summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-12-02 09:01:21 +0000
committer <>2014-12-04 16:11:25 +0000
commitbdab5265fcbf3f472545073a23f8999749a9f2b9 (patch)
treec6018dd03dea906f8f1fb5f105f05b71a7dc250a
downloadntp-dev-4.2.7p482.tar.gz
Imported from /home/lorry/working-area/delta_ntp/ntp-dev-4.2.7p482.tar.gz.ntp-dev-4.2.7p482
-rw-r--r--COPYRIGHT197
-rw-r--r--ChangeLog3835
-rw-r--r--CommitLog186461
-rw-r--r--CommitLog-4.1.06152
-rw-r--r--INSTALL178
-rw-r--r--Makefile.am158
-rw-r--r--Makefile.in1063
-rw-r--r--NEWS451
-rw-r--r--NOTES.y2kfixes107
-rw-r--r--README148
-rw-r--r--README.bk7
-rw-r--r--README.hackers15
-rw-r--r--README.patches49
-rw-r--r--README.refclocks50
-rw-r--r--README.versions27
-rw-r--r--TODO122
-rw-r--r--WHERE-TO-START42
-rw-r--r--aclocal.m41165
-rw-r--r--adjtimed/Makefile.am21
-rw-r--r--adjtimed/Makefile.in890
-rw-r--r--adjtimed/README22
-rw-r--r--adjtimed/adjtimed.c491
-rw-r--r--bincheck.mf17
-rwxr-xr-xbootstrap171
-rwxr-xr-xbuild200
-rw-r--r--check-libopts.mf14
-rw-r--r--clockstuff/Makefile.am17
-rw-r--r--clockstuff/Makefile.in749
-rw-r--r--clockstuff/README21
-rw-r--r--clockstuff/chutest.c821
-rw-r--r--clockstuff/propdelay.c548
-rw-r--r--conf/README13
-rw-r--r--conf/baldwin.conf10
-rw-r--r--conf/beauregard.conf23
-rw-r--r--conf/grundoon.conf36
-rw-r--r--conf/malarky.conf24
-rw-r--r--conf/pogo.conf44
-rw-r--r--conf/rackety.conf56
-rw-r--r--config.h.in1734
-rwxr-xr-xconfigure39034
-rw-r--r--configure.ac4363
-rw-r--r--deps-ver1
-rw-r--r--depsver.mf60
-rw-r--r--dot.emacs19
-rwxr-xr-xflock-build133
-rw-r--r--html/access.html50
-rw-r--r--html/accopt.html91
-rw-r--r--html/assoc.html81
-rw-r--r--html/audio.html180
-rw-r--r--html/authentic.html65
-rw-r--r--html/authopt.html95
-rw-r--r--html/autokey.html215
-rw-r--r--html/bugs.html27
-rw-r--r--html/build.html57
-rw-r--r--html/clock.html65
-rw-r--r--html/clockopt.html59
-rw-r--r--html/cluster.html32
-rw-r--r--html/comdex.html29
-rw-r--r--html/config.html40
-rw-r--r--html/confopt.html103
-rw-r--r--html/copyright.html102
-rw-r--r--html/debug.html93
-rw-r--r--html/decode.html692
-rw-r--r--html/discipline.html49
-rw-r--r--html/discover.html75
-rw-r--r--html/drivers/driver1.html50
-rw-r--r--html/drivers/driver10.html53
-rw-r--r--html/drivers/driver11.html85
-rw-r--r--html/drivers/driver12.html49
-rw-r--r--html/drivers/driver16.html34
-rw-r--r--html/drivers/driver18.html82
-rw-r--r--html/drivers/driver19.html59
-rw-r--r--html/drivers/driver20.html432
-rw-r--r--html/drivers/driver22.html98
-rw-r--r--html/drivers/driver26.html56
-rw-r--r--html/drivers/driver27.html248
-rw-r--r--html/drivers/driver28.html147
-rw-r--r--html/drivers/driver29.html1093
-rw-r--r--html/drivers/driver3.html76
-rw-r--r--html/drivers/driver30.html86
-rw-r--r--html/drivers/driver31.html61
-rw-r--r--html/drivers/driver32.html40
-rw-r--r--html/drivers/driver33.html36
-rw-r--r--html/drivers/driver34.html82
-rw-r--r--html/drivers/driver35.html51
-rw-r--r--html/drivers/driver36.html150
-rw-r--r--html/drivers/driver37.html54
-rw-r--r--html/drivers/driver38.html133
-rw-r--r--html/drivers/driver39.html115
-rw-r--r--html/drivers/driver4.html76
-rw-r--r--html/drivers/driver40.html264
-rw-r--r--html/drivers/driver42.html33
-rw-r--r--html/drivers/driver43.html68
-rw-r--r--html/drivers/driver44.html91
-rw-r--r--html/drivers/driver45.html32
-rw-r--r--html/drivers/driver46.html184
-rw-r--r--html/drivers/driver5.html83
-rw-r--r--html/drivers/driver6.html80
-rw-r--r--html/drivers/driver7.html144
-rw-r--r--html/drivers/driver8.html278
-rw-r--r--html/drivers/driver9.html60
-rw-r--r--html/drivers/icons/home.gifbin0 -> 983 bytes
-rw-r--r--html/drivers/icons/mail2.gifbin0 -> 287 bytes
-rw-r--r--html/drivers/mx4200data.html1077
-rw-r--r--html/drivers/oncore-shmem.html164
-rw-r--r--html/drivers/scripts/footer.txt9
-rw-r--r--html/drivers/scripts/style.css64
-rw-r--r--html/drivers/tf582_4.html74
-rw-r--r--html/extern.html48
-rw-r--r--html/filter.html34
-rw-r--r--html/hints.html22
-rw-r--r--html/hints/a-ux195
-rw-r--r--html/hints/aix76
-rw-r--r--html/hints/bsdi65
-rw-r--r--html/hints/changes13
-rw-r--r--html/hints/decosf140
-rw-r--r--html/hints/decosf254
-rw-r--r--html/hints/freebsd15
-rw-r--r--html/hints/hpux158
-rw-r--r--html/hints/linux5
-rw-r--r--html/hints/mpeix50
-rw-r--r--html/hints/notes-xntp-v3119
-rw-r--r--html/hints/parse105
-rw-r--r--html/hints/refclocks35
-rw-r--r--html/hints/rs600056
-rw-r--r--html/hints/sco.html29
-rw-r--r--html/hints/sgi74
-rw-r--r--html/hints/solaris-dosynctodr.html321
-rw-r--r--html/hints/solaris.html236
-rw-r--r--html/hints/solaris.xtra.402311836
-rw-r--r--html/hints/solaris.xtra.409584974
-rw-r--r--html/hints/solaris.xtra.S99ntpd21
-rw-r--r--html/hints/solaris.xtra.patchfreq85
-rw-r--r--html/hints/sun415
-rw-r--r--html/hints/svr4-dell8
-rw-r--r--html/hints/svr4_package33
-rw-r--r--html/hints/todo4
-rw-r--r--html/hints/vxworks.html88
-rw-r--r--html/hints/winnt.html90
-rw-r--r--html/history.html74
-rw-r--r--html/howto.html109
-rw-r--r--html/huffpuff.html31
-rw-r--r--html/icons/home.gifbin0 -> 983 bytes
-rw-r--r--html/icons/mail2.gifbin0 -> 287 bytes
-rw-r--r--html/icons/sitemap.pngbin0 -> 2825 bytes
-rw-r--r--html/index.html73
-rw-r--r--html/kern.html32
-rw-r--r--html/kernpps.html49
-rw-r--r--html/keygen.html116
-rw-r--r--html/leap.html24
-rw-r--r--html/miscopt.html177
-rw-r--r--html/monopt.html566
-rw-r--r--html/msyslog.html129
-rw-r--r--html/ntp-wait.html33
-rw-r--r--html/ntp_conf.html174
-rw-r--r--html/ntpd.html176
-rw-r--r--html/ntpdate.html81
-rw-r--r--html/ntpdc.html178
-rw-r--r--html/ntpdsim.html71
-rw-r--r--html/ntpdsim_new.html110
-rw-r--r--html/ntpq.html654
-rw-r--r--html/ntptime.html46
-rw-r--r--html/ntptrace.html42
-rw-r--r--html/orphan.html42
-rw-r--r--html/parsedata.html352
-rw-r--r--html/parsenew.html199
-rw-r--r--html/pic/9400n.jpgbin0 -> 5736 bytes
-rw-r--r--html/pic/alice11.gifbin0 -> 18003 bytes
-rw-r--r--html/pic/alice13.gifbin0 -> 11516 bytes
-rw-r--r--html/pic/alice15.gifbin0 -> 26328 bytes
-rw-r--r--html/pic/alice23.gifbin0 -> 7753 bytes
-rw-r--r--html/pic/alice31.gifbin0 -> 13824 bytes
-rw-r--r--html/pic/alice32.gifbin0 -> 17168 bytes
-rw-r--r--html/pic/alice35.gifbin0 -> 8968 bytes
-rw-r--r--html/pic/alice38.gifbin0 -> 10296 bytes
-rw-r--r--html/pic/alice44.gifbin0 -> 19897 bytes
-rw-r--r--html/pic/alice47.gifbin0 -> 10771 bytes
-rw-r--r--html/pic/alice51.gifbin0 -> 12403 bytes
-rw-r--r--html/pic/alice61.gifbin0 -> 11269 bytes
-rw-r--r--html/pic/barnstable.gifbin0 -> 2946 bytes
-rw-r--r--html/pic/beaver.gifbin0 -> 2831 bytes
-rw-r--r--html/pic/boom3.gifbin0 -> 11042 bytes
-rw-r--r--html/pic/boom3a.gifbin0 -> 18300 bytes
-rw-r--r--html/pic/boom4.gifbin0 -> 16157 bytes
-rw-r--r--html/pic/broad.gifbin0 -> 5728 bytes
-rw-r--r--html/pic/bustardfly.gifbin0 -> 8476 bytes
-rw-r--r--html/pic/c51.jpgbin0 -> 16429 bytes
-rw-r--r--html/pic/description.jpgbin0 -> 34170 bytes
-rw-r--r--html/pic/discipline.gifbin0 -> 6836 bytes
-rw-r--r--html/pic/dogsnake.gifbin0 -> 5445 bytes
-rw-r--r--html/pic/driver29.gifbin0 -> 11723 bytes
-rw-r--r--html/pic/driver43_1.gifbin0 -> 38818 bytes
-rw-r--r--html/pic/driver43_2.jpgbin0 -> 6576 bytes
-rw-r--r--html/pic/fg6021.gifbin0 -> 21593 bytes
-rw-r--r--html/pic/fg6039.jpgbin0 -> 7383 bytes
-rw-r--r--html/pic/fig_3_1.gifbin0 -> 10428 bytes
-rw-r--r--html/pic/flatheads.gifbin0 -> 13085 bytes
-rw-r--r--html/pic/flt1.gifbin0 -> 9045 bytes
-rw-r--r--html/pic/flt2.gifbin0 -> 3148 bytes
-rw-r--r--html/pic/flt3.gifbin0 -> 1847 bytes
-rw-r--r--html/pic/flt4.gifbin0 -> 3876 bytes
-rw-r--r--html/pic/flt5.gifbin0 -> 10609 bytes
-rw-r--r--html/pic/flt6.gifbin0 -> 15563 bytes
-rw-r--r--html/pic/flt7.gifbin0 -> 7848 bytes
-rw-r--r--html/pic/flt8.gifbin0 -> 5969 bytes
-rw-r--r--html/pic/flt9.gifbin0 -> 8948 bytes
-rw-r--r--html/pic/freq1211.gifbin0 -> 11428 bytes
-rw-r--r--html/pic/gadget.jpgbin0 -> 26341 bytes
-rw-r--r--html/pic/gps167.jpgbin0 -> 15589 bytes
-rw-r--r--html/pic/group.gifbin0 -> 2756 bytes
-rw-r--r--html/pic/hornraba.gifbin0 -> 8790 bytes
-rw-r--r--html/pic/igclock.gifbin0 -> 8985 bytes
-rwxr-xr-xhtml/pic/neoclock4x.gifbin0 -> 14977 bytes
-rw-r--r--html/pic/offset1211.gifbin0 -> 25493 bytes
-rw-r--r--html/pic/oncore_evalbig.gifbin0 -> 7904 bytes
-rw-r--r--html/pic/oncore_remoteant.jpgbin0 -> 4828 bytes
-rw-r--r--html/pic/oncore_utplusbig.gifbin0 -> 10117 bytes
-rw-r--r--html/pic/oz2.gifbin0 -> 8225 bytes
-rw-r--r--html/pic/panda.gifbin0 -> 1660 bytes
-rw-r--r--html/pic/pd_om006.gifbin0 -> 16704 bytes
-rw-r--r--html/pic/pd_om011.gifbin0 -> 12848 bytes
-rw-r--r--html/pic/peer.gifbin0 -> 4936 bytes
-rw-r--r--html/pic/pogo.gifbin0 -> 1918 bytes
-rw-r--r--html/pic/pogo1a.gifbin0 -> 18769 bytes
-rw-r--r--html/pic/pogo3a.gifbin0 -> 3657 bytes
-rw-r--r--html/pic/pogo4.gifbin0 -> 3213 bytes
-rw-r--r--html/pic/pogo5.gifbin0 -> 5819 bytes
-rw-r--r--html/pic/pogo6.gifbin0 -> 5902 bytes
-rw-r--r--html/pic/pogo7.gifbin0 -> 13817 bytes
-rw-r--r--html/pic/pogo8.gifbin0 -> 7820 bytes
-rw-r--r--html/pic/pzf509.jpgbin0 -> 13011 bytes
-rw-r--r--html/pic/pzf511.jpgbin0 -> 20370 bytes
-rw-r--r--html/pic/rabbit.gifbin0 -> 3342 bytes
-rw-r--r--html/pic/radio2.jpgbin0 -> 17006 bytes
-rw-r--r--html/pic/sheepb.jpgbin0 -> 20295 bytes
-rw-r--r--html/pic/stack1a.jpgbin0 -> 29655 bytes
-rw-r--r--html/pic/stats.gifbin0 -> 12168 bytes
-rw-r--r--html/pic/sx5.gifbin0 -> 20470 bytes
-rw-r--r--html/pic/thunderbolt.jpgbin0 -> 38718 bytes
-rw-r--r--html/pic/time1.gifbin0 -> 4507 bytes
-rw-r--r--html/pic/tonea.gifbin0 -> 12002 bytes
-rw-r--r--html/pic/tribeb.gifbin0 -> 30287 bytes
-rw-r--r--html/pic/wingdorothy.gifbin0 -> 10849 bytes
-rw-r--r--html/poll.html26
-rw-r--r--html/pps.html47
-rw-r--r--html/prefer.html93
-rw-r--r--html/quick.html45
-rw-r--r--html/rate.html67
-rw-r--r--html/rdebug.html29
-rw-r--r--html/refclock.html93
-rw-r--r--html/release.html72
-rw-r--r--html/scripts/accopt.txt5
-rw-r--r--html/scripts/audio.txt7
-rw-r--r--html/scripts/authopt.txt12
-rw-r--r--html/scripts/clockopt.txt5
-rw-r--r--html/scripts/command.txt7
-rw-r--r--html/scripts/config.txt5
-rw-r--r--html/scripts/confopt.txt12
-rw-r--r--html/scripts/external.txt19
-rw-r--r--html/scripts/footer.txt9
-rw-r--r--html/scripts/hand.txt11
-rw-r--r--html/scripts/install.txt10
-rw-r--r--html/scripts/manual.txt13
-rw-r--r--html/scripts/misc.txt9
-rw-r--r--html/scripts/miscopt.txt21
-rw-r--r--html/scripts/monopt.txt6
-rw-r--r--html/scripts/refclock.txt7
-rw-r--r--html/scripts/special.txt17
-rw-r--r--html/scripts/style.css64
-rw-r--r--html/select.html41
-rw-r--r--html/sitemap.html33
-rw-r--r--html/sntp.html78
-rw-r--r--html/stats.html70
-rw-r--r--html/tickadj.html45
-rw-r--r--html/warp.html60
-rw-r--r--html/xleave.html30
-rw-r--r--include/Makefile.am77
-rw-r--r--include/Makefile.in808
-rw-r--r--include/README4
-rw-r--r--include/adjtime.h63
-rw-r--r--include/ascii.h96
-rw-r--r--include/audio.h14
-rw-r--r--include/binio.h76
-rw-r--r--include/declcond.h21
-rw-r--r--include/gps.h53
-rw-r--r--include/hopf6039.h144
-rw-r--r--include/icom.h87
-rw-r--r--include/ieee754io.h78
-rw-r--r--include/intreswork.h29
-rw-r--r--include/iosignal.h58
-rw-r--r--include/isc/Makefile.am5
-rw-r--r--include/isc/Makefile.in586
-rw-r--r--include/isc/mem.h68
-rw-r--r--include/l_stdlib.h224
-rw-r--r--include/lib_strbuf.h32
-rw-r--r--include/libntp.h16
-rw-r--r--include/mbg_gps166.h582
-rw-r--r--include/mx4200.h40
-rw-r--r--include/ntif.h98
-rw-r--r--include/ntp.h895
-rw-r--r--include/ntp_assert.h108
-rw-r--r--include/ntp_calendar.h416
-rw-r--r--include/ntp_cmdargs.h1
-rw-r--r--include/ntp_config.h322
-rw-r--r--include/ntp_control.h192
-rw-r--r--include/ntp_crypto.h190
-rw-r--r--include/ntp_datum.h30
-rw-r--r--include/ntp_debug.h27
-rw-r--r--include/ntp_filegen.h56
-rw-r--r--include/ntp_fp.h420
-rw-r--r--include/ntp_if.h27
-rw-r--r--include/ntp_intres.h45
-rw-r--r--include/ntp_io.h97
-rw-r--r--include/ntp_libopts.h14
-rw-r--r--include/ntp_lineedit.h13
-rw-r--r--include/ntp_lists.h443
-rw-r--r--include/ntp_machine.h297
-rw-r--r--include/ntp_malloc.h61
-rw-r--r--include/ntp_md5.h40
-rw-r--r--include/ntp_net.h238
-rw-r--r--include/ntp_prio_q.h83
-rw-r--r--include/ntp_proto.h6
-rw-r--r--include/ntp_random.h14
-rw-r--r--include/ntp_refclock.h239
-rw-r--r--include/ntp_request.h952
-rw-r--r--include/ntp_rfc2553.h253
-rw-r--r--include/ntp_select.h35
-rw-r--r--include/ntp_stdlib.h267
-rw-r--r--include/ntp_string.h37
-rw-r--r--include/ntp_syscall.h56
-rw-r--r--include/ntp_syslog.h85
-rw-r--r--include/ntp_tty.h103
-rw-r--r--include/ntp_types.h288
-rw-r--r--include/ntp_unixtime.h47
-rw-r--r--include/ntp_worker.h162
-rw-r--r--include/ntp_workimpl.h30
-rw-r--r--include/ntpd.h568
-rw-r--r--include/ntpsim.h146
-rw-r--r--include/parse.h421
-rw-r--r--include/parse_conf.h83
-rw-r--r--include/recvbuff.h123
-rw-r--r--include/refclock_atom.h15
-rw-r--r--include/ssl_applink.c74
-rw-r--r--include/timepps-SCO.h503
-rw-r--r--include/timepps-Solaris.h569
-rw-r--r--include/timepps-SunOS.h504
-rw-r--r--include/timespecops.h393
-rw-r--r--include/timetoa.h83
-rw-r--r--include/timevalops.h446
-rw-r--r--include/trimble.h160
-rw-r--r--include/vint64ops.h28
-rw-r--r--includes.mf6
-rwxr-xr-xinstall-sh323
-rw-r--r--kernel/Makefile.am1
-rw-r--r--kernel/Makefile.in731
-rw-r--r--kernel/sys/Makefile.am2
-rw-r--r--kernel/sys/Makefile.in584
-rw-r--r--kernel/sys/README11
-rw-r--r--kernel/sys/bsd_audioirig.h101
-rw-r--r--kernel/sys/i8253.h48
-rw-r--r--kernel/sys/parsestreams.h133
-rw-r--r--kernel/sys/pcl720.h95
-rw-r--r--kernel/sys/ppsclock.h64
-rw-r--r--kernel/sys/timex.h309
-rw-r--r--kernel/sys/tpro.h34
-rw-r--r--kernel/sys/tt560_api.h489
-rw-r--r--lib/isc/Atffile5
-rw-r--r--lib/isc/alpha/include/isc/atomic.h184
-rw-r--r--lib/isc/api8
-rw-r--r--lib/isc/app_api.c136
-rw-r--r--lib/isc/assertions.c139
-rw-r--r--lib/isc/backtrace-emptytbl.c34
-rw-r--r--lib/isc/backtrace.c285
-rw-r--r--lib/isc/base32.c373
-rw-r--r--lib/isc/base64.c252
-rw-r--r--lib/isc/bitstring.c127
-rw-r--r--lib/isc/buffer.c489
-rw-r--r--lib/isc/bufferlist.c64
-rw-r--r--lib/isc/commandline.c225
-rw-r--r--lib/isc/entropy.c1277
-rw-r--r--lib/isc/error.c106
-rw-r--r--lib/isc/event.c88
-rw-r--r--lib/isc/fsaccess.c102
-rw-r--r--lib/isc/hash.c404
-rw-r--r--lib/isc/heap.c265
-rw-r--r--lib/isc/hex.c201
-rw-r--r--lib/isc/hmacmd5.c149
-rw-r--r--lib/isc/hmacsha.c594
-rw-r--r--lib/isc/httpd.c1028
-rw-r--r--lib/isc/ia64/include/isc/atomic.h100
-rw-r--r--lib/isc/include/isc/Makefile439
-rw-r--r--lib/isc/include/isc/app.h375
-rw-r--r--lib/isc/include/isc/assertions.h126
-rw-r--r--lib/isc/include/isc/backtrace.h131
-rw-r--r--lib/isc/include/isc/base32.h128
-rw-r--r--lib/isc/include/isc/base64.h99
-rw-r--r--lib/isc/include/isc/bind9.h30
-rw-r--r--lib/isc/include/isc/bitstring.h157
-rw-r--r--lib/isc/include/isc/boolean.h31
-rw-r--r--lib/isc/include/isc/buffer.h904
-rw-r--r--lib/isc/include/isc/bufferlist.h86
-rw-r--r--lib/isc/include/isc/commandline.h50
-rw-r--r--lib/isc/include/isc/entropy.h314
-rw-r--r--lib/isc/include/isc/error.h63
-rw-r--r--lib/isc/include/isc/event.h121
-rw-r--r--lib/isc/include/isc/eventclass.h53
-rw-r--r--lib/isc/include/isc/file.h304
-rw-r--r--lib/isc/include/isc/formatcheck.h40
-rw-r--r--lib/isc/include/isc/fsaccess.h178
-rw-r--r--lib/isc/include/isc/hash.h185
-rw-r--r--lib/isc/include/isc/heap.h170
-rw-r--r--lib/isc/include/isc/hex.h98
-rw-r--r--lib/isc/include/isc/hmacmd5.h72
-rw-r--r--lib/isc/include/isc/hmacsha.h169
-rw-r--r--lib/isc/include/isc/httpd.h64
-rw-r--r--lib/isc/include/isc/interfaceiter.h138
-rw-r--r--lib/isc/include/isc/ipv6.h148
-rw-r--r--lib/isc/include/isc/iterated_hash.h47
-rw-r--r--lib/isc/include/isc/lang.h33
-rw-r--r--lib/isc/include/isc/lex.h431
-rw-r--r--lib/isc/include/isc/lfsr.h130
-rw-r--r--lib/isc/include/isc/lib.h50
-rw-r--r--lib/isc/include/isc/list.h197
-rw-r--r--lib/isc/include/isc/log.h914
-rw-r--r--lib/isc/include/isc/magic.h41
-rw-r--r--lib/isc/include/isc/md5.h83
-rw-r--r--lib/isc/include/isc/mem.h750
-rw-r--r--lib/isc/include/isc/msgcat.h131
-rw-r--r--lib/isc/include/isc/msgs.h195
-rw-r--r--lib/isc/include/isc/mutexblock.h71
-rw-r--r--lib/isc/include/isc/namespace.h171
-rw-r--r--lib/isc/include/isc/netaddr.h180
-rw-r--r--lib/isc/include/isc/netscope.h43
-rw-r--r--lib/isc/include/isc/ondestroy.h116
-rw-r--r--lib/isc/include/isc/os.h38
-rw-r--r--lib/isc/include/isc/parseint.h64
-rw-r--r--lib/isc/include/isc/platform.h40
-rw-r--r--lib/isc/include/isc/platform.h.in367
-rw-r--r--lib/isc/include/isc/portset.h141
-rw-r--r--lib/isc/include/isc/print.h87
-rw-r--r--lib/isc/include/isc/queue.h100
-rw-r--r--lib/isc/include/isc/quota.h119
-rw-r--r--lib/isc/include/isc/radix.h240
-rw-r--r--lib/isc/include/isc/random.h62
-rw-r--r--lib/isc/include/isc/ratelimiter.h134
-rw-r--r--lib/isc/include/isc/refcount.h233
-rw-r--r--lib/isc/include/isc/region.h99
-rw-r--r--lib/isc/include/isc/resource.h97
-rw-r--r--lib/isc/include/isc/result.h109
-rw-r--r--lib/isc/include/isc/resultclass.h51
-rw-r--r--lib/isc/include/isc/rwlock.h135
-rw-r--r--lib/isc/include/isc/serial.h75
-rw-r--r--lib/isc/include/isc/sha1.h68
-rw-r--r--lib/isc/include/isc/sha2.h145
-rw-r--r--lib/isc/include/isc/sockaddr.h241
-rw-r--r--lib/isc/include/isc/socket.h1168
-rw-r--r--lib/isc/include/isc/stats.h121
-rw-r--r--lib/isc/include/isc/stdio.h77
-rw-r--r--lib/isc/include/isc/stdlib.h40
-rw-r--r--lib/isc/include/isc/string.h231
-rw-r--r--lib/isc/include/isc/symtab.h139
-rw-r--r--lib/isc/include/isc/task.h796
-rw-r--r--lib/isc/include/isc/taskpool.h157
-rw-r--r--lib/isc/include/isc/timer.h431
-rw-r--r--lib/isc/include/isc/types.h129
-rw-r--r--lib/isc/include/isc/util.h238
-rw-r--r--lib/isc/include/isc/version.h28
-rw-r--r--lib/isc/include/isc/xml.h41
-rw-r--r--lib/isc/inet_aton.c196
-rw-r--r--lib/isc/inet_ntop.c202
-rw-r--r--lib/isc/inet_pton.c215
-rw-r--r--lib/isc/iterated_hash.c48
-rw-r--r--lib/isc/lex.c959
-rw-r--r--lib/isc/lfsr.c161
-rw-r--r--lib/isc/lib.c103
-rw-r--r--lib/isc/log.c1766
-rw-r--r--lib/isc/md5.c277
-rw-r--r--lib/isc/mem.c2477
-rw-r--r--lib/isc/mem_api.c303
-rw-r--r--lib/isc/mips/include/isc/atomic.h98
-rw-r--r--lib/isc/mutexblock.c58
-rw-r--r--lib/isc/netaddr.c435
-rw-r--r--lib/isc/netscope.c76
-rw-r--r--lib/isc/nls/msgcat.c131
-rw-r--r--lib/isc/noatomic/include/isc/atomic.h24
-rw-r--r--lib/isc/nothreads/condition.c24
-rw-r--r--lib/isc/nothreads/include/isc/condition.h59
-rw-r--r--lib/isc/nothreads/include/isc/mutex.h39
-rw-r--r--lib/isc/nothreads/include/isc/once.h32
-rw-r--r--lib/isc/nothreads/include/isc/thread.h35
-rw-r--r--lib/isc/nothreads/mutex.c25
-rw-r--r--lib/isc/nothreads/thread.c28
-rw-r--r--lib/isc/ondestroy.c85
-rw-r--r--lib/isc/parseint.c72
-rw-r--r--lib/isc/portset.c143
-rw-r--r--lib/isc/powerpc/include/isc/atomic.h197
-rw-r--r--lib/isc/print.c624
-rw-r--r--lib/isc/pthreads/condition.c74
-rw-r--r--lib/isc/pthreads/include/isc/condition.h65
-rw-r--r--lib/isc/pthreads/include/isc/mutex.h145
-rw-r--r--lib/isc/pthreads/include/isc/once.h50
-rw-r--r--lib/isc/pthreads/include/isc/thread.h60
-rw-r--r--lib/isc/pthreads/mutex.c284
-rw-r--r--lib/isc/pthreads/thread.c76
-rw-r--r--lib/isc/quota.c101
-rw-r--r--lib/isc/radix.c706
-rw-r--r--lib/isc/random.c113
-rw-r--r--lib/isc/ratelimiter.c328
-rw-r--r--lib/isc/refcount.c37
-rw-r--r--lib/isc/region.c45
-rw-r--r--lib/isc/result.c214
-rw-r--r--lib/isc/rwlock.c809
-rw-r--r--lib/isc/serial.c59
-rw-r--r--lib/isc/sha1.c354
-rw-r--r--lib/isc/sha2.c1449
-rw-r--r--lib/isc/sockaddr.c506
-rw-r--r--lib/isc/socket_api.c231
-rw-r--r--lib/isc/sparc64/include/isc/atomic.h127
-rw-r--r--lib/isc/stats.c326
-rw-r--r--lib/isc/string.c271
-rw-r--r--lib/isc/strtoul.c129
-rw-r--r--lib/isc/symtab.c301
-rw-r--r--lib/isc/task.c1813
-rw-r--r--lib/isc/task_api.c244
-rw-r--r--lib/isc/task_p.h39
-rw-r--r--lib/isc/taskpool.c185
-rw-r--r--lib/isc/tests/Atffile5
-rw-r--r--lib/isc/tests/hash_test.c1805
-rw-r--r--lib/isc/tests/isctest.c178
-rw-r--r--lib/isc/tests/isctest.h57
-rw-r--r--lib/isc/tests/queue_test.c144
-rw-r--r--lib/isc/tests/socket_test.c255
-rw-r--r--lib/isc/tests/symtab_test.c147
-rw-r--r--lib/isc/tests/task_test.c416
-rw-r--r--lib/isc/tests/taskpool_test.c211
-rw-r--r--lib/isc/timer.c1072
-rw-r--r--lib/isc/timer_api.c144
-rw-r--r--lib/isc/timer_p.h31
-rw-r--r--lib/isc/unix/app.c946
-rw-r--r--lib/isc/unix/dir.c256
-rw-r--r--lib/isc/unix/entropy.c605
-rw-r--r--lib/isc/unix/errno2result.c122
-rw-r--r--lib/isc/unix/errno2result.h41
-rw-r--r--lib/isc/unix/file.c544
-rw-r--r--lib/isc/unix/fsaccess.c93
-rw-r--r--lib/isc/unix/ifiter_getifaddrs.c257
-rw-r--r--lib/isc/unix/ifiter_ioctl.c1018
-rw-r--r--lib/isc/unix/ifiter_sysctl.c321
-rw-r--r--lib/isc/unix/include/isc/Makefile415
-rw-r--r--lib/isc/unix/include/isc/dir.h94
-rw-r--r--lib/isc/unix/include/isc/int.h55
-rw-r--r--lib/isc/unix/include/isc/keyboard.h52
-rw-r--r--lib/isc/unix/include/isc/net.h364
-rw-r--r--lib/isc/unix/include/isc/netdb.h57
-rw-r--r--lib/isc/unix/include/isc/offset.h46
-rw-r--r--lib/isc/unix/include/isc/stat.h52
-rw-r--r--lib/isc/unix/include/isc/stdtime.h64
-rw-r--r--lib/isc/unix/include/isc/strerror.h45
-rw-r--r--lib/isc/unix/include/isc/syslog.h47
-rw-r--r--lib/isc/unix/include/isc/time.h334
-rw-r--r--lib/isc/unix/interfaceiter.c327
-rw-r--r--lib/isc/unix/ipv6.c27
-rw-r--r--lib/isc/unix/keyboard.c126
-rw-r--r--lib/isc/unix/net.c522
-rw-r--r--lib/isc/unix/os.c94
-rw-r--r--lib/isc/unix/resource.c231
-rw-r--r--lib/isc/unix/socket.c6011
-rw-r--r--lib/isc/unix/socket_p.h33
-rw-r--r--lib/isc/unix/stdio.c129
-rw-r--r--lib/isc/unix/stdtime.c86
-rw-r--r--lib/isc/unix/strerror.c76
-rw-r--r--lib/isc/unix/syslog.c84
-rw-r--r--lib/isc/unix/time.c420
-rw-r--r--lib/isc/version.c28
-rw-r--r--lib/isc/win32/DLLMain.c58
-rw-r--r--lib/isc/win32/app.c260
-rw-r--r--lib/isc/win32/condition.c258
-rw-r--r--lib/isc/win32/dir.c312
-rw-r--r--lib/isc/win32/entropy.c307
-rw-r--r--lib/isc/win32/errno2result.c113
-rw-r--r--lib/isc/win32/errno2result.h40
-rw-r--r--lib/isc/win32/file.c619
-rw-r--r--lib/isc/win32/fsaccess.c375
-rw-r--r--lib/isc/win32/include/isc/bind_registry.h50
-rw-r--r--lib/isc/win32/include/isc/bindevt.h91
-rw-r--r--lib/isc/win32/include/isc/condition.h67
-rw-r--r--lib/isc/win32/include/isc/dir.h83
-rw-r--r--lib/isc/win32/include/isc/int.h56
-rw-r--r--lib/isc/win32/include/isc/ipv6.h124
-rw-r--r--lib/isc/win32/include/isc/keyboard.h47
-rw-r--r--lib/isc/win32/include/isc/mutex.h55
-rw-r--r--lib/isc/win32/include/isc/net.h374
-rw-r--r--lib/isc/win32/include/isc/netdb.h54
-rw-r--r--lib/isc/win32/include/isc/ntgroups.h35
-rw-r--r--lib/isc/win32/include/isc/ntpaths.h72
-rw-r--r--lib/isc/win32/include/isc/offset.h44
-rw-r--r--lib/isc/win32/include/isc/once.h43
-rw-r--r--lib/isc/win32/include/isc/platform.h117
-rw-r--r--lib/isc/win32/include/isc/stat.h68
-rw-r--r--lib/isc/win32/include/isc/stdtime.h62
-rw-r--r--lib/isc/win32/include/isc/strerror.h42
-rw-r--r--lib/isc/win32/include/isc/syslog.h45
-rw-r--r--lib/isc/win32/include/isc/thread.h100
-rw-r--r--lib/isc/win32/include/isc/time.h291
-rw-r--r--lib/isc/win32/include/isc/win32os.h71
-rw-r--r--lib/isc/win32/interfaceiter.c807
-rw-r--r--lib/isc/win32/ipv6.c27
-rw-r--r--lib/isc/win32/keyboard.c89
-rw-r--r--lib/isc/win32/libgen.h25
-rw-r--r--lib/isc/win32/libisc.def583
-rw-r--r--lib/isc/win32/libisc.dsp802
-rw-r--r--lib/isc/win32/libisc.dsw29
-rw-r--r--lib/isc/win32/libisc.mak2055
-rw-r--r--lib/isc/win32/net.c338
-rw-r--r--lib/isc/win32/netdb.h187
-rw-r--r--lib/isc/win32/ntgroups.c186
-rw-r--r--lib/isc/win32/ntpaths.c147
-rw-r--r--lib/isc/win32/once.c54
-rw-r--r--lib/isc/win32/os.c45
-rw-r--r--lib/isc/win32/resource.c72
-rw-r--r--lib/isc/win32/socket.c3967
-rw-r--r--lib/isc/win32/stdio.c117
-rw-r--r--lib/isc/win32/stdtime.c37
-rw-r--r--lib/isc/win32/strerror.c459
-rw-r--r--lib/isc/win32/syslog.c181
-rw-r--r--lib/isc/win32/syslog.h76
-rw-r--r--lib/isc/win32/thread.c94
-rw-r--r--lib/isc/win32/time.c320
-rw-r--r--lib/isc/win32/unistd.h60
-rw-r--r--lib/isc/win32/version.c28
-rw-r--r--lib/isc/win32/win32os.c101
-rw-r--r--lib/isc/x86_32/include/isc/atomic.h176
-rw-r--r--lib/isc/x86_64/include/isc/atomic.h123
-rw-r--r--libjsmn/LICENSE20
-rw-r--r--libjsmn/Makefile27
-rw-r--r--libjsmn/README.md161
-rw-r--r--libjsmn/jsmn.c268
-rw-r--r--libjsmn/jsmn.h67
-rw-r--r--libjsmn/jsmn_test.c409
-rw-r--r--libntp/Makefile.am125
-rw-r--r--libntp/Makefile.in1557
-rw-r--r--libntp/README5
-rw-r--r--libntp/a_md5encrypt.c137
-rw-r--r--libntp/adjtime.c386
-rw-r--r--libntp/adjtimex.c15
-rw-r--r--libntp/atoint.c51
-rw-r--r--libntp/atolfp.c122
-rw-r--r--libntp/atouint.c42
-rw-r--r--libntp/audio.c504
-rw-r--r--libntp/authkeys.c687
-rw-r--r--libntp/authreadkeys.c207
-rw-r--r--libntp/authusekey.c34
-rw-r--r--libntp/bsd_strerror.c49
-rw-r--r--libntp/buftvtots.c38
-rw-r--r--libntp/caljulian.c41
-rw-r--r--libntp/caltontp.c68
-rw-r--r--libntp/calyearstart.c88
-rw-r--r--libntp/clocktime.c149
-rw-r--r--libntp/clocktypes.c123
-rw-r--r--libntp/decodenetnum.c83
-rw-r--r--libntp/dofptoa.c159
-rw-r--r--libntp/dolfptoa.c174
-rw-r--r--libntp/emalloc.c96
-rw-r--r--libntp/findconfig.c74
-rw-r--r--libntp/getopt.c108
-rw-r--r--libntp/hextoint.c42
-rw-r--r--libntp/hextolfp.c68
-rw-r--r--libntp/humandate.c60
-rw-r--r--libntp/icom.c164
-rw-r--r--libntp/iosignal.c546
-rw-r--r--libntp/lib_strbuf.c39
-rw-r--r--libntp/machines.c533
-rw-r--r--libntp/mktime.c310
-rw-r--r--libntp/modetoa.c35
-rw-r--r--libntp/mstolfp.c101
-rw-r--r--libntp/msyslog.c572
-rw-r--r--libntp/netof.c55
-rw-r--r--libntp/ntp_calendar.c1615
-rw-r--r--libntp/ntp_intres.c1143
-rw-r--r--libntp/ntp_libopts.c58
-rw-r--r--libntp/ntp_lineedit.c246
-rw-r--r--libntp/ntp_random.c499
-rw-r--r--libntp/ntp_rfc2553.c576
-rw-r--r--libntp/ntp_worker.c340
-rw-r--r--libntp/numtoa.c59
-rw-r--r--libntp/numtohost.c43
-rw-r--r--libntp/octtoint.c36
-rw-r--r--libntp/prettydate.c231
-rw-r--r--libntp/recvbuff.c326
-rw-r--r--libntp/refnumtoa.c36
-rw-r--r--libntp/snprintf.c2132
-rw-r--r--libntp/socket.c218
-rw-r--r--libntp/socktoa.c170
-rw-r--r--libntp/socktohost.c110
-rw-r--r--libntp/ssl_init.c187
-rw-r--r--libntp/statestr.c501
-rw-r--r--libntp/strdup.c30
-rw-r--r--libntp/strl_obsd.c123
-rw-r--r--libntp/syssignal.c188
-rw-r--r--libntp/systime.c570
-rw-r--r--libntp/systime_s.c2
-rw-r--r--libntp/timetoa.c109
-rw-r--r--libntp/timevalops.c297
-rw-r--r--libntp/uglydate.c51
-rw-r--r--libntp/vint64ops.c284
-rw-r--r--libntp/work_fork.c526
-rw-r--r--libntp/work_thread.c726
-rw-r--r--libntp/ymd2yd.c26
-rw-r--r--libparse/Makefile.am145
-rw-r--r--libparse/Makefile.in935
-rw-r--r--libparse/README96
-rw-r--r--libparse/binio.c156
-rw-r--r--libparse/clk_computime.c219
-rw-r--r--libparse/clk_dcf7000.c214
-rw-r--r--libparse/clk_hopf6021.c283
-rw-r--r--libparse/clk_meinberg.c776
-rw-r--r--libparse/clk_rawdcf.c658
-rw-r--r--libparse/clk_rcc8000.c198
-rw-r--r--libparse/clk_schmid.c258
-rw-r--r--libparse/clk_sel240x.c178
-rw-r--r--libparse/clk_trimtaip.c223
-rw-r--r--libparse/clk_trimtsip.c463
-rw-r--r--libparse/clk_varitext.c271
-rw-r--r--libparse/clk_wharton.c181
-rw-r--r--libparse/data_mbg.c539
-rw-r--r--libparse/gpstolfp.c77
-rw-r--r--libparse/ieee754io.c614
-rw-r--r--libparse/info_trimble.c94
-rw-r--r--libparse/mfp_mul.c207
-rw-r--r--libparse/mkinfo_rcmd.sed8
-rw-r--r--libparse/mkinfo_scmd.sed15
-rw-r--r--libparse/parse.c945
-rw-r--r--libparse/parse_conf.c182
-rw-r--r--libparse/parsesolaris.c1202
-rw-r--r--libparse/parsestreams.c1367
-rw-r--r--libparse/trim_info.c70
-rw-r--r--ntpd/Makefile.am438
-rw-r--r--ntpd/Makefile.in1790
-rw-r--r--ntpd/check_y2k.c626
-rw-r--r--ntpd/cmd_args.c202
-rw-r--r--ntpd/complete.conf.in67
-rw-r--r--ntpd/declcond.h21
-rw-r--r--ntpd/invoke-ntp.conf.menu1
-rw-r--r--ntpd/invoke-ntp.conf.texi2634
-rw-r--r--ntpd/invoke-ntp.keys.menu1
-rw-r--r--ntpd/invoke-ntp.keys.texi125
-rw-r--r--ntpd/invoke-ntpd.menu1
-rw-r--r--ntpd/invoke-ntpd.texi702
-rw-r--r--ntpd/jupiter.h255
-rw-r--r--ntpd/keyword-gen-utd1
-rw-r--r--ntpd/keyword-gen.c752
-rw-r--r--ntpd/ntp.conf.5man3004
-rw-r--r--ntpd/ntp.conf.5mdoc2808
-rw-r--r--ntpd/ntp.conf.def2795
-rw-r--r--ntpd/ntp.conf.html2625
-rw-r--r--ntpd/ntp.conf.man.in3004
-rw-r--r--ntpd/ntp.conf.mdoc.in2808
-rw-r--r--ntpd/ntp.conf.texi49
-rw-r--r--ntpd/ntp.keys.5man173
-rw-r--r--ntpd/ntp.keys.5mdoc158
-rw-r--r--ntpd/ntp.keys.def152
-rw-r--r--ntpd/ntp.keys.html200
-rw-r--r--ntpd/ntp.keys.man.in173
-rw-r--r--ntpd/ntp.keys.mdoc.in158
-rw-r--r--ntpd/ntp.keys.texi49
-rw-r--r--ntpd/ntp_config.c4957
-rw-r--r--ntpd/ntp_control.c4942
-rw-r--r--ntpd/ntp_crypto.c3987
-rw-r--r--ntpd/ntp_filegen.c645
-rw-r--r--ntpd/ntp_io.c4688
-rw-r--r--ntpd/ntp_keyword.h1032
-rw-r--r--ntpd/ntp_leapsec.c1009
-rw-r--r--ntpd/ntp_leapsec.h218
-rw-r--r--ntpd/ntp_loopfilter.c1224
-rw-r--r--ntpd/ntp_monitor.c496
-rw-r--r--ntpd/ntp_parser.c3612
-rw-r--r--ntpd/ntp_parser.h459
-rw-r--r--ntpd/ntp_parser.y1638
-rw-r--r--ntpd/ntp_peer.c1038
-rw-r--r--ntpd/ntp_prio_q.c238
-rw-r--r--ntpd/ntp_proto.c4168
-rw-r--r--ntpd/ntp_refclock.c1332
-rw-r--r--ntpd/ntp_request.c2670
-rw-r--r--ntpd/ntp_restrict.c669
-rw-r--r--ntpd/ntp_scanner.c755
-rw-r--r--ntpd/ntp_scanner.h130
-rw-r--r--ntpd/ntp_signd.c239
-rw-r--r--ntpd/ntp_timer.c570
-rw-r--r--ntpd/ntp_util.c1031
-rw-r--r--ntpd/ntpd-opts.c1952
-rw-r--r--ntpd/ntpd-opts.def611
-rw-r--r--ntpd/ntpd-opts.h458
-rw-r--r--ntpd/ntpd.1ntpdman987
-rw-r--r--ntpd/ntpd.1ntpdmdoc891
-rw-r--r--ntpd/ntpd.c1478
-rw-r--r--ntpd/ntpd.html995
-rw-r--r--ntpd/ntpd.man.in987
-rw-r--r--ntpd/ntpd.mdoc.in891
-rw-r--r--ntpd/ntpd.texi113
-rw-r--r--ntpd/ntpdbase-opts.def463
-rw-r--r--ntpd/ntpsim.c657
-rw-r--r--ntpd/ppsapi_timepps.h26
-rw-r--r--ntpd/refclock_acts.c911
-rw-r--r--ntpd/refclock_arbiter.c479
-rw-r--r--ntpd/refclock_arc.c1587
-rw-r--r--ntpd/refclock_as2201.c388
-rw-r--r--ntpd/refclock_atom.c239
-rw-r--r--ntpd/refclock_bancomm.c548
-rw-r--r--ntpd/refclock_chronolog.c343
-rw-r--r--ntpd/refclock_chu.c1683
-rw-r--r--ntpd/refclock_conf.c326
-rw-r--r--ntpd/refclock_datum.c782
-rw-r--r--ntpd/refclock_dumbclock.c383
-rw-r--r--ntpd/refclock_fg.c335
-rw-r--r--ntpd/refclock_gpsdjson.c1341
-rw-r--r--ntpd/refclock_gpsvme.c253
-rw-r--r--ntpd/refclock_heath.c450
-rw-r--r--ntpd/refclock_hopfpci.c258
-rw-r--r--ntpd/refclock_hopfser.c372
-rw-r--r--ntpd/refclock_hpgps.c623
-rw-r--r--ntpd/refclock_irig.c1045
-rw-r--r--ntpd/refclock_jjy.c1743
-rw-r--r--ntpd/refclock_jupiter.c1121
-rw-r--r--ntpd/refclock_leitch.c600
-rw-r--r--ntpd/refclock_local.c230
-rw-r--r--ntpd/refclock_msfees.c1450
-rw-r--r--ntpd/refclock_mx4200.c1631
-rw-r--r--ntpd/refclock_neoclock4x.c1124
-rw-r--r--ntpd/refclock_nmea.c1956
-rw-r--r--ntpd/refclock_oncore.c4083
-rw-r--r--ntpd/refclock_palisade.c1253
-rw-r--r--ntpd/refclock_palisade.h201
-rw-r--r--ntpd/refclock_parse.c6204
-rw-r--r--ntpd/refclock_pcf.c227
-rw-r--r--ntpd/refclock_pst.c318
-rw-r--r--ntpd/refclock_ripencc.c5255
-rw-r--r--ntpd/refclock_shm.c571
-rw-r--r--ntpd/refclock_tpro.c208
-rw-r--r--ntpd/refclock_true.c986
-rw-r--r--ntpd/refclock_tsyncpci.c912
-rw-r--r--ntpd/refclock_tt560.c270
-rw-r--r--ntpd/refclock_ulink.c568
-rw-r--r--ntpd/refclock_wwv.c2709
-rw-r--r--ntpd/refclock_wwvb.c603
-rw-r--r--ntpd/refclock_zyfer.c331
-rw-r--r--ntpdate/Makefile.am40
-rw-r--r--ntpdate/Makefile.in913
-rw-r--r--ntpdate/README7
-rw-r--r--ntpdate/ntpdate.c2246
-rw-r--r--ntpdate/ntpdate.h108
-rw-r--r--ntpdc/Makefile.am151
-rw-r--r--ntpdc/Makefile.in1180
-rw-r--r--ntpdc/README6
-rw-r--r--ntpdc/invoke-ntpdc.menu1
-rw-r--r--ntpdc/invoke-ntpdc.texi349
-rw-r--r--ntpdc/layout.std447
-rwxr-xr-xntpdc/nl.pl43
-rw-r--r--ntpdc/nl.pl.in43
-rw-r--r--ntpdc/nl_in.c3
-rw-r--r--ntpdc/ntpdc-layout.c22
-rw-r--r--ntpdc/ntpdc-opts.c1173
-rw-r--r--ntpdc/ntpdc-opts.def812
-rw-r--r--ntpdc/ntpdc-opts.h294
-rw-r--r--ntpdc/ntpdc.1ntpdcman874
-rw-r--r--ntpdc/ntpdc.1ntpdcmdoc809
-rw-r--r--ntpdc/ntpdc.c1934
-rw-r--r--ntpdc/ntpdc.h67
-rw-r--r--ntpdc/ntpdc.html515
-rw-r--r--ntpdc/ntpdc.man.in874
-rw-r--r--ntpdc/ntpdc.mdoc.in809
-rw-r--r--ntpdc/ntpdc.texi88
-rw-r--r--ntpdc/ntpdc_ops.c3142
-rw-r--r--ntpq/Makefile.am131
-rw-r--r--ntpq/Makefile.in1208
-rw-r--r--ntpq/README6
-rw-r--r--ntpq/invoke-ntpq.menu1
-rw-r--r--ntpq/invoke-ntpq.texi1086
-rw-r--r--ntpq/libntpq.c771
-rw-r--r--ntpq/libntpq.h109
-rw-r--r--ntpq/libntpq_subs.c52
-rw-r--r--ntpq/ntpq-opts.c1160
-rw-r--r--ntpq/ntpq-opts.def938
-rw-r--r--ntpq/ntpq-opts.h294
-rw-r--r--ntpq/ntpq-subs.c3875
-rw-r--r--ntpq/ntpq.1ntpqman1408
-rw-r--r--ntpq/ntpq.1ntpqmdoc954
-rw-r--r--ntpq/ntpq.c3415
-rw-r--r--ntpq/ntpq.h154
-rw-r--r--ntpq/ntpq.html1814
-rw-r--r--ntpq/ntpq.man.in1408
-rw-r--r--ntpq/ntpq.mdoc.in954
-rw-r--r--ntpq/ntpq.texi834
-rw-r--r--ntpsnmpd/Makefile.am117
-rw-r--r--ntpsnmpd/Makefile.in1141
-rw-r--r--ntpsnmpd/README40
-rw-r--r--ntpsnmpd/invoke-ntpsnmpd.menu1
-rw-r--r--ntpsnmpd/invoke-ntpsnmpd.texi188
-rw-r--r--ntpsnmpd/netsnmp_daemonize.c270
-rw-r--r--ntpsnmpd/ntpSnmpSubagentObject.c549
-rw-r--r--ntpsnmpd/ntpSnmpSubagentObject.h81
-rw-r--r--ntpsnmpd/ntp_snmp.h34
-rw-r--r--ntpsnmpd/ntpsnmpd-opts.c910
-rw-r--r--ntpsnmpd/ntpsnmpd-opts.def146
-rw-r--r--ntpsnmpd/ntpsnmpd-opts.h243
-rw-r--r--ntpsnmpd/ntpsnmpd.1ntpsnmpdman203
-rw-r--r--ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc144
-rw-r--r--ntpsnmpd/ntpsnmpd.c118
-rw-r--r--ntpsnmpd/ntpsnmpd.html79
-rw-r--r--ntpsnmpd/ntpsnmpd.man.in203
-rw-r--r--ntpsnmpd/ntpsnmpd.mdoc.in144
-rw-r--r--ntpsnmpd/ntpsnmpd.texi53
-rw-r--r--ntpsnmpd/ntpv4-mib.mib892
-rw-r--r--packageinfo.sh107
-rw-r--r--parseutil/Makefile.am24
-rw-r--r--parseutil/Makefile.in752
-rw-r--r--parseutil/README16
-rw-r--r--parseutil/dcfd.c1872
-rw-r--r--parseutil/testdcf.c541
-rw-r--r--ports/winnt/include/arpa/inet.h4
-rw-r--r--ports/winnt/include/clockstuff.h44
-rw-r--r--ports/winnt/include/config.h554
-rw-r--r--ports/winnt/include/gaa_compat.h771
-rw-r--r--ports/winnt/include/hopf_PCI_io.h91
-rw-r--r--ports/winnt/include/netdb.h4
-rw-r--r--ports/winnt/include/ntp_iocompletionport.h27
-rw-r--r--ports/winnt/include/ntp_timer.h6
-rw-r--r--ports/winnt/include/ntservice.h31
-rw-r--r--ports/winnt/include/stdint.h244
-rw-r--r--ports/winnt/include/stdnoreturn.h61
-rw-r--r--ports/winnt/include/sys/ioctl.h11
-rw-r--r--ports/winnt/include/sys/param.h4
-rw-r--r--ports/winnt/include/sys/resource.h10
-rw-r--r--ports/winnt/include/sys/signal.h4
-rw-r--r--ports/winnt/include/sys/time.h25
-rw-r--r--ports/winnt/include/sys/wait.h4
-rw-r--r--ports/winnt/include/syslog.h82
-rw-r--r--ports/winnt/include/termios.h214
-rw-r--r--ports/winnt/include/timepps.h811
-rw-r--r--ports/winnt/include/unistd.h4
-rw-r--r--ports/winnt/include/win32_io.h7
-rw-r--r--ports/winnt/instsrv/instsrv.c461
-rw-r--r--ports/winnt/libntp/MSG00001.binbin0 -> 104 bytes
-rw-r--r--ports/winnt/libntp/SetSystemTime.c34
-rw-r--r--ports/winnt/libntp/getclock.c63
-rw-r--r--ports/winnt/libntp/messages.h199
-rw-r--r--ports/winnt/libntp/messages.mc161
-rw-r--r--ports/winnt/libntp/messages.rc2
-rw-r--r--ports/winnt/libntp/randfile.c109
-rw-r--r--ports/winnt/libntp/setpriority.c76
-rw-r--r--ports/winnt/libntp/syslog.c219
-rw-r--r--ports/winnt/libntp/termios.c789
-rw-r--r--ports/winnt/libntp/util_clockstuff.c26
-rw-r--r--ports/winnt/libntp/win32_io.c81
-rw-r--r--ports/winnt/ntpd/hopf_PCI_io.c335
-rw-r--r--ports/winnt/ntpd/nt_clockstuff.c1743
-rw-r--r--ports/winnt/ntpd/ntp_iocompletionport.c1639
-rw-r--r--ports/winnt/ntpd/ntservice.c321
-rw-r--r--ports/winnt/ntptrace/ntptrace.dsp153
-rw-r--r--ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h714
-rw-r--r--ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt52
-rw-r--r--ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c465
-rw-r--r--ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def9
-rw-r--r--ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h49
-rw-r--r--ports/winnt/ppsapi/loopback/src/sys/time.h18
-rw-r--r--ports/winnt/ppsapi/loopback/src/timepps.h805
-rw-r--r--ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c382
-rw-r--r--ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def9
-rw-r--r--ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h22
-rw-r--r--ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln19
-rw-r--r--ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj227
-rw-r--r--ports/winnt/ppsapi/skelprov/sys/time.h18
-rwxr-xr-xports/winnt/scripts/mkver.bat439
-rw-r--r--ports/winnt/vs2005/Instsrv.vcproj244
-rw-r--r--ports/winnt/vs2005/libntp.vcproj864
-rw-r--r--ports/winnt/vs2005/ntp.sln70
-rw-r--r--ports/winnt/vs2005/ntpd.vcproj1893
-rw-r--r--ports/winnt/vs2005/ntpdate.vcproj294
-rw-r--r--ports/winnt/vs2005/ntpdc.vcproj338
-rw-r--r--ports/winnt/vs2005/ntpkeygen.vcproj378
-rw-r--r--ports/winnt/vs2005/ntpq.vcproj338
-rw-r--r--ports/winnt/vs2008/instsrv/instsrv.vcproj258
-rw-r--r--ports/winnt/vs2008/libntp/libntp.vcproj948
-rw-r--r--ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj256
-rw-r--r--ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj335
-rw-r--r--ports/winnt/vs2008/ntp.sln90
-rw-r--r--ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj273
-rw-r--r--ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat39
-rw-r--r--ports/winnt/vs2008/ntpd/ntpd.vcproj1126
-rw-r--r--ports/winnt/vs2008/ntpdate/ntpdate.vcproj362
-rw-r--r--ports/winnt/vs2008/ntpdc/ntpdc.vcproj367
-rw-r--r--ports/winnt/vs2008/ntpq/ntpq.vcproj357
-rw-r--r--ports/winnt/vs2013/instsrv/instsrv.vcproj258
-rw-r--r--ports/winnt/vs2013/instsrv/instsrv.vcxproj680
-rw-r--r--ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters22
-rw-r--r--ports/winnt/vs2013/libntp/libntp.vcproj936
-rw-r--r--ports/winnt/vs2013/libntp/libntp.vcxproj740
-rw-r--r--ports/winnt/vs2013/libntp/libntp.vcxproj.filters568
-rw-r--r--ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj256
-rw-r--r--ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj583
-rw-r--r--ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters36
-rw-r--r--ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj335
-rw-r--r--ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj752
-rw-r--r--ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters36
-rw-r--r--ports/winnt/vs2013/ntp.sln166
-rw-r--r--ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj273
-rw-r--r--ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj531
-rw-r--r--ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters69
-rw-r--r--ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat39
-rw-r--r--ports/winnt/vs2013/ntpd/ntpd.vcproj1126
-rw-r--r--ports/winnt/vs2013/ntpd/ntpd.vcxproj1036
-rw-r--r--ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters559
-rw-r--r--ports/winnt/vs2013/ntpdate/ntpdate.vcproj362
-rw-r--r--ports/winnt/vs2013/ntpdate/ntpdate.vcxproj750
-rw-r--r--ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters72
-rw-r--r--ports/winnt/vs2013/ntpdc/ntpdc.vcproj367
-rw-r--r--ports/winnt/vs2013/ntpdc/ntpdc.vcxproj768
-rw-r--r--ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters45
-rw-r--r--ports/winnt/vs2013/ntpq/ntpq.vcproj357
-rw-r--r--ports/winnt/vs2013/ntpq/ntpq.vcxproj740
-rw-r--r--ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters42
-rw-r--r--readme.y2kfixes131
-rw-r--r--results.y2kfixes76
-rw-r--r--scripts/Makefile.am174
-rw-r--r--scripts/Makefile.in1025
-rw-r--r--scripts/README31
-rw-r--r--scripts/build/Makefile.am17
-rw-r--r--scripts/build/Makefile.in550
-rwxr-xr-xscripts/build/UpdatePoint331
-rwxr-xr-xscripts/build/VersionName61
-rwxr-xr-xscripts/build/check--help22
-rwxr-xr-xscripts/build/checkChangeLog29
-rwxr-xr-xscripts/build/checkHtmlFileDates16
-rwxr-xr-xscripts/build/fixautomakedepsmagic28
-rwxr-xr-xscripts/build/genCommitLog16
-rwxr-xr-xscripts/build/genver96
-rw-r--r--scripts/build/mkver.in38
-rwxr-xr-xscripts/build/updateBEDate53
-rw-r--r--scripts/calc_tickadj/Makefile.am104
-rw-r--r--scripts/calc_tickadj/Makefile.in865
-rw-r--r--scripts/calc_tickadj/calc_tickadj-opts60
-rw-r--r--scripts/calc_tickadj/calc_tickadj-opts.def60
-rw-r--r--scripts/calc_tickadj/calc_tickadj.1calc_tickadjman108
-rw-r--r--scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc84
-rw-r--r--scripts/calc_tickadj/calc_tickadj.html166
-rw-r--r--scripts/calc_tickadj/calc_tickadj.in59
-rw-r--r--scripts/calc_tickadj/calc_tickadj.man.in108
-rw-r--r--scripts/calc_tickadj/calc_tickadj.mdoc.in84
-rw-r--r--scripts/calc_tickadj/calc_tickadj.texi37
-rw-r--r--scripts/calc_tickadj/invoke-calc_tickadj.menu1
-rw-r--r--scripts/calc_tickadj/invoke-calc_tickadj.texi102
-rw-r--r--scripts/deprecated/freq_adj.in97
-rwxr-xr-xscripts/deprecated/hpadjtime.sh18
-rwxr-xr-xscripts/deprecated/html2man.in234
-rwxr-xr-xscripts/deprecated/ntp-close8
-rwxr-xr-xscripts/deprecated/ntp-groper95
-rwxr-xr-xscripts/deprecated/ntp-restart10
-rwxr-xr-xscripts/deprecated/ntp-status45
-rw-r--r--scripts/invoke-plot_summary.menu1
-rw-r--r--scripts/invoke-plot_summary.texi121
-rw-r--r--scripts/invoke-summary.menu1
-rw-r--r--scripts/invoke-summary.texi103
-rw-r--r--scripts/lib/Makefile.am5
-rw-r--r--scripts/lib/Makefile.in583
-rw-r--r--scripts/lib/NTP/Util.pm137
-rw-r--r--scripts/monitoring/README158
-rw-r--r--scripts/monitoring/loopwatch.config.SAMPLE89
-rw-r--r--scripts/monitoring/lr.pl151
-rw-r--r--scripts/monitoring/ntp.pl506
-rw-r--r--scripts/monitoring/ntploopstat458
-rw-r--r--scripts/monitoring/ntploopwatch1667
-rw-r--r--scripts/monitoring/ntptrap465
-rw-r--r--scripts/monitoring/timelocal.pl77
-rw-r--r--scripts/ntp-wait/Makefile.am96
-rw-r--r--scripts/ntp-wait/Makefile.in879
-rw-r--r--scripts/ntp-wait/invoke-ntp-wait.menu1
-rw-r--r--scripts/ntp-wait/invoke-ntp-wait.texi114
-rw-r--r--scripts/ntp-wait/ntp-wait-opts62
-rw-r--r--scripts/ntp-wait/ntp-wait-opts.def109
-rw-r--r--scripts/ntp-wait/ntp-wait.1ntp-waitman122
-rw-r--r--scripts/ntp-wait/ntp-wait.1ntp-waitmdoc95
-rw-r--r--scripts/ntp-wait/ntp-wait.html208
-rw-r--r--scripts/ntp-wait/ntp-wait.in66
-rw-r--r--scripts/ntp-wait/ntp-wait.man.in122
-rw-r--r--scripts/ntp-wait/ntp-wait.mdoc.in95
-rw-r--r--scripts/ntp-wait/ntp-wait.texi52
-rw-r--r--scripts/ntpsweep/Makefile.am102
-rw-r--r--scripts/ntpsweep/Makefile.in885
-rw-r--r--scripts/ntpsweep/invoke-ntpsweep.menu1
-rw-r--r--scripts/ntpsweep/invoke-ntpsweep.texi118
-rw-r--r--scripts/ntpsweep/ntpsweep-opts67
-rw-r--r--scripts/ntpsweep/ntpsweep-opts.def66
-rw-r--r--scripts/ntpsweep/ntpsweep.1ntpsweepman97
-rw-r--r--scripts/ntpsweep/ntpsweep.1ntpsweepmdoc75
-rw-r--r--scripts/ntpsweep/ntpsweep.html201
-rw-r--r--scripts/ntpsweep/ntpsweep.in204
-rw-r--r--scripts/ntpsweep/ntpsweep.man.in97
-rw-r--r--scripts/ntpsweep/ntpsweep.mdoc.in75
-rw-r--r--scripts/ntpsweep/ntpsweep.texi43
-rw-r--r--scripts/ntptrace/Makefile.am95
-rw-r--r--scripts/ntptrace/Makefile.in878
-rw-r--r--scripts/ntptrace/invoke-ntptrace.menu1
-rw-r--r--scripts/ntptrace/invoke-ntptrace.texi109
-rw-r--r--scripts/ntptrace/ntptrace-opts62
-rw-r--r--scripts/ntptrace/ntptrace-opts.def69
-rw-r--r--scripts/ntptrace/ntptrace.1ntptraceman114
-rw-r--r--scripts/ntptrace/ntptrace.1ntptracemdoc91
-rw-r--r--scripts/ntptrace/ntptrace.html180
-rwxr-xr-xscripts/ntptrace/ntptrace.in80
-rw-r--r--scripts/ntptrace/ntptrace.man.in114
-rw-r--r--scripts/ntptrace/ntptrace.mdoc.in91
-rw-r--r--scripts/ntptrace/ntptrace.texi40
-rw-r--r--scripts/ntpver.in7
-rw-r--r--scripts/plot_summary-opts73
-rw-r--r--scripts/plot_summary-opts.def83
-rw-r--r--scripts/plot_summary.1plot_summaryman114
-rw-r--r--scripts/plot_summary.1plot_summarymdoc88
-rw-r--r--scripts/plot_summary.html207
-rw-r--r--scripts/plot_summary.in329
-rw-r--r--scripts/plot_summary.man.in114
-rw-r--r--scripts/plot_summary.mdoc.in88
-rw-r--r--scripts/plot_summary.texi40
-rw-r--r--scripts/rc/README13
-rw-r--r--scripts/rc/ntpd88
-rw-r--r--scripts/rc/ntpwait15
-rw-r--r--scripts/rc/rc.d/TIMESYNC8
-rw-r--r--scripts/rc/rc.d/ntpd32
-rw-r--r--scripts/rc/rc.d/ntpwait21
-rw-r--r--scripts/stats/README39
-rw-r--r--scripts/stats/README.stats246
-rw-r--r--scripts/stats/README.timecodes149
-rwxr-xr-xscripts/stats/clock.awk431
-rwxr-xr-xscripts/stats/dupe.awk8
-rwxr-xr-xscripts/stats/ensemble.S5
-rwxr-xr-xscripts/stats/ensemble.awk17
-rwxr-xr-xscripts/stats/etf.S15
-rwxr-xr-xscripts/stats/etf.awk19
-rwxr-xr-xscripts/stats/itf.S5
-rwxr-xr-xscripts/stats/itf.awk19
-rwxr-xr-xscripts/stats/loop.S7
-rwxr-xr-xscripts/stats/loop.awk45
-rwxr-xr-xscripts/stats/loop_summary2
-rwxr-xr-xscripts/stats/peer.awk68
-rwxr-xr-xscripts/stats/psummary.awk82
-rwxr-xr-xscripts/stats/summary.sh88
-rwxr-xr-xscripts/stats/tdata.S5
-rwxr-xr-xscripts/stats/tdata.awk45
-rw-r--r--scripts/summary-opts69
-rw-r--r--scripts/summary-opts.def82
-rw-r--r--scripts/summary.1summaryman123
-rw-r--r--scripts/summary.1summarymdoc98
-rw-r--r--scripts/summary.html182
-rw-r--r--scripts/summary.in369
-rw-r--r--scripts/summary.man.in123
-rw-r--r--scripts/summary.mdoc.in98
-rw-r--r--scripts/summary.texi40
-rw-r--r--sntp/COPYRIGHT197
-rw-r--r--sntp/Makefile.am297
-rw-r--r--sntp/Makefile.in1578
-rw-r--r--sntp/aclocal.m41163
-rw-r--r--sntp/ag-tpl/0-old/Mdoc.pm515
-rw-r--r--sntp/ag-tpl/0-old/agman-cmd.tpl58
-rw-r--r--sntp/ag-tpl/0-old/agmdoc-cmd.tpl46
-rw-r--r--sntp/ag-tpl/0-old/cmd-doc.tlib1079
-rw-r--r--sntp/ag-tpl/0-old/mdoc-synopsis.tlib92
-rwxr-xr-xsntp/ag-tpl/0-old/mdoc2man193
-rwxr-xr-xsntp/ag-tpl/0-old/mdoc2texi162
-rw-r--r--sntp/ag-tpl/0-old/perlopt.tpl188
-rw-r--r--sntp/bincheck.mf17
-rw-r--r--sntp/check-libntp.mf15
-rw-r--r--sntp/check-libopts.mf14
-rw-r--r--sntp/config.h.in1011
-rwxr-xr-xsntp/configure32730
-rw-r--r--sntp/configure.ac151
-rw-r--r--sntp/crypto.c192
-rw-r--r--sntp/crypto.h32
-rw-r--r--sntp/data_formats.h8
-rw-r--r--sntp/deps-ver1
-rw-r--r--sntp/depsver.mf60
-rw-r--r--sntp/include/Makefile.am19
-rw-r--r--sntp/include/Makefile.in512
-rw-r--r--sntp/include/autogen-version.def4
-rw-r--r--sntp/include/copyright.def30
-rw-r--r--sntp/include/debug-opt.def29
-rw-r--r--sntp/include/homerc.def9
-rw-r--r--sntp/include/ntp.lic18
-rw-r--r--sntp/include/version.def1
-rw-r--r--sntp/include/version.texi3
-rw-r--r--sntp/includes.mf6
-rwxr-xr-xsntp/install-sh323
-rw-r--r--sntp/invoke-sntp.menu1
-rw-r--r--sntp/invoke-sntp.texi426
-rw-r--r--sntp/kod_management.c301
-rw-r--r--sntp/kod_management.h20
-rw-r--r--sntp/libevent/ChangeLog736
-rw-r--r--sntp/libevent/ChangeLog-1.4231
-rw-r--r--sntp/libevent/ChangeLog-2.01280
-rw-r--r--sntp/libevent/Doxyfile257
-rw-r--r--sntp/libevent/LICENSE99
-rw-r--r--sntp/libevent/Makefile.am301
-rw-r--r--sntp/libevent/Makefile.in2293
-rw-r--r--sntp/libevent/Makefile.nmake82
-rw-r--r--sntp/libevent/README218
-rw-r--r--sntp/libevent/WIN32-Code/nmake/evconfig-private.h6
-rw-r--r--sntp/libevent/WIN32-Code/nmake/event2/event-config.h360
-rw-r--r--sntp/libevent/WIN32-Code/tree.h1354
-rw-r--r--sntp/libevent/aclocal.m41142
-rw-r--r--sntp/libevent/arc4random.c556
-rwxr-xr-xsntp/libevent/autogen.sh15
-rw-r--r--sntp/libevent/buffer.c3375
-rw-r--r--sntp/libevent/buffer_iocp.c326
-rw-r--r--sntp/libevent/bufferevent-internal.h450
-rw-r--r--sntp/libevent/bufferevent.c984
-rw-r--r--sntp/libevent/bufferevent_async.c684
-rw-r--r--sntp/libevent/bufferevent_filter.c518
-rw-r--r--sntp/libevent/bufferevent_openssl.c1502
-rw-r--r--sntp/libevent/bufferevent_pair.c327
-rw-r--r--sntp/libevent/bufferevent_ratelim.c1092
-rw-r--r--sntp/libevent/bufferevent_sock.c709
-rwxr-xr-xsntp/libevent/build-aux/compile143
-rwxr-xr-xsntp/libevent/build-aux/config.guess1517
-rwxr-xr-xsntp/libevent/build-aux/config.sub1756
-rwxr-xr-xsntp/libevent/build-aux/depcomp630
-rwxr-xr-xsntp/libevent/build-aux/install-sh520
-rwxr-xr-xsntp/libevent/build-aux/ltmain.sh9636
-rwxr-xr-xsntp/libevent/build-aux/missing376
-rwxr-xr-xsntp/libevent/build-aux/ylwrap222
-rw-r--r--sntp/libevent/changelist-internal.h102
-rw-r--r--sntp/libevent/compat/sys/queue.h488
-rw-r--r--sntp/libevent/config.h.in632
-rwxr-xr-xsntp/libevent/configure22030
-rw-r--r--sntp/libevent/configure.ac919
-rw-r--r--sntp/libevent/defer-internal.h70
-rw-r--r--sntp/libevent/devpoll.c311
-rw-r--r--sntp/libevent/epoll.c541
-rw-r--r--sntp/libevent/epoll_sub.c66
-rw-r--r--sntp/libevent/epolltable-internal.h1166
-rw-r--r--sntp/libevent/evbuffer-internal.h339
-rw-r--r--sntp/libevent/evconfig-private.h49
-rw-r--r--sntp/libevent/evconfig-private.h.in48
-rw-r--r--sntp/libevent/evdns.c4709
-rw-r--r--sntp/libevent/event-internal.h474
-rw-r--r--sntp/libevent/event.c3862
-rw-r--r--sntp/libevent/event_iocp.c294
-rwxr-xr-xsntp/libevent/event_rpcgen.py1728
-rw-r--r--sntp/libevent/event_tagging.c591
-rw-r--r--sntp/libevent/evmap-internal.h117
-rw-r--r--sntp/libevent/evmap.c1055
-rw-r--r--sntp/libevent/evport.c451
-rw-r--r--sntp/libevent/evrpc-internal.h204
-rw-r--r--sntp/libevent/evrpc.c1171
-rw-r--r--sntp/libevent/evsignal-internal.h65
-rw-r--r--sntp/libevent/evthread-internal.h385
-rw-r--r--sntp/libevent/evthread.c464
-rw-r--r--sntp/libevent/evthread_pthread.c191
-rw-r--r--sntp/libevent/evthread_win32.c341
-rw-r--r--sntp/libevent/evutil.c2649
-rw-r--r--sntp/libevent/evutil_rand.c206
-rw-r--r--sntp/libevent/evutil_time.c488
-rw-r--r--sntp/libevent/ht-internal.h488
-rw-r--r--sntp/libevent/http-internal.h204
-rw-r--r--sntp/libevent/http.c4814
-rw-r--r--sntp/libevent/include/evdns.h45
-rw-r--r--sntp/libevent/include/event.h85
-rw-r--r--sntp/libevent/include/event2/buffer.h1081
-rw-r--r--sntp/libevent/include/event2/buffer_compat.h115
-rw-r--r--sntp/libevent/include/event2/bufferevent.h994
-rw-r--r--sntp/libevent/include/event2/bufferevent_compat.h100
-rw-r--r--sntp/libevent/include/event2/bufferevent_ssl.h134
-rw-r--r--sntp/libevent/include/event2/bufferevent_struct.h116
-rw-r--r--sntp/libevent/include/event2/dns.h701
-rw-r--r--sntp/libevent/include/event2/dns_compat.h336
-rw-r--r--sntp/libevent/include/event2/dns_struct.h80
-rw-r--r--sntp/libevent/include/event2/event.h1669
-rw-r--r--sntp/libevent/include/event2/event_compat.h230
-rw-r--r--sntp/libevent/include/event2/event_struct.h180
-rw-r--r--sntp/libevent/include/event2/http.h1140
-rw-r--r--sntp/libevent/include/event2/http_compat.h90
-rw-r--r--sntp/libevent/include/event2/http_struct.h152
-rw-r--r--sntp/libevent/include/event2/keyvalq_struct.h80
-rw-r--r--sntp/libevent/include/event2/listener.h171
-rw-r--r--sntp/libevent/include/event2/rpc.h596
-rw-r--r--sntp/libevent/include/event2/rpc_compat.h61
-rw-r--r--sntp/libevent/include/event2/rpc_struct.h100
-rw-r--r--sntp/libevent/include/event2/tag.h146
-rw-r--r--sntp/libevent/include/event2/tag_compat.h49
-rw-r--r--sntp/libevent/include/event2/thread.h253
-rw-r--r--sntp/libevent/include/event2/util.h768
-rw-r--r--sntp/libevent/include/event2/visibility.h55
-rw-r--r--sntp/libevent/include/evhttp.h45
-rw-r--r--sntp/libevent/include/evrpc.h45
-rw-r--r--sntp/libevent/include/evutil.h39
-rw-r--r--sntp/libevent/include/include.am46
-rw-r--r--sntp/libevent/iocp-internal.h201
-rw-r--r--sntp/libevent/ipv6-internal.h83
-rw-r--r--sntp/libevent/kqueue-internal.h39
-rw-r--r--sntp/libevent/kqueue.c549
-rw-r--r--sntp/libevent/libevent.pc.in16
-rw-r--r--sntp/libevent/libevent_openssl.pc.in16
-rw-r--r--sntp/libevent/libevent_pthreads.pc.in16
-rw-r--r--sntp/libevent/listener.c882
-rw-r--r--sntp/libevent/log-internal.h83
-rw-r--r--sntp/libevent/log.c253
-rw-r--r--sntp/libevent/m4/ac_backport_259_ssizet.m43
-rw-r--r--sntp/libevent/m4/libevent_openssl.m447
-rw-r--r--sntp/libevent/m4/libtool.m47831
-rw-r--r--sntp/libevent/m4/ltoptions.m4369
-rw-r--r--sntp/libevent/m4/ltsugar.m4123
-rw-r--r--sntp/libevent/m4/ltversion.m423
-rw-r--r--sntp/libevent/m4/lt~obsolete.m498
-rw-r--r--sntp/libevent/m4/ntp_pkg_config.m427
-rw-r--r--sntp/libevent/m4/openldap-thread-check.m4683
-rw-r--r--sntp/libevent/m4/openldap.m41131
-rw-r--r--sntp/libevent/make-event-config.sed23
-rw-r--r--sntp/libevent/minheap-internal.h188
-rw-r--r--sntp/libevent/mm-internal.h87
-rw-r--r--sntp/libevent/poll.c341
-rw-r--r--sntp/libevent/ratelim-internal.h105
-rw-r--r--sntp/libevent/sample/dns-example.c248
-rw-r--r--sntp/libevent/sample/event-read-fifo.c162
-rw-r--r--sntp/libevent/sample/hello-world.c141
-rw-r--r--sntp/libevent/sample/hostcheck.c217
-rw-r--r--sntp/libevent/sample/hostcheck.h30
-rw-r--r--sntp/libevent/sample/http-server.c415
-rw-r--r--sntp/libevent/sample/https-client.c426
-rw-r--r--sntp/libevent/sample/include.am51
-rw-r--r--sntp/libevent/sample/le-proxy.c288
-rw-r--r--sntp/libevent/sample/openssl_hostname_validation.c172
-rw-r--r--sntp/libevent/sample/openssl_hostname_validation.h56
-rw-r--r--sntp/libevent/sample/signal-test.c75
-rw-r--r--sntp/libevent/sample/time-test.c107
-rw-r--r--sntp/libevent/select.c346
-rw-r--r--sntp/libevent/signal.c479
-rw-r--r--sntp/libevent/strlcpy-internal.h22
-rw-r--r--sntp/libevent/strlcpy.c75
-rw-r--r--sntp/libevent/test/Makefile.nmake79
-rw-r--r--sntp/libevent/test/bench.c207
-rw-r--r--sntp/libevent/test/bench_cascade.c188
-rw-r--r--sntp/libevent/test/bench_http.c195
-rw-r--r--sntp/libevent/test/bench_httpclient.c230
-rwxr-xr-xsntp/libevent/test/check-dumpevents.py54
-rw-r--r--sntp/libevent/test/include.am145
-rw-r--r--sntp/libevent/test/regress.c3309
-rw-r--r--sntp/libevent/test/regress.gen.c1
-rw-r--r--sntp/libevent/test/regress.gen.h1
-rw-r--r--sntp/libevent/test/regress.h132
-rw-r--r--sntp/libevent/test/regress.rpc25
-rw-r--r--sntp/libevent/test/regress_buffer.c2240
-rw-r--r--sntp/libevent/test/regress_bufferevent.c1014
-rw-r--r--sntp/libevent/test/regress_dns.c1922
-rw-r--r--sntp/libevent/test/regress_et.c208
-rw-r--r--sntp/libevent/test/regress_finalize.c346
-rw-r--r--sntp/libevent/test/regress_http.c3893
-rw-r--r--sntp/libevent/test/regress_iocp.c352
-rw-r--r--sntp/libevent/test/regress_listener.c214
-rw-r--r--sntp/libevent/test/regress_main.c462
-rw-r--r--sntp/libevent/test/regress_minheap.c98
-rw-r--r--sntp/libevent/test/regress_rpc.c905
-rw-r--r--sntp/libevent/test/regress_ssl.c477
-rw-r--r--sntp/libevent/test/regress_testutils.c219
-rw-r--r--sntp/libevent/test/regress_testutils.h66
-rw-r--r--sntp/libevent/test/regress_thread.c584
-rw-r--r--sntp/libevent/test/regress_thread.h48
-rw-r--r--sntp/libevent/test/regress_util.c1411
-rw-r--r--sntp/libevent/test/regress_zlib.c345
-rwxr-xr-xsntp/libevent/test/rpcgen_wrapper.sh52
-rw-r--r--sntp/libevent/test/test-changelist.c224
-rw-r--r--sntp/libevent/test/test-closed.c117
-rw-r--r--sntp/libevent/test/test-dumpevents.c179
-rw-r--r--sntp/libevent/test/test-eof.c124
-rw-r--r--sntp/libevent/test/test-fdleak.c249
-rw-r--r--sntp/libevent/test/test-init.c65
-rw-r--r--sntp/libevent/test/test-ratelim.c602
-rw-r--r--sntp/libevent/test/test-time.c113
-rw-r--r--sntp/libevent/test/test-weof.c117
-rwxr-xr-xsntp/libevent/test/test.sh144
-rw-r--r--sntp/libevent/test/tinytest.c460
-rw-r--r--sntp/libevent/test/tinytest.h98
-rw-r--r--sntp/libevent/test/tinytest_local.h12
-rw-r--r--sntp/libevent/test/tinytest_macros.h184
-rw-r--r--sntp/libevent/time-internal.h101
-rw-r--r--sntp/libevent/util-internal.h479
-rw-r--r--sntp/libevent/whatsnew-2.0.txt609
-rw-r--r--sntp/libevent/whatsnew-2.1.txt639
-rw-r--r--sntp/libevent/win32select.c388
-rw-r--r--sntp/libopts/COPYING.gplv3674
-rw-r--r--sntp/libopts/COPYING.lgplv3165
-rw-r--r--sntp/libopts/COPYING.mbsd26
-rw-r--r--sntp/libopts/MakeDefs.inc0
-rw-r--r--sntp/libopts/Makefile.am60
-rw-r--r--sntp/libopts/Makefile.in733
-rw-r--r--sntp/libopts/README122
-rw-r--r--sntp/libopts/ag-char-map.h526
-rw-r--r--sntp/libopts/alias.c116
-rw-r--r--sntp/libopts/ao-strs.c374
-rw-r--r--sntp/libopts/ao-strs.h330
-rw-r--r--sntp/libopts/autoopts.c397
-rw-r--r--sntp/libopts/autoopts.h484
-rw-r--r--sntp/libopts/autoopts/options.h1253
-rw-r--r--sntp/libopts/autoopts/project.h77
-rw-r--r--sntp/libopts/autoopts/usage-txt.h657
-rw-r--r--sntp/libopts/boolean.c95
-rw-r--r--sntp/libopts/check.c177
-rw-r--r--sntp/libopts/compat/_Noreturn.h10
-rw-r--r--sntp/libopts/compat/compat.h383
-rw-r--r--sntp/libopts/compat/pathfind.c283
-rw-r--r--sntp/libopts/compat/snprintf.c62
-rw-r--r--sntp/libopts/compat/strchr.c66
-rw-r--r--sntp/libopts/compat/strdup.c22
-rw-r--r--sntp/libopts/compat/windows-config.h144
-rw-r--r--sntp/libopts/configfile.c1382
-rw-r--r--sntp/libopts/cook.c325
-rw-r--r--sntp/libopts/enum.c652
-rw-r--r--sntp/libopts/env.c267
-rw-r--r--sntp/libopts/file.c201
-rw-r--r--sntp/libopts/find.c780
-rw-r--r--sntp/libopts/genshell.c847
-rw-r--r--sntp/libopts/genshell.h209
-rw-r--r--sntp/libopts/gettext.h288
-rw-r--r--sntp/libopts/init.c298
-rw-r--r--sntp/libopts/intprops.h320
-rw-r--r--sntp/libopts/libopts.c46
-rw-r--r--sntp/libopts/load.c588
-rw-r--r--sntp/libopts/m4/libopts.m4592
-rw-r--r--sntp/libopts/m4/liboptschk.m427
-rw-r--r--sntp/libopts/m4/stdnoreturn.m441
-rw-r--r--sntp/libopts/makeshell.c951
-rw-r--r--sntp/libopts/nested.c936
-rw-r--r--sntp/libopts/numeric.c179
-rw-r--r--sntp/libopts/option-value-type.c156
-rw-r--r--sntp/libopts/option-value-type.h60
-rw-r--r--sntp/libopts/option-xat-attribute.c148
-rw-r--r--sntp/libopts/option-xat-attribute.h57
-rw-r--r--sntp/libopts/parse-duration.c604
-rw-r--r--sntp/libopts/parse-duration.h90
-rw-r--r--sntp/libopts/pgusage.c187
-rw-r--r--sntp/libopts/proto.h146
-rw-r--r--sntp/libopts/putshell.c511
-rw-r--r--sntp/libopts/reset.c141
-rw-r--r--sntp/libopts/restore.c223
-rw-r--r--sntp/libopts/save.c809
-rw-r--r--sntp/libopts/sort.c340
-rw-r--r--sntp/libopts/stack.c267
-rw-r--r--sntp/libopts/stdnoreturn.in.h50
-rw-r--r--sntp/libopts/streqvcmp.c284
-rw-r--r--sntp/libopts/text_mmap.c379
-rw-r--r--sntp/libopts/time.c143
-rw-r--r--sntp/libopts/tokenize.c339
-rw-r--r--sntp/libopts/usage.c1336
-rw-r--r--sntp/libopts/version.c237
-rw-r--r--sntp/loc/README17
-rw-r--r--sntp/loc/darwin14
-rw-r--r--sntp/loc/debian17
-rw-r--r--sntp/loc/freebsd14
-rw-r--r--sntp/loc/legacy17
-rw-r--r--sntp/loc/netbsd14
-rw-r--r--sntp/loc/redhat17
-rw-r--r--sntp/loc/solaris16
-rw-r--r--sntp/log.c38
-rw-r--r--sntp/log.h27
-rw-r--r--sntp/m4/define_dir.m435
-rw-r--r--sntp/m4/hms_search_lib.m430
-rw-r--r--sntp/m4/libtool.m47831
-rw-r--r--sntp/m4/ltoptions.m4369
-rw-r--r--sntp/m4/ltsugar.m4123
-rw-r--r--sntp/m4/ltversion.m423
-rw-r--r--sntp/m4/lt~obsolete.m498
-rw-r--r--sntp/m4/ntp_cacheversion.m4129
-rw-r--r--sntp/m4/ntp_compiler.m4195
-rw-r--r--sntp/m4/ntp_crosscompile.m48
-rw-r--r--sntp/m4/ntp_debug.m422
-rw-r--r--sntp/m4/ntp_dir_sep.m424
-rw-r--r--sntp/m4/ntp_facilitynames.m424
-rw-r--r--sntp/m4/ntp_googletest.m453
-rw-r--r--sntp/m4/ntp_ipv6.m4528
-rw-r--r--sntp/m4/ntp_lib_m.m417
-rw-r--r--sntp/m4/ntp_libevent.m4150
-rw-r--r--sntp/m4/ntp_libntp.m41137
-rw-r--r--sntp/m4/ntp_lineeditlibs.m4136
-rw-r--r--sntp/m4/ntp_locinfo.m4129
-rw-r--r--sntp/m4/ntp_openssl.m4372
-rw-r--r--sntp/m4/ntp_pkg_config.m427
-rw-r--r--sntp/m4/ntp_prog_cc.m421
-rw-r--r--sntp/m4/ntp_rlimit.m466
-rw-r--r--sntp/m4/ntp_sntp.m429
-rw-r--r--sntp/m4/ntp_sysexits.m411
-rw-r--r--sntp/m4/ntp_ver_suffix.m413
-rw-r--r--sntp/m4/ntp_vpathhack.m443
-rw-r--r--sntp/m4/os_cflags.m4104
-rw-r--r--sntp/m4/snprintf.m4288
-rw-r--r--sntp/m4/version.m41
-rw-r--r--sntp/main.c1579
-rw-r--r--sntp/main.h31
-rw-r--r--sntp/networking.c278
-rw-r--r--sntp/networking.h110
-rw-r--r--sntp/scm-rev1
-rw-r--r--sntp/scripts/Makefile.am7
-rw-r--r--sntp/scripts/Makefile.in498
-rwxr-xr-xsntp/scripts/cvo.sh150
-rwxr-xr-xsntp/scripts/genLocInfo256
-rw-r--r--sntp/scripts/mansec2subst.sed28
-rw-r--r--sntp/sntp-opts.c1572
-rw-r--r--sntp/sntp-opts.def319
-rw-r--r--sntp/sntp-opts.h370
-rw-r--r--sntp/sntp.1sntpman339
-rw-r--r--sntp/sntp.1sntpmdoc295
-rw-r--r--sntp/sntp.c12
-rw-r--r--sntp/sntp.html620
-rw-r--r--sntp/sntp.man.in339
-rw-r--r--sntp/sntp.mdoc.in295
-rw-r--r--sntp/sntp.texi88
-rw-r--r--sntp/tests/Makefile.am111
-rw-r--r--sntp/tests/Makefile.in898
-rw-r--r--sntp/tests/crypto.cpp129
-rw-r--r--sntp/tests/data/debug-input-lfp-bin3
-rw-r--r--sntp/tests/data/debug-input-lfp-dec3
-rw-r--r--sntp/tests/data/debug-input-pkt8
-rw-r--r--sntp/tests/data/key-test-ascii2
-rw-r--r--sntp/tests/data/key-test-comments3
-rw-r--r--sntp/tests/data/key-test-empty0
-rw-r--r--sntp/tests/data/key-test-hex3
-rw-r--r--sntp/tests/data/key-test-invalid-hex2
-rw-r--r--sntp/tests/data/kod-expected-multiple3
-rw-r--r--sntp/tests/data/kod-expected-single1
-rw-r--r--sntp/tests/data/kod-test-blanks6
-rw-r--r--sntp/tests/data/kod-test-correct2
-rw-r--r--sntp/tests/data/kod-test-empty0
-rw-r--r--sntp/tests/fileHandlingTest.h64
-rw-r--r--sntp/tests/keyFile.cpp131
-rw-r--r--sntp/tests/kodDatabase.cpp118
-rw-r--r--sntp/tests/kodFile.cpp138
-rw-r--r--sntp/tests/networking.cpp5
-rw-r--r--sntp/tests/packetHandling.cpp264
-rw-r--r--sntp/tests/packetProcessing.cpp334
-rw-r--r--sntp/tests/sntptest.h35
-rwxr-xr-xsntp/tests/tests-runner13
-rw-r--r--sntp/tests/utilities.cpp176
-rw-r--r--sntp/tests_main.cpp25
-rw-r--r--sntp/tests_main.h22
-rw-r--r--sntp/utilities.c209
-rw-r--r--sntp/utilities.h27
-rw-r--r--tests/Makefile.am9
-rw-r--r--tests/Makefile.in736
-rw-r--r--tests/libntp/Makefile.am93
-rw-r--r--tests/libntp/Makefile.in970
-rw-r--r--tests/libntp/a_md5encrypt.cpp89
-rw-r--r--tests/libntp/atoint.cpp48
-rw-r--r--tests/libntp/atouint.cpp40
-rw-r--r--tests/libntp/authkeys.cpp100
-rw-r--r--tests/libntp/buftvtots.cpp61
-rw-r--r--tests/libntp/calendar.cpp337
-rw-r--r--tests/libntp/caljulian.cpp94
-rw-r--r--tests/libntp/caltontp.cpp49
-rw-r--r--tests/libntp/calyearstart.cpp43
-rw-r--r--tests/libntp/clocktime.cpp187
-rw-r--r--tests/libntp/decodenetnum.cpp93
-rw-r--r--tests/libntp/hextoint.cpp42
-rw-r--r--tests/libntp/hextolfp.cpp58
-rw-r--r--tests/libntp/humandate.cpp41
-rw-r--r--tests/libntp/lfpfunc.cpp547
-rw-r--r--tests/libntp/lfptest.h31
-rw-r--r--tests/libntp/lfptostr.cpp103
-rw-r--r--tests/libntp/libntptest.cpp27
-rw-r--r--tests/libntp/libntptest.h15
-rw-r--r--tests/libntp/modetoa.cpp16
-rw-r--r--tests/libntp/msyslog.cpp137
-rw-r--r--tests/libntp/netof.cpp69
-rw-r--r--tests/libntp/numtoa.cpp18
-rw-r--r--tests/libntp/numtohost.cpp15
-rw-r--r--tests/libntp/octtoint.cpp57
-rw-r--r--tests/libntp/prettydate.cpp16
-rw-r--r--tests/libntp/recvbuff.cpp38
-rw-r--r--tests/libntp/refnumtoa.cpp52
-rw-r--r--tests/libntp/sfptostr.cpp71
-rw-r--r--tests/libntp/sockaddrtest.h58
-rw-r--r--tests/libntp/socktoa.cpp100
-rw-r--r--tests/libntp/ssl_init.cpp50
-rw-r--r--tests/libntp/statestr.cpp27
-rw-r--r--tests/libntp/strtolfp.cpp107
-rw-r--r--tests/libntp/timespecops.cpp475
-rw-r--r--tests/libntp/timestructs.cpp156
-rw-r--r--tests/libntp/timestructs.h185
-rw-r--r--tests/libntp/timevalops.cpp480
-rw-r--r--tests/libntp/tstotv.cpp57
-rw-r--r--tests/libntp/tvtots.cpp54
-rw-r--r--tests/libntp/uglydate.cpp18
-rw-r--r--tests/libntp/vi64ops.cpp64
-rw-r--r--tests/libntp/ymd2yd.cpp23
-rw-r--r--tests/ntpd/Makefile.am55
-rw-r--r--tests/ntpd/Makefile.in938
-rw-r--r--tests/ntpd/leapsec.cpp901
-rw-r--r--tests/ntpd/ntpdtest.cpp27
-rw-r--r--tests/ntpd/ntpdtest.h15
-rw-r--r--util/Makefile.am135
-rw-r--r--util/Makefile.in1289
-rw-r--r--util/README44
-rw-r--r--util/audio-pcm.c154
-rw-r--r--util/byteorder.c56
-rw-r--r--util/hist.c110
-rw-r--r--util/invoke-ntp-keygen.menu1
-rw-r--r--util/invoke-ntp-keygen.texi1354
-rw-r--r--util/jitter.c136
-rw-r--r--util/jitter.h401
-rw-r--r--util/kern.c225
-rw-r--r--util/longsize.c11
-rw-r--r--util/ntp-keygen-opts.c1719
-rw-r--r--util/ntp-keygen-opts.def1144
-rw-r--r--util/ntp-keygen-opts.h386
-rw-r--r--util/ntp-keygen.1ntp-keygenman1221
-rw-r--r--util/ntp-keygen.1ntp-keygenmdoc1071
-rw-r--r--util/ntp-keygen.c2181
-rw-r--r--util/ntp-keygen.html1811
-rw-r--r--util/ntp-keygen.man.in1221
-rw-r--r--util/ntp-keygen.mdoc.in1071
-rw-r--r--util/ntp-keygen.texi307
-rw-r--r--util/ntptime.c474
-rw-r--r--util/pps-api.c100
-rw-r--r--util/precision.c171
-rw-r--r--util/sht.c260
-rw-r--r--util/testrs6000.c55
-rw-r--r--util/tg.c653
-rw-r--r--util/tg2.c2506
-rw-r--r--util/tickadj.c908
-rw-r--r--util/timetrim.c116
1623 files changed, 861925 insertions, 0 deletions
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644
index 0000000..1775a64
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,197 @@
+This file is automatically generated from html/copyright.html
+
+ Copyright Notice
+
+ jpg "Clone me," says Dolly sheepishly.
+
+ Last update: 9-Aug-2014 07:56 UTC
+ _________________________________________________________________
+
+ The following copyright notice applies to all files collectively
+ called the Network Time Protocol Version 4 Distribution. Unless
+ specifically declared otherwise in an individual file, this notice
+ applies as if the text was explicitly included in the file.
+***********************************************************************
+* *
+* Copyright (c) University of Delaware 1992-2014 *
+* *
+* Permission to use, copy, modify, and distribute this software and *
+* its documentation for any purpose with or without fee is hereby *
+* granted, provided that the above copyright notice appears in all *
+* copies and that both the copyright notice and this permission *
+* notice appear in supporting documentation, and that the name *
+* University of Delaware not be used in advertising or publicity *
+* pertaining to distribution of the software without specific, *
+* written prior permission. The University of Delaware makes no *
+* representations about the suitability this software for any *
+* purpose. It is provided "as is" without express or implied *
+* warranty. *
+* *
+***********************************************************************
+
+ The following individuals contributed in part to the Network Time
+ Protocol Distribution Version 4 and are acknowledged as authors of
+ this work.
+ 1. [1]Takao Abe <takao_abe@xurb.jp> Clock driver for JJY receivers
+ 2. [2]Mark Andrews <mark_andrews@isc.org> Leitch atomic clock
+ controller
+ 3. [3]Bernd Altmeier <altmeier@atlsoft.de> hopf Elektronik serial
+ line and PCI-bus devices
+ 4. [4]Viraj Bais <vbais@mailman1.intel.com> and [5]Clayton Kirkwood
+ <kirkwood@striderfm.intel.com> port to WindowsNT 3.5
+ 5. [6]Michael Barone <michael,barone@lmco.com> GPSVME fixes
+ 6. [7]Karl Berry <karl@owl.HQ.ileaf.com> syslog to file option
+ 7. [8]Greg Brackley <greg.brackley@bigfoot.com> Major rework of WINNT
+ port. Clean up recvbuf and iosignal code into separate modules.
+ 8. [9]Marc Brett <Marc.Brett@westgeo.com> Magnavox GPS clock driver
+ 9. [10]Piete Brooks <Piete.Brooks@cl.cam.ac.uk> MSF clock driver,
+ Trimble PARSE support
+ 10. [11]Nelson B Bolyard <nelson@bolyard.me> update and complete
+ broadcast and crypto features in sntp
+ 11. [12]Jean-Francois Boudreault
+ <Jean-Francois.Boudreault@viagenie.qc.ca> IPv6 support
+ 12. [13]Reg Clemens <reg@dwf.com> Oncore driver (Current maintainer)
+ 13. [14]Steve Clift <clift@ml.csiro.au> OMEGA clock driver
+ 14. [15]Casey Crellin <casey@csc.co.za> vxWorks (Tornado) port and
+ help with target configuration
+ 15. [16]Sven Dietrich <sven_dietrich@trimble.com> Palisade reference
+ clock driver, NT adj. residuals, integrated Greg's Winnt port.
+ 16. [17]John A. Dundas III <dundas@salt.jpl.nasa.gov> Apple A/UX port
+ 17. [18]Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> Linux
+ port
+ 18. [19]Dennis Ferguson <dennis@mrbill.canet.ca> foundation code for
+ NTP Version 2 as specified in RFC-1119
+ 19. [20]John Hay <jhay@icomtek.csir.co.za> IPv6 support and testing
+ 20. [21]Dave Hart <davehart@davehart.com> General maintenance, Windows
+ port interpolation rewrite
+ 21. [22]Claas Hilbrecht <neoclock4x@linum.com> NeoClock4X clock driver
+ 22. [23]Glenn Hollinger <glenn@herald.usask.ca> GOES clock driver
+ 23. [24]Mike Iglesias <iglesias@uci.edu> DEC Alpha port
+ 24. [25]Jim Jagielski <jim@jagubox.gsfc.nasa.gov> A/UX port
+ 25. [26]Jeff Johnson <jbj@chatham.usdesign.com> massive prototyping
+ overhaul
+ 26. [27]Hans Lambermont <Hans.Lambermont@nl.origin-it.com> or
+ [28]<H.Lambermont@chello.nl> ntpsweep
+ 27. [29]Poul-Henning Kamp <phk@FreeBSD.ORG> Oncore driver (Original
+ author)
+ 28. [30]Frank Kardel [31]<kardel (at) ntp (dot) org> PARSE <GENERIC>
+ (driver 14 reference clocks), STREAMS modules for PARSE, support
+ scripts, syslog cleanup, dynamic interface handling
+ 29. [32]Johannes Maximilian Kuehn <kuehn@ntp.org> Rewrote sntp to
+ comply with NTPv4 specification, ntpq saveconfig
+ 30. [33]William L. Jones <jones@hermes.chpc.utexas.edu> RS/6000 AIX
+ modifications, HPUX modifications
+ 31. [34]Dave Katz <dkatz@cisco.com> RS/6000 AIX port
+ 32. [35]Craig Leres <leres@ee.lbl.gov> 4.4BSD port, ppsclock, Magnavox
+ GPS clock driver
+ 33. [36]George Lindholm <lindholm@ucs.ubc.ca> SunOS 5.1 port
+ 34. [37]Louis A. Mamakos <louie@ni.umd.edu> MD5-based authentication
+ 35. [38]Lars H. Mathiesen <thorinn@diku.dk> adaptation of foundation
+ code for Version 3 as specified in RFC-1305
+ 36. [39]Danny Mayer <mayer@ntp.org>Network I/O, Windows Port, Code
+ Maintenance
+ 37. [40]David L. Mills <mills@udel.edu> Version 4 foundation,
+ precision kernel; clock drivers: 1, 3, 4, 6, 7, 11, 13, 18, 19,
+ 22, 36
+ 38. [41]Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de> VMS port
+ 39. [42]Jeffrey Mogul <mogul@pa.dec.com> ntptrace utility
+ 40. [43]Tom Moore <tmoore@fievel.daytonoh.ncr.com> i386 svr4 port
+ 41. [44]Kamal A Mostafa <kamal@whence.com> SCO OpenServer port
+ 42. [45]Derek Mulcahy <derek@toybox.demon.co.uk> and [46]Damon
+ Hart-Davis <d@hd.org> ARCRON MSF clock driver
+ 43. [47]Rob Neal <neal@ntp.org> Bancomm refclock and config/parse code
+ maintenance
+ 44. [48]Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de>
+ monitoring/trap scripts, statistics file handling
+ 45. [49]Dirce Richards <dirce@zk3.dec.com> Digital UNIX V4.0 port
+ 46. [50]Wilfredo Sánchez <wsanchez@apple.com> added support for
+ NetInfo
+ 47. [51]Nick Sayer <mrapple@quack.kfu.com> SunOS streams modules
+ 48. [52]Jack Sasportas <jack@innovativeinternet.com> Saved a Lot of
+ space on the stuff in the html/pic/ subdirectory
+ 49. [53]Ray Schnitzler <schnitz@unipress.com> Unixware1 port
+ 50. [54]Michael Shields <shields@tembel.org> USNO clock driver
+ 51. [55]Jeff Steinman <jss@pebbles.jpl.nasa.gov> Datum PTS clock
+ driver
+ 52. [56]Harlan Stenn <harlan@pfcs.com> GNU automake/autoconfigure
+ makeover, various other bits (see the ChangeLog)
+ 53. [57]Kenneth Stone <ken@sdd.hp.com> HP-UX port
+ 54. [58]Ajit Thyagarajan <ajit@ee.udel.edu>IP multicast/anycast
+ support
+ 55. [59]Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp>TRAK clock
+ driver
+ 56. [60]Brian Utterback <brian.utterback@oracle.com> General codebase,
+ Solaris issues
+ 57. [61]Loganaden Velvindron <loganaden@gmail.com> Sandboxing
+ (libseccomp) support
+ 58. [62]Paul A Vixie <vixie@vix.com> TrueTime GPS driver, generic
+ TrueTime clock driver
+ 59. [63]Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> corrected and
+ validated HTML documents according to the HTML DTD
+ _________________________________________________________________
+
+References
+
+ 1. mailto:%20takao_abe@xurb.jp
+ 2. mailto:%20mark_andrews@isc.org
+ 3. mailto:%20altmeier@atlsoft.de
+ 4. mailto:%20vbais@mailman1.intel.co
+ 5. mailto:%20kirkwood@striderfm.intel.com
+ 6. mailto:%20michael.barone@lmco.com
+ 7. mailto:%20karl@owl.HQ.ileaf.com
+ 8. mailto:%20greg.brackley@bigfoot.com
+ 9. mailto:%20Marc.Brett@westgeo.com
+ 10. mailto:%20Piete.Brooks@cl.cam.ac.uk
+ 11. mailto:%20nelson@bolyard.me
+ 12. mailto:%20Jean-Francois.Boudreault@viagenie.qc.ca
+ 13. mailto:%20reg@dwf.com
+ 14. mailto:%20clift@ml.csiro.au
+ 15. mailto:%20casey@csc.co.za
+ 16. mailto:%20Sven_Dietrich@trimble.COM
+ 17. mailto:%20dundas@salt.jpl.nasa.gov
+ 18. mailto:%20duwe@immd4.informatik.uni-erlangen.de
+ 19. mailto:%20dennis@mrbill.canet.ca
+ 20. mailto:%20jhay@icomtek.csir.co.za
+ 21. mailto:%20davehart@davehart.com
+ 22. mailto:%20neoclock4x@linum.com
+ 23. mailto:%20glenn@herald.usask.ca
+ 24. mailto:%20iglesias@uci.edu
+ 25. mailto:%20jagubox.gsfc.nasa.gov
+ 26. mailto:%20jbj@chatham.usdesign.com
+ 27. mailto:%20Hans.Lambermont@nl.origin-it.com
+ 28. mailto:H.Lambermont@chello.nl
+ 29. mailto:%20phk@FreeBSD.ORG
+ 30. http://www4.informatik.uni-erlangen.de/%7ekardel
+ 31. mailto:%20kardel%20%28at%29%20ntp%20%28dot%29%20org
+ 32. mailto:kuehn@ntp.org
+ 33. mailto:%20jones@hermes.chpc.utexas.edu
+ 34. mailto:%20dkatz@cisco.com
+ 35. mailto:%20leres@ee.lbl.gov
+ 36. mailto:%20lindholm@ucs.ubc.ca
+ 37. mailto:%20louie@ni.umd.edu
+ 38. mailto:%20thorinn@diku.dk
+ 39. mailto:%20mayer@ntp.org
+ 40. mailto:%20mills@udel.edu
+ 41. mailto:%20moeller@gwdgv1.dnet.gwdg.de
+ 42. mailto:%20mogul@pa.dec.com
+ 43. mailto:%20tmoore@fievel.daytonoh.ncr.com
+ 44. mailto:%20kamal@whence.com
+ 45. mailto:%20derek@toybox.demon.co.uk
+ 46. mailto:%20d@hd.org
+ 47. mailto:%20neal@ntp.org
+ 48. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de
+ 49. mailto:%20dirce@zk3.dec.com
+ 50. mailto:%20wsanchez@apple.com
+ 51. mailto:%20mrapple@quack.kfu.com
+ 52. mailto:%20jack@innovativeinternet.com
+ 53. mailto:%20schnitz@unipress.com
+ 54. mailto:%20shields@tembel.org
+ 55. mailto:%20pebbles.jpl.nasa.gov
+ 56. mailto:%20harlan@pfcs.com
+ 57. mailto:%20ken@sdd.hp.com
+ 58. mailto:%20ajit@ee.udel.edu
+ 59. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp
+ 60. mailto:%20brian.utterback@oracle.com
+ 61. mailto:%20loganaden@gmail.com
+ 62. mailto:%20vixie@vix.com
+ 63. mailto:%20Ulrich.Windl@rz.uni-regensburg.de
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..aafdee1
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,3835 @@
+(4.2.7p482) 2014/12/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2641] sntp is installed in the wrong location in Solaris.
+* [Bug 2678] nmea_control() now checks 'refclock_params()' result.
+(4.2.7p481) 2014/11/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2314] Only enable PPS if kernel consumer binding succeeds.
+* [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition.
+* Rename pps_enable to hardpps_enable.
+(4.2.7p480) 2014/11/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2677] PATH_MAX isn't #define'd under Windows.
+ Regression from the patch fixing Bug 2639.
+(4.2.7p479) 2014/11/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed.
+(4.2.7p478) 2014/11/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Sec 2630] buffer overrun in ntpq tokenize().
+* [Bug 2639] Check return value of ntp_adjtime().
+* [Bug 2650] includefile processing broken.
+* [Bug 2661] ntpq crashes with mreadvar.
+(4.2.7p477) 2014/11/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2657] Document that "restrict nopeer" intereferes with "pool".
+(4.2.7p476) 2014/10/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2503] SHT utility outdated
+(4.2.7p475) 2014/09/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2654] refclock_true.c doesn't identify the Mk III.
+(4.2.7p474) 2014/09/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup.
+* [Bug 2649] Clean up html/ page installation.
+(4.2.7p473) 2014/09/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2649] Clean up html/ page installation.
+(4.2.7p472) 2014/09/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2556] mrulist is missing from the generated ntpq man page.
+(4.2.7p471) 2014/09/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2649] "make install" leaves wrong owner for files in html/.
+* [Bug 2652] Windows hates directory names that contain a :.
+(4.2.7p470) 2014/09/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2502] Autogen text replacement errors.
+* autogen-5.18.5pre1
+* html/ cleanups from Hal Murray.
+(4.2.7p469) 2014/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup.
+(4.2.7p468) 2014/08/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2556] ntpq man page cleanup.
+* autogen-5.18.4
+(4.2.7p467) 2014/08/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2639] Check return value of ntp_adjtime().
+* [Bug 2640] STA_NANO can result in invalid ntv.constant.
+(4.2.7p466) 2014/08/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup.
+(4.2.7p465) 2014/08/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2538] NTP programs print exit code in help/usage text.
+* [Bug 2595] Man page quirks: ntpdate references in ntpd.
+* [Bug 2613] www.ntp.org/bugs.html tells folks to email doc bugs to DLM.
+* [Bug 2636] Clutter in syslog if gpsd not running
+ - found (hopefully) last cause for clutter in protocol version
+ - log GPSD revision and release numbers with protocol version
+(4.2.7p464) 2014/08/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2636] Fix coverity warning from previous patch.
+(4.2.7p463) 2014/08/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2636] Clutter in syslog if gpsd not running
+ - make driver work with GPSD protocol version 3.9
+ - use exponential back-off for connection problems
+ - implement rate-limit for syslog entries
+(4.2.7p462) 2014/08/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2622] Synchronisation problem using SHM [...]
+ Add 'control' function -- fudge values not available during start.
+(4.2.7p461) 2014/08/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1128] ntpq truncates "remote" host information.
+* More autogen-5.18.4pre14 cleanup.
+(4.2.7p460) 2014/08/13 Released by Harlan Stenn <stenn@ntp.org>
+* More autogen-5.18.4pre14 cleanup.
+(4.2.7p459) 2014/08/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2630] Limit the ntpq command buffer to 512 bytes.
+* FlexeLint cleanups.
+* Try bison-3.0.2 instead of bison-2.5.
+(4.2.7p458) 2014/08/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2633] Provide stdnoreturn.h for windows port.
+(4.2.7p457) 2014/08/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2622] Synchronisation problem using SHM when time difference is
+ more than four hours: Change SHM driver so TOY restricted API is not
+ used any more. (Plus some minor cleanup in logic and flow control)
+* Pass the configration source into the parser as argument rather
+ than through a global variable.
+* Fix nits in the ntpq man page.
+* autogen-5.18.4pre14
+(4.2.7p456) 2014/08/07 Released by Harlan Stenn <stenn@ntp.org>
+* CID 739722: Change the way the extention and MAC fields are processed.
+(4.2.7p455) 2014/08/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2565] ntpd sometimes logs unexpected getifaddrs() errors.
+* CID 739722: Clean up the definition of the exten field of struct pkt.
+(4.2.7p454) 2014/07/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2628] 'mon_getmoremem()' relies on undefined behaviour
+(4.2.7p453) 2014/07/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2597] leap file loose ends (follow-up)
+ - uniform expiration check messages for config and timer triggered
+ leap file loads
+ - timer triggered loads log messages only once per day
+(4.2.7p452) 2014/07/18 Released by Harlan Stenn <stenn@ntp.org>
+* Make all of the html/ .html files use the same format for "Last update".
+(4.2.7p451) 2014/07/17 Released by Harlan Stenn <stenn@ntp.org>
+* Fix the "Last update" entries in the html/ subtree.
+(4.2.7p450) 2014/07/16 Released by Harlan Stenn <stenn@ntp.org>
+* Distribute the scripts needed for the fix for Bug 2547.
+(4.2.7p449) 2014/07/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2547] Automate update of "Last Update" datestamps in .html files.
+* [Bug 2623] Missing {} in refclock_oncore.c.
+* Quiet warnings from ntp_calendar.h: avoid using argument names.
+* Fix typos in decode.html and debug.html .
+(4.2.7p448) 2014/07/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2621] Avoid use of indeterminate address after 'free()'
+ (minor C standard conformance issue)
+* Quiet warnings from ntp_calendar.h: avoid using argument names.
+(4.2.7p447) 2014/07/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2620] Use version.pm for checking version numbers in NTP::Util.
+* [Bug 2624] Fix signed compare on 'l_fp'.
+(4.2.7p446) 2014/06/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2597] leap file processing -- loose ends.
+* [Bug 2614] use 'unsigned long' consistently in ntp_random.c
+ to avoid possibly undefined behaviour in signed int overflow
+* [Bug 2619] Save a signed int copy of the return value of i2d_DSA_SIG().
+ Provide missing msyslog() message in crypto_alice().
+* Fix a variable lifetime issue.
+* Allow for version suffix in libevent in ntp_libevent.m4.
+(4.2.7p445) 2014/06/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2556] mrulist isn't mentioned in the ntpq man page.
+(4.2.7p444) 2014/05/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2597] leap file processing -- loose ends
+ fixed coverity issues
+(4.2.7p443) 2014/05/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2594] Update the year in sntp/include/copyright.def.
+(4.2.7p442) 2014/05/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2589] Update VS2013 project files for libntp.
+* [Bug 2600] Fix "Undisicplined Local Clock" driver1.html page.
+(4.2.7p441) 2014/05/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2597] leap file processing -- loose ends
+ log daily warning when leap info less than 28 days to expiration or
+ already expired; nag hourly on last day before expiration; log when
+ leapfile name is invalid
+(4.2.7p440) 2014/04/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup.
+* [Bug 2570] cleanup: fix log format for successful leapfile load
+(4.2.7p439) 2014/04/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2589] fix VS2009 compile problem.
+(4.2.7p438) 2014/04/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2546] Windows build documentation updates.
+(4.2.7p437) 2014/03/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2537] ntpd truncates symmetric keys to 20 bytes.
+* [Bug 2546] Documentation updates.
+(4.2.7p436) 2014/03/31 Released by Harlan Stenn <stenn@ntp.org>
+* Update to libopts-40.2.15, and autogen-5.18.3pre18.
+* [Bug 2311] Add more tags to mdoc2xxx.
+* [Bug 2502] Assorted text replacement errors in 4.2.7p345
+* [Bug 2538] ntp programs print exit code as part of the "usage" text.
+(4.2.7p435) 2014/03/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2570] cleanup: reduced logging noise, moved some functions
+ into libntp.
+(4.2.7p434) 2014/03/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2577] Update VS2013 solution and project files.
+(4.2.7p433) 2014/03/10 Released by Harlan Stenn <stenn@ntp.org>
+* Clean up last-update timestamps of html/*.html files.
+* [Bug 2546] Documentation updates.
+(4.2.7p432) 2014/03/09 Released by Harlan Stenn <stenn@ntp.org>
+* CID 711660: Do a non-NULL pointer assertion check a bit earlier.
+(4.2.7p431) 2014/03/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2572] cross-compiling fails for --with-yielding-select.
+(4.2.7p430) 2014/03/04 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to libevent-2.1.3-alpha-dev.
+* [Bug 2572] cross-compiling fails for --with-yielding-select.
+(4.2.7p429) 2014/03/03 Released by Harlan Stenn <stenn@ntp.org>
+* CID 1165098: Remove logically dead code from refclock_true.c.
+* CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check.
+* In ntp_dir_sep.m4, we care about $host_os, not $target_os.
+* [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP.
+* [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups.
+* [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash
+ -- change reading the hash line code: NIST omits leading zeros.
+* [Bug 2576] refclock_gpsdjson.c doesn't compile if CLOCK_GPSDJSON is
+ not enabled at configure time.
+(4.2.7p428) 2014/03/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash
+* [Bug 2562] Distribute the code in libjsmn/ .
+(4.2.7p427) 2014/03/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2562] GPSD_JSON: fix solaris issues (asprintf(), isfinite())
+* [Bug 2562] first release of the GPSD client clock (type 46)
+(4.2.7p426) 2014/02/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2113] Warn about ignored extra args in ntpq.
+* [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups.
+* [Bug 2561] Allow wildcards in the target of the "interface" command.
+* [Bug 2572] cross-compiling fails for --with-yielding_select.
+(4.2.7p425) 2014/02/26 Released by Harlan Stenn <stenn@ntp.org>
+* Copyright file update.
+(4.2.7p424) 2014/02/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2541] ntpd terminates itself with SIGHUP unexpectedly.
+(4.2.7p423) 2014/02/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2565] Handle EINTR on getifaddrs().
+(4.2.7p422) 2014/02/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2536] ntpd sandboxing support (libseccomp2).
+(4.2.7p421) 2014/02/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 898] More documentation fixes.
+* [Bug 2555] Autogen mdoc man pages all stamped with SunOS 5.10.
+* calc_tickadj/Makefile.am man/mdoc page build cleanup.
+(4.2.7p420) 2014/02/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 492] Clearly document ntpdate's pending deprecation.
+* [Bug 1186] ntpd fails with link local IPv6 addresses.
+* [Sec 2542] Strengthen the mrulist nonce.
+(4.2.7p419) 2014/02/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2466] Wrap NMEA timestamps in 1024 week cycles.
+(4.2.7p418) 2014/02/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2551] --disable-local-libevent breaks the build.
+(4.2.7p417) 2014/02/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2539] doc and code tweaks for NMEA driver.
+* Add check for enable stats to ntpd/complete.conf.in
+* Fix typo in html/confopt.html
+(4.2.7p416) 2014/01/31 Released by Harlan Stenn <stenn@ntp.org>
+* Tweak the 'Modified' line on appropriate html pages.
+* Note in the deprecation of ntpdc in its documentation.
+* [Bug 2332] Be more careful about when we use 'libgcc_s'.
+(4.2.7p415) 2014/01/28 Released by Harlan Stenn <stenn@ntp.org>
+* Fix the man page installation for the scripts/ files.
+(4.2.7p414) 2014/01/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 792] TrueTime TL-3 WWV refclock support.
+* [Bug 898] Documentation fixes.
+* [Bug 930] ntpdc docs refer to 'clockinfo', but mean 'clockstat'.
+* [Bug 1002] ntp-keygen option and documentation updates: -p/--pvt-passwd
+ is now -p/--password, and -q/--get-pvt-passwd is now -q/--export-passwd.
+* [Bug 1349] statistics command not documented in HTML documentation.
+ In html/monopt.html, add statistics id, definition, description, and
+ correct typo.
+ In html/scripts/monopt.txt, add statistics item, href, and comment.
+ In ntpd/ntp.conf.def, under statistics correct four to eight kinds.
+ In ntpd/complete.conf.in, add all eight kinds to statistics.
+ In html/comdex.html, remove duplicate footer.
+* [Bug 1734] Include man page for ntp.conf (fixed in 4.2.7p297).
+* [Bug 2049] Clarify ntpdate's -d option behavior.
+* [Bug 2366] ntpdc.html: burst/iburst only work on servers.
+* [Bug 2493] ntptrace needs a man page (fixed in 4.2.7p402).
+* [Bug 2545] Cleanup of scripts/monitoring/ntptrap.
+(4.2.7p413) 2014/01/27 Released by Harlan Stenn <stenn@ntp.org>
+* Require a version string for perl scripts that use autogen.
+* html/ cleanup.
+(4.2.7p412) 2014/01/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups.
+(4.2.7p411) 2014/01/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2532] Note in ntpdc docs that "enable pps" only works on older ntpd.
+(4.2.7p410) 2014/01/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2332] Force reference to 'libgcc_s' when using GCC, because
+ threading+restricted user+locked memory otherwise fails on Linux.
+* [Bug 2530] Fix documentation for enable/disable mode7 and pps.
+* Cleanup to the new scripts/*/Makefile.am files.
+(4.2.7p409) 2014/01/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2060] Warn about restrictions with "kod" but not "limited".
+(4.2.7p408) 2013/12/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2187] Update version number generation scripts.
+(4.2.7p407) 2013/12/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2519] mktime.c does not compile on 64-bit Solaris but we do not
+ need timegm() and the Solaris provides mktime().
+* [Bug 2522] Revert Bug 2513 fix - it breaks backward compatibility.
+(4.2.7p406) 2013/12/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2521] VPATH tweaks for perl -opts files.
+(4.2.7p405) 2013/12/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2521] bootstrap script needs a tweak for perl -opts files.
+* [Bug 2524] Add ntpsweep to sntp/loc/* files.
+* [Bug 2526] Add "noinst" support to the sntp/loc/ framework.
+(4.2.7p404) 2013/12/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 135] AIX5: "Address already in use" for IPv6 wildcard.
+(4.2.7p403) 2013/12/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2513] Remove any PIDFILE in finish().
+* [Bug 2516] Enable clock_gettime() support for AIX 5+.
+* [Bug 2517] Fix peer status errors in decode.html.
+(4.2.7p402) 2013/12/23 Released by Harlan Stenn <stenn@ntp.org>
+* Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup.
+(4.2.7p401) 2013/11/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2491] VS20xx compile fixes.
+(4.2.7p400) 2013/11/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2491] VS2013 project files.
+(4.2.7p399) 2013/11/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2326] More leapsecond file notification cleanup.
+* [Bug 2506] make sure routing updates are always tracked
+* [Bug 2514] secs/* #define usage cleanup.
+(4.2.7p398) 2013/11/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2326] More leapsecond file notification cleanup.
+* Improve sntp KoD data file fopen() error message.
+(4.2.7p397) 2013/11/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2326] More leapsecond file notification cleanup.
+(4.2.7p396) 2013/11/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2326] Improve stale leapsecond notifications.
+(4.2.7p395) 2013/11/12 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to autogen-5.18.3pre5 and libopts-40.1.15.
+(4.2.7p394) 2013/11/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1050] Change ONCORE log message for leap second announcement
+ to avoid misunderstandings.
+* [Bug 2499] Win32 user-space/loopback ppsapi provider drops samples.
+* [Bug 2256] Improve configure's function searches in libraries.
+(4.2.7p393) 2013/10/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2272] Use C99 integer types. ntp_calendar.h and ntp_types.h .
+(4.2.7p392) 2013/10/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2375] Improve AIX compatibility.
+* [Bug 2490] Fixed non-const initializer coming from [Bug 2250] fix.
+(4.2.7p391) 2013/10/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2250] Rework of leap second handling machine.
+* [Bug 2419] [rc-nmea] Improve clockstats reporting when receiver sends
+ data without valid GPS fix.
+(4.2.7p390) 2013/09/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2482] Cleanup of droproot and jail support for Solaris.
+(4.2.7p389) 2013/09/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2473] revisited: NTPD exits after clock is stepped backwards
+ Avoid possible unsigned underrun for startup condition when testing
+ for clock backstep.
+* [Bug 2481] ntpd aborts when both user and group are specified with -u.
+* [Bug 2482] Add droproot and jail support for Solaris.
+(4.2.7p388) 2013/09/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2473] NTPD exits after clock is stepped backwards externally
+(4.2.7p387) 2013/09/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1642] ntpdsim can't find simnulate block in config file.
+(4.2.7p386) 2013/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2472] (WinXP) Avoid self-termination of IO thread during exit().
+(4.2.7p385) 2013/08/19 Released by Harlan Stenn <stenn@ntp.org>
+* CID 975596: Copy/paste error: vallen should be siglen.
+* CID 1009579: Check return status of X509_add_ext().
+* [2085] Fix root distance and root dispersion calculations.
+* [Bug 2426] Possibly uninitialized data in crypto_send() - CID 975596.
+(4.2.7p384) 2013/08/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2450] --version has bogus short option.
+(4.2.7p383) 2013/08/10 Released by Harlan Stenn <stenn@ntp.org>
+* (no changes - force a rebuild for a new Coverity scan)
+(4.2.7p382) 2013/08/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2454] Need way to set file descriptor limit - cleanup.
+(4.2.7p381) 2013/08/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2451] rlimit command is missing from the table of contents in
+ miscopt.html .
+* [Bug 2452] provide io_handler/input_handler only on
+ non HAVE_IO_COMPLETION_PORT platforms
+* [Bug 2453] Need a way to avoid calling mlockall.
+* [Bug 2454] Need way to set file descriptor limit.
+* [Bug 2458] AM_CONFIG_HEADER is obsolete.
+(4.2.7p380) 2013/08/03 Released by Harlan Stenn <stenn@ntp.org>
+* CID 984511: Some systems have different printf needs for sizeof.
+(4.2.7p379) 2013/08/02 Released by Harlan Stenn <stenn@ntp.org>
+* CID 739724: Fix printf arg mismatch in a debug line.
+* [Bug 2425] compile io_handler() in ntp_io.c unconditionally
+* [Bug 2448] Fix checks for configure --with-stack-limit and --with-memlock
+ values.
+(4.2.7p378) 2013/08/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2425] move part of input handler code from ntpd.c to ntp_io.c
+ and fix select()-only platforms calling input_handler directly.
+* [Bug 2446] Quiet warnings from Oracle's Studio compiler.
+* Upgrade to AutoGen-5.18.1pre3
+* Upgrade to libopts-40.1.15.
+(4.2.7p377) 2013/07/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2397] License/copyright cleanup.
+* [Bug 2439] Fix check of EscapeCommFunction() in ports/winnt/libntp/termios.c.
+(4.2.7p376) 2013/07/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2322] Oncore driver should send 0 PPS offset to GPS.
+(4.2.7p375) 2013/07/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 883] log warning arguments swapped in refclock_gpsvme.c.
+* [Bug 2368] Correct bug in previous attempt.
+* [Bug 2413] Fix "make check" with automake >= 1.13.
+* [Bug 2434] Line-buffer (v. block-buffer) stdout.
+(4.2.7p374) 2013/07/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2368] make check troubles in libevent.
+* [Bug 2425] setup SIGIO/SIGPOLL for asyncio on the read side
+ of a socketpair for the worker thread.
+(4.2.7p373) 2013/07/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2427] configure fails to detect recvmsg() on Solaris.
+(4.2.7p372) 2013/07/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1466] Oncore should set FLAG_PPS.
+* [Bug 2375] AIX 7 doesn't like a libevent validation check.
+* [Bug 2423] Log command-line args at LOG_INFO.
+* [Bug 2428] do_unconf() should reset 'items' before the 2nd loop.
+(4.2.7p371) 2013/07/07 Released by Harlan Stenn <stenn@ntp.org>
+* CID 1042586: Check the return value of clock_gettime() in worker_sleep().
+* Upgrade to libopts-39.0.14 from 5.17.5pre10.
+(4.2.7p370) 2013/07/06 Released by Harlan Stenn <stenn@ntp.org>
+* Remove \n's from syslog output strings.
+(4.2.7p369) 2013/07/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2415] RES_LIMITED flags check should use &, not &&.
+* Have NTP_LIBNTP check for time.h and clock_getres().
+* Fix ntpsweep to use sntp instead of ntpdate, from Oliver Kindernay.
+(4.2.7p368) 2013/05/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2145] ntpq dumps core when displaying sys_var_list and more.
+(4.2.7p367) 2013/04/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1485] Sometimes ntpd crashes
+* [Bug 2382] Implement LOGTOD using ldexp() instead of shifting.
+(4.2.7p366) 2013/04/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1866] Disable some debugging output in refclock_oncore.
+(4.2.7p365) 2013/04/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2149] Log an error message if /proc/net/if_inet6 cannot be opened.
+(4.2.7p364) 2013/03/26 Released by Harlan Stenn <stenn@ntp.org>
+* Bump sntp/include/autogen-version.def .
+(4.2.7p363) 2013/03/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl.
+* Upgrade to libopts from 5.17.3pre10.
+(4.2.7p362) 2013/03/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2364] "sed -i" is not portable.
+(4.2.7p361) 2013/03/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl.
+* [Bug 2365] "make check" fails in libevent.
+(4.2.7p360) 2013/03/15 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade libevent (coverity fixes, etc.).
+* EEXIST is OK for mkdir() in sntp/kod_management.c.
+(4.2.7p359) 2013/03/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2359] Fix send_via_ntp_signd() prototype.
+(4.2.7p358) 2013/02/27 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to autogen-5.17.3pre4 and libopts-38.0.13.
+* [Bug 2357] sntp/libopts/usage.c on NetBSD needs -lintl.
+(4.2.7p357) 2013/02/22 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to autogen-5.17.2pre and libopts-38.0.13.
+(4.2.7p356) 2013/02/19 Released by Harlan Stenn <stenn@ntp.org>
+* Added loc/debian.
+(4.2.7p355) 2013/02/18 Released by Harlan Stenn <stenn@ntp.org>
+* CID 739708: Check return status of fcntl() in refclock_arc.c.
+* CID 739709: Check return status of fcntl() in refclock_datum.c.
+* CID 739710: Check return status of mkdir() in sntp/kod_management.c.
+* CID 739711: Ignore return status of remove() in ntp-keygen.c.
+* CID 739723: Print sizeof as unsigned.
+* CID 971094: Clean up time of check/time of use in check_leap_file().
+(4.2.7p354) 2013/02/10 Released by Harlan Stenn <stenn@ntp.org>
+* CID 97194: Check return from setsockopt().
+* CID 739473,739532: Out-of-bounds access/illegal address computation.
+* CID 739558: Double close.
+* CID 739559: Double close.
+* CID 739713: devmask/recmask copy/paste error.
+* CID 739714: Fix code indentation level.
+* CID 739715: Clean up sockaddr_dump().
+(4.2.7p353) 2013/02/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2326] Check hourly for a new leapfile if the old one expired.
+(4.2.7p352) 2013/01/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2326] Notice when a new leapfile has been installed.
+(4.2.7p351) 2013/01/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2328] Don't apply small time adjustments on Windows versions
+ which don't support this.
+(4.2.7p350) 2013/01/21 Released by Harlan Stenn <stenn@ntp.org>
+* Added sntp/loc/netbsd based on info from Christos Zoulas.
+(4.2.7p349) 2013/01/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2321] Fixed Windows build, but autogen update still required.
+(4.2.7p348) 2013/01/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2327] Rename sntp/ag-tpl/:Old to sntp/ag-tpl/Old.
+* Cleanup to ntpsnmpd-opts.def.
+* Cleanup to ntpq.texi.
+* Documentation cleanup to the ntpd, ntpdc, ntpq and ntp-wait
+ .def files.
+* In ntp.conf.def, cleanup SEE ALSO, document 'rlimit' options.
+* Add a reference to RFC5907 in the ntpsnmpd documentation.
+(4.2.7p347) 2013/01/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2325] Re-enable mlockall() check under Linux post-1223 fix.
+(4.2.7p346) 2013/01/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1223] reorganize inclusion of sys/resource.h.
+(4.2.7p345) 2013/01/04 Released by Harlan Stenn <stenn@ntp.org>
+* Update several .def files to use autogen-5.17 feature set.
+(4.2.7p344) 2013/01/03 Released by Harlan Stenn <stenn@ntp.org>
+* Refactor and enhance mdoc2texi.
+* Make sure agtexi-file.tpl defines label-str.
+* Cleanup to ntp.conf.def.
+* Upgrade to autogen-5.17 and libopts-37.0.12.
+(4.2.7p343) 2013/01/02 Released by Harlan Stenn <stenn@ntp.org>
+* Update the copyright year.
+(4.2.7p342) 2012/12/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2081 - Backward Incompatible] rawstats now logs everything.
+(4.2.7p341) 2012/12/30 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.7p340) 2012/12/29 Released by Harlan Stenn <stenn@ntp.org>
+* mdoc2texi fixes: trailing punctuation.
+(4.2.7p339) 2012/12/26 Released by Harlan Stenn <stenn@ntp.org>
+* mdoc2texi fixes: parseQuote, closing of list item tables.
+* ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates.
+(4.2.7p338) 2012/12/25 Released by Harlan Stenn <stenn@ntp.org>
+* mdoc2texi fixes: Handle_ArCmFlIc, Handle_Fn, HandleQ.
+* ntp-keygen autogen documentation updates.
+* ntpq autogen docs.
+(4.2.7p337) 2012/12/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1223] More final cleanup for rlimit changes.
+(4.2.7p336) 2012/12/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1223] Final cleanup for rlimit changes.
+(4.2.7p335) 2012/12/18 Released by Harlan Stenn <stenn@ntp.org>
+* Update documentation templates and definitions.
+* Create agtexi-file.tpl .
+(4.2.7p334) 2012/12/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2114] Update tests for sntp's synch distance.
+* Create ntp-keygen.{html,texi}.
+(4.2.7p333) 2012/12/07 Released by Harlan Stenn <stenn@ntp.org>
+* Autogen documentation cleanup.
+(4.2.7p332) 2012/12/06 Released by Harlan Stenn <stenn@ntp.org>
+* sntp documentation cleanup.
+(4.2.7p331) 2012/12/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2114] Correctly calculate sntp's synch distance.
+(4.2.7p330) 2012/12/03 Released by Harlan Stenn <stenn@ntp.org>
+* autogen doc cleanup
+(4.2.7p329) 2012/12/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2278] ACTS flag3 mismatch between code and driver18.html.
+* Use an enum for the ACTS state table.
+* html doc reconciliation with DLM's copy.
+(4.2.7p328) 2012/11/30 Released by Harlan Stenn <stenn@ntp.org>
+* html doc reconciliation with DLM's copy.
+(4.2.7p327) 2012/11/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2024] Identify Events in the system status word in decode.html.'
+* [Bug 2040] Provide a command-line option for the identity key bits.
+* Create loc/darwin for Mac OSX
+(4.2.7p326) 2012/11/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1214] 'proto: precision = ...' should be at INFO, not NOTICE.
+* [Bug 2246] Clear sys_leap when voting says to disarm the leap.
+(4.2.7p325) 2012/11/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2202] ntpq.html: there is no "acv" billboard.
+* [Bug 2306] keep pps hack for Win32 even if user-mode/loopback
+ PPS API is activated on a serial line.
+(4.2.7p324) 2012/11/19 Released by Harlan Stenn <stenn@ntp.org>
+* Reinstate doc fix to authentic.html from Mike T.
+* [Bug 1223] cleanup for rlimit changes.
+* [Bug 2098] Install DLM's HTML documentation.
+* [Bug 2306] Added user-mode/loop-back PPS API provider for Win32
+(4.2.7p323) 2012/11/18 Released by Harlan Stenn <stenn@ntp.org>
+* html/ updates from Dave Mills.
+(4.2.7p322) 2012/11/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1223] Allow configurable values for RLIMIT_STACK and
+ RLIMIT_MEMLOCK.
+* [Bug 1320] Log ntpd's initial command-line parameters. (updated fix)
+* [Bug 2120] no sysexits.h under QNX.
+* [Bug 2123] cleanup to html/leap.html.
+(4.2.7p321) 2012/11/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1320] Log ntpd's initial command-line parameters.
+(4.2.7p320) 2012/11/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 969] Clarify ntpdate.html documentation about -u and ntpd.
+* [Bug 1217] libisc/ifiter_sysctl.c:internal_current(): Ignore RTM
+ messages with wrong version
+(4.2.7p319) 2012/11/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2296] Fix compile problem with building with old OpenSSL.
+(4.2.7p318) 2012/11/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2301] Remove spurious debug output from ntpq.
+(4.2.7p317) 2012/11/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line.
+(4.2.7p316) 2012/10/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2296] Update fix for Bug 2294 to handle --without-crypto.
+(4.2.7p315) 2012/10/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2294] ntpd crashes in FIPS mode.
+(4.2.7p314) 2012/10/23 Released by Harlan Stenn <stenn@ntp.org>
+* Document a tricky malloc() of dns_ctx in sntp.
+(4.2.7p313) 2012/10/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2291] sntp should report why it cannot open file.kod.
+* [Bug 2293] add support for SO_BINTIME, refine support for
+ SO_TIMESTAMPNS (bug 1374)
+(4.2.7p312) 2012/10/11 Released by Harlan Stenn <stenn@ntp.org>
+* Clean up testing/debugging of fix for [Bug 938] from sntp/main.c .
+(4.2.7p311) 2012/10/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 938] The argument to the -D flag takes a number, not a string.
+* [Bug 1013] ntpdate's HTML page claims wrong default version.
+* [Bug 1374] Support SO_TIMESTAMPNS.
+(4.2.7p310) 2012/10/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1374] Support SO_TIMESTAMPNS.
+* [Bug 2266] Remove deprecated refclock_trak.c from Windows Makefile
+ equivalents.
+* [Bug 2274] Bring libopts/enum.c back to (old) ANSI C compliance.
+(4.2.7p309) 2012/10/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2287] ntpdate returns 0 even if adjtime() call fails.
+(4.2.7p308) 2012/09/29 Released by Harlan Stenn <stenn@ntp.org>
+* CID 97198: Check return from ioctl() calls in refclock_acts.c.
+(4.2.7p307) 2012/09/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1997] Fix sntp broadcast timeouts.
+* [Bug 2234] Fix incorrect ntptrace html documentation.
+* [Bug 2262] Install html docs in $htmldir.
+* Fix typo in html/select.html.
+(4.2.7p306) 2012/09/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 752] ToS cleanup from Mike Tatarinov.
+(4.2.7p305) 2012/09/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6.
+* [Bug 1232] Convert SHM refclock to use struct timespec.
+* [Bug 2258] Add syslog message about leap insertion.
+* [Bug 2263] broadcast server doesn't work for host with
+ OS_MISSES_SPECIFIC_ROUTE_UPDATES.
+* [Bug 2271] Decode refclock types when built with --disable-all-clocks.
+* [Bug 2276] clk_sel240x.c #define's _XOPEN_SOURCE, breaking QNX6.
+* Updates to driver28.html.
+(4.2.7p304) 2012/09/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2264] Cleanup SEL240X Refclock.
+* In refclock_wwv.c rename SECOND to WWV_SEC and MINUTE to WWV_MIN.
+(4.2.7p303) 2012/09/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1232] Add nanosecond support to SHM driver.
+(4.2.7p302) 2012/09/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2160] Log warning about expired leapseconds file.
+(4.2.7p301) 2012/09/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2164] Greater precision needed for ntpq offset report.
+* Clean the man5_MANS in ntpd/ .
+(4.2.7p300) 2012/09/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2262] Install sntp.html into htmldir.
+* [Bug 2270] Install fails due to repeated man5 page names.
+(4.2.7p299) 2012/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* More cleanup to the bootstrap script.
+(4.2.7p298) 2012/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* Handle additional man page sections in the bootstrap script.
+* Remove extraneous parens.
+* Add a missing "%s" syslog format string.
+(4.2.7p297) 2012/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* Fix mdoc2man.
+* Distribute ntp.conf.def and ntp.keys.def.
+(4.2.7p296) 2012/08/31 Released by Harlan Stenn <stenn@ntp.org>
+* Begin support for autogen maintaining ntp.conf and ntp.keys docs.
+* Upgrade to autogen-5.16.2 and libopts-36.5.11.
+* Potential bugfix for agtexi-cmd.tpl.
+(4.2.7p295) 2012/08/11 Released by Harlan Stenn <stenn@ntp.org>
+* Look for syslog's facilitynames[].
+(4.2.7p294) 2012/08/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2242] configure fails to detect getifaddrs function on Solaris.
+* [Bug 2249] Bad operator for 'test' in 'make check' of libevent.
+* [Bug 2252] palisade: formats nanosecs to a 6-char field.
+* Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c.
+* Fix && -> & typo in refclock_palisade.c debug statements.
+(4.2.7p293) 2012/08/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006.
+* Documentation cleanup from Mike T.
+* Cleanup kclk_sel240x.o rules in libparse/Makefile.am.
+(4.2.7p292) 2012/08/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1545] Note why we are logging the Version string.
+* [Bug 1872] Remove legacy ppsclock fdpps, #ifdef PPS.
+* [Bug 2075] Fix spelling of 'incompatible'.
+* [Bug 2247] Get rid of the TRAK refclock - deprecated since 2006.
+* Clean up an exit status in ntpq.c.
+(4.2.7p291) 2012/07/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2241] MDNS registration should only happen if requested.
+(4.2.7p290) 2012/07/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1454] Add parse clock support for the SEL-240x GPS products.
+* CID 709185: refclock_chu.c will leak fd==0 (better fix)
+(4.2.7p289) 2012/07/16 Released by Harlan Stenn <stenn@ntp.org>
+* CID 97123: Future-proof possible change to refclock_nmea.c.
+* CID 97377: ntp-keygen.c's followlink() might not NUL-terminate.
+* CID 709185: refclock_chu.c will leak fd==0 (which should be impossible).
+(4.2.7p288) 2012/07/03 Released by Harlan Stenn <stenn@ntp.org>
+* CID 709173: Make sure a libisc function we do not use is called properly.
+(4.2.7p287) 2012/07/03 Released by Harlan Stenn <stenn@ntp.org>
+* Remove 1024 associations-per-server limit from ntpq.
+* Remove blank line between ntpq mreadvar associations.
+(4.2.7p286) 2012/06/28 Released by Harlan Stenn <stenn@ntp.org>
+* CID 97193: check return from sscanf() in ntp_config.c.
+* CID 709169: check return from open("/dev/null", 0) and friends.
+* CID 709207: Initialize "quality" for ulink_receive.
+(4.2.7p285) 2012/06/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2227] Enable mrulist access control via "restrict ... nomrulist".
+* Automake-1.12 wants us to use AM_PROG_AR.
+* Conditionalize msyslog messages about rejected mode 6 requests due to
+ nomodify and nomrulist restrictions under "logconfig +sysinfo".
+* Increment sys_restricted in a few rejection paths due to nomodify
+ restrictions where previosuly overlooked.
+(4.2.7p284) 2012/06/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2225] libevent configure hangs.
+* Update bundled libevent to git master, post libevent 2.1.1-alpha.
+(4.2.7p283) 2012/06/16 Released by Harlan Stenn <stenn@ntp.org>
+* In sntp/m4/ntp_openssl.m4, Support multiple package names for the
+ crypto library. Add legacy support for -Wl,-rpath.
+(4.2.7p282) 2012/06/15 Released by Harlan Stenn <stenn@ntp.org>
+* tickadj may need to be linked with PTHREAD_LIBS.
+(4.2.7p281) 2012/06/14 Released by Harlan Stenn <stenn@ntp.org>
+* U_INT32_MAX cleanup in include/ntp_types.h .
+* When linking, ntp_keygen and tickadj need $(LIBM).
+(4.2.7p280) 2012/06/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2224] Use-after-free in routing socket code after dropping root.
+(4.2.7p279) 2012/06/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2211] findbcastinter(): possibly undefined variable iface used.
+* [Bug 2220] Incorrect check for maximum association id in ntpq.
+(4.2.7p278) 2012/06/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2204] Build with --enable-getifaddrs=glibc fails.
+* [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+* [Bug 2191] dcfd -Y y2kcheck on CentOS 6.2 x86_64 breaks make check.
+(4.2.7p277) 2012/05/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2193] Building timestruct tests with Clang 3.1 fails.
+(4.2.7p276) 2012/05/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2179] Remove sntp/header.h.
+(4.2.7p275) 2012/04/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1744] Remove obsolete ntpdate/ntptime* items.
+(4.2.7p274) 2012/04/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus.
+(4.2.7p273) 2012/04/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2141] handle_sigio() calls get_systime(), which must be
+ reentrant when SIGIO is used. Sanity checks relative to the prior
+ get_systime() are disabled in ntpd on systems with signaled I/O, but
+ active in sntp and ntpdate.
+* Correct authnumfreekeys accounting broken in 4.2.7p262.
+(4.2.7p272) 2012/04/14 Released by Harlan Stenn <stenn@ntp.org>
+* LCRYPTO is gone - replace with VER_SUFFIX.
+* Change the link order for ntpsntpd.
+* Remove extra 'nlist' check from configure.ac.
+(4.2.7p271) 2012/04/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1122] openssl detection via pkg-config fails when no additional
+ -Idir flags are needed.
+* Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+(4.2.7p270) 2012/03/26 Released by Harlan Stenn <stenn@ntp.org>
+* Update driver45.html page.
+(4.2.7p269) 2012/03/25 Released by Harlan Stenn <stenn@ntp.org>
+* Clean up configure.ac.
+* Cleanup configure.ac's TSYNC PCI section.
+(4.2.7p268) 2012/03/24 Released by Harlan Stenn <stenn@ntp.org>
+* Update driver45.html page.
+(4.2.7p267) 2012/03/23 Released by Harlan Stenn <stenn@ntp.org>
+* Initial cut at a basic driver45.html page.
+(4.2.7p266) 2012/03/21 Released by Harlan Stenn <stenn@ntp.org>
+* Add refclock_tsyncpci.c (driver 45) supporting Spectracom TSYNC timing
+ boards.
+(4.2.7p265) 2012/03/20 Released by Harlan Stenn <stenn@ntp.org>
+* Treat zero counter as indication of precise system time in Windows
+ PPSAPI helper function pps_ntp_timestamp_from_counter(), enabling
+ PPSAPI providers to use the Windows 8 precise clock directly.
+(4.2.7p264) 2012/03/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2160] Note if leapseconds file is past its prime.
+* Use GetSystemTimePreciseAsFileTime() on Windows 8.
+(4.2.7p263) 2012/03/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2156] clock instability with LOCAL driver, from Miroslav Lichvar.
+* [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
+(4.2.7p262) 2012/02/29 Released by Harlan Stenn <stenn@ntp.org>
+* Improve ntpd scalability for servers with many trusted keys.
+(4.2.7p261) 2012/02/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2048] add the clock variable timecode to SHM refclock.
+(4.2.7p260) 2012/02/24 Released by Harlan Stenn <stenn@ntp.org>
+* Fix the check-scm-rev invocation in several Makefile.am's.
+(4.2.7p259) 2012/02/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2148] ntpd 4.2.7p258 segfault with 0x0100000 bit in NMEA mode.
+* refclock_nmea.c merge cleanup thanks to Juergen Perlinger.
+(4.2.7p258) 2012/02/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2140] Rework of Windows I/O completion port handling to avoid
+ garbling serial input in UNIX line discipline emulation.
+* [Bug 2143] NMEA driver: discard data if quality indication not good,
+ add statistic counters (mode bit enabled) to clockstats file.
+(4.2.7p257) 2012/02/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2135] defer calls to 'io_input' to main thread under Windows.
+(4.2.7p256) 2012/02/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2131] Set the system variable settimeofday only after clock step.
+* [Bug 2134] --enable-C99-snprintf does not force rpl_snprintf use.
+(4.2.7p255) 2012/01/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 603] Only link with nlist()-related libraries when needed:
+ More cleanup.
+(4.2.7p254) 2012/01/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 603] Only link with nlist()-related libraries when needed.
+(4.2.7p253) 2012/01/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2126] Compile error on Windows with libopts from Autogen 5.14.
+* Update one of the license URLs.
+(4.2.7p252) 2012/01/25 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to autogen-5.14 (and libopts-36.1.11).
+(4.2.7p251) 2012/01/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2115] ntptrace should accept both rootdispersion and rootdisp.
+(4.2.7p250) 2012/01/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2113] Warn about ignored extra args in ntpq.
+* Update the copyright year.
+(4.2.7p249) 2012/01/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2111] Remove minpoll delay before iburst for pool and
+ manycastclient.
+* Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+(4.2.7p248) 2012/01/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2109] "make clean check" is broken with gtest available.
+* [Bug 2110] systime.c typo breaks build on microsecond clocks.
+(4.2.7p247) 2012/01/07 Released by Harlan Stenn <stenn@ntp.org>
+* Fix build break triggered by updating deps-ver and libntp/systime.c at
+ the same time by explicitly depending systime_s.c on systime.c.
+(4.2.7p246) 2012/01/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2104] ntpdc fault with oversize -c command.
+* [Bug 2106] Fix warnings when using -Wformat-security.
+* Refactor timespecops.h and timevalops.h into inline functions.
+(4.2.7p245) 2011/12/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2100] conversion problem with timespec/timeval <--> l_fp fixed;
+ added tests to expose the bug.
+(4.2.7p244) 2011/12/25 Released by Harlan Stenn <stenn@ntp.org>
+* Updates from 4.2.6p5.
+(4.2.7p243) 2011/12/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2095] ntptrace now needs 'rv' instead of 'pstat', reported
+ by Michael Tatarinov.
+(4.2.7p242) 2011/12/21 Released by Harlan Stenn <stenn@ntp.org>
+* Include missing html/icons/sitemap.png, reported by Michael Tatarinov.
+* Documentation updates from Dave Mills.
+(4.2.7p241) 2011/12/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+* [Bug 2037] Fuzzed non-interpolated clock may decrease.
+* [Bug 2068] "tos ceiling" default and cap changed to 15.
+* Floor peer delay using system precision, as with jitter, reflecting
+ inability to measure shorter intervals.
+(4.2.7p240) 2011/12/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2092] clock_select() selection jitter miscalculated.
+* [Bug 2093] Reintroduce smaller stratum factor to system peer metric.
+(4.2.7p239) 2011/12/11 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p238) 2011/12/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2082] from 4.2.6p5-RC3: 3-char refid sent by ntpd 4.2.6p5-RC2
+ ends with extra dot.
+* [Bug 2085] from 4.2.6p5-RC3: clock_update() sys_rootdisp calculation
+ omits root delay.
+* [Bug 2086] from 4.2.6p5-RC3: get_systime() should not offset by
+ sys_residual.
+* [Bug 2087] from 4.2.6p5-RC3: sys_jitter calculation overweights
+ sys.peer jitter.
+* from 4.2.6p5-RC3: Ensure NULL peer->dstadr is not accessed in orphan
+ parent selection.
+(4.2.7p237) 2011/12/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2050] from 4.2.6p5-RC2: Orphan mode stratum counting to infinity.
+* [Bug 2059] from 4.2.6p5-RC2: optional billboard column "server" does
+ not honor -n.
+* [Bug 2066] from 4.2.6p5-RC2: ntpq lopeers ipv6 "local" column overrun.
+* [Bug 2068] from 4.2.6p5-RC2: ntpd sends nonprintable stratum 16 refid
+ to ntpq.
+* [Bug 2069] from 4.2.6p5-RC2: broadcastclient, multicastclient spin up
+ duplicate ephemeral associations without broadcastdelay.
+* [Bug 2072] from 4.2.6p5-RC2: Orphan parent selection metric needs
+ ntohl().
+* [Bug 2073] Correct ntpq billboard's MODE_PASSIVE t from 'u' to 'S'.
+* from 4.2.6p5-RC2: Exclude not-yet-determined sys_refid from use in
+ loopback TEST12 (from Dave Mills).
+* from 4.2.6p5-RC2: Never send KoD rate limiting response to MODE_SERVER.
+* Floor calculation of sys_rootdisp at sys_mindisp in clock_update (from
+ Dave Mills).
+* Restore 4.2.6 clock_combine() weighting to ntp-dev, reverting to pre-
+ 4.2.7p70 method while also avoiding divide-by-zero (from Dave Mills).
+* Round l_fp traffic interval when converting to integer in rate limit
+ and KoD calculation.
+(4.2.7p236) 2011/11/16 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p235) 2011/11/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2052] Autokey CRYPTO_ASSOC host@group vallen needs checking.
+(4.2.7p234) 2011/11/07 Released by Harlan Stenn <stenn@ntp.org>
+* Clean up -libm entries regarding libntp.a
+(4.2.7p233) 2011/11/06 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p232) 2011/11/05 Released by Harlan Stenn <stenn@ntp.org>
+* Update the NEWS file so we note the default disable of mode 7 requests.
+* Clean up some bitrotted code in libntp/socket.c.
+(4.2.7p231) 2011/11/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1940] ignore auth key if hex decoding fails.
+* Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+(4.2.7p230) 2011/11/01 Released by Harlan Stenn <stenn@ntp.org>
+* Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+* Directly limit the number of datagrams in a mrulist response, rather
+ than limiting the number of entries returned to indirectly limit the
+ datagram count.
+* Documentation updates from Dave Mills.
+(4.2.7p229) 2011/10/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1995] fix wrong use of ZERO() macro in 'ntp_calendar.c'
+(4.2.7p228) 2011/10/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1995] add compile time stamp based era unfolding for
+ 'step_systime()' and necessary support to 'ntp-calendar.c'.
+(4.2.7p227) 2011/10/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2036] gcc 2.95.3 preprocessor can't nest #ifdef in macro args.
+* A number of compiler warnings eliminated.
+(4.2.7p226) 2011/10/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2035] ntpq -c mrulist sleeps 1 sec between queries, not 5 msec.
+* Documentation updates from Dave Mills.
+(4.2.7p225) 2011/10/15 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p224) 2011/10/14 Released by Harlan Stenn <stenn@ntp.org>
+* ntpq mrulist shows intermediate counts every five seconds while
+ retrieving list, and allows Ctrl-C interruption of the retrieval,
+ showing the incomplete list as retrieved. Reduce delay between
+ successive mrulist retrieval queries from 30 to 5 msec. Do not
+ give up mrulist retrieval when a single query times out.
+(4.2.7p223) 2011/10/12 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p222) 2011/10/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2029] "make check" clutters syslog.
+* Log signal description along with number on ntpd exit.
+(4.2.7p221) 2011/10/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2025] Switching between daemon and kernel loops can doubly-
+ correct drift
+* [Bug 2028] ntpd -n (nofork) redirects logging to stderr.
+* Documentation updates from Dave Mills.
+(4.2.7p220) 2011/10/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1945] mbg_gps166.h use of _TM_DEFINED conflicts with MS VC.
+* [Bug 1946] parse_start uses open; does not work on Windows.
+* [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+* [Bug 2024] Remove unused system event code EVNT_CLKHOP.
+(4.2.7p219) 2011/10/04 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p218) 2011/10/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2019] Allow selection of cipher for private key files.
+* Documentation updates from Dave Mills.
+* ntp-keygen private key cipher default now triple-key triple DES CBC.
+* ntp-keygen -M is intended to ignore all other defaults and
+ options, so do not attempt to open existing Autokey host certificate
+ before generating symmetric keys and terminating.
+* Restore IFF, MV, and GQ identity parameter filename convention to
+ ntpkey_<scheme>par_<group/host> in ntpd, matching ntp-keygen.
+* Change some error logging to syslog to ignore logconfig mask, such
+ as reporting PPSAPI failure in NMEA and WWVB refclocks.
+* ntp-keygen on Windows XP and later systems will now create links
+ expected by ntpd. They are hardlinks on Windows, soft on POSIX.
+* Conditionalize NMEA serial open message under clockevent.
+* Send all peer variables to trappers in report_event().
+(4.2.7p217) 2011/09/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2020] ntp-keygen -s no longer sets host in cert file name.
+* [Backward Incompatible] ntp-keygen -i option long name changed from
+ misleading --issuer-name to --ident.
+(4.2.7p216) 2011/09/27 Released by Harlan Stenn <stenn@ntp.org>
+* sntp documentation tag cleanup.
+* mdoc2man improvements.
+(4.2.7p215) 2011/09/24 Released by Harlan Stenn <stenn@ntp.org>
+* Use patched mdoc2man script, from Eric Feng.
+* Sync with ntp-4.2.6p4 (a no-op).
+(4.2.7p214) 2011/09/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1981] Initial offset convergence applies frequency correction 2x
+ with kernel discipline.
+* [Bug 2008] Initial offset convergence degraded with 500 PPM adjtime().
+* [Bug 2009] EVNT_NSET adj_systime() mishandled by Windows ntpd.
+(4.2.7p213) 2011/09/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1999] NMEA does not send PMOTG messages any more.
+(4.2.7p212) 2011/09/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2003] from 4.2.6p4-RC3: ntpq_read_assoc_peervars() broken.
+(4.2.7p211) 2011/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* Update libevent to git head (2.1 branch) as of 2.0.14-stable.
+(4.2.7p210) 2011/08/31 Released by Harlan Stenn <stenn@ntp.org>
+* Require -D4 or higher for ntpd SIGALRM debug trace from [Bug 2000].
+(4.2.7p209) 2011/08/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2000] ntpd worker threads must block signals expected in main
+ thread.
+* [Bug 2001] add ntpq -c timerstats like ntpdc -c timerstats.
+* [Bug 2001] from 4.2.6p4-RC3: ntpdc timerstats reports overruns as
+ handled.
+* Update sntp tests to track the change of root dispersion to
+ synchronization distance.
+(4.2.7p208) 2011/08/24 Released by Harlan Stenn <stenn@ntp.org>
+* Fix the CLOCK_MONOTONIC TRACE() message.
+(4.2.7p207) 2011/08/22 Released by Harlan Stenn <stenn@ntp.org>
+* Restore the original CLOCK_MONOTONIC output format in sntp.
+* Cleanups for ntp-wait-opts.def and ntp.keys.def .
+(4.2.7p206) 2011/08/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1993] ntpd Windows port adj_systime() broken in 4.2.7p203.
+* sntp documentation and behavior improvements suggested by
+ Steven Sommars.
+* Have sntp report synchronization distance instead of root dispersion.
+* Clean up ntp-wait-opts.def .
+(4.2.7p205) 2011/08/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1992] util/tg2 doesn't compile, needs libntp.
+(4.2.7p204) 2011/08/16 Released by Harlan Stenn <stenn@ntp.org>
+* Added support for Garmin's $PGRMF sentence to NMEA driver
+* [Bug 1988] Better sntp send failed error message needed.
+* [Bug 1989] sntp manual page sometimes refers to SNTP as a program.
+* [Bug 1990] sntp output should include stratum.
+(4.2.7p203) 2011/08/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1986] Require Visual C++ 2005 or later compilers in Windows port.
+* Actually use long long for (u_)int64 by correcting spelling of
+ SIZEOF_LONG_LONG in ntp_types.h.
+* Force .exe minimum Windows version to 0x0400 to allow NT4 in
+ vs2005/*.vcproj files.
+* Fix make distcheck with --enable-libevent-regress problem with
+ unwritable $srcdir.
+* Correct init_logging()'s def_syslogmask type to u_int32 following
+ change of ntp_syslogmask from u_long to u_int32 in p202.
+(4.2.7p202) 2011/08/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1983] --without-sntp build breaks in sntp subdir.
+* [Bug 1984] from 4.2.6p4-RC3: ntp/libisc fails to compile on OS X 10.7.
+* [Bug 1985] from 4.2.6p4-RC3: "logconfig =allall" rejected.
+(4.2.7p201) 2011/08/05 Released by Harlan Stenn <stenn@ntp.org>
+* sntp: change -h/--headspace to -g/--gap, and change the default gap
+ from 10 to 50ms
+* [Backward Incompatible] from 4.2.6p4: sntp: -l/--filelog ->
+ -l/--logfile, to be consistent with ntpd.
+* Documentation updates from Dave Mills.
+* From 4.2.6p4: libopts/file.c fix from Bruce Korb (arg-type=file).
+(4.2.7p200) 2011/08/04 Released by Harlan Stenn <stenn@ntp.org>
+* Sync with 4.2.6p4-RC2.
+(4.2.7p199) 2011/07/29 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p198) 2011/07/28 Released by Harlan Stenn <stenn@ntp.org>
+* remove old binsubdir stuff from SNTP, as NTP_LOCINFO does that now.
+(4.2.7p197) 2011/07/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1975] from 4.2.6p4-RC2: libntp/mktime.c won't work with 64-bit
+ time_t
+* [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
+* [Bug 1977] Fix flag/description mismatches in ntp-keygen-opts.def.
+* Do not force "legacy" when --with-locfile is not given, genLocInfo
+ will find the correct default for the system.
+* Fix warnings in ntp_request.c ([Bug 1973] oversight) and sntp/main.c
+ (CID 159, apparent overrun due to union, actually correct).
+* Update sntp/loc/solaris to conform to stock locations.
+(4.2.7p196) 2011/07/27 Released by Harlan Stenn <stenn@ntp.org>
+* DEFAULT INSTALLATION DIRECTORY CHANGES ON SOME OSes: to get the old
+ behavior, pass --with-locfile=legacy to 'configure'
+* [Bug 1972] from 4.2.6p4-RC2: checking for struct rtattr fails.
+* [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+* Removed sntp/m4/ntp_bindir.m4 - no longer needed.
+* Move loc/ to sntp/loc/ .
+* Move scripts/cvo.sh to sntp/scripts/cvo.sh .
+* Move scripts/genLocInfo to sntp/scripts/genLocInfo .
+* Give NTP_LOCINFO an optional path-to argument.
+* Remove hacks to get NTP_LOCINFO-related data to sntp/ .
+* Move sntp/include/mansec2subst.sed to sntp/scripts/mansec2subst.sed .
+* If no "more specific" loc file is found for redhat* or fedora*,
+ look for a loc/redhat file.
+* If no "more specific" loc file is found and uname says this is Linux,
+ look for a loc/linux file.
+* Improve the help text: --with-locfile=XXX .
+* work around solaris /bin/sh issues for genLocInfo.
+(4.2.7p195) 2011/07/25 Released by Harlan Stenn <stenn@ntp.org>
+* Added loc/redhat.
+(4.2.7p194) 2011/07/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1608] from 4.2.6p4-RC2: Parse Refclock driver should honor
+ trusttime.
+* Add support for installing programs and scripts to libexec.
+* Added loc/solaris.
+(4.2.7p193) 2011/07/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1970] from 4.2.6p4-RC2: UNLINK_EXPR_SLIST() causes crash if list
+ is empty.
+* Update libevent to 2.1 HEAD as of merge of 2.0.13-stable-dev.
+* Match addr_eqprefix() sizeof and memcpy destination to make it clear
+ to static analysis that there is no buffer overrun (CID 402).
+(4.2.7p192) 2011/07/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1966] Broken FILES section for ntp.keys.def.
+(4.2.7p191) 2011/07/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1948] Update man page section layout.
+* [Bug 1963] add reset command for ntpq :config, similar to ntpdc's.
+* [Bug 1964] --without-sntp should not build sntp.
+(4.2.7p190) 2011/07/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1961] from 4.2.6p4: html2man update: distribute ntp-wait.html.
+* Require autogen-5.12.
+(4.2.7p189) 2011/07/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1134] from 4.2.6p4-RC1: ntpd fails binding to tentative IPv6
+ addresses.
+* [Bug 1790] from 4.2.6p4-RC1: Update config.guess and config.sub to
+ detect AIX6.
+(4.2.7p188) 2011/06/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1958] genLocInfo must export PATH.
+* ntp-wait: some versions of ntpd spell "associd" differently.
+(4.2.7p187) 2011/06/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1954] Fix typos in [s]bin_PROGRAMS in ntpd/Makefile.am.
+* Implement --with-locfile=filename configure argument. If filename is
+ empty we'll look under loc/ for a good fit. If the filename contains
+ a / character, it will be treated as a "normal" pathname. Otherwise,
+ that explicit file will be searched for under loc/ .
+(4.2.7p186) 2011/06/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1950] Control installation of event_rpcgen.py.
+* Update .point-changed-filelist for the new man pages.
+* Update the building of OS-specific programs.
+* Finish conversion to genLocInfo.
+* validate MANTAGFMT in genLocInfo.
+* Documentation update from Dave Mills.
+(4.2.7p185) 2011/06/21 Released by Harlan Stenn <stenn@ntp.org>
+* ntp_locs.m4: handle the case where . is not in the PATH.
+* More genLocInfo cleanup.
+(4.2.7p184) 2011/06/20 Released by Harlan Stenn <stenn@ntp.org>
+* Added ntp_locs.m4.
+* genLocInfo improvements.
+* Add the man page tag "flavor" to the loc.* files.
+* Add/distribute genLocInfo.
+(4.2.7p183) 2011/06/19 Released by Harlan Stenn <stenn@ntp.org>
+* Update the autogen include list for scripts/Makefile.am.
+* Added loc.freebsd (and distribute it).
+* Added loc.legacy (and distribute it).
+(4.2.7p182) 2011/06/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1304] Update sntp.html to reflect new implementation.
+* Update .point-changed-filelist .
+* ntpdc documentation fixes.
+* Update ntp-wait autogen docs.
+* Update the ntpd autogen docs.
+* Update the ntpsnmpd autogen docs.
+* Use autogen to produce ntp-keygen docs.
+* Add "license name" to ntp.lic for autogen-5.11.10.
+* Prepare for ntp.keys.5.
+(4.2.7p181) 2011/06/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1938] addr_eqprefix() doesn't clear enough storage.
+(4.2.7p180) 2011/06/06 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to libevent-2.0.12.
+* More sntp.1 cleanups.
+* Produce ntpq.1 with the new autogen macros.
+* Remove the deprecated "detail" stanza from ntpdc-opts.def.
+(4.2.7p179) 2011/06/03 Released by Harlan Stenn <stenn@ntp.org>
+* Update cmd-doc.tlib to autogen-5.11.10pre5.
+* Upgrade local autoopts templates to 5.11.10pre5.
+(4.2.7p178) 2011/06/02 Released by Harlan Stenn <stenn@ntp.org>
+* Update the std_def_list to include the ntp.lic file.
+* Distribute the ntp.lic file.
+* Add http://ntp.org/license to the ntp.lic file.
+(4.2.7p177) 2011/06/01 Released by Harlan Stenn <stenn@ntp.org>
+* Use the latest autogen's new copyright template code.
+* Clean up the ntp.lic file.
+(4.2.7p176) 2011/05/31 Released by Harlan Stenn <stenn@ntp.org>
+* sntp documentation cleanup.
+* autogen documentation template cleanup.
+(4.2.7p175) 2011/05/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1936] Correctly set IPV6_MULTICAST_LOOP.
+* cmd-doc.tlib cleanup from Bruce Korb.
+* sntp documentation cleanup.
+(4.2.7p174) 2011/05/28 Released by Harlan Stenn <stenn@ntp.org>
+* ntpdc documentation cleanup.
+* sntp documentation cleanup.
+* Don't build libevent with openssl support. Right now, libevent
+ doesn't use pkg-config to find openssl's installation location.
+(4.2.7p173) 2011/05/25 Released by Harlan Stenn <stenn@ntp.org>
+* Typo in emalloc.c hides file and line number from emalloc() error msg.
+* parsesolaris.c compile fails on SPARC Solaris with conflicting printf.
+* ntp_util.c compile fails on AIX and OSF with conflicting statsdir.
+(4.2.7p172) 2011/05/24 Released by Harlan Stenn <stenn@ntp.org>
+* Remove hardcoded 1/960 s. fudge for <CR> transmission time at 9600 8n1
+ from WWVB/Spectracom driver introduced in 4.2.7p169.
+(4.2.7p171) 2011/05/23 Released by Harlan Stenn <stenn@ntp.org>
+* Eliminate warnings about shadowing global "basename" on Linux.
+* Use filegen_config() consistently when changing filegen options.
+* mprintf() should go to stdout, not stderr. DPRINTF() uses mprintf().
+* Repair a few simulator problems (more remain).
+* Documentation updates from Dave Mills.
+(4.2.7p170) 2011/05/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1932] libevent/util_internal.h builtin_expect compile error with
+ gcc 2.95.
+* Use 64-bit scalars in LFPTOD() and DTOLFP() on more platforms by
+ conditionalizing on HAVE_U_INT64 rather than UINT64_MAX.
+(4.2.7p169) 2011/05/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs.
+(4.2.7p168) 2011/05/16 Released by Harlan Stenn <stenn@ntp.org>
+* Convert receive buffer queue from doubly-linked list to FIFO.
+(4.2.7p167) 2011/05/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1927] io_closeclock() should purge pending recvbufs.
+* [Bug 1931] cv always includes fudgetime1, never fudgetime2.
+* Use acts_close() in acts_shutdown() to avoid leaving a stale lockfile
+ if unpeered via runtime configuration while the modem is open.
+* Correct acts_close() test of pp->io.fd to see if it is open.
+* 4.2.7p164 documentation updates re: 'tos orphanwait' expanded scope.
+(4.2.7p166) 2011/05/13 Released by Harlan Stenn <stenn@ntp.org>
+* If we have local overrides for autogen template files, use them.
+* Convert more of the sntp-opt.def documentation from man to mdoc.
+(4.2.7p165) 2011/05/11 Released by Harlan Stenn <stenn@ntp.org>
+* Convert snmp docs to mdoc format, which requires autogen 5.11.9.
+* from 4.2.6p4-RC1: Require autogen 5.11.9.
+(4.2.7p164) 2011/05/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 988] Local clock eats up -g option, so ntpd stops with large
+ initial time offset.
+* [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial
+ candidate list.
+* [Bug 1922] "tos orphanwait" applied incorrectly at startup.
+* [Bug 1923] orphan parent favored over LOCAL, ACTS drivers.
+* [Bug 1924] Billboard tally codes sometimes do not match operation,
+ variables.
+* Change "pool DNS" messages from msyslog to debug trace output.
+* Remove unused FLAG_SYSPEER from peer->status.
+* Respect "tos orphanwait" at startup. Previously there was an
+ unconditional 300 s. startup orphanwait, though other values were
+ respected for subsequent orphan wait periods after no_sys_peer events.
+* Apply "tos orphanwait" (def. 300 seconds) to LOCAL and ACTS reference
+ clock drivers, in addition to orphan parent operation. LOCAL and ACTS
+ are not selectable during the orphanwait delay at startup and after
+ each no_sys_peer event. This prevents a particular form of clock-
+ hopping, such as using LOCAL briefly at startup before remote peers
+ are selectable. This fixes the issue reported in [Bug 988].
+* Documentation updates from Dave Mills.
+(4.2.7p163) 2011/05/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1911] missing curly brace in libntp/ntp_rfc2553.c
+(4.2.7p162) 2011/05/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1910] Support the Tristate Ltd. TS-GPSclock-01.
+(4.2.7p161) 2011/05/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1904] 4.2.7p160 Windows build broken (POSIX_SHELL).
+* [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+* Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+* Add missing --enable-local-libevent help to top-level configure.
+(4.2.7p160) 2011/05/01 Released by Harlan Stenn <stenn@ntp.org>
+* from 4.2.6p4-RC1: Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8.
+* [Bug 1901] Simulator does not set progname.
+(4.2.7p159) 2011/04/28 Released by Harlan Stenn <stenn@ntp.org>
+* Fix a couple of unused variable warnings.
+* cleanup in timespecops.c / timevalops.c
+(4.2.7p158) 2011/04/24 Released by Harlan Stenn <stenn@ntp.org>
+* Update libevent --disable-libevent-regress handling to work when
+ building libevent using mingw.
+(4.2.7p157) 2011/04/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1890] 4.2.7p156 segfault in duplicate freeaddrinfo().
+(4.2.7p156) 2011/04/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1851] freeaddrinfo() called after getaddrinfo() fails.
+(4.2.7p155) 2011/04/18 Released by Harlan Stenn <stenn@ntp.org>
+* Fix leak in refclock_datum.c start failure path.
+(4.2.7p154) 2011/04/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1887] DNS fails on 4.2.7p153 using threads.
+(4.2.7p153) 2011/04/16 Released by Harlan Stenn <stenn@ntp.org>
+* A few more Coverity Scan cleanups.
+(4.2.7p152) 2011/04/15 Released by Harlan Stenn <stenn@ntp.org>
+* Update embedded libevent to current 2.1 git HEAD.
+(4.2.7p151) 2011/04/14 Released by Harlan Stenn <stenn@ntp.org>
+* Detect vsnprintf() support for "%m" and disable our "%m" expansion.
+* Add --enable-c99-sprintf to configure args for -noopenssl variety of
+ flock-build to avoid regressions in (v)snprintf() replacement.
+* More msnprintf() unit tests.
+* Coverity Scan error checking fixes.
+* Log failure to fetch time from HOPF_P hardware.
+* Check HOPF_S sscanf() conversion count before converted values.
+(4.2.7p150) 2011/04/13 Released by Harlan Stenn <stenn@ntp.org>
+* Remove never-used, incomplete ports/winnt/ntpd/refclock_trimbledc.[ch]
+* On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements (http://www.jhweiss.de/software/snprintf.html)
+* Remove remaining sprintf() calls except refclock_ripencc.c (which is
+ kept out of --enable-all-clocks as a result), upstream libs which use
+ sprintf() only after careful buffer sizing.
+(4.2.7p149) 2011/04/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1881] describe the {+,-,s} characters in configure --help output.
+(4.2.7p148) 2011/04/09 Released by Harlan Stenn <stenn@ntp.org>
+* Use _mkgmtime() as timegm() in the Windows port, rather than
+ libntp/mktime.c's timegm(). Fixed [Bug 1875] on Windows using the old
+ asn2ntp() code from before 4.2.7p147.
+* ntp_crypto.c string buffer safety.
+* Remove use of MAXFILENAME in mode 7 (ntpdc) on-wire structs.
+* Change ntpd MAXFILENAME from 128 to 256 to match ntp-keygen.
+* Buffer safety and sign extension fixes (thanks Coverity Scan).
+(4.2.7p147) 2011/04/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1875] 'asn2ntp()' rewritten with 'caltontp()'; 'timegm()'
+ substitute likely to crash with 64bit time_t.
+(4.2.7p146) 2011/04/05 Released by Harlan Stenn <stenn@ntp.org>
+* String buffer safety cleanup, converting to strlcpy() and strlcat().
+* Use utmpname() before pututline() so repeated steps do not
+ accidentally record into wtmp where utmp was intended.
+* Use setutent() before each pututline() including first.
+(4.2.7p145) 2011/04/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1840] ntp_lists.h FIFO macros buggy.
+(4.2.7p144) 2011/04/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1874] ntpq -c "rv 0 sys_var_list" empty.
+(4.2.7p143) 2011/03/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1732] ntpd ties up CPU on disconnected USB refclock.
+* [Bug 1861] tickadj build failure using uClibc.
+* [Bug 1862] in6addr_any test in configure fooled by arm gcc 4.1.3 -O2.
+* Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+* Remove "signal_no_reset: signal 17 had flags 4000000" logging, as it
+ indicates no problem and is interpreted as an error. Previously some
+ bits had been ignored one-by-one, but Linux SA_RESTORER definition is
+ unavailable to user headers.
+(4.2.7p142) 2011/03/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1844] ntpd 4.2.7p131 NetBSD, --gc-sections links bad executable.
+* Fix "make distcheck" break in libevent/sample caused by typo.
+(4.2.7p141) 2011/03/20 Released by Harlan Stenn <stenn@ntp.org>
+* Add "ntpq -c iostats" similar to "ntpdc -c iostats".
+* Compare entire timestamp to reject duplicates in refclock_pps().
+(4.2.7p140) 2011/03/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1848] ntpd 4.2.7p139 --disable-thread-support does not compile.
+* Add --disable-thread-support to one flock-build variation.
+* One more lock-while-init in lib/isc/task.c to quiet lock analysis.
+(4.2.7p139) 2011/03/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1848] make check ntpd --saveconfigquit clutters syslog.
+(4.2.7p138) 2011/03/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1846] MacOSX: debug symbol not found by propdelay or tickadj.
+(4.2.7p137) 2011/03/07 Released by Harlan Stenn <stenn@ntp.org>
+* Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+* Declare debug in libntp instead of each program. Expose extern
+ declaration to utilities, libntp, and DEBUG ntpd.
+* Lock under-construction task, taskmgr objects to satisfy Coverity's
+ mostly-correct assumptions about which variables are protected by
+ which locks.
+(4.2.7p136) 2011/03/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1839] 4.2.7p135 still installs libevent ev*.h headers.
+(4.2.7p135) 2011/03/02 Released by Harlan Stenn <stenn@ntp.org>
+* libevent: When building on systems with CLOCK_MONOTONIC available,
+ separate the internal timeline (possibly counting since system boot)
+ from the gettimeofday() timeline in event_base cached timevals. Adds
+ new event_base_tv_cached() to retrieve cached callback round start
+ time on the internal timeline, and changes
+ event_based_gettimeofday_cached() to always return times using the
+ namesake timeline. This preserves the benefit of using the never-
+ stepped monotonic clock for event timeouts while providing clients
+ with times consistently using gettimeofday().
+* Correct event_base_gettimeofday_cached() workaround code in
+ sntp to work with corrected libevent.
+* Remove sntp l_fp_output() test now that it uses prettydate().
+* [Bug 1839] 4.2.7p131 installs libevent ev*.h headers.
+* Ensure CONFIG_SHELL is not empty before relying on it for #! scripts.
+(4.2.7p134) 2011/02/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1837] Build fails on Win7 due to regedit requiring privilege.
+* Provide fallback definitions for GetAdaptersAddresses() for Windows
+ build environments lacking iphlpapi.h.
+* Rename file containing 1.xxxx ChangeSet revision from version to
+ scm-rev to avoid invoking GNU make implicit rules attempting to
+ compile version.c into version. Problem was with sntp/version.o
+ during make distcheck after fix for spurious sntp rebuilds.
+* Add INC_ALIGNED_PTR() macro to align pointers like malloc().
+(4.2.7p133) 2011/02/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1834] ntpdate 4.2.7p131 aborts with assertion failure.
+* Move sntp last in top-level Makefile.am SUBDIRS so that the libevent
+ tearoff (if required) and sntp are compiled after the rest.
+* Use a single set of Automake options for each package in configure.ac
+ AM_INIT, remove Makefile.am AUTOMAKE_OPTIONS= lines.
+* Correct spurious sntp rebuilds triggered by a make misperception
+ sntp/version was out-of-date relative to phony target FRC.version.
+* Do not cache paths to perl, test, or pkg-config, searching the PATH
+ at configure time is worth it to pick up tool updates.
+(4.2.7p132) 2011/02/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1832] ntpdate doesn't allow timeout > 2s.
+* [Bug 1833] The checking sem_timedwait() fails without -pthread.
+* ElectricFence was suffering bitrot - remove it. valgrind works well.
+* Enable all relevant automake warnings.
+* Correct Solaris 2.1x PTHREAD_ONCE_INIT extra braces test to avoid
+ triggering warnings due to excess braces.
+* Remove libevent-cfg from sntp/Makefile.am.
+* Provide bug report and URL options to Autoconf.
+* Avoid relying on remake rules for routine build/flock-build for
+ libevent as for the top-level and sntp subproject.
+(4.2.7p131) 2011/02/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1087] -v/--normalverbose conflicts with -v/--version in sntp.
+* [Bug 1088] sntp should (only) report the time difference without -s/-a.
+* older autoconf sometimes dislikes [].
+* Move "can't write KoD file" warning from sntp shutdown to startup.
+* refclock_acts.c cleanup from Dave Mills.
+* Convert sntp to libevent event-driven socket programming. Instead of
+ blocking name resolution and querying one NTP server at a time,
+ resolve server names and send NTP queries without blocking. Add
+ sntp command-line options to adjust timing and optionally wait for all
+ servers to respond instead of exiting after the first.
+* Import libevent 2.0.10-stable plus local patches as a tearoff, used
+ only if the target system lacks an installed libevent 2.0.9 or later.
+* Move blocking worker and resolver to libntp from ntpd.
+* Use threads rather than forked child processes for blocking worker
+ when possible. Override with configure --disable-thread-support.
+* Move init_logging(), change_logfile(), and setup_logfile() from ntpd
+ to libntp, use them in sntp.
+* Test --without-sntp in flock-build script's -no-refclocks variety.
+* Avoid invoking config.status twice in a row in build script.
+* Move more m4sh tests needed by libntp to shared .m4 files.
+* Split up ntp_libntp.m4 into smaller, more specific subsets.
+* Enable gcc -Wcast-align, fix many instances of warnings when casting
+ a pointer to a more-strictly-aligned underlying type.
+(4.2.7p130) 2011/02/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1811] Update the download location in WHERE-TO-START.
+(4.2.7p129) 2011/02/09 Released by Harlan Stenn <stenn@ntp.org>
+* Add missing "break;" to ntp_control.c ctl_putsys() for caliberrs, used
+ by ntpq -c kerninfo introduced in 4.2.7p104.
+* Fix leak in ntp_control.c read_mru_list().
+(4.2.7p128) 2011/01/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1799] ntpq mrv crash.
+* [Bug 1801] ntpq mreadvar requires prior association caching.
+(4.2.7p127) 2011/01/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1797] Restore stale timestamp check from the RANGEGATE cleanup.
+(4.2.7p126) 2011/01/27 Released by Harlan Stenn <stenn@ntp.org>
+* Fix unexposed fencepost error in format_time_fraction().
+* Add more unit tests for timeval_tostr() and timespec_tostr().
+(4.2.7p125) 2011/01/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1794] ntpq -c rv missing clk_wander information.
+* [Bug 1795] ntpq readvar does not display last variable.
+(4.2.7p124) 2011/01/25 Released by Harlan Stenn <stenn@ntp.org>
+* sntp/Makefile.am needs any passed-in CFLAGS.
+(4.2.7p123) 2011/01/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1788] tvtots.c tables inaccurate
+(4.2.7p122) 2011/01/22 Released by Harlan Stenn <stenn@ntp.org>
+* ACTS refclock cleanup from Dave Mills.
+* Avoid shadowing the "group" global variable.
+(4.2.7p121) 2011/01/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1786] Remove extra semicolon from ntp_proto.c .
+(4.2.7p120) 2011/01/20 Released by Harlan Stenn <stenn@ntp.org>
+* Change new timeval and timespec to string routines to use snprintf()
+ rather than hand-crafted conversion, avoid signed int overflow there.
+* Add configure support for SIZEOF_LONG_LONG to enable portable use of
+ snprintf() with time_t.
+* Grow ntpd/work_thread.c arrays as needed.
+* Add DEBUG_* variants of ntp_assert.h macros which compile away using
+ ./configure --disable-debugging.
+* Fix tvalops.cpp unit test failures for 32-bit builds.
+* Return to a single autoreconf invocation in ./bootstrap script.
+* Fix warnings seen on FreeBSD 9.
+* crypto group changes from Dave Mills.
+* Lose the RANGEGATE check in PPS, from Dave Mills.
+* ACTS refclock cleanup from Dave Mills.
+* Documentation updates from Dave Mills.
+* NMEA driver documentation update from Juergen Perlinger.
+(4.2.7p119) 2011/01/18 Released by Harlan Stenn <stenn@ntp.org>
+* added timespecops.{c,h} and tievalops.{c.h} to libntp and include
+ added tspecops.cpp to tests/libntp
+* Correct msyslog.c build break on Solaris 2.9 from #ifdef/#if mixup.
+(4.2.7p118) 2011/01/15 Released by Harlan Stenn <stenn@ntp.org>
+* Simplify the built-sources stuff in sntp/ .
+* Fix check for -lipv6 on HP-UX 11.
+(4.2.7p117) 2011/01/13 Released by Harlan Stenn <stenn@ntp.org>
+* Add configure --without-sntp option to disable building sntp and
+ sntp/tests. withsntp=no in the environment changes the default.
+* Build infrastructure cleanup:
+ Move m4 directory to sntp/m4.
+ Share a single set of genver output between sntp and the top level.
+ Share a single set of autogen included .defs in sntp/include.
+ Share a single set of build-aux scripts (e.g. config.guess, missing).
+ Add ntp_libntp.m4 and ntp_ipv6.m4 to reduce configure.ac duplication.
+ Warn and exit build/flock-build if bootstrap needs to be run.
+(4.2.7p116) 2011/01/10 Released by Harlan Stenn <stenn@ntp.org>
+* refclock_nmea.c refactoring by Juergen Perlinger.
+(4.2.7p115) 2011/01/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1780] Windows ntpd 4.2.7p114 crashes in ioctl().
+* [Bug 1781] longlong undefined in sntp handle_pkt() on Debian amd64.
+(4.2.7p114) 2011/01/08 Released by Harlan Stenn <stenn@ntp.org>
+* Fix for openssl pkg-config detection eval failure.
+* Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+(4.2.7p113) 2011/01/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1776] sntp mishandles -t/--timeout and -a/--authentication.
+* Default to silent make rules, override with make V=1 or ./configure
+ --disable-silent-rules.
+* Correct --with-openssl-incdir defaulting with pkg-config.
+* Correct ./build on systems without gtest available.
+* Begin moving some of the low-level socket stuff to libntp.
+(4.2.7p112) 2011/01/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1773] openssl not detected during ./configure.
+* [Bug 1774] Segfaults if cryptostats enabled and built without OpenSSL.
+* Use make V=0 in build script to increase signal/noise ratio.
+(4.2.7p111) 2011/01/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1772] refclock_open() return value check wrong for ACTS.
+* Default --with-openssl-libdir and --with-openssl-incdir to the values
+ from pkg-config, falling back on our usual search paths if pkg-config
+ is not available or does not have openssl.pc on PKG_CONFIG_PATH.
+* Change refclock_open() to return -1 on failure like open().
+* Update all refclock_open() callers to check for fd <= 0 indicating
+ failure, so they work with older and newer refclock_open() and can
+ easily backport.
+* Initialize refclockproc.rio.fd to -1, harmonize refclock shutdown
+ entrypoints to avoid crashing, particularly if refclock_open() fails.
+* Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+(4.2.7p110) 2011/01/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1771] algorithmic error in 'clocktime()' fixed.
+* Unit tests extended for hard-coded system time.
+* make V=0 and configure --enable-silent-rules supported.
+* setvar modemsetup = ATE0... overrides ACTS driver default.
+* Preserve last timecode in ACTS driver (ntpq -ccv).
+* Tolerate previous ATE1 state when sending ACTS setup.
+* Enable raw tty line discipline in Windows port.
+* Allow tty open/close/open to succeed on Windows port.
+* Enable ACTS and CHU reference clock drivers on Windows.
+(4.2.7p109) 2011/01/02 Released by Harlan Stenn <stenn@ntp.org>
+* Remove nearly all strcpy() and most strcat() from NTP distribution.
+ One major pocket remains in ntp_crypto.c. libopts & libisc also have
+ (safe) uses of strcpy() and strcat() remaining.
+* Documentation updates from Dave Mills.
+(4.2.7p108) 2011/01/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1764] Move Palisade modem control logic to configure.ac.
+* [Bug 1768] TIOCFLUSH undefined in linux for refclock_acts.
+* Autokey multiple identity group improvements from Dave Mills.
+* from 4.2.6p3: Update the copyright year.
+(4.2.7p107) 2010/12/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1764] Palisade driver doesn't build on Linux.
+* [Bug 1766] Oncore clock has offset/high jitter at startup.
+* Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+* refclock_acts.c updates from Dave Mills.
+(4.2.7p106) 2010/12/30 Released by Harlan Stenn <stenn@ntp.org>
+* from 4.2.6p3: Update genCommitLog for the bk-5 release.
+(4.2.7p105) 2010/12/29 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.7p104) 2010/12/28 Released by Harlan Stenn <stenn@ntp.org>
+* from 4.2.6p3: Create and use scripts/check--help when generating
+ .texi files.
+* from 4.2.6p3: Update bk triggers for the bk-5 release.
+* Support for multiple Autokey identity groups from Dave Mills.
+* Documentation updates from Dave Mills.
+* Add ntpq kerninfo, authinfo, and sysinfo commands similar to ntpdc's.
+(4.2.7p103) 2010/12/24 Released by Harlan Stenn <stenn@ntp.org>
+* Add ntpq pstats command similar to ntpdc's.
+* Remove ntpq pstatus command, rv/readvar does the same and more.
+* Documentation updates from Dave Mills.
+(4.2.7p102) 2010/12/23 Released by Harlan Stenn <stenn@ntp.org>
+* Allow ntpq &1 associd use without preceding association-fetching.
+* Documentation updates from Dave Mills.
+(4.2.7p101) 2010/12/22 Released by Harlan Stenn <stenn@ntp.org>
+* from 4.2.6p3-RC12: Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre7.
+* from 4.2.6p3-RC12: Relax minimum Automake version to 1.10 with updated
+ libopts.m4.
+(4.2.7p100) 2010/12/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1743] from 4.2.6p3-RC12: Display timezone offset when showing
+ time for sntp in the local timezone (documentation updates).
+(4.2.7p99) 2010/12/21 Released by Harlan Stenn <stenn@ntp.org>
+* Add unit tests for msnprintf().
+(4.2.7p98) 2010/12/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1761] clockstuff/clktest-opts.h omitted from tarball.
+* [Bug 1762] from 4.2.6p3-RC12: manycastclient responses interfere.
+* Documentation updates from Dave Mills.
+(4.2.7p97) 2010/12/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1458] from 4.2.6p3-RC12: Can not compile NTP on FreeBSD 4.7.
+* [Bug 1760] from 4.2.6p3-RC12: ntpd Windows interpolation cannot be
+ disabled.
+* from 4.2.6p3-RC12: Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre5.
+* Documentation updates from Dave Mills.
+(4.2.7p96) 2010/12/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1758] from 4.2.6p3-RC12: setsockopt IPV6_MULTICAST_IF with wrong
+ ifindex.
+* Documentation updates from Dave Mills.
+(4.2.7p95) 2010/12/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1753] 4.2.7p94 faults on startup in newpeer(), strdup(NULL).
+* [Bug 1754] from 4.2.6p3-RC12: --version output should be more verbose.
+* [Bug 1757] from 4.2.6p3-RC12: oncore snprintf("%m") doesn't expand %m.
+* from 4.2.6p3-RC12: Suppress ntp-keygen OpenSSL version display for
+ --help, --version, display both build and runtime OpenSSL versions
+ when they differ.
+* from 4.2.6p3-RC12: Upgrade to libopts 33.5.8 from AutoGen 5.11.6pre3.
+* Documentation updates from Dave Mills.
+(4.2.7p94) 2010/12/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1751] from 4.2.6p3-RC12: Support for Atari FreeMiNT OS.
+* Documentation updates from Dave Mills.
+(4.2.7p93) 2010/12/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1510] from 4.2.6p3-RC12: Add modes 20/21 for driver 8 to support
+ RAWDCF @ 75 baud.
+* [Bug 1741] from 4.2.6p3-RC12: Enable multicast reception on each
+ address (Windows).
+* from 4.2.6p3-RC12: Other manycastclient repairs:
+ Separate handling of scope ID embedded in many in6_addr from ifindex
+ used for IPv6 multicasting ioctls.
+ Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses.
+ Enable outbound multicast from only one address per interface in the
+ same subnet, and in that case prefer embedded MAC address modified
+ EUI-64 IPv6 addresses first, then static, and last RFC 4941 privacy
+ addresses.
+ Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to
+ select the local source address, using the correct socket is not
+ enough.
+* "server ... ident <groupname>" changes from Dave Mills.
+* Documentation updates from Dave Mills.
+(4.2.7p92) 2010/12/08 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1743] from 4.2.6p3-RC12: Display timezone offset when showing
+ time for sntp in the local timezone.
+(4.2.7p91) 2010/12/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1732] ntpd ties up CPU on disconnected USB device.
+* [Bug 1742] form 4.2.6p3-RC12: Fix a typo in an error message in the
+ "build" script.
+(4.2.7p90) 2010/12/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1738] Windows ntpd has wrong net adapter name.
+* [Bug 1740] ntpdc -c reslist packet count wrongly treated as signed.
+(4.2.7p89) 2010/12/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1736] tos int, bool options broken in 4.2.7p66.
+* from 4.2.6p3-RC12: Clean up the SNTP documentation.
+(4.2.7p88) 2010/12/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1735] 'clocktime()' aborts ntpd on bogus input
+(4.2.7p87) 2010/12/01 Released by Harlan Stenn <stenn@ntp.org>
+* from 4.2.6p3-RC12: Clean up m4 quoting in configure.ac, *.m4 files,
+ resolving intermittent AC_LANG_PROGRAM possibly undefined errors.
+(4.2.7p86) 2010/11/29 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p85) 2010/11/24 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p84) 2010/11/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1618] Unreachable code in jjy_start().
+* [Bug 1725] from 4.2.6p3-RC11: ntpd sends multicast from only one
+ address.
+* from 4.2.6p3-RC11: Upgrade libopts to 33.3.8.
+* from 4.2.6p3-RC11: Bump minimum Automake version to 1.11, required for
+ AM_COND_IF use in LIBOPTS_CHECK.
+* An almost complete rebuild of the initial loopfilter configuration
+ process, including the code that determines the interval between
+ frequency file updates, from Dave Mills.
+* Documentation updates from Dave Mills.
+* Add ntp-keygen -l/--lifetime to control certificate expiry.
+* JJY driver improvements for Tristate JJY01/02, including changes
+ to its clockstats format.
+* Add "nonvolatile" ntp.conf directive to control how often the
+ driftfile is written.
+(4.2.7p83) 2010/11/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1727] ntp-keygen PLEN, ILEN undeclared --without-crypto.
+* Remove top-level libopts, use sntp/libopts.
+* from 4.2.6p3-RC11: Remove log_msg() and debug_msg() from sntp in favor
+ of msyslog().
+* Documentation updates from Dave Mills.
+(4.2.7p82) 2010/11/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1728] from 4.2.6p3-RC11: In ntp_openssl.m4, don't add
+ -I/usr/include or -L/usr/lib to CPPFLAGS or LDFLAGS.
+(4.2.7p81) 2010/11/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1681] from 4.2.6p3-RC10: More sntp logging cleanup.
+* [Bug 1683] from 4.2.6p3-RC10: Non-localhost on loopback exempted from
+ nic rules.
+* [Bug 1719] Cleanup for ntp-keygen and fix -V crash, from Dave Mills.
+(4.2.7p80) 2010/11/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1574] from 4.2.6p3-RC9: sntp doesn't set tv_usec correctly.
+* [Bug 1681] from 4.2.6p3-RC9: sntp logging cleanup.
+* [Bug 1683] from 4.2.6p3-RC9: Interface binding does not seem to work
+ as intended.
+* [Bug 1708] make check fails with googletest 1.4.0.
+* [Bug 1709] from 4.2.6p3-RC9: ntpdate ignores replies with equal
+ receive and transmit timestamps.
+* [Bug 1715] sntp utilitiesTest.IPv6Address failed.
+* [Bug 1718] Improve gtest checks in configure.ac.
+(4.2.7p79) 2010/11/07 Released by Harlan Stenn <stenn@ntp.org>
+* Correct frequency estimate with no drift file, from David Mills.
+(4.2.7p78) 2010/11/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1697] filegen implementation should be improved.
+* Refactor calendar functions in terms of new common code.
+* Documentation updates from Dave Mills.
+(4.2.7p77) 2010/11/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1692] packageinfo.sh needs to be "sourced" using ./ .
+* [Bug 1695] ntpdate takes longer than necessary.
+(4.2.7p76) 2010/11/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1690] Unit tests fails to build on some systems.
+* [Bug 1691] Use first NMEA sentence each second.
+* Put the sntp tests under sntp/ .
+* ... and only build/run them if we have gtest.
+* Documentation updates from Dave Mills.
+(4.2.7p75) 2010/10/30 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* Include Linus Karlsson's GSoC 2010 testing code.
+(4.2.7p74) 2010/10/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1685] from 4.2.6p3-RC8: NMEA driver mode byte confusion.
+* from 4.2.6p3-RC8: First cut at using scripts/checkChangeLog.
+* Documentation updates from Dave Mills.
+(4.2.7p73) 2010/10/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1680] Fix alignment of clock_select() arrays.
+* refinements to new startup behavior from David Mills.
+* For the bootstrap script, touch .html files last.
+* Add 'make check' test case that would have caught [Bug 1678].
+(4.2.7p72) 2010/10/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1679] Fix test for -lsocket.
+* Clean up missing ;; entries in configure.ac.
+(4.2.7p71) 2010/10/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1676] from 4.2.6p3-RC7: NMEA: $GPGLL did not work after fix
+ for Bug 1571.
+* [Bug 1678] "restrict source" treated as "restrict default".
+* from 4.2.6p3-RC7: Added scripts/checkChangeLog.
+(4.2.7p70) 2010/10/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1571] from 4.2.6p3-RC6: NMEA does not relate data to PPS edge.
+* [Bug 1572] from 4.2.p63-RC6: NMEA time adjustment for GPZDG buggy.
+* [Bug 1675] from 4.2.6p3-RC6: Prohibit includefile remote config.
+* Enable generating ntpd/ntp_keyword.h after keyword-gen.c changes on
+ Windows as well as POSIX platforms.
+* Fix from Dave Mills for a rare singularity in clock_combine().
+(4.2.7p69) 2010/10/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1671] Automatic delay calibration is sometimes inaccurate.
+(4.2.7p68) 2010/10/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1669] from 4.2.6p3-RC5: NTP fails to compile on IBM AIX 5.3.
+* [Bug 1670] Fix peer->bias and broadcastdelay.
+* Documentation updates from Dave Mills.
+* Documentation EOL cleanup.
+(4.2.7p67) 2010/10/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1649] from 4.2.6p3-RC5: Require NMEA checksum if $GPRMC or
+ previously seen.
+(4.2.7p66) 2010/10/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1277] Provide and use O(1) FIFOs, esp. in the config tree code.
+* Remove unused 'bias' configuration keyword.
+(4.2.7p65) 2010/10/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1584] from 4.2.6p3-RC4: wrong SNMP type for precision,
+ resolution.
+* Remove 'calldelay' and 'sign' remnants from parser, ntp_config.c.
+(4.2.7p64) 2010/10/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1584] from 4.2.6p3-RC3: ntpsnmpd OID must be mib-2.197.
+* [Bug 1659] from 4.2.6p3-RC4: Need CLOCK_TRUETIME not CLOCK_TRUE.
+* [Bug 1663] ntpdsim should not open net sockets.
+* [Bug 1665] from 4.2.6p3-RC4: is_anycast() u_int32_t should be u_int32.
+* from 4.2.6p3: ntpsnmpd, libntpq warning cleanup.
+* Remove 'calldelay' and 'sign' keywords (Dave Mills).
+* Documentation updates from Dave Mills.
+(4.2.7p63) 2010/10/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1080] from 4.2.6p3-RC3: ntpd on ipv6 routers very chatty.
+* Documentation nit cleanup.
+* Documentation updates from Dave Mills.
+(4.2.7p62) 2010/10/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 750] from 4.2.6p3-RC3: Non-existing device causes coredump with
+ RIPE-NCC driver.
+* [Bug 1567] from 4.2.6p3-RC3: Support Arbiter 1093C Satellite Clock on
+ Windows.
+* [Bug 1581] from 4.2.6p3-RC3: printf format string mismatch leftover.
+* [Bug 1659] from 4.2.6p3-RC3: Support Truetime Satellite Clocks on
+ Windows.
+* [Bug 1660] from 4.2.6p3-RC3: On some systems, test is in /usr/bin, not
+ /bin.
+* [Bug 1661] from 4.2.6p3-RC3: Re-indent refclock_ripencc.c.
+* Lose peer_count from ntp_peer.c and ntp_proto.c (Dave Mills).
+* Documentation updates from Dave Mills.
+(4.2.7p61) 2010/10/06 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation and code cleanup from Dave Mills. No more NTP_MAXASSOC.
+(4.2.7p60) 2010/10/04 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p59) 2010/10/02 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* Variable name cleanup from Dave Mills.
+* [Bug 1657] darwin needs res_9_init, not res_init.
+(4.2.7p58) 2010/09/30 Released by Harlan Stenn <stenn@ntp.org>
+* Clock select bugfix from Dave Mills.
+* [Bug 1554] peer may stay selected as system peer after becoming
+ unreachable.
+* [Bug 1644] from 4.2.6p3-RC3: cvo.sh should use lsb_release to identify
+ linux distros.
+* [Bug 1646] ntpd crashes with relative path to logfile.
+(4.2.7p57) 2010/09/27 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p56) 2010/09/25 Released by Harlan Stenn <stenn@ntp.org>
+* Clock combining algorithm improvements from Dave Mills.
+* Documentation updates from Dave Mills.
+* [Bug 1642] ntpdsim can't find simulate block in config file.
+* [Bug 1643] from 4.2.6p3-RC3: Range-check the decoding of the RIPE-NCC
+ status codes.
+(4.2.7p55) 2010/09/22 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* [Bug 1636] from 4.2.6p3-RC2: segfault after denied remote config.
+(4.2.7p54) 2010/09/21 Released by Harlan Stenn <stenn@ntp.org>
+* More Initial convergence improvements from Dave Mills.
+* Documentation updates from Dave Mills.
+* [Bug 1635] from 4.2.6p3-RC2: "filegen ... enable" is not default.
+(4.2.7p53) 2010/09/20 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* More Initial convergence improvements from Dave Mills.
+(4.2.7p52) 2010/09/19 Released by Harlan Stenn <stenn@ntp.org>
+* Initial convergence improvements from Dave Mills.
+(4.2.7p51) 2010/09/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1344] from 4.2.6p3-RC1: ntpd on Windows exits without logging
+ cause.
+* [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache.
+* [Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61.
+(4.2.7p50) 2010/09/16 Released by Harlan Stenn <stenn@ntp.org>
+* Cleanup NTP_LIB_M.
+* [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris.
+(4.2.7p49) 2010/09/13 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p48) 2010/09/12 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.7p47) 2010/09/11 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* [Bug 1588] finish configure --disable-autokey implementation.
+* [Bug 1616] refclock_acts.c: if (pp->leap == 2) is always false.
+* [Bug 1620] [Backward Incompatible] "discard minimum" value should be in
+ seconds, not log2 seconds.
+(4.2.7p46) 2010/09/10 Released by Harlan Stenn <stenn@ntp.org>
+* Use AC_SEARCH_LIBS instead of AC_CHECK_LIB for NTP_LIB_M.
+(4.2.7p45) 2010/09/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1578] Consistently use -lm when needed.
+(4.2.7p44) 2010/08/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1573] from 4.2.6p3-beta1: Miscalculation of offset in sntp.
+(4.2.7p43) 2010/08/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1602] Refactor some of the sntp/ directory to facililtate testing.
+(4.2.7p42) 2010/08/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1593] ntpd abort in free() with logconfig syntax error.
+* [Bug 1595] from 4.2.6p3-beta1: empty last line in key file causes
+ duplicate key to be added
+* [Bug 1597] from 4.2.6p3-beta1: packet processing ignores RATE KoD packets,
+ Because of a bug in string comparison.
+(4.2.7p41) 2010/07/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1581] from 4.2.6p3-beta1: ntp_intres.c size_t printf format
+ string mismatch.
+* [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+* Avoid race with parallel builds using same source directory in
+ scripts/genver by using build directory for temporary files.
+* orphanwait documentation updates.
+(4.2.7p40) 2010/07/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1395] ease ntpdate elimination with ntpd -w/--wait-sync
+* [Bug 1396] allow servers on ntpd command line like ntpdate
+(4.2.7p39) 2010/07/09 Released by Harlan Stenn <stenn@ntp.org>
+* Fix typo in driver28.html.
+* [Bug 1581] from 4.2.6p2: size_t printf format string mismatches, IRIG
+ string buffers undersized. Mostly backported from earlier ntp-dev
+ fixes by Juergen Perlinger.
+(4.2.7p38) 2010/06/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1570] backported to 4.2.6p2-RC7.
+* [Bug 1575] from 4.2.6p2-RC7: use 'snprintf' with LIB_BUFLENGTH in
+ inttoa.c, tvtoa.c and utvtoa.c
+* [Bug 1576] backported to 4.2.6p2-RC7.
+* Typo fix in a comment in ntp_proto.c.
+(4.2.7p37) 2010/06/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD.
+(4.2.7p36) 2010/06/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1560] Initial support for orphanwait, from Dave Mills.
+* clock_filter()/reachability fixes from Dave Mills.
+(4.2.7p35) 2010/06/12 Released by Harlan Stenn <stenn@ntp.org>
+* Rewrite of multiprecision macros in 'ntp_fp.h' from J. Perlinger
+ <perlinger@ntp.org>
+* [Bug 715] from 4.2.6p2-RC6: libisc Linux IPv6 interface iteration
+ drops multicast flags.
+(4.2.7p34) 2010/06/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1570] serial clock drivers get outdated input from kernel tty
+ line buffer after startup
+(4.2.7p33) 2010/06/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1561] from 4.2.6p2-RC5: ntpq, ntpdc "passwd" prompts for MD5
+ password w/SHA1.
+* [Bug 1565] from 4.2.6p2-RC5: sntp/crypto.c compile fails on MacOS over
+ vsnprintf().
+* from 4.2.6p2-RC5: Windows port: do not exit in
+ ntp_timestamp_from_counter() without first logging the reason.
+(4.2.7p32) 2010/05/19 Released by Harlan Stenn <stenn@ntp.org>
+* Copyright file cleanup from Dave Mills.
+* [Bug 1555] from 4.2.6p2-RC4: sntp illegal C (mixed code and
+ declarations).
+* [Bug 1558] pool prototype associations have 0.0.0.0 for remote addr.
+* configure.ac: add --disable-autokey, #define AUTOKEY to enable future
+ support for building without Autokey, but with OpenSSL for its digest
+ algorithms (hash functions). Code must be modified to use #ifdef
+ AUTOKEY instead of #ifdef OPENSSL where appropriate to complete this.
+* include/ntp_crypto.h: make assumption AUTOKEY implies OPENSSL explicit.
+(4.2.7p31) 2010/05/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1325] from 4.2.6p2-RC3: unreachable code sntp recv_bcst_data().
+* [Bug 1459] from 4.2.6p2-RC3: sntp MD5 authentication does not work
+ with ntpd.
+* [Bug 1552] from 4.2.6p2-RC3: update and complete broadcast and crypto
+ features in sntp.
+* [Bug 1553] from 4.2.6p2-RC3: sntp/configure.ac OpenSSL support.
+* from 4.2.6p2-RC3: Escape unprintable characters in a refid in ntpq -p
+ billboard.
+* from 4.2.6p2-RC3: Simplify hash client code by providing OpenSSL
+ EVP_*() API when built without OpenSSL. (already in 4.2.7)
+* from 4.2.6p2-RC3: Do not depend on ASCII in sntp.
+(4.2.7p30) 2010/05/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1526] ntpd DNS pipe read EINTR with no network at startup.
+* Update the ChangeLog entries when merging items from -stable.
+(4.2.7p29) 2010/05/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1542] ntpd mrulist response may have incorrect last.older.
+* [Bug 1543] ntpq mrulist must refresh nonce when retrying.
+* [Bug 1544] ntpq mrulist sscanf timestamp format mismatch on 64-bit.
+* Windows compiling hints/winnt.html update from G. Sunil Tej.
+(4.2.7p28) 2010/05/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1512] from 4.2.6p2-RC3: ntpsnmpd should connect to net-snmpd
+ via a unix-domain socket by default.
+ Provide a command-line 'socket name' option.
+* [Bug 1538] from 4.2.6p2-RC3: update refclock_nmea.c's call to
+ getprotobyname().
+* [Bug 1541] from 4.2.6p2-RC3: Fix wrong keyword for "maxclock".
+(4.2.7p27) 2010/04/27 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.7p26) 2010/04/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1465] from 4.2.6p2-RC2: Make sure time from TS2100 is not
+ invalid (backport from -dev).
+* [Bug 1528] from 4.2.6p2-RC2: Fix EDITLINE_LIBS link order for ntpq
+ and ntpdc.
+* [Bug 1531] Require nonce with mrulist requests.
+* [Bug 1532] Remove ntpd support for ntpdc's monlist in favor of ntpq's
+ mrulist.
+* [Bug 1534] from 4.2.6p2-RC2: conflicts with VC++ 2010 errno.h.
+* [Bug 1535] from 4.2.6p2-RC2: "restrict -4 default" and "restrict
+ -6 default" ignored.
+(4.2.7p25) 2010/04/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1528] from 4.2.6p2-RC2: Remove --with-arlib from br-flock.
+* [Bug 1503] [Bug 1504] [Bug 1518] [Bug 1522] from 4.2.6p2-RC2:
+ all of which were fixed in 4.2.7 previously.
+(4.2.7p24) 2010/04/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1390] Control PPS on the Oncore M12.
+* [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+* [Bug 1520] '%u' formats for size_t gives warnings with 64-bit builds.
+* [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
+* Documentation updates for 4.2.7p22 changes and additions, updating
+ ntpdc.html, ntpq.html, accopt.html, confopt.html, manyopt.html,
+ miscopt.html, and miscopt.txt.
+* accopt.html: non-ntpport doc changes from Dave Mills.
+* Modify full MRU list preemption when full to match "discard monitor"
+ documentation, by removing exception for count == 1.
+(4.2.7p23) 2010/04/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1516] unpeer by IP address fails, DNS name works.
+* [Bug 1517] ntpq and ntpdc should verify reverse DNS before use.
+ ntpq and ntpdc now use the following format for showing purported
+ DNS names from IP address "reverse" DNS lookups when the DNS name
+ does not exist or does not include the original IP address among
+ the results: "192.168.1.2 (fake.dns.local)".
+(4.2.7p22) 2010/04/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1432] Don't set inheritable flag for linux capabilities.
+* [Bug 1465] Make sure time from TS2100 is not invalid.
+* [Bug 1483] AI_NUMERICSERV undefined in 4.2.7p20.
+* [Bug 1497] fudge is broken by getnetnum() change.
+* [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+* [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if
+ "restrict ... limited" is used.
+* ntpdate: stop querying source after KoD packet response, log it.
+* ntpdate: rate limit each server to 2s between packets.
+* From J. N. Perlinger: avoid pointer wraparound warnings in dolfptoa(),
+ printf format mismatches with 64-bit size_t.
+* Broadcast client (ephemeral) associations should be demobilized only
+ if they are not heard from for 10 consecutive polls, regardless of
+ surviving the clock selection. Fix from David Mills.
+* Add "ntpq -c ifstats" similar to "ntpdc -c ifstats".
+* Add "ntpq -c sysstats" similar to "ntpdc -c sysstats".
+* Add "ntpq -c monstats" to show monlist knobs and stats.
+* Add "ntpq -c mrulist" similar to "ntpdc -c monlist" but not
+ limited to 600 rows, and with filtering and sorting options:
+ ntpq -c "mrulist mincount=2 laddr=192.168.1.2 sort=-avgint"
+ ntpq -c "mrulist sort=addr"
+ ntpq -c "mrulist mincount=2 sort=count"
+ ntpq -c "mrulist sort=-lstint"
+* Modify internal representation of MRU list to use l_fp fixed-point
+ NTP timestamps instead of seconds since startup. This increases the
+ resolution and substantially improves accuracy of sorts involving
+ timestamps, at the cost of flushing all MRU entries when the clock is
+ stepped, to ensure the timestamps can be compared with the current
+ get_systime() results.
+* Add ntp.conf "mru" directive to configure MRU parameters, such as
+ "mru mindepth 600 maxage 64 maxdepth 5000 maxmem 1024" or
+ "mru initalloc 0 initmem 16 incalloc 99 incmem 4". Several pairs are
+ equivalent with one in units of MRU entries and its twin in units of
+ kilobytes of memory, so the last one used in ntp.conf controls:
+ maxdepth/maxmem, initalloc/initmem, incalloc/incmem. With the above
+ values, ntpd will preallocate 16kB worth of MRU entries, allocating
+ 4kB worth each time more are needed, with a hard limit of 1MB of MRU
+ entries. Until there are more than 600 entries none would be reused.
+ Then only entries for addresses last seen 64 seconds or longer ago are
+ reused.
+* Limit "ntpdc -c monlist" response in ntpd to 600 entries, the previous
+ overall limit on the MRU list depth which was driven by the monlist
+ implementation limit of one request with a single multipacket
+ response.
+* New "pool" directive implementation modeled on manycastclient.
+* Do not abort on non-ASCII characters in ntp.conf, ignore them.
+* ntpq: increase response reassembly limit from 24 to 32 packets, add
+ discussion in comment regarding results with even larger MAXFRAGS.
+* ntpq: handle "passwd MYPASSWORD" (without prompting) as with ntpdc.
+* ntpdc: do not examine argument to "passwd" if not supplied.
+* configure: remove check for pointer type used with qsort(), we
+ require ANSI C which mandates void *.
+* Reset sys_kodsent to 0 in proto_clr_stats().
+* Add sptoa()/sockporttoa() similar to stoa()/socktoa() adding :port.
+* Use memcpy() instead of memmove() when buffers can not overlap.
+* Remove sockaddr_storage from our sockaddr_u union of sockaddr,
+ sockaddr_in, and sockaddr_in6, shaving about 100 bytes from its size
+ and substantially decreasing MRU entry memory consumption.
+* Extend ntpq readvar (alias rv) to allow fetching up to three named
+ variables in one operation: ntpq -c "rv 0 version offset frequency".
+* ntpq: use srchost variable to show .POOL. prototype associations'
+ hostname instead of address 0.0.0.0.
+* "restrict source ..." configures override restrictions for time
+ sources, allows tight default restrictions to be used with the pool
+ directive (where server addresses are not known in advance).
+* Ignore "preempt" modifier on manycastclient and pool prototype
+ associations. The resulting associations are preemptible, but the
+ prototype must not be.
+* Maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+* Remove more workarounds unneeded since we require ISO C90 AKA ANSI C:
+ - remove fallback implementations for memmove(), memset, strstr().
+ - do not test for atexit() or memcpy().
+* Collapse a bunch of code duplication in ntpd/ntp_restrict.c added with
+ support for IPv6.
+* Correct some corner case failures in automatically enabling the MRU
+ list if any "restrict ... limited" is in effect, and in disabling MRU
+ maintenance. (ntp_monitor.c, ntp_restrict.c)
+* Reverse the internal sort order of the address restriction lists, but
+ preserve the same behavior. This allows removal of special-case code
+ related to the default restrictions and more straightforward lookups
+ of restrictions for a given address (now, stop on first match).
+* Move ntp_restrict.c MRU doubly-linked list maintenance code into
+ ntp_lists.h macros, allowing more duplicated source excision.
+* Repair ntpdate.c to no longer test HAVE_TIMER_SETTIME.
+* Do not reference peer_node/unpeer_node after freeing when built with
+ --disable-saveconfig and using DNS.
+(4.2.7p21) 2010/03/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 2399] Reset sys_kodsent in proto_clr_stats().
+* [Bug 1514] from 4.2.6p1-RC6: Typo in ntp_proto.c: fabs(foo < .4)
+ should be fabs(foo) < .4.
+* [Bug 1464] from 4.2.6p1-RC6: synchronization source wrong for
+ refclocks ARCRON_MSF (27) and SHM (28).
+* From 4.2.6p1-RC6: Correct Windows port's refclock_open() to
+ return 0 on failure not -1.
+* From 4.2.6p1-RC6: Correct CHU, dumbclock, and WWVB drivers to
+ check for 0 returned from refclock_open() on failure.
+* From 4.2.6p1-RC6: Correct "SIMUL=4 ./flock-build -1" to
+ prioritize -1/--one.
+* [Bug 1306] constant conditionals in audio_gain().
+(4.2.7p20) 2010/02/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1483] hostname in ntp.conf "restrict" parameter rejected.
+* Use all addresses for each restrict by hostname.
+* Use async DNS to resolve trap directive hostnames.
+(4.2.7p19) 2010/02/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1338] Update the association type codes in ntpq.html.
+* [Bug 1478] from 4.2.6p1-RC5: linking fails: EVP_MD_pkey_type.
+* [Bug 1479] from 4.2.6p1-RC5: not finding readline headers.
+* [Bug 1484] from 4.2.6p1-RC5: ushort is not defined in QNX6.
+(4.2.7p18) 2010/02/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1480] from 4.2.6p1-RC5: snprintf() cleanup caused
+ unterminated refclock IDs.
+* Stop using getaddrinfo() to convert numeric address strings to on-wire
+ addresses in favor of is_ip_address() alone.
+(4.2.7p17) 2010/02/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1477] from 4.2.6p1-RC5: First non-gmake make in clone
+ w/VPATH can't make COPYRIGHT.
+* Attempts to cure CID 108 CID 118 CID 119 TAINTED_SCALAR warnings.
+* Broaden ylwrap workaround VPATH_HACK to all non-GNU make.
+(4.2.7p16) 2010/02/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1474] from 4.2.6p1-RC4: ntp_keygen LCRYPTO after libntp.a.
+* Include 4.2.6p1-RC4: Remove arlib.
+(4.2.7p15) 2010/02/03 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1455] from 4.2.6p1: ntpd does not try /etc/ntp.audio.
+* Include 4.2.6p1: Convert many sprintf() calls to snprintf(), also
+ strcpy(), strcat().
+* Include 4.2.6p1: Fix widely cut-n-pasted bug in refclock shutdown
+ after failed start.
+* Include 4.2.6p1: Remove some dead code checking for emalloc()
+ returning NULL.
+(4.2.7p14) 2010/02/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1338] ntpq displays incorrect association type codes.
+* [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+* [Bug 1470] from 4.2.6p1: "make distdir" compiles keyword-gen.
+* [Bug 1471] CID 120 CID 121 CID 122 is_ip_address() uninit family.
+* [Bug 1472] CID 116 CID 117 minor warnings in new DNS code.
+* [Bug 1473] from 4.2.6p1: "make distcheck" version.m4 error.
+(4.2.7p13) 2010/01/31 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1467] from 4.2.6p1: Fix bogus rebuild of sntp/sntp.html.
+(4.2.7p12) 2010/01/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1468] 'make install' broken for root on default NFS mount.
+(4.2.7p11) 2010/01/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 47] Debugging and logging do not work after a fork.
+* [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+* New async DNS resolver in ntpd allows nonblocking queries anytime,
+ instead of only once at startup.
+(4.2.7p10) 2010/01/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1140] from 4.2.6p1-RC5: Clean up debug.html, decode.html,
+ and ntpq.html.
+* Include 4.2.6p1-RC3: Use TZ=UTC instead of TZ= when calling date in
+ scripts/mkver.in .
+* [Bug 1448] from 4.2.6p1-RC3: Some macros not correctly conditionally
+ or absolutely defined on Windows.
+* [Bug 1449] from 4.2.6p1-RC3: ntpsim.h in ntp_config.c should be used
+ conditionally.
+* [Bug 1450] from 4.2.6p1-RC3: Option to exclude warnings not
+ unconditionally defined on Windows.
+(4.2.7p9) 2010/01/13 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.7p8) 2010/01/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 702] ntpd service logic should use libopts to examine cmdline.
+* [Bug 1451] from 4.2.6p1-RC3: sntp leaks KoD entry updating.
+* [Bug 1453] from 4.2.6p1-RC3: Use $CC in config.cache filename.
+(4.2.7p7) 2009/12/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 620] ntpdc getresponse() esize != *rsize s/b size != *rsize.
+* [Bug 1446] 4.2.7p6 requires autogen, missing ntpd.1, *.texi, *.menu.
+(4.2.7p6) 2009/12/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+* [Bug 1442] Move Windows functions into libntp files
+* [Bug 1127] from 4.2.6p1-RC3: Check the return of X590_verify().
+* [Bug 1439] from 4.2.6p1-RC3: .texi gen after binary is linked.
+* [Bug 1440] from 4.2.6p1-RC3: Update configure.ac to support kfreebsd.
+* [Bug 1445] from 4.2.6p1-RC3: IRIX does not have -lcap or support
+ linux capabilities.
+(4.2.7p5) 2009/12/25 Released by Harlan Stenn <stenn@ntp.org>
+* Include 4.2.6p1-RC2
+(4.2.7p4) 2009/12/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1429] ntpd -4 option does not reliably force IPv4 resolution.
+* [Bug 1431] System headers must come before ntp headers in ntp_intres.c .
+(4.2.7p3) 2009/12/22 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1426] scripts/VersionName needs . on the search path.
+* [Bug 1427] quote missing in ./build - shows up on NetBSD.
+* [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h
+(4.2.7p2) 2009/12/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+* [Bug 1421] add util/tg2, a clone of tg that works on Linux, NetBSD, and
+ FreeBSD
+(4.2.7p1) 2009/12/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1348] ntpd Windows port should wait for sendto() completion.
+* [Bug 1413] test OpenSSL headers regarding -Wno-strict-prototypes.
+* [Bug 1418] building ntpd/ntpdc/ntpq statically with ssl fails.
+(4.2.7p0) 2009/12/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC.
+* [Bug 1414] Enable "make distcheck" success with BSD make.
+(4.2.7) 2009/12/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1407] configure.ac: recent GNU Make -v does not include "version".
+---
+(4.2.6p5) 2011/12/24 Released by Harlan Stenn <stenn@ntp.org>
+
+No changes from 4.2.6p5-RC3.
+
+---
+(4.2.6p5-RC3) 2011/12/08 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot.
+* [Bug 2085] clock_update() sys_rootdisp calculation omits root delay.
+* [Bug 2086] get_systime() should not offset by sys_residual.
+* [Bug 2087] sys_jitter calculation overweights sys.peer jitter.
+* Ensure NULL peer->dstadr is not accessed in orphan parent selection.
+
+---
+(4.2.6p5-RC2) 2011/11/30 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2050] Orphan mode stratum counting to infinity.
+* [Bug 2059] optional billboard column "server" does not honor -n.
+* [Bug 2066] ntpq lopeers ipv6 "local" column overrun.
+* [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq.
+* [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+* [Bug 2072] Orphan parent selection metric needs ntohl().
+* Exclude not-yet-determined sys_refid from use in loopback TEST12
+ (from David Mills).
+* Never send KoD rate limiting response to MODE_SERVER response.
+
+---
+(4.2.6p5-RC1) 2011/10/18 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 2034] Listening address configuration with prefix misapplied.
+
+---
+(4.2.6p4) 2011/09/22 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+* [Bug 1985] "logconfig =allall" rejected.
+* [Bug 2001] ntpdc timerstats reports overruns as handled.
+* [Bug 2003] libntpq ntpq_read_assoc_peervars() broken.
+* [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be
+ consistent with ntpd.
+* libopts/file.c fix from Bruce Korb (arg-type=file).
+
+---
+(4.2.6p4-RC2) 2011/08/04 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1608] Parse Refclock driver should honor trusttime.
+* [Bug 1961] html2man update: distribute ntp-wait.html.
+* [Bug 1970] UNLINK_EXPR_SLIST() causes crash if list is empty.
+* [Bug 1972] checking for struct rtattr fails.
+* [Bug 1975] libntp/mktime.c won't work with 64-bit time_t
+* [Bug 1978] [Bug 1134] fix in 4.2.6p4-RC1 doesn't build on older Linux.
+* Backport several fixes for Coverity warnings from ntp-dev.
+* Backport if_nametoindex() check for hpux.
+
+---
+(4.2.6p4-RC1) 2011/07/10 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1134] ntpd fails binding to tentative IPv6 addresses.
+* [Bug 1790] Update config.guess and config.sub to detect AIX6.
+* [Bug 1961] html2man needs an update.
+* Update the NEWS file.
+
+---
+(4.2.6p4-beta2) 2011/05/25 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1695] ntpdate takes longer than necessary.
+* [Bug 1832] ntpdate doesn't allow timeout > 2s.
+* [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs.
+* Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+---
+(4.2.6p4-beta1) 2011/05/16 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1554] peer may stay selected as system peer after becoming
+ unreachable.
+* [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial
+ candidate list.
+* [Bug 1923] orphan parent favored over LOCAL, ACTS drivers.
+* [Bug 1924] Billboard tally codes sometimes do not match operation,
+ variables.
+* Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+* Upgrade to AutoGen 5.11.9 (and require it).
+* Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8.
+
+---
+(4.2.6p3) 2011/01/03 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1764] Palisade driver doesn't build on Linux
+* Create and use scripts/check--help when generating .texi files.
+* Update bk triggers for the bk-5 release.
+* Update genCommitLog for the bk-5 release.
+* Update the copyright year.
+
+---
+(4.2.6p3-RC12) 2010/12/25 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1458] Can not compile NTP on FreeBSD 4.7.
+* [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud.
+* [Bug 1618] Unreachable code in jjy_start(). (backport from ntp-dev)
+* [Bug 1719] ntp-keygen -V crash. (backport)
+* [Bug 1740] ntpdc treats many counters as signed. (backport)
+* [Bug 1741] Enable multicast reception on each address (Windows).
+* [Bug 1742] Fix a typo in an error message in the "build" script.
+* [Bug 1743] Display timezone offset when showing time for sntp in the
+local timezone.
+* [Bug 1751] Support for Atari FreeMiNT OS.
+* [Bug 1754] --version output should be more verbose.
+* [Bug 1757] oncore snprintf("%m") doesn't expand %m.
+* [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex.
+* [Bug 1760] ntpd Windows interpolation cannot be disabled.
+* [Bug 1762] manycastclient solicitation responses interfere.
+* Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre7.
+* Relax minimum Automake version to 1.10 with updated libopts.m4.
+* Suppress ntp-keygen OpenSSL version display for --help, --version,
+display both build and runtime OpenSSL versions when they differ.
+* Clean up m4 quoting in configure.ac, *.m4 files, resolving
+ intermittent AC_LANG_PROGRAM possibly undefined errors.
+* Clean up the SNTP documentation.
+* Other manycastclient repairs:
+ Separate handling of scope ID embedded in many in6_addr from ifindex
+ used for IPv6 multicasting ioctls.
+ Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses.
+ Enable outbound multicast from only one address per interface in the
+ same subnet, and in that case prefer embedded MAC address modified
+ EUI-64 IPv6 addresses first, then static, and last RFC 4941 privacy
+ addresses.
+ Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to
+ select the local source address, using the correct socket is not
+ enough.
+
+---
+(4.2.6p3-RC11) 2010/11/28 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1725] ntpd sends multicast from only one address.
+* [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib
+ to CPPFLAGS or LDFLAGS.
+* [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog).
+* Remove log_msg() and debug_msg() from sntp in favor of msyslog().
+* Use a single copy of libopts/, in sntp/.
+* Upgrade libopts to 33.3.8.
+* Bump minimum Automake version to 1.11, required for AM_COND_IF
+ use in LIBOPTS_CHECK.
+* Improvements to the 'build' script.
+
+---
+(4.2.6p3-RC10) 2010/11/14 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1681] More sntp logging cleanup.
+* [Bug 1683] Non-localhost on loopback exempted from nic rules.
+
+---
+(4.2.6p3-RC9) 2010/11/10 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1574] sntp:set_time doesn't set tv_usec correctly.
+* [Bug 1681] sntp logging cleanup.
+* [Bug 1683] Interface binding does not seem to work as intended.
+* [Bug 1691] Use first NMEA sentence each second.
+* [Bug 1692] packageinfo.sh needs to be "sourced" using ./ .
+* [Bug 1709] ntpdate ignores replies with equal receive and transmit
+ timestamps.
+* Backport sntp from -dev
+
+---
+(4.2.6p3-RC8) 2010/10/29 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1685] NMEA driver mode byte confusion.
+* First cut at using scripts/checkChangeLog.
+
+---
+(4.2.6p3-RC7) 2010/10/25 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1676] NMEA: $GPGLL did not work after fix for Bug 1571.
+* Added scripts/checkChangeLog.
+
+---
+(4.2.6p3-RC6) 2010/10/24 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1571] NMEA does not relate data to PPS edge.
+* [Bug 1572] NMEA time adjustment for GPZDG buggy.
+* [Bug 1675] Prohibit includefile remote config.
+
+---
+(4.2.6p3-RC5) 2010/10/22 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1649] Require NMEA checksum if $GPRMC or previously seen.
+* [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3.
+
+---
+(4.2.6p3-RC4) 2010/10/16 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1584] wrong SNMP type for precision, resolution.
+* [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE.
+* [Bug 1665] is_anycast() u_int32_t should be u_int32.
+* ntpsnmpd, libntpq warning cleanup.
+
+---
+(4.2.6p3-RC3) 2010/10/14 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 750] Non-existing device causes coredump with RIPE-NCC driver.
+* [Bug 1080] ntpd on ipv6 routers very chatty.
+* [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+* [Bug 1581] printf format string mismatch leftover.
+* [Bug 1584] ntpsnmpd OID must be mib-2.197.
+* [Bug 1643] Range-check the decoding of the RIPE-NCC status codes.
+* [Bug 1644] cvo.sh should use lsb_release to identify linux distros.
+* [Bug 1659] Support Truetime Satellite Clocks on Windows.
+* [Bug 1660] On some systems, test is in /usr/bin, not /bin.
+* [Bug 1661] Re-indent refclock_ripencc.c.
+
+---
+(4.2.6p3-RC2) 2010/09/25 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1635] "filegen ... enable" is not default.
+* [Bug 1636] yyparse() segfault after denied filegen remote config.
+
+---
+(4.2.6p3-RC1) 2010/09/18 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1344] ntpd on Windows exits without logging cause.
+
+---
+(4.2.6p3-beta1) 2010/09/11 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1573] Miscalculation of offset in sntp.
+* [Bug 1595] empty last line in key file causes duplicate key to be added
+* [Bug 1597] packet processing ignores RATE KoD packets, because of
+ a bug in string comparison.
+* [Bug 1581] ntp_intres.c size_t printf format string mismatch.
+
+---
+(4.2.6p2) 2010/07/09 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1581] size_t printf format string mismatches, IRIG string buffers
+ undersized. Mostly backported from earlier ntp-dev fixes by Juergen
+ Perlinger.
+
+---
+(4.2.6p2-RC7) 2010/06/19 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1570] serial clock drivers get outdated input from kernel tty
+ line buffer after startup
+* [Bug 1575] use 'snprintf' with LIB_BUFLENGTH in inttoa.c, tvtoa.c and
+ utvtoa.c
+* [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD.
+
+---
+(4.2.6p2-RC6) 2010/06/12 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags.
+
+---
+(4.2.6p2-RC5) 2010/06/03 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
+* [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf().
+* Windows port: do not exit in ntp_timestamp_from_counter() without
+ first logging the reason.
+* Support "passwd blah" syntax in ntpq.
+
+---
+(4.2.6p2-RC4) 2010/05/19 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations).
+
+---
+(4.2.6p2-RC3) 2010/05/11 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1325] unreachable code in sntp recv_bcst_data().
+* [Bug 1459] sntp MD5 authentication does not work with ntpd.
+* [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain
+ socket by default. Provide a command-line 'socket name' option.
+* [Bug 1538] update refclock_nmea.c's call to getprotobyname().
+* [Bug 1541] Fix wrong keyword for "maxclock".
+* [Bug 1552] update and complete broadcast and crypto features in sntp.
+* [Bug 1553] sntp/configure.ac OpenSSL support.
+* Escape unprintable characters in a refid in ntpq -p billboard.
+* Simplify hash client code by providing OpenSSL EVP_*() API when built
+ without OpenSSL. (from ntp-dev)
+* Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp.
+* Windows compiling hints/winnt.html update from G. Sunil Tej.
+
+---
+(4.2.6p2-RC2) 2010/04/27 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1465] Make sure time from TS2100 is not invalid (backport from
+ ntp-dev).
+* [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc.
+* [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h.
+* [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored.
+* Remove --with-arlib from br-flock.
+
+---
+(4.2.6p2-RC1) 2010/04/18 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+* [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if
+ "restrict ... limited" is used.
+* [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+* [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
+* Update html/authopt.html controlkey, requestkey, and trustedkey docs.
+
+---
+(4.2.6p1) 2010/04/09 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.6p1-RC6) 2010/03/31 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4.
+* [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27)
+ and SHM (28).
+* Correct Windows port's refclock_open() to return 0 on failure not -1.
+* Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+* Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one.
+
+---
+(4.2.6p1-RC5) 2010/02/09 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1140] Clean up debug.html, decode.html, and ntpq.html.
+* [Bug 1438] Remove dead code from sntp/networking.c.
+* [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
+* [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
+* [Bug 1479] Compilation fails because of not finding readline headers.
+* [Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
+* [Bug 1484] ushort is not defined in QNX6.
+
+---
+(4.2.6p1-RC4) 2010/02/04 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1455] ntpd does not try /etc/ntp.audio as documented.
+* [Bug 1467] Fix bogus rebuild of sntp/sntp.html
+* [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a.
+* [Bug 1473] "make distcheck" before build can't make sntp/version.m4.
+* [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a.
+* Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+* Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+* Remove some dead code checking for emalloc() returning NULL.
+* Remove arlib.
+
+---
+(4.2.6p1-RC3) 2010/01/24 Released by Harlan Stenn <stenn@ntp.org>
+
+* Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in .
+* [Bug 1448] Some macros not correctly conditionally or absolutely defined
+ on Windows.
+* [Bug 1449] ntpsim.h in ntp_config.c should be used conditionally.
+* [Bug 1450] Option to exclude warnings not unconditionally defined on Windows.
+* [Bug 1127] Properly check the return of X590_verify() - missed one.
+* [Bug 1439] .texi generation must wait until after binary is linked.
+* [Bug 1440] Update configure.ac to support kfreebsd.
+* [Bug 1445] IRIX does not have -lcap or support linux capabilities.
+* [Bug 1451] CID 115: sntp leaks KoD entry when updating existing.
+* [Bug 1453] Use $CC in config.cache filename in ./build script.
+
+---
+(4.2.6p1-RC2) 2009/12/25 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1411] Fix status messages in refclock_oncore.c.
+* [Bug 1416] MAXDNAME undefined on Solaris 2.6.
+* [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+* [Bug 1424] Fix check for rtattr (rtnetlink.h).
+* [Bug 1425] unpeer by association ID sets up for duplicate free().
+* [Bug 1426] scripts/VersionName needs . on the search path.
+* [Bug 1427] quote missing in ./build - shows up on NetBSD.
+* [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h
+* [Bug 1429] ntpd -4 option does not reliably force IPv4 resolution.
+* [Bug 1431] System headers must come before ntp headers in ntp_intres.c .
+* [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
+* [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp.
+
+---
+(4.2.6p1-RC1) 2009/12/20 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1409] Put refclock_neoclock4x.c under the NTP COPYRIGHT notice.
+ This should allow debian and other distros to add this refclock driver
+ in further distro releases.
+ Detect R2 hardware releases.
+* [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC.
+* [Bug 1413] test OpenSSL headers regarding -Wno-strict-prototypes.
+* [Bug 1414] Enable "make distcheck" success with BSD make.
+* [Bug 1415] Fix Mac OS X link problem.
+* [Bug 1418] building ntpd/ntpdc/ntpq statically with ssl fails.
+* Build infrastructure updates to enable beta releases of ntp-stable.
+
+---
+(4.2.6) 2009/12/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Sec 1331] from4.2.4p8: DoS with mode 7 packets - CVE-2009-3563.
+* [Bug 508] Fixed leap second handling for Windows.
+(4.2.5p250-RC) 2009/11/30 Released by Harlan Stenn <stenn@ntp.org>
+* sntp documentation updates.
+* [Bug 761] internal resolver does not seem to honor -4/-6 qualifiers
+* [Bug 1386] Deferred DNS doesn't work on NetBSD
+* [Bug 1391] avoid invoking autogen twice for .c and .h files.
+* [Bug 1397] shmget() refclock_shm failing because of file mode.
+* Pass no_needed to ntp_intres as first part of fixing [Bug 975].
+* Add ./configure --enable-force-defer-DNS to help debugging.
+(4.2.5p249-RC) 2009/11/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1400] An empty KOD DB file causes sntp to coredump.
+* sntp: documentation cleanup.
+* sntp: clean up some error messages.
+* sntp: Use the precision to control how many offset digits are shown.
+* sntp: Show root dispersion.
+* Cleanup from the automake/autoconf upgrades.
+(4.2.5p248-RC) 2009/11/26 Released by Harlan Stenn <stenn@ntp.org>
+* Prepare for the generation of sntp.html.
+* Documentation changes from Dave Mills.
+* [Bug 1387] Storage leak in ntp_intres (minor).
+* [Bug 1389] buffer overflow in refclock_oncore.c
+* [Bug 1391] .texi usage text from installed, not built binaries.
+* [Bug 1392] intres retries duplicate assocations endlessly.
+* Correct *-opts.h dependency so default 'get' action isn't used.
+(4.2.5p247-RC) 2009/11/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1142] nodebug builds shed no light on -d, -D option failure.
+* [Bug 1179] point out the problem with -i/--jaildir and -u/--user when
+ they are disabled by configure.
+* [Bug 1308] support systems that lack fork().
+* [Bug 1343] sntp doesn't link on Solaris 7, needs -lresolv.
+(4.2.5p246-RC) 2009/11/17 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to autogen-5.10
+* [Bug 1378] Unnecessary resetting of peers during interface update.
+* [Bug 1382] p245 configure --disable-dependency-tracking won't build.
+* [Bug 1384] ntpq :config core dumped with a blank password.
+(4.2.5p245-RC) 2009/11/14 Released by Harlan Stenn <stenn@ntp.org>
+* Cleanup from Dave Mills.
+* [Bug 1343] sntp illegal C does not compile on Solaris 7.
+* [Bug 1381] Version .deps generated include file dependencies to allow
+ known dependency-breaking changes to force .deps to be cleaned,
+ triggered by changing the contents of deps-ver and/or sntp/deps-ver.
+(4.2.5p244-RC) 2009/11/12 Released by Harlan Stenn <stenn@ntp.org>
+* keygen.html updates from Dave Mills.
+* [Bug 1003] ntpdc unconfig command doesn't prompt for keyid.
+* [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+* ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a
+ non-fatal warning.
+(4.2.5p243-RC) 2009/11/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1226] Fix deferred DNS lookups.
+* new crypto signature cleanup.
+(4.2.5p242-RC) 2009/11/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1363] CID 92 clarify fallthrough case in clk_trimtsip.c
+* [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7.
+* [Bug 1368] typos in libntp --without-crypto case
+* [Bug 1371] deferred DNS lookup failing with INFO_ERR_AUTH.
+* CID 87 dead code in ntpq.c atoascii().
+* Fix authenticated ntpdc, broken in p240.
+* Stub out isc/mem.h, shaving 47k from a MIPS ntpd binary.
+* Shrink keyword scanner FSM entries from 64 to 32 bits apiece.
+* Documention updates from Dave Mills.
+* authkeys.c cleanup from Dave Mills.
+(4.2.5p241-RC) 2009/11/07 Released by Harlan Stenn <stenn@ntp.org>
+* html/authopt.html update from Dave Mills.
+* Remove unused file from sntp/Makefile.am's distribution list.
+* new crypto signature cleanup.
+(4.2.5p240-RC) 2009/11/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3.
+* Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2).
+(4.2.5p239-RC) 2009/10/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1357] bogus assert from refclock_shm.
+* [Bug 1359] Debug message cleanup.
+* CID 101: more pointer/array cleanup.
+* [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU.
+* [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared.
+* CID 101: pointer/array cleanup.
+(4.2.5p238-RC) 2009/10/27 Released by Harlan Stenn <stenn@ntp.org>
+* Changes from Dave Mills.
+* driver4.html updates from Dave Mills.
+* [Bug 1252] PPSAPI cleanup on ntpd/refclock_wwvb.c.
+* [Bug 1354] libtool error building after bootstrap with Autoconf 2.64.
+* Allow NTP_VPATH_HACK configure test to handle newer gmake versions.
+* CIDs 94-99 make it more clearly impossible for sock_hash() to return
+ a negative number.
+* CID 105, 106 ensure ntpdc arrays are not overrun even if callers
+ misbehave.
+* CID 113 use va_end() in refclock_true.c true_debug().
+* Get rid of configure tests for __ss_family and __ss_len when the more
+ common ss_family and ss_len are present.
+(4.2.5p237-RC) 2009/10/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 610] NMEA support for using PPSAPI on a different device.
+* [Bug 1238] use only fudge time2 to offset NMEA serial timestamp.
+* [Bug 1355] ntp-dev won't compile on OpenBSD 4.6.
+(4.2.5p236-RC) 2009/10/22 Released by Harlan Stenn <stenn@ntp.org>
+* Cleanup from Dave Mills.
+* [Bug 1343] ntpd/ntp_io.c close_fd() does not compile on Solaris 7.
+* [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+* Do not attempt to execute built binaries from ntpd/Makefile when
+ cross-compiling (keyword-gen and ntpd --saveconfigquit).
+* sntp/main.c: Remove duplicate global adr_buf[] (also defined in
+ networking.c) which Piotr Grudzinski identified breaking his build.
+* Correct in6addr_any test in configure.ac to attempt link too.
+(4.2.5p235-RC) 2009/10/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+(4.2.5p234-RC) 2009/10/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
+ move #define strerror... to a header not used by lib/isc code.
+* [Bug 1345] illegal 'grep' option prevents compilation.
+* [Bug 1346] keyword scanner broken where char defaults to unsigned.
+* [Bug 1347] ntpd/complete.conf missing multicastclient test case.
+(4.2.5p233-RC) 2009/10/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1337] cast setsockopt() v4 address pointer to void *.
+* [Bug 1342] ignore|drop one IPv6 address on an interface blocks all
+ addresses on that interface.
+* Documentation cleanup and updates.
+(4.2.5p232-RC) 2009/10/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1302] OpenSSL under Windows needs applink support.
+* [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...).
+* [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
+* [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI.
+* Construct ntpd keyword scanner finite state machine at compile time
+ rather than at runtime, shrink entries from 40+ to 8 bytes.
+* Update documentation for ntpq --old-rv, saveconfig, saveconfigdir,
+ ntpd -I -L and -M, and interface/nic rules. (From Dave Hart)
+* [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...)
+(4.2.5p231-RC) 2009/10/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1335] Broadcast client degraded by wildcard default change.
+(4.2.5p230-RC) 2009/10/09 Released by Harlan Stenn <stenn@ntp.org>
+* Start the 4.2.6 Release Candidate cycle.
+* Broadcast and transit phase cleanup from Dave Mills.
+(4.2.5p229) 2009/10/07 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'.
+* Change ntpsnmpd/Makefile.am include file order to fix FreeBSD build.
+(4.2.5p228) 2009/10/06 Released by Harlan Stenn <stenn@ntp.org>
+* Reclaim syntax tree memory after application in ntpd built with
+ configure --disable-saveconfig.
+* [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant.
+* [Bug 1333] ntpd --interface precedence over --novirtualips lost.
+(4.2.5p227) 2009/10/05 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1135] :config fails with "Server disallowed request"
+* [Bug 1330] disallow interface/nic rules when --novirtualips or
+ --interface are used.
+* [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff.
+* Add test of ntpd --saveconfigquit fidelity using new complete.conf.
+* Documentation updates from Dave Hart/Dave Mills.
+(4.2.5p226) 2009/10/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1318] Allow multiple -g options on ntpd command line.
+* [Bug 1327] ntpq, ntpdc, ntp-keygen -d & -D should work with configure
+ --disable-debugging.
+* Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+* Clockhop and autokey cleanup from Dave Mills.
+* Documentation updates from Dave Mills.
+(4.2.5p225) 2009/09/30 Released by Harlan Stenn <stenn@ntp.org>
+* authopt documentation changes from Dave Mills/Dave Hart.
+* [Bug 1324] support bracketed IPv6 numeric addresses for restrict.
+(4.2.5p224) 2009/09/29 Released by Harlan Stenn <stenn@ntp.org>
+* Clockhop and documentation fixes from Dave Mills.
+* Remove "tos maxhop" ntp.conf knob.
+(4.2.5p223) 2009/09/28 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1321] build doesn't work if . isn't on $PATH.
+* [Bug 1323] Implement "revoke #" to match documentation, deprecate
+ "crypto revoke #".
+(4.2.5p222) 2009/09/27 Released by Harlan Stenn <stenn@ntp.org>
+* Update libisc code using bind-9.6.1-P1.tar.gz, rearrange our copy to
+ mirror the upstream layout (lib/isc/...), and merge in NTP-local
+ modifications to libisc. There is a new procedure to ease future
+ libisc merges using a separate "upstream" bk repo. That will enable
+ normal bk pull automerge to handle carrying forward any local changes
+ and should enable us to take updated libisc snapshots more often.
+* Updated build and flock-build scripts. flock-build --one is a way
+ to perform a flock-build compatible solitary build, handy for a repo
+ clone's first build on a machine with autoconf, automake, etc.
+* Compiling ntp_parser.y using BSD make correctly places ntp_parser.h
+ in the top-level ntpd directory instead of A.*/ntpd.
+* bootstrap script updated to remove potentially stale .deps dirs.
+* Remove unneeded Makefile.am files from the lib/isc/include tree.
+(4.2.5p221) 2009/09/26 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1316] segfault if refclock_nmea can't open file.
+* [Bug 1317] Distribute cvo.sh.
+(4.2.5p220) 2009/09/25 Released by Harlan Stenn <stenn@ntp.org>
+* Rearrange libisc code to match the upstream layout in BIND. This is
+ step one of two, changing the layout but keeping our existing libisc.
+(4.2.5p219) 2009/09/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1315] "interface ignore 0.0.0.0" is ignored.
+* add implicit "nic ignore all" rule before any rules from ntp.conf, so
+ "nic listen eth0" alone means the same as "-I eth0".
+* add wildcard match class for interface/nic rules.
+* fix mistaken carryover of prefixlen from one rule to the next.
+* Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6
+ address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1
+ on Windows to end.
+(4.2.5p218) 2009/09/21 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1314] saveconfig emits -4 and -6 on when not given.
+* correct parsing and processing of setvar directive.
+* highlight location of ntpq :config syntax errors with ^.
+* clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to
+ FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC.
+* parser, saveconfig cleanup to store T_ identifiers in syntax tree.
+(4.2.5p217) 2009/09/20 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1300] reject remote configuration of dangerous items.
+(4.2.5p216) 2009/09/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns.
+* CID 10 missing free(up); in refclock_palisade.c error return, again.
+* CID 83 added assertion to demonstrate config_nic_rules() does not
+ call strchr(NULL, '/').
+(4.2.5p215) 2009/09/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1292] Workaround last VC6 unsigned __int64 kink.
+(4.2.5p214) 2009/09/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1303] remove top-level "autokey" directive.
+* use "nic listen 192.168.0.0/16" instead of
+ "nic listen 192.168.0.0 prefixlen 16".
+(4.2.5p213) 2009/09/16 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1310] fix Thunderbolt mode in refclock_palisade.c
+(4.2.5p212) 2009/09/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 983] add interface [listen | ignore | drop] ... directive.
+* [Bug 1243] MD5auth_setkey zero-fills key from first zero octet.
+* [Bug 1295] leftover fix, do not crash on exit in free_config_trap()
+ when "trap 1.2.3.4" is used without any further options.
+* [Bug 1311] 4.2.5p211 doesn't build in no-debug mode.
+* document interface (alias nic) and unpeer.
+* Correct syntax error line & column numbers.
+* CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths.
+* CID 80: attempt to quiet Coverity false positive re: leaking "reason"
+ in main().
+* Documentation updates from Dave Mills.
+* CID 81: savedconfig leaked in save_config().
+* Make the code agree with the spec and the book (Dave Mills).
+(4.2.5p211) 2009/09/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 663] respect ntpq -c and -p order on command line.
+* [Bug 1292] more VC6 unsigned __int64 workarounds.
+* [Bug 1296] Added Support for Trimble Acutime Gold.
+(4.2.5p210) 2009/09/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros for Windows
+ and remove unnecessary reference to applink.c for Windows
+* [Bug 1295] trap directive options are not optional.
+* [Bug 1297] yylex() must always set yylval before returning.
+(4.2.5p209) 2009/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1290] Fix to use GETTIMEOFDAY macro
+* [Bug 1289] Update project files for VC6, VS2003, VS2005, VS 2008
+(4.2.5p208) 2009/08/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1293] make configuration dumper ready for release, specifically:
+* rename ntpq dumpcfg command to "saveconfig".
+* require authentication for saveconfig.
+* "restrict ... nomodify" prevents saveconfig and :config.
+* "saveconfig ." shorthand to save to startup configuration file.
+* support strftime() substitution in saveconfig arg to timestamp
+ the output filename, for example "saveconfig %Y%m%d-%H%M%S.conf".
+* display saveconfig response message from ntpd in ntpq.
+* save output filename in "savedconfig" variable, fetched with ntpq -c
+ "rv 0 savedconfig".
+* document saveconfig in html/ntpq.html.
+* add ./configure --disable-saveconfig to build a smaller ntpd.
+* log saveconfig failures and successes to syslog.
+(4.2.5p207) 2009/08/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1292] Minor Windows source tweaks for VC6-era SDK headers.
+(4.2.5p206) 2009/08/26 Released by Harlan Stenn <stenn@ntp.org>
+* accopt.html typo fixes from Dave Mills.
+* [Bug 1283] default to remembering KoD in sntp.
+* clean up numerous sntp/kod_management.c bugs.
+* use all addresses resolved from each DNS name in sntp.
+(4.2.5p205) 2009/08/18 Released by Harlan Stenn <stenn@ntp.org>
+* accopt.html typo fixes from Dave Mills.
+* [Bug 1285] Log ntpq :config/config-from-file events.
+* [Bug 1286] dumpcfg omits statsdir, mangles filegen.
+(4.2.5p204) 2009/08/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1284] infinite loop in ntpd dumping more than one trustedkey
+(4.2.5p203) 2009/08/16 Released by Harlan Stenn <stenn@ntp.org>
+* Add ntpq -c dumpcfg, Google Summer of Code project of Max Kuehn
+(4.2.5p202) 2009/08/14 Released by Harlan Stenn <stenn@ntp.org>
+* install the binary and man page for sntp.
+(4.2.5p201) 2009/08/13 Released by Harlan Stenn <stenn@ntp.org>
+* sntp: out with the old, in with the new.
+(4.2.5p200) 2009/08/12 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1281] Build ntpd on Windows without big SDK download, burn,
+ and install by checking in essentially unchanging messages.mc build
+ products to avoid requiring mc.exe, which is not included with VC++
+ 2008 EE.
+(4.2.5p199) 2009/08/09 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1279] Cleanup for warnings from Veracode static analysis.
+(4.2.5p198) 2009/08/03 Released by Harlan Stenn <stenn@ntp.org>
+* Upgrade to autogen-5.9.9-pre5.
+(4.2.5p197) 2009/07/30 Released by Harlan Stenn <stenn@ntp.org>
+* The build script now has . at the end of PATH for config.guess.
+(4.2.5p196) 2009/07/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10.
+* [Bug 1273] CID 10: Palisade leaks unit struct in error path.
+* [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers
+ are consistent.
+* [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0],
+ precs[0].
+* [Bug 1276] CID 52: crypto_xmit() may call crypto_alice[23]()
+ with NULL peer.
+(4.2.5p195) 2009/07/27 Released by Harlan Stenn <stenn@ntp.org>
+* cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE, and QNX.
+(4.2.5p194) 2009/07/26 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* Use scripts/cvo.sh in the build script to get better subdir names.
+(4.2.5p193) 2009/07/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized.
+* [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server().
+* [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks
+ uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
+* [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD.
+* [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt.
+* [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed.
+* [Bug 1267] CID 44: old sntp handle_saving() writes stack garbage to
+ file when clearing.
+* [Bug 1268] CID 63: resolve_hosts() leaks error message buffer.
+* [Bug 1269] CID 74: use assertion to ensure move_fd() does not return
+ negative descriptors.
+* [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface
+ uninitialized.
+(4.2.5p192) 2009/07/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 965] CID 42: ss_family uninitialized.
+* [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer.
+* [Bug 1251] CID 68: search_entry() mishandles dst argument.
+* [Bug 1252] CID 32: Quiet Coverity warning with assertion.
+* [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a
+ list with one entry.
+* [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call.
+* [Bug 1255] CID 55: pkt_output() leaks a copy of each packet.
+* [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as
+ terminal.
+* [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile).
+* [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification.
+* [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata)
+ on error paths.
+* [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata).
+* Updated to AutoGen-5.9.9pre2.
+(4.2.5p191) 2009/07/21 Released by Harlan Stenn <stenn@ntp.org>
+* Updated to AutoGen-5.9.9pre1.
+(4.2.5p190) 2009/07/20 Released by Harlan Stenn <stenn@ntp.org>
+* Updated to AutoGen-5.9.8.
+* [Bug 1248] RES_MSSNTP typo in ntp_proto.c.
+* [Bug 1246] use a common template for singly-linked lists, convert most
+ doubly-linked lists to singly-linked.
+* Log warning about signd blocking when restrict mssntp used.
+(4.2.5p189) 2009/07/16 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation cleanup from Dave Mills.
+(4.2.5p188) 2009/07/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187.
+(4.2.5p187) 2009/07/11 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1042] multicast listeners IPv4+6 ignore new interfaces.
+* [Bug 1237] Windows serial code treat CR and LF both as line
+ terminators.
+* [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver.
+* [Bug 1242] Remove --enable-wintime, symmetric workaround is now
+ always enabled.
+* [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child
+* Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills.
+(4.2.5p186) 2009/07/08 Released by Harlan Stenn <stenn@ntp.org>
+* ntp_proto.c cleanup from Dave Mills.
+(4.2.5p185) 2009/07/01 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* [Bug 1234] convert NMEA driver to use common PPSAPI code.
+* timepps-Solaris.h pps_handle_t changed from pointer to scalar
+* Spectracom refclock added to Windows port of ntpd
+* [Bug 1236] Declaration order fixed.
+* Bracket private ONCORE debug statements with #if 0 rather than #ifdef
+ DEBUG
+* Delete ONCORE debug statement that is now handled elsewhere.
+(4.2.5p184) 2009/06/24 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1233] atom refclock fudge time1 sign flipped in 4.2.5p164.
+(4.2.5p183) 2009/06/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000
+ and earlier with WSAINVAL, do not log a complaint in that case.
+* [Bug 1210] ONCORE driver terminates ntpd without logging a reason.
+* [Bug 1218] Correct comment in refclock_oncore on /etc/ntp.oncore*
+ configuration file search order.
+* Change ONCORE driver to log using msyslog as well as to any
+ clockstats file.
+* [Bug 1231] ntpsnmpd build fails after sockaddr union changes.
+(4.2.5p182) 2009/06/18 Released by Harlan Stenn <stenn@ntp.org>
+* Add missing header dependencies to the ntpdc layout verification.
+* prefer.html updates from Dave Mills.
+* [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
+* [Bug 1215] unpeer by association ID
+* [Bug 1225] Broadcast address miscalculated on Windows 4.2.5p180
+* [Bug 1229] autokey segfaults in cert_install().
+* Use a union for structs sockaddr, sockaddr_storage, sockaddr_in, and
+ sockaddr_in6 to remove casts and enable type checking. Collapse
+ some previously separate IPv4/IPv6 paths into a single codepath.
+(4.2.5p181) 2009/06/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1206] Required compiler changes for Windows
+* [Bug 1084] PPSAPI for ntpd on Windows with DLL backends
+* [Bug 1204] Unix-style refclock device paths on Windows
+* [Bug 1205] partial fix, disable RDTSC use by default on Windows
+* [Bug 1208] decodenetnum() buffer overrun on [ with no ]
+* [Bug 1211] keysdir free()d twice #ifdef DEBUG
+* Enable ONCORE, ARCRON refclocks on Windows (untested)
+(4.2.5p180) 2009/05/29 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1200] Enable IPv6 in Windows port
+* Lose FLAG_FIXPOLL, from Dave Mills.
+(4.2.5p179) 2009/05/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1041] xmt -> aorg timestamp cleanup from Dave Mills,
+ reported by Dave Hart.
+* [Bug 1193] Compile error: conflicting types for emalloc.
+* [Bug 1196] VC6 winsock2.h does not define SO_EXCLUSIVEADDRUSE.
+* Leap/expire cleanup from Dave Mills.
+(4.2.5p178) 2009/05/21 Released by Harlan Stenn <stenn@ntp.org>
+* Provide erealloc() and estrdup(), a la emalloc().
+* Improve ntp.conf's parser error messages.
+* [Bug 320] "restrict default ignore" does not affect IPv6.
+* [Bug 1192] "restrict -6 ..." reports a syntax error.
+(4.2.5p177) 2009/05/18 Released by Harlan Stenn <stenn@ntp.org>
+* Include 4.2.4p7
+* [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned
+* [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode
+* Update NMEA refclock documentation in html/drivers/driver20.html
+(4.2.5p176) 2009/05/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1154] mDNS registration should be done later, repeatedly and only
+ if asked for. (second try for fix)
+(4.2.5p175) 2009/05/12 Released by Harlan Stenn <stenn@ntp.org>
+* Include 4.2.4p7-RC7
+* [Bug 1180] ntpd won't start with more than ~1000 interfaces
+* [Bug 1182] Documentation typos and missing bits.
+* [Bug 1183] COM port support should extend past COM3
+* [Bug 1184] ntpd is deaf when restricted to second IP on the same net
+* Clean up configure.ac NTP_CACHEVERSION interface, display cache
+ version when clearing. Fixes a regression.
+(4.2.5p174) 2009/05/09 Released by Harlan Stenn <stenn@ntp.org>
+* Stale leapsecond file fixes from Dave Mills.
+(4.2.5p173) 2009/05/08 Released by Harlan Stenn <stenn@ntp.org>
+* Include 4.2.4p7-RC6
+(4.2.5p172) 2009/05/06 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1175] Instability in PLL daemon mode.
+* [Bug 1176] refclock_parse.c does not compile without PPSAPI.
+(4.2.5p171) 2009/05/04 Released by Harlan Stenn <stenn@ntp.org>
+* Autokey documentation cleanup from Dave Mills.
+* [Bug 1171] line editing libs found without headers (Solaris 11)
+* [Bug 1173] NMEA refclock fails with Solaris PPSAPI
+* Fix problem linking msntp on Solaris when sntp subdir is configured
+ before parent caused by different gethostent library search order.
+* Do not clear config.cache when it is empty.
+(4.2.5p170) 2009/05/02 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1152] adjust PARSE to new refclock_pps logic
+* Include 4.2.4p7-RC5
+* loopfilter FLL/PLL crossover cleanup from Dave Mills.
+* Documentation updates from Dave Mills.
+* ntp-keygen cleanup from Dave Mills.
+* crypto API cleanup from Dave Mills.
+* Add NTP_CACHEVERSION mechanism to ignore incompatible config.cache
+* Enable gcc -Wstrict-overflow for gsoc_sntp as well
+(4.2.5p169) 2009/04/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1171] Note that we never look for -lreadline by default.
+* [Bug 1090] Fix bogus leap seconds in refclock_hpgps.
+(4.2.5p168) 2009/04/29 Released by Harlan Stenn <stenn@ntp.org>
+* Include 4.2.4p7-RC4
+* [Bug 1169] quiet compiler warnings
+* Re-enable gcc -Wstrict-prototypes when not building with OpenSSL
+* Enable gcc -Wstrict-overflow
+* ntpq/ntpdc emit newline after accepting password on Windows
+* Updates from Dave Mills:
+* ntp-keygen.c: Updates.
+* Fix the error return and syslog function ID in refclock_{param,ppsapi}.
+* Make sure syspoll is within the peer's minpoll/maxpoll bounds.
+* ntp_crypto.c: Use sign_siglen, not len. sign key filename cleanup.
+* Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths.
+* m4/ntp_lineeditlibs.m4: fix warnings from newer Autoconf
+* [Bug 1166] Remove truncation of position (blanking) code in refclock_nmea.c
+(4.2.5p167) 2009/04/26 Released by Harlan Stenn <stenn@ntp.org>
+* Crypto cleanup from Dave Mills.
+(4.2.5p166) 2009/04/25 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1165] Clean up small memory leaks in the config file parser
+* Correct logconfig keyword declaration to MULTIPLE_ARG
+* Enable filename and line number leak reporting on Windows when built
+ DEBUG for all the typical C runtime allocators such as calloc,
+ malloc, and strdup. Previously only emalloc calls were covered.
+* Add DEBUG-only code to free dynamically allocated memory that would
+ otherwise remain allocated at ntpd exit, to allow less forgivable
+ leaks to stand out in leaks reported after exit.
+* Ensure termination of strings in ports/winnt/libisc/isc_strerror.c
+ and quiet compiler warnings.
+* [Bug 1057] ntpdc unconfig failure
+* [Bug 1161] unpeer AKA unconfig command for ntpq :config
+* PPS and crypto cleanup in ntp_proto.c from Dave Mills.
+(4.2.5p165) 2009/04/23 Released by Harlan Stenn <stenn@ntp.org>
+* WWVB refclock cleanup from Dave Mills.
+* Code cleanup: requested_key -> request_key.
+* [Bug 833] ignore whitespace at end of remote configuration lines
+* [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows
+* [Bug 1028] Support for W32Time authentication via Samba.
+* quiet ntp_parser.c malloc redeclaration warning
+* Mitigation and PPS/PPSAPI cleanup from Dave Mills.
+* Documentation updates from Dave Mills.
+* timepps-Solaris.h patches from Dave Hart.
+(4.2.5p164) 2009/04/22 Released by Harlan Stenn <stenn@ntp.org>
+* Include 4.2.4p7-RC3
+* PPS/PPSAPI cleanup from Dave Mills.
+* Documentation updates from Dave Mills.
+* [Bug 1125] C runtime per-thread initialization on Windows
+* [Bug 1152] temporarily disable refclock_parse, refclock_true until
+ maintainers can repair build break from pps_sample()
+* [Bug 1153] refclock_nmea should not mix UTC with GPS time
+* [Bug 1159] ntpq overlap diagnostic message test buggy
+(4.2.5p163) 2009/04/10 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.5p162) 2009/04/09 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* Mitigation and PPS cleanup from Dave Mills.
+* Include 4.2.4p7-RC2
+* [Bug 216] New interpolation scheme for Windows eliminates 1ms jitter
+* remove a bunch of #ifdef SYS_WINNT from portable code
+* 64-bit time_t cleanup for building on newer Windows compilers
+* Only set CMOS clock during ntpd exit on Windows if the computer is
+ shutting down or restarting.
+* [Bug 1148] NMEA reference clock improvements
+* remove deleted gsoc_sntp/utilities.o from repository so that .o build
+ products can be cleaned up without corrupting the repository.
+(4.2.5p161) 2009/03/31 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+(4.2.5p160) 2009/03/30 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1141] refclock_report missing braces cause spurious "peer event:
+ clock clk_unspec" log entries
+* Include 4.2.4p7-RC1
+(4.2.5p159) 2009/03/28 Released by Harlan Stenn <stenn@ntp.org>
+* "bias" changes from Dave Mills.
+(4.2.5p158) 2009/01/30 Released by Harlan Stenn <stenn@ntp.org>
+* Fix [CID 72], a typo introduced at the latest fix to prettydate.c.
+(4.2.5p157) 2009/01/26 Released by Harlan Stenn <stenn@ntp.org>
+* Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills.
+(4.2.5p156) 2009/01/19 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1118] Fixed sign extension for 32 bit time_t in caljulian() and prettydate().
+ Fixed some compiler warnings about missing prototypes.
+ Fixed some other simple compiler warnings.
+* [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c.
+* [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it.
+* [Bug 1121] [CID 47] double fclose() in ntp-keygen.c.
+(4.2.5p155) 2009/01/18 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* CHU frequency updates.
+* Design assertion fixes for ntp_crypto.c from Dave Mills.
+(4.2.5p154) 2009/01/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 992] support interface event change on Linux from
+ Miroslav Lichvar.
+(4.2.5p153) 2009/01/09 Released by Harlan Stenn <stenn@ntp.org>
+* Renamed gsoc_sntp/:fetch-stubs to gsoc_sntp/fetch-stubs to avoid
+ file name problems under Windows.
+ Removed German umlaut from log msg for 4.2.5p142.
+(4.2.5p152) 2009/01/08 Released by Harlan Stenn <stenn@ntp.org>
+* Include 4.2.4p6: 2009/01/08 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.5p151) 2008/12/23 Released by Harlan Stenn <stenn@ntp.org>
+* Stats file logging cleanup from Dave Mills.
+(4.2.5p150) 2008/12/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1099] Fixed wrong behaviour in sntp's crypto.c.
+* [Bug 1103] Fix 64-bit issues in the new calendar code.
+(4.2.5p149) 2008/12/05 Released by Harlan Stenn <stenn@ntp.org>
+* Fixed mismatches in data types and OID definitions in ntpSnmpSubAgent.c
+* added a premliminary MIB file to ntpsnmpd (ntpv4-mib.mib)
+(4.2.5p148) 2008/12/04 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1070] Fix use of ntpq_parsestring() in ntpsnmpd.
+(4.2.5p147) 2008/11/27 Released by Harlan Stenn <stenn@ntp.org>
+* Update gsoc_sntp's GCC warning code.
+(4.2.5p146) 2008/11/26 Released by Harlan Stenn <stenn@ntp.org>
+* Update Solaris CFLAGS for gsoc_sntp.
+(4.2.5p145) 2008/11/20 Released by Harlan Stenn <stenn@ntp.org>
+* Deal with time.h for sntp under linux.
+* Provide rpl_malloc() for sntp for systems that need it.
+* Handle ss_len and socklen type for sntp.
+* Fixes to the sntp configure.ac script.
+* Provide INET6_ADDRSTRLEN if it is missing.
+* [Bug 1095] overflow in caljulian.c.
+(4.2.5p144) 2008/11/19 Released by Harlan Stenn <stenn@ntp.org>
+* Use int32, not int32_t.
+* Avoid the sched*() functions under OSF - link problems.
+(4.2.5p143) 2008/11/17 Released by Harlan Stenn <stenn@ntp.org>
+* sntp cleanup and fixes.
+(4.2.5p142) 2008/11/16 Released by Harlan Stenn <stenn@ntp.org>
+* Imported GSoC SNTP code from Johannes Maximilian Kuehn.
+(4.2.5p141) 2008/11/13 Released by Harlan Stenn <stenn@ntp.org>
+* New caltontp.c and calyearstart.c from Juergen Perlinger.
+(4.2.5p140) 2008/11/12 Released by Harlan Stenn <stenn@ntp.org>
+* Cleanup lint from the ntp_scanner files.
+* [Bug 1011] gmtime() returns NULL on windows where it would not under Unix.
+* Updated caljulian.c and prettydate.c from Juergen Perlinger.
+(4.2.5p139) 2008/11/11 Released by Harlan Stenn <stenn@ntp.org>
+* Typo fix to driver20.html.
+(4.2.5p138) 2008/11/10 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 474] --disable-ipv6 is broken.
+* IPv6 interfaces were being looked for twice.
+* SHM driver grabs more samples, add clockstats
+* decode.html and driver20.html updates from Dave Mills.
+(4.2.5p137) 2008/11/01 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1069] #undef netsnmp's PACKAGE_* macros.
+* [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize().
+(4.2.5p136) 2008/10/27 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1078] statsdir configuration parsing is broken.
+(4.2.5p135) 2008/09/23 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1072] clock_update should not allow updates older than sys_epoch.
+(4.2.5p134) 2008/09/17 Released by Harlan Stenn <stenn@ntp.org>
+* Clean up build process for ntpsnmpd.
+(4.2.5p133) 2008/09/16 Released by Harlan Stenn <stenn@ntp.org>
+* Add options processing to ntpsnmpd.
+* [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd.
+* Clean up the libntpq.a build.
+* Regenerate ntp_parser.[ch] from ntp_parser.y
+(4.2.5p132) 2008/09/15 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1067] Multicast DNS service registration must come after the fork
+ on Solaris.
+* [Bug 1066] Error messages should log as errors.
+(4.2.5p131) 2008/09/14 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1065] Re-enable support for the timingstats file.
+(4.2.5p130) 2008/09/13 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1064] Implement --with-net-snmp-config=progname
+* [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution.
+(4.2.5p129) 2008/09/11 Released by Harlan Stenn <stenn@ntp.org>
+* Quiet some libntpq-related warnings.
+(4.2.5p128) 2008/09/08 Released by Harlan Stenn <stenn@ntp.org>
+* Import Heiko Gerstung's GSoC2008 NTP MIB daemon.
+(4.2.5p127) 2008/09/01 Released by Harlan Stenn <stenn@ntp.org>
+* Regenerate ntpd/ntp_parser.c
+(4.2.5p126) 2008/08/31 Released by Harlan Stenn <stenn@ntp.org>
+* Stop libtool-1.5 from looking for C++ or Fortran.
+* [BUG 610] Documentation update for NMEA reference clock driver.
+* [Bug 828] Fix IPv4/IPv6 address parsing.
+* Changes from Dave Mills:
+ Documentation updates.
+ Fix a corner case where a frequency update was reported but not set.
+ When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have
+ crypto_flags.
+(4.2.5p125) 2008/08/18 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 1052] Add linuxPPS support to ONCORE driver.
+(4.2.5p124) 2008/08/17 Released by Harlan Stenn <stenn@ntp.org>
+* Documentation updates from Dave Mills.
+* Include 4.2.4p5: 2008/08/17 Released by Harlan Stenn <stenn@ntp.org>
+* [Bug 861] leap info was not being transmitted.
+* [Bug 1046] refnumtoa.c is using the wrong header file.
+* [Bug 1047] enable/disable options processing fix.
+* header file cleanup.
+* [Bug 1037] buffer in subroutine was 1 byte short.
+* configure.ac: cleanup, add option for wintime, and lay the groundwork
+ for the changes needed for bug 1028.
+* Fixes from Dave Mills: 'bias' and 'interleave' work. Separate
+ phase and frequency discipline (for long poll intervals). Update
+ TAI function to match current leapsecond processing.
+* Documentation updates from Dave Mills.
+* [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen.
+* Fixed the incorrect edge parameter being passed to time_pps_kcbind in
+ NMEA refclock driver.
+* [Bug 399] NMEA refclock driver does not honor time1 offset if flag3 set.
+* [Bug 985] Modifications to NMEA reference clock driver to support Accord
+ GPS Clock.
+* poll time updates from Dave Mills.
+* local refclock documentation updates from Dave Mills.
+* [Bug 1022] Fix compilation problems with yesterday's commit.
+* Updates and cleanup from Dave Mills:
+ I've now spent eleven months of a sabbatical year - 7 days a week, 6-10
+ hours most days - working on NTP. I have carefully reviewed every major
+ algorithm, examined its original design and evolution from that design.
+ I've trimmed off dead code and briar patches and did zillions of tests
+ contrived to expose evil vulnerabilities. The development article is in
+ rather good shape and should be ready for prime time.
+
+ 1. The protostats statistics files have been very useful in exposing
+ little twitches and turns when something hiccups, like a broken PPS
+ signal. Most of what used to be syslog messages are now repackaged as
+ protostats messages with optional syslog as well. These can also be sent
+ as traps which might be handy to tiggle a beeper or celltext. These, the
+ sysstats files and cryptostats files reveal the ambient health of a busy
+ server, monitor traffic and error counts and spot crypto attacks.
+
+ 2. Close inspection of the clock discipline behavior at long poll
+ intervals (36 h) showed it not doing as well as it should. I redesigned
+ the FLL loop to improve nominal accuracy from several tens of
+ milliseconds to something less than ten milliseconds.
+
+ 3. Autokey (again). The enhanced error checking was becoming a major
+ pain. I found a way to toss out gobs of ugly fat code and replace the
+ function with a much simpler and more comprehensive scheme. It resists
+ bait-and-switch attacks and quickly detect cases when the protocol is
+ not correctly synchronized.
+
+ 4. The interface code for the kernel PPS signal was not in sync with the
+ kernel code itself. Some error checks were duplicated and some
+ ineffective. I found none of the PPS-capable drivers, including the atom
+ driver, do anything when the prefer peer fails; the kernel PPS signal
+ remains in control. The atom driver now disables the kernel PPS when the
+ prefer peer comes bum. This is important when the prefer peer is not a
+ reference clock but a remote NTP server.
+
+ 5. The flake restrict bit turned out to be really interesting,
+ especially with symmtric modes and of those especially those using
+ Autokey. Small changes in the recovery procedures when packets are lost
+ now avoid almost all scenarios which previously required protocol resets.
+
+ 6. I've always been a little uncomfortable when using the clock filter
+ with long poll intervals because the samples become less and less
+ correlated as the sample age exceeds the Allan intercept. Various
+ schemes have been used over the years to cope with this fact. The latest
+ one and the one that works the best is to use a modified sort metric
+ where the delay is used when the age of the sample is less than the
+ intercept and the sum of delay and dispersion above that. The net result
+ is that, at small poll intervals the algorithm operates as a minimum
+ filter, while at larger poll intervals it morphs to FIFO. Left
+ unmodified, a sample could be used when twelve days old. This along with
+ the FLL modifications has made a dramatic improvement at large poll
+ intervals.
+
+- [Backward Incompatible] The 'state' variable is no longer reported or
+ available via ntpq output. The following system status bit names
+ have been changed:
+ - sync_alarm -> leap_alarm
+ - sync_atomic -> sync_pps
+ - sync_lf_clock -> sync_lf_radio
+ - sync_hf_clock -> sync_hf_radio
+ - sync_uhf_clock -> sync_uhf_radio
+ - sync_local_proto -> sync_local
+ - sync_udp/time -> sync_other
+ Other names have been changed as well. See the change history for
+ libntp/statestr.c for more details.
+ Other backward-incompatible changes in ntpq include:
+ - assID -> associd
+ - rootdispersion -> rootdisp
+ - pkt_head -> pkt_neader
+ See the change history for other details.
+
+* Updates and cleanup from Dave Mills.
+* [Bug 995] Remove spurious ; from ntp-keygen.c.
+* More cleanup and changes from Dave Mills.
+* [Bug 980] Direct help to stdout.
+---
+(4.2.4p8) 2009/12/08 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Sec 1331] DoS with mode 7 packets - CVE-2009-3563.
+
+---
+(4.2.4p7) 2009/05/18 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252.
+* [Bug 1187] Update the copyright date.
+* [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix
+ for [Sec 1149].
+
+---
+(4.2.4p7-RC7) 2009/05/12 Released by Harlan Stenn <stenn@ntp.org>
+
+* ntp.isc.org -> ntp.org cleanup.
+* [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime,
+ add configure --enable-ignore-dns-errors to be even more stubborn
+
+---
+(4.2.4p7-RC6) 2009/05/08 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 784] Make --enable-linuxcaps the default when available
+* [Bug 1179] error messages for -u/--user and -i lacking droproot
+* Updated JJY reference clock driver from Takao Abe
+* [Bug 1071] Log a message and exit before trying to use FD_SET with a
+ descriptor larger than FD_SETSIZE, which will corrupt memory
+* On corruption of the iface list head in add_interface, log and exit
+
+---
+(4.2.4p7-RC5) 2009/05/02 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux.
+* flock-build script unportable 'set -m' use removed
+
+---
+(4.2.4p7-RC4) 2009/04/29 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1167] use gcc -Winit-self only if it is understood
+
+---
+(4.2.4p7-RC3) 2009/04/22 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 787] Bug fixes for 64-bit time_t on Windows
+* [Bug 813] Conditional naming of Event
+* [Bug 1147] System errors should be logged to msyslog()
+* [Bug 1155] Fix compile problem on Windows with VS2005
+* [Bug 1156] lock_thread_to_processor() should be declared in header
+* [Bug 1157] quiet OpenSSL warnings, clean up configure.ac
+* [Bug 1158] support for aix6.1
+* [Bug 1160] MacOS X is like BSD regarding F_SETOWN
+
+---
+(4.2.4p7-RC2) 2009/04/09 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159
+* [Sec 1149] use SO_EXCLUSIVEADDRUSE on Windows
+
+---
+(4.2.4p7-RC1) 2009/03/30 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1131] UDP sockets should not use SIGPOLL on Solaris.
+* build system email address cleanup
+* [Bug 774] parsesolaris.c does not compile under the new Solaris
+* [Bug 873] Windows serial refclock proper TTY line discipline emulation
+* [Bug 1014] Enable building with VC9 (in Visual Studio 2008,
+ Visual C++ 2008, or SDK)
+* [Bug 1117] Deferred interface binding under Windows works only correctly
+ if FORCE_DNSRETRY is defined
+* [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU
+* DPRINTF macro made safer, always evaluates to a statement and will not
+ misassociate an else which follows the macro.
+
+---
+(4.2.4p6) 2009/01/08 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 1113] Fixed build errors with recent versions of openSSL.
+* [Sec 1111] Fix incorrect check of EVP_VerifyFinal()'s return value.
+* Update the copyright year.
+
+---
+(4.2.4p5) 2008/08/17 Released by Harlan Stenn <stenn@ntp.org>
+
+* [BUG 1051] Month off by one in leap second message written to clockstats
+ file fixed.
+* [Bug 450] Windows only: Under original Windows NT we must not discard the
+ wildcard socket to workaround a bug in NT's getsockname().
+* [Bug 1038] Built-in getpass() function also prompts for password if
+ not built with DEBUG.
+* [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
+ to local interfaces the default.
+ Emit a warning if that keyword is used for configuration.
+* [Bug 959] Refclock on Windows not properly releasing recvbuffs.
+* [Bug 993] Fix memory leak when fetching system messages.
+* much cleanup, fixes, and changes from Dave Mills.
+* ntp_control.c: LEAPTAB is a filestamp, not an unsigned. From Dave Mills.
+* ntp_config.c: ntp_minpoll fixes from Dave Mills.
+* ntp-keygen updates from Dave Mills.
+* refresh epoch, throttle, and leap cleanup from Dave Mills.
+* Documentation cleanup from Dave Mills.
+* [Bug 918] Only use a native md5.h if MD5Init() is available.
+* [Bug 979] Provide ntptimeval if it is not otherwise present.
+* [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork.
+* [Bug 952] Use md5 code with a friendlier license.
+* [Bug 977] Fix mismatching #ifdefs for builds without IPv6.
+* [Bug 830] Fix the checking order of the interface options.
+* Clean up the logfile/syslog setup.
+* [Bug 970] Lose obsolete -g flag to ntp-keygen.
+* The -e flag to ntp-keygen can write GQ keys now, too.
+* ntp_proto.c: sys_survivors and hpoll cleanup from Dave Mills.
+* ntp_loopfilter.c: sys_poll cleanup from Dave Mills.
+* refclock_wwv.c: maximum-likelihood digit and DSYNC fixes from Dave Mills.
+* [Bug 967] preemptable associations are lost forever on a step.
+* ntp_config.c: [CID 48] missing "else" clause.
+* [Bug 833] ntpq config keyword is quote-mark unfriendly.
+* Rename the ntpq "config" keyword to ":config".
+* Dave Mills shifted some orphan processing.
+* Fix typos in the [Bug 963] patch.
+* bootstrap: squawk if genver fails. Use -f with cp in case Dave does a chown.
+* Remove obsolete simulator command-line options.
+* ntp_request.c: [CID 36] zero sin_zero.
+* [Bug 963] get_systime() is too noisy.
+* [Bug 960] spurious syslog:crypto_setup:spurious crypto command
+* [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux.
+* Changes from Dave Mills:
+ - ntp_util.c: cleanup.
+ - ntp_timer.c: watch the non-burst packet rate.
+ - ntp_request.c: cleanup.
+ - ntp_restrict.c: RES_LIMITED cleanup.
+ - ntp_proto.c: RES_LIMITED, rate bucktes, counters, overall cleanup.
+ - ntp_peer.c: disallow peer_unconfig().
+ - ntp_monitor.c: RES_LIMITED cleanup.
+ - ntp_loopfilter.c: poll interval cleanup.
+ - ntp_crypto.c: volley -> retry. Cleanup TAI leap message.
+ - ntp_config: average and minimum are ^2 values.
+ - ntpdc: unknownversion is really "declined", not "bad version".
+ - Packet retry cleanup.
+* [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice.
+* [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI
+ override the standard parameters from the ImagePath registry key.
+* Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions.
+* Work around a VPATH difference in FreeBSD's 'make' command.
+* Update bugreport URL.
+* Update -I documentation.
+* [Bug 713] Fix bug reporting information.
+* A bug in the application of the negative-sawtooth for 12 channel receivers.
+* The removal of unneeded startup code used for the original LinuxPPS, it now
+ conforms to the PPSAPI and does not need special code.
+* ntp-keygen.c: Coverity fixes [CID 33,47].
+* Volley cleanup from Dave Mills.
+* Fuzz cleanup from Dave Mills.
+* [Bug 861] Leap second cleanups from Dave Mills.
+* ntpsim.c: add missing protypes and fix [CID 34], a nit.
+* Upgraded bison at UDel.
+* Update br-flock and flock-build machine lists.
+* [Bug 752] QoS: add parse/config handling code.
+* Fix the #include order in tickadj.c for picky machines.
+* [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h.
+* [Bug 752] Update the QoS tagging (code only - configuration to follow).
+* Orphan mode and other protocol cleanup from Dave Mills.
+* Documentation cleanup from Dave Mills.
+* [Bug 940] ntp-keygen uses -v. Disallow it as a shortcut for --version.
+* more cleanup to ntp_lineeditlibs.m4.
+* Documentation updates from Dave Mills.
+* -ledit cleanup for ntpdc and ntpq.
+* Association and other cleanup from Dave Mills.
+* NTP_UNREACH changes from Dave Mills.
+* Fix the readline history test.
+* [Bug 931] Require -lreadline to be asked for explicitly.
+* [Bug 764] When looking for -lreadline support, also try using -lncurses.
+* [Bug 909] Fix int32_t errors for ntohl().
+* [Bug 376/214] Enhancements to support multiple if names and IP addresses.
+* [Bug 929] int32_t is undefined on Windows. Casting wrong.
+* [Bug 928] readlink missing braces.
+* [Bug 788] Update macros to support VS 2005.
+* ntpd/ntp_timer.c: add missing sys_tai parameter for debug printf
+* [Bug 917] config parse leaves files open
+* [Bug 912] detect conflicting enable/disable configuration on interfaces
+ sharing an IP address
+* [Bug 771] compare scopeid if available for IPv6 addresses
+* Lose obsolete crypto subcommands (Dave Mills).
+* WWV is an HF source, not an LF source (Dave Mills).
+* [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT.
+* [Bug 916] 'cryptosw' is undefined if built without OpenSSL.
+* [Bug 891] 'restrict' config file keyword does not work (partial fix).
+* [Bug 890] the crypto command seems to be required now.
+* [Bug 915] ntpd cores during processing of x509 certificates.
+* Crypto lint cleanup from Dave Mills.
+* [Bug 897] Check RAND_status() - we may not need a .rnd file.
+* Crypto cleanup from Dave Mills.
+* [Bug 911] Fix error message in cmd_args.c.
+* [Bug 895] Log assertion failures via syslog(), not stderr.
+* Documentation updates from Dave Mills.
+* Crypto cleanup from Dave Mills.
+* [Bug 905] ntp_crypto.c fails to compile without -DDEBUG.
+* Avoid double peer stats logging.
+* ntp-keygen cleanup from Dave Mills.
+* libopts needs to be built after ElectricFence.
+* [Bug 894] Initialize keysdir before calling crypto_setup().
+* Calysto cleanup for ntpq.
+* ntp-keygen -i takes an arg.
+* Cleanup and fixes from Dave Mills.
+* [Bug 887] Fix error in ntp_types.h (for sizeof int != 4).
+* Bug 880 bug fixes for Windows build
+* Improve Calysto support.
+* The "revoke" parameter is a crypto command.
+* The driftfile wander threshold is a real number.
+* [Bug 850] Fix the wander threshold parameter on the driftfile command.
+* ntp_io.c: Dead code cleanup - Coverity View 19.
+* Leap file related cleanup from Dave Mills.
+* ntp_peer.c: Set peer->srcadr before (not after) calling set_peerdstadr().
+* Initialize offset in leap_file() - Coverity View 17.
+* Use the correct stratum on KISS codes.
+* Fuzz bits cleanup.
+* Show more digits in some debug printf's.
+* Use drift_file_sw internally to control writing the drift file.
+* Implement the wander_threshold option for the driftfile config keyword.
+* reformat ntp_control.c; do not use c++ // comments.
+* [Bug 629] Undo bug #629 fixes as they cause more problems than were being
+ solved
+* Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup,
+ driftfile write cleanup, packet buffer length checks, documentation updates.
+* More assertion checks and malloc()->emalloc(), courtesy of Calysto.
+* [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
+* [Bug 862] includefile nesting; preserve phonelist on reconfig.
+* [Bug 604] ntpd regularly dies on linux/alpha.
+* more leap second infrastructure fixes from Dave Mills.
+* [Bug 858] recent leapfile changes broke non-OpenSSL builds.
+* Use emalloc() instead of malloc() in refclock_datum.c (Calysto).
+* Start using 'design by contract' assertions.
+* [Bug 767] Fast sync to refclocks wanted.
+* Allow null driftfile.
+* Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES.
+* [Bug 629] changes to ensure broadcast works including on wildcard addresses
+* [Bug 853] get_node() must return a pointer to maximally-aligned memory.
+* Initial leap file fixes from Dave Mills.
+* [Bug 858] Recent leapfile changes broke without OPENSSL.
+* Use a char for DIR_SEP, not a string.
+* [Bug 850] driftfile parsing changes.
+* driftfile maintenance changes from Dave Mills. Use clock_phi instead of
+ stats_write_tolerance.
+* [Bug 828] refid string not being parsed correctly.
+* [Bug 846] Correct includefile parsing.
+* [Bug 827] New parsing code does not handle "fudge" correctly.
+* Enable debugging capability in the config parser.
+* [Bug 839] Crypto password not read from ntp.conf.
+* Have autogen produce writable output files.
+* [Bug 825] Correct logconfig -/+ keyword processing.
+* [Bug 828] Correct parsing of " delimited strings.
+* Cleanup FILE * usage after fclose() in ntp_filegen.c.
+* [Bug 843] Windows Completion port code was incorrectly merged from -stable.
+* [Bug 840] do fudge configuration AFTER peers (thus refclocks) have been
+ configured.
+* [Bug 824] Added new parser modules to the Windows project file.
+* [Bug 832] Add libisc/log.c headers to the distribution.
+* [Bug 808] Only write the drift file if we are in state 4.
+* Initial import of libisc/log.c and friends.
+* [Bug 826] Fix redefinition of PI.
+* [Bug 825] ntp_scanner.c needs to #include <config.h> .
+* [Bug 824] New parser code has some build problems with the SIM code.
+* [Bug 817] Use longnames for setting ntp variables on the command-line;
+ Allowing '-v' with and without an arg to disambiguate usage is error-prone.
+* [Bug 822] set progname once, early.
+* [Bug 819] remove erroneous #if 0 in Windows completion port code.
+* The new config code missed an #ifdef for building without refclocks.
+* Distribute some files needed by the new config parsing code.
+* [Bug 819] Timeout for WaitForMultipleObjects was 500ms instead of INFINITE
+* Use autogen 5.9.1.
+* Fix clktest command-line arg processing.'
+* Audio documentation updates from Dave Mills.
+* New config file parsing code, from Sachin Kamboj.
+* fuzz bit cleanup from Dave Mills.
+* replay cleanup from Dave Mills.
+* [Bug 542] Tolerate missing directory separator at EO statsdir.
+* [Bug 812] ntpd should drop supplementary groups.
+* [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6.
+* [Bug 740] Fix kernel/daemon startup drift anomaly.
+* refclock_wwv.c fixes from Dave Mills.
+* [Bug 810] Fix ntp-keygen documentation.
+* [Bug 787] Bug fixes for 64-bit time_t on Windows.
+* [Bug 796] Clean up duplicate #defines in ntp_control.c.
+* [Bug 569] Use the correct precision for the Leitch CSD-5300.
+* [Bug 795] Moved declaration of variable to top of function.
+* [Bug 798] ntpq [p typo crashes ntpq/ntpdc.
+* [Bug 786] Fix refclock_bancomm.c on Solaris.
+* [Bug 774] parsesolaris.c does not compile under the new Solaris.
+* [Bug 782] Remove P() macros from Windows files.
+* [Bug 778] ntpd fails to lock with drift=+500 when started with drift=-500.
+* [Bug 592] Trimble Thunderbolt GPS support.
+* IRIG, CHU, WWV, WWVB refclock improvements from Dave Mills.
+* [Bug 757] Lose ULONG_CONST().
+* [Bug 756] Require ANSI C (function prototypes).
+* codec (audio) and ICOM changes from Dave Mills.
+
+---
+
+* [Bug 450] Windows only: Under original Windows NT we must not discard the
+ wildcard socket to workaround a bug in NT's getsockname().
+* [Bug 1038] Built-in getpass() function also prompts for password if
+ not built with DEBUG.
+* [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
+ to local interfaces the default.
+ Emit a warning if that keyword is used for configuration.
+* [Bug 959] Refclock on Windows not properly releasing recvbuffs.
+* [Bug 993] Fix memory leak when fetching system messages.
+* [Bug 987] Wake up the resolver thread/process when a new interface has
+ become available.
+* Correctly apply negative-sawtooth for oncore 12 channel receiver.
+* Startup code for original LinuxPPS removed. LinuxPPS now conforms to
+ the PPSAPI.
+* [Bug 1000] allow implicit receive buffer allocation for Windows.
+ fixes startup for windows systems with many interfaces.
+ reduces dropped packets on network bursts.
+ additionally fix timer() starvation during high load.
+* [Bug 990] drop minimum time restriction for interface update interval.
+* [Bug 977] Fix mismatching #ifdefs for builds without IPv6.
+* Update the copyright year.
+* Build system cleanup (make autogen-generated files writable).
+* [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI
+ override the standard parameters from the ImagePath registry key.
+* Fixes for ntpdate:
+* [Bug 532] nptdate timeout is too long if several servers are supplied.
+* [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools.
+* [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't.
+* [Bug 908] ntpdate crashes sometimes.
+* [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set
+ (dup of 908).
+* [Bug 997] ntpdate buffer too small and unsafe.
+* ntpdate.c: Under Windows check whether NTP port in use under same conditions
+ as under other OSs.
+* ntpdate.c: Fixed some typos and indents (tabs/spaces).
+
+(4.2.4p4) Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 902] Fix problems with the -6 flag.
+* Updated include/copyright.def (owner and year).
+* [Bug 878] Avoid ntpdc use of refid value as unterminated string.
+* [Bug 881] Corrected display of pll offset on 64bit systems.
+* [Bug 886] Corrected sign handling on 64bit in ntpdc loopinfo command.
+* [Bug 889] avoid malloc() interrupted by SIGIO risk
+* ntpd/refclock_parse.c: cleanup shutdown while the file descriptor is still
+ open.
+* [Bug 885] use emalloc() to get a message at the end of the memory
+ unsigned types cannot be less than 0
+ default_ai_family is a short
+ lose trailing , from enum list
+ clarify ntp_restrict.c for easier automated analysis
+* [Bug 884] don't access recv buffers after having them passed to the free
+ list.
+* [Bug 882] allow loopback interfaces to share addresses with other
+ interfaces.
+
+---
+(4.2.4p3) Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 863] unable to stop ntpd on Windows as the handle reference for events
+ changed
+
+---
+(4.2.4p2) Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 854] Broadcast address was not correctly set for interface addresses
+* [Bug 829] reduce syslog noise, while there fix Enabled/Disable logging
+ to reflect the actual configuration.
+* [Bug 795] Moved declaration of variable to top of function.
+* [Bug 789] Fix multicast client crypto authentication and make sure arriving
+ multicast packets do not disturb the autokey dance.
+* [Bug 785] improve handling of multicast interfaces
+ (multicast routers still need to run a multicast routing software/daemon)
+* ntpd/refclock_parse.c: cleanup shutdown while the file descriptor is still
+ open.
+* [Bug 885] use emalloc() to get a message at the end of the memory
+ unsigned types cannot be less than 0
+ default_ai_family is a short
+ lose trailing , from enum list
+* [Bug 884] don't access recv buffers after having them passed to the free list.
+* [Bug 882] allow loopback interfaces to share addresses with other interfaces.
+* [Bug 527] Don't write from source address length to wrong location
+* Upgraded autogen and libopts.
+* [Bug 811] ntpd should not read a .ntprc file.
+
+---
+(4.2.4p1) (skipped)
+
+---
+(4.2.4p0) Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 793] Update Hans Lambermont's email address in ntpsweep.
+* [Bug 776] Remove unimplemented "rate" flag from ntpdate.
+* [Bug 586] Avoid lookups if AI_NUMERICHOST is set.
+* [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert).
+* [Bug 768] Fix io_setbclient() error message.
+* [Bug 765] Use net_bind_service capability on linux.
+* [Bug 760] The background resolver must be aware of the 'dynamic' keyword.
+* [Bug 753] make union timestamp anonymous (Philip Prindeville).
+* confopt.html: move description for "dynamic" keyword into the right section.
+* pick the right type for the recv*() length argument.
+
+---
+(4.2.4) Released by Harlan Stenn <stenn@ntp.org>
+
+* monopt.html fixes from Dave Mills.
+* [Bug 452] Do not report kernel PLL/FLL flips.
+* [Bug 746] Expert mouseCLOCK USB v2.0 support added.'
+* driver8.html updates.
+* [Bug 747] Drop <NOBR> tags from ntpdc.html.
+* sntp now uses the returned precision to control decimal places.
+* sntp -u will use an unprivileged port for its queries.
+* [Bug 741] "burst" doesn't work with !unfit peers.
+* [Bug 735] Fix a make/gmake VPATH issue on Solaris.
+* [Bug 739] ntpd -x should not take an argument.
+* [Bug 737] Some systems need help providing struct iovec.
+* [Bug 717] Fix libopts compile problem.
+* [Bug 728] parse documentation fixes.
+* [Bug 734] setsockopt(..., IP_MULTICAST_IF, ...) fails on 64-bit platforms.
+* [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu.
+* [Bug 721] check for __ss_family and __ss_len separately.
+* [Bug 666] ntpq opeers displays jitter rather than dispersion.
+* [Bug 718] Use the recommended type for the saddrlen arg to getsockname().
+* [Bug 715] Fix a multicast issue under Linux.
+* [Bug 690] Fix a Windows DNS lookup buffer overflow.
+* [Bug 670] Resolved a Windows issue with the dynamic interface rescan code.
+* K&R C support is being deprecated.
+* [Bug 714] ntpq -p should conflict with -i, not -c.
+* WWV refclock improvements from Dave Mills.
+* [Bug 708] Use thread affinity only for the clock interpolation thread.
+* [Bug 706] ntpd can be running several times in parallel.
+* [Bug 704] Documentation typos.
+* [Bug 701] coverity: NULL dereference in ntp_peer.c
+* [Bug 695] libopts does not protect against macro collisions.
+* [Bug 693] __adjtimex is independent of ntp_{adj,get}time.
+* [Bug 692] sys_limitrejected was not being incremented.
+* [Bug 691] restrictions() assumption not always valid.
+* [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked.
+* [Bug 688] Fix documentation typos.
+* [Bug 686] Handle leap seconds better under Windows.
+* [Bug 685] Use the Windows multimedia timer.
+* [Bug 684] Only allow debug options if debugging is enabled.
+* [Bug 683] Use the right version string.
+* [Bug 680] Fix the generated version string on Windows.
+* [Bug 678] Use the correct size for control messages.
+* [Bug 677] Do not check uint_t in configure.ac.
+* [Bug 676] Use the right value for msg_namelen.
+* [Bug 675] Make sure ntpd builds without debugging.
+* [Bug 672] Fix cross-platform structure padding/size differences.
+* [Bug 660] New TIMESTAMP code fails tp build on Solaris Express.
+* [Bug 659] libopts does not build under Windows.
+* [Bug 658] HP-UX with cc needs -Wp,-H8166 in CFLAGS.
+* [Bug 656] ntpdate doesn't work with multicast address.
+* [Bug 638] STREAMS_TLI is deprecated - remove it.
+* [Bug 635] Fix tOptions definition.
+* [Bug 628] Fallback to ntp discipline not working for large offsets.
+* [Bug 622] Dynamic interface tracking for ntpd.
+* [Bug 603] Don't link with libelf if it's not needed.
+* [Bug 523] ntpd service under Windows does't shut down properly.
+* [Bug 500] sntp should always be built.
+* [Bug 479] Fix the -P option.
+* [Bug 421] Support the bc637PCI-U card.
+* [Bug 342] Deprecate broken TRAK refclock driver.
+* [Bug 340] Deprecate broken MSF EES refclock driver.
+* [Bug 153] Don't do DNS lookups on address masks.
+* [Bug 143] Fix interrupted system call on HP-UX.
+* [Bug 42] Distribution tarballs should be signed.
+* Support separate PPS devices for PARSE refclocks.
+* [Bug 637, 51?] Dynamic interface scanning can now be done.
+* Options processing now uses GNU AutoGen.
+
+---
+(4.2.2p4) Released by Harlan Stenn <stenn@ntp.org>
+
+* [Bug 710] compat getnameinfo() has off-by-one error
+* [Bug 690] Buffer overflow in Windows when doing DNS Lookups
+
+---
+(4.2.2p3) Released by Harlan Stenn <stenn@ntp.org>
+
+* Make the ChangeLog file cleaner and easier to read
+* [Bug 601] ntpq's decodeint uses an extra level of indirection
+* [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP
+* release engineering/build changes
+* Documentation fixes
+* Get sntp working under AIX-5
+
+---
+(4.2.2p2) (broken)
+
+* Get sntp working under AIX-5
+
+---
+(4.2.2p1)
+
+* [Bug 661] Use environment variable to specify the base path to openssl.
+* Resolve an ambiguity in the copyright notice
+* Added some new documentation files
+* URL cleanup in the documentation
+* [Bug 657]: IP_MULTICAST_LOOP uses a u_char value/size
+* quiet gcc4 complaints
+* more Coverity fixes
+* [Bug 614] manage file descriptors better
+* [Bug 632] update kernel PPS offsets when PPS offset is re-configured
+* [Bug 637] Ignore UP in*addr_any interfaces
+* [Bug 633] Avoid writing files in srcdir
+* release engineering/build changes
+
+---
+(4.2.2)
+
+* SNTP
+* Many bugfixes
+* Implements the current "goal state" of NTPv4
+* Autokey improvements
+* Much better IPv6 support
+* [Bug 360] ntpd loses handles with LAN connection disabled.
+* [Bug 239] Fix intermittent autokey failure with multicast clients.
+* Rewrite of the multicast code
+* New version numbering scheme
+
+---
+(4.2.0)
+
+* More stuff than I have time to document
+* IPv6 support
+* Bugfixes
+* call-gap filtering
+* wwv and chu refclock improvements
+* OpenSSL integration
+
+---
+(4.1.2)
+
+* clock state machine bugfix
+* Lose the source port check on incoming packets
+* (x)ntpdc compatibility patch
+* Virtual IP improvements
+* ntp_loopfilter fixes and improvements
+* ntpdc improvements
+* GOES refclock fix
+* JJY driver
+* Jupiter refclock fixes
+* Neoclock4X refclock fixes
+* AIX 5 port
+* bsdi port fixes
+* Cray unicos port upgrade
+* HP MPE/iX port
+* Win/NT port upgrade
+* Dynix PTX port fixes
+* Document conversion from CVS to BK
+* readline support for ntpq
+
+---
+(4.1.0)
+
+* CERT problem fixed (99k23)
+
+* Huff-n-Puff filter
+* Preparation for OpenSSL support
+* Resolver changes/improvements are not backward compatible with mode 7
+ requests (which are implementation-specific anyway)
+* leap second stuff
+* manycast should work now
+* ntp-genkeys does new good things.
+* scripts/ntp-close
+* PPS cleanup and improvements
+* readline support for ntpdc
+* Crypto/authentication rewrite
+* WINNT builds with MD5 by default
+* WINNT no longer requires Perl for building with Visual C++ 6.0
+* algorithmic improvements, bugfixes
+* Solaris dosynctodr info update
+* html/pic/* is *lots* smaller
+* New/updated drivers: Forum Graphic GPS, WWV/H, Heath GC-100 II, HOPF
+ serial and PCI, ONCORE, ulink331
+* Rewrite of the audio drivers
+
+---
+(4.0.99)
+
+* Driver updates: CHU, DCF, GPS/VME, Oncore, PCF, Ulink, WWVB, burst
+ If you use the ONCORE driver with a HARDPPS kernel module,
+ you *must* have a properly specified:
+ pps <filename> [assert/clear] [hardpps]
+ line in the /etc/ntp.conf file.
+* PARSE cleanup
+* PPS cleanup
+* ntpd, ntpq, ntpdate cleanup and fixes
+* NT port improvements
+* AIX, BSDI, DEC OSF, FreeBSD, NetBSD, Reliant, SCO, Solaris port improvements
+
+---
+(4.0.98)
+
+* Solaris kernel FLL bug is fixed in 106541-07
+* Bug/lint cleanup
+* PPS cleanup
+* ReliantUNIX patches
+* NetInfo support
+* Ultralink driver
+* Trimble OEM Ace-II support
+* DCF77 power choices
+* Oncore improvements
+
+---
+(4.0.97)
+
+* NT patches
+* AIX,SunOS,IRIX portability
+* NeXT portability
+* ntptimeset utility added
+* cygwin portability patches
+
+---
+(4.0.96)
+
+* -lnsl, -lsocket, -lgen configuration patches
+* Y2K patches from AT&T
+* Linux portability cruft
+
+---
+(4.0.95)
+
+* NT port cleanup/replacement
+* a few portability fixes
+* VARITEXT Parse clock added
+
+---
+(4.0.94)
+
+* PPS updates (including ntp.config options)
+* Lose the old DES stuff in favor of the (optional) RSAREF stuff
+* html cleanup/updates
+* numerous drivers cleaned up
+* numerous portability patches and code cleanup
+
+---
+(4.0.93)
+
+* Oncore refclock needs PPS or one of two ioctls.
+* Don't make ntptime under Linux. It doesn't compile for too many folks.
+* Autokey cleanup
+* ReliantUnix patches
+* html cleanup
+* tickadj cleanup
+* PARSE cleanup
+* IRIX -n32 cleanup
+* byte order cleanup
+* ntptrace improvements and patches
+* ntpdc improvements and patches
+* PPS cleanup
+* mx4200 cleanup
+* New clock state machine
+* SCO cleanup
+* Skip alias interfaces
+
+---
+(4.0.92)
+
+* chronolog and dumbclock refclocks
+* SCO updates
+* Cleanup/bugfixes
+* Y2K patches
+* Updated palisade driver
+* Plug memory leak
+* wharton kernel clock
+* Oncore clock upgrades
+* NMEA clock improvements
+* PPS improvements
+* AIX portability patches
+
+---
+(4.0.91)
+
+* New ONCORE driver
+* New MX4200 driver
+* Palisade improvements
+* config file bugfixes and problem reporting
+* autoconf upgrade and cleanup
+* HP-UX, IRIX lint cleanup
+* AIX portability patches
+* NT cleanup
+
+---
+(4.0.90)
+
+* Nanoseconds
+* New palisade driver
+* New Oncore driver
+
+---
+(4.0.73)
+
+* README.hackers added
+* PARSE driver is working again
+* Solaris 2.6 has nasty kernel bugs. DO NOT enable pll!
+* DES is out of the distribution.
+
+---
+(4.0.72)
+
+* K&R C compiling should work again.
+* IRIG patches.
+* MX4200 driver patches.
+* Jupiter driver added.
+* Palisade driver added. Needs work (ANSI, ntoh/hton, sizeof double, ???)
diff --git a/CommitLog b/CommitLog
new file mode 100644
index 0000000..e8aa261
--- /dev/null
+++ b/CommitLog
@@ -0,0 +1,186461 @@
+ChangeSet@1.3240, 2014-12-02 08:59:55+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P482
+ TAG: NTP_4_2_7P482
+
+ ChangeLog@1.1575 +1 -0
+ NTP_4_2_7P482
+
+ ntpd/invoke-ntp.conf.texi@1.163 +1 -1
+ NTP_4_2_7P482
+
+ ntpd/invoke-ntp.keys.texi@1.160 +1 -1
+ NTP_4_2_7P482
+
+ ntpd/invoke-ntpd.texi@1.476 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntp.conf.5man@1.197 +3 -3
+ NTP_4_2_7P482
+
+ ntpd/ntp.conf.5mdoc@1.197 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntp.conf.html@1.156 +1 -1
+ NTP_4_2_7P482
+
+ ntpd/ntp.conf.man.in@1.197 +3 -3
+ NTP_4_2_7P482
+
+ ntpd/ntp.conf.mdoc.in@1.197 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntp.keys.5man@1.194 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntp.keys.5mdoc@1.194 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntp.keys.html@1.157 +1 -1
+ NTP_4_2_7P482
+
+ ntpd/ntp.keys.man.in@1.194 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntp.keys.mdoc.in@1.194 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntpd-opts.c@1.497 +7 -7
+ NTP_4_2_7P482
+
+ ntpd/ntpd-opts.h@1.496 +3 -3
+ NTP_4_2_7P482
+
+ ntpd/ntpd.1ntpdman@1.305 +3 -3
+ NTP_4_2_7P482
+
+ ntpd/ntpd.1ntpdmdoc@1.305 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntpd.html@1.151 +2 -2
+ NTP_4_2_7P482
+
+ ntpd/ntpd.man.in@1.305 +3 -3
+ NTP_4_2_7P482
+
+ ntpd/ntpd.mdoc.in@1.305 +2 -2
+ NTP_4_2_7P482
+
+ ntpdc/invoke-ntpdc.texi@1.474 +2 -2
+ NTP_4_2_7P482
+
+ ntpdc/ntpdc-opts.c@1.492 +7 -7
+ NTP_4_2_7P482
+
+ ntpdc/ntpdc-opts.h@1.491 +3 -3
+ NTP_4_2_7P482
+
+ ntpdc/ntpdc.1ntpdcman@1.305 +3 -3
+ NTP_4_2_7P482
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.305 +2 -2
+ NTP_4_2_7P482
+
+ ntpdc/ntpdc.html@1.318 +2 -2
+ NTP_4_2_7P482
+
+ ntpdc/ntpdc.man.in@1.305 +3 -3
+ NTP_4_2_7P482
+
+ ntpdc/ntpdc.mdoc.in@1.305 +2 -2
+ NTP_4_2_7P482
+
+ ntpq/invoke-ntpq.texi@1.480 +2 -2
+ NTP_4_2_7P482
+
+ ntpq/ntpq-opts.c@1.497 +7 -7
+ NTP_4_2_7P482
+
+ ntpq/ntpq-opts.h@1.495 +3 -3
+ NTP_4_2_7P482
+
+ ntpq/ntpq.1ntpqman@1.308 +3 -3
+ NTP_4_2_7P482
+
+ ntpq/ntpq.1ntpqmdoc@1.308 +2 -2
+ NTP_4_2_7P482
+
+ ntpq/ntpq.html@1.148 +2 -2
+ NTP_4_2_7P482
+
+ ntpq/ntpq.man.in@1.308 +3 -3
+ NTP_4_2_7P482
+
+ ntpq/ntpq.mdoc.in@1.308 +2 -2
+ NTP_4_2_7P482
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.476 +2 -2
+ NTP_4_2_7P482
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.494 +7 -7
+ NTP_4_2_7P482
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.493 +3 -3
+ NTP_4_2_7P482
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.305 +3 -3
+ NTP_4_2_7P482
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.305 +2 -2
+ NTP_4_2_7P482
+
+ ntpsnmpd/ntpsnmpd.html@1.146 +1 -1
+ NTP_4_2_7P482
+
+ ntpsnmpd/ntpsnmpd.man.in@1.305 +3 -3
+ NTP_4_2_7P482
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.305 +2 -2
+ NTP_4_2_7P482
+
+ packageinfo.sh@1.486 +1 -1
+ NTP_4_2_7P482
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.67 +3 -3
+ NTP_4_2_7P482
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.67 +2 -2
+ NTP_4_2_7P482
+
+ scripts/calc_tickadj/calc_tickadj.html@1.69 +1 -1
+ NTP_4_2_7P482
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.66 +3 -3
+ NTP_4_2_7P482
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P482
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.71 +1 -1
+ NTP_4_2_7P482
+
+ scripts/invoke-plot_summary.texi@1.88 +2 -2
+ NTP_4_2_7P482
+
+ scripts/invoke-summary.texi@1.88 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.297 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntp-wait/ntp-wait-opts@1.33 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.295 +3 -3
+ NTP_4_2_7P482
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.295 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntp-wait/ntp-wait.html@1.314 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntp-wait/ntp-wait.man.in@1.295 +3 -3
+ NTP_4_2_7P482
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.295 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.86 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntpsweep/ntpsweep-opts@1.35 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.74 +3 -3
+ NTP_4_2_7P482
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.74 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntpsweep/ntpsweep.html@1.87 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntpsweep/ntpsweep.man.in@1.74 +3 -3
+ NTP_4_2_7P482
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.86 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntptrace/ntptrace-opts@1.35 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.74 +3 -3
+ NTP_4_2_7P482
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.74 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntptrace/ntptrace.html@1.87 +2 -2
+ NTP_4_2_7P482
+
+ scripts/ntptrace/ntptrace.man.in@1.74 +3 -3
+ NTP_4_2_7P482
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P482
+
+ scripts/plot_summary-opts@1.35 +2 -2
+ NTP_4_2_7P482
+
+ scripts/plot_summary.1plot_summaryman@1.86 +3 -3
+ NTP_4_2_7P482
+
+ scripts/plot_summary.1plot_summarymdoc@1.86 +2 -2
+ NTP_4_2_7P482
+
+ scripts/plot_summary.html@1.89 +2 -2
+ NTP_4_2_7P482
+
+ scripts/plot_summary.man.in@1.86 +3 -3
+ NTP_4_2_7P482
+
+ scripts/plot_summary.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P482
+
+ scripts/summary-opts@1.35 +2 -2
+ NTP_4_2_7P482
+
+ scripts/summary.1summaryman@1.86 +3 -3
+ NTP_4_2_7P482
+
+ scripts/summary.1summarymdoc@1.86 +2 -2
+ NTP_4_2_7P482
+
+ scripts/summary.html@1.89 +2 -2
+ NTP_4_2_7P482
+
+ scripts/summary.man.in@1.86 +3 -3
+ NTP_4_2_7P482
+
+ scripts/summary.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P482
+
+ sntp/invoke-sntp.texi@1.473 +2 -2
+ NTP_4_2_7P482
+
+ sntp/sntp-opts.c@1.491 +7 -7
+ NTP_4_2_7P482
+
+ sntp/sntp-opts.h@1.490 +3 -3
+ NTP_4_2_7P482
+
+ sntp/sntp.1sntpman@1.308 +3 -3
+ NTP_4_2_7P482
+
+ sntp/sntp.1sntpmdoc@1.308 +2 -2
+ NTP_4_2_7P482
+
+ sntp/sntp.html@1.488 +2 -2
+ NTP_4_2_7P482
+
+ sntp/sntp.man.in@1.308 +3 -3
+ NTP_4_2_7P482
+
+ sntp/sntp.mdoc.in@1.308 +2 -2
+ NTP_4_2_7P482
+
+ util/invoke-ntp-keygen.texi@1.477 +2 -2
+ NTP_4_2_7P482
+
+ util/ntp-keygen-opts.c@1.494 +7 -7
+ NTP_4_2_7P482
+
+ util/ntp-keygen-opts.h@1.493 +3 -3
+ NTP_4_2_7P482
+
+ util/ntp-keygen.1ntp-keygenman@1.305 +3 -3
+ NTP_4_2_7P482
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.305 +2 -2
+ NTP_4_2_7P482
+
+ util/ntp-keygen.html@1.152 +2 -2
+ NTP_4_2_7P482
+
+ util/ntp-keygen.man.in@1.305 +3 -3
+ NTP_4_2_7P482
+
+ util/ntp-keygen.mdoc.in@1.305 +2 -2
+ NTP_4_2_7P482
+
+ChangeSet@1.3237.1.1, 2014-12-02 02:55:23+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2641] sntp is installed in the wrong location in Solaris
+
+ ChangeLog@1.1572.1.1 +1 -0
+ [Bug 2641] sntp is installed in the wrong location in Solaris
+
+ sntp/loc/solaris@1.6 +1 -1
+ [Bug 2641] sntp is installed in the wrong location in Solaris
+
+ChangeSet@1.3238, 2014-12-02 00:37:46+01:00, jnperlin@hydra.(none)
+ [Bug 2678] nmea_control() now checks 'refclock_params()' result.
+
+ ChangeLog@1.1573 +1 -0
+ [Bug 2678] nmea_control() now checks 'refclock_params()' result.
+
+ ntpd/refclock_nmea.c@1.75 +12 -2
+ [Bug 2678] nmea_control() now checks 'refclock_params()' result.
+
+ChangeSet@1.3237, 2014-11-22 08:59:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P481
+ TAG: NTP_4_2_7P481
+
+ ChangeLog@1.1572 +1 -0
+ NTP_4_2_7P481
+
+ ntpd/invoke-ntp.conf.texi@1.162 +1 -1
+ NTP_4_2_7P481
+
+ ntpd/invoke-ntp.keys.texi@1.159 +1 -1
+ NTP_4_2_7P481
+
+ ntpd/invoke-ntpd.texi@1.475 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntp.conf.5man@1.196 +3 -3
+ NTP_4_2_7P481
+
+ ntpd/ntp.conf.5mdoc@1.196 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntp.conf.html@1.155 +1 -1
+ NTP_4_2_7P481
+
+ ntpd/ntp.conf.man.in@1.196 +3 -3
+ NTP_4_2_7P481
+
+ ntpd/ntp.conf.mdoc.in@1.196 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntp.keys.5man@1.193 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntp.keys.5mdoc@1.193 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntp.keys.html@1.156 +1 -1
+ NTP_4_2_7P481
+
+ ntpd/ntp.keys.man.in@1.193 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntp.keys.mdoc.in@1.193 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntpd-opts.c@1.496 +7 -7
+ NTP_4_2_7P481
+
+ ntpd/ntpd-opts.h@1.495 +3 -3
+ NTP_4_2_7P481
+
+ ntpd/ntpd.1ntpdman@1.304 +3 -3
+ NTP_4_2_7P481
+
+ ntpd/ntpd.1ntpdmdoc@1.304 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntpd.html@1.150 +2 -2
+ NTP_4_2_7P481
+
+ ntpd/ntpd.man.in@1.304 +3 -3
+ NTP_4_2_7P481
+
+ ntpd/ntpd.mdoc.in@1.304 +2 -2
+ NTP_4_2_7P481
+
+ ntpdc/invoke-ntpdc.texi@1.473 +2 -2
+ NTP_4_2_7P481
+
+ ntpdc/ntpdc-opts.c@1.491 +7 -7
+ NTP_4_2_7P481
+
+ ntpdc/ntpdc-opts.h@1.490 +3 -3
+ NTP_4_2_7P481
+
+ ntpdc/ntpdc.1ntpdcman@1.304 +3 -3
+ NTP_4_2_7P481
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.304 +2 -2
+ NTP_4_2_7P481
+
+ ntpdc/ntpdc.html@1.317 +2 -2
+ NTP_4_2_7P481
+
+ ntpdc/ntpdc.man.in@1.304 +3 -3
+ NTP_4_2_7P481
+
+ ntpdc/ntpdc.mdoc.in@1.304 +2 -2
+ NTP_4_2_7P481
+
+ ntpq/invoke-ntpq.texi@1.479 +2 -2
+ NTP_4_2_7P481
+
+ ntpq/ntpq-opts.c@1.496 +7 -7
+ NTP_4_2_7P481
+
+ ntpq/ntpq-opts.h@1.494 +3 -3
+ NTP_4_2_7P481
+
+ ntpq/ntpq.1ntpqman@1.307 +3 -3
+ NTP_4_2_7P481
+
+ ntpq/ntpq.1ntpqmdoc@1.307 +2 -2
+ NTP_4_2_7P481
+
+ ntpq/ntpq.html@1.147 +2 -2
+ NTP_4_2_7P481
+
+ ntpq/ntpq.man.in@1.307 +3 -3
+ NTP_4_2_7P481
+
+ ntpq/ntpq.mdoc.in@1.307 +2 -2
+ NTP_4_2_7P481
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.475 +2 -2
+ NTP_4_2_7P481
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.493 +7 -7
+ NTP_4_2_7P481
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.492 +3 -3
+ NTP_4_2_7P481
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.304 +3 -3
+ NTP_4_2_7P481
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.304 +2 -2
+ NTP_4_2_7P481
+
+ ntpsnmpd/ntpsnmpd.html@1.145 +1 -1
+ NTP_4_2_7P481
+
+ ntpsnmpd/ntpsnmpd.man.in@1.304 +3 -3
+ NTP_4_2_7P481
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.304 +2 -2
+ NTP_4_2_7P481
+
+ packageinfo.sh@1.485 +1 -1
+ NTP_4_2_7P481
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.66 +3 -3
+ NTP_4_2_7P481
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.66 +2 -2
+ NTP_4_2_7P481
+
+ scripts/calc_tickadj/calc_tickadj.html@1.68 +1 -1
+ NTP_4_2_7P481
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.65 +3 -3
+ NTP_4_2_7P481
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.66 +2 -2
+ NTP_4_2_7P481
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.70 +1 -1
+ NTP_4_2_7P481
+
+ scripts/invoke-plot_summary.texi@1.87 +2 -2
+ NTP_4_2_7P481
+
+ scripts/invoke-summary.texi@1.87 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.296 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntp-wait/ntp-wait-opts@1.32 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.294 +3 -3
+ NTP_4_2_7P481
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.294 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntp-wait/ntp-wait.html@1.313 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntp-wait/ntp-wait.man.in@1.294 +3 -3
+ NTP_4_2_7P481
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.294 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.85 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntpsweep/ntpsweep-opts@1.34 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.73 +3 -3
+ NTP_4_2_7P481
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.73 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntpsweep/ntpsweep.html@1.86 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntpsweep/ntpsweep.man.in@1.73 +3 -3
+ NTP_4_2_7P481
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.85 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntptrace/ntptrace-opts@1.34 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.73 +3 -3
+ NTP_4_2_7P481
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.73 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntptrace/ntptrace.html@1.86 +2 -2
+ NTP_4_2_7P481
+
+ scripts/ntptrace/ntptrace.man.in@1.73 +3 -3
+ NTP_4_2_7P481
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P481
+
+ scripts/plot_summary-opts@1.34 +2 -2
+ NTP_4_2_7P481
+
+ scripts/plot_summary.1plot_summaryman@1.85 +3 -3
+ NTP_4_2_7P481
+
+ scripts/plot_summary.1plot_summarymdoc@1.85 +2 -2
+ NTP_4_2_7P481
+
+ scripts/plot_summary.html@1.88 +2 -2
+ NTP_4_2_7P481
+
+ scripts/plot_summary.man.in@1.85 +3 -3
+ NTP_4_2_7P481
+
+ scripts/plot_summary.mdoc.in@1.85 +2 -2
+ NTP_4_2_7P481
+
+ scripts/summary-opts@1.34 +2 -2
+ NTP_4_2_7P481
+
+ scripts/summary.1summaryman@1.85 +3 -3
+ NTP_4_2_7P481
+
+ scripts/summary.1summarymdoc@1.85 +2 -2
+ NTP_4_2_7P481
+
+ scripts/summary.html@1.88 +2 -2
+ NTP_4_2_7P481
+
+ scripts/summary.man.in@1.85 +3 -3
+ NTP_4_2_7P481
+
+ scripts/summary.mdoc.in@1.85 +2 -2
+ NTP_4_2_7P481
+
+ sntp/invoke-sntp.texi@1.472 +2 -2
+ NTP_4_2_7P481
+
+ sntp/sntp-opts.c@1.490 +7 -7
+ NTP_4_2_7P481
+
+ sntp/sntp-opts.h@1.489 +3 -3
+ NTP_4_2_7P481
+
+ sntp/sntp.1sntpman@1.307 +3 -3
+ NTP_4_2_7P481
+
+ sntp/sntp.1sntpmdoc@1.307 +2 -2
+ NTP_4_2_7P481
+
+ sntp/sntp.html@1.487 +2 -2
+ NTP_4_2_7P481
+
+ sntp/sntp.man.in@1.307 +3 -3
+ NTP_4_2_7P481
+
+ sntp/sntp.mdoc.in@1.307 +2 -2
+ NTP_4_2_7P481
+
+ util/invoke-ntp-keygen.texi@1.476 +2 -2
+ NTP_4_2_7P481
+
+ util/ntp-keygen-opts.c@1.493 +7 -7
+ NTP_4_2_7P481
+
+ util/ntp-keygen-opts.h@1.492 +3 -3
+ NTP_4_2_7P481
+
+ util/ntp-keygen.1ntp-keygenman@1.304 +3 -3
+ NTP_4_2_7P481
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.304 +2 -2
+ NTP_4_2_7P481
+
+ util/ntp-keygen.html@1.151 +2 -2
+ NTP_4_2_7P481
+
+ util/ntp-keygen.man.in@1.304 +3 -3
+ NTP_4_2_7P481
+
+ util/ntp-keygen.mdoc.in@1.304 +2 -2
+ NTP_4_2_7P481
+
+ChangeSet@1.3236, 2014-11-21 21:13:03+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition
+
+ ChangeLog@1.1571 +1 -0
+ [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition
+
+ ntpd/ntp_refclock.c@1.119 +5 -8
+ [Bug 2314] Kernel PPS binding EOPNOTSUPP is a failure condition
+
+ChangeSet@1.3235, 2014-11-21 11:08:32+00:00, stenn@psp-fb1.ntp.org
+ Rename pps_enable to hardpps_enable.
+
+ ChangeLog@1.1570 +1 -0
+ Rename pps_enable to hardpps_enable.
+
+ include/ntpd.h@1.183 +1 -1
+ Rename pps_enable to hardpps_enable.
+
+ ntpd/ntp_loopfilter.c@1.175 +3 -3
+ Rename pps_enable to hardpps_enable.
+
+ ntpd/ntp_proto.c@1.350 +2 -2
+ Rename pps_enable to hardpps_enable.
+
+ ntpd/ntp_refclock.c@1.118 +1 -1
+ Rename pps_enable to hardpps_enable.
+
+ ntpd/ntp_request.c@1.112 +1 -1
+ Rename pps_enable to hardpps_enable.
+
+ ntpd/refclock_jupiter.c@1.28 +1 -1
+ Rename pps_enable to hardpps_enable.
+
+ ntpd/refclock_oncore.c@1.101 +1 -1
+ Rename pps_enable to hardpps_enable.
+
+ ntpd/refclock_parse.c@1.68 +2 -2
+ Rename pps_enable to hardpps_enable.
+
+ChangeSet@1.3234, 2014-11-21 09:44:10+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2314] Only enable PPS if kernel consumer binding succeeds
+
+ ChangeLog@1.1569 +1 -0
+ [Bug 2314] Only enable PPS if kernel consumer binding succeeds
+
+ ntpd/ntp_refclock.c@1.117 +4 -3
+ [Bug 2314] Only enable PPS if kernel consumer binding succeeds
+
+ChangeSet@1.3233, 2014-11-21 09:00:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P480
+ TAG: NTP_4_2_7P480
+
+ ChangeLog@1.1568 +1 -0
+ NTP_4_2_7P480
+
+ ntpd/invoke-ntp.conf.texi@1.161 +1 -1
+ NTP_4_2_7P480
+
+ ntpd/invoke-ntp.keys.texi@1.158 +1 -1
+ NTP_4_2_7P480
+
+ ntpd/invoke-ntpd.texi@1.474 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntp.conf.5man@1.195 +3 -3
+ NTP_4_2_7P480
+
+ ntpd/ntp.conf.5mdoc@1.195 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntp.conf.html@1.154 +1 -1
+ NTP_4_2_7P480
+
+ ntpd/ntp.conf.man.in@1.195 +3 -3
+ NTP_4_2_7P480
+
+ ntpd/ntp.conf.mdoc.in@1.195 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntp.keys.5man@1.192 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntp.keys.5mdoc@1.192 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntp.keys.html@1.155 +1 -1
+ NTP_4_2_7P480
+
+ ntpd/ntp.keys.man.in@1.192 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntp.keys.mdoc.in@1.192 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntpd-opts.c@1.495 +7 -7
+ NTP_4_2_7P480
+
+ ntpd/ntpd-opts.h@1.494 +3 -3
+ NTP_4_2_7P480
+
+ ntpd/ntpd.1ntpdman@1.303 +3 -3
+ NTP_4_2_7P480
+
+ ntpd/ntpd.1ntpdmdoc@1.303 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntpd.html@1.149 +2 -2
+ NTP_4_2_7P480
+
+ ntpd/ntpd.man.in@1.303 +3 -3
+ NTP_4_2_7P480
+
+ ntpd/ntpd.mdoc.in@1.303 +2 -2
+ NTP_4_2_7P480
+
+ ntpdc/invoke-ntpdc.texi@1.472 +2 -2
+ NTP_4_2_7P480
+
+ ntpdc/ntpdc-opts.c@1.490 +7 -7
+ NTP_4_2_7P480
+
+ ntpdc/ntpdc-opts.h@1.489 +3 -3
+ NTP_4_2_7P480
+
+ ntpdc/ntpdc.1ntpdcman@1.303 +3 -3
+ NTP_4_2_7P480
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.303 +2 -2
+ NTP_4_2_7P480
+
+ ntpdc/ntpdc.html@1.316 +2 -2
+ NTP_4_2_7P480
+
+ ntpdc/ntpdc.man.in@1.303 +3 -3
+ NTP_4_2_7P480
+
+ ntpdc/ntpdc.mdoc.in@1.303 +2 -2
+ NTP_4_2_7P480
+
+ ntpq/invoke-ntpq.texi@1.478 +2 -2
+ NTP_4_2_7P480
+
+ ntpq/ntpq-opts.c@1.495 +7 -7
+ NTP_4_2_7P480
+
+ ntpq/ntpq-opts.h@1.493 +3 -3
+ NTP_4_2_7P480
+
+ ntpq/ntpq.1ntpqman@1.306 +3 -3
+ NTP_4_2_7P480
+
+ ntpq/ntpq.1ntpqmdoc@1.306 +2 -2
+ NTP_4_2_7P480
+
+ ntpq/ntpq.html@1.146 +2 -2
+ NTP_4_2_7P480
+
+ ntpq/ntpq.man.in@1.306 +3 -3
+ NTP_4_2_7P480
+
+ ntpq/ntpq.mdoc.in@1.306 +2 -2
+ NTP_4_2_7P480
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.474 +2 -2
+ NTP_4_2_7P480
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.492 +7 -7
+ NTP_4_2_7P480
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.491 +3 -3
+ NTP_4_2_7P480
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.303 +3 -3
+ NTP_4_2_7P480
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.303 +2 -2
+ NTP_4_2_7P480
+
+ ntpsnmpd/ntpsnmpd.html@1.144 +1 -1
+ NTP_4_2_7P480
+
+ ntpsnmpd/ntpsnmpd.man.in@1.303 +3 -3
+ NTP_4_2_7P480
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.303 +2 -2
+ NTP_4_2_7P480
+
+ packageinfo.sh@1.484 +1 -1
+ NTP_4_2_7P480
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.65 +3 -3
+ NTP_4_2_7P480
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.65 +2 -2
+ NTP_4_2_7P480
+
+ scripts/calc_tickadj/calc_tickadj.html@1.67 +1 -1
+ NTP_4_2_7P480
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.64 +3 -3
+ NTP_4_2_7P480
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P480
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.69 +1 -1
+ NTP_4_2_7P480
+
+ scripts/invoke-plot_summary.texi@1.86 +2 -2
+ NTP_4_2_7P480
+
+ scripts/invoke-summary.texi@1.86 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.295 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntp-wait/ntp-wait-opts@1.31 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.293 +3 -3
+ NTP_4_2_7P480
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.293 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntp-wait/ntp-wait.html@1.312 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntp-wait/ntp-wait.man.in@1.293 +3 -3
+ NTP_4_2_7P480
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.293 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.84 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntpsweep/ntpsweep-opts@1.33 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.72 +3 -3
+ NTP_4_2_7P480
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.72 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntpsweep/ntpsweep.html@1.85 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntpsweep/ntpsweep.man.in@1.72 +3 -3
+ NTP_4_2_7P480
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.84 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntptrace/ntptrace-opts@1.33 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.72 +3 -3
+ NTP_4_2_7P480
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.72 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntptrace/ntptrace.html@1.85 +2 -2
+ NTP_4_2_7P480
+
+ scripts/ntptrace/ntptrace.man.in@1.72 +3 -3
+ NTP_4_2_7P480
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P480
+
+ scripts/plot_summary-opts@1.33 +2 -2
+ NTP_4_2_7P480
+
+ scripts/plot_summary.1plot_summaryman@1.84 +3 -3
+ NTP_4_2_7P480
+
+ scripts/plot_summary.1plot_summarymdoc@1.84 +2 -2
+ NTP_4_2_7P480
+
+ scripts/plot_summary.html@1.87 +2 -2
+ NTP_4_2_7P480
+
+ scripts/plot_summary.man.in@1.84 +3 -3
+ NTP_4_2_7P480
+
+ scripts/plot_summary.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P480
+
+ scripts/summary-opts@1.33 +2 -2
+ NTP_4_2_7P480
+
+ scripts/summary.1summaryman@1.84 +3 -3
+ NTP_4_2_7P480
+
+ scripts/summary.1summarymdoc@1.84 +2 -2
+ NTP_4_2_7P480
+
+ scripts/summary.html@1.87 +2 -2
+ NTP_4_2_7P480
+
+ scripts/summary.man.in@1.84 +3 -3
+ NTP_4_2_7P480
+
+ scripts/summary.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P480
+
+ sntp/invoke-sntp.texi@1.471 +2 -2
+ NTP_4_2_7P480
+
+ sntp/sntp-opts.c@1.489 +7 -7
+ NTP_4_2_7P480
+
+ sntp/sntp-opts.h@1.488 +3 -3
+ NTP_4_2_7P480
+
+ sntp/sntp.1sntpman@1.306 +3 -3
+ NTP_4_2_7P480
+
+ sntp/sntp.1sntpmdoc@1.306 +2 -2
+ NTP_4_2_7P480
+
+ sntp/sntp.html@1.486 +2 -2
+ NTP_4_2_7P480
+
+ sntp/sntp.man.in@1.306 +3 -3
+ NTP_4_2_7P480
+
+ sntp/sntp.mdoc.in@1.306 +2 -2
+ NTP_4_2_7P480
+
+ util/invoke-ntp-keygen.texi@1.475 +2 -2
+ NTP_4_2_7P480
+
+ util/ntp-keygen-opts.c@1.492 +7 -7
+ NTP_4_2_7P480
+
+ util/ntp-keygen-opts.h@1.491 +3 -3
+ NTP_4_2_7P480
+
+ util/ntp-keygen.1ntp-keygenman@1.303 +3 -3
+ NTP_4_2_7P480
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.303 +2 -2
+ NTP_4_2_7P480
+
+ util/ntp-keygen.html@1.150 +2 -2
+ NTP_4_2_7P480
+
+ util/ntp-keygen.man.in@1.303 +3 -3
+ NTP_4_2_7P480
+
+ util/ntp-keygen.mdoc.in@1.303 +2 -2
+ NTP_4_2_7P480
+
+ChangeSet@1.3232, 2014-11-20 10:21:46+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2677] PATH_MAX isn't #define'd under Windows
+
+ ChangeLog@1.1567 +2 -0
+ [Bug 2677] PATH_MAX isn't #define'd under Windows
+
+ ntpd/ntp_loopfilter.c@1.174 +3 -0
+ [Bug 2677] PATH_MAX isn't #define'd under Windows
+
+ChangeSet@1.3231, 2014-11-15 08:58:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P479
+ TAG: NTP_4_2_7P479
+
+ ChangeLog@1.1566 +1 -0
+ NTP_4_2_7P479
+
+ ntpd/invoke-ntp.conf.texi@1.160 +1 -1
+ NTP_4_2_7P479
+
+ ntpd/invoke-ntp.keys.texi@1.157 +1 -1
+ NTP_4_2_7P479
+
+ ntpd/invoke-ntpd.texi@1.473 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntp.conf.5man@1.194 +3 -3
+ NTP_4_2_7P479
+
+ ntpd/ntp.conf.5mdoc@1.194 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntp.conf.html@1.153 +1 -1
+ NTP_4_2_7P479
+
+ ntpd/ntp.conf.man.in@1.194 +3 -3
+ NTP_4_2_7P479
+
+ ntpd/ntp.conf.mdoc.in@1.194 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntp.keys.5man@1.191 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntp.keys.5mdoc@1.191 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntp.keys.html@1.154 +1 -1
+ NTP_4_2_7P479
+
+ ntpd/ntp.keys.man.in@1.191 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntp.keys.mdoc.in@1.191 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntpd-opts.c@1.494 +7 -7
+ NTP_4_2_7P479
+
+ ntpd/ntpd-opts.h@1.493 +3 -3
+ NTP_4_2_7P479
+
+ ntpd/ntpd.1ntpdman@1.302 +3 -3
+ NTP_4_2_7P479
+
+ ntpd/ntpd.1ntpdmdoc@1.302 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntpd.html@1.148 +2 -2
+ NTP_4_2_7P479
+
+ ntpd/ntpd.man.in@1.302 +3 -3
+ NTP_4_2_7P479
+
+ ntpd/ntpd.mdoc.in@1.302 +2 -2
+ NTP_4_2_7P479
+
+ ntpdc/invoke-ntpdc.texi@1.471 +2 -2
+ NTP_4_2_7P479
+
+ ntpdc/ntpdc-opts.c@1.489 +7 -7
+ NTP_4_2_7P479
+
+ ntpdc/ntpdc-opts.h@1.488 +3 -3
+ NTP_4_2_7P479
+
+ ntpdc/ntpdc.1ntpdcman@1.302 +3 -3
+ NTP_4_2_7P479
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.302 +2 -2
+ NTP_4_2_7P479
+
+ ntpdc/ntpdc.html@1.315 +2 -2
+ NTP_4_2_7P479
+
+ ntpdc/ntpdc.man.in@1.302 +3 -3
+ NTP_4_2_7P479
+
+ ntpdc/ntpdc.mdoc.in@1.302 +2 -2
+ NTP_4_2_7P479
+
+ ntpq/invoke-ntpq.texi@1.477 +2 -2
+ NTP_4_2_7P479
+
+ ntpq/ntpq-opts.c@1.494 +7 -7
+ NTP_4_2_7P479
+
+ ntpq/ntpq-opts.h@1.492 +3 -3
+ NTP_4_2_7P479
+
+ ntpq/ntpq.1ntpqman@1.305 +3 -3
+ NTP_4_2_7P479
+
+ ntpq/ntpq.1ntpqmdoc@1.305 +2 -2
+ NTP_4_2_7P479
+
+ ntpq/ntpq.html@1.145 +2 -2
+ NTP_4_2_7P479
+
+ ntpq/ntpq.man.in@1.305 +3 -3
+ NTP_4_2_7P479
+
+ ntpq/ntpq.mdoc.in@1.305 +2 -2
+ NTP_4_2_7P479
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.473 +2 -2
+ NTP_4_2_7P479
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.491 +7 -7
+ NTP_4_2_7P479
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.490 +3 -3
+ NTP_4_2_7P479
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.302 +3 -3
+ NTP_4_2_7P479
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.302 +2 -2
+ NTP_4_2_7P479
+
+ ntpsnmpd/ntpsnmpd.html@1.143 +1 -1
+ NTP_4_2_7P479
+
+ ntpsnmpd/ntpsnmpd.man.in@1.302 +3 -3
+ NTP_4_2_7P479
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.302 +2 -2
+ NTP_4_2_7P479
+
+ packageinfo.sh@1.483 +1 -1
+ NTP_4_2_7P479
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.64 +3 -3
+ NTP_4_2_7P479
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.64 +2 -2
+ NTP_4_2_7P479
+
+ scripts/calc_tickadj/calc_tickadj.html@1.66 +1 -1
+ NTP_4_2_7P479
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.63 +3 -3
+ NTP_4_2_7P479
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P479
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.68 +1 -1
+ NTP_4_2_7P479
+
+ scripts/invoke-plot_summary.texi@1.85 +2 -2
+ NTP_4_2_7P479
+
+ scripts/invoke-summary.texi@1.85 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.294 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntp-wait/ntp-wait-opts@1.30 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.292 +3 -3
+ NTP_4_2_7P479
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.292 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntp-wait/ntp-wait.html@1.311 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntp-wait/ntp-wait.man.in@1.292 +3 -3
+ NTP_4_2_7P479
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.292 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.83 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntpsweep/ntpsweep-opts@1.32 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.71 +3 -3
+ NTP_4_2_7P479
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.71 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntpsweep/ntpsweep.html@1.84 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntpsweep/ntpsweep.man.in@1.71 +3 -3
+ NTP_4_2_7P479
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.83 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntptrace/ntptrace-opts@1.32 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.71 +3 -3
+ NTP_4_2_7P479
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.71 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntptrace/ntptrace.html@1.84 +2 -2
+ NTP_4_2_7P479
+
+ scripts/ntptrace/ntptrace.man.in@1.71 +3 -3
+ NTP_4_2_7P479
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P479
+
+ scripts/plot_summary-opts@1.32 +2 -2
+ NTP_4_2_7P479
+
+ scripts/plot_summary.1plot_summaryman@1.83 +3 -3
+ NTP_4_2_7P479
+
+ scripts/plot_summary.1plot_summarymdoc@1.83 +2 -2
+ NTP_4_2_7P479
+
+ scripts/plot_summary.html@1.86 +2 -2
+ NTP_4_2_7P479
+
+ scripts/plot_summary.man.in@1.83 +3 -3
+ NTP_4_2_7P479
+
+ scripts/plot_summary.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P479
+
+ scripts/summary-opts@1.32 +2 -2
+ NTP_4_2_7P479
+
+ scripts/summary.1summaryman@1.83 +3 -3
+ NTP_4_2_7P479
+
+ scripts/summary.1summarymdoc@1.83 +2 -2
+ NTP_4_2_7P479
+
+ scripts/summary.html@1.86 +2 -2
+ NTP_4_2_7P479
+
+ scripts/summary.man.in@1.83 +3 -3
+ NTP_4_2_7P479
+
+ scripts/summary.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P479
+
+ sntp/invoke-sntp.texi@1.470 +2 -2
+ NTP_4_2_7P479
+
+ sntp/sntp-opts.c@1.488 +7 -7
+ NTP_4_2_7P479
+
+ sntp/sntp-opts.h@1.487 +3 -3
+ NTP_4_2_7P479
+
+ sntp/sntp.1sntpman@1.305 +3 -3
+ NTP_4_2_7P479
+
+ sntp/sntp.1sntpmdoc@1.305 +2 -2
+ NTP_4_2_7P479
+
+ sntp/sntp.html@1.485 +2 -2
+ NTP_4_2_7P479
+
+ sntp/sntp.man.in@1.305 +3 -3
+ NTP_4_2_7P479
+
+ sntp/sntp.mdoc.in@1.305 +2 -2
+ NTP_4_2_7P479
+
+ util/invoke-ntp-keygen.texi@1.474 +2 -2
+ NTP_4_2_7P479
+
+ util/ntp-keygen-opts.c@1.491 +7 -7
+ NTP_4_2_7P479
+
+ util/ntp-keygen-opts.h@1.490 +3 -3
+ NTP_4_2_7P479
+
+ util/ntp-keygen.1ntp-keygenman@1.302 +3 -3
+ NTP_4_2_7P479
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.302 +2 -2
+ NTP_4_2_7P479
+
+ util/ntp-keygen.html@1.149 +2 -2
+ NTP_4_2_7P479
+
+ util/ntp-keygen.man.in@1.302 +3 -3
+ NTP_4_2_7P479
+
+ util/ntp-keygen.mdoc.in@1.302 +2 -2
+ NTP_4_2_7P479
+
+ChangeSet@1.3230, 2014-11-15 04:42:01+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed
+
+ ChangeLog@1.1565 +1 -0
+ [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed
+
+ include/ntp_crypto.h@1.51 +4 -2
+ [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed
+
+ ntpd/ntp_control.c@1.190 +4 -1
+ [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed
+
+ ntpd/ntp_crypto.c@1.168 +98 -32
+ [Bug 2651] Certificates with ASN timestamps w/ 4-digit years mis-parsed
+
+ChangeSet@1.3229, 2014-11-14 10:55:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P478
+ TAG: NTP_4_2_7P478
+
+ ChangeLog@1.1564 +1 -0
+ NTP_4_2_7P478
+
+ ntpd/invoke-ntp.conf.texi@1.159 +1 -1
+ NTP_4_2_7P478
+
+ ntpd/invoke-ntp.keys.texi@1.156 +1 -1
+ NTP_4_2_7P478
+
+ ntpd/invoke-ntpd.texi@1.472 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntp.conf.5man@1.193 +3 -3
+ NTP_4_2_7P478
+
+ ntpd/ntp.conf.5mdoc@1.193 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntp.conf.html@1.152 +1 -1
+ NTP_4_2_7P478
+
+ ntpd/ntp.conf.man.in@1.193 +3 -3
+ NTP_4_2_7P478
+
+ ntpd/ntp.conf.mdoc.in@1.193 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntp.keys.5man@1.190 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntp.keys.5mdoc@1.190 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntp.keys.html@1.153 +1 -1
+ NTP_4_2_7P478
+
+ ntpd/ntp.keys.man.in@1.190 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntp.keys.mdoc.in@1.190 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntpd-opts.c@1.493 +7 -7
+ NTP_4_2_7P478
+
+ ntpd/ntpd-opts.h@1.492 +3 -3
+ NTP_4_2_7P478
+
+ ntpd/ntpd.1ntpdman@1.301 +3 -3
+ NTP_4_2_7P478
+
+ ntpd/ntpd.1ntpdmdoc@1.301 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntpd.html@1.147 +2 -2
+ NTP_4_2_7P478
+
+ ntpd/ntpd.man.in@1.301 +3 -3
+ NTP_4_2_7P478
+
+ ntpd/ntpd.mdoc.in@1.301 +2 -2
+ NTP_4_2_7P478
+
+ ntpdc/invoke-ntpdc.texi@1.470 +2 -2
+ NTP_4_2_7P478
+
+ ntpdc/ntpdc-opts.c@1.488 +7 -7
+ NTP_4_2_7P478
+
+ ntpdc/ntpdc-opts.h@1.487 +3 -3
+ NTP_4_2_7P478
+
+ ntpdc/ntpdc.1ntpdcman@1.301 +3 -3
+ NTP_4_2_7P478
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.301 +2 -2
+ NTP_4_2_7P478
+
+ ntpdc/ntpdc.html@1.314 +2 -2
+ NTP_4_2_7P478
+
+ ntpdc/ntpdc.man.in@1.301 +3 -3
+ NTP_4_2_7P478
+
+ ntpdc/ntpdc.mdoc.in@1.301 +2 -2
+ NTP_4_2_7P478
+
+ ntpq/invoke-ntpq.texi@1.476 +2 -2
+ NTP_4_2_7P478
+
+ ntpq/ntpq-opts.c@1.493 +7 -7
+ NTP_4_2_7P478
+
+ ntpq/ntpq-opts.h@1.491 +3 -3
+ NTP_4_2_7P478
+
+ ntpq/ntpq.1ntpqman@1.304 +3 -3
+ NTP_4_2_7P478
+
+ ntpq/ntpq.1ntpqmdoc@1.304 +2 -2
+ NTP_4_2_7P478
+
+ ntpq/ntpq.html@1.144 +2 -2
+ NTP_4_2_7P478
+
+ ntpq/ntpq.man.in@1.304 +3 -3
+ NTP_4_2_7P478
+
+ ntpq/ntpq.mdoc.in@1.304 +2 -2
+ NTP_4_2_7P478
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.472 +2 -2
+ NTP_4_2_7P478
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.490 +7 -7
+ NTP_4_2_7P478
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.489 +3 -3
+ NTP_4_2_7P478
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.301 +3 -3
+ NTP_4_2_7P478
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.301 +2 -2
+ NTP_4_2_7P478
+
+ ntpsnmpd/ntpsnmpd.html@1.142 +1 -1
+ NTP_4_2_7P478
+
+ ntpsnmpd/ntpsnmpd.man.in@1.301 +3 -3
+ NTP_4_2_7P478
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.301 +2 -2
+ NTP_4_2_7P478
+
+ packageinfo.sh@1.482 +1 -1
+ NTP_4_2_7P478
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.63 +3 -3
+ NTP_4_2_7P478
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.63 +2 -2
+ NTP_4_2_7P478
+
+ scripts/calc_tickadj/calc_tickadj.html@1.65 +1 -1
+ NTP_4_2_7P478
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.62 +3 -3
+ NTP_4_2_7P478
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.63 +2 -2
+ NTP_4_2_7P478
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.67 +1 -1
+ NTP_4_2_7P478
+
+ scripts/invoke-plot_summary.texi@1.84 +2 -2
+ NTP_4_2_7P478
+
+ scripts/invoke-summary.texi@1.84 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.293 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntp-wait/ntp-wait-opts@1.29 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.291 +3 -3
+ NTP_4_2_7P478
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.291 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntp-wait/ntp-wait.html@1.310 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntp-wait/ntp-wait.man.in@1.291 +3 -3
+ NTP_4_2_7P478
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.291 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.82 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntpsweep/ntpsweep-opts@1.31 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.70 +3 -3
+ NTP_4_2_7P478
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.70 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntpsweep/ntpsweep.html@1.83 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntpsweep/ntpsweep.man.in@1.70 +3 -3
+ NTP_4_2_7P478
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.71 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.82 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntptrace/ntptrace-opts@1.31 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.70 +3 -3
+ NTP_4_2_7P478
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.70 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntptrace/ntptrace.html@1.83 +2 -2
+ NTP_4_2_7P478
+
+ scripts/ntptrace/ntptrace.man.in@1.70 +3 -3
+ NTP_4_2_7P478
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.71 +2 -2
+ NTP_4_2_7P478
+
+ scripts/plot_summary-opts@1.31 +2 -2
+ NTP_4_2_7P478
+
+ scripts/plot_summary.1plot_summaryman@1.82 +3 -3
+ NTP_4_2_7P478
+
+ scripts/plot_summary.1plot_summarymdoc@1.82 +2 -2
+ NTP_4_2_7P478
+
+ scripts/plot_summary.html@1.85 +2 -2
+ NTP_4_2_7P478
+
+ scripts/plot_summary.man.in@1.82 +3 -3
+ NTP_4_2_7P478
+
+ scripts/plot_summary.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P478
+
+ scripts/summary-opts@1.31 +2 -2
+ NTP_4_2_7P478
+
+ scripts/summary.1summaryman@1.82 +3 -3
+ NTP_4_2_7P478
+
+ scripts/summary.1summarymdoc@1.82 +2 -2
+ NTP_4_2_7P478
+
+ scripts/summary.html@1.85 +2 -2
+ NTP_4_2_7P478
+
+ scripts/summary.man.in@1.82 +3 -3
+ NTP_4_2_7P478
+
+ scripts/summary.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P478
+
+ sntp/invoke-sntp.texi@1.469 +2 -2
+ NTP_4_2_7P478
+
+ sntp/sntp-opts.c@1.487 +7 -7
+ NTP_4_2_7P478
+
+ sntp/sntp-opts.h@1.486 +3 -3
+ NTP_4_2_7P478
+
+ sntp/sntp.1sntpman@1.304 +3 -3
+ NTP_4_2_7P478
+
+ sntp/sntp.1sntpmdoc@1.304 +2 -2
+ NTP_4_2_7P478
+
+ sntp/sntp.html@1.484 +2 -2
+ NTP_4_2_7P478
+
+ sntp/sntp.man.in@1.304 +3 -3
+ NTP_4_2_7P478
+
+ sntp/sntp.mdoc.in@1.304 +2 -2
+ NTP_4_2_7P478
+
+ util/invoke-ntp-keygen.texi@1.473 +2 -2
+ NTP_4_2_7P478
+
+ util/ntp-keygen-opts.c@1.490 +7 -7
+ NTP_4_2_7P478
+
+ util/ntp-keygen-opts.h@1.489 +3 -3
+ NTP_4_2_7P478
+
+ util/ntp-keygen.1ntp-keygenman@1.301 +3 -3
+ NTP_4_2_7P478
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.301 +2 -2
+ NTP_4_2_7P478
+
+ util/ntp-keygen.html@1.148 +2 -2
+ NTP_4_2_7P478
+
+ util/ntp-keygen.man.in@1.301 +3 -3
+ NTP_4_2_7P478
+
+ util/ntp-keygen.mdoc.in@1.301 +2 -2
+ NTP_4_2_7P478
+
+ChangeSet@1.3228, 2014-11-14 09:53:23+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2650] includefile processing broken
+
+ ChangeLog@1.1563 +1 -0
+ [Bug 2650] includefile processing broken
+
+ ntpd/ntp_scanner.c@1.45 +2 -0
+ [Bug 2650] includefile processing broken
+
+ChangeSet@1.3227, 2014-11-14 09:40:06+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2639] Check return value of ntp_adjtime()
+
+ ChangeLog@1.1562 +1 -0
+ [Bug 2639] Check return value of ntp_adjtime()
+
+ ntpd/ntp_loopfilter.c@1.173 +136 -26
+ [Bug 2639] Check return value of ntp_adjtime()
+
+ChangeSet@1.3226, 2014-11-14 09:19:09+00:00, stenn@psp-fb1.ntp.org
+ [Sec 2630] buffer overrun in ntpq tokenize()
+
+ ChangeLog@1.1561 +1 -0
+ [Sec 2630] buffer overrun in ntpq tokenize()
+
+ ntpq/ntpq.c@1.153 +16 -0
+ [Sec 2630] buffer overrun in ntpq tokenize()
+
+ChangeSet@1.3225, 2014-11-14 08:54:11+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2661] ntpq crashes with mreadvar
+
+ ChangeLog@1.1560 +1 -0
+ [Bug 2661] ntpq crashes with mreadvar
+
+ ntpq/ntpq-subs.c@1.101 +1 -1
+ [Bug 2661] ntpq crashes with mreadvar
+
+ChangeSet@1.3224, 2014-11-13 09:01:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P477
+ TAG: NTP_4_2_7P477
+
+ ChangeLog@1.1559 +1 -0
+ NTP_4_2_7P477
+
+ ntpd/invoke-ntp.conf.texi@1.158 +1 -1
+ NTP_4_2_7P477
+
+ ntpd/invoke-ntp.keys.texi@1.155 +1 -1
+ NTP_4_2_7P477
+
+ ntpd/invoke-ntpd.texi@1.471 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntp.conf.5man@1.192 +3 -3
+ NTP_4_2_7P477
+
+ ntpd/ntp.conf.5mdoc@1.192 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntp.conf.html@1.151 +12 -1
+ NTP_4_2_7P477
+
+ ntpd/ntp.conf.man.in@1.192 +3 -3
+ NTP_4_2_7P477
+
+ ntpd/ntp.conf.mdoc.in@1.192 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntp.keys.5man@1.189 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntp.keys.5mdoc@1.189 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntp.keys.html@1.152 +1 -1
+ NTP_4_2_7P477
+
+ ntpd/ntp.keys.man.in@1.189 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntp.keys.mdoc.in@1.189 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntpd-opts.c@1.492 +7 -7
+ NTP_4_2_7P477
+
+ ntpd/ntpd-opts.h@1.491 +3 -3
+ NTP_4_2_7P477
+
+ ntpd/ntpd.1ntpdman@1.300 +3 -3
+ NTP_4_2_7P477
+
+ ntpd/ntpd.1ntpdmdoc@1.300 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntpd.html@1.146 +2 -2
+ NTP_4_2_7P477
+
+ ntpd/ntpd.man.in@1.300 +3 -3
+ NTP_4_2_7P477
+
+ ntpd/ntpd.mdoc.in@1.300 +2 -2
+ NTP_4_2_7P477
+
+ ntpdc/invoke-ntpdc.texi@1.469 +2 -2
+ NTP_4_2_7P477
+
+ ntpdc/ntpdc-opts.c@1.487 +7 -7
+ NTP_4_2_7P477
+
+ ntpdc/ntpdc-opts.h@1.486 +3 -3
+ NTP_4_2_7P477
+
+ ntpdc/ntpdc.1ntpdcman@1.300 +3 -3
+ NTP_4_2_7P477
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.300 +2 -2
+ NTP_4_2_7P477
+
+ ntpdc/ntpdc.html@1.313 +2 -2
+ NTP_4_2_7P477
+
+ ntpdc/ntpdc.man.in@1.300 +3 -3
+ NTP_4_2_7P477
+
+ ntpdc/ntpdc.mdoc.in@1.300 +2 -2
+ NTP_4_2_7P477
+
+ ntpq/invoke-ntpq.texi@1.475 +2 -2
+ NTP_4_2_7P477
+
+ ntpq/ntpq-opts.c@1.492 +7 -7
+ NTP_4_2_7P477
+
+ ntpq/ntpq-opts.h@1.490 +3 -3
+ NTP_4_2_7P477
+
+ ntpq/ntpq.1ntpqman@1.303 +3 -3
+ NTP_4_2_7P477
+
+ ntpq/ntpq.1ntpqmdoc@1.303 +2 -2
+ NTP_4_2_7P477
+
+ ntpq/ntpq.html@1.143 +2 -2
+ NTP_4_2_7P477
+
+ ntpq/ntpq.man.in@1.303 +3 -3
+ NTP_4_2_7P477
+
+ ntpq/ntpq.mdoc.in@1.303 +2 -2
+ NTP_4_2_7P477
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.471 +2 -2
+ NTP_4_2_7P477
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.489 +7 -7
+ NTP_4_2_7P477
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.488 +3 -3
+ NTP_4_2_7P477
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.300 +3 -3
+ NTP_4_2_7P477
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.300 +2 -2
+ NTP_4_2_7P477
+
+ ntpsnmpd/ntpsnmpd.html@1.141 +1 -1
+ NTP_4_2_7P477
+
+ ntpsnmpd/ntpsnmpd.man.in@1.300 +3 -3
+ NTP_4_2_7P477
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.300 +2 -2
+ NTP_4_2_7P477
+
+ packageinfo.sh@1.481 +1 -1
+ NTP_4_2_7P477
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.62 +3 -3
+ NTP_4_2_7P477
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.62 +2 -2
+ NTP_4_2_7P477
+
+ scripts/calc_tickadj/calc_tickadj.html@1.64 +1 -1
+ NTP_4_2_7P477
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.61 +3 -3
+ NTP_4_2_7P477
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P477
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.66 +1 -1
+ NTP_4_2_7P477
+
+ scripts/invoke-plot_summary.texi@1.83 +2 -2
+ NTP_4_2_7P477
+
+ scripts/invoke-summary.texi@1.83 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.292 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntp-wait/ntp-wait-opts@1.28 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.290 +3 -3
+ NTP_4_2_7P477
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.290 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntp-wait/ntp-wait.html@1.309 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntp-wait/ntp-wait.man.in@1.290 +3 -3
+ NTP_4_2_7P477
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.290 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.81 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntpsweep/ntpsweep-opts@1.30 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.69 +3 -3
+ NTP_4_2_7P477
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.69 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntpsweep/ntpsweep.html@1.82 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntpsweep/ntpsweep.man.in@1.69 +3 -3
+ NTP_4_2_7P477
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.81 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntptrace/ntptrace-opts@1.30 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.69 +3 -3
+ NTP_4_2_7P477
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.69 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntptrace/ntptrace.html@1.82 +2 -2
+ NTP_4_2_7P477
+
+ scripts/ntptrace/ntptrace.man.in@1.69 +3 -3
+ NTP_4_2_7P477
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P477
+
+ scripts/plot_summary-opts@1.30 +2 -2
+ NTP_4_2_7P477
+
+ scripts/plot_summary.1plot_summaryman@1.81 +3 -3
+ NTP_4_2_7P477
+
+ scripts/plot_summary.1plot_summarymdoc@1.81 +2 -2
+ NTP_4_2_7P477
+
+ scripts/plot_summary.html@1.84 +2 -2
+ NTP_4_2_7P477
+
+ scripts/plot_summary.man.in@1.81 +3 -3
+ NTP_4_2_7P477
+
+ scripts/plot_summary.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P477
+
+ scripts/summary-opts@1.30 +2 -2
+ NTP_4_2_7P477
+
+ scripts/summary.1summaryman@1.81 +3 -3
+ NTP_4_2_7P477
+
+ scripts/summary.1summarymdoc@1.81 +2 -2
+ NTP_4_2_7P477
+
+ scripts/summary.html@1.84 +2 -2
+ NTP_4_2_7P477
+
+ scripts/summary.man.in@1.81 +3 -3
+ NTP_4_2_7P477
+
+ scripts/summary.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P477
+
+ sntp/invoke-sntp.texi@1.468 +2 -2
+ NTP_4_2_7P477
+
+ sntp/sntp-opts.c@1.486 +7 -7
+ NTP_4_2_7P477
+
+ sntp/sntp-opts.h@1.485 +3 -3
+ NTP_4_2_7P477
+
+ sntp/sntp.1sntpman@1.303 +3 -3
+ NTP_4_2_7P477
+
+ sntp/sntp.1sntpmdoc@1.303 +2 -2
+ NTP_4_2_7P477
+
+ sntp/sntp.html@1.483 +2 -2
+ NTP_4_2_7P477
+
+ sntp/sntp.man.in@1.303 +3 -3
+ NTP_4_2_7P477
+
+ sntp/sntp.mdoc.in@1.303 +2 -2
+ NTP_4_2_7P477
+
+ util/invoke-ntp-keygen.texi@1.472 +2 -2
+ NTP_4_2_7P477
+
+ util/ntp-keygen-opts.c@1.489 +7 -7
+ NTP_4_2_7P477
+
+ util/ntp-keygen-opts.h@1.488 +3 -3
+ NTP_4_2_7P477
+
+ util/ntp-keygen.1ntp-keygenman@1.300 +3 -3
+ NTP_4_2_7P477
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.300 +2 -2
+ NTP_4_2_7P477
+
+ util/ntp-keygen.html@1.147 +2 -2
+ NTP_4_2_7P477
+
+ util/ntp-keygen.man.in@1.300 +3 -3
+ NTP_4_2_7P477
+
+ util/ntp-keygen.mdoc.in@1.300 +2 -2
+ NTP_4_2_7P477
+
+ChangeSet@1.3223, 2014-11-13 03:05:35+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2657] Document that "restrict nopeer" interferes with "pool"
+
+ ChangeLog@1.1558 +1 -0
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ html/accopt.html@1.43 +4 -3
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ ntpd/invoke-ntp.conf.texi@1.157 +13 -1
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ ntpd/ntp.conf.5man@1.191 +16 -3
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ ntpd/ntp.conf.5mdoc@1.191 +14 -2
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ ntpd/ntp.conf.def@1.13 +12 -0
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ ntpd/ntp.conf.man.in@1.191 +16 -3
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ ntpd/ntp.conf.mdoc.in@1.191 +14 -2
+ [Bug 2657] Document that "restrict nopeer" intereferes with "pool"
+
+ChangeSet@1.3222, 2014-10-08 09:36:42+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P476
+ TAG: NTP_4_2_7P476
+
+ ChangeLog@1.1557 +1 -0
+ NTP_4_2_7P476
+
+ ntpd/invoke-ntp.conf.texi@1.156 +1 -1
+ NTP_4_2_7P476
+
+ ntpd/invoke-ntp.keys.texi@1.154 +1 -1
+ NTP_4_2_7P476
+
+ ntpd/invoke-ntpd.texi@1.470 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntp.conf.5man@1.190 +3 -3
+ NTP_4_2_7P476
+
+ ntpd/ntp.conf.5mdoc@1.190 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntp.conf.html@1.150 +1 -1
+ NTP_4_2_7P476
+
+ ntpd/ntp.conf.man.in@1.190 +3 -3
+ NTP_4_2_7P476
+
+ ntpd/ntp.conf.mdoc.in@1.190 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntp.keys.5man@1.188 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntp.keys.5mdoc@1.188 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntp.keys.html@1.151 +1 -1
+ NTP_4_2_7P476
+
+ ntpd/ntp.keys.man.in@1.188 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntp.keys.mdoc.in@1.188 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntpd-opts.c@1.491 +10 -10
+ NTP_4_2_7P476
+
+ ntpd/ntpd-opts.h@1.490 +3 -3
+ NTP_4_2_7P476
+
+ ntpd/ntpd.1ntpdman@1.299 +3 -3
+ NTP_4_2_7P476
+
+ ntpd/ntpd.1ntpdmdoc@1.299 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntpd.html@1.145 +2 -2
+ NTP_4_2_7P476
+
+ ntpd/ntpd.man.in@1.299 +3 -3
+ NTP_4_2_7P476
+
+ ntpd/ntpd.mdoc.in@1.299 +2 -2
+ NTP_4_2_7P476
+
+ ntpdc/invoke-ntpdc.texi@1.468 +2 -2
+ NTP_4_2_7P476
+
+ ntpdc/ntpdc-opts.c@1.486 +10 -10
+ NTP_4_2_7P476
+
+ ntpdc/ntpdc-opts.h@1.485 +3 -3
+ NTP_4_2_7P476
+
+ ntpdc/ntpdc.1ntpdcman@1.299 +3 -3
+ NTP_4_2_7P476
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.299 +2 -2
+ NTP_4_2_7P476
+
+ ntpdc/ntpdc.html@1.312 +2 -2
+ NTP_4_2_7P476
+
+ ntpdc/ntpdc.man.in@1.299 +3 -3
+ NTP_4_2_7P476
+
+ ntpdc/ntpdc.mdoc.in@1.299 +2 -2
+ NTP_4_2_7P476
+
+ ntpq/invoke-ntpq.texi@1.474 +2 -2
+ NTP_4_2_7P476
+
+ ntpq/ntpq-opts.c@1.491 +10 -10
+ NTP_4_2_7P476
+
+ ntpq/ntpq-opts.h@1.489 +3 -3
+ NTP_4_2_7P476
+
+ ntpq/ntpq.1ntpqman@1.302 +3 -3
+ NTP_4_2_7P476
+
+ ntpq/ntpq.1ntpqmdoc@1.302 +2 -2
+ NTP_4_2_7P476
+
+ ntpq/ntpq.html@1.142 +2 -2
+ NTP_4_2_7P476
+
+ ntpq/ntpq.man.in@1.302 +3 -3
+ NTP_4_2_7P476
+
+ ntpq/ntpq.mdoc.in@1.302 +2 -2
+ NTP_4_2_7P476
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.470 +2 -2
+ NTP_4_2_7P476
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.488 +10 -10
+ NTP_4_2_7P476
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.487 +3 -3
+ NTP_4_2_7P476
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.299 +3 -3
+ NTP_4_2_7P476
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.299 +2 -2
+ NTP_4_2_7P476
+
+ ntpsnmpd/ntpsnmpd.html@1.140 +1 -1
+ NTP_4_2_7P476
+
+ ntpsnmpd/ntpsnmpd.man.in@1.299 +3 -3
+ NTP_4_2_7P476
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.299 +2 -2
+ NTP_4_2_7P476
+
+ packageinfo.sh@1.480 +1 -1
+ NTP_4_2_7P476
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.61 +3 -3
+ NTP_4_2_7P476
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.61 +2 -2
+ NTP_4_2_7P476
+
+ scripts/calc_tickadj/calc_tickadj.html@1.63 +1 -1
+ NTP_4_2_7P476
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.60 +3 -3
+ NTP_4_2_7P476
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P476
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.65 +1 -1
+ NTP_4_2_7P476
+
+ scripts/invoke-plot_summary.texi@1.82 +2 -2
+ NTP_4_2_7P476
+
+ scripts/invoke-summary.texi@1.82 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.291 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntp-wait/ntp-wait-opts@1.27 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.289 +3 -3
+ NTP_4_2_7P476
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.289 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntp-wait/ntp-wait.html@1.308 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntp-wait/ntp-wait.man.in@1.289 +3 -3
+ NTP_4_2_7P476
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.289 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.80 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntpsweep/ntpsweep-opts@1.29 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.68 +3 -3
+ NTP_4_2_7P476
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.68 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntpsweep/ntpsweep.html@1.81 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntpsweep/ntpsweep.man.in@1.68 +3 -3
+ NTP_4_2_7P476
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.69 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.80 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntptrace/ntptrace-opts@1.29 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.68 +3 -3
+ NTP_4_2_7P476
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.68 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntptrace/ntptrace.html@1.81 +2 -2
+ NTP_4_2_7P476
+
+ scripts/ntptrace/ntptrace.man.in@1.68 +3 -3
+ NTP_4_2_7P476
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.69 +2 -2
+ NTP_4_2_7P476
+
+ scripts/plot_summary-opts@1.29 +2 -2
+ NTP_4_2_7P476
+
+ scripts/plot_summary.1plot_summaryman@1.80 +3 -3
+ NTP_4_2_7P476
+
+ scripts/plot_summary.1plot_summarymdoc@1.80 +2 -2
+ NTP_4_2_7P476
+
+ scripts/plot_summary.html@1.83 +2 -2
+ NTP_4_2_7P476
+
+ scripts/plot_summary.man.in@1.80 +3 -3
+ NTP_4_2_7P476
+
+ scripts/plot_summary.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P476
+
+ scripts/summary-opts@1.29 +2 -2
+ NTP_4_2_7P476
+
+ scripts/summary.1summaryman@1.80 +3 -3
+ NTP_4_2_7P476
+
+ scripts/summary.1summarymdoc@1.80 +2 -2
+ NTP_4_2_7P476
+
+ scripts/summary.html@1.83 +2 -2
+ NTP_4_2_7P476
+
+ scripts/summary.man.in@1.80 +3 -3
+ NTP_4_2_7P476
+
+ scripts/summary.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P476
+
+ sntp/invoke-sntp.texi@1.467 +2 -2
+ NTP_4_2_7P476
+
+ sntp/sntp-opts.c@1.485 +10 -10
+ NTP_4_2_7P476
+
+ sntp/sntp-opts.h@1.484 +3 -3
+ NTP_4_2_7P476
+
+ sntp/sntp.1sntpman@1.302 +3 -3
+ NTP_4_2_7P476
+
+ sntp/sntp.1sntpmdoc@1.302 +2 -2
+ NTP_4_2_7P476
+
+ sntp/sntp.html@1.482 +2 -2
+ NTP_4_2_7P476
+
+ sntp/sntp.man.in@1.302 +3 -3
+ NTP_4_2_7P476
+
+ sntp/sntp.mdoc.in@1.302 +2 -2
+ NTP_4_2_7P476
+
+ util/invoke-ntp-keygen.texi@1.471 +2 -2
+ NTP_4_2_7P476
+
+ util/ntp-keygen-opts.c@1.488 +10 -10
+ NTP_4_2_7P476
+
+ util/ntp-keygen-opts.h@1.487 +3 -3
+ NTP_4_2_7P476
+
+ util/ntp-keygen.1ntp-keygenman@1.299 +3 -3
+ NTP_4_2_7P476
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.299 +2 -2
+ NTP_4_2_7P476
+
+ util/ntp-keygen.html@1.146 +2 -2
+ NTP_4_2_7P476
+
+ util/ntp-keygen.man.in@1.299 +3 -3
+ NTP_4_2_7P476
+
+ util/ntp-keygen.mdoc.in@1.299 +2 -2
+ NTP_4_2_7P476
+
+ChangeSet@1.3221, 2014-10-04 11:53:31+02:00, jnperlin@hydra.(none)
+ [Bug 2503] sht utility outdated
+
+ ChangeLog@1.1556 +1 -0
+ [Bug 2503] sht utility outdated
+
+ util/sht.c@1.5 +147 -72
+ [Bug 2503] sht utility outdated
+
+ChangeSet@1.3220, 2014-09-11 08:58:05+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P475
+ TAG: NTP_4_2_7P475
+
+ ChangeLog@1.1555 +1 -0
+ NTP_4_2_7P475
+
+ ntpd/invoke-ntp.conf.texi@1.155 +1 -1
+ NTP_4_2_7P475
+
+ ntpd/invoke-ntp.keys.texi@1.153 +1 -1
+ NTP_4_2_7P475
+
+ ntpd/invoke-ntpd.texi@1.469 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntp.conf.5man@1.189 +3 -3
+ NTP_4_2_7P475
+
+ ntpd/ntp.conf.5mdoc@1.189 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntp.conf.html@1.149 +1 -1
+ NTP_4_2_7P475
+
+ ntpd/ntp.conf.man.in@1.189 +3 -3
+ NTP_4_2_7P475
+
+ ntpd/ntp.conf.mdoc.in@1.189 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntp.keys.5man@1.187 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntp.keys.5mdoc@1.187 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntp.keys.html@1.150 +1 -1
+ NTP_4_2_7P475
+
+ ntpd/ntp.keys.man.in@1.187 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntp.keys.mdoc.in@1.187 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntpd-opts.c@1.490 +7 -7
+ NTP_4_2_7P475
+
+ ntpd/ntpd-opts.h@1.489 +3 -3
+ NTP_4_2_7P475
+
+ ntpd/ntpd.1ntpdman@1.298 +3 -3
+ NTP_4_2_7P475
+
+ ntpd/ntpd.1ntpdmdoc@1.298 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntpd.html@1.144 +2 -2
+ NTP_4_2_7P475
+
+ ntpd/ntpd.man.in@1.298 +3 -3
+ NTP_4_2_7P475
+
+ ntpd/ntpd.mdoc.in@1.298 +2 -2
+ NTP_4_2_7P475
+
+ ntpdc/invoke-ntpdc.texi@1.467 +2 -2
+ NTP_4_2_7P475
+
+ ntpdc/ntpdc-opts.c@1.485 +7 -7
+ NTP_4_2_7P475
+
+ ntpdc/ntpdc-opts.h@1.484 +3 -3
+ NTP_4_2_7P475
+
+ ntpdc/ntpdc.1ntpdcman@1.298 +3 -3
+ NTP_4_2_7P475
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.298 +2 -2
+ NTP_4_2_7P475
+
+ ntpdc/ntpdc.html@1.311 +2 -2
+ NTP_4_2_7P475
+
+ ntpdc/ntpdc.man.in@1.298 +3 -3
+ NTP_4_2_7P475
+
+ ntpdc/ntpdc.mdoc.in@1.298 +2 -2
+ NTP_4_2_7P475
+
+ ntpq/invoke-ntpq.texi@1.473 +2 -2
+ NTP_4_2_7P475
+
+ ntpq/ntpq-opts.c@1.490 +7 -7
+ NTP_4_2_7P475
+
+ ntpq/ntpq-opts.h@1.488 +3 -3
+ NTP_4_2_7P475
+
+ ntpq/ntpq.1ntpqman@1.301 +3 -3
+ NTP_4_2_7P475
+
+ ntpq/ntpq.1ntpqmdoc@1.301 +2 -2
+ NTP_4_2_7P475
+
+ ntpq/ntpq.html@1.141 +2 -2
+ NTP_4_2_7P475
+
+ ntpq/ntpq.man.in@1.301 +3 -3
+ NTP_4_2_7P475
+
+ ntpq/ntpq.mdoc.in@1.301 +2 -2
+ NTP_4_2_7P475
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.469 +2 -2
+ NTP_4_2_7P475
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.487 +7 -7
+ NTP_4_2_7P475
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.486 +3 -3
+ NTP_4_2_7P475
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.298 +3 -3
+ NTP_4_2_7P475
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.298 +2 -2
+ NTP_4_2_7P475
+
+ ntpsnmpd/ntpsnmpd.html@1.139 +1 -1
+ NTP_4_2_7P475
+
+ ntpsnmpd/ntpsnmpd.man.in@1.298 +3 -3
+ NTP_4_2_7P475
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.298 +2 -2
+ NTP_4_2_7P475
+
+ packageinfo.sh@1.479 +1 -1
+ NTP_4_2_7P475
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.60 +3 -3
+ NTP_4_2_7P475
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.60 +2 -2
+ NTP_4_2_7P475
+
+ scripts/calc_tickadj/calc_tickadj.html@1.62 +1 -1
+ NTP_4_2_7P475
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.59 +3 -3
+ NTP_4_2_7P475
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P475
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.64 +1 -1
+ NTP_4_2_7P475
+
+ scripts/invoke-plot_summary.texi@1.81 +2 -2
+ NTP_4_2_7P475
+
+ scripts/invoke-summary.texi@1.81 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.290 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntp-wait/ntp-wait-opts@1.26 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.288 +3 -3
+ NTP_4_2_7P475
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.288 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntp-wait/ntp-wait.html@1.307 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntp-wait/ntp-wait.man.in@1.288 +3 -3
+ NTP_4_2_7P475
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.288 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.79 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntpsweep/ntpsweep-opts@1.28 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.67 +3 -3
+ NTP_4_2_7P475
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.67 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntpsweep/ntpsweep.html@1.80 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntpsweep/ntpsweep.man.in@1.67 +3 -3
+ NTP_4_2_7P475
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.79 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntptrace/ntptrace-opts@1.28 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.67 +3 -3
+ NTP_4_2_7P475
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.67 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntptrace/ntptrace.html@1.80 +2 -2
+ NTP_4_2_7P475
+
+ scripts/ntptrace/ntptrace.man.in@1.67 +3 -3
+ NTP_4_2_7P475
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P475
+
+ scripts/plot_summary-opts@1.28 +2 -2
+ NTP_4_2_7P475
+
+ scripts/plot_summary.1plot_summaryman@1.79 +3 -3
+ NTP_4_2_7P475
+
+ scripts/plot_summary.1plot_summarymdoc@1.79 +2 -2
+ NTP_4_2_7P475
+
+ scripts/plot_summary.html@1.82 +2 -2
+ NTP_4_2_7P475
+
+ scripts/plot_summary.man.in@1.79 +3 -3
+ NTP_4_2_7P475
+
+ scripts/plot_summary.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P475
+
+ scripts/summary-opts@1.28 +2 -2
+ NTP_4_2_7P475
+
+ scripts/summary.1summaryman@1.79 +3 -3
+ NTP_4_2_7P475
+
+ scripts/summary.1summarymdoc@1.79 +2 -2
+ NTP_4_2_7P475
+
+ scripts/summary.html@1.82 +2 -2
+ NTP_4_2_7P475
+
+ scripts/summary.man.in@1.79 +3 -3
+ NTP_4_2_7P475
+
+ scripts/summary.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P475
+
+ sntp/invoke-sntp.texi@1.466 +2 -2
+ NTP_4_2_7P475
+
+ sntp/sntp-opts.c@1.484 +7 -7
+ NTP_4_2_7P475
+
+ sntp/sntp-opts.h@1.483 +3 -3
+ NTP_4_2_7P475
+
+ sntp/sntp.1sntpman@1.301 +3 -3
+ NTP_4_2_7P475
+
+ sntp/sntp.1sntpmdoc@1.301 +2 -2
+ NTP_4_2_7P475
+
+ sntp/sntp.html@1.481 +2 -2
+ NTP_4_2_7P475
+
+ sntp/sntp.man.in@1.301 +3 -3
+ NTP_4_2_7P475
+
+ sntp/sntp.mdoc.in@1.301 +2 -2
+ NTP_4_2_7P475
+
+ util/invoke-ntp-keygen.texi@1.470 +2 -2
+ NTP_4_2_7P475
+
+ util/ntp-keygen-opts.c@1.487 +7 -7
+ NTP_4_2_7P475
+
+ util/ntp-keygen-opts.h@1.486 +3 -3
+ NTP_4_2_7P475
+
+ util/ntp-keygen.1ntp-keygenman@1.298 +3 -3
+ NTP_4_2_7P475
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.298 +2 -2
+ NTP_4_2_7P475
+
+ util/ntp-keygen.html@1.145 +2 -2
+ NTP_4_2_7P475
+
+ util/ntp-keygen.man.in@1.298 +3 -3
+ NTP_4_2_7P475
+
+ util/ntp-keygen.mdoc.in@1.298 +2 -2
+ NTP_4_2_7P475
+
+ChangeSet@1.3219, 2014-09-10 09:48:50+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2654] refclock_true.c doesn't identify the Mk III
+
+ ChangeLog@1.1554 +1 -0
+ [Bug 2654] refclock_true.c doesn't identify the Mk III
+
+ ntpd/refclock_true.c@1.22 +1 -1
+ [Bug 2654] refclock_true.c doesn't identify the Mk III
+
+ChangeSet@1.3218, 2014-09-10 09:21:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P474
+ TAG: NTP_4_2_7P474
+
+ ChangeLog@1.1553 +1 -0
+ NTP_4_2_7P474
+
+ ntpd/invoke-ntp.conf.texi@1.154 +1 -1
+ NTP_4_2_7P474
+
+ ntpd/invoke-ntp.keys.texi@1.152 +1 -1
+ NTP_4_2_7P474
+
+ ntpd/invoke-ntpd.texi@1.468 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntp.conf.5man@1.188 +2990 -0
+ NTP_4_2_7P474
+
+ ntpd/ntp.conf.5mdoc@1.188 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntp.conf.html@1.148 +1 -1
+ NTP_4_2_7P474
+
+ ntpd/ntp.conf.man.in@1.188 +2990 -0
+ NTP_4_2_7P474
+
+ ntpd/ntp.conf.mdoc.in@1.188 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntp.keys.5man@1.186 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntp.keys.5mdoc@1.186 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntp.keys.html@1.149 +1 -1
+ NTP_4_2_7P474
+
+ ntpd/ntp.keys.man.in@1.186 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntp.keys.mdoc.in@1.186 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntpd-opts.c@1.489 +7 -7
+ NTP_4_2_7P474
+
+ ntpd/ntpd-opts.h@1.488 +3 -3
+ NTP_4_2_7P474
+
+ ntpd/ntpd.1ntpdman@1.297 +3 -3
+ NTP_4_2_7P474
+
+ ntpd/ntpd.1ntpdmdoc@1.297 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntpd.html@1.143 +2 -2
+ NTP_4_2_7P474
+
+ ntpd/ntpd.man.in@1.297 +3 -3
+ NTP_4_2_7P474
+
+ ntpd/ntpd.mdoc.in@1.297 +2 -2
+ NTP_4_2_7P474
+
+ ntpdc/invoke-ntpdc.texi@1.466 +2 -2
+ NTP_4_2_7P474
+
+ ntpdc/ntpdc-opts.c@1.484 +7 -7
+ NTP_4_2_7P474
+
+ ntpdc/ntpdc-opts.h@1.483 +3 -3
+ NTP_4_2_7P474
+
+ ntpdc/ntpdc.1ntpdcman@1.297 +3 -3
+ NTP_4_2_7P474
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.297 +2 -2
+ NTP_4_2_7P474
+
+ ntpdc/ntpdc.html@1.310 +2 -2
+ NTP_4_2_7P474
+
+ ntpdc/ntpdc.man.in@1.297 +3 -3
+ NTP_4_2_7P474
+
+ ntpdc/ntpdc.mdoc.in@1.297 +2 -2
+ NTP_4_2_7P474
+
+ ntpq/invoke-ntpq.texi@1.472 +2 -2
+ NTP_4_2_7P474
+
+ ntpq/ntpq-opts.c@1.489 +7 -7
+ NTP_4_2_7P474
+
+ ntpq/ntpq-opts.h@1.487 +3 -3
+ NTP_4_2_7P474
+
+ ntpq/ntpq.1ntpqman@1.300 +3 -3
+ NTP_4_2_7P474
+
+ ntpq/ntpq.1ntpqmdoc@1.300 +2 -2
+ NTP_4_2_7P474
+
+ ntpq/ntpq.html@1.140 +2 -2
+ NTP_4_2_7P474
+
+ ntpq/ntpq.man.in@1.300 +3 -3
+ NTP_4_2_7P474
+
+ ntpq/ntpq.mdoc.in@1.300 +2 -2
+ NTP_4_2_7P474
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.468 +2 -2
+ NTP_4_2_7P474
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.486 +7 -7
+ NTP_4_2_7P474
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.485 +3 -3
+ NTP_4_2_7P474
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.297 +3 -3
+ NTP_4_2_7P474
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.297 +2 -2
+ NTP_4_2_7P474
+
+ ntpsnmpd/ntpsnmpd.html@1.138 +1 -1
+ NTP_4_2_7P474
+
+ ntpsnmpd/ntpsnmpd.man.in@1.297 +3 -3
+ NTP_4_2_7P474
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.297 +2 -2
+ NTP_4_2_7P474
+
+ packageinfo.sh@1.478 +1 -1
+ NTP_4_2_7P474
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.59 +3 -3
+ NTP_4_2_7P474
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.59 +2 -2
+ NTP_4_2_7P474
+
+ scripts/calc_tickadj/calc_tickadj.html@1.61 +1 -1
+ NTP_4_2_7P474
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.58 +3 -3
+ NTP_4_2_7P474
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P474
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.63 +1 -1
+ NTP_4_2_7P474
+
+ scripts/invoke-plot_summary.texi@1.80 +2 -2
+ NTP_4_2_7P474
+
+ scripts/invoke-summary.texi@1.80 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.289 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntp-wait/ntp-wait-opts@1.25 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.287 +3 -3
+ NTP_4_2_7P474
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.287 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntp-wait/ntp-wait.html@1.306 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntp-wait/ntp-wait.man.in@1.287 +3 -3
+ NTP_4_2_7P474
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.287 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.78 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntpsweep/ntpsweep-opts@1.27 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.66 +3 -3
+ NTP_4_2_7P474
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.66 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntpsweep/ntpsweep.html@1.79 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntpsweep/ntpsweep.man.in@1.66 +3 -3
+ NTP_4_2_7P474
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.78 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntptrace/ntptrace-opts@1.27 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.66 +3 -3
+ NTP_4_2_7P474
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.66 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntptrace/ntptrace.html@1.79 +2 -2
+ NTP_4_2_7P474
+
+ scripts/ntptrace/ntptrace.man.in@1.66 +3 -3
+ NTP_4_2_7P474
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P474
+
+ scripts/plot_summary-opts@1.27 +2 -2
+ NTP_4_2_7P474
+
+ scripts/plot_summary.1plot_summaryman@1.78 +3 -3
+ NTP_4_2_7P474
+
+ scripts/plot_summary.1plot_summarymdoc@1.78 +2 -2
+ NTP_4_2_7P474
+
+ scripts/plot_summary.html@1.81 +2 -2
+ NTP_4_2_7P474
+
+ scripts/plot_summary.man.in@1.78 +3 -3
+ NTP_4_2_7P474
+
+ scripts/plot_summary.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P474
+
+ scripts/summary-opts@1.27 +2 -2
+ NTP_4_2_7P474
+
+ scripts/summary.1summaryman@1.78 +3 -3
+ NTP_4_2_7P474
+
+ scripts/summary.1summarymdoc@1.78 +2 -2
+ NTP_4_2_7P474
+
+ scripts/summary.html@1.81 +2 -2
+ NTP_4_2_7P474
+
+ scripts/summary.man.in@1.78 +3 -3
+ NTP_4_2_7P474
+
+ scripts/summary.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P474
+
+ sntp/invoke-sntp.texi@1.465 +2 -2
+ NTP_4_2_7P474
+
+ sntp/sntp-opts.c@1.483 +7 -7
+ NTP_4_2_7P474
+
+ sntp/sntp-opts.h@1.482 +3 -3
+ NTP_4_2_7P474
+
+ sntp/sntp.1sntpman@1.300 +3 -3
+ NTP_4_2_7P474
+
+ sntp/sntp.1sntpmdoc@1.300 +2 -2
+ NTP_4_2_7P474
+
+ sntp/sntp.html@1.480 +2 -2
+ NTP_4_2_7P474
+
+ sntp/sntp.man.in@1.300 +3 -3
+ NTP_4_2_7P474
+
+ sntp/sntp.mdoc.in@1.300 +2 -2
+ NTP_4_2_7P474
+
+ util/invoke-ntp-keygen.texi@1.469 +2 -2
+ NTP_4_2_7P474
+
+ util/ntp-keygen-opts.c@1.486 +7 -7
+ NTP_4_2_7P474
+
+ util/ntp-keygen-opts.h@1.485 +3 -3
+ NTP_4_2_7P474
+
+ util/ntp-keygen.1ntp-keygenman@1.297 +3 -3
+ NTP_4_2_7P474
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.297 +2 -2
+ NTP_4_2_7P474
+
+ util/ntp-keygen.html@1.144 +2 -2
+ NTP_4_2_7P474
+
+ util/ntp-keygen.man.in@1.297 +3 -3
+ NTP_4_2_7P474
+
+ util/ntp-keygen.mdoc.in@1.297 +2 -2
+ NTP_4_2_7P474
+
+ChangeSet@1.3217, 2014-09-10 08:56:05+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ ChangeLog@1.1552 +1 -0
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ configure.ac@1.576 +40 -0
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ ntpd/ntpd.c@1.157 +4 -4
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ChangeSet@1.3216, 2014-09-10 08:25:33+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2649] Clean up html/ page installation
+
+ ChangeLog@1.1551 +1 -0
+ [Bug 2649] Clean up html/ page installation
+
+ Makefile.am@1.123 +1 -1
+ [Bug 2649] Clean up html/ page installation
+
+ChangeSet@1.3215, 2014-09-07 02:04:00+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P473
+ TAG: NTP_4_2_7P473
+
+ ChangeLog@1.1550 +1 -0
+ NTP_4_2_7P473
+
+ ntpd/invoke-ntp.conf.texi@1.153 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/invoke-ntp.keys.texi@1.151 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/invoke-ntpd.texi@1.467 +2 -2
+ NTP_4_2_7P473
+
+ ntpd/ntp.conf.5man@1.187 +0 -2990
+ NTP_4_2_7P473
+
+ ntpd/ntp.conf.5mdoc@1.187 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/ntp.conf.html@1.147 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/ntp.conf.man.in@1.187 +0 -2990
+ NTP_4_2_7P473
+
+ ntpd/ntp.conf.mdoc.in@1.187 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/ntp.keys.5man@1.185 +2 -2
+ NTP_4_2_7P473
+
+ ntpd/ntp.keys.5mdoc@1.185 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/ntp.keys.html@1.148 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/ntp.keys.man.in@1.185 +2 -2
+ NTP_4_2_7P473
+
+ ntpd/ntp.keys.mdoc.in@1.185 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/ntpd-opts.c@1.488 +7 -7
+ NTP_4_2_7P473
+
+ ntpd/ntpd-opts.h@1.487 +3 -3
+ NTP_4_2_7P473
+
+ ntpd/ntpd.1ntpdman@1.296 +3 -3
+ NTP_4_2_7P473
+
+ ntpd/ntpd.1ntpdmdoc@1.296 +1 -1
+ NTP_4_2_7P473
+
+ ntpd/ntpd.html@1.142 +2 -2
+ NTP_4_2_7P473
+
+ ntpd/ntpd.man.in@1.296 +3 -3
+ NTP_4_2_7P473
+
+ ntpd/ntpd.mdoc.in@1.296 +1 -1
+ NTP_4_2_7P473
+
+ ntpdc/invoke-ntpdc.texi@1.465 +2 -2
+ NTP_4_2_7P473
+
+ ntpdc/ntpdc-opts.c@1.483 +7 -7
+ NTP_4_2_7P473
+
+ ntpdc/ntpdc-opts.h@1.482 +3 -3
+ NTP_4_2_7P473
+
+ ntpdc/ntpdc.1ntpdcman@1.296 +3 -3
+ NTP_4_2_7P473
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.296 +1 -1
+ NTP_4_2_7P473
+
+ ntpdc/ntpdc.html@1.309 +2 -2
+ NTP_4_2_7P473
+
+ ntpdc/ntpdc.man.in@1.296 +3 -3
+ NTP_4_2_7P473
+
+ ntpdc/ntpdc.mdoc.in@1.296 +1 -1
+ NTP_4_2_7P473
+
+ ntpq/invoke-ntpq.texi@1.471 +2 -2
+ NTP_4_2_7P473
+
+ ntpq/ntpq-opts.c@1.488 +7 -7
+ NTP_4_2_7P473
+
+ ntpq/ntpq-opts.h@1.486 +3 -3
+ NTP_4_2_7P473
+
+ ntpq/ntpq.1ntpqman@1.299 +3 -3
+ NTP_4_2_7P473
+
+ ntpq/ntpq.1ntpqmdoc@1.299 +1 -1
+ NTP_4_2_7P473
+
+ ntpq/ntpq.html@1.139 +56 -11
+ NTP_4_2_7P473
+
+ ntpq/ntpq.man.in@1.299 +3 -3
+ NTP_4_2_7P473
+
+ ntpq/ntpq.mdoc.in@1.299 +1 -1
+ NTP_4_2_7P473
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.467 +2 -2
+ NTP_4_2_7P473
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.485 +7 -7
+ NTP_4_2_7P473
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.484 +3 -3
+ NTP_4_2_7P473
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.296 +3 -3
+ NTP_4_2_7P473
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.296 +1 -1
+ NTP_4_2_7P473
+
+ ntpsnmpd/ntpsnmpd.html@1.137 +1 -1
+ NTP_4_2_7P473
+
+ ntpsnmpd/ntpsnmpd.man.in@1.296 +3 -3
+ NTP_4_2_7P473
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.296 +1 -1
+ NTP_4_2_7P473
+
+ packageinfo.sh@1.477 +1 -1
+ NTP_4_2_7P473
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.58 +3 -3
+ NTP_4_2_7P473
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.58 +1 -1
+ NTP_4_2_7P473
+
+ scripts/calc_tickadj/calc_tickadj.html@1.60 +1 -1
+ NTP_4_2_7P473
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.57 +3 -3
+ NTP_4_2_7P473
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.58 +1 -1
+ NTP_4_2_7P473
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.62 +1 -1
+ NTP_4_2_7P473
+
+ scripts/invoke-plot_summary.texi@1.79 +1 -1
+ NTP_4_2_7P473
+
+ scripts/invoke-summary.texi@1.79 +1 -1
+ NTP_4_2_7P473
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.288 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntp-wait/ntp-wait-opts@1.24 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.286 +3 -3
+ NTP_4_2_7P473
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.286 +1 -1
+ NTP_4_2_7P473
+
+ scripts/ntp-wait/ntp-wait.html@1.305 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntp-wait/ntp-wait.man.in@1.286 +3 -3
+ NTP_4_2_7P473
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.286 +1 -1
+ NTP_4_2_7P473
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.77 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntpsweep/ntpsweep-opts@1.26 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.65 +3 -3
+ NTP_4_2_7P473
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.65 +1 -1
+ NTP_4_2_7P473
+
+ scripts/ntpsweep/ntpsweep.html@1.78 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntpsweep/ntpsweep.man.in@1.65 +3 -3
+ NTP_4_2_7P473
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.66 +1 -1
+ NTP_4_2_7P473
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.77 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntptrace/ntptrace-opts@1.26 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.65 +3 -3
+ NTP_4_2_7P473
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.65 +1 -1
+ NTP_4_2_7P473
+
+ scripts/ntptrace/ntptrace.html@1.78 +2 -2
+ NTP_4_2_7P473
+
+ scripts/ntptrace/ntptrace.man.in@1.65 +3 -3
+ NTP_4_2_7P473
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.66 +1 -1
+ NTP_4_2_7P473
+
+ scripts/plot_summary-opts@1.26 +1 -1
+ NTP_4_2_7P473
+
+ scripts/plot_summary.1plot_summaryman@1.77 +2 -2
+ NTP_4_2_7P473
+
+ scripts/plot_summary.1plot_summarymdoc@1.77 +1 -1
+ NTP_4_2_7P473
+
+ scripts/plot_summary.html@1.80 +2 -2
+ NTP_4_2_7P473
+
+ scripts/plot_summary.man.in@1.77 +2 -2
+ NTP_4_2_7P473
+
+ scripts/plot_summary.mdoc.in@1.77 +1 -1
+ NTP_4_2_7P473
+
+ scripts/summary-opts@1.26 +1 -1
+ NTP_4_2_7P473
+
+ scripts/summary.1summaryman@1.77 +2 -2
+ NTP_4_2_7P473
+
+ scripts/summary.1summarymdoc@1.77 +1 -1
+ NTP_4_2_7P473
+
+ scripts/summary.html@1.80 +2 -2
+ NTP_4_2_7P473
+
+ scripts/summary.man.in@1.77 +2 -2
+ NTP_4_2_7P473
+
+ scripts/summary.mdoc.in@1.77 +1 -1
+ NTP_4_2_7P473
+
+ sntp/invoke-sntp.texi@1.464 +2 -2
+ NTP_4_2_7P473
+
+ sntp/sntp-opts.c@1.482 +7 -7
+ NTP_4_2_7P473
+
+ sntp/sntp-opts.h@1.481 +3 -3
+ NTP_4_2_7P473
+
+ sntp/sntp.1sntpman@1.299 +3 -3
+ NTP_4_2_7P473
+
+ sntp/sntp.1sntpmdoc@1.299 +1 -1
+ NTP_4_2_7P473
+
+ sntp/sntp.html@1.479 +2 -2
+ NTP_4_2_7P473
+
+ sntp/sntp.man.in@1.299 +3 -3
+ NTP_4_2_7P473
+
+ sntp/sntp.mdoc.in@1.299 +1 -1
+ NTP_4_2_7P473
+
+ util/invoke-ntp-keygen.texi@1.468 +2 -2
+ NTP_4_2_7P473
+
+ util/ntp-keygen-opts.c@1.485 +7 -7
+ NTP_4_2_7P473
+
+ util/ntp-keygen-opts.h@1.484 +3 -3
+ NTP_4_2_7P473
+
+ util/ntp-keygen.1ntp-keygenman@1.296 +3 -3
+ NTP_4_2_7P473
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.296 +1 -1
+ NTP_4_2_7P473
+
+ util/ntp-keygen.html@1.143 +2 -2
+ NTP_4_2_7P473
+
+ util/ntp-keygen.man.in@1.296 +3 -3
+ NTP_4_2_7P473
+
+ util/ntp-keygen.mdoc.in@1.296 +1 -1
+ NTP_4_2_7P473
+
+ChangeSet@1.3214, 2014-09-06 22:03:18-04:00, stenn@deacon.udel.edu
+ Autogen DNE fix
+
+ scripts/Makefile.am@1.39 +1 -1
+ Autogen DNE fix
+
+ChangeSet@1.3213, 2014-09-06 05:38:30-04:00, stenn@deacon.udel.edu
+ [Bug 2649] Clean up html/ page installation
+
+ Makefile.am@1.122 +2 -0
+ [Bug 2649] Clean up html/ page installation
+
+ChangeSet@1.3212, 2014-09-06 09:27:29+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2649] Clean up html/ page installation
+
+ ChangeLog@1.1549 +1 -0
+ [Bug 2649] Clean up html/ page installation
+
+ Makefile.am@1.121 +1 -1
+ [Bug 2649] Clean up html/ page installation
+
+ChangeSet@1.3211, 2014-09-06 08:58:30+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P472
+ TAG: NTP_4_2_7P472
+
+ ChangeLog@1.1548 +1 -0
+ NTP_4_2_7P472
+
+ ntpd/invoke-ntp.conf.texi@1.152 +1 -1
+ NTP_4_2_7P472
+
+ ntpd/invoke-ntp.keys.texi@1.150 +1 -1
+ NTP_4_2_7P472
+
+ ntpd/invoke-ntpd.texi@1.466 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntp.conf.5man@1.186 +3 -3
+ NTP_4_2_7P472
+
+ ntpd/ntp.conf.5mdoc@1.186 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntp.conf.html@1.146 +1 -1
+ NTP_4_2_7P472
+
+ ntpd/ntp.conf.man.in@1.186 +3 -3
+ NTP_4_2_7P472
+
+ ntpd/ntp.conf.mdoc.in@1.186 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntp.keys.5man@1.184 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntp.keys.5mdoc@1.184 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntp.keys.html@1.147 +1 -1
+ NTP_4_2_7P472
+
+ ntpd/ntp.keys.man.in@1.184 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntp.keys.mdoc.in@1.184 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntpd-opts.c@1.487 +7 -7
+ NTP_4_2_7P472
+
+ ntpd/ntpd-opts.h@1.486 +3 -3
+ NTP_4_2_7P472
+
+ ntpd/ntpd.1ntpdman@1.295 +3 -3
+ NTP_4_2_7P472
+
+ ntpd/ntpd.1ntpdmdoc@1.295 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntpd.html@1.141 +2 -2
+ NTP_4_2_7P472
+
+ ntpd/ntpd.man.in@1.295 +3 -3
+ NTP_4_2_7P472
+
+ ntpd/ntpd.mdoc.in@1.295 +2 -2
+ NTP_4_2_7P472
+
+ ntpdc/invoke-ntpdc.texi@1.464 +2 -2
+ NTP_4_2_7P472
+
+ ntpdc/ntpdc-opts.c@1.482 +7 -7
+ NTP_4_2_7P472
+
+ ntpdc/ntpdc-opts.h@1.481 +3 -3
+ NTP_4_2_7P472
+
+ ntpdc/ntpdc.1ntpdcman@1.295 +3 -3
+ NTP_4_2_7P472
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.295 +2 -2
+ NTP_4_2_7P472
+
+ ntpdc/ntpdc.html@1.308 +2 -2
+ NTP_4_2_7P472
+
+ ntpdc/ntpdc.man.in@1.295 +3 -3
+ NTP_4_2_7P472
+
+ ntpdc/ntpdc.mdoc.in@1.295 +2 -2
+ NTP_4_2_7P472
+
+ ntpq/invoke-ntpq.texi@1.470 +72 -13
+ NTP_4_2_7P472
+
+ ntpq/ntpq-opts.c@1.487 +7 -7
+ NTP_4_2_7P472
+
+ ntpq/ntpq-opts.h@1.485 +3 -3
+ NTP_4_2_7P472
+
+ ntpq/ntpq.1ntpqman@1.298 +119 -15
+ NTP_4_2_7P472
+
+ ntpq/ntpq.1ntpqmdoc@1.298 +92 -14
+ NTP_4_2_7P472
+
+ ntpq/ntpq.html@1.138 +2 -2
+ NTP_4_2_7P472
+
+ ntpq/ntpq.man.in@1.298 +119 -15
+ NTP_4_2_7P472
+
+ ntpq/ntpq.mdoc.in@1.298 +92 -14
+ NTP_4_2_7P472
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.466 +2 -2
+ NTP_4_2_7P472
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.484 +7 -7
+ NTP_4_2_7P472
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.483 +3 -3
+ NTP_4_2_7P472
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.295 +3 -3
+ NTP_4_2_7P472
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.295 +2 -2
+ NTP_4_2_7P472
+
+ ntpsnmpd/ntpsnmpd.html@1.136 +1 -1
+ NTP_4_2_7P472
+
+ ntpsnmpd/ntpsnmpd.man.in@1.295 +3 -3
+ NTP_4_2_7P472
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.295 +2 -2
+ NTP_4_2_7P472
+
+ packageinfo.sh@1.476 +1 -1
+ NTP_4_2_7P472
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.57 +3 -3
+ NTP_4_2_7P472
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.57 +2 -2
+ NTP_4_2_7P472
+
+ scripts/calc_tickadj/calc_tickadj.html@1.59 +1 -1
+ NTP_4_2_7P472
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.56 +3 -3
+ NTP_4_2_7P472
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P472
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.61 +1 -1
+ NTP_4_2_7P472
+
+ scripts/invoke-plot_summary.texi@1.78 +1 -1
+ NTP_4_2_7P472
+
+ scripts/invoke-summary.texi@1.78 +1 -1
+ NTP_4_2_7P472
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.287 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntp-wait/ntp-wait-opts@1.23 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.285 +3 -3
+ NTP_4_2_7P472
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.285 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntp-wait/ntp-wait.html@1.304 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntp-wait/ntp-wait.man.in@1.285 +3 -3
+ NTP_4_2_7P472
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.285 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.76 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntpsweep/ntpsweep-opts@1.25 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.64 +3 -3
+ NTP_4_2_7P472
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.64 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntpsweep/ntpsweep.html@1.77 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntpsweep/ntpsweep.man.in@1.64 +3 -3
+ NTP_4_2_7P472
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.76 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntptrace/ntptrace-opts@1.25 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.64 +3 -3
+ NTP_4_2_7P472
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.64 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntptrace/ntptrace.html@1.77 +2 -2
+ NTP_4_2_7P472
+
+ scripts/ntptrace/ntptrace.man.in@1.64 +3 -3
+ NTP_4_2_7P472
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P472
+
+ scripts/plot_summary-opts@1.25 +1 -1
+ NTP_4_2_7P472
+
+ scripts/plot_summary.1plot_summaryman@1.76 +2 -2
+ NTP_4_2_7P472
+
+ scripts/plot_summary.1plot_summarymdoc@1.76 +1 -1
+ NTP_4_2_7P472
+
+ scripts/plot_summary.html@1.79 +2 -2
+ NTP_4_2_7P472
+
+ scripts/plot_summary.man.in@1.76 +2 -2
+ NTP_4_2_7P472
+
+ scripts/plot_summary.mdoc.in@1.76 +1 -1
+ NTP_4_2_7P472
+
+ scripts/summary-opts@1.25 +1 -1
+ NTP_4_2_7P472
+
+ scripts/summary.1summaryman@1.76 +2 -2
+ NTP_4_2_7P472
+
+ scripts/summary.1summarymdoc@1.76 +1 -1
+ NTP_4_2_7P472
+
+ scripts/summary.html@1.79 +2 -2
+ NTP_4_2_7P472
+
+ scripts/summary.man.in@1.76 +2 -2
+ NTP_4_2_7P472
+
+ scripts/summary.mdoc.in@1.76 +1 -1
+ NTP_4_2_7P472
+
+ sntp/invoke-sntp.texi@1.463 +2 -2
+ NTP_4_2_7P472
+
+ sntp/sntp-opts.c@1.481 +7 -7
+ NTP_4_2_7P472
+
+ sntp/sntp-opts.h@1.480 +3 -3
+ NTP_4_2_7P472
+
+ sntp/sntp.1sntpman@1.298 +3 -3
+ NTP_4_2_7P472
+
+ sntp/sntp.1sntpmdoc@1.298 +2 -2
+ NTP_4_2_7P472
+
+ sntp/sntp.html@1.478 +2 -2
+ NTP_4_2_7P472
+
+ sntp/sntp.man.in@1.298 +3 -3
+ NTP_4_2_7P472
+
+ sntp/sntp.mdoc.in@1.298 +2 -2
+ NTP_4_2_7P472
+
+ util/invoke-ntp-keygen.texi@1.467 +2 -2
+ NTP_4_2_7P472
+
+ util/ntp-keygen-opts.c@1.484 +7 -7
+ NTP_4_2_7P472
+
+ util/ntp-keygen-opts.h@1.483 +3 -3
+ NTP_4_2_7P472
+
+ util/ntp-keygen.1ntp-keygenman@1.295 +3 -3
+ NTP_4_2_7P472
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.295 +2 -2
+ NTP_4_2_7P472
+
+ util/ntp-keygen.html@1.142 +2 -2
+ NTP_4_2_7P472
+
+ util/ntp-keygen.man.in@1.295 +3 -3
+ NTP_4_2_7P472
+
+ util/ntp-keygen.mdoc.in@1.295 +2 -2
+ NTP_4_2_7P472
+
+ChangeSet@1.3210, 2014-09-05 10:34:18+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2556] mrulist is missing from the generated ntpq man page
+
+ ChangeLog@1.1547 +1 -0
+ [Bug 2556] mrulist is missing from the generated ntpq man page
+
+ ntpq/ntpq-opts.def@1.24 +91 -12
+ [Bug 2556] mrulist is missing from the generated ntpq man page
+
+ChangeSet@1.3209, 2014-09-05 08:58:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P471
+ TAG: NTP_4_2_7P471
+
+ ChangeLog@1.1546 +1 -0
+ NTP_4_2_7P471
+
+ ntpd/invoke-ntp.conf.texi@1.151 +1 -1
+ NTP_4_2_7P471
+
+ ntpd/invoke-ntp.keys.texi@1.149 +1 -1
+ NTP_4_2_7P471
+
+ ntpd/invoke-ntpd.texi@1.465 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntp.conf.5man@1.185 +3 -3
+ NTP_4_2_7P471
+
+ ntpd/ntp.conf.5mdoc@1.185 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntp.conf.html@1.145 +1 -1
+ NTP_4_2_7P471
+
+ ntpd/ntp.conf.man.in@1.185 +3 -3
+ NTP_4_2_7P471
+
+ ntpd/ntp.conf.mdoc.in@1.185 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntp.keys.5man@1.183 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntp.keys.5mdoc@1.183 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntp.keys.html@1.146 +1 -1
+ NTP_4_2_7P471
+
+ ntpd/ntp.keys.man.in@1.183 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntp.keys.mdoc.in@1.183 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntpd-opts.c@1.486 +7 -7
+ NTP_4_2_7P471
+
+ ntpd/ntpd-opts.h@1.485 +3 -3
+ NTP_4_2_7P471
+
+ ntpd/ntpd.1ntpdman@1.294 +3 -3
+ NTP_4_2_7P471
+
+ ntpd/ntpd.1ntpdmdoc@1.294 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntpd.html@1.140 +2 -2
+ NTP_4_2_7P471
+
+ ntpd/ntpd.man.in@1.294 +3 -3
+ NTP_4_2_7P471
+
+ ntpd/ntpd.mdoc.in@1.294 +2 -2
+ NTP_4_2_7P471
+
+ ntpdc/invoke-ntpdc.texi@1.463 +2 -2
+ NTP_4_2_7P471
+
+ ntpdc/ntpdc-opts.c@1.481 +7 -7
+ NTP_4_2_7P471
+
+ ntpdc/ntpdc-opts.h@1.480 +3 -3
+ NTP_4_2_7P471
+
+ ntpdc/ntpdc.1ntpdcman@1.294 +3 -3
+ NTP_4_2_7P471
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.294 +2 -2
+ NTP_4_2_7P471
+
+ ntpdc/ntpdc.html@1.307 +2 -2
+ NTP_4_2_7P471
+
+ ntpdc/ntpdc.man.in@1.294 +3 -3
+ NTP_4_2_7P471
+
+ ntpdc/ntpdc.mdoc.in@1.294 +2 -2
+ NTP_4_2_7P471
+
+ ntpq/invoke-ntpq.texi@1.469 +2 -2
+ NTP_4_2_7P471
+
+ ntpq/ntpq-opts.c@1.486 +7 -7
+ NTP_4_2_7P471
+
+ ntpq/ntpq-opts.h@1.484 +3 -3
+ NTP_4_2_7P471
+
+ ntpq/ntpq.1ntpqman@1.297 +3 -3
+ NTP_4_2_7P471
+
+ ntpq/ntpq.1ntpqmdoc@1.297 +2 -2
+ NTP_4_2_7P471
+
+ ntpq/ntpq.html@1.137 +2 -2
+ NTP_4_2_7P471
+
+ ntpq/ntpq.man.in@1.297 +3 -3
+ NTP_4_2_7P471
+
+ ntpq/ntpq.mdoc.in@1.297 +2 -2
+ NTP_4_2_7P471
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.465 +2 -2
+ NTP_4_2_7P471
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.483 +7 -7
+ NTP_4_2_7P471
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.482 +3 -3
+ NTP_4_2_7P471
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.294 +3 -3
+ NTP_4_2_7P471
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.294 +2 -2
+ NTP_4_2_7P471
+
+ ntpsnmpd/ntpsnmpd.html@1.135 +1 -1
+ NTP_4_2_7P471
+
+ ntpsnmpd/ntpsnmpd.man.in@1.294 +3 -3
+ NTP_4_2_7P471
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.294 +2 -2
+ NTP_4_2_7P471
+
+ packageinfo.sh@1.475 +1 -1
+ NTP_4_2_7P471
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.56 +3 -3
+ NTP_4_2_7P471
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.56 +2 -2
+ NTP_4_2_7P471
+
+ scripts/calc_tickadj/calc_tickadj.html@1.58 +1 -1
+ NTP_4_2_7P471
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.55 +3 -3
+ NTP_4_2_7P471
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P471
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.60 +1 -1
+ NTP_4_2_7P471
+
+ scripts/invoke-plot_summary.texi@1.77 +1 -1
+ NTP_4_2_7P471
+
+ scripts/invoke-summary.texi@1.77 +1 -1
+ NTP_4_2_7P471
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.286 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntp-wait/ntp-wait-opts@1.22 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.284 +3 -3
+ NTP_4_2_7P471
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.284 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntp-wait/ntp-wait.html@1.303 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntp-wait/ntp-wait.man.in@1.284 +3 -3
+ NTP_4_2_7P471
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.284 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.75 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntpsweep/ntpsweep-opts@1.24 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.63 +3 -3
+ NTP_4_2_7P471
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.63 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntpsweep/ntpsweep.html@1.76 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntpsweep/ntpsweep.man.in@1.63 +3 -3
+ NTP_4_2_7P471
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.75 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntptrace/ntptrace-opts@1.24 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.63 +3 -3
+ NTP_4_2_7P471
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.63 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntptrace/ntptrace.html@1.76 +2 -2
+ NTP_4_2_7P471
+
+ scripts/ntptrace/ntptrace.man.in@1.63 +3 -3
+ NTP_4_2_7P471
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P471
+
+ scripts/plot_summary-opts@1.24 +1 -1
+ NTP_4_2_7P471
+
+ scripts/plot_summary.1plot_summaryman@1.75 +2 -2
+ NTP_4_2_7P471
+
+ scripts/plot_summary.1plot_summarymdoc@1.75 +1 -1
+ NTP_4_2_7P471
+
+ scripts/plot_summary.html@1.78 +2 -2
+ NTP_4_2_7P471
+
+ scripts/plot_summary.man.in@1.75 +2 -2
+ NTP_4_2_7P471
+
+ scripts/plot_summary.mdoc.in@1.75 +1 -1
+ NTP_4_2_7P471
+
+ scripts/summary-opts@1.24 +1 -1
+ NTP_4_2_7P471
+
+ scripts/summary.1summaryman@1.75 +2 -2
+ NTP_4_2_7P471
+
+ scripts/summary.1summarymdoc@1.75 +1 -1
+ NTP_4_2_7P471
+
+ scripts/summary.html@1.78 +2 -2
+ NTP_4_2_7P471
+
+ scripts/summary.man.in@1.75 +2 -2
+ NTP_4_2_7P471
+
+ scripts/summary.mdoc.in@1.75 +1 -1
+ NTP_4_2_7P471
+
+ sntp/invoke-sntp.texi@1.462 +2 -2
+ NTP_4_2_7P471
+
+ sntp/sntp-opts.c@1.480 +7 -7
+ NTP_4_2_7P471
+
+ sntp/sntp-opts.h@1.479 +3 -3
+ NTP_4_2_7P471
+
+ sntp/sntp.1sntpman@1.297 +3 -3
+ NTP_4_2_7P471
+
+ sntp/sntp.1sntpmdoc@1.297 +2 -2
+ NTP_4_2_7P471
+
+ sntp/sntp.html@1.477 +2 -2
+ NTP_4_2_7P471
+
+ sntp/sntp.man.in@1.297 +3 -3
+ NTP_4_2_7P471
+
+ sntp/sntp.mdoc.in@1.297 +2 -2
+ NTP_4_2_7P471
+
+ util/invoke-ntp-keygen.texi@1.466 +2 -2
+ NTP_4_2_7P471
+
+ util/ntp-keygen-opts.c@1.483 +7 -7
+ NTP_4_2_7P471
+
+ util/ntp-keygen-opts.h@1.482 +3 -3
+ NTP_4_2_7P471
+
+ util/ntp-keygen.1ntp-keygenman@1.294 +3 -3
+ NTP_4_2_7P471
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.294 +2 -2
+ NTP_4_2_7P471
+
+ util/ntp-keygen.html@1.141 +2 -2
+ NTP_4_2_7P471
+
+ util/ntp-keygen.man.in@1.294 +3 -3
+ NTP_4_2_7P471
+
+ util/ntp-keygen.mdoc.in@1.294 +2 -2
+ NTP_4_2_7P471
+
+ChangeSet@1.3208, 2014-09-05 02:34:19+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2649] "make install" leaves wrong owner for files in html/
+
+ ChangeLog@1.1545 +1 -0
+ [Bug 2649] "make install" leaves wrong owner for files in html/
+
+ Makefile.am@1.120 +2 -2
+ [Bug 2649] "make install" leaves wrong owner for files in html/
+
+ChangeSet@1.3207, 2014-09-05 02:29:49+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2652] Windows hates directory names that contain a :
+
+ ChangeLog@1.1544 +1 -0
+ [Bug 2652] Windows hates directory names that contain a :
+
+ sntp/ag-tpl/0-old/Mdoc.pm@1.4 +0 -0
+ Rename: sntp/ag-tpl/:Old/Mdoc.pm -> sntp/ag-tpl/0-old/Mdoc.pm
+
+ sntp/ag-tpl/0-old/agman-cmd.tpl@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/agman-cmd.tpl -> sntp/ag-tpl/0-old/agman-cmd.tpl
+
+ sntp/ag-tpl/0-old/agmdoc-cmd.tpl@1.4 +0 -0
+ Rename: sntp/ag-tpl/:Old/agmdoc-cmd.tpl -> sntp/ag-tpl/0-old/agmdoc-cmd.tpl
+
+ sntp/ag-tpl/0-old/cmd-doc.tlib@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/cmd-doc.tlib -> sntp/ag-tpl/0-old/cmd-doc.tlib
+
+ sntp/ag-tpl/0-old/mdoc-synopsis.tlib@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/mdoc-synopsis.tlib -> sntp/ag-tpl/0-old/mdoc-synopsis.tlib
+
+ sntp/ag-tpl/0-old/mdoc2man@1.4 +0 -0
+ Rename: sntp/ag-tpl/:Old/mdoc2man -> sntp/ag-tpl/0-old/mdoc2man
+
+ sntp/ag-tpl/0-old/mdoc2texi@1.11 +0 -0
+ Rename: sntp/ag-tpl/:Old/mdoc2texi -> sntp/ag-tpl/0-old/mdoc2texi
+
+ sntp/ag-tpl/0-old/perlopt.tpl@1.5 +0 -0
+ Rename: sntp/ag-tpl/:Old/perlopt.tpl -> sntp/ag-tpl/0-old/perlopt.tpl
+
+ChangeSet@1.3206, 2014-09-02 08:58:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P470
+ TAG: NTP_4_2_7P470
+
+ ChangeLog@1.1543 +1 -0
+ NTP_4_2_7P470
+
+ ntpd/invoke-ntp.conf.texi@1.150 +1 -1
+ NTP_4_2_7P470
+
+ ntpd/invoke-ntp.keys.texi@1.148 +1 -1
+ NTP_4_2_7P470
+
+ ntpd/invoke-ntpd.texi@1.464 +2 -2
+ NTP_4_2_7P470
+
+ ntpd/ntp.conf.5man@1.184 +3 -54
+ NTP_4_2_7P470
+
+ ntpd/ntp.conf.5mdoc@1.184 +2 -44
+ NTP_4_2_7P470
+
+ ntpd/ntp.conf.html@1.144 +1 -1
+ NTP_4_2_7P470
+
+ ntpd/ntp.conf.man.in@1.184 +3 -54
+ NTP_4_2_7P470
+
+ ntpd/ntp.conf.mdoc.in@1.184 +2 -44
+ NTP_4_2_7P470
+
+ ntpd/ntp.keys.5man@1.182 +2 -43
+ NTP_4_2_7P470
+
+ ntpd/ntp.keys.5mdoc@1.182 +2 -44
+ NTP_4_2_7P470
+
+ ntpd/ntp.keys.html@1.145 +1 -1
+ NTP_4_2_7P470
+
+ ntpd/ntp.keys.man.in@1.182 +2 -43
+ NTP_4_2_7P470
+
+ ntpd/ntp.keys.mdoc.in@1.182 +2 -44
+ NTP_4_2_7P470
+
+ ntpd/ntpd-opts.c@1.485 +7 -7
+ NTP_4_2_7P470
+
+ ntpd/ntpd-opts.h@1.484 +3 -3
+ NTP_4_2_7P470
+
+ ntpd/ntpd.1ntpdman@1.293 +3 -54
+ NTP_4_2_7P470
+
+ ntpd/ntpd.1ntpdmdoc@1.293 +2 -44
+ NTP_4_2_7P470
+
+ ntpd/ntpd.html@1.139 +2 -2
+ NTP_4_2_7P470
+
+ ntpd/ntpd.man.in@1.293 +3 -54
+ NTP_4_2_7P470
+
+ ntpd/ntpd.mdoc.in@1.293 +2 -44
+ NTP_4_2_7P470
+
+ ntpdc/invoke-ntpdc.texi@1.462 +2 -2
+ NTP_4_2_7P470
+
+ ntpdc/ntpdc-opts.c@1.480 +7 -7
+ NTP_4_2_7P470
+
+ ntpdc/ntpdc-opts.h@1.479 +3 -3
+ NTP_4_2_7P470
+
+ ntpdc/ntpdc.1ntpdcman@1.293 +3 -54
+ NTP_4_2_7P470
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.293 +2 -44
+ NTP_4_2_7P470
+
+ ntpdc/ntpdc.html@1.306 +2 -2
+ NTP_4_2_7P470
+
+ ntpdc/ntpdc.man.in@1.293 +3 -54
+ NTP_4_2_7P470
+
+ ntpdc/ntpdc.mdoc.in@1.293 +2 -44
+ NTP_4_2_7P470
+
+ ntpq/invoke-ntpq.texi@1.468 +2 -2
+ NTP_4_2_7P470
+
+ ntpq/ntpq-opts.c@1.485 +7 -7
+ NTP_4_2_7P470
+
+ ntpq/ntpq-opts.h@1.483 +3 -3
+ NTP_4_2_7P470
+
+ ntpq/ntpq.1ntpqman@1.296 +3 -54
+ NTP_4_2_7P470
+
+ ntpq/ntpq.1ntpqmdoc@1.296 +2 -44
+ NTP_4_2_7P470
+
+ ntpq/ntpq.html@1.136 +2 -2
+ NTP_4_2_7P470
+
+ ntpq/ntpq.man.in@1.296 +3 -54
+ NTP_4_2_7P470
+
+ ntpq/ntpq.mdoc.in@1.296 +2 -44
+ NTP_4_2_7P470
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.464 +2 -2
+ NTP_4_2_7P470
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.482 +7 -7
+ NTP_4_2_7P470
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.481 +3 -3
+ NTP_4_2_7P470
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.293 +3 -54
+ NTP_4_2_7P470
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.293 +2 -44
+ NTP_4_2_7P470
+
+ ntpsnmpd/ntpsnmpd.html@1.134 +1 -1
+ NTP_4_2_7P470
+
+ ntpsnmpd/ntpsnmpd.man.in@1.293 +3 -54
+ NTP_4_2_7P470
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.293 +2 -44
+ NTP_4_2_7P470
+
+ packageinfo.sh@1.474 +1 -1
+ NTP_4_2_7P470
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.55 +3 -54
+ NTP_4_2_7P470
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.55 +2 -44
+ NTP_4_2_7P470
+
+ scripts/calc_tickadj/calc_tickadj.html@1.57 +1 -1
+ NTP_4_2_7P470
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.54 +3 -54
+ NTP_4_2_7P470
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.55 +2 -44
+ NTP_4_2_7P470
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.59 +1 -1
+ NTP_4_2_7P470
+
+ scripts/invoke-plot_summary.texi@1.76 +1 -1
+ NTP_4_2_7P470
+
+ scripts/invoke-summary.texi@1.76 +1 -1
+ NTP_4_2_7P470
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.285 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntp-wait/ntp-wait-opts@1.21 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.283 +3 -54
+ NTP_4_2_7P470
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.283 +2 -44
+ NTP_4_2_7P470
+
+ scripts/ntp-wait/ntp-wait.html@1.302 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntp-wait/ntp-wait.man.in@1.283 +3 -54
+ NTP_4_2_7P470
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.283 +2 -44
+ NTP_4_2_7P470
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.74 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntpsweep/ntpsweep-opts@1.23 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.62 +3 -54
+ NTP_4_2_7P470
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.62 +2 -44
+ NTP_4_2_7P470
+
+ scripts/ntpsweep/ntpsweep.html@1.75 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntpsweep/ntpsweep.man.in@1.62 +3 -54
+ NTP_4_2_7P470
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.63 +2 -44
+ NTP_4_2_7P470
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.74 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntptrace/ntptrace-opts@1.23 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.62 +3 -54
+ NTP_4_2_7P470
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.62 +2 -44
+ NTP_4_2_7P470
+
+ scripts/ntptrace/ntptrace.html@1.75 +2 -2
+ NTP_4_2_7P470
+
+ scripts/ntptrace/ntptrace.man.in@1.62 +3 -54
+ NTP_4_2_7P470
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.63 +2 -44
+ NTP_4_2_7P470
+
+ scripts/plot_summary-opts@1.23 +1 -1
+ NTP_4_2_7P470
+
+ scripts/plot_summary.1plot_summaryman@1.74 +2 -54
+ NTP_4_2_7P470
+
+ scripts/plot_summary.1plot_summarymdoc@1.74 +1 -44
+ NTP_4_2_7P470
+
+ scripts/plot_summary.html@1.77 +2 -2
+ NTP_4_2_7P470
+
+ scripts/plot_summary.man.in@1.74 +2 -54
+ NTP_4_2_7P470
+
+ scripts/plot_summary.mdoc.in@1.74 +1 -44
+ NTP_4_2_7P470
+
+ scripts/summary-opts@1.23 +1 -1
+ NTP_4_2_7P470
+
+ scripts/summary.1summaryman@1.74 +2 -53
+ NTP_4_2_7P470
+
+ scripts/summary.1summarymdoc@1.74 +1 -43
+ NTP_4_2_7P470
+
+ scripts/summary.html@1.77 +2 -2
+ NTP_4_2_7P470
+
+ scripts/summary.man.in@1.74 +2 -53
+ NTP_4_2_7P470
+
+ scripts/summary.mdoc.in@1.74 +1 -43
+ NTP_4_2_7P470
+
+ sntp/invoke-sntp.texi@1.461 +2 -2
+ NTP_4_2_7P470
+
+ sntp/sntp-opts.c@1.479 +7 -7
+ NTP_4_2_7P470
+
+ sntp/sntp-opts.h@1.478 +3 -3
+ NTP_4_2_7P470
+
+ sntp/sntp.1sntpman@1.296 +3 -54
+ NTP_4_2_7P470
+
+ sntp/sntp.1sntpmdoc@1.296 +2 -44
+ NTP_4_2_7P470
+
+ sntp/sntp.html@1.476 +2 -2
+ NTP_4_2_7P470
+
+ sntp/sntp.man.in@1.296 +3 -54
+ NTP_4_2_7P470
+
+ sntp/sntp.mdoc.in@1.296 +2 -44
+ NTP_4_2_7P470
+
+ util/invoke-ntp-keygen.texi@1.465 +2 -2
+ NTP_4_2_7P470
+
+ util/ntp-keygen-opts.c@1.482 +7 -7
+ NTP_4_2_7P470
+
+ util/ntp-keygen-opts.h@1.481 +3 -3
+ NTP_4_2_7P470
+
+ util/ntp-keygen.1ntp-keygenman@1.293 +3 -54
+ NTP_4_2_7P470
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.293 +2 -44
+ NTP_4_2_7P470
+
+ util/ntp-keygen.html@1.140 +2 -2
+ NTP_4_2_7P470
+
+ util/ntp-keygen.man.in@1.293 +3 -54
+ NTP_4_2_7P470
+
+ util/ntp-keygen.mdoc.in@1.293 +2 -44
+ NTP_4_2_7P470
+
+ChangeSet@1.3205, 2014-09-01 23:43:55-04:00, stenn@pogo.udel.edu
+ html/ cleanups from Hal Murray
+
+ ChangeLog@1.1542 +1 -0
+ html/ cleanups from Hal Murray
+
+ html/clockopt.html@1.25 +1 -1
+ html/ cleanups from Hal Murray
+
+ html/miscopt.html@1.79 +2 -2
+ html/ cleanups from Hal Murray
+
+ html/refclock.html@1.44 +1 -1
+ html/ cleanups from Hal Murray
+
+ChangeSet@1.3204, 2014-09-01 19:13:08-04:00, stenn@deacon.udel.edu
+ autogen-5.18.5pre1 fixes [Bug 2502] Autogen text replacement errors
+
+ ChangeLog@1.1541 +2 -0
+ autogen-5.18.5pre1 fixes [Bug 2502] Autogen text replacement errors
+
+ChangeSet@1.3203, 2014-09-01 08:58:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P469
+ TAG: NTP_4_2_7P469
+
+ ChangeLog@1.1540 +1 -0
+ NTP_4_2_7P469
+
+ ntpd/invoke-ntp.conf.texi@1.149 +1 -1
+ NTP_4_2_7P469
+
+ ntpd/invoke-ntp.keys.texi@1.147 +1 -1
+ NTP_4_2_7P469
+
+ ntpd/invoke-ntpd.texi@1.463 +2 -2
+ NTP_4_2_7P469
+
+ ntpd/ntp.conf.5man@1.183 +16 -6
+ NTP_4_2_7P469
+
+ ntpd/ntp.conf.5mdoc@1.183 +12 -2
+ NTP_4_2_7P469
+
+ ntpd/ntp.conf.html@1.143 +1 -1
+ NTP_4_2_7P469
+
+ ntpd/ntp.conf.man.in@1.183 +16 -6
+ NTP_4_2_7P469
+
+ ntpd/ntp.conf.mdoc.in@1.183 +12 -2
+ NTP_4_2_7P469
+
+ ntpd/ntp.keys.5man@1.181 +12 -2
+ NTP_4_2_7P469
+
+ ntpd/ntp.keys.5mdoc@1.181 +12 -2
+ NTP_4_2_7P469
+
+ ntpd/ntp.keys.html@1.144 +1 -1
+ NTP_4_2_7P469
+
+ ntpd/ntp.keys.man.in@1.181 +12 -2
+ NTP_4_2_7P469
+
+ ntpd/ntp.keys.mdoc.in@1.181 +12 -2
+ NTP_4_2_7P469
+
+ ntpd/ntpd-opts.c@1.484 +7 -7
+ NTP_4_2_7P469
+
+ ntpd/ntpd-opts.h@1.483 +3 -3
+ NTP_4_2_7P469
+
+ ntpd/ntpd.1ntpdman@1.292 +16 -6
+ NTP_4_2_7P469
+
+ ntpd/ntpd.1ntpdmdoc@1.292 +12 -2
+ NTP_4_2_7P469
+
+ ntpd/ntpd.html@1.138 +4 -4
+ NTP_4_2_7P469
+
+ ntpd/ntpd.man.in@1.292 +16 -6
+ NTP_4_2_7P469
+
+ ntpd/ntpd.mdoc.in@1.292 +12 -2
+ NTP_4_2_7P469
+
+ ntpdc/invoke-ntpdc.texi@1.461 +2 -2
+ NTP_4_2_7P469
+
+ ntpdc/ntpdc-opts.c@1.479 +7 -7
+ NTP_4_2_7P469
+
+ ntpdc/ntpdc-opts.h@1.478 +3 -3
+ NTP_4_2_7P469
+
+ ntpdc/ntpdc.1ntpdcman@1.292 +16 -6
+ NTP_4_2_7P469
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.292 +12 -2
+ NTP_4_2_7P469
+
+ ntpdc/ntpdc.html@1.305 +2 -2
+ NTP_4_2_7P469
+
+ ntpdc/ntpdc.man.in@1.292 +16 -6
+ NTP_4_2_7P469
+
+ ntpdc/ntpdc.mdoc.in@1.292 +12 -2
+ NTP_4_2_7P469
+
+ ntpq/invoke-ntpq.texi@1.467 +2 -2
+ NTP_4_2_7P469
+
+ ntpq/ntpq-opts.c@1.484 +7 -7
+ NTP_4_2_7P469
+
+ ntpq/ntpq-opts.h@1.482 +3 -3
+ NTP_4_2_7P469
+
+ ntpq/ntpq.1ntpqman@1.295 +16 -6
+ NTP_4_2_7P469
+
+ ntpq/ntpq.1ntpqmdoc@1.295 +12 -2
+ NTP_4_2_7P469
+
+ ntpq/ntpq.html@1.135 +2 -2
+ NTP_4_2_7P469
+
+ ntpq/ntpq.man.in@1.295 +16 -6
+ NTP_4_2_7P469
+
+ ntpq/ntpq.mdoc.in@1.295 +12 -2
+ NTP_4_2_7P469
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.463 +2 -2
+ NTP_4_2_7P469
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.481 +7 -7
+ NTP_4_2_7P469
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.480 +3 -3
+ NTP_4_2_7P469
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.292 +23 -13
+ NTP_4_2_7P469
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.292 +12 -2
+ NTP_4_2_7P469
+
+ ntpsnmpd/ntpsnmpd.html@1.133 +1 -1
+ NTP_4_2_7P469
+
+ ntpsnmpd/ntpsnmpd.man.in@1.292 +23 -13
+ NTP_4_2_7P469
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.292 +12 -2
+ NTP_4_2_7P469
+
+ packageinfo.sh@1.473 +1 -1
+ NTP_4_2_7P469
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.54 +16 -6
+ NTP_4_2_7P469
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.54 +12 -2
+ NTP_4_2_7P469
+
+ scripts/calc_tickadj/calc_tickadj.html@1.56 +1 -1
+ NTP_4_2_7P469
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.53 +16 -6
+ NTP_4_2_7P469
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.54 +12 -2
+ NTP_4_2_7P469
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.58 +1 -1
+ NTP_4_2_7P469
+
+ scripts/invoke-plot_summary.texi@1.75 +1 -1
+ NTP_4_2_7P469
+
+ scripts/invoke-summary.texi@1.75 +1 -1
+ NTP_4_2_7P469
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.284 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntp-wait/ntp-wait-opts@1.20 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.282 +16 -6
+ NTP_4_2_7P469
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.282 +12 -2
+ NTP_4_2_7P469
+
+ scripts/ntp-wait/ntp-wait.html@1.301 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntp-wait/ntp-wait.man.in@1.282 +16 -6
+ NTP_4_2_7P469
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.282 +12 -2
+ NTP_4_2_7P469
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.73 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntpsweep/ntpsweep-opts@1.22 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.61 +16 -6
+ NTP_4_2_7P469
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.61 +12 -2
+ NTP_4_2_7P469
+
+ scripts/ntpsweep/ntpsweep.html@1.74 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntpsweep/ntpsweep.man.in@1.61 +16 -6
+ NTP_4_2_7P469
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.62 +12 -2
+ NTP_4_2_7P469
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.73 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntptrace/ntptrace-opts@1.22 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.61 +23 -13
+ NTP_4_2_7P469
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.61 +12 -2
+ NTP_4_2_7P469
+
+ scripts/ntptrace/ntptrace.html@1.74 +2 -2
+ NTP_4_2_7P469
+
+ scripts/ntptrace/ntptrace.man.in@1.61 +23 -13
+ NTP_4_2_7P469
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.62 +12 -2
+ NTP_4_2_7P469
+
+ scripts/plot_summary-opts@1.22 +1 -1
+ NTP_4_2_7P469
+
+ scripts/plot_summary.1plot_summaryman@1.73 +14 -4
+ NTP_4_2_7P469
+
+ scripts/plot_summary.1plot_summarymdoc@1.73 +11 -1
+ NTP_4_2_7P469
+
+ scripts/plot_summary.html@1.76 +2 -2
+ NTP_4_2_7P469
+
+ scripts/plot_summary.man.in@1.73 +14 -4
+ NTP_4_2_7P469
+
+ scripts/plot_summary.mdoc.in@1.73 +11 -1
+ NTP_4_2_7P469
+
+ scripts/summary-opts@1.22 +1 -1
+ NTP_4_2_7P469
+
+ scripts/summary.1summaryman@1.73 +14 -4
+ NTP_4_2_7P469
+
+ scripts/summary.1summarymdoc@1.73 +11 -1
+ NTP_4_2_7P469
+
+ scripts/summary.html@1.76 +2 -2
+ NTP_4_2_7P469
+
+ scripts/summary.man.in@1.73 +14 -4
+ NTP_4_2_7P469
+
+ scripts/summary.mdoc.in@1.73 +11 -1
+ NTP_4_2_7P469
+
+ sntp/invoke-sntp.texi@1.460 +2 -2
+ NTP_4_2_7P469
+
+ sntp/sntp-opts.c@1.478 +7 -7
+ NTP_4_2_7P469
+
+ sntp/sntp-opts.h@1.477 +3 -3
+ NTP_4_2_7P469
+
+ sntp/sntp.1sntpman@1.295 +16 -6
+ NTP_4_2_7P469
+
+ sntp/sntp.1sntpmdoc@1.295 +12 -2
+ NTP_4_2_7P469
+
+ sntp/sntp.html@1.475 +2 -2
+ NTP_4_2_7P469
+
+ sntp/sntp.man.in@1.295 +16 -6
+ NTP_4_2_7P469
+
+ sntp/sntp.mdoc.in@1.295 +12 -2
+ NTP_4_2_7P469
+
+ util/invoke-ntp-keygen.texi@1.464 +2 -2
+ NTP_4_2_7P469
+
+ util/ntp-keygen-opts.c@1.481 +7 -7
+ NTP_4_2_7P469
+
+ util/ntp-keygen-opts.h@1.480 +3 -3
+ NTP_4_2_7P469
+
+ util/ntp-keygen.1ntp-keygenman@1.292 +16 -6
+ NTP_4_2_7P469
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.292 +12 -2
+ NTP_4_2_7P469
+
+ util/ntp-keygen.html@1.139 +2 -2
+ NTP_4_2_7P469
+
+ util/ntp-keygen.man.in@1.292 +16 -6
+ NTP_4_2_7P469
+
+ util/ntp-keygen.mdoc.in@1.292 +12 -2
+ NTP_4_2_7P469
+
+ChangeSet@1.3202, 2014-09-01 03:12:34+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ ChangeLog@1.1539 +1 -0
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ ntpd/ntpd.c@1.156 +2 -2
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ChangeSet@1.3201, 2014-08-31 09:00:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P468
+ TAG: NTP_4_2_7P468
+
+ ChangeLog@1.1538 +1 -0
+ NTP_4_2_7P468
+
+ ntpd/invoke-ntp.conf.texi@1.148 +1 -1
+ NTP_4_2_7P468
+
+ ntpd/invoke-ntp.keys.texi@1.146 +1 -1
+ NTP_4_2_7P468
+
+ ntpd/invoke-ntpd.texi@1.462 +4 -4
+ NTP_4_2_7P468
+
+ ntpd/ntp.conf.5man@1.182 +44 -3
+ NTP_4_2_7P468
+
+ ntpd/ntp.conf.5mdoc@1.182 +32 -1
+ NTP_4_2_7P468
+
+ ntpd/ntp.conf.html@1.142 +1 -1
+ NTP_4_2_7P468
+
+ ntpd/ntp.conf.man.in@1.182 +44 -3
+ NTP_4_2_7P468
+
+ ntpd/ntp.conf.mdoc.in@1.182 +32 -1
+ NTP_4_2_7P468
+
+ ntpd/ntp.keys.5man@1.180 +33 -2
+ NTP_4_2_7P468
+
+ ntpd/ntp.keys.5mdoc@1.180 +33 -2
+ NTP_4_2_7P468
+
+ ntpd/ntp.keys.html@1.143 +1 -1
+ NTP_4_2_7P468
+
+ ntpd/ntp.keys.man.in@1.180 +33 -2
+ NTP_4_2_7P468
+
+ ntpd/ntp.keys.mdoc.in@1.180 +33 -2
+ NTP_4_2_7P468
+
+ ntpd/ntpd-opts.c@1.483 +7 -7
+ NTP_4_2_7P468
+
+ ntpd/ntpd-opts.h@1.482 +3 -3
+ NTP_4_2_7P468
+
+ ntpd/ntpd.1ntpdman@1.291 +44 -3
+ NTP_4_2_7P468
+
+ ntpd/ntpd.1ntpdmdoc@1.291 +32 -1
+ NTP_4_2_7P468
+
+ ntpd/ntpd.html@1.137 +4 -4
+ NTP_4_2_7P468
+
+ ntpd/ntpd.man.in@1.291 +44 -3
+ NTP_4_2_7P468
+
+ ntpd/ntpd.mdoc.in@1.291 +32 -1
+ NTP_4_2_7P468
+
+ ntpdc/invoke-ntpdc.texi@1.460 +2 -2
+ NTP_4_2_7P468
+
+ ntpdc/ntpdc-opts.c@1.478 +7 -7
+ NTP_4_2_7P468
+
+ ntpdc/ntpdc-opts.h@1.477 +3 -3
+ NTP_4_2_7P468
+
+ ntpdc/ntpdc.1ntpdcman@1.291 +44 -3
+ NTP_4_2_7P468
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.291 +32 -1
+ NTP_4_2_7P468
+
+ ntpdc/ntpdc.html@1.304 +57 -77
+ NTP_4_2_7P468
+
+ ntpdc/ntpdc.man.in@1.291 +44 -3
+ NTP_4_2_7P468
+
+ ntpdc/ntpdc.mdoc.in@1.291 +32 -1
+ NTP_4_2_7P468
+
+ ntpq/invoke-ntpq.texi@1.466 +2 -2
+ NTP_4_2_7P468
+
+ ntpq/ntpq-opts.c@1.483 +7 -7
+ NTP_4_2_7P468
+
+ ntpq/ntpq-opts.h@1.481 +3 -3
+ NTP_4_2_7P468
+
+ ntpq/ntpq.1ntpqman@1.294 +44 -3
+ NTP_4_2_7P468
+
+ ntpq/ntpq.1ntpqmdoc@1.294 +32 -1
+ NTP_4_2_7P468
+
+ ntpq/ntpq.html@1.134 +3 -3
+ NTP_4_2_7P468
+
+ ntpq/ntpq.man.in@1.294 +44 -3
+ NTP_4_2_7P468
+
+ ntpq/ntpq.mdoc.in@1.294 +32 -1
+ NTP_4_2_7P468
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.462 +2 -2
+ NTP_4_2_7P468
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.480 +7 -7
+ NTP_4_2_7P468
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.479 +3 -3
+ NTP_4_2_7P468
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.291 +44 -3
+ NTP_4_2_7P468
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.291 +32 -1
+ NTP_4_2_7P468
+
+ ntpsnmpd/ntpsnmpd.html@1.132 +1 -1
+ NTP_4_2_7P468
+
+ ntpsnmpd/ntpsnmpd.man.in@1.291 +44 -3
+ NTP_4_2_7P468
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.291 +32 -1
+ NTP_4_2_7P468
+
+ packageinfo.sh@1.472 +1 -1
+ NTP_4_2_7P468
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.53 +44 -3
+ NTP_4_2_7P468
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.53 +32 -1
+ NTP_4_2_7P468
+
+ scripts/calc_tickadj/calc_tickadj.html@1.55 +23 -35
+ NTP_4_2_7P468
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.52 +44 -3
+ NTP_4_2_7P468
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.53 +32 -1
+ NTP_4_2_7P468
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.57 +2 -2
+ NTP_4_2_7P468
+
+ scripts/invoke-plot_summary.texi@1.74 +1 -1
+ NTP_4_2_7P468
+
+ scripts/invoke-summary.texi@1.74 +1 -1
+ NTP_4_2_7P468
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.283 +2 -2
+ NTP_4_2_7P468
+
+ scripts/ntp-wait/ntp-wait-opts@1.19 +2 -2
+ NTP_4_2_7P468
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.281 +44 -3
+ NTP_4_2_7P468
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.281 +32 -1
+ NTP_4_2_7P468
+
+ scripts/ntp-wait/ntp-wait.html@1.300 +31 -49
+ NTP_4_2_7P468
+
+ scripts/ntp-wait/ntp-wait.man.in@1.281 +44 -3
+ NTP_4_2_7P468
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.281 +32 -1
+ NTP_4_2_7P468
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.72 +2 -2
+ NTP_4_2_7P468
+
+ scripts/ntpsweep/ntpsweep-opts@1.21 +2 -2
+ NTP_4_2_7P468
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.60 +44 -3
+ NTP_4_2_7P468
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.60 +32 -1
+ NTP_4_2_7P468
+
+ scripts/ntpsweep/ntpsweep.html@1.73 +33 -44
+ NTP_4_2_7P468
+
+ scripts/ntpsweep/ntpsweep.man.in@1.60 +44 -3
+ NTP_4_2_7P468
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.61 +32 -1
+ NTP_4_2_7P468
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.72 +2 -2
+ NTP_4_2_7P468
+
+ scripts/ntptrace/ntptrace-opts@1.21 +2 -2
+ NTP_4_2_7P468
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.60 +44 -3
+ NTP_4_2_7P468
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.60 +32 -1
+ NTP_4_2_7P468
+
+ scripts/ntptrace/ntptrace.html@1.73 +27 -36
+ NTP_4_2_7P468
+
+ scripts/ntptrace/ntptrace.man.in@1.60 +44 -3
+ NTP_4_2_7P468
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.61 +32 -1
+ NTP_4_2_7P468
+
+ scripts/plot_summary-opts@1.21 +1 -1
+ NTP_4_2_7P468
+
+ scripts/plot_summary.1plot_summaryman@1.72 +44 -2
+ NTP_4_2_7P468
+
+ scripts/plot_summary.1plot_summarymdoc@1.72 +32 -0
+ NTP_4_2_7P468
+
+ scripts/plot_summary.html@1.75 +29 -47
+ NTP_4_2_7P468
+
+ scripts/plot_summary.man.in@1.72 +44 -2
+ NTP_4_2_7P468
+
+ scripts/plot_summary.mdoc.in@1.72 +32 -0
+ NTP_4_2_7P468
+
+ scripts/summary-opts@1.21 +1 -1
+ NTP_4_2_7P468
+
+ scripts/summary.1summaryman@1.72 +43 -2
+ NTP_4_2_7P468
+
+ scripts/summary.1summarymdoc@1.72 +31 -0
+ NTP_4_2_7P468
+
+ scripts/summary.html@1.75 +27 -39
+ NTP_4_2_7P468
+
+ scripts/summary.man.in@1.72 +43 -2
+ NTP_4_2_7P468
+
+ scripts/summary.mdoc.in@1.72 +31 -0
+ NTP_4_2_7P468
+
+ sntp/invoke-sntp.texi@1.459 +2 -2
+ NTP_4_2_7P468
+
+ sntp/sntp-opts.c@1.477 +7 -7
+ NTP_4_2_7P468
+
+ sntp/sntp-opts.h@1.476 +3 -3
+ NTP_4_2_7P468
+
+ sntp/sntp.1sntpman@1.294 +44 -3
+ NTP_4_2_7P468
+
+ sntp/sntp.1sntpmdoc@1.294 +32 -1
+ NTP_4_2_7P468
+
+ sntp/sntp.html@1.474 +85 -109
+ NTP_4_2_7P468
+
+ sntp/sntp.man.in@1.294 +44 -3
+ NTP_4_2_7P468
+
+ sntp/sntp.mdoc.in@1.294 +32 -1
+ NTP_4_2_7P468
+
+ util/invoke-ntp-keygen.texi@1.463 +2 -2
+ NTP_4_2_7P468
+
+ util/ntp-keygen-opts.c@1.480 +7 -7
+ NTP_4_2_7P468
+
+ util/ntp-keygen-opts.h@1.479 +3 -3
+ NTP_4_2_7P468
+
+ util/ntp-keygen.1ntp-keygenman@1.291 +44 -3
+ NTP_4_2_7P468
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.291 +32 -1
+ NTP_4_2_7P468
+
+ util/ntp-keygen.html@1.138 +2 -2
+ NTP_4_2_7P468
+
+ util/ntp-keygen.man.in@1.291 +44 -3
+ NTP_4_2_7P468
+
+ util/ntp-keygen.mdoc.in@1.291 +32 -1
+ NTP_4_2_7P468
+
+ChangeSet@1.3200, 2014-08-31 05:07:43+00:00, stenn@psp-fb1.ntp.org
+ autogen-5.18.4
+
+ ChangeLog@1.1537 +1 -0
+ autogen-5.18.4
+
+ ntpd/invoke-ntp.conf.texi@1.147 +1 -1
+ autogen-5.18.4
+
+ ntpd/invoke-ntp.keys.texi@1.145 +1 -1
+ autogen-5.18.4
+
+ ntpd/invoke-ntpd.texi@1.461 +3 -3
+ autogen-5.18.4
+
+ ntpd/ntp.conf.5man@1.181 +3 -32
+ autogen-5.18.4
+
+ ntpd/ntp.conf.5mdoc@1.181 +3 -21
+ autogen-5.18.4
+
+ ntpd/ntp.conf.man.in@1.181 +3 -32
+ autogen-5.18.4
+
+ ntpd/ntp.conf.mdoc.in@1.181 +3 -21
+ autogen-5.18.4
+
+ ntpd/ntp.keys.5man@1.179 +2 -21
+ autogen-5.18.4
+
+ ntpd/ntp.keys.5mdoc@1.179 +4 -22
+ autogen-5.18.4
+
+ ntpd/ntp.keys.man.in@1.179 +2 -21
+ autogen-5.18.4
+
+ ntpd/ntp.keys.mdoc.in@1.179 +4 -22
+ autogen-5.18.4
+
+ ntpd/ntpd-opts.c@1.482 +1 -1
+ autogen-5.18.4
+
+ ntpd/ntpd-opts.h@1.481 +1 -1
+ autogen-5.18.4
+
+ ntpd/ntpd.1ntpdman@1.290 +3 -32
+ autogen-5.18.4
+
+ ntpd/ntpd.1ntpdmdoc@1.290 +3 -21
+ autogen-5.18.4
+
+ ntpd/ntpd.man.in@1.290 +3 -32
+ autogen-5.18.4
+
+ ntpd/ntpd.mdoc.in@1.290 +3 -21
+ autogen-5.18.4
+
+ ntpdc/invoke-ntpdc.texi@1.459 +1 -1
+ autogen-5.18.4
+
+ ntpdc/ntpdc-opts.c@1.477 +1 -1
+ autogen-5.18.4
+
+ ntpdc/ntpdc-opts.h@1.476 +1 -1
+ autogen-5.18.4
+
+ ntpdc/ntpdc.1ntpdcman@1.290 +3 -32
+ autogen-5.18.4
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.290 +3 -21
+ autogen-5.18.4
+
+ ntpdc/ntpdc.html@1.303 +75 -55
+ autogen-5.18.4
+
+ ntpdc/ntpdc.man.in@1.290 +3 -32
+ autogen-5.18.4
+
+ ntpdc/ntpdc.mdoc.in@1.290 +3 -21
+ autogen-5.18.4
+
+ ntpq/invoke-ntpq.texi@1.465 +2 -2
+ autogen-5.18.4
+
+ ntpq/ntpq-opts.c@1.482 +1 -1
+ autogen-5.18.4
+
+ ntpq/ntpq-opts.h@1.480 +1 -1
+ autogen-5.18.4
+
+ ntpq/ntpq.1ntpqman@1.293 +4 -33
+ autogen-5.18.4
+
+ ntpq/ntpq.1ntpqmdoc@1.293 +4 -22
+ autogen-5.18.4
+
+ ntpq/ntpq.man.in@1.293 +4 -33
+ autogen-5.18.4
+
+ ntpq/ntpq.mdoc.in@1.293 +4 -22
+ autogen-5.18.4
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.461 +1 -1
+ autogen-5.18.4
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.479 +1 -1
+ autogen-5.18.4
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.478 +1 -1
+ autogen-5.18.4
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.290 +3 -32
+ autogen-5.18.4
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.290 +3 -21
+ autogen-5.18.4
+
+ ntpsnmpd/ntpsnmpd.man.in@1.290 +3 -32
+ autogen-5.18.4
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.290 +3 -21
+ autogen-5.18.4
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.9 +2 -2
+ autogen-5.18.4
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.52 +3 -32
+ autogen-5.18.4
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.52 +3 -21
+ autogen-5.18.4
+
+ scripts/calc_tickadj/calc_tickadj.html@1.54 +33 -21
+ autogen-5.18.4
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.51 +3 -32
+ autogen-5.18.4
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.52 +3 -21
+ autogen-5.18.4
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.56 +1 -1
+ autogen-5.18.4
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.282 +1 -1
+ autogen-5.18.4
+
+ scripts/ntp-wait/ntp-wait-opts@1.18 +1 -1
+ autogen-5.18.4
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.280 +3 -32
+ autogen-5.18.4
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.280 +3 -21
+ autogen-5.18.4
+
+ scripts/ntp-wait/ntp-wait.html@1.299 +47 -29
+ autogen-5.18.4
+
+ scripts/ntp-wait/ntp-wait.man.in@1.280 +3 -32
+ autogen-5.18.4
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.280 +3 -21
+ autogen-5.18.4
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.71 +1 -1
+ autogen-5.18.4
+
+ scripts/ntpsweep/ntpsweep-opts@1.20 +1 -1
+ autogen-5.18.4
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.59 +3 -32
+ autogen-5.18.4
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.59 +3 -21
+ autogen-5.18.4
+
+ scripts/ntpsweep/ntpsweep.html@1.72 +42 -31
+ autogen-5.18.4
+
+ scripts/ntpsweep/ntpsweep.man.in@1.59 +3 -32
+ autogen-5.18.4
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.60 +3 -21
+ autogen-5.18.4
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.71 +1 -1
+ autogen-5.18.4
+
+ scripts/ntptrace/ntptrace-opts@1.20 +1 -1
+ autogen-5.18.4
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.59 +3 -32
+ autogen-5.18.4
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.59 +3 -21
+ autogen-5.18.4
+
+ scripts/ntptrace/ntptrace.html@1.72 +34 -25
+ autogen-5.18.4
+
+ scripts/ntptrace/ntptrace.man.in@1.59 +3 -32
+ autogen-5.18.4
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.60 +3 -21
+ autogen-5.18.4
+
+ scripts/plot_summary.1plot_summaryman@1.71 +2 -32
+ autogen-5.18.4
+
+ scripts/plot_summary.1plot_summarymdoc@1.71 +2 -21
+ autogen-5.18.4
+
+ scripts/plot_summary.html@1.74 +45 -27
+ autogen-5.18.4
+
+ scripts/plot_summary.man.in@1.71 +2 -32
+ autogen-5.18.4
+
+ scripts/plot_summary.mdoc.in@1.71 +2 -21
+ autogen-5.18.4
+
+ scripts/summary.1summaryman@1.71 +2 -31
+ autogen-5.18.4
+
+ scripts/summary.1summarymdoc@1.71 +2 -20
+ autogen-5.18.4
+
+ scripts/summary.html@1.74 +37 -25
+ autogen-5.18.4
+
+ scripts/summary.man.in@1.71 +2 -31
+ autogen-5.18.4
+
+ scripts/summary.mdoc.in@1.71 +2 -20
+ autogen-5.18.4
+
+ sntp/include/autogen-version.def@1.21 +2 -2
+ autogen-5.18.4
+
+ sntp/invoke-sntp.texi@1.458 +1 -1
+ autogen-5.18.4
+
+ sntp/sntp-opts.c@1.476 +1 -1
+ autogen-5.18.4
+
+ sntp/sntp-opts.h@1.475 +1 -1
+ autogen-5.18.4
+
+ sntp/sntp.1sntpman@1.293 +3 -32
+ autogen-5.18.4
+
+ sntp/sntp.1sntpmdoc@1.293 +3 -21
+ autogen-5.18.4
+
+ sntp/sntp.html@1.473 +107 -83
+ autogen-5.18.4
+
+ sntp/sntp.man.in@1.293 +3 -32
+ autogen-5.18.4
+
+ sntp/sntp.mdoc.in@1.293 +3 -21
+ autogen-5.18.4
+
+ util/invoke-ntp-keygen.texi@1.462 +1 -1
+ autogen-5.18.4
+
+ util/ntp-keygen-opts.c@1.479 +1 -1
+ autogen-5.18.4
+
+ util/ntp-keygen-opts.h@1.478 +1 -1
+ autogen-5.18.4
+
+ util/ntp-keygen.1ntp-keygenman@1.290 +3 -32
+ autogen-5.18.4
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.290 +3 -21
+ autogen-5.18.4
+
+ util/ntp-keygen.man.in@1.290 +3 -32
+ autogen-5.18.4
+
+ util/ntp-keygen.mdoc.in@1.290 +3 -21
+ autogen-5.18.4
+
+ChangeSet@1.3199, 2014-08-31 04:47:39+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2556] ntpq man page cleanup
+
+ ChangeLog@1.1536 +1 -0
+ [Bug 2556] ntpq man page cleanup
+
+ ntpq/ntpq-opts.def@1.23 +1 -1
+ [Bug 2556] ntpq man page cleanup
+
+ChangeSet@1.3198, 2014-08-28 08:58:35+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P467
+ TAG: NTP_4_2_7P467
+
+ ChangeLog@1.1535 +1 -0
+ NTP_4_2_7P467
+
+ ntpd/invoke-ntp.conf.texi@1.146 +1 -1
+ NTP_4_2_7P467
+
+ ntpd/invoke-ntp.keys.texi@1.144 +1 -1
+ NTP_4_2_7P467
+
+ ntpd/invoke-ntpd.texi@1.460 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntp.conf.5man@1.180 +6 -6
+ NTP_4_2_7P467
+
+ ntpd/ntp.conf.5mdoc@1.180 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntp.conf.html@1.141 +1 -1
+ NTP_4_2_7P467
+
+ ntpd/ntp.conf.man.in@1.180 +6 -6
+ NTP_4_2_7P467
+
+ ntpd/ntp.conf.mdoc.in@1.180 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntp.keys.5man@1.178 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntp.keys.5mdoc@1.178 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntp.keys.html@1.142 +1 -1
+ NTP_4_2_7P467
+
+ ntpd/ntp.keys.man.in@1.178 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntp.keys.mdoc.in@1.178 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntpd-opts.c@1.481 +7 -7
+ NTP_4_2_7P467
+
+ ntpd/ntpd-opts.h@1.480 +3 -3
+ NTP_4_2_7P467
+
+ ntpd/ntpd.1ntpdman@1.289 +6 -6
+ NTP_4_2_7P467
+
+ ntpd/ntpd.1ntpdmdoc@1.289 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntpd.html@1.136 +2 -2
+ NTP_4_2_7P467
+
+ ntpd/ntpd.man.in@1.289 +6 -6
+ NTP_4_2_7P467
+
+ ntpd/ntpd.mdoc.in@1.289 +2 -2
+ NTP_4_2_7P467
+
+ ntpdc/invoke-ntpdc.texi@1.458 +2 -2
+ NTP_4_2_7P467
+
+ ntpdc/ntpdc-opts.c@1.476 +7 -7
+ NTP_4_2_7P467
+
+ ntpdc/ntpdc-opts.h@1.475 +3 -3
+ NTP_4_2_7P467
+
+ ntpdc/ntpdc.1ntpdcman@1.289 +6 -6
+ NTP_4_2_7P467
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.289 +2 -2
+ NTP_4_2_7P467
+
+ ntpdc/ntpdc.html@1.302 +2 -2
+ NTP_4_2_7P467
+
+ ntpdc/ntpdc.man.in@1.289 +6 -6
+ NTP_4_2_7P467
+
+ ntpdc/ntpdc.mdoc.in@1.289 +2 -2
+ NTP_4_2_7P467
+
+ ntpq/invoke-ntpq.texi@1.464 +2 -2
+ NTP_4_2_7P467
+
+ ntpq/ntpq-opts.c@1.481 +7 -7
+ NTP_4_2_7P467
+
+ ntpq/ntpq-opts.h@1.479 +3 -3
+ NTP_4_2_7P467
+
+ ntpq/ntpq.1ntpqman@1.292 +6 -6
+ NTP_4_2_7P467
+
+ ntpq/ntpq.1ntpqmdoc@1.292 +2 -2
+ NTP_4_2_7P467
+
+ ntpq/ntpq.html@1.133 +2 -2
+ NTP_4_2_7P467
+
+ ntpq/ntpq.man.in@1.292 +6 -6
+ NTP_4_2_7P467
+
+ ntpq/ntpq.mdoc.in@1.292 +2 -2
+ NTP_4_2_7P467
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.460 +2 -2
+ NTP_4_2_7P467
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.478 +7 -7
+ NTP_4_2_7P467
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.477 +3 -3
+ NTP_4_2_7P467
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.289 +6 -6
+ NTP_4_2_7P467
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.289 +2 -2
+ NTP_4_2_7P467
+
+ ntpsnmpd/ntpsnmpd.html@1.131 +1 -1
+ NTP_4_2_7P467
+
+ ntpsnmpd/ntpsnmpd.man.in@1.289 +6 -6
+ NTP_4_2_7P467
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.289 +2 -2
+ NTP_4_2_7P467
+
+ packageinfo.sh@1.471 +1 -1
+ NTP_4_2_7P467
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.51 +6 -6
+ NTP_4_2_7P467
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.51 +2 -2
+ NTP_4_2_7P467
+
+ scripts/calc_tickadj/calc_tickadj.html@1.53 +1 -1
+ NTP_4_2_7P467
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.50 +6 -6
+ NTP_4_2_7P467
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P467
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.55 +1 -1
+ NTP_4_2_7P467
+
+ scripts/invoke-plot_summary.texi@1.73 +1 -1
+ NTP_4_2_7P467
+
+ scripts/invoke-summary.texi@1.73 +1 -1
+ NTP_4_2_7P467
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.281 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntp-wait/ntp-wait-opts@1.17 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.279 +6 -6
+ NTP_4_2_7P467
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.279 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntp-wait/ntp-wait.html@1.298 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntp-wait/ntp-wait.man.in@1.279 +6 -6
+ NTP_4_2_7P467
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.279 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.70 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntpsweep/ntpsweep-opts@1.19 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.58 +6 -6
+ NTP_4_2_7P467
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.58 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntpsweep/ntpsweep.html@1.71 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntpsweep/ntpsweep.man.in@1.58 +6 -6
+ NTP_4_2_7P467
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.70 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntptrace/ntptrace-opts@1.19 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.58 +6 -6
+ NTP_4_2_7P467
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.58 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntptrace/ntptrace.html@1.71 +2 -2
+ NTP_4_2_7P467
+
+ scripts/ntptrace/ntptrace.man.in@1.58 +6 -6
+ NTP_4_2_7P467
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P467
+
+ scripts/plot_summary-opts@1.20 +1 -1
+ NTP_4_2_7P467
+
+ scripts/plot_summary.1plot_summaryman@1.70 +4 -4
+ NTP_4_2_7P467
+
+ scripts/plot_summary.1plot_summarymdoc@1.70 +1 -1
+ NTP_4_2_7P467
+
+ scripts/plot_summary.html@1.73 +2 -2
+ NTP_4_2_7P467
+
+ scripts/plot_summary.man.in@1.70 +4 -4
+ NTP_4_2_7P467
+
+ scripts/plot_summary.mdoc.in@1.70 +1 -1
+ NTP_4_2_7P467
+
+ scripts/summary-opts@1.20 +1 -1
+ NTP_4_2_7P467
+
+ scripts/summary.1summaryman@1.70 +4 -4
+ NTP_4_2_7P467
+
+ scripts/summary.1summarymdoc@1.70 +1 -1
+ NTP_4_2_7P467
+
+ scripts/summary.html@1.73 +2 -2
+ NTP_4_2_7P467
+
+ scripts/summary.man.in@1.70 +4 -4
+ NTP_4_2_7P467
+
+ scripts/summary.mdoc.in@1.70 +1 -1
+ NTP_4_2_7P467
+
+ sntp/invoke-sntp.texi@1.457 +2 -2
+ NTP_4_2_7P467
+
+ sntp/sntp-opts.c@1.475 +7 -7
+ NTP_4_2_7P467
+
+ sntp/sntp-opts.h@1.474 +3 -3
+ NTP_4_2_7P467
+
+ sntp/sntp.1sntpman@1.292 +6 -6
+ NTP_4_2_7P467
+
+ sntp/sntp.1sntpmdoc@1.292 +2 -2
+ NTP_4_2_7P467
+
+ sntp/sntp.html@1.472 +2 -2
+ NTP_4_2_7P467
+
+ sntp/sntp.man.in@1.292 +6 -6
+ NTP_4_2_7P467
+
+ sntp/sntp.mdoc.in@1.292 +2 -2
+ NTP_4_2_7P467
+
+ util/invoke-ntp-keygen.texi@1.461 +2 -2
+ NTP_4_2_7P467
+
+ util/ntp-keygen-opts.c@1.478 +7 -7
+ NTP_4_2_7P467
+
+ util/ntp-keygen-opts.h@1.477 +3 -3
+ NTP_4_2_7P467
+
+ util/ntp-keygen.1ntp-keygenman@1.289 +6 -6
+ NTP_4_2_7P467
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.289 +2 -2
+ NTP_4_2_7P467
+
+ util/ntp-keygen.html@1.137 +2 -2
+ NTP_4_2_7P467
+
+ util/ntp-keygen.man.in@1.289 +6 -6
+ NTP_4_2_7P467
+
+ util/ntp-keygen.mdoc.in@1.289 +2 -2
+ NTP_4_2_7P467
+
+ChangeSet@1.3197, 2014-08-28 03:33:02-04:00, stenn@deacon.udel.edu
+ [Bug 2640] STA_NANO can result in invalid ntv.constant
+
+ ChangeLog@1.1534 +1 -0
+ [Bug 2640] STA_NANO can result in invalid ntv.constant
+
+ ntpd/ntp_loopfilter.c@1.172 +3 -0
+ [Bug 2640] STA_NANO can result in invalid ntv.constant
+
+ChangeSet@1.3196, 2014-08-28 07:13:56+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2639] Check return value of ntp_adjtime()
+
+ ChangeLog@1.1533 +1 -0
+ [Bug 2639] Check return value of ntp_adjtime()
+
+ ntpd/ntp_loopfilter.c@1.171 +24 -6
+ [Bug 2639] Check return value of ntp_adjtime()
+
+ChangeSet@1.3195, 2014-08-27 08:59:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P466
+ TAG: NTP_4_2_7P466
+
+ ChangeLog@1.1532 +1 -0
+ NTP_4_2_7P466
+
+ ntpd/invoke-ntp.conf.texi@1.145 +1 -1
+ NTP_4_2_7P466
+
+ ntpd/invoke-ntp.keys.texi@1.143 +1 -1
+ NTP_4_2_7P466
+
+ ntpd/invoke-ntpd.texi@1.459 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntp.conf.5man@1.179 +6 -6
+ NTP_4_2_7P466
+
+ ntpd/ntp.conf.5mdoc@1.179 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntp.conf.html@1.140 +1 -1
+ NTP_4_2_7P466
+
+ ntpd/ntp.conf.man.in@1.179 +6 -6
+ NTP_4_2_7P466
+
+ ntpd/ntp.conf.mdoc.in@1.179 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntp.keys.5man@1.177 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntp.keys.5mdoc@1.177 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntp.keys.html@1.141 +1 -1
+ NTP_4_2_7P466
+
+ ntpd/ntp.keys.man.in@1.177 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntp.keys.mdoc.in@1.177 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntpd-opts.c@1.480 +7 -7
+ NTP_4_2_7P466
+
+ ntpd/ntpd-opts.h@1.479 +3 -3
+ NTP_4_2_7P466
+
+ ntpd/ntpd.1ntpdman@1.288 +6 -6
+ NTP_4_2_7P466
+
+ ntpd/ntpd.1ntpdmdoc@1.288 +2 -2
+ NTP_4_2_7P466
+
+ ntpd/ntpd.html@1.135 +2 -4
+ NTP_4_2_7P466
+
+ ntpd/ntpd.man.in@1.288 +6 -6
+ NTP_4_2_7P466
+
+ ntpd/ntpd.mdoc.in@1.288 +2 -2
+ NTP_4_2_7P466
+
+ ntpdc/invoke-ntpdc.texi@1.457 +2 -2
+ NTP_4_2_7P466
+
+ ntpdc/ntpdc-opts.c@1.475 +7 -7
+ NTP_4_2_7P466
+
+ ntpdc/ntpdc-opts.h@1.474 +3 -3
+ NTP_4_2_7P466
+
+ ntpdc/ntpdc.1ntpdcman@1.288 +6 -6
+ NTP_4_2_7P466
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.288 +2 -2
+ NTP_4_2_7P466
+
+ ntpdc/ntpdc.html@1.301 +2 -2
+ NTP_4_2_7P466
+
+ ntpdc/ntpdc.man.in@1.288 +6 -6
+ NTP_4_2_7P466
+
+ ntpdc/ntpdc.mdoc.in@1.288 +2 -2
+ NTP_4_2_7P466
+
+ ntpq/invoke-ntpq.texi@1.463 +2 -2
+ NTP_4_2_7P466
+
+ ntpq/ntpq-opts.c@1.480 +7 -7
+ NTP_4_2_7P466
+
+ ntpq/ntpq-opts.h@1.478 +3 -3
+ NTP_4_2_7P466
+
+ ntpq/ntpq.1ntpqman@1.291 +6 -6
+ NTP_4_2_7P466
+
+ ntpq/ntpq.1ntpqmdoc@1.291 +2 -2
+ NTP_4_2_7P466
+
+ ntpq/ntpq.html@1.132 +2 -4
+ NTP_4_2_7P466
+
+ ntpq/ntpq.man.in@1.291 +6 -6
+ NTP_4_2_7P466
+
+ ntpq/ntpq.mdoc.in@1.291 +2 -2
+ NTP_4_2_7P466
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.459 +2 -2
+ NTP_4_2_7P466
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.477 +7 -7
+ NTP_4_2_7P466
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.476 +3 -3
+ NTP_4_2_7P466
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.288 +6 -6
+ NTP_4_2_7P466
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.288 +2 -2
+ NTP_4_2_7P466
+
+ ntpsnmpd/ntpsnmpd.html@1.130 +1 -1
+ NTP_4_2_7P466
+
+ ntpsnmpd/ntpsnmpd.man.in@1.288 +6 -6
+ NTP_4_2_7P466
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.288 +2 -2
+ NTP_4_2_7P466
+
+ packageinfo.sh@1.470 +1 -1
+ NTP_4_2_7P466
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.50 +6 -6
+ NTP_4_2_7P466
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.50 +2 -2
+ NTP_4_2_7P466
+
+ scripts/calc_tickadj/calc_tickadj.html@1.52 +1 -1
+ NTP_4_2_7P466
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.49 +6 -6
+ NTP_4_2_7P466
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P466
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.54 +1 -1
+ NTP_4_2_7P466
+
+ scripts/invoke-plot_summary.texi@1.72 +1 -1
+ NTP_4_2_7P466
+
+ scripts/invoke-summary.texi@1.72 +1 -1
+ NTP_4_2_7P466
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.280 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntp-wait/ntp-wait-opts@1.16 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.278 +6 -6
+ NTP_4_2_7P466
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.278 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntp-wait/ntp-wait.html@1.297 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntp-wait/ntp-wait.man.in@1.278 +6 -6
+ NTP_4_2_7P466
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.278 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.69 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntpsweep/ntpsweep-opts@1.18 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.57 +6 -6
+ NTP_4_2_7P466
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.57 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntpsweep/ntpsweep.html@1.70 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntpsweep/ntpsweep.man.in@1.57 +6 -6
+ NTP_4_2_7P466
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.69 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntptrace/ntptrace-opts@1.18 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.57 +6 -6
+ NTP_4_2_7P466
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.57 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntptrace/ntptrace.html@1.70 +2 -2
+ NTP_4_2_7P466
+
+ scripts/ntptrace/ntptrace.man.in@1.57 +6 -6
+ NTP_4_2_7P466
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P466
+
+ scripts/plot_summary-opts@1.19 +1 -1
+ NTP_4_2_7P466
+
+ scripts/plot_summary.1plot_summaryman@1.69 +4 -4
+ NTP_4_2_7P466
+
+ scripts/plot_summary.1plot_summarymdoc@1.69 +1 -1
+ NTP_4_2_7P466
+
+ scripts/plot_summary.html@1.72 +2 -2
+ NTP_4_2_7P466
+
+ scripts/plot_summary.man.in@1.69 +4 -4
+ NTP_4_2_7P466
+
+ scripts/plot_summary.mdoc.in@1.69 +1 -1
+ NTP_4_2_7P466
+
+ scripts/summary-opts@1.19 +1 -1
+ NTP_4_2_7P466
+
+ scripts/summary.1summaryman@1.69 +4 -4
+ NTP_4_2_7P466
+
+ scripts/summary.1summarymdoc@1.69 +1 -1
+ NTP_4_2_7P466
+
+ scripts/summary.html@1.72 +2 -2
+ NTP_4_2_7P466
+
+ scripts/summary.man.in@1.69 +4 -4
+ NTP_4_2_7P466
+
+ scripts/summary.mdoc.in@1.69 +1 -1
+ NTP_4_2_7P466
+
+ sntp/invoke-sntp.texi@1.456 +2 -2
+ NTP_4_2_7P466
+
+ sntp/sntp-opts.c@1.474 +7 -7
+ NTP_4_2_7P466
+
+ sntp/sntp-opts.h@1.473 +3 -3
+ NTP_4_2_7P466
+
+ sntp/sntp.1sntpman@1.291 +6 -6
+ NTP_4_2_7P466
+
+ sntp/sntp.1sntpmdoc@1.291 +2 -2
+ NTP_4_2_7P466
+
+ sntp/sntp.html@1.471 +2 -2
+ NTP_4_2_7P466
+
+ sntp/sntp.man.in@1.291 +6 -6
+ NTP_4_2_7P466
+
+ sntp/sntp.mdoc.in@1.291 +2 -2
+ NTP_4_2_7P466
+
+ util/invoke-ntp-keygen.texi@1.460 +2 -2
+ NTP_4_2_7P466
+
+ util/ntp-keygen-opts.c@1.477 +7 -7
+ NTP_4_2_7P466
+
+ util/ntp-keygen-opts.h@1.476 +3 -3
+ NTP_4_2_7P466
+
+ util/ntp-keygen.1ntp-keygenman@1.288 +6 -6
+ NTP_4_2_7P466
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.288 +2 -2
+ NTP_4_2_7P466
+
+ util/ntp-keygen.html@1.136 +2 -4
+ NTP_4_2_7P466
+
+ util/ntp-keygen.man.in@1.288 +6 -6
+ NTP_4_2_7P466
+
+ util/ntp-keygen.mdoc.in@1.288 +2 -2
+ NTP_4_2_7P466
+
+ChangeSet@1.3194, 2014-08-27 04:53:42+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ ChangeLog@1.1531 +1 -0
+
+ ntpd/ntpd.c@1.155 +10 -3
+
+ChangeSet@1.3193, 2014-08-23 08:59:05+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P465
+ TAG: NTP_4_2_7P465
+
+ ChangeLog@1.1530 +1 -0
+ NTP_4_2_7P465
+
+ ntpd/invoke-ntp.conf.texi@1.144 +1 -1
+ NTP_4_2_7P465
+
+ ntpd/invoke-ntp.keys.texi@1.142 +1 -1
+ NTP_4_2_7P465
+
+ ntpd/invoke-ntpd.texi@1.458 +2 -4
+ NTP_4_2_7P465
+
+ ntpd/ntp.conf.5man@1.178 +6 -6
+ NTP_4_2_7P465
+
+ ntpd/ntp.conf.5mdoc@1.178 +2 -2
+ NTP_4_2_7P465
+
+ ntpd/ntp.conf.html@1.139 +1 -1
+ NTP_4_2_7P465
+
+ ntpd/ntp.conf.man.in@1.178 +6 -6
+ NTP_4_2_7P465
+
+ ntpd/ntp.conf.mdoc.in@1.178 +2 -2
+ NTP_4_2_7P465
+
+ ntpd/ntp.keys.5man@1.176 +2 -2
+ NTP_4_2_7P465
+
+ ntpd/ntp.keys.5mdoc@1.176 +2 -2
+ NTP_4_2_7P465
+
+ ntpd/ntp.keys.html@1.140 +1 -1
+ NTP_4_2_7P465
+
+ ntpd/ntp.keys.man.in@1.176 +2 -2
+ NTP_4_2_7P465
+
+ ntpd/ntp.keys.mdoc.in@1.176 +2 -2
+ NTP_4_2_7P465
+
+ ntpd/ntpd-opts.c@1.479 +7 -7
+ NTP_4_2_7P465
+
+ ntpd/ntpd-opts.h@1.478 +3 -3
+ NTP_4_2_7P465
+
+ ntpd/ntpd.1ntpdman@1.287 +22 -13
+ NTP_4_2_7P465
+
+ ntpd/ntpd.1ntpdmdoc@1.287 +18 -9
+ NTP_4_2_7P465
+
+ ntpd/ntpd.html@1.134 +2 -2
+ NTP_4_2_7P465
+
+ ntpd/ntpd.man.in@1.287 +22 -13
+ NTP_4_2_7P465
+
+ ntpd/ntpd.mdoc.in@1.287 +18 -9
+ NTP_4_2_7P465
+
+ ntpdc/invoke-ntpdc.texi@1.456 +2 -4
+ NTP_4_2_7P465
+
+ ntpdc/ntpdc-opts.c@1.474 +7 -7
+ NTP_4_2_7P465
+
+ ntpdc/ntpdc-opts.h@1.473 +3 -3
+ NTP_4_2_7P465
+
+ ntpdc/ntpdc.1ntpdcman@1.287 +6 -6
+ NTP_4_2_7P465
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.287 +2 -2
+ NTP_4_2_7P465
+
+ ntpdc/ntpdc.html@1.300 +2 -4
+ NTP_4_2_7P465
+
+ ntpdc/ntpdc.man.in@1.287 +6 -6
+ NTP_4_2_7P465
+
+ ntpdc/ntpdc.mdoc.in@1.287 +2 -2
+ NTP_4_2_7P465
+
+ ntpq/invoke-ntpq.texi@1.462 +2 -4
+ NTP_4_2_7P465
+
+ ntpq/ntpq-opts.c@1.479 +7 -7
+ NTP_4_2_7P465
+
+ ntpq/ntpq-opts.h@1.477 +3 -3
+ NTP_4_2_7P465
+
+ ntpq/ntpq.1ntpqman@1.290 +6 -6
+ NTP_4_2_7P465
+
+ ntpq/ntpq.1ntpqmdoc@1.290 +2 -2
+ NTP_4_2_7P465
+
+ ntpq/ntpq.html@1.131 +2 -2
+ NTP_4_2_7P465
+
+ ntpq/ntpq.man.in@1.290 +6 -6
+ NTP_4_2_7P465
+
+ ntpq/ntpq.mdoc.in@1.290 +2 -2
+ NTP_4_2_7P465
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.458 +2 -4
+ NTP_4_2_7P465
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.476 +7 -7
+ NTP_4_2_7P465
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.475 +3 -3
+ NTP_4_2_7P465
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.287 +6 -6
+ NTP_4_2_7P465
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.287 +2 -2
+ NTP_4_2_7P465
+
+ ntpsnmpd/ntpsnmpd.html@1.129 +1 -1
+ NTP_4_2_7P465
+
+ ntpsnmpd/ntpsnmpd.man.in@1.287 +6 -6
+ NTP_4_2_7P465
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.287 +2 -2
+ NTP_4_2_7P465
+
+ packageinfo.sh@1.469 +1 -1
+ NTP_4_2_7P465
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.49 +6 -6
+ NTP_4_2_7P465
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.49 +2 -2
+ NTP_4_2_7P465
+
+ scripts/calc_tickadj/calc_tickadj.html@1.51 +22 -34
+ NTP_4_2_7P465
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.48 +6 -6
+ NTP_4_2_7P465
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P465
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.53 +1 -1
+ NTP_4_2_7P465
+
+ scripts/invoke-plot_summary.texi@1.71 +1 -1
+ NTP_4_2_7P465
+
+ scripts/invoke-summary.texi@1.71 +1 -1
+ NTP_4_2_7P465
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.279 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntp-wait/ntp-wait-opts@1.15 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.277 +6 -6
+ NTP_4_2_7P465
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.277 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntp-wait/ntp-wait.html@1.296 +31 -49
+ NTP_4_2_7P465
+
+ scripts/ntp-wait/ntp-wait.man.in@1.277 +6 -6
+ NTP_4_2_7P465
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.277 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.68 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntpsweep/ntpsweep-opts@1.17 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.56 +6 -6
+ NTP_4_2_7P465
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.56 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntpsweep/ntpsweep.html@1.69 +33 -44
+ NTP_4_2_7P465
+
+ scripts/ntpsweep/ntpsweep.man.in@1.56 +6 -6
+ NTP_4_2_7P465
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.68 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntptrace/ntptrace-opts@1.17 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.56 +13 -13
+ NTP_4_2_7P465
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.56 +2 -2
+ NTP_4_2_7P465
+
+ scripts/ntptrace/ntptrace.html@1.69 +27 -36
+ NTP_4_2_7P465
+
+ scripts/ntptrace/ntptrace.man.in@1.56 +13 -13
+ NTP_4_2_7P465
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P465
+
+ scripts/plot_summary-opts@1.18 +1 -1
+ NTP_4_2_7P465
+
+ scripts/plot_summary.1plot_summaryman@1.68 +6 -6
+ NTP_4_2_7P465
+
+ scripts/plot_summary.1plot_summarymdoc@1.68 +3 -3
+ NTP_4_2_7P465
+
+ scripts/plot_summary.html@1.71 +29 -47
+ NTP_4_2_7P465
+
+ scripts/plot_summary.man.in@1.68 +6 -6
+ NTP_4_2_7P465
+
+ scripts/plot_summary.mdoc.in@1.68 +3 -3
+ NTP_4_2_7P465
+
+ scripts/summary-opts@1.18 +1 -1
+ NTP_4_2_7P465
+
+ scripts/summary.1summaryman@1.68 +6 -6
+ NTP_4_2_7P465
+
+ scripts/summary.1summarymdoc@1.68 +2 -2
+ NTP_4_2_7P465
+
+ scripts/summary.html@1.71 +27 -39
+ NTP_4_2_7P465
+
+ scripts/summary.man.in@1.68 +6 -6
+ NTP_4_2_7P465
+
+ scripts/summary.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P465
+
+ sntp/invoke-sntp.texi@1.455 +2 -4
+ NTP_4_2_7P465
+
+ sntp/sntp-opts.c@1.473 +7 -7
+ NTP_4_2_7P465
+
+ sntp/sntp-opts.h@1.472 +3 -3
+ NTP_4_2_7P465
+
+ sntp/sntp.1sntpman@1.290 +6 -6
+ NTP_4_2_7P465
+
+ sntp/sntp.1sntpmdoc@1.290 +2 -2
+ NTP_4_2_7P465
+
+ sntp/sntp.html@1.470 +2 -4
+ NTP_4_2_7P465
+
+ sntp/sntp.man.in@1.290 +6 -6
+ NTP_4_2_7P465
+
+ sntp/sntp.mdoc.in@1.290 +2 -2
+ NTP_4_2_7P465
+
+ util/invoke-ntp-keygen.texi@1.459 +2 -4
+ NTP_4_2_7P465
+
+ util/ntp-keygen-opts.c@1.476 +7 -7
+ NTP_4_2_7P465
+
+ util/ntp-keygen-opts.h@1.475 +3 -3
+ NTP_4_2_7P465
+
+ util/ntp-keygen.1ntp-keygenman@1.287 +6 -6
+ NTP_4_2_7P465
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.287 +2 -2
+ NTP_4_2_7P465
+
+ util/ntp-keygen.html@1.135 +2 -2
+ NTP_4_2_7P465
+
+ util/ntp-keygen.man.in@1.287 +6 -6
+ NTP_4_2_7P465
+
+ util/ntp-keygen.mdoc.in@1.287 +2 -2
+ NTP_4_2_7P465
+
+ChangeSet@1.3192, 2014-08-23 08:37:07+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2595] Man page quirks: ntpdate references in ntpd
+
+ ChangeLog@1.1529 +1 -0
+ [Bug 2595] Man page quirks: ntpdate references in ntpd
+
+ ntpd/ntpd-opts.def@1.12 +16 -7
+ [Bug 2595] Man page quirks: ntpdate references in ntpd
+
+ChangeSet@1.3191, 2014-08-23 05:39:03+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2613] www.ntp.org/bugs.html tells folks to email doc bugs to DLM
+
+ ChangeLog@1.1528 +1 -0
+ [Bug 2613] www.ntp.org/bugs.html tells folks to email doc bugs to DLM
+
+ html/bugs.html@1.8 +4 -7
+ [Bug 2613] www.ntp.org/bugs.html tells folks to email doc bugs to DLM
+
+ChangeSet@1.3190, 2014-08-23 00:23:55+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ChangeLog@1.1527 +1 -0
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpd/Makefile.am@1.131 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpd/ntpd-opts.c@1.478 +3 -60
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpd/ntpdbase-opts.def@1.27 +0 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpd/ntpdsim-opts.c@1.28 +9 -66
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpd/ntpdsim-opts.h@1.28 +2 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpdc/Makefile.am@1.75 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpdc/ntpdc-opts.c@1.473 +3 -60
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpdc/ntpdc-opts.def@1.23 +0 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpq/Makefile.am@1.71 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpq/ntpq-opts.c@1.478 +5 -69
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpq/ntpq-opts.def@1.22 +0 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpsnmpd/Makefile.am@1.40 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.475 +2 -44
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.11 +0 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/build/Makefile.am@1.4 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/calc_tickadj/Makefile.am@1.10 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.8 +2 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/calc_tickadj/calc_tickadj.html@1.50 +34 -22
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.52 +2 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/invoke-plot_summary.texi@1.70 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/invoke-summary.texi@1.70 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntp-wait/Makefile.am@1.9 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.278 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntp-wait/ntp-wait-opts@1.14 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntp-wait/ntp-wait-opts.def@1.11 +0 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntp-wait/ntp-wait.html@1.295 +47 -29
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntpsweep/Makefile.am@1.10 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.67 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntpsweep/ntpsweep-opts@1.16 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntpsweep/ntpsweep.html@1.68 +42 -31
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntptrace/Makefile.am@1.10 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.67 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntptrace/ntptrace-opts@1.16 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/ntptrace/ntptrace.html@1.68 +34 -25
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/plot_summary-opts@1.17 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/plot_summary.html@1.70 +45 -27
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/summary-opts@1.17 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ scripts/summary.html@1.70 +37 -25
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ sntp/Makefile.am@1.76 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ sntp/sntp-opts.c@1.472 +3 -61
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ sntp/sntp-opts.def@1.44 +0 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ util/Makefile.am@1.76 +1 -1
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ util/ntp-keygen-opts.c@1.475 +3 -60
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ util/ntp-keygen-opts.def@1.27 +0 -2
+ [Bug 2538] NTP programs print exit code in help/usage text
+
+ChangeSet@1.3189, 2014-08-22 22:14:11+02:00, jnperlin@hydra.(none)
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - log GPSD revision and release numbers with protocol version
+
+ ChangeLog@1.1526 +1 -0
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - log GPSD revision and release numbers with protocol version
+
+ ntpd/refclock_gpsdjson.c@1.14 +8 -1
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - log GPSD revision and release numbers with protocol version
+
+ChangeSet@1.3188, 2014-08-22 18:36:17+02:00, jnperlin@hydra.(none)
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - found (hopefully) last cause for clutter in protocol version
+
+ ChangeLog@1.1525 +2 -0
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - found (hopefully) last cause for clutter in protocol version
+
+
+ ntpd/refclock_gpsdjson.c@1.13 +12 -13
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - found (hopefully) last cause for clutter in protocol version
+
+
+ChangeSet@1.3187, 2014-08-22 08:58:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P464
+ TAG: NTP_4_2_7P464
+
+ ChangeLog@1.1524 +1 -0
+ NTP_4_2_7P464
+
+ ntpd/invoke-ntp.conf.texi@1.143 +1 -1
+ NTP_4_2_7P464
+
+ ntpd/invoke-ntp.keys.texi@1.141 +1 -1
+ NTP_4_2_7P464
+
+ ntpd/invoke-ntpd.texi@1.457 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntp.conf.5man@1.177 +6 -6
+ NTP_4_2_7P464
+
+ ntpd/ntp.conf.5mdoc@1.177 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntp.conf.html@1.138 +1 -1
+ NTP_4_2_7P464
+
+ ntpd/ntp.conf.man.in@1.177 +6 -6
+ NTP_4_2_7P464
+
+ ntpd/ntp.conf.mdoc.in@1.177 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntp.keys.5man@1.175 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntp.keys.5mdoc@1.175 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntp.keys.html@1.139 +1 -1
+ NTP_4_2_7P464
+
+ ntpd/ntp.keys.man.in@1.175 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntp.keys.mdoc.in@1.175 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntpd-opts.c@1.477 +6 -6
+ NTP_4_2_7P464
+
+ ntpd/ntpd-opts.h@1.477 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntpd.1ntpdman@1.286 +6 -6
+ NTP_4_2_7P464
+
+ ntpd/ntpd.1ntpdmdoc@1.286 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntpd.html@1.133 +2 -2
+ NTP_4_2_7P464
+
+ ntpd/ntpd.man.in@1.286 +6 -6
+ NTP_4_2_7P464
+
+ ntpd/ntpd.mdoc.in@1.286 +2 -2
+ NTP_4_2_7P464
+
+ ntpdc/invoke-ntpdc.texi@1.455 +2 -2
+ NTP_4_2_7P464
+
+ ntpdc/ntpdc-opts.c@1.472 +6 -6
+ NTP_4_2_7P464
+
+ ntpdc/ntpdc-opts.h@1.472 +2 -2
+ NTP_4_2_7P464
+
+ ntpdc/ntpdc.1ntpdcman@1.286 +6 -6
+ NTP_4_2_7P464
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.286 +2 -2
+ NTP_4_2_7P464
+
+ ntpdc/ntpdc.html@1.299 +2 -2
+ NTP_4_2_7P464
+
+ ntpdc/ntpdc.man.in@1.286 +6 -6
+ NTP_4_2_7P464
+
+ ntpdc/ntpdc.mdoc.in@1.286 +2 -2
+ NTP_4_2_7P464
+
+ ntpq/invoke-ntpq.texi@1.461 +2 -2
+ NTP_4_2_7P464
+
+ ntpq/ntpq-opts.c@1.477 +6 -6
+ NTP_4_2_7P464
+
+ ntpq/ntpq-opts.h@1.476 +2 -2
+ NTP_4_2_7P464
+
+ ntpq/ntpq.1ntpqman@1.289 +6 -6
+ NTP_4_2_7P464
+
+ ntpq/ntpq.1ntpqmdoc@1.289 +2 -2
+ NTP_4_2_7P464
+
+ ntpq/ntpq.html@1.130 +2 -2
+ NTP_4_2_7P464
+
+ ntpq/ntpq.man.in@1.289 +6 -6
+ NTP_4_2_7P464
+
+ ntpq/ntpq.mdoc.in@1.289 +2 -2
+ NTP_4_2_7P464
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.457 +2 -2
+ NTP_4_2_7P464
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.474 +6 -6
+ NTP_4_2_7P464
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.474 +2 -2
+ NTP_4_2_7P464
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.286 +6 -6
+ NTP_4_2_7P464
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.286 +2 -2
+ NTP_4_2_7P464
+
+ ntpsnmpd/ntpsnmpd.html@1.128 +1 -1
+ NTP_4_2_7P464
+
+ ntpsnmpd/ntpsnmpd.man.in@1.286 +6 -6
+ NTP_4_2_7P464
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.286 +2 -2
+ NTP_4_2_7P464
+
+ packageinfo.sh@1.468 +1 -1
+ NTP_4_2_7P464
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.48 +6 -6
+ NTP_4_2_7P464
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.48 +2 -2
+ NTP_4_2_7P464
+
+ scripts/calc_tickadj/calc_tickadj.html@1.49 +1 -1
+ NTP_4_2_7P464
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.47 +6 -6
+ NTP_4_2_7P464
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P464
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.51 +1 -1
+ NTP_4_2_7P464
+
+ scripts/invoke-plot_summary.texi@1.69 +2 -2
+ NTP_4_2_7P464
+
+ scripts/invoke-summary.texi@1.69 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.277 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntp-wait/ntp-wait-opts@1.13 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.276 +6 -6
+ NTP_4_2_7P464
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.276 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntp-wait/ntp-wait.html@1.294 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntp-wait/ntp-wait.man.in@1.276 +6 -6
+ NTP_4_2_7P464
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.276 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.66 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntpsweep/ntpsweep-opts@1.15 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.55 +6 -6
+ NTP_4_2_7P464
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.55 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntpsweep/ntpsweep.html@1.67 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntpsweep/ntpsweep.man.in@1.55 +6 -6
+ NTP_4_2_7P464
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.66 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntptrace/ntptrace-opts@1.15 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.55 +13 -13
+ NTP_4_2_7P464
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.55 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntptrace/ntptrace.html@1.67 +2 -2
+ NTP_4_2_7P464
+
+ scripts/ntptrace/ntptrace.man.in@1.55 +13 -13
+ NTP_4_2_7P464
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P464
+
+ scripts/plot_summary-opts@1.16 +2 -2
+ NTP_4_2_7P464
+
+ scripts/plot_summary.1plot_summaryman@1.67 +14 -14
+ NTP_4_2_7P464
+
+ scripts/plot_summary.1plot_summarymdoc@1.67 +3 -3
+ NTP_4_2_7P464
+
+ scripts/plot_summary.html@1.69 +2 -2
+ NTP_4_2_7P464
+
+ scripts/plot_summary.man.in@1.67 +14 -14
+ NTP_4_2_7P464
+
+ scripts/plot_summary.mdoc.in@1.67 +3 -3
+ NTP_4_2_7P464
+
+ scripts/summary-opts@1.16 +2 -2
+ NTP_4_2_7P464
+
+ scripts/summary.1summaryman@1.67 +6 -6
+ NTP_4_2_7P464
+
+ scripts/summary.1summarymdoc@1.67 +2 -2
+ NTP_4_2_7P464
+
+ scripts/summary.html@1.69 +2 -2
+ NTP_4_2_7P464
+
+ scripts/summary.man.in@1.67 +6 -6
+ NTP_4_2_7P464
+
+ scripts/summary.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P464
+
+ sntp/invoke-sntp.texi@1.454 +2 -2
+ NTP_4_2_7P464
+
+ sntp/sntp-opts.c@1.471 +6 -6
+ NTP_4_2_7P464
+
+ sntp/sntp-opts.h@1.471 +2 -2
+ NTP_4_2_7P464
+
+ sntp/sntp.1sntpman@1.289 +6 -6
+ NTP_4_2_7P464
+
+ sntp/sntp.1sntpmdoc@1.289 +2 -2
+ NTP_4_2_7P464
+
+ sntp/sntp.html@1.469 +2 -2
+ NTP_4_2_7P464
+
+ sntp/sntp.man.in@1.289 +6 -6
+ NTP_4_2_7P464
+
+ sntp/sntp.mdoc.in@1.289 +2 -2
+ NTP_4_2_7P464
+
+ util/invoke-ntp-keygen.texi@1.458 +2 -2
+ NTP_4_2_7P464
+
+ util/ntp-keygen-opts.c@1.474 +6 -6
+ NTP_4_2_7P464
+
+ util/ntp-keygen-opts.h@1.474 +2 -2
+ NTP_4_2_7P464
+
+ util/ntp-keygen.1ntp-keygenman@1.286 +6 -6
+ NTP_4_2_7P464
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.286 +2 -2
+ NTP_4_2_7P464
+
+ util/ntp-keygen.html@1.134 +2 -2
+ NTP_4_2_7P464
+
+ util/ntp-keygen.man.in@1.286 +6 -6
+ NTP_4_2_7P464
+
+ util/ntp-keygen.mdoc.in@1.286 +2 -2
+ NTP_4_2_7P464
+
+ChangeSet@1.3186, 2014-08-22 02:15:10-04:00, stenn@deacon.udel.edu
+ typos
+
+ ChangeLog@1.1523 +1 -1
+ typos
+
+ChangeSet@1.3185, 2014-08-21 21:40:54+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2636] Fix coverity warning from previous patch
+
+ ChangeLog@1.1522 +1 -0
+ [Bug 2636] Fix coverity warning from previous patch
+
+ChangeSet@1.3184, 2014-08-21 18:17:07+02:00, jnperlin@hydra.(none)
+ refclock_gpsdjson: Fix coverity warning. Did not cause a bug, but the code was not excatly as intented.
+
+ ntpd/refclock_gpsdjson.c@1.12 +11 -5
+ Fix coverity warning. Did not cause a bug, but the code was not excatly as intented.
+
+ChangeSet@1.3183, 2014-08-21 08:59:13+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P463
+ TAG: NTP_4_2_7P463
+
+ ChangeLog@1.1521 +1 -0
+ NTP_4_2_7P463
+
+ ntpd/invoke-ntp.conf.texi@1.142 +1 -1
+ NTP_4_2_7P463
+
+ ntpd/invoke-ntp.keys.texi@1.140 +1 -1
+ NTP_4_2_7P463
+
+ ntpd/invoke-ntpd.texi@1.456 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntp.conf.5man@1.176 +6 -6
+ NTP_4_2_7P463
+
+ ntpd/ntp.conf.5mdoc@1.176 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntp.conf.html@1.137 +1 -1
+ NTP_4_2_7P463
+
+ ntpd/ntp.conf.man.in@1.176 +6 -6
+ NTP_4_2_7P463
+
+ ntpd/ntp.conf.mdoc.in@1.176 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntp.keys.5man@1.174 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntp.keys.5mdoc@1.174 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntp.keys.html@1.138 +1 -1
+ NTP_4_2_7P463
+
+ ntpd/ntp.keys.man.in@1.174 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntp.keys.mdoc.in@1.174 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntpd-opts.c@1.476 +6 -6
+ NTP_4_2_7P463
+
+ ntpd/ntpd-opts.h@1.476 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntpd.1ntpdman@1.285 +6 -6
+ NTP_4_2_7P463
+
+ ntpd/ntpd.1ntpdmdoc@1.285 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntpd.html@1.132 +2 -2
+ NTP_4_2_7P463
+
+ ntpd/ntpd.man.in@1.285 +6 -6
+ NTP_4_2_7P463
+
+ ntpd/ntpd.mdoc.in@1.285 +2 -2
+ NTP_4_2_7P463
+
+ ntpdc/invoke-ntpdc.texi@1.454 +2 -2
+ NTP_4_2_7P463
+
+ ntpdc/ntpdc-opts.c@1.471 +6 -6
+ NTP_4_2_7P463
+
+ ntpdc/ntpdc-opts.h@1.471 +2 -2
+ NTP_4_2_7P463
+
+ ntpdc/ntpdc.1ntpdcman@1.285 +13 -13
+ NTP_4_2_7P463
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.285 +2 -2
+ NTP_4_2_7P463
+
+ ntpdc/ntpdc.html@1.298 +2 -2
+ NTP_4_2_7P463
+
+ ntpdc/ntpdc.man.in@1.285 +13 -13
+ NTP_4_2_7P463
+
+ ntpdc/ntpdc.mdoc.in@1.285 +2 -2
+ NTP_4_2_7P463
+
+ ntpq/invoke-ntpq.texi@1.460 +2 -2
+ NTP_4_2_7P463
+
+ ntpq/ntpq-opts.c@1.476 +6 -6
+ NTP_4_2_7P463
+
+ ntpq/ntpq-opts.h@1.475 +2 -2
+ NTP_4_2_7P463
+
+ ntpq/ntpq.1ntpqman@1.288 +6 -6
+ NTP_4_2_7P463
+
+ ntpq/ntpq.1ntpqmdoc@1.288 +2 -2
+ NTP_4_2_7P463
+
+ ntpq/ntpq.html@1.129 +2 -2
+ NTP_4_2_7P463
+
+ ntpq/ntpq.man.in@1.288 +6 -6
+ NTP_4_2_7P463
+
+ ntpq/ntpq.mdoc.in@1.288 +2 -2
+ NTP_4_2_7P463
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.456 +2 -2
+ NTP_4_2_7P463
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.473 +6 -6
+ NTP_4_2_7P463
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.473 +2 -2
+ NTP_4_2_7P463
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.285 +6 -6
+ NTP_4_2_7P463
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.285 +2 -2
+ NTP_4_2_7P463
+
+ ntpsnmpd/ntpsnmpd.html@1.127 +1 -1
+ NTP_4_2_7P463
+
+ ntpsnmpd/ntpsnmpd.man.in@1.285 +6 -6
+ NTP_4_2_7P463
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.285 +2 -2
+ NTP_4_2_7P463
+
+ packageinfo.sh@1.467 +1 -1
+ NTP_4_2_7P463
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.47 +6 -6
+ NTP_4_2_7P463
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.47 +2 -2
+ NTP_4_2_7P463
+
+ scripts/calc_tickadj/calc_tickadj.html@1.48 +1 -1
+ NTP_4_2_7P463
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.46 +6 -6
+ NTP_4_2_7P463
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P463
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.50 +1 -1
+ NTP_4_2_7P463
+
+ scripts/invoke-plot_summary.texi@1.68 +2 -2
+ NTP_4_2_7P463
+
+ scripts/invoke-summary.texi@1.68 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.276 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntp-wait/ntp-wait-opts@1.12 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.275 +6 -6
+ NTP_4_2_7P463
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.275 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntp-wait/ntp-wait.html@1.293 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntp-wait/ntp-wait.man.in@1.275 +6 -6
+ NTP_4_2_7P463
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.275 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.65 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntpsweep/ntpsweep-opts@1.14 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.54 +6 -6
+ NTP_4_2_7P463
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.54 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntpsweep/ntpsweep.html@1.66 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntpsweep/ntpsweep.man.in@1.54 +6 -6
+ NTP_4_2_7P463
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.65 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntptrace/ntptrace-opts@1.14 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.54 +6 -6
+ NTP_4_2_7P463
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.54 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntptrace/ntptrace.html@1.66 +2 -2
+ NTP_4_2_7P463
+
+ scripts/ntptrace/ntptrace.man.in@1.54 +6 -6
+ NTP_4_2_7P463
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P463
+
+ scripts/plot_summary-opts@1.15 +2 -2
+ NTP_4_2_7P463
+
+ scripts/plot_summary.1plot_summaryman@1.66 +14 -14
+ NTP_4_2_7P463
+
+ scripts/plot_summary.1plot_summarymdoc@1.66 +2 -2
+ NTP_4_2_7P463
+
+ scripts/plot_summary.html@1.68 +2 -2
+ NTP_4_2_7P463
+
+ scripts/plot_summary.man.in@1.66 +14 -14
+ NTP_4_2_7P463
+
+ scripts/plot_summary.mdoc.in@1.66 +2 -2
+ NTP_4_2_7P463
+
+ scripts/summary-opts@1.15 +2 -2
+ NTP_4_2_7P463
+
+ scripts/summary.1summaryman@1.66 +6 -6
+ NTP_4_2_7P463
+
+ scripts/summary.1summarymdoc@1.66 +2 -2
+ NTP_4_2_7P463
+
+ scripts/summary.html@1.68 +2 -2
+ NTP_4_2_7P463
+
+ scripts/summary.man.in@1.66 +6 -6
+ NTP_4_2_7P463
+
+ scripts/summary.mdoc.in@1.66 +2 -2
+ NTP_4_2_7P463
+
+ sntp/invoke-sntp.texi@1.453 +2 -2
+ NTP_4_2_7P463
+
+ sntp/sntp-opts.c@1.470 +6 -6
+ NTP_4_2_7P463
+
+ sntp/sntp-opts.h@1.470 +2 -2
+ NTP_4_2_7P463
+
+ sntp/sntp.1sntpman@1.288 +6 -6
+ NTP_4_2_7P463
+
+ sntp/sntp.1sntpmdoc@1.288 +2 -2
+ NTP_4_2_7P463
+
+ sntp/sntp.html@1.468 +2 -2
+ NTP_4_2_7P463
+
+ sntp/sntp.man.in@1.288 +6 -6
+ NTP_4_2_7P463
+
+ sntp/sntp.mdoc.in@1.288 +2 -2
+ NTP_4_2_7P463
+
+ util/invoke-ntp-keygen.texi@1.457 +2 -2
+ NTP_4_2_7P463
+
+ util/ntp-keygen-opts.c@1.473 +6 -6
+ NTP_4_2_7P463
+
+ util/ntp-keygen-opts.h@1.473 +2 -2
+ NTP_4_2_7P463
+
+ util/ntp-keygen.1ntp-keygenman@1.285 +6 -6
+ NTP_4_2_7P463
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.285 +2 -2
+ NTP_4_2_7P463
+
+ util/ntp-keygen.html@1.133 +2 -2
+ NTP_4_2_7P463
+
+ util/ntp-keygen.man.in@1.285 +6 -6
+ NTP_4_2_7P463
+
+ util/ntp-keygen.mdoc.in@1.285 +2 -2
+ NTP_4_2_7P463
+
+ChangeSet@1.3182, 2014-08-20 22:14:09+02:00, jnperlin@hydra.(none)
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - make driver work with PSD protocol versio 3.9
+ - use exponential back-off for connection problems
+ - implement rate-limit for syslog entries
+
+ ChangeLog@1.1520 +4 -0
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - make driver work with PSD protocol versio 3.9
+ - use exponential back-off for connection problems
+ - implement rate-limit for syslog entries
+
+ html/drivers/driver46.html@1.4 +102 -43
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - documentation update and extension
+
+ ntpd/refclock_gpsdjson.c@1.11 +125 -74
+ [Bug 2636] Clutter in syslog if gpsd not running
+ - make driver work with PSD protocol versio 3.9
+ - use exponential back-off for connection problems
+ - implement rate-limit for syslog entries
+
+ChangeSet@1.3181, 2014-08-19 22:39:42+02:00, jnperlin@hydra.(none)
+ [Bug 2636] reduce logging of recurrent/persistent errors to avoid syslog flooding;
+ adapt to protocol version 3.9 and nanosecond PPS precision.
+
+ html/drivers/driver46.html@1.3 +10 -3
+ [Bug 2636] describe fudge flags used for clock stats and log throttle
+
+ ntpd/refclock_gpsdjson.c@1.10 +271 -121
+ [Bug 2636] imlement log throttling, adapt to GPSD protoco verdion 3.9
+
+ChangeSet@1.3180, 2014-08-16 06:28:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P462
+ TAG: NTP_4_2_7P462
+
+ ChangeLog@1.1519 +1 -0
+ NTP_4_2_7P462
+
+ ntpd/invoke-ntp.conf.texi@1.141 +1 -1
+ NTP_4_2_7P462
+
+ ntpd/invoke-ntp.keys.texi@1.139 +1 -1
+ NTP_4_2_7P462
+
+ ntpd/invoke-ntpd.texi@1.455 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntp.conf.5man@1.175 +6 -6
+ NTP_4_2_7P462
+
+ ntpd/ntp.conf.5mdoc@1.175 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntp.conf.html@1.136 +1 -1
+ NTP_4_2_7P462
+
+ ntpd/ntp.conf.man.in@1.175 +6 -6
+ NTP_4_2_7P462
+
+ ntpd/ntp.conf.mdoc.in@1.175 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntp.keys.5man@1.173 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntp.keys.5mdoc@1.173 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntp.keys.html@1.137 +1 -1
+ NTP_4_2_7P462
+
+ ntpd/ntp.keys.man.in@1.173 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntp.keys.mdoc.in@1.173 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntpd-opts.c@1.475 +6 -6
+ NTP_4_2_7P462
+
+ ntpd/ntpd-opts.h@1.475 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntpd.1ntpdman@1.284 +6 -6
+ NTP_4_2_7P462
+
+ ntpd/ntpd.1ntpdmdoc@1.284 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntpd.html@1.131 +2 -2
+ NTP_4_2_7P462
+
+ ntpd/ntpd.man.in@1.284 +6 -6
+ NTP_4_2_7P462
+
+ ntpd/ntpd.mdoc.in@1.284 +2 -2
+ NTP_4_2_7P462
+
+ ntpdc/invoke-ntpdc.texi@1.453 +2 -2
+ NTP_4_2_7P462
+
+ ntpdc/ntpdc-opts.c@1.470 +6 -6
+ NTP_4_2_7P462
+
+ ntpdc/ntpdc-opts.h@1.470 +2 -2
+ NTP_4_2_7P462
+
+ ntpdc/ntpdc.1ntpdcman@1.284 +13 -13
+ NTP_4_2_7P462
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.284 +2 -2
+ NTP_4_2_7P462
+
+ ntpdc/ntpdc.html@1.297 +2 -2
+ NTP_4_2_7P462
+
+ ntpdc/ntpdc.man.in@1.284 +13 -13
+ NTP_4_2_7P462
+
+ ntpdc/ntpdc.mdoc.in@1.284 +2 -2
+ NTP_4_2_7P462
+
+ ntpq/invoke-ntpq.texi@1.459 +2 -2
+ NTP_4_2_7P462
+
+ ntpq/ntpq-opts.c@1.475 +6 -6
+ NTP_4_2_7P462
+
+ ntpq/ntpq-opts.h@1.474 +2 -2
+ NTP_4_2_7P462
+
+ ntpq/ntpq.1ntpqman@1.287 +6 -6
+ NTP_4_2_7P462
+
+ ntpq/ntpq.1ntpqmdoc@1.287 +2 -2
+ NTP_4_2_7P462
+
+ ntpq/ntpq.html@1.128 +2 -2
+ NTP_4_2_7P462
+
+ ntpq/ntpq.man.in@1.287 +6 -6
+ NTP_4_2_7P462
+
+ ntpq/ntpq.mdoc.in@1.287 +2 -2
+ NTP_4_2_7P462
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.455 +2 -2
+ NTP_4_2_7P462
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.472 +6 -6
+ NTP_4_2_7P462
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.472 +2 -2
+ NTP_4_2_7P462
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.284 +6 -6
+ NTP_4_2_7P462
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.284 +2 -2
+ NTP_4_2_7P462
+
+ ntpsnmpd/ntpsnmpd.html@1.126 +1 -1
+ NTP_4_2_7P462
+
+ ntpsnmpd/ntpsnmpd.man.in@1.284 +6 -6
+ NTP_4_2_7P462
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.284 +2 -2
+ NTP_4_2_7P462
+
+ packageinfo.sh@1.466 +1 -1
+ NTP_4_2_7P462
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.46 +6 -6
+ NTP_4_2_7P462
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.46 +2 -2
+ NTP_4_2_7P462
+
+ scripts/calc_tickadj/calc_tickadj.html@1.47 +1 -1
+ NTP_4_2_7P462
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.45 +6 -6
+ NTP_4_2_7P462
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P462
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.49 +1 -1
+ NTP_4_2_7P462
+
+ scripts/invoke-plot_summary.texi@1.67 +3 -3
+ NTP_4_2_7P462
+
+ scripts/invoke-summary.texi@1.67 +3 -3
+ NTP_4_2_7P462
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.275 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntp-wait/ntp-wait-opts@1.11 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.274 +6 -6
+ NTP_4_2_7P462
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.274 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntp-wait/ntp-wait.html@1.292 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntp-wait/ntp-wait.man.in@1.274 +6 -6
+ NTP_4_2_7P462
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.274 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.64 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntpsweep/ntpsweep-opts@1.13 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.53 +6 -6
+ NTP_4_2_7P462
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.53 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntpsweep/ntpsweep.html@1.65 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntpsweep/ntpsweep.man.in@1.53 +6 -6
+ NTP_4_2_7P462
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.64 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntptrace/ntptrace-opts@1.13 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.53 +6 -6
+ NTP_4_2_7P462
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.53 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntptrace/ntptrace.html@1.65 +2 -2
+ NTP_4_2_7P462
+
+ scripts/ntptrace/ntptrace.man.in@1.53 +6 -6
+ NTP_4_2_7P462
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P462
+
+ scripts/plot_summary-opts@1.14 +3 -3
+ NTP_4_2_7P462
+
+ scripts/plot_summary.1plot_summaryman@1.65 +6 -6
+ NTP_4_2_7P462
+
+ scripts/plot_summary.1plot_summarymdoc@1.65 +3 -3
+ NTP_4_2_7P462
+
+ scripts/plot_summary.html@1.67 +3 -3
+ NTP_4_2_7P462
+
+ scripts/plot_summary.man.in@1.65 +6 -6
+ NTP_4_2_7P462
+
+ scripts/plot_summary.mdoc.in@1.65 +3 -3
+ NTP_4_2_7P462
+
+ scripts/summary-opts@1.14 +2 -2
+ NTP_4_2_7P462
+
+ scripts/summary.1summaryman@1.65 +6 -6
+ NTP_4_2_7P462
+
+ scripts/summary.1summarymdoc@1.65 +3 -3
+ NTP_4_2_7P462
+
+ scripts/summary.html@1.67 +3 -3
+ NTP_4_2_7P462
+
+ scripts/summary.man.in@1.65 +6 -6
+ NTP_4_2_7P462
+
+ scripts/summary.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P462
+
+ sntp/invoke-sntp.texi@1.452 +2 -2
+ NTP_4_2_7P462
+
+ sntp/sntp-opts.c@1.469 +6 -6
+ NTP_4_2_7P462
+
+ sntp/sntp-opts.h@1.469 +2 -2
+ NTP_4_2_7P462
+
+ sntp/sntp.1sntpman@1.287 +6 -6
+ NTP_4_2_7P462
+
+ sntp/sntp.1sntpmdoc@1.287 +2 -2
+ NTP_4_2_7P462
+
+ sntp/sntp.html@1.467 +2 -2
+ NTP_4_2_7P462
+
+ sntp/sntp.man.in@1.287 +6 -6
+ NTP_4_2_7P462
+
+ sntp/sntp.mdoc.in@1.287 +2 -2
+ NTP_4_2_7P462
+
+ util/invoke-ntp-keygen.texi@1.456 +2 -2
+ NTP_4_2_7P462
+
+ util/ntp-keygen-opts.c@1.472 +6 -6
+ NTP_4_2_7P462
+
+ util/ntp-keygen-opts.h@1.472 +2 -2
+ NTP_4_2_7P462
+
+ util/ntp-keygen.1ntp-keygenman@1.284 +6 -6
+ NTP_4_2_7P462
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.284 +2 -2
+ NTP_4_2_7P462
+
+ util/ntp-keygen.html@1.132 +2 -2
+ NTP_4_2_7P462
+
+ util/ntp-keygen.man.in@1.284 +6 -6
+ NTP_4_2_7P462
+
+ util/ntp-keygen.mdoc.in@1.284 +2 -2
+ NTP_4_2_7P462
+
+ChangeSet@1.3177.1.5, 2014-08-14 09:32:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P461
+ TAG: NTP_4_2_7P461
+
+ ChangeLog@1.1516.1.5 +2 -0
+ NTP_4_2_7P461
+
+ ntpd/invoke-ntp.conf.texi@1.140 +1 -1
+ NTP_4_2_7P461
+
+ ntpd/invoke-ntp.keys.texi@1.138 +1 -1
+ NTP_4_2_7P461
+
+ ntpd/invoke-ntpd.texi@1.454 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntp.conf.5man@1.174 +6 -6
+ NTP_4_2_7P461
+
+ ntpd/ntp.conf.5mdoc@1.174 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntp.conf.html@1.135 +1 -1
+ NTP_4_2_7P461
+
+ ntpd/ntp.conf.man.in@1.174 +6 -6
+ NTP_4_2_7P461
+
+ ntpd/ntp.conf.mdoc.in@1.174 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntp.keys.5man@1.172 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntp.keys.5mdoc@1.172 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntp.keys.html@1.136 +1 -1
+ NTP_4_2_7P461
+
+ ntpd/ntp.keys.man.in@1.172 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntp.keys.mdoc.in@1.172 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntpd-opts.c@1.474 +6 -6
+ NTP_4_2_7P461
+
+ ntpd/ntpd-opts.h@1.474 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntpd.1ntpdman@1.283 +6 -6
+ NTP_4_2_7P461
+
+ ntpd/ntpd.1ntpdmdoc@1.283 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntpd.html@1.130 +2 -2
+ NTP_4_2_7P461
+
+ ntpd/ntpd.man.in@1.283 +6 -6
+ NTP_4_2_7P461
+
+ ntpd/ntpd.mdoc.in@1.283 +2 -2
+ NTP_4_2_7P461
+
+ ntpdc/invoke-ntpdc.texi@1.452 +2 -2
+ NTP_4_2_7P461
+
+ ntpdc/ntpdc-opts.c@1.469 +6 -6
+ NTP_4_2_7P461
+
+ ntpdc/ntpdc-opts.h@1.469 +2 -2
+ NTP_4_2_7P461
+
+ ntpdc/ntpdc.1ntpdcman@1.283 +6 -6
+ NTP_4_2_7P461
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.283 +2 -2
+ NTP_4_2_7P461
+
+ ntpdc/ntpdc.html@1.296 +2 -2
+ NTP_4_2_7P461
+
+ ntpdc/ntpdc.man.in@1.283 +6 -6
+ NTP_4_2_7P461
+
+ ntpdc/ntpdc.mdoc.in@1.283 +2 -2
+ NTP_4_2_7P461
+
+ ntpq/invoke-ntpq.texi@1.458 +2 -2
+ NTP_4_2_7P461
+
+ ntpq/ntpq-opts.c@1.474 +6 -6
+ NTP_4_2_7P461
+
+ ntpq/ntpq-opts.h@1.473 +2 -2
+ NTP_4_2_7P461
+
+ ntpq/ntpq.1ntpqman@1.286 +32 -3
+ NTP_4_2_7P461
+
+ ntpq/ntpq.1ntpqmdoc@1.286 +20 -1
+ NTP_4_2_7P461
+
+ ntpq/ntpq.html@1.127 +63 -41
+ NTP_4_2_7P461
+
+ ntpq/ntpq.man.in@1.286 +32 -3
+ NTP_4_2_7P461
+
+ ntpq/ntpq.mdoc.in@1.286 +20 -1
+ NTP_4_2_7P461
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.454 +2 -2
+ NTP_4_2_7P461
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.471 +6 -6
+ NTP_4_2_7P461
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.471 +2 -2
+ NTP_4_2_7P461
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.283 +6 -6
+ NTP_4_2_7P461
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.283 +2 -2
+ NTP_4_2_7P461
+
+ ntpsnmpd/ntpsnmpd.html@1.125 +1 -1
+ NTP_4_2_7P461
+
+ ntpsnmpd/ntpsnmpd.man.in@1.283 +6 -6
+ NTP_4_2_7P461
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.283 +2 -2
+ NTP_4_2_7P461
+
+ packageinfo.sh@1.465 +1 -1
+ NTP_4_2_7P461
+
+ scripts/Makefile.am@1.38 +1 -0
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.45 +6 -6
+ NTP_4_2_7P461
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.45 +2 -2
+ NTP_4_2_7P461
+
+ scripts/calc_tickadj/calc_tickadj.html@1.46 +1 -1
+ NTP_4_2_7P461
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.44 +6 -6
+ NTP_4_2_7P461
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P461
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.48 +1 -1
+ NTP_4_2_7P461
+
+ scripts/invoke-plot_summary.texi@1.66 +1 -1
+ NTP_4_2_7P461
+
+ scripts/invoke-plot_summary.texi@1.65 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/invoke-summary.texi@1.66 +1 -1
+ NTP_4_2_7P461
+
+ scripts/invoke-summary.texi@1.65 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntp-wait/Makefile.am@1.8 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.274 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntp-wait/ntp-wait-opts@1.10 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.273 +6 -6
+ NTP_4_2_7P461
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.273 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntp-wait/ntp-wait.html@1.291 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntp-wait/ntp-wait.man.in@1.273 +6 -6
+ NTP_4_2_7P461
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.273 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntpsweep/Makefile.am@1.9 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.63 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntpsweep/ntpsweep-opts@1.12 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.52 +13 -13
+ NTP_4_2_7P461
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.52 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntpsweep/ntpsweep.html@1.64 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntpsweep/ntpsweep.man.in@1.52 +13 -13
+ NTP_4_2_7P461
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntptrace/Makefile.am@1.9 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.63 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntptrace/ntptrace-opts@1.12 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.52 +6 -6
+ NTP_4_2_7P461
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.52 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntptrace/ntptrace.html@1.64 +2 -2
+ NTP_4_2_7P461
+
+ scripts/ntptrace/ntptrace.man.in@1.52 +6 -6
+ NTP_4_2_7P461
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P461
+
+ scripts/plot_summary-opts@1.13 +1 -1
+ NTP_4_2_7P461
+
+ scripts/plot_summary-opts@1.12 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/plot_summary.1plot_summaryman@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/plot_summary.1plot_summaryman@1.63 +6 -6
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/plot_summary.1plot_summarymdoc@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/plot_summary.1plot_summarymdoc@1.63 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/plot_summary.html@1.66 +1 -1
+ NTP_4_2_7P461
+
+ scripts/plot_summary.html@1.65 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/plot_summary.man.in@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/plot_summary.man.in@1.63 +6 -6
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/plot_summary.mdoc.in@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/plot_summary.mdoc.in@1.63 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary-opts@1.13 +1 -1
+ NTP_4_2_7P461
+
+ scripts/summary-opts@1.12 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary.1summaryman@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/summary.1summaryman@1.63 +6 -6
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary.1summarymdoc@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/summary.1summarymdoc@1.63 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary.html@1.66 +1 -1
+ NTP_4_2_7P461
+
+ scripts/summary.html@1.65 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary.man.in@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/summary.man.in@1.63 +6 -6
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary.mdoc.in@1.64 +1 -1
+ NTP_4_2_7P461
+
+ scripts/summary.mdoc.in@1.63 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ sntp/invoke-sntp.texi@1.451 +2 -2
+ NTP_4_2_7P461
+
+ sntp/sntp-opts.c@1.468 +6 -6
+ NTP_4_2_7P461
+
+ sntp/sntp-opts.h@1.468 +2 -2
+ NTP_4_2_7P461
+
+ sntp/sntp.1sntpman@1.286 +6 -6
+ NTP_4_2_7P461
+
+ sntp/sntp.1sntpmdoc@1.286 +2 -2
+ NTP_4_2_7P461
+
+ sntp/sntp.html@1.466 +2 -2
+ NTP_4_2_7P461
+
+ sntp/sntp.man.in@1.286 +6 -6
+ NTP_4_2_7P461
+
+ sntp/sntp.mdoc.in@1.286 +2 -2
+ NTP_4_2_7P461
+
+ util/invoke-ntp-keygen.texi@1.455 +2 -2
+ NTP_4_2_7P461
+
+ util/ntp-keygen-opts.c@1.471 +6 -6
+ NTP_4_2_7P461
+
+ util/ntp-keygen-opts.h@1.471 +2 -2
+ NTP_4_2_7P461
+
+ util/ntp-keygen.1ntp-keygenman@1.283 +6 -6
+ NTP_4_2_7P461
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.283 +2 -2
+ NTP_4_2_7P461
+
+ util/ntp-keygen.html@1.131 +2 -2
+ NTP_4_2_7P461
+
+ util/ntp-keygen.man.in@1.283 +6 -6
+ NTP_4_2_7P461
+
+ util/ntp-keygen.mdoc.in@1.283 +2 -2
+ NTP_4_2_7P461
+
+ChangeSet@1.3177.1.4, 2014-08-14 08:27:49+00:00, stenn@psp-fb1.ntp.org
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ChangeLog@1.1516.1.4 +1 -0
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/invoke-ntpq.texi@1.457 +38 -23
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq-opts.c@1.473 +129 -99
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq-opts.def@1.21 +30 -14
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq-opts.h@1.472 +23 -16
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq-subs.c@1.100 +5 -1
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq.1ntpqman@1.285 +24 -41
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq.1ntpqmdoc@1.285 +22 -30
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq.c@1.152 +4 -0
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq.man.in@1.285 +24 -41
+ [Bug 1128] ntpq truncates "remote" host information
+
+ ntpq/ntpq.mdoc.in@1.285 +22 -30
+ [Bug 1128] ntpq truncates "remote" host information
+
+ChangeSet@1.3177.1.3, 2014-08-13 11:49:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P460
+ TAG: NTP_4_2_7P460
+
+ ChangeLog@1.1516.1.3 +1 -0
+ NTP_4_2_7P460
+
+ ntpd/invoke-ntp.conf.texi@1.139 +1 -1
+ NTP_4_2_7P460
+
+ ntpd/invoke-ntp.keys.texi@1.137 +1 -1
+ NTP_4_2_7P460
+
+ ntpd/invoke-ntpd.texi@1.453 +2 -2
+ NTP_4_2_7P460
+
+ ntpd/ntp.conf.5man@1.173 +4 -4
+ NTP_4_2_7P460
+
+ ntpd/ntp.conf.5mdoc@1.173 +1 -1
+ NTP_4_2_7P460
+
+ ntpd/ntp.conf.html@1.134 +1 -1
+ NTP_4_2_7P460
+
+ ntpd/ntp.conf.man.in@1.173 +4 -4
+ NTP_4_2_7P460
+
+ ntpd/ntp.conf.mdoc.in@1.173 +1 -1
+ NTP_4_2_7P460
+
+ ntpd/ntp.keys.5man@1.171 +11 -4
+ NTP_4_2_7P460
+
+ ntpd/ntp.keys.5mdoc@1.171 +7 -3
+ NTP_4_2_7P460
+
+ ntpd/ntp.keys.html@1.135 +1 -1
+ NTP_4_2_7P460
+
+ ntpd/ntp.keys.man.in@1.171 +11 -4
+ NTP_4_2_7P460
+
+ ntpd/ntp.keys.mdoc.in@1.171 +7 -3
+ NTP_4_2_7P460
+
+ ntpd/ntpd-opts.c@1.473 +6 -6
+ NTP_4_2_7P460
+
+ ntpd/ntpd-opts.h@1.473 +2 -2
+ NTP_4_2_7P460
+
+ ntpd/ntpd.1ntpdman@1.282 +4 -4
+ NTP_4_2_7P460
+
+ ntpd/ntpd.1ntpdmdoc@1.282 +1 -1
+ NTP_4_2_7P460
+
+ ntpd/ntpd.html@1.129 +2 -2
+ NTP_4_2_7P460
+
+ ntpd/ntpd.man.in@1.282 +4 -4
+ NTP_4_2_7P460
+
+ ntpd/ntpd.mdoc.in@1.282 +1 -1
+ NTP_4_2_7P460
+
+ ntpdc/invoke-ntpdc.texi@1.451 +2 -2
+ NTP_4_2_7P460
+
+ ntpdc/ntpdc-opts.c@1.468 +6 -6
+ NTP_4_2_7P460
+
+ ntpdc/ntpdc-opts.h@1.468 +2 -2
+ NTP_4_2_7P460
+
+ ntpdc/ntpdc.1ntpdcman@1.282 +4 -4
+ NTP_4_2_7P460
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.282 +1 -1
+ NTP_4_2_7P460
+
+ ntpdc/ntpdc.html@1.295 +2 -2
+ NTP_4_2_7P460
+
+ ntpdc/ntpdc.man.in@1.282 +4 -4
+ NTP_4_2_7P460
+
+ ntpdc/ntpdc.mdoc.in@1.282 +1 -1
+ NTP_4_2_7P460
+
+ ntpq/invoke-ntpq.texi@1.456 +2 -2
+ NTP_4_2_7P460
+
+ ntpq/ntpq-opts.c@1.472 +6 -6
+ NTP_4_2_7P460
+
+ ntpq/ntpq-opts.h@1.471 +2 -2
+ NTP_4_2_7P460
+
+ ntpq/ntpq.1ntpqman@1.284 +4 -4
+ NTP_4_2_7P460
+
+ ntpq/ntpq.1ntpqmdoc@1.284 +1 -1
+ NTP_4_2_7P460
+
+ ntpq/ntpq.html@1.126 +2 -2
+ NTP_4_2_7P460
+
+ ntpq/ntpq.man.in@1.284 +4 -4
+ NTP_4_2_7P460
+
+ ntpq/ntpq.mdoc.in@1.284 +1 -1
+ NTP_4_2_7P460
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.453 +2 -2
+ NTP_4_2_7P460
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.470 +6 -6
+ NTP_4_2_7P460
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.470 +2 -2
+ NTP_4_2_7P460
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.282 +4 -4
+ NTP_4_2_7P460
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.282 +1 -1
+ NTP_4_2_7P460
+
+ ntpsnmpd/ntpsnmpd.html@1.124 +1 -1
+ NTP_4_2_7P460
+
+ ntpsnmpd/ntpsnmpd.man.in@1.282 +4 -4
+ NTP_4_2_7P460
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.282 +1 -1
+ NTP_4_2_7P460
+
+ packageinfo.sh@1.464 +1 -1
+ NTP_4_2_7P460
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.44 +4 -4
+ NTP_4_2_7P460
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.44 +1 -1
+ NTP_4_2_7P460
+
+ scripts/calc_tickadj/calc_tickadj.html@1.45 +22 -34
+ NTP_4_2_7P460
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.43 +4 -4
+ NTP_4_2_7P460
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.44 +1 -1
+ NTP_4_2_7P460
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.47 +1 -1
+ NTP_4_2_7P460
+
+ scripts/invoke-plot_summary.texi@1.64 +2 -2
+ NTP_4_2_7P460
+
+ scripts/invoke-summary.texi@1.64 +2 -2
+ NTP_4_2_7P460
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.273 +2 -2
+ NTP_4_2_7P460
+
+ scripts/ntp-wait/ntp-wait-opts@1.9 +2 -2
+ NTP_4_2_7P460
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.272 +4 -4
+ NTP_4_2_7P460
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.272 +1 -1
+ NTP_4_2_7P460
+
+ scripts/ntp-wait/ntp-wait.html@1.290 +31 -49
+ NTP_4_2_7P460
+
+ scripts/ntp-wait/ntp-wait.man.in@1.272 +4 -4
+ NTP_4_2_7P460
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.272 +1 -1
+ NTP_4_2_7P460
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.62 +2 -2
+ NTP_4_2_7P460
+
+ scripts/ntpsweep/ntpsweep-opts@1.11 +2 -2
+ NTP_4_2_7P460
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.51 +12 -12
+ NTP_4_2_7P460
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.51 +1 -1
+ NTP_4_2_7P460
+
+ scripts/ntpsweep/ntpsweep.html@1.63 +33 -44
+ NTP_4_2_7P460
+
+ scripts/ntpsweep/ntpsweep.man.in@1.51 +12 -12
+ NTP_4_2_7P460
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P460
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.62 +2 -2
+ NTP_4_2_7P460
+
+ scripts/ntptrace/ntptrace-opts@1.11 +2 -2
+ NTP_4_2_7P460
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.51 +4 -4
+ NTP_4_2_7P460
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.51 +1 -1
+ NTP_4_2_7P460
+
+ scripts/ntptrace/ntptrace.html@1.63 +27 -36
+ NTP_4_2_7P460
+
+ scripts/ntptrace/ntptrace.man.in@1.51 +4 -4
+ NTP_4_2_7P460
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P460
+
+ scripts/plot_summary-opts@1.11 +2 -2
+ NTP_4_2_7P460
+
+ scripts/plot_summary.1plot_summaryman@1.62 +4 -4
+ NTP_4_2_7P460
+
+ scripts/plot_summary.1plot_summarymdoc@1.62 +1 -1
+ NTP_4_2_7P460
+
+ scripts/plot_summary.html@1.64 +29 -47
+ NTP_4_2_7P460
+
+ scripts/plot_summary.man.in@1.62 +4 -4
+ NTP_4_2_7P460
+
+ scripts/plot_summary.mdoc.in@1.62 +1 -1
+ NTP_4_2_7P460
+
+ scripts/summary-opts@1.11 +2 -2
+ NTP_4_2_7P460
+
+ scripts/summary.1summaryman@1.62 +4 -4
+ NTP_4_2_7P460
+
+ scripts/summary.1summarymdoc@1.62 +1 -1
+ NTP_4_2_7P460
+
+ scripts/summary.html@1.64 +27 -39
+ NTP_4_2_7P460
+
+ scripts/summary.man.in@1.62 +4 -4
+ NTP_4_2_7P460
+
+ scripts/summary.mdoc.in@1.62 +1 -1
+ NTP_4_2_7P460
+
+ sntp/invoke-sntp.texi@1.450 +2 -2
+ NTP_4_2_7P460
+
+ sntp/sntp-opts.c@1.467 +6 -6
+ NTP_4_2_7P460
+
+ sntp/sntp-opts.h@1.467 +2 -2
+ NTP_4_2_7P460
+
+ sntp/sntp.1sntpman@1.285 +4 -4
+ NTP_4_2_7P460
+
+ sntp/sntp.1sntpmdoc@1.285 +1 -1
+ NTP_4_2_7P460
+
+ sntp/sntp.html@1.465 +2 -2
+ NTP_4_2_7P460
+
+ sntp/sntp.man.in@1.285 +4 -4
+ NTP_4_2_7P460
+
+ sntp/sntp.mdoc.in@1.285 +1 -1
+ NTP_4_2_7P460
+
+ util/invoke-ntp-keygen.texi@1.454 +2 -2
+ NTP_4_2_7P460
+
+ util/ntp-keygen-opts.c@1.470 +6 -6
+ NTP_4_2_7P460
+
+ util/ntp-keygen-opts.h@1.470 +2 -2
+ NTP_4_2_7P460
+
+ util/ntp-keygen.1ntp-keygenman@1.282 +4 -4
+ NTP_4_2_7P460
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.282 +1 -1
+ NTP_4_2_7P460
+
+ util/ntp-keygen.html@1.130 +2 -2
+ NTP_4_2_7P460
+
+ util/ntp-keygen.man.in@1.282 +4 -4
+ NTP_4_2_7P460
+
+ util/ntp-keygen.mdoc.in@1.282 +1 -1
+ NTP_4_2_7P460
+
+ChangeSet@1.3177.1.2, 2014-08-13 10:36:39+00:00, stenn@psp-fb1.ntp.org
+ More autogen-5.18.4pre14 cleanup
+
+ BitKeeper/deleted/00/mdoc2man~8fe2ef1ce14f0f8e@1.4 +0 -0
+ Delete: sntp/ag-tpl/Old/mdoc2man
+
+ BitKeeper/deleted/0f/agman-file.tpl~e66d0c3c8f6fdd@1.4 +0 -0
+ Delete: sntp/ag-tpl/Old/agman-file.tpl
+
+ BitKeeper/deleted/63/agtexi-cmd.tpl~2f8da79991e6b4d4@1.4 +0 -0
+ Delete: sntp/ag-tpl/Old/agtexi-cmd.tpl
+
+ BitKeeper/deleted/80/agmdoc-file.tpl~4fa7cc72899a18a3@1.4 +0 -0
+ Delete: sntp/ag-tpl/Old/agmdoc-file.tpl
+
+ BitKeeper/deleted/a6/cmd-doc.tlib~e55de6df878a7dcc@1.4 +0 -0
+ Delete: sntp/ag-tpl/Old/cmd-doc.tlib
+
+ ChangeLog@1.1516.1.2 +1 -0
+ More autogen-5.18.4pre14 cleanup
+
+ ntpd/ntpdsim-opts.c@1.27 +6 -6
+ More autogen-5.18.4pre14 cleanup
+
+ ntpd/ntpdsim-opts.h@1.27 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/Makefile.am@1.37 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/calc_tickadj/Makefile.am@1.9 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.7 +3 -3
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/calc_tickadj/calc_tickadj.html@1.44 +35 -23
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.46 +3 -3
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/invoke-plot_summary.texi@1.63 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/invoke-summary.texi@1.63 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntp-wait/Makefile.am@1.7 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.272 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntp-wait/ntp-wait-opts@1.8 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntp-wait/ntp-wait.html@1.289 +48 -30
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntpsweep/Makefile.am@1.8 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.61 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntpsweep/ntpsweep-opts@1.10 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntpsweep/ntpsweep.html@1.62 +43 -32
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntptrace/Makefile.am@1.8 +1 -1
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.61 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntptrace/ntptrace-opts@1.10 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/ntptrace/ntptrace.html@1.62 +35 -26
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/plot_summary-opts@1.10 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/plot_summary.html@1.63 +46 -28
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary-opts@1.10 +2 -2
+ More autogen-5.18.4pre14 cleanup
+
+ scripts/summary.html@1.63 +38 -26
+ More autogen-5.18.4pre14 cleanup
+
+ sntp/ag-tpl/:Old/Mdoc.pm@1.3 +0 -0
+ Rename: sntp/ag-tpl/Mdoc.pm -> sntp/ag-tpl/:Old/Mdoc.pm
+
+ sntp/ag-tpl/:Old/agman-cmd.tpl@1.2 +0 -0
+ Rename: sntp/ag-tpl/agman-cmd.tpl -> sntp/ag-tpl/:Old/agman-cmd.tpl
+
+ sntp/ag-tpl/:Old/agmdoc-cmd.tpl@1.3 +0 -0
+ Rename: sntp/ag-tpl/agmdoc-cmd.tpl -> sntp/ag-tpl/:Old/agmdoc-cmd.tpl
+
+ sntp/ag-tpl/:Old/cmd-doc.tlib@1.2 +0 -0
+ Rename: sntp/ag-tpl/cmd-doc.tlib -> sntp/ag-tpl/:Old/cmd-doc.tlib
+
+ sntp/ag-tpl/:Old/mdoc-synopsis.tlib@1.2 +0 -0
+ Rename: sntp/ag-tpl/mdoc-synopsis.tlib -> sntp/ag-tpl/:Old/mdoc-synopsis.tlib
+
+ sntp/ag-tpl/:Old/mdoc2man@1.3 +0 -0
+ Rename: sntp/ag-tpl/mdoc2man -> sntp/ag-tpl/:Old/mdoc2man
+
+ sntp/ag-tpl/:Old/mdoc2texi@1.10 +0 -0
+ Rename: sntp/ag-tpl/mdoc2texi -> sntp/ag-tpl/:Old/mdoc2texi
+
+ sntp/ag-tpl/:Old/perlopt.tpl@1.4 +0 -0
+ Rename: sntp/ag-tpl/perlopt.tpl -> sntp/ag-tpl/:Old/perlopt.tpl
+
+ChangeSet@1.3177.1.1, 2014-08-13 08:38:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P459
+ TAG: NTP_4_2_7P459
+
+ ChangeLog@1.1516.1.1 +1 -0
+ NTP_4_2_7P459
+
+ ntpd/invoke-ntp.conf.texi@1.138 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/invoke-ntp.keys.texi@1.136 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/invoke-ntpd.texi@1.452 +2 -2
+ NTP_4_2_7P459
+
+ ntpd/ntp.conf.5man@1.172 +4 -4
+ NTP_4_2_7P459
+
+ ntpd/ntp.conf.5mdoc@1.172 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntp.conf.html@1.133 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntp.conf.man.in@1.172 +4 -4
+ NTP_4_2_7P459
+
+ ntpd/ntp.conf.mdoc.in@1.172 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntp.keys.5man@1.170 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntp.keys.5mdoc@1.170 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntp.keys.html@1.134 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntp.keys.man.in@1.170 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntp.keys.mdoc.in@1.170 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntpd-opts.c@1.472 +6 -6
+ NTP_4_2_7P459
+
+ ntpd/ntpd-opts.h@1.472 +2 -2
+ NTP_4_2_7P459
+
+ ntpd/ntpd.1ntpdman@1.281 +4 -4
+ NTP_4_2_7P459
+
+ ntpd/ntpd.1ntpdmdoc@1.281 +1 -1
+ NTP_4_2_7P459
+
+ ntpd/ntpd.html@1.128 +2 -2
+ NTP_4_2_7P459
+
+ ntpd/ntpd.man.in@1.281 +4 -4
+ NTP_4_2_7P459
+
+ ntpd/ntpd.mdoc.in@1.281 +1 -1
+ NTP_4_2_7P459
+
+ ntpdc/invoke-ntpdc.texi@1.450 +2 -2
+ NTP_4_2_7P459
+
+ ntpdc/ntpdc-opts.c@1.467 +6 -6
+ NTP_4_2_7P459
+
+ ntpdc/ntpdc-opts.h@1.467 +2 -2
+ NTP_4_2_7P459
+
+ ntpdc/ntpdc.1ntpdcman@1.281 +12 -12
+ NTP_4_2_7P459
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.281 +1 -1
+ NTP_4_2_7P459
+
+ ntpdc/ntpdc.html@1.294 +2 -2
+ NTP_4_2_7P459
+
+ ntpdc/ntpdc.man.in@1.281 +12 -12
+ NTP_4_2_7P459
+
+ ntpdc/ntpdc.mdoc.in@1.281 +1 -1
+ NTP_4_2_7P459
+
+ ntpq/invoke-ntpq.texi@1.455 +2 -2
+ NTP_4_2_7P459
+
+ ntpq/ntpq-opts.c@1.471 +6 -6
+ NTP_4_2_7P459
+
+ ntpq/ntpq-opts.h@1.470 +2 -2
+ NTP_4_2_7P459
+
+ ntpq/ntpq.1ntpqman@1.283 +4 -4
+ NTP_4_2_7P459
+
+ ntpq/ntpq.1ntpqmdoc@1.283 +1 -1
+ NTP_4_2_7P459
+
+ ntpq/ntpq.html@1.125 +4 -4
+ NTP_4_2_7P459
+
+ ntpq/ntpq.man.in@1.283 +4 -4
+ NTP_4_2_7P459
+
+ ntpq/ntpq.mdoc.in@1.283 +1 -1
+ NTP_4_2_7P459
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.452 +2 -2
+ NTP_4_2_7P459
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.469 +6 -6
+ NTP_4_2_7P459
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.469 +2 -2
+ NTP_4_2_7P459
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.281 +4 -4
+ NTP_4_2_7P459
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.281 +1 -1
+ NTP_4_2_7P459
+
+ ntpsnmpd/ntpsnmpd.html@1.123 +1 -1
+ NTP_4_2_7P459
+
+ ntpsnmpd/ntpsnmpd.man.in@1.281 +4 -4
+ NTP_4_2_7P459
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.281 +1 -1
+ NTP_4_2_7P459
+
+ packageinfo.sh@1.463 +1 -1
+ NTP_4_2_7P459
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.43 +4 -4
+ NTP_4_2_7P459
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.43 +1 -1
+ NTP_4_2_7P459
+
+ scripts/calc_tickadj/calc_tickadj.html@1.43 +1 -1
+ NTP_4_2_7P459
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.42 +4 -4
+ NTP_4_2_7P459
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.43 +1 -1
+ NTP_4_2_7P459
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.45 +1 -1
+ NTP_4_2_7P459
+
+ scripts/invoke-plot_summary.texi@1.62 +2 -2
+ NTP_4_2_7P459
+
+ scripts/invoke-summary.texi@1.62 +2 -2
+ NTP_4_2_7P459
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.271 +2 -2
+ NTP_4_2_7P459
+
+ scripts/ntp-wait/ntp-wait-opts@1.7 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.271 +4 -4
+ NTP_4_2_7P459
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.271 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntp-wait/ntp-wait.html@1.288 +2 -2
+ NTP_4_2_7P459
+
+ scripts/ntp-wait/ntp-wait.man.in@1.271 +4 -4
+ NTP_4_2_7P459
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.271 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.60 +2 -2
+ NTP_4_2_7P459
+
+ scripts/ntpsweep/ntpsweep-opts@1.9 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.50 +4 -4
+ NTP_4_2_7P459
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.50 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntpsweep/ntpsweep.html@1.61 +2 -2
+ NTP_4_2_7P459
+
+ scripts/ntpsweep/ntpsweep.man.in@1.50 +4 -4
+ NTP_4_2_7P459
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.51 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.60 +2 -2
+ NTP_4_2_7P459
+
+ scripts/ntptrace/ntptrace-opts@1.9 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.50 +4 -4
+ NTP_4_2_7P459
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.50 +1 -1
+ NTP_4_2_7P459
+
+ scripts/ntptrace/ntptrace.html@1.61 +2 -2
+ NTP_4_2_7P459
+
+ scripts/ntptrace/ntptrace.man.in@1.50 +4 -4
+ NTP_4_2_7P459
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.51 +1 -1
+ NTP_4_2_7P459
+
+ scripts/plot_summary-opts@1.9 +1 -1
+ NTP_4_2_7P459
+
+ scripts/plot_summary.1plot_summaryman@1.61 +4 -4
+ NTP_4_2_7P459
+
+ scripts/plot_summary.1plot_summarymdoc@1.61 +1 -1
+ NTP_4_2_7P459
+
+ scripts/plot_summary.html@1.62 +2 -2
+ NTP_4_2_7P459
+
+ scripts/plot_summary.man.in@1.61 +4 -4
+ NTP_4_2_7P459
+
+ scripts/plot_summary.mdoc.in@1.61 +1 -1
+ NTP_4_2_7P459
+
+ scripts/summary-opts@1.9 +1 -1
+ NTP_4_2_7P459
+
+ scripts/summary.1summaryman@1.61 +4 -4
+ NTP_4_2_7P459
+
+ scripts/summary.1summarymdoc@1.61 +1 -1
+ NTP_4_2_7P459
+
+ scripts/summary.html@1.62 +2 -2
+ NTP_4_2_7P459
+
+ scripts/summary.man.in@1.61 +4 -4
+ NTP_4_2_7P459
+
+ scripts/summary.mdoc.in@1.61 +1 -1
+ NTP_4_2_7P459
+
+ sntp/invoke-sntp.texi@1.449 +2 -2
+ NTP_4_2_7P459
+
+ sntp/sntp-opts.c@1.466 +6 -6
+ NTP_4_2_7P459
+
+ sntp/sntp-opts.h@1.466 +2 -2
+ NTP_4_2_7P459
+
+ sntp/sntp.1sntpman@1.284 +4 -4
+ NTP_4_2_7P459
+
+ sntp/sntp.1sntpmdoc@1.284 +1 -1
+ NTP_4_2_7P459
+
+ sntp/sntp.html@1.464 +2 -2
+ NTP_4_2_7P459
+
+ sntp/sntp.man.in@1.284 +4 -4
+ NTP_4_2_7P459
+
+ sntp/sntp.mdoc.in@1.284 +1 -1
+ NTP_4_2_7P459
+
+ util/invoke-ntp-keygen.texi@1.453 +2 -2
+ NTP_4_2_7P459
+
+ util/ntp-keygen-opts.c@1.469 +6 -6
+ NTP_4_2_7P459
+
+ util/ntp-keygen-opts.h@1.469 +2 -2
+ NTP_4_2_7P459
+
+ util/ntp-keygen.1ntp-keygenman@1.281 +4 -4
+ NTP_4_2_7P459
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.281 +1 -1
+ NTP_4_2_7P459
+
+ util/ntp-keygen.html@1.129 +2 -2
+ NTP_4_2_7P459
+
+ util/ntp-keygen.man.in@1.281 +4 -4
+ NTP_4_2_7P459
+
+ util/ntp-keygen.mdoc.in@1.281 +1 -1
+ NTP_4_2_7P459
+
+ChangeSet@1.3178, 2014-08-12 20:29:54+02:00, jnperlin@hydra.(none)
+ [Bug 2622] Synchronisation problem using SHM [...]
+ Add 'control' function to SHM driver-- fudge values not available during start.
+
+ ChangeLog@1.1517 +2 -0
+ [Bug 2622] Synchronisation problem using SHM [...]
+ Add 'control' function -- fudge values not available during start.
+
+ ntpd/refclock_shm.c@1.29 +38 -9
+ [Bug 2622] Synchronisation problem using SHM [...]
+ Add 'control' function -- fudge values not available during start.
+
+ChangeSet@1.3177, 2014-08-12 02:08:55-04:00, stenn@deacon.udel.edu
+ Try bison-3.0.2 instead of bison-2.5
+
+ ChangeLog@1.1516 +1 -0
+ Try bison-3.0.2 instead of bison-2.5
+
+ ntpd/ntp_parser.c@1.88 +1109 -1510
+ Try bison-3.0.2 instead of bison-2.5
+
+ ntpd/ntp_parser.h@1.54 +215 -211
+ Try bison-3.0.2 instead of bison-2.5
+
+ChangeSet@1.3176, 2014-08-12 02:01:01-04:00, stenn@deacon.udel.edu
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ChangeLog@1.1515 +1 -0
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ntpq/invoke-ntpq.texi@1.454 +3 -3
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ntpq/ntpq-opts.c@1.470 +1 -1
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ntpq/ntpq-opts.def@1.20 +1 -1
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ntpq/ntpq.1ntpqman@1.282 +5 -5
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ntpq/ntpq.1ntpqmdoc@1.282 +2 -2
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ntpq/ntpq.man.in@1.282 +5 -5
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ ntpq/ntpq.mdoc.in@1.282 +2 -2
+ [Bug 2630] Limit the ntpq command buffer to 512 bytes
+
+ChangeSet@1.3175, 2014-08-12 02:08:30+00:00, stenn@psp-fb1.ntp.org
+ FlexeLint cleanups
+
+ ChangeLog@1.1514 +1 -0
+ FlexeLint cleanups
+
+ChangeSet@1.3172.1.2, 2014-08-12 01:27:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P458
+ TAG: NTP_4_2_7P458
+
+ ChangeLog@1.1513 +1 -0
+ NTP_4_2_7P458
+
+ ntpd/invoke-ntp.conf.texi@1.137 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/invoke-ntp.keys.texi@1.135 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/invoke-ntpd.texi@1.451 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.conf.5man@1.171 +4 -4
+ NTP_4_2_7P458
+
+ ntpd/ntp.conf.5mdoc@1.171 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.conf.html@1.132 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.conf.man.in@1.171 +4 -4
+ NTP_4_2_7P458
+
+ ntpd/ntp.conf.mdoc.in@1.171 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.keys.5man@1.169 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.keys.5mdoc@1.169 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.keys.html@1.133 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.keys.man.in@1.169 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntp.keys.mdoc.in@1.169 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntpd-opts.c@1.471 +6 -6
+ NTP_4_2_7P458
+
+ ntpd/ntpd-opts.h@1.471 +2 -2
+ NTP_4_2_7P458
+
+ ntpd/ntpd.1ntpdman@1.280 +4 -4
+ NTP_4_2_7P458
+
+ ntpd/ntpd.1ntpdmdoc@1.280 +1 -1
+ NTP_4_2_7P458
+
+ ntpd/ntpd.html@1.127 +2 -2
+ NTP_4_2_7P458
+
+ ntpd/ntpd.man.in@1.280 +4 -4
+ NTP_4_2_7P458
+
+ ntpd/ntpd.mdoc.in@1.280 +1 -1
+ NTP_4_2_7P458
+
+ ntpdc/invoke-ntpdc.texi@1.449 +1 -1
+ NTP_4_2_7P458
+
+ ntpdc/ntpdc-opts.c@1.466 +6 -6
+ NTP_4_2_7P458
+
+ ntpdc/ntpdc-opts.h@1.466 +2 -2
+ NTP_4_2_7P458
+
+ ntpdc/ntpdc.1ntpdcman@1.280 +4 -4
+ NTP_4_2_7P458
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.280 +1 -1
+ NTP_4_2_7P458
+
+ ntpdc/ntpdc.html@1.293 +2 -2
+ NTP_4_2_7P458
+
+ ntpdc/ntpdc.man.in@1.280 +4 -4
+ NTP_4_2_7P458
+
+ ntpdc/ntpdc.mdoc.in@1.280 +1 -1
+ NTP_4_2_7P458
+
+ ntpq/invoke-ntpq.texi@1.453 +1 -1
+ NTP_4_2_7P458
+
+ ntpq/ntpq-opts.c@1.469 +6 -6
+ NTP_4_2_7P458
+
+ ntpq/ntpq-opts.h@1.469 +2 -2
+ NTP_4_2_7P458
+
+ ntpq/ntpq.1ntpqman@1.281 +4 -4
+ NTP_4_2_7P458
+
+ ntpq/ntpq.1ntpqmdoc@1.281 +1 -1
+ NTP_4_2_7P458
+
+ ntpq/ntpq.html@1.124 +27 -26
+ NTP_4_2_7P458
+
+ ntpq/ntpq.man.in@1.281 +4 -4
+ NTP_4_2_7P458
+
+ ntpq/ntpq.mdoc.in@1.281 +1 -1
+ NTP_4_2_7P458
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.451 +1 -1
+ NTP_4_2_7P458
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.468 +6 -6
+ NTP_4_2_7P458
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.468 +2 -2
+ NTP_4_2_7P458
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.280 +4 -4
+ NTP_4_2_7P458
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.280 +1 -1
+ NTP_4_2_7P458
+
+ ntpsnmpd/ntpsnmpd.html@1.122 +1 -1
+ NTP_4_2_7P458
+
+ ntpsnmpd/ntpsnmpd.man.in@1.280 +4 -4
+ NTP_4_2_7P458
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.280 +1 -1
+ NTP_4_2_7P458
+
+ packageinfo.sh@1.462 +1 -1
+ NTP_4_2_7P458
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.42 +4 -4
+ NTP_4_2_7P458
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.42 +1 -1
+ NTP_4_2_7P458
+
+ scripts/calc_tickadj/calc_tickadj.html@1.42 +1 -1
+ NTP_4_2_7P458
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.41 +4 -4
+ NTP_4_2_7P458
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.42 +1 -1
+ NTP_4_2_7P458
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.44 +1 -1
+ NTP_4_2_7P458
+
+ scripts/invoke-plot_summary.texi@1.61 +1 -1
+ NTP_4_2_7P458
+
+ scripts/invoke-summary.texi@1.61 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.270 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntp-wait/ntp-wait-opts@1.6 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.270 +4 -4
+ NTP_4_2_7P458
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.270 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntp-wait/ntp-wait.html@1.287 +2 -2
+ NTP_4_2_7P458
+
+ scripts/ntp-wait/ntp-wait.man.in@1.270 +4 -4
+ NTP_4_2_7P458
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.270 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.59 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntpsweep/ntpsweep-opts@1.8 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.49 +4 -4
+ NTP_4_2_7P458
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.49 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntpsweep/ntpsweep.html@1.60 +2 -2
+ NTP_4_2_7P458
+
+ scripts/ntpsweep/ntpsweep.man.in@1.49 +4 -4
+ NTP_4_2_7P458
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.50 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.59 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntptrace/ntptrace-opts@1.8 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.49 +4 -4
+ NTP_4_2_7P458
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.49 +1 -1
+ NTP_4_2_7P458
+
+ scripts/ntptrace/ntptrace.html@1.60 +2 -2
+ NTP_4_2_7P458
+
+ scripts/ntptrace/ntptrace.man.in@1.49 +4 -4
+ NTP_4_2_7P458
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.50 +1 -1
+ NTP_4_2_7P458
+
+ scripts/plot_summary-opts@1.8 +1 -1
+ NTP_4_2_7P458
+
+ scripts/plot_summary.1plot_summaryman@1.60 +4 -4
+ NTP_4_2_7P458
+
+ scripts/plot_summary.1plot_summarymdoc@1.60 +1 -1
+ NTP_4_2_7P458
+
+ scripts/plot_summary.html@1.61 +2 -2
+ NTP_4_2_7P458
+
+ scripts/plot_summary.man.in@1.60 +4 -4
+ NTP_4_2_7P458
+
+ scripts/plot_summary.mdoc.in@1.60 +1 -1
+ NTP_4_2_7P458
+
+ scripts/summary-opts@1.8 +1 -1
+ NTP_4_2_7P458
+
+ scripts/summary.1summaryman@1.60 +4 -4
+ NTP_4_2_7P458
+
+ scripts/summary.1summarymdoc@1.60 +1 -1
+ NTP_4_2_7P458
+
+ scripts/summary.html@1.61 +2 -2
+ NTP_4_2_7P458
+
+ scripts/summary.man.in@1.60 +4 -4
+ NTP_4_2_7P458
+
+ scripts/summary.mdoc.in@1.60 +1 -1
+ NTP_4_2_7P458
+
+ sntp/invoke-sntp.texi@1.448 +1 -1
+ NTP_4_2_7P458
+
+ sntp/sntp-opts.c@1.465 +6 -6
+ NTP_4_2_7P458
+
+ sntp/sntp-opts.h@1.465 +2 -2
+ NTP_4_2_7P458
+
+ sntp/sntp.1sntpman@1.283 +4 -4
+ NTP_4_2_7P458
+
+ sntp/sntp.1sntpmdoc@1.283 +1 -1
+ NTP_4_2_7P458
+
+ sntp/sntp.html@1.463 +2 -2
+ NTP_4_2_7P458
+
+ sntp/sntp.man.in@1.283 +4 -4
+ NTP_4_2_7P458
+
+ sntp/sntp.mdoc.in@1.283 +1 -1
+ NTP_4_2_7P458
+
+ util/invoke-ntp-keygen.texi@1.452 +1 -1
+ NTP_4_2_7P458
+
+ util/ntp-keygen-opts.c@1.468 +6 -6
+ NTP_4_2_7P458
+
+ util/ntp-keygen-opts.h@1.468 +2 -2
+ NTP_4_2_7P458
+
+ util/ntp-keygen.1ntp-keygenman@1.280 +4 -4
+ NTP_4_2_7P458
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.280 +1 -1
+ NTP_4_2_7P458
+
+ util/ntp-keygen.html@1.128 +2 -2
+ NTP_4_2_7P458
+
+ util/ntp-keygen.man.in@1.280 +4 -4
+ NTP_4_2_7P458
+
+ util/ntp-keygen.mdoc.in@1.280 +1 -1
+ NTP_4_2_7P458
+
+ChangeSet@1.3172.1.1, 2014-08-10 22:26:19+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2633] Provide stdnoreturn.h for windows port
+
+ ChangeLog@1.1512 +1 -0
+ [Bug 2633] Provide stdnoreturn.h for windows port
+
+ ports/winnt/include/hopf_PCI_io.h@1.3 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/include/stdnoreturn.h@1.1 +61 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/ports/winnt/include/stdnoreturn.h
+
+ ports/winnt/include/stdnoreturn.h@1.0 +0 -0
+
+ChangeSet@1.3173, 2014-08-09 20:32:45+00:00, phk@psp-fb1.ntp.org
+ ntp.h, ntp_proto.c:
+ Don't do arithmetic on NULL pointer when we have a real pointer to use
+ ntp_parser.y, ntp_config.c:
+ A set of no-op pedantic changes inspired by FlexeLints complaints,
+ while looking for ways to make the simulator work again:
+
+ Add prototype for yyparser() until bison joins the century of the fruit-bat.
+ Make some functions static.
+ Spell NTP_INSIST() INSIST()
+ Deal with "SIM-only" stuff in ntp_parser.y rather than later.
+ Mark knowingly unused arguments
+ Signed/Unsigned/Long fixes to constants.
+ Const char* argument to fprintf(3).
+ ntp_assert.h:
+ Use systems assert(3) for FlexeLint analysis
+
+ include/ntp.h@1.210 +1 -2
+ Don't do arithmetic on NULL pointer when we have a real pointer to use
+
+ include/ntp_assert.h@1.8 +12 -1
+ Use systems assert(3) for FlexeLint analysis
+
+ ntpd/ntp_config.c@1.320 +59 -50
+ A set of no-op pedantic changes inspired by FlexeLints complaints,
+ while looking for ways to make the simulator work again:
+
+ Add prototype for yyparser() until bison joins the century of the fruit-bat.
+ Make some functions static.
+ Spell NTP_INSIST() INSIST()
+ Deal with "SIM-only" stuff in ntp_parser.y rather than later.
+ Mark knowingly unused arguments
+ Signed/Unsigned/Long fixes to constants.
+ Const char* argument to fprintf(3).
+
+ ntpd/ntp_parser.c@1.87 +187 -181
+ A set of no-op pedantic changes inspired by FlexeLints complaints,
+ while looking for ways to make the simulator work again:
+
+ Add prototype for yyparser() until bison joins the century of the fruit-bat.
+ Make some functions static.
+ Spell NTP_INSIST() INSIST()
+ Deal with "SIM-only" stuff in ntp_parser.y rather than later.
+ Mark knowingly unused arguments
+ Signed/Unsigned/Long fixes to constants.
+ Const char* argument to fprintf(3).
+
+ ntpd/ntp_parser.h@1.53 +1 -1
+
+ ntpd/ntp_parser.y@1.81 +8 -2
+
+ ntpd/ntp_proto.c@1.349 +1 -1
+ Don't do arithmetic on NULL pointer when we have a real pointer to use
+
+ChangeSet@1.3172, 2014-08-09 11:04:13+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P457
+ TAG: NTP_4_2_7P457
+
+ ChangeLog@1.1511 +1 -0
+ NTP_4_2_7P457
+
+ ntpd/invoke-ntp.conf.texi@1.136 +1 -1
+ NTP_4_2_7P457
+
+ ntpd/invoke-ntp.keys.texi@1.134 +1 -1
+ NTP_4_2_7P457
+
+ ntpd/invoke-ntpd.texi@1.450 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntp.conf.5man@1.170 +6 -6
+ NTP_4_2_7P457
+
+ ntpd/ntp.conf.5mdoc@1.170 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntp.conf.html@1.131 +1 -1
+ NTP_4_2_7P457
+
+ ntpd/ntp.conf.man.in@1.170 +6 -6
+ NTP_4_2_7P457
+
+ ntpd/ntp.conf.mdoc.in@1.170 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntp.keys.5man@1.168 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntp.keys.5mdoc@1.168 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntp.keys.html@1.132 +1 -1
+ NTP_4_2_7P457
+
+ ntpd/ntp.keys.man.in@1.168 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntp.keys.mdoc.in@1.168 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntpd-opts.c@1.470 +6 -6
+ NTP_4_2_7P457
+
+ ntpd/ntpd-opts.h@1.470 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntpd.1ntpdman@1.279 +6 -6
+ NTP_4_2_7P457
+
+ ntpd/ntpd.1ntpdmdoc@1.279 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntpd.html@1.126 +2 -2
+ NTP_4_2_7P457
+
+ ntpd/ntpd.man.in@1.279 +6 -6
+ NTP_4_2_7P457
+
+ ntpd/ntpd.mdoc.in@1.279 +2 -2
+ NTP_4_2_7P457
+
+ ntpdc/invoke-ntpdc.texi@1.448 +2 -2
+ NTP_4_2_7P457
+
+ ntpdc/ntpdc-opts.c@1.465 +6 -6
+ NTP_4_2_7P457
+
+ ntpdc/ntpdc-opts.h@1.465 +2 -2
+ NTP_4_2_7P457
+
+ ntpdc/ntpdc.1ntpdcman@1.279 +13 -13
+ NTP_4_2_7P457
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.279 +2 -2
+ NTP_4_2_7P457
+
+ ntpdc/ntpdc.html@1.292 +2 -2
+ NTP_4_2_7P457
+
+ ntpdc/ntpdc.man.in@1.279 +13 -13
+ NTP_4_2_7P457
+
+ ntpdc/ntpdc.mdoc.in@1.279 +2 -2
+ NTP_4_2_7P457
+
+ ntpq/invoke-ntpq.texi@1.452 +28 -26
+ NTP_4_2_7P457
+
+ ntpq/ntpq-opts.c@1.468 +6 -6
+ NTP_4_2_7P457
+
+ ntpq/ntpq-opts.h@1.468 +2 -2
+ NTP_4_2_7P457
+
+ ntpq/ntpq.1ntpqman@1.280 +43 -34
+ NTP_4_2_7P457
+
+ ntpq/ntpq.1ntpqmdoc@1.280 +31 -28
+ NTP_4_2_7P457
+
+ ntpq/ntpq.html@1.123 +2 -2
+ NTP_4_2_7P457
+
+ ntpq/ntpq.man.in@1.280 +43 -34
+ NTP_4_2_7P457
+
+ ntpq/ntpq.mdoc.in@1.280 +31 -28
+ NTP_4_2_7P457
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.450 +2 -2
+ NTP_4_2_7P457
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.467 +6 -6
+ NTP_4_2_7P457
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.467 +2 -2
+ NTP_4_2_7P457
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.279 +6 -6
+ NTP_4_2_7P457
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.279 +2 -2
+ NTP_4_2_7P457
+
+ ntpsnmpd/ntpsnmpd.html@1.121 +1 -1
+ NTP_4_2_7P457
+
+ ntpsnmpd/ntpsnmpd.man.in@1.279 +6 -6
+ NTP_4_2_7P457
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.279 +2 -2
+ NTP_4_2_7P457
+
+ packageinfo.sh@1.461 +1 -1
+ NTP_4_2_7P457
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.41 +6 -6
+ NTP_4_2_7P457
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.41 +2 -2
+ NTP_4_2_7P457
+
+ scripts/calc_tickadj/calc_tickadj.html@1.41 +23 -35
+ NTP_4_2_7P457
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.40 +6 -6
+ NTP_4_2_7P457
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P457
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.43 +1 -1
+ NTP_4_2_7P457
+
+ scripts/invoke-plot_summary.texi@1.60 +1 -1
+ NTP_4_2_7P457
+
+ scripts/invoke-summary.texi@1.60 +1 -1
+ NTP_4_2_7P457
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.269 +1 -1
+ NTP_4_2_7P457
+
+ scripts/ntp-wait/ntp-wait-opts@1.5 +1 -1
+ NTP_4_2_7P457
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.269 +6 -6
+ NTP_4_2_7P457
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.269 +2 -2
+ NTP_4_2_7P457
+
+ scripts/ntp-wait/ntp-wait.html@1.286 +31 -49
+ NTP_4_2_7P457
+
+ scripts/ntp-wait/ntp-wait.man.in@1.269 +6 -6
+ NTP_4_2_7P457
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.269 +2 -2
+ NTP_4_2_7P457
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.58 +1 -1
+ NTP_4_2_7P457
+
+ scripts/ntpsweep/ntpsweep-opts@1.7 +1 -1
+ NTP_4_2_7P457
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.48 +6 -6
+ NTP_4_2_7P457
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.48 +2 -2
+ NTP_4_2_7P457
+
+ scripts/ntpsweep/ntpsweep.html@1.59 +33 -44
+ NTP_4_2_7P457
+
+ scripts/ntpsweep/ntpsweep.man.in@1.48 +6 -6
+ NTP_4_2_7P457
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P457
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.58 +1 -1
+ NTP_4_2_7P457
+
+ scripts/ntptrace/ntptrace-opts@1.7 +1 -1
+ NTP_4_2_7P457
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.48 +6 -6
+ NTP_4_2_7P457
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.48 +2 -2
+ NTP_4_2_7P457
+
+ scripts/ntptrace/ntptrace.html@1.59 +27 -36
+ NTP_4_2_7P457
+
+ scripts/ntptrace/ntptrace.man.in@1.48 +6 -6
+ NTP_4_2_7P457
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P457
+
+ scripts/plot_summary-opts@1.7 +1 -1
+ NTP_4_2_7P457
+
+ scripts/plot_summary.1plot_summaryman@1.59 +6 -6
+ NTP_4_2_7P457
+
+ scripts/plot_summary.1plot_summarymdoc@1.59 +2 -2
+ NTP_4_2_7P457
+
+ scripts/plot_summary.html@1.60 +29 -47
+ NTP_4_2_7P457
+
+ scripts/plot_summary.man.in@1.59 +6 -6
+ NTP_4_2_7P457
+
+ scripts/plot_summary.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P457
+
+ scripts/summary-opts@1.7 +1 -1
+ NTP_4_2_7P457
+
+ scripts/summary.1summaryman@1.59 +6 -6
+ NTP_4_2_7P457
+
+ scripts/summary.1summarymdoc@1.59 +2 -2
+ NTP_4_2_7P457
+
+ scripts/summary.html@1.60 +27 -39
+ NTP_4_2_7P457
+
+ scripts/summary.man.in@1.59 +6 -6
+ NTP_4_2_7P457
+
+ scripts/summary.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P457
+
+ sntp/invoke-sntp.texi@1.447 +2 -2
+ NTP_4_2_7P457
+
+ sntp/sntp-opts.c@1.464 +6 -6
+ NTP_4_2_7P457
+
+ sntp/sntp-opts.h@1.464 +2 -2
+ NTP_4_2_7P457
+
+ sntp/sntp.1sntpman@1.282 +6 -6
+ NTP_4_2_7P457
+
+ sntp/sntp.1sntpmdoc@1.282 +2 -2
+ NTP_4_2_7P457
+
+ sntp/sntp.html@1.462 +2 -2
+ NTP_4_2_7P457
+
+ sntp/sntp.man.in@1.282 +6 -6
+ NTP_4_2_7P457
+
+ sntp/sntp.mdoc.in@1.282 +2 -2
+ NTP_4_2_7P457
+
+ util/invoke-ntp-keygen.texi@1.451 +2 -2
+ NTP_4_2_7P457
+
+ util/ntp-keygen-opts.c@1.467 +6 -6
+ NTP_4_2_7P457
+
+ util/ntp-keygen-opts.h@1.467 +2 -2
+ NTP_4_2_7P457
+
+ util/ntp-keygen.1ntp-keygenman@1.279 +6 -6
+ NTP_4_2_7P457
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.279 +2 -2
+ NTP_4_2_7P457
+
+ util/ntp-keygen.html@1.127 +2 -2
+ NTP_4_2_7P457
+
+ util/ntp-keygen.man.in@1.279 +6 -6
+ NTP_4_2_7P457
+
+ util/ntp-keygen.mdoc.in@1.279 +2 -2
+ NTP_4_2_7P457
+
+ChangeSet@1.3171, 2014-08-09 07:02:16-04:00, stenn@deacon.udel.edu
+ Update .point-changed-filelist
+
+ .point-changed-filelist@1.25 +5 -0
+ Update .point-changed-filelist
+
+ChangeSet@1.3156.2.2, 2014-08-09 08:17:47+00:00, phk@psp-fb1.ntp.org
+ Typo fix
+
+ ChangeLog@1.1502.2.2 +1 -1
+ Typo fix
+
+ChangeSet@1.3168, 2014-08-09 08:00:44+00:00, stenn@psp-fb1.ntp.org
+ Added Brian Utterback to the copyright file
+
+ html/copyright.html@1.65 +2 -1
+ Added Brian Utterback to the copyright file
+
+ChangeSet@1.3167, 2014-08-09 07:51:01+00:00, stenn@psp-fb1.ntp.org
+ autogen-5.18.4pre14
+
+ scripts/calc_tickadj/calc_tickadj.html@1.40 +1 -1
+ autogen-5.18.4pre14
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.42 +3 -3
+ autogen-5.18.4pre14
+
+ scripts/invoke-plot_summary.texi@1.59 +10 -10
+ autogen-5.18.4pre14
+
+ scripts/invoke-summary.texi@1.59 +9 -9
+ autogen-5.18.4pre14
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.268 +3 -3
+ autogen-5.18.4pre14
+
+ scripts/ntp-wait/ntp-wait.html@1.285 +49 -31
+ autogen-5.18.4pre14
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.57 +3 -3
+ autogen-5.18.4pre14
+
+ scripts/ntpsweep/ntpsweep.html@1.58 +1 -1
+ autogen-5.18.4pre14
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.57 +3 -3
+ autogen-5.18.4pre14
+
+ scripts/ntptrace/ntptrace.html@1.58 +1 -1
+ autogen-5.18.4pre14
+
+ scripts/plot_summary.html@1.59 +1 -1
+ autogen-5.18.4pre14
+
+ scripts/summary.html@1.59 +1 -1
+ autogen-5.18.4pre14
+
+ChangeSet@1.3166, 2014-08-09 07:27:03+00:00, stenn@psp-fb1.ntp.org
+ autogen-5.18.4pre14
+
+ ntpd/ntpd-opts.c@1.469 +7 -7
+ autogen-5.18.4pre14
+
+ ntpd/ntpd-opts.h@1.469 +3 -3
+ autogen-5.18.4pre14
+
+ ntpd/ntpdsim-opts.c@1.26 +7 -7
+ autogen-5.18.4pre14
+
+ ntpd/ntpdsim-opts.h@1.26 +3 -3
+ autogen-5.18.4pre14
+
+ ntpdc/ntpdc-opts.c@1.464 +7 -7
+ autogen-5.18.4pre14
+
+ ntpdc/ntpdc-opts.h@1.464 +3 -3
+ autogen-5.18.4pre14
+
+ ntpq/ntpq-opts.c@1.467 +7 -7
+ autogen-5.18.4pre14
+
+ ntpq/ntpq-opts.h@1.467 +3 -3
+ autogen-5.18.4pre14
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.466 +7 -7
+ autogen-5.18.4pre14
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.466 +3 -3
+ autogen-5.18.4pre14
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.6 +2 -2
+ autogen-5.18.4pre14
+
+ scripts/ntp-wait/ntp-wait-opts@1.4 +2 -2
+ autogen-5.18.4pre14
+
+ scripts/ntpsweep/ntpsweep-opts@1.6 +2 -2
+ autogen-5.18.4pre14
+
+ scripts/ntptrace/ntptrace-opts@1.6 +2 -2
+ autogen-5.18.4pre14
+
+ scripts/plot_summary-opts@1.6 +2 -2
+ autogen-5.18.4pre14
+
+ scripts/summary-opts@1.6 +2 -2
+ autogen-5.18.4pre14
+
+ sntp/sntp-opts.c@1.463 +7 -7
+ autogen-5.18.4pre14
+
+ sntp/sntp-opts.h@1.463 +3 -3
+ autogen-5.18.4pre14
+
+ util/ntp-keygen-opts.c@1.466 +7 -7
+ autogen-5.18.4pre14
+
+ util/ntp-keygen-opts.h@1.466 +3 -3
+ autogen-5.18.4pre14
+
+ChangeSet@1.3165, 2014-08-09 07:16:25+00:00, stenn@psp-fb1.ntp.org
+ autogen-5.18.4pre14
+
+ ChangeLog@1.1508 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/Makefile.am@1.27 +3 -3
+ autogen-5.18.4pre14
+
+ sntp/libopts/ag-char-map.h@1.30 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/ao-strs.c@1.16 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/ao-strs.h@1.15 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/genshell.c@1.30 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/genshell.h@1.30 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/option-value-type.c@1.17 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/option-value-type.h@1.31 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/option-xat-attribute.c@1.17 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/option-xat-attribute.h@1.31 +1 -1
+ autogen-5.18.4pre14
+
+ sntp/libopts/proto.h@1.30 +1 -1
+ autogen-5.18.4pre14
+
+ChangeSet@1.3156.1.12, 2014-08-08 22:47:50+02:00, jnperlin@hydra.(none)
+ implement new logic to define difference limit and limit check with SHM clock (driver28)
+
+ html/drivers/driver28.html@1.16 +25 -5
+ updated docs to describe flag1 and time2
+
+ ntpd/refclock_shm.c@1.28 +125 -55
+ use time2 for difference limit and flag1 to disable distance limit check
+
+ChangeSet@1.3156.2.1, 2014-08-08 09:54:12+00:00, phk@psp-fb1.ntp.org
+ Pass the configration source into the parser as argument rather than through a global variable
+
+ ChangeLog@1.1502.2.1 +2 -0
+ Changelog entry
+
+ ntpd/ntp_config.c@1.319 +2 -5
+ Pass config file source to yyparse() as argument, not through global variable
+
+ ntpd/ntp_parser.c@1.86 +610 -558
+ Pass config file source to yyparse() as argument, not through global variable
+
+ ntpd/ntp_parser.h@1.52 +7 -9
+ Pass config file source to yyparse() as argument, not through global variable
+
+ ntpd/ntp_parser.y@1.80 +13 -13
+ Pass config file source to yyparse() as argument, not through global variable
+
+ ntpd/ntp_scanner.c@1.44 +13 -15
+ Pass config file source to yyparse() as argument, not through global variable
+
+ ntpd/ntp_scanner.h@1.18 +1 -5
+ Pass config file source to yyparse() as argument, not through global variable
+
+ChangeSet@1.3164, 2014-08-08 09:31:03+00:00, stenn@psp-fb1.ntp.org
+ autogen-5.18.4pre12
+
+ ntpd/ntpd-opts.c@1.468 +8 -8
+ autogen-5.18.4pre12
+
+ ntpd/ntpd-opts.h@1.468 +11 -11
+ autogen-5.18.4pre12
+
+ ntpd/ntpdsim-opts.c@1.25 +7 -7
+ autogen-5.18.4pre12
+
+ ntpd/ntpdsim-opts.h@1.25 +3 -3
+ autogen-5.18.4pre12
+
+ ntpdc/ntpdc-opts.c@1.463 +8 -8
+ autogen-5.18.4pre12
+
+ ntpdc/ntpdc-opts.h@1.463 +13 -13
+ autogen-5.18.4pre12
+
+ ntpq/ntpq-opts.c@1.466 +8 -8
+ autogen-5.18.4pre12
+
+ ntpq/ntpq-opts.h@1.466 +13 -13
+ autogen-5.18.4pre12
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.465 +8 -8
+ autogen-5.18.4pre12
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.465 +13 -13
+ autogen-5.18.4pre12
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.5 +2 -2
+ autogen-5.18.4pre12
+
+ scripts/ntpsweep/ntpsweep-opts@1.5 +2 -2
+ autogen-5.18.4pre12
+
+ scripts/ntptrace/ntptrace-opts@1.5 +2 -2
+ autogen-5.18.4pre12
+
+ scripts/plot_summary-opts@1.5 +2 -2
+ autogen-5.18.4pre12
+
+ scripts/summary-opts@1.5 +2 -2
+ autogen-5.18.4pre12
+
+ util/ntp-keygen-opts.c@1.465 +8 -8
+ autogen-5.18.4pre12
+
+ util/ntp-keygen-opts.h@1.465 +13 -13
+ autogen-5.18.4pre12
+
+ChangeSet@1.3163, 2014-08-08 09:24:12+00:00, stenn@psp-fb1.ntp.org
+ autogen-5.18.4pre12
+
+ sntp/libopts/Makefile.am@1.26 +19 -26
+ autogen-5.18.4pre12
+
+ sntp/libopts/ag-char-map.h@1.29 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/ao-strs.c@1.15 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/ao-strs.h@1.14 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/autoopts/options.h@1.28 +26 -5
+ autogen-5.18.4pre12
+
+ sntp/libopts/autoopts/usage-txt.h@1.28 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/genshell.c@1.29 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/genshell.h@1.29 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/m4/libopts.m4@1.32 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/option-value-type.c@1.16 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/option-value-type.h@1.30 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/option-xat-attribute.c@1.16 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/option-xat-attribute.h@1.30 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/proto.h@1.29 +1 -1
+ autogen-5.18.4pre12
+
+ sntp/libopts/version.c@1.18 +0 -2
+ autogen-5.18.4pre12
+
+ sntp/sntp-opts.c@1.462 +8 -8
+ autogen-5.18.4pre12
+
+ sntp/sntp-opts.h@1.462 +13 -13
+ autogen-5.18.4pre12
+
+ChangeSet@1.3156.1.11, 2014-08-07 21:24:29+02:00, jnperlin@hydra.(none)
+ [Bug 2622] Change SHM driver so TOY restricted API is not used any more. (Plus some minor cleanup in logic and flow control)
+
+ ChangeLog@1.1502.1.9 +3 -0
+ [Bug 2622] change SHM driver so TOY restricted API is not used any more. (Plus some minor cleanup in logic and flow control)
+
+ ntpd/refclock_shm.c@1.27 +106 -103
+ [Bug 2622] Change SHM driver so TOY restricted API is not used any more. (Plus some minor cleanup in logic and flow control)
+
+ChangeSet@1.3156.1.10, 2014-08-07 09:34:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P456
+ TAG: NTP_4_2_7P456
+
+ ChangeLog@1.1502.1.8 +1 -0
+ NTP_4_2_7P456
+
+ ntpd/invoke-ntp.conf.texi@1.135 +1 -1
+ NTP_4_2_7P456
+
+ ntpd/invoke-ntp.keys.texi@1.133 +1 -1
+ NTP_4_2_7P456
+
+ ntpd/invoke-ntpd.texi@1.449 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntp.conf.5man@1.169 +6 -6
+ NTP_4_2_7P456
+
+ ntpd/ntp.conf.5mdoc@1.169 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntp.conf.html@1.130 +1 -1
+ NTP_4_2_7P456
+
+ ntpd/ntp.conf.man.in@1.169 +6 -6
+ NTP_4_2_7P456
+
+ ntpd/ntp.conf.mdoc.in@1.169 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntp.keys.5man@1.167 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntp.keys.5mdoc@1.167 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntp.keys.html@1.131 +1 -1
+ NTP_4_2_7P456
+
+ ntpd/ntp.keys.man.in@1.167 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntp.keys.mdoc.in@1.167 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntpd-opts.c@1.464.1.3 +7 -7
+ NTP_4_2_7P456
+
+ ntpd/ntpd-opts.h@1.464.1.3 +3 -3
+ NTP_4_2_7P456
+
+ ntpd/ntpd.1ntpdman@1.278 +6 -6
+ NTP_4_2_7P456
+
+ ntpd/ntpd.1ntpdmdoc@1.278 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntpd.html@1.125 +2 -2
+ NTP_4_2_7P456
+
+ ntpd/ntpd.man.in@1.278 +6 -6
+ NTP_4_2_7P456
+
+ ntpd/ntpd.mdoc.in@1.278 +2 -2
+ NTP_4_2_7P456
+
+ ntpdc/invoke-ntpdc.texi@1.447 +2 -2
+ NTP_4_2_7P456
+
+ ntpdc/ntpdc-opts.c@1.459.1.3 +7 -7
+ NTP_4_2_7P456
+
+ ntpdc/ntpdc-opts.h@1.459.1.3 +3 -3
+ NTP_4_2_7P456
+
+ ntpdc/ntpdc.1ntpdcman@1.278 +6 -6
+ NTP_4_2_7P456
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.278 +2 -2
+ NTP_4_2_7P456
+
+ ntpdc/ntpdc.html@1.291 +2 -2
+ NTP_4_2_7P456
+
+ ntpdc/ntpdc.man.in@1.278 +6 -6
+ NTP_4_2_7P456
+
+ ntpdc/ntpdc.mdoc.in@1.278 +2 -2
+ NTP_4_2_7P456
+
+ ntpq/invoke-ntpq.texi@1.448.1.3 +2 -2
+ NTP_4_2_7P456
+
+ ntpq/ntpq-opts.c@1.462.1.3 +7 -7
+ NTP_4_2_7P456
+
+ ntpq/ntpq-opts.h@1.462.1.3 +3 -3
+ NTP_4_2_7P456
+
+ ntpq/ntpq.1ntpqman@1.276.1.3 +6 -6
+ NTP_4_2_7P456
+
+ ntpq/ntpq.1ntpqmdoc@1.276.1.3 +2 -2
+ NTP_4_2_7P456
+
+ ntpq/ntpq.html@1.122 +2 -2
+ NTP_4_2_7P456
+
+ ntpq/ntpq.man.in@1.276.1.3 +6 -6
+ NTP_4_2_7P456
+
+ ntpq/ntpq.mdoc.in@1.276.1.3 +2 -2
+ NTP_4_2_7P456
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.449 +2 -2
+ NTP_4_2_7P456
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.461.1.3 +7 -7
+ NTP_4_2_7P456
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.461.1.3 +3 -3
+ NTP_4_2_7P456
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.278 +6 -6
+ NTP_4_2_7P456
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.278 +2 -2
+ NTP_4_2_7P456
+
+ ntpsnmpd/ntpsnmpd.html@1.120 +1 -1
+ NTP_4_2_7P456
+
+ ntpsnmpd/ntpsnmpd.man.in@1.278 +6 -6
+ NTP_4_2_7P456
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.278 +2 -2
+ NTP_4_2_7P456
+
+ packageinfo.sh@1.460 +1 -1
+ NTP_4_2_7P456
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.40 +6 -6
+ NTP_4_2_7P456
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.40 +2 -2
+ NTP_4_2_7P456
+
+ scripts/calc_tickadj/calc_tickadj.html@1.36.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.39 +6 -6
+ NTP_4_2_7P456
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P456
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.38.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/invoke-plot_summary.texi@1.55.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/invoke-summary.texi@1.55.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.267 +1 -1
+ NTP_4_2_7P456
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.268 +6 -6
+ NTP_4_2_7P456
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.268 +2 -2
+ NTP_4_2_7P456
+
+ scripts/ntp-wait/ntp-wait.html@1.284 +1 -1
+ NTP_4_2_7P456
+
+ scripts/ntp-wait/ntp-wait.man.in@1.268 +6 -6
+ NTP_4_2_7P456
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.268 +2 -2
+ NTP_4_2_7P456
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.53.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.47 +6 -6
+ NTP_4_2_7P456
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.47 +2 -2
+ NTP_4_2_7P456
+
+ scripts/ntpsweep/ntpsweep.html@1.54.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/ntpsweep/ntpsweep.man.in@1.47 +6 -6
+ NTP_4_2_7P456
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P456
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.53.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.47 +6 -6
+ NTP_4_2_7P456
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.47 +2 -2
+ NTP_4_2_7P456
+
+ scripts/ntptrace/ntptrace.html@1.54.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/ntptrace/ntptrace.man.in@1.47 +6 -6
+ NTP_4_2_7P456
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P456
+
+ scripts/plot_summary.1plot_summaryman@1.58 +6 -6
+ NTP_4_2_7P456
+
+ scripts/plot_summary.1plot_summarymdoc@1.58 +2 -2
+ NTP_4_2_7P456
+
+ scripts/plot_summary.html@1.55.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/plot_summary.man.in@1.58 +6 -6
+ NTP_4_2_7P456
+
+ scripts/plot_summary.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P456
+
+ scripts/summary.1summaryman@1.58 +6 -6
+ NTP_4_2_7P456
+
+ scripts/summary.1summarymdoc@1.58 +2 -2
+ NTP_4_2_7P456
+
+ scripts/summary.html@1.55.1.3 +1 -1
+ NTP_4_2_7P456
+
+ scripts/summary.man.in@1.58 +6 -6
+ NTP_4_2_7P456
+
+ scripts/summary.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P456
+
+ sntp/invoke-sntp.texi@1.446 +2 -2
+ NTP_4_2_7P456
+
+ sntp/sntp-opts.c@1.458.1.3 +7 -7
+ NTP_4_2_7P456
+
+ sntp/sntp-opts.h@1.458.1.3 +3 -3
+ NTP_4_2_7P456
+
+ sntp/sntp.1sntpman@1.281 +6 -6
+ NTP_4_2_7P456
+
+ sntp/sntp.1sntpmdoc@1.281 +2 -2
+ NTP_4_2_7P456
+
+ sntp/sntp.html@1.461 +2 -2
+ NTP_4_2_7P456
+
+ sntp/sntp.man.in@1.281 +6 -6
+ NTP_4_2_7P456
+
+ sntp/sntp.mdoc.in@1.281 +2 -2
+ NTP_4_2_7P456
+
+ util/invoke-ntp-keygen.texi@1.450 +2 -2
+ NTP_4_2_7P456
+
+ util/ntp-keygen-opts.c@1.461.1.3 +7 -7
+ NTP_4_2_7P456
+
+ util/ntp-keygen-opts.h@1.461.1.3 +3 -3
+ NTP_4_2_7P456
+
+ util/ntp-keygen.1ntp-keygenman@1.278 +13 -13
+ NTP_4_2_7P456
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.278 +2 -2
+ NTP_4_2_7P456
+
+ util/ntp-keygen.html@1.126 +2 -2
+ NTP_4_2_7P456
+
+ util/ntp-keygen.man.in@1.278 +13 -13
+ NTP_4_2_7P456
+
+ util/ntp-keygen.mdoc.in@1.278 +2 -2
+ NTP_4_2_7P456
+
+ChangeSet@1.3156.1.9, 2014-08-07 07:07:31+00:00, stenn@psp-fb1.ntp.org
+ CID 739722: Change the way the extention and MAC fields are processed
+
+ ChangeLog@1.1502.1.7 +1 -0
+ CID 739722: Change the way the extention and MAC fields are processed
+
+ sntp/networking.c@1.64 +6 -6
+ CID 739722: Change the way the extention and MAC fields are processed
+
+ChangeSet@1.3156.1.8, 2014-08-06 22:22:18+02:00, jnperlin@hydra.(none)
+ Work around Coverity issue over mismatch of formal and paket layout.
+
+ sntp/networking.c@1.63 +47 -24
+ Move skipping over extension fields into a pointer-based separate function.
+ Should deal with coverity issue with formal/actual structure layout.
+ Also easier to read.
+
+ChangeSet@1.3156.1.7, 2014-08-03 09:34:31+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P455
+ TAG: NTP_4_2_7P455
+
+ ChangeLog@1.1502.1.6 +1 -0
+ NTP_4_2_7P455
+
+ ntpd/invoke-ntp.conf.texi@1.134 +1 -1
+ NTP_4_2_7P455
+
+ ntpd/invoke-ntp.keys.texi@1.132 +1 -1
+ NTP_4_2_7P455
+
+ ntpd/invoke-ntpd.texi@1.448 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntp.conf.5man@1.168 +6 -6
+ NTP_4_2_7P455
+
+ ntpd/ntp.conf.5mdoc@1.168 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntp.conf.html@1.129 +1 -1
+ NTP_4_2_7P455
+
+ ntpd/ntp.conf.man.in@1.168 +6 -6
+ NTP_4_2_7P455
+
+ ntpd/ntp.conf.mdoc.in@1.168 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntp.keys.5man@1.166 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntp.keys.5mdoc@1.166 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntp.keys.html@1.130 +1 -1
+ NTP_4_2_7P455
+
+ ntpd/ntp.keys.man.in@1.166 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntp.keys.mdoc.in@1.166 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntpd-opts.c@1.464.1.2 +7 -7
+ NTP_4_2_7P455
+
+ ntpd/ntpd-opts.h@1.464.1.2 +3 -3
+ NTP_4_2_7P455
+
+ ntpd/ntpd.1ntpdman@1.277 +6 -6
+ NTP_4_2_7P455
+
+ ntpd/ntpd.1ntpdmdoc@1.277 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntpd.html@1.124 +2 -2
+ NTP_4_2_7P455
+
+ ntpd/ntpd.man.in@1.277 +6 -6
+ NTP_4_2_7P455
+
+ ntpd/ntpd.mdoc.in@1.277 +2 -2
+ NTP_4_2_7P455
+
+ ntpdc/invoke-ntpdc.texi@1.446 +2 -2
+ NTP_4_2_7P455
+
+ ntpdc/ntpdc-opts.c@1.459.1.2 +7 -7
+ NTP_4_2_7P455
+
+ ntpdc/ntpdc-opts.h@1.459.1.2 +3 -3
+ NTP_4_2_7P455
+
+ ntpdc/ntpdc.1ntpdcman@1.277 +6 -6
+ NTP_4_2_7P455
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.277 +2 -2
+ NTP_4_2_7P455
+
+ ntpdc/ntpdc.html@1.290 +2 -2
+ NTP_4_2_7P455
+
+ ntpdc/ntpdc.man.in@1.277 +6 -6
+ NTP_4_2_7P455
+
+ ntpdc/ntpdc.mdoc.in@1.277 +2 -2
+ NTP_4_2_7P455
+
+ ntpq/invoke-ntpq.texi@1.448.1.2 +2 -2
+ NTP_4_2_7P455
+
+ ntpq/ntpq-opts.c@1.462.1.2 +7 -7
+ NTP_4_2_7P455
+
+ ntpq/ntpq-opts.h@1.462.1.2 +3 -3
+ NTP_4_2_7P455
+
+ ntpq/ntpq.1ntpqman@1.276.1.2 +6 -6
+ NTP_4_2_7P455
+
+ ntpq/ntpq.1ntpqmdoc@1.276.1.2 +2 -2
+ NTP_4_2_7P455
+
+ ntpq/ntpq.html@1.121 +2 -2
+ NTP_4_2_7P455
+
+ ntpq/ntpq.man.in@1.276.1.2 +6 -6
+ NTP_4_2_7P455
+
+ ntpq/ntpq.mdoc.in@1.276.1.2 +2 -2
+ NTP_4_2_7P455
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.448 +2 -2
+ NTP_4_2_7P455
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.461.1.2 +7 -7
+ NTP_4_2_7P455
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.461.1.2 +3 -3
+ NTP_4_2_7P455
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.277 +6 -6
+ NTP_4_2_7P455
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.277 +2 -2
+ NTP_4_2_7P455
+
+ ntpsnmpd/ntpsnmpd.html@1.119 +1 -1
+ NTP_4_2_7P455
+
+ ntpsnmpd/ntpsnmpd.man.in@1.277 +6 -6
+ NTP_4_2_7P455
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.277 +2 -2
+ NTP_4_2_7P455
+
+ packageinfo.sh@1.459 +1 -1
+ NTP_4_2_7P455
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.39 +6 -6
+ NTP_4_2_7P455
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.39 +2 -2
+ NTP_4_2_7P455
+
+ scripts/calc_tickadj/calc_tickadj.html@1.36.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.38 +6 -6
+ NTP_4_2_7P455
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P455
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.38.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/invoke-plot_summary.texi@1.55.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/invoke-summary.texi@1.55.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.266 +1 -1
+ NTP_4_2_7P455
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.267 +6 -6
+ NTP_4_2_7P455
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.267 +2 -2
+ NTP_4_2_7P455
+
+ scripts/ntp-wait/ntp-wait.html@1.283 +1 -1
+ NTP_4_2_7P455
+
+ scripts/ntp-wait/ntp-wait.man.in@1.267 +6 -6
+ NTP_4_2_7P455
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.267 +2 -2
+ NTP_4_2_7P455
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.53.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.46 +6 -6
+ NTP_4_2_7P455
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.46 +2 -2
+ NTP_4_2_7P455
+
+ scripts/ntpsweep/ntpsweep.html@1.54.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/ntpsweep/ntpsweep.man.in@1.46 +6 -6
+ NTP_4_2_7P455
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P455
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.53.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.46 +6 -6
+ NTP_4_2_7P455
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.46 +2 -2
+ NTP_4_2_7P455
+
+ scripts/ntptrace/ntptrace.html@1.54.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/ntptrace/ntptrace.man.in@1.46 +6 -6
+ NTP_4_2_7P455
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P455
+
+ scripts/plot_summary.1plot_summaryman@1.57 +6 -6
+ NTP_4_2_7P455
+
+ scripts/plot_summary.1plot_summarymdoc@1.57 +2 -2
+ NTP_4_2_7P455
+
+ scripts/plot_summary.html@1.55.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/plot_summary.man.in@1.57 +6 -6
+ NTP_4_2_7P455
+
+ scripts/plot_summary.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P455
+
+ scripts/summary.1summaryman@1.57 +13 -13
+ NTP_4_2_7P455
+
+ scripts/summary.1summarymdoc@1.57 +2 -2
+ NTP_4_2_7P455
+
+ scripts/summary.html@1.55.1.2 +1 -1
+ NTP_4_2_7P455
+
+ scripts/summary.man.in@1.57 +13 -13
+ NTP_4_2_7P455
+
+ scripts/summary.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P455
+
+ sntp/invoke-sntp.texi@1.445 +2 -2
+ NTP_4_2_7P455
+
+ sntp/sntp-opts.c@1.458.1.2 +7 -7
+ NTP_4_2_7P455
+
+ sntp/sntp-opts.h@1.458.1.2 +3 -3
+ NTP_4_2_7P455
+
+ sntp/sntp.1sntpman@1.280 +6 -6
+ NTP_4_2_7P455
+
+ sntp/sntp.1sntpmdoc@1.280 +2 -2
+ NTP_4_2_7P455
+
+ sntp/sntp.html@1.460 +2 -2
+ NTP_4_2_7P455
+
+ sntp/sntp.man.in@1.280 +6 -6
+ NTP_4_2_7P455
+
+ sntp/sntp.mdoc.in@1.280 +2 -2
+ NTP_4_2_7P455
+
+ util/invoke-ntp-keygen.texi@1.449 +2 -2
+ NTP_4_2_7P455
+
+ util/ntp-keygen-opts.c@1.461.1.2 +7 -7
+ NTP_4_2_7P455
+
+ util/ntp-keygen-opts.h@1.461.1.2 +3 -3
+ NTP_4_2_7P455
+
+ util/ntp-keygen.1ntp-keygenman@1.277 +13 -13
+ NTP_4_2_7P455
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.277 +2 -2
+ NTP_4_2_7P455
+
+ util/ntp-keygen.html@1.125 +2 -2
+ NTP_4_2_7P455
+
+ util/ntp-keygen.man.in@1.277 +13 -13
+ NTP_4_2_7P455
+
+ util/ntp-keygen.mdoc.in@1.277 +2 -2
+ NTP_4_2_7P455
+
+ChangeSet@1.3156.1.6, 2014-08-03 05:03:03+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2565] ntpd sometimes logs unexpected getifaddrs() errors
+
+ ChangeLog@1.1502.1.5 +1 -0
+ [Bug 2565] ntpd sometimes logs unexpected getifaddrs() errors
+
+ lib/isc/unix/ifiter_getifaddrs.c@1.12 +14 -17
+ [Bug 2565] ntpd sometimes logs unexpected getifaddrs() errors
+
+ChangeSet@1.3156.1.5, 2014-08-02 19:56:24-04:00, stenn@deacon.udel.edu
+ CID 739722: Clean up the definition of the exten field of struct pkt
+
+ ChangeLog@1.1502.1.4 +1 -1
+ CID 739722: Clean up the definition of the exten field of struct pkt
+
+ChangeSet@1.3156.1.4, 2014-08-02 23:44:12+00:00, stenn@psp-fb1.ntp.org
+ Clean up the definition of the exten field of struct pkt
+
+ ChangeLog@1.1502.1.3 +1 -0
+ Clean up the definition of the exten field of struct pkt
+
+ChangeSet@1.3156.1.3, 2014-08-02 13:15:10+02:00, jnperlin@hydra.(none)
+ make consistent layout for 'struct pkt'
+
+ include/ntp.h@1.209 +9 -3
+ make consistent layout for 'struct pkt'
+
+ libntp/work_thread.c@1.17 +1 -1
+ fix minor 64-bit casting issue for 'thread_exit()' macro
+
+ sntp/main.c@1.93 +2 -6
+ make consistent layout for 'struct pkt'
+
+ChangeSet@1.3156.1.2, 2014-07-30 09:34:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P454
+ TAG: NTP_4_2_7P454
+
+ ChangeLog@1.1502.1.2 +1 -0
+ NTP_4_2_7P454
+
+ ntpd/invoke-ntp.conf.texi@1.133 +1 -1
+ NTP_4_2_7P454
+
+ ntpd/invoke-ntp.keys.texi@1.131 +1 -1
+ NTP_4_2_7P454
+
+ ntpd/invoke-ntpd.texi@1.447 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntp.conf.5man@1.167 +6 -6
+ NTP_4_2_7P454
+
+ ntpd/ntp.conf.5mdoc@1.167 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntp.conf.html@1.128 +1 -1
+ NTP_4_2_7P454
+
+ ntpd/ntp.conf.man.in@1.167 +6 -6
+ NTP_4_2_7P454
+
+ ntpd/ntp.conf.mdoc.in@1.167 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntp.keys.5man@1.165 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntp.keys.5mdoc@1.165 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntp.keys.html@1.129 +1 -1
+ NTP_4_2_7P454
+
+ ntpd/ntp.keys.man.in@1.165 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntp.keys.mdoc.in@1.165 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntpd-opts.c@1.464.1.1 +7 -7
+ NTP_4_2_7P454
+
+ ntpd/ntpd-opts.h@1.464.1.1 +3 -3
+ NTP_4_2_7P454
+
+ ntpd/ntpd.1ntpdman@1.276 +6 -6
+ NTP_4_2_7P454
+
+ ntpd/ntpd.1ntpdmdoc@1.276 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntpd.html@1.123 +2 -2
+ NTP_4_2_7P454
+
+ ntpd/ntpd.man.in@1.276 +6 -6
+ NTP_4_2_7P454
+
+ ntpd/ntpd.mdoc.in@1.276 +2 -2
+ NTP_4_2_7P454
+
+ ntpdc/invoke-ntpdc.texi@1.445 +2 -2
+ NTP_4_2_7P454
+
+ ntpdc/ntpdc-opts.c@1.459.1.1 +7 -7
+ NTP_4_2_7P454
+
+ ntpdc/ntpdc-opts.h@1.459.1.1 +3 -3
+ NTP_4_2_7P454
+
+ ntpdc/ntpdc.1ntpdcman@1.276 +6 -6
+ NTP_4_2_7P454
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.276 +2 -2
+ NTP_4_2_7P454
+
+ ntpdc/ntpdc.html@1.289 +2 -2
+ NTP_4_2_7P454
+
+ ntpdc/ntpdc.man.in@1.276 +6 -6
+ NTP_4_2_7P454
+
+ ntpdc/ntpdc.mdoc.in@1.276 +2 -2
+ NTP_4_2_7P454
+
+ ntpq/invoke-ntpq.texi@1.448.1.1 +2 -2
+ NTP_4_2_7P454
+
+ ntpq/ntpq-opts.c@1.462.1.1 +7 -7
+ NTP_4_2_7P454
+
+ ntpq/ntpq-opts.h@1.462.1.1 +3 -3
+ NTP_4_2_7P454
+
+ ntpq/ntpq.1ntpqman@1.276.1.1 +6 -6
+ NTP_4_2_7P454
+
+ ntpq/ntpq.1ntpqmdoc@1.276.1.1 +2 -2
+ NTP_4_2_7P454
+
+ ntpq/ntpq.html@1.120 +2 -2
+ NTP_4_2_7P454
+
+ ntpq/ntpq.man.in@1.276.1.1 +6 -6
+ NTP_4_2_7P454
+
+ ntpq/ntpq.mdoc.in@1.276.1.1 +2 -2
+ NTP_4_2_7P454
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.447 +2 -2
+ NTP_4_2_7P454
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.461.1.1 +7 -7
+ NTP_4_2_7P454
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.461.1.1 +3 -3
+ NTP_4_2_7P454
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.276 +6 -6
+ NTP_4_2_7P454
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.276 +2 -2
+ NTP_4_2_7P454
+
+ ntpsnmpd/ntpsnmpd.html@1.118 +1 -1
+ NTP_4_2_7P454
+
+ ntpsnmpd/ntpsnmpd.man.in@1.276 +6 -6
+ NTP_4_2_7P454
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.276 +2 -2
+ NTP_4_2_7P454
+
+ packageinfo.sh@1.458 +1 -1
+ NTP_4_2_7P454
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.38 +6 -6
+ NTP_4_2_7P454
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.38 +2 -2
+ NTP_4_2_7P454
+
+ scripts/calc_tickadj/calc_tickadj.html@1.36.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.37 +6 -6
+ NTP_4_2_7P454
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P454
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.38.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/invoke-plot_summary.texi@1.55.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/invoke-summary.texi@1.55.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.265 +1 -1
+ NTP_4_2_7P454
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.266 +13 -13
+ NTP_4_2_7P454
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.266 +2 -2
+ NTP_4_2_7P454
+
+ scripts/ntp-wait/ntp-wait.html@1.282 +1 -1
+ NTP_4_2_7P454
+
+ scripts/ntp-wait/ntp-wait.man.in@1.266 +13 -13
+ NTP_4_2_7P454
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.266 +2 -2
+ NTP_4_2_7P454
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.53.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.45 +6 -6
+ NTP_4_2_7P454
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.45 +2 -2
+ NTP_4_2_7P454
+
+ scripts/ntpsweep/ntpsweep.html@1.54.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/ntpsweep/ntpsweep.man.in@1.45 +6 -6
+ NTP_4_2_7P454
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P454
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.53.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.45 +6 -6
+ NTP_4_2_7P454
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.45 +2 -2
+ NTP_4_2_7P454
+
+ scripts/ntptrace/ntptrace.html@1.54.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/ntptrace/ntptrace.man.in@1.45 +6 -6
+ NTP_4_2_7P454
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P454
+
+ scripts/plot_summary.1plot_summaryman@1.56 +6 -6
+ NTP_4_2_7P454
+
+ scripts/plot_summary.1plot_summarymdoc@1.56 +2 -2
+ NTP_4_2_7P454
+
+ scripts/plot_summary.html@1.55.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/plot_summary.man.in@1.56 +6 -6
+ NTP_4_2_7P454
+
+ scripts/plot_summary.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P454
+
+ scripts/summary.1summaryman@1.56 +13 -13
+ NTP_4_2_7P454
+
+ scripts/summary.1summarymdoc@1.56 +2 -2
+ NTP_4_2_7P454
+
+ scripts/summary.html@1.55.1.1 +1 -1
+ NTP_4_2_7P454
+
+ scripts/summary.man.in@1.56 +13 -13
+ NTP_4_2_7P454
+
+ scripts/summary.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P454
+
+ sntp/invoke-sntp.texi@1.444 +2 -2
+ NTP_4_2_7P454
+
+ sntp/sntp-opts.c@1.458.1.1 +7 -7
+ NTP_4_2_7P454
+
+ sntp/sntp-opts.h@1.458.1.1 +3 -3
+ NTP_4_2_7P454
+
+ sntp/sntp.1sntpman@1.279 +6 -6
+ NTP_4_2_7P454
+
+ sntp/sntp.1sntpmdoc@1.279 +2 -2
+ NTP_4_2_7P454
+
+ sntp/sntp.html@1.459 +2 -2
+ NTP_4_2_7P454
+
+ sntp/sntp.man.in@1.279 +6 -6
+ NTP_4_2_7P454
+
+ sntp/sntp.mdoc.in@1.279 +2 -2
+ NTP_4_2_7P454
+
+ util/invoke-ntp-keygen.texi@1.448 +2 -2
+ NTP_4_2_7P454
+
+ util/ntp-keygen-opts.c@1.461.1.1 +7 -7
+ NTP_4_2_7P454
+
+ util/ntp-keygen-opts.h@1.461.1.1 +3 -3
+ NTP_4_2_7P454
+
+ util/ntp-keygen.1ntp-keygenman@1.276 +6 -6
+ NTP_4_2_7P454
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.276 +2 -2
+ NTP_4_2_7P454
+
+ util/ntp-keygen.html@1.124 +2 -2
+ NTP_4_2_7P454
+
+ util/ntp-keygen.man.in@1.276 +6 -6
+ NTP_4_2_7P454
+
+ util/ntp-keygen.mdoc.in@1.276 +2 -2
+ NTP_4_2_7P454
+
+ChangeSet@1.3156.1.1, 2014-07-29 20:35:32+02:00, jnperlin@hydra.(none)
+ [Bug 2628] 'mon_getmoremem()' relies on undefined behaviour
+
+ ChangeLog@1.1502.1.1 +1 -0
+ [Bug 2628] 'mon_getmoremem()' relies on undefined behaviour
+
+ ntpd/ntp_monitor.c@1.41 +8 -7
+ [Bug 2628] 'mon_getmoremem()' relies on undefined behaviour
+
+ChangeSet@1.3160, 2014-07-20 09:44:32+00:00, stenn@psp-fb1.ntp.org
+ autogen-5.18.4pre9
+
+ ntpd/ntpd-opts.c@1.465 +2 -2
+ autogen-5.18.4pre9
+
+ ntpd/ntpd-opts.h@1.465 +9 -9
+ autogen-5.18.4pre9
+
+ ntpd/ntpdsim-opts.c@1.24 +11 -11
+ autogen-5.18.4pre9
+
+ ntpd/ntpdsim-opts.h@1.24 +14 -14
+ autogen-5.18.4pre9
+
+ ntpdc/ntpdc-opts.c@1.460 +2 -2
+ autogen-5.18.4pre9
+
+ ntpdc/ntpdc-opts.h@1.460 +11 -11
+ autogen-5.18.4pre9
+
+ ntpq/invoke-ntpq.texi@1.449 +27 -25
+ autogen-5.18.4pre9
+
+ ntpq/ntpq-opts.c@1.463 +2 -2
+ autogen-5.18.4pre9
+
+ ntpq/ntpq-opts.h@1.463 +11 -11
+ autogen-5.18.4pre9
+
+ ntpq/ntpq.1ntpqman@1.277 +40 -60
+ autogen-5.18.4pre9
+
+ ntpq/ntpq.1ntpqmdoc@1.277 +31 -47
+ autogen-5.18.4pre9
+
+ ntpq/ntpq.man.in@1.277 +40 -60
+ autogen-5.18.4pre9
+
+ ntpq/ntpq.mdoc.in@1.277 +31 -47
+ autogen-5.18.4pre9
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.462 +2 -2
+ autogen-5.18.4pre9
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.462 +11 -11
+ autogen-5.18.4pre9
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.4 +6 -6
+ autogen-5.18.4pre9
+
+ scripts/calc_tickadj/calc_tickadj.html@1.37 +35 -23
+ autogen-5.18.4pre9
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.39 +3 -3
+ autogen-5.18.4pre9
+
+ scripts/invoke-plot_summary.texi@1.56 +10 -10
+ autogen-5.18.4pre9
+
+ scripts/invoke-summary.texi@1.56 +9 -9
+ autogen-5.18.4pre9
+
+ scripts/ntp-wait/ntp-wait-opts@1.3 +6 -6
+ autogen-5.18.4pre9
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.54 +3 -3
+ autogen-5.18.4pre9
+
+ scripts/ntpsweep/ntpsweep-opts@1.4 +6 -11
+ autogen-5.18.4pre9
+
+ scripts/ntpsweep/ntpsweep.html@1.55 +44 -33
+ autogen-5.18.4pre9
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.54 +3 -3
+ autogen-5.18.4pre9
+
+ scripts/ntptrace/ntptrace-opts@1.4 +6 -11
+ autogen-5.18.4pre9
+
+ scripts/ntptrace/ntptrace.html@1.55 +36 -27
+ autogen-5.18.4pre9
+
+ scripts/plot_summary-opts@1.4 +13 -13
+ autogen-5.18.4pre9
+
+ scripts/plot_summary.html@1.56 +54 -36
+ autogen-5.18.4pre9
+
+ scripts/summary-opts@1.4 +12 -12
+ autogen-5.18.4pre9
+
+ scripts/summary.html@1.56 +45 -33
+ autogen-5.18.4pre9
+
+ sntp/sntp-opts.c@1.459 +2 -2
+ autogen-5.18.4pre9
+
+ sntp/sntp-opts.h@1.459 +11 -11
+ autogen-5.18.4pre9
+
+ util/ntp-keygen-opts.c@1.462 +2 -2
+ autogen-5.18.4pre9
+
+ util/ntp-keygen-opts.h@1.462 +11 -11
+ autogen-5.18.4pre9
+
+ChangeSet@1.3159, 2014-07-20 09:34:20+00:00, stenn@psp-fb1.ntp.org
+ Fix nits in the ntpq man page
+
+ ChangeLog@1.1505 +1 -1
+ Fix nits in the ntpq man page
+
+ ntpq/ntpq-opts.def@1.19 +28 -28
+ Fix nits in the ntpq man page
+
+ChangeSet@1.3158, 2014-07-20 07:31:46+00:00, stenn@psp-deb1.ntp.org
+ Fix a nit in the ntpq man page
+
+ ChangeLog@1.1504 +1 -0
+ Fix a nit in the ntpq man page
+
+ ntpq/ntpq-opts.def@1.18 +1 -1
+ Fix a nit in the ntpq man page
+
+ChangeSet@1.3157, 2014-07-20 07:30:06+00:00, stenn@psp-deb1.ntp.org
+ autogen-5.18.4pre9
+
+ ChangeLog@1.1503 +1 -0
+ autogen-5.18.4pre9
+
+ sntp/libopts/Makefile.am@1.25 +52 -16
+ autogen-5.18.4pre9
+
+ sntp/libopts/ag-char-map.h@1.28 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/ao-strs.c@1.14 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/ao-strs.h@1.13 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/autoopts.h@1.18 +1 -0
+ autogen-5.18.4pre9
+
+ sntp/libopts/autoopts/options.h@1.27 +6 -4
+ autogen-5.18.4pre9
+
+ sntp/libopts/autoopts/usage-txt.h@1.27 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/compat/_Noreturn.h@1.1 +10 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen-5.18.4/sntp/libopts/compat/_Noreturn.h
+
+ sntp/libopts/compat/_Noreturn.h@1.0 +0 -0
+
+ sntp/libopts/genshell.c@1.28 +2 -2
+ autogen-5.18.4pre9
+
+ sntp/libopts/genshell.h@1.28 +9 -9
+ autogen-5.18.4pre9
+
+ sntp/libopts/intprops.h@1.1 +320 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen-5.18.4/sntp/libopts/intprops.h
+
+ sntp/libopts/intprops.h@1.0 +0 -0
+
+ sntp/libopts/m4/libopts.m4@1.31 +2 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/m4/stdnoreturn.m4@1.1 +41 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen-5.18.4/sntp/libopts/m4/stdnoreturn.m4
+
+ sntp/libopts/m4/stdnoreturn.m4@1.0 +0 -0
+
+ sntp/libopts/makeshell.c@1.18 +3 -3
+ autogen-5.18.4pre9
+
+ sntp/libopts/option-value-type.c@1.15 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/option-value-type.h@1.29 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/option-xat-attribute.c@1.15 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/option-xat-attribute.h@1.29 +1 -1
+ autogen-5.18.4pre9
+
+ sntp/libopts/parse-duration.c@1.12 +6 -3
+ autogen-5.18.4pre9
+
+ sntp/libopts/proto.h@1.28 +4 -4
+ autogen-5.18.4pre9
+
+ sntp/libopts/stdnoreturn.in.h@1.1 +50 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen-5.18.4/sntp/libopts/stdnoreturn.in.h
+
+ sntp/libopts/stdnoreturn.in.h@1.0 +0 -0
+
+ sntp/libopts/version.c@1.17 +24 -4
+ autogen-5.18.4pre9
+
+ChangeSet@1.3156, 2014-07-19 09:33:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P453
+ TAG: NTP_4_2_7P453
+
+ ChangeLog@1.1502 +1 -0
+ NTP_4_2_7P453
+
+ ntpd/invoke-ntp.conf.texi@1.132 +1 -1
+ NTP_4_2_7P453
+
+ ntpd/invoke-ntp.keys.texi@1.130 +1 -1
+ NTP_4_2_7P453
+
+ ntpd/invoke-ntpd.texi@1.446 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntp.conf.5man@1.166 +6 -6
+ NTP_4_2_7P453
+
+ ntpd/ntp.conf.5mdoc@1.166 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntp.conf.html@1.127 +1 -1
+ NTP_4_2_7P453
+
+ ntpd/ntp.conf.man.in@1.166 +6 -6
+ NTP_4_2_7P453
+
+ ntpd/ntp.conf.mdoc.in@1.166 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntp.keys.5man@1.164 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntp.keys.5mdoc@1.164 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntp.keys.html@1.128 +1 -1
+ NTP_4_2_7P453
+
+ ntpd/ntp.keys.man.in@1.164 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntp.keys.mdoc.in@1.164 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntpd-opts.c@1.464 +7 -7
+ NTP_4_2_7P453
+
+ ntpd/ntpd-opts.h@1.464 +3 -3
+ NTP_4_2_7P453
+
+ ntpd/ntpd.1ntpdman@1.275 +13 -13
+ NTP_4_2_7P453
+
+ ntpd/ntpd.1ntpdmdoc@1.275 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntpd.html@1.122 +2 -2
+ NTP_4_2_7P453
+
+ ntpd/ntpd.man.in@1.275 +13 -13
+ NTP_4_2_7P453
+
+ ntpd/ntpd.mdoc.in@1.275 +2 -2
+ NTP_4_2_7P453
+
+ ntpdc/invoke-ntpdc.texi@1.444 +2 -2
+ NTP_4_2_7P453
+
+ ntpdc/ntpdc-opts.c@1.459 +7 -7
+ NTP_4_2_7P453
+
+ ntpdc/ntpdc-opts.h@1.459 +3 -3
+ NTP_4_2_7P453
+
+ ntpdc/ntpdc.1ntpdcman@1.275 +6 -6
+ NTP_4_2_7P453
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.275 +2 -2
+ NTP_4_2_7P453
+
+ ntpdc/ntpdc.html@1.288 +2 -2
+ NTP_4_2_7P453
+
+ ntpdc/ntpdc.man.in@1.275 +6 -6
+ NTP_4_2_7P453
+
+ ntpdc/ntpdc.mdoc.in@1.275 +2 -2
+ NTP_4_2_7P453
+
+ ntpq/invoke-ntpq.texi@1.448 +2 -2
+ NTP_4_2_7P453
+
+ ntpq/ntpq-opts.c@1.462 +7 -7
+ NTP_4_2_7P453
+
+ ntpq/ntpq-opts.h@1.462 +3 -3
+ NTP_4_2_7P453
+
+ ntpq/ntpq.1ntpqman@1.276 +6 -6
+ NTP_4_2_7P453
+
+ ntpq/ntpq.1ntpqmdoc@1.276 +2 -2
+ NTP_4_2_7P453
+
+ ntpq/ntpq.html@1.119 +2 -2
+ NTP_4_2_7P453
+
+ ntpq/ntpq.man.in@1.276 +6 -6
+ NTP_4_2_7P453
+
+ ntpq/ntpq.mdoc.in@1.276 +2 -2
+ NTP_4_2_7P453
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.446 +2 -2
+ NTP_4_2_7P453
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.461 +7 -7
+ NTP_4_2_7P453
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.461 +3 -3
+ NTP_4_2_7P453
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.275 +6 -6
+ NTP_4_2_7P453
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.275 +2 -2
+ NTP_4_2_7P453
+
+ ntpsnmpd/ntpsnmpd.html@1.117 +1 -1
+ NTP_4_2_7P453
+
+ ntpsnmpd/ntpsnmpd.man.in@1.275 +6 -6
+ NTP_4_2_7P453
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.275 +2 -2
+ NTP_4_2_7P453
+
+ packageinfo.sh@1.457 +1 -1
+ NTP_4_2_7P453
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.37 +6 -6
+ NTP_4_2_7P453
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.37 +2 -2
+ NTP_4_2_7P453
+
+ scripts/calc_tickadj/calc_tickadj.html@1.36 +1 -1
+ NTP_4_2_7P453
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.36 +6 -6
+ NTP_4_2_7P453
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P453
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.38 +1 -1
+ NTP_4_2_7P453
+
+ scripts/invoke-plot_summary.texi@1.55 +1 -1
+ NTP_4_2_7P453
+
+ scripts/invoke-summary.texi@1.55 +1 -1
+ NTP_4_2_7P453
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.264 +1 -1
+ NTP_4_2_7P453
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.265 +13 -13
+ NTP_4_2_7P453
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.265 +2 -2
+ NTP_4_2_7P453
+
+ scripts/ntp-wait/ntp-wait.html@1.281 +1 -1
+ NTP_4_2_7P453
+
+ scripts/ntp-wait/ntp-wait.man.in@1.265 +13 -13
+ NTP_4_2_7P453
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.265 +2 -2
+ NTP_4_2_7P453
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.53 +1 -1
+ NTP_4_2_7P453
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.44 +6 -6
+ NTP_4_2_7P453
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.44 +2 -2
+ NTP_4_2_7P453
+
+ scripts/ntpsweep/ntpsweep.html@1.54 +1 -1
+ NTP_4_2_7P453
+
+ scripts/ntpsweep/ntpsweep.man.in@1.44 +6 -6
+ NTP_4_2_7P453
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P453
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.53 +1 -1
+ NTP_4_2_7P453
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.44 +6 -6
+ NTP_4_2_7P453
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.44 +2 -2
+ NTP_4_2_7P453
+
+ scripts/ntptrace/ntptrace.html@1.54 +1 -1
+ NTP_4_2_7P453
+
+ scripts/ntptrace/ntptrace.man.in@1.44 +6 -6
+ NTP_4_2_7P453
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P453
+
+ scripts/plot_summary.1plot_summaryman@1.55 +6 -6
+ NTP_4_2_7P453
+
+ scripts/plot_summary.1plot_summarymdoc@1.55 +2 -2
+ NTP_4_2_7P453
+
+ scripts/plot_summary.html@1.55 +1 -1
+ NTP_4_2_7P453
+
+ scripts/plot_summary.man.in@1.55 +6 -6
+ NTP_4_2_7P453
+
+ scripts/plot_summary.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P453
+
+ scripts/summary.1summaryman@1.55 +6 -6
+ NTP_4_2_7P453
+
+ scripts/summary.1summarymdoc@1.55 +2 -2
+ NTP_4_2_7P453
+
+ scripts/summary.html@1.55 +1 -1
+ NTP_4_2_7P453
+
+ scripts/summary.man.in@1.55 +6 -6
+ NTP_4_2_7P453
+
+ scripts/summary.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P453
+
+ sntp/invoke-sntp.texi@1.443 +2 -2
+ NTP_4_2_7P453
+
+ sntp/sntp-opts.c@1.458 +7 -7
+ NTP_4_2_7P453
+
+ sntp/sntp-opts.h@1.458 +3 -3
+ NTP_4_2_7P453
+
+ sntp/sntp.1sntpman@1.278 +6 -6
+ NTP_4_2_7P453
+
+ sntp/sntp.1sntpmdoc@1.278 +2 -2
+ NTP_4_2_7P453
+
+ sntp/sntp.html@1.458 +2 -2
+ NTP_4_2_7P453
+
+ sntp/sntp.man.in@1.278 +6 -6
+ NTP_4_2_7P453
+
+ sntp/sntp.mdoc.in@1.278 +2 -2
+ NTP_4_2_7P453
+
+ util/invoke-ntp-keygen.texi@1.447 +2 -2
+ NTP_4_2_7P453
+
+ util/ntp-keygen-opts.c@1.461 +7 -7
+ NTP_4_2_7P453
+
+ util/ntp-keygen-opts.h@1.461 +3 -3
+ NTP_4_2_7P453
+
+ util/ntp-keygen.1ntp-keygenman@1.275 +6 -6
+ NTP_4_2_7P453
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.275 +2 -2
+ NTP_4_2_7P453
+
+ util/ntp-keygen.html@1.123 +2 -2
+ NTP_4_2_7P453
+
+ util/ntp-keygen.man.in@1.275 +6 -6
+ NTP_4_2_7P453
+
+ util/ntp-keygen.mdoc.in@1.275 +2 -2
+ NTP_4_2_7P453
+
+ChangeSet@1.3154, 2014-07-18 09:33:45+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P452
+ TAG: NTP_4_2_7P452
+
+ ChangeLog@1.1500 +1 -0
+ NTP_4_2_7P452
+
+ ntpd/invoke-ntp.conf.texi@1.131 +1 -1
+ NTP_4_2_7P452
+
+ ntpd/invoke-ntp.keys.texi@1.129 +1 -1
+ NTP_4_2_7P452
+
+ ntpd/invoke-ntpd.texi@1.445 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntp.conf.5man@1.165 +6 -6
+ NTP_4_2_7P452
+
+ ntpd/ntp.conf.5mdoc@1.165 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntp.conf.html@1.126 +1 -1
+ NTP_4_2_7P452
+
+ ntpd/ntp.conf.man.in@1.165 +6 -6
+ NTP_4_2_7P452
+
+ ntpd/ntp.conf.mdoc.in@1.165 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntp.keys.5man@1.163 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntp.keys.5mdoc@1.163 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntp.keys.html@1.127 +1 -1
+ NTP_4_2_7P452
+
+ ntpd/ntp.keys.man.in@1.163 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntp.keys.mdoc.in@1.163 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntpd-opts.c@1.463 +7 -7
+ NTP_4_2_7P452
+
+ ntpd/ntpd-opts.h@1.463 +3 -3
+ NTP_4_2_7P452
+
+ ntpd/ntpd.1ntpdman@1.274 +13 -13
+ NTP_4_2_7P452
+
+ ntpd/ntpd.1ntpdmdoc@1.274 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntpd.html@1.121 +2 -2
+ NTP_4_2_7P452
+
+ ntpd/ntpd.man.in@1.274 +13 -13
+ NTP_4_2_7P452
+
+ ntpd/ntpd.mdoc.in@1.274 +2 -2
+ NTP_4_2_7P452
+
+ ntpdc/invoke-ntpdc.texi@1.443 +2 -2
+ NTP_4_2_7P452
+
+ ntpdc/ntpdc-opts.c@1.458 +7 -7
+ NTP_4_2_7P452
+
+ ntpdc/ntpdc-opts.h@1.458 +3 -3
+ NTP_4_2_7P452
+
+ ntpdc/ntpdc.1ntpdcman@1.274 +6 -6
+ NTP_4_2_7P452
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.274 +2 -2
+ NTP_4_2_7P452
+
+ ntpdc/ntpdc.html@1.287 +2 -2
+ NTP_4_2_7P452
+
+ ntpdc/ntpdc.man.in@1.274 +6 -6
+ NTP_4_2_7P452
+
+ ntpdc/ntpdc.mdoc.in@1.274 +2 -2
+ NTP_4_2_7P452
+
+ ntpq/invoke-ntpq.texi@1.447 +2 -2
+ NTP_4_2_7P452
+
+ ntpq/ntpq-opts.c@1.461 +7 -7
+ NTP_4_2_7P452
+
+ ntpq/ntpq-opts.h@1.461 +3 -3
+ NTP_4_2_7P452
+
+ ntpq/ntpq.1ntpqman@1.275 +6 -6
+ NTP_4_2_7P452
+
+ ntpq/ntpq.1ntpqmdoc@1.275 +2 -2
+ NTP_4_2_7P452
+
+ ntpq/ntpq.html@1.118 +2 -2
+ NTP_4_2_7P452
+
+ ntpq/ntpq.man.in@1.275 +6 -6
+ NTP_4_2_7P452
+
+ ntpq/ntpq.mdoc.in@1.275 +2 -2
+ NTP_4_2_7P452
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.445 +2 -2
+ NTP_4_2_7P452
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.460 +7 -7
+ NTP_4_2_7P452
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.460 +3 -3
+ NTP_4_2_7P452
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.274 +6 -6
+ NTP_4_2_7P452
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.274 +2 -2
+ NTP_4_2_7P452
+
+ ntpsnmpd/ntpsnmpd.html@1.116 +1 -1
+ NTP_4_2_7P452
+
+ ntpsnmpd/ntpsnmpd.man.in@1.274 +6 -6
+ NTP_4_2_7P452
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.274 +2 -2
+ NTP_4_2_7P452
+
+ packageinfo.sh@1.456 +1 -1
+ NTP_4_2_7P452
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.36 +6 -6
+ NTP_4_2_7P452
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.36 +2 -2
+ NTP_4_2_7P452
+
+ scripts/calc_tickadj/calc_tickadj.html@1.35 +1 -1
+ NTP_4_2_7P452
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.35 +6 -6
+ NTP_4_2_7P452
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P452
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.37 +1 -1
+ NTP_4_2_7P452
+
+ scripts/invoke-plot_summary.texi@1.54 +1 -1
+ NTP_4_2_7P452
+
+ scripts/invoke-summary.texi@1.54 +1 -1
+ NTP_4_2_7P452
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.263 +1 -1
+ NTP_4_2_7P452
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.264 +6 -6
+ NTP_4_2_7P452
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.264 +2 -2
+ NTP_4_2_7P452
+
+ scripts/ntp-wait/ntp-wait.html@1.280 +1 -1
+ NTP_4_2_7P452
+
+ scripts/ntp-wait/ntp-wait.man.in@1.264 +6 -6
+ NTP_4_2_7P452
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.264 +2 -2
+ NTP_4_2_7P452
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.52 +1 -1
+ NTP_4_2_7P452
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.43 +6 -6
+ NTP_4_2_7P452
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.43 +2 -2
+ NTP_4_2_7P452
+
+ scripts/ntpsweep/ntpsweep.html@1.53 +1 -1
+ NTP_4_2_7P452
+
+ scripts/ntpsweep/ntpsweep.man.in@1.43 +6 -6
+ NTP_4_2_7P452
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P452
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.52 +1 -1
+ NTP_4_2_7P452
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.43 +6 -6
+ NTP_4_2_7P452
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.43 +2 -2
+ NTP_4_2_7P452
+
+ scripts/ntptrace/ntptrace.html@1.53 +1 -1
+ NTP_4_2_7P452
+
+ scripts/ntptrace/ntptrace.man.in@1.43 +6 -6
+ NTP_4_2_7P452
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P452
+
+ scripts/plot_summary.1plot_summaryman@1.54 +6 -6
+ NTP_4_2_7P452
+
+ scripts/plot_summary.1plot_summarymdoc@1.54 +2 -2
+ NTP_4_2_7P452
+
+ scripts/plot_summary.html@1.54 +1 -1
+ NTP_4_2_7P452
+
+ scripts/plot_summary.man.in@1.54 +6 -6
+ NTP_4_2_7P452
+
+ scripts/plot_summary.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P452
+
+ scripts/summary.1summaryman@1.54 +6 -6
+ NTP_4_2_7P452
+
+ scripts/summary.1summarymdoc@1.54 +2 -2
+ NTP_4_2_7P452
+
+ scripts/summary.html@1.54 +1 -1
+ NTP_4_2_7P452
+
+ scripts/summary.man.in@1.54 +6 -6
+ NTP_4_2_7P452
+
+ scripts/summary.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P452
+
+ sntp/invoke-sntp.texi@1.442 +2 -2
+ NTP_4_2_7P452
+
+ sntp/sntp-opts.c@1.457 +7 -7
+ NTP_4_2_7P452
+
+ sntp/sntp-opts.h@1.457 +3 -3
+ NTP_4_2_7P452
+
+ sntp/sntp.1sntpman@1.277 +6 -6
+ NTP_4_2_7P452
+
+ sntp/sntp.1sntpmdoc@1.277 +2 -2
+ NTP_4_2_7P452
+
+ sntp/sntp.html@1.457 +2 -2
+ NTP_4_2_7P452
+
+ sntp/sntp.man.in@1.277 +6 -6
+ NTP_4_2_7P452
+
+ sntp/sntp.mdoc.in@1.277 +2 -2
+ NTP_4_2_7P452
+
+ util/invoke-ntp-keygen.texi@1.446 +2 -2
+ NTP_4_2_7P452
+
+ util/ntp-keygen-opts.c@1.460 +7 -7
+ NTP_4_2_7P452
+
+ util/ntp-keygen-opts.h@1.460 +3 -3
+ NTP_4_2_7P452
+
+ util/ntp-keygen.1ntp-keygenman@1.274 +6 -6
+ NTP_4_2_7P452
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.274 +2 -2
+ NTP_4_2_7P452
+
+ util/ntp-keygen.html@1.122 +2 -2
+ NTP_4_2_7P452
+
+ util/ntp-keygen.man.in@1.274 +6 -6
+ NTP_4_2_7P452
+
+ util/ntp-keygen.mdoc.in@1.274 +2 -2
+ NTP_4_2_7P452
+
+ChangeSet@1.3153, 2014-07-18 04:36:57-04:00, stenn@deacon.udel.edu
+ Make all of the html/ .html files use the same format for "Last update"
+
+ ChangeLog@1.1499 +1 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/assoc.html@1.41 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/comdex.html@1.7 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/config.html@1.25 +3 -2
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/confopt.html@1.62 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/copyright.html@1.64 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/decode.html@1.25 +3 -2
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/discipline.html@1.10 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/discover.html@1.6 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver16.html@1.13 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver20.html@1.29 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver26.html@1.11 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver27.html@1.17 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver28.html@1.15 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver29.html@1.17 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver30.html@1.21 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver31.html@1.4 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver32.html@1.14 +3 -1
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver33.html@1.14 +3 -2
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver34.html@1.13 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver35.html@1.16 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver37.html@1.14 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver38.html@1.16 +3 -1
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver39.html@1.15 +3 -1
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver40.html@1.16 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver42.html@1.14 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver43.html@1.12 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver44.html@1.15 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver45.html@1.4 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver46.html@1.2 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver6.html@1.30 +2 -2
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver7.html@1.31 +2 -1
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver8.html@1.31 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/driver9.html@1.16 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/mx4200data.html@1.3 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/oncore-shmem.html@1.14 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/drivers/tf582_4.html@1.4 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/extern.html@1.21 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/filter.html@1.8 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/hints.html@1.20 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/hints/sco.html@1.12 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/hints/solaris.html@1.12 +4 -1
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/hints/vxworks.html@1.11 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/history.html@1.4 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/howto.html@1.25 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/huffpuff.html@1.6 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/kern.html@1.22 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/kernpps.html@1.5 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/keygen.html@1.34 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/leap.html@1.7 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/miscopt.html@1.78 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/monopt.html@1.38 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/msyslog.html@1.12 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/ntp-wait.html@1.2 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/ntpd.html@1.62 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/ntpdate.html@1.28 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/ntpdc.html@1.39 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/ntpdsim_new.html@1.9 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/ntpq.html@1.50 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/ntptrace.html@1.21 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/parsedata.html@1.14 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/parsenew.html@1.13 +3 -0
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/poll.html@1.5 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/pps.html@1.26 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/prefer.html@1.33 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/rate.html@1.13 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/rdebug.html@1.19 +4 -4
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/refclock.html@1.43 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/select.html@1.10 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/stats.html@1.3 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/tickadj.html@1.19 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/warp.html@1.24 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ html/xleave.html@1.10 +3 -3
+ Make all of the html/ .html files use the same format for "Last update"
+
+ChangeSet@1.3152, 2014-07-17 09:33:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P451
+ TAG: NTP_4_2_7P451
+
+ ChangeLog@1.1498 +1 -0
+ NTP_4_2_7P451
+
+ ntpd/invoke-ntp.conf.texi@1.130 +1 -1
+ NTP_4_2_7P451
+
+ ntpd/invoke-ntp.keys.texi@1.128 +1 -1
+ NTP_4_2_7P451
+
+ ntpd/invoke-ntpd.texi@1.444 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntp.conf.5man@1.164 +6 -6
+ NTP_4_2_7P451
+
+ ntpd/ntp.conf.5mdoc@1.164 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntp.conf.html@1.125 +1 -1
+ NTP_4_2_7P451
+
+ ntpd/ntp.conf.man.in@1.164 +6 -6
+ NTP_4_2_7P451
+
+ ntpd/ntp.conf.mdoc.in@1.164 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntp.keys.5man@1.162 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntp.keys.5mdoc@1.162 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntp.keys.html@1.126 +1 -1
+ NTP_4_2_7P451
+
+ ntpd/ntp.keys.man.in@1.162 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntp.keys.mdoc.in@1.162 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntpd-opts.c@1.462 +7 -7
+ NTP_4_2_7P451
+
+ ntpd/ntpd-opts.h@1.462 +3 -3
+ NTP_4_2_7P451
+
+ ntpd/ntpd.1ntpdman@1.273 +6 -6
+ NTP_4_2_7P451
+
+ ntpd/ntpd.1ntpdmdoc@1.273 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntpd.html@1.120 +2 -2
+ NTP_4_2_7P451
+
+ ntpd/ntpd.man.in@1.273 +6 -6
+ NTP_4_2_7P451
+
+ ntpd/ntpd.mdoc.in@1.273 +2 -2
+ NTP_4_2_7P451
+
+ ntpdc/invoke-ntpdc.texi@1.442 +2 -2
+ NTP_4_2_7P451
+
+ ntpdc/ntpdc-opts.c@1.457 +7 -7
+ NTP_4_2_7P451
+
+ ntpdc/ntpdc-opts.h@1.457 +3 -3
+ NTP_4_2_7P451
+
+ ntpdc/ntpdc.1ntpdcman@1.273 +6 -6
+ NTP_4_2_7P451
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.273 +2 -2
+ NTP_4_2_7P451
+
+ ntpdc/ntpdc.html@1.286 +2 -2
+ NTP_4_2_7P451
+
+ ntpdc/ntpdc.man.in@1.273 +6 -6
+ NTP_4_2_7P451
+
+ ntpdc/ntpdc.mdoc.in@1.273 +2 -2
+ NTP_4_2_7P451
+
+ ntpq/invoke-ntpq.texi@1.446 +2 -2
+ NTP_4_2_7P451
+
+ ntpq/ntpq-opts.c@1.460 +7 -7
+ NTP_4_2_7P451
+
+ ntpq/ntpq-opts.h@1.460 +3 -3
+ NTP_4_2_7P451
+
+ ntpq/ntpq.1ntpqman@1.274 +6 -6
+ NTP_4_2_7P451
+
+ ntpq/ntpq.1ntpqmdoc@1.274 +2 -2
+ NTP_4_2_7P451
+
+ ntpq/ntpq.html@1.117 +2 -2
+ NTP_4_2_7P451
+
+ ntpq/ntpq.man.in@1.274 +6 -6
+ NTP_4_2_7P451
+
+ ntpq/ntpq.mdoc.in@1.274 +2 -2
+ NTP_4_2_7P451
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.444 +2 -2
+ NTP_4_2_7P451
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.459 +7 -7
+ NTP_4_2_7P451
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.459 +3 -3
+ NTP_4_2_7P451
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.273 +6 -6
+ NTP_4_2_7P451
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.273 +2 -2
+ NTP_4_2_7P451
+
+ ntpsnmpd/ntpsnmpd.html@1.115 +1 -1
+ NTP_4_2_7P451
+
+ ntpsnmpd/ntpsnmpd.man.in@1.273 +6 -6
+ NTP_4_2_7P451
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.273 +2 -2
+ NTP_4_2_7P451
+
+ packageinfo.sh@1.455 +1 -1
+ NTP_4_2_7P451
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.35 +6 -6
+ NTP_4_2_7P451
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.35 +2 -2
+ NTP_4_2_7P451
+
+ scripts/calc_tickadj/calc_tickadj.html@1.34 +1 -1
+ NTP_4_2_7P451
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.34 +6 -6
+ NTP_4_2_7P451
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P451
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.36 +1 -1
+ NTP_4_2_7P451
+
+ scripts/invoke-plot_summary.texi@1.53 +1 -1
+ NTP_4_2_7P451
+
+ scripts/invoke-summary.texi@1.53 +1 -1
+ NTP_4_2_7P451
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.262 +1 -1
+ NTP_4_2_7P451
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.263 +6 -6
+ NTP_4_2_7P451
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.263 +2 -2
+ NTP_4_2_7P451
+
+ scripts/ntp-wait/ntp-wait.html@1.279 +1 -1
+ NTP_4_2_7P451
+
+ scripts/ntp-wait/ntp-wait.man.in@1.263 +6 -6
+ NTP_4_2_7P451
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.263 +2 -2
+ NTP_4_2_7P451
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.51 +1 -1
+ NTP_4_2_7P451
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.42 +6 -6
+ NTP_4_2_7P451
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.42 +2 -2
+ NTP_4_2_7P451
+
+ scripts/ntpsweep/ntpsweep.html@1.52 +1 -1
+ NTP_4_2_7P451
+
+ scripts/ntpsweep/ntpsweep.man.in@1.42 +6 -6
+ NTP_4_2_7P451
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P451
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.51 +1 -1
+ NTP_4_2_7P451
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.42 +6 -6
+ NTP_4_2_7P451
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.42 +2 -2
+ NTP_4_2_7P451
+
+ scripts/ntptrace/ntptrace.html@1.52 +1 -1
+ NTP_4_2_7P451
+
+ scripts/ntptrace/ntptrace.man.in@1.42 +6 -6
+ NTP_4_2_7P451
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P451
+
+ scripts/plot_summary.1plot_summaryman@1.53 +6 -6
+ NTP_4_2_7P451
+
+ scripts/plot_summary.1plot_summarymdoc@1.53 +2 -2
+ NTP_4_2_7P451
+
+ scripts/plot_summary.html@1.53 +1 -1
+ NTP_4_2_7P451
+
+ scripts/plot_summary.man.in@1.53 +6 -6
+ NTP_4_2_7P451
+
+ scripts/plot_summary.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P451
+
+ scripts/summary.1summaryman@1.53 +6 -6
+ NTP_4_2_7P451
+
+ scripts/summary.1summarymdoc@1.53 +2 -2
+ NTP_4_2_7P451
+
+ scripts/summary.html@1.53 +1 -1
+ NTP_4_2_7P451
+
+ scripts/summary.man.in@1.53 +6 -6
+ NTP_4_2_7P451
+
+ scripts/summary.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P451
+
+ sntp/invoke-sntp.texi@1.441 +2 -2
+ NTP_4_2_7P451
+
+ sntp/sntp-opts.c@1.456 +7 -7
+ NTP_4_2_7P451
+
+ sntp/sntp-opts.h@1.456 +3 -3
+ NTP_4_2_7P451
+
+ sntp/sntp.1sntpman@1.276 +6 -6
+ NTP_4_2_7P451
+
+ sntp/sntp.1sntpmdoc@1.276 +2 -2
+ NTP_4_2_7P451
+
+ sntp/sntp.html@1.456 +2 -2
+ NTP_4_2_7P451
+
+ sntp/sntp.man.in@1.276 +6 -6
+ NTP_4_2_7P451
+
+ sntp/sntp.mdoc.in@1.276 +2 -2
+ NTP_4_2_7P451
+
+ util/invoke-ntp-keygen.texi@1.445 +2 -2
+ NTP_4_2_7P451
+
+ util/ntp-keygen-opts.c@1.459 +7 -7
+ NTP_4_2_7P451
+
+ util/ntp-keygen-opts.h@1.459 +3 -3
+ NTP_4_2_7P451
+
+ util/ntp-keygen.1ntp-keygenman@1.273 +6 -6
+ NTP_4_2_7P451
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.273 +2 -2
+ NTP_4_2_7P451
+
+ util/ntp-keygen.html@1.121 +2 -2
+ NTP_4_2_7P451
+
+ util/ntp-keygen.man.in@1.273 +6 -6
+ NTP_4_2_7P451
+
+ util/ntp-keygen.mdoc.in@1.273 +2 -2
+ NTP_4_2_7P451
+
+ChangeSet@1.3151, 2014-07-17 06:13:14+00:00, stenn@psp-deb1.ntp.org
+ Fix the "Last update" entries in the html/ subtree
+
+ ChangeLog@1.1497 +1 -0
+ Fix the "Last update" entries in the html/ subtree
+
+ html/access.html@1.2 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/accopt.html@1.42 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/audio.html@1.23 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/authentic.html@1.14 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/authopt.html@1.74 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/autokey.html@1.22 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/bugs.html@1.7 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/build.html@1.27 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/clock.html@1.4 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/clockopt.html@1.24 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/cluster.html@1.9 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/debug.html@1.33 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver1.html@1.22 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver10.html@1.14 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver11.html@1.14 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver12.html@1.13 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver18.html@1.20 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver19.html@1.13 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver22.html@1.22 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver3.html@1.13 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver36.html@1.35 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver4.html@1.17 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver6.html@1.29 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/drivers/driver7.html@1.30 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/hints/winnt.html@1.24 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/index.html@1.47 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/ntp_conf.html@1.7 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/ntpdsim.html@1.9 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/ntptime.html@1.18 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/orphan.html@1.4 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/quick.html@1.25 +2 -2
+ Fix the "Last update" entries in the html/ subtree
+
+ html/release.html@1.43 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/sitemap.html@1.5 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ html/sntp.html@1.10 +1 -1
+ Fix the "Last update" entries in the html/ subtree
+
+ChangeSet@1.3148.1.1, 2014-07-17 00:02:39+02:00, jnperlin@hydra.(none)
+ [Bug 2597] leap file loose ends
+ - uniform log messages for timer and config triggered leap file loads
+ - timer triggered load errors only once per day
+
+ ChangeLog@1.1494.1.1 +4 -0
+ [Bug 2597] leap file loose ends
+ - uniform log messages for timer and config triggered leap file loads
+ - timer triggered load errors only once per day
+
+ ntpd/ntp_leapsec.c@1.13 +37 -32
+ [Bug 2597] file/stream load supports 'logall' flag to enable silent operation
+
+ ntpd/ntp_leapsec.h@1.8 +3 -2
+ [Bug 2597] file/stream load supports 'logall' flag to enable silent operation
+
+ ntpd/ntp_timer.c@1.82 +4 -4
+ [Bug 2597] proper setup for leap file check timer
+
+ ntpd/ntp_util.c@1.115 +32 -11
+ [Bug 2597] unified expiration check messages for timer and config triggered leap file load
+
+ChangeSet@1.3150, 2014-07-16 21:57:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P450
+ TAG: NTP_4_2_7P450
+
+ ChangeLog@1.1496 +1 -0
+ NTP_4_2_7P450
+
+ ntpd/invoke-ntp.conf.texi@1.129 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/invoke-ntp.keys.texi@1.127 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/invoke-ntpd.texi@1.443 +2 -2
+ NTP_4_2_7P450
+
+ ntpd/ntp.conf.5man@1.163 +6 -6
+ NTP_4_2_7P450
+
+ ntpd/ntp.conf.5mdoc@1.163 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/ntp.conf.html@1.124 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/ntp.conf.man.in@1.163 +6 -6
+ NTP_4_2_7P450
+
+ ntpd/ntp.conf.mdoc.in@1.163 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/ntp.keys.5man@1.161 +2 -2
+ NTP_4_2_7P450
+
+ ntpd/ntp.keys.5mdoc@1.161 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/ntp.keys.html@1.125 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/ntp.keys.man.in@1.161 +2 -2
+ NTP_4_2_7P450
+
+ ntpd/ntp.keys.mdoc.in@1.161 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/ntpd-opts.c@1.461 +7 -7
+ NTP_4_2_7P450
+
+ ntpd/ntpd-opts.h@1.461 +3 -3
+ NTP_4_2_7P450
+
+ ntpd/ntpd.1ntpdman@1.272 +6 -6
+ NTP_4_2_7P450
+
+ ntpd/ntpd.1ntpdmdoc@1.272 +1 -1
+ NTP_4_2_7P450
+
+ ntpd/ntpd.html@1.119 +2 -2
+ NTP_4_2_7P450
+
+ ntpd/ntpd.man.in@1.272 +6 -6
+ NTP_4_2_7P450
+
+ ntpd/ntpd.mdoc.in@1.272 +1 -1
+ NTP_4_2_7P450
+
+ ntpdc/invoke-ntpdc.texi@1.441 +2 -2
+ NTP_4_2_7P450
+
+ ntpdc/ntpdc-opts.c@1.456 +7 -7
+ NTP_4_2_7P450
+
+ ntpdc/ntpdc-opts.h@1.456 +3 -3
+ NTP_4_2_7P450
+
+ ntpdc/ntpdc.1ntpdcman@1.272 +6 -6
+ NTP_4_2_7P450
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.272 +1 -1
+ NTP_4_2_7P450
+
+ ntpdc/ntpdc.html@1.285 +2 -2
+ NTP_4_2_7P450
+
+ ntpdc/ntpdc.man.in@1.272 +6 -6
+ NTP_4_2_7P450
+
+ ntpdc/ntpdc.mdoc.in@1.272 +1 -1
+ NTP_4_2_7P450
+
+ ntpq/invoke-ntpq.texi@1.445 +2 -2
+ NTP_4_2_7P450
+
+ ntpq/ntpq-opts.c@1.459 +7 -7
+ NTP_4_2_7P450
+
+ ntpq/ntpq-opts.h@1.459 +3 -3
+ NTP_4_2_7P450
+
+ ntpq/ntpq.1ntpqman@1.273 +6 -6
+ NTP_4_2_7P450
+
+ ntpq/ntpq.1ntpqmdoc@1.273 +1 -1
+ NTP_4_2_7P450
+
+ ntpq/ntpq.html@1.116 +2 -2
+ NTP_4_2_7P450
+
+ ntpq/ntpq.man.in@1.273 +6 -6
+ NTP_4_2_7P450
+
+ ntpq/ntpq.mdoc.in@1.273 +1 -1
+ NTP_4_2_7P450
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.443 +2 -2
+ NTP_4_2_7P450
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.458 +7 -7
+ NTP_4_2_7P450
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.458 +3 -3
+ NTP_4_2_7P450
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.272 +6 -6
+ NTP_4_2_7P450
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.272 +1 -1
+ NTP_4_2_7P450
+
+ ntpsnmpd/ntpsnmpd.html@1.114 +1 -1
+ NTP_4_2_7P450
+
+ ntpsnmpd/ntpsnmpd.man.in@1.272 +6 -6
+ NTP_4_2_7P450
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.272 +1 -1
+ NTP_4_2_7P450
+
+ packageinfo.sh@1.454 +1 -1
+ NTP_4_2_7P450
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.34 +6 -6
+ NTP_4_2_7P450
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.34 +1 -1
+ NTP_4_2_7P450
+
+ scripts/calc_tickadj/calc_tickadj.html@1.33 +1 -1
+ NTP_4_2_7P450
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.33 +6 -6
+ NTP_4_2_7P450
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.34 +1 -1
+ NTP_4_2_7P450
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.35 +1 -1
+ NTP_4_2_7P450
+
+ scripts/invoke-plot_summary.texi@1.52 +1 -1
+ NTP_4_2_7P450
+
+ scripts/invoke-summary.texi@1.52 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.261 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.262 +6 -6
+ NTP_4_2_7P450
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.262 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntp-wait/ntp-wait.html@1.278 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntp-wait/ntp-wait.man.in@1.262 +6 -6
+ NTP_4_2_7P450
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.262 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.50 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.41 +6 -6
+ NTP_4_2_7P450
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.41 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntpsweep/ntpsweep.html@1.51 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntpsweep/ntpsweep.man.in@1.41 +6 -6
+ NTP_4_2_7P450
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.42 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.50 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.41 +6 -6
+ NTP_4_2_7P450
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.41 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntptrace/ntptrace.html@1.51 +1 -1
+ NTP_4_2_7P450
+
+ scripts/ntptrace/ntptrace.man.in@1.41 +6 -6
+ NTP_4_2_7P450
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.42 +1 -1
+ NTP_4_2_7P450
+
+ scripts/plot_summary.1plot_summaryman@1.52 +6 -6
+ NTP_4_2_7P450
+
+ scripts/plot_summary.1plot_summarymdoc@1.52 +2 -2
+ NTP_4_2_7P450
+
+ scripts/plot_summary.html@1.52 +1 -1
+ NTP_4_2_7P450
+
+ scripts/plot_summary.man.in@1.52 +6 -6
+ NTP_4_2_7P450
+
+ scripts/plot_summary.mdoc.in@1.52 +2 -2
+ NTP_4_2_7P450
+
+ scripts/summary.1summaryman@1.52 +6 -6
+ NTP_4_2_7P450
+
+ scripts/summary.1summarymdoc@1.52 +1 -1
+ NTP_4_2_7P450
+
+ scripts/summary.html@1.52 +1 -1
+ NTP_4_2_7P450
+
+ scripts/summary.man.in@1.52 +6 -6
+ NTP_4_2_7P450
+
+ scripts/summary.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P450
+
+ sntp/invoke-sntp.texi@1.440 +2 -2
+ NTP_4_2_7P450
+
+ sntp/sntp-opts.c@1.455 +7 -7
+ NTP_4_2_7P450
+
+ sntp/sntp-opts.h@1.455 +3 -3
+ NTP_4_2_7P450
+
+ sntp/sntp.1sntpman@1.275 +6 -6
+ NTP_4_2_7P450
+
+ sntp/sntp.1sntpmdoc@1.275 +1 -1
+ NTP_4_2_7P450
+
+ sntp/sntp.html@1.455 +2 -2
+ NTP_4_2_7P450
+
+ sntp/sntp.man.in@1.275 +6 -6
+ NTP_4_2_7P450
+
+ sntp/sntp.mdoc.in@1.275 +1 -1
+ NTP_4_2_7P450
+
+ util/invoke-ntp-keygen.texi@1.444 +2 -2
+ NTP_4_2_7P450
+
+ util/ntp-keygen-opts.c@1.458 +7 -7
+ NTP_4_2_7P450
+
+ util/ntp-keygen-opts.h@1.458 +3 -3
+ NTP_4_2_7P450
+
+ util/ntp-keygen.1ntp-keygenman@1.272 +6 -6
+ NTP_4_2_7P450
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.272 +1 -1
+ NTP_4_2_7P450
+
+ util/ntp-keygen.html@1.120 +2 -2
+ NTP_4_2_7P450
+
+ util/ntp-keygen.man.in@1.272 +6 -6
+ NTP_4_2_7P450
+
+ util/ntp-keygen.mdoc.in@1.272 +1 -1
+ NTP_4_2_7P450
+
+ChangeSet@1.3149, 2014-07-16 17:20:01-04:00, stenn@deacon.udel.edu
+ Distribute the scripts needed for the fix for Bug 2547
+
+ ChangeLog@1.1495 +1 -0
+ Distribute the scripts needed for the fix for Bug 2547
+
+ scripts/build/Makefile.am@1.3 +5 -1
+ Distribute the scripts needed for the fix for Bug 2547
+
+ scripts/build/Makefile.am@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.3148, 2014-07-16 09:33:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P449
+ TAG: NTP_4_2_7P449
+
+ ChangeLog@1.1494 +1 -0
+ NTP_4_2_7P449
+
+ ntpd/invoke-ntp.conf.texi@1.128 +1 -1
+ NTP_4_2_7P449
+
+ ntpd/invoke-ntp.keys.texi@1.126 +1 -1
+ NTP_4_2_7P449
+
+ ntpd/invoke-ntpd.texi@1.442 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntp.conf.5man@1.162 +6 -6
+ NTP_4_2_7P449
+
+ ntpd/ntp.conf.5mdoc@1.162 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntp.conf.html@1.123 +1 -1
+ NTP_4_2_7P449
+
+ ntpd/ntp.conf.man.in@1.162 +6 -6
+ NTP_4_2_7P449
+
+ ntpd/ntp.conf.mdoc.in@1.162 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntp.keys.5man@1.160 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntp.keys.5mdoc@1.160 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntp.keys.html@1.124 +1 -1
+ NTP_4_2_7P449
+
+ ntpd/ntp.keys.man.in@1.160 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntp.keys.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntpd-opts.c@1.460 +7 -7
+ NTP_4_2_7P449
+
+ ntpd/ntpd-opts.h@1.460 +3 -3
+ NTP_4_2_7P449
+
+ ntpd/ntpd.1ntpdman@1.271 +6 -6
+ NTP_4_2_7P449
+
+ ntpd/ntpd.1ntpdmdoc@1.271 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntpd.html@1.118 +2 -2
+ NTP_4_2_7P449
+
+ ntpd/ntpd.man.in@1.271 +6 -6
+ NTP_4_2_7P449
+
+ ntpd/ntpd.mdoc.in@1.271 +2 -2
+ NTP_4_2_7P449
+
+ ntpdc/invoke-ntpdc.texi@1.440 +2 -2
+ NTP_4_2_7P449
+
+ ntpdc/ntpdc-opts.c@1.455 +7 -7
+ NTP_4_2_7P449
+
+ ntpdc/ntpdc-opts.h@1.455 +3 -3
+ NTP_4_2_7P449
+
+ ntpdc/ntpdc.1ntpdcman@1.271 +6 -6
+ NTP_4_2_7P449
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.271 +2 -2
+ NTP_4_2_7P449
+
+ ntpdc/ntpdc.html@1.284 +2 -2
+ NTP_4_2_7P449
+
+ ntpdc/ntpdc.man.in@1.271 +6 -6
+ NTP_4_2_7P449
+
+ ntpdc/ntpdc.mdoc.in@1.271 +2 -2
+ NTP_4_2_7P449
+
+ ntpq/invoke-ntpq.texi@1.444 +2 -2
+ NTP_4_2_7P449
+
+ ntpq/ntpq-opts.c@1.458 +7 -7
+ NTP_4_2_7P449
+
+ ntpq/ntpq-opts.h@1.458 +3 -3
+ NTP_4_2_7P449
+
+ ntpq/ntpq.1ntpqman@1.272 +6 -6
+ NTP_4_2_7P449
+
+ ntpq/ntpq.1ntpqmdoc@1.272 +2 -2
+ NTP_4_2_7P449
+
+ ntpq/ntpq.html@1.115 +2 -2
+ NTP_4_2_7P449
+
+ ntpq/ntpq.man.in@1.272 +6 -6
+ NTP_4_2_7P449
+
+ ntpq/ntpq.mdoc.in@1.272 +2 -2
+ NTP_4_2_7P449
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.442 +2 -2
+ NTP_4_2_7P449
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.457 +7 -7
+ NTP_4_2_7P449
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.457 +3 -3
+ NTP_4_2_7P449
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.271 +6 -6
+ NTP_4_2_7P449
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.271 +2 -2
+ NTP_4_2_7P449
+
+ ntpsnmpd/ntpsnmpd.html@1.113 +1 -1
+ NTP_4_2_7P449
+
+ ntpsnmpd/ntpsnmpd.man.in@1.271 +6 -6
+ NTP_4_2_7P449
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.271 +2 -2
+ NTP_4_2_7P449
+
+ packageinfo.sh@1.453 +1 -1
+ NTP_4_2_7P449
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.33 +6 -6
+ NTP_4_2_7P449
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.33 +2 -2
+ NTP_4_2_7P449
+
+ scripts/calc_tickadj/calc_tickadj.html@1.32 +1 -1
+ NTP_4_2_7P449
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.32 +6 -6
+ NTP_4_2_7P449
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P449
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.34 +1 -1
+ NTP_4_2_7P449
+
+ scripts/invoke-plot_summary.texi@1.51 +1 -1
+ NTP_4_2_7P449
+
+ scripts/invoke-summary.texi@1.51 +1 -1
+ NTP_4_2_7P449
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.260 +1 -1
+ NTP_4_2_7P449
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.261 +6 -6
+ NTP_4_2_7P449
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.261 +2 -2
+ NTP_4_2_7P449
+
+ scripts/ntp-wait/ntp-wait.html@1.277 +1 -1
+ NTP_4_2_7P449
+
+ scripts/ntp-wait/ntp-wait.man.in@1.261 +6 -6
+ NTP_4_2_7P449
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.261 +2 -2
+ NTP_4_2_7P449
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.49 +1 -1
+ NTP_4_2_7P449
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.40 +6 -6
+ NTP_4_2_7P449
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.40 +2 -2
+ NTP_4_2_7P449
+
+ scripts/ntpsweep/ntpsweep.html@1.50 +1 -1
+ NTP_4_2_7P449
+
+ scripts/ntpsweep/ntpsweep.man.in@1.40 +6 -6
+ NTP_4_2_7P449
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P449
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.49 +1 -1
+ NTP_4_2_7P449
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.40 +6 -6
+ NTP_4_2_7P449
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.40 +2 -2
+ NTP_4_2_7P449
+
+ scripts/ntptrace/ntptrace.html@1.50 +1 -1
+ NTP_4_2_7P449
+
+ scripts/ntptrace/ntptrace.man.in@1.40 +6 -6
+ NTP_4_2_7P449
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P449
+
+ scripts/plot_summary.1plot_summaryman@1.51 +6 -6
+ NTP_4_2_7P449
+
+ scripts/plot_summary.1plot_summarymdoc@1.51 +3 -3
+ NTP_4_2_7P449
+
+ scripts/plot_summary.html@1.51 +1 -1
+ NTP_4_2_7P449
+
+ scripts/plot_summary.man.in@1.51 +6 -6
+ NTP_4_2_7P449
+
+ scripts/plot_summary.mdoc.in@1.51 +3 -3
+ NTP_4_2_7P449
+
+ scripts/summary.1summaryman@1.51 +6 -6
+ NTP_4_2_7P449
+
+ scripts/summary.1summarymdoc@1.51 +2 -2
+ NTP_4_2_7P449
+
+ scripts/summary.html@1.51 +1 -1
+ NTP_4_2_7P449
+
+ scripts/summary.man.in@1.51 +6 -6
+ NTP_4_2_7P449
+
+ scripts/summary.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P449
+
+ sntp/invoke-sntp.texi@1.439 +2 -2
+ NTP_4_2_7P449
+
+ sntp/sntp-opts.c@1.454 +7 -7
+ NTP_4_2_7P449
+
+ sntp/sntp-opts.h@1.454 +3 -3
+ NTP_4_2_7P449
+
+ sntp/sntp.1sntpman@1.274 +6 -6
+ NTP_4_2_7P449
+
+ sntp/sntp.1sntpmdoc@1.274 +2 -2
+ NTP_4_2_7P449
+
+ sntp/sntp.html@1.454 +2 -2
+ NTP_4_2_7P449
+
+ sntp/sntp.man.in@1.274 +6 -6
+ NTP_4_2_7P449
+
+ sntp/sntp.mdoc.in@1.274 +2 -2
+ NTP_4_2_7P449
+
+ util/invoke-ntp-keygen.texi@1.443 +2 -2
+ NTP_4_2_7P449
+
+ util/ntp-keygen-opts.c@1.457 +7 -7
+ NTP_4_2_7P449
+
+ util/ntp-keygen-opts.h@1.457 +3 -3
+ NTP_4_2_7P449
+
+ util/ntp-keygen.1ntp-keygenman@1.271 +6 -6
+ NTP_4_2_7P449
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.271 +2 -2
+ NTP_4_2_7P449
+
+ util/ntp-keygen.html@1.119 +2 -2
+ NTP_4_2_7P449
+
+ util/ntp-keygen.man.in@1.271 +6 -6
+ NTP_4_2_7P449
+
+ util/ntp-keygen.mdoc.in@1.271 +2 -2
+ NTP_4_2_7P449
+
+ChangeSet@1.3147, 2014-07-16 01:37:41-07:00, harlan@hms-mbp11.pfcs.com
+ Fix typos in decode.html and debug.html
+
+ ChangeLog@1.1493 +1 -0
+ Fix typos in decode.html and debug.html
+
+ html/debug.html@1.32 +3 -3
+ Fix typos in decode.html and debug.html
+
+ html/decode.html@1.24 +1 -1
+ Fix typos in decode.html and debug.html
+
+ChangeSet@1.3146, 2014-07-16 01:33:06-07:00, harlan@hms-mbp11.pfcs.com
+ [Bug 2547] Automate update of "Last Update" datestamps in .html files
+
+ ChangeLog@1.1492 +1 -0
+ [Bug 2547] Automate update of "Last Update" datestamps in .html files
+
+ Makefile.am@1.119 +24 -19
+ [Bug 2547] Automate update of "Last Update" datestamps in .html files
+
+ scripts/build/checkHtmlFileDates@1.1 +16 -0
+ BitKeeper file /Users/harlan/src/ntp-dev/scripts/build/checkHtmlFileDates
+
+ scripts/build/checkHtmlFileDates@1.0 +0 -0
+
+ scripts/build/updateBEDate@1.1 +53 -0
+ BitKeeper file /Users/harlan/src/ntp-dev/scripts/build/updateBEDate
+
+ scripts/build/updateBEDate@1.0 +0 -0
+
+ChangeSet@1.3145, 2014-07-16 02:45:17-04:00, stenn@deacon.udel.edu
+ Quiet warnings from ntp_calendar.h: avoid using argument names
+
+ ChangeLog@1.1491 +1 -0
+ Quiet warnings from ntp_calendar.h: avoid using argument names
+
+ include/ntp_calendar.h@1.16 +41 -38
+ Quiet warnings from ntp_calendar.h: avoid using argument names
+
+ChangeSet@1.3144, 2014-07-16 04:17:40+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2623] Missing {} in refclock_oncore.c
+
+ ChangeLog@1.1490 +1 -0
+ [Bug 2623] Missing {} in refclock_oncore.c
+
+ ntpd/refclock_oncore.c@1.100 +2 -1
+ [Bug 2623] Missing {} in refclock_oncore.c
+
+ChangeSet@1.3143, 2014-07-15 09:34:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P448
+ TAG: NTP_4_2_7P448
+
+ ChangeLog@1.1489 +1 -0
+ NTP_4_2_7P448
+
+ ntpd/invoke-ntp.conf.texi@1.127 +1 -1
+ NTP_4_2_7P448
+
+ ntpd/invoke-ntp.keys.texi@1.125 +1 -1
+ NTP_4_2_7P448
+
+ ntpd/invoke-ntpd.texi@1.441 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntp.conf.5man@1.161 +6 -6
+ NTP_4_2_7P448
+
+ ntpd/ntp.conf.5mdoc@1.161 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntp.conf.html@1.122 +1 -1
+ NTP_4_2_7P448
+
+ ntpd/ntp.conf.man.in@1.161 +6 -6
+ NTP_4_2_7P448
+
+ ntpd/ntp.conf.mdoc.in@1.161 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntp.keys.5man@1.159 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntp.keys.5mdoc@1.159 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntp.keys.html@1.123 +1 -1
+ NTP_4_2_7P448
+
+ ntpd/ntp.keys.man.in@1.159 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntp.keys.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntpd-opts.c@1.459 +7 -7
+ NTP_4_2_7P448
+
+ ntpd/ntpd-opts.h@1.459 +3 -3
+ NTP_4_2_7P448
+
+ ntpd/ntpd.1ntpdman@1.270 +6 -6
+ NTP_4_2_7P448
+
+ ntpd/ntpd.1ntpdmdoc@1.270 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntpd.html@1.117 +2 -2
+ NTP_4_2_7P448
+
+ ntpd/ntpd.man.in@1.270 +6 -6
+ NTP_4_2_7P448
+
+ ntpd/ntpd.mdoc.in@1.270 +2 -2
+ NTP_4_2_7P448
+
+ ntpdc/invoke-ntpdc.texi@1.439 +2 -2
+ NTP_4_2_7P448
+
+ ntpdc/ntpdc-opts.c@1.454 +7 -7
+ NTP_4_2_7P448
+
+ ntpdc/ntpdc-opts.h@1.454 +3 -3
+ NTP_4_2_7P448
+
+ ntpdc/ntpdc.1ntpdcman@1.270 +6 -6
+ NTP_4_2_7P448
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.270 +2 -2
+ NTP_4_2_7P448
+
+ ntpdc/ntpdc.html@1.283 +2 -2
+ NTP_4_2_7P448
+
+ ntpdc/ntpdc.man.in@1.270 +6 -6
+ NTP_4_2_7P448
+
+ ntpdc/ntpdc.mdoc.in@1.270 +2 -2
+ NTP_4_2_7P448
+
+ ntpq/invoke-ntpq.texi@1.443 +2 -2
+ NTP_4_2_7P448
+
+ ntpq/ntpq-opts.c@1.457 +7 -7
+ NTP_4_2_7P448
+
+ ntpq/ntpq-opts.h@1.457 +3 -3
+ NTP_4_2_7P448
+
+ ntpq/ntpq.1ntpqman@1.271 +6 -6
+ NTP_4_2_7P448
+
+ ntpq/ntpq.1ntpqmdoc@1.271 +2 -2
+ NTP_4_2_7P448
+
+ ntpq/ntpq.html@1.114 +2 -2
+ NTP_4_2_7P448
+
+ ntpq/ntpq.man.in@1.271 +6 -6
+ NTP_4_2_7P448
+
+ ntpq/ntpq.mdoc.in@1.271 +2 -2
+ NTP_4_2_7P448
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.441 +2 -2
+ NTP_4_2_7P448
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.456 +7 -7
+ NTP_4_2_7P448
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.456 +3 -3
+ NTP_4_2_7P448
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.270 +6 -6
+ NTP_4_2_7P448
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.270 +2 -2
+ NTP_4_2_7P448
+
+ ntpsnmpd/ntpsnmpd.html@1.112 +1 -1
+ NTP_4_2_7P448
+
+ ntpsnmpd/ntpsnmpd.man.in@1.270 +6 -6
+ NTP_4_2_7P448
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.270 +2 -2
+ NTP_4_2_7P448
+
+ packageinfo.sh@1.452 +1 -1
+ NTP_4_2_7P448
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.32 +6 -6
+ NTP_4_2_7P448
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.32 +2 -2
+ NTP_4_2_7P448
+
+ scripts/calc_tickadj/calc_tickadj.html@1.31 +1 -1
+ NTP_4_2_7P448
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.31 +6 -6
+ NTP_4_2_7P448
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P448
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.33 +1 -1
+ NTP_4_2_7P448
+
+ scripts/invoke-plot_summary.texi@1.50 +1 -1
+ NTP_4_2_7P448
+
+ scripts/invoke-summary.texi@1.50 +1 -1
+ NTP_4_2_7P448
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.259 +1 -1
+ NTP_4_2_7P448
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.260 +6 -6
+ NTP_4_2_7P448
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.260 +2 -2
+ NTP_4_2_7P448
+
+ scripts/ntp-wait/ntp-wait.html@1.276 +1 -1
+ NTP_4_2_7P448
+
+ scripts/ntp-wait/ntp-wait.man.in@1.260 +6 -6
+ NTP_4_2_7P448
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.260 +2 -2
+ NTP_4_2_7P448
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.48 +1 -1
+ NTP_4_2_7P448
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.39 +6 -6
+ NTP_4_2_7P448
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.39 +2 -2
+ NTP_4_2_7P448
+
+ scripts/ntpsweep/ntpsweep.html@1.49 +1 -1
+ NTP_4_2_7P448
+
+ scripts/ntpsweep/ntpsweep.man.in@1.39 +6 -6
+ NTP_4_2_7P448
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P448
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.48 +1 -1
+ NTP_4_2_7P448
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.39 +6 -6
+ NTP_4_2_7P448
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.39 +2 -2
+ NTP_4_2_7P448
+
+ scripts/ntptrace/ntptrace.html@1.49 +1 -1
+ NTP_4_2_7P448
+
+ scripts/ntptrace/ntptrace.man.in@1.39 +6 -6
+ NTP_4_2_7P448
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P448
+
+ scripts/plot_summary.1plot_summaryman@1.50 +6 -6
+ NTP_4_2_7P448
+
+ scripts/plot_summary.1plot_summarymdoc@1.50 +3 -3
+ NTP_4_2_7P448
+
+ scripts/plot_summary.html@1.50 +1 -1
+ NTP_4_2_7P448
+
+ scripts/plot_summary.man.in@1.50 +6 -6
+ NTP_4_2_7P448
+
+ scripts/plot_summary.mdoc.in@1.50 +3 -3
+ NTP_4_2_7P448
+
+ scripts/summary.1summaryman@1.50 +6 -6
+ NTP_4_2_7P448
+
+ scripts/summary.1summarymdoc@1.50 +2 -2
+ NTP_4_2_7P448
+
+ scripts/summary.html@1.50 +1 -1
+ NTP_4_2_7P448
+
+ scripts/summary.man.in@1.50 +6 -6
+ NTP_4_2_7P448
+
+ scripts/summary.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P448
+
+ sntp/invoke-sntp.texi@1.438 +2 -2
+ NTP_4_2_7P448
+
+ sntp/sntp-opts.c@1.453 +7 -7
+ NTP_4_2_7P448
+
+ sntp/sntp-opts.h@1.453 +3 -3
+ NTP_4_2_7P448
+
+ sntp/sntp.1sntpman@1.273 +6 -6
+ NTP_4_2_7P448
+
+ sntp/sntp.1sntpmdoc@1.273 +2 -2
+ NTP_4_2_7P448
+
+ sntp/sntp.html@1.453 +2 -2
+ NTP_4_2_7P448
+
+ sntp/sntp.man.in@1.273 +6 -6
+ NTP_4_2_7P448
+
+ sntp/sntp.mdoc.in@1.273 +2 -2
+ NTP_4_2_7P448
+
+ util/invoke-ntp-keygen.texi@1.442 +2 -2
+ NTP_4_2_7P448
+
+ util/ntp-keygen-opts.c@1.456 +7 -7
+ NTP_4_2_7P448
+
+ util/ntp-keygen-opts.h@1.456 +3 -3
+ NTP_4_2_7P448
+
+ util/ntp-keygen.1ntp-keygenman@1.270 +6 -6
+ NTP_4_2_7P448
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.270 +2 -2
+ NTP_4_2_7P448
+
+ util/ntp-keygen.html@1.118 +2 -2
+ NTP_4_2_7P448
+
+ util/ntp-keygen.man.in@1.270 +6 -6
+ NTP_4_2_7P448
+
+ util/ntp-keygen.mdoc.in@1.270 +2 -2
+ NTP_4_2_7P448
+
+ChangeSet@1.3142, 2014-07-15 08:41:34+00:00, stenn@psp-deb1.ntp.org
+ Quiet warnings from ntp_calendar.h: avoid using argument names
+
+ ChangeLog@1.1488 +1 -0
+ Quiet warnings from ntp_calendar.h: avoid using argument names
+
+ include/ntp_calendar.h@1.15 +8 -8
+ Quiet warnings from ntp_calendar.h: avoid using argument names
+
+ChangeSet@1.3141, 2014-07-12 12:26:38+02:00, jnperlin@hydra.(none)
+ [Bug 2621] Avoid use of indeterminate address after 'free()'
+
+ ChangeLog@1.1487 +2 -0
+ [Bug 2621] Avoid use of indeterminate address after 'free()'
+
+ libntp/recvbuff.c@1.39 +11 -9
+ [Bug 2621] Avoid use of indeterminate address after 'free()'
+
+ ntpd/ntp_config.c@1.318 +62 -61
+ [Bug 2621] Avoid use of indeterminate address after 'free()', unification of cleanup pattern
+
+ ntpd/ntp_io.c@1.392 +8 -8
+ [Bug 2621] Avoid use of indeterminate address after 'free()'
+
+ChangeSet@1.3140, 2014-07-05 11:09:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P447
+ TAG: NTP_4_2_7P447
+
+ ChangeLog@1.1486 +1 -0
+ NTP_4_2_7P447
+
+ ntpd/invoke-ntp.conf.texi@1.126 +1 -1
+ NTP_4_2_7P447
+
+ ntpd/invoke-ntp.keys.texi@1.124 +1 -1
+ NTP_4_2_7P447
+
+ ntpd/invoke-ntpd.texi@1.440 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntp.conf.5man@1.160 +6 -6
+ NTP_4_2_7P447
+
+ ntpd/ntp.conf.5mdoc@1.160 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntp.conf.html@1.121 +1 -1
+ NTP_4_2_7P447
+
+ ntpd/ntp.conf.man.in@1.160 +6 -6
+ NTP_4_2_7P447
+
+ ntpd/ntp.conf.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntp.keys.5man@1.158 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntp.keys.5mdoc@1.158 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntp.keys.html@1.122 +1 -1
+ NTP_4_2_7P447
+
+ ntpd/ntp.keys.man.in@1.158 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntp.keys.mdoc.in@1.158 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntpd-opts.c@1.458 +7 -7
+ NTP_4_2_7P447
+
+ ntpd/ntpd-opts.h@1.458 +3 -3
+ NTP_4_2_7P447
+
+ ntpd/ntpd.1ntpdman@1.269 +6 -6
+ NTP_4_2_7P447
+
+ ntpd/ntpd.1ntpdmdoc@1.269 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntpd.html@1.116 +2 -2
+ NTP_4_2_7P447
+
+ ntpd/ntpd.man.in@1.269 +6 -6
+ NTP_4_2_7P447
+
+ ntpd/ntpd.mdoc.in@1.269 +2 -2
+ NTP_4_2_7P447
+
+ ntpdc/invoke-ntpdc.texi@1.438 +2 -2
+ NTP_4_2_7P447
+
+ ntpdc/ntpdc-opts.c@1.453 +7 -7
+ NTP_4_2_7P447
+
+ ntpdc/ntpdc-opts.h@1.453 +3 -3
+ NTP_4_2_7P447
+
+ ntpdc/ntpdc.1ntpdcman@1.269 +6 -6
+ NTP_4_2_7P447
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.269 +2 -2
+ NTP_4_2_7P447
+
+ ntpdc/ntpdc.html@1.282 +2 -2
+ NTP_4_2_7P447
+
+ ntpdc/ntpdc.man.in@1.269 +6 -6
+ NTP_4_2_7P447
+
+ ntpdc/ntpdc.mdoc.in@1.269 +2 -2
+ NTP_4_2_7P447
+
+ ntpq/invoke-ntpq.texi@1.442 +2 -2
+ NTP_4_2_7P447
+
+ ntpq/ntpq-opts.c@1.456 +7 -7
+ NTP_4_2_7P447
+
+ ntpq/ntpq-opts.h@1.456 +3 -3
+ NTP_4_2_7P447
+
+ ntpq/ntpq.1ntpqman@1.270 +6 -6
+ NTP_4_2_7P447
+
+ ntpq/ntpq.1ntpqmdoc@1.270 +2 -2
+ NTP_4_2_7P447
+
+ ntpq/ntpq.html@1.113 +2 -2
+ NTP_4_2_7P447
+
+ ntpq/ntpq.man.in@1.270 +6 -6
+ NTP_4_2_7P447
+
+ ntpq/ntpq.mdoc.in@1.270 +2 -2
+ NTP_4_2_7P447
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.440 +2 -2
+ NTP_4_2_7P447
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.455 +7 -7
+ NTP_4_2_7P447
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.455 +3 -3
+ NTP_4_2_7P447
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.269 +6 -6
+ NTP_4_2_7P447
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.269 +2 -2
+ NTP_4_2_7P447
+
+ ntpsnmpd/ntpsnmpd.html@1.111 +1 -1
+ NTP_4_2_7P447
+
+ ntpsnmpd/ntpsnmpd.man.in@1.269 +6 -6
+ NTP_4_2_7P447
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.269 +2 -2
+ NTP_4_2_7P447
+
+ packageinfo.sh@1.451 +1 -1
+ NTP_4_2_7P447
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.31 +6 -6
+ NTP_4_2_7P447
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.31 +2 -2
+ NTP_4_2_7P447
+
+ scripts/calc_tickadj/calc_tickadj.html@1.30 +1 -1
+ NTP_4_2_7P447
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.30 +6 -6
+ NTP_4_2_7P447
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P447
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.32 +1 -1
+ NTP_4_2_7P447
+
+ scripts/invoke-plot_summary.texi@1.49 +1 -1
+ NTP_4_2_7P447
+
+ scripts/invoke-summary.texi@1.49 +1 -1
+ NTP_4_2_7P447
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.258 +1 -1
+ NTP_4_2_7P447
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.259 +6 -6
+ NTP_4_2_7P447
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.259 +2 -2
+ NTP_4_2_7P447
+
+ scripts/ntp-wait/ntp-wait.html@1.275 +1 -1
+ NTP_4_2_7P447
+
+ scripts/ntp-wait/ntp-wait.man.in@1.259 +6 -6
+ NTP_4_2_7P447
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.259 +2 -2
+ NTP_4_2_7P447
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.47 +1 -1
+ NTP_4_2_7P447
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.38 +6 -6
+ NTP_4_2_7P447
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.38 +2 -2
+ NTP_4_2_7P447
+
+ scripts/ntpsweep/ntpsweep.html@1.48 +1 -1
+ NTP_4_2_7P447
+
+ scripts/ntpsweep/ntpsweep.man.in@1.38 +6 -6
+ NTP_4_2_7P447
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P447
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.47 +1 -1
+ NTP_4_2_7P447
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.38 +6 -6
+ NTP_4_2_7P447
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.38 +2 -2
+ NTP_4_2_7P447
+
+ scripts/ntptrace/ntptrace.html@1.48 +1 -1
+ NTP_4_2_7P447
+
+ scripts/ntptrace/ntptrace.man.in@1.38 +6 -6
+ NTP_4_2_7P447
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P447
+
+ scripts/plot_summary.1plot_summaryman@1.49 +6 -6
+ NTP_4_2_7P447
+
+ scripts/plot_summary.1plot_summarymdoc@1.49 +3 -3
+ NTP_4_2_7P447
+
+ scripts/plot_summary.html@1.49 +1 -1
+ NTP_4_2_7P447
+
+ scripts/plot_summary.man.in@1.49 +6 -6
+ NTP_4_2_7P447
+
+ scripts/plot_summary.mdoc.in@1.49 +3 -3
+ NTP_4_2_7P447
+
+ scripts/summary.1summaryman@1.49 +6 -6
+ NTP_4_2_7P447
+
+ scripts/summary.1summarymdoc@1.49 +2 -2
+ NTP_4_2_7P447
+
+ scripts/summary.html@1.49 +1 -1
+ NTP_4_2_7P447
+
+ scripts/summary.man.in@1.49 +6 -6
+ NTP_4_2_7P447
+
+ scripts/summary.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P447
+
+ sntp/invoke-sntp.texi@1.437 +2 -2
+ NTP_4_2_7P447
+
+ sntp/sntp-opts.c@1.452 +7 -7
+ NTP_4_2_7P447
+
+ sntp/sntp-opts.h@1.452 +3 -3
+ NTP_4_2_7P447
+
+ sntp/sntp.1sntpman@1.272 +6 -6
+ NTP_4_2_7P447
+
+ sntp/sntp.1sntpmdoc@1.272 +2 -2
+ NTP_4_2_7P447
+
+ sntp/sntp.html@1.452 +2 -2
+ NTP_4_2_7P447
+
+ sntp/sntp.man.in@1.272 +6 -6
+ NTP_4_2_7P447
+
+ sntp/sntp.mdoc.in@1.272 +2 -2
+ NTP_4_2_7P447
+
+ util/invoke-ntp-keygen.texi@1.441 +2 -2
+ NTP_4_2_7P447
+
+ util/ntp-keygen-opts.c@1.455 +7 -7
+ NTP_4_2_7P447
+
+ util/ntp-keygen-opts.h@1.455 +3 -3
+ NTP_4_2_7P447
+
+ util/ntp-keygen.1ntp-keygenman@1.269 +6 -6
+ NTP_4_2_7P447
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.269 +2 -2
+ NTP_4_2_7P447
+
+ util/ntp-keygen.html@1.117 +2 -2
+ NTP_4_2_7P447
+
+ util/ntp-keygen.man.in@1.269 +6 -6
+ NTP_4_2_7P447
+
+ util/ntp-keygen.mdoc.in@1.269 +2 -2
+ NTP_4_2_7P447
+
+ChangeSet@1.3139, 2014-07-05 08:22:01+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2624] Fix signed compare on 'l_fp'
+
+ ChangeLog@1.1485 +1 -1
+ [Bug 2624] Fix signed compare on 'l_fp'
+
+ChangeSet@1.3131.3.2, 2014-07-05 09:34:14+02:00, jnperlin@hydra.(none)
+ [Bug 2618) (side work) added unit test for 'l_fp' operations
+
+ ChangeLog@1.1478.3.1 +1 -0
+ [Bug 2618) (side work) added unit test for 'l_fp' operations
+
+ include/ntp_fp.h@1.31 +3 -3
+ fixed a sign/unsigned compare problem inside signed compare macros
+
+ tests/libntp/lfpfunc.cpp@1.2 +224 -28
+ added relational operation tests
+ cleanup and more independent reference implementations
+
+ChangeSet@1.3137, 2014-07-04 16:57:21-04:00, stenn@deacon.udel.edu
+ Remove extraneous NULs
+
+ readme.y2kfixes@1.6 +1 -75
+ Remove extraneous NULs
+
+ChangeSet@1.3136, 2014-07-04 03:12:30+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2620] Use version.pm for checking version numbers in NTP::Util
+
+ ChangeLog@1.1483 +1 -0
+ [Bug 2620] Use version.pm for checking version numbers in NTP::Util
+
+ scripts/lib/NTP/Util.pm@1.2 +2 -1
+ [Bug 2620] Use version.pm for checking version numbers in NTP::Util
+
+ChangeSet@1.3131.3.1, 2014-07-01 00:59:29+02:00, jnperlin@hydra.(none)
+ added first tests for 'l_fp'
+
+ tests/libntp/Makefile.am@1.42 +1 -0
+ added first tests for 'l_fp'
+
+ tests/libntp/lfpfunc.cpp@1.1 +351 -0
+ added first tests for 'l_fp'
+
+ tests/libntp/lfpfunc.cpp@1.0 +0 -0
+
+ChangeSet@1.3135, 2014-06-28 09:33:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P446
+ TAG: NTP_4_2_7P446
+
+ ChangeLog@1.1482 +1 -0
+ NTP_4_2_7P446
+
+ ntpd/invoke-ntp.conf.texi@1.125 +1 -1
+ NTP_4_2_7P446
+
+ ntpd/invoke-ntp.keys.texi@1.123 +1 -1
+ NTP_4_2_7P446
+
+ ntpd/invoke-ntpd.texi@1.439 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntp.conf.5man@1.159 +6 -6
+ NTP_4_2_7P446
+
+ ntpd/ntp.conf.5mdoc@1.159 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntp.conf.html@1.120 +1 -1
+ NTP_4_2_7P446
+
+ ntpd/ntp.conf.man.in@1.159 +6 -6
+ NTP_4_2_7P446
+
+ ntpd/ntp.conf.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntp.keys.5man@1.157 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntp.keys.5mdoc@1.157 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntp.keys.html@1.121 +1 -1
+ NTP_4_2_7P446
+
+ ntpd/ntp.keys.man.in@1.157 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntp.keys.mdoc.in@1.157 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntpd-opts.c@1.457 +7 -7
+ NTP_4_2_7P446
+
+ ntpd/ntpd-opts.h@1.457 +3 -3
+ NTP_4_2_7P446
+
+ ntpd/ntpd.1ntpdman@1.268 +6 -6
+ NTP_4_2_7P446
+
+ ntpd/ntpd.1ntpdmdoc@1.268 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntpd.html@1.115 +2 -2
+ NTP_4_2_7P446
+
+ ntpd/ntpd.man.in@1.268 +6 -6
+ NTP_4_2_7P446
+
+ ntpd/ntpd.mdoc.in@1.268 +2 -2
+ NTP_4_2_7P446
+
+ ntpdc/invoke-ntpdc.texi@1.437 +2 -2
+ NTP_4_2_7P446
+
+ ntpdc/ntpdc-opts.c@1.452 +7 -7
+ NTP_4_2_7P446
+
+ ntpdc/ntpdc-opts.h@1.452 +3 -3
+ NTP_4_2_7P446
+
+ ntpdc/ntpdc.1ntpdcman@1.268 +6 -6
+ NTP_4_2_7P446
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.268 +2 -2
+ NTP_4_2_7P446
+
+ ntpdc/ntpdc.html@1.281 +2 -2
+ NTP_4_2_7P446
+
+ ntpdc/ntpdc.man.in@1.268 +6 -6
+ NTP_4_2_7P446
+
+ ntpdc/ntpdc.mdoc.in@1.268 +2 -2
+ NTP_4_2_7P446
+
+ ntpq/invoke-ntpq.texi@1.441 +2 -2
+ NTP_4_2_7P446
+
+ ntpq/ntpq-opts.c@1.455 +7 -7
+ NTP_4_2_7P446
+
+ ntpq/ntpq-opts.h@1.455 +3 -3
+ NTP_4_2_7P446
+
+ ntpq/ntpq.1ntpqman@1.269 +6 -6
+ NTP_4_2_7P446
+
+ ntpq/ntpq.1ntpqmdoc@1.269 +2 -2
+ NTP_4_2_7P446
+
+ ntpq/ntpq.html@1.112 +3 -3
+ NTP_4_2_7P446
+
+ ntpq/ntpq.man.in@1.269 +6 -6
+ NTP_4_2_7P446
+
+ ntpq/ntpq.mdoc.in@1.269 +2 -2
+ NTP_4_2_7P446
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.439 +2 -2
+ NTP_4_2_7P446
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.454 +7 -7
+ NTP_4_2_7P446
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.454 +3 -3
+ NTP_4_2_7P446
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.268 +6 -6
+ NTP_4_2_7P446
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.268 +2 -2
+ NTP_4_2_7P446
+
+ ntpsnmpd/ntpsnmpd.html@1.110 +1 -1
+ NTP_4_2_7P446
+
+ ntpsnmpd/ntpsnmpd.man.in@1.268 +6 -6
+ NTP_4_2_7P446
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.268 +2 -2
+ NTP_4_2_7P446
+
+ packageinfo.sh@1.450 +1 -1
+ NTP_4_2_7P446
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.30 +6 -6
+ NTP_4_2_7P446
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.30 +2 -2
+ NTP_4_2_7P446
+
+ scripts/calc_tickadj/calc_tickadj.html@1.29 +1 -1
+ NTP_4_2_7P446
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.29 +6 -6
+ NTP_4_2_7P446
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P446
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.31 +1 -1
+ NTP_4_2_7P446
+
+ scripts/invoke-plot_summary.texi@1.48 +1 -1
+ NTP_4_2_7P446
+
+ scripts/invoke-summary.texi@1.48 +1 -1
+ NTP_4_2_7P446
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.257 +1 -1
+ NTP_4_2_7P446
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.258 +13 -13
+ NTP_4_2_7P446
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.258 +2 -2
+ NTP_4_2_7P446
+
+ scripts/ntp-wait/ntp-wait.html@1.274 +1 -1
+ NTP_4_2_7P446
+
+ scripts/ntp-wait/ntp-wait.man.in@1.258 +13 -13
+ NTP_4_2_7P446
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.258 +2 -2
+ NTP_4_2_7P446
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.46 +1 -1
+ NTP_4_2_7P446
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.37 +6 -6
+ NTP_4_2_7P446
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.37 +2 -2
+ NTP_4_2_7P446
+
+ scripts/ntpsweep/ntpsweep.html@1.47 +1 -1
+ NTP_4_2_7P446
+
+ scripts/ntpsweep/ntpsweep.man.in@1.37 +6 -6
+ NTP_4_2_7P446
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P446
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.46 +1 -1
+ NTP_4_2_7P446
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.37 +6 -6
+ NTP_4_2_7P446
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.37 +2 -2
+ NTP_4_2_7P446
+
+ scripts/ntptrace/ntptrace.html@1.47 +1 -1
+ NTP_4_2_7P446
+
+ scripts/ntptrace/ntptrace.man.in@1.37 +6 -6
+ NTP_4_2_7P446
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P446
+
+ scripts/plot_summary.1plot_summaryman@1.48 +6 -6
+ NTP_4_2_7P446
+
+ scripts/plot_summary.1plot_summarymdoc@1.48 +2 -2
+ NTP_4_2_7P446
+
+ scripts/plot_summary.html@1.48 +1 -1
+ NTP_4_2_7P446
+
+ scripts/plot_summary.man.in@1.48 +6 -6
+ NTP_4_2_7P446
+
+ scripts/plot_summary.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P446
+
+ scripts/summary.1summaryman@1.48 +6 -6
+ NTP_4_2_7P446
+
+ scripts/summary.1summarymdoc@1.48 +2 -2
+ NTP_4_2_7P446
+
+ scripts/summary.html@1.48 +1 -1
+ NTP_4_2_7P446
+
+ scripts/summary.man.in@1.48 +6 -6
+ NTP_4_2_7P446
+
+ scripts/summary.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P446
+
+ sntp/invoke-sntp.texi@1.436 +2 -2
+ NTP_4_2_7P446
+
+ sntp/sntp-opts.c@1.451 +7 -7
+ NTP_4_2_7P446
+
+ sntp/sntp-opts.h@1.451 +3 -3
+ NTP_4_2_7P446
+
+ sntp/sntp.1sntpman@1.271 +6 -6
+ NTP_4_2_7P446
+
+ sntp/sntp.1sntpmdoc@1.271 +2 -2
+ NTP_4_2_7P446
+
+ sntp/sntp.html@1.451 +2 -2
+ NTP_4_2_7P446
+
+ sntp/sntp.man.in@1.271 +6 -6
+ NTP_4_2_7P446
+
+ sntp/sntp.mdoc.in@1.271 +2 -2
+ NTP_4_2_7P446
+
+ util/invoke-ntp-keygen.texi@1.440 +2 -2
+ NTP_4_2_7P446
+
+ util/ntp-keygen-opts.c@1.454 +7 -7
+ NTP_4_2_7P446
+
+ util/ntp-keygen-opts.h@1.454 +3 -3
+ NTP_4_2_7P446
+
+ util/ntp-keygen.1ntp-keygenman@1.268 +6 -6
+ NTP_4_2_7P446
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.268 +2 -2
+ NTP_4_2_7P446
+
+ util/ntp-keygen.html@1.116 +2 -2
+ NTP_4_2_7P446
+
+ util/ntp-keygen.man.in@1.268 +6 -6
+ NTP_4_2_7P446
+
+ util/ntp-keygen.mdoc.in@1.268 +2 -2
+ NTP_4_2_7P446
+
+ChangeSet@1.3134, 2014-06-28 05:00:22-04:00, stenn@deacon.udel.edu
+ Allow for version suffix in libevent in ntp_libevent.m4
+
+ ChangeLog@1.1481 +1 -0
+ Allow for version suffix in libevent in ntp_libevent.m4
+
+ sntp/m4/ntp_libevent.m4@1.11 +19 -1
+ Allow for version suffix in libevent in ntp_libevent.m4
+
+ChangeSet@1.3131.1.4, 2014-06-28 07:48:23+00:00, stenn@psp-fb1.ntp.org
+ ntp_crypto.c, ChangeLog:
+ [Bug 2619] Save a signed int copy of the return value of i2d_DSA_SIG().
+ Provide missing msyslog() message in crypto_alice().
+
+ ChangeLog@1.1478.1.3 +2 -0
+ [Bug 2619] Save a signed int copy of the return value of i2d_DSA_SIG().
+ Provide missing msyslog() message in crypto_alice().
+
+ ntpd/ntp_crypto.c@1.167 +6 -3
+ [Bug 2619] Save a signed int copy of the return value of i2d_DSA_SIG().
+ Provide missing msyslog() message in crypto_alice().
+
+ChangeSet@1.3131.2.1, 2014-06-28 07:25:32+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2597] leap file processing -- loose ends
+
+ ChangeLog@1.1478.2.1 +1 -0
+ [Bug 2597] leap file processing -- loose ends
+
+ ntpd/ntp_util.c@1.114 +1 -1
+ [Bug 2597] leap file processing -- loose ends
+
+ChangeSet@1.3131.1.2, 2014-06-28 06:27:42+00:00, phk@psp-fb1.ntp.org
+ ChangeLog:
+ fix a variable lifetime issue
+
+ ChangeLog@1.1478.1.1 +1 -0
+ fix a variable lifetime issue
+
+ChangeSet@1.3131.1.1, 2014-06-28 06:19:58+00:00, phk@psp-fb1.ntp.org
+ ntp_crypto.c:
+ Don't assign stack variables to globals.
+
+ ntpd/ntp_crypto.c@1.166 +1 -1
+ Don't assign stack variables to globals.
+
+ChangeSet@1.3132, 2014-06-20 10:59:35+02:00, jnperlin@hydra.(none)
+ [Bug 2614] use 'unsigned long' consistently in 'ntp_random.c' to avoid undefined signed int overflow
+
+ ChangeLog@1.1479 +2 -0
+ [Bug 2614] use 'unsigned long' consistently in 'ntp_random.c' to avoid undefined signed int overflow
+
+ libntp/ntp_random.c@1.11 +8 -8
+ [Bug 2614] use 'unsigned long' consistently in 'ntp_random.c' to avoid undefined signed int overflow
+
+ChangeSet@1.3131, 2014-06-12 09:34:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P445
+ TAG: NTP_4_2_7P445
+
+ ChangeLog@1.1478 +1 -0
+ NTP_4_2_7P445
+
+ ntpd/invoke-ntp.conf.texi@1.124 +1 -1
+ NTP_4_2_7P445
+
+ ntpd/invoke-ntp.keys.texi@1.122 +1 -1
+ NTP_4_2_7P445
+
+ ntpd/invoke-ntpd.texi@1.438 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntp.conf.5man@1.158 +6 -6
+ NTP_4_2_7P445
+
+ ntpd/ntp.conf.5mdoc@1.158 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntp.conf.html@1.119 +1 -1
+ NTP_4_2_7P445
+
+ ntpd/ntp.conf.man.in@1.158 +6 -6
+ NTP_4_2_7P445
+
+ ntpd/ntp.conf.mdoc.in@1.158 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntp.keys.5man@1.156 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntp.keys.5mdoc@1.156 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntp.keys.html@1.120 +1 -1
+ NTP_4_2_7P445
+
+ ntpd/ntp.keys.man.in@1.156 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntp.keys.mdoc.in@1.156 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntpd-opts.c@1.456 +7 -7
+ NTP_4_2_7P445
+
+ ntpd/ntpd-opts.h@1.456 +3 -3
+ NTP_4_2_7P445
+
+ ntpd/ntpd.1ntpdman@1.267 +6 -6
+ NTP_4_2_7P445
+
+ ntpd/ntpd.1ntpdmdoc@1.267 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntpd.html@1.114 +2 -2
+ NTP_4_2_7P445
+
+ ntpd/ntpd.man.in@1.267 +6 -6
+ NTP_4_2_7P445
+
+ ntpd/ntpd.mdoc.in@1.267 +2 -2
+ NTP_4_2_7P445
+
+ ntpdc/invoke-ntpdc.texi@1.436 +2 -2
+ NTP_4_2_7P445
+
+ ntpdc/ntpdc-opts.c@1.451 +7 -7
+ NTP_4_2_7P445
+
+ ntpdc/ntpdc-opts.h@1.451 +3 -3
+ NTP_4_2_7P445
+
+ ntpdc/ntpdc.1ntpdcman@1.267 +6 -6
+ NTP_4_2_7P445
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.267 +2 -2
+ NTP_4_2_7P445
+
+ ntpdc/ntpdc.html@1.280 +2 -2
+ NTP_4_2_7P445
+
+ ntpdc/ntpdc.man.in@1.267 +6 -6
+ NTP_4_2_7P445
+
+ ntpdc/ntpdc.mdoc.in@1.267 +2 -2
+ NTP_4_2_7P445
+
+ ntpq/invoke-ntpq.texi@1.440 +3 -3
+ NTP_4_2_7P445
+
+ ntpq/ntpq-opts.c@1.454 +7 -7
+ NTP_4_2_7P445
+
+ ntpq/ntpq-opts.h@1.454 +3 -3
+ NTP_4_2_7P445
+
+ ntpq/ntpq.1ntpqman@1.268 +33 -4
+ NTP_4_2_7P445
+
+ ntpq/ntpq.1ntpqmdoc@1.268 +21 -2
+ NTP_4_2_7P445
+
+ ntpq/ntpq.html@1.111 +359 -2
+ NTP_4_2_7P445
+
+ ntpq/ntpq.man.in@1.268 +33 -4
+ NTP_4_2_7P445
+
+ ntpq/ntpq.mdoc.in@1.268 +21 -2
+ NTP_4_2_7P445
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.438 +2 -2
+ NTP_4_2_7P445
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.453 +7 -7
+ NTP_4_2_7P445
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.453 +3 -3
+ NTP_4_2_7P445
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.267 +6 -6
+ NTP_4_2_7P445
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.267 +2 -2
+ NTP_4_2_7P445
+
+ ntpsnmpd/ntpsnmpd.html@1.109 +1 -1
+ NTP_4_2_7P445
+
+ ntpsnmpd/ntpsnmpd.man.in@1.267 +6 -6
+ NTP_4_2_7P445
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.267 +2 -2
+ NTP_4_2_7P445
+
+ packageinfo.sh@1.449 +1 -1
+ NTP_4_2_7P445
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.29 +6 -6
+ NTP_4_2_7P445
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.29 +2 -2
+ NTP_4_2_7P445
+
+ scripts/calc_tickadj/calc_tickadj.html@1.28 +1 -1
+ NTP_4_2_7P445
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.28 +6 -6
+ NTP_4_2_7P445
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P445
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.30 +1 -1
+ NTP_4_2_7P445
+
+ scripts/invoke-plot_summary.texi@1.47 +1 -1
+ NTP_4_2_7P445
+
+ scripts/invoke-summary.texi@1.47 +1 -1
+ NTP_4_2_7P445
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.256 +1 -1
+ NTP_4_2_7P445
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.257 +13 -13
+ NTP_4_2_7P445
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.257 +2 -2
+ NTP_4_2_7P445
+
+ scripts/ntp-wait/ntp-wait.html@1.273 +1 -1
+ NTP_4_2_7P445
+
+ scripts/ntp-wait/ntp-wait.man.in@1.257 +13 -13
+ NTP_4_2_7P445
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.257 +2 -2
+ NTP_4_2_7P445
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.45 +1 -1
+ NTP_4_2_7P445
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.36 +6 -6
+ NTP_4_2_7P445
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.36 +2 -2
+ NTP_4_2_7P445
+
+ scripts/ntpsweep/ntpsweep.html@1.46 +1 -1
+ NTP_4_2_7P445
+
+ scripts/ntpsweep/ntpsweep.man.in@1.36 +6 -6
+ NTP_4_2_7P445
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P445
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.45 +1 -1
+ NTP_4_2_7P445
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.36 +6 -6
+ NTP_4_2_7P445
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.36 +2 -2
+ NTP_4_2_7P445
+
+ scripts/ntptrace/ntptrace.html@1.46 +1 -1
+ NTP_4_2_7P445
+
+ scripts/ntptrace/ntptrace.man.in@1.36 +6 -6
+ NTP_4_2_7P445
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P445
+
+ scripts/plot_summary.1plot_summaryman@1.47 +6 -6
+ NTP_4_2_7P445
+
+ scripts/plot_summary.1plot_summarymdoc@1.47 +2 -2
+ NTP_4_2_7P445
+
+ scripts/plot_summary.html@1.47 +1 -1
+ NTP_4_2_7P445
+
+ scripts/plot_summary.man.in@1.47 +6 -6
+ NTP_4_2_7P445
+
+ scripts/plot_summary.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P445
+
+ scripts/summary.1summaryman@1.47 +6 -6
+ NTP_4_2_7P445
+
+ scripts/summary.1summarymdoc@1.47 +2 -2
+ NTP_4_2_7P445
+
+ scripts/summary.html@1.47 +1 -1
+ NTP_4_2_7P445
+
+ scripts/summary.man.in@1.47 +6 -6
+ NTP_4_2_7P445
+
+ scripts/summary.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P445
+
+ sntp/invoke-sntp.texi@1.435 +2 -2
+ NTP_4_2_7P445
+
+ sntp/sntp-opts.c@1.450 +7 -7
+ NTP_4_2_7P445
+
+ sntp/sntp-opts.h@1.450 +3 -3
+ NTP_4_2_7P445
+
+ sntp/sntp.1sntpman@1.270 +6 -6
+ NTP_4_2_7P445
+
+ sntp/sntp.1sntpmdoc@1.270 +2 -2
+ NTP_4_2_7P445
+
+ sntp/sntp.html@1.450 +2 -2
+ NTP_4_2_7P445
+
+ sntp/sntp.man.in@1.270 +6 -6
+ NTP_4_2_7P445
+
+ sntp/sntp.mdoc.in@1.270 +2 -2
+ NTP_4_2_7P445
+
+ util/invoke-ntp-keygen.texi@1.439 +2 -2
+ NTP_4_2_7P445
+
+ util/ntp-keygen-opts.c@1.453 +7 -7
+ NTP_4_2_7P445
+
+ util/ntp-keygen-opts.h@1.453 +3 -3
+ NTP_4_2_7P445
+
+ util/ntp-keygen.1ntp-keygenman@1.267 +6 -6
+ NTP_4_2_7P445
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.267 +2 -2
+ NTP_4_2_7P445
+
+ util/ntp-keygen.html@1.115 +2 -2
+ NTP_4_2_7P445
+
+ util/ntp-keygen.man.in@1.267 +6 -6
+ NTP_4_2_7P445
+
+ util/ntp-keygen.mdoc.in@1.267 +2 -2
+ NTP_4_2_7P445
+
+ChangeSet@1.3130, 2014-06-12 08:47:33+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ChangeLog@1.1477 +1 -0
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/invoke-ntpq.texi@1.439 +491 -1
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/ntpq-opts.c@1.453 +1 -1
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/ntpq-opts.def@1.17 +487 -0
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/ntpq-opts.h@1.453 +1 -1
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/ntpq.1ntpqman@1.267 +839 -32
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/ntpq.1ntpqmdoc@1.267 +479 -21
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/ntpq.man.in@1.267 +839 -32
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ ntpq/ntpq.mdoc.in@1.267 +479 -21
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ sntp/ag-tpl/Mdoc.pm@1.2 +1 -1
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ sntp/ag-tpl/mdoc2man@1.2 +13 -1
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ sntp/ag-tpl/mdoc2texi@1.9 +12 -0
+ [Bug 2556] mrulist isn't mentioned in the ntpq man page
+
+ChangeSet@1.3129, 2014-05-19 09:34:39+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P444
+ TAG: NTP_4_2_7P444
+
+ ChangeLog@1.1476 +1 -0
+ NTP_4_2_7P444
+
+ ntpd/invoke-ntp.conf.texi@1.123 +1 -1
+ NTP_4_2_7P444
+
+ ntpd/invoke-ntp.keys.texi@1.121 +1 -1
+ NTP_4_2_7P444
+
+ ntpd/invoke-ntpd.texi@1.437 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntp.conf.5man@1.157 +6 -6
+ NTP_4_2_7P444
+
+ ntpd/ntp.conf.5mdoc@1.157 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntp.conf.html@1.118 +1 -1
+ NTP_4_2_7P444
+
+ ntpd/ntp.conf.man.in@1.157 +6 -6
+ NTP_4_2_7P444
+
+ ntpd/ntp.conf.mdoc.in@1.157 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntp.keys.5man@1.155 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntp.keys.5mdoc@1.155 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntp.keys.html@1.119 +1 -1
+ NTP_4_2_7P444
+
+ ntpd/ntp.keys.man.in@1.155 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntp.keys.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntpd-opts.c@1.455 +7 -7
+ NTP_4_2_7P444
+
+ ntpd/ntpd-opts.h@1.455 +3 -3
+ NTP_4_2_7P444
+
+ ntpd/ntpd.1ntpdman@1.266 +6 -6
+ NTP_4_2_7P444
+
+ ntpd/ntpd.1ntpdmdoc@1.266 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntpd.html@1.113 +2 -2
+ NTP_4_2_7P444
+
+ ntpd/ntpd.man.in@1.266 +6 -6
+ NTP_4_2_7P444
+
+ ntpd/ntpd.mdoc.in@1.266 +2 -2
+ NTP_4_2_7P444
+
+ ntpdc/invoke-ntpdc.texi@1.435 +2 -2
+ NTP_4_2_7P444
+
+ ntpdc/ntpdc-opts.c@1.450 +7 -7
+ NTP_4_2_7P444
+
+ ntpdc/ntpdc-opts.h@1.450 +3 -3
+ NTP_4_2_7P444
+
+ ntpdc/ntpdc.1ntpdcman@1.266 +6 -6
+ NTP_4_2_7P444
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.266 +2 -2
+ NTP_4_2_7P444
+
+ ntpdc/ntpdc.html@1.279 +2 -2
+ NTP_4_2_7P444
+
+ ntpdc/ntpdc.man.in@1.266 +6 -6
+ NTP_4_2_7P444
+
+ ntpdc/ntpdc.mdoc.in@1.266 +2 -2
+ NTP_4_2_7P444
+
+ ntpq/invoke-ntpq.texi@1.438 +2 -2
+ NTP_4_2_7P444
+
+ ntpq/ntpq-opts.c@1.452 +7 -7
+ NTP_4_2_7P444
+
+ ntpq/ntpq-opts.h@1.452 +3 -3
+ NTP_4_2_7P444
+
+ ntpq/ntpq.1ntpqman@1.266 +13 -13
+ NTP_4_2_7P444
+
+ ntpq/ntpq.1ntpqmdoc@1.266 +2 -2
+ NTP_4_2_7P444
+
+ ntpq/ntpq.html@1.110 +2 -2
+ NTP_4_2_7P444
+
+ ntpq/ntpq.man.in@1.266 +13 -13
+ NTP_4_2_7P444
+
+ ntpq/ntpq.mdoc.in@1.266 +2 -2
+ NTP_4_2_7P444
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.437 +2 -2
+ NTP_4_2_7P444
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.452 +7 -7
+ NTP_4_2_7P444
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.452 +3 -3
+ NTP_4_2_7P444
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.266 +6 -6
+ NTP_4_2_7P444
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.266 +2 -2
+ NTP_4_2_7P444
+
+ ntpsnmpd/ntpsnmpd.html@1.108 +1 -1
+ NTP_4_2_7P444
+
+ ntpsnmpd/ntpsnmpd.man.in@1.266 +6 -6
+ NTP_4_2_7P444
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.266 +2 -2
+ NTP_4_2_7P444
+
+ packageinfo.sh@1.448 +1 -1
+ NTP_4_2_7P444
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.28 +6 -6
+ NTP_4_2_7P444
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.28 +2 -2
+ NTP_4_2_7P444
+
+ scripts/calc_tickadj/calc_tickadj.html@1.27 +1 -1
+ NTP_4_2_7P444
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.27 +6 -6
+ NTP_4_2_7P444
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P444
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.29 +1 -1
+ NTP_4_2_7P444
+
+ scripts/invoke-plot_summary.texi@1.46 +1 -1
+ NTP_4_2_7P444
+
+ scripts/invoke-summary.texi@1.46 +1 -1
+ NTP_4_2_7P444
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.255 +1 -1
+ NTP_4_2_7P444
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.256 +6 -6
+ NTP_4_2_7P444
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.256 +2 -2
+ NTP_4_2_7P444
+
+ scripts/ntp-wait/ntp-wait.html@1.272 +1 -1
+ NTP_4_2_7P444
+
+ scripts/ntp-wait/ntp-wait.man.in@1.256 +6 -6
+ NTP_4_2_7P444
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.256 +2 -2
+ NTP_4_2_7P444
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.44 +1 -1
+ NTP_4_2_7P444
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.35 +6 -6
+ NTP_4_2_7P444
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.35 +2 -2
+ NTP_4_2_7P444
+
+ scripts/ntpsweep/ntpsweep.html@1.45 +1 -1
+ NTP_4_2_7P444
+
+ scripts/ntpsweep/ntpsweep.man.in@1.35 +6 -6
+ NTP_4_2_7P444
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P444
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.44 +1 -1
+ NTP_4_2_7P444
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.35 +6 -6
+ NTP_4_2_7P444
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.35 +2 -2
+ NTP_4_2_7P444
+
+ scripts/ntptrace/ntptrace.html@1.45 +1 -1
+ NTP_4_2_7P444
+
+ scripts/ntptrace/ntptrace.man.in@1.35 +6 -6
+ NTP_4_2_7P444
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P444
+
+ scripts/plot_summary.1plot_summaryman@1.46 +6 -6
+ NTP_4_2_7P444
+
+ scripts/plot_summary.1plot_summarymdoc@1.46 +2 -2
+ NTP_4_2_7P444
+
+ scripts/plot_summary.html@1.46 +1 -1
+ NTP_4_2_7P444
+
+ scripts/plot_summary.man.in@1.46 +6 -6
+ NTP_4_2_7P444
+
+ scripts/plot_summary.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P444
+
+ scripts/summary.1summaryman@1.46 +6 -6
+ NTP_4_2_7P444
+
+ scripts/summary.1summarymdoc@1.46 +2 -2
+ NTP_4_2_7P444
+
+ scripts/summary.html@1.46 +1 -1
+ NTP_4_2_7P444
+
+ scripts/summary.man.in@1.46 +6 -6
+ NTP_4_2_7P444
+
+ scripts/summary.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P444
+
+ sntp/invoke-sntp.texi@1.434 +2 -2
+ NTP_4_2_7P444
+
+ sntp/sntp-opts.c@1.449 +7 -7
+ NTP_4_2_7P444
+
+ sntp/sntp-opts.h@1.449 +3 -3
+ NTP_4_2_7P444
+
+ sntp/sntp.1sntpman@1.269 +6 -6
+ NTP_4_2_7P444
+
+ sntp/sntp.1sntpmdoc@1.269 +2 -2
+ NTP_4_2_7P444
+
+ sntp/sntp.html@1.449 +2 -2
+ NTP_4_2_7P444
+
+ sntp/sntp.man.in@1.269 +6 -6
+ NTP_4_2_7P444
+
+ sntp/sntp.mdoc.in@1.269 +2 -2
+ NTP_4_2_7P444
+
+ util/invoke-ntp-keygen.texi@1.438 +2 -2
+ NTP_4_2_7P444
+
+ util/ntp-keygen-opts.c@1.452 +7 -7
+ NTP_4_2_7P444
+
+ util/ntp-keygen-opts.h@1.452 +3 -3
+ NTP_4_2_7P444
+
+ util/ntp-keygen.1ntp-keygenman@1.266 +6 -6
+ NTP_4_2_7P444
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.266 +2 -2
+ NTP_4_2_7P444
+
+ util/ntp-keygen.html@1.114 +2 -2
+ NTP_4_2_7P444
+
+ util/ntp-keygen.man.in@1.266 +6 -6
+ NTP_4_2_7P444
+
+ util/ntp-keygen.mdoc.in@1.266 +2 -2
+ NTP_4_2_7P444
+
+ChangeSet@1.3127, 2014-05-10 09:33:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P443
+ TAG: NTP_4_2_7P443
+
+ ChangeLog@1.1473.1.6 +1 -0
+ NTP_4_2_7P443
+
+ ntpd/invoke-ntp.conf.texi@1.122 +1 -1
+ NTP_4_2_7P443
+
+ ntpd/invoke-ntp.keys.texi@1.120 +1 -1
+ NTP_4_2_7P443
+
+ ntpd/invoke-ntpd.texi@1.436 +2 -2
+ NTP_4_2_7P443
+
+ ntpd/ntp.conf.5man@1.156 +7 -7
+ NTP_4_2_7P443
+
+ ntpd/ntp.conf.5mdoc@1.156 +3 -3
+ NTP_4_2_7P443
+
+ ntpd/ntp.conf.html@1.117 +1 -1
+ NTP_4_2_7P443
+
+ ntpd/ntp.conf.man.in@1.156 +7 -7
+ NTP_4_2_7P443
+
+ ntpd/ntp.conf.mdoc.in@1.156 +3 -3
+ NTP_4_2_7P443
+
+ ntpd/ntp.keys.5man@1.154 +3 -3
+ NTP_4_2_7P443
+
+ ntpd/ntp.keys.5mdoc@1.154 +3 -3
+ NTP_4_2_7P443
+
+ ntpd/ntp.keys.html@1.118 +1 -1
+ NTP_4_2_7P443
+
+ ntpd/ntp.keys.man.in@1.154 +3 -3
+ NTP_4_2_7P443
+
+ ntpd/ntp.keys.mdoc.in@1.154 +3 -3
+ NTP_4_2_7P443
+
+ ntpd/ntpd-opts.c@1.454 +10 -10
+ NTP_4_2_7P443
+
+ ntpd/ntpd-opts.h@1.454 +4 -4
+ NTP_4_2_7P443
+
+ ntpd/ntpd.1ntpdman@1.265 +7 -7
+ NTP_4_2_7P443
+
+ ntpd/ntpd.1ntpdmdoc@1.265 +3 -3
+ NTP_4_2_7P443
+
+ ntpd/ntpd.html@1.112 +2 -2
+ NTP_4_2_7P443
+
+ ntpd/ntpd.man.in@1.265 +7 -7
+ NTP_4_2_7P443
+
+ ntpd/ntpd.mdoc.in@1.265 +3 -3
+ NTP_4_2_7P443
+
+ ntpdc/invoke-ntpdc.texi@1.434 +2 -2
+ NTP_4_2_7P443
+
+ ntpdc/ntpdc-opts.c@1.449 +10 -10
+ NTP_4_2_7P443
+
+ ntpdc/ntpdc-opts.h@1.449 +4 -4
+ NTP_4_2_7P443
+
+ ntpdc/ntpdc.1ntpdcman@1.265 +14 -14
+ NTP_4_2_7P443
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.265 +3 -3
+ NTP_4_2_7P443
+
+ ntpdc/ntpdc.html@1.278 +2 -2
+ NTP_4_2_7P443
+
+ ntpdc/ntpdc.man.in@1.265 +14 -14
+ NTP_4_2_7P443
+
+ ntpdc/ntpdc.mdoc.in@1.265 +3 -3
+ NTP_4_2_7P443
+
+ ntpq/invoke-ntpq.texi@1.437 +2 -2
+ NTP_4_2_7P443
+
+ ntpq/ntpq-opts.c@1.451 +10 -10
+ NTP_4_2_7P443
+
+ ntpq/ntpq-opts.h@1.451 +4 -4
+ NTP_4_2_7P443
+
+ ntpq/ntpq.1ntpqman@1.265 +7 -7
+ NTP_4_2_7P443
+
+ ntpq/ntpq.1ntpqmdoc@1.265 +3 -3
+ NTP_4_2_7P443
+
+ ntpq/ntpq.html@1.109 +2 -2
+ NTP_4_2_7P443
+
+ ntpq/ntpq.man.in@1.265 +7 -7
+ NTP_4_2_7P443
+
+ ntpq/ntpq.mdoc.in@1.265 +3 -3
+ NTP_4_2_7P443
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.436 +2 -2
+ NTP_4_2_7P443
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.451 +10 -10
+ NTP_4_2_7P443
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.451 +4 -4
+ NTP_4_2_7P443
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.265 +7 -7
+ NTP_4_2_7P443
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.265 +3 -3
+ NTP_4_2_7P443
+
+ ntpsnmpd/ntpsnmpd.html@1.107 +1 -1
+ NTP_4_2_7P443
+
+ ntpsnmpd/ntpsnmpd.man.in@1.265 +7 -7
+ NTP_4_2_7P443
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.265 +3 -3
+ NTP_4_2_7P443
+
+ packageinfo.sh@1.447 +1 -1
+ NTP_4_2_7P443
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.27 +6 -6
+ NTP_4_2_7P443
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.27 +2 -2
+ NTP_4_2_7P443
+
+ scripts/calc_tickadj/calc_tickadj.html@1.26 +1 -1
+ NTP_4_2_7P443
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.26 +6 -6
+ NTP_4_2_7P443
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P443
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.28 +1 -1
+ NTP_4_2_7P443
+
+ scripts/invoke-plot_summary.texi@1.45 +1 -1
+ NTP_4_2_7P443
+
+ scripts/invoke-summary.texi@1.45 +1 -1
+ NTP_4_2_7P443
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.254 +1 -1
+ NTP_4_2_7P443
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.255 +6 -6
+ NTP_4_2_7P443
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.255 +2 -2
+ NTP_4_2_7P443
+
+ scripts/ntp-wait/ntp-wait.html@1.271 +1 -1
+ NTP_4_2_7P443
+
+ scripts/ntp-wait/ntp-wait.man.in@1.255 +6 -6
+ NTP_4_2_7P443
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.255 +2 -2
+ NTP_4_2_7P443
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.43 +1 -1
+ NTP_4_2_7P443
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.34 +6 -6
+ NTP_4_2_7P443
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.34 +2 -2
+ NTP_4_2_7P443
+
+ scripts/ntpsweep/ntpsweep.html@1.44 +1 -1
+ NTP_4_2_7P443
+
+ scripts/ntpsweep/ntpsweep.man.in@1.34 +6 -6
+ NTP_4_2_7P443
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P443
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.43 +1 -1
+ NTP_4_2_7P443
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.34 +6 -6
+ NTP_4_2_7P443
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.34 +2 -2
+ NTP_4_2_7P443
+
+ scripts/ntptrace/ntptrace.html@1.44 +1 -1
+ NTP_4_2_7P443
+
+ scripts/ntptrace/ntptrace.man.in@1.34 +6 -6
+ NTP_4_2_7P443
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P443
+
+ scripts/plot_summary.1plot_summaryman@1.45 +6 -6
+ NTP_4_2_7P443
+
+ scripts/plot_summary.1plot_summarymdoc@1.45 +2 -2
+ NTP_4_2_7P443
+
+ scripts/plot_summary.html@1.45 +1 -1
+ NTP_4_2_7P443
+
+ scripts/plot_summary.man.in@1.45 +6 -6
+ NTP_4_2_7P443
+
+ scripts/plot_summary.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P443
+
+ scripts/summary.1summaryman@1.45 +6 -6
+ NTP_4_2_7P443
+
+ scripts/summary.1summarymdoc@1.45 +2 -2
+ NTP_4_2_7P443
+
+ scripts/summary.html@1.45 +1 -1
+ NTP_4_2_7P443
+
+ scripts/summary.man.in@1.45 +6 -6
+ NTP_4_2_7P443
+
+ scripts/summary.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P443
+
+ sntp/invoke-sntp.texi@1.433 +2 -2
+ NTP_4_2_7P443
+
+ sntp/sntp-opts.c@1.448 +10 -10
+ NTP_4_2_7P443
+
+ sntp/sntp-opts.h@1.448 +4 -4
+ NTP_4_2_7P443
+
+ sntp/sntp.1sntpman@1.268 +7 -7
+ NTP_4_2_7P443
+
+ sntp/sntp.1sntpmdoc@1.268 +3 -3
+ NTP_4_2_7P443
+
+ sntp/sntp.html@1.448 +2 -2
+ NTP_4_2_7P443
+
+ sntp/sntp.man.in@1.268 +7 -7
+ NTP_4_2_7P443
+
+ sntp/sntp.mdoc.in@1.268 +3 -3
+ NTP_4_2_7P443
+
+ util/invoke-ntp-keygen.texi@1.437 +2 -2
+ NTP_4_2_7P443
+
+ util/ntp-keygen-opts.c@1.451 +10 -10
+ NTP_4_2_7P443
+
+ util/ntp-keygen-opts.h@1.451 +4 -4
+ NTP_4_2_7P443
+
+ util/ntp-keygen.1ntp-keygenman@1.265 +7 -7
+ NTP_4_2_7P443
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.265 +3 -3
+ NTP_4_2_7P443
+
+ util/ntp-keygen.html@1.113 +2 -2
+ NTP_4_2_7P443
+
+ util/ntp-keygen.man.in@1.265 +7 -7
+ NTP_4_2_7P443
+
+ util/ntp-keygen.mdoc.in@1.265 +3 -3
+ NTP_4_2_7P443
+
+ChangeSet@1.3126, 2014-05-09 21:52:34+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2594] Update the year in sntp/include/copyright.def
+
+ ChangeLog@1.1473.1.5 +1 -1
+ [Bug 2594] Update the year in sntp/include/copyright.def
+
+ChangeSet@1.3123.1.1, 2014-05-09 09:34:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P442
+ TAG: NTP_4_2_7P442
+
+ ChangeLog@1.1473.2.1 +1 -0
+ NTP_4_2_7P442
+
+ ntpd/invoke-ntp.conf.texi@1.121 +1 -1
+ NTP_4_2_7P442
+
+ ntpd/invoke-ntp.keys.texi@1.119 +1 -1
+ NTP_4_2_7P442
+
+ ntpd/invoke-ntpd.texi@1.435 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntp.conf.5man@1.155 +6 -6
+ NTP_4_2_7P442
+
+ ntpd/ntp.conf.5mdoc@1.155 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntp.conf.html@1.116 +1 -1
+ NTP_4_2_7P442
+
+ ntpd/ntp.conf.man.in@1.155 +6 -6
+ NTP_4_2_7P442
+
+ ntpd/ntp.conf.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntp.keys.5man@1.153 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntp.keys.5mdoc@1.153 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntp.keys.html@1.117 +1 -1
+ NTP_4_2_7P442
+
+ ntpd/ntp.keys.man.in@1.153 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntp.keys.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntpd-opts.c@1.453 +7 -7
+ NTP_4_2_7P442
+
+ ntpd/ntpd-opts.h@1.453 +3 -3
+ NTP_4_2_7P442
+
+ ntpd/ntpd.1ntpdman@1.264 +13 -13
+ NTP_4_2_7P442
+
+ ntpd/ntpd.1ntpdmdoc@1.264 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntpd.html@1.111 +2 -2
+ NTP_4_2_7P442
+
+ ntpd/ntpd.man.in@1.264 +13 -13
+ NTP_4_2_7P442
+
+ ntpd/ntpd.mdoc.in@1.264 +2 -2
+ NTP_4_2_7P442
+
+ ntpdc/invoke-ntpdc.texi@1.433 +2 -2
+ NTP_4_2_7P442
+
+ ntpdc/ntpdc-opts.c@1.448 +7 -7
+ NTP_4_2_7P442
+
+ ntpdc/ntpdc-opts.h@1.448 +3 -3
+ NTP_4_2_7P442
+
+ ntpdc/ntpdc.1ntpdcman@1.264 +13 -13
+ NTP_4_2_7P442
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.264 +2 -2
+ NTP_4_2_7P442
+
+ ntpdc/ntpdc.html@1.277 +2 -2
+ NTP_4_2_7P442
+
+ ntpdc/ntpdc.man.in@1.264 +13 -13
+ NTP_4_2_7P442
+
+ ntpdc/ntpdc.mdoc.in@1.264 +2 -2
+ NTP_4_2_7P442
+
+ ntpq/invoke-ntpq.texi@1.436 +2 -2
+ NTP_4_2_7P442
+
+ ntpq/ntpq-opts.c@1.450 +7 -7
+ NTP_4_2_7P442
+
+ ntpq/ntpq-opts.h@1.450 +3 -3
+ NTP_4_2_7P442
+
+ ntpq/ntpq.1ntpqman@1.264 +6 -6
+ NTP_4_2_7P442
+
+ ntpq/ntpq.1ntpqmdoc@1.264 +2 -2
+ NTP_4_2_7P442
+
+ ntpq/ntpq.html@1.108 +2 -2
+ NTP_4_2_7P442
+
+ ntpq/ntpq.man.in@1.264 +6 -6
+ NTP_4_2_7P442
+
+ ntpq/ntpq.mdoc.in@1.264 +2 -2
+ NTP_4_2_7P442
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.435 +2 -2
+ NTP_4_2_7P442
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.450 +7 -7
+ NTP_4_2_7P442
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.450 +3 -3
+ NTP_4_2_7P442
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.264 +6 -6
+ NTP_4_2_7P442
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.264 +2 -2
+ NTP_4_2_7P442
+
+ ntpsnmpd/ntpsnmpd.html@1.106 +1 -1
+ NTP_4_2_7P442
+
+ ntpsnmpd/ntpsnmpd.man.in@1.264 +6 -6
+ NTP_4_2_7P442
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.264 +2 -2
+ NTP_4_2_7P442
+
+ packageinfo.sh@1.446 +1 -1
+ NTP_4_2_7P442
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.26 +6 -6
+ NTP_4_2_7P442
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.26 +2 -2
+ NTP_4_2_7P442
+
+ scripts/calc_tickadj/calc_tickadj.html@1.25 +1 -1
+ NTP_4_2_7P442
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.25 +6 -6
+ NTP_4_2_7P442
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P442
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.27 +1 -1
+ NTP_4_2_7P442
+
+ scripts/invoke-plot_summary.texi@1.44 +1 -1
+ NTP_4_2_7P442
+
+ scripts/invoke-summary.texi@1.44 +1 -1
+ NTP_4_2_7P442
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.253 +1 -1
+ NTP_4_2_7P442
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.254 +6 -6
+ NTP_4_2_7P442
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.254 +2 -2
+ NTP_4_2_7P442
+
+ scripts/ntp-wait/ntp-wait.html@1.270 +1 -1
+ NTP_4_2_7P442
+
+ scripts/ntp-wait/ntp-wait.man.in@1.254 +6 -6
+ NTP_4_2_7P442
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.254 +2 -2
+ NTP_4_2_7P442
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.42 +1 -1
+ NTP_4_2_7P442
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.33 +6 -6
+ NTP_4_2_7P442
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.33 +2 -2
+ NTP_4_2_7P442
+
+ scripts/ntpsweep/ntpsweep.html@1.43 +1 -1
+ NTP_4_2_7P442
+
+ scripts/ntpsweep/ntpsweep.man.in@1.33 +6 -6
+ NTP_4_2_7P442
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P442
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.42 +1 -1
+ NTP_4_2_7P442
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.33 +6 -6
+ NTP_4_2_7P442
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.33 +2 -2
+ NTP_4_2_7P442
+
+ scripts/ntptrace/ntptrace.html@1.43 +1 -1
+ NTP_4_2_7P442
+
+ scripts/ntptrace/ntptrace.man.in@1.33 +6 -6
+ NTP_4_2_7P442
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P442
+
+ scripts/plot_summary.1plot_summaryman@1.44 +6 -6
+ NTP_4_2_7P442
+
+ scripts/plot_summary.1plot_summarymdoc@1.44 +2 -2
+ NTP_4_2_7P442
+
+ scripts/plot_summary.html@1.44 +1 -1
+ NTP_4_2_7P442
+
+ scripts/plot_summary.man.in@1.44 +6 -6
+ NTP_4_2_7P442
+
+ scripts/plot_summary.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P442
+
+ scripts/summary.1summaryman@1.44 +6 -6
+ NTP_4_2_7P442
+
+ scripts/summary.1summarymdoc@1.44 +2 -2
+ NTP_4_2_7P442
+
+ scripts/summary.html@1.44 +1 -1
+ NTP_4_2_7P442
+
+ scripts/summary.man.in@1.44 +6 -6
+ NTP_4_2_7P442
+
+ scripts/summary.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P442
+
+ sntp/invoke-sntp.texi@1.432 +2 -2
+ NTP_4_2_7P442
+
+ sntp/sntp-opts.c@1.447 +7 -7
+ NTP_4_2_7P442
+
+ sntp/sntp-opts.h@1.447 +3 -3
+ NTP_4_2_7P442
+
+ sntp/sntp.1sntpman@1.267 +6 -6
+ NTP_4_2_7P442
+
+ sntp/sntp.1sntpmdoc@1.267 +2 -2
+ NTP_4_2_7P442
+
+ sntp/sntp.html@1.447 +2 -2
+ NTP_4_2_7P442
+
+ sntp/sntp.man.in@1.267 +6 -6
+ NTP_4_2_7P442
+
+ sntp/sntp.mdoc.in@1.267 +2 -2
+ NTP_4_2_7P442
+
+ util/invoke-ntp-keygen.texi@1.436 +2 -2
+ NTP_4_2_7P442
+
+ util/ntp-keygen-opts.c@1.450 +7 -7
+ NTP_4_2_7P442
+
+ util/ntp-keygen-opts.h@1.450 +3 -3
+ NTP_4_2_7P442
+
+ util/ntp-keygen.1ntp-keygenman@1.264 +6 -6
+ NTP_4_2_7P442
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.264 +2 -2
+ NTP_4_2_7P442
+
+ util/ntp-keygen.html@1.112 +2 -2
+ NTP_4_2_7P442
+
+ util/ntp-keygen.man.in@1.264 +6 -6
+ NTP_4_2_7P442
+
+ util/ntp-keygen.mdoc.in@1.264 +2 -2
+ NTP_4_2_7P442
+
+ChangeSet@1.3124, 2014-05-09 01:54:22-07:00, harlan@hms-mbp11.local
+ [Bug 2594] Update the year in sntp/include/copyright.def
+
+ ChangeLog@1.1473.1.3 +1 -0
+ [Bug 2594] Update the year in sntp/include/copyright.def
+
+ sntp/include/copyright.def@1.24 +1 -1
+ [Bug 2594] Update the year in sntp/include/copyright.def
+
+ChangeSet@1.3123, 2014-05-09 01:32:31-07:00, harlan@hms-mbp11.local
+ turn off the SCCS flag in extern.html
+
+ html/extern.html@1.20 +0 -0
+ Turn off SCCS flag
+
+ChangeSet@1.3122, 2014-05-08 23:29:15-07:00, harlan@hms-mbp11.local
+ [Bug 2600] Fix "Undisicplined Local Clock" driver1.html page
+
+ ChangeLog@1.1473.1.2 +1 -0
+ [Bug 2600] Fix "Undisicplined Local Clock" driver1.html page
+
+ html/drivers/driver1.html@1.21 +3 -3
+ [Bug 2600] Fix "Undisicplined Local Clock" driver1.html page
+
+ChangeSet@1.3121, 2014-05-08 23:07:27-07:00, harlan@hms-mbp11.local
+ [Bug 2589] Update VS2013 project files for libntp
+
+ ChangeLog@1.1473.1.1 +1 -0
+ [Bug 2589] Update VS2013 project files for libntp
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj@1.4 +2 -0
+ [Bug 2589] Update VS2013 project files for libntp
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.3 +6 -0
+ [Bug 2589] Update VS2013 project files for libntp
+
+ChangeSet@1.3107.1.41, 2014-05-06 00:48:08+02:00, jnperlin@hydra.(none)
+ [bug 2597] leap second loose ends -- coverity issues
+
+ ChangeLog@1.1474 +2 -0
+ [bug 2597] leap second loose ends -- coverity issues
+
+ ntpd/ntp_leapsec.c@1.12 +17 -1
+ [bug 2597] leap second loose ends -- coverity issues
+
+ ntpd/ntp_util.c@1.113 +4 -4
+ [bug 2597] leap second loose ends -- coverity issues
+
+ChangeSet@1.3107.1.40, 2014-05-04 06:10:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P441
+ TAG: NTP_4_2_7P441
+
+ ChangeLog@1.1473 +1 -0
+ NTP_4_2_7P441
+
+ ntpd/invoke-ntp.conf.texi@1.120 +1 -1
+ NTP_4_2_7P441
+
+ ntpd/invoke-ntp.keys.texi@1.118 +1 -1
+ NTP_4_2_7P441
+
+ ntpd/invoke-ntpd.texi@1.434 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntp.conf.5man@1.154 +3019 -0
+ NTP_4_2_7P441
+
+ ntpd/ntp.conf.5mdoc@1.154 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntp.conf.html@1.115 +1 -1
+ NTP_4_2_7P441
+
+ ntpd/ntp.conf.man.in@1.154 +3019 -0
+ NTP_4_2_7P441
+
+ ntpd/ntp.conf.mdoc.in@1.154 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntp.keys.5man@1.152 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntp.keys.5mdoc@1.152 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntp.keys.html@1.116 +1 -1
+ NTP_4_2_7P441
+
+ ntpd/ntp.keys.man.in@1.152 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntp.keys.mdoc.in@1.152 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntpd-opts.c@1.452 +7 -7
+ NTP_4_2_7P441
+
+ ntpd/ntpd-opts.h@1.452 +3 -3
+ NTP_4_2_7P441
+
+ ntpd/ntpd.1ntpdman@1.263 +13 -13
+ NTP_4_2_7P441
+
+ ntpd/ntpd.1ntpdmdoc@1.263 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntpd.html@1.110 +2 -2
+ NTP_4_2_7P441
+
+ ntpd/ntpd.man.in@1.263 +13 -13
+ NTP_4_2_7P441
+
+ ntpd/ntpd.mdoc.in@1.263 +2 -2
+ NTP_4_2_7P441
+
+ ntpdc/invoke-ntpdc.texi@1.432 +2 -2
+ NTP_4_2_7P441
+
+ ntpdc/ntpdc-opts.c@1.447 +7 -7
+ NTP_4_2_7P441
+
+ ntpdc/ntpdc-opts.h@1.447 +3 -3
+ NTP_4_2_7P441
+
+ ntpdc/ntpdc.1ntpdcman@1.263 +6 -6
+ NTP_4_2_7P441
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.263 +2 -2
+ NTP_4_2_7P441
+
+ ntpdc/ntpdc.html@1.276 +2 -2
+ NTP_4_2_7P441
+
+ ntpdc/ntpdc.man.in@1.263 +6 -6
+ NTP_4_2_7P441
+
+ ntpdc/ntpdc.mdoc.in@1.263 +2 -2
+ NTP_4_2_7P441
+
+ ntpq/invoke-ntpq.texi@1.435 +2 -2
+ NTP_4_2_7P441
+
+ ntpq/ntpq-opts.c@1.449 +7 -7
+ NTP_4_2_7P441
+
+ ntpq/ntpq-opts.h@1.449 +3 -3
+ NTP_4_2_7P441
+
+ ntpq/ntpq.1ntpqman@1.263 +13 -13
+ NTP_4_2_7P441
+
+ ntpq/ntpq.1ntpqmdoc@1.263 +2 -2
+ NTP_4_2_7P441
+
+ ntpq/ntpq.html@1.107 +2 -2
+ NTP_4_2_7P441
+
+ ntpq/ntpq.man.in@1.263 +13 -13
+ NTP_4_2_7P441
+
+ ntpq/ntpq.mdoc.in@1.263 +2 -2
+ NTP_4_2_7P441
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.434 +2 -2
+ NTP_4_2_7P441
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.449 +7 -7
+ NTP_4_2_7P441
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.449 +3 -3
+ NTP_4_2_7P441
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.263 +6 -6
+ NTP_4_2_7P441
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.263 +2 -2
+ NTP_4_2_7P441
+
+ ntpsnmpd/ntpsnmpd.html@1.105 +1 -1
+ NTP_4_2_7P441
+
+ ntpsnmpd/ntpsnmpd.man.in@1.263 +6 -6
+ NTP_4_2_7P441
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.263 +2 -2
+ NTP_4_2_7P441
+
+ packageinfo.sh@1.445 +1 -1
+ NTP_4_2_7P441
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.25 +6 -6
+ NTP_4_2_7P441
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.25 +2 -2
+ NTP_4_2_7P441
+
+ scripts/calc_tickadj/calc_tickadj.html@1.24 +1 -1
+ NTP_4_2_7P441
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.24 +6 -6
+ NTP_4_2_7P441
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P441
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.26 +1 -1
+ NTP_4_2_7P441
+
+ scripts/invoke-plot_summary.texi@1.43 +1 -1
+ NTP_4_2_7P441
+
+ scripts/invoke-summary.texi@1.43 +1 -1
+ NTP_4_2_7P441
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.252 +1 -1
+ NTP_4_2_7P441
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.253 +6 -6
+ NTP_4_2_7P441
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.253 +2 -2
+ NTP_4_2_7P441
+
+ scripts/ntp-wait/ntp-wait.html@1.269 +1 -1
+ NTP_4_2_7P441
+
+ scripts/ntp-wait/ntp-wait.man.in@1.253 +6 -6
+ NTP_4_2_7P441
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.253 +2 -2
+ NTP_4_2_7P441
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.41 +1 -1
+ NTP_4_2_7P441
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.32 +6 -6
+ NTP_4_2_7P441
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.32 +2 -2
+ NTP_4_2_7P441
+
+ scripts/ntpsweep/ntpsweep.html@1.42 +1 -1
+ NTP_4_2_7P441
+
+ scripts/ntpsweep/ntpsweep.man.in@1.32 +6 -6
+ NTP_4_2_7P441
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P441
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.41 +1 -1
+ NTP_4_2_7P441
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.32 +6 -6
+ NTP_4_2_7P441
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.32 +2 -2
+ NTP_4_2_7P441
+
+ scripts/ntptrace/ntptrace.html@1.42 +1 -1
+ NTP_4_2_7P441
+
+ scripts/ntptrace/ntptrace.man.in@1.32 +6 -6
+ NTP_4_2_7P441
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P441
+
+ scripts/plot_summary.1plot_summaryman@1.43 +6 -6
+ NTP_4_2_7P441
+
+ scripts/plot_summary.1plot_summarymdoc@1.43 +2 -2
+ NTP_4_2_7P441
+
+ scripts/plot_summary.html@1.43 +1 -1
+ NTP_4_2_7P441
+
+ scripts/plot_summary.man.in@1.43 +6 -6
+ NTP_4_2_7P441
+
+ scripts/plot_summary.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P441
+
+ scripts/summary.1summaryman@1.43 +6 -6
+ NTP_4_2_7P441
+
+ scripts/summary.1summarymdoc@1.43 +2 -2
+ NTP_4_2_7P441
+
+ scripts/summary.html@1.43 +1 -1
+ NTP_4_2_7P441
+
+ scripts/summary.man.in@1.43 +6 -6
+ NTP_4_2_7P441
+
+ scripts/summary.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P441
+
+ sntp/invoke-sntp.texi@1.431 +2 -2
+ NTP_4_2_7P441
+
+ sntp/sntp-opts.c@1.446 +7 -7
+ NTP_4_2_7P441
+
+ sntp/sntp-opts.h@1.446 +3 -3
+ NTP_4_2_7P441
+
+ sntp/sntp.1sntpman@1.266 +6 -6
+ NTP_4_2_7P441
+
+ sntp/sntp.1sntpmdoc@1.266 +2 -2
+ NTP_4_2_7P441
+
+ sntp/sntp.html@1.446 +2 -2
+ NTP_4_2_7P441
+
+ sntp/sntp.man.in@1.266 +6 -6
+ NTP_4_2_7P441
+
+ sntp/sntp.mdoc.in@1.266 +2 -2
+ NTP_4_2_7P441
+
+ util/invoke-ntp-keygen.texi@1.435 +2 -2
+ NTP_4_2_7P441
+
+ util/ntp-keygen-opts.c@1.449 +7 -7
+ NTP_4_2_7P441
+
+ util/ntp-keygen-opts.h@1.449 +3 -3
+ NTP_4_2_7P441
+
+ util/ntp-keygen.1ntp-keygenman@1.263 +6 -6
+ NTP_4_2_7P441
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.263 +2 -2
+ NTP_4_2_7P441
+
+ util/ntp-keygen.html@1.111 +2 -2
+ NTP_4_2_7P441
+
+ util/ntp-keygen.man.in@1.263 +6 -6
+ NTP_4_2_7P441
+
+ util/ntp-keygen.mdoc.in@1.263 +2 -2
+ NTP_4_2_7P441
+
+ChangeSet@1.3107.1.39, 2014-05-04 04:51:37+00:00, stenn@psp-deb1.ntp.org
+ nits
+
+ ntpd/ntp_leapsec.c@1.11 +9 -7
+ nits
+
+ ntpd/ntp_util.c@1.112 +2 -2
+ nits
+
+ChangeSet@1.3107.1.38, 2014-04-22 21:40:54+02:00, jnperlin@hydra.(none)
+ [Bug 2597] fixed loose ends: changed/unified logging for leapfile related actions
+
+ ChangeLog@1.1472 +4 -0
+ [Bug 2597] changed/unified logging for leapfile related actions
+
+ include/ntpd.h@1.182 +1 -1
+ [Bug 2597] changed/unified logging for leapfile related actions
+ changed signature for 'check_leap_file()'
+
+ ntpd/ntp_leapsec.c@1.10 +83 -7
+ [Bug 2597] changed/unified logging for leapfile related actions
+ split functionality between 'leapsec_load_file()' and 'leapsec_load_stream()'
+ improve logging for non-existing and successfully loaded files
+
+ ntpd/ntp_leapsec.h@1.7 +17 -4
+ [Bug 2597] changed/unified logging for leapfile related actions
+ split functionality between 'leapsec_load_file()' and 'leapsec_load_stream()'
+
+ ntpd/ntp_timer.c@1.81 +5 -26
+ [Bug 2597] changed/unified logging for leapfile related actions
+ let 'check_leap_file()' do the expiration test and logging
+
+ ntpd/ntp_util.c@1.111 +44 -54
+ [Bug 2597] changed/unified logging for leapfile related actions
+ 'check_leap_file()' checks for leapfile load/reload and expiration,
+ let 'leapsec_load_file()' do the handling & logging for the disk file
+
+ChangeSet@1.3107.1.37, 2014-04-09 10:24:43+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P440
+ TAG: NTP_4_2_7P440
+
+ ChangeLog@1.1471 +1 -0
+ NTP_4_2_7P440
+
+ ntpd/invoke-ntp.conf.texi@1.119 +1 -1
+ NTP_4_2_7P440
+
+ ntpd/invoke-ntp.keys.texi@1.117 +1 -1
+ NTP_4_2_7P440
+
+ ntpd/invoke-ntpd.texi@1.433 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntp.conf.5man@1.153 +0 -3019
+ NTP_4_2_7P440
+
+ ntpd/ntp.conf.5mdoc@1.153 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntp.conf.html@1.114 +1 -1
+ NTP_4_2_7P440
+
+ ntpd/ntp.conf.man.in@1.153 +0 -3019
+ NTP_4_2_7P440
+
+ ntpd/ntp.conf.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntp.keys.5man@1.151 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntp.keys.5mdoc@1.151 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntp.keys.html@1.115 +1 -1
+ NTP_4_2_7P440
+
+ ntpd/ntp.keys.man.in@1.151 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntp.keys.mdoc.in@1.151 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntpd-opts.c@1.451 +7 -7
+ NTP_4_2_7P440
+
+ ntpd/ntpd-opts.h@1.451 +3 -3
+ NTP_4_2_7P440
+
+ ntpd/ntpd.1ntpdman@1.262 +6 -6
+ NTP_4_2_7P440
+
+ ntpd/ntpd.1ntpdmdoc@1.262 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntpd.html@1.109 +2 -2
+ NTP_4_2_7P440
+
+ ntpd/ntpd.man.in@1.262 +6 -6
+ NTP_4_2_7P440
+
+ ntpd/ntpd.mdoc.in@1.262 +2 -2
+ NTP_4_2_7P440
+
+ ntpdc/invoke-ntpdc.texi@1.431 +2 -2
+ NTP_4_2_7P440
+
+ ntpdc/ntpdc-opts.c@1.446 +7 -7
+ NTP_4_2_7P440
+
+ ntpdc/ntpdc-opts.h@1.446 +3 -3
+ NTP_4_2_7P440
+
+ ntpdc/ntpdc.1ntpdcman@1.262 +6 -6
+ NTP_4_2_7P440
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.262 +2 -2
+ NTP_4_2_7P440
+
+ ntpdc/ntpdc.html@1.275 +2 -2
+ NTP_4_2_7P440
+
+ ntpdc/ntpdc.man.in@1.262 +6 -6
+ NTP_4_2_7P440
+
+ ntpdc/ntpdc.mdoc.in@1.262 +2 -2
+ NTP_4_2_7P440
+
+ ntpq/invoke-ntpq.texi@1.434 +2 -2
+ NTP_4_2_7P440
+
+ ntpq/ntpq-opts.c@1.448 +7 -7
+ NTP_4_2_7P440
+
+ ntpq/ntpq-opts.h@1.448 +3 -3
+ NTP_4_2_7P440
+
+ ntpq/ntpq.1ntpqman@1.262 +475 -0
+ NTP_4_2_7P440
+
+ ntpq/ntpq.1ntpqmdoc@1.262 +2 -2
+ NTP_4_2_7P440
+
+ ntpq/ntpq.html@1.106 +2 -2
+ NTP_4_2_7P440
+
+ ntpq/ntpq.man.in@1.262 +475 -0
+ NTP_4_2_7P440
+
+ ntpq/ntpq.mdoc.in@1.262 +2 -2
+ NTP_4_2_7P440
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.433 +2 -2
+ NTP_4_2_7P440
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.448 +7 -7
+ NTP_4_2_7P440
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.448 +3 -3
+ NTP_4_2_7P440
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.262 +13 -13
+ NTP_4_2_7P440
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.262 +2 -2
+ NTP_4_2_7P440
+
+ ntpsnmpd/ntpsnmpd.html@1.104 +1 -1
+ NTP_4_2_7P440
+
+ ntpsnmpd/ntpsnmpd.man.in@1.262 +13 -13
+ NTP_4_2_7P440
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.262 +2 -2
+ NTP_4_2_7P440
+
+ packageinfo.sh@1.444 +1 -1
+ NTP_4_2_7P440
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.24 +6 -6
+ NTP_4_2_7P440
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.24 +2 -2
+ NTP_4_2_7P440
+
+ scripts/calc_tickadj/calc_tickadj.html@1.23 +1 -1
+ NTP_4_2_7P440
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.23 +6 -6
+ NTP_4_2_7P440
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P440
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.25 +1 -1
+ NTP_4_2_7P440
+
+ scripts/invoke-plot_summary.texi@1.42 +1 -1
+ NTP_4_2_7P440
+
+ scripts/invoke-summary.texi@1.42 +1 -1
+ NTP_4_2_7P440
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.251 +1 -1
+ NTP_4_2_7P440
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.252 +6 -6
+ NTP_4_2_7P440
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.252 +2 -2
+ NTP_4_2_7P440
+
+ scripts/ntp-wait/ntp-wait.html@1.268 +1 -1
+ NTP_4_2_7P440
+
+ scripts/ntp-wait/ntp-wait.man.in@1.252 +6 -6
+ NTP_4_2_7P440
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.252 +2 -2
+ NTP_4_2_7P440
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.40 +1 -1
+ NTP_4_2_7P440
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.31 +6 -6
+ NTP_4_2_7P440
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.31 +2 -2
+ NTP_4_2_7P440
+
+ scripts/ntpsweep/ntpsweep.html@1.41 +1 -1
+ NTP_4_2_7P440
+
+ scripts/ntpsweep/ntpsweep.man.in@1.31 +6 -6
+ NTP_4_2_7P440
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P440
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.40 +1 -1
+ NTP_4_2_7P440
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.31 +6 -6
+ NTP_4_2_7P440
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.31 +2 -2
+ NTP_4_2_7P440
+
+ scripts/ntptrace/ntptrace.html@1.41 +1 -1
+ NTP_4_2_7P440
+
+ scripts/ntptrace/ntptrace.man.in@1.31 +6 -6
+ NTP_4_2_7P440
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P440
+
+ scripts/plot_summary.1plot_summaryman@1.42 +6 -6
+ NTP_4_2_7P440
+
+ scripts/plot_summary.1plot_summarymdoc@1.42 +2 -2
+ NTP_4_2_7P440
+
+ scripts/plot_summary.html@1.42 +1 -1
+ NTP_4_2_7P440
+
+ scripts/plot_summary.man.in@1.42 +6 -6
+ NTP_4_2_7P440
+
+ scripts/plot_summary.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P440
+
+ scripts/summary.1summaryman@1.42 +6 -6
+ NTP_4_2_7P440
+
+ scripts/summary.1summarymdoc@1.42 +2 -2
+ NTP_4_2_7P440
+
+ scripts/summary.html@1.42 +1 -1
+ NTP_4_2_7P440
+
+ scripts/summary.man.in@1.42 +6 -6
+ NTP_4_2_7P440
+
+ scripts/summary.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P440
+
+ sntp/invoke-sntp.texi@1.430 +2 -2
+ NTP_4_2_7P440
+
+ sntp/sntp-opts.c@1.445 +7 -7
+ NTP_4_2_7P440
+
+ sntp/sntp-opts.h@1.445 +3 -3
+ NTP_4_2_7P440
+
+ sntp/sntp.1sntpman@1.265 +6 -6
+ NTP_4_2_7P440
+
+ sntp/sntp.1sntpmdoc@1.265 +2 -2
+ NTP_4_2_7P440
+
+ sntp/sntp.html@1.445 +2 -2
+ NTP_4_2_7P440
+
+ sntp/sntp.man.in@1.265 +6 -6
+ NTP_4_2_7P440
+
+ sntp/sntp.mdoc.in@1.265 +2 -2
+ NTP_4_2_7P440
+
+ util/invoke-ntp-keygen.texi@1.434 +2 -2
+ NTP_4_2_7P440
+
+ util/ntp-keygen-opts.c@1.448 +7 -7
+ NTP_4_2_7P440
+
+ util/ntp-keygen-opts.h@1.448 +3 -3
+ NTP_4_2_7P440
+
+ util/ntp-keygen.1ntp-keygenman@1.262 +6 -6
+ NTP_4_2_7P440
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.262 +2 -2
+ NTP_4_2_7P440
+
+ util/ntp-keygen.html@1.110 +2 -2
+ NTP_4_2_7P440
+
+ util/ntp-keygen.man.in@1.262 +6 -6
+ NTP_4_2_7P440
+
+ util/ntp-keygen.mdoc.in@1.262 +2 -2
+ NTP_4_2_7P440
+
+ChangeSet@1.3107.4.2, 2014-04-08 07:40:51+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ ChangeLog@1.1468.1.2 +1 -0
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ ntpd/ntpd.c@1.154 +46 -45
+ [Bug 2536] ntpd sandboxing support (libseccomp2) cleanup
+
+ChangeSet@1.3107.4.1, 2014-04-03 10:22:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P439
+ TAG: NTP_4_2_7P439
+
+ ChangeLog@1.1468.1.1 +1 -0
+ NTP_4_2_7P439
+
+ ntpd/invoke-ntp.conf.texi@1.118 +1 -1
+ NTP_4_2_7P439
+
+ ntpd/invoke-ntp.keys.texi@1.116 +1 -1
+ NTP_4_2_7P439
+
+ ntpd/invoke-ntpd.texi@1.432 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntp.conf.5man@1.152 +6 -6
+ NTP_4_2_7P439
+
+ ntpd/ntp.conf.5mdoc@1.152 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntp.conf.html@1.113 +1 -1
+ NTP_4_2_7P439
+
+ ntpd/ntp.conf.man.in@1.152 +6 -6
+ NTP_4_2_7P439
+
+ ntpd/ntp.conf.mdoc.in@1.152 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntp.keys.5man@1.150 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntp.keys.5mdoc@1.150 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntp.keys.html@1.114 +1 -1
+ NTP_4_2_7P439
+
+ ntpd/ntp.keys.man.in@1.150 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntp.keys.mdoc.in@1.150 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntpd-opts.c@1.450 +7 -7
+ NTP_4_2_7P439
+
+ ntpd/ntpd-opts.h@1.450 +3 -3
+ NTP_4_2_7P439
+
+ ntpd/ntpd.1ntpdman@1.261 +6 -6
+ NTP_4_2_7P439
+
+ ntpd/ntpd.1ntpdmdoc@1.261 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntpd.html@1.108 +2 -2
+ NTP_4_2_7P439
+
+ ntpd/ntpd.man.in@1.261 +6 -6
+ NTP_4_2_7P439
+
+ ntpd/ntpd.mdoc.in@1.261 +2 -2
+ NTP_4_2_7P439
+
+ ntpdc/invoke-ntpdc.texi@1.430 +2 -2
+ NTP_4_2_7P439
+
+ ntpdc/ntpdc-opts.c@1.445 +7 -7
+ NTP_4_2_7P439
+
+ ntpdc/ntpdc-opts.h@1.445 +3 -3
+ NTP_4_2_7P439
+
+ ntpdc/ntpdc.1ntpdcman@1.261 +6 -6
+ NTP_4_2_7P439
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.261 +2 -2
+ NTP_4_2_7P439
+
+ ntpdc/ntpdc.html@1.274 +2 -2
+ NTP_4_2_7P439
+
+ ntpdc/ntpdc.man.in@1.261 +6 -6
+ NTP_4_2_7P439
+
+ ntpdc/ntpdc.mdoc.in@1.261 +2 -2
+ NTP_4_2_7P439
+
+ ntpq/invoke-ntpq.texi@1.433 +2 -2
+ NTP_4_2_7P439
+
+ ntpq/ntpq-opts.c@1.447 +7 -7
+ NTP_4_2_7P439
+
+ ntpq/ntpq-opts.h@1.447 +3 -3
+ NTP_4_2_7P439
+
+ ntpq/ntpq.1ntpqman@1.261 +0 -475
+ NTP_4_2_7P439
+
+ ntpq/ntpq.1ntpqmdoc@1.261 +2 -2
+ NTP_4_2_7P439
+
+ ntpq/ntpq.html@1.105 +2 -2
+ NTP_4_2_7P439
+
+ ntpq/ntpq.man.in@1.261 +0 -475
+ NTP_4_2_7P439
+
+ ntpq/ntpq.mdoc.in@1.261 +2 -2
+ NTP_4_2_7P439
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.432 +2 -2
+ NTP_4_2_7P439
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.447 +7 -7
+ NTP_4_2_7P439
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.447 +3 -3
+ NTP_4_2_7P439
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.261 +13 -13
+ NTP_4_2_7P439
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.261 +2 -2
+ NTP_4_2_7P439
+
+ ntpsnmpd/ntpsnmpd.html@1.103 +1 -1
+ NTP_4_2_7P439
+
+ ntpsnmpd/ntpsnmpd.man.in@1.261 +13 -13
+ NTP_4_2_7P439
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.261 +2 -2
+ NTP_4_2_7P439
+
+ packageinfo.sh@1.443 +1 -1
+ NTP_4_2_7P439
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.23 +6 -6
+ NTP_4_2_7P439
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.23 +2 -2
+ NTP_4_2_7P439
+
+ scripts/calc_tickadj/calc_tickadj.html@1.22 +1 -1
+ NTP_4_2_7P439
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.22 +6 -6
+ NTP_4_2_7P439
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P439
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.24 +1 -1
+ NTP_4_2_7P439
+
+ scripts/invoke-plot_summary.texi@1.41 +1 -1
+ NTP_4_2_7P439
+
+ scripts/invoke-summary.texi@1.41 +1 -1
+ NTP_4_2_7P439
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.250 +1 -1
+ NTP_4_2_7P439
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.251 +6 -6
+ NTP_4_2_7P439
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.251 +2 -2
+ NTP_4_2_7P439
+
+ scripts/ntp-wait/ntp-wait.html@1.267 +1 -1
+ NTP_4_2_7P439
+
+ scripts/ntp-wait/ntp-wait.man.in@1.251 +6 -6
+ NTP_4_2_7P439
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.251 +2 -2
+ NTP_4_2_7P439
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.39 +1 -1
+ NTP_4_2_7P439
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.30 +6 -6
+ NTP_4_2_7P439
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.30 +2 -2
+ NTP_4_2_7P439
+
+ scripts/ntpsweep/ntpsweep.html@1.40 +1 -1
+ NTP_4_2_7P439
+
+ scripts/ntpsweep/ntpsweep.man.in@1.30 +6 -6
+ NTP_4_2_7P439
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P439
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.39 +1 -1
+ NTP_4_2_7P439
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.30 +6 -6
+ NTP_4_2_7P439
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.30 +2 -2
+ NTP_4_2_7P439
+
+ scripts/ntptrace/ntptrace.html@1.40 +1 -1
+ NTP_4_2_7P439
+
+ scripts/ntptrace/ntptrace.man.in@1.30 +6 -6
+ NTP_4_2_7P439
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P439
+
+ scripts/plot_summary.1plot_summaryman@1.41 +6 -6
+ NTP_4_2_7P439
+
+ scripts/plot_summary.1plot_summarymdoc@1.41 +2 -2
+ NTP_4_2_7P439
+
+ scripts/plot_summary.html@1.41 +1 -1
+ NTP_4_2_7P439
+
+ scripts/plot_summary.man.in@1.41 +6 -6
+ NTP_4_2_7P439
+
+ scripts/plot_summary.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P439
+
+ scripts/summary.1summaryman@1.41 +6 -6
+ NTP_4_2_7P439
+
+ scripts/summary.1summarymdoc@1.41 +2 -2
+ NTP_4_2_7P439
+
+ scripts/summary.html@1.41 +1 -1
+ NTP_4_2_7P439
+
+ scripts/summary.man.in@1.41 +6 -6
+ NTP_4_2_7P439
+
+ scripts/summary.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P439
+
+ sntp/invoke-sntp.texi@1.429 +2 -2
+ NTP_4_2_7P439
+
+ sntp/sntp-opts.c@1.444 +7 -7
+ NTP_4_2_7P439
+
+ sntp/sntp-opts.h@1.444 +3 -3
+ NTP_4_2_7P439
+
+ sntp/sntp.1sntpman@1.264 +6 -6
+ NTP_4_2_7P439
+
+ sntp/sntp.1sntpmdoc@1.264 +2 -2
+ NTP_4_2_7P439
+
+ sntp/sntp.html@1.444 +2 -2
+ NTP_4_2_7P439
+
+ sntp/sntp.man.in@1.264 +6 -6
+ NTP_4_2_7P439
+
+ sntp/sntp.mdoc.in@1.264 +2 -2
+ NTP_4_2_7P439
+
+ util/invoke-ntp-keygen.texi@1.433 +2 -2
+ NTP_4_2_7P439
+
+ util/ntp-keygen-opts.c@1.447 +7 -7
+ NTP_4_2_7P439
+
+ util/ntp-keygen-opts.h@1.447 +3 -3
+ NTP_4_2_7P439
+
+ util/ntp-keygen.1ntp-keygenman@1.261 +6 -6
+ NTP_4_2_7P439
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.261 +2 -2
+ NTP_4_2_7P439
+
+ util/ntp-keygen.html@1.109 +2 -2
+ NTP_4_2_7P439
+
+ util/ntp-keygen.man.in@1.261 +6 -6
+ NTP_4_2_7P439
+
+ util/ntp-keygen.mdoc.in@1.261 +2 -2
+ NTP_4_2_7P439
+
+ChangeSet@1.3107.1.35, 2014-04-02 20:26:10+02:00, jnperlin@hydra.(none)
+ [Bug 2570] cleanup: log format for successful leapfile load
+
+ ChangeLog@1.1469 +1 -0
+ [Bug 2570] cleanup: log format for successful leapfile load
+
+ ntpd/ntp_leapsec.c@1.9 +1 -1
+ [Bug 2570] cleanup: log format for successful leapfile load
+
+ChangeSet@1.3107.1.34, 2014-04-02 03:00:46-04:00, stenn@deacon.udel.edu
+ [Bug 2589] fix VS2009 compile problem
+
+ ChangeLog@1.1468 +1 -0
+ [Bug 2589] fix VS2009 compile problem
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.50 +10 -2
+ [Bug 2589] fix VS2009 compile problem
+
+ChangeSet@1.3107.1.33, 2014-04-01 10:50:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P438
+ TAG: NTP_4_2_7P438
+
+ ChangeLog@1.1467 +1 -0
+ NTP_4_2_7P438
+
+ ntpd/invoke-ntp.conf.texi@1.117 +1 -1
+ NTP_4_2_7P438
+
+ ntpd/invoke-ntp.keys.texi@1.115 +1 -1
+ NTP_4_2_7P438
+
+ ntpd/invoke-ntpd.texi@1.431 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntp.conf.5man@1.151 +6 -6
+ NTP_4_2_7P438
+
+ ntpd/ntp.conf.5mdoc@1.151 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntp.conf.html@1.112 +1 -1
+ NTP_4_2_7P438
+
+ ntpd/ntp.conf.man.in@1.151 +6 -6
+ NTP_4_2_7P438
+
+ ntpd/ntp.conf.mdoc.in@1.151 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntp.keys.5man@1.149 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntp.keys.5mdoc@1.149 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntp.keys.html@1.113 +1 -1
+ NTP_4_2_7P438
+
+ ntpd/ntp.keys.man.in@1.149 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntp.keys.mdoc.in@1.149 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntpd-opts.c@1.449 +7 -7
+ NTP_4_2_7P438
+
+ ntpd/ntpd-opts.h@1.449 +3 -3
+ NTP_4_2_7P438
+
+ ntpd/ntpd.1ntpdman@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpd/ntpd.1ntpdmdoc@1.260 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntpd.html@1.107 +2 -2
+ NTP_4_2_7P438
+
+ ntpd/ntpd.man.in@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpd/ntpd.mdoc.in@1.260 +2 -2
+ NTP_4_2_7P438
+
+ ntpdc/invoke-ntpdc.texi@1.429 +2 -2
+ NTP_4_2_7P438
+
+ ntpdc/ntpdc-opts.c@1.444 +7 -7
+ NTP_4_2_7P438
+
+ ntpdc/ntpdc-opts.h@1.444 +3 -3
+ NTP_4_2_7P438
+
+ ntpdc/ntpdc.1ntpdcman@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.260 +2 -2
+ NTP_4_2_7P438
+
+ ntpdc/ntpdc.html@1.273 +2 -2
+ NTP_4_2_7P438
+
+ ntpdc/ntpdc.man.in@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpdc/ntpdc.mdoc.in@1.260 +2 -2
+ NTP_4_2_7P438
+
+ ntpq/invoke-ntpq.texi@1.432 +2 -2
+ NTP_4_2_7P438
+
+ ntpq/ntpq-opts.c@1.446 +7 -7
+ NTP_4_2_7P438
+
+ ntpq/ntpq-opts.h@1.446 +3 -3
+ NTP_4_2_7P438
+
+ ntpq/ntpq.1ntpqman@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpq/ntpq.1ntpqmdoc@1.260 +2 -2
+ NTP_4_2_7P438
+
+ ntpq/ntpq.html@1.104 +2 -2
+ NTP_4_2_7P438
+
+ ntpq/ntpq.man.in@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpq/ntpq.mdoc.in@1.260 +2 -2
+ NTP_4_2_7P438
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.431 +2 -2
+ NTP_4_2_7P438
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.446 +7 -7
+ NTP_4_2_7P438
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.446 +3 -3
+ NTP_4_2_7P438
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.260 +2 -2
+ NTP_4_2_7P438
+
+ ntpsnmpd/ntpsnmpd.html@1.102 +1 -1
+ NTP_4_2_7P438
+
+ ntpsnmpd/ntpsnmpd.man.in@1.260 +6 -6
+ NTP_4_2_7P438
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.260 +2 -2
+ NTP_4_2_7P438
+
+ packageinfo.sh@1.442 +1 -1
+ NTP_4_2_7P438
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.22 +6 -6
+ NTP_4_2_7P438
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.22 +2 -2
+ NTP_4_2_7P438
+
+ scripts/calc_tickadj/calc_tickadj.html@1.21 +1 -1
+ NTP_4_2_7P438
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.21 +6 -6
+ NTP_4_2_7P438
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P438
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.23 +1 -1
+ NTP_4_2_7P438
+
+ scripts/invoke-plot_summary.texi@1.40 +1 -1
+ NTP_4_2_7P438
+
+ scripts/invoke-summary.texi@1.40 +1 -1
+ NTP_4_2_7P438
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.249 +1 -1
+ NTP_4_2_7P438
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.250 +6 -6
+ NTP_4_2_7P438
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.250 +2 -2
+ NTP_4_2_7P438
+
+ scripts/ntp-wait/ntp-wait.html@1.266 +1 -1
+ NTP_4_2_7P438
+
+ scripts/ntp-wait/ntp-wait.man.in@1.250 +6 -6
+ NTP_4_2_7P438
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.250 +2 -2
+ NTP_4_2_7P438
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.38 +1 -1
+ NTP_4_2_7P438
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.29 +6 -6
+ NTP_4_2_7P438
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.29 +2 -2
+ NTP_4_2_7P438
+
+ scripts/ntpsweep/ntpsweep.html@1.39 +1 -1
+ NTP_4_2_7P438
+
+ scripts/ntpsweep/ntpsweep.man.in@1.29 +6 -6
+ NTP_4_2_7P438
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P438
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.38 +1 -1
+ NTP_4_2_7P438
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.29 +6 -6
+ NTP_4_2_7P438
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.29 +2 -2
+ NTP_4_2_7P438
+
+ scripts/ntptrace/ntptrace.html@1.39 +1 -1
+ NTP_4_2_7P438
+
+ scripts/ntptrace/ntptrace.man.in@1.29 +6 -6
+ NTP_4_2_7P438
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P438
+
+ scripts/plot_summary.1plot_summaryman@1.40 +6 -6
+ NTP_4_2_7P438
+
+ scripts/plot_summary.1plot_summarymdoc@1.40 +2 -2
+ NTP_4_2_7P438
+
+ scripts/plot_summary.html@1.40 +1 -1
+ NTP_4_2_7P438
+
+ scripts/plot_summary.man.in@1.40 +6 -6
+ NTP_4_2_7P438
+
+ scripts/plot_summary.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P438
+
+ scripts/summary.1summaryman@1.40 +6 -6
+ NTP_4_2_7P438
+
+ scripts/summary.1summarymdoc@1.40 +2 -2
+ NTP_4_2_7P438
+
+ scripts/summary.html@1.40 +1 -1
+ NTP_4_2_7P438
+
+ scripts/summary.man.in@1.40 +6 -6
+ NTP_4_2_7P438
+
+ scripts/summary.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P438
+
+ sntp/invoke-sntp.texi@1.428 +2 -2
+ NTP_4_2_7P438
+
+ sntp/sntp-opts.c@1.443 +7 -7
+ NTP_4_2_7P438
+
+ sntp/sntp-opts.h@1.443 +3 -3
+ NTP_4_2_7P438
+
+ sntp/sntp.1sntpman@1.263 +6 -6
+ NTP_4_2_7P438
+
+ sntp/sntp.1sntpmdoc@1.263 +2 -2
+ NTP_4_2_7P438
+
+ sntp/sntp.html@1.443 +2 -2
+ NTP_4_2_7P438
+
+ sntp/sntp.man.in@1.263 +6 -6
+ NTP_4_2_7P438
+
+ sntp/sntp.mdoc.in@1.263 +2 -2
+ NTP_4_2_7P438
+
+ util/invoke-ntp-keygen.texi@1.432 +2 -2
+ NTP_4_2_7P438
+
+ util/ntp-keygen-opts.c@1.446 +7 -7
+ NTP_4_2_7P438
+
+ util/ntp-keygen-opts.h@1.446 +3 -3
+ NTP_4_2_7P438
+
+ util/ntp-keygen.1ntp-keygenman@1.260 +6 -6
+ NTP_4_2_7P438
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.260 +2 -2
+ NTP_4_2_7P438
+
+ util/ntp-keygen.html@1.108 +2 -2
+ NTP_4_2_7P438
+
+ util/ntp-keygen.man.in@1.260 +6 -6
+ NTP_4_2_7P438
+
+ util/ntp-keygen.mdoc.in@1.260 +2 -2
+ NTP_4_2_7P438
+
+ChangeSet@1.3107.1.32, 2014-04-01 02:26:13-04:00, stenn@deacon.udel.edu
+ Windows build documentation updates
+
+ ChangeLog@1.1466 +1 -0
+ Windows build documentation updates
+
+ html/hints/winnt.html@1.23 +6 -5
+ Windows build documentation updates
+
+ChangeSet@1.3107.1.31, 2014-03-31 10:52:43+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P437
+ TAG: NTP_4_2_7P437
+
+ ChangeLog@1.1465 +1 -0
+ NTP_4_2_7P437
+
+ ntpd/invoke-ntp.conf.texi@1.116 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/invoke-ntp.keys.texi@1.114 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/invoke-ntpd.texi@1.430 +2 -2
+ NTP_4_2_7P437
+
+ ntpd/ntp.conf.5man@1.150 +6 -6
+ NTP_4_2_7P437
+
+ ntpd/ntp.conf.5mdoc@1.150 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/ntp.conf.html@1.111 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/ntp.conf.man.in@1.150 +6 -6
+ NTP_4_2_7P437
+
+ ntpd/ntp.conf.mdoc.in@1.150 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/ntp.keys.5man@1.148 +2 -2
+ NTP_4_2_7P437
+
+ ntpd/ntp.keys.5mdoc@1.148 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/ntp.keys.html@1.112 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/ntp.keys.man.in@1.148 +2 -2
+ NTP_4_2_7P437
+
+ ntpd/ntp.keys.mdoc.in@1.148 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/ntpd-opts.c@1.448 +7 -7
+ NTP_4_2_7P437
+
+ ntpd/ntpd-opts.h@1.448 +3 -3
+ NTP_4_2_7P437
+
+ ntpd/ntpd.1ntpdman@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpd/ntpd.1ntpdmdoc@1.259 +1 -1
+ NTP_4_2_7P437
+
+ ntpd/ntpd.html@1.106 +4 -4
+ NTP_4_2_7P437
+
+ ntpd/ntpd.man.in@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpd/ntpd.mdoc.in@1.259 +1 -1
+ NTP_4_2_7P437
+
+ ntpdc/invoke-ntpdc.texi@1.428 +2 -2
+ NTP_4_2_7P437
+
+ ntpdc/ntpdc-opts.c@1.443 +7 -7
+ NTP_4_2_7P437
+
+ ntpdc/ntpdc-opts.h@1.443 +3 -3
+ NTP_4_2_7P437
+
+ ntpdc/ntpdc.1ntpdcman@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.259 +1 -1
+ NTP_4_2_7P437
+
+ ntpdc/ntpdc.html@1.272 +2 -2
+ NTP_4_2_7P437
+
+ ntpdc/ntpdc.man.in@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpdc/ntpdc.mdoc.in@1.259 +1 -1
+ NTP_4_2_7P437
+
+ ntpq/invoke-ntpq.texi@1.431 +2 -2
+ NTP_4_2_7P437
+
+ ntpq/ntpq-opts.c@1.445 +7 -7
+ NTP_4_2_7P437
+
+ ntpq/ntpq-opts.h@1.445 +3 -3
+ NTP_4_2_7P437
+
+ ntpq/ntpq.1ntpqman@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpq/ntpq.1ntpqmdoc@1.259 +1 -1
+ NTP_4_2_7P437
+
+ ntpq/ntpq.html@1.103 +2 -2
+ NTP_4_2_7P437
+
+ ntpq/ntpq.man.in@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpq/ntpq.mdoc.in@1.259 +1 -1
+ NTP_4_2_7P437
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.430 +2 -2
+ NTP_4_2_7P437
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.445 +7 -7
+ NTP_4_2_7P437
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.445 +3 -3
+ NTP_4_2_7P437
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.259 +1 -1
+ NTP_4_2_7P437
+
+ ntpsnmpd/ntpsnmpd.html@1.101 +1 -1
+ NTP_4_2_7P437
+
+ ntpsnmpd/ntpsnmpd.man.in@1.259 +6 -6
+ NTP_4_2_7P437
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.259 +1 -1
+ NTP_4_2_7P437
+
+ packageinfo.sh@1.441 +1 -1
+ NTP_4_2_7P437
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.21 +6 -6
+ NTP_4_2_7P437
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.21 +1 -1
+ NTP_4_2_7P437
+
+ scripts/calc_tickadj/calc_tickadj.html@1.20 +1 -1
+ NTP_4_2_7P437
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.20 +6 -6
+ NTP_4_2_7P437
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.21 +1 -1
+ NTP_4_2_7P437
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.22 +1 -1
+ NTP_4_2_7P437
+
+ scripts/invoke-plot_summary.texi@1.39 +1 -1
+ NTP_4_2_7P437
+
+ scripts/invoke-summary.texi@1.39 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.248 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.249 +6 -6
+ NTP_4_2_7P437
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.249 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntp-wait/ntp-wait.html@1.265 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntp-wait/ntp-wait.man.in@1.249 +6 -6
+ NTP_4_2_7P437
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.249 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.37 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.28 +6 -6
+ NTP_4_2_7P437
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.28 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntpsweep/ntpsweep.html@1.38 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntpsweep/ntpsweep.man.in@1.28 +6 -6
+ NTP_4_2_7P437
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.29 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.37 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.28 +6 -6
+ NTP_4_2_7P437
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.28 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntptrace/ntptrace.html@1.38 +1 -1
+ NTP_4_2_7P437
+
+ scripts/ntptrace/ntptrace.man.in@1.28 +6 -6
+ NTP_4_2_7P437
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.29 +1 -1
+ NTP_4_2_7P437
+
+ scripts/plot_summary.1plot_summaryman@1.39 +6 -6
+ NTP_4_2_7P437
+
+ scripts/plot_summary.1plot_summarymdoc@1.39 +1 -1
+ NTP_4_2_7P437
+
+ scripts/plot_summary.html@1.39 +1 -1
+ NTP_4_2_7P437
+
+ scripts/plot_summary.man.in@1.39 +6 -6
+ NTP_4_2_7P437
+
+ scripts/plot_summary.mdoc.in@1.39 +1 -1
+ NTP_4_2_7P437
+
+ scripts/summary.1summaryman@1.39 +6 -6
+ NTP_4_2_7P437
+
+ scripts/summary.1summarymdoc@1.39 +1 -1
+ NTP_4_2_7P437
+
+ scripts/summary.html@1.39 +1 -1
+ NTP_4_2_7P437
+
+ scripts/summary.man.in@1.39 +6 -6
+ NTP_4_2_7P437
+
+ scripts/summary.mdoc.in@1.39 +1 -1
+ NTP_4_2_7P437
+
+ sntp/invoke-sntp.texi@1.427 +2 -2
+ NTP_4_2_7P437
+
+ sntp/sntp-opts.c@1.442 +7 -7
+ NTP_4_2_7P437
+
+ sntp/sntp-opts.h@1.442 +3 -3
+ NTP_4_2_7P437
+
+ sntp/sntp.1sntpman@1.262 +6 -6
+ NTP_4_2_7P437
+
+ sntp/sntp.1sntpmdoc@1.262 +1 -1
+ NTP_4_2_7P437
+
+ sntp/sntp.html@1.442 +2 -2
+ NTP_4_2_7P437
+
+ sntp/sntp.man.in@1.262 +6 -6
+ NTP_4_2_7P437
+
+ sntp/sntp.mdoc.in@1.262 +1 -1
+ NTP_4_2_7P437
+
+ util/invoke-ntp-keygen.texi@1.431 +2 -2
+ NTP_4_2_7P437
+
+ util/ntp-keygen-opts.c@1.445 +7 -7
+ NTP_4_2_7P437
+
+ util/ntp-keygen-opts.h@1.445 +3 -3
+ NTP_4_2_7P437
+
+ util/ntp-keygen.1ntp-keygenman@1.259 +6 -6
+ NTP_4_2_7P437
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.259 +1 -1
+ NTP_4_2_7P437
+
+ util/ntp-keygen.html@1.107 +2 -2
+ NTP_4_2_7P437
+
+ util/ntp-keygen.man.in@1.259 +6 -6
+ NTP_4_2_7P437
+
+ util/ntp-keygen.mdoc.in@1.259 +1 -1
+ NTP_4_2_7P437
+
+ChangeSet@1.3107.1.30, 2014-03-31 04:06:33-04:00, stenn@deacon.udel.edu
+ [Bug 2537] ntpd truncates symmetric keys to 20 bytes
+
+ ChangeLog@1.1464 +1 -0
+ [Bug 2537] ntpd truncates symmetric keys to 20 bytes
+
+ libntp/authreadkeys.c@1.19 +2 -2
+ [Bug 2537] ntpd truncates symmetric keys to 20 bytes
+
+ChangeSet@1.3107.1.29, 2014-03-31 07:53:05+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2546] Documentation updates
+
+ ChangeLog@1.1463 +1 -0
+ [Bug 2546] Documentation updates
+
+ChangeSet@1.3107.3.1, 2014-03-31 07:50:34+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2546] Documentation updates
+
+ ChangeLog@1.1453.1.1 +1 -0
+ [Bug 2546] Documentation updates
+
+ html/build.html@1.26 +3 -3
+ [Bug 2546] Documentation updates
+
+ html/drivers/driver20.html@1.28 +5 -1
+ [Bug 2546] Documentation updates
+
+ html/drivers/driver22.html@1.21 +4 -3
+ [Bug 2546] Documentation updates
+
+ html/hints/winnt.html@1.22 +11 -109
+ [Bug 2546] Documentation updates
+
+ html/index.html@1.46 +3 -3
+ [Bug 2546] Documentation updates
+
+ChangeSet@1.3107.1.27, 2014-03-31 06:48:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P436
+ TAG: NTP_4_2_7P436
+
+ ChangeLog@1.1461 +1 -0
+ NTP_4_2_7P436
+
+ ntpd/invoke-ntp.conf.texi@1.115 +1 -1
+ NTP_4_2_7P436
+
+ ntpd/invoke-ntp.keys.texi@1.113 +1 -1
+ NTP_4_2_7P436
+
+ ntpd/invoke-ntpd.texi@1.429 +4 -4
+ NTP_4_2_7P436
+
+ ntpd/ntp.conf.5man@1.149 +32 -3
+ NTP_4_2_7P436
+
+ ntpd/ntp.conf.5mdoc@1.149 +20 -1
+ NTP_4_2_7P436
+
+ ntpd/ntp.conf.html@1.110 +91 -104
+ NTP_4_2_7P436
+
+ ntpd/ntp.conf.man.in@1.149 +32 -3
+ NTP_4_2_7P436
+
+ ntpd/ntp.conf.mdoc.in@1.149 +20 -1
+ NTP_4_2_7P436
+
+ ntpd/ntp.keys.5man@1.147 +21 -2
+ NTP_4_2_7P436
+
+ ntpd/ntp.keys.5mdoc@1.147 +21 -2
+ NTP_4_2_7P436
+
+ ntpd/ntp.keys.html@1.111 +17 -29
+ NTP_4_2_7P436
+
+ ntpd/ntp.keys.man.in@1.147 +21 -2
+ NTP_4_2_7P436
+
+ ntpd/ntp.keys.mdoc.in@1.147 +21 -2
+ NTP_4_2_7P436
+
+ ntpd/ntpd-opts.c@1.447 +7 -7
+ NTP_4_2_7P436
+
+ ntpd/ntpd-opts.h@1.447 +3 -3
+ NTP_4_2_7P436
+
+ ntpd/ntpd.1ntpdman@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpd/ntpd.1ntpdmdoc@1.258 +20 -1
+ NTP_4_2_7P436
+
+ ntpd/ntpd.html@1.105 +100 -142
+ NTP_4_2_7P436
+
+ ntpd/ntpd.man.in@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpd/ntpd.mdoc.in@1.258 +20 -1
+ NTP_4_2_7P436
+
+ ntpdc/invoke-ntpdc.texi@1.427 +2 -2
+ NTP_4_2_7P436
+
+ ntpdc/ntpdc-opts.c@1.442 +7 -7
+ NTP_4_2_7P436
+
+ ntpdc/ntpdc-opts.h@1.442 +3 -3
+ NTP_4_2_7P436
+
+ ntpdc/ntpdc.1ntpdcman@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.258 +20 -1
+ NTP_4_2_7P436
+
+ ntpdc/ntpdc.html@1.271 +57 -77
+ NTP_4_2_7P436
+
+ ntpdc/ntpdc.man.in@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpdc/ntpdc.mdoc.in@1.258 +20 -1
+ NTP_4_2_7P436
+
+ ntpq/invoke-ntpq.texi@1.430 +2 -2
+ NTP_4_2_7P436
+
+ ntpq/ntpq-opts.c@1.444 +7 -7
+ NTP_4_2_7P436
+
+ ntpq/ntpq-opts.h@1.444 +3 -3
+ NTP_4_2_7P436
+
+ ntpq/ntpq.1ntpqman@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpq/ntpq.1ntpqmdoc@1.258 +20 -1
+ NTP_4_2_7P436
+
+ ntpq/ntpq.html@1.102 +97 -119
+ NTP_4_2_7P436
+
+ ntpq/ntpq.man.in@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpq/ntpq.mdoc.in@1.258 +20 -1
+ NTP_4_2_7P436
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.429 +2 -2
+ NTP_4_2_7P436
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.444 +7 -7
+ NTP_4_2_7P436
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.444 +3 -3
+ NTP_4_2_7P436
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.258 +20 -1
+ NTP_4_2_7P436
+
+ ntpsnmpd/ntpsnmpd.html@1.100 +10 -14
+ NTP_4_2_7P436
+
+ ntpsnmpd/ntpsnmpd.man.in@1.258 +32 -3
+ NTP_4_2_7P436
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.258 +20 -1
+ NTP_4_2_7P436
+
+ packageinfo.sh@1.440 +1 -1
+ NTP_4_2_7P436
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.20 +32 -3
+ NTP_4_2_7P436
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.20 +20 -1
+ NTP_4_2_7P436
+
+ scripts/calc_tickadj/calc_tickadj.html@1.19 +22 -34
+ NTP_4_2_7P436
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.19 +32 -3
+ NTP_4_2_7P436
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.20 +20 -1
+ NTP_4_2_7P436
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.21 +1 -1
+ NTP_4_2_7P436
+
+ scripts/invoke-plot_summary.texi@1.38 +1 -1
+ NTP_4_2_7P436
+
+ scripts/invoke-summary.texi@1.38 +1 -1
+ NTP_4_2_7P436
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.247 +1 -1
+ NTP_4_2_7P436
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.248 +32 -3
+ NTP_4_2_7P436
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.248 +20 -1
+ NTP_4_2_7P436
+
+ scripts/ntp-wait/ntp-wait.html@1.264 +30 -48
+ NTP_4_2_7P436
+
+ scripts/ntp-wait/ntp-wait.man.in@1.248 +32 -3
+ NTP_4_2_7P436
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.248 +20 -1
+ NTP_4_2_7P436
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.36 +1 -1
+ NTP_4_2_7P436
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.27 +32 -3
+ NTP_4_2_7P436
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.27 +20 -1
+ NTP_4_2_7P436
+
+ scripts/ntpsweep/ntpsweep.html@1.37 +32 -43
+ NTP_4_2_7P436
+
+ scripts/ntpsweep/ntpsweep.man.in@1.27 +32 -3
+ NTP_4_2_7P436
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.28 +20 -1
+ NTP_4_2_7P436
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.36 +1 -1
+ NTP_4_2_7P436
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.27 +32 -3
+ NTP_4_2_7P436
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.27 +20 -1
+ NTP_4_2_7P436
+
+ scripts/ntptrace/ntptrace.html@1.37 +26 -35
+ NTP_4_2_7P436
+
+ scripts/ntptrace/ntptrace.man.in@1.27 +32 -3
+ NTP_4_2_7P436
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.28 +20 -1
+ NTP_4_2_7P436
+
+ scripts/plot_summary.1plot_summaryman@1.38 +33 -3
+ NTP_4_2_7P436
+
+ scripts/plot_summary.1plot_summarymdoc@1.38 +21 -1
+ NTP_4_2_7P436
+
+ scripts/plot_summary.html@1.38 +28 -46
+ NTP_4_2_7P436
+
+ scripts/plot_summary.man.in@1.38 +33 -3
+ NTP_4_2_7P436
+
+ scripts/plot_summary.mdoc.in@1.38 +21 -1
+ NTP_4_2_7P436
+
+ scripts/summary.1summaryman@1.38 +32 -3
+ NTP_4_2_7P436
+
+ scripts/summary.1summarymdoc@1.38 +20 -1
+ NTP_4_2_7P436
+
+ scripts/summary.html@1.38 +26 -38
+ NTP_4_2_7P436
+
+ scripts/summary.man.in@1.38 +32 -3
+ NTP_4_2_7P436
+
+ scripts/summary.mdoc.in@1.38 +20 -1
+ NTP_4_2_7P436
+
+ sntp/invoke-sntp.texi@1.426 +2 -2
+ NTP_4_2_7P436
+
+ sntp/sntp-opts.c@1.441 +7 -7
+ NTP_4_2_7P436
+
+ sntp/sntp-opts.h@1.441 +3 -3
+ NTP_4_2_7P436
+
+ sntp/sntp.1sntpman@1.261 +32 -3
+ NTP_4_2_7P436
+
+ sntp/sntp.1sntpmdoc@1.261 +20 -1
+ NTP_4_2_7P436
+
+ sntp/sntp.html@1.441 +85 -109
+ NTP_4_2_7P436
+
+ sntp/sntp.man.in@1.261 +32 -3
+ NTP_4_2_7P436
+
+ sntp/sntp.mdoc.in@1.261 +20 -1
+ NTP_4_2_7P436
+
+ util/invoke-ntp-keygen.texi@1.430 +2 -2
+ NTP_4_2_7P436
+
+ util/ntp-keygen-opts.c@1.444 +7 -7
+ NTP_4_2_7P436
+
+ util/ntp-keygen-opts.h@1.444 +3 -3
+ NTP_4_2_7P436
+
+ util/ntp-keygen.1ntp-keygenman@1.258 +32 -3
+ NTP_4_2_7P436
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.258 +20 -1
+ NTP_4_2_7P436
+
+ util/ntp-keygen.html@1.106 +124 -183
+ NTP_4_2_7P436
+
+ util/ntp-keygen.man.in@1.258 +32 -3
+ NTP_4_2_7P436
+
+ util/ntp-keygen.mdoc.in@1.258 +20 -1
+ NTP_4_2_7P436
+
+ChangeSet@1.3107.1.26, 2014-03-31 04:52:47+00:00, stenn@psp-fb1.ntp.org
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ChangeLog@1.1460 +4 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/invoke-ntp.conf.texi@1.114 +1 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/invoke-ntp.keys.texi@1.112 +1 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/invoke-ntpd.texi@1.428 +3 -3
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.conf.5man@1.148 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.conf.5mdoc@1.148 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.conf.def@1.12 +0 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.conf.html@1.109 +104 -92
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.conf.man.in@1.148 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.conf.mdoc.in@1.148 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.keys.5man@1.146 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.keys.5mdoc@1.146 +3 -23
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.keys.def@1.10 +0 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.keys.html@1.110 +29 -18
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.keys.man.in@1.146 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntp.keys.mdoc.in@1.146 +3 -23
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd-opts.c@1.446 +6 -6
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd-opts.def@1.11 +0 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd-opts.h@1.446 +8 -3
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd.1ntpdman@1.257 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd.1ntpdmdoc@1.257 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd.html@1.104 +143 -101
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd.man.in@1.257 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpd.mdoc.in@1.257 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpdsim-opts.c@1.23 +196 -195
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpd/ntpdsim-opts.h@1.23 +16 -11
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/invoke-ntpdc.texi@1.426 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/ntpdc-opts.c@1.441 +6 -6
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/ntpdc-opts.h@1.441 +8 -3
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/ntpdc.1ntpdcman@1.257 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.257 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/ntpdc.html@1.270 +75 -55
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/ntpdc.man.in@1.257 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpdc/ntpdc.mdoc.in@1.257 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/invoke-ntpq.texi@1.429 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/ntpq-opts.c@1.443 +6 -6
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/ntpq-opts.h@1.443 +8 -3
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/ntpq.1ntpqman@1.257 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/ntpq.1ntpqmdoc@1.257 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/ntpq.html@1.101 +118 -96
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/ntpq.man.in@1.257 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpq/ntpq.mdoc.in@1.257 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.428 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.443 +6 -6
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.10 +0 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.443 +8 -3
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.257 +3 -36
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.257 +2 -23
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd.html@1.99 +13 -9
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd.man.in@1.257 +3 -36
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.257 +2 -23
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.3 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.19 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.19 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/calc_tickadj/calc_tickadj.html@1.18 +34 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.18 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.19 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.20 +2 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/invoke-plot_summary.texi@1.37 +2 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/invoke-summary.texi@1.37 +2 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.246 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.247 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.247 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntp-wait/ntp-wait.html@1.263 +47 -29
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntp-wait/ntp-wait.man.in@1.247 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.247 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.35 +2 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntpsweep/ntpsweep-opts@1.3 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.26 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.26 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntpsweep/ntpsweep.html@1.36 +43 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntpsweep/ntpsweep.man.in@1.26 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.27 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.35 +2 -2
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntptrace/ntptrace-opts@1.3 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.26 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.26 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntptrace/ntptrace.html@1.36 +35 -26
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntptrace/ntptrace.man.in@1.26 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.27 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/plot_summary-opts@1.3 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/plot_summary.1plot_summaryman@1.37 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/plot_summary.1plot_summarymdoc@1.37 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/plot_summary.html@1.37 +46 -28
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/plot_summary.man.in@1.37 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/plot_summary.mdoc.in@1.37 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/summary-opts@1.3 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/summary.1summaryman@1.37 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/summary.1summarymdoc@1.37 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/summary.html@1.37 +38 -26
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/summary.man.in@1.37 +3 -32
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ scripts/summary.mdoc.in@1.37 +2 -21
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/ag-tpl/perlopt.tpl@1.3 +66 -55
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/include/autogen-version.def@1.20 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/include/copyright.def@1.23 +8 -4
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/invoke-sntp.texi@1.425 +1 -4
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp-opts.c@1.440 +6 -6
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp-opts.def@1.43 +0 -9
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp-opts.h@1.440 +8 -3
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp.1sntpman@1.260 +4 -38
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp.1sntpmdoc@1.260 +3 -25
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp.html@1.440 +104 -91
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp.man.in@1.260 +4 -38
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ sntp/sntp.mdoc.in@1.260 +3 -25
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/invoke-ntp-keygen.texi@1.429 +1 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen-opts.c@1.443 +6 -6
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen-opts.def@1.26 +0 -1
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen-opts.h@1.443 +8 -3
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen.1ntp-keygenman@1.257 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.257 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen.html@1.105 +182 -123
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen.man.in@1.257 +3 -33
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ util/ntp-keygen.mdoc.in@1.257 +2 -22
+ * Update to libopts-40.2.15, and autogen-5.18.3pre18.
+ * [Bug 2311] Add more tags to mdoc2xxx.
+ * [Bug 2502] Assorted text replacement errors in 4.2.7p345
+ * [Bug 2538] ntp programs print exit code as part of the "usage" text.
+
+ChangeSet@1.3107.1.25, 2014-03-29 23:11:12+00:00, stenn@psp-fb1.ntp.org
+ Update to libopts-40.2.15
+
+ ChangeLog@1.1459 +1 -0
+ Update to libopts-40.2.15
+
+ sntp/libopts/COPYING.gplv3@1.7 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/COPYING.lgplv3@1.7 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/Makefile.am@1.24 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/README@1.9 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/ag-char-map.h@1.27 +2 -2
+ Update to libopts-40.2.15
+
+ sntp/libopts/alias.c@1.7 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/ao-strs.c@1.13 +2 -2
+ Update to libopts-40.2.15
+
+ sntp/libopts/ao-strs.h@1.12 +2 -2
+ Update to libopts-40.2.15
+
+ sntp/libopts/autoopts.c@1.19 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/autoopts.h@1.17 +11 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/autoopts/options.h@1.26 +6 -6
+ Update to libopts-40.2.15
+
+ sntp/libopts/autoopts/project.h@1.7 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/autoopts/usage-txt.h@1.26 +7 -7
+ Update to libopts-40.2.15
+
+ sntp/libopts/boolean.c@1.14 +14 -19
+ Update to libopts-40.2.15
+
+ sntp/libopts/check.c@1.7 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/compat/compat.h@1.15 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/compat/windows-config.h@1.13 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/configfile.c@1.21 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/cook.c@1.14 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/enum.c@1.10 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/env.c@1.8 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/file.c@1.14 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/find.c@1.10 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/genshell.c@1.27 +9 -9
+ Update to libopts-40.2.15
+
+ sntp/libopts/genshell.h@1.27 +9 -4
+ Update to libopts-40.2.15
+
+ sntp/libopts/gettext.h@1.3 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/init.c@1.6 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/load.c@1.19 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/m4/libopts.m4@1.30 +5 -5
+ Update to libopts-40.2.15
+
+ sntp/libopts/m4/liboptschk.m4@1.12 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/makeshell.c@1.17 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/nested.c@1.14 +75 -52
+ Update to libopts-40.2.15
+
+ sntp/libopts/numeric.c@1.13 +8 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/option-value-type.c@1.14 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/option-value-type.h@1.28 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/option-xat-attribute.c@1.14 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/option-xat-attribute.h@1.28 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/parse-duration.c@1.11 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/parse-duration.h@1.9 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/pgusage.c@1.16 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/proto.h@1.27 +2 -2
+ Update to libopts-40.2.15
+
+ sntp/libopts/putshell.c@1.14 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/reset.c@1.15 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/restore.c@1.13 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/save.c@1.16 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/sort.c@1.13 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/stack.c@1.15 +41 -46
+ Update to libopts-40.2.15
+
+ sntp/libopts/streqvcmp.c@1.15 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/text_mmap.c@1.16 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/time.c@1.14 +32 -35
+ Update to libopts-40.2.15
+
+ sntp/libopts/tokenize.c@1.11 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/usage.c@1.19 +1 -1
+ Update to libopts-40.2.15
+
+ sntp/libopts/version.c@1.16 +1 -1
+ Update to libopts-40.2.15
+
+ChangeSet@1.3107.1.24, 2014-03-29 11:41:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P435
+ TAG: NTP_4_2_7P435
+
+ ChangeLog@1.1458 +1 -0
+ NTP_4_2_7P435
+
+ ntpd/invoke-ntp.conf.texi@1.113 +1 -1
+ NTP_4_2_7P435
+
+ ntpd/invoke-ntp.keys.texi@1.111 +1 -1
+ NTP_4_2_7P435
+
+ ntpd/invoke-ntpd.texi@1.427 +2 -2
+ NTP_4_2_7P435
+
+ ntpd/ntp.conf.5man@1.147 +7 -7
+ NTP_4_2_7P435
+
+ ntpd/ntp.conf.5mdoc@1.147 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntp.conf.html@1.108 +1 -1
+ NTP_4_2_7P435
+
+ ntpd/ntp.conf.man.in@1.147 +7 -7
+ NTP_4_2_7P435
+
+ ntpd/ntp.conf.mdoc.in@1.147 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntp.keys.5man@1.145 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntp.keys.5mdoc@1.145 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntp.keys.html@1.109 +1 -1
+ NTP_4_2_7P435
+
+ ntpd/ntp.keys.man.in@1.145 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntp.keys.mdoc.in@1.145 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntpd-opts.c@1.445 +7 -7
+ NTP_4_2_7P435
+
+ ntpd/ntpd-opts.h@1.445 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntpd.1ntpdman@1.256 +7 -7
+ NTP_4_2_7P435
+
+ ntpd/ntpd.1ntpdmdoc@1.256 +3 -3
+ NTP_4_2_7P435
+
+ ntpd/ntpd.html@1.103 +2 -2
+ NTP_4_2_7P435
+
+ ntpd/ntpd.man.in@1.256 +7 -7
+ NTP_4_2_7P435
+
+ ntpd/ntpd.mdoc.in@1.256 +3 -3
+ NTP_4_2_7P435
+
+ ntpdc/invoke-ntpdc.texi@1.425 +2 -2
+ NTP_4_2_7P435
+
+ ntpdc/ntpdc-opts.c@1.440 +7 -7
+ NTP_4_2_7P435
+
+ ntpdc/ntpdc-opts.h@1.440 +3 -3
+ NTP_4_2_7P435
+
+ ntpdc/ntpdc.1ntpdcman@1.256 +6 -6
+ NTP_4_2_7P435
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.256 +2 -2
+ NTP_4_2_7P435
+
+ ntpdc/ntpdc.html@1.269 +2 -2
+ NTP_4_2_7P435
+
+ ntpdc/ntpdc.man.in@1.256 +6 -6
+ NTP_4_2_7P435
+
+ ntpdc/ntpdc.mdoc.in@1.256 +2 -2
+ NTP_4_2_7P435
+
+ ntpq/invoke-ntpq.texi@1.428 +2 -2
+ NTP_4_2_7P435
+
+ ntpq/ntpq-opts.c@1.442 +7 -7
+ NTP_4_2_7P435
+
+ ntpq/ntpq-opts.h@1.442 +3 -3
+ NTP_4_2_7P435
+
+ ntpq/ntpq.1ntpqman@1.256 +6 -6
+ NTP_4_2_7P435
+
+ ntpq/ntpq.1ntpqmdoc@1.256 +2 -2
+ NTP_4_2_7P435
+
+ ntpq/ntpq.html@1.100 +2 -2
+ NTP_4_2_7P435
+
+ ntpq/ntpq.man.in@1.256 +6 -6
+ NTP_4_2_7P435
+
+ ntpq/ntpq.mdoc.in@1.256 +2 -2
+ NTP_4_2_7P435
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.427 +2 -2
+ NTP_4_2_7P435
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.442 +7 -7
+ NTP_4_2_7P435
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.442 +3 -3
+ NTP_4_2_7P435
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.256 +14 -14
+ NTP_4_2_7P435
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.256 +3 -3
+ NTP_4_2_7P435
+
+ ntpsnmpd/ntpsnmpd.html@1.98 +1 -1
+ NTP_4_2_7P435
+
+ ntpsnmpd/ntpsnmpd.man.in@1.256 +14 -14
+ NTP_4_2_7P435
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.256 +3 -3
+ NTP_4_2_7P435
+
+ packageinfo.sh@1.439 +1 -1
+ NTP_4_2_7P435
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.18 +6 -6
+ NTP_4_2_7P435
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.18 +2 -2
+ NTP_4_2_7P435
+
+ scripts/calc_tickadj/calc_tickadj.html@1.17 +82 -1
+ NTP_4_2_7P435
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.17 +6 -6
+ NTP_4_2_7P435
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P435
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.19 +60 -1
+ NTP_4_2_7P435
+
+ scripts/invoke-plot_summary.texi@1.36 +1 -1
+ NTP_4_2_7P435
+
+ scripts/invoke-summary.texi@1.36 +1 -1
+ NTP_4_2_7P435
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.245 +1 -1
+ NTP_4_2_7P435
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.246 +6 -6
+ NTP_4_2_7P435
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.246 +2 -2
+ NTP_4_2_7P435
+
+ scripts/ntp-wait/ntp-wait.html@1.262 +1 -1
+ NTP_4_2_7P435
+
+ scripts/ntp-wait/ntp-wait.man.in@1.246 +6 -6
+ NTP_4_2_7P435
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.246 +2 -2
+ NTP_4_2_7P435
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.34 +1 -1
+ NTP_4_2_7P435
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.25 +6 -6
+ NTP_4_2_7P435
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.25 +2 -2
+ NTP_4_2_7P435
+
+ scripts/ntpsweep/ntpsweep.html@1.35 +1 -1
+ NTP_4_2_7P435
+
+ scripts/ntpsweep/ntpsweep.man.in@1.25 +6 -6
+ NTP_4_2_7P435
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P435
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.34 +1 -1
+ NTP_4_2_7P435
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.25 +6 -6
+ NTP_4_2_7P435
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.25 +2 -2
+ NTP_4_2_7P435
+
+ scripts/ntptrace/ntptrace.html@1.35 +1 -1
+ NTP_4_2_7P435
+
+ scripts/ntptrace/ntptrace.man.in@1.25 +6 -6
+ NTP_4_2_7P435
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P435
+
+ scripts/plot_summary.1plot_summaryman@1.36 +6 -6
+ NTP_4_2_7P435
+
+ scripts/plot_summary.1plot_summarymdoc@1.36 +2 -2
+ NTP_4_2_7P435
+
+ scripts/plot_summary.html@1.36 +1 -1
+ NTP_4_2_7P435
+
+ scripts/plot_summary.man.in@1.36 +6 -6
+ NTP_4_2_7P435
+
+ scripts/plot_summary.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P435
+
+ scripts/summary.1summaryman@1.36 +13 -13
+ NTP_4_2_7P435
+
+ scripts/summary.1summarymdoc@1.36 +2 -2
+ NTP_4_2_7P435
+
+ scripts/summary.html@1.36 +1 -1
+ NTP_4_2_7P435
+
+ scripts/summary.man.in@1.36 +13 -13
+ NTP_4_2_7P435
+
+ scripts/summary.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P435
+
+ sntp/invoke-sntp.texi@1.424 +2 -2
+ NTP_4_2_7P435
+
+ sntp/sntp-opts.c@1.439 +7 -7
+ NTP_4_2_7P435
+
+ sntp/sntp-opts.h@1.439 +3 -3
+ NTP_4_2_7P435
+
+ sntp/sntp.1sntpman@1.259 +7 -7
+ NTP_4_2_7P435
+
+ sntp/sntp.1sntpmdoc@1.259 +3 -3
+ NTP_4_2_7P435
+
+ sntp/sntp.html@1.439 +2 -2
+ NTP_4_2_7P435
+
+ sntp/sntp.man.in@1.259 +7 -7
+ NTP_4_2_7P435
+
+ sntp/sntp.mdoc.in@1.259 +3 -3
+ NTP_4_2_7P435
+
+ util/invoke-ntp-keygen.texi@1.428 +2 -2
+ NTP_4_2_7P435
+
+ util/ntp-keygen-opts.c@1.442 +7 -7
+ NTP_4_2_7P435
+
+ util/ntp-keygen-opts.h@1.442 +3 -3
+ NTP_4_2_7P435
+
+ util/ntp-keygen.1ntp-keygenman@1.256 +7 -7
+ NTP_4_2_7P435
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.256 +3 -3
+ NTP_4_2_7P435
+
+ util/ntp-keygen.html@1.104 +2 -2
+ NTP_4_2_7P435
+
+ util/ntp-keygen.man.in@1.256 +7 -7
+ NTP_4_2_7P435
+
+ util/ntp-keygen.mdoc.in@1.256 +3 -3
+ NTP_4_2_7P435
+
+ChangeSet@1.3107.1.23, 2014-03-26 11:01:31+01:00, jnperlin@hydra.(none)
+ [Bug 2570] cleanup: reduced logging noise, moved some functions into libntp
+
+ ChangeLog@1.1457 +2 -0
+ [Bug 2570] cleanup: reduced logging noise, moved some functions into libntp
+
+ include/Makefile.am@1.50 +1 -0
+ [Bug 2570] cleanup: added 'vint64ops.h'
+
+ include/ntp_calendar.h@1.14 +12 -0
+ [Bug 2570] cleanup: moved functions for 64bit times to to calendar
+
+ include/vint64ops.h@1.1 +28 -0
+ [Bug 2570] cleanup: moved vint64 operations to libntp
+
+ include/vint64ops.h@1.0 +0 -0
+
+ libntp/Makefile.am@1.74 +1 -0
+ [Bug 2570] cleanup: added 'vint64ops.c'
+
+ libntp/ntp_calendar.c@1.13 +71 -23
+ [Bug 2570] cleanup: moved functions for 64bit times to to calendar
+
+ libntp/vint64ops.c@1.1 +284 -0
+ [Bug 2570] cleanup: moved vint64 operations to libntp
+
+ libntp/vint64ops.c@1.0 +0 -0
+
+ ntpd/ntp_leapsec.c@1.8 +44 -277
+ [Bug 2570] cleanup: reduced logging noise, moved some functions into libntp
+
+ ntpd/ntp_leapsec.h@1.6 +1 -6
+ [Bug 2570] cleanup: reduced logging noise, moved some functions into libntp
+
+ ntpd/ntp_util.c@1.110 +2 -10
+ [Bug 2570] cleanup: reduced logging noise
+
+ tests/libntp/Makefile.am@1.41 +1 -0
+ [Bug 2570] cleanup: added test cases for vint64 ops
+
+ tests/libntp/vi64ops.cpp@1.1 +64 -0
+ [Bug 2570] cleanup: added test cases for vint64 ops
+
+ tests/libntp/vi64ops.cpp@1.0 +0 -0
+
+ tests/ntpd/leapsec.cpp@1.8 +0 -42
+ [Bug 2570] cleanup: moved vint64 tests to libntp
+
+ChangeSet@1.3107.1.22, 2014-03-21 06:02:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P434
+ TAG: NTP_4_2_7P434
+
+ ChangeLog@1.1456 +1 -0
+ NTP_4_2_7P434
+
+ ntpd/invoke-ntp.conf.texi@1.112 +1 -1
+ NTP_4_2_7P434
+
+ ntpd/invoke-ntp.keys.texi@1.110 +1 -1
+ NTP_4_2_7P434
+
+ ntpd/invoke-ntpd.texi@1.426 +2 -2
+ NTP_4_2_7P434
+
+ ntpd/ntp.conf.5man@1.146 +7 -7
+ NTP_4_2_7P434
+
+ ntpd/ntp.conf.5mdoc@1.146 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntp.conf.html@1.107 +1 -1
+ NTP_4_2_7P434
+
+ ntpd/ntp.conf.man.in@1.146 +7 -7
+ NTP_4_2_7P434
+
+ ntpd/ntp.conf.mdoc.in@1.146 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntp.keys.5man@1.144 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntp.keys.5mdoc@1.144 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntp.keys.html@1.108 +1 -1
+ NTP_4_2_7P434
+
+ ntpd/ntp.keys.man.in@1.144 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntp.keys.mdoc.in@1.144 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntpd-opts.c@1.444 +7 -7
+ NTP_4_2_7P434
+
+ ntpd/ntpd-opts.h@1.444 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntpd.1ntpdman@1.255 +7 -7
+ NTP_4_2_7P434
+
+ ntpd/ntpd.1ntpdmdoc@1.255 +3 -3
+ NTP_4_2_7P434
+
+ ntpd/ntpd.html@1.102 +2 -2
+ NTP_4_2_7P434
+
+ ntpd/ntpd.man.in@1.255 +7 -7
+ NTP_4_2_7P434
+
+ ntpd/ntpd.mdoc.in@1.255 +3 -3
+ NTP_4_2_7P434
+
+ ntpdc/invoke-ntpdc.texi@1.424 +2 -2
+ NTP_4_2_7P434
+
+ ntpdc/ntpdc-opts.c@1.439 +7 -7
+ NTP_4_2_7P434
+
+ ntpdc/ntpdc-opts.h@1.439 +3 -3
+ NTP_4_2_7P434
+
+ ntpdc/ntpdc.1ntpdcman@1.255 +6 -6
+ NTP_4_2_7P434
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.255 +2 -2
+ NTP_4_2_7P434
+
+ ntpdc/ntpdc.html@1.268 +2 -2
+ NTP_4_2_7P434
+
+ ntpdc/ntpdc.man.in@1.255 +6 -6
+ NTP_4_2_7P434
+
+ ntpdc/ntpdc.mdoc.in@1.255 +2 -2
+ NTP_4_2_7P434
+
+ ntpq/invoke-ntpq.texi@1.427 +2 -2
+ NTP_4_2_7P434
+
+ ntpq/ntpq-opts.c@1.441 +7 -7
+ NTP_4_2_7P434
+
+ ntpq/ntpq-opts.h@1.441 +3 -3
+ NTP_4_2_7P434
+
+ ntpq/ntpq.1ntpqman@1.255 +6 -6
+ NTP_4_2_7P434
+
+ ntpq/ntpq.1ntpqmdoc@1.255 +2 -2
+ NTP_4_2_7P434
+
+ ntpq/ntpq.html@1.99 +2 -2
+ NTP_4_2_7P434
+
+ ntpq/ntpq.man.in@1.255 +6 -6
+ NTP_4_2_7P434
+
+ ntpq/ntpq.mdoc.in@1.255 +2 -2
+ NTP_4_2_7P434
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.426 +2 -2
+ NTP_4_2_7P434
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.441 +7 -7
+ NTP_4_2_7P434
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.441 +3 -3
+ NTP_4_2_7P434
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.255 +7 -7
+ NTP_4_2_7P434
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.255 +3 -3
+ NTP_4_2_7P434
+
+ ntpsnmpd/ntpsnmpd.html@1.97 +1 -1
+ NTP_4_2_7P434
+
+ ntpsnmpd/ntpsnmpd.man.in@1.255 +7 -7
+ NTP_4_2_7P434
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.255 +3 -3
+ NTP_4_2_7P434
+
+ packageinfo.sh@1.438 +1 -1
+ NTP_4_2_7P434
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.17 +6 -6
+ NTP_4_2_7P434
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.17 +2 -2
+ NTP_4_2_7P434
+
+ scripts/calc_tickadj/calc_tickadj.html@1.16 +1 -82
+ NTP_4_2_7P434
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.16 +6 -6
+ NTP_4_2_7P434
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P434
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.18 +1 -60
+ NTP_4_2_7P434
+
+ scripts/invoke-plot_summary.texi@1.35 +1 -1
+ NTP_4_2_7P434
+
+ scripts/invoke-summary.texi@1.35 +1 -1
+ NTP_4_2_7P434
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.244 +1 -1
+ NTP_4_2_7P434
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.245 +6 -6
+ NTP_4_2_7P434
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.245 +2 -2
+ NTP_4_2_7P434
+
+ scripts/ntp-wait/ntp-wait.html@1.261 +1 -1
+ NTP_4_2_7P434
+
+ scripts/ntp-wait/ntp-wait.man.in@1.245 +6 -6
+ NTP_4_2_7P434
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.245 +2 -2
+ NTP_4_2_7P434
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.33 +1 -1
+ NTP_4_2_7P434
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.24 +6 -6
+ NTP_4_2_7P434
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.24 +2 -2
+ NTP_4_2_7P434
+
+ scripts/ntpsweep/ntpsweep.html@1.34 +1 -1
+ NTP_4_2_7P434
+
+ scripts/ntpsweep/ntpsweep.man.in@1.24 +6 -6
+ NTP_4_2_7P434
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P434
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.33 +1 -1
+ NTP_4_2_7P434
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.24 +6 -6
+ NTP_4_2_7P434
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.24 +2 -2
+ NTP_4_2_7P434
+
+ scripts/ntptrace/ntptrace.html@1.34 +1 -1
+ NTP_4_2_7P434
+
+ scripts/ntptrace/ntptrace.man.in@1.24 +6 -6
+ NTP_4_2_7P434
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P434
+
+ scripts/plot_summary.1plot_summaryman@1.35 +13 -13
+ NTP_4_2_7P434
+
+ scripts/plot_summary.1plot_summarymdoc@1.35 +2 -2
+ NTP_4_2_7P434
+
+ scripts/plot_summary.html@1.35 +1 -1
+ NTP_4_2_7P434
+
+ scripts/plot_summary.man.in@1.35 +13 -13
+ NTP_4_2_7P434
+
+ scripts/plot_summary.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P434
+
+ scripts/summary.1summaryman@1.35 +13 -13
+ NTP_4_2_7P434
+
+ scripts/summary.1summarymdoc@1.35 +2 -2
+ NTP_4_2_7P434
+
+ scripts/summary.html@1.35 +1 -1
+ NTP_4_2_7P434
+
+ scripts/summary.man.in@1.35 +13 -13
+ NTP_4_2_7P434
+
+ scripts/summary.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P434
+
+ sntp/invoke-sntp.texi@1.423 +2 -2
+ NTP_4_2_7P434
+
+ sntp/sntp-opts.c@1.438 +7 -7
+ NTP_4_2_7P434
+
+ sntp/sntp-opts.h@1.438 +3 -3
+ NTP_4_2_7P434
+
+ sntp/sntp.1sntpman@1.258 +7 -7
+ NTP_4_2_7P434
+
+ sntp/sntp.1sntpmdoc@1.258 +3 -3
+ NTP_4_2_7P434
+
+ sntp/sntp.html@1.438 +2 -2
+ NTP_4_2_7P434
+
+ sntp/sntp.man.in@1.258 +7 -7
+ NTP_4_2_7P434
+
+ sntp/sntp.mdoc.in@1.258 +3 -3
+ NTP_4_2_7P434
+
+ util/invoke-ntp-keygen.texi@1.427 +2 -2
+ NTP_4_2_7P434
+
+ util/ntp-keygen-opts.c@1.441 +7 -7
+ NTP_4_2_7P434
+
+ util/ntp-keygen-opts.h@1.441 +3 -3
+ NTP_4_2_7P434
+
+ util/ntp-keygen.1ntp-keygenman@1.255 +7 -7
+ NTP_4_2_7P434
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.255 +3 -3
+ NTP_4_2_7P434
+
+ util/ntp-keygen.html@1.103 +2 -2
+ NTP_4_2_7P434
+
+ util/ntp-keygen.man.in@1.255 +7 -7
+ NTP_4_2_7P434
+
+ util/ntp-keygen.mdoc.in@1.255 +3 -3
+ NTP_4_2_7P434
+
+ChangeSet@1.3107.1.21, 2014-03-20 05:43:19-04:00, stenn@deacon.udel.edu
+ [Bug 2577] Update VS2013 solution and project files
+
+ ChangeLog@1.1455 +1 -0
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/instsrv/instsrv.vcxproj@1.2 +375 -6
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj@1.3 +295 -0
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.2 +6 -0
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj@1.2 +313 -6
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj@1.3 +401 -4
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/ntp.sln@1.2 +59 -1
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.3 +281 -0
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.3 +451 -9
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcxproj@1.3 +393 -3
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcxproj@1.3 +407 -4
+ [Bug 2577] Update VS2013 solution and project files
+
+ ports/winnt/vs2013/ntpq/ntpq.vcxproj@1.3 +395 -4
+ [Bug 2577] Update VS2013 solution and project files
+
+ChangeSet@1.3107.1.20, 2014-03-10 11:23:57+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P433
+ TAG: NTP_4_2_7P433
+
+ ChangeLog@1.1454 +1 -0
+ NTP_4_2_7P433
+
+ ntpd/invoke-ntp.conf.texi@1.111 +1 -1
+ NTP_4_2_7P433
+
+ ntpd/invoke-ntp.keys.texi@1.109 +1 -1
+ NTP_4_2_7P433
+
+ ntpd/invoke-ntpd.texi@1.425 +2 -2
+ NTP_4_2_7P433
+
+ ntpd/ntp.conf.5man@1.145 +7 -7
+ NTP_4_2_7P433
+
+ ntpd/ntp.conf.5mdoc@1.145 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntp.conf.html@1.106 +1 -1
+ NTP_4_2_7P433
+
+ ntpd/ntp.conf.man.in@1.145 +7 -7
+ NTP_4_2_7P433
+
+ ntpd/ntp.conf.mdoc.in@1.145 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntp.keys.5man@1.143 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntp.keys.5mdoc@1.143 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntp.keys.html@1.107 +1 -1
+ NTP_4_2_7P433
+
+ ntpd/ntp.keys.man.in@1.143 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntp.keys.mdoc.in@1.143 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntpd-opts.c@1.443 +7 -7
+ NTP_4_2_7P433
+
+ ntpd/ntpd-opts.h@1.443 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntpd.1ntpdman@1.254 +7 -7
+ NTP_4_2_7P433
+
+ ntpd/ntpd.1ntpdmdoc@1.254 +3 -3
+ NTP_4_2_7P433
+
+ ntpd/ntpd.html@1.101 +2 -2
+ NTP_4_2_7P433
+
+ ntpd/ntpd.man.in@1.254 +7 -7
+ NTP_4_2_7P433
+
+ ntpd/ntpd.mdoc.in@1.254 +3 -3
+ NTP_4_2_7P433
+
+ ntpdc/invoke-ntpdc.texi@1.423 +2 -2
+ NTP_4_2_7P433
+
+ ntpdc/ntpdc-opts.c@1.438 +7 -7
+ NTP_4_2_7P433
+
+ ntpdc/ntpdc-opts.h@1.438 +3 -3
+ NTP_4_2_7P433
+
+ ntpdc/ntpdc.1ntpdcman@1.254 +6 -6
+ NTP_4_2_7P433
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.254 +2 -2
+ NTP_4_2_7P433
+
+ ntpdc/ntpdc.html@1.267 +2 -2
+ NTP_4_2_7P433
+
+ ntpdc/ntpdc.man.in@1.254 +6 -6
+ NTP_4_2_7P433
+
+ ntpdc/ntpdc.mdoc.in@1.254 +2 -2
+ NTP_4_2_7P433
+
+ ntpq/invoke-ntpq.texi@1.426 +2 -2
+ NTP_4_2_7P433
+
+ ntpq/ntpq-opts.c@1.440 +7 -7
+ NTP_4_2_7P433
+
+ ntpq/ntpq-opts.h@1.440 +3 -3
+ NTP_4_2_7P433
+
+ ntpq/ntpq.1ntpqman@1.254 +6 -6
+ NTP_4_2_7P433
+
+ ntpq/ntpq.1ntpqmdoc@1.254 +2 -2
+ NTP_4_2_7P433
+
+ ntpq/ntpq.html@1.98 +2 -2
+ NTP_4_2_7P433
+
+ ntpq/ntpq.man.in@1.254 +6 -6
+ NTP_4_2_7P433
+
+ ntpq/ntpq.mdoc.in@1.254 +2 -2
+ NTP_4_2_7P433
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.425 +2 -2
+ NTP_4_2_7P433
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.440 +7 -7
+ NTP_4_2_7P433
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.440 +3 -3
+ NTP_4_2_7P433
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.254 +7 -7
+ NTP_4_2_7P433
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.254 +3 -3
+ NTP_4_2_7P433
+
+ ntpsnmpd/ntpsnmpd.html@1.96 +1 -1
+ NTP_4_2_7P433
+
+ ntpsnmpd/ntpsnmpd.man.in@1.254 +7 -7
+ NTP_4_2_7P433
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.254 +3 -3
+ NTP_4_2_7P433
+
+ packageinfo.sh@1.437 +1 -1
+ NTP_4_2_7P433
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.16 +6 -6
+ NTP_4_2_7P433
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.16 +2 -2
+ NTP_4_2_7P433
+
+ scripts/calc_tickadj/calc_tickadj.html@1.15 +1 -1
+ NTP_4_2_7P433
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.15 +6 -6
+ NTP_4_2_7P433
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P433
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.17 +1 -1
+ NTP_4_2_7P433
+
+ scripts/invoke-plot_summary.texi@1.34 +1 -1
+ NTP_4_2_7P433
+
+ scripts/invoke-summary.texi@1.34 +1 -1
+ NTP_4_2_7P433
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.243 +1 -1
+ NTP_4_2_7P433
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.244 +13 -13
+ NTP_4_2_7P433
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.244 +2 -2
+ NTP_4_2_7P433
+
+ scripts/ntp-wait/ntp-wait.html@1.260 +1 -1
+ NTP_4_2_7P433
+
+ scripts/ntp-wait/ntp-wait.man.in@1.244 +13 -13
+ NTP_4_2_7P433
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.244 +2 -2
+ NTP_4_2_7P433
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.32 +1 -1
+ NTP_4_2_7P433
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.23 +6 -6
+ NTP_4_2_7P433
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.23 +2 -2
+ NTP_4_2_7P433
+
+ scripts/ntpsweep/ntpsweep.html@1.33 +1 -1
+ NTP_4_2_7P433
+
+ scripts/ntpsweep/ntpsweep.man.in@1.23 +6 -6
+ NTP_4_2_7P433
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P433
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.32 +1 -1
+ NTP_4_2_7P433
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.23 +6 -6
+ NTP_4_2_7P433
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.23 +2 -2
+ NTP_4_2_7P433
+
+ scripts/ntptrace/ntptrace.html@1.33 +1 -1
+ NTP_4_2_7P433
+
+ scripts/ntptrace/ntptrace.man.in@1.23 +6 -6
+ NTP_4_2_7P433
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P433
+
+ scripts/plot_summary.1plot_summaryman@1.34 +13 -13
+ NTP_4_2_7P433
+
+ scripts/plot_summary.1plot_summarymdoc@1.34 +2 -2
+ NTP_4_2_7P433
+
+ scripts/plot_summary.html@1.34 +1 -1
+ NTP_4_2_7P433
+
+ scripts/plot_summary.man.in@1.34 +13 -13
+ NTP_4_2_7P433
+
+ scripts/plot_summary.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P433
+
+ scripts/summary.1summaryman@1.34 +6 -6
+ NTP_4_2_7P433
+
+ scripts/summary.1summarymdoc@1.34 +2 -2
+ NTP_4_2_7P433
+
+ scripts/summary.html@1.34 +1 -1
+ NTP_4_2_7P433
+
+ scripts/summary.man.in@1.34 +6 -6
+ NTP_4_2_7P433
+
+ scripts/summary.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P433
+
+ sntp/invoke-sntp.texi@1.422 +2 -2
+ NTP_4_2_7P433
+
+ sntp/sntp-opts.c@1.437 +7 -7
+ NTP_4_2_7P433
+
+ sntp/sntp-opts.h@1.437 +3 -3
+ NTP_4_2_7P433
+
+ sntp/sntp.1sntpman@1.257 +7 -7
+ NTP_4_2_7P433
+
+ sntp/sntp.1sntpmdoc@1.257 +3 -3
+ NTP_4_2_7P433
+
+ sntp/sntp.html@1.437 +2 -2
+ NTP_4_2_7P433
+
+ sntp/sntp.man.in@1.257 +7 -7
+ NTP_4_2_7P433
+
+ sntp/sntp.mdoc.in@1.257 +3 -3
+ NTP_4_2_7P433
+
+ util/invoke-ntp-keygen.texi@1.426 +2 -2
+ NTP_4_2_7P433
+
+ util/ntp-keygen-opts.c@1.440 +7 -7
+ NTP_4_2_7P433
+
+ util/ntp-keygen-opts.h@1.440 +3 -3
+ NTP_4_2_7P433
+
+ util/ntp-keygen.1ntp-keygenman@1.254 +7 -7
+ NTP_4_2_7P433
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.254 +3 -3
+ NTP_4_2_7P433
+
+ util/ntp-keygen.html@1.102 +2 -2
+ NTP_4_2_7P433
+
+ util/ntp-keygen.man.in@1.254 +7 -7
+ NTP_4_2_7P433
+
+ util/ntp-keygen.mdoc.in@1.254 +3 -3
+ NTP_4_2_7P433
+
+ChangeSet@1.3107.1.19, 2014-03-10 05:31:40-04:00, stenn@deacon.udel.edu
+ Clean up last-update timestamps of html/*.html files
+
+ ChangeLog@1.1453 +1 -0
+ Clean up last-update timestamps of html/*.html files
+
+ html/confopt.html@1.61 +1 -1
+ Clean up last-update timestamps of html/*.html files
+
+ html/copyright.html@1.63 +5 -4
+ Clean up last-update timestamps of html/*.html files
+
+ html/discipline.html@1.9 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/discover.html@1.5 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/extern.html@1.16.1.1 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/filter.html@1.7 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/hints.html@1.19 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/history.html@1.3 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/howto.html@1.24 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/huffpuff.html@1.5 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/index.html@1.45 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/kern.html@1.21 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/kernpps.html@1.4 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/keygen.html@1.33 +2 -2
+ Clean up last-update timestamps of html/*.html files
+
+ html/leap.html@1.6 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/msyslog.html@1.11 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/ntpd.html@1.61 +1 -1
+ Clean up last-update timestamps of html/*.html files
+
+ html/poll.html@1.4 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/pps.html@1.25 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/prefer.html@1.32 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/rate.html@1.12 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/rdebug.html@1.18 +3 -5
+ Clean up last-update timestamps of html/*.html files
+
+ html/refclock.html@1.42 +1 -1
+ Clean up last-update timestamps of html/*.html files
+
+ html/select.html@1.9 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/stats.html@1.2 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/tickadj.html@1.18 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/warp.html@1.23 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ html/xleave.html@1.9 +3 -3
+ Clean up last-update timestamps of html/*.html files
+
+ChangeSet@1.3107.1.18, 2014-03-09 11:46:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P432
+ TAG: NTP_4_2_7P432
+
+ ChangeLog@1.1452 +1 -0
+ NTP_4_2_7P432
+
+ ntpd/invoke-ntp.conf.texi@1.110 +1 -1
+ NTP_4_2_7P432
+
+ ntpd/invoke-ntp.keys.texi@1.108 +1 -1
+ NTP_4_2_7P432
+
+ ntpd/invoke-ntpd.texi@1.424 +2 -2
+ NTP_4_2_7P432
+
+ ntpd/ntp.conf.5man@1.144 +7 -7
+ NTP_4_2_7P432
+
+ ntpd/ntp.conf.5mdoc@1.144 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntp.conf.html@1.105 +1 -1
+ NTP_4_2_7P432
+
+ ntpd/ntp.conf.man.in@1.144 +7 -7
+ NTP_4_2_7P432
+
+ ntpd/ntp.conf.mdoc.in@1.144 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntp.keys.5man@1.142 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntp.keys.5mdoc@1.142 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntp.keys.html@1.106 +1 -1
+ NTP_4_2_7P432
+
+ ntpd/ntp.keys.man.in@1.142 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntp.keys.mdoc.in@1.142 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntpd-opts.c@1.442 +7 -7
+ NTP_4_2_7P432
+
+ ntpd/ntpd-opts.h@1.442 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntpd.1ntpdman@1.253 +7 -7
+ NTP_4_2_7P432
+
+ ntpd/ntpd.1ntpdmdoc@1.253 +3 -3
+ NTP_4_2_7P432
+
+ ntpd/ntpd.html@1.100 +2 -2
+ NTP_4_2_7P432
+
+ ntpd/ntpd.man.in@1.253 +7 -7
+ NTP_4_2_7P432
+
+ ntpd/ntpd.mdoc.in@1.253 +3 -3
+ NTP_4_2_7P432
+
+ ntpdc/invoke-ntpdc.texi@1.422 +2 -2
+ NTP_4_2_7P432
+
+ ntpdc/ntpdc-opts.c@1.437 +7 -7
+ NTP_4_2_7P432
+
+ ntpdc/ntpdc-opts.h@1.437 +3 -3
+ NTP_4_2_7P432
+
+ ntpdc/ntpdc.1ntpdcman@1.253 +6 -6
+ NTP_4_2_7P432
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.253 +2 -2
+ NTP_4_2_7P432
+
+ ntpdc/ntpdc.html@1.266 +2 -2
+ NTP_4_2_7P432
+
+ ntpdc/ntpdc.man.in@1.253 +6 -6
+ NTP_4_2_7P432
+
+ ntpdc/ntpdc.mdoc.in@1.253 +2 -2
+ NTP_4_2_7P432
+
+ ntpq/invoke-ntpq.texi@1.425 +2 -2
+ NTP_4_2_7P432
+
+ ntpq/ntpq-opts.c@1.439 +7 -7
+ NTP_4_2_7P432
+
+ ntpq/ntpq-opts.h@1.439 +3 -3
+ NTP_4_2_7P432
+
+ ntpq/ntpq.1ntpqman@1.253 +6 -6
+ NTP_4_2_7P432
+
+ ntpq/ntpq.1ntpqmdoc@1.253 +2 -2
+ NTP_4_2_7P432
+
+ ntpq/ntpq.html@1.97 +2 -2
+ NTP_4_2_7P432
+
+ ntpq/ntpq.man.in@1.253 +6 -6
+ NTP_4_2_7P432
+
+ ntpq/ntpq.mdoc.in@1.253 +2 -2
+ NTP_4_2_7P432
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.424 +2 -2
+ NTP_4_2_7P432
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.439 +7 -7
+ NTP_4_2_7P432
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.439 +3 -3
+ NTP_4_2_7P432
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.253 +7 -7
+ NTP_4_2_7P432
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.253 +3 -3
+ NTP_4_2_7P432
+
+ ntpsnmpd/ntpsnmpd.html@1.95 +1 -1
+ NTP_4_2_7P432
+
+ ntpsnmpd/ntpsnmpd.man.in@1.253 +7 -7
+ NTP_4_2_7P432
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.253 +3 -3
+ NTP_4_2_7P432
+
+ packageinfo.sh@1.436 +1 -1
+ NTP_4_2_7P432
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.15 +13 -13
+ NTP_4_2_7P432
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.15 +2 -2
+ NTP_4_2_7P432
+
+ scripts/calc_tickadj/calc_tickadj.html@1.14 +1 -1
+ NTP_4_2_7P432
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.14 +13 -13
+ NTP_4_2_7P432
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P432
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.16 +1 -1
+ NTP_4_2_7P432
+
+ scripts/invoke-plot_summary.texi@1.33 +1 -1
+ NTP_4_2_7P432
+
+ scripts/invoke-summary.texi@1.33 +1 -1
+ NTP_4_2_7P432
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.242 +1 -1
+ NTP_4_2_7P432
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.243 +13 -13
+ NTP_4_2_7P432
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.243 +2 -2
+ NTP_4_2_7P432
+
+ scripts/ntp-wait/ntp-wait.html@1.259 +1 -1
+ NTP_4_2_7P432
+
+ scripts/ntp-wait/ntp-wait.man.in@1.243 +13 -13
+ NTP_4_2_7P432
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.243 +2 -2
+ NTP_4_2_7P432
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.31 +1 -1
+ NTP_4_2_7P432
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.22 +6 -6
+ NTP_4_2_7P432
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.22 +2 -2
+ NTP_4_2_7P432
+
+ scripts/ntpsweep/ntpsweep.html@1.32 +1 -1
+ NTP_4_2_7P432
+
+ scripts/ntpsweep/ntpsweep.man.in@1.22 +6 -6
+ NTP_4_2_7P432
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P432
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.31 +1 -1
+ NTP_4_2_7P432
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.22 +6 -6
+ NTP_4_2_7P432
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.22 +2 -2
+ NTP_4_2_7P432
+
+ scripts/ntptrace/ntptrace.html@1.32 +1 -1
+ NTP_4_2_7P432
+
+ scripts/ntptrace/ntptrace.man.in@1.22 +6 -6
+ NTP_4_2_7P432
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P432
+
+ scripts/plot_summary.1plot_summaryman@1.33 +6 -6
+ NTP_4_2_7P432
+
+ scripts/plot_summary.1plot_summarymdoc@1.33 +2 -2
+ NTP_4_2_7P432
+
+ scripts/plot_summary.html@1.33 +1 -1
+ NTP_4_2_7P432
+
+ scripts/plot_summary.man.in@1.33 +6 -6
+ NTP_4_2_7P432
+
+ scripts/plot_summary.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P432
+
+ scripts/summary.1summaryman@1.33 +6 -6
+ NTP_4_2_7P432
+
+ scripts/summary.1summarymdoc@1.33 +2 -2
+ NTP_4_2_7P432
+
+ scripts/summary.html@1.33 +1 -1
+ NTP_4_2_7P432
+
+ scripts/summary.man.in@1.33 +6 -6
+ NTP_4_2_7P432
+
+ scripts/summary.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P432
+
+ sntp/invoke-sntp.texi@1.421 +2 -2
+ NTP_4_2_7P432
+
+ sntp/sntp-opts.c@1.436 +7 -7
+ NTP_4_2_7P432
+
+ sntp/sntp-opts.h@1.436 +3 -3
+ NTP_4_2_7P432
+
+ sntp/sntp.1sntpman@1.256 +7 -7
+ NTP_4_2_7P432
+
+ sntp/sntp.1sntpmdoc@1.256 +3 -3
+ NTP_4_2_7P432
+
+ sntp/sntp.html@1.436 +2 -2
+ NTP_4_2_7P432
+
+ sntp/sntp.man.in@1.256 +7 -7
+ NTP_4_2_7P432
+
+ sntp/sntp.mdoc.in@1.256 +3 -3
+ NTP_4_2_7P432
+
+ util/invoke-ntp-keygen.texi@1.425 +2 -2
+ NTP_4_2_7P432
+
+ util/ntp-keygen-opts.c@1.439 +7 -7
+ NTP_4_2_7P432
+
+ util/ntp-keygen-opts.h@1.439 +3 -3
+ NTP_4_2_7P432
+
+ util/ntp-keygen.1ntp-keygenman@1.253 +7 -7
+ NTP_4_2_7P432
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.253 +3 -3
+ NTP_4_2_7P432
+
+ util/ntp-keygen.html@1.101 +2 -2
+ NTP_4_2_7P432
+
+ util/ntp-keygen.man.in@1.253 +7 -7
+ NTP_4_2_7P432
+
+ util/ntp-keygen.mdoc.in@1.253 +3 -3
+ NTP_4_2_7P432
+
+ChangeSet@1.3107.1.17, 2014-03-08 23:11:31-05:00, stenn@deacon.udel.edu
+ CID 711660: Do a non-NULL pointer assertion check a bit earlier
+
+ ChangeLog@1.1451 +1 -1
+ CID 711660: Do a non-NULL pointer assertion check a bit earlier
+
+ sntp/libevent/event.c@1.12 +1 -1
+ CID 711660: Do a non-NULL pointer assertion check a bit earlier
+
+ChangeSet@1.3107.1.16, 2014-03-05 11:18:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P431
+ TAG: NTP_4_2_7P431
+
+ ChangeLog@1.1450 +1 -0
+ NTP_4_2_7P431
+
+ ntpd/invoke-ntp.conf.texi@1.109 +1 -1
+ NTP_4_2_7P431
+
+ ntpd/invoke-ntp.keys.texi@1.107 +1 -1
+ NTP_4_2_7P431
+
+ ntpd/invoke-ntpd.texi@1.423 +2 -2
+ NTP_4_2_7P431
+
+ ntpd/ntp.conf.5man@1.143 +7 -7
+ NTP_4_2_7P431
+
+ ntpd/ntp.conf.5mdoc@1.143 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntp.conf.html@1.104 +1 -1
+ NTP_4_2_7P431
+
+ ntpd/ntp.conf.man.in@1.143 +7 -7
+ NTP_4_2_7P431
+
+ ntpd/ntp.conf.mdoc.in@1.143 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntp.keys.5man@1.141 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntp.keys.5mdoc@1.141 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntp.keys.html@1.105 +1 -1
+ NTP_4_2_7P431
+
+ ntpd/ntp.keys.man.in@1.141 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntp.keys.mdoc.in@1.141 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntpd-opts.c@1.441 +7 -7
+ NTP_4_2_7P431
+
+ ntpd/ntpd-opts.h@1.441 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntpd.1ntpdman@1.252 +7 -7
+ NTP_4_2_7P431
+
+ ntpd/ntpd.1ntpdmdoc@1.252 +3 -3
+ NTP_4_2_7P431
+
+ ntpd/ntpd.html@1.99 +2 -2
+ NTP_4_2_7P431
+
+ ntpd/ntpd.man.in@1.252 +7 -7
+ NTP_4_2_7P431
+
+ ntpd/ntpd.mdoc.in@1.252 +3 -3
+ NTP_4_2_7P431
+
+ ntpdc/invoke-ntpdc.texi@1.421 +2 -2
+ NTP_4_2_7P431
+
+ ntpdc/ntpdc-opts.c@1.436 +7 -7
+ NTP_4_2_7P431
+
+ ntpdc/ntpdc-opts.h@1.436 +3 -3
+ NTP_4_2_7P431
+
+ ntpdc/ntpdc.1ntpdcman@1.252 +6 -6
+ NTP_4_2_7P431
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.252 +2 -2
+ NTP_4_2_7P431
+
+ ntpdc/ntpdc.html@1.265 +2 -2
+ NTP_4_2_7P431
+
+ ntpdc/ntpdc.man.in@1.252 +6 -6
+ NTP_4_2_7P431
+
+ ntpdc/ntpdc.mdoc.in@1.252 +2 -2
+ NTP_4_2_7P431
+
+ ntpq/invoke-ntpq.texi@1.424 +2 -2
+ NTP_4_2_7P431
+
+ ntpq/ntpq-opts.c@1.438 +7 -7
+ NTP_4_2_7P431
+
+ ntpq/ntpq-opts.h@1.438 +3 -3
+ NTP_4_2_7P431
+
+ ntpq/ntpq.1ntpqman@1.252 +6 -6
+ NTP_4_2_7P431
+
+ ntpq/ntpq.1ntpqmdoc@1.252 +2 -2
+ NTP_4_2_7P431
+
+ ntpq/ntpq.html@1.96 +2 -2
+ NTP_4_2_7P431
+
+ ntpq/ntpq.man.in@1.252 +6 -6
+ NTP_4_2_7P431
+
+ ntpq/ntpq.mdoc.in@1.252 +2 -2
+ NTP_4_2_7P431
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.423 +2 -2
+ NTP_4_2_7P431
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.438 +7 -7
+ NTP_4_2_7P431
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.438 +3 -3
+ NTP_4_2_7P431
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.252 +7 -7
+ NTP_4_2_7P431
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.252 +3 -3
+ NTP_4_2_7P431
+
+ ntpsnmpd/ntpsnmpd.html@1.94 +1 -1
+ NTP_4_2_7P431
+
+ ntpsnmpd/ntpsnmpd.man.in@1.252 +7 -7
+ NTP_4_2_7P431
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.252 +3 -3
+ NTP_4_2_7P431
+
+ packageinfo.sh@1.435 +1 -1
+ NTP_4_2_7P431
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.14 +6 -6
+ NTP_4_2_7P431
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.14 +2 -2
+ NTP_4_2_7P431
+
+ scripts/calc_tickadj/calc_tickadj.html@1.13 +1 -1
+ NTP_4_2_7P431
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.13 +6 -6
+ NTP_4_2_7P431
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.14 +2 -2
+ NTP_4_2_7P431
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.15 +1 -1
+ NTP_4_2_7P431
+
+ scripts/invoke-plot_summary.texi@1.32 +1 -1
+ NTP_4_2_7P431
+
+ scripts/invoke-summary.texi@1.32 +1 -1
+ NTP_4_2_7P431
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.241 +1 -1
+ NTP_4_2_7P431
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.242 +6 -6
+ NTP_4_2_7P431
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.242 +2 -2
+ NTP_4_2_7P431
+
+ scripts/ntp-wait/ntp-wait.html@1.258 +1 -1
+ NTP_4_2_7P431
+
+ scripts/ntp-wait/ntp-wait.man.in@1.242 +6 -6
+ NTP_4_2_7P431
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.242 +2 -2
+ NTP_4_2_7P431
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.30 +1 -1
+ NTP_4_2_7P431
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.21 +6 -6
+ NTP_4_2_7P431
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.21 +2 -2
+ NTP_4_2_7P431
+
+ scripts/ntpsweep/ntpsweep.html@1.31 +1 -1
+ NTP_4_2_7P431
+
+ scripts/ntpsweep/ntpsweep.man.in@1.21 +6 -6
+ NTP_4_2_7P431
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P431
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.30 +1 -1
+ NTP_4_2_7P431
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.21 +13 -13
+ NTP_4_2_7P431
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.21 +2 -2
+ NTP_4_2_7P431
+
+ scripts/ntptrace/ntptrace.html@1.31 +1 -1
+ NTP_4_2_7P431
+
+ scripts/ntptrace/ntptrace.man.in@1.21 +13 -13
+ NTP_4_2_7P431
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P431
+
+ scripts/plot_summary.1plot_summaryman@1.32 +6 -6
+ NTP_4_2_7P431
+
+ scripts/plot_summary.1plot_summarymdoc@1.32 +3 -3
+ NTP_4_2_7P431
+
+ scripts/plot_summary.html@1.32 +1 -1
+ NTP_4_2_7P431
+
+ scripts/plot_summary.man.in@1.32 +6 -6
+ NTP_4_2_7P431
+
+ scripts/plot_summary.mdoc.in@1.32 +3 -3
+ NTP_4_2_7P431
+
+ scripts/summary.1summaryman@1.32 +6 -6
+ NTP_4_2_7P431
+
+ scripts/summary.1summarymdoc@1.32 +2 -2
+ NTP_4_2_7P431
+
+ scripts/summary.html@1.32 +1 -1
+ NTP_4_2_7P431
+
+ scripts/summary.man.in@1.32 +6 -6
+ NTP_4_2_7P431
+
+ scripts/summary.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P431
+
+ sntp/invoke-sntp.texi@1.420 +2 -2
+ NTP_4_2_7P431
+
+ sntp/sntp-opts.c@1.435 +7 -7
+ NTP_4_2_7P431
+
+ sntp/sntp-opts.h@1.435 +3 -3
+ NTP_4_2_7P431
+
+ sntp/sntp.1sntpman@1.255 +7 -7
+ NTP_4_2_7P431
+
+ sntp/sntp.1sntpmdoc@1.255 +3 -3
+ NTP_4_2_7P431
+
+ sntp/sntp.html@1.435 +2 -2
+ NTP_4_2_7P431
+
+ sntp/sntp.man.in@1.255 +7 -7
+ NTP_4_2_7P431
+
+ sntp/sntp.mdoc.in@1.255 +3 -3
+ NTP_4_2_7P431
+
+ util/invoke-ntp-keygen.texi@1.424 +2 -2
+ NTP_4_2_7P431
+
+ util/ntp-keygen-opts.c@1.438 +7 -7
+ NTP_4_2_7P431
+
+ util/ntp-keygen-opts.h@1.438 +3 -3
+ NTP_4_2_7P431
+
+ util/ntp-keygen.1ntp-keygenman@1.252 +7 -7
+ NTP_4_2_7P431
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.252 +3 -3
+ NTP_4_2_7P431
+
+ util/ntp-keygen.html@1.100 +2 -2
+ NTP_4_2_7P431
+
+ util/ntp-keygen.man.in@1.252 +7 -7
+ NTP_4_2_7P431
+
+ util/ntp-keygen.mdoc.in@1.252 +3 -3
+ NTP_4_2_7P431
+
+ChangeSet@1.3107.1.15, 2014-03-05 01:44:37-05:00, stenn@deacon.udel.edu
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ ChangeLog@1.1449 +1 -0
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ sntp/libevent/m4/openldap-thread-check.m4@1.4 +1 -1
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ChangeSet@1.3107.1.14, 2014-03-05 00:53:47-05:00, stenn@deacon.udel.edu
+ CID 711669: Do a non-NULL pointer assertion check a bit earlier
+
+ ChangeLog@1.1448 +1 -0
+ CID 711669: Do a non-NULL pointer assertion check a bit earlier
+
+ sntp/libevent/event.c@1.11 +1 -1
+ CID 711669: Do a non-NULL pointer assertion check a bit earlier
+
+ChangeSet@1.3107.1.13, 2014-03-04 11:54:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P430
+ TAG: NTP_4_2_7P430
+
+ ChangeLog@1.1447 +1 -0
+ NTP_4_2_7P430
+
+ ntpd/invoke-ntp.conf.texi@1.108 +1 -1
+ NTP_4_2_7P430
+
+ ntpd/invoke-ntp.keys.texi@1.106 +1 -1
+ NTP_4_2_7P430
+
+ ntpd/invoke-ntpd.texi@1.422 +2 -2
+ NTP_4_2_7P430
+
+ ntpd/ntp.conf.5man@1.142 +7 -7
+ NTP_4_2_7P430
+
+ ntpd/ntp.conf.5mdoc@1.142 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntp.conf.html@1.103 +1 -1
+ NTP_4_2_7P430
+
+ ntpd/ntp.conf.man.in@1.142 +7 -7
+ NTP_4_2_7P430
+
+ ntpd/ntp.conf.mdoc.in@1.142 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntp.keys.5man@1.140 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntp.keys.5mdoc@1.140 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntp.keys.html@1.104 +1 -1
+ NTP_4_2_7P430
+
+ ntpd/ntp.keys.man.in@1.140 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntp.keys.mdoc.in@1.140 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntpd-opts.c@1.440 +7 -7
+ NTP_4_2_7P430
+
+ ntpd/ntpd-opts.h@1.440 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntpd.1ntpdman@1.251 +1007 -0
+ NTP_4_2_7P430
+
+ ntpd/ntpd.1ntpdmdoc@1.251 +3 -3
+ NTP_4_2_7P430
+
+ ntpd/ntpd.html@1.98 +2 -2
+ NTP_4_2_7P430
+
+ ntpd/ntpd.man.in@1.251 +1007 -0
+ NTP_4_2_7P430
+
+ ntpd/ntpd.mdoc.in@1.251 +3 -3
+ NTP_4_2_7P430
+
+ ntpdc/invoke-ntpdc.texi@1.420 +2 -2
+ NTP_4_2_7P430
+
+ ntpdc/ntpdc-opts.c@1.435 +7 -7
+ NTP_4_2_7P430
+
+ ntpdc/ntpdc-opts.h@1.435 +3 -3
+ NTP_4_2_7P430
+
+ ntpdc/ntpdc.1ntpdcman@1.251 +6 -6
+ NTP_4_2_7P430
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.251 +2 -2
+ NTP_4_2_7P430
+
+ ntpdc/ntpdc.html@1.264 +2 -2
+ NTP_4_2_7P430
+
+ ntpdc/ntpdc.man.in@1.251 +6 -6
+ NTP_4_2_7P430
+
+ ntpdc/ntpdc.mdoc.in@1.251 +2 -2
+ NTP_4_2_7P430
+
+ ntpq/invoke-ntpq.texi@1.423 +2 -2
+ NTP_4_2_7P430
+
+ ntpq/ntpq-opts.c@1.437 +7 -7
+ NTP_4_2_7P430
+
+ ntpq/ntpq-opts.h@1.437 +3 -3
+ NTP_4_2_7P430
+
+ ntpq/ntpq.1ntpqman@1.251 +6 -6
+ NTP_4_2_7P430
+
+ ntpq/ntpq.1ntpqmdoc@1.251 +2 -2
+ NTP_4_2_7P430
+
+ ntpq/ntpq.html@1.95 +2 -2
+ NTP_4_2_7P430
+
+ ntpq/ntpq.man.in@1.251 +6 -6
+ NTP_4_2_7P430
+
+ ntpq/ntpq.mdoc.in@1.251 +2 -2
+ NTP_4_2_7P430
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.422 +2 -2
+ NTP_4_2_7P430
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.437 +7 -7
+ NTP_4_2_7P430
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.437 +3 -3
+ NTP_4_2_7P430
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.251 +7 -7
+ NTP_4_2_7P430
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.251 +3 -3
+ NTP_4_2_7P430
+
+ ntpsnmpd/ntpsnmpd.html@1.93 +1 -1
+ NTP_4_2_7P430
+
+ ntpsnmpd/ntpsnmpd.man.in@1.251 +7 -7
+ NTP_4_2_7P430
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.251 +3 -3
+ NTP_4_2_7P430
+
+ packageinfo.sh@1.434 +1 -1
+ NTP_4_2_7P430
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.13 +13 -13
+ NTP_4_2_7P430
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.13 +2 -2
+ NTP_4_2_7P430
+
+ scripts/calc_tickadj/calc_tickadj.html@1.12 +1 -1
+ NTP_4_2_7P430
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.12 +13 -13
+ NTP_4_2_7P430
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P430
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.14 +1 -1
+ NTP_4_2_7P430
+
+ scripts/invoke-plot_summary.texi@1.31 +1 -1
+ NTP_4_2_7P430
+
+ scripts/invoke-summary.texi@1.31 +1 -1
+ NTP_4_2_7P430
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.240 +1 -1
+ NTP_4_2_7P430
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.241 +6 -6
+ NTP_4_2_7P430
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.241 +2 -2
+ NTP_4_2_7P430
+
+ scripts/ntp-wait/ntp-wait.html@1.257 +1 -1
+ NTP_4_2_7P430
+
+ scripts/ntp-wait/ntp-wait.man.in@1.241 +6 -6
+ NTP_4_2_7P430
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.241 +2 -2
+ NTP_4_2_7P430
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.29 +1 -1
+ NTP_4_2_7P430
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.20 +6 -6
+ NTP_4_2_7P430
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.20 +2 -2
+ NTP_4_2_7P430
+
+ scripts/ntpsweep/ntpsweep.html@1.30 +1 -1
+ NTP_4_2_7P430
+
+ scripts/ntpsweep/ntpsweep.man.in@1.20 +6 -6
+ NTP_4_2_7P430
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P430
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.29 +1 -1
+ NTP_4_2_7P430
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.20 +13 -13
+ NTP_4_2_7P430
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.20 +2 -2
+ NTP_4_2_7P430
+
+ scripts/ntptrace/ntptrace.html@1.30 +1 -1
+ NTP_4_2_7P430
+
+ scripts/ntptrace/ntptrace.man.in@1.20 +13 -13
+ NTP_4_2_7P430
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P430
+
+ scripts/plot_summary.1plot_summaryman@1.31 +6 -6
+ NTP_4_2_7P430
+
+ scripts/plot_summary.1plot_summarymdoc@1.31 +3 -3
+ NTP_4_2_7P430
+
+ scripts/plot_summary.html@1.31 +1 -1
+ NTP_4_2_7P430
+
+ scripts/plot_summary.man.in@1.31 +6 -6
+ NTP_4_2_7P430
+
+ scripts/plot_summary.mdoc.in@1.31 +3 -3
+ NTP_4_2_7P430
+
+ scripts/summary.1summaryman@1.31 +6 -6
+ NTP_4_2_7P430
+
+ scripts/summary.1summarymdoc@1.31 +2 -2
+ NTP_4_2_7P430
+
+ scripts/summary.html@1.31 +1 -1
+ NTP_4_2_7P430
+
+ scripts/summary.man.in@1.31 +6 -6
+ NTP_4_2_7P430
+
+ scripts/summary.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P430
+
+ sntp/invoke-sntp.texi@1.419 +2 -2
+ NTP_4_2_7P430
+
+ sntp/sntp-opts.c@1.434 +7 -7
+ NTP_4_2_7P430
+
+ sntp/sntp-opts.h@1.434 +3 -3
+ NTP_4_2_7P430
+
+ sntp/sntp.1sntpman@1.254 +7 -7
+ NTP_4_2_7P430
+
+ sntp/sntp.1sntpmdoc@1.254 +3 -3
+ NTP_4_2_7P430
+
+ sntp/sntp.html@1.434 +2 -2
+ NTP_4_2_7P430
+
+ sntp/sntp.man.in@1.254 +7 -7
+ NTP_4_2_7P430
+
+ sntp/sntp.mdoc.in@1.254 +3 -3
+ NTP_4_2_7P430
+
+ util/invoke-ntp-keygen.texi@1.423 +2 -2
+ NTP_4_2_7P430
+
+ util/ntp-keygen-opts.c@1.437 +7 -7
+ NTP_4_2_7P430
+
+ util/ntp-keygen-opts.h@1.437 +3 -3
+ NTP_4_2_7P430
+
+ util/ntp-keygen.1ntp-keygenman@1.251 +7 -7
+ NTP_4_2_7P430
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.251 +3 -3
+ NTP_4_2_7P430
+
+ util/ntp-keygen.html@1.99 +2 -2
+ NTP_4_2_7P430
+
+ util/ntp-keygen.man.in@1.251 +7 -7
+ NTP_4_2_7P430
+
+ util/ntp-keygen.mdoc.in@1.251 +3 -3
+ NTP_4_2_7P430
+
+ChangeSet@1.3107.1.12, 2014-03-04 01:43:16-08:00, harlan@hms-mbp11.local
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ sntp/libevent/configure.ac@1.16 +2 -0
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ChangeSet@1.3107.1.11, 2014-03-04 01:36:37-08:00, harlan@hms-mbp11.local
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ ChangeLog@1.1446 +1 -0
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ sntp/libevent/configure.ac@1.15 +16 -10
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ sntp/libevent/m4/openldap-thread-check.m4@1.3 +4 -2
+ [Bug 2572] cross-compiling fails for --with-yielding-select
+
+ChangeSet@1.3107.1.10, 2014-03-04 00:36:34-08:00, harlan@hms-mbp11.local
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ BitKeeper/deleted/17/evconfig-private.h~e326850fdeaa98a0@1.3 +0 -0
+ Delete: sntp/libevent/WIN32-Code/evconfig-private.h
+
+ BitKeeper/deleted/1d/test-ratelim.sh~dddafffaaeb54e28@1.4 +0 -0
+ Delete: sntp/libevent/test/test-ratelim.sh
+
+ BitKeeper/deleted/27/event.3~f0ceb5963a3e2eb2@1.2 +0 -0
+ Delete: sntp/libevent/event.3
+
+ BitKeeper/deleted/5d/make_epoll_table.py~9cb592404263d3ec@1.3 +0 -0
+ Delete: sntp/libevent/make_epoll_table.py
+
+ BitKeeper/deleted/5e/CommitLog~8348099c640278eb@1.3 +0 -0
+ Delete: sntp/libevent/CommitLog
+
+ BitKeeper/deleted/a5/event-config.h~b5f19946803cd6c3@1.7 +0 -0
+ Delete: sntp/libevent/WIN32-Code/event2/event-config.h
+
+ BitKeeper/deleted/ae/print-winsock-errors.c~9a8c717f5ec35467@1.2 +0 -0
+ Delete: sntp/libevent/test/print-winsock-errors.c
+
+ BitKeeper/deleted/c5/tinytest_demo.c~ce8c6418b673bdfe@1.4 +0 -0
+ Delete: sntp/libevent/test/tinytest_demo.c
+
+ BitKeeper/deleted/d8/evdns.3~b3752932bb1e0709@1.2 +0 -0
+ Delete: sntp/libevent/evdns.3
+
+ BitKeeper/etc/ignore@1.85 +1 -0
+ added sntp/libevent/build-aux/ar-lib
+
+ ChangeLog@1.1445 +1 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/ChangeLog@1.8 +257 -1
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/Makefile.am@1.12 +10 -7
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/Makefile.nmake@1.5 +1 -1
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/WIN32-Code/nmake/evconfig-private.h@1.1 +6 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/WIN32-Code/nmake/evconfig-private.h
+
+ sntp/libevent/WIN32-Code/nmake/evconfig-private.h@1.0 +0 -0
+
+ sntp/libevent/WIN32-Code/nmake/event2/event-config.h@1.1 +360 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/WIN32-Code/nmake/event2/event-config.h
+
+ sntp/libevent/WIN32-Code/nmake/event2/event-config.h@1.0 +0 -0
+
+ sntp/libevent/arc4random.c@1.6 +36 -20
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/buffer.c@1.9 +36 -8
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent-internal.h@1.7 +34 -10
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent.c@1.7 +119 -44
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent_async.c@1.6 +10 -17
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent_filter.c@1.6 +16 -11
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent_openssl.c@1.8 +46 -37
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent_pair.c@1.7 +10 -17
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent_ratelim.c@1.5 +22 -5
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/bufferevent_sock.c@1.7 +16 -20
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/changelist-internal.h@1.3 +1 -0
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/configure.ac@1.14 +28 -22
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/epoll.c@1.6 +33 -176
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/epoll_sub.c@1.4 +13 -0
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/epolltable-internal.h@1.1 +1166 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/epolltable-internal.h
+
+ sntp/libevent/epolltable-internal.h@1.0 +0 -0
+
+ sntp/libevent/evbuffer-internal.h@1.7 +5 -0
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/evconfig-private.h@1.1 +49 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/evconfig-private.h
+
+ sntp/libevent/evconfig-private.h@1.0 +0 -0
+
+ sntp/libevent/evdns.c@1.9 +87 -37
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/event-internal.h@1.9 +45 -3
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/event.c@1.10 +381 -69
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/event_iocp.c@1.6 +4 -1
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/evmap.c@1.7 +54 -13
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/evrpc.c@1.6 +5 -9
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/evutil.c@1.9 +25 -9
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/evutil_rand.c@1.7 +26 -3
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/evutil_time.c@1.4 +14 -3
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/http-internal.h@1.5 +10 -9
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/http.c@1.9 +116 -28
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/buffer.h@1.6 +59 -5
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/buffer_compat.h@1.4 +5 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/bufferevent.h@1.5 +123 -3
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/bufferevent_ssl.h@1.4 +8 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/dns.h@1.6 +59 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/event.h@1.9 +266 -15
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/event_compat.h@1.5 +10 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/event_struct.h@1.5 +8 -3
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/http.h@1.6 +209 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/http_struct.h@1.4 +22 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/listener.h@1.3 +11 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/tag.h@1.4 +22 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/thread.h@1.6 +10 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/util.h@1.6 +47 -3
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/include/event2/visibility.h@1.1 +55 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/include/event2/visibility.h
+
+ sntp/libevent/include/event2/visibility.h@1.0 +0 -0
+
+ sntp/libevent/include/include.am@1.2 +2 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/log-internal.h@1.3 +3 -0
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/log.c@1.6 +13 -12
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/m4/acx_pthread.m4@1.1 +279 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/m4/acx_pthread.m4
+
+ sntp/libevent/m4/acx_pthread.m4@1.0 +0 -0
+
+ sntp/libevent/minheap-internal.h@1.6 +1 -1
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/sample/dns-example.c@1.7 +2 -2
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/sample/hostcheck.c@1.1 +217 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/sample/hostcheck.c
+
+ sntp/libevent/sample/hostcheck.c@1.0 +0 -0
+
+ sntp/libevent/sample/hostcheck.h@1.1 +30 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/sample/hostcheck.h
+
+ sntp/libevent/sample/hostcheck.h@1.0 +0 -0
+
+ sntp/libevent/sample/http-server.c@1.9 +2 -2
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/sample/https-client.c@1.1 +426 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/sample/https-client.c
+
+ sntp/libevent/sample/https-client.c@1.0 +0 -0
+
+ sntp/libevent/sample/include.am@1.2 +12 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/sample/le-proxy.c@1.3 +10 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/sample/openssl_hostname_validation.c@1.1 +172 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/sample/openssl_hostname_validation.c
+
+ sntp/libevent/sample/openssl_hostname_validation.c@1.0 +0 -0
+
+ sntp/libevent/sample/openssl_hostname_validation.h@1.1 +56 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/sample/openssl_hostname_validation.h
+
+ sntp/libevent/sample/openssl_hostname_validation.h@1.0 +0 -0
+
+ sntp/libevent/test/Makefile.nmake@1.5 +7 -5
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/bench.c@1.5 +15 -4
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/bench_cascade.c@1.5 +15 -6
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/bench_http.c@1.5 +6 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/include.am@1.3 +11 -10
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress.c@1.5 +604 -7
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress.h@1.4 +3 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_buffer.c@1.7 +15 -14
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_bufferevent.c@1.5 +159 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_dns.c@1.7 +68 -8
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_et.c@1.5 +2 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_finalize.c@1.1 +346 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/test/regress_finalize.c
+
+ sntp/libevent/test/regress_finalize.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_http.c@1.7 +215 -18
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_main.c@1.6 +12 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_rpc.c@1.6 +8 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_ssl.c@1.6 +5 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_thread.c@1.5 +1 -18
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/regress_thread.h@1.1 +48 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/test/regress_thread.h
+
+ sntp/libevent/test/regress_thread.h@1.0 +0 -0
+
+ sntp/libevent/test/regress_util.c@1.6 +1 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.4 +2 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/test-changelist.c@1.5 +2 -1
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/test-closed.c@1.1 +117 -0
+ BitKeeper file /Users/harlan/src/ntp-dev-libevent/sntp/libevent/test/test-closed.c
+
+ sntp/libevent/test/test-closed.c@1.0 +0 -0
+
+ sntp/libevent/test/test-ratelim.c@1.8 +2 -0
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/test/test.sh@1.10 +3 -10
+ Upgrade to libevent-2.1.3-alpha-dev
+
+ sntp/libevent/util-internal.h@1.9 +4 -0
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/whatsnew-2.1.txt@1.3 +125 -7
+ upgrade to libevent 2.1.3-alpha-dev
+
+ sntp/libevent/win32select.c@1.5 +1 -1
+ upgrade to libevent 2.1.3-alpha-dev
+
+ChangeSet@1.3107.1.9, 2014-03-03 11:15:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P429
+ TAG: NTP_4_2_7P429
+
+ ChangeLog@1.1444 +1 -0
+ NTP_4_2_7P429
+
+ ntpd/invoke-ntp.conf.texi@1.107 +1 -1
+ NTP_4_2_7P429
+
+ ntpd/invoke-ntp.keys.texi@1.105 +1 -1
+ NTP_4_2_7P429
+
+ ntpd/invoke-ntpd.texi@1.421 +2 -2
+ NTP_4_2_7P429
+
+ ntpd/ntp.conf.5man@1.141 +7 -7
+ NTP_4_2_7P429
+
+ ntpd/ntp.conf.5mdoc@1.141 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntp.conf.html@1.102 +1 -1
+ NTP_4_2_7P429
+
+ ntpd/ntp.conf.man.in@1.141 +7 -7
+ NTP_4_2_7P429
+
+ ntpd/ntp.conf.mdoc.in@1.141 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntp.keys.5man@1.139 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntp.keys.5mdoc@1.139 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntp.keys.html@1.103 +1 -1
+ NTP_4_2_7P429
+
+ ntpd/ntp.keys.man.in@1.139 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntp.keys.mdoc.in@1.139 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntpd-opts.c@1.439 +7 -7
+ NTP_4_2_7P429
+
+ ntpd/ntpd-opts.h@1.439 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntpd.1ntpdman@1.250 +0 -1007
+ NTP_4_2_7P429
+
+ ntpd/ntpd.1ntpdmdoc@1.250 +3 -3
+ NTP_4_2_7P429
+
+ ntpd/ntpd.html@1.97 +2 -2
+ NTP_4_2_7P429
+
+ ntpd/ntpd.man.in@1.250 +0 -1007
+ NTP_4_2_7P429
+
+ ntpd/ntpd.mdoc.in@1.250 +3 -3
+ NTP_4_2_7P429
+
+ ntpdc/invoke-ntpdc.texi@1.419 +2 -2
+ NTP_4_2_7P429
+
+ ntpdc/ntpdc-opts.c@1.434 +7 -7
+ NTP_4_2_7P429
+
+ ntpdc/ntpdc-opts.h@1.434 +3 -3
+ NTP_4_2_7P429
+
+ ntpdc/ntpdc.1ntpdcman@1.250 +6 -6
+ NTP_4_2_7P429
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.250 +2 -2
+ NTP_4_2_7P429
+
+ ntpdc/ntpdc.html@1.263 +2 -2
+ NTP_4_2_7P429
+
+ ntpdc/ntpdc.man.in@1.250 +6 -6
+ NTP_4_2_7P429
+
+ ntpdc/ntpdc.mdoc.in@1.250 +2 -2
+ NTP_4_2_7P429
+
+ ntpq/invoke-ntpq.texi@1.422 +2 -2
+ NTP_4_2_7P429
+
+ ntpq/ntpq-opts.c@1.436 +7 -7
+ NTP_4_2_7P429
+
+ ntpq/ntpq-opts.h@1.436 +3 -3
+ NTP_4_2_7P429
+
+ ntpq/ntpq.1ntpqman@1.250 +6 -6
+ NTP_4_2_7P429
+
+ ntpq/ntpq.1ntpqmdoc@1.250 +2 -2
+ NTP_4_2_7P429
+
+ ntpq/ntpq.html@1.94 +2 -2
+ NTP_4_2_7P429
+
+ ntpq/ntpq.man.in@1.250 +6 -6
+ NTP_4_2_7P429
+
+ ntpq/ntpq.mdoc.in@1.250 +2 -2
+ NTP_4_2_7P429
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.421 +2 -2
+ NTP_4_2_7P429
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.436 +7 -7
+ NTP_4_2_7P429
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.436 +3 -3
+ NTP_4_2_7P429
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.250 +7 -7
+ NTP_4_2_7P429
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.250 +3 -3
+ NTP_4_2_7P429
+
+ ntpsnmpd/ntpsnmpd.html@1.92 +1 -1
+ NTP_4_2_7P429
+
+ ntpsnmpd/ntpsnmpd.man.in@1.250 +7 -7
+ NTP_4_2_7P429
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.250 +3 -3
+ NTP_4_2_7P429
+
+ packageinfo.sh@1.433 +1 -1
+ NTP_4_2_7P429
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.12 +6 -6
+ NTP_4_2_7P429
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.12 +2 -2
+ NTP_4_2_7P429
+
+ scripts/calc_tickadj/calc_tickadj.html@1.11 +1 -1
+ NTP_4_2_7P429
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.11 +6 -6
+ NTP_4_2_7P429
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P429
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.13 +1 -1
+ NTP_4_2_7P429
+
+ scripts/invoke-plot_summary.texi@1.30 +1 -1
+ NTP_4_2_7P429
+
+ scripts/invoke-summary.texi@1.30 +1 -1
+ NTP_4_2_7P429
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.239 +1 -1
+ NTP_4_2_7P429
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.240 +6 -6
+ NTP_4_2_7P429
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.240 +2 -2
+ NTP_4_2_7P429
+
+ scripts/ntp-wait/ntp-wait.html@1.256 +1 -1
+ NTP_4_2_7P429
+
+ scripts/ntp-wait/ntp-wait.man.in@1.240 +6 -6
+ NTP_4_2_7P429
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.240 +2 -2
+ NTP_4_2_7P429
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.28 +1 -1
+ NTP_4_2_7P429
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.19 +6 -6
+ NTP_4_2_7P429
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.19 +2 -2
+ NTP_4_2_7P429
+
+ scripts/ntpsweep/ntpsweep.html@1.29 +1 -1
+ NTP_4_2_7P429
+
+ scripts/ntpsweep/ntpsweep.man.in@1.19 +6 -6
+ NTP_4_2_7P429
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P429
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.28 +1 -1
+ NTP_4_2_7P429
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.19 +6 -6
+ NTP_4_2_7P429
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.19 +2 -2
+ NTP_4_2_7P429
+
+ scripts/ntptrace/ntptrace.html@1.29 +1 -1
+ NTP_4_2_7P429
+
+ scripts/ntptrace/ntptrace.man.in@1.19 +6 -6
+ NTP_4_2_7P429
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P429
+
+ scripts/plot_summary.1plot_summaryman@1.30 +6 -6
+ NTP_4_2_7P429
+
+ scripts/plot_summary.1plot_summarymdoc@1.30 +3 -3
+ NTP_4_2_7P429
+
+ scripts/plot_summary.html@1.30 +1 -1
+ NTP_4_2_7P429
+
+ scripts/plot_summary.man.in@1.30 +6 -6
+ NTP_4_2_7P429
+
+ scripts/plot_summary.mdoc.in@1.30 +3 -3
+ NTP_4_2_7P429
+
+ scripts/summary.1summaryman@1.30 +6 -6
+ NTP_4_2_7P429
+
+ scripts/summary.1summarymdoc@1.30 +2 -2
+ NTP_4_2_7P429
+
+ scripts/summary.html@1.30 +1 -1
+ NTP_4_2_7P429
+
+ scripts/summary.man.in@1.30 +6 -6
+ NTP_4_2_7P429
+
+ scripts/summary.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P429
+
+ sntp/invoke-sntp.texi@1.418 +2 -2
+ NTP_4_2_7P429
+
+ sntp/sntp-opts.c@1.433 +7 -7
+ NTP_4_2_7P429
+
+ sntp/sntp-opts.h@1.433 +3 -3
+ NTP_4_2_7P429
+
+ sntp/sntp.1sntpman@1.253 +7 -7
+ NTP_4_2_7P429
+
+ sntp/sntp.1sntpmdoc@1.253 +3 -3
+ NTP_4_2_7P429
+
+ sntp/sntp.html@1.433 +2 -2
+ NTP_4_2_7P429
+
+ sntp/sntp.man.in@1.253 +7 -7
+ NTP_4_2_7P429
+
+ sntp/sntp.mdoc.in@1.253 +3 -3
+ NTP_4_2_7P429
+
+ util/invoke-ntp-keygen.texi@1.422 +2 -2
+ NTP_4_2_7P429
+
+ util/ntp-keygen-opts.c@1.436 +7 -7
+ NTP_4_2_7P429
+
+ util/ntp-keygen-opts.h@1.436 +3 -3
+ NTP_4_2_7P429
+
+ util/ntp-keygen.1ntp-keygenman@1.250 +7 -7
+ NTP_4_2_7P429
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.250 +3 -3
+ NTP_4_2_7P429
+
+ util/ntp-keygen.html@1.98 +2 -2
+ NTP_4_2_7P429
+
+ util/ntp-keygen.man.in@1.250 +7 -7
+ NTP_4_2_7P429
+
+ util/ntp-keygen.mdoc.in@1.250 +3 -3
+ NTP_4_2_7P429
+
+ChangeSet@1.3107.1.8, 2014-03-03 09:53:09+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP
+
+ ChangeLog@1.1443 +1 -0
+ [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP
+
+ configure.ac@1.575 +51 -59
+ [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP
+
+ sntp/m4/ntp_libntp.m4@1.27 +6 -8
+ [Bug 2170] Use AC_PREPROC_IFELSE instead of AC_EGREP_CPP
+
+ChangeSet@1.3107.2.2, 2014-03-03 09:33:00+00:00, stenn@psp-deb1.ntp.org
+ Reorder ChangeLog entry
+
+ ChangeLog@1.1440.1.2 +2 -2
+ Reorder ChangeLog entry
+
+ChangeSet@1.3107.2.1, 2014-03-03 10:06:43+01:00, jnperlin@hydra.(none)
+ * [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash
+ -- change reading the hash line code: NIST omits leading zeros.
+
+ ChangeLog@1.1440.1.1 +2 -0
+ * [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash
+ -- change reading the hash line code: NIST omits leading zeros.
+
+ ntpd/ntp_leapsec.c@1.7 +24 -22
+ * [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash
+ -- change reading the hash line code: NIST omits leading zeros.
+
+ tests/ntpd/leapsec.cpp@1.7 +74 -0
+ * [Bug 2570] refuse to load leapsec file with bad/missing SHA1 hash
+ -- added test cases for modified hash line read.
+
+ChangeSet@1.3107.1.6, 2014-03-03 03:37:29-05:00, stenn@deacon.udel.edu
+ CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check
+
+ ChangeLog@1.1441 +1 -0
+ CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check
+
+ ntpd/refclock_gpsdjson.c@1.9 +5 -4
+ CID 1189401: Use INSIST() instead of a belt-and-suspenders pointer check
+
+ChangeSet@1.3107.1.5, 2014-03-03 02:34:17-05:00, stenn@deacon.udel.edu
+ [Bug 2576] refclock_gpsdjson.c doesn't compile if CLOCK_GPSDJSON is not enabled at configure time
+
+ ChangeLog@1.1440 +2 -0
+ [Bug 2576] refclock_gpsdjson.c doesn't compile if CLOCK_GPSDJSON is not enabled at configure time
+
+ ntpd/refclock_gpsdjson.c@1.8 +2 -1
+ [Bug 2576] refclock_gpsdjson.c doesn't compile if CLOCK_GPSDJSON is not enabled at configure time
+
+ChangeSet@1.3107.1.4, 2014-03-03 02:04:30-05:00, stenn@deacon.udel.edu
+ CID 1165098: Remove logically dead code from refclock_true.c
+
+ ChangeLog@1.1439 +1 -0
+ CID 1165098: Remove logically dead code from refclock_true.c
+
+ ntpd/refclock_true.c@1.21 +2 -4
+ CID 1165098: Remove logically dead code from refclock_true.c
+
+ChangeSet@1.3107.1.3, 2014-03-02 22:47:14-05:00, stenn@deacon.udel.edu
+ In ntp_dir_sep.m4, we care about $host_os, not $target_os
+
+ ChangeLog@1.1438 +1 -0
+ In ntp_dir_sep.m4, we care about $host_os, not $target_os
+
+ sntp/m4/ntp_dir_sep.m4@1.5 +1 -1
+ In ntp_dir_sep.m4, we care about $host_os, not $target_os
+
+ChangeSet@1.3107.1.2, 2014-03-02 21:45:57-05:00, stenn@deacon.udel.edu
+ bootstrap script needs to 'touch' files in finer-grained groups
+
+ ChangeLog@1.1437 +1 -0
+ bootstrap script needs to 'touch' files in finer-grained groups
+
+ bootstrap@1.47 +3 -0
+ bootstrap script needs to 'touch' files in finer-grained groups
+
+ChangeSet@1.3107.1.1, 2014-03-03 01:58:08+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P428
+ TAG: NTP_4_2_7P428
+
+ ChangeLog@1.1436 +1 -0
+ NTP_4_2_7P428
+
+ ntpd/invoke-ntp.conf.texi@1.106 +1 -1
+ NTP_4_2_7P428
+
+ ntpd/invoke-ntp.keys.texi@1.104 +1 -1
+ NTP_4_2_7P428
+
+ ntpd/invoke-ntpd.texi@1.420 +2 -2
+ NTP_4_2_7P428
+
+ ntpd/ntp.conf.5man@1.140 +7 -7
+ NTP_4_2_7P428
+
+ ntpd/ntp.conf.5mdoc@1.140 +2 -2
+ NTP_4_2_7P428
+
+ ntpd/ntp.conf.html@1.101 +1 -1
+ NTP_4_2_7P428
+
+ ntpd/ntp.conf.man.in@1.140 +7 -7
+ NTP_4_2_7P428
+
+ ntpd/ntp.conf.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P428
+
+ ntpd/ntp.keys.5man@1.138 +3 -3
+ NTP_4_2_7P428
+
+ ntpd/ntp.keys.5mdoc@1.138 +2 -2
+ NTP_4_2_7P428
+
+ ntpd/ntp.keys.html@1.102 +1 -1
+ NTP_4_2_7P428
+
+ ntpd/ntp.keys.man.in@1.138 +3 -3
+ NTP_4_2_7P428
+
+ ntpd/ntp.keys.mdoc.in@1.138 +2 -2
+ NTP_4_2_7P428
+
+ ntpd/ntpd-opts.c@1.438 +7 -7
+ NTP_4_2_7P428
+
+ ntpd/ntpd-opts.h@1.438 +3 -3
+ NTP_4_2_7P428
+
+ ntpd/ntpd.1ntpdman@1.249 +7 -7
+ NTP_4_2_7P428
+
+ ntpd/ntpd.1ntpdmdoc@1.249 +2 -2
+ NTP_4_2_7P428
+
+ ntpd/ntpd.html@1.96 +2 -2
+ NTP_4_2_7P428
+
+ ntpd/ntpd.man.in@1.249 +7 -7
+ NTP_4_2_7P428
+
+ ntpd/ntpd.mdoc.in@1.249 +2 -2
+ NTP_4_2_7P428
+
+ ntpdc/invoke-ntpdc.texi@1.418 +2 -2
+ NTP_4_2_7P428
+
+ ntpdc/ntpdc-opts.c@1.433 +7 -7
+ NTP_4_2_7P428
+
+ ntpdc/ntpdc-opts.h@1.433 +3 -3
+ NTP_4_2_7P428
+
+ ntpdc/ntpdc.1ntpdcman@1.249 +6 -6
+ NTP_4_2_7P428
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.249 +1 -1
+ NTP_4_2_7P428
+
+ ntpdc/ntpdc.html@1.262 +2 -2
+ NTP_4_2_7P428
+
+ ntpdc/ntpdc.man.in@1.249 +6 -6
+ NTP_4_2_7P428
+
+ ntpdc/ntpdc.mdoc.in@1.249 +1 -1
+ NTP_4_2_7P428
+
+ ntpq/invoke-ntpq.texi@1.421 +2 -2
+ NTP_4_2_7P428
+
+ ntpq/ntpq-opts.c@1.435 +7 -7
+ NTP_4_2_7P428
+
+ ntpq/ntpq-opts.h@1.435 +3 -3
+ NTP_4_2_7P428
+
+ ntpq/ntpq.1ntpqman@1.249 +6 -6
+ NTP_4_2_7P428
+
+ ntpq/ntpq.1ntpqmdoc@1.249 +1 -1
+ NTP_4_2_7P428
+
+ ntpq/ntpq.html@1.93 +2 -2
+ NTP_4_2_7P428
+
+ ntpq/ntpq.man.in@1.249 +6 -6
+ NTP_4_2_7P428
+
+ ntpq/ntpq.mdoc.in@1.249 +1 -1
+ NTP_4_2_7P428
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.420 +2 -2
+ NTP_4_2_7P428
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.435 +7 -7
+ NTP_4_2_7P428
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.435 +3 -3
+ NTP_4_2_7P428
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.249 +7 -7
+ NTP_4_2_7P428
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.249 +2 -2
+ NTP_4_2_7P428
+
+ ntpsnmpd/ntpsnmpd.html@1.91 +1 -1
+ NTP_4_2_7P428
+
+ ntpsnmpd/ntpsnmpd.man.in@1.249 +7 -7
+ NTP_4_2_7P428
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.249 +2 -2
+ NTP_4_2_7P428
+
+ packageinfo.sh@1.432 +1 -1
+ NTP_4_2_7P428
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.11 +6 -6
+ NTP_4_2_7P428
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.11 +2 -2
+ NTP_4_2_7P428
+
+ scripts/calc_tickadj/calc_tickadj.html@1.10 +1 -1
+ NTP_4_2_7P428
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.10 +6 -6
+ NTP_4_2_7P428
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.11 +2 -2
+ NTP_4_2_7P428
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.12 +1 -1
+ NTP_4_2_7P428
+
+ scripts/invoke-plot_summary.texi@1.29 +1 -1
+ NTP_4_2_7P428
+
+ scripts/invoke-summary.texi@1.29 +1 -1
+ NTP_4_2_7P428
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.238 +1 -1
+ NTP_4_2_7P428
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.239 +6 -6
+ NTP_4_2_7P428
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.239 +2 -2
+ NTP_4_2_7P428
+
+ scripts/ntp-wait/ntp-wait.html@1.255 +1 -1
+ NTP_4_2_7P428
+
+ scripts/ntp-wait/ntp-wait.man.in@1.239 +6 -6
+ NTP_4_2_7P428
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.239 +2 -2
+ NTP_4_2_7P428
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.27 +1 -1
+ NTP_4_2_7P428
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.18 +6 -6
+ NTP_4_2_7P428
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.18 +2 -2
+ NTP_4_2_7P428
+
+ scripts/ntpsweep/ntpsweep.html@1.28 +1 -1
+ NTP_4_2_7P428
+
+ scripts/ntpsweep/ntpsweep.man.in@1.18 +6 -6
+ NTP_4_2_7P428
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P428
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.27 +1 -1
+ NTP_4_2_7P428
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.18 +6 -6
+ NTP_4_2_7P428
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.18 +2 -2
+ NTP_4_2_7P428
+
+ scripts/ntptrace/ntptrace.html@1.28 +1 -1
+ NTP_4_2_7P428
+
+ scripts/ntptrace/ntptrace.man.in@1.18 +6 -6
+ NTP_4_2_7P428
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P428
+
+ scripts/plot_summary.1plot_summaryman@1.29 +6 -6
+ NTP_4_2_7P428
+
+ scripts/plot_summary.1plot_summarymdoc@1.29 +3 -3
+ NTP_4_2_7P428
+
+ scripts/plot_summary.html@1.29 +1 -1
+ NTP_4_2_7P428
+
+ scripts/plot_summary.man.in@1.29 +6 -6
+ NTP_4_2_7P428
+
+ scripts/plot_summary.mdoc.in@1.29 +3 -3
+ NTP_4_2_7P428
+
+ scripts/summary.1summaryman@1.29 +6 -6
+ NTP_4_2_7P428
+
+ scripts/summary.1summarymdoc@1.29 +2 -2
+ NTP_4_2_7P428
+
+ scripts/summary.html@1.29 +1 -1
+ NTP_4_2_7P428
+
+ scripts/summary.man.in@1.29 +6 -6
+ NTP_4_2_7P428
+
+ scripts/summary.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P428
+
+ sntp/invoke-sntp.texi@1.417 +2 -2
+ NTP_4_2_7P428
+
+ sntp/sntp-opts.c@1.432 +7 -7
+ NTP_4_2_7P428
+
+ sntp/sntp-opts.h@1.432 +3 -3
+ NTP_4_2_7P428
+
+ sntp/sntp.1sntpman@1.252 +14 -14
+ NTP_4_2_7P428
+
+ sntp/sntp.1sntpmdoc@1.252 +2 -2
+ NTP_4_2_7P428
+
+ sntp/sntp.html@1.432 +2 -2
+ NTP_4_2_7P428
+
+ sntp/sntp.man.in@1.252 +14 -14
+ NTP_4_2_7P428
+
+ sntp/sntp.mdoc.in@1.252 +2 -2
+ NTP_4_2_7P428
+
+ util/invoke-ntp-keygen.texi@1.421 +2 -2
+ NTP_4_2_7P428
+
+ util/ntp-keygen-opts.c@1.435 +7 -7
+ NTP_4_2_7P428
+
+ util/ntp-keygen-opts.h@1.435 +3 -3
+ NTP_4_2_7P428
+
+ util/ntp-keygen.1ntp-keygenman@1.249 +7 -7
+ NTP_4_2_7P428
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.249 +2 -2
+ NTP_4_2_7P428
+
+ util/ntp-keygen.html@1.97 +2 -2
+ NTP_4_2_7P428
+
+ util/ntp-keygen.man.in@1.249 +7 -7
+ NTP_4_2_7P428
+
+ util/ntp-keygen.mdoc.in@1.249 +2 -2
+ NTP_4_2_7P428
+
+ChangeSet@1.3103.2.3, 2014-03-02 04:45:25-05:00, stenn@deacon.udel.edu
+ [Bug 2562] Distribute the code in libjsmn/
+
+ ChangeLog@1.1432.2.3 +1 -0
+ [Bug 2562] Distribute the code in libjsmn/
+
+ Makefile.am@1.118 +1 -0
+ [Bug 2562] Distribute the code in libjsmn/
+
+ChangeSet@1.3103.2.2, 2014-03-02 09:11:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P427
+ TAG: NTP_4_2_7P427
+
+ ChangeLog@1.1432.2.2 +1 -0
+ NTP_4_2_7P427
+
+ ntpd/invoke-ntp.conf.texi@1.105 +1 -1
+ NTP_4_2_7P427
+
+ ntpd/invoke-ntp.keys.texi@1.103 +1 -1
+ NTP_4_2_7P427
+
+ ntpd/invoke-ntpd.texi@1.419 +2 -2
+ NTP_4_2_7P427
+
+ ntpd/ntp.conf.5man@1.139 +14 -14
+ NTP_4_2_7P427
+
+ ntpd/ntp.conf.5mdoc@1.139 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntp.conf.html@1.100 +1 -1
+ NTP_4_2_7P427
+
+ ntpd/ntp.conf.man.in@1.139 +14 -14
+ NTP_4_2_7P427
+
+ ntpd/ntp.conf.mdoc.in@1.139 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntp.keys.5man@1.137 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntp.keys.5mdoc@1.137 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntp.keys.html@1.101 +1 -1
+ NTP_4_2_7P427
+
+ ntpd/ntp.keys.man.in@1.137 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntp.keys.mdoc.in@1.137 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntpd-opts.c@1.437 +7 -7
+ NTP_4_2_7P427
+
+ ntpd/ntpd-opts.h@1.437 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntpd.1ntpdman@1.248 +7 -7
+ NTP_4_2_7P427
+
+ ntpd/ntpd.1ntpdmdoc@1.248 +3 -3
+ NTP_4_2_7P427
+
+ ntpd/ntpd.html@1.95 +2 -2
+ NTP_4_2_7P427
+
+ ntpd/ntpd.man.in@1.248 +7 -7
+ NTP_4_2_7P427
+
+ ntpd/ntpd.mdoc.in@1.248 +3 -3
+ NTP_4_2_7P427
+
+ ntpdc/invoke-ntpdc.texi@1.417 +2 -2
+ NTP_4_2_7P427
+
+ ntpdc/ntpdc-opts.c@1.432 +7 -7
+ NTP_4_2_7P427
+
+ ntpdc/ntpdc-opts.h@1.432 +3 -3
+ NTP_4_2_7P427
+
+ ntpdc/ntpdc.1ntpdcman@1.248 +13 -13
+ NTP_4_2_7P427
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.248 +2 -2
+ NTP_4_2_7P427
+
+ ntpdc/ntpdc.html@1.261 +2 -2
+ NTP_4_2_7P427
+
+ ntpdc/ntpdc.man.in@1.248 +13 -13
+ NTP_4_2_7P427
+
+ ntpdc/ntpdc.mdoc.in@1.248 +2 -2
+ NTP_4_2_7P427
+
+ ntpq/invoke-ntpq.texi@1.420 +2 -2
+ NTP_4_2_7P427
+
+ ntpq/ntpq-opts.c@1.434 +7 -7
+ NTP_4_2_7P427
+
+ ntpq/ntpq-opts.h@1.434 +3 -3
+ NTP_4_2_7P427
+
+ ntpq/ntpq.1ntpqman@1.248 +13 -13
+ NTP_4_2_7P427
+
+ ntpq/ntpq.1ntpqmdoc@1.248 +2 -2
+ NTP_4_2_7P427
+
+ ntpq/ntpq.html@1.92 +2 -2
+ NTP_4_2_7P427
+
+ ntpq/ntpq.man.in@1.248 +13 -13
+ NTP_4_2_7P427
+
+ ntpq/ntpq.mdoc.in@1.248 +2 -2
+ NTP_4_2_7P427
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.419 +2 -2
+ NTP_4_2_7P427
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.434 +7 -7
+ NTP_4_2_7P427
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.434 +3 -3
+ NTP_4_2_7P427
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.248 +7 -7
+ NTP_4_2_7P427
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.248 +3 -3
+ NTP_4_2_7P427
+
+ ntpsnmpd/ntpsnmpd.html@1.90 +1 -1
+ NTP_4_2_7P427
+
+ ntpsnmpd/ntpsnmpd.man.in@1.248 +7 -7
+ NTP_4_2_7P427
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.248 +3 -3
+ NTP_4_2_7P427
+
+ packageinfo.sh@1.431 +1 -1
+ NTP_4_2_7P427
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.10 +6 -6
+ NTP_4_2_7P427
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.10 +2 -2
+ NTP_4_2_7P427
+
+ scripts/calc_tickadj/calc_tickadj.html@1.9 +1 -1
+ NTP_4_2_7P427
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.9 +6 -6
+ NTP_4_2_7P427
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P427
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.11 +1 -1
+ NTP_4_2_7P427
+
+ scripts/invoke-plot_summary.texi@1.28 +1 -1
+ NTP_4_2_7P427
+
+ scripts/invoke-summary.texi@1.28 +1 -1
+ NTP_4_2_7P427
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.237 +1 -1
+ NTP_4_2_7P427
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.238 +6 -6
+ NTP_4_2_7P427
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.238 +2 -2
+ NTP_4_2_7P427
+
+ scripts/ntp-wait/ntp-wait.html@1.254 +1 -1
+ NTP_4_2_7P427
+
+ scripts/ntp-wait/ntp-wait.man.in@1.238 +6 -6
+ NTP_4_2_7P427
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.238 +2 -2
+ NTP_4_2_7P427
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.26 +1 -1
+ NTP_4_2_7P427
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.17 +6 -6
+ NTP_4_2_7P427
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.17 +2 -2
+ NTP_4_2_7P427
+
+ scripts/ntpsweep/ntpsweep.html@1.27 +1 -1
+ NTP_4_2_7P427
+
+ scripts/ntpsweep/ntpsweep.man.in@1.17 +6 -6
+ NTP_4_2_7P427
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P427
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.26 +1 -1
+ NTP_4_2_7P427
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.17 +13 -13
+ NTP_4_2_7P427
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.17 +2 -2
+ NTP_4_2_7P427
+
+ scripts/ntptrace/ntptrace.html@1.27 +1 -1
+ NTP_4_2_7P427
+
+ scripts/ntptrace/ntptrace.man.in@1.17 +13 -13
+ NTP_4_2_7P427
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P427
+
+ scripts/plot_summary.1plot_summaryman@1.28 +6 -6
+ NTP_4_2_7P427
+
+ scripts/plot_summary.1plot_summarymdoc@1.28 +2 -2
+ NTP_4_2_7P427
+
+ scripts/plot_summary.html@1.28 +1 -1
+ NTP_4_2_7P427
+
+ scripts/plot_summary.man.in@1.28 +6 -6
+ NTP_4_2_7P427
+
+ scripts/plot_summary.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P427
+
+ scripts/summary.1summaryman@1.28 +6 -6
+ NTP_4_2_7P427
+
+ scripts/summary.1summarymdoc@1.28 +2 -2
+ NTP_4_2_7P427
+
+ scripts/summary.html@1.28 +1 -1
+ NTP_4_2_7P427
+
+ scripts/summary.man.in@1.28 +6 -6
+ NTP_4_2_7P427
+
+ scripts/summary.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P427
+
+ sntp/invoke-sntp.texi@1.416 +2 -2
+ NTP_4_2_7P427
+
+ sntp/sntp-opts.c@1.431 +7 -7
+ NTP_4_2_7P427
+
+ sntp/sntp-opts.h@1.431 +3 -3
+ NTP_4_2_7P427
+
+ sntp/sntp.1sntpman@1.251 +14 -14
+ NTP_4_2_7P427
+
+ sntp/sntp.1sntpmdoc@1.251 +3 -3
+ NTP_4_2_7P427
+
+ sntp/sntp.html@1.431 +2 -2
+ NTP_4_2_7P427
+
+ sntp/sntp.man.in@1.251 +14 -14
+ NTP_4_2_7P427
+
+ sntp/sntp.mdoc.in@1.251 +3 -3
+ NTP_4_2_7P427
+
+ util/invoke-ntp-keygen.texi@1.420 +2 -2
+ NTP_4_2_7P427
+
+ util/ntp-keygen-opts.c@1.434 +7 -7
+ NTP_4_2_7P427
+
+ util/ntp-keygen-opts.h@1.434 +3 -3
+ NTP_4_2_7P427
+
+ util/ntp-keygen.1ntp-keygenman@1.248 +7 -7
+ NTP_4_2_7P427
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.248 +3 -3
+ NTP_4_2_7P427
+
+ util/ntp-keygen.html@1.96 +2 -2
+ NTP_4_2_7P427
+
+ util/ntp-keygen.man.in@1.248 +7 -7
+ NTP_4_2_7P427
+
+ util/ntp-keygen.mdoc.in@1.248 +3 -3
+ NTP_4_2_7P427
+
+ChangeSet@1.3102.1.1, 2014-03-02 09:25:15+01:00, jnperlin@hydra.(none)
+ [Bug 2562] GPSD_JSON clock: fix build issues with solaris (asprintf(),isfinite())
+
+ ChangeLog@1.1431.1.1 +1 -0
+ [Bug 2562] GPSD_JSON clock: fix build issues with solaris (asprintf(),isfinite())
+
+ ntpd/refclock_gpsdjson.c@1.7 +40 -14
+ [Bug 2562] GPSD_JSON clock: fix build issues with solaris (asprintf(),isfinite())
+
+ChangeSet@1.3103.1.1, 2014-03-01 11:52:12+00:00, perlinger@psp-deb1.ntp.org
+ [Bug 2570] add signature check when reading leapseconds file
+
+ ChangeLog@1.1432.1.1 +1 -0
+ [Bug 2570] add signature check when reading leapseconds file
+
+ libntp/Makefile.am@1.71.1.1 +1 -0
+ [Bug 2570] add signature check when reading leapseconds file
+ - include isc/sha1.c in build
+
+ ntpd/ntp_leapsec.c@1.4.1.1 +141 -1
+ [Bug 2570] add signature check when reading leapseconds file
+ - add support functions and plumbing
+
+ ntpd/ntp_leapsec.h@1.3.1.1 +14 -1
+ [Bug 2570] add signature check when reading leapseconds file
+ - define hash validation result definitions
+ - provide argument how to handle validation results
+
+
+ ntpd/ntp_util.c@1.106.1.1 +10 -2
+ [Bug 2570] add signature check when reading leapseconds file
+ - hardwired refusal of files with bad signature (no signature is OK!)
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.47.1.1 +7 -3
+ [Bug 2570] add signature check when reading leapseconds file
+ - include isc/sha1.c in build
+
+ tests/ntpd/leapsec.cpp@1.4.1.1 +114 -1
+ [Bug 2570] add signature check when reading leapseconds file
+ - Add test cases for good/missing/bad/malformed SHA1 lines
+
+ChangeSet@1.3105, 2014-03-01 12:46:15+01:00, jnperlin@hydra.(none)
+ default
+
+ ntpd/ntp_util.c@1.108 +10 -2
+ default
+
+ChangeSet@1.3104, 2014-03-01 11:13:10+00:00, perlinger@psp-deb1.ntp.org
+ [Bug 2570] add signature check when reading leapseconds file
+ - include isc/sha1.c in build
+
+ ChangeLog@1.1433 +1 -0
+ [Bug 2570] add signature check when reading leapseconds file
+
+ libntp/Makefile.am@1.72 +1 -0
+ [Bug 2570] add signature check when reading leapseconds file
+ - include isc/sha1.c in build
+
+ ntpd/ntp_leapsec.c@1.5 +141 -1
+ [Bug 2570] add signature check when reading leapseconds file
+ - add support functions and plumbing
+
+ ntpd/ntp_leapsec.h@1.4 +14 -1
+ [Bug 2570] add signature check when reading leapseconds file
+ - define hash validation result definitions
+ - provide argument how to handle validation results
+
+
+ ntpd/ntp_util.c@1.107 +2 -2
+ [Bug 2570] add signature check when reading leapseconds file
+ - hardwired refusal of files without good signature
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.48 +7 -3
+ [Bug 2570] add signature check when reading leapseconds file
+ - include isc/sha1.c in build
+
+ tests/ntpd/leapsec.cpp@1.5 +114 -1
+ [Bug 2570] add signature check when reading leapseconds file
+ - Add test cases for good/missing/bad/malformed SHA1 lines
+
+ChangeSet@1.3093.4.4, 2014-02-28 11:46:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P426
+ TAG: NTP_4_2_7P426
+
+ ChangeLog@1.1430.1.6 +1 -0
+ NTP_4_2_7P426
+
+ ntpd/invoke-ntp.conf.texi@1.104 +1 -1
+ NTP_4_2_7P426
+
+ ntpd/invoke-ntp.keys.texi@1.102 +1 -1
+ NTP_4_2_7P426
+
+ ntpd/invoke-ntpd.texi@1.418 +2 -2
+ NTP_4_2_7P426
+
+ ntpd/ntp.conf.5man@1.138 +14 -14
+ NTP_4_2_7P426
+
+ ntpd/ntp.conf.5mdoc@1.138 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntp.conf.html@1.99 +1 -1
+ NTP_4_2_7P426
+
+ ntpd/ntp.conf.man.in@1.138 +14 -14
+ NTP_4_2_7P426
+
+ ntpd/ntp.conf.mdoc.in@1.138 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntp.keys.5man@1.136 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntp.keys.5mdoc@1.136 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntp.keys.html@1.100 +1 -1
+ NTP_4_2_7P426
+
+ ntpd/ntp.keys.man.in@1.136 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntp.keys.mdoc.in@1.136 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntpd-opts.c@1.436 +7 -7
+ NTP_4_2_7P426
+
+ ntpd/ntpd-opts.h@1.436 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntpd.1ntpdman@1.247 +7 -7
+ NTP_4_2_7P426
+
+ ntpd/ntpd.1ntpdmdoc@1.247 +3 -3
+ NTP_4_2_7P426
+
+ ntpd/ntpd.html@1.94 +2 -2
+ NTP_4_2_7P426
+
+ ntpd/ntpd.man.in@1.247 +7 -7
+ NTP_4_2_7P426
+
+ ntpd/ntpd.mdoc.in@1.247 +3 -3
+ NTP_4_2_7P426
+
+ ntpdc/invoke-ntpdc.texi@1.416 +2 -2
+ NTP_4_2_7P426
+
+ ntpdc/ntpdc-opts.c@1.431 +7 -7
+ NTP_4_2_7P426
+
+ ntpdc/ntpdc-opts.h@1.431 +3 -3
+ NTP_4_2_7P426
+
+ ntpdc/ntpdc.1ntpdcman@1.247 +13 -13
+ NTP_4_2_7P426
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.247 +2 -2
+ NTP_4_2_7P426
+
+ ntpdc/ntpdc.html@1.260 +2 -2
+ NTP_4_2_7P426
+
+ ntpdc/ntpdc.man.in@1.247 +13 -13
+ NTP_4_2_7P426
+
+ ntpdc/ntpdc.mdoc.in@1.247 +2 -2
+ NTP_4_2_7P426
+
+ ntpq/invoke-ntpq.texi@1.419 +2 -2
+ NTP_4_2_7P426
+
+ ntpq/ntpq-opts.c@1.433 +7 -7
+ NTP_4_2_7P426
+
+ ntpq/ntpq-opts.h@1.433 +3 -3
+ NTP_4_2_7P426
+
+ ntpq/ntpq.1ntpqman@1.247 +13 -13
+ NTP_4_2_7P426
+
+ ntpq/ntpq.1ntpqmdoc@1.247 +2 -2
+ NTP_4_2_7P426
+
+ ntpq/ntpq.html@1.91 +2 -2
+ NTP_4_2_7P426
+
+ ntpq/ntpq.man.in@1.247 +13 -13
+ NTP_4_2_7P426
+
+ ntpq/ntpq.mdoc.in@1.247 +2 -2
+ NTP_4_2_7P426
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.418 +2 -2
+ NTP_4_2_7P426
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.433 +7 -7
+ NTP_4_2_7P426
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.433 +3 -3
+ NTP_4_2_7P426
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.247 +7 -7
+ NTP_4_2_7P426
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.247 +3 -3
+ NTP_4_2_7P426
+
+ ntpsnmpd/ntpsnmpd.html@1.89 +1 -1
+ NTP_4_2_7P426
+
+ ntpsnmpd/ntpsnmpd.man.in@1.247 +7 -7
+ NTP_4_2_7P426
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.247 +3 -3
+ NTP_4_2_7P426
+
+ packageinfo.sh@1.430 +1 -1
+ NTP_4_2_7P426
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.9 +13 -13
+ NTP_4_2_7P426
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.9 +2 -2
+ NTP_4_2_7P426
+
+ scripts/calc_tickadj/calc_tickadj.html@1.8 +1 -1
+ NTP_4_2_7P426
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.8 +13 -13
+ NTP_4_2_7P426
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P426
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.10 +1 -1
+ NTP_4_2_7P426
+
+ scripts/invoke-plot_summary.texi@1.27 +1 -1
+ NTP_4_2_7P426
+
+ scripts/invoke-summary.texi@1.27 +1 -1
+ NTP_4_2_7P426
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.236 +1 -1
+ NTP_4_2_7P426
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.237 +6 -6
+ NTP_4_2_7P426
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.237 +2 -2
+ NTP_4_2_7P426
+
+ scripts/ntp-wait/ntp-wait.html@1.253 +1 -1
+ NTP_4_2_7P426
+
+ scripts/ntp-wait/ntp-wait.man.in@1.237 +6 -6
+ NTP_4_2_7P426
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.237 +2 -2
+ NTP_4_2_7P426
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.25 +1 -1
+ NTP_4_2_7P426
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.16 +6 -6
+ NTP_4_2_7P426
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.16 +2 -2
+ NTP_4_2_7P426
+
+ scripts/ntpsweep/ntpsweep.html@1.26 +1 -1
+ NTP_4_2_7P426
+
+ scripts/ntpsweep/ntpsweep.man.in@1.16 +6 -6
+ NTP_4_2_7P426
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P426
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.25 +1 -1
+ NTP_4_2_7P426
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.16 +13 -13
+ NTP_4_2_7P426
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.16 +2 -2
+ NTP_4_2_7P426
+
+ scripts/ntptrace/ntptrace.html@1.26 +1 -1
+ NTP_4_2_7P426
+
+ scripts/ntptrace/ntptrace.man.in@1.16 +13 -13
+ NTP_4_2_7P426
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P426
+
+ scripts/plot_summary.1plot_summaryman@1.27 +6 -6
+ NTP_4_2_7P426
+
+ scripts/plot_summary.1plot_summarymdoc@1.27 +2 -2
+ NTP_4_2_7P426
+
+ scripts/plot_summary.html@1.27 +1 -1
+ NTP_4_2_7P426
+
+ scripts/plot_summary.man.in@1.27 +6 -6
+ NTP_4_2_7P426
+
+ scripts/plot_summary.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P426
+
+ scripts/summary.1summaryman@1.27 +6 -6
+ NTP_4_2_7P426
+
+ scripts/summary.1summarymdoc@1.27 +2 -2
+ NTP_4_2_7P426
+
+ scripts/summary.html@1.27 +1 -1
+ NTP_4_2_7P426
+
+ scripts/summary.man.in@1.27 +6 -6
+ NTP_4_2_7P426
+
+ scripts/summary.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P426
+
+ sntp/invoke-sntp.texi@1.415 +2 -2
+ NTP_4_2_7P426
+
+ sntp/sntp-opts.c@1.430 +7 -7
+ NTP_4_2_7P426
+
+ sntp/sntp-opts.h@1.430 +3 -3
+ NTP_4_2_7P426
+
+ sntp/sntp.1sntpman@1.250 +7 -7
+ NTP_4_2_7P426
+
+ sntp/sntp.1sntpmdoc@1.250 +3 -3
+ NTP_4_2_7P426
+
+ sntp/sntp.html@1.430 +2 -2
+ NTP_4_2_7P426
+
+ sntp/sntp.man.in@1.250 +7 -7
+ NTP_4_2_7P426
+
+ sntp/sntp.mdoc.in@1.250 +3 -3
+ NTP_4_2_7P426
+
+ util/invoke-ntp-keygen.texi@1.419 +2 -2
+ NTP_4_2_7P426
+
+ util/ntp-keygen-opts.c@1.433 +7 -7
+ NTP_4_2_7P426
+
+ util/ntp-keygen-opts.h@1.433 +3 -3
+ NTP_4_2_7P426
+
+ util/ntp-keygen.1ntp-keygenman@1.247 +1250 -0
+ NTP_4_2_7P426
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.247 +3 -3
+ NTP_4_2_7P426
+
+ util/ntp-keygen.html@1.95 +2 -2
+ NTP_4_2_7P426
+
+ util/ntp-keygen.man.in@1.247 +1250 -0
+ NTP_4_2_7P426
+
+ util/ntp-keygen.mdoc.in@1.247 +3 -3
+ NTP_4_2_7P426
+
+ChangeSet@1.3093.4.3, 2014-02-28 06:24:16-05:00, stenn@deacon.udel.edu
+ test -nt is not portable
+
+ bootstrap@1.46 +7 -2
+ test -nt is not portable
+
+ChangeSet@1.3093.4.2, 2014-02-28 04:20:55-05:00, stenn@deacon.udel.edu
+ [Bug 2561] Allow wildcards in the target of the "interface" command
+
+ ntpd/ntp_io.c@1.391 +4 -1
+ [Bug 2561] Allow wildcards in the target of the "interface" command
+
+ChangeSet@1.3093.4.1, 2014-02-28 08:14:13+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2572] cross-compiling fails for --with-yielding_select
+
+ ChangeLog@1.1430.1.5 +1 -0
+ [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups
+
+ ChangeLog@1.1430.1.4 +1 -0
+ [Bug 2572] cross-compiling fails for --with-yielding_select
+
+ bootstrap@1.45 +3 -0
+ [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups.
+
+ sntp/libevent/m4/openldap-thread-check.m4@1.2 +1 -1
+ [Bug 2572] cross-compiling fails for --with-yielding_select
+
+ChangeSet@1.3093.3.2, 2014-02-27 23:55:28-08:00, harlan@hms-mbp11.local
+ test SCCS date/time keyword expansion for html files
+
+ html/extern.html@1.18 +0 -0
+ Turn on SCCS flag
+
+ChangeSet@1.3093.1.10, 2014-02-28 02:29:49-05:00, stenn@deacon.udel.edu
+ [Bug 2113] Warn about ignored extra args in ntpq
+
+ ChangeLog@1.1430.1.3 +1 -0
+ [Bug 2113] Warn about ignored extra args in ntpq
+
+ ntpq/ntpq-subs.c@1.99 +7 -3
+ [Bug 2113] Warn about ignored extra args in ntpq
+
+ChangeSet@1.3093.3.1, 2014-02-27 22:53:21-08:00, harlan@hms-mbp11.local
+ test bk keyword expansion
+
+ html/extern.html@1.17 +1 -1
+ test bk keyword expansion
+
+ChangeSet@1.3093.2.1, 2014-02-28 06:37:01+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2561] Allow wildcards in the target of the "interface" command
+
+ ChangeLog@1.1425.1.1 +1 -0
+ [Bug 2561] Allow wildcards in the target of the "interface" command
+
+ configure.ac@1.571.1.2 +2 -2
+ [Bug 2561] Allow wildcards in the target of the "interface" command
+
+ ntpd/ntp_io.c@1.390 +9 -1
+ [Bug 2561] Allow wildcards in the target of the "interface" command
+
+ChangeSet@1.3093.1.8, 2014-02-26 10:06:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P425
+ TAG: NTP_4_2_7P425
+
+ ChangeLog@1.1430.1.1 +1 -0
+ NTP_4_2_7P425
+
+ ntpd/invoke-ntp.conf.texi@1.103 +1 -1
+ NTP_4_2_7P425
+
+ ntpd/invoke-ntp.keys.texi@1.101 +1 -1
+ NTP_4_2_7P425
+
+ ntpd/invoke-ntpd.texi@1.417 +2 -2
+ NTP_4_2_7P425
+
+ ntpd/ntp.conf.5man@1.137 +7 -7
+ NTP_4_2_7P425
+
+ ntpd/ntp.conf.5mdoc@1.137 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntp.conf.html@1.98 +1 -1
+ NTP_4_2_7P425
+
+ ntpd/ntp.conf.man.in@1.137 +7 -7
+ NTP_4_2_7P425
+
+ ntpd/ntp.conf.mdoc.in@1.137 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntp.keys.5man@1.135 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntp.keys.5mdoc@1.135 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntp.keys.html@1.99 +1 -1
+ NTP_4_2_7P425
+
+ ntpd/ntp.keys.man.in@1.135 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntp.keys.mdoc.in@1.135 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntpd-opts.c@1.435 +7 -7
+ NTP_4_2_7P425
+
+ ntpd/ntpd-opts.h@1.435 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntpd.1ntpdman@1.246 +7 -7
+ NTP_4_2_7P425
+
+ ntpd/ntpd.1ntpdmdoc@1.246 +3 -3
+ NTP_4_2_7P425
+
+ ntpd/ntpd.html@1.93 +2 -2
+ NTP_4_2_7P425
+
+ ntpd/ntpd.man.in@1.246 +7 -7
+ NTP_4_2_7P425
+
+ ntpd/ntpd.mdoc.in@1.246 +3 -3
+ NTP_4_2_7P425
+
+ ntpdc/invoke-ntpdc.texi@1.415 +2 -2
+ NTP_4_2_7P425
+
+ ntpdc/ntpdc-opts.c@1.430 +7 -7
+ NTP_4_2_7P425
+
+ ntpdc/ntpdc-opts.h@1.430 +3 -3
+ NTP_4_2_7P425
+
+ ntpdc/ntpdc.1ntpdcman@1.246 +6 -6
+ NTP_4_2_7P425
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.246 +2 -2
+ NTP_4_2_7P425
+
+ ntpdc/ntpdc.html@1.259 +2 -2
+ NTP_4_2_7P425
+
+ ntpdc/ntpdc.man.in@1.246 +6 -6
+ NTP_4_2_7P425
+
+ ntpdc/ntpdc.mdoc.in@1.246 +2 -2
+ NTP_4_2_7P425
+
+ ntpq/invoke-ntpq.texi@1.418 +2 -2
+ NTP_4_2_7P425
+
+ ntpq/ntpq-opts.c@1.432 +7 -7
+ NTP_4_2_7P425
+
+ ntpq/ntpq-opts.h@1.432 +3 -3
+ NTP_4_2_7P425
+
+ ntpq/ntpq.1ntpqman@1.246 +6 -6
+ NTP_4_2_7P425
+
+ ntpq/ntpq.1ntpqmdoc@1.246 +2 -2
+ NTP_4_2_7P425
+
+ ntpq/ntpq.html@1.90 +2 -2
+ NTP_4_2_7P425
+
+ ntpq/ntpq.man.in@1.246 +6 -6
+ NTP_4_2_7P425
+
+ ntpq/ntpq.mdoc.in@1.246 +2 -2
+ NTP_4_2_7P425
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.417 +2 -2
+ NTP_4_2_7P425
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.432 +7 -7
+ NTP_4_2_7P425
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.432 +3 -3
+ NTP_4_2_7P425
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.246 +7 -7
+ NTP_4_2_7P425
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.246 +3 -3
+ NTP_4_2_7P425
+
+ ntpsnmpd/ntpsnmpd.html@1.88 +1 -1
+ NTP_4_2_7P425
+
+ ntpsnmpd/ntpsnmpd.man.in@1.246 +7 -7
+ NTP_4_2_7P425
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.246 +3 -3
+ NTP_4_2_7P425
+
+ packageinfo.sh@1.429 +1 -1
+ NTP_4_2_7P425
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.8 +13 -13
+ NTP_4_2_7P425
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.8 +2 -2
+ NTP_4_2_7P425
+
+ scripts/calc_tickadj/calc_tickadj.html@1.7 +1 -1
+ NTP_4_2_7P425
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.7 +13 -13
+ NTP_4_2_7P425
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P425
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.9 +1 -1
+ NTP_4_2_7P425
+
+ scripts/invoke-plot_summary.texi@1.26 +1 -1
+ NTP_4_2_7P425
+
+ scripts/invoke-summary.texi@1.26 +1 -1
+ NTP_4_2_7P425
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.235 +1 -1
+ NTP_4_2_7P425
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.236 +6 -6
+ NTP_4_2_7P425
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.236 +2 -2
+ NTP_4_2_7P425
+
+ scripts/ntp-wait/ntp-wait.html@1.252 +1 -1
+ NTP_4_2_7P425
+
+ scripts/ntp-wait/ntp-wait.man.in@1.236 +6 -6
+ NTP_4_2_7P425
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.236 +2 -2
+ NTP_4_2_7P425
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.24 +1 -1
+ NTP_4_2_7P425
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.15 +6 -6
+ NTP_4_2_7P425
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.15 +2 -2
+ NTP_4_2_7P425
+
+ scripts/ntpsweep/ntpsweep.html@1.25 +1 -1
+ NTP_4_2_7P425
+
+ scripts/ntpsweep/ntpsweep.man.in@1.15 +6 -6
+ NTP_4_2_7P425
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P425
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.24 +1 -1
+ NTP_4_2_7P425
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.15 +6 -6
+ NTP_4_2_7P425
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.15 +2 -2
+ NTP_4_2_7P425
+
+ scripts/ntptrace/ntptrace.html@1.25 +1 -1
+ NTP_4_2_7P425
+
+ scripts/ntptrace/ntptrace.man.in@1.15 +6 -6
+ NTP_4_2_7P425
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P425
+
+ scripts/plot_summary.1plot_summaryman@1.26 +6 -6
+ NTP_4_2_7P425
+
+ scripts/plot_summary.1plot_summarymdoc@1.26 +2 -2
+ NTP_4_2_7P425
+
+ scripts/plot_summary.html@1.26 +1 -1
+ NTP_4_2_7P425
+
+ scripts/plot_summary.man.in@1.26 +6 -6
+ NTP_4_2_7P425
+
+ scripts/plot_summary.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P425
+
+ scripts/summary.1summaryman@1.26 +6 -6
+ NTP_4_2_7P425
+
+ scripts/summary.1summarymdoc@1.26 +2 -2
+ NTP_4_2_7P425
+
+ scripts/summary.html@1.26 +1 -1
+ NTP_4_2_7P425
+
+ scripts/summary.man.in@1.26 +6 -6
+ NTP_4_2_7P425
+
+ scripts/summary.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P425
+
+ sntp/invoke-sntp.texi@1.414 +2 -2
+ NTP_4_2_7P425
+
+ sntp/sntp-opts.c@1.429 +7 -7
+ NTP_4_2_7P425
+
+ sntp/sntp-opts.h@1.429 +3 -3
+ NTP_4_2_7P425
+
+ sntp/sntp.1sntpman@1.249 +7 -7
+ NTP_4_2_7P425
+
+ sntp/sntp.1sntpmdoc@1.249 +3 -3
+ NTP_4_2_7P425
+
+ sntp/sntp.html@1.429 +2 -2
+ NTP_4_2_7P425
+
+ sntp/sntp.man.in@1.249 +7 -7
+ NTP_4_2_7P425
+
+ sntp/sntp.mdoc.in@1.249 +3 -3
+ NTP_4_2_7P425
+
+ util/invoke-ntp-keygen.texi@1.418 +2 -2
+ NTP_4_2_7P425
+
+ util/ntp-keygen-opts.c@1.432 +7 -7
+ NTP_4_2_7P425
+
+ util/ntp-keygen-opts.h@1.432 +3 -3
+ NTP_4_2_7P425
+
+ util/ntp-keygen.1ntp-keygenman@1.246 +0 -1250
+ NTP_4_2_7P425
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.246 +3 -3
+ NTP_4_2_7P425
+
+ util/ntp-keygen.html@1.94 +2 -2
+ NTP_4_2_7P425
+
+ util/ntp-keygen.man.in@1.246 +0 -1250
+ NTP_4_2_7P425
+
+ util/ntp-keygen.mdoc.in@1.246 +3 -3
+ NTP_4_2_7P425
+
+ChangeSet@1.3102, 2014-02-25 21:26:28+01:00, jnperlin@hydra.(none)
+ [Bug 2562] first release of the GPSD client clock (type 46)
+
+ ChangeLog@1.1431 +1 -0
+ [Bug 2562] first release of the GPSD client clock (type 46)
+
+ChangeSet@1.3093.1.7, 2014-02-25 01:36:30-05:00, stenn@deacon.udel.edu
+ Copyright file update
+
+ ChangeLog@1.1430 +1 -0
+ Copyright file update
+
+ html/copyright.html@1.62 +1 -0
+ Copyright file update
+
+ChangeSet@1.3093.1.6, 2014-02-24 05:59:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P424
+ TAG: NTP_4_2_7P424
+
+ ChangeLog@1.1429 +1 -0
+ NTP_4_2_7P424
+
+ ntpd/invoke-ntp.conf.texi@1.102 +1 -1
+ NTP_4_2_7P424
+
+ ntpd/invoke-ntp.keys.texi@1.100 +1 -1
+ NTP_4_2_7P424
+
+ ntpd/invoke-ntpd.texi@1.416 +2 -2
+ NTP_4_2_7P424
+
+ ntpd/ntp.conf.5man@1.136 +7 -7
+ NTP_4_2_7P424
+
+ ntpd/ntp.conf.5mdoc@1.136 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntp.conf.html@1.97 +1 -1
+ NTP_4_2_7P424
+
+ ntpd/ntp.conf.man.in@1.136 +7 -7
+ NTP_4_2_7P424
+
+ ntpd/ntp.conf.mdoc.in@1.136 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntp.keys.5man@1.134 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntp.keys.5mdoc@1.134 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntp.keys.html@1.98 +1 -1
+ NTP_4_2_7P424
+
+ ntpd/ntp.keys.man.in@1.134 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntp.keys.mdoc.in@1.134 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntpd-opts.c@1.434 +7 -7
+ NTP_4_2_7P424
+
+ ntpd/ntpd-opts.h@1.434 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntpd.1ntpdman@1.245 +7 -7
+ NTP_4_2_7P424
+
+ ntpd/ntpd.1ntpdmdoc@1.245 +3 -3
+ NTP_4_2_7P424
+
+ ntpd/ntpd.html@1.92 +2 -2
+ NTP_4_2_7P424
+
+ ntpd/ntpd.man.in@1.245 +7 -7
+ NTP_4_2_7P424
+
+ ntpd/ntpd.mdoc.in@1.245 +3 -3
+ NTP_4_2_7P424
+
+ ntpdc/invoke-ntpdc.texi@1.414 +2 -2
+ NTP_4_2_7P424
+
+ ntpdc/ntpdc-opts.c@1.429 +7 -7
+ NTP_4_2_7P424
+
+ ntpdc/ntpdc-opts.h@1.429 +3 -3
+ NTP_4_2_7P424
+
+ ntpdc/ntpdc.1ntpdcman@1.245 +6 -6
+ NTP_4_2_7P424
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.245 +2 -2
+ NTP_4_2_7P424
+
+ ntpdc/ntpdc.html@1.258 +2 -2
+ NTP_4_2_7P424
+
+ ntpdc/ntpdc.man.in@1.245 +6 -6
+ NTP_4_2_7P424
+
+ ntpdc/ntpdc.mdoc.in@1.245 +2 -2
+ NTP_4_2_7P424
+
+ ntpq/invoke-ntpq.texi@1.417 +2 -2
+ NTP_4_2_7P424
+
+ ntpq/ntpq-opts.c@1.431 +7 -7
+ NTP_4_2_7P424
+
+ ntpq/ntpq-opts.h@1.431 +3 -3
+ NTP_4_2_7P424
+
+ ntpq/ntpq.1ntpqman@1.245 +6 -6
+ NTP_4_2_7P424
+
+ ntpq/ntpq.1ntpqmdoc@1.245 +2 -2
+ NTP_4_2_7P424
+
+ ntpq/ntpq.html@1.89 +2 -2
+ NTP_4_2_7P424
+
+ ntpq/ntpq.man.in@1.245 +6 -6
+ NTP_4_2_7P424
+
+ ntpq/ntpq.mdoc.in@1.245 +2 -2
+ NTP_4_2_7P424
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.416 +2 -2
+ NTP_4_2_7P424
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.431 +7 -7
+ NTP_4_2_7P424
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.431 +3 -3
+ NTP_4_2_7P424
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.245 +235 -0
+ NTP_4_2_7P424
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.245 +3 -3
+ NTP_4_2_7P424
+
+ ntpsnmpd/ntpsnmpd.html@1.87 +1 -1
+ NTP_4_2_7P424
+
+ ntpsnmpd/ntpsnmpd.man.in@1.245 +235 -0
+ NTP_4_2_7P424
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.245 +3 -3
+ NTP_4_2_7P424
+
+ packageinfo.sh@1.428 +1 -1
+ NTP_4_2_7P424
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.7 +6 -6
+ NTP_4_2_7P424
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.7 +2 -2
+ NTP_4_2_7P424
+
+ scripts/calc_tickadj/calc_tickadj.html@1.6 +1 -1
+ NTP_4_2_7P424
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.6 +6 -6
+ NTP_4_2_7P424
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P424
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.8 +1 -1
+ NTP_4_2_7P424
+
+ scripts/invoke-plot_summary.texi@1.25 +1 -1
+ NTP_4_2_7P424
+
+ scripts/invoke-summary.texi@1.25 +1 -1
+ NTP_4_2_7P424
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.234 +1 -1
+ NTP_4_2_7P424
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.235 +6 -6
+ NTP_4_2_7P424
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.235 +2 -2
+ NTP_4_2_7P424
+
+ scripts/ntp-wait/ntp-wait.html@1.251 +1 -1
+ NTP_4_2_7P424
+
+ scripts/ntp-wait/ntp-wait.man.in@1.235 +6 -6
+ NTP_4_2_7P424
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.235 +2 -2
+ NTP_4_2_7P424
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.23 +1 -1
+ NTP_4_2_7P424
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.14 +6 -6
+ NTP_4_2_7P424
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.14 +2 -2
+ NTP_4_2_7P424
+
+ scripts/ntpsweep/ntpsweep.html@1.24 +1 -1
+ NTP_4_2_7P424
+
+ scripts/ntpsweep/ntpsweep.man.in@1.14 +6 -6
+ NTP_4_2_7P424
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P424
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.23 +1 -1
+ NTP_4_2_7P424
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.14 +6 -6
+ NTP_4_2_7P424
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.14 +2 -2
+ NTP_4_2_7P424
+
+ scripts/ntptrace/ntptrace.html@1.24 +1 -1
+ NTP_4_2_7P424
+
+ scripts/ntptrace/ntptrace.man.in@1.14 +6 -6
+ NTP_4_2_7P424
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P424
+
+ scripts/plot_summary.1plot_summaryman@1.25 +6 -6
+ NTP_4_2_7P424
+
+ scripts/plot_summary.1plot_summarymdoc@1.25 +2 -2
+ NTP_4_2_7P424
+
+ scripts/plot_summary.html@1.25 +1 -1
+ NTP_4_2_7P424
+
+ scripts/plot_summary.man.in@1.25 +6 -6
+ NTP_4_2_7P424
+
+ scripts/plot_summary.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P424
+
+ scripts/summary.1summaryman@1.25 +6 -6
+ NTP_4_2_7P424
+
+ scripts/summary.1summarymdoc@1.25 +2 -2
+ NTP_4_2_7P424
+
+ scripts/summary.html@1.25 +1 -1
+ NTP_4_2_7P424
+
+ scripts/summary.man.in@1.25 +6 -6
+ NTP_4_2_7P424
+
+ scripts/summary.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P424
+
+ sntp/invoke-sntp.texi@1.413 +2 -2
+ NTP_4_2_7P424
+
+ sntp/sntp-opts.c@1.428 +7 -7
+ NTP_4_2_7P424
+
+ sntp/sntp-opts.h@1.428 +3 -3
+ NTP_4_2_7P424
+
+ sntp/sntp.1sntpman@1.248 +7 -7
+ NTP_4_2_7P424
+
+ sntp/sntp.1sntpmdoc@1.248 +3 -3
+ NTP_4_2_7P424
+
+ sntp/sntp.html@1.428 +2 -2
+ NTP_4_2_7P424
+
+ sntp/sntp.man.in@1.248 +7 -7
+ NTP_4_2_7P424
+
+ sntp/sntp.mdoc.in@1.248 +3 -3
+ NTP_4_2_7P424
+
+ util/invoke-ntp-keygen.texi@1.417 +2 -2
+ NTP_4_2_7P424
+
+ util/ntp-keygen-opts.c@1.431 +7 -7
+ NTP_4_2_7P424
+
+ util/ntp-keygen-opts.h@1.431 +3 -3
+ NTP_4_2_7P424
+
+ util/ntp-keygen.1ntp-keygenman@1.245 +7 -7
+ NTP_4_2_7P424
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.245 +3 -3
+ NTP_4_2_7P424
+
+ util/ntp-keygen.html@1.93 +2 -2
+ NTP_4_2_7P424
+
+ util/ntp-keygen.man.in@1.245 +7 -7
+ NTP_4_2_7P424
+
+ util/ntp-keygen.mdoc.in@1.245 +3 -3
+ NTP_4_2_7P424
+
+ChangeSet@1.3093.1.5, 2014-02-23 18:25:43-05:00, stenn@deacon.udel.edu
+ [Bug 2541] ntpd terminates itself with SIGHUP unexpectedly
+
+ ChangeLog@1.1428 +1 -0
+ [Bug 2541] ntpd terminates itself with SIGHUP unexpectedly
+
+ libntp/work_fork.c@1.12 +3 -1
+ [Bug 2541] ntpd terminates itself with SIGHUP unexpectedly
+
+ChangeSet@1.3093.1.4, 2014-02-23 22:59:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P423
+ TAG: NTP_4_2_7P423
+
+ ChangeLog@1.1427 +1 -0
+ NTP_4_2_7P423
+
+ ntpd/invoke-ntp.conf.texi@1.101 +1 -1
+ NTP_4_2_7P423
+
+ ntpd/invoke-ntp.keys.texi@1.99 +1 -1
+ NTP_4_2_7P423
+
+ ntpd/invoke-ntpd.texi@1.415 +2 -2
+ NTP_4_2_7P423
+
+ ntpd/ntp.conf.5man@1.135 +7 -7
+ NTP_4_2_7P423
+
+ ntpd/ntp.conf.5mdoc@1.135 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntp.conf.html@1.96 +1 -1
+ NTP_4_2_7P423
+
+ ntpd/ntp.conf.man.in@1.135 +7 -7
+ NTP_4_2_7P423
+
+ ntpd/ntp.conf.mdoc.in@1.135 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntp.keys.5man@1.133 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntp.keys.5mdoc@1.133 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntp.keys.html@1.97 +1 -1
+ NTP_4_2_7P423
+
+ ntpd/ntp.keys.man.in@1.133 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntp.keys.mdoc.in@1.133 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntpd-opts.c@1.433 +7 -7
+ NTP_4_2_7P423
+
+ ntpd/ntpd-opts.h@1.433 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntpd.1ntpdman@1.244 +7 -7
+ NTP_4_2_7P423
+
+ ntpd/ntpd.1ntpdmdoc@1.244 +3 -3
+ NTP_4_2_7P423
+
+ ntpd/ntpd.html@1.91 +2 -2
+ NTP_4_2_7P423
+
+ ntpd/ntpd.man.in@1.244 +7 -7
+ NTP_4_2_7P423
+
+ ntpd/ntpd.mdoc.in@1.244 +3 -3
+ NTP_4_2_7P423
+
+ ntpdc/invoke-ntpdc.texi@1.413 +2 -2
+ NTP_4_2_7P423
+
+ ntpdc/ntpdc-opts.c@1.428 +7 -7
+ NTP_4_2_7P423
+
+ ntpdc/ntpdc-opts.h@1.428 +3 -3
+ NTP_4_2_7P423
+
+ ntpdc/ntpdc.1ntpdcman@1.244 +6 -6
+ NTP_4_2_7P423
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.244 +2 -2
+ NTP_4_2_7P423
+
+ ntpdc/ntpdc.html@1.257 +2 -2
+ NTP_4_2_7P423
+
+ ntpdc/ntpdc.man.in@1.244 +6 -6
+ NTP_4_2_7P423
+
+ ntpdc/ntpdc.mdoc.in@1.244 +2 -2
+ NTP_4_2_7P423
+
+ ntpq/invoke-ntpq.texi@1.416 +2 -2
+ NTP_4_2_7P423
+
+ ntpq/ntpq-opts.c@1.430 +7 -7
+ NTP_4_2_7P423
+
+ ntpq/ntpq-opts.h@1.430 +3 -3
+ NTP_4_2_7P423
+
+ ntpq/ntpq.1ntpqman@1.244 +6 -6
+ NTP_4_2_7P423
+
+ ntpq/ntpq.1ntpqmdoc@1.244 +2 -2
+ NTP_4_2_7P423
+
+ ntpq/ntpq.html@1.88 +2 -2
+ NTP_4_2_7P423
+
+ ntpq/ntpq.man.in@1.244 +6 -6
+ NTP_4_2_7P423
+
+ ntpq/ntpq.mdoc.in@1.244 +2 -2
+ NTP_4_2_7P423
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.415 +2 -2
+ NTP_4_2_7P423
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.430 +7 -7
+ NTP_4_2_7P423
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.430 +3 -3
+ NTP_4_2_7P423
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.244 +0 -235
+ NTP_4_2_7P423
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.244 +3 -3
+ NTP_4_2_7P423
+
+ ntpsnmpd/ntpsnmpd.html@1.86 +1 -1
+ NTP_4_2_7P423
+
+ ntpsnmpd/ntpsnmpd.man.in@1.244 +0 -235
+ NTP_4_2_7P423
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.244 +3 -3
+ NTP_4_2_7P423
+
+ packageinfo.sh@1.427 +1 -1
+ NTP_4_2_7P423
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.6 +6 -6
+ NTP_4_2_7P423
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.6 +2 -2
+ NTP_4_2_7P423
+
+ scripts/calc_tickadj/calc_tickadj.html@1.5 +1 -1
+ NTP_4_2_7P423
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.5 +6 -6
+ NTP_4_2_7P423
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P423
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.7 +1 -1
+ NTP_4_2_7P423
+
+ scripts/invoke-plot_summary.texi@1.24 +1 -1
+ NTP_4_2_7P423
+
+ scripts/invoke-summary.texi@1.24 +1 -1
+ NTP_4_2_7P423
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.233 +1 -1
+ NTP_4_2_7P423
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.234 +6 -6
+ NTP_4_2_7P423
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.234 +2 -2
+ NTP_4_2_7P423
+
+ scripts/ntp-wait/ntp-wait.html@1.250 +1 -1
+ NTP_4_2_7P423
+
+ scripts/ntp-wait/ntp-wait.man.in@1.234 +6 -6
+ NTP_4_2_7P423
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.234 +2 -2
+ NTP_4_2_7P423
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.22 +1 -1
+ NTP_4_2_7P423
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.13 +6 -6
+ NTP_4_2_7P423
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.13 +2 -2
+ NTP_4_2_7P423
+
+ scripts/ntpsweep/ntpsweep.html@1.23 +1 -1
+ NTP_4_2_7P423
+
+ scripts/ntpsweep/ntpsweep.man.in@1.13 +6 -6
+ NTP_4_2_7P423
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.14 +2 -2
+ NTP_4_2_7P423
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.22 +1 -1
+ NTP_4_2_7P423
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.13 +6 -6
+ NTP_4_2_7P423
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.13 +2 -2
+ NTP_4_2_7P423
+
+ scripts/ntptrace/ntptrace.html@1.23 +1 -1
+ NTP_4_2_7P423
+
+ scripts/ntptrace/ntptrace.man.in@1.13 +6 -6
+ NTP_4_2_7P423
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.14 +2 -2
+ NTP_4_2_7P423
+
+ scripts/plot_summary.1plot_summaryman@1.24 +6 -6
+ NTP_4_2_7P423
+
+ scripts/plot_summary.1plot_summarymdoc@1.24 +2 -2
+ NTP_4_2_7P423
+
+ scripts/plot_summary.html@1.24 +1 -1
+ NTP_4_2_7P423
+
+ scripts/plot_summary.man.in@1.24 +6 -6
+ NTP_4_2_7P423
+
+ scripts/plot_summary.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P423
+
+ scripts/summary.1summaryman@1.24 +6 -6
+ NTP_4_2_7P423
+
+ scripts/summary.1summarymdoc@1.24 +2 -2
+ NTP_4_2_7P423
+
+ scripts/summary.html@1.24 +1 -1
+ NTP_4_2_7P423
+
+ scripts/summary.man.in@1.24 +6 -6
+ NTP_4_2_7P423
+
+ scripts/summary.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P423
+
+ sntp/invoke-sntp.texi@1.412 +2 -2
+ NTP_4_2_7P423
+
+ sntp/sntp-opts.c@1.427 +7 -7
+ NTP_4_2_7P423
+
+ sntp/sntp-opts.h@1.427 +3 -3
+ NTP_4_2_7P423
+
+ sntp/sntp.1sntpman@1.247 +7 -7
+ NTP_4_2_7P423
+
+ sntp/sntp.1sntpmdoc@1.247 +3 -3
+ NTP_4_2_7P423
+
+ sntp/sntp.html@1.427 +2 -2
+ NTP_4_2_7P423
+
+ sntp/sntp.man.in@1.247 +7 -7
+ NTP_4_2_7P423
+
+ sntp/sntp.mdoc.in@1.247 +3 -3
+ NTP_4_2_7P423
+
+ util/invoke-ntp-keygen.texi@1.416 +2 -2
+ NTP_4_2_7P423
+
+ util/ntp-keygen-opts.c@1.430 +7 -7
+ NTP_4_2_7P423
+
+ util/ntp-keygen-opts.h@1.430 +3 -3
+ NTP_4_2_7P423
+
+ util/ntp-keygen.1ntp-keygenman@1.244 +7 -7
+ NTP_4_2_7P423
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.244 +3 -3
+ NTP_4_2_7P423
+
+ util/ntp-keygen.html@1.92 +2 -2
+ NTP_4_2_7P423
+
+ util/ntp-keygen.man.in@1.244 +7 -7
+ NTP_4_2_7P423
+
+ util/ntp-keygen.mdoc.in@1.244 +3 -3
+ NTP_4_2_7P423
+
+ChangeSet@1.3093.1.3, 2014-02-22 05:25:52+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2565] Handle EINTR on getifaddrs()
+
+ ChangeLog@1.1426 +1 -0
+ [Bug 2565] Handle EINTR on getifaddrs()
+
+ lib/isc/unix/ifiter_getifaddrs.c@1.11 +18 -11
+ [Bug 2565] Handle EINTR on getifaddrs()
+
+ChangeSet@1.3100, 2014-02-20 21:22:08+01:00, jnperlin@hydra.(none)
+ refclock_gpsdjson: operation reordering (grouping) during startup
+
+ ntpd/refclock_gpsdjson.c@1.6 +5 -3
+ operation reordering (grouping) during startup
+
+ChangeSet@1.3099, 2014-02-18 21:36:24+01:00, jnperlin@hydra.(none)
+ refclock_gpsdjson: fix clock status report logic (did not work after reconnect)
+
+ ntpd/refclock_gpsdjson.c@1.5 +43 -16
+ fix clock status report logic (did not work after reconnect)
+
+ChangeSet@1.3098, 2014-02-17 19:42:56+01:00, jnperlin@hydra.(none)
+ GPSD_JSON: do not build on Win32
+
+ ntpd/refclock_conf.c@1.35 +1 -1
+ GPSD_JSON: do not build on Win32
+
+ ntpd/refclock_gpsdjson.c@1.4 +40 -30
+ GPSD_JSON: do not build on Win32 (and some typo fixing)
+
+ChangeSet@1.3093.1.2, 2014-02-17 11:39:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P422
+ TAG: NTP_4_2_7P422
+
+ ChangeLog@1.1425 +1 -0
+ NTP_4_2_7P422
+
+ ntpd/invoke-ntp.conf.texi@1.100 +1 -1
+ NTP_4_2_7P422
+
+ ntpd/invoke-ntp.keys.texi@1.98 +1 -1
+ NTP_4_2_7P422
+
+ ntpd/invoke-ntpd.texi@1.414 +2 -2
+ NTP_4_2_7P422
+
+ ntpd/ntp.conf.5man@1.134 +7 -7
+ NTP_4_2_7P422
+
+ ntpd/ntp.conf.5mdoc@1.134 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntp.conf.html@1.95 +1 -1
+ NTP_4_2_7P422
+
+ ntpd/ntp.conf.man.in@1.134 +7 -7
+ NTP_4_2_7P422
+
+ ntpd/ntp.conf.mdoc.in@1.134 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntp.keys.5man@1.132 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntp.keys.5mdoc@1.132 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntp.keys.html@1.96 +1 -1
+ NTP_4_2_7P422
+
+ ntpd/ntp.keys.man.in@1.132 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntp.keys.mdoc.in@1.132 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntpd-opts.c@1.432 +7 -7
+ NTP_4_2_7P422
+
+ ntpd/ntpd-opts.h@1.432 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntpd.1ntpdman@1.243 +7 -7
+ NTP_4_2_7P422
+
+ ntpd/ntpd.1ntpdmdoc@1.243 +3 -3
+ NTP_4_2_7P422
+
+ ntpd/ntpd.html@1.90 +2 -2
+ NTP_4_2_7P422
+
+ ntpd/ntpd.man.in@1.243 +7 -7
+ NTP_4_2_7P422
+
+ ntpd/ntpd.mdoc.in@1.243 +3 -3
+ NTP_4_2_7P422
+
+ ntpdc/invoke-ntpdc.texi@1.412 +2 -2
+ NTP_4_2_7P422
+
+ ntpdc/ntpdc-opts.c@1.427 +7 -7
+ NTP_4_2_7P422
+
+ ntpdc/ntpdc-opts.h@1.427 +3 -3
+ NTP_4_2_7P422
+
+ ntpdc/ntpdc.1ntpdcman@1.243 +6 -6
+ NTP_4_2_7P422
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.243 +2 -2
+ NTP_4_2_7P422
+
+ ntpdc/ntpdc.html@1.256 +2 -2
+ NTP_4_2_7P422
+
+ ntpdc/ntpdc.man.in@1.243 +6 -6
+ NTP_4_2_7P422
+
+ ntpdc/ntpdc.mdoc.in@1.243 +2 -2
+ NTP_4_2_7P422
+
+ ntpq/invoke-ntpq.texi@1.415 +2 -2
+ NTP_4_2_7P422
+
+ ntpq/ntpq-opts.c@1.429 +7 -7
+ NTP_4_2_7P422
+
+ ntpq/ntpq-opts.h@1.429 +3 -3
+ NTP_4_2_7P422
+
+ ntpq/ntpq.1ntpqman@1.243 +6 -6
+ NTP_4_2_7P422
+
+ ntpq/ntpq.1ntpqmdoc@1.243 +2 -2
+ NTP_4_2_7P422
+
+ ntpq/ntpq.html@1.87 +2 -2
+ NTP_4_2_7P422
+
+ ntpq/ntpq.man.in@1.243 +6 -6
+ NTP_4_2_7P422
+
+ ntpq/ntpq.mdoc.in@1.243 +2 -2
+ NTP_4_2_7P422
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.414 +2 -2
+ NTP_4_2_7P422
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.429 +7 -7
+ NTP_4_2_7P422
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.429 +3 -3
+ NTP_4_2_7P422
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.243 +7 -7
+ NTP_4_2_7P422
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.243 +3 -3
+ NTP_4_2_7P422
+
+ ntpsnmpd/ntpsnmpd.html@1.85 +1 -1
+ NTP_4_2_7P422
+
+ ntpsnmpd/ntpsnmpd.man.in@1.243 +7 -7
+ NTP_4_2_7P422
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.243 +3 -3
+ NTP_4_2_7P422
+
+ packageinfo.sh@1.426 +1 -1
+ NTP_4_2_7P422
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.5 +6 -6
+ NTP_4_2_7P422
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.5 +2 -2
+ NTP_4_2_7P422
+
+ scripts/calc_tickadj/calc_tickadj.html@1.4 +1 -1
+ NTP_4_2_7P422
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.4 +6 -6
+ NTP_4_2_7P422
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P422
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.6 +1 -1
+ NTP_4_2_7P422
+
+ scripts/invoke-plot_summary.texi@1.23 +1 -1
+ NTP_4_2_7P422
+
+ scripts/invoke-summary.texi@1.23 +1 -1
+ NTP_4_2_7P422
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.232 +1 -1
+ NTP_4_2_7P422
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.233 +6 -6
+ NTP_4_2_7P422
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.233 +2 -2
+ NTP_4_2_7P422
+
+ scripts/ntp-wait/ntp-wait.html@1.249 +1 -1
+ NTP_4_2_7P422
+
+ scripts/ntp-wait/ntp-wait.man.in@1.233 +6 -6
+ NTP_4_2_7P422
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.233 +2 -2
+ NTP_4_2_7P422
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.21 +1 -1
+ NTP_4_2_7P422
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.12 +6 -6
+ NTP_4_2_7P422
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.12 +2 -2
+ NTP_4_2_7P422
+
+ scripts/ntpsweep/ntpsweep.html@1.22 +1 -1
+ NTP_4_2_7P422
+
+ scripts/ntpsweep/ntpsweep.man.in@1.12 +6 -6
+ NTP_4_2_7P422
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P422
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.21 +1 -1
+ NTP_4_2_7P422
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.12 +6 -6
+ NTP_4_2_7P422
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.12 +2 -2
+ NTP_4_2_7P422
+
+ scripts/ntptrace/ntptrace.html@1.22 +1 -1
+ NTP_4_2_7P422
+
+ scripts/ntptrace/ntptrace.man.in@1.12 +6 -6
+ NTP_4_2_7P422
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P422
+
+ scripts/plot_summary.1plot_summaryman@1.23 +6 -6
+ NTP_4_2_7P422
+
+ scripts/plot_summary.1plot_summarymdoc@1.23 +2 -2
+ NTP_4_2_7P422
+
+ scripts/plot_summary.html@1.23 +1 -1
+ NTP_4_2_7P422
+
+ scripts/plot_summary.man.in@1.23 +6 -6
+ NTP_4_2_7P422
+
+ scripts/plot_summary.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P422
+
+ scripts/summary.1summaryman@1.23 +6 -6
+ NTP_4_2_7P422
+
+ scripts/summary.1summarymdoc@1.23 +2 -2
+ NTP_4_2_7P422
+
+ scripts/summary.html@1.23 +1 -1
+ NTP_4_2_7P422
+
+ scripts/summary.man.in@1.23 +6 -6
+ NTP_4_2_7P422
+
+ scripts/summary.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P422
+
+ sntp/invoke-sntp.texi@1.411 +2 -2
+ NTP_4_2_7P422
+
+ sntp/sntp-opts.c@1.426 +7 -7
+ NTP_4_2_7P422
+
+ sntp/sntp-opts.h@1.426 +3 -3
+ NTP_4_2_7P422
+
+ sntp/sntp.1sntpman@1.246 +14 -14
+ NTP_4_2_7P422
+
+ sntp/sntp.1sntpmdoc@1.246 +3 -3
+ NTP_4_2_7P422
+
+ sntp/sntp.html@1.426 +2 -2
+ NTP_4_2_7P422
+
+ sntp/sntp.man.in@1.246 +14 -14
+ NTP_4_2_7P422
+
+ sntp/sntp.mdoc.in@1.246 +3 -3
+ NTP_4_2_7P422
+
+ util/invoke-ntp-keygen.texi@1.415 +2 -2
+ NTP_4_2_7P422
+
+ util/ntp-keygen-opts.c@1.429 +7 -7
+ NTP_4_2_7P422
+
+ util/ntp-keygen-opts.h@1.429 +3 -3
+ NTP_4_2_7P422
+
+ util/ntp-keygen.1ntp-keygenman@1.243 +7 -7
+ NTP_4_2_7P422
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.243 +3 -3
+ NTP_4_2_7P422
+
+ util/ntp-keygen.html@1.91 +2 -2
+ NTP_4_2_7P422
+
+ util/ntp-keygen.man.in@1.243 +7 -7
+ NTP_4_2_7P422
+
+ util/ntp-keygen.mdoc.in@1.243 +3 -3
+ NTP_4_2_7P422
+
+ChangeSet@1.3093.1.1, 2014-02-17 07:51:58+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2536] ntpd sandboxing support (libseccomp2)
+
+ ChangeLog@1.1424 +1 -0
+ [Bug 2536] ntpd sandboxing support (libseccomp2)
+
+ configure.ac@1.571.1.1 +24 -0
+ [Bug 2536] ntpd sandboxing support (libseccomp2)
+
+ ntpd/ntpd.c@1.153 +106 -4
+ [Bug 2536] ntpd sandboxing support (libseccomp2)
+
+ChangeSet@1.3097, 2014-02-16 22:43:49+01:00, jnperlin@hydra.(none)
+ GPSD/JSON driver: added type aliases, some more cleanup
+
+ ntpd/refclock_gpsdjson.c@1.3 +137 -152
+ added type aliases, some more cleanup
+
+ChangeSet@1.3096, 2014-02-16 15:07:57+01:00, jnperlin@hydra.(none)
+ started documentation on driver 46 (GPSD_JSON)
+
+ html/drivers/driver46.html@1.1 +115 -0
+ started documentation
+
+ html/drivers/driver46.html@1.0 +0 -0
+
+ html/refclock.html@1.41 +1 -0
+ added link to driver 46 /GPSD_JSON)
+
+ ntpd/ntp_control.c@1.189 +1 -0
+ added GPSD_JSON
+
+ChangeSet@1.3095, 2014-02-16 14:10:37+01:00, jnperlin@hydra.(none)
+ logging, cleanup, refactoring: still a work in progress
+
+ ntpd/refclock_gpsdjson.c@1.2 +463 -308
+ logging, cleanup, refactoring: still a work in progress
+
+ChangeSet@1.3094, 2014-02-15 02:56:41+01:00, jnperlin@hydra.(none)
+ added the GPSD-JSON client driver
+
+ configure.ac@1.572 +18 -0
+ added the GPSD-JSON client driver
+
+ include/ntp.h@1.208 +3 -2
+ added the GPSD-JSON client driver
+
+ libjsmn/LICENSE@1.1 +20 -0
+ added the GPSD-JSON client driver
+
+ libjsmn/LICENSE@1.0 +0 -0
+
+ libjsmn/Makefile@1.1 +27 -0
+ added the GPSD-JSON client driver
+
+ libjsmn/Makefile@1.0 +0 -0
+
+ libjsmn/README.md@1.1 +161 -0
+ added the GPSD-JSON client driver
+
+ libjsmn/README.md@1.0 +0 -0
+
+ libjsmn/jsmn.c@1.1 +268 -0
+ added the GPSD-JSON client driver
+
+ libjsmn/jsmn.c@1.0 +0 -0
+
+ libjsmn/jsmn.h@1.1 +67 -0
+ added the GPSD-JSON client driver
+
+ libjsmn/jsmn.h@1.0 +0 -0
+
+ libjsmn/jsmn_test.c@1.1 +409 -0
+ added the GPSD-JSON client driver
+
+ libjsmn/jsmn_test.c@1.0 +0 -0
+
+ libntp/clocktypes.c@1.21 +2 -0
+ added the GPSD-JSON client driver
+
+ ntpd/Makefile.am@1.130 +1 -0
+ added the GPSD-JSON client driver
+
+ ntpd/refclock_conf.c@1.34 +8 -1
+ added the GPSD-JSON client driver
+
+ ntpd/refclock_gpsdjson.c@1.1 +921 -0
+ added the GPSD-JSON client driver
+
+ ntpd/refclock_gpsdjson.c@1.0 +0 -0
+
+ChangeSet@1.3093, 2014-02-10 20:34:39+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P421
+ TAG: NTP_4_2_7P421
+
+ ChangeLog@1.1423 +1 -0
+ NTP_4_2_7P421
+
+ ntpd/invoke-ntp.conf.texi@1.99 +1 -1
+ NTP_4_2_7P421
+
+ ntpd/invoke-ntp.keys.texi@1.97 +1 -1
+ NTP_4_2_7P421
+
+ ntpd/invoke-ntpd.texi@1.413 +2 -2
+ NTP_4_2_7P421
+
+ ntpd/ntp.conf.5man@1.133 +7 -7
+ NTP_4_2_7P421
+
+ ntpd/ntp.conf.5mdoc@1.133 +4 -4
+ NTP_4_2_7P421
+
+ ntpd/ntp.conf.html@1.94 +1 -1
+ NTP_4_2_7P421
+
+ ntpd/ntp.conf.man.in@1.133 +7 -7
+ NTP_4_2_7P421
+
+ ntpd/ntp.conf.mdoc.in@1.133 +4 -4
+ NTP_4_2_7P421
+
+ ntpd/ntp.keys.5man@1.131 +3 -3
+ NTP_4_2_7P421
+
+ ntpd/ntp.keys.5mdoc@1.131 +3 -3
+ NTP_4_2_7P421
+
+ ntpd/ntp.keys.html@1.95 +1 -1
+ NTP_4_2_7P421
+
+ ntpd/ntp.keys.man.in@1.131 +3 -3
+ NTP_4_2_7P421
+
+ ntpd/ntp.keys.mdoc.in@1.131 +3 -3
+ NTP_4_2_7P421
+
+ ntpd/ntpd-opts.c@1.431 +7 -7
+ NTP_4_2_7P421
+
+ ntpd/ntpd-opts.h@1.431 +3 -3
+ NTP_4_2_7P421
+
+ ntpd/ntpd.1ntpdman@1.242 +7 -7
+ NTP_4_2_7P421
+
+ ntpd/ntpd.1ntpdmdoc@1.242 +4 -4
+ NTP_4_2_7P421
+
+ ntpd/ntpd.html@1.89 +2 -2
+ NTP_4_2_7P421
+
+ ntpd/ntpd.man.in@1.242 +7 -7
+ NTP_4_2_7P421
+
+ ntpd/ntpd.mdoc.in@1.242 +4 -4
+ NTP_4_2_7P421
+
+ ntpdc/invoke-ntpdc.texi@1.411 +2 -2
+ NTP_4_2_7P421
+
+ ntpdc/ntpdc-opts.c@1.426 +7 -7
+ NTP_4_2_7P421
+
+ ntpdc/ntpdc-opts.h@1.426 +3 -3
+ NTP_4_2_7P421
+
+ ntpdc/ntpdc.1ntpdcman@1.242 +6 -6
+ NTP_4_2_7P421
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.242 +3 -3
+ NTP_4_2_7P421
+
+ ntpdc/ntpdc.html@1.255 +2 -2
+ NTP_4_2_7P421
+
+ ntpdc/ntpdc.man.in@1.242 +6 -6
+ NTP_4_2_7P421
+
+ ntpdc/ntpdc.mdoc.in@1.242 +3 -3
+ NTP_4_2_7P421
+
+ ntpq/invoke-ntpq.texi@1.414 +2 -2
+ NTP_4_2_7P421
+
+ ntpq/ntpq-opts.c@1.428 +7 -7
+ NTP_4_2_7P421
+
+ ntpq/ntpq-opts.h@1.428 +3 -3
+ NTP_4_2_7P421
+
+ ntpq/ntpq.1ntpqman@1.242 +6 -6
+ NTP_4_2_7P421
+
+ ntpq/ntpq.1ntpqmdoc@1.242 +3 -3
+ NTP_4_2_7P421
+
+ ntpq/ntpq.html@1.86 +2 -2
+ NTP_4_2_7P421
+
+ ntpq/ntpq.man.in@1.242 +6 -6
+ NTP_4_2_7P421
+
+ ntpq/ntpq.mdoc.in@1.242 +3 -3
+ NTP_4_2_7P421
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.413 +2 -2
+ NTP_4_2_7P421
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.428 +7 -7
+ NTP_4_2_7P421
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.428 +3 -3
+ NTP_4_2_7P421
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.242 +7 -7
+ NTP_4_2_7P421
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.242 +4 -4
+ NTP_4_2_7P421
+
+ ntpsnmpd/ntpsnmpd.html@1.84 +1 -1
+ NTP_4_2_7P421
+
+ ntpsnmpd/ntpsnmpd.man.in@1.242 +7 -7
+ NTP_4_2_7P421
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.242 +4 -4
+ NTP_4_2_7P421
+
+ packageinfo.sh@1.425 +1 -1
+ NTP_4_2_7P421
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.4 +6 -6
+ NTP_4_2_7P421
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.4 +1 -1
+ NTP_4_2_7P421
+
+ scripts/calc_tickadj/calc_tickadj.html@1.3 +23 -35
+ NTP_4_2_7P421
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.3 +6 -6
+ NTP_4_2_7P421
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.4 +1 -1
+ NTP_4_2_7P421
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.5 +2 -2
+ NTP_4_2_7P421
+
+ scripts/invoke-plot_summary.texi@1.22 +1 -1
+ NTP_4_2_7P421
+
+ scripts/invoke-summary.texi@1.22 +1 -1
+ NTP_4_2_7P421
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.231 +1 -1
+ NTP_4_2_7P421
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.232 +6 -6
+ NTP_4_2_7P421
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.232 +3 -3
+ NTP_4_2_7P421
+
+ scripts/ntp-wait/ntp-wait.html@1.248 +1 -1
+ NTP_4_2_7P421
+
+ scripts/ntp-wait/ntp-wait.man.in@1.232 +6 -6
+ NTP_4_2_7P421
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.232 +3 -3
+ NTP_4_2_7P421
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.20 +1 -1
+ NTP_4_2_7P421
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.11 +6 -6
+ NTP_4_2_7P421
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.11 +3 -3
+ NTP_4_2_7P421
+
+ scripts/ntpsweep/ntpsweep.html@1.21 +1 -1
+ NTP_4_2_7P421
+
+ scripts/ntpsweep/ntpsweep.man.in@1.11 +6 -6
+ NTP_4_2_7P421
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.12 +3 -3
+ NTP_4_2_7P421
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.20 +1 -1
+ NTP_4_2_7P421
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.11 +6 -6
+ NTP_4_2_7P421
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.11 +3 -3
+ NTP_4_2_7P421
+
+ scripts/ntptrace/ntptrace.html@1.21 +1 -1
+ NTP_4_2_7P421
+
+ scripts/ntptrace/ntptrace.man.in@1.11 +6 -6
+ NTP_4_2_7P421
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.12 +3 -3
+ NTP_4_2_7P421
+
+ scripts/plot_summary.1plot_summaryman@1.22 +6 -6
+ NTP_4_2_7P421
+
+ scripts/plot_summary.1plot_summarymdoc@1.22 +3 -3
+ NTP_4_2_7P421
+
+ scripts/plot_summary.html@1.22 +1 -1
+ NTP_4_2_7P421
+
+ scripts/plot_summary.man.in@1.22 +6 -6
+ NTP_4_2_7P421
+
+ scripts/plot_summary.mdoc.in@1.22 +3 -3
+ NTP_4_2_7P421
+
+ scripts/summary.1summaryman@1.22 +6 -6
+ NTP_4_2_7P421
+
+ scripts/summary.1summarymdoc@1.22 +3 -3
+ NTP_4_2_7P421
+
+ scripts/summary.html@1.22 +1 -1
+ NTP_4_2_7P421
+
+ scripts/summary.man.in@1.22 +6 -6
+ NTP_4_2_7P421
+
+ scripts/summary.mdoc.in@1.22 +3 -3
+ NTP_4_2_7P421
+
+ sntp/invoke-sntp.texi@1.410 +2 -2
+ NTP_4_2_7P421
+
+ sntp/sntp-opts.c@1.425 +7 -7
+ NTP_4_2_7P421
+
+ sntp/sntp-opts.h@1.425 +3 -3
+ NTP_4_2_7P421
+
+ sntp/sntp.1sntpman@1.245 +14 -14
+ NTP_4_2_7P421
+
+ sntp/sntp.1sntpmdoc@1.245 +4 -4
+ NTP_4_2_7P421
+
+ sntp/sntp.html@1.425 +2 -2
+ NTP_4_2_7P421
+
+ sntp/sntp.man.in@1.245 +14 -14
+ NTP_4_2_7P421
+
+ sntp/sntp.mdoc.in@1.245 +4 -4
+ NTP_4_2_7P421
+
+ util/invoke-ntp-keygen.texi@1.414 +2 -2
+ NTP_4_2_7P421
+
+ util/ntp-keygen-opts.c@1.428 +7 -7
+ NTP_4_2_7P421
+
+ util/ntp-keygen-opts.h@1.428 +3 -3
+ NTP_4_2_7P421
+
+ util/ntp-keygen.1ntp-keygenman@1.242 +7 -7
+ NTP_4_2_7P421
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.242 +4 -4
+ NTP_4_2_7P421
+
+ util/ntp-keygen.html@1.90 +2 -2
+ NTP_4_2_7P421
+
+ util/ntp-keygen.man.in@1.242 +7 -7
+ NTP_4_2_7P421
+
+ util/ntp-keygen.mdoc.in@1.242 +4 -4
+ NTP_4_2_7P421
+
+ChangeSet@1.3092, 2014-02-10 15:34:22-05:00, stenn@deacon.udel.edu
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ .point-changed-filelist@1.24 +6 -0
+
+ChangeSet@1.3091, 2014-02-10 02:35:55-05:00, stenn@deacon.udel.edu
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ ChangeLog@1.1422 +1 -0
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ scripts/calc_tickadj/Makefile.am@1.8 +11 -0
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.3 +32 -3
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.3 +22 -3
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.2 +37 -3
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.3 +22 -3
+ calc_tickadj/Makefile.am man/mdoc page build cleanup
+
+ChangeSet@1.3090, 2014-02-10 01:17:38-05:00, stenn@deacon.udel.edu
+ [Bug 2555] Autogen mdoc man pages all stamped with SunOS 5.10
+
+ ChangeLog@1.1421 +1 -0
+ [Bug 2555] Autogen mdoc man pages all stamped with SunOS 5.10
+
+ sntp/ag-tpl/agmdoc-cmd.tpl@1.2 +1 -1
+ [Bug 2555] Autogen mdoc man pages all stamped with SunOS 5.10
+
+ChangeSet@1.3089, 2014-02-10 05:55:42+00:00, stenn@psp-fb1.ntp.org
+ [Bug 898] More documentation fixes
+
+ ChangeLog@1.1420 +1 -0
+ [Bug 898] More documentation fixes
+
+ html/ntpd.html@1.60 +4 -3
+ [Bug 898] More documentation fixes
+
+ChangeSet@1.3088, 2014-02-09 11:19:15+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P420
+ TAG: NTP_4_2_7P420
+
+ ChangeLog@1.1419 +1 -0
+ NTP_4_2_7P420
+
+ ntpd/invoke-ntp.conf.texi@1.98 +1 -1
+ NTP_4_2_7P420
+
+ ntpd/invoke-ntp.keys.texi@1.96 +1 -1
+ NTP_4_2_7P420
+
+ ntpd/invoke-ntpd.texi@1.412 +2 -2
+ NTP_4_2_7P420
+
+ ntpd/ntp.conf.5man@1.132 +7 -7
+ NTP_4_2_7P420
+
+ ntpd/ntp.conf.5mdoc@1.132 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntp.conf.html@1.93 +1 -1
+ NTP_4_2_7P420
+
+ ntpd/ntp.conf.man.in@1.132 +7 -7
+ NTP_4_2_7P420
+
+ ntpd/ntp.conf.mdoc.in@1.132 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntp.keys.5man@1.130 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntp.keys.5mdoc@1.130 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntp.keys.html@1.94 +1 -1
+ NTP_4_2_7P420
+
+ ntpd/ntp.keys.man.in@1.130 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntp.keys.mdoc.in@1.130 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntpd-opts.c@1.430 +7 -7
+ NTP_4_2_7P420
+
+ ntpd/ntpd-opts.h@1.430 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntpd.1ntpdman@1.241 +7 -7
+ NTP_4_2_7P420
+
+ ntpd/ntpd.1ntpdmdoc@1.241 +3 -3
+ NTP_4_2_7P420
+
+ ntpd/ntpd.html@1.88 +2 -2
+ NTP_4_2_7P420
+
+ ntpd/ntpd.man.in@1.241 +7 -7
+ NTP_4_2_7P420
+
+ ntpd/ntpd.mdoc.in@1.241 +3 -3
+ NTP_4_2_7P420
+
+ ntpdc/invoke-ntpdc.texi@1.410 +2 -2
+ NTP_4_2_7P420
+
+ ntpdc/ntpdc-opts.c@1.425 +7 -7
+ NTP_4_2_7P420
+
+ ntpdc/ntpdc-opts.h@1.425 +3 -3
+ NTP_4_2_7P420
+
+ ntpdc/ntpdc.1ntpdcman@1.241 +6 -6
+ NTP_4_2_7P420
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.241 +2 -2
+ NTP_4_2_7P420
+
+ ntpdc/ntpdc.html@1.254 +2 -2
+ NTP_4_2_7P420
+
+ ntpdc/ntpdc.man.in@1.241 +6 -6
+ NTP_4_2_7P420
+
+ ntpdc/ntpdc.mdoc.in@1.241 +2 -2
+ NTP_4_2_7P420
+
+ ntpq/invoke-ntpq.texi@1.413 +2 -2
+ NTP_4_2_7P420
+
+ ntpq/ntpq-opts.c@1.427 +7 -7
+ NTP_4_2_7P420
+
+ ntpq/ntpq-opts.h@1.427 +3 -3
+ NTP_4_2_7P420
+
+ ntpq/ntpq.1ntpqman@1.241 +6 -6
+ NTP_4_2_7P420
+
+ ntpq/ntpq.1ntpqmdoc@1.241 +2 -2
+ NTP_4_2_7P420
+
+ ntpq/ntpq.html@1.85 +2 -2
+ NTP_4_2_7P420
+
+ ntpq/ntpq.man.in@1.241 +6 -6
+ NTP_4_2_7P420
+
+ ntpq/ntpq.mdoc.in@1.241 +2 -2
+ NTP_4_2_7P420
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.412 +2 -2
+ NTP_4_2_7P420
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.427 +7 -7
+ NTP_4_2_7P420
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.427 +3 -3
+ NTP_4_2_7P420
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.241 +7 -7
+ NTP_4_2_7P420
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.241 +3 -3
+ NTP_4_2_7P420
+
+ ntpsnmpd/ntpsnmpd.html@1.83 +1 -1
+ NTP_4_2_7P420
+
+ ntpsnmpd/ntpsnmpd.man.in@1.241 +7 -7
+ NTP_4_2_7P420
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.241 +3 -3
+ NTP_4_2_7P420
+
+ packageinfo.sh@1.424 +1 -1
+ NTP_4_2_7P420
+
+ scripts/invoke-plot_summary.texi@1.21 +1 -1
+ NTP_4_2_7P420
+
+ scripts/invoke-summary.texi@1.21 +1 -1
+ NTP_4_2_7P420
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.230 +1 -1
+ NTP_4_2_7P420
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.231 +6 -6
+ NTP_4_2_7P420
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.231 +2 -2
+ NTP_4_2_7P420
+
+ scripts/ntp-wait/ntp-wait.html@1.247 +1 -1
+ NTP_4_2_7P420
+
+ scripts/ntp-wait/ntp-wait.man.in@1.231 +6 -6
+ NTP_4_2_7P420
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.231 +2 -2
+ NTP_4_2_7P420
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.19 +1 -1
+ NTP_4_2_7P420
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.10 +6 -6
+ NTP_4_2_7P420
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.10 +2 -2
+ NTP_4_2_7P420
+
+ scripts/ntpsweep/ntpsweep.html@1.20 +1 -1
+ NTP_4_2_7P420
+
+ scripts/ntpsweep/ntpsweep.man.in@1.10 +6 -6
+ NTP_4_2_7P420
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.11 +2 -2
+ NTP_4_2_7P420
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.19 +1 -1
+ NTP_4_2_7P420
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.10 +6 -6
+ NTP_4_2_7P420
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.10 +2 -2
+ NTP_4_2_7P420
+
+ scripts/ntptrace/ntptrace.html@1.20 +1 -1
+ NTP_4_2_7P420
+
+ scripts/ntptrace/ntptrace.man.in@1.10 +6 -6
+ NTP_4_2_7P420
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.11 +2 -2
+ NTP_4_2_7P420
+
+ scripts/plot_summary.1plot_summaryman@1.21 +6 -6
+ NTP_4_2_7P420
+
+ scripts/plot_summary.1plot_summarymdoc@1.21 +2 -2
+ NTP_4_2_7P420
+
+ scripts/plot_summary.html@1.21 +1 -1
+ NTP_4_2_7P420
+
+ scripts/plot_summary.man.in@1.21 +6 -6
+ NTP_4_2_7P420
+
+ scripts/plot_summary.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P420
+
+ scripts/summary.1summaryman@1.21 +6 -6
+ NTP_4_2_7P420
+
+ scripts/summary.1summarymdoc@1.21 +2 -2
+ NTP_4_2_7P420
+
+ scripts/summary.html@1.21 +1 -1
+ NTP_4_2_7P420
+
+ scripts/summary.man.in@1.21 +6 -6
+ NTP_4_2_7P420
+
+ scripts/summary.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P420
+
+ sntp/invoke-sntp.texi@1.409 +2 -2
+ NTP_4_2_7P420
+
+ sntp/sntp-opts.c@1.424 +7 -7
+ NTP_4_2_7P420
+
+ sntp/sntp-opts.h@1.424 +3 -3
+ NTP_4_2_7P420
+
+ sntp/sntp.1sntpman@1.244 +7 -7
+ NTP_4_2_7P420
+
+ sntp/sntp.1sntpmdoc@1.244 +3 -3
+ NTP_4_2_7P420
+
+ sntp/sntp.html@1.424 +2 -2
+ NTP_4_2_7P420
+
+ sntp/sntp.man.in@1.244 +7 -7
+ NTP_4_2_7P420
+
+ sntp/sntp.mdoc.in@1.244 +3 -3
+ NTP_4_2_7P420
+
+ util/invoke-ntp-keygen.texi@1.413 +2 -2
+ NTP_4_2_7P420
+
+ util/ntp-keygen-opts.c@1.427 +7 -7
+ NTP_4_2_7P420
+
+ util/ntp-keygen-opts.h@1.427 +3 -3
+ NTP_4_2_7P420
+
+ util/ntp-keygen.1ntp-keygenman@1.241 +7 -7
+ NTP_4_2_7P420
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.241 +3 -3
+ NTP_4_2_7P420
+
+ util/ntp-keygen.html@1.89 +2 -2
+ NTP_4_2_7P420
+
+ util/ntp-keygen.man.in@1.241 +7 -7
+ NTP_4_2_7P420
+
+ util/ntp-keygen.mdoc.in@1.241 +3 -3
+ NTP_4_2_7P420
+
+ChangeSet@1.3087, 2014-02-09 09:00:04+00:00, stenn@psp-fb1.ntp.org
+ [Sec 2542] Strengthen the mrulist nonce
+
+ ChangeLog@1.1418 +1 -0
+ [Sec 2542] Strengthen the mrulist nonce
+
+ ntpd/ntp_control.c@1.188 +8 -3
+ [Sec 2542] Strengthen the mrulist nonce
+
+ChangeSet@1.3086, 2014-02-09 03:37:08-05:00, stenn@deacon.udel.edu
+ [Bug 492] Clearly document ntpdate's pending deprecation
+
+ ChangeLog@1.1417 +1 -0
+ [Bug 492] Clearly document ntpdate's pending deprecation
+
+ html/ntpdate.html@1.27 +11 -1
+ [Bug 492] Clearly document ntpdate's pending deprecation
+
+ChangeSet@1.3085, 2014-02-09 08:09:56+00:00, stenn@psp-fb1.ntp.org
+ [Bug 1186] ntpd fails with link local IPv6 addresses
+
+ ChangeLog@1.1416 +3 -2
+ [Bug 1186] ntpd fails with link local IPv6 addresses
+
+ ntpd/ntp_io.c@1.389 +11 -6
+ [Bug 1186] ntpd fails with link local IPv6 addresses
+
+ChangeSet@1.3084, 2014-02-08 11:29:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P419
+ TAG: NTP_4_2_7P419
+
+ ChangeLog@1.1415 +1 -0
+ NTP_4_2_7P419
+
+ ntpd/invoke-ntp.conf.texi@1.97 +1 -1
+ NTP_4_2_7P419
+
+ ntpd/invoke-ntp.keys.texi@1.95 +1 -1
+ NTP_4_2_7P419
+
+ ntpd/invoke-ntpd.texi@1.411 +2 -2
+ NTP_4_2_7P419
+
+ ntpd/ntp.conf.5man@1.131 +7 -7
+ NTP_4_2_7P419
+
+ ntpd/ntp.conf.5mdoc@1.131 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntp.conf.html@1.92 +1 -1
+ NTP_4_2_7P419
+
+ ntpd/ntp.conf.man.in@1.131 +7 -7
+ NTP_4_2_7P419
+
+ ntpd/ntp.conf.mdoc.in@1.131 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntp.keys.5man@1.129 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntp.keys.5mdoc@1.129 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntp.keys.html@1.93 +1 -1
+ NTP_4_2_7P419
+
+ ntpd/ntp.keys.man.in@1.129 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntp.keys.mdoc.in@1.129 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntpd-opts.c@1.429 +7 -7
+ NTP_4_2_7P419
+
+ ntpd/ntpd-opts.h@1.429 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntpd.1ntpdman@1.240 +14 -14
+ NTP_4_2_7P419
+
+ ntpd/ntpd.1ntpdmdoc@1.240 +3 -3
+ NTP_4_2_7P419
+
+ ntpd/ntpd.html@1.87 +2 -2
+ NTP_4_2_7P419
+
+ ntpd/ntpd.man.in@1.240 +14 -14
+ NTP_4_2_7P419
+
+ ntpd/ntpd.mdoc.in@1.240 +3 -3
+ NTP_4_2_7P419
+
+ ntpdc/invoke-ntpdc.texi@1.409 +2 -2
+ NTP_4_2_7P419
+
+ ntpdc/ntpdc-opts.c@1.424 +7 -7
+ NTP_4_2_7P419
+
+ ntpdc/ntpdc-opts.h@1.424 +3 -3
+ NTP_4_2_7P419
+
+ ntpdc/ntpdc.1ntpdcman@1.240 +6 -6
+ NTP_4_2_7P419
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.240 +2 -2
+ NTP_4_2_7P419
+
+ ntpdc/ntpdc.html@1.253 +2 -2
+ NTP_4_2_7P419
+
+ ntpdc/ntpdc.man.in@1.240 +6 -6
+ NTP_4_2_7P419
+
+ ntpdc/ntpdc.mdoc.in@1.240 +2 -2
+ NTP_4_2_7P419
+
+ ntpq/invoke-ntpq.texi@1.412 +2 -2
+ NTP_4_2_7P419
+
+ ntpq/ntpq-opts.c@1.426 +7 -7
+ NTP_4_2_7P419
+
+ ntpq/ntpq-opts.h@1.426 +3 -3
+ NTP_4_2_7P419
+
+ ntpq/ntpq.1ntpqman@1.240 +6 -6
+ NTP_4_2_7P419
+
+ ntpq/ntpq.1ntpqmdoc@1.240 +2 -2
+ NTP_4_2_7P419
+
+ ntpq/ntpq.html@1.84 +2 -2
+ NTP_4_2_7P419
+
+ ntpq/ntpq.man.in@1.240 +6 -6
+ NTP_4_2_7P419
+
+ ntpq/ntpq.mdoc.in@1.240 +2 -2
+ NTP_4_2_7P419
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.411 +2 -2
+ NTP_4_2_7P419
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.426 +7 -7
+ NTP_4_2_7P419
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.426 +3 -3
+ NTP_4_2_7P419
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.240 +7 -7
+ NTP_4_2_7P419
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.240 +3 -3
+ NTP_4_2_7P419
+
+ ntpsnmpd/ntpsnmpd.html@1.82 +1 -1
+ NTP_4_2_7P419
+
+ ntpsnmpd/ntpsnmpd.man.in@1.240 +7 -7
+ NTP_4_2_7P419
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.240 +3 -3
+ NTP_4_2_7P419
+
+ packageinfo.sh@1.423 +1 -1
+ NTP_4_2_7P419
+
+ scripts/invoke-plot_summary.texi@1.20 +1 -1
+ NTP_4_2_7P419
+
+ scripts/invoke-summary.texi@1.20 +1 -1
+ NTP_4_2_7P419
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.229 +1 -1
+ NTP_4_2_7P419
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.230 +6 -6
+ NTP_4_2_7P419
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.230 +2 -2
+ NTP_4_2_7P419
+
+ scripts/ntp-wait/ntp-wait.html@1.246 +1 -1
+ NTP_4_2_7P419
+
+ scripts/ntp-wait/ntp-wait.man.in@1.230 +6 -6
+ NTP_4_2_7P419
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.230 +2 -2
+ NTP_4_2_7P419
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.18 +1 -1
+ NTP_4_2_7P419
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.9 +6 -6
+ NTP_4_2_7P419
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.9 +2 -2
+ NTP_4_2_7P419
+
+ scripts/ntpsweep/ntpsweep.html@1.19 +1 -1
+ NTP_4_2_7P419
+
+ scripts/ntpsweep/ntpsweep.man.in@1.9 +6 -6
+ NTP_4_2_7P419
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P419
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.18 +1 -1
+ NTP_4_2_7P419
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.9 +6 -6
+ NTP_4_2_7P419
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.9 +2 -2
+ NTP_4_2_7P419
+
+ scripts/ntptrace/ntptrace.html@1.19 +1 -1
+ NTP_4_2_7P419
+
+ scripts/ntptrace/ntptrace.man.in@1.9 +6 -6
+ NTP_4_2_7P419
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P419
+
+ scripts/plot_summary.1plot_summaryman@1.20 +6 -6
+ NTP_4_2_7P419
+
+ scripts/plot_summary.1plot_summarymdoc@1.20 +2 -2
+ NTP_4_2_7P419
+
+ scripts/plot_summary.html@1.20 +1 -1
+ NTP_4_2_7P419
+
+ scripts/plot_summary.man.in@1.20 +6 -6
+ NTP_4_2_7P419
+
+ scripts/plot_summary.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P419
+
+ scripts/summary.1summaryman@1.20 +6 -6
+ NTP_4_2_7P419
+
+ scripts/summary.1summarymdoc@1.20 +2 -2
+ NTP_4_2_7P419
+
+ scripts/summary.html@1.20 +1 -1
+ NTP_4_2_7P419
+
+ scripts/summary.man.in@1.20 +6 -6
+ NTP_4_2_7P419
+
+ scripts/summary.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P419
+
+ sntp/invoke-sntp.texi@1.408 +2 -2
+ NTP_4_2_7P419
+
+ sntp/sntp-opts.c@1.423 +7 -7
+ NTP_4_2_7P419
+
+ sntp/sntp-opts.h@1.423 +3 -3
+ NTP_4_2_7P419
+
+ sntp/sntp.1sntpman@1.243 +7 -7
+ NTP_4_2_7P419
+
+ sntp/sntp.1sntpmdoc@1.243 +3 -3
+ NTP_4_2_7P419
+
+ sntp/sntp.html@1.423 +2 -2
+ NTP_4_2_7P419
+
+ sntp/sntp.man.in@1.243 +7 -7
+ NTP_4_2_7P419
+
+ sntp/sntp.mdoc.in@1.243 +3 -3
+ NTP_4_2_7P419
+
+ util/invoke-ntp-keygen.texi@1.412 +2 -2
+ NTP_4_2_7P419
+
+ util/ntp-keygen-opts.c@1.426 +7 -7
+ NTP_4_2_7P419
+
+ util/ntp-keygen-opts.h@1.426 +3 -3
+ NTP_4_2_7P419
+
+ util/ntp-keygen.1ntp-keygenman@1.240 +7 -7
+ NTP_4_2_7P419
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.240 +3 -3
+ NTP_4_2_7P419
+
+ util/ntp-keygen.html@1.88 +2 -2
+ NTP_4_2_7P419
+
+ util/ntp-keygen.man.in@1.240 +7 -7
+ NTP_4_2_7P419
+
+ util/ntp-keygen.mdoc.in@1.240 +3 -3
+ NTP_4_2_7P419
+
+ChangeSet@1.3052.1.1, 2014-02-08 08:52:51+01:00, jnperlin@hydra.(none)
+ [Bug 2466] Fold NMEA date into 1024 week cycles - GPS has no absolute date.
+
+ ChangeLog@1.1387.1.1 +1 -0
+ [Bug 2466] Fold NMEA date into 1024 week cycles - GPS has no absolute date.
+
+ libntp/ntp_calendar.c@1.12 +17 -1
+ [Bug 2466] Fold NMEA date into 1024 week cycles - GPS has no absolute date.
+ Evaluation of build date can be blocked for DEBUG builds by environment.
+
+ ntpd/refclock_nmea.c@1.72.1.1 +156 -4
+ [Bug 2466] Fold NMEA date into 1024 week cycles - GPS has no absolute date.
+ Refactored date evaluation into separate function.
+
+ChangeSet@1.3082, 2014-02-05 12:02:45+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P418
+ TAG: NTP_4_2_7P418
+
+ ChangeLog@1.1413 +1 -0
+ NTP_4_2_7P418
+
+ ntpd/invoke-ntp.conf.texi@1.96 +1 -1
+ NTP_4_2_7P418
+
+ ntpd/invoke-ntp.keys.texi@1.94 +1 -1
+ NTP_4_2_7P418
+
+ ntpd/invoke-ntpd.texi@1.410 +2 -2
+ NTP_4_2_7P418
+
+ ntpd/ntp.conf.5man@1.130 +7 -7
+ NTP_4_2_7P418
+
+ ntpd/ntp.conf.5mdoc@1.130 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntp.conf.html@1.91 +1 -1
+ NTP_4_2_7P418
+
+ ntpd/ntp.conf.man.in@1.130 +7 -7
+ NTP_4_2_7P418
+
+ ntpd/ntp.conf.mdoc.in@1.130 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntp.keys.5man@1.128 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntp.keys.5mdoc@1.128 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntp.keys.html@1.92 +1 -1
+ NTP_4_2_7P418
+
+ ntpd/ntp.keys.man.in@1.128 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntp.keys.mdoc.in@1.128 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntpd-opts.c@1.428 +7 -7
+ NTP_4_2_7P418
+
+ ntpd/ntpd-opts.h@1.428 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntpd.1ntpdman@1.239 +14 -14
+ NTP_4_2_7P418
+
+ ntpd/ntpd.1ntpdmdoc@1.239 +3 -3
+ NTP_4_2_7P418
+
+ ntpd/ntpd.html@1.86 +2 -2
+ NTP_4_2_7P418
+
+ ntpd/ntpd.man.in@1.239 +14 -14
+ NTP_4_2_7P418
+
+ ntpd/ntpd.mdoc.in@1.239 +3 -3
+ NTP_4_2_7P418
+
+ ntpdc/invoke-ntpdc.texi@1.408 +2 -2
+ NTP_4_2_7P418
+
+ ntpdc/ntpdc-opts.c@1.423 +7 -7
+ NTP_4_2_7P418
+
+ ntpdc/ntpdc-opts.h@1.423 +3 -3
+ NTP_4_2_7P418
+
+ ntpdc/ntpdc.1ntpdcman@1.239 +6 -6
+ NTP_4_2_7P418
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.239 +2 -2
+ NTP_4_2_7P418
+
+ ntpdc/ntpdc.html@1.252 +2 -2
+ NTP_4_2_7P418
+
+ ntpdc/ntpdc.man.in@1.239 +6 -6
+ NTP_4_2_7P418
+
+ ntpdc/ntpdc.mdoc.in@1.239 +2 -2
+ NTP_4_2_7P418
+
+ ntpq/invoke-ntpq.texi@1.411 +2 -2
+ NTP_4_2_7P418
+
+ ntpq/ntpq-opts.c@1.425 +7 -7
+ NTP_4_2_7P418
+
+ ntpq/ntpq-opts.h@1.425 +3 -3
+ NTP_4_2_7P418
+
+ ntpq/ntpq.1ntpqman@1.239 +6 -6
+ NTP_4_2_7P418
+
+ ntpq/ntpq.1ntpqmdoc@1.239 +2 -2
+ NTP_4_2_7P418
+
+ ntpq/ntpq.html@1.83 +2 -2
+ NTP_4_2_7P418
+
+ ntpq/ntpq.man.in@1.239 +6 -6
+ NTP_4_2_7P418
+
+ ntpq/ntpq.mdoc.in@1.239 +2 -2
+ NTP_4_2_7P418
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.410 +2 -2
+ NTP_4_2_7P418
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.425 +7 -7
+ NTP_4_2_7P418
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.425 +3 -3
+ NTP_4_2_7P418
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.239 +7 -7
+ NTP_4_2_7P418
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.239 +3 -3
+ NTP_4_2_7P418
+
+ ntpsnmpd/ntpsnmpd.html@1.81 +1 -1
+ NTP_4_2_7P418
+
+ ntpsnmpd/ntpsnmpd.man.in@1.239 +7 -7
+ NTP_4_2_7P418
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.239 +3 -3
+ NTP_4_2_7P418
+
+ packageinfo.sh@1.422 +1 -1
+ NTP_4_2_7P418
+
+ scripts/invoke-plot_summary.texi@1.19 +1 -1
+ NTP_4_2_7P418
+
+ scripts/invoke-summary.texi@1.19 +1 -1
+ NTP_4_2_7P418
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.228 +1 -1
+ NTP_4_2_7P418
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.229 +6 -6
+ NTP_4_2_7P418
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.229 +2 -2
+ NTP_4_2_7P418
+
+ scripts/ntp-wait/ntp-wait.html@1.245 +1 -1
+ NTP_4_2_7P418
+
+ scripts/ntp-wait/ntp-wait.man.in@1.229 +6 -6
+ NTP_4_2_7P418
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.229 +2 -2
+ NTP_4_2_7P418
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.17 +1 -1
+ NTP_4_2_7P418
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.8 +6 -6
+ NTP_4_2_7P418
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.8 +2 -2
+ NTP_4_2_7P418
+
+ scripts/ntpsweep/ntpsweep.html@1.18 +1 -1
+ NTP_4_2_7P418
+
+ scripts/ntpsweep/ntpsweep.man.in@1.8 +6 -6
+ NTP_4_2_7P418
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P418
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.17 +1 -1
+ NTP_4_2_7P418
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.8 +6 -6
+ NTP_4_2_7P418
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.8 +2 -2
+ NTP_4_2_7P418
+
+ scripts/ntptrace/ntptrace.html@1.18 +1 -1
+ NTP_4_2_7P418
+
+ scripts/ntptrace/ntptrace.man.in@1.8 +6 -6
+ NTP_4_2_7P418
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P418
+
+ scripts/plot_summary.1plot_summaryman@1.19 +6 -6
+ NTP_4_2_7P418
+
+ scripts/plot_summary.1plot_summarymdoc@1.19 +2 -2
+ NTP_4_2_7P418
+
+ scripts/plot_summary.html@1.19 +1 -1
+ NTP_4_2_7P418
+
+ scripts/plot_summary.man.in@1.19 +6 -6
+ NTP_4_2_7P418
+
+ scripts/plot_summary.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P418
+
+ scripts/summary.1summaryman@1.19 +6 -6
+ NTP_4_2_7P418
+
+ scripts/summary.1summarymdoc@1.19 +2 -2
+ NTP_4_2_7P418
+
+ scripts/summary.html@1.19 +1 -1
+ NTP_4_2_7P418
+
+ scripts/summary.man.in@1.19 +6 -6
+ NTP_4_2_7P418
+
+ scripts/summary.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P418
+
+ sntp/invoke-sntp.texi@1.407 +2 -2
+ NTP_4_2_7P418
+
+ sntp/sntp-opts.c@1.422 +7 -7
+ NTP_4_2_7P418
+
+ sntp/sntp-opts.h@1.422 +3 -3
+ NTP_4_2_7P418
+
+ sntp/sntp.1sntpman@1.242 +7 -7
+ NTP_4_2_7P418
+
+ sntp/sntp.1sntpmdoc@1.242 +3 -3
+ NTP_4_2_7P418
+
+ sntp/sntp.html@1.422 +2 -2
+ NTP_4_2_7P418
+
+ sntp/sntp.man.in@1.242 +7 -7
+ NTP_4_2_7P418
+
+ sntp/sntp.mdoc.in@1.242 +3 -3
+ NTP_4_2_7P418
+
+ util/invoke-ntp-keygen.texi@1.411 +2 -2
+ NTP_4_2_7P418
+
+ util/ntp-keygen-opts.c@1.425 +7 -7
+ NTP_4_2_7P418
+
+ util/ntp-keygen-opts.h@1.425 +3 -3
+ NTP_4_2_7P418
+
+ util/ntp-keygen.1ntp-keygenman@1.239 +7 -7
+ NTP_4_2_7P418
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.239 +3 -3
+ NTP_4_2_7P418
+
+ util/ntp-keygen.html@1.87 +2 -2
+ NTP_4_2_7P418
+
+ util/ntp-keygen.man.in@1.239 +7 -7
+ NTP_4_2_7P418
+
+ util/ntp-keygen.mdoc.in@1.239 +3 -3
+ NTP_4_2_7P418
+
+ChangeSet@1.3081, 2014-02-05 07:02:58+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2551] --disable-local-libevent breaks the build
+
+ ChangeLog@1.1412 +1 -0
+ [Bug 2551] --disable-local-libevent breaks the build
+
+ sntp/m4/ntp_libevent.m4@1.10 +1 -3
+ [Bug 2551] --disable-local-libevent breaks the build
+
+ChangeSet@1.3080, 2014-02-02 11:35:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P417
+ TAG: NTP_4_2_7P417
+
+ ChangeLog@1.1411 +1 -0
+ NTP_4_2_7P417
+
+ ntpd/invoke-ntp.conf.texi@1.95 +1 -1
+ NTP_4_2_7P417
+
+ ntpd/invoke-ntp.keys.texi@1.93 +1 -1
+ NTP_4_2_7P417
+
+ ntpd/invoke-ntpd.texi@1.409 +2 -2
+ NTP_4_2_7P417
+
+ ntpd/ntp.conf.5man@1.129 +7 -7
+ NTP_4_2_7P417
+
+ ntpd/ntp.conf.5mdoc@1.129 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntp.conf.html@1.90 +1 -1
+ NTP_4_2_7P417
+
+ ntpd/ntp.conf.man.in@1.129 +7 -7
+ NTP_4_2_7P417
+
+ ntpd/ntp.conf.mdoc.in@1.129 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntp.keys.5man@1.127 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntp.keys.5mdoc@1.127 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntp.keys.html@1.91 +1 -1
+ NTP_4_2_7P417
+
+ ntpd/ntp.keys.man.in@1.127 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntp.keys.mdoc.in@1.127 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntpd-opts.c@1.427 +7 -7
+ NTP_4_2_7P417
+
+ ntpd/ntpd-opts.h@1.427 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntpd.1ntpdman@1.238 +7 -7
+ NTP_4_2_7P417
+
+ ntpd/ntpd.1ntpdmdoc@1.238 +3 -3
+ NTP_4_2_7P417
+
+ ntpd/ntpd.html@1.85 +2 -2
+ NTP_4_2_7P417
+
+ ntpd/ntpd.man.in@1.238 +7 -7
+ NTP_4_2_7P417
+
+ ntpd/ntpd.mdoc.in@1.238 +3 -3
+ NTP_4_2_7P417
+
+ ntpdc/invoke-ntpdc.texi@1.407 +2 -2
+ NTP_4_2_7P417
+
+ ntpdc/ntpdc-opts.c@1.422 +7 -7
+ NTP_4_2_7P417
+
+ ntpdc/ntpdc-opts.h@1.422 +3 -3
+ NTP_4_2_7P417
+
+ ntpdc/ntpdc.1ntpdcman@1.238 +6 -6
+ NTP_4_2_7P417
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.238 +2 -2
+ NTP_4_2_7P417
+
+ ntpdc/ntpdc.html@1.251 +2 -2
+ NTP_4_2_7P417
+
+ ntpdc/ntpdc.man.in@1.238 +6 -6
+ NTP_4_2_7P417
+
+ ntpdc/ntpdc.mdoc.in@1.238 +2 -2
+ NTP_4_2_7P417
+
+ ntpq/invoke-ntpq.texi@1.410 +2 -2
+ NTP_4_2_7P417
+
+ ntpq/ntpq-opts.c@1.424 +7 -7
+ NTP_4_2_7P417
+
+ ntpq/ntpq-opts.h@1.424 +3 -3
+ NTP_4_2_7P417
+
+ ntpq/ntpq.1ntpqman@1.238 +6 -6
+ NTP_4_2_7P417
+
+ ntpq/ntpq.1ntpqmdoc@1.238 +2 -2
+ NTP_4_2_7P417
+
+ ntpq/ntpq.html@1.82 +2 -2
+ NTP_4_2_7P417
+
+ ntpq/ntpq.man.in@1.238 +6 -6
+ NTP_4_2_7P417
+
+ ntpq/ntpq.mdoc.in@1.238 +2 -2
+ NTP_4_2_7P417
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.409 +2 -2
+ NTP_4_2_7P417
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.424 +7 -7
+ NTP_4_2_7P417
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.424 +3 -3
+ NTP_4_2_7P417
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.238 +7 -7
+ NTP_4_2_7P417
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.238 +3 -3
+ NTP_4_2_7P417
+
+ ntpsnmpd/ntpsnmpd.html@1.80 +1 -1
+ NTP_4_2_7P417
+
+ ntpsnmpd/ntpsnmpd.man.in@1.238 +7 -7
+ NTP_4_2_7P417
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.238 +3 -3
+ NTP_4_2_7P417
+
+ packageinfo.sh@1.421 +1 -1
+ NTP_4_2_7P417
+
+ scripts/invoke-plot_summary.texi@1.18 +1 -1
+ NTP_4_2_7P417
+
+ scripts/invoke-summary.texi@1.18 +1 -1
+ NTP_4_2_7P417
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.227 +1 -1
+ NTP_4_2_7P417
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.228 +6 -6
+ NTP_4_2_7P417
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.228 +2 -2
+ NTP_4_2_7P417
+
+ scripts/ntp-wait/ntp-wait.html@1.244 +1 -1
+ NTP_4_2_7P417
+
+ scripts/ntp-wait/ntp-wait.man.in@1.228 +6 -6
+ NTP_4_2_7P417
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.228 +2 -2
+ NTP_4_2_7P417
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.16 +1 -1
+ NTP_4_2_7P417
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.7 +6 -6
+ NTP_4_2_7P417
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.7 +2 -2
+ NTP_4_2_7P417
+
+ scripts/ntpsweep/ntpsweep.html@1.17 +1 -1
+ NTP_4_2_7P417
+
+ scripts/ntpsweep/ntpsweep.man.in@1.7 +6 -6
+ NTP_4_2_7P417
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P417
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.16 +1 -1
+ NTP_4_2_7P417
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.7 +6 -6
+ NTP_4_2_7P417
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.7 +2 -2
+ NTP_4_2_7P417
+
+ scripts/ntptrace/ntptrace.html@1.17 +1 -1
+ NTP_4_2_7P417
+
+ scripts/ntptrace/ntptrace.man.in@1.7 +6 -6
+ NTP_4_2_7P417
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P417
+
+ scripts/plot_summary.1plot_summaryman@1.18 +6 -6
+ NTP_4_2_7P417
+
+ scripts/plot_summary.1plot_summarymdoc@1.18 +2 -2
+ NTP_4_2_7P417
+
+ scripts/plot_summary.html@1.18 +1 -1
+ NTP_4_2_7P417
+
+ scripts/plot_summary.man.in@1.18 +6 -6
+ NTP_4_2_7P417
+
+ scripts/plot_summary.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P417
+
+ scripts/summary.1summaryman@1.18 +6 -6
+ NTP_4_2_7P417
+
+ scripts/summary.1summarymdoc@1.18 +2 -2
+ NTP_4_2_7P417
+
+ scripts/summary.html@1.18 +1 -1
+ NTP_4_2_7P417
+
+ scripts/summary.man.in@1.18 +6 -6
+ NTP_4_2_7P417
+
+ scripts/summary.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P417
+
+ sntp/invoke-sntp.texi@1.406 +2 -2
+ NTP_4_2_7P417
+
+ sntp/sntp-opts.c@1.421 +7 -7
+ NTP_4_2_7P417
+
+ sntp/sntp-opts.h@1.421 +3 -3
+ NTP_4_2_7P417
+
+ sntp/sntp.1sntpman@1.241 +7 -7
+ NTP_4_2_7P417
+
+ sntp/sntp.1sntpmdoc@1.241 +3 -3
+ NTP_4_2_7P417
+
+ sntp/sntp.html@1.421 +2 -2
+ NTP_4_2_7P417
+
+ sntp/sntp.man.in@1.241 +7 -7
+ NTP_4_2_7P417
+
+ sntp/sntp.mdoc.in@1.241 +3 -3
+ NTP_4_2_7P417
+
+ util/invoke-ntp-keygen.texi@1.410 +2 -2
+ NTP_4_2_7P417
+
+ util/ntp-keygen-opts.c@1.424 +7 -7
+ NTP_4_2_7P417
+
+ util/ntp-keygen-opts.h@1.424 +3 -3
+ NTP_4_2_7P417
+
+ util/ntp-keygen.1ntp-keygenman@1.238 +7 -7
+ NTP_4_2_7P417
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.238 +3 -3
+ NTP_4_2_7P417
+
+ util/ntp-keygen.html@1.86 +2 -2
+ NTP_4_2_7P417
+
+ util/ntp-keygen.man.in@1.238 +7 -7
+ NTP_4_2_7P417
+
+ util/ntp-keygen.mdoc.in@1.238 +3 -3
+ NTP_4_2_7P417
+
+ChangeSet@1.3075.1.4, 2014-01-31 12:14:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P416
+ TAG: NTP_4_2_7P416
+
+ ChangeLog@1.1406.1.4 +1 -0
+ NTP_4_2_7P416
+
+ ntpd/invoke-ntp.conf.texi@1.94 +1 -1
+ NTP_4_2_7P416
+
+ ntpd/invoke-ntp.keys.texi@1.92 +1 -1
+ NTP_4_2_7P416
+
+ ntpd/invoke-ntpd.texi@1.408 +2 -2
+ NTP_4_2_7P416
+
+ ntpd/ntp.conf.5man@1.128 +7 -7
+ NTP_4_2_7P416
+
+ ntpd/ntp.conf.5mdoc@1.128 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntp.conf.html@1.89 +1 -1
+ NTP_4_2_7P416
+
+ ntpd/ntp.conf.man.in@1.128 +7 -7
+ NTP_4_2_7P416
+
+ ntpd/ntp.conf.mdoc.in@1.128 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntp.keys.5man@1.126 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntp.keys.5mdoc@1.126 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntp.keys.html@1.90 +1 -1
+ NTP_4_2_7P416
+
+ ntpd/ntp.keys.man.in@1.126 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntp.keys.mdoc.in@1.126 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntpd-opts.c@1.426 +7 -7
+ NTP_4_2_7P416
+
+ ntpd/ntpd-opts.h@1.426 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntpd.1ntpdman@1.237 +7 -7
+ NTP_4_2_7P416
+
+ ntpd/ntpd.1ntpdmdoc@1.237 +3 -3
+ NTP_4_2_7P416
+
+ ntpd/ntpd.html@1.84 +2 -2
+ NTP_4_2_7P416
+
+ ntpd/ntpd.man.in@1.237 +7 -7
+ NTP_4_2_7P416
+
+ ntpd/ntpd.mdoc.in@1.237 +3 -3
+ NTP_4_2_7P416
+
+ ntpdc/invoke-ntpdc.texi@1.406 +2 -2
+ NTP_4_2_7P416
+
+ ntpdc/ntpdc-opts.c@1.421 +7 -7
+ NTP_4_2_7P416
+
+ ntpdc/ntpdc-opts.h@1.421 +3 -3
+ NTP_4_2_7P416
+
+ ntpdc/ntpdc.1ntpdcman@1.237 +32 -3
+ NTP_4_2_7P416
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.237 +21 -2
+ NTP_4_2_7P416
+
+ ntpdc/ntpdc.html@1.250 +57 -77
+ NTP_4_2_7P416
+
+ ntpdc/ntpdc.man.in@1.237 +32 -3
+ NTP_4_2_7P416
+
+ ntpdc/ntpdc.mdoc.in@1.237 +21 -2
+ NTP_4_2_7P416
+
+ ntpq/invoke-ntpq.texi@1.409 +2 -2
+ NTP_4_2_7P416
+
+ ntpq/ntpq-opts.c@1.423 +7 -7
+ NTP_4_2_7P416
+
+ ntpq/ntpq-opts.h@1.423 +3 -3
+ NTP_4_2_7P416
+
+ ntpq/ntpq.1ntpqman@1.237 +6 -6
+ NTP_4_2_7P416
+
+ ntpq/ntpq.1ntpqmdoc@1.237 +2 -2
+ NTP_4_2_7P416
+
+ ntpq/ntpq.html@1.81 +2 -2
+ NTP_4_2_7P416
+
+ ntpq/ntpq.man.in@1.237 +6 -6
+ NTP_4_2_7P416
+
+ ntpq/ntpq.mdoc.in@1.237 +2 -2
+ NTP_4_2_7P416
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.408 +2 -2
+ NTP_4_2_7P416
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.423 +7 -7
+ NTP_4_2_7P416
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.423 +3 -3
+ NTP_4_2_7P416
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.237 +7 -7
+ NTP_4_2_7P416
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.237 +3 -3
+ NTP_4_2_7P416
+
+ ntpsnmpd/ntpsnmpd.html@1.79 +1 -1
+ NTP_4_2_7P416
+
+ ntpsnmpd/ntpsnmpd.man.in@1.237 +7 -7
+ NTP_4_2_7P416
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.237 +3 -3
+ NTP_4_2_7P416
+
+ packageinfo.sh@1.420 +1 -1
+ NTP_4_2_7P416
+
+ scripts/invoke-plot_summary.texi@1.17 +1 -1
+ NTP_4_2_7P416
+
+ scripts/invoke-summary.texi@1.17 +1 -1
+ NTP_4_2_7P416
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.226 +1 -1
+ NTP_4_2_7P416
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.227 +6 -6
+ NTP_4_2_7P416
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.227 +2 -2
+ NTP_4_2_7P416
+
+ scripts/ntp-wait/ntp-wait.html@1.243 +1 -1
+ NTP_4_2_7P416
+
+ scripts/ntp-wait/ntp-wait.man.in@1.227 +6 -6
+ NTP_4_2_7P416
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.227 +2 -2
+ NTP_4_2_7P416
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.15 +1 -1
+ NTP_4_2_7P416
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.6 +6 -6
+ NTP_4_2_7P416
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.6 +2 -2
+ NTP_4_2_7P416
+
+ scripts/ntpsweep/ntpsweep.html@1.16 +1 -1
+ NTP_4_2_7P416
+
+ scripts/ntpsweep/ntpsweep.man.in@1.6 +6 -6
+ NTP_4_2_7P416
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P416
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.15 +1 -1
+ NTP_4_2_7P416
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.6 +6 -6
+ NTP_4_2_7P416
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.6 +2 -2
+ NTP_4_2_7P416
+
+ scripts/ntptrace/ntptrace.html@1.16 +1 -1
+ NTP_4_2_7P416
+
+ scripts/ntptrace/ntptrace.man.in@1.6 +6 -6
+ NTP_4_2_7P416
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P416
+
+ scripts/plot_summary.1plot_summaryman@1.17 +6 -6
+ NTP_4_2_7P416
+
+ scripts/plot_summary.1plot_summarymdoc@1.17 +2 -2
+ NTP_4_2_7P416
+
+ scripts/plot_summary.html@1.17 +1 -1
+ NTP_4_2_7P416
+
+ scripts/plot_summary.man.in@1.17 +6 -6
+ NTP_4_2_7P416
+
+ scripts/plot_summary.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P416
+
+ scripts/summary.1summaryman@1.17 +6 -6
+ NTP_4_2_7P416
+
+ scripts/summary.1summarymdoc@1.17 +2 -2
+ NTP_4_2_7P416
+
+ scripts/summary.html@1.17 +1 -1
+ NTP_4_2_7P416
+
+ scripts/summary.man.in@1.17 +6 -6
+ NTP_4_2_7P416
+
+ scripts/summary.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P416
+
+ sntp/invoke-sntp.texi@1.405 +2 -2
+ NTP_4_2_7P416
+
+ sntp/sntp-opts.c@1.420 +7 -7
+ NTP_4_2_7P416
+
+ sntp/sntp-opts.h@1.420 +3 -3
+ NTP_4_2_7P416
+
+ sntp/sntp.1sntpman@1.240 +7 -7
+ NTP_4_2_7P416
+
+ sntp/sntp.1sntpmdoc@1.240 +3 -3
+ NTP_4_2_7P416
+
+ sntp/sntp.html@1.420 +2 -2
+ NTP_4_2_7P416
+
+ sntp/sntp.man.in@1.240 +7 -7
+ NTP_4_2_7P416
+
+ sntp/sntp.mdoc.in@1.240 +3 -3
+ NTP_4_2_7P416
+
+ util/invoke-ntp-keygen.texi@1.409 +2 -2
+ NTP_4_2_7P416
+
+ util/ntp-keygen-opts.c@1.423 +7 -7
+ NTP_4_2_7P416
+
+ util/ntp-keygen-opts.h@1.423 +3 -3
+ NTP_4_2_7P416
+
+ util/ntp-keygen.1ntp-keygenman@1.237 +7 -7
+ NTP_4_2_7P416
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.237 +3 -3
+ NTP_4_2_7P416
+
+ util/ntp-keygen.html@1.85 +2 -2
+ NTP_4_2_7P416
+
+ util/ntp-keygen.man.in@1.237 +7 -7
+ NTP_4_2_7P416
+
+ util/ntp-keygen.mdoc.in@1.237 +3 -3
+ NTP_4_2_7P416
+
+ChangeSet@1.3075.1.3, 2014-01-31 11:53:07+00:00, stenn@psp-fb1.ntp.org
+ Tweak the 'Modified' line on appropriate html pages
+
+ ChangeLog@1.1406.1.3 +1 -0
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/assoc.html@1.40 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/comdex.html@1.6 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/confopt.html@1.58.1.1 +3 -2
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/decode.html@1.23 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/miscopt.html@1.77 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/monopt.html@1.37 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/ntpd.html@1.59 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/ntpdate.html@1.26 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/ntpdsim_new.html@1.8 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/ntpq.html@1.49 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/ntptrace.html@1.20 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ html/refclock.html@1.40 +3 -3
+ Tweak the 'Modified' line on appropriate html pages
+
+ChangeSet@1.3075.1.2, 2014-01-31 11:50:29+00:00, stenn@psp-fb1.ntp.org
+ Note in the deprecation of ntpdc in its documentation
+
+ ChangeLog@1.1406.1.2 +1 -0
+ Note in the deprecation of ntpdc in its documentation
+
+ html/ntpdc.html@1.38 +6 -4
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/invoke-ntpdc.texi@1.405 +8 -1
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc-opts.c@1.420 +1 -1
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc-opts.def@1.22 +7 -0
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc-opts.h@1.420 +1 -1
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc.1ntpdcman@1.236 +12 -32
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.236 +10 -22
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc.html@1.249 +82 -55
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc.man.in@1.236 +12 -32
+ Note in the deprecation of ntpdc in its documentation
+
+ ntpdc/ntpdc.mdoc.in@1.236 +10 -22
+ Note in the deprecation of ntpdc in its documentation
+
+ChangeSet@1.3075.1.1, 2014-01-31 11:48:11+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2332] Be more careful about when we use 'libgcc_s'
+
+ ChangeLog@1.1406.1.1 +1 -0
+ [Bug 2332] Be more careful about when we use 'libgcc_s'
+
+ sntp/m4/ntp_libntp.m4@1.26 +6 -4
+ [Bug 2332] Be more careful about when we use 'libgcc_s'
+
+ChangeSet@1.3078, 2014-01-29 04:21:29-05:00, murray@pogo.udel.edu
+ ChangeLog:
+ Bug 2539, doc extra statistics and code fixe for NMEA driver
+ refclock_nmea.c:
+ expand extra counters
+ fix for missing NMEA sentence in clockstats
+ driver20.html:
+ document extra statistics
+ several minor fixes
+
+ ChangeLog@1.1409 +1 -0
+ Bug 2539, doc extra statistics and code fixe for NMEA driver
+
+ html/drivers/driver20.html@1.27 +100 -6
+ document extra statistics
+ several minor fixes
+
+ ntpd/refclock_nmea.c@1.73 +22 -13
+ expand extra counters
+ fix for missing NMEA sentence in clockstats
+
+ChangeSet@1.3077, 2014-01-29 04:16:00-05:00, murray@pogo.udel.edu
+ ChangeLog:
+ Add check for enable stats to ntpd/complete.conf.in
+ complete.conf.in:
+ Add check for enable stats
+
+ ChangeLog@1.1408 +1 -0
+ Add check for enable stats to ntpd/complete.conf.in
+
+ ntpd/complete.conf.in@1.27 +2 -1
+ Add check for enable stats
+
+ChangeSet@1.3076, 2014-01-29 04:12:05-05:00, murray@pogo.udel.edu
+ confopt.html, ChangeLog:
+ Fix typo
+
+ ChangeLog@1.1407 +1 -0
+ Fix typo
+
+ html/confopt.html@1.59 +2 -2
+ Fix typo
+
+ChangeSet@1.3075, 2014-01-28 12:18:50+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P415
+ TAG: NTP_4_2_7P415
+
+ ChangeLog@1.1406 +1 -0
+ NTP_4_2_7P415
+
+ ntpd/invoke-ntp.conf.texi@1.93 +1 -1
+ NTP_4_2_7P415
+
+ ntpd/invoke-ntp.keys.texi@1.91 +1 -1
+ NTP_4_2_7P415
+
+ ntpd/invoke-ntpd.texi@1.407 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntp.conf.5man@1.127 +7 -7
+ NTP_4_2_7P415
+
+ ntpd/ntp.conf.5mdoc@1.127 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntp.conf.html@1.88 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntp.conf.man.in@1.127 +7 -7
+ NTP_4_2_7P415
+
+ ntpd/ntp.conf.mdoc.in@1.127 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntp.keys.5man@1.125 +3 -3
+ NTP_4_2_7P415
+
+ ntpd/ntp.keys.5mdoc@1.125 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntp.keys.html@1.89 +1 -1
+ NTP_4_2_7P415
+
+ ntpd/ntp.keys.man.in@1.125 +3 -3
+ NTP_4_2_7P415
+
+ ntpd/ntp.keys.mdoc.in@1.125 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntpd-opts.c@1.425 +7 -7
+ NTP_4_2_7P415
+
+ ntpd/ntpd-opts.h@1.425 +3 -3
+ NTP_4_2_7P415
+
+ ntpd/ntpd.1ntpdman@1.236 +7 -7
+ NTP_4_2_7P415
+
+ ntpd/ntpd.1ntpdmdoc@1.236 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntpd.html@1.83 +2 -2
+ NTP_4_2_7P415
+
+ ntpd/ntpd.man.in@1.236 +7 -7
+ NTP_4_2_7P415
+
+ ntpd/ntpd.mdoc.in@1.236 +2 -2
+ NTP_4_2_7P415
+
+ ntpdc/invoke-ntpdc.texi@1.404 +2 -2
+ NTP_4_2_7P415
+
+ ntpdc/ntpdc-opts.c@1.419 +7 -7
+ NTP_4_2_7P415
+
+ ntpdc/ntpdc-opts.h@1.419 +3 -3
+ NTP_4_2_7P415
+
+ ntpdc/ntpdc.1ntpdcman@1.235 +6 -6
+ NTP_4_2_7P415
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.235 +1 -1
+ NTP_4_2_7P415
+
+ ntpdc/ntpdc.html@1.248 +2 -2
+ NTP_4_2_7P415
+
+ ntpdc/ntpdc.man.in@1.235 +6 -6
+ NTP_4_2_7P415
+
+ ntpdc/ntpdc.mdoc.in@1.235 +1 -1
+ NTP_4_2_7P415
+
+ ntpq/invoke-ntpq.texi@1.408 +2 -2
+ NTP_4_2_7P415
+
+ ntpq/ntpq-opts.c@1.422 +7 -7
+ NTP_4_2_7P415
+
+ ntpq/ntpq-opts.h@1.422 +3 -3
+ NTP_4_2_7P415
+
+ ntpq/ntpq.1ntpqman@1.236 +6 -6
+ NTP_4_2_7P415
+
+ ntpq/ntpq.1ntpqmdoc@1.236 +1 -1
+ NTP_4_2_7P415
+
+ ntpq/ntpq.html@1.80 +2 -2
+ NTP_4_2_7P415
+
+ ntpq/ntpq.man.in@1.236 +6 -6
+ NTP_4_2_7P415
+
+ ntpq/ntpq.mdoc.in@1.236 +1 -1
+ NTP_4_2_7P415
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.407 +2 -2
+ NTP_4_2_7P415
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.422 +7 -7
+ NTP_4_2_7P415
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.422 +3 -3
+ NTP_4_2_7P415
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.236 +7 -7
+ NTP_4_2_7P415
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.236 +2 -2
+ NTP_4_2_7P415
+
+ ntpsnmpd/ntpsnmpd.html@1.78 +1 -1
+ NTP_4_2_7P415
+
+ ntpsnmpd/ntpsnmpd.man.in@1.236 +7 -7
+ NTP_4_2_7P415
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.236 +2 -2
+ NTP_4_2_7P415
+
+ packageinfo.sh@1.419 +1 -1
+ NTP_4_2_7P415
+
+ scripts/invoke-plot_summary.texi@1.16 +1 -1
+ NTP_4_2_7P415
+
+ scripts/invoke-summary.texi@1.16 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.225 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.226 +6 -6
+ NTP_4_2_7P415
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.226 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntp-wait/ntp-wait.html@1.242 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntp-wait/ntp-wait.man.in@1.226 +6 -6
+ NTP_4_2_7P415
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.226 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.14 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.5 +6 -6
+ NTP_4_2_7P415
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.5 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntpsweep/ntpsweep.html@1.15 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntpsweep/ntpsweep.man.in@1.5 +6 -6
+ NTP_4_2_7P415
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.6 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.14 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.5 +6 -6
+ NTP_4_2_7P415
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.5 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntptrace/ntptrace.html@1.15 +1 -1
+ NTP_4_2_7P415
+
+ scripts/ntptrace/ntptrace.man.in@1.5 +6 -6
+ NTP_4_2_7P415
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.6 +1 -1
+ NTP_4_2_7P415
+
+ scripts/plot_summary.1plot_summaryman@1.16 +6 -6
+ NTP_4_2_7P415
+
+ scripts/plot_summary.1plot_summarymdoc@1.16 +1 -1
+ NTP_4_2_7P415
+
+ scripts/plot_summary.html@1.16 +1 -1
+ NTP_4_2_7P415
+
+ scripts/plot_summary.man.in@1.16 +6 -6
+ NTP_4_2_7P415
+
+ scripts/plot_summary.mdoc.in@1.16 +1 -1
+ NTP_4_2_7P415
+
+ scripts/summary.1summaryman@1.16 +6 -6
+ NTP_4_2_7P415
+
+ scripts/summary.1summarymdoc@1.16 +1 -1
+ NTP_4_2_7P415
+
+ scripts/summary.html@1.16 +1 -1
+ NTP_4_2_7P415
+
+ scripts/summary.man.in@1.16 +6 -6
+ NTP_4_2_7P415
+
+ scripts/summary.mdoc.in@1.16 +1 -1
+ NTP_4_2_7P415
+
+ sntp/invoke-sntp.texi@1.404 +2 -2
+ NTP_4_2_7P415
+
+ sntp/sntp-opts.c@1.419 +7 -7
+ NTP_4_2_7P415
+
+ sntp/sntp-opts.h@1.419 +3 -3
+ NTP_4_2_7P415
+
+ sntp/sntp.1sntpman@1.239 +7 -7
+ NTP_4_2_7P415
+
+ sntp/sntp.1sntpmdoc@1.239 +2 -2
+ NTP_4_2_7P415
+
+ sntp/sntp.html@1.419 +2 -2
+ NTP_4_2_7P415
+
+ sntp/sntp.man.in@1.239 +7 -7
+ NTP_4_2_7P415
+
+ sntp/sntp.mdoc.in@1.239 +2 -2
+ NTP_4_2_7P415
+
+ util/invoke-ntp-keygen.texi@1.408 +2 -2
+ NTP_4_2_7P415
+
+ util/ntp-keygen-opts.c@1.422 +7 -7
+ NTP_4_2_7P415
+
+ util/ntp-keygen-opts.h@1.422 +3 -3
+ NTP_4_2_7P415
+
+ util/ntp-keygen.1ntp-keygenman@1.236 +7 -7
+ NTP_4_2_7P415
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.236 +2 -2
+ NTP_4_2_7P415
+
+ util/ntp-keygen.html@1.84 +27 -20
+ NTP_4_2_7P415
+
+ util/ntp-keygen.man.in@1.236 +7 -7
+ NTP_4_2_7P415
+
+ util/ntp-keygen.mdoc.in@1.236 +2 -2
+ NTP_4_2_7P415
+
+ChangeSet@1.3074, 2014-01-28 03:51:39-08:00, harlan@hms-mbp11.local
+ Fix the man page installation for the scripts/ files
+
+ ChangeLog@1.1405 +1 -0
+ Fix the man page installation for the scripts/ files
+
+ scripts/calc_tickadj/Makefile.am@1.7 +2 -0
+ Fix the man page installation for the scripts/ files
+
+ scripts/ntp-wait/Makefile.am@1.6 +2 -0
+ Fix the man page installation for the scripts/ files
+
+ scripts/ntpsweep/Makefile.am@1.7 +2 -0
+ Fix the man page installation for the scripts/ files
+
+ scripts/ntptrace/Makefile.am@1.7 +2 -0
+ Fix the man page installation for the scripts/ files
+
+ sntp/loc/README@1.3 +7 -0
+ Fix the man page installation for the scripts/ files
+
+ChangeSet@1.3073, 2014-01-28 11:26:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P414
+ TAG: NTP_4_2_7P414
+
+ ChangeLog@1.1404 +1 -0
+ NTP_4_2_7P414
+
+ ntpd/invoke-ntp.conf.texi@1.92 +2 -2
+ NTP_4_2_7P414
+
+ ntpd/invoke-ntp.keys.texi@1.90 +1 -1
+ NTP_4_2_7P414
+
+ ntpd/invoke-ntpd.texi@1.406 +2 -2
+ NTP_4_2_7P414
+
+ ntpd/ntp.conf.5man@1.126 +8 -8
+ NTP_4_2_7P414
+
+ ntpd/ntp.conf.5mdoc@1.126 +4 -4
+ NTP_4_2_7P414
+
+ ntpd/ntp.conf.html@1.87 +1 -1
+ NTP_4_2_7P414
+
+ ntpd/ntp.conf.man.in@1.126 +8 -8
+ NTP_4_2_7P414
+
+ ntpd/ntp.conf.mdoc.in@1.126 +4 -4
+ NTP_4_2_7P414
+
+ ntpd/ntp.keys.5man@1.124 +3 -3
+ NTP_4_2_7P414
+
+ ntpd/ntp.keys.5mdoc@1.124 +3 -3
+ NTP_4_2_7P414
+
+ ntpd/ntp.keys.html@1.88 +1 -1
+ NTP_4_2_7P414
+
+ ntpd/ntp.keys.man.in@1.124 +3 -3
+ NTP_4_2_7P414
+
+ ntpd/ntp.keys.mdoc.in@1.124 +3 -3
+ NTP_4_2_7P414
+
+ ntpd/ntpd-opts.c@1.424 +7 -7
+ NTP_4_2_7P414
+
+ ntpd/ntpd-opts.h@1.424 +3 -3
+ NTP_4_2_7P414
+
+ ntpd/ntpd.1ntpdman@1.235 +7 -7
+ NTP_4_2_7P414
+
+ ntpd/ntpd.1ntpdmdoc@1.235 +3 -3
+ NTP_4_2_7P414
+
+ ntpd/ntpd.html@1.82 +2 -2
+ NTP_4_2_7P414
+
+ ntpd/ntpd.man.in@1.235 +7 -7
+ NTP_4_2_7P414
+
+ ntpd/ntpd.mdoc.in@1.235 +3 -3
+ NTP_4_2_7P414
+
+ ntpdc/invoke-ntpdc.texi@1.403 +2 -2
+ NTP_4_2_7P414
+
+ ntpdc/ntpdc-opts.c@1.418 +7 -7
+ NTP_4_2_7P414
+
+ ntpdc/ntpdc-opts.h@1.418 +3 -3
+ NTP_4_2_7P414
+
+ ntpdc/ntpdc.1ntpdcman@1.234 +7 -7
+ NTP_4_2_7P414
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.234 +3 -3
+ NTP_4_2_7P414
+
+ ntpdc/ntpdc.html@1.247 +2 -2
+ NTP_4_2_7P414
+
+ ntpdc/ntpdc.man.in@1.234 +7 -7
+ NTP_4_2_7P414
+
+ ntpdc/ntpdc.mdoc.in@1.234 +3 -3
+ NTP_4_2_7P414
+
+ ntpq/invoke-ntpq.texi@1.407 +2 -2
+ NTP_4_2_7P414
+
+ ntpq/ntpq-opts.c@1.421 +7 -7
+ NTP_4_2_7P414
+
+ ntpq/ntpq-opts.h@1.421 +3 -3
+ NTP_4_2_7P414
+
+ ntpq/ntpq.1ntpqman@1.235 +6 -6
+ NTP_4_2_7P414
+
+ ntpq/ntpq.1ntpqmdoc@1.235 +2 -2
+ NTP_4_2_7P414
+
+ ntpq/ntpq.html@1.79 +2 -2
+ NTP_4_2_7P414
+
+ ntpq/ntpq.man.in@1.235 +6 -6
+ NTP_4_2_7P414
+
+ ntpq/ntpq.mdoc.in@1.235 +2 -2
+ NTP_4_2_7P414
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.406 +2 -2
+ NTP_4_2_7P414
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.421 +7 -7
+ NTP_4_2_7P414
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.421 +3 -3
+ NTP_4_2_7P414
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.235 +14 -14
+ NTP_4_2_7P414
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.235 +3 -3
+ NTP_4_2_7P414
+
+ ntpsnmpd/ntpsnmpd.html@1.77 +1 -1
+ NTP_4_2_7P414
+
+ ntpsnmpd/ntpsnmpd.man.in@1.235 +14 -14
+ NTP_4_2_7P414
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.235 +3 -3
+ NTP_4_2_7P414
+
+ packageinfo.sh@1.418 +1 -1
+ NTP_4_2_7P414
+
+ scripts/invoke-plot_summary.texi@1.15 +1 -1
+ NTP_4_2_7P414
+
+ scripts/invoke-summary.texi@1.15 +1 -1
+ NTP_4_2_7P414
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.224 +1 -1
+ NTP_4_2_7P414
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.225 +6 -6
+ NTP_4_2_7P414
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.225 +2 -2
+ NTP_4_2_7P414
+
+ scripts/ntp-wait/ntp-wait.html@1.241 +1 -1
+ NTP_4_2_7P414
+
+ scripts/ntp-wait/ntp-wait.man.in@1.225 +6 -6
+ NTP_4_2_7P414
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.225 +2 -2
+ NTP_4_2_7P414
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.13 +1 -1
+ NTP_4_2_7P414
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.4 +6 -6
+ NTP_4_2_7P414
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.4 +2 -2
+ NTP_4_2_7P414
+
+ scripts/ntpsweep/ntpsweep.html@1.14 +1 -1
+ NTP_4_2_7P414
+
+ scripts/ntpsweep/ntpsweep.man.in@1.4 +6 -6
+ NTP_4_2_7P414
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P414
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.13 +1 -1
+ NTP_4_2_7P414
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.4 +6 -6
+ NTP_4_2_7P414
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.4 +2 -2
+ NTP_4_2_7P414
+
+ scripts/ntptrace/ntptrace.html@1.14 +1 -1
+ NTP_4_2_7P414
+
+ scripts/ntptrace/ntptrace.man.in@1.4 +6 -6
+ NTP_4_2_7P414
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P414
+
+ scripts/plot_summary.1plot_summaryman@1.15 +6 -6
+ NTP_4_2_7P414
+
+ scripts/plot_summary.1plot_summarymdoc@1.15 +2 -2
+ NTP_4_2_7P414
+
+ scripts/plot_summary.html@1.15 +1 -1
+ NTP_4_2_7P414
+
+ scripts/plot_summary.man.in@1.15 +6 -6
+ NTP_4_2_7P414
+
+ scripts/plot_summary.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P414
+
+ scripts/summary.1summaryman@1.15 +6 -6
+ NTP_4_2_7P414
+
+ scripts/summary.1summarymdoc@1.15 +2 -2
+ NTP_4_2_7P414
+
+ scripts/summary.html@1.15 +1 -1
+ NTP_4_2_7P414
+
+ scripts/summary.man.in@1.15 +6 -6
+ NTP_4_2_7P414
+
+ scripts/summary.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P414
+
+ sntp/invoke-sntp.texi@1.403 +2 -2
+ NTP_4_2_7P414
+
+ sntp/sntp-opts.c@1.418 +7 -7
+ NTP_4_2_7P414
+
+ sntp/sntp-opts.h@1.418 +3 -3
+ NTP_4_2_7P414
+
+ sntp/sntp.1sntpman@1.238 +7 -7
+ NTP_4_2_7P414
+
+ sntp/sntp.1sntpmdoc@1.238 +3 -3
+ NTP_4_2_7P414
+
+ sntp/sntp.html@1.418 +2 -2
+ NTP_4_2_7P414
+
+ sntp/sntp.man.in@1.238 +7 -7
+ NTP_4_2_7P414
+
+ sntp/sntp.mdoc.in@1.238 +3 -3
+ NTP_4_2_7P414
+
+ util/invoke-ntp-keygen.texi@1.407 +24 -17
+ NTP_4_2_7P414
+
+ util/ntp-keygen-opts.c@1.421 +122 -122
+ NTP_4_2_7P414
+
+ util/ntp-keygen-opts.h@1.421 +16 -16
+ NTP_4_2_7P414
+
+ util/ntp-keygen.1ntp-keygenman@1.235 +23 -16
+ NTP_4_2_7P414
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.235 +18 -11
+ NTP_4_2_7P414
+
+ util/ntp-keygen.html@1.83 +2 -2
+ NTP_4_2_7P414
+
+ util/ntp-keygen.man.in@1.235 +23 -16
+ NTP_4_2_7P414
+
+ util/ntp-keygen.mdoc.in@1.235 +18 -11
+ NTP_4_2_7P414
+
+ChangeSet@1.3072, 2014-01-28 06:21:33-05:00, stenn@deacon.udel.edu
+ [Bug 1002] ntp-keygen option and documentation updates
+
+ util/ntp-keygen.c@1.97 +4 -4
+ [Bug 1002] ntp-keygen option and documentation updates
+
+ChangeSet@1.3071, 2014-01-28 04:40:20-05:00, stenn@deacon.udel.edu
+ [Bug 2493] ntptrace needs a man page (fixed in 4.2.7p402)
+
+ ChangeLog@1.1403 +1 -0
+ [Bug 2493] ntptrace needs a man page (fixed in 4.2.7p402)
+
+ChangeSet@1.3070, 2014-01-28 09:33:40+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2366] ntpdc.html: burst/iburst only work on servers
+
+ ChangeLog@1.1402 +1 -0
+ [Bug 2366] ntpdc.html: burst/iburst only work on servers
+
+ html/confopt.html@1.58 +1 -1
+ fix a typo
+
+ html/ntpdc.html@1.37 +3 -3
+ [Bug 2366] ntpdc.html: burst/iburst only work on servers
+
+ChangeSet@1.3069, 2014-01-28 08:45:42+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2049] Clarify ntpdate's -d option behavior
+
+ ChangeLog@1.1401 +1 -0
+ [Bug 2049] Clarify ntpdate's -d option behavior
+
+ html/ntpdate.html@1.25 +1 -1
+ [Bug 2049] Clarify ntpdate's -d option behavior
+
+ChangeSet@1.3068, 2014-01-28 03:35:19-05:00, stenn@deacon.udel.edu
+ [Bug 1734] Include man page for ntp.conf (fixed in 4.2.7p297)
+
+ ChangeLog@1.1400 +1 -0
+ [Bug 1734] Include man page for ntp.conf (fixed in 4.2.7p297)
+
+ChangeSet@1.3067, 2014-01-28 08:28:29+00:00, stenn@psp-fb1.ntp.org
+ [Bug 1349] statistics command not documented in HTML documentation
+
+ ChangeLog@1.1399 +7 -0
+ [Bug 1349] statistics command not documented in HTML documentation
+
+ html/comdex.html@1.5 +2 -2
+ [Bug 1349] statistics command not documented in HTML documentation
+
+ html/monopt.html@1.36 +5 -1
+ [Bug 1349] statistics command not documented in HTML documentation
+
+ html/scripts/monopt.txt@1.4 +1 -0
+ [Bug 1349] statistics command not documented in HTML documentation
+
+ ntpd/complete.conf.in@1.26 +1 -1
+ [Bug 1349] statistics command not documented in HTML documentation
+
+ ntpd/ntp.conf.def@1.11 +1 -1
+ [Bug 1349] statistics command not documented in HTML documentation
+
+ChangeSet@1.3066, 2014-01-28 08:14:17+00:00, stenn@psp-fb1.ntp.org
+ [Bug 1002] ntp-keygen option and documentation updates
+
+ ChangeLog@1.1398 +2 -0
+ [Bug 1002] ntp-keygen option and documentation updates
+
+ util/ntp-keygen-opts.def@1.25 +14 -7
+ [Bug 1002] ntp-keygen option and documentation updates
+
+ChangeSet@1.3065, 2014-01-28 07:35:00+00:00, stenn@psp-fb1.ntp.org
+ [Bug 930] ntpdc docs refer to 'clockinfo', but mean 'clockstat'
+
+ ChangeLog@1.1397 +1 -0
+ [Bug 930] ntpdc docs refer to 'clockinfo', but mean 'clockstat'
+
+ html/ntpdc.html@1.36 +1 -1
+ [Bug 930] ntpdc docs refer to 'clockinfo', but mean 'clockstat'
+
+ ntpdc/ntpdc-opts.def@1.21 +1 -1
+ [Bug 930] ntpdc docs refer to 'clockinfo', but mean 'clockstat'
+
+ChangeSet@1.3064, 2014-01-28 07:07:13+00:00, stenn@psp-fb1.ntp.org
+ [Bug 898] Documentation fixes
+
+ ChangeLog@1.1396 +1 -0
+ [Bug 898] Documentation fixes
+
+ html/ntpd.html@1.58 +5 -1
+ [Bug 898] Documentation fixes
+
+ html/ntpdate.html@1.24 +5 -5
+ [Bug 898] Documentation fixes
+
+ html/ntpdc.html@1.35 +4 -2
+ [Bug 898] Documentation fixes
+
+ html/ntpq.html@1.48 +1 -1
+ [Bug 898] Documentation fixes
+
+ html/ntptrace.html@1.19 +1 -1
+ [Bug 898] Documentation fixes
+
+ChangeSet@1.3063, 2014-01-28 00:00:50-05:00, stenn@deacon.udel.edu
+ [Bug 2545] Cleanup of scripts/monitoring/ntptrap
+
+ ChangeLog@1.1395 +1 -0
+ [Bug 2545] Cleanup of scripts/monitoring/ntptrap
+
+ scripts/monitoring/ntp.pl@1.4 +54 -27
+ [Bug 2545] Cleanup of scripts/monitoring/ntptrap
+
+ scripts/monitoring/ntptrap@1.3 +6 -4
+ [Bug 2545] Cleanup of scripts/monitoring/ntptrap
+
+ChangeSet@1.3062, 2014-01-27 21:32:42-05:00, stenn@deacon.udel.edu
+ [Bug 792] TrueTime TL-3 WWV refclock support
+
+ ChangeLog@1.1394 +1 -0
+ [Bug 792] TrueTime TL-3 WWV refclock support
+
+ html/drivers/driver5.html@1.15 +17 -6
+ [Bug 792] TrueTime TL-3 WWV refclock support
+
+ ntpd/refclock_true.c@1.20 +121 -30
+ [Bug 792] TrueTime TL-3 WWV refclock support
+
+ChangeSet@1.3061, 2014-01-28 00:35:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P413
+ TAG: NTP_4_2_7P413
+
+ ChangeLog@1.1393 +1 -0
+ NTP_4_2_7P413
+
+ ntpd/invoke-ntp.conf.texi@1.91 +1 -1
+ NTP_4_2_7P413
+
+ ntpd/invoke-ntp.keys.texi@1.89 +1 -1
+ NTP_4_2_7P413
+
+ ntpd/invoke-ntpd.texi@1.405 +2 -2
+ NTP_4_2_7P413
+
+ ntpd/ntp.conf.5man@1.125 +7 -7
+ NTP_4_2_7P413
+
+ ntpd/ntp.conf.5mdoc@1.125 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntp.conf.html@1.86 +1 -1
+ NTP_4_2_7P413
+
+ ntpd/ntp.conf.man.in@1.125 +7 -7
+ NTP_4_2_7P413
+
+ ntpd/ntp.conf.mdoc.in@1.125 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntp.keys.5man@1.123 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntp.keys.5mdoc@1.123 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntp.keys.html@1.87 +1 -1
+ NTP_4_2_7P413
+
+ ntpd/ntp.keys.man.in@1.123 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntp.keys.mdoc.in@1.123 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntpd-opts.c@1.423 +7 -7
+ NTP_4_2_7P413
+
+ ntpd/ntpd-opts.h@1.423 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntpd.1ntpdman@1.234 +7 -7
+ NTP_4_2_7P413
+
+ ntpd/ntpd.1ntpdmdoc@1.234 +3 -3
+ NTP_4_2_7P413
+
+ ntpd/ntpd.html@1.81 +2 -2
+ NTP_4_2_7P413
+
+ ntpd/ntpd.man.in@1.234 +7 -7
+ NTP_4_2_7P413
+
+ ntpd/ntpd.mdoc.in@1.234 +3 -3
+ NTP_4_2_7P413
+
+ ntpdc/invoke-ntpdc.texi@1.402 +2 -2
+ NTP_4_2_7P413
+
+ ntpdc/ntpdc-opts.c@1.417 +7 -7
+ NTP_4_2_7P413
+
+ ntpdc/ntpdc-opts.h@1.417 +3 -3
+ NTP_4_2_7P413
+
+ ntpdc/ntpdc.1ntpdcman@1.233 +6 -6
+ NTP_4_2_7P413
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.233 +2 -2
+ NTP_4_2_7P413
+
+ ntpdc/ntpdc.html@1.246 +2 -2
+ NTP_4_2_7P413
+
+ ntpdc/ntpdc.man.in@1.233 +6 -6
+ NTP_4_2_7P413
+
+ ntpdc/ntpdc.mdoc.in@1.233 +2 -2
+ NTP_4_2_7P413
+
+ ntpq/invoke-ntpq.texi@1.406 +2 -2
+ NTP_4_2_7P413
+
+ ntpq/ntpq-opts.c@1.420 +7 -7
+ NTP_4_2_7P413
+
+ ntpq/ntpq-opts.h@1.420 +3 -3
+ NTP_4_2_7P413
+
+ ntpq/ntpq.1ntpqman@1.234 +6 -6
+ NTP_4_2_7P413
+
+ ntpq/ntpq.1ntpqmdoc@1.234 +2 -2
+ NTP_4_2_7P413
+
+ ntpq/ntpq.html@1.78 +2 -2
+ NTP_4_2_7P413
+
+ ntpq/ntpq.man.in@1.234 +6 -6
+ NTP_4_2_7P413
+
+ ntpq/ntpq.mdoc.in@1.234 +2 -2
+ NTP_4_2_7P413
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.405 +2 -2
+ NTP_4_2_7P413
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.420 +7 -7
+ NTP_4_2_7P413
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.420 +3 -3
+ NTP_4_2_7P413
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.234 +7 -7
+ NTP_4_2_7P413
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.234 +3 -3
+ NTP_4_2_7P413
+
+ ntpsnmpd/ntpsnmpd.html@1.76 +1 -1
+ NTP_4_2_7P413
+
+ ntpsnmpd/ntpsnmpd.man.in@1.234 +7 -7
+ NTP_4_2_7P413
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.234 +3 -3
+ NTP_4_2_7P413
+
+ packageinfo.sh@1.417 +1 -1
+ NTP_4_2_7P413
+
+ scripts/invoke-plot_summary.texi@1.14 +1 -1
+ NTP_4_2_7P413
+
+ scripts/invoke-summary.texi@1.14 +1 -1
+ NTP_4_2_7P413
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.223 +2 -2
+ NTP_4_2_7P413
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.224 +32 -3
+ NTP_4_2_7P413
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.224 +21 -2
+ NTP_4_2_7P413
+
+ scripts/ntp-wait/ntp-wait.html@1.240 +2 -2
+ NTP_4_2_7P413
+
+ scripts/ntp-wait/ntp-wait.man.in@1.224 +32 -3
+ NTP_4_2_7P413
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.224 +21 -2
+ NTP_4_2_7P413
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.12 +2 -2
+ NTP_4_2_7P413
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.3 +32 -3
+ NTP_4_2_7P413
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.3 +21 -2
+ NTP_4_2_7P413
+
+ scripts/ntpsweep/ntpsweep.html@1.13 +2 -2
+ NTP_4_2_7P413
+
+ scripts/ntpsweep/ntpsweep.man.in@1.3 +32 -3
+ NTP_4_2_7P413
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.4 +21 -2
+ NTP_4_2_7P413
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.12 +2 -2
+ NTP_4_2_7P413
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.3 +32 -3
+ NTP_4_2_7P413
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.3 +21 -2
+ NTP_4_2_7P413
+
+ scripts/ntptrace/ntptrace.html@1.13 +2 -2
+ NTP_4_2_7P413
+
+ scripts/ntptrace/ntptrace.man.in@1.3 +32 -3
+ NTP_4_2_7P413
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.4 +21 -2
+ NTP_4_2_7P413
+
+ scripts/plot_summary.1plot_summaryman@1.14 +33 -3
+ NTP_4_2_7P413
+
+ scripts/plot_summary.1plot_summarymdoc@1.14 +22 -2
+ NTP_4_2_7P413
+
+ scripts/plot_summary.html@1.14 +28 -46
+ NTP_4_2_7P413
+
+ scripts/plot_summary.man.in@1.14 +33 -3
+ NTP_4_2_7P413
+
+ scripts/plot_summary.mdoc.in@1.14 +22 -2
+ NTP_4_2_7P413
+
+ scripts/summary.1summaryman@1.14 +32 -3
+ NTP_4_2_7P413
+
+ scripts/summary.1summarymdoc@1.14 +21 -2
+ NTP_4_2_7P413
+
+ scripts/summary.html@1.14 +26 -38
+ NTP_4_2_7P413
+
+ scripts/summary.man.in@1.14 +32 -3
+ NTP_4_2_7P413
+
+ scripts/summary.mdoc.in@1.14 +21 -2
+ NTP_4_2_7P413
+
+ sntp/invoke-sntp.texi@1.402 +2 -2
+ NTP_4_2_7P413
+
+ sntp/sntp-opts.c@1.417 +7 -7
+ NTP_4_2_7P413
+
+ sntp/sntp-opts.h@1.417 +3 -3
+ NTP_4_2_7P413
+
+ sntp/sntp.1sntpman@1.237 +7 -7
+ NTP_4_2_7P413
+
+ sntp/sntp.1sntpmdoc@1.237 +3 -3
+ NTP_4_2_7P413
+
+ sntp/sntp.html@1.417 +2 -2
+ NTP_4_2_7P413
+
+ sntp/sntp.man.in@1.237 +7 -7
+ NTP_4_2_7P413
+
+ sntp/sntp.mdoc.in@1.237 +3 -3
+ NTP_4_2_7P413
+
+ util/invoke-ntp-keygen.texi@1.406 +2 -2
+ NTP_4_2_7P413
+
+ util/ntp-keygen-opts.c@1.420 +7 -7
+ NTP_4_2_7P413
+
+ util/ntp-keygen-opts.h@1.420 +3 -3
+ NTP_4_2_7P413
+
+ util/ntp-keygen.1ntp-keygenman@1.234 +7 -7
+ NTP_4_2_7P413
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.234 +3 -3
+ NTP_4_2_7P413
+
+ util/ntp-keygen.html@1.82 +2 -2
+ NTP_4_2_7P413
+
+ util/ntp-keygen.man.in@1.234 +7 -7
+ NTP_4_2_7P413
+
+ util/ntp-keygen.mdoc.in@1.234 +3 -3
+ NTP_4_2_7P413
+
+ChangeSet@1.3060, 2014-01-27 19:35:20-05:00, stenn@deacon.udel.edu
+ update .point-changed-filelist
+
+ .point-changed-filelist@1.23 +12 -0
+ update .point-changed-filelist
+
+ChangeSet@1.3059, 2014-01-27 19:31:58-05:00, stenn@deacon.udel.edu
+ Add missing std_def_list
+
+ scripts/ntp-wait/Makefile.am@1.5 +8 -0
+ Add missing std_def_list
+
+ scripts/ntpsweep/Makefile.am@1.6 +8 -0
+ Add missing std_def_list
+
+ scripts/ntptrace/Makefile.am@1.6 +8 -0
+ Add missing std_def_list
+
+ChangeSet@1.3058, 2014-01-27 09:55:09+00:00, stenn@psp-fb1.ntp.org
+ Require a version string for perl scripts that use autogen
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.2 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/calc_tickadj/calc_tickadj-opts.def@1.2 +7 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.2 +7 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.2 +6 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/calc_tickadj/calc_tickadj.html@1.2 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.2 +6 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.4 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/invoke-plot_summary.texi@1.13 +2 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/invoke-summary.texi@1.13 +2 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntp-wait/ntp-wait-opts@1.2 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntp-wait/ntp-wait-opts.def@1.10 +6 -4
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.223 +71 -72
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.223 +27 -53
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntp-wait/ntp-wait.man.in@1.223 +71 -72
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.223 +27 -53
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntpsweep/ntpsweep-opts@1.2 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntpsweep/ntpsweep-opts.def@1.2 +3 -0
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.2 +7 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.2 +6 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntpsweep/ntpsweep.man.in@1.2 +7 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.3 +6 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntptrace/ntptrace-opts@1.2 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntptrace/ntptrace-opts.def@1.2 +7 -4
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.2 +7 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.2 +6 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntptrace/ntptrace.man.in@1.2 +7 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.3 +6 -2
+ Require a version string for perl scripts that use autogen
+
+ scripts/plot_summary-opts@1.2 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/plot_summary-opts.def@1.2 +6 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/plot_summary.1plot_summaryman@1.13 +8 -33
+ Require a version string for perl scripts that use autogen
+
+ scripts/plot_summary.1plot_summarymdoc@1.13 +7 -23
+ Require a version string for perl scripts that use autogen
+
+ scripts/plot_summary.html@1.13 +46 -28
+ Require a version string for perl scripts that use autogen
+
+ scripts/plot_summary.man.in@1.13 +8 -33
+ Require a version string for perl scripts that use autogen
+
+ scripts/plot_summary.mdoc.in@1.13 +7 -23
+ Require a version string for perl scripts that use autogen
+
+ scripts/summary-opts@1.2 +1 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/summary-opts.def@1.2 +6 -1
+ Require a version string for perl scripts that use autogen
+
+ scripts/summary.1summaryman@1.13 +8 -32
+ Require a version string for perl scripts that use autogen
+
+ scripts/summary.1summarymdoc@1.13 +7 -22
+ Require a version string for perl scripts that use autogen
+
+ scripts/summary.html@1.13 +38 -26
+ Require a version string for perl scripts that use autogen
+
+ scripts/summary.man.in@1.13 +8 -32
+ Require a version string for perl scripts that use autogen
+
+ scripts/summary.mdoc.in@1.13 +7 -22
+ Require a version string for perl scripts that use autogen
+
+ChangeSet@1.3057, 2014-01-27 09:46:42+00:00, stenn@psp-fb1.ntp.org
+ Require a version string for perl scripts that use autogen
+
+ ChangeLog@1.1392 +2 -1
+ Require a version string for perl scripts that use autogen
+
+ sntp/ag-tpl/perlopt.tpl@1.2 +3 -2
+ Require a version string for perl scripts that use autogen
+
+ChangeSet@1.3056, 2014-01-27 09:42:49+00:00, stenn@psp-fb1.ntp.org
+ html/ cleanup
+
+ ChangeLog@1.1391 +1 -0
+ html/ cleanup
+
+ html/assoc.html@1.39 +1 -1
+ html/ cleanup
+
+ html/drivers/driver8.html@1.30 +1 -1
+ html/ cleanup
+
+ html/hints/solaris.html@1.11 +90 -1
+ html/ cleanup
+
+ html/pic/stats.gif@1.1, stenn@stenn.ntp.org +272 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/html/pic/stats.gif
+
+ html/pic/stats.gif@1.0, stenn@stenn.ntp.org +0 -0
+
+ html/pic/time1.gif@1.1, stenn@stenn.ntp.org +102 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/html/pic/time1.gif
+
+ html/pic/time1.gif@1.0, stenn@stenn.ntp.org +0 -0
+
+ html/refclock.html@1.39 +1 -1
+ html/ cleanup
+
+ChangeSet@1.3055, 2014-01-27 09:13:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P412
+ TAG: NTP_4_2_7P412
+
+ ChangeLog@1.1390 +1 -0
+ NTP_4_2_7P412
+
+ ntpd/invoke-ntp.conf.texi@1.90 +1 -1
+ NTP_4_2_7P412
+
+ ntpd/invoke-ntp.keys.texi@1.88 +1 -1
+ NTP_4_2_7P412
+
+ ntpd/invoke-ntpd.texi@1.404 +2 -2
+ NTP_4_2_7P412
+
+ ntpd/ntp.conf.5man@1.124 +7 -7
+ NTP_4_2_7P412
+
+ ntpd/ntp.conf.5mdoc@1.124 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntp.conf.html@1.85 +1 -1
+ NTP_4_2_7P412
+
+ ntpd/ntp.conf.man.in@1.124 +7 -7
+ NTP_4_2_7P412
+
+ ntpd/ntp.conf.mdoc.in@1.124 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntp.keys.5man@1.122 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntp.keys.5mdoc@1.122 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntp.keys.html@1.86 +1 -1
+ NTP_4_2_7P412
+
+ ntpd/ntp.keys.man.in@1.122 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntp.keys.mdoc.in@1.122 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntpd-opts.c@1.422 +7 -7
+ NTP_4_2_7P412
+
+ ntpd/ntpd-opts.h@1.422 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntpd.1ntpdman@1.233 +7 -7
+ NTP_4_2_7P412
+
+ ntpd/ntpd.1ntpdmdoc@1.233 +3 -3
+ NTP_4_2_7P412
+
+ ntpd/ntpd.html@1.80 +2 -2
+ NTP_4_2_7P412
+
+ ntpd/ntpd.man.in@1.233 +7 -7
+ NTP_4_2_7P412
+
+ ntpd/ntpd.mdoc.in@1.233 +3 -3
+ NTP_4_2_7P412
+
+ ntpdc/invoke-ntpdc.texi@1.401 +2 -2
+ NTP_4_2_7P412
+
+ ntpdc/ntpdc-opts.c@1.416 +7 -7
+ NTP_4_2_7P412
+
+ ntpdc/ntpdc-opts.h@1.416 +3 -3
+ NTP_4_2_7P412
+
+ ntpdc/ntpdc.1ntpdcman@1.232 +893 -0
+ NTP_4_2_7P412
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.232 +2 -2
+ NTP_4_2_7P412
+
+ ntpdc/ntpdc.html@1.245 +2 -2
+ NTP_4_2_7P412
+
+ ntpdc/ntpdc.man.in@1.232 +893 -0
+ NTP_4_2_7P412
+
+ ntpdc/ntpdc.mdoc.in@1.232 +2 -2
+ NTP_4_2_7P412
+
+ ntpq/invoke-ntpq.texi@1.405 +2 -2
+ NTP_4_2_7P412
+
+ ntpq/ntpq-opts.c@1.419 +7 -7
+ NTP_4_2_7P412
+
+ ntpq/ntpq-opts.h@1.419 +3 -3
+ NTP_4_2_7P412
+
+ ntpq/ntpq.1ntpqman@1.233 +6 -6
+ NTP_4_2_7P412
+
+ ntpq/ntpq.1ntpqmdoc@1.233 +2 -2
+ NTP_4_2_7P412
+
+ ntpq/ntpq.html@1.77 +2 -2
+ NTP_4_2_7P412
+
+ ntpq/ntpq.man.in@1.233 +6 -6
+ NTP_4_2_7P412
+
+ ntpq/ntpq.mdoc.in@1.233 +2 -2
+ NTP_4_2_7P412
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.404 +2 -2
+ NTP_4_2_7P412
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.419 +7 -7
+ NTP_4_2_7P412
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.419 +3 -3
+ NTP_4_2_7P412
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.233 +7 -7
+ NTP_4_2_7P412
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.233 +3 -3
+ NTP_4_2_7P412
+
+ ntpsnmpd/ntpsnmpd.html@1.75 +1 -1
+ NTP_4_2_7P412
+
+ ntpsnmpd/ntpsnmpd.man.in@1.233 +7 -7
+ NTP_4_2_7P412
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.233 +3 -3
+ NTP_4_2_7P412
+
+ packageinfo.sh@1.416 +1 -1
+ NTP_4_2_7P412
+
+ scripts/invoke-plot_summary.texi@1.12 +1 -1
+ NTP_4_2_7P412
+
+ scripts/invoke-summary.texi@1.12 +1 -1
+ NTP_4_2_7P412
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.222 +1 -1
+ NTP_4_2_7P412
+
+ scripts/ntp-wait/ntp-wait.html@1.239 +1 -1
+ NTP_4_2_7P412
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.11 +1 -1
+ NTP_4_2_7P412
+
+ scripts/ntpsweep/ntpsweep.html@1.12 +1 -1
+ NTP_4_2_7P412
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.11 +1 -1
+ NTP_4_2_7P412
+
+ scripts/ntptrace/ntptrace.html@1.12 +1 -1
+ NTP_4_2_7P412
+
+ scripts/plot_summary.1plot_summaryman@1.12 +6 -6
+ NTP_4_2_7P412
+
+ scripts/plot_summary.1plot_summarymdoc@1.12 +2 -2
+ NTP_4_2_7P412
+
+ scripts/plot_summary.html@1.12 +1 -1
+ NTP_4_2_7P412
+
+ scripts/plot_summary.man.in@1.12 +6 -6
+ NTP_4_2_7P412
+
+ scripts/plot_summary.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P412
+
+ scripts/summary.1summaryman@1.12 +6 -6
+ NTP_4_2_7P412
+
+ scripts/summary.1summarymdoc@1.12 +2 -2
+ NTP_4_2_7P412
+
+ scripts/summary.html@1.12 +1 -1
+ NTP_4_2_7P412
+
+ scripts/summary.man.in@1.12 +6 -6
+ NTP_4_2_7P412
+
+ scripts/summary.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P412
+
+ sntp/invoke-sntp.texi@1.401 +2 -2
+ NTP_4_2_7P412
+
+ sntp/sntp-opts.c@1.416 +7 -7
+ NTP_4_2_7P412
+
+ sntp/sntp-opts.h@1.416 +3 -3
+ NTP_4_2_7P412
+
+ sntp/sntp.1sntpman@1.236 +372 -0
+ NTP_4_2_7P412
+
+ sntp/sntp.1sntpmdoc@1.236 +3 -3
+ NTP_4_2_7P412
+
+ sntp/sntp.html@1.416 +2 -2
+ NTP_4_2_7P412
+
+ sntp/sntp.man.in@1.236 +372 -0
+ NTP_4_2_7P412
+
+ sntp/sntp.mdoc.in@1.236 +3 -3
+ NTP_4_2_7P412
+
+ util/invoke-ntp-keygen.texi@1.405 +2 -2
+ NTP_4_2_7P412
+
+ util/ntp-keygen-opts.c@1.419 +7 -7
+ NTP_4_2_7P412
+
+ util/ntp-keygen-opts.h@1.419 +3 -3
+ NTP_4_2_7P412
+
+ util/ntp-keygen.1ntp-keygenman@1.233 +7 -7
+ NTP_4_2_7P412
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.233 +3 -3
+ NTP_4_2_7P412
+
+ util/ntp-keygen.html@1.81 +2 -2
+ NTP_4_2_7P412
+
+ util/ntp-keygen.man.in@1.233 +7 -7
+ NTP_4_2_7P412
+
+ util/ntp-keygen.mdoc.in@1.233 +3 -3
+ NTP_4_2_7P412
+
+ChangeSet@1.3054, 2014-01-20 02:39:11+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups
+
+ ChangeLog@1.1389 +1 -0
+ [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups
+
+ bootstrap@1.44 +26 -7
+ [Bug 2540] bootstrap script needs to 'touch' files in finer-grained groups
+
+ChangeSet@1.3053, 2014-01-12 10:07:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P411
+ TAG: NTP_4_2_7P411
+
+ ChangeLog@1.1388 +1 -0
+ NTP_4_2_7P411
+
+ ntpd/invoke-ntp.conf.texi@1.89 +1 -1
+ NTP_4_2_7P411
+
+ ntpd/invoke-ntp.keys.texi@1.87 +1 -1
+ NTP_4_2_7P411
+
+ ntpd/invoke-ntpd.texi@1.403 +2 -2
+ NTP_4_2_7P411
+
+ ntpd/ntp.conf.5man@1.123 +7 -7
+ NTP_4_2_7P411
+
+ ntpd/ntp.conf.5mdoc@1.123 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntp.conf.html@1.84 +14 -12
+ NTP_4_2_7P411
+
+ ntpd/ntp.conf.man.in@1.123 +7 -7
+ NTP_4_2_7P411
+
+ ntpd/ntp.conf.mdoc.in@1.123 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntp.keys.5man@1.121 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntp.keys.5mdoc@1.121 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntp.keys.html@1.85 +1 -1
+ NTP_4_2_7P411
+
+ ntpd/ntp.keys.man.in@1.121 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntp.keys.mdoc.in@1.121 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntpd-opts.c@1.421 +7 -7
+ NTP_4_2_7P411
+
+ ntpd/ntpd-opts.h@1.421 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntpd.1ntpdman@1.232 +7 -7
+ NTP_4_2_7P411
+
+ ntpd/ntpd.1ntpdmdoc@1.232 +3 -3
+ NTP_4_2_7P411
+
+ ntpd/ntpd.html@1.79 +2 -2
+ NTP_4_2_7P411
+
+ ntpd/ntpd.man.in@1.232 +7 -7
+ NTP_4_2_7P411
+
+ ntpd/ntpd.mdoc.in@1.232 +3 -3
+ NTP_4_2_7P411
+
+ ntpdc/invoke-ntpdc.texi@1.400 +2 -2
+ NTP_4_2_7P411
+
+ ntpdc/ntpdc-opts.c@1.415 +7 -7
+ NTP_4_2_7P411
+
+ ntpdc/ntpdc-opts.h@1.415 +3 -3
+ NTP_4_2_7P411
+
+ ntpdc/ntpdc.1ntpdcman@1.231 +0 -893
+ NTP_4_2_7P411
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.231 +2 -2
+ NTP_4_2_7P411
+
+ ntpdc/ntpdc.html@1.244 +2 -2
+ NTP_4_2_7P411
+
+ ntpdc/ntpdc.man.in@1.231 +0 -893
+ NTP_4_2_7P411
+
+ ntpdc/ntpdc.mdoc.in@1.231 +2 -2
+ NTP_4_2_7P411
+
+ ntpq/invoke-ntpq.texi@1.404 +2 -2
+ NTP_4_2_7P411
+
+ ntpq/ntpq-opts.c@1.418 +7 -7
+ NTP_4_2_7P411
+
+ ntpq/ntpq-opts.h@1.418 +3 -3
+ NTP_4_2_7P411
+
+ ntpq/ntpq.1ntpqman@1.232 +6 -6
+ NTP_4_2_7P411
+
+ ntpq/ntpq.1ntpqmdoc@1.232 +2 -2
+ NTP_4_2_7P411
+
+ ntpq/ntpq.html@1.76 +2 -2
+ NTP_4_2_7P411
+
+ ntpq/ntpq.man.in@1.232 +6 -6
+ NTP_4_2_7P411
+
+ ntpq/ntpq.mdoc.in@1.232 +2 -2
+ NTP_4_2_7P411
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.403 +2 -2
+ NTP_4_2_7P411
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.418 +7 -7
+ NTP_4_2_7P411
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.418 +3 -3
+ NTP_4_2_7P411
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.232 +14 -14
+ NTP_4_2_7P411
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.232 +3 -3
+ NTP_4_2_7P411
+
+ ntpsnmpd/ntpsnmpd.html@1.74 +1 -1
+ NTP_4_2_7P411
+
+ ntpsnmpd/ntpsnmpd.man.in@1.232 +14 -14
+ NTP_4_2_7P411
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.232 +3 -3
+ NTP_4_2_7P411
+
+ packageinfo.sh@1.415 +1 -1
+ NTP_4_2_7P411
+
+ scripts/invoke-plot_summary.texi@1.11 +1 -1
+ NTP_4_2_7P411
+
+ scripts/invoke-summary.texi@1.11 +1 -1
+ NTP_4_2_7P411
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.221 +1 -1
+ NTP_4_2_7P411
+
+ scripts/ntp-wait/ntp-wait.html@1.238 +1 -1
+ NTP_4_2_7P411
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.10 +1 -1
+ NTP_4_2_7P411
+
+ scripts/ntpsweep/ntpsweep.html@1.11 +1 -1
+ NTP_4_2_7P411
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.10 +1 -1
+ NTP_4_2_7P411
+
+ scripts/ntptrace/ntptrace.html@1.11 +1 -1
+ NTP_4_2_7P411
+
+ scripts/plot_summary.1plot_summaryman@1.11 +6 -6
+ NTP_4_2_7P411
+
+ scripts/plot_summary.1plot_summarymdoc@1.11 +2 -2
+ NTP_4_2_7P411
+
+ scripts/plot_summary.html@1.11 +1 -1
+ NTP_4_2_7P411
+
+ scripts/plot_summary.man.in@1.11 +6 -6
+ NTP_4_2_7P411
+
+ scripts/plot_summary.mdoc.in@1.11 +2 -2
+ NTP_4_2_7P411
+
+ scripts/summary.1summaryman@1.11 +6 -6
+ NTP_4_2_7P411
+
+ scripts/summary.1summarymdoc@1.11 +2 -2
+ NTP_4_2_7P411
+
+ scripts/summary.html@1.11 +1 -1
+ NTP_4_2_7P411
+
+ scripts/summary.man.in@1.11 +6 -6
+ NTP_4_2_7P411
+
+ scripts/summary.mdoc.in@1.11 +2 -2
+ NTP_4_2_7P411
+
+ sntp/invoke-sntp.texi@1.400 +2 -2
+ NTP_4_2_7P411
+
+ sntp/sntp-opts.c@1.415 +7 -7
+ NTP_4_2_7P411
+
+ sntp/sntp-opts.h@1.415 +3 -3
+ NTP_4_2_7P411
+
+ sntp/sntp.1sntpman@1.235 +0 -372
+ NTP_4_2_7P411
+
+ sntp/sntp.1sntpmdoc@1.235 +3 -3
+ NTP_4_2_7P411
+
+ sntp/sntp.html@1.415 +2 -2
+ NTP_4_2_7P411
+
+ sntp/sntp.man.in@1.235 +0 -372
+ NTP_4_2_7P411
+
+ sntp/sntp.mdoc.in@1.235 +3 -3
+ NTP_4_2_7P411
+
+ util/invoke-ntp-keygen.texi@1.404 +2 -2
+ NTP_4_2_7P411
+
+ util/ntp-keygen-opts.c@1.418 +7 -7
+ NTP_4_2_7P411
+
+ util/ntp-keygen-opts.h@1.418 +3 -3
+ NTP_4_2_7P411
+
+ util/ntp-keygen.1ntp-keygenman@1.232 +7 -7
+ NTP_4_2_7P411
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.232 +3 -3
+ NTP_4_2_7P411
+
+ util/ntp-keygen.html@1.80 +2 -2
+ NTP_4_2_7P411
+
+ util/ntp-keygen.man.in@1.232 +7 -7
+ NTP_4_2_7P411
+
+ util/ntp-keygen.mdoc.in@1.232 +3 -3
+ NTP_4_2_7P411
+
+ChangeSet@1.3052, 2014-01-09 05:21:23-05:00, stenn@deacon.udel.edu
+ [Bug 2532] Note in ntpdc docs that "enable pps" only works on older ntpd
+
+ ChangeLog@1.1387 +1 -0
+ [Bug 2532] Note in ntpdc docs that "enable pps" only works on older ntpd
+
+ html/ntpdc.html@1.34 +1 -0
+ [Bug 2532] Note in ntpdc docs that "enable pps" only works on older ntpd
+
+ChangeSet@1.3051, 2014-01-08 11:47:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P410
+ TAG: NTP_4_2_7P410
+
+ ChangeLog@1.1386 +1 -0
+ NTP_4_2_7P410
+
+ ntpd/invoke-ntp.conf.texi@1.88 +16 -14
+ NTP_4_2_7P410
+
+ ntpd/invoke-ntp.keys.texi@1.86 +1 -1
+ NTP_4_2_7P410
+
+ ntpd/invoke-ntpd.texi@1.402 +2 -2
+ NTP_4_2_7P410
+
+ ntpd/ntp.conf.5man@1.122 +24 -22
+ NTP_4_2_7P410
+
+ ntpd/ntp.conf.5mdoc@1.122 +21 -19
+ NTP_4_2_7P410
+
+ ntpd/ntp.conf.html@1.83 +1 -1
+ NTP_4_2_7P410
+
+ ntpd/ntp.conf.man.in@1.122 +24 -22
+ NTP_4_2_7P410
+
+ ntpd/ntp.conf.mdoc.in@1.122 +21 -19
+ NTP_4_2_7P410
+
+ ntpd/ntp.keys.5man@1.120 +4 -4
+ NTP_4_2_7P410
+
+ ntpd/ntp.keys.5mdoc@1.120 +4 -4
+ NTP_4_2_7P410
+
+ ntpd/ntp.keys.html@1.84 +1 -1
+ NTP_4_2_7P410
+
+ ntpd/ntp.keys.man.in@1.120 +4 -4
+ NTP_4_2_7P410
+
+ ntpd/ntp.keys.mdoc.in@1.120 +4 -4
+ NTP_4_2_7P410
+
+ ntpd/ntpd-opts.c@1.420 +7 -7
+ NTP_4_2_7P410
+
+ ntpd/ntpd-opts.h@1.420 +3 -3
+ NTP_4_2_7P410
+
+ ntpd/ntpd.1ntpdman@1.231 +8 -8
+ NTP_4_2_7P410
+
+ ntpd/ntpd.1ntpdmdoc@1.231 +4 -4
+ NTP_4_2_7P410
+
+ ntpd/ntpd.html@1.78 +2 -2
+ NTP_4_2_7P410
+
+ ntpd/ntpd.man.in@1.231 +8 -8
+ NTP_4_2_7P410
+
+ ntpd/ntpd.mdoc.in@1.231 +4 -4
+ NTP_4_2_7P410
+
+ ntpdc/invoke-ntpdc.texi@1.399 +2 -2
+ NTP_4_2_7P410
+
+ ntpdc/ntpdc-opts.c@1.414 +7 -7
+ NTP_4_2_7P410
+
+ ntpdc/ntpdc-opts.h@1.414 +3 -3
+ NTP_4_2_7P410
+
+ ntpdc/ntpdc.1ntpdcman@1.230 +7 -7
+ NTP_4_2_7P410
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.230 +3 -3
+ NTP_4_2_7P410
+
+ ntpdc/ntpdc.html@1.243 +2 -2
+ NTP_4_2_7P410
+
+ ntpdc/ntpdc.man.in@1.230 +7 -7
+ NTP_4_2_7P410
+
+ ntpdc/ntpdc.mdoc.in@1.230 +3 -3
+ NTP_4_2_7P410
+
+ ntpq/invoke-ntpq.texi@1.403 +2 -2
+ NTP_4_2_7P410
+
+ ntpq/ntpq-opts.c@1.417 +7 -7
+ NTP_4_2_7P410
+
+ ntpq/ntpq-opts.h@1.417 +3 -3
+ NTP_4_2_7P410
+
+ ntpq/ntpq.1ntpqman@1.231 +7 -7
+ NTP_4_2_7P410
+
+ ntpq/ntpq.1ntpqmdoc@1.231 +3 -3
+ NTP_4_2_7P410
+
+ ntpq/ntpq.html@1.75 +2 -2
+ NTP_4_2_7P410
+
+ ntpq/ntpq.man.in@1.231 +7 -7
+ NTP_4_2_7P410
+
+ ntpq/ntpq.mdoc.in@1.231 +3 -3
+ NTP_4_2_7P410
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.402 +2 -2
+ NTP_4_2_7P410
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.417 +7 -7
+ NTP_4_2_7P410
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.417 +3 -3
+ NTP_4_2_7P410
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.231 +15 -15
+ NTP_4_2_7P410
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.231 +4 -4
+ NTP_4_2_7P410
+
+ ntpsnmpd/ntpsnmpd.html@1.73 +1 -1
+ NTP_4_2_7P410
+
+ ntpsnmpd/ntpsnmpd.man.in@1.231 +15 -15
+ NTP_4_2_7P410
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.231 +4 -4
+ NTP_4_2_7P410
+
+ packageinfo.sh@1.414 +1 -1
+ NTP_4_2_7P410
+
+ scripts/invoke-plot_summary.texi@1.10 +1 -1
+ NTP_4_2_7P410
+
+ scripts/invoke-summary.texi@1.10 +14 -1
+ NTP_4_2_7P410
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.220 +29 -1
+ NTP_4_2_7P410
+
+ scripts/ntp-wait/ntp-wait.html@1.237 +31 -2
+ NTP_4_2_7P410
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.9 +1 -1
+ NTP_4_2_7P410
+
+ scripts/ntpsweep/ntpsweep.html@1.10 +1 -1
+ NTP_4_2_7P410
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.9 +1 -1
+ NTP_4_2_7P410
+
+ scripts/ntptrace/ntptrace.html@1.10 +1 -1
+ NTP_4_2_7P410
+
+ scripts/plot_summary.1plot_summaryman@1.10 +138 -0
+ NTP_4_2_7P410
+
+ scripts/plot_summary.1plot_summarymdoc@1.10 +3 -3
+ NTP_4_2_7P410
+
+ scripts/plot_summary.html@1.10 +1 -1
+ NTP_4_2_7P410
+
+ scripts/plot_summary.man.in@1.10 +138 -0
+ NTP_4_2_7P410
+
+ scripts/plot_summary.mdoc.in@1.10 +3 -3
+ NTP_4_2_7P410
+
+ scripts/summary.1summaryman@1.10 +7 -7
+ NTP_4_2_7P410
+
+ scripts/summary.1summarymdoc@1.10 +3 -3
+ NTP_4_2_7P410
+
+ scripts/summary.html@1.10 +15 -2
+ NTP_4_2_7P410
+
+ scripts/summary.man.in@1.10 +7 -7
+ NTP_4_2_7P410
+
+ scripts/summary.mdoc.in@1.10 +3 -3
+ NTP_4_2_7P410
+
+ sntp/invoke-sntp.texi@1.399 +2 -2
+ NTP_4_2_7P410
+
+ sntp/sntp-opts.c@1.414 +7 -7
+ NTP_4_2_7P410
+
+ sntp/sntp-opts.h@1.414 +3 -3
+ NTP_4_2_7P410
+
+ sntp/sntp.1sntpman@1.234 +8 -8
+ NTP_4_2_7P410
+
+ sntp/sntp.1sntpmdoc@1.234 +4 -4
+ NTP_4_2_7P410
+
+ sntp/sntp.html@1.414 +2 -2
+ NTP_4_2_7P410
+
+ sntp/sntp.man.in@1.234 +8 -8
+ NTP_4_2_7P410
+
+ sntp/sntp.mdoc.in@1.234 +4 -4
+ NTP_4_2_7P410
+
+ util/invoke-ntp-keygen.texi@1.403 +2 -2
+ NTP_4_2_7P410
+
+ util/ntp-keygen-opts.c@1.417 +7 -7
+ NTP_4_2_7P410
+
+ util/ntp-keygen-opts.h@1.417 +3 -3
+ NTP_4_2_7P410
+
+ util/ntp-keygen.1ntp-keygenman@1.231 +8 -8
+ NTP_4_2_7P410
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.231 +4 -4
+ NTP_4_2_7P410
+
+ util/ntp-keygen.html@1.79 +2 -2
+ NTP_4_2_7P410
+
+ util/ntp-keygen.man.in@1.231 +8 -8
+ NTP_4_2_7P410
+
+ util/ntp-keygen.mdoc.in@1.231 +4 -4
+ NTP_4_2_7P410
+
+ChangeSet@1.3050, 2014-01-08 10:25:17+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2530] Fix documentation for enable/disable mode7 and pps
+
+ ChangeLog@1.1385 +1 -0
+ [Bug 2530] Fix documentation for enable/disable mode7 and pps
+
+ html/miscopt.html@1.76 +4 -4
+ [Bug 2530] Fix documentation for enable/disable mode7 and pps
+
+ ntpd/ntp.conf.def@1.10 +17 -15
+ [Bug 2530] Fix documentation for enable/disable mode7 and pps
+
+ChangeSet@1.3049, 2014-01-08 02:46:45-05:00, stenn@deacon.udel.edu
+ [Bug 2332] Force reference to 'libgcc_s' when using GCC and GNU ld
+
+ sntp/m4/ntp_libntp.m4@1.25 +5 -3
+ [Bug 2332] Force reference to 'libgcc_s' when using GCC and GNU ld
+
+ChangeSet@1.3046.2.2, 2014-01-07 20:33:45-05:00, stenn@deacon.udel.edu
+ Cleanup to the new scripts/*/Makefile.am files
+
+ ChangeLog@1.1382.1.2 +1 -0
+
+ scripts/calc_tickadj/Makefile.am@1.6 +2 -0
+
+ scripts/ntp-wait/Makefile.am@1.4 +1 -0
+
+ scripts/ntptrace/Makefile.am@1.5 +2 -0
+
+ChangeSet@1.3046.2.1, 2014-01-04 11:22:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P409
+ TAG: NTP_4_2_7P409
+
+ ChangeLog@1.1382.1.1 +1 -0
+ NTP_4_2_7P409
+
+ ntpd/invoke-ntp.conf.texi@1.87 +1 -1
+ NTP_4_2_7P409
+
+ ntpd/invoke-ntp.keys.texi@1.85 +1 -1
+ NTP_4_2_7P409
+
+ ntpd/invoke-ntpd.texi@1.401 +2 -2
+ NTP_4_2_7P409
+
+ ntpd/ntp.conf.5man@1.121 +7 -7
+ NTP_4_2_7P409
+
+ ntpd/ntp.conf.5mdoc@1.121 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntp.conf.html@1.82 +1 -1
+ NTP_4_2_7P409
+
+ ntpd/ntp.conf.man.in@1.121 +7 -7
+ NTP_4_2_7P409
+
+ ntpd/ntp.conf.mdoc.in@1.121 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntp.keys.5man@1.119 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntp.keys.5mdoc@1.119 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntp.keys.html@1.83 +1 -1
+ NTP_4_2_7P409
+
+ ntpd/ntp.keys.man.in@1.119 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntp.keys.mdoc.in@1.119 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntpd-opts.c@1.419 +7 -7
+ NTP_4_2_7P409
+
+ ntpd/ntpd-opts.h@1.419 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntpd.1ntpdman@1.230 +7 -7
+ NTP_4_2_7P409
+
+ ntpd/ntpd.1ntpdmdoc@1.230 +3 -3
+ NTP_4_2_7P409
+
+ ntpd/ntpd.html@1.77 +2 -2
+ NTP_4_2_7P409
+
+ ntpd/ntpd.man.in@1.230 +7 -7
+ NTP_4_2_7P409
+
+ ntpd/ntpd.mdoc.in@1.230 +3 -3
+ NTP_4_2_7P409
+
+ ntpdc/invoke-ntpdc.texi@1.398 +2 -2
+ NTP_4_2_7P409
+
+ ntpdc/ntpdc-opts.c@1.413 +7 -7
+ NTP_4_2_7P409
+
+ ntpdc/ntpdc-opts.h@1.413 +3 -3
+ NTP_4_2_7P409
+
+ ntpdc/ntpdc.1ntpdcman@1.229 +6 -6
+ NTP_4_2_7P409
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.229 +2 -2
+ NTP_4_2_7P409
+
+ ntpdc/ntpdc.html@1.242 +2 -2
+ NTP_4_2_7P409
+
+ ntpdc/ntpdc.man.in@1.229 +6 -6
+ NTP_4_2_7P409
+
+ ntpdc/ntpdc.mdoc.in@1.229 +2 -2
+ NTP_4_2_7P409
+
+ ntpq/invoke-ntpq.texi@1.402 +2 -2
+ NTP_4_2_7P409
+
+ ntpq/ntpq-opts.c@1.416 +7 -7
+ NTP_4_2_7P409
+
+ ntpq/ntpq-opts.h@1.416 +3 -3
+ NTP_4_2_7P409
+
+ ntpq/ntpq.1ntpqman@1.230 +6 -6
+ NTP_4_2_7P409
+
+ ntpq/ntpq.1ntpqmdoc@1.230 +2 -2
+ NTP_4_2_7P409
+
+ ntpq/ntpq.html@1.74 +2 -2
+ NTP_4_2_7P409
+
+ ntpq/ntpq.man.in@1.230 +6 -6
+ NTP_4_2_7P409
+
+ ntpq/ntpq.mdoc.in@1.230 +2 -2
+ NTP_4_2_7P409
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.401 +2 -2
+ NTP_4_2_7P409
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.416 +7 -7
+ NTP_4_2_7P409
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.416 +3 -3
+ NTP_4_2_7P409
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.230 +14 -14
+ NTP_4_2_7P409
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.230 +3 -3
+ NTP_4_2_7P409
+
+ ntpsnmpd/ntpsnmpd.html@1.72 +1 -1
+ NTP_4_2_7P409
+
+ ntpsnmpd/ntpsnmpd.man.in@1.230 +14 -14
+ NTP_4_2_7P409
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.230 +3 -3
+ NTP_4_2_7P409
+
+ packageinfo.sh@1.413 +1 -1
+ NTP_4_2_7P409
+
+ scripts/invoke-plot_summary.texi@1.9 +1 -1
+ NTP_4_2_7P409
+
+ scripts/invoke-summary.texi@1.9 +1 -14
+ NTP_4_2_7P409
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.219 +1 -29
+ NTP_4_2_7P409
+
+ scripts/ntp-wait/ntp-wait.html@1.236 +2 -31
+ NTP_4_2_7P409
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.8 +1 -1
+ NTP_4_2_7P409
+
+ scripts/ntpsweep/ntpsweep.html@1.9 +1 -1
+ NTP_4_2_7P409
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.8 +1 -1
+ NTP_4_2_7P409
+
+ scripts/ntptrace/ntptrace.html@1.9 +1 -1
+ NTP_4_2_7P409
+
+ scripts/plot_summary.1plot_summaryman@1.9 +0 -138
+ NTP_4_2_7P409
+
+ scripts/plot_summary.1plot_summarymdoc@1.9 +2 -2
+ NTP_4_2_7P409
+
+ scripts/plot_summary.html@1.9 +1 -1
+ NTP_4_2_7P409
+
+ scripts/plot_summary.man.in@1.9 +0 -138
+ NTP_4_2_7P409
+
+ scripts/plot_summary.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P409
+
+ scripts/summary.1summaryman@1.9 +6 -6
+ NTP_4_2_7P409
+
+ scripts/summary.1summarymdoc@1.9 +2 -2
+ NTP_4_2_7P409
+
+ scripts/summary.html@1.9 +2 -15
+ NTP_4_2_7P409
+
+ scripts/summary.man.in@1.9 +6 -6
+ NTP_4_2_7P409
+
+ scripts/summary.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P409
+
+ sntp/invoke-sntp.texi@1.398 +2 -2
+ NTP_4_2_7P409
+
+ sntp/sntp-opts.c@1.413 +7 -7
+ NTP_4_2_7P409
+
+ sntp/sntp-opts.h@1.413 +3 -3
+ NTP_4_2_7P409
+
+ sntp/sntp.1sntpman@1.233 +7 -7
+ NTP_4_2_7P409
+
+ sntp/sntp.1sntpmdoc@1.233 +3 -3
+ NTP_4_2_7P409
+
+ sntp/sntp.html@1.413 +2 -2
+ NTP_4_2_7P409
+
+ sntp/sntp.man.in@1.233 +7 -7
+ NTP_4_2_7P409
+
+ sntp/sntp.mdoc.in@1.233 +3 -3
+ NTP_4_2_7P409
+
+ util/invoke-ntp-keygen.texi@1.402 +2 -2
+ NTP_4_2_7P409
+
+ util/ntp-keygen-opts.c@1.416 +7 -7
+ NTP_4_2_7P409
+
+ util/ntp-keygen-opts.h@1.416 +3 -3
+ NTP_4_2_7P409
+
+ util/ntp-keygen.1ntp-keygenman@1.230 +7 -7
+ NTP_4_2_7P409
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.230 +3 -3
+ NTP_4_2_7P409
+
+ util/ntp-keygen.html@1.78 +2 -2
+ NTP_4_2_7P409
+
+ util/ntp-keygen.man.in@1.230 +7 -7
+ NTP_4_2_7P409
+
+ util/ntp-keygen.mdoc.in@1.230 +3 -3
+ NTP_4_2_7P409
+
+ChangeSet@1.3046.1.1, 2014-01-04 00:11:38+01:00, jnperlin@hydra.(none)
+ [Bug 2332] Force reference to 'libgcc_s' when using GCC, because threading+restricted user+locked memory otherwise fails on Linux.
+
+ ChangeLog@1.1383 +2 -0
+ [Bug 2332] Force reference to 'libgcc_s' when using GCC, because threading+restricted user+locked memory otherwise fails on Linux.
+
+ sntp/m4/ntp_libntp.m4@1.24 +10 -0
+ [Bug 2332] Force reference to 'libgcc_s' when using GCC, because threading+restricted user+locked memory otherwise fails on Linux.
+
+ChangeSet@1.3047, 2014-01-01 08:25:27+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2060] Warn about restrictions with "kod" but not "limited"
+
+ ntpd/ntp_config.c@1.317 +7 -2
+ [Bug 2060] Warn about restrictions with "kod" but not "limited"
+
+ChangeSet@1.3046, 2014-01-01 05:51:07+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2060] Warn about restrictions with "kod" but not "limited"
+
+ ChangeLog@1.1382 +1 -0
+ [Bug 2060] Warn about restrictions with "kod" but not "limited"
+
+ ntpd/ntp_config.c@1.316 +9 -1
+ [Bug 2060] Warn about restrictions with "kod" but not "limited"
+
+ChangeSet@1.3045, 2013-12-29 13:02:05+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P408
+ TAG: NTP_4_2_7P408
+
+ ChangeLog@1.1381 +1 -0
+ NTP_4_2_7P408
+
+ ntpd/invoke-ntp.conf.texi@1.86 +1 -1
+ NTP_4_2_7P408
+
+ ntpd/invoke-ntp.keys.texi@1.84 +1 -1
+ NTP_4_2_7P408
+
+ ntpd/invoke-ntpd.texi@1.400 +2 -2
+ NTP_4_2_7P408
+
+ ntpd/ntp.conf.5man@1.120 +7 -7
+ NTP_4_2_7P408
+
+ ntpd/ntp.conf.5mdoc@1.120 +2 -2
+ NTP_4_2_7P408
+
+ ntpd/ntp.conf.html@1.81 +1 -1
+ NTP_4_2_7P408
+
+ ntpd/ntp.conf.man.in@1.120 +7 -7
+ NTP_4_2_7P408
+
+ ntpd/ntp.conf.mdoc.in@1.120 +2 -2
+ NTP_4_2_7P408
+
+ ntpd/ntp.keys.5man@1.118 +3 -3
+ NTP_4_2_7P408
+
+ ntpd/ntp.keys.5mdoc@1.118 +2 -2
+ NTP_4_2_7P408
+
+ ntpd/ntp.keys.html@1.82 +1 -1
+ NTP_4_2_7P408
+
+ ntpd/ntp.keys.man.in@1.118 +3 -3
+ NTP_4_2_7P408
+
+ ntpd/ntp.keys.mdoc.in@1.118 +2 -2
+ NTP_4_2_7P408
+
+ ntpd/ntpd-opts.c@1.418 +7 -7
+ NTP_4_2_7P408
+
+ ntpd/ntpd-opts.h@1.418 +3 -3
+ NTP_4_2_7P408
+
+ ntpd/ntpd.1ntpdman@1.229 +7 -7
+ NTP_4_2_7P408
+
+ ntpd/ntpd.1ntpdmdoc@1.229 +2 -2
+ NTP_4_2_7P408
+
+ ntpd/ntpd.html@1.76 +2 -2
+ NTP_4_2_7P408
+
+ ntpd/ntpd.man.in@1.229 +7 -7
+ NTP_4_2_7P408
+
+ ntpd/ntpd.mdoc.in@1.229 +2 -2
+ NTP_4_2_7P408
+
+ ntpdc/invoke-ntpdc.texi@1.397 +2 -2
+ NTP_4_2_7P408
+
+ ntpdc/ntpdc-opts.c@1.412 +7 -7
+ NTP_4_2_7P408
+
+ ntpdc/ntpdc-opts.h@1.412 +3 -3
+ NTP_4_2_7P408
+
+ ntpdc/ntpdc.1ntpdcman@1.228 +6 -6
+ NTP_4_2_7P408
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.228 +1 -1
+ NTP_4_2_7P408
+
+ ntpdc/ntpdc.html@1.241 +2 -2
+ NTP_4_2_7P408
+
+ ntpdc/ntpdc.man.in@1.228 +6 -6
+ NTP_4_2_7P408
+
+ ntpdc/ntpdc.mdoc.in@1.228 +1 -1
+ NTP_4_2_7P408
+
+ ntpq/invoke-ntpq.texi@1.401 +2 -2
+ NTP_4_2_7P408
+
+ ntpq/ntpq-opts.c@1.415 +7 -7
+ NTP_4_2_7P408
+
+ ntpq/ntpq-opts.h@1.415 +3 -3
+ NTP_4_2_7P408
+
+ ntpq/ntpq.1ntpqman@1.229 +6 -6
+ NTP_4_2_7P408
+
+ ntpq/ntpq.1ntpqmdoc@1.229 +1 -1
+ NTP_4_2_7P408
+
+ ntpq/ntpq.html@1.73 +2 -2
+ NTP_4_2_7P408
+
+ ntpq/ntpq.man.in@1.229 +6 -6
+ NTP_4_2_7P408
+
+ ntpq/ntpq.mdoc.in@1.229 +1 -1
+ NTP_4_2_7P408
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.400 +2 -2
+ NTP_4_2_7P408
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.415 +7 -7
+ NTP_4_2_7P408
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.415 +3 -3
+ NTP_4_2_7P408
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.229 +7 -7
+ NTP_4_2_7P408
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.229 +2 -2
+ NTP_4_2_7P408
+
+ ntpsnmpd/ntpsnmpd.html@1.71 +1 -1
+ NTP_4_2_7P408
+
+ ntpsnmpd/ntpsnmpd.man.in@1.229 +7 -7
+ NTP_4_2_7P408
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.229 +2 -2
+ NTP_4_2_7P408
+
+ packageinfo.sh@1.412 +1 -1
+ NTP_4_2_7P408
+
+ scripts/invoke-plot_summary.texi@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/invoke-summary.texi@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.218 +1 -1
+ NTP_4_2_7P408
+
+ scripts/ntp-wait/ntp-wait.html@1.235 +1 -1
+ NTP_4_2_7P408
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.7 +1 -1
+ NTP_4_2_7P408
+
+ scripts/ntpsweep/ntpsweep.html@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.7 +1 -1
+ NTP_4_2_7P408
+
+ scripts/ntptrace/ntptrace.html@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/plot_summary.1plot_summaryman@1.8 +4 -4
+ NTP_4_2_7P408
+
+ scripts/plot_summary.1plot_summarymdoc@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/plot_summary.html@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/plot_summary.man.in@1.8 +4 -4
+ NTP_4_2_7P408
+
+ scripts/plot_summary.mdoc.in@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/summary.1summaryman@1.8 +4 -4
+ NTP_4_2_7P408
+
+ scripts/summary.1summarymdoc@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/summary.html@1.8 +1 -1
+ NTP_4_2_7P408
+
+ scripts/summary.man.in@1.8 +4 -4
+ NTP_4_2_7P408
+
+ scripts/summary.mdoc.in@1.8 +1 -1
+ NTP_4_2_7P408
+
+ sntp/invoke-sntp.texi@1.397 +2 -2
+ NTP_4_2_7P408
+
+ sntp/sntp-opts.c@1.412 +7 -7
+ NTP_4_2_7P408
+
+ sntp/sntp-opts.h@1.412 +3 -3
+ NTP_4_2_7P408
+
+ sntp/sntp.1sntpman@1.232 +7 -7
+ NTP_4_2_7P408
+
+ sntp/sntp.1sntpmdoc@1.232 +2 -2
+ NTP_4_2_7P408
+
+ sntp/sntp.html@1.412 +2 -2
+ NTP_4_2_7P408
+
+ sntp/sntp.man.in@1.232 +7 -7
+ NTP_4_2_7P408
+
+ sntp/sntp.mdoc.in@1.232 +2 -2
+ NTP_4_2_7P408
+
+ util/invoke-ntp-keygen.texi@1.401 +2 -2
+ NTP_4_2_7P408
+
+ util/ntp-keygen-opts.c@1.415 +7 -7
+ NTP_4_2_7P408
+
+ util/ntp-keygen-opts.h@1.415 +3 -3
+ NTP_4_2_7P408
+
+ util/ntp-keygen.1ntp-keygenman@1.229 +7 -7
+ NTP_4_2_7P408
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.229 +2 -2
+ NTP_4_2_7P408
+
+ util/ntp-keygen.html@1.77 +2 -2
+ NTP_4_2_7P408
+
+ util/ntp-keygen.man.in@1.229 +7 -7
+ NTP_4_2_7P408
+
+ util/ntp-keygen.mdoc.in@1.229 +2 -2
+ NTP_4_2_7P408
+
+ChangeSet@1.3042.1.1, 2013-12-29 11:41:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P407
+ TAG: NTP_4_2_7P407
+
+ ChangeLog@1.1378.1.1 +1 -0
+ NTP_4_2_7P407
+
+ ntpd/invoke-ntp.conf.texi@1.85 +1 -1
+ NTP_4_2_7P407
+
+ ntpd/invoke-ntp.keys.texi@1.83 +1 -1
+ NTP_4_2_7P407
+
+ ntpd/invoke-ntpd.texi@1.399 +2 -2
+ NTP_4_2_7P407
+
+ ntpd/ntp.conf.5man@1.119 +7 -7
+ NTP_4_2_7P407
+
+ ntpd/ntp.conf.5mdoc@1.119 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntp.conf.html@1.80 +1 -1
+ NTP_4_2_7P407
+
+ ntpd/ntp.conf.man.in@1.119 +7 -7
+ NTP_4_2_7P407
+
+ ntpd/ntp.conf.mdoc.in@1.119 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntp.keys.5man@1.117 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntp.keys.5mdoc@1.117 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntp.keys.html@1.81 +1 -1
+ NTP_4_2_7P407
+
+ ntpd/ntp.keys.man.in@1.117 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntp.keys.mdoc.in@1.117 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntpd-opts.c@1.417 +7 -7
+ NTP_4_2_7P407
+
+ ntpd/ntpd-opts.h@1.417 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntpd.1ntpdman@1.228 +7 -7
+ NTP_4_2_7P407
+
+ ntpd/ntpd.1ntpdmdoc@1.228 +3 -3
+ NTP_4_2_7P407
+
+ ntpd/ntpd.html@1.75 +2 -2
+ NTP_4_2_7P407
+
+ ntpd/ntpd.man.in@1.228 +7 -7
+ NTP_4_2_7P407
+
+ ntpd/ntpd.mdoc.in@1.228 +3 -3
+ NTP_4_2_7P407
+
+ ntpdc/invoke-ntpdc.texi@1.396 +2 -2
+ NTP_4_2_7P407
+
+ ntpdc/ntpdc-opts.c@1.411 +7 -7
+ NTP_4_2_7P407
+
+ ntpdc/ntpdc-opts.h@1.411 +3 -3
+ NTP_4_2_7P407
+
+ ntpdc/ntpdc.1ntpdcman@1.227 +6 -6
+ NTP_4_2_7P407
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.227 +2 -2
+ NTP_4_2_7P407
+
+ ntpdc/ntpdc.html@1.240 +2 -2
+ NTP_4_2_7P407
+
+ ntpdc/ntpdc.man.in@1.227 +6 -6
+ NTP_4_2_7P407
+
+ ntpdc/ntpdc.mdoc.in@1.227 +2 -2
+ NTP_4_2_7P407
+
+ ntpq/invoke-ntpq.texi@1.400 +2 -2
+ NTP_4_2_7P407
+
+ ntpq/ntpq-opts.c@1.414 +7 -7
+ NTP_4_2_7P407
+
+ ntpq/ntpq-opts.h@1.414 +3 -3
+ NTP_4_2_7P407
+
+ ntpq/ntpq.1ntpqman@1.228 +6 -6
+ NTP_4_2_7P407
+
+ ntpq/ntpq.1ntpqmdoc@1.228 +2 -2
+ NTP_4_2_7P407
+
+ ntpq/ntpq.html@1.72 +2 -2
+ NTP_4_2_7P407
+
+ ntpq/ntpq.man.in@1.228 +6 -6
+ NTP_4_2_7P407
+
+ ntpq/ntpq.mdoc.in@1.228 +2 -2
+ NTP_4_2_7P407
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.399 +2 -2
+ NTP_4_2_7P407
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.414 +7 -7
+ NTP_4_2_7P407
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.414 +3 -3
+ NTP_4_2_7P407
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.228 +7 -7
+ NTP_4_2_7P407
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.228 +3 -3
+ NTP_4_2_7P407
+
+ ntpsnmpd/ntpsnmpd.html@1.70 +1 -1
+ NTP_4_2_7P407
+
+ ntpsnmpd/ntpsnmpd.man.in@1.228 +7 -7
+ NTP_4_2_7P407
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.228 +3 -3
+ NTP_4_2_7P407
+
+ packageinfo.sh@1.409.1.1 +1 -1
+ NTP_4_2_7P407
+
+ scripts/invoke-plot_summary.texi@1.7 +1 -1
+ NTP_4_2_7P407
+
+ scripts/invoke-summary.texi@1.7 +1 -1
+ NTP_4_2_7P407
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.217 +1 -1
+ NTP_4_2_7P407
+
+ scripts/ntp-wait/ntp-wait.html@1.234 +1 -1
+ NTP_4_2_7P407
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.6 +1 -1
+ NTP_4_2_7P407
+
+ scripts/ntpsweep/ntpsweep.html@1.7 +1 -1
+ NTP_4_2_7P407
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.6 +1 -1
+ NTP_4_2_7P407
+
+ scripts/ntptrace/ntptrace.html@1.7 +1 -1
+ NTP_4_2_7P407
+
+ scripts/plot_summary.1plot_summaryman@1.7 +6 -6
+ NTP_4_2_7P407
+
+ scripts/plot_summary.1plot_summarymdoc@1.7 +2 -2
+ NTP_4_2_7P407
+
+ scripts/plot_summary.html@1.7 +1 -1
+ NTP_4_2_7P407
+
+ scripts/plot_summary.man.in@1.7 +6 -6
+ NTP_4_2_7P407
+
+ scripts/plot_summary.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P407
+
+ scripts/summary.1summaryman@1.7 +6 -6
+ NTP_4_2_7P407
+
+ scripts/summary.1summarymdoc@1.7 +2 -2
+ NTP_4_2_7P407
+
+ scripts/summary.html@1.7 +1 -1
+ NTP_4_2_7P407
+
+ scripts/summary.man.in@1.7 +6 -6
+ NTP_4_2_7P407
+
+ scripts/summary.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P407
+
+ sntp/invoke-sntp.texi@1.396 +2 -2
+ NTP_4_2_7P407
+
+ sntp/sntp-opts.c@1.411 +7 -7
+ NTP_4_2_7P407
+
+ sntp/sntp-opts.h@1.411 +3 -3
+ NTP_4_2_7P407
+
+ sntp/sntp.1sntpman@1.231 +14 -14
+ NTP_4_2_7P407
+
+ sntp/sntp.1sntpmdoc@1.231 +3 -3
+ NTP_4_2_7P407
+
+ sntp/sntp.html@1.411 +2 -2
+ NTP_4_2_7P407
+
+ sntp/sntp.man.in@1.231 +14 -14
+ NTP_4_2_7P407
+
+ sntp/sntp.mdoc.in@1.231 +3 -3
+ NTP_4_2_7P407
+
+ util/invoke-ntp-keygen.texi@1.400 +2 -2
+ NTP_4_2_7P407
+
+ util/ntp-keygen-opts.c@1.414 +7 -7
+ NTP_4_2_7P407
+
+ util/ntp-keygen-opts.h@1.414 +3 -3
+ NTP_4_2_7P407
+
+ util/ntp-keygen.1ntp-keygenman@1.228 +7 -7
+ NTP_4_2_7P407
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.228 +3 -3
+ NTP_4_2_7P407
+
+ util/ntp-keygen.html@1.76 +2 -2
+ NTP_4_2_7P407
+
+ util/ntp-keygen.man.in@1.228 +7 -7
+ NTP_4_2_7P407
+
+ util/ntp-keygen.mdoc.in@1.228 +3 -3
+ NTP_4_2_7P407
+
+ChangeSet@1.3043, 2013-12-29 10:20:38+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2187] Update version number generation scripts
+
+ ChangeLog@1.1379 +1 -0
+ [Bug 2187] Update version number generation scripts
+
+ configure.ac@1.571 +1 -1
+ [Bug 2187] Update version number generation scripts
+
+ packageinfo.sh@1.410 +14 -1
+ [Bug 2187] Update version number generation scripts
+
+ scripts/build/VersionName@1.8 +7 -1
+ [Bug 2187] Update version number generation scripts
+
+ChangeSet@1.3042, 2013-12-29 07:55:28+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2519] mktime.c does not compile on 64-bit Solaris but we do not need timegm() and the Solaris provides mktime()
+
+ ChangeLog@1.1378 +2 -0
+ [Bug 2519] mktime.c does not compile on 64-bit Solaris but we do not need timegm() and the Solaris provides mktime()
+
+ libntp/mktime.c@1.13 +3 -1
+ [Bug 2519] mktime.c does not compile on 64-bit Solaris but we do not need timegm() and the Solaris provides mktime()
+
+ChangeSet@1.3041, 2013-12-29 07:06:37+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2522] Revert Bug 2513 fix - it breaks backward compatibility
+
+ ChangeLog@1.1377 +1 -0
+ [Bug 2522] Revert Bug 2513 fix - it breaks backward compatibility
+
+ ntpd/ntpd.c@1.152 +1 -4
+ [Bug 2522] Revert Bug 2513 fix - it breaks backward compatibility
+
+ChangeSet@1.3040, 2013-12-28 12:09:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P406
+ TAG: NTP_4_2_7P406
+
+ ChangeLog@1.1376 +1 -0
+ NTP_4_2_7P406
+
+ ntpd/invoke-ntp.conf.texi@1.84 +1 -1
+ NTP_4_2_7P406
+
+ ntpd/invoke-ntp.keys.texi@1.82 +1 -1
+ NTP_4_2_7P406
+
+ ntpd/invoke-ntpd.texi@1.398 +2 -2
+ NTP_4_2_7P406
+
+ ntpd/ntp.conf.5man@1.118 +7 -7
+ NTP_4_2_7P406
+
+ ntpd/ntp.conf.5mdoc@1.118 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntp.conf.html@1.79 +1 -1
+ NTP_4_2_7P406
+
+ ntpd/ntp.conf.man.in@1.118 +7 -7
+ NTP_4_2_7P406
+
+ ntpd/ntp.conf.mdoc.in@1.118 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntp.keys.5man@1.116 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntp.keys.5mdoc@1.116 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntp.keys.html@1.80 +1 -1
+ NTP_4_2_7P406
+
+ ntpd/ntp.keys.man.in@1.116 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntp.keys.mdoc.in@1.116 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntpd-opts.c@1.416 +7 -7
+ NTP_4_2_7P406
+
+ ntpd/ntpd-opts.h@1.416 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntpd.1ntpdman@1.227 +7 -7
+ NTP_4_2_7P406
+
+ ntpd/ntpd.1ntpdmdoc@1.227 +3 -3
+ NTP_4_2_7P406
+
+ ntpd/ntpd.html@1.74 +2 -2
+ NTP_4_2_7P406
+
+ ntpd/ntpd.man.in@1.227 +7 -7
+ NTP_4_2_7P406
+
+ ntpd/ntpd.mdoc.in@1.227 +3 -3
+ NTP_4_2_7P406
+
+ ntpdc/invoke-ntpdc.texi@1.395 +2 -2
+ NTP_4_2_7P406
+
+ ntpdc/ntpdc-opts.c@1.410 +7 -7
+ NTP_4_2_7P406
+
+ ntpdc/ntpdc-opts.h@1.410 +3 -3
+ NTP_4_2_7P406
+
+ ntpdc/ntpdc.1ntpdcman@1.226 +6 -6
+ NTP_4_2_7P406
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.226 +2 -2
+ NTP_4_2_7P406
+
+ ntpdc/ntpdc.html@1.239 +2 -2
+ NTP_4_2_7P406
+
+ ntpdc/ntpdc.man.in@1.226 +6 -6
+ NTP_4_2_7P406
+
+ ntpdc/ntpdc.mdoc.in@1.226 +2 -2
+ NTP_4_2_7P406
+
+ ntpq/invoke-ntpq.texi@1.399 +2 -2
+ NTP_4_2_7P406
+
+ ntpq/ntpq-opts.c@1.413 +7 -7
+ NTP_4_2_7P406
+
+ ntpq/ntpq-opts.h@1.413 +3 -3
+ NTP_4_2_7P406
+
+ ntpq/ntpq.1ntpqman@1.227 +6 -6
+ NTP_4_2_7P406
+
+ ntpq/ntpq.1ntpqmdoc@1.227 +2 -2
+ NTP_4_2_7P406
+
+ ntpq/ntpq.html@1.71 +2 -2
+ NTP_4_2_7P406
+
+ ntpq/ntpq.man.in@1.227 +6 -6
+ NTP_4_2_7P406
+
+ ntpq/ntpq.mdoc.in@1.227 +2 -2
+ NTP_4_2_7P406
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.398 +2 -2
+ NTP_4_2_7P406
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.413 +7 -7
+ NTP_4_2_7P406
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.413 +3 -3
+ NTP_4_2_7P406
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.227 +7 -7
+ NTP_4_2_7P406
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.227 +3 -3
+ NTP_4_2_7P406
+
+ ntpsnmpd/ntpsnmpd.html@1.69 +1 -1
+ NTP_4_2_7P406
+
+ ntpsnmpd/ntpsnmpd.man.in@1.227 +7 -7
+ NTP_4_2_7P406
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.227 +3 -3
+ NTP_4_2_7P406
+
+ packageinfo.sh@1.409 +1 -1
+ NTP_4_2_7P406
+
+ scripts/invoke-plot_summary.texi@1.6 +1 -1
+ NTP_4_2_7P406
+
+ scripts/invoke-summary.texi@1.6 +1 -1
+ NTP_4_2_7P406
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.216 +1 -1
+ NTP_4_2_7P406
+
+ scripts/ntp-wait/ntp-wait.html@1.233 +1 -1
+ NTP_4_2_7P406
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.5 +1 -1
+ NTP_4_2_7P406
+
+ scripts/ntpsweep/ntpsweep.html@1.6 +1 -1
+ NTP_4_2_7P406
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.5 +1 -1
+ NTP_4_2_7P406
+
+ scripts/ntptrace/ntptrace.html@1.6 +1 -1
+ NTP_4_2_7P406
+
+ scripts/plot_summary.1plot_summaryman@1.6 +6 -6
+ NTP_4_2_7P406
+
+ scripts/plot_summary.1plot_summarymdoc@1.6 +2 -2
+ NTP_4_2_7P406
+
+ scripts/plot_summary.html@1.6 +1 -1
+ NTP_4_2_7P406
+
+ scripts/plot_summary.man.in@1.6 +6 -6
+ NTP_4_2_7P406
+
+ scripts/plot_summary.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P406
+
+ scripts/summary.1summaryman@1.6 +6 -6
+ NTP_4_2_7P406
+
+ scripts/summary.1summarymdoc@1.6 +2 -2
+ NTP_4_2_7P406
+
+ scripts/summary.html@1.6 +1 -1
+ NTP_4_2_7P406
+
+ scripts/summary.man.in@1.6 +6 -6
+ NTP_4_2_7P406
+
+ scripts/summary.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P406
+
+ sntp/invoke-sntp.texi@1.395 +2 -2
+ NTP_4_2_7P406
+
+ sntp/sntp-opts.c@1.410 +7 -7
+ NTP_4_2_7P406
+
+ sntp/sntp-opts.h@1.410 +3 -3
+ NTP_4_2_7P406
+
+ sntp/sntp.1sntpman@1.230 +14 -14
+ NTP_4_2_7P406
+
+ sntp/sntp.1sntpmdoc@1.230 +3 -3
+ NTP_4_2_7P406
+
+ sntp/sntp.html@1.410 +2 -2
+ NTP_4_2_7P406
+
+ sntp/sntp.man.in@1.230 +14 -14
+ NTP_4_2_7P406
+
+ sntp/sntp.mdoc.in@1.230 +3 -3
+ NTP_4_2_7P406
+
+ util/invoke-ntp-keygen.texi@1.399 +2 -2
+ NTP_4_2_7P406
+
+ util/ntp-keygen-opts.c@1.413 +7 -7
+ NTP_4_2_7P406
+
+ util/ntp-keygen-opts.h@1.413 +3 -3
+ NTP_4_2_7P406
+
+ util/ntp-keygen.1ntp-keygenman@1.227 +7 -7
+ NTP_4_2_7P406
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.227 +3 -3
+ NTP_4_2_7P406
+
+ util/ntp-keygen.html@1.75 +2 -2
+ NTP_4_2_7P406
+
+ util/ntp-keygen.man.in@1.227 +7 -7
+ NTP_4_2_7P406
+
+ util/ntp-keygen.mdoc.in@1.227 +3 -3
+ NTP_4_2_7P406
+
+ChangeSet@1.3039, 2013-12-28 11:47:47+00:00, harlan@chessie.everett.org
+ [Bug 2521] VPATH tweaks for perl -opts files
+
+ ChangeLog@1.1375 +1 -0
+ [Bug 2521] VPATH tweaks for perl -opts files
+
+ scripts/Makefile.am@1.36 +4 -4
+ [Bug 2521] VPATH tweaks for perl -opts files
+
+ChangeSet@1.3038, 2013-12-28 10:34:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P405
+ TAG: NTP_4_2_7P405
+
+ .point-changed-filelist@1.22 +3 -0
+ Updates for some of the new script invoke-* files
+
+ ChangeLog@1.1374 +1 -0
+ NTP_4_2_7P405
+
+ ntpd/invoke-ntp.conf.texi@1.83 +1 -1
+ NTP_4_2_7P405
+
+ ntpd/invoke-ntp.keys.texi@1.81 +1 -1
+ NTP_4_2_7P405
+
+ ntpd/invoke-ntpd.texi@1.397 +2 -2
+ NTP_4_2_7P405
+
+ ntpd/ntp.conf.5man@1.117 +7 -7
+ NTP_4_2_7P405
+
+ ntpd/ntp.conf.5mdoc@1.117 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntp.conf.html@1.78 +1 -1
+ NTP_4_2_7P405
+
+ ntpd/ntp.conf.man.in@1.117 +7 -7
+ NTP_4_2_7P405
+
+ ntpd/ntp.conf.mdoc.in@1.117 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntp.keys.5man@1.115 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntp.keys.5mdoc@1.115 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntp.keys.html@1.79 +1 -1
+ NTP_4_2_7P405
+
+ ntpd/ntp.keys.man.in@1.115 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntp.keys.mdoc.in@1.115 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntpd-opts.c@1.415 +7 -7
+ NTP_4_2_7P405
+
+ ntpd/ntpd-opts.h@1.415 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntpd.1ntpdman@1.226 +7 -7
+ NTP_4_2_7P405
+
+ ntpd/ntpd.1ntpdmdoc@1.226 +3 -3
+ NTP_4_2_7P405
+
+ ntpd/ntpd.html@1.73 +2 -2
+ NTP_4_2_7P405
+
+ ntpd/ntpd.man.in@1.226 +7 -7
+ NTP_4_2_7P405
+
+ ntpd/ntpd.mdoc.in@1.226 +3 -3
+ NTP_4_2_7P405
+
+ ntpdc/invoke-ntpdc.texi@1.394 +2 -2
+ NTP_4_2_7P405
+
+ ntpdc/ntpdc-opts.c@1.409 +7 -7
+ NTP_4_2_7P405
+
+ ntpdc/ntpdc-opts.h@1.409 +3 -3
+ NTP_4_2_7P405
+
+ ntpdc/ntpdc.1ntpdcman@1.225 +13 -13
+ NTP_4_2_7P405
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.225 +2 -2
+ NTP_4_2_7P405
+
+ ntpdc/ntpdc.html@1.238 +2 -2
+ NTP_4_2_7P405
+
+ ntpdc/ntpdc.man.in@1.225 +13 -13
+ NTP_4_2_7P405
+
+ ntpdc/ntpdc.mdoc.in@1.225 +2 -2
+ NTP_4_2_7P405
+
+ ntpq/invoke-ntpq.texi@1.398 +2 -2
+ NTP_4_2_7P405
+
+ ntpq/ntpq-opts.c@1.412 +7 -7
+ NTP_4_2_7P405
+
+ ntpq/ntpq-opts.h@1.412 +3 -3
+ NTP_4_2_7P405
+
+ ntpq/ntpq.1ntpqman@1.226 +6 -6
+ NTP_4_2_7P405
+
+ ntpq/ntpq.1ntpqmdoc@1.226 +2 -2
+ NTP_4_2_7P405
+
+ ntpq/ntpq.html@1.70 +2 -2
+ NTP_4_2_7P405
+
+ ntpq/ntpq.man.in@1.226 +6 -6
+ NTP_4_2_7P405
+
+ ntpq/ntpq.mdoc.in@1.226 +2 -2
+ NTP_4_2_7P405
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.397 +2 -2
+ NTP_4_2_7P405
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.412 +7 -7
+ NTP_4_2_7P405
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.412 +3 -3
+ NTP_4_2_7P405
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.226 +7 -7
+ NTP_4_2_7P405
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.226 +3 -3
+ NTP_4_2_7P405
+
+ ntpsnmpd/ntpsnmpd.html@1.68 +1 -1
+ NTP_4_2_7P405
+
+ ntpsnmpd/ntpsnmpd.man.in@1.226 +7 -7
+ NTP_4_2_7P405
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.226 +3 -3
+ NTP_4_2_7P405
+
+ packageinfo.sh@1.408 +1 -1
+ NTP_4_2_7P405
+
+ scripts/invoke-plot_summary.texi@1.5 +1 -1
+ NTP_4_2_7P405
+
+ scripts/invoke-summary.texi@1.5 +1 -1
+ NTP_4_2_7P405
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.215 +1 -1
+ NTP_4_2_7P405
+
+ scripts/ntp-wait/ntp-wait.html@1.232 +1 -1
+ NTP_4_2_7P405
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.4 +1 -1
+ NTP_4_2_7P405
+
+ scripts/ntpsweep/ntpsweep.html@1.5 +1 -1
+ NTP_4_2_7P405
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.4 +1 -1
+ NTP_4_2_7P405
+
+ scripts/ntptrace/ntptrace.html@1.5 +1 -1
+ NTP_4_2_7P405
+
+ scripts/plot_summary.1plot_summaryman@1.5 +6 -6
+ NTP_4_2_7P405
+
+ scripts/plot_summary.1plot_summarymdoc@1.5 +2 -2
+ NTP_4_2_7P405
+
+ scripts/plot_summary.html@1.5 +1 -1
+ NTP_4_2_7P405
+
+ scripts/plot_summary.man.in@1.5 +6 -6
+ NTP_4_2_7P405
+
+ scripts/plot_summary.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P405
+
+ scripts/summary.1summaryman@1.5 +6 -6
+ NTP_4_2_7P405
+
+ scripts/summary.1summarymdoc@1.5 +2 -2
+ NTP_4_2_7P405
+
+ scripts/summary.html@1.5 +1 -1
+ NTP_4_2_7P405
+
+ scripts/summary.man.in@1.5 +6 -6
+ NTP_4_2_7P405
+
+ scripts/summary.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P405
+
+ sntp/invoke-sntp.texi@1.394 +2 -2
+ NTP_4_2_7P405
+
+ sntp/sntp-opts.c@1.409 +7 -7
+ NTP_4_2_7P405
+
+ sntp/sntp-opts.h@1.409 +3 -3
+ NTP_4_2_7P405
+
+ sntp/sntp.1sntpman@1.229 +7 -7
+ NTP_4_2_7P405
+
+ sntp/sntp.1sntpmdoc@1.229 +3 -3
+ NTP_4_2_7P405
+
+ sntp/sntp.html@1.409 +2 -2
+ NTP_4_2_7P405
+
+ sntp/sntp.man.in@1.229 +7 -7
+ NTP_4_2_7P405
+
+ sntp/sntp.mdoc.in@1.229 +3 -3
+ NTP_4_2_7P405
+
+ util/invoke-ntp-keygen.texi@1.398 +2 -2
+ NTP_4_2_7P405
+
+ util/ntp-keygen-opts.c@1.412 +7 -7
+ NTP_4_2_7P405
+
+ util/ntp-keygen-opts.h@1.412 +3 -3
+ NTP_4_2_7P405
+
+ util/ntp-keygen.1ntp-keygenman@1.226 +7 -7
+ NTP_4_2_7P405
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.226 +3 -3
+ NTP_4_2_7P405
+
+ util/ntp-keygen.html@1.74 +2 -2
+ NTP_4_2_7P405
+
+ util/ntp-keygen.man.in@1.226 +7 -7
+ NTP_4_2_7P405
+
+ util/ntp-keygen.mdoc.in@1.226 +3 -3
+ NTP_4_2_7P405
+
+ChangeSet@1.3037, 2013-12-27 03:50:46-05:00, stenn@deacon.udel.edu
+ [Bug 2521] bootstrap script needs a tweak for perl *-opts files
+
+ ChangeLog@1.1373 +1 -0
+ [Bug 2521] bootstrap script needs a tweak for perl *-opts files
+
+ bootstrap@1.43 +1 -1
+ [Bug 2521] bootstrap script needs a tweak for perl *-opts files
+
+ChangeSet@1.3036, 2013-12-27 05:51:12+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ ChangeLog@1.1372 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ ChangeLog@1.1371 +1 -0
+ [Bug 2526] Add "noinst" support to the sntp/loc/ framework
+
+ scripts/ntpsweep/Makefile.am@1.5 +12 -2
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/README@1.2 +2 -1
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/darwin@1.2 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/debian@1.3 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/freebsd@1.5 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/legacy@1.6 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/netbsd@1.2 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/redhat@1.4 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/loc/solaris@1.5 +1 -0
+ [Bug 2524] Add ntpsweep to sntp/loc/* files
+
+ sntp/m4/ntp_locinfo.m4@1.17 +21 -0
+ [Bug 2526] Add "noinst" support to the sntp/loc/ framework
+
+ sntp/scripts/genLocInfo@1.17 +16 -4
+ [Bug 2526] Add "noinst" support to the sntp/loc/ framework
+
+ChangeSet@1.3035, 2013-12-24 11:40:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P404
+ TAG: NTP_4_2_7P404
+
+ ChangeLog@1.1370 +1 -0
+ NTP_4_2_7P404
+
+ ntpd/invoke-ntp.conf.texi@1.82 +1 -1
+ NTP_4_2_7P404
+
+ ntpd/invoke-ntp.keys.texi@1.80 +1 -1
+ NTP_4_2_7P404
+
+ ntpd/invoke-ntpd.texi@1.396 +2 -2
+ NTP_4_2_7P404
+
+ ntpd/ntp.conf.5man@1.116 +7 -7
+ NTP_4_2_7P404
+
+ ntpd/ntp.conf.5mdoc@1.116 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntp.conf.html@1.77 +1 -1
+ NTP_4_2_7P404
+
+ ntpd/ntp.conf.man.in@1.116 +7 -7
+ NTP_4_2_7P404
+
+ ntpd/ntp.conf.mdoc.in@1.116 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntp.keys.5man@1.114 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntp.keys.5mdoc@1.114 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntp.keys.html@1.78 +1 -1
+ NTP_4_2_7P404
+
+ ntpd/ntp.keys.man.in@1.114 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntp.keys.mdoc.in@1.114 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntpd-opts.c@1.414 +7 -7
+ NTP_4_2_7P404
+
+ ntpd/ntpd-opts.h@1.414 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntpd.1ntpdman@1.225 +7 -7
+ NTP_4_2_7P404
+
+ ntpd/ntpd.1ntpdmdoc@1.225 +3 -3
+ NTP_4_2_7P404
+
+ ntpd/ntpd.html@1.72 +2 -2
+ NTP_4_2_7P404
+
+ ntpd/ntpd.man.in@1.225 +7 -7
+ NTP_4_2_7P404
+
+ ntpd/ntpd.mdoc.in@1.225 +3 -3
+ NTP_4_2_7P404
+
+ ntpdc/invoke-ntpdc.texi@1.393 +2 -2
+ NTP_4_2_7P404
+
+ ntpdc/ntpdc-opts.c@1.408 +7 -7
+ NTP_4_2_7P404
+
+ ntpdc/ntpdc-opts.h@1.408 +3 -3
+ NTP_4_2_7P404
+
+ ntpdc/ntpdc.1ntpdcman@1.224 +13 -13
+ NTP_4_2_7P404
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.224 +2 -2
+ NTP_4_2_7P404
+
+ ntpdc/ntpdc.html@1.237 +2 -2
+ NTP_4_2_7P404
+
+ ntpdc/ntpdc.man.in@1.224 +13 -13
+ NTP_4_2_7P404
+
+ ntpdc/ntpdc.mdoc.in@1.224 +2 -2
+ NTP_4_2_7P404
+
+ ntpq/invoke-ntpq.texi@1.397 +2 -2
+ NTP_4_2_7P404
+
+ ntpq/ntpq-opts.c@1.411 +7 -7
+ NTP_4_2_7P404
+
+ ntpq/ntpq-opts.h@1.411 +3 -3
+ NTP_4_2_7P404
+
+ ntpq/ntpq.1ntpqman@1.225 +13 -13
+ NTP_4_2_7P404
+
+ ntpq/ntpq.1ntpqmdoc@1.225 +2 -2
+ NTP_4_2_7P404
+
+ ntpq/ntpq.html@1.69 +2 -2
+ NTP_4_2_7P404
+
+ ntpq/ntpq.man.in@1.225 +13 -13
+ NTP_4_2_7P404
+
+ ntpq/ntpq.mdoc.in@1.225 +2 -2
+ NTP_4_2_7P404
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.396 +2 -2
+ NTP_4_2_7P404
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.411 +7 -7
+ NTP_4_2_7P404
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.411 +3 -3
+ NTP_4_2_7P404
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.225 +7 -7
+ NTP_4_2_7P404
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.225 +3 -3
+ NTP_4_2_7P404
+
+ ntpsnmpd/ntpsnmpd.html@1.67 +1 -1
+ NTP_4_2_7P404
+
+ ntpsnmpd/ntpsnmpd.man.in@1.225 +7 -7
+ NTP_4_2_7P404
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.225 +3 -3
+ NTP_4_2_7P404
+
+ packageinfo.sh@1.407 +1 -1
+ NTP_4_2_7P404
+
+ scripts/invoke-plot_summary.texi@1.4 +1 -1
+ NTP_4_2_7P404
+
+ scripts/invoke-summary.texi@1.4 +1 -1
+ NTP_4_2_7P404
+
+ scripts/ntp-wait/ntp-wait.html@1.231 +1 -1
+ NTP_4_2_7P404
+
+ scripts/ntpsweep/ntpsweep.html@1.4 +1 -1
+ NTP_4_2_7P404
+
+ scripts/ntptrace/ntptrace.html@1.4 +1 -1
+ NTP_4_2_7P404
+
+ scripts/plot_summary.1plot_summaryman@1.4 +6 -6
+ NTP_4_2_7P404
+
+ scripts/plot_summary.1plot_summarymdoc@1.4 +2 -2
+ NTP_4_2_7P404
+
+ scripts/plot_summary.html@1.4 +1 -1
+ NTP_4_2_7P404
+
+ scripts/plot_summary.man.in@1.4 +6 -6
+ NTP_4_2_7P404
+
+ scripts/plot_summary.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P404
+
+ scripts/summary.1summaryman@1.4 +6 -6
+ NTP_4_2_7P404
+
+ scripts/summary.1summarymdoc@1.4 +2 -2
+ NTP_4_2_7P404
+
+ scripts/summary.html@1.4 +1 -1
+ NTP_4_2_7P404
+
+ scripts/summary.man.in@1.4 +6 -6
+ NTP_4_2_7P404
+
+ scripts/summary.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P404
+
+ sntp/invoke-sntp.texi@1.393 +2 -2
+ NTP_4_2_7P404
+
+ sntp/sntp-opts.c@1.408 +7 -7
+ NTP_4_2_7P404
+
+ sntp/sntp-opts.h@1.408 +3 -3
+ NTP_4_2_7P404
+
+ sntp/sntp.1sntpman@1.228 +7 -7
+ NTP_4_2_7P404
+
+ sntp/sntp.1sntpmdoc@1.228 +3 -3
+ NTP_4_2_7P404
+
+ sntp/sntp.html@1.408 +2 -2
+ NTP_4_2_7P404
+
+ sntp/sntp.man.in@1.228 +7 -7
+ NTP_4_2_7P404
+
+ sntp/sntp.mdoc.in@1.228 +3 -3
+ NTP_4_2_7P404
+
+ util/invoke-ntp-keygen.texi@1.397 +2 -2
+ NTP_4_2_7P404
+
+ util/ntp-keygen-opts.c@1.411 +7 -7
+ NTP_4_2_7P404
+
+ util/ntp-keygen-opts.h@1.411 +3 -3
+ NTP_4_2_7P404
+
+ util/ntp-keygen.1ntp-keygenman@1.225 +7 -7
+ NTP_4_2_7P404
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.225 +3 -3
+ NTP_4_2_7P404
+
+ util/ntp-keygen.html@1.73 +2 -2
+ NTP_4_2_7P404
+
+ util/ntp-keygen.man.in@1.225 +7 -7
+ NTP_4_2_7P404
+
+ util/ntp-keygen.mdoc.in@1.225 +3 -3
+ NTP_4_2_7P404
+
+ChangeSet@1.3034, 2013-12-24 09:49:09+00:00, stenn@psp-deb1.ntp.org
+ [Bug 135] AIX5: "Address already in use" for IPv6 wildcard
+
+ ChangeLog@1.1369 +1 -0
+ [Bug 135] AIX5: "Address already in use" for IPv6 wildcard
+
+ ntpd/ntp_io.c@1.388 +159 -159
+ [Bug 135] AIX5: "Address already in use" for IPv6 wildcard
+
+ChangeSet@1.3033, 2013-12-23 11:39:23+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P403
+ TAG: NTP_4_2_7P403
+
+ ChangeLog@1.1368 +1 -0
+ NTP_4_2_7P403
+
+ ntpd/invoke-ntp.conf.texi@1.81 +1 -1
+ NTP_4_2_7P403
+
+ ntpd/invoke-ntp.keys.texi@1.79 +1 -1
+ NTP_4_2_7P403
+
+ ntpd/invoke-ntpd.texi@1.395 +2 -2
+ NTP_4_2_7P403
+
+ ntpd/ntp.conf.5man@1.115 +7 -7
+ NTP_4_2_7P403
+
+ ntpd/ntp.conf.5mdoc@1.115 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntp.conf.html@1.76 +1211 -139
+ NTP_4_2_7P403
+
+ ntpd/ntp.conf.man.in@1.115 +7 -7
+ NTP_4_2_7P403
+
+ ntpd/ntp.conf.mdoc.in@1.115 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntp.keys.5man@1.113 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntp.keys.5mdoc@1.113 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntp.keys.html@1.77 +2 -2
+ NTP_4_2_7P403
+
+ ntpd/ntp.keys.man.in@1.113 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntp.keys.mdoc.in@1.113 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntpd-opts.c@1.413 +7 -7
+ NTP_4_2_7P403
+
+ ntpd/ntpd-opts.h@1.413 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntpd.1ntpdman@1.224 +7 -7
+ NTP_4_2_7P403
+
+ ntpd/ntpd.1ntpdmdoc@1.224 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntpd.html@1.71 +3 -3
+ NTP_4_2_7P403
+
+ ntpd/ntpd.man.in@1.224 +7 -7
+ NTP_4_2_7P403
+
+ ntpd/ntpd.mdoc.in@1.224 +3 -3
+ NTP_4_2_7P403
+
+ ntpdc/invoke-ntpdc.texi@1.392 +2 -2
+ NTP_4_2_7P403
+
+ ntpdc/ntpdc-opts.c@1.407 +7 -7
+ NTP_4_2_7P403
+
+ ntpdc/ntpdc-opts.h@1.407 +3 -3
+ NTP_4_2_7P403
+
+ ntpdc/ntpdc.1ntpdcman@1.223 +6 -6
+ NTP_4_2_7P403
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.223 +2 -2
+ NTP_4_2_7P403
+
+ ntpdc/ntpdc.html@1.236 +2 -2
+ NTP_4_2_7P403
+
+ ntpdc/ntpdc.man.in@1.223 +6 -6
+ NTP_4_2_7P403
+
+ ntpdc/ntpdc.mdoc.in@1.223 +2 -2
+ NTP_4_2_7P403
+
+ ntpq/invoke-ntpq.texi@1.396 +2 -2
+ NTP_4_2_7P403
+
+ ntpq/ntpq-opts.c@1.410 +7 -7
+ NTP_4_2_7P403
+
+ ntpq/ntpq-opts.h@1.410 +3 -3
+ NTP_4_2_7P403
+
+ ntpq/ntpq.1ntpqman@1.224 +13 -13
+ NTP_4_2_7P403
+
+ ntpq/ntpq.1ntpqmdoc@1.224 +2 -2
+ NTP_4_2_7P403
+
+ ntpq/ntpq.html@1.68 +30 -57
+ NTP_4_2_7P403
+
+ ntpq/ntpq.man.in@1.224 +13 -13
+ NTP_4_2_7P403
+
+ ntpq/ntpq.mdoc.in@1.224 +2 -2
+ NTP_4_2_7P403
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.395 +2 -2
+ NTP_4_2_7P403
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.410 +7 -7
+ NTP_4_2_7P403
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.410 +3 -3
+ NTP_4_2_7P403
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.224 +14 -14
+ NTP_4_2_7P403
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.224 +3 -3
+ NTP_4_2_7P403
+
+ ntpsnmpd/ntpsnmpd.html@1.66 +1 -1
+ NTP_4_2_7P403
+
+ ntpsnmpd/ntpsnmpd.man.in@1.224 +14 -14
+ NTP_4_2_7P403
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.224 +3 -3
+ NTP_4_2_7P403
+
+ packageinfo.sh@1.406 +1 -1
+ NTP_4_2_7P403
+
+ scripts/invoke-plot_summary.texi@1.3 +1 -1
+ NTP_4_2_7P403
+
+ scripts/invoke-summary.texi@1.3 +1 -1
+ NTP_4_2_7P403
+
+ scripts/ntp-wait/ntp-wait.html@1.230 +1 -1
+ NTP_4_2_7P403
+
+ scripts/ntpsweep/ntpsweep.html@1.3 +1 -1
+ NTP_4_2_7P403
+
+ scripts/ntptrace/ntptrace.html@1.3 +1 -1
+ NTP_4_2_7P403
+
+ scripts/plot_summary.1plot_summaryman@1.3 +6 -6
+ NTP_4_2_7P403
+
+ scripts/plot_summary.1plot_summarymdoc@1.3 +3 -3
+ NTP_4_2_7P403
+
+ scripts/plot_summary.html@1.3 +1 -1
+ NTP_4_2_7P403
+
+ scripts/plot_summary.man.in@1.3 +6 -6
+ NTP_4_2_7P403
+
+ scripts/plot_summary.mdoc.in@1.3 +3 -3
+ NTP_4_2_7P403
+
+ scripts/summary.1summaryman@1.3 +6 -6
+ NTP_4_2_7P403
+
+ scripts/summary.1summarymdoc@1.3 +2 -2
+ NTP_4_2_7P403
+
+ scripts/summary.html@1.3 +1 -1
+ NTP_4_2_7P403
+
+ scripts/summary.man.in@1.3 +6 -6
+ NTP_4_2_7P403
+
+ scripts/summary.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P403
+
+ sntp/invoke-sntp.texi@1.392 +2 -2
+ NTP_4_2_7P403
+
+ sntp/sntp-opts.c@1.407 +7 -7
+ NTP_4_2_7P403
+
+ sntp/sntp-opts.h@1.407 +3 -3
+ NTP_4_2_7P403
+
+ sntp/sntp.1sntpman@1.227 +14 -14
+ NTP_4_2_7P403
+
+ sntp/sntp.1sntpmdoc@1.227 +3 -3
+ NTP_4_2_7P403
+
+ sntp/sntp.html@1.407 +2 -2
+ NTP_4_2_7P403
+
+ sntp/sntp.man.in@1.227 +14 -14
+ NTP_4_2_7P403
+
+ sntp/sntp.mdoc.in@1.227 +3 -3
+ NTP_4_2_7P403
+
+ util/invoke-ntp-keygen.texi@1.396 +2 -2
+ NTP_4_2_7P403
+
+ util/ntp-keygen-opts.c@1.410 +7 -7
+ NTP_4_2_7P403
+
+ util/ntp-keygen-opts.h@1.410 +3 -3
+ NTP_4_2_7P403
+
+ util/ntp-keygen.1ntp-keygenman@1.224 +7 -7
+ NTP_4_2_7P403
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.224 +3 -3
+ NTP_4_2_7P403
+
+ util/ntp-keygen.html@1.72 +60 -95
+ NTP_4_2_7P403
+
+ util/ntp-keygen.man.in@1.224 +7 -7
+ NTP_4_2_7P403
+
+ util/ntp-keygen.mdoc.in@1.224 +3 -3
+ NTP_4_2_7P403
+
+ChangeSet@1.3032, 2013-12-23 03:03:25-05:00, stenn@deacon.udel.edu
+ [Bug 2513] Remove any PIDFILE in finish()
+
+ ChangeLog@1.1367 +1 -0
+ [Bug 2513] Remove any PIDFILE in finish()
+
+ ntpd/ntpd.c@1.151 +4 -0
+ [Bug 2513] Remove any PIDFILE in finish()
+
+ChangeSet@1.3031, 2013-12-23 07:22:20+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2517] Fix peer status errors in decode.html
+
+ ChangeLog@1.1366 +1 -0
+ [Bug 2517] Fix peer status errors in decode.html
+
+ html/decode.html@1.22 +4 -4
+ [Bug 2517] Fix peer status errors in decode.html
+
+ChangeSet@1.3030, 2013-12-23 07:03:41+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2516] Enable clock_gettime() support for AIX 5+
+
+ ChangeLog@1.1365 +1 -0
+ [Bug 2516] Enable clock_gettime() support for AIX 5+
+
+ sntp/m4/ntp_libntp.m4@1.23 +7 -2
+ [Bug 2516] Enable clock_gettime() support for AIX 5+
+
+ChangeSet@1.3029, 2013-12-23 02:44:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P402
+ TAG: NTP_4_2_7P402
+
+ .point-changed-filelist@1.21 +15 -6
+ updated point changed list
+
+ ChangeLog@1.1364 +1 -0
+ NTP_4_2_7P402
+
+ ntpd/invoke-ntp.conf.texi@1.80 +117 -230
+ NTP_4_2_7P402
+
+ ntpd/invoke-ntp.keys.texi@1.78 +2 -4
+ NTP_4_2_7P402
+
+ ntpd/invoke-ntpd.texi@1.394 +3 -3
+ NTP_4_2_7P402
+
+ ntpd/ntp.conf.5man@1.114 +985 -953
+ NTP_4_2_7P402
+
+ ntpd/ntp.conf.5mdoc@1.114 +6 -6
+ NTP_4_2_7P402
+
+ ntpd/ntp.conf.html@1.75 +1 -1
+ NTP_4_2_7P402
+
+ ntpd/ntp.conf.man.in@1.114 +985 -953
+ NTP_4_2_7P402
+
+ ntpd/ntp.conf.mdoc.in@1.114 +6 -6
+ NTP_4_2_7P402
+
+ ntpd/ntp.keys.5man@1.112 +93 -47
+ NTP_4_2_7P402
+
+ ntpd/ntp.keys.5mdoc@1.112 +10 -6
+ NTP_4_2_7P402
+
+ ntpd/ntp.keys.html@1.76 +1 -1
+ NTP_4_2_7P402
+
+ ntpd/ntp.keys.man.in@1.112 +93 -47
+ NTP_4_2_7P402
+
+ ntpd/ntp.keys.mdoc.in@1.112 +10 -6
+ NTP_4_2_7P402
+
+ ntpd/ntpd-opts.c@1.412 +7 -7
+ NTP_4_2_7P402
+
+ ntpd/ntpd-opts.h@1.412 +3 -3
+ NTP_4_2_7P402
+
+ ntpd/ntpd.1ntpdman@1.223 +282 -209
+ NTP_4_2_7P402
+
+ ntpd/ntpd.1ntpdmdoc@1.223 +42 -42
+ NTP_4_2_7P402
+
+ ntpd/ntpd.html@1.70 +2 -2
+ NTP_4_2_7P402
+
+ ntpd/ntpd.man.in@1.223 +282 -209
+ NTP_4_2_7P402
+
+ ntpd/ntpd.mdoc.in@1.223 +42 -42
+ NTP_4_2_7P402
+
+ ntpdc/invoke-ntpdc.texi@1.391 +3 -3
+ NTP_4_2_7P402
+
+ ntpdc/ntpdc-opts.c@1.406 +7 -7
+ NTP_4_2_7P402
+
+ ntpdc/ntpdc-opts.h@1.406 +3 -3
+ NTP_4_2_7P402
+
+ ntpdc/ntpdc.1ntpdcman@1.222 +306 -289
+ NTP_4_2_7P402
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.222 +19 -19
+ NTP_4_2_7P402
+
+ ntpdc/ntpdc.html@1.235 +3 -3
+ NTP_4_2_7P402
+
+ ntpdc/ntpdc.man.in@1.222 +306 -289
+ NTP_4_2_7P402
+
+ ntpdc/ntpdc.mdoc.in@1.222 +19 -19
+ NTP_4_2_7P402
+
+ ntpq/invoke-ntpq.texi@1.395 +24 -36
+ NTP_4_2_7P402
+
+ ntpq/ntpq-opts.c@1.409 +7 -7
+ NTP_4_2_7P402
+
+ ntpq/ntpq-opts.h@1.409 +3 -3
+ NTP_4_2_7P402
+
+ ntpq/ntpq.1ntpqman@1.223 +165 -117
+ NTP_4_2_7P402
+
+ ntpq/ntpq.1ntpqmdoc@1.223 +18 -18
+ NTP_4_2_7P402
+
+ ntpq/ntpq.html@1.67 +2 -2
+ NTP_4_2_7P402
+
+ ntpq/ntpq.man.in@1.223 +165 -117
+ NTP_4_2_7P402
+
+ ntpq/ntpq.mdoc.in@1.223 +18 -18
+ NTP_4_2_7P402
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.394 +2 -2
+ NTP_4_2_7P402
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.409 +7 -7
+ NTP_4_2_7P402
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.409 +3 -3
+ NTP_4_2_7P402
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.223 +126 -66
+ NTP_4_2_7P402
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.223 +16 -14
+ NTP_4_2_7P402
+
+ ntpsnmpd/ntpsnmpd.html@1.65 +1 -1
+ NTP_4_2_7P402
+
+ ntpsnmpd/ntpsnmpd.man.in@1.223 +126 -66
+ NTP_4_2_7P402
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.223 +16 -14
+ NTP_4_2_7P402
+
+ packageinfo.sh@1.405 +1 -1
+ NTP_4_2_7P402
+
+ scripts/invoke-plot_summary.texi@1.2 +1 -1
+ NTP_4_2_7P402
+
+ scripts/invoke-summary.texi@1.2 +1 -1
+ NTP_4_2_7P402
+
+ scripts/ntp-wait/ntp-wait.html@1.229 +30 -48
+ NTP_4_2_7P402
+
+ scripts/ntpsweep/Makefile.am@1.4 +3 -0
+ cleanup
+
+ scripts/ntpsweep/ntpsweep.html@1.2 +32 -43
+ NTP_4_2_7P402
+
+ scripts/ntptrace/ntptrace.html@1.2 +26 -35
+ NTP_4_2_7P402
+
+ scripts/plot_summary.1plot_summaryman@1.2 +32 -2
+ NTP_4_2_7P402
+
+ scripts/plot_summary.1plot_summarymdoc@1.2 +22 -2
+ NTP_4_2_7P402
+
+ scripts/plot_summary.html@1.2 +28 -46
+ NTP_4_2_7P402
+
+ scripts/plot_summary.man.in@1.2 +32 -2
+ NTP_4_2_7P402
+
+ scripts/plot_summary.mdoc.in@1.2 +22 -2
+ NTP_4_2_7P402
+
+ scripts/summary.1summaryman@1.2 +31 -2
+ NTP_4_2_7P402
+
+ scripts/summary.1summarymdoc@1.2 +21 -2
+ NTP_4_2_7P402
+
+ scripts/summary.html@1.2 +26 -38
+ NTP_4_2_7P402
+
+ scripts/summary.man.in@1.2 +31 -2
+ NTP_4_2_7P402
+
+ scripts/summary.mdoc.in@1.2 +21 -2
+ NTP_4_2_7P402
+
+ sntp/invoke-sntp.texi@1.391 +7 -7
+ NTP_4_2_7P402
+
+ sntp/sntp-opts.c@1.406 +7 -7
+ NTP_4_2_7P402
+
+ sntp/sntp-opts.h@1.406 +3 -3
+ NTP_4_2_7P402
+
+ sntp/sntp.1sntpman@1.226 +119 -70
+ NTP_4_2_7P402
+
+ sntp/sntp.1sntpmdoc@1.226 +46 -34
+ NTP_4_2_7P402
+
+ sntp/sntp.html@1.406 +7 -7
+ NTP_4_2_7P402
+
+ sntp/sntp.man.in@1.226 +119 -70
+ NTP_4_2_7P402
+
+ sntp/sntp.mdoc.in@1.226 +46 -34
+ NTP_4_2_7P402
+
+ util/invoke-ntp-keygen.texi@1.395 +28 -50
+ NTP_4_2_7P402
+
+ util/ntp-keygen-opts.c@1.409 +7 -7
+ NTP_4_2_7P402
+
+ util/ntp-keygen-opts.h@1.409 +3 -3
+ NTP_4_2_7P402
+
+ util/ntp-keygen.1ntp-keygenman@1.223 +397 -270
+ NTP_4_2_7P402
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.223 +37 -33
+ NTP_4_2_7P402
+
+ util/ntp-keygen.html@1.71 +2 -2
+ NTP_4_2_7P402
+
+ util/ntp-keygen.man.in@1.223 +397 -270
+ NTP_4_2_7P402
+
+ util/ntp-keygen.mdoc.in@1.223 +37 -33
+ NTP_4_2_7P402
+
+ChangeSet@1.3028, 2013-12-22 10:28:11+00:00, stenn@psp-fb1.ntp.org
+ Create doc framework for summary and plot_summary
+
+ scripts/Makefile.am@1.35 +120 -9
+ Create doc framework for summary and plot_summary
+
+ scripts/invoke-plot_summary.menu@1.1 +1 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/invoke-plot_summary.menu
+
+ scripts/invoke-plot_summary.menu@1.0 +0 -0
+
+ scripts/invoke-plot_summary.texi@1.1 +121 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/invoke-plot_summary.texi
+
+ scripts/invoke-plot_summary.texi@1.0 +0 -0
+
+ scripts/invoke-summary.menu@1.1 +1 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/invoke-summary.menu
+
+ scripts/invoke-summary.menu@1.0 +0 -0
+
+ scripts/invoke-summary.texi@1.1 +103 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/invoke-summary.texi
+
+ scripts/invoke-summary.texi@1.0 +0 -0
+
+ scripts/ntptrace/Makefile.am@1.4 +2 -2
+ fix typos in ntptrace/Makefile.am
+
+ scripts/plot_summary.1plot_summaryman@1.1 +109 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary.1plot_summaryman
+
+ scripts/plot_summary.1plot_summaryman@1.0 +0 -0
+
+ scripts/plot_summary.1plot_summarymdoc@1.1 +84 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary.1plot_summarymdoc
+
+ scripts/plot_summary.1plot_summarymdoc@1.0 +0 -0
+
+ scripts/plot_summary.html@1.1 +225 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary.html
+
+ scripts/plot_summary.html@1.0 +0 -0
+
+ scripts/plot_summary.man.in@1.1 +109 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary.man.in
+
+ scripts/plot_summary.man.in@1.0 +0 -0
+
+ scripts/plot_summary.mdoc.in@1.1 +84 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary.mdoc.in
+
+ scripts/plot_summary.mdoc.in@1.0 +0 -0
+
+ scripts/plot_summary.texi@1.1 +40 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary.texi
+
+ scripts/plot_summary.texi@1.0 +0 -0
+
+ scripts/summary.1summaryman@1.1 +118 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary.1summaryman
+
+ scripts/summary.1summaryman@1.0 +0 -0
+
+ scripts/summary.1summarymdoc@1.1 +94 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary.1summarymdoc
+
+ scripts/summary.1summarymdoc@1.0 +0 -0
+
+ scripts/summary.html@1.1 +194 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary.html
+
+ scripts/summary.html@1.0 +0 -0
+
+ scripts/summary.man.in@1.1 +118 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary.man.in
+
+ scripts/summary.man.in@1.0 +0 -0
+
+ scripts/summary.mdoc.in@1.1 +94 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary.mdoc.in
+
+ scripts/summary.mdoc.in@1.0 +0 -0
+
+ scripts/summary.texi@1.1 +40 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary.texi
+
+ scripts/summary.texi@1.0 +0 -0
+
+ChangeSet@1.3027, 2013-12-21 10:12:36+00:00, stenn@psp-fb1.ntp.org
+ More build cleanup around Oliver's GSoC project
+
+ scripts/Makefile.am@1.34 +4 -0
+ More build cleanup around Oliver's GSoC project
+
+ scripts/calc_tickadj/Makefile.am@1.5 +11 -8
+ More build cleanup around Oliver's GSoC project
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.1 +103 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj.man.in
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.0 +0 -0
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.3 +1 -1
+ More build cleanup around Oliver's GSoC project
+
+ scripts/lib/Makefile.am@1.2 +1 -1
+ More build cleanup around Oliver's GSoC project
+
+ scripts/ntp-wait/Makefile.am@1.3 +24 -27
+ More build cleanup around Oliver's GSoC project
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.214 +1 -1
+ More build cleanup around Oliver's GSoC project
+
+ scripts/ntpsweep/Makefile.am@1.3 +34 -36
+ More build cleanup around Oliver's GSoC project
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.3 +1 -1
+ More build cleanup around Oliver's GSoC project
+
+ scripts/ntpsweep/ntpsweep.man.in@1.1 +92 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep.man.in
+
+ scripts/ntpsweep/ntpsweep.man.in@1.0 +0 -0
+
+ scripts/ntptrace/Makefile.am@1.3 +26 -27
+ More build cleanup around Oliver's GSoC project
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.3 +1 -1
+ More build cleanup around Oliver's GSoC project
+
+ scripts/ntptrace/ntptrace.man.in@1.1 +109 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace.man.in
+
+ scripts/ntptrace/ntptrace.man.in@1.0 +0 -0
+
+ChangeSet@1.3026, 2013-12-19 11:47:46+00:00, stenn@psp-fb1.ntp.org
+ calc_tickadj man page generation fixes
+
+ scripts/calc_tickadj/Makefile.am@1.4 +2 -1
+ calc_tickadj man page generation fixes
+
+ sntp/m4/ntp_locinfo.m4@1.16 +2 -0
+ calc_tickadj man page generation fixes
+
+ChangeSet@1.3025, 2013-12-19 09:27:41+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ scripts/calc_tickadj/Makefile.am@1.3 +26 -21
+ cleanup
+
+ChangeSet@1.3024, 2013-12-19 07:56:15+00:00, stenn@psp-fb1.ntp.org
+ automake cleanup for Oliver's work
+
+ configure.ac@1.570 +4 -0
+ automake cleanup for Oliver's work
+
+ scripts/Makefile.am@1.33 +8 -2
+ automake cleanup for Oliver's work
+
+ scripts/calc_tickadj/Makefile.am@1.2 +8 -7
+ automake cleanup for Oliver's work
+
+ scripts/calc_tickadj/calc_tickadj.texi@1.2 +1 -1
+ automake cleanup for Oliver's work
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.2 +1 -1
+ automake cleanup for Oliver's work
+
+ scripts/ntp-wait/Makefile.am@1.2 +27 -26
+ automake cleanup for Oliver's work
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.213 +1 -1
+ automake cleanup for Oliver's work
+
+ scripts/ntp-wait/ntp-wait.in@1.11 +0 -1
+ automake cleanup for Oliver's work
+
+ scripts/ntpsweep/Makefile.am@1.2 +23 -22
+ automake cleanup for Oliver's work
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.2 +1 -1
+ automake cleanup for Oliver's work
+
+ scripts/ntpsweep/ntpsweep.in@1.8 +0 -1
+ automake cleanup for Oliver's work
+
+ scripts/ntptrace/Makefile.am@1.2 +5 -7
+ automake cleanup for Oliver's work
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.2 +1 -1
+ automake cleanup for Oliver's work
+
+ scripts/ntptrace/ntptrace.in@1.12 +0 -1
+ automake cleanup for Oliver's work
+
+ sntp/loc/debian@1.2 +1 -0
+ automake cleanup for Oliver's work
+
+ sntp/loc/legacy@1.5 +1 -0
+ automake cleanup for Oliver's work
+
+ sntp/loc/redhat@1.3 +1 -0
+ automake cleanup for Oliver's work
+
+ sntp/loc/solaris@1.4 +1 -0
+ automake cleanup for Oliver's work
+
+ sntp/m4/ntp_locinfo.m4@1.15 +4 -0
+ automake cleanup for Oliver's work
+
+ChangeSet@1.3023, 2013-12-18 11:09:54+00:00, stenn@psp-fb1.ntp.org
+ updates
+
+ configure.ac@1.569 +6 -6
+ fix *_opts variables
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.1 +103 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.0 +0 -0
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.1 +80 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.0 +0 -0
+
+ scripts/calc_tickadj/calc_tickadj.html@1.1 +178 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj.html
+
+ scripts/calc_tickadj/calc_tickadj.html@1.0 +0 -0
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.1 +80 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj.mdoc.in
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.0 +0 -0
+
+ scripts/calc_tickadj/invoke-calc_tickadj.menu@1.1 +1 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/invoke-calc_tickadj.menu
+
+ scripts/calc_tickadj/invoke-calc_tickadj.menu@1.0 +0 -0
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.1 +102 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/invoke-calc_tickadj.texi
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.0 +0 -0
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.212 +32 -64
+ updates
+
+ scripts/ntp-wait/ntp-wait.html@1.228 +85 -117
+ updates
+
+ scripts/ntp-wait/ntp-wait.in@1.10 +2 -0
+ updates
+
+ scripts/ntpsweep/invoke-ntpsweep.menu@1.1 +1 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/invoke-ntpsweep.menu
+
+ scripts/ntpsweep/invoke-ntpsweep.menu@1.0 +0 -0
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.1 +118 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/invoke-ntpsweep.texi
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.1 +92 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep.1ntpsweepman
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.1 +71 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep.html@1.1 +212 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep.html
+
+ scripts/ntpsweep/ntpsweep.html@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep.in@1.7 +2 -0
+ updates
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.2 +2 -2
+ updates
+
+ scripts/ntptrace/invoke-ntptrace.menu@1.1 +1 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/invoke-ntptrace.menu
+
+ scripts/ntptrace/invoke-ntptrace.menu@1.0 +0 -0
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.1 +109 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/invoke-ntptrace.texi
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.1 +109 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace.1ntptraceman
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.1 +87 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace.1ntptracemdoc
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace.html@1.1 +189 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace.html
+
+ scripts/ntptrace/ntptrace.html@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace.in@1.11 +2 -0
+ updates
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.2 +2 -2
+ updates
+
+ChangeSet@1.3020.1.5, 2013-11-30 11:34:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P401
+ TAG: NTP_4_2_7P401
+
+ ChangeLog@1.1361.1.4 +1 -0
+ NTP_4_2_7P401
+
+ ntpd/invoke-ntp.conf.texi@1.79 +1 -1
+ NTP_4_2_7P401
+
+ ntpd/invoke-ntp.keys.texi@1.77 +1 -1
+ NTP_4_2_7P401
+
+ ntpd/invoke-ntpd.texi@1.393 +2 -2
+ NTP_4_2_7P401
+
+ ntpd/ntp.conf.5man@1.113 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntp.conf.5mdoc@1.113 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntp.conf.html@1.74 +1 -1
+ NTP_4_2_7P401
+
+ ntpd/ntp.conf.man.in@1.113 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntp.conf.mdoc.in@1.113 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntp.keys.5man@1.111 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntp.keys.5mdoc@1.111 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntp.keys.html@1.75 +1 -1
+ NTP_4_2_7P401
+
+ ntpd/ntp.keys.man.in@1.111 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntp.keys.mdoc.in@1.111 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntpd-opts.c@1.411 +7 -7
+ NTP_4_2_7P401
+
+ ntpd/ntpd-opts.h@1.411 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntpd.1ntpdman@1.222 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntpd.1ntpdmdoc@1.222 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntpd.html@1.69 +2 -2
+ NTP_4_2_7P401
+
+ ntpd/ntpd.man.in@1.222 +3 -3
+ NTP_4_2_7P401
+
+ ntpd/ntpd.mdoc.in@1.222 +3 -3
+ NTP_4_2_7P401
+
+ ntpdc/invoke-ntpdc.texi@1.390 +2 -2
+ NTP_4_2_7P401
+
+ ntpdc/ntpdc-opts.c@1.405 +7 -7
+ NTP_4_2_7P401
+
+ ntpdc/ntpdc-opts.h@1.405 +3 -3
+ NTP_4_2_7P401
+
+ ntpdc/ntpdc.1ntpdcman@1.221 +2 -2
+ NTP_4_2_7P401
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.221 +2 -2
+ NTP_4_2_7P401
+
+ ntpdc/ntpdc.html@1.234 +2 -2
+ NTP_4_2_7P401
+
+ ntpdc/ntpdc.man.in@1.221 +2 -2
+ NTP_4_2_7P401
+
+ ntpdc/ntpdc.mdoc.in@1.221 +2 -2
+ NTP_4_2_7P401
+
+ ntpq/invoke-ntpq.texi@1.394 +2 -2
+ NTP_4_2_7P401
+
+ ntpq/ntpq-opts.c@1.408 +7 -7
+ NTP_4_2_7P401
+
+ ntpq/ntpq-opts.h@1.408 +3 -3
+ NTP_4_2_7P401
+
+ ntpq/ntpq.1ntpqman@1.222 +2 -2
+ NTP_4_2_7P401
+
+ ntpq/ntpq.1ntpqmdoc@1.222 +2 -2
+ NTP_4_2_7P401
+
+ ntpq/ntpq.html@1.66 +2 -2
+ NTP_4_2_7P401
+
+ ntpq/ntpq.man.in@1.222 +2 -2
+ NTP_4_2_7P401
+
+ ntpq/ntpq.mdoc.in@1.222 +2 -2
+ NTP_4_2_7P401
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.393 +2 -2
+ NTP_4_2_7P401
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.408 +7 -7
+ NTP_4_2_7P401
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.408 +3 -3
+ NTP_4_2_7P401
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.222 +3 -3
+ NTP_4_2_7P401
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.222 +3 -3
+ NTP_4_2_7P401
+
+ ntpsnmpd/ntpsnmpd.html@1.64 +1 -1
+ NTP_4_2_7P401
+
+ ntpsnmpd/ntpsnmpd.man.in@1.222 +3 -3
+ NTP_4_2_7P401
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.222 +3 -3
+ NTP_4_2_7P401
+
+ packageinfo.sh@1.404 +1 -1
+ NTP_4_2_7P401
+
+ scripts/invoke-ntp-wait.texi@1.208.1.2 +1 -1
+ NTP_4_2_7P401
+
+ scripts/ntp-wait.1ntp-waitman@1.219.1.2 +3 -3
+ NTP_4_2_7P401
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.219.1.2 +3 -3
+ NTP_4_2_7P401
+
+ scripts/ntp-wait.html@1.224.1.2 +1 -1
+ NTP_4_2_7P401
+
+ scripts/ntp-wait.man.in@1.219.1.2 +3 -3
+ NTP_4_2_7P401
+
+ scripts/ntp-wait.mdoc.in@1.219.1.2 +3 -3
+ NTP_4_2_7P401
+
+ sntp/invoke-sntp.texi@1.390 +2 -2
+ NTP_4_2_7P401
+
+ sntp/sntp-opts.c@1.405 +7 -7
+ NTP_4_2_7P401
+
+ sntp/sntp-opts.h@1.405 +3 -3
+ NTP_4_2_7P401
+
+ sntp/sntp.1sntpman@1.225 +3 -3
+ NTP_4_2_7P401
+
+ sntp/sntp.1sntpmdoc@1.225 +3 -3
+ NTP_4_2_7P401
+
+ sntp/sntp.html@1.405 +2 -2
+ NTP_4_2_7P401
+
+ sntp/sntp.man.in@1.225 +3 -3
+ NTP_4_2_7P401
+
+ sntp/sntp.mdoc.in@1.225 +3 -3
+ NTP_4_2_7P401
+
+ util/invoke-ntp-keygen.texi@1.394 +2 -2
+ NTP_4_2_7P401
+
+ util/ntp-keygen-opts.c@1.408 +7 -7
+ NTP_4_2_7P401
+
+ util/ntp-keygen-opts.h@1.408 +3 -3
+ NTP_4_2_7P401
+
+ util/ntp-keygen.1ntp-keygenman@1.222 +3 -3
+ NTP_4_2_7P401
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.222 +3 -3
+ NTP_4_2_7P401
+
+ util/ntp-keygen.html@1.70 +2 -2
+ NTP_4_2_7P401
+
+ util/ntp-keygen.man.in@1.222 +3 -3
+ NTP_4_2_7P401
+
+ util/ntp-keygen.mdoc.in@1.222 +3 -3
+ NTP_4_2_7P401
+
+ChangeSet@1.3020.1.4, 2013-11-30 03:56:11-05:00, stenn@deacon.udel.edu
+ [Bug 2491] VS20xx compile fixes
+
+ ChangeLog@1.1361.1.3 +1 -0
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/include/config.h@1.107 +12 -3
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/include/stdint.h@1.2 +2 -2
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj@1.2 +4 -4
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj@1.2 +4 -4
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.2 +4 -4
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.2 +4 -4
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcxproj@1.2 +4 -4
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcxproj@1.2 +4 -4
+ [Bug 2491] VS20xx compile fixes
+
+ ports/winnt/vs2013/ntpq/ntpq.vcxproj@1.2 +4 -4
+ [Bug 2491] VS20xx compile fixes
+
+ChangeSet@1.3020.1.3, 2013-11-29 11:36:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P400
+ TAG: NTP_4_2_7P400
+
+ ChangeLog@1.1361.1.2 +1 -0
+ NTP_4_2_7P400
+
+ ntpd/invoke-ntp.conf.texi@1.78 +1 -1
+ NTP_4_2_7P400
+
+ ntpd/invoke-ntp.keys.texi@1.76 +1 -1
+ NTP_4_2_7P400
+
+ ntpd/invoke-ntpd.texi@1.392 +2 -2
+ NTP_4_2_7P400
+
+ ntpd/ntp.conf.5man@1.112 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntp.conf.5mdoc@1.112 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntp.conf.html@1.73 +1 -1
+ NTP_4_2_7P400
+
+ ntpd/ntp.conf.man.in@1.112 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntp.conf.mdoc.in@1.112 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntp.keys.5man@1.110 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntp.keys.5mdoc@1.110 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntp.keys.html@1.74 +1 -1
+ NTP_4_2_7P400
+
+ ntpd/ntp.keys.man.in@1.110 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntp.keys.mdoc.in@1.110 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntpd-opts.c@1.410 +7 -7
+ NTP_4_2_7P400
+
+ ntpd/ntpd-opts.h@1.410 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntpd.1ntpdman@1.221 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntpd.1ntpdmdoc@1.221 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntpd.html@1.68 +2 -2
+ NTP_4_2_7P400
+
+ ntpd/ntpd.man.in@1.221 +3 -3
+ NTP_4_2_7P400
+
+ ntpd/ntpd.mdoc.in@1.221 +3 -3
+ NTP_4_2_7P400
+
+ ntpdc/invoke-ntpdc.texi@1.389 +2 -2
+ NTP_4_2_7P400
+
+ ntpdc/ntpdc-opts.c@1.404 +7 -7
+ NTP_4_2_7P400
+
+ ntpdc/ntpdc-opts.h@1.404 +3 -3
+ NTP_4_2_7P400
+
+ ntpdc/ntpdc.1ntpdcman@1.220 +2 -2
+ NTP_4_2_7P400
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.220 +2 -2
+ NTP_4_2_7P400
+
+ ntpdc/ntpdc.html@1.233 +2 -2
+ NTP_4_2_7P400
+
+ ntpdc/ntpdc.man.in@1.220 +2 -2
+ NTP_4_2_7P400
+
+ ntpdc/ntpdc.mdoc.in@1.220 +2 -2
+ NTP_4_2_7P400
+
+ ntpq/invoke-ntpq.texi@1.393 +2 -2
+ NTP_4_2_7P400
+
+ ntpq/ntpq-opts.c@1.407 +7 -7
+ NTP_4_2_7P400
+
+ ntpq/ntpq-opts.h@1.407 +3 -3
+ NTP_4_2_7P400
+
+ ntpq/ntpq.1ntpqman@1.221 +2 -2
+ NTP_4_2_7P400
+
+ ntpq/ntpq.1ntpqmdoc@1.221 +2 -2
+ NTP_4_2_7P400
+
+ ntpq/ntpq.html@1.65 +2 -2
+ NTP_4_2_7P400
+
+ ntpq/ntpq.man.in@1.221 +2 -2
+ NTP_4_2_7P400
+
+ ntpq/ntpq.mdoc.in@1.221 +2 -2
+ NTP_4_2_7P400
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.392 +2 -2
+ NTP_4_2_7P400
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.407 +7 -7
+ NTP_4_2_7P400
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.407 +3 -3
+ NTP_4_2_7P400
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.221 +3 -3
+ NTP_4_2_7P400
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.221 +3 -3
+ NTP_4_2_7P400
+
+ ntpsnmpd/ntpsnmpd.html@1.63 +1 -1
+ NTP_4_2_7P400
+
+ ntpsnmpd/ntpsnmpd.man.in@1.221 +3 -3
+ NTP_4_2_7P400
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.221 +3 -3
+ NTP_4_2_7P400
+
+ packageinfo.sh@1.403 +1 -1
+ NTP_4_2_7P400
+
+ scripts/invoke-ntp-wait.texi@1.208.1.1 +1 -1
+ NTP_4_2_7P400
+
+ scripts/ntp-wait.1ntp-waitman@1.219.1.1 +3 -3
+ NTP_4_2_7P400
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.219.1.1 +3 -3
+ NTP_4_2_7P400
+
+ scripts/ntp-wait.html@1.224.1.1 +1 -1
+ NTP_4_2_7P400
+
+ scripts/ntp-wait.man.in@1.219.1.1 +3 -3
+ NTP_4_2_7P400
+
+ scripts/ntp-wait.mdoc.in@1.219.1.1 +3 -3
+ NTP_4_2_7P400
+
+ sntp/invoke-sntp.texi@1.389 +2 -2
+ NTP_4_2_7P400
+
+ sntp/sntp-opts.c@1.404 +7 -7
+ NTP_4_2_7P400
+
+ sntp/sntp-opts.h@1.404 +3 -3
+ NTP_4_2_7P400
+
+ sntp/sntp.1sntpman@1.224 +3 -3
+ NTP_4_2_7P400
+
+ sntp/sntp.1sntpmdoc@1.224 +3 -3
+ NTP_4_2_7P400
+
+ sntp/sntp.html@1.404 +2 -2
+ NTP_4_2_7P400
+
+ sntp/sntp.man.in@1.224 +3 -3
+ NTP_4_2_7P400
+
+ sntp/sntp.mdoc.in@1.224 +3 -3
+ NTP_4_2_7P400
+
+ util/invoke-ntp-keygen.texi@1.393 +2 -2
+ NTP_4_2_7P400
+
+ util/ntp-keygen-opts.c@1.407 +7 -7
+ NTP_4_2_7P400
+
+ util/ntp-keygen-opts.h@1.407 +3 -3
+ NTP_4_2_7P400
+
+ util/ntp-keygen.1ntp-keygenman@1.221 +3 -3
+ NTP_4_2_7P400
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.221 +3 -3
+ NTP_4_2_7P400
+
+ util/ntp-keygen.html@1.69 +2 -2
+ NTP_4_2_7P400
+
+ util/ntp-keygen.man.in@1.221 +3 -3
+ NTP_4_2_7P400
+
+ util/ntp-keygen.mdoc.in@1.221 +3 -3
+ NTP_4_2_7P400
+
+ChangeSet@1.3020.1.2, 2013-11-29 05:40:01-05:00, stenn@deacon.udel.edu
+ [Bug 2491] VS2013 project files
+
+ ports/winnt/include/config.h@1.106 +5 -1
+ [Bug 2491] VS2013 project files
+
+ChangeSet@1.3020.1.1, 2013-11-29 05:34:11-05:00, stenn@deacon.udel.edu
+ [Bug 2491] VS2013 project files
+
+ ChangeLog@1.1361.1.1 +1 -0
+ [Bug 2491] VS2013 project files
+
+ ports/winnt/vs2013/instsrv/instsrv.vcproj@1.1 +258 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/instsrv/instsrv.vcproj
+
+ ports/winnt/vs2013/instsrv/instsrv.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/instsrv/instsrv.vcxproj@1.1 +311 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/instsrv/instsrv.vcxproj
+
+ ports/winnt/vs2013/instsrv/instsrv.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters@1.1 +22 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters
+
+ ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/libntp/libntp.vcproj@1.1 +936 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/libntp/libntp.vcproj
+
+ ports/winnt/vs2013/libntp/libntp.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj@1.1 +443 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/libntp/libntp.vcxproj
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.1 +556 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/libntp/libntp.vcxproj.filters
+
+ ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj@1.1 +256 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj
+
+ ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj@1.1 +276 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj
+
+ ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters@1.1 +36 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters
+
+ ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters@1.1 +36 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters
+
+ ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/ntp.sln@1.1 +108 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntp.sln
+
+ ports/winnt/vs2013/ntp.sln@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj@1.1 +273 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters@1.1 +69 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters
+
+ ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat@1.1 +39 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat
+
+ ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpd/ntpd.vcproj@1.1 +1126 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpd/ntpd.vcproj
+
+ ports/winnt/vs2013/ntpd/ntpd.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.1 +594 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpd/ntpd.vcxproj
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters@1.1 +559 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcproj@1.1 +362 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpdate/ntpdate.vcproj
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcxproj@1.1 +360 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters@1.1 +72 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters
+
+ ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcproj@1.1 +367 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpdc/ntpdc.vcproj
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcxproj@1.1 +365 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters@1.1 +45 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters
+
+ ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpq/ntpq.vcproj@1.1 +357 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpq/ntpq.vcproj
+
+ ports/winnt/vs2013/ntpq/ntpq.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpq/ntpq.vcxproj@1.1 +349 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpq/ntpq.vcxproj
+
+ ports/winnt/vs2013/ntpq/ntpq.vcxproj@1.0 +0 -0
+
+ ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters
+
+ ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters@1.0 +0 -0
+
+ChangeSet@1.2991.2.1, 2013-11-29 06:12:37+00:00, stenn@psp-fb1.ntp.org
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ BitKeeper/deleted/21/checktime.in~d65a0b68@1.3 +0 -0
+ Delete: scripts/checktime.in
+
+ ChangeLog@1.1338.2.1 +1 -0
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ Makefile.am@1.117 +3 -3
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ bootstrap@1.42 +2 -1
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ configure.ac@1.562.2.1 +27 -8
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ ntpd/Makefile.am@1.127.1.1 +2 -2
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ ntpdate/Makefile.am@1.37 +1 -1
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ ntpdc/Makefile.am@1.74 +2 -2
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ ntpq/Makefile.am@1.70 +2 -2
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ ntpsnmpd/Makefile.am@1.39 +1 -1
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/Makefile.am@1.32 +13 -74
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/README@1.9 +7 -19
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/build/Makefile.am@1.1 +13 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/build/Makefile.am
+
+ scripts/build/Makefile.am@1.0 +0 -0
+
+ scripts/build/UpdatePoint@1.6 +3 -3
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/build/UpdatePoint@1.5 +0 -0
+ Rename: scripts/UpdatePoint -> scripts/build/UpdatePoint
+
+ scripts/build/VersionName@1.7 +0 -0
+ Rename: scripts/VersionName -> scripts/build/VersionName
+
+ scripts/build/addChangeLogTag@1.5 +1 -1
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/build/addChangeLogTag@1.4 +0 -0
+ Rename: scripts/addChangeLogTag -> scripts/build/addChangeLogTag
+
+ scripts/build/check--help@1.3 +0 -0
+ Rename: scripts/check--help -> scripts/build/check--help
+
+ scripts/build/checkChangeLog@1.6 +0 -0
+ Rename: scripts/checkChangeLog -> scripts/build/checkChangeLog
+
+ scripts/build/fixautomakedepsmagic@1.4 +0 -0
+ Change mode to -rwxrwxr-x
+
+ scripts/build/fixautomakedepsmagic@1.3 +0 -0
+ Rename: scripts/fixautomakedepsmagic -> scripts/build/fixautomakedepsmagic
+
+ scripts/build/genChangeLogTag@1.3 +1 -1
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/build/genChangeLogTag@1.2 +0 -0
+ Rename: scripts/genChangeLogTag -> scripts/build/genChangeLogTag
+
+ scripts/build/genCommitLog@1.9 +0 -0
+ Rename: scripts/genCommitLog -> scripts/build/genCommitLog
+
+ scripts/build/genver@1.9 +1 -1
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/build/genver@1.8 +0 -0
+ Rename: scripts/genver -> scripts/build/genver
+
+ scripts/build/mkver.in@1.15 +0 -0
+ Rename: scripts/mkver.in -> scripts/build/mkver.in
+
+ scripts/calc_tickadj/Makefile.am@1.1 +79 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/Makefile.am
+
+ scripts/calc_tickadj/Makefile.am@1.0 +0 -0
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.1 +60 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj-opts
+
+ scripts/calc_tickadj/calc_tickadj-opts@1.0 +0 -0
+
+ scripts/calc_tickadj/calc_tickadj-opts.def@1.1 +55 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj-opts.def
+
+ scripts/calc_tickadj/calc_tickadj-opts.def@1.0 +0 -0
+
+ scripts/calc_tickadj/calc_tickadj.in@1.4 +51 -30
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/calc_tickadj/calc_tickadj.in@1.3 +0 -0
+ Rename: scripts/calc_tickadj.in -> scripts/calc_tickadj/calc_tickadj.in
+
+ scripts/calc_tickadj/calc_tickadj.texi@1.1 +37 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/calc_tickadj/calc_tickadj.texi
+
+ scripts/calc_tickadj/calc_tickadj.texi@1.0 +0 -0
+
+ scripts/deprecated/freq_adj.in@1.3 +0 -0
+ Rename: scripts/freq_adj.in -> scripts/deprecated/freq_adj.in
+
+ scripts/deprecated/hpadjtime.sh@1.3 +0 -0
+ Rename: scripts/hpadjtime.sh -> scripts/deprecated/hpadjtime.sh
+
+ scripts/deprecated/html2man.in@1.8 +0 -0
+ Rename: scripts/html2man.in -> scripts/deprecated/html2man.in
+
+ scripts/deprecated/ntp-close@1.3 +0 -0
+ Rename: scripts/ntp-close -> scripts/deprecated/ntp-close
+
+ scripts/deprecated/ntp-groper@1.3 +0 -0
+ Rename: scripts/ntp-groper -> scripts/deprecated/ntp-groper
+
+ scripts/deprecated/ntp-restart@1.4 +0 -0
+ Rename: scripts/ntp-restart -> scripts/deprecated/ntp-restart
+
+ scripts/deprecated/ntp-status@1.3 +0 -0
+ Rename: scripts/ntp-status -> scripts/deprecated/ntp-status
+
+ scripts/lib/Makefile.am@1.1 +5 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/lib/Makefile.am
+
+ scripts/lib/Makefile.am@1.0 +0 -0
+
+ scripts/lib/NTP/Mode6/Packet.pm@1.1 +222 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/lib/NTP/Mode6/Packet.pm
+
+ scripts/lib/NTP/Mode6/Packet.pm@1.0 +0 -0
+
+ scripts/lib/NTP/Util.pm@1.1 +136 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/lib/NTP/Util.pm
+
+ scripts/lib/NTP/Util.pm@1.0 +0 -0
+
+ scripts/ntp-wait/Makefile.am@1.1 +87 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntp-wait/Makefile.am
+
+ scripts/ntp-wait/Makefile.am@1.0 +0 -0
+
+ scripts/ntp-wait/invoke-ntp-wait.menu@1.3 +0 -0
+ Rename: scripts/invoke-ntp-wait.menu -> scripts/ntp-wait/invoke-ntp-wait.menu
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.199.1.1 +0 -0
+ Rename: scripts/invoke-ntp-wait.texi -> scripts/ntp-wait/invoke-ntp-wait.texi
+
+ scripts/ntp-wait/ntp-wait-opts@1.1 +62 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntp-wait/ntp-wait-opts
+
+ scripts/ntp-wait/ntp-wait-opts@1.0 +0 -0
+
+ scripts/ntp-wait/ntp-wait-opts.def@1.9 +30 -29
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/ntp-wait/ntp-wait-opts.def@1.8 +0 -0
+ Rename: scripts/ntp-wait-opts.def -> scripts/ntp-wait/ntp-wait-opts.def
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.210.1.1 +0 -0
+ Rename: scripts/ntp-wait.1ntp-waitman -> scripts/ntp-wait/ntp-wait.1ntp-waitman
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.210.1.1 +0 -0
+ Rename: scripts/ntp-wait.1ntp-waitmdoc -> scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
+
+ scripts/ntp-wait/ntp-wait.html@1.215.1.1 +0 -0
+ Rename: scripts/ntp-wait.html -> scripts/ntp-wait/ntp-wait.html
+
+ scripts/ntp-wait/ntp-wait.in@1.9 +62 -51
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/ntp-wait/ntp-wait.in@1.8 +0 -0
+ Rename: scripts/ntp-wait.in -> scripts/ntp-wait/ntp-wait.in
+
+ scripts/ntp-wait/ntp-wait.man.in@1.210.1.1 +0 -0
+ Rename: scripts/ntp-wait.man.in -> scripts/ntp-wait/ntp-wait.man.in
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.210.1.2 +26 -56
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.210.1.1 +0 -0
+ Rename: scripts/ntp-wait.mdoc.in -> scripts/ntp-wait/ntp-wait.mdoc.in
+
+ scripts/ntp-wait/ntp-wait.texi@1.6 +1 -10
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/ntp-wait/ntp-wait.texi@1.5 +0 -0
+ Rename: scripts/ntp-wait.texi -> scripts/ntp-wait/ntp-wait.texi
+
+ scripts/ntpsweep/Makefile.am@1.1 +80 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/Makefile.am
+
+ scripts/ntpsweep/Makefile.am@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep-opts@1.1 +72 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep-opts
+
+ scripts/ntpsweep/ntpsweep-opts@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep-opts.def@1.1 +63 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep-opts.def
+
+ scripts/ntpsweep/ntpsweep-opts.def@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep.in@1.6 +150 -247
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/ntpsweep/ntpsweep.in@1.5 +0 -0
+ Rename: scripts/ntpsweep.in -> scripts/ntpsweep/ntpsweep.in
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.1 +71 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep.mdoc.in
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.0 +0 -0
+
+ scripts/ntpsweep/ntpsweep.texi@1.1 +43 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntpsweep/ntpsweep.texi
+
+ scripts/ntpsweep/ntpsweep.texi@1.0 +0 -0
+
+ scripts/ntptrace/Makefile.am@1.1 +86 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/Makefile.am
+
+ scripts/ntptrace/Makefile.am@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace-opts@1.1 +67 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace-opts
+
+ scripts/ntptrace/ntptrace-opts@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace-opts.def@1.1 +66 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace-opts.def
+
+ scripts/ntptrace/ntptrace-opts.def@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace.in@1.10 +74 -67
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/ntptrace/ntptrace.in@1.9 +0 -0
+ Rename: scripts/ntptrace.in -> scripts/ntptrace/ntptrace.in
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.1 +87 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace.mdoc.in
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.0 +0 -0
+
+ scripts/ntptrace/ntptrace.texi@1.1 +40 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/ntptrace/ntptrace.texi
+
+ scripts/ntptrace/ntptrace.texi@1.0 +0 -0
+
+ scripts/plot_summary-opts@1.1 +73 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary-opts
+
+ scripts/plot_summary-opts@1.0 +0 -0
+
+ scripts/plot_summary-opts.def@1.1 +78 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/plot_summary-opts.def
+
+ scripts/plot_summary-opts.def@1.0 +0 -0
+
+ scripts/plot_summary.in@1.3 +42 -50
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/rc/README@1.1 +13 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/rc/README
+
+ scripts/rc/README@1.0 +0 -0
+
+ scripts/rc/ntpd@1.1 +88 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/rc/ntpd
+
+ scripts/rc/ntpd@1.0 +0 -0
+
+ scripts/rc/ntpwait@1.1 +15 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/rc/ntpwait
+
+ scripts/rc/ntpwait@1.0 +0 -0
+
+ scripts/rc/rc.d/TIMESYNC@1.1 +8 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/rc/rc.d/TIMESYNC
+
+ scripts/rc/rc.d/TIMESYNC@1.0 +0 -0
+
+ scripts/rc/rc.d/ntpd@1.1 +32 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/rc/rc.d/ntpd
+
+ scripts/rc/rc.d/ntpd@1.0 +0 -0
+
+ scripts/rc/rc.d/ntpwait@1.1 +21 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/rc/rc.d/ntpwait
+
+ scripts/rc/rc.d/ntpwait@1.0 +0 -0
+
+ scripts/rc1/postinstall@1.3 +0 -2
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/rc1/preinstall@1.3 +0 -6
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/rc1/preremove@1.3 +0 -4
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/rc1/prototype@1.3 +0 -19
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/rc1/xntp@1.3 +0 -29
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/rc2/local.ntpd@1.3 +0 -64
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/summary-opts@1.1 +69 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary-opts
+
+ scripts/summary-opts@1.0 +0 -0
+
+ scripts/summary-opts.def@1.1 +77 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/summary-opts.def
+
+ scripts/summary-opts.def@1.0 +0 -0
+
+ scripts/summary.in@1.3 +81 -85
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ scripts/t/1_common.t@1.1 +28 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/1_common.t
+
+ scripts/t/1_common.t@1.0 +0 -0
+
+ scripts/t/calc_tickadj.t@1.1 +90 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/calc_tickadj.t
+
+ scripts/t/calc_tickadj.t@1.0 +0 -0
+
+ scripts/t/lib/Test/Command.pm@1.1 +261 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/lib/Test/Command.pm
+
+ scripts/t/lib/Test/Command.pm@1.0 +0 -0
+
+ scripts/t/lib/Test/Mode6/Server.pm@1.1 +66 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/lib/Test/Mode6/Server.pm
+
+ scripts/t/lib/Test/Mode6/Server.pm@1.0 +0 -0
+
+ scripts/t/lib/Test/Util.pm@1.1 +167 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/lib/Test/Util.pm
+
+ scripts/t/lib/Test/Util.pm@1.0 +0 -0
+
+ scripts/t/ntp-wait.t@1.1 +142 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/ntp-wait.t
+
+ scripts/t/ntp-wait.t@1.0 +0 -0
+
+ scripts/t/ntpsweep.t@1.1 +117 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/ntpsweep.t
+
+ scripts/t/ntpsweep.t@1.0 +0 -0
+
+ scripts/t/ntptrace.t@1.1 +154 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/ntptrace.t
+
+ scripts/t/ntptrace.t@1.0 +0 -0
+
+ scripts/t/plot_summary.t@1.1 +17 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/plot_summary.t
+
+ scripts/t/plot_summary.t@1.0 +0 -0
+
+ scripts/t/summary.t@1.1 +17 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/summary.t
+
+ scripts/t/summary.t@1.0 +0 -0
+
+ scripts/t/util.t@1.1 +179 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/scripts/t/util.t
+
+ scripts/t/util.t@1.0 +0 -0
+
+ sntp/Makefile.am@1.75 +5 -5
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ sntp/ag-tpl/Mdoc.pm@1.1 +515 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/sntp/ag-tpl/Mdoc.pm
+
+ sntp/ag-tpl/Mdoc.pm@1.0 +0 -0
+
+ sntp/ag-tpl/agman-cmd.tpl@1.1 +58 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/sntp/ag-tpl/agman-cmd.tpl
+
+ sntp/ag-tpl/agman-cmd.tpl@1.0 +0 -0
+
+ sntp/ag-tpl/agmdoc-cmd.tpl@1.1 +46 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/sntp/ag-tpl/agmdoc-cmd.tpl
+
+ sntp/ag-tpl/agmdoc-cmd.tpl@1.0 +0 -0
+
+ sntp/ag-tpl/cmd-doc.tlib@1.1 +1079 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/sntp/ag-tpl/cmd-doc.tlib
+
+ sntp/ag-tpl/cmd-doc.tlib@1.0 +0 -0
+
+ sntp/ag-tpl/mdoc-synopsis.tlib@1.1 +92 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/sntp/ag-tpl/mdoc-synopsis.tlib
+
+ sntp/ag-tpl/mdoc-synopsis.tlib@1.0 +0 -0
+
+ sntp/ag-tpl/mdoc2man@1.1 +181 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/sntp/ag-tpl/mdoc2man
+
+ sntp/ag-tpl/mdoc2man@1.0 +0 -0
+
+ sntp/ag-tpl/mdoc2texi@1.8 +144 -1016
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ sntp/ag-tpl/perlopt.tpl@1.1 +176 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/kindernay/ntp-dev-final/sntp/ag-tpl/perlopt.tpl
+
+ sntp/ag-tpl/perlopt.tpl@1.0 +0 -0
+
+ sntp/m4/define_dir.m4@1.4 +26 -17
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ util/Makefile.am@1.75 +2 -2
+ Incorporate Oliver Kindernay's GSoC 2013 scripts/ cleanup
+
+ChangeSet@1.3020, 2013-11-28 11:37:11+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P399
+ TAG: NTP_4_2_7P399
+
+ ChangeLog@1.1361 +1 -0
+ NTP_4_2_7P399
+
+ ntpd/invoke-ntp.conf.texi@1.77 +1 -1
+ NTP_4_2_7P399
+
+ ntpd/invoke-ntp.keys.texi@1.75 +1 -1
+ NTP_4_2_7P399
+
+ ntpd/invoke-ntpd.texi@1.391 +2 -2
+ NTP_4_2_7P399
+
+ ntpd/ntp.conf.5man@1.111 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntp.conf.5mdoc@1.111 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntp.conf.html@1.72 +1 -1
+ NTP_4_2_7P399
+
+ ntpd/ntp.conf.man.in@1.111 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntp.conf.mdoc.in@1.111 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntp.keys.5man@1.109 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntp.keys.5mdoc@1.109 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntp.keys.html@1.73 +1 -1
+ NTP_4_2_7P399
+
+ ntpd/ntp.keys.man.in@1.109 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntp.keys.mdoc.in@1.109 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntpd-opts.c@1.409 +7 -7
+ NTP_4_2_7P399
+
+ ntpd/ntpd-opts.h@1.409 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntpd.1ntpdman@1.220 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntpd.1ntpdmdoc@1.220 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntpd.html@1.67 +2 -2
+ NTP_4_2_7P399
+
+ ntpd/ntpd.man.in@1.220 +3 -3
+ NTP_4_2_7P399
+
+ ntpd/ntpd.mdoc.in@1.220 +3 -3
+ NTP_4_2_7P399
+
+ ntpdc/invoke-ntpdc.texi@1.388 +2 -2
+ NTP_4_2_7P399
+
+ ntpdc/ntpdc-opts.c@1.403 +7 -7
+ NTP_4_2_7P399
+
+ ntpdc/ntpdc-opts.h@1.403 +3 -3
+ NTP_4_2_7P399
+
+ ntpdc/ntpdc.1ntpdcman@1.219 +2 -2
+ NTP_4_2_7P399
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.219 +2 -2
+ NTP_4_2_7P399
+
+ ntpdc/ntpdc.html@1.232 +2 -2
+ NTP_4_2_7P399
+
+ ntpdc/ntpdc.man.in@1.219 +2 -2
+ NTP_4_2_7P399
+
+ ntpdc/ntpdc.mdoc.in@1.219 +2 -2
+ NTP_4_2_7P399
+
+ ntpq/invoke-ntpq.texi@1.392 +2 -2
+ NTP_4_2_7P399
+
+ ntpq/ntpq-opts.c@1.406 +7 -7
+ NTP_4_2_7P399
+
+ ntpq/ntpq-opts.h@1.406 +3 -3
+ NTP_4_2_7P399
+
+ ntpq/ntpq.1ntpqman@1.220 +2 -2
+ NTP_4_2_7P399
+
+ ntpq/ntpq.1ntpqmdoc@1.220 +2 -2
+ NTP_4_2_7P399
+
+ ntpq/ntpq.html@1.64 +2 -2
+ NTP_4_2_7P399
+
+ ntpq/ntpq.man.in@1.220 +2 -2
+ NTP_4_2_7P399
+
+ ntpq/ntpq.mdoc.in@1.220 +2 -2
+ NTP_4_2_7P399
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.391 +2 -2
+ NTP_4_2_7P399
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.406 +7 -7
+ NTP_4_2_7P399
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.406 +3 -3
+ NTP_4_2_7P399
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.220 +3 -3
+ NTP_4_2_7P399
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.220 +3 -3
+ NTP_4_2_7P399
+
+ ntpsnmpd/ntpsnmpd.html@1.62 +1 -1
+ NTP_4_2_7P399
+
+ ntpsnmpd/ntpsnmpd.man.in@1.220 +3 -3
+ NTP_4_2_7P399
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.220 +3 -3
+ NTP_4_2_7P399
+
+ packageinfo.sh@1.402 +1 -1
+ NTP_4_2_7P399
+
+ scripts/invoke-ntp-wait.texi@1.208 +1 -1
+ NTP_4_2_7P399
+
+ scripts/ntp-wait.1ntp-waitman@1.219 +3 -3
+ NTP_4_2_7P399
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.219 +3 -3
+ NTP_4_2_7P399
+
+ scripts/ntp-wait.html@1.224 +1 -1
+ NTP_4_2_7P399
+
+ scripts/ntp-wait.man.in@1.219 +3 -3
+ NTP_4_2_7P399
+
+ scripts/ntp-wait.mdoc.in@1.219 +3 -3
+ NTP_4_2_7P399
+
+ sntp/invoke-sntp.texi@1.388 +2 -2
+ NTP_4_2_7P399
+
+ sntp/sntp-opts.c@1.403 +7 -7
+ NTP_4_2_7P399
+
+ sntp/sntp-opts.h@1.403 +3 -3
+ NTP_4_2_7P399
+
+ sntp/sntp.1sntpman@1.223 +3 -3
+ NTP_4_2_7P399
+
+ sntp/sntp.1sntpmdoc@1.223 +3 -3
+ NTP_4_2_7P399
+
+ sntp/sntp.html@1.403 +2 -2
+ NTP_4_2_7P399
+
+ sntp/sntp.man.in@1.223 +3 -3
+ NTP_4_2_7P399
+
+ sntp/sntp.mdoc.in@1.223 +3 -3
+ NTP_4_2_7P399
+
+ util/invoke-ntp-keygen.texi@1.392 +2 -2
+ NTP_4_2_7P399
+
+ util/ntp-keygen-opts.c@1.406 +7 -7
+ NTP_4_2_7P399
+
+ util/ntp-keygen-opts.h@1.406 +3 -3
+ NTP_4_2_7P399
+
+ util/ntp-keygen.1ntp-keygenman@1.220 +3 -3
+ NTP_4_2_7P399
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.220 +3 -3
+ NTP_4_2_7P399
+
+ util/ntp-keygen.html@1.68 +2 -2
+ NTP_4_2_7P399
+
+ util/ntp-keygen.man.in@1.220 +3 -3
+ NTP_4_2_7P399
+
+ util/ntp-keygen.mdoc.in@1.220 +3 -3
+ NTP_4_2_7P399
+
+ChangeSet@1.3017, 2013-11-28 00:20:43-05:00, stenn@deacon.udel.edu
+ [Bug 2514] secs/* #define usage cleanup
+
+ ChangeLog@1.1359 +1 -0
+ [Bug 2514] secs/* #define usage cleanup
+
+ include/ntp_stdlib.h@1.76 +0 -4
+ [Bug 2514] secs/* #define usage cleanup
+
+ ntpd/ntp_loopfilter.c@1.170 +0 -2
+ [Bug 2514] secs/* #define usage cleanup
+
+ ntpd/ntp_timer.c@1.80 +4 -3
+ [Bug 2514] secs/* #define usage cleanup
+
+ ntpd/refclock_tsyncpci.c@1.9 +19 -29
+ [Bug 2514] secs/* #define usage cleanup
+
+ util/ntp-keygen.c@1.96 +2 -3
+ [Bug 2514] secs/* #define usage cleanup
+
+ChangeSet@1.3016, 2013-11-27 22:07:41+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ChangeLog@1.1358 +1 -0
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ntpd/ntp_timer.c@1.79 +4 -4
+ [Bug 2326] More leapsecond file notification cleanup
+
+ChangeSet@1.3015, 2013-11-25 13:00:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P398
+ TAG: NTP_4_2_7P398
+
+ ChangeLog@1.1357 +1 -0
+ NTP_4_2_7P398
+
+ ntpd/invoke-ntp.conf.texi@1.76 +1 -1
+ NTP_4_2_7P398
+
+ ntpd/invoke-ntp.keys.texi@1.74 +1 -1
+ NTP_4_2_7P398
+
+ ntpd/invoke-ntpd.texi@1.390 +2 -2
+ NTP_4_2_7P398
+
+ ntpd/ntp.conf.5man@1.110 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntp.conf.5mdoc@1.110 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntp.conf.html@1.71 +1 -1
+ NTP_4_2_7P398
+
+ ntpd/ntp.conf.man.in@1.110 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntp.conf.mdoc.in@1.110 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntp.keys.5man@1.108 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntp.keys.5mdoc@1.108 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntp.keys.html@1.72 +1 -1
+ NTP_4_2_7P398
+
+ ntpd/ntp.keys.man.in@1.108 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntp.keys.mdoc.in@1.108 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntpd-opts.c@1.408 +7 -7
+ NTP_4_2_7P398
+
+ ntpd/ntpd-opts.h@1.408 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntpd.1ntpdman@1.219 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntpd.1ntpdmdoc@1.219 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntpd.html@1.66 +2 -2
+ NTP_4_2_7P398
+
+ ntpd/ntpd.man.in@1.219 +3 -3
+ NTP_4_2_7P398
+
+ ntpd/ntpd.mdoc.in@1.219 +3 -3
+ NTP_4_2_7P398
+
+ ntpdc/invoke-ntpdc.texi@1.387 +2 -2
+ NTP_4_2_7P398
+
+ ntpdc/ntpdc-opts.c@1.402 +7 -7
+ NTP_4_2_7P398
+
+ ntpdc/ntpdc-opts.h@1.402 +3 -3
+ NTP_4_2_7P398
+
+ ntpdc/ntpdc.1ntpdcman@1.218 +2 -2
+ NTP_4_2_7P398
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.218 +2 -2
+ NTP_4_2_7P398
+
+ ntpdc/ntpdc.html@1.231 +2 -2
+ NTP_4_2_7P398
+
+ ntpdc/ntpdc.man.in@1.218 +2 -2
+ NTP_4_2_7P398
+
+ ntpdc/ntpdc.mdoc.in@1.218 +2 -2
+ NTP_4_2_7P398
+
+ ntpq/invoke-ntpq.texi@1.391 +2 -2
+ NTP_4_2_7P398
+
+ ntpq/ntpq-opts.c@1.405 +7 -7
+ NTP_4_2_7P398
+
+ ntpq/ntpq-opts.h@1.405 +3 -3
+ NTP_4_2_7P398
+
+ ntpq/ntpq.1ntpqman@1.219 +2 -2
+ NTP_4_2_7P398
+
+ ntpq/ntpq.1ntpqmdoc@1.219 +2 -2
+ NTP_4_2_7P398
+
+ ntpq/ntpq.html@1.63 +2 -2
+ NTP_4_2_7P398
+
+ ntpq/ntpq.man.in@1.219 +2 -2
+ NTP_4_2_7P398
+
+ ntpq/ntpq.mdoc.in@1.219 +2 -2
+ NTP_4_2_7P398
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.390 +2 -2
+ NTP_4_2_7P398
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.405 +7 -7
+ NTP_4_2_7P398
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.405 +3 -3
+ NTP_4_2_7P398
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.219 +3 -3
+ NTP_4_2_7P398
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.219 +3 -3
+ NTP_4_2_7P398
+
+ ntpsnmpd/ntpsnmpd.html@1.61 +1 -1
+ NTP_4_2_7P398
+
+ ntpsnmpd/ntpsnmpd.man.in@1.219 +3 -3
+ NTP_4_2_7P398
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.219 +3 -3
+ NTP_4_2_7P398
+
+ packageinfo.sh@1.401 +1 -1
+ NTP_4_2_7P398
+
+ scripts/invoke-ntp-wait.texi@1.207 +1 -1
+ NTP_4_2_7P398
+
+ scripts/ntp-wait.1ntp-waitman@1.218 +3 -3
+ NTP_4_2_7P398
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.218 +3 -3
+ NTP_4_2_7P398
+
+ scripts/ntp-wait.html@1.223 +1 -1
+ NTP_4_2_7P398
+
+ scripts/ntp-wait.man.in@1.218 +3 -3
+ NTP_4_2_7P398
+
+ scripts/ntp-wait.mdoc.in@1.218 +3 -3
+ NTP_4_2_7P398
+
+ sntp/invoke-sntp.texi@1.387 +2 -2
+ NTP_4_2_7P398
+
+ sntp/sntp-opts.c@1.402 +7 -7
+ NTP_4_2_7P398
+
+ sntp/sntp-opts.h@1.402 +3 -3
+ NTP_4_2_7P398
+
+ sntp/sntp.1sntpman@1.222 +3 -3
+ NTP_4_2_7P398
+
+ sntp/sntp.1sntpmdoc@1.222 +3 -3
+ NTP_4_2_7P398
+
+ sntp/sntp.html@1.402 +2 -2
+ NTP_4_2_7P398
+
+ sntp/sntp.man.in@1.222 +3 -3
+ NTP_4_2_7P398
+
+ sntp/sntp.mdoc.in@1.222 +3 -3
+ NTP_4_2_7P398
+
+ util/invoke-ntp-keygen.texi@1.391 +2 -2
+ NTP_4_2_7P398
+
+ util/ntp-keygen-opts.c@1.405 +7 -7
+ NTP_4_2_7P398
+
+ util/ntp-keygen-opts.h@1.405 +3 -3
+ NTP_4_2_7P398
+
+ util/ntp-keygen.1ntp-keygenman@1.219 +3 -3
+ NTP_4_2_7P398
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.219 +3 -3
+ NTP_4_2_7P398
+
+ util/ntp-keygen.html@1.67 +2 -2
+ NTP_4_2_7P398
+
+ util/ntp-keygen.man.in@1.219 +3 -3
+ NTP_4_2_7P398
+
+ util/ntp-keygen.mdoc.in@1.219 +3 -3
+ NTP_4_2_7P398
+
+ChangeSet@1.3014, 2013-11-25 04:01:41-08:00, harlan@hms-mbp11.local
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ntpd/ntp_config.c@1.315 +0 -1
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ntpd/ntp_io.c@1.386 +0 -32
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ntpd/ntp_timer.c@1.78 +18 -13
+ [Bug 2326] More leapsecond file notification cleanup
+
+ChangeSet@1.3013, 2013-11-23 14:08:57-08:00, harlan@hms-mbp11.local
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ChangeLog@1.1356 +2 -0
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ntpd/ntp_io.c@1.385 +25 -8
+ [Bug 2326] More leapsecond file notification cleanup
+
+ ntpd/ntp_timer.c@1.77 +3 -2
+ [Bug 2326] More leapsecond file notification cleanup
+
+ChangeSet@1.3012, 2013-11-23 13:59:42-08:00, harlan@hms-mbp11.local
+ Emit %m value on KoD file open failure.
+
+ sntp/kod_management.c@1.32 +1 -1
+ Emit %m value on KoD file open failure.
+
+ChangeSet@1.3011, 2013-11-20 11:34:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P397
+ TAG: NTP_4_2_7P397
+
+ ChangeLog@1.1355 +1 -0
+ NTP_4_2_7P397
+
+ ntpd/invoke-ntp.conf.texi@1.75 +1 -1
+ NTP_4_2_7P397
+
+ ntpd/invoke-ntp.keys.texi@1.73 +1 -1
+ NTP_4_2_7P397
+
+ ntpd/invoke-ntpd.texi@1.389 +2 -2
+ NTP_4_2_7P397
+
+ ntpd/ntp.conf.5man@1.109 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntp.conf.5mdoc@1.109 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntp.conf.html@1.70 +1 -1
+ NTP_4_2_7P397
+
+ ntpd/ntp.conf.man.in@1.109 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntp.conf.mdoc.in@1.109 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntp.keys.5man@1.107 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntp.keys.5mdoc@1.107 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntp.keys.html@1.71 +1 -1
+ NTP_4_2_7P397
+
+ ntpd/ntp.keys.man.in@1.107 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntp.keys.mdoc.in@1.107 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntpd-opts.c@1.407 +7 -7
+ NTP_4_2_7P397
+
+ ntpd/ntpd-opts.h@1.407 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntpd.1ntpdman@1.218 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntpd.1ntpdmdoc@1.218 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntpd.html@1.65 +2 -2
+ NTP_4_2_7P397
+
+ ntpd/ntpd.man.in@1.218 +3 -3
+ NTP_4_2_7P397
+
+ ntpd/ntpd.mdoc.in@1.218 +3 -3
+ NTP_4_2_7P397
+
+ ntpdc/invoke-ntpdc.texi@1.386 +2 -2
+ NTP_4_2_7P397
+
+ ntpdc/ntpdc-opts.c@1.401 +7 -7
+ NTP_4_2_7P397
+
+ ntpdc/ntpdc-opts.h@1.401 +3 -3
+ NTP_4_2_7P397
+
+ ntpdc/ntpdc.1ntpdcman@1.217 +2 -2
+ NTP_4_2_7P397
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.217 +2 -2
+ NTP_4_2_7P397
+
+ ntpdc/ntpdc.html@1.230 +2 -2
+ NTP_4_2_7P397
+
+ ntpdc/ntpdc.man.in@1.217 +2 -2
+ NTP_4_2_7P397
+
+ ntpdc/ntpdc.mdoc.in@1.217 +2 -2
+ NTP_4_2_7P397
+
+ ntpq/invoke-ntpq.texi@1.390 +2 -2
+ NTP_4_2_7P397
+
+ ntpq/ntpq-opts.c@1.404 +7 -7
+ NTP_4_2_7P397
+
+ ntpq/ntpq-opts.h@1.404 +3 -3
+ NTP_4_2_7P397
+
+ ntpq/ntpq.1ntpqman@1.218 +2 -2
+ NTP_4_2_7P397
+
+ ntpq/ntpq.1ntpqmdoc@1.218 +2 -2
+ NTP_4_2_7P397
+
+ ntpq/ntpq.html@1.62 +2 -2
+ NTP_4_2_7P397
+
+ ntpq/ntpq.man.in@1.218 +2 -2
+ NTP_4_2_7P397
+
+ ntpq/ntpq.mdoc.in@1.218 +2 -2
+ NTP_4_2_7P397
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.389 +2 -2
+ NTP_4_2_7P397
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.404 +7 -7
+ NTP_4_2_7P397
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.404 +3 -3
+ NTP_4_2_7P397
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.218 +3 -3
+ NTP_4_2_7P397
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.218 +3 -3
+ NTP_4_2_7P397
+
+ ntpsnmpd/ntpsnmpd.html@1.60 +1 -1
+ NTP_4_2_7P397
+
+ ntpsnmpd/ntpsnmpd.man.in@1.218 +3 -3
+ NTP_4_2_7P397
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.218 +3 -3
+ NTP_4_2_7P397
+
+ packageinfo.sh@1.400 +1 -1
+ NTP_4_2_7P397
+
+ scripts/invoke-ntp-wait.texi@1.206 +1 -1
+ NTP_4_2_7P397
+
+ scripts/ntp-wait.1ntp-waitman@1.217 +3 -3
+ NTP_4_2_7P397
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.217 +3 -3
+ NTP_4_2_7P397
+
+ scripts/ntp-wait.html@1.222 +1 -1
+ NTP_4_2_7P397
+
+ scripts/ntp-wait.man.in@1.217 +3 -3
+ NTP_4_2_7P397
+
+ scripts/ntp-wait.mdoc.in@1.217 +3 -3
+ NTP_4_2_7P397
+
+ sntp/invoke-sntp.texi@1.386 +2 -2
+ NTP_4_2_7P397
+
+ sntp/sntp-opts.c@1.401 +7 -7
+ NTP_4_2_7P397
+
+ sntp/sntp-opts.h@1.401 +3 -3
+ NTP_4_2_7P397
+
+ sntp/sntp.1sntpman@1.221 +3 -3
+ NTP_4_2_7P397
+
+ sntp/sntp.1sntpmdoc@1.221 +3 -3
+ NTP_4_2_7P397
+
+ sntp/sntp.html@1.401 +2 -2
+ NTP_4_2_7P397
+
+ sntp/sntp.man.in@1.221 +3 -3
+ NTP_4_2_7P397
+
+ sntp/sntp.mdoc.in@1.221 +3 -3
+ NTP_4_2_7P397
+
+ util/invoke-ntp-keygen.texi@1.390 +2 -2
+ NTP_4_2_7P397
+
+ util/ntp-keygen-opts.c@1.404 +7 -7
+ NTP_4_2_7P397
+
+ util/ntp-keygen-opts.h@1.404 +3 -3
+ NTP_4_2_7P397
+
+ util/ntp-keygen.1ntp-keygenman@1.218 +3 -3
+ NTP_4_2_7P397
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.218 +3 -3
+ NTP_4_2_7P397
+
+ util/ntp-keygen.html@1.66 +2 -2
+ NTP_4_2_7P397
+
+ util/ntp-keygen.man.in@1.218 +3 -3
+ NTP_4_2_7P397
+
+ util/ntp-keygen.mdoc.in@1.218 +3 -3
+ NTP_4_2_7P397
+
+ChangeSet@1.3010, 2013-11-20 03:56:38-05:00, stenn@deacon.udel.edu
+ [Bug 2326] Improve stale leapsecond notifications
+
+ ChangeLog@1.1354 +1 -0
+ [Bug 2326] Improve stale leapsecond notifications
+
+ ntpd/ntp_io.c@1.384 +7 -1
+ [Bug 2326] Improve stale leapsecond notifications
+
+ ntpd/ntp_timer.c@1.76 +2 -3
+ [Bug 2326] Improve stale leapsecond notifications
+
+ChangeSet@1.3009, 2013-11-19 11:37:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P396
+ TAG: NTP_4_2_7P396
+
+ ChangeLog@1.1353 +1 -0
+ NTP_4_2_7P396
+
+ ntpd/invoke-ntp.conf.texi@1.74 +1 -1
+ NTP_4_2_7P396
+
+ ntpd/invoke-ntp.keys.texi@1.72 +1 -1
+ NTP_4_2_7P396
+
+ ntpd/invoke-ntpd.texi@1.388 +2 -2
+ NTP_4_2_7P396
+
+ ntpd/ntp.conf.5man@1.108 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntp.conf.5mdoc@1.108 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntp.conf.html@1.69 +1 -1
+ NTP_4_2_7P396
+
+ ntpd/ntp.conf.man.in@1.108 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntp.conf.mdoc.in@1.108 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntp.keys.5man@1.106 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntp.keys.5mdoc@1.106 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntp.keys.html@1.70 +1 -1
+ NTP_4_2_7P396
+
+ ntpd/ntp.keys.man.in@1.106 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntp.keys.mdoc.in@1.106 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntpd-opts.c@1.406 +7 -7
+ NTP_4_2_7P396
+
+ ntpd/ntpd-opts.h@1.406 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntpd.1ntpdman@1.217 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntpd.1ntpdmdoc@1.217 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntpd.html@1.64 +18 -18
+ NTP_4_2_7P396
+
+ ntpd/ntpd.man.in@1.217 +3 -3
+ NTP_4_2_7P396
+
+ ntpd/ntpd.mdoc.in@1.217 +3 -3
+ NTP_4_2_7P396
+
+ ntpdc/invoke-ntpdc.texi@1.385 +2 -2
+ NTP_4_2_7P396
+
+ ntpdc/ntpdc-opts.c@1.400 +7 -7
+ NTP_4_2_7P396
+
+ ntpdc/ntpdc-opts.h@1.400 +3 -3
+ NTP_4_2_7P396
+
+ ntpdc/ntpdc.1ntpdcman@1.216 +2 -2
+ NTP_4_2_7P396
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.216 +2 -2
+ NTP_4_2_7P396
+
+ ntpdc/ntpdc.html@1.229 +2 -2
+ NTP_4_2_7P396
+
+ ntpdc/ntpdc.man.in@1.216 +2 -2
+ NTP_4_2_7P396
+
+ ntpdc/ntpdc.mdoc.in@1.216 +2 -2
+ NTP_4_2_7P396
+
+ ntpq/invoke-ntpq.texi@1.389 +2 -2
+ NTP_4_2_7P396
+
+ ntpq/ntpq-opts.c@1.403 +7 -7
+ NTP_4_2_7P396
+
+ ntpq/ntpq-opts.h@1.403 +3 -3
+ NTP_4_2_7P396
+
+ ntpq/ntpq.1ntpqman@1.217 +2 -2
+ NTP_4_2_7P396
+
+ ntpq/ntpq.1ntpqmdoc@1.217 +2 -2
+ NTP_4_2_7P396
+
+ ntpq/ntpq.html@1.61 +3 -3
+ NTP_4_2_7P396
+
+ ntpq/ntpq.man.in@1.217 +2 -2
+ NTP_4_2_7P396
+
+ ntpq/ntpq.mdoc.in@1.217 +2 -2
+ NTP_4_2_7P396
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.388 +2 -2
+ NTP_4_2_7P396
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.403 +7 -7
+ NTP_4_2_7P396
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.403 +3 -3
+ NTP_4_2_7P396
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.217 +3 -3
+ NTP_4_2_7P396
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.217 +3 -3
+ NTP_4_2_7P396
+
+ ntpsnmpd/ntpsnmpd.html@1.59 +1 -1
+ NTP_4_2_7P396
+
+ ntpsnmpd/ntpsnmpd.man.in@1.217 +3 -3
+ NTP_4_2_7P396
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.217 +3 -3
+ NTP_4_2_7P396
+
+ packageinfo.sh@1.399 +1 -1
+ NTP_4_2_7P396
+
+ scripts/invoke-ntp-wait.texi@1.205 +1 -1
+ NTP_4_2_7P396
+
+ scripts/ntp-wait.1ntp-waitman@1.216 +3 -3
+ NTP_4_2_7P396
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.216 +3 -3
+ NTP_4_2_7P396
+
+ scripts/ntp-wait.html@1.221 +1 -1
+ NTP_4_2_7P396
+
+ scripts/ntp-wait.man.in@1.216 +3 -3
+ NTP_4_2_7P396
+
+ scripts/ntp-wait.mdoc.in@1.216 +3 -3
+ NTP_4_2_7P396
+
+ sntp/invoke-sntp.texi@1.385 +2 -2
+ NTP_4_2_7P396
+
+ sntp/sntp-opts.c@1.400 +7 -7
+ NTP_4_2_7P396
+
+ sntp/sntp-opts.h@1.400 +3 -3
+ NTP_4_2_7P396
+
+ sntp/sntp.1sntpman@1.220 +3 -3
+ NTP_4_2_7P396
+
+ sntp/sntp.1sntpmdoc@1.220 +3 -3
+ NTP_4_2_7P396
+
+ sntp/sntp.html@1.400 +2 -2
+ NTP_4_2_7P396
+
+ sntp/sntp.man.in@1.220 +3 -3
+ NTP_4_2_7P396
+
+ sntp/sntp.mdoc.in@1.220 +3 -3
+ NTP_4_2_7P396
+
+ util/invoke-ntp-keygen.texi@1.389 +2 -2
+ NTP_4_2_7P396
+
+ util/ntp-keygen-opts.c@1.403 +7 -7
+ NTP_4_2_7P396
+
+ util/ntp-keygen-opts.h@1.403 +3 -3
+ NTP_4_2_7P396
+
+ util/ntp-keygen.1ntp-keygenman@1.217 +3 -3
+ NTP_4_2_7P396
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.217 +3 -3
+ NTP_4_2_7P396
+
+ util/ntp-keygen.html@1.65 +14 -14
+ NTP_4_2_7P396
+
+ util/ntp-keygen.man.in@1.217 +3 -3
+ NTP_4_2_7P396
+
+ util/ntp-keygen.mdoc.in@1.217 +3 -3
+ NTP_4_2_7P396
+
+ChangeSet@1.3005.1.1, 2013-11-18 20:55:37+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ ntp_io.c:
+ [Bug 2506] make sure routing updates are always tracked
+ the 'flapping fix' from 2010-12-12 was and is incorrect
+ as routes can change without change of interface
+ configuration.
+
+ ChangeLog@1.1351.1.1 +1 -0
+ [Bug 2506] make sure routing updates are always tracked
+ the 'flapping fix' from 2010-12-12 was and is incorrect
+ as routes can change without change of interface
+ configuration.
+
+ ntpd/ntp_io.c@1.382.1.1 +14 -24
+
+ChangeSet@1.3008, 2013-11-17 14:38:45+01:00, jnperlin@hydra.(none)
+ [Bug 2326] sidekick: C99 type cleanup
+
+ tests/ntpd/leapsec.cpp@1.4 +4 -4
+ [Bug 2326] sidekick: C99 type cleanup
+
+ChangeSet@1.3007, 2013-11-17 14:36:40+01:00, jnperlin@hydra.(none)
+ [bug 2326] use time-to-live of leap second table for better diagnostics
+
+ ntpd/ntp_leapsec.c@1.4 +101 -56
+ [bug 2326] add support for calculation of remaining time-to-live of table data
+
+ ntpd/ntp_leapsec.h@1.3 +22 -22
+ [bug 2326] add support for calculation of remaining time-to-live of table data
+
+ ntpd/ntp_util.c@1.106 +24 -22
+ [Bug 2326] plumbing to TTL calculation for leap second data
+
+ tests/ntpd/leapsec.cpp@1.3 +28 -1
+ [Bug 2326] add tests for TTL calculation of table data
+
+ChangeSet@1.3006, 2013-11-17 09:03:39+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2326] Improve stale leapsecond notifications
+
+ ChangeLog@1.1352 +1 -0
+ [Bug 2326] Improve stale leapsecond notifications
+
+ include/ntpd.h@1.181 +1 -1
+ [Bug 2326] Improve stale leapsecond notifications
+
+ ntpd/ntp_io.c@1.383 +1 -1
+ [Bug 2326] Improve stale leapsecond notifications
+
+ ntpd/ntp_timer.c@1.75 +19 -11
+ [Bug 2326] Improve stale leapsecond notifications
+
+ ntpd/ntp_util.c@1.105 +15 -4
+ [Bug 2326] Improve stale leapsecond notifications
+
+ChangeSet@1.3005, 2013-11-12 11:30:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P395
+ TAG: NTP_4_2_7P395
+
+ ChangeLog@1.1351 +1 -0
+ NTP_4_2_7P395
+
+ ntpd/invoke-ntp.conf.texi@1.73 +1 -1
+ NTP_4_2_7P395
+
+ ntpd/invoke-ntp.keys.texi@1.71 +1 -1
+ NTP_4_2_7P395
+
+ ntpd/invoke-ntpd.texi@1.387 +18 -18
+ NTP_4_2_7P395
+
+ ntpd/ntp.conf.5man@1.107 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntp.conf.5mdoc@1.107 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntp.conf.html@1.68 +1 -1
+ NTP_4_2_7P395
+
+ ntpd/ntp.conf.man.in@1.107 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntp.conf.mdoc.in@1.107 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntp.keys.5man@1.105 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntp.keys.5mdoc@1.105 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntp.keys.html@1.69 +1 -1
+ NTP_4_2_7P395
+
+ ntpd/ntp.keys.man.in@1.105 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntp.keys.mdoc.in@1.105 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntpd-opts.c@1.405 +10 -9
+ NTP_4_2_7P395
+
+ ntpd/ntpd-opts.h@1.405 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntpd.1ntpdman@1.216 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntpd.1ntpdmdoc@1.216 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntpd.html@1.63 +2 -2
+ NTP_4_2_7P395
+
+ ntpd/ntpd.man.in@1.216 +3 -3
+ NTP_4_2_7P395
+
+ ntpd/ntpd.mdoc.in@1.216 +3 -3
+ NTP_4_2_7P395
+
+ ntpdc/invoke-ntpdc.texi@1.384 +3 -3
+ NTP_4_2_7P395
+
+ ntpdc/ntpdc-opts.c@1.399 +10 -9
+ NTP_4_2_7P395
+
+ ntpdc/ntpdc-opts.h@1.399 +3 -3
+ NTP_4_2_7P395
+
+ ntpdc/ntpdc.1ntpdcman@1.215 +2 -2
+ NTP_4_2_7P395
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.215 +2 -2
+ NTP_4_2_7P395
+
+ ntpdc/ntpdc.html@1.228 +3 -3
+ NTP_4_2_7P395
+
+ ntpdc/ntpdc.man.in@1.215 +2 -2
+ NTP_4_2_7P395
+
+ ntpdc/ntpdc.mdoc.in@1.215 +2 -2
+ NTP_4_2_7P395
+
+ ntpq/invoke-ntpq.texi@1.388 +3 -3
+ NTP_4_2_7P395
+
+ ntpq/ntpq-opts.c@1.402 +10 -9
+ NTP_4_2_7P395
+
+ ntpq/ntpq-opts.h@1.402 +3 -3
+ NTP_4_2_7P395
+
+ ntpq/ntpq.1ntpqman@1.216 +2 -2
+ NTP_4_2_7P395
+
+ ntpq/ntpq.1ntpqmdoc@1.216 +2 -2
+ NTP_4_2_7P395
+
+ ntpq/ntpq.html@1.60 +2 -2
+ NTP_4_2_7P395
+
+ ntpq/ntpq.man.in@1.216 +2 -2
+ NTP_4_2_7P395
+
+ ntpq/ntpq.mdoc.in@1.216 +2 -2
+ NTP_4_2_7P395
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.387 +3 -3
+ NTP_4_2_7P395
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.402 +10 -9
+ NTP_4_2_7P395
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.402 +3 -3
+ NTP_4_2_7P395
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.216 +3 -3
+ NTP_4_2_7P395
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.216 +3 -3
+ NTP_4_2_7P395
+
+ ntpsnmpd/ntpsnmpd.html@1.58 +1 -1
+ NTP_4_2_7P395
+
+ ntpsnmpd/ntpsnmpd.man.in@1.216 +3 -3
+ NTP_4_2_7P395
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.216 +3 -3
+ NTP_4_2_7P395
+
+ packageinfo.sh@1.398 +1 -1
+ NTP_4_2_7P395
+
+ scripts/invoke-ntp-wait.texi@1.204 +3 -3
+ NTP_4_2_7P395
+
+ scripts/ntp-wait.1ntp-waitman@1.215 +3 -3
+ NTP_4_2_7P395
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.215 +3 -3
+ NTP_4_2_7P395
+
+ scripts/ntp-wait.html@1.220 +3 -3
+ NTP_4_2_7P395
+
+ scripts/ntp-wait.man.in@1.215 +3 -3
+ NTP_4_2_7P395
+
+ scripts/ntp-wait.mdoc.in@1.215 +3 -3
+ NTP_4_2_7P395
+
+ sntp/invoke-sntp.texi@1.384 +15 -13
+ NTP_4_2_7P395
+
+ sntp/sntp-opts.c@1.399 +10 -9
+ NTP_4_2_7P395
+
+ sntp/sntp-opts.h@1.399 +3 -3
+ NTP_4_2_7P395
+
+ sntp/sntp.1sntpman@1.219 +3 -3
+ NTP_4_2_7P395
+
+ sntp/sntp.1sntpmdoc@1.219 +3 -3
+ NTP_4_2_7P395
+
+ sntp/sntp.html@1.399 +14 -13
+ NTP_4_2_7P395
+
+ sntp/sntp.man.in@1.219 +3 -3
+ NTP_4_2_7P395
+
+ sntp/sntp.mdoc.in@1.219 +3 -3
+ NTP_4_2_7P395
+
+ util/invoke-ntp-keygen.texi@1.388 +14 -14
+ NTP_4_2_7P395
+
+ util/ntp-keygen-opts.c@1.402 +10 -9
+ NTP_4_2_7P395
+
+ util/ntp-keygen-opts.h@1.402 +3 -3
+ NTP_4_2_7P395
+
+ util/ntp-keygen.1ntp-keygenman@1.216 +3 -3
+ NTP_4_2_7P395
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.216 +3 -3
+ NTP_4_2_7P395
+
+ util/ntp-keygen.html@1.64 +2 -2
+ NTP_4_2_7P395
+
+ util/ntp-keygen.man.in@1.216 +3 -3
+ NTP_4_2_7P395
+
+ util/ntp-keygen.mdoc.in@1.216 +3 -3
+ NTP_4_2_7P395
+
+ChangeSet@1.3004, 2013-11-12 08:16:16+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ ChangeLog@1.1350 +1 -0
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/include/autogen-version.def@1.19 +2 -2
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/Makefile.am@1.23 +4 -4
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/ag-char-map.h@1.26 +2 -3
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/ao-strs.c@1.12 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/ao-strs.h@1.11 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/autoopts/options.h@1.25 +51 -51
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/autoopts/usage-txt.h@1.25 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/compat/compat.h@1.14 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/genshell.c@1.26 +49 -48
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/genshell.h@1.26 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/m4/libopts.m4@1.29 +1 -2
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/option-value-type.c@1.13 +2 -2
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/option-value-type.h@1.27 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/option-xat-attribute.c@1.13 +2 -2
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/option-xat-attribute.h@1.27 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ sntp/libopts/proto.h@1.26 +1 -1
+ Upgrade to autogen-5.18.3pre5 and libopts-40.1.15
+
+ChangeSet@1.3003, 2013-11-05 11:37:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P394
+ TAG: NTP_4_2_7P394
+
+ ChangeLog@1.1349 +1 -0
+ NTP_4_2_7P394
+
+ ntpd/invoke-ntp.conf.texi@1.72 +1 -1
+ NTP_4_2_7P394
+
+ ntpd/invoke-ntp.keys.texi@1.70 +1 -1
+ NTP_4_2_7P394
+
+ ntpd/invoke-ntpd.texi@1.386 +2 -2
+ NTP_4_2_7P394
+
+ ntpd/ntp.conf.5man@1.106 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntp.conf.5mdoc@1.106 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntp.conf.html@1.67 +1 -1
+ NTP_4_2_7P394
+
+ ntpd/ntp.conf.man.in@1.106 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntp.conf.mdoc.in@1.106 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntp.keys.5man@1.104 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntp.keys.5mdoc@1.104 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntp.keys.html@1.68 +1 -1
+ NTP_4_2_7P394
+
+ ntpd/ntp.keys.man.in@1.104 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntp.keys.mdoc.in@1.104 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntpd-opts.c@1.404 +7 -7
+ NTP_4_2_7P394
+
+ ntpd/ntpd-opts.h@1.404 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntpd.1ntpdman@1.215 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntpd.1ntpdmdoc@1.215 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntpd.html@1.62 +2 -2
+ NTP_4_2_7P394
+
+ ntpd/ntpd.man.in@1.215 +3 -3
+ NTP_4_2_7P394
+
+ ntpd/ntpd.mdoc.in@1.215 +3 -3
+ NTP_4_2_7P394
+
+ ntpdc/invoke-ntpdc.texi@1.383 +2 -2
+ NTP_4_2_7P394
+
+ ntpdc/ntpdc-opts.c@1.398 +7 -7
+ NTP_4_2_7P394
+
+ ntpdc/ntpdc-opts.h@1.398 +3 -3
+ NTP_4_2_7P394
+
+ ntpdc/ntpdc.1ntpdcman@1.214 +2 -2
+ NTP_4_2_7P394
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.214 +2 -2
+ NTP_4_2_7P394
+
+ ntpdc/ntpdc.html@1.227 +2 -2
+ NTP_4_2_7P394
+
+ ntpdc/ntpdc.man.in@1.214 +2 -2
+ NTP_4_2_7P394
+
+ ntpdc/ntpdc.mdoc.in@1.214 +2 -2
+ NTP_4_2_7P394
+
+ ntpq/invoke-ntpq.texi@1.387 +2 -2
+ NTP_4_2_7P394
+
+ ntpq/ntpq-opts.c@1.401 +7 -7
+ NTP_4_2_7P394
+
+ ntpq/ntpq-opts.h@1.401 +3 -3
+ NTP_4_2_7P394
+
+ ntpq/ntpq.1ntpqman@1.215 +2 -2
+ NTP_4_2_7P394
+
+ ntpq/ntpq.1ntpqmdoc@1.215 +2 -2
+ NTP_4_2_7P394
+
+ ntpq/ntpq.html@1.59 +2 -2
+ NTP_4_2_7P394
+
+ ntpq/ntpq.man.in@1.215 +2 -2
+ NTP_4_2_7P394
+
+ ntpq/ntpq.mdoc.in@1.215 +2 -2
+ NTP_4_2_7P394
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.386 +2 -2
+ NTP_4_2_7P394
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.401 +7 -7
+ NTP_4_2_7P394
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.401 +3 -3
+ NTP_4_2_7P394
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.215 +3 -3
+ NTP_4_2_7P394
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.215 +3 -3
+ NTP_4_2_7P394
+
+ ntpsnmpd/ntpsnmpd.html@1.57 +1 -1
+ NTP_4_2_7P394
+
+ ntpsnmpd/ntpsnmpd.man.in@1.215 +3 -3
+ NTP_4_2_7P394
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.215 +3 -3
+ NTP_4_2_7P394
+
+ packageinfo.sh@1.397 +1 -1
+ NTP_4_2_7P394
+
+ scripts/invoke-ntp-wait.texi@1.203 +14 -2
+ NTP_4_2_7P394
+
+ scripts/ntp-wait.1ntp-waitman@1.214 +3 -3
+ NTP_4_2_7P394
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.214 +3 -3
+ NTP_4_2_7P394
+
+ scripts/ntp-wait.html@1.219 +14 -2
+ NTP_4_2_7P394
+
+ scripts/ntp-wait.man.in@1.214 +3 -3
+ NTP_4_2_7P394
+
+ scripts/ntp-wait.mdoc.in@1.214 +3 -3
+ NTP_4_2_7P394
+
+ sntp/invoke-sntp.texi@1.383 +2 -2
+ NTP_4_2_7P394
+
+ sntp/sntp-opts.c@1.398 +7 -7
+ NTP_4_2_7P394
+
+ sntp/sntp-opts.h@1.398 +3 -3
+ NTP_4_2_7P394
+
+ sntp/sntp.1sntpman@1.218 +3 -3
+ NTP_4_2_7P394
+
+ sntp/sntp.1sntpmdoc@1.218 +3 -3
+ NTP_4_2_7P394
+
+ sntp/sntp.html@1.398 +2 -2
+ NTP_4_2_7P394
+
+ sntp/sntp.man.in@1.218 +3 -3
+ NTP_4_2_7P394
+
+ sntp/sntp.mdoc.in@1.218 +3 -3
+ NTP_4_2_7P394
+
+ util/invoke-ntp-keygen.texi@1.387 +2 -2
+ NTP_4_2_7P394
+
+ util/ntp-keygen-opts.c@1.401 +7 -7
+ NTP_4_2_7P394
+
+ util/ntp-keygen-opts.h@1.401 +3 -3
+ NTP_4_2_7P394
+
+ util/ntp-keygen.1ntp-keygenman@1.215 +3 -3
+ NTP_4_2_7P394
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.215 +3 -3
+ NTP_4_2_7P394
+
+ util/ntp-keygen.html@1.63 +2 -2
+ NTP_4_2_7P394
+
+ util/ntp-keygen.man.in@1.215 +3 -3
+ NTP_4_2_7P394
+
+ util/ntp-keygen.mdoc.in@1.215 +3 -3
+ NTP_4_2_7P394
+
+ChangeSet@1.2996.4.1, 2013-11-02 16:14:35+01:00, jnperlin@nemesis.localnet
+ [Bug 2499] Win32 user-space/loopback ppsapi provider drops samples.
+
+ ChangeLog@1.1346.2.1 +1 -0
+ [Bug 2499] Win32 user-space/loopback ppsapi provider drops samples.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.70 +29 -29
+ [Bug 2499] Win32 user-space/loopback ppsapi provider drops samples.
+ Caused by FIFO buffer access logic.
+
+ChangeSet@1.2996.3.1, 2013-11-01 10:37:27+01:00, jnperlin@nemesis.localnet
+ [Bug 2272] (update) Use C99 integer types.
+
+ include/ntp_calendar.h@1.13 +76 -76
+ [Bug 2272] (update) Use C99 integer types. Consequently, not for just u_char.
+
+ libntp/caljulian.c@1.15 +1 -1
+ [Bug 2272] (update) Use C99 integer types.
+
+ libntp/caltontp.c@1.6 +3 -3
+ [Bug 2272] (update) Use C99 integer types.
+
+ libntp/ntp_calendar.c@1.11 +157 -155
+ [Bug 2272] (update) Use C99 integer types. Consequently, not for just u_char.
+
+ ports/winnt/include/config.h@1.105 +0 -5
+ [Bug 2272] (update) Use C99 integer types.
+ Avoid including stdint/stdtypes from inside the config header.
+
+ ports/winnt/include/stdint.h@1.1 +244 -0
+ [Bug 2272] (update) Use C99 integer types.
+ Provide a C99 compatible <stdint.h> for local use if the compiler comes without one.
+
+ ports/winnt/include/stdint.h@1.0 +0 -0
+
+ChangeSet@1.3001, 2013-10-28 08:17:56+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2256] Improve configure's function searches in libraries
+
+ configure.ac@1.567 +1 -1
+ [Bug 2256] Improve configure's function searches in libraries
+
+ sntp/configure.ac@1.76 +3 -1
+ [Bug 2256] Improve configure's function searches in libraries
+
+ sntp/m4/ntp_ipv6.m4@1.8 +4 -0
+ [Bug 2256] Improve configure's function searches in libraries
+
+ChangeSet@1.3000, 2013-10-26 09:04:23+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2256] Improve configure's function searches in libraries
+
+ configure.ac@1.566 +6 -12
+ [Bug 2256] Improve configure's function searches in libraries
+
+ChangeSet@1.2996.1.7, 2013-10-25 18:32:28+02:00, jnperlin@hydra.(none)
+ [Bug 1050] Change ONCORE log message for leap second announcement to avoid misunderstandings.
+
+ ChangeLog@1.1346.1.1 +2 -0
+ [Bug 1050] Change ONCORE log message for leap second announcement to avoid misunderstandings.
+
+ ntpd/refclock_oncore.c@1.99 +21 -4
+ [Bug 1050] Change ONCORE log message for leap second announcement to avoid misunderstandings.
+
+ChangeSet@1.2998, 2013-10-17 07:15:02+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2256] Improve configure's function searches in libraries
+
+ ChangeLog@1.1341.1.1 +1 -0
+ [Bug 2256] Improve configure's function searches in libraries
+
+ sntp/configure.ac@1.75 +2 -0
+ [Bug 2256] Improve configure's function searches in libraries
+
+ sntp/m4/hms_search_lib.m4@1.1 +30 -0
+ BitKeeper file /home/stenn/ntp-dev-2256/sntp/m4/hms_search_lib.m4
+
+ sntp/m4/hms_search_lib.m4@1.0 +0 -0
+
+ sntp/m4/ntp_libntp.m4@1.20.1.1 +9 -5
+ [Bug 2256] Improve configure's function searches in libraries
+
+ChangeSet@1.2996.1.6, 2013-10-16 11:37:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P393
+ TAG: NTP_4_2_7P393
+
+ ChangeLog@1.1346 +1 -0
+ NTP_4_2_7P393
+
+ ntpd/invoke-ntp.conf.texi@1.71 +1 -1
+ NTP_4_2_7P393
+
+ ntpd/invoke-ntp.keys.texi@1.69 +1 -1
+ NTP_4_2_7P393
+
+ ntpd/invoke-ntpd.texi@1.385 +2 -2
+ NTP_4_2_7P393
+
+ ntpd/ntp.conf.5man@1.105 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntp.conf.5mdoc@1.105 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntp.conf.html@1.66 +1 -1
+ NTP_4_2_7P393
+
+ ntpd/ntp.conf.man.in@1.105 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntp.conf.mdoc.in@1.105 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntp.keys.5man@1.103 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntp.keys.5mdoc@1.103 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntp.keys.html@1.67 +1 -1
+ NTP_4_2_7P393
+
+ ntpd/ntp.keys.man.in@1.103 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntp.keys.mdoc.in@1.103 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntpd-opts.c@1.403 +7 -7
+ NTP_4_2_7P393
+
+ ntpd/ntpd-opts.h@1.403 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntpd.1ntpdman@1.214 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntpd.1ntpdmdoc@1.214 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntpd.html@1.61 +2 -2
+ NTP_4_2_7P393
+
+ ntpd/ntpd.man.in@1.214 +3 -3
+ NTP_4_2_7P393
+
+ ntpd/ntpd.mdoc.in@1.214 +3 -3
+ NTP_4_2_7P393
+
+ ntpdc/invoke-ntpdc.texi@1.382 +2 -2
+ NTP_4_2_7P393
+
+ ntpdc/ntpdc-opts.c@1.397 +7 -7
+ NTP_4_2_7P393
+
+ ntpdc/ntpdc-opts.h@1.397 +3 -3
+ NTP_4_2_7P393
+
+ ntpdc/ntpdc.1ntpdcman@1.213 +2 -2
+ NTP_4_2_7P393
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.213 +2 -2
+ NTP_4_2_7P393
+
+ ntpdc/ntpdc.html@1.226 +2 -2
+ NTP_4_2_7P393
+
+ ntpdc/ntpdc.man.in@1.213 +2 -2
+ NTP_4_2_7P393
+
+ ntpdc/ntpdc.mdoc.in@1.213 +2 -2
+ NTP_4_2_7P393
+
+ ntpq/invoke-ntpq.texi@1.386 +2 -2
+ NTP_4_2_7P393
+
+ ntpq/ntpq-opts.c@1.400 +7 -7
+ NTP_4_2_7P393
+
+ ntpq/ntpq-opts.h@1.400 +3 -3
+ NTP_4_2_7P393
+
+ ntpq/ntpq.1ntpqman@1.214 +2 -2
+ NTP_4_2_7P393
+
+ ntpq/ntpq.1ntpqmdoc@1.214 +2 -2
+ NTP_4_2_7P393
+
+ ntpq/ntpq.html@1.58 +2 -2
+ NTP_4_2_7P393
+
+ ntpq/ntpq.man.in@1.214 +2 -2
+ NTP_4_2_7P393
+
+ ntpq/ntpq.mdoc.in@1.214 +2 -2
+ NTP_4_2_7P393
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.385 +2 -2
+ NTP_4_2_7P393
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.400 +7 -7
+ NTP_4_2_7P393
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.400 +3 -3
+ NTP_4_2_7P393
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.214 +3 -3
+ NTP_4_2_7P393
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.214 +3 -3
+ NTP_4_2_7P393
+
+ ntpsnmpd/ntpsnmpd.html@1.56 +1 -1
+ NTP_4_2_7P393
+
+ ntpsnmpd/ntpsnmpd.man.in@1.214 +3 -3
+ NTP_4_2_7P393
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.214 +3 -3
+ NTP_4_2_7P393
+
+ packageinfo.sh@1.396 +1 -1
+ NTP_4_2_7P393
+
+ scripts/invoke-ntp-wait.texi@1.202 +1 -1
+ NTP_4_2_7P393
+
+ scripts/ntp-wait.1ntp-waitman@1.213 +3 -3
+ NTP_4_2_7P393
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.213 +3 -3
+ NTP_4_2_7P393
+
+ scripts/ntp-wait.html@1.218 +1 -1
+ NTP_4_2_7P393
+
+ scripts/ntp-wait.man.in@1.213 +3 -3
+ NTP_4_2_7P393
+
+ scripts/ntp-wait.mdoc.in@1.213 +3 -3
+ NTP_4_2_7P393
+
+ sntp/invoke-sntp.texi@1.382 +2 -2
+ NTP_4_2_7P393
+
+ sntp/sntp-opts.c@1.397 +7 -7
+ NTP_4_2_7P393
+
+ sntp/sntp-opts.h@1.397 +3 -3
+ NTP_4_2_7P393
+
+ sntp/sntp.1sntpman@1.217 +3 -3
+ NTP_4_2_7P393
+
+ sntp/sntp.1sntpmdoc@1.217 +3 -3
+ NTP_4_2_7P393
+
+ sntp/sntp.html@1.397 +2 -2
+ NTP_4_2_7P393
+
+ sntp/sntp.man.in@1.217 +3 -3
+ NTP_4_2_7P393
+
+ sntp/sntp.mdoc.in@1.217 +3 -3
+ NTP_4_2_7P393
+
+ util/invoke-ntp-keygen.texi@1.386 +2 -2
+ NTP_4_2_7P393
+
+ util/ntp-keygen-opts.c@1.400 +7 -7
+ NTP_4_2_7P393
+
+ util/ntp-keygen-opts.h@1.400 +3 -3
+ NTP_4_2_7P393
+
+ util/ntp-keygen.1ntp-keygenman@1.214 +3 -3
+ NTP_4_2_7P393
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.214 +3 -3
+ NTP_4_2_7P393
+
+ util/ntp-keygen.html@1.62 +2 -2
+ NTP_4_2_7P393
+
+ util/ntp-keygen.man.in@1.214 +3 -3
+ NTP_4_2_7P393
+
+ util/ntp-keygen.mdoc.in@1.214 +3 -3
+ NTP_4_2_7P393
+
+ChangeSet@1.2996.1.5, 2013-10-16 08:45:10+00:00, stenn@hikaru.il.thewrittenword.com
+ [Bug 2272] Use c99 integer types: ntp_calendar.h, ntp_types.h
+
+ ChangeLog@1.1345 +1 -0
+ [Bug 2272] Use c99 integer types: ntp_calendar.h, ntp_types.h
+
+ include/ntp_calendar.h@1.12 +14 -14
+ [Bug 2272] Use c99 integer types: ntp_calendar.h, ntp_types.h
+
+ include/ntp_types.h@1.33 +13 -8
+ [Bug 2272] Use c99 integer types: ntp_calendar.h, ntp_types.h
+
+ChangeSet@1.2996.1.4, 2013-10-15 11:35:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P392
+ TAG: NTP_4_2_7P392
+
+ ChangeLog@1.1344 +1 -0
+ NTP_4_2_7P392
+
+ ntpd/invoke-ntp.conf.texi@1.70 +1 -1
+ NTP_4_2_7P392
+
+ ntpd/invoke-ntp.keys.texi@1.68 +1 -1
+ NTP_4_2_7P392
+
+ ntpd/invoke-ntpd.texi@1.384 +2 -2
+ NTP_4_2_7P392
+
+ ntpd/ntp.conf.5man@1.104 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntp.conf.5mdoc@1.104 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntp.conf.html@1.65 +1 -1
+ NTP_4_2_7P392
+
+ ntpd/ntp.conf.man.in@1.104 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntp.conf.mdoc.in@1.104 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntp.keys.5man@1.102 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntp.keys.5mdoc@1.102 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntp.keys.html@1.66 +1 -1
+ NTP_4_2_7P392
+
+ ntpd/ntp.keys.man.in@1.102 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntp.keys.mdoc.in@1.102 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntpd-opts.c@1.402 +7 -7
+ NTP_4_2_7P392
+
+ ntpd/ntpd-opts.h@1.402 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntpd.1ntpdman@1.213 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntpd.1ntpdmdoc@1.213 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntpd.html@1.60 +2 -2
+ NTP_4_2_7P392
+
+ ntpd/ntpd.man.in@1.213 +3 -3
+ NTP_4_2_7P392
+
+ ntpd/ntpd.mdoc.in@1.213 +3 -3
+ NTP_4_2_7P392
+
+ ntpdc/invoke-ntpdc.texi@1.381 +2 -2
+ NTP_4_2_7P392
+
+ ntpdc/ntpdc-opts.c@1.396 +7 -7
+ NTP_4_2_7P392
+
+ ntpdc/ntpdc-opts.h@1.396 +3 -3
+ NTP_4_2_7P392
+
+ ntpdc/ntpdc.1ntpdcman@1.212 +2 -2
+ NTP_4_2_7P392
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.212 +2 -2
+ NTP_4_2_7P392
+
+ ntpdc/ntpdc.html@1.225 +2 -2
+ NTP_4_2_7P392
+
+ ntpdc/ntpdc.man.in@1.212 +2 -2
+ NTP_4_2_7P392
+
+ ntpdc/ntpdc.mdoc.in@1.212 +2 -2
+ NTP_4_2_7P392
+
+ ntpq/invoke-ntpq.texi@1.385 +2 -2
+ NTP_4_2_7P392
+
+ ntpq/ntpq-opts.c@1.399 +7 -7
+ NTP_4_2_7P392
+
+ ntpq/ntpq-opts.h@1.399 +3 -3
+ NTP_4_2_7P392
+
+ ntpq/ntpq.1ntpqman@1.213 +2 -2
+ NTP_4_2_7P392
+
+ ntpq/ntpq.1ntpqmdoc@1.213 +2 -2
+ NTP_4_2_7P392
+
+ ntpq/ntpq.html@1.57 +2 -2
+ NTP_4_2_7P392
+
+ ntpq/ntpq.man.in@1.213 +2 -2
+ NTP_4_2_7P392
+
+ ntpq/ntpq.mdoc.in@1.213 +2 -2
+ NTP_4_2_7P392
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.384 +2 -2
+ NTP_4_2_7P392
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.399 +7 -7
+ NTP_4_2_7P392
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.399 +3 -3
+ NTP_4_2_7P392
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.213 +3 -3
+ NTP_4_2_7P392
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.213 +3 -3
+ NTP_4_2_7P392
+
+ ntpsnmpd/ntpsnmpd.html@1.55 +1 -1
+ NTP_4_2_7P392
+
+ ntpsnmpd/ntpsnmpd.man.in@1.213 +3 -3
+ NTP_4_2_7P392
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.213 +3 -3
+ NTP_4_2_7P392
+
+ packageinfo.sh@1.395 +1 -1
+ NTP_4_2_7P392
+
+ scripts/invoke-ntp-wait.texi@1.201 +1 -1
+ NTP_4_2_7P392
+
+ scripts/ntp-wait.1ntp-waitman@1.212 +3 -3
+ NTP_4_2_7P392
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.212 +3 -3
+ NTP_4_2_7P392
+
+ scripts/ntp-wait.html@1.217 +1 -1
+ NTP_4_2_7P392
+
+ scripts/ntp-wait.man.in@1.212 +3 -3
+ NTP_4_2_7P392
+
+ scripts/ntp-wait.mdoc.in@1.212 +3 -3
+ NTP_4_2_7P392
+
+ sntp/invoke-sntp.texi@1.381 +2 -2
+ NTP_4_2_7P392
+
+ sntp/sntp-opts.c@1.396 +7 -7
+ NTP_4_2_7P392
+
+ sntp/sntp-opts.h@1.396 +3 -3
+ NTP_4_2_7P392
+
+ sntp/sntp.1sntpman@1.216 +3 -3
+ NTP_4_2_7P392
+
+ sntp/sntp.1sntpmdoc@1.216 +3 -3
+ NTP_4_2_7P392
+
+ sntp/sntp.html@1.396 +2 -2
+ NTP_4_2_7P392
+
+ sntp/sntp.man.in@1.216 +3 -3
+ NTP_4_2_7P392
+
+ sntp/sntp.mdoc.in@1.216 +3 -3
+ NTP_4_2_7P392
+
+ util/invoke-ntp-keygen.texi@1.385 +2 -2
+ NTP_4_2_7P392
+
+ util/ntp-keygen-opts.c@1.399 +7 -7
+ NTP_4_2_7P392
+
+ util/ntp-keygen-opts.h@1.399 +3 -3
+ NTP_4_2_7P392
+
+ util/ntp-keygen.1ntp-keygenman@1.213 +3 -3
+ NTP_4_2_7P392
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.213 +3 -3
+ NTP_4_2_7P392
+
+ util/ntp-keygen.html@1.61 +2 -2
+ NTP_4_2_7P392
+
+ util/ntp-keygen.man.in@1.213 +3 -3
+ NTP_4_2_7P392
+
+ util/ntp-keygen.mdoc.in@1.213 +3 -3
+ NTP_4_2_7P392
+
+ChangeSet@1.2996.1.3, 2013-10-15 03:16:55-07:00, harlan@hms-mbp11.local
+ [Bug 2375] Improve AIX compatibility
+
+ ChangeLog@1.1343 +1 -0
+ [Bug 2375] Improve AIX compatibility
+
+ configure.ac@1.563.1.2 +10 -5
+ [Bug 2375] Improve AIX compatibility
+
+ sntp/m4/ntp_libntp.m4@1.21 +6 -3
+ [Bug 2375] Improve AIX compatibility
+
+ sntp/m4/os_cflags.m4@1.9 +6 -1
+ [Bug 2375] Improve AIX compatibility
+
+ChangeSet@1.2996.2.1, 2013-10-14 21:11:05+02:00, jnperlin@hydra.localnet
+ [Bug 2490] Fixed non-const initializer introduced with [Bug 2250] fix.
+
+ ChangeLog@1.1342 +1 -0
+ [Bug 2490] Fixed non-const initializer introduced with [Bug 2250] fix.
+
+ ntpd/ntp_control.c@1.187 +4 -4
+ [Bug 2490] Fixed non-const initializer introduced with [Bug 2250] fix.
+
+ChangeSet@1.2996.1.1, 2013-10-13 17:43:29-07:00, harlan@hms-mbp11.local
+ Fix comments and netbsd patterns in configure.ac
+
+ configure.ac@1.563.1.1 +14 -14
+ Fix comments and netbsd patterns in configure.ac
+
+ChangeSet@1.2990.1.1, 2013-10-13 09:26:49+00:00, stenn@psp-fb1.ntp.org
+ Prep for fixing bug 2256
+
+ configure.ac@1.562.1.1 +9 -0
+ Prep for fixing bug 2256
+
+ sntp/configure.ac@1.74 +6 -1
+ Prep for fixing bug 2256
+
+ChangeSet@1.2996, 2013-10-12 11:26:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P391
+ TAG: NTP_4_2_7P391
+
+ ChangeLog@1.1341 +1 -0
+ NTP_4_2_7P391
+
+ ntpd/invoke-ntp.conf.texi@1.69 +1 -1
+ NTP_4_2_7P391
+
+ ntpd/invoke-ntp.keys.texi@1.67 +1 -1
+ NTP_4_2_7P391
+
+ ntpd/invoke-ntpd.texi@1.383 +2 -2
+ NTP_4_2_7P391
+
+ ntpd/ntp.conf.5man@1.103 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntp.conf.5mdoc@1.103 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntp.conf.html@1.64 +1 -1
+ NTP_4_2_7P391
+
+ ntpd/ntp.conf.man.in@1.103 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntp.conf.mdoc.in@1.103 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntp.keys.5man@1.101 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntp.keys.5mdoc@1.101 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntp.keys.html@1.65 +1 -1
+ NTP_4_2_7P391
+
+ ntpd/ntp.keys.man.in@1.101 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntp.keys.mdoc.in@1.101 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntpd-opts.c@1.401 +7 -7
+ NTP_4_2_7P391
+
+ ntpd/ntpd-opts.h@1.401 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntpd.1ntpdman@1.212 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntpd.1ntpdmdoc@1.212 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntpd.html@1.59 +2 -2
+ NTP_4_2_7P391
+
+ ntpd/ntpd.man.in@1.212 +3 -3
+ NTP_4_2_7P391
+
+ ntpd/ntpd.mdoc.in@1.212 +3 -3
+ NTP_4_2_7P391
+
+ ntpdc/invoke-ntpdc.texi@1.380 +2 -2
+ NTP_4_2_7P391
+
+ ntpdc/ntpdc-opts.c@1.395 +7 -7
+ NTP_4_2_7P391
+
+ ntpdc/ntpdc-opts.h@1.395 +3 -3
+ NTP_4_2_7P391
+
+ ntpdc/ntpdc.1ntpdcman@1.211 +2 -2
+ NTP_4_2_7P391
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.211 +2 -2
+ NTP_4_2_7P391
+
+ ntpdc/ntpdc.html@1.224 +2 -2
+ NTP_4_2_7P391
+
+ ntpdc/ntpdc.man.in@1.211 +2 -2
+ NTP_4_2_7P391
+
+ ntpdc/ntpdc.mdoc.in@1.211 +2 -2
+ NTP_4_2_7P391
+
+ ntpq/invoke-ntpq.texi@1.384 +2 -2
+ NTP_4_2_7P391
+
+ ntpq/ntpq-opts.c@1.398 +7 -7
+ NTP_4_2_7P391
+
+ ntpq/ntpq-opts.h@1.398 +3 -3
+ NTP_4_2_7P391
+
+ ntpq/ntpq.1ntpqman@1.212 +2 -2
+ NTP_4_2_7P391
+
+ ntpq/ntpq.1ntpqmdoc@1.212 +2 -2
+ NTP_4_2_7P391
+
+ ntpq/ntpq.html@1.56 +2 -2
+ NTP_4_2_7P391
+
+ ntpq/ntpq.man.in@1.212 +2 -2
+ NTP_4_2_7P391
+
+ ntpq/ntpq.mdoc.in@1.212 +2 -2
+ NTP_4_2_7P391
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.383 +2 -2
+ NTP_4_2_7P391
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.398 +7 -7
+ NTP_4_2_7P391
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.398 +3 -3
+ NTP_4_2_7P391
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.212 +3 -3
+ NTP_4_2_7P391
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.212 +3 -3
+ NTP_4_2_7P391
+
+ ntpsnmpd/ntpsnmpd.html@1.54 +1 -1
+ NTP_4_2_7P391
+
+ ntpsnmpd/ntpsnmpd.man.in@1.212 +3 -3
+ NTP_4_2_7P391
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.212 +3 -3
+ NTP_4_2_7P391
+
+ packageinfo.sh@1.394 +1 -1
+ NTP_4_2_7P391
+
+ scripts/invoke-ntp-wait.texi@1.200 +2 -14
+ NTP_4_2_7P391
+
+ scripts/ntp-wait.1ntp-waitman@1.211 +3 -3
+ NTP_4_2_7P391
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.211 +3 -3
+ NTP_4_2_7P391
+
+ scripts/ntp-wait.html@1.216 +2 -14
+ NTP_4_2_7P391
+
+ scripts/ntp-wait.man.in@1.211 +3 -3
+ NTP_4_2_7P391
+
+ scripts/ntp-wait.mdoc.in@1.211 +3 -3
+ NTP_4_2_7P391
+
+ sntp/invoke-sntp.texi@1.380 +2 -2
+ NTP_4_2_7P391
+
+ sntp/sntp-opts.c@1.395 +7 -7
+ NTP_4_2_7P391
+
+ sntp/sntp-opts.h@1.395 +3 -3
+ NTP_4_2_7P391
+
+ sntp/sntp.1sntpman@1.215 +3 -3
+ NTP_4_2_7P391
+
+ sntp/sntp.1sntpmdoc@1.215 +3 -3
+ NTP_4_2_7P391
+
+ sntp/sntp.html@1.395 +2 -2
+ NTP_4_2_7P391
+
+ sntp/sntp.man.in@1.215 +3 -3
+ NTP_4_2_7P391
+
+ sntp/sntp.mdoc.in@1.215 +3 -3
+ NTP_4_2_7P391
+
+ util/invoke-ntp-keygen.texi@1.384 +2 -2
+ NTP_4_2_7P391
+
+ util/ntp-keygen-opts.c@1.398 +7 -7
+ NTP_4_2_7P391
+
+ util/ntp-keygen-opts.h@1.398 +3 -3
+ NTP_4_2_7P391
+
+ util/ntp-keygen.1ntp-keygenman@1.212 +3 -3
+ NTP_4_2_7P391
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.212 +3 -3
+ NTP_4_2_7P391
+
+ util/ntp-keygen.html@1.60 +2 -2
+ NTP_4_2_7P391
+
+ util/ntp-keygen.man.in@1.212 +3 -3
+ NTP_4_2_7P391
+
+ util/ntp-keygen.mdoc.in@1.212 +3 -3
+ NTP_4_2_7P391
+
+ChangeSet@1.2991.1.1, 2013-10-06 15:06:40+02:00, jnperlin@hydra.localnet
+ [Bug 2419] [rc-nmea] Improve clockstats reporting when receiver sends data without valid GPS fix.
+
+ ChangeLog@1.1338.1.1 +2 -0
+ [Bug 2419] [rc-nmea] Improve clockstats reporting when receiver sends data without valid GPS fix.
+
+ ntpd/refclock_nmea.c@1.72 +38 -22
+ [Bug 2419] [rc-nmea] Improve clockstats reporting when receiver sends data without valid GPS fix.
+
+ChangeSet@1.2994, 2013-10-03 14:55:29+02:00, jnperlin@hydra.localnet
+ [Bug 2250] Cleanup & Win32 integration of the NTPD leapsec module
+ fixed handling of leap second removal
+ trigger logic and windows port for leap seconds
+
+ include/ntpd.h@1.180 +1 -0
+ [Bug 2250] make difference in TAI offset at next leap second globally visible
+
+ ntpd/ntp_crypto.c@1.165 +2 -2
+ [Bug 2250] some argument reordering in leapsec module for clearer code
+
+ ntpd/ntp_leapsec.c@1.3 +137 -87
+ [Bug 2250] further cleanup & MSVC warning issues
+ better support for Win32 clock handling;
+ some argument reordering and more consistent naming
+ handling of leap second removal was buggy
+ some further refinements in parsing
+
+ ntpd/ntp_leapsec.h@1.2 +55 -24
+ [Bug 2250] further cleanup & MSVC warning issues;
+ some argument reordering
+
+ ntpd/ntp_proto.c@1.348 +3 -3
+ [Bug 2250] reset leap frame by API function
+ some argument reordering in leapsec module for clearer code
+
+ ntpd/ntp_timer.c@1.74 +35 -27
+ [Bug 2250] let windows clock stuff decide how to handle a leap second
+ separation of concerns
+ fix trigger logic for leap events
+
+ ntpd/ntp_util.c@1.104 +1 -5
+ [Bug 2250] use proper leapsec function to read file
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.61 +43 -48
+ [Bug 2250] use NTPD's leapsec module to decide when leap seconds occur
+ fix offset NTP vs FILETIME (don't trust constants you haven't calculated yourself...)
+
+ ports/winnt/vs2005/ntpd.vcproj@1.19 +8 -0
+ [Bug 2250] add ntp_leapsec.* to build
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.46 +8 -0
+ [Bug 2250] add ntp_leapsec.* to build
+
+ tests/ntpd/leapsec.cpp@1.2 +246 -85
+ [Bug 2250] some argument reordering in leapsec module for clearer code
+ removed some irrelevant checks
+ added a (faked) leap second deleteion table and test cases
+
+ChangeSet@1.2993, 2013-09-28 08:43:01+02:00, jnperlin@hydra.localnet
+ [Bug 2250] minor cleanup
+
+ ntpd/ntp_leapsec.c@1.2 +25 -18
+ [Bug 2250] minor cleanup
+
+ChangeSet@1.2985.2.1, 2013-09-27 20:37:04+02:00, jnperlin@hydra.localnet
+ [Bug 2250] Rework of leap second handling machine
+
+ ChangeLog@1.1333.2.1 +1 -0
+ [Bug 2250] Rework of leap second handling machine
+
+ configure.ac@1.561.1.1 +1 -0
+ [Bug 2250] add unit test dir for NTPD modules
+
+ include/ntpd.h@1.179 +1 -6
+ [Bug 2250] removed global values that went into leap second handling module
+
+ ntpd/Makefile.am@1.128 +5 -1
+ [Bug 2250] add references to 'ntp_leapsec.[ch]'
+
+ ntpd/ntp_control.c@1.186 +17 -10
+ [Bug 2250] rewired to 'ntp_leapsec'
+
+ ntpd/ntp_crypto.c@1.164 +18 -12
+ [Bug 2250] rewired to 'ntp_leapsec'
+
+ ntpd/ntp_leapsec.c@1.1 +899 -0
+ [Bug 2250] new module for leap second processing
+
+ ntpd/ntp_leapsec.c@1.0 +0 -0
+
+ ntpd/ntp_leapsec.h@1.1 +165 -0
+ [Bug 2250] new module for leap second processing
+
+ ntpd/ntp_leapsec.h@1.0 +0 -0
+
+ ntpd/ntp_proto.c@1.347 +31 -40
+ [Bug 2250] rewired to 'ntp_leapsec'
+
+ ntpd/ntp_timer.c@1.73 +103 -47
+ [Bug 2250] rewired to 'ntp_leapsec'
+
+ ntpd/ntp_util.c@1.103 +24 -124
+ [Bug 2250] rewired to 'ntp_leapsec'
+
+ tests/Makefile.am@1.5 +4 -1
+ [Bug 2250] subdir references to unit test for NTPD modules
+
+ tests/ntpd/Makefile.am@1.1 +55 -0
+ [Bug 2250] unit test support
+
+ tests/ntpd/Makefile.am@1.0 +0 -0
+
+ tests/ntpd/leapsec.cpp@1.1 +568 -0
+ [Bug 2250] unit test for leap second machine
+
+ tests/ntpd/leapsec.cpp@1.0 +0 -0
+
+ tests/ntpd/ntpdtest.cpp@1.1 +27 -0
+ [Bug 2250] unit test support
+
+ tests/ntpd/ntpdtest.cpp@1.0 +0 -0
+
+ tests/ntpd/ntpdtest.h@1.1 +15 -0
+ [Bug 2250] unit test support
+
+ tests/ntpd/ntpdtest.h@1.0 +0 -0
+
+ChangeSet@1.2991, 2013-09-26 11:37:35+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P390
+ TAG: NTP_4_2_7P390
+
+ ChangeLog@1.1338 +1 -0
+ NTP_4_2_7P390
+
+ ntpd/invoke-ntp.conf.texi@1.68 +1 -1
+ NTP_4_2_7P390
+
+ ntpd/invoke-ntp.keys.texi@1.66 +1 -1
+ NTP_4_2_7P390
+
+ ntpd/invoke-ntpd.texi@1.382 +2 -2
+ NTP_4_2_7P390
+
+ ntpd/ntp.conf.5man@1.102 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntp.conf.5mdoc@1.102 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntp.conf.html@1.63 +1 -1
+ NTP_4_2_7P390
+
+ ntpd/ntp.conf.man.in@1.102 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntp.conf.mdoc.in@1.102 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntp.keys.5man@1.100 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntp.keys.5mdoc@1.100 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntp.keys.html@1.64 +1 -1
+ NTP_4_2_7P390
+
+ ntpd/ntp.keys.man.in@1.100 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntp.keys.mdoc.in@1.100 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntpd-opts.c@1.400 +7 -7
+ NTP_4_2_7P390
+
+ ntpd/ntpd-opts.h@1.400 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntpd.1ntpdman@1.211 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntpd.1ntpdmdoc@1.211 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntpd.html@1.58 +8 -8
+ NTP_4_2_7P390
+
+ ntpd/ntpd.man.in@1.211 +3 -3
+ NTP_4_2_7P390
+
+ ntpd/ntpd.mdoc.in@1.211 +3 -3
+ NTP_4_2_7P390
+
+ ntpdc/invoke-ntpdc.texi@1.379 +2 -2
+ NTP_4_2_7P390
+
+ ntpdc/ntpdc-opts.c@1.394 +7 -7
+ NTP_4_2_7P390
+
+ ntpdc/ntpdc-opts.h@1.394 +3 -3
+ NTP_4_2_7P390
+
+ ntpdc/ntpdc.1ntpdcman@1.210 +2 -2
+ NTP_4_2_7P390
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.210 +2 -2
+ NTP_4_2_7P390
+
+ ntpdc/ntpdc.html@1.223 +2 -2
+ NTP_4_2_7P390
+
+ ntpdc/ntpdc.man.in@1.210 +2 -2
+ NTP_4_2_7P390
+
+ ntpdc/ntpdc.mdoc.in@1.210 +2 -2
+ NTP_4_2_7P390
+
+ ntpq/invoke-ntpq.texi@1.383 +2 -2
+ NTP_4_2_7P390
+
+ ntpq/ntpq-opts.c@1.397 +7 -7
+ NTP_4_2_7P390
+
+ ntpq/ntpq-opts.h@1.397 +3 -3
+ NTP_4_2_7P390
+
+ ntpq/ntpq.1ntpqman@1.211 +2 -2
+ NTP_4_2_7P390
+
+ ntpq/ntpq.1ntpqmdoc@1.211 +2 -2
+ NTP_4_2_7P390
+
+ ntpq/ntpq.html@1.55 +2 -2
+ NTP_4_2_7P390
+
+ ntpq/ntpq.man.in@1.211 +2 -2
+ NTP_4_2_7P390
+
+ ntpq/ntpq.mdoc.in@1.211 +2 -2
+ NTP_4_2_7P390
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.382 +2 -2
+ NTP_4_2_7P390
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.397 +7 -7
+ NTP_4_2_7P390
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.397 +3 -3
+ NTP_4_2_7P390
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.211 +3 -3
+ NTP_4_2_7P390
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.211 +3 -3
+ NTP_4_2_7P390
+
+ ntpsnmpd/ntpsnmpd.html@1.53 +1 -1
+ NTP_4_2_7P390
+
+ ntpsnmpd/ntpsnmpd.man.in@1.211 +3 -3
+ NTP_4_2_7P390
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.211 +3 -3
+ NTP_4_2_7P390
+
+ packageinfo.sh@1.393 +1 -1
+ NTP_4_2_7P390
+
+ scripts/invoke-ntp-wait.texi@1.199 +1 -1
+ NTP_4_2_7P390
+
+ scripts/ntp-wait.1ntp-waitman@1.210 +3 -3
+ NTP_4_2_7P390
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.210 +3 -3
+ NTP_4_2_7P390
+
+ scripts/ntp-wait.html@1.215 +1 -1
+ NTP_4_2_7P390
+
+ scripts/ntp-wait.man.in@1.210 +3 -3
+ NTP_4_2_7P390
+
+ scripts/ntp-wait.mdoc.in@1.210 +3 -3
+ NTP_4_2_7P390
+
+ sntp/invoke-sntp.texi@1.379 +2 -2
+ NTP_4_2_7P390
+
+ sntp/sntp-opts.c@1.394 +7 -7
+ NTP_4_2_7P390
+
+ sntp/sntp-opts.h@1.394 +3 -3
+ NTP_4_2_7P390
+
+ sntp/sntp.1sntpman@1.214 +3 -3
+ NTP_4_2_7P390
+
+ sntp/sntp.1sntpmdoc@1.214 +3 -3
+ NTP_4_2_7P390
+
+ sntp/sntp.html@1.394 +2 -2
+ NTP_4_2_7P390
+
+ sntp/sntp.man.in@1.214 +3 -3
+ NTP_4_2_7P390
+
+ sntp/sntp.mdoc.in@1.214 +3 -3
+ NTP_4_2_7P390
+
+ util/invoke-ntp-keygen.texi@1.383 +2 -2
+ NTP_4_2_7P390
+
+ util/ntp-keygen-opts.c@1.397 +7 -7
+ NTP_4_2_7P390
+
+ util/ntp-keygen-opts.h@1.397 +3 -3
+ NTP_4_2_7P390
+
+ util/ntp-keygen.1ntp-keygenman@1.211 +3 -3
+ NTP_4_2_7P390
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.211 +3 -3
+ NTP_4_2_7P390
+
+ util/ntp-keygen.html@1.59 +2 -2
+ NTP_4_2_7P390
+
+ util/ntp-keygen.man.in@1.211 +3 -3
+ NTP_4_2_7P390
+
+ util/ntp-keygen.mdoc.in@1.211 +3 -3
+ NTP_4_2_7P390
+
+ChangeSet@1.2990, 2013-09-25 08:24:34-04:00, stenn@deacon.udel.edu
+ [Bug 2482] Cleanup of droproot and jail support for Solaris
+
+ ChangeLog@1.1337 +2 -1
+ [Bug 2482] Cleanup of droproot and jail support for Solaris
+
+ ntpd/ntpd.c@1.150 +1 -3
+ [Bug 2482] Cleanup of droproot and jail support for Solaris
+
+ChangeSet@1.2989, 2013-09-24 08:54:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P389
+ TAG: NTP_4_2_7P389
+
+ ChangeLog@1.1336 +1 -0
+ NTP_4_2_7P389
+
+ ntpd/invoke-ntp.conf.texi@1.67 +1 -1
+ NTP_4_2_7P389
+
+ ntpd/invoke-ntp.keys.texi@1.65 +1 -1
+ NTP_4_2_7P389
+
+ ntpd/invoke-ntpd.texi@1.381 +8 -8
+ NTP_4_2_7P389
+
+ ntpd/ntp.conf.5man@1.101 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntp.conf.5mdoc@1.101 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntp.conf.html@1.62 +1 -1
+ NTP_4_2_7P389
+
+ ntpd/ntp.conf.man.in@1.101 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntp.conf.mdoc.in@1.101 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntp.keys.5man@1.99 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntp.keys.5mdoc@1.99 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntp.keys.html@1.63 +1 -1
+ NTP_4_2_7P389
+
+ ntpd/ntp.keys.man.in@1.99 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntp.keys.mdoc.in@1.99 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntpd-opts.c@1.399 +170 -170
+ NTP_4_2_7P389
+
+ ntpd/ntpd-opts.h@1.399 +3 -3
+ NTP_4_2_7P389
+
+ ntpd/ntpd.1ntpdman@1.210 +7 -7
+ NTP_4_2_7P389
+
+ ntpd/ntpd.1ntpdmdoc@1.210 +7 -7
+ NTP_4_2_7P389
+
+ ntpd/ntpd.html@1.57 +2 -2
+ NTP_4_2_7P389
+
+ ntpd/ntpd.man.in@1.210 +7 -7
+ NTP_4_2_7P389
+
+ ntpd/ntpd.mdoc.in@1.210 +7 -7
+ NTP_4_2_7P389
+
+ ntpdc/invoke-ntpdc.texi@1.378 +2 -2
+ NTP_4_2_7P389
+
+ ntpdc/ntpdc-opts.c@1.393 +7 -7
+ NTP_4_2_7P389
+
+ ntpdc/ntpdc-opts.h@1.393 +3 -3
+ NTP_4_2_7P389
+
+ ntpdc/ntpdc.1ntpdcman@1.209 +2 -2
+ NTP_4_2_7P389
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.209 +2 -2
+ NTP_4_2_7P389
+
+ ntpdc/ntpdc.html@1.222 +2 -2
+ NTP_4_2_7P389
+
+ ntpdc/ntpdc.man.in@1.209 +2 -2
+ NTP_4_2_7P389
+
+ ntpdc/ntpdc.mdoc.in@1.209 +2 -2
+ NTP_4_2_7P389
+
+ ntpq/invoke-ntpq.texi@1.382 +2 -2
+ NTP_4_2_7P389
+
+ ntpq/ntpq-opts.c@1.396 +7 -7
+ NTP_4_2_7P389
+
+ ntpq/ntpq-opts.h@1.396 +3 -3
+ NTP_4_2_7P389
+
+ ntpq/ntpq.1ntpqman@1.210 +2 -2
+ NTP_4_2_7P389
+
+ ntpq/ntpq.1ntpqmdoc@1.210 +2 -2
+ NTP_4_2_7P389
+
+ ntpq/ntpq.html@1.54 +2 -2
+ NTP_4_2_7P389
+
+ ntpq/ntpq.man.in@1.210 +2 -2
+ NTP_4_2_7P389
+
+ ntpq/ntpq.mdoc.in@1.210 +2 -2
+ NTP_4_2_7P389
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.381 +2 -2
+ NTP_4_2_7P389
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.396 +7 -7
+ NTP_4_2_7P389
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.396 +3 -3
+ NTP_4_2_7P389
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.210 +3 -3
+ NTP_4_2_7P389
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.210 +3 -3
+ NTP_4_2_7P389
+
+ ntpsnmpd/ntpsnmpd.html@1.52 +1 -1
+ NTP_4_2_7P389
+
+ ntpsnmpd/ntpsnmpd.man.in@1.210 +3 -3
+ NTP_4_2_7P389
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.210 +3 -3
+ NTP_4_2_7P389
+
+ packageinfo.sh@1.392 +1 -1
+ NTP_4_2_7P389
+
+ scripts/invoke-ntp-wait.texi@1.198 +1 -1
+ NTP_4_2_7P389
+
+ scripts/ntp-wait.1ntp-waitman@1.209 +3 -3
+ NTP_4_2_7P389
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.209 +3 -3
+ NTP_4_2_7P389
+
+ scripts/ntp-wait.html@1.214 +1 -1
+ NTP_4_2_7P389
+
+ scripts/ntp-wait.man.in@1.209 +3 -3
+ NTP_4_2_7P389
+
+ scripts/ntp-wait.mdoc.in@1.209 +3 -3
+ NTP_4_2_7P389
+
+ sntp/invoke-sntp.texi@1.378 +2 -2
+ NTP_4_2_7P389
+
+ sntp/sntp-opts.c@1.393 +7 -7
+ NTP_4_2_7P389
+
+ sntp/sntp-opts.h@1.393 +3 -3
+ NTP_4_2_7P389
+
+ sntp/sntp.1sntpman@1.213 +3 -3
+ NTP_4_2_7P389
+
+ sntp/sntp.1sntpmdoc@1.213 +3 -3
+ NTP_4_2_7P389
+
+ sntp/sntp.html@1.393 +2 -2
+ NTP_4_2_7P389
+
+ sntp/sntp.man.in@1.213 +3 -3
+ NTP_4_2_7P389
+
+ sntp/sntp.mdoc.in@1.213 +3 -3
+ NTP_4_2_7P389
+
+ util/invoke-ntp-keygen.texi@1.382 +2 -2
+ NTP_4_2_7P389
+
+ util/ntp-keygen-opts.c@1.396 +7 -7
+ NTP_4_2_7P389
+
+ util/ntp-keygen-opts.h@1.396 +3 -3
+ NTP_4_2_7P389
+
+ util/ntp-keygen.1ntp-keygenman@1.210 +3 -3
+ NTP_4_2_7P389
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.210 +3 -3
+ NTP_4_2_7P389
+
+ util/ntp-keygen.html@1.58 +2 -2
+ NTP_4_2_7P389
+
+ util/ntp-keygen.man.in@1.210 +3 -3
+ NTP_4_2_7P389
+
+ util/ntp-keygen.mdoc.in@1.210 +3 -3
+ NTP_4_2_7P389
+
+ChangeSet@1.2988, 2013-09-24 04:30:55-04:00, stenn@deacon.udel.edu
+ #ifdef PRIV_AWARE_RESET for older Solaris for now...
+
+ ntpd/ntpd.c@1.149 +2 -0
+ #ifdef PRIV_AWARE_RESET for older Solaris for now...
+
+ChangeSet@1.2985.1.1, 2013-09-24 04:05:09-04:00, stenn@pogo.udel.edu
+ [Bug 2482] Add droproot ahd jail support for Solaris
+
+ ChangeLog@1.1333.1.2 +1 -0
+ [Bug 2482] Add droproot ahd jail support for Solaris
+
+ ChangeLog@1.1333.1.1 +1 -0
+ [Bug 2481] ntpd aborts when both user and group are specified with -u
+
+ configure.ac@1.562 +0 -11
+ [Bug 2482] Add droproot ahd jail support for Solaris
+
+ ntpd/cmd_args.c@1.61 +4 -1
+ [Bug 2481] ntpd aborts when both user and group are specified with -u
+
+ ntpd/ntpd.c@1.148 +44 -5
+ [Bug 2482] Add droproot ahd jail support for Solaris
+
+ ntpd/ntpdbase-opts.def@1.26 +6 -6
+ [Bug 2482] Add droproot ahd jail support for Solaris
+
+ sntp/m4/ntp_libntp.m4@1.20 +37 -1
+ [Bug 2482] Add droproot ahd jail support for Solaris
+
+ChangeSet@1.2986, 2013-09-20 13:40:43+02:00, jnperlin@hydra.localnet
+ [Bug 2473] revisited: Avoid possible unsigned underrun for startup condition when testing for clock backstep.
+
+ ChangeLog@1.1334 +3 -0
+ [Bug 2473] revisited: Avoid possible unsigned underrun for startup condition when testing for clock backstep.
+
+ libntp/systime.c@1.68 +10 -2
+ [Bug 2473] revisited: Avoid possible unsigned underrun for startup condition when testing for clock backstep.
+
+ChangeSet@1.2985, 2013-09-19 11:35:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P388
+ TAG: NTP_4_2_7P388
+
+ ChangeLog@1.1333 +1 -0
+ NTP_4_2_7P388
+
+ ntpd/invoke-ntp.conf.texi@1.66 +1 -1
+ NTP_4_2_7P388
+
+ ntpd/invoke-ntp.keys.texi@1.64 +1 -1
+ NTP_4_2_7P388
+
+ ntpd/invoke-ntpd.texi@1.380 +2 -2
+ NTP_4_2_7P388
+
+ ntpd/ntp.conf.5man@1.100 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntp.conf.5mdoc@1.100 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntp.conf.html@1.61 +1 -1
+ NTP_4_2_7P388
+
+ ntpd/ntp.conf.man.in@1.100 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntp.conf.mdoc.in@1.100 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntp.keys.5man@1.98 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntp.keys.5mdoc@1.98 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntp.keys.html@1.62 +1 -1
+ NTP_4_2_7P388
+
+ ntpd/ntp.keys.man.in@1.98 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntp.keys.mdoc.in@1.98 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntpd-opts.c@1.398 +7 -7
+ NTP_4_2_7P388
+
+ ntpd/ntpd-opts.h@1.398 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntpd.1ntpdman@1.209 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntpd.1ntpdmdoc@1.209 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntpd.html@1.56 +2 -2
+ NTP_4_2_7P388
+
+ ntpd/ntpd.man.in@1.209 +3 -3
+ NTP_4_2_7P388
+
+ ntpd/ntpd.mdoc.in@1.209 +3 -3
+ NTP_4_2_7P388
+
+ ntpdc/invoke-ntpdc.texi@1.377 +2 -2
+ NTP_4_2_7P388
+
+ ntpdc/ntpdc-opts.c@1.392 +7 -7
+ NTP_4_2_7P388
+
+ ntpdc/ntpdc-opts.h@1.392 +3 -3
+ NTP_4_2_7P388
+
+ ntpdc/ntpdc.1ntpdcman@1.208 +2 -2
+ NTP_4_2_7P388
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.208 +2 -2
+ NTP_4_2_7P388
+
+ ntpdc/ntpdc.html@1.221 +2 -2
+ NTP_4_2_7P388
+
+ ntpdc/ntpdc.man.in@1.208 +2 -2
+ NTP_4_2_7P388
+
+ ntpdc/ntpdc.mdoc.in@1.208 +2 -2
+ NTP_4_2_7P388
+
+ ntpq/invoke-ntpq.texi@1.381 +2 -2
+ NTP_4_2_7P388
+
+ ntpq/ntpq-opts.c@1.395 +7 -7
+ NTP_4_2_7P388
+
+ ntpq/ntpq-opts.h@1.395 +3 -3
+ NTP_4_2_7P388
+
+ ntpq/ntpq.1ntpqman@1.209 +2 -2
+ NTP_4_2_7P388
+
+ ntpq/ntpq.1ntpqmdoc@1.209 +2 -2
+ NTP_4_2_7P388
+
+ ntpq/ntpq.html@1.53 +2 -2
+ NTP_4_2_7P388
+
+ ntpq/ntpq.man.in@1.209 +2 -2
+ NTP_4_2_7P388
+
+ ntpq/ntpq.mdoc.in@1.209 +2 -2
+ NTP_4_2_7P388
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.380 +2 -2
+ NTP_4_2_7P388
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.395 +7 -7
+ NTP_4_2_7P388
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.395 +3 -3
+ NTP_4_2_7P388
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.209 +3 -3
+ NTP_4_2_7P388
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.209 +3 -3
+ NTP_4_2_7P388
+
+ ntpsnmpd/ntpsnmpd.html@1.51 +1 -1
+ NTP_4_2_7P388
+
+ ntpsnmpd/ntpsnmpd.man.in@1.209 +3 -3
+ NTP_4_2_7P388
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.209 +3 -3
+ NTP_4_2_7P388
+
+ packageinfo.sh@1.391 +1 -1
+ NTP_4_2_7P388
+
+ scripts/invoke-ntp-wait.texi@1.197 +1 -1
+ NTP_4_2_7P388
+
+ scripts/ntp-wait.1ntp-waitman@1.208 +3 -3
+ NTP_4_2_7P388
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.208 +3 -3
+ NTP_4_2_7P388
+
+ scripts/ntp-wait.html@1.213 +1 -1
+ NTP_4_2_7P388
+
+ scripts/ntp-wait.man.in@1.208 +3 -3
+ NTP_4_2_7P388
+
+ scripts/ntp-wait.mdoc.in@1.208 +3 -3
+ NTP_4_2_7P388
+
+ sntp/invoke-sntp.texi@1.377 +2 -2
+ NTP_4_2_7P388
+
+ sntp/sntp-opts.c@1.392 +7 -7
+ NTP_4_2_7P388
+
+ sntp/sntp-opts.h@1.392 +3 -3
+ NTP_4_2_7P388
+
+ sntp/sntp.1sntpman@1.212 +3 -3
+ NTP_4_2_7P388
+
+ sntp/sntp.1sntpmdoc@1.212 +3 -3
+ NTP_4_2_7P388
+
+ sntp/sntp.html@1.392 +2 -2
+ NTP_4_2_7P388
+
+ sntp/sntp.man.in@1.212 +3 -3
+ NTP_4_2_7P388
+
+ sntp/sntp.mdoc.in@1.212 +3 -3
+ NTP_4_2_7P388
+
+ util/invoke-ntp-keygen.texi@1.381 +2 -2
+ NTP_4_2_7P388
+
+ util/ntp-keygen-opts.c@1.395 +7 -7
+ NTP_4_2_7P388
+
+ util/ntp-keygen-opts.h@1.395 +3 -3
+ NTP_4_2_7P388
+
+ util/ntp-keygen.1ntp-keygenman@1.209 +3 -3
+ NTP_4_2_7P388
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.209 +3 -3
+ NTP_4_2_7P388
+
+ util/ntp-keygen.html@1.57 +2 -2
+ NTP_4_2_7P388
+
+ util/ntp-keygen.man.in@1.209 +3 -3
+ NTP_4_2_7P388
+
+ util/ntp-keygen.mdoc.in@1.209 +3 -3
+ NTP_4_2_7P388
+
+ChangeSet@1.2983, 2013-09-16 11:34:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P387
+ TAG: NTP_4_2_7P387
+
+ ChangeLog@1.1331 +1 -0
+ NTP_4_2_7P387
+
+ ntpd/invoke-ntp.conf.texi@1.65 +1 -1
+ NTP_4_2_7P387
+
+ ntpd/invoke-ntp.keys.texi@1.63 +1 -1
+ NTP_4_2_7P387
+
+ ntpd/invoke-ntpd.texi@1.379 +2 -2
+ NTP_4_2_7P387
+
+ ntpd/ntp.conf.5man@1.99 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntp.conf.5mdoc@1.99 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntp.conf.html@1.60 +1 -1
+ NTP_4_2_7P387
+
+ ntpd/ntp.conf.man.in@1.99 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntp.conf.mdoc.in@1.99 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntp.keys.5man@1.97 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntp.keys.5mdoc@1.97 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntp.keys.html@1.61 +1 -1
+ NTP_4_2_7P387
+
+ ntpd/ntp.keys.man.in@1.97 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntp.keys.mdoc.in@1.97 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntpd-opts.c@1.397 +7 -7
+ NTP_4_2_7P387
+
+ ntpd/ntpd-opts.h@1.397 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntpd.1ntpdman@1.208 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntpd.1ntpdmdoc@1.208 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntpd.html@1.55 +2 -2
+ NTP_4_2_7P387
+
+ ntpd/ntpd.man.in@1.208 +3 -3
+ NTP_4_2_7P387
+
+ ntpd/ntpd.mdoc.in@1.208 +3 -3
+ NTP_4_2_7P387
+
+ ntpdc/invoke-ntpdc.texi@1.376 +2 -2
+ NTP_4_2_7P387
+
+ ntpdc/ntpdc-opts.c@1.391 +7 -7
+ NTP_4_2_7P387
+
+ ntpdc/ntpdc-opts.h@1.391 +3 -3
+ NTP_4_2_7P387
+
+ ntpdc/ntpdc.1ntpdcman@1.207 +2 -2
+ NTP_4_2_7P387
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.207 +2 -2
+ NTP_4_2_7P387
+
+ ntpdc/ntpdc.html@1.220 +2 -2
+ NTP_4_2_7P387
+
+ ntpdc/ntpdc.man.in@1.207 +2 -2
+ NTP_4_2_7P387
+
+ ntpdc/ntpdc.mdoc.in@1.207 +2 -2
+ NTP_4_2_7P387
+
+ ntpq/invoke-ntpq.texi@1.380 +2 -2
+ NTP_4_2_7P387
+
+ ntpq/ntpq-opts.c@1.394 +7 -7
+ NTP_4_2_7P387
+
+ ntpq/ntpq-opts.h@1.394 +3 -3
+ NTP_4_2_7P387
+
+ ntpq/ntpq.1ntpqman@1.208 +2 -2
+ NTP_4_2_7P387
+
+ ntpq/ntpq.1ntpqmdoc@1.208 +2 -2
+ NTP_4_2_7P387
+
+ ntpq/ntpq.html@1.52 +2 -2
+ NTP_4_2_7P387
+
+ ntpq/ntpq.man.in@1.208 +2 -2
+ NTP_4_2_7P387
+
+ ntpq/ntpq.mdoc.in@1.208 +2 -2
+ NTP_4_2_7P387
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.379 +2 -2
+ NTP_4_2_7P387
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.394 +7 -7
+ NTP_4_2_7P387
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.394 +3 -3
+ NTP_4_2_7P387
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.208 +3 -3
+ NTP_4_2_7P387
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.208 +3 -3
+ NTP_4_2_7P387
+
+ ntpsnmpd/ntpsnmpd.html@1.50 +1 -1
+ NTP_4_2_7P387
+
+ ntpsnmpd/ntpsnmpd.man.in@1.208 +3 -3
+ NTP_4_2_7P387
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.208 +3 -3
+ NTP_4_2_7P387
+
+ packageinfo.sh@1.390 +1 -1
+ NTP_4_2_7P387
+
+ scripts/invoke-ntp-wait.texi@1.196 +1 -1
+ NTP_4_2_7P387
+
+ scripts/ntp-wait.1ntp-waitman@1.207 +3 -3
+ NTP_4_2_7P387
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.207 +3 -3
+ NTP_4_2_7P387
+
+ scripts/ntp-wait.html@1.212 +1 -1
+ NTP_4_2_7P387
+
+ scripts/ntp-wait.man.in@1.207 +3 -3
+ NTP_4_2_7P387
+
+ scripts/ntp-wait.mdoc.in@1.207 +3 -3
+ NTP_4_2_7P387
+
+ sntp/invoke-sntp.texi@1.376 +2 -2
+ NTP_4_2_7P387
+
+ sntp/sntp-opts.c@1.391 +7 -7
+ NTP_4_2_7P387
+
+ sntp/sntp-opts.h@1.391 +3 -3
+ NTP_4_2_7P387
+
+ sntp/sntp.1sntpman@1.211 +3 -3
+ NTP_4_2_7P387
+
+ sntp/sntp.1sntpmdoc@1.211 +3 -3
+ NTP_4_2_7P387
+
+ sntp/sntp.html@1.391 +2 -2
+ NTP_4_2_7P387
+
+ sntp/sntp.man.in@1.211 +3 -3
+ NTP_4_2_7P387
+
+ sntp/sntp.mdoc.in@1.211 +3 -3
+ NTP_4_2_7P387
+
+ util/invoke-ntp-keygen.texi@1.380 +2 -2
+ NTP_4_2_7P387
+
+ util/ntp-keygen-opts.c@1.394 +7 -7
+ NTP_4_2_7P387
+
+ util/ntp-keygen-opts.h@1.394 +3 -3
+ NTP_4_2_7P387
+
+ util/ntp-keygen.1ntp-keygenman@1.208 +3 -3
+ NTP_4_2_7P387
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.208 +3 -3
+ NTP_4_2_7P387
+
+ util/ntp-keygen.html@1.56 +2 -2
+ NTP_4_2_7P387
+
+ util/ntp-keygen.man.in@1.208 +3 -3
+ NTP_4_2_7P387
+
+ util/ntp-keygen.mdoc.in@1.208 +3 -3
+ NTP_4_2_7P387
+
+ChangeSet@1.2977.1.10, 2013-09-16 01:24:16-07:00, harlan@hms-mbp11.local
+ [Bug 1642] ntpdsim can't find simnulate block in config file
+
+ ChangeLog@1.1326.1.10 +1 -0
+ [Bug 1642] ntpdsim can't find simnulate block in config file
+
+ html/ntpdsim_new.html@1.7 +28 -28
+ [Bug 1642] ntpdsim can't find simnulate block in config file
+
+ChangeSet@1.2981, 2013-09-16 03:56:14-04:00, stenn@psp-deb1.ntp.org
+ Remove obsolete agtexi-file.tpl patch
+
+ BitKeeper/deleted/86/agtexi-file.tpl~53aac9b4490bfb69@1.5, stenn@psp-fb1.ntp.org +0 -0
+ Delete: sntp/ag-tpl/agtexi-file.tpl
+
+ChangeSet@1.2977.1.9, 2013-09-01 11:39:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P386
+ TAG: NTP_4_2_7P386
+
+ ChangeLog@1.1326.1.9 +1 -0
+ NTP_4_2_7P386
+
+ ntpd/invoke-ntp.conf.texi@1.64 +1 -1
+ NTP_4_2_7P386
+
+ ntpd/invoke-ntp.keys.texi@1.62 +1 -1
+ NTP_4_2_7P386
+
+ ntpd/invoke-ntpd.texi@1.378 +2 -2
+ NTP_4_2_7P386
+
+ ntpd/ntp.conf.5man@1.98 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntp.conf.5mdoc@1.98 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntp.conf.html@1.59 +1 -1
+ NTP_4_2_7P386
+
+ ntpd/ntp.conf.man.in@1.98 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntp.conf.mdoc.in@1.98 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntp.keys.5man@1.96 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntp.keys.5mdoc@1.96 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntp.keys.html@1.60 +1 -1
+ NTP_4_2_7P386
+
+ ntpd/ntp.keys.man.in@1.96 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntp.keys.mdoc.in@1.96 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntpd-opts.c@1.396 +7 -7
+ NTP_4_2_7P386
+
+ ntpd/ntpd-opts.h@1.396 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntpd.1ntpdman@1.207 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntpd.1ntpdmdoc@1.207 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntpd.html@1.54 +2 -2
+ NTP_4_2_7P386
+
+ ntpd/ntpd.man.in@1.207 +3 -3
+ NTP_4_2_7P386
+
+ ntpd/ntpd.mdoc.in@1.207 +3 -3
+ NTP_4_2_7P386
+
+ ntpdc/invoke-ntpdc.texi@1.375 +2 -2
+ NTP_4_2_7P386
+
+ ntpdc/ntpdc-opts.c@1.390 +7 -7
+ NTP_4_2_7P386
+
+ ntpdc/ntpdc-opts.h@1.390 +3 -3
+ NTP_4_2_7P386
+
+ ntpdc/ntpdc.1ntpdcman@1.206 +2 -2
+ NTP_4_2_7P386
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.206 +2 -2
+ NTP_4_2_7P386
+
+ ntpdc/ntpdc.html@1.219 +2 -2
+ NTP_4_2_7P386
+
+ ntpdc/ntpdc.man.in@1.206 +2 -2
+ NTP_4_2_7P386
+
+ ntpdc/ntpdc.mdoc.in@1.206 +2 -2
+ NTP_4_2_7P386
+
+ ntpq/invoke-ntpq.texi@1.379 +2 -2
+ NTP_4_2_7P386
+
+ ntpq/ntpq-opts.c@1.393 +7 -7
+ NTP_4_2_7P386
+
+ ntpq/ntpq-opts.h@1.393 +3 -3
+ NTP_4_2_7P386
+
+ ntpq/ntpq.1ntpqman@1.207 +2 -2
+ NTP_4_2_7P386
+
+ ntpq/ntpq.1ntpqmdoc@1.207 +2 -2
+ NTP_4_2_7P386
+
+ ntpq/ntpq.html@1.51 +2 -2
+ NTP_4_2_7P386
+
+ ntpq/ntpq.man.in@1.207 +2 -2
+ NTP_4_2_7P386
+
+ ntpq/ntpq.mdoc.in@1.207 +2 -2
+ NTP_4_2_7P386
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.378 +2 -2
+ NTP_4_2_7P386
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.393 +7 -7
+ NTP_4_2_7P386
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.393 +3 -3
+ NTP_4_2_7P386
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.207 +3 -3
+ NTP_4_2_7P386
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.207 +3 -3
+ NTP_4_2_7P386
+
+ ntpsnmpd/ntpsnmpd.html@1.49 +1 -1
+ NTP_4_2_7P386
+
+ ntpsnmpd/ntpsnmpd.man.in@1.207 +3 -3
+ NTP_4_2_7P386
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.207 +3 -3
+ NTP_4_2_7P386
+
+ packageinfo.sh@1.389 +1 -1
+ NTP_4_2_7P386
+
+ scripts/invoke-ntp-wait.texi@1.195 +1 -1
+ NTP_4_2_7P386
+
+ scripts/ntp-wait.1ntp-waitman@1.206 +3 -3
+ NTP_4_2_7P386
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.206 +3 -3
+ NTP_4_2_7P386
+
+ scripts/ntp-wait.html@1.211 +1 -1
+ NTP_4_2_7P386
+
+ scripts/ntp-wait.man.in@1.206 +3 -3
+ NTP_4_2_7P386
+
+ scripts/ntp-wait.mdoc.in@1.206 +3 -3
+ NTP_4_2_7P386
+
+ sntp/invoke-sntp.texi@1.375 +2 -2
+ NTP_4_2_7P386
+
+ sntp/sntp-opts.c@1.390 +7 -7
+ NTP_4_2_7P386
+
+ sntp/sntp-opts.h@1.390 +3 -3
+ NTP_4_2_7P386
+
+ sntp/sntp.1sntpman@1.210 +3 -3
+ NTP_4_2_7P386
+
+ sntp/sntp.1sntpmdoc@1.210 +3 -3
+ NTP_4_2_7P386
+
+ sntp/sntp.html@1.390 +2 -2
+ NTP_4_2_7P386
+
+ sntp/sntp.man.in@1.210 +3 -3
+ NTP_4_2_7P386
+
+ sntp/sntp.mdoc.in@1.210 +3 -3
+ NTP_4_2_7P386
+
+ util/invoke-ntp-keygen.texi@1.379 +2 -2
+ NTP_4_2_7P386
+
+ util/ntp-keygen-opts.c@1.393 +7 -7
+ NTP_4_2_7P386
+
+ util/ntp-keygen-opts.h@1.393 +3 -3
+ NTP_4_2_7P386
+
+ util/ntp-keygen.1ntp-keygenman@1.207 +3 -3
+ NTP_4_2_7P386
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.207 +3 -3
+ NTP_4_2_7P386
+
+ util/ntp-keygen.html@1.55 +2 -2
+ NTP_4_2_7P386
+
+ util/ntp-keygen.man.in@1.207 +3 -3
+ NTP_4_2_7P386
+
+ util/ntp-keygen.mdoc.in@1.207 +3 -3
+ NTP_4_2_7P386
+
+ChangeSet@1.2977.2.1, 2013-09-01 10:34:32+02:00, jnperlin@armageddon.
+ [Bug 2473] NTPD exits after clock is stepped backwards externally
+
+ ChangeLog@1.1326.2.1 +1 -0
+ [Bug 2473] NTPD exits after clock is stepped backwards externally
+
+ libntp/systime.c@1.67 +10 -0
+ [Bug 2473] NTPD exits after clock is stepped backwards externally
+ Check for back-steps of the system clock to avoid sporious Lamport advance violations
+
+ChangeSet@1.2977.1.8, 2013-08-30 21:23:39+02:00, jnperlin@armageddon.
+ * [Bug 2472] (WinXP) Avoid self-termination of IO thread during exit().
+
+ ChangeLog@1.1326.1.8 +1 -0
+ * [Bug 2472] (WinXP) Avoid self-termination of IO thread during exit().
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.69 +16 -10
+ * [Bug 2472] (WinXP) Avoid self-termination of IO thread during exit().
+
+ChangeSet@1.2977.1.7, 2013-08-19 03:48:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P385
+ TAG: NTP_4_2_7P385
+
+ ChangeLog@1.1326.1.7 +1 -0
+ NTP_4_2_7P385
+
+ ntpd/invoke-ntp.conf.texi@1.63 +1 -1
+ NTP_4_2_7P385
+
+ ntpd/invoke-ntp.keys.texi@1.61 +1 -1
+ NTP_4_2_7P385
+
+ ntpd/invoke-ntpd.texi@1.377 +2 -2
+ NTP_4_2_7P385
+
+ ntpd/ntp.conf.5man@1.97 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntp.conf.5mdoc@1.97 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntp.conf.html@1.58 +1 -1
+ NTP_4_2_7P385
+
+ ntpd/ntp.conf.man.in@1.97 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntp.conf.mdoc.in@1.97 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntp.keys.5man@1.95 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntp.keys.5mdoc@1.95 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntp.keys.html@1.59 +1 -1
+ NTP_4_2_7P385
+
+ ntpd/ntp.keys.man.in@1.95 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntp.keys.mdoc.in@1.95 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntpd-opts.c@1.395 +7 -7
+ NTP_4_2_7P385
+
+ ntpd/ntpd-opts.h@1.395 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntpd.1ntpdman@1.206 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntpd.1ntpdmdoc@1.206 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntpd.html@1.53 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntpd.man.in@1.206 +3 -3
+ NTP_4_2_7P385
+
+ ntpd/ntpd.mdoc.in@1.206 +3 -3
+ NTP_4_2_7P385
+
+ ntpdc/invoke-ntpdc.texi@1.374 +2 -2
+ NTP_4_2_7P385
+
+ ntpdc/ntpdc-opts.c@1.389 +7 -7
+ NTP_4_2_7P385
+
+ ntpdc/ntpdc-opts.h@1.389 +3 -3
+ NTP_4_2_7P385
+
+ ntpdc/ntpdc.1ntpdcman@1.205 +2 -2
+ NTP_4_2_7P385
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.205 +2 -2
+ NTP_4_2_7P385
+
+ ntpdc/ntpdc.html@1.218 +2 -2
+ NTP_4_2_7P385
+
+ ntpdc/ntpdc.man.in@1.205 +2 -2
+ NTP_4_2_7P385
+
+ ntpdc/ntpdc.mdoc.in@1.205 +2 -2
+ NTP_4_2_7P385
+
+ ntpq/invoke-ntpq.texi@1.378 +2 -2
+ NTP_4_2_7P385
+
+ ntpq/ntpq-opts.c@1.392 +7 -7
+ NTP_4_2_7P385
+
+ ntpq/ntpq-opts.h@1.392 +3 -3
+ NTP_4_2_7P385
+
+ ntpq/ntpq.1ntpqman@1.206 +2 -2
+ NTP_4_2_7P385
+
+ ntpq/ntpq.1ntpqmdoc@1.206 +2 -2
+ NTP_4_2_7P385
+
+ ntpq/ntpq.html@1.50 +2 -2
+ NTP_4_2_7P385
+
+ ntpq/ntpq.man.in@1.206 +2 -2
+ NTP_4_2_7P385
+
+ ntpq/ntpq.mdoc.in@1.206 +2 -2
+ NTP_4_2_7P385
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.377 +2 -2
+ NTP_4_2_7P385
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.392 +7 -7
+ NTP_4_2_7P385
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.392 +3 -3
+ NTP_4_2_7P385
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.206 +3 -3
+ NTP_4_2_7P385
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.206 +3 -3
+ NTP_4_2_7P385
+
+ ntpsnmpd/ntpsnmpd.html@1.48 +1 -1
+ NTP_4_2_7P385
+
+ ntpsnmpd/ntpsnmpd.man.in@1.206 +3 -3
+ NTP_4_2_7P385
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.206 +3 -3
+ NTP_4_2_7P385
+
+ packageinfo.sh@1.388 +1 -1
+ NTP_4_2_7P385
+
+ scripts/invoke-ntp-wait.texi@1.194 +1 -1
+ NTP_4_2_7P385
+
+ scripts/ntp-wait.1ntp-waitman@1.205 +3 -3
+ NTP_4_2_7P385
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.205 +3 -3
+ NTP_4_2_7P385
+
+ scripts/ntp-wait.html@1.210 +1 -1
+ NTP_4_2_7P385
+
+ scripts/ntp-wait.man.in@1.205 +3 -3
+ NTP_4_2_7P385
+
+ scripts/ntp-wait.mdoc.in@1.205 +3 -3
+ NTP_4_2_7P385
+
+ sntp/invoke-sntp.texi@1.374 +2 -2
+ NTP_4_2_7P385
+
+ sntp/sntp-opts.c@1.389 +7 -7
+ NTP_4_2_7P385
+
+ sntp/sntp-opts.h@1.389 +3 -3
+ NTP_4_2_7P385
+
+ sntp/sntp.1sntpman@1.209 +3 -3
+ NTP_4_2_7P385
+
+ sntp/sntp.1sntpmdoc@1.209 +3 -3
+ NTP_4_2_7P385
+
+ sntp/sntp.html@1.389 +2 -2
+ NTP_4_2_7P385
+
+ sntp/sntp.man.in@1.209 +3 -3
+ NTP_4_2_7P385
+
+ sntp/sntp.mdoc.in@1.209 +3 -3
+ NTP_4_2_7P385
+
+ util/invoke-ntp-keygen.texi@1.378 +2 -2
+ NTP_4_2_7P385
+
+ util/ntp-keygen-opts.c@1.392 +7 -7
+ NTP_4_2_7P385
+
+ util/ntp-keygen-opts.h@1.392 +3 -3
+ NTP_4_2_7P385
+
+ util/ntp-keygen.1ntp-keygenman@1.206 +3 -3
+ NTP_4_2_7P385
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.206 +3 -3
+ NTP_4_2_7P385
+
+ util/ntp-keygen.html@1.54 +2 -2
+ NTP_4_2_7P385
+
+ util/ntp-keygen.man.in@1.206 +3 -3
+ NTP_4_2_7P385
+
+ util/ntp-keygen.mdoc.in@1.206 +3 -3
+ NTP_4_2_7P385
+
+ChangeSet@1.2977.1.6, 2013-08-18 23:30:39-04:00, stenn@deacon.udel.edu
+ [Bug 2426] Possibly uninitialized data in crypto_send() - CID 975596
+
+ ChangeLog@1.1326.1.6 +1 -0
+ [Bug 2426] Possibly uninitialized data in crypto_send() - CID 975596
+
+ChangeSet@1.2977.1.5, 2013-08-18 23:05:39-04:00, stenn@pogo.udel.edu
+ CID 975596: Copy/paste error: vallen should be siglen
+
+ ChangeLog@1.1326.1.5 +1 -0
+ CID 975596: Copy/paste error: vallen should be siglen
+
+ ntpd/ntp_crypto.c@1.163 +1 -1
+ CID 975596: Copy/paste error: vallen should be siglen
+
+ChangeSet@1.2977.1.4, 2013-08-18 23:00:37-04:00, stenn@pogo.udel.edu
+ CID 1009579: Check return status of X509_add_ext()
+
+ ChangeLog@1.1326.1.4 +1 -0
+ CID 1009579: Check return status of X509_add_ext()
+
+ ntpd/ntp_crypto.c@1.162 +1 -1
+ CID 1009579: Check return status of X509_add_ext()
+
+ChangeSet@1.2977.1.3, 2013-08-18 22:20:55-04:00, stenn@pogo.udel.edu
+ [2085] Fix root distance and root dispersion calculations
+
+ ChangeLog@1.1326.1.3 +1 -0
+ [2085] Fix root distance and root dispersion calculations
+
+ ntpd/ntp_proto.c@1.346 +48 -6
+ [2085] Fix root distance and root dispersion calculations
+
+ChangeSet@1.2977.1.2, 2013-08-18 11:41:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P384
+ TAG: NTP_4_2_7P384
+
+ ChangeLog@1.1326.1.2 +1 -0
+ NTP_4_2_7P384
+
+ ntpd/invoke-ntp.conf.texi@1.62 +1 -1
+ NTP_4_2_7P384
+
+ ntpd/invoke-ntp.keys.texi@1.60 +1 -1
+ NTP_4_2_7P384
+
+ ntpd/invoke-ntpd.texi@1.376 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.conf.5man@1.96 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.conf.5mdoc@1.96 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.conf.html@1.57 +1 -1
+ NTP_4_2_7P384
+
+ ntpd/ntp.conf.man.in@1.96 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.conf.mdoc.in@1.96 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.keys.5man@1.94 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.keys.5mdoc@1.94 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.keys.html@1.58 +1 -1
+ NTP_4_2_7P384
+
+ ntpd/ntp.keys.man.in@1.94 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntp.keys.mdoc.in@1.94 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntpd-opts.c@1.394 +7 -7
+ NTP_4_2_7P384
+
+ ntpd/ntpd-opts.h@1.394 +9 -9
+ NTP_4_2_7P384
+
+ ntpd/ntpd.1ntpdman@1.205 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntpd.1ntpdmdoc@1.205 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntpd.html@1.52 +2 -2
+ NTP_4_2_7P384
+
+ ntpd/ntpd.man.in@1.205 +3 -3
+ NTP_4_2_7P384
+
+ ntpd/ntpd.mdoc.in@1.205 +3 -3
+ NTP_4_2_7P384
+
+ ntpdc/invoke-ntpdc.texi@1.373 +2 -2
+ NTP_4_2_7P384
+
+ ntpdc/ntpdc-opts.c@1.388 +7 -7
+ NTP_4_2_7P384
+
+ ntpdc/ntpdc-opts.h@1.388 +4 -4
+ NTP_4_2_7P384
+
+ ntpdc/ntpdc.1ntpdcman@1.204 +2 -2
+ NTP_4_2_7P384
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.204 +2 -2
+ NTP_4_2_7P384
+
+ ntpdc/ntpdc.html@1.217 +2 -2
+ NTP_4_2_7P384
+
+ ntpdc/ntpdc.man.in@1.204 +2 -2
+ NTP_4_2_7P384
+
+ ntpdc/ntpdc.mdoc.in@1.204 +2 -2
+ NTP_4_2_7P384
+
+ ntpq/invoke-ntpq.texi@1.377 +2 -2
+ NTP_4_2_7P384
+
+ ntpq/ntpq-opts.c@1.391 +7 -7
+ NTP_4_2_7P384
+
+ ntpq/ntpq-opts.h@1.391 +5 -5
+ NTP_4_2_7P384
+
+ ntpq/ntpq.1ntpqman@1.205 +2 -2
+ NTP_4_2_7P384
+
+ ntpq/ntpq.1ntpqmdoc@1.205 +2 -2
+ NTP_4_2_7P384
+
+ ntpq/ntpq.html@1.49 +2 -2
+ NTP_4_2_7P384
+
+ ntpq/ntpq.man.in@1.205 +2 -2
+ NTP_4_2_7P384
+
+ ntpq/ntpq.mdoc.in@1.205 +2 -2
+ NTP_4_2_7P384
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.376 +2 -2
+ NTP_4_2_7P384
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.391 +7 -7
+ NTP_4_2_7P384
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.391 +5 -5
+ NTP_4_2_7P384
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.205 +3 -3
+ NTP_4_2_7P384
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.205 +3 -3
+ NTP_4_2_7P384
+
+ ntpsnmpd/ntpsnmpd.html@1.47 +1 -1
+ NTP_4_2_7P384
+
+ ntpsnmpd/ntpsnmpd.man.in@1.205 +3 -3
+ NTP_4_2_7P384
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.205 +3 -3
+ NTP_4_2_7P384
+
+ packageinfo.sh@1.387 +1 -1
+ NTP_4_2_7P384
+
+ scripts/invoke-ntp-wait.texi@1.193 +1 -1
+ NTP_4_2_7P384
+
+ scripts/ntp-wait.1ntp-waitman@1.204 +3 -3
+ NTP_4_2_7P384
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.204 +3 -3
+ NTP_4_2_7P384
+
+ scripts/ntp-wait.html@1.209 +1 -1
+ NTP_4_2_7P384
+
+ scripts/ntp-wait.man.in@1.204 +3 -3
+ NTP_4_2_7P384
+
+ scripts/ntp-wait.mdoc.in@1.204 +3 -3
+ NTP_4_2_7P384
+
+ sntp/invoke-sntp.texi@1.373 +2 -2
+ NTP_4_2_7P384
+
+ sntp/sntp-opts.c@1.388 +7 -7
+ NTP_4_2_7P384
+
+ sntp/sntp-opts.h@1.388 +5 -5
+ NTP_4_2_7P384
+
+ sntp/sntp.1sntpman@1.208 +3 -3
+ NTP_4_2_7P384
+
+ sntp/sntp.1sntpmdoc@1.208 +3 -3
+ NTP_4_2_7P384
+
+ sntp/sntp.html@1.388 +2 -2
+ NTP_4_2_7P384
+
+ sntp/sntp.man.in@1.208 +3 -3
+ NTP_4_2_7P384
+
+ sntp/sntp.mdoc.in@1.208 +3 -3
+ NTP_4_2_7P384
+
+ util/invoke-ntp-keygen.texi@1.377 +2 -2
+ NTP_4_2_7P384
+
+ util/ntp-keygen-opts.c@1.391 +7 -7
+ NTP_4_2_7P384
+
+ util/ntp-keygen-opts.h@1.391 +4 -4
+ NTP_4_2_7P384
+
+ util/ntp-keygen.1ntp-keygenman@1.205 +3 -3
+ NTP_4_2_7P384
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.205 +3 -3
+ NTP_4_2_7P384
+
+ util/ntp-keygen.html@1.53 +2 -2
+ NTP_4_2_7P384
+
+ util/ntp-keygen.man.in@1.205 +3 -3
+ NTP_4_2_7P384
+
+ util/ntp-keygen.mdoc.in@1.205 +3 -3
+ NTP_4_2_7P384
+
+ChangeSet@1.2977.1.1, 2013-08-18 01:42:12-04:00, stenn@deacon.udel.edu
+ [Bug 2450] --version has bogus short option
+
+ ChangeLog@1.1326.1.1 +1 -0
+ [Bug 2450] --version has bogus short option
+
+ChangeSet@1.2978, 2013-08-13 07:22:26+00:00, stenn@psp-fb1.ntp.org
+ Note [Bug 2399] Reset sys_kodsent in proto_clr_stats() was fixed in 4.2.7p21
+
+ ChangeLog@1.1327 +1 -0
+ Note [Bug 2399] Reset sys_kodsent in proto_clr_stats() was fixed in 4.2.7p21
+
+ChangeSet@1.2977, 2013-08-10 11:34:05+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P383
+ TAG: NTP_4_2_7P383
+
+ ChangeLog@1.1326 +1 -0
+ NTP_4_2_7P383
+
+ ntpd/invoke-ntp.conf.texi@1.61 +1 -1
+ NTP_4_2_7P383
+
+ ntpd/invoke-ntp.keys.texi@1.59 +1 -1
+ NTP_4_2_7P383
+
+ ntpd/invoke-ntpd.texi@1.375 +2 -2
+ NTP_4_2_7P383
+
+ ntpd/ntp.conf.5man@1.95 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntp.conf.5mdoc@1.95 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntp.conf.html@1.56 +1 -1
+ NTP_4_2_7P383
+
+ ntpd/ntp.conf.man.in@1.95 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntp.conf.mdoc.in@1.95 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntp.keys.5man@1.93 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntp.keys.5mdoc@1.93 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntp.keys.html@1.57 +1 -1
+ NTP_4_2_7P383
+
+ ntpd/ntp.keys.man.in@1.93 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntp.keys.mdoc.in@1.93 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntpd-opts.c@1.393 +7 -7
+ NTP_4_2_7P383
+
+ ntpd/ntpd-opts.h@1.393 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntpd.1ntpdman@1.204 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntpd.1ntpdmdoc@1.204 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntpd.html@1.51 +2 -2
+ NTP_4_2_7P383
+
+ ntpd/ntpd.man.in@1.204 +3 -3
+ NTP_4_2_7P383
+
+ ntpd/ntpd.mdoc.in@1.204 +3 -3
+ NTP_4_2_7P383
+
+ ntpdc/invoke-ntpdc.texi@1.372 +2 -2
+ NTP_4_2_7P383
+
+ ntpdc/ntpdc-opts.c@1.387 +7 -7
+ NTP_4_2_7P383
+
+ ntpdc/ntpdc-opts.h@1.387 +3 -3
+ NTP_4_2_7P383
+
+ ntpdc/ntpdc.1ntpdcman@1.203 +2 -2
+ NTP_4_2_7P383
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.203 +2 -2
+ NTP_4_2_7P383
+
+ ntpdc/ntpdc.html@1.216 +2 -2
+ NTP_4_2_7P383
+
+ ntpdc/ntpdc.man.in@1.203 +2 -2
+ NTP_4_2_7P383
+
+ ntpdc/ntpdc.mdoc.in@1.203 +2 -2
+ NTP_4_2_7P383
+
+ ntpq/invoke-ntpq.texi@1.376 +2 -2
+ NTP_4_2_7P383
+
+ ntpq/ntpq-opts.c@1.390 +7 -7
+ NTP_4_2_7P383
+
+ ntpq/ntpq-opts.h@1.390 +3 -3
+ NTP_4_2_7P383
+
+ ntpq/ntpq.1ntpqman@1.204 +2 -2
+ NTP_4_2_7P383
+
+ ntpq/ntpq.1ntpqmdoc@1.204 +2 -2
+ NTP_4_2_7P383
+
+ ntpq/ntpq.html@1.48 +2 -2
+ NTP_4_2_7P383
+
+ ntpq/ntpq.man.in@1.204 +2 -2
+ NTP_4_2_7P383
+
+ ntpq/ntpq.mdoc.in@1.204 +2 -2
+ NTP_4_2_7P383
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.375 +2 -2
+ NTP_4_2_7P383
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.390 +7 -7
+ NTP_4_2_7P383
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.390 +3 -3
+ NTP_4_2_7P383
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.204 +3 -3
+ NTP_4_2_7P383
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.204 +3 -3
+ NTP_4_2_7P383
+
+ ntpsnmpd/ntpsnmpd.html@1.46 +1 -1
+ NTP_4_2_7P383
+
+ ntpsnmpd/ntpsnmpd.man.in@1.204 +3 -3
+ NTP_4_2_7P383
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.204 +3 -3
+ NTP_4_2_7P383
+
+ packageinfo.sh@1.386 +1 -1
+ NTP_4_2_7P383
+
+ scripts/invoke-ntp-wait.texi@1.192 +1 -1
+ NTP_4_2_7P383
+
+ scripts/ntp-wait.1ntp-waitman@1.203 +3 -3
+ NTP_4_2_7P383
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.203 +3 -3
+ NTP_4_2_7P383
+
+ scripts/ntp-wait.html@1.208 +1 -1
+ NTP_4_2_7P383
+
+ scripts/ntp-wait.man.in@1.203 +3 -3
+ NTP_4_2_7P383
+
+ scripts/ntp-wait.mdoc.in@1.203 +3 -3
+ NTP_4_2_7P383
+
+ sntp/invoke-sntp.texi@1.372 +2 -2
+ NTP_4_2_7P383
+
+ sntp/sntp-opts.c@1.387 +7 -7
+ NTP_4_2_7P383
+
+ sntp/sntp-opts.h@1.387 +3 -3
+ NTP_4_2_7P383
+
+ sntp/sntp.1sntpman@1.207 +3 -3
+ NTP_4_2_7P383
+
+ sntp/sntp.1sntpmdoc@1.207 +3 -3
+ NTP_4_2_7P383
+
+ sntp/sntp.html@1.387 +2 -2
+ NTP_4_2_7P383
+
+ sntp/sntp.man.in@1.207 +3 -3
+ NTP_4_2_7P383
+
+ sntp/sntp.mdoc.in@1.207 +3 -3
+ NTP_4_2_7P383
+
+ util/invoke-ntp-keygen.texi@1.376 +2 -2
+ NTP_4_2_7P383
+
+ util/ntp-keygen-opts.c@1.390 +7 -7
+ NTP_4_2_7P383
+
+ util/ntp-keygen-opts.h@1.390 +3 -3
+ NTP_4_2_7P383
+
+ util/ntp-keygen.1ntp-keygenman@1.204 +3 -3
+ NTP_4_2_7P383
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.204 +3 -3
+ NTP_4_2_7P383
+
+ util/ntp-keygen.html@1.52 +2 -2
+ NTP_4_2_7P383
+
+ util/ntp-keygen.man.in@1.204 +3 -3
+ NTP_4_2_7P383
+
+ util/ntp-keygen.mdoc.in@1.204 +3 -3
+ NTP_4_2_7P383
+
+ChangeSet@1.2976, 2013-08-10 06:47:51-04:00, stenn@deacon.udel.edu
+ (no changes - force a rebuild for a new Coverity scan)
+
+ ChangeLog@1.1325 +1 -0
+ (no changes - force a rebuild for a new Coverity scan)
+
+ChangeSet@1.2975, 2013-08-08 11:38:23+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P382
+ TAG: NTP_4_2_7P382
+
+ ChangeLog@1.1324 +1 -0
+ NTP_4_2_7P382
+
+ ntpd/invoke-ntp.conf.texi@1.60 +1 -1
+ NTP_4_2_7P382
+
+ ntpd/invoke-ntp.keys.texi@1.58 +1 -1
+ NTP_4_2_7P382
+
+ ntpd/invoke-ntpd.texi@1.374 +2 -2
+ NTP_4_2_7P382
+
+ ntpd/ntp.conf.5man@1.94 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntp.conf.5mdoc@1.94 +2 -2
+ NTP_4_2_7P382
+
+ ntpd/ntp.conf.html@1.55 +1 -1
+ NTP_4_2_7P382
+
+ ntpd/ntp.conf.man.in@1.94 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntp.conf.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P382
+
+ ntpd/ntp.keys.5man@1.92 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntp.keys.5mdoc@1.92 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntp.keys.html@1.56 +1 -1
+ NTP_4_2_7P382
+
+ ntpd/ntp.keys.man.in@1.92 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntp.keys.mdoc.in@1.92 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntpd-opts.c@1.392 +7 -7
+ NTP_4_2_7P382
+
+ ntpd/ntpd-opts.h@1.392 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntpd.1ntpdman@1.203 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntpd.1ntpdmdoc@1.203 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntpd.html@1.50 +2 -2
+ NTP_4_2_7P382
+
+ ntpd/ntpd.man.in@1.203 +3 -3
+ NTP_4_2_7P382
+
+ ntpd/ntpd.mdoc.in@1.203 +3 -3
+ NTP_4_2_7P382
+
+ ntpdc/invoke-ntpdc.texi@1.371 +2 -2
+ NTP_4_2_7P382
+
+ ntpdc/ntpdc-opts.c@1.386 +7 -7
+ NTP_4_2_7P382
+
+ ntpdc/ntpdc-opts.h@1.386 +3 -3
+ NTP_4_2_7P382
+
+ ntpdc/ntpdc.1ntpdcman@1.202 +2 -2
+ NTP_4_2_7P382
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.202 +2 -2
+ NTP_4_2_7P382
+
+ ntpdc/ntpdc.html@1.215 +2 -2
+ NTP_4_2_7P382
+
+ ntpdc/ntpdc.man.in@1.202 +2 -2
+ NTP_4_2_7P382
+
+ ntpdc/ntpdc.mdoc.in@1.202 +2 -2
+ NTP_4_2_7P382
+
+ ntpq/invoke-ntpq.texi@1.375 +2 -2
+ NTP_4_2_7P382
+
+ ntpq/ntpq-opts.c@1.389 +7 -7
+ NTP_4_2_7P382
+
+ ntpq/ntpq-opts.h@1.389 +3 -3
+ NTP_4_2_7P382
+
+ ntpq/ntpq.1ntpqman@1.203 +2 -2
+ NTP_4_2_7P382
+
+ ntpq/ntpq.1ntpqmdoc@1.203 +2 -2
+ NTP_4_2_7P382
+
+ ntpq/ntpq.html@1.47 +2 -2
+ NTP_4_2_7P382
+
+ ntpq/ntpq.man.in@1.203 +2 -2
+ NTP_4_2_7P382
+
+ ntpq/ntpq.mdoc.in@1.203 +2 -2
+ NTP_4_2_7P382
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.374 +2 -2
+ NTP_4_2_7P382
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.389 +7 -7
+ NTP_4_2_7P382
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.389 +3 -3
+ NTP_4_2_7P382
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.203 +3 -3
+ NTP_4_2_7P382
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.203 +3 -3
+ NTP_4_2_7P382
+
+ ntpsnmpd/ntpsnmpd.html@1.45 +1 -1
+ NTP_4_2_7P382
+
+ ntpsnmpd/ntpsnmpd.man.in@1.203 +3 -3
+ NTP_4_2_7P382
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.203 +3 -3
+ NTP_4_2_7P382
+
+ packageinfo.sh@1.385 +1 -1
+ NTP_4_2_7P382
+
+ scripts/invoke-ntp-wait.texi@1.191 +1 -1
+ NTP_4_2_7P382
+
+ scripts/ntp-wait.1ntp-waitman@1.202 +3 -3
+ NTP_4_2_7P382
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.202 +3 -3
+ NTP_4_2_7P382
+
+ scripts/ntp-wait.html@1.207 +1 -1
+ NTP_4_2_7P382
+
+ scripts/ntp-wait.man.in@1.202 +3 -3
+ NTP_4_2_7P382
+
+ scripts/ntp-wait.mdoc.in@1.202 +3 -3
+ NTP_4_2_7P382
+
+ sntp/invoke-sntp.texi@1.371 +2 -2
+ NTP_4_2_7P382
+
+ sntp/sntp-opts.c@1.386 +7 -7
+ NTP_4_2_7P382
+
+ sntp/sntp-opts.h@1.386 +3 -3
+ NTP_4_2_7P382
+
+ sntp/sntp.1sntpman@1.206 +3 -3
+ NTP_4_2_7P382
+
+ sntp/sntp.1sntpmdoc@1.206 +3 -3
+ NTP_4_2_7P382
+
+ sntp/sntp.html@1.386 +2 -2
+ NTP_4_2_7P382
+
+ sntp/sntp.man.in@1.206 +3 -3
+ NTP_4_2_7P382
+
+ sntp/sntp.mdoc.in@1.206 +3 -3
+ NTP_4_2_7P382
+
+ util/invoke-ntp-keygen.texi@1.375 +2 -2
+ NTP_4_2_7P382
+
+ util/ntp-keygen-opts.c@1.389 +7 -7
+ NTP_4_2_7P382
+
+ util/ntp-keygen-opts.h@1.389 +3 -3
+ NTP_4_2_7P382
+
+ util/ntp-keygen.1ntp-keygenman@1.203 +3 -3
+ NTP_4_2_7P382
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.203 +3 -3
+ NTP_4_2_7P382
+
+ util/ntp-keygen.html@1.51 +2 -2
+ NTP_4_2_7P382
+
+ util/ntp-keygen.man.in@1.203 +3 -3
+ NTP_4_2_7P382
+
+ util/ntp-keygen.mdoc.in@1.203 +3 -3
+ NTP_4_2_7P382
+
+ChangeSet@1.2974, 2013-08-08 04:18:46-04:00, stenn@deacon.udel.edu
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ChangeLog@1.1323 +15 -14
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ html/miscopt.html@1.75 +3 -3
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ include/ntp_config.h@1.81 +1 -1
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ntpd/invoke-ntp.conf.texi@1.59 +3 -3
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ntpd/ntp.conf.5man@1.93 +4 -4
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ntpd/ntp.conf.5mdoc@1.93 +4 -4
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ntpd/ntp.conf.def@1.9 +2 -2
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ntpd/ntp.conf.man.in@1.93 +4 -4
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ntpd/ntp.conf.mdoc.in@1.93 +4 -4
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ ntpd/ntp_config.c@1.314 +13 -11
+ [Bug 2454] Need way to set file descriptor limit - cleanup
+
+ChangeSet@1.2973, 2013-08-07 11:44:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P381
+ TAG: NTP_4_2_7P381
+
+ ChangeLog@1.1322 +1 -0
+ NTP_4_2_7P381
+
+ ntpd/invoke-ntp.conf.texi@1.58 +1 -1
+ NTP_4_2_7P381
+
+ ntpd/invoke-ntp.keys.texi@1.57 +1 -1
+ NTP_4_2_7P381
+
+ ntpd/invoke-ntpd.texi@1.373 +2 -2
+ NTP_4_2_7P381
+
+ ntpd/ntp.conf.5man@1.92 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntp.conf.5mdoc@1.92 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntp.conf.html@1.54 +1 -1
+ NTP_4_2_7P381
+
+ ntpd/ntp.conf.man.in@1.92 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntp.conf.mdoc.in@1.92 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntp.keys.5man@1.91 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntp.keys.5mdoc@1.91 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntp.keys.html@1.55 +1 -1
+ NTP_4_2_7P381
+
+ ntpd/ntp.keys.man.in@1.91 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntp.keys.mdoc.in@1.91 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntpd-opts.c@1.391 +7 -7
+ NTP_4_2_7P381
+
+ ntpd/ntpd-opts.h@1.391 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntpd.1ntpdman@1.202 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntpd.1ntpdmdoc@1.202 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntpd.html@1.49 +2 -2
+ NTP_4_2_7P381
+
+ ntpd/ntpd.man.in@1.202 +3 -3
+ NTP_4_2_7P381
+
+ ntpd/ntpd.mdoc.in@1.202 +3 -3
+ NTP_4_2_7P381
+
+ ntpdc/invoke-ntpdc.texi@1.370 +2 -2
+ NTP_4_2_7P381
+
+ ntpdc/ntpdc-opts.c@1.385 +7 -7
+ NTP_4_2_7P381
+
+ ntpdc/ntpdc-opts.h@1.385 +3 -3
+ NTP_4_2_7P381
+
+ ntpdc/ntpdc.1ntpdcman@1.201 +2 -2
+ NTP_4_2_7P381
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.201 +2 -2
+ NTP_4_2_7P381
+
+ ntpdc/ntpdc.html@1.214 +2 -2
+ NTP_4_2_7P381
+
+ ntpdc/ntpdc.man.in@1.201 +2 -2
+ NTP_4_2_7P381
+
+ ntpdc/ntpdc.mdoc.in@1.201 +2 -2
+ NTP_4_2_7P381
+
+ ntpq/invoke-ntpq.texi@1.374 +2 -2
+ NTP_4_2_7P381
+
+ ntpq/ntpq-opts.c@1.388 +7 -7
+ NTP_4_2_7P381
+
+ ntpq/ntpq-opts.h@1.388 +3 -3
+ NTP_4_2_7P381
+
+ ntpq/ntpq.1ntpqman@1.202 +2 -2
+ NTP_4_2_7P381
+
+ ntpq/ntpq.1ntpqmdoc@1.202 +2 -2
+ NTP_4_2_7P381
+
+ ntpq/ntpq.html@1.46 +2 -2
+ NTP_4_2_7P381
+
+ ntpq/ntpq.man.in@1.202 +2 -2
+ NTP_4_2_7P381
+
+ ntpq/ntpq.mdoc.in@1.202 +2 -2
+ NTP_4_2_7P381
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.373 +2 -2
+ NTP_4_2_7P381
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.388 +7 -7
+ NTP_4_2_7P381
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.388 +3 -3
+ NTP_4_2_7P381
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.202 +3 -3
+ NTP_4_2_7P381
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.202 +3 -3
+ NTP_4_2_7P381
+
+ ntpsnmpd/ntpsnmpd.html@1.44 +1 -1
+ NTP_4_2_7P381
+
+ ntpsnmpd/ntpsnmpd.man.in@1.202 +3 -3
+ NTP_4_2_7P381
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.202 +3 -3
+ NTP_4_2_7P381
+
+ packageinfo.sh@1.384 +1 -1
+ NTP_4_2_7P381
+
+ scripts/invoke-ntp-wait.texi@1.190 +1 -1
+ NTP_4_2_7P381
+
+ scripts/ntp-wait.1ntp-waitman@1.201 +3 -3
+ NTP_4_2_7P381
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.201 +3 -3
+ NTP_4_2_7P381
+
+ scripts/ntp-wait.html@1.206 +1 -1
+ NTP_4_2_7P381
+
+ scripts/ntp-wait.man.in@1.201 +3 -3
+ NTP_4_2_7P381
+
+ scripts/ntp-wait.mdoc.in@1.201 +3 -3
+ NTP_4_2_7P381
+
+ sntp/invoke-sntp.texi@1.370 +2 -2
+ NTP_4_2_7P381
+
+ sntp/sntp-opts.c@1.385 +7 -7
+ NTP_4_2_7P381
+
+ sntp/sntp-opts.h@1.385 +3 -3
+ NTP_4_2_7P381
+
+ sntp/sntp.1sntpman@1.205 +3 -3
+ NTP_4_2_7P381
+
+ sntp/sntp.1sntpmdoc@1.205 +3 -3
+ NTP_4_2_7P381
+
+ sntp/sntp.html@1.385 +2 -2
+ NTP_4_2_7P381
+
+ sntp/sntp.man.in@1.205 +3 -3
+ NTP_4_2_7P381
+
+ sntp/sntp.mdoc.in@1.205 +3 -3
+ NTP_4_2_7P381
+
+ util/invoke-ntp-keygen.texi@1.374 +2 -2
+ NTP_4_2_7P381
+
+ util/ntp-keygen-opts.c@1.388 +7 -7
+ NTP_4_2_7P381
+
+ util/ntp-keygen-opts.h@1.388 +3 -3
+ NTP_4_2_7P381
+
+ util/ntp-keygen.1ntp-keygenman@1.202 +3 -3
+ NTP_4_2_7P381
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.202 +3 -3
+ NTP_4_2_7P381
+
+ util/ntp-keygen.html@1.50 +2 -2
+ NTP_4_2_7P381
+
+ util/ntp-keygen.man.in@1.202 +3 -3
+ NTP_4_2_7P381
+
+ util/ntp-keygen.mdoc.in@1.202 +3 -3
+ NTP_4_2_7P381
+
+ChangeSet@1.2972, 2013-08-07 06:31:17-04:00, stenn@deacon.udel.edu
+ [Bug 2458] AM_CONFIG_HEADER is obsolete
+
+ sntp/m4/ntp_cacheversion.m4@1.14 +1 -1
+ [Bug 2458] AM_CONFIG_HEADER is obsolete
+
+ChangeSet@1.2971, 2013-08-07 05:59:16-04:00, stenn@deacon.udel.edu
+ [Bug 2458] AM_CONFIG_HEADER is obsolete
+
+ ChangeLog@1.1321 +1 -0
+ [Bug 2458] AM_CONFIG_HEADER is obsolete
+
+ configure.ac@1.561 +1 -1
+ [Bug 2458] AM_CONFIG_HEADER is obsolete
+
+ChangeSet@1.2970, 2013-08-07 05:54:22-04:00, stenn@deacon.udel.edu
+ fix type in miscopt.html - thanks Michael Tatarinov!
+
+ html/miscopt.html@1.74 +1 -1
+ fix type in miscopt.html - thanks Michael Tatarinov!
+
+ChangeSet@1.2966.1.5, 2013-08-07 05:31:26-04:00, stenn@pogo.udel.edu
+ Reorder bug numbers in ChangeLog
+
+ ChangeLog@1.1317.1.4 +3 -2
+ Reorder bug numbers in ChangeLog
+
+ChangeSet@1.2966.1.4, 2013-08-04 01:02:28-04:00, stenn@pogo.udel.edu
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/invoke-ntp.conf.texi@1.57 +5 -3
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/keyword-gen-utd@1.20 +1 -1
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/ntp.conf.5man@1.91 +7 -3
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/ntp.conf.5mdoc@1.91 +6 -3
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/ntp.conf.man.in@1.91 +7 -3
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/ntp.conf.mdoc.in@1.91 +6 -3
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/ntp_keyword.h@1.22 +793 -789
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/ntp_parser.c@1.85 +1448 -1130
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ ntpd/ntp_parser.h@1.51 +321 -313
+ Check in of updated files from Brian's updates for 2451,53,54
+
+ChangeSet@1.2966.1.3, 2013-08-03 15:13:34-04:00, utterback@pogo.udel.edu
+ [Bug 2454] Need way to set file descriptor limit.
+ [Bug 2453] Need a way to avoid calling mlockall.
+ [Bug 2451] rlimit command is missing from the table of contents in miscopt.html
+
+ ChangeLog@1.1317.1.3 +3 -0
+ [Bug 2454] Need way to set file descriptor limit.
+ [Bug 2453] Need a way to avoid calling mlockall.
+ [Bug 2451] rlimit command is missing from the table of contents in miscopt.html
+
+
+ html/miscopt.html@1.73 +3 -1
+ [Bug 2454] Need way to set file descriptor limit.
+ [Bug 2453] Need a way to avoid calling mlockall.
+
+ html/scripts/miscopt.txt@1.9 +1 -0
+ [Bug 2451] rlimit command is missing from the table of contents in miscopt.html
+
+ include/ntp_config.h@1.80 +3 -0
+ [Bug 2453] Need a way to avoid calling mlockall.
+
+ ntpd/keyword-gen.c@1.25 +1 -0
+ [Bug 2454] Need way to set file descriptor limit.
+
+ ntpd/ntp.conf.def@1.8 +4 -1
+ [Bug 2454] Need way to set file descriptor limit.
+ [Bug 2453] Need a way to avoid calling mlockall.
+
+ ntpd/ntp_config.c@1.313 +40 -6
+ [Bug 2454] Need way to set file descriptor limit.
+ [Bug 2453] Need a way to avoid calling mlockall.
+
+ ntpd/ntp_parser.y@1.79 +2 -0
+ [Bug 2454] Need way to set file descriptor limit.
+
+ ntpd/ntpd.c@1.147 +34 -22
+ [Bug 2454] Need way to set file descriptor limit.
+ [Bug 2453] Need a way to avoid calling mlockall.
+
+ChangeSet@1.2966.1.2, 2013-08-03 11:35:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P380
+ TAG: NTP_4_2_7P380
+
+ ChangeLog@1.1317.1.2 +1 -0
+ NTP_4_2_7P380
+
+ ntpd/invoke-ntp.conf.texi@1.56 +1 -1
+ NTP_4_2_7P380
+
+ ntpd/invoke-ntp.keys.texi@1.56 +1 -1
+ NTP_4_2_7P380
+
+ ntpd/invoke-ntpd.texi@1.372 +2 -2
+ NTP_4_2_7P380
+
+ ntpd/ntp.conf.5man@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntp.conf.5mdoc@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntp.conf.html@1.53 +1 -1
+ NTP_4_2_7P380
+
+ ntpd/ntp.conf.man.in@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntp.conf.mdoc.in@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntp.keys.5man@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntp.keys.5mdoc@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntp.keys.html@1.54 +1 -1
+ NTP_4_2_7P380
+
+ ntpd/ntp.keys.man.in@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntp.keys.mdoc.in@1.90 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntpd-opts.c@1.390 +7 -7
+ NTP_4_2_7P380
+
+ ntpd/ntpd-opts.h@1.390 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntpd.1ntpdman@1.201 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntpd.1ntpdmdoc@1.201 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntpd.html@1.48 +2 -2
+ NTP_4_2_7P380
+
+ ntpd/ntpd.man.in@1.201 +3 -3
+ NTP_4_2_7P380
+
+ ntpd/ntpd.mdoc.in@1.201 +3 -3
+ NTP_4_2_7P380
+
+ ntpdc/invoke-ntpdc.texi@1.369 +2 -2
+ NTP_4_2_7P380
+
+ ntpdc/ntpdc-opts.c@1.384 +7 -7
+ NTP_4_2_7P380
+
+ ntpdc/ntpdc-opts.h@1.384 +3 -3
+ NTP_4_2_7P380
+
+ ntpdc/ntpdc.1ntpdcman@1.200 +2 -2
+ NTP_4_2_7P380
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.200 +2 -2
+ NTP_4_2_7P380
+
+ ntpdc/ntpdc.html@1.213 +2 -2
+ NTP_4_2_7P380
+
+ ntpdc/ntpdc.man.in@1.200 +2 -2
+ NTP_4_2_7P380
+
+ ntpdc/ntpdc.mdoc.in@1.200 +2 -2
+ NTP_4_2_7P380
+
+ ntpq/invoke-ntpq.texi@1.373 +2 -2
+ NTP_4_2_7P380
+
+ ntpq/ntpq-opts.c@1.387 +7 -7
+ NTP_4_2_7P380
+
+ ntpq/ntpq-opts.h@1.387 +3 -3
+ NTP_4_2_7P380
+
+ ntpq/ntpq.1ntpqman@1.201 +2 -2
+ NTP_4_2_7P380
+
+ ntpq/ntpq.1ntpqmdoc@1.201 +2 -2
+ NTP_4_2_7P380
+
+ ntpq/ntpq.html@1.45 +2 -2
+ NTP_4_2_7P380
+
+ ntpq/ntpq.man.in@1.201 +2 -2
+ NTP_4_2_7P380
+
+ ntpq/ntpq.mdoc.in@1.201 +2 -2
+ NTP_4_2_7P380
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.372 +2 -2
+ NTP_4_2_7P380
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.387 +7 -7
+ NTP_4_2_7P380
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.387 +3 -3
+ NTP_4_2_7P380
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.201 +3 -3
+ NTP_4_2_7P380
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.201 +3 -3
+ NTP_4_2_7P380
+
+ ntpsnmpd/ntpsnmpd.html@1.43 +1 -1
+ NTP_4_2_7P380
+
+ ntpsnmpd/ntpsnmpd.man.in@1.201 +3 -3
+ NTP_4_2_7P380
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.201 +3 -3
+ NTP_4_2_7P380
+
+ packageinfo.sh@1.383 +1 -1
+ NTP_4_2_7P380
+
+ scripts/invoke-ntp-wait.texi@1.189 +16 -1
+ NTP_4_2_7P380
+
+ scripts/ntp-wait.1ntp-waitman@1.200 +3 -3
+ NTP_4_2_7P380
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.200 +3 -3
+ NTP_4_2_7P380
+
+ scripts/ntp-wait.html@1.205 +17 -1
+ NTP_4_2_7P380
+
+ scripts/ntp-wait.man.in@1.200 +3 -3
+ NTP_4_2_7P380
+
+ scripts/ntp-wait.mdoc.in@1.200 +3 -3
+ NTP_4_2_7P380
+
+ sntp/invoke-sntp.texi@1.369 +2 -2
+ NTP_4_2_7P380
+
+ sntp/sntp-opts.c@1.384 +7 -7
+ NTP_4_2_7P380
+
+ sntp/sntp-opts.h@1.384 +3 -3
+ NTP_4_2_7P380
+
+ sntp/sntp.1sntpman@1.204 +3 -3
+ NTP_4_2_7P380
+
+ sntp/sntp.1sntpmdoc@1.204 +3 -3
+ NTP_4_2_7P380
+
+ sntp/sntp.html@1.384 +2 -2
+ NTP_4_2_7P380
+
+ sntp/sntp.man.in@1.204 +3 -3
+ NTP_4_2_7P380
+
+ sntp/sntp.mdoc.in@1.204 +3 -3
+ NTP_4_2_7P380
+
+ util/invoke-ntp-keygen.texi@1.373 +2 -2
+ NTP_4_2_7P380
+
+ util/ntp-keygen-opts.c@1.387 +7 -7
+ NTP_4_2_7P380
+
+ util/ntp-keygen-opts.h@1.387 +3 -3
+ NTP_4_2_7P380
+
+ util/ntp-keygen.1ntp-keygenman@1.201 +3 -3
+ NTP_4_2_7P380
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.201 +3 -3
+ NTP_4_2_7P380
+
+ util/ntp-keygen.html@1.49 +2 -2
+ NTP_4_2_7P380
+
+ util/ntp-keygen.man.in@1.201 +3 -3
+ NTP_4_2_7P380
+
+ util/ntp-keygen.mdoc.in@1.201 +3 -3
+ NTP_4_2_7P380
+
+ChangeSet@1.2966.1.1, 2013-08-03 05:35:28-04:00, stenn@deacon.udel.edu
+ CID 984511: Some systems have different printf needs for sizeof
+
+ ChangeLog@1.1317.1.1 +1 -0
+ CID 984511: Some systems have different printf needs for sizeof
+
+ sntp/main.c@1.92 +1 -1
+ CID 984511: Some systems have different printf needs for sizeof
+
+ChangeSet@1.2967, 2013-08-03 08:15:49+00:00, kardel@pogo.udel.edu
+ ChangeLog ntpd.h, ntp_io.c:
+ [Bug 2452] provide io_handler/input_handler only on non HAVE_IO_COMPLETION_PORT platforms
+
+ ChangeLog@1.1318 +2 -0
+ [Bug 2452] provide io_handler/input_handler only on non HAVE_IO_COMPLETION_PORT platforms
+
+ include/ntpd.h@1.178 +2 -0
+ [Bug 2452] provide io_handler/input_handler only on HAVE_IO_COMPLETION platforms
+
+ ntpd/ntp_io.c@1.382 +64 -64
+ [Bug 2452] provide io_handler/input_handler only on HAVE_IO_COMPLETION platforms
+
+ChangeSet@1.2966, 2013-08-02 11:37:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P379
+ TAG: NTP_4_2_7P379
+
+ ChangeLog@1.1317 +1 -0
+ NTP_4_2_7P379
+
+ ntpd/invoke-ntp.conf.texi@1.55 +1 -1
+ NTP_4_2_7P379
+
+ ntpd/invoke-ntp.keys.texi@1.55 +1 -1
+ NTP_4_2_7P379
+
+ ntpd/invoke-ntpd.texi@1.371 +2 -2
+ NTP_4_2_7P379
+
+ ntpd/ntp.conf.5man@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntp.conf.5mdoc@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntp.conf.html@1.52 +1 -1
+ NTP_4_2_7P379
+
+ ntpd/ntp.conf.man.in@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntp.conf.mdoc.in@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntp.keys.5man@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntp.keys.5mdoc@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntp.keys.html@1.53 +1 -1
+ NTP_4_2_7P379
+
+ ntpd/ntp.keys.man.in@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntp.keys.mdoc.in@1.89 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntpd-opts.c@1.389 +7 -7
+ NTP_4_2_7P379
+
+ ntpd/ntpd-opts.h@1.389 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntpd.1ntpdman@1.200 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntpd.1ntpdmdoc@1.200 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntpd.html@1.47 +2 -2
+ NTP_4_2_7P379
+
+ ntpd/ntpd.man.in@1.200 +3 -3
+ NTP_4_2_7P379
+
+ ntpd/ntpd.mdoc.in@1.200 +3 -3
+ NTP_4_2_7P379
+
+ ntpdc/invoke-ntpdc.texi@1.368 +2 -2
+ NTP_4_2_7P379
+
+ ntpdc/ntpdc-opts.c@1.383 +7 -7
+ NTP_4_2_7P379
+
+ ntpdc/ntpdc-opts.h@1.383 +3 -3
+ NTP_4_2_7P379
+
+ ntpdc/ntpdc.1ntpdcman@1.199 +2 -2
+ NTP_4_2_7P379
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.199 +2 -2
+ NTP_4_2_7P379
+
+ ntpdc/ntpdc.html@1.212 +2 -2
+ NTP_4_2_7P379
+
+ ntpdc/ntpdc.man.in@1.199 +2 -2
+ NTP_4_2_7P379
+
+ ntpdc/ntpdc.mdoc.in@1.199 +2 -2
+ NTP_4_2_7P379
+
+ ntpq/invoke-ntpq.texi@1.372 +2 -2
+ NTP_4_2_7P379
+
+ ntpq/ntpq-opts.c@1.386 +7 -7
+ NTP_4_2_7P379
+
+ ntpq/ntpq-opts.h@1.386 +3 -3
+ NTP_4_2_7P379
+
+ ntpq/ntpq.1ntpqman@1.200 +2 -2
+ NTP_4_2_7P379
+
+ ntpq/ntpq.1ntpqmdoc@1.200 +2 -2
+ NTP_4_2_7P379
+
+ ntpq/ntpq.html@1.44 +2 -2
+ NTP_4_2_7P379
+
+ ntpq/ntpq.man.in@1.200 +2 -2
+ NTP_4_2_7P379
+
+ ntpq/ntpq.mdoc.in@1.200 +2 -2
+ NTP_4_2_7P379
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.371 +2 -2
+ NTP_4_2_7P379
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.386 +7 -7
+ NTP_4_2_7P379
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.386 +3 -3
+ NTP_4_2_7P379
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.200 +3 -3
+ NTP_4_2_7P379
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.200 +3 -3
+ NTP_4_2_7P379
+
+ ntpsnmpd/ntpsnmpd.html@1.42 +1 -1
+ NTP_4_2_7P379
+
+ ntpsnmpd/ntpsnmpd.man.in@1.200 +3 -3
+ NTP_4_2_7P379
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.200 +3 -3
+ NTP_4_2_7P379
+
+ packageinfo.sh@1.382 +1 -1
+ NTP_4_2_7P379
+
+ scripts/invoke-ntp-wait.texi@1.188 +1 -16
+ NTP_4_2_7P379
+
+ scripts/ntp-wait.1ntp-waitman@1.199 +3 -3
+ NTP_4_2_7P379
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.199 +3 -3
+ NTP_4_2_7P379
+
+ scripts/ntp-wait.html@1.204 +1 -17
+ NTP_4_2_7P379
+
+ scripts/ntp-wait.man.in@1.199 +3 -3
+ NTP_4_2_7P379
+
+ scripts/ntp-wait.mdoc.in@1.199 +3 -3
+ NTP_4_2_7P379
+
+ sntp/invoke-sntp.texi@1.368 +2 -2
+ NTP_4_2_7P379
+
+ sntp/sntp-opts.c@1.383 +7 -7
+ NTP_4_2_7P379
+
+ sntp/sntp-opts.h@1.383 +3 -3
+ NTP_4_2_7P379
+
+ sntp/sntp.1sntpman@1.203 +3 -3
+ NTP_4_2_7P379
+
+ sntp/sntp.1sntpmdoc@1.203 +3 -3
+ NTP_4_2_7P379
+
+ sntp/sntp.html@1.383 +2 -2
+ NTP_4_2_7P379
+
+ sntp/sntp.man.in@1.203 +3 -3
+ NTP_4_2_7P379
+
+ sntp/sntp.mdoc.in@1.203 +3 -3
+ NTP_4_2_7P379
+
+ util/invoke-ntp-keygen.texi@1.372 +2 -2
+ NTP_4_2_7P379
+
+ util/ntp-keygen-opts.c@1.386 +7 -7
+ NTP_4_2_7P379
+
+ util/ntp-keygen-opts.h@1.386 +3 -3
+ NTP_4_2_7P379
+
+ util/ntp-keygen.1ntp-keygenman@1.200 +3 -3
+ NTP_4_2_7P379
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.200 +3 -3
+ NTP_4_2_7P379
+
+ util/ntp-keygen.html@1.48 +2 -2
+ NTP_4_2_7P379
+
+ util/ntp-keygen.man.in@1.200 +3 -3
+ NTP_4_2_7P379
+
+ util/ntp-keygen.mdoc.in@1.200 +3 -3
+ NTP_4_2_7P379
+
+ChangeSet@1.2965, 2013-08-02 06:30:59-04:00, stenn@deacon.udel.edu
+ CID 739724: Fix printf arg mismatch in a debug line
+
+ sntp/main.c@1.91 +1 -1
+ CID 739724: Fix printf arg mismatch in a debug line
+
+ChangeSet@1.2964, 2013-08-02 06:28:46-04:00, stenn@deacon.udel.edu
+ CID 739724: Fix printf arg mismatch in a debug line
+
+ ChangeLog@1.1316 +1 -0
+ CID 739724: Fix printf arg mismatch in a debug line
+
+ sntp/main.c@1.90 +1 -1
+ CID 739724: Fix printf arg mismatch in a debug line
+
+ChangeSet@1.2963, 2013-08-02 06:08:47+00:00, kardel@pogo.udel.edu
+ ChangeLog ntp_io.c:
+ [Bug 2425] compile io_handler() in ntp_io.c unconditionally
+
+ ChangeLog@1.1315 +1 -0
+ [Bug 2425] compile io_handler() in ntp_io.c unconditionally
+
+ ntpd/ntp_io.c@1.381 +7 -8
+ place io_handler outside of HAVE_ROUTING_SOCKET conditional
+
+ChangeSet@1.2962, 2013-08-01 17:58:31-04:00, stenn@deacon.udel.edu
+ [Bug 2448] Fix checks for configure --with-stack-limit and --with-memlock values
+
+ ChangeLog@1.1314 +2 -0
+ [Bug 2448] Fix checks for configure --with-stack-limit and --with-memlock values
+
+ configure.ac@1.560 +2 -2
+ [Bug 2448] Fix checks for configure --with-stack-limit and --with-memlock values
+
+ChangeSet@1.2961, 2013-08-01 06:45:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P378
+ TAG: NTP_4_2_7P378
+
+ ChangeLog@1.1313 +1 -0
+ NTP_4_2_7P378
+
+ ntpd/invoke-ntp.conf.texi@1.54 +1 -1
+ NTP_4_2_7P378
+
+ ntpd/invoke-ntp.keys.texi@1.54 +1 -1
+ NTP_4_2_7P378
+
+ ntpd/invoke-ntpd.texi@1.370 +2 -2
+ NTP_4_2_7P378
+
+ ntpd/ntp.conf.5man@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntp.conf.5mdoc@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntp.conf.html@1.51 +1 -1
+ NTP_4_2_7P378
+
+ ntpd/ntp.conf.man.in@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntp.conf.mdoc.in@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntp.keys.5man@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntp.keys.5mdoc@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntp.keys.html@1.52 +1 -1
+ NTP_4_2_7P378
+
+ ntpd/ntp.keys.man.in@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntp.keys.mdoc.in@1.88 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntpd-opts.c@1.388 +7 -7
+ NTP_4_2_7P378
+
+ ntpd/ntpd-opts.h@1.388 +3 -3
+ NTP_4_2_7P378
+
+ ntpd/ntpd.1ntpdman@1.199 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntpd.1ntpdmdoc@1.199 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntpd.html@1.46 +2 -2
+ NTP_4_2_7P378
+
+ ntpd/ntpd.man.in@1.199 +22 -3
+ NTP_4_2_7P378
+
+ ntpd/ntpd.mdoc.in@1.199 +22 -3
+ NTP_4_2_7P378
+
+ ntpdc/invoke-ntpdc.texi@1.367 +2 -2
+ NTP_4_2_7P378
+
+ ntpdc/ntpdc-opts.c@1.382 +7 -7
+ NTP_4_2_7P378
+
+ ntpdc/ntpdc-opts.h@1.382 +3 -3
+ NTP_4_2_7P378
+
+ ntpdc/ntpdc.1ntpdcman@1.198 +21 -2
+ NTP_4_2_7P378
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.198 +21 -2
+ NTP_4_2_7P378
+
+ ntpdc/ntpdc.html@1.211 +57 -77
+ NTP_4_2_7P378
+
+ ntpdc/ntpdc.man.in@1.198 +21 -2
+ NTP_4_2_7P378
+
+ ntpdc/ntpdc.mdoc.in@1.198 +21 -2
+ NTP_4_2_7P378
+
+ ntpq/invoke-ntpq.texi@1.371 +2 -2
+ NTP_4_2_7P378
+
+ ntpq/ntpq-opts.c@1.385 +7 -7
+ NTP_4_2_7P378
+
+ ntpq/ntpq-opts.h@1.385 +3 -3
+ NTP_4_2_7P378
+
+ ntpq/ntpq.1ntpqman@1.199 +21 -2
+ NTP_4_2_7P378
+
+ ntpq/ntpq.1ntpqmdoc@1.199 +21 -2
+ NTP_4_2_7P378
+
+ ntpq/ntpq.html@1.43 +2 -2
+ NTP_4_2_7P378
+
+ ntpq/ntpq.man.in@1.199 +21 -2
+ NTP_4_2_7P378
+
+ ntpq/ntpq.mdoc.in@1.199 +21 -2
+ NTP_4_2_7P378
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.370 +2 -2
+ NTP_4_2_7P378
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.385 +7 -7
+ NTP_4_2_7P378
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.385 +3 -3
+ NTP_4_2_7P378
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.199 +22 -3
+ NTP_4_2_7P378
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.199 +22 -3
+ NTP_4_2_7P378
+
+ ntpsnmpd/ntpsnmpd.html@1.41 +1 -1
+ NTP_4_2_7P378
+
+ ntpsnmpd/ntpsnmpd.man.in@1.199 +22 -3
+ NTP_4_2_7P378
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.199 +22 -3
+ NTP_4_2_7P378
+
+ packageinfo.sh@1.381 +1 -1
+ NTP_4_2_7P378
+
+ scripts/invoke-ntp-wait.texi@1.187 +3 -3
+ NTP_4_2_7P378
+
+ scripts/ntp-wait.1ntp-waitman@1.198 +22 -3
+ NTP_4_2_7P378
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.198 +22 -3
+ NTP_4_2_7P378
+
+ scripts/ntp-wait.html@1.203 +40 -62
+ NTP_4_2_7P378
+
+ scripts/ntp-wait.man.in@1.198 +22 -3
+ NTP_4_2_7P378
+
+ scripts/ntp-wait.mdoc.in@1.198 +22 -3
+ NTP_4_2_7P378
+
+ sntp/invoke-sntp.texi@1.367 +2 -2
+ NTP_4_2_7P378
+
+ sntp/sntp-opts.c@1.382 +7 -7
+ NTP_4_2_7P378
+
+ sntp/sntp-opts.h@1.382 +3 -3
+ NTP_4_2_7P378
+
+ sntp/sntp.1sntpman@1.202 +22 -3
+ NTP_4_2_7P378
+
+ sntp/sntp.1sntpmdoc@1.202 +22 -3
+ NTP_4_2_7P378
+
+ sntp/sntp.html@1.382 +87 -112
+ NTP_4_2_7P378
+
+ sntp/sntp.man.in@1.202 +22 -3
+ NTP_4_2_7P378
+
+ sntp/sntp.mdoc.in@1.202 +22 -3
+ NTP_4_2_7P378
+
+ util/invoke-ntp-keygen.texi@1.371 +2 -2
+ NTP_4_2_7P378
+
+ util/ntp-keygen-opts.c@1.385 +7 -7
+ NTP_4_2_7P378
+
+ util/ntp-keygen-opts.h@1.385 +3 -3
+ NTP_4_2_7P378
+
+ util/ntp-keygen.1ntp-keygenman@1.199 +22 -3
+ NTP_4_2_7P378
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.199 +22 -3
+ NTP_4_2_7P378
+
+ util/ntp-keygen.html@1.47 +2 -2
+ NTP_4_2_7P378
+
+ util/ntp-keygen.man.in@1.199 +22 -3
+ NTP_4_2_7P378
+
+ util/ntp-keygen.mdoc.in@1.199 +22 -3
+ NTP_4_2_7P378
+
+ChangeSet@1.2960, 2013-08-01 01:34:34-04:00, stenn@deacon.udel.edu
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ ChangeLog@1.1312 +1 -0
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ include/ntp_stdlib.h@1.75 +11 -10
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ include/ntp_worker.h@1.3 +2 -2
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ include/ntpd.h@1.177 +2 -2
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ libntp/ntp_random.c@1.10 +5 -5
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ ntpd/refclock_oncore.c@1.98 +1 -1
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ sntp/libevent/minheap-internal.h@1.5 +1 -2
+ [Bug 2446] Quiet warnings from Oracle's Studio compiler
+
+ChangeSet@1.2957.1.3, 2013-08-01 02:39:32+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to AutoGen-5.18.1pre3
+
+ ChangeLog@1.1307.1.2 +1 -0
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/invoke-ntp.conf.texi@1.53 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/invoke-ntp.keys.texi@1.53 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/invoke-ntpd.texi@1.369 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.conf.5man@1.87 +11 -30
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.conf.5mdoc@1.87 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.conf.man.in@1.87 +11 -30
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.conf.mdoc.in@1.87 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.keys.5man@1.87 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.keys.5mdoc@1.87 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.keys.man.in@1.87 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntp.keys.mdoc.in@1.87 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpd-opts.c@1.387 +66 -66
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpd-opts.h@1.387 +3 -3
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpd.1ntpdman@1.198 +44 -63
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpd.1ntpdmdoc@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpd.man.in@1.198 +44 -63
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpd.mdoc.in@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpdsim-opts.c@1.22 +324 -167
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpd/ntpdsim-opts.h@1.22 +47 -25
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/invoke-ntpdc.texi@1.366 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/ntpdc-opts.c@1.381 +67 -67
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/ntpdc-opts.h@1.381 +3 -3
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/ntpdc.1ntpdcman@1.197 +17 -36
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.197 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/ntpdc.html@1.210 +75 -55
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/ntpdc.man.in@1.197 +17 -36
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpdc/ntpdc.mdoc.in@1.197 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpq/invoke-ntpq.texi@1.370 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpq/ntpq-opts.c@1.384 +67 -67
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpq/ntpq-opts.h@1.384 +3 -3
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpq/ntpq.1ntpqman@1.198 +15 -34
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpq/ntpq.1ntpqmdoc@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpq/ntpq.man.in@1.198 +15 -34
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpq/ntpq.mdoc.in@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.369 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.384 +67 -67
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.384 +3 -3
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.198 +5 -24
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpsnmpd/ntpsnmpd.man.in@1.198 +5 -24
+ Upgrade to AutoGen-5.18.1pre3
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ scripts/invoke-ntp-wait.texi@1.186 +3 -3
+ Upgrade to AutoGen-5.18.1pre3
+
+ scripts/ntp-wait.1ntp-waitman@1.197 +6 -25
+ Upgrade to AutoGen-5.18.1pre3
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.197 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ scripts/ntp-wait.html@1.202 +61 -39
+ Upgrade to AutoGen-5.18.1pre3
+
+ scripts/ntp-wait.man.in@1.197 +6 -25
+ Upgrade to AutoGen-5.18.1pre3
+
+ scripts/ntp-wait.mdoc.in@1.197 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/include/autogen-version.def@1.18 +2 -2
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/invoke-sntp.texi@1.366 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/sntp-opts.c@1.381 +67 -67
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/sntp-opts.h@1.381 +3 -3
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/sntp.1sntpman@1.201 +20 -39
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/sntp.1sntpmdoc@1.201 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/sntp.html@1.381 +110 -85
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/sntp.man.in@1.201 +20 -39
+ Upgrade to AutoGen-5.18.1pre3
+
+ sntp/sntp.mdoc.in@1.201 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ util/invoke-ntp-keygen.texi@1.370 +1 -1
+ Upgrade to AutoGen-5.18.1pre3
+
+ util/ntp-keygen-opts.c@1.384 +67 -67
+ Upgrade to AutoGen-5.18.1pre3
+
+ util/ntp-keygen-opts.h@1.384 +3 -3
+ Upgrade to AutoGen-5.18.1pre3
+
+ util/ntp-keygen.1ntp-keygenman@1.198 +45 -64
+ Upgrade to AutoGen-5.18.1pre3
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ util/ntp-keygen.man.in@1.198 +45 -64
+ Upgrade to AutoGen-5.18.1pre3
+
+ util/ntp-keygen.mdoc.in@1.198 +3 -22
+ Upgrade to AutoGen-5.18.1pre3
+
+ChangeSet@1.2957.1.2, 2013-08-01 02:05:18+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to libopts-40.1.15
+
+ ChangeLog@1.1307.1.1 +1 -0
+ Upgrade to libopts-40.1.15
+
+ChangeSet@1.2957.1.1, 2013-08-01 02:03:52+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/Makefile.am@1.22 +6 -6
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/ag-char-map.h@1.25 +5 -5
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/ao-strs.c@1.11 +1 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/ao-strs.h@1.10 +1 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/autoopts.c@1.18 +22 -22
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/autoopts.h@1.16 +11 -0
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/autoopts/options.h@1.24 +4 -4
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/autoopts/usage-txt.h@1.24 +61 -61
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/compat/pathfind.c@1.10 +22 -76
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/compat/strchr.c@1.4 +2 -2
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/configfile.c@1.20 +12 -5
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/find.c@1.9 +10 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/genshell.c@1.25 +20 -20
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/genshell.h@1.25 +3 -3
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/init.c@1.5 +6 -6
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/load.c@1.18 +164 -117
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/m4/libopts.m4@1.28 +1 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/option-value-type.c@1.12 +1 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/option-value-type.h@1.26 +1 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/option-xat-attribute.c@1.12 +1 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/option-xat-attribute.h@1.26 +1 -1
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/pgusage.c@1.15 +4 -0
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/proto.h@1.25 +3 -3
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/streqvcmp.c@1.14 +2 -2
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/text_mmap.c@1.15 +25 -18
+ Upgrade to libopts-40.1.15
+
+ sntp/libopts/usage.c@1.18 +1 -0
+ Upgrade to libopts-40.1.15
+
+ChangeSet@1.2958, 2013-07-31 08:45:06+00:00, kardel@pogo.udel.edu
+ ntpd.c, ntp_io.c, ChangeLog, ntpd.h, iosignal.h:
+ [Bug 2425] move part of input handler code from ntpd.c to ntp_io.c
+ and fix select() only platforms calling input_handler directly.
+
+ ChangeLog@1.1310 +1 -1
+ fix wording
+
+ ChangeLog@1.1309 +1 -1
+ fix spelling
+
+ ChangeLog@1.1308 +2 -0
+ [Bug 2425] move part of inputhandle code from ntpd.c to ntp_io.c
+ and fix select() only platforms callint input_handler.
+
+ include/iosignal.h@1.8 +3 -3
+ [Bug 2425] move part of inputhandle code from ntpd.c to ntp_io.c
+ and fix select() only platforms callint input_handler.
+
+ include/ntpd.h@1.176 +1 -3
+ [Bug 2425] move part of inputhandle code from ntpd.c to ntp_io.c
+ and fix select() only platforms callint input_handler..
+
+ ntpd/ntp_io.c@1.380 +69 -4
+ [Bug 2425] move part of inputhandle code from ntpd.c to ntp_io.c
+ and fix select() only platforms callint input_handler.
+
+ ntpd/ntpd.c@1.146 +6 -61
+ [Bug 2425] move part of inputhandle code from ntpd.c to ntp_io.c
+ and fix select() only platforms callint input_handler..
+
+ChangeSet@1.2957, 2013-07-28 11:41:08+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P377
+ TAG: NTP_4_2_7P377
+
+ ChangeLog@1.1307 +1 -0
+ NTP_4_2_7P377
+
+ ntpd/invoke-ntp.conf.texi@1.52 +1 -1
+ NTP_4_2_7P377
+
+ ntpd/invoke-ntp.keys.texi@1.52 +1 -1
+ NTP_4_2_7P377
+
+ ntpd/invoke-ntpd.texi@1.368 +2 -2
+ NTP_4_2_7P377
+
+ ntpd/ntp.conf.5man@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntp.conf.5mdoc@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntp.conf.html@1.50 +1 -1
+ NTP_4_2_7P377
+
+ ntpd/ntp.conf.man.in@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntp.conf.mdoc.in@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntp.keys.5man@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntp.keys.5mdoc@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntp.keys.html@1.51 +1 -1
+ NTP_4_2_7P377
+
+ ntpd/ntp.keys.man.in@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntp.keys.mdoc.in@1.86 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntpd-opts.c@1.386 +7 -7
+ NTP_4_2_7P377
+
+ ntpd/ntpd-opts.h@1.386 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntpd.1ntpdman@1.197 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntpd.1ntpdmdoc@1.197 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntpd.html@1.45 +2 -2
+ NTP_4_2_7P377
+
+ ntpd/ntpd.man.in@1.197 +3 -3
+ NTP_4_2_7P377
+
+ ntpd/ntpd.mdoc.in@1.197 +3 -3
+ NTP_4_2_7P377
+
+ ntpdc/invoke-ntpdc.texi@1.365 +2 -2
+ NTP_4_2_7P377
+
+ ntpdc/ntpdc-opts.c@1.380 +7 -7
+ NTP_4_2_7P377
+
+ ntpdc/ntpdc-opts.h@1.380 +3 -3
+ NTP_4_2_7P377
+
+ ntpdc/ntpdc.1ntpdcman@1.196 +2 -2
+ NTP_4_2_7P377
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.196 +2 -2
+ NTP_4_2_7P377
+
+ ntpdc/ntpdc.html@1.209 +2 -2
+ NTP_4_2_7P377
+
+ ntpdc/ntpdc.man.in@1.196 +2 -2
+ NTP_4_2_7P377
+
+ ntpdc/ntpdc.mdoc.in@1.196 +2 -2
+ NTP_4_2_7P377
+
+ ntpq/invoke-ntpq.texi@1.369 +2 -2
+ NTP_4_2_7P377
+
+ ntpq/ntpq-opts.c@1.383 +7 -7
+ NTP_4_2_7P377
+
+ ntpq/ntpq-opts.h@1.383 +3 -3
+ NTP_4_2_7P377
+
+ ntpq/ntpq.1ntpqman@1.197 +2 -2
+ NTP_4_2_7P377
+
+ ntpq/ntpq.1ntpqmdoc@1.197 +2 -2
+ NTP_4_2_7P377
+
+ ntpq/ntpq.html@1.42 +2 -2
+ NTP_4_2_7P377
+
+ ntpq/ntpq.man.in@1.197 +2 -2
+ NTP_4_2_7P377
+
+ ntpq/ntpq.mdoc.in@1.197 +2 -2
+ NTP_4_2_7P377
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.368 +2 -2
+ NTP_4_2_7P377
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.383 +7 -7
+ NTP_4_2_7P377
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.383 +3 -3
+ NTP_4_2_7P377
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.197 +3 -3
+ NTP_4_2_7P377
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.197 +3 -3
+ NTP_4_2_7P377
+
+ ntpsnmpd/ntpsnmpd.html@1.40 +1 -1
+ NTP_4_2_7P377
+
+ ntpsnmpd/ntpsnmpd.man.in@1.197 +3 -3
+ NTP_4_2_7P377
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.197 +3 -3
+ NTP_4_2_7P377
+
+ packageinfo.sh@1.380 +1 -1
+ NTP_4_2_7P377
+
+ scripts/invoke-ntp-wait.texi@1.185 +1 -1
+ NTP_4_2_7P377
+
+ scripts/ntp-wait.1ntp-waitman@1.196 +3 -3
+ NTP_4_2_7P377
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.196 +3 -3
+ NTP_4_2_7P377
+
+ scripts/ntp-wait.html@1.201 +1 -1
+ NTP_4_2_7P377
+
+ scripts/ntp-wait.man.in@1.196 +3 -3
+ NTP_4_2_7P377
+
+ scripts/ntp-wait.mdoc.in@1.196 +3 -3
+ NTP_4_2_7P377
+
+ sntp/invoke-sntp.texi@1.365 +2 -2
+ NTP_4_2_7P377
+
+ sntp/sntp-opts.c@1.380 +7 -7
+ NTP_4_2_7P377
+
+ sntp/sntp-opts.h@1.380 +3 -3
+ NTP_4_2_7P377
+
+ sntp/sntp.1sntpman@1.200 +3 -3
+ NTP_4_2_7P377
+
+ sntp/sntp.1sntpmdoc@1.200 +3 -3
+ NTP_4_2_7P377
+
+ sntp/sntp.html@1.380 +2 -2
+ NTP_4_2_7P377
+
+ sntp/sntp.man.in@1.200 +3 -3
+ NTP_4_2_7P377
+
+ sntp/sntp.mdoc.in@1.200 +3 -3
+ NTP_4_2_7P377
+
+ util/invoke-ntp-keygen.texi@1.369 +2 -2
+ NTP_4_2_7P377
+
+ util/ntp-keygen-opts.c@1.383 +7 -7
+ NTP_4_2_7P377
+
+ util/ntp-keygen-opts.h@1.383 +3 -3
+ NTP_4_2_7P377
+
+ util/ntp-keygen.1ntp-keygenman@1.197 +3 -3
+ NTP_4_2_7P377
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.197 +3 -3
+ NTP_4_2_7P377
+
+ util/ntp-keygen.html@1.46 +2 -2
+ NTP_4_2_7P377
+
+ util/ntp-keygen.man.in@1.197 +3 -3
+ NTP_4_2_7P377
+
+ util/ntp-keygen.mdoc.in@1.197 +3 -3
+ NTP_4_2_7P377
+
+ChangeSet@1.2956, 2013-07-28 04:16:23-04:00, stenn@deacon.udel.edu
+ [Bug 2397] License/copyright cleanup
+
+ ChangeLog@1.1306 +1 -0
+ [Bug 2397] License/copyright cleanup
+
+ include/timepps-SCO.h@1.3 +1 -1
+ [Bug 2397] License/copyright cleanup
+
+ include/timepps-Solaris.h@1.7 +1 -1
+ [Bug 2397] License/copyright cleanup
+
+ include/timepps-SunOS.h@1.4 +1 -1
+ [Bug 2397] License/copyright cleanup
+
+ ports/winnt/include/timepps.h@1.3 +1 -1
+ [Bug 2397] License/copyright cleanup
+
+ ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h@1.2 +1 -1
+ [Bug 2397] License/copyright cleanup
+
+ ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt@1.2 +1 -1
+ [Bug 2397] License/copyright cleanup
+
+ ports/winnt/ppsapi/loopback/src/timepps.h@1.2 +1 -1
+ [Bug 2397] License/copyright cleanup
+
+ChangeSet@1.2955, 2013-07-28 02:28:23-04:00, stenn@deacon.udel.edu
+ [Bug 2439] Fix check of EscapeCommFunction() in ports/winnt/libntp/termios.c
+
+ ChangeLog@1.1305 +1 -0
+ [Bug 2439] Fix check of EscapeCommFunction() in ports/winnt/libntp/termios.c
+
+ ports/winnt/libntp/termios.c@1.29 +2 -2
+ [Bug 2439] Fix check of EscapeCommFunction() in ports/winnt/libntp/termios.c
+
+ChangeSet@1.2954, 2013-07-24 11:38:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P376
+ TAG: NTP_4_2_7P376
+
+ ChangeLog@1.1304 +1 -0
+ NTP_4_2_7P376
+
+ ntpd/invoke-ntp.conf.texi@1.51 +1 -1
+ NTP_4_2_7P376
+
+ ntpd/invoke-ntp.keys.texi@1.51 +1 -1
+ NTP_4_2_7P376
+
+ ntpd/invoke-ntpd.texi@1.367 +2 -2
+ NTP_4_2_7P376
+
+ ntpd/ntp.conf.5man@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntp.conf.5mdoc@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntp.conf.html@1.49 +1 -1
+ NTP_4_2_7P376
+
+ ntpd/ntp.conf.man.in@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntp.conf.mdoc.in@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntp.keys.5man@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntp.keys.5mdoc@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntp.keys.html@1.50 +1 -1
+ NTP_4_2_7P376
+
+ ntpd/ntp.keys.man.in@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntp.keys.mdoc.in@1.85 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntpd-opts.c@1.385 +7 -7
+ NTP_4_2_7P376
+
+ ntpd/ntpd-opts.h@1.385 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntpd.1ntpdman@1.196 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntpd.1ntpdmdoc@1.196 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntpd.html@1.44 +2 -2
+ NTP_4_2_7P376
+
+ ntpd/ntpd.man.in@1.196 +3 -3
+ NTP_4_2_7P376
+
+ ntpd/ntpd.mdoc.in@1.196 +3 -3
+ NTP_4_2_7P376
+
+ ntpdc/invoke-ntpdc.texi@1.364 +2 -2
+ NTP_4_2_7P376
+
+ ntpdc/ntpdc-opts.c@1.379 +7 -7
+ NTP_4_2_7P376
+
+ ntpdc/ntpdc-opts.h@1.379 +3 -3
+ NTP_4_2_7P376
+
+ ntpdc/ntpdc.1ntpdcman@1.195 +2 -2
+ NTP_4_2_7P376
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.195 +2 -2
+ NTP_4_2_7P376
+
+ ntpdc/ntpdc.html@1.208 +2 -2
+ NTP_4_2_7P376
+
+ ntpdc/ntpdc.man.in@1.195 +2 -2
+ NTP_4_2_7P376
+
+ ntpdc/ntpdc.mdoc.in@1.195 +2 -2
+ NTP_4_2_7P376
+
+ ntpq/invoke-ntpq.texi@1.368 +2 -2
+ NTP_4_2_7P376
+
+ ntpq/ntpq-opts.c@1.382 +7 -7
+ NTP_4_2_7P376
+
+ ntpq/ntpq-opts.h@1.382 +3 -3
+ NTP_4_2_7P376
+
+ ntpq/ntpq.1ntpqman@1.196 +2 -2
+ NTP_4_2_7P376
+
+ ntpq/ntpq.1ntpqmdoc@1.196 +2 -2
+ NTP_4_2_7P376
+
+ ntpq/ntpq.html@1.41 +2 -2
+ NTP_4_2_7P376
+
+ ntpq/ntpq.man.in@1.196 +2 -2
+ NTP_4_2_7P376
+
+ ntpq/ntpq.mdoc.in@1.196 +2 -2
+ NTP_4_2_7P376
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.367 +2 -2
+ NTP_4_2_7P376
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.382 +7 -7
+ NTP_4_2_7P376
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.382 +3 -3
+ NTP_4_2_7P376
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.196 +3 -3
+ NTP_4_2_7P376
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.196 +3 -3
+ NTP_4_2_7P376
+
+ ntpsnmpd/ntpsnmpd.html@1.39 +1 -1
+ NTP_4_2_7P376
+
+ ntpsnmpd/ntpsnmpd.man.in@1.196 +3 -3
+ NTP_4_2_7P376
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.196 +3 -3
+ NTP_4_2_7P376
+
+ packageinfo.sh@1.379 +1 -1
+ NTP_4_2_7P376
+
+ scripts/invoke-ntp-wait.texi@1.184 +1 -1
+ NTP_4_2_7P376
+
+ scripts/ntp-wait.1ntp-waitman@1.195 +3 -3
+ NTP_4_2_7P376
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.195 +3 -3
+ NTP_4_2_7P376
+
+ scripts/ntp-wait.html@1.200 +1 -1
+ NTP_4_2_7P376
+
+ scripts/ntp-wait.man.in@1.195 +3 -3
+ NTP_4_2_7P376
+
+ scripts/ntp-wait.mdoc.in@1.195 +3 -3
+ NTP_4_2_7P376
+
+ sntp/invoke-sntp.texi@1.364 +2 -2
+ NTP_4_2_7P376
+
+ sntp/sntp-opts.c@1.379 +7 -7
+ NTP_4_2_7P376
+
+ sntp/sntp-opts.h@1.379 +3 -3
+ NTP_4_2_7P376
+
+ sntp/sntp.1sntpman@1.199 +3 -3
+ NTP_4_2_7P376
+
+ sntp/sntp.1sntpmdoc@1.199 +3 -3
+ NTP_4_2_7P376
+
+ sntp/sntp.html@1.379 +2 -2
+ NTP_4_2_7P376
+
+ sntp/sntp.man.in@1.199 +3 -3
+ NTP_4_2_7P376
+
+ sntp/sntp.mdoc.in@1.199 +3 -3
+ NTP_4_2_7P376
+
+ util/invoke-ntp-keygen.texi@1.368 +2 -2
+ NTP_4_2_7P376
+
+ util/ntp-keygen-opts.c@1.382 +7 -7
+ NTP_4_2_7P376
+
+ util/ntp-keygen-opts.h@1.382 +3 -3
+ NTP_4_2_7P376
+
+ util/ntp-keygen.1ntp-keygenman@1.196 +3 -3
+ NTP_4_2_7P376
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.196 +3 -3
+ NTP_4_2_7P376
+
+ util/ntp-keygen.html@1.45 +2 -2
+ NTP_4_2_7P376
+
+ util/ntp-keygen.man.in@1.196 +3 -3
+ NTP_4_2_7P376
+
+ util/ntp-keygen.mdoc.in@1.196 +3 -3
+ NTP_4_2_7P376
+
+ChangeSet@1.2953, 2013-07-24 05:46:25-04:00, stenn@deacon.udel.edu
+ [Bug 2322] Oncore driver should send 0 PPS offset to GPS
+
+ ChangeLog@1.1303 +1 -0
+ [Bug 2322] Oncore driver should send 0 PPS offset to GPS
+
+ ntpd/refclock_oncore.c@1.97 +3 -5
+ [Bug 2322] Oncore driver should send 0 PPS offset to GPS
+
+ChangeSet@1.2952, 2013-07-22 11:40:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P375
+ TAG: NTP_4_2_7P375
+
+ ChangeLog@1.1302 +1 -0
+ NTP_4_2_7P375
+
+ ntpd/invoke-ntp.conf.texi@1.50 +1 -1
+ NTP_4_2_7P375
+
+ ntpd/invoke-ntp.keys.texi@1.50 +1 -1
+ NTP_4_2_7P375
+
+ ntpd/invoke-ntpd.texi@1.366 +2 -2
+ NTP_4_2_7P375
+
+ ntpd/ntp.conf.5man@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntp.conf.5mdoc@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntp.conf.html@1.48 +1 -1
+ NTP_4_2_7P375
+
+ ntpd/ntp.conf.man.in@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntp.conf.mdoc.in@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntp.keys.5man@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntp.keys.5mdoc@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntp.keys.html@1.49 +1 -1
+ NTP_4_2_7P375
+
+ ntpd/ntp.keys.man.in@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntp.keys.mdoc.in@1.84 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntpd-opts.c@1.384 +7 -7
+ NTP_4_2_7P375
+
+ ntpd/ntpd-opts.h@1.384 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntpd.1ntpdman@1.195 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntpd.1ntpdmdoc@1.195 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntpd.html@1.43 +2 -2
+ NTP_4_2_7P375
+
+ ntpd/ntpd.man.in@1.195 +3 -3
+ NTP_4_2_7P375
+
+ ntpd/ntpd.mdoc.in@1.195 +3 -3
+ NTP_4_2_7P375
+
+ ntpdc/invoke-ntpdc.texi@1.363 +2 -2
+ NTP_4_2_7P375
+
+ ntpdc/ntpdc-opts.c@1.378 +7 -7
+ NTP_4_2_7P375
+
+ ntpdc/ntpdc-opts.h@1.378 +3 -3
+ NTP_4_2_7P375
+
+ ntpdc/ntpdc.1ntpdcman@1.194 +2 -2
+ NTP_4_2_7P375
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.194 +2 -2
+ NTP_4_2_7P375
+
+ ntpdc/ntpdc.html@1.207 +2 -2
+ NTP_4_2_7P375
+
+ ntpdc/ntpdc.man.in@1.194 +2 -2
+ NTP_4_2_7P375
+
+ ntpdc/ntpdc.mdoc.in@1.194 +2 -2
+ NTP_4_2_7P375
+
+ ntpq/invoke-ntpq.texi@1.367 +2 -2
+ NTP_4_2_7P375
+
+ ntpq/ntpq-opts.c@1.381 +7 -7
+ NTP_4_2_7P375
+
+ ntpq/ntpq-opts.h@1.381 +3 -3
+ NTP_4_2_7P375
+
+ ntpq/ntpq.1ntpqman@1.195 +2 -2
+ NTP_4_2_7P375
+
+ ntpq/ntpq.1ntpqmdoc@1.195 +2 -2
+ NTP_4_2_7P375
+
+ ntpq/ntpq.html@1.40 +2 -2
+ NTP_4_2_7P375
+
+ ntpq/ntpq.man.in@1.195 +2 -2
+ NTP_4_2_7P375
+
+ ntpq/ntpq.mdoc.in@1.195 +2 -2
+ NTP_4_2_7P375
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.366 +2 -2
+ NTP_4_2_7P375
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.381 +7 -7
+ NTP_4_2_7P375
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.381 +3 -3
+ NTP_4_2_7P375
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.195 +3 -3
+ NTP_4_2_7P375
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.195 +3 -3
+ NTP_4_2_7P375
+
+ ntpsnmpd/ntpsnmpd.html@1.38 +1 -1
+ NTP_4_2_7P375
+
+ ntpsnmpd/ntpsnmpd.man.in@1.195 +3 -3
+ NTP_4_2_7P375
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.195 +3 -3
+ NTP_4_2_7P375
+
+ packageinfo.sh@1.378 +1 -1
+ NTP_4_2_7P375
+
+ scripts/invoke-ntp-wait.texi@1.183 +1 -1
+ NTP_4_2_7P375
+
+ scripts/ntp-wait.1ntp-waitman@1.194 +3 -3
+ NTP_4_2_7P375
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.194 +3 -3
+ NTP_4_2_7P375
+
+ scripts/ntp-wait.html@1.199 +1 -1
+ NTP_4_2_7P375
+
+ scripts/ntp-wait.man.in@1.194 +3 -3
+ NTP_4_2_7P375
+
+ scripts/ntp-wait.mdoc.in@1.194 +3 -3
+ NTP_4_2_7P375
+
+ sntp/invoke-sntp.texi@1.363 +2 -2
+ NTP_4_2_7P375
+
+ sntp/sntp-opts.c@1.378 +7 -7
+ NTP_4_2_7P375
+
+ sntp/sntp-opts.h@1.378 +3 -3
+ NTP_4_2_7P375
+
+ sntp/sntp.1sntpman@1.198 +3 -3
+ NTP_4_2_7P375
+
+ sntp/sntp.1sntpmdoc@1.198 +3 -3
+ NTP_4_2_7P375
+
+ sntp/sntp.html@1.378 +2 -2
+ NTP_4_2_7P375
+
+ sntp/sntp.man.in@1.198 +3 -3
+ NTP_4_2_7P375
+
+ sntp/sntp.mdoc.in@1.198 +3 -3
+ NTP_4_2_7P375
+
+ util/invoke-ntp-keygen.texi@1.367 +2 -2
+ NTP_4_2_7P375
+
+ util/ntp-keygen-opts.c@1.381 +7 -7
+ NTP_4_2_7P375
+
+ util/ntp-keygen-opts.h@1.381 +3 -3
+ NTP_4_2_7P375
+
+ util/ntp-keygen.1ntp-keygenman@1.195 +3 -3
+ NTP_4_2_7P375
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.195 +3 -3
+ NTP_4_2_7P375
+
+ util/ntp-keygen.html@1.44 +2 -2
+ NTP_4_2_7P375
+
+ util/ntp-keygen.man.in@1.195 +3 -3
+ NTP_4_2_7P375
+
+ util/ntp-keygen.mdoc.in@1.195 +3 -3
+ NTP_4_2_7P375
+
+ChangeSet@1.2951, 2013-07-22 06:50:54-04:00, stenn@deacon.udel.edu
+ [Bug 883] log warning arguments swapped in refclock_gpsvme.c
+
+ ChangeLog@1.1301 +1 -0
+ [Bug 883] log warning arguments swapped in refclock_gpsvme.c
+
+ ntpd/refclock_gpsvme.c@1.10 +1 -1
+ [Bug 883] log warning arguments swapped in refclock_gpsvme.c
+
+ChangeSet@1.2950, 2013-07-22 06:39:38-04:00, stenn@deacon.udel.edu
+ [Bug 2434] Line-buffer (v. block-buffer) stdout
+
+ ChangeLog@1.1300 +1 -0
+ [Bug 2434] Line-buffer (v. block-buffer) stdout
+
+ ntpd/ntpd.c@1.145 +3 -0
+ [Bug 2434] Line-buffer (v. block-buffer) stdout
+
+ChangeSet@1.2946.1.22, 2013-07-21 17:50:57-04:00, murray@pogo.udel.edu
+ test.sh, ChangeLog:
+ Correct bug in previous attempt to fix bug-2368.
+
+ ChangeLog@1.1296.1.19 +1 -0
+ Correct bug in previous attempt to fix bug-2368.
+
+ sntp/libevent/test/test.sh@1.9 +1 -1
+ Correct bug in previous attempt to fix bug-2368.
+
+ChangeSet@1.2946.1.21, 2013-07-21 11:39:42+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P374
+ TAG: NTP_4_2_7P374
+
+ ChangeLog@1.1296.1.18 +1 -0
+ NTP_4_2_7P374
+
+ ntpd/invoke-ntp.conf.texi@1.49 +1 -1
+ NTP_4_2_7P374
+
+ ntpd/invoke-ntp.keys.texi@1.49 +1 -1
+ NTP_4_2_7P374
+
+ ntpd/invoke-ntpd.texi@1.365 +2 -2
+ NTP_4_2_7P374
+
+ ntpd/ntp.conf.5man@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntp.conf.5mdoc@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntp.conf.html@1.47 +1 -1
+ NTP_4_2_7P374
+
+ ntpd/ntp.conf.man.in@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntp.conf.mdoc.in@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntp.keys.5man@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntp.keys.5mdoc@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntp.keys.html@1.48 +1 -1
+ NTP_4_2_7P374
+
+ ntpd/ntp.keys.man.in@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntp.keys.mdoc.in@1.83 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntpd-opts.c@1.383 +7 -7
+ NTP_4_2_7P374
+
+ ntpd/ntpd-opts.h@1.383 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntpd.1ntpdman@1.194 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntpd.1ntpdmdoc@1.194 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntpd.html@1.42 +2 -2
+ NTP_4_2_7P374
+
+ ntpd/ntpd.man.in@1.194 +3 -3
+ NTP_4_2_7P374
+
+ ntpd/ntpd.mdoc.in@1.194 +3 -3
+ NTP_4_2_7P374
+
+ ntpdc/invoke-ntpdc.texi@1.362 +2 -2
+ NTP_4_2_7P374
+
+ ntpdc/ntpdc-opts.c@1.377 +7 -7
+ NTP_4_2_7P374
+
+ ntpdc/ntpdc-opts.h@1.377 +3 -3
+ NTP_4_2_7P374
+
+ ntpdc/ntpdc.1ntpdcman@1.193 +2 -2
+ NTP_4_2_7P374
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.193 +2 -2
+ NTP_4_2_7P374
+
+ ntpdc/ntpdc.html@1.206 +2 -2
+ NTP_4_2_7P374
+
+ ntpdc/ntpdc.man.in@1.193 +2 -2
+ NTP_4_2_7P374
+
+ ntpdc/ntpdc.mdoc.in@1.193 +2 -2
+ NTP_4_2_7P374
+
+ ntpq/invoke-ntpq.texi@1.366 +2 -2
+ NTP_4_2_7P374
+
+ ntpq/ntpq-opts.c@1.380 +7 -7
+ NTP_4_2_7P374
+
+ ntpq/ntpq-opts.h@1.380 +3 -3
+ NTP_4_2_7P374
+
+ ntpq/ntpq.1ntpqman@1.194 +2 -2
+ NTP_4_2_7P374
+
+ ntpq/ntpq.1ntpqmdoc@1.194 +2 -2
+ NTP_4_2_7P374
+
+ ntpq/ntpq.html@1.39 +2 -2
+ NTP_4_2_7P374
+
+ ntpq/ntpq.man.in@1.194 +2 -2
+ NTP_4_2_7P374
+
+ ntpq/ntpq.mdoc.in@1.194 +2 -2
+ NTP_4_2_7P374
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.365 +2 -2
+ NTP_4_2_7P374
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.380 +7 -7
+ NTP_4_2_7P374
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.380 +3 -3
+ NTP_4_2_7P374
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.194 +3 -3
+ NTP_4_2_7P374
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.194 +3 -3
+ NTP_4_2_7P374
+
+ ntpsnmpd/ntpsnmpd.html@1.37 +1 -1
+ NTP_4_2_7P374
+
+ ntpsnmpd/ntpsnmpd.man.in@1.194 +3 -3
+ NTP_4_2_7P374
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.194 +3 -3
+ NTP_4_2_7P374
+
+ packageinfo.sh@1.377 +1 -1
+ NTP_4_2_7P374
+
+ scripts/invoke-ntp-wait.texi@1.182 +1 -1
+ NTP_4_2_7P374
+
+ scripts/ntp-wait.1ntp-waitman@1.193 +3 -3
+ NTP_4_2_7P374
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.193 +3 -3
+ NTP_4_2_7P374
+
+ scripts/ntp-wait.html@1.198 +1 -1
+ NTP_4_2_7P374
+
+ scripts/ntp-wait.man.in@1.193 +3 -3
+ NTP_4_2_7P374
+
+ scripts/ntp-wait.mdoc.in@1.193 +3 -3
+ NTP_4_2_7P374
+
+ sntp/invoke-sntp.texi@1.362 +2 -2
+ NTP_4_2_7P374
+
+ sntp/sntp-opts.c@1.377 +7 -7
+ NTP_4_2_7P374
+
+ sntp/sntp-opts.h@1.377 +3 -3
+ NTP_4_2_7P374
+
+ sntp/sntp.1sntpman@1.197 +3 -3
+ NTP_4_2_7P374
+
+ sntp/sntp.1sntpmdoc@1.197 +3 -3
+ NTP_4_2_7P374
+
+ sntp/sntp.html@1.377 +2 -2
+ NTP_4_2_7P374
+
+ sntp/sntp.man.in@1.197 +3 -3
+ NTP_4_2_7P374
+
+ sntp/sntp.mdoc.in@1.197 +3 -3
+ NTP_4_2_7P374
+
+ util/invoke-ntp-keygen.texi@1.366 +2 -2
+ NTP_4_2_7P374
+
+ util/ntp-keygen-opts.c@1.380 +7 -7
+ NTP_4_2_7P374
+
+ util/ntp-keygen-opts.h@1.380 +3 -3
+ NTP_4_2_7P374
+
+ util/ntp-keygen.1ntp-keygenman@1.194 +3 -3
+ NTP_4_2_7P374
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.194 +3 -3
+ NTP_4_2_7P374
+
+ util/ntp-keygen.html@1.43 +2 -2
+ NTP_4_2_7P374
+
+ util/ntp-keygen.man.in@1.194 +3 -3
+ NTP_4_2_7P374
+
+ util/ntp-keygen.mdoc.in@1.194 +3 -3
+ NTP_4_2_7P374
+
+ChangeSet@1.2946.4.4, 2013-07-21 01:37:05-04:00, karlsson@psp-deb1.ntp.org
+ [Bug 2413] Fix "make check" with automake >= 1.13
+
+ ChangeLog@1.1296.3.4 +1 -1
+ [Bug 2413] Fix "make check" with automake >= 1.13
+
+ChangeSet@1.2946.4.3, 2013-07-21 01:36:42-04:00, karlsson@psp-deb1.ntp.org
+ [Bug 2413] Fix "make check" with automake >= 1.13
+
+ ChangeLog@1.1296.3.3 +2 -1
+ [Bug 2413] Fix "make check" with automamke >= 1.13
+
+ChangeSet@1.2946.5.1, 2013-07-20 19:56:47-04:00, murray@pogo.udel.edu
+ test.sh, ChangeLog:
+ Fix bug 2368
+
+ ChangeLog@1.1296.4.1 +1 -0
+ Fix bug 2368
+
+ sntp/libevent/test/test.sh@1.8 +7 -0
+ Fix bug 2368
+
+ChangeSet@1.2946.4.1, 2013-07-20 11:32:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P373
+ TAG: NTP_4_2_7P373
+
+ ChangeLog@1.1296.3.1 +1 -0
+ NTP_4_2_7P373
+
+ ntpd/invoke-ntp.conf.texi@1.48 +1 -1
+ NTP_4_2_7P373
+
+ ntpd/invoke-ntp.keys.texi@1.48 +1 -1
+ NTP_4_2_7P373
+
+ ntpd/invoke-ntpd.texi@1.364 +2 -2
+ NTP_4_2_7P373
+
+ ntpd/ntp.conf.5man@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntp.conf.5mdoc@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntp.conf.html@1.46 +1 -1
+ NTP_4_2_7P373
+
+ ntpd/ntp.conf.man.in@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntp.conf.mdoc.in@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntp.keys.5man@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntp.keys.5mdoc@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntp.keys.html@1.47 +1 -1
+ NTP_4_2_7P373
+
+ ntpd/ntp.keys.man.in@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntp.keys.mdoc.in@1.82 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntpd-opts.c@1.382 +7 -7
+ NTP_4_2_7P373
+
+ ntpd/ntpd-opts.h@1.382 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntpd.1ntpdman@1.193 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntpd.1ntpdmdoc@1.193 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntpd.html@1.41 +2 -2
+ NTP_4_2_7P373
+
+ ntpd/ntpd.man.in@1.193 +3 -3
+ NTP_4_2_7P373
+
+ ntpd/ntpd.mdoc.in@1.193 +3 -3
+ NTP_4_2_7P373
+
+ ntpdc/invoke-ntpdc.texi@1.361 +2 -2
+ NTP_4_2_7P373
+
+ ntpdc/ntpdc-opts.c@1.376 +7 -7
+ NTP_4_2_7P373
+
+ ntpdc/ntpdc-opts.h@1.376 +3 -3
+ NTP_4_2_7P373
+
+ ntpdc/ntpdc.1ntpdcman@1.192 +2 -2
+ NTP_4_2_7P373
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.192 +2 -2
+ NTP_4_2_7P373
+
+ ntpdc/ntpdc.html@1.205 +2 -2
+ NTP_4_2_7P373
+
+ ntpdc/ntpdc.man.in@1.192 +2 -2
+ NTP_4_2_7P373
+
+ ntpdc/ntpdc.mdoc.in@1.192 +2 -2
+ NTP_4_2_7P373
+
+ ntpq/invoke-ntpq.texi@1.365 +2 -2
+ NTP_4_2_7P373
+
+ ntpq/ntpq-opts.c@1.379 +7 -7
+ NTP_4_2_7P373
+
+ ntpq/ntpq-opts.h@1.379 +3 -3
+ NTP_4_2_7P373
+
+ ntpq/ntpq.1ntpqman@1.193 +2 -2
+ NTP_4_2_7P373
+
+ ntpq/ntpq.1ntpqmdoc@1.193 +2 -2
+ NTP_4_2_7P373
+
+ ntpq/ntpq.html@1.38 +2 -2
+ NTP_4_2_7P373
+
+ ntpq/ntpq.man.in@1.193 +2 -2
+ NTP_4_2_7P373
+
+ ntpq/ntpq.mdoc.in@1.193 +2 -2
+ NTP_4_2_7P373
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.364 +2 -2
+ NTP_4_2_7P373
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.379 +7 -7
+ NTP_4_2_7P373
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.379 +3 -3
+ NTP_4_2_7P373
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.193 +3 -3
+ NTP_4_2_7P373
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.193 +3 -3
+ NTP_4_2_7P373
+
+ ntpsnmpd/ntpsnmpd.html@1.36 +1 -1
+ NTP_4_2_7P373
+
+ ntpsnmpd/ntpsnmpd.man.in@1.193 +3 -3
+ NTP_4_2_7P373
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.193 +3 -3
+ NTP_4_2_7P373
+
+ packageinfo.sh@1.376 +1 -1
+ NTP_4_2_7P373
+
+ scripts/invoke-ntp-wait.texi@1.181 +1 -1
+ NTP_4_2_7P373
+
+ scripts/ntp-wait.1ntp-waitman@1.192 +3 -3
+ NTP_4_2_7P373
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.192 +3 -3
+ NTP_4_2_7P373
+
+ scripts/ntp-wait.html@1.197 +1 -1
+ NTP_4_2_7P373
+
+ scripts/ntp-wait.man.in@1.192 +3 -3
+ NTP_4_2_7P373
+
+ scripts/ntp-wait.mdoc.in@1.192 +3 -3
+ NTP_4_2_7P373
+
+ sntp/invoke-sntp.texi@1.361 +2 -2
+ NTP_4_2_7P373
+
+ sntp/sntp-opts.c@1.376 +7 -7
+ NTP_4_2_7P373
+
+ sntp/sntp-opts.h@1.376 +3 -3
+ NTP_4_2_7P373
+
+ sntp/sntp.1sntpman@1.196 +3 -3
+ NTP_4_2_7P373
+
+ sntp/sntp.1sntpmdoc@1.196 +3 -3
+ NTP_4_2_7P373
+
+ sntp/sntp.html@1.376 +2 -2
+ NTP_4_2_7P373
+
+ sntp/sntp.man.in@1.196 +3 -3
+ NTP_4_2_7P373
+
+ sntp/sntp.mdoc.in@1.196 +3 -3
+ NTP_4_2_7P373
+
+ util/invoke-ntp-keygen.texi@1.365 +2 -2
+ NTP_4_2_7P373
+
+ util/ntp-keygen-opts.c@1.379 +7 -7
+ NTP_4_2_7P373
+
+ util/ntp-keygen-opts.h@1.379 +3 -3
+ NTP_4_2_7P373
+
+ util/ntp-keygen.1ntp-keygenman@1.193 +3 -3
+ NTP_4_2_7P373
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.193 +3 -3
+ NTP_4_2_7P373
+
+ util/ntp-keygen.html@1.42 +2 -2
+ NTP_4_2_7P373
+
+ util/ntp-keygen.man.in@1.193 +3 -3
+ NTP_4_2_7P373
+
+ util/ntp-keygen.mdoc.in@1.193 +3 -3
+ NTP_4_2_7P373
+
+ChangeSet@1.2946.1.19, 2013-07-20 10:59:15+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ add missing static
+
+ ntpd/ntp_io.c@1.379 +1 -1
+ add missing static
+
+ChangeSet@1.2946.1.18, 2013-07-20 10:48:50+00:00, kardel@pogo.udel.edu
+ ntp_io.c, work_thread.c:
+ [Bug 2425] keep init_socket_sig() within ntp_io.c to avoid interference with sntp's way of doing i/o
+
+ libntp/work_thread.c@1.16 +0 -4
+ [Bug 2425] keep init_socket_sig() within ntp_io.c to avoid interference with sntp's way of doing things
+
+ ntpd/ntp_io.c@1.378 +6 -1
+ [Bug 2425] keep init_socket_sig() within ntp_io.c to avoid interference with sntp's way of doing things
+
+ChangeSet@1.2946.1.17, 2013-07-20 08:25:40+00:00, kardel@pogo.udel.edu
+ work_thread.c, ntpd.h, ntpd.c, ntp_io.c, ChangeLog, iosignal.h, iosignal.c:
+ [Bug 2425] fix async io setup for worker thread
+
+ ChangeLog@1.1296.1.16 +2 -0
+ [Bug 2425] fix async io setup for worker thread
+
+ include/iosignal.h@1.7 +4 -2
+ [Bug 2425] fix async io setup for worker thread
+
+ include/ntpd.h@1.175 +0 -1
+ [Bug 2425] fix async io setup for worker thread
+
+ libntp/iosignal.c@1.17 +30 -15
+ [Bug 2425] fix async io setup for worker thread
+
+ libntp/work_thread.c@1.15 +4 -0
+ [Bug 2425] fix async io setup for worker thread.
+
+ ntpd/ntp_io.c@1.377 +1 -1
+ [Bug 2425] fix async io setup for worker thread
+
+ ntpd/ntpd.c@1.144 +1 -0
+ [Bug 2425] fix async io setup for worker thread
+
+ChangeSet@1.2946.1.16, 2013-07-20 00:33:31-04:00, stenn@pogo.udel.edu
+ Bug 2427] configure fails to detect recvmsg() on Solaris
+
+ ChangeLog@1.1296.1.15 +1 -0
+ Bug 2427] configure fails to detect recvmsg() on Solaris
+
+ configure.ac@1.559 +1 -1
+ Bug 2427] configure fails to detect recvmsg() on Solaris
+
+ sntp/m4/ntp_libntp.m4@1.19 +3 -0
+ Bug 2427] configure fails to detect recvmsg() on Solaris
+
+ChangeSet@1.2946.1.15, 2013-07-17 11:39:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P372
+ TAG: NTP_4_2_7P372
+
+ ChangeLog@1.1296.1.14 +1 -0
+ NTP_4_2_7P372
+
+ ntpd/invoke-ntp.conf.texi@1.47 +1 -1
+ NTP_4_2_7P372
+
+ ntpd/invoke-ntp.keys.texi@1.47 +1 -1
+ NTP_4_2_7P372
+
+ ntpd/invoke-ntpd.texi@1.363 +2 -2
+ NTP_4_2_7P372
+
+ ntpd/ntp.conf.5man@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntp.conf.5mdoc@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntp.conf.html@1.45 +1 -1
+ NTP_4_2_7P372
+
+ ntpd/ntp.conf.man.in@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntp.conf.mdoc.in@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntp.keys.5man@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntp.keys.5mdoc@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntp.keys.html@1.46 +1 -1
+ NTP_4_2_7P372
+
+ ntpd/ntp.keys.man.in@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntp.keys.mdoc.in@1.81 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntpd-opts.c@1.381 +7 -7
+ NTP_4_2_7P372
+
+ ntpd/ntpd-opts.h@1.381 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntpd.1ntpdman@1.192 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntpd.1ntpdmdoc@1.192 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntpd.html@1.40 +4 -2
+ NTP_4_2_7P372
+
+ ntpd/ntpd.man.in@1.192 +3 -3
+ NTP_4_2_7P372
+
+ ntpd/ntpd.mdoc.in@1.192 +3 -3
+ NTP_4_2_7P372
+
+ ntpdc/invoke-ntpdc.texi@1.360 +2 -2
+ NTP_4_2_7P372
+
+ ntpdc/ntpdc-opts.c@1.375 +7 -7
+ NTP_4_2_7P372
+
+ ntpdc/ntpdc-opts.h@1.375 +3 -3
+ NTP_4_2_7P372
+
+ ntpdc/ntpdc.1ntpdcman@1.191 +2 -2
+ NTP_4_2_7P372
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.191 +2 -2
+ NTP_4_2_7P372
+
+ ntpdc/ntpdc.html@1.204 +2 -2
+ NTP_4_2_7P372
+
+ ntpdc/ntpdc.man.in@1.191 +2 -2
+ NTP_4_2_7P372
+
+ ntpdc/ntpdc.mdoc.in@1.191 +2 -2
+ NTP_4_2_7P372
+
+ ntpq/invoke-ntpq.texi@1.364 +2 -2
+ NTP_4_2_7P372
+
+ ntpq/ntpq-opts.c@1.378 +7 -7
+ NTP_4_2_7P372
+
+ ntpq/ntpq-opts.h@1.378 +3 -3
+ NTP_4_2_7P372
+
+ ntpq/ntpq.1ntpqman@1.192 +2 -2
+ NTP_4_2_7P372
+
+ ntpq/ntpq.1ntpqmdoc@1.192 +2 -2
+ NTP_4_2_7P372
+
+ ntpq/ntpq.html@1.37 +4 -2
+ NTP_4_2_7P372
+
+ ntpq/ntpq.man.in@1.192 +2 -2
+ NTP_4_2_7P372
+
+ ntpq/ntpq.mdoc.in@1.192 +2 -2
+ NTP_4_2_7P372
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.363 +2 -2
+ NTP_4_2_7P372
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.378 +7 -7
+ NTP_4_2_7P372
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.378 +3 -3
+ NTP_4_2_7P372
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.192 +3 -3
+ NTP_4_2_7P372
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.192 +3 -3
+ NTP_4_2_7P372
+
+ ntpsnmpd/ntpsnmpd.html@1.35 +1 -1
+ NTP_4_2_7P372
+
+ ntpsnmpd/ntpsnmpd.man.in@1.192 +3 -3
+ NTP_4_2_7P372
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.192 +3 -3
+ NTP_4_2_7P372
+
+ packageinfo.sh@1.375 +1 -1
+ NTP_4_2_7P372
+
+ scripts/invoke-ntp-wait.texi@1.180 +1 -1
+ NTP_4_2_7P372
+
+ scripts/ntp-wait.1ntp-waitman@1.191 +3 -3
+ NTP_4_2_7P372
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.191 +3 -3
+ NTP_4_2_7P372
+
+ scripts/ntp-wait.html@1.196 +1 -1
+ NTP_4_2_7P372
+
+ scripts/ntp-wait.man.in@1.191 +3 -3
+ NTP_4_2_7P372
+
+ scripts/ntp-wait.mdoc.in@1.191 +3 -3
+ NTP_4_2_7P372
+
+ sntp/invoke-sntp.texi@1.360 +2 -2
+ NTP_4_2_7P372
+
+ sntp/sntp-opts.c@1.375 +7 -7
+ NTP_4_2_7P372
+
+ sntp/sntp-opts.h@1.375 +3 -3
+ NTP_4_2_7P372
+
+ sntp/sntp.1sntpman@1.195 +3 -3
+ NTP_4_2_7P372
+
+ sntp/sntp.1sntpmdoc@1.195 +3 -3
+ NTP_4_2_7P372
+
+ sntp/sntp.html@1.375 +2 -2
+ NTP_4_2_7P372
+
+ sntp/sntp.man.in@1.195 +3 -3
+ NTP_4_2_7P372
+
+ sntp/sntp.mdoc.in@1.195 +3 -3
+ NTP_4_2_7P372
+
+ util/invoke-ntp-keygen.texi@1.364 +2 -2
+ NTP_4_2_7P372
+
+ util/ntp-keygen-opts.c@1.378 +7 -7
+ NTP_4_2_7P372
+
+ util/ntp-keygen-opts.h@1.378 +3 -3
+ NTP_4_2_7P372
+
+ util/ntp-keygen.1ntp-keygenman@1.192 +3 -3
+ NTP_4_2_7P372
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.192 +3 -3
+ NTP_4_2_7P372
+
+ util/ntp-keygen.html@1.41 +4 -2
+ NTP_4_2_7P372
+
+ util/ntp-keygen.man.in@1.192 +3 -3
+ NTP_4_2_7P372
+
+ util/ntp-keygen.mdoc.in@1.192 +3 -3
+ NTP_4_2_7P372
+
+ChangeSet@1.2946.1.14, 2013-07-17 05:23:29-04:00, stenn@deacon.udel.edu
+ [Bug 2428] do_unconf() should reset 'items' before the 2nd loop
+
+ ChangeLog@1.1296.1.13 +1 -0
+ [Bug 2428] do_unconf() should reset 'items' before the 2nd loop
+
+ ntpd/ntp_request.c@1.111 +1 -0
+ [Bug 2428] do_unconf() should reset 'items' before the 2nd loop
+
+ChangeSet@1.2946.1.13, 2013-07-17 05:18:42-04:00, stenn@deacon.udel.edu
+ [Bug 2423] Log command-line args at LOG_INFO
+
+ ChangeLog@1.1296.1.12 +1 -0
+ [Bug 2423] Log command-line args at LOG_INFO
+
+ ntpd/ntpd.c@1.143 +1 -1
+ [Bug 2423] Log command-line args at LOG_INFO
+
+ChangeSet@1.2946.1.12, 2013-07-17 05:11:31-04:00, stenn@pogo.udel.edu
+ [Bug 2375] AIX 7 doesn't like a libevent validation check
+
+ ChangeLog@1.1296.1.11 +1 -0
+ [Bug 2375] AIX 7 doesn't like a libevent validation check
+
+ sntp/libevent/evutil_time.c@1.3 +0 -10
+ [Bug 2375] AIX 7 doesn't like a libevent validation check
+
+ChangeSet@1.2946.1.11, 2013-07-17 03:34:42-04:00, stenn@deacon.udel.edu
+ [Bug 1466] Oncore should set FLAG_PPS
+
+ ChangeLog@1.1296.1.10 +1 -0
+ [Bug 1466] Oncore should set FLAG_PPS
+
+ ntpd/refclock_oncore.c@1.96 +12 -3
+ [Bug 1466] Oncore should set FLAG_PPS
+
+ChangeSet@1.2946.1.10, 2013-07-07 06:34:52+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P371
+ TAG: NTP_4_2_7P371
+
+ ChangeLog@1.1296.1.9 +1 -0
+ NTP_4_2_7P371
+
+ ntpd/invoke-ntp.conf.texi@1.46 +1 -1
+ NTP_4_2_7P371
+
+ ntpd/invoke-ntp.keys.texi@1.46 +1 -1
+ NTP_4_2_7P371
+
+ ntpd/invoke-ntpd.texi@1.362 +4 -2
+ NTP_4_2_7P371
+
+ ntpd/ntp.conf.5man@1.80 +36 -36
+ NTP_4_2_7P371
+
+ ntpd/ntp.conf.5mdoc@1.80 +4 -4
+ NTP_4_2_7P371
+
+ ntpd/ntp.conf.html@1.44 +1 -1
+ NTP_4_2_7P371
+
+ ntpd/ntp.conf.man.in@1.80 +36 -36
+ NTP_4_2_7P371
+
+ ntpd/ntp.conf.mdoc.in@1.80 +4 -4
+ NTP_4_2_7P371
+
+ ntpd/ntp.keys.5man@1.80 +10 -10
+ NTP_4_2_7P371
+
+ ntpd/ntp.keys.5mdoc@1.80 +4 -4
+ NTP_4_2_7P371
+
+ ntpd/ntp.keys.html@1.45 +1 -1
+ NTP_4_2_7P371
+
+ ntpd/ntp.keys.man.in@1.80 +10 -10
+ NTP_4_2_7P371
+
+ ntpd/ntp.keys.mdoc.in@1.80 +4 -4
+ NTP_4_2_7P371
+
+ ntpd/ntpd-opts.c@1.380 +104 -99
+ NTP_4_2_7P371
+
+ ntpd/ntpd-opts.h@1.380 +13 -15
+ NTP_4_2_7P371
+
+ ntpd/ntpd.1ntpdman@1.191 +4 -4
+ NTP_4_2_7P371
+
+ ntpd/ntpd.1ntpdmdoc@1.191 +4 -4
+ NTP_4_2_7P371
+
+ ntpd/ntpd.html@1.39 +2 -2
+ NTP_4_2_7P371
+
+ ntpd/ntpd.man.in@1.191 +4 -4
+ NTP_4_2_7P371
+
+ ntpd/ntpd.mdoc.in@1.191 +4 -4
+ NTP_4_2_7P371
+
+ ntpdc/invoke-ntpdc.texi@1.359 +4 -3
+ NTP_4_2_7P371
+
+ ntpdc/ntpdc-opts.c@1.374 +104 -99
+ NTP_4_2_7P371
+
+ ntpdc/ntpdc-opts.h@1.374 +14 -16
+ NTP_4_2_7P371
+
+ ntpdc/ntpdc.1ntpdcman@1.190 +14 -13
+ NTP_4_2_7P371
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.190 +9 -8
+ NTP_4_2_7P371
+
+ ntpdc/ntpdc.html@1.203 +4 -2
+ NTP_4_2_7P371
+
+ ntpdc/ntpdc.man.in@1.190 +14 -13
+ NTP_4_2_7P371
+
+ ntpdc/ntpdc.mdoc.in@1.190 +9 -8
+ NTP_4_2_7P371
+
+ ntpq/invoke-ntpq.texi@1.363 +4 -3
+ NTP_4_2_7P371
+
+ ntpq/ntpq-opts.c@1.377 +104 -99
+ NTP_4_2_7P371
+
+ ntpq/ntpq-opts.h@1.377 +14 -16
+ NTP_4_2_7P371
+
+ ntpq/ntpq.1ntpqman@1.191 +10 -9
+ NTP_4_2_7P371
+
+ ntpq/ntpq.1ntpqmdoc@1.191 +9 -8
+ NTP_4_2_7P371
+
+ ntpq/ntpq.html@1.36 +2 -2
+ NTP_4_2_7P371
+
+ ntpq/ntpq.man.in@1.191 +10 -9
+ NTP_4_2_7P371
+
+ ntpq/ntpq.mdoc.in@1.191 +9 -8
+ NTP_4_2_7P371
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.362 +4 -3
+ NTP_4_2_7P371
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.377 +104 -99
+ NTP_4_2_7P371
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.377 +14 -16
+ NTP_4_2_7P371
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.191 +10 -9
+ NTP_4_2_7P371
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.191 +10 -9
+ NTP_4_2_7P371
+
+ ntpsnmpd/ntpsnmpd.html@1.34 +1 -1
+ NTP_4_2_7P371
+
+ ntpsnmpd/ntpsnmpd.man.in@1.191 +10 -9
+ NTP_4_2_7P371
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.191 +10 -9
+ NTP_4_2_7P371
+
+ packageinfo.sh@1.374 +1 -1
+ NTP_4_2_7P371
+
+ scripts/invoke-ntp-wait.texi@1.179 +1 -1
+ NTP_4_2_7P371
+
+ scripts/ntp-wait.1ntp-waitman@1.190 +6 -6
+ NTP_4_2_7P371
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.190 +4 -4
+ NTP_4_2_7P371
+
+ scripts/ntp-wait.html@1.195 +1 -1
+ NTP_4_2_7P371
+
+ scripts/ntp-wait.man.in@1.190 +6 -6
+ NTP_4_2_7P371
+
+ scripts/ntp-wait.mdoc.in@1.190 +4 -4
+ NTP_4_2_7P371
+
+ sntp/invoke-sntp.texi@1.359 +4 -3
+ NTP_4_2_7P371
+
+ sntp/sntp-opts.c@1.374 +104 -99
+ NTP_4_2_7P371
+
+ sntp/sntp-opts.h@1.374 +14 -16
+ NTP_4_2_7P371
+
+ sntp/sntp.1sntpman@1.194 +10 -9
+ NTP_4_2_7P371
+
+ sntp/sntp.1sntpmdoc@1.194 +10 -9
+ NTP_4_2_7P371
+
+ sntp/sntp.html@1.374 +4 -2
+ NTP_4_2_7P371
+
+ sntp/sntp.man.in@1.194 +10 -9
+ NTP_4_2_7P371
+
+ sntp/sntp.mdoc.in@1.194 +10 -9
+ NTP_4_2_7P371
+
+ util/invoke-ntp-keygen.texi@1.363 +4 -3
+ NTP_4_2_7P371
+
+ util/ntp-keygen-opts.c@1.377 +104 -99
+ NTP_4_2_7P371
+
+ util/ntp-keygen-opts.h@1.377 +9 -11
+ NTP_4_2_7P371
+
+ util/ntp-keygen.1ntp-keygenman@1.191 +36 -35
+ NTP_4_2_7P371
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.191 +10 -9
+ NTP_4_2_7P371
+
+ util/ntp-keygen.html@1.40 +2 -2
+ NTP_4_2_7P371
+
+ util/ntp-keygen.man.in@1.191 +36 -35
+ NTP_4_2_7P371
+
+ util/ntp-keygen.mdoc.in@1.191 +10 -9
+ NTP_4_2_7P371
+
+ChangeSet@1.2946.1.8, 2013-07-07 01:42:37-04:00, stenn@deacon.udel.edu
+ CID 1042586: Check the return value of clock_gettime() in worker_sleep()
+
+ ChangeLog@1.1296.1.7 +1 -0
+ CID 1042586: Check the return value of clock_gettime() in worker_sleep()
+
+ libntp/work_thread.c@1.14 +9 -3
+ CID 1042586: Check the return value of clock_gettime() in worker_sleep()
+
+ChangeSet@1.2946.3.1, 2013-07-07 05:39:47+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ ChangeLog@1.1296.2.1 +1 -0
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/Makefile.am@1.21 +5 -5
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/ag-char-map.h@1.24 +2 -2
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/alias.c@1.6 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/ao-strs.c@1.10 +58 -56
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/ao-strs.h@1.9 +64 -60
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/autoopts.c@1.17 +4 -19
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/autoopts.h@1.15 +59 -0
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/autoopts/options.h@1.23 +22 -6
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/autoopts/project.h@1.6 +2 -0
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/autoopts/usage-txt.h@1.23 +78 -78
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/enum.c@1.9 +211 -95
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/find.c@1.8 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/genshell.c@1.24 +91 -89
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/genshell.h@1.24 +9 -11
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/init.c@1.4 +1 -0
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/load.c@1.17 +28 -18
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/m4/libopts.m4@1.27 +11 -9
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/makeshell.c@1.16 +19 -11
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/option-value-type.c@1.11 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/option-value-type.h@1.25 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/option-xat-attribute.c@1.11 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/option-xat-attribute.h@1.25 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/pgusage.c@1.14 +81 -34
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/proto.h@1.24 +9 -10
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/putshell.c@1.13 +4 -9
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/restore.c@1.12 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/save.c@1.15 +39 -41
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/stack.c@1.14 +2 -2
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/text_mmap.c@1.14 +1 -1
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/usage.c@1.17 +35 -63
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ sntp/libopts/version.c@1.15 +3 -3
+ Upgrade to libopts-39.0.14 from 5.17.5pre10
+
+ChangeSet@1.2946.1.7, 2013-07-06 11:30:50+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P370
+ TAG: NTP_4_2_7P370
+
+ ChangeLog@1.1296.1.6 +1 -0
+ NTP_4_2_7P370
+
+ ntpd/invoke-ntp.conf.texi@1.45 +1 -1
+ NTP_4_2_7P370
+
+ ntpd/invoke-ntp.keys.texi@1.45 +1 -1
+ NTP_4_2_7P370
+
+ ntpd/invoke-ntpd.texi@1.361 +2 -2
+ NTP_4_2_7P370
+
+ ntpd/ntp.conf.5man@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntp.conf.5mdoc@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntp.conf.html@1.43 +1 -1
+ NTP_4_2_7P370
+
+ ntpd/ntp.conf.man.in@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntp.conf.mdoc.in@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntp.keys.5man@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntp.keys.5mdoc@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntp.keys.html@1.44 +1 -1
+ NTP_4_2_7P370
+
+ ntpd/ntp.keys.man.in@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntp.keys.mdoc.in@1.79 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntpd-opts.c@1.379 +7 -7
+ NTP_4_2_7P370
+
+ ntpd/ntpd-opts.h@1.379 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntpd.1ntpdman@1.190 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntpd.1ntpdmdoc@1.190 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntpd.html@1.38 +2 -2
+ NTP_4_2_7P370
+
+ ntpd/ntpd.man.in@1.190 +3 -3
+ NTP_4_2_7P370
+
+ ntpd/ntpd.mdoc.in@1.190 +3 -3
+ NTP_4_2_7P370
+
+ ntpdc/invoke-ntpdc.texi@1.358 +2 -2
+ NTP_4_2_7P370
+
+ ntpdc/ntpdc-opts.c@1.373 +7 -7
+ NTP_4_2_7P370
+
+ ntpdc/ntpdc-opts.h@1.373 +3 -3
+ NTP_4_2_7P370
+
+ ntpdc/ntpdc.1ntpdcman@1.189 +2 -2
+ NTP_4_2_7P370
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.189 +2 -2
+ NTP_4_2_7P370
+
+ ntpdc/ntpdc.html@1.202 +2 -2
+ NTP_4_2_7P370
+
+ ntpdc/ntpdc.man.in@1.189 +2 -2
+ NTP_4_2_7P370
+
+ ntpdc/ntpdc.mdoc.in@1.189 +2 -2
+ NTP_4_2_7P370
+
+ ntpq/invoke-ntpq.texi@1.362 +2 -2
+ NTP_4_2_7P370
+
+ ntpq/ntpq-opts.c@1.376 +7 -7
+ NTP_4_2_7P370
+
+ ntpq/ntpq-opts.h@1.376 +3 -3
+ NTP_4_2_7P370
+
+ ntpq/ntpq.1ntpqman@1.190 +2 -2
+ NTP_4_2_7P370
+
+ ntpq/ntpq.1ntpqmdoc@1.190 +2 -2
+ NTP_4_2_7P370
+
+ ntpq/ntpq.html@1.35 +2 -2
+ NTP_4_2_7P370
+
+ ntpq/ntpq.man.in@1.190 +2 -2
+ NTP_4_2_7P370
+
+ ntpq/ntpq.mdoc.in@1.190 +2 -2
+ NTP_4_2_7P370
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.361 +2 -2
+ NTP_4_2_7P370
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.376 +7 -7
+ NTP_4_2_7P370
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.376 +3 -3
+ NTP_4_2_7P370
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.190 +3 -3
+ NTP_4_2_7P370
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.190 +3 -3
+ NTP_4_2_7P370
+
+ ntpsnmpd/ntpsnmpd.html@1.33 +1 -1
+ NTP_4_2_7P370
+
+ ntpsnmpd/ntpsnmpd.man.in@1.190 +3 -3
+ NTP_4_2_7P370
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.190 +3 -3
+ NTP_4_2_7P370
+
+ packageinfo.sh@1.373 +1 -1
+ NTP_4_2_7P370
+
+ scripts/invoke-ntp-wait.texi@1.178 +1 -1
+ NTP_4_2_7P370
+
+ scripts/ntp-wait.1ntp-waitman@1.189 +3 -3
+ NTP_4_2_7P370
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.189 +3 -3
+ NTP_4_2_7P370
+
+ scripts/ntp-wait.html@1.194 +1 -1
+ NTP_4_2_7P370
+
+ scripts/ntp-wait.man.in@1.189 +3 -3
+ NTP_4_2_7P370
+
+ scripts/ntp-wait.mdoc.in@1.189 +3 -3
+ NTP_4_2_7P370
+
+ sntp/invoke-sntp.texi@1.358 +2 -2
+ NTP_4_2_7P370
+
+ sntp/sntp-opts.c@1.373 +7 -7
+ NTP_4_2_7P370
+
+ sntp/sntp-opts.h@1.373 +3 -3
+ NTP_4_2_7P370
+
+ sntp/sntp.1sntpman@1.193 +3 -3
+ NTP_4_2_7P370
+
+ sntp/sntp.1sntpmdoc@1.193 +3 -3
+ NTP_4_2_7P370
+
+ sntp/sntp.html@1.373 +2 -2
+ NTP_4_2_7P370
+
+ sntp/sntp.man.in@1.193 +3 -3
+ NTP_4_2_7P370
+
+ sntp/sntp.mdoc.in@1.193 +3 -3
+ NTP_4_2_7P370
+
+ util/invoke-ntp-keygen.texi@1.362 +2 -2
+ NTP_4_2_7P370
+
+ util/ntp-keygen-opts.c@1.376 +7 -7
+ NTP_4_2_7P370
+
+ util/ntp-keygen-opts.h@1.376 +3 -3
+ NTP_4_2_7P370
+
+ util/ntp-keygen.1ntp-keygenman@1.190 +3 -3
+ NTP_4_2_7P370
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.190 +3 -3
+ NTP_4_2_7P370
+
+ util/ntp-keygen.html@1.39 +2 -2
+ NTP_4_2_7P370
+
+ util/ntp-keygen.man.in@1.190 +3 -3
+ NTP_4_2_7P370
+
+ util/ntp-keygen.mdoc.in@1.190 +3 -3
+ NTP_4_2_7P370
+
+ChangeSet@1.2946.1.6, 2013-07-05 22:39:55-07:00, harlan@hms-mbp11.local
+ Remove tailing \n's from msyslog output strings
+
+ ChangeLog@1.1296.1.5 +1 -0
+ Remove tailing \n's from msyslog output strings
+
+ChangeSet@1.2946.2.1, 2013-07-05 22:36:33-07:00, harlan@hms-mbp11.local
+ Remove tailing \n's from msyslog output strings
+
+ libntp/audio.c@1.34 +3 -3
+ Remove tailing \n's from msyslog output strings
+
+ libntp/ssl_init.c@1.16 +2 -2
+ Remove tailing \n's from msyslog output strings
+
+ libntp/work_fork.c@1.11 +5 -5
+ Remove tailing \n's from msyslog output strings
+
+ libntp/work_thread.c@1.13 +2 -2
+ Remove tailing \n's from msyslog output strings
+
+ libparse/clk_rawdcf.c@1.16 +2 -2
+ Remove tailing \n's from msyslog output strings
+
+ libparse/parse.c@1.16 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_config.c@1.312 +9 -9
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_control.c@1.185 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_crypto.c@1.161 +3 -3
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_parser.c@1.84 +167 -470
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_parser.h@1.50 +20 -25
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_parser.y@1.78 +2 -2
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_proto.c@1.345 +3 -3
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntp_timer.c@1.72 +2 -2
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/ntpd.c@1.142 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_arc.c@1.31 +4 -4
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_bancomm.c@1.16 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_datum.c@1.22 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_hopfpci.c@1.14 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_msfees.c@1.18 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_palisade.c@1.41 +4 -4
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_ripencc.c@1.17 +5 -5
+ Remove tailing \n's from msyslog output strings
+
+ ntpd/refclock_tsyncpci.c@1.8 +5 -5
+ Remove tailing \n's from msyslog output strings
+
+ ntpdate/ntpdate.c@1.92 +4 -4
+ Remove tailing \n's from msyslog output strings
+
+ ports/winnt/libntp/SetSystemTime.c@1.11 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ports/winnt/libntp/win32_io.c@1.3 +1 -1
+ Remove tailing \n's from msyslog output strings
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.60 +5 -5
+ Remove tailing \n's from msyslog output strings
+
+ sntp/main.c@1.89 +2 -2
+ Remove tailing \n's from msyslog output strings
+
+ sntp/networking.c@1.62 +3 -3
+ Remove tailing \n's from msyslog output strings
+
+ChangeSet@1.2946.1.4, 2013-07-05 11:39:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P369
+ TAG: NTP_4_2_7P369
+
+ ChangeLog@1.1296.1.4 +1 -0
+ NTP_4_2_7P369
+
+ ntpd/invoke-ntp.conf.texi@1.44 +1 -1
+ NTP_4_2_7P369
+
+ ntpd/invoke-ntp.keys.texi@1.44 +1 -1
+ NTP_4_2_7P369
+
+ ntpd/invoke-ntpd.texi@1.360 +2 -2
+ NTP_4_2_7P369
+
+ ntpd/ntp.conf.5man@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntp.conf.5mdoc@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntp.conf.html@1.42 +1 -1
+ NTP_4_2_7P369
+
+ ntpd/ntp.conf.man.in@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntp.conf.mdoc.in@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntp.keys.5man@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntp.keys.5mdoc@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntp.keys.html@1.43 +1 -1
+ NTP_4_2_7P369
+
+ ntpd/ntp.keys.man.in@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntp.keys.mdoc.in@1.78 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntpd-opts.c@1.378 +7 -7
+ NTP_4_2_7P369
+
+ ntpd/ntpd-opts.h@1.378 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntpd.1ntpdman@1.189 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntpd.1ntpdmdoc@1.189 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntpd.html@1.37 +2 -2
+ NTP_4_2_7P369
+
+ ntpd/ntpd.man.in@1.189 +3 -3
+ NTP_4_2_7P369
+
+ ntpd/ntpd.mdoc.in@1.189 +3 -3
+ NTP_4_2_7P369
+
+ ntpdc/invoke-ntpdc.texi@1.357 +2 -2
+ NTP_4_2_7P369
+
+ ntpdc/ntpdc-opts.c@1.372 +7 -7
+ NTP_4_2_7P369
+
+ ntpdc/ntpdc-opts.h@1.372 +3 -3
+ NTP_4_2_7P369
+
+ ntpdc/ntpdc.1ntpdcman@1.188 +2 -2
+ NTP_4_2_7P369
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.188 +2 -2
+ NTP_4_2_7P369
+
+ ntpdc/ntpdc.html@1.201 +2 -2
+ NTP_4_2_7P369
+
+ ntpdc/ntpdc.man.in@1.188 +2 -2
+ NTP_4_2_7P369
+
+ ntpdc/ntpdc.mdoc.in@1.188 +2 -2
+ NTP_4_2_7P369
+
+ ntpq/invoke-ntpq.texi@1.361 +2 -2
+ NTP_4_2_7P369
+
+ ntpq/ntpq-opts.c@1.375 +7 -7
+ NTP_4_2_7P369
+
+ ntpq/ntpq-opts.h@1.375 +3 -3
+ NTP_4_2_7P369
+
+ ntpq/ntpq.1ntpqman@1.189 +2 -2
+ NTP_4_2_7P369
+
+ ntpq/ntpq.1ntpqmdoc@1.189 +2 -2
+ NTP_4_2_7P369
+
+ ntpq/ntpq.html@1.34 +2 -2
+ NTP_4_2_7P369
+
+ ntpq/ntpq.man.in@1.189 +2 -2
+ NTP_4_2_7P369
+
+ ntpq/ntpq.mdoc.in@1.189 +2 -2
+ NTP_4_2_7P369
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.360 +2 -2
+ NTP_4_2_7P369
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.375 +7 -7
+ NTP_4_2_7P369
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.375 +3 -3
+ NTP_4_2_7P369
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.189 +3 -3
+ NTP_4_2_7P369
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.189 +3 -3
+ NTP_4_2_7P369
+
+ ntpsnmpd/ntpsnmpd.html@1.32 +1 -1
+ NTP_4_2_7P369
+
+ ntpsnmpd/ntpsnmpd.man.in@1.189 +3 -3
+ NTP_4_2_7P369
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.189 +3 -3
+ NTP_4_2_7P369
+
+ packageinfo.sh@1.372 +1 -1
+ NTP_4_2_7P369
+
+ scripts/invoke-ntp-wait.texi@1.177 +1 -1
+ NTP_4_2_7P369
+
+ scripts/ntp-wait.1ntp-waitman@1.188 +3 -3
+ NTP_4_2_7P369
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.188 +3 -3
+ NTP_4_2_7P369
+
+ scripts/ntp-wait.html@1.193 +1 -1
+ NTP_4_2_7P369
+
+ scripts/ntp-wait.man.in@1.188 +3 -3
+ NTP_4_2_7P369
+
+ scripts/ntp-wait.mdoc.in@1.188 +3 -3
+ NTP_4_2_7P369
+
+ sntp/invoke-sntp.texi@1.357 +2 -2
+ NTP_4_2_7P369
+
+ sntp/sntp-opts.c@1.372 +7 -7
+ NTP_4_2_7P369
+
+ sntp/sntp-opts.h@1.372 +3 -3
+ NTP_4_2_7P369
+
+ sntp/sntp.1sntpman@1.192 +3 -3
+ NTP_4_2_7P369
+
+ sntp/sntp.1sntpmdoc@1.192 +3 -3
+ NTP_4_2_7P369
+
+ sntp/sntp.html@1.372 +2 -2
+ NTP_4_2_7P369
+
+ sntp/sntp.man.in@1.192 +3 -3
+ NTP_4_2_7P369
+
+ sntp/sntp.mdoc.in@1.192 +3 -3
+ NTP_4_2_7P369
+
+ util/invoke-ntp-keygen.texi@1.361 +2 -2
+ NTP_4_2_7P369
+
+ util/ntp-keygen-opts.c@1.375 +7 -7
+ NTP_4_2_7P369
+
+ util/ntp-keygen-opts.h@1.375 +3 -3
+ NTP_4_2_7P369
+
+ util/ntp-keygen.1ntp-keygenman@1.189 +3 -3
+ NTP_4_2_7P369
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.189 +3 -3
+ NTP_4_2_7P369
+
+ util/ntp-keygen.html@1.38 +2 -2
+ NTP_4_2_7P369
+
+ util/ntp-keygen.man.in@1.189 +3 -3
+ NTP_4_2_7P369
+
+ util/ntp-keygen.mdoc.in@1.189 +3 -3
+ NTP_4_2_7P369
+
+ChangeSet@1.2946.1.3, 2013-07-04 23:01:44-04:00, stenn@deacon.udel.edu
+ [Bug 2415] RES_LIMITED flags check should use &, not &&
+
+ ChangeLog@1.1296.1.3 +1 -0
+ [Bug 2415] RES_LIMITED flags check should use &, not &&
+
+ ntpd/ntp_restrict.c@1.35 +1 -1
+ [Bug 2415] RES_LIMITED flags check should use &, not &&
+
+ChangeSet@1.2946.1.2, 2013-07-04 21:45:09-04:00, stenn@deacon.udel.edu
+ Have NTP_LIBNTP check for time.h and clock_getres()
+
+ ChangeLog@1.1296.1.2 +1 -0
+ Have NTP_LIBNTP check for time.h and clock_getres()
+
+ sntp/m4/ntp_libntp.m4@1.18 +2 -2
+ Have NTP_LIBNTP check for time.h and clock_getres()
+
+ChangeSet@1.2939.1.1, 2013-07-04 20:43:53-04:00, stenn@psp-deb1.ntp.org
+ Fix ntpsweep to use sntp instead of ntpdate, from Oliver Kindernay
+
+ ChangeLog@1.1289.1.1 +1 -0
+ Fix ntpsweep to use sntp instead of ntpdate, from Oliver Kindernay
+
+ scripts/ntpsweep.in@1.4 +13 -13
+ Fix ntpsweep to use sntp instead of ntpdate, from Oliver Kindernay
+
+ChangeSet@1.2947, 2013-06-28 13:18:15-04:00, karlsson@psp-deb1.ntp.org
+ [Bug 2413] make check fails to run tests with automake >= 1.13
+
+ BitKeeper/deleted/31/test-driver~38cbd0dac650aed0@1.5 +0 -0
+ Delete: sntp/tests/test-driver
+
+ ChangeLog@1.1297 +1 -0
+ [Bug 2413] make check fails to run tests with automake >= 1.13
+
+ sntp/tests/Makefile.am@1.28 +2 -7
+ [Bug 2413] make check fails to run tests with automake >= 1.13
+
+ sntp/tests/tests-runner@1.1 +13 -0
+ BitKeeper file /home/karlsson/2413/ntp-dev-2413/sntp/tests/tests-runner
+
+ sntp/tests/tests-runner@1.0 +0 -0
+
+ChangeSet@1.2946, 2013-05-01 11:35:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P368
+ TAG: NTP_4_2_7P368
+
+ ChangeLog@1.1296 +1 -0
+ NTP_4_2_7P368
+
+ ntpd/invoke-ntp.conf.texi@1.43 +1 -1
+ NTP_4_2_7P368
+
+ ntpd/invoke-ntp.keys.texi@1.43 +1 -1
+ NTP_4_2_7P368
+
+ ntpd/invoke-ntpd.texi@1.359 +2 -2
+ NTP_4_2_7P368
+
+ ntpd/ntp.conf.5man@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntp.conf.5mdoc@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntp.conf.html@1.41 +1 -1
+ NTP_4_2_7P368
+
+ ntpd/ntp.conf.man.in@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntp.conf.mdoc.in@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntp.keys.5man@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntp.keys.5mdoc@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntp.keys.html@1.42 +1 -1
+ NTP_4_2_7P368
+
+ ntpd/ntp.keys.man.in@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntp.keys.mdoc.in@1.77 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntpd-opts.c@1.377 +7 -7
+ NTP_4_2_7P368
+
+ ntpd/ntpd-opts.h@1.377 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntpd.1ntpdman@1.188 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntpd.1ntpdmdoc@1.188 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntpd.html@1.36 +2 -2
+ NTP_4_2_7P368
+
+ ntpd/ntpd.man.in@1.188 +3 -3
+ NTP_4_2_7P368
+
+ ntpd/ntpd.mdoc.in@1.188 +3 -3
+ NTP_4_2_7P368
+
+ ntpdc/invoke-ntpdc.texi@1.356 +2 -2
+ NTP_4_2_7P368
+
+ ntpdc/ntpdc-opts.c@1.371 +7 -7
+ NTP_4_2_7P368
+
+ ntpdc/ntpdc-opts.h@1.371 +3 -3
+ NTP_4_2_7P368
+
+ ntpdc/ntpdc.1ntpdcman@1.187 +2 -2
+ NTP_4_2_7P368
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.187 +2 -2
+ NTP_4_2_7P368
+
+ ntpdc/ntpdc.html@1.200 +2 -2
+ NTP_4_2_7P368
+
+ ntpdc/ntpdc.man.in@1.187 +2 -2
+ NTP_4_2_7P368
+
+ ntpdc/ntpdc.mdoc.in@1.187 +2 -2
+ NTP_4_2_7P368
+
+ ntpq/invoke-ntpq.texi@1.360 +2 -2
+ NTP_4_2_7P368
+
+ ntpq/ntpq-opts.c@1.374 +7 -7
+ NTP_4_2_7P368
+
+ ntpq/ntpq-opts.h@1.374 +3 -3
+ NTP_4_2_7P368
+
+ ntpq/ntpq.1ntpqman@1.188 +2 -2
+ NTP_4_2_7P368
+
+ ntpq/ntpq.1ntpqmdoc@1.188 +2 -2
+ NTP_4_2_7P368
+
+ ntpq/ntpq.html@1.33 +2 -2
+ NTP_4_2_7P368
+
+ ntpq/ntpq.man.in@1.188 +2 -2
+ NTP_4_2_7P368
+
+ ntpq/ntpq.mdoc.in@1.188 +2 -2
+ NTP_4_2_7P368
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.359 +2 -2
+ NTP_4_2_7P368
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.374 +7 -7
+ NTP_4_2_7P368
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.374 +3 -3
+ NTP_4_2_7P368
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.188 +3 -3
+ NTP_4_2_7P368
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.188 +3 -3
+ NTP_4_2_7P368
+
+ ntpsnmpd/ntpsnmpd.html@1.31 +1 -1
+ NTP_4_2_7P368
+
+ ntpsnmpd/ntpsnmpd.man.in@1.188 +3 -3
+ NTP_4_2_7P368
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.188 +3 -3
+ NTP_4_2_7P368
+
+ packageinfo.sh@1.371 +1 -1
+ NTP_4_2_7P368
+
+ scripts/invoke-ntp-wait.texi@1.176 +1 -1
+ NTP_4_2_7P368
+
+ scripts/ntp-wait.1ntp-waitman@1.187 +3 -3
+ NTP_4_2_7P368
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.187 +3 -3
+ NTP_4_2_7P368
+
+ scripts/ntp-wait.html@1.192 +1 -1
+ NTP_4_2_7P368
+
+ scripts/ntp-wait.man.in@1.187 +3 -3
+ NTP_4_2_7P368
+
+ scripts/ntp-wait.mdoc.in@1.187 +3 -3
+ NTP_4_2_7P368
+
+ sntp/invoke-sntp.texi@1.356 +2 -2
+ NTP_4_2_7P368
+
+ sntp/sntp-opts.c@1.371 +7 -7
+ NTP_4_2_7P368
+
+ sntp/sntp-opts.h@1.371 +3 -3
+ NTP_4_2_7P368
+
+ sntp/sntp.1sntpman@1.191 +3 -3
+ NTP_4_2_7P368
+
+ sntp/sntp.1sntpmdoc@1.191 +3 -3
+ NTP_4_2_7P368
+
+ sntp/sntp.html@1.371 +2 -2
+ NTP_4_2_7P368
+
+ sntp/sntp.man.in@1.191 +3 -3
+ NTP_4_2_7P368
+
+ sntp/sntp.mdoc.in@1.191 +3 -3
+ NTP_4_2_7P368
+
+ util/invoke-ntp-keygen.texi@1.360 +2 -2
+ NTP_4_2_7P368
+
+ util/ntp-keygen-opts.c@1.374 +7 -7
+ NTP_4_2_7P368
+
+ util/ntp-keygen-opts.h@1.374 +3 -3
+ NTP_4_2_7P368
+
+ util/ntp-keygen.1ntp-keygenman@1.188 +3 -3
+ NTP_4_2_7P368
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.188 +3 -3
+ NTP_4_2_7P368
+
+ util/ntp-keygen.html@1.37 +2 -2
+ NTP_4_2_7P368
+
+ util/ntp-keygen.man.in@1.188 +3 -3
+ NTP_4_2_7P368
+
+ util/ntp-keygen.mdoc.in@1.188 +3 -3
+ NTP_4_2_7P368
+
+ChangeSet@1.2945, 2013-04-30 22:36:28-04:00, stenn@pogo.udel.edu
+ [Bug 2145] ntpq dumps core when displaying sys_var_list and more
+
+ ChangeLog@1.1295 +1 -0
+ [Bug 2145] ntpq dumps core when displaying sys_var_list and more
+
+ ntpd/ntp_control.c@1.184 +43 -18
+ [Bug 2145] ntpq dumps core when displaying sys_var_list and more
+
+ChangeSet@1.2944, 2013-04-25 11:43:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P367
+ TAG: NTP_4_2_7P367
+
+ ChangeLog@1.1294 +1 -0
+ NTP_4_2_7P367
+
+ ntpd/invoke-ntp.conf.texi@1.42 +1 -1
+ NTP_4_2_7P367
+
+ ntpd/invoke-ntp.keys.texi@1.42 +1 -1
+ NTP_4_2_7P367
+
+ ntpd/invoke-ntpd.texi@1.358 +2 -2
+ NTP_4_2_7P367
+
+ ntpd/ntp.conf.5man@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntp.conf.5mdoc@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntp.conf.html@1.40 +1 -1
+ NTP_4_2_7P367
+
+ ntpd/ntp.conf.man.in@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntp.conf.mdoc.in@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntp.keys.5man@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntp.keys.5mdoc@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntp.keys.html@1.41 +1 -1
+ NTP_4_2_7P367
+
+ ntpd/ntp.keys.man.in@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntp.keys.mdoc.in@1.76 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntpd-opts.c@1.376 +7 -7
+ NTP_4_2_7P367
+
+ ntpd/ntpd-opts.h@1.376 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntpd.1ntpdman@1.187 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntpd.1ntpdmdoc@1.187 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntpd.html@1.35 +2 -2
+ NTP_4_2_7P367
+
+ ntpd/ntpd.man.in@1.187 +3 -3
+ NTP_4_2_7P367
+
+ ntpd/ntpd.mdoc.in@1.187 +3 -3
+ NTP_4_2_7P367
+
+ ntpdc/invoke-ntpdc.texi@1.355 +2 -2
+ NTP_4_2_7P367
+
+ ntpdc/ntpdc-opts.c@1.370 +7 -7
+ NTP_4_2_7P367
+
+ ntpdc/ntpdc-opts.h@1.370 +3 -3
+ NTP_4_2_7P367
+
+ ntpdc/ntpdc.1ntpdcman@1.186 +2 -2
+ NTP_4_2_7P367
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.186 +2 -2
+ NTP_4_2_7P367
+
+ ntpdc/ntpdc.html@1.199 +2 -2
+ NTP_4_2_7P367
+
+ ntpdc/ntpdc.man.in@1.186 +2 -2
+ NTP_4_2_7P367
+
+ ntpdc/ntpdc.mdoc.in@1.186 +2 -2
+ NTP_4_2_7P367
+
+ ntpq/invoke-ntpq.texi@1.359 +2 -2
+ NTP_4_2_7P367
+
+ ntpq/ntpq-opts.c@1.373 +7 -7
+ NTP_4_2_7P367
+
+ ntpq/ntpq-opts.h@1.373 +3 -3
+ NTP_4_2_7P367
+
+ ntpq/ntpq.1ntpqman@1.187 +2 -2
+ NTP_4_2_7P367
+
+ ntpq/ntpq.1ntpqmdoc@1.187 +2 -2
+ NTP_4_2_7P367
+
+ ntpq/ntpq.html@1.32 +2 -2
+ NTP_4_2_7P367
+
+ ntpq/ntpq.man.in@1.187 +2 -2
+ NTP_4_2_7P367
+
+ ntpq/ntpq.mdoc.in@1.187 +2 -2
+ NTP_4_2_7P367
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.358 +2 -2
+ NTP_4_2_7P367
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.373 +7 -7
+ NTP_4_2_7P367
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.373 +3 -3
+ NTP_4_2_7P367
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.187 +3 -3
+ NTP_4_2_7P367
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.187 +3 -3
+ NTP_4_2_7P367
+
+ ntpsnmpd/ntpsnmpd.html@1.30 +1 -1
+ NTP_4_2_7P367
+
+ ntpsnmpd/ntpsnmpd.man.in@1.187 +3 -3
+ NTP_4_2_7P367
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.187 +3 -3
+ NTP_4_2_7P367
+
+ packageinfo.sh@1.370 +1 -1
+ NTP_4_2_7P367
+
+ scripts/invoke-ntp-wait.texi@1.175 +1 -1
+ NTP_4_2_7P367
+
+ scripts/ntp-wait.1ntp-waitman@1.186 +3 -3
+ NTP_4_2_7P367
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.186 +3 -3
+ NTP_4_2_7P367
+
+ scripts/ntp-wait.html@1.191 +1 -1
+ NTP_4_2_7P367
+
+ scripts/ntp-wait.man.in@1.186 +3 -3
+ NTP_4_2_7P367
+
+ scripts/ntp-wait.mdoc.in@1.186 +3 -3
+ NTP_4_2_7P367
+
+ sntp/invoke-sntp.texi@1.355 +2 -2
+ NTP_4_2_7P367
+
+ sntp/sntp-opts.c@1.370 +7 -7
+ NTP_4_2_7P367
+
+ sntp/sntp-opts.h@1.370 +3 -3
+ NTP_4_2_7P367
+
+ sntp/sntp.1sntpman@1.190 +3 -3
+ NTP_4_2_7P367
+
+ sntp/sntp.1sntpmdoc@1.190 +3 -3
+ NTP_4_2_7P367
+
+ sntp/sntp.html@1.370 +2 -2
+ NTP_4_2_7P367
+
+ sntp/sntp.man.in@1.190 +3 -3
+ NTP_4_2_7P367
+
+ sntp/sntp.mdoc.in@1.190 +3 -3
+ NTP_4_2_7P367
+
+ util/invoke-ntp-keygen.texi@1.359 +2 -2
+ NTP_4_2_7P367
+
+ util/ntp-keygen-opts.c@1.373 +7 -7
+ NTP_4_2_7P367
+
+ util/ntp-keygen-opts.h@1.373 +3 -3
+ NTP_4_2_7P367
+
+ util/ntp-keygen.1ntp-keygenman@1.187 +3 -3
+ NTP_4_2_7P367
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.187 +3 -3
+ NTP_4_2_7P367
+
+ util/ntp-keygen.html@1.36 +2 -2
+ NTP_4_2_7P367
+
+ util/ntp-keygen.man.in@1.187 +3 -3
+ NTP_4_2_7P367
+
+ util/ntp-keygen.mdoc.in@1.187 +3 -3
+ NTP_4_2_7P367
+
+ChangeSet@1.2943, 2013-04-24 19:13:53-04:00, stenn@deacon.udel.edu
+ [Bug 2382] Implement LOGTOD using ldexp() instead of shifting
+
+ ChangeLog@1.1293 +1 -0
+ [Bug 2382] Implement LOGTOD using ldexp() instead of shifting
+
+ include/ntp.h@1.207 +2 -3
+ [Bug 2382] Implement LOGTOD using ldexp() instead of shifting
+
+ChangeSet@1.2942, 2013-04-17 12:50:12-04:00, utterback@pogo.udel.edu
+ ChangeLog, ifiter_ioctl.c:
+ [Bug 1485] Sometimes ntpd crashes
+
+ ChangeLog@1.1292 +1 -0
+ [Bug 1485] Sometimes ntpd crashes
+
+ lib/isc/unix/ifiter_ioctl.c@1.32 +26 -11
+ [Bug 1485] Sometimes ntpd crashes
+
+ChangeSet@1.2941, 2013-04-17 11:36:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P366
+ TAG: NTP_4_2_7P366
+
+ ChangeLog@1.1291 +1 -0
+ NTP_4_2_7P366
+
+ ntpd/invoke-ntp.conf.texi@1.41 +1 -1
+ NTP_4_2_7P366
+
+ ntpd/invoke-ntp.keys.texi@1.41 +1 -1
+ NTP_4_2_7P366
+
+ ntpd/invoke-ntpd.texi@1.357 +2 -2
+ NTP_4_2_7P366
+
+ ntpd/ntp.conf.5man@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntp.conf.5mdoc@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntp.conf.html@1.39 +1 -1
+ NTP_4_2_7P366
+
+ ntpd/ntp.conf.man.in@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntp.conf.mdoc.in@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntp.keys.5man@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntp.keys.5mdoc@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntp.keys.html@1.40 +1 -1
+ NTP_4_2_7P366
+
+ ntpd/ntp.keys.man.in@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntp.keys.mdoc.in@1.75 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntpd-opts.c@1.375 +7 -7
+ NTP_4_2_7P366
+
+ ntpd/ntpd-opts.h@1.375 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntpd.1ntpdman@1.186 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntpd.1ntpdmdoc@1.186 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntpd.html@1.34 +2 -2
+ NTP_4_2_7P366
+
+ ntpd/ntpd.man.in@1.186 +3 -3
+ NTP_4_2_7P366
+
+ ntpd/ntpd.mdoc.in@1.186 +3 -3
+ NTP_4_2_7P366
+
+ ntpdc/invoke-ntpdc.texi@1.354 +2 -2
+ NTP_4_2_7P366
+
+ ntpdc/ntpdc-opts.c@1.369 +7 -7
+ NTP_4_2_7P366
+
+ ntpdc/ntpdc-opts.h@1.369 +3 -3
+ NTP_4_2_7P366
+
+ ntpdc/ntpdc.1ntpdcman@1.185 +2 -2
+ NTP_4_2_7P366
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.185 +2 -2
+ NTP_4_2_7P366
+
+ ntpdc/ntpdc.html@1.198 +2 -2
+ NTP_4_2_7P366
+
+ ntpdc/ntpdc.man.in@1.185 +2 -2
+ NTP_4_2_7P366
+
+ ntpdc/ntpdc.mdoc.in@1.185 +2 -2
+ NTP_4_2_7P366
+
+ ntpq/invoke-ntpq.texi@1.358 +2 -2
+ NTP_4_2_7P366
+
+ ntpq/ntpq-opts.c@1.372 +7 -7
+ NTP_4_2_7P366
+
+ ntpq/ntpq-opts.h@1.372 +3 -3
+ NTP_4_2_7P366
+
+ ntpq/ntpq.1ntpqman@1.186 +2 -2
+ NTP_4_2_7P366
+
+ ntpq/ntpq.1ntpqmdoc@1.186 +2 -2
+ NTP_4_2_7P366
+
+ ntpq/ntpq.html@1.31 +2 -2
+ NTP_4_2_7P366
+
+ ntpq/ntpq.man.in@1.186 +2 -2
+ NTP_4_2_7P366
+
+ ntpq/ntpq.mdoc.in@1.186 +2 -2
+ NTP_4_2_7P366
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.357 +2 -2
+ NTP_4_2_7P366
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.372 +7 -7
+ NTP_4_2_7P366
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.372 +3 -3
+ NTP_4_2_7P366
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.186 +3 -3
+ NTP_4_2_7P366
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.186 +3 -3
+ NTP_4_2_7P366
+
+ ntpsnmpd/ntpsnmpd.html@1.29 +1 -1
+ NTP_4_2_7P366
+
+ ntpsnmpd/ntpsnmpd.man.in@1.186 +3 -3
+ NTP_4_2_7P366
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.186 +3 -3
+ NTP_4_2_7P366
+
+ packageinfo.sh@1.369 +1 -1
+ NTP_4_2_7P366
+
+ scripts/invoke-ntp-wait.texi@1.174 +1 -1
+ NTP_4_2_7P366
+
+ scripts/ntp-wait.1ntp-waitman@1.185 +3 -3
+ NTP_4_2_7P366
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.185 +3 -3
+ NTP_4_2_7P366
+
+ scripts/ntp-wait.html@1.190 +1 -1
+ NTP_4_2_7P366
+
+ scripts/ntp-wait.man.in@1.185 +3 -3
+ NTP_4_2_7P366
+
+ scripts/ntp-wait.mdoc.in@1.185 +3 -3
+ NTP_4_2_7P366
+
+ sntp/invoke-sntp.texi@1.354 +2 -2
+ NTP_4_2_7P366
+
+ sntp/sntp-opts.c@1.369 +7 -7
+ NTP_4_2_7P366
+
+ sntp/sntp-opts.h@1.369 +3 -3
+ NTP_4_2_7P366
+
+ sntp/sntp.1sntpman@1.189 +3 -3
+ NTP_4_2_7P366
+
+ sntp/sntp.1sntpmdoc@1.189 +3 -3
+ NTP_4_2_7P366
+
+ sntp/sntp.html@1.369 +2 -2
+ NTP_4_2_7P366
+
+ sntp/sntp.man.in@1.189 +3 -3
+ NTP_4_2_7P366
+
+ sntp/sntp.mdoc.in@1.189 +3 -3
+ NTP_4_2_7P366
+
+ util/invoke-ntp-keygen.texi@1.358 +2 -2
+ NTP_4_2_7P366
+
+ util/ntp-keygen-opts.c@1.372 +7 -7
+ NTP_4_2_7P366
+
+ util/ntp-keygen-opts.h@1.372 +3 -3
+ NTP_4_2_7P366
+
+ util/ntp-keygen.1ntp-keygenman@1.186 +3 -3
+ NTP_4_2_7P366
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.186 +3 -3
+ NTP_4_2_7P366
+
+ util/ntp-keygen.html@1.35 +2 -2
+ NTP_4_2_7P366
+
+ util/ntp-keygen.man.in@1.186 +3 -3
+ NTP_4_2_7P366
+
+ util/ntp-keygen.mdoc.in@1.186 +3 -3
+ NTP_4_2_7P366
+
+ChangeSet@1.2940, 2013-04-16 19:58:03-04:00, stenn@deacon.udel.edu
+ [Bug 1866] Disable some debugging output in refclock_oncore
+
+ ChangeLog@1.1290 +1 -0
+ [Bug 1866] Disable some debugging output in refclock_oncore
+
+ ntpd/refclock_oncore.c@1.95 +7 -0
+ [Bug 1866] Disable some debugging output in refclock_oncore
+
+ChangeSet@1.2939, 2013-04-16 09:55:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P365
+ TAG: NTP_4_2_7P365
+
+ ChangeLog@1.1289 +1 -0
+ NTP_4_2_7P365
+
+ ntpd/invoke-ntp.conf.texi@1.40 +1 -1
+ NTP_4_2_7P365
+
+ ntpd/invoke-ntp.keys.texi@1.40 +1 -1
+ NTP_4_2_7P365
+
+ ntpd/invoke-ntpd.texi@1.356 +2 -2
+ NTP_4_2_7P365
+
+ ntpd/ntp.conf.5man@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntp.conf.5mdoc@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntp.conf.html@1.38 +1 -1
+ NTP_4_2_7P365
+
+ ntpd/ntp.conf.man.in@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntp.conf.mdoc.in@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntp.keys.5man@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntp.keys.5mdoc@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntp.keys.html@1.39 +1 -1
+ NTP_4_2_7P365
+
+ ntpd/ntp.keys.man.in@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntp.keys.mdoc.in@1.74 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntpd-opts.c@1.374 +7 -7
+ NTP_4_2_7P365
+
+ ntpd/ntpd-opts.h@1.374 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntpd.1ntpdman@1.185 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntpd.1ntpdmdoc@1.185 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntpd.html@1.33 +2 -2
+ NTP_4_2_7P365
+
+ ntpd/ntpd.man.in@1.185 +3 -3
+ NTP_4_2_7P365
+
+ ntpd/ntpd.mdoc.in@1.185 +3 -3
+ NTP_4_2_7P365
+
+ ntpdc/invoke-ntpdc.texi@1.353 +2 -2
+ NTP_4_2_7P365
+
+ ntpdc/ntpdc-opts.c@1.368 +7 -7
+ NTP_4_2_7P365
+
+ ntpdc/ntpdc-opts.h@1.368 +3 -3
+ NTP_4_2_7P365
+
+ ntpdc/ntpdc.1ntpdcman@1.184 +2 -2
+ NTP_4_2_7P365
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.184 +2 -2
+ NTP_4_2_7P365
+
+ ntpdc/ntpdc.html@1.197 +2 -2
+ NTP_4_2_7P365
+
+ ntpdc/ntpdc.man.in@1.184 +2 -2
+ NTP_4_2_7P365
+
+ ntpdc/ntpdc.mdoc.in@1.184 +2 -2
+ NTP_4_2_7P365
+
+ ntpq/invoke-ntpq.texi@1.357 +2 -2
+ NTP_4_2_7P365
+
+ ntpq/ntpq-opts.c@1.371 +7 -7
+ NTP_4_2_7P365
+
+ ntpq/ntpq-opts.h@1.371 +3 -3
+ NTP_4_2_7P365
+
+ ntpq/ntpq.1ntpqman@1.185 +2 -2
+ NTP_4_2_7P365
+
+ ntpq/ntpq.1ntpqmdoc@1.185 +2 -2
+ NTP_4_2_7P365
+
+ ntpq/ntpq.html@1.30 +2 -2
+ NTP_4_2_7P365
+
+ ntpq/ntpq.man.in@1.185 +2 -2
+ NTP_4_2_7P365
+
+ ntpq/ntpq.mdoc.in@1.185 +2 -2
+ NTP_4_2_7P365
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.356 +2 -2
+ NTP_4_2_7P365
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.371 +7 -7
+ NTP_4_2_7P365
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.371 +3 -3
+ NTP_4_2_7P365
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.185 +3 -3
+ NTP_4_2_7P365
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.185 +3 -3
+ NTP_4_2_7P365
+
+ ntpsnmpd/ntpsnmpd.html@1.28 +1 -1
+ NTP_4_2_7P365
+
+ ntpsnmpd/ntpsnmpd.man.in@1.185 +3 -3
+ NTP_4_2_7P365
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.185 +3 -3
+ NTP_4_2_7P365
+
+ packageinfo.sh@1.368 +1 -1
+ NTP_4_2_7P365
+
+ scripts/invoke-ntp-wait.texi@1.173 +1 -1
+ NTP_4_2_7P365
+
+ scripts/ntp-wait.1ntp-waitman@1.184 +3 -3
+ NTP_4_2_7P365
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.184 +3 -3
+ NTP_4_2_7P365
+
+ scripts/ntp-wait.html@1.189 +1 -1
+ NTP_4_2_7P365
+
+ scripts/ntp-wait.man.in@1.184 +3 -3
+ NTP_4_2_7P365
+
+ scripts/ntp-wait.mdoc.in@1.184 +3 -3
+ NTP_4_2_7P365
+
+ sntp/invoke-sntp.texi@1.353 +2 -2
+ NTP_4_2_7P365
+
+ sntp/sntp-opts.c@1.368 +7 -7
+ NTP_4_2_7P365
+
+ sntp/sntp-opts.h@1.368 +3 -3
+ NTP_4_2_7P365
+
+ sntp/sntp.1sntpman@1.188 +3 -3
+ NTP_4_2_7P365
+
+ sntp/sntp.1sntpmdoc@1.188 +3 -3
+ NTP_4_2_7P365
+
+ sntp/sntp.html@1.368 +2 -2
+ NTP_4_2_7P365
+
+ sntp/sntp.man.in@1.188 +3 -3
+ NTP_4_2_7P365
+
+ sntp/sntp.mdoc.in@1.188 +3 -3
+ NTP_4_2_7P365
+
+ util/invoke-ntp-keygen.texi@1.357 +2 -2
+ NTP_4_2_7P365
+
+ util/ntp-keygen-opts.c@1.371 +7 -7
+ NTP_4_2_7P365
+
+ util/ntp-keygen-opts.h@1.371 +3 -3
+ NTP_4_2_7P365
+
+ util/ntp-keygen.1ntp-keygenman@1.185 +3 -3
+ NTP_4_2_7P365
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.185 +3 -3
+ NTP_4_2_7P365
+
+ util/ntp-keygen.html@1.34 +2 -2
+ NTP_4_2_7P365
+
+ util/ntp-keygen.man.in@1.185 +3 -3
+ NTP_4_2_7P365
+
+ util/ntp-keygen.mdoc.in@1.185 +3 -3
+ NTP_4_2_7P365
+
+ChangeSet@1.2936.1.1, 2013-04-16 09:32:43+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2149] Log an error message if /proc/net/if_inet6 cannot be opened
+
+ ChangeLog@1.1288 +1 -0
+ [Bug 2149] Log an error message if /proc/net/if_inet6 cannot be opened
+
+ lib/isc/unix/ifiter_getifaddrs.c@1.10 +8 -2
+ [Bug 2149] Log an error message if /proc/net/if_inet6 cannot be opened
+
+ChangeSet@1.2937, 2013-04-16 05:22:18-04:00, stenn@deacon.udel.edu
+ Clean up autogen-version check
+
+ sntp/include/autogen-version.def@1.17 +1 -1
+ Clean up autogen-version check
+
+ChangeSet@1.2936, 2013-03-26 11:35:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P364
+ TAG: NTP_4_2_7P364
+
+ ChangeLog@1.1287 +1 -0
+ NTP_4_2_7P364
+
+ ntpd/invoke-ntp.conf.texi@1.39 +1 -1
+ NTP_4_2_7P364
+
+ ntpd/invoke-ntp.keys.texi@1.39 +1 -1
+ NTP_4_2_7P364
+
+ ntpd/invoke-ntpd.texi@1.355 +2 -2
+ NTP_4_2_7P364
+
+ ntpd/ntp.conf.5man@1.73 +3 -3
+ NTP_4_2_7P364
+
+ ntpd/ntp.conf.5mdoc@1.73 +2 -2
+ NTP_4_2_7P364
+
+ ntpd/ntp.conf.html@1.37 +1 -1
+ NTP_4_2_7P364
+
+ ntpd/ntp.conf.man.in@1.73 +3 -3
+ NTP_4_2_7P364
+
+ ntpd/ntp.conf.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P364
+
+ ntpd/ntp.keys.5man@1.73 +3 -3
+ NTP_4_2_7P364
+
+ ntpd/ntp.keys.5mdoc@1.73 +2 -2
+ NTP_4_2_7P364
+
+ ntpd/ntp.keys.html@1.38 +1 -1
+ NTP_4_2_7P364
+
+ ntpd/ntp.keys.man.in@1.73 +3 -3
+ NTP_4_2_7P364
+
+ ntpd/ntp.keys.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P364
+
+ ntpd/ntpd-opts.c@1.373 +7 -7
+ NTP_4_2_7P364
+
+ ntpd/ntpd-opts.h@1.373 +3 -3
+ NTP_4_2_7P364
+
+ ntpd/ntpd.1ntpdman@1.184 +3 -3
+ NTP_4_2_7P364
+
+ ntpd/ntpd.1ntpdmdoc@1.184 +2 -2
+ NTP_4_2_7P364
+
+ ntpd/ntpd.html@1.32 +2 -2
+ NTP_4_2_7P364
+
+ ntpd/ntpd.man.in@1.184 +3 -3
+ NTP_4_2_7P364
+
+ ntpd/ntpd.mdoc.in@1.184 +2 -2
+ NTP_4_2_7P364
+
+ ntpdc/invoke-ntpdc.texi@1.352 +2 -2
+ NTP_4_2_7P364
+
+ ntpdc/ntpdc-opts.c@1.367 +7 -7
+ NTP_4_2_7P364
+
+ ntpdc/ntpdc-opts.h@1.367 +3 -3
+ NTP_4_2_7P364
+
+ ntpdc/ntpdc.1ntpdcman@1.183 +2 -2
+ NTP_4_2_7P364
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.183 +1 -1
+ NTP_4_2_7P364
+
+ ntpdc/ntpdc.html@1.196 +2 -2
+ NTP_4_2_7P364
+
+ ntpdc/ntpdc.man.in@1.183 +2 -2
+ NTP_4_2_7P364
+
+ ntpdc/ntpdc.mdoc.in@1.183 +1 -1
+ NTP_4_2_7P364
+
+ ntpq/invoke-ntpq.texi@1.356 +2 -2
+ NTP_4_2_7P364
+
+ ntpq/ntpq-opts.c@1.370 +7 -7
+ NTP_4_2_7P364
+
+ ntpq/ntpq-opts.h@1.370 +3 -3
+ NTP_4_2_7P364
+
+ ntpq/ntpq.1ntpqman@1.184 +2 -2
+ NTP_4_2_7P364
+
+ ntpq/ntpq.1ntpqmdoc@1.184 +1 -1
+ NTP_4_2_7P364
+
+ ntpq/ntpq.html@1.29 +2 -2
+ NTP_4_2_7P364
+
+ ntpq/ntpq.man.in@1.184 +2 -2
+ NTP_4_2_7P364
+
+ ntpq/ntpq.mdoc.in@1.184 +1 -1
+ NTP_4_2_7P364
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.355 +2 -2
+ NTP_4_2_7P364
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.370 +7 -7
+ NTP_4_2_7P364
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.370 +3 -3
+ NTP_4_2_7P364
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.184 +3 -3
+ NTP_4_2_7P364
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.184 +2 -2
+ NTP_4_2_7P364
+
+ ntpsnmpd/ntpsnmpd.html@1.27 +1 -1
+ NTP_4_2_7P364
+
+ ntpsnmpd/ntpsnmpd.man.in@1.184 +3 -3
+ NTP_4_2_7P364
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.184 +2 -2
+ NTP_4_2_7P364
+
+ packageinfo.sh@1.367 +1 -1
+ NTP_4_2_7P364
+
+ scripts/invoke-ntp-wait.texi@1.172 +1 -1
+ NTP_4_2_7P364
+
+ scripts/ntp-wait.1ntp-waitman@1.183 +3 -3
+ NTP_4_2_7P364
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.183 +2 -2
+ NTP_4_2_7P364
+
+ scripts/ntp-wait.html@1.188 +1 -1
+ NTP_4_2_7P364
+
+ scripts/ntp-wait.man.in@1.183 +3 -3
+ NTP_4_2_7P364
+
+ scripts/ntp-wait.mdoc.in@1.183 +2 -2
+ NTP_4_2_7P364
+
+ sntp/invoke-sntp.texi@1.352 +2 -2
+ NTP_4_2_7P364
+
+ sntp/sntp-opts.c@1.367 +7 -7
+ NTP_4_2_7P364
+
+ sntp/sntp-opts.h@1.367 +3 -3
+ NTP_4_2_7P364
+
+ sntp/sntp.1sntpman@1.187 +3 -3
+ NTP_4_2_7P364
+
+ sntp/sntp.1sntpmdoc@1.187 +2 -2
+ NTP_4_2_7P364
+
+ sntp/sntp.html@1.367 +2 -2
+ NTP_4_2_7P364
+
+ sntp/sntp.man.in@1.187 +3 -3
+ NTP_4_2_7P364
+
+ sntp/sntp.mdoc.in@1.187 +2 -2
+ NTP_4_2_7P364
+
+ util/invoke-ntp-keygen.texi@1.356 +2 -2
+ NTP_4_2_7P364
+
+ util/ntp-keygen-opts.c@1.370 +7 -7
+ NTP_4_2_7P364
+
+ util/ntp-keygen-opts.h@1.370 +3 -3
+ NTP_4_2_7P364
+
+ util/ntp-keygen.1ntp-keygenman@1.184 +3 -3
+ NTP_4_2_7P364
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.184 +2 -2
+ NTP_4_2_7P364
+
+ util/ntp-keygen.html@1.33 +2 -2
+ NTP_4_2_7P364
+
+ util/ntp-keygen.man.in@1.184 +3 -3
+ NTP_4_2_7P364
+
+ util/ntp-keygen.mdoc.in@1.184 +2 -2
+ NTP_4_2_7P364
+
+ChangeSet@1.2935, 2013-03-26 06:25:16-04:00, stenn@deacon.udel.edu
+ sntp/include/autogen-version.def
+
+ ChangeLog@1.1286 +1 -0
+ sntp/include/autogen-version.def
+
+ sntp/include/autogen-version.def@1.16 +2 -1
+ sntp/include/autogen-version.def
+
+ChangeSet@1.2934, 2013-03-26 09:16:08+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P363
+ TAG: NTP_4_2_7P363
+
+ ChangeLog@1.1285 +1 -0
+ NTP_4_2_7P363
+
+ ntpd/invoke-ntp.conf.texi@1.38 +1 -1
+ NTP_4_2_7P363
+
+ ntpd/invoke-ntp.keys.texi@1.38 +1 -1
+ NTP_4_2_7P363
+
+ ntpd/invoke-ntpd.texi@1.354 +2 -2
+ NTP_4_2_7P363
+
+ ntpd/ntp.conf.5man@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntp.conf.5mdoc@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntp.conf.html@1.36 +1 -1
+ NTP_4_2_7P363
+
+ ntpd/ntp.conf.man.in@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntp.conf.mdoc.in@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntp.keys.5man@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntp.keys.5mdoc@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntp.keys.html@1.37 +1 -1
+ NTP_4_2_7P363
+
+ ntpd/ntp.keys.man.in@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntp.keys.mdoc.in@1.72 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntpd-opts.c@1.372 +7 -7
+ NTP_4_2_7P363
+
+ ntpd/ntpd-opts.h@1.372 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntpd.1ntpdman@1.183 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntpd.1ntpdmdoc@1.183 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntpd.html@1.31 +2 -2
+ NTP_4_2_7P363
+
+ ntpd/ntpd.man.in@1.183 +3 -3
+ NTP_4_2_7P363
+
+ ntpd/ntpd.mdoc.in@1.183 +3 -3
+ NTP_4_2_7P363
+
+ ntpdc/invoke-ntpdc.texi@1.351 +2 -2
+ NTP_4_2_7P363
+
+ ntpdc/ntpdc-opts.c@1.366 +7 -7
+ NTP_4_2_7P363
+
+ ntpdc/ntpdc-opts.h@1.366 +3 -3
+ NTP_4_2_7P363
+
+ ntpdc/ntpdc.1ntpdcman@1.182 +2 -2
+ NTP_4_2_7P363
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.182 +2 -2
+ NTP_4_2_7P363
+
+ ntpdc/ntpdc.html@1.195 +2 -2
+ NTP_4_2_7P363
+
+ ntpdc/ntpdc.man.in@1.182 +2 -2
+ NTP_4_2_7P363
+
+ ntpdc/ntpdc.mdoc.in@1.182 +2 -2
+ NTP_4_2_7P363
+
+ ntpq/invoke-ntpq.texi@1.355 +2 -2
+ NTP_4_2_7P363
+
+ ntpq/ntpq-opts.c@1.369 +7 -7
+ NTP_4_2_7P363
+
+ ntpq/ntpq-opts.h@1.369 +3 -3
+ NTP_4_2_7P363
+
+ ntpq/ntpq.1ntpqman@1.183 +2 -2
+ NTP_4_2_7P363
+
+ ntpq/ntpq.1ntpqmdoc@1.183 +2 -2
+ NTP_4_2_7P363
+
+ ntpq/ntpq.html@1.28 +2 -2
+ NTP_4_2_7P363
+
+ ntpq/ntpq.man.in@1.183 +2 -2
+ NTP_4_2_7P363
+
+ ntpq/ntpq.mdoc.in@1.183 +2 -2
+ NTP_4_2_7P363
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.354 +2 -2
+ NTP_4_2_7P363
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.369 +7 -7
+ NTP_4_2_7P363
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.369 +3 -3
+ NTP_4_2_7P363
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.183 +3 -3
+ NTP_4_2_7P363
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.183 +3 -3
+ NTP_4_2_7P363
+
+ ntpsnmpd/ntpsnmpd.html@1.26 +1 -1
+ NTP_4_2_7P363
+
+ ntpsnmpd/ntpsnmpd.man.in@1.183 +3 -3
+ NTP_4_2_7P363
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.183 +3 -3
+ NTP_4_2_7P363
+
+ packageinfo.sh@1.366 +1 -1
+ NTP_4_2_7P363
+
+ scripts/invoke-ntp-wait.texi@1.171 +1 -1
+ NTP_4_2_7P363
+
+ scripts/ntp-wait.1ntp-waitman@1.182 +3 -3
+ NTP_4_2_7P363
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.182 +3 -3
+ NTP_4_2_7P363
+
+ scripts/ntp-wait.html@1.187 +1 -1
+ NTP_4_2_7P363
+
+ scripts/ntp-wait.man.in@1.182 +3 -3
+ NTP_4_2_7P363
+
+ scripts/ntp-wait.mdoc.in@1.182 +3 -3
+ NTP_4_2_7P363
+
+ sntp/invoke-sntp.texi@1.351 +2 -2
+ NTP_4_2_7P363
+
+ sntp/sntp-opts.c@1.366 +7 -7
+ NTP_4_2_7P363
+
+ sntp/sntp-opts.h@1.366 +3 -3
+ NTP_4_2_7P363
+
+ sntp/sntp.1sntpman@1.186 +3 -3
+ NTP_4_2_7P363
+
+ sntp/sntp.1sntpmdoc@1.186 +3 -3
+ NTP_4_2_7P363
+
+ sntp/sntp.html@1.366 +2 -2
+ NTP_4_2_7P363
+
+ sntp/sntp.man.in@1.186 +3 -3
+ NTP_4_2_7P363
+
+ sntp/sntp.mdoc.in@1.186 +3 -3
+ NTP_4_2_7P363
+
+ util/invoke-ntp-keygen.texi@1.355 +2 -2
+ NTP_4_2_7P363
+
+ util/ntp-keygen-opts.c@1.369 +7 -7
+ NTP_4_2_7P363
+
+ util/ntp-keygen-opts.h@1.369 +3 -3
+ NTP_4_2_7P363
+
+ util/ntp-keygen.1ntp-keygenman@1.183 +3 -3
+ NTP_4_2_7P363
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.183 +3 -3
+ NTP_4_2_7P363
+
+ util/ntp-keygen.html@1.32 +2 -2
+ NTP_4_2_7P363
+
+ util/ntp-keygen.man.in@1.183 +3 -3
+ NTP_4_2_7P363
+
+ util/ntp-keygen.mdoc.in@1.183 +3 -3
+ NTP_4_2_7P363
+
+ChangeSet@1.2933, 2013-03-26 04:56:04-04:00, stenn@deacon.udel.edu
+ Upgrade to libopts from 5.17.3pre10
+
+ ChangeLog@1.1284 +2 -0
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/Makefile.am@1.20 +4 -4
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/ag-char-map.h@1.23 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/ao-strs.c@1.9 +2 -2
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/ao-strs.h@1.8 +2 -2
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/autoopts/options.h@1.22 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/autoopts/usage-txt.h@1.22 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/genshell.c@1.23 +116 -114
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/genshell.h@1.23 +13 -12
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/m4/libopts.m4@1.26 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/option-value-type.c@1.10 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/option-value-type.h@1.24 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/option-xat-attribute.c@1.10 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/option-xat-attribute.h@1.24 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/proto.h@1.23 +1 -1
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/streqvcmp.c@1.13 +16 -2
+ Upgrade to libopts from 5.17.3pre10
+
+ sntp/libopts/usage.c@1.16 +3 -3
+ Upgrade to libopts from 5.17.3pre10
+
+ChangeSet@1.2932, 2013-03-19 11:40:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P362
+ TAG: NTP_4_2_7P362
+
+ ChangeLog@1.1283 +1 -0
+ NTP_4_2_7P362
+
+ ntpd/invoke-ntp.conf.texi@1.37 +1 -1
+ NTP_4_2_7P362
+
+ ntpd/invoke-ntp.keys.texi@1.37 +1 -1
+ NTP_4_2_7P362
+
+ ntpd/invoke-ntpd.texi@1.353 +2 -2
+ NTP_4_2_7P362
+
+ ntpd/ntp.conf.5man@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntp.conf.5mdoc@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntp.conf.html@1.35 +1 -1
+ NTP_4_2_7P362
+
+ ntpd/ntp.conf.man.in@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntp.conf.mdoc.in@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntp.keys.5man@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntp.keys.5mdoc@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntp.keys.html@1.36 +1 -1
+ NTP_4_2_7P362
+
+ ntpd/ntp.keys.man.in@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntp.keys.mdoc.in@1.71 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntpd-opts.c@1.371 +7 -7
+ NTP_4_2_7P362
+
+ ntpd/ntpd-opts.h@1.371 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntpd.1ntpdman@1.182 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntpd.1ntpdmdoc@1.182 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntpd.html@1.30 +2 -2
+ NTP_4_2_7P362
+
+ ntpd/ntpd.man.in@1.182 +3 -3
+ NTP_4_2_7P362
+
+ ntpd/ntpd.mdoc.in@1.182 +3 -3
+ NTP_4_2_7P362
+
+ ntpdc/invoke-ntpdc.texi@1.350 +2 -2
+ NTP_4_2_7P362
+
+ ntpdc/ntpdc-opts.c@1.365 +7 -7
+ NTP_4_2_7P362
+
+ ntpdc/ntpdc-opts.h@1.365 +3 -3
+ NTP_4_2_7P362
+
+ ntpdc/ntpdc.1ntpdcman@1.181 +2 -2
+ NTP_4_2_7P362
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.181 +2 -2
+ NTP_4_2_7P362
+
+ ntpdc/ntpdc.html@1.194 +2 -2
+ NTP_4_2_7P362
+
+ ntpdc/ntpdc.man.in@1.181 +2 -2
+ NTP_4_2_7P362
+
+ ntpdc/ntpdc.mdoc.in@1.181 +2 -2
+ NTP_4_2_7P362
+
+ ntpq/invoke-ntpq.texi@1.354 +2 -2
+ NTP_4_2_7P362
+
+ ntpq/ntpq-opts.c@1.368 +7 -7
+ NTP_4_2_7P362
+
+ ntpq/ntpq-opts.h@1.368 +3 -3
+ NTP_4_2_7P362
+
+ ntpq/ntpq.1ntpqman@1.182 +2 -2
+ NTP_4_2_7P362
+
+ ntpq/ntpq.1ntpqmdoc@1.182 +2 -2
+ NTP_4_2_7P362
+
+ ntpq/ntpq.html@1.27 +2 -2
+ NTP_4_2_7P362
+
+ ntpq/ntpq.man.in@1.182 +2 -2
+ NTP_4_2_7P362
+
+ ntpq/ntpq.mdoc.in@1.182 +2 -2
+ NTP_4_2_7P362
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.353 +2 -2
+ NTP_4_2_7P362
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.368 +7 -7
+ NTP_4_2_7P362
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.368 +3 -3
+ NTP_4_2_7P362
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.182 +3 -3
+ NTP_4_2_7P362
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.182 +3 -3
+ NTP_4_2_7P362
+
+ ntpsnmpd/ntpsnmpd.html@1.25 +1 -1
+ NTP_4_2_7P362
+
+ ntpsnmpd/ntpsnmpd.man.in@1.182 +3 -3
+ NTP_4_2_7P362
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.182 +3 -3
+ NTP_4_2_7P362
+
+ packageinfo.sh@1.365 +1 -1
+ NTP_4_2_7P362
+
+ scripts/invoke-ntp-wait.texi@1.170 +1 -1
+ NTP_4_2_7P362
+
+ scripts/ntp-wait.1ntp-waitman@1.181 +3 -3
+ NTP_4_2_7P362
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.181 +3 -3
+ NTP_4_2_7P362
+
+ scripts/ntp-wait.html@1.186 +1 -1
+ NTP_4_2_7P362
+
+ scripts/ntp-wait.man.in@1.181 +3 -3
+ NTP_4_2_7P362
+
+ scripts/ntp-wait.mdoc.in@1.181 +3 -3
+ NTP_4_2_7P362
+
+ sntp/invoke-sntp.texi@1.350 +2 -2
+ NTP_4_2_7P362
+
+ sntp/sntp-opts.c@1.365 +7 -7
+ NTP_4_2_7P362
+
+ sntp/sntp-opts.h@1.365 +3 -3
+ NTP_4_2_7P362
+
+ sntp/sntp.1sntpman@1.185 +3 -3
+ NTP_4_2_7P362
+
+ sntp/sntp.1sntpmdoc@1.185 +3 -3
+ NTP_4_2_7P362
+
+ sntp/sntp.html@1.365 +2 -2
+ NTP_4_2_7P362
+
+ sntp/sntp.man.in@1.185 +3 -3
+ NTP_4_2_7P362
+
+ sntp/sntp.mdoc.in@1.185 +3 -3
+ NTP_4_2_7P362
+
+ util/invoke-ntp-keygen.texi@1.354 +2 -2
+ NTP_4_2_7P362
+
+ util/ntp-keygen-opts.c@1.368 +7 -7
+ NTP_4_2_7P362
+
+ util/ntp-keygen-opts.h@1.368 +3 -3
+ NTP_4_2_7P362
+
+ util/ntp-keygen.1ntp-keygenman@1.182 +3 -3
+ NTP_4_2_7P362
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.182 +3 -3
+ NTP_4_2_7P362
+
+ util/ntp-keygen.html@1.31 +2 -2
+ NTP_4_2_7P362
+
+ util/ntp-keygen.man.in@1.182 +3 -3
+ NTP_4_2_7P362
+
+ util/ntp-keygen.mdoc.in@1.182 +3 -3
+ NTP_4_2_7P362
+
+ChangeSet@1.2931, 2013-03-19 06:26:04-04:00, stenn@deacon.udel.edu
+ [Bug 2364] "sed -i" is not portable
+
+ ChangeLog@1.1282 +1 -0
+ [Bug 2364] "sed -i" is not portable
+
+ configure.ac@1.558 +1 -1
+ [Bug 2364] "sed -i" is not portable
+
+ChangeSet@1.2930, 2013-03-17 05:08:00+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P361
+ TAG: NTP_4_2_7P361
+
+ ChangeLog@1.1281 +1 -0
+ NTP_4_2_7P361
+
+ ntpd/invoke-ntp.conf.texi@1.36 +1 -1
+ NTP_4_2_7P361
+
+ ntpd/invoke-ntp.keys.texi@1.36 +1 -1
+ NTP_4_2_7P361
+
+ ntpd/invoke-ntpd.texi@1.352 +2 -2
+ NTP_4_2_7P361
+
+ ntpd/ntp.conf.5man@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntp.conf.5mdoc@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntp.conf.html@1.34 +1 -1
+ NTP_4_2_7P361
+
+ ntpd/ntp.conf.man.in@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntp.conf.mdoc.in@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntp.keys.5man@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntp.keys.5mdoc@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntp.keys.html@1.35 +1 -1
+ NTP_4_2_7P361
+
+ ntpd/ntp.keys.man.in@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntp.keys.mdoc.in@1.70 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntpd-opts.c@1.370 +10 -11
+ NTP_4_2_7P361
+
+ ntpd/ntpd-opts.h@1.370 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntpd.1ntpdman@1.181 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntpd.1ntpdmdoc@1.181 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntpd.html@1.29 +2 -2
+ NTP_4_2_7P361
+
+ ntpd/ntpd.man.in@1.181 +3 -3
+ NTP_4_2_7P361
+
+ ntpd/ntpd.mdoc.in@1.181 +3 -3
+ NTP_4_2_7P361
+
+ ntpdc/invoke-ntpdc.texi@1.349 +2 -2
+ NTP_4_2_7P361
+
+ ntpdc/ntpdc-opts.c@1.364 +10 -11
+ NTP_4_2_7P361
+
+ ntpdc/ntpdc-opts.h@1.364 +3 -3
+ NTP_4_2_7P361
+
+ ntpdc/ntpdc.1ntpdcman@1.180 +2 -2
+ NTP_4_2_7P361
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.180 +2 -2
+ NTP_4_2_7P361
+
+ ntpdc/ntpdc.html@1.193 +2 -2
+ NTP_4_2_7P361
+
+ ntpdc/ntpdc.man.in@1.180 +2 -2
+ NTP_4_2_7P361
+
+ ntpdc/ntpdc.mdoc.in@1.180 +2 -2
+ NTP_4_2_7P361
+
+ ntpq/invoke-ntpq.texi@1.353 +2 -2
+ NTP_4_2_7P361
+
+ ntpq/ntpq-opts.c@1.367 +10 -11
+ NTP_4_2_7P361
+
+ ntpq/ntpq-opts.h@1.367 +3 -3
+ NTP_4_2_7P361
+
+ ntpq/ntpq.1ntpqman@1.181 +2 -2
+ NTP_4_2_7P361
+
+ ntpq/ntpq.1ntpqmdoc@1.181 +2 -2
+ NTP_4_2_7P361
+
+ ntpq/ntpq.html@1.26 +2 -2
+ NTP_4_2_7P361
+
+ ntpq/ntpq.man.in@1.181 +2 -2
+ NTP_4_2_7P361
+
+ ntpq/ntpq.mdoc.in@1.181 +2 -2
+ NTP_4_2_7P361
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.352 +2 -2
+ NTP_4_2_7P361
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.367 +10 -11
+ NTP_4_2_7P361
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.367 +3 -3
+ NTP_4_2_7P361
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.181 +3 -3
+ NTP_4_2_7P361
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.181 +3 -3
+ NTP_4_2_7P361
+
+ ntpsnmpd/ntpsnmpd.html@1.24 +1 -1
+ NTP_4_2_7P361
+
+ ntpsnmpd/ntpsnmpd.man.in@1.181 +3 -3
+ NTP_4_2_7P361
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.181 +3 -3
+ NTP_4_2_7P361
+
+ packageinfo.sh@1.364 +1 -1
+ NTP_4_2_7P361
+
+ scripts/invoke-ntp-wait.texi@1.169 +1 -1
+ NTP_4_2_7P361
+
+ scripts/ntp-wait.1ntp-waitman@1.180 +3 -3
+ NTP_4_2_7P361
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.180 +3 -3
+ NTP_4_2_7P361
+
+ scripts/ntp-wait.html@1.185 +1 -1
+ NTP_4_2_7P361
+
+ scripts/ntp-wait.man.in@1.180 +3 -3
+ NTP_4_2_7P361
+
+ scripts/ntp-wait.mdoc.in@1.180 +3 -3
+ NTP_4_2_7P361
+
+ sntp/invoke-sntp.texi@1.349 +2 -2
+ NTP_4_2_7P361
+
+ sntp/sntp-opts.c@1.364 +10 -11
+ NTP_4_2_7P361
+
+ sntp/sntp-opts.h@1.364 +3 -3
+ NTP_4_2_7P361
+
+ sntp/sntp.1sntpman@1.184 +3 -3
+ NTP_4_2_7P361
+
+ sntp/sntp.1sntpmdoc@1.184 +3 -3
+ NTP_4_2_7P361
+
+ sntp/sntp.html@1.364 +2 -2
+ NTP_4_2_7P361
+
+ sntp/sntp.man.in@1.184 +3 -3
+ NTP_4_2_7P361
+
+ sntp/sntp.mdoc.in@1.184 +3 -3
+ NTP_4_2_7P361
+
+ util/invoke-ntp-keygen.texi@1.353 +2 -2
+ NTP_4_2_7P361
+
+ util/ntp-keygen-opts.c@1.367 +10 -11
+ NTP_4_2_7P361
+
+ util/ntp-keygen-opts.h@1.367 +3 -3
+ NTP_4_2_7P361
+
+ util/ntp-keygen.1ntp-keygenman@1.181 +3 -3
+ NTP_4_2_7P361
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.181 +3 -3
+ NTP_4_2_7P361
+
+ util/ntp-keygen.html@1.30 +2 -2
+ NTP_4_2_7P361
+
+ util/ntp-keygen.man.in@1.181 +3 -3
+ NTP_4_2_7P361
+
+ util/ntp-keygen.mdoc.in@1.181 +3 -3
+ NTP_4_2_7P361
+
+ChangeSet@1.2929, 2013-03-17 00:09:12+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2365] "make check" fails in libevent
+
+ ChangeLog@1.1280 +1 -0
+ [Bug 2365] "make check" fails in libevent
+
+ sntp/libevent/test/include.am@1.2 +1 -1
+ [Bug 2365] "make check" fails in libevent
+
+ChangeSet@1.2928, 2013-03-16 23:12:44+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl
+
+ ChangeLog@1.1279 +1 -0
+ [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl
+
+ configure.ac@1.557 +1 -0
+ [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl
+
+ sntp/configure.ac@1.73 +1 -0
+ [Bug 2357] sntp/libopts/usage.c sometimes needs -lintl
+
+ChangeSet@1.2927, 2013-03-15 07:13:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P360
+ TAG: NTP_4_2_7P360
+
+ ChangeLog@1.1278 +1 -0
+ NTP_4_2_7P360
+
+ ntpd/invoke-ntp.conf.texi@1.35 +1 -1
+ NTP_4_2_7P360
+
+ ntpd/invoke-ntp.keys.texi@1.35 +1 -1
+ NTP_4_2_7P360
+
+ ntpd/invoke-ntpd.texi@1.351 +2 -2
+ NTP_4_2_7P360
+
+ ntpd/ntp.conf.5man@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntp.conf.5mdoc@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntp.conf.html@1.33 +1 -1
+ NTP_4_2_7P360
+
+ ntpd/ntp.conf.man.in@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntp.conf.mdoc.in@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntp.keys.5man@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntp.keys.5mdoc@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntp.keys.html@1.34 +1 -1
+ NTP_4_2_7P360
+
+ ntpd/ntp.keys.man.in@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntp.keys.mdoc.in@1.69 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntpd-opts.c@1.369 +7 -7
+ NTP_4_2_7P360
+
+ ntpd/ntpd-opts.h@1.369 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntpd.1ntpdman@1.180 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntpd.1ntpdmdoc@1.180 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntpd.html@1.28 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntpd.man.in@1.180 +3 -3
+ NTP_4_2_7P360
+
+ ntpd/ntpd.mdoc.in@1.180 +3 -3
+ NTP_4_2_7P360
+
+ ntpdc/invoke-ntpdc.texi@1.348 +2 -2
+ NTP_4_2_7P360
+
+ ntpdc/ntpdc-opts.c@1.363 +7 -7
+ NTP_4_2_7P360
+
+ ntpdc/ntpdc-opts.h@1.363 +3 -3
+ NTP_4_2_7P360
+
+ ntpdc/ntpdc.1ntpdcman@1.179 +2 -2
+ NTP_4_2_7P360
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.179 +2 -2
+ NTP_4_2_7P360
+
+ ntpdc/ntpdc.html@1.192 +2 -2
+ NTP_4_2_7P360
+
+ ntpdc/ntpdc.man.in@1.179 +2 -2
+ NTP_4_2_7P360
+
+ ntpdc/ntpdc.mdoc.in@1.179 +2 -2
+ NTP_4_2_7P360
+
+ ntpq/invoke-ntpq.texi@1.352 +2 -2
+ NTP_4_2_7P360
+
+ ntpq/ntpq-opts.c@1.366 +7 -7
+ NTP_4_2_7P360
+
+ ntpq/ntpq-opts.h@1.366 +3 -3
+ NTP_4_2_7P360
+
+ ntpq/ntpq.1ntpqman@1.180 +2 -2
+ NTP_4_2_7P360
+
+ ntpq/ntpq.1ntpqmdoc@1.180 +2 -2
+ NTP_4_2_7P360
+
+ ntpq/ntpq.html@1.25 +3 -3
+ NTP_4_2_7P360
+
+ ntpq/ntpq.man.in@1.180 +2 -2
+ NTP_4_2_7P360
+
+ ntpq/ntpq.mdoc.in@1.180 +2 -2
+ NTP_4_2_7P360
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.351 +2 -2
+ NTP_4_2_7P360
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.366 +7 -7
+ NTP_4_2_7P360
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.366 +3 -3
+ NTP_4_2_7P360
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.180 +3 -3
+ NTP_4_2_7P360
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.180 +3 -3
+ NTP_4_2_7P360
+
+ ntpsnmpd/ntpsnmpd.html@1.23 +1 -1
+ NTP_4_2_7P360
+
+ ntpsnmpd/ntpsnmpd.man.in@1.180 +3 -3
+ NTP_4_2_7P360
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.180 +3 -3
+ NTP_4_2_7P360
+
+ packageinfo.sh@1.363 +1 -1
+ NTP_4_2_7P360
+
+ scripts/invoke-ntp-wait.texi@1.168 +1 -1
+ NTP_4_2_7P360
+
+ scripts/ntp-wait.1ntp-waitman@1.179 +3 -3
+ NTP_4_2_7P360
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.179 +3 -3
+ NTP_4_2_7P360
+
+ scripts/ntp-wait.html@1.184 +1 -1
+ NTP_4_2_7P360
+
+ scripts/ntp-wait.man.in@1.179 +3 -3
+ NTP_4_2_7P360
+
+ scripts/ntp-wait.mdoc.in@1.179 +3 -3
+ NTP_4_2_7P360
+
+ sntp/invoke-sntp.texi@1.348 +2 -2
+ NTP_4_2_7P360
+
+ sntp/sntp-opts.c@1.363 +7 -7
+ NTP_4_2_7P360
+
+ sntp/sntp-opts.h@1.363 +3 -3
+ NTP_4_2_7P360
+
+ sntp/sntp.1sntpman@1.183 +3 -3
+ NTP_4_2_7P360
+
+ sntp/sntp.1sntpmdoc@1.183 +3 -3
+ NTP_4_2_7P360
+
+ sntp/sntp.html@1.363 +2 -2
+ NTP_4_2_7P360
+
+ sntp/sntp.man.in@1.183 +3 -3
+ NTP_4_2_7P360
+
+ sntp/sntp.mdoc.in@1.183 +3 -3
+ NTP_4_2_7P360
+
+ util/invoke-ntp-keygen.texi@1.352 +2 -2
+ NTP_4_2_7P360
+
+ util/ntp-keygen-opts.c@1.366 +7 -7
+ NTP_4_2_7P360
+
+ util/ntp-keygen-opts.h@1.366 +3 -3
+ NTP_4_2_7P360
+
+ util/ntp-keygen.1ntp-keygenman@1.180 +3 -3
+ NTP_4_2_7P360
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.180 +3 -3
+ NTP_4_2_7P360
+
+ util/ntp-keygen.html@1.29 +3 -3
+ NTP_4_2_7P360
+
+ util/ntp-keygen.man.in@1.180 +3 -3
+ NTP_4_2_7P360
+
+ util/ntp-keygen.mdoc.in@1.180 +3 -3
+ NTP_4_2_7P360
+
+ChangeSet@1.2926, 2013-03-15 02:31:25-04:00, stenn@psp-deb1.ntp.org
+ UPgrade libevent (Coverity fixes, etc.).
+ ChangeLog, kod_management.c:
+ EEXIST is OK for mkdir() in sntp/kod_management.c
+
+ BitKeeper/deleted/00/Makefile.am~474636ab6fc9e8d9@1.5 +0 -0
+ Delete: sntp/libevent/include/Makefile.am
+
+ BitKeeper/deleted/51/Makefile.am~1dee536054aa1db2@1.11 +0 -0
+ Delete: sntp/libevent/test/Makefile.am
+
+ BitKeeper/deleted/97/Makefile.am~e1e2decef1947524@1.8 +0 -0
+ Delete: sntp/libevent/sample/Makefile.am
+
+ ChangeLog@1.1277 +1 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ ChangeLog@1.1276 +1 -0
+ EEXIST is OK for mkdir() in sntp/kod_management.c
+
+ sntp/kod_management.c@1.31 +2 -1
+ EEXIST is OK for mkdir() in sntp/kod_management.c
+
+ sntp/libevent/ChangeLog@1.7 +192 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/ChangeLog-2.0@1.2 +56 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/Makefile.am@1.11 +27 -14
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/Makefile.nmake@1.4 +37 -4
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/README@1.6 +18 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/WIN32-Code/event2/event-config.h@1.6 +2 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/buffer.c@1.8 +39 -13
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/bufferevent-internal.h@1.6 +2 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/bufferevent.c@1.6 +25 -14
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/bufferevent_openssl.c@1.7 +68 -38
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/bufferevent_pair.c@1.6 +2 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/bufferevent_sock.c@1.6 +26 -6
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/configure.ac@1.13 +42 -30
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/configure.ac@1.12 +0 -0
+ Rename: sntp/libevent/configure.in -> sntp/libevent/configure.ac
+
+ sntp/libevent/defer-internal.h@1.5 +16 -52
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/epoll.c@1.5 +6 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evbuffer-internal.h@1.6 +8 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evdns.c@1.8 +29 -5
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/event-internal.h@1.8 +59 -16
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/event.c@1.9 +580 -273
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/event_rpcgen.py@1.3 +17 -6
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evmap.c@1.6 +2 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evthread-internal.h@1.6 +1 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evthread.c@1.7 +7 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evthread_pthread.c@1.6 +1 -13
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evthread_win32.c@1.6 +1 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evutil.c@1.8 +201 -78
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evutil_rand.c@1.6 +1 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/evutil_time.c@1.2 +2 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/http-internal.h@1.4 +4 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/http.c@1.8 +99 -56
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/event2/buffer.h@1.5 +22 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/event2/bufferevent.h@1.4 +6 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/event2/event.h@1.8 +81 -29
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/event2/event_struct.h@1.4 +38 -22
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/event2/http.h@1.5 +3 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/event2/thread.h@1.5 +4 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/event2/util.h@1.5 +5 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/include/include.am@1.1 +45 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/include.am
+
+ sntp/libevent/include/include.am@1.0 +0 -0
+
+ sntp/libevent/libevent_openssl.pc.in@1.3 +2 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/listener.c@1.6 +27 -18
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/log.c@1.5 +8 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/make_epoll_table.py@1.2 +1 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/sample/event-read-fifo.c@1.5 +3 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/sample/http-server.c@1.8 +11 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/sample/include.am@1.1 +40 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/include.am
+
+ sntp/libevent/sample/include.am@1.0 +0 -0
+
+ sntp/libevent/sample/signal-test.c@1.4 +1 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/sample/time-test.c@1.4 +1 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/signal.c@1.7 +3 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/Makefile.nmake@1.4 +22 -6
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/bench.c@1.4 +8 -8
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/bench_cascade.c@1.4 +16 -11
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/bench_httpclient.c@1.6 +12 -4
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/check-dumpevents.py@1.3 +1 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/include.am@1.1 +144 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/include.am
+
+ sntp/libevent/test/include.am@1.0 +0 -0
+
+ sntp/libevent/test/print-winsock-errors.c@1.1 +84 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/print-winsock-errors.c
+
+ sntp/libevent/test/print-winsock-errors.c@1.0 +0 -0
+
+ sntp/libevent/test/regress.c@1.4 +175 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_buffer.c@1.6 +81 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_bufferevent.c@1.4 +13 -5
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_dns.c@1.6 +19 -17
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_et.c@1.4 +3 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_http.c@1.6 +126 -51
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_listener.c@1.6 +1 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_main.c@1.5 +31 -4
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_rpc.c@1.5 +5 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_ssl.c@1.5 +30 -7
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_testutils.c@1.6 +8 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_thread.c@1.4 +24 -13
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_util.c@1.5 +93 -16
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/regress_zlib.c@1.4 +2 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.3 +13 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test-changelist.c@1.4 +1 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test-dumpevents.c@1.2 +1 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test-eof.c@1.6 +3 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test-init.c@1.4 +1 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test-ratelim.c@1.7 +10 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test-time.c@1.4 +1 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test-weof.c@1.4 +1 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/test.sh@1.7 +11 -4
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/tinytest.c@1.5 +83 -22
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/tinytest.h@1.3 +14 -3
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/test/tinytest_demo.c@1.3 +42 -0
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/util-internal.h@1.8 +27 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/whatsnew-2.0.txt@1.4 +1 -1
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/whatsnew-2.1.txt@1.2 +135 -4
+ Upgrade libevent (coverity fixes, etc.)
+
+ sntp/libevent/win32select.c@1.4 +3 -2
+ Upgrade libevent (coverity fixes, etc.)
+
+ChangeSet@1.2925, 2013-03-03 11:39:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P359
+ TAG: NTP_4_2_7P359
+
+ ChangeLog@1.1275 +1 -0
+ NTP_4_2_7P359
+
+ ntpd/invoke-ntp.conf.texi@1.34 +1 -1
+ NTP_4_2_7P359
+
+ ntpd/invoke-ntp.keys.texi@1.34 +1 -1
+ NTP_4_2_7P359
+
+ ntpd/invoke-ntpd.texi@1.350 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.conf.5man@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.conf.5mdoc@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.conf.html@1.32 +1 -1
+ NTP_4_2_7P359
+
+ ntpd/ntp.conf.man.in@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.conf.mdoc.in@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.keys.5man@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.keys.5mdoc@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.keys.html@1.33 +1 -1
+ NTP_4_2_7P359
+
+ ntpd/ntp.keys.man.in@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntp.keys.mdoc.in@1.68 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntpd-opts.c@1.368 +7 -7
+ NTP_4_2_7P359
+
+ ntpd/ntpd-opts.h@1.368 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntpd.1ntpdman@1.179 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntpd.1ntpdmdoc@1.179 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntpd.html@1.27 +2 -2
+ NTP_4_2_7P359
+
+ ntpd/ntpd.man.in@1.179 +3 -3
+ NTP_4_2_7P359
+
+ ntpd/ntpd.mdoc.in@1.179 +3 -3
+ NTP_4_2_7P359
+
+ ntpdc/invoke-ntpdc.texi@1.347 +3 -3
+ NTP_4_2_7P359
+
+ ntpdc/ntpdc-opts.c@1.362 +7 -7
+ NTP_4_2_7P359
+
+ ntpdc/ntpdc-opts.h@1.362 +3 -3
+ NTP_4_2_7P359
+
+ ntpdc/ntpdc.1ntpdcman@1.178 +2 -2
+ NTP_4_2_7P359
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.178 +2 -2
+ NTP_4_2_7P359
+
+ ntpdc/ntpdc.html@1.191 +3 -3
+ NTP_4_2_7P359
+
+ ntpdc/ntpdc.man.in@1.178 +2 -2
+ NTP_4_2_7P359
+
+ ntpdc/ntpdc.mdoc.in@1.178 +2 -2
+ NTP_4_2_7P359
+
+ ntpq/invoke-ntpq.texi@1.351 +3 -3
+ NTP_4_2_7P359
+
+ ntpq/ntpq-opts.c@1.365 +7 -7
+ NTP_4_2_7P359
+
+ ntpq/ntpq-opts.h@1.365 +3 -3
+ NTP_4_2_7P359
+
+ ntpq/ntpq.1ntpqman@1.179 +2 -2
+ NTP_4_2_7P359
+
+ ntpq/ntpq.1ntpqmdoc@1.179 +2 -2
+ NTP_4_2_7P359
+
+ ntpq/ntpq.html@1.24 +2 -2
+ NTP_4_2_7P359
+
+ ntpq/ntpq.man.in@1.179 +2 -2
+ NTP_4_2_7P359
+
+ ntpq/ntpq.mdoc.in@1.179 +2 -2
+ NTP_4_2_7P359
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.350 +3 -3
+ NTP_4_2_7P359
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.365 +7 -7
+ NTP_4_2_7P359
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.365 +3 -3
+ NTP_4_2_7P359
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.179 +3 -3
+ NTP_4_2_7P359
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.179 +3 -3
+ NTP_4_2_7P359
+
+ ntpsnmpd/ntpsnmpd.html@1.22 +1 -1
+ NTP_4_2_7P359
+
+ ntpsnmpd/ntpsnmpd.man.in@1.179 +3 -3
+ NTP_4_2_7P359
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.179 +3 -3
+ NTP_4_2_7P359
+
+ packageinfo.sh@1.362 +1 -1
+ NTP_4_2_7P359
+
+ scripts/invoke-ntp-wait.texi@1.167 +1 -1
+ NTP_4_2_7P359
+
+ scripts/ntp-wait.1ntp-waitman@1.178 +3 -3
+ NTP_4_2_7P359
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.178 +3 -3
+ NTP_4_2_7P359
+
+ scripts/ntp-wait.html@1.183 +1 -1
+ NTP_4_2_7P359
+
+ scripts/ntp-wait.man.in@1.178 +3 -3
+ NTP_4_2_7P359
+
+ scripts/ntp-wait.mdoc.in@1.178 +3 -3
+ NTP_4_2_7P359
+
+ sntp/invoke-sntp.texi@1.347 +2 -2
+ NTP_4_2_7P359
+
+ sntp/sntp-opts.c@1.362 +7 -7
+ NTP_4_2_7P359
+
+ sntp/sntp-opts.h@1.362 +3 -3
+ NTP_4_2_7P359
+
+ sntp/sntp.1sntpman@1.182 +3 -3
+ NTP_4_2_7P359
+
+ sntp/sntp.1sntpmdoc@1.182 +3 -3
+ NTP_4_2_7P359
+
+ sntp/sntp.html@1.362 +2 -2
+ NTP_4_2_7P359
+
+ sntp/sntp.man.in@1.182 +3 -3
+ NTP_4_2_7P359
+
+ sntp/sntp.mdoc.in@1.182 +3 -3
+ NTP_4_2_7P359
+
+ util/invoke-ntp-keygen.texi@1.351 +3 -3
+ NTP_4_2_7P359
+
+ util/ntp-keygen-opts.c@1.365 +7 -7
+ NTP_4_2_7P359
+
+ util/ntp-keygen-opts.h@1.365 +3 -3
+ NTP_4_2_7P359
+
+ util/ntp-keygen.1ntp-keygenman@1.179 +3 -3
+ NTP_4_2_7P359
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.179 +3 -3
+ NTP_4_2_7P359
+
+ util/ntp-keygen.html@1.28 +2 -2
+ NTP_4_2_7P359
+
+ util/ntp-keygen.man.in@1.179 +3 -3
+ NTP_4_2_7P359
+
+ util/ntp-keygen.mdoc.in@1.179 +3 -3
+ NTP_4_2_7P359
+
+ChangeSet@1.2924, 2013-03-02 22:41:29-05:00, stenn@deacon.udel.edu
+ [Bug 2359] Fix send_via_ntp_signd() prototype
+
+ ChangeLog@1.1274 +1 -0
+ [Bug 2359] Fix send_via_ntp_signd() prototype
+
+ include/ntpd.h@1.174 +1 -1
+ [Bug 2359] Fix send_via_ntp_signd() prototype
+
+ChangeSet@1.2923, 2013-02-27 11:39:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P358
+ TAG: NTP_4_2_7P358
+
+ ChangeLog@1.1273 +1 -0
+ NTP_4_2_7P358
+
+ ntpd/invoke-ntp.conf.texi@1.33 +1 -1
+ NTP_4_2_7P358
+
+ ntpd/invoke-ntp.keys.texi@1.33 +1 -1
+ NTP_4_2_7P358
+
+ ntpd/invoke-ntpd.texi@1.349 +2 -2
+ NTP_4_2_7P358
+
+ ntpd/ntp.conf.5man@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntp.conf.5mdoc@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntp.conf.html@1.31 +1 -1
+ NTP_4_2_7P358
+
+ ntpd/ntp.conf.man.in@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntp.conf.mdoc.in@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntp.keys.5man@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntp.keys.5mdoc@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntp.keys.html@1.32 +1 -1
+ NTP_4_2_7P358
+
+ ntpd/ntp.keys.man.in@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntp.keys.mdoc.in@1.67 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntpd-opts.c@1.367 +248 -95
+ NTP_4_2_7P358
+
+ ntpd/ntpd-opts.h@1.367 +37 -15
+ NTP_4_2_7P358
+
+ ntpd/ntpd.1ntpdman@1.178 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntpd.1ntpdmdoc@1.178 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntpd.html@1.26 +2 -2
+ NTP_4_2_7P358
+
+ ntpd/ntpd.man.in@1.178 +3 -3
+ NTP_4_2_7P358
+
+ ntpd/ntpd.mdoc.in@1.178 +3 -3
+ NTP_4_2_7P358
+
+ ntpdc/invoke-ntpdc.texi@1.346 +2 -2
+ NTP_4_2_7P358
+
+ ntpdc/ntpdc-opts.c@1.361 +124 -71
+ NTP_4_2_7P358
+
+ ntpdc/ntpdc-opts.h@1.361 +39 -15
+ NTP_4_2_7P358
+
+ ntpdc/ntpdc.1ntpdcman@1.177 +2 -2
+ NTP_4_2_7P358
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.177 +2 -2
+ NTP_4_2_7P358
+
+ ntpdc/ntpdc.html@1.190 +2 -2
+ NTP_4_2_7P358
+
+ ntpdc/ntpdc.man.in@1.177 +2 -2
+ NTP_4_2_7P358
+
+ ntpdc/ntpdc.mdoc.in@1.177 +2 -2
+ NTP_4_2_7P358
+
+ ntpq/invoke-ntpq.texi@1.350 +2 -2
+ NTP_4_2_7P358
+
+ ntpq/ntpq-opts.c@1.364 +117 -70
+ NTP_4_2_7P358
+
+ ntpq/ntpq-opts.h@1.364 +39 -15
+ NTP_4_2_7P358
+
+ ntpq/ntpq.1ntpqman@1.178 +2 -2
+ NTP_4_2_7P358
+
+ ntpq/ntpq.1ntpqmdoc@1.178 +2 -2
+ NTP_4_2_7P358
+
+ ntpq/ntpq.html@1.23 +2 -2
+ NTP_4_2_7P358
+
+ ntpq/ntpq.man.in@1.178 +2 -2
+ NTP_4_2_7P358
+
+ ntpq/ntpq.mdoc.in@1.178 +2 -2
+ NTP_4_2_7P358
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.349 +2 -2
+ NTP_4_2_7P358
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.364 +81 -61
+ NTP_4_2_7P358
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.364 +39 -15
+ NTP_4_2_7P358
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.178 +3 -3
+ NTP_4_2_7P358
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.178 +3 -3
+ NTP_4_2_7P358
+
+ ntpsnmpd/ntpsnmpd.html@1.21 +1 -1
+ NTP_4_2_7P358
+
+ ntpsnmpd/ntpsnmpd.man.in@1.178 +3 -3
+ NTP_4_2_7P358
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.178 +3 -3
+ NTP_4_2_7P358
+
+ packageinfo.sh@1.361 +1 -1
+ NTP_4_2_7P358
+
+ scripts/invoke-ntp-wait.texi@1.166 +1 -1
+ NTP_4_2_7P358
+
+ scripts/ntp-wait.1ntp-waitman@1.177 +3 -3
+ NTP_4_2_7P358
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.177 +3 -3
+ NTP_4_2_7P358
+
+ scripts/ntp-wait.html@1.182 +1 -1
+ NTP_4_2_7P358
+
+ scripts/ntp-wait.man.in@1.177 +3 -3
+ NTP_4_2_7P358
+
+ scripts/ntp-wait.mdoc.in@1.177 +3 -3
+ NTP_4_2_7P358
+
+ sntp/invoke-sntp.texi@1.346 +3 -3
+ NTP_4_2_7P358
+
+ sntp/sntp-opts.c@1.361 +189 -94
+ NTP_4_2_7P358
+
+ sntp/sntp-opts.h@1.361 +39 -15
+ NTP_4_2_7P358
+
+ sntp/sntp.1sntpman@1.181 +3 -3
+ NTP_4_2_7P358
+
+ sntp/sntp.1sntpmdoc@1.181 +3 -3
+ NTP_4_2_7P358
+
+ sntp/sntp.html@1.361 +3 -3
+ NTP_4_2_7P358
+
+ sntp/sntp.man.in@1.181 +3 -3
+ NTP_4_2_7P358
+
+ sntp/sntp.mdoc.in@1.181 +3 -3
+ NTP_4_2_7P358
+
+ util/invoke-ntp-keygen.texi@1.350 +2 -2
+ NTP_4_2_7P358
+
+ util/ntp-keygen-opts.c@1.364 +179 -88
+ NTP_4_2_7P358
+
+ util/ntp-keygen-opts.h@1.364 +39 -15
+ NTP_4_2_7P358
+
+ util/ntp-keygen.1ntp-keygenman@1.178 +3 -3
+ NTP_4_2_7P358
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.178 +3 -3
+ NTP_4_2_7P358
+
+ util/ntp-keygen.html@1.27 +2 -2
+ NTP_4_2_7P358
+
+ util/ntp-keygen.man.in@1.178 +3 -3
+ NTP_4_2_7P358
+
+ util/ntp-keygen.mdoc.in@1.178 +3 -3
+ NTP_4_2_7P358
+
+ChangeSet@1.2919.1.1, 2013-02-27 10:18:58+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ ChangeLog@1.1270.1.1 +1 -0
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/Makefile.am@1.19 +3 -3
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/ag-char-map.h@1.22 +1 -1
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/ao-strs.c@1.8 +1 -1
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/ao-strs.h@1.7 +1 -1
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/autoopts/options.h@1.21 +2 -1
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/autoopts/usage-txt.h@1.21 +141 -141
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/configfile.c@1.19 +31 -18
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/genshell.c@1.22 +31 -14
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/genshell.h@1.22 +33 -12
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/m4/libopts.m4@1.25 +40 -21
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/nested.c@1.13 +2 -10
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/option-value-type.c@1.9 +3 -3
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/option-value-type.h@1.23 +3 -3
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/option-xat-attribute.c@1.9 +3 -3
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/option-xat-attribute.h@1.23 +1 -1
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/proto.h@1.22 +3 -3
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ sntp/libopts/usage.c@1.15 +18 -5
+ Upgrade to autogen-5.17.3pre4 and libopts-38.0.13
+
+ChangeSet@1.2921, 2013-02-22 03:49:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P357
+ TAG: NTP_4_2_7P357
+
+ ChangeLog@1.1271 +1 -0
+ NTP_4_2_7P357
+
+ ntpd/invoke-ntp.conf.texi@1.32 +1 -1
+ NTP_4_2_7P357
+
+ ntpd/invoke-ntp.keys.texi@1.32 +1 -1
+ NTP_4_2_7P357
+
+ ntpd/invoke-ntpd.texi@1.348 +2 -2
+ NTP_4_2_7P357
+
+ ntpd/ntp.conf.5man@1.66 +3 -3
+ NTP_4_2_7P357
+
+ ntpd/ntp.conf.5mdoc@1.66 +2 -2
+ NTP_4_2_7P357
+
+ ntpd/ntp.conf.html@1.30 +1 -1
+ NTP_4_2_7P357
+
+ ntpd/ntp.conf.man.in@1.66 +3 -3
+ NTP_4_2_7P357
+
+ ntpd/ntp.conf.mdoc.in@1.66 +2 -2
+ NTP_4_2_7P357
+
+ ntpd/ntp.keys.5man@1.66 +3 -3
+ NTP_4_2_7P357
+
+ ntpd/ntp.keys.5mdoc@1.66 +2 -2
+ NTP_4_2_7P357
+
+ ntpd/ntp.keys.html@1.31 +1 -1
+ NTP_4_2_7P357
+
+ ntpd/ntp.keys.man.in@1.66 +3 -3
+ NTP_4_2_7P357
+
+ ntpd/ntp.keys.mdoc.in@1.66 +2 -2
+ NTP_4_2_7P357
+
+ ntpd/ntpd-opts.c@1.366 +7 -7
+ NTP_4_2_7P357
+
+ ntpd/ntpd-opts.h@1.366 +3 -3
+ NTP_4_2_7P357
+
+ ntpd/ntpd.1ntpdman@1.177 +3 -3
+ NTP_4_2_7P357
+
+ ntpd/ntpd.1ntpdmdoc@1.177 +2 -2
+ NTP_4_2_7P357
+
+ ntpd/ntpd.html@1.25 +12 -18
+ NTP_4_2_7P357
+
+ ntpd/ntpd.man.in@1.177 +3 -3
+ NTP_4_2_7P357
+
+ ntpd/ntpd.mdoc.in@1.177 +2 -2
+ NTP_4_2_7P357
+
+ ntpdc/invoke-ntpdc.texi@1.345 +2 -2
+ NTP_4_2_7P357
+
+ ntpdc/ntpdc-opts.c@1.360 +7 -7
+ NTP_4_2_7P357
+
+ ntpdc/ntpdc-opts.h@1.360 +3 -3
+ NTP_4_2_7P357
+
+ ntpdc/ntpdc.1ntpdcman@1.176 +2 -2
+ NTP_4_2_7P357
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.176 +1 -1
+ NTP_4_2_7P357
+
+ ntpdc/ntpdc.html@1.189 +2 -2
+ NTP_4_2_7P357
+
+ ntpdc/ntpdc.man.in@1.176 +2 -2
+ NTP_4_2_7P357
+
+ ntpdc/ntpdc.mdoc.in@1.176 +1 -1
+ NTP_4_2_7P357
+
+ ntpq/invoke-ntpq.texi@1.349 +2 -2
+ NTP_4_2_7P357
+
+ ntpq/ntpq-opts.c@1.363 +7 -7
+ NTP_4_2_7P357
+
+ ntpq/ntpq-opts.h@1.363 +3 -3
+ NTP_4_2_7P357
+
+ ntpq/ntpq.1ntpqman@1.177 +2 -2
+ NTP_4_2_7P357
+
+ ntpq/ntpq.1ntpqmdoc@1.177 +1 -1
+ NTP_4_2_7P357
+
+ ntpq/ntpq.html@1.22 +13 -16
+ NTP_4_2_7P357
+
+ ntpq/ntpq.man.in@1.177 +2 -2
+ NTP_4_2_7P357
+
+ ntpq/ntpq.mdoc.in@1.177 +1 -1
+ NTP_4_2_7P357
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.348 +2 -2
+ NTP_4_2_7P357
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.363 +7 -7
+ NTP_4_2_7P357
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.363 +3 -3
+ NTP_4_2_7P357
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.177 +3 -3
+ NTP_4_2_7P357
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.177 +2 -2
+ NTP_4_2_7P357
+
+ ntpsnmpd/ntpsnmpd.html@1.20 +1 -1
+ NTP_4_2_7P357
+
+ ntpsnmpd/ntpsnmpd.man.in@1.177 +3 -3
+ NTP_4_2_7P357
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.177 +2 -2
+ NTP_4_2_7P357
+
+ packageinfo.sh@1.360 +1 -1
+ NTP_4_2_7P357
+
+ scripts/invoke-ntp-wait.texi@1.165 +2 -2
+ NTP_4_2_7P357
+
+ scripts/ntp-wait.1ntp-waitman@1.176 +3 -3
+ NTP_4_2_7P357
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.176 +3 -3
+ NTP_4_2_7P357
+
+ scripts/ntp-wait.html@1.181 +2 -2
+ NTP_4_2_7P357
+
+ scripts/ntp-wait.man.in@1.176 +3 -3
+ NTP_4_2_7P357
+
+ scripts/ntp-wait.mdoc.in@1.176 +3 -3
+ NTP_4_2_7P357
+
+ sntp/invoke-sntp.texi@1.345 +2 -2
+ NTP_4_2_7P357
+
+ sntp/sntp-opts.c@1.360 +7 -7
+ NTP_4_2_7P357
+
+ sntp/sntp-opts.h@1.360 +3 -3
+ NTP_4_2_7P357
+
+ sntp/sntp.1sntpman@1.180 +3 -3
+ NTP_4_2_7P357
+
+ sntp/sntp.1sntpmdoc@1.180 +2 -2
+ NTP_4_2_7P357
+
+ sntp/sntp.html@1.360 +2 -2
+ NTP_4_2_7P357
+
+ sntp/sntp.man.in@1.180 +3 -3
+ NTP_4_2_7P357
+
+ sntp/sntp.mdoc.in@1.180 +2 -2
+ NTP_4_2_7P357
+
+ util/invoke-ntp-keygen.texi@1.349 +2 -2
+ NTP_4_2_7P357
+
+ util/ntp-keygen-opts.c@1.363 +7 -7
+ NTP_4_2_7P357
+
+ util/ntp-keygen-opts.h@1.363 +3 -3
+ NTP_4_2_7P357
+
+ util/ntp-keygen.1ntp-keygenman@1.177 +3 -3
+ NTP_4_2_7P357
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.177 +2 -2
+ NTP_4_2_7P357
+
+ util/ntp-keygen.html@1.26 +12 -13
+ NTP_4_2_7P357
+
+ util/ntp-keygen.man.in@1.177 +3 -3
+ NTP_4_2_7P357
+
+ util/ntp-keygen.mdoc.in@1.177 +2 -2
+ NTP_4_2_7P357
+
+ChangeSet@1.2920, 2013-02-21 21:29:59-05:00, stenn@deacon.udel.edu
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/invoke-ntp.conf.texi@1.31 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/invoke-ntp.keys.texi@1.31 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/invoke-ntpd.texi@1.347 +13 -19
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.conf.5man@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.conf.5mdoc@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.conf.man.in@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.conf.mdoc.in@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.keys.5man@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.keys.5mdoc@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.keys.man.in@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntp.keys.mdoc.in@1.65 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpd-opts.c@1.365 +493 -41
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpd-opts.h@1.365 +6 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpd.1ntpdman@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpd.1ntpdmdoc@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpd.man.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpd.mdoc.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpdsim-opts.c@1.21 +780 -312
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpd/ntpdsim-opts.h@1.21 +17 -14
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/invoke-ntpdc.texi@1.344 +16 -22
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/ntpdc-opts.c@1.359 +424 -45
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/ntpdc-opts.h@1.359 +6 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/ntpdc.1ntpdcman@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/ntpdc.html@1.188 +13 -19
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/ntpdc.man.in@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpdc/ntpdc.mdoc.in@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpq/invoke-ntpq.texi@1.348 +14 -17
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpq/ntpq-opts.c@1.362 +414 -41
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpq/ntpq-opts.h@1.362 +6 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpq/ntpq.1ntpqman@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpq/ntpq.1ntpqmdoc@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpq/ntpq.man.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpq/ntpq.mdoc.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.347 +11 -12
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.362 +403 -45
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.362 +6 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpsnmpd/ntpsnmpd.man.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ scripts/invoke-ntp-wait.texi@1.164 +4 -4
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ scripts/ntp-wait.1ntp-waitman@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ scripts/ntp-wait.html@1.180 +1 -1
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ scripts/ntp-wait.man.in@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ scripts/ntp-wait.mdoc.in@1.175 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/include/autogen-version.def@1.15 +1 -1
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/invoke-sntp.texi@1.344 +16 -19
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/sntp-opts.c@1.359 +449 -45
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/sntp-opts.h@1.359 +6 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/sntp.1sntpman@1.179 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/sntp.1sntpmdoc@1.179 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/sntp.html@1.359 +13 -16
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/sntp.man.in@1.179 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/sntp.mdoc.in@1.179 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ util/invoke-ntp-keygen.texi@1.348 +13 -14
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ util/ntp-keygen-opts.c@1.362 +457 -45
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ util/ntp-keygen-opts.h@1.362 +6 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ util/ntp-keygen.1ntp-keygenman@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ util/ntp-keygen.man.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ util/ntp-keygen.mdoc.in@1.176 +3 -3
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ChangeSet@1.2919, 2013-02-22 01:52:51+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ ChangeLog@1.1270 +1 -0
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/Makefile.am@1.18 +4 -4
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/ag-char-map.h@1.21 +5 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/alias.c@1.5 +49 -39
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/ao-strs.c@1.7 +146 -107
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/ao-strs.h@1.6 +188 -114
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/autoopts.c@1.16 +51 -56
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/autoopts.h@1.14 +69 -32
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/autoopts/options.h@1.20 +507 -335
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/autoopts/project.h@1.5 +4 -4
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/autoopts/usage-txt.h@1.20 +541 -580
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/boolean.c@1.13 +11 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/check.c@1.6 +37 -24
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/compat/compat.h@1.13 +22 -40
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/compat/windows-config.h@1.12 +40 -50
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/configfile.c@1.18 +13 -11
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/cook.c@1.13 +11 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/enum.c@1.8 +26 -35
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/env.c@1.7 +10 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/file.c@1.13 +27 -32
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/find.c@1.7 +27 -38
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/genshell.c@1.21 +450 -99
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/genshell.h@1.21 +15 -16
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/init.c@1.3 +19 -14
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/load.c@1.16 +11 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/m4/libopts.m4@1.24 +9 -19
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/makeshell.c@1.15 +131 -104
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/nested.c@1.12 +13 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/numeric.c@1.12 +34 -25
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/option-value-type.c@1.8 +5 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/option-value-type.h@1.22 +8 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/option-xat-attribute.c@1.8 +5 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/option-xat-attribute.h@1.22 +8 -6
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/pgusage.c@1.13 +10 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/proto.h@1.21 +20 -2
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/putshell.c@1.12 +212 -55
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/reset.c@1.14 +16 -11
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/restore.c@1.11 +12 -16
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/save.c@1.14 +133 -88
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/sort.c@1.12 +10 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/stack.c@1.13 +12 -7
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/streqvcmp.c@1.12 +21 -16
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/text_mmap.c@1.13 +11 -7
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/time.c@1.13 +10 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/tokenize.c@1.10 +13 -5
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/usage.c@1.14 +496 -204
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ sntp/libopts/version.c@1.14 +78 -69
+ Upgrade to autogen-5.17.2pre and libopts-38.0.13
+
+ChangeSet@1.2918, 2013-02-19 11:40:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P356
+ TAG: NTP_4_2_7P356
+
+ ChangeLog@1.1269 +1 -0
+ NTP_4_2_7P356
+
+ ntpd/invoke-ntp.conf.texi@1.30 +1 -1
+ NTP_4_2_7P356
+
+ ntpd/invoke-ntp.keys.texi@1.30 +1 -1
+ NTP_4_2_7P356
+
+ ntpd/invoke-ntpd.texi@1.346 +2 -2
+ NTP_4_2_7P356
+
+ ntpd/ntp.conf.5man@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntp.conf.5mdoc@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntp.conf.html@1.29 +1 -1
+ NTP_4_2_7P356
+
+ ntpd/ntp.conf.man.in@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntp.conf.mdoc.in@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntp.keys.5man@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntp.keys.5mdoc@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntp.keys.html@1.30 +1 -1
+ NTP_4_2_7P356
+
+ ntpd/ntp.keys.man.in@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntp.keys.mdoc.in@1.64 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntpd-opts.c@1.364 +4 -4
+ NTP_4_2_7P356
+
+ ntpd/ntpd-opts.h@1.364 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntpd.1ntpdman@1.175 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntpd.1ntpdmdoc@1.175 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntpd.html@1.24 +2 -2
+ NTP_4_2_7P356
+
+ ntpd/ntpd.man.in@1.175 +3 -3
+ NTP_4_2_7P356
+
+ ntpd/ntpd.mdoc.in@1.175 +3 -3
+ NTP_4_2_7P356
+
+ ntpdc/invoke-ntpdc.texi@1.343 +2 -2
+ NTP_4_2_7P356
+
+ ntpdc/ntpdc-opts.c@1.358 +4 -4
+ NTP_4_2_7P356
+
+ ntpdc/ntpdc-opts.h@1.358 +3 -3
+ NTP_4_2_7P356
+
+ ntpdc/ntpdc.1ntpdcman@1.174 +2 -2
+ NTP_4_2_7P356
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.174 +2 -2
+ NTP_4_2_7P356
+
+ ntpdc/ntpdc.html@1.187 +2 -2
+ NTP_4_2_7P356
+
+ ntpdc/ntpdc.man.in@1.174 +2 -2
+ NTP_4_2_7P356
+
+ ntpdc/ntpdc.mdoc.in@1.174 +2 -2
+ NTP_4_2_7P356
+
+ ntpq/invoke-ntpq.texi@1.347 +2 -2
+ NTP_4_2_7P356
+
+ ntpq/ntpq-opts.c@1.361 +4 -4
+ NTP_4_2_7P356
+
+ ntpq/ntpq-opts.h@1.361 +3 -3
+ NTP_4_2_7P356
+
+ ntpq/ntpq.1ntpqman@1.175 +2 -2
+ NTP_4_2_7P356
+
+ ntpq/ntpq.1ntpqmdoc@1.175 +2 -2
+ NTP_4_2_7P356
+
+ ntpq/ntpq.html@1.21 +2 -2
+ NTP_4_2_7P356
+
+ ntpq/ntpq.man.in@1.175 +2 -2
+ NTP_4_2_7P356
+
+ ntpq/ntpq.mdoc.in@1.175 +2 -2
+ NTP_4_2_7P356
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.346 +2 -2
+ NTP_4_2_7P356
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.361 +4 -4
+ NTP_4_2_7P356
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.361 +3 -3
+ NTP_4_2_7P356
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.175 +3 -3
+ NTP_4_2_7P356
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.175 +3 -3
+ NTP_4_2_7P356
+
+ ntpsnmpd/ntpsnmpd.html@1.19 +1 -1
+ NTP_4_2_7P356
+
+ ntpsnmpd/ntpsnmpd.man.in@1.175 +3 -3
+ NTP_4_2_7P356
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.175 +3 -3
+ NTP_4_2_7P356
+
+ packageinfo.sh@1.359 +1 -1
+ NTP_4_2_7P356
+
+ scripts/invoke-ntp-wait.texi@1.163 +1 -1
+ NTP_4_2_7P356
+
+ scripts/ntp-wait.1ntp-waitman@1.174 +3 -3
+ NTP_4_2_7P356
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.174 +3 -3
+ NTP_4_2_7P356
+
+ scripts/ntp-wait.html@1.179 +1 -1
+ NTP_4_2_7P356
+
+ scripts/ntp-wait.man.in@1.174 +3 -3
+ NTP_4_2_7P356
+
+ scripts/ntp-wait.mdoc.in@1.174 +3 -3
+ NTP_4_2_7P356
+
+ sntp/invoke-sntp.texi@1.343 +2 -2
+ NTP_4_2_7P356
+
+ sntp/sntp-opts.c@1.358 +4 -4
+ NTP_4_2_7P356
+
+ sntp/sntp-opts.h@1.358 +3 -3
+ NTP_4_2_7P356
+
+ sntp/sntp.1sntpman@1.178 +3 -3
+ NTP_4_2_7P356
+
+ sntp/sntp.1sntpmdoc@1.178 +3 -3
+ NTP_4_2_7P356
+
+ sntp/sntp.html@1.358 +2 -2
+ NTP_4_2_7P356
+
+ sntp/sntp.man.in@1.178 +3 -3
+ NTP_4_2_7P356
+
+ sntp/sntp.mdoc.in@1.178 +3 -3
+ NTP_4_2_7P356
+
+ util/invoke-ntp-keygen.texi@1.347 +2 -2
+ NTP_4_2_7P356
+
+ util/ntp-keygen-opts.c@1.361 +4 -4
+ NTP_4_2_7P356
+
+ util/ntp-keygen-opts.h@1.361 +3 -3
+ NTP_4_2_7P356
+
+ util/ntp-keygen.1ntp-keygenman@1.175 +3 -3
+ NTP_4_2_7P356
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.175 +3 -3
+ NTP_4_2_7P356
+
+ util/ntp-keygen.html@1.25 +2 -2
+ NTP_4_2_7P356
+
+ util/ntp-keygen.man.in@1.175 +3 -3
+ NTP_4_2_7P356
+
+ util/ntp-keygen.mdoc.in@1.175 +3 -3
+ NTP_4_2_7P356
+
+ChangeSet@1.2917, 2013-02-18 22:58:22-08:00, harlan@hms-mbp11.local
+ Added loc/debian
+
+ ChangeLog@1.1268 +1 -0
+ Added loc/debian
+
+ sntp/loc/debian@1.1 +15 -0
+ BitKeeper file /Users/harlan/src/ntp-dev/sntp/loc/debian
+
+ sntp/loc/debian@1.0 +0 -0
+
+ChangeSet@1.2916, 2013-02-18 09:26:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P355
+ TAG: NTP_4_2_7P355
+
+ ChangeLog@1.1267 +1 -0
+ NTP_4_2_7P355
+
+ ntpd/invoke-ntp.conf.texi@1.29 +1 -1
+ NTP_4_2_7P355
+
+ ntpd/invoke-ntp.keys.texi@1.29 +1 -1
+ NTP_4_2_7P355
+
+ ntpd/invoke-ntpd.texi@1.345 +2 -2
+ NTP_4_2_7P355
+
+ ntpd/ntp.conf.5man@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntp.conf.5mdoc@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntp.conf.html@1.28 +1 -1
+ NTP_4_2_7P355
+
+ ntpd/ntp.conf.man.in@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntp.conf.mdoc.in@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntp.keys.5man@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntp.keys.5mdoc@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntp.keys.html@1.29 +1 -1
+ NTP_4_2_7P355
+
+ ntpd/ntp.keys.man.in@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntp.keys.mdoc.in@1.63 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntpd-opts.c@1.363 +4 -4
+ NTP_4_2_7P355
+
+ ntpd/ntpd-opts.h@1.363 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntpd.1ntpdman@1.174 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntpd.1ntpdmdoc@1.174 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntpd.html@1.23 +2 -2
+ NTP_4_2_7P355
+
+ ntpd/ntpd.man.in@1.174 +3 -3
+ NTP_4_2_7P355
+
+ ntpd/ntpd.mdoc.in@1.174 +3 -3
+ NTP_4_2_7P355
+
+ ntpdc/invoke-ntpdc.texi@1.342 +2 -2
+ NTP_4_2_7P355
+
+ ntpdc/ntpdc-opts.c@1.357 +4 -4
+ NTP_4_2_7P355
+
+ ntpdc/ntpdc-opts.h@1.357 +3 -3
+ NTP_4_2_7P355
+
+ ntpdc/ntpdc.1ntpdcman@1.173 +2 -2
+ NTP_4_2_7P355
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.173 +2 -2
+ NTP_4_2_7P355
+
+ ntpdc/ntpdc.html@1.186 +2 -2
+ NTP_4_2_7P355
+
+ ntpdc/ntpdc.man.in@1.173 +2 -2
+ NTP_4_2_7P355
+
+ ntpdc/ntpdc.mdoc.in@1.173 +2 -2
+ NTP_4_2_7P355
+
+ ntpq/invoke-ntpq.texi@1.346 +2 -2
+ NTP_4_2_7P355
+
+ ntpq/ntpq-opts.c@1.360 +4 -4
+ NTP_4_2_7P355
+
+ ntpq/ntpq-opts.h@1.360 +3 -3
+ NTP_4_2_7P355
+
+ ntpq/ntpq.1ntpqman@1.174 +2 -2
+ NTP_4_2_7P355
+
+ ntpq/ntpq.1ntpqmdoc@1.174 +2 -2
+ NTP_4_2_7P355
+
+ ntpq/ntpq.html@1.20 +2 -2
+ NTP_4_2_7P355
+
+ ntpq/ntpq.man.in@1.174 +2 -2
+ NTP_4_2_7P355
+
+ ntpq/ntpq.mdoc.in@1.174 +2 -2
+ NTP_4_2_7P355
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.345 +2 -2
+ NTP_4_2_7P355
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.360 +4 -4
+ NTP_4_2_7P355
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.360 +3 -3
+ NTP_4_2_7P355
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.174 +3 -3
+ NTP_4_2_7P355
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.174 +3 -3
+ NTP_4_2_7P355
+
+ ntpsnmpd/ntpsnmpd.html@1.18 +1 -1
+ NTP_4_2_7P355
+
+ ntpsnmpd/ntpsnmpd.man.in@1.174 +3 -3
+ NTP_4_2_7P355
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.174 +3 -3
+ NTP_4_2_7P355
+
+ packageinfo.sh@1.358 +1 -1
+ NTP_4_2_7P355
+
+ scripts/invoke-ntp-wait.texi@1.162 +1 -1
+ NTP_4_2_7P355
+
+ scripts/ntp-wait.1ntp-waitman@1.173 +3 -3
+ NTP_4_2_7P355
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.173 +3 -3
+ NTP_4_2_7P355
+
+ scripts/ntp-wait.html@1.178 +1 -1
+ NTP_4_2_7P355
+
+ scripts/ntp-wait.man.in@1.173 +3 -3
+ NTP_4_2_7P355
+
+ scripts/ntp-wait.mdoc.in@1.173 +3 -3
+ NTP_4_2_7P355
+
+ sntp/invoke-sntp.texi@1.342 +2 -2
+ NTP_4_2_7P355
+
+ sntp/sntp-opts.c@1.357 +4 -4
+ NTP_4_2_7P355
+
+ sntp/sntp-opts.h@1.357 +3 -3
+ NTP_4_2_7P355
+
+ sntp/sntp.1sntpman@1.177 +3 -3
+ NTP_4_2_7P355
+
+ sntp/sntp.1sntpmdoc@1.177 +3 -3
+ NTP_4_2_7P355
+
+ sntp/sntp.html@1.357 +2 -2
+ NTP_4_2_7P355
+
+ sntp/sntp.man.in@1.177 +3 -3
+ NTP_4_2_7P355
+
+ sntp/sntp.mdoc.in@1.177 +3 -3
+ NTP_4_2_7P355
+
+ util/invoke-ntp-keygen.texi@1.346 +2 -2
+ NTP_4_2_7P355
+
+ util/ntp-keygen-opts.c@1.360 +4 -4
+ NTP_4_2_7P355
+
+ util/ntp-keygen-opts.h@1.360 +3 -3
+ NTP_4_2_7P355
+
+ util/ntp-keygen.1ntp-keygenman@1.174 +3 -3
+ NTP_4_2_7P355
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.174 +3 -3
+ NTP_4_2_7P355
+
+ util/ntp-keygen.html@1.24 +2 -2
+ NTP_4_2_7P355
+
+ util/ntp-keygen.man.in@1.174 +3 -3
+ NTP_4_2_7P355
+
+ util/ntp-keygen.mdoc.in@1.174 +3 -3
+ NTP_4_2_7P355
+
+ChangeSet@1.2915, 2013-02-18 04:01:05-05:00, stenn@deacon.udel.edu
+ CID 739711: Ignore return status of remove() in ntp-keygen.c
+
+ ChangeLog@1.1266 +1 -0
+ CID 739711: Ignore return status of remove() in ntp-keygen.c
+
+ util/ntp-keygen.c@1.95 +1 -1
+ CID 739711: Ignore return status of remove() in ntp-keygen.c
+
+ChangeSet@1.2914, 2013-02-18 03:28:57-05:00, stenn@deacon.udel.edu
+ CID 739710: Check return status of mkdir() in sntp/kod_management.c
+
+ ChangeLog@1.1265 +1 -0
+ CID 739710: Check return status of mkdir() in sntp/kod_management.c
+
+ sntp/kod_management.c@1.30 +5 -1
+ CID 739710: Check return status of mkdir() in sntp/kod_management.c
+
+ChangeSet@1.2913, 2013-02-18 03:18:18-05:00, stenn@deacon.udel.edu
+ CID 739709: Check return status of fcntl() in refclock_datum.c
+
+ ChangeLog@1.1264 +1 -0
+ CID 739709: Check return status of fcntl() in refclock_datum.c
+
+ ntpd/refclock_datum.c@1.21 +3 -1
+ CID 739709: Check return status of fcntl() in refclock_datum.c
+
+ChangeSet@1.2912, 2013-02-18 03:10:44-05:00, stenn@deacon.udel.edu
+ CID 739708: Check return status of fcntl() in refclock_arc.c
+
+ ChangeLog@1.1263 +1 -0
+ CID 739708: Check return status of fcntl() in refclock_arc.c
+
+ ntpd/refclock_arc.c@1.30 +4 -1
+ CID 739708: Check return status of fcntl() in refclock_arc.c
+
+ChangeSet@1.2911, 2013-02-18 03:05:01-05:00, stenn@deacon.udel.edu
+ CID 739723: Print sizeof as unsigned
+
+ ChangeLog@1.1262 +1 -0
+ CID 739723: Print sizeof as unsigned
+
+ sntp/main.c@1.88 +1 -1
+ CID 739723: Print sizeof as unsigned
+
+ChangeSet@1.2910, 2013-02-18 01:09:24-05:00, stenn@deacon.udel.edu
+ CID 971094: Clean up time of check/time of use in check_leap_file()
+
+ ChangeLog@1.1261 +1 -0
+ CID 971094: Clean up time of check/time of use in check_leap_file()
+
+ ntpd/ntp_util.c@1.102 +13 -13
+ CID 971094: Clean up time of check/time of use in check_leap_file()
+
+ChangeSet@1.2909, 2013-02-10 11:50:16+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P354
+ TAG: NTP_4_2_7P354
+
+ ChangeLog@1.1260 +1 -0
+ NTP_4_2_7P354
+
+ ntpd/invoke-ntp.conf.texi@1.28 +1 -1
+ NTP_4_2_7P354
+
+ ntpd/invoke-ntp.keys.texi@1.28 +1 -1
+ NTP_4_2_7P354
+
+ ntpd/invoke-ntpd.texi@1.344 +2 -2
+ NTP_4_2_7P354
+
+ ntpd/ntp.conf.5man@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntp.conf.5mdoc@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntp.conf.html@1.27 +1 -1
+ NTP_4_2_7P354
+
+ ntpd/ntp.conf.man.in@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntp.conf.mdoc.in@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntp.keys.5man@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntp.keys.5mdoc@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntp.keys.html@1.28 +1 -1
+ NTP_4_2_7P354
+
+ ntpd/ntp.keys.man.in@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntp.keys.mdoc.in@1.62 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntpd-opts.c@1.362 +4 -4
+ NTP_4_2_7P354
+
+ ntpd/ntpd-opts.h@1.362 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntpd.1ntpdman@1.173 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntpd.1ntpdmdoc@1.173 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntpd.html@1.22 +2 -2
+ NTP_4_2_7P354
+
+ ntpd/ntpd.man.in@1.173 +3 -3
+ NTP_4_2_7P354
+
+ ntpd/ntpd.mdoc.in@1.173 +3 -3
+ NTP_4_2_7P354
+
+ ntpdc/invoke-ntpdc.texi@1.341 +2 -2
+ NTP_4_2_7P354
+
+ ntpdc/ntpdc-opts.c@1.356 +4 -4
+ NTP_4_2_7P354
+
+ ntpdc/ntpdc-opts.h@1.356 +3 -3
+ NTP_4_2_7P354
+
+ ntpdc/ntpdc.1ntpdcman@1.172 +2 -2
+ NTP_4_2_7P354
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.172 +2 -2
+ NTP_4_2_7P354
+
+ ntpdc/ntpdc.html@1.185 +2 -2
+ NTP_4_2_7P354
+
+ ntpdc/ntpdc.man.in@1.172 +2 -2
+ NTP_4_2_7P354
+
+ ntpdc/ntpdc.mdoc.in@1.172 +2 -2
+ NTP_4_2_7P354
+
+ ntpq/invoke-ntpq.texi@1.345 +2 -2
+ NTP_4_2_7P354
+
+ ntpq/ntpq-opts.c@1.359 +4 -4
+ NTP_4_2_7P354
+
+ ntpq/ntpq-opts.h@1.359 +3 -3
+ NTP_4_2_7P354
+
+ ntpq/ntpq.1ntpqman@1.173 +2 -2
+ NTP_4_2_7P354
+
+ ntpq/ntpq.1ntpqmdoc@1.173 +2 -2
+ NTP_4_2_7P354
+
+ ntpq/ntpq.html@1.19 +2 -2
+ NTP_4_2_7P354
+
+ ntpq/ntpq.man.in@1.173 +2 -2
+ NTP_4_2_7P354
+
+ ntpq/ntpq.mdoc.in@1.173 +2 -2
+ NTP_4_2_7P354
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.344 +2 -2
+ NTP_4_2_7P354
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.359 +4 -4
+ NTP_4_2_7P354
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.359 +3 -3
+ NTP_4_2_7P354
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.173 +3 -3
+ NTP_4_2_7P354
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.173 +3 -3
+ NTP_4_2_7P354
+
+ ntpsnmpd/ntpsnmpd.html@1.17 +1 -1
+ NTP_4_2_7P354
+
+ ntpsnmpd/ntpsnmpd.man.in@1.173 +3 -3
+ NTP_4_2_7P354
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.173 +3 -3
+ NTP_4_2_7P354
+
+ packageinfo.sh@1.357 +1 -1
+ NTP_4_2_7P354
+
+ scripts/invoke-ntp-wait.texi@1.161 +1 -1
+ NTP_4_2_7P354
+
+ scripts/ntp-wait.1ntp-waitman@1.172 +3 -3
+ NTP_4_2_7P354
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.172 +3 -3
+ NTP_4_2_7P354
+
+ scripts/ntp-wait.html@1.177 +1 -1
+ NTP_4_2_7P354
+
+ scripts/ntp-wait.man.in@1.172 +3 -3
+ NTP_4_2_7P354
+
+ scripts/ntp-wait.mdoc.in@1.172 +3 -3
+ NTP_4_2_7P354
+
+ sntp/invoke-sntp.texi@1.341 +2 -2
+ NTP_4_2_7P354
+
+ sntp/sntp-opts.c@1.356 +4 -4
+ NTP_4_2_7P354
+
+ sntp/sntp-opts.h@1.356 +3 -3
+ NTP_4_2_7P354
+
+ sntp/sntp.1sntpman@1.176 +3 -3
+ NTP_4_2_7P354
+
+ sntp/sntp.1sntpmdoc@1.176 +3 -3
+ NTP_4_2_7P354
+
+ sntp/sntp.html@1.356 +2 -2
+ NTP_4_2_7P354
+
+ sntp/sntp.man.in@1.176 +3 -3
+ NTP_4_2_7P354
+
+ sntp/sntp.mdoc.in@1.176 +3 -3
+ NTP_4_2_7P354
+
+ util/invoke-ntp-keygen.texi@1.345 +2 -2
+ NTP_4_2_7P354
+
+ util/ntp-keygen-opts.c@1.359 +4 -4
+ NTP_4_2_7P354
+
+ util/ntp-keygen-opts.h@1.359 +3 -3
+ NTP_4_2_7P354
+
+ util/ntp-keygen.1ntp-keygenman@1.173 +3 -3
+ NTP_4_2_7P354
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.173 +3 -3
+ NTP_4_2_7P354
+
+ util/ntp-keygen.html@1.23 +2 -2
+ NTP_4_2_7P354
+
+ util/ntp-keygen.man.in@1.173 +3 -3
+ NTP_4_2_7P354
+
+ util/ntp-keygen.mdoc.in@1.173 +3 -3
+ NTP_4_2_7P354
+
+ChangeSet@1.2908, 2013-02-09 20:25:46-05:00, stenn@deacon.udel.edu
+ CID 739714: Fix code indentation level
+
+ ChangeLog@1.1259 +1 -0
+ CID 739714: Fix code indentation level
+
+ ntpd/refclock_irig.c@1.36 +2 -2
+ CID 739714: Fix code indentation level
+
+ChangeSet@1.2907, 2013-02-09 19:55:02-05:00, stenn@deacon.udel.edu
+ CID 739715: Clean up sockaddr_dump()
+
+ ChangeLog@1.1258 +1 -0
+ CID 739715: Clean up sockaddr_dump()
+
+ ntpd/ntp_io.c@1.376 +2 -1
+ CID 739715: Clean up sockaddr_dump()
+
+ChangeSet@1.2906, 2013-02-09 19:05:32-05:00, stenn@deacon.udel.edu
+ CID 97194: Check return from setsockopt()
+
+ ChangeLog@1.1257 +1 -0
+ CID 97194: Check return from setsockopt()
+
+ ntpd/ntp_io.c@1.375 +7 -2
+ CID 97194: Check return from setsockopt()
+
+ChangeSet@1.2905, 2013-02-09 18:28:45-05:00, stenn@deacon.udel.edu
+ CID 739713: devmask/recmask copy/paste error
+
+ ChangeLog@1.1256 +1 -0
+ CID 739713: devmask/recmask copy/paste error
+
+ libntp/audio.c@1.33 +2 -1
+ CID 739713: devmask/recmask copy/paste error
+
+ChangeSet@1.2904, 2013-02-09 18:17:48-05:00, stenn@deacon.udel.edu
+ CID 739559: Double close
+
+ ChangeLog@1.1255 +2 -1
+ CID 739559: Double close
+
+ lib/isc/unix/net.c@1.18 +0 -1
+ CID 739559: Double close
+
+ChangeSet@1.2903, 2013-02-09 18:14:26-05:00, stenn@deacon.udel.edu
+ CID 739558: Double close
+
+ ChangeLog@1.1254 +1 -0
+ CID 739558: Double close
+
+ lib/isc/unix/net.c@1.17 +0 -2
+ CID 739558: Double close
+
+ChangeSet@1.2902, 2013-02-09 18:05:03-05:00, stenn@deacon.udel.edu
+ CID 739473,739532: Out-of-bounds access/illegal address computation
+
+ ChangeLog@1.1253 +1 -0
+ CID 739473,739532: Out-of-bounds access/illegal address computation
+
+ lib/isc/sockaddr.c@1.11 +1 -1
+ CID 739473,739532: Out-of-bounds access/illegal address computation
+
+ChangeSet@1.2901, 2013-02-09 11:31:13+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P353
+ TAG: NTP_4_2_7P353
+
+ ChangeLog@1.1252 +1 -0
+ NTP_4_2_7P353
+
+ ntpd/invoke-ntp.conf.texi@1.27 +1 -1
+ NTP_4_2_7P353
+
+ ntpd/invoke-ntp.keys.texi@1.27 +1 -1
+ NTP_4_2_7P353
+
+ ntpd/invoke-ntpd.texi@1.343 +2 -2
+ NTP_4_2_7P353
+
+ ntpd/ntp.conf.5man@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntp.conf.5mdoc@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntp.conf.html@1.26 +1 -1
+ NTP_4_2_7P353
+
+ ntpd/ntp.conf.man.in@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntp.conf.mdoc.in@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntp.keys.5man@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntp.keys.5mdoc@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntp.keys.html@1.27 +1 -1
+ NTP_4_2_7P353
+
+ ntpd/ntp.keys.man.in@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntp.keys.mdoc.in@1.61 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntpd-opts.c@1.361 +4 -4
+ NTP_4_2_7P353
+
+ ntpd/ntpd-opts.h@1.361 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntpd.1ntpdman@1.172 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntpd.1ntpdmdoc@1.172 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntpd.html@1.21 +2 -2
+ NTP_4_2_7P353
+
+ ntpd/ntpd.man.in@1.172 +3 -3
+ NTP_4_2_7P353
+
+ ntpd/ntpd.mdoc.in@1.172 +3 -3
+ NTP_4_2_7P353
+
+ ntpdc/invoke-ntpdc.texi@1.340 +2 -2
+ NTP_4_2_7P353
+
+ ntpdc/ntpdc-opts.c@1.355 +4 -4
+ NTP_4_2_7P353
+
+ ntpdc/ntpdc-opts.h@1.355 +3 -3
+ NTP_4_2_7P353
+
+ ntpdc/ntpdc.1ntpdcman@1.171 +2 -2
+ NTP_4_2_7P353
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.171 +2 -2
+ NTP_4_2_7P353
+
+ ntpdc/ntpdc.html@1.184 +2 -2
+ NTP_4_2_7P353
+
+ ntpdc/ntpdc.man.in@1.171 +2 -2
+ NTP_4_2_7P353
+
+ ntpdc/ntpdc.mdoc.in@1.171 +2 -2
+ NTP_4_2_7P353
+
+ ntpq/invoke-ntpq.texi@1.344 +2 -2
+ NTP_4_2_7P353
+
+ ntpq/ntpq-opts.c@1.358 +4 -4
+ NTP_4_2_7P353
+
+ ntpq/ntpq-opts.h@1.358 +3 -3
+ NTP_4_2_7P353
+
+ ntpq/ntpq.1ntpqman@1.172 +2 -2
+ NTP_4_2_7P353
+
+ ntpq/ntpq.1ntpqmdoc@1.172 +2 -2
+ NTP_4_2_7P353
+
+ ntpq/ntpq.html@1.18 +2 -2
+ NTP_4_2_7P353
+
+ ntpq/ntpq.man.in@1.172 +2 -2
+ NTP_4_2_7P353
+
+ ntpq/ntpq.mdoc.in@1.172 +2 -2
+ NTP_4_2_7P353
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.343 +2 -2
+ NTP_4_2_7P353
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.358 +4 -4
+ NTP_4_2_7P353
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.358 +3 -3
+ NTP_4_2_7P353
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.172 +3 -3
+ NTP_4_2_7P353
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.172 +3 -3
+ NTP_4_2_7P353
+
+ ntpsnmpd/ntpsnmpd.html@1.16 +1 -1
+ NTP_4_2_7P353
+
+ ntpsnmpd/ntpsnmpd.man.in@1.172 +3 -3
+ NTP_4_2_7P353
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.172 +3 -3
+ NTP_4_2_7P353
+
+ packageinfo.sh@1.356 +1 -1
+ NTP_4_2_7P353
+
+ scripts/invoke-ntp-wait.texi@1.160 +1 -1
+ NTP_4_2_7P353
+
+ scripts/ntp-wait.1ntp-waitman@1.171 +3 -3
+ NTP_4_2_7P353
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.171 +3 -3
+ NTP_4_2_7P353
+
+ scripts/ntp-wait.html@1.176 +1 -1
+ NTP_4_2_7P353
+
+ scripts/ntp-wait.man.in@1.171 +3 -3
+ NTP_4_2_7P353
+
+ scripts/ntp-wait.mdoc.in@1.171 +3 -3
+ NTP_4_2_7P353
+
+ sntp/invoke-sntp.texi@1.340 +2 -2
+ NTP_4_2_7P353
+
+ sntp/sntp-opts.c@1.355 +4 -4
+ NTP_4_2_7P353
+
+ sntp/sntp-opts.h@1.355 +3 -3
+ NTP_4_2_7P353
+
+ sntp/sntp.1sntpman@1.175 +3 -3
+ NTP_4_2_7P353
+
+ sntp/sntp.1sntpmdoc@1.175 +3 -3
+ NTP_4_2_7P353
+
+ sntp/sntp.html@1.355 +2 -2
+ NTP_4_2_7P353
+
+ sntp/sntp.man.in@1.175 +3 -3
+ NTP_4_2_7P353
+
+ sntp/sntp.mdoc.in@1.175 +3 -3
+ NTP_4_2_7P353
+
+ util/invoke-ntp-keygen.texi@1.344 +2 -2
+ NTP_4_2_7P353
+
+ util/ntp-keygen-opts.c@1.358 +4 -4
+ NTP_4_2_7P353
+
+ util/ntp-keygen-opts.h@1.358 +3 -3
+ NTP_4_2_7P353
+
+ util/ntp-keygen.1ntp-keygenman@1.172 +3 -3
+ NTP_4_2_7P353
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.172 +3 -3
+ NTP_4_2_7P353
+
+ util/ntp-keygen.html@1.22 +2 -2
+ NTP_4_2_7P353
+
+ util/ntp-keygen.man.in@1.172 +3 -3
+ NTP_4_2_7P353
+
+ util/ntp-keygen.mdoc.in@1.172 +3 -3
+ NTP_4_2_7P353
+
+ChangeSet@1.2900, 2013-02-08 23:15:13-08:00, harlan@hms-mbp11.lan
+ [Bug 2326] Check hourly for a new leapfile if the old one expired
+
+ ChangeLog@1.1251 +1 -0
+ [Bug 2326] Check hourly for a new leapfile if the old one expired
+
+ ntpd/ntp_timer.c@1.71 +7 -0
+ [Bug 2326] Check hourly for a new leapfile if the old one expired
+
+ ntpd/ntp_util.c@1.101 +1 -1
+ [Bug 2326] Check hourly for a new leapfile if the old one expired
+
+ChangeSet@1.2899, 2013-01-28 02:57:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P352
+ TAG: NTP_4_2_7P352
+
+ ChangeLog@1.1250 +1 -0
+ NTP_4_2_7P352
+
+ ntpd/invoke-ntp.conf.texi@1.26 +1 -1
+ NTP_4_2_7P352
+
+ ntpd/invoke-ntp.keys.texi@1.26 +1 -1
+ NTP_4_2_7P352
+
+ ntpd/invoke-ntpd.texi@1.342 +2 -2
+ NTP_4_2_7P352
+
+ ntpd/ntp.conf.5man@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntp.conf.5mdoc@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntp.conf.html@1.25 +1 -1
+ NTP_4_2_7P352
+
+ ntpd/ntp.conf.man.in@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntp.conf.mdoc.in@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntp.keys.5man@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntp.keys.5mdoc@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntp.keys.html@1.26 +1 -1
+ NTP_4_2_7P352
+
+ ntpd/ntp.keys.man.in@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntp.keys.mdoc.in@1.60 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntpd-opts.c@1.360 +4 -4
+ NTP_4_2_7P352
+
+ ntpd/ntpd-opts.h@1.360 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntpd.1ntpdman@1.171 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntpd.1ntpdmdoc@1.171 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntpd.html@1.20 +2 -2
+ NTP_4_2_7P352
+
+ ntpd/ntpd.man.in@1.171 +3 -3
+ NTP_4_2_7P352
+
+ ntpd/ntpd.mdoc.in@1.171 +3 -3
+ NTP_4_2_7P352
+
+ ntpdc/invoke-ntpdc.texi@1.339 +2 -2
+ NTP_4_2_7P352
+
+ ntpdc/ntpdc-opts.c@1.354 +4 -4
+ NTP_4_2_7P352
+
+ ntpdc/ntpdc-opts.h@1.354 +3 -3
+ NTP_4_2_7P352
+
+ ntpdc/ntpdc.1ntpdcman@1.170 +2 -2
+ NTP_4_2_7P352
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.170 +2 -2
+ NTP_4_2_7P352
+
+ ntpdc/ntpdc.html@1.183 +2 -2
+ NTP_4_2_7P352
+
+ ntpdc/ntpdc.man.in@1.170 +2 -2
+ NTP_4_2_7P352
+
+ ntpdc/ntpdc.mdoc.in@1.170 +2 -2
+ NTP_4_2_7P352
+
+ ntpq/invoke-ntpq.texi@1.343 +2 -2
+ NTP_4_2_7P352
+
+ ntpq/ntpq-opts.c@1.357 +4 -4
+ NTP_4_2_7P352
+
+ ntpq/ntpq-opts.h@1.357 +3 -3
+ NTP_4_2_7P352
+
+ ntpq/ntpq.1ntpqman@1.171 +2 -2
+ NTP_4_2_7P352
+
+ ntpq/ntpq.1ntpqmdoc@1.171 +2 -2
+ NTP_4_2_7P352
+
+ ntpq/ntpq.html@1.17 +2 -2
+ NTP_4_2_7P352
+
+ ntpq/ntpq.man.in@1.171 +2 -2
+ NTP_4_2_7P352
+
+ ntpq/ntpq.mdoc.in@1.171 +2 -2
+ NTP_4_2_7P352
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.342 +2 -2
+ NTP_4_2_7P352
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.357 +4 -4
+ NTP_4_2_7P352
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.357 +3 -3
+ NTP_4_2_7P352
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.171 +3 -3
+ NTP_4_2_7P352
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.171 +3 -3
+ NTP_4_2_7P352
+
+ ntpsnmpd/ntpsnmpd.html@1.15 +1 -1
+ NTP_4_2_7P352
+
+ ntpsnmpd/ntpsnmpd.man.in@1.171 +3 -3
+ NTP_4_2_7P352
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.171 +3 -3
+ NTP_4_2_7P352
+
+ packageinfo.sh@1.355 +1 -1
+ NTP_4_2_7P352
+
+ scripts/invoke-ntp-wait.texi@1.159 +1 -1
+ NTP_4_2_7P352
+
+ scripts/ntp-wait.1ntp-waitman@1.170 +3 -3
+ NTP_4_2_7P352
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.170 +3 -3
+ NTP_4_2_7P352
+
+ scripts/ntp-wait.html@1.175 +1 -1
+ NTP_4_2_7P352
+
+ scripts/ntp-wait.man.in@1.170 +3 -3
+ NTP_4_2_7P352
+
+ scripts/ntp-wait.mdoc.in@1.170 +3 -3
+ NTP_4_2_7P352
+
+ sntp/invoke-sntp.texi@1.339 +2 -2
+ NTP_4_2_7P352
+
+ sntp/sntp-opts.c@1.354 +4 -4
+ NTP_4_2_7P352
+
+ sntp/sntp-opts.h@1.354 +3 -3
+ NTP_4_2_7P352
+
+ sntp/sntp.1sntpman@1.174 +3 -3
+ NTP_4_2_7P352
+
+ sntp/sntp.1sntpmdoc@1.174 +3 -3
+ NTP_4_2_7P352
+
+ sntp/sntp.html@1.354 +2 -2
+ NTP_4_2_7P352
+
+ sntp/sntp.man.in@1.174 +3 -3
+ NTP_4_2_7P352
+
+ sntp/sntp.mdoc.in@1.174 +3 -3
+ NTP_4_2_7P352
+
+ util/invoke-ntp-keygen.texi@1.343 +2 -2
+ NTP_4_2_7P352
+
+ util/ntp-keygen-opts.c@1.357 +4 -4
+ NTP_4_2_7P352
+
+ util/ntp-keygen-opts.h@1.357 +3 -3
+ NTP_4_2_7P352
+
+ util/ntp-keygen.1ntp-keygenman@1.171 +3 -3
+ NTP_4_2_7P352
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.171 +3 -3
+ NTP_4_2_7P352
+
+ util/ntp-keygen.html@1.21 +2 -2
+ NTP_4_2_7P352
+
+ util/ntp-keygen.man.in@1.171 +3 -3
+ NTP_4_2_7P352
+
+ util/ntp-keygen.mdoc.in@1.171 +3 -3
+ NTP_4_2_7P352
+
+ChangeSet@1.2898, 2013-01-28 00:44:57+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ html/miscopt.html@1.72 +1 -0
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ChangeSet@1.2897, 2013-01-28 00:20:35+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ ChangeLog@1.1249 +1 -0
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ include/ntpd.h@1.173 +1 -0
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ ntpd/ntp_config.c@1.311 +1 -1
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ ntpd/ntp_io.c@1.374 +15 -5
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ ntpd/ntp_util.c@1.100 +60 -5
+ [Bug 2326] Notice when a new leapfile has been installed
+
+ChangeSet@1.2896, 2013-01-24 11:39:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P351
+ TAG: NTP_4_2_7P351
+
+ ChangeLog@1.1248 +1 -0
+ NTP_4_2_7P351
+
+ ntpd/invoke-ntp.conf.texi@1.25 +1 -1
+ NTP_4_2_7P351
+
+ ntpd/invoke-ntp.keys.texi@1.25 +1 -1
+ NTP_4_2_7P351
+
+ ntpd/invoke-ntpd.texi@1.341 +2 -2
+ NTP_4_2_7P351
+
+ ntpd/ntp.conf.5man@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntp.conf.5mdoc@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntp.conf.html@1.24 +1 -1
+ NTP_4_2_7P351
+
+ ntpd/ntp.conf.man.in@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntp.conf.mdoc.in@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntp.keys.5man@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntp.keys.5mdoc@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntp.keys.html@1.25 +1 -1
+ NTP_4_2_7P351
+
+ ntpd/ntp.keys.man.in@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntp.keys.mdoc.in@1.59 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntpd-opts.c@1.359 +4 -4
+ NTP_4_2_7P351
+
+ ntpd/ntpd-opts.h@1.359 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntpd.1ntpdman@1.170 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntpd.1ntpdmdoc@1.170 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntpd.html@1.19 +2 -2
+ NTP_4_2_7P351
+
+ ntpd/ntpd.man.in@1.170 +3 -3
+ NTP_4_2_7P351
+
+ ntpd/ntpd.mdoc.in@1.170 +3 -3
+ NTP_4_2_7P351
+
+ ntpdc/invoke-ntpdc.texi@1.338 +2 -2
+ NTP_4_2_7P351
+
+ ntpdc/ntpdc-opts.c@1.353 +4 -4
+ NTP_4_2_7P351
+
+ ntpdc/ntpdc-opts.h@1.353 +3 -3
+ NTP_4_2_7P351
+
+ ntpdc/ntpdc.1ntpdcman@1.169 +2 -2
+ NTP_4_2_7P351
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.169 +2 -2
+ NTP_4_2_7P351
+
+ ntpdc/ntpdc.html@1.182 +2 -2
+ NTP_4_2_7P351
+
+ ntpdc/ntpdc.man.in@1.169 +2 -2
+ NTP_4_2_7P351
+
+ ntpdc/ntpdc.mdoc.in@1.169 +2 -2
+ NTP_4_2_7P351
+
+ ntpq/invoke-ntpq.texi@1.342 +2 -2
+ NTP_4_2_7P351
+
+ ntpq/ntpq-opts.c@1.356 +4 -4
+ NTP_4_2_7P351
+
+ ntpq/ntpq-opts.h@1.356 +3 -3
+ NTP_4_2_7P351
+
+ ntpq/ntpq.1ntpqman@1.170 +2 -2
+ NTP_4_2_7P351
+
+ ntpq/ntpq.1ntpqmdoc@1.170 +2 -2
+ NTP_4_2_7P351
+
+ ntpq/ntpq.html@1.16 +2 -2
+ NTP_4_2_7P351
+
+ ntpq/ntpq.man.in@1.170 +2 -2
+ NTP_4_2_7P351
+
+ ntpq/ntpq.mdoc.in@1.170 +2 -2
+ NTP_4_2_7P351
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.341 +2 -2
+ NTP_4_2_7P351
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.356 +4 -4
+ NTP_4_2_7P351
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.356 +3 -3
+ NTP_4_2_7P351
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.170 +3 -3
+ NTP_4_2_7P351
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.170 +3 -3
+ NTP_4_2_7P351
+
+ ntpsnmpd/ntpsnmpd.html@1.14 +1 -1
+ NTP_4_2_7P351
+
+ ntpsnmpd/ntpsnmpd.man.in@1.170 +3 -3
+ NTP_4_2_7P351
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.170 +3 -3
+ NTP_4_2_7P351
+
+ packageinfo.sh@1.354 +1 -1
+ NTP_4_2_7P351
+
+ scripts/invoke-ntp-wait.texi@1.158 +1 -1
+ NTP_4_2_7P351
+
+ scripts/ntp-wait.1ntp-waitman@1.169 +3 -3
+ NTP_4_2_7P351
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.169 +3 -3
+ NTP_4_2_7P351
+
+ scripts/ntp-wait.html@1.174 +1 -1
+ NTP_4_2_7P351
+
+ scripts/ntp-wait.man.in@1.169 +3 -3
+ NTP_4_2_7P351
+
+ scripts/ntp-wait.mdoc.in@1.169 +3 -3
+ NTP_4_2_7P351
+
+ sntp/invoke-sntp.texi@1.338 +2 -2
+ NTP_4_2_7P351
+
+ sntp/sntp-opts.c@1.353 +4 -4
+ NTP_4_2_7P351
+
+ sntp/sntp-opts.h@1.353 +3 -3
+ NTP_4_2_7P351
+
+ sntp/sntp.1sntpman@1.173 +3 -3
+ NTP_4_2_7P351
+
+ sntp/sntp.1sntpmdoc@1.173 +3 -3
+ NTP_4_2_7P351
+
+ sntp/sntp.html@1.353 +2 -2
+ NTP_4_2_7P351
+
+ sntp/sntp.man.in@1.173 +3 -3
+ NTP_4_2_7P351
+
+ sntp/sntp.mdoc.in@1.173 +3 -3
+ NTP_4_2_7P351
+
+ util/invoke-ntp-keygen.texi@1.342 +2 -2
+ NTP_4_2_7P351
+
+ util/ntp-keygen-opts.c@1.356 +4 -4
+ NTP_4_2_7P351
+
+ util/ntp-keygen-opts.h@1.356 +3 -3
+ NTP_4_2_7P351
+
+ util/ntp-keygen.1ntp-keygenman@1.170 +3 -3
+ NTP_4_2_7P351
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.170 +3 -3
+ NTP_4_2_7P351
+
+ util/ntp-keygen.html@1.20 +2 -2
+ NTP_4_2_7P351
+
+ util/ntp-keygen.man.in@1.170 +3 -3
+ NTP_4_2_7P351
+
+ util/ntp-keygen.mdoc.in@1.170 +3 -3
+ NTP_4_2_7P351
+
+ChangeSet@1.2895, 2013-01-23 17:50:49+01:00, burnicki@pc-martin4.
+ [Bug 2328] Don't apply small time adjustments on Windows versions which don't support this.
+
+ ChangeLog@1.1247 +2 -0
+ [Bug 2328] Don't apply small time adjustments on Windows versions which don't support this.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.59 +58 -0
+ [bug 2328] Don't apply small time adjustments on Windows versions which don't support this.
+
+ChangeSet@1.2894, 2013-01-21 11:44:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P350
+ TAG: NTP_4_2_7P350
+
+ ChangeLog@1.1246 +1 -0
+ NTP_4_2_7P350
+
+ ntpd/invoke-ntp.conf.texi@1.24 +1 -1
+ NTP_4_2_7P350
+
+ ntpd/invoke-ntp.keys.texi@1.24 +1 -1
+ NTP_4_2_7P350
+
+ ntpd/invoke-ntpd.texi@1.340 +2 -2
+ NTP_4_2_7P350
+
+ ntpd/ntp.conf.5man@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntp.conf.5mdoc@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntp.conf.html@1.23 +1 -1
+ NTP_4_2_7P350
+
+ ntpd/ntp.conf.man.in@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntp.conf.mdoc.in@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntp.keys.5man@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntp.keys.5mdoc@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntp.keys.html@1.24 +1 -1
+ NTP_4_2_7P350
+
+ ntpd/ntp.keys.man.in@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntp.keys.mdoc.in@1.58 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntpd-opts.c@1.358 +4 -4
+ NTP_4_2_7P350
+
+ ntpd/ntpd-opts.h@1.358 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntpd.1ntpdman@1.169 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntpd.1ntpdmdoc@1.169 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntpd.html@1.18 +2 -2
+ NTP_4_2_7P350
+
+ ntpd/ntpd.man.in@1.169 +3 -3
+ NTP_4_2_7P350
+
+ ntpd/ntpd.mdoc.in@1.169 +3 -3
+ NTP_4_2_7P350
+
+ ntpdc/invoke-ntpdc.texi@1.337 +2 -2
+ NTP_4_2_7P350
+
+ ntpdc/ntpdc-opts.c@1.352 +4 -4
+ NTP_4_2_7P350
+
+ ntpdc/ntpdc-opts.h@1.352 +3 -3
+ NTP_4_2_7P350
+
+ ntpdc/ntpdc.1ntpdcman@1.168 +2 -2
+ NTP_4_2_7P350
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.168 +2 -2
+ NTP_4_2_7P350
+
+ ntpdc/ntpdc.html@1.181 +2 -2
+ NTP_4_2_7P350
+
+ ntpdc/ntpdc.man.in@1.168 +2 -2
+ NTP_4_2_7P350
+
+ ntpdc/ntpdc.mdoc.in@1.168 +2 -2
+ NTP_4_2_7P350
+
+ ntpq/invoke-ntpq.texi@1.341 +2 -2
+ NTP_4_2_7P350
+
+ ntpq/ntpq-opts.c@1.355 +4 -4
+ NTP_4_2_7P350
+
+ ntpq/ntpq-opts.h@1.355 +3 -3
+ NTP_4_2_7P350
+
+ ntpq/ntpq.1ntpqman@1.169 +2 -2
+ NTP_4_2_7P350
+
+ ntpq/ntpq.1ntpqmdoc@1.169 +2 -2
+ NTP_4_2_7P350
+
+ ntpq/ntpq.html@1.15 +2 -2
+ NTP_4_2_7P350
+
+ ntpq/ntpq.man.in@1.169 +2 -2
+ NTP_4_2_7P350
+
+ ntpq/ntpq.mdoc.in@1.169 +2 -2
+ NTP_4_2_7P350
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.340 +2 -2
+ NTP_4_2_7P350
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.355 +4 -4
+ NTP_4_2_7P350
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.355 +3 -3
+ NTP_4_2_7P350
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.169 +3 -3
+ NTP_4_2_7P350
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.169 +3 -3
+ NTP_4_2_7P350
+
+ ntpsnmpd/ntpsnmpd.html@1.13 +1 -1
+ NTP_4_2_7P350
+
+ ntpsnmpd/ntpsnmpd.man.in@1.169 +3 -3
+ NTP_4_2_7P350
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.169 +3 -3
+ NTP_4_2_7P350
+
+ packageinfo.sh@1.353 +1 -1
+ NTP_4_2_7P350
+
+ scripts/invoke-ntp-wait.texi@1.157 +1 -1
+ NTP_4_2_7P350
+
+ scripts/ntp-wait.1ntp-waitman@1.168 +3 -3
+ NTP_4_2_7P350
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.168 +3 -3
+ NTP_4_2_7P350
+
+ scripts/ntp-wait.html@1.173 +1 -1
+ NTP_4_2_7P350
+
+ scripts/ntp-wait.man.in@1.168 +3 -3
+ NTP_4_2_7P350
+
+ scripts/ntp-wait.mdoc.in@1.168 +3 -3
+ NTP_4_2_7P350
+
+ sntp/invoke-sntp.texi@1.337 +2 -2
+ NTP_4_2_7P350
+
+ sntp/sntp-opts.c@1.352 +4 -4
+ NTP_4_2_7P350
+
+ sntp/sntp-opts.h@1.352 +3 -3
+ NTP_4_2_7P350
+
+ sntp/sntp.1sntpman@1.172 +3 -3
+ NTP_4_2_7P350
+
+ sntp/sntp.1sntpmdoc@1.172 +3 -3
+ NTP_4_2_7P350
+
+ sntp/sntp.html@1.352 +2 -2
+ NTP_4_2_7P350
+
+ sntp/sntp.man.in@1.172 +3 -3
+ NTP_4_2_7P350
+
+ sntp/sntp.mdoc.in@1.172 +3 -3
+ NTP_4_2_7P350
+
+ util/invoke-ntp-keygen.texi@1.341 +2 -2
+ NTP_4_2_7P350
+
+ util/ntp-keygen-opts.c@1.355 +4 -4
+ NTP_4_2_7P350
+
+ util/ntp-keygen-opts.h@1.355 +3 -3
+ NTP_4_2_7P350
+
+ util/ntp-keygen.1ntp-keygenman@1.169 +3 -3
+ NTP_4_2_7P350
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.169 +3 -3
+ NTP_4_2_7P350
+
+ util/ntp-keygen.html@1.19 +2 -2
+ NTP_4_2_7P350
+
+ util/ntp-keygen.man.in@1.169 +3 -3
+ NTP_4_2_7P350
+
+ util/ntp-keygen.mdoc.in@1.169 +3 -3
+ NTP_4_2_7P350
+
+ChangeSet@1.2893, 2013-01-20 20:58:35-05:00, stenn@deacon.udel.edu
+ Added sntp/loc/netbsd based on info from Christos Zoulas
+
+ ChangeLog@1.1245 +1 -0
+ Added sntp/loc/netbsd based on info from Christos Zoulas
+
+ sntp/loc/netbsd@1.1 +13 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/loc/netbsd
+
+ sntp/loc/netbsd@1.0 +0 -0
+
+ChangeSet@1.2892, 2013-01-20 11:44:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P349
+ TAG: NTP_4_2_7P349
+
+ ChangeLog@1.1244 +1 -0
+ NTP_4_2_7P349
+
+ ntpd/invoke-ntp.conf.texi@1.23 +1 -1
+ NTP_4_2_7P349
+
+ ntpd/invoke-ntp.keys.texi@1.23 +1 -1
+ NTP_4_2_7P349
+
+ ntpd/invoke-ntpd.texi@1.339 +2 -2
+ NTP_4_2_7P349
+
+ ntpd/ntp.conf.5man@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntp.conf.5mdoc@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntp.conf.html@1.22 +1 -1
+ NTP_4_2_7P349
+
+ ntpd/ntp.conf.man.in@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntp.conf.mdoc.in@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntp.keys.5man@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntp.keys.5mdoc@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntp.keys.html@1.23 +1 -1
+ NTP_4_2_7P349
+
+ ntpd/ntp.keys.man.in@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntp.keys.mdoc.in@1.57 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntpd-opts.c@1.357 +4 -4
+ NTP_4_2_7P349
+
+ ntpd/ntpd-opts.h@1.357 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntpd.1ntpdman@1.168 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntpd.1ntpdmdoc@1.168 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntpd.html@1.17 +4 -4
+ NTP_4_2_7P349
+
+ ntpd/ntpd.man.in@1.168 +3 -3
+ NTP_4_2_7P349
+
+ ntpd/ntpd.mdoc.in@1.168 +3 -3
+ NTP_4_2_7P349
+
+ ntpdc/invoke-ntpdc.texi@1.336 +2 -2
+ NTP_4_2_7P349
+
+ ntpdc/ntpdc-opts.c@1.351 +4 -4
+ NTP_4_2_7P349
+
+ ntpdc/ntpdc-opts.h@1.351 +3 -3
+ NTP_4_2_7P349
+
+ ntpdc/ntpdc.1ntpdcman@1.167 +2 -2
+ NTP_4_2_7P349
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.167 +2 -2
+ NTP_4_2_7P349
+
+ ntpdc/ntpdc.html@1.180 +2 -2
+ NTP_4_2_7P349
+
+ ntpdc/ntpdc.man.in@1.167 +2 -2
+ NTP_4_2_7P349
+
+ ntpdc/ntpdc.mdoc.in@1.167 +2 -2
+ NTP_4_2_7P349
+
+ ntpq/invoke-ntpq.texi@1.340 +2 -2
+ NTP_4_2_7P349
+
+ ntpq/ntpq-opts.c@1.354 +4 -4
+ NTP_4_2_7P349
+
+ ntpq/ntpq-opts.h@1.354 +3 -3
+ NTP_4_2_7P349
+
+ ntpq/ntpq.1ntpqman@1.168 +2 -2
+ NTP_4_2_7P349
+
+ ntpq/ntpq.1ntpqmdoc@1.168 +2 -2
+ NTP_4_2_7P349
+
+ ntpq/ntpq.html@1.14 +13 -10
+ NTP_4_2_7P349
+
+ ntpq/ntpq.man.in@1.168 +2 -2
+ NTP_4_2_7P349
+
+ ntpq/ntpq.mdoc.in@1.168 +2 -2
+ NTP_4_2_7P349
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.339 +2 -2
+ NTP_4_2_7P349
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.354 +4 -4
+ NTP_4_2_7P349
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.354 +3 -3
+ NTP_4_2_7P349
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.168 +3 -3
+ NTP_4_2_7P349
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.168 +3 -3
+ NTP_4_2_7P349
+
+ ntpsnmpd/ntpsnmpd.html@1.12 +1 -1
+ NTP_4_2_7P349
+
+ ntpsnmpd/ntpsnmpd.man.in@1.168 +3 -3
+ NTP_4_2_7P349
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.168 +3 -3
+ NTP_4_2_7P349
+
+ packageinfo.sh@1.352 +1 -1
+ NTP_4_2_7P349
+
+ scripts/invoke-ntp-wait.texi@1.156 +1 -1
+ NTP_4_2_7P349
+
+ scripts/ntp-wait.1ntp-waitman@1.167 +3 -3
+ NTP_4_2_7P349
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.167 +3 -3
+ NTP_4_2_7P349
+
+ scripts/ntp-wait.html@1.172 +1 -1
+ NTP_4_2_7P349
+
+ scripts/ntp-wait.man.in@1.167 +3 -3
+ NTP_4_2_7P349
+
+ scripts/ntp-wait.mdoc.in@1.167 +3 -3
+ NTP_4_2_7P349
+
+ sntp/invoke-sntp.texi@1.336 +2 -2
+ NTP_4_2_7P349
+
+ sntp/sntp-opts.c@1.351 +4 -4
+ NTP_4_2_7P349
+
+ sntp/sntp-opts.h@1.351 +3 -3
+ NTP_4_2_7P349
+
+ sntp/sntp.1sntpman@1.171 +3 -3
+ NTP_4_2_7P349
+
+ sntp/sntp.1sntpmdoc@1.171 +3 -3
+ NTP_4_2_7P349
+
+ sntp/sntp.html@1.351 +2 -2
+ NTP_4_2_7P349
+
+ sntp/sntp.man.in@1.171 +3 -3
+ NTP_4_2_7P349
+
+ sntp/sntp.mdoc.in@1.171 +3 -3
+ NTP_4_2_7P349
+
+ util/invoke-ntp-keygen.texi@1.340 +2 -2
+ NTP_4_2_7P349
+
+ util/ntp-keygen-opts.c@1.354 +4 -4
+ NTP_4_2_7P349
+
+ util/ntp-keygen-opts.h@1.354 +3 -3
+ NTP_4_2_7P349
+
+ util/ntp-keygen.1ntp-keygenman@1.168 +3 -3
+ NTP_4_2_7P349
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.168 +3 -3
+ NTP_4_2_7P349
+
+ util/ntp-keygen.html@1.18 +2 -2
+ NTP_4_2_7P349
+
+ util/ntp-keygen.man.in@1.168 +3 -3
+ NTP_4_2_7P349
+
+ util/ntp-keygen.mdoc.in@1.168 +3 -3
+ NTP_4_2_7P349
+
+ChangeSet@1.2891, 2013-01-18 09:44:02+01:00, burnicki@pc-martin4.
+ Support C99 exact size int types in a way which is compatible with the upcoming
+ version of libopts which will not #include <inttypes.h> unconditionally anymore.
+ Fixes the build errors under Windows reported in [Bug 2321].
+
+ ChangeLog@1.1243 +1 -0
+ [Bug 2321] Fixed Windows build, but autogen update still required.
+
+ ports/winnt/include/config.h@1.104 +46 -0
+ Support C99 exact size int types in a way which is compatible with the upcoming
+ version of libopts which will not #include <inttypes.h> unconditionally anymore.
+ See [Bug 2321] for details.
+
+ChangeSet@1.2890, 2013-01-17 07:08:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P348
+ TAG: NTP_4_2_7P348
+
+ ChangeLog@1.1242 +1 -0
+ NTP_4_2_7P348
+
+ ntpd/invoke-ntp.conf.texi@1.22 +17 -5
+ NTP_4_2_7P348
+
+ ntpd/invoke-ntp.keys.texi@1.22 +1 -1
+ NTP_4_2_7P348
+
+ ntpd/invoke-ntpd.texi@1.338 +4 -4
+ NTP_4_2_7P348
+
+ ntpd/ntp.conf.5man@1.56 +26 -4
+ NTP_4_2_7P348
+
+ ntpd/ntp.conf.5mdoc@1.56 +23 -4
+ NTP_4_2_7P348
+
+ ntpd/ntp.conf.html@1.21 +1 -1
+ NTP_4_2_7P348
+
+ ntpd/ntp.conf.man.in@1.56 +26 -4
+ NTP_4_2_7P348
+
+ ntpd/ntp.conf.mdoc.in@1.56 +23 -4
+ NTP_4_2_7P348
+
+ ntpd/ntp.keys.5man@1.56 +3 -3
+ NTP_4_2_7P348
+
+ ntpd/ntp.keys.5mdoc@1.56 +3 -3
+ NTP_4_2_7P348
+
+ ntpd/ntp.keys.html@1.22 +1 -1
+ NTP_4_2_7P348
+
+ ntpd/ntp.keys.man.in@1.56 +3 -3
+ NTP_4_2_7P348
+
+ ntpd/ntp.keys.mdoc.in@1.56 +3 -3
+ NTP_4_2_7P348
+
+ ntpd/ntpd-opts.c@1.356 +4 -4
+ NTP_4_2_7P348
+
+ ntpd/ntpd-opts.h@1.356 +3 -3
+ NTP_4_2_7P348
+
+ ntpd/ntpd.1ntpdman@1.167 +18 -18
+ NTP_4_2_7P348
+
+ ntpd/ntpd.1ntpdmdoc@1.167 +18 -18
+ NTP_4_2_7P348
+
+ ntpd/ntpd.html@1.16 +2 -2
+ NTP_4_2_7P348
+
+ ntpd/ntpd.man.in@1.167 +18 -18
+ NTP_4_2_7P348
+
+ ntpd/ntpd.mdoc.in@1.167 +18 -18
+ NTP_4_2_7P348
+
+ ntpdc/invoke-ntpdc.texi@1.335 +3 -3
+ NTP_4_2_7P348
+
+ ntpdc/ntpdc-opts.c@1.350 +4 -4
+ NTP_4_2_7P348
+
+ ntpdc/ntpdc-opts.h@1.350 +3 -3
+ NTP_4_2_7P348
+
+ ntpdc/ntpdc.1ntpdcman@1.166 +14 -14
+ NTP_4_2_7P348
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.166 +14 -14
+ NTP_4_2_7P348
+
+ ntpdc/ntpdc.html@1.179 +3 -3
+ NTP_4_2_7P348
+
+ ntpdc/ntpdc.man.in@1.166 +14 -14
+ NTP_4_2_7P348
+
+ ntpdc/ntpdc.mdoc.in@1.166 +14 -14
+ NTP_4_2_7P348
+
+ ntpq/invoke-ntpq.texi@1.339 +13 -10
+ NTP_4_2_7P348
+
+ ntpq/ntpq-opts.c@1.353 +4 -4
+ NTP_4_2_7P348
+
+ ntpq/ntpq-opts.h@1.353 +3 -3
+ NTP_4_2_7P348
+
+ ntpq/ntpq.1ntpqman@1.167 +13 -10
+ NTP_4_2_7P348
+
+ ntpq/ntpq.1ntpqmdoc@1.167 +13 -10
+ NTP_4_2_7P348
+
+ ntpq/ntpq.html@1.13 +2 -25
+ NTP_4_2_7P348
+
+ ntpq/ntpq.man.in@1.167 +13 -10
+ NTP_4_2_7P348
+
+ ntpq/ntpq.mdoc.in@1.167 +13 -10
+ NTP_4_2_7P348
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.338 +2 -2
+ NTP_4_2_7P348
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.353 +4 -4
+ NTP_4_2_7P348
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.353 +3 -3
+ NTP_4_2_7P348
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.167 +3 -3
+ NTP_4_2_7P348
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.167 +3 -3
+ NTP_4_2_7P348
+
+ ntpsnmpd/ntpsnmpd.html@1.11 +1 -1
+ NTP_4_2_7P348
+
+ ntpsnmpd/ntpsnmpd.man.in@1.167 +3 -3
+ NTP_4_2_7P348
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.167 +3 -3
+ NTP_4_2_7P348
+
+ packageinfo.sh@1.351 +1 -1
+ NTP_4_2_7P348
+
+ scripts/invoke-ntp-wait.texi@1.155 +7 -7
+ NTP_4_2_7P348
+
+ scripts/ntp-wait.1ntp-waitman@1.166 +9 -9
+ NTP_4_2_7P348
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.166 +9 -9
+ NTP_4_2_7P348
+
+ scripts/ntp-wait.html@1.171 +7 -7
+ NTP_4_2_7P348
+
+ scripts/ntp-wait.man.in@1.166 +9 -9
+ NTP_4_2_7P348
+
+ scripts/ntp-wait.mdoc.in@1.166 +9 -9
+ NTP_4_2_7P348
+
+ sntp/invoke-sntp.texi@1.335 +2 -2
+ NTP_4_2_7P348
+
+ sntp/sntp-opts.c@1.350 +4 -4
+ NTP_4_2_7P348
+
+ sntp/sntp-opts.h@1.350 +3 -3
+ NTP_4_2_7P348
+
+ sntp/sntp.1sntpman@1.170 +3 -3
+ NTP_4_2_7P348
+
+ sntp/sntp.1sntpmdoc@1.170 +3 -3
+ NTP_4_2_7P348
+
+ sntp/sntp.html@1.350 +2 -2
+ NTP_4_2_7P348
+
+ sntp/sntp.man.in@1.170 +3 -3
+ NTP_4_2_7P348
+
+ sntp/sntp.mdoc.in@1.170 +3 -3
+ NTP_4_2_7P348
+
+ util/invoke-ntp-keygen.texi@1.339 +2 -2
+ NTP_4_2_7P348
+
+ util/ntp-keygen-opts.c@1.353 +4 -4
+ NTP_4_2_7P348
+
+ util/ntp-keygen-opts.h@1.353 +3 -3
+ NTP_4_2_7P348
+
+ util/ntp-keygen.1ntp-keygenman@1.167 +3 -3
+ NTP_4_2_7P348
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.167 +3 -3
+ NTP_4_2_7P348
+
+ util/ntp-keygen.html@1.17 +2 -2
+ NTP_4_2_7P348
+
+ util/ntp-keygen.man.in@1.167 +3 -3
+ NTP_4_2_7P348
+
+ util/ntp-keygen.mdoc.in@1.167 +3 -3
+ NTP_4_2_7P348
+
+ChangeSet@1.2889, 2013-01-17 02:07:52-05:00, stenn@deacon.udel.edu
+ Cleanup to ntpsnmpd-opts.def
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.9 +2 -0
+ Cleanup to ntpsnmpd-opts.def
+
+ChangeSet@1.2888, 2013-01-17 01:40:10-05:00, stenn@deacon.udel.edu
+ Cleanup to ntpsnmpd-opts.def
+
+ ChangeLog@1.1241 +1 -0
+ Cleanup to ntpsnmpd-opts.def
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.8 +1 -0
+ Cleanup to ntpsnmpd-opts.def
+
+ChangeSet@1.2887, 2013-01-13 10:47:08+00:00, stenn@psp-fb1.ntp.org
+ Cleanup to ntpq.texi
+
+ ChangeLog@1.1240 +1 -0
+ Cleanup to ntpq.texi
+
+ ntpq/ntpq.texi@1.4 +0 -23
+ Cleanup to ntpq.texi
+
+ChangeSet@1.2886, 2013-01-13 09:54:06+00:00, stenn@psp-fb1.ntp.org
+ Documentation cleanup to various .def files
+
+ ChangeLog@1.1239 +2 -0
+ Documentation cleanup to various .def files
+
+ChangeSet@1.2885, 2013-01-13 09:53:41+00:00, stenn@psp-fb1.ntp.org
+ Documentation cleanup to various .def files
+
+ ntpd/ntpd-opts.def@1.10 +15 -15
+ Documentation cleanup to the ntpd .def files
+
+ ntpdc/ntpdc-opts.def@1.20 +12 -12
+ Documentation cleanup to the ntpdc .def files
+
+ ntpq/ntpq-opts.def@1.16 +11 -8
+ Documentation cleanup to the ntpq .def files
+
+ scripts/ntp-wait-opts.def@1.7 +6 -6
+ Documentation cleanup to the ntp-wait .def files
+
+ChangeSet@1.2884, 2013-01-13 07:37:17+00:00, stenn@psp-fb1.ntp.org
+ In ntp.conf.def, cleanup SEE ALSO, document 'rlimit' options
+
+ ChangeLog@1.1238 +1 -0
+ In ntp.conf.def, cleanup SEE ALSO, document 'rlimit' options
+
+ ntpd/ntp.conf.def@1.7 +20 -1
+ In ntp.conf.def, cleanup SEE ALSO, document 'rlimit' options
+
+ChangeSet@1.2883, 2013-01-09 10:07:33+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2327] Rename sntp/ag-tpl/:Old to sntp/ag-tpl/Old.
+
+ ChangeLog@1.1237 +1 -0
+ [Bug 2327] Rename sntp/ag-tpl/:Old to sntp/ag-tpl/Old.
+
+ sntp/ag-tpl/Old/agman-file.tpl@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/agman-file.tpl -> sntp/ag-tpl/Old/agman-file.tpl
+
+ sntp/ag-tpl/Old/agmdoc-file.tpl@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/agmdoc-file.tpl -> sntp/ag-tpl/Old/agmdoc-file.tpl
+
+ sntp/ag-tpl/Old/agtexi-cmd.tpl@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/agtexi-cmd.tpl -> sntp/ag-tpl/Old/agtexi-cmd.tpl
+
+ sntp/ag-tpl/Old/cmd-doc.tlib@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/cmd-doc.tlib -> sntp/ag-tpl/Old/cmd-doc.tlib
+
+ sntp/ag-tpl/Old/mdoc2man@1.3 +0 -0
+ Rename: sntp/ag-tpl/:Old/mdoc2man -> sntp/ag-tpl/Old/mdoc2man
+
+ChangeSet@1.2882, 2013-01-09 09:09:37+00:00, stenn@psp-fb1.ntp.org
+ Add a reference to RFC5907 in the ntpsnmpd documentation
+
+ ChangeLog@1.1236 +1 -0
+ Add a reference to RFC5907 in the ntpsnmpd documentation
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.7 +13 -0
+ Add a reference to RFC5907 in the ntpsnmpd documentation
+
+ChangeSet@1.2881, 2013-01-07 11:42:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P347
+ TAG: NTP_4_2_7P347
+
+ ChangeLog@1.1235 +1 -0
+ NTP_4_2_7P347
+
+ ntpd/invoke-ntp.conf.texi@1.21 +1 -1
+ NTP_4_2_7P347
+
+ ntpd/invoke-ntp.keys.texi@1.21 +1 -1
+ NTP_4_2_7P347
+
+ ntpd/invoke-ntpd.texi@1.337 +2 -2
+ NTP_4_2_7P347
+
+ ntpd/ntp.conf.5man@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntp.conf.5mdoc@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntp.conf.html@1.20 +1 -1
+ NTP_4_2_7P347
+
+ ntpd/ntp.conf.man.in@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntp.conf.mdoc.in@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntp.keys.5man@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntp.keys.5mdoc@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntp.keys.html@1.21 +1 -1
+ NTP_4_2_7P347
+
+ ntpd/ntp.keys.man.in@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntp.keys.mdoc.in@1.55 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntpd-opts.c@1.355 +4 -4
+ NTP_4_2_7P347
+
+ ntpd/ntpd-opts.h@1.355 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntpd.1ntpdman@1.166 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntpd.1ntpdmdoc@1.166 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntpd.html@1.15 +2 -492
+ NTP_4_2_7P347
+
+ ntpd/ntpd.man.in@1.166 +3 -3
+ NTP_4_2_7P347
+
+ ntpd/ntpd.mdoc.in@1.166 +3 -3
+ NTP_4_2_7P347
+
+ ntpdc/invoke-ntpdc.texi@1.334 +2 -2
+ NTP_4_2_7P347
+
+ ntpdc/ntpdc-opts.c@1.349 +4 -4
+ NTP_4_2_7P347
+
+ ntpdc/ntpdc-opts.h@1.349 +3 -3
+ NTP_4_2_7P347
+
+ ntpdc/ntpdc.1ntpdcman@1.165 +2 -2
+ NTP_4_2_7P347
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.165 +2 -2
+ NTP_4_2_7P347
+
+ ntpdc/ntpdc.html@1.178 +2 -2
+ NTP_4_2_7P347
+
+ ntpdc/ntpdc.man.in@1.165 +2 -2
+ NTP_4_2_7P347
+
+ ntpdc/ntpdc.mdoc.in@1.165 +2 -2
+ NTP_4_2_7P347
+
+ ntpq/invoke-ntpq.texi@1.338 +2 -2
+ NTP_4_2_7P347
+
+ ntpq/ntpq-opts.c@1.352 +4 -4
+ NTP_4_2_7P347
+
+ ntpq/ntpq-opts.h@1.352 +3 -3
+ NTP_4_2_7P347
+
+ ntpq/ntpq.1ntpqman@1.166 +2 -2
+ NTP_4_2_7P347
+
+ ntpq/ntpq.1ntpqmdoc@1.166 +2 -2
+ NTP_4_2_7P347
+
+ ntpq/ntpq.html@1.12 +2 -2
+ NTP_4_2_7P347
+
+ ntpq/ntpq.man.in@1.166 +2 -2
+ NTP_4_2_7P347
+
+ ntpq/ntpq.mdoc.in@1.166 +2 -2
+ NTP_4_2_7P347
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.337 +2 -2
+ NTP_4_2_7P347
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.352 +4 -4
+ NTP_4_2_7P347
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.352 +3 -3
+ NTP_4_2_7P347
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.166 +3 -3
+ NTP_4_2_7P347
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.166 +3 -3
+ NTP_4_2_7P347
+
+ ntpsnmpd/ntpsnmpd.html@1.10 +1 -1
+ NTP_4_2_7P347
+
+ ntpsnmpd/ntpsnmpd.man.in@1.166 +3 -3
+ NTP_4_2_7P347
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.166 +3 -3
+ NTP_4_2_7P347
+
+ packageinfo.sh@1.350 +1 -1
+ NTP_4_2_7P347
+
+ scripts/invoke-ntp-wait.texi@1.154 +1 -1
+ NTP_4_2_7P347
+
+ scripts/ntp-wait.1ntp-waitman@1.165 +3 -3
+ NTP_4_2_7P347
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.165 +3 -3
+ NTP_4_2_7P347
+
+ scripts/ntp-wait.html@1.170 +1 -1
+ NTP_4_2_7P347
+
+ scripts/ntp-wait.man.in@1.165 +3 -3
+ NTP_4_2_7P347
+
+ scripts/ntp-wait.mdoc.in@1.165 +3 -3
+ NTP_4_2_7P347
+
+ sntp/invoke-sntp.texi@1.334 +2 -2
+ NTP_4_2_7P347
+
+ sntp/sntp-opts.c@1.349 +4 -4
+ NTP_4_2_7P347
+
+ sntp/sntp-opts.h@1.349 +3 -3
+ NTP_4_2_7P347
+
+ sntp/sntp.1sntpman@1.169 +3 -3
+ NTP_4_2_7P347
+
+ sntp/sntp.1sntpmdoc@1.169 +3 -3
+ NTP_4_2_7P347
+
+ sntp/sntp.html@1.349 +2 -2
+ NTP_4_2_7P347
+
+ sntp/sntp.man.in@1.169 +3 -3
+ NTP_4_2_7P347
+
+ sntp/sntp.mdoc.in@1.169 +3 -3
+ NTP_4_2_7P347
+
+ util/invoke-ntp-keygen.texi@1.338 +2 -2
+ NTP_4_2_7P347
+
+ util/ntp-keygen-opts.c@1.352 +4 -4
+ NTP_4_2_7P347
+
+ util/ntp-keygen-opts.h@1.352 +3 -3
+ NTP_4_2_7P347
+
+ util/ntp-keygen.1ntp-keygenman@1.166 +3 -3
+ NTP_4_2_7P347
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.166 +3 -3
+ NTP_4_2_7P347
+
+ util/ntp-keygen.html@1.16 +2 -23
+ NTP_4_2_7P347
+
+ util/ntp-keygen.man.in@1.166 +3 -3
+ NTP_4_2_7P347
+
+ util/ntp-keygen.mdoc.in@1.166 +3 -3
+ NTP_4_2_7P347
+
+ChangeSet@1.2880, 2013-01-07 04:15:55-05:00, stenn@deacon.udel.edu
+ [Bug 2325] Re-enable mlockall() check under Linux post-1223 fix
+
+ ChangeLog@1.1234 +1 -0
+ [Bug 2325] Re-enable mlockall() check under Linux post-1223 fix
+
+ configure.ac@1.556 +4 -3
+ [Bug 2325] Re-enable mlockall() check under Linux post-1223 fix
+
+ChangeSet@1.2879, 2013-01-06 11:47:57+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P346
+ TAG: NTP_4_2_7P346
+
+ ChangeLog@1.1233 +1 -0
+ NTP_4_2_7P346
+
+ ntpd/invoke-ntp.conf.texi@1.20 +1 -1
+ NTP_4_2_7P346
+
+ ntpd/invoke-ntp.keys.texi@1.20 +1 -1
+ NTP_4_2_7P346
+
+ ntpd/invoke-ntpd.texi@1.336 +2 -471
+ NTP_4_2_7P346
+
+ ntpd/ntp.conf.5man@1.54 +8 -5
+ NTP_4_2_7P346
+
+ ntpd/ntp.conf.5mdoc@1.54 +8 -5
+ NTP_4_2_7P346
+
+ ntpd/ntp.conf.html@1.19 +1 -1
+ NTP_4_2_7P346
+
+ ntpd/ntp.conf.man.in@1.54 +8 -5
+ NTP_4_2_7P346
+
+ ntpd/ntp.conf.mdoc.in@1.54 +8 -5
+ NTP_4_2_7P346
+
+ ntpd/ntp.keys.5man@1.54 +5 -4
+ NTP_4_2_7P346
+
+ ntpd/ntp.keys.5mdoc@1.54 +5 -4
+ NTP_4_2_7P346
+
+ ntpd/ntp.keys.html@1.20 +2 -2
+ NTP_4_2_7P346
+
+ ntpd/ntp.keys.man.in@1.54 +5 -4
+ NTP_4_2_7P346
+
+ ntpd/ntp.keys.mdoc.in@1.54 +5 -4
+ NTP_4_2_7P346
+
+ ntpd/ntpd-opts.c@1.354 +5 -5
+ NTP_4_2_7P346
+
+ ntpd/ntpd-opts.h@1.354 +5 -5
+ NTP_4_2_7P346
+
+ ntpd/ntpd.1ntpdman@1.165 +8 -5
+ NTP_4_2_7P346
+
+ ntpd/ntpd.1ntpdmdoc@1.165 +8 -5
+ NTP_4_2_7P346
+
+ ntpd/ntpd.html@1.14 +5 -5
+ NTP_4_2_7P346
+
+ ntpd/ntpd.man.in@1.165 +8 -5
+ NTP_4_2_7P346
+
+ ntpd/ntpd.mdoc.in@1.165 +8 -5
+ NTP_4_2_7P346
+
+ ntpdc/invoke-ntpdc.texi@1.333 +2 -609
+ NTP_4_2_7P346
+
+ ntpdc/ntpdc-opts.c@1.348 +5 -5
+ NTP_4_2_7P346
+
+ ntpdc/ntpdc-opts.h@1.348 +5 -5
+ NTP_4_2_7P346
+
+ ntpdc/ntpdc.1ntpdcman@1.164 +5 -3
+ NTP_4_2_7P346
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.164 +5 -3
+ NTP_4_2_7P346
+
+ ntpdc/ntpdc.html@1.177 +47 -187
+ NTP_4_2_7P346
+
+ ntpdc/ntpdc.man.in@1.164 +5 -3
+ NTP_4_2_7P346
+
+ ntpdc/ntpdc.mdoc.in@1.164 +5 -3
+ NTP_4_2_7P346
+
+ ntpq/invoke-ntpq.texi@1.337 +2 -2
+ NTP_4_2_7P346
+
+ ntpq/ntpq-opts.c@1.351 +5 -5
+ NTP_4_2_7P346
+
+ ntpq/ntpq-opts.h@1.351 +5 -5
+ NTP_4_2_7P346
+
+ ntpq/ntpq.1ntpqman@1.165 +2 -2
+ NTP_4_2_7P346
+
+ ntpq/ntpq.1ntpqmdoc@1.165 +2 -2
+ NTP_4_2_7P346
+
+ ntpq/ntpq.html@1.11 +4 -4
+ NTP_4_2_7P346
+
+ ntpq/ntpq.man.in@1.165 +2 -2
+ NTP_4_2_7P346
+
+ ntpq/ntpq.mdoc.in@1.165 +2 -2
+ NTP_4_2_7P346
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.336 +2 -48
+ NTP_4_2_7P346
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.351 +5 -5
+ NTP_4_2_7P346
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.351 +5 -5
+ NTP_4_2_7P346
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.165 +4 -3
+ NTP_4_2_7P346
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.165 +4 -3
+ NTP_4_2_7P346
+
+ ntpsnmpd/ntpsnmpd.html@1.9 +1 -1
+ NTP_4_2_7P346
+
+ ntpsnmpd/ntpsnmpd.man.in@1.165 +4 -3
+ NTP_4_2_7P346
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.165 +4 -3
+ NTP_4_2_7P346
+
+ packageinfo.sh@1.349 +1 -1
+ NTP_4_2_7P346
+
+ scripts/invoke-ntp-wait.texi@1.153 +1 -3
+ NTP_4_2_7P346
+
+ scripts/ntp-wait.1ntp-waitman@1.164 +4 -3
+ NTP_4_2_7P346
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.164 +4 -3
+ NTP_4_2_7P346
+
+ scripts/ntp-wait.html@1.169 +2 -5
+ NTP_4_2_7P346
+
+ scripts/ntp-wait.man.in@1.164 +4 -3
+ NTP_4_2_7P346
+
+ scripts/ntp-wait.mdoc.in@1.164 +4 -3
+ NTP_4_2_7P346
+
+ sntp/invoke-sntp.texi@1.333 +2 -27
+ NTP_4_2_7P346
+
+ sntp/sntp-opts.c@1.348 +5 -5
+ NTP_4_2_7P346
+
+ sntp/sntp-opts.h@1.348 +5 -5
+ NTP_4_2_7P346
+
+ sntp/sntp.1sntpman@1.168 +6 -4
+ NTP_4_2_7P346
+
+ sntp/sntp.1sntpmdoc@1.168 +6 -4
+ NTP_4_2_7P346
+
+ sntp/sntp.html@1.348 +2 -25
+ NTP_4_2_7P346
+
+ sntp/sntp.man.in@1.168 +6 -4
+ NTP_4_2_7P346
+
+ sntp/sntp.mdoc.in@1.168 +6 -4
+ NTP_4_2_7P346
+
+ util/invoke-ntp-keygen.texi@1.337 +2 -22
+ NTP_4_2_7P346
+
+ util/ntp-keygen-opts.c@1.351 +5 -5
+ NTP_4_2_7P346
+
+ util/ntp-keygen-opts.h@1.351 +5 -5
+ NTP_4_2_7P346
+
+ util/ntp-keygen.1ntp-keygenman@1.165 +9 -5
+ NTP_4_2_7P346
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.165 +9 -5
+ NTP_4_2_7P346
+
+ util/ntp-keygen.html@1.15 +5 -5
+ NTP_4_2_7P346
+
+ util/ntp-keygen.man.in@1.165 +9 -5
+ NTP_4_2_7P346
+
+ util/ntp-keygen.mdoc.in@1.165 +9 -5
+ NTP_4_2_7P346
+
+ChangeSet@1.2878, 2013-01-06 06:26:49-05:00, stenn@deacon.udel.edu
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/autoopts/options.h@1.19 +60 -40
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/autoopts/project.h@1.4 +25 -0
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/autoopts/usage-txt.h@1.19 +9 -9
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/compat/compat.h@1.12 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/compat/windows-config.h@1.11 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/m4/libopts.m4@1.23 +2 -2
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/m4/liboptschk.m4@1.11 +1 -1
+ Libopts-5.17.1pre14 update
+
+ChangeSet@1.2877, 2013-01-06 05:17:07-05:00, stenn@deacon.udel.edu
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/COPYING.gplv3@1.6 +3 -3
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/COPYING.lgplv3@1.6 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/Makefile.am@1.17 +3 -3
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/README@1.8 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/ag-char-map.h@1.20 +2 -2
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/alias.c@1.4 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/ao-strs.c@1.6 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/ao-strs.h@1.5 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/autoopts.c@1.15 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/autoopts.h@1.13 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/boolean.c@1.12 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/check.c@1.5 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/configfile.c@1.17 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/cook.c@1.12 +24 -15
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/enum.c@1.7 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/env.c@1.6 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/file.c@1.12 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/find.c@1.6 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/genshell.c@1.20 +2 -2
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/genshell.h@1.20 +3 -3
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/gettext.h@1.2 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/init.c@1.2 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/load.c@1.15 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/makeshell.c@1.14 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/nested.c@1.11 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/numeric.c@1.11 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/option-value-type.c@1.7 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/option-value-type.h@1.21 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/option-xat-attribute.c@1.7 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/option-xat-attribute.h@1.21 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/parse-duration.c@1.10 +4 -4
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/parse-duration.h@1.8 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/pgusage.c@1.12 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/proto.h@1.20 +29 -39
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/putshell.c@1.11 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/reset.c@1.13 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/restore.c@1.10 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/save.c@1.13 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/sort.c@1.11 +70 -70
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/stack.c@1.12 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/streqvcmp.c@1.11 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/text_mmap.c@1.12 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/time.c@1.12 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/tokenize.c@1.9 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/usage.c@1.13 +1 -1
+ Libopts-5.17.1pre14 update
+
+ sntp/libopts/version.c@1.13 +3 -5
+ Libopts-5.17.1pre14 update
+
+ChangeSet@1.2876, 2013-01-06 09:08:55+00:00, stenn@psp-at1.ntp.org
+ [Bug 1223] reorganize inclusion of sys/resource.h
+
+ ChangeLog@1.1232 +1 -0
+ [Bug 1223] reorganize inclusion of sys/resource.h
+
+ include/ntp_config.h@1.79 +4 -0
+ [Bug 1223] reorganize inclusion of sys/resource.h
+
+ ntpd/ntp_config.c@1.310 +0 -3
+ [Bug 1223] reorganize inclusion of sys/resource.h
+
+ ntpd/ntp_util.c@1.99 +0 -6
+ [Bug 1223] reorganize inclusion of sys/resource.h
+
+ ntpd/ntpd.c@1.141 +0 -3
+ [Bug 1223] reorganize inclusion of sys/resource.h
+
+ChangeSet@1.2875, 2013-01-04 09:05:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P345
+ TAG: NTP_4_2_7P345
+
+ ChangeLog@1.1231 +1 -0
+ NTP_4_2_7P345
+
+ ntpd/invoke-ntp.conf.texi@1.19 +2 -2
+ NTP_4_2_7P345
+
+ ntpd/invoke-ntp.keys.texi@1.19 +2 -2
+ NTP_4_2_7P345
+
+ ntpd/invoke-ntpd.texi@1.335 +5 -5
+ NTP_4_2_7P345
+
+ ntpd/ntp.conf.5man@1.53 +61 -10
+ NTP_4_2_7P345
+
+ ntpd/ntp.conf.5mdoc@1.53 +136 -87
+ NTP_4_2_7P345
+
+ ntpd/ntp.conf.html@1.18 +405 -1603
+ NTP_4_2_7P345
+
+ ntpd/ntp.conf.man.in@1.53 +61 -10
+ NTP_4_2_7P345
+
+ ntpd/ntp.conf.mdoc.in@1.53 +136 -87
+ NTP_4_2_7P345
+
+ ntpd/ntp.keys.5man@1.53 +24 -6
+ NTP_4_2_7P345
+
+ ntpd/ntp.keys.5mdoc@1.53 +58 -9
+ NTP_4_2_7P345
+
+ ntpd/ntp.keys.html@1.19 +71 -27
+ NTP_4_2_7P345
+
+ ntpd/ntp.keys.man.in@1.53 +24 -6
+ NTP_4_2_7P345
+
+ ntpd/ntp.keys.mdoc.in@1.53 +58 -9
+ NTP_4_2_7P345
+
+ ntpd/ntpd-opts.c@1.353 +4 -4
+ NTP_4_2_7P345
+
+ ntpd/ntpd-opts.h@1.353 +3 -3
+ NTP_4_2_7P345
+
+ ntpd/ntpd.1ntpdman@1.164 +42 -20
+ NTP_4_2_7P345
+
+ ntpd/ntpd.1ntpdmdoc@1.164 +68 -53
+ NTP_4_2_7P345
+
+ ntpd/ntpd.html@1.13 +70 -178
+ NTP_4_2_7P345
+
+ ntpd/ntpd.man.in@1.164 +42 -20
+ NTP_4_2_7P345
+
+ ntpd/ntpd.mdoc.in@1.164 +68 -53
+ NTP_4_2_7P345
+
+ ntpdc/invoke-ntpdc.texi@1.332 +4 -4
+ NTP_4_2_7P345
+
+ ntpdc/ntpdc-opts.c@1.347 +4 -4
+ NTP_4_2_7P345
+
+ ntpdc/ntpdc-opts.h@1.347 +3 -3
+ NTP_4_2_7P345
+
+ ntpdc/ntpdc.1ntpdcman@1.163 +31 -12
+ NTP_4_2_7P345
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.163 +53 -36
+ NTP_4_2_7P345
+
+ ntpdc/ntpdc.html@1.176 +4 -4
+ NTP_4_2_7P345
+
+ ntpdc/ntpdc.man.in@1.163 +31 -12
+ NTP_4_2_7P345
+
+ ntpdc/ntpdc.mdoc.in@1.163 +53 -36
+ NTP_4_2_7P345
+
+ ntpq/invoke-ntpq.texi@1.336 +4 -4
+ NTP_4_2_7P345
+
+ ntpq/ntpq-opts.c@1.350 +4 -4
+ NTP_4_2_7P345
+
+ ntpq/ntpq-opts.h@1.350 +3 -3
+ NTP_4_2_7P345
+
+ ntpq/ntpq.1ntpqman@1.164 +28 -9
+ NTP_4_2_7P345
+
+ ntpq/ntpq.1ntpqmdoc@1.164 +40 -23
+ NTP_4_2_7P345
+
+ ntpq/ntpq.html@1.10 +68 -37
+ NTP_4_2_7P345
+
+ ntpq/ntpq.man.in@1.164 +28 -9
+ NTP_4_2_7P345
+
+ ntpq/ntpq.mdoc.in@1.164 +40 -23
+ NTP_4_2_7P345
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.335 +5 -5
+ NTP_4_2_7P345
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.350 +4 -4
+ NTP_4_2_7P345
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.350 +3 -3
+ NTP_4_2_7P345
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.164 +25 -7
+ NTP_4_2_7P345
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.164 +35 -19
+ NTP_4_2_7P345
+
+ ntpsnmpd/ntpsnmpd.html@1.8 +1 -1
+ NTP_4_2_7P345
+
+ ntpsnmpd/ntpsnmpd.man.in@1.164 +25 -7
+ NTP_4_2_7P345
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.164 +35 -19
+ NTP_4_2_7P345
+
+ packageinfo.sh@1.348 +1 -1
+ NTP_4_2_7P345
+
+ scripts/invoke-ntp-wait.texi@1.152 +5 -5
+ NTP_4_2_7P345
+
+ scripts/ntp-wait.1ntp-waitman@1.163 +27 -5
+ NTP_4_2_7P345
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.163 +33 -12
+ NTP_4_2_7P345
+
+ scripts/ntp-wait.html@1.168 +5 -5
+ NTP_4_2_7P345
+
+ scripts/ntp-wait.man.in@1.163 +27 -5
+ NTP_4_2_7P345
+
+ scripts/ntp-wait.mdoc.in@1.163 +33 -12
+ NTP_4_2_7P345
+
+ sntp/invoke-sntp.texi@1.332 +5 -5
+ NTP_4_2_7P345
+
+ sntp/sntp-opts.c@1.347 +4 -4
+ NTP_4_2_7P345
+
+ sntp/sntp-opts.h@1.347 +3 -3
+ NTP_4_2_7P345
+
+ sntp/sntp.1sntpman@1.167 +32 -14
+ NTP_4_2_7P345
+
+ sntp/sntp.1sntpmdoc@1.167 +47 -34
+ NTP_4_2_7P345
+
+ sntp/sntp.html@1.347 +5 -5
+ NTP_4_2_7P345
+
+ sntp/sntp.man.in@1.167 +32 -14
+ NTP_4_2_7P345
+
+ sntp/sntp.mdoc.in@1.167 +47 -34
+ NTP_4_2_7P345
+
+ util/invoke-ntp-keygen.texi@1.336 +5 -5
+ NTP_4_2_7P345
+
+ util/ntp-keygen-opts.c@1.350 +4 -4
+ NTP_4_2_7P345
+
+ util/ntp-keygen-opts.h@1.350 +3 -3
+ NTP_4_2_7P345
+
+ util/ntp-keygen.1ntp-keygenman@1.164 +32 -14
+ NTP_4_2_7P345
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.164 +74 -59
+ NTP_4_2_7P345
+
+ util/ntp-keygen.html@1.14 +233 -205
+ NTP_4_2_7P345
+
+ util/ntp-keygen.man.in@1.164 +32 -14
+ NTP_4_2_7P345
+
+ util/ntp-keygen.mdoc.in@1.164 +74 -59
+ NTP_4_2_7P345
+
+ChangeSet@1.2874, 2013-01-04 03:36:43-05:00, stenn@deacon.udel.edu
+ clarify the reasoning for local libopts
+
+ configure.ac@1.555 +3 -2
+ clarify the reasoning for local libopts
+
+ChangeSet@1.2873, 2013-01-04 08:12:48+00:00, stenn@psp-at1.ntp.org
+ Update several .def files to use autogen-5.17 feature set
+
+ ChangeLog@1.1230 +1 -0
+ Update several .def files to use autogen-5.17 feature set
+
+ ntpd/ntp.conf.def@1.6 +1 -6
+ Update several .def files to use autogen-5.17 feature set
+
+ ntpd/ntp.keys.def@1.9 +1 -6
+ Update several .def files to use autogen-5.17 feature set
+
+ ntpd/ntpd-opts.def@1.9 +1 -1
+ Update several .def files to use autogen-5.17 feature set
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.6 +1 -1
+ Update several .def files to use autogen-5.17 feature set
+
+ scripts/ntp-wait-opts.def@1.6 +1 -6
+ Update several .def files to use autogen-5.17 feature set
+
+ sntp/ag-tpl/:Old/agman-file.tpl@1.2 +0 -0
+ Rename: sntp/ag-tpl/agman-file.tpl -> sntp/ag-tpl/:Old/agman-file.tpl
+
+ sntp/ag-tpl/:Old/agmdoc-file.tpl@1.2 +0 -0
+ Rename: sntp/ag-tpl/agmdoc-file.tpl -> sntp/ag-tpl/:Old/agmdoc-file.tpl
+
+ sntp/ag-tpl/:Old/agtexi-cmd.tpl@1.2 +0 -0
+ Rename: sntp/ag-tpl/agtexi-cmd.tpl -> sntp/ag-tpl/:Old/agtexi-cmd.tpl
+
+ sntp/ag-tpl/:Old/cmd-doc.tlib@1.2 +0 -0
+ Rename: sntp/ag-tpl/cmd-doc.tlib -> sntp/ag-tpl/:Old/cmd-doc.tlib
+
+ sntp/ag-tpl/:Old/mdoc2man@1.2 +0 -0
+ Rename: sntp/ag-tpl/mdoc2man -> sntp/ag-tpl/:Old/mdoc2man
+
+ sntp/include/autogen-version.def@1.14 +2 -1
+ Update several .def files to use autogen-5.17 feature set
+
+ sntp/include/copyright.def@1.22 +5 -0
+ Update several .def files to use autogen-5.17 feature set
+
+ sntp/sntp-opts.def@1.42 +1 -47
+ Update several .def files to use autogen-5.17 feature set
+
+ util/ntp-keygen-opts.def@1.24 +1 -6
+ Update several .def files to use autogen-5.17 feature set
+
+ChangeSet@1.2872, 2013-01-03 13:11:51+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P344
+ TAG: NTP_4_2_7P344
+
+ ChangeLog@1.1229 +1 -0
+ NTP_4_2_7P344
+
+ ntpd/invoke-ntp.conf.texi@1.18 +773 -774
+ NTP_4_2_7P344
+
+ ntpd/invoke-ntp.keys.texi@1.18 +54 -29
+ NTP_4_2_7P344
+
+ ntpd/invoke-ntpd.texi@1.334 +72 -173
+ NTP_4_2_7P344
+
+ ntpd/ntp.conf.5man@1.52 +2879 -3
+ NTP_4_2_7P344
+
+ ntpd/ntp.conf.5mdoc@1.52 +2711 -3
+ NTP_4_2_7P344
+
+ ntpd/ntp.conf.html@1.17 +1 -1
+ NTP_4_2_7P344
+
+ ntpd/ntp.conf.man.in@1.52 +2879 -3
+ NTP_4_2_7P344
+
+ ntpd/ntp.conf.mdoc.in@1.52 +2711 -3
+ NTP_4_2_7P344
+
+ ntpd/ntp.keys.5man@1.52 +95 -2
+ NTP_4_2_7P344
+
+ ntpd/ntp.keys.5mdoc@1.52 +94 -2
+ NTP_4_2_7P344
+
+ ntpd/ntp.keys.html@1.18 +1 -1
+ NTP_4_2_7P344
+
+ ntpd/ntp.keys.man.in@1.52 +95 -2
+ NTP_4_2_7P344
+
+ ntpd/ntp.keys.mdoc.in@1.52 +94 -2
+ NTP_4_2_7P344
+
+ ntpd/ntpd-opts.c@1.352 +73 -45
+ NTP_4_2_7P344
+
+ ntpd/ntpd-opts.h@1.352 +10 -9
+ NTP_4_2_7P344
+
+ ntpd/ntpd.1ntpdman@1.163 +550 -4
+ NTP_4_2_7P344
+
+ ntpd/ntpd.1ntpdmdoc@1.163 +548 -3
+ NTP_4_2_7P344
+
+ ntpd/ntpd.html@1.12 +2 -2
+ NTP_4_2_7P344
+
+ ntpd/ntpd.man.in@1.163 +550 -4
+ NTP_4_2_7P344
+
+ ntpd/ntpd.mdoc.in@1.163 +548 -3
+ NTP_4_2_7P344
+
+ ntpdc/invoke-ntpdc.texi@1.331 +154 -205
+ NTP_4_2_7P344
+
+ ntpdc/ntpdc-opts.c@1.346 +73 -45
+ NTP_4_2_7P344
+
+ ntpdc/ntpdc-opts.h@1.346 +12 -11
+ NTP_4_2_7P344
+
+ ntpdc/ntpdc.1ntpdcman@1.162 +705 -4
+ NTP_4_2_7P344
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.162 +659 -3
+ NTP_4_2_7P344
+
+ ntpdc/ntpdc.html@1.175 +40 -34
+ NTP_4_2_7P344
+
+ ntpdc/ntpdc.man.in@1.162 +705 -4
+ NTP_4_2_7P344
+
+ ntpdc/ntpdc.mdoc.in@1.162 +659 -3
+ NTP_4_2_7P344
+
+ ntpq/invoke-ntpq.texi@1.335 +61 -42
+ NTP_4_2_7P344
+
+ ntpq/ntpq-opts.c@1.349 +73 -45
+ NTP_4_2_7P344
+
+ ntpq/ntpq-opts.h@1.349 +12 -11
+ NTP_4_2_7P344
+
+ ntpq/ntpq.1ntpqman@1.163 +261 -3
+ NTP_4_2_7P344
+
+ ntpq/ntpq.1ntpqmdoc@1.163 +245 -2
+ NTP_4_2_7P344
+
+ ntpq/ntpq.html@1.9 +2 -2
+ NTP_4_2_7P344
+
+ ntpq/ntpq.man.in@1.163 +261 -3
+ NTP_4_2_7P344
+
+ ntpq/ntpq.mdoc.in@1.163 +245 -2
+ NTP_4_2_7P344
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.334 +19 -23
+ NTP_4_2_7P344
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.349 +67 -45
+ NTP_4_2_7P344
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.349 +12 -11
+ NTP_4_2_7P344
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.163 +57 -3
+ NTP_4_2_7P344
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.163 +48 -2
+ NTP_4_2_7P344
+
+ ntpsnmpd/ntpsnmpd.html@1.7 +1 -1
+ NTP_4_2_7P344
+
+ ntpsnmpd/ntpsnmpd.man.in@1.163 +57 -3
+ NTP_4_2_7P344
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.163 +48 -2
+ NTP_4_2_7P344
+
+ packageinfo.sh@1.347 +1 -1
+ NTP_4_2_7P344
+
+ scripts/invoke-ntp-wait.texi@1.151 +9 -6
+ NTP_4_2_7P344
+
+ scripts/ntp-wait.1ntp-waitman@1.162 +20 -3
+ NTP_4_2_7P344
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.162 +19 -2
+ NTP_4_2_7P344
+
+ scripts/ntp-wait.html@1.167 +9 -6
+ NTP_4_2_7P344
+
+ scripts/ntp-wait.man.in@1.162 +20 -3
+ NTP_4_2_7P344
+
+ scripts/ntp-wait.mdoc.in@1.162 +19 -2
+ NTP_4_2_7P344
+
+ sntp/invoke-sntp.texi@1.331 +28 -18
+ NTP_4_2_7P344
+
+ sntp/sntp-opts.c@1.346 +75 -47
+ NTP_4_2_7P344
+
+ sntp/sntp-opts.h@1.346 +12 -11
+ NTP_4_2_7P344
+
+ sntp/sntp.1sntpman@1.166 +67 -3
+ NTP_4_2_7P344
+
+ sntp/sntp.1sntpmdoc@1.166 +66 -2
+ NTP_4_2_7P344
+
+ sntp/sntp.html@1.346 +26 -17
+ NTP_4_2_7P344
+
+ sntp/sntp.man.in@1.166 +67 -3
+ NTP_4_2_7P344
+
+ sntp/sntp.mdoc.in@1.166 +66 -2
+ NTP_4_2_7P344
+
+ util/invoke-ntp-keygen.texi@1.335 +208 -171
+ NTP_4_2_7P344
+
+ util/ntp-keygen-opts.c@1.349 +75 -47
+ NTP_4_2_7P344
+
+ util/ntp-keygen-opts.h@1.349 +10 -9
+ NTP_4_2_7P344
+
+ util/ntp-keygen.1ntp-keygenman@1.163 +854 -4
+ NTP_4_2_7P344
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.163 +839 -3
+ NTP_4_2_7P344
+
+ util/ntp-keygen.html@1.13 +2 -2
+ NTP_4_2_7P344
+
+ util/ntp-keygen.man.in@1.163 +854 -4
+ NTP_4_2_7P344
+
+ util/ntp-keygen.mdoc.in@1.163 +839 -3
+ NTP_4_2_7P344
+
+ChangeSet@1.2871, 2013-01-03 11:36:26+00:00, stenn@psp-at1.ntp.org
+ Refactor and enhance mdoc2texi
+
+ ChangeLog@1.1228 +1 -0
+ Refactor and enhance mdoc2texi
+
+ ChangeLog@1.1227 +1 -0
+ Make sure agtexi-file.tpl defines label-str
+
+ sntp/ag-tpl/agtexi-file.tpl@1.4 +4 -4
+ Make sure agtexi-file.tpl defines label-str
+
+ sntp/ag-tpl/mdoc2texi@1.7 +676 -393
+ Refactor and enhance mdoc2texi
+
+ChangeSet@1.2870, 2013-01-03 11:23:34+00:00, stenn@psp-at1.ntp.org
+ Cleanup to ntp.conf.def
+
+ ChangeLog@1.1226 +1 -0
+ Cleanup to ntp.conf.def
+
+ ntpd/ntp.conf.def@1.5 +4 -2
+ Cleanup to ntp.conf.def
+
+ChangeSet@1.2865.1.7, 2013-01-02 02:21:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P343
+ TAG: NTP_4_2_7P343
+
+ ChangeLog@1.1222.1.6 +1 -0
+ NTP_4_2_7P343
+
+ ntpd/invoke-ntp.conf.texi@1.17 +1 -1
+ NTP_4_2_7P343
+
+ ntpd/invoke-ntp.keys.texi@1.17 +1 -1
+ NTP_4_2_7P343
+
+ ntpd/invoke-ntpd.texi@1.333 +2 -2
+ NTP_4_2_7P343
+
+ ntpd/ntp.conf.5man@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntp.conf.5mdoc@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntp.conf.html@1.16 +1 -1
+ NTP_4_2_7P343
+
+ ntpd/ntp.conf.man.in@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntp.conf.mdoc.in@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntp.keys.5man@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntp.keys.5mdoc@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntp.keys.html@1.17 +1 -1
+ NTP_4_2_7P343
+
+ ntpd/ntp.keys.man.in@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntp.keys.mdoc.in@1.51 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntpd-opts.c@1.351 +6 -6
+ NTP_4_2_7P343
+
+ ntpd/ntpd-opts.h@1.351 +4 -4
+ NTP_4_2_7P343
+
+ ntpd/ntpd.1ntpdman@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntpd.1ntpdmdoc@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntpd.html@1.11 +2 -2
+ NTP_4_2_7P343
+
+ ntpd/ntpd.man.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpd/ntpd.mdoc.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpdc/invoke-ntpdc.texi@1.330 +2 -2
+ NTP_4_2_7P343
+
+ ntpdc/ntpdc-opts.c@1.345 +6 -6
+ NTP_4_2_7P343
+
+ ntpdc/ntpdc-opts.h@1.345 +4 -4
+ NTP_4_2_7P343
+
+ ntpdc/ntpdc.1ntpdcman@1.161 +3 -3
+ NTP_4_2_7P343
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.161 +3 -3
+ NTP_4_2_7P343
+
+ ntpdc/ntpdc.html@1.174 +2 -2
+ NTP_4_2_7P343
+
+ ntpdc/ntpdc.man.in@1.161 +3 -3
+ NTP_4_2_7P343
+
+ ntpdc/ntpdc.mdoc.in@1.161 +3 -3
+ NTP_4_2_7P343
+
+ ntpq/invoke-ntpq.texi@1.334 +2 -2
+ NTP_4_2_7P343
+
+ ntpq/ntpq-opts.c@1.348 +6 -6
+ NTP_4_2_7P343
+
+ ntpq/ntpq-opts.h@1.348 +4 -4
+ NTP_4_2_7P343
+
+ ntpq/ntpq.1ntpqman@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpq/ntpq.1ntpqmdoc@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpq/ntpq.html@1.8 +2 -2
+ NTP_4_2_7P343
+
+ ntpq/ntpq.man.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpq/ntpq.mdoc.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.333 +2 -2
+ NTP_4_2_7P343
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.348 +6 -6
+ NTP_4_2_7P343
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.348 +4 -4
+ NTP_4_2_7P343
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpsnmpd/ntpsnmpd.html@1.6 +1 -1
+ NTP_4_2_7P343
+
+ ntpsnmpd/ntpsnmpd.man.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ packageinfo.sh@1.346 +1 -1
+ NTP_4_2_7P343
+
+ scripts/invoke-ntp-wait.texi@1.150 +1 -1
+ NTP_4_2_7P343
+
+ scripts/ntp-wait.1ntp-waitman@1.161 +3 -3
+ NTP_4_2_7P343
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.161 +3 -3
+ NTP_4_2_7P343
+
+ scripts/ntp-wait.html@1.166 +1 -1
+ NTP_4_2_7P343
+
+ scripts/ntp-wait.man.in@1.161 +3 -3
+ NTP_4_2_7P343
+
+ scripts/ntp-wait.mdoc.in@1.161 +3 -3
+ NTP_4_2_7P343
+
+ sntp/invoke-sntp.texi@1.330 +2 -2
+ NTP_4_2_7P343
+
+ sntp/sntp-opts.c@1.345 +6 -6
+ NTP_4_2_7P343
+
+ sntp/sntp-opts.h@1.345 +4 -4
+ NTP_4_2_7P343
+
+ sntp/sntp.1sntpman@1.165 +3 -3
+ NTP_4_2_7P343
+
+ sntp/sntp.1sntpmdoc@1.165 +3 -3
+ NTP_4_2_7P343
+
+ sntp/sntp.html@1.345 +2 -2
+ NTP_4_2_7P343
+
+ sntp/sntp.man.in@1.165 +3 -3
+ NTP_4_2_7P343
+
+ sntp/sntp.mdoc.in@1.165 +3 -3
+ NTP_4_2_7P343
+
+ util/invoke-ntp-keygen.texi@1.334 +2 -2
+ NTP_4_2_7P343
+
+ util/ntp-keygen-opts.c@1.348 +6 -6
+ NTP_4_2_7P343
+
+ util/ntp-keygen-opts.h@1.348 +4 -4
+ NTP_4_2_7P343
+
+ util/ntp-keygen.1ntp-keygenman@1.162 +3 -3
+ NTP_4_2_7P343
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.162 +3 -3
+ NTP_4_2_7P343
+
+ util/ntp-keygen.html@1.12 +2 -2
+ NTP_4_2_7P343
+
+ util/ntp-keygen.man.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ util/ntp-keygen.mdoc.in@1.162 +3 -3
+ NTP_4_2_7P343
+
+ChangeSet@1.2865.1.6, 2012-12-31 20:47:19-05:00, stenn@deacon.udel.edu
+ Update the copyright year
+
+ ChangeLog@1.1222.1.5 +1 -0
+ Update the copyright year
+
+ html/copyright.html@1.61 +1 -1
+ Update the copyright year
+
+ sntp/include/copyright.def@1.21 +1 -1
+ Update the copyright year
+
+ChangeSet@1.2865.1.5, 2012-12-31 09:25:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P342
+ TAG: NTP_4_2_7P342
+
+ ChangeLog@1.1222.1.4 +1 -0
+ NTP_4_2_7P342
+
+ ntpd/invoke-ntp.conf.texi@1.16 +1 -1
+ NTP_4_2_7P342
+
+ ntpd/invoke-ntp.keys.texi@1.16 +1 -1
+ NTP_4_2_7P342
+
+ ntpd/invoke-ntpd.texi@1.332 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.conf.5man@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.conf.5mdoc@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.conf.html@1.15 +1 -1
+ NTP_4_2_7P342
+
+ ntpd/ntp.conf.man.in@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.conf.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.keys.5man@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.keys.5mdoc@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.keys.html@1.16 +1 -1
+ NTP_4_2_7P342
+
+ ntpd/ntp.keys.man.in@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntp.keys.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntpd-opts.c@1.350 +4 -4
+ NTP_4_2_7P342
+
+ ntpd/ntpd-opts.h@1.350 +3 -3
+ NTP_4_2_7P342
+
+ ntpd/ntpd.1ntpdman@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntpd.1ntpdmdoc@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntpd.html@1.10 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntpd.man.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpd/ntpd.mdoc.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpdc/invoke-ntpdc.texi@1.329 +2 -2
+ NTP_4_2_7P342
+
+ ntpdc/ntpdc-opts.c@1.344 +4 -4
+ NTP_4_2_7P342
+
+ ntpdc/ntpdc-opts.h@1.344 +3 -3
+ NTP_4_2_7P342
+
+ ntpdc/ntpdc.1ntpdcman@1.160 +2 -2
+ NTP_4_2_7P342
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.160 +2 -2
+ NTP_4_2_7P342
+
+ ntpdc/ntpdc.html@1.173 +2 -2
+ NTP_4_2_7P342
+
+ ntpdc/ntpdc.man.in@1.160 +2 -2
+ NTP_4_2_7P342
+
+ ntpdc/ntpdc.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P342
+
+ ntpq/invoke-ntpq.texi@1.333 +2 -2
+ NTP_4_2_7P342
+
+ ntpq/ntpq-opts.c@1.347 +4 -4
+ NTP_4_2_7P342
+
+ ntpq/ntpq-opts.h@1.347 +3 -3
+ NTP_4_2_7P342
+
+ ntpq/ntpq.1ntpqman@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpq/ntpq.1ntpqmdoc@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpq/ntpq.html@1.7 +2 -2
+ NTP_4_2_7P342
+
+ ntpq/ntpq.man.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpq/ntpq.mdoc.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.332 +2 -2
+ NTP_4_2_7P342
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.347 +4 -4
+ NTP_4_2_7P342
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.347 +3 -3
+ NTP_4_2_7P342
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpsnmpd/ntpsnmpd.html@1.5 +1 -1
+ NTP_4_2_7P342
+
+ ntpsnmpd/ntpsnmpd.man.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ packageinfo.sh@1.345 +1 -1
+ NTP_4_2_7P342
+
+ scripts/invoke-ntp-wait.texi@1.149 +1 -1
+ NTP_4_2_7P342
+
+ scripts/ntp-wait.1ntp-waitman@1.160 +2 -2
+ NTP_4_2_7P342
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.160 +2 -2
+ NTP_4_2_7P342
+
+ scripts/ntp-wait.html@1.165 +1 -1
+ NTP_4_2_7P342
+
+ scripts/ntp-wait.man.in@1.160 +2 -2
+ NTP_4_2_7P342
+
+ scripts/ntp-wait.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P342
+
+ sntp/invoke-sntp.texi@1.329 +2 -2
+ NTP_4_2_7P342
+
+ sntp/sntp-opts.c@1.344 +4 -4
+ NTP_4_2_7P342
+
+ sntp/sntp-opts.h@1.344 +3 -3
+ NTP_4_2_7P342
+
+ sntp/sntp.1sntpman@1.164 +2 -2
+ NTP_4_2_7P342
+
+ sntp/sntp.1sntpmdoc@1.164 +2 -2
+ NTP_4_2_7P342
+
+ sntp/sntp.html@1.344 +2 -2
+ NTP_4_2_7P342
+
+ sntp/sntp.man.in@1.164 +2 -2
+ NTP_4_2_7P342
+
+ sntp/sntp.mdoc.in@1.164 +2 -2
+ NTP_4_2_7P342
+
+ util/invoke-ntp-keygen.texi@1.333 +2 -2
+ NTP_4_2_7P342
+
+ util/ntp-keygen-opts.c@1.347 +4 -4
+ NTP_4_2_7P342
+
+ util/ntp-keygen-opts.h@1.347 +3 -3
+ NTP_4_2_7P342
+
+ util/ntp-keygen.1ntp-keygenman@1.161 +2 -2
+ NTP_4_2_7P342
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.161 +2 -2
+ NTP_4_2_7P342
+
+ util/ntp-keygen.html@1.11 +2 -2
+ NTP_4_2_7P342
+
+ util/ntp-keygen.man.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ util/ntp-keygen.mdoc.in@1.161 +2 -2
+ NTP_4_2_7P342
+
+ChangeSet@1.2865.1.3, 2012-12-30 16:01:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P341
+ TAG: NTP_4_2_7P341
+
+ ChangeLog@1.1222.1.2 +1 -0
+ NTP_4_2_7P341
+
+ ntpd/invoke-ntp.conf.texi@1.15 +1 -1
+ NTP_4_2_7P341
+
+ ntpd/invoke-ntp.keys.texi@1.15 +1 -1
+ NTP_4_2_7P341
+
+ ntpd/invoke-ntpd.texi@1.331 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.conf.5man@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.conf.5mdoc@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.conf.html@1.14 +1 -13
+ NTP_4_2_7P341
+
+ ntpd/ntp.conf.man.in@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.conf.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.keys.5man@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.keys.5mdoc@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.keys.html@1.15 +1 -1
+ NTP_4_2_7P341
+
+ ntpd/ntp.keys.man.in@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntp.keys.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntpd-opts.c@1.349 +4 -4
+ NTP_4_2_7P341
+
+ ntpd/ntpd-opts.h@1.349 +3 -3
+ NTP_4_2_7P341
+
+ ntpd/ntpd.1ntpdman@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntpd.1ntpdmdoc@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntpd.html@1.9 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntpd.man.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpd/ntpd.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpdc/invoke-ntpdc.texi@1.328 +2 -2
+ NTP_4_2_7P341
+
+ ntpdc/ntpdc-opts.c@1.343 +4 -4
+ NTP_4_2_7P341
+
+ ntpdc/ntpdc-opts.h@1.343 +3 -3
+ NTP_4_2_7P341
+
+ ntpdc/ntpdc.1ntpdcman@1.159 +2 -2
+ NTP_4_2_7P341
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.159 +2 -2
+ NTP_4_2_7P341
+
+ ntpdc/ntpdc.html@1.172 +2 -2
+ NTP_4_2_7P341
+
+ ntpdc/ntpdc.man.in@1.159 +2 -2
+ NTP_4_2_7P341
+
+ ntpdc/ntpdc.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P341
+
+ ntpq/invoke-ntpq.texi@1.332 +2 -2
+ NTP_4_2_7P341
+
+ ntpq/ntpq-opts.c@1.346 +4 -4
+ NTP_4_2_7P341
+
+ ntpq/ntpq-opts.h@1.346 +3 -3
+ NTP_4_2_7P341
+
+ ntpq/ntpq.1ntpqman@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpq/ntpq.1ntpqmdoc@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpq/ntpq.html@1.6 +2 -4
+ NTP_4_2_7P341
+
+ ntpq/ntpq.man.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpq/ntpq.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.331 +2 -2
+ NTP_4_2_7P341
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.346 +4 -4
+ NTP_4_2_7P341
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.346 +3 -3
+ NTP_4_2_7P341
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpsnmpd/ntpsnmpd.html@1.4 +1 -1
+ NTP_4_2_7P341
+
+ ntpsnmpd/ntpsnmpd.man.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ packageinfo.sh@1.344 +1 -1
+ NTP_4_2_7P341
+
+ scripts/invoke-ntp-wait.texi@1.148 +1 -1
+ NTP_4_2_7P341
+
+ scripts/ntp-wait.1ntp-waitman@1.159 +2 -2
+ NTP_4_2_7P341
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.159 +2 -2
+ NTP_4_2_7P341
+
+ scripts/ntp-wait.html@1.164 +1 -1
+ NTP_4_2_7P341
+
+ scripts/ntp-wait.man.in@1.159 +2 -2
+ NTP_4_2_7P341
+
+ scripts/ntp-wait.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P341
+
+ sntp/invoke-sntp.texi@1.328 +2 -2
+ NTP_4_2_7P341
+
+ sntp/sntp-opts.c@1.343 +4 -4
+ NTP_4_2_7P341
+
+ sntp/sntp-opts.h@1.343 +3 -3
+ NTP_4_2_7P341
+
+ sntp/sntp.1sntpman@1.163 +2 -2
+ NTP_4_2_7P341
+
+ sntp/sntp.1sntpmdoc@1.163 +2 -2
+ NTP_4_2_7P341
+
+ sntp/sntp.html@1.343 +2 -2
+ NTP_4_2_7P341
+
+ sntp/sntp.man.in@1.163 +2 -2
+ NTP_4_2_7P341
+
+ sntp/sntp.mdoc.in@1.163 +2 -2
+ NTP_4_2_7P341
+
+ util/invoke-ntp-keygen.texi@1.332 +2 -2
+ NTP_4_2_7P341
+
+ util/ntp-keygen-opts.c@1.346 +4 -4
+ NTP_4_2_7P341
+
+ util/ntp-keygen-opts.h@1.346 +3 -3
+ NTP_4_2_7P341
+
+ util/ntp-keygen.1ntp-keygenman@1.160 +2 -2
+ NTP_4_2_7P341
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.160 +2 -2
+ NTP_4_2_7P341
+
+ util/ntp-keygen.html@1.10 +2 -3
+ NTP_4_2_7P341
+
+ util/ntp-keygen.man.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ util/ntp-keygen.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P341
+
+ChangeSet@1.2865.1.2, 2012-12-29 19:57:16-05:00, stenn@deacon.udel.edu
+ Fix permissions on ntpsnmpd/netsnmp_daemonize.c
+
+ ntpsnmpd/netsnmp_daemonize.c@1.4 +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.2865.1.1, 2012-12-29 09:30:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P340
+ TAG: NTP_4_2_7P340
+
+ ChangeLog@1.1222.1.1 +1 -0
+ NTP_4_2_7P340
+
+ ntpd/invoke-ntp.conf.texi@1.14 +1 -13
+ NTP_4_2_7P340
+
+ ntpd/invoke-ntp.keys.texi@1.14 +1 -1
+ NTP_4_2_7P340
+
+ ntpd/invoke-ntpd.texi@1.330 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.conf.5man@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.conf.5mdoc@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.conf.html@1.13 +451 -126
+ NTP_4_2_7P340
+
+ ntpd/ntp.conf.man.in@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.conf.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.keys.5man@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.keys.5mdoc@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.keys.html@1.14 +6 -5
+ NTP_4_2_7P340
+
+ ntpd/ntp.keys.man.in@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntp.keys.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntpd-opts.c@1.348 +4 -4
+ NTP_4_2_7P340
+
+ ntpd/ntpd-opts.h@1.348 +3 -3
+ NTP_4_2_7P340
+
+ ntpd/ntpd.1ntpdman@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntpd.1ntpdmdoc@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntpd.html@1.8 +8 -8
+ NTP_4_2_7P340
+
+ ntpd/ntpd.man.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpd/ntpd.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpdc/invoke-ntpdc.texi@1.327 +2 -3
+ NTP_4_2_7P340
+
+ ntpdc/ntpdc-opts.c@1.342 +4 -4
+ NTP_4_2_7P340
+
+ ntpdc/ntpdc-opts.h@1.342 +3 -3
+ NTP_4_2_7P340
+
+ ntpdc/ntpdc.1ntpdcman@1.158 +2 -2
+ NTP_4_2_7P340
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.158 +2 -2
+ NTP_4_2_7P340
+
+ ntpdc/ntpdc.html@1.171 +2 -3
+ NTP_4_2_7P340
+
+ ntpdc/ntpdc.man.in@1.158 +2 -2
+ NTP_4_2_7P340
+
+ ntpdc/ntpdc.mdoc.in@1.158 +2 -2
+ NTP_4_2_7P340
+
+ ntpq/invoke-ntpq.texi@1.331 +2 -4
+ NTP_4_2_7P340
+
+ ntpq/ntpq-opts.c@1.345 +4 -4
+ NTP_4_2_7P340
+
+ ntpq/ntpq-opts.h@1.345 +3 -3
+ NTP_4_2_7P340
+
+ ntpq/ntpq.1ntpqman@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpq/ntpq.1ntpqmdoc@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpq/ntpq.html@1.5 +6 -4
+ NTP_4_2_7P340
+
+ ntpq/ntpq.man.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpq/ntpq.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.330 +2 -3
+ NTP_4_2_7P340
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.345 +4 -4
+ NTP_4_2_7P340
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.345 +3 -3
+ NTP_4_2_7P340
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpsnmpd/ntpsnmpd.html@1.3 +1 -1
+ NTP_4_2_7P340
+
+ ntpsnmpd/ntpsnmpd.man.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ packageinfo.sh@1.343 +1 -1
+ NTP_4_2_7P340
+
+ scripts/invoke-ntp-wait.texi@1.147 +1 -1
+ NTP_4_2_7P340
+
+ scripts/ntp-wait.1ntp-waitman@1.158 +2 -2
+ NTP_4_2_7P340
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.158 +2 -2
+ NTP_4_2_7P340
+
+ scripts/ntp-wait.html@1.163 +1 -1
+ NTP_4_2_7P340
+
+ scripts/ntp-wait.man.in@1.158 +2 -2
+ NTP_4_2_7P340
+
+ scripts/ntp-wait.mdoc.in@1.158 +2 -2
+ NTP_4_2_7P340
+
+ sntp/invoke-sntp.texi@1.327 +3 -3
+ NTP_4_2_7P340
+
+ sntp/sntp-opts.c@1.342 +4 -4
+ NTP_4_2_7P340
+
+ sntp/sntp-opts.h@1.342 +3 -3
+ NTP_4_2_7P340
+
+ sntp/sntp.1sntpman@1.162 +2 -2
+ NTP_4_2_7P340
+
+ sntp/sntp.1sntpmdoc@1.162 +2 -2
+ NTP_4_2_7P340
+
+ sntp/sntp.html@1.342 +3 -3
+ NTP_4_2_7P340
+
+ sntp/sntp.man.in@1.162 +2 -2
+ NTP_4_2_7P340
+
+ sntp/sntp.mdoc.in@1.162 +2 -2
+ NTP_4_2_7P340
+
+ util/invoke-ntp-keygen.texi@1.331 +2 -3
+ NTP_4_2_7P340
+
+ util/ntp-keygen-opts.c@1.345 +4 -4
+ NTP_4_2_7P340
+
+ util/ntp-keygen-opts.h@1.345 +3 -3
+ NTP_4_2_7P340
+
+ util/ntp-keygen.1ntp-keygenman@1.159 +2 -2
+ NTP_4_2_7P340
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.159 +2 -2
+ NTP_4_2_7P340
+
+ util/ntp-keygen.html@1.9 +214 -213
+ NTP_4_2_7P340
+
+ util/ntp-keygen.man.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ util/ntp-keygen.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P340
+
+ChangeSet@1.2863.2.1, 2012-12-29 06:47:23+00:00, stenn@psp-fb1.ntp.org
+ mdoc2texi: fix trailing punctuation handlers
+
+ ChangeLog@1.1220.2.1 +2 -1
+ mdoc2texi: fix trailing punctuation handlers
+
+ sntp/ag-tpl/mdoc2texi@1.6 +16 -5
+ mdoc2texi: fix trailing punctuation handlers
+
+ChangeSet@1.2863.1.1, 2012-12-28 11:41:12+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ ChangeLog@1.1220.1.1 +1 -0
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/include/autogen-version.def@1.13 +1 -1
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/Makefile.am@1.16 +9 -8
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/ag-char-map.h@1.19 +23 -6
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/alias.c@1.3 +0 -2
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/ao-strs.c@1.5 +201 -191
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/ao-strs.h@1.4 +210 -208
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/autoopts.c@1.14 +58 -370
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/autoopts.h@1.12 +38 -7
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/autoopts/options.h@1.18 +218 -307
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/autoopts/usage-txt.h@1.18 +531 -270
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/boolean.c@1.11 +0 -2
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/check.c@1.4 +0 -2
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/compat/compat.h@1.11 +0 -2
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/compat/pathfind.c@1.9 +18 -16
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/compat/snprintf.c@1.3 +2 -0
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/compat/strchr.c@1.3 +10 -4
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/compat/strdup.c@1.3 +3 -0
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/compat/windows-config.h@1.10 +0 -2
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/configfile.c@1.16 +349 -422
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/cook.c@1.11 +8 -9
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/enum.c@1.6 +11 -12
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/env.c@1.5 +12 -14
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/file.c@1.11 +1 -3
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/find.c@1.5 +248 -45
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/genshell.c@1.19 +63 -41
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/genshell.h@1.19 +7 -6
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/gettext.h@1.1 +288 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen-5.17/sntp/libopts/gettext.h
+
+ sntp/libopts/gettext.h@1.0 +0 -0
+
+ sntp/libopts/init.c@1.1 +292 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen-5.17/sntp/libopts/init.c
+
+ sntp/libopts/init.c@1.0 +0 -0
+
+ sntp/libopts/libopts.c@1.8 +5 -4
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/load.c@1.14 +21 -15
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/m4/libopts.m4@1.22 +1 -3
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/m4/liboptschk.m4@1.10 +0 -2
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/makeshell.c@1.13 +220 -177
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/nested.c@1.10 +334 -269
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/numeric.c@1.10 +1 -3
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/option-value-type.c@1.6 +115 -82
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/option-value-type.c@1.5 +0 -0
+ Rename: sntp/libopts/value-type.c -> sntp/libopts/option-value-type.c
+
+ sntp/libopts/option-value-type.h@1.20 +54 -21
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/option-value-type.h@1.19 +0 -0
+ Rename: sntp/libopts/value-type.h -> sntp/libopts/option-value-type.h
+
+ sntp/libopts/option-xat-attribute.c@1.6 +106 -72
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/option-xat-attribute.c@1.5 +0 -0
+ Rename: sntp/libopts/xat-attribute.c -> sntp/libopts/option-xat-attribute.c
+
+ sntp/libopts/option-xat-attribute.h@1.20 +51 -18
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/option-xat-attribute.h@1.19 +0 -0
+ Rename: sntp/libopts/xat-attribute.h -> sntp/libopts/option-xat-attribute.h
+
+ sntp/libopts/parse-duration.c@1.9 +6 -6
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/pgusage.c@1.11 +18 -19
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/proto.h@1.19 +24 -15
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/putshell.c@1.10 +0 -2
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/reset.c@1.12 +1 -3
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/restore.c@1.9 +7 -8
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/save.c@1.12 +1 -3
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/sort.c@1.10 +5 -6
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/stack.c@1.11 +1 -3
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/streqvcmp.c@1.10 +1 -3
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/text_mmap.c@1.11 +2 -4
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/time.c@1.11 +3 -5
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/tokenize.c@1.8 +2 -4
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/usage.c@1.12 +114 -109
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ sntp/libopts/version.c@1.12 +3 -5
+ Upgrade to autogen-5.17 and libopts-37.0.12
+
+ChangeSet@1.2857.1.2, 2012-12-27 20:14:04-05:00, murray@pogo.udel.edu
+ monopt.html:
+ Fix for bug-2801
+
+ html/monopt.html@1.35 +53 -9
+ Fix for bug-2801
+
+ChangeSet@1.2857.1.1, 2012-12-27 20:09:00-05:00, murray@pogo.udel.edu
+ ntp_util.c, ntpd.h, ChangeLog, ntp_proto.c:
+ Fix for bug 2081
+
+ ChangeLog@1.1214.1.1 +1 -0
+ Fix for bug 2081
+
+ include/ntpd.h@1.172 +1 -1
+ Fix for bug 2081
+
+ ntpd/ntp_proto.c@1.344 +6 -3
+ Fix for bug 2081
+
+ ntpd/ntp_util.c@1.98 +18 -5
+ Fix for bug 2081
+
+ChangeSet@1.2864, 2012-12-26 04:12:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P339
+ TAG: NTP_4_2_7P339
+
+ ChangeLog@1.1221 +1 -0
+ NTP_4_2_7P339
+
+ ntpd/invoke-ntp.conf.texi@1.13 +36 -39
+ NTP_4_2_7P339
+
+ ntpd/invoke-ntp.keys.texi@1.13 +2 -3
+ NTP_4_2_7P339
+
+ ntpd/invoke-ntpd.texi@1.329 +3 -4
+ NTP_4_2_7P339
+
+ ntpd/ntp.conf.5man@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntp.conf.5mdoc@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntp.conf.html@1.12 +114 -155
+ NTP_4_2_7P339
+
+ ntpd/ntp.conf.man.in@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntp.conf.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntp.keys.5man@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntp.keys.5mdoc@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntp.keys.html@1.13 +9 -9
+ NTP_4_2_7P339
+
+ ntpd/ntp.keys.man.in@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntp.keys.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntpd-opts.c@1.347 +4 -4
+ NTP_4_2_7P339
+
+ ntpd/ntpd-opts.h@1.347 +3 -3
+ NTP_4_2_7P339
+
+ ntpd/ntpd.1ntpdman@1.158 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntpd.1ntpdmdoc@1.158 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntpd.html@1.7 +123 -177
+ NTP_4_2_7P339
+
+ ntpd/ntpd.man.in@1.158 +2 -2
+ NTP_4_2_7P339
+
+ ntpd/ntpd.mdoc.in@1.158 +2 -2
+ NTP_4_2_7P339
+
+ ntpdc/invoke-ntpdc.texi@1.326 +7 -9
+ NTP_4_2_7P339
+
+ ntpdc/ntpdc-opts.c@1.341 +4 -4
+ NTP_4_2_7P339
+
+ ntpdc/ntpdc-opts.h@1.341 +3 -3
+ NTP_4_2_7P339
+
+ ntpdc/ntpdc.1ntpdcman@1.157 +2 -2
+ NTP_4_2_7P339
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.157 +2 -2
+ NTP_4_2_7P339
+
+ ntpdc/ntpdc.html@1.170 +77 -603
+ NTP_4_2_7P339
+
+ ntpdc/ntpdc.man.in@1.157 +2 -2
+ NTP_4_2_7P339
+
+ ntpdc/ntpdc.mdoc.in@1.157 +2 -2
+ NTP_4_2_7P339
+
+ ntpq/invoke-ntpq.texi@1.330 +6 -4
+ NTP_4_2_7P339
+
+ ntpq/ntpq-opts.c@1.344 +4 -4
+ NTP_4_2_7P339
+
+ ntpq/ntpq-opts.h@1.344 +3 -3
+ NTP_4_2_7P339
+
+ ntpq/ntpq.1ntpqman@1.158 +2 -260
+ NTP_4_2_7P339
+
+ ntpq/ntpq.1ntpqmdoc@1.158 +3 -246
+ NTP_4_2_7P339
+
+ ntpq/ntpq.html@1.4 +281 -304
+ NTP_4_2_7P339
+
+ ntpq/ntpq.man.in@1.158 +2 -260
+ NTP_4_2_7P339
+
+ ntpq/ntpq.mdoc.in@1.158 +3 -246
+ NTP_4_2_7P339
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.329 +3 -4
+ NTP_4_2_7P339
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.344 +4 -4
+ NTP_4_2_7P339
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.344 +3 -3
+ NTP_4_2_7P339
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.158 +2 -56
+ NTP_4_2_7P339
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.158 +3 -49
+ NTP_4_2_7P339
+
+ ntpsnmpd/ntpsnmpd.html@1.2 +10 -15
+ NTP_4_2_7P339
+
+ ntpsnmpd/ntpsnmpd.man.in@1.158 +2 -56
+ NTP_4_2_7P339
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.158 +3 -49
+ NTP_4_2_7P339
+
+ packageinfo.sh@1.342 +1 -1
+ NTP_4_2_7P339
+
+ scripts/invoke-ntp-wait.texi@1.146 +2 -1
+ NTP_4_2_7P339
+
+ scripts/ntp-wait.1ntp-waitman@1.157 +2 -2
+ NTP_4_2_7P339
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.157 +1 -1
+ NTP_4_2_7P339
+
+ scripts/ntp-wait.html@1.162 +39 -60
+ NTP_4_2_7P339
+
+ scripts/ntp-wait.man.in@1.157 +2 -2
+ NTP_4_2_7P339
+
+ scripts/ntp-wait.mdoc.in@1.157 +1 -1
+ NTP_4_2_7P339
+
+ sntp/invoke-sntp.texi@1.326 +4 -4
+ NTP_4_2_7P339
+
+ sntp/sntp-opts.c@1.341 +4 -4
+ NTP_4_2_7P339
+
+ sntp/sntp-opts.h@1.341 +3 -3
+ NTP_4_2_7P339
+
+ sntp/sntp.1sntpman@1.161 +2 -2
+ NTP_4_2_7P339
+
+ sntp/sntp.1sntpmdoc@1.161 +2 -2
+ NTP_4_2_7P339
+
+ sntp/sntp.html@1.341 +15 -14
+ NTP_4_2_7P339
+
+ sntp/sntp.man.in@1.161 +2 -2
+ NTP_4_2_7P339
+
+ sntp/sntp.mdoc.in@1.161 +2 -2
+ NTP_4_2_7P339
+
+ util/invoke-ntp-keygen.texi@1.330 +5 -5
+ NTP_4_2_7P339
+
+ util/ntp-keygen-opts.c@1.344 +4 -4
+ NTP_4_2_7P339
+
+ util/ntp-keygen-opts.h@1.344 +3 -3
+ NTP_4_2_7P339
+
+ util/ntp-keygen.1ntp-keygenman@1.158 +2 -2
+ NTP_4_2_7P339
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.158 +2 -2
+ NTP_4_2_7P339
+
+ util/ntp-keygen.html@1.8 +121 -181
+ NTP_4_2_7P339
+
+ util/ntp-keygen.man.in@1.158 +2 -2
+ NTP_4_2_7P339
+
+ util/ntp-keygen.mdoc.in@1.158 +2 -2
+ NTP_4_2_7P339
+
+ChangeSet@1.2860.1.1, 2012-12-25 11:36:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P338
+ TAG: NTP_4_2_7P338
+
+ ChangeLog@1.1217.1.1 +1 -0
+ NTP_4_2_7P338
+
+ ntpd/invoke-ntp.conf.texi@1.12 +118 -160
+ NTP_4_2_7P338
+
+ ntpd/invoke-ntp.keys.texi@1.12 +9 -9
+ NTP_4_2_7P338
+
+ ntpd/invoke-ntpd.texi@1.328 +4 -8
+ NTP_4_2_7P338
+
+ ntpd/ntp.conf.5man@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntp.conf.5mdoc@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntp.conf.html@1.11 +1 -1
+ NTP_4_2_7P338
+
+ ntpd/ntp.conf.man.in@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntp.conf.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntp.keys.5man@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntp.keys.5mdoc@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntp.keys.html@1.12 +1 -1
+ NTP_4_2_7P338
+
+ ntpd/ntp.keys.man.in@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntp.keys.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntpd-opts.c@1.346 +4 -4
+ NTP_4_2_7P338
+
+ ntpd/ntpd-opts.h@1.346 +3 -3
+ NTP_4_2_7P338
+
+ ntpd/ntpd.1ntpdman@1.157 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntpd.1ntpdmdoc@1.157 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntpd.html@1.4.1.1 +1 -1
+ NTP_4_2_7P338
+
+ ntpd/ntpd.man.in@1.157 +2 -2
+ NTP_4_2_7P338
+
+ ntpd/ntpd.mdoc.in@1.157 +2 -2
+ NTP_4_2_7P338
+
+ ntpdc/invoke-ntpdc.texi@1.325 +26 -31
+ NTP_4_2_7P338
+
+ ntpdc/ntpdc-opts.c@1.340 +4 -4
+ NTP_4_2_7P338
+
+ ntpdc/ntpdc-opts.h@1.340 +3 -3
+ NTP_4_2_7P338
+
+ ntpdc/ntpdc.1ntpdcman@1.156 +2 -2
+ NTP_4_2_7P338
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.156 +2 -2
+ NTP_4_2_7P338
+
+ ntpdc/ntpdc.html@1.167.1.1 +5 -5
+ NTP_4_2_7P338
+
+ ntpdc/ntpdc.man.in@1.156 +2 -2
+ NTP_4_2_7P338
+
+ ntpdc/ntpdc.mdoc.in@1.156 +2 -2
+ NTP_4_2_7P338
+
+ ntpq/invoke-ntpq.texi@1.327.1.1 +7 -7
+ NTP_4_2_7P338
+
+ ntpq/ntpq-opts.c@1.341.1.1 +4 -4
+ NTP_4_2_7P338
+
+ ntpq/ntpq-opts.h@1.341.1.1 +3 -3
+ NTP_4_2_7P338
+
+ ntpq/ntpq.1ntpqman@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpq/ntpq.1ntpqmdoc@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpq/ntpq.html@1.1.1.1 +717 -195
+ NTP_4_2_7P338
+
+ ntpq/ntpq.man.in@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpq/ntpq.mdoc.in@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.326.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.341.1.1 +4 -4
+ NTP_4_2_7P338
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.341.1.1 +3 -3
+ NTP_4_2_7P338
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpsnmpd/ntpsnmpd.man.in@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.155.1.1 +2 -2
+ NTP_4_2_7P338
+
+ packageinfo.sh@1.341 +1 -1
+ NTP_4_2_7P338
+
+ scripts/invoke-ntp-wait.texi@1.145 +3 -3
+ NTP_4_2_7P338
+
+ scripts/ntp-wait.1ntp-waitman@1.156 +2 -2
+ NTP_4_2_7P338
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.156 +2 -2
+ NTP_4_2_7P338
+
+ scripts/ntp-wait.html@1.159.1.1 +3 -3
+ NTP_4_2_7P338
+
+ scripts/ntp-wait.man.in@1.156 +2 -2
+ NTP_4_2_7P338
+
+ scripts/ntp-wait.mdoc.in@1.156 +2 -2
+ NTP_4_2_7P338
+
+ sntp/invoke-sntp.texi@1.325 +2 -2
+ NTP_4_2_7P338
+
+ sntp/sntp-opts.c@1.340 +4 -4
+ NTP_4_2_7P338
+
+ sntp/sntp-opts.h@1.340 +3 -3
+ NTP_4_2_7P338
+
+ sntp/sntp.1sntpman@1.160 +2 -2
+ NTP_4_2_7P338
+
+ sntp/sntp.1sntpmdoc@1.160 +2 -2
+ NTP_4_2_7P338
+
+ sntp/sntp.html@1.340 +2 -2
+ NTP_4_2_7P338
+
+ sntp/sntp.man.in@1.160 +2 -2
+ NTP_4_2_7P338
+
+ sntp/sntp.mdoc.in@1.160 +2 -2
+ NTP_4_2_7P338
+
+ util/invoke-ntp-keygen.texi@1.329 +2 -2
+ NTP_4_2_7P338
+
+ util/ntp-keygen-opts.c@1.343 +4 -4
+ NTP_4_2_7P338
+
+ util/ntp-keygen-opts.h@1.343 +3 -3
+ NTP_4_2_7P338
+
+ util/ntp-keygen.1ntp-keygenman@1.157 +3 -853
+ NTP_4_2_7P338
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.157 +4 -840
+ NTP_4_2_7P338
+
+ util/ntp-keygen.html@1.5.1.1 +210 -230
+ NTP_4_2_7P338
+
+ util/ntp-keygen.man.in@1.157 +3 -853
+ NTP_4_2_7P338
+
+ util/ntp-keygen.mdoc.in@1.157 +4 -840
+ NTP_4_2_7P338
+
+ChangeSet@1.2862, 2012-12-25 11:21:04+00:00, stenn@psp-fb1.ntp.org
+ mdoc2texi fixes: parseQuote, closing of list item tables
+
+ ChangeLog@1.1219 +1 -0
+ mdoc2texi fixes: parseQuote, closing of list item tables
+
+ sntp/ag-tpl/mdoc2texi@1.5 +17 -7
+ mdoc2texi fixes: parseQuote, closing of list item tables
+
+ChangeSet@1.2861, 2012-12-25 11:20:12+00:00, stenn@psp-fb1.ntp.org
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ .point-changed-filelist@1.20 +1 -0
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ChangeLog@1.1218 +1 -0
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpd/ntpd.html@1.5 +171 -121
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpd/ntpd.texi@1.2 +1 -1
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpdc/ntpdc.html@1.168 +598 -71
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpdc/ntpdc.texi@1.4 +1 -1
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/invoke-ntpq.texi@1.328 +9 -8
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq-opts.c@1.342 +1 -1
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq-opts.h@1.342 +1 -1
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq.1ntpqman@1.156 +260 -2
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq.1ntpqmdoc@1.156 +246 -3
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq.html@1.2 +662 -131
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq.man.in@1.156 +260 -2
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq.mdoc.in@1.156 +246 -3
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpq/ntpq.texi@1.3 +16 -21
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/Makefile.am@1.38 +12 -0
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.327 +61 -2
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.342 +1 -1
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.5 +47 -3
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.342 +1 -1
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.156 +60 -3
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.156 +53 -4
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd.html@1.1 +84 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpsnmpd/ntpsnmpd.html
+
+ ntpsnmpd/ntpsnmpd.html@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.man.in@1.156 +60 -3
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.156 +53 -4
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ ntpsnmpd/ntpsnmpd.texi@1.1 +53 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpsnmpd/ntpsnmpd.texi
+
+ ntpsnmpd/ntpsnmpd.texi@1.0 +0 -0
+
+ scripts/ntp-wait.html@1.160 +59 -37
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ scripts/ntp-wait.texi@1.4 +1 -1
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ util/ntp-keygen.html@1.6 +429 -383
+ ntp-wait, ntpd, ntpdc, ntpq, ntpsnmpd autogen documentation updates
+
+ChangeSet@1.2860, 2012-12-25 05:14:20+00:00, stenn@psp-fb1.ntp.org
+ mdoc2texi fixes: Handle_ArCmFlIc, Handle_Fn, HandleQ
+
+ ChangeLog@1.1217 +1 -0
+ mdoc2texi fixes: Handle_ArCmFlIc, Handle_Fn, HandleQ
+
+ sntp/ag-tpl/mdoc2texi@1.4 +71 -10
+ mdoc2texi fixes: Handle_ArCmFlIc, Handle_Fn, HandleQ.
+
+ChangeSet@1.2859, 2012-12-25 05:09:53+00:00, stenn@psp-fb1.ntp.org
+ ntp-keygen autogen documentation updates
+
+ ChangeLog@1.1216 +1 -0
+ ntp-keygen autogen documentation updates
+
+ ntpq/ntpq.html@1.1 +902 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpq/ntpq.html
+
+ ntpq/ntpq.html@1.0 +0 -0
+
+ util/invoke-ntp-keygen.texi@1.328 +82 -135
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen-opts.c@1.342 +1 -1
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen-opts.def@1.23 +31 -26
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen-opts.h@1.342 +1 -1
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen.1ntp-keygenman@1.156 +867 -16
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.156 +854 -17
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen.man.in@1.156 +867 -16
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen.mdoc.in@1.156 +854 -17
+ ntp-keygen autogen documentation updates
+
+ util/ntp-keygen.texi@1.2 +115 -82
+ ntp-keygen autogen documentation updates
+
+ChangeSet@1.2858, 2012-12-24 08:51:47+00:00, stenn@psp-fb1.ntp.org
+ ntpq autogen docs
+
+ .point-changed-filelist@1.19 +1 -0
+ ntpq autogen docs.
+
+ ChangeLog@1.1215 +1 -0
+ ntpq autogen docs.
+
+ ntpq/Makefile.am@1.69 +14 -0
+ ntpq autogen docs
+
+ ntpq/invoke-ntpq.texi@1.327 +1 -1
+ ntpq autogen docs
+
+ ntpq/ntpq.texi@1.2 +29 -18
+ ntpq autogen docs
+
+ ntpq/ntpq.texi@1.1 +851 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpq/ntpq.texi
+
+ ntpq/ntpq.texi@1.0 +0 -0
+
+ChangeSet@1.2857, 2012-12-22 11:54:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P337
+ TAG: NTP_4_2_7P337
+
+ ChangeLog@1.1214 +1 -0
+ NTP_4_2_7P337
+
+ ntpd/invoke-ntp.conf.texi@1.11 +1 -1
+ NTP_4_2_7P337
+
+ ntpd/invoke-ntp.keys.texi@1.11 +1 -1
+ NTP_4_2_7P337
+
+ ntpd/invoke-ntpd.texi@1.327 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.conf.5man@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.conf.5mdoc@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.conf.html@1.10 +1 -1
+ NTP_4_2_7P337
+
+ ntpd/ntp.conf.man.in@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.conf.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.keys.5man@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.keys.5mdoc@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.keys.html@1.11 +1 -1
+ NTP_4_2_7P337
+
+ ntpd/ntp.keys.man.in@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntp.keys.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntpd-opts.c@1.345 +4 -4
+ NTP_4_2_7P337
+
+ ntpd/ntpd-opts.h@1.345 +3 -3
+ NTP_4_2_7P337
+
+ ntpd/ntpd.1ntpdman@1.156 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntpd.1ntpdmdoc@1.156 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntpd.html@1.4 +1 -1
+ NTP_4_2_7P337
+
+ ntpd/ntpd.man.in@1.156 +2 -2
+ NTP_4_2_7P337
+
+ ntpd/ntpd.mdoc.in@1.156 +2 -2
+ NTP_4_2_7P337
+
+ ntpdc/invoke-ntpdc.texi@1.324 +2 -2
+ NTP_4_2_7P337
+
+ ntpdc/ntpdc-opts.c@1.339 +4 -4
+ NTP_4_2_7P337
+
+ ntpdc/ntpdc-opts.h@1.339 +3 -3
+ NTP_4_2_7P337
+
+ ntpdc/ntpdc.1ntpdcman@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpdc/ntpdc.html@1.167 +2 -2
+ NTP_4_2_7P337
+
+ ntpdc/ntpdc.man.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpdc/ntpdc.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpq/invoke-ntpq.texi@1.326 +2 -2
+ NTP_4_2_7P337
+
+ ntpq/ntpq-opts.c@1.341 +4 -4
+ NTP_4_2_7P337
+
+ ntpq/ntpq-opts.h@1.341 +3 -3
+ NTP_4_2_7P337
+
+ ntpq/ntpq.1ntpqman@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpq/ntpq.1ntpqmdoc@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpq/ntpq.man.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpq/ntpq.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.326 +2 -2
+ NTP_4_2_7P337
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.341 +4 -4
+ NTP_4_2_7P337
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.341 +3 -3
+ NTP_4_2_7P337
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpsnmpd/ntpsnmpd.man.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ packageinfo.sh@1.340 +1 -1
+ NTP_4_2_7P337
+
+ scripts/invoke-ntp-wait.texi@1.144 +1 -1
+ NTP_4_2_7P337
+
+ scripts/ntp-wait.1ntp-waitman@1.155 +2 -2
+ NTP_4_2_7P337
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.155 +2 -2
+ NTP_4_2_7P337
+
+ scripts/ntp-wait.html@1.159 +1 -1
+ NTP_4_2_7P337
+
+ scripts/ntp-wait.man.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ scripts/ntp-wait.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ sntp/invoke-sntp.texi@1.324 +2 -2
+ NTP_4_2_7P337
+
+ sntp/sntp-opts.c@1.339 +4 -4
+ NTP_4_2_7P337
+
+ sntp/sntp-opts.h@1.339 +3 -3
+ NTP_4_2_7P337
+
+ sntp/sntp.1sntpman@1.159 +2 -2
+ NTP_4_2_7P337
+
+ sntp/sntp.1sntpmdoc@1.159 +2 -2
+ NTP_4_2_7P337
+
+ sntp/sntp.html@1.339 +2 -2
+ NTP_4_2_7P337
+
+ sntp/sntp.man.in@1.159 +2 -2
+ NTP_4_2_7P337
+
+ sntp/sntp.mdoc.in@1.159 +2 -2
+ NTP_4_2_7P337
+
+ util/invoke-ntp-keygen.texi@1.327 +2 -2
+ NTP_4_2_7P337
+
+ util/ntp-keygen-opts.c@1.341 +4 -4
+ NTP_4_2_7P337
+
+ util/ntp-keygen-opts.h@1.341 +3 -3
+ NTP_4_2_7P337
+
+ util/ntp-keygen.1ntp-keygenman@1.155 +2 -2
+ NTP_4_2_7P337
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.155 +2 -2
+ NTP_4_2_7P337
+
+ util/ntp-keygen.html@1.5 +2 -2
+ NTP_4_2_7P337
+
+ util/ntp-keygen.man.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ util/ntp-keygen.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P337
+
+ChangeSet@1.2856, 2012-12-22 06:35:37-05:00, stenn@deacon.udel.edu
+ [Bug 1223] More final cleanup for rlimit changes
+
+ ChangeLog@1.1213 +1 -0
+ [Bug 1223] More final cleanup for rlimit changes
+
+ ntpd/ntp_config.c@1.309 +2 -2
+ [Bug 1223] More final cleanup for rlimit changes
+
+ChangeSet@1.2855, 2012-12-21 23:25:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P336
+ TAG: NTP_4_2_7P336
+
+ ChangeLog@1.1212 +1 -0
+ NTP_4_2_7P336
+
+ ntpd/invoke-ntp.conf.texi@1.10 +1 -1
+ NTP_4_2_7P336
+
+ ntpd/invoke-ntp.keys.texi@1.10 +1 -1
+ NTP_4_2_7P336
+
+ ntpd/invoke-ntpd.texi@1.326 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.conf.5man@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.conf.5mdoc@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.conf.html@1.9 +552 -1862
+ NTP_4_2_7P336
+
+ ntpd/ntp.conf.man.in@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.conf.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.keys.5man@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.keys.5mdoc@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.keys.html@1.10 +13 -149
+ NTP_4_2_7P336
+
+ ntpd/ntp.keys.man.in@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntp.keys.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntpd-opts.c@1.344 +4 -4
+ NTP_4_2_7P336
+
+ ntpd/ntpd-opts.h@1.344 +3 -3
+ NTP_4_2_7P336
+
+ ntpd/ntpd.1ntpdman@1.155 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntpd.1ntpdmdoc@1.155 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntpd.html@1.3 +116 -126
+ NTP_4_2_7P336
+
+ ntpd/ntpd.man.in@1.155 +2 -2
+ NTP_4_2_7P336
+
+ ntpd/ntpd.mdoc.in@1.155 +2 -2
+ NTP_4_2_7P336
+
+ ntpdc/invoke-ntpdc.texi@1.323 +2 -2
+ NTP_4_2_7P336
+
+ ntpdc/ntpdc-opts.c@1.338 +4 -4
+ NTP_4_2_7P336
+
+ ntpdc/ntpdc-opts.h@1.338 +3 -3
+ NTP_4_2_7P336
+
+ ntpdc/ntpdc.1ntpdcman@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpdc/ntpdc.html@1.166 +2 -2
+ NTP_4_2_7P336
+
+ ntpdc/ntpdc.man.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpdc/ntpdc.mdoc.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpq/invoke-ntpq.texi@1.325 +2 -2
+ NTP_4_2_7P336
+
+ ntpq/ntpq-opts.c@1.340 +4 -4
+ NTP_4_2_7P336
+
+ ntpq/ntpq-opts.h@1.340 +3 -3
+ NTP_4_2_7P336
+
+ ntpq/ntpq.1ntpqman@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpq/ntpq.1ntpqmdoc@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpq/ntpq.man.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpq/ntpq.mdoc.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.325 +2 -2
+ NTP_4_2_7P336
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.340 +4 -4
+ NTP_4_2_7P336
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.340 +3 -3
+ NTP_4_2_7P336
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpsnmpd/ntpsnmpd.man.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ packageinfo.sh@1.339 +1 -1
+ NTP_4_2_7P336
+
+ scripts/invoke-ntp-wait.texi@1.143 +1 -1
+ NTP_4_2_7P336
+
+ scripts/ntp-wait.1ntp-waitman@1.154 +2 -2
+ NTP_4_2_7P336
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.154 +2 -2
+ NTP_4_2_7P336
+
+ scripts/ntp-wait.html@1.158 +1 -1
+ NTP_4_2_7P336
+
+ scripts/ntp-wait.man.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ scripts/ntp-wait.mdoc.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ sntp/invoke-sntp.texi@1.323 +2 -2
+ NTP_4_2_7P336
+
+ sntp/sntp-opts.c@1.338 +4 -4
+ NTP_4_2_7P336
+
+ sntp/sntp-opts.h@1.338 +3 -3
+ NTP_4_2_7P336
+
+ sntp/sntp.1sntpman@1.158 +2 -2
+ NTP_4_2_7P336
+
+ sntp/sntp.1sntpmdoc@1.158 +2 -2
+ NTP_4_2_7P336
+
+ sntp/sntp.html@1.338 +2 -2
+ NTP_4_2_7P336
+
+ sntp/sntp.man.in@1.158 +2 -2
+ NTP_4_2_7P336
+
+ sntp/sntp.mdoc.in@1.158 +2 -2
+ NTP_4_2_7P336
+
+ util/invoke-ntp-keygen.texi@1.326 +2 -2
+ NTP_4_2_7P336
+
+ util/ntp-keygen-opts.c@1.340 +4 -4
+ NTP_4_2_7P336
+
+ util/ntp-keygen-opts.h@1.340 +3 -3
+ NTP_4_2_7P336
+
+ util/ntp-keygen.1ntp-keygenman@1.154 +2 -2
+ NTP_4_2_7P336
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.154 +2 -2
+ NTP_4_2_7P336
+
+ util/ntp-keygen.html@1.4 +181 -293
+ NTP_4_2_7P336
+
+ util/ntp-keygen.man.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ util/ntp-keygen.mdoc.in@1.154 +2 -2
+ NTP_4_2_7P336
+
+ChangeSet@1.2854, 2012-12-21 05:41:54-05:00, stenn@deacon.udel.edu
+ [Bug 1223] Final cleanup for rlimit changes
+
+ ChangeLog@1.1211 +1 -0
+ [Bug 1223] Final cleanup for rlimit changes
+
+ ntpd/ntpd.c@1.140 +3 -2
+ [Bug 1223] Final cleanup for rlimit changes
+
+ChangeSet@1.2853, 2012-12-18 09:00:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P335
+ TAG: NTP_4_2_7P335
+
+ ChangeLog@1.1210 +1 -0
+ NTP_4_2_7P335
+
+ ntpd/invoke-ntp.conf.texi@1.9 +410 -1484
+ NTP_4_2_7P335
+
+ ntpd/invoke-ntp.keys.texi@1.9 +13 -118
+ NTP_4_2_7P335
+
+ ntpd/invoke-ntpd.texi@1.325 +87 -127
+ NTP_4_2_7P335
+
+ ntpd/ntp.conf.5man@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntp.conf.5mdoc@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntp.conf.html@1.8 +5 -4
+ NTP_4_2_7P335
+
+ ntpd/ntp.conf.man.in@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntp.conf.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntp.keys.5man@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntp.keys.5mdoc@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntp.keys.html@1.9 +5 -4
+ NTP_4_2_7P335
+
+ ntpd/ntp.keys.man.in@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntp.keys.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P335
+
+ ntpd/ntpd-opts.c@1.343 +4 -4
+ NTP_4_2_7P335
+
+ ntpd/ntpd-opts.h@1.343 +3 -3
+ NTP_4_2_7P335
+
+ ntpd/ntpd.1ntpdman@1.154 +43 -47
+ NTP_4_2_7P335
+
+ ntpd/ntpd.1ntpdmdoc@1.154 +43 -47
+ NTP_4_2_7P335
+
+ ntpd/ntpd.html@1.2 +97 -139
+ NTP_4_2_7P335
+
+ ntpd/ntpd.man.in@1.154 +43 -47
+ NTP_4_2_7P335
+
+ ntpd/ntpd.mdoc.in@1.154 +43 -47
+ NTP_4_2_7P335
+
+ ntpdc/invoke-ntpdc.texi@1.322 +89 -299
+ NTP_4_2_7P335
+
+ ntpdc/ntpdc-opts.c@1.337 +4 -4
+ NTP_4_2_7P335
+
+ ntpdc/ntpdc-opts.h@1.337 +3 -3
+ NTP_4_2_7P335
+
+ ntpdc/ntpdc.1ntpdcman@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpdc/ntpdc.html@1.165 +26 -725
+ NTP_4_2_7P335
+
+ ntpdc/ntpdc.man.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpdc/ntpdc.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpq/invoke-ntpq.texi@1.324 +27 -83
+ NTP_4_2_7P335
+
+ ntpq/ntpq-opts.c@1.339 +4 -4
+ NTP_4_2_7P335
+
+ ntpq/ntpq-opts.h@1.339 +3 -3
+ NTP_4_2_7P335
+
+ ntpq/ntpq.1ntpqman@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpq/ntpq.1ntpqmdoc@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpq/ntpq.man.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpq/ntpq.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.324 +2 -5
+ NTP_4_2_7P335
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.339 +4 -4
+ NTP_4_2_7P335
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.339 +3 -3
+ NTP_4_2_7P335
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpsnmpd/ntpsnmpd.man.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ packageinfo.sh@1.338 +1 -1
+ NTP_4_2_7P335
+
+ scripts/invoke-ntp-wait.texi@1.142 +3 -10
+ NTP_4_2_7P335
+
+ scripts/ntp-wait.1ntp-waitman@1.153 +2 -2
+ NTP_4_2_7P335
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.153 +2 -2
+ NTP_4_2_7P335
+
+ scripts/ntp-wait.html@1.157 +16 -52
+ NTP_4_2_7P335
+
+ scripts/ntp-wait.man.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ scripts/ntp-wait.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ sntp/invoke-sntp.texi@1.322 +14 -57
+ NTP_4_2_7P335
+
+ sntp/sntp-opts.c@1.337 +4 -4
+ NTP_4_2_7P335
+
+ sntp/sntp-opts.h@1.337 +3 -3
+ NTP_4_2_7P335
+
+ sntp/sntp.1sntpman@1.157 +2 -2
+ NTP_4_2_7P335
+
+ sntp/sntp.1sntpmdoc@1.157 +2 -2
+ NTP_4_2_7P335
+
+ sntp/sntp.html@1.337 +15 -58
+ NTP_4_2_7P335
+
+ sntp/sntp.man.in@1.157 +2 -2
+ NTP_4_2_7P335
+
+ sntp/sntp.mdoc.in@1.157 +2 -2
+ NTP_4_2_7P335
+
+ util/invoke-ntp-keygen.texi@1.325 +107 -254
+ NTP_4_2_7P335
+
+ util/ntp-keygen-opts.c@1.339 +4 -4
+ NTP_4_2_7P335
+
+ util/ntp-keygen-opts.h@1.339 +3 -3
+ NTP_4_2_7P335
+
+ util/ntp-keygen.1ntp-keygenman@1.153 +2 -2
+ NTP_4_2_7P335
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.153 +2 -2
+ NTP_4_2_7P335
+
+ util/ntp-keygen.html@1.3 +152 -2
+ NTP_4_2_7P335
+
+ util/ntp-keygen.man.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ util/ntp-keygen.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P335
+
+ChangeSet@1.2852, 2012-12-17 05:34:02-05:00, stenn@deacon.udel.edu
+ nothing
+
+ ChangeLog@1.1209 +0 -0
+ nothing
+
+ChangeSet@1.2851, 2012-12-17 09:43:26+00:00, stenn@psp-fb1.ntp.org
+ Update documentation templates and definitions
+
+ sntp/ag-tpl/agtexi-file.tpl@1.3 +5 -2
+ Update documentation templates and definitions
+
+ChangeSet@1.2850, 2012-12-16 10:32:46+00:00, stenn@psp-fb1.ntp.org
+ Update documentation templates and definitions
+
+ sntp/ag-tpl/mdoc2texi@1.3 +22 -5
+ Update documentation templates and definitions
+
+ChangeSet@1.2849, 2012-12-16 09:50:14+00:00, stenn@psp-fb1.ntp.org
+ Update documentation templates and definitions
+
+ sntp/ag-tpl/mdoc2texi@1.2 +121 -10
+ Update documentation templates and definitions
+
+ChangeSet@1.2848, 2012-12-16 05:08:04+00:00, stenn@psp-fb1.ntp.org
+ Update documentation templates and definitions
+
+ ntpd/ntpd.html@1.1 +1655 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/ntpd.html
+
+ ntpd/ntpd.html@1.0 +0 -0
+
+ ntpd/ntpdbase-opts.def@1.25 +45 -45
+ Update documentation templates and definitions
+
+ sntp/ag-tpl/mdoc2texi@1.1 +529 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/sntp/ag-tpl/mdoc2texi
+
+ sntp/ag-tpl/mdoc2texi@1.0 +0 -0
+
+ChangeSet@1.2847, 2012-12-12 09:52:10+00:00, stenn@psp-fb1.ntp.org
+ Update documentation templates and definitions
+
+ .point-changed-filelist@1.18 +1 -0
+ Update documentation templates and definitions
+
+ ntpd/Makefile.am@1.127 +6 -0
+ Update documentation templates and definitions
+
+ ntpd/ntpd.texi@1.1 +113 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/ntpd.texi
+
+ ntpd/ntpd.texi@1.0 +0 -0
+
+ChangeSet@1.2846, 2012-12-12 08:13:15+00:00, stenn@psp-fb1.ntp.org
+ Update documentation templates and definitions
+
+ ChangeLog@1.1208 +1 -0
+ Update documentation templates and definitions
+
+ ntpd/invoke-ntp.conf.menu@1.2 +1 -1
+ Update documentation templates and definitions
+
+ ntpd/invoke-ntp.keys.menu@1.2 +1 -1
+ Update documentation templates and definitions
+
+ ntpd/ntp.conf.texi@1.4 +3 -3
+ Update documentation templates and definitions
+
+ ntpd/ntp.keys.texi@1.4 +3 -3
+ Update documentation templates and definitions
+
+ scripts/ntp-wait.texi@1.3 +15 -45
+ Update documentation templates and definitions
+
+ sntp/ag-tpl/agtexi-file.tpl@1.2 +0 -559
+ Update documentation templates and definitions
+
+ChangeSet@1.2845, 2012-12-11 05:37:07-05:00, stenn@psp-deb1.ntp.org
+ Create agtexi-file.tpl
+
+ ChangeLog@1.1207 +1 -0
+ Create agtexi-file.tpl
+
+ ntpd/Makefile.am@1.126 +2 -2
+ Create agtexi-file.tpl
+
+ sntp/ag-tpl/agtexi-file.tpl@1.1 +884 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/sntp/ag-tpl/agtexi-file.tpl
+
+ sntp/ag-tpl/agtexi-file.tpl@1.0 +0 -0
+
+ChangeSet@1.2844, 2012-12-10 11:42:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P334
+ TAG: NTP_4_2_7P334
+
+ ChangeLog@1.1206 +1 -0
+ NTP_4_2_7P334
+
+ ntpd/invoke-ntp.conf.texi@1.8 +1 -1
+ NTP_4_2_7P334
+
+ ntpd/invoke-ntp.keys.texi@1.8 +1 -1
+ NTP_4_2_7P334
+
+ ntpd/invoke-ntpd.texi@1.324 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.conf.5man@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.conf.5mdoc@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.conf.html@1.7 +1 -1
+ NTP_4_2_7P334
+
+ ntpd/ntp.conf.man.in@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.conf.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.keys.5man@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.keys.5mdoc@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.keys.html@1.8 +1 -1
+ NTP_4_2_7P334
+
+ ntpd/ntp.keys.man.in@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntp.keys.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntpd-opts.c@1.342 +4 -4
+ NTP_4_2_7P334
+
+ ntpd/ntpd-opts.h@1.342 +3 -3
+ NTP_4_2_7P334
+
+ ntpd/ntpd.1ntpdman@1.153 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntpd.1ntpdmdoc@1.153 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntpd.man.in@1.153 +2 -2
+ NTP_4_2_7P334
+
+ ntpd/ntpd.mdoc.in@1.153 +2 -2
+ NTP_4_2_7P334
+
+ ntpdc/invoke-ntpdc.texi@1.321 +2 -2
+ NTP_4_2_7P334
+
+ ntpdc/ntpdc-opts.c@1.336 +4 -4
+ NTP_4_2_7P334
+
+ ntpdc/ntpdc-opts.h@1.336 +3 -3
+ NTP_4_2_7P334
+
+ ntpdc/ntpdc.1ntpdcman@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpdc/ntpdc.html@1.164 +2 -2
+ NTP_4_2_7P334
+
+ ntpdc/ntpdc.man.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpdc/ntpdc.mdoc.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpq/invoke-ntpq.texi@1.323 +2 -2
+ NTP_4_2_7P334
+
+ ntpq/ntpq-opts.c@1.338 +4 -4
+ NTP_4_2_7P334
+
+ ntpq/ntpq-opts.h@1.338 +3 -3
+ NTP_4_2_7P334
+
+ ntpq/ntpq.1ntpqman@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpq/ntpq.1ntpqmdoc@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpq/ntpq.man.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpq/ntpq.mdoc.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.323 +2 -2
+ NTP_4_2_7P334
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.338 +4 -4
+ NTP_4_2_7P334
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.338 +3 -3
+ NTP_4_2_7P334
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpsnmpd/ntpsnmpd.man.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ packageinfo.sh@1.337 +1 -1
+ NTP_4_2_7P334
+
+ scripts/invoke-ntp-wait.texi@1.141 +1 -1
+ NTP_4_2_7P334
+
+ scripts/ntp-wait.1ntp-waitman@1.152 +2 -2
+ NTP_4_2_7P334
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.152 +2 -2
+ NTP_4_2_7P334
+
+ scripts/ntp-wait.html@1.156 +1 -1
+ NTP_4_2_7P334
+
+ scripts/ntp-wait.man.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ scripts/ntp-wait.mdoc.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ sntp/invoke-sntp.texi@1.321 +2 -2
+ NTP_4_2_7P334
+
+ sntp/sntp-opts.c@1.336 +4 -4
+ NTP_4_2_7P334
+
+ sntp/sntp-opts.h@1.336 +3 -3
+ NTP_4_2_7P334
+
+ sntp/sntp.1sntpman@1.156 +2 -2
+ NTP_4_2_7P334
+
+ sntp/sntp.1sntpmdoc@1.156 +2 -2
+ NTP_4_2_7P334
+
+ sntp/sntp.html@1.336 +2 -2
+ NTP_4_2_7P334
+
+ sntp/sntp.man.in@1.156 +2 -2
+ NTP_4_2_7P334
+
+ sntp/sntp.mdoc.in@1.156 +2 -2
+ NTP_4_2_7P334
+
+ util/invoke-ntp-keygen.texi@1.324 +154 -2
+ NTP_4_2_7P334
+
+ util/ntp-keygen-opts.c@1.338 +4 -4
+ NTP_4_2_7P334
+
+ util/ntp-keygen-opts.h@1.338 +3 -3
+ NTP_4_2_7P334
+
+ util/ntp-keygen.1ntp-keygenman@1.152 +2 -2
+ NTP_4_2_7P334
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.152 +2 -2
+ NTP_4_2_7P334
+
+ util/ntp-keygen.html@1.2 +115 -174
+ NTP_4_2_7P334
+
+ util/ntp-keygen.man.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ util/ntp-keygen.mdoc.in@1.152 +2 -2
+ NTP_4_2_7P334
+
+ChangeSet@1.2843, 2012-12-10 04:25:24-05:00, stenn@psp-deb1.ntp.org
+ [Bug 2114] Update tests for sntp's synch distance
+
+ ChangeLog@1.1205 +1 -0
+ [Bug 2114] Update tests for sntp's synch distance
+
+ sntp/tests/packetHandling.cpp@1.10 +3 -2
+ [Bug 2114] Update tests for sntp's synch distance
+
+ChangeSet@1.2842, 2012-12-10 04:23:36-05:00, stenn@psp-deb1.ntp.org
+ Create ntp-keygen.{html,texi}
+
+ .point-changed-filelist@1.17 +1 -0
+ Create ntp-keygen.{html,texi}
+
+ ChangeLog@1.1204 +1 -0
+ Create ntp-keygen.{html,texi}
+
+ util/Makefile.am@1.74 +11 -0
+ Create ntp-keygen.{html,texi}
+
+ util/ntp-keygen-opts.def@1.22 +130 -0
+ Create ntp-keygen.{html,texi}
+
+ util/ntp-keygen.html@1.1 +1874 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/util/ntp-keygen.html
+
+ util/ntp-keygen.html@1.0 +0 -0
+
+ util/ntp-keygen.texi@1.1 +274 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/util/ntp-keygen.texi
+
+ util/ntp-keygen.texi@1.0 +0 -0
+
+ChangeSet@1.2841, 2012-12-07 11:33:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P333
+ TAG: NTP_4_2_7P333
+
+ ChangeLog@1.1203 +1 -0
+ NTP_4_2_7P333
+
+ ntpd/invoke-ntp.conf.texi@1.7 +1 -1
+ NTP_4_2_7P333
+
+ ntpd/invoke-ntp.keys.texi@1.7 +1 -1
+ NTP_4_2_7P333
+
+ ntpd/invoke-ntpd.texi@1.323 +2 -2
+ NTP_4_2_7P333
+
+ ntpd/ntp.conf.5man@1.41 +3 -2877
+ NTP_4_2_7P333
+
+ ntpd/ntp.conf.5mdoc@1.41 +3 -2709
+ NTP_4_2_7P333
+
+ ntpd/ntp.conf.html@1.6 +168 -187
+ NTP_4_2_7P333
+
+ ntpd/ntp.conf.man.in@1.41 +3 -2877
+ NTP_4_2_7P333
+
+ ntpd/ntp.conf.mdoc.in@1.41 +3 -2709
+ NTP_4_2_7P333
+
+ ntpd/ntp.keys.5man@1.41 +2 -95
+ NTP_4_2_7P333
+
+ ntpd/ntp.keys.5mdoc@1.41 +2 -94
+ NTP_4_2_7P333
+
+ ntpd/ntp.keys.html@1.7 +36 -53
+ NTP_4_2_7P333
+
+ ntpd/ntp.keys.man.in@1.41 +2 -95
+ NTP_4_2_7P333
+
+ ntpd/ntp.keys.mdoc.in@1.41 +2 -94
+ NTP_4_2_7P333
+
+ ntpd/ntpd-opts.c@1.341 +4 -4
+ NTP_4_2_7P333
+
+ ntpd/ntpd-opts.h@1.341 +3 -3
+ NTP_4_2_7P333
+
+ ntpd/ntpd.1ntpdman@1.152 +3 -549
+ NTP_4_2_7P333
+
+ ntpd/ntpd.1ntpdmdoc@1.152 +3 -548
+ NTP_4_2_7P333
+
+ ntpd/ntpd.man.in@1.152 +3 -549
+ NTP_4_2_7P333
+
+ ntpd/ntpd.mdoc.in@1.152 +3 -548
+ NTP_4_2_7P333
+
+ ntpdc/invoke-ntpdc.texi@1.320 +2 -2
+ NTP_4_2_7P333
+
+ ntpdc/ntpdc-opts.c@1.335 +4 -4
+ NTP_4_2_7P333
+
+ ntpdc/ntpdc-opts.h@1.335 +3 -3
+ NTP_4_2_7P333
+
+ ntpdc/ntpdc.1ntpdcman@1.151 +3 -704
+ NTP_4_2_7P333
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.151 +3 -659
+ NTP_4_2_7P333
+
+ ntpdc/ntpdc.html@1.163 +98 -118
+ NTP_4_2_7P333
+
+ ntpdc/ntpdc.man.in@1.151 +3 -704
+ NTP_4_2_7P333
+
+ ntpdc/ntpdc.mdoc.in@1.151 +3 -659
+ NTP_4_2_7P333
+
+ ntpq/invoke-ntpq.texi@1.322 +2 -2
+ NTP_4_2_7P333
+
+ ntpq/ntpq-opts.c@1.337 +4 -4
+ NTP_4_2_7P333
+
+ ntpq/ntpq-opts.h@1.337 +3 -3
+ NTP_4_2_7P333
+
+ ntpq/ntpq.1ntpqman@1.151 +2 -260
+ NTP_4_2_7P333
+
+ ntpq/ntpq.1ntpqmdoc@1.151 +2 -245
+ NTP_4_2_7P333
+
+ ntpq/ntpq.man.in@1.151 +2 -260
+ NTP_4_2_7P333
+
+ ntpq/ntpq.mdoc.in@1.151 +2 -245
+ NTP_4_2_7P333
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.322 +2 -2
+ NTP_4_2_7P333
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.337 +4 -4
+ NTP_4_2_7P333
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.337 +3 -3
+ NTP_4_2_7P333
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.151 +2 -4
+ NTP_4_2_7P333
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.151 +2 -4
+ NTP_4_2_7P333
+
+ ntpsnmpd/ntpsnmpd.man.in@1.151 +2 -4
+ NTP_4_2_7P333
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.151 +2 -4
+ NTP_4_2_7P333
+
+ packageinfo.sh@1.336 +1 -1
+ NTP_4_2_7P333
+
+ scripts/invoke-ntp-wait.texi@1.140 +3 -3
+ NTP_4_2_7P333
+
+ scripts/ntp-wait.1ntp-waitman@1.151 +2 -19
+ NTP_4_2_7P333
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.151 +2 -19
+ NTP_4_2_7P333
+
+ scripts/ntp-wait.html@1.155 +42 -65
+ NTP_4_2_7P333
+
+ scripts/ntp-wait.man.in@1.151 +2 -19
+ NTP_4_2_7P333
+
+ scripts/ntp-wait.mdoc.in@1.151 +2 -19
+ NTP_4_2_7P333
+
+ sntp/invoke-sntp.texi@1.320 +2 -2
+ NTP_4_2_7P333
+
+ sntp/sntp-opts.c@1.335 +4 -4
+ NTP_4_2_7P333
+
+ sntp/sntp-opts.h@1.335 +3 -3
+ NTP_4_2_7P333
+
+ sntp/sntp.1sntpman@1.155 +2 -66
+ NTP_4_2_7P333
+
+ sntp/sntp.1sntpmdoc@1.155 +2 -66
+ NTP_4_2_7P333
+
+ sntp/sntp.html@1.335 +91 -116
+ NTP_4_2_7P333
+
+ sntp/sntp.man.in@1.155 +2 -66
+ NTP_4_2_7P333
+
+ sntp/sntp.mdoc.in@1.155 +2 -66
+ NTP_4_2_7P333
+
+ util/invoke-ntp-keygen.texi@1.323 +2 -2
+ NTP_4_2_7P333
+
+ util/ntp-keygen-opts.c@1.337 +4 -4
+ NTP_4_2_7P333
+
+ util/ntp-keygen-opts.h@1.337 +3 -3
+ NTP_4_2_7P333
+
+ util/ntp-keygen.1ntp-keygenman@1.151 +3 -721
+ NTP_4_2_7P333
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.151 +3 -707
+ NTP_4_2_7P333
+
+ util/ntp-keygen.man.in@1.151 +3 -721
+ NTP_4_2_7P333
+
+ util/ntp-keygen.mdoc.in@1.151 +3 -707
+ NTP_4_2_7P333
+
+ChangeSet@1.2840, 2012-12-07 09:56:25+00:00, stenn@psp-fb1.ntp.org
+ Autogen documentation cleanup
+
+ ChangeLog@1.1202 +1 -0
+ Autogen documentation cleanup
+
+ ntpd/invoke-ntp.conf.texi@1.6 +3 -2
+ Autogen documentation cleanup
+
+ ntpd/invoke-ntp.keys.texi@1.6 +3 -2
+ Autogen documentation cleanup
+
+ ntpd/invoke-ntpd.texi@1.322 +2 -1
+ Autogen documentation cleanup
+
+ ntpd/ntp.conf.5man@1.40 +2877 -3
+ Autogen documentation cleanup
+
+ ntpd/ntp.conf.5mdoc@1.40 +2710 -4
+ Autogen documentation cleanup
+
+ ntpd/ntp.conf.def@1.4 +2 -1
+ Autogen documentation cleanup
+
+ ntpd/ntp.conf.html@1.5 +185 -165
+ Autogen documentation cleanup
+
+ ntpd/ntp.conf.man.in@1.40 +2877 -3
+ Autogen documentation cleanup
+
+ ntpd/ntp.conf.mdoc.in@1.40 +2710 -4
+ Autogen documentation cleanup
+
+ ntpd/ntp.keys.5man@1.40 +95 -2
+ Autogen documentation cleanup
+
+ ntpd/ntp.keys.5mdoc@1.40 +95 -3
+ Autogen documentation cleanup
+
+ ntpd/ntp.keys.def@1.8 +2 -1
+ Autogen documentation cleanup
+
+ ntpd/ntp.keys.html@1.6 +51 -33
+ Autogen documentation cleanup
+
+ ntpd/ntp.keys.man.in@1.40 +95 -2
+ Autogen documentation cleanup
+
+ ntpd/ntp.keys.mdoc.in@1.40 +95 -3
+ Autogen documentation cleanup
+
+ ntpd/ntpd-opts.c@1.340 +1 -1
+ Autogen documentation cleanup
+
+ ntpd/ntpd-opts.def@1.8 +1 -0
+ Autogen documentation cleanup
+
+ ntpd/ntpd-opts.h@1.340 +1 -1
+ Autogen documentation cleanup
+
+ ntpd/ntpd.1ntpdman@1.151 +549 -3
+ Autogen documentation cleanup
+
+ ntpd/ntpd.1ntpdmdoc@1.151 +549 -4
+ Autogen documentation cleanup
+
+ ntpd/ntpd.man.in@1.151 +549 -3
+ Autogen documentation cleanup
+
+ ntpd/ntpd.mdoc.in@1.151 +549 -4
+ Autogen documentation cleanup
+
+ ntpdc/invoke-ntpdc.texi@1.319 +1 -1
+ Autogen documentation cleanup
+
+ ntpdc/ntpdc-opts.c@1.334 +1 -1
+ Autogen documentation cleanup
+
+ ntpdc/ntpdc-opts.h@1.334 +1 -1
+ Autogen documentation cleanup
+
+ ntpdc/ntpdc.1ntpdcman@1.150 +704 -3
+ Autogen documentation cleanup
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.150 +660 -4
+ Autogen documentation cleanup
+
+ ntpdc/ntpdc.html@1.162 +116 -96
+ Autogen documentation cleanup
+
+ ntpdc/ntpdc.man.in@1.150 +704 -3
+ Autogen documentation cleanup
+
+ ntpdc/ntpdc.mdoc.in@1.150 +660 -4
+ Autogen documentation cleanup
+
+ ntpq/invoke-ntpq.texi@1.321 +1 -1
+ Autogen documentation cleanup
+
+ ntpq/ntpq-opts.c@1.336 +1 -1
+ Autogen documentation cleanup
+
+ ntpq/ntpq-opts.h@1.336 +1 -1
+ Autogen documentation cleanup
+
+ ntpq/ntpq.1ntpqman@1.150 +260 -2
+ Autogen documentation cleanup
+
+ ntpq/ntpq.1ntpqmdoc@1.150 +246 -3
+ Autogen documentation cleanup
+
+ ntpq/ntpq.man.in@1.150 +260 -2
+ Autogen documentation cleanup
+
+ ntpq/ntpq.mdoc.in@1.150 +246 -3
+ Autogen documentation cleanup
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.321 +5 -1
+ Autogen documentation cleanup
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.336 +1 -1
+ Autogen documentation cleanup
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.4 +1 -2
+ Autogen documentation cleanup
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.336 +1 -1
+ Autogen documentation cleanup
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.150 +6 -3
+ Autogen documentation cleanup
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.150 +7 -4
+ Autogen documentation cleanup
+
+ ntpsnmpd/ntpsnmpd.man.in@1.150 +6 -3
+ Autogen documentation cleanup
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.150 +7 -4
+ Autogen documentation cleanup
+
+ scripts/invoke-ntp-wait.texi@1.139 +7 -3
+ Autogen documentation cleanup
+
+ scripts/ntp-wait-opts.def@1.5 +9 -1
+ Autogen documentation cleanup
+
+ scripts/ntp-wait.1ntp-waitman@1.150 +21 -3
+ Autogen documentation cleanup
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.150 +22 -4
+ Autogen documentation cleanup
+
+ scripts/ntp-wait.html@1.154 +74 -39
+ Autogen documentation cleanup
+
+ scripts/ntp-wait.man.in@1.150 +21 -3
+ Autogen documentation cleanup
+
+ scripts/ntp-wait.mdoc.in@1.150 +22 -4
+ Autogen documentation cleanup
+
+ sntp/invoke-sntp.texi@1.319 +1 -1
+ Autogen documentation cleanup
+
+ sntp/sntp-opts.c@1.334 +1 -1
+ Autogen documentation cleanup
+
+ sntp/sntp-opts.h@1.334 +1 -1
+ Autogen documentation cleanup
+
+ sntp/sntp.1sntpman@1.154 +66 -2
+ Autogen documentation cleanup
+
+ sntp/sntp.1sntpmdoc@1.154 +67 -3
+ Autogen documentation cleanup
+
+ sntp/sntp.html@1.334 +114 -89
+ Autogen documentation cleanup
+
+ sntp/sntp.man.in@1.154 +66 -2
+ Autogen documentation cleanup
+
+ sntp/sntp.mdoc.in@1.154 +67 -3
+ Autogen documentation cleanup
+
+ util/invoke-ntp-keygen.texi@1.322 +2 -1
+ Autogen documentation cleanup
+
+ util/ntp-keygen-opts.c@1.336 +1 -1
+ Autogen documentation cleanup
+
+ util/ntp-keygen-opts.def@1.21 +1 -0
+ Autogen documentation cleanup
+
+ util/ntp-keygen-opts.h@1.336 +1 -1
+ Autogen documentation cleanup
+
+ util/ntp-keygen.1ntp-keygenman@1.150 +721 -3
+ Autogen documentation cleanup
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.150 +708 -4
+ Autogen documentation cleanup
+
+ util/ntp-keygen.man.in@1.150 +721 -3
+ Autogen documentation cleanup
+
+ util/ntp-keygen.mdoc.in@1.150 +708 -4
+ Autogen documentation cleanup
+
+ChangeSet@1.2839, 2012-12-06 07:46:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P332
+ TAG: NTP_4_2_7P332
+
+ ChangeLog@1.1201 +1 -0
+ NTP_4_2_7P332
+
+ ntpd/invoke-ntp.conf.texi@1.5 +1 -1
+ NTP_4_2_7P332
+
+ ntpd/invoke-ntp.keys.texi@1.5 +1 -1
+ NTP_4_2_7P332
+
+ ntpd/invoke-ntpd.texi@1.321 +2 -2
+ NTP_4_2_7P332
+
+ ntpd/ntp.conf.5man@1.39 +3 -2876
+ NTP_4_2_7P332
+
+ ntpd/ntp.conf.5mdoc@1.39 +4 -2709
+ NTP_4_2_7P332
+
+ ntpd/ntp.conf.html@1.4 +1 -1
+ NTP_4_2_7P332
+
+ ntpd/ntp.conf.man.in@1.39 +3 -2876
+ NTP_4_2_7P332
+
+ ntpd/ntp.conf.mdoc.in@1.39 +4 -2709
+ NTP_4_2_7P332
+
+ ntpd/ntp.keys.5man@1.39 +2 -94
+ NTP_4_2_7P332
+
+ ntpd/ntp.keys.5mdoc@1.39 +3 -94
+ NTP_4_2_7P332
+
+ ntpd/ntp.keys.html@1.5 +1 -1
+ NTP_4_2_7P332
+
+ ntpd/ntp.keys.man.in@1.39 +2 -94
+ NTP_4_2_7P332
+
+ ntpd/ntp.keys.mdoc.in@1.39 +3 -94
+ NTP_4_2_7P332
+
+ ntpd/ntpd-opts.c@1.339 +4 -4
+ NTP_4_2_7P332
+
+ ntpd/ntpd-opts.h@1.339 +3 -3
+ NTP_4_2_7P332
+
+ ntpd/ntpd.1ntpdman@1.150 +2 -2
+ NTP_4_2_7P332
+
+ ntpd/ntpd.1ntpdmdoc@1.150 +2 -2
+ NTP_4_2_7P332
+
+ ntpd/ntpd.man.in@1.150 +2 -2
+ NTP_4_2_7P332
+
+ ntpd/ntpd.mdoc.in@1.150 +2 -2
+ NTP_4_2_7P332
+
+ ntpdc/invoke-ntpdc.texi@1.318 +2 -2
+ NTP_4_2_7P332
+
+ ntpdc/ntpdc-opts.c@1.333 +4 -4
+ NTP_4_2_7P332
+
+ ntpdc/ntpdc-opts.h@1.333 +3 -3
+ NTP_4_2_7P332
+
+ ntpdc/ntpdc.1ntpdcman@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpdc/ntpdc.html@1.161 +2 -2
+ NTP_4_2_7P332
+
+ ntpdc/ntpdc.man.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpdc/ntpdc.mdoc.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpq/invoke-ntpq.texi@1.320 +2 -2
+ NTP_4_2_7P332
+
+ ntpq/ntpq-opts.c@1.335 +4 -4
+ NTP_4_2_7P332
+
+ ntpq/ntpq-opts.h@1.335 +3 -3
+ NTP_4_2_7P332
+
+ ntpq/ntpq.1ntpqman@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpq/ntpq.1ntpqmdoc@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpq/ntpq.man.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpq/ntpq.mdoc.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.320 +2 -2
+ NTP_4_2_7P332
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.335 +4 -4
+ NTP_4_2_7P332
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.335 +3 -3
+ NTP_4_2_7P332
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpsnmpd/ntpsnmpd.man.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ packageinfo.sh@1.335 +1 -1
+ NTP_4_2_7P332
+
+ scripts/invoke-ntp-wait.texi@1.138 +1 -1
+ NTP_4_2_7P332
+
+ scripts/ntp-wait.1ntp-waitman@1.149 +2 -2
+ NTP_4_2_7P332
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.149 +2 -2
+ NTP_4_2_7P332
+
+ scripts/ntp-wait.html@1.153 +1 -1
+ NTP_4_2_7P332
+
+ scripts/ntp-wait.man.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ scripts/ntp-wait.mdoc.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ sntp/invoke-sntp.texi@1.318 +2 -2
+ NTP_4_2_7P332
+
+ sntp/sntp-opts.c@1.333 +4 -4
+ NTP_4_2_7P332
+
+ sntp/sntp-opts.h@1.333 +3 -3
+ NTP_4_2_7P332
+
+ sntp/sntp.1sntpman@1.153 +2 -66
+ NTP_4_2_7P332
+
+ sntp/sntp.1sntpmdoc@1.153 +2 -66
+ NTP_4_2_7P332
+
+ sntp/sntp.html@1.333 +91 -116
+ NTP_4_2_7P332
+
+ sntp/sntp.man.in@1.153 +2 -66
+ NTP_4_2_7P332
+
+ sntp/sntp.mdoc.in@1.153 +2 -66
+ NTP_4_2_7P332
+
+ util/invoke-ntp-keygen.texi@1.321 +2 -2
+ NTP_4_2_7P332
+
+ util/ntp-keygen-opts.c@1.335 +4 -4
+ NTP_4_2_7P332
+
+ util/ntp-keygen-opts.h@1.335 +3 -3
+ NTP_4_2_7P332
+
+ util/ntp-keygen.1ntp-keygenman@1.149 +2 -2
+ NTP_4_2_7P332
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.149 +2 -2
+ NTP_4_2_7P332
+
+ util/ntp-keygen.man.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ util/ntp-keygen.mdoc.in@1.149 +2 -2
+ NTP_4_2_7P332
+
+ChangeSet@1.2838, 2012-12-06 02:20:55+00:00, stenn@psp-fb1.ntp.org
+ update ntpd docs
+
+ ntpd/invoke-ntp.conf.texi@1.4 +1 -1
+ update ntpd docs
+
+ ntpd/invoke-ntp.keys.texi@1.4 +1 -1
+ update ntpd docs
+
+ ntpd/ntp.conf.5man@1.38 +2876 -3
+ update ntpd docs
+
+ ntpd/ntp.conf.5mdoc@1.38 +2709 -4
+ update ntpd docs
+
+ ntpd/ntp.conf.man.in@1.38 +2876 -3
+ update ntpd docs
+
+ ntpd/ntp.conf.mdoc.in@1.38 +2709 -4
+ update ntpd docs
+
+ ntpd/ntp.keys.5man@1.38 +94 -2
+ update ntpd docs
+
+ ntpd/ntp.keys.5mdoc@1.38 +94 -3
+ update ntpd docs
+
+ ntpd/ntp.keys.man.in@1.38 +94 -2
+ update ntpd docs
+
+ ntpd/ntp.keys.mdoc.in@1.38 +94 -3
+ update ntpd docs
+
+ChangeSet@1.2837, 2012-12-06 02:14:12+00:00, stenn@psp-fb1.ntp.org
+ sntp doc cleanup
+
+ ChangeLog@1.1200 +1 -0
+ sntp doc cleanup
+
+ sntp/invoke-sntp.texi@1.317 +17 -26
+ sntp doc cleanup
+
+ sntp/sntp-opts.c@1.332 +78 -78
+ sntp doc cleanup
+
+ sntp/sntp-opts.def@1.41 +15 -24
+ sntp doc cleanup
+
+ sntp/sntp-opts.h@1.332 +1 -1
+ sntp doc cleanup
+
+ sntp/sntp.1sntpman@1.152 +78 -20
+ sntp doc cleanup
+
+ sntp/sntp.1sntpmdoc@1.152 +79 -24
+ sntp doc cleanup
+
+ sntp/sntp.html@1.332 +125 -110
+ sntp doc cleanup
+
+ sntp/sntp.man.in@1.152 +78 -20
+ sntp doc cleanup
+
+ sntp/sntp.mdoc.in@1.152 +79 -24
+ sntp doc cleanup
+
+ChangeSet@1.2836, 2012-12-03 12:35:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P331
+ TAG: NTP_4_2_7P331
+
+ ChangeLog@1.1199 +1 -0
+ NTP_4_2_7P331
+
+ ntpd/invoke-ntp.conf.texi@1.3 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/invoke-ntp.keys.texi@1.3 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/invoke-ntpd.texi@1.320 +2 -2
+ NTP_4_2_7P331
+
+ ntpd/ntp.conf.5man@1.37 +2 -2
+ NTP_4_2_7P331
+
+ ntpd/ntp.conf.5mdoc@1.37 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/ntp.conf.html@1.3 +36 -3
+ NTP_4_2_7P331
+
+ ntpd/ntp.conf.man.in@1.37 +2 -2
+ NTP_4_2_7P331
+
+ ntpd/ntp.conf.mdoc.in@1.37 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/ntp.keys.5man@1.37 +2 -2
+ NTP_4_2_7P331
+
+ ntpd/ntp.keys.5mdoc@1.37 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/ntp.keys.html@1.4 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/ntp.keys.man.in@1.37 +2 -2
+ NTP_4_2_7P331
+
+ ntpd/ntp.keys.mdoc.in@1.37 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/ntpd-opts.c@1.338 +4 -4
+ NTP_4_2_7P331
+
+ ntpd/ntpd-opts.h@1.338 +3 -3
+ NTP_4_2_7P331
+
+ ntpd/ntpd.1ntpdman@1.149 +2 -2
+ NTP_4_2_7P331
+
+ ntpd/ntpd.1ntpdmdoc@1.149 +1 -1
+ NTP_4_2_7P331
+
+ ntpd/ntpd.man.in@1.149 +2 -2
+ NTP_4_2_7P331
+
+ ntpd/ntpd.mdoc.in@1.149 +1 -1
+ NTP_4_2_7P331
+
+ ntpdc/invoke-ntpdc.texi@1.317 +2 -2
+ NTP_4_2_7P331
+
+ ntpdc/ntpdc-opts.c@1.332 +4 -4
+ NTP_4_2_7P331
+
+ ntpdc/ntpdc-opts.h@1.332 +3 -3
+ NTP_4_2_7P331
+
+ ntpdc/ntpdc.1ntpdcman@1.148 +2 -2
+ NTP_4_2_7P331
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.148 +1 -1
+ NTP_4_2_7P331
+
+ ntpdc/ntpdc.html@1.160 +2 -2
+ NTP_4_2_7P331
+
+ ntpdc/ntpdc.man.in@1.148 +2 -2
+ NTP_4_2_7P331
+
+ ntpdc/ntpdc.mdoc.in@1.148 +1 -1
+ NTP_4_2_7P331
+
+ ntpq/invoke-ntpq.texi@1.319 +2 -2
+ NTP_4_2_7P331
+
+ ntpq/ntpq-opts.c@1.334 +4 -4
+ NTP_4_2_7P331
+
+ ntpq/ntpq-opts.h@1.334 +3 -3
+ NTP_4_2_7P331
+
+ ntpq/ntpq.1ntpqman@1.148 +2 -2
+ NTP_4_2_7P331
+
+ ntpq/ntpq.1ntpqmdoc@1.148 +1 -1
+ NTP_4_2_7P331
+
+ ntpq/ntpq.man.in@1.148 +2 -2
+ NTP_4_2_7P331
+
+ ntpq/ntpq.mdoc.in@1.148 +1 -1
+ NTP_4_2_7P331
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.319 +2 -2
+ NTP_4_2_7P331
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.334 +4 -4
+ NTP_4_2_7P331
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.334 +3 -3
+ NTP_4_2_7P331
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.148 +2 -2
+ NTP_4_2_7P331
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.148 +1 -1
+ NTP_4_2_7P331
+
+ ntpsnmpd/ntpsnmpd.man.in@1.148 +2 -2
+ NTP_4_2_7P331
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.148 +1 -1
+ NTP_4_2_7P331
+
+ packageinfo.sh@1.334 +1 -1
+ NTP_4_2_7P331
+
+ scripts/invoke-ntp-wait.texi@1.137 +1 -1
+ NTP_4_2_7P331
+
+ scripts/ntp-wait.1ntp-waitman@1.148 +2 -2
+ NTP_4_2_7P331
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.148 +1 -1
+ NTP_4_2_7P331
+
+ scripts/ntp-wait.html@1.152 +1 -1
+ NTP_4_2_7P331
+
+ scripts/ntp-wait.man.in@1.148 +2 -2
+ NTP_4_2_7P331
+
+ scripts/ntp-wait.mdoc.in@1.148 +1 -1
+ NTP_4_2_7P331
+
+ sntp/invoke-sntp.texi@1.316 +2 -2
+ NTP_4_2_7P331
+
+ sntp/sntp-opts.c@1.331 +4 -4
+ NTP_4_2_7P331
+
+ sntp/sntp-opts.h@1.331 +3 -3
+ NTP_4_2_7P331
+
+ sntp/sntp.1sntpman@1.151 +2 -2
+ NTP_4_2_7P331
+
+ sntp/sntp.1sntpmdoc@1.151 +1 -1
+ NTP_4_2_7P331
+
+ sntp/sntp.html@1.331 +2 -2
+ NTP_4_2_7P331
+
+ sntp/sntp.man.in@1.151 +2 -2
+ NTP_4_2_7P331
+
+ sntp/sntp.mdoc.in@1.151 +1 -1
+ NTP_4_2_7P331
+
+ util/invoke-ntp-keygen.texi@1.320 +2 -2
+ NTP_4_2_7P331
+
+ util/ntp-keygen-opts.c@1.334 +4 -4
+ NTP_4_2_7P331
+
+ util/ntp-keygen-opts.h@1.334 +3 -3
+ NTP_4_2_7P331
+
+ util/ntp-keygen.1ntp-keygenman@1.148 +2 -2
+ NTP_4_2_7P331
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.148 +1 -1
+ NTP_4_2_7P331
+
+ util/ntp-keygen.man.in@1.148 +2 -2
+ NTP_4_2_7P331
+
+ util/ntp-keygen.mdoc.in@1.148 +1 -1
+ NTP_4_2_7P331
+
+ChangeSet@1.2835, 2012-12-03 07:24:46-05:00, stenn@deacon.udel.edu
+ Include VERSION in the texi output
+
+ ntpd/ntp.conf.texi@1.3 +2 -1
+ Include VERSION in the texi output
+
+ ntpd/ntp.keys.texi@1.3 +2 -1
+ Include VERSION in the texi output
+
+ChangeSet@1.2834, 2012-12-03 07:14:45-05:00, stenn@deacon.udel.edu
+ autogen cleanup
+
+ ntpd/ntp.keys.def@1.7 +1 -0
+ autogen cleanup
+
+ ntpd/ntp.keys.html@1.3 +1 -1
+ autogen cleanup
+
+ChangeSet@1.2833, 2012-12-03 07:11:28-05:00, stenn@deacon.udel.edu
+ fix include path for texi version
+
+ ntpd/ntp.conf.texi@1.2 +1 -1
+ fix include path for texi version
+
+ ntpd/ntp.keys.texi@1.2 +1 -1
+ fix include path for texi version
+
+ChangeSet@1.2832, 2012-12-03 02:40:27-08:00, harlan@hms-mbp11.local
+ [Bug 2114] Correctly calculate sntp's synch distance
+
+ ChangeLog@1.1198 +1 -0
+ [Bug 2114] Correctly calculate sntp's synch distance
+
+ sntp/main.c@1.87 +52 -17
+ [Bug 2114] Correctly calculate sntp's synch distance
+
+ChangeSet@1.2831, 2012-12-03 05:37:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P330
+ TAG: NTP_4_2_7P330
+
+ ChangeLog@1.1197 +1 -0
+ NTP_4_2_7P330
+
+ ntpd/invoke-ntp.conf.texi@1.2 +37 -2
+ NTP_4_2_7P330
+
+ ntpd/invoke-ntp.keys.texi@1.2 +1 -1
+ NTP_4_2_7P330
+
+ ntpd/invoke-ntpd.texi@1.319 +2 -2
+ NTP_4_2_7P330
+
+ ntpd/ntp.conf.5man@1.36 +2 -31
+ NTP_4_2_7P330
+
+ ntpd/ntp.conf.5mdoc@1.36 +2 -30
+ NTP_4_2_7P330
+
+ ntpd/ntp.conf.html@1.2 +163 -183
+ NTP_4_2_7P330
+
+ ntpd/ntp.conf.man.in@1.36 +2 -31
+ NTP_4_2_7P330
+
+ ntpd/ntp.conf.mdoc.in@1.36 +2 -30
+ NTP_4_2_7P330
+
+ ntpd/ntp.keys.5man@1.36 +6 -38
+ NTP_4_2_7P330
+
+ ntpd/ntp.keys.5mdoc@1.36 +6 -38
+ NTP_4_2_7P330
+
+ ntpd/ntp.keys.html@1.2 +235 -12
+ NTP_4_2_7P330
+
+ ntpd/ntp.keys.man.in@1.36 +6 -38
+ NTP_4_2_7P330
+
+ ntpd/ntp.keys.mdoc.in@1.36 +6 -38
+ NTP_4_2_7P330
+
+ ntpd/ntpd-opts.c@1.337 +4 -4
+ NTP_4_2_7P330
+
+ ntpd/ntpd-opts.h@1.337 +3 -3
+ NTP_4_2_7P330
+
+ ntpd/ntpd.1ntpdman@1.148 +2 -2
+ NTP_4_2_7P330
+
+ ntpd/ntpd.1ntpdmdoc@1.148 +2 -2
+ NTP_4_2_7P330
+
+ ntpd/ntpd.man.in@1.148 +2 -2
+ NTP_4_2_7P330
+
+ ntpd/ntpd.mdoc.in@1.148 +2 -2
+ NTP_4_2_7P330
+
+ ntpdc/invoke-ntpdc.texi@1.316 +2 -2
+ NTP_4_2_7P330
+
+ ntpdc/ntpdc-opts.c@1.331 +4 -4
+ NTP_4_2_7P330
+
+ ntpdc/ntpdc-opts.h@1.331 +3 -3
+ NTP_4_2_7P330
+
+ ntpdc/ntpdc.1ntpdcman@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpdc/ntpdc.html@1.159 +2 -2
+ NTP_4_2_7P330
+
+ ntpdc/ntpdc.man.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpdc/ntpdc.mdoc.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpq/invoke-ntpq.texi@1.318 +2 -2
+ NTP_4_2_7P330
+
+ ntpq/ntpq-opts.c@1.333 +4 -4
+ NTP_4_2_7P330
+
+ ntpq/ntpq-opts.h@1.333 +3 -3
+ NTP_4_2_7P330
+
+ ntpq/ntpq.1ntpqman@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpq/ntpq.1ntpqmdoc@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpq/ntpq.man.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpq/ntpq.mdoc.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.318 +2 -2
+ NTP_4_2_7P330
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.333 +4 -4
+ NTP_4_2_7P330
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.333 +3 -3
+ NTP_4_2_7P330
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpsnmpd/ntpsnmpd.man.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ packageinfo.sh@1.333 +1 -1
+ NTP_4_2_7P330
+
+ scripts/invoke-ntp-wait.texi@1.136 +1 -1
+ NTP_4_2_7P330
+
+ scripts/ntp-wait.1ntp-waitman@1.147 +2 -2
+ NTP_4_2_7P330
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.147 +2 -2
+ NTP_4_2_7P330
+
+ scripts/ntp-wait.html@1.151 +1 -1
+ NTP_4_2_7P330
+
+ scripts/ntp-wait.man.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ scripts/ntp-wait.mdoc.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ sntp/invoke-sntp.texi@1.315 +2 -2
+ NTP_4_2_7P330
+
+ sntp/sntp-opts.c@1.330 +4 -4
+ NTP_4_2_7P330
+
+ sntp/sntp-opts.h@1.330 +3 -3
+ NTP_4_2_7P330
+
+ sntp/sntp.1sntpman@1.150 +2 -2
+ NTP_4_2_7P330
+
+ sntp/sntp.1sntpmdoc@1.150 +2 -2
+ NTP_4_2_7P330
+
+ sntp/sntp.html@1.330 +2 -2
+ NTP_4_2_7P330
+
+ sntp/sntp.man.in@1.150 +2 -2
+ NTP_4_2_7P330
+
+ sntp/sntp.mdoc.in@1.150 +2 -2
+ NTP_4_2_7P330
+
+ util/invoke-ntp-keygen.texi@1.319 +2 -2
+ NTP_4_2_7P330
+
+ util/ntp-keygen-opts.c@1.333 +4 -4
+ NTP_4_2_7P330
+
+ util/ntp-keygen-opts.h@1.333 +3 -3
+ NTP_4_2_7P330
+
+ util/ntp-keygen.1ntp-keygenman@1.147 +2 -2
+ NTP_4_2_7P330
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.147 +2 -2
+ NTP_4_2_7P330
+
+ util/ntp-keygen.man.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ util/ntp-keygen.mdoc.in@1.147 +2 -2
+ NTP_4_2_7P330
+
+ChangeSet@1.2830, 2012-12-03 00:37:12-05:00, stenn@deacon.udel.edu
+ autogen doc update
+
+ .point-changed-filelist@1.16 +0 -2
+ autogen doc update
+
+ChangeSet@1.2829, 2012-12-03 04:52:58+00:00, stenn@psp-fb1.ntp.org
+ autogen doc cleanup
+
+ ntpd/ntp.conf.def@1.3 +16 -1
+ autogen doc cleanup
+
+ChangeSet@1.2828, 2012-12-02 23:09:51-05:00, stenn@deacon.udel.edu
+ autogen doc cleanup
+
+ ntpd/ntp.conf.def@1.2 +1 -0
+ autogen doc cleanup
+
+ChangeSet@1.2827, 2012-12-03 02:51:53+00:00, stenn@psp-fb1.ntp.org
+ autogen doc cleanup
+
+ .point-changed-filelist@1.15 +6 -0
+ autogen doc cleanup
+
+ ChangeLog@1.1196 +1 -0
+ autogen doc cleanup
+
+ ntpd/Makefile.am@1.125 +59 -18
+ autogen doc cleanup
+
+ ntpd/invoke-ntp.conf.menu@1.1 +1 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/invoke-ntp.conf.menu
+
+ ntpd/invoke-ntp.conf.menu@1.0 +0 -0
+
+ ntpd/invoke-ntp.conf.texi@1.1 +3816 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/invoke-ntp.conf.texi
+
+ ntpd/invoke-ntp.conf.texi@1.0 +0 -0
+
+ ntpd/invoke-ntp.keys.menu@1.1 +1 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/invoke-ntp.keys.menu
+
+ ntpd/invoke-ntp.keys.menu@1.0 +0 -0
+
+ ntpd/invoke-ntp.keys.texi@1.1 +208 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/invoke-ntp.keys.texi
+
+ ntpd/invoke-ntp.keys.texi@1.0 +0 -0
+
+ ntpd/ntp.conf.html@1.1 +3762 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/ntp.conf.html
+
+ ntpd/ntp.conf.html@1.0 +0 -0
+
+ ntpd/ntp.conf.texi@1.1 +48 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/ntp.conf.texi
+
+ ntpd/ntp.conf.texi@1.0 +0 -0
+
+ ntpd/ntp.keys.def@1.6 +40 -48
+ autogen doc cleanup
+
+ ntpd/ntp.keys.html@1.1 +67 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/ntp.keys.html
+
+ ntpd/ntp.keys.html@1.0 +0 -0
+
+ ntpd/ntp.keys.texi@1.1 +48 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/ntpd/ntp.keys.texi
+
+ ntpd/ntp.keys.texi@1.0 +0 -0
+
+ sntp/ag-tpl/agman-file.tpl@1.1 +86 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/sntp/ag-tpl/agman-file.tpl
+
+ sntp/ag-tpl/agman-file.tpl@1.0 +0 -0
+
+ sntp/ag-tpl/agmdoc-file.tpl@1.1 +73 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/sntp/ag-tpl/agmdoc-file.tpl
+
+ sntp/ag-tpl/agmdoc-file.tpl@1.0 +0 -0
+
+ sntp/ag-tpl/cmd-doc.tlib@1.1 +1003 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/sntp/ag-tpl/cmd-doc.tlib
+
+ sntp/ag-tpl/cmd-doc.tlib@1.0 +0 -0
+
+ChangeSet@1.2826, 2012-12-01 11:33:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P329
+ TAG: NTP_4_2_7P329
+
+ ChangeLog@1.1195 +1 -0
+ NTP_4_2_7P329
+
+ ntpd/invoke-ntpd.texi@1.318 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.conf.5man@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.conf.5mdoc@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.conf.man.in@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.conf.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.keys.5man@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.keys.5mdoc@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.keys.man.in@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntp.keys.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntpd-opts.c@1.336 +4 -4
+ NTP_4_2_7P329
+
+ ntpd/ntpd-opts.h@1.336 +3 -3
+ NTP_4_2_7P329
+
+ ntpd/ntpd.1ntpdman@1.147 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntpd.1ntpdmdoc@1.147 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntpd.man.in@1.147 +2 -2
+ NTP_4_2_7P329
+
+ ntpd/ntpd.mdoc.in@1.147 +2 -2
+ NTP_4_2_7P329
+
+ ntpdc/invoke-ntpdc.texi@1.315 +2 -2
+ NTP_4_2_7P329
+
+ ntpdc/ntpdc-opts.c@1.330 +4 -4
+ NTP_4_2_7P329
+
+ ntpdc/ntpdc-opts.h@1.330 +3 -3
+ NTP_4_2_7P329
+
+ ntpdc/ntpdc.1ntpdcman@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpdc/ntpdc.html@1.158 +2 -2
+ NTP_4_2_7P329
+
+ ntpdc/ntpdc.man.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpdc/ntpdc.mdoc.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpq/invoke-ntpq.texi@1.317 +2 -2
+ NTP_4_2_7P329
+
+ ntpq/ntpq-opts.c@1.332 +4 -4
+ NTP_4_2_7P329
+
+ ntpq/ntpq-opts.h@1.332 +3 -3
+ NTP_4_2_7P329
+
+ ntpq/ntpq.1ntpqman@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpq/ntpq.1ntpqmdoc@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpq/ntpq.man.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpq/ntpq.mdoc.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.317 +2 -2
+ NTP_4_2_7P329
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.332 +4 -4
+ NTP_4_2_7P329
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.332 +3 -3
+ NTP_4_2_7P329
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpsnmpd/ntpsnmpd.man.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ packageinfo.sh@1.332 +1 -1
+ NTP_4_2_7P329
+
+ scripts/invoke-ntp-wait.texi@1.135 +1 -1
+ NTP_4_2_7P329
+
+ scripts/ntp-wait.1ntp-waitman@1.146 +2 -2
+ NTP_4_2_7P329
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.146 +2 -2
+ NTP_4_2_7P329
+
+ scripts/ntp-wait.html@1.150 +1 -1
+ NTP_4_2_7P329
+
+ scripts/ntp-wait.man.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ scripts/ntp-wait.mdoc.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ sntp/invoke-sntp.texi@1.314 +2 -2
+ NTP_4_2_7P329
+
+ sntp/sntp-opts.c@1.329 +4 -4
+ NTP_4_2_7P329
+
+ sntp/sntp-opts.h@1.329 +3 -3
+ NTP_4_2_7P329
+
+ sntp/sntp.1sntpman@1.149 +2 -2
+ NTP_4_2_7P329
+
+ sntp/sntp.1sntpmdoc@1.149 +2 -2
+ NTP_4_2_7P329
+
+ sntp/sntp.html@1.329 +2 -2
+ NTP_4_2_7P329
+
+ sntp/sntp.man.in@1.149 +2 -2
+ NTP_4_2_7P329
+
+ sntp/sntp.mdoc.in@1.149 +2 -2
+ NTP_4_2_7P329
+
+ util/invoke-ntp-keygen.texi@1.318 +2 -2
+ NTP_4_2_7P329
+
+ util/ntp-keygen-opts.c@1.332 +4 -4
+ NTP_4_2_7P329
+
+ util/ntp-keygen-opts.h@1.332 +3 -3
+ NTP_4_2_7P329
+
+ util/ntp-keygen.1ntp-keygenman@1.146 +2 -2
+ NTP_4_2_7P329
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.146 +2 -2
+ NTP_4_2_7P329
+
+ util/ntp-keygen.man.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ util/ntp-keygen.mdoc.in@1.146 +2 -2
+ NTP_4_2_7P329
+
+ChangeSet@1.2824, 2012-12-01 10:43:56+00:00, stenn@psp-fb1.ntp.org
+ Use an enum for the ACTS state table
+
+ ChangeLog@1.1193 +1 -0
+ Use an enum for the ACTS state table
+
+ ntpd/refclock_acts.c@1.51.1.1 +8 -6
+ Use an enum for the ACTS state table
+
+ChangeSet@1.2822.1.73, 2012-11-30 23:45:57-05:00, stenn@deacon.udel.edu
+ html doc reconciliation with DLM's copy
+
+ ChangeLog@1.1191.1.63 +1 -0
+ html doc reconciliation with DLM's copy
+
+ html/authentic.html@1.13 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/copyright.html@1.60 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/decode.html@1.21 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/drivers/driver1.html@1.20 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/leap.html@1.5 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/miscopt.html@1.71 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/ntpd.html@1.57 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/ntpdate.html@1.23 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/ntpq.html@1.47 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/ntptrace.html@1.18 +1 -1
+ html doc reconciliation with DLM's copy
+
+ html/quick.html@1.24 +2 -2
+ html doc reconciliation with DLM's copy
+
+ChangeSet@1.2822.1.72, 2012-11-30 11:34:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P328
+ TAG: NTP_4_2_7P328
+
+ ChangeLog@1.1191.1.62 +1 -0
+ NTP_4_2_7P328
+
+ ntpd/invoke-ntpd.texi@1.317 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.conf.5man@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.conf.5mdoc@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.conf.man.in@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.conf.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.keys.5man@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.keys.5mdoc@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.keys.man.in@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntp.keys.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntpd-opts.c@1.335 +4 -4
+ NTP_4_2_7P328
+
+ ntpd/ntpd-opts.h@1.335 +3 -3
+ NTP_4_2_7P328
+
+ ntpd/ntpd.1ntpdman@1.146 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntpd.1ntpdmdoc@1.146 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntpd.man.in@1.146 +2 -2
+ NTP_4_2_7P328
+
+ ntpd/ntpd.mdoc.in@1.146 +2 -2
+ NTP_4_2_7P328
+
+ ntpdc/invoke-ntpdc.texi@1.314 +2 -2
+ NTP_4_2_7P328
+
+ ntpdc/ntpdc-opts.c@1.329 +4 -4
+ NTP_4_2_7P328
+
+ ntpdc/ntpdc-opts.h@1.329 +3 -3
+ NTP_4_2_7P328
+
+ ntpdc/ntpdc.1ntpdcman@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpdc/ntpdc.html@1.157 +2 -2
+ NTP_4_2_7P328
+
+ ntpdc/ntpdc.man.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpdc/ntpdc.mdoc.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpq/invoke-ntpq.texi@1.316 +2 -2
+ NTP_4_2_7P328
+
+ ntpq/ntpq-opts.c@1.331 +4 -4
+ NTP_4_2_7P328
+
+ ntpq/ntpq-opts.h@1.331 +3 -3
+ NTP_4_2_7P328
+
+ ntpq/ntpq.1ntpqman@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpq/ntpq.1ntpqmdoc@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpq/ntpq.man.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpq/ntpq.mdoc.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.316 +2 -2
+ NTP_4_2_7P328
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.331 +4 -4
+ NTP_4_2_7P328
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.331 +3 -3
+ NTP_4_2_7P328
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpsnmpd/ntpsnmpd.man.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ packageinfo.sh@1.331 +1 -1
+ NTP_4_2_7P328
+
+ scripts/invoke-ntp-wait.texi@1.134 +1 -1
+ NTP_4_2_7P328
+
+ scripts/ntp-wait.1ntp-waitman@1.145 +2 -2
+ NTP_4_2_7P328
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.145 +2 -2
+ NTP_4_2_7P328
+
+ scripts/ntp-wait.html@1.149 +1 -1
+ NTP_4_2_7P328
+
+ scripts/ntp-wait.man.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ scripts/ntp-wait.mdoc.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ sntp/invoke-sntp.texi@1.313 +2 -2
+ NTP_4_2_7P328
+
+ sntp/sntp-opts.c@1.328 +4 -4
+ NTP_4_2_7P328
+
+ sntp/sntp-opts.h@1.328 +3 -3
+ NTP_4_2_7P328
+
+ sntp/sntp.1sntpman@1.148 +2 -2
+ NTP_4_2_7P328
+
+ sntp/sntp.1sntpmdoc@1.148 +2 -2
+ NTP_4_2_7P328
+
+ sntp/sntp.html@1.328 +2 -2
+ NTP_4_2_7P328
+
+ sntp/sntp.man.in@1.148 +2 -2
+ NTP_4_2_7P328
+
+ sntp/sntp.mdoc.in@1.148 +2 -2
+ NTP_4_2_7P328
+
+ util/invoke-ntp-keygen.texi@1.317 +2 -2
+ NTP_4_2_7P328
+
+ util/ntp-keygen-opts.c@1.331 +4 -4
+ NTP_4_2_7P328
+
+ util/ntp-keygen-opts.h@1.331 +3 -3
+ NTP_4_2_7P328
+
+ util/ntp-keygen.1ntp-keygenman@1.145 +2 -2
+ NTP_4_2_7P328
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.145 +2 -2
+ NTP_4_2_7P328
+
+ util/ntp-keygen.man.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ util/ntp-keygen.mdoc.in@1.145 +2 -2
+ NTP_4_2_7P328
+
+ChangeSet@1.2822.1.71, 2012-11-30 06:00:13-05:00, stenn@deacon.udel.edu
+ html doc reconciliation with DLM's copy
+
+ ChangeLog@1.1191.1.61 +1 -0
+ html doc reconciliation with DLM's copy
+
+ html/refclock.html@1.38 +1 -0
+ html doc reconciliation with DLM's copy
+
+ChangeSet@1.2822.1.70, 2012-11-29 11:36:57+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P327
+ TAG: NTP_4_2_7P327
+
+ ChangeLog@1.1191.1.60 +1 -0
+ NTP_4_2_7P327
+
+ ntpd/invoke-ntpd.texi@1.316 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.conf.5man@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.conf.5mdoc@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.conf.man.in@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.conf.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.keys.5man@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.keys.5mdoc@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.keys.man.in@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntp.keys.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntpd-opts.c@1.334 +4 -4
+ NTP_4_2_7P327
+
+ ntpd/ntpd-opts.h@1.334 +3 -3
+ NTP_4_2_7P327
+
+ ntpd/ntpd.1ntpdman@1.145 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntpd.1ntpdmdoc@1.145 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntpd.man.in@1.145 +2 -2
+ NTP_4_2_7P327
+
+ ntpd/ntpd.mdoc.in@1.145 +2 -2
+ NTP_4_2_7P327
+
+ ntpdc/invoke-ntpdc.texi@1.313 +2 -2
+ NTP_4_2_7P327
+
+ ntpdc/ntpdc-opts.c@1.328 +4 -4
+ NTP_4_2_7P327
+
+ ntpdc/ntpdc-opts.h@1.328 +3 -3
+ NTP_4_2_7P327
+
+ ntpdc/ntpdc.1ntpdcman@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpdc/ntpdc.html@1.156 +2 -2
+ NTP_4_2_7P327
+
+ ntpdc/ntpdc.man.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpdc/ntpdc.mdoc.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpq/invoke-ntpq.texi@1.315 +2 -2
+ NTP_4_2_7P327
+
+ ntpq/ntpq-opts.c@1.330 +4 -4
+ NTP_4_2_7P327
+
+ ntpq/ntpq-opts.h@1.330 +3 -3
+ NTP_4_2_7P327
+
+ ntpq/ntpq.1ntpqman@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpq/ntpq.1ntpqmdoc@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpq/ntpq.man.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpq/ntpq.mdoc.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.315 +2 -2
+ NTP_4_2_7P327
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.330 +4 -4
+ NTP_4_2_7P327
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.330 +3 -3
+ NTP_4_2_7P327
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpsnmpd/ntpsnmpd.man.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ packageinfo.sh@1.330 +1 -1
+ NTP_4_2_7P327
+
+ scripts/invoke-ntp-wait.texi@1.133 +1 -1
+ NTP_4_2_7P327
+
+ scripts/ntp-wait.1ntp-waitman@1.144 +2 -2
+ NTP_4_2_7P327
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.144 +2 -2
+ NTP_4_2_7P327
+
+ scripts/ntp-wait.html@1.148 +1 -1
+ NTP_4_2_7P327
+
+ scripts/ntp-wait.man.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ scripts/ntp-wait.mdoc.in@1.144 +2 -2
+ NTP_4_2_7P327
+
+ sntp/invoke-sntp.texi@1.312 +2 -2
+ NTP_4_2_7P327
+
+ sntp/sntp-opts.c@1.327 +4 -4
+ NTP_4_2_7P327
+
+ sntp/sntp-opts.h@1.327 +3 -3
+ NTP_4_2_7P327
+
+ sntp/sntp.1sntpman@1.147 +2 -2
+ NTP_4_2_7P327
+
+ sntp/sntp.1sntpmdoc@1.147 +2 -2
+ NTP_4_2_7P327
+
+ sntp/sntp.html@1.327 +2 -2
+ NTP_4_2_7P327
+
+ sntp/sntp.man.in@1.147 +2 -2
+ NTP_4_2_7P327
+
+ sntp/sntp.mdoc.in@1.147 +2 -2
+ NTP_4_2_7P327
+
+ util/invoke-ntp-keygen.texi@1.316 +21 -2
+ NTP_4_2_7P327
+
+ util/ntp-keygen-opts.c@1.330 +277 -203
+ NTP_4_2_7P327
+
+ util/ntp-keygen-opts.h@1.330 +40 -30
+ NTP_4_2_7P327
+
+ util/ntp-keygen.1ntp-keygenman@1.144 +15 -2
+ NTP_4_2_7P327
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.144 +14 -2
+ NTP_4_2_7P327
+
+ util/ntp-keygen.man.in@1.144 +15 -2
+ NTP_4_2_7P327
+
+ util/ntp-keygen.mdoc.in@1.144 +14 -2
+ NTP_4_2_7P327
+
+ChangeSet@1.2822.1.69, 2012-11-29 03:55:28-05:00, stenn@deacon.udel.edu
+ [Bug 2024] Identify Events in the system status word in decode.html
+
+ ChangeLog@1.1191.1.59 +1 -0
+ [Bug 2024] Identify Events in the system status word in decode.html
+
+ html/decode.html@1.20 +3 -3
+ [Bug 2024] Identify Events in the system status word in decode.html
+
+ChangeSet@1.2822.1.68, 2012-11-29 03:48:03-05:00, stenn@deacon.udel.edu
+ [Bug 2040] Provide a command-line option for the identity key bits
+
+ util/ntp-keygen.c@1.94 +4 -0
+ [Bug 2040] Provide a command-line option for the identity key bits
+
+ChangeSet@1.2822.1.67, 2012-11-29 03:45:42-05:00, stenn@deacon.udel.edu
+ [Bug 2040] Provide a command-line option for the identity key bits
+
+ ChangeLog@1.1191.1.58 +1 -0
+ [Bug 2040] Provide a command-line option for the identity key bits
+
+ html/keygen.html@1.32 +4 -2
+ [Bug 2040] Provide a command-line option for the identity key bits
+
+ util/ntp-keygen-opts.def@1.20 +13 -0
+ [Bug 2040] Provide a command-line option for the identity key bits
+
+ChangeSet@1.2822.1.66, 2012-11-29 08:21:55+00:00, stenn@psp-fb1.ntp.org
+ Create loc/darwin for Mac OSX
+
+ ChangeLog@1.1191.1.57 +1 -0
+ Create loc/darwin for Mac OSX
+
+ sntp/loc/darwin@1.1 +13 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/loc/darwin
+
+ sntp/loc/darwin@1.0 +0 -0
+
+ChangeSet@1.2822.1.65, 2012-11-21 11:33:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P326
+ TAG: NTP_4_2_7P326
+
+ ChangeLog@1.1191.1.56 +1 -0
+ NTP_4_2_7P326
+
+ ntpd/invoke-ntpd.texi@1.315 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.conf.5man@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.conf.5mdoc@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.conf.man.in@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.conf.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.keys.5man@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.keys.5mdoc@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.keys.man.in@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntp.keys.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntpd-opts.c@1.333 +4 -4
+ NTP_4_2_7P326
+
+ ntpd/ntpd-opts.h@1.333 +3 -3
+ NTP_4_2_7P326
+
+ ntpd/ntpd.1ntpdman@1.144 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntpd.1ntpdmdoc@1.144 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntpd.man.in@1.144 +2 -2
+ NTP_4_2_7P326
+
+ ntpd/ntpd.mdoc.in@1.144 +2 -2
+ NTP_4_2_7P326
+
+ ntpdc/invoke-ntpdc.texi@1.312 +2 -2
+ NTP_4_2_7P326
+
+ ntpdc/ntpdc-opts.c@1.327 +4 -4
+ NTP_4_2_7P326
+
+ ntpdc/ntpdc-opts.h@1.327 +3 -3
+ NTP_4_2_7P326
+
+ ntpdc/ntpdc.1ntpdcman@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpdc/ntpdc.html@1.155 +2 -2
+ NTP_4_2_7P326
+
+ ntpdc/ntpdc.man.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpdc/ntpdc.mdoc.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpq/invoke-ntpq.texi@1.314 +2 -2
+ NTP_4_2_7P326
+
+ ntpq/ntpq-opts.c@1.329 +4 -4
+ NTP_4_2_7P326
+
+ ntpq/ntpq-opts.h@1.329 +3 -3
+ NTP_4_2_7P326
+
+ ntpq/ntpq.1ntpqman@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpq/ntpq.1ntpqmdoc@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpq/ntpq.man.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpq/ntpq.mdoc.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.314 +2 -2
+ NTP_4_2_7P326
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.329 +4 -4
+ NTP_4_2_7P326
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.329 +3 -3
+ NTP_4_2_7P326
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpsnmpd/ntpsnmpd.man.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ packageinfo.sh@1.329 +1 -1
+ NTP_4_2_7P326
+
+ scripts/invoke-ntp-wait.texi@1.132 +1 -1
+ NTP_4_2_7P326
+
+ scripts/ntp-wait.1ntp-waitman@1.143 +2 -2
+ NTP_4_2_7P326
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.143 +2 -2
+ NTP_4_2_7P326
+
+ scripts/ntp-wait.html@1.147 +1 -1
+ NTP_4_2_7P326
+
+ scripts/ntp-wait.man.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ scripts/ntp-wait.mdoc.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ sntp/invoke-sntp.texi@1.311 +2 -2
+ NTP_4_2_7P326
+
+ sntp/sntp-opts.c@1.326 +4 -4
+ NTP_4_2_7P326
+
+ sntp/sntp-opts.h@1.326 +3 -3
+ NTP_4_2_7P326
+
+ sntp/sntp.1sntpman@1.146 +2 -2
+ NTP_4_2_7P326
+
+ sntp/sntp.1sntpmdoc@1.146 +2 -2
+ NTP_4_2_7P326
+
+ sntp/sntp.html@1.326 +2 -2
+ NTP_4_2_7P326
+
+ sntp/sntp.man.in@1.146 +2 -2
+ NTP_4_2_7P326
+
+ sntp/sntp.mdoc.in@1.146 +2 -2
+ NTP_4_2_7P326
+
+ util/invoke-ntp-keygen.texi@1.315 +2 -2
+ NTP_4_2_7P326
+
+ util/ntp-keygen-opts.c@1.329 +4 -4
+ NTP_4_2_7P326
+
+ util/ntp-keygen-opts.h@1.329 +3 -3
+ NTP_4_2_7P326
+
+ util/ntp-keygen.1ntp-keygenman@1.143 +2 -2
+ NTP_4_2_7P326
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.143 +2 -2
+ NTP_4_2_7P326
+
+ util/ntp-keygen.man.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ util/ntp-keygen.mdoc.in@1.143 +2 -2
+ NTP_4_2_7P326
+
+ChangeSet@1.2822.11.2, 2012-11-20 11:35:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P325
+ TAG: NTP_4_2_7P325
+
+ ChangeLog@1.1191.8.1 +1 -0
+ NTP_4_2_7P325
+
+ ntpd/invoke-ntpd.texi@1.314 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.conf.5man@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.conf.5mdoc@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.conf.man.in@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.conf.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.keys.5man@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.keys.5mdoc@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.keys.man.in@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntp.keys.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntpd-opts.c@1.332 +4 -4
+ NTP_4_2_7P325
+
+ ntpd/ntpd-opts.h@1.332 +3 -3
+ NTP_4_2_7P325
+
+ ntpd/ntpd.1ntpdman@1.143 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntpd.1ntpdmdoc@1.143 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntpd.man.in@1.143 +2 -2
+ NTP_4_2_7P325
+
+ ntpd/ntpd.mdoc.in@1.143 +2 -2
+ NTP_4_2_7P325
+
+ ntpdc/invoke-ntpdc.texi@1.311 +2 -2
+ NTP_4_2_7P325
+
+ ntpdc/ntpdc-opts.c@1.326 +4 -4
+ NTP_4_2_7P325
+
+ ntpdc/ntpdc-opts.h@1.326 +3 -3
+ NTP_4_2_7P325
+
+ ntpdc/ntpdc.1ntpdcman@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpdc/ntpdc.html@1.154 +2 -2
+ NTP_4_2_7P325
+
+ ntpdc/ntpdc.man.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpdc/ntpdc.mdoc.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpq/invoke-ntpq.texi@1.313 +2 -2
+ NTP_4_2_7P325
+
+ ntpq/ntpq-opts.c@1.328 +4 -4
+ NTP_4_2_7P325
+
+ ntpq/ntpq-opts.h@1.328 +3 -3
+ NTP_4_2_7P325
+
+ ntpq/ntpq.1ntpqman@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpq/ntpq.1ntpqmdoc@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpq/ntpq.man.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpq/ntpq.mdoc.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.313 +2 -2
+ NTP_4_2_7P325
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.328 +4 -4
+ NTP_4_2_7P325
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.328 +3 -3
+ NTP_4_2_7P325
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpsnmpd/ntpsnmpd.man.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ packageinfo.sh@1.328 +1 -1
+ NTP_4_2_7P325
+
+ scripts/invoke-ntp-wait.texi@1.131 +1 -1
+ NTP_4_2_7P325
+
+ scripts/ntp-wait.1ntp-waitman@1.142 +2 -2
+ NTP_4_2_7P325
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.142 +2 -2
+ NTP_4_2_7P325
+
+ scripts/ntp-wait.html@1.146 +1 -1
+ NTP_4_2_7P325
+
+ scripts/ntp-wait.man.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ scripts/ntp-wait.mdoc.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ sntp/invoke-sntp.texi@1.310 +2 -2
+ NTP_4_2_7P325
+
+ sntp/sntp-opts.c@1.325 +4 -4
+ NTP_4_2_7P325
+
+ sntp/sntp-opts.h@1.325 +3 -3
+ NTP_4_2_7P325
+
+ sntp/sntp.1sntpman@1.145 +2 -2
+ NTP_4_2_7P325
+
+ sntp/sntp.1sntpmdoc@1.145 +2 -2
+ NTP_4_2_7P325
+
+ sntp/sntp.html@1.325 +2 -2
+ NTP_4_2_7P325
+
+ sntp/sntp.man.in@1.145 +2 -2
+ NTP_4_2_7P325
+
+ sntp/sntp.mdoc.in@1.145 +2 -2
+ NTP_4_2_7P325
+
+ util/invoke-ntp-keygen.texi@1.314 +2 -2
+ NTP_4_2_7P325
+
+ util/ntp-keygen-opts.c@1.328 +4 -4
+ NTP_4_2_7P325
+
+ util/ntp-keygen-opts.h@1.328 +3 -3
+ NTP_4_2_7P325
+
+ util/ntp-keygen.1ntp-keygenman@1.142 +2 -2
+ NTP_4_2_7P325
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.142 +2 -2
+ NTP_4_2_7P325
+
+ util/ntp-keygen.man.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ util/ntp-keygen.mdoc.in@1.142 +2 -2
+ NTP_4_2_7P325
+
+ChangeSet@1.2822.11.1, 2012-11-20 03:45:54-05:00, stenn@deacon.udel.edu
+ typo fix
+
+ html/leap.html@1.4 +1 -1
+ typo fix
+
+ChangeSet@1.2822.1.62, 2012-11-19 23:37:09-05:00, stenn@deacon.udel.edu
+ [Bug 2202] ntpq.html: there is no "acv" billboard
+
+ ChangeLog@1.1191.1.53 +1 -0
+ [Bug 2202] ntpq.html: there is no "acv" billboard
+
+ html/ntpq.html@1.46 +1 -1
+ [Bug 2202] ntpq.html: there is no "acv" billboard
+
+ChangeSet@1.2822.10.2, 2012-11-19 20:17:35-08:00, harlan@hms-mbp11.local
+ [Bug 2246] Clear sys_leap when voting says to disarm the leap
+
+ ChangeLog@1.1191.7.2 +1 -0
+ [Bug 2246] Clear sys_leap when voting says to disarm the leap
+
+ ntpd/ntp_proto.c@1.343 +1 -0
+ [Bug 2246] Clear sys_leap when voting says to disarm the leap
+
+ChangeSet@1.2822.10.1, 2012-11-19 18:44:38-08:00, harlan@hms-mbp11.local
+ [Bug 1214] 'proto: precision = ...' should be at INFO, not NOTICE
+
+ ChangeLog@1.1191.7.1 +1 -0
+ [Bug 1214] 'proto: precision = ...' should be at INFO, not NOTICE
+
+ ntpd/ntp_proto.c@1.342 +1 -1
+ [Bug 1214] 'proto: precision = ...' should be at INFO, not NOTICE
+
+ChangeSet@1.2822.1.61, 2012-11-19 19:38:43+01:00, jnperlin@armageddon.
+ [Bug 2306] Keep pps hack for Win32 even if user-mode/loopback PPS API is activated on a serial line.
+
+ ChangeLog@1.1191.1.52 +2 -0
+ [Bug 2306] Keep pps hack for Win32 even if user-mode/loopback PPS API is activated on a serial line.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.68 +10 -1
+ [Bug 2306] Keep pps hack for Win32 even if user-mode/loopback PPS API is activated on a serial line.
+
+ChangeSet@1.2822.1.60, 2012-11-19 12:05:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P324
+ TAG: NTP_4_2_7P324
+
+ ChangeLog@1.1191.1.51 +1 -0
+ NTP_4_2_7P324
+
+ ntpd/invoke-ntpd.texi@1.313 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.conf.5man@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.conf.5mdoc@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.conf.man.in@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.conf.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.keys.5man@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.keys.5mdoc@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.keys.man.in@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntp.keys.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntpd-opts.c@1.331 +4 -4
+ NTP_4_2_7P324
+
+ ntpd/ntpd-opts.h@1.331 +3 -3
+ NTP_4_2_7P324
+
+ ntpd/ntpd.1ntpdman@1.142 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntpd.1ntpdmdoc@1.142 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntpd.man.in@1.142 +2 -2
+ NTP_4_2_7P324
+
+ ntpd/ntpd.mdoc.in@1.142 +2 -2
+ NTP_4_2_7P324
+
+ ntpdc/invoke-ntpdc.texi@1.310 +2 -2
+ NTP_4_2_7P324
+
+ ntpdc/ntpdc-opts.c@1.325 +4 -4
+ NTP_4_2_7P324
+
+ ntpdc/ntpdc-opts.h@1.325 +3 -3
+ NTP_4_2_7P324
+
+ ntpdc/ntpdc.1ntpdcman@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpdc/ntpdc.html@1.153 +2 -2
+ NTP_4_2_7P324
+
+ ntpdc/ntpdc.man.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpdc/ntpdc.mdoc.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpq/invoke-ntpq.texi@1.312 +2 -2
+ NTP_4_2_7P324
+
+ ntpq/ntpq-opts.c@1.327 +4 -4
+ NTP_4_2_7P324
+
+ ntpq/ntpq-opts.h@1.327 +3 -3
+ NTP_4_2_7P324
+
+ ntpq/ntpq.1ntpqman@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpq/ntpq.1ntpqmdoc@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpq/ntpq.man.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpq/ntpq.mdoc.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.312 +2 -2
+ NTP_4_2_7P324
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.327 +4 -4
+ NTP_4_2_7P324
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.327 +3 -3
+ NTP_4_2_7P324
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpsnmpd/ntpsnmpd.man.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ packageinfo.sh@1.327 +1 -1
+ NTP_4_2_7P324
+
+ scripts/invoke-ntp-wait.texi@1.130 +1 -1
+ NTP_4_2_7P324
+
+ scripts/ntp-wait.1ntp-waitman@1.141 +2 -2
+ NTP_4_2_7P324
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.141 +2 -2
+ NTP_4_2_7P324
+
+ scripts/ntp-wait.html@1.145 +1 -1
+ NTP_4_2_7P324
+
+ scripts/ntp-wait.man.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ scripts/ntp-wait.mdoc.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ sntp/invoke-sntp.texi@1.309 +2 -2
+ NTP_4_2_7P324
+
+ sntp/sntp-opts.c@1.324 +4 -4
+ NTP_4_2_7P324
+
+ sntp/sntp-opts.h@1.324 +3 -3
+ NTP_4_2_7P324
+
+ sntp/sntp.1sntpman@1.144 +2 -2
+ NTP_4_2_7P324
+
+ sntp/sntp.1sntpmdoc@1.144 +2 -2
+ NTP_4_2_7P324
+
+ sntp/sntp.html@1.324 +2 -2
+ NTP_4_2_7P324
+
+ sntp/sntp.man.in@1.144 +2 -2
+ NTP_4_2_7P324
+
+ sntp/sntp.mdoc.in@1.144 +2 -2
+ NTP_4_2_7P324
+
+ util/invoke-ntp-keygen.texi@1.313 +2 -2
+ NTP_4_2_7P324
+
+ util/ntp-keygen-opts.c@1.327 +4 -4
+ NTP_4_2_7P324
+
+ util/ntp-keygen-opts.h@1.327 +3 -3
+ NTP_4_2_7P324
+
+ util/ntp-keygen.1ntp-keygenman@1.141 +2 -2
+ NTP_4_2_7P324
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.141 +2 -2
+ NTP_4_2_7P324
+
+ util/ntp-keygen.man.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ util/ntp-keygen.mdoc.in@1.141 +2 -2
+ NTP_4_2_7P324
+
+ChangeSet@1.2822.1.59, 2012-11-19 02:49:32-08:00, harlan@hms-mbp11.local
+ [Bug 2098] Install DLM's HTML documentation
+
+ ChangeLog@1.1191.1.50 +1 -0
+ [Bug 2098] Install DLM's HTML documentation
+
+ Makefile.am@1.116 +7 -0
+ [Bug 2098] Install DLM's HTML documentation
+
+ configure.ac@1.554 +1 -1
+ [Bug 2098] Install DLM's HTML documentation
+
+ChangeSet@1.2822.1.58, 2012-11-19 02:32:45-05:00, stenn@deacon.udel.edu
+ Use "diff -u" when comparing complete.conf
+
+ ntpd/Makefile.am@1.124 +1 -1
+ Use "diff -u" when comparing complete.conf
+
+ChangeSet@1.2822.1.56, 2012-11-19 02:01:25-05:00, stenn@deacon.udel.edu
+ Reinstate change from Mike T. to authentic.html
+
+ ChangeLog@1.1191.1.48 +1 -0
+ Reinstate change from Mike T. to authentic.html
+
+ html/authentic.html@1.12 +2 -2
+ Reinstate change from Mike T. to authentic.html
+
+ChangeSet@1.2822.1.55, 2012-11-19 01:50:59-05:00, stenn@deacon.udel.edu
+ [Bug 1223] cleanup for rlimit changes
+
+ ChangeLog@1.1191.1.47 +1 -0
+ [Bug 1223] cleanup for rlimit changes
+
+ChangeSet@1.2822.9.1, 2012-11-18 12:58:00+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P323
+ TAG: NTP_4_2_7P323
+
+ ChangeLog@1.1191.1.46 +1 -0
+ NTP_4_2_7P323
+
+ ntpd/invoke-ntpd.texi@1.312 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.conf.5man@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.conf.5mdoc@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.conf.man.in@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.conf.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.keys.5man@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.keys.5mdoc@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.keys.man.in@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntp.keys.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntpd-opts.c@1.330 +4 -4
+ NTP_4_2_7P323
+
+ ntpd/ntpd-opts.h@1.330 +3 -3
+ NTP_4_2_7P323
+
+ ntpd/ntpd.1ntpdman@1.141 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntpd.1ntpdmdoc@1.141 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntpd.man.in@1.141 +2 -2
+ NTP_4_2_7P323
+
+ ntpd/ntpd.mdoc.in@1.141 +2 -2
+ NTP_4_2_7P323
+
+ ntpdc/invoke-ntpdc.texi@1.309 +2 -2
+ NTP_4_2_7P323
+
+ ntpdc/ntpdc-opts.c@1.324 +4 -4
+ NTP_4_2_7P323
+
+ ntpdc/ntpdc-opts.h@1.324 +3 -3
+ NTP_4_2_7P323
+
+ ntpdc/ntpdc.1ntpdcman@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpdc/ntpdc.html@1.152 +2 -2
+ NTP_4_2_7P323
+
+ ntpdc/ntpdc.man.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpdc/ntpdc.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpq/invoke-ntpq.texi@1.311 +2 -2
+ NTP_4_2_7P323
+
+ ntpq/ntpq-opts.c@1.326 +4 -4
+ NTP_4_2_7P323
+
+ ntpq/ntpq-opts.h@1.326 +3 -3
+ NTP_4_2_7P323
+
+ ntpq/ntpq.1ntpqman@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpq/ntpq.1ntpqmdoc@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpq/ntpq.man.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpq/ntpq.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.311 +2 -2
+ NTP_4_2_7P323
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.326 +4 -4
+ NTP_4_2_7P323
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.326 +3 -3
+ NTP_4_2_7P323
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpsnmpd/ntpsnmpd.man.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ packageinfo.sh@1.326 +1 -1
+ NTP_4_2_7P323
+
+ scripts/invoke-ntp-wait.texi@1.129 +111 -1
+ NTP_4_2_7P323
+
+ scripts/ntp-wait.1ntp-waitman@1.140 +2 -2
+ NTP_4_2_7P323
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.140 +2 -2
+ NTP_4_2_7P323
+
+ scripts/ntp-wait.html@1.144 +152 -4
+ NTP_4_2_7P323
+
+ scripts/ntp-wait.man.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ scripts/ntp-wait.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ sntp/invoke-sntp.texi@1.308 +2 -2
+ NTP_4_2_7P323
+
+ sntp/sntp-opts.c@1.323 +4 -4
+ NTP_4_2_7P323
+
+ sntp/sntp-opts.h@1.323 +3 -3
+ NTP_4_2_7P323
+
+ sntp/sntp.1sntpman@1.143 +2 -2
+ NTP_4_2_7P323
+
+ sntp/sntp.1sntpmdoc@1.143 +2 -2
+ NTP_4_2_7P323
+
+ sntp/sntp.html@1.323 +2 -2
+ NTP_4_2_7P323
+
+ sntp/sntp.man.in@1.143 +2 -2
+ NTP_4_2_7P323
+
+ sntp/sntp.mdoc.in@1.143 +2 -2
+ NTP_4_2_7P323
+
+ util/invoke-ntp-keygen.texi@1.312 +2 -2
+ NTP_4_2_7P323
+
+ util/ntp-keygen-opts.c@1.326 +4 -4
+ NTP_4_2_7P323
+
+ util/ntp-keygen-opts.h@1.326 +3 -3
+ NTP_4_2_7P323
+
+ util/ntp-keygen.1ntp-keygenman@1.140 +2 -2
+ NTP_4_2_7P323
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.140 +2 -2
+ NTP_4_2_7P323
+
+ util/ntp-keygen.man.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ util/ntp-keygen.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P323
+
+ChangeSet@1.2822.8.2, 2012-11-18 07:31:57-05:00, stenn@psp-deb1.ntp.org
+ added ntp_rlimit.m4
+
+ sntp/m4/ntp_rlimit.m4@1.1 +66 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/m4/ntp_rlimit.m4
+
+ sntp/m4/ntp_rlimit.m4@1.0 +0 -0
+
+ChangeSet@1.2822.8.1, 2012-11-18 12:15:14+00:00, stenn@psp-fb1.ntp.org
+ rlimit cleanup
+
+ configure.ac@1.553 +57 -54
+ rlimit cleanup
+
+ ntpd/Makefile.am@1.123 +6 -6
+ rlimit cleanup
+
+ ntpd/complete.conf.in@1.25 +1 -1
+ rlimit cleanup
+
+ ntpd/complete.conf.in@1.24, stenn@psp-deb1.ntp.org +0 -0
+ Rename: ntpd/complete.conf -> ntpd/complete.conf.in
+
+ ntpd/ntp_parser.c@1.83 +422 -418
+ rlimit cleanup
+
+ ntpd/ntp_parser.h@1.49 +6 -7
+ rlimit cleanup
+
+ ntpd/ntp_parser.y@1.77 +1 -1
+ rlimit cleanup
+
+ChangeSet@1.2822.7.1, 2012-11-18 12:15:34+01:00, jnperlin@armageddon.
+ [Bug 2306] Added user-mode/loop-back PPS API provider for Win32
+
+ ChangeLog@1.1191.6.1 +1 -0
+ [Bug 2306] Added user-mode/loop-back PPS API provider for Win32
+
+ include/ntp_refclock.h@1.36 +4 -0
+ [Bug 2306](user-mode PPS API) add device context handle for Win32
+
+ ports/winnt/include/ntp_iocompletionport.h@1.20 +1 -0
+ [Bug 2306](user-mode PPS API) support clean removal of clocks
+
+ ports/winnt/include/termios.h@1.16 +1 -0
+ [Bug 2306](user-mode PPS API) check for DUPs of serial line device handles
+
+ ports/winnt/libntp/termios.c@1.28 +18 -0
+ [Bug 2306](user-mode PPS API) check for DUPs of serial line device handles
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.67 +383 -64
+ [Bug 2306](user-mode PPS API) provide wiring and lock-free buffers for data exchange with loop-back PPS API
+
+ ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h@1.1 +714 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h@1.0 +0 -0
+
+ ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt@1.1 +52 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt@1.0 +0 -0
+
+ ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c@1.1 +465 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c@1.0 +0 -0
+
+ ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def@1.1 +9 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def@1.0 +0 -0
+
+ ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h@1.1 +49 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h@1.0 +0 -0
+
+ ports/winnt/ppsapi/loopback/src/sys/time.h@1.1 +18 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/ppsapi/loopback/src/sys/time.h@1.0 +0 -0
+
+ ports/winnt/ppsapi/loopback/src/timepps.h@1.1 +805 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/ppsapi/loopback/src/timepps.h@1.0 +0 -0
+
+ ports/winnt/vs2008/instsrv/instsrv.vcproj@1.6 +25 -20
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.47 +18 -17
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj@1.1 +256 -0
+ [Bug 2306](user-mode PPS API) PPS-API implementation
+
+ ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.14 +25 -21
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ ports/winnt/vs2008/ntp.sln@1.10 +9 -0
+ [Bug 2306](user-mode PPS API) add DLL project
+
+ ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj@1.2 +19 -9
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.45 +25 -24
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.14 +26 -21
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.16 +26 -21
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.15 +26 -21
+ [Bug 2306](user-mode PPS API) cleanup of build process
+
+ChangeSet@1.2822.1.50, 2012-11-18 03:37:42-05:00, stenn@psp-deb1.ntp.org
+ RLIMIT header cleanup
+
+ ntpd/ntp_config.c@1.308 +3 -0
+ RLIMIT header cleanup
+
+ ntpd/ntpd.c@1.139 +0 -3
+ RLIMIT header cleanup
+
+ChangeSet@1.2822.6.1, 2012-11-15 11:21:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P322
+ TAG: NTP_4_2_7P322
+
+ ChangeLog@1.1191.5.1 +1 -0
+ NTP_4_2_7P322
+
+ ntpd/invoke-ntpd.texi@1.311 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.conf.5man@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.conf.5mdoc@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.conf.man.in@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.conf.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.keys.5man@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.keys.5mdoc@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.keys.man.in@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntp.keys.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntpd-opts.c@1.329 +4 -4
+ NTP_4_2_7P322
+
+ ntpd/ntpd-opts.h@1.329 +3 -3
+ NTP_4_2_7P322
+
+ ntpd/ntpd.1ntpdman@1.140 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntpd.1ntpdmdoc@1.140 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntpd.man.in@1.140 +2 -2
+ NTP_4_2_7P322
+
+ ntpd/ntpd.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P322
+
+ ntpdc/invoke-ntpdc.texi@1.308 +2 -2
+ NTP_4_2_7P322
+
+ ntpdc/ntpdc-opts.c@1.323 +4 -4
+ NTP_4_2_7P322
+
+ ntpdc/ntpdc-opts.h@1.323 +3 -3
+ NTP_4_2_7P322
+
+ ntpdc/ntpdc.1ntpdcman@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpdc/ntpdc.html@1.151 +2 -2
+ NTP_4_2_7P322
+
+ ntpdc/ntpdc.man.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpdc/ntpdc.mdoc.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpq/invoke-ntpq.texi@1.310 +2 -2
+ NTP_4_2_7P322
+
+ ntpq/ntpq-opts.c@1.325 +4 -4
+ NTP_4_2_7P322
+
+ ntpq/ntpq-opts.h@1.325 +3 -3
+ NTP_4_2_7P322
+
+ ntpq/ntpq.1ntpqman@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpq/ntpq.1ntpqmdoc@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpq/ntpq.man.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpq/ntpq.mdoc.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.310 +2 -2
+ NTP_4_2_7P322
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.325 +4 -4
+ NTP_4_2_7P322
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.325 +3 -3
+ NTP_4_2_7P322
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpsnmpd/ntpsnmpd.man.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ packageinfo.sh@1.325 +1 -1
+ NTP_4_2_7P322
+
+ scripts/invoke-ntp-wait.texi@1.128 +1 -111
+ NTP_4_2_7P322
+
+ scripts/ntp-wait.1ntp-waitman@1.139 +2 -2
+ NTP_4_2_7P322
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.139 +2 -2
+ NTP_4_2_7P322
+
+ scripts/ntp-wait.html@1.143 +4 -152
+ NTP_4_2_7P322
+
+ scripts/ntp-wait.man.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ scripts/ntp-wait.mdoc.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ sntp/invoke-sntp.texi@1.307 +2 -2
+ NTP_4_2_7P322
+
+ sntp/sntp-opts.c@1.322 +4 -4
+ NTP_4_2_7P322
+
+ sntp/sntp-opts.h@1.322 +3 -3
+ NTP_4_2_7P322
+
+ sntp/sntp.1sntpman@1.142 +2 -2
+ NTP_4_2_7P322
+
+ sntp/sntp.1sntpmdoc@1.142 +2 -2
+ NTP_4_2_7P322
+
+ sntp/sntp.html@1.322 +2 -2
+ NTP_4_2_7P322
+
+ sntp/sntp.man.in@1.142 +2 -2
+ NTP_4_2_7P322
+
+ sntp/sntp.mdoc.in@1.142 +2 -2
+ NTP_4_2_7P322
+
+ util/invoke-ntp-keygen.texi@1.311 +2 -2
+ NTP_4_2_7P322
+
+ util/ntp-keygen-opts.c@1.325 +4 -4
+ NTP_4_2_7P322
+
+ util/ntp-keygen-opts.h@1.325 +3 -3
+ NTP_4_2_7P322
+
+ util/ntp-keygen.1ntp-keygenman@1.139 +2 -2
+ NTP_4_2_7P322
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.139 +2 -2
+ NTP_4_2_7P322
+
+ util/ntp-keygen.man.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ util/ntp-keygen.mdoc.in@1.139 +2 -2
+ NTP_4_2_7P322
+
+ChangeSet@1.2822.1.49, 2012-11-15 04:10:48-05:00, stenn@deacon.udel.edu
+ html/ updates from Dave Mills
+
+ ChangeLog@1.1191.1.44 +1 -0
+ html/ updates from Dave Mills
+
+ html/stats.html@1.1 +70 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/stats.html
+
+ html/stats.html@1.0 +0 -0
+
+ChangeSet@1.2822.5.1, 2012-11-14 22:58:44-08:00, harlan@hms-mbp11.local
+ Documentation updates from Dave Mills.
+
+ html/authentic.html@1.11 +2 -2
+ Updates from Dave Mills
+
+ html/cluster.html@1.8 +7 -7
+ Updates from Dave Mills
+
+ html/discipline.html@1.8 +14 -6
+ Updates from Dave Mills
+
+ html/drivers/driver18.html@1.17.1.1 +3 -3
+ Updates from Dave Mills
+
+ html/drivers/driver20.html@1.26 +1 -1
+ Updates from Dave Mills
+
+ html/drivers/driver36.html@1.34 +6 -6
+ Updates from Dave Mills
+
+ html/drivers/driver6.html@1.28 +3 -3
+ Updates from Dave Mills
+
+ html/drivers/driver7.html@1.29 +2 -2
+ Updates from Dave Mills
+
+ html/filter.html@1.6 +7 -5
+ Updates from Dave Mills
+
+ html/huffpuff.html@1.4 +3 -3
+ Updates from Dave Mills
+
+ html/kern.html@1.20 +1 -1
+ Updates from Dave Mills
+
+ html/leap.html@1.1.1.1 +2 -2
+ Updates from Dave Mills
+
+ html/poll.html@1.3 +10 -8
+ Updates from Dave Mills
+
+ html/pps.html@1.24 +1 -1
+ Updates from Dave Mills
+
+ html/prefer.html@1.31 +30 -29
+ Updates from Dave Mills
+
+ html/quick.html@1.23 +3 -3
+ Updates from Dave Mills
+
+ html/rate.html@1.11 +8 -8
+ Updates from Dave Mills
+
+ html/refclock.html@1.37 +1 -0
+ Updates from Dave Mills
+
+ html/scripts/external.txt@1.6 +1 -0
+ Updates from Dave Mills
+
+ html/scripts/special.txt@1.7 +1 -1
+ Updates from Dave Mills
+
+ html/select.html@1.8 +8 -8
+ Updates from Dave Mills
+
+ html/warp.html@1.22 +27 -39
+ Updates from Dave Mills
+
+ html/xleave.html@1.8 +3 -4
+ Updates from Dave Mills
+
+ChangeSet@1.2822.1.47, 2012-11-14 05:53:00-05:00, stenn@psp-deb1.ntp.org
+ [Bug 2123] cleanup to html/leap.html
+
+ ChangeLog@1.1191.1.43 +1 -0
+ [Bug 2123] cleanup to html/leap.html
+
+ html/leap.html@1.2 +5 -5
+ [Bug 2123] cleanup to html/leap.html
+
+ChangeSet@1.2822.1.46, 2012-11-14 05:07:30-05:00, stenn@deacon.udel.edu
+ for the setrlimit() stuff, use INSIST(), not ASSERT()
+
+ ntpd/ntp_config.c@1.307 +1 -1
+ for the setrlimit() stuff, use INSIST(), not ASSERT()
+
+ChangeSet@1.2822.1.45, 2012-11-14 01:35:24-08:00, harlan@hms-mbp11.local
+ [Bug 2120] no sysexits.h under QNX
+
+ ChangeLog@1.1191.1.42 +1 -0
+ [Bug 2120] no sysexits.h under QNX
+
+ sntp/configure.ac@1.72 +1 -0
+ [Bug 2120] no sysexits.h under QNX
+
+ sntp/m4/ntp_sysexits.m4@1.1 +11 -0
+ BitKeeper file /Users/harlan/src/ntp-dev/sntp/m4/ntp_sysexits.m4
+
+ sntp/m4/ntp_sysexits.m4@1.0 +0 -0
+
+ChangeSet@1.2822.1.44, 2012-11-14 02:38:45-05:00, stenn@psp-deb1.ntp.org
+ Cleanup for bug 1223 - rlimit() updates
+
+ include/ntp_config.h@1.78 +1 -1
+ Cleanup for bug 1223 - rlimit() updates
+
+ ntpd/ntp_config.c@1.306 +38 -18
+ Cleanup for bug 1223 - rlimit() updates
+
+ChangeSet@1.2822.1.43, 2012-11-13 19:27:23-05:00, stenn@psp-deb1.ntp.org
+ Bug 1223 cleanup
+
+ include/ntp_config.h@1.77 +1 -3
+ Bug 1223 cleanup
+
+ ntpd/complete.conf@1.23 +1 -0
+ Bug 1223 cleanup
+
+ ntpd/ntp_config.c@1.305 +68 -66
+ Bug 1223 cleanup
+
+ ntpd/ntpd.c@1.138 +3 -3
+ Bug 1223 cleanup
+
+ChangeSet@1.2822.4.5, 2012-11-13 18:50:25-05:00, stenn@deacon.udel.edu
+ More cleanup of fix for Bug 1320
+
+ ntpd/ntpd.c@1.134.1.3 +8 -4
+ More cleanup of fix for Bug 1320
+
+ChangeSet@1.2822.4.4, 2012-11-13 17:49:10-05:00, stenn@deacon.udel.edu
+ [Bug 1320] Log ntpd's initial command-line parameters - updated fix
+
+ ChangeLog@1.1191.4.4 +1 -0
+ [Bug 1320] Log ntpd's initial command-line parameters - updated fix
+
+ ntpd/ntpd.c@1.134.1.2 +1 -1
+ [Bug 1320] Log ntpd's initial command-line parameters - updated fix
+
+ChangeSet@1.2822.4.3, 2012-11-13 11:33:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P321
+ TAG: NTP_4_2_7P321
+
+ ChangeLog@1.1191.4.3 +1 -0
+ NTP_4_2_7P321
+
+ ntpd/invoke-ntpd.texi@1.310 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.conf.5man@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.conf.5mdoc@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.conf.man.in@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.conf.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.keys.5man@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.keys.5mdoc@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.keys.man.in@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntp.keys.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntpd-opts.c@1.328 +4 -4
+ NTP_4_2_7P321
+
+ ntpd/ntpd-opts.h@1.328 +3 -3
+ NTP_4_2_7P321
+
+ ntpd/ntpd.1ntpdman@1.139 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntpd.1ntpdmdoc@1.139 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntpd.man.in@1.139 +2 -2
+ NTP_4_2_7P321
+
+ ntpd/ntpd.mdoc.in@1.139 +2 -2
+ NTP_4_2_7P321
+
+ ntpdc/invoke-ntpdc.texi@1.307 +2 -2
+ NTP_4_2_7P321
+
+ ntpdc/ntpdc-opts.c@1.322 +4 -4
+ NTP_4_2_7P321
+
+ ntpdc/ntpdc-opts.h@1.322 +3 -3
+ NTP_4_2_7P321
+
+ ntpdc/ntpdc.1ntpdcman@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpdc/ntpdc.html@1.150 +2 -2
+ NTP_4_2_7P321
+
+ ntpdc/ntpdc.man.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpdc/ntpdc.mdoc.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpq/invoke-ntpq.texi@1.309 +2 -2
+ NTP_4_2_7P321
+
+ ntpq/ntpq-opts.c@1.324 +4 -4
+ NTP_4_2_7P321
+
+ ntpq/ntpq-opts.h@1.324 +3 -3
+ NTP_4_2_7P321
+
+ ntpq/ntpq.1ntpqman@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpq/ntpq.1ntpqmdoc@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpq/ntpq.man.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpq/ntpq.mdoc.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.309 +2 -2
+ NTP_4_2_7P321
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.324 +4 -4
+ NTP_4_2_7P321
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.324 +3 -3
+ NTP_4_2_7P321
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpsnmpd/ntpsnmpd.man.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ packageinfo.sh@1.324 +1 -1
+ NTP_4_2_7P321
+
+ scripts/invoke-ntp-wait.texi@1.127 +1 -1
+ NTP_4_2_7P321
+
+ scripts/ntp-wait.1ntp-waitman@1.138 +2 -2
+ NTP_4_2_7P321
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.138 +2 -2
+ NTP_4_2_7P321
+
+ scripts/ntp-wait.html@1.142 +1 -1
+ NTP_4_2_7P321
+
+ scripts/ntp-wait.man.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ scripts/ntp-wait.mdoc.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ sntp/invoke-sntp.texi@1.306 +2 -2
+ NTP_4_2_7P321
+
+ sntp/sntp-opts.c@1.321 +4 -4
+ NTP_4_2_7P321
+
+ sntp/sntp-opts.h@1.321 +3 -3
+ NTP_4_2_7P321
+
+ sntp/sntp.1sntpman@1.141 +2 -2
+ NTP_4_2_7P321
+
+ sntp/sntp.1sntpmdoc@1.141 +2 -2
+ NTP_4_2_7P321
+
+ sntp/sntp.html@1.321 +2 -2
+ NTP_4_2_7P321
+
+ sntp/sntp.man.in@1.141 +2 -2
+ NTP_4_2_7P321
+
+ sntp/sntp.mdoc.in@1.141 +2 -2
+ NTP_4_2_7P321
+
+ util/invoke-ntp-keygen.texi@1.310 +2 -2
+ NTP_4_2_7P321
+
+ util/ntp-keygen-opts.c@1.324 +4 -4
+ NTP_4_2_7P321
+
+ util/ntp-keygen-opts.h@1.324 +3 -3
+ NTP_4_2_7P321
+
+ util/ntp-keygen.1ntp-keygenman@1.138 +2 -2
+ NTP_4_2_7P321
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.138 +2 -2
+ NTP_4_2_7P321
+
+ util/ntp-keygen.man.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ util/ntp-keygen.mdoc.in@1.138 +2 -2
+ NTP_4_2_7P321
+
+ChangeSet@1.2822.4.2, 2012-11-13 03:59:29-05:00, stenn@psp-deb1.ntp.org
+ Fix typo: [Bug 1320] Log ntpd's initial command-line parameters
+
+ ChangeLog@1.1191.4.2 +1 -1
+ Fix typo: [Bug 1320] Log ntpd's initial command-line parameters
+
+ChangeSet@1.2822.4.1, 2012-11-13 03:57:34-05:00, stenn@psp-deb1.ntp.org
+ [Bug 1320] Log ntpd's initial command-line paprameters
+
+ ChangeLog@1.1191.4.1 +1 -0
+ [Bug 1320] Log ntpd's initial command-line paprameters
+
+ ntpd/ntpd.c@1.134.1.1 +18 -0
+ [Bug 1320] Log ntpd's initial command-line paprameters
+
+ChangeSet@1.2822.1.40, 2012-11-12 22:56:50-05:00, stenn@psp-deb1.ntp.org
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ChangeLog@1.1191.1.39 +2 -0
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ configure.ac@1.552 +54 -0
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ html/miscopt.html@1.70 +10 -0
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ include/ntp_config.h@1.76 +6 -0
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/keyword-gen-utd@1.19 +1 -1
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/keyword-gen.c@1.24 +4 -0
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/ntp_config.c@1.304 +124 -15
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/ntp_keyword.h@1.21 +584 -566
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/ntp_parser.c@1.82 +1181 -1138
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/ntp_parser.h@1.48 +201 -194
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/ntp_parser.y@1.76 +48 -1
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ ntpd/ntpd.c@1.135 +2 -18
+ [Bug 1223] Allow configurable values for RLIMIT_STACK and RLIMIT_MEMLOCK
+
+ChangeSet@1.2822.1.39, 2012-11-12 11:34:28+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P320
+ TAG: NTP_4_2_7P320
+
+ ChangeLog@1.1191.1.38 +1 -0
+ NTP_4_2_7P320
+
+ ntpd/invoke-ntpd.texi@1.309 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.conf.5man@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.conf.5mdoc@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.conf.man.in@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.conf.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.keys.5man@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.keys.5mdoc@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.keys.man.in@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntp.keys.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntpd-opts.c@1.327 +4 -4
+ NTP_4_2_7P320
+
+ ntpd/ntpd-opts.h@1.327 +3 -3
+ NTP_4_2_7P320
+
+ ntpd/ntpd.1ntpdman@1.138 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntpd.1ntpdmdoc@1.138 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntpd.man.in@1.138 +2 -2
+ NTP_4_2_7P320
+
+ ntpd/ntpd.mdoc.in@1.138 +2 -2
+ NTP_4_2_7P320
+
+ ntpdc/invoke-ntpdc.texi@1.306 +2 -2
+ NTP_4_2_7P320
+
+ ntpdc/ntpdc-opts.c@1.321 +4 -4
+ NTP_4_2_7P320
+
+ ntpdc/ntpdc-opts.h@1.321 +3 -3
+ NTP_4_2_7P320
+
+ ntpdc/ntpdc.1ntpdcman@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpdc/ntpdc.html@1.149 +2 -2
+ NTP_4_2_7P320
+
+ ntpdc/ntpdc.man.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpdc/ntpdc.mdoc.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpq/invoke-ntpq.texi@1.308 +2 -2
+ NTP_4_2_7P320
+
+ ntpq/ntpq-opts.c@1.323 +4 -4
+ NTP_4_2_7P320
+
+ ntpq/ntpq-opts.h@1.323 +3 -3
+ NTP_4_2_7P320
+
+ ntpq/ntpq.1ntpqman@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpq/ntpq.1ntpqmdoc@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpq/ntpq.man.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpq/ntpq.mdoc.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.308 +2 -2
+ NTP_4_2_7P320
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.323 +4 -4
+ NTP_4_2_7P320
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.323 +3 -3
+ NTP_4_2_7P320
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpsnmpd/ntpsnmpd.man.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ packageinfo.sh@1.323 +1 -1
+ NTP_4_2_7P320
+
+ scripts/invoke-ntp-wait.texi@1.126 +1 -1
+ NTP_4_2_7P320
+
+ scripts/ntp-wait.1ntp-waitman@1.137 +2 -2
+ NTP_4_2_7P320
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.137 +2 -2
+ NTP_4_2_7P320
+
+ scripts/ntp-wait.html@1.141 +1 -1
+ NTP_4_2_7P320
+
+ scripts/ntp-wait.man.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ scripts/ntp-wait.mdoc.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ sntp/invoke-sntp.texi@1.305 +2 -2
+ NTP_4_2_7P320
+
+ sntp/sntp-opts.c@1.320 +4 -4
+ NTP_4_2_7P320
+
+ sntp/sntp-opts.h@1.320 +3 -3
+ NTP_4_2_7P320
+
+ sntp/sntp.1sntpman@1.140 +2 -2
+ NTP_4_2_7P320
+
+ sntp/sntp.1sntpmdoc@1.140 +2 -2
+ NTP_4_2_7P320
+
+ sntp/sntp.html@1.320 +2 -2
+ NTP_4_2_7P320
+
+ sntp/sntp.man.in@1.140 +2 -2
+ NTP_4_2_7P320
+
+ sntp/sntp.mdoc.in@1.140 +2 -2
+ NTP_4_2_7P320
+
+ util/invoke-ntp-keygen.texi@1.309 +2 -2
+ NTP_4_2_7P320
+
+ util/ntp-keygen-opts.c@1.323 +4 -4
+ NTP_4_2_7P320
+
+ util/ntp-keygen-opts.h@1.323 +3 -3
+ NTP_4_2_7P320
+
+ util/ntp-keygen.1ntp-keygenman@1.137 +2 -2
+ NTP_4_2_7P320
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.137 +2 -2
+ NTP_4_2_7P320
+
+ util/ntp-keygen.man.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ util/ntp-keygen.mdoc.in@1.137 +2 -2
+ NTP_4_2_7P320
+
+ChangeSet@1.2822.1.38, 2012-11-12 00:58:20-05:00, stenn@deacon.udel.edu
+ [Bug 1217] libisc/ifiter_sysctl.c:internal_current(): Ignore RTM messages with wrong version
+
+ ChangeLog@1.1191.1.37 +2 -0
+ [Bug 1217] libisc/ifiter_sysctl.c:internal_current(): Ignore RTM messages with wrong version
+
+ lib/isc/unix/ifiter_sysctl.c@1.18 +4 -0
+ [Bug 1217] libisc/ifiter_sysctl.c:internal_current(): Ignore RTM messages with wrong version
+
+ChangeSet@1.2822.1.37, 2012-11-11 20:09:21-05:00, stenn@psp-deb1.ntp.org
+ [Bug 969] Clarify ntpdate.html documentation about -u and ntpd
+
+ ChangeLog@1.1191.1.36 +1 -0
+ [Bug 969] Clarify ntpdate.html documentation about -u and ntpd
+
+ html/ntpdate.html@1.22 +1 -1
+ [Bug 969] Clarify ntpdate.html documentation about -u and ntpd
+
+ChangeSet@1.2822.1.36, 2012-11-11 11:38:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P319
+ TAG: NTP_4_2_7P319
+
+ ChangeLog@1.1191.1.35 +1 -0
+ NTP_4_2_7P319
+
+ ntpd/invoke-ntpd.texi@1.308 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.conf.5man@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.conf.5mdoc@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.conf.man.in@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.conf.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.keys.5man@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.keys.5mdoc@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.keys.man.in@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntp.keys.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntpd-opts.c@1.326 +4 -4
+ NTP_4_2_7P319
+
+ ntpd/ntpd-opts.h@1.326 +3 -3
+ NTP_4_2_7P319
+
+ ntpd/ntpd.1ntpdman@1.137 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntpd.1ntpdmdoc@1.137 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntpd.man.in@1.137 +2 -2
+ NTP_4_2_7P319
+
+ ntpd/ntpd.mdoc.in@1.137 +2 -2
+ NTP_4_2_7P319
+
+ ntpdc/invoke-ntpdc.texi@1.305 +2 -2
+ NTP_4_2_7P319
+
+ ntpdc/ntpdc-opts.c@1.320 +4 -4
+ NTP_4_2_7P319
+
+ ntpdc/ntpdc-opts.h@1.320 +3 -3
+ NTP_4_2_7P319
+
+ ntpdc/ntpdc.1ntpdcman@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpdc/ntpdc.html@1.148 +2 -2
+ NTP_4_2_7P319
+
+ ntpdc/ntpdc.man.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpdc/ntpdc.mdoc.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpq/invoke-ntpq.texi@1.307 +2 -2
+ NTP_4_2_7P319
+
+ ntpq/ntpq-opts.c@1.322 +4 -4
+ NTP_4_2_7P319
+
+ ntpq/ntpq-opts.h@1.322 +3 -3
+ NTP_4_2_7P319
+
+ ntpq/ntpq.1ntpqman@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpq/ntpq.1ntpqmdoc@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpq/ntpq.man.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpq/ntpq.mdoc.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.307 +2 -2
+ NTP_4_2_7P319
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.322 +4 -4
+ NTP_4_2_7P319
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.322 +3 -3
+ NTP_4_2_7P319
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpsnmpd/ntpsnmpd.man.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ packageinfo.sh@1.322 +1 -1
+ NTP_4_2_7P319
+
+ scripts/invoke-ntp-wait.texi@1.125 +1 -1
+ NTP_4_2_7P319
+
+ scripts/ntp-wait.1ntp-waitman@1.136 +2 -2
+ NTP_4_2_7P319
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.136 +2 -2
+ NTP_4_2_7P319
+
+ scripts/ntp-wait.html@1.140 +1 -1
+ NTP_4_2_7P319
+
+ scripts/ntp-wait.man.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ scripts/ntp-wait.mdoc.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ sntp/invoke-sntp.texi@1.304 +2 -2
+ NTP_4_2_7P319
+
+ sntp/sntp-opts.c@1.319 +4 -4
+ NTP_4_2_7P319
+
+ sntp/sntp-opts.h@1.319 +3 -3
+ NTP_4_2_7P319
+
+ sntp/sntp.1sntpman@1.139 +2 -2
+ NTP_4_2_7P319
+
+ sntp/sntp.1sntpmdoc@1.139 +2 -2
+ NTP_4_2_7P319
+
+ sntp/sntp.html@1.319 +2 -2
+ NTP_4_2_7P319
+
+ sntp/sntp.man.in@1.139 +2 -2
+ NTP_4_2_7P319
+
+ sntp/sntp.mdoc.in@1.139 +2 -2
+ NTP_4_2_7P319
+
+ util/invoke-ntp-keygen.texi@1.308 +2 -2
+ NTP_4_2_7P319
+
+ util/ntp-keygen-opts.c@1.322 +4 -4
+ NTP_4_2_7P319
+
+ util/ntp-keygen-opts.h@1.322 +3 -3
+ NTP_4_2_7P319
+
+ util/ntp-keygen.1ntp-keygenman@1.136 +2 -2
+ NTP_4_2_7P319
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.136 +2 -2
+ NTP_4_2_7P319
+
+ util/ntp-keygen.man.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ util/ntp-keygen.mdoc.in@1.136 +2 -2
+ NTP_4_2_7P319
+
+ChangeSet@1.2822.1.35, 2012-11-11 03:49:15-05:00, stenn@deacon.udel.edu
+ [Bug 2296] Fix compile problem with building with old OpenSSL
+
+ ChangeLog@1.1191.1.34 +1 -0
+ [Bug 2296] Fix compile problem with building with old OpenSSL
+
+ libntp/a_md5encrypt.c@1.34 +14 -0
+ [Bug 2296] Fix compile problem with building with old OpenSSL
+
+ChangeSet@1.2822.1.34, 2012-11-05 11:28:16+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P318
+ TAG: NTP_4_2_7P318
+
+ ChangeLog@1.1191.1.33 +1 -0
+ NTP_4_2_7P318
+
+ ntpd/invoke-ntpd.texi@1.307 +2 -2
+ NTP_4_2_7P318
+
+ ntpd/ntp.conf.5man@1.24 +2 -2
+ NTP_4_2_7P318
+
+ ntpd/ntp.conf.5mdoc@1.24 +1 -1
+ NTP_4_2_7P318
+
+ ntpd/ntp.conf.man.in@1.24 +2 -2
+ NTP_4_2_7P318
+
+ ntpd/ntp.conf.mdoc.in@1.24 +1 -1
+ NTP_4_2_7P318
+
+ ntpd/ntp.keys.5man@1.24 +2 -2
+ NTP_4_2_7P318
+
+ ntpd/ntp.keys.5mdoc@1.24 +1 -1
+ NTP_4_2_7P318
+
+ ntpd/ntp.keys.man.in@1.24 +2 -2
+ NTP_4_2_7P318
+
+ ntpd/ntp.keys.mdoc.in@1.24 +1 -1
+ NTP_4_2_7P318
+
+ ntpd/ntpd-opts.c@1.325 +4 -4
+ NTP_4_2_7P318
+
+ ntpd/ntpd-opts.h@1.325 +3 -3
+ NTP_4_2_7P318
+
+ ntpd/ntpd.1ntpdman@1.136 +2 -2
+ NTP_4_2_7P318
+
+ ntpd/ntpd.1ntpdmdoc@1.136 +1 -1
+ NTP_4_2_7P318
+
+ ntpd/ntpd.man.in@1.136 +2 -2
+ NTP_4_2_7P318
+
+ ntpd/ntpd.mdoc.in@1.136 +1 -1
+ NTP_4_2_7P318
+
+ ntpdc/invoke-ntpdc.texi@1.304 +2 -2
+ NTP_4_2_7P318
+
+ ntpdc/ntpdc-opts.c@1.319 +4 -4
+ NTP_4_2_7P318
+
+ ntpdc/ntpdc-opts.h@1.319 +3 -3
+ NTP_4_2_7P318
+
+ ntpdc/ntpdc.1ntpdcman@1.135 +2 -2
+ NTP_4_2_7P318
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.135 +1 -1
+ NTP_4_2_7P318
+
+ ntpdc/ntpdc.html@1.147 +2 -2
+ NTP_4_2_7P318
+
+ ntpdc/ntpdc.man.in@1.135 +2 -2
+ NTP_4_2_7P318
+
+ ntpdc/ntpdc.mdoc.in@1.135 +1 -1
+ NTP_4_2_7P318
+
+ ntpq/invoke-ntpq.texi@1.306 +2 -2
+ NTP_4_2_7P318
+
+ ntpq/ntpq-opts.c@1.321 +4 -4
+ NTP_4_2_7P318
+
+ ntpq/ntpq-opts.h@1.321 +3 -3
+ NTP_4_2_7P318
+
+ ntpq/ntpq.1ntpqman@1.135 +2 -2
+ NTP_4_2_7P318
+
+ ntpq/ntpq.1ntpqmdoc@1.135 +1 -1
+ NTP_4_2_7P318
+
+ ntpq/ntpq.man.in@1.135 +2 -2
+ NTP_4_2_7P318
+
+ ntpq/ntpq.mdoc.in@1.135 +1 -1
+ NTP_4_2_7P318
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.306 +2 -2
+ NTP_4_2_7P318
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.321 +4 -4
+ NTP_4_2_7P318
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.321 +3 -3
+ NTP_4_2_7P318
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.135 +2 -2
+ NTP_4_2_7P318
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.135 +1 -1
+ NTP_4_2_7P318
+
+ ntpsnmpd/ntpsnmpd.man.in@1.135 +2 -2
+ NTP_4_2_7P318
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.135 +1 -1
+ NTP_4_2_7P318
+
+ packageinfo.sh@1.321 +1 -1
+ NTP_4_2_7P318
+
+ scripts/invoke-ntp-wait.texi@1.124 +1 -1
+ NTP_4_2_7P318
+
+ scripts/ntp-wait.1ntp-waitman@1.135 +2 -2
+ NTP_4_2_7P318
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.135 +1 -1
+ NTP_4_2_7P318
+
+ scripts/ntp-wait.html@1.139 +1 -1
+ NTP_4_2_7P318
+
+ scripts/ntp-wait.man.in@1.135 +2 -2
+ NTP_4_2_7P318
+
+ scripts/ntp-wait.mdoc.in@1.135 +1 -1
+ NTP_4_2_7P318
+
+ sntp/invoke-sntp.texi@1.303 +2 -2
+ NTP_4_2_7P318
+
+ sntp/sntp-opts.c@1.318 +4 -4
+ NTP_4_2_7P318
+
+ sntp/sntp-opts.h@1.318 +3 -3
+ NTP_4_2_7P318
+
+ sntp/sntp.1sntpman@1.138 +2 -2
+ NTP_4_2_7P318
+
+ sntp/sntp.1sntpmdoc@1.138 +1 -1
+ NTP_4_2_7P318
+
+ sntp/sntp.html@1.318 +2 -2
+ NTP_4_2_7P318
+
+ sntp/sntp.man.in@1.138 +2 -2
+ NTP_4_2_7P318
+
+ sntp/sntp.mdoc.in@1.138 +1 -1
+ NTP_4_2_7P318
+
+ util/invoke-ntp-keygen.texi@1.307 +2 -2
+ NTP_4_2_7P318
+
+ util/ntp-keygen-opts.c@1.321 +4 -4
+ NTP_4_2_7P318
+
+ util/ntp-keygen-opts.h@1.321 +3 -3
+ NTP_4_2_7P318
+
+ util/ntp-keygen.1ntp-keygenman@1.135 +2 -2
+ NTP_4_2_7P318
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.135 +1 -1
+ NTP_4_2_7P318
+
+ util/ntp-keygen.man.in@1.135 +2 -2
+ NTP_4_2_7P318
+
+ util/ntp-keygen.mdoc.in@1.135 +1 -1
+ NTP_4_2_7P318
+
+ChangeSet@1.2822.1.33, 2012-11-05 02:09:35-05:00, stenn@deacon.udel.edu
+ [Bug 2301] Remove spurious debug output from ntpq
+
+ ChangeLog@1.1191.1.32 +1 -0
+ [Bug 2301] Remove spurious debug output from ntpq
+
+ ntpq/ntpq.c@1.151 +0 -1
+ [Bug 2301] Remove spurious debug output from ntpq
+
+ChangeSet@1.2822.1.32, 2012-11-05 06:02:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P317
+ TAG: NTP_4_2_7P317
+
+ ChangeLog@1.1191.1.31 +1 -0
+ NTP_4_2_7P317
+
+ ntpd/invoke-ntpd.texi@1.306 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.conf.5man@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.conf.5mdoc@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.conf.man.in@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.conf.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.keys.5man@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.keys.5mdoc@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.keys.man.in@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntp.keys.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntpd-opts.c@1.324 +4 -4
+ NTP_4_2_7P317
+
+ ntpd/ntpd-opts.h@1.324 +3 -3
+ NTP_4_2_7P317
+
+ ntpd/ntpd.1ntpdman@1.135 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntpd.1ntpdmdoc@1.135 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntpd.man.in@1.135 +2 -2
+ NTP_4_2_7P317
+
+ ntpd/ntpd.mdoc.in@1.135 +2 -2
+ NTP_4_2_7P317
+
+ ntpdc/invoke-ntpdc.texi@1.303 +2 -2
+ NTP_4_2_7P317
+
+ ntpdc/ntpdc-opts.c@1.318 +4 -4
+ NTP_4_2_7P317
+
+ ntpdc/ntpdc-opts.h@1.318 +3 -3
+ NTP_4_2_7P317
+
+ ntpdc/ntpdc.1ntpdcman@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpdc/ntpdc.html@1.146 +2 -2
+ NTP_4_2_7P317
+
+ ntpdc/ntpdc.man.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpdc/ntpdc.mdoc.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpq/invoke-ntpq.texi@1.305 +2 -2
+ NTP_4_2_7P317
+
+ ntpq/ntpq-opts.c@1.320 +4 -4
+ NTP_4_2_7P317
+
+ ntpq/ntpq-opts.h@1.320 +3 -3
+ NTP_4_2_7P317
+
+ ntpq/ntpq.1ntpqman@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpq/ntpq.1ntpqmdoc@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpq/ntpq.man.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpq/ntpq.mdoc.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.305 +2 -2
+ NTP_4_2_7P317
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.320 +4 -4
+ NTP_4_2_7P317
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.320 +3 -3
+ NTP_4_2_7P317
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpsnmpd/ntpsnmpd.man.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ packageinfo.sh@1.320 +1 -1
+ NTP_4_2_7P317
+
+ scripts/invoke-ntp-wait.texi@1.123 +14 -2
+ NTP_4_2_7P317
+
+ scripts/ntp-wait.1ntp-waitman@1.134 +2 -2
+ NTP_4_2_7P317
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.134 +2 -2
+ NTP_4_2_7P317
+
+ scripts/ntp-wait.html@1.138 +14 -2
+ NTP_4_2_7P317
+
+ scripts/ntp-wait.man.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ scripts/ntp-wait.mdoc.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ sntp/invoke-sntp.texi@1.302 +2 -2
+ NTP_4_2_7P317
+
+ sntp/sntp-opts.c@1.317 +4 -4
+ NTP_4_2_7P317
+
+ sntp/sntp-opts.h@1.317 +3 -3
+ NTP_4_2_7P317
+
+ sntp/sntp.1sntpman@1.137 +2 -2
+ NTP_4_2_7P317
+
+ sntp/sntp.1sntpmdoc@1.137 +2 -2
+ NTP_4_2_7P317
+
+ sntp/sntp.html@1.317 +2 -2
+ NTP_4_2_7P317
+
+ sntp/sntp.man.in@1.137 +2 -2
+ NTP_4_2_7P317
+
+ sntp/sntp.mdoc.in@1.137 +2 -2
+ NTP_4_2_7P317
+
+ util/invoke-ntp-keygen.texi@1.306 +2 -2
+ NTP_4_2_7P317
+
+ util/ntp-keygen-opts.c@1.320 +4 -4
+ NTP_4_2_7P317
+
+ util/ntp-keygen-opts.h@1.320 +3 -3
+ NTP_4_2_7P317
+
+ util/ntp-keygen.1ntp-keygenman@1.134 +2 -2
+ NTP_4_2_7P317
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.134 +2 -2
+ NTP_4_2_7P317
+
+ util/ntp-keygen.man.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ util/ntp-keygen.mdoc.in@1.134 +2 -2
+ NTP_4_2_7P317
+
+ChangeSet@1.2822.1.31, 2012-11-05 02:34:01+00:00, stenn@psp-fb1.ntp.org
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ ChangeLog@1.1191.1.30 +1 -0
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ ntpq/libntpq.c@1.12 +7 -2
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ ntpq/libntpq.h@1.9 +1 -1
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ ntpq/ntpq-subs.c@1.98 +2 -3
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ ntpq/ntpq.c@1.150 +54 -14
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ ntpq/ntpq.h@1.28 +8 -0
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ ntpsnmpd/ntpsnmpd.c@1.8 +1 -1
+ [Bug 922] Allow interspersed -4 and -6 flags on the ntpq command line
+
+ChangeSet@1.2822.1.30, 2012-10-27 11:26:16+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P316
+ TAG: NTP_4_2_7P316
+
+ ChangeLog@1.1191.1.29 +1 -0
+ NTP_4_2_7P316
+
+ ntpd/invoke-ntpd.texi@1.305 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.conf.5man@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.conf.5mdoc@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.conf.man.in@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.conf.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.keys.5man@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.keys.5mdoc@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.keys.man.in@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntp.keys.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntpd-opts.c@1.323 +4 -4
+ NTP_4_2_7P316
+
+ ntpd/ntpd-opts.h@1.323 +3 -3
+ NTP_4_2_7P316
+
+ ntpd/ntpd.1ntpdman@1.134 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntpd.1ntpdmdoc@1.134 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntpd.man.in@1.134 +2 -2
+ NTP_4_2_7P316
+
+ ntpd/ntpd.mdoc.in@1.134 +2 -2
+ NTP_4_2_7P316
+
+ ntpdc/invoke-ntpdc.texi@1.302 +2 -2
+ NTP_4_2_7P316
+
+ ntpdc/ntpdc-opts.c@1.317 +4 -4
+ NTP_4_2_7P316
+
+ ntpdc/ntpdc-opts.h@1.317 +3 -3
+ NTP_4_2_7P316
+
+ ntpdc/ntpdc.1ntpdcman@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpdc/ntpdc.html@1.145 +2 -2
+ NTP_4_2_7P316
+
+ ntpdc/ntpdc.man.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpdc/ntpdc.mdoc.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpq/invoke-ntpq.texi@1.304 +2 -2
+ NTP_4_2_7P316
+
+ ntpq/ntpq-opts.c@1.319 +4 -4
+ NTP_4_2_7P316
+
+ ntpq/ntpq-opts.h@1.319 +3 -3
+ NTP_4_2_7P316
+
+ ntpq/ntpq.1ntpqman@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpq/ntpq.1ntpqmdoc@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpq/ntpq.man.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpq/ntpq.mdoc.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.304 +2 -2
+ NTP_4_2_7P316
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.319 +4 -4
+ NTP_4_2_7P316
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.319 +3 -3
+ NTP_4_2_7P316
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpsnmpd/ntpsnmpd.man.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ packageinfo.sh@1.319 +1 -1
+ NTP_4_2_7P316
+
+ scripts/invoke-ntp-wait.texi@1.122 +1 -1
+ NTP_4_2_7P316
+
+ scripts/ntp-wait.1ntp-waitman@1.133 +2 -2
+ NTP_4_2_7P316
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.133 +2 -2
+ NTP_4_2_7P316
+
+ scripts/ntp-wait.html@1.137 +1 -1
+ NTP_4_2_7P316
+
+ scripts/ntp-wait.man.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ scripts/ntp-wait.mdoc.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ sntp/invoke-sntp.texi@1.301 +2 -2
+ NTP_4_2_7P316
+
+ sntp/sntp-opts.c@1.316 +4 -4
+ NTP_4_2_7P316
+
+ sntp/sntp-opts.h@1.316 +3 -3
+ NTP_4_2_7P316
+
+ sntp/sntp.1sntpman@1.136 +2 -2
+ NTP_4_2_7P316
+
+ sntp/sntp.1sntpmdoc@1.136 +2 -2
+ NTP_4_2_7P316
+
+ sntp/sntp.html@1.316 +2 -2
+ NTP_4_2_7P316
+
+ sntp/sntp.man.in@1.136 +2 -2
+ NTP_4_2_7P316
+
+ sntp/sntp.mdoc.in@1.136 +2 -2
+ NTP_4_2_7P316
+
+ util/invoke-ntp-keygen.texi@1.305 +2 -2
+ NTP_4_2_7P316
+
+ util/ntp-keygen-opts.c@1.319 +4 -4
+ NTP_4_2_7P316
+
+ util/ntp-keygen-opts.h@1.319 +3 -3
+ NTP_4_2_7P316
+
+ util/ntp-keygen.1ntp-keygenman@1.133 +2 -2
+ NTP_4_2_7P316
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.133 +2 -2
+ NTP_4_2_7P316
+
+ util/ntp-keygen.man.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ util/ntp-keygen.mdoc.in@1.133 +2 -2
+ NTP_4_2_7P316
+
+ChangeSet@1.2822.1.29, 2012-10-26 13:37:56-04:00, stenn@deacon.udel.edu
+ [Bug 2296] Update fix for Bug 2294 to handle --without-crypto
+
+ ChangeLog@1.1191.1.28 +1 -0
+ [Bug 2296] Update fix for Bug 2294 to handle --without-crypto
+
+ include/ntp_md5.h@1.9 +5 -1
+ [Bug 2296] Update fix for Bug 2294 to handle --without-crypto
+
+ChangeSet@1.2822.1.28, 2012-10-26 07:13:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P315
+ TAG: NTP_4_2_7P315
+
+ ChangeLog@1.1191.1.27 +1 -0
+ NTP_4_2_7P315
+
+ ntpd/invoke-ntpd.texi@1.304 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.conf.5man@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.conf.5mdoc@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.conf.man.in@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.conf.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.keys.5man@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.keys.5mdoc@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.keys.man.in@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntp.keys.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntpd-opts.c@1.322 +4 -4
+ NTP_4_2_7P315
+
+ ntpd/ntpd-opts.h@1.322 +3 -3
+ NTP_4_2_7P315
+
+ ntpd/ntpd.1ntpdman@1.133 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntpd.1ntpdmdoc@1.133 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntpd.man.in@1.133 +2 -2
+ NTP_4_2_7P315
+
+ ntpd/ntpd.mdoc.in@1.133 +2 -2
+ NTP_4_2_7P315
+
+ ntpdc/invoke-ntpdc.texi@1.301 +2 -2
+ NTP_4_2_7P315
+
+ ntpdc/ntpdc-opts.c@1.316 +4 -4
+ NTP_4_2_7P315
+
+ ntpdc/ntpdc-opts.h@1.316 +3 -3
+ NTP_4_2_7P315
+
+ ntpdc/ntpdc.1ntpdcman@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpdc/ntpdc.html@1.144 +2 -2
+ NTP_4_2_7P315
+
+ ntpdc/ntpdc.man.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpdc/ntpdc.mdoc.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpq/invoke-ntpq.texi@1.303 +2 -2
+ NTP_4_2_7P315
+
+ ntpq/ntpq-opts.c@1.318 +4 -4
+ NTP_4_2_7P315
+
+ ntpq/ntpq-opts.h@1.318 +3 -3
+ NTP_4_2_7P315
+
+ ntpq/ntpq.1ntpqman@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpq/ntpq.1ntpqmdoc@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpq/ntpq.man.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpq/ntpq.mdoc.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.303 +2 -2
+ NTP_4_2_7P315
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.318 +4 -4
+ NTP_4_2_7P315
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.318 +3 -3
+ NTP_4_2_7P315
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpsnmpd/ntpsnmpd.man.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ packageinfo.sh@1.318 +1 -1
+ NTP_4_2_7P315
+
+ scripts/invoke-ntp-wait.texi@1.121 +1 -1
+ NTP_4_2_7P315
+
+ scripts/ntp-wait.1ntp-waitman@1.132 +2 -2
+ NTP_4_2_7P315
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.132 +2 -2
+ NTP_4_2_7P315
+
+ scripts/ntp-wait.html@1.136 +1 -1
+ NTP_4_2_7P315
+
+ scripts/ntp-wait.man.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ scripts/ntp-wait.mdoc.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ sntp/invoke-sntp.texi@1.300 +2 -2
+ NTP_4_2_7P315
+
+ sntp/sntp-opts.c@1.315 +4 -4
+ NTP_4_2_7P315
+
+ sntp/sntp-opts.h@1.315 +3 -3
+ NTP_4_2_7P315
+
+ sntp/sntp.1sntpman@1.135 +2 -2
+ NTP_4_2_7P315
+
+ sntp/sntp.1sntpmdoc@1.135 +2 -2
+ NTP_4_2_7P315
+
+ sntp/sntp.html@1.315 +2 -2
+ NTP_4_2_7P315
+
+ sntp/sntp.man.in@1.135 +2 -2
+ NTP_4_2_7P315
+
+ sntp/sntp.mdoc.in@1.135 +2 -2
+ NTP_4_2_7P315
+
+ util/invoke-ntp-keygen.texi@1.304 +2 -2
+ NTP_4_2_7P315
+
+ util/ntp-keygen-opts.c@1.318 +4 -4
+ NTP_4_2_7P315
+
+ util/ntp-keygen-opts.h@1.318 +3 -3
+ NTP_4_2_7P315
+
+ util/ntp-keygen.1ntp-keygenman@1.132 +2 -2
+ NTP_4_2_7P315
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.132 +2 -2
+ NTP_4_2_7P315
+
+ util/ntp-keygen.man.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ util/ntp-keygen.mdoc.in@1.132 +2 -2
+ NTP_4_2_7P315
+
+ChangeSet@1.2822.1.27, 2012-10-26 02:23:16-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2294] ntpd crashes in FIPS mode
+
+ ChangeLog@1.1191.1.26 +1 -0
+ [Bug 2294] ntpd crashes in FIPS mode
+
+ libntp/a_md5encrypt.c@1.33 +20 -3
+ [Bug 2294] ntpd crashes in FIPS mode
+
+ChangeSet@1.2822.1.26, 2012-10-23 11:32:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P314
+ TAG: NTP_4_2_7P314
+
+ ChangeLog@1.1191.1.25 +1 -0
+ NTP_4_2_7P314
+
+ ntpd/invoke-ntpd.texi@1.303 +2 -2
+ NTP_4_2_7P314
+
+ ntpd/ntp.conf.5man@1.20 +2 -2
+ NTP_4_2_7P314
+
+ ntpd/ntp.conf.5mdoc@1.20 +1 -1
+ NTP_4_2_7P314
+
+ ntpd/ntp.conf.man.in@1.20 +2 -2
+ NTP_4_2_7P314
+
+ ntpd/ntp.conf.mdoc.in@1.20 +1 -1
+ NTP_4_2_7P314
+
+ ntpd/ntp.keys.5man@1.20 +2 -2
+ NTP_4_2_7P314
+
+ ntpd/ntp.keys.5mdoc@1.20 +1 -1
+ NTP_4_2_7P314
+
+ ntpd/ntp.keys.man.in@1.20 +2 -2
+ NTP_4_2_7P314
+
+ ntpd/ntp.keys.mdoc.in@1.20 +1 -1
+ NTP_4_2_7P314
+
+ ntpd/ntpd-opts.c@1.321 +4 -4
+ NTP_4_2_7P314
+
+ ntpd/ntpd-opts.h@1.321 +3 -3
+ NTP_4_2_7P314
+
+ ntpd/ntpd.1ntpdman@1.132 +2 -2
+ NTP_4_2_7P314
+
+ ntpd/ntpd.1ntpdmdoc@1.132 +1 -1
+ NTP_4_2_7P314
+
+ ntpd/ntpd.man.in@1.132 +2 -2
+ NTP_4_2_7P314
+
+ ntpd/ntpd.mdoc.in@1.132 +1 -1
+ NTP_4_2_7P314
+
+ ntpdc/invoke-ntpdc.texi@1.300 +2 -2
+ NTP_4_2_7P314
+
+ ntpdc/ntpdc-opts.c@1.315 +4 -4
+ NTP_4_2_7P314
+
+ ntpdc/ntpdc-opts.h@1.315 +3 -3
+ NTP_4_2_7P314
+
+ ntpdc/ntpdc.1ntpdcman@1.131 +2 -2
+ NTP_4_2_7P314
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.131 +1 -1
+ NTP_4_2_7P314
+
+ ntpdc/ntpdc.html@1.143 +2 -2
+ NTP_4_2_7P314
+
+ ntpdc/ntpdc.man.in@1.131 +2 -2
+ NTP_4_2_7P314
+
+ ntpdc/ntpdc.mdoc.in@1.131 +1 -1
+ NTP_4_2_7P314
+
+ ntpq/invoke-ntpq.texi@1.302 +2 -2
+ NTP_4_2_7P314
+
+ ntpq/ntpq-opts.c@1.317 +4 -4
+ NTP_4_2_7P314
+
+ ntpq/ntpq-opts.h@1.317 +3 -3
+ NTP_4_2_7P314
+
+ ntpq/ntpq.1ntpqman@1.131 +2 -2
+ NTP_4_2_7P314
+
+ ntpq/ntpq.1ntpqmdoc@1.131 +1 -1
+ NTP_4_2_7P314
+
+ ntpq/ntpq.man.in@1.131 +2 -2
+ NTP_4_2_7P314
+
+ ntpq/ntpq.mdoc.in@1.131 +1 -1
+ NTP_4_2_7P314
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.302 +2 -2
+ NTP_4_2_7P314
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.317 +4 -4
+ NTP_4_2_7P314
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.317 +3 -3
+ NTP_4_2_7P314
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.131 +2 -2
+ NTP_4_2_7P314
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.131 +1 -1
+ NTP_4_2_7P314
+
+ ntpsnmpd/ntpsnmpd.man.in@1.131 +2 -2
+ NTP_4_2_7P314
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.131 +1 -1
+ NTP_4_2_7P314
+
+ packageinfo.sh@1.317 +1 -1
+ NTP_4_2_7P314
+
+ scripts/invoke-ntp-wait.texi@1.120 +1 -1
+ NTP_4_2_7P314
+
+ scripts/ntp-wait.1ntp-waitman@1.131 +2 -2
+ NTP_4_2_7P314
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.131 +1 -1
+ NTP_4_2_7P314
+
+ scripts/ntp-wait.html@1.135 +1 -1
+ NTP_4_2_7P314
+
+ scripts/ntp-wait.man.in@1.131 +2 -2
+ NTP_4_2_7P314
+
+ scripts/ntp-wait.mdoc.in@1.131 +1 -1
+ NTP_4_2_7P314
+
+ sntp/invoke-sntp.texi@1.299 +2 -2
+ NTP_4_2_7P314
+
+ sntp/sntp-opts.c@1.314 +4 -4
+ NTP_4_2_7P314
+
+ sntp/sntp-opts.h@1.314 +3 -3
+ NTP_4_2_7P314
+
+ sntp/sntp.1sntpman@1.134 +2 -2
+ NTP_4_2_7P314
+
+ sntp/sntp.1sntpmdoc@1.134 +1 -1
+ NTP_4_2_7P314
+
+ sntp/sntp.html@1.314 +2 -2
+ NTP_4_2_7P314
+
+ sntp/sntp.man.in@1.134 +2 -2
+ NTP_4_2_7P314
+
+ sntp/sntp.mdoc.in@1.134 +1 -1
+ NTP_4_2_7P314
+
+ util/invoke-ntp-keygen.texi@1.303 +2 -2
+ NTP_4_2_7P314
+
+ util/ntp-keygen-opts.c@1.317 +4 -4
+ NTP_4_2_7P314
+
+ util/ntp-keygen-opts.h@1.317 +3 -3
+ NTP_4_2_7P314
+
+ util/ntp-keygen.1ntp-keygenman@1.131 +2 -2
+ NTP_4_2_7P314
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.131 +1 -1
+ NTP_4_2_7P314
+
+ util/ntp-keygen.man.in@1.131 +2 -2
+ NTP_4_2_7P314
+
+ util/ntp-keygen.mdoc.in@1.131 +1 -1
+ NTP_4_2_7P314
+
+ChangeSet@1.2822.1.25, 2012-10-23 08:43:55+00:00, stenn@psp-fb1.ntp.org
+ Document a tricky malloc() of dns_ctx in sntp
+
+ ChangeLog@1.1191.1.24 +1 -0
+ Document a tricky malloc() of dns_ctx in sntp
+
+ sntp/main.c@1.86 +5 -5
+ Document a tricky malloc() of dns_ctx in sntp
+
+ChangeSet@1.2822.1.24, 2012-10-23 06:09:15+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P313
+ TAG: NTP_4_2_7P313
+
+ ChangeLog@1.1191.1.23 +1 -0
+ NTP_4_2_7P313
+
+ ntpd/invoke-ntpd.texi@1.302 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.conf.5man@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.conf.5mdoc@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.conf.man.in@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.conf.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.keys.5man@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.keys.5mdoc@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.keys.man.in@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntp.keys.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntpd-opts.c@1.320 +4 -4
+ NTP_4_2_7P313
+
+ ntpd/ntpd-opts.h@1.320 +3 -3
+ NTP_4_2_7P313
+
+ ntpd/ntpd.1ntpdman@1.131 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntpd.1ntpdmdoc@1.131 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntpd.man.in@1.131 +2 -2
+ NTP_4_2_7P313
+
+ ntpd/ntpd.mdoc.in@1.131 +2 -2
+ NTP_4_2_7P313
+
+ ntpdc/invoke-ntpdc.texi@1.299 +2 -2
+ NTP_4_2_7P313
+
+ ntpdc/ntpdc-opts.c@1.314 +4 -4
+ NTP_4_2_7P313
+
+ ntpdc/ntpdc-opts.h@1.314 +3 -3
+ NTP_4_2_7P313
+
+ ntpdc/ntpdc.1ntpdcman@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpdc/ntpdc.html@1.142 +2 -2
+ NTP_4_2_7P313
+
+ ntpdc/ntpdc.man.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpdc/ntpdc.mdoc.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpq/invoke-ntpq.texi@1.301 +2 -2
+ NTP_4_2_7P313
+
+ ntpq/ntpq-opts.c@1.316 +4 -4
+ NTP_4_2_7P313
+
+ ntpq/ntpq-opts.h@1.316 +3 -3
+ NTP_4_2_7P313
+
+ ntpq/ntpq.1ntpqman@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpq/ntpq.1ntpqmdoc@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpq/ntpq.man.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpq/ntpq.mdoc.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.301 +2 -2
+ NTP_4_2_7P313
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.316 +4 -4
+ NTP_4_2_7P313
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.316 +3 -3
+ NTP_4_2_7P313
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpsnmpd/ntpsnmpd.man.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ packageinfo.sh@1.316 +1 -1
+ NTP_4_2_7P313
+
+ scripts/invoke-ntp-wait.texi@1.119 +2 -14
+ NTP_4_2_7P313
+
+ scripts/ntp-wait.1ntp-waitman@1.130 +2 -2
+ NTP_4_2_7P313
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.130 +2 -2
+ NTP_4_2_7P313
+
+ scripts/ntp-wait.html@1.134 +2 -14
+ NTP_4_2_7P313
+
+ scripts/ntp-wait.man.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ scripts/ntp-wait.mdoc.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ sntp/invoke-sntp.texi@1.298 +2 -2
+ NTP_4_2_7P313
+
+ sntp/sntp-opts.c@1.313 +4 -4
+ NTP_4_2_7P313
+
+ sntp/sntp-opts.h@1.313 +3 -3
+ NTP_4_2_7P313
+
+ sntp/sntp.1sntpman@1.133 +2 -2
+ NTP_4_2_7P313
+
+ sntp/sntp.1sntpmdoc@1.133 +2 -2
+ NTP_4_2_7P313
+
+ sntp/sntp.html@1.313 +2 -2
+ NTP_4_2_7P313
+
+ sntp/sntp.man.in@1.133 +2 -2
+ NTP_4_2_7P313
+
+ sntp/sntp.mdoc.in@1.133 +2 -2
+ NTP_4_2_7P313
+
+ util/invoke-ntp-keygen.texi@1.302 +2 -2
+ NTP_4_2_7P313
+
+ util/ntp-keygen-opts.c@1.316 +4 -4
+ NTP_4_2_7P313
+
+ util/ntp-keygen-opts.h@1.316 +3 -3
+ NTP_4_2_7P313
+
+ util/ntp-keygen.1ntp-keygenman@1.130 +2 -2
+ NTP_4_2_7P313
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.130 +2 -2
+ NTP_4_2_7P313
+
+ util/ntp-keygen.man.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ util/ntp-keygen.mdoc.in@1.130 +2 -2
+ NTP_4_2_7P313
+
+ChangeSet@1.2822.1.23, 2012-10-23 02:16:06+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2293] add support for SO_BINTIME, refine support for SO_TIMESTAMPNS (bug 1374)
+
+ ChangeLog@1.1191.1.22 +2 -0
+ [Bug 2293] add support for SO_BINTIME, refine support for SO_TIMESTAMPNS (bug 1374)
+
+ ntpd/ntp_io.c@1.373 +89 -45
+ [Bug 2293] add support for SO_BINTIME, refine support for SO_TIMESTAMPNS (bug 1374)
+
+ChangeSet@1.2822.1.22, 2012-10-18 16:31:00-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2291] sntp should report why it cannot open file.kod
+
+ ChangeLog@1.1191.1.21 +1 -0
+ [Bug 2291] sntp should report why it cannot open file.kod
+
+ sntp/kod_management.c@1.29 +1 -1
+ [Bug 2291] sntp should report why it cannot open file.kod
+
+ChangeSet@1.2822.1.21, 2012-10-11 07:12:51+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P312
+ TAG: NTP_4_2_7P312
+
+ ChangeLog@1.1191.1.20 +1 -0
+ NTP_4_2_7P312
+
+ ntpd/invoke-ntpd.texi@1.301 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.conf.5man@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.conf.5mdoc@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.conf.man.in@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.conf.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.keys.5man@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.keys.5mdoc@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.keys.man.in@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntp.keys.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntpd-opts.c@1.319 +4 -4
+ NTP_4_2_7P312
+
+ ntpd/ntpd-opts.h@1.319 +3 -3
+ NTP_4_2_7P312
+
+ ntpd/ntpd.1ntpdman@1.130 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntpd.1ntpdmdoc@1.130 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntpd.man.in@1.130 +2 -2
+ NTP_4_2_7P312
+
+ ntpd/ntpd.mdoc.in@1.130 +2 -2
+ NTP_4_2_7P312
+
+ ntpdc/invoke-ntpdc.texi@1.298 +2 -2
+ NTP_4_2_7P312
+
+ ntpdc/ntpdc-opts.c@1.313 +4 -4
+ NTP_4_2_7P312
+
+ ntpdc/ntpdc-opts.h@1.313 +3 -3
+ NTP_4_2_7P312
+
+ ntpdc/ntpdc.1ntpdcman@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpdc/ntpdc.html@1.141 +2 -2
+ NTP_4_2_7P312
+
+ ntpdc/ntpdc.man.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpdc/ntpdc.mdoc.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpq/invoke-ntpq.texi@1.300 +2 -2
+ NTP_4_2_7P312
+
+ ntpq/ntpq-opts.c@1.315 +4 -4
+ NTP_4_2_7P312
+
+ ntpq/ntpq-opts.h@1.315 +3 -3
+ NTP_4_2_7P312
+
+ ntpq/ntpq.1ntpqman@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpq/ntpq.1ntpqmdoc@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpq/ntpq.man.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpq/ntpq.mdoc.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.300 +2 -2
+ NTP_4_2_7P312
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.315 +4 -4
+ NTP_4_2_7P312
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.315 +3 -3
+ NTP_4_2_7P312
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpsnmpd/ntpsnmpd.man.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ packageinfo.sh@1.315 +1 -1
+ NTP_4_2_7P312
+
+ scripts/invoke-ntp-wait.texi@1.118 +1 -1
+ NTP_4_2_7P312
+
+ scripts/ntp-wait.1ntp-waitman@1.129 +2 -2
+ NTP_4_2_7P312
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.129 +2 -2
+ NTP_4_2_7P312
+
+ scripts/ntp-wait.html@1.133 +1 -1
+ NTP_4_2_7P312
+
+ scripts/ntp-wait.man.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ scripts/ntp-wait.mdoc.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ sntp/invoke-sntp.texi@1.297 +2 -2
+ NTP_4_2_7P312
+
+ sntp/sntp-opts.c@1.312 +4 -4
+ NTP_4_2_7P312
+
+ sntp/sntp-opts.h@1.312 +3 -3
+ NTP_4_2_7P312
+
+ sntp/sntp.1sntpman@1.132 +2 -2
+ NTP_4_2_7P312
+
+ sntp/sntp.1sntpmdoc@1.132 +2 -2
+ NTP_4_2_7P312
+
+ sntp/sntp.html@1.312 +2 -2
+ NTP_4_2_7P312
+
+ sntp/sntp.man.in@1.132 +2 -2
+ NTP_4_2_7P312
+
+ sntp/sntp.mdoc.in@1.132 +2 -2
+ NTP_4_2_7P312
+
+ util/invoke-ntp-keygen.texi@1.301 +2 -2
+ NTP_4_2_7P312
+
+ util/ntp-keygen-opts.c@1.315 +4 -4
+ NTP_4_2_7P312
+
+ util/ntp-keygen-opts.h@1.315 +3 -3
+ NTP_4_2_7P312
+
+ util/ntp-keygen.1ntp-keygenman@1.129 +2 -2
+ NTP_4_2_7P312
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.129 +2 -2
+ NTP_4_2_7P312
+
+ util/ntp-keygen.man.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ util/ntp-keygen.mdoc.in@1.129 +2 -2
+ NTP_4_2_7P312
+
+ChangeSet@1.2822.1.20, 2012-10-11 01:30:28-04:00, stenn@deacon.udel.edu
+ Remove debugging from testing the fix for [Bug 938]
+
+ ChangeLog@1.1191.1.19 +1 -0
+ Remove debugging from testing the fix for [Bug 938]
+
+ sntp/main.c@1.85 +0 -5
+ Remove debugging from testing the fix for [Bug 938]
+
+ChangeSet@1.2822.1.19, 2012-10-10 06:30:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P311
+ TAG: NTP_4_2_7P311
+
+ ChangeLog@1.1191.1.18 +1 -0
+ NTP_4_2_7P311
+
+ ntpd/invoke-ntpd.texi@1.300 +4 -40
+ NTP_4_2_7P311
+
+ ntpd/ntp.conf.5man@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntp.conf.5mdoc@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntp.conf.man.in@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntp.conf.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntp.keys.5man@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntp.keys.5mdoc@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntp.keys.man.in@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntp.keys.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P311
+
+ ntpd/ntpd-opts.c@1.318 +214 -231
+ NTP_4_2_7P311
+
+ ntpd/ntpd-opts.h@1.318 +5 -3
+ NTP_4_2_7P311
+
+ ntpd/ntpd.1ntpdman@1.129 +6 -8
+ NTP_4_2_7P311
+
+ ntpd/ntpd.1ntpdmdoc@1.129 +8 -8
+ NTP_4_2_7P311
+
+ ntpd/ntpd.man.in@1.129 +6 -8
+ NTP_4_2_7P311
+
+ ntpd/ntpd.mdoc.in@1.129 +8 -8
+ NTP_4_2_7P311
+
+ ntpdc/invoke-ntpdc.texi@1.297 +3 -3
+ NTP_4_2_7P311
+
+ ntpdc/ntpdc-opts.c@1.312 +15 -14
+ NTP_4_2_7P311
+
+ ntpdc/ntpdc-opts.h@1.312 +5 -3
+ NTP_4_2_7P311
+
+ ntpdc/ntpdc.1ntpdcman@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpdc/ntpdc.html@1.140 +3 -3
+ NTP_4_2_7P311
+
+ ntpdc/ntpdc.man.in@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpdc/ntpdc.mdoc.in@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpq/invoke-ntpq.texi@1.299 +3 -3
+ NTP_4_2_7P311
+
+ ntpq/ntpq-opts.c@1.314 +15 -14
+ NTP_4_2_7P311
+
+ ntpq/ntpq-opts.h@1.314 +5 -3
+ NTP_4_2_7P311
+
+ ntpq/ntpq.1ntpqman@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpq/ntpq.1ntpqmdoc@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpq/ntpq.man.in@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpq/ntpq.mdoc.in@1.128 +4 -3
+ NTP_4_2_7P311
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.299 +2 -2
+ NTP_4_2_7P311
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.314 +4 -4
+ NTP_4_2_7P311
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.314 +3 -3
+ NTP_4_2_7P311
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.128 +2 -2
+ NTP_4_2_7P311
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.128 +2 -2
+ NTP_4_2_7P311
+
+ ntpsnmpd/ntpsnmpd.man.in@1.128 +2 -2
+ NTP_4_2_7P311
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.128 +2 -2
+ NTP_4_2_7P311
+
+ packageinfo.sh@1.314 +1 -1
+ NTP_4_2_7P311
+
+ scripts/invoke-ntp-wait.texi@1.117 +1 -1
+ NTP_4_2_7P311
+
+ scripts/ntp-wait.1ntp-waitman@1.128 +2 -2
+ NTP_4_2_7P311
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.128 +2 -2
+ NTP_4_2_7P311
+
+ scripts/ntp-wait.html@1.132 +1 -1
+ NTP_4_2_7P311
+
+ scripts/ntp-wait.man.in@1.128 +2 -2
+ NTP_4_2_7P311
+
+ scripts/ntp-wait.mdoc.in@1.128 +2 -2
+ NTP_4_2_7P311
+
+ sntp/invoke-sntp.texi@1.296 +3 -3
+ NTP_4_2_7P311
+
+ sntp/sntp-opts.c@1.311 +16 -16
+ NTP_4_2_7P311
+
+ sntp/sntp-opts.h@1.311 +5 -3
+ NTP_4_2_7P311
+
+ sntp/sntp.1sntpman@1.131 +4 -3
+ NTP_4_2_7P311
+
+ sntp/sntp.1sntpmdoc@1.131 +4 -3
+ NTP_4_2_7P311
+
+ sntp/sntp.html@1.311 +3 -3
+ NTP_4_2_7P311
+
+ sntp/sntp.man.in@1.131 +4 -3
+ NTP_4_2_7P311
+
+ sntp/sntp.mdoc.in@1.131 +4 -3
+ NTP_4_2_7P311
+
+ util/invoke-ntp-keygen.texi@1.300 +3 -3
+ NTP_4_2_7P311
+
+ util/ntp-keygen-opts.c@1.314 +15 -14
+ NTP_4_2_7P311
+
+ util/ntp-keygen-opts.h@1.314 +5 -3
+ NTP_4_2_7P311
+
+ util/ntp-keygen.1ntp-keygenman@1.128 +4 -3
+ NTP_4_2_7P311
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.128 +4 -3
+ NTP_4_2_7P311
+
+ util/ntp-keygen.man.in@1.128 +4 -3
+ NTP_4_2_7P311
+
+ util/ntp-keygen.mdoc.in@1.128 +4 -3
+ NTP_4_2_7P311
+
+ChangeSet@1.2822.1.17, 2012-10-10 01:49:46-04:00, stenn@psp-deb1.ntp.org
+ [Bug 938] The argument to the -D flag takes a number, not a string
+
+ ChangeLog@1.1191.1.16 +1 -0
+ [Bug 938] The argument to the -D flag takes a number, not a string
+
+ChangeSet@1.2822.1.16, 2012-10-09 23:19:59-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ChangeLog@1.1191.1.15 +1 -0
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ntpd/ntpd.c@1.134 +2 -2
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ntpd/ntpdbase-opts.def@1.24 +1 -27
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ntpdc/ntpdc.c@1.101 +1 -1
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ntpq/ntpq.c@1.149 +1 -1
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ports/winnt/ntpd/ntservice.c@1.29 +1 -1
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ sntp/include/debug-opt.def@1.8 +2 -2
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ sntp/main.c@1.84 +6 -1
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ util/ntp-keygen.c@1.93 +1 -1
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ChangeSet@1.2822.1.15, 2012-10-09 22:55:48-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ntpd/ntp_io.c@1.372 +9 -8
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ChangeSet@1.2822.3.1, 2012-10-09 11:41:30+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P310
+ TAG: NTP_4_2_7P310
+
+ ChangeLog@1.1191.3.1 +1 -0
+ NTP_4_2_7P310
+
+ ntpd/invoke-ntpd.texi@1.299 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.conf.5man@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.conf.5mdoc@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.conf.man.in@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.conf.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.keys.5man@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.keys.5mdoc@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.keys.man.in@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntp.keys.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntpd-opts.c@1.317 +4 -4
+ NTP_4_2_7P310
+
+ ntpd/ntpd-opts.h@1.317 +3 -3
+ NTP_4_2_7P310
+
+ ntpd/ntpd.1ntpdman@1.128 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntpd.1ntpdmdoc@1.128 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntpd.man.in@1.128 +2 -2
+ NTP_4_2_7P310
+
+ ntpd/ntpd.mdoc.in@1.128 +2 -2
+ NTP_4_2_7P310
+
+ ntpdc/invoke-ntpdc.texi@1.296 +2 -2
+ NTP_4_2_7P310
+
+ ntpdc/ntpdc-opts.c@1.311 +4 -4
+ NTP_4_2_7P310
+
+ ntpdc/ntpdc-opts.h@1.311 +3 -3
+ NTP_4_2_7P310
+
+ ntpdc/ntpdc.1ntpdcman@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpdc/ntpdc.html@1.139 +2 -2
+ NTP_4_2_7P310
+
+ ntpdc/ntpdc.man.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpdc/ntpdc.mdoc.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpq/invoke-ntpq.texi@1.298 +2 -2
+ NTP_4_2_7P310
+
+ ntpq/ntpq-opts.c@1.313 +4 -4
+ NTP_4_2_7P310
+
+ ntpq/ntpq-opts.h@1.313 +3 -3
+ NTP_4_2_7P310
+
+ ntpq/ntpq.1ntpqman@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpq/ntpq.1ntpqmdoc@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpq/ntpq.man.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpq/ntpq.mdoc.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.298 +2 -2
+ NTP_4_2_7P310
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.313 +4 -4
+ NTP_4_2_7P310
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.313 +3 -3
+ NTP_4_2_7P310
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpsnmpd/ntpsnmpd.man.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ packageinfo.sh@1.313 +1 -1
+ NTP_4_2_7P310
+
+ scripts/invoke-ntp-wait.texi@1.116 +1 -1
+ NTP_4_2_7P310
+
+ scripts/ntp-wait.1ntp-waitman@1.127 +2 -2
+ NTP_4_2_7P310
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.127 +2 -2
+ NTP_4_2_7P310
+
+ scripts/ntp-wait.html@1.131 +1 -1
+ NTP_4_2_7P310
+
+ scripts/ntp-wait.man.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ scripts/ntp-wait.mdoc.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ sntp/invoke-sntp.texi@1.295 +2 -2
+ NTP_4_2_7P310
+
+ sntp/sntp-opts.c@1.310 +4 -4
+ NTP_4_2_7P310
+
+ sntp/sntp-opts.h@1.310 +3 -3
+ NTP_4_2_7P310
+
+ sntp/sntp.1sntpman@1.130 +2 -2
+ NTP_4_2_7P310
+
+ sntp/sntp.1sntpmdoc@1.130 +2 -2
+ NTP_4_2_7P310
+
+ sntp/sntp.html@1.310 +2 -2
+ NTP_4_2_7P310
+
+ sntp/sntp.man.in@1.130 +2 -2
+ NTP_4_2_7P310
+
+ sntp/sntp.mdoc.in@1.130 +2 -2
+ NTP_4_2_7P310
+
+ util/invoke-ntp-keygen.texi@1.299 +2 -2
+ NTP_4_2_7P310
+
+ util/ntp-keygen-opts.c@1.313 +4 -4
+ NTP_4_2_7P310
+
+ util/ntp-keygen-opts.h@1.313 +3 -3
+ NTP_4_2_7P310
+
+ util/ntp-keygen.1ntp-keygenman@1.127 +2 -2
+ NTP_4_2_7P310
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.127 +2 -2
+ NTP_4_2_7P310
+
+ util/ntp-keygen.man.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ util/ntp-keygen.mdoc.in@1.127 +2 -2
+ NTP_4_2_7P310
+
+ChangeSet@1.2822.1.14, 2012-10-09 02:15:38-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1013] ntpdate's HTML page claims wrong default version.
+
+ ChangeLog@1.1191.1.14 +1 -0
+ [Bug 1013] ntpdate's HTML page claims wrong default version.
+
+ html/ntpdate.html@1.21 +2 -1
+ [Bug 1013] ntpdate's HTML page claims wrong default version.
+
+ChangeSet@1.2822.1.13, 2012-10-08 23:50:56-04:00, stenn@deacon.udel.edu
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ChangeLog@1.1191.1.13 +1 -0
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ ntpd/ntp_io.c@1.371 +68 -16
+ [Bug 1374] Support SO_TIMESTAMPNS
+
+ChangeSet@1.2822.1.12, 2012-10-08 22:50:36-04:00, stenn@deacon.udel.edu
+ [Bug 2274] Bring libopts/enum.c back to (old) ANSI C compliance
+
+ ChangeLog@1.1191.1.12 +1 -1
+ [Bug 2274] Bring libopts/enum.c back to (old) ANSI C compliance
+
+ChangeSet@1.2822.1.11, 2012-10-08 20:17:15-04:00, stenn@deacon.udel.edu
+ [Bug 2266] Remove deprecated refclock_trak.c from Windows Makefile equivalents
+
+ ChangeLog@1.1191.1.11 +2 -1
+ [Bug 2266] Remove deprecated refclock_trak.c from Windows Makefile equivalents
+
+ChangeSet@1.2822.2.1, 2012-10-05 01:53:46+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Bring libopts/enum.c back to ANSI C compliance.
+ Reflect removal of refclock_trak.c in Windows Makefile equivalents.
+
+ ChangeLog@1.1191.2.1 +2 -0
+ Bring libopts/enum.c back to ANSI C compliance.
+ Reflect removal of refclock_trak.c in Windows Makefile equivalents.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.18 +0 -24
+ Reflect removal of refclock_trak.c in Windows Makefile equivalents.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.44 +0 -4
+ Reflect removal of refclock_trak.c in Windows Makefile equivalents.
+
+ sntp/libopts/enum.c@1.5 +3 -3
+ Bring libopts/enum.c back to ANSI C compliance.
+
+
+ChangeSet@1.2822.1.9, 2012-10-04 11:41:02+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P309
+ TAG: NTP_4_2_7P309
+
+ ChangeLog@1.1191.1.9 +1 -0
+ NTP_4_2_7P309
+
+ ntpd/invoke-ntpd.texi@1.298 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.conf.5man@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.conf.5mdoc@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.conf.man.in@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.conf.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.keys.5man@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.keys.5mdoc@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.keys.man.in@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntp.keys.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntpd-opts.c@1.316 +4 -4
+ NTP_4_2_7P309
+
+ ntpd/ntpd-opts.h@1.316 +3 -3
+ NTP_4_2_7P309
+
+ ntpd/ntpd.1ntpdman@1.127 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntpd.1ntpdmdoc@1.127 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntpd.man.in@1.127 +2 -2
+ NTP_4_2_7P309
+
+ ntpd/ntpd.mdoc.in@1.127 +2 -2
+ NTP_4_2_7P309
+
+ ntpdc/invoke-ntpdc.texi@1.295 +2 -2
+ NTP_4_2_7P309
+
+ ntpdc/ntpdc-opts.c@1.310 +4 -4
+ NTP_4_2_7P309
+
+ ntpdc/ntpdc-opts.h@1.310 +3 -3
+ NTP_4_2_7P309
+
+ ntpdc/ntpdc.1ntpdcman@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpdc/ntpdc.html@1.138 +2 -2
+ NTP_4_2_7P309
+
+ ntpdc/ntpdc.man.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpdc/ntpdc.mdoc.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpq/invoke-ntpq.texi@1.297 +2 -2
+ NTP_4_2_7P309
+
+ ntpq/ntpq-opts.c@1.312 +4 -4
+ NTP_4_2_7P309
+
+ ntpq/ntpq-opts.h@1.312 +3 -3
+ NTP_4_2_7P309
+
+ ntpq/ntpq.1ntpqman@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpq/ntpq.1ntpqmdoc@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpq/ntpq.man.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpq/ntpq.mdoc.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.297 +2 -2
+ NTP_4_2_7P309
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.312 +4 -4
+ NTP_4_2_7P309
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.312 +3 -3
+ NTP_4_2_7P309
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpsnmpd/ntpsnmpd.man.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ packageinfo.sh@1.312 +1 -1
+ NTP_4_2_7P309
+
+ scripts/invoke-ntp-wait.texi@1.115 +1 -1
+ NTP_4_2_7P309
+
+ scripts/ntp-wait.1ntp-waitman@1.126 +2 -2
+ NTP_4_2_7P309
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.126 +2 -2
+ NTP_4_2_7P309
+
+ scripts/ntp-wait.html@1.130 +1 -1
+ NTP_4_2_7P309
+
+ scripts/ntp-wait.man.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ scripts/ntp-wait.mdoc.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ sntp/invoke-sntp.texi@1.294 +2 -2
+ NTP_4_2_7P309
+
+ sntp/sntp-opts.c@1.309 +4 -4
+ NTP_4_2_7P309
+
+ sntp/sntp-opts.h@1.309 +3 -3
+ NTP_4_2_7P309
+
+ sntp/sntp.1sntpman@1.129 +2 -2
+ NTP_4_2_7P309
+
+ sntp/sntp.1sntpmdoc@1.129 +2 -2
+ NTP_4_2_7P309
+
+ sntp/sntp.html@1.309 +2 -2
+ NTP_4_2_7P309
+
+ sntp/sntp.man.in@1.129 +2 -2
+ NTP_4_2_7P309
+
+ sntp/sntp.mdoc.in@1.129 +2 -2
+ NTP_4_2_7P309
+
+ util/invoke-ntp-keygen.texi@1.298 +2 -2
+ NTP_4_2_7P309
+
+ util/ntp-keygen-opts.c@1.312 +4 -4
+ NTP_4_2_7P309
+
+ util/ntp-keygen-opts.h@1.312 +3 -3
+ NTP_4_2_7P309
+
+ util/ntp-keygen.1ntp-keygenman@1.126 +2 -2
+ NTP_4_2_7P309
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.126 +2 -2
+ NTP_4_2_7P309
+
+ util/ntp-keygen.man.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ util/ntp-keygen.mdoc.in@1.126 +2 -2
+ NTP_4_2_7P309
+
+ChangeSet@1.2822.1.8, 2012-10-04 03:37:21-04:00, stenn@deacon.udel.edu
+ [Bug 2287] ntpdate returns 0 even if adjtime() call fails
+
+ ChangeLog@1.1191.1.8 +1 -0
+ [Bug 2287] ntpdate returns 0 even if adjtime() call fails
+
+ ntpdate/ntpdate.c@1.91 +1 -1
+ [Bug 2287] ntpdate returns 0 even if adjtime() call fails
+
+ChangeSet@1.2822.1.7, 2012-09-29 10:48:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P308
+ TAG: NTP_4_2_7P308
+
+ ChangeLog@1.1191.1.7 +1 -0
+ NTP_4_2_7P308
+
+ ntpd/invoke-ntpd.texi@1.297 +2 -2
+ NTP_4_2_7P308
+
+ ntpd/ntp.conf.5man@1.14 +2 -2
+ NTP_4_2_7P308
+
+ ntpd/ntp.conf.5mdoc@1.14 +1 -1
+ NTP_4_2_7P308
+
+ ntpd/ntp.conf.man.in@1.14 +2 -2
+ NTP_4_2_7P308
+
+ ntpd/ntp.conf.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P308
+
+ ntpd/ntp.keys.5man@1.14 +2 -2
+ NTP_4_2_7P308
+
+ ntpd/ntp.keys.5mdoc@1.14 +1 -1
+ NTP_4_2_7P308
+
+ ntpd/ntp.keys.man.in@1.14 +2 -2
+ NTP_4_2_7P308
+
+ ntpd/ntp.keys.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P308
+
+ ntpd/ntpd-opts.c@1.315 +4 -4
+ NTP_4_2_7P308
+
+ ntpd/ntpd-opts.h@1.315 +3 -3
+ NTP_4_2_7P308
+
+ ntpd/ntpd.1ntpdman@1.126 +2 -2
+ NTP_4_2_7P308
+
+ ntpd/ntpd.1ntpdmdoc@1.126 +1 -1
+ NTP_4_2_7P308
+
+ ntpd/ntpd.man.in@1.126 +2 -2
+ NTP_4_2_7P308
+
+ ntpd/ntpd.mdoc.in@1.126 +1 -1
+ NTP_4_2_7P308
+
+ ntpdc/invoke-ntpdc.texi@1.294 +2 -2
+ NTP_4_2_7P308
+
+ ntpdc/ntpdc-opts.c@1.309 +4 -4
+ NTP_4_2_7P308
+
+ ntpdc/ntpdc-opts.h@1.309 +3 -3
+ NTP_4_2_7P308
+
+ ntpdc/ntpdc.1ntpdcman@1.125 +2 -2
+ NTP_4_2_7P308
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.125 +1 -1
+ NTP_4_2_7P308
+
+ ntpdc/ntpdc.html@1.137 +2 -2
+ NTP_4_2_7P308
+
+ ntpdc/ntpdc.man.in@1.125 +2 -2
+ NTP_4_2_7P308
+
+ ntpdc/ntpdc.mdoc.in@1.125 +1 -1
+ NTP_4_2_7P308
+
+ ntpq/invoke-ntpq.texi@1.296 +2 -2
+ NTP_4_2_7P308
+
+ ntpq/ntpq-opts.c@1.311 +4 -4
+ NTP_4_2_7P308
+
+ ntpq/ntpq-opts.h@1.311 +3 -3
+ NTP_4_2_7P308
+
+ ntpq/ntpq.1ntpqman@1.125 +2 -2
+ NTP_4_2_7P308
+
+ ntpq/ntpq.1ntpqmdoc@1.125 +1 -1
+ NTP_4_2_7P308
+
+ ntpq/ntpq.man.in@1.125 +2 -2
+ NTP_4_2_7P308
+
+ ntpq/ntpq.mdoc.in@1.125 +1 -1
+ NTP_4_2_7P308
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.296 +2 -2
+ NTP_4_2_7P308
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.311 +4 -4
+ NTP_4_2_7P308
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.311 +3 -3
+ NTP_4_2_7P308
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.125 +2 -2
+ NTP_4_2_7P308
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.125 +1 -1
+ NTP_4_2_7P308
+
+ ntpsnmpd/ntpsnmpd.man.in@1.125 +2 -2
+ NTP_4_2_7P308
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.125 +1 -1
+ NTP_4_2_7P308
+
+ packageinfo.sh@1.311 +1 -1
+ NTP_4_2_7P308
+
+ scripts/invoke-ntp-wait.texi@1.114 +1 -1
+ NTP_4_2_7P308
+
+ scripts/ntp-wait.1ntp-waitman@1.125 +2 -2
+ NTP_4_2_7P308
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.125 +1 -1
+ NTP_4_2_7P308
+
+ scripts/ntp-wait.html@1.129 +1 -1
+ NTP_4_2_7P308
+
+ scripts/ntp-wait.man.in@1.125 +2 -2
+ NTP_4_2_7P308
+
+ scripts/ntp-wait.mdoc.in@1.125 +1 -1
+ NTP_4_2_7P308
+
+ sntp/invoke-sntp.texi@1.293 +2 -2
+ NTP_4_2_7P308
+
+ sntp/sntp-opts.c@1.308 +4 -4
+ NTP_4_2_7P308
+
+ sntp/sntp-opts.h@1.308 +3 -3
+ NTP_4_2_7P308
+
+ sntp/sntp.1sntpman@1.128 +2 -2
+ NTP_4_2_7P308
+
+ sntp/sntp.1sntpmdoc@1.128 +1 -1
+ NTP_4_2_7P308
+
+ sntp/sntp.html@1.308 +2 -2
+ NTP_4_2_7P308
+
+ sntp/sntp.man.in@1.128 +2 -2
+ NTP_4_2_7P308
+
+ sntp/sntp.mdoc.in@1.128 +1 -1
+ NTP_4_2_7P308
+
+ util/invoke-ntp-keygen.texi@1.297 +2 -2
+ NTP_4_2_7P308
+
+ util/ntp-keygen-opts.c@1.311 +4 -4
+ NTP_4_2_7P308
+
+ util/ntp-keygen-opts.h@1.311 +3 -3
+ NTP_4_2_7P308
+
+ util/ntp-keygen.1ntp-keygenman@1.125 +2 -2
+ NTP_4_2_7P308
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.125 +1 -1
+ NTP_4_2_7P308
+
+ util/ntp-keygen.man.in@1.125 +2 -2
+ NTP_4_2_7P308
+
+ util/ntp-keygen.mdoc.in@1.125 +1 -1
+ NTP_4_2_7P308
+
+ChangeSet@1.2822.1.6, 2012-09-29 02:03:52-04:00, stenn@psp-deb1.ntp.org
+ CID 97198: Check return from ioctl() calls in refclock_acts.c
+
+ ChangeLog@1.1191.1.6 +1 -0
+ CID 97198: Check return from ioctl() calls in refclock_acts.c
+
+ ntpd/refclock_acts.c@1.52 +4 -2
+ CID 97198: Check return from ioctl() calls in refclock_acts.c
+
+ChangeSet@1.2822.1.5, 2012-09-29 00:52:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P307
+ TAG: NTP_4_2_7P307
+
+ ChangeLog@1.1191.1.5 +1 -0
+ NTP_4_2_7P307
+
+ ntpd/invoke-ntpd.texi@1.296 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.conf.5man@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.conf.5mdoc@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.conf.man.in@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.conf.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.keys.5man@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.keys.5mdoc@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.keys.man.in@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntp.keys.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntpd-opts.c@1.314 +4 -4
+ NTP_4_2_7P307
+
+ ntpd/ntpd-opts.h@1.314 +3 -3
+ NTP_4_2_7P307
+
+ ntpd/ntpd.1ntpdman@1.125 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntpd.1ntpdmdoc@1.125 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntpd.man.in@1.125 +2 -2
+ NTP_4_2_7P307
+
+ ntpd/ntpd.mdoc.in@1.125 +2 -2
+ NTP_4_2_7P307
+
+ ntpdc/invoke-ntpdc.texi@1.293 +2 -2
+ NTP_4_2_7P307
+
+ ntpdc/ntpdc-opts.c@1.308 +4 -4
+ NTP_4_2_7P307
+
+ ntpdc/ntpdc-opts.h@1.308 +3 -3
+ NTP_4_2_7P307
+
+ ntpdc/ntpdc.1ntpdcman@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpdc/ntpdc.html@1.136 +2 -2
+ NTP_4_2_7P307
+
+ ntpdc/ntpdc.man.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpdc/ntpdc.mdoc.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpq/invoke-ntpq.texi@1.295 +2 -2
+ NTP_4_2_7P307
+
+ ntpq/ntpq-opts.c@1.310 +4 -4
+ NTP_4_2_7P307
+
+ ntpq/ntpq-opts.h@1.310 +3 -3
+ NTP_4_2_7P307
+
+ ntpq/ntpq.1ntpqman@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpq/ntpq.1ntpqmdoc@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpq/ntpq.man.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpq/ntpq.mdoc.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.295 +2 -2
+ NTP_4_2_7P307
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.310 +4 -4
+ NTP_4_2_7P307
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.310 +3 -3
+ NTP_4_2_7P307
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpsnmpd/ntpsnmpd.man.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ packageinfo.sh@1.310 +1 -1
+ NTP_4_2_7P307
+
+ scripts/invoke-ntp-wait.texi@1.113 +1 -1
+ NTP_4_2_7P307
+
+ scripts/ntp-wait.1ntp-waitman@1.124 +2 -2
+ NTP_4_2_7P307
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.124 +2 -2
+ NTP_4_2_7P307
+
+ scripts/ntp-wait.html@1.128 +1 -1
+ NTP_4_2_7P307
+
+ scripts/ntp-wait.man.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ scripts/ntp-wait.mdoc.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ sntp/invoke-sntp.texi@1.292 +2 -2
+ NTP_4_2_7P307
+
+ sntp/sntp-opts.c@1.307 +4 -4
+ NTP_4_2_7P307
+
+ sntp/sntp-opts.h@1.307 +3 -3
+ NTP_4_2_7P307
+
+ sntp/sntp.1sntpman@1.127 +3 -65
+ NTP_4_2_7P307
+
+ sntp/sntp.1sntpmdoc@1.127 +4 -66
+ NTP_4_2_7P307
+
+ sntp/sntp.html@1.307 +93 -118
+ NTP_4_2_7P307
+
+ sntp/sntp.man.in@1.127 +3 -65
+ NTP_4_2_7P307
+
+ sntp/sntp.mdoc.in@1.127 +4 -66
+ NTP_4_2_7P307
+
+ util/invoke-ntp-keygen.texi@1.296 +2 -2
+ NTP_4_2_7P307
+
+ util/ntp-keygen-opts.c@1.310 +4 -4
+ NTP_4_2_7P307
+
+ util/ntp-keygen-opts.h@1.310 +3 -3
+ NTP_4_2_7P307
+
+ util/ntp-keygen.1ntp-keygenman@1.124 +2 -2
+ NTP_4_2_7P307
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.124 +2 -2
+ NTP_4_2_7P307
+
+ util/ntp-keygen.man.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ util/ntp-keygen.mdoc.in@1.124 +2 -2
+ NTP_4_2_7P307
+
+ChangeSet@1.2822.1.4, 2012-09-28 20:12:45-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ ChangeLog@1.1191.1.4 +1 -0
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/invoke-sntp.texi@1.291 +13 -20
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/main.c@1.83 +68 -18
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp-opts.c@1.306 +172 -197
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp-opts.def@1.40 +9 -19
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp-opts.h@1.306 +30 -39
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp.1sntpman@1.126 +73 -18
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp.1sntpmdoc@1.126 +74 -18
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp.html@1.306 +141 -130
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp.man.in@1.126 +73 -18
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ sntp/sntp.mdoc.in@1.126 +74 -18
+ [Bug 1997] Fix sntp broadcast timeouts
+
+ChangeSet@1.2822.1.3, 2012-09-23 01:03:01-04:00, stenn@psp-deb1.ntp.org
+ Fix typo in html/select.html
+
+ ChangeLog@1.1191.1.3 +1 -0
+ Fix typo in html/select.html
+
+ html/select.html@1.7 +1 -1
+ Fix typo in html/select.html
+
+ChangeSet@1.2822.1.2, 2012-09-22 21:07:43-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2234] Fix incorrect ntptrace html documentation.
+
+ ChangeLog@1.1191.1.2 +1 -0
+ [Bug 2234] Fix incorrect ntptrace html documentation.
+
+ html/ntptrace.html@1.17 +3 -9
+ [Bug 2234] Fix incorrect ntptrace html documentation.
+
+ChangeSet@1.2822.1.1, 2012-09-17 06:11:50-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2262] Install html docs in $htmldir
+
+ ChangeLog@1.1191.1.1 +1 -0
+ [Bug 2262] Install html docs in $htmldir
+
+ ntpdc/Makefile.am@1.73 +6 -1
+ [Bug 2262] Install html docs in $htmldir
+
+ scripts/Makefile.am@1.31 +6 -1
+ [Bug 2262] Install html docs in $htmldir
+
+ChangeSet@1.2823, 2012-09-17 02:46:11-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2278] ACTS flag3 mismatch between code and driver18.html.
+
+ ChangeLog@1.1192 +1 -0
+ [Bug 2278] ACTS flag3 mismatch between code and driver18.html.
+
+ html/drivers/driver18.html@1.18 +4 -4
+ [Bug 2278] ACTS flag3 mismatch between code and driver18.html.
+
+ChangeSet@1.2822, 2012-09-15 11:26:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P306
+ TAG: NTP_4_2_7P306
+
+ ChangeLog@1.1191 +1 -0
+ NTP_4_2_7P306
+
+ ntpd/invoke-ntpd.texi@1.295 +2 -2
+ NTP_4_2_7P306
+
+ ntpd/ntp.conf.5man@1.12 +2 -2
+ NTP_4_2_7P306
+
+ ntpd/ntp.conf.5mdoc@1.12 +1 -1
+ NTP_4_2_7P306
+
+ ntpd/ntp.conf.man.in@1.12 +2 -2
+ NTP_4_2_7P306
+
+ ntpd/ntp.conf.mdoc.in@1.12 +1 -1
+ NTP_4_2_7P306
+
+ ntpd/ntp.keys.5man@1.12 +2 -2
+ NTP_4_2_7P306
+
+ ntpd/ntp.keys.5mdoc@1.12 +1 -1
+ NTP_4_2_7P306
+
+ ntpd/ntp.keys.man.in@1.12 +2 -2
+ NTP_4_2_7P306
+
+ ntpd/ntp.keys.mdoc.in@1.12 +1 -1
+ NTP_4_2_7P306
+
+ ntpd/ntpd-opts.c@1.313 +4 -4
+ NTP_4_2_7P306
+
+ ntpd/ntpd-opts.h@1.313 +3 -3
+ NTP_4_2_7P306
+
+ ntpd/ntpd.1ntpdman@1.124 +2 -2
+ NTP_4_2_7P306
+
+ ntpd/ntpd.1ntpdmdoc@1.124 +1 -1
+ NTP_4_2_7P306
+
+ ntpd/ntpd.man.in@1.124 +2 -2
+ NTP_4_2_7P306
+
+ ntpd/ntpd.mdoc.in@1.124 +1 -1
+ NTP_4_2_7P306
+
+ ntpdc/invoke-ntpdc.texi@1.292 +2 -2
+ NTP_4_2_7P306
+
+ ntpdc/ntpdc-opts.c@1.307 +4 -4
+ NTP_4_2_7P306
+
+ ntpdc/ntpdc-opts.h@1.307 +3 -3
+ NTP_4_2_7P306
+
+ ntpdc/ntpdc.1ntpdcman@1.123 +2 -2
+ NTP_4_2_7P306
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.123 +1 -1
+ NTP_4_2_7P306
+
+ ntpdc/ntpdc.html@1.135 +2 -2
+ NTP_4_2_7P306
+
+ ntpdc/ntpdc.man.in@1.123 +2 -2
+ NTP_4_2_7P306
+
+ ntpdc/ntpdc.mdoc.in@1.123 +1 -1
+ NTP_4_2_7P306
+
+ ntpq/invoke-ntpq.texi@1.294 +2 -2
+ NTP_4_2_7P306
+
+ ntpq/ntpq-opts.c@1.309 +4 -4
+ NTP_4_2_7P306
+
+ ntpq/ntpq-opts.h@1.309 +3 -3
+ NTP_4_2_7P306
+
+ ntpq/ntpq.1ntpqman@1.123 +2 -2
+ NTP_4_2_7P306
+
+ ntpq/ntpq.1ntpqmdoc@1.123 +1 -1
+ NTP_4_2_7P306
+
+ ntpq/ntpq.man.in@1.123 +2 -2
+ NTP_4_2_7P306
+
+ ntpq/ntpq.mdoc.in@1.123 +1 -1
+ NTP_4_2_7P306
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.294 +2 -2
+ NTP_4_2_7P306
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.309 +4 -4
+ NTP_4_2_7P306
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.309 +3 -3
+ NTP_4_2_7P306
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.123 +2 -2
+ NTP_4_2_7P306
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.123 +1 -1
+ NTP_4_2_7P306
+
+ ntpsnmpd/ntpsnmpd.man.in@1.123 +2 -2
+ NTP_4_2_7P306
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.123 +1 -1
+ NTP_4_2_7P306
+
+ packageinfo.sh@1.309 +1 -1
+ NTP_4_2_7P306
+
+ scripts/invoke-ntp-wait.texi@1.112 +1 -1
+ NTP_4_2_7P306
+
+ scripts/ntp-wait.1ntp-waitman@1.123 +2 -2
+ NTP_4_2_7P306
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.123 +1 -1
+ NTP_4_2_7P306
+
+ scripts/ntp-wait.html@1.127 +1 -1
+ NTP_4_2_7P306
+
+ scripts/ntp-wait.man.in@1.123 +2 -2
+ NTP_4_2_7P306
+
+ scripts/ntp-wait.mdoc.in@1.123 +1 -1
+ NTP_4_2_7P306
+
+ sntp/invoke-sntp.texi@1.290 +2 -2
+ NTP_4_2_7P306
+
+ sntp/sntp-opts.c@1.305 +4 -4
+ NTP_4_2_7P306
+
+ sntp/sntp-opts.h@1.305 +3 -3
+ NTP_4_2_7P306
+
+ sntp/sntp.1sntpman@1.125 +2 -2
+ NTP_4_2_7P306
+
+ sntp/sntp.1sntpmdoc@1.125 +1 -1
+ NTP_4_2_7P306
+
+ sntp/sntp.html@1.305 +2 -2
+ NTP_4_2_7P306
+
+ sntp/sntp.man.in@1.125 +2 -2
+ NTP_4_2_7P306
+
+ sntp/sntp.mdoc.in@1.125 +1 -1
+ NTP_4_2_7P306
+
+ util/invoke-ntp-keygen.texi@1.295 +2 -2
+ NTP_4_2_7P306
+
+ util/ntp-keygen-opts.c@1.309 +4 -4
+ NTP_4_2_7P306
+
+ util/ntp-keygen-opts.h@1.309 +3 -3
+ NTP_4_2_7P306
+
+ util/ntp-keygen.1ntp-keygenman@1.123 +2 -2
+ NTP_4_2_7P306
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.123 +1 -1
+ NTP_4_2_7P306
+
+ util/ntp-keygen.man.in@1.123 +2 -2
+ NTP_4_2_7P306
+
+ util/ntp-keygen.mdoc.in@1.123 +1 -1
+ NTP_4_2_7P306
+
+ChangeSet@1.2821, 2012-09-15 03:45:57-04:00, stenn@deacon.udel.edu
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ ChangeLog@1.1190 +1 -0
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ include/ntp_config.h@1.75 +0 -23
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ libntp/socket.c@1.9 +0 -13
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ ntpd/keyword-gen-utd@1.18 +1 -1
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ ntpd/keyword-gen.c@1.23 +0 -1
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ ntpd/ntp_keyword.h@1.20 +488 -492
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ ntpd/ntp_parser.c@1.81 +713 -717
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ ntpd/ntp_parser.h@1.47 +107 -109
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ ntpd/ntp_parser.y@1.75 +0 -2
+ [Bug 752] ToS cleanup from Mike Tatarinov
+
+ChangeSet@1.2820, 2012-09-15 07:21:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P305
+ TAG: NTP_4_2_7P305
+
+ ChangeLog@1.1189 +1 -0
+ NTP_4_2_7P305
+
+ ntpd/invoke-ntpd.texi@1.294 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.conf.5man@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.conf.5mdoc@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.conf.man.in@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.conf.mdoc.in@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.keys.5man@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.keys.5mdoc@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.keys.man.in@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntp.keys.mdoc.in@1.11 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntpd-opts.c@1.312 +4 -4
+ NTP_4_2_7P305
+
+ ntpd/ntpd-opts.h@1.312 +3 -3
+ NTP_4_2_7P305
+
+ ntpd/ntpd.1ntpdman@1.123 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntpd.1ntpdmdoc@1.123 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntpd.man.in@1.123 +2 -2
+ NTP_4_2_7P305
+
+ ntpd/ntpd.mdoc.in@1.123 +2 -2
+ NTP_4_2_7P305
+
+ ntpdc/invoke-ntpdc.texi@1.291 +2 -2
+ NTP_4_2_7P305
+
+ ntpdc/ntpdc-opts.c@1.306 +4 -4
+ NTP_4_2_7P305
+
+ ntpdc/ntpdc-opts.h@1.306 +3 -3
+ NTP_4_2_7P305
+
+ ntpdc/ntpdc.1ntpdcman@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpdc/ntpdc.html@1.134 +2 -2
+ NTP_4_2_7P305
+
+ ntpdc/ntpdc.man.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpdc/ntpdc.mdoc.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpq/invoke-ntpq.texi@1.293 +2 -2
+ NTP_4_2_7P305
+
+ ntpq/ntpq-opts.c@1.308 +4 -4
+ NTP_4_2_7P305
+
+ ntpq/ntpq-opts.h@1.308 +3 -3
+ NTP_4_2_7P305
+
+ ntpq/ntpq.1ntpqman@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpq/ntpq.1ntpqmdoc@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpq/ntpq.man.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpq/ntpq.mdoc.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.293 +2 -2
+ NTP_4_2_7P305
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.308 +4 -4
+ NTP_4_2_7P305
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.308 +3 -3
+ NTP_4_2_7P305
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpsnmpd/ntpsnmpd.man.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ packageinfo.sh@1.308 +1 -1
+ NTP_4_2_7P305
+
+ scripts/invoke-ntp-wait.texi@1.111 +1 -1
+ NTP_4_2_7P305
+
+ scripts/ntp-wait.1ntp-waitman@1.122 +2 -2
+ NTP_4_2_7P305
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.122 +2 -2
+ NTP_4_2_7P305
+
+ scripts/ntp-wait.html@1.126 +1 -1
+ NTP_4_2_7P305
+
+ scripts/ntp-wait.man.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ scripts/ntp-wait.mdoc.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ sntp/invoke-sntp.texi@1.289 +2 -2
+ NTP_4_2_7P305
+
+ sntp/sntp-opts.c@1.304 +4 -4
+ NTP_4_2_7P305
+
+ sntp/sntp-opts.h@1.304 +3 -3
+ NTP_4_2_7P305
+
+ sntp/sntp.1sntpman@1.124 +2 -2
+ NTP_4_2_7P305
+
+ sntp/sntp.1sntpmdoc@1.124 +2 -2
+ NTP_4_2_7P305
+
+ sntp/sntp.html@1.304 +2 -2
+ NTP_4_2_7P305
+
+ sntp/sntp.man.in@1.124 +2 -2
+ NTP_4_2_7P305
+
+ sntp/sntp.mdoc.in@1.124 +2 -2
+ NTP_4_2_7P305
+
+ util/invoke-ntp-keygen.texi@1.294 +2 -2
+ NTP_4_2_7P305
+
+ util/ntp-keygen-opts.c@1.308 +4 -4
+ NTP_4_2_7P305
+
+ util/ntp-keygen-opts.h@1.308 +3 -3
+ NTP_4_2_7P305
+
+ util/ntp-keygen.1ntp-keygenman@1.122 +2 -2
+ NTP_4_2_7P305
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.122 +2 -2
+ NTP_4_2_7P305
+
+ util/ntp-keygen.man.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ util/ntp-keygen.mdoc.in@1.122 +2 -2
+ NTP_4_2_7P305
+
+ChangeSet@1.2819, 2012-09-15 02:20:37-04:00, stenn@deacon.udel.edu
+ [Bug 2276] clk_sel240x.c #define's _XOPEN_SOURCE, breaking QNX6
+
+ ChangeLog@1.1188 +1 -0
+ [Bug 2276] clk_sel240x.c #define's _XOPEN_SOURCE, breaking QNX6
+
+ libparse/clk_sel240x.c@1.3 +3 -3
+ [Bug 2276] clk_sel240x.c #define's _XOPEN_SOURCE, breaking QNX6
+
+ChangeSet@1.2818, 2012-09-15 00:38:40-04:00, stenn@deacon.udel.edu
+ generated parser file cleanup
+
+ ntpd/keyword-gen-utd@1.17 +1 -1
+ generated parser file cleanup
+
+ ntpd/ntp_keyword.h@1.19 +995 -989
+ generated parser file cleanup
+
+ ntpd/ntp_parser.c@1.80 +1015 -1002
+ generated parser file cleanup
+
+ ntpd/ntp_parser.h@1.46 +367 -365
+ generated parser file cleanup
+
+ChangeSet@1.2817, 2012-09-15 00:35:46-04:00, stenn@deacon.udel.edu
+ [Bug 2258] Add syslog message about leap insertion
+
+ ChangeLog@1.1187 +1 -0
+ [Bug 2258] Add syslog message about leap insertion
+
+ ntpd/ntp_timer.c@1.70 +6 -5
+ [Bug 2258] Add syslog message about leap insertion
+
+ChangeSet@1.2816, 2012-09-14 23:42:10-04:00, stenn@deacon.udel.edu
+ [Bug 1232] Convert SHM refclock to use struct timespec
+
+ ChangeLog@1.1186 +1 -0
+ [Bug 1232] Convert SHM refclock to use struct timespec
+
+ ntpd/refclock_shm.c@1.26 +25 -33
+ [Bug 1232] Convert SHM refclock to use struct timespec
+
+ChangeSet@1.2815, 2012-09-14 18:45:55-04:00, stenn@psp-deb1.ntp.org
+ Updates to driver28.html
+
+ ChangeLog@1.1185 +1 -0
+ Updates to driver28.html
+
+ html/drivers/driver28.html@1.14 +26 -25
+ Updates to driver28.html
+
+ChangeSet@1.2814, 2012-09-14 18:44:39-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2263] broadcast server doesn't work for host with OS_MISSES_SPECIFIC_ROUTE_UPDATES
+
+ ChangeLog@1.1184 +2 -0
+ [Bug 2263] broadcast server doesn't work for host with OS_MISSES_SPECIFIC_ROUTE_UPDATES
+
+ include/ntp.h@1.206 +2 -1
+ [Bug 2263] broadcast server doesn't work for host with OS_MISSES_SPECIFIC_ROUTE_UPDATES
+
+ ntpd/keyword-gen.c@1.22 +1 -0
+ [Bug 2263] broadcast server doesn't work for host with OS_MISSES_SPECIFIC_ROUTE_UPDATES
+
+ ntpd/ntp_io.c@1.370 +49 -35
+ [Bug 2263] broadcast server doesn't work for host with OS_MISSES_SPECIFIC_ROUTE_UPDATES
+
+ ntpd/ntp_parser.y@1.74 +3 -0
+ [Bug 2263] broadcast server doesn't work for host with OS_MISSES_SPECIFIC_ROUTE_UPDATES
+
+ChangeSet@1.2813, 2012-09-14 18:33:31-04:00, stenn@psp-deb1.ntp.org
+ [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6
+
+ ChangeLog@1.1183 +1 -0
+ [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6
+
+ configure.ac@1.551 +0 -27
+ [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6
+
+ include/libntp.h@1.3 +0 -2
+ [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6
+
+ ntpd/ntp_config.c@1.303 +0 -84
+ [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6
+
+ ntpd/ntp_io.c@1.369 +15 -3
+ [Bug 752] Use proper ToS network packet markings for IPv4 and IPv6
+
+ChangeSet@1.2812, 2012-09-09 19:05:06-04:00, stenn@deacon.udel.edu
+ [Bug 2271] Decode refclock types when built with --disable-all-clocks.
+
+ ChangeLog@1.1182 +1 -0
+ [Bug 2271] Decode refclock types when built with --disable-all-clocks.
+
+ include/ntp_net.h@1.12 +0 -4
+ [Bug 2271] Decode refclock types when built with --disable-all-clocks.
+
+ ntpd/ntp_peer.c@1.153 +8 -3
+ [Bug 2271] Decode refclock types when built with --disable-all-clocks.
+
+ChangeSet@1.2811, 2012-09-06 08:28:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P304
+ TAG: NTP_4_2_7P304
+
+ ChangeLog@1.1181 +1 -0
+ NTP_4_2_7P304
+
+ ntpd/invoke-ntpd.texi@1.293 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.conf.5man@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.conf.5mdoc@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.conf.man.in@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.conf.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.keys.5man@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.keys.5mdoc@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.keys.man.in@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntp.keys.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntpd-opts.c@1.311 +4 -4
+ NTP_4_2_7P304
+
+ ntpd/ntpd-opts.h@1.311 +3 -3
+ NTP_4_2_7P304
+
+ ntpd/ntpd.1ntpdman@1.122 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntpd.1ntpdmdoc@1.122 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntpd.man.in@1.122 +2 -2
+ NTP_4_2_7P304
+
+ ntpd/ntpd.mdoc.in@1.122 +2 -2
+ NTP_4_2_7P304
+
+ ntpdc/invoke-ntpdc.texi@1.290 +2 -2
+ NTP_4_2_7P304
+
+ ntpdc/ntpdc-opts.c@1.305 +4 -4
+ NTP_4_2_7P304
+
+ ntpdc/ntpdc-opts.h@1.305 +3 -3
+ NTP_4_2_7P304
+
+ ntpdc/ntpdc.1ntpdcman@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpdc/ntpdc.html@1.133 +2 -2
+ NTP_4_2_7P304
+
+ ntpdc/ntpdc.man.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpdc/ntpdc.mdoc.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpq/invoke-ntpq.texi@1.292 +2 -2
+ NTP_4_2_7P304
+
+ ntpq/ntpq-opts.c@1.307 +4 -4
+ NTP_4_2_7P304
+
+ ntpq/ntpq-opts.h@1.307 +3 -3
+ NTP_4_2_7P304
+
+ ntpq/ntpq.1ntpqman@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpq/ntpq.1ntpqmdoc@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpq/ntpq.man.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpq/ntpq.mdoc.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.292 +2 -2
+ NTP_4_2_7P304
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.307 +4 -4
+ NTP_4_2_7P304
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.307 +3 -3
+ NTP_4_2_7P304
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpsnmpd/ntpsnmpd.man.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ packageinfo.sh@1.307 +1 -1
+ NTP_4_2_7P304
+
+ scripts/invoke-ntp-wait.texi@1.110 +1 -1
+ NTP_4_2_7P304
+
+ scripts/ntp-wait.1ntp-waitman@1.121 +2 -2
+ NTP_4_2_7P304
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.121 +2 -2
+ NTP_4_2_7P304
+
+ scripts/ntp-wait.html@1.125 +1 -1
+ NTP_4_2_7P304
+
+ scripts/ntp-wait.man.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ scripts/ntp-wait.mdoc.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ sntp/invoke-sntp.texi@1.288 +2 -2
+ NTP_4_2_7P304
+
+ sntp/sntp-opts.c@1.303 +4 -4
+ NTP_4_2_7P304
+
+ sntp/sntp-opts.h@1.303 +3 -3
+ NTP_4_2_7P304
+
+ sntp/sntp.1sntpman@1.123 +2 -2
+ NTP_4_2_7P304
+
+ sntp/sntp.1sntpmdoc@1.123 +2 -2
+ NTP_4_2_7P304
+
+ sntp/sntp.html@1.303 +2 -2
+ NTP_4_2_7P304
+
+ sntp/sntp.man.in@1.123 +2 -2
+ NTP_4_2_7P304
+
+ sntp/sntp.mdoc.in@1.123 +2 -2
+ NTP_4_2_7P304
+
+ util/invoke-ntp-keygen.texi@1.293 +2 -2
+ NTP_4_2_7P304
+
+ util/ntp-keygen-opts.c@1.307 +4 -4
+ NTP_4_2_7P304
+
+ util/ntp-keygen-opts.h@1.307 +3 -3
+ NTP_4_2_7P304
+
+ util/ntp-keygen.1ntp-keygenman@1.121 +2 -2
+ NTP_4_2_7P304
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.121 +2 -2
+ NTP_4_2_7P304
+
+ util/ntp-keygen.man.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ util/ntp-keygen.mdoc.in@1.121 +2 -2
+ NTP_4_2_7P304
+
+ChangeSet@1.2810, 2012-09-06 00:56:00-04:00, stenn@deacon.udel.edu
+ In refclock_wwv.c rename SECOND to WWV_SEC and MINUTE to WWV_MIN
+
+ ChangeLog@1.1180 +1 -0
+ In refclock_wwv.c rename SECOND to WWV_SEC and MINUTE to WWV_MIN
+
+ ntpd/refclock_wwv.c@1.78 +29 -29
+ In refclock_wwv.c rename SECOND to WWV_SEC and MINUTE to WWV_MIN
+
+ChangeSet@1.2809, 2012-09-05 21:13:07-04:00, stenn@deacon.udel.edu
+ [Bug 2264] Cleanup SEL240X Refclock
+
+ ChangeLog@1.1179 +1 -0
+ [Bug 2264] Cleanup SEL240X Refclock
+
+ libparse/clk_sel240x.c@1.2 +13 -29
+ [Bug 2264] Cleanup SEL240X Refclock
+
+ChangeSet@1.2808, 2012-09-05 20:02:15+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P303
+ TAG: NTP_4_2_7P303
+
+ ChangeLog@1.1178 +1 -0
+ NTP_4_2_7P303
+
+ ntpd/invoke-ntpd.texi@1.292 +2 -2
+ NTP_4_2_7P303
+
+ ntpd/ntp.conf.5man@1.9 +2 -2
+ NTP_4_2_7P303
+
+ ntpd/ntp.conf.5mdoc@1.9 +1 -1
+ NTP_4_2_7P303
+
+ ntpd/ntp.conf.man.in@1.9 +2 -2
+ NTP_4_2_7P303
+
+ ntpd/ntp.conf.mdoc.in@1.9 +1 -1
+ NTP_4_2_7P303
+
+ ntpd/ntp.keys.5man@1.9 +2 -2
+ NTP_4_2_7P303
+
+ ntpd/ntp.keys.5mdoc@1.9 +1 -1
+ NTP_4_2_7P303
+
+ ntpd/ntp.keys.man.in@1.9 +2 -2
+ NTP_4_2_7P303
+
+ ntpd/ntp.keys.mdoc.in@1.9 +1 -1
+ NTP_4_2_7P303
+
+ ntpd/ntpd-opts.c@1.310 +4 -4
+ NTP_4_2_7P303
+
+ ntpd/ntpd-opts.h@1.310 +3 -3
+ NTP_4_2_7P303
+
+ ntpd/ntpd.1ntpdman@1.121 +2 -2
+ NTP_4_2_7P303
+
+ ntpd/ntpd.1ntpdmdoc@1.121 +1 -1
+ NTP_4_2_7P303
+
+ ntpd/ntpd.man.in@1.121 +2 -2
+ NTP_4_2_7P303
+
+ ntpd/ntpd.mdoc.in@1.121 +1 -1
+ NTP_4_2_7P303
+
+ ntpdc/invoke-ntpdc.texi@1.289 +2 -2
+ NTP_4_2_7P303
+
+ ntpdc/ntpdc-opts.c@1.304 +4 -4
+ NTP_4_2_7P303
+
+ ntpdc/ntpdc-opts.h@1.304 +3 -3
+ NTP_4_2_7P303
+
+ ntpdc/ntpdc.1ntpdcman@1.120 +2 -2
+ NTP_4_2_7P303
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.120 +1 -1
+ NTP_4_2_7P303
+
+ ntpdc/ntpdc.html@1.132 +2 -2
+ NTP_4_2_7P303
+
+ ntpdc/ntpdc.man.in@1.120 +2 -2
+ NTP_4_2_7P303
+
+ ntpdc/ntpdc.mdoc.in@1.120 +1 -1
+ NTP_4_2_7P303
+
+ ntpq/invoke-ntpq.texi@1.291 +2 -2
+ NTP_4_2_7P303
+
+ ntpq/ntpq-opts.c@1.306 +4 -4
+ NTP_4_2_7P303
+
+ ntpq/ntpq-opts.h@1.306 +3 -3
+ NTP_4_2_7P303
+
+ ntpq/ntpq.1ntpqman@1.120 +2 -2
+ NTP_4_2_7P303
+
+ ntpq/ntpq.1ntpqmdoc@1.120 +1 -1
+ NTP_4_2_7P303
+
+ ntpq/ntpq.man.in@1.120 +2 -2
+ NTP_4_2_7P303
+
+ ntpq/ntpq.mdoc.in@1.120 +1 -1
+ NTP_4_2_7P303
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.291 +2 -2
+ NTP_4_2_7P303
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.306 +4 -4
+ NTP_4_2_7P303
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.306 +3 -3
+ NTP_4_2_7P303
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.120 +2 -2
+ NTP_4_2_7P303
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.120 +1 -1
+ NTP_4_2_7P303
+
+ ntpsnmpd/ntpsnmpd.man.in@1.120 +2 -2
+ NTP_4_2_7P303
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.120 +1 -1
+ NTP_4_2_7P303
+
+ packageinfo.sh@1.306 +1 -1
+ NTP_4_2_7P303
+
+ scripts/invoke-ntp-wait.texi@1.109 +1 -1
+ NTP_4_2_7P303
+
+ scripts/ntp-wait.1ntp-waitman@1.120 +2 -2
+ NTP_4_2_7P303
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.120 +1 -1
+ NTP_4_2_7P303
+
+ scripts/ntp-wait.html@1.124 +1 -1
+ NTP_4_2_7P303
+
+ scripts/ntp-wait.man.in@1.120 +2 -2
+ NTP_4_2_7P303
+
+ scripts/ntp-wait.mdoc.in@1.120 +1 -1
+ NTP_4_2_7P303
+
+ sntp/invoke-sntp.texi@1.287 +2 -2
+ NTP_4_2_7P303
+
+ sntp/sntp-opts.c@1.302 +4 -4
+ NTP_4_2_7P303
+
+ sntp/sntp-opts.h@1.302 +3 -3
+ NTP_4_2_7P303
+
+ sntp/sntp.1sntpman@1.122 +2 -2
+ NTP_4_2_7P303
+
+ sntp/sntp.1sntpmdoc@1.122 +1 -1
+ NTP_4_2_7P303
+
+ sntp/sntp.html@1.302 +2 -2
+ NTP_4_2_7P303
+
+ sntp/sntp.man.in@1.122 +2 -2
+ NTP_4_2_7P303
+
+ sntp/sntp.mdoc.in@1.122 +1 -1
+ NTP_4_2_7P303
+
+ util/invoke-ntp-keygen.texi@1.292 +2 -2
+ NTP_4_2_7P303
+
+ util/ntp-keygen-opts.c@1.306 +4 -4
+ NTP_4_2_7P303
+
+ util/ntp-keygen-opts.h@1.306 +3 -3
+ NTP_4_2_7P303
+
+ util/ntp-keygen.1ntp-keygenman@1.120 +2 -2
+ NTP_4_2_7P303
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.120 +1 -1
+ NTP_4_2_7P303
+
+ util/ntp-keygen.man.in@1.120 +2 -2
+ NTP_4_2_7P303
+
+ util/ntp-keygen.mdoc.in@1.120 +1 -1
+ NTP_4_2_7P303
+
+ChangeSet@1.2807, 2012-09-05 15:13:58-04:00, stenn@deacon.udel.edu
+ [Bug 1232] Add nanosecond support to SHM driver
+
+ ChangeLog@1.1177 +1 -0
+ [Bug 1232] Add nanosecond support to SHM driver
+
+ ntpd/refclock_shm.c@1.25 +134 -86
+ [Bug 1232] Add nanosecond support to SHM driver
+
+ChangeSet@1.2806, 2012-09-05 11:49:16+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P302
+ TAG: NTP_4_2_7P302
+
+ ChangeLog@1.1176 +1 -0
+ NTP_4_2_7P302
+
+ ntpd/invoke-ntpd.texi@1.291 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.conf.5man@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.conf.5mdoc@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.conf.man.in@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.conf.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.keys.5man@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.keys.5mdoc@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.keys.man.in@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntp.keys.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntpd-opts.c@1.309 +4 -4
+ NTP_4_2_7P302
+
+ ntpd/ntpd-opts.h@1.309 +3 -3
+ NTP_4_2_7P302
+
+ ntpd/ntpd.1ntpdman@1.120 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntpd.1ntpdmdoc@1.120 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntpd.man.in@1.120 +2 -2
+ NTP_4_2_7P302
+
+ ntpd/ntpd.mdoc.in@1.120 +2 -2
+ NTP_4_2_7P302
+
+ ntpdc/invoke-ntpdc.texi@1.288 +2 -2
+ NTP_4_2_7P302
+
+ ntpdc/ntpdc-opts.c@1.303 +4 -4
+ NTP_4_2_7P302
+
+ ntpdc/ntpdc-opts.h@1.303 +3 -3
+ NTP_4_2_7P302
+
+ ntpdc/ntpdc.1ntpdcman@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpdc/ntpdc.html@1.131 +2 -2
+ NTP_4_2_7P302
+
+ ntpdc/ntpdc.man.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpdc/ntpdc.mdoc.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpq/invoke-ntpq.texi@1.290 +2 -2
+ NTP_4_2_7P302
+
+ ntpq/ntpq-opts.c@1.305 +4 -4
+ NTP_4_2_7P302
+
+ ntpq/ntpq-opts.h@1.305 +3 -3
+ NTP_4_2_7P302
+
+ ntpq/ntpq.1ntpqman@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpq/ntpq.1ntpqmdoc@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpq/ntpq.man.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpq/ntpq.mdoc.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.290 +2 -2
+ NTP_4_2_7P302
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.305 +4 -4
+ NTP_4_2_7P302
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.305 +3 -3
+ NTP_4_2_7P302
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpsnmpd/ntpsnmpd.man.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ packageinfo.sh@1.305 +1 -1
+ NTP_4_2_7P302
+
+ scripts/invoke-ntp-wait.texi@1.108 +1 -1
+ NTP_4_2_7P302
+
+ scripts/ntp-wait.1ntp-waitman@1.119 +2 -2
+ NTP_4_2_7P302
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.119 +2 -2
+ NTP_4_2_7P302
+
+ scripts/ntp-wait.html@1.123 +1 -1
+ NTP_4_2_7P302
+
+ scripts/ntp-wait.man.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ scripts/ntp-wait.mdoc.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ sntp/invoke-sntp.texi@1.286 +2 -2
+ NTP_4_2_7P302
+
+ sntp/sntp-opts.c@1.301 +4 -4
+ NTP_4_2_7P302
+
+ sntp/sntp-opts.h@1.301 +3 -3
+ NTP_4_2_7P302
+
+ sntp/sntp.1sntpman@1.121 +2 -2
+ NTP_4_2_7P302
+
+ sntp/sntp.1sntpmdoc@1.121 +2 -2
+ NTP_4_2_7P302
+
+ sntp/sntp.html@1.301 +2 -2
+ NTP_4_2_7P302
+
+ sntp/sntp.man.in@1.121 +2 -2
+ NTP_4_2_7P302
+
+ sntp/sntp.mdoc.in@1.121 +2 -2
+ NTP_4_2_7P302
+
+ util/invoke-ntp-keygen.texi@1.291 +2 -2
+ NTP_4_2_7P302
+
+ util/ntp-keygen-opts.c@1.305 +4 -4
+ NTP_4_2_7P302
+
+ util/ntp-keygen-opts.h@1.305 +3 -3
+ NTP_4_2_7P302
+
+ util/ntp-keygen.1ntp-keygenman@1.119 +2 -2
+ NTP_4_2_7P302
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.119 +2 -2
+ NTP_4_2_7P302
+
+ util/ntp-keygen.man.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ util/ntp-keygen.mdoc.in@1.119 +2 -2
+ NTP_4_2_7P302
+
+ChangeSet@1.2805, 2012-09-05 06:33:07-04:00, stenn@deacon.udel.edu
+ [Bug 2160] Log warning about expired leapseconds file
+
+ ChangeLog@1.1175 +1 -0
+ [Bug 2160] Log warning about expired leapseconds file
+
+ ntpd/ntp_timer.c@1.69 +9 -1
+ [Bug 2160] Log warning about expired leapseconds file
+
+ChangeSet@1.2804, 2012-09-03 11:47:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P301
+ TAG: NTP_4_2_7P301
+
+ ChangeLog@1.1174 +1 -0
+ NTP_4_2_7P301
+
+ ntpd/invoke-ntpd.texi@1.290 +2 -2
+ NTP_4_2_7P301
+
+ ntpd/ntp.conf.5man@1.7 +2 -2
+ NTP_4_2_7P301
+
+ ntpd/ntp.conf.5mdoc@1.7 +1 -1
+ NTP_4_2_7P301
+
+ ntpd/ntp.conf.man.in@1.7 +2 -2
+ NTP_4_2_7P301
+
+ ntpd/ntp.conf.mdoc.in@1.7 +1 -1
+ NTP_4_2_7P301
+
+ ntpd/ntp.keys.5man@1.7 +2 -2
+ NTP_4_2_7P301
+
+ ntpd/ntp.keys.5mdoc@1.7 +1 -1
+ NTP_4_2_7P301
+
+ ntpd/ntp.keys.man.in@1.7 +2 -2
+ NTP_4_2_7P301
+
+ ntpd/ntp.keys.mdoc.in@1.7 +1 -1
+ NTP_4_2_7P301
+
+ ntpd/ntpd-opts.c@1.308 +4 -4
+ NTP_4_2_7P301
+
+ ntpd/ntpd-opts.h@1.308 +3 -3
+ NTP_4_2_7P301
+
+ ntpd/ntpd.1ntpdman@1.119 +2 -2
+ NTP_4_2_7P301
+
+ ntpd/ntpd.1ntpdmdoc@1.119 +1 -1
+ NTP_4_2_7P301
+
+ ntpd/ntpd.man.in@1.119 +2 -2
+ NTP_4_2_7P301
+
+ ntpd/ntpd.mdoc.in@1.119 +1 -1
+ NTP_4_2_7P301
+
+ ntpdc/invoke-ntpdc.texi@1.287 +2 -2
+ NTP_4_2_7P301
+
+ ntpdc/ntpdc-opts.c@1.302 +4 -4
+ NTP_4_2_7P301
+
+ ntpdc/ntpdc-opts.h@1.302 +3 -3
+ NTP_4_2_7P301
+
+ ntpdc/ntpdc.1ntpdcman@1.118 +2 -2
+ NTP_4_2_7P301
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.118 +1 -1
+ NTP_4_2_7P301
+
+ ntpdc/ntpdc.html@1.130 +2 -2
+ NTP_4_2_7P301
+
+ ntpdc/ntpdc.man.in@1.118 +2 -2
+ NTP_4_2_7P301
+
+ ntpdc/ntpdc.mdoc.in@1.118 +1 -1
+ NTP_4_2_7P301
+
+ ntpq/invoke-ntpq.texi@1.289 +2 -2
+ NTP_4_2_7P301
+
+ ntpq/ntpq-opts.c@1.304 +4 -4
+ NTP_4_2_7P301
+
+ ntpq/ntpq-opts.h@1.304 +3 -3
+ NTP_4_2_7P301
+
+ ntpq/ntpq.1ntpqman@1.118 +2 -2
+ NTP_4_2_7P301
+
+ ntpq/ntpq.1ntpqmdoc@1.118 +1 -1
+ NTP_4_2_7P301
+
+ ntpq/ntpq.man.in@1.118 +2 -2
+ NTP_4_2_7P301
+
+ ntpq/ntpq.mdoc.in@1.118 +1 -1
+ NTP_4_2_7P301
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.289 +2 -2
+ NTP_4_2_7P301
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.304 +4 -4
+ NTP_4_2_7P301
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.304 +3 -3
+ NTP_4_2_7P301
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.118 +2 -2
+ NTP_4_2_7P301
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.118 +1 -1
+ NTP_4_2_7P301
+
+ ntpsnmpd/ntpsnmpd.man.in@1.118 +2 -2
+ NTP_4_2_7P301
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.118 +1 -1
+ NTP_4_2_7P301
+
+ packageinfo.sh@1.304 +1 -1
+ NTP_4_2_7P301
+
+ scripts/invoke-ntp-wait.texi@1.107 +1 -1
+ NTP_4_2_7P301
+
+ scripts/ntp-wait.1ntp-waitman@1.118 +2 -2
+ NTP_4_2_7P301
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.118 +1 -1
+ NTP_4_2_7P301
+
+ scripts/ntp-wait.html@1.122 +1 -1
+ NTP_4_2_7P301
+
+ scripts/ntp-wait.man.in@1.118 +2 -2
+ NTP_4_2_7P301
+
+ scripts/ntp-wait.mdoc.in@1.118 +1 -1
+ NTP_4_2_7P301
+
+ sntp/invoke-sntp.texi@1.285 +2 -2
+ NTP_4_2_7P301
+
+ sntp/sntp-opts.c@1.300 +4 -4
+ NTP_4_2_7P301
+
+ sntp/sntp-opts.h@1.300 +3 -3
+ NTP_4_2_7P301
+
+ sntp/sntp.1sntpman@1.120 +2 -2
+ NTP_4_2_7P301
+
+ sntp/sntp.1sntpmdoc@1.120 +1 -1
+ NTP_4_2_7P301
+
+ sntp/sntp.html@1.300 +2 -2
+ NTP_4_2_7P301
+
+ sntp/sntp.man.in@1.120 +2 -2
+ NTP_4_2_7P301
+
+ sntp/sntp.mdoc.in@1.120 +1 -1
+ NTP_4_2_7P301
+
+ util/invoke-ntp-keygen.texi@1.290 +2 -2
+ NTP_4_2_7P301
+
+ util/ntp-keygen-opts.c@1.304 +4 -4
+ NTP_4_2_7P301
+
+ util/ntp-keygen-opts.h@1.304 +3 -3
+ NTP_4_2_7P301
+
+ util/ntp-keygen.1ntp-keygenman@1.118 +2 -2
+ NTP_4_2_7P301
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.118 +1 -1
+ NTP_4_2_7P301
+
+ util/ntp-keygen.man.in@1.118 +2 -2
+ NTP_4_2_7P301
+
+ util/ntp-keygen.mdoc.in@1.118 +1 -1
+ NTP_4_2_7P301
+
+ChangeSet@1.2803, 2012-09-03 05:13:00-04:00, stenn@deacon.udel.edu
+ [Bug 2164] Greater precision needed for ntpq offset report
+
+ ChangeLog@1.1173 +1 -0
+ [Bug 2164] Greater precision needed for ntpq offset report
+
+ ntpd/ntp_control.c@1.183 +4 -2
+ [Bug 2164] Greater precision needed for ntpq offset report
+
+ChangeSet@1.2802, 2012-09-03 03:20:41-04:00, stenn@deacon.udel.edu
+ Clean the man5_MANS in ntpd/
+
+ ChangeLog@1.1172 +1 -0
+ Clean the man5_MANS in ntpd/
+
+ ntpd/Makefile.am@1.122 +1 -0
+ Clean the man5_MANS in ntpd/
+
+ChangeSet@1.2801, 2012-09-03 06:02:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P300
+ TAG: NTP_4_2_7P300
+
+ ChangeLog@1.1171 +1 -0
+ NTP_4_2_7P300
+
+ ntpd/invoke-ntpd.texi@1.289 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.conf.5man@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.conf.5mdoc@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.conf.man.in@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.conf.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.keys.5man@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.keys.5mdoc@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.keys.man.in@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntp.keys.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntpd-opts.c@1.307 +4 -4
+ NTP_4_2_7P300
+
+ ntpd/ntpd-opts.h@1.307 +3 -3
+ NTP_4_2_7P300
+
+ ntpd/ntpd.1ntpdman@1.118 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntpd.1ntpdmdoc@1.118 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntpd.man.in@1.118 +2 -2
+ NTP_4_2_7P300
+
+ ntpd/ntpd.mdoc.in@1.118 +2 -2
+ NTP_4_2_7P300
+
+ ntpdc/invoke-ntpdc.texi@1.286 +2 -2
+ NTP_4_2_7P300
+
+ ntpdc/ntpdc-opts.c@1.301 +4 -4
+ NTP_4_2_7P300
+
+ ntpdc/ntpdc-opts.h@1.301 +3 -3
+ NTP_4_2_7P300
+
+ ntpdc/ntpdc.1ntpdcman@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpdc/ntpdc.html@1.129 +2 -2
+ NTP_4_2_7P300
+
+ ntpdc/ntpdc.man.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpdc/ntpdc.mdoc.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpq/invoke-ntpq.texi@1.288 +2 -2
+ NTP_4_2_7P300
+
+ ntpq/ntpq-opts.c@1.303 +4 -4
+ NTP_4_2_7P300
+
+ ntpq/ntpq-opts.h@1.303 +3 -3
+ NTP_4_2_7P300
+
+ ntpq/ntpq.1ntpqman@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpq/ntpq.1ntpqmdoc@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpq/ntpq.man.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpq/ntpq.mdoc.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.288 +2 -2
+ NTP_4_2_7P300
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.303 +4 -4
+ NTP_4_2_7P300
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.303 +3 -3
+ NTP_4_2_7P300
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpsnmpd/ntpsnmpd.man.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ packageinfo.sh@1.303 +1 -1
+ NTP_4_2_7P300
+
+ scripts/invoke-ntp-wait.texi@1.106 +1 -1
+ NTP_4_2_7P300
+
+ scripts/ntp-wait.1ntp-waitman@1.117 +2 -2
+ NTP_4_2_7P300
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.117 +2 -2
+ NTP_4_2_7P300
+
+ scripts/ntp-wait.html@1.121 +1 -1
+ NTP_4_2_7P300
+
+ scripts/ntp-wait.man.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ scripts/ntp-wait.mdoc.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ sntp/invoke-sntp.texi@1.284 +2 -2
+ NTP_4_2_7P300
+
+ sntp/sntp-opts.c@1.299 +4 -4
+ NTP_4_2_7P300
+
+ sntp/sntp-opts.h@1.299 +3 -3
+ NTP_4_2_7P300
+
+ sntp/sntp.1sntpman@1.119 +2 -2
+ NTP_4_2_7P300
+
+ sntp/sntp.1sntpmdoc@1.119 +2 -2
+ NTP_4_2_7P300
+
+ sntp/sntp.html@1.299 +2 -2
+ NTP_4_2_7P300
+
+ sntp/sntp.man.in@1.119 +2 -2
+ NTP_4_2_7P300
+
+ sntp/sntp.mdoc.in@1.119 +2 -2
+ NTP_4_2_7P300
+
+ util/invoke-ntp-keygen.texi@1.289 +2 -2
+ NTP_4_2_7P300
+
+ util/ntp-keygen-opts.c@1.303 +4 -4
+ NTP_4_2_7P300
+
+ util/ntp-keygen-opts.h@1.303 +3 -3
+ NTP_4_2_7P300
+
+ util/ntp-keygen.1ntp-keygenman@1.117 +2 -2
+ NTP_4_2_7P300
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.117 +2 -2
+ NTP_4_2_7P300
+
+ util/ntp-keygen.man.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ util/ntp-keygen.mdoc.in@1.117 +2 -2
+ NTP_4_2_7P300
+
+ChangeSet@1.2791.1.3, 2012-09-02 03:42:22-04:00, stenn@psp-deb1.ntp.org
+ Installing html docs is bug 2262
+
+ ChangeLog@1.1161.1.3 +1 -1
+ Installing html docs is bug 2262
+
+ChangeSet@1.2791.1.2, 2012-09-02 03:35:48-04:00, stenn@psp-deb1.ntp.org
+ Install sntp.html into htmldir
+
+ ChangeLog@1.1161.1.2 +1 -0
+ Install sntp.html into htmldir
+
+ sntp/Makefile.am@1.74 +6 -1
+ Install sntp.html into htmldir
+
+ChangeSet@1.2791.1.1, 2012-09-02 03:34:32-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2270] Install fails due to repeated man5 page names
+
+ ChangeLog@1.1161.1.1 +1 -0
+ [Bug 2270] Install fails due to repeated man5 page names
+
+ ntpd/Makefile.am@1.119.1.1 +1 -1
+ [Bug 2270] Install fails due to repeated man5 page names
+
+ChangeSet@1.2799, 2012-09-01 18:38:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P299
+ TAG: NTP_4_2_7P299
+
+ ChangeLog@1.1169 +1 -0
+ NTP_4_2_7P299
+
+ ntpd/invoke-ntpd.texi@1.288 +2 -2
+ NTP_4_2_7P299
+
+ ntpd/ntp.conf.5man@1.5 +2 -2
+ NTP_4_2_7P299
+
+ ntpd/ntp.conf.5mdoc@1.5 +1 -1
+ NTP_4_2_7P299
+
+ ntpd/ntp.conf.man.in@1.5 +2 -2
+ NTP_4_2_7P299
+
+ ntpd/ntp.conf.mdoc.in@1.5 +1 -1
+ NTP_4_2_7P299
+
+ ntpd/ntp.keys.5man@1.5 +2 -2
+ NTP_4_2_7P299
+
+ ntpd/ntp.keys.5mdoc@1.5 +1 -1
+ NTP_4_2_7P299
+
+ ntpd/ntp.keys.man.in@1.5 +2 -2
+ NTP_4_2_7P299
+
+ ntpd/ntp.keys.mdoc.in@1.5 +1 -1
+ NTP_4_2_7P299
+
+ ntpd/ntpd-opts.c@1.306 +4 -4
+ NTP_4_2_7P299
+
+ ntpd/ntpd-opts.h@1.306 +3 -3
+ NTP_4_2_7P299
+
+ ntpd/ntpd.1ntpdman@1.117 +2 -2
+ NTP_4_2_7P299
+
+ ntpd/ntpd.1ntpdmdoc@1.117 +1 -1
+ NTP_4_2_7P299
+
+ ntpd/ntpd.man.in@1.117 +2 -2
+ NTP_4_2_7P299
+
+ ntpd/ntpd.mdoc.in@1.117 +1 -1
+ NTP_4_2_7P299
+
+ ntpdc/invoke-ntpdc.texi@1.285 +2 -2
+ NTP_4_2_7P299
+
+ ntpdc/ntpdc-opts.c@1.300 +4 -4
+ NTP_4_2_7P299
+
+ ntpdc/ntpdc-opts.h@1.300 +3 -3
+ NTP_4_2_7P299
+
+ ntpdc/ntpdc.1ntpdcman@1.116 +2 -2
+ NTP_4_2_7P299
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.116 +1 -1
+ NTP_4_2_7P299
+
+ ntpdc/ntpdc.html@1.128 +2 -2
+ NTP_4_2_7P299
+
+ ntpdc/ntpdc.man.in@1.116 +2 -2
+ NTP_4_2_7P299
+
+ ntpdc/ntpdc.mdoc.in@1.116 +1 -1
+ NTP_4_2_7P299
+
+ ntpq/invoke-ntpq.texi@1.287 +2 -2
+ NTP_4_2_7P299
+
+ ntpq/ntpq-opts.c@1.302 +4 -4
+ NTP_4_2_7P299
+
+ ntpq/ntpq-opts.h@1.302 +3 -3
+ NTP_4_2_7P299
+
+ ntpq/ntpq.1ntpqman@1.116 +2 -2
+ NTP_4_2_7P299
+
+ ntpq/ntpq.1ntpqmdoc@1.116 +1 -1
+ NTP_4_2_7P299
+
+ ntpq/ntpq.man.in@1.116 +2 -2
+ NTP_4_2_7P299
+
+ ntpq/ntpq.mdoc.in@1.116 +1 -1
+ NTP_4_2_7P299
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.287 +2 -2
+ NTP_4_2_7P299
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.302 +4 -4
+ NTP_4_2_7P299
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.302 +3 -3
+ NTP_4_2_7P299
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.116 +2 -2
+ NTP_4_2_7P299
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.116 +1 -1
+ NTP_4_2_7P299
+
+ ntpsnmpd/ntpsnmpd.man.in@1.116 +2 -2
+ NTP_4_2_7P299
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.116 +1 -1
+ NTP_4_2_7P299
+
+ packageinfo.sh@1.302 +1 -1
+ NTP_4_2_7P299
+
+ scripts/invoke-ntp-wait.texi@1.105 +1 -1
+ NTP_4_2_7P299
+
+ scripts/ntp-wait.1ntp-waitman@1.116 +2 -2
+ NTP_4_2_7P299
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.116 +1 -1
+ NTP_4_2_7P299
+
+ scripts/ntp-wait.html@1.120 +1 -1
+ NTP_4_2_7P299
+
+ scripts/ntp-wait.man.in@1.116 +2 -2
+ NTP_4_2_7P299
+
+ scripts/ntp-wait.mdoc.in@1.116 +1 -1
+ NTP_4_2_7P299
+
+ sntp/invoke-sntp.texi@1.283 +2 -2
+ NTP_4_2_7P299
+
+ sntp/sntp-opts.c@1.298 +4 -4
+ NTP_4_2_7P299
+
+ sntp/sntp-opts.h@1.298 +3 -3
+ NTP_4_2_7P299
+
+ sntp/sntp.1sntpman@1.118 +2 -2
+ NTP_4_2_7P299
+
+ sntp/sntp.1sntpmdoc@1.118 +1 -1
+ NTP_4_2_7P299
+
+ sntp/sntp.html@1.298 +2 -2
+ NTP_4_2_7P299
+
+ sntp/sntp.man.in@1.118 +2 -2
+ NTP_4_2_7P299
+
+ sntp/sntp.mdoc.in@1.118 +1 -1
+ NTP_4_2_7P299
+
+ util/invoke-ntp-keygen.texi@1.288 +2 -2
+ NTP_4_2_7P299
+
+ util/ntp-keygen-opts.c@1.302 +4 -4
+ NTP_4_2_7P299
+
+ util/ntp-keygen-opts.h@1.302 +3 -3
+ NTP_4_2_7P299
+
+ util/ntp-keygen.1ntp-keygenman@1.116 +2 -2
+ NTP_4_2_7P299
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.116 +1 -1
+ NTP_4_2_7P299
+
+ util/ntp-keygen.man.in@1.116 +2 -2
+ NTP_4_2_7P299
+
+ util/ntp-keygen.mdoc.in@1.116 +1 -1
+ NTP_4_2_7P299
+
+ChangeSet@1.2798, 2012-09-01 14:24:07-04:00, stenn@deacon.udel.edu
+ More cleanup to the bootstrap script
+
+ ChangeLog@1.1168 +1 -0
+ More cleanup to the bootstrap script
+
+ bootstrap@1.41 +4 -2
+ More cleanup to the bootstrap script
+
+ChangeSet@1.2797, 2012-09-01 04:07:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P298
+ TAG: NTP_4_2_7P298
+
+ ChangeLog@1.1167 +1 -0
+ NTP_4_2_7P298
+
+ ntpd/invoke-ntpd.texi@1.287 +2 -2
+ NTP_4_2_7P298
+
+ ntpd/ntp.conf.5man@1.4 +2 -2
+ NTP_4_2_7P298
+
+ ntpd/ntp.conf.5mdoc@1.4 +1 -1
+ NTP_4_2_7P298
+
+ ntpd/ntp.conf.man.in@1.4 +2 -2
+ NTP_4_2_7P298
+
+ ntpd/ntp.conf.mdoc.in@1.4 +1 -1
+ NTP_4_2_7P298
+
+ ntpd/ntp.keys.5man@1.4 +2 -2
+ NTP_4_2_7P298
+
+ ntpd/ntp.keys.5mdoc@1.4 +1 -1
+ NTP_4_2_7P298
+
+ ntpd/ntp.keys.man.in@1.4 +2 -2
+ NTP_4_2_7P298
+
+ ntpd/ntp.keys.mdoc.in@1.4 +1 -1
+ NTP_4_2_7P298
+
+ ntpd/ntpd-opts.c@1.305 +4 -4
+ NTP_4_2_7P298
+
+ ntpd/ntpd-opts.h@1.305 +3 -3
+ NTP_4_2_7P298
+
+ ntpd/ntpd.1ntpdman@1.116 +2 -2
+ NTP_4_2_7P298
+
+ ntpd/ntpd.1ntpdmdoc@1.116 +1 -1
+ NTP_4_2_7P298
+
+ ntpd/ntpd.man.in@1.116 +2 -2
+ NTP_4_2_7P298
+
+ ntpd/ntpd.mdoc.in@1.116 +1 -1
+ NTP_4_2_7P298
+
+ ntpdc/invoke-ntpdc.texi@1.284 +2 -2
+ NTP_4_2_7P298
+
+ ntpdc/ntpdc-opts.c@1.299 +4 -4
+ NTP_4_2_7P298
+
+ ntpdc/ntpdc-opts.h@1.299 +3 -3
+ NTP_4_2_7P298
+
+ ntpdc/ntpdc.1ntpdcman@1.115 +2 -2
+ NTP_4_2_7P298
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.115 +1 -1
+ NTP_4_2_7P298
+
+ ntpdc/ntpdc.html@1.127 +2 -2
+ NTP_4_2_7P298
+
+ ntpdc/ntpdc.man.in@1.115 +2 -2
+ NTP_4_2_7P298
+
+ ntpdc/ntpdc.mdoc.in@1.115 +1 -1
+ NTP_4_2_7P298
+
+ ntpq/invoke-ntpq.texi@1.286 +2 -2
+ NTP_4_2_7P298
+
+ ntpq/ntpq-opts.c@1.301 +4 -4
+ NTP_4_2_7P298
+
+ ntpq/ntpq-opts.h@1.301 +3 -3
+ NTP_4_2_7P298
+
+ ntpq/ntpq.1ntpqman@1.115 +2 -2
+ NTP_4_2_7P298
+
+ ntpq/ntpq.1ntpqmdoc@1.115 +1 -1
+ NTP_4_2_7P298
+
+ ntpq/ntpq.man.in@1.115 +2 -2
+ NTP_4_2_7P298
+
+ ntpq/ntpq.mdoc.in@1.115 +1 -1
+ NTP_4_2_7P298
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.286 +2 -2
+ NTP_4_2_7P298
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.301 +4 -4
+ NTP_4_2_7P298
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.301 +3 -3
+ NTP_4_2_7P298
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.115 +2 -2
+ NTP_4_2_7P298
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.115 +1 -1
+ NTP_4_2_7P298
+
+ ntpsnmpd/ntpsnmpd.man.in@1.115 +2 -2
+ NTP_4_2_7P298
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.115 +1 -1
+ NTP_4_2_7P298
+
+ packageinfo.sh@1.301 +1 -1
+ NTP_4_2_7P298
+
+ scripts/invoke-ntp-wait.texi@1.104 +1 -1
+ NTP_4_2_7P298
+
+ scripts/ntp-wait.1ntp-waitman@1.115 +2 -2
+ NTP_4_2_7P298
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.115 +1 -1
+ NTP_4_2_7P298
+
+ scripts/ntp-wait.html@1.119 +1 -1
+ NTP_4_2_7P298
+
+ scripts/ntp-wait.man.in@1.115 +2 -2
+ NTP_4_2_7P298
+
+ scripts/ntp-wait.mdoc.in@1.115 +1 -1
+ NTP_4_2_7P298
+
+ sntp/invoke-sntp.texi@1.282 +2 -2
+ NTP_4_2_7P298
+
+ sntp/sntp-opts.c@1.297 +4 -4
+ NTP_4_2_7P298
+
+ sntp/sntp-opts.h@1.297 +3 -3
+ NTP_4_2_7P298
+
+ sntp/sntp.1sntpman@1.117 +2 -2
+ NTP_4_2_7P298
+
+ sntp/sntp.1sntpmdoc@1.117 +1 -1
+ NTP_4_2_7P298
+
+ sntp/sntp.html@1.297 +2 -2
+ NTP_4_2_7P298
+
+ sntp/sntp.man.in@1.117 +2 -2
+ NTP_4_2_7P298
+
+ sntp/sntp.mdoc.in@1.117 +1 -1
+ NTP_4_2_7P298
+
+ util/invoke-ntp-keygen.texi@1.287 +2 -2
+ NTP_4_2_7P298
+
+ util/ntp-keygen-opts.c@1.301 +4 -4
+ NTP_4_2_7P298
+
+ util/ntp-keygen-opts.h@1.301 +3 -3
+ NTP_4_2_7P298
+
+ util/ntp-keygen.1ntp-keygenman@1.115 +2 -2
+ NTP_4_2_7P298
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.115 +1 -1
+ NTP_4_2_7P298
+
+ util/ntp-keygen.man.in@1.115 +2 -2
+ NTP_4_2_7P298
+
+ util/ntp-keygen.mdoc.in@1.115 +1 -1
+ NTP_4_2_7P298
+
+ChangeSet@1.2796, 2012-08-31 23:45:41-04:00, stenn@deacon.udel.edu
+ Remove extraneous parens
+
+ ntpdc/ntpdc_ops.c@1.79 +1 -1
+ Remove extraneous parens
+
+ChangeSet@1.2795, 2012-08-31 23:40:43-04:00, stenn@deacon.udel.edu
+ Remove extraneous parens
+
+ ChangeLog@1.1166 +1 -0
+ Remove extraneous parens
+
+ChangeSet@1.2794, 2012-08-31 23:37:42-04:00, stenn@deacon.udel.edu
+ Add a missing "%s" syslog format string
+
+ ChangeLog@1.1165 +1 -0
+ Handle additional man page sections in the bootstrap script
+
+ ChangeLog@1.1164 +1 -0
+ Add a missing "%s" syslog format string
+
+ bootstrap@1.40 +1 -1
+ Handle additional man page sections in the bootstrap script
+
+ ntpd/ntp_config.c@1.302 +1 -1
+ Add a missing "%s" syslog format string
+
+ChangeSet@1.2793, 2012-09-01 00:34:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P297
+ TAG: NTP_4_2_7P297
+
+ ChangeLog@1.1163 +1 -0
+ NTP_4_2_7P297
+
+ ntpd/invoke-ntpd.texi@1.286 +2 -2
+ NTP_4_2_7P297
+
+ ntpd/ntp.conf.5man@1.3 +8 -8
+ NTP_4_2_7P297
+
+ ntpd/ntp.conf.5mdoc@1.3 +2 -2
+ NTP_4_2_7P297
+
+ ntpd/ntp.conf.man.in@1.3 +8 -8
+ NTP_4_2_7P297
+
+ ntpd/ntp.conf.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P297
+
+ ntpd/ntp.keys.5man@1.3 +8 -8
+ NTP_4_2_7P297
+
+ ntpd/ntp.keys.5mdoc@1.3 +2 -2
+ NTP_4_2_7P297
+
+ ntpd/ntp.keys.man.in@1.3 +8 -8
+ NTP_4_2_7P297
+
+ ntpd/ntp.keys.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P297
+
+ ntpd/ntpd-opts.c@1.304 +4 -4
+ NTP_4_2_7P297
+
+ ntpd/ntpd-opts.h@1.304 +3 -3
+ NTP_4_2_7P297
+
+ ntpd/ntpd.1ntpdman@1.115 +27 -27
+ NTP_4_2_7P297
+
+ ntpd/ntpd.1ntpdmdoc@1.115 +2 -2
+ NTP_4_2_7P297
+
+ ntpd/ntpd.man.in@1.115 +27 -27
+ NTP_4_2_7P297
+
+ ntpd/ntpd.mdoc.in@1.115 +2 -2
+ NTP_4_2_7P297
+
+ ntpdc/invoke-ntpdc.texi@1.283 +2 -2
+ NTP_4_2_7P297
+
+ ntpdc/ntpdc-opts.c@1.298 +4 -4
+ NTP_4_2_7P297
+
+ ntpdc/ntpdc-opts.h@1.298 +3 -3
+ NTP_4_2_7P297
+
+ ntpdc/ntpdc.1ntpdcman@1.114 +21 -21
+ NTP_4_2_7P297
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.114 +2 -2
+ NTP_4_2_7P297
+
+ ntpdc/ntpdc.html@1.126 +2 -2
+ NTP_4_2_7P297
+
+ ntpdc/ntpdc.man.in@1.114 +21 -21
+ NTP_4_2_7P297
+
+ ntpdc/ntpdc.mdoc.in@1.114 +2 -2
+ NTP_4_2_7P297
+
+ ntpq/invoke-ntpq.texi@1.285 +2 -2
+ NTP_4_2_7P297
+
+ ntpq/ntpq-opts.c@1.300 +4 -4
+ NTP_4_2_7P297
+
+ ntpq/ntpq-opts.h@1.300 +3 -3
+ NTP_4_2_7P297
+
+ ntpq/ntpq.1ntpqman@1.114 +21 -21
+ NTP_4_2_7P297
+
+ ntpq/ntpq.1ntpqmdoc@1.114 +2 -2
+ NTP_4_2_7P297
+
+ ntpq/ntpq.man.in@1.114 +21 -21
+ NTP_4_2_7P297
+
+ ntpq/ntpq.mdoc.in@1.114 +2 -2
+ NTP_4_2_7P297
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.285 +2 -2
+ NTP_4_2_7P297
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.300 +4 -4
+ NTP_4_2_7P297
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.300 +3 -3
+ NTP_4_2_7P297
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.114 +21 -21
+ NTP_4_2_7P297
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.114 +2 -2
+ NTP_4_2_7P297
+
+ ntpsnmpd/ntpsnmpd.man.in@1.114 +21 -21
+ NTP_4_2_7P297
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.114 +2 -2
+ NTP_4_2_7P297
+
+ packageinfo.sh@1.300 +1 -1
+ NTP_4_2_7P297
+
+ scripts/invoke-ntp-wait.texi@1.103 +1 -1
+ NTP_4_2_7P297
+
+ scripts/ntp-wait.1ntp-waitman@1.114 +13 -13
+ NTP_4_2_7P297
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.114 +2 -2
+ NTP_4_2_7P297
+
+ scripts/ntp-wait.html@1.118 +1 -1
+ NTP_4_2_7P297
+
+ scripts/ntp-wait.man.in@1.114 +13 -13
+ NTP_4_2_7P297
+
+ scripts/ntp-wait.mdoc.in@1.114 +2 -2
+ NTP_4_2_7P297
+
+ sntp/invoke-sntp.texi@1.281 +2 -2
+ NTP_4_2_7P297
+
+ sntp/sntp-opts.c@1.296 +4 -4
+ NTP_4_2_7P297
+
+ sntp/sntp-opts.h@1.296 +3 -3
+ NTP_4_2_7P297
+
+ sntp/sntp.1sntpman@1.116 +68 -68
+ NTP_4_2_7P297
+
+ sntp/sntp.1sntpmdoc@1.116 +2 -2
+ NTP_4_2_7P297
+
+ sntp/sntp.html@1.296 +2 -2
+ NTP_4_2_7P297
+
+ sntp/sntp.man.in@1.116 +68 -68
+ NTP_4_2_7P297
+
+ sntp/sntp.mdoc.in@1.116 +2 -2
+ NTP_4_2_7P297
+
+ util/invoke-ntp-keygen.texi@1.286 +2 -2
+ NTP_4_2_7P297
+
+ util/ntp-keygen-opts.c@1.300 +4 -4
+ NTP_4_2_7P297
+
+ util/ntp-keygen-opts.h@1.300 +3 -3
+ NTP_4_2_7P297
+
+ util/ntp-keygen.1ntp-keygenman@1.114 +32 -32
+ NTP_4_2_7P297
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.114 +2 -2
+ NTP_4_2_7P297
+
+ util/ntp-keygen.man.in@1.114 +32 -32
+ NTP_4_2_7P297
+
+ util/ntp-keygen.mdoc.in@1.114 +2 -2
+ NTP_4_2_7P297
+
+ChangeSet@1.2792, 2012-08-31 14:18:39-04:00, stenn@deacon.udel.edu
+ Distribute ntp.conf.def and ntp.keys.def
+
+ ChangeLog@1.1162 +1 -1
+ Distribute ntp.conf.def and ntp.keys.def
+
+ ntpd/Makefile.am@1.120 +1 -0
+ Distribute ntp.conf.def and ntp.keys.def
+
+ChangeSet@1.2791, 2012-08-31 06:27:38+00:00, stenn@psp-fb1.ntp.org
+ Fix mdoc2man
+
+ ChangeLog@1.1161 +1 -0
+ Fix mdoc2man
+
+ sntp/ag-tpl/mdoc2man@1.1 +308 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/ag-tpl/mdoc2man
+
+ sntp/ag-tpl/mdoc2man@1.0 +0 -0
+
+ChangeSet@1.2790, 2012-08-31 00:07:37-04:00, stenn@deacon.udel.edu
+ Distribute ntp.conf.def
+
+ ChangeLog@1.1160 +1 -0
+ Distribute ntp.conf.def
+
+ ntpd/Makefile.am@1.119 +1 -0
+ Distribute ntp.conf.def
+
+ChangeSet@1.2789, 2012-08-31 03:43:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P296
+ TAG: NTP_4_2_7P296
+
+ ChangeLog@1.1159 +1 -0
+ NTP_4_2_7P296
+
+ ntpd/invoke-ntpd.texi@1.285 +80 -5
+ NTP_4_2_7P296
+
+ ntpd/ntp.conf.5man@1.2 +10 -2865
+ NTP_4_2_7P296
+
+ ntpd/ntp.conf.5mdoc@1.2 +5 -2694
+ NTP_4_2_7P296
+
+ ntpd/ntp.conf.man.in@1.2 +10 -2865
+ NTP_4_2_7P296
+
+ ntpd/ntp.conf.mdoc.in@1.2 +5 -2694
+ NTP_4_2_7P296
+
+ ntpd/ntp.keys.5man@1.2 +9 -109
+ NTP_4_2_7P296
+
+ ntpd/ntp.keys.5mdoc@1.2 +4 -103
+ NTP_4_2_7P296
+
+ ntpd/ntp.keys.man.in@1.2 +9 -109
+ NTP_4_2_7P296
+
+ ntpd/ntp.keys.mdoc.in@1.2 +4 -103
+ NTP_4_2_7P296
+
+ ntpd/ntpd-opts.c@1.303 +4 -4
+ NTP_4_2_7P296
+
+ ntpd/ntpd-opts.h@1.303 +3 -3
+ NTP_4_2_7P296
+
+ ntpd/ntpd.1ntpdman@1.114 +29 -573
+ NTP_4_2_7P296
+
+ ntpd/ntpd.1ntpdmdoc@1.114 +5 -548
+ NTP_4_2_7P296
+
+ ntpd/ntpd.man.in@1.114 +29 -573
+ NTP_4_2_7P296
+
+ ntpd/ntpd.mdoc.in@1.114 +5 -548
+ NTP_4_2_7P296
+
+ ntpdc/invoke-ntpdc.texi@1.282 +56 -5
+ NTP_4_2_7P296
+
+ ntpdc/ntpdc-opts.c@1.297 +4 -4
+ NTP_4_2_7P296
+
+ ntpdc/ntpdc-opts.h@1.297 +3 -3
+ NTP_4_2_7P296
+
+ ntpdc/ntpdc.1ntpdcman@1.113 +22 -723
+ NTP_4_2_7P296
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.113 +4 -660
+ NTP_4_2_7P296
+
+ ntpdc/ntpdc.html@1.125 +150 -119
+ NTP_4_2_7P296
+
+ ntpdc/ntpdc.man.in@1.113 +22 -723
+ NTP_4_2_7P296
+
+ ntpdc/ntpdc.mdoc.in@1.113 +4 -660
+ NTP_4_2_7P296
+
+ ntpq/invoke-ntpq.texi@1.284 +47 -5
+ NTP_4_2_7P296
+
+ ntpq/ntpq-opts.c@1.299 +4 -4
+ NTP_4_2_7P296
+
+ ntpq/ntpq-opts.h@1.299 +3 -3
+ NTP_4_2_7P296
+
+ ntpq/ntpq.1ntpqman@1.113 +21 -279
+ NTP_4_2_7P296
+
+ ntpq/ntpq.1ntpqmdoc@1.113 +3 -246
+ NTP_4_2_7P296
+
+ ntpq/ntpq.man.in@1.113 +21 -279
+ NTP_4_2_7P296
+
+ ntpq/ntpq.mdoc.in@1.113 +3 -246
+ NTP_4_2_7P296
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.284 +31 -5
+ NTP_4_2_7P296
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.299 +4 -4
+ NTP_4_2_7P296
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.299 +3 -3
+ NTP_4_2_7P296
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.113 +21 -22
+ NTP_4_2_7P296
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.113 +3 -4
+ NTP_4_2_7P296
+
+ ntpsnmpd/ntpsnmpd.man.in@1.113 +21 -22
+ NTP_4_2_7P296
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.113 +3 -4
+ NTP_4_2_7P296
+
+ packageinfo.sh@1.299 +1 -1
+ NTP_4_2_7P296
+
+ scripts/invoke-ntp-wait.texi@1.102 +19 -5
+ NTP_4_2_7P296
+
+ scripts/ntp-wait.1ntp-waitman@1.113 +13 -29
+ NTP_4_2_7P296
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.113 +3 -19
+ NTP_4_2_7P296
+
+ scripts/ntp-wait.html@1.117 +54 -61
+ NTP_4_2_7P296
+
+ scripts/ntp-wait.man.in@1.113 +13 -29
+ NTP_4_2_7P296
+
+ scripts/ntp-wait.mdoc.in@1.113 +3 -19
+ NTP_4_2_7P296
+
+ sntp/invoke-sntp.texi@1.280 +7 -5
+ NTP_4_2_7P296
+
+ sntp/sntp-opts.c@1.295 +4 -4
+ NTP_4_2_7P296
+
+ sntp/sntp-opts.h@1.295 +3 -3
+ NTP_4_2_7P296
+
+ sntp/sntp.1sntpman@1.115 +69 -131
+ NTP_4_2_7P296
+
+ sntp/sntp.1sntpmdoc@1.115 +4 -66
+ NTP_4_2_7P296
+
+ sntp/sntp.html@1.295 +99 -123
+ NTP_4_2_7P296
+
+ sntp/sntp.man.in@1.115 +69 -131
+ NTP_4_2_7P296
+
+ sntp/sntp.mdoc.in@1.115 +4 -66
+ NTP_4_2_7P296
+
+ util/invoke-ntp-keygen.texi@1.285 +52 -5
+ NTP_4_2_7P296
+
+ util/ntp-keygen-opts.c@1.299 +4 -4
+ NTP_4_2_7P296
+
+ util/ntp-keygen-opts.h@1.299 +3 -3
+ NTP_4_2_7P296
+
+ util/ntp-keygen.1ntp-keygenman@1.113 +34 -750
+ NTP_4_2_7P296
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.113 +5 -707
+ NTP_4_2_7P296
+
+ util/ntp-keygen.man.in@1.113 +34 -750
+ NTP_4_2_7P296
+
+ util/ntp-keygen.mdoc.in@1.113 +5 -707
+ NTP_4_2_7P296
+
+ChangeSet@1.2788, 2012-08-30 22:01:12-04:00, stenn@deacon.udel.edu
+ Potential bugfix for agtexi-cmd.tpl
+
+ ChangeLog@1.1158 +1 -0
+ Potential bugfix for agtexi-cmd.tpl
+
+ sntp/ag-tpl/agtexi-cmd.tpl@1.1 +884 -0
+ BitKeeper file /deacon/backroom/ntp-dev-autogen/sntp/ag-tpl/agtexi-cmd.tpl
+
+ sntp/ag-tpl/agtexi-cmd.tpl@1.0 +0 -0
+
+ChangeSet@1.2787, 2012-08-30 21:48:02-04:00, stenn@deacon.udel.edu
+ Begin support for autogen maintaining ntp.conf and ntp.keys docs
+
+ .point-changed-filelist@1.14 +15 -7
+ Begin support for autogen maintaining ntp.conf and ntp.keys docs
+
+ChangeSet@1.2786, 2012-08-30 20:44:10-04:00, stenn@psp-deb1.ntp.org
+ Begin support for autogen maintaining ntp.conf and ntp.keys docs
+
+ ChangeLog@1.1157 +1 -0
+ Begin support for autogen maintaining ntp.conf and ntp.keys docs
+
+ ntpd/ntp.conf.5man@1.1 +2915 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.conf.5man
+
+ ntpd/ntp.conf.5man@1.0 +0 -0
+
+ ntpd/ntp.conf.5mdoc@1.1 +2749 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.conf.5mdoc
+
+ ntpd/ntp.conf.5mdoc@1.0 +0 -0
+
+ ntpd/ntp.conf.def@1.1 +2746 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.conf.def
+
+ ntpd/ntp.conf.def@1.0 +0 -0
+
+ ntpd/ntp.conf.man.in@1.1 +2915 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.conf.man.in
+
+ ntpd/ntp.conf.man.in@1.0 +0 -0
+
+ ntpd/ntp.conf.mdoc.in@1.1 +2749 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.conf.mdoc.in
+
+ ntpd/ntp.conf.mdoc.in@1.0 +0 -0
+
+ ntpd/ntp.keys.5man@1.1 +160 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.keys.5man
+
+ ntpd/ntp.keys.5man@1.0 +0 -0
+
+ ntpd/ntp.keys.5mdoc@1.1 +159 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.keys.5mdoc
+
+ ntpd/ntp.keys.5mdoc@1.0 +0 -0
+
+ ntpd/ntp.keys.man.in@1.1 +160 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.keys.man.in
+
+ ntpd/ntp.keys.man.in@1.0 +0 -0
+
+ ntpd/ntp.keys.mdoc.in@1.1 +159 -0
+ BitKeeper file /home/stenn/ntp-dev-autogen/ntpd/ntp.keys.mdoc.in
+
+ ntpd/ntp.keys.mdoc.in@1.0 +0 -0
+
+ChangeSet@1.2785, 2012-08-12 04:33:15+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ChangeLog@1.1156 +1 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/invoke-ntpd.texi@1.284 +360 -132
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpd-opts.c@1.302 +309 -261
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpd-opts.h@1.302 +12 -5
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpd.1ntpdman@1.113 +43 -43
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpd.1ntpdmdoc@1.113 +13 -9
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpd.man.in@1.113 +43 -43
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpd.mdoc.in@1.113 +13 -9
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpdsim-opts.c@1.20 +112 -53
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpd/ntpdsim-opts.h@1.20 +24 -11
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/invoke-ntpdc.texi@1.281 +421 -72
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/ntpdc-opts.c@1.296 +172 -124
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/ntpdc-opts.h@1.296 +13 -5
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/ntpdc.1ntpdcman@1.112 +28 -21
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.112 +13 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/ntpdc.html@1.124 +1108 -189
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/ntpdc.man.in@1.112 +28 -21
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpdc/ntpdc.mdoc.in@1.112 +13 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpq/invoke-ntpq.texi@1.283 +285 -237
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpq/ntpq-opts.c@1.298 +165 -119
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpq/ntpq-opts.h@1.298 +13 -5
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpq/ntpq.1ntpqman@1.112 +22 -15
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpq/ntpq.1ntpqmdoc@1.112 +15 -8
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpq/ntpq.man.in@1.112 +22 -15
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpq/ntpq.mdoc.in@1.112 +15 -8
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.283 +5 -29
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.298 +125 -81
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.298 +13 -5
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.112 +10 -3
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.112 +13 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpsnmpd/ntpsnmpd.man.in@1.112 +10 -3
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.112 +13 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ scripts/invoke-ntp-wait.texi@1.101 +21 -24
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ scripts/ntp-wait.1ntp-waitman@1.112 +6 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.112 +6 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ scripts/ntp-wait.html@1.116 +162 -37
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ scripts/ntp-wait.man.in@1.112 +6 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ scripts/ntp-wait.mdoc.in@1.112 +6 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/include/autogen-version.def@1.12 +1 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/invoke-sntp.texi@1.279 +67 -59
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/Makefile.am@1.15 +4 -4
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/ag-char-map.h@1.18 +322 -308
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/alias.c@1.2 +2 -2
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/ao-strs.c@1.4 +52 -52
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/ao-strs.h@1.3 +206 -207
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/autoopts/options.h@1.17 +8 -7
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/autoopts/usage-txt.h@1.17 +185 -183
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/boolean.c@1.10 +4 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/compat/compat.h@1.10 +4 -2
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/compat/pathfind.c@1.8 +2 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/configfile.c@1.15 +7 -3
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/enum.c@1.4 +4 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/env.c@1.4 +3 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/find.c@1.4 +31 -18
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/genshell.c@1.18 +3 -3
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/genshell.h@1.18 +9 -3
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/load.c@1.13 +67 -63
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/m4/libopts.m4@1.21 +19 -19
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/makeshell.c@1.12 +96 -61
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/proto.h@1.18 +6 -6
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/reset.c@1.11 +4 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/stack.c@1.10 +7 -2
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/time.c@1.10 +7 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/value-type.h@1.18 +1 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/version.c@1.11 +54 -51
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/libopts/xat-attribute.h@1.18 +1 -1
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/sntp-opts.c@1.294 +265 -195
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/sntp-opts.h@1.294 +13 -5
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/sntp.1sntpman@1.114 +39 -32
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/sntp.1sntpmdoc@1.114 +48 -35
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/sntp.html@1.294 +402 -252
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/sntp.man.in@1.114 +39 -32
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ sntp/sntp.mdoc.in@1.114 +48 -35
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ util/invoke-ntp-keygen.texi@1.284 +784 -497
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ util/ntp-keygen-opts.c@1.298 +238 -188
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ util/ntp-keygen-opts.h@1.298 +13 -5
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ util/ntp-keygen.1ntp-keygenman@1.112 +43 -36
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.112 +27 -19
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ util/ntp-keygen.man.in@1.112 +43 -36
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ util/ntp-keygen.mdoc.in@1.112 +27 -19
+ Upgrade to autogen-5.16.2 and libopts-36.5.11
+
+ChangeSet@1.2773.1.76, 2012-08-11 11:33:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P295
+ TAG: NTP_4_2_7P295
+
+ ChangeLog@1.1146.1.67 +1 -0
+ NTP_4_2_7P295
+
+ ntpd/ntpd-opts.c@1.301 +4 -4
+ NTP_4_2_7P295
+
+ ntpd/ntpd-opts.h@1.301 +3 -3
+ NTP_4_2_7P295
+
+ ntpd/ntpd-opts.texi@1.275.5.6 +2 -2
+ NTP_4_2_7P295
+
+ ntpd/ntpd.1ntpdman@1.112 +2 -2
+ NTP_4_2_7P295
+
+ ntpd/ntpd.1ntpdmdoc@1.112 +2 -2
+ NTP_4_2_7P295
+
+ ntpd/ntpd.man.in@1.112 +2 -2
+ NTP_4_2_7P295
+
+ ntpd/ntpd.mdoc.in@1.112 +2 -2
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc-opts.c@1.295 +4 -4
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc-opts.h@1.295 +3 -3
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc-opts.texi@1.272.5.5 +2 -2
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc.1ntpdcman@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc.html@1.123 +2 -2
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc.man.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpdc/ntpdc.mdoc.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpq/ntpq-opts.c@1.297 +4 -4
+ NTP_4_2_7P295
+
+ ntpq/ntpq-opts.h@1.297 +3 -3
+ NTP_4_2_7P295
+
+ ntpq/ntpq-opts.texi@1.274.5.5 +2 -2
+ NTP_4_2_7P295
+
+ ntpq/ntpq.1ntpqman@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpq/ntpq.1ntpqmdoc@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpq/ntpq.man.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpq/ntpq.mdoc.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.297 +4 -4
+ NTP_4_2_7P295
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.297 +3 -3
+ NTP_4_2_7P295
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.5.5 +2 -2
+ NTP_4_2_7P295
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpsnmpd/ntpsnmpd.man.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ packageinfo.sh@1.298 +1 -1
+ NTP_4_2_7P295
+
+ scripts/ntp-wait-opts.texi@1.92.5.5 +14 -2
+ NTP_4_2_7P295
+
+ scripts/ntp-wait.1ntp-waitman@1.111 +2 -2
+ NTP_4_2_7P295
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.111 +2 -2
+ NTP_4_2_7P295
+
+ scripts/ntp-wait.html@1.115 +14 -2
+ NTP_4_2_7P295
+
+ scripts/ntp-wait.man.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ scripts/ntp-wait.mdoc.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ sntp/sntp-opts.c@1.293 +4 -4
+ NTP_4_2_7P295
+
+ sntp/sntp-opts.h@1.293 +3 -3
+ NTP_4_2_7P295
+
+ sntp/sntp-opts.texi@1.270.5.5 +2 -2
+ NTP_4_2_7P295
+
+ sntp/sntp.1sntpman@1.113 +2 -2
+ NTP_4_2_7P295
+
+ sntp/sntp.1sntpmdoc@1.113 +2 -2
+ NTP_4_2_7P295
+
+ sntp/sntp.html@1.293 +2 -2
+ NTP_4_2_7P295
+
+ sntp/sntp.man.in@1.113 +2 -2
+ NTP_4_2_7P295
+
+ sntp/sntp.mdoc.in@1.113 +2 -2
+ NTP_4_2_7P295
+
+ util/ntp-keygen-opts.c@1.297 +4 -4
+ NTP_4_2_7P295
+
+ util/ntp-keygen-opts.h@1.297 +3 -3
+ NTP_4_2_7P295
+
+ util/ntp-keygen-opts.texi@1.275.5.5 +2 -2
+ NTP_4_2_7P295
+
+ util/ntp-keygen.1ntp-keygenman@1.111 +2 -2
+ NTP_4_2_7P295
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.111 +2 -2
+ NTP_4_2_7P295
+
+ util/ntp-keygen.man.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ util/ntp-keygen.mdoc.in@1.111 +2 -2
+ NTP_4_2_7P295
+
+ChangeSet@1.2773.1.75, 2012-08-11 04:28:13-04:00, stenn@psp-deb1.ntp.org
+ Look for syslog's facilitynames[]
+
+ ChangeLog@1.1146.1.66 +1 -0
+ Look for syslog's facilitynames[]
+
+ configure.ac@1.550 +2 -0
+ Look for syslog's facilitynames[]
+
+ sntp/configure.ac@1.71 +1 -0
+ Look for syslog's facilitynames[]
+
+ sntp/m4/ntp_facilitynames.m4@1.1 +24 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/m4/ntp_facilitynames.m4
+
+ sntp/m4/ntp_facilitynames.m4@1.0 +0 -0
+
+ChangeSet@1.2773.1.74, 2012-08-08 11:38:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P294
+ TAG: NTP_4_2_7P294
+
+ ChangeLog@1.1146.1.65 +1 -0
+ NTP_4_2_7P294
+
+ ntpd/ntpd-opts.c@1.300 +4 -4
+ NTP_4_2_7P294
+
+ ntpd/ntpd-opts.h@1.300 +3 -3
+ NTP_4_2_7P294
+
+ ntpd/ntpd-opts.texi@1.275.5.5 +2 -2
+ NTP_4_2_7P294
+
+ ntpd/ntpd.1ntpdman@1.111 +2 -2
+ NTP_4_2_7P294
+
+ ntpd/ntpd.1ntpdmdoc@1.111 +2 -2
+ NTP_4_2_7P294
+
+ ntpd/ntpd.man.in@1.111 +2 -2
+ NTP_4_2_7P294
+
+ ntpd/ntpd.mdoc.in@1.111 +2 -2
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc-opts.c@1.294 +4 -4
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc-opts.h@1.294 +3 -3
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc-opts.texi@1.272.5.4 +2 -2
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc.1ntpdcman@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc.html@1.122 +2 -2
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc.man.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpdc/ntpdc.mdoc.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpq/ntpq-opts.c@1.296 +4 -4
+ NTP_4_2_7P294
+
+ ntpq/ntpq-opts.h@1.296 +3 -3
+ NTP_4_2_7P294
+
+ ntpq/ntpq-opts.texi@1.274.5.4 +2 -2
+ NTP_4_2_7P294
+
+ ntpq/ntpq.1ntpqman@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpq/ntpq.1ntpqmdoc@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpq/ntpq.man.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpq/ntpq.mdoc.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.296 +4 -4
+ NTP_4_2_7P294
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.296 +3 -3
+ NTP_4_2_7P294
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.5.4 +2 -2
+ NTP_4_2_7P294
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpsnmpd/ntpsnmpd.man.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ packageinfo.sh@1.297 +1 -1
+ NTP_4_2_7P294
+
+ scripts/ntp-wait-opts.texi@1.92.5.4 +1 -1
+ NTP_4_2_7P294
+
+ scripts/ntp-wait.1ntp-waitman@1.110 +2 -2
+ NTP_4_2_7P294
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.110 +2 -2
+ NTP_4_2_7P294
+
+ scripts/ntp-wait.html@1.114 +1 -1
+ NTP_4_2_7P294
+
+ scripts/ntp-wait.man.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ scripts/ntp-wait.mdoc.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ sntp/sntp-opts.c@1.292 +4 -4
+ NTP_4_2_7P294
+
+ sntp/sntp-opts.h@1.292 +3 -3
+ NTP_4_2_7P294
+
+ sntp/sntp-opts.texi@1.270.5.4 +2 -2
+ NTP_4_2_7P294
+
+ sntp/sntp.1sntpman@1.112 +2 -2
+ NTP_4_2_7P294
+
+ sntp/sntp.1sntpmdoc@1.112 +2 -2
+ NTP_4_2_7P294
+
+ sntp/sntp.html@1.292 +2 -2
+ NTP_4_2_7P294
+
+ sntp/sntp.man.in@1.112 +2 -2
+ NTP_4_2_7P294
+
+ sntp/sntp.mdoc.in@1.112 +2 -2
+ NTP_4_2_7P294
+
+ util/ntp-keygen-opts.c@1.296 +4 -4
+ NTP_4_2_7P294
+
+ util/ntp-keygen-opts.h@1.296 +3 -3
+ NTP_4_2_7P294
+
+ util/ntp-keygen-opts.texi@1.275.5.4 +2 -2
+ NTP_4_2_7P294
+
+ util/ntp-keygen.1ntp-keygenman@1.110 +2 -2
+ NTP_4_2_7P294
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.110 +2 -2
+ NTP_4_2_7P294
+
+ util/ntp-keygen.man.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ util/ntp-keygen.mdoc.in@1.110 +2 -2
+ NTP_4_2_7P294
+
+ChangeSet@1.2773.4.5, 2012-08-06 04:22:39+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c.
+ Force prior config.cache files to be flushed due to [Bug 2242] fix
+ invalidating getifaddrs() cached result.
+
+ ChangeLog@1.1146.4.4 +1 -0
+ Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c.
+
+ configure.ac@1.549 +1 -1
+ Force prior config.cache files to be flushed due to [Bug 2242] fix
+ invalidating getifaddrs() cached result.
+
+ ntpd/refclock_tsyncpci.c@1.7 +5 -3
+ Attempt to resolve strict-aliasing violation in refclock_tsyncpci.c.
+
+ sntp/configure.ac@1.70 +1 -1
+ Force prior config.cache files to be flushed due to [Bug 2242] fix
+ invalidating getifaddrs() cached result.
+
+ChangeSet@1.2773.4.4, 2012-08-05 21:15:00+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2242] configure fails to detect getifaddrs function on Solaris.
+
+ ChangeLog@1.1146.4.3 +1 -0
+ [Bug 2242] configure fails to detect getifaddrs function on Solaris.
+
+ sntp/m4/ntp_ipv6.m4@1.7 +7 -3
+ [Bug 2242] configure fails to detect getifaddrs function on Solaris.
+
+ChangeSet@1.2773.4.3, 2012-08-05 21:04:38+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2252] palisade: formats nanosecs to a 6-char field.
+
+ ChangeLog@1.1146.4.2 +1 -0
+ [Bug 2252] palisade: formats nanosecs to a 6-char field.
+
+ ntpd/refclock_palisade.c@1.38.1.1 +5 -5
+ [Bug 2252] palisade: formats nanosecs to a 6-char field.
+
+ChangeSet@1.2773.4.2, 2012-08-05 20:48:27+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Remove unneeded \ line continuation in ntp_config.c if condition.
+ Use INSIST() instead of equivalent NTP_INSIST in a few places.
+
+ ntpd/ntp_config.c@1.301 +4 -4
+ Remove unneeded \ line continuation in ntp_config.c if condition.
+ Use INSIST() instead of equivalent NTP_INSIST in a few places.
+
+ChangeSet@1.2773.4.1, 2012-08-05 19:09:38+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2249] Bad operator for 'test' in 'make check' of libevent.
+
+ ChangeLog@1.1146.4.1 +1 -0
+ [Bug 2249] Bad operator for 'test' in 'make check' of libevent.
+
+ sntp/libevent/test/test.sh@1.6 +1 -1
+ [Bug 2249] Bad operator for 'test' in 'make check' of libevent.
+
+ChangeSet@1.2773.1.72, 2012-08-05 05:03:59-04:00, stenn@psp-deb1.ntp.org
+ Fix && -> & typo in refclock_palisade.c debug statements
+
+ ChangeLog@1.1146.1.63 +1 -0
+ Fix && -> & typo in refclock_palisade.c debug statements
+
+ ntpd/refclock_palisade.c@1.39 +5 -5
+ Fix && -> & typo in refclock_palisade.c debug statements
+
+ChangeSet@1.2773.1.71, 2012-08-04 11:34:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P293
+ TAG: NTP_4_2_7P293
+
+ ChangeLog@1.1146.1.62 +1 -0
+ NTP_4_2_7P293
+
+ ntpd/ntpd-opts.c@1.299 +4 -4
+ NTP_4_2_7P293
+
+ ntpd/ntpd-opts.h@1.299 +3 -3
+ NTP_4_2_7P293
+
+ ntpd/ntpd-opts.texi@1.275.5.4 +2 -2
+ NTP_4_2_7P293
+
+ ntpd/ntpd.1ntpdman@1.110 +2 -2
+ NTP_4_2_7P293
+
+ ntpd/ntpd.1ntpdmdoc@1.110 +2 -2
+ NTP_4_2_7P293
+
+ ntpd/ntpd.man.in@1.110 +2 -2
+ NTP_4_2_7P293
+
+ ntpd/ntpd.mdoc.in@1.110 +2 -2
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc-opts.c@1.293 +4 -4
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc-opts.h@1.293 +3 -3
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc-opts.texi@1.272.5.3 +2 -2
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc.1ntpdcman@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc.html@1.121 +2 -2
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc.man.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpdc/ntpdc.mdoc.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpq/ntpq-opts.c@1.295 +4 -4
+ NTP_4_2_7P293
+
+ ntpq/ntpq-opts.h@1.295 +3 -3
+ NTP_4_2_7P293
+
+ ntpq/ntpq-opts.texi@1.274.5.3 +2 -2
+ NTP_4_2_7P293
+
+ ntpq/ntpq.1ntpqman@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpq/ntpq.1ntpqmdoc@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpq/ntpq.man.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpq/ntpq.mdoc.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.295 +4 -4
+ NTP_4_2_7P293
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.295 +3 -3
+ NTP_4_2_7P293
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.5.3 +2 -2
+ NTP_4_2_7P293
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpsnmpd/ntpsnmpd.man.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ packageinfo.sh@1.296 +1 -1
+ NTP_4_2_7P293
+
+ scripts/ntp-wait-opts.texi@1.92.5.3 +1 -1
+ NTP_4_2_7P293
+
+ scripts/ntp-wait.1ntp-waitman@1.109 +2 -2
+ NTP_4_2_7P293
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.109 +2 -2
+ NTP_4_2_7P293
+
+ scripts/ntp-wait.html@1.113 +1 -1
+ NTP_4_2_7P293
+
+ scripts/ntp-wait.man.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ scripts/ntp-wait.mdoc.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ sntp/sntp-opts.c@1.291 +4 -4
+ NTP_4_2_7P293
+
+ sntp/sntp-opts.h@1.291 +3 -3
+ NTP_4_2_7P293
+
+ sntp/sntp-opts.texi@1.270.5.3 +2 -2
+ NTP_4_2_7P293
+
+ sntp/sntp.1sntpman@1.111 +2 -2
+ NTP_4_2_7P293
+
+ sntp/sntp.1sntpmdoc@1.111 +2 -2
+ NTP_4_2_7P293
+
+ sntp/sntp.html@1.291 +2 -2
+ NTP_4_2_7P293
+
+ sntp/sntp.man.in@1.111 +2 -2
+ NTP_4_2_7P293
+
+ sntp/sntp.mdoc.in@1.111 +2 -2
+ NTP_4_2_7P293
+
+ util/ntp-keygen-opts.c@1.295 +4 -4
+ NTP_4_2_7P293
+
+ util/ntp-keygen-opts.h@1.295 +3 -3
+ NTP_4_2_7P293
+
+ util/ntp-keygen-opts.texi@1.275.5.3 +2 -2
+ NTP_4_2_7P293
+
+ util/ntp-keygen.1ntp-keygenman@1.109 +2 -2
+ NTP_4_2_7P293
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.109 +2 -2
+ NTP_4_2_7P293
+
+ util/ntp-keygen.man.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ util/ntp-keygen.mdoc.in@1.109 +2 -2
+ NTP_4_2_7P293
+
+ChangeSet@1.2773.1.70, 2012-08-03 23:15:30-04:00, stenn@psp-deb1.ntp.org
+ Cleanup kclk_sel240x.o rules in libparse/Makefile.am
+
+ ChangeLog@1.1146.1.61 +1 -0
+ Cleanup kclk_sel240x.o rules in libparse/Makefile.am
+
+ libparse/Makefile.am@1.30 +1 -4
+ Cleanup kclk_sel240x.o rules in libparse/Makefile.am
+
+ChangeSet@1.2773.1.69, 2012-08-03 23:11:04-04:00, stenn@psp-deb1.ntp.org
+ Documentation cleanup from Mike T.
+
+ ChangeLog@1.1146.1.60 +1 -0
+ Documentation cleanup from Mike T.
+
+ html/authentic.html@1.10 +2 -2
+ Documentation cleanup from Mike T.
+
+ html/decode.html@1.19 +1 -1
+ Documentation cleanup from Mike T.
+
+ html/drivers/driver1.html@1.19 +1 -1
+ Documentation cleanup from Mike T.
+
+ html/miscopt.html@1.69 +2 -2
+ Documentation cleanup from Mike T.
+
+ChangeSet@1.2773.1.68, 2012-08-03 02:51:04-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006.
+
+ BitKeeper/deleted/55/driver2.htm~3aed0663@1.14 +0 -0
+ Delete: html/drivers/driver2.html
+
+ ChangeLog@1.1146.1.59 +1 -0
+ [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006.
+
+ html/refclock.html@1.36 +0 -1
+ [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006.
+
+ ntpd/ntp_control.c@1.182 +1 -1
+ [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006.
+
+ ntpd/refclock_conf.c@1.33 +0 -6
+ [Bug 2247] (more) Get rid of the TRAK refclock - deprecated since 2006.
+
+ChangeSet@1.2773.1.67, 2012-08-02 11:34:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P292
+ TAG: NTP_4_2_7P292
+
+ ChangeLog@1.1146.1.58 +1 -0
+ NTP_4_2_7P292
+
+ ntpd/ntpd-opts.c@1.298 +4 -4
+ NTP_4_2_7P292
+
+ ntpd/ntpd-opts.h@1.298 +3 -3
+ NTP_4_2_7P292
+
+ ntpd/ntpd-opts.texi@1.275.5.3 +2 -2
+ NTP_4_2_7P292
+
+ ntpd/ntpd.1ntpdman@1.109 +2 -2
+ NTP_4_2_7P292
+
+ ntpd/ntpd.1ntpdmdoc@1.109 +2 -2
+ NTP_4_2_7P292
+
+ ntpd/ntpd.man.in@1.109 +2 -2
+ NTP_4_2_7P292
+
+ ntpd/ntpd.mdoc.in@1.109 +2 -2
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc-opts.c@1.292 +4 -4
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc-opts.h@1.292 +3 -3
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc-opts.texi@1.272.5.2 +2 -2
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc.1ntpdcman@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc.html@1.120 +2 -2
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc.man.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpdc/ntpdc.mdoc.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpq/ntpq-opts.c@1.294 +4 -4
+ NTP_4_2_7P292
+
+ ntpq/ntpq-opts.h@1.294 +3 -3
+ NTP_4_2_7P292
+
+ ntpq/ntpq-opts.texi@1.274.5.2 +2 -2
+ NTP_4_2_7P292
+
+ ntpq/ntpq.1ntpqman@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpq/ntpq.1ntpqmdoc@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpq/ntpq.man.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpq/ntpq.mdoc.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.294 +4 -4
+ NTP_4_2_7P292
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.294 +3 -3
+ NTP_4_2_7P292
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.5.2 +2 -2
+ NTP_4_2_7P292
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpsnmpd/ntpsnmpd.man.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ packageinfo.sh@1.295 +1 -1
+ NTP_4_2_7P292
+
+ scripts/ntp-wait-opts.texi@1.92.5.2 +1 -1
+ NTP_4_2_7P292
+
+ scripts/ntp-wait.1ntp-waitman@1.108 +2 -2
+ NTP_4_2_7P292
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.108 +2 -2
+ NTP_4_2_7P292
+
+ scripts/ntp-wait.html@1.112 +1 -1
+ NTP_4_2_7P292
+
+ scripts/ntp-wait.man.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ scripts/ntp-wait.mdoc.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ sntp/sntp-opts.c@1.290 +4 -4
+ NTP_4_2_7P292
+
+ sntp/sntp-opts.h@1.290 +3 -3
+ NTP_4_2_7P292
+
+ sntp/sntp-opts.texi@1.270.5.2 +2 -2
+ NTP_4_2_7P292
+
+ sntp/sntp.1sntpman@1.110 +2 -2
+ NTP_4_2_7P292
+
+ sntp/sntp.1sntpmdoc@1.110 +2 -2
+ NTP_4_2_7P292
+
+ sntp/sntp.html@1.290 +2 -2
+ NTP_4_2_7P292
+
+ sntp/sntp.man.in@1.110 +2 -2
+ NTP_4_2_7P292
+
+ sntp/sntp.mdoc.in@1.110 +2 -2
+ NTP_4_2_7P292
+
+ util/ntp-keygen-opts.c@1.294 +4 -4
+ NTP_4_2_7P292
+
+ util/ntp-keygen-opts.h@1.294 +3 -3
+ NTP_4_2_7P292
+
+ util/ntp-keygen-opts.texi@1.275.5.2 +2 -2
+ NTP_4_2_7P292
+
+ util/ntp-keygen.1ntp-keygenman@1.108 +2 -2
+ NTP_4_2_7P292
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.108 +2 -2
+ NTP_4_2_7P292
+
+ util/ntp-keygen.man.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ util/ntp-keygen.mdoc.in@1.108 +2 -2
+ NTP_4_2_7P292
+
+ChangeSet@1.2773.1.66, 2012-08-02 06:48:06-04:00, stenn@deacon.udel.edu
+ [Bug 1545] Note why we are logging the Version string
+
+ ChangeLog@1.1146.1.57 +1 -0
+ [Bug 1545] Note why we are logging the Version string
+
+ ntpd/ntpd.c@1.133 +1 -1
+ [Bug 1545] Note why we are logging the Version string
+
+ChangeSet@1.2773.1.65, 2012-08-02 04:41:05-04:00, stenn@deacon.udel.edu
+ [Bug 2247] Get rid of the TRAK refclock - deprecated since 2006
+
+ BitKeeper/deleted/50/refclock_trak.c~3aed0663@1.12 +0 -0
+ Delete: ntpd/refclock_trak.c
+
+ ChangeLog@1.1146.1.56 +1 -0
+ [Bug 2247] Get rid of the TRAK refclock - deprecated since 2006
+
+ configure.ac@1.548 +0 -11
+ [Bug 2247] Get rid of the TRAK refclock - deprecated since 2006
+
+ ntpd/Makefile.am@1.112.1.4 +0 -1
+ [Bug 2247] Get rid of the TRAK refclock - deprecated since 2006
+
+ChangeSet@1.2773.1.64, 2012-08-02 04:35:10-04:00, stenn@deacon.udel.edu
+ [Bug 1872] Remove legacy ppsclock fdpps, #ifdef PPS
+
+ ChangeLog@1.1146.1.55 +1 -0
+ [Bug 1872] Remove legacy ppsclock fdpps, #ifdef PPS
+
+ ntpd/ntp_refclock.c@1.116 +1 -6
+ [Bug 1872] Remove legacy ppsclock fdpps, #ifdef PPS
+
+ ntpd/refclock_zyfer.c@1.10 +1 -18
+ [Bug 1872] Remove legacy ppsclock fdpps, #ifdef PPS
+
+ChangeSet@1.2773.1.63, 2012-08-02 02:32:58-04:00, stenn@deacon.udel.edu
+ Clean up an exit status in ntpq.c
+
+ ChangeLog@1.1146.1.54 +1 -0
+ Clean up an exit status in ntpq.c
+
+ ntpq/ntpq.c@1.148 +1 -1
+ Clean up an exit status in ntpq.c
+
+ChangeSet@1.2773.1.62, 2012-08-01 21:26:07-04:00, stenn@psp-deb1.ntp.org
+ [Bug 2075] Fix spelling of 'incompatible'
+
+ ChangeLog@1.1146.1.53 +1 -0
+ [Bug 2075] Fix spelling of 'incompatible'
+
+ include/ntp_request.h@1.47 +2 -2
+ [Bug 2075] Fix spelling of 'incompatible'
+
+ ntpdc/ntpdc.c@1.100 +1 -1
+ [Bug 2075] Fix spelling of 'incompatible'
+
+ChangeSet@1.2773.1.61, 2012-07-31 11:34:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P291
+ TAG: NTP_4_2_7P291
+
+ ChangeLog@1.1146.1.52 +1 -0
+ NTP_4_2_7P291
+
+ ntpd/ntpd-opts.c@1.297 +6 -6
+ NTP_4_2_7P291
+
+ ntpd/ntpd-opts.h@1.297 +3 -3
+ NTP_4_2_7P291
+
+ ntpd/ntpd-opts.texi@1.275.5.2 +2 -2
+ NTP_4_2_7P291
+
+ ntpd/ntpd.1ntpdman@1.108 +548 -8
+ NTP_4_2_7P291
+
+ ntpd/ntpd.1ntpdmdoc@1.108 +547 -8
+ NTP_4_2_7P291
+
+ ntpd/ntpd.man.in@1.108 +548 -8
+ NTP_4_2_7P291
+
+ ntpd/ntpd.mdoc.in@1.108 +547 -8
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc-opts.c@1.291 +4 -4
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc-opts.h@1.291 +3 -3
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc-opts.texi@1.272.5.1 +2 -2
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc.1ntpdcman@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc.html@1.119 +2 -2
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc.man.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpdc/ntpdc.mdoc.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpq/ntpq-opts.c@1.293 +4 -4
+ NTP_4_2_7P291
+
+ ntpq/ntpq-opts.h@1.293 +3 -3
+ NTP_4_2_7P291
+
+ ntpq/ntpq-opts.texi@1.274.5.1 +2 -2
+ NTP_4_2_7P291
+
+ ntpq/ntpq.1ntpqman@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpq/ntpq.1ntpqmdoc@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpq/ntpq.man.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpq/ntpq.mdoc.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.293 +4 -4
+ NTP_4_2_7P291
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.293 +3 -3
+ NTP_4_2_7P291
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.5.1 +2 -2
+ NTP_4_2_7P291
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpsnmpd/ntpsnmpd.man.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ packageinfo.sh@1.294 +1 -1
+ NTP_4_2_7P291
+
+ scripts/ntp-wait-opts.texi@1.92.5.1 +1 -1
+ NTP_4_2_7P291
+
+ scripts/ntp-wait.1ntp-waitman@1.107 +2 -2
+ NTP_4_2_7P291
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.107 +2 -2
+ NTP_4_2_7P291
+
+ scripts/ntp-wait.html@1.111 +1 -1
+ NTP_4_2_7P291
+
+ scripts/ntp-wait.man.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ scripts/ntp-wait.mdoc.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ sntp/sntp-opts.c@1.289 +4 -4
+ NTP_4_2_7P291
+
+ sntp/sntp-opts.h@1.289 +3 -3
+ NTP_4_2_7P291
+
+ sntp/sntp-opts.texi@1.270.5.1 +2 -2
+ NTP_4_2_7P291
+
+ sntp/sntp.1sntpman@1.109 +2 -2
+ NTP_4_2_7P291
+
+ sntp/sntp.1sntpmdoc@1.109 +2 -2
+ NTP_4_2_7P291
+
+ sntp/sntp.html@1.289 +2 -2
+ NTP_4_2_7P291
+
+ sntp/sntp.man.in@1.109 +2 -2
+ NTP_4_2_7P291
+
+ sntp/sntp.mdoc.in@1.109 +2 -2
+ NTP_4_2_7P291
+
+ util/ntp-keygen-opts.c@1.293 +4 -4
+ NTP_4_2_7P291
+
+ util/ntp-keygen-opts.h@1.293 +3 -3
+ NTP_4_2_7P291
+
+ util/ntp-keygen-opts.texi@1.275.5.1 +2 -2
+ NTP_4_2_7P291
+
+ util/ntp-keygen.1ntp-keygenman@1.107 +2 -2
+ NTP_4_2_7P291
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.107 +2 -2
+ NTP_4_2_7P291
+
+ util/ntp-keygen.man.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ util/ntp-keygen.mdoc.in@1.107 +2 -2
+ NTP_4_2_7P291
+
+ChangeSet@1.2773.1.60, 2012-07-27 15:12:58-04:00, utterback@pogo.udel.edu
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ChangeLog@1.1146.1.51 +1 -0
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ html/ntpd.html@1.56 +2 -0
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd-opts.c@1.296 +58 -27
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd-opts.h@1.296 +12 -5
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd-opts.texi@1.275.5.1 +18 -2
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd.1ntpdman@1.107 +14 -548
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd.1ntpdmdoc@1.107 +13 -547
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd.c@1.132 +11 -2
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd.man.in@1.107 +14 -548
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpd.mdoc.in@1.107 +13 -547
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ ntpd/ntpdbase-opts.def@1.23 +11 -0
+ [Bug 2241] New: MDNS registration should only happen if requested.
+
+ChangeSet@1.2782, 2012-07-20 06:02:41-04:00, stenn@psp-deb1.ntp.org
+ Upgrade to autogen-5.16.1 and libopts-36.4.11
+
+ sntp/include/autogen-version.def@1.11 +1 -1
+ Upgrade to autogen-5.16.1 and libopts-36.4.11
+
+ sntp/libopts/Makefile.am@1.14, stenn@psp-fb1.ntp.org +5 -5
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/ag-char-map.h@1.17, stenn@psp-fb1.ntp.org +295 -197
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/ao-strs.c@1.3, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/ao-strs.h@1.2, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/autoopts/options.h@1.16, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/autoopts/project.h@1.3, stenn@psp-fb1.ntp.org +0 -2
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/autoopts/usage-txt.h@1.16, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/compat/windows-config.h@1.9, stenn@psp-fb1.ntp.org +25 -14
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/genshell.c@1.17, stenn@psp-fb1.ntp.org +41 -11
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/genshell.h@1.17, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/libopts.c@1.7, stenn@psp-fb1.ntp.org +0 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/m4/libopts.m4@1.20, stenn@psp-fb1.ntp.org +7 -7
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/parse-duration.c@1.8, stenn@psp-fb1.ntp.org +7 -7
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/parse-duration.h@1.7, stenn@psp-fb1.ntp.org +4 -4
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/proto.h@1.17, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/value-type.h@1.17, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/libopts/xat-attribute.h@1.17, stenn@psp-fb1.ntp.org +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ChangeSet@1.2773.1.59, 2012-07-20 00:03:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P290
+ TAG: NTP_4_2_7P290
+
+ ChangeLog@1.1146.1.50 +1 -0
+ NTP_4_2_7P290
+
+ ntpd/ntpd-opts.c@1.295 +4 -4
+ NTP_4_2_7P290
+
+ ntpd/ntpd-opts.h@1.295 +3 -3
+ NTP_4_2_7P290
+
+ ntpd/ntpd-opts.texi@1.275.4.6 +2 -2
+ NTP_4_2_7P290
+
+ ntpd/ntpd.1ntpdman@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpd/ntpd.1ntpdmdoc@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpd/ntpd.man.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpd/ntpd.mdoc.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc-opts.c@1.290 +4 -4
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc-opts.h@1.290 +3 -3
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc-opts.texi@1.272.4.6 +2 -2
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc.1ntpdcman@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc.html@1.118 +2 -2
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc.man.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpdc/ntpdc.mdoc.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpq/ntpq-opts.c@1.292 +4 -4
+ NTP_4_2_7P290
+
+ ntpq/ntpq-opts.h@1.292 +3 -3
+ NTP_4_2_7P290
+
+ ntpq/ntpq-opts.texi@1.274.4.6 +2 -2
+ NTP_4_2_7P290
+
+ ntpq/ntpq.1ntpqman@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpq/ntpq.1ntpqmdoc@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpq/ntpq.man.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpq/ntpq.mdoc.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.292 +4 -4
+ NTP_4_2_7P290
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.292 +3 -3
+ NTP_4_2_7P290
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.4.6 +2 -2
+ NTP_4_2_7P290
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpsnmpd/ntpsnmpd.man.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ packageinfo.sh@1.293 +1 -1
+ NTP_4_2_7P290
+
+ scripts/ntp-wait-opts.texi@1.92.4.6 +1 -1
+ NTP_4_2_7P290
+
+ scripts/ntp-wait.1ntp-waitman@1.106 +2 -2
+ NTP_4_2_7P290
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.106 +2 -2
+ NTP_4_2_7P290
+
+ scripts/ntp-wait.html@1.110 +1 -1
+ NTP_4_2_7P290
+
+ scripts/ntp-wait.man.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ scripts/ntp-wait.mdoc.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ sntp/sntp-opts.c@1.288 +4 -4
+ NTP_4_2_7P290
+
+ sntp/sntp-opts.h@1.288 +3 -3
+ NTP_4_2_7P290
+
+ sntp/sntp-opts.texi@1.270.4.6 +2 -2
+ NTP_4_2_7P290
+
+ sntp/sntp.1sntpman@1.108 +2 -2
+ NTP_4_2_7P290
+
+ sntp/sntp.1sntpmdoc@1.108 +2 -2
+ NTP_4_2_7P290
+
+ sntp/sntp.html@1.288 +2 -2
+ NTP_4_2_7P290
+
+ sntp/sntp.man.in@1.108 +2 -2
+ NTP_4_2_7P290
+
+ sntp/sntp.mdoc.in@1.108 +2 -2
+ NTP_4_2_7P290
+
+ util/ntp-keygen-opts.c@1.292 +4 -4
+ NTP_4_2_7P290
+
+ util/ntp-keygen-opts.h@1.292 +3 -3
+ NTP_4_2_7P290
+
+ util/ntp-keygen-opts.texi@1.275.4.6 +2 -2
+ NTP_4_2_7P290
+
+ util/ntp-keygen.1ntp-keygenman@1.106 +2 -2
+ NTP_4_2_7P290
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.106 +2 -2
+ NTP_4_2_7P290
+
+ util/ntp-keygen.man.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ util/ntp-keygen.mdoc.in@1.106 +2 -2
+ NTP_4_2_7P290
+
+ChangeSet@1.2773.1.58, 2012-07-19 19:26:56-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1454] Add parse clock support for the SEL-240x GPS products
+
+ ChangeLog@1.1146.1.49 +1 -0
+ [Bug 1454] Add parse clock support for the SEL-240x GPS products
+
+ configure.ac@1.547 +16 -0
+ [Bug 1454] Add parse clock support for the SEL-240x GPS products
+
+ html/drivers/driver8.html@1.29 +252 -242
+ [Bug 1454] Add parse clock support for the SEL-240x GPS products
+
+ libparse/Makefile.am@1.29 +8 -0
+ [Bug 1454] Add parse clock support for the SEL-240x GPS products
+
+ libparse/clk_sel240x.c@1.1 +194 -0
+ BitKeeper file /home/stenn/ntp-dev/libparse/clk_sel240x.c
+
+ libparse/clk_sel240x.c@1.0 +0 -0
+
+ libparse/parse_conf.c@1.10 +7 -0
+ [Bug 1454] Add parse clock support for the SEL-240x GPS products
+
+ ntpd/refclock_parse.c@1.67 +52 -0
+ [Bug 1454] Add parse clock support for the SEL-240x GPS products
+
+ChangeSet@1.2773.1.57, 2012-07-17 01:15:11-04:00, stenn@psp-deb1.ntp.org
+ CID 709185: refclock_chu.c will leak fd==0 (better fix)
+
+ ChangeLog@1.1146.1.48 +1 -0
+ CID 709185: refclock_chu.c will leak fd==0 (better fix)
+
+ ntpd/refclock_chu.c@1.55 +4 -13
+ CID 709185: refclock_chu.c will leak fd==0 (better fix)
+
+ChangeSet@1.2773.1.56, 2012-07-16 00:21:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P289
+ TAG: NTP_4_2_7P289
+
+ ChangeLog@1.1146.1.47 +1 -0
+ NTP_4_2_7P289
+
+ ntpd/ntpd-opts.c@1.294 +4 -4
+ NTP_4_2_7P289
+
+ ntpd/ntpd-opts.h@1.294 +3 -3
+ NTP_4_2_7P289
+
+ ntpd/ntpd-opts.texi@1.275.4.5 +2 -2
+ NTP_4_2_7P289
+
+ ntpd/ntpd.1ntpdman@1.105 +4 -10
+ NTP_4_2_7P289
+
+ ntpd/ntpd.1ntpdmdoc@1.105 +4 -10
+ NTP_4_2_7P289
+
+ ntpd/ntpd.man.in@1.105 +4 -10
+ NTP_4_2_7P289
+
+ ntpd/ntpd.mdoc.in@1.105 +4 -10
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc-opts.c@1.289 +4 -4
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc-opts.h@1.289 +3 -3
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc-opts.texi@1.272.4.5 +2 -2
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc.1ntpdcman@1.105 +3 -8
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.105 +3 -8
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc.html@1.117 +2 -2
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc.man.in@1.105 +3 -8
+ NTP_4_2_7P289
+
+ ntpdc/ntpdc.mdoc.in@1.105 +3 -8
+ NTP_4_2_7P289
+
+ ntpq/ntpq-opts.c@1.291 +4 -4
+ NTP_4_2_7P289
+
+ ntpq/ntpq-opts.h@1.291 +3 -3
+ NTP_4_2_7P289
+
+ ntpq/ntpq-opts.texi@1.274.4.5 +2 -2
+ NTP_4_2_7P289
+
+ ntpq/ntpq.1ntpqman@1.105 +2 -3
+ NTP_4_2_7P289
+
+ ntpq/ntpq.1ntpqmdoc@1.105 +2 -3
+ NTP_4_2_7P289
+
+ ntpq/ntpq.man.in@1.105 +2 -3
+ NTP_4_2_7P289
+
+ ntpq/ntpq.mdoc.in@1.105 +2 -3
+ NTP_4_2_7P289
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.291 +4 -4
+ NTP_4_2_7P289
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.291 +3 -3
+ NTP_4_2_7P289
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.4.5 +2 -2
+ NTP_4_2_7P289
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.105 +2 -4
+ NTP_4_2_7P289
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.105 +2 -4
+ NTP_4_2_7P289
+
+ ntpsnmpd/ntpsnmpd.man.in@1.105 +2 -4
+ NTP_4_2_7P289
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.105 +2 -4
+ NTP_4_2_7P289
+
+ packageinfo.sh@1.292 +1 -1
+ NTP_4_2_7P289
+
+ scripts/ntp-wait-opts.texi@1.92.4.5 +2 -14
+ NTP_4_2_7P289
+
+ scripts/ntp-wait.1ntp-waitman@1.105 +2 -4
+ NTP_4_2_7P289
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.105 +2 -4
+ NTP_4_2_7P289
+
+ scripts/ntp-wait.html@1.109 +2 -14
+ NTP_4_2_7P289
+
+ scripts/ntp-wait.man.in@1.105 +2 -4
+ NTP_4_2_7P289
+
+ scripts/ntp-wait.mdoc.in@1.105 +2 -4
+ NTP_4_2_7P289
+
+ sntp/sntp-opts.c@1.287 +4 -4
+ NTP_4_2_7P289
+
+ sntp/sntp-opts.h@1.287 +3 -3
+ NTP_4_2_7P289
+
+ sntp/sntp-opts.texi@1.270.4.5 +2 -2
+ NTP_4_2_7P289
+
+ sntp/sntp.1sntpman@1.107 +3 -7
+ NTP_4_2_7P289
+
+ sntp/sntp.1sntpmdoc@1.107 +3 -7
+ NTP_4_2_7P289
+
+ sntp/sntp.html@1.287 +2 -2
+ NTP_4_2_7P289
+
+ sntp/sntp.man.in@1.107 +3 -7
+ NTP_4_2_7P289
+
+ sntp/sntp.mdoc.in@1.107 +3 -7
+ NTP_4_2_7P289
+
+ util/ntp-keygen-opts.c@1.291 +4 -4
+ NTP_4_2_7P289
+
+ util/ntp-keygen-opts.h@1.291 +3 -3
+ NTP_4_2_7P289
+
+ util/ntp-keygen-opts.texi@1.275.4.5 +2 -2
+ NTP_4_2_7P289
+
+ util/ntp-keygen.1ntp-keygenman@1.105 +4 -8
+ NTP_4_2_7P289
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.105 +4 -8
+ NTP_4_2_7P289
+
+ util/ntp-keygen.man.in@1.105 +4 -8
+ NTP_4_2_7P289
+
+ util/ntp-keygen.mdoc.in@1.105 +4 -8
+ NTP_4_2_7P289
+
+ChangeSet@1.2773.1.55, 2012-07-15 02:28:03-07:00, stenn@stenn.ntp.org
+ CID 97123: Future-proof possible change to refclock_nmea.c
+
+ ChangeLog@1.1146.1.46 +1 -0
+ CID 97123: Future-proof possible change to refclock_nmea.c
+
+ ntpd/refclock_nmea.c@1.71 +1 -0
+ CID 97123: Future-proof possible change to refclock_nmea.c
+
+ChangeSet@1.2773.1.54, 2012-07-15 01:04:03-07:00, stenn@stenn.ntp.org
+ CID 97377: ntp-keygen.c's followlink() might not NUL-terminate
+
+ ChangeLog@1.1146.1.45 +1 -0
+ CID 97377: ntp-keygen.c's followlink() might not NUL-terminate
+
+ util/ntp-keygen.c@1.92 +5 -1
+ CID 97377: ntp-keygen.c's followlink() might not NUL-terminate
+
+ChangeSet@1.2773.1.53, 2012-07-14 23:46:24-07:00, stenn@stenn.ntp.org
+ CID 709185: refclock_chu.c will leak fd==0 (which should be impossible)
+
+ ChangeLog@1.1146.1.44 +1 -0
+ CID 709185: refclock_chu.c will leak fd==0 (which should be impossible)
+
+ ntpd/refclock_chu.c@1.54 +11 -0
+ CID 709185: refclock_chu.c will leak fd==0 (which should be impossible)
+
+ChangeSet@1.2773.1.52, 2012-07-03 09:13:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P288
+ TAG: NTP_4_2_7P288
+
+ ChangeLog@1.1146.1.43 +1 -0
+ NTP_4_2_7P288
+
+ ntpd/ntpd-opts.c@1.293 +4 -4
+ NTP_4_2_7P288
+
+ ntpd/ntpd-opts.h@1.293 +3 -3
+ NTP_4_2_7P288
+
+ ntpd/ntpd-opts.texi@1.275.4.4 +2 -2
+ NTP_4_2_7P288
+
+ ntpd/ntpd.1ntpdman@1.104 +554 -8
+ NTP_4_2_7P288
+
+ ntpd/ntpd.1ntpdmdoc@1.104 +552 -7
+ NTP_4_2_7P288
+
+ ntpd/ntpd.man.in@1.104 +554 -8
+ NTP_4_2_7P288
+
+ ntpd/ntpd.mdoc.in@1.104 +552 -7
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc-opts.c@1.288 +4 -4
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc-opts.h@1.288 +3 -3
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc-opts.texi@1.272.4.4 +2 -2
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc.1ntpdcman@1.104 +709 -7
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.104 +663 -6
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc.html@1.116 +2 -2
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc.man.in@1.104 +709 -7
+ NTP_4_2_7P288
+
+ ntpdc/ntpdc.mdoc.in@1.104 +663 -6
+ NTP_4_2_7P288
+
+ ntpq/ntpq-opts.c@1.290 +4 -4
+ NTP_4_2_7P288
+
+ ntpq/ntpq-opts.h@1.290 +3 -3
+ NTP_4_2_7P288
+
+ ntpq/ntpq-opts.texi@1.274.4.4 +2 -2
+ NTP_4_2_7P288
+
+ ntpq/ntpq.1ntpqman@1.104 +261 -3
+ NTP_4_2_7P288
+
+ ntpq/ntpq.1ntpqmdoc@1.104 +245 -2
+ NTP_4_2_7P288
+
+ ntpq/ntpq.man.in@1.104 +261 -3
+ NTP_4_2_7P288
+
+ ntpq/ntpq.mdoc.in@1.104 +245 -2
+ NTP_4_2_7P288
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.290 +4 -4
+ NTP_4_2_7P288
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.290 +3 -3
+ NTP_4_2_7P288
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.4.4 +2 -2
+ NTP_4_2_7P288
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.104 +5 -4
+ NTP_4_2_7P288
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.104 +4 -3
+ NTP_4_2_7P288
+
+ ntpsnmpd/ntpsnmpd.man.in@1.104 +5 -4
+ NTP_4_2_7P288
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.104 +4 -3
+ NTP_4_2_7P288
+
+ packageinfo.sh@1.291 +1 -1
+ NTP_4_2_7P288
+
+ scripts/ntp-wait-opts.texi@1.92.4.4 +1 -1
+ NTP_4_2_7P288
+
+ scripts/ntp-wait.1ntp-waitman@1.104 +20 -4
+ NTP_4_2_7P288
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.104 +19 -3
+ NTP_4_2_7P288
+
+ scripts/ntp-wait.html@1.108 +1 -1
+ NTP_4_2_7P288
+
+ scripts/ntp-wait.man.in@1.104 +20 -4
+ NTP_4_2_7P288
+
+ scripts/ntp-wait.mdoc.in@1.104 +19 -3
+ NTP_4_2_7P288
+
+ sntp/sntp-opts.c@1.286 +4 -4
+ NTP_4_2_7P288
+
+ sntp/sntp-opts.h@1.286 +3 -3
+ NTP_4_2_7P288
+
+ sntp/sntp-opts.texi@1.270.4.4 +2 -2
+ NTP_4_2_7P288
+
+ sntp/sntp.1sntpman@1.106 +69 -6
+ NTP_4_2_7P288
+
+ sntp/sntp.1sntpmdoc@1.106 +68 -5
+ NTP_4_2_7P288
+
+ sntp/sntp.html@1.286 +2 -2
+ NTP_4_2_7P288
+
+ sntp/sntp.man.in@1.106 +69 -6
+ NTP_4_2_7P288
+
+ sntp/sntp.mdoc.in@1.106 +68 -5
+ NTP_4_2_7P288
+
+ util/ntp-keygen-opts.c@1.290 +4 -4
+ NTP_4_2_7P288
+
+ util/ntp-keygen-opts.h@1.290 +3 -3
+ NTP_4_2_7P288
+
+ util/ntp-keygen-opts.texi@1.275.4.4 +2 -2
+ NTP_4_2_7P288
+
+ util/ntp-keygen.1ntp-keygenman@1.104 +724 -6
+ NTP_4_2_7P288
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.104 +709 -5
+ NTP_4_2_7P288
+
+ util/ntp-keygen.man.in@1.104 +724 -6
+ NTP_4_2_7P288
+
+ util/ntp-keygen.mdoc.in@1.104 +709 -5
+ NTP_4_2_7P288
+
+ChangeSet@1.2773.1.51, 2012-07-03 04:44:18-04:00, stenn@deacon.udel.edu
+ CID 709173: Make sure a libisc function we do not use is called properly
+
+ ChangeLog@1.1146.1.42 +1 -0
+ CID 709173: Make sure a libisc function we do not use is called properly
+
+ lib/isc/unix/file.c@1.6 +2 -0
+ CID 709173: Make sure a libisc function we do not use is called properly
+
+ChangeSet@1.2773.1.50, 2012-07-03 01:29:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P287
+ TAG: NTP_4_2_7P287
+
+ ChangeLog@1.1146.1.41 +1 -0
+ NTP_4_2_7P287
+
+ ntpd/ntpd-opts.c@1.292 +4 -4
+ NTP_4_2_7P287
+
+ ntpd/ntpd-opts.h@1.292 +3 -3
+ NTP_4_2_7P287
+
+ ntpd/ntpd-opts.texi@1.275.4.3 +2 -2
+ NTP_4_2_7P287
+
+ ntpd/ntpd.1ntpdman@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpd/ntpd.1ntpdmdoc@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpd/ntpd.man.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpd/ntpd.mdoc.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc-opts.c@1.287 +4 -4
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc-opts.h@1.287 +3 -3
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc-opts.texi@1.272.4.3 +2 -2
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc.1ntpdcman@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc.html@1.115 +2 -2
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc.man.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpdc/ntpdc.mdoc.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpq/ntpq-opts.c@1.289 +4 -4
+ NTP_4_2_7P287
+
+ ntpq/ntpq-opts.h@1.289 +3 -3
+ NTP_4_2_7P287
+
+ ntpq/ntpq-opts.texi@1.274.4.3 +2 -2
+ NTP_4_2_7P287
+
+ ntpq/ntpq.1ntpqman@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpq/ntpq.1ntpqmdoc@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpq/ntpq.man.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpq/ntpq.mdoc.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.289 +4 -4
+ NTP_4_2_7P287
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.289 +3 -3
+ NTP_4_2_7P287
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.4.3 +2 -2
+ NTP_4_2_7P287
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpsnmpd/ntpsnmpd.man.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ packageinfo.sh@1.290 +1 -1
+ NTP_4_2_7P287
+
+ scripts/ntp-wait-opts.texi@1.92.4.3 +14 -2
+ NTP_4_2_7P287
+
+ scripts/ntp-wait.1ntp-waitman@1.103 +2 -2
+ NTP_4_2_7P287
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.103 +2 -2
+ NTP_4_2_7P287
+
+ scripts/ntp-wait.html@1.107 +14 -2
+ NTP_4_2_7P287
+
+ scripts/ntp-wait.man.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ scripts/ntp-wait.mdoc.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ sntp/sntp-opts.c@1.285 +4 -4
+ NTP_4_2_7P287
+
+ sntp/sntp-opts.h@1.285 +3 -3
+ NTP_4_2_7P287
+
+ sntp/sntp-opts.texi@1.270.4.3 +2 -2
+ NTP_4_2_7P287
+
+ sntp/sntp.1sntpman@1.105 +2 -2
+ NTP_4_2_7P287
+
+ sntp/sntp.1sntpmdoc@1.105 +2 -2
+ NTP_4_2_7P287
+
+ sntp/sntp.html@1.285 +2 -2
+ NTP_4_2_7P287
+
+ sntp/sntp.man.in@1.105 +2 -2
+ NTP_4_2_7P287
+
+ sntp/sntp.mdoc.in@1.105 +2 -2
+ NTP_4_2_7P287
+
+ util/ntp-keygen-opts.c@1.289 +4 -4
+ NTP_4_2_7P287
+
+ util/ntp-keygen-opts.h@1.289 +3 -3
+ NTP_4_2_7P287
+
+ util/ntp-keygen-opts.texi@1.275.4.3 +2 -2
+ NTP_4_2_7P287
+
+ util/ntp-keygen.1ntp-keygenman@1.103 +2 -2
+ NTP_4_2_7P287
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.103 +2 -2
+ NTP_4_2_7P287
+
+ util/ntp-keygen.man.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ util/ntp-keygen.mdoc.in@1.103 +2 -2
+ NTP_4_2_7P287
+
+ChangeSet@1.2773.1.49, 2012-07-02 02:17:35+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Remove 1024 associations-per-server limit from ntpq.
+ Remove blank line between ntpq mreadvar associations.
+
+ ChangeLog@1.1146.1.40 +2 -0
+ Remove 1024 associations-per-server limit from ntpq.
+ Remove blank line between ntpq mreadvar associations.
+
+ ntpq/ntpq-subs.c@1.97 +13 -10
+ Remove 1024 associations-per-server limit from ntpq.
+ Remove blank line between ntpq mreadvar associations.
+
+ ntpq/ntpq.c@1.147 +28 -2
+ Remove 1024 associations-per-server limit from ntpq.
+
+ ntpq/ntpq.h@1.27 +3 -3
+ Remove 1024 associations-per-server limit from ntpq.
+
+ChangeSet@1.2773.1.48, 2012-06-28 07:06:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P286
+ TAG: NTP_4_2_7P286
+
+ ChangeLog@1.1146.1.39 +1 -0
+ NTP_4_2_7P286
+
+ ntpd/ntpd-opts.c@1.291 +4 -4
+ NTP_4_2_7P286
+
+ ntpd/ntpd-opts.h@1.291 +3 -3
+ NTP_4_2_7P286
+
+ ntpd/ntpd-opts.texi@1.275.4.2 +2 -2
+ NTP_4_2_7P286
+
+ ntpd/ntpd.1ntpdman@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpd/ntpd.1ntpdmdoc@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpd/ntpd.man.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpd/ntpd.mdoc.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc-opts.c@1.286 +4 -4
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc-opts.h@1.286 +3 -3
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc-opts.texi@1.272.4.2 +2 -2
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc.1ntpdcman@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc.html@1.114 +2 -2
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc.man.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpdc/ntpdc.mdoc.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpq/ntpq-opts.c@1.288 +4 -4
+ NTP_4_2_7P286
+
+ ntpq/ntpq-opts.h@1.288 +3 -3
+ NTP_4_2_7P286
+
+ ntpq/ntpq-opts.texi@1.274.4.2 +2 -2
+ NTP_4_2_7P286
+
+ ntpq/ntpq.1ntpqman@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpq/ntpq.1ntpqmdoc@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpq/ntpq.man.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpq/ntpq.mdoc.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.288 +4 -4
+ NTP_4_2_7P286
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.288 +3 -3
+ NTP_4_2_7P286
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.4.2 +2 -2
+ NTP_4_2_7P286
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpsnmpd/ntpsnmpd.man.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ packageinfo.sh@1.289 +1 -1
+ NTP_4_2_7P286
+
+ scripts/ntp-wait-opts.texi@1.92.4.2 +2 -14
+ NTP_4_2_7P286
+
+ scripts/ntp-wait.1ntp-waitman@1.102 +2 -2
+ NTP_4_2_7P286
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.102 +2 -2
+ NTP_4_2_7P286
+
+ scripts/ntp-wait.html@1.106 +2 -14
+ NTP_4_2_7P286
+
+ scripts/ntp-wait.man.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ scripts/ntp-wait.mdoc.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ sntp/sntp-opts.c@1.284 +4 -4
+ NTP_4_2_7P286
+
+ sntp/sntp-opts.h@1.284 +3 -3
+ NTP_4_2_7P286
+
+ sntp/sntp-opts.texi@1.270.4.2 +2 -2
+ NTP_4_2_7P286
+
+ sntp/sntp.1sntpman@1.104 +2 -2
+ NTP_4_2_7P286
+
+ sntp/sntp.1sntpmdoc@1.104 +2 -2
+ NTP_4_2_7P286
+
+ sntp/sntp.html@1.284 +2 -2
+ NTP_4_2_7P286
+
+ sntp/sntp.man.in@1.104 +2 -2
+ NTP_4_2_7P286
+
+ sntp/sntp.mdoc.in@1.104 +2 -2
+ NTP_4_2_7P286
+
+ util/ntp-keygen-opts.c@1.288 +4 -4
+ NTP_4_2_7P286
+
+ util/ntp-keygen-opts.h@1.288 +3 -3
+ NTP_4_2_7P286
+
+ util/ntp-keygen-opts.texi@1.275.4.2 +2 -2
+ NTP_4_2_7P286
+
+ util/ntp-keygen.1ntp-keygenman@1.102 +2 -2
+ NTP_4_2_7P286
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.102 +2 -2
+ NTP_4_2_7P286
+
+ util/ntp-keygen.man.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ util/ntp-keygen.mdoc.in@1.102 +2 -2
+ NTP_4_2_7P286
+
+ChangeSet@1.2773.1.47, 2012-06-27 23:43:05-07:00, stenn@stenn.ntp.org
+ CID 97193: check return from sscanf() in ntp_config.c
+
+ ChangeLog@1.1146.1.38 +1 -0
+ CID 97193: check return from sscanf() in ntp_config.c
+
+ ntpd/ntp_config.c@1.300 +3 -3
+ CID 97193: check return from sscanf() in ntp_config.c
+
+ChangeSet@1.2773.1.46, 2012-06-27 23:37:22-07:00, stenn@stenn.ntp.org
+ CID 709207: Initialize "quality" for ulink_receive
+
+ ChangeLog@1.1146.1.37 +1 -0
+ CID 709207: Initialize "quality" for ulink_receive
+
+ ntpd/refclock_ulink.c@1.19 +7 -7
+ CID 709207: Initialize "quality" for ulink_receive
+
+ChangeSet@1.2773.1.45, 2012-06-27 23:28:32-07:00, stenn@stenn.ntp.org
+ CID 709169: check return from open("/dev/null", 0) and friends
+
+ ChangeLog@1.1146.1.36 +1 -0
+ CID 709169: check return from open("/dev/null", 0) and friends
+
+ ntpd/ntpd.c@1.131 +2 -3
+ CID 709169: check return from open("/dev/null", 0) and friends
+
+ChangeSet@1.2773.1.44, 2012-06-18 11:33:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P285
+ TAG: NTP_4_2_7P285
+
+ ChangeLog@1.1146.1.35 +1 -0
+ NTP_4_2_7P285
+
+ ntpd/ntpd-opts.c@1.290 +4 -4
+ NTP_4_2_7P285
+
+ ntpd/ntpd-opts.h@1.290 +3 -3
+ NTP_4_2_7P285
+
+ ntpd/ntpd-opts.texi@1.275.4.1 +2 -2
+ NTP_4_2_7P285
+
+ ntpd/ntpd.1ntpdman@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpd/ntpd.1ntpdmdoc@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpd/ntpd.man.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpd/ntpd.mdoc.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc-opts.c@1.285 +4 -4
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc-opts.h@1.285 +3 -3
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc-opts.texi@1.272.4.1 +2 -2
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc.1ntpdcman@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc.html@1.113 +2 -2
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc.man.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpdc/ntpdc.mdoc.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpq/ntpq-opts.c@1.287 +4 -4
+ NTP_4_2_7P285
+
+ ntpq/ntpq-opts.h@1.287 +3 -3
+ NTP_4_2_7P285
+
+ ntpq/ntpq-opts.texi@1.274.4.1 +2 -2
+ NTP_4_2_7P285
+
+ ntpq/ntpq.1ntpqman@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpq/ntpq.1ntpqmdoc@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpq/ntpq.man.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpq/ntpq.mdoc.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.287 +4 -4
+ NTP_4_2_7P285
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.287 +3 -3
+ NTP_4_2_7P285
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.4.1 +2 -2
+ NTP_4_2_7P285
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpsnmpd/ntpsnmpd.man.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ packageinfo.sh@1.288 +1 -1
+ NTP_4_2_7P285
+
+ scripts/ntp-wait-opts.texi@1.92.4.1 +1 -1
+ NTP_4_2_7P285
+
+ scripts/ntp-wait.1ntp-waitman@1.101 +2 -2
+ NTP_4_2_7P285
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.101 +2 -2
+ NTP_4_2_7P285
+
+ scripts/ntp-wait.html@1.105 +1 -1
+ NTP_4_2_7P285
+
+ scripts/ntp-wait.man.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ scripts/ntp-wait.mdoc.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ sntp/sntp-opts.c@1.283 +4 -4
+ NTP_4_2_7P285
+
+ sntp/sntp-opts.h@1.283 +3 -3
+ NTP_4_2_7P285
+
+ sntp/sntp-opts.texi@1.270.4.1 +2 -2
+ NTP_4_2_7P285
+
+ sntp/sntp.1sntpman@1.103 +2 -2
+ NTP_4_2_7P285
+
+ sntp/sntp.1sntpmdoc@1.103 +2 -2
+ NTP_4_2_7P285
+
+ sntp/sntp.html@1.283 +2 -2
+ NTP_4_2_7P285
+
+ sntp/sntp.man.in@1.103 +2 -2
+ NTP_4_2_7P285
+
+ sntp/sntp.mdoc.in@1.103 +2 -2
+ NTP_4_2_7P285
+
+ util/ntp-keygen-opts.c@1.287 +4 -4
+ NTP_4_2_7P285
+
+ util/ntp-keygen-opts.h@1.287 +3 -3
+ NTP_4_2_7P285
+
+ util/ntp-keygen-opts.texi@1.275.4.1 +2 -2
+ NTP_4_2_7P285
+
+ util/ntp-keygen.1ntp-keygenman@1.101 +2 -2
+ NTP_4_2_7P285
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.101 +2 -2
+ NTP_4_2_7P285
+
+ util/ntp-keygen.man.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ util/ntp-keygen.mdoc.in@1.101 +2 -2
+ NTP_4_2_7P285
+
+ChangeSet@1.2773.1.43, 2012-06-18 07:49:19+00:00, stenn@psp-fb1.ntp.org
+ Automake-1.12 wants us to use AM_PROG_AR
+
+ ChangeLog@1.1146.1.34 +1 -0
+ Automake-1.12 wants us to use AM_PROG_AR
+
+ configure.ac@1.546 +6 -0
+ Automake-1.12 wants us to use AM_PROG_AR
+
+ sntp/configure.ac@1.69 +6 -0
+ Automake-1.12 wants us to use AM_PROG_AR
+
+ChangeSet@1.2773.1.42, 2012-06-18 05:18:28+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ generated files from last cset's ntp_parser.y and keyword-gen.c changes.
+
+ ntpd/keyword-gen-utd@1.16 +1 -1
+ generated from last cset's keyword-gen.c changes.
+
+ ntpd/ntp_keyword.h@1.18 +535 -528
+ generated from last cset's keyword-gen.c changes.
+
+ ntpd/ntp_parser.c@1.79 +806 -796
+ generated from last cset's ntp_parser.y changes.
+
+ ntpd/ntp_parser.h@1.45 +161 -159
+ generated from last cset's ntp_parser.y changes.
+
+ChangeSet@1.2773.1.41, 2012-06-18 05:01:49+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2227] Enable mrulist access control via "restrict ... nomrulist".
+ Conditionalize msyslog messages about rejected mode 6 requests due to
+ nomodify and nomrulist restrictions under "logconfig +sysinfo".
+ Increment sys_restricted in a few rejection paths due to nomodify
+ restrictions where previosuly overlooked.
+
+ ChangeLog@1.1146.1.33 +5 -0
+ [Bug 2227] Enable mrulist access control via "restrict ... nomrulist".
+ Conditionalize msyslog messages about rejected mode 6 requests due to
+ nomodify and nomrulist restrictions under "logconfig +sysinfo".
+ Increment sys_restricted in a few rejection paths due to nomodify
+ restrictions where previosuly overlooked.
+
+ include/ntp.h@1.205 +5 -3
+ Add RES_NOMRULIST (0x2000) for "restrict ... nomrulist"
+
+ include/ntp_request.h@1.46 +1 -0
+ Make explicit MAX_INFO_ERR macro for ntp_request.c
+
+ ntpd/complete.conf@1.22 +1 -1
+ Add "nomrulist" to round-trip parser/saveconfig test.
+
+ ntpd/keyword-gen.c@1.21 +1 -0
+ Add "nomrulist" / T_Nomrulist
+
+ ntpd/ntp_config.c@1.299 +4 -0
+ [Bug 2227] Enable mrulist access control via "restrict ... nomrulist".
+
+ ntpd/ntp_control.c@1.181 +24 -10
+ [Bug 2227] Enable mrulist access control via "restrict ... nomrulist".
+ Conditionalize msyslog messages about rejected mode 6 requests due to
+ nomodify and nomrulist restrictions under "logconfig +sysinfo".
+ Increment sys_restricted in a few rejection paths due to nomodify
+ restrictions where previosuly overlooked.
+
+ ntpd/ntp_parser.y@1.73 +2 -0
+ Add, use "nomrulist" restriction.
+
+ ntpd/ntp_request.c@1.110 +7 -2
+ Increment sys_restricted in a few rejection paths due to nomodify
+ restrictions where previosuly overlooked.
+ Use explicit MAX_INFO_ERR macro instead of implicitly assuming
+ INFO_ERR_AUTH is the highest-numbered.
+
+ChangeSet@1.2773.1.40, 2012-06-16 21:36:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P284
+ TAG: NTP_4_2_7P284
+
+ ChangeLog@1.1146.1.32 +1 -0
+ NTP_4_2_7P284
+
+ ntpd/ntpd-opts.c@1.289 +4 -4
+ NTP_4_2_7P284
+
+ ntpd/ntpd-opts.h@1.289 +3 -3
+ NTP_4_2_7P284
+
+ ntpd/ntpd-opts.texi@1.275.3.6 +2 -2
+ NTP_4_2_7P284
+
+ ntpd/ntpd.1ntpdman@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpd/ntpd.1ntpdmdoc@1.100 +1 -1
+ NTP_4_2_7P284
+
+ ntpd/ntpd.man.in@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpd/ntpd.mdoc.in@1.100 +1 -1
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc-opts.c@1.284 +4 -4
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc-opts.h@1.284 +3 -3
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc-opts.texi@1.272.3.6 +2 -2
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc.1ntpdcman@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.100 +1 -1
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc.html@1.112 +2 -2
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc.man.in@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpdc/ntpdc.mdoc.in@1.100 +1 -1
+ NTP_4_2_7P284
+
+ ntpq/ntpq-opts.c@1.286 +4 -4
+ NTP_4_2_7P284
+
+ ntpq/ntpq-opts.h@1.286 +3 -3
+ NTP_4_2_7P284
+
+ ntpq/ntpq-opts.texi@1.274.3.6 +2 -2
+ NTP_4_2_7P284
+
+ ntpq/ntpq.1ntpqman@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpq/ntpq.1ntpqmdoc@1.100 +1 -1
+ NTP_4_2_7P284
+
+ ntpq/ntpq.man.in@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpq/ntpq.mdoc.in@1.100 +1 -1
+ NTP_4_2_7P284
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.286 +4 -4
+ NTP_4_2_7P284
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.286 +3 -3
+ NTP_4_2_7P284
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.3.6 +2 -2
+ NTP_4_2_7P284
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.100 +1 -1
+ NTP_4_2_7P284
+
+ ntpsnmpd/ntpsnmpd.man.in@1.100 +2 -2
+ NTP_4_2_7P284
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.100 +1 -1
+ NTP_4_2_7P284
+
+ packageinfo.sh@1.287 +1 -1
+ NTP_4_2_7P284
+
+ scripts/ntp-wait-opts.texi@1.92.3.6 +1 -1
+ NTP_4_2_7P284
+
+ scripts/ntp-wait.1ntp-waitman@1.100 +2 -2
+ NTP_4_2_7P284
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.100 +1 -1
+ NTP_4_2_7P284
+
+ scripts/ntp-wait.html@1.104 +1 -1
+ NTP_4_2_7P284
+
+ scripts/ntp-wait.man.in@1.100 +2 -2
+ NTP_4_2_7P284
+
+ scripts/ntp-wait.mdoc.in@1.100 +1 -1
+ NTP_4_2_7P284
+
+ sntp/sntp-opts.c@1.282 +4 -4
+ NTP_4_2_7P284
+
+ sntp/sntp-opts.h@1.282 +3 -3
+ NTP_4_2_7P284
+
+ sntp/sntp-opts.texi@1.270.3.6 +2 -2
+ NTP_4_2_7P284
+
+ sntp/sntp.1sntpman@1.102 +2 -2
+ NTP_4_2_7P284
+
+ sntp/sntp.1sntpmdoc@1.102 +1 -1
+ NTP_4_2_7P284
+
+ sntp/sntp.html@1.282 +2 -2
+ NTP_4_2_7P284
+
+ sntp/sntp.man.in@1.102 +2 -2
+ NTP_4_2_7P284
+
+ sntp/sntp.mdoc.in@1.102 +1 -1
+ NTP_4_2_7P284
+
+ util/ntp-keygen-opts.c@1.286 +4 -4
+ NTP_4_2_7P284
+
+ util/ntp-keygen-opts.h@1.286 +3 -3
+ NTP_4_2_7P284
+
+ util/ntp-keygen-opts.texi@1.275.3.6 +2 -2
+ NTP_4_2_7P284
+
+ util/ntp-keygen.1ntp-keygenman@1.100 +2 -2
+ NTP_4_2_7P284
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.100 +1 -1
+ NTP_4_2_7P284
+
+ util/ntp-keygen.man.in@1.100 +2 -2
+ NTP_4_2_7P284
+
+ util/ntp-keygen.mdoc.in@1.100 +1 -1
+ NTP_4_2_7P284
+
+ChangeSet@1.2773.3.3, 2012-06-16 11:23:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P283
+ TAG: NTP_4_2_7P283
+
+ ChangeLog@1.1146.3.1 +1 -0
+ NTP_4_2_7P283
+
+ ntpd/ntpd-opts.c@1.288 +4 -4
+ NTP_4_2_7P283
+
+ ntpd/ntpd-opts.h@1.288 +3 -3
+ NTP_4_2_7P283
+
+ ntpd/ntpd-opts.texi@1.275.3.5 +2 -2
+ NTP_4_2_7P283
+
+ ntpd/ntpd.1ntpdman@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpd/ntpd.1ntpdmdoc@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpd/ntpd.man.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpd/ntpd.mdoc.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc-opts.c@1.283 +4 -4
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc-opts.h@1.283 +3 -3
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc-opts.texi@1.272.3.5 +2 -2
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc.1ntpdcman@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc.html@1.111 +2 -2
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc.man.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpdc/ntpdc.mdoc.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpq/ntpq-opts.c@1.285 +4 -4
+ NTP_4_2_7P283
+
+ ntpq/ntpq-opts.h@1.285 +3 -3
+ NTP_4_2_7P283
+
+ ntpq/ntpq-opts.texi@1.274.3.5 +2 -2
+ NTP_4_2_7P283
+
+ ntpq/ntpq.1ntpqman@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpq/ntpq.1ntpqmdoc@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpq/ntpq.man.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpq/ntpq.mdoc.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.285 +4 -4
+ NTP_4_2_7P283
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.285 +3 -3
+ NTP_4_2_7P283
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.3.5 +2 -2
+ NTP_4_2_7P283
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpsnmpd/ntpsnmpd.man.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ packageinfo.sh@1.286 +1 -1
+ NTP_4_2_7P283
+
+ scripts/ntp-wait-opts.texi@1.92.3.5 +1 -1
+ NTP_4_2_7P283
+
+ scripts/ntp-wait.1ntp-waitman@1.99 +2 -2
+ NTP_4_2_7P283
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.99 +2 -2
+ NTP_4_2_7P283
+
+ scripts/ntp-wait.html@1.103 +1 -1
+ NTP_4_2_7P283
+
+ scripts/ntp-wait.man.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ scripts/ntp-wait.mdoc.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ sntp/sntp-opts.c@1.281 +4 -4
+ NTP_4_2_7P283
+
+ sntp/sntp-opts.h@1.281 +3 -3
+ NTP_4_2_7P283
+
+ sntp/sntp-opts.texi@1.270.3.5 +2 -2
+ NTP_4_2_7P283
+
+ sntp/sntp.1sntpman@1.101 +2 -2
+ NTP_4_2_7P283
+
+ sntp/sntp.1sntpmdoc@1.101 +2 -2
+ NTP_4_2_7P283
+
+ sntp/sntp.html@1.281 +2 -2
+ NTP_4_2_7P283
+
+ sntp/sntp.man.in@1.101 +2 -2
+ NTP_4_2_7P283
+
+ sntp/sntp.mdoc.in@1.101 +2 -2
+ NTP_4_2_7P283
+
+ util/ntp-keygen-opts.c@1.285 +4 -4
+ NTP_4_2_7P283
+
+ util/ntp-keygen-opts.h@1.285 +3 -3
+ NTP_4_2_7P283
+
+ util/ntp-keygen-opts.texi@1.275.3.5 +2 -2
+ NTP_4_2_7P283
+
+ util/ntp-keygen.1ntp-keygenman@1.99 +2 -2
+ NTP_4_2_7P283
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.99 +2 -2
+ NTP_4_2_7P283
+
+ util/ntp-keygen.man.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ util/ntp-keygen.mdoc.in@1.99 +2 -2
+ NTP_4_2_7P283
+
+ChangeSet@1.2773.1.38, 2012-06-16 05:58:30+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Update ChangeLog for libevent update and [Bug 2225].
+
+ ChangeLog@1.1146.1.30 +2 -0
+ [Bug 2225] libevent configure hangs.
+ Update bundled libevent to git master, post libevent 2.1.1-alpha.
+
+
+ChangeSet@1.2773.1.36, 2012-06-16 04:51:53+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Linux 2.6.26 and earlier will fail libevent's timerfd_create() call due to
+ nonzero flags, yet some systems using that version have the nonworking
+ flags in their header files (Debian Lenny). Do not spew warnings in
+ regress output in that case, and set epollop->timerfd = -1. Suggested
+ by Nick Mathewson.
+
+ sntp/libevent/epoll.c@1.4 +4 -1
+ Linux 2.6.26 and earlier will fail libevent's timerfd_create() call due to
+ nonzero flags, yet some systems using that version have the nonworking
+ flags in their header files (Debian Lenny). Do not spew warnings in
+ regress output in that case, and set epollop->timerfd = -1. Suggested
+ by Nick Mathewson.
+
+ChangeSet@1.2773.3.2, 2012-06-16 03:45:09+00:00, stenn@poog.il.thewrittenword.com
+ Improvements to sntp/m4/ntp_openssl.m4
+
+ ChangeLog@1.1146.1.29 +2 -0
+ Improvements to sntp/m4/ntp_openssl.m4
+
+ sntp/m4/ntp_openssl.m4@1.21 +35 -16
+ Improvements to sntp/m4/ntp_openssl.m4
+
+ChangeSet@1.2773.3.1, 2012-06-15 11:22:51+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P282
+ TAG: NTP_4_2_7P282
+
+ ChangeLog@1.1146.1.28 +1 -0
+ NTP_4_2_7P282
+
+ ntpd/ntpd-opts.c@1.287 +4 -4
+ NTP_4_2_7P282
+
+ ntpd/ntpd-opts.h@1.287 +3 -3
+ NTP_4_2_7P282
+
+ ntpd/ntpd-opts.texi@1.275.3.4 +2 -2
+ NTP_4_2_7P282
+
+ ntpd/ntpd.1ntpdman@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpd/ntpd.1ntpdmdoc@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpd/ntpd.man.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpd/ntpd.mdoc.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc-opts.c@1.282 +4 -4
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc-opts.h@1.282 +3 -3
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc-opts.texi@1.272.3.4 +2 -2
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc.1ntpdcman@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc.html@1.110 +2 -2
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc.man.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpdc/ntpdc.mdoc.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpq/ntpq-opts.c@1.284 +4 -4
+ NTP_4_2_7P282
+
+ ntpq/ntpq-opts.h@1.284 +3 -3
+ NTP_4_2_7P282
+
+ ntpq/ntpq-opts.texi@1.274.3.4 +2 -2
+ NTP_4_2_7P282
+
+ ntpq/ntpq.1ntpqman@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpq/ntpq.1ntpqmdoc@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpq/ntpq.man.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpq/ntpq.mdoc.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.284 +4 -4
+ NTP_4_2_7P282
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.284 +3 -3
+ NTP_4_2_7P282
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.3.4 +2 -2
+ NTP_4_2_7P282
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpsnmpd/ntpsnmpd.man.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ packageinfo.sh@1.285 +1 -1
+ NTP_4_2_7P282
+
+ scripts/ntp-wait-opts.texi@1.92.3.4 +1 -1
+ NTP_4_2_7P282
+
+ scripts/ntp-wait.1ntp-waitman@1.98 +2 -2
+ NTP_4_2_7P282
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.98 +2 -2
+ NTP_4_2_7P282
+
+ scripts/ntp-wait.html@1.102 +1 -1
+ NTP_4_2_7P282
+
+ scripts/ntp-wait.man.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ scripts/ntp-wait.mdoc.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ sntp/sntp-opts.c@1.280 +4 -4
+ NTP_4_2_7P282
+
+ sntp/sntp-opts.h@1.280 +3 -3
+ NTP_4_2_7P282
+
+ sntp/sntp-opts.texi@1.270.3.4 +2 -2
+ NTP_4_2_7P282
+
+ sntp/sntp.1sntpman@1.100 +2 -2
+ NTP_4_2_7P282
+
+ sntp/sntp.1sntpmdoc@1.100 +2 -2
+ NTP_4_2_7P282
+
+ sntp/sntp.html@1.280 +2 -2
+ NTP_4_2_7P282
+
+ sntp/sntp.man.in@1.100 +2 -2
+ NTP_4_2_7P282
+
+ sntp/sntp.mdoc.in@1.100 +2 -2
+ NTP_4_2_7P282
+
+ util/ntp-keygen-opts.c@1.284 +4 -4
+ NTP_4_2_7P282
+
+ util/ntp-keygen-opts.h@1.284 +3 -3
+ NTP_4_2_7P282
+
+ util/ntp-keygen-opts.texi@1.275.3.4 +2 -2
+ NTP_4_2_7P282
+
+ util/ntp-keygen.1ntp-keygenman@1.98 +2 -2
+ NTP_4_2_7P282
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.98 +2 -2
+ NTP_4_2_7P282
+
+ util/ntp-keygen.man.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ util/ntp-keygen.mdoc.in@1.98 +2 -2
+ NTP_4_2_7P282
+
+ChangeSet@1.2773.1.35, 2012-06-14 23:17:32+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ repair merge flub
+ keep local-to-NTP patch up to date with event-config.h s/_EVENT/EVENT_/
+
+ sntp/libevent/configure.in@1.11 +3 -0
+ repair merge flub
+
+ sntp/libevent/evthread_pthread.c@1.5 +1 -1
+ keep local-to-NTP patch up to date with event-config.h s/_EVENT/EVENT_/
+
+ChangeSet@1.2461.1.10, 2012-06-14 22:20:00+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/ChangeLog@1.6 +289 -1127
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/ChangeLog-1.4@1.1 +231 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/ChangeLog-1.4
+
+ sntp/libevent/ChangeLog-1.4@1.0 +0 -0
+
+ sntp/libevent/ChangeLog-2.0@1.1 +1225 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/ChangeLog-2.0
+
+ sntp/libevent/ChangeLog-2.0@1.0 +0 -0
+
+ sntp/libevent/Doxyfile@1.3 +1 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/LICENSE@1.2 +26 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/Makefile.am@1.1.1.6 +83 -44
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/Makefile.nmake@1.3 +5 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/README@1.5 +41 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/WIN32-Code/evconfig-private.h@1.2 +2 -2
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/WIN32-Code/event2/event-config.h@1.1.1.3 +115 -115
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/arc4random.c@1.1.1.3 +20 -19
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/buffer.c@1.7 +432 -175
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/buffer_iocp.c@1.5 +19 -19
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent-internal.h@1.5 +48 -34
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent.c@1.5 +77 -55
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent_async.c@1.5 +74 -74
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent_filter.c@1.5 +33 -33
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent_openssl.c@1.6 +171 -60
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent_pair.c@1.5 +13 -13
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent_ratelim.c@1.4 +170 -107
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/bufferevent_sock.c@1.5 +49 -49
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/changelist-internal.h@1.2 +8 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/compat/sys/queue.h@1.3 +3 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/configure.in@1.1.1.5 +110 -23
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/defer-internal.h@1.4 +9 -9
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/devpoll.c@1.3 +10 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/epoll.c@1.3 +116 -21
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/epoll_sub.c@1.3 +1 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evbuffer-internal.h@1.5 +39 -22
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evconfig-private.h.in@1.2 +7 -2
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evdns.c@1.1.1.5 +171 -101
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/event-internal.h@1.1.1.5 +55 -30
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/event.c@1.1.1.6 +731 -460
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/event_iocp.c@1.5 +13 -13
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/event_rpcgen.py@1.2 +17 -16
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/event_tagging.c@1.4 +5 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evmap-internal.h@1.2 +42 -15
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evmap.c@1.5 +359 -68
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evport.c@1.1.1.3 +13 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evrpc-internal.h@1.2 +11 -11
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evrpc.c@1.5 +24 -24
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evsignal-internal.h@1.2 +9 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evthread-internal.h@1.5 +112 -102
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evthread.c@1.1.1.4 +100 -85
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evthread_pthread.c@1.1.1.2 +16 -16
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evthread_win32.c@1.5 +24 -23
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evutil.c@1.1.1.5 +511 -168
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evutil_rand.c@1.5 +49 -14
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/evutil_time.c@1.1 +485 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/evutil_time.c
+
+ sntp/libevent/evutil_time.c@1.0 +0 -0
+
+ sntp/libevent/ht-internal.h@1.3 +52 -48
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/http-internal.h@1.3 +17 -12
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/http.c@1.1.1.6 +197 -150
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/Makefile.am@1.1.1.2 +6 -0
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/evdns.h@1.4 +5 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/evdns.h@1.3 +0 -0
+ Rename: sntp/libevent/evdns.h -> sntp/libevent/include/evdns.h
+
+ sntp/libevent/include/event.h@1.5 +7 -7
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event.h@1.4 +0 -0
+ Rename: sntp/libevent/event.h -> sntp/libevent/include/event.h
+
+ sntp/libevent/include/event2/buffer.h@1.4 +100 -16
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/buffer_compat.h@1.3 +3 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/bufferevent.h@1.3 +55 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/bufferevent_compat.h@1.3 +3 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/bufferevent_ssl.h@1.3 +25 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/bufferevent_struct.h@1.3 +6 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/dns.h@1.5 +12 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/dns_compat.h@1.4 +6 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/dns_struct.h@1.3 +6 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/event.h@1.1.1.5 +142 -20
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/event_compat.h@1.4 +6 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/event_struct.h@1.3 +32 -14
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/http.h@1.4 +70 -10
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/http_compat.h@1.3 +6 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/http_struct.h@1.3 +6 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/keyvalq_struct.h@1.2 +7 -7
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/listener.h@1.2 +20 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/rpc.h@1.3 +8 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/rpc_compat.h@1.3 +4 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/rpc_struct.h@1.3 +4 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/tag.h@1.3 +6 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/tag_compat.h@1.3 +4 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/thread.h@1.4 +11 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/event2/util.h@1.4 +93 -64
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/evhttp.h@1.4 +5 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/evhttp.h@1.3 +0 -0
+ Rename: sntp/libevent/evhttp.h -> sntp/libevent/include/evhttp.h
+
+ sntp/libevent/include/evrpc.h@1.4 +5 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/evrpc.h@1.3 +0 -0
+ Rename: sntp/libevent/evrpc.h -> sntp/libevent/include/evrpc.h
+
+ sntp/libevent/include/evutil.h@1.4 +4 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/include/evutil.h@1.3 +0 -0
+ Rename: sntp/libevent/evutil.h -> sntp/libevent/include/evutil.h
+
+ sntp/libevent/iocp-internal.h@1.3 +28 -28
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/ipv6-internal.h@1.1.1.2 +7 -7
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/kqueue-internal.h@1.1 +39 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/kqueue-internal.h
+
+ sntp/libevent/kqueue-internal.h@1.0 +0 -0
+
+ sntp/libevent/kqueue.c@1.6 +98 -16
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/listener.c@1.5 +48 -45
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/log-internal.h@1.2 +29 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/log.c@1.4 +36 -17
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/m4/libevent_openssl.m4@1.2 +3 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/make-event-config.sed@1.1 +23 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/make-event-config.sed
+
+ sntp/libevent/make-event-config.sed@1.0 +0 -0
+
+ sntp/libevent/minheap-internal.h@1.4 +30 -30
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/mm-internal.h@1.2 +31 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/poll.c@1.3 +22 -15
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/ratelim-internal.h@1.2 +7 -7
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/sample/Makefile.am@1.1.1.5 +21 -9
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/sample/dns-example.c@1.1.1.4 +28 -7
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/sample/event-read-fifo.c@1.4 +45 -26
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/sample/event-read-fifo.c@1.3 +0 -0
+ Rename: sntp/libevent/sample/event-test.c -> sntp/libevent/sample/event-read-fifo.c
+
+ sntp/libevent/sample/http-server.c@1.1.1.5 +5 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/sample/signal-test.c@1.3 +7 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/sample/time-test.c@1.3 +1 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/select.c@1.1.1.4 +14 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/signal.c@1.6 +65 -32
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/strlcpy-internal.h@1.3 +5 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/strlcpy.c@1.3 +2 -2
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/Makefile.am@1.1.1.5 +60 -13
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/bench.c@1.3 +3 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/bench_cascade.c@1.3 +3 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/bench_http.c@1.4 +1 -3
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/bench_httpclient.c@1.1.1.3 +4 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/check-dumpevents.py@1.2 +0 -0
+ Change mode to -rwxr-xr-x
+
+ sntp/libevent/test/check-dumpevents.py@1.1 +54 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/test/check-dumpevents.py
+
+ sntp/libevent/test/check-dumpevents.py@1.0 +0 -0
+
+ sntp/libevent/test/regress.c@1.3 +273 -86
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress.h@1.3 +10 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_buffer.c@1.5 +331 -16
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_bufferevent.c@1.3 +21 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_dns.c@1.1.1.3 +186 -33
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_et.c@1.3 +16 -8
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_http.c@1.1.1.4 +47 -40
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_iocp.c@1.2 +29 -29
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_listener.c@1.1.1.3 +5 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_main.c@1.4 +38 -10
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_minheap.c@1.2 +11 -11
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_rpc.c@1.4 +7 -7
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_ssl.c@1.4 +1 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_testutils.c@1.1.1.3 +21 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_testutils.h@1.2 +4 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_thread.c@1.3 +104 -25
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_util.c@1.4 +262 -23
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/regress_zlib.c@1.3 +1 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test-changelist.c@1.3 +31 -5
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test-dumpevents.c@1.1 +180 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/test/test-dumpevents.c
+
+ sntp/libevent/test/test-dumpevents.c@1.0 +0 -0
+
+ sntp/libevent/test/test-eof.c@1.1.1.3 +28 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test-fdleak.c@1.1 +249 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/test/test-fdleak.c
+
+ sntp/libevent/test/test-fdleak.c@1.0 +0 -0
+
+ sntp/libevent/test/test-init.c@1.3 +26 -4
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test-ratelim.c@1.1.1.4 +124 -9
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test-ratelim.sh@1.3 +11 -0
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test-time.c@1.3 +24 -2
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test-weof.c@1.3 +28 -6
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/test.sh@1.1.1.3 +48 -52
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/tinytest.c@1.4 +31 -20
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/tinytest.h@1.2 +9 -9
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/tinytest_demo.c@1.2 +2 -2
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/tinytest_local.h@1.3 +1 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/test/tinytest_macros.h@1.2 +39 -39
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/time-internal.h@1.1 +101 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/time-internal.h
+
+ sntp/libevent/time-internal.h@1.0 +0 -0
+
+ sntp/libevent/util-internal.h@1.1.1.4 +181 -47
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/whatsnew-2.0.txt@1.3 +1 -1
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ sntp/libevent/whatsnew-2.1.txt@1.1 +390 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/whatsnew-2.1.txt
+
+ sntp/libevent/whatsnew-2.1.txt@1.0 +0 -0
+
+ sntp/libevent/win32select.c@1.3 +30 -20
+ update to libevent git master, after 2.1.1-alpha, as of 14-Jun-2012 git cset
+ e7bf4c84afd7961eb92a2d6583c84b56a87f2555
+
+ChangeSet@1.2773.1.33, 2012-06-14 07:53:00-04:00, stenn@deacon.udel.edu
+ tickadj may need to be linked with PTHREAD_LIBS
+
+ ChangeLog@1.1146.1.27 +1 -0
+ tickadj may need to be linked with PTHREAD_LIBS
+
+ util/Makefile.am@1.71.1.2 +1 -1
+ tickadj may need to be linked with PTHREAD_LIBS
+
+ChangeSet@1.2773.1.32, 2012-06-14 11:24:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P281
+ TAG: NTP_4_2_7P281
+
+ ChangeLog@1.1146.1.26 +1 -0
+ NTP_4_2_7P281
+
+ ntpd/ntpd-opts.c@1.286 +4 -4
+ NTP_4_2_7P281
+
+ ntpd/ntpd-opts.h@1.286 +3 -3
+ NTP_4_2_7P281
+
+ ntpd/ntpd-opts.texi@1.275.3.3 +2 -2
+ NTP_4_2_7P281
+
+ ntpd/ntpd.1ntpdman@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpd/ntpd.1ntpdmdoc@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpd/ntpd.man.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpd/ntpd.mdoc.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc-opts.c@1.281 +4 -4
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc-opts.h@1.281 +3 -3
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc-opts.texi@1.272.3.3 +2 -2
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc.1ntpdcman@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc.html@1.109 +2 -2
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc.man.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpdc/ntpdc.mdoc.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpq/ntpq-opts.c@1.283 +4 -4
+ NTP_4_2_7P281
+
+ ntpq/ntpq-opts.h@1.283 +3 -3
+ NTP_4_2_7P281
+
+ ntpq/ntpq-opts.texi@1.274.3.3 +2 -2
+ NTP_4_2_7P281
+
+ ntpq/ntpq.1ntpqman@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpq/ntpq.1ntpqmdoc@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpq/ntpq.man.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpq/ntpq.mdoc.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.283 +4 -4
+ NTP_4_2_7P281
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.283 +3 -3
+ NTP_4_2_7P281
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.3.3 +2 -2
+ NTP_4_2_7P281
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpsnmpd/ntpsnmpd.man.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ packageinfo.sh@1.284 +1 -1
+ NTP_4_2_7P281
+
+ scripts/ntp-wait-opts.texi@1.92.3.3 +14 -2
+ NTP_4_2_7P281
+
+ scripts/ntp-wait.1ntp-waitman@1.97 +2 -2
+ NTP_4_2_7P281
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.97 +2 -2
+ NTP_4_2_7P281
+
+ scripts/ntp-wait.html@1.101 +14 -2
+ NTP_4_2_7P281
+
+ scripts/ntp-wait.man.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ scripts/ntp-wait.mdoc.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ sntp/sntp-opts.c@1.279 +4 -4
+ NTP_4_2_7P281
+
+ sntp/sntp-opts.h@1.279 +3 -3
+ NTP_4_2_7P281
+
+ sntp/sntp-opts.texi@1.270.3.3 +2 -2
+ NTP_4_2_7P281
+
+ sntp/sntp.1sntpman@1.99 +2 -2
+ NTP_4_2_7P281
+
+ sntp/sntp.1sntpmdoc@1.99 +2 -2
+ NTP_4_2_7P281
+
+ sntp/sntp.html@1.279 +2 -2
+ NTP_4_2_7P281
+
+ sntp/sntp.man.in@1.99 +2 -2
+ NTP_4_2_7P281
+
+ sntp/sntp.mdoc.in@1.99 +2 -2
+ NTP_4_2_7P281
+
+ util/ntp-keygen-opts.c@1.283 +4 -4
+ NTP_4_2_7P281
+
+ util/ntp-keygen-opts.h@1.283 +3 -3
+ NTP_4_2_7P281
+
+ util/ntp-keygen-opts.texi@1.275.3.3 +2 -2
+ NTP_4_2_7P281
+
+ util/ntp-keygen.1ntp-keygenman@1.97 +2 -2
+ NTP_4_2_7P281
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.97 +2 -2
+ NTP_4_2_7P281
+
+ util/ntp-keygen.man.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ util/ntp-keygen.mdoc.in@1.97 +2 -2
+ NTP_4_2_7P281
+
+ChangeSet@1.2773.1.31, 2012-06-14 06:38:51-04:00, stenn@deacon.udel.edu
+ U_INT32_MAX cleanup in include/ntp_types.h
+
+ ChangeLog@1.1146.1.25 +1 -0
+ U_INT32_MAX cleanup in include/ntp_types.h
+
+ include/ntp_types.h@1.32 +4 -4
+ U_INT32_MAX cleanup in include/ntp_types.h
+
+ChangeSet@1.2773.1.30, 2012-06-14 05:41:58-04:00, stenn@deacon.udel.edu
+ When linking, ntp_keygen and tickadj need $(LIBM)
+
+ ChangeLog@1.1146.1.24 +1 -0
+ When linking, ntp_keygen and tickadj need $(LIBM)
+
+ util/Makefile.am@1.71.1.1 +2 -2
+ When linking, ntp_keygen and tickadj need $(LIBM)
+
+ChangeSet@1.2773.1.29, 2012-06-13 05:35:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P280
+ TAG: NTP_4_2_7P280
+
+ ChangeLog@1.1146.1.23 +1 -0
+ NTP_4_2_7P280
+
+ ntpd/ntpd-opts.c@1.285 +4 -4
+ NTP_4_2_7P280
+
+ ntpd/ntpd-opts.h@1.285 +3 -3
+ NTP_4_2_7P280
+
+ ntpd/ntpd-opts.texi@1.275.3.2 +2 -2
+ NTP_4_2_7P280
+
+ ntpd/ntpd.1ntpdman@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpd/ntpd.1ntpdmdoc@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpd/ntpd.man.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpd/ntpd.mdoc.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc-opts.c@1.280 +4 -4
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc-opts.h@1.280 +3 -3
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc-opts.texi@1.272.3.2 +2 -2
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc.1ntpdcman@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc.html@1.108 +2 -2
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc.man.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpdc/ntpdc.mdoc.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpq/ntpq-opts.c@1.282 +4 -4
+ NTP_4_2_7P280
+
+ ntpq/ntpq-opts.h@1.282 +3 -3
+ NTP_4_2_7P280
+
+ ntpq/ntpq-opts.texi@1.274.3.2 +2 -2
+ NTP_4_2_7P280
+
+ ntpq/ntpq.1ntpqman@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpq/ntpq.1ntpqmdoc@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpq/ntpq.man.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpq/ntpq.mdoc.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.282 +4 -4
+ NTP_4_2_7P280
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.282 +3 -3
+ NTP_4_2_7P280
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.3.2 +2 -2
+ NTP_4_2_7P280
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpsnmpd/ntpsnmpd.man.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ packageinfo.sh@1.283 +1 -1
+ NTP_4_2_7P280
+
+ scripts/ntp-wait-opts.texi@1.92.3.2 +2 -14
+ NTP_4_2_7P280
+
+ scripts/ntp-wait.1ntp-waitman@1.96 +2 -2
+ NTP_4_2_7P280
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.96 +2 -2
+ NTP_4_2_7P280
+
+ scripts/ntp-wait.html@1.100 +2 -14
+ NTP_4_2_7P280
+
+ scripts/ntp-wait.man.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ scripts/ntp-wait.mdoc.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ sntp/sntp-opts.c@1.278 +4 -4
+ NTP_4_2_7P280
+
+ sntp/sntp-opts.h@1.278 +3 -3
+ NTP_4_2_7P280
+
+ sntp/sntp-opts.texi@1.270.3.2 +2 -2
+ NTP_4_2_7P280
+
+ sntp/sntp.1sntpman@1.98 +2 -2
+ NTP_4_2_7P280
+
+ sntp/sntp.1sntpmdoc@1.98 +2 -2
+ NTP_4_2_7P280
+
+ sntp/sntp.html@1.278 +2 -2
+ NTP_4_2_7P280
+
+ sntp/sntp.man.in@1.98 +2 -2
+ NTP_4_2_7P280
+
+ sntp/sntp.mdoc.in@1.98 +2 -2
+ NTP_4_2_7P280
+
+ util/ntp-keygen-opts.c@1.282 +4 -4
+ NTP_4_2_7P280
+
+ util/ntp-keygen-opts.h@1.282 +3 -3
+ NTP_4_2_7P280
+
+ util/ntp-keygen-opts.texi@1.275.3.2 +2 -2
+ NTP_4_2_7P280
+
+ util/ntp-keygen.1ntp-keygenman@1.96 +2 -2
+ NTP_4_2_7P280
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.96 +2 -2
+ NTP_4_2_7P280
+
+ util/ntp-keygen.man.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ util/ntp-keygen.mdoc.in@1.96 +2 -2
+ NTP_4_2_7P280
+
+ChangeSet@1.2773.1.28, 2012-06-11 17:22:29+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2224] Use-after-free in routing socket code after dropping root.
+
+ ChangeLog@1.1146.1.22 +2 -1
+ [Bug 2224] Use-after-free in routing socket code after dropping root.
+
+ ntpd/ntp_io.c@1.368 +6 -3
+ [Bug 2224] Use-after-free in routing socket code after dropping root.
+
+ChangeSet@1.2773.1.27, 2012-06-10 06:52:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P279
+ TAG: NTP_4_2_7P279
+
+ ChangeLog@1.1146.1.21 +1 -0
+ NTP_4_2_7P279
+
+ ntpd/ntpd-opts.c@1.284 +4 -4
+ NTP_4_2_7P279
+
+ ntpd/ntpd-opts.h@1.284 +3 -3
+ NTP_4_2_7P279
+
+ ntpd/ntpd-opts.texi@1.275.3.1 +2 -2
+ NTP_4_2_7P279
+
+ ntpd/ntpd.1ntpdman@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpd/ntpd.1ntpdmdoc@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpd/ntpd.man.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpd/ntpd.mdoc.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc-opts.c@1.279 +4 -4
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc-opts.h@1.279 +3 -3
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc-opts.texi@1.272.3.1 +2 -2
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc.1ntpdcman@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc.html@1.107 +2 -2
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc.man.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpdc/ntpdc.mdoc.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpq/ntpq-opts.c@1.281 +4 -4
+ NTP_4_2_7P279
+
+ ntpq/ntpq-opts.h@1.281 +3 -3
+ NTP_4_2_7P279
+
+ ntpq/ntpq-opts.texi@1.274.3.1 +2 -2
+ NTP_4_2_7P279
+
+ ntpq/ntpq.1ntpqman@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpq/ntpq.1ntpqmdoc@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpq/ntpq.man.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpq/ntpq.mdoc.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.281 +4 -4
+ NTP_4_2_7P279
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.281 +3 -3
+ NTP_4_2_7P279
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.3.1 +2 -2
+ NTP_4_2_7P279
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpsnmpd/ntpsnmpd.man.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ packageinfo.sh@1.282 +1 -1
+ NTP_4_2_7P279
+
+ scripts/ntp-wait-opts.texi@1.92.3.1 +1 -1
+ NTP_4_2_7P279
+
+ scripts/ntp-wait.1ntp-waitman@1.95 +2 -2
+ NTP_4_2_7P279
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.95 +2 -2
+ NTP_4_2_7P279
+
+ scripts/ntp-wait.html@1.99 +1 -1
+ NTP_4_2_7P279
+
+ scripts/ntp-wait.man.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ scripts/ntp-wait.mdoc.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ sntp/sntp-opts.c@1.277 +4 -4
+ NTP_4_2_7P279
+
+ sntp/sntp-opts.h@1.277 +3 -3
+ NTP_4_2_7P279
+
+ sntp/sntp-opts.texi@1.270.3.1 +2 -2
+ NTP_4_2_7P279
+
+ sntp/sntp.1sntpman@1.97 +2 -2
+ NTP_4_2_7P279
+
+ sntp/sntp.1sntpmdoc@1.97 +2 -2
+ NTP_4_2_7P279
+
+ sntp/sntp.html@1.277 +2 -2
+ NTP_4_2_7P279
+
+ sntp/sntp.man.in@1.97 +2 -2
+ NTP_4_2_7P279
+
+ sntp/sntp.mdoc.in@1.97 +2 -2
+ NTP_4_2_7P279
+
+ util/ntp-keygen-opts.c@1.281 +4 -4
+ NTP_4_2_7P279
+
+ util/ntp-keygen-opts.h@1.281 +3 -3
+ NTP_4_2_7P279
+
+ util/ntp-keygen-opts.texi@1.275.3.1 +2 -2
+ NTP_4_2_7P279
+
+ util/ntp-keygen.1ntp-keygenman@1.95 +2 -2
+ NTP_4_2_7P279
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.95 +2 -2
+ NTP_4_2_7P279
+
+ util/ntp-keygen.man.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ util/ntp-keygen.mdoc.in@1.95 +2 -2
+ NTP_4_2_7P279
+
+ChangeSet@1.2773.1.26, 2012-06-09 14:16:49+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2211] findbcastinter(): possibly undefined variable iface used.
+ [Bug 2220] Incorrect check for maximum association id in ntpq.
+
+ ChangeLog@1.1146.1.20 +3 -0
+ [Bug 2211] findbcastinter(): possibly undefined variable iface used.
+ [Bug 2220] Incorrect check for maximum association id in ntpq.
+
+ ntpd/ntp_io.c@1.367 +6 -4
+ [Bug 2211] findbcastinter(): possibly undefined variable iface used.
+
+ ntpq/ntpq.c@1.146 +9 -7
+ [Bug 2220] Incorrect check for maximum association id in ntpq.
+
+ChangeSet@1.2773.1.25, 2012-06-03 08:13:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P278
+ TAG: NTP_4_2_7P278
+
+ ChangeLog@1.1146.1.19 +1 -0
+ NTP_4_2_7P278
+
+ ntpd/ntpd-opts.c@1.283 +4 -4
+ NTP_4_2_7P278
+
+ ntpd/ntpd-opts.h@1.283 +3 -3
+ NTP_4_2_7P278
+
+ ntpd/ntpd-opts.texi@1.275.2.3 +2 -2
+ NTP_4_2_7P278
+
+ ntpd/ntpd.1ntpdman@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpd/ntpd.1ntpdmdoc@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpd/ntpd.man.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpd/ntpd.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc-opts.c@1.278 +4 -4
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc-opts.h@1.278 +3 -3
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc-opts.texi@1.272.2.3 +2 -2
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc.1ntpdcman@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc.html@1.106 +2 -2
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc.man.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpdc/ntpdc.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpq/ntpq-opts.c@1.280 +4 -4
+ NTP_4_2_7P278
+
+ ntpq/ntpq-opts.h@1.280 +3 -3
+ NTP_4_2_7P278
+
+ ntpq/ntpq-opts.texi@1.274.2.3 +2 -2
+ NTP_4_2_7P278
+
+ ntpq/ntpq.1ntpqman@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpq/ntpq.1ntpqmdoc@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpq/ntpq.man.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpq/ntpq.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.280 +4 -4
+ NTP_4_2_7P278
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.280 +3 -3
+ NTP_4_2_7P278
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.2.3 +2 -2
+ NTP_4_2_7P278
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpsnmpd/ntpsnmpd.man.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ packageinfo.sh@1.281 +1 -1
+ NTP_4_2_7P278
+
+ scripts/ntp-wait-opts.texi@1.92.2.3 +1 -1
+ NTP_4_2_7P278
+
+ scripts/ntp-wait.1ntp-waitman@1.94 +2 -2
+ NTP_4_2_7P278
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.94 +2 -2
+ NTP_4_2_7P278
+
+ scripts/ntp-wait.html@1.98 +1 -1
+ NTP_4_2_7P278
+
+ scripts/ntp-wait.man.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ scripts/ntp-wait.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ sntp/sntp-opts.c@1.276 +4 -4
+ NTP_4_2_7P278
+
+ sntp/sntp-opts.h@1.276 +3 -3
+ NTP_4_2_7P278
+
+ sntp/sntp-opts.texi@1.270.2.3 +2 -2
+ NTP_4_2_7P278
+
+ sntp/sntp.1sntpman@1.96 +2 -2
+ NTP_4_2_7P278
+
+ sntp/sntp.1sntpmdoc@1.96 +2 -2
+ NTP_4_2_7P278
+
+ sntp/sntp.html@1.276 +2 -2
+ NTP_4_2_7P278
+
+ sntp/sntp.man.in@1.96 +2 -2
+ NTP_4_2_7P278
+
+ sntp/sntp.mdoc.in@1.96 +2 -2
+ NTP_4_2_7P278
+
+ util/ntp-keygen-opts.c@1.280 +4 -4
+ NTP_4_2_7P278
+
+ util/ntp-keygen-opts.h@1.280 +3 -3
+ NTP_4_2_7P278
+
+ util/ntp-keygen-opts.texi@1.275.2.3 +2 -2
+ NTP_4_2_7P278
+
+ util/ntp-keygen.1ntp-keygenman@1.94 +2 -2
+ NTP_4_2_7P278
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.94 +2 -2
+ NTP_4_2_7P278
+
+ util/ntp-keygen.man.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ util/ntp-keygen.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P278
+
+ChangeSet@1.2773.1.24, 2012-06-03 07:18:47+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Update --enable-getifaddrs handling in ntp_ipv6.m4 to match bind 9.9.1 for
+ [Bug 2204] Build with --enable-getifaddrs=glibc fails
+
+ include/isc/mem.h@1.5 +3 -3
+ Clean up merge of libisc from bind-9.9.1
+ some isc_mem_* are now implemented in isc__mem_*
+
+ include/ntp_stdlib.h@1.74 +0 -19
+ Clean up merge of libisc from bind-9.9.1
+ __attribute__ conditionaliztion moved to config.h
+
+ lib/isc/assertions.c@1.7 +1 -2
+ Clean up merge of libisc from bind-9.9.1
+ Follow libisc __attribute__((__noreturn__)) convention now there is one.
+
+ lib/isc/include/isc/assertions.h@1.7 +1 -21
+ Clean up merge of libisc from bind-9.9.1
+ __attribute__ conditionaliztion moved to config.h
+
+ lib/isc/task.c@1.7 +0 -2
+ Automerge was successful where I might wish it had not been.
+
+ lib/isc/unix/interfaceiter.c@1.25 +1 -30
+ Remove NTP local addition to Linux fallback IPv6 address enumeration code
+ which broke --enable-getifaddrs on Linux, which is now default there with
+ coincident ntp_ipv6.m4 change.
+
+ libntp/Makefile.am@1.71 +2 -0
+ Clean up merge of libisc from bind-9.9.1
+ task.c depends on global provided by backtrace.c
+
+ libntp/msyslog.c@1.49 +1 -17
+ Remove broken strerror_r workaround code with the real problem fixed,
+ which is ensuring _GNU_SOURCE is defined before the first system
+ header is included.
+
+ ports/winnt/include/config.h@1.103 +2 -1
+ Clean up merge of libisc from bind-9.9.1
+ __attribute__ conditionaliztion moved to config.h
+
+ ports/winnt/vs2005/libntp.vcproj@1.23 +8 -0
+ Clean up merge of libisc from bind-9.9.1
+ task.c depends on global provided by backtrace.c
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.46 +10 -2
+ Clean up merge of libisc from bind-9.9.1
+ task.c depends on global provided by backtrace.c
+
+ sntp/m4/ntp_compiler.m4@1.4 +29 -0
+ Clean up merge of libisc from bind-9.9.1
+ __attribute__ conditionaliztion moved to config.h
+
+ sntp/m4/ntp_ipv6.m4@1.6 +6 -39
+ Update --enable-getifaddrs handling to match bind 9.9.1 configure.in
+
+ sntp/m4/ntp_libntp.m4@1.17 +10 -4
+ ensure _GNU_SOURCE is defined before any system headers are included.
+
+ChangeSet@1.2773.1.22, 2012-06-02 12:51:48+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Correct incompatible pointer type assignment warning refclock_tsyncpci.c:341
+
+ ntpd/refclock_tsyncpci.c@1.6 +1 -1
+ Correct incompatible pointer type assignment warning refclock_tsyncpci.c:341
+
+ChangeSet@1.2773.1.21, 2012-06-02 12:44:37+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2191] dcfd -Y y2kcheck on CentOS 6.2 x86_64 breaks make check.
+
+ ChangeLog@1.1146.1.18 +1 -0
+ [Bug 2191] dcfd -Y y2kcheck on CentOS 6.2 x86_64 breaks make check.
+
+ parseutil/dcfd.c@1.25 +0 -37
+ [Bug 2191] dcfd -Y y2kcheck on CentOS 6.2 x86_64 breaks make check.
+ Patch supplied by Frank Kardel.
+
+ChangeSet@1.2773.1.20, 2012-06-02 00:02:32+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ChangeLog@1.1146.1.17 +1 -0
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/ntp_io.c@1.366 +1 -1
+ DPRINTF lacked \n
+
+ ntpd/refclock_as2201.c@1.16 +0 -4
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_fg.c@1.15 +0 -3
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_heath.c@1.18 +0 -4
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_hopfser.c@1.17 +0 -1
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_jjy.c@1.25 +0 -1
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_neoclock4x.c@1.22 +0 -1
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_pst.c@1.13 +0 -4
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_tpro.c@1.14 +0 -4
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_tsyncpci.c@1.5 +0 -8
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_tt560.c@1.4 +0 -4
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ ntpd/refclock_ulink.c@1.18 +0 -4
+ [Bug 2178] refclock_tsyncpci.c reach register fails to shift.
+
+ChangeSet@1.2004.2.2, 2012-06-01 18:17:30+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ unmodified bind-9.9.1
+
+ lib/isc/Atffile@1.1 +5 -0
+ bind-9.9.1
+
+ lib/isc/Atffile@1.0 +0 -0
+
+ lib/isc/alpha/include/isc/atomic.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/api@1.2 +6 -1
+ bind-9.9.1
+
+ lib/isc/app_api.c@1.1 +136 -0
+ bind-9.9.1
+
+ lib/isc/app_api.c@1.0 +0 -0
+
+ lib/isc/assertions.c@1.4.1.1 +53 -11
+ bind-9.9.1
+
+ lib/isc/backtrace-emptytbl.c@1.1 +34 -0
+ bind-9.9.1
+
+ lib/isc/backtrace-emptytbl.c@1.0 +0 -0
+
+ lib/isc/backtrace.c@1.1 +285 -0
+ bind-9.9.1
+
+ lib/isc/backtrace.c@1.0 +0 -0
+
+ lib/isc/base32.c@1.2 +3 -1
+ bind-9.9.1
+
+ lib/isc/base64.c@1.2 +5 -3
+ bind-9.9.1
+
+ lib/isc/entropy.c@1.2 +7 -4
+ bind-9.9.1
+
+ lib/isc/hash.c@1.2 +17 -3
+ bind-9.9.1
+
+ lib/isc/heap.c@1.2 +11 -8
+ bind-9.9.1
+
+ lib/isc/hmacmd5.c@1.2 +33 -2
+ bind-9.9.1
+
+ lib/isc/hmacsha.c@1.2 +220 -64
+ bind-9.9.1
+
+ lib/isc/httpd.c@1.2 +58 -17
+ bind-9.9.1
+
+ lib/isc/ia64/include/isc/atomic.h@1.2 +4 -4
+ bind-9.9.1
+
+ lib/isc/include/isc/app.h@1.5 +168 -5
+ bind-9.9.1
+
+ lib/isc/include/isc/assertions.h@1.4.1.1 +5 -3
+ bind-9.9.1
+
+ lib/isc/include/isc/backtrace.h@1.1 +131 -0
+ bind-9.9.1
+
+ lib/isc/include/isc/backtrace.h@1.0 +0 -0
+
+ lib/isc/include/isc/bind9.h@1.1 +30 -0
+ bind-9.9.1
+
+ lib/isc/include/isc/bind9.h@1.0 +0 -0
+
+ lib/isc/include/isc/buffer.h@1.5 +2 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/entropy.h@1.2 +7 -7
+ bind-9.9.1
+
+ lib/isc/include/isc/error.h@1.5 +5 -4
+ bind-9.9.1
+
+ lib/isc/include/isc/file.h@1.4.1.1 +50 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/fsaccess.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/hash.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/heap.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/hmacmd5.h@1.2 +11 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/hmacsha.h@1.2 +15 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/lib.h@1.5 +11 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/list.h@1.5 +15 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/log.h@1.4 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/md5.h@1.3 +12 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/mem.h@1.6 +148 -27
+ bind-9.9.1
+
+ lib/isc/include/isc/msgs.h@1.5.1.1 +3 -3
+ bind-9.9.1
+
+ lib/isc/include/isc/namespace.h@1.1 +171 -0
+ bind-9.9.1
+
+ lib/isc/include/isc/namespace.h@1.0 +0 -0
+
+ lib/isc/include/isc/netaddr.h@1.7 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/netscope.h@1.4 +3 -3
+ bind-9.9.1
+
+ lib/isc/include/isc/platform.h.in@1.2 +30 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/portset.h@1.2 +2 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/queue.h@1.1 +100 -0
+ bind-9.9.1
+
+ lib/isc/include/isc/queue.h@1.0 +0 -0
+
+ lib/isc/include/isc/radix.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/random.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/ratelimiter.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/refcount.h@1.2 +6 -6
+ bind-9.9.1
+
+ lib/isc/include/isc/result.h@1.6 +5 -3
+ bind-9.9.1
+
+ lib/isc/include/isc/resultclass.h@1.2 +3 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/serial.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/sha1.h@1.2 +11 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/sha2.h@1.2 +18 -5
+ bind-9.9.1
+
+ lib/isc/include/isc/sockaddr.h@1.6 +1 -1
+ bind-9.9.1
+
+ lib/isc/include/isc/socket.h@1.2 +163 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/stats.h@1.2 +2 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/symtab.h@1.2 +10 -2
+ bind-9.9.1
+
+ lib/isc/include/isc/task.h@1.2 +176 -4
+ bind-9.9.1
+
+ lib/isc/include/isc/taskpool.h@1.2 +58 -6
+ bind-9.9.1
+
+ lib/isc/include/isc/timer.h@1.2 +90 -3
+ bind-9.9.1
+
+ lib/isc/include/isc/types.h@1.5 +8 -3
+ bind-9.9.1
+
+ lib/isc/include/isc/util.h@1.4.1.1 +7 -2
+ bind-9.9.1
+
+ lib/isc/inet_aton.c@1.5 +2 -2
+ bind-9.9.1
+
+ lib/isc/inet_ntop.c@1.7.1.1 +6 -5
+ bind-9.9.1
+
+ lib/isc/iterated_hash.c@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/lib.c@1.5 +29 -5
+ bind-9.9.1
+
+ lib/isc/log.c@1.3.1.1 +5 -4
+ bind-9.9.1
+
+ lib/isc/md5.c@1.3 +28 -2
+ bind-9.9.1
+
+ lib/isc/mem.c@1.6 +444 -172
+ bind-9.9.1
+
+ lib/isc/mem_api.c@1.1 +303 -0
+ bind-9.9.1
+
+ lib/isc/mem_api.c@1.0 +0 -0
+
+ lib/isc/mutexblock.c@1.2 +4 -5
+ bind-9.9.1
+
+ lib/isc/netaddr.c@1.6.1.1 +20 -22
+ bind-9.9.1
+
+ lib/isc/powerpc/include/isc/atomic.h@1.2 +54 -17
+ bind-9.9.1
+
+ lib/isc/print.c@1.2 +3 -3
+ bind-9.9.1
+
+ lib/isc/pthreads/mutex.c@1.1.1.1 +13 -10
+ bind-9.9.1
+
+ lib/isc/radix.c@1.2 +3 -3
+ bind-9.9.1
+
+ lib/isc/random.c@1.2 +19 -10
+ bind-9.9.1
+
+ lib/isc/result.c@1.1.1.1 +3 -2
+ bind-9.9.1
+
+ lib/isc/rwlock.c@1.2 +3 -2
+ bind-9.9.1
+
+ lib/isc/sha1.c@1.2 +41 -2
+ bind-9.9.1
+
+ lib/isc/sha2.c@1.2 +335 -120
+ bind-9.9.1
+
+ lib/isc/sockaddr.c@1.8.1.1 +7 -4
+ bind-9.9.1
+
+ lib/isc/socket_api.c@1.1 +231 -0
+ bind-9.9.1
+
+ lib/isc/socket_api.c@1.0 +0 -0
+
+ lib/isc/stats.c@1.2 +2 -2
+ bind-9.9.1
+
+ lib/isc/string.c@1.2 +6 -5
+ bind-9.9.1
+
+ lib/isc/symtab.c@1.2 +51 -2
+ bind-9.9.1
+
+ lib/isc/task.c@1.1.1.1 +607 -178
+ bind-9.9.1
+
+ lib/isc/task_api.c@1.1 +244 -0
+ bind-9.9.1
+
+ lib/isc/task_api.c@1.0 +0 -0
+
+ lib/isc/task_p.h@1.2 +12 -4
+ bind-9.9.1
+
+ lib/isc/taskpool.c@1.2 +103 -14
+ bind-9.9.1
+
+ lib/isc/tests/Atffile@1.1 +5 -0
+ bind-9.9.1
+
+ lib/isc/tests/Atffile@1.0 +0 -0
+
+ lib/isc/tests/hash_test.c@1.1 +1805 -0
+ bind-9.9.1
+
+ lib/isc/tests/hash_test.c@1.0 +0 -0
+
+ lib/isc/tests/isctest.c@1.1 +178 -0
+ bind-9.9.1
+
+ lib/isc/tests/isctest.c@1.0 +0 -0
+
+ lib/isc/tests/isctest.h@1.1 +57 -0
+ bind-9.9.1
+
+ lib/isc/tests/isctest.h@1.0 +0 -0
+
+ lib/isc/tests/queue_test.c@1.1 +144 -0
+ bind-9.9.1
+
+ lib/isc/tests/queue_test.c@1.0 +0 -0
+
+ lib/isc/tests/socket_test.c@1.1 +255 -0
+ bind-9.9.1
+
+ lib/isc/tests/socket_test.c@1.0 +0 -0
+
+ lib/isc/tests/symtab_test.c@1.1 +147 -0
+ bind-9.9.1
+
+ lib/isc/tests/symtab_test.c@1.0 +0 -0
+
+ lib/isc/tests/task_test.c@1.1 +416 -0
+ bind-9.9.1
+
+ lib/isc/tests/task_test.c@1.0 +0 -0
+
+ lib/isc/tests/taskpool_test.c@1.1 +211 -0
+ bind-9.9.1
+
+ lib/isc/tests/taskpool_test.c@1.0 +0 -0
+
+ lib/isc/timer.c@1.2 +246 -107
+ bind-9.9.1
+
+ lib/isc/timer_api.c@1.1 +144 -0
+ bind-9.9.1
+
+ lib/isc/timer_api.c@1.0 +0 -0
+
+ lib/isc/timer_p.h@1.2 +4 -4
+ bind-9.9.1
+
+ lib/isc/unix/app.c@1.2 +399 -137
+ bind-9.9.1
+
+ lib/isc/unix/dir.c@1.1.1.1 +3 -3
+ bind-9.9.1
+
+ lib/isc/unix/entropy.c@1.2 +2 -2
+ bind-9.9.1
+
+ lib/isc/unix/errno2result.c@1.2 +5 -6
+ bind-9.9.1
+
+ lib/isc/unix/errno2result.h@1.2 +5 -3
+ bind-9.9.1
+
+ lib/isc/unix/file.c@1.1.1.1 +102 -5
+ bind-9.9.1
+
+ lib/isc/unix/ifiter_getifaddrs.c@1.7.1.1 +3 -3
+ bind-9.9.1
+
+ lib/isc/unix/ifiter_ioctl.c@1.27.1.1 +1 -1
+ bind-9.9.1
+
+ lib/isc/unix/include/isc/net.h@1.10.1.1 +2 -2
+ bind-9.9.1
+
+ lib/isc/unix/include/isc/offset.h@1.5 +2 -2
+ bind-9.9.1
+
+ lib/isc/unix/include/isc/stdtime.h@1.2 +6 -2
+ bind-9.9.1
+
+ lib/isc/unix/include/isc/strerror.h@1.5 +2 -2
+ bind-9.9.1
+
+ lib/isc/unix/include/isc/time.h@1.4 +1 -1
+ bind-9.9.1
+
+ lib/isc/unix/interfaceiter.c@1.17.1.1 +2 -2
+ bind-9.9.1
+
+ lib/isc/unix/net.c@1.12.1.1 +2 -2
+ bind-9.9.1
+
+ lib/isc/unix/resource.c@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/unix/socket.c@1.2 +851 -390
+ bind-9.9.1
+
+ lib/isc/unix/socket_p.h@1.2 +5 -4
+ bind-9.9.1
+
+ lib/isc/unix/stdio.c@1.2 +15 -3
+ bind-9.9.1
+
+ lib/isc/unix/strerror.c@1.5.1.1 +1 -1
+ bind-9.9.1
+
+ lib/isc/unix/time.c@1.2 +6 -24
+ bind-9.9.1
+
+ lib/isc/win32/app.c@1.2 +11 -11
+ bind-9.9.1
+
+ lib/isc/win32/dir.c@1.2 +3 -3
+ bind-9.9.1
+
+ lib/isc/win32/entropy.c@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/win32/file.c@1.2 +126 -14
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/ipv6.h@1.8.1.1 +6 -6
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/mutex.h@1.5 +1 -1
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/net.h@1.8.1.1 +2 -2
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/ntpaths.h@1.2 +5 -4
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/platform.h@1.5.1.1 +7 -1
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/stat.h@1.3.1.1 +16 -3
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/stdtime.h@1.2 +6 -2
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/thread.h@1.1.1.1 +7 -7
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/time.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/win32/include/isc/win32os.h@1.5 +3 -3
+ bind-9.9.1
+
+ lib/isc/win32/interfaceiter.c@1.10.2.1 +1 -1
+ bind-9.9.1
+
+ lib/isc/win32/libgen.h@1.1 +25 -0
+ bind-9.9.1
+
+ lib/isc/win32/libgen.h@1.0 +0 -0
+
+ lib/isc/win32/libisc.def@1.2 +149 -117
+ bind-9.9.1
+
+ lib/isc/win32/libisc.dsp@1.2 +22 -4
+ bind-9.9.1
+
+ lib/isc/win32/libisc.mak@1.2 +53 -4
+ bind-9.9.1
+
+ lib/isc/win32/net.c@1.11.1.1 +7 -5
+ bind-9.9.1
+
+ lib/isc/win32/netdb.h@1.2 +1 -1
+ bind-9.9.1
+
+ lib/isc/win32/ntgroups.c@1.2 +23 -23
+ bind-9.9.1
+
+ lib/isc/win32/ntpaths.c@1.2 +11 -4
+ bind-9.9.1
+
+ lib/isc/win32/socket.c@1.2 +388 -95
+ bind-9.9.1
+
+ lib/isc/win32/time.c@1.2 +44 -19
+ bind-9.9.1
+
+ lib/isc/win32/unistd.h@1.2 +9 -2
+ bind-9.9.1
+
+ChangeSet@1.2773.1.19, 2012-05-25 05:07:31+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P277
+ TAG: NTP_4_2_7P277
+
+ ChangeLog@1.1146.1.16 +1 -0
+ NTP_4_2_7P277
+
+ ntpd/ntpd-opts.c@1.282 +4 -4
+ NTP_4_2_7P277
+
+ ntpd/ntpd-opts.h@1.282 +3 -3
+ NTP_4_2_7P277
+
+ ntpd/ntpd-opts.texi@1.275.2.2 +2 -2
+ NTP_4_2_7P277
+
+ ntpd/ntpd.1ntpdman@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpd/ntpd.1ntpdmdoc@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpd/ntpd.man.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpd/ntpd.mdoc.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc-opts.c@1.277 +4 -4
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc-opts.h@1.277 +3 -3
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc-opts.texi@1.272.2.2 +2 -2
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc.1ntpdcman@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc.html@1.105 +2 -2
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc.man.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpdc/ntpdc.mdoc.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpq/ntpq-opts.c@1.279 +4 -4
+ NTP_4_2_7P277
+
+ ntpq/ntpq-opts.h@1.279 +3 -3
+ NTP_4_2_7P277
+
+ ntpq/ntpq-opts.texi@1.274.2.2 +2 -2
+ NTP_4_2_7P277
+
+ ntpq/ntpq.1ntpqman@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpq/ntpq.1ntpqmdoc@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpq/ntpq.man.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpq/ntpq.mdoc.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.279 +4 -4
+ NTP_4_2_7P277
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.279 +3 -3
+ NTP_4_2_7P277
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.2.2 +2 -2
+ NTP_4_2_7P277
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpsnmpd/ntpsnmpd.man.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ packageinfo.sh@1.280 +1 -1
+ NTP_4_2_7P277
+
+ scripts/ntp-wait-opts.texi@1.92.2.2 +1 -1
+ NTP_4_2_7P277
+
+ scripts/ntp-wait.1ntp-waitman@1.93 +2 -2
+ NTP_4_2_7P277
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.93 +2 -2
+ NTP_4_2_7P277
+
+ scripts/ntp-wait.html@1.97 +1 -1
+ NTP_4_2_7P277
+
+ scripts/ntp-wait.man.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ scripts/ntp-wait.mdoc.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ sntp/sntp-opts.c@1.275 +4 -4
+ NTP_4_2_7P277
+
+ sntp/sntp-opts.h@1.275 +3 -3
+ NTP_4_2_7P277
+
+ sntp/sntp-opts.texi@1.270.2.2 +2 -2
+ NTP_4_2_7P277
+
+ sntp/sntp.1sntpman@1.95 +2 -2
+ NTP_4_2_7P277
+
+ sntp/sntp.1sntpmdoc@1.95 +2 -2
+ NTP_4_2_7P277
+
+ sntp/sntp.html@1.275 +2 -2
+ NTP_4_2_7P277
+
+ sntp/sntp.man.in@1.95 +2 -2
+ NTP_4_2_7P277
+
+ sntp/sntp.mdoc.in@1.95 +2 -2
+ NTP_4_2_7P277
+
+ util/ntp-keygen-opts.c@1.279 +4 -4
+ NTP_4_2_7P277
+
+ util/ntp-keygen-opts.h@1.279 +3 -3
+ NTP_4_2_7P277
+
+ util/ntp-keygen-opts.texi@1.275.2.2 +2 -2
+ NTP_4_2_7P277
+
+ util/ntp-keygen.1ntp-keygenman@1.93 +2 -2
+ NTP_4_2_7P277
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.93 +2 -2
+ NTP_4_2_7P277
+
+ util/ntp-keygen.man.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ util/ntp-keygen.mdoc.in@1.93 +2 -2
+ NTP_4_2_7P277
+
+ChangeSet@1.2773.1.18, 2012-05-25 00:36:37+02:00, karlsson@luft.lund.zozs.se
+ [Bug 2193] Building timestruct tests with Clang 3.1 fails.
+
+ ChangeLog@1.1146.1.15 +1 -0
+ [Bug 2193] Building timestruct tests with Clang 3.1 fails.
+
+ tests/libntp/timestructs.cpp@1.4 +2 -2
+ [Bug 2193] Building timestruct tests with Clang 3.1 fails.
+
+ tests/libntp/timestructs.h@1.4 +2 -2
+ [Bug 2193] Building timestruct tests with Clang 3.1 fails.
+
+ChangeSet@1.2773.1.17, 2012-05-15 06:32:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P276
+ TAG: NTP_4_2_7P276
+
+ ChangeLog@1.1146.1.14 +1 -0
+ NTP_4_2_7P276
+
+ ntpd/ntpd-opts.c@1.281 +4 -4
+ NTP_4_2_7P276
+
+ ntpd/ntpd-opts.h@1.281 +3 -3
+ NTP_4_2_7P276
+
+ ntpd/ntpd-opts.texi@1.275.2.1 +2 -2
+ NTP_4_2_7P276
+
+ ntpd/ntpd.1ntpdman@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpd/ntpd.1ntpdmdoc@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpd/ntpd.man.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpd/ntpd.mdoc.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc-opts.c@1.276 +4 -4
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc-opts.h@1.276 +3 -3
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc-opts.texi@1.272.2.1 +2 -2
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc.1ntpdcman@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc.html@1.104 +2 -2
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc.man.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpdc/ntpdc.mdoc.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpq/ntpq-opts.c@1.278 +4 -4
+ NTP_4_2_7P276
+
+ ntpq/ntpq-opts.h@1.278 +3 -3
+ NTP_4_2_7P276
+
+ ntpq/ntpq-opts.texi@1.274.2.1 +2 -2
+ NTP_4_2_7P276
+
+ ntpq/ntpq.1ntpqman@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpq/ntpq.1ntpqmdoc@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpq/ntpq.man.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpq/ntpq.mdoc.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.278 +4 -4
+ NTP_4_2_7P276
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.278 +3 -3
+ NTP_4_2_7P276
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.2.1 +2 -2
+ NTP_4_2_7P276
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpsnmpd/ntpsnmpd.man.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ packageinfo.sh@1.279 +1 -1
+ NTP_4_2_7P276
+
+ scripts/ntp-wait-opts.texi@1.92.2.1 +1 -1
+ NTP_4_2_7P276
+
+ scripts/ntp-wait.1ntp-waitman@1.92 +2 -2
+ NTP_4_2_7P276
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.92 +2 -2
+ NTP_4_2_7P276
+
+ scripts/ntp-wait.html@1.96 +1 -1
+ NTP_4_2_7P276
+
+ scripts/ntp-wait.man.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ scripts/ntp-wait.mdoc.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ sntp/sntp-opts.c@1.274 +4 -4
+ NTP_4_2_7P276
+
+ sntp/sntp-opts.h@1.274 +3 -3
+ NTP_4_2_7P276
+
+ sntp/sntp-opts.texi@1.270.2.1 +2 -2
+ NTP_4_2_7P276
+
+ sntp/sntp.1sntpman@1.94 +2 -2
+ NTP_4_2_7P276
+
+ sntp/sntp.1sntpmdoc@1.94 +2 -2
+ NTP_4_2_7P276
+
+ sntp/sntp.html@1.274 +2 -2
+ NTP_4_2_7P276
+
+ sntp/sntp.man.in@1.94 +2 -2
+ NTP_4_2_7P276
+
+ sntp/sntp.mdoc.in@1.94 +2 -2
+ NTP_4_2_7P276
+
+ util/ntp-keygen-opts.c@1.278 +4 -4
+ NTP_4_2_7P276
+
+ util/ntp-keygen-opts.h@1.278 +3 -3
+ NTP_4_2_7P276
+
+ util/ntp-keygen-opts.texi@1.275.2.1 +2 -2
+ NTP_4_2_7P276
+
+ util/ntp-keygen.1ntp-keygenman@1.92 +2 -2
+ NTP_4_2_7P276
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.92 +2 -2
+ NTP_4_2_7P276
+
+ util/ntp-keygen.man.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ util/ntp-keygen.mdoc.in@1.92 +2 -2
+ NTP_4_2_7P276
+
+ChangeSet@1.2773.1.16, 2012-05-15 02:16:33-04:00, stenn@deacon.udel.edu
+ [Bug 2179] Remove sntp/header.h
+
+ BitKeeper/deleted/28/header.h~bd6b45785988925a@1.8 +0 -0
+ Delete: sntp/header.h
+
+ ChangeLog@1.1146.1.13 +1 -0
+ [Bug 2179] Remove sntp/header.h
+
+ sntp/Makefile.am@1.71.1.1 +0 -1
+ [Bug 2179] Remove sntp/header.h
+
+ChangeSet@1.2778, 2012-05-08 05:47:09+00:00, stenn@psp-fb1.ntp.org
+ autogen upgrade
+
+ ntpd/invoke-ntpd.texi@1.278 +2 -2
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.c@1.19 +643 -472
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.h@1.19 +57 -31
+ autogen upgrade
+
+ ntpdc/invoke-ntpdc.texi@1.275 +2 -2
+ autogen upgrade
+
+ ntpq/invoke-ntpq.texi@1.277 +2 -2
+ autogen upgrade
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.277 +3 -25
+ autogen upgrade
+
+ scripts/invoke-ntp-wait.texi@1.95 +1 -1
+ autogen upgrade
+
+ sntp/invoke-sntp.texi@1.273 +8 -8
+ autogen upgrade
+
+ util/invoke-ntp-keygen.texi@1.278 +2 -2
+ autogen upgrade
+
+ChangeSet@1.2773.1.15, 2012-04-28 06:38:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P275
+ TAG: NTP_4_2_7P275
+
+ ChangeLog@1.1146.1.12 +1 -0
+ NTP_4_2_7P275
+
+ ntpd/ntpd-opts.c@1.280 +4 -4
+ NTP_4_2_7P275
+
+ ntpd/ntpd-opts.h@1.280 +3 -3
+ NTP_4_2_7P275
+
+ ntpd/ntpd-opts.texi@1.275.1.3 +2 -2
+ NTP_4_2_7P275
+
+ ntpd/ntpd.1ntpdman@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpd/ntpd.1ntpdmdoc@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpd/ntpd.man.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpd/ntpd.mdoc.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc-opts.c@1.275 +4 -4
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc-opts.h@1.275 +3 -3
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc-opts.texi@1.272.1.3 +2 -2
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc.1ntpdcman@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc.html@1.103 +2 -2
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc.man.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpdc/ntpdc.mdoc.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpq/ntpq-opts.c@1.277 +4 -4
+ NTP_4_2_7P275
+
+ ntpq/ntpq-opts.h@1.277 +3 -3
+ NTP_4_2_7P275
+
+ ntpq/ntpq-opts.texi@1.274.1.3 +2 -2
+ NTP_4_2_7P275
+
+ ntpq/ntpq.1ntpqman@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpq/ntpq.1ntpqmdoc@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpq/ntpq.man.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpq/ntpq.mdoc.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.277 +4 -4
+ NTP_4_2_7P275
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.277 +3 -3
+ NTP_4_2_7P275
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.1.3 +2 -2
+ NTP_4_2_7P275
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpsnmpd/ntpsnmpd.man.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ packageinfo.sh@1.278 +1 -1
+ NTP_4_2_7P275
+
+ scripts/ntp-wait-opts.texi@1.92.1.3 +1 -1
+ NTP_4_2_7P275
+
+ scripts/ntp-wait.1ntp-waitman@1.91 +2 -2
+ NTP_4_2_7P275
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.91 +2 -2
+ NTP_4_2_7P275
+
+ scripts/ntp-wait.html@1.95 +1 -1
+ NTP_4_2_7P275
+
+ scripts/ntp-wait.man.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ scripts/ntp-wait.mdoc.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ sntp/sntp-opts.c@1.273 +4 -4
+ NTP_4_2_7P275
+
+ sntp/sntp-opts.h@1.273 +3 -3
+ NTP_4_2_7P275
+
+ sntp/sntp-opts.texi@1.270.1.3 +2 -2
+ NTP_4_2_7P275
+
+ sntp/sntp.1sntpman@1.93 +2 -2
+ NTP_4_2_7P275
+
+ sntp/sntp.1sntpmdoc@1.93 +2 -2
+ NTP_4_2_7P275
+
+ sntp/sntp.html@1.273 +2 -2
+ NTP_4_2_7P275
+
+ sntp/sntp.man.in@1.93 +2 -2
+ NTP_4_2_7P275
+
+ sntp/sntp.mdoc.in@1.93 +2 -2
+ NTP_4_2_7P275
+
+ util/ntp-keygen-opts.c@1.277 +4 -4
+ NTP_4_2_7P275
+
+ util/ntp-keygen-opts.h@1.277 +3 -3
+ NTP_4_2_7P275
+
+ util/ntp-keygen-opts.texi@1.275.1.3 +2 -2
+ NTP_4_2_7P275
+
+ util/ntp-keygen.1ntp-keygenman@1.91 +2 -2
+ NTP_4_2_7P275
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.91 +2 -2
+ NTP_4_2_7P275
+
+ util/ntp-keygen.man.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ util/ntp-keygen.mdoc.in@1.91 +2 -2
+ NTP_4_2_7P275
+
+ChangeSet@1.2773.1.14, 2012-04-27 15:02:14-07:00, harlan@hms-mbp.local
+ [Bug 1744] Remove obsolete ntpdate/ntptime* items
+
+ BitKeeper/deleted/2e/ntptime_config.c~491a3955@1.7 +0 -0
+ Delete: ntpdate/ntptime_config.c
+
+ BitKeeper/deleted/92/ntptimeset.c~491a3955@1.16 +0 -0
+ Delete: ntpdate/ntptimeset.c
+
+ ChangeLog@1.1146.1.11 +1 -0
+ [Bug 1744] Remove obsolete ntpdate/ntptime* items
+
+ ntpdate/Makefile.am@1.36 +1 -3
+ [Bug 1744] Remove obsolete ntpdate/ntptime* items
+
+ChangeSet@1.2773.1.13, 2012-04-25 04:41:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P274
+ TAG: NTP_4_2_7P274
+
+ ChangeLog@1.1146.1.10 +1 -0
+ NTP_4_2_7P274
+
+ ntpd/ntpd-opts.c@1.279 +4 -4
+ NTP_4_2_7P274
+
+ ntpd/ntpd-opts.h@1.279 +3 -3
+ NTP_4_2_7P274
+
+ ntpd/ntpd-opts.texi@1.275.1.2 +2 -2
+ NTP_4_2_7P274
+
+ ntpd/ntpd.1ntpdman@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpd/ntpd.1ntpdmdoc@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpd/ntpd.man.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpd/ntpd.mdoc.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc-opts.c@1.274 +4 -4
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc-opts.h@1.274 +3 -3
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc-opts.texi@1.272.1.2 +2 -2
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc.1ntpdcman@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc.html@1.102 +2 -2
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc.man.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpdc/ntpdc.mdoc.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpq/ntpq-opts.c@1.276 +4 -4
+ NTP_4_2_7P274
+
+ ntpq/ntpq-opts.h@1.276 +3 -3
+ NTP_4_2_7P274
+
+ ntpq/ntpq-opts.texi@1.274.1.2 +2 -2
+ NTP_4_2_7P274
+
+ ntpq/ntpq.1ntpqman@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpq/ntpq.1ntpqmdoc@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpq/ntpq.man.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpq/ntpq.mdoc.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.276 +4 -4
+ NTP_4_2_7P274
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.276 +3 -3
+ NTP_4_2_7P274
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.1.2 +2 -2
+ NTP_4_2_7P274
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpsnmpd/ntpsnmpd.man.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ packageinfo.sh@1.277 +1 -1
+ NTP_4_2_7P274
+
+ scripts/ntp-wait-opts.texi@1.92.1.2 +1 -1
+ NTP_4_2_7P274
+
+ scripts/ntp-wait.1ntp-waitman@1.90 +2 -2
+ NTP_4_2_7P274
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.90 +2 -2
+ NTP_4_2_7P274
+
+ scripts/ntp-wait.html@1.94 +1 -1
+ NTP_4_2_7P274
+
+ scripts/ntp-wait.man.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ scripts/ntp-wait.mdoc.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ sntp/sntp-opts.c@1.272 +4 -4
+ NTP_4_2_7P274
+
+ sntp/sntp-opts.h@1.272 +3 -3
+ NTP_4_2_7P274
+
+ sntp/sntp-opts.texi@1.270.1.2 +2 -2
+ NTP_4_2_7P274
+
+ sntp/sntp.1sntpman@1.92 +2 -2
+ NTP_4_2_7P274
+
+ sntp/sntp.1sntpmdoc@1.92 +2 -2
+ NTP_4_2_7P274
+
+ sntp/sntp.html@1.272 +2 -2
+ NTP_4_2_7P274
+
+ sntp/sntp.man.in@1.92 +2 -2
+ NTP_4_2_7P274
+
+ sntp/sntp.mdoc.in@1.92 +2 -2
+ NTP_4_2_7P274
+
+ util/ntp-keygen-opts.c@1.276 +4 -4
+ NTP_4_2_7P274
+
+ util/ntp-keygen-opts.h@1.276 +3 -3
+ NTP_4_2_7P274
+
+ util/ntp-keygen-opts.texi@1.275.1.2 +2 -2
+ NTP_4_2_7P274
+
+ util/ntp-keygen.1ntp-keygenman@1.90 +2 -2
+ NTP_4_2_7P274
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.90 +2 -2
+ NTP_4_2_7P274
+
+ util/ntp-keygen.man.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ util/ntp-keygen.mdoc.in@1.90 +2 -2
+ NTP_4_2_7P274
+
+ChangeSet@1.2773.1.12, 2012-04-25 03:53:28+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus.
+
+ ChangeLog@1.1146.1.9 +1 -0
+ [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus.
+
+ ntpd/ntp_proto.c@1.341 +3 -6
+ [Bug 2174] ntpd rejects source UDP ports less than 123 as bogus.
+
+ChangeSet@1.2773.1.11, 2012-04-25 03:18:53+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Remove redundant manual systime_s.o: systime.c dependency from libntp's
+ Makefile.am.
+
+ libntp/Makefile.am@1.70 +0 -7
+ Remove redundant manual dependency of systime_s.o upon systime.c. The
+ same dependency is automatically generated in .deps/systime_s.Po which
+ Makefile includes. The manual dependency was an attempt to resolve a
+ problem caused by the release snapshot Makefile erroneously removing
+ all .deps directories from the build tree before running configure.
+ .dep/*.Po must not be removed unless *.o are removed at the same time,
+ or else automatic dependencies are missing.
+
+ChangeSet@1.2773.1.10, 2012-04-19 05:43:39+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P273
+ TAG: NTP_4_2_7P273
+
+ ChangeLog@1.1146.1.8 +1 -0
+ NTP_4_2_7P273
+
+ libntp/Makefile.am@1.69 +1 -1
+ Use $(OBJEXT), not .o
+
+ libntp/Makefile.am@1.68 +1 -2
+ Fix systime_s.o dependency
+
+ ntpd/ntpd-opts.c@1.278 +4 -4
+ NTP_4_2_7P273
+
+ ntpd/ntpd-opts.h@1.278 +3 -3
+ NTP_4_2_7P273
+
+ ntpd/ntpd-opts.texi@1.275.1.1 +2 -2
+ NTP_4_2_7P273
+
+ ntpd/ntpd.1ntpdman@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpd/ntpd.1ntpdmdoc@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpd/ntpd.man.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpd/ntpd.mdoc.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc-opts.c@1.273 +4 -4
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc-opts.h@1.273 +3 -3
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc-opts.texi@1.272.1.1 +2 -2
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc.1ntpdcman@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc.html@1.101 +2 -2
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc.man.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpdc/ntpdc.mdoc.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpq/ntpq-opts.c@1.275 +4 -4
+ NTP_4_2_7P273
+
+ ntpq/ntpq-opts.h@1.275 +3 -3
+ NTP_4_2_7P273
+
+ ntpq/ntpq-opts.texi@1.274.1.1 +2 -2
+ NTP_4_2_7P273
+
+ ntpq/ntpq.1ntpqman@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpq/ntpq.1ntpqmdoc@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpq/ntpq.man.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpq/ntpq.mdoc.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.275 +4 -4
+ NTP_4_2_7P273
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.275 +3 -3
+ NTP_4_2_7P273
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274.1.1 +2 -2
+ NTP_4_2_7P273
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpsnmpd/ntpsnmpd.man.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ packageinfo.sh@1.276 +1 -1
+ NTP_4_2_7P273
+
+ scripts/ntp-wait-opts.texi@1.92.1.1 +1 -1
+ NTP_4_2_7P273
+
+ scripts/ntp-wait.1ntp-waitman@1.89 +2 -2
+ NTP_4_2_7P273
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.89 +2 -2
+ NTP_4_2_7P273
+
+ scripts/ntp-wait.html@1.93 +1 -1
+ NTP_4_2_7P273
+
+ scripts/ntp-wait.man.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ scripts/ntp-wait.mdoc.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ sntp/sntp-opts.c@1.271 +4 -4
+ NTP_4_2_7P273
+
+ sntp/sntp-opts.h@1.271 +3 -3
+ NTP_4_2_7P273
+
+ sntp/sntp-opts.texi@1.270.1.1 +2 -2
+ NTP_4_2_7P273
+
+ sntp/sntp.1sntpman@1.91 +2 -2
+ NTP_4_2_7P273
+
+ sntp/sntp.1sntpmdoc@1.91 +2 -2
+ NTP_4_2_7P273
+
+ sntp/sntp.html@1.271 +2 -2
+ NTP_4_2_7P273
+
+ sntp/sntp.man.in@1.91 +2 -2
+ NTP_4_2_7P273
+
+ sntp/sntp.mdoc.in@1.91 +2 -2
+ NTP_4_2_7P273
+
+ util/ntp-keygen-opts.c@1.275 +4 -4
+ NTP_4_2_7P273
+
+ util/ntp-keygen-opts.h@1.275 +3 -3
+ NTP_4_2_7P273
+
+ util/ntp-keygen-opts.texi@1.275.1.1 +2 -2
+ NTP_4_2_7P273
+
+ util/ntp-keygen.1ntp-keygenman@1.89 +2 -2
+ NTP_4_2_7P273
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.89 +2 -2
+ NTP_4_2_7P273
+
+ util/ntp-keygen.man.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ util/ntp-keygen.mdoc.in@1.89 +2 -2
+ NTP_4_2_7P273
+
+ChangeSet@1.2773.1.9, 2012-04-18 19:30:28+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Correct authnumfreekeys accounting broken in 4.2.7p262.
+
+ ChangeLog@1.1146.1.7 +1 -0
+ Correct authnumfreekeys accounting broken in 4.2.7p262.
+
+ libntp/authkeys.c@1.24 +2 -2
+ Correct authnumfreekeys accounting broken in 4.2.7p262.
+
+ChangeSet@1.2773.1.8, 2012-04-18 11:46:26+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2141] handle_sigio() calls get_systime(), which must be
+ reentrant when SIGIO is used. Sanity checks relative to the prior
+ get_systime() are disabled in ntpd on systems with signaled I/O, but
+ active in sntp and ntpdate.
+
+ ChangeLog@1.1146.1.6 +4 -0
+ [Bug 2141] handle_sigio() calls get_systime(), which must be
+ reentrant when SIGIO is used. Sanity checks relative to the prior
+ get_systime() are disabled in ntpd on systems with signaled I/O, but
+ active in sntp and ntpdate.
+
+ include/iosignal.h@1.6 +5 -0
+ Add USING_SIGIO() and using_sigio.
+
+ libntp/iosignal.c@1.16 +2 -0
+ Set using_sigio when doing so.
+
+ libntp/systime.c@1.66 +51 -31
+ Disable non-reentrant checks in get_systime() when SIGIO is being used,
+ as handle_sigio() calls get_systime().
+
+ChangeSet@1.2773.1.7, 2012-04-18 05:03:10+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Remove inttoa() and uinttoa(), convert solitary use of latter
+ to simpler code.
+
+ BitKeeper/deleted/73/inttoa.cpp~827ae0ffc75432e4@1.5 +0 -0
+ Delete: tests/libntp/inttoa.cpp
+
+ BitKeeper/deleted/a5/inttoa.c~3e480692@1.5 +0 -0
+ Delete: libntp/inttoa.c
+
+ BitKeeper/deleted/ac/uinttoa.c~3e480692@1.5 +0 -0
+ Delete: libntp/uinttoa.c
+
+ BitKeeper/deleted/f0/uinttoa.cpp~d804670d7d9346f4@1.2 +0 -0
+ Delete: tests/libntp/uinttoa.cpp
+
+ include/ntp_stdlib.h@1.73 +0 -2
+ Remove inttoa() and uinttoa().
+
+ libntp/Makefile.am@1.67 +0 -2
+ Remove inttoa() and uinttoa().
+
+ ntpq/ntpq-subs.c@1.96 +2 -4
+ Convert solitary callsite of uinttoa() to simpler equivalent.
+
+ ports/winnt/vs2005/libntp.vcproj@1.22 +0 -8
+ Remove inttoa() and uinttoa().
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.45 +2 -10
+ Remove inttoa() and uinttoa().
+
+ tests/libntp/Makefile.am@1.40 +0 -2
+ Remove inttoa() and uinttoa() unit tests.
+
+ChangeSet@1.2776, 2012-04-17 01:54:04-07:00, stenn@stenn.ntp.org
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ ChangeLog@1.1149 +1 -0
+ Upgrade to autogen-5.16
+
+ ntpd/Makefile.am@1.117 +7 -7
+ Upgrade to autogen-5.16
+
+ ntpd/invoke-ntpd.menu@1.7 +0 -0
+ Rename: ntpd/ntpd-opts.menu -> ntpd/invoke-ntpd.menu
+
+ ntpd/invoke-ntpd.texi@1.274.1.2 +681 -272
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ ntpd/invoke-ntpd.texi@1.274.1.1 +0 -0
+ Rename: ntpd/ntpd-opts.texi -> ntpd/invoke-ntpd.texi
+
+ ntpdc/Makefile.am@1.72 +9 -9
+ Upgrade to autogen-5.16
+
+ ntpdc/invoke-ntpdc.menu@1.7 +0 -0
+ Rename: ntpdc/ntpdc-opts.menu -> ntpdc/invoke-ntpdc.menu
+
+ ntpdc/invoke-ntpdc.texi@1.271.1.2 +667 -84
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ ntpdc/invoke-ntpdc.texi@1.271.1.1 +0 -0
+ Rename: ntpdc/ntpdc-opts.texi -> ntpdc/invoke-ntpdc.texi
+
+ ntpdc/ntpdc.texi@1.3 +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ ntpq/Makefile.am@1.68 +7 -7
+ Upgrade to autogen-5.16
+
+ ntpq/invoke-ntpq.menu@1.7 +0 -0
+ Rename: ntpq/ntpq-opts.menu -> ntpq/invoke-ntpq.menu
+
+ ntpq/invoke-ntpq.texi@1.273.1.2 +352 -83
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ ntpq/invoke-ntpq.texi@1.273.1.1 +0 -0
+ Rename: ntpq/ntpq-opts.texi -> ntpq/invoke-ntpq.texi
+
+ ntpsnmpd/Makefile.am@1.35.1.1 +7 -7
+ Upgrade to autogen-5.16
+
+ ntpsnmpd/invoke-ntpsnmpd.menu@1.7 +0 -0
+ Rename: ntpsnmpd/ntpsnmpd-opts.menu -> ntpsnmpd/invoke-ntpsnmpd.menu
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.273.1.2 +120 -47
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.273.1.1 +0 -0
+ Rename: ntpsnmpd/ntpsnmpd-opts.texi -> ntpsnmpd/invoke-ntpsnmpd.texi
+
+ scripts/Makefile.am@1.30 +8 -8
+ Upgrade to autogen-5.16
+
+ scripts/invoke-ntp-wait.menu@1.2 +0 -0
+ Rename: scripts/ntp-wait-opts.menu -> scripts/invoke-ntp-wait.menu
+
+ scripts/invoke-ntp-wait.texi@1.91.1.2 +92 -26
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ scripts/invoke-ntp-wait.texi@1.91.1.1 +0 -0
+ Rename: scripts/ntp-wait-opts.texi -> scripts/invoke-ntp-wait.texi
+
+ scripts/ntp-wait.texi@1.2 +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/Makefile.am@1.72 +9 -9
+ Upgrade to autogen-5.16
+
+ sntp/invoke-sntp.menu@1.7 +0 -0
+ Rename: sntp/sntp-opts.menu -> sntp/invoke-sntp.menu
+
+ sntp/invoke-sntp.texi@1.269.1.2 +254 -133
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ sntp/invoke-sntp.texi@1.269.1.1 +0 -0
+ Rename: sntp/sntp-opts.texi -> sntp/invoke-sntp.texi
+
+ sntp/libopts/Makefile.am@1.13 +6 -6
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/ag-char-map.h@1.16 +305 -129
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/ao-strs.c@1.2 +1 -1
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/ao-strs.h@1.1 +251 -0
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/ao-strs.h@1.0 +0 -0
+
+ sntp/libopts/autoopts.c@1.13 +14 -5
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/autoopts.h@1.11 +8 -9
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/autoopts/options.h@1.15 +50 -29
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/autoopts/project.h@1.2 +2 -0
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/autoopts/usage-txt.h@1.15 +161 -159
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/boolean.c@1.9 +8 -6
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/check.c@1.3 +17 -15
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/compat/compat.h@1.9 +15 -4
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/compat/pathfind.c@1.7 +2 -2
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/configfile.c@1.14 +58 -50
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/cook.c@1.10 +8 -8
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/enum.c@1.3 +32 -6
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/env.c@1.3 +7 -4
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/find.c@1.3 +4 -4
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/genshell.c@1.16 +17 -16
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/genshell.h@1.16 +6 -5
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/libopts.c@1.6 +1 -2
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/load.c@1.12 +46 -47
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/m4/libopts.m4@1.19 +3 -2
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/makeshell.c@1.11 +5 -3
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/nested.c@1.9 +7 -6
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/parse-duration.c@1.7 +3 -3
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/pgusage.c@1.10 +4 -11
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/proto.h@1.16 +4 -7
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/putshell.c@1.9 +6 -4
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/reset.c@1.10 +4 -4
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/save.c@1.11 +3 -3
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/stack.c@1.9 +8 -8
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/streqvcmp.c@1.9 +3 -3
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/tokenize.c@1.7 +7 -9
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/usage.c@1.11 +30 -32
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/value-type.h@1.16 +1 -1
+ upgrade to libopts-36.4.11
+
+ sntp/libopts/xat-attribute.h@1.16 +1 -1
+ upgrade to libopts-36.4.11
+
+ sntp/sntp.texi@1.9 +1 -1
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ util/Makefile.am@1.72 +7 -7
+ Upgrade to autogen-5.16
+
+ util/invoke-ntp-keygen.menu@1.8 +0 -0
+ Rename: util/ntp-keygen-opts.menu -> util/invoke-ntp-keygen.menu
+
+ util/invoke-ntp-keygen.texi@1.274.1.2 +761 -120
+ Upgrade to autogen-5.16 and libopts-36.4.11
+
+ util/invoke-ntp-keygen.texi@1.274.1.1 +0 -0
+ Rename: util/ntp-keygen-opts.texi -> util/invoke-ntp-keygen.texi
+
+ChangeSet@1.2773.1.6, 2012-04-14 04:43:39+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P272
+ TAG: NTP_4_2_7P272
+
+ ChangeLog@1.1146.1.5 +1 -0
+ NTP_4_2_7P272
+
+ ntpd/ntpd-opts.c@1.277 +4 -4
+ NTP_4_2_7P272
+
+ ntpd/ntpd-opts.h@1.277 +3 -3
+ NTP_4_2_7P272
+
+ ntpd/ntpd-opts.texi@1.275 +2 -2
+ NTP_4_2_7P272
+
+ ntpd/ntpd.1ntpdman@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpd/ntpd.1ntpdmdoc@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpd/ntpd.man.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpd/ntpd.mdoc.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc-opts.c@1.272 +4 -4
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc-opts.h@1.272 +3 -3
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc-opts.texi@1.272 +2 -2
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc.1ntpdcman@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc.html@1.100 +2 -2
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc.man.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpdc/ntpdc.mdoc.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpq/ntpq-opts.c@1.274 +4 -4
+ NTP_4_2_7P272
+
+ ntpq/ntpq-opts.h@1.274 +3 -3
+ NTP_4_2_7P272
+
+ ntpq/ntpq-opts.texi@1.274 +2 -2
+ NTP_4_2_7P272
+
+ ntpq/ntpq.1ntpqman@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpq/ntpq.1ntpqmdoc@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpq/ntpq.man.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpq/ntpq.mdoc.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.274 +4 -4
+ NTP_4_2_7P272
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.274 +3 -3
+ NTP_4_2_7P272
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.274 +2 -2
+ NTP_4_2_7P272
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpsnmpd/ntpsnmpd.man.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ packageinfo.sh@1.275 +1 -1
+ NTP_4_2_7P272
+
+ scripts/ntp-wait-opts.texi@1.92 +1 -1
+ NTP_4_2_7P272
+
+ scripts/ntp-wait.1ntp-waitman@1.88 +2 -2
+ NTP_4_2_7P272
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.88 +2 -2
+ NTP_4_2_7P272
+
+ scripts/ntp-wait.html@1.92 +1 -1
+ NTP_4_2_7P272
+
+ scripts/ntp-wait.man.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ scripts/ntp-wait.mdoc.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ sntp/sntp-opts.c@1.270 +4 -4
+ NTP_4_2_7P272
+
+ sntp/sntp-opts.h@1.270 +3 -3
+ NTP_4_2_7P272
+
+ sntp/sntp-opts.texi@1.270 +2 -2
+ NTP_4_2_7P272
+
+ sntp/sntp.1sntpman@1.90 +2 -2
+ NTP_4_2_7P272
+
+ sntp/sntp.1sntpmdoc@1.90 +2 -2
+ NTP_4_2_7P272
+
+ sntp/sntp.html@1.270 +2 -2
+ NTP_4_2_7P272
+
+ sntp/sntp.man.in@1.90 +2 -2
+ NTP_4_2_7P272
+
+ sntp/sntp.mdoc.in@1.90 +2 -2
+ NTP_4_2_7P272
+
+ util/ntp-keygen-opts.c@1.274 +4 -4
+ NTP_4_2_7P272
+
+ util/ntp-keygen-opts.h@1.274 +3 -3
+ NTP_4_2_7P272
+
+ util/ntp-keygen-opts.texi@1.275 +2 -2
+ NTP_4_2_7P272
+
+ util/ntp-keygen.1ntp-keygenman@1.88 +2 -2
+ NTP_4_2_7P272
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.88 +2 -2
+ NTP_4_2_7P272
+
+ util/ntp-keygen.man.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ util/ntp-keygen.mdoc.in@1.88 +2 -2
+ NTP_4_2_7P272
+
+ChangeSet@1.2773.2.1, 2012-04-13 23:49:28-04:00, stenn@deacon.udel.edu
+ Change the link order for ntpsntpd
+
+ ChangeLog@1.1146.2.2 +1 -0
+ Change the link order for ntpsntpd
+
+ ChangeLog@1.1146.2.1 +1 -0
+ Remove extra nlist test
+
+ configure.ac@1.545 +1 -1
+ Remove extra nlist test
+
+ ntpsnmpd/Makefile.am@1.36 +3 -2
+ Change the link order for ntpsntpd
+
+ChangeSet@1.2773.1.4, 2012-04-13 02:02:55-07:00, harlan@hms-mbp.lan
+ LCRYPTO is gone - replace with VER_SUFFIX
+
+ ChangeLog@1.1146.1.3 +1 -0
+ LCRYPTO is gone - replace with VER_SUFFIX
+
+ scripts/mkver.in@1.14 +2 -4
+ LCRYPTO is gone - replace with VER_SUFFIX
+
+ sntp/m4/ntp_openssl.m4@1.20 +8 -0
+ LCRYPTO is gone - replace with VER_SUFFIX
+
+ sntp/m4/ntp_ver_suffix.m4@1.1 +13 -0
+ BitKeeper file /Users/harlan/src/ntp-dev/sntp/m4/ntp_ver_suffix.m4
+
+ sntp/m4/ntp_ver_suffix.m4@1.0 +0 -0
+
+ChangeSet@1.2773.1.3, 2012-04-11 08:44:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P271
+ TAG: NTP_4_2_7P271
+
+ ChangeLog@1.1146.1.2 +1 -0
+ NTP_4_2_7P271
+
+ ntpd/ntpd-opts.c@1.276 +4 -4
+ NTP_4_2_7P271
+
+ ntpd/ntpd-opts.h@1.276 +3 -3
+ NTP_4_2_7P271
+
+ ntpd/ntpd-opts.texi@1.274 +2 -2
+ NTP_4_2_7P271
+
+ ntpd/ntpd.1ntpdman@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpd/ntpd.1ntpdmdoc@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpd/ntpd.man.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpd/ntpd.mdoc.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc-opts.c@1.271 +4 -4
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc-opts.h@1.271 +3 -3
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc-opts.texi@1.271 +2 -2
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc.1ntpdcman@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc.html@1.99 +2 -2
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc.man.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpdc/ntpdc.mdoc.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpq/ntpq-opts.c@1.273 +4 -4
+ NTP_4_2_7P271
+
+ ntpq/ntpq-opts.h@1.273 +3 -3
+ NTP_4_2_7P271
+
+ ntpq/ntpq-opts.texi@1.273 +2 -2
+ NTP_4_2_7P271
+
+ ntpq/ntpq.1ntpqman@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpq/ntpq.1ntpqmdoc@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpq/ntpq.man.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpq/ntpq.mdoc.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.273 +4 -4
+ NTP_4_2_7P271
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.273 +3 -3
+ NTP_4_2_7P271
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.273 +2 -2
+ NTP_4_2_7P271
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpsnmpd/ntpsnmpd.man.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ packageinfo.sh@1.274 +1 -1
+ NTP_4_2_7P271
+
+ scripts/ntp-wait-opts.texi@1.91 +14 -2
+ NTP_4_2_7P271
+
+ scripts/ntp-wait.1ntp-waitman@1.87 +2 -2
+ NTP_4_2_7P271
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.87 +2 -2
+ NTP_4_2_7P271
+
+ scripts/ntp-wait.html@1.91 +14 -2
+ NTP_4_2_7P271
+
+ scripts/ntp-wait.man.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ scripts/ntp-wait.mdoc.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ sntp/sntp-opts.c@1.269 +4 -4
+ NTP_4_2_7P271
+
+ sntp/sntp-opts.h@1.269 +3 -3
+ NTP_4_2_7P271
+
+ sntp/sntp-opts.texi@1.269 +2 -2
+ NTP_4_2_7P271
+
+ sntp/sntp.1sntpman@1.89 +2 -2
+ NTP_4_2_7P271
+
+ sntp/sntp.1sntpmdoc@1.89 +2 -2
+ NTP_4_2_7P271
+
+ sntp/sntp.html@1.269 +2 -2
+ NTP_4_2_7P271
+
+ sntp/sntp.man.in@1.89 +2 -2
+ NTP_4_2_7P271
+
+ sntp/sntp.mdoc.in@1.89 +2 -2
+ NTP_4_2_7P271
+
+ util/ntp-keygen-opts.c@1.273 +4 -4
+ NTP_4_2_7P271
+
+ util/ntp-keygen-opts.h@1.273 +3 -3
+ NTP_4_2_7P271
+
+ util/ntp-keygen-opts.texi@1.274 +2 -2
+ NTP_4_2_7P271
+
+ util/ntp-keygen.1ntp-keygenman@1.87 +2 -2
+ NTP_4_2_7P271
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.87 +2 -2
+ NTP_4_2_7P271
+
+ util/ntp-keygen.man.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ util/ntp-keygen.mdoc.in@1.87 +2 -2
+ NTP_4_2_7P271
+
+ChangeSet@1.2773.1.2, 2012-04-09 16:19:04+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Put openssl -L flags from pkg-config in LDADD_NTP as comment indicates,
+ rather than in LDFLAGS_NTP.
+
+ sntp/m4/ntp_openssl.m4@1.19 +4 -4
+ Put openssl -L flags from pkg-config in LDADD_NTP as comment indicates,
+ rather than in LDFLAGS_NTP.
+
+ChangeSet@1.2773.1.1, 2012-04-09 05:25:13+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 1122] openssl detection via pkg-config fails when no additional
+ -Idir flags are needed.
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ ChangeLog@1.1146.1.1 +4 -0
+ [Bug 1122] openssl detection via pkg-config fails when no additional
+ -Idir flags are needed.
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+
+ ntpd/Makefile.am@1.112.1.3 +4 -2
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ ntpdate/Makefile.am@1.35 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ ntpdc/Makefile.am@1.71 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ ntpq/Makefile.am@1.67 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ ntpsnmpd/Makefile.am@1.35 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ sntp/Makefile.am@1.71 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ sntp/m4/ntp_compiler.m4@1.3 +4 -0
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ sntp/m4/ntp_openssl.m4@1.18 +185 -197
+ [Bug 1122] openssl detection via pkg-config fails when no additional
+ -Idir flags are needed.
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+
+ sntp/tests/Makefile.am@1.27 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ tests/libntp/Makefile.am@1.39 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ util/Makefile.am@1.71 +3 -1
+ Avoid overwriting user variable LDFLAGS with OpenSSL flags, instead
+ they are added to LDFLAGS_NTP.
+
+ChangeSet@1.2773, 2012-03-26 09:24:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P270
+ TAG: NTP_4_2_7P270
+
+ ChangeLog@1.1146 +1 -0
+ NTP_4_2_7P270
+
+ ntpd/ntpd-opts.c@1.275 +4 -4
+ NTP_4_2_7P270
+
+ ntpd/ntpd-opts.h@1.275 +3 -3
+ NTP_4_2_7P270
+
+ ntpd/ntpd-opts.texi@1.273 +2 -2
+ NTP_4_2_7P270
+
+ ntpd/ntpd.1ntpdman@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpd/ntpd.1ntpdmdoc@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpd/ntpd.man.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpd/ntpd.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc-opts.c@1.270 +4 -4
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc-opts.h@1.270 +3 -3
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc-opts.texi@1.270 +2 -2
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc.1ntpdcman@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc.html@1.98 +2 -2
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc.man.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpdc/ntpdc.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpq/ntpq-opts.c@1.272 +4 -4
+ NTP_4_2_7P270
+
+ ntpq/ntpq-opts.h@1.272 +3 -3
+ NTP_4_2_7P270
+
+ ntpq/ntpq-opts.texi@1.272 +2 -2
+ NTP_4_2_7P270
+
+ ntpq/ntpq.1ntpqman@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpq/ntpq.1ntpqmdoc@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpq/ntpq.man.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpq/ntpq.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.272 +4 -4
+ NTP_4_2_7P270
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.272 +3 -3
+ NTP_4_2_7P270
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.272 +2 -2
+ NTP_4_2_7P270
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpsnmpd/ntpsnmpd.man.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ packageinfo.sh@1.273 +1 -1
+ NTP_4_2_7P270
+
+ scripts/ntp-wait-opts.texi@1.90 +1 -1
+ NTP_4_2_7P270
+
+ scripts/ntp-wait.1ntp-waitman@1.86 +2 -2
+ NTP_4_2_7P270
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.86 +2 -2
+ NTP_4_2_7P270
+
+ scripts/ntp-wait.html@1.90 +1 -1
+ NTP_4_2_7P270
+
+ scripts/ntp-wait.man.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ scripts/ntp-wait.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ sntp/sntp-opts.c@1.268 +4 -4
+ NTP_4_2_7P270
+
+ sntp/sntp-opts.h@1.268 +3 -3
+ NTP_4_2_7P270
+
+ sntp/sntp-opts.texi@1.268 +2 -2
+ NTP_4_2_7P270
+
+ sntp/sntp.1sntpman@1.88 +2 -2
+ NTP_4_2_7P270
+
+ sntp/sntp.1sntpmdoc@1.88 +2 -2
+ NTP_4_2_7P270
+
+ sntp/sntp.html@1.268 +2 -2
+ NTP_4_2_7P270
+
+ sntp/sntp.man.in@1.88 +2 -2
+ NTP_4_2_7P270
+
+ sntp/sntp.mdoc.in@1.88 +2 -2
+ NTP_4_2_7P270
+
+ util/ntp-keygen-opts.c@1.272 +4 -4
+ NTP_4_2_7P270
+
+ util/ntp-keygen-opts.h@1.272 +3 -3
+ NTP_4_2_7P270
+
+ util/ntp-keygen-opts.texi@1.273 +2 -2
+ NTP_4_2_7P270
+
+ util/ntp-keygen.1ntp-keygenman@1.86 +2 -2
+ NTP_4_2_7P270
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.86 +2 -2
+ NTP_4_2_7P270
+
+ util/ntp-keygen.man.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ util/ntp-keygen.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P270
+
+ChangeSet@1.2772, 2012-03-26 05:12:44-04:00, stenn@deacon.udel.edu
+ Update driver45.html page
+
+ ChangeLog@1.1145 +1 -0
+ Update driver45.html page
+
+ html/drivers/driver45.html@1.3 +1 -1
+ Update driver45.html page
+
+ChangeSet@1.2771, 2012-03-25 05:07:53+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P269
+ TAG: NTP_4_2_7P269
+
+ ChangeLog@1.1144 +1 -0
+ NTP_4_2_7P269
+
+ ntpd/ntpd-opts.c@1.274 +4 -4
+ NTP_4_2_7P269
+
+ ntpd/ntpd-opts.h@1.274 +3 -3
+ NTP_4_2_7P269
+
+ ntpd/ntpd-opts.texi@1.272 +2 -2
+ NTP_4_2_7P269
+
+ ntpd/ntpd.1ntpdman@1.85 +8 -548
+ NTP_4_2_7P269
+
+ ntpd/ntpd.1ntpdmdoc@1.85 +8 -547
+ NTP_4_2_7P269
+
+ ntpd/ntpd.man.in@1.85 +8 -548
+ NTP_4_2_7P269
+
+ ntpd/ntpd.mdoc.in@1.85 +8 -547
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc-opts.c@1.269 +4 -4
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc-opts.h@1.269 +3 -3
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc-opts.texi@1.269 +2 -2
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc.1ntpdcman@1.85 +7 -704
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.85 +7 -659
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc.html@1.97 +2 -2
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc.man.in@1.85 +7 -704
+ NTP_4_2_7P269
+
+ ntpdc/ntpdc.mdoc.in@1.85 +7 -659
+ NTP_4_2_7P269
+
+ ntpq/ntpq-opts.c@1.271 +4 -4
+ NTP_4_2_7P269
+
+ ntpq/ntpq-opts.h@1.271 +3 -3
+ NTP_4_2_7P269
+
+ ntpq/ntpq-opts.texi@1.271 +2 -2
+ NTP_4_2_7P269
+
+ ntpq/ntpq.1ntpqman@1.85 +3 -260
+ NTP_4_2_7P269
+
+ ntpq/ntpq.1ntpqmdoc@1.85 +3 -245
+ NTP_4_2_7P269
+
+ ntpq/ntpq.man.in@1.85 +3 -260
+ NTP_4_2_7P269
+
+ ntpq/ntpq.mdoc.in@1.85 +3 -245
+ NTP_4_2_7P269
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.271 +4 -4
+ NTP_4_2_7P269
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.271 +3 -3
+ NTP_4_2_7P269
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.271 +2 -2
+ NTP_4_2_7P269
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.85 +4 -3
+ NTP_4_2_7P269
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.85 +4 -3
+ NTP_4_2_7P269
+
+ ntpsnmpd/ntpsnmpd.man.in@1.85 +4 -3
+ NTP_4_2_7P269
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.85 +4 -3
+ NTP_4_2_7P269
+
+ packageinfo.sh@1.272 +1 -1
+ NTP_4_2_7P269
+
+ scripts/ntp-wait-opts.texi@1.89 +1 -1
+ NTP_4_2_7P269
+
+ scripts/ntp-wait.1ntp-waitman@1.85 +4 -18
+ NTP_4_2_7P269
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.85 +4 -18
+ NTP_4_2_7P269
+
+ scripts/ntp-wait.html@1.89 +1 -1
+ NTP_4_2_7P269
+
+ scripts/ntp-wait.man.in@1.85 +4 -18
+ NTP_4_2_7P269
+
+ scripts/ntp-wait.mdoc.in@1.85 +4 -18
+ NTP_4_2_7P269
+
+ sntp/sntp-opts.c@1.267 +4 -4
+ NTP_4_2_7P269
+
+ sntp/sntp-opts.h@1.267 +3 -3
+ NTP_4_2_7P269
+
+ sntp/sntp-opts.texi@1.267 +2 -2
+ NTP_4_2_7P269
+
+ sntp/sntp.1sntpman@1.87 +6 -65
+ NTP_4_2_7P269
+
+ sntp/sntp.1sntpmdoc@1.87 +6 -65
+ NTP_4_2_7P269
+
+ sntp/sntp.html@1.267 +2 -2
+ NTP_4_2_7P269
+
+ sntp/sntp.man.in@1.87 +6 -65
+ NTP_4_2_7P269
+
+ sntp/sntp.mdoc.in@1.87 +6 -65
+ NTP_4_2_7P269
+
+ util/ntp-keygen-opts.c@1.271 +4 -4
+ NTP_4_2_7P269
+
+ util/ntp-keygen-opts.h@1.271 +3 -3
+ NTP_4_2_7P269
+
+ util/ntp-keygen-opts.texi@1.272 +2 -2
+ NTP_4_2_7P269
+
+ util/ntp-keygen.1ntp-keygenman@1.85 +6 -720
+ NTP_4_2_7P269
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.85 +6 -706
+ NTP_4_2_7P269
+
+ util/ntp-keygen.man.in@1.85 +6 -720
+ NTP_4_2_7P269
+
+ util/ntp-keygen.mdoc.in@1.85 +6 -706
+ NTP_4_2_7P269
+
+ChangeSet@1.2770, 2012-03-24 22:19:50-04:00, stenn@deacon.udel.edu
+ Clean up configure.ac
+
+ ChangeLog@1.1143 +1 -0
+ Clean up configure.ac
+
+ configure.ac@1.544 +221 -117
+ Clean up configure.ac
+
+ChangeSet@1.2769, 2012-03-24 19:30:26-04:00, stenn@psp-deb1.ntp.org
+ Cleanup configure.ac's TSYNC PCI section
+
+ ChangeLog@1.1142 +2 -0
+ Cleanup configure.ac's TSYNC PCI section
+
+ configure.ac@1.543 +2 -2
+ Cleanup configure.ac's TSYNC PCI section
+
+ChangeSet@1.2762.1.43, 2012-03-24 11:22:52+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P268
+ TAG: NTP_4_2_7P268
+
+ ChangeLog@1.1141 +1 -0
+ NTP_4_2_7P268
+
+ ntpd/ntpd-opts.c@1.273 +4 -4
+ NTP_4_2_7P268
+
+ ntpd/ntpd-opts.h@1.273 +3 -3
+ NTP_4_2_7P268
+
+ ntpd/ntpd-opts.texi@1.271 +2 -2
+ NTP_4_2_7P268
+
+ ntpd/ntpd.1ntpdman@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpd/ntpd.1ntpdmdoc@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpd/ntpd.man.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpd/ntpd.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc-opts.c@1.268 +4 -4
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc-opts.h@1.268 +3 -3
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc-opts.texi@1.268 +2 -2
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc.1ntpdcman@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc.html@1.96 +2 -2
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc.man.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpdc/ntpdc.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpq/ntpq-opts.c@1.270 +4 -4
+ NTP_4_2_7P268
+
+ ntpq/ntpq-opts.h@1.270 +3 -3
+ NTP_4_2_7P268
+
+ ntpq/ntpq-opts.texi@1.270 +2 -2
+ NTP_4_2_7P268
+
+ ntpq/ntpq.1ntpqman@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpq/ntpq.1ntpqmdoc@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpq/ntpq.man.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpq/ntpq.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.270 +4 -4
+ NTP_4_2_7P268
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.270 +3 -3
+ NTP_4_2_7P268
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.270 +2 -2
+ NTP_4_2_7P268
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpsnmpd/ntpsnmpd.man.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ packageinfo.sh@1.271 +1 -1
+ NTP_4_2_7P268
+
+ scripts/ntp-wait-opts.texi@1.88 +1 -1
+ NTP_4_2_7P268
+
+ scripts/ntp-wait.1ntp-waitman@1.84 +2 -2
+ NTP_4_2_7P268
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.84 +2 -2
+ NTP_4_2_7P268
+
+ scripts/ntp-wait.html@1.88 +1 -1
+ NTP_4_2_7P268
+
+ scripts/ntp-wait.man.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ scripts/ntp-wait.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ sntp/sntp-opts.c@1.266 +4 -4
+ NTP_4_2_7P268
+
+ sntp/sntp-opts.h@1.266 +3 -3
+ NTP_4_2_7P268
+
+ sntp/sntp-opts.texi@1.266 +2 -2
+ NTP_4_2_7P268
+
+ sntp/sntp.1sntpman@1.86 +2 -2
+ NTP_4_2_7P268
+
+ sntp/sntp.1sntpmdoc@1.86 +2 -2
+ NTP_4_2_7P268
+
+ sntp/sntp.html@1.266 +2 -2
+ NTP_4_2_7P268
+
+ sntp/sntp.man.in@1.86 +2 -2
+ NTP_4_2_7P268
+
+ sntp/sntp.mdoc.in@1.86 +2 -2
+ NTP_4_2_7P268
+
+ util/ntp-keygen-opts.c@1.270 +4 -4
+ NTP_4_2_7P268
+
+ util/ntp-keygen-opts.h@1.270 +3 -3
+ NTP_4_2_7P268
+
+ util/ntp-keygen-opts.texi@1.271 +2 -2
+ NTP_4_2_7P268
+
+ util/ntp-keygen.1ntp-keygenman@1.84 +2 -2
+ NTP_4_2_7P268
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.84 +2 -2
+ NTP_4_2_7P268
+
+ util/ntp-keygen.man.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ util/ntp-keygen.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P268
+
+ChangeSet@1.2762.1.42, 2012-03-23 21:50:58-04:00, stenn@deacon.udel.edu
+ reindent driver45.html
+
+ html/drivers/driver45.html@1.2 +22 -22
+ reindent driver45.html
+
+ChangeSet@1.2762.1.41, 2012-03-23 11:23:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P267
+ TAG: NTP_4_2_7P267
+
+ ChangeLog@1.1140 +1 -0
+ NTP_4_2_7P267
+
+ ntpd/ntpd-opts.c@1.272 +4 -4
+ NTP_4_2_7P267
+
+ ntpd/ntpd-opts.h@1.272 +3 -3
+ NTP_4_2_7P267
+
+ ntpd/ntpd-opts.texi@1.270 +2 -2
+ NTP_4_2_7P267
+
+ ntpd/ntpd.1ntpdman@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpd/ntpd.1ntpdmdoc@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpd/ntpd.man.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpd/ntpd.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc-opts.c@1.267 +4 -4
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc-opts.h@1.267 +3 -3
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc-opts.texi@1.267 +2 -2
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc.1ntpdcman@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc.html@1.95 +2 -2
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc.man.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpdc/ntpdc.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpq/ntpq-opts.c@1.269 +4 -4
+ NTP_4_2_7P267
+
+ ntpq/ntpq-opts.h@1.269 +3 -3
+ NTP_4_2_7P267
+
+ ntpq/ntpq-opts.texi@1.269 +2 -2
+ NTP_4_2_7P267
+
+ ntpq/ntpq.1ntpqman@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpq/ntpq.1ntpqmdoc@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpq/ntpq.man.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpq/ntpq.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.269 +4 -4
+ NTP_4_2_7P267
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.269 +3 -3
+ NTP_4_2_7P267
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.269 +2 -2
+ NTP_4_2_7P267
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpsnmpd/ntpsnmpd.man.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ packageinfo.sh@1.270 +1 -1
+ NTP_4_2_7P267
+
+ scripts/ntp-wait-opts.texi@1.87 +1 -1
+ NTP_4_2_7P267
+
+ scripts/ntp-wait.1ntp-waitman@1.83 +2 -2
+ NTP_4_2_7P267
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.83 +2 -2
+ NTP_4_2_7P267
+
+ scripts/ntp-wait.html@1.87 +1 -1
+ NTP_4_2_7P267
+
+ scripts/ntp-wait.man.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ scripts/ntp-wait.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ sntp/sntp-opts.c@1.265 +4 -4
+ NTP_4_2_7P267
+
+ sntp/sntp-opts.h@1.265 +3 -3
+ NTP_4_2_7P267
+
+ sntp/sntp-opts.texi@1.265 +2 -2
+ NTP_4_2_7P267
+
+ sntp/sntp.1sntpman@1.85 +2 -2
+ NTP_4_2_7P267
+
+ sntp/sntp.1sntpmdoc@1.85 +2 -2
+ NTP_4_2_7P267
+
+ sntp/sntp.html@1.265 +2 -2
+ NTP_4_2_7P267
+
+ sntp/sntp.man.in@1.85 +2 -2
+ NTP_4_2_7P267
+
+ sntp/sntp.mdoc.in@1.85 +2 -2
+ NTP_4_2_7P267
+
+ util/ntp-keygen-opts.c@1.269 +4 -4
+ NTP_4_2_7P267
+
+ util/ntp-keygen-opts.h@1.269 +3 -3
+ NTP_4_2_7P267
+
+ util/ntp-keygen-opts.texi@1.270 +2 -2
+ NTP_4_2_7P267
+
+ util/ntp-keygen.1ntp-keygenman@1.83 +2 -2
+ NTP_4_2_7P267
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.83 +2 -2
+ NTP_4_2_7P267
+
+ util/ntp-keygen.man.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ util/ntp-keygen.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P267
+
+ChangeSet@1.2762.1.40, 2012-03-22 20:20:29-04:00, stenn@deacon.udel.edu
+ Initial cut at a basic driver45.html page
+
+ ChangeLog@1.1139 +1 -0
+ Initial cut at a basic driver45.html page
+
+ html/drivers/driver45.html@1.1 +29 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/drivers/driver45.html
+
+ html/drivers/driver45.html@1.0 +0 -0
+
+ChangeSet@1.2762.1.39, 2012-03-21 11:24:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P266
+ TAG: NTP_4_2_7P266
+
+ ChangeLog@1.1138 +1 -0
+ NTP_4_2_7P266
+
+ ntpd/ntpd-opts.c@1.271 +4 -4
+ NTP_4_2_7P266
+
+ ntpd/ntpd-opts.h@1.271 +3 -3
+ NTP_4_2_7P266
+
+ ntpd/ntpd-opts.texi@1.269 +2 -2
+ NTP_4_2_7P266
+
+ ntpd/ntpd.1ntpdman@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpd/ntpd.1ntpdmdoc@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpd/ntpd.man.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpd/ntpd.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc-opts.c@1.266 +4 -4
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc-opts.h@1.266 +3 -3
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc-opts.texi@1.266 +2 -2
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc.1ntpdcman@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc.html@1.94 +2 -2
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc.man.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpdc/ntpdc.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpq/ntpq-opts.c@1.268 +4 -4
+ NTP_4_2_7P266
+
+ ntpq/ntpq-opts.h@1.268 +3 -3
+ NTP_4_2_7P266
+
+ ntpq/ntpq-opts.texi@1.268 +2 -2
+ NTP_4_2_7P266
+
+ ntpq/ntpq.1ntpqman@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpq/ntpq.1ntpqmdoc@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpq/ntpq.man.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpq/ntpq.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.268 +4 -4
+ NTP_4_2_7P266
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.268 +3 -3
+ NTP_4_2_7P266
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.268 +2 -2
+ NTP_4_2_7P266
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpsnmpd/ntpsnmpd.man.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ packageinfo.sh@1.269 +1 -1
+ NTP_4_2_7P266
+
+ scripts/ntp-wait-opts.texi@1.86 +1 -1
+ NTP_4_2_7P266
+
+ scripts/ntp-wait.1ntp-waitman@1.82 +2 -2
+ NTP_4_2_7P266
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.82 +2 -2
+ NTP_4_2_7P266
+
+ scripts/ntp-wait.html@1.86 +1 -1
+ NTP_4_2_7P266
+
+ scripts/ntp-wait.man.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ scripts/ntp-wait.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ sntp/sntp-opts.c@1.264 +4 -4
+ NTP_4_2_7P266
+
+ sntp/sntp-opts.h@1.264 +3 -3
+ NTP_4_2_7P266
+
+ sntp/sntp-opts.texi@1.264 +2 -2
+ NTP_4_2_7P266
+
+ sntp/sntp.1sntpman@1.84 +2 -2
+ NTP_4_2_7P266
+
+ sntp/sntp.1sntpmdoc@1.84 +2 -2
+ NTP_4_2_7P266
+
+ sntp/sntp.html@1.264 +2 -2
+ NTP_4_2_7P266
+
+ sntp/sntp.man.in@1.84 +2 -2
+ NTP_4_2_7P266
+
+ sntp/sntp.mdoc.in@1.84 +2 -2
+ NTP_4_2_7P266
+
+ util/ntp-keygen-opts.c@1.268 +4 -4
+ NTP_4_2_7P266
+
+ util/ntp-keygen-opts.h@1.268 +3 -3
+ NTP_4_2_7P266
+
+ util/ntp-keygen-opts.texi@1.269 +2 -2
+ NTP_4_2_7P266
+
+ util/ntp-keygen.1ntp-keygenman@1.82 +2 -2
+ NTP_4_2_7P266
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.82 +2 -2
+ NTP_4_2_7P266
+
+ util/ntp-keygen.man.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ util/ntp-keygen.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P266
+
+ChangeSet@1.2762.1.38, 2012-03-21 05:23:41+00:00, hart@psp-os1.ntp.org
+ refclock_tsyncpci.c:
+ Change mode to -rw-rw-r--
+
+ ntpd/refclock_tsyncpci.c@1.4 +0 -0
+ Change mode to -rw-rw-r--
+
+ ntpd/refclock_tsyncpci.c@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ChangeSet@1.2762.1.36, 2012-03-21 03:04:51+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Include Linux-specific refclock_tsyncpci.c in --enable-all-clocks only
+ on Linux.
+ Clean up configure.ac m4 quoting, indents to match current style.
+
+ configure.ac@1.542 +18 -5
+ Include Linux-specific refclock_tsyncpci.c in --enable-all-clocks only
+ on Linux.
+ Clean up m4 quoting, indents to match current style.
+
+ ntpd/refclock_tsyncpci.c@1.2 +3 -1
+ protect sys/ioctl.h include with HAVE_SYS_IOCTL_H
+
+ChangeSet@1.2762.10.1, 2012-03-20 11:25:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P265
+ TAG: NTP_4_2_7P265
+
+ ChangeLog@1.1135.1.1 +1 -0
+ NTP_4_2_7P265
+
+ ntpd/ntpd-opts.c@1.270 +4 -4
+ NTP_4_2_7P265
+
+ ntpd/ntpd-opts.h@1.270 +3 -3
+ NTP_4_2_7P265
+
+ ntpd/ntpd-opts.texi@1.268 +2 -2
+ NTP_4_2_7P265
+
+ ntpd/ntpd.1ntpdman@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpd/ntpd.1ntpdmdoc@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpd/ntpd.man.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpd/ntpd.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc-opts.c@1.265 +4 -4
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc-opts.h@1.265 +3 -3
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc-opts.texi@1.265 +2 -2
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc.1ntpdcman@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc.html@1.93 +2 -2
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc.man.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpdc/ntpdc.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpq/ntpq-opts.c@1.267 +4 -4
+ NTP_4_2_7P265
+
+ ntpq/ntpq-opts.h@1.267 +3 -3
+ NTP_4_2_7P265
+
+ ntpq/ntpq-opts.texi@1.267 +2 -2
+ NTP_4_2_7P265
+
+ ntpq/ntpq.1ntpqman@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpq/ntpq.1ntpqmdoc@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpq/ntpq.man.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpq/ntpq.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.267 +4 -4
+ NTP_4_2_7P265
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.267 +3 -3
+ NTP_4_2_7P265
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.267 +2 -2
+ NTP_4_2_7P265
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpsnmpd/ntpsnmpd.man.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ packageinfo.sh@1.268 +1 -1
+ NTP_4_2_7P265
+
+ scripts/ntp-wait-opts.texi@1.85 +1 -1
+ NTP_4_2_7P265
+
+ scripts/ntp-wait.1ntp-waitman@1.81 +2 -2
+ NTP_4_2_7P265
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.81 +2 -2
+ NTP_4_2_7P265
+
+ scripts/ntp-wait.html@1.85 +1 -1
+ NTP_4_2_7P265
+
+ scripts/ntp-wait.man.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ scripts/ntp-wait.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ sntp/sntp-opts.c@1.263 +4 -4
+ NTP_4_2_7P265
+
+ sntp/sntp-opts.h@1.263 +3 -3
+ NTP_4_2_7P265
+
+ sntp/sntp-opts.texi@1.263 +2 -2
+ NTP_4_2_7P265
+
+ sntp/sntp.1sntpman@1.83 +2 -2
+ NTP_4_2_7P265
+
+ sntp/sntp.1sntpmdoc@1.83 +2 -2
+ NTP_4_2_7P265
+
+ sntp/sntp.html@1.263 +2 -2
+ NTP_4_2_7P265
+
+ sntp/sntp.man.in@1.83 +2 -2
+ NTP_4_2_7P265
+
+ sntp/sntp.mdoc.in@1.83 +2 -2
+ NTP_4_2_7P265
+
+ util/ntp-keygen-opts.c@1.267 +4 -4
+ NTP_4_2_7P265
+
+ util/ntp-keygen-opts.h@1.267 +3 -3
+ NTP_4_2_7P265
+
+ util/ntp-keygen-opts.texi@1.268 +2 -2
+ NTP_4_2_7P265
+
+ util/ntp-keygen.1ntp-keygenman@1.81 +2 -2
+ NTP_4_2_7P265
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.81 +2 -2
+ NTP_4_2_7P265
+
+ util/ntp-keygen.man.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ util/ntp-keygen.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P265
+
+ChangeSet@1.2762.1.35, 2012-03-20 06:29:13+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Add reference to refclock_tsyncpci.c to ntpd.vcproj
+
+ ports/winnt/vs2005/ntpd.vcproj@1.17 +4 -0
+ Add reference to refclock_tsyncpci.c
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.43 +4 -0
+ Add reference to refclock_tsyncpci.c
+
+ChangeSet@1.2762.1.34, 2012-03-20 06:18:59+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Spectracom TSYNC reference clock driver from tsync.2.5.0.tar.gz downloaded from
+ http://www.spectracomcorp.com/Support/HowCanWeHelpYou/Library/tabid/59/Default.aspx?EntryId=107
+ (see linux/ntp/tsync.patch)
+
+ ChangeLog@1.1136 +2 -0
+ david.sohn@spectracom.orolia.com
+
+ configure.ac@1.541 +11 -0
+ Spectracom TSYNC reference clock driver from tsync.2.5.0.tar.gz
+
+ include/ntp.h@1.204 +2 -1
+ Spectracom TSYNC reference clock driver from tsync.2.5.0.tar.gz
+
+ libntp/clocktypes.c@1.20 +2 -0
+ Spectracom TSYNC reference clock driver from tsync.2.5.0.tar.gz
+
+ ntpd/Makefile.am@1.112.1.2 +1 -0
+ Spectracom TSYNC reference clock driver from tsync.2.5.0.tar.gz
+
+ ntpd/ntp_control.c@1.180 +1 -0
+ Spectracom TSYNC reference clock driver from tsync.2.5.0.tar.gz
+
+ ntpd/refclock_conf.c@1.32 +7 -1
+ Spectracom TSYNC reference clock driver from tsync.2.5.0.tar.gz
+
+ ntpd/refclock_tsyncpci.c@1.1 +926 -0
+ Via email from david.sohn@spectracom.orolia.com 19 Mar 2012
+
+ ntpd/refclock_tsyncpci.c@1.0 +0 -0
+
+ChangeSet@1.2762.1.33, 2012-03-20 06:03:15+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Treat zero counter as indication of precise system time in Windows
+ PPSAPI helper function pps_ntp_timestamp_from_counter(), enabling
+ PPSAPI providers to use the Windows 8 precise clock directly.
+
+ ChangeLog@1.1135 +3 -0
+ Treat zero counter as indication of precise system time in Windows
+ PPSAPI helper function pps_ntp_timestamp_from_counter(), enabling
+ PPSAPI providers to use the Windows 8 precise clock directly.
+
+ ports/winnt/include/clockstuff.h@1.13 +0 -9
+ Treat zero counter as indication of precise system time in Windows
+ PPSAPI helper function pps_ntp_timestamp_from_counter(), enabling
+ PPSAPI providers to use the Windows 8 precise clock directly.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.58 +6 -37
+ Treat zero counter as indication of precise system time in Windows
+ PPSAPI helper function pps_ntp_timestamp_from_counter(), enabling
+ PPSAPI providers to use the Windows 8 precise clock directly.
+
+ChangeSet@1.2762.1.32, 2012-03-14 07:58:25+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P264
+ TAG: NTP_4_2_7P264
+
+ ChangeLog@1.1134 +1 -0
+ NTP_4_2_7P264
+
+ ntpd/ntpd-opts.c@1.269 +4 -4
+ NTP_4_2_7P264
+
+ ntpd/ntpd-opts.h@1.269 +3 -3
+ NTP_4_2_7P264
+
+ ntpd/ntpd-opts.texi@1.267 +2 -2
+ NTP_4_2_7P264
+
+ ntpd/ntpd.1ntpdman@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpd/ntpd.1ntpdmdoc@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpd/ntpd.man.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpd/ntpd.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc-opts.c@1.264 +4 -4
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc-opts.h@1.264 +3 -3
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc-opts.texi@1.264 +2 -2
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc.1ntpdcman@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc.html@1.92 +2 -2
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc.man.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpdc/ntpdc.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpq/ntpq-opts.c@1.266 +4 -4
+ NTP_4_2_7P264
+
+ ntpq/ntpq-opts.h@1.266 +3 -3
+ NTP_4_2_7P264
+
+ ntpq/ntpq-opts.texi@1.266 +2 -2
+ NTP_4_2_7P264
+
+ ntpq/ntpq.1ntpqman@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpq/ntpq.1ntpqmdoc@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpq/ntpq.man.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpq/ntpq.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.266 +4 -4
+ NTP_4_2_7P264
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.266 +3 -3
+ NTP_4_2_7P264
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.266 +2 -2
+ NTP_4_2_7P264
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpsnmpd/ntpsnmpd.man.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ packageinfo.sh@1.267 +1 -1
+ NTP_4_2_7P264
+
+ scripts/ntp-wait-opts.texi@1.84 +1 -1
+ NTP_4_2_7P264
+
+ scripts/ntp-wait.1ntp-waitman@1.80 +2 -2
+ NTP_4_2_7P264
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.80 +2 -2
+ NTP_4_2_7P264
+
+ scripts/ntp-wait.html@1.84 +1 -1
+ NTP_4_2_7P264
+
+ scripts/ntp-wait.man.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ scripts/ntp-wait.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ sntp/sntp-opts.c@1.262 +4 -4
+ NTP_4_2_7P264
+
+ sntp/sntp-opts.h@1.262 +3 -3
+ NTP_4_2_7P264
+
+ sntp/sntp-opts.texi@1.262 +2 -2
+ NTP_4_2_7P264
+
+ sntp/sntp.1sntpman@1.82 +2 -2
+ NTP_4_2_7P264
+
+ sntp/sntp.1sntpmdoc@1.82 +2 -2
+ NTP_4_2_7P264
+
+ sntp/sntp.html@1.262 +2 -2
+ NTP_4_2_7P264
+
+ sntp/sntp.man.in@1.82 +2 -2
+ NTP_4_2_7P264
+
+ sntp/sntp.mdoc.in@1.82 +2 -2
+ NTP_4_2_7P264
+
+ util/ntp-keygen-opts.c@1.266 +4 -4
+ NTP_4_2_7P264
+
+ util/ntp-keygen-opts.h@1.266 +3 -3
+ NTP_4_2_7P264
+
+ util/ntp-keygen-opts.texi@1.267 +2 -2
+ NTP_4_2_7P264
+
+ util/ntp-keygen.1ntp-keygenman@1.80 +2 -2
+ NTP_4_2_7P264
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.80 +2 -2
+ NTP_4_2_7P264
+
+ util/ntp-keygen.man.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ util/ntp-keygen.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P264
+
+ChangeSet@1.2762.1.31, 2012-03-13 09:31:09+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Quiet "DAY" redefinition warning compiling ntp-keygen.c
+
+ util/ntp-keygen.c@1.91 +0 -1
+ Quiet "DAY" redefinition warning.
+
+ChangeSet@1.2762.1.30, 2012-03-13 09:22:37+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2160] Note if leapseconds file is past its prime.
+
+ ChangeLog@1.1133 +1 -0
+ [Bug 2160] Note if leapseconds file is past its prime.
+
+ ntpd/ntp_util.c@1.97 +10 -3
+ [Bug 2160] Note if leapseconds file is past its prime.
+
+ChangeSet@1.2762.1.29, 2012-03-13 09:02:35+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ ChangeLog@1.1132 +1 -0
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ include/ntp_fp.h@1.30 +4 -0
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ libntp/systime.c@1.65 +1 -0
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ ports/winnt/include/clockstuff.h@1.12 +2 -1
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ ports/winnt/include/sys/time.h@1.8 +1 -0
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ ports/winnt/libntp/getclock.c@1.4 +20 -8
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.57 +74 -49
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ util/ntp-keygen.c@1.90 +1 -1
+ Use GetSystemTimePreciseAsFileTime() on Windows 8.
+
+ChangeSet@1.2762.1.28, 2012-03-13 03:57:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P263
+ TAG: NTP_4_2_7P263
+
+ ChangeLog@1.1131 +1 -0
+ NTP_4_2_7P263
+
+ ntpd/ntpd-opts.c@1.268 +4 -4
+ NTP_4_2_7P263
+
+ ntpd/ntpd-opts.h@1.268 +3 -3
+ NTP_4_2_7P263
+
+ ntpd/ntpd-opts.texi@1.266 +2 -2
+ NTP_4_2_7P263
+
+ ntpd/ntpd.1ntpdman@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpd/ntpd.1ntpdmdoc@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpd/ntpd.man.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpd/ntpd.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc-opts.c@1.263 +4 -4
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc-opts.h@1.263 +3 -3
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc-opts.texi@1.263 +2 -2
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc.1ntpdcman@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc.html@1.91 +2 -2
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc.man.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpdc/ntpdc.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpq/ntpq-opts.c@1.265 +4 -4
+ NTP_4_2_7P263
+
+ ntpq/ntpq-opts.h@1.265 +3 -3
+ NTP_4_2_7P263
+
+ ntpq/ntpq-opts.texi@1.265 +2 -2
+ NTP_4_2_7P263
+
+ ntpq/ntpq.1ntpqman@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpq/ntpq.1ntpqmdoc@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpq/ntpq.man.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpq/ntpq.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.265 +4 -4
+ NTP_4_2_7P263
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.265 +3 -3
+ NTP_4_2_7P263
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.265 +2 -2
+ NTP_4_2_7P263
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpsnmpd/ntpsnmpd.man.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ packageinfo.sh@1.266 +1 -1
+ NTP_4_2_7P263
+
+ scripts/ntp-wait-opts.texi@1.83 +2 -14
+ NTP_4_2_7P263
+
+ scripts/ntp-wait.1ntp-waitman@1.79 +2 -2
+ NTP_4_2_7P263
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.79 +2 -2
+ NTP_4_2_7P263
+
+ scripts/ntp-wait.html@1.83 +2 -14
+ NTP_4_2_7P263
+
+ scripts/ntp-wait.man.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ scripts/ntp-wait.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ sntp/sntp-opts.c@1.261 +4 -4
+ NTP_4_2_7P263
+
+ sntp/sntp-opts.h@1.261 +3 -3
+ NTP_4_2_7P263
+
+ sntp/sntp-opts.texi@1.261 +2 -2
+ NTP_4_2_7P263
+
+ sntp/sntp.1sntpman@1.81 +2 -2
+ NTP_4_2_7P263
+
+ sntp/sntp.1sntpmdoc@1.81 +2 -2
+ NTP_4_2_7P263
+
+ sntp/sntp.html@1.261 +2 -2
+ NTP_4_2_7P263
+
+ sntp/sntp.man.in@1.81 +2 -2
+ NTP_4_2_7P263
+
+ sntp/sntp.mdoc.in@1.81 +2 -2
+ NTP_4_2_7P263
+
+ util/ntp-keygen-opts.c@1.265 +4 -4
+ NTP_4_2_7P263
+
+ util/ntp-keygen-opts.h@1.265 +3 -3
+ NTP_4_2_7P263
+
+ util/ntp-keygen-opts.texi@1.266 +2 -2
+ NTP_4_2_7P263
+
+ util/ntp-keygen.1ntp-keygenman@1.79 +2 -2
+ NTP_4_2_7P263
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.79 +2 -2
+ NTP_4_2_7P263
+
+ util/ntp-keygen.man.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ util/ntp-keygen.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P263
+
+ChangeSet@1.2762.1.27, 2012-03-11 07:10:54+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
+
+ ChangeLog@1.1130 +1 -0
+ [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
+
+ include/ntp_stdlib.h@1.72 +4 -0
+ [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
+
+ ntpd/ntp_timer.c@1.68 +0 -4
+ [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.56 +4 -3
+ [Bug 2159] Windows ntpd using leapfile erroneous leap second 20120401.
+
+ChangeSet@1.2762.1.26, 2012-03-10 17:27:45+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2156] clock instability with LOCAL driver, from Miroslav Lichvar.
+
+ ChangeLog@1.1129 +1 -0
+ [Bug 2156] clock instability with LOCAL driver, from Miroslav Lichvar.
+
+ ntpd/ntp_proto.c@1.340 +1 -1
+ [Bug 2156] clock instability with LOCAL driver, from Miroslav Lichvar.
+
+ChangeSet@1.2082.4.263, 2012-03-10 04:49:48-05:00, stenn@deacon.udel.edu
+ Update 2mirror trigger to copy directly to bk2
+
+ BitKeeper/triggers/2mirrors@1.7.1.1 +5 -3
+ Update 2mirror trigger to copy directly to bk2
+
+ChangeSet@1.2762.1.24, 2012-02-29 01:27:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P262
+ TAG: NTP_4_2_7P262
+
+ ChangeLog@1.1128 +1 -0
+ NTP_4_2_7P262
+
+ ntpd/ntpd-opts.c@1.267 +4 -4
+ NTP_4_2_7P262
+
+ ntpd/ntpd-opts.h@1.267 +3 -3
+ NTP_4_2_7P262
+
+ ntpd/ntpd-opts.texi@1.265 +2 -2
+ NTP_4_2_7P262
+
+ ntpd/ntpd.1ntpdman@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpd/ntpd.1ntpdmdoc@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpd/ntpd.man.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpd/ntpd.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc-opts.c@1.262 +4 -4
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc-opts.h@1.262 +3 -3
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc-opts.texi@1.262 +2 -2
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc.1ntpdcman@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc.html@1.90 +2 -2
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc.man.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpdc/ntpdc.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpq/ntpq-opts.c@1.264 +4 -4
+ NTP_4_2_7P262
+
+ ntpq/ntpq-opts.h@1.264 +3 -3
+ NTP_4_2_7P262
+
+ ntpq/ntpq-opts.texi@1.264 +2 -2
+ NTP_4_2_7P262
+
+ ntpq/ntpq.1ntpqman@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpq/ntpq.1ntpqmdoc@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpq/ntpq.man.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpq/ntpq.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.264 +4 -4
+ NTP_4_2_7P262
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.264 +3 -3
+ NTP_4_2_7P262
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.264 +2 -2
+ NTP_4_2_7P262
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpsnmpd/ntpsnmpd.man.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ packageinfo.sh@1.265 +1 -1
+ NTP_4_2_7P262
+
+ scripts/ntp-wait-opts.texi@1.82 +1 -1
+ NTP_4_2_7P262
+
+ scripts/ntp-wait.1ntp-waitman@1.78 +2 -2
+ NTP_4_2_7P262
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.78 +2 -2
+ NTP_4_2_7P262
+
+ scripts/ntp-wait.html@1.82 +1 -1
+ NTP_4_2_7P262
+
+ scripts/ntp-wait.man.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ scripts/ntp-wait.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ sntp/sntp-opts.c@1.260 +4 -4
+ NTP_4_2_7P262
+
+ sntp/sntp-opts.h@1.260 +3 -3
+ NTP_4_2_7P262
+
+ sntp/sntp-opts.texi@1.260 +2 -2
+ NTP_4_2_7P262
+
+ sntp/sntp.1sntpman@1.80 +2 -2
+ NTP_4_2_7P262
+
+ sntp/sntp.1sntpmdoc@1.80 +2 -2
+ NTP_4_2_7P262
+
+ sntp/sntp.html@1.260 +2 -2
+ NTP_4_2_7P262
+
+ sntp/sntp.man.in@1.80 +2 -2
+ NTP_4_2_7P262
+
+ sntp/sntp.mdoc.in@1.80 +2 -2
+ NTP_4_2_7P262
+
+ util/ntp-keygen-opts.c@1.264 +4 -4
+ NTP_4_2_7P262
+
+ util/ntp-keygen-opts.h@1.264 +3 -3
+ NTP_4_2_7P262
+
+ util/ntp-keygen-opts.texi@1.265 +2 -2
+ NTP_4_2_7P262
+
+ util/ntp-keygen.1ntp-keygenman@1.78 +2 -2
+ NTP_4_2_7P262
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.78 +2 -2
+ NTP_4_2_7P262
+
+ util/ntp-keygen.man.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ util/ntp-keygen.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P262
+
+ChangeSet@1.2762.1.23, 2012-02-28 20:27:35-05:00, stenn@deacon.udel.edu
+ Add missing library to ntpsnmpd build
+
+ ntpsnmpd/Makefile.am@1.34 +1 -1
+ Add missing library to ntpsnmpd build
+
+ChangeSet@1.2762.9.1, 2012-02-28 04:42:34-05:00, stenn@deacon.udel.edu
+ Disable bkbits as a mirror for now
+
+ BitKeeper/triggers/2mirrors@1.8 +3 -1
+ Disable bkbits as a mirror for now
+
+ChangeSet@1.2762.1.21, 2012-02-27 23:05:11+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Improve ntpd scalability for servers with many trusted keys.
+
+ ChangeLog@1.1127 +1 -0
+ Improve ntpd scalability for servers with many trusted keys.
+
+ include/ntp_stdlib.h@1.71 +6 -4
+ Improve ntpd scalability for servers with many trusted keys.
+
+ libntp/a_md5encrypt.c@1.32 +3 -3
+ Improve ntpd scalability for servers with many trusted keys.
+
+ libntp/authkeys.c@1.23 +410 -257
+ Improve ntpd scalability for servers with many trusted keys.
+
+ ntpd/ntp_config.c@1.298 +43 -9
+ Improve ntpd scalability for servers with many trusted keys.
+
+ ntpdc/ntpdc.c@1.99 +1 -0
+ Use init_auth() before other symmetric key routines.
+
+ ntpq/ntpq.c@1.145 +1 -0
+ Use init_auth() before other symmetric key routines.
+
+ sntp/main.c@1.82 +2 -0
+ Use init_auth() before other symmetric key routines.
+
+ sntp/tests_main.cpp@1.8 +1 -0
+ Use init_auth() before other symmetric key routines.
+
+ tests/libntp/a_md5encrypt.cpp@1.5 +4 -4
+ Improve ntpd scalability for servers with many trusted keys.
+
+ tests/libntp/authkeys.cpp@1.7 +7 -11
+ Improve ntpd scalability for servers with many trusted keys.
+
+ChangeSet@1.2762.1.20, 2012-02-27 11:45:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P261
+ TAG: NTP_4_2_7P261
+
+ ChangeLog@1.1126 +1 -0
+ NTP_4_2_7P261
+
+ ntpd/ntpd-opts.c@1.266 +4 -4
+ NTP_4_2_7P261
+
+ ntpd/ntpd-opts.h@1.266 +3 -3
+ NTP_4_2_7P261
+
+ ntpd/ntpd-opts.texi@1.264 +2 -2
+ NTP_4_2_7P261
+
+ ntpd/ntpd.1ntpdman@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpd/ntpd.1ntpdmdoc@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpd/ntpd.man.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpd/ntpd.mdoc.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc-opts.c@1.261 +4 -4
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc-opts.h@1.261 +3 -3
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc-opts.texi@1.261 +2 -2
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc.1ntpdcman@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc.html@1.89 +2 -2
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc.man.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpdc/ntpdc.mdoc.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpq/ntpq-opts.c@1.263 +4 -4
+ NTP_4_2_7P261
+
+ ntpq/ntpq-opts.h@1.263 +3 -3
+ NTP_4_2_7P261
+
+ ntpq/ntpq-opts.texi@1.263 +2 -2
+ NTP_4_2_7P261
+
+ ntpq/ntpq.1ntpqman@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpq/ntpq.1ntpqmdoc@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpq/ntpq.man.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpq/ntpq.mdoc.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.263 +4 -4
+ NTP_4_2_7P261
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.263 +3 -3
+ NTP_4_2_7P261
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.263 +2 -2
+ NTP_4_2_7P261
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpsnmpd/ntpsnmpd.man.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ packageinfo.sh@1.264 +1 -1
+ NTP_4_2_7P261
+
+ scripts/ntp-wait-opts.texi@1.81 +1 -1
+ NTP_4_2_7P261
+
+ scripts/ntp-wait.1ntp-waitman@1.77 +2 -2
+ NTP_4_2_7P261
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.77 +2 -2
+ NTP_4_2_7P261
+
+ scripts/ntp-wait.html@1.81 +1 -1
+ NTP_4_2_7P261
+
+ scripts/ntp-wait.man.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ scripts/ntp-wait.mdoc.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ sntp/sntp-opts.c@1.259 +4 -4
+ NTP_4_2_7P261
+
+ sntp/sntp-opts.h@1.259 +3 -3
+ NTP_4_2_7P261
+
+ sntp/sntp-opts.texi@1.259 +2 -2
+ NTP_4_2_7P261
+
+ sntp/sntp.1sntpman@1.79 +2 -2
+ NTP_4_2_7P261
+
+ sntp/sntp.1sntpmdoc@1.79 +2 -2
+ NTP_4_2_7P261
+
+ sntp/sntp.html@1.259 +2 -2
+ NTP_4_2_7P261
+
+ sntp/sntp.man.in@1.79 +2 -2
+ NTP_4_2_7P261
+
+ sntp/sntp.mdoc.in@1.79 +2 -2
+ NTP_4_2_7P261
+
+ util/ntp-keygen-opts.c@1.263 +4 -4
+ NTP_4_2_7P261
+
+ util/ntp-keygen-opts.h@1.263 +3 -3
+ NTP_4_2_7P261
+
+ util/ntp-keygen-opts.texi@1.264 +2 -2
+ NTP_4_2_7P261
+
+ util/ntp-keygen.1ntp-keygenman@1.77 +2 -2
+ NTP_4_2_7P261
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.77 +2 -2
+ NTP_4_2_7P261
+
+ util/ntp-keygen.man.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ util/ntp-keygen.mdoc.in@1.77 +2 -2
+ NTP_4_2_7P261
+
+ChangeSet@1.2762.7.3, 2012-02-27 06:45:32+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to autogen-5.15
+
+ ChangeLog@1.1123.1.2 +1 -0
+ Upgrade to autogen-5.15
+
+ sntp/include/autogen-version.def@1.10 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/COPYING.gplv3@1.5 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/COPYING.lgplv3@1.5 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/Makefile.am@1.12 +5 -4
+ Upgrade to autogen-5.15
+
+ sntp/libopts/README@1.7 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/ag-char-map.h@1.15 +132 -102
+ Upgrade to autogen-5.15
+
+ sntp/libopts/alias.c@1.1 +108 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/sntp/libopts/alias.c
+
+ sntp/libopts/alias.c@1.0 +0 -0
+
+ sntp/libopts/ao-strs.c@1.1 +323 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-autogen/sntp/libopts/ao-strs.c
+
+ sntp/libopts/ao-strs.c@1.0 +0 -0
+
+ sntp/libopts/autoopts.c@1.12 +14 -14
+ Upgrade to autogen-5.15
+
+ sntp/libopts/autoopts.h@1.10 +5 -3
+ Upgrade to autogen-5.15
+
+ sntp/libopts/autoopts/options.h@1.14 +31 -19
+ Upgrade to autogen-5.15
+
+ sntp/libopts/autoopts/usage-txt.h@1.14 +168 -170
+ Upgrade to autogen-5.15
+
+ sntp/libopts/boolean.c@1.8 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/check.c@1.2 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/compat/compat.h@1.8 +5 -3
+ Upgrade to autogen-5.15
+
+ sntp/libopts/compat/windows-config.h@1.8 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/configfile.c@1.13 +16 -14
+ Upgrade to autogen-5.15
+
+ sntp/libopts/cook.c@1.9 +12 -12
+ Upgrade to autogen-5.15
+
+ sntp/libopts/enum.c@1.2 +31 -36
+ Upgrade to autogen-5.15
+
+ sntp/libopts/env.c@1.2 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/file.c@1.10 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/find.c@1.2 +36 -38
+ Upgrade to autogen-5.15
+
+ sntp/libopts/genshell.c@1.15 +25 -19
+ Upgrade to autogen-5.15
+
+ sntp/libopts/genshell.h@1.15 +4 -4
+ Upgrade to autogen-5.15
+
+ sntp/libopts/libopts.c@1.5 +7 -3
+ Upgrade to autogen-5.15
+
+ sntp/libopts/load.c@1.11 +10 -11
+ Upgrade to autogen-5.15
+
+ sntp/libopts/m4/libopts.m4@1.18 +30 -30
+ Upgrade to autogen-5.15
+
+ sntp/libopts/m4/liboptschk.m4@1.9 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/makeshell.c@1.10 +124 -436
+ Upgrade to autogen-5.15
+
+ sntp/libopts/nested.c@1.8 +65 -40
+ Upgrade to autogen-5.15
+
+ sntp/libopts/numeric.c@1.9 +9 -13
+ Upgrade to autogen-5.15
+
+ sntp/libopts/parse-duration.c@1.6 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/parse-duration.h@1.6 +2 -2
+ Upgrade to autogen-5.15
+
+ sntp/libopts/pgusage.c@1.9 +8 -9
+ Upgrade to autogen-5.15
+
+ sntp/libopts/proto.h@1.15 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/putshell.c@1.8 +21 -34
+ Upgrade to autogen-5.15
+
+ sntp/libopts/reset.c@1.9 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/restore.c@1.8 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/save.c@1.10 +82 -98
+ Upgrade to autogen-5.15
+
+ sntp/libopts/sort.c@1.9 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/stack.c@1.8 +6 -6
+ Upgrade to autogen-5.15
+
+ sntp/libopts/streqvcmp.c@1.8 +6 -6
+ Upgrade to autogen-5.15
+
+ sntp/libopts/text_mmap.c@1.10 +2 -2
+ Upgrade to autogen-5.15
+
+ sntp/libopts/time.c@1.9 +3 -3
+ Upgrade to autogen-5.15
+
+ sntp/libopts/tokenize.c@1.6 +5 -5
+ Upgrade to autogen-5.15
+
+ sntp/libopts/usage.c@1.10 +9 -9
+ Upgrade to autogen-5.15
+
+ sntp/libopts/value-type.h@1.15 +1 -1
+ Upgrade to autogen-5.15
+
+ sntp/libopts/version.c@1.10 +25 -10
+ Upgrade to autogen-5.15
+
+ sntp/libopts/xat-attribute.h@1.15 +1 -1
+ Upgrade to autogen-5.15
+
+ChangeSet@1.2762.7.1, 2012-02-24 11:36:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P260
+ TAG: NTP_4_2_7P260
+
+ ChangeLog@1.1123.1.1 +1 -0
+ NTP_4_2_7P260
+
+ ntpd/ntpd-opts.c@1.265 +4 -4
+ NTP_4_2_7P260
+
+ ntpd/ntpd-opts.h@1.265 +3 -3
+ NTP_4_2_7P260
+
+ ntpd/ntpd-opts.texi@1.263 +2 -2
+ NTP_4_2_7P260
+
+ ntpd/ntpd.1ntpdman@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpd/ntpd.1ntpdmdoc@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpd/ntpd.man.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpd/ntpd.mdoc.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc-opts.c@1.260 +4 -4
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc-opts.h@1.260 +3 -3
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc-opts.texi@1.260 +2 -2
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc.1ntpdcman@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc.html@1.88 +2 -2
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc.man.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpdc/ntpdc.mdoc.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpq/ntpq-opts.c@1.262 +4 -4
+ NTP_4_2_7P260
+
+ ntpq/ntpq-opts.h@1.262 +3 -3
+ NTP_4_2_7P260
+
+ ntpq/ntpq-opts.texi@1.262 +2 -2
+ NTP_4_2_7P260
+
+ ntpq/ntpq.1ntpqman@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpq/ntpq.1ntpqmdoc@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpq/ntpq.man.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpq/ntpq.mdoc.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.262 +4 -4
+ NTP_4_2_7P260
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.262 +3 -3
+ NTP_4_2_7P260
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.262 +2 -2
+ NTP_4_2_7P260
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpsnmpd/ntpsnmpd.man.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ packageinfo.sh@1.263 +1 -1
+ NTP_4_2_7P260
+
+ scripts/ntp-wait-opts.texi@1.80 +1 -1
+ NTP_4_2_7P260
+
+ scripts/ntp-wait.1ntp-waitman@1.76 +2 -2
+ NTP_4_2_7P260
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.76 +2 -2
+ NTP_4_2_7P260
+
+ scripts/ntp-wait.html@1.80 +1 -1
+ NTP_4_2_7P260
+
+ scripts/ntp-wait.man.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ scripts/ntp-wait.mdoc.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ sntp/sntp-opts.c@1.258 +4 -4
+ NTP_4_2_7P260
+
+ sntp/sntp-opts.h@1.258 +3 -3
+ NTP_4_2_7P260
+
+ sntp/sntp-opts.texi@1.258 +2 -2
+ NTP_4_2_7P260
+
+ sntp/sntp.1sntpman@1.78 +2 -2
+ NTP_4_2_7P260
+
+ sntp/sntp.1sntpmdoc@1.78 +2 -2
+ NTP_4_2_7P260
+
+ sntp/sntp.html@1.258 +2 -2
+ NTP_4_2_7P260
+
+ sntp/sntp.man.in@1.78 +2 -2
+ NTP_4_2_7P260
+
+ sntp/sntp.mdoc.in@1.78 +2 -2
+ NTP_4_2_7P260
+
+ util/ntp-keygen-opts.c@1.262 +4 -4
+ NTP_4_2_7P260
+
+ util/ntp-keygen-opts.h@1.262 +3 -3
+ NTP_4_2_7P260
+
+ util/ntp-keygen-opts.texi@1.263 +2 -2
+ NTP_4_2_7P260
+
+ util/ntp-keygen.1ntp-keygenman@1.76 +2 -2
+ NTP_4_2_7P260
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.76 +2 -2
+ NTP_4_2_7P260
+
+ util/ntp-keygen.man.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ util/ntp-keygen.mdoc.in@1.76 +2 -2
+ NTP_4_2_7P260
+
+ChangeSet@1.2762.1.18, 2012-02-24 08:07:56+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2048] add the clock variable timecode to SHM refclock.
+ Thanks to Michael Tatarinov.
+
+ ChangeLog@1.1124 +1 -0
+ [Bug 2048] add the clock variable timecode to SHM refclock.
+
+ ntpd/refclock_shm.c@1.24 +16 -6
+ [Bug 2048] add the clock variable timecode to SHM refclock.
+
+ChangeSet@1.2762.1.17, 2012-02-23 18:16:42-05:00, stenn@deacon.udel.edu
+ Fix the check-scm-rev invocation in several Makefile.am's.
+
+ ChangeLog@1.1123 +1 -0
+ Fix the check-scm-rev invocation in several Makefile.am's.
+
+ ntpd/Makefile.am@1.112.1.1 +1 -1
+ Fix the check-scm-rev invocation in several Makefile.am's.
+
+ ntpdate/Makefile.am@1.34 +1 -1
+ Fix the check-scm-rev invocation in several Makefile.am's.
+
+ ntpdc/Makefile.am@1.70 +1 -1
+ Fix the check-scm-rev invocation in several Makefile.am's.
+
+ ntpq/Makefile.am@1.66 +1 -1
+ Fix the check-scm-rev invocation in several Makefile.am's.
+
+ util/Makefile.am@1.70 +1 -1
+ Fix the check-scm-rev invocation in several Makefile.am's.
+
+ChangeSet@1.2762.1.16, 2012-02-22 05:59:53+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P259
+ TAG: NTP_4_2_7P259
+
+ ChangeLog@1.1122 +1 -0
+ NTP_4_2_7P259
+
+ ntpd/ntpd-opts.c@1.264 +4 -4
+ NTP_4_2_7P259
+
+ ntpd/ntpd-opts.h@1.264 +3 -3
+ NTP_4_2_7P259
+
+ ntpd/ntpd-opts.texi@1.262 +2 -2
+ NTP_4_2_7P259
+
+ ntpd/ntpd.1ntpdman@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpd/ntpd.1ntpdmdoc@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpd/ntpd.man.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpd/ntpd.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc-opts.c@1.259 +4 -4
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc-opts.h@1.259 +3 -3
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc-opts.texi@1.259 +2 -2
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc.1ntpdcman@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc.html@1.87 +2 -2
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc.man.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpdc/ntpdc.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpq/ntpq-opts.c@1.261 +4 -4
+ NTP_4_2_7P259
+
+ ntpq/ntpq-opts.h@1.261 +3 -3
+ NTP_4_2_7P259
+
+ ntpq/ntpq-opts.texi@1.261 +2 -2
+ NTP_4_2_7P259
+
+ ntpq/ntpq.1ntpqman@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpq/ntpq.1ntpqmdoc@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpq/ntpq.man.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpq/ntpq.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.261 +4 -4
+ NTP_4_2_7P259
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.261 +3 -3
+ NTP_4_2_7P259
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.261 +2 -2
+ NTP_4_2_7P259
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpsnmpd/ntpsnmpd.man.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ packageinfo.sh@1.262 +1 -1
+ NTP_4_2_7P259
+
+ scripts/ntp-wait-opts.texi@1.79 +1 -1
+ NTP_4_2_7P259
+
+ scripts/ntp-wait.1ntp-waitman@1.75 +2 -2
+ NTP_4_2_7P259
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.75 +2 -2
+ NTP_4_2_7P259
+
+ scripts/ntp-wait.html@1.79 +1 -1
+ NTP_4_2_7P259
+
+ scripts/ntp-wait.man.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ scripts/ntp-wait.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ sntp/sntp-opts.c@1.257 +4 -4
+ NTP_4_2_7P259
+
+ sntp/sntp-opts.h@1.257 +3 -3
+ NTP_4_2_7P259
+
+ sntp/sntp-opts.texi@1.257 +2 -2
+ NTP_4_2_7P259
+
+ sntp/sntp.1sntpman@1.77 +2 -2
+ NTP_4_2_7P259
+
+ sntp/sntp.1sntpmdoc@1.77 +2 -2
+ NTP_4_2_7P259
+
+ sntp/sntp.html@1.257 +2 -2
+ NTP_4_2_7P259
+
+ sntp/sntp.man.in@1.77 +2 -2
+ NTP_4_2_7P259
+
+ sntp/sntp.mdoc.in@1.77 +2 -2
+ NTP_4_2_7P259
+
+ util/ntp-keygen-opts.c@1.261 +4 -4
+ NTP_4_2_7P259
+
+ util/ntp-keygen-opts.h@1.261 +3 -3
+ NTP_4_2_7P259
+
+ util/ntp-keygen-opts.texi@1.262 +2 -2
+ NTP_4_2_7P259
+
+ util/ntp-keygen.1ntp-keygenman@1.75 +2 -2
+ NTP_4_2_7P259
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.75 +2 -2
+ NTP_4_2_7P259
+
+ util/ntp-keygen.man.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ util/ntp-keygen.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P259
+
+ChangeSet@1.2762.1.15, 2012-02-22 05:05:04+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2148] ntpd 4.2.7p258 segfault with 0x0100000 bit in NMEA mode.
+ refclock_nmea.c merge cleanup thanks to Juergen Perlinger.
+ Use mutex with Lamport checks in get_systime() on Windows, which
+ unlike portable ntpd uses the routine across threads.
+
+ ChangeLog@1.1121 +2 -0
+ [Bug 2148] ntpd 4.2.7p258 segfault with 0x0100000 bit in NMEA mode.
+ refclock_nmea.c merge cleanup thanks to Juergen Perlinger.
+
+ include/ntp_assert.h@1.7 +4 -4
+ Do not evaluate expression for compiled-out DEBUG_INSIST() and other
+ DEBUG_*() assertions.
+
+ include/ntp_fp.h@1.29 +30 -0
+ Make recent fuzz Lamport checks in get_systime() safe on Windows ntpd,
+ which invokes get_systime() on independent threads with mutex.
+
+ libntp/lib_strbuf.c@1.10 +5 -0
+ Make recent fuzz Lamport checks in get_systime() safe on Windows ntpd,
+ which invokes get_systime() on independent threads with mutex.
+
+ libntp/systime.c@1.64 +26 -2
+ Make recent fuzz Lamport checks in get_systime() safe on Windows ntpd,
+ which invokes get_systime() on independent threads with mutex.
+
+ ntpd/ntp_control.c@1.179 +7 -1
+ [Bug 2148] ntpd 4.2.7p258 segfault with 0x0100000 bit in NMEA mode.
+
+ ntpd/ntp_refclock.c@1.115 +3 -1
+ p257 change requires reflective change to debug trace code to avoid
+ unprintable spew.
+
+ ntpd/ntpd.c@1.130 +1 -1
+ init_lib() calls init_systime() which needs to happen before get_systime()
+
+ ntpd/refclock_nmea.c@1.70 +0 -13
+ merge cleanup of Dave's merge, courtesy Juergen OOB
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.66 +1 -1
+ debug trace of user PPS hack treated DCD timestamp as signed.
+
+ sntp/tests_main.cpp@1.7 +2 -0
+ Call libntp's init_lib() early in unit tests.
+
+ sntp/tests_main.h@1.8 +3 -0
+ ntp_stdlib.h for init_lib()
+
+ChangeSet@1.2762.1.14, 2012-02-21 04:53:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P258
+ TAG: NTP_4_2_7P258
+
+ ChangeLog@1.1120 +1 -0
+ NTP_4_2_7P258
+
+ ntpd/ntpd-opts.c@1.263 +4 -4
+ NTP_4_2_7P258
+
+ ntpd/ntpd-opts.h@1.263 +3 -3
+ NTP_4_2_7P258
+
+ ntpd/ntpd-opts.texi@1.261 +2 -2
+ NTP_4_2_7P258
+
+ ntpd/ntpd.1ntpdman@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpd/ntpd.1ntpdmdoc@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpd/ntpd.man.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpd/ntpd.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc-opts.c@1.258 +4 -4
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc-opts.h@1.258 +3 -3
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc-opts.texi@1.258 +2 -2
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc.1ntpdcman@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc.html@1.86 +2 -2
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc.man.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpdc/ntpdc.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpq/ntpq-opts.c@1.260 +4 -4
+ NTP_4_2_7P258
+
+ ntpq/ntpq-opts.h@1.260 +3 -3
+ NTP_4_2_7P258
+
+ ntpq/ntpq-opts.texi@1.260 +2 -2
+ NTP_4_2_7P258
+
+ ntpq/ntpq.1ntpqman@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpq/ntpq.1ntpqmdoc@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpq/ntpq.man.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpq/ntpq.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.260 +4 -4
+ NTP_4_2_7P258
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.260 +3 -3
+ NTP_4_2_7P258
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.260 +2 -2
+ NTP_4_2_7P258
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpsnmpd/ntpsnmpd.man.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ packageinfo.sh@1.261 +1 -1
+ NTP_4_2_7P258
+
+ scripts/ntp-wait-opts.texi@1.78 +1 -1
+ NTP_4_2_7P258
+
+ scripts/ntp-wait.1ntp-waitman@1.74 +2 -2
+ NTP_4_2_7P258
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.74 +2 -2
+ NTP_4_2_7P258
+
+ scripts/ntp-wait.html@1.78 +1 -1
+ NTP_4_2_7P258
+
+ scripts/ntp-wait.man.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ scripts/ntp-wait.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ sntp/sntp-opts.c@1.256 +4 -4
+ NTP_4_2_7P258
+
+ sntp/sntp-opts.h@1.256 +3 -3
+ NTP_4_2_7P258
+
+ sntp/sntp-opts.texi@1.256 +2 -2
+ NTP_4_2_7P258
+
+ sntp/sntp.1sntpman@1.76 +2 -2
+ NTP_4_2_7P258
+
+ sntp/sntp.1sntpmdoc@1.76 +2 -2
+ NTP_4_2_7P258
+
+ sntp/sntp.html@1.256 +2 -2
+ NTP_4_2_7P258
+
+ sntp/sntp.man.in@1.76 +2 -2
+ NTP_4_2_7P258
+
+ sntp/sntp.mdoc.in@1.76 +2 -2
+ NTP_4_2_7P258
+
+ util/ntp-keygen-opts.c@1.260 +4 -4
+ NTP_4_2_7P258
+
+ util/ntp-keygen-opts.h@1.260 +3 -3
+ NTP_4_2_7P258
+
+ util/ntp-keygen-opts.texi@1.261 +2 -2
+ NTP_4_2_7P258
+
+ util/ntp-keygen.1ntp-keygenman@1.74 +2 -2
+ NTP_4_2_7P258
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.74 +2 -2
+ NTP_4_2_7P258
+
+ util/ntp-keygen.man.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ util/ntp-keygen.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P258
+
+ChangeSet@1.2762.1.13, 2012-02-21 02:43:49+00:00, hart@psp-os1.ntp.org
+ refclock_nmea.c:
+ add newline to EOF
+
+ ntpd/refclock_nmea.c@1.69 +1 -1
+ add newline to EOF
+
+ChangeSet@1.2762.6.1, 2012-02-21 01:26:03+01:00, jnperlin@hydra.localnet
+ [bug 2143] discard data if quality indication not good to avoid glitches
+ add stat counters for diagnostics (mode bit enabled) to clockstats file
+
+ ChangeLog@1.1116.2.1 +2 -0
+ [bug 2143] discard data if quality indication not good to avoid glitches
+ add stat counters for diagnostics (mode bit enabled) to clockstats file
+
+ ntpd/refclock_nmea.c@1.65.1.1 +63 -12
+ [bug 2143] discard data if quality indication not good to avoid glitches
+ add stat counters for diagnostics (mode bit enabled) to clockstats file
+
+ChangeSet@1.2762.4.2, 2012-02-20 22:16:37+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2143] NMEA 4.2.7p204 uses timecodes indicating lost reception.
+ Increase detail in clockstats for NMEA driver (from Hal Murray).
+
+ ChangeLog@1.1116.1.1 +2 -0
+ [Bug 2143] NMEA 4.2.7p204 uses timecodes indicating lost reception.
+ Increase detail in clockstats for NMEA driver (from Hal Murray).
+
+ ntpd/refclock_nmea.c@1.67 +39 -6
+ Increase detail in clockstats for NMEA driver (from Hal Murray).
+
+
+ChangeSet@1.2762.1.10, 2012-02-19 16:30:28+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ fix user-mode PPS end of line timestamp, and use wait I/O
+ completion timestamp not read completion.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.65 +5 -2
+ fix user-mode PPS end of line timestamp, and use wait I/O
+ completion timestamp not read completion.
+
+ChangeSet@1.2762.5.1, 2012-02-19 16:06:38+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Minor nonfunctional refclock_nmea.c cleanup while hunting bug.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.62.1.1 +74 -54
+ Minor nonfunctional cleanup while hunting bug.
+
+ChangeSet@1.2762.1.8, 2012-02-19 16:10:00+01:00, jnperlin@hydra.localnet
+ hack to get rid of leading CR/LF and keep timestamp for the whole buffer
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.63 +16 -6
+ hack to get rid of leading CR/LF and keep timestamp for the whole buffer
+
+ChangeSet@1.2762.4.1, 2012-02-19 09:29:05+01:00, jnperlin@hydra.localnet
+ [bug 2143] do not process data if quality indication says 'not good' to avoid glitches
+
+ ntpd/refclock_nmea.c@1.66 +6 -1
+ [bug 2143] do not process data if quality indication says 'not good' to avoid glitches
+
+ChangeSet@1.2762.1.7, 2012-02-18 02:41:22+01:00, jnperlin@hydra.localnet
+ [Bug 2140] Rework of Windows I/O completion port handling to avoid garbling serial input in UNIX line discipline emulation.
+
+ ChangeLog@1.1117 +2 -0
+ [Bug 2140] Rework of Windows I/O completion port handling to avoid garbling serial input in UNIX line discipline emulation.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.62 +775 -598
+ [Bug 2140] Rework of Windows I/O completion port handling to avoid garbling serial input in UNIX line discipline emulation.
+
+ChangeSet@1.2762.1.6, 2012-02-17 05:52:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P257
+ TAG: NTP_4_2_7P257
+
+ ChangeLog@1.1116 +1 -0
+ NTP_4_2_7P257
+
+ ntpd/ntpd-opts.c@1.262 +4 -4
+ NTP_4_2_7P257
+
+ ntpd/ntpd-opts.h@1.262 +3 -3
+ NTP_4_2_7P257
+
+ ntpd/ntpd-opts.texi@1.260 +2 -2
+ NTP_4_2_7P257
+
+ ntpd/ntpd.1ntpdman@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpd/ntpd.1ntpdmdoc@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpd/ntpd.man.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpd/ntpd.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc-opts.c@1.257 +4 -4
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc-opts.h@1.257 +3 -3
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc-opts.texi@1.257 +2 -2
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc.1ntpdcman@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc.html@1.85 +2 -2
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc.man.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpdc/ntpdc.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpq/ntpq-opts.c@1.259 +4 -4
+ NTP_4_2_7P257
+
+ ntpq/ntpq-opts.h@1.259 +3 -3
+ NTP_4_2_7P257
+
+ ntpq/ntpq-opts.texi@1.259 +2 -2
+ NTP_4_2_7P257
+
+ ntpq/ntpq.1ntpqman@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpq/ntpq.1ntpqmdoc@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpq/ntpq.man.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpq/ntpq.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.259 +4 -4
+ NTP_4_2_7P257
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.259 +3 -3
+ NTP_4_2_7P257
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.259 +2 -2
+ NTP_4_2_7P257
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpsnmpd/ntpsnmpd.man.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ packageinfo.sh@1.260 +1 -1
+ NTP_4_2_7P257
+
+ scripts/ntp-wait-opts.texi@1.77 +1 -1
+ NTP_4_2_7P257
+
+ scripts/ntp-wait.1ntp-waitman@1.73 +2 -2
+ NTP_4_2_7P257
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.73 +2 -2
+ NTP_4_2_7P257
+
+ scripts/ntp-wait.html@1.77 +1 -1
+ NTP_4_2_7P257
+
+ scripts/ntp-wait.man.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ scripts/ntp-wait.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ sntp/sntp-opts.c@1.255 +4 -4
+ NTP_4_2_7P257
+
+ sntp/sntp-opts.h@1.255 +3 -3
+ NTP_4_2_7P257
+
+ sntp/sntp-opts.texi@1.255 +2 -2
+ NTP_4_2_7P257
+
+ sntp/sntp.1sntpman@1.75 +2 -2
+ NTP_4_2_7P257
+
+ sntp/sntp.1sntpmdoc@1.75 +2 -2
+ NTP_4_2_7P257
+
+ sntp/sntp.html@1.255 +2 -2
+ NTP_4_2_7P257
+
+ sntp/sntp.man.in@1.75 +2 -2
+ NTP_4_2_7P257
+
+ sntp/sntp.mdoc.in@1.75 +2 -2
+ NTP_4_2_7P257
+
+ util/ntp-keygen-opts.c@1.259 +4 -4
+ NTP_4_2_7P257
+
+ util/ntp-keygen-opts.h@1.259 +3 -3
+ NTP_4_2_7P257
+
+ util/ntp-keygen-opts.texi@1.260 +2 -2
+ NTP_4_2_7P257
+
+ util/ntp-keygen.1ntp-keygenman@1.73 +2 -2
+ NTP_4_2_7P257
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.73 +2 -2
+ NTP_4_2_7P257
+
+ util/ntp-keygen.man.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ util/ntp-keygen.mdoc.in@1.73 +2 -2
+ NTP_4_2_7P257
+
+ChangeSet@1.2762.1.5, 2012-02-15 02:48:49+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Restore accidentally-removed "parsetime" local variable declaration
+ in refclock_parse.c stream_receive().
+ Remove Windows-specific code from indicate_refclock_packet() as it is
+ now used only on non-Windows systems.
+ process_refclock_packet() is used only on Windows, #ifdef away elsewhere.
+
+ ntpd/ntp_refclock.c@1.114 +3 -3
+ Remove Windows-specific code from indicate_refclock_packet() as it is
+ now used only on non-Windows systems.
+ process_refclock_packet() is used only on Windows, #ifdef away elsewhere.
+
+
+ ntpd/refclock_parse.c@1.66 +1 -0
+ Restore accidentally-removed "parsetime" local variable declaration
+ in refclock_parse.c stream_receive().
+
+ChangeSet@1.2762.2.1, 2012-02-09 23:18:03+01:00, jnperlin@hydra.localnet
+ [Bug 2135] defer calls to 'io_input' to main thread under Windows
+
+ ChangeLog@1.1111.1.1 +1 -0
+ [Bug 2135] defer calls to 'io_input' to main thread under Windows
+
+ include/ntp_refclock.h@1.35 +1 -0
+ [Bug 2135] defer calls to 'io_input' to main thread under Windows
+ * add prototype for 'process_refclock_packet()'
+
+ ntpd/ntp_refclock.c@1.111.1.1 +65 -32
+ [Bug 2135] defer calls to 'io_input' to main thread under Windows
+ * implement 'process_refclock_packet()'
+ * cleanup 'refclock_gtlin()' and refclock_gtraw()'
+
+ ntpd/refclock_msfees.c@1.17 +2 -2
+ [Bug 2135] defer calls to 'io_input' to main thread under Windows
+ * fix 'io.srcclock' mangling -- this should be the peer. Use the unit ptr to get the unit.
+
+ ntpd/refclock_parse.c@1.65 +8 -5
+ [Bug 2135] defer calls to 'io_input' to main thread under Windows
+ * fix 'io.srcclock' mangling -- this should be the peer. Use the unit ptr to get the unit.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.61 +7 -14
+ [Bug 2135] defer calls to 'io_input' to main thread under Windows
+
+ChangeSet@1.2762.1.3, 2012-02-08 08:33:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P256
+ TAG: NTP_4_2_7P256
+
+ ChangeLog@1.1114 +1 -0
+ NTP_4_2_7P256
+
+ ntpd/ntpd-opts.c@1.261 +4 -4
+ NTP_4_2_7P256
+
+ ntpd/ntpd-opts.h@1.261 +3 -3
+ NTP_4_2_7P256
+
+ ntpd/ntpd-opts.texi@1.259 +2 -2
+ NTP_4_2_7P256
+
+ ntpd/ntpd.1ntpdman@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpd/ntpd.1ntpdmdoc@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpd/ntpd.man.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpd/ntpd.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc-opts.c@1.256 +4 -4
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc-opts.h@1.256 +3 -3
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc-opts.texi@1.256 +2 -2
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc.1ntpdcman@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc.html@1.84 +2 -2
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc.man.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpdc/ntpdc.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpq/ntpq-opts.c@1.258 +4 -4
+ NTP_4_2_7P256
+
+ ntpq/ntpq-opts.h@1.258 +3 -3
+ NTP_4_2_7P256
+
+ ntpq/ntpq-opts.texi@1.258 +2 -2
+ NTP_4_2_7P256
+
+ ntpq/ntpq.1ntpqman@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpq/ntpq.1ntpqmdoc@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpq/ntpq.man.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpq/ntpq.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.258 +4 -4
+ NTP_4_2_7P256
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.258 +3 -3
+ NTP_4_2_7P256
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.258 +2 -2
+ NTP_4_2_7P256
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpsnmpd/ntpsnmpd.man.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ packageinfo.sh@1.259 +1 -1
+ NTP_4_2_7P256
+
+ scripts/ntp-wait-opts.texi@1.76 +1 -1
+ NTP_4_2_7P256
+
+ scripts/ntp-wait.1ntp-waitman@1.72 +2 -2
+ NTP_4_2_7P256
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.72 +2 -2
+ NTP_4_2_7P256
+
+ scripts/ntp-wait.html@1.76 +1 -1
+ NTP_4_2_7P256
+
+ scripts/ntp-wait.man.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ scripts/ntp-wait.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ sntp/sntp-opts.c@1.254 +4 -4
+ NTP_4_2_7P256
+
+ sntp/sntp-opts.h@1.254 +3 -3
+ NTP_4_2_7P256
+
+ sntp/sntp-opts.texi@1.254 +2 -2
+ NTP_4_2_7P256
+
+ sntp/sntp.1sntpman@1.74 +2 -2
+ NTP_4_2_7P256
+
+ sntp/sntp.1sntpmdoc@1.74 +2 -2
+ NTP_4_2_7P256
+
+ sntp/sntp.html@1.254 +2 -2
+ NTP_4_2_7P256
+
+ sntp/sntp.man.in@1.74 +2 -2
+ NTP_4_2_7P256
+
+ sntp/sntp.mdoc.in@1.74 +2 -2
+ NTP_4_2_7P256
+
+ util/ntp-keygen-opts.c@1.258 +4 -4
+ NTP_4_2_7P256
+
+ util/ntp-keygen-opts.h@1.258 +3 -3
+ NTP_4_2_7P256
+
+ util/ntp-keygen-opts.texi@1.259 +2 -2
+ NTP_4_2_7P256
+
+ util/ntp-keygen.1ntp-keygenman@1.72 +2 -2
+ NTP_4_2_7P256
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.72 +2 -2
+ NTP_4_2_7P256
+
+ util/ntp-keygen.man.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ util/ntp-keygen.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P256
+
+ChangeSet@1.2762.1.2, 2012-02-08 07:25:26+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2131] Set the system variable settimeofday only after clock step.
+
+ ChangeLog@1.1113 +1 -0
+ [Bug 2131] Set the system variable settimeofday only after clock step.
+
+ ntpd/ntp_config.c@1.297 +0 -8
+ [Bug 2131] Set the system variable settimeofday only after clock step.
+
+ ntpd/ntp_refclock.c@1.112 +0 -1
+ Remove unused local from refclock_timer().
+
+ChangeSet@1.2762.1.1, 2012-02-08 02:33:45+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2134] --enable-C99-snprintf does not force rpl_snprintf use.
+
+ ChangeLog@1.1112 +1 -0
+ [Bug 2134] --enable-C99-snprintf does not force rpl_snprintf use.
+
+ sntp/m4/snprintf.m4@1.3 +4 -4
+ [Bug 2134] --enable-C99-snprintf does not force rpl_snprintf use.
+
+ChangeSet@1.2764, 2012-02-06 19:40:41+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/ag-tpl/texi2txt@1.2 +2 -4
+ cleanup
+
+ChangeSet@1.2763, 2012-02-06 06:04:15+00:00, stenn@psp-fb1.ntp.org
+ autogen translator updates
+
+ BitKeeper/deleted/02/mdoc2mdoc~efc40f7d5fb243b2@1.2 +0 -0
+ Delete: sntp/ag-tpl/mdoc2mdoc
+
+ BitKeeper/deleted/55/mdoc2man~beb9c4c088d95890@1.3 +0 -0
+ Delete: sntp/ag-tpl/mdoc2man
+
+ sntp/ag-tpl/texi2man@1.1 +63 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/ag-tpl/texi2man
+
+ sntp/ag-tpl/texi2man@1.0 +0 -0
+
+ sntp/ag-tpl/texi2mdoc@1.1 +182 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/ag-tpl/texi2mdoc
+
+ sntp/ag-tpl/texi2mdoc@1.0 +0 -0
+
+ sntp/ag-tpl/texi2plain@1.1 +62 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/ag-tpl/texi2plain
+
+ sntp/ag-tpl/texi2plain@1.0 +0 -0
+
+ sntp/ag-tpl/texi2txt@1.1 +81 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/ag-tpl/texi2txt
+
+ sntp/ag-tpl/texi2txt@1.0 +0 -0
+
+ChangeSet@1.2759.1.2, 2012-01-30 05:15:20+00:00, stenn@psp-fb1.ntp.org
+ Handle .5 in the mansec substitutions
+
+ sntp/scripts/mansec2subst.sed@1.3 +2 -0
+ Handle .5 in the mansec substitutions
+
+ChangeSet@1.2759.1.1, 2012-01-30 05:14:29+00:00, stenn@psp-fb1.ntp.org
+ Rules for ntp.conf.5 and ntp.keys.5
+
+ ntpd/Makefile.am@1.113 +62 -1
+ Rules for ntp.conf.5 and ntp.keys.5
+
+ChangeSet@1.2762, 2012-01-29 22:06:30+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P255
+ TAG: NTP_4_2_7P255
+
+ ChangeLog@1.1111 +1 -0
+ NTP_4_2_7P255
+
+ ntpd/ntpd-opts.c@1.260 +4 -4
+ NTP_4_2_7P255
+
+ ntpd/ntpd-opts.h@1.260 +3 -3
+ NTP_4_2_7P255
+
+ ntpd/ntpd-opts.texi@1.258 +2 -2
+ NTP_4_2_7P255
+
+ ntpd/ntpd.1ntpdman@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpd/ntpd.1ntpdmdoc@1.71 +1 -1
+ NTP_4_2_7P255
+
+ ntpd/ntpd.man.in@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpd/ntpd.mdoc.in@1.71 +1 -1
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc-opts.c@1.255 +4 -4
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc-opts.h@1.255 +3 -3
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc-opts.texi@1.255 +2 -2
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc.1ntpdcman@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.71 +1 -1
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc.html@1.83 +2 -2
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc.man.in@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpdc/ntpdc.mdoc.in@1.71 +1 -1
+ NTP_4_2_7P255
+
+ ntpq/ntpq-opts.c@1.257 +4 -4
+ NTP_4_2_7P255
+
+ ntpq/ntpq-opts.h@1.257 +3 -3
+ NTP_4_2_7P255
+
+ ntpq/ntpq-opts.texi@1.257 +2 -2
+ NTP_4_2_7P255
+
+ ntpq/ntpq.1ntpqman@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpq/ntpq.1ntpqmdoc@1.71 +1 -1
+ NTP_4_2_7P255
+
+ ntpq/ntpq.man.in@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpq/ntpq.mdoc.in@1.71 +1 -1
+ NTP_4_2_7P255
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.257 +4 -4
+ NTP_4_2_7P255
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.257 +3 -3
+ NTP_4_2_7P255
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.257 +2 -2
+ NTP_4_2_7P255
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.71 +1 -1
+ NTP_4_2_7P255
+
+ ntpsnmpd/ntpsnmpd.man.in@1.71 +2 -2
+ NTP_4_2_7P255
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.71 +1 -1
+ NTP_4_2_7P255
+
+ packageinfo.sh@1.258 +1 -1
+ NTP_4_2_7P255
+
+ scripts/ntp-wait-opts.texi@1.75 +1 -1
+ NTP_4_2_7P255
+
+ scripts/ntp-wait.1ntp-waitman@1.71 +2 -2
+ NTP_4_2_7P255
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.71 +1 -1
+ NTP_4_2_7P255
+
+ scripts/ntp-wait.html@1.75 +1 -1
+ NTP_4_2_7P255
+
+ scripts/ntp-wait.man.in@1.71 +2 -2
+ NTP_4_2_7P255
+
+ scripts/ntp-wait.mdoc.in@1.71 +1 -1
+ NTP_4_2_7P255
+
+ sntp/sntp-opts.c@1.253 +4 -4
+ NTP_4_2_7P255
+
+ sntp/sntp-opts.h@1.253 +3 -3
+ NTP_4_2_7P255
+
+ sntp/sntp-opts.texi@1.253 +2 -2
+ NTP_4_2_7P255
+
+ sntp/sntp.1sntpman@1.73 +2 -2
+ NTP_4_2_7P255
+
+ sntp/sntp.1sntpmdoc@1.73 +1 -1
+ NTP_4_2_7P255
+
+ sntp/sntp.html@1.253 +2 -2
+ NTP_4_2_7P255
+
+ sntp/sntp.man.in@1.73 +2 -2
+ NTP_4_2_7P255
+
+ sntp/sntp.mdoc.in@1.73 +1 -1
+ NTP_4_2_7P255
+
+ util/ntp-keygen-opts.c@1.257 +4 -4
+ NTP_4_2_7P255
+
+ util/ntp-keygen-opts.h@1.257 +3 -3
+ NTP_4_2_7P255
+
+ util/ntp-keygen-opts.texi@1.258 +2 -2
+ NTP_4_2_7P255
+
+ util/ntp-keygen.1ntp-keygenman@1.71 +2 -2
+ NTP_4_2_7P255
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.71 +1 -1
+ NTP_4_2_7P255
+
+ util/ntp-keygen.man.in@1.71 +2 -2
+ NTP_4_2_7P255
+
+ util/ntp-keygen.mdoc.in@1.71 +1 -1
+ NTP_4_2_7P255
+
+ChangeSet@1.2761, 2012-01-29 16:49:09-05:00, stenn@deacon.udel.edu
+ [Bug 603] Only link with nlist()-related libraries when needed: More cleanup
+
+ ChangeLog@1.1110 +2 -0
+ [Bug 603] Only link with nlist()-related libraries when needed: More cleanup
+
+ configure.ac@1.540 +6 -1
+ [Bug 603] Only link with nlist()-related libraries when needed: More cleanup
+
+ChangeSet@1.2760, 2012-01-29 07:02:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P254
+ TAG: NTP_4_2_7P254
+
+ ChangeLog@1.1109 +1 -0
+ NTP_4_2_7P254
+
+ ntpd/ntpd-opts.c@1.259 +4 -4
+ NTP_4_2_7P254
+
+ ntpd/ntpd-opts.h@1.259 +3 -3
+ NTP_4_2_7P254
+
+ ntpd/ntpd-opts.texi@1.257 +2 -2
+ NTP_4_2_7P254
+
+ ntpd/ntpd.1ntpdman@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpd/ntpd.1ntpdmdoc@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpd/ntpd.man.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpd/ntpd.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc-opts.c@1.254 +4 -4
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc-opts.h@1.254 +3 -3
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc-opts.texi@1.254 +2 -2
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc.1ntpdcman@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc.html@1.82 +2 -2
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc.man.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpdc/ntpdc.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpq/ntpq-opts.c@1.256 +4 -4
+ NTP_4_2_7P254
+
+ ntpq/ntpq-opts.h@1.256 +3 -3
+ NTP_4_2_7P254
+
+ ntpq/ntpq-opts.texi@1.256 +2 -2
+ NTP_4_2_7P254
+
+ ntpq/ntpq.1ntpqman@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpq/ntpq.1ntpqmdoc@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpq/ntpq.man.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpq/ntpq.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.256 +4 -4
+ NTP_4_2_7P254
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.256 +3 -3
+ NTP_4_2_7P254
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.256 +2 -2
+ NTP_4_2_7P254
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpsnmpd/ntpsnmpd.man.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ packageinfo.sh@1.257 +1 -1
+ NTP_4_2_7P254
+
+ scripts/ntp-wait-opts.texi@1.74 +1 -1
+ NTP_4_2_7P254
+
+ scripts/ntp-wait.1ntp-waitman@1.70 +2 -2
+ NTP_4_2_7P254
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.70 +2 -2
+ NTP_4_2_7P254
+
+ scripts/ntp-wait.html@1.74 +1 -1
+ NTP_4_2_7P254
+
+ scripts/ntp-wait.man.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ scripts/ntp-wait.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ sntp/sntp-opts.c@1.252 +4 -4
+ NTP_4_2_7P254
+
+ sntp/sntp-opts.h@1.252 +3 -3
+ NTP_4_2_7P254
+
+ sntp/sntp-opts.texi@1.252 +2 -2
+ NTP_4_2_7P254
+
+ sntp/sntp.1sntpman@1.72 +2 -2
+ NTP_4_2_7P254
+
+ sntp/sntp.1sntpmdoc@1.72 +2 -2
+ NTP_4_2_7P254
+
+ sntp/sntp.html@1.252 +2 -2
+ NTP_4_2_7P254
+
+ sntp/sntp.man.in@1.72 +2 -2
+ NTP_4_2_7P254
+
+ sntp/sntp.mdoc.in@1.72 +2 -2
+ NTP_4_2_7P254
+
+ util/ntp-keygen-opts.c@1.256 +4 -4
+ NTP_4_2_7P254
+
+ util/ntp-keygen-opts.h@1.256 +3 -3
+ NTP_4_2_7P254
+
+ util/ntp-keygen-opts.texi@1.257 +2 -2
+ NTP_4_2_7P254
+
+ util/ntp-keygen.1ntp-keygenman@1.70 +2 -2
+ NTP_4_2_7P254
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.70 +2 -2
+ NTP_4_2_7P254
+
+ util/ntp-keygen.man.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ util/ntp-keygen.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P254
+
+ChangeSet@1.2759, 2012-01-28 23:24:08+00:00, stenn@psp-fb1.ntp.org
+ Only link with nlist()-related libraries when needed
+
+ ChangeLog@1.1108 +1 -0
+ Only link with nlist()-related libraries when needed
+
+ configure.ac@1.539 +8 -5
+ Only link with nlist()-related libraries when needed
+
+ util/Makefile.am@1.69 +2 -0
+ Only link with nlist()-related libraries when needed
+
+ChangeSet@1.2758, 2012-01-26 06:05:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P253
+ TAG: NTP_4_2_7P253
+
+ ChangeLog@1.1107 +1 -0
+ NTP_4_2_7P253
+
+ ntpd/ntpd-opts.c@1.258 +251 -256
+ NTP_4_2_7P253
+
+ ntpd/ntpd-opts.h@1.258 +7 -7
+ NTP_4_2_7P253
+
+ ntpd/ntpd-opts.texi@1.256 +2 -2
+ NTP_4_2_7P253
+
+ ntpd/ntpd.1ntpdman@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpd/ntpd.1ntpdmdoc@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpd/ntpd.man.in@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpd/ntpd.mdoc.in@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc-opts.c@1.253 +120 -125
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc-opts.h@1.253 +7 -7
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc-opts.texi@1.253 +2 -2
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc.1ntpdcman@1.69 +3 -3
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.69 +3 -3
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc.html@1.81 +2 -2
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc.man.in@1.69 +3 -3
+ NTP_4_2_7P253
+
+ ntpdc/ntpdc.mdoc.in@1.69 +3 -3
+ NTP_4_2_7P253
+
+ ntpq/ntpq-opts.c@1.255 +111 -116
+ NTP_4_2_7P253
+
+ ntpq/ntpq-opts.h@1.255 +7 -7
+ NTP_4_2_7P253
+
+ ntpq/ntpq-opts.texi@1.255 +2 -2
+ NTP_4_2_7P253
+
+ ntpq/ntpq.1ntpqman@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpq/ntpq.1ntpqmdoc@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpq/ntpq.man.in@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpq/ntpq.mdoc.in@1.69 +4 -4
+ NTP_4_2_7P253
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.255 +81 -86
+ NTP_4_2_7P253
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.255 +7 -7
+ NTP_4_2_7P253
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.255 +2 -2
+ NTP_4_2_7P253
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.69 +3 -3
+ NTP_4_2_7P253
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.69 +3 -3
+ NTP_4_2_7P253
+
+ ntpsnmpd/ntpsnmpd.man.in@1.69 +3 -3
+ NTP_4_2_7P253
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.69 +3 -3
+ NTP_4_2_7P253
+
+ packageinfo.sh@1.256 +1 -1
+ NTP_4_2_7P253
+
+ scripts/ntp-wait-opts.texi@1.73 +1 -1
+ NTP_4_2_7P253
+
+ scripts/ntp-wait.1ntp-waitman@1.69 +3 -3
+ NTP_4_2_7P253
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.69 +3 -3
+ NTP_4_2_7P253
+
+ scripts/ntp-wait.html@1.73 +1 -1
+ NTP_4_2_7P253
+
+ scripts/ntp-wait.man.in@1.69 +3 -3
+ NTP_4_2_7P253
+
+ scripts/ntp-wait.mdoc.in@1.69 +3 -3
+ NTP_4_2_7P253
+
+ sntp/sntp-opts.c@1.251 +178 -183
+ NTP_4_2_7P253
+
+ sntp/sntp-opts.h@1.251 +7 -7
+ NTP_4_2_7P253
+
+ sntp/sntp-opts.texi@1.251 +2 -2
+ NTP_4_2_7P253
+
+ sntp/sntp.1sntpman@1.71 +3 -3
+ NTP_4_2_7P253
+
+ sntp/sntp.1sntpmdoc@1.71 +3 -3
+ NTP_4_2_7P253
+
+ sntp/sntp.html@1.251 +2 -2
+ NTP_4_2_7P253
+
+ sntp/sntp.man.in@1.71 +3 -3
+ NTP_4_2_7P253
+
+ sntp/sntp.mdoc.in@1.71 +3 -3
+ NTP_4_2_7P253
+
+ util/ntp-keygen-opts.c@1.255 +180 -185
+ NTP_4_2_7P253
+
+ util/ntp-keygen-opts.h@1.255 +7 -7
+ NTP_4_2_7P253
+
+ util/ntp-keygen-opts.texi@1.256 +2 -2
+ NTP_4_2_7P253
+
+ util/ntp-keygen.1ntp-keygenman@1.69 +4 -4
+ NTP_4_2_7P253
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.69 +4 -4
+ NTP_4_2_7P253
+
+ util/ntp-keygen.man.in@1.69 +4 -4
+ NTP_4_2_7P253
+
+ util/ntp-keygen.mdoc.in@1.69 +4 -4
+ NTP_4_2_7P253
+
+ChangeSet@1.2757, 2012-01-25 23:01:37-05:00, stenn@deacon.udel.edu
+ Update a license URL
+
+ ChangeLog@1.1106 +1 -0
+ Update a license URL
+
+ sntp/include/ntp.lic@1.6 +1 -1
+ Update a license URL
+
+ChangeSet@1.2756, 2012-01-26 03:33:12+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Override --version output without the ugly hack previously used,
+ as Autogen 5.13 and later provide version-proc = override in .def.
+
+ include/ntp_libopts.h@1.2 +1 -0
+ Override --version output without the ugly hack previously used,
+ as Autogen 5.13 and later provide version-proc = override in .def.
+
+ libntp/ntp_libopts.c@1.5 +28 -30
+ Override --version output without the ugly hack previously used,
+ as Autogen 5.13 and later provide version-proc = override in .def.
+
+ sntp/include/copyright.def@1.20 +2 -1
+ Override --version output without the ugly hack previously used,
+ as Autogen 5.13 and later provide version-proc = override in .def.
+ Change owner = to match copyright.html.
+
+ChangeSet@1.2755, 2012-01-26 01:44:08+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2126] Compile error on Windows with libopts from Autogen 5.14.
+
+ ChangeLog@1.1105 +1 -0
+ [Bug 2126] Compile error on Windows with libopts from Autogen 5.14.
+
+ sntp/libopts/text_mmap.c@1.9 +6 -2
+ [Bug 2126] Compile error on Windows with libopts from Autogen 5.14.
+ Patch provided by Bruce Korb based on pending Autogen changes.
+
+ChangeSet@1.2754, 2012-01-25 12:05:43+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P252
+ TAG: NTP_4_2_7P252
+
+ ChangeLog@1.1104 +1 -0
+ NTP_4_2_7P252
+
+ ntpd/ntpd-opts.c@1.257 +516 -442
+ NTP_4_2_7P252
+
+ ntpd/ntpd-opts.h@1.257 +11 -10
+ NTP_4_2_7P252
+
+ ntpd/ntpd-opts.texi@1.255 +3 -3
+ NTP_4_2_7P252
+
+ ntpd/ntpd.1ntpdman@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpd/ntpd.1ntpdmdoc@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpd/ntpd.man.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpd/ntpd.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc-opts.c@1.252 +255 -219
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc-opts.h@1.252 +11 -9
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc-opts.texi@1.252 +3 -3
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc.1ntpdcman@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc.html@1.80 +3 -3
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc.man.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpdc/ntpdc.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpq/ntpq-opts.c@1.254 +244 -207
+ NTP_4_2_7P252
+
+ ntpq/ntpq-opts.h@1.254 +11 -9
+ NTP_4_2_7P252
+
+ ntpq/ntpq-opts.texi@1.254 +3 -3
+ NTP_4_2_7P252
+
+ ntpq/ntpq.1ntpqman@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpq/ntpq.1ntpqmdoc@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpq/ntpq.man.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpq/ntpq.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.254 +164 -132
+ NTP_4_2_7P252
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.254 +11 -9
+ NTP_4_2_7P252
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.254 +3 -3
+ NTP_4_2_7P252
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpsnmpd/ntpsnmpd.man.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ packageinfo.sh@1.255 +1 -1
+ NTP_4_2_7P252
+
+ scripts/ntp-wait-opts.texi@1.72 +2 -2
+ NTP_4_2_7P252
+
+ scripts/ntp-wait.1ntp-waitman@1.68 +2 -2
+ NTP_4_2_7P252
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.68 +2 -2
+ NTP_4_2_7P252
+
+ scripts/ntp-wait.html@1.72 +2 -2
+ NTP_4_2_7P252
+
+ scripts/ntp-wait.man.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ scripts/ntp-wait.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ sntp/sntp-opts.c@1.250 +366 -305
+ NTP_4_2_7P252
+
+ sntp/sntp-opts.h@1.250 +11 -9
+ NTP_4_2_7P252
+
+ sntp/sntp-opts.texi@1.250 +3 -3
+ NTP_4_2_7P252
+
+ sntp/sntp.1sntpman@1.70 +2 -2
+ NTP_4_2_7P252
+
+ sntp/sntp.1sntpmdoc@1.70 +2 -2
+ NTP_4_2_7P252
+
+ sntp/sntp.html@1.250 +3 -3
+ NTP_4_2_7P252
+
+ sntp/sntp.man.in@1.70 +2 -2
+ NTP_4_2_7P252
+
+ sntp/sntp.mdoc.in@1.70 +2 -2
+ NTP_4_2_7P252
+
+ util/ntp-keygen-opts.c@1.254 +451 -387
+ NTP_4_2_7P252
+
+ util/ntp-keygen-opts.h@1.254 +11 -13
+ NTP_4_2_7P252
+
+ util/ntp-keygen-opts.texi@1.255 +3 -3
+ NTP_4_2_7P252
+
+ util/ntp-keygen.1ntp-keygenman@1.68 +2 -2
+ NTP_4_2_7P252
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.68 +2 -2
+ NTP_4_2_7P252
+
+ util/ntp-keygen.man.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ util/ntp-keygen.mdoc.in@1.68 +2 -2
+ NTP_4_2_7P252
+
+ChangeSet@1.2753, 2012-01-25 09:54:11+00:00, stenn@psp-fb1.ntp.org
+ Upgrade to autogen-5.14 (and libopts-36.1.11)
+
+ BitKeeper/deleted/94/enumeration.c~263a95e02049b99c@1.9 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/97/environment.c~444322456d6044d7@1.11 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ ChangeLog@1.1103 +1 -0
+ Upgrade to autogen-5.14 (and libopts-36.1.11)
+
+ sntp/include/autogen-version.def@1.9 +1 -1
+ Upgrade to autogen 5.14
+
+ sntp/libopts/Makefile.am@1.11 +16 -15
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/ag-char-map.h@1.14 +3 -3
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/autoopts.c@1.11 +48 -515
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/autoopts/options.h@1.13 +47 -37
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/autoopts/usage-txt.h@1.13 +324 -312
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/check.c@1.1 +164 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/libopts/check.c
+
+ sntp/libopts/check.c@1.0 +0 -0
+
+ sntp/libopts/configfile.c@1.12 +35 -25
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/enum.c@1.1 +522 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/libopts/enum.c
+
+ sntp/libopts/enum.c@1.0 +0 -0
+
+ sntp/libopts/env.c@1.1 +259 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/libopts/env.c
+
+ sntp/libopts/env.c@1.0 +0 -0
+
+ sntp/libopts/file.c@1.9 +129 -94
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/find.c@1.1 +568 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/libopts/find.c
+
+ sntp/libopts/find.c@1.0 +0 -0
+
+ sntp/libopts/genshell.c@1.14 +140 -114
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/genshell.h@1.14 +29 -24
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/libopts.c@1.4 +4 -2
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/load.c@1.10 +15 -16
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/m4/libopts.m4@1.17 +4 -4
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/proto.h@1.14 +35 -14
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/reset.c@1.8 +3 -3
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/sort.c@1.8 +5 -5
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/text_mmap.c@1.8 +231 -248
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/usage.c@1.9 +220 -62
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/value-type.h@1.14 +1 -1
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/version.c@1.9 +14 -7
+ Upgrade to libopts-36.1.11
+
+ sntp/libopts/xat-attribute.h@1.14 +1 -1
+ Upgrade to libopts-36.1.11
+
+ChangeSet@1.2752, 2012-01-17 11:36:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P251
+ TAG: NTP_4_2_7P251
+
+ ChangeLog@1.1102 +1 -0
+ NTP_4_2_7P251
+
+ ntpd/ntpd-opts.c@1.256 +3 -3
+ NTP_4_2_7P251
+
+ ntpd/ntpd-opts.h@1.256 +3 -3
+ NTP_4_2_7P251
+
+ ntpd/ntpd-opts.texi@1.254 +2 -2
+ NTP_4_2_7P251
+
+ ntpd/ntpd.1ntpdman@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpd/ntpd.1ntpdmdoc@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpd/ntpd.man.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpd/ntpd.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc-opts.c@1.251 +3 -3
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc-opts.h@1.251 +3 -3
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc-opts.texi@1.251 +2 -2
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc.1ntpdcman@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc.html@1.79 +2 -2
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc.man.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpdc/ntpdc.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpq/ntpq-opts.c@1.253 +3 -3
+ NTP_4_2_7P251
+
+ ntpq/ntpq-opts.h@1.253 +3 -3
+ NTP_4_2_7P251
+
+ ntpq/ntpq-opts.texi@1.253 +2 -2
+ NTP_4_2_7P251
+
+ ntpq/ntpq.1ntpqman@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpq/ntpq.1ntpqmdoc@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpq/ntpq.man.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpq/ntpq.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.253 +3 -3
+ NTP_4_2_7P251
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.253 +3 -3
+ NTP_4_2_7P251
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.253 +2 -2
+ NTP_4_2_7P251
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpsnmpd/ntpsnmpd.man.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ packageinfo.sh@1.254 +1 -1
+ NTP_4_2_7P251
+
+ scripts/ntp-wait-opts.texi@1.71 +1 -1
+ NTP_4_2_7P251
+
+ scripts/ntp-wait.1ntp-waitman@1.67 +2 -2
+ NTP_4_2_7P251
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.67 +2 -2
+ NTP_4_2_7P251
+
+ scripts/ntp-wait.html@1.71 +1 -1
+ NTP_4_2_7P251
+
+ scripts/ntp-wait.man.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ scripts/ntp-wait.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ sntp/sntp-opts.c@1.249 +3 -3
+ NTP_4_2_7P251
+
+ sntp/sntp-opts.h@1.249 +3 -3
+ NTP_4_2_7P251
+
+ sntp/sntp-opts.texi@1.249 +2 -2
+ NTP_4_2_7P251
+
+ sntp/sntp.1sntpman@1.69 +2 -2
+ NTP_4_2_7P251
+
+ sntp/sntp.1sntpmdoc@1.69 +2 -2
+ NTP_4_2_7P251
+
+ sntp/sntp.html@1.249 +2 -2
+ NTP_4_2_7P251
+
+ sntp/sntp.man.in@1.69 +2 -2
+ NTP_4_2_7P251
+
+ sntp/sntp.mdoc.in@1.69 +2 -2
+ NTP_4_2_7P251
+
+ util/ntp-keygen-opts.c@1.253 +3 -3
+ NTP_4_2_7P251
+
+ util/ntp-keygen-opts.h@1.253 +3 -3
+ NTP_4_2_7P251
+
+ util/ntp-keygen-opts.texi@1.254 +2 -2
+ NTP_4_2_7P251
+
+ util/ntp-keygen.1ntp-keygenman@1.67 +2 -2
+ NTP_4_2_7P251
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.67 +2 -2
+ NTP_4_2_7P251
+
+ util/ntp-keygen.man.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ util/ntp-keygen.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P251
+
+ChangeSet@1.2751, 2012-01-17 00:59:47+00:00, stenn@psp-fb1.ntp.org
+ [Bug 2115] ntptrace should accept both rootdispersion and rootdisp
+
+ ChangeLog@1.1101 +1 -0
+ [Bug 2115] ntptrace should accept both rootdispersion and rootdisp
+
+ scripts/ntptrace.in@1.8 +2 -1
+ [Bug 2115] ntptrace should accept both rootdispersion and rootdisp
+
+ChangeSet@1.2750, 2012-01-15 11:37:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P250
+ TAG: NTP_4_2_7P250
+
+ ChangeLog@1.1100 +1 -0
+ NTP_4_2_7P250
+
+ ntpd/ntpd-opts.c@1.255 +5 -5
+ NTP_4_2_7P250
+
+ ntpd/ntpd-opts.h@1.255 +4 -4
+ NTP_4_2_7P250
+
+ ntpd/ntpd-opts.texi@1.253 +2 -2
+ NTP_4_2_7P250
+
+ ntpd/ntpd.1ntpdman@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpd/ntpd.1ntpdmdoc@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpd/ntpd.man.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpd/ntpd.mdoc.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc-opts.c@1.250 +5 -5
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc-opts.h@1.250 +4 -4
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc-opts.texi@1.250 +2 -2
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc.1ntpdcman@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc.html@1.78 +2 -2
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc.man.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpdc/ntpdc.mdoc.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpq/ntpq-opts.c@1.252 +5 -5
+ NTP_4_2_7P250
+
+ ntpq/ntpq-opts.h@1.252 +4 -4
+ NTP_4_2_7P250
+
+ ntpq/ntpq-opts.texi@1.252 +2 -2
+ NTP_4_2_7P250
+
+ ntpq/ntpq.1ntpqman@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpq/ntpq.1ntpqmdoc@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpq/ntpq.man.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpq/ntpq.mdoc.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.252 +5 -5
+ NTP_4_2_7P250
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.252 +4 -4
+ NTP_4_2_7P250
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.252 +2 -2
+ NTP_4_2_7P250
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpsnmpd/ntpsnmpd.man.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ packageinfo.sh@1.253 +1 -1
+ NTP_4_2_7P250
+
+ scripts/ntp-wait-opts.texi@1.70 +1 -1
+ NTP_4_2_7P250
+
+ scripts/ntp-wait.1ntp-waitman@1.66 +3 -3
+ NTP_4_2_7P250
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.66 +3 -3
+ NTP_4_2_7P250
+
+ scripts/ntp-wait.html@1.70 +1 -1
+ NTP_4_2_7P250
+
+ scripts/ntp-wait.man.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ scripts/ntp-wait.mdoc.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ sntp/sntp-opts.c@1.248 +5 -5
+ NTP_4_2_7P250
+
+ sntp/sntp-opts.h@1.248 +4 -4
+ NTP_4_2_7P250
+
+ sntp/sntp-opts.texi@1.248 +2 -2
+ NTP_4_2_7P250
+
+ sntp/sntp.1sntpman@1.68 +3 -3
+ NTP_4_2_7P250
+
+ sntp/sntp.1sntpmdoc@1.68 +3 -3
+ NTP_4_2_7P250
+
+ sntp/sntp.html@1.248 +2 -2
+ NTP_4_2_7P250
+
+ sntp/sntp.man.in@1.68 +3 -3
+ NTP_4_2_7P250
+
+ sntp/sntp.mdoc.in@1.68 +3 -3
+ NTP_4_2_7P250
+
+ util/ntp-keygen-opts.c@1.252 +5 -5
+ NTP_4_2_7P250
+
+ util/ntp-keygen-opts.h@1.252 +4 -4
+ NTP_4_2_7P250
+
+ util/ntp-keygen-opts.texi@1.253 +2 -2
+ NTP_4_2_7P250
+
+ util/ntp-keygen.1ntp-keygenman@1.66 +3 -3
+ NTP_4_2_7P250
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.66 +3 -3
+ NTP_4_2_7P250
+
+ util/ntp-keygen.man.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ util/ntp-keygen.mdoc.in@1.66 +3 -3
+ NTP_4_2_7P250
+
+ChangeSet@1.2749, 2012-01-14 21:57:29+00:00, stenn@psp-fb1.ntp.org
+ Update the copyright year
+
+ ChangeLog@1.1099 +1 -0
+ Update the copyright year
+
+ html/copyright.html@1.59 +1 -1
+ Update the copyright year
+
+ sntp/include/copyright.def@1.19 +1 -1
+ Update the copyright year
+
+ChangeSet@1.2748, 2012-01-13 00:20:30-08:00, harlan@hms-mbp.local
+ [Bug 2113] Warn about ignored extra args in ntpq
+
+ ChangeLog@1.1098 +1 -0
+ [Bug 2113] Warn about ignored extra args in ntpq
+
+ ntpq/ntpq.c@1.144 +36 -29
+ [Bug 2113] Warn about ignored extra args in ntpq
+
+ChangeSet@1.2747, 2012-01-10 06:49:35+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P249
+ TAG: NTP_4_2_7P249
+
+ ChangeLog@1.1097 +1 -0
+ NTP_4_2_7P249
+
+ ntpd/ntpd-opts.c@1.254 +3 -3
+ NTP_4_2_7P249
+
+ ntpd/ntpd-opts.h@1.254 +3 -3
+ NTP_4_2_7P249
+
+ ntpd/ntpd-opts.texi@1.252 +2 -2
+ NTP_4_2_7P249
+
+ ntpd/ntpd.1ntpdman@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpd/ntpd.1ntpdmdoc@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpd/ntpd.man.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpd/ntpd.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc-opts.c@1.249 +3 -3
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc-opts.h@1.249 +3 -3
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc-opts.texi@1.249 +2 -2
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc.1ntpdcman@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc.html@1.77 +2 -2
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc.man.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpdc/ntpdc.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpq/ntpq-opts.c@1.251 +3 -3
+ NTP_4_2_7P249
+
+ ntpq/ntpq-opts.h@1.251 +3 -3
+ NTP_4_2_7P249
+
+ ntpq/ntpq-opts.texi@1.251 +2 -2
+ NTP_4_2_7P249
+
+ ntpq/ntpq.1ntpqman@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpq/ntpq.1ntpqmdoc@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpq/ntpq.man.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpq/ntpq.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.251 +3 -3
+ NTP_4_2_7P249
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.251 +3 -3
+ NTP_4_2_7P249
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.251 +2 -2
+ NTP_4_2_7P249
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpsnmpd/ntpsnmpd.man.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ packageinfo.sh@1.252 +1 -1
+ NTP_4_2_7P249
+
+ scripts/ntp-wait-opts.texi@1.69 +1 -1
+ NTP_4_2_7P249
+
+ scripts/ntp-wait.1ntp-waitman@1.65 +2 -2
+ NTP_4_2_7P249
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.65 +2 -2
+ NTP_4_2_7P249
+
+ scripts/ntp-wait.html@1.69 +1 -1
+ NTP_4_2_7P249
+
+ scripts/ntp-wait.man.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ scripts/ntp-wait.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ sntp/sntp-opts.c@1.247 +3 -3
+ NTP_4_2_7P249
+
+ sntp/sntp-opts.h@1.247 +3 -3
+ NTP_4_2_7P249
+
+ sntp/sntp-opts.texi@1.247 +2 -2
+ NTP_4_2_7P249
+
+ sntp/sntp.1sntpman@1.67 +2 -2
+ NTP_4_2_7P249
+
+ sntp/sntp.1sntpmdoc@1.67 +2 -2
+ NTP_4_2_7P249
+
+ sntp/sntp.html@1.247 +2 -2
+ NTP_4_2_7P249
+
+ sntp/sntp.man.in@1.67 +2 -2
+ NTP_4_2_7P249
+
+ sntp/sntp.mdoc.in@1.67 +2 -2
+ NTP_4_2_7P249
+
+ util/ntp-keygen-opts.c@1.251 +3 -3
+ NTP_4_2_7P249
+
+ util/ntp-keygen-opts.h@1.251 +3 -3
+ NTP_4_2_7P249
+
+ util/ntp-keygen-opts.texi@1.252 +2 -2
+ NTP_4_2_7P249
+
+ util/ntp-keygen.1ntp-keygenman@1.65 +2 -2
+ NTP_4_2_7P249
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.65 +2 -2
+ NTP_4_2_7P249
+
+ util/ntp-keygen.man.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ util/ntp-keygen.mdoc.in@1.65 +2 -2
+ NTP_4_2_7P249
+
+ChangeSet@1.2746, 2012-01-10 05:24:10+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2111] Remove minpoll delay before iburst for pool and
+ manycastclient.
+
+ ChangeLog@1.1096 +2 -0
+ [Bug 2111] Remove minpoll delay before iburst for pool and
+ manycastclient.
+
+ ntpd/ntp_proto.c@1.339 +30 -46
+ [Bug 2111] Remove minpoll delay before iburst for pool and
+ manycastclient.
+
+ChangeSet@1.2745, 2012-01-10 04:55:48+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ ChangeLog@1.1095 +4 -0
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ include/ntp.h@1.203 +1 -3
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ include/ntp_refclock.h@1.34 +4 -1
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ ntpd/ntp_peer.c@1.152 +2 -3
+ use TRUE and comment typo
+
+ ntpd/ntp_refclock.c@1.111 +12 -8
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ ntpd/ntp_timer.c@1.67 +0 -2
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ ntpd/refclock_arc.c@1.29 +3 -3
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ ntpd/refclock_parse.c@1.64 +10 -10
+ Move refclock-specific scheduled timer code under #ifdef REFCLOCK
+ and move "action" and "nextaction" data for same from struct peer to
+ struct refclockproc. These provide a way to schedule a callback some
+ seconds in the future.
+
+ChangeSet@1.2744, 2012-01-08 23:14:53+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P248
+ TAG: NTP_4_2_7P248
+
+ ChangeLog@1.1094 +1 -0
+ NTP_4_2_7P248
+
+ ntpd/ntpd-opts.c@1.253 +3 -3
+ NTP_4_2_7P248
+
+ ntpd/ntpd-opts.h@1.253 +3 -3
+ NTP_4_2_7P248
+
+ ntpd/ntpd-opts.texi@1.251 +2 -2
+ NTP_4_2_7P248
+
+ ntpd/ntpd.1ntpdman@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpd/ntpd.1ntpdmdoc@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpd/ntpd.man.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpd/ntpd.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc-opts.c@1.248 +3 -3
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc-opts.h@1.248 +3 -3
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc-opts.texi@1.248 +2 -2
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc.1ntpdcman@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc.html@1.76 +2 -2
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc.man.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpdc/ntpdc.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpq/ntpq-opts.c@1.250 +3 -3
+ NTP_4_2_7P248
+
+ ntpq/ntpq-opts.h@1.250 +3 -3
+ NTP_4_2_7P248
+
+ ntpq/ntpq-opts.texi@1.250 +2 -2
+ NTP_4_2_7P248
+
+ ntpq/ntpq.1ntpqman@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpq/ntpq.1ntpqmdoc@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpq/ntpq.man.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpq/ntpq.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.250 +3 -3
+ NTP_4_2_7P248
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.250 +3 -3
+ NTP_4_2_7P248
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.250 +2 -2
+ NTP_4_2_7P248
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpsnmpd/ntpsnmpd.man.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ packageinfo.sh@1.251 +1 -1
+ NTP_4_2_7P248
+
+ scripts/ntp-wait-opts.texi@1.68 +1 -1
+ NTP_4_2_7P248
+
+ scripts/ntp-wait.1ntp-waitman@1.64 +2 -2
+ NTP_4_2_7P248
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.64 +2 -2
+ NTP_4_2_7P248
+
+ scripts/ntp-wait.html@1.68 +1 -1
+ NTP_4_2_7P248
+
+ scripts/ntp-wait.man.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ scripts/ntp-wait.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ sntp/sntp-opts.c@1.246 +3 -3
+ NTP_4_2_7P248
+
+ sntp/sntp-opts.h@1.246 +3 -3
+ NTP_4_2_7P248
+
+ sntp/sntp-opts.texi@1.246 +2 -2
+ NTP_4_2_7P248
+
+ sntp/sntp.1sntpman@1.66 +2 -2
+ NTP_4_2_7P248
+
+ sntp/sntp.1sntpmdoc@1.66 +2 -2
+ NTP_4_2_7P248
+
+ sntp/sntp.html@1.246 +2 -2
+ NTP_4_2_7P248
+
+ sntp/sntp.man.in@1.66 +2 -2
+ NTP_4_2_7P248
+
+ sntp/sntp.mdoc.in@1.66 +2 -2
+ NTP_4_2_7P248
+
+ util/ntp-keygen-opts.c@1.250 +3 -3
+ NTP_4_2_7P248
+
+ util/ntp-keygen-opts.h@1.250 +3 -3
+ NTP_4_2_7P248
+
+ util/ntp-keygen-opts.texi@1.251 +2 -2
+ NTP_4_2_7P248
+
+ util/ntp-keygen.1ntp-keygenman@1.64 +2 -2
+ NTP_4_2_7P248
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.64 +2 -2
+ NTP_4_2_7P248
+
+ util/ntp-keygen.man.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ util/ntp-keygen.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P248
+
+ChangeSet@1.2743, 2012-01-08 12:02:32+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2109] "make clean check" is broken with gtest available.
+ [Bug 2110] systime.c typo breaks build on microsecond clocks.
+ Use $(MAKE) $(AM_MAKEFLAGS) for submakes.
+
+ ChangeLog@1.1093 +2 -0
+ [Bug 2109] "make clean check" is broken with gtest available.
+ [Bug 2110] systime.c typo breaks build on microsecond clocks.
+
+ Makefile.am@1.115 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ check-libopts.mf@1.2 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ depsver.mf@1.4 +2 -2
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ libntp/systime.c@1.63 +1 -1
+ [Bug 2110] systime.c typo breaks build on microsecond clocks.
+
+ ntpd/Makefile.am@1.112 +4 -4
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ ntpdate/Makefile.am@1.33 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ ntpdc/Makefile.am@1.69 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ ntpq/Makefile.am@1.65 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ sntp/Makefile.am@1.70 +31 -24
+ [Bug 2109] "make clean check" is broken with gtest available.
+
+ sntp/check-libntp.mf@1.2 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ sntp/check-libopts.mf@1.2 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ sntp/include/Makefile.am@1.5 +2 -2
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ sntp/main.c@1.81 +3 -3
+ Pass version string to sntp_main() as arg instead of global to remove main.o dependency on version.o for libsntp.a.
+
+ sntp/main.h@1.7 +1 -1
+ Pass version string to sntp_main() as arg instead of global to remove main.o dependency on version.o for libsntp.a.
+
+ sntp/sntp.c@1.4 +1 -1
+ Pass version string to sntp_main() as arg instead of global to remove main.o dependency on version.o for libsntp.a.
+
+ sntp/tests/Makefile.am@1.26 +13 -15
+ [Bug 2109] "make clean check" is broken with gtest available.
+
+ sntp/tests/utilities.cpp@1.8 +1 -0
+ Provide stub Version string for libntp.a/ntp_libopts.o
+
+ tests/libntp/Makefile.am@1.38 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ util/Makefile.am@1.68 +1 -1
+ use $(MAKE) $(AM_MAKEFLAGS) for submakes
+
+ChangeSet@1.2742, 2012-01-07 01:05:31+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P247
+ TAG: NTP_4_2_7P247
+
+ ChangeLog@1.1092 +1 -0
+ NTP_4_2_7P247
+
+ ntpd/ntpd-opts.c@1.252 +3 -3
+ NTP_4_2_7P247
+
+ ntpd/ntpd-opts.h@1.252 +3 -3
+ NTP_4_2_7P247
+
+ ntpd/ntpd-opts.texi@1.250 +2 -2
+ NTP_4_2_7P247
+
+ ntpd/ntpd.1ntpdman@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpd/ntpd.1ntpdmdoc@1.63 +1 -1
+ NTP_4_2_7P247
+
+ ntpd/ntpd.man.in@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpd/ntpd.mdoc.in@1.63 +1 -1
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc-opts.c@1.247 +3 -3
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc-opts.h@1.247 +3 -3
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc-opts.texi@1.247 +2 -2
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc.1ntpdcman@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.63 +1 -1
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc.html@1.75 +2 -2
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc.man.in@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpdc/ntpdc.mdoc.in@1.63 +1 -1
+ NTP_4_2_7P247
+
+ ntpq/ntpq-opts.c@1.249 +3 -3
+ NTP_4_2_7P247
+
+ ntpq/ntpq-opts.h@1.249 +3 -3
+ NTP_4_2_7P247
+
+ ntpq/ntpq-opts.texi@1.249 +2 -2
+ NTP_4_2_7P247
+
+ ntpq/ntpq.1ntpqman@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpq/ntpq.1ntpqmdoc@1.63 +1 -1
+ NTP_4_2_7P247
+
+ ntpq/ntpq.man.in@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpq/ntpq.mdoc.in@1.63 +1 -1
+ NTP_4_2_7P247
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.249 +3 -3
+ NTP_4_2_7P247
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.249 +3 -3
+ NTP_4_2_7P247
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.249 +2 -2
+ NTP_4_2_7P247
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.63 +1 -1
+ NTP_4_2_7P247
+
+ ntpsnmpd/ntpsnmpd.man.in@1.63 +2 -2
+ NTP_4_2_7P247
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.63 +1 -1
+ NTP_4_2_7P247
+
+ packageinfo.sh@1.250 +1 -1
+ NTP_4_2_7P247
+
+ scripts/ntp-wait-opts.texi@1.67 +1 -1
+ NTP_4_2_7P247
+
+ scripts/ntp-wait.1ntp-waitman@1.63 +2 -2
+ NTP_4_2_7P247
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.63 +1 -1
+ NTP_4_2_7P247
+
+ scripts/ntp-wait.html@1.67 +1 -1
+ NTP_4_2_7P247
+
+ scripts/ntp-wait.man.in@1.63 +2 -2
+ NTP_4_2_7P247
+
+ scripts/ntp-wait.mdoc.in@1.63 +1 -1
+ NTP_4_2_7P247
+
+ sntp/sntp-opts.c@1.245 +3 -3
+ NTP_4_2_7P247
+
+ sntp/sntp-opts.h@1.245 +3 -3
+ NTP_4_2_7P247
+
+ sntp/sntp-opts.texi@1.245 +2 -2
+ NTP_4_2_7P247
+
+ sntp/sntp.1sntpman@1.65 +2 -2
+ NTP_4_2_7P247
+
+ sntp/sntp.1sntpmdoc@1.65 +1 -1
+ NTP_4_2_7P247
+
+ sntp/sntp.html@1.245 +2 -2
+ NTP_4_2_7P247
+
+ sntp/sntp.man.in@1.65 +2 -2
+ NTP_4_2_7P247
+
+ sntp/sntp.mdoc.in@1.65 +1 -1
+ NTP_4_2_7P247
+
+ util/ntp-keygen-opts.c@1.249 +3 -3
+ NTP_4_2_7P247
+
+ util/ntp-keygen-opts.h@1.249 +3 -3
+ NTP_4_2_7P247
+
+ util/ntp-keygen-opts.texi@1.250 +2 -2
+ NTP_4_2_7P247
+
+ util/ntp-keygen.1ntp-keygenman@1.63 +2 -2
+ NTP_4_2_7P247
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.63 +1 -1
+ NTP_4_2_7P247
+
+ util/ntp-keygen.man.in@1.63 +2 -2
+ NTP_4_2_7P247
+
+ util/ntp-keygen.mdoc.in@1.63 +1 -1
+ NTP_4_2_7P247
+
+ChangeSet@1.2741, 2012-01-06 20:05:11-05:00, stenn@deacon.udel.edu
+ cleanup
+
+ libntp/Makefile.am@1.66 +2 -2
+ cleanup
+
+ChangeSet@1.2740, 2012-01-06 18:38:02-05:00, stenn@deacon.udel.edu
+ tolerate an error touching a file in a read-only srcdir
+
+ libntp/Makefile.am@1.65 +1 -1
+ tolerate an error touching a file in a read-only srcdir
+
+ChangeSet@1.2739, 2012-01-06 22:31:21+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ Fix build break triggered by updating deps-ver and libntp/systime.c at
+ the same time by explicitly depending systime_s.c on systime.c.
+
+ ChangeLog@1.1091 +2 -0
+ Fix build break triggered by updating deps-ver and libntp/systime.c at
+ the same time by explicitly depending systime_s.c on systime.c.
+
+ libntp/Makefile.am@1.64 +8 -0
+ Fix build break triggered by updating deps-ver and libntp/systime.c at
+ the same time by explicitly depending systime_s.c on systime.c.
+
+ChangeSet@1.2738, 2012-01-06 22:04:11+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P246
+ TAG: NTP_4_2_7P246
+
+ ChangeLog@1.1090 +1 -0
+ NTP_4_2_7P246
+
+ ntpd/ntpd-opts.c@1.251 +3 -3
+ NTP_4_2_7P246
+
+ ntpd/ntpd-opts.h@1.251 +3 -3
+ NTP_4_2_7P246
+
+ ntpd/ntpd-opts.texi@1.249 +2 -2
+ NTP_4_2_7P246
+
+ ntpd/ntpd.1ntpdman@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpd/ntpd.1ntpdmdoc@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpd/ntpd.man.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpd/ntpd.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc-opts.c@1.246 +3 -3
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc-opts.h@1.246 +3 -3
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc-opts.texi@1.246 +2 -2
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc.1ntpdcman@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc.html@1.74 +2 -2
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc.man.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpdc/ntpdc.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpq/ntpq-opts.c@1.248 +3 -3
+ NTP_4_2_7P246
+
+ ntpq/ntpq-opts.h@1.248 +3 -3
+ NTP_4_2_7P246
+
+ ntpq/ntpq-opts.texi@1.248 +2 -2
+ NTP_4_2_7P246
+
+ ntpq/ntpq.1ntpqman@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpq/ntpq.1ntpqmdoc@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpq/ntpq.man.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpq/ntpq.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.248 +3 -3
+ NTP_4_2_7P246
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.248 +3 -3
+ NTP_4_2_7P246
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.248 +2 -2
+ NTP_4_2_7P246
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpsnmpd/ntpsnmpd.man.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ packageinfo.sh@1.249 +1 -1
+ NTP_4_2_7P246
+
+ scripts/ntp-wait-opts.texi@1.66 +1 -1
+ NTP_4_2_7P246
+
+ scripts/ntp-wait.1ntp-waitman@1.62 +2 -2
+ NTP_4_2_7P246
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.62 +2 -2
+ NTP_4_2_7P246
+
+ scripts/ntp-wait.html@1.66 +1 -1
+ NTP_4_2_7P246
+
+ scripts/ntp-wait.man.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ scripts/ntp-wait.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ sntp/sntp-opts.c@1.244 +3 -3
+ NTP_4_2_7P246
+
+ sntp/sntp-opts.h@1.244 +3 -3
+ NTP_4_2_7P246
+
+ sntp/sntp-opts.texi@1.244 +2 -2
+ NTP_4_2_7P246
+
+ sntp/sntp.1sntpman@1.64 +2 -2
+ NTP_4_2_7P246
+
+ sntp/sntp.1sntpmdoc@1.64 +2 -2
+ NTP_4_2_7P246
+
+ sntp/sntp.html@1.244 +2 -2
+ NTP_4_2_7P246
+
+ sntp/sntp.man.in@1.64 +2 -2
+ NTP_4_2_7P246
+
+ sntp/sntp.mdoc.in@1.64 +2 -2
+ NTP_4_2_7P246
+
+ util/ntp-keygen-opts.c@1.248 +3 -3
+ NTP_4_2_7P246
+
+ util/ntp-keygen-opts.h@1.248 +3 -3
+ NTP_4_2_7P246
+
+ util/ntp-keygen-opts.texi@1.249 +2 -2
+ NTP_4_2_7P246
+
+ util/ntp-keygen.1ntp-keygenman@1.62 +2 -2
+ NTP_4_2_7P246
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.62 +2 -2
+ NTP_4_2_7P246
+
+ util/ntp-keygen.man.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ util/ntp-keygen.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P246
+
+ChangeSet@1.2732.1.1, 2012-01-05 19:29:42+00:00, davehart@dlh-7551.ad.hartbrothers.com
+ [Bug 2104] ntpdc fault with oversize -c command.
+ [Bug 2106] Fix warnings when using -Wformat-security.
+ Refactor timespecops.h and timevalops.h into inline functions.
+
+ BitKeeper/deleted/0e/fptoa.c~3e480692@1.5 +0 -0
+ Rename: libntp/fptoa.c -> BitKeeper/deleted/0e/fptoa.c~3e480692
+
+ BitKeeper/deleted/22/mfptoa.c~3e480692@1.5 +0 -0
+ Rename: libntp/mfptoa.c -> BitKeeper/deleted/22/mfptoa.c~3e480692
+
+ BitKeeper/deleted/40/tsftomsu.c~3e480692@1.5 +0 -0
+ Rename: libntp/tsftomsu.c -> BitKeeper/deleted/40/tsftomsu.c~3e480692
+
+ BitKeeper/deleted/6d/mfptoms.c~3e480692@1.5 +0 -0
+ Rename: libntp/mfptoms.c -> BitKeeper/deleted/6d/mfptoms.c~3e480692
+
+ BitKeeper/deleted/84/tvtots.c~3e480692@1.5 +0 -0
+ Rename: libntp/tvtots.c -> BitKeeper/deleted/84/tvtots.c~3e480692
+
+ BitKeeper/deleted/b0/tstotv.c~3e480692@1.5 +0 -0
+ Rename: libntp/tstotv.c -> BitKeeper/deleted/b0/tstotv.c~3e480692
+
+ BitKeeper/deleted/b2/msutotsf.c~3e480692@1.5 +0 -0
+ Rename: libntp/msutotsf.c -> BitKeeper/deleted/b2/msutotsf.c~3e480692
+
+ BitKeeper/deleted/b2/timespecops.c~89e74bdf8b9e22c4@1.8.1.1 +0 -0
+ Rename: libntp/timespecops.c -> BitKeeper/deleted/b2/timespecops.c~89e74bdf8b9e22c4
+
+ BitKeeper/deleted/ed/tsftomsu.cpp~5ef492abb78ec38b@1.2 +0 -0
+ Rename: tests/libntp/tsftomsu.cpp -> BitKeeper/deleted/ed/tsftomsu.cpp~5ef492abb78ec38b
+
+ BitKeeper/deleted/f5/fptoms.c~3e480692@1.5 +0 -0
+ Rename: libntp/fptoms.c -> BitKeeper/deleted/f5/fptoms.c~3e480692
+
+ BitKeeper/etc/ignore@1.84 +1 -0
+ added ports/winnt/vs2008/ntp.suo
+
+ ChangeLog@1.1085.1.1 +3 -0
+ [Bug 2104] ntpdc fault with oversize -c command.
+ [Bug 2106] Fix warnings when using -Wformat-security.
+ Refactor timespecops.h and timevalops.h into inline functions.
+
+ deps-ver@1.6 +1 -1
+ No longer building some libntp source files can trigger breakage via
+ stale Makefiles including nonexistent .deps/*.Po files. Bumping
+ deps-ver cleans older .deps dirs to cure the problem.
+
+ depsver.mf@1.3 +3 -10
+ Support tests/libntp use of depsver.mf by removing requirement that
+ consuming Makefile.am files be no deeper than one subdirectory from
+ the top $srcdir.
+
+ include/ntp_fp.h@1.28 +83 -59
+ remove lfp.l_f signed fraction, which has little legit use.
+ remove unused fraction argument from M_ISNEG().
+ style cleanup.
+
+ include/ntp_stdlib.h@1.70 +3 -3
+ use u_int32 not u_long for mfpto*() l_fp halves
+
+ include/ntp_types.h@1.31 +9 -0
+ provide NONEMPTY_TRANSLATION_UNIT macro for conditionally-compiled files.
+
+ include/ntp_unixtime.h@1.13 +1 -98
+ consolidate timeval conversion in timevalops.[ch]
+
+ include/timespecops.h@1.5 +295 -46
+ experiment with two levels of inlining timespecops/timevalops
+
+ include/timevalops.h@1.4 +369 -38
+ experiment with two levels of inlining timespecops/timevalops
+
+ lib/isc/include/isc/util.h@1.6 +1 -1
+ suppress "defined but not used" warning re: nonempty_translation_unit.
+
+ lib/isc/unix/ifiter_sysctl.c@1.17 +5 -4
+ [Bug 2106] Fix warnings when using -Wformat-security.
+
+ libntp/Makefile.am@1.63 +0 -9
+ consolidate several single-function source files
+
+ libntp/buftvtots.c@1.6 +7 -22
+ consolidate timeval conversion in timevalops.[ch]
+
+ libntp/dofptoa.c@1.9 +40 -0
+ consolidate several single-function source files
+
+ libntp/dolfptoa.c@1.11 +42 -3
+ consolidate several single-function source files
+
+ libntp/ntp_calendar.c@1.10 +1 -1
+ remove unused M_ISNEG() fraction argument
+
+ libntp/systime.c@1.62 +34 -48
+ Refine recent get_systime() fuzzing changes on non-interpolated clocks.
+ Conditionalize less iin get_systime() so measure_precision() sees
+ performance while calibrating which is closer to get_systime() use
+ later. Instead of comparing two doubles to decide if the rarely-
+ used simulation of a low-precision clock is configured via "tinker
+ tick", use a Bool-like int trunc_os_clock.
+
+ libntp/timevalops.c@1.7.1.1 +278 -347
+ refactor time*ops.h with renamed inline functions
+
+ libntp/work_thread.c@1.12 +1 -1
+ experiment with two levels of inlining timespecops/timevalops
+
+ libparse/clk_trimtsip.c@1.11 +1 -1
+ move timeval fraction macros to timevalops.h
+
+ libparse/parse.c@1.15 +1 -1
+ move timeval fraction macros to timevalops.h
+
+ ntpd/ntp_io.c@1.365 +3 -3
+ include timevalops.h explicitly
+
+ ntpd/ntp_proto.c@1.338 +41 -22
+ Minor refinement of prior precision and fuzz determination changes.
+
+ ntpd/ntp_request.c@1.109 +1 -1
+ remove l_fp.l_f signed fraction
+
+ ntpd/refclock_arc.c@1.28 +4 -2
+ remove l_fp.l_f signed fraction
+
+ ntpd/refclock_chu.c@1.53 +4 -2
+ remove l_fp.l_f signed fraction
+
+ ntpd/refclock_datum.c@1.20 +4 -2
+ move timeval fraction macros to timevalops.h
+
+ ntpd/refclock_leitch.c@1.15 +4 -2
+ move milllisecond/l_fp conversion macro to timevalops.h
+
+ ntpd/refclock_msfees.c@1.16 +7 -6
+ use tval_stamp_to_lfp() rather than buftvtots()
+
+ ntpd/refclock_nmea.c@1.65 +5 -3
+ refactor time*ops.h with renamed inline functions
+
+ ntpd/refclock_parse.c@1.63 +15 -34
+ use tval_stamp_to_lfp() rather than buftvtots().
+ remove l_fp.l_f signed fraction.
+
+ ntpd/refclock_shm.c@1.23 +7 -5
+ move timeval fraction macros to timevalops.h
+
+ ntpdate/ntpdate.c@1.90 +1 -1
+ move timeval fraction macros to timevalops.h
+
+ ntpdc/ntpdc.c@1.98 +5 -0
+ [Bug 2104] ntpdc fault with oversize -c command.
+
+ ports/winnt/include/termios.h@1.15 +1 -0
+ add overlooked tcflush() prototype referenced by refclock_parse.c
+
+ ports/winnt/vs2005/libntp.vcproj@1.21 +0 -36
+ consolidate several single-function source files
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.44 +2 -38
+ consolidate several single-function source files
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.42 +8 -0
+ add timespecops.h and timevalops.h references
+
+ sntp/main.c@1.80 +4 -4
+ refactor time*ops.h with renamed inline functions
+
+ tests/libntp/Makefile.am@1.37 +0 -1
+ remove tsftomsu.cpp as tested code was unused and removed.
+
+ tests/libntp/lfptostr.cpp@1.3 +2 -2
+ remove l_fp.l_f signed fraction
+
+ tests/libntp/strtolfp.cpp@1.9 +1 -1
+ remove l_fp.l_f signed fraction
+
+ tests/libntp/timespecops.cpp@1.6.1.1 +260 -144
+ refactor time*ops.h with renamed inline functions (thanks to Juergen
+ for helping refactor the tests).
+
+ tests/libntp/timestructs.cpp@1.1.1.1 +36 -7
+ refactor time*ops.h with renamed inline functions
+
+ tests/libntp/timestructs.h@1.1.1.1 +28 -2
+ Cherry-picked from Juergen's [Bug 2100] fix
+
+ tests/libntp/timevalops.cpp@1.6.1.1 +140 -59
+ experiment with two levels of inlining timespecops/timevalops
+
+ tests/libntp/tstotv.cpp@1.2 +1 -1
+ move timeval fraction macros to timevalops.h
+
+ tests/libntp/tvtots.cpp@1.6 +1 -1
+ move timeval fraction macros to timevalops.h
+
+ util/ntp-keygen.c@1.89 +1 -1
+ Resolve MAXFILENAME redefinition warning.
+
+ util/ntptime.c@1.24 +8 -1
+ move timeval fraction macros to timevalops.h
+
+ChangeSet@1.2736, 2011-12-31 11:27:35+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P245
+ TAG: NTP_4_2_7P245
+
+ ChangeLog@1.1088 +1 -0
+ NTP_4_2_7P245
+
+ ntpd/ntpd-opts.c@1.250 +3 -3
+ NTP_4_2_7P245
+
+ ntpd/ntpd-opts.h@1.250 +3 -3
+ NTP_4_2_7P245
+
+ ntpd/ntpd-opts.texi@1.248 +2 -2
+ NTP_4_2_7P245
+
+ ntpd/ntpd.1ntpdman@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpd/ntpd.1ntpdmdoc@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpd/ntpd.man.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpd/ntpd.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc-opts.c@1.245 +3 -3
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc-opts.h@1.245 +3 -3
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc-opts.texi@1.245 +2 -2
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc.1ntpdcman@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc.html@1.73 +2 -2
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc.man.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpdc/ntpdc.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpq/ntpq-opts.c@1.247 +3 -3
+ NTP_4_2_7P245
+
+ ntpq/ntpq-opts.h@1.247 +3 -3
+ NTP_4_2_7P245
+
+ ntpq/ntpq-opts.texi@1.247 +2 -2
+ NTP_4_2_7P245
+
+ ntpq/ntpq.1ntpqman@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpq/ntpq.1ntpqmdoc@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpq/ntpq.man.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpq/ntpq.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.247 +3 -3
+ NTP_4_2_7P245
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.247 +3 -3
+ NTP_4_2_7P245
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.247 +2 -2
+ NTP_4_2_7P245
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpsnmpd/ntpsnmpd.man.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ packageinfo.sh@1.248 +1 -1
+ NTP_4_2_7P245
+
+ scripts/ntp-wait-opts.texi@1.65 +1 -1
+ NTP_4_2_7P245
+
+ scripts/ntp-wait.1ntp-waitman@1.61 +2 -2
+ NTP_4_2_7P245
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.61 +2 -2
+ NTP_4_2_7P245
+
+ scripts/ntp-wait.html@1.65 +1 -1
+ NTP_4_2_7P245
+
+ scripts/ntp-wait.man.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ scripts/ntp-wait.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ sntp/sntp-opts.c@1.243 +3 -3
+ NTP_4_2_7P245
+
+ sntp/sntp-opts.h@1.243 +3 -3
+ NTP_4_2_7P245
+
+ sntp/sntp-opts.texi@1.243 +2 -2
+ NTP_4_2_7P245
+
+ sntp/sntp.1sntpman@1.63 +2 -2
+ NTP_4_2_7P245
+
+ sntp/sntp.1sntpmdoc@1.63 +2 -2
+ NTP_4_2_7P245
+
+ sntp/sntp.html@1.243 +2 -2
+ NTP_4_2_7P245
+
+ sntp/sntp.man.in@1.63 +2 -2
+ NTP_4_2_7P245
+
+ sntp/sntp.mdoc.in@1.63 +2 -2
+ NTP_4_2_7P245
+
+ util/ntp-keygen-opts.c@1.247 +3 -3
+ NTP_4_2_7P245
+
+ util/ntp-keygen-opts.h@1.247 +3 -3
+ NTP_4_2_7P245
+
+ util/ntp-keygen-opts.texi@1.248 +2 -2
+ NTP_4_2_7P245
+
+ util/ntp-keygen.1ntp-keygenman@1.61 +2 -2
+ NTP_4_2_7P245
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.61 +2 -2
+ NTP_4_2_7P245
+
+ util/ntp-keygen.man.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ util/ntp-keygen.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P245
+
+ChangeSet@1.2735, 2011-12-30 21:10:00-05:00, stenn@deacon.udel.edu
+ typo
+
+ ChangeLog@1.1087 +3 -2
+ typo
+
+ChangeSet@1.2734, 2011-12-30 12:17:49+01:00, jnperlin@hydra.localnet
+ [Bug2100] conversion timespec/timeval <--> l_fp fixed
+
+ ChangeLog@1.1086 +2 -0
+ [Bug2100] conversion timespec/timeval <--> l_fp fixed
+
+ libntp/timespecops.c@1.9 +2 -2
+ [Bug2100] conversion l_fp --> timespec fixed
+
+ libntp/timevalops.c@1.8 +2 -2
+ [Bug2100] conversion lfp --> timeval fixed
+
+ChangeSet@1.2733, 2011-12-30 12:12:49+01:00, jnperlin@hydra.localnet
+ add test cases to reveal bug#2100
+ cleanup of test code
+
+ tests/libntp/timespecops.cpp@1.7 +229 -130
+ add test cases to reveal bug#2100
+ synchronise test cases & coding between timeval <--> timespec
+
+ tests/libntp/timestructs.cpp@1.2 +34 -1
+ use 'lfptoa' for printing l_fp values
+ timespec closeness predicate implementation
+
+ tests/libntp/timestructs.h@1.2 +27 -0
+ added copy C'TORs to timespec/timeval wrappers,
+ added a timespec closeness predicate class
+
+ tests/libntp/timevalops.cpp@1.7 +109 -45
+ add test cases to reveal bug#2100
+ synchronise test cases & coding between timeval <--> timespec
+
+ChangeSet@1.2732, 2011-12-25 11:32:25+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P244
+ TAG: NTP_4_2_7P244
+
+ ChangeLog@1.1085 +1 -0
+ NTP_4_2_7P244
+
+ ntpd/ntpd-opts.c@1.249 +3 -3
+ NTP_4_2_7P244
+
+ ntpd/ntpd-opts.h@1.249 +3 -3
+ NTP_4_2_7P244
+
+ ntpd/ntpd-opts.texi@1.247 +2 -2
+ NTP_4_2_7P244
+
+ ntpd/ntpd.1ntpdman@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpd/ntpd.1ntpdmdoc@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpd/ntpd.man.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpd/ntpd.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc-opts.c@1.244 +3 -3
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc-opts.h@1.244 +3 -3
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc-opts.texi@1.244 +2 -2
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc.1ntpdcman@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc.html@1.72 +2 -2
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc.man.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpdc/ntpdc.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpq/ntpq-opts.c@1.246 +3 -3
+ NTP_4_2_7P244
+
+ ntpq/ntpq-opts.h@1.246 +3 -3
+ NTP_4_2_7P244
+
+ ntpq/ntpq-opts.texi@1.246 +2 -2
+ NTP_4_2_7P244
+
+ ntpq/ntpq.1ntpqman@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpq/ntpq.1ntpqmdoc@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpq/ntpq.man.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpq/ntpq.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.246 +3 -3
+ NTP_4_2_7P244
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.246 +3 -3
+ NTP_4_2_7P244
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.246 +2 -2
+ NTP_4_2_7P244
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpsnmpd/ntpsnmpd.man.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ packageinfo.sh@1.247 +1 -1
+ NTP_4_2_7P244
+
+ scripts/ntp-wait-opts.texi@1.64 +1 -1
+ NTP_4_2_7P244
+
+ scripts/ntp-wait.1ntp-waitman@1.60 +2 -2
+ NTP_4_2_7P244
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.60 +2 -2
+ NTP_4_2_7P244
+
+ scripts/ntp-wait.html@1.64 +1 -1
+ NTP_4_2_7P244
+
+ scripts/ntp-wait.man.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ scripts/ntp-wait.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ sntp/sntp-opts.c@1.242 +3 -3
+ NTP_4_2_7P244
+
+ sntp/sntp-opts.h@1.242 +3 -3
+ NTP_4_2_7P244
+
+ sntp/sntp-opts.texi@1.242 +2 -2
+ NTP_4_2_7P244
+
+ sntp/sntp.1sntpman@1.62 +2 -2
+ NTP_4_2_7P244
+
+ sntp/sntp.1sntpmdoc@1.62 +2 -2
+ NTP_4_2_7P244
+
+ sntp/sntp.html@1.242 +2 -2
+ NTP_4_2_7P244
+
+ sntp/sntp.man.in@1.62 +2 -2
+ NTP_4_2_7P244
+
+ sntp/sntp.mdoc.in@1.62 +2 -2
+ NTP_4_2_7P244
+
+ util/ntp-keygen-opts.c@1.246 +3 -3
+ NTP_4_2_7P244
+
+ util/ntp-keygen-opts.h@1.246 +3 -3
+ NTP_4_2_7P244
+
+ util/ntp-keygen-opts.texi@1.247 +2 -2
+ NTP_4_2_7P244
+
+ util/ntp-keygen.1ntp-keygenman@1.60 +2 -2
+ NTP_4_2_7P244
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.60 +2 -2
+ NTP_4_2_7P244
+
+ util/ntp-keygen.man.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ util/ntp-keygen.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P244
+
+ChangeSet@1.2082.4.262, 2011-12-24 18:34:58-05:00, stenn@deacon.udel.edu
+ NTP_4_2_6P5
+ TAG: NTP_4_2_6P5
+
+ ChangeLog@1.496.26.186 +1 -0
+ NTP_4_2_6P5
+
+ ntpd/ntpd-opts.c@1.248.43.1 +5 -5
+ NTP_4_2_6P5
+
+ ntpd/ntpd-opts.h@1.248.43.1 +3 -3
+ NTP_4_2_6P5
+
+ ntpd/ntpd-opts.texi@1.246.42.1 +2 -2
+ NTP_4_2_6P5
+
+ ntpd/ntpd.1@1.246.42.1 +2 -2
+ NTP_4_2_6P5
+
+ ntpdc/ntpdc-opts.c@1.244.43.1 +5 -5
+ NTP_4_2_6P5
+
+ ntpdc/ntpdc-opts.h@1.244.43.1 +3 -3
+ NTP_4_2_6P5
+
+ ntpdc/ntpdc-opts.texi@1.243.42.1 +2 -2
+ NTP_4_2_6P5
+
+ ntpdc/ntpdc.1@1.243.42.1 +2 -2
+ NTP_4_2_6P5
+
+ ntpq/ntpq-opts.c@1.245.43.1 +5 -5
+ NTP_4_2_6P5
+
+ ntpq/ntpq-opts.h@1.245.43.1 +3 -3
+ NTP_4_2_6P5
+
+ ntpq/ntpq-opts.texi@1.244.42.1 +2 -2
+ NTP_4_2_6P5
+
+ ntpq/ntpq.1@1.244.42.1 +2 -2
+ NTP_4_2_6P5
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.44.1 +5 -5
+ NTP_4_2_6P5
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.44.1 +3 -3
+ NTP_4_2_6P5
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.43.1 +2 -2
+ NTP_4_2_6P5
+
+ ntpsnmpd/ntpsnmpd.1@1.122.43.1 +2 -2
+ NTP_4_2_6P5
+
+ packageinfo.sh@1.255.40.2 +2 -2
+ NTP_4_2_6P5
+
+ sntp/sntp-opts.c@1.117.42.1 +5 -5
+ NTP_4_2_6P5
+
+ sntp/sntp-opts.h@1.117.42.1 +3 -3
+ NTP_4_2_6P5
+
+ sntp/sntp-opts.texi@1.117.41.1 +2 -2
+ NTP_4_2_6P5
+
+ sntp/sntp.1@1.117.41.1 +2 -2
+ NTP_4_2_6P5
+
+ sntp/sntp.html@1.7.42.1 +2 -2
+ NTP_4_2_6P5
+
+ util/ntp-keygen-opts.c@1.247.43.1 +5 -5
+ NTP_4_2_6P5
+
+ util/ntp-keygen-opts.h@1.247.43.1 +3 -3
+ NTP_4_2_6P5
+
+ util/ntp-keygen-opts.texi@1.246.42.1 +2 -2
+ NTP_4_2_6P5
+
+ util/ntp-keygen.1@1.246.42.1 +2 -2
+ NTP_4_2_6P5
+
+ChangeSet@1.2082.4.261, 2011-12-24 18:21:54-05:00, stenn@deacon.udel.edu
+ ntp-4.2.6p5
+
+ packageinfo.sh@1.255.40.1 +3 -2
+ ntp-4.2.6p5
+
+ChangeSet@1.2082.4.260, 2011-12-24 18:08:51-05:00, stenn@deacon.udel.edu
+ fix typos
+
+ NEWS@1.122.1.5 +8 -8
+ fix typos
+
+ChangeSet@1.2082.4.259, 2011-12-24 17:47:02-05:00, stenn@deacon.udel.edu
+ NEWS cleanup
+
+ NEWS@1.122.1.4 +25 -21
+ NEWS cleanup
+
+ChangeSet@1.2082.4.258, 2011-12-23 22:48:14-05:00, stenn@deacon.udel.edu
+ NEWS file cleanup
+
+ ChangeLog@1.496.26.185 +3 -0
+ NEWS file cleanup
+
+ NEWS@1.122.1.3 +6 -8
+ NEWS file cleanup
+
+ChangeSet@1.2730, 2011-12-23 04:43:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P243
+ TAG: NTP_4_2_7P243
+
+ ChangeLog@1.1083 +1 -0
+ NTP_4_2_7P243
+
+ ntpd/ntpd-opts.c@1.248 +3 -3
+ NTP_4_2_7P243
+
+ ntpd/ntpd-opts.h@1.248 +3 -3
+ NTP_4_2_7P243
+
+ ntpd/ntpd-opts.texi@1.246 +2 -2
+ NTP_4_2_7P243
+
+ ntpd/ntpd.1ntpdman@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpd/ntpd.1ntpdmdoc@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpd/ntpd.man.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpd/ntpd.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc-opts.c@1.243 +3 -3
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc-opts.h@1.243 +3 -3
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc-opts.texi@1.243 +2 -2
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc.1ntpdcman@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc.html@1.71 +2 -2
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc.man.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpdc/ntpdc.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpq/ntpq-opts.c@1.245 +3 -3
+ NTP_4_2_7P243
+
+ ntpq/ntpq-opts.h@1.245 +3 -3
+ NTP_4_2_7P243
+
+ ntpq/ntpq-opts.texi@1.245 +2 -2
+ NTP_4_2_7P243
+
+ ntpq/ntpq.1ntpqman@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpq/ntpq.1ntpqmdoc@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpq/ntpq.man.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpq/ntpq.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.245 +3 -3
+ NTP_4_2_7P243
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.245 +3 -3
+ NTP_4_2_7P243
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.245 +2 -2
+ NTP_4_2_7P243
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpsnmpd/ntpsnmpd.man.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ packageinfo.sh@1.246 +1 -1
+ NTP_4_2_7P243
+
+ scripts/ntp-wait-opts.texi@1.63 +1 -1
+ NTP_4_2_7P243
+
+ scripts/ntp-wait.1ntp-waitman@1.59 +2 -2
+ NTP_4_2_7P243
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.59 +2 -2
+ NTP_4_2_7P243
+
+ scripts/ntp-wait.html@1.63 +1 -1
+ NTP_4_2_7P243
+
+ scripts/ntp-wait.man.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ scripts/ntp-wait.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ sntp/sntp-opts.c@1.241 +3 -3
+ NTP_4_2_7P243
+
+ sntp/sntp-opts.h@1.241 +3 -3
+ NTP_4_2_7P243
+
+ sntp/sntp-opts.texi@1.241 +2 -2
+ NTP_4_2_7P243
+
+ sntp/sntp.1sntpman@1.61 +2 -2
+ NTP_4_2_7P243
+
+ sntp/sntp.1sntpmdoc@1.61 +2 -2
+ NTP_4_2_7P243
+
+ sntp/sntp.html@1.241 +2 -2
+ NTP_4_2_7P243
+
+ sntp/sntp.man.in@1.61 +2 -2
+ NTP_4_2_7P243
+
+ sntp/sntp.mdoc.in@1.61 +2 -2
+ NTP_4_2_7P243
+
+ util/ntp-keygen-opts.c@1.245 +3 -3
+ NTP_4_2_7P243
+
+ util/ntp-keygen-opts.h@1.245 +3 -3
+ NTP_4_2_7P243
+
+ util/ntp-keygen-opts.texi@1.246 +2 -2
+ NTP_4_2_7P243
+
+ util/ntp-keygen.1ntp-keygenman@1.59 +2 -2
+ NTP_4_2_7P243
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.59 +2 -2
+ NTP_4_2_7P243
+
+ util/ntp-keygen.man.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ util/ntp-keygen.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P243
+
+ChangeSet@1.2729, 2011-12-22 23:22:36-05:00, stenn@deacon.udel.edu
+ typo
+
+ ChangeLog@1.1082 +1 -1
+ typo
+
+ChangeSet@1.2728, 2011-12-22 23:07:30-05:00, stenn@deacon.udel.edu
+ [Bug 2095] ntptrace now needs 'rv' instead pf 'pstat', reported by Michael Tatarinov
+
+ ChangeLog@1.1081 +2 -0
+ [Bug 2095] ntptrace now needs 'rv' instead pf 'pstat', reported by Michael Tatarinov
+
+ scripts/ntptrace.in@1.7 +1 -1
+ [Bug 2095] ntptrace now needs 'rv' instead pf 'pstat', reported by Michael Tatarinov
+
+ChangeSet@1.2727, 2011-12-21 21:08:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P242
+ TAG: NTP_4_2_7P242
+
+ ChangeLog@1.1080 +1 -0
+ NTP_4_2_7P242
+
+ ntpd/ntpd-opts.c@1.247 +3 -3
+ NTP_4_2_7P242
+
+ ntpd/ntpd-opts.h@1.247 +3 -3
+ NTP_4_2_7P242
+
+ ntpd/ntpd-opts.texi@1.245 +2 -2
+ NTP_4_2_7P242
+
+ ntpd/ntpd.1ntpdman@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpd/ntpd.1ntpdmdoc@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpd/ntpd.man.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpd/ntpd.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc-opts.c@1.242 +3 -3
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc-opts.h@1.242 +3 -3
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc-opts.texi@1.242 +2 -2
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc.1ntpdcman@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc.html@1.70 +2 -2
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc.man.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpdc/ntpdc.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpq/ntpq-opts.c@1.244 +3 -3
+ NTP_4_2_7P242
+
+ ntpq/ntpq-opts.h@1.244 +3 -3
+ NTP_4_2_7P242
+
+ ntpq/ntpq-opts.texi@1.244 +2 -2
+ NTP_4_2_7P242
+
+ ntpq/ntpq.1ntpqman@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpq/ntpq.1ntpqmdoc@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpq/ntpq.man.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpq/ntpq.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.244 +3 -3
+ NTP_4_2_7P242
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.244 +3 -3
+ NTP_4_2_7P242
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.244 +2 -2
+ NTP_4_2_7P242
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpsnmpd/ntpsnmpd.man.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ packageinfo.sh@1.245 +1 -1
+ NTP_4_2_7P242
+
+ scripts/ntp-wait-opts.texi@1.62 +1 -1
+ NTP_4_2_7P242
+
+ scripts/ntp-wait.1ntp-waitman@1.58 +2 -2
+ NTP_4_2_7P242
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.58 +2 -2
+ NTP_4_2_7P242
+
+ scripts/ntp-wait.html@1.62 +1 -1
+ NTP_4_2_7P242
+
+ scripts/ntp-wait.man.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ scripts/ntp-wait.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ sntp/sntp-opts.c@1.240 +3 -3
+ NTP_4_2_7P242
+
+ sntp/sntp-opts.h@1.240 +3 -3
+ NTP_4_2_7P242
+
+ sntp/sntp-opts.texi@1.240 +2 -2
+ NTP_4_2_7P242
+
+ sntp/sntp.1sntpman@1.60 +2 -2
+ NTP_4_2_7P242
+
+ sntp/sntp.1sntpmdoc@1.60 +2 -2
+ NTP_4_2_7P242
+
+ sntp/sntp.html@1.240 +2 -2
+ NTP_4_2_7P242
+
+ sntp/sntp.man.in@1.60 +2 -2
+ NTP_4_2_7P242
+
+ sntp/sntp.mdoc.in@1.60 +2 -2
+ NTP_4_2_7P242
+
+ util/ntp-keygen-opts.c@1.244 +3 -3
+ NTP_4_2_7P242
+
+ util/ntp-keygen-opts.h@1.244 +3 -3
+ NTP_4_2_7P242
+
+ util/ntp-keygen-opts.texi@1.245 +2 -2
+ NTP_4_2_7P242
+
+ util/ntp-keygen.1ntp-keygenman@1.58 +2 -2
+ NTP_4_2_7P242
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.58 +2 -2
+ NTP_4_2_7P242
+
+ util/ntp-keygen.man.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ util/ntp-keygen.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P242
+
+ChangeSet@1.2726, 2011-12-21 15:05:08-05:00, stenn@deacon.udel.edu
+ Documentation updates
+
+ ChangeLog@1.1079 +1 -0
+ Include missing html/icons/sitemap.png, reported by Michael Tatarinov
+
+ ChangeLog@1.1078 +1 -0
+ Documentation updates from Dave Mills
+
+ html/icons/sitemap.png@1.1 +64 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/icons/sitemap.png
+
+ html/icons/sitemap.png@1.0 +0 -0
+
+ html/prefer.html@1.30 +3 -3
+ Documentation updates from Dave Mills
+
+ html/select.html@1.6 +2 -2
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.21 +6 -8
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2725, 2011-12-18 22:08:57+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P241
+ TAG: NTP_4_2_7P241
+
+ ChangeLog@1.1077 +1 -0
+ NTP_4_2_7P241
+
+ ntpd/ntpd-opts.c@1.246 +3 -3
+ NTP_4_2_7P241
+
+ ntpd/ntpd-opts.h@1.246 +3 -3
+ NTP_4_2_7P241
+
+ ntpd/ntpd-opts.texi@1.244 +2 -2
+ NTP_4_2_7P241
+
+ ntpd/ntpd.1ntpdman@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpd/ntpd.1ntpdmdoc@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpd/ntpd.man.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpd/ntpd.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc-opts.c@1.241 +3 -3
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc-opts.h@1.241 +3 -3
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc-opts.texi@1.241 +2 -2
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc.1ntpdcman@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc.html@1.69 +2 -2
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc.man.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpdc/ntpdc.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpq/ntpq-opts.c@1.243 +3 -3
+ NTP_4_2_7P241
+
+ ntpq/ntpq-opts.h@1.243 +3 -3
+ NTP_4_2_7P241
+
+ ntpq/ntpq-opts.texi@1.243 +2 -2
+ NTP_4_2_7P241
+
+ ntpq/ntpq.1ntpqman@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpq/ntpq.1ntpqmdoc@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpq/ntpq.man.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpq/ntpq.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.243 +3 -3
+ NTP_4_2_7P241
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.243 +3 -3
+ NTP_4_2_7P241
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.243 +2 -2
+ NTP_4_2_7P241
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpsnmpd/ntpsnmpd.man.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ packageinfo.sh@1.244 +1 -1
+ NTP_4_2_7P241
+
+ scripts/ntp-wait-opts.texi@1.61 +1 -1
+ NTP_4_2_7P241
+
+ scripts/ntp-wait.1ntp-waitman@1.57 +2 -2
+ NTP_4_2_7P241
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.57 +2 -2
+ NTP_4_2_7P241
+
+ scripts/ntp-wait.html@1.61 +1 -1
+ NTP_4_2_7P241
+
+ scripts/ntp-wait.man.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ scripts/ntp-wait.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ sntp/sntp-opts.c@1.239 +3 -3
+ NTP_4_2_7P241
+
+ sntp/sntp-opts.h@1.239 +3 -3
+ NTP_4_2_7P241
+
+ sntp/sntp-opts.texi@1.239 +2 -2
+ NTP_4_2_7P241
+
+ sntp/sntp.1sntpman@1.59 +2 -2
+ NTP_4_2_7P241
+
+ sntp/sntp.1sntpmdoc@1.59 +2 -2
+ NTP_4_2_7P241
+
+ sntp/sntp.html@1.239 +2 -2
+ NTP_4_2_7P241
+
+ sntp/sntp.man.in@1.59 +2 -2
+ NTP_4_2_7P241
+
+ sntp/sntp.mdoc.in@1.59 +2 -2
+ NTP_4_2_7P241
+
+ util/ntp-keygen-opts.c@1.243 +3 -3
+ NTP_4_2_7P241
+
+ util/ntp-keygen-opts.h@1.243 +3 -3
+ NTP_4_2_7P241
+
+ util/ntp-keygen-opts.texi@1.244 +2 -2
+ NTP_4_2_7P241
+
+ util/ntp-keygen.1ntp-keygenman@1.57 +2 -2
+ NTP_4_2_7P241
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.57 +2 -2
+ NTP_4_2_7P241
+
+ util/ntp-keygen.man.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ util/ntp-keygen.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P241
+
+ChangeSet@1.2724, 2011-12-18 04:24:58+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+ [Bug 2068] "tos ceiling" default and cap changed to 15.
+ Floor peer delay using system precision, as with jitter, reflecting
+ inability to measure shorter intervals.
+
+ ChangeLog@1.1076 +4 -0
+ [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+ [Bug 2068] "tos ceiling" default and cap changed to 15.
+ Floor peer delay using system precision, as with jitter, reflecting
+ inability to measure shorter intervals.
+
+ include/ntp.h@1.202 +2 -1
+ move sys_tick override from proto_config() to loop_config()
+
+ include/ntp_stdlib.h@1.69 +1 -0
+ [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+
+ include/ntp_unixtime.h@1.12 +2 -0
+ include timespecops.h and timevalops.h
+
+ include/ntpd.h@1.171 +1 -0
+ [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+
+ libntp/systime.c@1.61 +11 -3
+ [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+
+ ntpd/complete.conf@1.21 +1 -1
+ add "tinker tick 0.01" coverage
+
+ ntpd/ntp_config.c@1.296 +17 -4
+ support "tinker tick 0.01" syntax alongside older "tick 0.01"
+ [Bug 2068] "tos ceiling" default and cap changed to 15.
+
+ ntpd/ntp_control.c@1.178 +8 -2
+ Expose sys_fuzz to ntpq as nondefault system variable fuzz.
+
+ ntpd/ntp_io.c@1.364 +30 -25
+ [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+
+ ntpd/ntp_loopfilter.c@1.169 +5 -1
+ move sys_tick override from proto_config() to loop_config()
+
+ ntpd/ntp_parser.c@1.78 +428 -424
+ Bison output for ntp_parser.y
+
+ ntpd/ntp_parser.y@1.72 +1 -0
+ support "tinker tick 0.01" syntax alongside older "tick 0.01"
+
+ ntpd/ntp_proto.c@1.337 +46 -17
+ [Bug 2015] Overriding sys_tick should recalculate sys_precision.
+ [Bug 2068] "tos ceiling" default and cap changed to 15.
+ Floor peer delay using system precision, as with jitter, reflecting
+ inability to measure shorter intervals.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.55 +6 -13
+ nonfunctional cleanup
+
+ util/ntp-keygen.c@1.88 +1 -2
+ remove now-redundant MAXHOSTNAME declaration (in ntp.h)
+
+ChangeSet@1.2713.1.1, 2011-12-17 02:30:42+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ ChangeLog@1.1065.1.1 +1 -0
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ include/ntp_fp.h@1.27 +7 -1
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ include/ntp_stdlib.h@1.68 +2 -1
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ libntp/systime.c@1.58.1.1 +151 -74
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ libntp/timespecops.c@1.8 +1 -1
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ ntpd/ntp_proto.c@1.332.1.1 +57 -23
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ ntpd/refclock_arc.c@1.27 +1 -1
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.54 +11 -2
+ [Bug 2037] Fuzzed non-interpolated clock may decrease.
+
+ChangeSet@1.2722, 2011-12-15 08:50:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P240
+ TAG: NTP_4_2_7P240
+
+ ChangeLog@1.1074 +1 -0
+ NTP_4_2_7P240
+
+ ntpd/ntpd-opts.c@1.245 +3 -3
+ NTP_4_2_7P240
+
+ ntpd/ntpd-opts.h@1.245 +3 -3
+ NTP_4_2_7P240
+
+ ntpd/ntpd-opts.texi@1.243 +2 -2
+ NTP_4_2_7P240
+
+ ntpd/ntpd.1ntpdman@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpd/ntpd.1ntpdmdoc@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpd/ntpd.man.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpd/ntpd.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc-opts.c@1.240 +3 -3
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc-opts.h@1.240 +3 -3
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc-opts.texi@1.240 +2 -2
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc.1ntpdcman@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc.html@1.68 +2 -2
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc.man.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpdc/ntpdc.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpq/ntpq-opts.c@1.242 +3 -3
+ NTP_4_2_7P240
+
+ ntpq/ntpq-opts.h@1.242 +3 -3
+ NTP_4_2_7P240
+
+ ntpq/ntpq-opts.texi@1.242 +2 -2
+ NTP_4_2_7P240
+
+ ntpq/ntpq.1ntpqman@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpq/ntpq.1ntpqmdoc@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpq/ntpq.man.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpq/ntpq.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.242 +3 -3
+ NTP_4_2_7P240
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.242 +3 -3
+ NTP_4_2_7P240
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.242 +2 -2
+ NTP_4_2_7P240
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpsnmpd/ntpsnmpd.man.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ packageinfo.sh@1.243 +1 -1
+ NTP_4_2_7P240
+
+ scripts/ntp-wait-opts.texi@1.60 +1 -1
+ NTP_4_2_7P240
+
+ scripts/ntp-wait.1ntp-waitman@1.56 +2 -2
+ NTP_4_2_7P240
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.56 +2 -2
+ NTP_4_2_7P240
+
+ scripts/ntp-wait.html@1.60 +1 -1
+ NTP_4_2_7P240
+
+ scripts/ntp-wait.man.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ scripts/ntp-wait.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ sntp/sntp-opts.c@1.238 +3 -3
+ NTP_4_2_7P240
+
+ sntp/sntp-opts.h@1.238 +3 -3
+ NTP_4_2_7P240
+
+ sntp/sntp-opts.texi@1.238 +2 -2
+ NTP_4_2_7P240
+
+ sntp/sntp.1sntpman@1.58 +2 -2
+ NTP_4_2_7P240
+
+ sntp/sntp.1sntpmdoc@1.58 +2 -2
+ NTP_4_2_7P240
+
+ sntp/sntp.html@1.238 +2 -2
+ NTP_4_2_7P240
+
+ sntp/sntp.man.in@1.58 +2 -2
+ NTP_4_2_7P240
+
+ sntp/sntp.mdoc.in@1.58 +2 -2
+ NTP_4_2_7P240
+
+ util/ntp-keygen-opts.c@1.242 +3 -3
+ NTP_4_2_7P240
+
+ util/ntp-keygen-opts.h@1.242 +3 -3
+ NTP_4_2_7P240
+
+ util/ntp-keygen-opts.texi@1.243 +2 -2
+ NTP_4_2_7P240
+
+ util/ntp-keygen.1ntp-keygenman@1.56 +2 -2
+ NTP_4_2_7P240
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.56 +2 -2
+ NTP_4_2_7P240
+
+ util/ntp-keygen.man.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ util/ntp-keygen.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P240
+
+ChangeSet@1.2721, 2011-12-15 03:27:02+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2092] clock_select() selection jitter miscalculated.
+ [Bug 2093] Reintroduce smaller stratum factor to system peer metric.
+
+ ChangeLog@1.1073 +2 -0
+ [Bug 2092] clock_select() selection jitter miscalculated.
+ [Bug 2093] Reintroduce smaller stratum factor to system peer metric.
+
+ include/ntp_calendar.h@1.11 +14 -12
+ Reduce use of magic precomputed numbers in favor of construction.
+
+ include/ntp_unixtime.h@1.11 +5 -2
+ Reduce use of magic precomputed numbers in favor of construction.
+
+ libntp/humandate.c@1.11 +0 -1
+ Remove declaration now redundant with ntp_calendar.h
+
+ ntpd/ntp_proto.c@1.335 +157 -164
+ [Bug 2092] clock_select() selection jitter miscalculated.
+ [Bug 2093] Reintroduce smaller stratum factor to system peer metric.
+ Refactor clock_select() to use single peers array of new peer_select
+ struct instead of separate synch and error arrays kept in sync,
+ no longer sort peers array by selection metric.
+
+ChangeSet@1.2720, 2011-12-11 11:39:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P239
+ TAG: NTP_4_2_7P239
+
+ ChangeLog@1.1072 +1 -0
+ NTP_4_2_7P239
+
+ ntpd/ntpd-opts.c@1.244 +3 -3
+ NTP_4_2_7P239
+
+ ntpd/ntpd-opts.h@1.244 +3 -3
+ NTP_4_2_7P239
+
+ ntpd/ntpd-opts.texi@1.242 +2 -2
+ NTP_4_2_7P239
+
+ ntpd/ntpd.1ntpdman@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpd/ntpd.1ntpdmdoc@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpd/ntpd.man.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpd/ntpd.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc-opts.c@1.239 +3 -3
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc-opts.h@1.239 +3 -3
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc-opts.texi@1.239 +2 -2
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc.1ntpdcman@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc.html@1.67 +2 -2
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc.man.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpdc/ntpdc.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpq/ntpq-opts.c@1.241 +3 -3
+ NTP_4_2_7P239
+
+ ntpq/ntpq-opts.h@1.241 +3 -3
+ NTP_4_2_7P239
+
+ ntpq/ntpq-opts.texi@1.241 +2 -2
+ NTP_4_2_7P239
+
+ ntpq/ntpq.1ntpqman@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpq/ntpq.1ntpqmdoc@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpq/ntpq.man.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpq/ntpq.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.241 +3 -3
+ NTP_4_2_7P239
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.241 +3 -3
+ NTP_4_2_7P239
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.241 +2 -2
+ NTP_4_2_7P239
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpsnmpd/ntpsnmpd.man.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ packageinfo.sh@1.242 +1 -1
+ NTP_4_2_7P239
+
+ scripts/ntp-wait-opts.texi@1.59 +1 -1
+ NTP_4_2_7P239
+
+ scripts/ntp-wait.1ntp-waitman@1.55 +2 -2
+ NTP_4_2_7P239
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.55 +2 -2
+ NTP_4_2_7P239
+
+ scripts/ntp-wait.html@1.59 +1 -1
+ NTP_4_2_7P239
+
+ scripts/ntp-wait.man.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ scripts/ntp-wait.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ sntp/sntp-opts.c@1.237 +3 -3
+ NTP_4_2_7P239
+
+ sntp/sntp-opts.h@1.237 +3 -3
+ NTP_4_2_7P239
+
+ sntp/sntp-opts.texi@1.237 +2 -2
+ NTP_4_2_7P239
+
+ sntp/sntp.1sntpman@1.57 +2 -2
+ NTP_4_2_7P239
+
+ sntp/sntp.1sntpmdoc@1.57 +2 -2
+ NTP_4_2_7P239
+
+ sntp/sntp.html@1.237 +2 -2
+ NTP_4_2_7P239
+
+ sntp/sntp.man.in@1.57 +2 -2
+ NTP_4_2_7P239
+
+ sntp/sntp.mdoc.in@1.57 +2 -2
+ NTP_4_2_7P239
+
+ util/ntp-keygen-opts.c@1.241 +3 -3
+ NTP_4_2_7P239
+
+ util/ntp-keygen-opts.h@1.241 +3 -3
+ NTP_4_2_7P239
+
+ util/ntp-keygen-opts.texi@1.242 +2 -2
+ NTP_4_2_7P239
+
+ util/ntp-keygen.1ntp-keygenman@1.55 +2 -2
+ NTP_4_2_7P239
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.55 +2 -2
+ NTP_4_2_7P239
+
+ util/ntp-keygen.man.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ util/ntp-keygen.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P239
+
+ChangeSet@1.2719, 2011-12-11 05:57:08-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1071 +1 -0
+ Documentation updates from Dave Mills
+
+ html/cluster.html@1.7 +4 -3
+ Documentation updates from Dave Mills
+
+ html/filter.html@1.5 +7 -6
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.29 +20 -33
+ Documentation updates from Dave Mills
+
+ html/select.html@1.5 +10 -3
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.20 +12 -12
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2718, 2011-12-09 19:19:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P238
+ TAG: NTP_4_2_7P238
+
+ ChangeLog@1.1070 +1 -0
+ NTP_4_2_7P238
+
+ ntpd/ntpd-opts.c@1.243 +3 -3
+ NTP_4_2_7P238
+
+ ntpd/ntpd-opts.h@1.243 +3 -3
+ NTP_4_2_7P238
+
+ ntpd/ntpd-opts.texi@1.241 +2 -2
+ NTP_4_2_7P238
+
+ ntpd/ntpd.1ntpdman@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpd/ntpd.1ntpdmdoc@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpd/ntpd.man.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpd/ntpd.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc-opts.c@1.238 +3 -3
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc-opts.h@1.238 +3 -3
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc-opts.texi@1.238 +2 -2
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc.1ntpdcman@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc.html@1.66 +2 -2
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc.man.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpdc/ntpdc.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpq/ntpq-opts.c@1.240 +3 -3
+ NTP_4_2_7P238
+
+ ntpq/ntpq-opts.h@1.240 +3 -3
+ NTP_4_2_7P238
+
+ ntpq/ntpq-opts.texi@1.240 +2 -2
+ NTP_4_2_7P238
+
+ ntpq/ntpq.1ntpqman@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpq/ntpq.1ntpqmdoc@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpq/ntpq.man.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpq/ntpq.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.240 +3 -3
+ NTP_4_2_7P238
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.240 +3 -3
+ NTP_4_2_7P238
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.240 +2 -2
+ NTP_4_2_7P238
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpsnmpd/ntpsnmpd.man.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ packageinfo.sh@1.241 +1 -1
+ NTP_4_2_7P238
+
+ scripts/ntp-wait-opts.texi@1.58 +1 -1
+ NTP_4_2_7P238
+
+ scripts/ntp-wait.1ntp-waitman@1.54 +2 -2
+ NTP_4_2_7P238
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.54 +2 -2
+ NTP_4_2_7P238
+
+ scripts/ntp-wait.html@1.58 +1 -1
+ NTP_4_2_7P238
+
+ scripts/ntp-wait.man.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ scripts/ntp-wait.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ sntp/sntp-opts.c@1.236 +3 -3
+ NTP_4_2_7P238
+
+ sntp/sntp-opts.h@1.236 +3 -3
+ NTP_4_2_7P238
+
+ sntp/sntp-opts.texi@1.236 +2 -2
+ NTP_4_2_7P238
+
+ sntp/sntp.1sntpman@1.56 +2 -2
+ NTP_4_2_7P238
+
+ sntp/sntp.1sntpmdoc@1.56 +2 -2
+ NTP_4_2_7P238
+
+ sntp/sntp.html@1.236 +2 -2
+ NTP_4_2_7P238
+
+ sntp/sntp.man.in@1.56 +2 -2
+ NTP_4_2_7P238
+
+ sntp/sntp.mdoc.in@1.56 +2 -2
+ NTP_4_2_7P238
+
+ util/ntp-keygen-opts.c@1.240 +3 -3
+ NTP_4_2_7P238
+
+ util/ntp-keygen-opts.h@1.240 +3 -3
+ NTP_4_2_7P238
+
+ util/ntp-keygen-opts.texi@1.241 +2 -2
+ NTP_4_2_7P238
+
+ util/ntp-keygen.1ntp-keygenman@1.54 +2 -2
+ NTP_4_2_7P238
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.54 +2 -2
+ NTP_4_2_7P238
+
+ util/ntp-keygen.man.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ util/ntp-keygen.mdoc.in@1.54 +2 -2
+ NTP_4_2_7P238
+
+ChangeSet@1.2082.4.257, 2011-12-08 21:09:05-05:00, stenn@deacon.udel.edu
+ NTP_4_2_6P5_RC3
+ TAG: NTP_4_2_6P5_RC3
+
+ ChangeLog@1.496.26.184 +1 -0
+ NTP_4_2_6P5_RC3
+
+ ntpd/ntpd-opts.c@1.248.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpd/ntpd-opts.h@1.248.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpd/ntpd-opts.texi@1.246.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ ntpd/ntpd.1@1.246.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ ntpdc/ntpdc-opts.c@1.244.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpdc/ntpdc-opts.h@1.244.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpdc/ntpdc-opts.texi@1.243.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ ntpdc/ntpdc.1@1.243.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ ntpq/ntpq-opts.c@1.245.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpq/ntpq-opts.h@1.245.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpq/ntpq-opts.texi@1.244.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ ntpq/ntpq.1@1.244.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.43.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.43.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.42.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ ntpsnmpd/ntpsnmpd.1@1.122.42.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ packageinfo.sh@1.255.39.1 +1 -1
+ NTP_4_2_6P5_RC3
+
+ sntp/sntp-opts.c@1.117.41.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ sntp/sntp-opts.h@1.117.41.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ sntp/sntp-opts.texi@1.117.40.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ sntp/sntp.1@1.117.40.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ sntp/sntp.html@1.7.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ util/ntp-keygen-opts.c@1.247.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ util/ntp-keygen-opts.h@1.247.42.1 +3 -3
+ NTP_4_2_6P5_RC3
+
+ util/ntp-keygen-opts.texi@1.246.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ util/ntp-keygen.1@1.246.41.1 +2 -2
+ NTP_4_2_6P5_RC3
+
+ChangeSet@1.2082.4.256, 2011-12-08 00:21:36-05:00, stenn@deacon.udel.edu
+ Update NEWS for RC3
+
+ NEWS@1.122.1.2 +6 -1
+ Update NEWS for RC3
+
+ChangeSet@1.2716, 2011-12-07 23:17:43+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct ChangeLog merge to duplicate -stable entries in -dev section.
+
+ ChangeLog@1.1068 +6 -0
+ Correct ChangeLog merge to duplicate -stable entries in -dev section.
+
+ChangeSet@1.2082.4.255, 2011-12-07 22:28:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2087] sys_jitter calculation overweights sys.peer jitter.
+
+ ChangeLog@1.496.26.183 +1 -0
+ [Bug 2087] sys_jitter calculation overweights sys.peer jitter.
+
+ ntpd/ntp_proto.c@1.297.2.10 +2 -2
+ [Bug 2087] sys_jitter calculation overweights sys.peer jitter.
+
+ChangeSet@1.2082.4.254, 2011-12-07 22:24:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2086] get_systime() should not offset by sys_residual.
+
+ ChangeLog@1.496.26.182 +1 -0
+ [Bug 2086] get_systime() should not offset by sys_residual.
+
+ libntp/systime.c@1.48.1.1 +2 -2
+ [Bug 2086] get_systime() should not offset by sys_residual.
+
+ChangeSet@1.2082.4.253, 2011-12-07 22:21:41+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2085] clock_update() sys_rootdisp calculation omits root delay.
+
+ ChangeLog@1.496.26.181 +1 -0
+ [Bug 2085] clock_update() sys_rootdisp calculation omits root delay.
+
+ ntpd/ntp_proto.c@1.297.2.9 +2 -1
+ [Bug 2085] clock_update() sys_rootdisp calculation omits root delay.
+
+ChangeSet@1.2082.4.252, 2011-12-05 17:07:40+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot.
+ Ensure NULL peer->dstadr is not accessed in orphan parent selection.
+
+ ChangeLog@1.496.26.180 +5 -0
+ [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot.
+ Ensure NULL peer->dstadr is not accessed in orphan parent selection.
+
+ ntpd/ntp_control.c@1.129.1.8 +2 -1
+ [Bug 2082] 3-char refid sent by ntpd 4.2.6p5-RC2 ends with extra dot.
+
+ ntpd/ntp_proto.c@1.297.2.8 +4 -1
+ Ensure NULL peer->dstadr is not accessed in orphan parent selection.
+
+ChangeSet@1.2713, 2011-12-01 05:30:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P237
+ TAG: NTP_4_2_7P237
+
+ ChangeLog@1.1065 +1 -0
+ NTP_4_2_7P237
+
+ ntpd/ntpd-opts.c@1.242 +3 -3
+ NTP_4_2_7P237
+
+ ntpd/ntpd-opts.h@1.242 +3 -3
+ NTP_4_2_7P237
+
+ ntpd/ntpd-opts.texi@1.240 +2 -2
+ NTP_4_2_7P237
+
+ ntpd/ntpd.1ntpdman@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpd/ntpd.1ntpdmdoc@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpd/ntpd.man.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpd/ntpd.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc-opts.c@1.237 +3 -3
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc-opts.h@1.237 +3 -3
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc-opts.texi@1.237 +2 -2
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc.1ntpdcman@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc.html@1.65 +2 -2
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc.man.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpdc/ntpdc.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpq/ntpq-opts.c@1.239 +3 -3
+ NTP_4_2_7P237
+
+ ntpq/ntpq-opts.h@1.239 +3 -3
+ NTP_4_2_7P237
+
+ ntpq/ntpq-opts.texi@1.239 +2 -2
+ NTP_4_2_7P237
+
+ ntpq/ntpq.1ntpqman@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpq/ntpq.1ntpqmdoc@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpq/ntpq.man.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpq/ntpq.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.239 +3 -3
+ NTP_4_2_7P237
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.239 +3 -3
+ NTP_4_2_7P237
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.239 +2 -2
+ NTP_4_2_7P237
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpsnmpd/ntpsnmpd.man.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ packageinfo.sh@1.240 +1 -1
+ NTP_4_2_7P237
+
+ scripts/ntp-wait-opts.texi@1.57 +1 -1
+ NTP_4_2_7P237
+
+ scripts/ntp-wait.1ntp-waitman@1.53 +2 -2
+ NTP_4_2_7P237
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.53 +2 -2
+ NTP_4_2_7P237
+
+ scripts/ntp-wait.html@1.57 +1 -1
+ NTP_4_2_7P237
+
+ scripts/ntp-wait.man.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ scripts/ntp-wait.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ sntp/sntp-opts.c@1.235 +3 -3
+ NTP_4_2_7P237
+
+ sntp/sntp-opts.h@1.235 +3 -3
+ NTP_4_2_7P237
+
+ sntp/sntp-opts.texi@1.235 +2 -2
+ NTP_4_2_7P237
+
+ sntp/sntp.1sntpman@1.55 +2 -2
+ NTP_4_2_7P237
+
+ sntp/sntp.1sntpmdoc@1.55 +2 -2
+ NTP_4_2_7P237
+
+ sntp/sntp.html@1.235 +2 -2
+ NTP_4_2_7P237
+
+ sntp/sntp.man.in@1.55 +2 -2
+ NTP_4_2_7P237
+
+ sntp/sntp.mdoc.in@1.55 +2 -2
+ NTP_4_2_7P237
+
+ util/ntp-keygen-opts.c@1.239 +3 -3
+ NTP_4_2_7P237
+
+ util/ntp-keygen-opts.h@1.239 +3 -3
+ NTP_4_2_7P237
+
+ util/ntp-keygen-opts.texi@1.240 +2 -2
+ NTP_4_2_7P237
+
+ util/ntp-keygen.1ntp-keygenman@1.53 +2 -2
+ NTP_4_2_7P237
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.53 +2 -2
+ NTP_4_2_7P237
+
+ util/ntp-keygen.man.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ util/ntp-keygen.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P237
+
+ChangeSet@1.2082.4.251, 2011-11-30 22:06:41-05:00, stenn@deacon.udel.edu
+ NTP_4_2_6P5_RC2
+ TAG: NTP_4_2_6P5_RC2
+
+ ChangeLog@1.496.26.179 +1 -0
+ NTP_4_2_6P5_RC2
+
+ ntpd/ntpd-opts.c@1.248.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpd/ntpd-opts.h@1.248.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpd/ntpd-opts.texi@1.246.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ ntpd/ntpd.1@1.246.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ ntpdc/ntpdc-opts.c@1.244.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpdc/ntpdc-opts.h@1.244.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpdc/ntpdc-opts.texi@1.243.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ ntpdc/ntpdc.1@1.243.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ ntpq/ntpq-opts.c@1.245.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpq/ntpq-opts.h@1.245.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpq/ntpq-opts.texi@1.244.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ ntpq/ntpq.1@1.244.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.42.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.42.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.41.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ ntpsnmpd/ntpsnmpd.1@1.122.41.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ packageinfo.sh@1.255.38.1 +1 -1
+ NTP_4_2_6P5_RC2
+
+ sntp/sntp-opts.c@1.117.40.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ sntp/sntp-opts.h@1.117.40.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ sntp/sntp-opts.texi@1.117.39.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ sntp/sntp.1@1.117.39.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ sntp/sntp.html@1.7.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ util/ntp-keygen-opts.c@1.247.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ util/ntp-keygen-opts.h@1.247.41.1 +3 -3
+ NTP_4_2_6P5_RC2
+
+ util/ntp-keygen-opts.texi@1.246.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ util/ntp-keygen.1@1.246.40.1 +2 -2
+ NTP_4_2_6P5_RC2
+
+ChangeSet@1.2082.4.250, 2011-11-30 21:49:45-05:00, stenn@pogo.udel.edu
+ update
+
+ NEWS@1.122.1.1 +20 -5
+ update
+
+ChangeSet@1.2711, 2011-11-30 04:00:32+00:00, davehart@shiny.ad.hartbrothers.com
+ Floor calculation of sys_rootdisp at sys_mindisp in clock_update (from
+ Dave Mills).
+
+ ChangeLog@1.1063 +2 -0
+ Floor calculation of sys_rootdisp at sys_mindisp in clock_update (from
+ Dave Mills).
+
+ ntpd/ntp_proto.c@1.332 +6 -3
+ Floor calculation of sys_rootdisp at sys_mindisp in clock_update (from
+ Dave Mills).
+
+ChangeSet@1.2709, 2011-11-29 21:58:49+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2073] Correct ntpq billboard's MODE_PASSIVE t from 'u' to 'S'.
+ Round l_fp traffic interval when converting to integer in rate limit
+ and KoD calculation.
+
+ ChangeLog@1.1061 +4 -1
+ [Bug 2073] Correct ntpq billboard's MODE_PASSIVE t from 'u' to 'S'.
+ Round l_fp traffic interval when converting to integer in rate limit
+ and KoD calculation.
+
+ include/ntp.h@1.201 +1 -1
+ MDF_UCLNT indicates preemptible, not ephemeral (comment fix).
+
+ ntpd/ntp_monitor.c@1.40 +5 -1
+ Round l_fp traffic interval when converting to integer in rate limit
+ and KoD calculation.
+
+ ntpd/ntp_peer.c@1.151 +20 -2
+ provide debug trace output of newpeer()/findexistingpeer() search
+ for duplicate associations.
+
+ ntpd/ntp_proto.c@1.330 +12 -10
+ Avoid duplicate "no servers found".
+
+ ntpq/ntpq-subs.c@1.95 +6 -2
+ [Bug 2073] Correct ntpq billboard's MODE_PASSIVE t from 'u' to 'S'.
+
+ChangeSet@1.2082.4.249, 2011-11-29 13:35:16+00:00, davehart@shiny.ad.hartbrothers.com
+ merge cleanup
+
+ ChangeLog@1.496.26.178 +0 -1
+ merge cleanup
+
+ChangeSet@1.2082.47.2, 2011-11-29 13:33:26+00:00, davehart@shiny.ad.hartbrothers.com
+ Never send KoD rate limiting response to MODE_SERVER response.
+
+ ChangeLog@1.496.61.2 +3 -1
+ Never send KoD rate limiting response to MODE_SERVER response.
+
+ ntpd/ntp_crypto.c@1.146.1.1 +1 -1
+ Use () to enforce intended precendence of & and && operators
+
+ ntpd/ntp_proto.c@1.297.3.2 +3 -3
+ Never send KoD rate limiting response to MODE_SERVER response.
+
+ChangeSet@1.2082.48.2, 2011-11-27 00:39:11+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2072] Orphan parent selection metric needs ntohl().
+
+ ChangeLog@1.496.62.1 +1 -0
+ [Bug 2072] Orphan parent selection metric needs ntohl().
+
+ libntp/a_md5encrypt.c@1.26.1.2 +1 -0
+ [Bug 2072] Orphan parent selection metric needs ntohl().
+
+ ntpd/ntp_proto.c@1.297.4.1 +3 -3
+ [Bug 2072] Orphan parent selection metric needs ntohl().
+
+ChangeSet@1.2707, 2011-11-26 23:06:48+00:00, davehart@shiny.ad.hartbrothers.com
+ more merge cleanup
+
+ include/lib_strbuf.h@1.11 +4 -0
+ guard against multiple inclusion (more merge cleanup)
+
+ include/ntp_fp.h@1.26 +1 -1
+ more merge cleanup
+
+ include/ntp_types.h@1.30 +11 -11
+ more merge cleanup
+
+ChangeSet@1.2082.48.1, 2011-11-26 19:43:12+00:00, davehart@shiny.ad.hartbrothers.com
+ Avoid redefinition warnings for INT32_MIN, INT32_MAX, U_INT32_MAX.
+
+ include/ntp_types.h@1.14.1.3 +18 -6
+ Avoid redefinition warnings for INT32_MIN, INT32_MAX, U_INT32_MAX.
+
+ChangeSet@1.2705, 2011-11-26 12:50:07+00:00, davehart@shiny.ad.hartbrothers.com
+ Restore 4.2.6 clock_combine() weighting to ntp-dev, reverting
+ to pre-4.2.7p70 logic and avoiding divide-by-zero (from Dave Mills).
+
+ ChangeLog@1.1059 +3 -1
+ Restore 4.2.6 clock_combine() weighting to ntp-dev, reverting
+ to pre-4.2.7p70 logic and avoiding divide-by-zero (from Dave Mills).
+
+ ntpd/ntp_proto.c@1.328 +5 -5
+ Restore 4.2.6 clock_combine() weighting to ntp-dev, reverting
+ to pre-4.2.7p70 logic and avoiding divide-by-zero (from Dave Mills).
+
+ChangeSet@1.2704, 2011-11-26 12:11:56+00:00, davehart@shiny.ad.hartbrothers.com
+ merge cleanup
+
+ ntpd/ntp_control.c@1.176 +6 -6
+ merge cleanup
+
+ ntpd/ntp_io.c@1.363 +0 -11
+ merge cleanup
+
+ ntpd/ntp_peer.c@1.150 +6 -4
+ merge cleanup
+
+ ntpd/ntp_proto.c@1.327 +1 -1
+ merge cleanup
+
+ ntpq/ntpq-subs.c@1.94 +28 -18
+ merge cleanup
+
+ ntpq/ntpq.c@1.143 +3 -3
+ merge cleanup
+
+ ntpq/ntpq.h@1.26 +2 -2
+ merge cleanup
+
+ChangeSet@1.2082.47.1, 2011-11-25 10:23:58+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2059] optional billboard column "server" does not honor -n.
+ [Bug 2066] ntpq lopeers ipv6 "local" column overrun.
+ [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq.
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+ Exclude not-yet-determined sys_refid from use in loopback TEST12
+ (from David Mills).
+
+ ChangeLog@1.496.61.1 +9 -0
+ [Bug 2059] optional billboard column "server" does not honor -n.
+ [Bug 2066] ntpq lopeers ipv6 "local" column overrun.
+ [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq.
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+ Exclude not-yet-determined sys_refid from use in loopback TEST12
+ (from David Mills).
+
+ include/ntp.h@1.168.1.7 +1 -0
+ Add peer flag FLAG_BC_VOL indicating the broadcastclient delay
+ calibration is still in progress.
+
+ include/ntp_refclock.h@1.24.1.2 +1 -1
+ [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq.
+
+ include/ntp_request.h@1.40.1.1 +2 -2
+ [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq.
+
+ include/ntpd.h@1.137.2.7 +3 -1
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+ backport latoa() -> localaddrtoa(endpt *) from 4.2.7
+
+ ntpd/ntp_config.c@1.241.1.10 +1 -1
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+
+ ntpd/ntp_control.c@1.129.1.7 +50 -37
+ [Bug 2068] ntpd sends nonprintable stratum 16 refid to ntpq.
+
+ ntpd/ntp_io.c@1.306.1.17 +11 -0
+ backport latoa() -> localaddrtoa(endpt *) from 4.2.7
+
+ ntpd/ntp_peer.c@1.126.1.4 +40 -21
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+
+ ntpd/ntp_proto.c@1.297.3.1 +53 -14
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+ Exclude not-yet-determined sys_refid from use in loopback TEST12
+ (from David Mills).
+
+ ntpd/ntp_refclock.c@1.92.1.3 +2 -2
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+
+ ntpd/ntp_request.c@1.82.1.6 +13 -11
+ [Bug 2069] broadcastclient, multicastclient spin up duplicate
+ ephemeral associations without broadcastdelay.
+
+ ntpq/ntpq-subs.c@1.39.2.6 +42 -22
+ [Bug 2059] optional billboard column "server" does not honor -n.
+ [Bug 2066] ntpq lopeers ipv6 "local" column overrun.
+
+ ntpq/ntpq.c@1.97.1.10 +94 -9
+ [Bug 2059] optional billboard column "server" does not honor -n.
+
+ ntpq/ntpq.h@1.10.1.5 +4 -0
+ [Bug 2059] optional billboard column "server" does not honor -n.
+ [Bug 2066] ntpq lopeers ipv6 "local" column overrun.
+
+ChangeSet@1.2082.4.244, 2011-11-21 09:35:28+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2050] Orphan mode stratum counting to infinity.
+
+ ChangeLog@1.496.26.174 +4 -0
+ [Bug 2050] Orphan mode stratum counting to infinity.
+
+ include/ntp_types.h@1.14.1.2 +6 -0
+ [Bug 2050] Orphan mode stratum counting to infinity.
+
+ ntpd/ntp_proto.c@1.297.2.4 +31 -8
+ [Bug 2050] Orphan mode stratum counting to infinity.
+
+ ntpd/ntp_timer.c@1.56.1.1 +2 -2
+ [Bug 2050] Orphan mode stratum counting to infinity.
+
+ChangeSet@1.2702, 2011-11-16 10:47:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P236
+ TAG: NTP_4_2_7P236
+
+ ChangeLog@1.1057 +1 -0
+ NTP_4_2_7P236
+
+ ntpd/ntpd-opts.c@1.241 +3 -3
+ NTP_4_2_7P236
+
+ ntpd/ntpd-opts.h@1.241 +3 -3
+ NTP_4_2_7P236
+
+ ntpd/ntpd-opts.texi@1.239 +2 -2
+ NTP_4_2_7P236
+
+ ntpd/ntpd.1ntpdman@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpd/ntpd.1ntpdmdoc@1.52 +1 -1
+ NTP_4_2_7P236
+
+ ntpd/ntpd.man.in@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpd/ntpd.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc-opts.c@1.236 +3 -3
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc-opts.h@1.236 +3 -3
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc-opts.texi@1.236 +2 -2
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc.1ntpdcman@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.52 +1 -1
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc.html@1.64 +2 -2
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc.man.in@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpdc/ntpdc.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P236
+
+ ntpq/ntpq-opts.c@1.238 +3 -3
+ NTP_4_2_7P236
+
+ ntpq/ntpq-opts.h@1.238 +3 -3
+ NTP_4_2_7P236
+
+ ntpq/ntpq-opts.texi@1.238 +2 -2
+ NTP_4_2_7P236
+
+ ntpq/ntpq.1ntpqman@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpq/ntpq.1ntpqmdoc@1.52 +1 -1
+ NTP_4_2_7P236
+
+ ntpq/ntpq.man.in@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpq/ntpq.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P236
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.238 +3 -3
+ NTP_4_2_7P236
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.238 +3 -3
+ NTP_4_2_7P236
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.238 +2 -2
+ NTP_4_2_7P236
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.52 +1 -1
+ NTP_4_2_7P236
+
+ ntpsnmpd/ntpsnmpd.man.in@1.52 +2 -2
+ NTP_4_2_7P236
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P236
+
+ packageinfo.sh@1.239 +1 -1
+ NTP_4_2_7P236
+
+ scripts/ntp-wait-opts.texi@1.56 +1 -1
+ NTP_4_2_7P236
+
+ scripts/ntp-wait.1ntp-waitman@1.52 +2 -2
+ NTP_4_2_7P236
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.52 +1 -1
+ NTP_4_2_7P236
+
+ scripts/ntp-wait.html@1.56 +1 -1
+ NTP_4_2_7P236
+
+ scripts/ntp-wait.man.in@1.52 +2 -2
+ NTP_4_2_7P236
+
+ scripts/ntp-wait.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P236
+
+ sntp/sntp-opts.c@1.234 +3 -3
+ NTP_4_2_7P236
+
+ sntp/sntp-opts.h@1.234 +3 -3
+ NTP_4_2_7P236
+
+ sntp/sntp-opts.texi@1.234 +2 -2
+ NTP_4_2_7P236
+
+ sntp/sntp.1sntpman@1.54 +2 -2
+ NTP_4_2_7P236
+
+ sntp/sntp.1sntpmdoc@1.54 +1 -1
+ NTP_4_2_7P236
+
+ sntp/sntp.html@1.234 +2 -2
+ NTP_4_2_7P236
+
+ sntp/sntp.man.in@1.54 +2 -2
+ NTP_4_2_7P236
+
+ sntp/sntp.mdoc.in@1.54 +1 -1
+ NTP_4_2_7P236
+
+ util/ntp-keygen-opts.c@1.238 +3 -3
+ NTP_4_2_7P236
+
+ util/ntp-keygen-opts.h@1.238 +3 -3
+ NTP_4_2_7P236
+
+ util/ntp-keygen-opts.texi@1.239 +2 -2
+ NTP_4_2_7P236
+
+ util/ntp-keygen.1ntp-keygenman@1.52 +2 -2
+ NTP_4_2_7P236
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.52 +1 -1
+ NTP_4_2_7P236
+
+ util/ntp-keygen.man.in@1.52 +2 -2
+ NTP_4_2_7P236
+
+ util/ntp-keygen.mdoc.in@1.52 +1 -1
+ NTP_4_2_7P236
+
+ChangeSet@1.2701, 2011-11-16 00:27:58-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1056 +1 -0
+ Documentation updates from Dave Mills
+
+ html/index.html@1.44 +8 -8
+ Documentation updates from Dave Mills
+
+ html/rate.html@1.10 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2700, 2011-11-16 03:15:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P235
+ TAG: NTP_4_2_7P235
+
+ ChangeLog@1.1055 +1 -0
+ NTP_4_2_7P235
+
+ ntpd/ntpd-opts.c@1.240 +3 -3
+ NTP_4_2_7P235
+
+ ntpd/ntpd-opts.h@1.240 +3 -3
+ NTP_4_2_7P235
+
+ ntpd/ntpd-opts.texi@1.238 +2 -2
+ NTP_4_2_7P235
+
+ ntpd/ntpd.1ntpdman@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpd/ntpd.1ntpdmdoc@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpd/ntpd.man.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpd/ntpd.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc-opts.c@1.235 +3 -3
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc-opts.h@1.235 +3 -3
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc-opts.texi@1.235 +2 -2
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc.1ntpdcman@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc.html@1.63 +2 -2
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc.man.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpdc/ntpdc.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpq/ntpq-opts.c@1.237 +3 -3
+ NTP_4_2_7P235
+
+ ntpq/ntpq-opts.h@1.237 +3 -3
+ NTP_4_2_7P235
+
+ ntpq/ntpq-opts.texi@1.237 +2 -2
+ NTP_4_2_7P235
+
+ ntpq/ntpq.1ntpqman@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpq/ntpq.1ntpqmdoc@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpq/ntpq.man.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpq/ntpq.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.237 +3 -3
+ NTP_4_2_7P235
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.237 +3 -3
+ NTP_4_2_7P235
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.237 +2 -2
+ NTP_4_2_7P235
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpsnmpd/ntpsnmpd.man.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ packageinfo.sh@1.238 +1 -1
+ NTP_4_2_7P235
+
+ scripts/ntp-wait-opts.texi@1.55 +1 -1
+ NTP_4_2_7P235
+
+ scripts/ntp-wait.1ntp-waitman@1.51 +2 -2
+ NTP_4_2_7P235
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.51 +2 -2
+ NTP_4_2_7P235
+
+ scripts/ntp-wait.html@1.55 +1 -1
+ NTP_4_2_7P235
+
+ scripts/ntp-wait.man.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ scripts/ntp-wait.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ sntp/sntp-opts.c@1.233 +3 -3
+ NTP_4_2_7P235
+
+ sntp/sntp-opts.h@1.233 +3 -3
+ NTP_4_2_7P235
+
+ sntp/sntp-opts.texi@1.233 +2 -2
+ NTP_4_2_7P235
+
+ sntp/sntp.1sntpman@1.53 +2 -2
+ NTP_4_2_7P235
+
+ sntp/sntp.1sntpmdoc@1.53 +2 -2
+ NTP_4_2_7P235
+
+ sntp/sntp.html@1.233 +2 -2
+ NTP_4_2_7P235
+
+ sntp/sntp.man.in@1.53 +2 -2
+ NTP_4_2_7P235
+
+ sntp/sntp.mdoc.in@1.53 +2 -2
+ NTP_4_2_7P235
+
+ util/ntp-keygen-opts.c@1.237 +3 -3
+ NTP_4_2_7P235
+
+ util/ntp-keygen-opts.h@1.237 +3 -3
+ NTP_4_2_7P235
+
+ util/ntp-keygen-opts.texi@1.238 +2 -2
+ NTP_4_2_7P235
+
+ util/ntp-keygen.1ntp-keygenman@1.51 +2 -2
+ NTP_4_2_7P235
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.51 +2 -2
+ NTP_4_2_7P235
+
+ util/ntp-keygen.man.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ util/ntp-keygen.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P235
+
+ChangeSet@1.2699, 2011-11-08 18:44:39+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2052] Autokey CRYPTO_ASSOC host@group vallen needs checking.
+
+ ChangeLog@1.1054 +1 -0
+ [Bug 2052] Autokey CRYPTO_ASSOC host@group vallen needs checking.
+
+ ntpd/ntp_proto.c@1.325 +27 -18
+ [Bug 2052] Autokey CRYPTO_ASSOC host@group vallen needs checking.
+ Fix a number of comment typos.
+
+ChangeSet@1.2698, 2011-11-07 23:09:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P234
+ TAG: NTP_4_2_7P234
+
+ ChangeLog@1.1053 +1 -0
+ NTP_4_2_7P234
+
+ ntpd/ntpd-opts.c@1.239 +3 -3
+ NTP_4_2_7P234
+
+ ntpd/ntpd-opts.h@1.239 +3 -3
+ NTP_4_2_7P234
+
+ ntpd/ntpd-opts.texi@1.237 +2 -2
+ NTP_4_2_7P234
+
+ ntpd/ntpd.1ntpdman@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpd/ntpd.1ntpdmdoc@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpd/ntpd.man.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpd/ntpd.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc-opts.c@1.234 +3 -3
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc-opts.h@1.234 +3 -3
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc-opts.texi@1.234 +2 -2
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc.1ntpdcman@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc.html@1.62 +2 -2
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc.man.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpdc/ntpdc.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpq/ntpq-opts.c@1.236 +3 -3
+ NTP_4_2_7P234
+
+ ntpq/ntpq-opts.h@1.236 +3 -3
+ NTP_4_2_7P234
+
+ ntpq/ntpq-opts.texi@1.236 +2 -2
+ NTP_4_2_7P234
+
+ ntpq/ntpq.1ntpqman@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpq/ntpq.1ntpqmdoc@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpq/ntpq.man.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpq/ntpq.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.236 +3 -3
+ NTP_4_2_7P234
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.236 +3 -3
+ NTP_4_2_7P234
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.236 +2 -2
+ NTP_4_2_7P234
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpsnmpd/ntpsnmpd.man.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ packageinfo.sh@1.237 +1 -1
+ NTP_4_2_7P234
+
+ scripts/ntp-wait-opts.texi@1.54 +1 -1
+ NTP_4_2_7P234
+
+ scripts/ntp-wait.1ntp-waitman@1.50 +2 -2
+ NTP_4_2_7P234
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.50 +2 -2
+ NTP_4_2_7P234
+
+ scripts/ntp-wait.html@1.54 +1 -1
+ NTP_4_2_7P234
+
+ scripts/ntp-wait.man.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ scripts/ntp-wait.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ sntp/sntp-opts.c@1.232 +3 -3
+ NTP_4_2_7P234
+
+ sntp/sntp-opts.h@1.232 +3 -3
+ NTP_4_2_7P234
+
+ sntp/sntp-opts.texi@1.232 +2 -2
+ NTP_4_2_7P234
+
+ sntp/sntp.1sntpman@1.52 +2 -2
+ NTP_4_2_7P234
+
+ sntp/sntp.1sntpmdoc@1.52 +2 -2
+ NTP_4_2_7P234
+
+ sntp/sntp.html@1.232 +2 -2
+ NTP_4_2_7P234
+
+ sntp/sntp.man.in@1.52 +2 -2
+ NTP_4_2_7P234
+
+ sntp/sntp.mdoc.in@1.52 +2 -2
+ NTP_4_2_7P234
+
+ util/ntp-keygen-opts.c@1.236 +3 -3
+ NTP_4_2_7P234
+
+ util/ntp-keygen-opts.h@1.236 +3 -3
+ NTP_4_2_7P234
+
+ util/ntp-keygen-opts.texi@1.237 +2 -2
+ NTP_4_2_7P234
+
+ util/ntp-keygen.1ntp-keygenman@1.50 +2 -2
+ NTP_4_2_7P234
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.50 +2 -2
+ NTP_4_2_7P234
+
+ util/ntp-keygen.man.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ util/ntp-keygen.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P234
+
+ChangeSet@1.2697, 2011-11-07 01:54:46-05:00, stenn@deacon.udel.edu
+ LDADD cleanup
+
+ libparse/Makefile.am@1.28 +2 -2
+ LDADD cleanup
+
+ ntpdc/Makefile.am@1.68 +1 -1
+ LDADD cleanup
+
+ ntpq/Makefile.am@1.64 +1 -1
+ LDADD cleanup
+
+ChangeSet@1.2696, 2011-11-07 01:04:24-05:00, stenn@deacon.udel.edu
+ Clean up -libm entries regarding libntp.a
+
+ ChangeLog@1.1052 +1 -0
+ Clean up -libm entries regarding libntp.a
+
+ adjtimed/Makefile.am@1.15 +1 -1
+ Clean up -libm entries regarding libntp.a
+
+ clockstuff/Makefile.am@1.21 +2 -2
+ Clean up -libm entries regarding libntp.a
+
+ libparse/Makefile.am@1.27 +2 -2
+ Clean up -libm entries regarding libntp.a
+
+ ntpd/Makefile.am@1.111 +3 -3
+ Clean up -libm entries regarding libntp.a
+
+ ntpdc/Makefile.am@1.67 +3 -2
+ Clean up -libm entries regarding libntp.a
+
+ ntpq/Makefile.am@1.63 +3 -2
+ Clean up -libm entries regarding libntp.a
+
+ parseutil/Makefile.am@1.17 +1 -1
+ Clean up -libm entries regarding libntp.a
+
+ sntp/Makefile.am@1.69 +1 -3
+ Clean up -libm entries regarding libntp.a
+
+ util/Makefile.am@1.67 +2 -2
+ Clean up -libm entries regarding libntp.a
+
+ChangeSet@1.2695, 2011-11-06 11:16:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P233
+ TAG: NTP_4_2_7P233
+
+ ChangeLog@1.1051 +1 -0
+ NTP_4_2_7P233
+
+ ntpd/ntpd-opts.c@1.238 +3 -3
+ NTP_4_2_7P233
+
+ ntpd/ntpd-opts.h@1.238 +3 -3
+ NTP_4_2_7P233
+
+ ntpd/ntpd-opts.texi@1.236 +2 -2
+ NTP_4_2_7P233
+
+ ntpd/ntpd.1ntpdman@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpd/ntpd.1ntpdmdoc@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpd/ntpd.man.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpd/ntpd.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc-opts.c@1.233 +3 -3
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc-opts.h@1.233 +3 -3
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc-opts.texi@1.233 +2 -2
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc.1ntpdcman@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc.html@1.61 +2 -2
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc.man.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpdc/ntpdc.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpq/ntpq-opts.c@1.235 +3 -3
+ NTP_4_2_7P233
+
+ ntpq/ntpq-opts.h@1.235 +3 -3
+ NTP_4_2_7P233
+
+ ntpq/ntpq-opts.texi@1.235 +2 -2
+ NTP_4_2_7P233
+
+ ntpq/ntpq.1ntpqman@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpq/ntpq.1ntpqmdoc@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpq/ntpq.man.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpq/ntpq.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.235 +3 -3
+ NTP_4_2_7P233
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.235 +3 -3
+ NTP_4_2_7P233
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.235 +2 -2
+ NTP_4_2_7P233
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpsnmpd/ntpsnmpd.man.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ packageinfo.sh@1.236 +1 -1
+ NTP_4_2_7P233
+
+ scripts/ntp-wait-opts.texi@1.53 +1 -1
+ NTP_4_2_7P233
+
+ scripts/ntp-wait.1ntp-waitman@1.49 +2 -2
+ NTP_4_2_7P233
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.49 +2 -2
+ NTP_4_2_7P233
+
+ scripts/ntp-wait.html@1.53 +1 -1
+ NTP_4_2_7P233
+
+ scripts/ntp-wait.man.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ scripts/ntp-wait.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ sntp/sntp-opts.c@1.231 +3 -3
+ NTP_4_2_7P233
+
+ sntp/sntp-opts.h@1.231 +3 -3
+ NTP_4_2_7P233
+
+ sntp/sntp-opts.texi@1.231 +2 -2
+ NTP_4_2_7P233
+
+ sntp/sntp.1sntpman@1.51 +2 -2
+ NTP_4_2_7P233
+
+ sntp/sntp.1sntpmdoc@1.51 +2 -2
+ NTP_4_2_7P233
+
+ sntp/sntp.html@1.231 +2 -2
+ NTP_4_2_7P233
+
+ sntp/sntp.man.in@1.51 +2 -2
+ NTP_4_2_7P233
+
+ sntp/sntp.mdoc.in@1.51 +2 -2
+ NTP_4_2_7P233
+
+ util/ntp-keygen-opts.c@1.235 +3 -3
+ NTP_4_2_7P233
+
+ util/ntp-keygen-opts.h@1.235 +3 -3
+ NTP_4_2_7P233
+
+ util/ntp-keygen-opts.texi@1.236 +2 -2
+ NTP_4_2_7P233
+
+ util/ntp-keygen.1ntp-keygenman@1.49 +2 -2
+ NTP_4_2_7P233
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.49 +2 -2
+ NTP_4_2_7P233
+
+ util/ntp-keygen.man.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ util/ntp-keygen.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P233
+
+ChangeSet@1.2694, 2011-11-06 01:37:19-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1050 +1 -0
+ Documentation updates from Dave Mills
+
+ html/discipline.html@1.7 +1 -1
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.68 +5 -3
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.28 +28 -30
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2693, 2011-11-05 10:46:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P232
+ TAG: NTP_4_2_7P232
+
+ ChangeLog@1.1049 +1 -0
+ NTP_4_2_7P232
+
+ ntpd/ntpd-opts.c@1.237 +3 -3
+ NTP_4_2_7P232
+
+ ntpd/ntpd-opts.h@1.237 +3 -3
+ NTP_4_2_7P232
+
+ ntpd/ntpd-opts.texi@1.235 +2 -2
+ NTP_4_2_7P232
+
+ ntpd/ntpd.1ntpdman@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpd/ntpd.1ntpdmdoc@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpd/ntpd.man.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpd/ntpd.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc-opts.c@1.232 +3 -3
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc-opts.h@1.232 +3 -3
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc-opts.texi@1.232 +2 -2
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc.1ntpdcman@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc.html@1.60 +2 -2
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc.man.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpdc/ntpdc.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpq/ntpq-opts.c@1.234 +3 -3
+ NTP_4_2_7P232
+
+ ntpq/ntpq-opts.h@1.234 +3 -3
+ NTP_4_2_7P232
+
+ ntpq/ntpq-opts.texi@1.234 +2 -2
+ NTP_4_2_7P232
+
+ ntpq/ntpq.1ntpqman@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpq/ntpq.1ntpqmdoc@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpq/ntpq.man.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpq/ntpq.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.234 +3 -3
+ NTP_4_2_7P232
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.234 +3 -3
+ NTP_4_2_7P232
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.234 +2 -2
+ NTP_4_2_7P232
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpsnmpd/ntpsnmpd.man.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ packageinfo.sh@1.235 +1 -1
+ NTP_4_2_7P232
+
+ scripts/ntp-wait-opts.texi@1.52 +1 -1
+ NTP_4_2_7P232
+
+ scripts/ntp-wait.1ntp-waitman@1.48 +2 -2
+ NTP_4_2_7P232
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.48 +2 -2
+ NTP_4_2_7P232
+
+ scripts/ntp-wait.html@1.52 +1 -1
+ NTP_4_2_7P232
+
+ scripts/ntp-wait.man.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ scripts/ntp-wait.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ sntp/sntp-opts.c@1.230 +3 -3
+ NTP_4_2_7P232
+
+ sntp/sntp-opts.h@1.230 +3 -3
+ NTP_4_2_7P232
+
+ sntp/sntp-opts.texi@1.230 +2 -2
+ NTP_4_2_7P232
+
+ sntp/sntp.1sntpman@1.50 +2 -2
+ NTP_4_2_7P232
+
+ sntp/sntp.1sntpmdoc@1.50 +2 -2
+ NTP_4_2_7P232
+
+ sntp/sntp.html@1.230 +2 -2
+ NTP_4_2_7P232
+
+ sntp/sntp.man.in@1.50 +2 -2
+ NTP_4_2_7P232
+
+ sntp/sntp.mdoc.in@1.50 +2 -2
+ NTP_4_2_7P232
+
+ util/ntp-keygen-opts.c@1.234 +3 -3
+ NTP_4_2_7P232
+
+ util/ntp-keygen-opts.h@1.234 +3 -3
+ NTP_4_2_7P232
+
+ util/ntp-keygen-opts.texi@1.235 +2 -2
+ NTP_4_2_7P232
+
+ util/ntp-keygen.1ntp-keygenman@1.48 +2 -2
+ NTP_4_2_7P232
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.48 +2 -2
+ NTP_4_2_7P232
+
+ util/ntp-keygen.man.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ util/ntp-keygen.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P232
+
+ChangeSet@1.2692, 2011-11-05 00:03:53-04:00, stenn@deacon.udel.edu
+ Clean up some bitrotted code in libntp/socket.c
+
+ ChangeLog@1.1048 +1 -0
+ Clean up some bitrotted code in libntp/socket.c
+
+ libntp/socket.c@1.8 +2 -503
+ Clean up some bitrotted code in libntp/socket.c
+
+ChangeSet@1.2691, 2011-11-05 00:01:22-04:00, stenn@deacon.udel.edu
+ Update the NEWS file so we note the default disable of mode 7 requests
+
+ ChangeLog@1.1047 +1 -0
+ Update the NEWS file so we note the default disable of mode 7 requests
+
+ NEWS@1.124 +35 -0
+ Update the NEWS file so we note the default disable of mode 7 requests
+
+ChangeSet@1.2690, 2011-11-03 19:28:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P231
+ TAG: NTP_4_2_7P231
+
+ ChangeLog@1.1046 +1 -0
+ NTP_4_2_7P231
+
+ ntpd/ntpd-opts.c@1.236 +3 -3
+ NTP_4_2_7P231
+
+ ntpd/ntpd-opts.h@1.236 +3 -3
+ NTP_4_2_7P231
+
+ ntpd/ntpd-opts.texi@1.234 +2 -2
+ NTP_4_2_7P231
+
+ ntpd/ntpd.1ntpdman@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpd/ntpd.1ntpdmdoc@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpd/ntpd.man.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpd/ntpd.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc-opts.c@1.231 +3 -3
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc-opts.h@1.231 +3 -3
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc-opts.texi@1.231 +2 -2
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc.1ntpdcman@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc.html@1.59 +2 -2
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc.man.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpdc/ntpdc.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpq/ntpq-opts.c@1.233 +3 -3
+ NTP_4_2_7P231
+
+ ntpq/ntpq-opts.h@1.233 +3 -3
+ NTP_4_2_7P231
+
+ ntpq/ntpq-opts.texi@1.233 +2 -2
+ NTP_4_2_7P231
+
+ ntpq/ntpq.1ntpqman@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpq/ntpq.1ntpqmdoc@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpq/ntpq.man.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpq/ntpq.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.233 +3 -3
+ NTP_4_2_7P231
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.233 +3 -3
+ NTP_4_2_7P231
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.233 +2 -2
+ NTP_4_2_7P231
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpsnmpd/ntpsnmpd.man.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ packageinfo.sh@1.234 +1 -1
+ NTP_4_2_7P231
+
+ scripts/ntp-wait-opts.texi@1.51 +1 -1
+ NTP_4_2_7P231
+
+ scripts/ntp-wait.1ntp-waitman@1.47 +2 -2
+ NTP_4_2_7P231
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.47 +2 -2
+ NTP_4_2_7P231
+
+ scripts/ntp-wait.html@1.51 +1 -1
+ NTP_4_2_7P231
+
+ scripts/ntp-wait.man.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ scripts/ntp-wait.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ sntp/sntp-opts.c@1.229 +3 -3
+ NTP_4_2_7P231
+
+ sntp/sntp-opts.h@1.229 +3 -3
+ NTP_4_2_7P231
+
+ sntp/sntp-opts.texi@1.229 +2 -2
+ NTP_4_2_7P231
+
+ sntp/sntp.1sntpman@1.49 +2 -2
+ NTP_4_2_7P231
+
+ sntp/sntp.1sntpmdoc@1.49 +2 -2
+ NTP_4_2_7P231
+
+ sntp/sntp.html@1.229 +2 -2
+ NTP_4_2_7P231
+
+ sntp/sntp.man.in@1.49 +2 -2
+ NTP_4_2_7P231
+
+ sntp/sntp.mdoc.in@1.49 +2 -2
+ NTP_4_2_7P231
+
+ util/ntp-keygen-opts.c@1.233 +3 -3
+ NTP_4_2_7P231
+
+ util/ntp-keygen-opts.h@1.233 +3 -3
+ NTP_4_2_7P231
+
+ util/ntp-keygen-opts.texi@1.234 +2 -2
+ NTP_4_2_7P231
+
+ util/ntp-keygen.1ntp-keygenman@1.47 +2 -2
+ NTP_4_2_7P231
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.47 +2 -2
+ NTP_4_2_7P231
+
+ util/ntp-keygen.man.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ util/ntp-keygen.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P231
+
+ChangeSet@1.2689, 2011-11-03 10:46:39+00:00, davehart@shiny.ad.hartbrothers.com
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ ChangeLog@1.1045 +2 -0
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ include/ntp_control.h@1.58 +9 -1
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ include/ntp_stdlib.h@1.67 +3 -0
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ libntp/decodenetnum.c@1.16 +1 -0
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ libntp/socktoa.c@1.18 +26 -6
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ libntp/statestr.c@1.27 +49 -0
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ ntpd/ntp_control.c@1.174 +263 -66
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ ntpq/ntpq-subs.c@1.92 +218 -13
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ ntpq/ntpq.c@1.141 +40 -31
+ Add ntpq reslist command to query access restrictions, similar to
+ ntpdc's reslist.
+
+ChangeSet@1.2688, 2011-11-03 05:55:39+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ ChangeLog@1.1044 +1 -1
+ cleanup
+
+ChangeSet@1.2687, 2011-11-02 22:39:22+01:00, jnperlin@hydra.localnet
+ [Bug 1940] ignore auth key if hex decoding fails
+
+ ChangeLog@1.1043 +1 -0
+ [Bug 1940] ignore auth key if hex decoding fails
+
+ libntp/authreadkeys.c@1.18 +8 -6
+ [Bug 1940] ignore auth key if hex decoding fails
+
+ChangeSet@1.2686, 2011-11-01 10:56:11+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P230
+ TAG: NTP_4_2_7P230
+
+ ChangeLog@1.1042 +1 -0
+ NTP_4_2_7P230
+
+ ntpd/ntpd-opts.c@1.235 +3 -3
+ NTP_4_2_7P230
+
+ ntpd/ntpd-opts.h@1.235 +3 -3
+ NTP_4_2_7P230
+
+ ntpd/ntpd-opts.texi@1.233 +2 -2
+ NTP_4_2_7P230
+
+ ntpd/ntpd.1ntpdman@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpd/ntpd.1ntpdmdoc@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpd/ntpd.man.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpd/ntpd.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc-opts.c@1.230 +3 -3
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc-opts.h@1.230 +3 -3
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc-opts.texi@1.230 +2 -2
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc.1ntpdcman@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc.html@1.58 +2 -2
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc.man.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpdc/ntpdc.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpq/ntpq-opts.c@1.232 +3 -3
+ NTP_4_2_7P230
+
+ ntpq/ntpq-opts.h@1.232 +3 -3
+ NTP_4_2_7P230
+
+ ntpq/ntpq-opts.texi@1.232 +2 -2
+ NTP_4_2_7P230
+
+ ntpq/ntpq.1ntpqman@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpq/ntpq.1ntpqmdoc@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpq/ntpq.man.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpq/ntpq.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.232 +3 -3
+ NTP_4_2_7P230
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.232 +3 -3
+ NTP_4_2_7P230
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.232 +2 -2
+ NTP_4_2_7P230
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpsnmpd/ntpsnmpd.man.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ packageinfo.sh@1.233 +1 -1
+ NTP_4_2_7P230
+
+ scripts/ntp-wait-opts.texi@1.50 +1 -1
+ NTP_4_2_7P230
+
+ scripts/ntp-wait.1ntp-waitman@1.46 +2 -2
+ NTP_4_2_7P230
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.46 +2 -2
+ NTP_4_2_7P230
+
+ scripts/ntp-wait.html@1.50 +1 -1
+ NTP_4_2_7P230
+
+ scripts/ntp-wait.man.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ scripts/ntp-wait.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ sntp/sntp-opts.c@1.228 +3 -3
+ NTP_4_2_7P230
+
+ sntp/sntp-opts.h@1.228 +3 -3
+ NTP_4_2_7P230
+
+ sntp/sntp-opts.texi@1.228 +2 -2
+ NTP_4_2_7P230
+
+ sntp/sntp.1sntpman@1.48 +2 -2
+ NTP_4_2_7P230
+
+ sntp/sntp.1sntpmdoc@1.48 +2 -2
+ NTP_4_2_7P230
+
+ sntp/sntp.html@1.228 +2 -2
+ NTP_4_2_7P230
+
+ sntp/sntp.man.in@1.48 +2 -2
+ NTP_4_2_7P230
+
+ sntp/sntp.mdoc.in@1.48 +2 -2
+ NTP_4_2_7P230
+
+ util/ntp-keygen-opts.c@1.232 +3 -3
+ NTP_4_2_7P230
+
+ util/ntp-keygen-opts.h@1.232 +3 -3
+ NTP_4_2_7P230
+
+ util/ntp-keygen-opts.texi@1.233 +2 -2
+ NTP_4_2_7P230
+
+ util/ntp-keygen.1ntp-keygenman@1.46 +2 -2
+ NTP_4_2_7P230
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.46 +2 -2
+ NTP_4_2_7P230
+
+ util/ntp-keygen.man.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ util/ntp-keygen.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P230
+
+ChangeSet@1.2685, 2011-10-31 15:38:17-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1041 +1 -0
+ Documentation updates from Dave Mills
+
+ html/cluster.html@1.6 +7 -7
+ Documentation updates from Dave Mills
+
+ html/discipline.html@1.6 +2 -2
+ Documentation updates from Dave Mills
+
+ html/discover.html@1.4 +14 -12
+ Documentation updates from Dave Mills
+
+ html/drivers/driver22.html@1.20 +3 -3
+ Documentation updates from Dave Mills
+
+ html/filter.html@1.4 +4 -4
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.27 +12 -11
+ Documentation updates from Dave Mills
+
+ html/rate.html@1.9 +22 -17
+ Documentation updates from Dave Mills
+
+ html/select.html@1.4 +5 -4
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.19 +21 -20
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2684, 2011-10-31 14:54:08+00:00, davehart@shiny.ad.hartbrothers.com
+ use rand() twice to get about 32 bits of noise for mrulist.
+
+ ntpd/ntp_control.c@1.173 +3 -3
+ use rand() twice to get about 32 bits of noise for mrulist.
+
+ChangeSet@1.2683, 2011-10-31 04:40:04+00:00, davehart@shiny.ad.hartbrothers.com
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ ChangeLog@1.1040 +5 -0
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ include/ntp.h@1.199 +1 -0
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ ntpd/complete.conf@1.20 +1 -1
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ ntpd/keyword-gen-utd@1.15 +1 -1
+ derived from ntp_keyword.h
+
+ ntpd/keyword-gen.c@1.20 +1 -0
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ ntpd/ntp_config.c@1.294 +5 -1
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ ntpd/ntp_keyword.h@1.17 +545 -543
+ keyword-gen output
+
+ ntpd/ntp_parser.c@1.77 +831 -823
+ Bison output
+
+ ntpd/ntp_parser.h@1.44 +175 -173
+ Bison output
+
+ ntpd/ntp_parser.y@1.71 +14 -2
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ ntpd/ntp_proto.c@1.324 +7 -2
+ Disable mode 7 (ntpdc) query processing in ntpd by default. ntpq is
+ believed to provide all functionality ntpdc did, and uses a less-
+ fragile protocol that's safer and easier to maintain. If you do find
+ some management via ntpdc is needed, you can use "enable mode7" in the
+ ntpd configuration.
+
+ChangeSet@1.2682, 2011-10-31 03:52:23+00:00, davehart@shiny.ad.hartbrothers.com
+ Directly limit the number of datagrams in a mrulist response, rather
+ than limiting the number of entries returned to indirectly limit the
+ datagram count.
+
+ ChangeLog@1.1039 +3 -0
+ Directly limit the number of datagrams in a mrulist response, rather
+ than limiting the number of entries returned to indirectly limit the
+ datagram count.
+
+ include/ntp.h@1.198 +2 -0
+ Directly limit the number of datagrams in a mrulist response, rather
+ than limiting the number of entries returned to indirectly limit the
+ datagram count.
+
+ libntp/ntp_random.c@1.9 +8 -5
+ Seed rand() while seeding ntp_random(), so that code needing low-grade
+ random numbers can use the former.
+
+ ntpd/ntp_control.c@1.172 +53 -28
+ Directly limit the number of datagrams in a mrulist response, rather
+ than limiting the number of entries returned to indirectly limit the
+ datagram count.
+
+ ntpq/ntpq-subs.c@1.91 +53 -21
+ Directly limit the number of datagrams in a mrulist response, rather
+ than limiting the number of entries returned to indirectly limit the
+ datagram count.
+
+ util/ntp-keygen.c@1.87 +1 -1
+ Use a better random seed for ntp-keygen (tv_sec + tv_usec)
+
+ChangeSet@1.2681, 2011-10-26 00:22:53+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P229
+ TAG: NTP_4_2_7P229
+
+ ChangeLog@1.1038 +1 -0
+ NTP_4_2_7P229
+
+ ntpd/ntpd-opts.c@1.234 +3 -3
+ NTP_4_2_7P229
+
+ ntpd/ntpd-opts.h@1.234 +3 -3
+ NTP_4_2_7P229
+
+ ntpd/ntpd-opts.texi@1.232 +2 -2
+ NTP_4_2_7P229
+
+ ntpd/ntpd.1ntpdman@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpd/ntpd.1ntpdmdoc@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpd/ntpd.man.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpd/ntpd.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc-opts.c@1.229 +3 -3
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc-opts.h@1.229 +3 -3
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc-opts.texi@1.229 +2 -2
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc.1ntpdcman@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc.html@1.57 +2 -2
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc.man.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpdc/ntpdc.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpq/ntpq-opts.c@1.231 +3 -3
+ NTP_4_2_7P229
+
+ ntpq/ntpq-opts.h@1.231 +3 -3
+ NTP_4_2_7P229
+
+ ntpq/ntpq-opts.texi@1.231 +2 -2
+ NTP_4_2_7P229
+
+ ntpq/ntpq.1ntpqman@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpq/ntpq.1ntpqmdoc@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpq/ntpq.man.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpq/ntpq.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.231 +3 -3
+ NTP_4_2_7P229
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.231 +3 -3
+ NTP_4_2_7P229
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.231 +2 -2
+ NTP_4_2_7P229
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpsnmpd/ntpsnmpd.man.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ packageinfo.sh@1.232 +1 -1
+ NTP_4_2_7P229
+
+ scripts/ntp-wait-opts.texi@1.49 +1 -1
+ NTP_4_2_7P229
+
+ scripts/ntp-wait.1ntp-waitman@1.45 +2 -2
+ NTP_4_2_7P229
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.45 +2 -2
+ NTP_4_2_7P229
+
+ scripts/ntp-wait.html@1.49 +1 -1
+ NTP_4_2_7P229
+
+ scripts/ntp-wait.man.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ scripts/ntp-wait.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ sntp/sntp-opts.c@1.227 +3 -3
+ NTP_4_2_7P229
+
+ sntp/sntp-opts.h@1.227 +3 -3
+ NTP_4_2_7P229
+
+ sntp/sntp-opts.texi@1.227 +2 -2
+ NTP_4_2_7P229
+
+ sntp/sntp.1sntpman@1.47 +2 -2
+ NTP_4_2_7P229
+
+ sntp/sntp.1sntpmdoc@1.47 +2 -2
+ NTP_4_2_7P229
+
+ sntp/sntp.html@1.227 +2 -2
+ NTP_4_2_7P229
+
+ sntp/sntp.man.in@1.47 +2 -2
+ NTP_4_2_7P229
+
+ sntp/sntp.mdoc.in@1.47 +2 -2
+ NTP_4_2_7P229
+
+ util/ntp-keygen-opts.c@1.231 +3 -3
+ NTP_4_2_7P229
+
+ util/ntp-keygen-opts.h@1.231 +3 -3
+ NTP_4_2_7P229
+
+ util/ntp-keygen-opts.texi@1.232 +2 -2
+ NTP_4_2_7P229
+
+ util/ntp-keygen.1ntp-keygenman@1.45 +2 -2
+ NTP_4_2_7P229
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.45 +2 -2
+ NTP_4_2_7P229
+
+ util/ntp-keygen.man.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ util/ntp-keygen.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P229
+
+ChangeSet@1.2680, 2011-10-25 17:18:33-04:00, perlinger@psp-deb1.ntp.org
+ [bug 1995] fixed wrong use of ZERO() macro in ntp_calendar.c
+
+ ChangeLog@1.1037 +1 -0
+ [bug 1995] fixed wrong use of ZERO() macro in ntp_calendar.c
+
+ libntp/ntp_calendar.c@1.9 +1 -1
+ [bug 1995] fixed wron use of ZERO() macro in ntp_calendar.c
+
+ChangeSet@1.2679, 2011-10-23 10:52:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P228
+ TAG: NTP_4_2_7P228
+
+ ChangeLog@1.1036 +1 -0
+ NTP_4_2_7P228
+
+ ntpd/ntpd-opts.c@1.233 +3 -3
+ NTP_4_2_7P228
+
+ ntpd/ntpd-opts.h@1.233 +3 -3
+ NTP_4_2_7P228
+
+ ntpd/ntpd-opts.texi@1.231 +2 -2
+ NTP_4_2_7P228
+
+ ntpd/ntpd.1ntpdman@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpd/ntpd.1ntpdmdoc@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpd/ntpd.man.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpd/ntpd.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc-opts.c@1.228 +3 -3
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc-opts.h@1.228 +3 -3
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc-opts.texi@1.228 +2 -2
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc.1ntpdcman@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc.html@1.56 +2 -2
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc.man.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpdc/ntpdc.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpq/ntpq-opts.c@1.230 +3 -3
+ NTP_4_2_7P228
+
+ ntpq/ntpq-opts.h@1.230 +3 -3
+ NTP_4_2_7P228
+
+ ntpq/ntpq-opts.texi@1.230 +2 -2
+ NTP_4_2_7P228
+
+ ntpq/ntpq.1ntpqman@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpq/ntpq.1ntpqmdoc@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpq/ntpq.man.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpq/ntpq.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.230 +3 -3
+ NTP_4_2_7P228
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.230 +3 -3
+ NTP_4_2_7P228
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.230 +2 -2
+ NTP_4_2_7P228
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpsnmpd/ntpsnmpd.man.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ packageinfo.sh@1.231 +1 -1
+ NTP_4_2_7P228
+
+ scripts/ntp-wait-opts.texi@1.48 +1 -1
+ NTP_4_2_7P228
+
+ scripts/ntp-wait.1ntp-waitman@1.44 +2 -2
+ NTP_4_2_7P228
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.44 +2 -2
+ NTP_4_2_7P228
+
+ scripts/ntp-wait.html@1.48 +1 -1
+ NTP_4_2_7P228
+
+ scripts/ntp-wait.man.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ scripts/ntp-wait.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ sntp/sntp-opts.c@1.226 +3 -3
+ NTP_4_2_7P228
+
+ sntp/sntp-opts.h@1.226 +3 -3
+ NTP_4_2_7P228
+
+ sntp/sntp-opts.texi@1.226 +2 -2
+ NTP_4_2_7P228
+
+ sntp/sntp.1sntpman@1.46 +2 -2
+ NTP_4_2_7P228
+
+ sntp/sntp.1sntpmdoc@1.46 +2 -2
+ NTP_4_2_7P228
+
+ sntp/sntp.html@1.226 +2 -2
+ NTP_4_2_7P228
+
+ sntp/sntp.man.in@1.46 +2 -2
+ NTP_4_2_7P228
+
+ sntp/sntp.mdoc.in@1.46 +2 -2
+ NTP_4_2_7P228
+
+ util/ntp-keygen-opts.c@1.230 +3 -3
+ NTP_4_2_7P228
+
+ util/ntp-keygen-opts.h@1.230 +3 -3
+ NTP_4_2_7P228
+
+ util/ntp-keygen-opts.texi@1.231 +2 -2
+ NTP_4_2_7P228
+
+ util/ntp-keygen.1ntp-keygenman@1.44 +2 -2
+ NTP_4_2_7P228
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.44 +2 -2
+ NTP_4_2_7P228
+
+ util/ntp-keygen.man.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ util/ntp-keygen.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P228
+
+ChangeSet@1.2678, 2011-10-22 18:05:27-04:00, stenn@deacon.udel.edu
+ Start the NEWS file updates in preparation for 4.2.8
+
+ NEWS@1.123 +18 -0
+ Start the NEWS file updates in preparation for 4.2.8
+
+ChangeSet@1.2673.1.50, 2011-10-22 10:34:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P227
+ TAG: NTP_4_2_7P227
+
+ ChangeLog@1.1032.1.42 +1 -0
+ NTP_4_2_7P227
+
+ ntpd/ntpd-opts.c@1.232 +3 -3
+ NTP_4_2_7P227
+
+ ntpd/ntpd-opts.h@1.232 +3 -3
+ NTP_4_2_7P227
+
+ ntpd/ntpd-opts.texi@1.230 +2 -2
+ NTP_4_2_7P227
+
+ ntpd/ntpd.1ntpdman@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpd/ntpd.1ntpdmdoc@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpd/ntpd.man.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpd/ntpd.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc-opts.c@1.227 +3 -3
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc-opts.h@1.227 +3 -3
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc-opts.texi@1.227 +2 -2
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc.1ntpdcman@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc.html@1.55 +2 -2
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc.man.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpdc/ntpdc.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpq/ntpq-opts.c@1.229 +3 -3
+ NTP_4_2_7P227
+
+ ntpq/ntpq-opts.h@1.229 +3 -3
+ NTP_4_2_7P227
+
+ ntpq/ntpq-opts.texi@1.229 +2 -2
+ NTP_4_2_7P227
+
+ ntpq/ntpq.1ntpqman@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpq/ntpq.1ntpqmdoc@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpq/ntpq.man.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpq/ntpq.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.229 +3 -3
+ NTP_4_2_7P227
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.229 +3 -3
+ NTP_4_2_7P227
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.229 +2 -2
+ NTP_4_2_7P227
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpsnmpd/ntpsnmpd.man.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ packageinfo.sh@1.230 +1 -1
+ NTP_4_2_7P227
+
+ scripts/ntp-wait-opts.texi@1.47 +1 -1
+ NTP_4_2_7P227
+
+ scripts/ntp-wait.1ntp-waitman@1.43 +2 -2
+ NTP_4_2_7P227
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.43 +2 -2
+ NTP_4_2_7P227
+
+ scripts/ntp-wait.html@1.47 +1 -1
+ NTP_4_2_7P227
+
+ scripts/ntp-wait.man.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ scripts/ntp-wait.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ sntp/sntp-opts.c@1.225 +3 -3
+ NTP_4_2_7P227
+
+ sntp/sntp-opts.h@1.225 +3 -3
+ NTP_4_2_7P227
+
+ sntp/sntp-opts.texi@1.225 +2 -2
+ NTP_4_2_7P227
+
+ sntp/sntp.1sntpman@1.45 +2 -2
+ NTP_4_2_7P227
+
+ sntp/sntp.1sntpmdoc@1.45 +2 -2
+ NTP_4_2_7P227
+
+ sntp/sntp.html@1.225 +2 -2
+ NTP_4_2_7P227
+
+ sntp/sntp.man.in@1.45 +2 -2
+ NTP_4_2_7P227
+
+ sntp/sntp.mdoc.in@1.45 +2 -2
+ NTP_4_2_7P227
+
+ util/ntp-keygen-opts.c@1.229 +3 -3
+ NTP_4_2_7P227
+
+ util/ntp-keygen-opts.h@1.229 +3 -3
+ NTP_4_2_7P227
+
+ util/ntp-keygen-opts.texi@1.230 +2 -2
+ NTP_4_2_7P227
+
+ util/ntp-keygen.1ntp-keygenman@1.43 +2 -2
+ NTP_4_2_7P227
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.43 +2 -2
+ NTP_4_2_7P227
+
+ util/ntp-keygen.man.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ util/ntp-keygen.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P227
+
+ChangeSet@1.2673.1.49, 2011-10-21 19:10:02+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2036] gcc 2.95.3 preprocessor can't nest #ifdef in macro args.
+ A number of compiler warnings eliminated.
+
+ ChangeLog@1.1032.1.41 +2 -0
+ [Bug 2036] gcc 2.95.3 preprocessor can't nest #ifdef in macro args.
+ A number of compiler warnings eliminated.
+
+ lib/isc/include/isc/file.h@1.5 +2 -2
+ A number of compiler warnings eliminated.
+
+ lib/isc/include/isc/util.h@1.5 +1 -1
+ A number of compiler warnings eliminated.
+
+ lib/isc/inet_ntop.c@1.12 +2 -1
+ A number of compiler warnings eliminated.
+
+ lib/isc/inet_pton.c@1.6 +1 -0
+ A number of compiler warnings eliminated.
+
+ lib/isc/result.c@1.2 +13 -13
+ A number of compiler warnings eliminated.
+
+ lib/isc/unix/file.c@1.4 +7 -7
+ A number of compiler warnings eliminated.
+
+ libntp/msyslog.c@1.48 +6 -2
+ A number of compiler warnings eliminated.
+
+ libntp/snprintf.c@1.12 +0 -2
+ A number of compiler warnings eliminated.
+
+ ntpd/ntp_io.c@1.361 +6 -1
+ A number of compiler warnings eliminated.
+
+ ntpd/refclock_nmea.c@1.64 +2 -0
+ A number of compiler warnings eliminated.
+
+ ntpd/refclock_parse.c@1.62 +9 -11
+ [Bug 2036] gcc 2.95.3 preprocessor can't nest #ifdef in macro args.
+ A number of compiler warnings eliminated.
+
+ ntpd/refclock_wwvb.c@1.33 +2 -0
+ A number of compiler warnings eliminated.
+
+ChangeSet@1.2673.1.48, 2011-10-21 18:40:55+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P226
+ TAG: NTP_4_2_7P226
+
+ ChangeLog@1.1032.1.40 +1 -0
+ NTP_4_2_7P226
+
+ ntpd/ntpd-opts.c@1.231 +3 -3
+ NTP_4_2_7P226
+
+ ntpd/ntpd-opts.h@1.231 +3 -3
+ NTP_4_2_7P226
+
+ ntpd/ntpd-opts.texi@1.229 +2 -2
+ NTP_4_2_7P226
+
+ ntpd/ntpd.1ntpdman@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpd/ntpd.1ntpdmdoc@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpd/ntpd.man.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpd/ntpd.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc-opts.c@1.226 +3 -3
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc-opts.h@1.226 +3 -3
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc-opts.texi@1.226 +2 -2
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc.1ntpdcman@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc.html@1.54 +2 -2
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc.man.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpdc/ntpdc.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpq/ntpq-opts.c@1.228 +3 -3
+ NTP_4_2_7P226
+
+ ntpq/ntpq-opts.h@1.228 +3 -3
+ NTP_4_2_7P226
+
+ ntpq/ntpq-opts.texi@1.228 +2 -2
+ NTP_4_2_7P226
+
+ ntpq/ntpq.1ntpqman@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpq/ntpq.1ntpqmdoc@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpq/ntpq.man.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpq/ntpq.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.228 +3 -3
+ NTP_4_2_7P226
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.228 +3 -3
+ NTP_4_2_7P226
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.228 +2 -2
+ NTP_4_2_7P226
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpsnmpd/ntpsnmpd.man.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ packageinfo.sh@1.229 +1 -1
+ NTP_4_2_7P226
+
+ scripts/ntp-wait-opts.texi@1.46 +1 -1
+ NTP_4_2_7P226
+
+ scripts/ntp-wait.1ntp-waitman@1.42 +2 -2
+ NTP_4_2_7P226
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.42 +2 -2
+ NTP_4_2_7P226
+
+ scripts/ntp-wait.html@1.46 +1 -1
+ NTP_4_2_7P226
+
+ scripts/ntp-wait.man.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ scripts/ntp-wait.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ sntp/sntp-opts.c@1.224 +3 -3
+ NTP_4_2_7P226
+
+ sntp/sntp-opts.h@1.224 +3 -3
+ NTP_4_2_7P226
+
+ sntp/sntp-opts.texi@1.224 +2 -2
+ NTP_4_2_7P226
+
+ sntp/sntp.1sntpman@1.44 +2 -2
+ NTP_4_2_7P226
+
+ sntp/sntp.1sntpmdoc@1.44 +2 -2
+ NTP_4_2_7P226
+
+ sntp/sntp.html@1.224 +2 -2
+ NTP_4_2_7P226
+
+ sntp/sntp.man.in@1.44 +2 -2
+ NTP_4_2_7P226
+
+ sntp/sntp.mdoc.in@1.44 +2 -2
+ NTP_4_2_7P226
+
+ util/ntp-keygen-opts.c@1.228 +3 -3
+ NTP_4_2_7P226
+
+ util/ntp-keygen-opts.h@1.228 +3 -3
+ NTP_4_2_7P226
+
+ util/ntp-keygen-opts.texi@1.229 +2 -2
+ NTP_4_2_7P226
+
+ util/ntp-keygen.1ntp-keygenman@1.42 +2 -2
+ NTP_4_2_7P226
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.42 +2 -2
+ NTP_4_2_7P226
+
+ util/ntp-keygen.man.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ util/ntp-keygen.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P226
+
+ChangeSet@1.2676, 2011-10-21 02:07:25+00:00, davehart@shiny.ad.hartbrothers.com
+ Minor style cleanup of ntp_calendar.c and systime.c
+
+ include/ntp_types.h@1.27 +4 -1
+ provide UNUSED_LOCAL() like UNUSED_ARG() to quiet warnings.
+
+ libntp/ntp_calendar.c@1.8 +180 -119
+ Remove shadowing "tmp" redeclaration in time_to_vint64(), rename tmp to tt.
+ Minor style cleanup, including older code.
+
+ libntp/systime.c@1.58 +25 -28
+ minor style cleanup, reduce indenting
+
+ChangeSet@1.2673.1.47, 2011-10-18 23:37:23-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1032.1.39 +1 -0
+ Documentation updates from Dave Mills
+
+ html/cluster.html@1.5 +5 -5
+ Documentation updates from Dave Mills
+
+ html/drivers/scripts/footer.txt@1.4 +5 -3
+ Documentation updates from Dave Mills
+
+ html/scripts/command.txt@1.5 +7 -9
+ Documentation updates from Dave Mills
+
+ html/scripts/confopt.txt@1.5 +5 -5
+ Documentation updates from Dave Mills
+
+ html/scripts/footer.txt@1.5 +5 -8
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2082.4.243, 2011-10-18 23:14:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P5_RC1
+ TAG: NTP_4_2_6P5_RC1
+
+ ChangeLog@1.496.26.173 +1 -0
+ NTP_4_2_6P5_RC1
+
+ ntpd/ntpd-opts.c@1.248.40.1 +5 -5
+ NTP_4_2_6P5_RC1
+
+ ntpd/ntpd-opts.h@1.248.40.1 +3 -3
+ NTP_4_2_6P5_RC1
+
+ ntpd/ntpd-opts.texi@1.246.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ ntpd/ntpd.1@1.246.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ ntpdc/ntpdc-opts.c@1.244.40.1 +5 -5
+ NTP_4_2_6P5_RC1
+
+ ntpdc/ntpdc-opts.h@1.244.40.1 +3 -3
+ NTP_4_2_6P5_RC1
+
+ ntpdc/ntpdc-opts.texi@1.243.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ ntpdc/ntpdc.1@1.243.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ ntpq/ntpq-opts.c@1.245.40.1 +5 -5
+ NTP_4_2_6P5_RC1
+
+ ntpq/ntpq-opts.h@1.245.40.1 +3 -3
+ NTP_4_2_6P5_RC1
+
+ ntpq/ntpq-opts.texi@1.244.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ ntpq/ntpq.1@1.244.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.41.1 +5 -5
+ NTP_4_2_6P5_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.41.1 +3 -3
+ NTP_4_2_6P5_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.40.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.40.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ packageinfo.sh@1.255.37.2 +2 -2
+ NTP_4_2_6P5_RC1
+
+ sntp/sntp-opts.c@1.117.39.1 +5 -5
+ NTP_4_2_6P5_RC1
+
+ sntp/sntp-opts.h@1.117.39.1 +3 -3
+ NTP_4_2_6P5_RC1
+
+ sntp/sntp-opts.texi@1.117.38.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ sntp/sntp.1@1.117.38.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ sntp/sntp.html@1.7.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ util/ntp-keygen-opts.c@1.247.40.1 +5 -5
+ NTP_4_2_6P5_RC1
+
+ util/ntp-keygen-opts.h@1.247.40.1 +3 -3
+ NTP_4_2_6P5_RC1
+
+ util/ntp-keygen-opts.texi@1.246.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ util/ntp-keygen.1@1.246.39.1 +2 -2
+ NTP_4_2_6P5_RC1
+
+ChangeSet@1.2082.4.242, 2011-10-18 14:31:10-04:00, stenn@deacon.udel.edu
+ ntp-4.2.6p5-RC1
+
+ packageinfo.sh@1.255.37.1 +1 -1
+ ntp-4.2.6p5-RC1
+
+ChangeSet@1.2082.4.241, 2011-10-18 14:27:46-04:00, stenn@deacon.udel.edu
+ update NEWS file
+
+ NEWS@1.122 +5 -5
+ update
+
+ChangeSet@1.2673.1.45, 2011-10-18 06:33:06+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2035] ntpq -c mrulist sleeps 1 sec between queries, not 5 msec.
+
+ ChangeLog@1.1032.1.37 +1 -0
+ [Bug 2035] ntpq -c mrulist sleeps 1 sec between queries, not 5 msec.
+
+ configure.ac@1.538 +1 -1
+ [Bug 2035] ntpq -c mrulist sleeps 1 sec between queries, not 5 msec.
+
+ ntpq/ntpq-subs.c@1.90 +6 -10
+ Move add_mru trace output from -D 1 to -D 2
+
+ChangeSet@1.2082.4.240, 2011-10-18 02:35:21+00:00, davehart@shiny.ad.hartbrothers.com
+ Generalize [Bug 2034] summary, correct NEWS description of same.
+
+ ChangeLog@1.496.26.172 +1 -1
+ Generalize [Bug 2034] summary, correct NEWS description of same.
+
+ NEWS@1.121 +7 -4
+ Generalize [Bug 2034] summary, correct NEWS description of same.
+
+ChangeSet@1.2082.4.239, 2011-10-17 20:43:13-04:00, stenn@deacon.udel.edu
+ Update NEWS file for 4.2.6p5
+
+ NEWS@1.120 +15 -0
+ Update NEWS file for 4.2.6p5
+
+ChangeSet@1.2082.4.238, 2011-10-17 20:14:44+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2034] interface ignore fe80::/64 mismatches ::, ::1...
+
+ ChangeLog@1.496.26.171 +4 -1
+ [Bug 2034] interface ignore fe80::/64 mismatches ::, ::1...
+
+ ntpd/ntp_io.c@1.306.1.16 +7 -4
+ [Bug 2034] interface ignore fe80::/64 mismatches ::, ::1...
+
+ChangeSet@1.2673.1.42, 2011-10-15 10:36:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P225
+ TAG: NTP_4_2_7P225
+
+ ChangeLog@1.1032.1.34 +1 -0
+ NTP_4_2_7P225
+
+ ntpd/ntpd-opts.c@1.230 +3 -3
+ NTP_4_2_7P225
+
+ ntpd/ntpd-opts.h@1.230 +3 -3
+ NTP_4_2_7P225
+
+ ntpd/ntpd-opts.texi@1.228 +2 -2
+ NTP_4_2_7P225
+
+ ntpd/ntpd.1ntpdman@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpd/ntpd.1ntpdmdoc@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpd/ntpd.man.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpd/ntpd.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc-opts.c@1.225 +3 -3
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc-opts.h@1.225 +3 -3
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc-opts.texi@1.225 +2 -2
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc.1ntpdcman@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc.html@1.53 +2 -2
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc.man.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpdc/ntpdc.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpq/ntpq-opts.c@1.227 +3 -3
+ NTP_4_2_7P225
+
+ ntpq/ntpq-opts.h@1.227 +3 -3
+ NTP_4_2_7P225
+
+ ntpq/ntpq-opts.texi@1.227 +2 -2
+ NTP_4_2_7P225
+
+ ntpq/ntpq.1ntpqman@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpq/ntpq.1ntpqmdoc@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpq/ntpq.man.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpq/ntpq.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.227 +3 -3
+ NTP_4_2_7P225
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.227 +3 -3
+ NTP_4_2_7P225
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.227 +2 -2
+ NTP_4_2_7P225
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpsnmpd/ntpsnmpd.man.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ packageinfo.sh@1.228 +1 -1
+ NTP_4_2_7P225
+
+ scripts/ntp-wait-opts.texi@1.45 +1 -1
+ NTP_4_2_7P225
+
+ scripts/ntp-wait.1ntp-waitman@1.41 +2 -2
+ NTP_4_2_7P225
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.41 +2 -2
+ NTP_4_2_7P225
+
+ scripts/ntp-wait.html@1.45 +1 -1
+ NTP_4_2_7P225
+
+ scripts/ntp-wait.man.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ scripts/ntp-wait.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ sntp/sntp-opts.c@1.223 +3 -3
+ NTP_4_2_7P225
+
+ sntp/sntp-opts.h@1.223 +3 -3
+ NTP_4_2_7P225
+
+ sntp/sntp-opts.texi@1.223 +2 -2
+ NTP_4_2_7P225
+
+ sntp/sntp.1sntpman@1.43 +2 -2
+ NTP_4_2_7P225
+
+ sntp/sntp.1sntpmdoc@1.43 +2 -2
+ NTP_4_2_7P225
+
+ sntp/sntp.html@1.223 +2 -2
+ NTP_4_2_7P225
+
+ sntp/sntp.man.in@1.43 +2 -2
+ NTP_4_2_7P225
+
+ sntp/sntp.mdoc.in@1.43 +2 -2
+ NTP_4_2_7P225
+
+ util/ntp-keygen-opts.c@1.227 +3 -3
+ NTP_4_2_7P225
+
+ util/ntp-keygen-opts.h@1.227 +3 -3
+ NTP_4_2_7P225
+
+ util/ntp-keygen-opts.texi@1.228 +2 -2
+ NTP_4_2_7P225
+
+ util/ntp-keygen.1ntp-keygenman@1.41 +2 -2
+ NTP_4_2_7P225
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.41 +2 -2
+ NTP_4_2_7P225
+
+ util/ntp-keygen.man.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ util/ntp-keygen.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P225
+
+ChangeSet@1.2673.1.41, 2011-10-14 21:01:03-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1032.1.33 +1 -0
+ Documentation updates from Dave Mills
+
+ html/accopt.html@1.41 +2 -1
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.38 +3 -3
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.73 +3 -6
+ Documentation updates from Dave Mills
+
+ html/cluster.html@1.4 +3 -3
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.57 +7 -7
+ Documentation updates from Dave Mills
+
+ html/discover.html@1.3 +7 -6
+ Documentation updates from Dave Mills
+
+ html/huffpuff.html@1.3 +9 -3
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.18 +3 -3
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2673.1.40, 2011-10-14 10:39:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P224
+ TAG: NTP_4_2_7P224
+
+ ChangeLog@1.1032.1.32 +1 -0
+ NTP_4_2_7P224
+
+ ntpd/ntpd-opts.c@1.229 +3 -3
+ NTP_4_2_7P224
+
+ ntpd/ntpd-opts.h@1.229 +3 -3
+ NTP_4_2_7P224
+
+ ntpd/ntpd-opts.texi@1.227 +2 -2
+ NTP_4_2_7P224
+
+ ntpd/ntpd.1ntpdman@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpd/ntpd.1ntpdmdoc@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpd/ntpd.man.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpd/ntpd.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc-opts.c@1.224 +3 -3
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc-opts.h@1.224 +3 -3
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc-opts.texi@1.224 +2 -2
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc.1ntpdcman@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc.html@1.52 +2 -2
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc.man.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpdc/ntpdc.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpq/ntpq-opts.c@1.226 +3 -3
+ NTP_4_2_7P224
+
+ ntpq/ntpq-opts.h@1.226 +3 -3
+ NTP_4_2_7P224
+
+ ntpq/ntpq-opts.texi@1.226 +2 -2
+ NTP_4_2_7P224
+
+ ntpq/ntpq.1ntpqman@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpq/ntpq.1ntpqmdoc@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpq/ntpq.man.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpq/ntpq.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.226 +3 -3
+ NTP_4_2_7P224
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.226 +3 -3
+ NTP_4_2_7P224
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.226 +2 -2
+ NTP_4_2_7P224
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpsnmpd/ntpsnmpd.man.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ packageinfo.sh@1.227 +1 -1
+ NTP_4_2_7P224
+
+ scripts/ntp-wait-opts.texi@1.44 +1 -1
+ NTP_4_2_7P224
+
+ scripts/ntp-wait.1ntp-waitman@1.40 +2 -2
+ NTP_4_2_7P224
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.40 +2 -2
+ NTP_4_2_7P224
+
+ scripts/ntp-wait.html@1.44 +1 -1
+ NTP_4_2_7P224
+
+ scripts/ntp-wait.man.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ scripts/ntp-wait.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ sntp/sntp-opts.c@1.222 +3 -3
+ NTP_4_2_7P224
+
+ sntp/sntp-opts.h@1.222 +3 -3
+ NTP_4_2_7P224
+
+ sntp/sntp-opts.texi@1.222 +2 -2
+ NTP_4_2_7P224
+
+ sntp/sntp.1sntpman@1.42 +2 -2
+ NTP_4_2_7P224
+
+ sntp/sntp.1sntpmdoc@1.42 +2 -2
+ NTP_4_2_7P224
+
+ sntp/sntp.html@1.222 +2 -2
+ NTP_4_2_7P224
+
+ sntp/sntp.man.in@1.42 +2 -2
+ NTP_4_2_7P224
+
+ sntp/sntp.mdoc.in@1.42 +2 -2
+ NTP_4_2_7P224
+
+ util/ntp-keygen-opts.c@1.226 +3 -3
+ NTP_4_2_7P224
+
+ util/ntp-keygen-opts.h@1.226 +3 -3
+ NTP_4_2_7P224
+
+ util/ntp-keygen-opts.texi@1.227 +2 -2
+ NTP_4_2_7P224
+
+ util/ntp-keygen.1ntp-keygenman@1.40 +2 -2
+ NTP_4_2_7P224
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.40 +2 -2
+ NTP_4_2_7P224
+
+ util/ntp-keygen.man.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ util/ntp-keygen.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P224
+
+ChangeSet@1.2673.1.39, 2011-10-13 18:13:58+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq mrulist shows intermediate counts every five seconds while
+ retrieving list, and allows Ctrl-C interruption of the retrieval,
+ showing the incomplete list as retrieved. Reduce delay between
+ successive mrulist retrieval queries from 30 to 5 msec. Do not
+ give up mrulist retrieval when a single query times out.
+
+ ChangeLog@1.1032.1.31 +5 -0
+ ntpq mrulist shows intermediate counts every five seconds while
+ retrieving list, and allows Ctrl-C interruption of the retrieval,
+ showing the incomplete list as retrieved. Reduce delay between
+ successive mrulist retrieval queries from 30 to 5 msec. Do not
+ give up mrulist retrieval when a single query times out.
+
+ include/ntp_stdlib.h@1.66 +3 -0
+ provide portable POSIX/Win32 Ctrl-C interception.
+
+ libntp/syssignal.c@1.15 +79 -0
+ provide portable POSIX/Win32 Ctrl-C interception.
+
+ ntpq/ntpq-subs.c@1.89 +53 -8
+ ntpq mrulist shows intermediate counts every five seconds while
+ retrieving list, and allows Ctrl-C interruption of the retrieval,
+ showing the incomplete list as retrieved. Reduce delay between
+ successive mrulist retrieval queries from 30 to 5 msec. Do not
+ give up mrulist retrieval when a single query times out.
+
+ ntpq/ntpq.h@1.24 +5 -0
+ ntpq mrulist shows intermediate counts every five seconds while
+ retrieving list.
+
+ChangeSet@1.2673.1.38, 2011-10-12 10:41:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P223
+ TAG: NTP_4_2_7P223
+
+ ChangeLog@1.1032.1.30 +1 -0
+ NTP_4_2_7P223
+
+ ntpd/ntpd-opts.c@1.228 +3 -3
+ NTP_4_2_7P223
+
+ ntpd/ntpd-opts.h@1.228 +3 -3
+ NTP_4_2_7P223
+
+ ntpd/ntpd-opts.texi@1.226 +2 -2
+ NTP_4_2_7P223
+
+ ntpd/ntpd.1ntpdman@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpd/ntpd.1ntpdmdoc@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpd/ntpd.man.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpd/ntpd.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc-opts.c@1.223 +3 -3
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc-opts.h@1.223 +3 -3
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc-opts.texi@1.223 +2 -2
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc.1ntpdcman@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc.html@1.51 +2 -2
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc.man.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpdc/ntpdc.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpq/ntpq-opts.c@1.225 +3 -3
+ NTP_4_2_7P223
+
+ ntpq/ntpq-opts.h@1.225 +3 -3
+ NTP_4_2_7P223
+
+ ntpq/ntpq-opts.texi@1.225 +2 -2
+ NTP_4_2_7P223
+
+ ntpq/ntpq.1ntpqman@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpq/ntpq.1ntpqmdoc@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpq/ntpq.man.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpq/ntpq.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.225 +3 -3
+ NTP_4_2_7P223
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.225 +3 -3
+ NTP_4_2_7P223
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.225 +2 -2
+ NTP_4_2_7P223
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpsnmpd/ntpsnmpd.man.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ packageinfo.sh@1.226 +1 -1
+ NTP_4_2_7P223
+
+ scripts/ntp-wait-opts.texi@1.43 +1 -1
+ NTP_4_2_7P223
+
+ scripts/ntp-wait.1ntp-waitman@1.39 +2 -2
+ NTP_4_2_7P223
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.39 +2 -2
+ NTP_4_2_7P223
+
+ scripts/ntp-wait.html@1.43 +1 -1
+ NTP_4_2_7P223
+
+ scripts/ntp-wait.man.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ scripts/ntp-wait.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ sntp/sntp-opts.c@1.221 +3 -3
+ NTP_4_2_7P223
+
+ sntp/sntp-opts.h@1.221 +3 -3
+ NTP_4_2_7P223
+
+ sntp/sntp-opts.texi@1.221 +2 -2
+ NTP_4_2_7P223
+
+ sntp/sntp.1sntpman@1.41 +2 -2
+ NTP_4_2_7P223
+
+ sntp/sntp.1sntpmdoc@1.41 +2 -2
+ NTP_4_2_7P223
+
+ sntp/sntp.html@1.221 +2 -2
+ NTP_4_2_7P223
+
+ sntp/sntp.man.in@1.41 +2 -2
+ NTP_4_2_7P223
+
+ sntp/sntp.mdoc.in@1.41 +2 -2
+ NTP_4_2_7P223
+
+ util/ntp-keygen-opts.c@1.225 +3 -3
+ NTP_4_2_7P223
+
+ util/ntp-keygen-opts.h@1.225 +3 -3
+ NTP_4_2_7P223
+
+ util/ntp-keygen-opts.texi@1.226 +2 -2
+ NTP_4_2_7P223
+
+ util/ntp-keygen.1ntp-keygenman@1.39 +2 -2
+ NTP_4_2_7P223
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.39 +2 -2
+ NTP_4_2_7P223
+
+ util/ntp-keygen.man.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ util/ntp-keygen.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P223
+
+ChangeSet@1.2673.1.37, 2011-10-12 02:48:59-04:00, stenn@deacon.udel.edu
+ revert bogus changes
+
+ html/accopt.html@1.40 +72 -55
+ revert bogus changes
+
+ html/assoc.html@1.37 +61 -671
+ revert bogus changes
+
+ChangeSet@1.2673.1.36, 2011-10-12 02:28:11-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1032.1.29 +1 -0
+ Documentation updates from Dave Mills
+
+ html/accopt.html@1.39 +55 -72
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.36 +671 -61
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.18 +1 -11
+ Documentation updates from Dave Mills
+
+ html/discover.html@1.2 +2 -2
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.17 +3 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2673.1.35, 2011-10-11 09:09:30+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P222
+ TAG: NTP_4_2_7P222
+
+ ChangeLog@1.1032.1.28 +1 -0
+ NTP_4_2_7P222
+
+ ntpd/ntpd-opts.c@1.227 +3 -3
+ NTP_4_2_7P222
+
+ ntpd/ntpd-opts.h@1.227 +3 -3
+ NTP_4_2_7P222
+
+ ntpd/ntpd-opts.texi@1.225 +2 -2
+ NTP_4_2_7P222
+
+ ntpd/ntpd.1ntpdman@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpd/ntpd.1ntpdmdoc@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpd/ntpd.man.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpd/ntpd.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc-opts.c@1.222 +3 -3
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc-opts.h@1.222 +3 -3
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc-opts.texi@1.222 +2 -2
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc.1ntpdcman@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc.html@1.50 +2 -2
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc.man.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpdc/ntpdc.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpq/ntpq-opts.c@1.224 +3 -3
+ NTP_4_2_7P222
+
+ ntpq/ntpq-opts.h@1.224 +3 -3
+ NTP_4_2_7P222
+
+ ntpq/ntpq-opts.texi@1.224 +2 -2
+ NTP_4_2_7P222
+
+ ntpq/ntpq.1ntpqman@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpq/ntpq.1ntpqmdoc@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpq/ntpq.man.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpq/ntpq.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.224 +3 -3
+ NTP_4_2_7P222
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.224 +3 -3
+ NTP_4_2_7P222
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.224 +2 -2
+ NTP_4_2_7P222
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpsnmpd/ntpsnmpd.man.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ packageinfo.sh@1.225 +1 -1
+ NTP_4_2_7P222
+
+ scripts/ntp-wait-opts.texi@1.42 +14 -2
+ NTP_4_2_7P222
+
+ scripts/ntp-wait.1ntp-waitman@1.38 +2 -2
+ NTP_4_2_7P222
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.38 +2 -2
+ NTP_4_2_7P222
+
+ scripts/ntp-wait.html@1.42 +14 -2
+ NTP_4_2_7P222
+
+ scripts/ntp-wait.man.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ scripts/ntp-wait.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ sntp/sntp-opts.c@1.220 +3 -3
+ NTP_4_2_7P222
+
+ sntp/sntp-opts.h@1.220 +3 -3
+ NTP_4_2_7P222
+
+ sntp/sntp-opts.texi@1.220 +2 -2
+ NTP_4_2_7P222
+
+ sntp/sntp.1sntpman@1.40 +2 -2
+ NTP_4_2_7P222
+
+ sntp/sntp.1sntpmdoc@1.40 +2 -2
+ NTP_4_2_7P222
+
+ sntp/sntp.html@1.220 +2 -2
+ NTP_4_2_7P222
+
+ sntp/sntp.man.in@1.40 +2 -2
+ NTP_4_2_7P222
+
+ sntp/sntp.mdoc.in@1.40 +2 -2
+ NTP_4_2_7P222
+
+ util/ntp-keygen-opts.c@1.224 +3 -3
+ NTP_4_2_7P222
+
+ util/ntp-keygen-opts.h@1.224 +3 -3
+ NTP_4_2_7P222
+
+ util/ntp-keygen-opts.texi@1.225 +2 -2
+ NTP_4_2_7P222
+
+ util/ntp-keygen.1ntp-keygenman@1.38 +2 -2
+ NTP_4_2_7P222
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.38 +2 -2
+ NTP_4_2_7P222
+
+ util/ntp-keygen.man.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ util/ntp-keygen.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P222
+
+ChangeSet@1.2673.1.34, 2011-10-11 02:04:21+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2029] "make check" clutters syslog.
+ Log signal description along with number on ntpd exit.
+
+ ChangeLog@1.1032.1.27 +2 -0
+ [Bug 2029] "make check" clutters syslog.
+ Log signal description along with number on ntpd exit.
+
+
+ configure.ac@1.537 +1 -4
+ Log signal description along with number on ntpd exit.
+
+ include/ntpd.h@1.169 +1 -1
+ cosmetic only
+
+ ntpd/ntpd.c@1.129 +26 -47
+ [Bug 2029] "make check" clutters syslog.
+ Log signal description along with number on ntpd exit.
+
+
+ChangeSet@1.2673.1.33, 2011-10-10 05:59:08+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P221
+ TAG: NTP_4_2_7P221
+
+ ChangeLog@1.1032.1.26 +1 -0
+ NTP_4_2_7P221
+
+ ntpd/ntpd-opts.c@1.226 +3 -3
+ NTP_4_2_7P221
+
+ ntpd/ntpd-opts.h@1.226 +3 -3
+ NTP_4_2_7P221
+
+ ntpd/ntpd-opts.texi@1.224 +2 -2
+ NTP_4_2_7P221
+
+ ntpd/ntpd.1ntpdman@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpd/ntpd.1ntpdmdoc@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpd/ntpd.man.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpd/ntpd.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc-opts.c@1.221 +3 -3
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc-opts.h@1.221 +3 -3
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc-opts.texi@1.221 +2 -2
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc.1ntpdcman@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc.html@1.49 +2 -2
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc.man.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpdc/ntpdc.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpq/ntpq-opts.c@1.223 +3 -3
+ NTP_4_2_7P221
+
+ ntpq/ntpq-opts.h@1.223 +3 -3
+ NTP_4_2_7P221
+
+ ntpq/ntpq-opts.texi@1.223 +2 -2
+ NTP_4_2_7P221
+
+ ntpq/ntpq.1ntpqman@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpq/ntpq.1ntpqmdoc@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpq/ntpq.man.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpq/ntpq.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.223 +3 -3
+ NTP_4_2_7P221
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.223 +3 -3
+ NTP_4_2_7P221
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.223 +2 -2
+ NTP_4_2_7P221
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpsnmpd/ntpsnmpd.man.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ packageinfo.sh@1.224 +1 -1
+ NTP_4_2_7P221
+
+ scripts/ntp-wait-opts.texi@1.41 +2 -14
+ NTP_4_2_7P221
+
+ scripts/ntp-wait.1ntp-waitman@1.37 +2 -2
+ NTP_4_2_7P221
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.37 +2 -2
+ NTP_4_2_7P221
+
+ scripts/ntp-wait.html@1.41 +2 -14
+ NTP_4_2_7P221
+
+ scripts/ntp-wait.man.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ scripts/ntp-wait.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ sntp/sntp-opts.c@1.219 +3 -3
+ NTP_4_2_7P221
+
+ sntp/sntp-opts.h@1.219 +3 -3
+ NTP_4_2_7P221
+
+ sntp/sntp-opts.texi@1.219 +2 -2
+ NTP_4_2_7P221
+
+ sntp/sntp.1sntpman@1.39 +2 -2
+ NTP_4_2_7P221
+
+ sntp/sntp.1sntpmdoc@1.39 +2 -2
+ NTP_4_2_7P221
+
+ sntp/sntp.html@1.219 +2 -2
+ NTP_4_2_7P221
+
+ sntp/sntp.man.in@1.39 +2 -2
+ NTP_4_2_7P221
+
+ sntp/sntp.mdoc.in@1.39 +2 -2
+ NTP_4_2_7P221
+
+ util/ntp-keygen-opts.c@1.223 +3 -3
+ NTP_4_2_7P221
+
+ util/ntp-keygen-opts.h@1.223 +3 -3
+ NTP_4_2_7P221
+
+ util/ntp-keygen-opts.texi@1.224 +2 -2
+ NTP_4_2_7P221
+
+ util/ntp-keygen.1ntp-keygenman@1.37 +2 -2
+ NTP_4_2_7P221
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.37 +2 -2
+ NTP_4_2_7P221
+
+ util/ntp-keygen.man.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ util/ntp-keygen.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P221
+
+ChangeSet@1.2673.1.32, 2011-10-10 04:49:18+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2028] ntpd -n (nofork) redirects logging to stderr.
+
+ ChangeLog@1.1032.1.25 +1 -0
+ [Bug 2028] ntpd -n (nofork) redirects logging to stderr.
+
+ ntpd/ntpd.c@1.128 +2 -5
+ [Bug 2028] ntpd -n (nofork) redirects logging to stderr.
+
+ChangeSet@1.2673.1.31, 2011-10-09 16:48:41-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1032.1.24 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.9 +6 -13
+ Documentation updates from Dave Mills
+
+ html/drivers/scripts/footer.txt@1.3 +1 -1
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2673.1.30, 2011-10-09 20:33:29+00:00, davehart@shiny.ad.hartbrothers.com
+ DLM does not want STA_UNSYNC set in kernel when ntpd exits.
+
+ ntpd/ntp_loopfilter.c@1.168 +1 -17
+ DLM does not want STA_UNSYNC set in kernel when ntpd exits.
+
+ChangeSet@1.2673.1.29, 2011-10-09 05:08:21+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2025] Switching between daemon and kernel loops can doubly-
+ correct drift
+
+ ChangeLog@1.1032.1.23 +2 -0
+ [Bug 2025] Switching between daemon and kernel loops can doubly-
+ correct drift
+
+ include/ntp_stdlib.h@1.65 +2 -0
+ conditionalize k_st_flags() prototype to match implementation.
+
+ include/ntpd.h@1.168 +1 -0
+ [Bug 2025] Switching between daemon and kernel loops can doubly-
+ correct drift
+
+ include/refclock_atom.h@1.4 +1 -0
+ Quiet NANOSECOND redeclaration warning with #undef.
+
+ libntp/statestr.c@1.26 +3 -0
+ Make decode_bitflags() (and thereby its wrappers like k_st_flags())
+ safe for using in msyslog/DPRINTF/msnprintf arguments with %m by
+ preserving errno across the function.
+
+ ntpd/cmd_args.c@1.60 +2 -4
+ Use loop_config() instead of duplicating logic for -x handling.
+
+ ntpd/ntp_loopfilter.c@1.167 +135 -62
+ [Bug 2025] Switching between daemon and kernel loops can doubly-
+ correct drift
+
+ ntpd/ntp_proto.c@1.323 +1 -1
+ [Bug 2025] Switching between daemon and kernel loops can doubly-
+ correct drift
+
+ChangeSet@1.2673.1.28, 2011-10-05 09:03:57+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P220
+ TAG: NTP_4_2_7P220
+
+ ChangeLog@1.1032.1.22 +1 -0
+ NTP_4_2_7P220
+
+ ntpd/ntpd-opts.c@1.225 +3 -3
+ NTP_4_2_7P220
+
+ ntpd/ntpd-opts.h@1.225 +3 -3
+ NTP_4_2_7P220
+
+ ntpd/ntpd-opts.texi@1.223 +2 -2
+ NTP_4_2_7P220
+
+ ntpd/ntpd.1ntpdman@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpd/ntpd.1ntpdmdoc@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpd/ntpd.man.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpd/ntpd.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc-opts.c@1.220 +3 -3
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc-opts.h@1.220 +3 -3
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc-opts.texi@1.220 +2 -2
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc.1ntpdcman@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc.html@1.48 +2 -2
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc.man.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpdc/ntpdc.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpq/ntpq-opts.c@1.222 +3 -3
+ NTP_4_2_7P220
+
+ ntpq/ntpq-opts.h@1.222 +3 -3
+ NTP_4_2_7P220
+
+ ntpq/ntpq-opts.texi@1.222 +2 -2
+ NTP_4_2_7P220
+
+ ntpq/ntpq.1ntpqman@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpq/ntpq.1ntpqmdoc@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpq/ntpq.man.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpq/ntpq.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.222 +3 -3
+ NTP_4_2_7P220
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.222 +3 -3
+ NTP_4_2_7P220
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.222 +2 -2
+ NTP_4_2_7P220
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpsnmpd/ntpsnmpd.man.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ packageinfo.sh@1.223 +1 -1
+ NTP_4_2_7P220
+
+ scripts/ntp-wait-opts.texi@1.40 +1 -1
+ NTP_4_2_7P220
+
+ scripts/ntp-wait.1ntp-waitman@1.36 +2 -2
+ NTP_4_2_7P220
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.36 +2 -2
+ NTP_4_2_7P220
+
+ scripts/ntp-wait.html@1.40 +1 -1
+ NTP_4_2_7P220
+
+ scripts/ntp-wait.man.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ scripts/ntp-wait.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ sntp/sntp-opts.c@1.218 +3 -3
+ NTP_4_2_7P220
+
+ sntp/sntp-opts.h@1.218 +3 -3
+ NTP_4_2_7P220
+
+ sntp/sntp-opts.texi@1.218 +2 -2
+ NTP_4_2_7P220
+
+ sntp/sntp.1sntpman@1.38 +2 -2
+ NTP_4_2_7P220
+
+ sntp/sntp.1sntpmdoc@1.38 +2 -2
+ NTP_4_2_7P220
+
+ sntp/sntp.html@1.218 +2 -2
+ NTP_4_2_7P220
+
+ sntp/sntp.man.in@1.38 +2 -2
+ NTP_4_2_7P220
+
+ sntp/sntp.mdoc.in@1.38 +2 -2
+ NTP_4_2_7P220
+
+ util/ntp-keygen-opts.c@1.222 +3 -3
+ NTP_4_2_7P220
+
+ util/ntp-keygen-opts.h@1.222 +3 -3
+ NTP_4_2_7P220
+
+ util/ntp-keygen-opts.texi@1.223 +2 -2
+ NTP_4_2_7P220
+
+ util/ntp-keygen.1ntp-keygenman@1.36 +2 -2
+ NTP_4_2_7P220
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.36 +2 -2
+ NTP_4_2_7P220
+
+ util/ntp-keygen.man.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ util/ntp-keygen.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P220
+
+ChangeSet@1.2673.1.27, 2011-10-05 08:34:46+00:00, davehart@shiny.ad.hartbrothers.com
+ Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1
+
+ include/ntp_refclock.h@1.32 +4 -0
+ Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1
+
+ ntpd/ntp_refclock.c@1.109 +3 -1
+ Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1
+
+ ntpd/refclock_parse.c@1.61 +3 -0
+ Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.60 +2 -4
+ Keep add_full_recv_buffer() and SetEvent(WaitableIoEventHandle) 1:1
+
+ChangeSet@1.2673.1.26, 2011-10-05 07:49:15+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1945] mbg_gps166.h use of _TM_DEFINED conflicts with MS VC.
+ [Bug 1946] parse_start uses open; does not work on Windows.
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ChangeLog@1.1032.1.21 +3 -0
+ [Bug 1945] mbg_gps166.h use of _TM_DEFINED conflicts with MS VC.
+ [Bug 1946] parse_start uses open; does not work on Windows.
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ include/mbg_gps166.h@1.11 +2 -2
+ [Bug 1945] mbg_gps166.h use of _TM_DEFINED conflicts with MS VC.
+
+ include/ntp_refclock.h@1.31 +4 -1
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ libparse/clk_wharton.c@1.8 +1 -1
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ntpd/ntp_io.c@1.359 +15 -22
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ntpd/ntp_refclock.c@1.108 +33 -0
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ntpd/refclock_parse.c@1.60 +13 -10
+ [Bug 1946] parse_start uses open; does not work on Windows.
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ports/winnt/include/config.h@1.102 +14 -1
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.59 +17 -15
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.16 +12 -240
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.41 +4 -336
+ [Bug 1947] Porting parse-based Wharton refclock driver to Windows.
+
+ChangeSet@1.2673.1.25, 2011-10-04 21:34:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2024] Remove unused system event code EVNT_CLKHOP.
+
+ ChangeLog@1.1032.1.20 +1 -0
+ [Bug 2024] Remove unused system event code EVNT_CLKHOP.
+
+ include/ntp.h@1.197 +0 -1
+ [Bug 2024] Remove unused system event code EVNT_CLKHOP.
+
+ libntp/statestr.c@1.25 +0 -1
+ [Bug 2024] Remove unused system event code EVNT_CLKHOP.
+
+ChangeSet@1.2673.1.24, 2011-10-04 10:54:55+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P219
+ TAG: NTP_4_2_7P219
+
+ ChangeLog@1.1032.1.19 +1 -0
+ NTP_4_2_7P219
+
+ ntpd/ntpd-opts.c@1.224 +3 -3
+ NTP_4_2_7P219
+
+ ntpd/ntpd-opts.h@1.224 +3 -3
+ NTP_4_2_7P219
+
+ ntpd/ntpd-opts.texi@1.222 +2 -2
+ NTP_4_2_7P219
+
+ ntpd/ntpd.1ntpdman@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpd/ntpd.1ntpdmdoc@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpd/ntpd.man.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpd/ntpd.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc-opts.c@1.219 +3 -3
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc-opts.h@1.219 +3 -3
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc-opts.texi@1.219 +2 -2
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc.1ntpdcman@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc.html@1.47 +2 -2
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc.man.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpdc/ntpdc.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpq/ntpq-opts.c@1.221 +3 -3
+ NTP_4_2_7P219
+
+ ntpq/ntpq-opts.h@1.221 +3 -3
+ NTP_4_2_7P219
+
+ ntpq/ntpq-opts.texi@1.221 +2 -2
+ NTP_4_2_7P219
+
+ ntpq/ntpq.1ntpqman@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpq/ntpq.1ntpqmdoc@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpq/ntpq.man.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpq/ntpq.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.221 +3 -3
+ NTP_4_2_7P219
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.221 +3 -3
+ NTP_4_2_7P219
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.221 +2 -2
+ NTP_4_2_7P219
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpsnmpd/ntpsnmpd.man.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ packageinfo.sh@1.222 +1 -1
+ NTP_4_2_7P219
+
+ scripts/ntp-wait-opts.texi@1.39 +1 -1
+ NTP_4_2_7P219
+
+ scripts/ntp-wait.1ntp-waitman@1.35 +2 -2
+ NTP_4_2_7P219
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.35 +2 -2
+ NTP_4_2_7P219
+
+ scripts/ntp-wait.html@1.39 +1 -1
+ NTP_4_2_7P219
+
+ scripts/ntp-wait.man.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ scripts/ntp-wait.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ sntp/sntp-opts.c@1.217 +3 -3
+ NTP_4_2_7P219
+
+ sntp/sntp-opts.h@1.217 +3 -3
+ NTP_4_2_7P219
+
+ sntp/sntp-opts.texi@1.217 +2 -2
+ NTP_4_2_7P219
+
+ sntp/sntp.1sntpman@1.37 +2 -2
+ NTP_4_2_7P219
+
+ sntp/sntp.1sntpmdoc@1.37 +2 -2
+ NTP_4_2_7P219
+
+ sntp/sntp.html@1.217 +2 -2
+ NTP_4_2_7P219
+
+ sntp/sntp.man.in@1.37 +2 -2
+ NTP_4_2_7P219
+
+ sntp/sntp.mdoc.in@1.37 +2 -2
+ NTP_4_2_7P219
+
+ util/ntp-keygen-opts.c@1.221 +3 -3
+ NTP_4_2_7P219
+
+ util/ntp-keygen-opts.h@1.221 +3 -3
+ NTP_4_2_7P219
+
+ util/ntp-keygen-opts.texi@1.222 +2 -2
+ NTP_4_2_7P219
+
+ util/ntp-keygen.1ntp-keygenman@1.35 +2 -2
+ NTP_4_2_7P219
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.35 +2 -2
+ NTP_4_2_7P219
+
+ util/ntp-keygen.man.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ util/ntp-keygen.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P219
+
+ChangeSet@1.2673.1.23, 2011-10-03 17:51:59-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1032.1.18 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.8 +12 -5
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.21 +3 -3
+ Documentation updates from Dave Mills
+
+ html/drivers/driver20.html@1.25 +12 -21
+ Documentation updates from Dave Mills
+
+ html/drivers/driver8.html@1.28 +2 -2
+ Documentation updates from Dave Mills
+
+ html/history.html@1.2 +2 -2
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.31 +10 -10
+ Documentation updates from Dave Mills
+
+ html/release.html@1.42 +3 -3
+ Documentation updates from Dave Mills
+
+ html/scripts/footer.txt@1.4 +6 -1
+ Documentation updates from Dave Mills
+
+ html/sntp.html@1.9 +4 -4
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2673.1.22, 2011-10-03 05:00:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P218
+ TAG: NTP_4_2_7P218
+
+ ChangeLog@1.1032.1.17 +1 -0
+ NTP_4_2_7P218
+
+ ntpd/ntpd-opts.c@1.223 +3 -3
+ NTP_4_2_7P218
+
+ ntpd/ntpd-opts.h@1.223 +3 -3
+ NTP_4_2_7P218
+
+ ntpd/ntpd-opts.texi@1.221 +2 -2
+ NTP_4_2_7P218
+
+ ntpd/ntpd.1ntpdman@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpd/ntpd.1ntpdmdoc@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpd/ntpd.man.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpd/ntpd.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc-opts.c@1.218 +3 -3
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc-opts.h@1.218 +3 -3
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc-opts.texi@1.218 +2 -2
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc.1ntpdcman@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc.html@1.46 +2 -2
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc.man.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpdc/ntpdc.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpq/ntpq-opts.c@1.220 +3 -3
+ NTP_4_2_7P218
+
+ ntpq/ntpq-opts.h@1.220 +3 -3
+ NTP_4_2_7P218
+
+ ntpq/ntpq-opts.texi@1.220 +2 -2
+ NTP_4_2_7P218
+
+ ntpq/ntpq.1ntpqman@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpq/ntpq.1ntpqmdoc@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpq/ntpq.man.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpq/ntpq.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.220 +3 -3
+ NTP_4_2_7P218
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.220 +3 -3
+ NTP_4_2_7P218
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.220 +2 -2
+ NTP_4_2_7P218
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpsnmpd/ntpsnmpd.man.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ packageinfo.sh@1.221 +1 -1
+ NTP_4_2_7P218
+
+ scripts/ntp-wait-opts.texi@1.38 +1 -1
+ NTP_4_2_7P218
+
+ scripts/ntp-wait.1ntp-waitman@1.34 +2 -2
+ NTP_4_2_7P218
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.34 +2 -2
+ NTP_4_2_7P218
+
+ scripts/ntp-wait.html@1.38 +1 -1
+ NTP_4_2_7P218
+
+ scripts/ntp-wait.man.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ scripts/ntp-wait.mdoc.in@1.34 +2 -2
+ NTP_4_2_7P218
+
+ sntp/sntp-opts.c@1.216 +3 -3
+ NTP_4_2_7P218
+
+ sntp/sntp-opts.h@1.216 +3 -3
+ NTP_4_2_7P218
+
+ sntp/sntp-opts.texi@1.216 +2 -2
+ NTP_4_2_7P218
+
+ sntp/sntp.1sntpman@1.36 +2 -2
+ NTP_4_2_7P218
+
+ sntp/sntp.1sntpmdoc@1.36 +2 -2
+ NTP_4_2_7P218
+
+ sntp/sntp.html@1.216 +2 -2
+ NTP_4_2_7P218
+
+ sntp/sntp.man.in@1.36 +2 -2
+ NTP_4_2_7P218
+
+ sntp/sntp.mdoc.in@1.36 +2 -2
+ NTP_4_2_7P218
+
+ util/ntp-keygen-opts.c@1.220 +3 -3
+ NTP_4_2_7P218
+
+ util/ntp-keygen-opts.h@1.220 +3 -3
+ NTP_4_2_7P218
+
+ util/ntp-keygen-opts.texi@1.221 +22 -3
+ NTP_4_2_7P218
+
+ util/ntp-keygen.1ntp-keygenman@1.34 +11 -3
+ NTP_4_2_7P218
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.34 +10 -3
+ NTP_4_2_7P218
+
+ util/ntp-keygen.man.in@1.34 +11 -3
+ NTP_4_2_7P218
+
+ util/ntp-keygen.mdoc.in@1.34 +10 -3
+ NTP_4_2_7P218
+
+ChangeSet@1.2673.1.21, 2011-10-02 19:41:17-04:00, stenn@deacon.udel.edu
+ typo
+
+ util/ntp-keygen-opts.def@1.19 +1 -1
+ typo
+
+ChangeSet@1.2673.1.19, 2011-10-02 22:12:47+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2019] Allow selection of cipher for private key files.
+ ntp-keygen private key cipher default now triple-key triple DES CBC.
+ ntp-keygen on Windows XP and later systems will now create links
+ expected by ntpd. They are hardlinks on Windows, soft on POSIX.
+
+ ChangeLog@1.1032.1.15 +4 -0
+ [Bug 2019] Allow selection of cipher for private key files.
+ ntp-keygen private key cipher default now triple-key triple DES CBC.
+ ntp-keygen on Windows XP and later systems will now create links
+ expected by ntpd. They are hardlinks on Windows, soft on POSIX.
+
+
+ util/ntp-keygen-opts.c@1.219 +68 -38
+ [Bug 2019] add -c/--cipher
+
+ util/ntp-keygen-opts.def@1.18 +1 -1
+ Minor correction.
+
+ util/ntp-keygen-opts.h@1.219 +32 -25
+ [Bug 2019] add -c/--cipher
+
+ util/ntp-keygen.c@1.86 +81 -38
+ Change multiple fclose(stdout) to fflush(stdout).
+ Generate ntp-keygen (hard) links correctly on Windows XP and later.
+ Use PEM_write_PKCS8PrivateKey() in place of deprecated predecessor.
+ Existing clients going back to at least 2002 can use the new format
+ with no changes to deployed code.
+
+
+ChangeSet@1.2673.3.2, 2011-10-02 18:09:07-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/history.html@1.1 +74 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/history.html
+
+ html/history.html@1.0 +0 -0
+
+ChangeSet@1.2673.3.1, 2011-10-02 17:43:54-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.1032.3.1 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.7 +10 -10
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.30 +2 -3
+ Documentation updates from Dave Mills
+
+ html/release.html@1.41 +2 -1
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2673.1.18, 2011-10-02 19:14:22+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2019] Allow selection of cipher for private key files.
+ Change default cipher from DES CBC to triple-key triple DES CBC.
+
+ util/ntp-keygen-opts.def@1.17 +15 -0
+ Add -C/--cipher option to ntp-keygen for [Bug 2019]
+
+ util/ntp-keygen.c@1.85 +20 -8
+ [Bug 2019] Allow selection of cipher for private key files.
+ Change default cipher from DES CBC to triple-key triple DES CBC.
+
+ChangeSet@1.2673.1.17, 2011-10-02 08:47:56+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp-keygen -M is intended to ignore all other defaults and
+ options, so do not attempt to open existing Autokey host certificate
+ before generating symmetric keys and terminating.
+ Restore IFF, MV, and GQ identity parameter filename convention to
+ ntpkey_<scheme>par_<group/host> in ntpd, matching ntp-keygen.
+ Change some error logging to syslog to ignore logconfig mask, such
+ as reporting PPSAPI failure in NMEA and WWVB refclocks.
+ Conditionalize NMEA serial open message under clockevent.
+ Send all peer variables to trappers in report_event().
+
+ ChangeLog@1.1032.1.14 +9 -0
+ ntp-keygen -M is intended to ignore all other defaults and
+ options, so do not attempt to open existing Autokey host certificate
+ before generating symmetric keys and terminating.
+ Restore IFF, MV, and GQ identity parameter filename convention to
+ ntpkey_<scheme>par_<group/host> in ntpd, matching ntp-keygen.
+ Change some error logging to syslog to ignore logconfig mask, such
+ as reporting PPSAPI failure in NMEA and WWVB refclocks.
+ Conditionalize NMEA serial open message under clockevent.
+ Send all peer variables to trappers in report_event().
+
+
+ include/ntp_syslog.h@1.8 +8 -1
+ Provide LOGIF(CLOCKINFO, (LOG_INFO, "msyslog %s", "args"))
+ as alternative to
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO, "msyslog %s", args);
+
+ ntpd/ntp_control.c@1.171 +6 -21
+ Send all peer variables to trappers, as intended.
+
+ ntpd/ntp_crypto.c@1.159 +37 -27
+ Restore IFF, MV, and GQ identity parameter filename convention to
+ ntpkey_<scheme>par_<group/host> in ntpd, matching ntp-keygen.
+
+ ntpd/ntp_loopfilter.c@1.166 +1 -1
+ Fix spelling in comment.
+
+ ntpd/refclock_nmea.c@1.63 +32 -34
+ Make failure and GPS time syslog output ignore logconfig.
+ Conditionalize serial output syslog under clockevent.
+
+ ntpd/refclock_wwvb.c@1.32 +10 -11
+ Report PPSAPI failure to log regardless of logconfig.
+
+ util/ntp-keygen.c@1.84 +11 -11
+ ntp-keygen -M is intended to ignore all other defaults and
+ options, so do not attempt to open existing Autokey host certificate
+ before generating symmetric keys and terminating.
+
+ChangeSet@1.2673.1.16, 2011-09-29 08:06:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P217
+ TAG: NTP_4_2_7P217
+
+ ChangeLog@1.1032.1.13 +1 -0
+ NTP_4_2_7P217
+
+ ntpd/ntpd-opts.c@1.222 +3 -3
+ NTP_4_2_7P217
+
+ ntpd/ntpd-opts.h@1.222 +3 -3
+ NTP_4_2_7P217
+
+ ntpd/ntpd-opts.texi@1.220 +2 -2
+ NTP_4_2_7P217
+
+ ntpd/ntpd.1ntpdman@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpd/ntpd.1ntpdmdoc@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpd/ntpd.man.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpd/ntpd.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc-opts.c@1.217 +3 -3
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc-opts.h@1.217 +3 -3
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc-opts.texi@1.217 +2 -2
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc.1ntpdcman@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc.html@1.45 +2 -2
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc.man.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpdc/ntpdc.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpq/ntpq-opts.c@1.219 +3 -3
+ NTP_4_2_7P217
+
+ ntpq/ntpq-opts.h@1.219 +3 -3
+ NTP_4_2_7P217
+
+ ntpq/ntpq-opts.texi@1.219 +2 -2
+ NTP_4_2_7P217
+
+ ntpq/ntpq.1ntpqman@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpq/ntpq.1ntpqmdoc@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpq/ntpq.man.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpq/ntpq.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.219 +3 -3
+ NTP_4_2_7P217
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.219 +3 -3
+ NTP_4_2_7P217
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.219 +2 -2
+ NTP_4_2_7P217
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpsnmpd/ntpsnmpd.man.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ packageinfo.sh@1.220 +1 -1
+ NTP_4_2_7P217
+
+ scripts/ntp-wait-opts.texi@1.37 +1 -1
+ NTP_4_2_7P217
+
+ scripts/ntp-wait.1ntp-waitman@1.33 +2 -2
+ NTP_4_2_7P217
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.33 +2 -2
+ NTP_4_2_7P217
+
+ scripts/ntp-wait.html@1.37 +1 -1
+ NTP_4_2_7P217
+
+ scripts/ntp-wait.man.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ scripts/ntp-wait.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P217
+
+ sntp/sntp-opts.c@1.215 +3 -3
+ NTP_4_2_7P217
+
+ sntp/sntp-opts.h@1.215 +3 -3
+ NTP_4_2_7P217
+
+ sntp/sntp-opts.texi@1.215 +2 -2
+ NTP_4_2_7P217
+
+ sntp/sntp.1sntpman@1.35 +2 -2
+ NTP_4_2_7P217
+
+ sntp/sntp.1sntpmdoc@1.35 +2 -2
+ NTP_4_2_7P217
+
+ sntp/sntp.html@1.215 +2 -2
+ NTP_4_2_7P217
+
+ sntp/sntp.man.in@1.35 +2 -2
+ NTP_4_2_7P217
+
+ sntp/sntp.mdoc.in@1.35 +2 -2
+ NTP_4_2_7P217
+
+ util/ntp-keygen-opts.c@1.218 +3 -3
+ NTP_4_2_7P217
+
+ util/ntp-keygen-opts.h@1.218 +3 -3
+ NTP_4_2_7P217
+
+ util/ntp-keygen-opts.texi@1.220 +34 -20
+ NTP_4_2_7P217
+
+ util/ntp-keygen.1ntp-keygenman@1.33 +24 -10
+ NTP_4_2_7P217
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.33 +24 -10
+ NTP_4_2_7P217
+
+ util/ntp-keygen.man.in@1.33 +24 -10
+ NTP_4_2_7P217
+
+ util/ntp-keygen.mdoc.in@1.33 +24 -10
+ NTP_4_2_7P217
+
+ChangeSet@1.2673.1.15, 2011-09-29 03:52:53-04:00, stenn@deacon.udel.edu
+ cleanup
+
+ ChangeLog@1.1032.1.12 +2 -2
+ cleanup
+
+ChangeSet@1.2673.1.14, 2011-09-29 07:17:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2020] ntp-keygen -s no longer sets host in cert file name.
+ ntp-keygen -i option long name changed from misleading --issuer-name
+ to --ident. [Backward Incompatible]
+
+ ChangeLog@1.1032.1.11 +3 -0
+ [Bug 2020] ntp-keygen -s no longer sets host in cert file name.
+ ntp-keygen -i option long name changed from misleading --issuer-name
+ to --ident. [Backward Incompatible]
+
+ ports/winnt/include/sys/time.h@1.7 +1 -1
+ Correct type of unused 2nd argument in port's gettimeofday()
+
+ ports/winnt/libntp/util_clockstuff.c@1.6 +2 -2
+ Correct type of unused 2nd argument in port's gettimeofday()
+
+ util/ntp-keygen-opts.c@1.217 +17 -17
+ ntp-keygen -i option long name changed from misleading --issuer-name
+ to --ident. [Backward Incompatible]
+
+ util/ntp-keygen-opts.h@1.217 +7 -7
+ ntp-keygen -i option long name changed from misleading --issuer-name
+ to --ident. [Backward Incompatible]
+
+ util/ntp-keygen.c@1.83 +51 -28
+ [Bug 2020] ntp-keygen -s no longer sets host in cert file name.
+ ntp-keygen -i option long name changed from misleading --issuer-name
+ to --ident. [Backward Incompatible]
+
+ChangeSet@1.2673.1.13, 2011-09-29 05:16:02+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2009] cleanup warning about adj_systime() returning no value.
+ [Bug 2020] Expand ntp-keygen-opts.def explanations of host name and
+ group name options and how they affect output, rename -i long form
+ from --issuer-name to --ident to match reality.
+
+ libntp/systime.c@1.55.1.2 +3 -3
+ [Bug 2009] cleanup: adj_systime() must return a value.
+
+ util/ntp-keygen-opts.def@1.16 +23 -9
+ [Bug 2020] groundwork. Clarify interaction of -i group and -s host[@group]
+ options and rename long option for -i from --issuer-name to --ident, as
+ the group name is never used for certificate issuer. Spell out how group
+ and host names are used. Backward compatibility is a relatively minor
+ issue as the official documentation and Steve's examples mention only
+ the short flag -i.
+
+ util/ntp-keygen.c@1.82 +9 -9
+ [Bug 2020] groundwork. Clarify interaction of -i group and -s host[@group]
+ options and rename long option for -i from --issuer-name to --ident, as
+ the group name is never used for certificate issuer. Spell out how group
+ and host names are used. Backward compatibility is a relatively minor
+ issue as the official documentation and Steve's examples mention only
+ the short flag -i.
+
+ChangeSet@1.2673.1.12, 2011-09-27 10:41:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P216
+ TAG: NTP_4_2_7P216
+
+ ChangeLog@1.1032.1.10 +1 -0
+ NTP_4_2_7P216
+
+ ntpd/ntpd-opts.c@1.221 +3 -3
+ NTP_4_2_7P216
+
+ ntpd/ntpd-opts.h@1.221 +3 -3
+ NTP_4_2_7P216
+
+ ntpd/ntpd-opts.texi@1.219 +2 -2
+ NTP_4_2_7P216
+
+ ntpd/ntpd.1ntpdman@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpd/ntpd.1ntpdmdoc@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpd/ntpd.man.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpd/ntpd.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc-opts.c@1.216 +3 -3
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc-opts.h@1.216 +3 -3
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc-opts.texi@1.216 +2 -2
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc.1ntpdcman@1.32 +8 -8
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc.html@1.44 +2 -2
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc.man.in@1.32 +8 -8
+ NTP_4_2_7P216
+
+ ntpdc/ntpdc.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpq/ntpq-opts.c@1.218 +3 -3
+ NTP_4_2_7P216
+
+ ntpq/ntpq-opts.h@1.218 +3 -3
+ NTP_4_2_7P216
+
+ ntpq/ntpq-opts.texi@1.218 +2 -2
+ NTP_4_2_7P216
+
+ ntpq/ntpq.1ntpqman@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpq/ntpq.1ntpqmdoc@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpq/ntpq.man.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpq/ntpq.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.218 +3 -3
+ NTP_4_2_7P216
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.218 +3 -3
+ NTP_4_2_7P216
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.218 +2 -2
+ NTP_4_2_7P216
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpsnmpd/ntpsnmpd.man.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ packageinfo.sh@1.219 +1 -1
+ NTP_4_2_7P216
+
+ scripts/ntp-wait-opts.texi@1.36 +1 -1
+ NTP_4_2_7P216
+
+ scripts/ntp-wait.1ntp-waitman@1.32 +2 -2
+ NTP_4_2_7P216
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.32 +2 -2
+ NTP_4_2_7P216
+
+ scripts/ntp-wait.html@1.36 +1 -1
+ NTP_4_2_7P216
+
+ scripts/ntp-wait.man.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ scripts/ntp-wait.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ sntp/sntp-opts.c@1.214 +9 -9
+ NTP_4_2_7P216
+
+ sntp/sntp-opts.h@1.214 +3 -3
+ NTP_4_2_7P216
+
+ sntp/sntp-opts.texi@1.214 +21 -21
+ NTP_4_2_7P216
+
+ sntp/sntp.1sntpman@1.34 +15 -15
+ NTP_4_2_7P216
+
+ sntp/sntp.1sntpmdoc@1.34 +15 -15
+ NTP_4_2_7P216
+
+ sntp/sntp.html@1.214 +21 -21
+ NTP_4_2_7P216
+
+ sntp/sntp.man.in@1.34 +15 -15
+ NTP_4_2_7P216
+
+ sntp/sntp.mdoc.in@1.34 +15 -15
+ NTP_4_2_7P216
+
+ util/ntp-keygen-opts.c@1.216 +3 -3
+ NTP_4_2_7P216
+
+ util/ntp-keygen-opts.h@1.216 +3 -3
+ NTP_4_2_7P216
+
+ util/ntp-keygen-opts.texi@1.219 +2 -2
+ NTP_4_2_7P216
+
+ util/ntp-keygen.1ntp-keygenman@1.32 +2 -2
+ NTP_4_2_7P216
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.32 +2 -2
+ NTP_4_2_7P216
+
+ util/ntp-keygen.man.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ util/ntp-keygen.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P216
+
+ChangeSet@1.2673.2.1, 2011-09-27 05:49:23-04:00, stenn@psp-deb1.ntp.org
+ mdoc2man improvements
+
+ ChangeLog@1.1032.2.2 +1 -0
+ mdoc2man improvements
+
+ ChangeLog@1.1032.2.1 +1 -0
+ sntp documentation tag cleanup
+
+ sntp/ag-tpl/mdoc2man@1.2 +27 -14
+ mdoc2man improvements
+
+ sntp/sntp-opts.def@1.39 +13 -13
+ sntp documentation tag cleanup
+
+ChangeSet@1.2673.1.10, 2011-09-24 02:03:00+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P215
+ TAG: NTP_4_2_7P215
+
+ ChangeLog@1.1032.1.8 +1 -0
+ NTP_4_2_7P215
+
+ ntpd/ntpd-opts.c@1.220 +3 -3
+ NTP_4_2_7P215
+
+ ntpd/ntpd-opts.h@1.220 +3 -3
+ NTP_4_2_7P215
+
+ ntpd/ntpd-opts.texi@1.218 +2 -2
+ NTP_4_2_7P215
+
+ ntpd/ntpd.1ntpdman@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpd/ntpd.1ntpdmdoc@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpd/ntpd.man.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpd/ntpd.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc-opts.c@1.215 +3 -3
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc-opts.h@1.215 +3 -3
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc-opts.texi@1.215 +2 -2
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc.1ntpdcman@1.31 +309 -3
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc.html@1.43 +2 -2
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc.man.in@1.31 +309 -3
+ NTP_4_2_7P215
+
+ ntpdc/ntpdc.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpq/ntpq-opts.c@1.217 +3 -3
+ NTP_4_2_7P215
+
+ ntpq/ntpq-opts.h@1.217 +3 -3
+ NTP_4_2_7P215
+
+ ntpq/ntpq-opts.texi@1.217 +2 -2
+ NTP_4_2_7P215
+
+ ntpq/ntpq.1ntpqman@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpq/ntpq.1ntpqmdoc@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpq/ntpq.man.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpq/ntpq.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.217 +3 -3
+ NTP_4_2_7P215
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.217 +3 -3
+ NTP_4_2_7P215
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.217 +2 -2
+ NTP_4_2_7P215
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpsnmpd/ntpsnmpd.man.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ packageinfo.sh@1.218 +1 -1
+ NTP_4_2_7P215
+
+ scripts/ntp-wait-opts.texi@1.35 +1 -1
+ NTP_4_2_7P215
+
+ scripts/ntp-wait.1ntp-waitman@1.31 +2 -2
+ NTP_4_2_7P215
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.31 +2 -2
+ NTP_4_2_7P215
+
+ scripts/ntp-wait.html@1.35 +1 -1
+ NTP_4_2_7P215
+
+ scripts/ntp-wait.man.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ scripts/ntp-wait.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ sntp/sntp-opts.c@1.213 +3 -3
+ NTP_4_2_7P215
+
+ sntp/sntp-opts.h@1.213 +3 -3
+ NTP_4_2_7P215
+
+ sntp/sntp-opts.texi@1.213 +2 -2
+ NTP_4_2_7P215
+
+ sntp/sntp.1sntpman@1.33 +2 -2
+ NTP_4_2_7P215
+
+ sntp/sntp.1sntpmdoc@1.33 +2 -2
+ NTP_4_2_7P215
+
+ sntp/sntp.html@1.213 +2 -2
+ NTP_4_2_7P215
+
+ sntp/sntp.man.in@1.33 +2 -2
+ NTP_4_2_7P215
+
+ sntp/sntp.mdoc.in@1.33 +2 -2
+ NTP_4_2_7P215
+
+ util/ntp-keygen-opts.c@1.215 +3 -3
+ NTP_4_2_7P215
+
+ util/ntp-keygen-opts.h@1.215 +3 -3
+ NTP_4_2_7P215
+
+ util/ntp-keygen-opts.texi@1.218 +2 -2
+ NTP_4_2_7P215
+
+ util/ntp-keygen.1ntp-keygenman@1.31 +2 -2
+ NTP_4_2_7P215
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.31 +2 -2
+ NTP_4_2_7P215
+
+ util/ntp-keygen.man.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ util/ntp-keygen.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P215
+
+ChangeSet@1.2673.1.9, 2011-09-23 21:47:46-04:00, stenn@deacon.udel.edu
+ Use patched mdoc2man script, from Eric Feng
+
+ ChangeLog@1.1032.1.7 +2 -0
+ Use patched mdoc2man script, from Eric Feng
+
+ChangeSet@1.2673.1.8, 2011-09-23 05:32:43+00:00, stenn@psp-fb1.ntp.org
+ Use updated mdoc2man
+
+ sntp/ag-tpl/mdoc2man@1.1 +288 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev/sntp/ag-tpl/mdoc2man
+
+ sntp/ag-tpl/mdoc2man@1.0 +0 -0
+
+ChangeSet@1.2082.4.237, 2011-09-23 03:38:30+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P4
+ TAG: NTP_4_2_6P4
+
+ ChangeLog@1.496.26.170 +1 -0
+ NTP_4_2_6P4
+
+ ntpd/ntpd-opts.c@1.248.39.1 +5 -5
+ NTP_4_2_6P4
+
+ ntpd/ntpd-opts.h@1.248.39.1 +3 -3
+ NTP_4_2_6P4
+
+ ntpd/ntpd-opts.texi@1.246.38.1 +2 -2
+ NTP_4_2_6P4
+
+ ntpd/ntpd.1@1.246.38.1 +2 -2
+ NTP_4_2_6P4
+
+ ntpdc/ntpdc-opts.c@1.244.39.1 +5 -5
+ NTP_4_2_6P4
+
+ ntpdc/ntpdc-opts.h@1.244.39.1 +3 -3
+ NTP_4_2_6P4
+
+ ntpdc/ntpdc-opts.texi@1.243.38.1 +2 -2
+ NTP_4_2_6P4
+
+ ntpdc/ntpdc.1@1.243.38.1 +2 -2
+ NTP_4_2_6P4
+
+ ntpq/ntpq-opts.c@1.245.39.1 +5 -5
+ NTP_4_2_6P4
+
+ ntpq/ntpq-opts.h@1.245.39.1 +3 -3
+ NTP_4_2_6P4
+
+ ntpq/ntpq-opts.texi@1.244.38.1 +2 -2
+ NTP_4_2_6P4
+
+ ntpq/ntpq.1@1.244.38.1 +2 -2
+ NTP_4_2_6P4
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.40.1 +5 -5
+ NTP_4_2_6P4
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.40.1 +3 -3
+ NTP_4_2_6P4
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.39.1 +2 -2
+ NTP_4_2_6P4
+
+ ntpsnmpd/ntpsnmpd.1@1.122.39.1 +2 -2
+ NTP_4_2_6P4
+
+ packageinfo.sh@1.255.36.2 +3 -3
+ NTP_4_2_6P4
+
+ sntp/sntp-opts.c@1.117.38.1 +7 -7
+ NTP_4_2_6P4
+
+ sntp/sntp-opts.h@1.117.38.1 +3 -3
+ NTP_4_2_6P4
+
+ sntp/sntp-opts.texi@1.117.37.1 +4 -4
+ NTP_4_2_6P4
+
+ sntp/sntp.1@1.117.37.1 +2 -2
+ NTP_4_2_6P4
+
+ sntp/sntp.html@1.7.38.1 +42 -60
+ NTP_4_2_6P4
+
+ util/ntp-keygen-opts.c@1.247.39.1 +5 -5
+ NTP_4_2_6P4
+
+ util/ntp-keygen-opts.h@1.247.39.1 +3 -3
+ NTP_4_2_6P4
+
+ util/ntp-keygen-opts.texi@1.246.38.1 +2 -2
+ NTP_4_2_6P4
+
+ util/ntp-keygen.1@1.246.38.1 +2 -2
+ NTP_4_2_6P4
+
+ChangeSet@1.2082.4.236, 2011-09-22 22:40:12-04:00, stenn@deacon.udel.edu
+ ntp-4.2.6p4
+
+ ChangeLog@1.496.26.169 +1 -0
+ ntp-4.2.6p4
+
+ NEWS@1.119 +62 -37
+ ntp-4.2.6p4
+
+ packageinfo.sh@1.255.36.1 +1 -1
+ ntp-4.2.6p4
+
+ChangeSet@1.2673.1.6, 2011-09-20 19:45:00+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P214
+ TAG: NTP_4_2_7P214
+
+ ChangeLog@1.1032.1.5 +1 -0
+ NTP_4_2_7P214
+
+ ntpd/ntpd-opts.c@1.219 +3 -3
+ NTP_4_2_7P214
+
+ ntpd/ntpd-opts.h@1.219 +3 -3
+ NTP_4_2_7P214
+
+ ntpd/ntpd-opts.texi@1.217 +2 -2
+ NTP_4_2_7P214
+
+ ntpd/ntpd.1ntpdman@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpd/ntpd.1ntpdmdoc@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpd/ntpd.man.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpd/ntpd.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc-opts.c@1.214 +3 -3
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc-opts.h@1.214 +3 -3
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc-opts.texi@1.214 +2 -2
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc.1ntpdcman@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc.html@1.42 +2 -2
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc.man.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpdc/ntpdc.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpq/ntpq-opts.c@1.216 +3 -3
+ NTP_4_2_7P214
+
+ ntpq/ntpq-opts.h@1.216 +3 -3
+ NTP_4_2_7P214
+
+ ntpq/ntpq-opts.texi@1.216 +2 -2
+ NTP_4_2_7P214
+
+ ntpq/ntpq.1ntpqman@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpq/ntpq.1ntpqmdoc@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpq/ntpq.man.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpq/ntpq.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.216 +3 -3
+ NTP_4_2_7P214
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.216 +3 -3
+ NTP_4_2_7P214
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.216 +2 -2
+ NTP_4_2_7P214
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpsnmpd/ntpsnmpd.man.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ packageinfo.sh@1.217 +1 -1
+ NTP_4_2_7P214
+
+ scripts/ntp-wait-opts.texi@1.34 +1 -1
+ NTP_4_2_7P214
+
+ scripts/ntp-wait.1ntp-waitman@1.30 +2 -2
+ NTP_4_2_7P214
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.30 +2 -2
+ NTP_4_2_7P214
+
+ scripts/ntp-wait.html@1.34 +1 -1
+ NTP_4_2_7P214
+
+ scripts/ntp-wait.man.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ scripts/ntp-wait.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ sntp/sntp-opts.c@1.212 +3 -3
+ NTP_4_2_7P214
+
+ sntp/sntp-opts.h@1.212 +3 -3
+ NTP_4_2_7P214
+
+ sntp/sntp-opts.texi@1.212 +2 -2
+ NTP_4_2_7P214
+
+ sntp/sntp.1sntpman@1.32 +2 -2
+ NTP_4_2_7P214
+
+ sntp/sntp.1sntpmdoc@1.32 +2 -2
+ NTP_4_2_7P214
+
+ sntp/sntp.html@1.212 +2 -2
+ NTP_4_2_7P214
+
+ sntp/sntp.man.in@1.32 +2 -2
+ NTP_4_2_7P214
+
+ sntp/sntp.mdoc.in@1.32 +2 -2
+ NTP_4_2_7P214
+
+ util/ntp-keygen-opts.c@1.214 +3 -3
+ NTP_4_2_7P214
+
+ util/ntp-keygen-opts.h@1.214 +3 -3
+ NTP_4_2_7P214
+
+ util/ntp-keygen-opts.texi@1.217 +2 -2
+ NTP_4_2_7P214
+
+ util/ntp-keygen.1ntp-keygenman@1.30 +2 -2
+ NTP_4_2_7P214
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.30 +2 -2
+ NTP_4_2_7P214
+
+ util/ntp-keygen.man.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ util/ntp-keygen.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P214
+
+ChangeSet@1.2673.1.5, 2011-09-20 15:29:47-04:00, stenn@deacon.udel.edu
+ whitespace cleanup
+
+ Makefile.am@1.114 +3 -3
+ whitespace cleanup
+
+ChangeSet@1.2673.1.4, 2011-09-20 01:32:36+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2009] EVNT_NSET adj_systime() mishandled by Windows ntpd.
+
+ ChangeLog@1.1032.1.4 +1 -0
+ [Bug 2009] EVNT_NSET adj_systime() mishandled by Windows ntpd.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.53 +33 -19
+ [Bug 2009] EVNT_NSET adj_systime() mishandled by Windows ntpd.
+
+ChangeSet@1.2673.1.3, 2011-09-19 18:09:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1981] Initial offset convergence applies frequency correction 2x
+ with kernel discipline.
+ [Bug 2008] Initial offset convergence degraded with 500 PPM adjtime().
+
+ ChangeLog@1.1032.1.3 +3 -0
+ [Bug 1981] Initial offset convergence applies frequency correction 2x
+ with kernel discipline.
+ [Bug 2008] Initial offset convergence degraded with 500 PPM adjtime().
+
+ libntp/systime.c@1.55.1.1 +12 -0
+ [Bug 1981] Initial offset convergence applies frequency correction 2x
+ with kernel discipline.
+ [Bug 2008] Initial offset convergence degraded with 500 PPM adjtime().
+
+ ntpd/ntp_loopfilter.c@1.165 +61 -47
+ [Bug 1981] Initial offset convergence applies frequency correction 2x
+ with kernel discipline.
+ [Bug 2008] Initial offset convergence degraded with 500 PPM adjtime().
+
+ChangeSet@1.2673.1.2, 2011-09-08 11:46:02+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P213
+ TAG: NTP_4_2_7P213
+
+ ChangeLog@1.1032.1.2 +1 -0
+ NTP_4_2_7P213
+
+ ntpd/ntpd-opts.c@1.218 +3 -3
+ NTP_4_2_7P213
+
+ ntpd/ntpd-opts.h@1.218 +3 -3
+ NTP_4_2_7P213
+
+ ntpd/ntpd-opts.texi@1.216 +2 -2
+ NTP_4_2_7P213
+
+ ntpd/ntpd.1ntpdman@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpd/ntpd.1ntpdmdoc@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpd/ntpd.man.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpd/ntpd.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc-opts.c@1.213 +3 -3
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc-opts.h@1.213 +3 -3
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc-opts.texi@1.213 +2 -2
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc.1ntpdcman@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc.html@1.41 +2 -2
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc.man.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpdc/ntpdc.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpq/ntpq-opts.c@1.215 +3 -3
+ NTP_4_2_7P213
+
+ ntpq/ntpq-opts.h@1.215 +3 -3
+ NTP_4_2_7P213
+
+ ntpq/ntpq-opts.texi@1.215 +2 -2
+ NTP_4_2_7P213
+
+ ntpq/ntpq.1ntpqman@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpq/ntpq.1ntpqmdoc@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpq/ntpq.man.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpq/ntpq.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.215 +3 -3
+ NTP_4_2_7P213
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.215 +3 -3
+ NTP_4_2_7P213
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.215 +2 -2
+ NTP_4_2_7P213
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpsnmpd/ntpsnmpd.man.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ packageinfo.sh@1.216 +1 -1
+ NTP_4_2_7P213
+
+ scripts/ntp-wait-opts.texi@1.33 +1 -1
+ NTP_4_2_7P213
+
+ scripts/ntp-wait.1ntp-waitman@1.29 +2 -2
+ NTP_4_2_7P213
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.29 +2 -2
+ NTP_4_2_7P213
+
+ scripts/ntp-wait.html@1.33 +1 -1
+ NTP_4_2_7P213
+
+ scripts/ntp-wait.man.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ scripts/ntp-wait.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ sntp/sntp-opts.c@1.211 +3 -3
+ NTP_4_2_7P213
+
+ sntp/sntp-opts.h@1.211 +3 -3
+ NTP_4_2_7P213
+
+ sntp/sntp-opts.texi@1.211 +2 -2
+ NTP_4_2_7P213
+
+ sntp/sntp.1sntpman@1.31 +2 -2
+ NTP_4_2_7P213
+
+ sntp/sntp.1sntpmdoc@1.31 +2 -2
+ NTP_4_2_7P213
+
+ sntp/sntp.html@1.211 +2 -2
+ NTP_4_2_7P213
+
+ sntp/sntp.man.in@1.31 +2 -2
+ NTP_4_2_7P213
+
+ sntp/sntp.mdoc.in@1.31 +2 -2
+ NTP_4_2_7P213
+
+ util/ntp-keygen-opts.c@1.213 +3 -3
+ NTP_4_2_7P213
+
+ util/ntp-keygen-opts.h@1.213 +3 -3
+ NTP_4_2_7P213
+
+ util/ntp-keygen-opts.texi@1.216 +2 -2
+ NTP_4_2_7P213
+
+ util/ntp-keygen.1ntp-keygenman@1.29 +2 -2
+ NTP_4_2_7P213
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.29 +2 -2
+ NTP_4_2_7P213
+
+ util/ntp-keygen.man.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ util/ntp-keygen.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P213
+
+ChangeSet@1.2673.1.1, 2011-09-07 20:08:08+02:00, jnperlin@hydra.localnet
+ [Bug 1999] NMEA driver should not send PMOTG once per second
+
+ ChangeLog@1.1032.1.1 +1 -0
+ [Bug 1999] NMEA driver should not send PMOTG once per second
+
+ ntpd/refclock_nmea.c@1.62 +27 -7
+ [Bug 1999] NMEA driver should not send PMOTG once per second. NMEA ouput support disabled by preprocessor conditionals.
+
+ChangeSet@1.2674, 2011-09-07 19:25:23+02:00, jnperlin@hydra.localnet
+ [Bug 1995] added support for getting build time stamp
+
+ ChangeLog@1.1033 +2 -0
+ [Bug 1995] compile time stamp support for 'step_systime()'
+
+ include/ntp_calendar.h@1.10 +18 -0
+ [Bug 1995] added support for getting build time stamp
+
+ libntp/ntp_calendar.c@1.7 +169 -41
+ [Bug 1995] added support for getting build time stamp; refactoring of some code pathes
+
+ libntp/systime.c@1.56 +105 -62
+ [Bug 1995] added support for NTP era unfolding based on build time stamp in 'step_systime()'
+
+ChangeSet@1.2673, 2011-09-07 11:53:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P212
+ TAG: NTP_4_2_7P212
+
+ ChangeLog@1.1032 +1 -0
+ NTP_4_2_7P212
+
+ ntpd/ntpd-opts.c@1.217 +3 -3
+ NTP_4_2_7P212
+
+ ntpd/ntpd-opts.h@1.217 +3 -3
+ NTP_4_2_7P212
+
+ ntpd/ntpd-opts.texi@1.215 +2 -2
+ NTP_4_2_7P212
+
+ ntpd/ntpd.1ntpdman@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpd/ntpd.1ntpdmdoc@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpd/ntpd.man.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpd/ntpd.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc-opts.c@1.212 +3 -3
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc-opts.h@1.212 +3 -3
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc-opts.texi@1.212 +2 -2
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc.1ntpdcman@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc.html@1.40 +2 -2
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc.man.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpdc/ntpdc.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpq/ntpq-opts.c@1.214 +3 -3
+ NTP_4_2_7P212
+
+ ntpq/ntpq-opts.h@1.214 +3 -3
+ NTP_4_2_7P212
+
+ ntpq/ntpq-opts.texi@1.214 +2 -2
+ NTP_4_2_7P212
+
+ ntpq/ntpq.1ntpqman@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpq/ntpq.1ntpqmdoc@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpq/ntpq.man.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpq/ntpq.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.214 +3 -3
+ NTP_4_2_7P212
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.214 +3 -3
+ NTP_4_2_7P212
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.214 +2 -2
+ NTP_4_2_7P212
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpsnmpd/ntpsnmpd.man.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ packageinfo.sh@1.215 +1 -1
+ NTP_4_2_7P212
+
+ scripts/ntp-wait-opts.texi@1.32 +1 -1
+ NTP_4_2_7P212
+
+ scripts/ntp-wait.1ntp-waitman@1.28 +2 -2
+ NTP_4_2_7P212
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.28 +2 -2
+ NTP_4_2_7P212
+
+ scripts/ntp-wait.html@1.32 +1 -1
+ NTP_4_2_7P212
+
+ scripts/ntp-wait.man.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ scripts/ntp-wait.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ sntp/sntp-opts.c@1.210 +3 -3
+ NTP_4_2_7P212
+
+ sntp/sntp-opts.h@1.210 +3 -3
+ NTP_4_2_7P212
+
+ sntp/sntp-opts.texi@1.210 +2 -2
+ NTP_4_2_7P212
+
+ sntp/sntp.1sntpman@1.30 +2 -2
+ NTP_4_2_7P212
+
+ sntp/sntp.1sntpmdoc@1.30 +2 -2
+ NTP_4_2_7P212
+
+ sntp/sntp.html@1.210 +2 -2
+ NTP_4_2_7P212
+
+ sntp/sntp.man.in@1.30 +2 -2
+ NTP_4_2_7P212
+
+ sntp/sntp.mdoc.in@1.30 +2 -2
+ NTP_4_2_7P212
+
+ util/ntp-keygen-opts.c@1.212 +3 -3
+ NTP_4_2_7P212
+
+ util/ntp-keygen-opts.h@1.212 +3 -3
+ NTP_4_2_7P212
+
+ util/ntp-keygen-opts.texi@1.215 +2 -2
+ NTP_4_2_7P212
+
+ util/ntp-keygen.1ntp-keygenman@1.28 +2 -2
+ NTP_4_2_7P212
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.28 +2 -2
+ NTP_4_2_7P212
+
+ util/ntp-keygen.man.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ util/ntp-keygen.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P212
+
+ChangeSet@1.2082.4.235, 2011-09-07 04:29:25+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2003] libntpq ntpq_read_assoc_peervars() broken.
+
+ ChangeLog@1.496.26.168 +1 -0
+ [Bug 2003] libntpq ntpq_read_assoc_peervars() broken.
+
+ ntpq/libntpq.c@1.3.1.6 +56 -66
+ [Bug 2003] libntpq ntpq_read_assoc_peervars() broken.
+
+ ntpq/libntpq.h@1.3.1.4 +1 -1
+ [Bug 2003] libntpq ntpq_read_assoc_peervars() broken.
+
+ChangeSet@1.2671, 2011-09-01 11:04:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P211
+ TAG: NTP_4_2_7P211
+
+ ChangeLog@1.1030 +1 -0
+ NTP_4_2_7P211
+
+ ntpd/ntpd-opts.c@1.216 +3 -3
+ NTP_4_2_7P211
+
+ ntpd/ntpd-opts.h@1.216 +3 -3
+ NTP_4_2_7P211
+
+ ntpd/ntpd-opts.texi@1.214 +2 -2
+ NTP_4_2_7P211
+
+ ntpd/ntpd.1ntpdman@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpd/ntpd.1ntpdmdoc@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpd/ntpd.man.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpd/ntpd.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc-opts.c@1.211 +3 -3
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc-opts.h@1.211 +3 -3
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc-opts.texi@1.211 +2 -2
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc.1ntpdcman@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc.html@1.39 +2 -2
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc.man.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpdc/ntpdc.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpq/ntpq-opts.c@1.213 +3 -3
+ NTP_4_2_7P211
+
+ ntpq/ntpq-opts.h@1.213 +3 -3
+ NTP_4_2_7P211
+
+ ntpq/ntpq-opts.texi@1.213 +2 -2
+ NTP_4_2_7P211
+
+ ntpq/ntpq.1ntpqman@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpq/ntpq.1ntpqmdoc@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpq/ntpq.man.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpq/ntpq.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.213 +3 -3
+ NTP_4_2_7P211
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.213 +3 -3
+ NTP_4_2_7P211
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.213 +2 -2
+ NTP_4_2_7P211
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpsnmpd/ntpsnmpd.man.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ packageinfo.sh@1.214 +1 -1
+ NTP_4_2_7P211
+
+ scripts/ntp-wait-opts.texi@1.31 +1 -1
+ NTP_4_2_7P211
+
+ scripts/ntp-wait.1ntp-waitman@1.27 +2 -2
+ NTP_4_2_7P211
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.27 +2 -2
+ NTP_4_2_7P211
+
+ scripts/ntp-wait.html@1.31 +1 -1
+ NTP_4_2_7P211
+
+ scripts/ntp-wait.man.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ scripts/ntp-wait.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ sntp/sntp-opts.c@1.209 +3 -3
+ NTP_4_2_7P211
+
+ sntp/sntp-opts.h@1.209 +3 -3
+ NTP_4_2_7P211
+
+ sntp/sntp-opts.texi@1.209 +2 -2
+ NTP_4_2_7P211
+
+ sntp/sntp.1sntpman@1.29 +2 -2
+ NTP_4_2_7P211
+
+ sntp/sntp.1sntpmdoc@1.29 +2 -2
+ NTP_4_2_7P211
+
+ sntp/sntp.html@1.209 +2 -2
+ NTP_4_2_7P211
+
+ sntp/sntp.man.in@1.29 +2 -2
+ NTP_4_2_7P211
+
+ sntp/sntp.mdoc.in@1.29 +2 -2
+ NTP_4_2_7P211
+
+ util/ntp-keygen-opts.c@1.211 +3 -3
+ NTP_4_2_7P211
+
+ util/ntp-keygen-opts.h@1.211 +3 -3
+ NTP_4_2_7P211
+
+ util/ntp-keygen-opts.texi@1.214 +2 -2
+ NTP_4_2_7P211
+
+ util/ntp-keygen.1ntp-keygenman@1.27 +2 -2
+ NTP_4_2_7P211
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.27 +2 -2
+ NTP_4_2_7P211
+
+ util/ntp-keygen.man.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ util/ntp-keygen.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P211
+
+ChangeSet@1.2461.1.9, 2011-08-31 17:07:44+00:00, davehart@shiny.ad.hartbrothers.com
+ make libevent/test/*.sh scripts executable
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.2 +0 -0
+ Change mode to -rwxrwxr-x
+
+ sntp/libevent/test/test-ratelim.sh@1.2 +0 -0
+ Change mode to -rwxrwxr-x
+
+ChangeSet@1.2669, 2011-08-31 16:46:40+00:00, davehart@shiny.ad.hartbrothers.com
+ Update libevent to git head (2.1 branch) as of 2.0.14-stable.
+
+ Applies to prior merge cset.
+
+ ChangeLog@1.1029 +1 -0
+ Update libevent to git head (2.1 branch) as of 2.0.14-stable.
+
+ChangeSet@1.2667, 2011-08-31 16:37:06+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove now-unsupported vc6 and vs2003 subdirs of ports/winnt.
+
+ BitKeeper/deleted/04/ntpkeygen.vcproj~7e53b51bab97a85@1.7 +0 -0
+ Delete: ports/winnt/vs2003/ntpkeygen.vcproj
+
+ BitKeeper/deleted/11/libntp.vcproj~ae0be90114fde0a7@1.23 +0 -0
+ Delete: ports/winnt/vs2003/libntp.vcproj
+
+ BitKeeper/deleted/42/ntpdc.vcproj~531302457eef61a9@1.7 +0 -0
+ Delete: ports/winnt/vs2003/ntpdc.vcproj
+
+ BitKeeper/deleted/43/ntpdc.dsp~29080509@1.31 +0 -0
+ Delete: ports/winnt/vc6/ntpdc.dsp
+
+ BitKeeper/deleted/4a/ntp.sln~b86a8294928e984c@1.3 +0 -0
+ Delete: ports/winnt/vs2003/ntp.sln
+
+ BitKeeper/deleted/67/ntpq.dsp~29080509@1.32 +0 -0
+ Delete: ports/winnt/vc6/ntpq.dsp
+
+ BitKeeper/deleted/69/ntp.dsw~29080509@1.14 +0 -0
+ Delete: ports/winnt/vc6/ntp.dsw
+
+ BitKeeper/deleted/9a/ntpdate.dsp~29080509@1.26 +0 -0
+ Delete: ports/winnt/vc6/ntpdate.dsp
+
+ BitKeeper/deleted/a2/ntpdate.vcproj~208e4d43d00e01e7@1.5 +0 -0
+ Delete: ports/winnt/vs2003/ntpdate.vcproj
+
+ BitKeeper/deleted/ad/Instsrv.vcproj~aa43ae49bdb6d4d6@1.2 +0 -0
+ Delete: ports/winnt/vs2003/Instsrv.vcproj
+
+ BitKeeper/deleted/ae/libntp.dsp~29080509@1.64 +0 -0
+ Delete: ports/winnt/vc6/libntp.dsp
+
+ BitKeeper/deleted/b0/Instsrv.dsp~29080509@1.13 +0 -0
+ Delete: ports/winnt/vc6/Instsrv.dsp
+
+ BitKeeper/deleted/c9/ntpd.vcproj~c453035eff854e7c@1.15 +0 -0
+ Delete: ports/winnt/vs2003/ntpd.vcproj
+
+ BitKeeper/deleted/db/ntpkeygen.dsp~d24bb34d@1.24 +0 -0
+ Delete: ports/winnt/vc6/ntpkeygen.dsp
+
+ BitKeeper/deleted/e2/ntpq.vcproj~dbbd02e21a47962f@1.7 +0 -0
+ Delete: ports/winnt/vs2003/ntpq.vcproj
+
+ BitKeeper/deleted/f7/ntpd.dsp~29080509@1.54 +0 -0
+ Delete: ports/winnt/vc6/ntpd.dsp
+
+ChangeSet@1.2461.1.8, 2011-08-31 16:12:20+00:00, davehart@shiny.ad.hartbrothers.com
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/ChangeLog@1.5 +25 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/Makefile.am@1.1.1.5 +1 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/buffer.c@1.6 +12 -6
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/buffer_iocp.c@1.4 +3 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/bufferevent-internal.h@1.4 +4 -1
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/bufferevent.c@1.4 +15 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/bufferevent_async.c@1.4 +41 -15
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/bufferevent_filter.c@1.4 +1 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/bufferevent_openssl.c@1.5 +5 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/bufferevent_ratelim.c@1.3 +33 -2
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/bufferevent_sock.c@1.4 +4 -2
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/configure.in@1.1.1.4 +18 -16
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/defer-internal.h@1.3 +4 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/evbuffer-internal.h@1.4 +2 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/evdns.c@1.1.1.4 +2 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/event-internal.h@1.1.1.4 +10 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/event.c@1.1.1.5 +234 -100
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/evrpc.c@1.4 +16 -5
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/evutil.c@1.1.1.4 +1 -1
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/evutil_rand.c@1.4 +12 -4
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/http.c@1.1.1.5 +1 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/include/event2/dns.h@1.4 +1 -1
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/include/event2/event.h@1.1.1.4 +32 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/include/event2/event_compat.h@1.3 +2 -2
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/kqueue.c@1.5 +7 -9
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/m4/libevent_openssl.m4@1.1 +47 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/m4/libevent_openssl.m4@1.0 +0 -0
+
+ sntp/libevent/m4/ntp_pkg_config.m4@1.1 +27 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/m4/ntp_pkg_config.m4@1.0 +0 -0
+
+ sntp/libevent/minheap-internal.h@1.3 +34 -6
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/sample/Makefile.am@1.1.1.4 +1 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/sample/dns-example.c@1.1.1.3 +4 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/sample/http-server.c@1.1.1.4 +4 -1
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/signal.c@1.5 +3 -1
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/test/Makefile.am@1.1.1.4 +10 -5
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/test/bench_http.c@1.3 +16 -3
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.1 +41 -0
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.0 +0 -0
+
+ sntp/libevent/test/test-ratelim.c@1.1.1.3 +18 -1
+ Update to libevent master (to be 2.1) as of 2.0.14-stable, HEAD git commit
+ 148458e0a1fd25e167aa2ef229d1c9a70b27c3e9
+
+ChangeSet@1.2666, 2011-08-31 04:15:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P210
+ TAG: NTP_4_2_7P210
+
+ ChangeLog@1.1028 +1 -0
+ NTP_4_2_7P210
+
+ ntpd/ntpd-opts.c@1.215 +3 -3
+ NTP_4_2_7P210
+
+ ntpd/ntpd-opts.h@1.215 +3 -3
+ NTP_4_2_7P210
+
+ ntpd/ntpd-opts.texi@1.213 +2 -2
+ NTP_4_2_7P210
+
+ ntpd/ntpd.1ntpdman@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpd/ntpd.1ntpdmdoc@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpd/ntpd.man.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpd/ntpd.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc-opts.c@1.210 +3 -3
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc-opts.h@1.210 +3 -3
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc-opts.texi@1.210 +2 -2
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc.1ntpdcman@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc.html@1.38 +2 -2
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc.man.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpdc/ntpdc.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpq/ntpq-opts.c@1.212 +3 -3
+ NTP_4_2_7P210
+
+ ntpq/ntpq-opts.h@1.212 +3 -3
+ NTP_4_2_7P210
+
+ ntpq/ntpq-opts.texi@1.212 +2 -2
+ NTP_4_2_7P210
+
+ ntpq/ntpq.1ntpqman@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpq/ntpq.1ntpqmdoc@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpq/ntpq.man.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpq/ntpq.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.212 +3 -3
+ NTP_4_2_7P210
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.212 +3 -3
+ NTP_4_2_7P210
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.212 +2 -2
+ NTP_4_2_7P210
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpsnmpd/ntpsnmpd.man.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ packageinfo.sh@1.213 +1 -1
+ NTP_4_2_7P210
+
+ scripts/ntp-wait-opts.texi@1.30 +1 -1
+ NTP_4_2_7P210
+
+ scripts/ntp-wait.1ntp-waitman@1.26 +2 -2
+ NTP_4_2_7P210
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.26 +2 -2
+ NTP_4_2_7P210
+
+ scripts/ntp-wait.html@1.30 +1 -1
+ NTP_4_2_7P210
+
+ scripts/ntp-wait.man.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ scripts/ntp-wait.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ sntp/sntp-opts.c@1.208 +3 -3
+ NTP_4_2_7P210
+
+ sntp/sntp-opts.h@1.208 +3 -3
+ NTP_4_2_7P210
+
+ sntp/sntp-opts.texi@1.208 +2 -2
+ NTP_4_2_7P210
+
+ sntp/sntp.1sntpman@1.28 +2 -2
+ NTP_4_2_7P210
+
+ sntp/sntp.1sntpmdoc@1.28 +2 -2
+ NTP_4_2_7P210
+
+ sntp/sntp.html@1.208 +2 -2
+ NTP_4_2_7P210
+
+ sntp/sntp.man.in@1.28 +2 -2
+ NTP_4_2_7P210
+
+ sntp/sntp.mdoc.in@1.28 +2 -2
+ NTP_4_2_7P210
+
+ util/ntp-keygen-opts.c@1.210 +3 -3
+ NTP_4_2_7P210
+
+ util/ntp-keygen-opts.h@1.210 +3 -3
+ NTP_4_2_7P210
+
+ util/ntp-keygen-opts.texi@1.213 +2 -2
+ NTP_4_2_7P210
+
+ util/ntp-keygen.1ntp-keygenman@1.26 +2 -2
+ NTP_4_2_7P210
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.26 +2 -2
+ NTP_4_2_7P210
+
+ util/ntp-keygen.man.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ util/ntp-keygen.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P210
+
+ChangeSet@1.2665, 2011-08-30 09:01:00+00:00, davehart@shiny.ad.hartbrothers.com
+ Require -D4 or higher for ntpd SIGALRM debug trace from [Bug 2000].
+
+ ChangeLog@1.1027 +1 -0
+ Require -D4 or higher for ntpd SIGALRM debug trace from [Bug 2000].
+
+ ntpd/ntp_timer.c@1.65 +10 -10
+ Require -D4 or higher for ntpd SIGALRM debug trace from [Bug 2000].
+
+ChangeSet@1.2664, 2011-08-27 10:47:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P209
+ TAG: NTP_4_2_7P209
+
+ ChangeLog@1.1026 +1 -0
+ NTP_4_2_7P209
+
+ ntpd/ntpd-opts.c@1.214 +3 -3
+ NTP_4_2_7P209
+
+ ntpd/ntpd-opts.h@1.214 +3 -3
+ NTP_4_2_7P209
+
+ ntpd/ntpd-opts.texi@1.212 +2 -2
+ NTP_4_2_7P209
+
+ ntpd/ntpd.1ntpdman@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpd/ntpd.1ntpdmdoc@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpd/ntpd.man.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpd/ntpd.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc-opts.c@1.209 +3 -3
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc-opts.h@1.209 +3 -3
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc-opts.texi@1.209 +2 -2
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc.1ntpdcman@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc.html@1.37 +2 -2
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc.man.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpdc/ntpdc.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpq/ntpq-opts.c@1.211 +3 -3
+ NTP_4_2_7P209
+
+ ntpq/ntpq-opts.h@1.211 +3 -3
+ NTP_4_2_7P209
+
+ ntpq/ntpq-opts.texi@1.211 +2 -2
+ NTP_4_2_7P209
+
+ ntpq/ntpq.1ntpqman@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpq/ntpq.1ntpqmdoc@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpq/ntpq.man.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpq/ntpq.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.211 +3 -3
+ NTP_4_2_7P209
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.211 +3 -3
+ NTP_4_2_7P209
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.211 +2 -2
+ NTP_4_2_7P209
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpsnmpd/ntpsnmpd.man.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ packageinfo.sh@1.212 +1 -1
+ NTP_4_2_7P209
+
+ scripts/ntp-wait-opts.texi@1.29 +1 -1
+ NTP_4_2_7P209
+
+ scripts/ntp-wait.1ntp-waitman@1.25 +2 -2
+ NTP_4_2_7P209
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.25 +2 -2
+ NTP_4_2_7P209
+
+ scripts/ntp-wait.html@1.29 +1 -1
+ NTP_4_2_7P209
+
+ scripts/ntp-wait.man.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ scripts/ntp-wait.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ sntp/sntp-opts.c@1.207 +3 -3
+ NTP_4_2_7P209
+
+ sntp/sntp-opts.h@1.207 +3 -3
+ NTP_4_2_7P209
+
+ sntp/sntp-opts.texi@1.207 +2 -2
+ NTP_4_2_7P209
+
+ sntp/sntp.1sntpman@1.27 +2 -2
+ NTP_4_2_7P209
+
+ sntp/sntp.1sntpmdoc@1.27 +2 -2
+ NTP_4_2_7P209
+
+ sntp/sntp.html@1.207 +2 -2
+ NTP_4_2_7P209
+
+ sntp/sntp.man.in@1.27 +2 -2
+ NTP_4_2_7P209
+
+ sntp/sntp.mdoc.in@1.27 +2 -2
+ NTP_4_2_7P209
+
+ util/ntp-keygen-opts.c@1.209 +3 -3
+ NTP_4_2_7P209
+
+ util/ntp-keygen-opts.h@1.209 +3 -3
+ NTP_4_2_7P209
+
+ util/ntp-keygen-opts.texi@1.212 +2 -2
+ NTP_4_2_7P209
+
+ util/ntp-keygen.1ntp-keygenman@1.25 +2 -2
+ NTP_4_2_7P209
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.25 +2 -2
+ NTP_4_2_7P209
+
+ util/ntp-keygen.man.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ util/ntp-keygen.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P209
+
+ChangeSet@1.2663, 2011-08-27 03:38:01-04:00, stenn@deacon.udel.edu
+ Use pre-calculated values for the sntp synch distance checks
+
+ sntp/tests/packetHandling.cpp@1.9 +5 -7
+ Use pre-calculated values for the sntp synch distance checks
+
+ChangeSet@1.2662, 2011-08-27 03:18:26-04:00, stenn@deacon.udel.edu
+ Update sntp test to use synch distance instead of root dispersion
+
+ ChangeLog@1.1025 +2 -0
+ Update sntp test to use synch distance instead of root dispersion
+
+ sntp/tests/packetHandling.cpp@1.8 +10 -6
+ Update sntp test to use synch distance instead of root dispersion
+
+ChangeSet@1.2661, 2011-08-27 07:07:45+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix copy/paste error (SIGIO -> SIGPOLL)
+
+ libntp/work_thread.c@1.11 +3 -3
+ Fix copy/paste error (SIGIO -> SIGPOLL)
+
+ChangeSet@1.2660, 2011-08-27 02:33:48-04:00, stenn@deacon.udel.edu
+ cleanup
+
+ ChangeLog@1.1024 +2 -0
+ cleanup
+
+ChangeSet@1.2659, 2011-08-27 05:24:07+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2000] ntpd worker threads must block signals expected in main thread.
+
+ ChangeLog@1.1023 +2 -0
+ [Bug 2000] ntpd worker threads must block signals expected in main thread.
+
+ include/ntpd.h@1.167 +14 -0
+ Expose signal number macros previously private to ntpd.c for use by work_thread.c.
+
+ libntp/syssignal.c@1.14 +1 -1
+ tiny tweak
+
+ libntp/work_thread.c@1.10 +57 -0
+ [Bug 2000] ntpd worker threads must block signals expected in main thread.
+
+ ntpd/ntp_timer.c@1.64 +116 -81
+ Check for failures setting interval timer, use more common code in
+ setitimer()/timer_settime() paths.
+
+ ntpd/ntpd.c@1.127 +44 -47
+ [Bug 2000] ntpd worker threads must block signals expected in main thread.
+
+ChangeSet@1.2658, 2011-08-27 04:19:04+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2001] add ntpq -c timerstats like ntpdc -c timerstats.
+
+ ChangeLog@1.1022 +1 -0
+ [Bug 2001] add ntpq -c timerstats like ntpdc -c timerstats.
+
+ ntpd/ntp_control.c@1.170 +21 -2
+ [Bug 2001] add ntpq -c timerstats like ntpdc -c timerstats.
+
+ ntpq/ntpq-subs.c@1.88 +25 -1
+ [Bug 2001] add ntpq -c timerstats like ntpdc -c timerstats.
+
+ChangeSet@1.2082.4.234, 2011-08-27 03:34:10+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 2001] ntpdc timerstats reports overruns as handled.
+
+ ChangeLog@1.496.26.167 +1 -0
+ [Bug 2001] ntpdc timerstats reports overruns as handled.
+
+ ntpd/ntp_request.c@1.82.1.5 +11 -16
+ [Bug 2001] ntpdc timerstats reports overruns as handled.
+
+ChangeSet@1.2656, 2011-08-24 09:02:39+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P208
+ TAG: NTP_4_2_7P208
+
+ ChangeLog@1.1020 +1 -0
+ NTP_4_2_7P208
+
+ ntpd/ntpd-opts.c@1.213 +3 -3
+ NTP_4_2_7P208
+
+ ntpd/ntpd-opts.h@1.213 +3 -3
+ NTP_4_2_7P208
+
+ ntpd/ntpd-opts.texi@1.211 +2 -2
+ NTP_4_2_7P208
+
+ ntpd/ntpd.1ntpdman@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpd/ntpd.1ntpdmdoc@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpd/ntpd.man.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpd/ntpd.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc-opts.c@1.208 +3 -3
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc-opts.h@1.208 +3 -3
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc-opts.texi@1.208 +2 -2
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc.1ntpdcman@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc.html@1.36 +2 -2
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc.man.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpdc/ntpdc.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpq/ntpq-opts.c@1.210 +3 -3
+ NTP_4_2_7P208
+
+ ntpq/ntpq-opts.h@1.210 +3 -3
+ NTP_4_2_7P208
+
+ ntpq/ntpq-opts.texi@1.210 +2 -2
+ NTP_4_2_7P208
+
+ ntpq/ntpq.1ntpqman@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpq/ntpq.1ntpqmdoc@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpq/ntpq.man.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpq/ntpq.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.210 +3 -3
+ NTP_4_2_7P208
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.210 +3 -3
+ NTP_4_2_7P208
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.210 +2 -2
+ NTP_4_2_7P208
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpsnmpd/ntpsnmpd.man.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ packageinfo.sh@1.211 +1 -1
+ NTP_4_2_7P208
+
+ scripts/ntp-wait-opts.texi@1.28 +1 -1
+ NTP_4_2_7P208
+
+ scripts/ntp-wait.1ntp-waitman@1.24 +2 -2
+ NTP_4_2_7P208
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.24 +2 -2
+ NTP_4_2_7P208
+
+ scripts/ntp-wait.html@1.28 +1 -1
+ NTP_4_2_7P208
+
+ scripts/ntp-wait.man.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ scripts/ntp-wait.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ sntp/sntp-opts.c@1.206 +3 -3
+ NTP_4_2_7P208
+
+ sntp/sntp-opts.h@1.206 +3 -3
+ NTP_4_2_7P208
+
+ sntp/sntp-opts.texi@1.206 +2 -2
+ NTP_4_2_7P208
+
+ sntp/sntp.1sntpman@1.26 +2 -2
+ NTP_4_2_7P208
+
+ sntp/sntp.1sntpmdoc@1.26 +2 -2
+ NTP_4_2_7P208
+
+ sntp/sntp.html@1.206 +2 -2
+ NTP_4_2_7P208
+
+ sntp/sntp.man.in@1.26 +2 -2
+ NTP_4_2_7P208
+
+ sntp/sntp.mdoc.in@1.26 +2 -2
+ NTP_4_2_7P208
+
+ util/ntp-keygen-opts.c@1.208 +3 -3
+ NTP_4_2_7P208
+
+ util/ntp-keygen-opts.h@1.208 +3 -3
+ NTP_4_2_7P208
+
+ util/ntp-keygen-opts.texi@1.211 +2 -2
+ NTP_4_2_7P208
+
+ util/ntp-keygen.1ntp-keygenman@1.24 +2 -2
+ NTP_4_2_7P208
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.24 +2 -2
+ NTP_4_2_7P208
+
+ util/ntp-keygen.man.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ util/ntp-keygen.mdoc.in@1.24 +2 -2
+ NTP_4_2_7P208
+
+ChangeSet@1.2655, 2011-08-24 03:50:28-04:00, stenn@deacon.udel.edu
+ Fix the CLOCK_MONOTONIC TRACE() message
+
+ ChangeLog@1.1019 +1 -0
+ Fix the CLOCK_MONOTONIC TRACE() message
+
+ sntp/main.c@1.79 +2 -1
+ Fix the CLOCK_MONOTONIC TRACE() message
+
+ChangeSet@1.2654, 2011-08-22 05:13:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P207
+ TAG: NTP_4_2_7P207
+
+ ChangeLog@1.1018 +1 -0
+ NTP_4_2_7P207
+
+ ntpd/ntpd-opts.c@1.212 +3 -3
+ NTP_4_2_7P207
+
+ ntpd/ntpd-opts.h@1.212 +3 -3
+ NTP_4_2_7P207
+
+ ntpd/ntpd-opts.texi@1.210 +2 -2
+ NTP_4_2_7P207
+
+ ntpd/ntpd.1ntpdman@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpd/ntpd.1ntpdmdoc@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpd/ntpd.man.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpd/ntpd.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc-opts.c@1.207 +3 -3
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc-opts.h@1.207 +3 -3
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc-opts.texi@1.207 +2 -2
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc.1ntpdcman@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc.html@1.35 +2 -2
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc.man.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpdc/ntpdc.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpq/ntpq-opts.c@1.209 +3 -3
+ NTP_4_2_7P207
+
+ ntpq/ntpq-opts.h@1.209 +3 -3
+ NTP_4_2_7P207
+
+ ntpq/ntpq-opts.texi@1.209 +2 -2
+ NTP_4_2_7P207
+
+ ntpq/ntpq.1ntpqman@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpq/ntpq.1ntpqmdoc@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpq/ntpq.man.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpq/ntpq.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.209 +3 -3
+ NTP_4_2_7P207
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.209 +3 -3
+ NTP_4_2_7P207
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.209 +2 -2
+ NTP_4_2_7P207
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpsnmpd/ntpsnmpd.man.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ packageinfo.sh@1.210 +1 -1
+ NTP_4_2_7P207
+
+ scripts/ntp-wait-opts.texi@1.27 +1 -1
+ NTP_4_2_7P207
+
+ scripts/ntp-wait.1ntp-waitman@1.23 +8 -7
+ NTP_4_2_7P207
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.23 +7 -6
+ NTP_4_2_7P207
+
+ scripts/ntp-wait.html@1.27 +1 -1
+ NTP_4_2_7P207
+
+ scripts/ntp-wait.man.in@1.23 +8 -7
+ NTP_4_2_7P207
+
+ scripts/ntp-wait.mdoc.in@1.23 +7 -6
+ NTP_4_2_7P207
+
+ sntp/sntp-opts.c@1.205 +3 -3
+ NTP_4_2_7P207
+
+ sntp/sntp-opts.h@1.205 +3 -3
+ NTP_4_2_7P207
+
+ sntp/sntp-opts.texi@1.205 +2 -2
+ NTP_4_2_7P207
+
+ sntp/sntp.1sntpman@1.25 +2 -2
+ NTP_4_2_7P207
+
+ sntp/sntp.1sntpmdoc@1.25 +2 -2
+ NTP_4_2_7P207
+
+ sntp/sntp.html@1.205 +2 -2
+ NTP_4_2_7P207
+
+ sntp/sntp.man.in@1.25 +2 -2
+ NTP_4_2_7P207
+
+ sntp/sntp.mdoc.in@1.25 +2 -2
+ NTP_4_2_7P207
+
+ util/ntp-keygen-opts.c@1.207 +3 -3
+ NTP_4_2_7P207
+
+ util/ntp-keygen-opts.h@1.207 +3 -3
+ NTP_4_2_7P207
+
+ util/ntp-keygen-opts.texi@1.210 +2 -2
+ NTP_4_2_7P207
+
+ util/ntp-keygen.1ntp-keygenman@1.23 +2 -2
+ NTP_4_2_7P207
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.23 +2 -2
+ NTP_4_2_7P207
+
+ util/ntp-keygen.man.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ util/ntp-keygen.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P207
+
+ChangeSet@1.2653, 2011-08-22 02:58:47+00:00, stenn@psp-fb2.ntp.org
+ Cleanups for ntp-wait-opts.def
+
+ scripts/ntp-wait-opts.def@1.4 +1 -1
+ Cleanups for ntp-wait-opts.def
+
+ChangeSet@1.2652, 2011-08-21 23:45:28+00:00, stenn@psp-fb2.ntp.org
+ cleanup ntp.keys.def
+
+ ntpd/ntp.keys.def@1.5 +5 -1
+ cleanup ntp.keys.def
+
+ChangeSet@1.2651, 2011-08-21 09:13:07+00:00, stenn@psp-fb2.ntp.org
+ ntp.keys.def cleanup
+
+ ntpd/ntp.keys.def@1.4 +2 -2
+ ntp.keys.def cleanup
+
+ChangeSet@1.2650, 2011-08-21 01:24:12-04:00, stenn@deacon.udel.edu
+ Restore the original CLOCK_MONOTONIC output format in sntp
+
+ ChangeLog@1.1017 +1 -0
+ Restore the original CLOCK_MONOTONIC output format in sntp
+
+ sntp/main.c@1.78 +2 -1
+ Restore the original CLOCK_MONOTONIC output format in sntp
+
+ChangeSet@1.2649, 2011-08-21 05:04:33+00:00, stenn@psp-fb2.ntp.org
+ Cleanups for ntp-wait-opts.def and ntp.keys.def
+
+ ChangeLog@1.1016 +1 -0
+ Cleanups for ntp-wait-opts.def and ntp.keys.def
+
+ ntpd/ntp.keys.def@1.3 +11 -8
+ Cleanups for ntp-wait-opts.def and ntp.keys.def
+
+ scripts/ntp-wait-opts.def@1.3 +6 -5
+ Cleanups for ntp-wait-opts.def and ntp.keys.def
+
+ChangeSet@1.2648, 2011-08-20 06:04:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P206
+ TAG: NTP_4_2_7P206
+
+ ChangeLog@1.1015 +1 -0
+ NTP_4_2_7P206
+
+ ntpd/ntpd-opts.c@1.211 +3 -3
+ NTP_4_2_7P206
+
+ ntpd/ntpd-opts.h@1.211 +3 -3
+ NTP_4_2_7P206
+
+ ntpd/ntpd-opts.texi@1.209 +2 -2
+ NTP_4_2_7P206
+
+ ntpd/ntpd.1ntpdman@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpd/ntpd.1ntpdmdoc@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpd/ntpd.man.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpd/ntpd.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc-opts.c@1.206 +3 -3
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc-opts.h@1.206 +3 -3
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc-opts.texi@1.206 +2 -2
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc.1ntpdcman@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc.html@1.34 +2 -2
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc.man.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpdc/ntpdc.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpq/ntpq-opts.c@1.208 +3 -3
+ NTP_4_2_7P206
+
+ ntpq/ntpq-opts.h@1.208 +3 -3
+ NTP_4_2_7P206
+
+ ntpq/ntpq-opts.texi@1.208 +2 -2
+ NTP_4_2_7P206
+
+ ntpq/ntpq.1ntpqman@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpq/ntpq.1ntpqmdoc@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpq/ntpq.man.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpq/ntpq.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.208 +3 -3
+ NTP_4_2_7P206
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.208 +3 -3
+ NTP_4_2_7P206
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.208 +2 -2
+ NTP_4_2_7P206
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpsnmpd/ntpsnmpd.man.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ packageinfo.sh@1.209 +1 -1
+ NTP_4_2_7P206
+
+ scripts/ntp-wait-opts.texi@1.26 +1 -1
+ NTP_4_2_7P206
+
+ scripts/ntp-wait.1ntp-waitman@1.22 +9 -5
+ NTP_4_2_7P206
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.22 +9 -5
+ NTP_4_2_7P206
+
+ scripts/ntp-wait.html@1.26 +1 -1
+ NTP_4_2_7P206
+
+ scripts/ntp-wait.man.in@1.22 +9 -5
+ NTP_4_2_7P206
+
+ scripts/ntp-wait.mdoc.in@1.22 +9 -5
+ NTP_4_2_7P206
+
+ sntp/sntp-opts.c@1.204 +7 -7
+ NTP_4_2_7P206
+
+ sntp/sntp-opts.h@1.204 +3 -3
+ NTP_4_2_7P206
+
+ sntp/sntp-opts.texi@1.204 +52 -37
+ NTP_4_2_7P206
+
+ sntp/sntp.1sntpman@1.24 +50 -35
+ NTP_4_2_7P206
+
+ sntp/sntp.1sntpmdoc@1.24 +50 -35
+ NTP_4_2_7P206
+
+ sntp/sntp.html@1.204 +49 -37
+ NTP_4_2_7P206
+
+ sntp/sntp.man.in@1.24 +50 -35
+ NTP_4_2_7P206
+
+ sntp/sntp.mdoc.in@1.24 +50 -35
+ NTP_4_2_7P206
+
+ util/ntp-keygen-opts.c@1.206 +3 -3
+ NTP_4_2_7P206
+
+ util/ntp-keygen-opts.h@1.206 +3 -3
+ NTP_4_2_7P206
+
+ util/ntp-keygen-opts.texi@1.209 +2 -2
+ NTP_4_2_7P206
+
+ util/ntp-keygen.1ntp-keygenman@1.22 +2 -2
+ NTP_4_2_7P206
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.22 +2 -2
+ NTP_4_2_7P206
+
+ util/ntp-keygen.man.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ util/ntp-keygen.mdoc.in@1.22 +2 -2
+ NTP_4_2_7P206
+
+ChangeSet@1.2645.1.2, 2011-08-20 02:51:43+00:00, stenn@psp-fb2.ntp.org
+ sntp documentation and behavior improvements suggested by Steven Sommars
+
+ ChangeLog@1.1012.1.3 +2 -0
+ sntp documentation and behavior improvements suggested by Steven Sommars
+
+ sntp/sntp-opts.def@1.38 +72 -42
+ sntp documentation and behavior improvements suggested by Steven Sommars
+
+ChangeSet@1.2645.1.1, 2011-08-20 02:42:48+00:00, stenn@psp-fb2.ntp.org
+ Have sntp report synchronization distance instead of root dispersion
+
+ ChangeLog@1.1012.1.2 +1 -0
+ Have sntp report synchronization distance instead of root dispersion
+
+ ChangeLog@1.1012.1.1 +1 -0
+ Clean up ntp-wait-opts.def
+
+ scripts/ntp-wait-opts.def@1.2 +16 -18
+ Clean up ntp-wait-opts.def
+
+ sntp/main.c@1.77 +9 -10
+ Have sntp report synchronization distance instead of root dispersion
+
+ChangeSet@1.2646, 2011-08-19 16:06:28+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1993] ntpd Windows port adj_systime() broken in 4.2.7p203.
+
+ ChangeLog@1.1013 +1 -0
+ [Bug 1993] ntpd Windows port adj_systime() broken in 4.2.7p203.
+
+ include/ntp_fp.h@1.25 +1 -1
+ Work around DebugBreak() in debug build of Windows port when a cast from
+ 64 to 32 bits changes the value by masking off upper 32 bits explicitly
+ in DTOLFP().
+
+ include/ntp_types.h@1.26 +5 -0
+ Provide UINT32_MAX corresponding to u_int32 type.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.52 +29 -23
+ [Bug 1993] ntpd Windows port adj_systime() broken in 4.2.7p203.
+
+ChangeSet@1.2645, 2011-08-19 07:46:19+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P205
+ TAG: NTP_4_2_7P205
+
+ ChangeLog@1.1012 +1 -0
+ NTP_4_2_7P205
+
+ ntpd/ntpd-opts.c@1.210 +3 -3
+ NTP_4_2_7P205
+
+ ntpd/ntpd-opts.h@1.210 +3 -3
+ NTP_4_2_7P205
+
+ ntpd/ntpd-opts.texi@1.208 +2 -2
+ NTP_4_2_7P205
+
+ ntpd/ntpd.1ntpdman@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpd/ntpd.1ntpdmdoc@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpd/ntpd.man.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpd/ntpd.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc-opts.c@1.205 +3 -3
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc-opts.h@1.205 +3 -3
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc-opts.texi@1.205 +2 -2
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc.1ntpdcman@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc.html@1.33 +2 -2
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc.man.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpdc/ntpdc.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpq/ntpq-opts.c@1.207 +3 -3
+ NTP_4_2_7P205
+
+ ntpq/ntpq-opts.h@1.207 +3 -3
+ NTP_4_2_7P205
+
+ ntpq/ntpq-opts.texi@1.207 +2 -2
+ NTP_4_2_7P205
+
+ ntpq/ntpq.1ntpqman@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpq/ntpq.1ntpqmdoc@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpq/ntpq.man.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpq/ntpq.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.207 +3 -3
+ NTP_4_2_7P205
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.207 +3 -3
+ NTP_4_2_7P205
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.207 +2 -2
+ NTP_4_2_7P205
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpsnmpd/ntpsnmpd.man.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ packageinfo.sh@1.208 +1 -1
+ NTP_4_2_7P205
+
+ scripts/ntp-wait-opts.texi@1.25 +1 -1
+ NTP_4_2_7P205
+
+ scripts/ntp-wait.1ntp-waitman@1.21 +2 -2
+ NTP_4_2_7P205
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.21 +2 -2
+ NTP_4_2_7P205
+
+ scripts/ntp-wait.html@1.25 +1 -1
+ NTP_4_2_7P205
+
+ scripts/ntp-wait.man.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ scripts/ntp-wait.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ sntp/sntp-opts.c@1.203 +3 -3
+ NTP_4_2_7P205
+
+ sntp/sntp-opts.h@1.203 +3 -3
+ NTP_4_2_7P205
+
+ sntp/sntp-opts.texi@1.203 +2 -2
+ NTP_4_2_7P205
+
+ sntp/sntp.1sntpman@1.23 +2 -2
+ NTP_4_2_7P205
+
+ sntp/sntp.1sntpmdoc@1.23 +2 -2
+ NTP_4_2_7P205
+
+ sntp/sntp.html@1.203 +2 -2
+ NTP_4_2_7P205
+
+ sntp/sntp.man.in@1.23 +2 -2
+ NTP_4_2_7P205
+
+ sntp/sntp.mdoc.in@1.23 +2 -2
+ NTP_4_2_7P205
+
+ util/ntp-keygen-opts.c@1.205 +3 -3
+ NTP_4_2_7P205
+
+ util/ntp-keygen-opts.h@1.205 +3 -3
+ NTP_4_2_7P205
+
+ util/ntp-keygen-opts.texi@1.208 +2 -2
+ NTP_4_2_7P205
+
+ util/ntp-keygen.1ntp-keygenman@1.21 +2 -2
+ NTP_4_2_7P205
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.21 +2 -2
+ NTP_4_2_7P205
+
+ util/ntp-keygen.man.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ util/ntp-keygen.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P205
+
+ChangeSet@1.2644, 2011-08-18 02:26:57+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix typo in libevent/test/rpcgen_wrapper.sh spotted by Nick Mathewson.
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.2 +1 -1
+ Fix typo in libevent/test/rpcgen_wrapper.sh spotted by Nick Mathewson.
+
+ChangeSet@1.2643, 2011-08-18 02:25:11+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1992] util/tg2 doesn't compile, needs libntp.
+ Patch supplied by kukabu@gmail.com:
+ http://bugs.ntp.org/attachment.cgi?id=786
+
+ ChangeLog@1.1011 +1 -0
+ [Bug 1992] util/tg2 doesn't compile, needs libntp.
+
+ util/Makefile.am@1.66 +1 -1
+ [Bug 1992] util/tg2 doesn't compile, needs libntp.
+
+ util/tg2.c@1.6 +2 -3
+ [Bug 1992] util/tg2 doesn't compile, needs libntp.
+
+ChangeSet@1.2642, 2011-08-16 11:18:13+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P204
+ TAG: NTP_4_2_7P204
+
+ ChangeLog@1.1010 +1 -0
+ NTP_4_2_7P204
+
+ ntpd/ntpd-opts.c@1.209 +3 -3
+ NTP_4_2_7P204
+
+ ntpd/ntpd-opts.h@1.209 +3 -3
+ NTP_4_2_7P204
+
+ ntpd/ntpd-opts.texi@1.207 +2 -2
+ NTP_4_2_7P204
+
+ ntpd/ntpd.1ntpdman@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpd/ntpd.1ntpdmdoc@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpd/ntpd.man.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpd/ntpd.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc-opts.c@1.204 +3 -3
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc-opts.h@1.204 +3 -3
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc-opts.texi@1.204 +2 -2
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc.1ntpdcman@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc.html@1.32 +2 -2
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc.man.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpdc/ntpdc.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpq/ntpq-opts.c@1.206 +3 -3
+ NTP_4_2_7P204
+
+ ntpq/ntpq-opts.h@1.206 +3 -3
+ NTP_4_2_7P204
+
+ ntpq/ntpq-opts.texi@1.206 +2 -2
+ NTP_4_2_7P204
+
+ ntpq/ntpq.1ntpqman@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpq/ntpq.1ntpqmdoc@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpq/ntpq.man.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpq/ntpq.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.206 +3 -3
+ NTP_4_2_7P204
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.206 +3 -3
+ NTP_4_2_7P204
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.206 +2 -2
+ NTP_4_2_7P204
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpsnmpd/ntpsnmpd.man.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ packageinfo.sh@1.207 +1 -1
+ NTP_4_2_7P204
+
+ scripts/ntp-wait-opts.texi@1.24 +1 -1
+ NTP_4_2_7P204
+
+ scripts/ntp-wait.1ntp-waitman@1.20 +2 -2
+ NTP_4_2_7P204
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.20 +2 -2
+ NTP_4_2_7P204
+
+ scripts/ntp-wait.html@1.24 +1 -1
+ NTP_4_2_7P204
+
+ scripts/ntp-wait.man.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ scripts/ntp-wait.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ sntp/sntp-opts.c@1.202 +3 -3
+ NTP_4_2_7P204
+
+ sntp/sntp-opts.h@1.202 +3 -3
+ NTP_4_2_7P204
+
+ sntp/sntp-opts.texi@1.202 +13 -15
+ NTP_4_2_7P204
+
+ sntp/sntp.1sntpman@1.22 +13 -15
+ NTP_4_2_7P204
+
+ sntp/sntp.1sntpmdoc@1.22 +13 -15
+ NTP_4_2_7P204
+
+ sntp/sntp.html@1.202 +14 -16
+ NTP_4_2_7P204
+
+ sntp/sntp.man.in@1.22 +13 -15
+ NTP_4_2_7P204
+
+ sntp/sntp.mdoc.in@1.22 +13 -15
+ NTP_4_2_7P204
+
+ util/ntp-keygen-opts.c@1.204 +3 -3
+ NTP_4_2_7P204
+
+ util/ntp-keygen-opts.h@1.204 +3 -3
+ NTP_4_2_7P204
+
+ util/ntp-keygen-opts.texi@1.207 +2 -2
+ NTP_4_2_7P204
+
+ util/ntp-keygen.1ntp-keygenman@1.20 +2 -2
+ NTP_4_2_7P204
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.20 +2 -2
+ NTP_4_2_7P204
+
+ util/ntp-keygen.man.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ util/ntp-keygen.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P204
+
+ChangeSet@1.2637.1.3, 2011-08-15 18:24:53-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1989] sntp manual page sometimes refers to SNTP as a program
+
+ ChangeLog@1.1005.1.3 +1 -0
+ [Bug 1989] sntp manual page sometimes refers to SNTP as a program
+
+ sntp/sntp-opts.def@1.37 +12 -14
+ [Bug 1989] sntp manual page sometimes refers to SNTP as a program
+
+ChangeSet@1.2637.1.2, 2011-08-14 23:08:50+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ ChangeLog@1.1005.1.2 +2 -0
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ include/ntp_syslog.h@1.7 +2 -0
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ libntp/msyslog.c@1.47 +21 -6
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ libntp/socktoa.c@1.17 +9 -2
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ sntp/log.c@1.22 +2 -1
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ sntp/main.c@1.76 +42 -25
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ sntp/networking.c@1.61 +11 -14
+ [Bug 1988] Better sntp send failed error message needed.
+ [Bug 1990] sntp output should include stratum.
+
+ sntp/networking.h@1.27 +2 -3
+ return FALSE from sendpkt() on error.
+
+ sntp/utilities.c@1.19 +33 -0
+ add hostnameaddr() to display given hostname and resolved numeric
+ IP address, avoid duplication if the input was a numeric address.
+
+ sntp/utilities.h@1.11 +14 -12
+ add hostnameaddr() to display given hostname and resolved numeric
+ IP address, avoid duplication if the input was a numeric address.
+
+ChangeSet@1.2637.1.1, 2011-08-13 10:46:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P203
+ TAG: NTP_4_2_7P203
+
+ ChangeLog@1.1005.1.1 +1 -0
+ NTP_4_2_7P203
+
+ ntpd/ntpd-opts.c@1.208 +3 -3
+ NTP_4_2_7P203
+
+ ntpd/ntpd-opts.h@1.208 +3 -3
+ NTP_4_2_7P203
+
+ ntpd/ntpd-opts.texi@1.206 +2 -2
+ NTP_4_2_7P203
+
+ ntpd/ntpd.1ntpdman@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpd/ntpd.1ntpdmdoc@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpd/ntpd.man.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpd/ntpd.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc-opts.c@1.203 +3 -3
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc-opts.h@1.203 +3 -3
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc-opts.texi@1.203 +2 -2
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc.1ntpdcman@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc.html@1.31 +2 -2
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc.man.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpdc/ntpdc.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpq/ntpq-opts.c@1.205 +3 -3
+ NTP_4_2_7P203
+
+ ntpq/ntpq-opts.h@1.205 +3 -3
+ NTP_4_2_7P203
+
+ ntpq/ntpq-opts.texi@1.205 +2 -2
+ NTP_4_2_7P203
+
+ ntpq/ntpq.1ntpqman@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpq/ntpq.1ntpqmdoc@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpq/ntpq.man.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpq/ntpq.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.205 +3 -3
+ NTP_4_2_7P203
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.205 +3 -3
+ NTP_4_2_7P203
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.205 +2 -2
+ NTP_4_2_7P203
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpsnmpd/ntpsnmpd.man.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ packageinfo.sh@1.206 +1 -1
+ NTP_4_2_7P203
+
+ scripts/ntp-wait-opts.texi@1.23 +1 -1
+ NTP_4_2_7P203
+
+ scripts/ntp-wait.1ntp-waitman@1.19 +2 -2
+ NTP_4_2_7P203
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.19 +2 -2
+ NTP_4_2_7P203
+
+ scripts/ntp-wait.html@1.23 +1 -1
+ NTP_4_2_7P203
+
+ scripts/ntp-wait.man.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ scripts/ntp-wait.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ sntp/sntp-opts.c@1.201 +3 -3
+ NTP_4_2_7P203
+
+ sntp/sntp-opts.h@1.201 +3 -3
+ NTP_4_2_7P203
+
+ sntp/sntp-opts.texi@1.201 +2 -2
+ NTP_4_2_7P203
+
+ sntp/sntp.1sntpman@1.21 +2 -2
+ NTP_4_2_7P203
+
+ sntp/sntp.1sntpmdoc@1.21 +2 -2
+ NTP_4_2_7P203
+
+ sntp/sntp.html@1.201 +2 -2
+ NTP_4_2_7P203
+
+ sntp/sntp.man.in@1.21 +2 -2
+ NTP_4_2_7P203
+
+ sntp/sntp.mdoc.in@1.21 +2 -2
+ NTP_4_2_7P203
+
+ util/ntp-keygen-opts.c@1.203 +3 -3
+ NTP_4_2_7P203
+
+ util/ntp-keygen-opts.h@1.203 +3 -3
+ NTP_4_2_7P203
+
+ util/ntp-keygen-opts.texi@1.206 +2 -2
+ NTP_4_2_7P203
+
+ util/ntp-keygen.1ntp-keygenman@1.19 +2 -2
+ NTP_4_2_7P203
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.19 +2 -2
+ NTP_4_2_7P203
+
+ util/ntp-keygen.man.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ util/ntp-keygen.mdoc.in@1.19 +2 -2
+ NTP_4_2_7P203
+
+ChangeSet@1.2638, 2011-08-13 08:59:34+02:00, jnperlin@hydra.localnet
+ PGRMF support in NMEA driver
+
+ ChangeLog@1.1006 +1 -0
+ PGRMF support in NMEA driver
+
+ ntpd/refclock_nmea.c@1.61 +647 -475
+ PGRMF support in NMEA driver
+
+ChangeSet@1.2637, 2011-08-12 15:04:45-04:00, stenn@deacon.udel.edu
+ Note that 1986 was fixed by this changeset
+
+ ChangeLog@1.1005 +1 -1
+ Note that 1986 was fixed by this changeset
+
+ChangeSet@1.2636, 2011-08-12 17:17:54+00:00, davehart@shiny.ad.hartbrothers.com
+ Actually use long long for (u_)int64 by correcting spelling
+ of SIZEOF_LONG_LONG in ntp_types.h.
+ Require Visual C++ 2005 or later compilers in Windows port.
+ Force .exe minimum Windows version to 0x0400 to allow NT4 in
+ vs2005/*.vcproj files.
+
+ ChangeLog@1.1004 +5 -0
+ Actually use long long for (u_)int64 by correcting spelling of
+ SIZEOF_LONG_LONG in ntp_types.h.
+ Require Visual C++ 2005 or later compilers in Windows port.
+ Force .exe minimum Windows version to 0x0400 to allow NT4 in
+ vs2005/*.vcproj files.
+
+
+ include/ntp_machine.h@1.36 +0 -5
+ Remove long-untested SYS_CYGWIN32-specific block.
+
+ include/ntp_types.h@1.25 +1 -6
+ Correct spelling of SIZEOF_LONG_LONG, which will restore NTP's int64 on a
+ number of platforms.
+ With VC++ 2005 the minimum requirement, remove _MSC_VER __int64 block,
+ using the same "long long" types for (u_)int64.
+
+ include/timetoa.h@1.4 +3 -2
+ comment cleanup
+
+ lib/isc/win32/include/isc/platform.h@1.8 +2 -0
+ Allow presetting ISC_PLATFORM_QUADFORMAT, as ports\winnt\include\config.h
+ now does.
+
+ libntp/timespecops.c@1.7 +4 -3
+ Use u_int64 where available, instead of only where long is 64-bit.
+
+ ntpd/complete.conf@1.19 +1 -0
+ test "server" with IPv6 link-local with interface specifier
+
+ ports/winnt/include/config.h@1.101 +54 -63
+ Require Visual C++ 2005 or later, enabling portable "long long" and
+ "%lld" for 64-bit scalars.
+ Switch libisc from %I64 to %ll.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.51 +77 -121
+ Require Visual C++ 2005 or later, enabling portable "long long" and
+ "%lld" for 64-bit scalars.
+ Switch from %I64 to %ll.
+ Remove workarounds for VC6 deficit converting u_int64 to double,
+ removing many (LONGLONG) casts of ULONGLONGs in particular.
+ Code style cleanup.
+
+ ports/winnt/vs2005/Instsrv.vcproj@1.3 +2 -0
+ Force .exe minimum Windows version to 0x0400 to allow NT4
+
+ ports/winnt/vs2005/ntpd.vcproj@1.15 +2 -0
+ Force .exe minimum Windows version to 0x0400 to allow NT4
+
+ ports/winnt/vs2005/ntpdate.vcproj@1.5 +2 -0
+ Force .exe minimum Windows version to 0x0400 to allow NT4
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.7 +2 -0
+ Force .exe minimum Windows version to 0x0400 to allow NT4
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.7 +2 -0
+ Force .exe minimum Windows version to 0x0400 to allow NT4
+
+ ports/winnt/vs2005/ntpq.vcproj@1.7 +2 -0
+ Force .exe minimum Windows version to 0x0400 to allow NT4
+
+ChangeSet@1.2635, 2011-08-12 06:25:53+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct init_logging()'s def_syslogmask type to u_int32 following
+ change of ntp_syslogmask from u_long to u_int32 in p202.
+
+ ChangeLog@1.1003 +2 -0
+ Correct init_logging()'s def_syslogmask type to u_int32 following
+ change of ntp_syslogmask from u_long to u_int32 in p202.
+
+ include/ntp_stdlib.h@1.64 +1 -1
+ change init_logging()'s def_syslogmask type to u_int32 to match
+ recent change of ntp_syslogmask from u_long to u_int32.
+
+ libntp/msyslog.c@1.46 +7 -3
+ More (u_long) to (u_int32) around ntp_syslogmask type change.
+
+ sntp/m4/ntp_libevent.m4@1.9 +6 -1
+ Detect --gc-sections support by default for our tearoff libevent,
+ now that libevent has opted to default to --disable-function-sections.
+
+ChangeSet@1.2634, 2011-08-12 06:21:59+00:00, davehart@shiny.ad.hartbrothers.com
+ Attempt to fix libevent "make distcheck" failure related to read-only
+ srcdir and event_rpcgen.py by avoiding creating stub regress.gen.h and
+ regress.gen.c in the build directory when $srcdir has both already.
+
+ ChangeLog@1.1002 +2 -0
+ Fix make distcheck with --enable-libevent-regress problem with
+ unwritable $srcdir.
+
+ sntp/libevent/test/Makefile.am@1.8 +9 -4
+ Attempt to fix libevent "make distcheck" failure related to read-only
+ srcdir and event_rpcgen.py by avoiding creating stub regress.gen.h and
+ regress.gen.c in the build directory when $srcdir has both already.
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.1 +42 -0
+ BitKeeper file C:/ntp/ntp-dev-1986/sntp/libevent/test/rpcgen_wrapper.sh
+
+ sntp/libevent/test/rpcgen_wrapper.sh@1.0 +0 -0
+
+ChangeSet@1.2633, 2011-08-09 08:20:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P202
+ TAG: NTP_4_2_7P202
+
+ ChangeLog@1.1001 +1 -0
+ NTP_4_2_7P202
+
+ ntpd/ntpd-opts.c@1.207 +3 -3
+ NTP_4_2_7P202
+
+ ntpd/ntpd-opts.h@1.207 +3 -3
+ NTP_4_2_7P202
+
+ ntpd/ntpd-opts.texi@1.205 +2 -2
+ NTP_4_2_7P202
+
+ ntpd/ntpd.1ntpdman@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpd/ntpd.1ntpdmdoc@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpd/ntpd.man.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpd/ntpd.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc-opts.c@1.202 +3 -3
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc-opts.h@1.202 +3 -3
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc-opts.texi@1.202 +2 -2
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc.1ntpdcman@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc.html@1.30 +2 -2
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc.man.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpdc/ntpdc.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpq/ntpq-opts.c@1.204 +3 -3
+ NTP_4_2_7P202
+
+ ntpq/ntpq-opts.h@1.204 +3 -3
+ NTP_4_2_7P202
+
+ ntpq/ntpq-opts.texi@1.204 +2 -2
+ NTP_4_2_7P202
+
+ ntpq/ntpq.1ntpqman@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpq/ntpq.1ntpqmdoc@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpq/ntpq.man.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpq/ntpq.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.204 +3 -3
+ NTP_4_2_7P202
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.204 +3 -3
+ NTP_4_2_7P202
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.204 +2 -2
+ NTP_4_2_7P202
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpsnmpd/ntpsnmpd.man.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ packageinfo.sh@1.205 +1 -1
+ NTP_4_2_7P202
+
+ scripts/ntp-wait-opts.texi@1.22 +1 -1
+ NTP_4_2_7P202
+
+ scripts/ntp-wait.1ntp-waitman@1.18 +2 -2
+ NTP_4_2_7P202
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.18 +2 -2
+ NTP_4_2_7P202
+
+ scripts/ntp-wait.html@1.22 +1 -1
+ NTP_4_2_7P202
+
+ scripts/ntp-wait.man.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ scripts/ntp-wait.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ sntp/sntp-opts.c@1.200 +3 -3
+ NTP_4_2_7P202
+
+ sntp/sntp-opts.h@1.200 +3 -3
+ NTP_4_2_7P202
+
+ sntp/sntp-opts.texi@1.200 +2 -2
+ NTP_4_2_7P202
+
+ sntp/sntp.1sntpman@1.20 +2 -2
+ NTP_4_2_7P202
+
+ sntp/sntp.1sntpmdoc@1.20 +2 -2
+ NTP_4_2_7P202
+
+ sntp/sntp.html@1.200 +2 -2
+ NTP_4_2_7P202
+
+ sntp/sntp.man.in@1.20 +2 -2
+ NTP_4_2_7P202
+
+ sntp/sntp.mdoc.in@1.20 +2 -2
+ NTP_4_2_7P202
+
+ util/ntp-keygen-opts.c@1.202 +3 -3
+ NTP_4_2_7P202
+
+ util/ntp-keygen-opts.h@1.202 +3 -3
+ NTP_4_2_7P202
+
+ util/ntp-keygen-opts.texi@1.205 +2 -2
+ NTP_4_2_7P202
+
+ util/ntp-keygen.1ntp-keygenman@1.18 +2 -2
+ NTP_4_2_7P202
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.18 +2 -2
+ NTP_4_2_7P202
+
+ util/ntp-keygen.man.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ util/ntp-keygen.mdoc.in@1.18 +2 -2
+ NTP_4_2_7P202
+
+ChangeSet@1.2632, 2011-08-09 03:58:30-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1983] --without-sntp build breaks in sntp subdir
+
+ sntp/Makefile.am@1.68 +0 -2
+ [Bug 1983] --without-sntp build breaks in sntp subdir
+
+ sntp/configure.ac@1.68 +8 -0
+ [Bug 1983] --without-sntp build breaks in sntp subdir
+
+ChangeSet@1.2631, 2011-08-09 05:46:47+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1983] --without-sntp build breaks in sntp subdir.
+
+ ChangeLog@1.1000 +1 -0
+ [Bug 1983] --without-sntp build breaks in sntp subdir.
+
+ sntp/Makefile.am@1.67 +5 -3
+ [Bug 1983] --without-sntp build breaks in sntp subdir.
+
+ Wrap *_PROGRAMS assignments with "if BUILD_SNTP" / "endif".
+
+ChangeSet@1.2082.4.233, 2011-08-09 04:27:25+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1985] "logconfig =allall" rejected.
+
+ ChangeLog@1.496.26.166 +1 -0
+ [Bug 1985] "logconfig =allall" rejected.
+
+ include/ntp_syslog.h@1.3.1.2 +7 -5
+ convert spaces to tabs, change ntp_syslogmask type from u_long to u_int32.
+
+ include/ntpd.h@1.137.2.6 +1 -2
+ #include ntp.h before ntp_syslog.h
+
+ libntp/machines.c@1.21.1.1 +1 -0
+ #include ntp.h before ntp_syslog.h
+
+ libntp/msyslog.c@1.24.1.5 +1 -1
+ [Bug 1985] "logconfig =allall" rejected.
+
+ ntpd/complete.conf@1.3.1.2 +1 -1
+ [Bug 1985] "logconfig =allall" rejected.
+
+ ntpd/ntp_config.c@1.241.1.9 +53 -40
+ [Bug 1985] "logconfig =allall" rejected.
+
+ChangeSet@1.2628, 2011-08-08 20:03:45+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+
+ ChangeLog@1.997 +1 -0
+ [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+
+ sntp/m4/ntp_ipv6.m4@1.5 +7 -0
+ [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+
+ChangeSet@1.2082.4.232, 2011-08-08 18:13:07+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+
+ ChangeLog@1.496.26.165 +1 -0
+ [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+
+
+ configure.ac@1.465.1.30 +7 -0
+ [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+
+
+ sntp/configure.ac@1.31.1.10 +7 -0
+ [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion).
+
+
+ChangeSet@1.2627, 2011-08-05 04:59:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P201
+ TAG: NTP_4_2_7P201
+
+ ChangeLog@1.996 +1 -0
+ NTP_4_2_7P201
+
+ ntpd/ntpd-opts.c@1.206 +3 -3
+ NTP_4_2_7P201
+
+ ntpd/ntpd-opts.h@1.206 +3 -3
+ NTP_4_2_7P201
+
+ ntpd/ntpd-opts.texi@1.204 +2 -2
+ NTP_4_2_7P201
+
+ ntpd/ntpd.1ntpdman@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpd/ntpd.1ntpdmdoc@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpd/ntpd.man.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpd/ntpd.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc-opts.c@1.201 +3 -3
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc-opts.h@1.201 +3 -3
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc-opts.texi@1.201 +2 -2
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc.1ntpdcman@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc.html@1.29 +2 -2
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc.man.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpdc/ntpdc.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpq/ntpq-opts.c@1.203 +3 -3
+ NTP_4_2_7P201
+
+ ntpq/ntpq-opts.h@1.203 +3 -3
+ NTP_4_2_7P201
+
+ ntpq/ntpq-opts.texi@1.203 +2 -2
+ NTP_4_2_7P201
+
+ ntpq/ntpq.1ntpqman@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpq/ntpq.1ntpqmdoc@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpq/ntpq.man.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpq/ntpq.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.203 +3 -3
+ NTP_4_2_7P201
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.203 +3 -3
+ NTP_4_2_7P201
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.203 +2 -2
+ NTP_4_2_7P201
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpsnmpd/ntpsnmpd.man.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ packageinfo.sh@1.204 +1 -1
+ NTP_4_2_7P201
+
+ scripts/ntp-wait-opts.texi@1.21 +1 -1
+ NTP_4_2_7P201
+
+ scripts/ntp-wait.1ntp-waitman@1.17 +2 -2
+ NTP_4_2_7P201
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.17 +2 -2
+ NTP_4_2_7P201
+
+ scripts/ntp-wait.html@1.21 +1 -1
+ NTP_4_2_7P201
+
+ scripts/ntp-wait.man.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ scripts/ntp-wait.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ sntp/sntp-opts.c@1.199 +3 -3
+ NTP_4_2_7P201
+
+ sntp/sntp-opts.h@1.199 +3 -3
+ NTP_4_2_7P201
+
+ sntp/sntp-opts.texi@1.199 +2 -2
+ NTP_4_2_7P201
+
+ sntp/sntp.1sntpman@1.19 +2 -2
+ NTP_4_2_7P201
+
+ sntp/sntp.1sntpmdoc@1.19 +3 -3
+ NTP_4_2_7P201
+
+ sntp/sntp.html@1.199 +51 -78
+ NTP_4_2_7P201
+
+ sntp/sntp.man.in@1.19 +2 -2
+ NTP_4_2_7P201
+
+ sntp/sntp.mdoc.in@1.19 +3 -3
+ NTP_4_2_7P201
+
+ util/ntp-keygen-opts.c@1.201 +3 -3
+ NTP_4_2_7P201
+
+ util/ntp-keygen-opts.h@1.201 +3 -3
+ NTP_4_2_7P201
+
+ util/ntp-keygen-opts.texi@1.204 +2 -2
+ NTP_4_2_7P201
+
+ util/ntp-keygen.1ntp-keygenman@1.17 +2 -2
+ NTP_4_2_7P201
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.17 +2 -2
+ NTP_4_2_7P201
+
+ util/ntp-keygen.man.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ util/ntp-keygen.mdoc.in@1.17 +2 -2
+ NTP_4_2_7P201
+
+ChangeSet@1.2626, 2011-08-04 19:41:51-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.995 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.6 +2 -2
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.72 +7 -7
+ Documentation updates from Dave Mills
+
+ html/clock.html@1.3 +5 -4
+ Documentation updates from Dave Mills
+
+ html/cluster.html@1.3 +5 -4
+ Documentation updates from Dave Mills
+
+ html/copyright.html@1.58 +8 -4
+ Documentation updates from Dave Mills
+
+ html/discipline.html@1.5 +6 -6
+ Documentation updates from Dave Mills
+
+ html/filter.html@1.3 +2 -2
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.67 +3 -1
+ Documentation updates from Dave Mills
+
+ html/orphan.html@1.3 +17 -11
+ Documentation updates from Dave Mills
+
+ html/poll.html@1.2 +2 -2
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.26 +18 -28
+ Documentation updates from Dave Mills
+
+ html/scripts/authopt.txt@1.5 +2 -0
+ Documentation updates from Dave Mills
+
+ html/scripts/miscopt.txt@1.8 +1 -0
+ Documentation updates from Dave Mills
+
+ html/select.html@1.3 +4 -3
+ Documentation updates from Dave Mills
+
+ html/sntp.html@1.8 +50 -26
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2625, 2011-08-04 18:51:13-04:00, stenn@psp-deb1.ntp.org
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp-opts.c@1.198 +26 -28
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp-opts.def@1.36 +1 -1
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp-opts.h@1.198 +9 -9
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp-opts.texi@1.198 +12 -14
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp.1sntpman@1.18 +4 -4
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp.1sntpmdoc@1.18 +4 -4
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp.html@1.198 +98 -73
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp.man.in@1.18 +4 -4
+ sntp autogen regenerate after merge cleanup
+
+ sntp/sntp.mdoc.in@1.18 +4 -4
+ sntp autogen regenerate after merge cleanup
+
+ChangeSet@1.2620.1.1, 2011-08-04 16:13:31-04:00, stenn@psp-deb1.ntp.org
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ ChangeLog@1.990.1.1 +2 -0
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/main.c@1.74 +6 -6
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp-opts.c@1.195.1.1 +20 -20
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp-opts.def@1.34 +3 -3
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp-opts.h@1.195.1.1 +8 -8
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp-opts.texi@1.195.1.1 +6 -6
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp.1sntpman@1.15.1.1 +4 -4
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp.1sntpmdoc@1.15.1.1 +5 -5
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp.html@1.195.1.1 +7 -7
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp.man.in@1.15.1.1 +4 -4
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ sntp/sntp.mdoc.in@1.15.1.1 +5 -5
+ sntp: change -h/--headspace to -g/--gap, and change the default gap from 10 to 50ms
+
+ChangeSet@1.2082.4.231, 2011-08-04 15:45:08-04:00, stenn@psp-deb1.ntp.org
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ sntp/sntp-opts.c@1.117.37.1 +19 -19
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ sntp/sntp-opts.h@1.117.37.1 +7 -7
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ sntp/sntp-opts.texi@1.117.36.1 +30 -29
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ sntp/sntp.1@1.117.36.1 +8 -8
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ sntp/sntp.html@1.7.37.1 +96 -77
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ChangeSet@1.2082.4.230, 2011-08-04 15:39:31-04:00, stenn@psp-deb1.ntp.org
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ ChangeLog@1.496.26.164 +2 -0
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ sntp/main.c@1.24.1.10 +2 -2
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ sntp/sntp-opts.def@1.19.1.1 +9 -14
+ [Backward Incompatible] sntp: -l/--filelog -> -l/--logfile, to be consistent with ntpd
+
+ChangeSet@1.2082.4.229, 2011-08-04 15:17:36-04:00, stenn@psp-deb1.ntp.org
+ libopts/file.c fix from Bruce Korb (arg-type=file)
+
+ ChangeLog@1.496.26.163 +4 -0
+ libopts/file.c fix from Bruce Korb (arg-type=file)
+
+ sntp/libopts/file.c@1.8 +4 -2
+ libopts/file.c fix from Bruce Korb (arg-type=file)
+
+ChangeSet@1.2622, 2011-08-04 13:37:42-04:00, stenn@deacon.udel.edu
+ Update Changelog
+
+ ChangeLog@1.992 +1 -0
+ Update Changelog
+
+ChangeSet@1.2621, 2011-08-04 11:56:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P200
+ TAG: NTP_4_2_7P200
+
+ ChangeLog@1.991 +1 -0
+ NTP_4_2_7P200
+
+ ntpd/ntpd-opts.c@1.205 +3 -3
+ NTP_4_2_7P200
+
+ ntpd/ntpd-opts.h@1.205 +3 -3
+ NTP_4_2_7P200
+
+ ntpd/ntpd-opts.texi@1.203 +2 -2
+ NTP_4_2_7P200
+
+ ntpd/ntpd.1ntpdman@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpd/ntpd.1ntpdmdoc@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpd/ntpd.man.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpd/ntpd.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc-opts.c@1.200 +3 -3
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc-opts.h@1.200 +3 -3
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc-opts.texi@1.200 +2 -2
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc.1ntpdcman@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc.html@1.28 +2 -2
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc.man.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpdc/ntpdc.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpq/ntpq-opts.c@1.202 +3 -3
+ NTP_4_2_7P200
+
+ ntpq/ntpq-opts.h@1.202 +3 -3
+ NTP_4_2_7P200
+
+ ntpq/ntpq-opts.texi@1.202 +2 -2
+ NTP_4_2_7P200
+
+ ntpq/ntpq.1ntpqman@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpq/ntpq.1ntpqmdoc@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpq/ntpq.man.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpq/ntpq.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.202 +3 -3
+ NTP_4_2_7P200
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.202 +3 -3
+ NTP_4_2_7P200
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.202 +2 -2
+ NTP_4_2_7P200
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpsnmpd/ntpsnmpd.man.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ packageinfo.sh@1.203 +1 -1
+ NTP_4_2_7P200
+
+ scripts/ntp-wait-opts.texi@1.20 +1 -1
+ NTP_4_2_7P200
+
+ scripts/ntp-wait.1ntp-waitman@1.16 +2 -2
+ NTP_4_2_7P200
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.16 +2 -2
+ NTP_4_2_7P200
+
+ scripts/ntp-wait.html@1.20 +1 -1
+ NTP_4_2_7P200
+
+ scripts/ntp-wait.man.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ scripts/ntp-wait.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ sntp/sntp-opts.c@1.196 +3 -3
+ NTP_4_2_7P200
+
+ sntp/sntp-opts.h@1.196 +3 -3
+ NTP_4_2_7P200
+
+ sntp/sntp-opts.texi@1.196 +2 -2
+ NTP_4_2_7P200
+
+ sntp/sntp.1sntpman@1.16 +2 -2
+ NTP_4_2_7P200
+
+ sntp/sntp.1sntpmdoc@1.16 +2 -2
+ NTP_4_2_7P200
+
+ sntp/sntp.html@1.196 +2 -2
+ NTP_4_2_7P200
+
+ sntp/sntp.man.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ sntp/sntp.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ util/ntp-keygen-opts.c@1.200 +3 -3
+ NTP_4_2_7P200
+
+ util/ntp-keygen-opts.h@1.200 +3 -3
+ NTP_4_2_7P200
+
+ util/ntp-keygen-opts.texi@1.203 +2 -2
+ NTP_4_2_7P200
+
+ util/ntp-keygen.1ntp-keygenman@1.16 +2 -2
+ NTP_4_2_7P200
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.16 +2 -2
+ NTP_4_2_7P200
+
+ util/ntp-keygen.man.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ util/ntp-keygen.mdoc.in@1.16 +2 -2
+ NTP_4_2_7P200
+
+ChangeSet@1.2082.4.228, 2011-08-04 04:50:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P4_RC2
+ TAG: NTP_4_2_6P4_RC2
+
+ ChangeLog@1.496.26.162 +1 -0
+ NTP_4_2_6P4_RC2
+
+ ntpd/ntpd-opts.c@1.248.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpd/ntpd-opts.h@1.248.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpd/ntpd-opts.texi@1.246.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ ntpd/ntpd.1@1.246.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ ntpdc/ntpdc-opts.c@1.244.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpdc/ntpdc-opts.h@1.244.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpdc/ntpdc-opts.texi@1.243.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ ntpdc/ntpdc.1@1.243.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ ntpq/ntpq-opts.c@1.245.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpq/ntpq-opts.h@1.245.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpq/ntpq-opts.texi@1.244.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ ntpq/ntpq.1@1.244.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.39.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.39.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.38.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ ntpsnmpd/ntpsnmpd.1@1.122.38.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ packageinfo.sh@1.255.35.1 +1 -1
+ NTP_4_2_6P4_RC2
+
+ sntp/sntp-opts.c@1.117.36.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ sntp/sntp-opts.h@1.117.36.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ sntp/sntp-opts.texi@1.117.35.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ sntp/sntp.1@1.117.35.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ sntp/sntp.html@1.7.36.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ util/ntp-keygen-opts.c@1.247.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ util/ntp-keygen-opts.h@1.247.38.1 +3 -3
+ NTP_4_2_6P4_RC2
+
+ util/ntp-keygen-opts.texi@1.246.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ util/ntp-keygen.1@1.246.37.1 +2 -2
+ NTP_4_2_6P4_RC2
+
+ChangeSet@1.2619, 2011-07-29 11:12:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P199
+ TAG: NTP_4_2_7P199
+
+ ChangeLog@1.989 +1 -0
+ NTP_4_2_7P199
+
+ ntpd/ntpd-opts.c@1.204 +3 -3
+ NTP_4_2_7P199
+
+ ntpd/ntpd-opts.h@1.204 +3 -3
+ NTP_4_2_7P199
+
+ ntpd/ntpd-opts.texi@1.202 +2 -2
+ NTP_4_2_7P199
+
+ ntpd/ntpd.1ntpdman@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpd/ntpd.1ntpdmdoc@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpd/ntpd.man.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpd/ntpd.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc-opts.c@1.199 +3 -3
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc-opts.h@1.199 +3 -3
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc-opts.texi@1.199 +2 -2
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc.1ntpdcman@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc.html@1.27 +2 -2
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc.man.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpdc/ntpdc.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpq/ntpq-opts.c@1.201 +3 -3
+ NTP_4_2_7P199
+
+ ntpq/ntpq-opts.h@1.201 +3 -3
+ NTP_4_2_7P199
+
+ ntpq/ntpq-opts.texi@1.201 +2 -2
+ NTP_4_2_7P199
+
+ ntpq/ntpq.1ntpqman@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpq/ntpq.1ntpqmdoc@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpq/ntpq.man.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpq/ntpq.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.201 +3 -3
+ NTP_4_2_7P199
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.201 +3 -3
+ NTP_4_2_7P199
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.201 +2 -2
+ NTP_4_2_7P199
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpsnmpd/ntpsnmpd.man.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ packageinfo.sh@1.202 +1 -1
+ NTP_4_2_7P199
+
+ scripts/ntp-wait-opts.texi@1.19 +1 -1
+ NTP_4_2_7P199
+
+ scripts/ntp-wait.1ntp-waitman@1.15 +2 -2
+ NTP_4_2_7P199
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.15 +2 -2
+ NTP_4_2_7P199
+
+ scripts/ntp-wait.html@1.19 +1 -1
+ NTP_4_2_7P199
+
+ scripts/ntp-wait.man.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ scripts/ntp-wait.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ sntp/sntp-opts.c@1.195 +3 -3
+ NTP_4_2_7P199
+
+ sntp/sntp-opts.h@1.195 +3 -3
+ NTP_4_2_7P199
+
+ sntp/sntp-opts.texi@1.195 +2 -2
+ NTP_4_2_7P199
+
+ sntp/sntp.1sntpman@1.15 +2 -2
+ NTP_4_2_7P199
+
+ sntp/sntp.1sntpmdoc@1.15 +2 -2
+ NTP_4_2_7P199
+
+ sntp/sntp.html@1.195 +2 -2
+ NTP_4_2_7P199
+
+ sntp/sntp.man.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ sntp/sntp.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ util/ntp-keygen-opts.c@1.199 +3 -3
+ NTP_4_2_7P199
+
+ util/ntp-keygen-opts.h@1.199 +3 -3
+ NTP_4_2_7P199
+
+ util/ntp-keygen-opts.texi@1.202 +2 -2
+ NTP_4_2_7P199
+
+ util/ntp-keygen.1ntp-keygenman@1.15 +2 -2
+ NTP_4_2_7P199
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.15 +2 -2
+ NTP_4_2_7P199
+
+ util/ntp-keygen.man.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ util/ntp-keygen.mdoc.in@1.15 +2 -2
+ NTP_4_2_7P199
+
+ChangeSet@1.2618, 2011-07-29 04:19:55-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.988 +1 -0
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.56 +2 -2
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.16 +20 -12
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2617, 2011-07-28 08:48:08+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P198
+ TAG: NTP_4_2_7P198
+
+ ChangeLog@1.987 +1 -0
+ NTP_4_2_7P198
+
+ ntpd/ntpd-opts.c@1.203 +3 -3
+ NTP_4_2_7P198
+
+ ntpd/ntpd-opts.h@1.203 +3 -3
+ NTP_4_2_7P198
+
+ ntpd/ntpd-opts.texi@1.201 +2 -2
+ NTP_4_2_7P198
+
+ ntpd/ntpd.1ntpdman@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpd/ntpd.1ntpdmdoc@1.14 +1 -1
+ NTP_4_2_7P198
+
+ ntpd/ntpd.man.in@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpd/ntpd.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc-opts.c@1.198 +3 -3
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc-opts.h@1.198 +3 -3
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc-opts.texi@1.198 +2 -2
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc.1ntpdcman@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.14 +1 -1
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc.html@1.26 +2 -2
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc.man.in@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpdc/ntpdc.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P198
+
+ ntpq/ntpq-opts.c@1.200 +3 -3
+ NTP_4_2_7P198
+
+ ntpq/ntpq-opts.h@1.200 +3 -3
+ NTP_4_2_7P198
+
+ ntpq/ntpq-opts.texi@1.200 +2 -2
+ NTP_4_2_7P198
+
+ ntpq/ntpq.1ntpqman@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpq/ntpq.1ntpqmdoc@1.14 +1 -1
+ NTP_4_2_7P198
+
+ ntpq/ntpq.man.in@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpq/ntpq.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P198
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.200 +3 -3
+ NTP_4_2_7P198
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.200 +3 -3
+ NTP_4_2_7P198
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.200 +2 -2
+ NTP_4_2_7P198
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.14 +1 -1
+ NTP_4_2_7P198
+
+ ntpsnmpd/ntpsnmpd.man.in@1.14 +2 -2
+ NTP_4_2_7P198
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P198
+
+ packageinfo.sh@1.201 +1 -1
+ NTP_4_2_7P198
+
+ scripts/ntp-wait-opts.texi@1.18 +1 -1
+ NTP_4_2_7P198
+
+ scripts/ntp-wait.1ntp-waitman@1.14 +2 -2
+ NTP_4_2_7P198
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.14 +1 -1
+ NTP_4_2_7P198
+
+ scripts/ntp-wait.html@1.18 +1 -1
+ NTP_4_2_7P198
+
+ scripts/ntp-wait.man.in@1.14 +2 -2
+ NTP_4_2_7P198
+
+ scripts/ntp-wait.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P198
+
+ sntp/sntp-opts.c@1.194 +3 -3
+ NTP_4_2_7P198
+
+ sntp/sntp-opts.h@1.194 +3 -3
+ NTP_4_2_7P198
+
+ sntp/sntp-opts.texi@1.194 +2 -2
+ NTP_4_2_7P198
+
+ sntp/sntp.1sntpman@1.14 +2 -2
+ NTP_4_2_7P198
+
+ sntp/sntp.1sntpmdoc@1.14 +1 -1
+ NTP_4_2_7P198
+
+ sntp/sntp.html@1.194 +2 -2
+ NTP_4_2_7P198
+
+ sntp/sntp.man.in@1.14 +2 -2
+ NTP_4_2_7P198
+
+ sntp/sntp.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P198
+
+ util/ntp-keygen-opts.c@1.198 +3 -3
+ NTP_4_2_7P198
+
+ util/ntp-keygen-opts.h@1.198 +3 -3
+ NTP_4_2_7P198
+
+ util/ntp-keygen-opts.texi@1.201 +2 -2
+ NTP_4_2_7P198
+
+ util/ntp-keygen.1ntp-keygenman@1.14 +2 -2
+ NTP_4_2_7P198
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.14 +1 -1
+ NTP_4_2_7P198
+
+ util/ntp-keygen.man.in@1.14 +2 -2
+ NTP_4_2_7P198
+
+ util/ntp-keygen.mdoc.in@1.14 +1 -1
+ NTP_4_2_7P198
+
+ChangeSet@1.2616, 2011-07-28 04:04:18-04:00, stenn@deacon.udel.edu
+ remove old binsubdir stuff from SNTP, as NTP_LOCINFO does that now.
+
+ ChangeLog@1.986 +1 -0
+ remove old binsubdir stuff from SNTP, as NTP_LOCINFO does that now.
+
+ sntp/configure.ac@1.66 +0 -100
+ remove old binsubdir stuff from SNTP, as NTP_LOCINFO does that now.
+
+ChangeSet@1.2615, 2011-07-28 07:03:09+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P197
+ TAG: NTP_4_2_7P197
+
+ ChangeLog@1.985 +1 -0
+ NTP_4_2_7P197
+
+ ntpd/ntpd-opts.c@1.202 +3 -3
+ NTP_4_2_7P197
+
+ ntpd/ntpd-opts.h@1.202 +3 -3
+ NTP_4_2_7P197
+
+ ntpd/ntpd-opts.texi@1.200 +2 -2
+ NTP_4_2_7P197
+
+ ntpd/ntpd.1ntpdman@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpd/ntpd.1ntpdmdoc@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpd/ntpd.man.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpd/ntpd.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc-opts.c@1.197 +3 -3
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc-opts.h@1.197 +3 -3
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc-opts.texi@1.197 +2 -2
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc.1ntpdcman@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc.html@1.25 +2 -2
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc.man.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpdc/ntpdc.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpq/ntpq-opts.c@1.199 +3 -3
+ NTP_4_2_7P197
+
+ ntpq/ntpq-opts.h@1.199 +3 -3
+ NTP_4_2_7P197
+
+ ntpq/ntpq-opts.texi@1.199 +2 -2
+ NTP_4_2_7P197
+
+ ntpq/ntpq.1ntpqman@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpq/ntpq.1ntpqmdoc@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpq/ntpq.man.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpq/ntpq.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.199 +3 -3
+ NTP_4_2_7P197
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.199 +3 -3
+ NTP_4_2_7P197
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.199 +2 -2
+ NTP_4_2_7P197
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpsnmpd/ntpsnmpd.man.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ packageinfo.sh@1.200 +1 -1
+ NTP_4_2_7P197
+
+ scripts/ntp-wait-opts.texi@1.17 +1 -1
+ NTP_4_2_7P197
+
+ scripts/ntp-wait.1ntp-waitman@1.13 +2 -2
+ NTP_4_2_7P197
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.13 +2 -2
+ NTP_4_2_7P197
+
+ scripts/ntp-wait.html@1.17 +1 -1
+ NTP_4_2_7P197
+
+ scripts/ntp-wait.man.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ scripts/ntp-wait.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ sntp/sntp-opts.c@1.193 +3 -3
+ NTP_4_2_7P197
+
+ sntp/sntp-opts.h@1.193 +3 -3
+ NTP_4_2_7P197
+
+ sntp/sntp-opts.texi@1.193 +2 -2
+ NTP_4_2_7P197
+
+ sntp/sntp.1sntpman@1.13 +2 -2
+ NTP_4_2_7P197
+
+ sntp/sntp.1sntpmdoc@1.13 +2 -2
+ NTP_4_2_7P197
+
+ sntp/sntp.html@1.193 +2 -2
+ NTP_4_2_7P197
+
+ sntp/sntp.man.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ sntp/sntp.mdoc.in@1.13 +2 -2
+ NTP_4_2_7P197
+
+ util/ntp-keygen-opts.c@1.197 +3 -3
+ NTP_4_2_7P197
+
+ util/ntp-keygen-opts.h@1.197 +3 -3
+ NTP_4_2_7P197
+
+ util/ntp-keygen-opts.texi@1.200 +4 -4
+ NTP_4_2_7P197
+
+ util/ntp-keygen.1ntp-keygenman@1.13 +4 -4
+ NTP_4_2_7P197
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.13 +4 -4
+ NTP_4_2_7P197
+
+ util/ntp-keygen.man.in@1.13 +4 -4
+ NTP_4_2_7P197
+
+ util/ntp-keygen.mdoc.in@1.13 +4 -4
+ NTP_4_2_7P197
+
+ChangeSet@1.2082.4.227, 2011-07-28 02:59:20-04:00, stenn@deacon.udel.edu
+ Backport if_nametoindex() check for hpux
+
+ ChangeLog@1.496.26.161 +1 -0
+ Backport if_nametoindex() check for hpux
+
+ configure.ac@1.465.1.29 +4 -10
+ Backport if_nametoindex() check for hpux
+
+ChangeSet@1.2612.1.9, 2011-07-28 02:25:31-04:00, stenn@deacon.udel.edu
+ cleanup
+
+ ChangeLog@1.984 +1 -1
+ cleanup
+
+ChangeSet@1.2612.1.8, 2011-07-27 22:10:08-07:00, harlan@hms-mbp.local
+ [Bug 1977] Mismatch between flag and description in ntp-keygen-opts.def
+
+ ChangeLog@1.983 +1 -0
+ [Bug 1977] Mismatch between flag and description in ntp-keygen-opts.def
+
+ util/ntp-keygen-opts.def@1.15 +2 -2
+ [Bug 1977] Mismatch between flag and description in ntp-keygen-opts.def
+
+ChangeSet@1.2612.1.7, 2011-07-27 19:45:16-04:00, stenn@deacon.udel.edu
+ Update sntp/loc/solaris to conform to stock locations
+
+ ChangeLog@1.982 +1 -0
+ Update sntp/loc/solaris to conform to stock locations
+
+ sntp/loc/solaris@1.3 +11 -11
+ Update sntp/loc/solaris to conform to stock locations
+
+ChangeSet@1.2612.1.6, 2011-07-27 22:42:23+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix warnings in ntp_request.c ([Bug 1973] oversight) and sntp/main.c
+ (CID 159, apparent overrun due to union, actually correct).
+
+ ChangeLog@1.981 +2 -0
+ Fix warnings in ntp_request.c ([Bug 1973] oversight) and sntp/main.c
+ (CID 159, apparent overrun due to union, actually correct).
+
+ ntpd/ntp_request.c@1.106 +1 -1
+ Fix warning in ntp_request.c ([Bug 1973] fix oversight, peer->ttl is now
+ 32 bits but mode 7 protocol still uses 8 bits, cast to avoid truncation
+ warning.
+
+ sntp/main.c@1.73 +1 -1
+ Fix CID 159, apparent overrun due to union, actually correct.
+
+ sntp/networking.c@1.60 +3 -3
+ Fix CID 159, apparent overrun due to union, actually correct.
+
+ sntp/networking.h@1.26 +1 -1
+ Fix CID 159, apparent overrun due to union, actually correct.
+
+ChangeSet@1.2082.4.226, 2011-07-27 22:22:03+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct [Bug 1978] description in ChangeLog.
+
+ ChangeLog@1.496.26.160 +1 -1
+ [Bug 1978] [Bug 1134] fix in 4.2.6p4-RC1 doesn't build on older Linux.
+
+ChangeSet@1.2082.4.225, 2011-07-27 21:41:02+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1978] Ignore tentative IP addresses on Linux.
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ ChangeLog@1.496.26.159 +2 -0
+ [Bug 1978] Ignore tentative IP addresses on Linux.
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ configure.ac@1.465.1.28 +9 -0
+ [Bug 1978] Ignore tentative IP addresses on Linux.
+
+ include/ntp_rfc2553.h@1.33.1.1 +10 -2
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ lib/isc/unix/interfaceiter.c@1.19.1.2 +5 -3
+ [Bug 1978] Ignore tentative IP addresses on Linux.
+
+ libntp/audio.c@1.27.1.1 +29 -29
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ libntp/decodenetnum.c@1.10.1.1 +43 -10
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ libntp/icom.c@1.11.1.1 +34 -10
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ ntpd/refclock_arc.c@1.22.1.1 +37 -34
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ ntpdc/ntpdc.c@1.75.1.5 +25 -17
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ ntpq/ntpq.c@1.97.1.9 +25 -17
+ Backport several fixes for Coverity warnings from ntp-dev.
+
+ChangeSet@1.2612.1.3, 2011-07-27 16:38:38+00:00, davehart@shiny.ad.hartbrothers.com
+ Do not force "legacy" when --with-locfile is not given, genLocInfo
+ will find the correct default for the system.
+
+ ChangeLog@1.978 +2 -0
+ Do not force "legacy" when --with-locfile is not given, genLocInfo
+ will find the correct default for the system.
+
+ sntp/m4/ntp_locinfo.m4@1.14 +13 -4
+ Do not force "legacy" when --with-locfile is not given, genLocInfo
+ will find the correct default for the system.
+
+ChangeSet@1.2612.1.1, 2011-07-27 06:27:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
+
+ ChangeLog@1.976 +2 -1
+ [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
+
+ sntp/m4/ntp_locinfo.m4@1.13 +8 -6
+ [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
+
+ sntp/scripts/Makefile.am@1.3 +0 -3
+ Remove unneeded DISTCLEANFILES=config.log in sntp/scripts/Makefile.am.
+
+ sntp/scripts/genLocInfo@1.14.1.1 +17 -11
+ [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
+
+ChangeSet@1.2613, 2011-07-26 22:44:46-04:00, stenn@deacon.udel.edu
+ cleanup
+
+ sntp/scripts/genLocInfo@1.15 +1 -1
+ cleanup
+
+ChangeSet@1.2612, 2011-07-27 02:25:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P196
+ TAG: NTP_4_2_7P196
+
+ ChangeLog@1.975 +1 -0
+ NTP_4_2_7P196
+
+ ntpd/ntpd-opts.c@1.201 +3 -3
+ NTP_4_2_7P196
+
+ ntpd/ntpd-opts.h@1.201 +3 -3
+ NTP_4_2_7P196
+
+ ntpd/ntpd-opts.texi@1.199 +2 -2
+ NTP_4_2_7P196
+
+ ntpd/ntpd.1ntpdman@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpd/ntpd.1ntpdmdoc@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpd/ntpd.man.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpd/ntpd.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc-opts.c@1.196 +3 -3
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc-opts.h@1.196 +3 -3
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc-opts.texi@1.196 +2 -2
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc.1ntpdcman@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc.html@1.24 +2 -2
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc.man.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpdc/ntpdc.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpq/ntpq-opts.c@1.198 +3 -3
+ NTP_4_2_7P196
+
+ ntpq/ntpq-opts.h@1.198 +3 -3
+ NTP_4_2_7P196
+
+ ntpq/ntpq-opts.texi@1.198 +2 -2
+ NTP_4_2_7P196
+
+ ntpq/ntpq.1ntpqman@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpq/ntpq.1ntpqmdoc@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpq/ntpq.man.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpq/ntpq.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.198 +3 -3
+ NTP_4_2_7P196
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.198 +3 -3
+ NTP_4_2_7P196
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.198 +2 -2
+ NTP_4_2_7P196
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpsnmpd/ntpsnmpd.man.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ packageinfo.sh@1.199 +1 -1
+ NTP_4_2_7P196
+
+ scripts/ntp-wait-opts.texi@1.16 +1 -1
+ NTP_4_2_7P196
+
+ scripts/ntp-wait.1ntp-waitman@1.12 +2 -2
+ NTP_4_2_7P196
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.12 +2 -2
+ NTP_4_2_7P196
+
+ scripts/ntp-wait.html@1.16 +1 -1
+ NTP_4_2_7P196
+
+ scripts/ntp-wait.man.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ scripts/ntp-wait.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ sntp/sntp-opts.c@1.192 +3 -3
+ NTP_4_2_7P196
+
+ sntp/sntp-opts.h@1.192 +3 -3
+ NTP_4_2_7P196
+
+ sntp/sntp-opts.texi@1.192 +2 -2
+ NTP_4_2_7P196
+
+ sntp/sntp.1sntpman@1.12 +2 -2
+ NTP_4_2_7P196
+
+ sntp/sntp.1sntpmdoc@1.12 +2 -2
+ NTP_4_2_7P196
+
+ sntp/sntp.html@1.192 +2 -2
+ NTP_4_2_7P196
+
+ sntp/sntp.man.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ sntp/sntp.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ util/ntp-keygen-opts.c@1.196 +3 -3
+ NTP_4_2_7P196
+
+ util/ntp-keygen-opts.h@1.196 +3 -3
+ NTP_4_2_7P196
+
+ util/ntp-keygen-opts.texi@1.199 +2 -2
+ NTP_4_2_7P196
+
+ util/ntp-keygen.1ntp-keygenman@1.12 +2 -2
+ NTP_4_2_7P196
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.12 +2 -2
+ NTP_4_2_7P196
+
+ util/ntp-keygen.man.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ util/ntp-keygen.mdoc.in@1.12 +2 -2
+ NTP_4_2_7P196
+
+ChangeSet@1.2611, 2011-07-26 21:55:09-04:00, stenn@deacon.udel.edu
+ use --with-loc=legacy in br-flock
+
+ br-flock@1.16 +1 -1
+ use --with-loc=legacy in br-flock
+
+ChangeSet@1.2610, 2011-07-26 21:51:16-04:00, stenn@deacon.udel.edu
+ cleanup
+
+ ChangeLog@1.974 +1 -1
+ cleanup
+
+ChangeSet@1.2609, 2011-07-26 21:38:54-04:00, stenn@pogo.udel.edu
+ work around solaris /bin/sh issues for genLocInfo.
+
+ ChangeLog@1.973 +1 -0
+ work around solaris /bin/sh issues for genLocInfo.
+
+ sntp/scripts/genLocInfo@1.14 +23 -12
+ work around solaris /bin/sh issues for genLocInfo.
+
+ChangeSet@1.2608, 2011-07-26 14:26:17-04:00, stenn@psp-deb1.ntp.org
+ Be louder about loc/ changes
+
+ ChangeLog@1.972 +2 -0
+ Be louder about loc/ changes
+
+ChangeSet@1.2607, 2011-07-26 14:23:35-04:00, stenn@psp-deb1.ntp.org
+ Improve the help text: --with-locfile=XXX
+
+ ChangeLog@1.971 +1 -0
+ Improve the help text: --with-locfile=XXX
+
+ sntp/m4/ntp_locinfo.m4@1.12 +1 -1
+ Improve the help text: --with-locfile=XXX
+
+ChangeSet@1.2606, 2011-07-26 14:10:34-04:00, stenn@psp-deb1.ntp.org
+ genLocInfo cleanup
+
+ ChangeLog@1.970 +10 -0
+ genLocInfo cleanup
+
+ Makefile.am@1.113 +0 -1
+ genLocInfo cleanup
+
+ build@1.46 +4 -4
+ genLocInfo cleanup
+
+ configure.ac@1.533 +1 -20
+ genLocInfo cleanup
+
+ ntpd/Makefile.am@1.110 +4 -4
+ genLocInfo cleanup
+
+ ntpdc/Makefile.am@1.66 +4 -4
+ genLocInfo cleanup
+
+ ntpq/Makefile.am@1.62 +4 -4
+ genLocInfo cleanup
+
+ ntpsnmpd/Makefile.am@1.33 +4 -4
+ genLocInfo cleanup
+
+ scripts/Makefile.am@1.29 +4 -6
+ genLocInfo cleanup
+
+ sntp/Makefile.am@1.66 +7 -6
+ genLocInfo cleanup
+
+ sntp/configure.ac@1.65 +2 -2
+ genLocInfo cleanup
+
+ sntp/include/Makefile.am@1.4 +0 -1
+ genLocInfo cleanup
+
+ sntp/loc/README@1.1 +9 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/loc/README
+
+ sntp/loc/README@1.0 +0 -0
+
+ sntp/loc/freebsd@1.4 +0 -0
+ Rename: loc/freebsd -> sntp/loc/freebsd
+
+ sntp/loc/legacy@1.4 +0 -0
+ Rename: loc/legacy -> sntp/loc/legacy
+
+ sntp/loc/redhat@1.2 +0 -0
+ Rename: loc/redhat -> sntp/loc/redhat
+
+ sntp/loc/solaris@1.2 +0 -0
+ Rename: loc/solaris -> sntp/loc/solaris
+
+ sntp/m4/ntp_locinfo.m4@1.11 +59 -58
+ genLocInfo cleanup
+
+ sntp/scripts/Makefile.am@1.2 +1 -0
+ genLocInfo cleanup
+
+ sntp/scripts/Makefile.am@1.1 +9 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/scripts/Makefile.am
+
+ sntp/scripts/Makefile.am@1.0 +0 -0
+
+ sntp/scripts/cvo.sh@1.7 +0 -0
+ Rename: scripts/cvo.sh -> sntp/scripts/cvo.sh
+
+ sntp/scripts/genLocInfo@1.13 +37 -3
+ genLocInfo cleanup
+
+ sntp/scripts/genLocInfo@1.12 +0 -0
+ Rename: scripts/genLocInfo -> sntp/scripts/genLocInfo
+
+ sntp/scripts/mansec2subst.sed@1.2 +0 -0
+ Rename: sntp/include/mansec2subst.sed -> sntp/scripts/mansec2subst.sed
+
+ util/Makefile.am@1.65 +4 -4
+ genLocInfo cleanup
+
+ChangeSet@1.2082.4.224, 2011-07-26 11:21:46+02:00, karlsson@beam.lund.zozs.se
+ [Bug 1975] libntp/mktime.c won't work with 64-bit time_t
+
+ ChangeLog@1.496.26.158 +1 -0
+ [Bug 1975] libntp/mktime.c won't work with 64-bit time_t
+
+ libntp/mktime.c@1.8.1.2 +4 -0
+ [Bug 1975] libntp/mktime.c won't work with 64-bit time_t
+
+ChangeSet@1.2605, 2011-07-26 01:57:56-04:00, stenn@psp-deb1.ntp.org
+ Removed sntp/m4/ntp_bindir.m4 - no longer needed
+
+ BitKeeper/deleted/a9/ntp_bindir.m4~14281a43d40ac9cd@1.2 +0 -0
+ Delete: sntp/m4/ntp_bindir.m4
+
+ ChangeLog@1.969 +1 -0
+ Removed sntp/m4/ntp_bindir.m4 - no longer needed
+
+ChangeSet@1.2604, 2011-07-26 01:59:51+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix build on Linux systems lacking linux/if_addr.h or IFA_F_TENTATIVE.
+
+ lib/isc/unix/interfaceiter.c@1.22 +3 -1
+ Fix build on Linux systems lacking linux/if_addr.h or IFA_F_TENTATIVE.
+
+ sntp/m4/ntp_libntp.m4@1.16 +9 -0
+ Fix build on Linux systems lacking linux/if_addr.h or IFA_F_TENTATIVE.
+
+ChangeSet@1.2603, 2011-07-26 00:18:29+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ ChangeLog@1.968 +1 -0
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ include/ntp.h@1.196 +1 -1
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ include/ntp_config.h@1.74 +2 -1
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ include/ntpd.h@1.165 +3 -3
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ libntp/tsftomsu.c@1.4 +10 -7
+ Eliminate warning: "round" shadows global (use "round_it").
+
+ ntpd/complete.conf@1.17 +1 -1
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ ntpd/keyword-gen-utd@1.14 +1 -1
+ keyword-gen output
+
+ ntpd/ntp_config.c@1.292 +18 -6
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ ntpd/ntp_keyword.h@1.16 +62 -61
+ keyword-gen output
+
+ ntpd/ntp_parser.c@1.76 +747 -744
+ Bison output
+
+ ntpd/ntp_parser.h@1.43 +44 -41
+ Bison output
+
+ ntpd/ntp_parser.y@1.70 +7 -3
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ ntpd/ntp_peer.c@1.148 +6 -6
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ ntpd/ntp_scanner.c@1.43 +103 -26
+ [Bug 1973] Widen reference clock mode from 8 to 32 bits.
+
+ sntp/main.c@1.72 +1 -1
+ Quiet incompatible type to recvdata() warning.
+
+ChangeSet@1.2082.4.223, 2011-07-25 14:10:27+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1972] checking for struct rtattr fails.
+
+ ChangeLog@1.496.26.157 +1 -0
+ [Bug 1972] checking for struct rtattr fails.
+
+ configure.ac@1.465.1.27 +6 -5
+ [Bug 1972] checking for struct rtattr fails.
+
+ChangeSet@1.2601, 2011-07-25 08:10:23+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P195
+ TAG: NTP_4_2_7P195
+
+ ChangeLog@1.966 +1 -0
+ NTP_4_2_7P195
+
+ ntpd/ntpd-opts.c@1.200 +3 -3
+ NTP_4_2_7P195
+
+ ntpd/ntpd-opts.h@1.200 +3 -3
+ NTP_4_2_7P195
+
+ ntpd/ntpd-opts.texi@1.198 +2 -2
+ NTP_4_2_7P195
+
+ ntpd/ntpd.1ntpdman@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpd/ntpd.1ntpdmdoc@1.11 +1 -1
+ NTP_4_2_7P195
+
+ ntpd/ntpd.man.in@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpd/ntpd.mdoc.in@1.11 +1 -1
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc-opts.c@1.195 +3 -3
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc-opts.h@1.195 +3 -3
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc-opts.texi@1.195 +2 -2
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc.1ntpdcman@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.11 +1 -1
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc.html@1.23 +2 -2
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc.man.in@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpdc/ntpdc.mdoc.in@1.11 +1 -1
+ NTP_4_2_7P195
+
+ ntpq/ntpq-opts.c@1.197 +3 -3
+ NTP_4_2_7P195
+
+ ntpq/ntpq-opts.h@1.197 +3 -3
+ NTP_4_2_7P195
+
+ ntpq/ntpq-opts.texi@1.197 +2 -2
+ NTP_4_2_7P195
+
+ ntpq/ntpq.1ntpqman@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpq/ntpq.1ntpqmdoc@1.11 +1 -1
+ NTP_4_2_7P195
+
+ ntpq/ntpq.man.in@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpq/ntpq.mdoc.in@1.11 +1 -1
+ NTP_4_2_7P195
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.197 +3 -3
+ NTP_4_2_7P195
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.197 +3 -3
+ NTP_4_2_7P195
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.197 +2 -2
+ NTP_4_2_7P195
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.11 +1 -1
+ NTP_4_2_7P195
+
+ ntpsnmpd/ntpsnmpd.man.in@1.11 +2 -2
+ NTP_4_2_7P195
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.11 +1 -1
+ NTP_4_2_7P195
+
+ packageinfo.sh@1.198 +1 -1
+ NTP_4_2_7P195
+
+ scripts/ntp-wait-opts.texi@1.15 +1 -1
+ NTP_4_2_7P195
+
+ scripts/ntp-wait.1ntp-waitman@1.11 +2 -2
+ NTP_4_2_7P195
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.11 +1 -1
+ NTP_4_2_7P195
+
+ scripts/ntp-wait.html@1.15 +1 -1
+ NTP_4_2_7P195
+
+ scripts/ntp-wait.man.in@1.11 +2 -2
+ NTP_4_2_7P195
+
+ scripts/ntp-wait.mdoc.in@1.11 +1 -1
+ NTP_4_2_7P195
+
+ sntp/sntp-opts.c@1.191 +3 -3
+ NTP_4_2_7P195
+
+ sntp/sntp-opts.h@1.191 +3 -3
+ NTP_4_2_7P195
+
+ sntp/sntp-opts.texi@1.191 +2 -2
+ NTP_4_2_7P195
+
+ sntp/sntp.1sntpman@1.11 +2 -2
+ NTP_4_2_7P195
+
+ sntp/sntp.1sntpmdoc@1.11 +1 -1
+ NTP_4_2_7P195
+
+ sntp/sntp.html@1.191 +2 -2
+ NTP_4_2_7P195
+
+ sntp/sntp.man.in@1.11 +2 -2
+ NTP_4_2_7P195
+
+ sntp/sntp.mdoc.in@1.11 +1 -1
+ NTP_4_2_7P195
+
+ util/ntp-keygen-opts.c@1.195 +3 -3
+ NTP_4_2_7P195
+
+ util/ntp-keygen-opts.h@1.195 +3 -3
+ NTP_4_2_7P195
+
+ util/ntp-keygen-opts.texi@1.198 +2 -2
+ NTP_4_2_7P195
+
+ util/ntp-keygen.1ntp-keygenman@1.11 +2 -2
+ NTP_4_2_7P195
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.11 +1 -1
+ NTP_4_2_7P195
+
+ util/ntp-keygen.man.in@1.11 +2 -2
+ NTP_4_2_7P195
+
+ util/ntp-keygen.mdoc.in@1.11 +1 -1
+ NTP_4_2_7P195
+
+ChangeSet@1.2598.1.10, 2011-07-25 07:02:42+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P194
+ TAG: NTP_4_2_7P194
+
+ ChangeLog@1.963.1.8 +1 -0
+ NTP_4_2_7P194
+
+ ntpd/ntpd-opts.c@1.199 +3 -3
+ NTP_4_2_7P194
+
+ ntpd/ntpd-opts.h@1.199 +3 -3
+ NTP_4_2_7P194
+
+ ntpd/ntpd-opts.texi@1.197 +2 -2
+ NTP_4_2_7P194
+
+ ntpd/ntpd.1ntpdman@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpd/ntpd.1ntpdmdoc@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpd/ntpd.man.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpd/ntpd.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc-opts.c@1.194 +3 -3
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc-opts.h@1.194 +3 -3
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc-opts.texi@1.194 +2 -2
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc.1ntpdcman@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc.html@1.22 +2 -2
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc.man.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpdc/ntpdc.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpq/ntpq-opts.c@1.196 +3 -3
+ NTP_4_2_7P194
+
+ ntpq/ntpq-opts.h@1.196 +3 -3
+ NTP_4_2_7P194
+
+ ntpq/ntpq-opts.texi@1.196 +2 -2
+ NTP_4_2_7P194
+
+ ntpq/ntpq.1ntpqman@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpq/ntpq.1ntpqmdoc@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpq/ntpq.man.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpq/ntpq.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.196 +3 -3
+ NTP_4_2_7P194
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.196 +3 -3
+ NTP_4_2_7P194
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.196 +2 -2
+ NTP_4_2_7P194
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpsnmpd/ntpsnmpd.man.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ packageinfo.sh@1.197 +1 -1
+ NTP_4_2_7P194
+
+ scripts/ntp-wait-opts.texi@1.14 +1 -1
+ NTP_4_2_7P194
+
+ scripts/ntp-wait.1ntp-waitman@1.10 +2 -2
+ NTP_4_2_7P194
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.10 +2 -2
+ NTP_4_2_7P194
+
+ scripts/ntp-wait.html@1.14 +1 -1
+ NTP_4_2_7P194
+
+ scripts/ntp-wait.man.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ scripts/ntp-wait.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ sntp/sntp-opts.c@1.190 +3 -3
+ NTP_4_2_7P194
+
+ sntp/sntp-opts.h@1.190 +3 -3
+ NTP_4_2_7P194
+
+ sntp/sntp-opts.texi@1.190 +2 -2
+ NTP_4_2_7P194
+
+ sntp/sntp.1sntpman@1.10 +2 -2
+ NTP_4_2_7P194
+
+ sntp/sntp.1sntpmdoc@1.10 +2 -2
+ NTP_4_2_7P194
+
+ sntp/sntp.html@1.190 +2 -2
+ NTP_4_2_7P194
+
+ sntp/sntp.man.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ sntp/sntp.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ util/ntp-keygen-opts.c@1.194 +3 -3
+ NTP_4_2_7P194
+
+ util/ntp-keygen-opts.h@1.194 +3 -3
+ NTP_4_2_7P194
+
+ util/ntp-keygen-opts.texi@1.197 +2 -2
+ NTP_4_2_7P194
+
+ util/ntp-keygen.1ntp-keygenman@1.10 +2 -2
+ NTP_4_2_7P194
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.10 +2 -2
+ NTP_4_2_7P194
+
+ util/ntp-keygen.man.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ util/ntp-keygen.mdoc.in@1.10 +2 -2
+ NTP_4_2_7P194
+
+ChangeSet@1.2598.1.9, 2011-07-25 02:23:52-04:00, stenn@deacon.udel.edu
+ Added loc/solaris
+
+ ChangeLog@1.963.1.7 +1 -0
+ Added loc/solaris
+
+ loc/solaris@1.1 +14 -0
+ BitKeeper file /deacon/backroom/ntp-dev/loc/solaris
+
+ loc/solaris@1.0 +0 -0
+
+ChangeSet@1.2598.1.8, 2011-07-25 02:21:49-04:00, stenn@deacon.udel.edu
+ Add support for installing programs and scripts to libexec
+
+ ChangeLog@1.963.1.6 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ adjtimed/Makefile.am@1.14 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ configure.ac@1.531 +11 -0
+ Add support for installing programs and scripts to libexec
+
+ ntpd/Makefile.am@1.109 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ ntpdate/Makefile.am@1.32 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ ntpdc/Makefile.am@1.65 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ ntpq/Makefile.am@1.61 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ ntpsnmpd/Makefile.am@1.32 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ scripts/Makefile.am@1.28 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ scripts/genLocInfo@1.11 +13 -3
+ Add support for installing programs and scripts to libexec
+
+ sntp/Makefile.am@1.65 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ sntp/configure.ac@1.64 +11 -2
+ Add support for installing programs and scripts to libexec
+
+ sntp/m4/ntp_locinfo.m4@1.10 +14 -1
+ Add support for installing programs and scripts to libexec
+
+ util/Makefile.am@1.64 +1 -0
+ Add support for installing programs and scripts to libexec
+
+ChangeSet@1.2082.4.222, 2011-07-25 00:09:06-04:00, stenn@deacon.udel.edu
+ [Bug 1608] Parse Refclock driver should honor trusttime
+
+ ChangeLog@1.496.26.156 +2 -1
+ [Bug 1608] Parse Refclock driver should honor trusttime
+
+ html/drivers/driver8.html@1.25.1.1 +9 -0
+ [Bug 1608] Parse Refclock driver should honor trusttime
+
+ ntpd/refclock_parse.c@1.52.1.2 +62 -13
+ [Bug 1608] Parse Refclock driver should honor trusttime
+
+ChangeSet@1.2598.1.6, 2011-07-24 12:28:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P193
+ TAG: NTP_4_2_7P193
+
+ ChangeLog@1.963.1.4 +1 -0
+ NTP_4_2_7P193
+
+ ntpd/ntpd-opts.c@1.198 +3 -3
+ NTP_4_2_7P193
+
+ ntpd/ntpd-opts.h@1.198 +3 -3
+ NTP_4_2_7P193
+
+ ntpd/ntpd-opts.texi@1.196 +2 -2
+ NTP_4_2_7P193
+
+ ntpd/ntpd.1ntpdman@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpd/ntpd.1ntpdmdoc@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpd/ntpd.man.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpd/ntpd.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc-opts.c@1.193 +3 -3
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc-opts.h@1.193 +3 -3
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc-opts.texi@1.193 +2 -2
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc.1ntpdcman@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc.html@1.21 +2 -2
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc.man.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpdc/ntpdc.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpq/ntpq-opts.c@1.195 +3 -3
+ NTP_4_2_7P193
+
+ ntpq/ntpq-opts.h@1.195 +3 -3
+ NTP_4_2_7P193
+
+ ntpq/ntpq-opts.texi@1.195 +2 -2
+ NTP_4_2_7P193
+
+ ntpq/ntpq.1ntpqman@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpq/ntpq.1ntpqmdoc@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpq/ntpq.man.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpq/ntpq.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.195 +3 -3
+ NTP_4_2_7P193
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.195 +3 -3
+ NTP_4_2_7P193
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.195 +2 -2
+ NTP_4_2_7P193
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpsnmpd/ntpsnmpd.man.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ packageinfo.sh@1.196 +1 -1
+ NTP_4_2_7P193
+
+ scripts/ntp-wait-opts.texi@1.13 +1 -1
+ NTP_4_2_7P193
+
+ scripts/ntp-wait.1ntp-waitman@1.9 +2 -2
+ NTP_4_2_7P193
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.9 +2 -2
+ NTP_4_2_7P193
+
+ scripts/ntp-wait.html@1.13 +1 -1
+ NTP_4_2_7P193
+
+ scripts/ntp-wait.man.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ scripts/ntp-wait.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ sntp/sntp-opts.c@1.189 +3 -3
+ NTP_4_2_7P193
+
+ sntp/sntp-opts.h@1.189 +3 -3
+ NTP_4_2_7P193
+
+ sntp/sntp-opts.texi@1.189 +2 -2
+ NTP_4_2_7P193
+
+ sntp/sntp.1sntpman@1.9 +2 -2
+ NTP_4_2_7P193
+
+ sntp/sntp.1sntpmdoc@1.9 +2 -2
+ NTP_4_2_7P193
+
+ sntp/sntp.html@1.189 +2 -2
+ NTP_4_2_7P193
+
+ sntp/sntp.man.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ sntp/sntp.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ util/ntp-keygen-opts.c@1.193 +3 -3
+ NTP_4_2_7P193
+
+ util/ntp-keygen-opts.h@1.193 +3 -3
+ NTP_4_2_7P193
+
+ util/ntp-keygen-opts.texi@1.196 +2 -2
+ NTP_4_2_7P193
+
+ util/ntp-keygen.1ntp-keygenman@1.9 +2 -2
+ NTP_4_2_7P193
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.9 +2 -2
+ NTP_4_2_7P193
+
+ util/ntp-keygen.man.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ util/ntp-keygen.mdoc.in@1.9 +2 -2
+ NTP_4_2_7P193
+
+ChangeSet@1.2598.1.5, 2011-07-24 01:41:56+00:00, davehart@shiny.ad.hartbrothers.com
+ Update libevent to 2.1 HEAD as of merge of 2.0.13-stable-dev.
+ (applies to prior cset)
+ Match addr_eqprefix() sizeof and memcpy destination to make it clear
+ to static analysis that there is no buffer overrun (CID 402).
+
+ ChangeLog@1.963.1.3 +3 -0
+ Update libevent to 2.1 HEAD as of merge of 2.0.13-stable-dev.
+ Match addr_eqprefix() sizeof and memcpy destination to make it clear
+ to static analysis that there is no buffer overrun (CID 402).
+
+
+ ntpd/ntp_io.c@1.358 +2 -4
+ Match addr_eqprefix() sizeof and memcpy destination to make it clear
+ to static analysis that there is no buffer overrun (CID 402).
+
+ChangeSet@1.2461.1.7, 2011-07-24 00:59:52+00:00, davehart@shiny.ad.hartbrothers.com
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/ChangeLog@1.4 +28 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/Doxyfile@1.2 +31 -18
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/Makefile.am@1.1.1.4 +3 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/README@1.4 +2 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/buffer.c@1.5 +50 -19
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/buffer_iocp.c@1.3 +2 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/bufferevent_openssl.c@1.4 +2 -2
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/bufferevent_pair.c@1.4 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evdns.h@1.2 +10 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/event-internal.h@1.1.1.3 +3 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/event.c@1.1.1.4 +25 -7
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/event.h@1.3 +6 -127
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evhttp.h@1.2 +10 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evmap.c@1.4 +6 -3
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evrpc.h@1.2 +10 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evthread-internal.h@1.4 +18 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evthread.c@1.1.1.3 +90 -2
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evutil.c@1.1.1.3 +3 -3
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evutil.h@1.2 +8 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/evutil_rand.c@1.3 +16 -3
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/ht-internal.h@1.2 +1 -3
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/http.c@1.1.1.4 +21 -13
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/buffer.h@1.3 +153 -68
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/buffer_compat.h@1.2 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/bufferevent.h@1.2 +99 -37
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/bufferevent_compat.h@1.2 +4 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/bufferevent_ssl.h@1.2 +31 -2
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/bufferevent_struct.h@1.2 +4 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/dns.h@1.3 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/dns_compat.h@1.3 +2 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/dns_struct.h@1.2 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/event.h@1.1.1.3 +553 -151
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/event_compat.h@1.2 +48 -152
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/event_struct.h@1.2 +5 -3
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/http.h@1.3 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/http_compat.h@1.2 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/http_struct.h@1.2 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/rpc_compat.h@1.2 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/rpc_struct.h@1.2 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/tag.h@1.2 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/tag_compat.h@1.2 +11 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/thread.h@1.3 +36 -25
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/include/event2/util.h@1.3 +131 -33
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/kqueue.c@1.4 +46 -19
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/sample/Makefile.am@1.1.1.3 +1 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/select.c@1.1.1.3 +19 -9
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/signal.c@1.4 +9 -5
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/test/Makefile.am@1.1.1.3 +7 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/test/Makefile.nmake@1.3 +5 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/test/regress_buffer.c@1.4 +103 -1
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/test/regress_rpc.c@1.3 +9 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/test/regress_util.c@1.3 +18 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/test/test.sh@1.1.1.2 +18 -40
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/test/tinytest.c@1.3 +8 -3
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ sntp/libevent/util-internal.h@1.1.1.3 +37 -0
+ Update to libevent HEAD as of 20110723, 77a4d7f406be9d78876ba8a1b7c7d834d8998479
+ Snapshot of libevent 2.1, as of 2.0.13-stable-dev release.
+
+ChangeSet@1.2598.1.3, 2011-07-20 20:12:25+00:00, davehart@shiny.ad.hartbrothers.com
+ slight ChangeLog cleanup (wrap after 72 chars, s/4.2.6p4/4.2.6p4-RC2/)
+
+ ChangeLog@1.963.1.2 +2 -1
+ slight ChangeLog cleanup (wrap after 72 chars, s/4.2.6p4/4.2.6p4-RC2/)
+
+ChangeSet@1.2082.4.221, 2011-07-20 19:37:50+00:00, davehart@shiny.ad.hartbrothers.com
+ Backport latest ntp_lists.h from ntp-dev, remove redundant () in
+ UNLINK_EXPR_SLIST().
+
+ include/ntp_lists.h@1.1.1.3 +213 -28
+ Backport latest ntp_lists.h from ntp-dev, remove redundant () in
+ UNLINK_EXPR_SLIST().
+
+ChangeSet@1.2082.4.220, 2011-07-20 13:06:51+02:00, karlsson@beam.lund.zozs.se
+ [BUG 1970] UNLINK_EXPR_SLIST() causes crash if list is empty.
+
+ ChangeLog@1.496.26.155 +1 -0
+ [BUG 1970] UNLINK_EXPR_SLIST() causes crash if list is empty.
+
+ include/ntp_lists.h@1.1.1.2 +4 -3
+ [BUG 1970] UNLINK_EXPR_SLIST() causes crash if list is empty.
+
+ChangeSet@1.2599, 2011-07-19 06:55:38-04:00, stenn@psp-deb1.ntp.org
+ Added loc/redhat
+
+ ChangeLog@1.964 +1 -0
+ Added loc/redhat
+
+ loc/redhat@1.1 +15 -0
+ BitKeeper file /home/stenn/ntp-dev/loc/redhat
+
+ loc/redhat@1.0 +0 -0
+
+ChangeSet@1.2598, 2011-07-18 11:53:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P192
+ TAG: NTP_4_2_7P192
+
+ ChangeLog@1.963 +1 -0
+ NTP_4_2_7P192
+
+ ntpd/ntpd-opts.c@1.197 +3 -3
+ NTP_4_2_7P192
+
+ ntpd/ntpd-opts.h@1.197 +3 -3
+ NTP_4_2_7P192
+
+ ntpd/ntpd-opts.texi@1.195 +2 -2
+ NTP_4_2_7P192
+
+ ntpd/ntpd.1ntpdman@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpd/ntpd.1ntpdmdoc@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpd/ntpd.man.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpd/ntpd.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc-opts.c@1.192 +3 -3
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc-opts.h@1.192 +3 -3
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc-opts.texi@1.192 +2 -2
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc.1ntpdcman@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc.html@1.20 +2 -2
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc.man.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpdc/ntpdc.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpq/ntpq-opts.c@1.194 +3 -3
+ NTP_4_2_7P192
+
+ ntpq/ntpq-opts.h@1.194 +3 -3
+ NTP_4_2_7P192
+
+ ntpq/ntpq-opts.texi@1.194 +2 -2
+ NTP_4_2_7P192
+
+ ntpq/ntpq.1ntpqman@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpq/ntpq.1ntpqmdoc@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpq/ntpq.man.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpq/ntpq.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.194 +3 -3
+ NTP_4_2_7P192
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.194 +3 -3
+ NTP_4_2_7P192
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.194 +2 -2
+ NTP_4_2_7P192
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpsnmpd/ntpsnmpd.man.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ packageinfo.sh@1.195 +1 -1
+ NTP_4_2_7P192
+
+ scripts/ntp-wait-opts.texi@1.12 +1 -1
+ NTP_4_2_7P192
+
+ scripts/ntp-wait.1ntp-waitman@1.8 +2 -2
+ NTP_4_2_7P192
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.8 +2 -2
+ NTP_4_2_7P192
+
+ scripts/ntp-wait.html@1.12 +1 -1
+ NTP_4_2_7P192
+
+ scripts/ntp-wait.man.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ scripts/ntp-wait.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ sntp/sntp-opts.c@1.188 +3 -3
+ NTP_4_2_7P192
+
+ sntp/sntp-opts.h@1.188 +3 -3
+ NTP_4_2_7P192
+
+ sntp/sntp-opts.texi@1.188 +2 -2
+ NTP_4_2_7P192
+
+ sntp/sntp.1sntpman@1.8 +2 -2
+ NTP_4_2_7P192
+
+ sntp/sntp.1sntpmdoc@1.8 +2 -2
+ NTP_4_2_7P192
+
+ sntp/sntp.html@1.188 +2 -2
+ NTP_4_2_7P192
+
+ sntp/sntp.man.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ sntp/sntp.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ util/ntp-keygen-opts.c@1.192 +3 -3
+ NTP_4_2_7P192
+
+ util/ntp-keygen-opts.h@1.192 +3 -3
+ NTP_4_2_7P192
+
+ util/ntp-keygen-opts.texi@1.195 +2 -2
+ NTP_4_2_7P192
+
+ util/ntp-keygen.1ntp-keygenman@1.8 +2 -2
+ NTP_4_2_7P192
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.8 +2 -2
+ NTP_4_2_7P192
+
+ util/ntp-keygen.man.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ util/ntp-keygen.mdoc.in@1.8 +2 -2
+ NTP_4_2_7P192
+
+ChangeSet@1.2597, 2011-07-17 19:09:30-04:00, stenn@deacon.udel.edu
+ [Bug 1966] Broken FILES section for ntp.keys.def
+
+ ChangeLog@1.962 +1 -0
+ [Bug 1966] Broken FILES section for ntp.keys.def
+
+ ntpd/ntp.keys.def@1.2 +4 -0
+ [Bug 1966] Broken FILES section for ntp.keys.def
+
+ChangeSet@1.2596, 2011-07-17 06:51:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P191
+ TAG: NTP_4_2_7P191
+
+ ChangeLog@1.961 +1 -0
+ NTP_4_2_7P191
+
+ ntpd/ntpd-opts.c@1.196 +3 -3
+ NTP_4_2_7P191
+
+ ntpd/ntpd-opts.h@1.196 +3 -3
+ NTP_4_2_7P191
+
+ ntpd/ntpd-opts.texi@1.194 +2 -2
+ NTP_4_2_7P191
+
+ ntpd/ntpd.1ntpdman@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpd/ntpd.1ntpdmdoc@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpd/ntpd.man.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpd/ntpd.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc-opts.c@1.191 +3 -3
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc-opts.h@1.191 +3 -3
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc-opts.texi@1.191 +2 -2
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc.1ntpdcman@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc.html@1.19 +2 -2
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc.man.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpdc/ntpdc.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpq/ntpq-opts.c@1.193 +3 -3
+ NTP_4_2_7P191
+
+ ntpq/ntpq-opts.h@1.193 +3 -3
+ NTP_4_2_7P191
+
+ ntpq/ntpq-opts.texi@1.193 +2 -2
+ NTP_4_2_7P191
+
+ ntpq/ntpq.1ntpqman@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpq/ntpq.1ntpqmdoc@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpq/ntpq.man.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpq/ntpq.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.193 +3 -3
+ NTP_4_2_7P191
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.193 +3 -3
+ NTP_4_2_7P191
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.193 +2 -2
+ NTP_4_2_7P191
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpsnmpd/ntpsnmpd.man.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ packageinfo.sh@1.194 +1 -1
+ NTP_4_2_7P191
+
+ scripts/ntp-wait-opts.texi@1.11 +1 -1
+ NTP_4_2_7P191
+
+ scripts/ntp-wait.1ntp-waitman@1.7 +2 -2
+ NTP_4_2_7P191
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.7 +2 -2
+ NTP_4_2_7P191
+
+ scripts/ntp-wait.html@1.11 +1 -1
+ NTP_4_2_7P191
+
+ scripts/ntp-wait.man.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ scripts/ntp-wait.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ sntp/sntp-opts.c@1.187 +3 -3
+ NTP_4_2_7P191
+
+ sntp/sntp-opts.h@1.187 +3 -3
+ NTP_4_2_7P191
+
+ sntp/sntp-opts.texi@1.187 +2 -2
+ NTP_4_2_7P191
+
+ sntp/sntp.1sntpman@1.7 +2 -2
+ NTP_4_2_7P191
+
+ sntp/sntp.1sntpmdoc@1.7 +2 -2
+ NTP_4_2_7P191
+
+ sntp/sntp.html@1.187 +2 -2
+ NTP_4_2_7P191
+
+ sntp/sntp.man.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ sntp/sntp.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ util/ntp-keygen-opts.c@1.191 +3 -3
+ NTP_4_2_7P191
+
+ util/ntp-keygen-opts.h@1.191 +3 -3
+ NTP_4_2_7P191
+
+ util/ntp-keygen-opts.texi@1.194 +2 -2
+ NTP_4_2_7P191
+
+ util/ntp-keygen.1ntp-keygenman@1.7 +2 -2
+ NTP_4_2_7P191
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.7 +2 -2
+ NTP_4_2_7P191
+
+ util/ntp-keygen.man.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ util/ntp-keygen.mdoc.in@1.7 +2 -2
+ NTP_4_2_7P191
+
+ChangeSet@1.2593.1.2, 2011-07-16 18:00:11-04:00, stenn@deacon.udel.edu
+ [Bug 1948] Update man page section layout
+
+ ChangeLog@1.958.1.2 +1 -0
+ [Bug 1948] Update man page section layout
+
+ scripts/html2man.in@1.7 +12 -12
+ [Bug 1948] Update man page section layout
+
+ChangeSet@1.2593.1.1, 2011-07-16 17:07:59-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1964] --without-sntp should not build sntp
+
+ ChangeLog@1.958.1.1 +1 -0
+ [Bug 1964] --without-sntp should not build sntp
+
+ sntp/configure.ac@1.63 +4 -4
+ [Bug 1964] --without-sntp should not build sntp
+
+ChangeSet@1.2594, 2011-07-16 15:26:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ChangeLog@1.959 +1 -0
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ include/ntp_config.h@1.73 +1 -0
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ include/ntp_request.h@1.44 +9 -3
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ include/ntpd.h@1.164 +1 -0
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ntpd/complete.conf@1.16 +1 -0
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ntpd/keyword-gen-utd@1.13 +1 -1
+ keyword-gen.c output
+
+ ntpd/keyword-gen.c@1.19 +7 -0
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ntpd/ntp_config.c@1.291 +77 -2
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ntpd/ntp_keyword.h@1.15 +971 -951
+ keyword-gen.c output
+
+ ntpd/ntp_parser.c@1.75 +1029 -969
+ ntp_parser.y output
+
+ ntpd/ntp_parser.h@1.42 +353 -339
+ ntp_parser.y output
+
+ ntpd/ntp_parser.y@1.69 +40 -0
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ntpd/ntp_request.c@1.105 +1 -2
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ntpdc/ntpdc_ops.c@1.78 +9 -8
+ [Bug 1963] add reset command for ntpq :config, similar to ntpdc's
+
+ ntpq/ntpq.c@1.139 +1 -1
+ Silence signed/unsigned comparison warning from VC++ 2008.
+
+ChangeSet@1.2593, 2011-07-13 09:55:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P190
+ TAG: NTP_4_2_7P190
+
+ ChangeLog@1.958 +1 -0
+ NTP_4_2_7P190
+
+ ntpd/ntpd-opts.c@1.195 +3 -3
+ NTP_4_2_7P190
+
+ ntpd/ntpd-opts.h@1.195 +3 -3
+ NTP_4_2_7P190
+
+ ntpd/ntpd-opts.texi@1.193 +2 -2
+ NTP_4_2_7P190
+
+ ntpd/ntpd.1ntpdman@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpd/ntpd.1ntpdmdoc@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpd/ntpd.man.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpd/ntpd.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc-opts.c@1.190 +3 -3
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc-opts.h@1.190 +3 -3
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc-opts.texi@1.190 +2 -2
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc.1ntpdcman@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc.html@1.18 +2 -2
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc.man.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpdc/ntpdc.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpq/ntpq-opts.c@1.192 +3 -3
+ NTP_4_2_7P190
+
+ ntpq/ntpq-opts.h@1.192 +3 -3
+ NTP_4_2_7P190
+
+ ntpq/ntpq-opts.texi@1.192 +2 -2
+ NTP_4_2_7P190
+
+ ntpq/ntpq.1ntpqman@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpq/ntpq.1ntpqmdoc@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpq/ntpq.man.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpq/ntpq.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.192 +3 -3
+ NTP_4_2_7P190
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.192 +3 -3
+ NTP_4_2_7P190
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.192 +2 -2
+ NTP_4_2_7P190
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpsnmpd/ntpsnmpd.man.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ packageinfo.sh@1.193 +1 -1
+ NTP_4_2_7P190
+
+ scripts/ntp-wait-opts.texi@1.10 +1 -1
+ NTP_4_2_7P190
+
+ scripts/ntp-wait.1ntp-waitman@1.6 +2 -2
+ NTP_4_2_7P190
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.6 +2 -2
+ NTP_4_2_7P190
+
+ scripts/ntp-wait.html@1.10 +1 -1
+ NTP_4_2_7P190
+
+ scripts/ntp-wait.man.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ scripts/ntp-wait.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ sntp/sntp-opts.c@1.186 +3 -3
+ NTP_4_2_7P190
+
+ sntp/sntp-opts.h@1.186 +3 -3
+ NTP_4_2_7P190
+
+ sntp/sntp-opts.texi@1.186 +2 -2
+ NTP_4_2_7P190
+
+ sntp/sntp.1sntpman@1.6 +2 -2
+ NTP_4_2_7P190
+
+ sntp/sntp.1sntpmdoc@1.6 +2 -2
+ NTP_4_2_7P190
+
+ sntp/sntp.html@1.186 +2 -2
+ NTP_4_2_7P190
+
+ sntp/sntp.man.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ sntp/sntp.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ util/ntp-keygen-opts.c@1.190 +3 -3
+ NTP_4_2_7P190
+
+ util/ntp-keygen-opts.h@1.190 +3 -3
+ NTP_4_2_7P190
+
+ util/ntp-keygen-opts.texi@1.193 +2 -2
+ NTP_4_2_7P190
+
+ util/ntp-keygen.1ntp-keygenman@1.6 +2 -2
+ NTP_4_2_7P190
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.6 +2 -2
+ NTP_4_2_7P190
+
+ util/ntp-keygen.man.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ util/ntp-keygen.mdoc.in@1.6 +2 -2
+ NTP_4_2_7P190
+
+ChangeSet@1.2592, 2011-07-12 22:11:22-04:00, stenn@deacon.udel.edu
+ Require autogen-5.12
+
+ ChangeLog@1.957 +2 -0
+ Require autogen-5.12
+
+ sntp/include/autogen-version.def@1.8 +1 -1
+ Require autogen-5.12
+
+ChangeSet@1.2082.4.219, 2011-07-12 21:46:20-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1961] html2man update: distribute ntp-wait.html
+
+ ChangeLog@1.496.26.154 +4 -0
+ [Bug 1961] html2man update: distribute ntp-wait.html
+
+ html/ntp-wait.html@1.1 +30 -0
+ BitKeeper file /home/stenn/ntp-stable/html/ntp-wait.html
+
+ html/ntp-wait.html@1.0 +0 -0
+
+ChangeSet@1.2590, 2011-07-11 06:29:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P189
+ TAG: NTP_4_2_7P189
+
+ ChangeLog@1.955 +1 -0
+ NTP_4_2_7P189
+
+ ntpd/ntpd-opts.c@1.194 +3 -3
+ NTP_4_2_7P189
+
+ ntpd/ntpd-opts.h@1.194 +3 -3
+ NTP_4_2_7P189
+
+ ntpd/ntpd-opts.texi@1.192 +2 -2
+ NTP_4_2_7P189
+
+ ntpd/ntpd.1ntpdman@1.5 +4 -5
+ NTP_4_2_7P189
+
+ ntpd/ntpd.1ntpdmdoc@1.5 +4 -5
+ NTP_4_2_7P189
+
+ ntpd/ntpd.man.in@1.5 +4 -5
+ NTP_4_2_7P189
+
+ ntpd/ntpd.mdoc.in@1.5 +4 -5
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc-opts.c@1.189 +3 -3
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc-opts.h@1.189 +3 -3
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc-opts.texi@1.189 +2 -2
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc.1ntpdcman@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.5 +3 -3
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc.html@1.17 +2 -2
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc.man.in@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpdc/ntpdc.mdoc.in@1.5 +3 -3
+ NTP_4_2_7P189
+
+ ntpq/ntpq-opts.c@1.191 +3 -3
+ NTP_4_2_7P189
+
+ ntpq/ntpq-opts.h@1.191 +3 -3
+ NTP_4_2_7P189
+
+ ntpq/ntpq-opts.texi@1.191 +2 -2
+ NTP_4_2_7P189
+
+ ntpq/ntpq.1ntpqman@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpq/ntpq.1ntpqmdoc@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpq/ntpq.man.in@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpq/ntpq.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.191 +3 -3
+ NTP_4_2_7P189
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.191 +3 -3
+ NTP_4_2_7P189
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.191 +2 -2
+ NTP_4_2_7P189
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpsnmpd/ntpsnmpd.man.in@1.5 +2 -2
+ NTP_4_2_7P189
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P189
+
+ packageinfo.sh@1.192 +1 -1
+ NTP_4_2_7P189
+
+ scripts/ntp-wait-opts.texi@1.9 +1 -1
+ NTP_4_2_7P189
+
+ scripts/ntp-wait.1ntp-waitman@1.5 +2 -2
+ NTP_4_2_7P189
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.5 +2 -2
+ NTP_4_2_7P189
+
+ scripts/ntp-wait.html@1.9 +1 -1
+ NTP_4_2_7P189
+
+ scripts/ntp-wait.man.in@1.5 +2 -2
+ NTP_4_2_7P189
+
+ scripts/ntp-wait.mdoc.in@1.5 +2 -2
+ NTP_4_2_7P189
+
+ sntp/sntp-opts.c@1.185 +3 -3
+ NTP_4_2_7P189
+
+ sntp/sntp-opts.h@1.185 +3 -3
+ NTP_4_2_7P189
+
+ sntp/sntp-opts.texi@1.185 +2 -2
+ NTP_4_2_7P189
+
+ sntp/sntp.1sntpman@1.5 +3 -3
+ NTP_4_2_7P189
+
+ sntp/sntp.1sntpmdoc@1.5 +3 -3
+ NTP_4_2_7P189
+
+ sntp/sntp.html@1.185 +2 -2
+ NTP_4_2_7P189
+
+ sntp/sntp.man.in@1.5 +3 -3
+ NTP_4_2_7P189
+
+ sntp/sntp.mdoc.in@1.5 +3 -3
+ NTP_4_2_7P189
+
+ util/ntp-keygen-opts.c@1.189 +3 -3
+ NTP_4_2_7P189
+
+ util/ntp-keygen-opts.h@1.189 +3 -3
+ NTP_4_2_7P189
+
+ util/ntp-keygen-opts.texi@1.192 +2 -2
+ NTP_4_2_7P189
+
+ util/ntp-keygen.1ntp-keygenman@1.5 +4 -5
+ NTP_4_2_7P189
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.5 +4 -5
+ NTP_4_2_7P189
+
+ util/ntp-keygen.man.in@1.5 +4 -5
+ NTP_4_2_7P189
+
+ util/ntp-keygen.mdoc.in@1.5 +4 -5
+ NTP_4_2_7P189
+
+ChangeSet@1.2082.4.218, 2011-07-10 23:03:48-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P4_RC1
+ TAG: NTP_4_2_6P4_RC1
+
+ ChangeLog@1.496.26.153 +1 -0
+ NTP_4_2_6P4_RC1
+
+ ntpd/ntpd-opts.c@1.248.37.1 +7 -9
+ NTP_4_2_6P4_RC1
+
+ ntpd/ntpd-opts.h@1.248.37.1 +9 -11
+ NTP_4_2_6P4_RC1
+
+ ntpd/ntpd-opts.texi@1.246.36.1 +3 -3
+ NTP_4_2_6P4_RC1
+
+ ntpd/ntpd.1@1.246.36.1 +2 -2
+ NTP_4_2_6P4_RC1
+
+ ntpdc/ntpdc-opts.c@1.244.37.1 +7 -9
+ NTP_4_2_6P4_RC1
+
+ ntpdc/ntpdc-opts.h@1.244.37.1 +9 -11
+ NTP_4_2_6P4_RC1
+
+ ntpdc/ntpdc-opts.texi@1.243.36.1 +3 -3
+ NTP_4_2_6P4_RC1
+
+ ntpdc/ntpdc.1@1.243.36.1 +2 -2
+ NTP_4_2_6P4_RC1
+
+ ntpq/ntpq-opts.c@1.245.37.1 +7 -9
+ NTP_4_2_6P4_RC1
+
+ ntpq/ntpq-opts.h@1.245.37.1 +9 -11
+ NTP_4_2_6P4_RC1
+
+ ntpq/ntpq-opts.texi@1.244.36.1 +3 -3
+ NTP_4_2_6P4_RC1
+
+ ntpq/ntpq.1@1.244.36.1 +2 -2
+ NTP_4_2_6P4_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.38.1 +7 -9
+ NTP_4_2_6P4_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.38.1 +9 -11
+ NTP_4_2_6P4_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.37.1 +3 -3
+ NTP_4_2_6P4_RC1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.37.1 +2 -2
+ NTP_4_2_6P4_RC1
+
+ packageinfo.sh@1.255.34.2 +1 -1
+ NTP_4_2_6P4_RC1
+
+ sntp/sntp-opts.c@1.117.35.1 +7 -9
+ NTP_4_2_6P4_RC1
+
+ sntp/sntp-opts.h@1.117.35.1 +9 -11
+ NTP_4_2_6P4_RC1
+
+ sntp/sntp-opts.texi@1.117.34.1 +3 -3
+ NTP_4_2_6P4_RC1
+
+ sntp/sntp.1@1.117.34.1 +2 -2
+ NTP_4_2_6P4_RC1
+
+ sntp/sntp.html@1.7.35.1 +3 -3
+ NTP_4_2_6P4_RC1
+
+ util/ntp-keygen-opts.c@1.247.37.1 +7 -9
+ NTP_4_2_6P4_RC1
+
+ util/ntp-keygen-opts.h@1.247.37.1 +9 -11
+ NTP_4_2_6P4_RC1
+
+ util/ntp-keygen-opts.texi@1.246.36.1 +3 -3
+ NTP_4_2_6P4_RC1
+
+ util/ntp-keygen.1@1.246.36.1 +2 -2
+ NTP_4_2_6P4_RC1
+
+ChangeSet@1.2082.4.217, 2011-07-10 22:14:53-04:00, stenn@deacon.udel.edu
+ 4.2.6p4-RC1
+
+ packageinfo.sh@1.255.34.1 +1 -1
+ 4.2.6p4-RC1
+
+ChangeSet@1.2082.4.216, 2011-07-10 17:51:34-04:00, stenn@deacon.udel.edu
+ Update the NEWS file
+
+ ChangeLog@1.496.26.152 +1 -0
+ Update the NEWS file
+
+ NEWS@1.118 +39 -0
+ Update the NEWS file
+
+ChangeSet@1.2082.4.215, 2011-07-10 08:02:44-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1961] html2man needs an update
+
+ ChangeLog@1.496.26.151 +1 -0
+ [Bug 1961] html2man needs an update
+
+ html/authopt.html@1.60.1.1 +1 -5
+ [Bug 1961] html2man needs an update
+
+ html/keygen.html@1.19.1.1 +1 -0
+ [Bug 1961] html2man needs an update
+
+ html/ntpd.html@1.51.1.1 +12 -4
+ [Bug 1961] html2man needs an update
+
+ html/ntpdate.html@1.18.1.1 +6 -6
+ [Bug 1961] html2man needs an update
+
+ html/ntpdc.html@1.30.1.1 +10 -8
+ [Bug 1961] html2man needs an update
+
+ html/ntpq.html@1.36.1.2 +2 -2
+ [Bug 1961] html2man needs an update
+
+ html/ntptrace.html@1.14.1.1 +2 -10
+ [Bug 1961] html2man needs an update
+
+ html/tickadj.html@1.15.1.1 +3 -1
+ [Bug 1961] html2man needs an update
+
+ scripts/html2man.in@1.6 +99 -37
+ [Bug 1961] html2man needs an update
+
+ChangeSet@1.2082.4.214, 2011-07-10 07:34:24-04:00, stenn@deacon.udel.edu
+ [Bug 1790] Update config.guess and config.sub to detect AIX6
+
+ ChangeLog@1.496.26.150 +1 -0
+ [Bug 1790] Update config.guess and config.sub to detect AIX6
+
+ChangeSet@1.2082.4.213, 2011-07-05 03:39:02-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1134] ntpd fails binding to tentative IPv6 addresses
+
+ ChangeLog@1.496.26.149 +4 -0
+ [Bug 1134] ntpd fails binding to tentative IPv6 addresses
+
+ lib/isc/unix/interfaceiter.c@1.19.1.1 +11 -0
+ [Bug 1134] ntpd fails binding to tentative IPv6 addresses
+
+ChangeSet@1.2587, 2011-06-28 07:07:51+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P188
+ TAG: NTP_4_2_7P188
+
+ ChangeLog@1.952 +1 -0
+ NTP_4_2_7P188
+
+ ntpd/ntpd-opts.c@1.193 +3 -3
+ NTP_4_2_7P188
+
+ ntpd/ntpd-opts.h@1.193 +3 -3
+ NTP_4_2_7P188
+
+ ntpd/ntpd-opts.texi@1.191 +2 -2
+ NTP_4_2_7P188
+
+ ntpd/ntpd.1ntpdman@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpd/ntpd.1ntpdmdoc@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpd/ntpd.man.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpd/ntpd.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc-opts.c@1.188 +3 -3
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc-opts.h@1.188 +3 -3
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc-opts.texi@1.188 +2 -2
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc.1ntpdcman@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc.html@1.16 +2 -2
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc.man.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpdc/ntpdc.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpq/ntpq-opts.c@1.190 +3 -3
+ NTP_4_2_7P188
+
+ ntpq/ntpq-opts.h@1.190 +3 -3
+ NTP_4_2_7P188
+
+ ntpq/ntpq-opts.texi@1.190 +2 -2
+ NTP_4_2_7P188
+
+ ntpq/ntpq.1ntpqman@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpq/ntpq.1ntpqmdoc@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpq/ntpq.man.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpq/ntpq.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.190 +3 -3
+ NTP_4_2_7P188
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.190 +3 -3
+ NTP_4_2_7P188
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.190 +2 -2
+ NTP_4_2_7P188
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpsnmpd/ntpsnmpd.man.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ packageinfo.sh@1.191 +1 -1
+ NTP_4_2_7P188
+
+ scripts/ntp-wait-opts.texi@1.8 +14 -2
+ NTP_4_2_7P188
+
+ scripts/ntp-wait.1ntp-waitman@1.4 +2 -2
+ NTP_4_2_7P188
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.4 +2 -2
+ NTP_4_2_7P188
+
+ scripts/ntp-wait.html@1.8 +14 -2
+ NTP_4_2_7P188
+
+ scripts/ntp-wait.man.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ scripts/ntp-wait.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ sntp/sntp-opts.c@1.184 +3 -3
+ NTP_4_2_7P188
+
+ sntp/sntp-opts.h@1.184 +3 -3
+ NTP_4_2_7P188
+
+ sntp/sntp-opts.texi@1.184 +2 -2
+ NTP_4_2_7P188
+
+ sntp/sntp.1sntpman@1.4 +2 -2
+ NTP_4_2_7P188
+
+ sntp/sntp.1sntpmdoc@1.4 +2 -2
+ NTP_4_2_7P188
+
+ sntp/sntp.html@1.184 +2 -2
+ NTP_4_2_7P188
+
+ sntp/sntp.man.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ sntp/sntp.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ util/ntp-keygen-opts.c@1.188 +3 -3
+ NTP_4_2_7P188
+
+ util/ntp-keygen-opts.h@1.188 +3 -3
+ NTP_4_2_7P188
+
+ util/ntp-keygen-opts.texi@1.191 +2 -2
+ NTP_4_2_7P188
+
+ util/ntp-keygen.1ntp-keygenman@1.4 +2 -2
+ NTP_4_2_7P188
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.4 +2 -2
+ NTP_4_2_7P188
+
+ util/ntp-keygen.man.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ util/ntp-keygen.mdoc.in@1.4 +2 -2
+ NTP_4_2_7P188
+
+ChangeSet@1.2586, 2011-06-27 22:31:27-07:00, harlan@hms-mbp.local
+ ntp-wait: some versions of ntpd spell "associd" differently
+
+ ChangeLog@1.951 +1 -0
+ ntp-wait: some versions of ntpd spell "associd" differently
+
+ scripts/ntp-wait.in@1.7 +1 -1
+ ntp-wait: some versions of ntpd spell "associd" differently
+
+ChangeSet@1.2585, 2011-06-27 22:30:17-07:00, harlan@hms-mbp.local
+ [Bug 1958] genLocInfo must export PATH
+
+ ChangeLog@1.950 +1 -0
+ [Bug 1958] genLocInfo must export PATH
+
+ scripts/genLocInfo@1.10 +1 -0
+ [Bug 1958] genLocInfo must export PATH
+
+ChangeSet@1.2584, 2011-06-24 08:03:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P187
+ TAG: NTP_4_2_7P187
+
+ ChangeLog@1.949 +1 -0
+ NTP_4_2_7P187
+
+ ntpd/ntpd-opts.c@1.192 +3 -3
+ NTP_4_2_7P187
+
+ ntpd/ntpd-opts.h@1.192 +3 -3
+ NTP_4_2_7P187
+
+ ntpd/ntpd-opts.texi@1.190 +2 -2
+ NTP_4_2_7P187
+
+ ntpd/ntpd.1ntpdman@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpd/ntpd.1ntpdmdoc@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpd/ntpd.man.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpd/ntpd.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc-opts.c@1.187 +3 -3
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc-opts.h@1.187 +3 -3
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc-opts.texi@1.187 +2 -2
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc.1ntpdcman@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc.html@1.15 +2 -2
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc.man.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpdc/ntpdc.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpq/ntpq-opts.c@1.189 +3 -3
+ NTP_4_2_7P187
+
+ ntpq/ntpq-opts.h@1.189 +3 -3
+ NTP_4_2_7P187
+
+ ntpq/ntpq-opts.texi@1.189 +2 -2
+ NTP_4_2_7P187
+
+ ntpq/ntpq.1ntpqman@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpq/ntpq.1ntpqmdoc@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpq/ntpq.man.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpq/ntpq.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.189 +3 -3
+ NTP_4_2_7P187
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.189 +3 -3
+ NTP_4_2_7P187
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.189 +2 -2
+ NTP_4_2_7P187
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpsnmpd/ntpsnmpd.man.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ packageinfo.sh@1.190 +1 -1
+ NTP_4_2_7P187
+
+ scripts/ntp-wait-opts.texi@1.7 +1 -1
+ NTP_4_2_7P187
+
+ scripts/ntp-wait.1ntp-waitman@1.3 +2 -2
+ NTP_4_2_7P187
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.3 +2 -2
+ NTP_4_2_7P187
+
+ scripts/ntp-wait.html@1.7 +1 -1
+ NTP_4_2_7P187
+
+ scripts/ntp-wait.man.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ scripts/ntp-wait.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ sntp/sntp-opts.c@1.183 +3 -3
+ NTP_4_2_7P187
+
+ sntp/sntp-opts.h@1.183 +3 -3
+ NTP_4_2_7P187
+
+ sntp/sntp-opts.texi@1.183 +2 -2
+ NTP_4_2_7P187
+
+ sntp/sntp.1sntpman@1.3 +2 -2
+ NTP_4_2_7P187
+
+ sntp/sntp.1sntpmdoc@1.3 +2 -2
+ NTP_4_2_7P187
+
+ sntp/sntp.html@1.183 +2 -2
+ NTP_4_2_7P187
+
+ sntp/sntp.man.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ sntp/sntp.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ util/ntp-keygen-opts.c@1.187 +3 -3
+ NTP_4_2_7P187
+
+ util/ntp-keygen-opts.h@1.187 +3 -3
+ NTP_4_2_7P187
+
+ util/ntp-keygen-opts.texi@1.190 +2 -2
+ NTP_4_2_7P187
+
+ util/ntp-keygen.1ntp-keygenman@1.3 +2 -2
+ NTP_4_2_7P187
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.3 +2 -2
+ NTP_4_2_7P187
+
+ util/ntp-keygen.man.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ util/ntp-keygen.mdoc.in@1.3 +2 -2
+ NTP_4_2_7P187
+
+ChangeSet@1.2583, 2011-06-24 03:02:21-04:00, stenn@deacon.udel.edu
+ Implement --with-locfile=filename configure argument
+
+ ChangeLog@1.948 +4 -0
+ Implement --with-locfile=filename configure argument
+
+ scripts/genLocInfo@1.9 +71 -50
+ Implement --with-locfile=filename configure argument
+
+ sntp/m4/ntp_locinfo.m4@1.9 +13 -1
+ Implement --with-locfile=filename configure argument
+
+ChangeSet@1.2582, 2011-06-24 02:52:59-04:00, stenn@deacon.udel.edu
+ [Bug 1954] Fix typos in [s]bin_PROGRAMS in ntpd/Makefile.am
+
+ ChangeLog@1.947 +1 -1
+ [Bug 1954] Fix typos in [s]bin_PROGRAMS in ntpd/Makefile.am
+
+ChangeSet@1.2581, 2011-06-24 01:25:47-04:00, stenn@deacon.udel.edu
+ Fix typos in [s]bin_PROGRAMS in ntpd/Makefile.am
+
+ ChangeLog@1.946 +1 -0
+ Fix typos in [s]bin_PROGRAMS in ntpd/Makefile.am
+
+ ntpd/Makefile.am@1.108 +2 -2
+ Fix typos in [s]bin_PROGRAMS in ntpd/Makefile.am
+
+ChangeSet@1.2580, 2011-06-23 11:29:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P186
+ TAG: NTP_4_2_7P186
+
+ ChangeLog@1.945 +1 -0
+ NTP_4_2_7P186
+
+ ntpd/ntpd-opts.c@1.191 +3 -3
+ NTP_4_2_7P186
+
+ ntpd/ntpd-opts.h@1.191 +3 -3
+ NTP_4_2_7P186
+
+ ntpd/ntpd-opts.texi@1.189 +1 -1
+ NTP_4_2_7P186
+
+ ntpd/ntpd.1ntpdman@1.2 +2 -2
+ NTP_4_2_7P186
+
+ ntpd/ntpd.1ntpdmdoc@1.2 +3 -3
+ NTP_4_2_7P186
+
+ ntpd/ntpd.man.in@1.2 +2 -2
+ NTP_4_2_7P186
+
+ ntpd/ntpd.mdoc.in@1.2 +3 -3
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc-opts.c@1.186 +3 -3
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc-opts.h@1.186 +3 -3
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc-opts.texi@1.186 +2 -2
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc.1ntpdcman@1.2 +3 -31
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.2 +3 -3
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc.html@1.14 +2 -2
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc.man.in@1.2 +3 -31
+ NTP_4_2_7P186
+
+ ntpdc/ntpdc.mdoc.in@1.2 +3 -3
+ NTP_4_2_7P186
+
+ ntpq/ntpq-opts.c@1.188 +3 -3
+ NTP_4_2_7P186
+
+ ntpq/ntpq-opts.h@1.188 +3 -3
+ NTP_4_2_7P186
+
+ ntpq/ntpq-opts.texi@1.188 +2 -2
+ NTP_4_2_7P186
+
+ ntpq/ntpq.1ntpqman@1.2 +2 -2
+ NTP_4_2_7P186
+
+ ntpq/ntpq.1ntpqmdoc@1.2 +3 -3
+ NTP_4_2_7P186
+
+ ntpq/ntpq.man.in@1.2 +2 -2
+ NTP_4_2_7P186
+
+ ntpq/ntpq.mdoc.in@1.2 +3 -3
+ NTP_4_2_7P186
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.188 +3 -3
+ NTP_4_2_7P186
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.188 +3 -3
+ NTP_4_2_7P186
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.188 +2 -2
+ NTP_4_2_7P186
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.2 +2 -2
+ NTP_4_2_7P186
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.2 +3 -3
+ NTP_4_2_7P186
+
+ ntpsnmpd/ntpsnmpd.man.in@1.2 +2 -2
+ NTP_4_2_7P186
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.2 +3 -3
+ NTP_4_2_7P186
+
+ packageinfo.sh@1.189 +1 -1
+ NTP_4_2_7P186
+
+ scripts/ntp-wait-opts.texi@1.6 +1 -1
+ NTP_4_2_7P186
+
+ scripts/ntp-wait.1ntp-waitman@1.2 +2 -2
+ NTP_4_2_7P186
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.2 +3 -3
+ NTP_4_2_7P186
+
+ scripts/ntp-wait.html@1.6 +1 -1
+ NTP_4_2_7P186
+
+ scripts/ntp-wait.man.in@1.2 +2 -2
+ NTP_4_2_7P186
+
+ scripts/ntp-wait.mdoc.in@1.2 +3 -3
+ NTP_4_2_7P186
+
+ sntp/sntp-opts.c@1.182 +3 -3
+ NTP_4_2_7P186
+
+ sntp/sntp-opts.h@1.182 +3 -3
+ NTP_4_2_7P186
+
+ sntp/sntp-opts.texi@1.182 +2 -2
+ NTP_4_2_7P186
+
+ sntp/sntp.1sntpman@1.2 +2 -2
+ NTP_4_2_7P186
+
+ sntp/sntp.1sntpmdoc@1.2 +3 -3
+ NTP_4_2_7P186
+
+ sntp/sntp.html@1.182 +2 -2
+ NTP_4_2_7P186
+
+ sntp/sntp.man.in@1.2 +2 -2
+ NTP_4_2_7P186
+
+ sntp/sntp.mdoc.in@1.2 +3 -3
+ NTP_4_2_7P186
+
+ util/ntp-keygen-opts.c@1.186 +3 -3
+ NTP_4_2_7P186
+
+ util/ntp-keygen-opts.h@1.186 +3 -3
+ NTP_4_2_7P186
+
+ util/ntp-keygen-opts.texi@1.189 +2 -2
+ NTP_4_2_7P186
+
+ util/ntp-keygen.1ntp-keygenman@1.2 +2 -2
+ NTP_4_2_7P186
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.2 +3 -3
+ NTP_4_2_7P186
+
+ util/ntp-keygen.man.in@1.2 +2 -2
+ NTP_4_2_7P186
+
+ util/ntp-keygen.mdoc.in@1.2 +3 -3
+ NTP_4_2_7P186
+
+ChangeSet@1.2577.1.1, 2011-06-23 03:27:04-04:00, stenn@psp-deb1.ntp.org
+ Update .point-changed-filelist for the new man pages
+
+ .point-changed-filelist@1.13 +25 -7
+ Update .point-changed-filelist for the new man pages
+
+ ChangeLog@1.942.1.1 +1 -0
+ Update .point-changed-filelist for the new man pages
+
+ChangeSet@1.2578, 2011-06-23 02:47:56-04:00, stenn@deacon.udel.edu
+ Documentation update from Dave Mills
+
+ ChangeLog@1.943 +2 -1
+ Documentation update from Dave Mills
+
+ html/warp.html@1.15 +11 -3
+ Documentation update from Dave Mills
+
+ChangeSet@1.2577, 2011-06-23 02:42:14-04:00, stenn@psp-deb1.ntp.org
+ merge cleanup
+
+ ChangeLog@1.942 +1 -2
+ merge cleanup
+
+ChangeSet@1.2574.1.6, 2011-06-23 02:16:14-04:00, stenn@psp-deb1.ntp.org
+ Update the building of OS-specific programs
+
+ ChangeLog@1.939.1.3 +1 -0
+ Update the building of OS-specific programs
+
+ configure.ac@1.530 +25 -2
+ Update the building of OS-specific programs
+
+ChangeSet@1.2574.1.5, 2011-06-22 23:14:06-04:00, stenn@psp-deb1.ntp.org
+ generated man page updates
+
+ bootstrap@1.39 +1 -1
+ generated man page updates
+
+ ntpd/ntpd.1ntpdman@1.1 +909 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpd/ntpd.1ntpdman
+
+ ntpd/ntpd.1ntpdman@1.0 +0 -0
+
+ ntpd/ntpd.1ntpdmdoc@1.1 +878 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpd/ntpd.1ntpdmdoc
+
+ ntpd/ntpd.1ntpdmdoc@1.0 +0 -0
+
+ ntpd/ntpd.man.in@1.1 +909 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpd/ntpd.man.in
+
+ ntpd/ntpd.man.in@1.0 +0 -0
+
+ ntpd/ntpd.mdoc.in@1.1 +878 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpd/ntpd.mdoc.in
+
+ ntpd/ntpd.mdoc.in@1.0 +0 -0
+
+ ntpdc/ntpdc.1ntpdcman@1.1 +569 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpdc/ntpdc.1ntpdcman
+
+ ntpdc/ntpdc.1ntpdcman@1.0 +0 -0
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.1 +793 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpdc/ntpdc.1ntpdcmdoc
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.0 +0 -0
+
+ ntpdc/ntpdc.man.in@1.1 +569 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpdc/ntpdc.man.in
+
+ ntpdc/ntpdc.man.in@1.0 +0 -0
+
+ ntpdc/ntpdc.mdoc.in@1.1 +793 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpdc/ntpdc.mdoc.in
+
+ ntpdc/ntpdc.mdoc.in@1.0 +0 -0
+
+ ntpq/ntpq.1ntpqman@1.1 +397 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpq/ntpq.1ntpqman
+
+ ntpq/ntpq.1ntpqman@1.0 +0 -0
+
+ ntpq/ntpq.1ntpqmdoc@1.1 +375 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpq/ntpq.1ntpqmdoc
+
+ ntpq/ntpq.1ntpqmdoc@1.0 +0 -0
+
+ ntpq/ntpq.man.in@1.1 +397 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpq/ntpq.man.in
+
+ ntpq/ntpq.man.in@1.0 +0 -0
+
+ ntpq/ntpq.mdoc.in@1.1 +375 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpq/ntpq.mdoc.in
+
+ ntpq/ntpq.mdoc.in@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.1 +92 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.1 +89 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.man.in@1.1 +92 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpsnmpd/ntpsnmpd.man.in
+
+ ntpsnmpd/ntpsnmpd.man.in@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.1 +89 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpsnmpd/ntpsnmpd.mdoc.in
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.0 +0 -0
+
+ scripts/ntp-wait.1ntp-waitman@1.1 +93 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait.1ntp-waitman
+
+ scripts/ntp-wait.1ntp-waitman@1.0 +0 -0
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.1 +92 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait.1ntp-waitmdoc
+
+ scripts/ntp-wait.1ntp-waitmdoc@1.0 +0 -0
+
+ scripts/ntp-wait.man.in@1.1 +93 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait.man.in
+
+ scripts/ntp-wait.man.in@1.0 +0 -0
+
+ scripts/ntp-wait.mdoc.in@1.1 +92 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait.mdoc.in
+
+ scripts/ntp-wait.mdoc.in@1.0 +0 -0
+
+ sntp/include/mansec2subst.sed@1.1 +26 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/include/mansec2subst.sed
+
+ sntp/include/mansec2subst.sed@1.0 +0 -0
+
+ sntp/sntp.1sntpman@1.1 +293 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/sntp.1sntpman
+
+ sntp/sntp.1sntpman@1.0 +0 -0
+
+ sntp/sntp.1sntpmdoc@1.1 +275 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/sntp.1sntpmdoc
+
+ sntp/sntp.1sntpmdoc@1.0 +0 -0
+
+ sntp/sntp.man.in@1.1 +293 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/sntp.man.in
+
+ sntp/sntp.man.in@1.0 +0 -0
+
+ sntp/sntp.mdoc.in@1.1 +275 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/sntp.mdoc.in
+
+ sntp/sntp.mdoc.in@1.0 +0 -0
+
+ util/ntp-keygen.1ntp-keygenman@1.1 +917 -0
+ BitKeeper file /home/stenn/ntp-dev/util/ntp-keygen.1ntp-keygenman
+
+ util/ntp-keygen.1ntp-keygenman@1.0 +0 -0
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.1 +884 -0
+ BitKeeper file /home/stenn/ntp-dev/util/ntp-keygen.1ntp-keygenmdoc
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.0 +0 -0
+
+ util/ntp-keygen.man.in@1.1 +917 -0
+ BitKeeper file /home/stenn/ntp-dev/util/ntp-keygen.man.in
+
+ util/ntp-keygen.man.in@1.0 +0 -0
+
+ util/ntp-keygen.mdoc.in@1.1 +884 -0
+ BitKeeper file /home/stenn/ntp-dev/util/ntp-keygen.mdoc.in
+
+ util/ntp-keygen.mdoc.in@1.0 +0 -0
+
+ChangeSet@1.2574.1.4, 2011-06-22 22:57:47-04:00, stenn@psp-deb1.ntp.org
+ Work around solaris /bin/sh braindamage
+
+ scripts/genLocInfo@1.8 +2 -12
+ Work around solaris /bin/sh braindamage
+
+ChangeSet@1.2574.1.3, 2011-06-22 22:57:21-04:00, stenn@psp-deb1.ntp.org
+ Do not ignore generated man pages
+
+ BitKeeper/etc/ignore@1.83 +0 -4
+ Do not ignore generated man pages
+
+ChangeSet@1.2574.1.2, 2011-06-22 20:18:20-04:00, stenn@psp-deb1.ntp.org
+ validate MANTAGFMT in genLocInfo
+
+ ChangeLog@1.939.1.2 +1 -0
+ validate MANTAGFMT in genLocInfo
+
+ scripts/genLocInfo@1.7 +9 -1
+ validate MANTAGFMT in genLocInfo
+
+ChangeSet@1.2573.1.4, 2011-06-22 18:49:43-04:00, stenn@psp-deb1.ntp.org
+ Finish conversion to genLocInfo.
+
+ .point-changed-filelist@1.12 +4 -1
+ Finish conversion to genLocInfo.
+
+ BitKeeper/deleted/10/ntp-wait.1~5aa615f3f31c2873@1.4.1.1 +0 -0
+ Delete: scripts/ntp-wait.1
+
+ BitKeeper/deleted/1d/ntp-keygen.1~ef7a6b66bc6794e8@1.187.1.1 +0 -0
+ Delete: util/ntp-keygen.1
+
+ BitKeeper/deleted/4d/sntp.1~9b6f13948b8b0ead@1.181 +0 -0
+ Delete: sntp/sntp.1
+
+ BitKeeper/deleted/70/ntpdsim.1~916fd6f22320fcad@1.16 +0 -0
+ Delete: ntpd/ntpdsim.1
+
+ BitKeeper/deleted/a7/ntpdc.1~1dd38e607d4b7e9a@1.184.1.1 +0 -0
+ Delete: ntpdc/ntpdc.1
+
+ BitKeeper/deleted/ac/ntpd.1~e95786c25d7ce6ae@1.187.1.1 +0 -0
+ Delete: ntpd/ntpd.1
+
+ BitKeeper/deleted/ad/ntpq.1~b5913739d03602e2@1.186.1.1 +0 -0
+ Delete: ntpq/ntpq.1
+
+ BitKeeper/deleted/e5/ntpsnmpd.1~14083c7c951dc39f@1.186.1.1 +0 -0
+ Delete: ntpsnmpd/ntpsnmpd.1
+
+ BitKeeper/etc/ignore@1.82 +5 -0
+ Finish conversion to genLocInfo.
+
+ ChangeLog@1.938.1.3 +1 -0
+ Finish conversion to genLocInfo.
+
+ Makefile.am@1.112 +1 -2
+ Finish conversion to genLocInfo.
+
+ adjtimed/Makefile.am@1.13 +2 -5
+ Finish conversion to genLocInfo.
+
+ bincheck.mf@1.4 +9 -7
+ Finish conversion to genLocInfo.
+
+ configure.ac@1.529 +26 -0
+ Finish conversion to genLocInfo.
+
+ loc/freebsd@1.3 +0 -0
+ Rename: loc.freebsd -> loc/freebsd
+
+ loc/legacy@1.3 +0 -0
+ Rename: loc.legacy -> loc/legacy
+
+ ntpd/Makefile.am@1.107 +45 -13
+ Finish conversion to genLocInfo.
+
+ ntpdate/Makefile.am@1.31 +3 -6
+ Finish conversion to genLocInfo.
+
+ ntpdc/Makefile.am@1.64 +38 -15
+ Finish conversion to genLocInfo.
+
+ ntpq/Makefile.am@1.60 +49 -15
+ Finish conversion to genLocInfo.
+
+ ntpsnmpd/Makefile.am@1.31 +50 -13
+ Finish conversion to genLocInfo.
+
+ scripts/Makefile.am@1.27 +42 -13
+ Finish conversion to genLocInfo.
+
+ scripts/genLocInfo@1.6 +7 -5
+ Finish conversion to genLocInfo.
+
+ sntp/Makefile.am@1.64 +39 -12
+ Finish conversion to genLocInfo.
+
+ sntp/configure.ac@1.62 +97 -0
+ Finish conversion to genLocInfo.
+
+ sntp/include/Makefile.am@1.3 +1 -0
+ Finish conversion to genLocInfo.
+
+ sntp/m4/ntp_libntp.m4@1.15 +0 -1
+ Finish conversion to genLocInfo.
+
+ sntp/m4/ntp_locinfo.m4@1.5.1.3 +2 -1
+ Finish conversion to genLocInfo.
+
+ sntp/sntp-opts.def@1.33 +1 -1
+ Finish conversion to genLocInfo.
+
+ util/Makefile.am@1.63 +54 -19
+ Finish conversion to genLocInfo.
+
+ChangeSet@1.2575, 2011-06-21 11:29:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P185
+ TAG: NTP_4_2_7P185
+
+ ChangeLog@1.940 +1 -0
+ NTP_4_2_7P185
+
+ ntpd/ntpd-opts.c@1.190 +3 -3
+ NTP_4_2_7P185
+
+ ntpd/ntpd-opts.h@1.190 +3 -3
+ NTP_4_2_7P185
+
+ ntpd/ntpd-opts.texi@1.188 +2 -2
+ NTP_4_2_7P185
+
+ ntpd/ntpd.1@1.188 +2 -2
+ NTP_4_2_7P185
+
+ ntpdc/ntpdc-opts.c@1.185 +3 -3
+ NTP_4_2_7P185
+
+ ntpdc/ntpdc-opts.h@1.185 +3 -3
+ NTP_4_2_7P185
+
+ ntpdc/ntpdc-opts.texi@1.185 +2 -2
+ NTP_4_2_7P185
+
+ ntpdc/ntpdc.1@1.185 +2 -2
+ NTP_4_2_7P185
+
+ ntpdc/ntpdc.html@1.13 +2 -2
+ NTP_4_2_7P185
+
+ ntpq/ntpq-opts.c@1.187 +3 -3
+ NTP_4_2_7P185
+
+ ntpq/ntpq-opts.h@1.187 +3 -3
+ NTP_4_2_7P185
+
+ ntpq/ntpq-opts.texi@1.187 +2 -2
+ NTP_4_2_7P185
+
+ ntpq/ntpq.1@1.187 +2 -2
+ NTP_4_2_7P185
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.187 +3 -3
+ NTP_4_2_7P185
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.187 +3 -3
+ NTP_4_2_7P185
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.187 +2 -2
+ NTP_4_2_7P185
+
+ ntpsnmpd/ntpsnmpd.1@1.187 +2 -2
+ NTP_4_2_7P185
+
+ packageinfo.sh@1.188 +1 -1
+ NTP_4_2_7P185
+
+ scripts/ntp-wait-opts.texi@1.5 +1 -1
+ NTP_4_2_7P185
+
+ scripts/ntp-wait.1@1.5 +2 -2
+ NTP_4_2_7P185
+
+ scripts/ntp-wait.html@1.5 +1 -1
+ NTP_4_2_7P185
+
+ sntp/sntp-opts.c@1.181 +3 -3
+ NTP_4_2_7P185
+
+ sntp/sntp-opts.h@1.181 +3 -3
+ NTP_4_2_7P185
+
+ sntp/sntp-opts.texi@1.181 +2 -2
+ NTP_4_2_7P185
+
+ sntp/sntp.1@1.180.1.1 +2 -2
+ NTP_4_2_7P185
+
+ sntp/sntp.html@1.181 +2 -2
+ NTP_4_2_7P185
+
+ util/ntp-keygen-opts.c@1.185 +3 -3
+ NTP_4_2_7P185
+
+ util/ntp-keygen-opts.h@1.185 +3 -3
+ NTP_4_2_7P185
+
+ util/ntp-keygen-opts.texi@1.188 +2 -2
+ NTP_4_2_7P185
+
+ util/ntp-keygen.1@1.188 +2 -2
+ NTP_4_2_7P185
+
+ChangeSet@1.2573.1.3, 2011-06-21 02:14:29-04:00, stenn@psp-deb1.ntp.org
+ Rename ntp_locs.m4 to ntp_locinfo.m4
+
+ sntp/m4/ntp_locinfo.m4@1.5.1.2 +0 -0
+ Rename: sntp/m4/ntp_locs.m4 -> sntp/m4/ntp_locinfo.m4
+
+ChangeSet@1.2573.1.2, 2011-06-21 02:09:40-04:00, stenn@psp-deb1.ntp.org
+ ntp_locs.m4: handle the case where . is not in the PATH
+
+ ChangeLog@1.938.1.2 +1 -0
+ ntp_locs.m4: handle the case where . is not in the PATH
+
+ sntp/m4/ntp_locs.m4@1.5.1.1 +1 -1
+ ntp_locs.m4: handle the case where . is not in the PATH
+
+ChangeSet@1.2573.1.1, 2011-06-21 01:58:35-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1950] Control installation of event_rpcgen.py
+
+ ChangeLog@1.938.1.1 +1 -0
+ [Bug 1950] Control installation of event_rpcgen.py
+
+ sntp/libevent/Makefile.am@1.7 +3 -0
+ [Bug 1950] Control installation of event_rpcgen.py
+
+ChangeSet@1.2574, 2011-06-20 18:50:41-04:00, stenn@deacon.udel.edu
+ . may not be in the PATH - ntp_locs.m4 fix
+
+ ChangeLog@1.939 +1 -0
+ . may not be in the PATH - ntp_locs.m4 fix
+
+ sntp/m4/ntp_locs.m4@1.6 +1 -1
+ . may not be in the PATH - ntp_locs.m4 fix
+
+ChangeSet@1.2573, 2011-06-20 07:02:17-04:00, stenn@psp-deb1.ntp.org
+ More genLocInfo cleanup
+
+ ChangeLog@1.938 +1 -0
+ More genLocInfo cleanup
+
+ configure.ac@1.528 +2 -0
+ More genLocInfo cleanup
+
+ scripts/genLocInfo@1.5 +1 -0
+ More genLocInfo cleanup
+
+ sntp/m4/ntp_locs.m4@1.5 +7 -1
+ More genLocInfo cleanup
+
+ChangeSet@1.2572, 2011-06-20 05:58:04-04:00, stenn@deacon.udel.edu
+ genLocInfo is EXTRA_DIST, not noinst_SCRIPT
+
+ scripts/Makefile.am@1.26 +1 -1
+ genLocInfo is EXTRA_DIST, not noinst_SCRIPT
+
+ChangeSet@1.2571, 2011-06-20 09:46:53+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P184
+ TAG: NTP_4_2_7P184
+
+ ChangeLog@1.937 +1 -0
+ NTP_4_2_7P184
+
+ ntpd/ntpd-opts.c@1.189 +3 -3
+ NTP_4_2_7P184
+
+ ntpd/ntpd-opts.h@1.189 +3 -3
+ NTP_4_2_7P184
+
+ ntpd/ntpd-opts.texi@1.187 +2 -2
+ NTP_4_2_7P184
+
+ ntpd/ntpd.1@1.187 +2 -2
+ NTP_4_2_7P184
+
+ ntpdc/ntpdc-opts.c@1.184 +3 -3
+ NTP_4_2_7P184
+
+ ntpdc/ntpdc-opts.h@1.184 +3 -3
+ NTP_4_2_7P184
+
+ ntpdc/ntpdc-opts.texi@1.184 +2 -2
+ NTP_4_2_7P184
+
+ ntpdc/ntpdc.1@1.184 +2 -2
+ NTP_4_2_7P184
+
+ ntpdc/ntpdc.html@1.12 +2 -2
+ NTP_4_2_7P184
+
+ ntpq/ntpq-opts.c@1.186 +3 -3
+ NTP_4_2_7P184
+
+ ntpq/ntpq-opts.h@1.186 +3 -3
+ NTP_4_2_7P184
+
+ ntpq/ntpq-opts.texi@1.186 +2 -2
+ NTP_4_2_7P184
+
+ ntpq/ntpq.1@1.186 +2 -2
+ NTP_4_2_7P184
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.186 +3 -3
+ NTP_4_2_7P184
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.186 +3 -3
+ NTP_4_2_7P184
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.186 +2 -2
+ NTP_4_2_7P184
+
+ ntpsnmpd/ntpsnmpd.1@1.186 +2 -2
+ NTP_4_2_7P184
+
+ packageinfo.sh@1.187 +1 -1
+ NTP_4_2_7P184
+
+ scripts/ntp-wait-opts.texi@1.4 +1 -1
+ NTP_4_2_7P184
+
+ scripts/ntp-wait.1@1.4 +2 -2
+ NTP_4_2_7P184
+
+ scripts/ntp-wait.html@1.4 +1 -1
+ NTP_4_2_7P184
+
+ sntp/sntp-opts.c@1.180 +3 -3
+ NTP_4_2_7P184
+
+ sntp/sntp-opts.h@1.180 +3 -3
+ NTP_4_2_7P184
+
+ sntp/sntp-opts.texi@1.180 +2 -2
+ NTP_4_2_7P184
+
+ sntp/sntp.1@1.180 +2 -2
+ NTP_4_2_7P184
+
+ sntp/sntp.html@1.180 +2 -2
+ NTP_4_2_7P184
+
+ util/ntp-keygen-opts.c@1.184 +3 -3
+ NTP_4_2_7P184
+
+ util/ntp-keygen-opts.h@1.184 +3 -3
+ NTP_4_2_7P184
+
+ util/ntp-keygen-opts.texi@1.187 +2 -2
+ NTP_4_2_7P184
+
+ util/ntp-keygen.1@1.187 +2 -2
+ NTP_4_2_7P184
+
+ChangeSet@1.2570, 2011-06-20 05:31:49-04:00, stenn@psp-deb1.ntp.org
+ genLocInfo cleanup
+
+ scripts/genLocInfo@1.4 +4 -0
+ genLocInfo cleanup
+
+ChangeSet@1.2569, 2011-06-20 05:24:55-04:00, stenn@psp-deb1.ntp.org
+ genLocInfo cleanup
+
+ sntp/m4/ntp_locs.m4@1.4 +2 -2
+ genLocInfo cleanup
+
+ChangeSet@1.2568, 2011-06-20 04:54:00-04:00, stenn@psp-deb1.ntp.org
+ genLocInfo cleanup
+
+ sntp/m4/ntp_locs.m4@1.3 +2 -1
+ genLocInfo cleanup
+
+ChangeSet@1.2567, 2011-06-20 03:58:19-04:00, stenn@psp-deb1.ntp.org
+ Updates to ntp_locs.m4
+
+ ChangeLog@1.936 +1 -0
+ Updates to ntp_locs.m4
+
+ sntp/m4/ntp_locs.m4@1.2 +1 -1
+ Updates to ntp_locs.m4
+
+ sntp/m4/ntp_locs.m4@1.1 +57 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/m4/ntp_locs.m4
+
+ sntp/m4/ntp_locs.m4@1.0 +0 -0
+
+ChangeSet@1.2566, 2011-06-20 02:08:50-04:00, stenn@psp-deb1.ntp.org
+ genLocInfo improvements
+
+ scripts/genLocInfo@1.3 +8 -3
+ genLocInfo improvements
+
+ChangeSet@1.2565, 2011-06-19 23:07:56-04:00, stenn@psp-deb1.ntp.org
+ genLocInfo improvements
+
+ ChangeLog@1.935 +1 -0
+ genLocInfo improvements
+
+ scripts/genLocInfo@1.2 +97 -12
+ genLocInfo improvements
+
+ChangeSet@1.2561.1.2, 2011-06-19 19:06:27-04:00, stenn@psp-deb1.ntp.org
+ Add the man page tag "flavor" to the loc.* files
+
+ ChangeLog@1.931.1.2 +1 -0
+ Add the man page tag "flavor" to the loc.* files
+
+ loc.freebsd@1.2 +1 -0
+ Add the man page tag "flavor" to the loc.* files
+
+ loc.legacy@1.2 +1 -0
+ Add the man page tag "flavor" to the loc.* files
+
+ChangeSet@1.2561.1.1, 2011-06-19 19:04:22-04:00, stenn@psp-deb1.ntp.org
+ Add/distribute genLocInfo
+
+ ChangeLog@1.931.1.1 +1 -0
+ Add/distribute genLocInfo
+
+ scripts/Makefile.am@1.23.1.1 +1 -0
+ Distribute genLocInfo
+
+ scripts/genLocInfo@1.1 +66 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/genLocInfo
+
+ scripts/genLocInfo@1.0 +0 -0
+
+ChangeSet@1.2563, 2011-06-19 22:34:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P183
+ TAG: NTP_4_2_7P183
+
+ ChangeLog@1.933 +1 -1
+ NTP_4_2_7P183
+
+ ntpd/ntpd-opts.c@1.188 +3 -3
+ NTP_4_2_7P183
+
+ ntpd/ntpd-opts.h@1.188 +3 -3
+ NTP_4_2_7P183
+
+ ntpd/ntpd-opts.texi@1.186 +2 -2
+ NTP_4_2_7P183
+
+ ntpd/ntpd.1@1.186 +2 -2
+ NTP_4_2_7P183
+
+ ntpdc/ntpdc-opts.c@1.183 +3 -3
+ NTP_4_2_7P183
+
+ ntpdc/ntpdc-opts.h@1.183 +3 -3
+ NTP_4_2_7P183
+
+ ntpdc/ntpdc-opts.texi@1.183 +2 -2
+ NTP_4_2_7P183
+
+ ntpdc/ntpdc.1@1.183 +2 -2
+ NTP_4_2_7P183
+
+ ntpdc/ntpdc.html@1.11 +2 -2
+ NTP_4_2_7P183
+
+ ntpq/ntpq-opts.c@1.185 +3 -3
+ NTP_4_2_7P183
+
+ ntpq/ntpq-opts.h@1.185 +3 -3
+ NTP_4_2_7P183
+
+ ntpq/ntpq-opts.texi@1.185 +2 -2
+ NTP_4_2_7P183
+
+ ntpq/ntpq.1@1.185 +2 -2
+ NTP_4_2_7P183
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.185 +3 -3
+ NTP_4_2_7P183
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.185 +3 -3
+ NTP_4_2_7P183
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.185 +2 -2
+ NTP_4_2_7P183
+
+ ntpsnmpd/ntpsnmpd.1@1.185 +2 -2
+ NTP_4_2_7P183
+
+ packageinfo.sh@1.186 +1 -1
+ NTP_4_2_7P183
+
+ scripts/ntp-wait-opts.texi@1.3 +1 -1
+ NTP_4_2_7P183
+
+ scripts/ntp-wait.1@1.3 +2 -2
+ NTP_4_2_7P183
+
+ scripts/ntp-wait.html@1.3 +1 -1
+ NTP_4_2_7P183
+
+ sntp/sntp-opts.c@1.179 +3 -3
+ NTP_4_2_7P183
+
+ sntp/sntp-opts.h@1.179 +3 -3
+ NTP_4_2_7P183
+
+ sntp/sntp-opts.texi@1.179 +2 -2
+ NTP_4_2_7P183
+
+ sntp/sntp.1@1.179 +2 -2
+ NTP_4_2_7P183
+
+ sntp/sntp.html@1.179 +2 -2
+ NTP_4_2_7P183
+
+ util/ntp-keygen-opts.c@1.183 +3 -3
+ NTP_4_2_7P183
+
+ util/ntp-keygen-opts.h@1.183 +3 -3
+ NTP_4_2_7P183
+
+ util/ntp-keygen-opts.texi@1.186 +2 -2
+ NTP_4_2_7P183
+
+ util/ntp-keygen.1@1.186 +2 -2
+ NTP_4_2_7P183
+
+ChangeSet@1.2562, 2011-06-19 18:17:53-04:00, stenn@deacon.udel.edu
+ Update the autogen include list for scripts/Makefile.am
+
+ ChangeLog@1.932 +2 -0
+ Update the autogen include list for scripts/Makefile.am
+
+ scripts/Makefile.am@1.24 +1 -1
+ Update the autogen include list for scripts/Makefile.am
+
+ChangeSet@1.2561, 2011-06-19 03:07:32-04:00, stenn@psp-deb1.ntp.org
+ Added loc.freebsd (and distribute it)
+
+ ChangeLog@1.931 +1 -0
+ Added loc.freebsd (and distribute it)
+
+ Makefile.am@1.111 +1 -0
+ Added loc.freebsd (and distribute it)
+
+ loc.freebsd@1.1 +12 -0
+ BitKeeper file /home/stenn/ntp-dev/loc.freebsd
+
+ loc.freebsd@1.0 +0 -0
+
+ChangeSet@1.2560, 2011-06-19 01:27:46-04:00, stenn@psp-deb1.ntp.org
+ Added loc.legacy (and distribute it)
+
+ ChangeLog@1.930 +1 -0
+ Added loc.legacy (and distribute it)
+
+ Makefile.am@1.110 +1 -0
+ Added loc.legacy (and distribute it)
+
+ loc.legacy@1.1 +14 -0
+ BitKeeper file /home/stenn/ntp-dev/loc.legacy
+
+ loc.legacy@1.0 +0 -0
+
+ChangeSet@1.2559, 2011-06-15 09:03:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P182
+ TAG: NTP_4_2_7P182
+
+ ChangeLog@1.929 +1 -0
+ NTP_4_2_7P182
+
+ ntpd/ntpd-opts.c@1.187 +21 -6
+ NTP_4_2_7P182
+
+ ntpd/ntpd-opts.h@1.187 +23 -8
+ NTP_4_2_7P182
+
+ ntpd/ntpd-opts.texi@1.185 +4 -5
+ NTP_4_2_7P182
+
+ ntpd/ntpd.1@1.185 +623 -102
+ NTP_4_2_7P182
+
+ ntpdc/ntpdc-opts.c@1.182 +21 -15
+ NTP_4_2_7P182
+
+ ntpdc/ntpdc-opts.h@1.182 +23 -8
+ NTP_4_2_7P182
+
+ ntpdc/ntpdc-opts.texi@1.182 +4 -29
+ NTP_4_2_7P182
+
+ ntpdc/ntpdc.1@1.182 +11 -9
+ NTP_4_2_7P182
+
+ ntpdc/ntpdc.html@1.10 +6 -31
+ NTP_4_2_7P182
+
+ ntpq/ntpq-opts.c@1.184 +20 -11
+ NTP_4_2_7P182
+
+ ntpq/ntpq-opts.h@1.184 +23 -8
+ NTP_4_2_7P182
+
+ ntpq/ntpq-opts.texi@1.184 +3 -17
+ NTP_4_2_7P182
+
+ ntpq/ntpq.1@1.184 +106 -124
+ NTP_4_2_7P182
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.184 +20 -5
+ NTP_4_2_7P182
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.184 +23 -8
+ NTP_4_2_7P182
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.184 +4 -3
+ NTP_4_2_7P182
+
+ ntpsnmpd/ntpsnmpd.1@1.184 +52 -45
+ NTP_4_2_7P182
+
+ packageinfo.sh@1.185 +1 -1
+ NTP_4_2_7P182
+
+ scripts/ntp-wait-opts.texi@1.2 +2 -14
+ NTP_4_2_7P182
+
+ scripts/ntp-wait.1@1.2 +3 -3
+ NTP_4_2_7P182
+
+ scripts/ntp-wait.html@1.2 +14 -37
+ NTP_4_2_7P182
+
+ sntp/sntp-opts.c@1.178 +19 -4
+ NTP_4_2_7P182
+
+ sntp/sntp-opts.h@1.178 +23 -8
+ NTP_4_2_7P182
+
+ sntp/sntp-opts.texi@1.178 +2 -2
+ NTP_4_2_7P182
+
+ sntp/sntp.1@1.178 +11 -13
+ NTP_4_2_7P182
+
+ sntp/sntp.html@1.178 +2 -2
+ NTP_4_2_7P182
+
+ util/ntp-keygen-opts.c@1.182 +21 -8
+ NTP_4_2_7P182
+
+ util/ntp-keygen-opts.h@1.182 +23 -8
+ NTP_4_2_7P182
+
+ util/ntp-keygen-opts.texi@1.185 +5 -8
+ NTP_4_2_7P182
+
+ util/ntp-keygen.1@1.185 +772 -78
+ NTP_4_2_7P182
+
+ChangeSet@1.2558, 2011-06-15 04:50:01-04:00, stenn@deacon.udel.edu
+ Update .point-changed-filelist
+
+ .point-changed-filelist@1.11 +3 -0
+ Update .point-changed-filelist
+
+ ChangeLog@1.928 +1 -0
+ Update .point-changed-filelist
+
+ChangeSet@1.2557, 2011-06-15 04:21:57-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1304] Update sntp.html to reflect new implementation
+
+ ChangeLog@1.927 +1 -0
+ [Bug 1304] Update sntp.html to reflect new implementation
+
+ChangeSet@1.2556, 2011-06-15 04:11:33-04:00, stenn@psp-deb1.ntp.org
+ ntpdc documentation fixes
+
+ ChangeLog@1.926 +1 -0
+ ntpdc documentation fixes
+
+ ntpdc/ntpdc-opts.def@1.19 +3 -0
+ ntpdc documentation fixes
+
+ ntpdc/ntpdc.texi@1.2 +1 -1
+ ntpdc documentation fixes
+
+ChangeSet@1.2555, 2011-06-15 04:10:12-04:00, stenn@psp-deb1.ntp.org
+ Update ntp-wait autogen docs
+
+ ChangeLog@1.925 +1 -0
+ Update ntp-wait autogen docs
+
+ scripts/Makefile.am@1.23 +40 -0
+ Update ntp-wait autogen docs
+
+ scripts/ntp-wait-opts.def@1.1 +106 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait-opts.def
+
+ scripts/ntp-wait-opts.def@1.0 +0 -0
+
+ scripts/ntp-wait-opts.menu@1.1 +1 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait-opts.menu
+
+ scripts/ntp-wait-opts.menu@1.0 +0 -0
+
+ scripts/ntp-wait-opts.texi@1.1 +58 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait-opts.texi
+
+ scripts/ntp-wait-opts.texi@1.0 +0 -0
+
+ scripts/ntp-wait.1@1.1 +92 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait.1
+
+ scripts/ntp-wait.1@1.0 +0 -0
+
+ scripts/ntp-wait.html@1.1 +174 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait.html
+
+ scripts/ntp-wait.html@1.0 +0 -0
+
+ scripts/ntp-wait.texi@1.1 +91 -0
+ BitKeeper file /home/stenn/ntp-dev/scripts/ntp-wait.texi
+
+ scripts/ntp-wait.texi@1.0 +0 -0
+
+ChangeSet@1.2554, 2011-06-14 08:10:15+00:00, stenn@psp-fb2.ntp.org
+ Update the ntpd autogen docs
+
+ ChangeLog@1.924 +1 -0
+ Update the ntpd autogen docs
+
+ ntpd/Makefile.am@1.106 +3 -1
+ Update the ntpd autogen docs
+
+ ntpd/ntpd-opts.def@1.7 +590 -2
+ Update the ntpd autogen docs
+
+ChangeSet@1.2553, 2011-06-13 22:24:35-07:00, stenn@psp-os1.ntp.org
+ Update the ntpsnmpd autogen docs
+
+ ChangeLog@1.923 +1 -0
+ Update the ntpsnmpd autogen docs
+
+ ntpsnmpd/Makefile.am@1.30 +3 -1
+ Update the ntpsnmpd autogen docs
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.3 +51 -0
+ Update the ntpsnmpd autogen docs
+
+ChangeSet@1.2552, 2011-06-12 14:53:25-07:00, stenn@psp-os1.ntp.org
+ Use autogen to produce ntp-keygen docs
+
+ ChangeLog@1.922 +1 -0
+ Use autogen to produce ntp-keygen docs
+
+ util/Makefile.am@1.62 +3 -1
+ Use autogen to produce ntp-keygen docs
+
+ util/ntp-keygen-opts.def@1.14 +743 -4
+ Use autogen to produce ntp-keygen docs
+
+ChangeSet@1.2551, 2011-06-12 14:52:05-07:00, stenn@psp-os1.ntp.org
+ Add "license name" to ntp.lic for autogen-5.11.10
+
+ ChangeLog@1.921 +1 -0
+ Add "license name" to ntp.lic for autogen-5.11.10
+
+ sntp/include/ntp.lic@1.5 +2 -0
+ Add "license name" to ntp.lic for autogen-5.11.10
+
+ChangeSet@1.2550, 2011-06-12 14:40:43-07:00, stenn@psp-os1.ntp.org
+ Prepare for ntp.keys.5
+
+ ChangeLog@1.920 +1 -0
+ Prepare for ntp.keys.5
+
+ ntpd/ntp.keys.def@1.1 +153 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpd/ntp.keys.def
+
+ ntpd/ntp.keys.def@1.0 +0 -0
+
+ChangeSet@1.2544.1.5, 2011-06-07 10:34:42+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P181
+ TAG: NTP_4_2_7P181
+
+ ChangeLog@1.915.1.4 +1 -0
+ NTP_4_2_7P181
+
+ ntpd/ntpd-opts.c@1.186 +3 -3
+ NTP_4_2_7P181
+
+ ntpd/ntpd-opts.h@1.186 +3 -3
+ NTP_4_2_7P181
+
+ ntpd/ntpd-opts.texi@1.184 +2 -2
+ NTP_4_2_7P181
+
+ ntpd/ntpd.1@1.184 +2 -2
+ NTP_4_2_7P181
+
+ ntpdc/ntpdc-opts.c@1.181 +3 -3
+ NTP_4_2_7P181
+
+ ntpdc/ntpdc-opts.h@1.181 +3 -3
+ NTP_4_2_7P181
+
+ ntpdc/ntpdc-opts.texi@1.181 +2 -2
+ NTP_4_2_7P181
+
+ ntpdc/ntpdc.1@1.181 +2 -2
+ NTP_4_2_7P181
+
+ ntpdc/ntpdc.html@1.9 +2 -2
+ NTP_4_2_7P181
+
+ ntpq/ntpq-opts.c@1.183 +3 -3
+ NTP_4_2_7P181
+
+ ntpq/ntpq-opts.h@1.183 +3 -3
+ NTP_4_2_7P181
+
+ ntpq/ntpq-opts.texi@1.183 +2 -2
+ NTP_4_2_7P181
+
+ ntpq/ntpq.1@1.183 +2 -2
+ NTP_4_2_7P181
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.183 +3 -3
+ NTP_4_2_7P181
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.183 +3 -3
+ NTP_4_2_7P181
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.183 +2 -2
+ NTP_4_2_7P181
+
+ ntpsnmpd/ntpsnmpd.1@1.183 +2 -2
+ NTP_4_2_7P181
+
+ packageinfo.sh@1.184 +1 -1
+ NTP_4_2_7P181
+
+ sntp/sntp-opts.c@1.177 +3 -3
+ NTP_4_2_7P181
+
+ sntp/sntp-opts.h@1.177 +3 -3
+ NTP_4_2_7P181
+
+ sntp/sntp-opts.texi@1.177 +2 -2
+ NTP_4_2_7P181
+
+ sntp/sntp.1@1.177 +2 -2
+ NTP_4_2_7P181
+
+ sntp/sntp.html@1.177 +2 -2
+ NTP_4_2_7P181
+
+ util/ntp-keygen-opts.c@1.181 +3 -3
+ NTP_4_2_7P181
+
+ util/ntp-keygen-opts.h@1.181 +3 -3
+ NTP_4_2_7P181
+
+ util/ntp-keygen-opts.texi@1.184 +2 -2
+ NTP_4_2_7P181
+
+ util/ntp-keygen.1@1.184 +2 -2
+ NTP_4_2_7P181
+
+ChangeSet@1.2544.1.4, 2011-06-07 02:25:51-04:00, stenn@deacon.udel.edu
+ [Bug 1938] addr_eqprefix() doesn't clear enough storage
+
+ ChangeLog@1.915.1.3 +1 -0
+ [Bug 1938] addr_eqprefix() doesn't clear enough storage
+
+ ntpd/ntp_io.c@1.357 +2 -2
+ [Bug 1938] addr_eqprefix() doesn't clear enough storage
+
+ChangeSet@1.2544.1.3, 2011-06-06 18:10:10-04:00, stenn@deacon.udel.edu
+ p180 was: Upgrade to libevent-2.0.12
+
+ ChangeLog@1.915.1.2 +1 -0
+ p180 was: Upgrade to libevent-2.0.12
+
+ChangeSet@1.2544.1.2, 2011-06-06 10:41:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P180
+ TAG: NTP_4_2_7P180
+
+ ChangeLog@1.915.1.1 +1 -0
+ NTP_4_2_7P180
+
+ ntpd/ntpd-opts.c@1.185 +3 -3
+ NTP_4_2_7P180
+
+ ntpd/ntpd-opts.h@1.185 +3 -3
+ NTP_4_2_7P180
+
+ ntpd/ntpd-opts.texi@1.183 +2 -2
+ NTP_4_2_7P180
+
+ ntpd/ntpd.1@1.183 +2 -2
+ NTP_4_2_7P180
+
+ ntpdc/ntpdc-opts.c@1.180 +3 -3
+ NTP_4_2_7P180
+
+ ntpdc/ntpdc-opts.h@1.180 +3 -3
+ NTP_4_2_7P180
+
+ ntpdc/ntpdc-opts.texi@1.180 +2 -2
+ NTP_4_2_7P180
+
+ ntpdc/ntpdc.1@1.180 +2 -2
+ NTP_4_2_7P180
+
+ ntpdc/ntpdc.html@1.8 +2 -2
+ NTP_4_2_7P180
+
+ ntpq/ntpq-opts.c@1.182 +3 -3
+ NTP_4_2_7P180
+
+ ntpq/ntpq-opts.h@1.182 +3 -3
+ NTP_4_2_7P180
+
+ ntpq/ntpq-opts.texi@1.182 +2 -2
+ NTP_4_2_7P180
+
+ ntpq/ntpq.1@1.182 +2 -2
+ NTP_4_2_7P180
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.182 +3 -3
+ NTP_4_2_7P180
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.182 +3 -3
+ NTP_4_2_7P180
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.182 +2 -2
+ NTP_4_2_7P180
+
+ ntpsnmpd/ntpsnmpd.1@1.182 +2 -2
+ NTP_4_2_7P180
+
+ packageinfo.sh@1.183 +1 -1
+ NTP_4_2_7P180
+
+ sntp/sntp-opts.c@1.176 +3 -3
+ NTP_4_2_7P180
+
+ sntp/sntp-opts.h@1.176 +3 -3
+ NTP_4_2_7P180
+
+ sntp/sntp-opts.texi@1.176 +2 -2
+ NTP_4_2_7P180
+
+ sntp/sntp.1@1.176 +2 -2
+ NTP_4_2_7P180
+
+ sntp/sntp.html@1.176 +2 -2
+ NTP_4_2_7P180
+
+ util/ntp-keygen-opts.c@1.180 +3 -3
+ NTP_4_2_7P180
+
+ util/ntp-keygen-opts.h@1.180 +3 -3
+ NTP_4_2_7P180
+
+ util/ntp-keygen-opts.texi@1.183 +2 -2
+ NTP_4_2_7P180
+
+ util/ntp-keygen.1@1.183 +2 -2
+ NTP_4_2_7P180
+
+ChangeSet@1.2548, 2011-06-06 03:59:08-04:00, stenn@psp-deb1.ntp.org
+ More sntp.1 cleanups
+
+ BitKeeper/deleted/3d/agmdoc-cmd.tpl~35a32d60c0791c7f@1.3 +0 -0
+ Delete: sntp/ag-tpl/agmdoc-cmd.tpl
+
+ BitKeeper/deleted/97/mdoc2man~9f658b3ccb67c829@1.3 +0 -0
+ Delete: sntp/ag-tpl/mdoc2man
+
+ BitKeeper/deleted/bf/aginfo.tpl~67b16ec8b8871afe@1.2 +0 -0
+ Delete: sntp/ag-tpl/aginfo.tpl
+
+ BitKeeper/deleted/f2/cmd-doc.tlib~e5f798f139ab3308@1.5 +0 -0
+ Delete: sntp/ag-tpl/cmd-doc.tlib
+
+ ChangeLog@1.918 +1 -0
+ More sntp.1 cleanups
+
+ sntp/sntp-opts.def@1.32 +0 -10
+ More sntp.1 cleanups
+
+ChangeSet@1.2461.1.6, 2011-06-05 11:23:00+00:00, davehart@shiny.ad.hartbrothers.com
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/ChangeLog@1.3 +40 -0
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/Makefile.am@1.1.1.3 +16 -1
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/README@1.3 +5 -0
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/buffer.c@1.4 +41 -16
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/configure.in@1.1.1.3 +15 -0
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/event.c@1.1.1.3 +5 -1
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/event_iocp.c@1.4 +4 -0
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/evport.c@1.1.1.2 +85 -112
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/evthread_win32.c@1.4 +4 -0
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/http.c@1.1.1.3 +45 -11
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/listener.c@1.4 +4 -0
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/select.c@1.1.1.2 +3 -3
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/test/regress_http.c@1.1.1.3 +3 -3
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ sntp/libevent/test/regress_ssl.c@1.3 +1 -0
+ Update to libevent HEAD as of 20110604, e40bafe796a8e544e9e54e247cb3aa30c95e06b0
+ Snapshot of libevent 2.1, as of 2.0.12-stable release.
+
+ChangeSet@1.2461.1.5, 2011-06-05 11:16:07+00:00, davehart@shiny.ad.hartbrothers.com
+ cleanup arlib cruft.
+ add sntp/libevent/.git and .gitignore to ease shared bk/git repo for libevent upstream.
+
+ BitKeeper/etc/ignore@1.77.1.1 +2 -4
+ cleanup arlib cruft.
+ add sntp/libevent/.git and .gitignore to ease shared bk/git repo for libevent upstream.
+
+
+ChangeSet@1.2546, 2011-06-04 04:22:32-04:00, stenn@psp-deb1.ntp.org
+ Produce ntpq.1 with the new autogen macros
+
+ ChangeLog@1.917 +1 -0
+ Produce ntpq.1 with the new autogen macros
+
+ ntpq/Makefile.am@1.59 +6 -1
+ Produce ntpq.1 with the new autogen macros
+
+ ntpq/ntpq-opts.def@1.15 +254 -259
+ Produce ntpq.1 with the new autogen macros
+
+ChangeSet@1.2545, 2011-06-04 02:57:47-04:00, stenn@psp-deb1.ntp.org
+ Remove the deprecated "detail" stanza from ntpdc-opts.def
+
+ ChangeLog@1.916 +1 -0
+ Remove the deprecated "detail" stanza from ntpdc-opts.def
+
+ ntpdc/ntpdc-opts.def@1.18 +0 -20
+ Remove the deprecated "detail" stanza from ntpdc-opts.def
+
+ChangeSet@1.2544, 2011-06-03 08:00:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P179
+ TAG: NTP_4_2_7P179
+
+ ChangeLog@1.915 +1 -0
+ NTP_4_2_7P179
+
+ ntpd/ntpd-opts.c@1.184 +3 -3
+ NTP_4_2_7P179
+
+ ntpd/ntpd-opts.h@1.184 +3 -3
+ NTP_4_2_7P179
+
+ ntpd/ntpd-opts.texi@1.182 +2 -2
+ NTP_4_2_7P179
+
+ ntpd/ntpd.1@1.182 +2 -2
+ NTP_4_2_7P179
+
+ ntpdc/ntpdc-opts.c@1.179 +3 -3
+ NTP_4_2_7P179
+
+ ntpdc/ntpdc-opts.h@1.179 +3 -3
+ NTP_4_2_7P179
+
+ ntpdc/ntpdc-opts.texi@1.179 +2 -2
+ NTP_4_2_7P179
+
+ ntpdc/ntpdc.1@1.179 +5 -5
+ NTP_4_2_7P179
+
+ ntpdc/ntpdc.html@1.7 +2 -2
+ NTP_4_2_7P179
+
+ ntpq/ntpq-opts.c@1.181 +3 -3
+ NTP_4_2_7P179
+
+ ntpq/ntpq-opts.h@1.181 +3 -3
+ NTP_4_2_7P179
+
+ ntpq/ntpq-opts.texi@1.181 +2 -2
+ NTP_4_2_7P179
+
+ ntpq/ntpq.1@1.181 +2 -2
+ NTP_4_2_7P179
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.181 +3 -3
+ NTP_4_2_7P179
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.181 +3 -3
+ NTP_4_2_7P179
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.181 +2 -2
+ NTP_4_2_7P179
+
+ ntpsnmpd/ntpsnmpd.1@1.181 +2 -2
+ NTP_4_2_7P179
+
+ packageinfo.sh@1.182 +1 -1
+ NTP_4_2_7P179
+
+ sntp/sntp-opts.c@1.175 +3 -3
+ NTP_4_2_7P179
+
+ sntp/sntp-opts.h@1.175 +3 -3
+ NTP_4_2_7P179
+
+ sntp/sntp-opts.texi@1.175 +2 -2
+ NTP_4_2_7P179
+
+ sntp/sntp.1@1.175 +9 -5
+ NTP_4_2_7P179
+
+ sntp/sntp.html@1.175 +2 -2
+ NTP_4_2_7P179
+
+ util/ntp-keygen-opts.c@1.179 +3 -3
+ NTP_4_2_7P179
+
+ util/ntp-keygen-opts.h@1.179 +3 -3
+ NTP_4_2_7P179
+
+ util/ntp-keygen-opts.texi@1.182 +2 -2
+ NTP_4_2_7P179
+
+ util/ntp-keygen.1@1.182 +2 -2
+ NTP_4_2_7P179
+
+ChangeSet@1.2543, 2011-06-03 02:55:13-04:00, stenn@psp-deb1.ntp.org
+ Upgrade local autoopts templates to 5.11.10pre5
+
+ ChangeLog@1.914 +1 -0
+ Upgrade local autoopts templates to 5.11.10pre5
+
+ sntp/ag-tpl/agmdoc-cmd.tpl@1.2 +19 -18
+ Upgrade local autoopts templates to 5.11.10pre5
+
+ sntp/ag-tpl/mdoc2man@1.2 +15 -12
+ Upgrade local autoopts templates to 5.11.10pre5
+
+ChangeSet@1.2542, 2011-06-02 15:51:22-04:00, stenn@psp-deb1.ntp.org
+ Update cmd-doc.tlib to autogen-5.11.10pre5
+
+ ChangeLog@1.913 +1 -0
+ Update cmd-doc.tlib to autogen-5.11.10pre5
+
+ sntp/ag-tpl/cmd-doc.tlib@1.4 +10 -9
+ Update cmd-doc.tlib to autogen-5.11.10pre5
+
+ChangeSet@1.2541, 2011-06-02 07:29:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P178
+ TAG: NTP_4_2_7P178
+
+ ChangeLog@1.912 +1 -0
+ NTP_4_2_7P178
+
+ ntpd/ntpd-opts.c@1.183 +5 -4
+ NTP_4_2_7P178
+
+ ntpd/ntpd-opts.h@1.183 +3 -3
+ NTP_4_2_7P178
+
+ ntpd/ntpd-opts.texi@1.181 +2 -2
+ NTP_4_2_7P178
+
+ ntpd/ntpd.1@1.181 +2 -2
+ NTP_4_2_7P178
+
+ ntpdc/ntpdc-opts.c@1.178 +5 -4
+ NTP_4_2_7P178
+
+ ntpdc/ntpdc-opts.h@1.178 +3 -3
+ NTP_4_2_7P178
+
+ ntpdc/ntpdc-opts.texi@1.178 +2 -2
+ NTP_4_2_7P178
+
+ ntpdc/ntpdc.1@1.178 +2 -2
+ NTP_4_2_7P178
+
+ ntpdc/ntpdc.html@1.6 +2 -2
+ NTP_4_2_7P178
+
+ ntpq/ntpq-opts.c@1.180 +5 -4
+ NTP_4_2_7P178
+
+ ntpq/ntpq-opts.h@1.180 +3 -3
+ NTP_4_2_7P178
+
+ ntpq/ntpq-opts.texi@1.180 +2 -2
+ NTP_4_2_7P178
+
+ ntpq/ntpq.1@1.180 +2 -2
+ NTP_4_2_7P178
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.180 +5 -4
+ NTP_4_2_7P178
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.180 +3 -3
+ NTP_4_2_7P178
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.180 +2 -2
+ NTP_4_2_7P178
+
+ ntpsnmpd/ntpsnmpd.1@1.180 +2 -2
+ NTP_4_2_7P178
+
+ packageinfo.sh@1.181 +1 -1
+ NTP_4_2_7P178
+
+ sntp/sntp-opts.c@1.174 +5 -4
+ NTP_4_2_7P178
+
+ sntp/sntp-opts.h@1.174 +3 -3
+ NTP_4_2_7P178
+
+ sntp/sntp-opts.texi@1.174 +2 -2
+ NTP_4_2_7P178
+
+ sntp/sntp.1@1.174 +2 -2
+ NTP_4_2_7P178
+
+ sntp/sntp.html@1.174 +2 -2
+ NTP_4_2_7P178
+
+ util/ntp-keygen-opts.c@1.178 +5 -4
+ NTP_4_2_7P178
+
+ util/ntp-keygen-opts.h@1.178 +3 -3
+ NTP_4_2_7P178
+
+ util/ntp-keygen-opts.texi@1.181 +2 -2
+ NTP_4_2_7P178
+
+ util/ntp-keygen.1@1.181 +2 -2
+ NTP_4_2_7P178
+
+ChangeSet@1.2540, 2011-06-02 02:25:52-04:00, stenn@psp-deb1.ntp.org
+ Update the std_def_list to include the ntp.lic file.
+
+ ChangeLog@1.911 +1 -0
+ Update the std_def_list to include the ntp.lic file.
+
+ ntpd/Makefile.am@1.105 +1 -0
+ Update the std_def_list to include the ntp.lic file.
+
+ ntpdc/Makefile.am@1.63 +1 -0
+ Update the std_def_list to include the ntp.lic file.
+
+ ntpq/Makefile.am@1.58 +1 -0
+ Update the std_def_list to include the ntp.lic file.
+
+ ntpsnmpd/Makefile.am@1.29 +1 -0
+ Update the std_def_list to include the ntp.lic file.
+
+ sntp/Makefile.am@1.63 +11 -3
+ Update the std_def_list to include the ntp.lic file.
+
+ util/Makefile.am@1.61 +1 -0
+ Update the std_def_list to include the ntp.lic file.
+
+ChangeSet@1.2539, 2011-06-01 22:03:22-04:00, stenn@deacon.udel.edu
+ Distribute ntp.lic
+
+ ChangeLog@1.910 +2 -0
+ Distribute ntp.lic
+
+ChangeSet@1.2538, 2011-06-01 21:59:17-04:00, stenn@deacon.udel.edu
+ Distribute ntp.lic
+
+ sntp/include/Makefile.am@1.2 +1 -0
+ Distribute ntp.lic
+
+ sntp/include/ntp.lic@1.4 +0 -0
+ Rename: sntp/ag-tpl/ntp.lic -> sntp/include/ntp.lic
+
+ sntp/ag-tpl/ntp.lic@1.3 +1 -0
+ Add http://ntp.org/license to the ntp.lic file
+
+ChangeSet@1.2537, 2011-06-01 11:01:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P177
+ TAG: NTP_4_2_7P177
+
+ ChangeLog@1.909 +1 -0
+ NTP_4_2_7P177
+
+ ntpd/ntpd-opts.c@1.182 +21 -11
+ NTP_4_2_7P177
+
+ ntpd/ntpd-opts.h@1.182 +4 -7
+ NTP_4_2_7P177
+
+ ntpd/ntpd-opts.texi@1.180 +3 -3
+ NTP_4_2_7P177
+
+ ntpd/ntpd.1@1.180 +4 -9
+ NTP_4_2_7P177
+
+ ntpdc/ntpdc-opts.c@1.177 +21 -11
+ NTP_4_2_7P177
+
+ ntpdc/ntpdc-opts.h@1.177 +4 -7
+ NTP_4_2_7P177
+
+ ntpdc/ntpdc-opts.texi@1.177 +2 -2
+ NTP_4_2_7P177
+
+ ntpdc/ntpdc.1@1.177 +3 -7
+ NTP_4_2_7P177
+
+ ntpdc/ntpdc.html@1.5 +2 -2
+ NTP_4_2_7P177
+
+ ntpq/ntpq-opts.c@1.179 +21 -11
+ NTP_4_2_7P177
+
+ ntpq/ntpq-opts.h@1.179 +4 -7
+ NTP_4_2_7P177
+
+ ntpq/ntpq-opts.texi@1.179 +3 -3
+ NTP_4_2_7P177
+
+ ntpq/ntpq.1@1.179 +4 -9
+ NTP_4_2_7P177
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.179 +21 -11
+ NTP_4_2_7P177
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.179 +4 -7
+ NTP_4_2_7P177
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.179 +3 -3
+ NTP_4_2_7P177
+
+ ntpsnmpd/ntpsnmpd.1@1.179 +4 -9
+ NTP_4_2_7P177
+
+ packageinfo.sh@1.180 +1 -1
+ NTP_4_2_7P177
+
+ sntp/sntp-opts.c@1.173 +21 -11
+ NTP_4_2_7P177
+
+ sntp/sntp-opts.h@1.173 +4 -7
+ NTP_4_2_7P177
+
+ sntp/sntp-opts.texi@1.173 +2 -2
+ NTP_4_2_7P177
+
+ sntp/sntp.1@1.173 +3 -7
+ NTP_4_2_7P177
+
+ sntp/sntp.html@1.173 +2 -2
+ NTP_4_2_7P177
+
+ util/ntp-keygen-opts.c@1.177 +21 -11
+ NTP_4_2_7P177
+
+ util/ntp-keygen-opts.h@1.177 +4 -7
+ NTP_4_2_7P177
+
+ util/ntp-keygen-opts.texi@1.180 +3 -3
+ NTP_4_2_7P177
+
+ util/ntp-keygen.1@1.180 +4 -9
+ NTP_4_2_7P177
+
+ChangeSet@1.2536, 2011-06-01 03:26:00-04:00, stenn@deacon.udel.edu
+ Clean up the ntp.lic file
+
+ ChangeLog@1.908 +1 -0
+ Clean up the ntp.lic file
+
+ sntp/ag-tpl/ntp.lic@1.2 +2 -2
+ Clean up the ntp.lic file
+
+ChangeSet@1.2535, 2011-06-01 03:14:41-04:00, stenn@psp-deb1.ntp.org
+ Provide ntp.lic for the new autogen license template
+
+ sntp/ag-tpl/ntp.lic@1.1 +15 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/ag-tpl/ntp.lic
+
+ sntp/ag-tpl/ntp.lic@1.0 +0 -0
+
+ChangeSet@1.2534, 2011-06-01 03:11:05-04:00, stenn@psp-deb1.ntp.org
+ Use the latest autogen's new copyright template code
+
+ ChangeLog@1.907 +1 -0
+ Use the latest autogen's new copyright template code
+
+ ntpd/Makefile.am@1.104 +1 -1
+ Use the latest autogen's new copyright template code
+
+ ntpq/Makefile.am@1.57 +1 -1
+ Use the latest autogen's new copyright template code
+
+ ntpsnmpd/Makefile.am@1.28 +1 -1
+ Use the latest autogen's new copyright template code
+
+ sntp/include/copyright.def@1.18 +2 -6
+ Use the latest autogen's new copyright template code
+
+ util/Makefile.am@1.60 +1 -1
+ Use the latest autogen's new copyright template code
+
+ChangeSet@1.2533, 2011-06-01 02:07:55-04:00, stenn@deacon.udel.edu
+ p176 cleaned up sntp docs and autogen doc templates
+
+ ChangeLog@1.906 +2 -0
+ p176 cleaned up sntp docs and autogen doc templates
+
+ChangeSet@1.2532, 2011-05-31 11:00:25+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P176
+ TAG: NTP_4_2_7P176
+
+ ChangeLog@1.905 +1 -0
+ NTP_4_2_7P176
+
+ ntpd/ntpd-opts.c@1.181 +3 -3
+ NTP_4_2_7P176
+
+ ntpd/ntpd-opts.h@1.181 +3 -3
+ NTP_4_2_7P176
+
+ ntpd/ntpd-opts.texi@1.179 +2 -2
+ NTP_4_2_7P176
+
+ ntpd/ntpd.1@1.179 +2 -2
+ NTP_4_2_7P176
+
+ ntpdc/ntpdc-opts.c@1.176 +3 -3
+ NTP_4_2_7P176
+
+ ntpdc/ntpdc-opts.h@1.176 +3 -3
+ NTP_4_2_7P176
+
+ ntpdc/ntpdc-opts.texi@1.176 +3 -3
+ NTP_4_2_7P176
+
+ ntpdc/ntpdc.1@1.176 +2 -2
+ NTP_4_2_7P176
+
+ ntpdc/ntpdc.html@1.4 +3 -3
+ NTP_4_2_7P176
+
+ ntpq/ntpq-opts.c@1.178 +3 -3
+ NTP_4_2_7P176
+
+ ntpq/ntpq-opts.h@1.178 +3 -3
+ NTP_4_2_7P176
+
+ ntpq/ntpq-opts.texi@1.178 +2 -2
+ NTP_4_2_7P176
+
+ ntpq/ntpq.1@1.178 +2 -2
+ NTP_4_2_7P176
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.178 +3 -3
+ NTP_4_2_7P176
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.178 +3 -3
+ NTP_4_2_7P176
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.178 +2 -2
+ NTP_4_2_7P176
+
+ ntpsnmpd/ntpsnmpd.1@1.178 +2 -2
+ NTP_4_2_7P176
+
+ packageinfo.sh@1.179 +1 -1
+ NTP_4_2_7P176
+
+ sntp/sntp-opts.c@1.172 +4 -10
+ NTP_4_2_7P176
+
+ sntp/sntp-opts.h@1.172 +3 -3
+ NTP_4_2_7P176
+
+ sntp/sntp-opts.texi@1.172 +4 -13
+ NTP_4_2_7P176
+
+ sntp/sntp.1@1.172 +3 -3
+ NTP_4_2_7P176
+
+ sntp/sntp.html@1.172 +4 -13
+ NTP_4_2_7P176
+
+ util/ntp-keygen-opts.c@1.176 +3 -3
+ NTP_4_2_7P176
+
+ util/ntp-keygen-opts.h@1.176 +3 -3
+ NTP_4_2_7P176
+
+ util/ntp-keygen-opts.texi@1.179 +2 -2
+ NTP_4_2_7P176
+
+ util/ntp-keygen.1@1.179 +2 -2
+ NTP_4_2_7P176
+
+ChangeSet@1.2529.1.1, 2011-05-30 11:16:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P175
+ TAG: NTP_4_2_7P175
+
+ ChangeLog@1.902.1.1 +1 -0
+ NTP_4_2_7P175
+
+ ntpd/ntpd-opts.c@1.180 +3 -3
+ NTP_4_2_7P175
+
+ ntpd/ntpd-opts.h@1.180 +3 -3
+ NTP_4_2_7P175
+
+ ntpd/ntpd-opts.texi@1.178 +2 -2
+ NTP_4_2_7P175
+
+ ntpd/ntpd.1@1.178 +2 -2
+ NTP_4_2_7P175
+
+ ntpdc/ntpdc-opts.c@1.175 +3 -3
+ NTP_4_2_7P175
+
+ ntpdc/ntpdc-opts.h@1.175 +3 -3
+ NTP_4_2_7P175
+
+ ntpdc/ntpdc-opts.texi@1.175 +2 -2
+ NTP_4_2_7P175
+
+ ntpdc/ntpdc.1@1.175 +13 -12
+ NTP_4_2_7P175
+
+ ntpdc/ntpdc.html@1.3 +2 -2
+ NTP_4_2_7P175
+
+ ntpq/ntpq-opts.c@1.177 +3 -3
+ NTP_4_2_7P175
+
+ ntpq/ntpq-opts.h@1.177 +3 -3
+ NTP_4_2_7P175
+
+ ntpq/ntpq-opts.texi@1.177 +2 -2
+ NTP_4_2_7P175
+
+ ntpq/ntpq.1@1.177 +2 -2
+ NTP_4_2_7P175
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.177 +3 -3
+ NTP_4_2_7P175
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.177 +3 -3
+ NTP_4_2_7P175
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.177 +2 -2
+ NTP_4_2_7P175
+
+ ntpsnmpd/ntpsnmpd.1@1.177 +2 -2
+ NTP_4_2_7P175
+
+ packageinfo.sh@1.178 +1 -1
+ NTP_4_2_7P175
+
+ sntp/sntp-opts.c@1.171 +3 -3
+ NTP_4_2_7P175
+
+ sntp/sntp-opts.h@1.171 +3 -3
+ NTP_4_2_7P175
+
+ sntp/sntp-opts.texi@1.171 +2 -2
+ NTP_4_2_7P175
+
+ sntp/sntp.1@1.171 +9 -6
+ NTP_4_2_7P175
+
+ sntp/sntp.html@1.171 +2 -2
+ NTP_4_2_7P175
+
+ util/ntp-keygen-opts.c@1.175 +3 -3
+ NTP_4_2_7P175
+
+ util/ntp-keygen-opts.h@1.175 +3 -3
+ NTP_4_2_7P175
+
+ util/ntp-keygen-opts.texi@1.178 +2 -2
+ NTP_4_2_7P175
+
+ util/ntp-keygen.1@1.178 +2 -2
+ NTP_4_2_7P175
+
+ChangeSet@1.2530, 2011-05-30 04:44:11-04:00, stenn@psp-deb1.ntp.org
+ sntp documentation updates
+
+ ChangeLog@1.903 +1 -0
+ sntp documentation cleanup
+
+ sntp/ag-tpl/aginfo.tpl@1.1 +308 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/ag-tpl/aginfo.tpl
+
+ sntp/ag-tpl/aginfo.tpl@1.0 +0 -0
+
+ sntp/ag-tpl/mdoc2man@1.1 +284 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/ag-tpl/mdoc2man
+
+ sntp/ag-tpl/mdoc2man@1.0 +0 -0
+
+ sntp/sntp-opts.def@1.31 +31 -42
+ documentation cleanup
+
+ChangeSet@1.2529, 2011-05-29 21:36:04-04:00, stenn@psp-deb1.ntp.org
+ cmd-doc.tlib cleanup from Bruce Korb
+
+ ChangeLog@1.902 +1 -0
+ cmd-doc.tlib cleanup from Bruce Korb
+
+ sntp/ag-tpl/cmd-doc.tlib@1.3 +50 -35
+ cmd-doc.tlib cleanup from Bruce Korb
+
+ChangeSet@1.2528, 2011-05-29 21:28:17-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1936] Correctly set IPV6_MULTICAST_LOOP
+
+ ChangeLog@1.901 +1 -0
+ [Bug 1936] Correctly set IPV6_MULTICAST_LOOP
+
+ ntpd/ntp_io.c@1.356 +7 -2
+ [Bug 1936] Correctly set IPV6_MULTICAST_LOOP
+
+ChangeSet@1.2527, 2011-05-28 11:03:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P174
+ TAG: NTP_4_2_7P174
+
+ ChangeLog@1.900 +1 -0
+ NTP_4_2_7P174
+
+ ntpd/ntpd-opts.c@1.179 +7 -7
+ NTP_4_2_7P174
+
+ ntpd/ntpd-opts.h@1.179 +5 -5
+ NTP_4_2_7P174
+
+ ntpd/ntpd-opts.texi@1.177 +2 -2
+ NTP_4_2_7P174
+
+ ntpd/ntpd.1@1.177 +4 -4
+ NTP_4_2_7P174
+
+ ntpdc/ntpdc-opts.c@1.174 +95 -95
+ NTP_4_2_7P174
+
+ ntpdc/ntpdc-opts.h@1.174 +36 -36
+ NTP_4_2_7P174
+
+ ntpdc/ntpdc-opts.texi@1.174 +20 -22
+ NTP_4_2_7P174
+
+ ntpdc/ntpdc.1@1.174 +719 -86
+ NTP_4_2_7P174
+
+ ntpdc/ntpdc.html@1.2 +50 -73
+ NTP_4_2_7P174
+
+ ntpq/ntpq-opts.c@1.176 +10 -10
+ NTP_4_2_7P174
+
+ ntpq/ntpq-opts.h@1.176 +5 -5
+ NTP_4_2_7P174
+
+ ntpq/ntpq-opts.texi@1.176 +7 -10
+ NTP_4_2_7P174
+
+ ntpq/ntpq.1@1.176 +8 -9
+ NTP_4_2_7P174
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.176 +7 -7
+ NTP_4_2_7P174
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.176 +5 -5
+ NTP_4_2_7P174
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.176 +2 -2
+ NTP_4_2_7P174
+
+ ntpsnmpd/ntpsnmpd.1@1.176 +4 -4
+ NTP_4_2_7P174
+
+ packageinfo.sh@1.177 +1 -1
+ NTP_4_2_7P174
+
+ sntp/sntp-opts.c@1.170 +15 -13
+ NTP_4_2_7P174
+
+ sntp/sntp-opts.h@1.170 +5 -5
+ NTP_4_2_7P174
+
+ sntp/sntp-opts.texi@1.170 +21 -20
+ NTP_4_2_7P174
+
+ sntp/sntp.1@1.170 +27 -36
+ NTP_4_2_7P174
+
+ sntp/sntp.html@1.170 +19 -22
+ NTP_4_2_7P174
+
+ util/ntp-keygen-opts.c@1.174 +10 -10
+ NTP_4_2_7P174
+
+ util/ntp-keygen-opts.h@1.174 +5 -5
+ NTP_4_2_7P174
+
+ util/ntp-keygen-opts.texi@1.177 +8 -9
+ NTP_4_2_7P174
+
+ util/ntp-keygen.1@1.177 +8 -9
+ NTP_4_2_7P174
+
+ChangeSet@1.2526, 2011-05-27 16:40:04-04:00, stenn@psp-deb1.ntp.org
+ sntp documentation cleanup
+
+ sntp/include/debug-opt.def@1.7 +4 -7
+ sntp documentation cleanup
+
+ sntp/sntp-opts.def@1.30 +9 -9
+ sntp documentation cleanup
+
+ChangeSet@1.2525, 2011-05-27 06:32:14-04:00, stenn@psp-deb1.ntp.org
+ sntp documentation cleanup (for autogen)
+
+ ChangeLog@1.899 +1 -0
+ sntp documentation cleanup (for autogen)
+
+ sntp/ag-tpl/cmd-doc.tlib@1.2 +42 -151
+ documentation cleanup (for autogen)
+
+ sntp/include/copyright.def@1.17 +2 -2
+ documentation cleanup (for autogen)
+
+ sntp/sntp-opts.def@1.29 +28 -5
+ documentation cleanup (for autogen)
+
+ChangeSet@1.2524, 2011-05-27 05:15:52-04:00, stenn@psp-deb1.ntp.org
+ ntpdc documentation cleanup
+
+ ChangeLog@1.898 +1 -0
+ ntpdc documentation cleanup
+
+ ntpdc/ntpdc-opts.def@1.17 +4 -2
+ ntpdc documentation cleanup
+
+ChangeSet@1.2523, 2011-05-26 18:54:06-04:00, stenn@psp-deb1.ntp.org
+ Don't build libevent with openssl support
+
+ ChangeLog@1.897 +2 -0
+ Don't build libevent with openssl support
+
+ sntp/m4/ntp_libevent.m4@1.8 +1 -0
+ Don't build libevent with openssl support
+
+ChangeSet@1.2461.1.4, 2011-05-26 07:10:45+00:00, davehart@shiny.ad.hartbrothers.com
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/ChangeLog@1.2 +84 -0
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/Makefile.am@1.1.1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/Makefile.nmake@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/README@1.2 +8 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/WIN32-Code/event2/event-config.h@1.1.1.2 +3 -0
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/arc4random.c@1.1.1.2 +5 -5
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/buffer.c@1.3 +12 -12
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/bufferevent-internal.h@1.3 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/bufferevent.c@1.3 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/bufferevent_async.c@1.3 +10 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/bufferevent_filter.c@1.3 +2 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/bufferevent_openssl.c@1.3 +2 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/bufferevent_pair.c@1.3 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/bufferevent_sock.c@1.3 +7 -6
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/compat/sys/queue.h@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/configure.in@1.1.1.2 +58 -25
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evbuffer-internal.h@1.3 +4 -4
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evdns.3@1.1 +322 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/evdns.3
+
+ sntp/libevent/evdns.3@1.0 +0 -0
+
+ sntp/libevent/evdns.c@1.1.1.3 +20 -8
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/event-internal.h@1.1.1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/event.3@1.1 +624 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/event.3
+
+ sntp/libevent/event.3@1.0 +0 -0
+
+ sntp/libevent/event.c@1.1.1.2 +12 -12
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/event.h@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/event_iocp.c@1.3 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/event_tagging.c@1.3 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evmap.c@1.3 +4 -4
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evrpc.c@1.3 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evthread-internal.h@1.3 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evthread.c@1.1.1.2 +1 -0
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evthread_win32.c@1.3 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/evutil.c@1.1.1.2 +19 -19
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/http.c@1.1.1.2 +165 -55
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/include/Makefile.am@1.1.1.1 +9 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/include/event2/dns.h@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/include/event2/dns_compat.h@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/include/event2/event.h@1.1.1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/include/event2/rpc.h@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/include/event2/thread.h@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/include/event2/util.h@1.2 +8 -8
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/iocp-internal.h@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/kqueue.c@1.3 +37 -9
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/libevent_openssl.pc.in@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/listener.c@1.3 +6 -6
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/log.c@1.3 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/m4/ac_backport_259_ssizet.m4@1.1 +3 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/m4/ac_backport_259_ssizet.m4
+
+ sntp/libevent/m4/ac_backport_259_ssizet.m4@1.0 +0 -0
+
+ sntp/libevent/make_epoll_table.py@1.1 +57 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/make_epoll_table.py
+
+ sntp/libevent/make_epoll_table.py@1.0 +0 -0
+
+ sntp/libevent/sample/Makefile.am@1.1.1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/sample/dns-example.c@1.1.1.2 +4 -5
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/sample/event-test.c@1.2 +6 -6
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/sample/hello-world.c@1.1.1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/sample/http-server.c@1.1.1.3 +11 -8
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/sample/le-proxy.c@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/sample/signal-test.c@1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/sample/time-test.c@1.2 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/signal.c@1.3 +5 -5
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/Makefile.am@1.1.1.2 +6 -4
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/Makefile.nmake@1.2 +1 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/bench.c@1.2 +11 -6
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/bench_cascade.c@1.2 +10 -5
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/bench_http.c@1.2 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/bench_httpclient.c@1.1.1.2 +9 -6
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress.c@1.2 +28 -16
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_buffer.c@1.3 +4 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_bufferevent.c@1.2 +5 -5
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_dns.c@1.1.1.2 +5 -6
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_et.c@1.2 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_http.c@1.1.1.2 +67 -4
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_listener.c@1.1.1.2 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_main.c@1.3 +9 -9
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_rpc.c@1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_ssl.c@1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_testutils.c@1.1.1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_thread.c@1.2 +5 -5
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_util.c@1.2 +7 -7
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/regress_zlib.c@1.2 +25 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/test-changelist.c@1.2 +7 -7
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/test-eof.c@1.1.1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/test-init.c@1.2 +2 -2
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/test-ratelim.c@1.1.1.2 +5 -5
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/test-time.c@1.2 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/test-weof.c@1.2 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/tinytest.c@1.2 +4 -4
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/test/tinytest_local.h@1.2 +4 -1
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ sntp/libevent/util-internal.h@1.1.1.2 +3 -3
+ libevent HEAD (will be 2.1) 20110526 95f70166df3bc9c0817ef98aa3711564300d5bb3
+
+ChangeSet@1.2517.1.14, 2011-05-25 19:29:28+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P173
+ TAG: NTP_4_2_7P173
+
+ ChangeLog@1.896 +1 -0
+ NTP_4_2_7P173
+
+ ntpd/ntpd-opts.c@1.178 +3 -3
+ NTP_4_2_7P173
+
+ ntpd/ntpd-opts.h@1.178 +3 -3
+ NTP_4_2_7P173
+
+ ntpd/ntpd-opts.texi@1.176 +2 -2
+ NTP_4_2_7P173
+
+ ntpd/ntpd.1@1.176 +2 -2
+ NTP_4_2_7P173
+
+ ntpdc/ntpdc-opts.c@1.170.1.5 +3 -3
+ NTP_4_2_7P173
+
+ ntpdc/ntpdc-opts.h@1.170.1.5 +3 -3
+ NTP_4_2_7P173
+
+ ntpdc/ntpdc-opts.texi@1.170.1.5 +2 -2
+ NTP_4_2_7P173
+
+ ntpdc/ntpdc.1@1.170.1.5 +2 -2
+ NTP_4_2_7P173
+
+ ntpq/ntpq-opts.c@1.175 +3 -3
+ NTP_4_2_7P173
+
+ ntpq/ntpq-opts.h@1.175 +3 -3
+ NTP_4_2_7P173
+
+ ntpq/ntpq-opts.texi@1.175 +2 -2
+ NTP_4_2_7P173
+
+ ntpq/ntpq.1@1.175 +2 -2
+ NTP_4_2_7P173
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.175 +3 -3
+ NTP_4_2_7P173
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.175 +3 -3
+ NTP_4_2_7P173
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.175 +2 -2
+ NTP_4_2_7P173
+
+ ntpsnmpd/ntpsnmpd.1@1.175 +2 -2
+ NTP_4_2_7P173
+
+ packageinfo.sh@1.176 +1 -1
+ NTP_4_2_7P173
+
+ sntp/sntp-opts.c@1.169 +3 -3
+ NTP_4_2_7P173
+
+ sntp/sntp-opts.h@1.169 +3 -3
+ NTP_4_2_7P173
+
+ sntp/sntp-opts.texi@1.169 +2 -2
+ NTP_4_2_7P173
+
+ sntp/sntp.1@1.169 +2 -2
+ NTP_4_2_7P173
+
+ sntp/sntp.html@1.169 +2 -2
+ NTP_4_2_7P173
+
+ util/ntp-keygen-opts.c@1.173 +3 -3
+ NTP_4_2_7P173
+
+ util/ntp-keygen-opts.h@1.173 +3 -3
+ NTP_4_2_7P173
+
+ util/ntp-keygen-opts.texi@1.176 +2 -2
+ NTP_4_2_7P173
+
+ util/ntp-keygen.1@1.176 +2 -2
+ NTP_4_2_7P173
+
+ChangeSet@1.2517.2.1, 2011-05-25 07:35:27+00:00, davehart@shiny.ad.hartbrothers.com
+ parsesolaris.c compile fails on SPARC Solaris with conflicting printf.
+ ntp_util.c compile fails on AIX and OSF with conflicting statsdir.
+
+ ChangeLog@1.893.1.1 +2 -0
+ parsesolaris.c compile fails on SPARC Solaris with conflicting printf.
+ ntp_util.c compile fails on AIX and OSF with conflicting statsdir.
+
+
+ include/ntp_fp.h@1.24 +11 -2
+ parsesolaris.c compile fails on SPARC Solaris with conflicting printf.
+
+ include/ntpd.h@1.163 +1 -4
+ ntp_util.c compile fails on AIX and OSF with conflicting statsdir.
+
+ ntpd/ntp_util.c@1.96 +1 -1
+ ntp_util.c compile fails on AIX and OSF with conflicting statsdir.
+
+ChangeSet@1.2082.4.212, 2011-05-25 05:27:31+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P4_BETA2
+ TAG: NTP_4_2_6P4_BETA2
+
+ ChangeLog@1.496.26.148 +1 -0
+ NTP_4_2_6P4_BETA2
+
+ ntpd/ntpd-opts.c@1.248.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpd/ntpd-opts.h@1.248.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpd/ntpd-opts.texi@1.246.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ ntpd/ntpd.1@1.246.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ ntpdc/ntpdc-opts.c@1.244.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpdc/ntpdc-opts.h@1.244.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpdc/ntpdc-opts.texi@1.243.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ ntpdc/ntpdc.1@1.243.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ ntpq/ntpq-opts.c@1.245.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpq/ntpq-opts.h@1.245.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpq/ntpq-opts.texi@1.244.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ ntpq/ntpq.1@1.244.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.37.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.37.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.36.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ ntpsnmpd/ntpsnmpd.1@1.122.36.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ packageinfo.sh@1.255.33.1 +1 -1
+ NTP_4_2_6P4_BETA2
+
+ sntp/sntp-opts.c@1.117.34.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ sntp/sntp-opts.h@1.117.34.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ sntp/sntp-opts.texi@1.117.33.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ sntp/sntp.1@1.117.33.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ sntp/sntp.html@1.7.34.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ util/ntp-keygen-opts.c@1.247.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ util/ntp-keygen-opts.h@1.247.36.1 +3 -3
+ NTP_4_2_6P4_BETA2
+
+ util/ntp-keygen-opts.texi@1.246.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ util/ntp-keygen.1@1.246.35.1 +2 -2
+ NTP_4_2_6P4_BETA2
+
+ChangeSet@1.2517.1.10, 2011-05-25 03:52:15+00:00, davehart@shiny.ad.hartbrothers.com
+ typo in #ifndef EREALLOC_CALLSITE hides file/line number from
+ emalloc() error message where available.
+
+ libntp/emalloc.c@1.15 +1 -1
+ typo in #ifndef EREALLOC_CALLSITE hides file/line number from
+ emalloc() error message where available.
+
+ChangeSet@1.2082.4.211, 2011-05-25 03:44:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1695] ntpdate takes longer than necessary.
+ [Bug 1832] ntpdate doesn't allow timeout > 2s.
+ [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs.
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ ChangeLog@1.496.26.147 +7 -0
+ [Bug 1695] ntpdate takes longer than necessary.
+ [Bug 1832] ntpdate doesn't allow timeout > 2s.
+ [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs.
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ include/ntp_assert.h@1.3.1.1 +54 -17
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ include/ntp_malloc.h@1.3.1.1 +46 -4
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ include/ntp_refclock.h@1.24.1.1 +1 -1
+ Use void * instead of char * for pp->unitptr to ease backports from 4.2.7.
+
+ include/ntp_stdlib.h@1.40.1.5 +37 -14
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ include/ntp_types.h@1.14.1.1 +7 -0
+ provide TRUE, FALSE definitions.
+
+ libntp/emalloc.c@1.10.1.1 +53 -79
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ libntp/msyslog.c@1.24.1.4 +80 -7
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ libntp/strdup.c@1.5.1.1 +16 -14
+ include <config.h> first, include <string.h> to resolve incompatible
+ implicit declaration warnings.
+
+ ntpd/refclock_wwvb.c@1.24.1.1 +61 -23
+ [Bug 1933] WWVB/Spectracom driver timestamps LFs, not CRs.
+
+ ntpdate/ntpdate.c@1.69.2.3 +50 -92
+ [Bug 1695] ntpdate takes longer than necessary.
+ [Bug 1832] ntpdate doesn't allow timeout > 2s.
+
+
+ ports/winnt/include/config.h@1.79.1.6 +2 -0
+ Backport utility routines from ntp-dev: mprintf(), emalloc_zero().
+
+ChangeSet@1.2517.1.9, 2011-05-24 06:09:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P172
+ TAG: NTP_4_2_7P172
+
+ ChangeLog@1.892 +1 -0
+ NTP_4_2_7P172
+
+ ntpd/ntpd-opts.c@1.177 +3 -3
+ NTP_4_2_7P172
+
+ ntpd/ntpd-opts.h@1.177 +3 -3
+ NTP_4_2_7P172
+
+ ntpd/ntpd-opts.texi@1.175 +2 -2
+ NTP_4_2_7P172
+
+ ntpd/ntpd.1@1.175 +2 -2
+ NTP_4_2_7P172
+
+ ntpdc/ntpdc-opts.c@1.170.1.4 +3 -3
+ NTP_4_2_7P172
+
+ ntpdc/ntpdc-opts.h@1.170.1.4 +3 -3
+ NTP_4_2_7P172
+
+ ntpdc/ntpdc-opts.texi@1.170.1.4 +2 -2
+ NTP_4_2_7P172
+
+ ntpdc/ntpdc.1@1.170.1.4 +2 -2
+ NTP_4_2_7P172
+
+ ntpq/ntpq-opts.c@1.174 +3 -3
+ NTP_4_2_7P172
+
+ ntpq/ntpq-opts.h@1.174 +3 -3
+ NTP_4_2_7P172
+
+ ntpq/ntpq-opts.texi@1.174 +2 -2
+ NTP_4_2_7P172
+
+ ntpq/ntpq.1@1.174 +2 -2
+ NTP_4_2_7P172
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.174 +3 -3
+ NTP_4_2_7P172
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.174 +3 -3
+ NTP_4_2_7P172
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.174 +2 -2
+ NTP_4_2_7P172
+
+ ntpsnmpd/ntpsnmpd.1@1.174 +2 -2
+ NTP_4_2_7P172
+
+ packageinfo.sh@1.175 +1 -1
+ NTP_4_2_7P172
+
+ sntp/sntp-opts.c@1.168 +3 -3
+ NTP_4_2_7P172
+
+ sntp/sntp-opts.h@1.168 +3 -3
+ NTP_4_2_7P172
+
+ sntp/sntp-opts.texi@1.168 +2 -2
+ NTP_4_2_7P172
+
+ sntp/sntp.1@1.168 +2 -2
+ NTP_4_2_7P172
+
+ sntp/sntp.html@1.168 +2 -2
+ NTP_4_2_7P172
+
+ util/ntp-keygen-opts.c@1.172 +3 -3
+ NTP_4_2_7P172
+
+ util/ntp-keygen-opts.h@1.172 +3 -3
+ NTP_4_2_7P172
+
+ util/ntp-keygen-opts.texi@1.175 +2 -2
+ NTP_4_2_7P172
+
+ util/ntp-keygen.1@1.175 +2 -2
+ NTP_4_2_7P172
+
+ChangeSet@1.2517.1.8, 2011-05-24 05:27:19+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove hardcoded 1/960 s. fudge for <CR> transmission time at 9600 8n1
+ from WWVB/Spectracom driver introduced in 4.2.7p169.
+
+ ChangeLog@1.891 +2 -0
+ Remove hardcoded 1/960 s. fudge for <CR> transmission time at 9600 8n1
+ from WWVB/Spectracom driver introduced in 4.2.7p169.
+
+ ntpd/refclock_wwvb.c@1.30 +0 -7
+ Remove hardcoded 1/960 s. fudge for <CR> transmission time at 9600 8n1
+ from WWVB/Spectracom driver introduced in 4.2.7p169.
+
+ChangeSet@1.2517.1.7, 2011-05-23 06:42:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P171
+ TAG: NTP_4_2_7P171
+
+ ChangeLog@1.890 +1 -0
+ NTP_4_2_7P171
+
+ ntpd/ntpd-opts.c@1.176 +3 -3
+ NTP_4_2_7P171
+
+ ntpd/ntpd-opts.h@1.176 +3 -3
+ NTP_4_2_7P171
+
+ ntpd/ntpd-opts.texi@1.174 +2 -2
+ NTP_4_2_7P171
+
+ ntpd/ntpd.1@1.174 +2 -2
+ NTP_4_2_7P171
+
+ ntpdc/ntpdc-opts.c@1.170.1.3 +3 -3
+ NTP_4_2_7P171
+
+ ntpdc/ntpdc-opts.h@1.170.1.3 +3 -3
+ NTP_4_2_7P171
+
+ ntpdc/ntpdc-opts.texi@1.170.1.3 +2 -2
+ NTP_4_2_7P171
+
+ ntpdc/ntpdc.1@1.170.1.3 +2 -2
+ NTP_4_2_7P171
+
+ ntpq/ntpq-opts.c@1.173 +3 -3
+ NTP_4_2_7P171
+
+ ntpq/ntpq-opts.h@1.173 +3 -3
+ NTP_4_2_7P171
+
+ ntpq/ntpq-opts.texi@1.173 +2 -2
+ NTP_4_2_7P171
+
+ ntpq/ntpq.1@1.173 +2 -2
+ NTP_4_2_7P171
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.173 +3 -3
+ NTP_4_2_7P171
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.173 +3 -3
+ NTP_4_2_7P171
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.173 +2 -2
+ NTP_4_2_7P171
+
+ ntpsnmpd/ntpsnmpd.1@1.173 +2 -2
+ NTP_4_2_7P171
+
+ packageinfo.sh@1.174 +1 -1
+ NTP_4_2_7P171
+
+ sntp/sntp-opts.c@1.167 +3 -3
+ NTP_4_2_7P171
+
+ sntp/sntp-opts.h@1.167 +3 -3
+ NTP_4_2_7P171
+
+ sntp/sntp-opts.texi@1.167 +2 -2
+ NTP_4_2_7P171
+
+ sntp/sntp.1@1.167 +2 -2
+ NTP_4_2_7P171
+
+ sntp/sntp.html@1.167 +2 -2
+ NTP_4_2_7P171
+
+ util/ntp-keygen-opts.c@1.171 +3 -3
+ NTP_4_2_7P171
+
+ util/ntp-keygen-opts.h@1.171 +3 -3
+ NTP_4_2_7P171
+
+ util/ntp-keygen-opts.texi@1.174 +2 -2
+ NTP_4_2_7P171
+
+ util/ntp-keygen.1@1.174 +2 -2
+ NTP_4_2_7P171
+
+ChangeSet@1.2517.1.6, 2011-05-23 02:28:42-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.889 +1 -0
+ Documentation updates from Dave Mills
+
+ html/discipline.html@1.4 +8 -8
+ Documentation updates from Dave Mills
+
+ html/ntpq.html@1.44 +41 -35
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.14 +4 -3
+ Documentation updates from Dave Mills
+
+ html/xleave.html@1.7 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2517.1.5, 2011-05-23 04:26:31+00:00, davehart@shiny.ad.hartbrothers.com
+ Eliminate warnings about shadowing global "basename" on Linux.
+ Use filegen_config() consistently when changing filegen options.
+ mprintf() should go to stdout, not stderr.
+ Repair a few simulator problems (more remain).
+
+ ChangeLog@1.888 +4 -0
+ Eliminate warnings about shadowing global "basename" on Linux.
+ Use filegen_config() consistently when changing filegen options.
+ mprintf() should go to stdout, not stderr.
+ Repair a few simulator problems (more remain).
+
+ include/ntp_filegen.h@1.10 +13 -12
+ Eliminate warnings about shadowing global "basename" on Linux.
+ Use filegen_config() consistently when changing filegen options.
+
+ include/ntpd.h@1.162 +10 -4
+ expose statsdir globally
+
+ include/ntpsim.h@1.16 +18 -20
+ whitespace -> tabs
+
+ libntp/msyslog.c@1.43 +1 -1
+ mprintf() should go to stdout, not stderr.
+
+ libntp/systime.c@1.55 +2 -13
+ remove empty #else block for SIM
+
+ ntpd/ntp_config.c@1.290 +13 -8
+ Eliminate warnings about shadowing global "basename" on Linux.
+ Use filegen_config() consistently when changing filegen options.
+
+ ntpd/ntp_filegen.c@1.24 +102 -71
+ Eliminate warnings about shadowing global "basename" on Linux.
+ Use filegen_config() consistently when changing filegen options.
+
+ ntpd/ntp_io.c@1.355 +71 -0
+ Move select_peerinterface() from ntp_peer.c to ntp_io.c so it can
+ use #ifdef SIM.
+
+ ntpd/ntp_monitor.c@1.39 +1 -1
+ struct interface -> endpt
+
+ ntpd/ntp_peer.c@1.147 +25 -95
+ Move select_peerinterface() from ntp_peer.c to ntp_io.c so it can
+ use #ifdef SIM.
+
+ ntpd/ntp_util.c@1.95 +9 -70
+ Eliminate warnings about shadowing global "basename" on Linux.
+ Use filegen_config() consistently when changing filegen options.
+
+ ntpd/ntpsim.c@1.32 +87 -50
+ Set msyslog_term = TRUE in ntpsim() to get syslog messages on console.
+ Use HTONL_FP() and NTOHL_FP() to byteswap simulated on-wire timestamps.
+ Use loopback IPv4 interface for simulator peer->dstadr.
+
+ ntpd/refclock_wwvb.c@1.29 +6 -0
+ timestamp 'T' polls in -D1 output
+
+ChangeSet@1.2517.1.4, 2011-05-19 11:26:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P170
+ TAG: NTP_4_2_7P170
+
+ ChangeLog@1.887 +1 -0
+ NTP_4_2_7P170
+
+ ntpd/ntpd-opts.c@1.175 +3 -3
+ NTP_4_2_7P170
+
+ ntpd/ntpd-opts.h@1.175 +3 -3
+ NTP_4_2_7P170
+
+ ntpd/ntpd-opts.texi@1.173 +2 -2
+ NTP_4_2_7P170
+
+ ntpd/ntpd.1@1.173 +2 -2
+ NTP_4_2_7P170
+
+ ntpdc/ntpdc-opts.c@1.170.1.2 +3 -3
+ NTP_4_2_7P170
+
+ ntpdc/ntpdc-opts.h@1.170.1.2 +3 -3
+ NTP_4_2_7P170
+
+ ntpdc/ntpdc-opts.texi@1.170.1.2 +2 -2
+ NTP_4_2_7P170
+
+ ntpdc/ntpdc.1@1.170.1.2 +2 -2
+ NTP_4_2_7P170
+
+ ntpq/ntpq-opts.c@1.172 +3 -3
+ NTP_4_2_7P170
+
+ ntpq/ntpq-opts.h@1.172 +3 -3
+ NTP_4_2_7P170
+
+ ntpq/ntpq-opts.texi@1.172 +2 -2
+ NTP_4_2_7P170
+
+ ntpq/ntpq.1@1.172 +2 -2
+ NTP_4_2_7P170
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.172 +3 -3
+ NTP_4_2_7P170
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.172 +3 -3
+ NTP_4_2_7P170
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.172 +2 -2
+ NTP_4_2_7P170
+
+ ntpsnmpd/ntpsnmpd.1@1.172 +2 -2
+ NTP_4_2_7P170
+
+ packageinfo.sh@1.173 +1 -1
+ NTP_4_2_7P170
+
+ sntp/sntp-opts.c@1.166 +3 -3
+ NTP_4_2_7P170
+
+ sntp/sntp-opts.h@1.166 +3 -3
+ NTP_4_2_7P170
+
+ sntp/sntp-opts.texi@1.166 +2 -2
+ NTP_4_2_7P170
+
+ sntp/sntp.1@1.166 +2 -2
+ NTP_4_2_7P170
+
+ sntp/sntp.html@1.166 +2 -2
+ NTP_4_2_7P170
+
+ util/ntp-keygen-opts.c@1.170 +3 -3
+ NTP_4_2_7P170
+
+ util/ntp-keygen-opts.h@1.170 +3 -3
+ NTP_4_2_7P170
+
+ util/ntp-keygen-opts.texi@1.173 +2 -2
+ NTP_4_2_7P170
+
+ util/ntp-keygen.1@1.173 +2 -2
+ NTP_4_2_7P170
+
+ChangeSet@1.2517.1.3, 2011-05-19 02:46:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1932] libevent/util_internal.h builtin_expect compile error with
+ gcc 2.95.
+ Use 64-bit scalars in LFPTOD() and DTOLFP() on more platforms by
+ conditionalizing on HAVE_U_INT64 rather than UINT64_MAX.
+
+ ChangeLog@1.886 +5 -1
+ [Bug 1932] libevent/util_internal.h builtin_expect compile error with
+ gcc 2.95.
+ Use 64-bit scalars in LFPTOD() and DTOLFP() on more platforms by
+ conditionalizing on HAVE_U_INT64 rather than UINT64_MAX.
+
+
+ include/ntp_fp.h@1.23 +12 -8
+ Use 64-bit scalars in LFPTOD() and DTOLFP() on more platforms by
+ conditionalizing on HAVE_U_INT64 rather than UINT64_MAX.
+
+ sntp/libevent/util-internal.h@1.4 +1 -1
+ [Bug 1932] libevent/util_internal.h builtin_expect compile error with
+ gcc 2.95.
+
+ChangeSet@1.2517.1.2, 2011-05-18 11:24:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P169
+ TAG: NTP_4_2_7P169
+
+ ChangeLog@1.885 +1 -0
+ NTP_4_2_7P169
+
+ ntpd/ntpd-opts.c@1.174 +3 -3
+ NTP_4_2_7P169
+
+ ntpd/ntpd-opts.h@1.174 +3 -3
+ NTP_4_2_7P169
+
+ ntpd/ntpd-opts.texi@1.172 +2 -2
+ NTP_4_2_7P169
+
+ ntpd/ntpd.1@1.172 +2 -2
+ NTP_4_2_7P169
+
+ ntpdc/ntpdc-opts.c@1.170.1.1 +3 -3
+ NTP_4_2_7P169
+
+ ntpdc/ntpdc-opts.h@1.170.1.1 +3 -3
+ NTP_4_2_7P169
+
+ ntpdc/ntpdc-opts.texi@1.170.1.1 +2 -2
+ NTP_4_2_7P169
+
+ ntpdc/ntpdc.1@1.170.1.1 +2 -2
+ NTP_4_2_7P169
+
+ ntpq/ntpq-opts.c@1.171 +3 -3
+ NTP_4_2_7P169
+
+ ntpq/ntpq-opts.h@1.171 +3 -3
+ NTP_4_2_7P169
+
+ ntpq/ntpq-opts.texi@1.171 +2 -2
+ NTP_4_2_7P169
+
+ ntpq/ntpq.1@1.171 +2 -2
+ NTP_4_2_7P169
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.171 +3 -3
+ NTP_4_2_7P169
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.171 +3 -3
+ NTP_4_2_7P169
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.171 +2 -2
+ NTP_4_2_7P169
+
+ ntpsnmpd/ntpsnmpd.1@1.171 +2 -2
+ NTP_4_2_7P169
+
+ packageinfo.sh@1.172 +1 -1
+ NTP_4_2_7P169
+
+ sntp/sntp-opts.c@1.165 +3 -3
+ NTP_4_2_7P169
+
+ sntp/sntp-opts.h@1.165 +3 -3
+ NTP_4_2_7P169
+
+ sntp/sntp-opts.texi@1.165 +2 -2
+ NTP_4_2_7P169
+
+ sntp/sntp.1@1.165 +2 -2
+ NTP_4_2_7P169
+
+ sntp/sntp.html@1.165 +2 -2
+ NTP_4_2_7P169
+
+ util/ntp-keygen-opts.c@1.169 +3 -3
+ NTP_4_2_7P169
+
+ util/ntp-keygen-opts.h@1.169 +3 -3
+ NTP_4_2_7P169
+
+ util/ntp-keygen-opts.texi@1.172 +2 -2
+ NTP_4_2_7P169
+
+ util/ntp-keygen.1@1.172 +2 -2
+ NTP_4_2_7P169
+
+ChangeSet@1.2520, 2011-05-18 04:48:08-04:00, stenn@psp-deb1.ntp.org
+ More cleanup around autogen-erating ntpdc.1 and ntpdc.html
+
+ sntp/ag-tpl/cmd-doc.tlib@1.1 +943 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/ag-tpl/cmd-doc.tlib
+
+ sntp/ag-tpl/cmd-doc.tlib@1.0 +0 -0
+
+ sntp/ag-tpl/mdoc2mdoc@1.1 +2 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/ag-tpl/mdoc2mdoc
+
+ sntp/ag-tpl/mdoc2mdoc@1.0 +0 -0
+
+ChangeSet@1.2519, 2011-05-18 04:46:41-04:00, stenn@psp-deb1.ntp.org
+ More cleanup around autogen-erating ntpdc.1 and ntpdc.html
+
+ .point-changed-filelist@1.10 +1 -0
+ Deal with the creation of ntpdc/ntpdc.html
+
+ ntpdc/Makefile.am@1.62 +8 -1
+ autogen ntpdc.1 cleanup
+
+ ntpdc/ntpdc-opts.def@1.16 +29 -5
+ autogen ntpdc.1 cleanup
+
+ sntp/sntp-opts.def@1.28 +2 -6
+ Use the homerc.def file like the other programs do
+
+ChangeSet@1.2517.1.1, 2011-05-17 23:17:51+00:00, davehart@shiny.ad.hartbrothers.com
+ Bug 1933 - WWVB/Spectracom driver timestamps LFs, not CRs
+
+ ChangeLog@1.884 +1 -0
+ Bug 1933 - WWVB/Spectracom driver timestamps LFs, not CRs
+
+ ntpd/refclock_wwvb.c@1.28 +49 -9
+ Bug 1933 - WWVB/Spectracom driver timestamps LFs, not CRs
+
+ChangeSet@1.2516.1.2, 2011-05-17 02:38:20-04:00, stenn@psp-deb1.ntp.org
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/ntpdc-opts.c@1.169.1.1 +95 -95
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/ntpdc-opts.h@1.169.1.1 +32 -32
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/ntpdc-opts.texi@1.169.1.1 +22 -23
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/ntpdc.1@1.169.1.1 +718 -81
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/ntpdc.html@1.1 +445 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpdc/ntpdc.html
+
+ ntpdc/ntpdc.html@1.0 +0 -0
+
+ChangeSet@1.2516.1.1, 2011-05-17 02:19:23-04:00, stenn@psp-deb1.ntp.org
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/Makefile.am@1.61 +26 -5
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/ntpdc-opts.def@1.15 +696 -25
+ Prepare for the autogen versions of ntpdc.1 and friends
+
+ ntpdc/ntpdc.texi@1.1 +88 -0
+ BitKeeper file /home/stenn/ntp-dev/ntpdc/ntpdc.texi
+
+ ntpdc/ntpdc.texi@1.0 +0 -0
+
+ChangeSet@1.2517, 2011-05-16 07:40:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P168
+ TAG: NTP_4_2_7P168
+
+ ChangeLog@1.883 +1 -0
+ NTP_4_2_7P168
+
+ ntpd/ntpd-opts.c@1.173 +3 -3
+ NTP_4_2_7P168
+
+ ntpd/ntpd-opts.h@1.173 +3 -3
+ NTP_4_2_7P168
+
+ ntpd/ntpd-opts.texi@1.171 +2 -2
+ NTP_4_2_7P168
+
+ ntpd/ntpd.1@1.171 +2 -2
+ NTP_4_2_7P168
+
+ ntpdc/ntpdc-opts.c@1.170 +3 -3
+ NTP_4_2_7P168
+
+ ntpdc/ntpdc-opts.h@1.170 +3 -3
+ NTP_4_2_7P168
+
+ ntpdc/ntpdc-opts.texi@1.170 +2 -2
+ NTP_4_2_7P168
+
+ ntpdc/ntpdc.1@1.170 +2 -2
+ NTP_4_2_7P168
+
+ ntpq/ntpq-opts.c@1.170 +3 -3
+ NTP_4_2_7P168
+
+ ntpq/ntpq-opts.h@1.170 +3 -3
+ NTP_4_2_7P168
+
+ ntpq/ntpq-opts.texi@1.170 +2 -2
+ NTP_4_2_7P168
+
+ ntpq/ntpq.1@1.170 +2 -2
+ NTP_4_2_7P168
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.170 +3 -3
+ NTP_4_2_7P168
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.170 +3 -3
+ NTP_4_2_7P168
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.170 +2 -2
+ NTP_4_2_7P168
+
+ ntpsnmpd/ntpsnmpd.1@1.170 +2 -2
+ NTP_4_2_7P168
+
+ packageinfo.sh@1.171 +1 -1
+ NTP_4_2_7P168
+
+ sntp/sntp-opts.c@1.164 +3 -3
+ NTP_4_2_7P168
+
+ sntp/sntp-opts.h@1.164 +3 -3
+ NTP_4_2_7P168
+
+ sntp/sntp-opts.texi@1.164 +2 -2
+ NTP_4_2_7P168
+
+ sntp/sntp.1@1.164 +2 -2
+ NTP_4_2_7P168
+
+ sntp/sntp.html@1.164 +2 -2
+ NTP_4_2_7P168
+
+ util/ntp-keygen-opts.c@1.168 +3 -3
+ NTP_4_2_7P168
+
+ util/ntp-keygen-opts.h@1.168 +3 -3
+ NTP_4_2_7P168
+
+ util/ntp-keygen-opts.texi@1.171 +2 -2
+ NTP_4_2_7P168
+
+ util/ntp-keygen.1@1.171 +2 -2
+ NTP_4_2_7P168
+
+ChangeSet@1.2516, 2011-05-16 05:18:56+00:00, davehart@shiny.ad.hartbrothers.com
+ Convert receive buffer queue from doubly-linked list to FIFO.
+
+ ChangeLog@1.882 +1 -0
+ Convert receive buffer queue from doubly-linked list to FIFO.
+
+ include/ntp_config.h@1.72 +0 -10
+ Convert receive buffer queue from doubly-linked list to FIFO.
+
+ include/ntp_lists.h@1.12 +50 -3
+ Convert receive buffer queue from doubly-linked list to FIFO.
+
+ include/recvbuff.h@1.25 +20 -20
+ Convert receive buffer queue from doubly-linked list to FIFO.
+
+ libntp/recvbuff.c@1.38 +52 -34
+ Convert receive buffer queue from doubly-linked list to FIFO.
+
+ ntpd/ntp_config.c@1.289 +0 -24
+ Convert receive buffer queue from doubly-linked list to FIFO.
+
+ChangeSet@1.2514, 2011-05-16 00:47:02-04:00, stenn@deacon.udel.edu
+ update the comments in packageinfo.sh
+
+ packageinfo.sh@1.170 +13 -0
+ update the comments in packageinfo.sh
+
+ChangeSet@1.2082.4.210, 2011-05-16 04:25:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P4_BETA1
+ TAG: NTP_4_2_6P4_BETA1
+
+ ChangeLog@1.496.26.146 +1 -0
+ NTP_4_2_6P4_BETA1
+
+ ntpd/ntpd-opts.c@1.248.35.1 +43 -48
+ NTP_4_2_6P4_BETA1
+
+ ntpd/ntpd-opts.h@1.248.35.1 +12 -12
+ NTP_4_2_6P4_BETA1
+
+ ntpd/ntpd-opts.texi@1.246.34.1 +4 -4
+ NTP_4_2_6P4_BETA1
+
+ ntpd/ntpd.1@1.246.34.1 +3 -2
+ NTP_4_2_6P4_BETA1
+
+ ntpdc/ntpdc-opts.c@1.244.35.1 +43 -48
+ NTP_4_2_6P4_BETA1
+
+ ntpdc/ntpdc-opts.h@1.244.35.1 +12 -12
+ NTP_4_2_6P4_BETA1
+
+ ntpdc/ntpdc-opts.texi@1.243.34.1 +12 -19
+ NTP_4_2_6P4_BETA1
+
+ ntpdc/ntpdc.1@1.243.34.1 +3 -2
+ NTP_4_2_6P4_BETA1
+
+ ntpq/ntpq-opts.c@1.245.35.1 +43 -48
+ NTP_4_2_6P4_BETA1
+
+ ntpq/ntpq-opts.h@1.245.35.1 +12 -12
+ NTP_4_2_6P4_BETA1
+
+ ntpq/ntpq-opts.texi@1.244.34.1 +10 -12
+ NTP_4_2_6P4_BETA1
+
+ ntpq/ntpq.1@1.244.34.1 +3 -2
+ NTP_4_2_6P4_BETA1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.36.1 +43 -48
+ NTP_4_2_6P4_BETA1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.36.1 +12 -12
+ NTP_4_2_6P4_BETA1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.35.1 +4 -4
+ NTP_4_2_6P4_BETA1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.35.1 +3 -2
+ NTP_4_2_6P4_BETA1
+
+ packageinfo.sh@1.255.32.1 +3 -3
+ NTP_4_2_6P4_BETA1
+
+ sntp/sntp-opts.c@1.117.33.1 +43 -48
+ NTP_4_2_6P4_BETA1
+
+ sntp/sntp-opts.h@1.117.33.1 +12 -12
+ NTP_4_2_6P4_BETA1
+
+ sntp/sntp-opts.texi@1.117.32.1 +7 -7
+ NTP_4_2_6P4_BETA1
+
+ sntp/sntp.1@1.117.32.1 +3 -2
+ NTP_4_2_6P4_BETA1
+
+ sntp/sntp.html@1.7.33.1 +7 -7
+ NTP_4_2_6P4_BETA1
+
+ util/ntp-keygen-opts.c@1.247.35.1 +52 -75
+ NTP_4_2_6P4_BETA1
+
+ util/ntp-keygen-opts.h@1.247.35.1 +12 -12
+ NTP_4_2_6P4_BETA1
+
+ util/ntp-keygen-opts.texi@1.246.34.1 +8 -7
+ NTP_4_2_6P4_BETA1
+
+ util/ntp-keygen.1@1.246.34.1 +3 -2
+ NTP_4_2_6P4_BETA1
+
+ChangeSet@1.2082.4.209, 2011-05-15 19:19:24+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1554] peer may stay selected as system peer after becoming
+ unreachable.
+ [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial
+ candidate list.
+ [Bug 1923] orphan parent favored over LOCAL, ACTS drivers.
+ [Bug 1924] Billboard tally codes sometimes do not match operation,
+ variables.
+ Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+
+ ChangeLog@1.496.26.145 +9 -0
+ [Bug 1554] peer may stay selected as system peer after becoming
+ unreachable.
+ [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial
+ candidate list.
+ [Bug 1923] orphan parent favored over LOCAL, ACTS drivers.
+ [Bug 1924] Billboard tally codes sometimes do not match operation,
+ variables.
+ Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+
+ include/ntp.h@1.168.1.6 +9 -9
+ [Bug 1924] Billboard tally codes sometimes do not match operation,
+ variables.
+
+
+ libntp/mktime.c@1.8.1.1 +2 -2
+ leading spaces -> tabs
+
+ ntpd/ntp_loopfilter.c@1.153.2.1 +1 -1
+ Comment typo
+
+ ntpd/ntp_proto.c@1.297.2.3 +37 -29
+ [Bug 1554] peer may stay selected as system peer after becoming
+ unreachable.
+ [Bug 1921] LOCAL, ACTS drivers with "prefer" excluded from initial
+ candidate list.
+ [Bug 1923] orphan parent favored over LOCAL, ACTS drivers.
+ [Bug 1924] Billboard tally codes sometimes do not match operation,
+ variables.
+
+
+ ports/winnt/include/config.h@1.79.1.5 +2 -0
+ Use _mkgmtime() for timegm() in Windows ports, resolves crash at startup
+ loading Autokey host certificate.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.38.1.5 +23 -0
+ Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+
+ChangeSet@1.2512, 2011-05-14 11:34:43+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P167
+ TAG: NTP_4_2_7P167
+
+ ChangeLog@1.879 +1 -0
+ NTP_4_2_7P167
+
+ ntpd/ntpd-opts.c@1.172 +3 -3
+ NTP_4_2_7P167
+
+ ntpd/ntpd-opts.h@1.172 +3 -3
+ NTP_4_2_7P167
+
+ ntpd/ntpd-opts.texi@1.170 +2 -2
+ NTP_4_2_7P167
+
+ ntpd/ntpd.1@1.170 +2 -2
+ NTP_4_2_7P167
+
+ ntpdc/ntpdc-opts.c@1.169 +3 -3
+ NTP_4_2_7P167
+
+ ntpdc/ntpdc-opts.h@1.169 +3 -3
+ NTP_4_2_7P167
+
+ ntpdc/ntpdc-opts.texi@1.169 +2 -2
+ NTP_4_2_7P167
+
+ ntpdc/ntpdc.1@1.169 +2 -2
+ NTP_4_2_7P167
+
+ ntpq/ntpq-opts.c@1.169 +3 -3
+ NTP_4_2_7P167
+
+ ntpq/ntpq-opts.h@1.169 +3 -3
+ NTP_4_2_7P167
+
+ ntpq/ntpq-opts.texi@1.169 +2 -2
+ NTP_4_2_7P167
+
+ ntpq/ntpq.1@1.169 +2 -2
+ NTP_4_2_7P167
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.169 +3 -3
+ NTP_4_2_7P167
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.169 +3 -3
+ NTP_4_2_7P167
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.169 +2 -2
+ NTP_4_2_7P167
+
+ ntpsnmpd/ntpsnmpd.1@1.169 +2 -2
+ NTP_4_2_7P167
+
+ packageinfo.sh@1.169 +1 -1
+ NTP_4_2_7P167
+
+ sntp/sntp-opts.c@1.163 +3 -3
+ NTP_4_2_7P167
+
+ sntp/sntp-opts.h@1.163 +3 -3
+ NTP_4_2_7P167
+
+ sntp/sntp-opts.texi@1.163 +2 -2
+ NTP_4_2_7P167
+
+ sntp/sntp.1@1.163 +2 -2
+ NTP_4_2_7P167
+
+ sntp/sntp.html@1.163 +2 -2
+ NTP_4_2_7P167
+
+ util/ntp-keygen-opts.c@1.167 +3 -3
+ NTP_4_2_7P167
+
+ util/ntp-keygen-opts.h@1.167 +3 -3
+ NTP_4_2_7P167
+
+ util/ntp-keygen-opts.texi@1.170 +2 -2
+ NTP_4_2_7P167
+
+ util/ntp-keygen.1@1.170 +2 -2
+ NTP_4_2_7P167
+
+ChangeSet@1.2511, 2011-05-14 01:11:38-04:00, stenn@deacon.udel.edu
+ 4.2.7p164 documentation updates regarding 'tos orphanwait' expanded scope
+
+ ChangeLog@1.878 +1 -0
+ 4.2.7p164 documentation updates regarding 'tos orphanwait' expanded scope
+
+ html/assoc.html@1.35 +2 -2
+ 4.2.7p164 documentation updates regarding 'tos orphanwait' expanded scope
+
+ html/miscopt.html@1.66 +3 -4
+ 4.2.7p164 documentation updates regarding 'tos orphanwait' expanded scope
+
+ html/orphan.html@1.2 +3 -3
+ 4.2.7p164 documentation updates regarding 'tos orphanwait' expanded scope
+
+ChangeSet@1.2510, 2011-05-14 03:37:31+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1931] cv always includes fudgetime1, never fudgetime2.
+
+ ChangeLog@1.877 +1 -0
+ [Bug 1931] cv always includes fudgetime1, never fudgetime2.
+
+ ntpd/ntp_control.c@1.169 +33 -32
+ [Bug 1931] cv always includes fudgetime1, never fudgetime2.
+
+ ntpd/ntp_refclock.c@1.107 +17 -6
+ [Bug 1931] cv always includes fudgetime1, never fudgetime2.
+
+ChangeSet@1.2509, 2011-05-13 21:38:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1927] io_closeclock() should purge pending recvbufs.
+ Use acts_close() in acts_shutdown() to avoid leaving a stale lockfile
+ if unpeered via runtime configuration while the modem is open.
+ Correct acts_close() test of pp->io.fd to see if it is open.
+
+ ChangeLog@1.876 +4 -0
+ [Bug 1927] io_closeclock() should purge pending recvbufs.
+ Use acts_close() in acts_shutdown() to avoid leaving a stale lockfile
+ if unpeered via runtime configuration while the modem is open.
+ Correct acts_close() test of pp->io.fd to see if it is open.
+
+ include/recvbuff.h@1.24 +21 -14
+ [Bug 1927] io_closeclock() should purge pending recvbufs.
+
+ libntp/recvbuff.c@1.37 +35 -1
+ [Bug 1927] io_closeclock() should purge pending recvbufs.
+
+ ntpd/ntp_io.c@1.354 +15 -22
+ [Bug 1927] io_closeclock() should purge pending recvbufs.
+
+ ntpd/refclock_acts.c@1.51 +7 -9
+ Use acts_close() in acts_shutdown() to avoid leaving a stale lockfile
+ if unpeered via runtime configuration while the modem is open.
+ Correct acts_close() test of pp->io.fd to see if it is open.
+
+ChangeSet@1.2508, 2011-05-13 11:42:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P166
+ TAG: NTP_4_2_7P166
+
+ ChangeLog@1.875 +1 -0
+ NTP_4_2_7P166
+
+ ntpd/ntpd-opts.c@1.171 +3 -3
+ NTP_4_2_7P166
+
+ ntpd/ntpd-opts.h@1.171 +3 -3
+ NTP_4_2_7P166
+
+ ntpd/ntpd-opts.texi@1.169 +2 -2
+ NTP_4_2_7P166
+
+ ntpd/ntpd.1@1.169 +2 -2
+ NTP_4_2_7P166
+
+ ntpdc/ntpdc-opts.c@1.168 +3 -3
+ NTP_4_2_7P166
+
+ ntpdc/ntpdc-opts.h@1.168 +3 -3
+ NTP_4_2_7P166
+
+ ntpdc/ntpdc-opts.texi@1.168 +2 -2
+ NTP_4_2_7P166
+
+ ntpdc/ntpdc.1@1.168 +2 -2
+ NTP_4_2_7P166
+
+ ntpq/ntpq-opts.c@1.168 +3 -3
+ NTP_4_2_7P166
+
+ ntpq/ntpq-opts.h@1.168 +3 -3
+ NTP_4_2_7P166
+
+ ntpq/ntpq-opts.texi@1.168 +2 -2
+ NTP_4_2_7P166
+
+ ntpq/ntpq.1@1.168 +2 -2
+ NTP_4_2_7P166
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.168 +3 -3
+ NTP_4_2_7P166
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.168 +3 -3
+ NTP_4_2_7P166
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.168 +2 -2
+ NTP_4_2_7P166
+
+ ntpsnmpd/ntpsnmpd.1@1.168 +2 -2
+ NTP_4_2_7P166
+
+ packageinfo.sh@1.168 +1 -1
+ NTP_4_2_7P166
+
+ sntp/sntp-opts.c@1.162 +3 -3
+ NTP_4_2_7P166
+
+ sntp/sntp-opts.h@1.162 +3 -3
+ NTP_4_2_7P166
+
+ sntp/sntp-opts.texi@1.162 +2 -2
+ NTP_4_2_7P166
+
+ sntp/sntp.1@1.162 +27 -22
+ NTP_4_2_7P166
+
+ sntp/sntp.html@1.162 +2 -2
+ NTP_4_2_7P166
+
+ util/ntp-keygen-opts.c@1.166 +3 -3
+ NTP_4_2_7P166
+
+ util/ntp-keygen-opts.h@1.166 +3 -3
+ NTP_4_2_7P166
+
+ util/ntp-keygen-opts.texi@1.169 +2 -2
+ NTP_4_2_7P166
+
+ util/ntp-keygen.1@1.169 +2 -2
+ NTP_4_2_7P166
+
+ChangeSet@1.2507, 2011-05-13 06:05:54-04:00, stenn@psp-deb1.ntp.org
+ Distribute sntp/ag-tpl/
+
+ sntp/Makefile.am@1.62 +1 -0
+ Distribute sntp/ag-tpl/
+
+ChangeSet@1.2506, 2011-05-13 05:08:53-04:00, stenn@psp-deb1.ntp.org
+ Use our autogen templates if we have any
+
+ ChangeLog@1.874 +2 -0
+ Use our autogen templates if we have any
+
+ sntp/Makefile.am@1.61 +1 -1
+ Use our autogen templates if we have any
+
+ sntp/ag-tpl/agmdoc-cmd.tpl@1.1 +115 -0
+ BitKeeper file /home/stenn/ntp-dev/sntp/ag-tpl/agmdoc-cmd.tpl
+
+ sntp/ag-tpl/agmdoc-cmd.tpl@1.0 +0 -0
+
+ sntp/sntp-opts.def@1.27 +24 -20
+ Update sntp docs
+
+ChangeSet@1.2505, 2011-05-11 19:29:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P165
+ TAG: NTP_4_2_7P165
+
+ ChangeLog@1.873 +1 -0
+ NTP_4_2_7P165
+
+ ntpd/ntpd-opts.c@1.170 +5 -5
+ NTP_4_2_7P165
+
+ ntpd/ntpd-opts.h@1.170 +3 -3
+ NTP_4_2_7P165
+
+ ntpd/ntpd-opts.texi@1.168 +2 -2
+ NTP_4_2_7P165
+
+ ntpd/ntpd.1@1.168 +2 -2
+ NTP_4_2_7P165
+
+ ntpdc/ntpdc-opts.c@1.167 +5 -5
+ NTP_4_2_7P165
+
+ ntpdc/ntpdc-opts.h@1.167 +3 -3
+ NTP_4_2_7P165
+
+ ntpdc/ntpdc-opts.texi@1.167 +2 -2
+ NTP_4_2_7P165
+
+ ntpdc/ntpdc.1@1.167 +2 -2
+ NTP_4_2_7P165
+
+ ntpq/ntpq-opts.c@1.167 +5 -5
+ NTP_4_2_7P165
+
+ ntpq/ntpq-opts.h@1.167 +3 -3
+ NTP_4_2_7P165
+
+ ntpq/ntpq-opts.texi@1.167 +2 -2
+ NTP_4_2_7P165
+
+ ntpq/ntpq.1@1.167 +2 -2
+ NTP_4_2_7P165
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.167 +5 -5
+ NTP_4_2_7P165
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.167 +3 -3
+ NTP_4_2_7P165
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.167 +2 -2
+ NTP_4_2_7P165
+
+ ntpsnmpd/ntpsnmpd.1@1.167 +2 -2
+ NTP_4_2_7P165
+
+ packageinfo.sh@1.167 +1 -1
+ NTP_4_2_7P165
+
+ sntp/sntp-opts.c@1.161 +60 -60
+ NTP_4_2_7P165
+
+ sntp/sntp-opts.h@1.161 +24 -24
+ NTP_4_2_7P165
+
+ sntp/sntp-opts.texi@1.161 +23 -18
+ NTP_4_2_7P165
+
+ sntp/sntp.1@1.161 +127 -121
+ NTP_4_2_7P165
+
+ sntp/sntp.html@1.161 +23 -18
+ NTP_4_2_7P165
+
+ util/ntp-keygen-opts.c@1.165 +5 -5
+ NTP_4_2_7P165
+
+ util/ntp-keygen-opts.h@1.165 +3 -3
+ NTP_4_2_7P165
+
+ util/ntp-keygen-opts.texi@1.168 +2 -2
+ NTP_4_2_7P165
+
+ util/ntp-keygen.1@1.168 +2 -2
+ NTP_4_2_7P165
+
+ChangeSet@1.2082.4.208, 2011-05-11 04:40:35-04:00, stenn@deacon.udel.edu
+ Upgrade to AutoGen 5.11.9 (and require it)
+
+ ChangeLog@1.496.26.144 +1 -0
+ Upgrade to AutoGen 5.11.9 (and require it)
+
+ include/autogen-version.def@1.4.1.1 +1 -1
+ Upgrade to AutoGen 5.11.9 (and require it)
+
+ChangeSet@1.2503, 2011-05-11 03:21:39-04:00, stenn@psp-deb1.ntp.org
+ Convert snmp docs to mdoc format, which requires autogen 5.11.9
+
+ ChangeLog@1.871 +1 -0
+ Convert snmp docs to mdoc format, which requires autogen 5.11.9
+
+ sntp/Makefile.am@1.60 +3 -1
+ Convert snmp docs to mdoc format, which requires autogen 5.11.9
+
+ sntp/include/autogen-version.def@1.6 +1 -1
+ Upgrade autogen to 5.11.9
+
+ sntp/sntp-opts.def@1.26 +146 -130
+ Convert snmp docs to mdoc format, which requires autogen 5.11.9
+
+ sntp/sntp.texi@1.8 +1 -1
+ Convert snmp docs to mdoc format, which requires autogen 5.11.9
+
+ChangeSet@1.2502, 2011-05-11 00:48:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P164
+ TAG: NTP_4_2_7P164
+
+ ChangeLog@1.870 +1 -0
+ NTP_4_2_7P164
+
+ ntpd/ntpd-opts.c@1.169 +3 -3
+ NTP_4_2_7P164
+
+ ntpd/ntpd-opts.h@1.169 +3 -3
+ NTP_4_2_7P164
+
+ ntpd/ntpd-opts.texi@1.167 +2 -2
+ NTP_4_2_7P164
+
+ ntpd/ntpd.1@1.167 +2 -2
+ NTP_4_2_7P164
+
+ ntpdc/ntpdc-opts.c@1.166 +3 -3
+ NTP_4_2_7P164
+
+ ntpdc/ntpdc-opts.h@1.166 +3 -3
+ NTP_4_2_7P164
+
+ ntpdc/ntpdc-opts.texi@1.166 +2 -2
+ NTP_4_2_7P164
+
+ ntpdc/ntpdc.1@1.166 +2 -2
+ NTP_4_2_7P164
+
+ ntpq/ntpq-opts.c@1.166 +3 -3
+ NTP_4_2_7P164
+
+ ntpq/ntpq-opts.h@1.166 +3 -3
+ NTP_4_2_7P164
+
+ ntpq/ntpq-opts.texi@1.166 +2 -2
+ NTP_4_2_7P164
+
+ ntpq/ntpq.1@1.166 +2 -2
+ NTP_4_2_7P164
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.166 +3 -3
+ NTP_4_2_7P164
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.166 +3 -3
+ NTP_4_2_7P164
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.166 +2 -2
+ NTP_4_2_7P164
+
+ ntpsnmpd/ntpsnmpd.1@1.166 +2 -2
+ NTP_4_2_7P164
+
+ packageinfo.sh@1.166 +1 -1
+ NTP_4_2_7P164
+
+ sntp/sntp-opts.c@1.160 +3 -3
+ NTP_4_2_7P164
+
+ sntp/sntp-opts.h@1.160 +3 -3
+ NTP_4_2_7P164
+
+ sntp/sntp-opts.texi@1.160 +2 -2
+ NTP_4_2_7P164
+
+ sntp/sntp.1@1.160 +2 -2
+ NTP_4_2_7P164
+
+ sntp/sntp.html@1.160 +1 -1
+ NTP_4_2_7P164
+
+ util/ntp-keygen-opts.c@1.164 +3 -3
+ NTP_4_2_7P164
+
+ util/ntp-keygen-opts.h@1.164 +3 -3
+ NTP_4_2_7P164
+
+ util/ntp-keygen-opts.texi@1.167 +2 -2
+ NTP_4_2_7P164
+
+ util/ntp-keygen.1@1.167 +2 -2
+ NTP_4_2_7P164
+
+ChangeSet@1.2501, 2011-05-10 15:46:36-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.869 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.20 +36 -52
+ Documentation updates from Dave Mills
+
+ html/drivers/driver6.html@1.27 +1 -2
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.65 +2 -2
+ Documentation updates from Dave Mills
+
+ html/release.html@1.40 +9 -7
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.13 +8 -7
+ Documentation updates from Dave Mills
+
+ html/xleave.html@1.6 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2479.13.2, 2011-05-09 23:20:17+00:00, davehart@shiny.ad.hartbrothers.com
+ Update ChangeLog additions for ntp_proto.c changes to reference newly-filed
+ bug reports: [Bug 1921] [Bug 1922] [Bug 1923] [Bug 1924]
+
+ ChangeLog@1.867 +9 -5
+ Update ChangeLog additions for ntp_proto.c changes to reference newly-filed
+ bug reports: [Bug 1921] [Bug 1922] [Bug 1923] [Bug 1924]
+
+ChangeSet@1.2499, 2011-05-08 09:10:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P163
+ TAG: NTP_4_2_7P163
+
+ ChangeLog@1.865.1.11 +1 -0
+ NTP_4_2_7P163
+
+ ntpd/ntpd-opts.c@1.168 +3 -3
+ NTP_4_2_7P163
+
+ ntpd/ntpd-opts.h@1.168 +3 -3
+ NTP_4_2_7P163
+
+ ntpd/ntpd-opts.texi@1.166 +2 -2
+ NTP_4_2_7P163
+
+ ntpd/ntpd.1@1.166 +2 -2
+ NTP_4_2_7P163
+
+ ntpdc/ntpdc-opts.c@1.165 +3 -3
+ NTP_4_2_7P163
+
+ ntpdc/ntpdc-opts.h@1.165 +3 -3
+ NTP_4_2_7P163
+
+ ntpdc/ntpdc-opts.texi@1.165 +2 -2
+ NTP_4_2_7P163
+
+ ntpdc/ntpdc.1@1.165 +2 -2
+ NTP_4_2_7P163
+
+ ntpq/ntpq-opts.c@1.165 +3 -3
+ NTP_4_2_7P163
+
+ ntpq/ntpq-opts.h@1.165 +3 -3
+ NTP_4_2_7P163
+
+ ntpq/ntpq-opts.texi@1.165 +2 -2
+ NTP_4_2_7P163
+
+ ntpq/ntpq.1@1.165 +2 -2
+ NTP_4_2_7P163
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.165 +3 -3
+ NTP_4_2_7P163
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.165 +3 -3
+ NTP_4_2_7P163
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.165 +2 -2
+ NTP_4_2_7P163
+
+ ntpsnmpd/ntpsnmpd.1@1.165 +2 -2
+ NTP_4_2_7P163
+
+ packageinfo.sh@1.165 +1 -1
+ NTP_4_2_7P163
+
+ sntp/sntp-opts.c@1.159 +3 -3
+ NTP_4_2_7P163
+
+ sntp/sntp-opts.h@1.159 +3 -3
+ NTP_4_2_7P163
+
+ sntp/sntp-opts.texi@1.159 +2 -2
+ NTP_4_2_7P163
+
+ sntp/sntp.1@1.159 +2 -2
+ NTP_4_2_7P163
+
+ sntp/sntp.html@1.159 +1 -1
+ NTP_4_2_7P163
+
+ util/ntp-keygen-opts.c@1.163 +3 -3
+ NTP_4_2_7P163
+
+ util/ntp-keygen-opts.h@1.163 +3 -3
+ NTP_4_2_7P163
+
+ util/ntp-keygen-opts.texi@1.166 +2 -2
+ NTP_4_2_7P163
+
+ util/ntp-keygen.1@1.166 +2 -2
+ NTP_4_2_7P163
+
+ChangeSet@1.2498, 2011-05-08 01:58:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1911] missing curly brace in libntp/ntp_rfc2553.c
+
+ ChangeLog@1.865.1.10 +1 -0
+ [Bug 1911] missing curly brace in libntp/ntp_rfc2553.c
+
+ libntp/ntp_rfc2553.c@1.47 +57 -35
+ [Bug 1911] missing curly brace in libntp/ntp_rfc2553.c
+ Refactor copy_addrinfo_common() code out of copy_addrinfo_impl()
+ and copy_addrinfo_list_impl().
+
+ChangeSet@1.2497, 2011-05-03 09:00:25+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P162
+ TAG: NTP_4_2_7P162
+
+ ChangeLog@1.865.1.9 +1 -0
+ NTP_4_2_7P162
+
+ ntpd/ntpd-opts.c@1.167 +3 -3
+ NTP_4_2_7P162
+
+ ntpd/ntpd-opts.h@1.167 +3 -3
+ NTP_4_2_7P162
+
+ ntpd/ntpd-opts.texi@1.165 +2 -2
+ NTP_4_2_7P162
+
+ ntpd/ntpd.1@1.165 +2 -2
+ NTP_4_2_7P162
+
+ ntpdc/ntpdc-opts.c@1.164 +3 -3
+ NTP_4_2_7P162
+
+ ntpdc/ntpdc-opts.h@1.164 +3 -3
+ NTP_4_2_7P162
+
+ ntpdc/ntpdc-opts.texi@1.164 +2 -2
+ NTP_4_2_7P162
+
+ ntpdc/ntpdc.1@1.164 +2 -2
+ NTP_4_2_7P162
+
+ ntpq/ntpq-opts.c@1.164 +3 -3
+ NTP_4_2_7P162
+
+ ntpq/ntpq-opts.h@1.164 +3 -3
+ NTP_4_2_7P162
+
+ ntpq/ntpq-opts.texi@1.164 +2 -2
+ NTP_4_2_7P162
+
+ ntpq/ntpq.1@1.164 +2 -2
+ NTP_4_2_7P162
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.164 +3 -3
+ NTP_4_2_7P162
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.164 +3 -3
+ NTP_4_2_7P162
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.164 +2 -2
+ NTP_4_2_7P162
+
+ ntpsnmpd/ntpsnmpd.1@1.164 +2 -2
+ NTP_4_2_7P162
+
+ packageinfo.sh@1.164 +1 -1
+ NTP_4_2_7P162
+
+ sntp/sntp-opts.c@1.158 +3 -3
+ NTP_4_2_7P162
+
+ sntp/sntp-opts.h@1.158 +3 -3
+ NTP_4_2_7P162
+
+ sntp/sntp-opts.texi@1.158 +2 -2
+ NTP_4_2_7P162
+
+ sntp/sntp.1@1.158 +2 -2
+ NTP_4_2_7P162
+
+ sntp/sntp.html@1.158 +1 -1
+ NTP_4_2_7P162
+
+ util/ntp-keygen-opts.c@1.162 +3 -3
+ NTP_4_2_7P162
+
+ util/ntp-keygen-opts.h@1.162 +3 -3
+ NTP_4_2_7P162
+
+ util/ntp-keygen-opts.texi@1.165 +2 -2
+ NTP_4_2_7P162
+
+ util/ntp-keygen.1@1.165 +2 -2
+ NTP_4_2_7P162
+
+ChangeSet@1.2496, 2011-05-02 21:16:22-07:00, harlan@hms-mbp.local
+ [Bug 1910] Support the Tristate Ltd. TS-GPSclock-01
+
+ ChangeLog@1.865.1.8 +1 -0
+ [Bug 1910] Support the Tristate Ltd. TS-GPSclock-01
+
+ html/drivers/driver40.html@1.15 +95 -23
+ [Bug 1910] Support the Tristate Ltd. TS-GPSclock-01
+
+ ntpd/refclock_jjy.c@1.24 +368 -24
+ [Bug 1910] Support the Tristate Ltd. TS-GPSclock-01
+
+ChangeSet@1.2495, 2011-05-02 17:58:58-04:00, stenn@deacon.udel.edu
+ more ignore file cleanup
+
+ BitKeeper/etc/ignore@1.80 +7 -11
+ more ignore file cleanup
+
+ChangeSet@1.2494, 2011-05-02 21:14:30+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P161
+ TAG: NTP_4_2_7P161
+
+ ChangeLog@1.865.1.7 +1 -0
+ NTP_4_2_7P161
+
+ ntpd/ntpd-opts.c@1.166 +3 -3
+ NTP_4_2_7P161
+
+ ntpd/ntpd-opts.h@1.166 +3 -3
+ NTP_4_2_7P161
+
+ ntpd/ntpd-opts.texi@1.164 +2 -2
+ NTP_4_2_7P161
+
+ ntpd/ntpd.1@1.164 +2 -2
+ NTP_4_2_7P161
+
+ ntpdc/ntpdc-opts.c@1.163 +3 -3
+ NTP_4_2_7P161
+
+ ntpdc/ntpdc-opts.h@1.163 +3 -3
+ NTP_4_2_7P161
+
+ ntpdc/ntpdc-opts.texi@1.163 +2 -2
+ NTP_4_2_7P161
+
+ ntpdc/ntpdc.1@1.163 +2 -2
+ NTP_4_2_7P161
+
+ ntpq/ntpq-opts.c@1.163 +3 -3
+ NTP_4_2_7P161
+
+ ntpq/ntpq-opts.h@1.163 +3 -3
+ NTP_4_2_7P161
+
+ ntpq/ntpq-opts.texi@1.163 +2 -2
+ NTP_4_2_7P161
+
+ ntpq/ntpq.1@1.163 +2 -2
+ NTP_4_2_7P161
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.163 +3 -3
+ NTP_4_2_7P161
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.163 +3 -3
+ NTP_4_2_7P161
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.163 +2 -2
+ NTP_4_2_7P161
+
+ ntpsnmpd/ntpsnmpd.1@1.163 +2 -2
+ NTP_4_2_7P161
+
+ packageinfo.sh@1.163 +1 -1
+ NTP_4_2_7P161
+
+ sntp/sntp-opts.c@1.157 +3 -3
+ NTP_4_2_7P161
+
+ sntp/sntp-opts.h@1.157 +3 -3
+ NTP_4_2_7P161
+
+ sntp/sntp-opts.texi@1.157 +2 -2
+ NTP_4_2_7P161
+
+ sntp/sntp.1@1.157 +2 -2
+ NTP_4_2_7P161
+
+ sntp/sntp.html@1.157 +1 -1
+ NTP_4_2_7P161
+
+ util/ntp-keygen-opts.c@1.161 +3 -3
+ NTP_4_2_7P161
+
+ util/ntp-keygen-opts.h@1.161 +3 -3
+ NTP_4_2_7P161
+
+ util/ntp-keygen-opts.texi@1.164 +2 -2
+ NTP_4_2_7P161
+
+ util/ntp-keygen.1@1.164 +2 -2
+ NTP_4_2_7P161
+
+ChangeSet@1.2493, 2011-05-01 22:57:03+00:00, davehart@shiny.ad.hartbrothers.com
+ Add missing --enable-local-libevent help to top-level configure.
+
+ ChangeLog@1.865.1.6 +1 -0
+ Add missing --enable-local-libevent help to top-level configure.
+
+ configure.ac@1.527 +2 -0
+ Add missing --enable-local-libevent help to top-level configure.
+
+ sntp/m4/ntp_libevent.m4@1.7 +24 -10
+ Add missing --enable-local-libevent help to top-level configure.
+
+ChangeSet@1.2492, 2011-05-01 21:15:54+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ ChangeLog@1.865.1.5 +4 -0
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ Makefile.am@1.109 +1 -1
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ build@1.45 +2 -2
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ configure.ac@1.526 +1 -1
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ flock-build@1.52 +1 -1
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ sntp/configure.ac@1.61 +1 -1
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ sntp/libevent/configure.in@1.7 +1 -0
+ [Bug 1906] 4.2.7p160 - libtool: compile: cannot determine name of
+ library object in ./libevent
+ Share a single sntp/libevent/build-aux directory between all three
+ configure scripts.
+
+ChangeSet@1.2491, 2011-05-01 10:40:29+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog entry needed for -dev, which rolled with the bug.
+
+ ChangeLog@1.865.1.4 +1 -0
+ ChangeLog entry needed for -dev, which rolled with the bug.
+
+ChangeSet@1.2082.4.207, 2011-05-01 10:37:55+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1904] New: 4.2.7p160 Windows build broken (POSIX_SHELL).
+
+ ports/winnt/include/config.h@1.79.1.4 +1 -0
+ [Bug 1904] New: 4.2.7p160 Windows build broken (POSIX_SHELL).
+
+ChangeSet@1.2489, 2011-05-01 08:30:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P160
+ TAG: NTP_4_2_7P160
+
+ ChangeLog@1.865.1.3 +1 -0
+ NTP_4_2_7P160
+
+ ntpd/ntpd-opts.c@1.165 +41 -46
+ NTP_4_2_7P160
+
+ ntpd/ntpd-opts.h@1.165 +12 -12
+ NTP_4_2_7P160
+
+ ntpd/ntpd-opts.texi@1.163 +2 -2
+ NTP_4_2_7P160
+
+ ntpd/ntpd.1@1.163 +3 -2
+ NTP_4_2_7P160
+
+ ntpdc/ntpdc-opts.c@1.162 +41 -46
+ NTP_4_2_7P160
+
+ ntpdc/ntpdc-opts.h@1.162 +12 -12
+ NTP_4_2_7P160
+
+ ntpdc/ntpdc-opts.texi@1.162 +2 -2
+ NTP_4_2_7P160
+
+ ntpdc/ntpdc.1@1.162 +3 -2
+ NTP_4_2_7P160
+
+ ntpq/ntpq-opts.c@1.162 +41 -46
+ NTP_4_2_7P160
+
+ ntpq/ntpq-opts.h@1.162 +12 -12
+ NTP_4_2_7P160
+
+ ntpq/ntpq-opts.texi@1.162 +2 -2
+ NTP_4_2_7P160
+
+ ntpq/ntpq.1@1.162 +3 -2
+ NTP_4_2_7P160
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.162 +41 -46
+ NTP_4_2_7P160
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.162 +12 -12
+ NTP_4_2_7P160
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.162 +2 -2
+ NTP_4_2_7P160
+
+ ntpsnmpd/ntpsnmpd.1@1.162 +3 -2
+ NTP_4_2_7P160
+
+ packageinfo.sh@1.162 +1 -1
+ NTP_4_2_7P160
+
+ sntp/sntp-opts.c@1.156 +57 -97
+ NTP_4_2_7P160
+
+ sntp/sntp-opts.h@1.156 +12 -12
+ NTP_4_2_7P160
+
+ sntp/sntp-opts.texi@1.156 +6 -4
+ NTP_4_2_7P160
+
+ sntp/sntp.1@1.156 +69 -90
+ NTP_4_2_7P160
+
+ sntp/sntp.html@1.156 +5 -3
+ NTP_4_2_7P160
+
+ util/ntp-keygen-opts.c@1.160 +50 -73
+ NTP_4_2_7P160
+
+ util/ntp-keygen-opts.h@1.160 +12 -12
+ NTP_4_2_7P160
+
+ util/ntp-keygen-opts.texi@1.163 +4 -3
+ NTP_4_2_7P160
+
+ util/ntp-keygen.1@1.163 +3 -2
+ NTP_4_2_7P160
+
+ChangeSet@1.2082.4.206, 2011-05-01 02:47:38-04:00, stenn@deacon.udel.edu
+ hack around a possible regression in the new autogen
+
+ include/copyright.def@1.13.1.1 +4 -1
+ hack around a possible regression in the new autogen
+
+ChangeSet@1.2082.4.205, 2011-05-01 02:41:53-04:00, stenn@deacon.udel.edu
+ Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8
+
+ ChangeLog@1.496.26.143 +4 -0
+ Upgrade to libopts 35.0.10 from AutoGen 5.11.9pre8
+
+ sntp/libopts/Makefile.am@1.10 +16 -16
+ Updated to libopts-35.0.10
+
+ sntp/libopts/ag-char-map.h@1.13 +6 -6
+ Updated to libopts-35.0.10
+
+ sntp/libopts/autoopts.c@1.10 +2 -12
+ Updated to libopts-35.0.10
+
+ sntp/libopts/autoopts.h@1.9 +3 -37
+ Updated to libopts-35.0.10
+
+ sntp/libopts/autoopts/options.h@1.12 +21 -23
+ Updated to libopts-35.0.10
+
+ sntp/libopts/autoopts/project.h@1.1 +50 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts/project.h
+
+ sntp/libopts/autoopts/project.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.12 +100 -95
+ Updated to libopts-35.0.10
+
+ sntp/libopts/configfile.c@1.11 +9 -9
+ Updated to libopts-35.0.10
+
+ sntp/libopts/cook.c@1.8 +85 -67
+ Updated to libopts-35.0.10
+
+ sntp/libopts/enumeration.c@1.8 +15 -10
+ Updated to libopts-35.0.10
+
+ sntp/libopts/environment.c@1.10 +22 -13
+ Updated to libopts-35.0.10
+
+ sntp/libopts/genshell.c@1.13 +58 -56
+ Updated to libopts-35.0.10
+
+ sntp/libopts/genshell.h@1.13 +46 -46
+ Updated to libopts-35.0.10
+
+ sntp/libopts/libopts.c@1.3 +5 -2
+ Updated to libopts-35.0.10
+
+ sntp/libopts/m4/libopts.m4@1.16 +22 -3
+ Updated to libopts-35.0.10
+
+ sntp/libopts/makeshell.c@1.9 +84 -58
+ Updated to libopts-35.0.10
+
+ sntp/libopts/numeric.c@1.8 +39 -47
+ Updated to libopts-35.0.10
+
+ sntp/libopts/parse-duration.c@1.5 +73 -54
+ Updated to libopts-35.0.10
+
+ sntp/libopts/parse-duration.h@1.5 +14 -14
+ Updated to libopts-35.0.10
+
+ sntp/libopts/pgusage.c@1.8 +1 -3
+ Updated to libopts-35.0.10
+
+ sntp/libopts/proto.h@1.13 +1 -4
+ Updated to libopts-35.0.10
+
+ sntp/libopts/save.c@1.9 +34 -41
+ Updated to libopts-35.0.10
+
+ sntp/libopts/time.c@1.8 +77 -29
+ Updated to libopts-35.0.10
+
+ sntp/libopts/value-type.h@1.13 +1 -1
+ Updated to libopts-35.0.10
+
+ sntp/libopts/version.c@1.8 +82 -51
+ Updated to libopts-35.0.10
+
+ sntp/libopts/xat-attribute.h@1.13 +1 -1
+ Updated to libopts-35.0.10
+
+ChangeSet@1.2487, 2011-04-30 03:15:11-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1901] Simulator does not set progname.
+
+ ChangeLog@1.865.1.1 +1 -0
+ [Bug 1901] Simulator does not set progname.
+
+ ntpd/ntpd.c@1.126 +1 -0
+ [Bug 1901] Simulator does not set progname.
+
+ChangeSet@1.2479.13.1, 2011-04-29 19:44:06+00:00, davehart@shiny.ad.hartbrothers.com
+ Change "pool DNS" messages from msyslog to debug trace output.
+ Prefer LOCAL and ACTS drivers to orphan parent peer as documented.
+ Include LOCAL and ACTS drivers marked prefer in candidate list.
+ Remove unused FLAG_SYSPEER from peer->status.
+ Respect "tos orphanwait 0" at startup. Previously there was an
+ unconditional 300 s. startup orphanwait, though other values were
+ respected for subsequent orphan wait periods after no_sys_peer events.
+ Apply "tos orphanwait" (def. 300 seconds) to LOCAL and ACTS reference
+ clock drivers, in addition to orphan parent operation. LOCAL and ACTS
+ are not selectable during the orphanwait delay at startup and after
+ each no_sys_peer event. This prevents a particular form of clock-
+ hopping, such as using LOCAL briefly at startup before remote peers
+ are selectable. This fixes the issue reported in [Bug 988].
+ [Bug 988] Local clock eats up -g option, so ntpd stops with large
+ initial time offset.
+
+ ChangeLog@1.866 +15 -0
+ Change "pool DNS" messages from msyslog to debug trace output.
+ Prefer LOCAL and ACTS drivers to orphan parent peer as documented.
+ Include LOCAL and ACTS drivers marked prefer in candidate list.
+ Remove unused FLAG_SYSPEER from peer->status.
+ Respect "tos orphanwait 0" at startup. Previously there was an
+ unconditional 300 s. startup orphanwait, though other values were
+ respected for subsequent orphan wait periods after no_sys_peer events.
+ Apply "tos orphanwait" (def. 300 seconds) to LOCAL and ACTS reference
+ clock drivers, in addition to orphan parent operation. LOCAL and ACTS
+ are not selectable during the orphanwait delay at startup and after
+ each no_sys_peer event. This prevents a particular form of clock-
+ hopping, such as using LOCAL briefly at startup before remote peers
+ are selectable. This fixes the issue reported in [Bug 988].
+ [Bug 988] Local clock eats up -g option, so ntpd stops with large
+ initial time offset.
+
+ include/ntp.h@1.194 +9 -9
+ Remove unused FLAG_SYSPEER from peer->status.
+
+ ntpd/ntp_loopfilter.c@1.163 +1 -1
+ comment typo fix
+
+ ntpd/ntp_proto.c@1.321 +41 -33
+ Change "pool DNS" messages from msyslog to debug trace output.
+ Prefer LOCAL and ACTS drivers to orphan parent peer as documented.
+ Include LOCAL and ACTS drivers marked prefer in candidate list.
+ Remove unused FLAG_SYSPEER from peer->status.
+ Respect "tos orphanwait 0" at startup. Previously there was an
+ unconditional 300 s. startup orphanwait, though other values were
+ respected for subsequent orphan wait periods after no_sys_peer events.
+ Apply "tos orphanwait" (def. 300 seconds) to LOCAL and ACTS reference
+ clock drivers, in addition to orphan parent operation. LOCAL and ACTS
+ are not selectable during the orphanwait delay at startup and after
+ each no_sys_peer event. This prevents a particular form of clock-
+ hopping, such as using LOCAL briefly at startup before remote peers
+ are selectable. This fixes the issue reported in [Bug 988].
+ [Bug 988] Local clock eats up -g option, so ntpd stops with large
+ initial time offset.
+
+ ntpd/refclock_acts.c@1.50 +7 -6
+ whitespace-only cleanup
+
+ChangeSet@1.2479.1.82, 2011-04-28 21:42:13-04:00, stenn@deacon.udel.edu
+ cleanup the bk ignore file - add sntp/scm-rev, remove old version stuff
+
+ BitKeeper/etc/ignore@1.79 +12 -11
+ cleanup the bk ignore file - add sntp/scm-rev, remove old version stuff
+
+ChangeSet@1.2479.1.81, 2011-04-28 06:47:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P159
+ TAG: NTP_4_2_7P159
+
+ ChangeLog@1.865 +1 -0
+ NTP_4_2_7P159
+
+ ntpd/ntpd-opts.c@1.164 +2 -2
+ NTP_4_2_7P159
+
+ ntpd/ntpd-opts.h@1.164 +3 -3
+ NTP_4_2_7P159
+
+ ntpd/ntpd-opts.texi@1.162 +2 -2
+ NTP_4_2_7P159
+
+ ntpd/ntpd.1@1.162 +2 -2
+ NTP_4_2_7P159
+
+ ntpdc/ntpdc-opts.c@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpdc/ntpdc-opts.h@1.161 +3 -3
+ NTP_4_2_7P159
+
+ ntpdc/ntpdc-opts.texi@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpdc/ntpdc.1@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpq/ntpq-opts.c@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpq/ntpq-opts.h@1.161 +3 -3
+ NTP_4_2_7P159
+
+ ntpq/ntpq-opts.texi@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpq/ntpq.1@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.161 +3 -3
+ NTP_4_2_7P159
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.161 +2 -2
+ NTP_4_2_7P159
+
+ ntpsnmpd/ntpsnmpd.1@1.161 +2 -2
+ NTP_4_2_7P159
+
+ packageinfo.sh@1.161 +1 -1
+ NTP_4_2_7P159
+
+ sntp/sntp-opts.c@1.155 +2 -2
+ NTP_4_2_7P159
+
+ sntp/sntp-opts.h@1.155 +3 -3
+ NTP_4_2_7P159
+
+ sntp/sntp-opts.texi@1.155 +2 -2
+ NTP_4_2_7P159
+
+ sntp/sntp.1@1.155 +2 -2
+ NTP_4_2_7P159
+
+ sntp/sntp.html@1.155 +1 -1
+ NTP_4_2_7P159
+
+ util/ntp-keygen-opts.c@1.159 +2 -2
+ NTP_4_2_7P159
+
+ util/ntp-keygen-opts.h@1.159 +3 -3
+ NTP_4_2_7P159
+
+ util/ntp-keygen-opts.texi@1.162 +2 -2
+ NTP_4_2_7P159
+
+ util/ntp-keygen.1@1.162 +2 -2
+ NTP_4_2_7P159
+
+ChangeSet@1.2479.12.3, 2011-04-28 00:05:49-04:00, murray@pogo.udel.edu
+ ntp_io.c:
+ Fix unused variable warning (no IPv6)
+ ntp_control.c:
+ Fix unused variable warning (no REFCLOCKs)
+ ChangeLog:
+ Fix unused variable warnings.
+
+ ChangeLog@1.861.1.3 +1 -0
+ Fix unused variable warnings.
+
+ ntpd/ntp_control.c@1.168 +2 -0
+ Fix unused variable warning (no REFCLOCKs)
+
+ ntpd/ntp_io.c@1.353 +4 -1
+ Fix unused variable warning (no IPv6)
+
+ChangeSet@1.2479.12.2, 2011-04-24 07:38:50+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P158
+ TAG: NTP_4_2_7P158
+
+ ChangeLog@1.861.1.2 +1 -0
+ NTP_4_2_7P158
+
+ ntpd/ntpd-opts.c@1.163 +2 -2
+ NTP_4_2_7P158
+
+ ntpd/ntpd-opts.h@1.163 +3 -3
+ NTP_4_2_7P158
+
+ ntpd/ntpd-opts.texi@1.161 +2 -2
+ NTP_4_2_7P158
+
+ ntpd/ntpd.1@1.161 +2 -2
+ NTP_4_2_7P158
+
+ ntpdc/ntpdc-opts.c@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpdc/ntpdc-opts.h@1.160 +3 -3
+ NTP_4_2_7P158
+
+ ntpdc/ntpdc-opts.texi@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpdc/ntpdc.1@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpq/ntpq-opts.c@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpq/ntpq-opts.h@1.160 +3 -3
+ NTP_4_2_7P158
+
+ ntpq/ntpq-opts.texi@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpq/ntpq.1@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.160 +3 -3
+ NTP_4_2_7P158
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.160 +2 -2
+ NTP_4_2_7P158
+
+ ntpsnmpd/ntpsnmpd.1@1.160 +2 -2
+ NTP_4_2_7P158
+
+ packageinfo.sh@1.160 +1 -1
+ NTP_4_2_7P158
+
+ sntp/sntp-opts.c@1.154 +2 -2
+ NTP_4_2_7P158
+
+ sntp/sntp-opts.h@1.154 +3 -3
+ NTP_4_2_7P158
+
+ sntp/sntp-opts.texi@1.154 +2 -2
+ NTP_4_2_7P158
+
+ sntp/sntp.1@1.154 +2 -2
+ NTP_4_2_7P158
+
+ sntp/sntp.html@1.154 +1 -1
+ NTP_4_2_7P158
+
+ util/ntp-keygen-opts.c@1.158 +2 -2
+ NTP_4_2_7P158
+
+ util/ntp-keygen-opts.h@1.158 +3 -3
+ NTP_4_2_7P158
+
+ util/ntp-keygen-opts.texi@1.161 +2 -2
+ NTP_4_2_7P158
+
+ util/ntp-keygen.1@1.161 +2 -2
+ NTP_4_2_7P158
+
+ChangeSet@1.2479.12.1, 2011-04-23 16:50:09+00:00, davehart@shiny.ad.hartbrothers.com
+ Update libevent --disable-libevent-regress handling to work when
+ building libevent using mingw.
+
+ ChangeLog@1.861.1.1 +2 -0
+ Update libevent --disable-libevent-regress handling to work when
+ building libevent using mingw.
+
+ sntp/libevent/configure.in@1.6 +0 -6
+ Update libevent --disable-libevent-regress handling to work when
+ building libevent using mingw.
+
+ sntp/libevent/test/Makefile.am@1.5 +4 -1
+ Update libevent --disable-libevent-regress handling to work when
+ building libevent using mingw.
+
+ChangeSet@1.2479.1.78, 2011-04-23 11:38:29+02:00, jnperlin@hydra.localnet
+ minor cleanup in timespecops/timevalops
+
+ ChangeLog@1.862 +1 -0
+ minor cleanup in timespecops/timevalops
+
+ libntp/timespecops.c@1.6 +12 -69
+ unified with tvalops, use string formatting in libntp, fixed misleading comments
+
+ libntp/timevalops.c@1.7 +9 -4
+ fixed misleading comments
+
+ChangeSet@1.2479.1.77, 2011-04-21 06:16:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P157
+ TAG: NTP_4_2_7P157
+
+ ChangeLog@1.861 +1 -0
+ NTP_4_2_7P157
+
+ ntpd/ntpd-opts.c@1.162 +2 -2
+ NTP_4_2_7P157
+
+ ntpd/ntpd-opts.h@1.162 +3 -3
+ NTP_4_2_7P157
+
+ ntpd/ntpd-opts.texi@1.160 +2 -2
+ NTP_4_2_7P157
+
+ ntpd/ntpd.1@1.160 +2 -2
+ NTP_4_2_7P157
+
+ ntpdc/ntpdc-opts.c@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpdc/ntpdc-opts.h@1.159 +3 -3
+ NTP_4_2_7P157
+
+ ntpdc/ntpdc-opts.texi@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpdc/ntpdc.1@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpq/ntpq-opts.c@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpq/ntpq-opts.h@1.159 +3 -3
+ NTP_4_2_7P157
+
+ ntpq/ntpq-opts.texi@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpq/ntpq.1@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.159 +3 -3
+ NTP_4_2_7P157
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.159 +2 -2
+ NTP_4_2_7P157
+
+ ntpsnmpd/ntpsnmpd.1@1.159 +2 -2
+ NTP_4_2_7P157
+
+ packageinfo.sh@1.159 +1 -1
+ NTP_4_2_7P157
+
+ sntp/sntp-opts.c@1.153 +2 -2
+ NTP_4_2_7P157
+
+ sntp/sntp-opts.h@1.153 +3 -3
+ NTP_4_2_7P157
+
+ sntp/sntp-opts.texi@1.153 +2 -2
+ NTP_4_2_7P157
+
+ sntp/sntp.1@1.153 +2 -2
+ NTP_4_2_7P157
+
+ sntp/sntp.html@1.153 +1 -1
+ NTP_4_2_7P157
+
+ util/ntp-keygen-opts.c@1.157 +2 -2
+ NTP_4_2_7P157
+
+ util/ntp-keygen-opts.h@1.157 +3 -3
+ NTP_4_2_7P157
+
+ util/ntp-keygen-opts.texi@1.160 +2 -2
+ NTP_4_2_7P157
+
+ util/ntp-keygen.1@1.160 +2 -2
+ NTP_4_2_7P157
+
+ChangeSet@1.2479.1.76, 2011-04-19 09:38:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1890] 4.2.7p156 segfault in duplicate freeaddrinfo().
+
+ ChangeLog@1.860 +1 -0
+ [Bug 1890] 4.2.7p156 segfault in duplicate freeaddrinfo().
+
+ libntp/ntp_intres.c@1.97 +0 -1
+ [Bug 1890] 4.2.7p156 segfault in duplicate freeaddrinfo().
+
+ChangeSet@1.2479.1.75, 2011-04-19 06:55:02+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P156
+ TAG: NTP_4_2_7P156
+
+ ChangeLog@1.859 +1 -0
+ NTP_4_2_7P156
+
+ ntpd/ntpd-opts.c@1.161 +2 -2
+ NTP_4_2_7P156
+
+ ntpd/ntpd-opts.h@1.161 +3 -3
+ NTP_4_2_7P156
+
+ ntpd/ntpd-opts.texi@1.159 +2 -2
+ NTP_4_2_7P156
+
+ ntpd/ntpd.1@1.159 +2 -2
+ NTP_4_2_7P156
+
+ ntpdc/ntpdc-opts.c@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpdc/ntpdc-opts.h@1.158 +3 -3
+ NTP_4_2_7P156
+
+ ntpdc/ntpdc-opts.texi@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpdc/ntpdc.1@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpq/ntpq-opts.c@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpq/ntpq-opts.h@1.158 +3 -3
+ NTP_4_2_7P156
+
+ ntpq/ntpq-opts.texi@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpq/ntpq.1@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.158 +3 -3
+ NTP_4_2_7P156
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.158 +2 -2
+ NTP_4_2_7P156
+
+ ntpsnmpd/ntpsnmpd.1@1.158 +2 -2
+ NTP_4_2_7P156
+
+ packageinfo.sh@1.158 +1 -1
+ NTP_4_2_7P156
+
+ sntp/sntp-opts.c@1.152 +2 -2
+ NTP_4_2_7P156
+
+ sntp/sntp-opts.h@1.152 +3 -3
+ NTP_4_2_7P156
+
+ sntp/sntp-opts.texi@1.152 +2 -2
+ NTP_4_2_7P156
+
+ sntp/sntp.1@1.152 +2 -2
+ NTP_4_2_7P156
+
+ sntp/sntp.html@1.152 +1 -1
+ NTP_4_2_7P156
+
+ util/ntp-keygen-opts.c@1.156 +2 -2
+ NTP_4_2_7P156
+
+ util/ntp-keygen-opts.h@1.156 +3 -3
+ NTP_4_2_7P156
+
+ util/ntp-keygen-opts.texi@1.159 +2 -2
+ NTP_4_2_7P156
+
+ util/ntp-keygen.1@1.159 +2 -2
+ NTP_4_2_7P156
+
+ChangeSet@1.2479.1.74, 2011-04-18 22:32:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1851] freeaddrinfo() called after getaddrinfo() fails.
+
+ ChangeLog@1.858 +1 -0
+ [Bug 1851] freeaddrinfo() called after getaddrinfo() fails.
+
+ libntp/ntp_intres.c@1.96 +8 -7
+ [Bug 1851] freeaddrinfo() called after getaddrinfo() fails.
+
+ChangeSet@1.2479.1.73, 2011-04-18 04:58:45+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P155
+ TAG: NTP_4_2_7P155
+
+ ChangeLog@1.857 +1 -0
+ NTP_4_2_7P155
+
+ ntpd/ntpd-opts.c@1.160 +2 -2
+ NTP_4_2_7P155
+
+ ntpd/ntpd-opts.h@1.160 +3 -3
+ NTP_4_2_7P155
+
+ ntpd/ntpd-opts.texi@1.158 +2 -2
+ NTP_4_2_7P155
+
+ ntpd/ntpd.1@1.158 +2 -2
+ NTP_4_2_7P155
+
+ ntpdc/ntpdc-opts.c@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpdc/ntpdc-opts.h@1.157 +3 -3
+ NTP_4_2_7P155
+
+ ntpdc/ntpdc-opts.texi@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpdc/ntpdc.1@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpq/ntpq-opts.c@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpq/ntpq-opts.h@1.157 +3 -3
+ NTP_4_2_7P155
+
+ ntpq/ntpq-opts.texi@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpq/ntpq.1@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.157 +3 -3
+ NTP_4_2_7P155
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.157 +2 -2
+ NTP_4_2_7P155
+
+ ntpsnmpd/ntpsnmpd.1@1.157 +2 -2
+ NTP_4_2_7P155
+
+ packageinfo.sh@1.157 +1 -1
+ NTP_4_2_7P155
+
+ sntp/sntp-opts.c@1.151 +2 -2
+ NTP_4_2_7P155
+
+ sntp/sntp-opts.h@1.151 +3 -3
+ NTP_4_2_7P155
+
+ sntp/sntp-opts.texi@1.151 +2 -2
+ NTP_4_2_7P155
+
+ sntp/sntp.1@1.151 +2 -2
+ NTP_4_2_7P155
+
+ sntp/sntp.html@1.151 +1 -1
+ NTP_4_2_7P155
+
+ util/ntp-keygen-opts.c@1.155 +2 -2
+ NTP_4_2_7P155
+
+ util/ntp-keygen-opts.h@1.155 +3 -3
+ NTP_4_2_7P155
+
+ util/ntp-keygen-opts.texi@1.158 +2 -2
+ NTP_4_2_7P155
+
+ util/ntp-keygen.1@1.158 +2 -2
+ NTP_4_2_7P155
+
+ChangeSet@1.2479.1.72, 2011-04-17 20:08:44+00:00, davehart@shiny.ad.hartbrothers.com
+ Automerge of ChangeLog got it wrong.
+
+ ChangeLog@1.856 +1 -1
+ Automerge of ChangeLog got it wrong.
+
+ChangeSet@1.2479.11.1, 2011-04-17 11:32:14+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P154
+ TAG: NTP_4_2_7P154
+
+ ChangeLog@1.853.1.1 +1 -0
+ NTP_4_2_7P154
+
+ ntpd/ntpd-opts.c@1.159 +2 -2
+ NTP_4_2_7P154
+
+ ntpd/ntpd-opts.h@1.159 +3 -3
+ NTP_4_2_7P154
+
+ ntpd/ntpd-opts.texi@1.157 +2 -2
+ NTP_4_2_7P154
+
+ ntpd/ntpd.1@1.157 +2 -2
+ NTP_4_2_7P154
+
+ ntpdc/ntpdc-opts.c@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpdc/ntpdc-opts.h@1.156 +3 -3
+ NTP_4_2_7P154
+
+ ntpdc/ntpdc-opts.texi@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpdc/ntpdc.1@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpq/ntpq-opts.c@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpq/ntpq-opts.h@1.156 +3 -3
+ NTP_4_2_7P154
+
+ ntpq/ntpq-opts.texi@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpq/ntpq.1@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.156 +3 -3
+ NTP_4_2_7P154
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.156 +2 -2
+ NTP_4_2_7P154
+
+ ntpsnmpd/ntpsnmpd.1@1.156 +2 -2
+ NTP_4_2_7P154
+
+ packageinfo.sh@1.156 +1 -1
+ NTP_4_2_7P154
+
+ sntp/sntp-opts.c@1.150 +2 -2
+ NTP_4_2_7P154
+
+ sntp/sntp-opts.h@1.150 +3 -3
+ NTP_4_2_7P154
+
+ sntp/sntp-opts.texi@1.150 +2 -2
+ NTP_4_2_7P154
+
+ sntp/sntp.1@1.150 +2 -2
+ NTP_4_2_7P154
+
+ sntp/sntp.html@1.150 +1 -1
+ NTP_4_2_7P154
+
+ util/ntp-keygen-opts.c@1.154 +2 -2
+ NTP_4_2_7P154
+
+ util/ntp-keygen-opts.h@1.154 +3 -3
+ NTP_4_2_7P154
+
+ util/ntp-keygen-opts.texi@1.157 +2 -2
+ NTP_4_2_7P154
+
+ util/ntp-keygen.1@1.157 +2 -2
+ NTP_4_2_7P154
+
+ChangeSet@1.2479.1.70, 2011-04-17 08:22:57+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct includes in lib/isc for strlcpy(), strlcat() prototypes.
+
+ lib/isc/log.c@1.5 +1 -1
+ Correct includes in lib/isc for strlcpy(), strlcat() prototypes.
+
+ lib/isc/netaddr.c@1.11 +1 -1
+ Correct includes in lib/isc for strlcpy(), strlcat() prototypes.
+
+ lib/isc/unix/dir.c@1.3 +1 -1
+ Correct includes in lib/isc for strlcpy(), strlcat() prototypes.
+
+ lib/isc/unix/file.c@1.3 +1 -1
+ Correct includes in lib/isc for strlcpy(), strlcat() prototypes.
+
+ChangeSet@1.2479.1.69, 2011-04-17 08:10:39+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix leak in refclock_datum.c start failure path.
+
+ ChangeLog@1.854 +1 -0
+ Fix leak in refclock_datum.c start failure path.
+
+ ntpd/refclock_datum.c@1.19 +1 -0
+ Fix leak in refclock_datum.c start failure path.
+
+ChangeSet@1.2479.1.68, 2011-04-16 18:14:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1887] DNS fails on 4.2.7p153 using threads.
+
+ ChangeLog@1.853 +1 -0
+ [Bug 1887] DNS fails on 4.2.7p153 using threads.
+
+ libntp/work_thread.c@1.9 +4 -3
+ [Bug 1887] DNS fails on 4.2.7p153 using threads.
+
+ChangeSet@1.2479.1.67, 2011-04-16 07:31:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P153
+ TAG: NTP_4_2_7P153
+
+ ChangeLog@1.852 +1 -0
+ NTP_4_2_7P153
+
+ ntpd/ntpd-opts.c@1.158 +2 -2
+ NTP_4_2_7P153
+
+ ntpd/ntpd-opts.h@1.158 +3 -3
+ NTP_4_2_7P153
+
+ ntpd/ntpd-opts.texi@1.156 +2 -2
+ NTP_4_2_7P153
+
+ ntpd/ntpd.1@1.156 +2 -2
+ NTP_4_2_7P153
+
+ ntpdc/ntpdc-opts.c@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpdc/ntpdc-opts.h@1.155 +3 -3
+ NTP_4_2_7P153
+
+ ntpdc/ntpdc-opts.texi@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpdc/ntpdc.1@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpq/ntpq-opts.c@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpq/ntpq-opts.h@1.155 +3 -3
+ NTP_4_2_7P153
+
+ ntpq/ntpq-opts.texi@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpq/ntpq.1@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.155 +3 -3
+ NTP_4_2_7P153
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.155 +2 -2
+ NTP_4_2_7P153
+
+ ntpsnmpd/ntpsnmpd.1@1.155 +2 -2
+ NTP_4_2_7P153
+
+ packageinfo.sh@1.155 +1 -1
+ NTP_4_2_7P153
+
+ sntp/sntp-opts.c@1.149 +2 -2
+ NTP_4_2_7P153
+
+ sntp/sntp-opts.h@1.149 +3 -3
+ NTP_4_2_7P153
+
+ sntp/sntp-opts.texi@1.149 +2 -2
+ NTP_4_2_7P153
+
+ sntp/sntp.1@1.149 +2 -2
+ NTP_4_2_7P153
+
+ sntp/sntp.html@1.149 +1 -1
+ NTP_4_2_7P153
+
+ util/ntp-keygen-opts.c@1.153 +2 -2
+ NTP_4_2_7P153
+
+ util/ntp-keygen-opts.h@1.153 +3 -3
+ NTP_4_2_7P153
+
+ util/ntp-keygen-opts.texi@1.156 +2 -2
+ NTP_4_2_7P153
+
+ util/ntp-keygen.1@1.156 +2 -2
+ NTP_4_2_7P153
+
+ChangeSet@1.2479.1.66, 2011-04-15 19:53:04+00:00, davehart@shiny.ad.hartbrothers.com
+ A few more Coverity Scan cleanups.
+
+ ChangeLog@1.851 +1 -0
+ A few more Coverity Scan cleanups.
+
+ lib/isc/inet_ntop.c@1.11 +6 -5
+ strcpy() -> memcpy()
+ sprintf() -> snprintf()
+
+ lib/isc/log.c@1.4 +5 -2
+ strcpy() -> strlcpy()
+
+ lib/isc/netaddr.c@1.10 +2 -1
+ strcpy() -> strlcpy()
+
+ lib/isc/task.c@1.5 +3 -1
+ Lock manager object during destruction to keep Coverity Scan lock
+ analysis on track.
+
+ lib/isc/unix/dir.c@1.2 +10 -5
+ strcpy() -> strlcpy()
+
+ lib/isc/unix/file.c@1.2 +6 -5
+ strncpy() -> strlcpy()
+ strcat() -> strlcat()
+
+ libntp/icom.c@1.16 +1 -1
+ Add missed assignment in tcsetattr() error check.
+
+ libntp/work_thread.c@1.8 +3 -1
+ Another attempt at convincing Coverity sizeof(*hdr) - hdr->octets is
+ always positive.
+
+ ntpd/refclock_datum.c@1.18 +7 -1
+ Check tcsetattr() return value.
+
+ChangeSet@1.2461.1.3, 2011-04-15 11:33:32+00:00, davehart@shiny.ad.hartbrothers.com
+ libevent HEAD 20110415 11:33 UTC d28fc52815023113840fb9e108ada0126964a799
+
+ sntp/libevent/CommitLog@1.2 +19 -0
+ libevent HEAD 20110415 11:33 UTC d28fc52815023113840fb9e108ada0126964a799
+
+ sntp/libevent/evdns.c@1.1.1.2 +2 -1
+ libevent HEAD 20110415 11:33 UTC d28fc52815023113840fb9e108ada0126964a799
+
+ sntp/libevent/sample/http-server.c@1.1.1.2 +5 -4
+ libevent HEAD 20110415 11:33 UTC d28fc52815023113840fb9e108ada0126964a799
+
+ChangeSet@1.2479.1.64, 2011-04-15 08:46:52+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P152
+ TAG: NTP_4_2_7P152
+
+ ChangeLog@1.850 +1 -0
+ NTP_4_2_7P152
+
+ ntpd/ntpd-opts.c@1.157 +2 -2
+ NTP_4_2_7P152
+
+ ntpd/ntpd-opts.h@1.157 +3 -3
+ NTP_4_2_7P152
+
+ ntpd/ntpd-opts.texi@1.155 +2 -2
+ NTP_4_2_7P152
+
+ ntpd/ntpd.1@1.155 +2 -2
+ NTP_4_2_7P152
+
+ ntpdc/ntpdc-opts.c@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpdc/ntpdc-opts.h@1.154 +3 -3
+ NTP_4_2_7P152
+
+ ntpdc/ntpdc-opts.texi@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpdc/ntpdc.1@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpq/ntpq-opts.c@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpq/ntpq-opts.h@1.154 +3 -3
+ NTP_4_2_7P152
+
+ ntpq/ntpq-opts.texi@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpq/ntpq.1@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.154 +3 -3
+ NTP_4_2_7P152
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.154 +2 -2
+ NTP_4_2_7P152
+
+ ntpsnmpd/ntpsnmpd.1@1.154 +2 -2
+ NTP_4_2_7P152
+
+ packageinfo.sh@1.154 +1 -1
+ NTP_4_2_7P152
+
+ sntp/sntp-opts.c@1.148 +2 -2
+ NTP_4_2_7P152
+
+ sntp/sntp-opts.h@1.148 +3 -3
+ NTP_4_2_7P152
+
+ sntp/sntp-opts.texi@1.148 +2 -2
+ NTP_4_2_7P152
+
+ sntp/sntp.1@1.148 +2 -2
+ NTP_4_2_7P152
+
+ sntp/sntp.html@1.148 +1 -1
+ NTP_4_2_7P152
+
+ util/ntp-keygen-opts.c@1.152 +2 -2
+ NTP_4_2_7P152
+
+ util/ntp-keygen-opts.h@1.152 +3 -3
+ NTP_4_2_7P152
+
+ util/ntp-keygen-opts.texi@1.155 +2 -2
+ NTP_4_2_7P152
+
+ util/ntp-keygen.1@1.155 +2 -2
+ NTP_4_2_7P152
+
+ChangeSet@1.2479.1.63, 2011-04-15 00:12:03+00:00, davehart@shiny.ad.hartbrothers.com
+ Automerge cleanup
+
+ ChangeLog@1.849 +1 -0
+ Update embedded libevent to current 2.1 git HEAD.
+
+ sntp/libevent/event.c@1.4 +2 -70
+ Automerge cleanup
+
+ChangeSet@1.2461.1.2, 2011-04-14 23:28:43+00:00, davehart@shiny.ad.hartbrothers.com
+ overlooked file
+
+ sntp/libevent/evconfig-private.h.in@1.1 +43 -0
+ BitKeeper file C:/ntp/ntp-dev-libevent-upstream/sntp/libevent/evconfig-private.h.in
+
+ sntp/libevent/evconfig-private.h.in@1.0 +0 -0
+
+ChangeSet@1.2461.1.1, 2011-04-14 19:55:12+00:00, davehart@shiny.ad.hartbrothers.com
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/CommitLog@1.1 +18272 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/CommitLog@1.0 +0 -0
+
+ sntp/libevent/Makefile.am@1.1.1.1 +27 -24
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/WIN32-Code/evconfig-private.h@1.1 +6 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/WIN32-Code/evconfig-private.h@1.0 +0 -0
+
+ sntp/libevent/WIN32-Code/event2/event-config.h@1.1.1.1 +2 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/arc4random.c@1.1.1.1 +6 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/buffer.c@1.2 +283 -266
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/buffer_iocp.c@1.2 +2 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent-internal.h@1.2 +16 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent.c@1.2 +21 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent_async.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent_filter.c@1.2 +2 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent_openssl.c@1.2 +3 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent_pair.c@1.2 +2 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent_ratelim.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/bufferevent_sock.c@1.2 +3 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/configure.in@1.1.1.1 +162 -17
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/defer-internal.h@1.2 +2 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/devpoll.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/epoll.c@1.2 +251 -140
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/epoll_sub.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evbuffer-internal.h@1.2 +45 -12
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evdns.c@1.1.1.1 +7 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/event-internal.h@1.1.1.1 +13 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/event.c@1.1.1.1 +29 -7
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/event_iocp.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/event_tagging.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evmap.c@1.2 +8 -12
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evport.c@1.1.1.1 +15 -4
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evrpc.c@1.2 +8 -7
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evthread-internal.h@1.2 +3 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evthread.c@1.1.1.1 +13 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evthread_pthread.c@1.1.1.1 +4 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evthread_win32.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evutil.c@1.1.1.1 +94 -22
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/evutil_rand.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/http-internal.h@1.2 +2 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/http.c@1.1.1.1 +212 -47
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/include/event2/buffer.h@1.2 +102 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/include/event2/event.h@1.1.1.1 +13 -3
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/include/event2/http.h@1.2 +45 -3
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/ipv6-internal.h@1.1.1.1 +12 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/kqueue.c@1.2 +1 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/listener.c@1.2 +3 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/log.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/minheap-internal.h@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/poll.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/sample/Makefile.am@1.1.1.1 +1 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/sample/dns-example.c@1.1.1.1 +3 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/sample/hello-world.c@1.1.1.1 +3 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/sample/http-server.c@1.1.1.1 +6 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/select.c@1.1.1.1 +28 -9
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/signal.c@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/strlcpy-internal.h@1.2 +1 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/strlcpy.c@1.2 +3 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/Makefile.am@1.1.1.1 +14 -9
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/bench_httpclient.c@1.1.1.1 +3 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/regress.h@1.2 +1 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/regress_buffer.c@1.2 +219 -46
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/regress_dns.c@1.1.1.1 +2 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/regress_http.c@1.1.1.1 +62 -53
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/regress_listener.c@1.1.1.1 +3 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/regress_main.c@1.2 +5 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/regress_testutils.c@1.1.1.1 +2 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/test-eof.c@1.1.1.1 +9 -3
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/test-ratelim.c@1.1.1.1 +5 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/test-ratelim.sh@1.1 +77 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/test-ratelim.sh@1.0 +0 -0
+
+ sntp/libevent/test/test.sh@1.1.1.1 +12 -5
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/tinytest_demo.c@1.1 +215 -0
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/test/tinytest_demo.c@1.0 +0 -0
+
+ sntp/libevent/util-internal.h@1.1.1.1 +25 -2
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/whatsnew-2.0.txt@1.2 +1 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ sntp/libevent/win32select.c@1.2 +2 -1
+ libevent 2.1 (prerelease git head bfdda26534ea66b847760720260a4b4d8fcefe58)
+
+ChangeSet@1.2479.1.60, 2011-04-14 08:03:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P151
+ TAG: NTP_4_2_7P151
+
+ ChangeLog@1.848 +1 -0
+ NTP_4_2_7P151
+
+ ntpd/ntpd-opts.c@1.156 +2 -2
+ NTP_4_2_7P151
+
+ ntpd/ntpd-opts.h@1.156 +3 -3
+ NTP_4_2_7P151
+
+ ntpd/ntpd-opts.texi@1.154 +2 -2
+ NTP_4_2_7P151
+
+ ntpd/ntpd.1@1.154 +2 -2
+ NTP_4_2_7P151
+
+ ntpdc/ntpdc-opts.c@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpdc/ntpdc-opts.h@1.153 +3 -3
+ NTP_4_2_7P151
+
+ ntpdc/ntpdc-opts.texi@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpdc/ntpdc.1@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpq/ntpq-opts.c@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpq/ntpq-opts.h@1.153 +3 -3
+ NTP_4_2_7P151
+
+ ntpq/ntpq-opts.texi@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpq/ntpq.1@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.153 +3 -3
+ NTP_4_2_7P151
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.153 +2 -2
+ NTP_4_2_7P151
+
+ ntpsnmpd/ntpsnmpd.1@1.153 +2 -2
+ NTP_4_2_7P151
+
+ packageinfo.sh@1.153 +1 -1
+ NTP_4_2_7P151
+
+ sntp/sntp-opts.c@1.147 +2 -2
+ NTP_4_2_7P151
+
+ sntp/sntp-opts.h@1.147 +3 -3
+ NTP_4_2_7P151
+
+ sntp/sntp-opts.texi@1.147 +2 -2
+ NTP_4_2_7P151
+
+ sntp/sntp.1@1.147 +2 -2
+ NTP_4_2_7P151
+
+ sntp/sntp.html@1.147 +1 -1
+ NTP_4_2_7P151
+
+ util/ntp-keygen-opts.c@1.151 +2 -2
+ NTP_4_2_7P151
+
+ util/ntp-keygen-opts.h@1.151 +3 -3
+ NTP_4_2_7P151
+
+ util/ntp-keygen-opts.texi@1.154 +2 -2
+ NTP_4_2_7P151
+
+ util/ntp-keygen.1@1.154 +2 -2
+ NTP_4_2_7P151
+
+ChangeSet@1.2479.1.59, 2011-04-14 05:30:10+00:00, davehart@shiny.ad.hartbrothers.com
+ Log failure to fetch time from HOPF_P hardware.
+ Check HOPF_S sscanf() conversion count before converted values.
+ Correct mvsnprintf() and mvfprintf() for vsnprintf() that handles %m.
+
+ ChangeLog@1.847 +2 -0
+ Log failure to fetch time from HOPF_P hardware.
+ Check HOPF_S sscanf() conversion count before converted values.
+
+ libntp/msyslog.c@1.42 +59 -54
+ Correct mvsnprintf() and mvfprintf() for vsnprintf() that handles %m.
+
+ ntpd/refclock_hopfpci.c@1.13 +3 -1
+ Log failure to fetch time from HOPF_P hardware.
+
+ ntpd/refclock_hopfser.c@1.16 +11 -10
+ Check HOPF_S sscanf() conversion count before converted values.
+
+ sntp/crypto.c@1.17 +2 -1
+ Minor leak fix.
+
+ sntp/main.c@1.71 +7 -7
+ nonfunctional, makes static analysis happy.
+
+ChangeSet@1.2479.1.58, 2011-04-14 02:00:02+00:00, davehart@shiny.ad.hartbrothers.com
+ Detect vsnprintf() support for "%m" and disable our "%m" expansion.
+ Add --enable-c99-sprintf to configure args for -noopenssl variety of
+ flock-build to avoid regressions in (v)snprintf() replacement.
+ More msnprintf() unit tests.
+ Coverity Scan error checking fixes.
+
+ ChangeLog@1.846 +5 -0
+ Detect vsnprintf() support for "%m" and disable our "%m" expansion.
+ Add --enable-c99-sprintf to configure args for -noopenssl variety of
+ flock-build to avoid regressions in (v)snprintf() replacement.
+ More msnprintf() unit tests.
+ Coverity Scan error checking fixes.
+
+ flock-build@1.51 +2 -2
+ Add --enable-c99-sprintf to configure args for -noopenssl variety of
+ flock-build to avoid regressions in (v)snprintf() replacement.
+
+ libntp/audio.c@1.31 +8 -8
+ check sscanf() return values
+
+ libntp/msyslog.c@1.41 +71 -66
+ Detect vsnprintf() support for "%m" and disable our "%m" expansion.
+ Remove pre-C99-snprintf() workaround.
+
+ libntp/snprintf.c@1.11 +1 -0
+ Add /* FALLTHROUGH */ comment to %F handling.
+
+ ntpd/refclock_arc.c@1.25 +30 -27
+ use msyslog instead of printf for failure to open clock.
+
+ ntpq/ntpq-subs.c@1.87 +10 -3
+ Check decodenetnum() return value.
+
+ ntpq/ntpq.c@1.138 +3 -3
+ printf format mismatch on 64-bit.
+
+ parseutil/dcfd.c@1.24 +2 -2
+ printf format mismatch on 64-bit.
+
+ sntp/m4/ntp_libntp.m4@1.14 +62 -0
+ Detect vsnprintf() support for "%m" and disable our "%m" expansion.
+
+ tests/libntp/msyslog.cpp@1.3 +74 -22
+ More msnprintf() unit tests.
+
+ChangeSet@1.2479.1.57, 2011-04-13 04:57:19+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P150
+ TAG: NTP_4_2_7P150
+
+ ChangeLog@1.845 +1 -0
+ NTP_4_2_7P150
+
+ ntpd/ntpd-opts.c@1.155 +2 -2
+ NTP_4_2_7P150
+
+ ntpd/ntpd-opts.h@1.155 +3 -3
+ NTP_4_2_7P150
+
+ ntpd/ntpd-opts.texi@1.153 +2 -2
+ NTP_4_2_7P150
+
+ ntpd/ntpd.1@1.153 +2 -2
+ NTP_4_2_7P150
+
+ ntpdc/ntpdc-opts.c@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpdc/ntpdc-opts.h@1.152 +3 -3
+ NTP_4_2_7P150
+
+ ntpdc/ntpdc-opts.texi@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpdc/ntpdc.1@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpq/ntpq-opts.c@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpq/ntpq-opts.h@1.152 +3 -3
+ NTP_4_2_7P150
+
+ ntpq/ntpq-opts.texi@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpq/ntpq.1@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.152 +3 -3
+ NTP_4_2_7P150
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.152 +2 -2
+ NTP_4_2_7P150
+
+ ntpsnmpd/ntpsnmpd.1@1.152 +2 -2
+ NTP_4_2_7P150
+
+ packageinfo.sh@1.152 +1 -1
+ NTP_4_2_7P150
+
+ sntp/sntp-opts.c@1.146 +2 -2
+ NTP_4_2_7P150
+
+ sntp/sntp-opts.h@1.146 +3 -3
+ NTP_4_2_7P150
+
+ sntp/sntp-opts.texi@1.146 +2 -2
+ NTP_4_2_7P150
+
+ sntp/sntp.1@1.146 +2 -2
+ NTP_4_2_7P150
+
+ sntp/sntp.html@1.146 +1 -1
+ NTP_4_2_7P150
+
+ util/ntp-keygen-opts.c@1.150 +2 -2
+ NTP_4_2_7P150
+
+ util/ntp-keygen-opts.h@1.150 +3 -3
+ NTP_4_2_7P150
+
+ util/ntp-keygen-opts.texi@1.153 +2 -2
+ NTP_4_2_7P150
+
+ util/ntp-keygen.1@1.153 +2 -2
+ NTP_4_2_7P150
+
+ChangeSet@1.2479.1.56, 2011-04-13 02:22:24+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_proto.c sprintf() -> snprintf()
+
+ ChangeLog@1.844 +1 -1
+ ntp_proto.c sprintf() -> snprintf()
+
+ ntpd/ntp_proto.c@1.320 +3 -2
+ ntp_proto.c sprintf() -> snprintf()
+
+ChangeSet@1.2479.1.55, 2011-04-13 01:02:31+00:00, davehart@shiny.ad.hartbrothers.com
+ Move rpl_vsnprintf() declaration and #define vsnprintf to config.h
+
+ include/l_stdlib.h@1.20 +0 -10
+ Move rpl_vsnprintf() declaration and #define vsnprintf to config.h
+
+ lib/isc/inet_ntop.c@1.10 +2 -3
+ leftover SNPRINTF() -> snprintf() overlooked in prior cset.
+
+ libntp/msyslog.c@1.40 +19 -2
+ Work around strerror_r return type misdetection.
+
+ ports/winnt/include/config.h@1.97 +5 -0
+ Move rpl_vsnprintf() declaration and #define vsnprintf to config.h
+
+ ports/winnt/libntp/syslog.c@1.11 +2 -0
+ include ntp_stdlib.h for strlcpy() declaration
+
+ sntp/m4/ntp_libntp.m4@1.13 +45 -19
+ Move rpl_vsnprintf() declaration and #define vsnprintf to config.h
+
+ sntp/m4/snprintf.m4@1.2 +1 -6
+ Update comment.
+
+ tests/libntp/msyslog.cpp@1.2 +1 -0
+ strerror() prototyped by string.h
+
+ChangeSet@1.2479.1.54, 2011-04-12 06:01:57+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove remaining sprintf() calls except refclock_ripencc.c (which is
+ kept out of --enable-all-clocks as a result), upstream libs which use
+ sprintf() ony after careful buffer sizing, and ntp_proto.c.
+
+ BitKeeper/deleted/14/ntp_sprintf.h~a4bd6474a120d477@1.2 +0 -0
+ Delete: include/ntp_sprintf.h
+
+ BitKeeper/deleted/53/refclock_trimbledc.c~29080509@1.5 +0 -0
+ Delete: ports/winnt/ntpd/refclock_trimbledc.c
+
+ BitKeeper/deleted/ab/refclock_trimbledc.h~29080509@1.4 +0 -0
+ Delete: ports/winnt/ntpd/refclock_trimbledc.h
+
+ ChangeLog@1.843 +3 -0
+ Remove remaining sprintf() calls except refclock_ripencc.c (which is
+ kept out of --enable-all-clocks as a result), upstream libs which use
+ sprintf() ony after careful buffer sizing, and ntp_proto.c.
+
+ configure.ac@1.525 +0 -6
+ SPRINTF_CHAR check is not needed, ANSI C mandates int return type.
+
+ include/Makefile.am@1.49 +0 -1
+ Remove ntp_sprintf.h workaround for pre-ANSI C sprintf().
+
+ lib/isc/inet_ntop.c@1.9 +1 -3
+ Remove ntp_sprintf.h workaround for pre-ANSI C sprintf().
+
+ libntp/bsd_strerror.c@1.6 +4 -3
+ sprintf() -> snprintf().
+
+ libntp/snprintf.c@1.10 +4 -4
+ clarify HAVE_* macros in non-Autoconf use.
+
+ libparse/ieee754io.c@1.11 +19 -15
+ sprintf() -> snprintf().
+
+ ntpd/refclock_mx4200.c@1.30 +0 -2
+ Remove ntp_sprintf.h workaround for pre-ANSI C sprintf().
+
+ ntpd/refclock_tpro.c@1.13 +1 -1
+ comment only.
+
+ ntpd/refclock_tt560.c@1.3 +6 -6
+ sprintf() -> snprintf().
+
+ ntpd/refclock_wwv.c@1.77 +2 -2
+ sprintf() -> snprintf().
+
+ ntpdate/ntptimeset.c@1.15 +4 -29
+ sprintf() -> msyslog().
+ Remove replacement vsprintf(), ANSI C mandates it.
+
+ ports/winnt/include/config.h@1.96 +4 -2
+ Comment out #define vsnprintf _vsnprintf as l_stdlib.h #defines them now.
+
+ ports/winnt/libntp/syslog.c@1.10 +1 -1
+ vsprintf() -> vsnprintf().
+
+ ports/winnt/ntpd/hopf_PCI_io.c@1.9 +2 -0
+ include ntp_stdlib.h for snprintf define.
+
+ ports/winnt/vs2003/libntp.vcproj@1.22 +0 -3
+ Remove ntp_sprintf.h workaround for pre-ANSI C sprintf().
+
+ ports/winnt/vs2005/libntp.vcproj@1.20 +0 -4
+ Remove ntp_sprintf.h workaround for pre-ANSI C sprintf().
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.43 +0 -4
+ Remove ntp_sprintf.h workaround for pre-ANSI C sprintf().
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.40 +4 -0
+ add refclock_tt560.c
+
+ util/audio-pcm.c@1.2 +2 -2
+ sprintf() -> snprintf().
+
+ util/sht.c@1.4 +1 -1
+ sprintf() -> snprintf().
+
+ util/tg.c@1.5 +8 -7
+ sprintf() -> snprintf().
+
+ util/tg2.c@1.5 +28 -19
+ sprintf() -> snprintf().
+
+ChangeSet@1.2479.9.1, 2011-04-11 21:24:15+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove never-used, incomplete ports/winnt/ntpd/refclock_trimbledc.[ch]
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+
+ ChangeLog@1.839.1.1 +3 -0
+ Remove never-used, incomplete ports/winnt/ntpd/refclock_trimbledc.[ch]
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+
+ configure.ac@1.521.1.1 +2 -2
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+
+ include/l_stdlib.h@1.19 +6 -6
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+
+ include/ntp_machine.h@1.35 +0 -1
+ Remove unused MAXHOSTNAMELEN.
+
+ libntp/ntp_intres.c@1.95 +1 -1
+ Remove unused MAXHOSTNAMELEN.
+
+ libntp/snprintf.c@1.9 +2115 -44
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+
+ ntpd/ntp_io.c@1.352 +3 -1
+ Add #ifdef REFCLOCK to quiet input_handler() unused locals warning.
+
+ ntpdate/ntpdate.c@1.88 +0 -51
+ vsprintf() is required by ANSI C, remove fallback implementation.
+ Remove #if 0'd signal_no_reset() replacement.
+
+ ntpq/ntpq.c@1.137 +2 -2
+ Correct printf() format mismatch on 64-bit systems.
+
+ parseutil/Makefile.am@1.16 +1 -1
+ dcfd needs libntp.a when using rpl_snprintf().
+
+ ports/winnt/include/config.h@1.95 +23 -24
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+ Remove unused MAXHOSTNAMELEN.
+
+ ports/winnt/ntpd/hopf_PCI_io.c@1.8 +6 -0
+ #ifdef away unused code.
+
+ ports/winnt/vc6/libntp.dsp@1.63 +4 -0
+ add libntp/snprintf.c reference.
+
+ ports/winnt/vs2003/libntp.vcproj@1.21 +4 -344
+ add libntp/snprintf.c reference.
+
+ ports/winnt/vs2005/libntp.vcproj@1.19 +4 -0
+ add libntp/snprintf.c reference.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.42 +6 -2
+ add libntp/snprintf.c reference.
+
+ sntp/configure.ac@1.58.1.1 +1 -1
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+
+ sntp/m4/ntp_libntp.m4@1.9.1.1 +27 -1
+ On systems without C99-compliant (v)snprintf(), use C99-snprintf
+ replacements. (http://www.jhweiss.de/software/snprintf.html)
+
+ sntp/m4/snprintf.m4@1.1 +293 -0
+ BitKeeper file C:/ntp/ntp-dev-C99-snprintf/sntp/m4/snprintf.m4
+ ---
+ Adapt snprintf.m4 for integration in NTP.
+
+ sntp/m4/snprintf.m4@1.0 +0 -0
+
+ChangeSet@1.2479.1.52, 2011-04-11 07:20:42+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P149
+ TAG: NTP_4_2_7P149
+
+ ChangeLog@1.841 +1 -0
+ NTP_4_2_7P149
+
+ ntpd/ntpd-opts.c@1.154 +2 -2
+ NTP_4_2_7P149
+
+ ntpd/ntpd-opts.h@1.154 +3 -3
+ NTP_4_2_7P149
+
+ ntpd/ntpd-opts.texi@1.152 +2 -2
+ NTP_4_2_7P149
+
+ ntpd/ntpd.1@1.152 +2 -2
+ NTP_4_2_7P149
+
+ ntpdc/ntpdc-opts.c@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpdc/ntpdc-opts.h@1.151 +3 -3
+ NTP_4_2_7P149
+
+ ntpdc/ntpdc-opts.texi@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpdc/ntpdc.1@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpq/ntpq-opts.c@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpq/ntpq-opts.h@1.151 +3 -3
+ NTP_4_2_7P149
+
+ ntpq/ntpq-opts.texi@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpq/ntpq.1@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.151 +3 -3
+ NTP_4_2_7P149
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.151 +2 -2
+ NTP_4_2_7P149
+
+ ntpsnmpd/ntpsnmpd.1@1.151 +2 -2
+ NTP_4_2_7P149
+
+ packageinfo.sh@1.151 +1 -1
+ NTP_4_2_7P149
+
+ sntp/sntp-opts.c@1.145 +2 -2
+ NTP_4_2_7P149
+
+ sntp/sntp-opts.h@1.145 +3 -3
+ NTP_4_2_7P149
+
+ sntp/sntp-opts.texi@1.145 +2 -2
+ NTP_4_2_7P149
+
+ sntp/sntp.1@1.145 +2 -2
+ NTP_4_2_7P149
+
+ sntp/sntp.html@1.145 +1 -1
+ NTP_4_2_7P149
+
+ util/ntp-keygen-opts.c@1.149 +2 -2
+ NTP_4_2_7P149
+
+ util/ntp-keygen-opts.h@1.149 +3 -3
+ NTP_4_2_7P149
+
+ util/ntp-keygen-opts.texi@1.152 +2 -2
+ NTP_4_2_7P149
+
+ util/ntp-keygen.1@1.152 +2 -2
+ NTP_4_2_7P149
+
+ChangeSet@1.2479.1.51, 2011-04-10 22:39:36-07:00, harlan@hms-mbp.local
+ Cleanup autoconf macro ordering/dependencies
+
+ configure.ac@1.523 +1 -0
+ Cleanup autoconf macro ordering/dependencies
+
+ sntp/configure.ac@1.59 +1 -0
+ Cleanup autoconf macro ordering/dependencies
+
+ sntp/m4/ntp_libntp.m4@1.11 +1 -12
+ Cleanup autoconf macro ordering/dependencies
+
+ sntp/m4/ntp_prog_cc.m4@1.1 +21 -0
+ BitKeeper file /Users/harlan/src/ntp-dev/sntp/m4/ntp_prog_cc.m4
+
+ sntp/m4/ntp_prog_cc.m4@1.0 +0 -0
+
+ChangeSet@1.2479.1.50, 2011-04-10 18:45:38-07:00, harlan@hms-mbp.local
+ [Bug 1881] describe the {+,-,s} characters in configure --help output
+
+ ChangeLog@1.840 +1 -0
+ [Bug 1881] describe the {+,-,s} characters in configure --help output
+
+ChangeSet@1.2479.8.1, 2011-04-10 18:39:40-07:00, harlan@hms-mbp.local
+ Bug 1881: describe the {+,-,s} characters in configure --help output
+
+ configure.ac@1.522 +5 -2
+ Bug 1881: describe the {+,-,s} characters in configure --help output
+
+ sntp/m4/ntp_googletest.m4@1.4 +1 -1
+ Bug 1881: describe the {+,-,s} characters in configure --help output
+
+ sntp/m4/ntp_libntp.m4@1.10 +10 -2
+ Bug 1881: describe the {+,-,s} characters in configure --help output
+
+ChangeSet@1.2479.1.48, 2011-04-09 07:09:13+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P148
+ TAG: NTP_4_2_7P148
+
+ ChangeLog@1.839 +1 -0
+ NTP_4_2_7P148
+
+ ntpd/ntpd-opts.c@1.153 +2 -2
+ NTP_4_2_7P148
+
+ ntpd/ntpd-opts.h@1.153 +3 -3
+ NTP_4_2_7P148
+
+ ntpd/ntpd-opts.texi@1.151 +2 -2
+ NTP_4_2_7P148
+
+ ntpd/ntpd.1@1.151 +2 -2
+ NTP_4_2_7P148
+
+ ntpdc/ntpdc-opts.c@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpdc/ntpdc-opts.h@1.150 +3 -3
+ NTP_4_2_7P148
+
+ ntpdc/ntpdc-opts.texi@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpdc/ntpdc.1@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpq/ntpq-opts.c@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpq/ntpq-opts.h@1.150 +3 -3
+ NTP_4_2_7P148
+
+ ntpq/ntpq-opts.texi@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpq/ntpq.1@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.150 +3 -3
+ NTP_4_2_7P148
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.150 +2 -2
+ NTP_4_2_7P148
+
+ ntpsnmpd/ntpsnmpd.1@1.150 +2 -2
+ NTP_4_2_7P148
+
+ packageinfo.sh@1.150 +1 -1
+ NTP_4_2_7P148
+
+ sntp/sntp-opts.c@1.144 +2 -2
+ NTP_4_2_7P148
+
+ sntp/sntp-opts.h@1.144 +3 -3
+ NTP_4_2_7P148
+
+ sntp/sntp-opts.texi@1.144 +2 -2
+ NTP_4_2_7P148
+
+ sntp/sntp.1@1.144 +2 -2
+ NTP_4_2_7P148
+
+ sntp/sntp.html@1.144 +1 -1
+ NTP_4_2_7P148
+
+ util/ntp-keygen-opts.c@1.148 +2 -2
+ NTP_4_2_7P148
+
+ util/ntp-keygen-opts.h@1.148 +3 -3
+ NTP_4_2_7P148
+
+ util/ntp-keygen-opts.texi@1.151 +2 -2
+ NTP_4_2_7P148
+
+ util/ntp-keygen.1@1.151 +2 -2
+ NTP_4_2_7P148
+
+ChangeSet@1.2479.1.47, 2011-04-09 06:20:32+00:00, davehart@shiny.ad.hartbrothers.com
+ Buffer safety and sign extension fixes (thanks Coverity Scan).
+
+ ChangeLog@1.838 +1 -0
+ Buffer safety and sign extension fixes (thanks Coverity Scan).
+
+ libntp/icom.c@1.15 +18 -3
+ Check for failure of tcgetattr() and tcsetattr() in icom_init().
+
+ libparse/binio.c@1.8 +2 -2
+ Avoid sign-extension on 64-bit platforms.
+
+ libparse/ieee754io.c@1.10 +5 -5
+ Avoid sign-extension on 64-bit platforms.
+
+ ntpd/refclock_fg.c@1.14 +86 -91
+ Whitespace cleanup of refclock_fg.c.
+ Replace literal ctrl-P with '\x10'.
+ sprintf() -> snprintf().
+
+ ntpd/refclock_ulink.c@1.17 +1 -1
+ sprintf() -> snprintf().
+
+ ntpd/refclock_wwv.c@1.76 +8 -6
+ sprintf() -> snprintf().
+
+ ntpd/refclock_zyfer.c@1.9 +1 -1
+ sprintf() -> snprintf().
+
+ ntpq/ntpq.c@1.136 +2 -2
+ printf signed/unsigned format mismatch.
+
+ parseutil/dcfd.c@1.23 +10 -5
+ printf signed/unsigned format mismatch.
+ sprintf() -> snprintf().
+
+ util/ntptime.c@1.23 +120 -93
+ sprintf() -> snprintf().
+ Protect against buffer overrun in sprintb().
+
+ChangeSet@1.2479.7.4, 2011-04-08 02:02:48+00:00, davehart@shiny.ad.hartbrothers.com
+ Use _mkgmtime() as timegm() in the Windows port, rather than
+ libntp/mktime.c's timegm(). Fixed [Bug 1875] on Windows using the old
+ asn2ntp() code from before 4.2.7p147.
+ ntp_crypto.c string buffer safety.
+ Remove use of MAXFILENAME in mode 7 (ntpdc) on-wire structs.
+ Change ntpd MAXFILENAME from 128 to 256 to match ntp-keygen.
+
+ ChangeLog@1.834.1.1 +6 -0
+ Use _mkgmtime() as timegm() in the Windows port, rather than
+ libntp/mktime.c's timegm(). Fixed [Bug 1875] on Windows using the old
+ asn2ntp() code from before 4.2.7p147.
+ ntp_crypto.c string buffer safety.
+ Remove use of MAXFILENAME in mode 7 (ntpdc) on-wire structs.
+ Change ntpd MAXFILENAME from 128 to 256 to match ntp-keygen.
+
+ include/ntp.h@1.193 +1 -1
+ Change ntpd's MAXFILENAME to 256 to match what ntp-keygen uses.
+
+ include/ntp_request.h@1.43 +6 -5
+ Remove use of MAXFILENAME in mode 7 (ntpdc) on-wire structs.
+
+ ntpd/ntp_control.c@1.167 +2 -2
+ use sizeof(buffer) rather than inside knowledge of buffer size.
+
+ ntpd/ntp_crypto.c@1.155.1.1 +46 -51
+ emalloc() + strcpy() -> estrdup().
+ fstostr() + strcpy() + fstostr() + strcpy() + snprintf() + report_event()
+ -> fstostr() + mprintf_event().
+ Use sizeof(buffer) rather than hardcoded knowledge of buffer size.
+
+ ntpd/ntp_util.c@1.94 +2 -5
+ fstostr() can now safely return strings longer than 19 characters.
+
+ ports/winnt/include/config.h@1.94 +2 -0
+ Use _mkgmtime() as timegm() in the Windows port, rather than
+ libntp/mktime.c's timegm(). Fixes [Bug 1875] on Windows, however that
+ bug is still present on systems without timegm().
+
+ sntp/tests/keyFile.cpp@1.4 +7 -6
+ strncpy() -> strlcpy()
+
+ util/ntp-keygen.c@1.81 +26 -21
+ Remove duplicate BN_CTX_new() call from gen_gqkey(), flagged by Coverity.
+
+ChangeSet@1.2479.1.45, 2011-04-07 11:30:15+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P147
+ TAG: NTP_4_2_7P147
+
+ ChangeLog@1.836 +1 -0
+ NTP_4_2_7P147
+
+ ntpd/ntpd-opts.c@1.152 +2 -2
+ NTP_4_2_7P147
+
+ ntpd/ntpd-opts.h@1.152 +3 -3
+ NTP_4_2_7P147
+
+ ntpd/ntpd-opts.texi@1.150 +2 -2
+ NTP_4_2_7P147
+
+ ntpd/ntpd.1@1.150 +2 -2
+ NTP_4_2_7P147
+
+ ntpdc/ntpdc-opts.c@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpdc/ntpdc-opts.h@1.149 +3 -3
+ NTP_4_2_7P147
+
+ ntpdc/ntpdc-opts.texi@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpdc/ntpdc.1@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpq/ntpq-opts.c@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpq/ntpq-opts.h@1.149 +3 -3
+ NTP_4_2_7P147
+
+ ntpq/ntpq-opts.texi@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpq/ntpq.1@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.149 +3 -3
+ NTP_4_2_7P147
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.149 +2 -2
+ NTP_4_2_7P147
+
+ ntpsnmpd/ntpsnmpd.1@1.149 +2 -2
+ NTP_4_2_7P147
+
+ packageinfo.sh@1.149 +1 -1
+ NTP_4_2_7P147
+
+ sntp/sntp-opts.c@1.143 +2 -2
+ NTP_4_2_7P147
+
+ sntp/sntp-opts.h@1.143 +3 -3
+ NTP_4_2_7P147
+
+ sntp/sntp-opts.texi@1.143 +2 -2
+ NTP_4_2_7P147
+
+ sntp/sntp.1@1.143 +2 -2
+ NTP_4_2_7P147
+
+ sntp/sntp.html@1.143 +1 -1
+ NTP_4_2_7P147
+
+ util/ntp-keygen-opts.c@1.147 +2 -2
+ NTP_4_2_7P147
+
+ util/ntp-keygen-opts.h@1.147 +3 -3
+ NTP_4_2_7P147
+
+ util/ntp-keygen-opts.texi@1.150 +2 -2
+ NTP_4_2_7P147
+
+ util/ntp-keygen.1@1.150 +2 -2
+ NTP_4_2_7P147
+
+ChangeSet@1.2479.1.43, 2011-04-05 19:23:34+02:00, jnperlin@hydra.localnet
+ [bug 1875] 'asn2ntp()' rewritten in terms of 'caltontp()' (ChangeLog update)
+
+ ChangeLog@1.832.1.1 +2 -0
+ [bug 1875] 'asn2ntp()' rewritten in terms of 'caltontp()'
+
+ChangeSet@1.2479.7.3, 2011-04-05 07:50:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P146
+ TAG: NTP_4_2_7P146
+
+ ChangeLog@1.834 +1 -0
+ NTP_4_2_7P146
+
+ ntpd/ntpd-opts.c@1.151 +2 -2
+ NTP_4_2_7P146
+
+ ntpd/ntpd-opts.h@1.151 +3 -3
+ NTP_4_2_7P146
+
+ ntpd/ntpd-opts.texi@1.149 +2 -2
+ NTP_4_2_7P146
+
+ ntpd/ntpd.1@1.149 +2 -2
+ NTP_4_2_7P146
+
+ ntpdc/ntpdc-opts.c@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpdc/ntpdc-opts.h@1.148 +3 -3
+ NTP_4_2_7P146
+
+ ntpdc/ntpdc-opts.texi@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpdc/ntpdc.1@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpq/ntpq-opts.c@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpq/ntpq-opts.h@1.148 +3 -3
+ NTP_4_2_7P146
+
+ ntpq/ntpq-opts.texi@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpq/ntpq.1@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.148 +3 -3
+ NTP_4_2_7P146
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.148 +2 -2
+ NTP_4_2_7P146
+
+ ntpsnmpd/ntpsnmpd.1@1.148 +2 -2
+ NTP_4_2_7P146
+
+ packageinfo.sh@1.148 +1 -1
+ NTP_4_2_7P146
+
+ sntp/sntp-opts.c@1.142 +2 -2
+ NTP_4_2_7P146
+
+ sntp/sntp-opts.h@1.142 +3 -3
+ NTP_4_2_7P146
+
+ sntp/sntp-opts.texi@1.142 +2 -2
+ NTP_4_2_7P146
+
+ sntp/sntp.1@1.142 +2 -2
+ NTP_4_2_7P146
+
+ sntp/sntp.html@1.142 +1 -1
+ NTP_4_2_7P146
+
+ util/ntp-keygen-opts.c@1.146 +2 -2
+ NTP_4_2_7P146
+
+ util/ntp-keygen-opts.h@1.146 +3 -3
+ NTP_4_2_7P146
+
+ util/ntp-keygen-opts.texi@1.149 +2 -2
+ NTP_4_2_7P146
+
+ util/ntp-keygen.1@1.149 +2 -2
+ NTP_4_2_7P146
+
+ChangeSet@1.2479.7.2, 2011-04-05 07:30:59+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog entry for prior cset.
+ String buffer safety cleanup, converting to strlcpy() and strlcat().
+ Use utmpname() before pututline() so repeated steps do not
+ accidentally record into wtmp where utmp was intended.
+ Use setutent() before each pututline() including first.
+
+ ChangeLog@1.833 +4 -0
+ ChangeLog entry for prior cset.
+ String buffer safety cleanup, converting to strlcpy() and strlcat().
+ Use utmpname() before pututline() so repeated steps do not
+ accidentally record into wtmp where utmp was intended.
+ Use setutent() before each pututline() including first.
+
+ChangeSet@1.2479.7.1, 2011-04-05 07:05:55+00:00, davehart@shiny.ad.hartbrothers.com
+ String buffer safety cleanup, converting to strlcpy() and strlcat().
+ Use utmpname() before pututline() so repeated steps do not accidentally
+ record into wtmp where utmp was intended.
+ Use setutent() before each pututline() including first.
+
+ BitKeeper/deleted/e7/ntp_resolver.c~47dd06e9@1.19 +0 -0
+ Rename: ntpd/ntp_resolver.c -> BitKeeper/deleted/e7/ntp_resolver.c~47dd06e9
+
+ include/ntp_stdlib.h@1.62 +21 -0
+ Conditional declarations for strlcpy(), strlcat() for systems which
+ do not provide them.
+
+ libntp/Makefile.am@1.62 +1 -0
+ add strl_obsd.c containing fallback strlcpy() and strlcat() picked up
+ from OpenBSD.
+
+ libntp/audio.c@1.30 +4 -4
+ strncpy() -> strlcpy()
+
+ libntp/authkeys.c@1.22 +2 -2
+ strncpy() -> strlcpy()
+
+ libntp/decodenetnum.c@1.14 +1 -1
+ strncpy() -> strlcpy()
+
+ libntp/findconfig.c@1.5 +2 -2
+ strncpy() -> strlcpy()
+
+ libntp/msyslog.c@1.39 +1 -1
+ strncpy() -> strlcpy()
+
+ libntp/ntp_rfc2553.c@1.46 +1 -10
+ strncpy() -> strlcpy()
+
+ libntp/numtoa.c@1.7 +1 -1
+ strncpy() -> memcpy()
+
+ libntp/numtohost.c@1.6 +2 -3
+ strncpy() -> strlcpy()
+
+ libntp/socktoa.c@1.16 +1 -1
+ strncpy() -> strlcpy()
+
+ libntp/ssl_init.c@1.15 +1 -1
+ strncpy() -> strlcpy()
+
+ libntp/strl_obsd.c@1.1 +123 -0
+ BitKeeper file C:/ntp/ntp-dev-strlcpy/libntp/strl_obsd.c
+
+ libntp/strl_obsd.c@1.0 +0 -0
+
+ libntp/systime.c@1.54 +22 -11
+ Use utmpname() before pututline() so repeated steps do not accidentally
+ record into wtmp where utmp was intended.
+ Use setutent() before each pututline() including first.
+ strncpy() -> strlcpy()
+
+ libparse/data_mbg.c@1.11 +3 -3
+ strncpy() -> strlcpy()
+
+ libparse/parsesolaris.c@1.11 +1 -1
+ strncpy() -> strlcpy()
+
+ ntpd/ntp_config.c@1.288 +2 -4
+ strncpy() -> strlcpy()
+ Remove leftover redundant CHECK_FIFO_CONSISTENCY() calls added to
+ get correct line numbers from failures. CONCAT_FIFO() has same.
+
+ ntpd/ntp_control.c@1.166 +12 -10
+ strncpy() -> strlcpy()
+
+ ntpd/ntp_filegen.c@1.23 +8 -9
+ strncpy() -> strlcpy()
+
+ ntpd/ntp_io.c@1.351 +11 -11
+ strncpy() -> strlcpy()
+
+ ntpd/ntp_request.c@1.104 +1 -1
+ strncpy() -> strlcpy()
+
+ ntpd/ntp_scanner.c@1.42 +1 -1
+ strncpy() -> strlcpy()
+
+ ntpd/ntp_signd.c@1.4 +1 -1
+ strncpy() -> strlcpy()
+
+ ntpd/ntp_util.c@1.93 +7 -7
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_acts.c@1.49 +2 -2
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_arbiter.c@1.20 +11 -11
+ strcat() -> strlcat()
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_chu.c@1.52 +1 -1
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_hpgps.c@1.14 +1 -1
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_jjy.c@1.23 +8 -11
+ strncat() -> strlcat() (was nearly the only correct use of strncat() in NTP)
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_neoclock4x.c@1.21 +10 -10
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_oncore.c@1.94 +17 -18
+ strncat() -> strlcat()
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_parse.c@1.58 +110 -106
+ strncat() -> strlcat()
+ strncpy() -> strlcpy()
+
+ ntpd/refclock_true.c@1.19 +105 -97
+ strncpy() -> strlcpy()
+ indent cleanup
+
+ ntpd/refclock_wwv.c@1.75 +18 -13
+ sprintf() -> snprintf()
+ strcat() -> strlcat()
+
+ ntpdate/ntpdate.c@1.87 +2 -2
+ strncpy() -> strlcpy()
+
+ ntpdate/ntptime_config.c@1.6 +2 -4
+ emalloc() + strcpy() -> estrdup()
+
+ ntpdc/ntpdc.c@1.96 +5 -6
+ strncpy() -> strlcpy()
+
+ ntpdc/ntpdc_ops.c@1.77 +19 -15
+ strcat() -> strlcat()
+ strncpy() -> strlcpy()
+
+ ntpq/ntpq-subs.c@1.86 +7 -6
+ strncpy() -> strlcpy()
+ strncpy() -> memcpy()
+
+ ntpq/ntpq.c@1.135 +5 -6
+ strncat() -> strlcat()
+ strncpy() -> strlcpy()
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.8 +1 -1
+ strncpy() -> strlcpy()
+
+ ports/winnt/libntp/syslog.c@1.9 +1 -2
+ strncpy() -> strlcpy()
+
+ ports/winnt/vc6/libntp.dsp@1.62 +4 -0
+ add strl_obsd.c containing fallback strlcpy() and strlcat() picked up
+ from OpenBSD.
+
+ ports/winnt/vs2003/libntp.vcproj@1.20 +3 -18
+ add strl_obsd.c containing fallback strlcpy() and strlcat() picked up
+ from OpenBSD.
+
+ ports/winnt/vs2005/libntp.vcproj@1.18 +4 -0
+ add strl_obsd.c containing fallback strlcpy() and strlcat() picked up
+ from OpenBSD.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.41 +6 -2
+ add strl_obsd.c containing fallback strlcpy() and strlcat() picked up
+ from OpenBSD.
+
+ sntp/kod_management.c@1.28 +1 -3
+ strncpy() -> strlcpy()
+
+ sntp/m4/ntp_libntp.m4@1.9 +1 -1
+ Check for strlcpy(), strlcat()
+
+ sntp/utilities.c@1.18 +2 -7
+ emalloc() + strncpy() -> estrdup()
+
+ util/ntp-keygen.c@1.80 +45 -19
+ Handle readlink() which doesn't NUL-terminate.
+ strdup() -> estrdup()
+ strcpy() -> strlcpy()
+ strcat() -> strlcat()
+ sprintf() -> snprintf()
+
+ util/tg.c@1.4 +2 -2
+ strcpy() -> strlcpy()
+
+ util/tg2.c@1.4 +15 -18
+ strcpy() -> strlcpy()
+ strncat() -> strlcat()
+
+ChangeSet@1.2479.1.42, 2011-04-04 18:39:05+02:00, jnperlin@hydra.localnet
+ bug1875 added missing header
+
+ ntpd/ntp_crypto.c@1.157 +1 -0
+ added missing header
+
+ChangeSet@1.2479.1.41, 2011-04-04 18:37:14+02:00, jnperlin@hydra.localnet
+ bug1875: timegm() from libntp blows up with 64bit time_t on Windows
+
+ ntpd/ntp_crypto.c@1.156 +14 -13
+ bug1875: timegm() from libntp blows up with 64bit time_t on Windows
+
+ChangeSet@1.2479.1.40, 2011-04-04 11:43:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P145
+ TAG: NTP_4_2_7P145
+
+ ChangeLog@1.832 +1 -0
+ NTP_4_2_7P145
+
+ ntpd/ntpd-opts.c@1.150 +2 -2
+ NTP_4_2_7P145
+
+ ntpd/ntpd-opts.h@1.150 +3 -3
+ NTP_4_2_7P145
+
+ ntpd/ntpd-opts.texi@1.148 +2 -2
+ NTP_4_2_7P145
+
+ ntpd/ntpd.1@1.148 +2 -2
+ NTP_4_2_7P145
+
+ ntpdc/ntpdc-opts.c@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpdc/ntpdc-opts.h@1.147 +3 -3
+ NTP_4_2_7P145
+
+ ntpdc/ntpdc-opts.texi@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpdc/ntpdc.1@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpq/ntpq-opts.c@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpq/ntpq-opts.h@1.147 +3 -3
+ NTP_4_2_7P145
+
+ ntpq/ntpq-opts.texi@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpq/ntpq.1@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.147 +3 -3
+ NTP_4_2_7P145
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.147 +2 -2
+ NTP_4_2_7P145
+
+ ntpsnmpd/ntpsnmpd.1@1.147 +2 -2
+ NTP_4_2_7P145
+
+ packageinfo.sh@1.147 +1 -1
+ NTP_4_2_7P145
+
+ sntp/sntp-opts.c@1.141 +2 -2
+ NTP_4_2_7P145
+
+ sntp/sntp-opts.h@1.141 +3 -3
+ NTP_4_2_7P145
+
+ sntp/sntp-opts.texi@1.141 +2 -2
+ NTP_4_2_7P145
+
+ sntp/sntp.1@1.141 +2 -2
+ NTP_4_2_7P145
+
+ sntp/sntp.html@1.141 +1 -1
+ NTP_4_2_7P145
+
+ util/ntp-keygen-opts.c@1.145 +2 -2
+ NTP_4_2_7P145
+
+ util/ntp-keygen-opts.h@1.145 +3 -3
+ NTP_4_2_7P145
+
+ util/ntp-keygen-opts.texi@1.148 +2 -2
+ NTP_4_2_7P145
+
+ util/ntp-keygen.1@1.148 +2 -2
+ NTP_4_2_7P145
+
+ChangeSet@1.2479.1.39, 2011-04-03 19:25:33+00:00, davehart@shiny.ad.hartbrothers.com
+ Cleanup a few Coverity static analysis warnings.
+
+ include/ntp_config.h@1.71 +3 -2
+ Add prototype for check_gen_fifo_consistency() overlooked in prior cet.
+
+ lib/isc/task.c@1.4 +1 -1
+ shuffle lock destruction until after protected field update to quiet
+ Coverity's lock analysis.
+
+ libntp/audio.c@1.29 +4 -4
+ Use width with sscanf(str, "%s", ...) to avoid overrun of destination.
+
+ libntp/work_thread.c@1.7 +3 -3
+ Change several DEBUG_REQUIRE to REQUIRE so needed safety checks are
+ included in -nodebug builds.
+
+ ntpd/ntp_config.c@1.287 +2 -2
+ match check_gen_fifo_consistency parameter naame with ntp_config.h
+
+ ntpd/refclock_nmea.c@1.60 +8 -6
+ leave room for terminating NUL by calling readlink with sizeof(...) - 1.
+
+ChangeSet@1.2479.1.38, 2011-04-03 17:35:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1840] ntp_lists.h FIFO macros buggy.
+
+ ChangeLog@1.831 +1 -0
+ [Bug 1840] ntp_lists.h FIFO macros buggy.
+
+ include/ntp_lists.h@1.11 +40 -28
+ Maintain pptail correctly in UNLINK_FIFO(), CONCAT_FIFO().
+ Add more checks to CHECK_FIFO_CONSISTENCY, use it more.
+ Re-enable NTP_DEBUG_LISTS_H on DEBUG builds.
+
+ libntp/mktime.c@1.10 +2 -2
+ whitespace only (leading blanks -> tab)
+
+ ntpd/ntp_config.c@1.286 +31 -0
+ Move CHECK_FIFO_CONSISTENCY guts from macro to function so debuggers
+ can highlight the failing check rather than entire macro invocation.
+
+ChangeSet@1.2479.1.37, 2011-04-03 06:35:28+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P144
+ TAG: NTP_4_2_7P144
+
+ ChangeLog@1.830 +1 -0
+ NTP_4_2_7P144
+
+ ntpd/ntpd-opts.c@1.149 +2 -2
+ NTP_4_2_7P144
+
+ ntpd/ntpd-opts.h@1.149 +3 -3
+ NTP_4_2_7P144
+
+ ntpd/ntpd-opts.texi@1.147 +2 -2
+ NTP_4_2_7P144
+
+ ntpd/ntpd.1@1.147 +2 -2
+ NTP_4_2_7P144
+
+ ntpdc/ntpdc-opts.c@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpdc/ntpdc-opts.h@1.146 +3 -3
+ NTP_4_2_7P144
+
+ ntpdc/ntpdc-opts.texi@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpdc/ntpdc.1@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpq/ntpq-opts.c@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpq/ntpq-opts.h@1.146 +3 -3
+ NTP_4_2_7P144
+
+ ntpq/ntpq-opts.texi@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpq/ntpq.1@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.146 +3 -3
+ NTP_4_2_7P144
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.146 +2 -2
+ NTP_4_2_7P144
+
+ ntpsnmpd/ntpsnmpd.1@1.146 +2 -2
+ NTP_4_2_7P144
+
+ packageinfo.sh@1.146 +1 -1
+ NTP_4_2_7P144
+
+ sntp/sntp-opts.c@1.140 +2 -2
+ NTP_4_2_7P144
+
+ sntp/sntp-opts.h@1.140 +3 -3
+ NTP_4_2_7P144
+
+ sntp/sntp-opts.texi@1.140 +2 -2
+ NTP_4_2_7P144
+
+ sntp/sntp.1@1.140 +2 -2
+ NTP_4_2_7P144
+
+ sntp/sntp.html@1.140 +1 -1
+ NTP_4_2_7P144
+
+ util/ntp-keygen-opts.c@1.144 +2 -2
+ NTP_4_2_7P144
+
+ util/ntp-keygen-opts.h@1.144 +3 -3
+ NTP_4_2_7P144
+
+ util/ntp-keygen-opts.texi@1.147 +2 -2
+ NTP_4_2_7P144
+
+ util/ntp-keygen.1@1.147 +2 -2
+ NTP_4_2_7P144
+
+ChangeSet@1.2479.1.36, 2011-04-02 06:32:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1874] ntpq -c "rv 0 sys_var_list" empty.
+
+ ChangeLog@1.829 +1 -0
+ [Bug 1874] ntpq -c "rv 0 sys_var_list" empty.
+
+ ntpd/ntp_control.c@1.165 +27 -44
+ [Bug 1874] ntpq -c "rv 0 sys_var_list" empty.
+
+ ntpq/ntpq.c@1.134 +10 -10
+ [Bug 1874] ntpq -c "rv 0 sys_var_list" empty.
+
+ChangeSet@1.2479.1.35, 2011-03-31 18:16:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P143
+ TAG: NTP_4_2_7P143
+
+ ChangeLog@1.828 +1 -0
+ NTP_4_2_7P143
+
+ ntpd/ntpd-opts.c@1.148 +2 -2
+ NTP_4_2_7P143
+
+ ntpd/ntpd-opts.h@1.148 +3 -3
+ NTP_4_2_7P143
+
+ ntpd/ntpd-opts.texi@1.146 +4 -4
+ NTP_4_2_7P143
+
+ ntpd/ntpd.1@1.146 +2 -2
+ NTP_4_2_7P143
+
+ ntpdc/ntpdc-opts.c@1.145 +2 -2
+ NTP_4_2_7P143
+
+ ntpdc/ntpdc-opts.h@1.145 +3 -3
+ NTP_4_2_7P143
+
+ ntpdc/ntpdc-opts.texi@1.145 +4 -4
+ NTP_4_2_7P143
+
+ ntpdc/ntpdc.1@1.145 +2 -2
+ NTP_4_2_7P143
+
+ ntpq/ntpq-opts.c@1.145 +2 -2
+ NTP_4_2_7P143
+
+ ntpq/ntpq-opts.h@1.145 +3 -3
+ NTP_4_2_7P143
+
+ ntpq/ntpq-opts.texi@1.145 +4 -4
+ NTP_4_2_7P143
+
+ ntpq/ntpq.1@1.145 +2 -2
+ NTP_4_2_7P143
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.145 +2 -2
+ NTP_4_2_7P143
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.145 +3 -3
+ NTP_4_2_7P143
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.145 +4 -4
+ NTP_4_2_7P143
+
+ ntpsnmpd/ntpsnmpd.1@1.145 +2 -2
+ NTP_4_2_7P143
+
+ packageinfo.sh@1.145 +1 -1
+ NTP_4_2_7P143
+
+ sntp/sntp-opts.c@1.139 +2 -2
+ NTP_4_2_7P143
+
+ sntp/sntp-opts.h@1.139 +3 -3
+ NTP_4_2_7P143
+
+ sntp/sntp-opts.texi@1.139 +4 -4
+ NTP_4_2_7P143
+
+ sntp/sntp.1@1.139 +2 -2
+ NTP_4_2_7P143
+
+ sntp/sntp.html@1.139 +3 -3
+ NTP_4_2_7P143
+
+ util/ntp-keygen-opts.c@1.143 +2 -2
+ NTP_4_2_7P143
+
+ util/ntp-keygen-opts.h@1.143 +3 -3
+ NTP_4_2_7P143
+
+ util/ntp-keygen-opts.texi@1.146 +4 -4
+ NTP_4_2_7P143
+
+ util/ntp-keygen.1@1.146 +2 -2
+ NTP_4_2_7P143
+
+ChangeSet@1.2479.1.34, 2011-03-31 13:11:38-04:00, stenn@deacon.udel.edu
+ Temporarily restore legacy ppsclock global fdpps for trak, zyfer refclocks
+
+ ntpd/ntp_refclock.c@1.106 +6 -1
+ Temporarily restore legacy ppsclock global fdpps for trak, zyfer refclocks
+
+ChangeSet@1.2479.1.33, 2011-03-30 04:53:34+00:00, davehart@shiny.ad.hartbrothers.com
+ Follow Ralf Wildenhues' advice for avoiding dead-code elimination
+ in configure test for in6addr_any.
+
+ sntp/m4/ntp_ipv6.m4@1.4 +23 -19
+ Follow Ralf Wildenhues' advice for avoiding dead-code elimination
+ in configure test for in6addr_any.
+
+ChangeSet@1.2479.1.32, 2011-03-29 13:35:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1862] in6addr_any test in configure fooled by arm gcc 4.1.3 -O2.
+
+ ChangeLog@1.827 +1 -0
+ [Bug 1862] in6addr_any test in configure fooled by arm gcc 4.1.3 -O2.
+
+ ntpd/ntp_crypto.c@1.155 +0 -1
+ Remove dead code (excess call to X509_get_ext()).
+
+ sntp/m4/ntp_ipv6.m4@1.3 +2 -2
+ [Bug 1862] in6addr_any test in configure fooled by arm gcc 4.1.3 -O2.
+
+ChangeSet@1.2479.6.1, 2011-03-28 02:29:10+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove "signal_no_reset: signal 17 had flags 4000000" logging, as it
+ indicates no problem and is interpreted as an error. Previously some
+ bits had been ignored one-by-one, but Linux SA_RESTORER definition is
+ unavailable to user headers.
+
+ ChangeLog@1.824.1.1 +4 -0
+ Remove "signal_no_reset: signal 17 had flags 4000000" logging, as it
+ indicates no problem and is interpreted as an error. Previously some
+ bits had been ignored one-by-one, but Linux SA_RESTORER definition is
+ unavailable to user headers.
+
+ libntp/syssignal.c@1.13 +1 -29
+ Remove "signal_no_reset: signal 17 had flags 4000000" logging, as it
+ indicates no problem and is interpreted as an error. Previously some
+ bits had been ignored one-by-one, but Linux SA_RESTORER definition is
+ unavailable to user headers.
+ Zero struct sigaction to silence warning about uninit vec.sa_restorer.
+
+ sntp/m4/ntp_libntp.m4@1.8 +0 -12
+ Remove unneeded dead code.
+
+ChangeSet@1.2479.1.30, 2011-03-26 02:03:35+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1861] tickadj build failure using uClibc.
+
+ ChangeLog@1.825 +1 -0
+ [Bug 1861] tickadj build failure using uClibc.
+
+ configure.ac@1.521 +62 -37
+ [Bug 1861] tickadj build failure using uClibc.
+
+ include/ntp_machine.h@1.34 +0 -11
+ moved to configure.ac
+
+ include/ntp_syscall.h@1.10 +24 -28
+ [Bug 1861] tickadj build failure using uClibc.
+
+ util/tickadj.c@1.12 +12 -9
+ [Bug 1861] tickadj build failure using uClibc.
+
+ChangeSet@1.2479.1.29, 2011-03-23 07:14:48+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1732] ntpd ties up CPU on disconnected USB refclock.
+
+ ChangeLog@1.824 +1 -0
+ [Bug 1732] ntpd ties up CPU on disconnected USB refclock.
+
+ ntpd/ntp_io.c@1.350 +39 -12
+ [Bug 1732] ntpd ties up CPU on disconnected USB refclock.
+
+ChangeSet@1.2479.5.2, 2011-03-21 07:57:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P142
+ TAG: NTP_4_2_7P142
+
+ ChangeLog@1.821.1.2 +1 -0
+ NTP_4_2_7P142
+
+ clockstuff/clktest-opts.c@1.67.1.1 +2 -2
+ NTP_4_2_7P142
+
+ clockstuff/clktest-opts.h@1.67.1.1 +3 -3
+ NTP_4_2_7P142
+
+ ntpd/ntpd-opts.c@1.147 +2 -2
+ NTP_4_2_7P142
+
+ ntpd/ntpd-opts.h@1.147 +3 -3
+ NTP_4_2_7P142
+
+ ntpd/ntpd-opts.texi@1.145 +2 -2
+ NTP_4_2_7P142
+
+ ntpd/ntpd.1@1.145 +2 -2
+ NTP_4_2_7P142
+
+ ntpdc/ntpdc-opts.c@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpdc/ntpdc-opts.h@1.144 +3 -3
+ NTP_4_2_7P142
+
+ ntpdc/ntpdc-opts.texi@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpdc/ntpdc.1@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpq/ntpq-opts.c@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpq/ntpq-opts.h@1.144 +3 -3
+ NTP_4_2_7P142
+
+ ntpq/ntpq-opts.texi@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpq/ntpq.1@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.144 +3 -3
+ NTP_4_2_7P142
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.144 +2 -2
+ NTP_4_2_7P142
+
+ ntpsnmpd/ntpsnmpd.1@1.144 +2 -2
+ NTP_4_2_7P142
+
+ packageinfo.sh@1.144 +1 -1
+ NTP_4_2_7P142
+
+ sntp/sntp-opts.c@1.138 +2 -2
+ NTP_4_2_7P142
+
+ sntp/sntp-opts.h@1.138 +3 -3
+ NTP_4_2_7P142
+
+ sntp/sntp-opts.texi@1.138 +2 -2
+ NTP_4_2_7P142
+
+ sntp/sntp.1@1.138 +2 -2
+ NTP_4_2_7P142
+
+ sntp/sntp.html@1.138 +1 -1
+ NTP_4_2_7P142
+
+ util/ntp-keygen-opts.c@1.142 +2 -2
+ NTP_4_2_7P142
+
+ util/ntp-keygen-opts.h@1.142 +3 -3
+ NTP_4_2_7P142
+
+ util/ntp-keygen-opts.texi@1.145 +2 -2
+ NTP_4_2_7P142
+
+ util/ntp-keygen.1@1.145 +2 -2
+ NTP_4_2_7P142
+
+ChangeSet@1.2479.5.1, 2011-03-21 06:28:29+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1844] ntpd 4.2.7p131 NetBSD, ld --gc-sections links bad executable.
+
+ ChangeLog@1.821.1.1 +2 -0
+ [Bug 1844] ntpd 4.2.7p131 NetBSD, ld --gc-sections links bad executable.
+ Fix "make distcheck" break in libevent/sample caused by typo.
+
+ sntp/libevent/Makefile.am@1.4 +1 -1
+ Fix "make distcheck" break in libevent/sample caused by typo.
+
+ sntp/libevent/configure.in@1.4 +45 -7
+ [Bug 1844] ntpd 4.2.7p131 NetBSD, ld --gc-sections links bad executable.
+
+ sntp/m4/ntp_compiler.m4@1.2 +45 -7
+ [Bug 1844] ntpd 4.2.7p131 NetBSD, ld --gc-sections links bad executable.
+
+ChangeSet@1.2479.4.1, 2011-03-20 20:39:43+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ .point-changed-filelist@1.9 +0 -2
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ BitKeeper/deleted/42/clktest-opts.c~28d4c334dbca58a1@1.66.1.1 +0 -0
+ Rename: clockstuff/clktest-opts.c -> BitKeeper/deleted/42/clktest-opts.c~28d4c334dbca58a1
+
+ BitKeeper/deleted/46/tty_chu.c~3e480692@1.3 +0 -0
+ Rename: kernel/tty_chu.c -> BitKeeper/deleted/46/tty_chu.c~3e480692
+
+ BitKeeper/deleted/69/clkinit.c~3e480692@1.4 +0 -0
+ Rename: kernel/clkinit.c -> BitKeeper/deleted/69/clkinit.c~3e480692
+
+ BitKeeper/deleted/7d/clktest.c~3e480692@1.7 +0 -0
+ Rename: clockstuff/clktest.c -> BitKeeper/deleted/7d/clktest.c~3e480692
+
+ BitKeeper/deleted/96/tty_clk_STREAMS.c~3e480692@1.3 +0 -0
+ Rename: kernel/tty_clk_STREAMS.c -> BitKeeper/deleted/96/tty_clk_STREAMS.c~3e480692
+
+ BitKeeper/deleted/99/tty_clk.c~3e480692@1.3 +0 -0
+ Rename: kernel/tty_clk.c -> BitKeeper/deleted/99/tty_clk.c~3e480692
+
+ BitKeeper/deleted/ab/chuinit.c~3e480692@1.4 +0 -0
+ Rename: kernel/chuinit.c -> BitKeeper/deleted/ab/chuinit.c~3e480692
+
+ BitKeeper/deleted/bf/chudefs.h~3e480692@1.3 +0 -0
+ Rename: kernel/sys/chudefs.h -> BitKeeper/deleted/bf/chudefs.h~3e480692
+
+ BitKeeper/deleted/d6/clkdefs.h~3e480692@1.3 +0 -0
+ Rename: kernel/sys/clkdefs.h -> BitKeeper/deleted/d6/clkdefs.h~3e480692
+
+ BitKeeper/deleted/d7/README~3e480692@1.3 +0 -0
+ Rename: kernel/README -> BitKeeper/deleted/d7/README~3e480692
+
+ BitKeeper/deleted/e1/clktest-opts.def~10c559de4ec2c50e@1.9 +0 -0
+ Rename: clockstuff/clktest-opts.def -> BitKeeper/deleted/e1/clktest-opts.def~10c559de4ec2c50e
+
+ BitKeeper/deleted/e5/clktest-opts.h~d3cf51ce6544d610@1.66.1.1 +0 -0
+ Rename: clockstuff/clktest-opts.h -> BitKeeper/deleted/e5/clktest-opts.h~d3cf51ce6544d610
+
+ BitKeeper/deleted/ed/tty_chu_STREAMS.c~3e480692@1.3 +0 -0
+ Rename: kernel/tty_chu_STREAMS.c -> BitKeeper/deleted/ed/tty_chu_STREAMS.c~3e480692
+
+ ChangeLog@1.820.1.1 +3 -0
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ clockstuff/Makefile.am@1.20 +3 -25
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ clockstuff/README@1.4 +4 -14
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ configure.ac@1.520 +1 -61
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ include/ntp_tty.h@1.6 +9 -7
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ include/ntpd.h@1.161 +0 -7
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ kernel/Makefile.am@1.6 +0 -1
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ kernel/sys/Makefile.am@1.7 +1 -1
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ ntpd/ntp_refclock.c@1.105 +9 -106
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ ntpd/refclock_datum.c@1.17 +0 -3
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ ntpd/refclock_leitch.c@1.14 +5 -43
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ ntpd/refclock_oncore.c@1.93 +0 -4
+ Remove kernel line discipline driver code for clk and chu, deprecate
+ related LDISC_ flags, and remove associated ntpd code to decode the
+ timestamps, remove clktest line discipline test program.
+
+ChangeSet@1.2479.1.26, 2011-03-20 11:16:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P141
+ TAG: NTP_4_2_7P141
+
+ ChangeLog@1.821 +1 -0
+ NTP_4_2_7P141
+
+ clockstuff/clktest-opts.c@1.67 +2 -2
+ NTP_4_2_7P141
+
+ clockstuff/clktest-opts.h@1.67 +3 -3
+ NTP_4_2_7P141
+
+ ntpd/ntpd-opts.c@1.146 +2 -2
+ NTP_4_2_7P141
+
+ ntpd/ntpd-opts.h@1.146 +3 -3
+ NTP_4_2_7P141
+
+ ntpd/ntpd-opts.texi@1.144 +2 -2
+ NTP_4_2_7P141
+
+ ntpd/ntpd.1@1.144 +2 -2
+ NTP_4_2_7P141
+
+ ntpdc/ntpdc-opts.c@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpdc/ntpdc-opts.h@1.143 +3 -3
+ NTP_4_2_7P141
+
+ ntpdc/ntpdc-opts.texi@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpdc/ntpdc.1@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpq/ntpq-opts.c@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpq/ntpq-opts.h@1.143 +3 -3
+ NTP_4_2_7P141
+
+ ntpq/ntpq-opts.texi@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpq/ntpq.1@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.143 +3 -3
+ NTP_4_2_7P141
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.143 +2 -2
+ NTP_4_2_7P141
+
+ ntpsnmpd/ntpsnmpd.1@1.143 +2 -2
+ NTP_4_2_7P141
+
+ packageinfo.sh@1.143 +1 -1
+ NTP_4_2_7P141
+
+ sntp/sntp-opts.c@1.137 +2 -2
+ NTP_4_2_7P141
+
+ sntp/sntp-opts.h@1.137 +3 -3
+ NTP_4_2_7P141
+
+ sntp/sntp-opts.texi@1.137 +2 -2
+ NTP_4_2_7P141
+
+ sntp/sntp.1@1.137 +2 -2
+ NTP_4_2_7P141
+
+ sntp/sntp.html@1.137 +1 -1
+ NTP_4_2_7P141
+
+ util/ntp-keygen-opts.c@1.141 +2 -2
+ NTP_4_2_7P141
+
+ util/ntp-keygen-opts.h@1.141 +3 -3
+ NTP_4_2_7P141
+
+ util/ntp-keygen-opts.texi@1.144 +2 -2
+ NTP_4_2_7P141
+
+ util/ntp-keygen.1@1.144 +2 -2
+ NTP_4_2_7P141
+
+ChangeSet@1.2479.1.25, 2011-03-19 20:14:05+00:00, davehart@shiny.ad.hartbrothers.com
+ Add overlooked ChangeLog entry for refclock_pps() (was in commit comment
+ but not ChangeLog text).
+
+ ChangeLog@1.820 +1 -0
+ Add overlooked ChangeLog entry for refclock_pps() (was in commit comment
+ but not ChangeLog text).
+
+ChangeSet@1.2479.1.24, 2011-03-19 16:38:10+00:00, davehart@shiny.ad.hartbrothers.com
+ Add "ntpq -c iostats" similar to "ntpdc -c iostats".
+ Compare entire timestamp to reject duplicates in refclock_pps().
+
+ ChangeLog@1.819 +1 -0
+ Add "ntpq -c iostats" similar to "ntpdc -c iostats".
+ Compare entire timestamp to reject duplicates in refclock_pps().
+
+ ntpd/ntp_control.c@1.164 +74 -1
+ Add "ntpq -c iostats" similar to "ntpdc -c iostats".
+
+ ntpd/ntp_refclock.c@1.104 +1 -1
+ Compare entire timestamp to reject duplicates in refclock_pps().
+
+ ntpq/ntpq-subs.c@1.85 +34 -1
+ Add "ntpq -c iostats" similar to "ntpdc -c iostats".
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.58 +7 -3
+ Add "ntpq -c iostats" similar to "ntpdc -c iostats".
+
+ChangeSet@1.2479.1.23, 2011-03-17 11:20:23+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P140
+ TAG: NTP_4_2_7P140
+
+ ChangeLog@1.818 +1 -0
+ NTP_4_2_7P140
+
+ clockstuff/clktest-opts.c@1.66 +2 -2
+ NTP_4_2_7P140
+
+ clockstuff/clktest-opts.h@1.66 +3 -3
+ NTP_4_2_7P140
+
+ ntpd/ntpd-opts.c@1.145 +2 -2
+ NTP_4_2_7P140
+
+ ntpd/ntpd-opts.h@1.145 +3 -3
+ NTP_4_2_7P140
+
+ ntpd/ntpd-opts.texi@1.143 +2 -2
+ NTP_4_2_7P140
+
+ ntpd/ntpd.1@1.143 +2 -2
+ NTP_4_2_7P140
+
+ ntpdc/ntpdc-opts.c@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpdc/ntpdc-opts.h@1.142 +3 -3
+ NTP_4_2_7P140
+
+ ntpdc/ntpdc-opts.texi@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpdc/ntpdc.1@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpq/ntpq-opts.c@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpq/ntpq-opts.h@1.142 +3 -3
+ NTP_4_2_7P140
+
+ ntpq/ntpq-opts.texi@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpq/ntpq.1@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.142 +3 -3
+ NTP_4_2_7P140
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.142 +2 -2
+ NTP_4_2_7P140
+
+ ntpsnmpd/ntpsnmpd.1@1.142 +2 -2
+ NTP_4_2_7P140
+
+ packageinfo.sh@1.142 +1 -1
+ NTP_4_2_7P140
+
+ sntp/sntp-opts.c@1.136 +2 -2
+ NTP_4_2_7P140
+
+ sntp/sntp-opts.h@1.136 +3 -3
+ NTP_4_2_7P140
+
+ sntp/sntp-opts.texi@1.136 +2 -2
+ NTP_4_2_7P140
+
+ sntp/sntp.1@1.136 +2 -2
+ NTP_4_2_7P140
+
+ sntp/sntp.html@1.136 +1 -1
+ NTP_4_2_7P140
+
+ util/ntp-keygen-opts.c@1.140 +2 -2
+ NTP_4_2_7P140
+
+ util/ntp-keygen-opts.h@1.140 +3 -3
+ NTP_4_2_7P140
+
+ util/ntp-keygen-opts.texi@1.143 +2 -2
+ NTP_4_2_7P140
+
+ util/ntp-keygen.1@1.143 +2 -2
+ NTP_4_2_7P140
+
+ChangeSet@1.2479.1.22, 2011-03-17 01:25:14+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1848] ntpd 4.2.7p139 --disable-thread-support does not compile.
+ Add --disable-thread-support to one flock-build variation.
+ One more lock-while-init in lib/isc/task.c to quiet lock analysis.
+
+ ChangeLog@1.817 +3 -0
+ [Bug 1848] ntpd 4.2.7p139 --disable-thread-support does not compile.
+ Add --disable-thread-support to one flock-build variation.
+ One more lock-while-init in lib/isc/task.c to quiet lock analysis.
+
+ flock-build@1.50 +2 -2
+ Add --disable-thread-support to one flock-build variation.
+
+ lib/isc/task.c@1.3 +2 -0
+ One more lock-while-init in lib/isc/task.c to quiet lock analysis.
+
+ libntp/msyslog.c@1.38 +4 -3
+ corner case leak fix with change_logfile("stderr")
+
+ libntp/work_fork.c@1.10 +2 -2
+ [Bug 1848] ntpd 4.2.7p139 --disable-thread-support does not compile.
+
+ChangeSet@1.2479.1.21, 2011-03-16 11:35:50+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P139
+ TAG: NTP_4_2_7P139
+
+ ChangeLog@1.816 +1 -0
+ NTP_4_2_7P139
+
+ clockstuff/clktest-opts.c@1.65 +2 -2
+ NTP_4_2_7P139
+
+ clockstuff/clktest-opts.h@1.65 +3 -3
+ NTP_4_2_7P139
+
+ ntpd/ntpd-opts.c@1.144 +2 -2
+ NTP_4_2_7P139
+
+ ntpd/ntpd-opts.h@1.144 +3 -3
+ NTP_4_2_7P139
+
+ ntpd/ntpd-opts.texi@1.142 +2 -2
+ NTP_4_2_7P139
+
+ ntpd/ntpd.1@1.142 +2 -2
+ NTP_4_2_7P139
+
+ ntpdc/ntpdc-opts.c@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpdc/ntpdc-opts.h@1.141 +3 -3
+ NTP_4_2_7P139
+
+ ntpdc/ntpdc-opts.texi@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpdc/ntpdc.1@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpq/ntpq-opts.c@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpq/ntpq-opts.h@1.141 +3 -3
+ NTP_4_2_7P139
+
+ ntpq/ntpq-opts.texi@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpq/ntpq.1@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.141 +3 -3
+ NTP_4_2_7P139
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.141 +2 -2
+ NTP_4_2_7P139
+
+ ntpsnmpd/ntpsnmpd.1@1.141 +2 -2
+ NTP_4_2_7P139
+
+ packageinfo.sh@1.141 +1 -1
+ NTP_4_2_7P139
+
+ sntp/sntp-opts.c@1.135 +2 -2
+ NTP_4_2_7P139
+
+ sntp/sntp-opts.h@1.135 +3 -3
+ NTP_4_2_7P139
+
+ sntp/sntp-opts.texi@1.135 +2 -2
+ NTP_4_2_7P139
+
+ sntp/sntp.1@1.135 +2 -2
+ NTP_4_2_7P139
+
+ sntp/sntp.html@1.135 +1 -1
+ NTP_4_2_7P139
+
+ util/ntp-keygen-opts.c@1.139 +2 -2
+ NTP_4_2_7P139
+
+ util/ntp-keygen-opts.h@1.139 +3 -3
+ NTP_4_2_7P139
+
+ util/ntp-keygen-opts.texi@1.142 +2 -2
+ NTP_4_2_7P139
+
+ util/ntp-keygen.1@1.142 +2 -2
+ NTP_4_2_7P139
+
+ChangeSet@1.2479.1.20, 2011-03-16 04:58:25-04:00, stenn@deacon.udel.edu
+ typo
+
+ ChangeLog@1.815 +1 -1
+ typo
+
+ChangeSet@1.2479.1.19, 2011-03-16 02:09:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1848] make check ntpd --saveconfigquit clutters syslog.
+
+ ChangeLog@1.814 +2 -1
+ [Bug 1848] make check ntpd --saveconfigquit clutters syslog.
+
+ include/ntp_stdlib.h@1.61 +3 -4
+ Move version string logging out of common logging routines where
+ it was increasingly unwieldy.
+
+ libntp/msyslog.c@1.37 +5 -12
+ Move version string logging out of common logging routines where
+ it was increasingly unwieldy.
+
+ ntpd/ntp_config.c@1.285 +1 -1
+ Move version string logging out of common logging routines where
+ it was increasingly unwieldy.
+
+ ntpd/ntpd.c@1.125 +41 -40
+ [Bug 1848] make check ntpd --saveconfigquit clutters syslog.
+
+ sntp/log.c@1.21 +3 -2
+ [Bug 1848] make check ntpd --saveconfigquit clutters syslog.
+
+ChangeSet@1.2479.1.18, 2011-03-08 11:17:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P138
+ TAG: NTP_4_2_7P138
+
+ ChangeLog@1.813 +1 -0
+ NTP_4_2_7P138
+
+ clockstuff/clktest-opts.c@1.64 +2 -2
+ NTP_4_2_7P138
+
+ clockstuff/clktest-opts.h@1.64 +3 -3
+ NTP_4_2_7P138
+
+ ntpd/ntpd-opts.c@1.143 +2 -2
+ NTP_4_2_7P138
+
+ ntpd/ntpd-opts.h@1.143 +3 -3
+ NTP_4_2_7P138
+
+ ntpd/ntpd-opts.texi@1.141 +2 -2
+ NTP_4_2_7P138
+
+ ntpd/ntpd.1@1.141 +2 -2
+ NTP_4_2_7P138
+
+ ntpdc/ntpdc-opts.c@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpdc/ntpdc-opts.h@1.140 +3 -3
+ NTP_4_2_7P138
+
+ ntpdc/ntpdc-opts.texi@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpdc/ntpdc.1@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpq/ntpq-opts.c@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpq/ntpq-opts.h@1.140 +3 -3
+ NTP_4_2_7P138
+
+ ntpq/ntpq-opts.texi@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpq/ntpq.1@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.140 +3 -3
+ NTP_4_2_7P138
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.140 +2 -2
+ NTP_4_2_7P138
+
+ ntpsnmpd/ntpsnmpd.1@1.140 +2 -2
+ NTP_4_2_7P138
+
+ packageinfo.sh@1.140 +1 -1
+ NTP_4_2_7P138
+
+ sntp/sntp-opts.c@1.134 +2 -2
+ NTP_4_2_7P138
+
+ sntp/sntp-opts.h@1.134 +3 -3
+ NTP_4_2_7P138
+
+ sntp/sntp-opts.texi@1.134 +2 -2
+ NTP_4_2_7P138
+
+ sntp/sntp.1@1.134 +2 -2
+ NTP_4_2_7P138
+
+ sntp/sntp.html@1.134 +1 -1
+ NTP_4_2_7P138
+
+ util/ntp-keygen-opts.c@1.138 +2 -2
+ NTP_4_2_7P138
+
+ util/ntp-keygen-opts.h@1.138 +3 -3
+ NTP_4_2_7P138
+
+ util/ntp-keygen-opts.texi@1.141 +2 -2
+ NTP_4_2_7P138
+
+ util/ntp-keygen.1@1.141 +2 -2
+ NTP_4_2_7P138
+
+ChangeSet@1.2479.1.17, 2011-03-08 01:10:53-05:00, stenn@deacon.udel.edu
+ [Bug 1846] MacOSX: debug symbol not found by propdelay or tickadj
+
+ ChangeLog@1.812 +1 -0
+ [Bug 1846] MacOSX: debug symbol not found by propdelay or tickadj
+
+ChangeSet@1.2479.1.16, 2011-03-07 12:12:49-08:00, harlan@hms-mbp.local
+ Call init_lib() in propdelay and tickadj just to get the debug symbol from libntp
+
+ clockstuff/propdelay.c@1.7 +2 -0
+ Call init_lib() just to get the debug symbol from libntp
+
+ util/tickadj.c@1.11 +2 -0
+ Call init_lib() just to get the debug symbol from libntp
+
+ChangeSet@1.2479.3.1, 2011-03-07 10:19:45+00:00, davehart@shiny.ad.hartbrothers.com
+ Lock under-construction task, taskmgr objects to satisfy Coverity's
+ mostly-correct assumptions about which variables are protected by
+ which locks.
+
+ ChangeLog@1.809.1.1 +3 -0
+ Lock under-construction task, taskmgr objects to satisfy Coverity's
+ mostly-correct assumptions about which variables are protected by
+ which locks.
+
+ lib/isc/task.c@1.2 +8 -4
+ Lock under-construction task, taskmgr objects to satisfy Coverity's
+ mostly-correct assumptions about which variables are protected by
+ which locks.
+
+ChangeSet@1.2479.1.14, 2011-03-07 10:06:50+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P137
+ TAG: NTP_4_2_7P137
+
+ ChangeLog@1.810 +1 -0
+ NTP_4_2_7P137
+
+ clockstuff/clktest-opts.c@1.63 +2 -2
+ NTP_4_2_7P137
+
+ clockstuff/clktest-opts.h@1.63 +3 -3
+ NTP_4_2_7P137
+
+ ntpd/ntpd-opts.c@1.142 +2 -2
+ NTP_4_2_7P137
+
+ ntpd/ntpd-opts.h@1.142 +3 -3
+ NTP_4_2_7P137
+
+ ntpd/ntpd-opts.texi@1.140 +2 -2
+ NTP_4_2_7P137
+
+ ntpd/ntpd.1@1.140 +2 -2
+ NTP_4_2_7P137
+
+ ntpdc/ntpdc-opts.c@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpdc/ntpdc-opts.h@1.139 +3 -3
+ NTP_4_2_7P137
+
+ ntpdc/ntpdc-opts.texi@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpdc/ntpdc.1@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpq/ntpq-opts.c@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpq/ntpq-opts.h@1.139 +3 -3
+ NTP_4_2_7P137
+
+ ntpq/ntpq-opts.texi@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpq/ntpq.1@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.139 +3 -3
+ NTP_4_2_7P137
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.139 +2 -2
+ NTP_4_2_7P137
+
+ ntpsnmpd/ntpsnmpd.1@1.139 +2 -2
+ NTP_4_2_7P137
+
+ packageinfo.sh@1.139 +1 -1
+ NTP_4_2_7P137
+
+ sntp/sntp-opts.c@1.133 +2 -2
+ NTP_4_2_7P137
+
+ sntp/sntp-opts.h@1.133 +3 -3
+ NTP_4_2_7P137
+
+ sntp/sntp-opts.texi@1.133 +2 -2
+ NTP_4_2_7P137
+
+ sntp/sntp.1@1.133 +2 -2
+ NTP_4_2_7P137
+
+ sntp/sntp.html@1.133 +1 -1
+ NTP_4_2_7P137
+
+ util/ntp-keygen-opts.c@1.137 +2 -2
+ NTP_4_2_7P137
+
+ util/ntp-keygen-opts.h@1.137 +3 -3
+ NTP_4_2_7P137
+
+ util/ntp-keygen-opts.texi@1.140 +2 -2
+ NTP_4_2_7P137
+
+ util/ntp-keygen.1@1.140 +2 -2
+ NTP_4_2_7P137
+
+ChangeSet@1.2479.1.13, 2011-03-06 01:24:22+00:00, davehart@shiny.ad.hartbrothers.com
+ Add overlooked ChangeLog entry for last cset.
+
+ ChangeLog@1.809 +2 -0
+ Add overlooked ChangeLog entry for last cset.
+
+ include/declcond.h@1.2 +4 -0
+ Use multiple-inclusion guard.
+
+ ntpd/declcond.h@1.2 +4 -0
+ Use multiple-inclusion guard.
+
+ChangeSet@1.2479.1.12, 2011-03-05 22:35:37+00:00, davehart@shiny.ad.hartbrothers.com
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ BitKeeper/deleted/16/sntptest.cpp~b166a62f6f744adb@1.4 +0 -0
+ Rename: sntp/tests/sntptest.cpp -> BitKeeper/deleted/16/sntptest.cpp~b166a62f6f744adb
+
+ BitKeeper/deleted/a3/dnslookup.c~96398d4d3428670@1.10 +0 -0
+ Rename: ports/winnt/libntp/dnslookup.c -> BitKeeper/deleted/a3/dnslookup.c~96398d4d3428670
+
+ BitKeeper/deleted/c4/mexit.c~13b0216e@1.5 +0 -0
+ Rename: ports/winnt/libntp/mexit.c -> BitKeeper/deleted/c4/mexit.c~13b0216e
+
+ ChangeLog@1.808 +2 -0
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ clockstuff/chutest.c@1.6 +0 -1
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ clockstuff/propdelay.c@1.6 +0 -1
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ include/Makefile.am@1.48 +1 -0
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ include/declcond.h@1.1 +17 -0
+ BitKeeper file C:/ntp/ntp-dev-trace/include/declcond.h
+
+ include/declcond.h@1.0 +0 -0
+
+ include/ntp_debug.h@1.5 +12 -16
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ include/ntp_stdlib.h@1.60 +3 -6
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ include/ntpd.h@1.160 +23 -1
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ libntp/lib_strbuf.c@1.9 +6 -5
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ libntp/machines.c@1.24 +6 -6
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ libntp/msyslog.c@1.36 +1 -1
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ libntp/ntp_intres.c@1.94 +46 -50
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ libntp/socket.c@1.7 +26 -26
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ libntp/socktohost.c@1.14 +3 -2
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ libntp/work_fork.c@1.9 +16 -16
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ libntp/work_thread.c@1.6 +2 -2
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ ntpd/Makefile.am@1.103 +1 -0
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ ntpd/check_y2k.c@1.8 +0 -1
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ ntpd/declcond.h@1.1 +17 -0
+ BitKeeper file C:/ntp/ntp-dev-trace/ntpd/declcond.h
+
+ ntpd/declcond.h@1.0 +0 -0
+
+ ntpd/keyword-gen.c@1.18 +2 -1
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ ntpd/ntp_scanner.c@1.41 +1 -1
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ ntpd/ntpd.c@1.124 +0 -7
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ ntpd/refclock_bancomm.c@1.15 +0 -5
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ ntpdate/ntpdate.c@1.86 +2 -7
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ ntpdate/ntptimeset.c@1.14 +0 -5
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ ntpdc/ntpdc.c@1.95 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ ntpq/ntpq.c@1.133 +29 -48
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ ports/winnt/include/gaa_compat.h@1.2 +1 -1
+ mismatched #pragma warning(pop) #ifdef _W64
+
+ ports/winnt/libntp/setpriority.c@1.5 +2 -3
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ ports/winnt/libntp/termios.c@1.27 +9 -13
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ ports/winnt/ntpd/ntservice.c@1.28 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.40 +6 -2
+ add include/declcond.h reference
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.39 +4 -0
+ add ntpd/declcond.h reference
+
+ sntp/kod_management.c@1.27 +7 -7
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ sntp/main.c@1.70 +51 -51
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ sntp/networking.c@1.59 +7 -7
+ Use TRACE() instead of DPRINTF() for libntp and utilities, which
+ use the "debug" variable regardless of #ifdef DEBUG.
+
+ sntp/sntp.c@1.3 +2 -4
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ sntp/tests/Makefile.am@1.25 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ tests/libntp/libntptest.cpp@1.3 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ util/jitter.c@1.10 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ util/ntp-keygen.c@1.79 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ util/ntptime.c@1.22 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ util/tickadj.c@1.10 +0 -1
+ Declare debug in libntp instead of each program. Expose extern declaration
+ to utilities, libntp, and DEBUG ntpd.
+
+ChangeSet@1.2479.1.11, 2011-03-02 07:25:19+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P136
+ TAG: NTP_4_2_7P136
+
+ ChangeLog@1.807 +1 -0
+ NTP_4_2_7P136
+
+ clockstuff/clktest-opts.c@1.62 +2 -2
+ NTP_4_2_7P136
+
+ clockstuff/clktest-opts.h@1.62 +3 -3
+ NTP_4_2_7P136
+
+ ntpd/ntpd-opts.c@1.141 +2 -2
+ NTP_4_2_7P136
+
+ ntpd/ntpd-opts.h@1.141 +3 -3
+ NTP_4_2_7P136
+
+ ntpd/ntpd-opts.texi@1.139 +2 -2
+ NTP_4_2_7P136
+
+ ntpd/ntpd.1@1.139 +2 -2
+ NTP_4_2_7P136
+
+ ntpdc/ntpdc-opts.c@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpdc/ntpdc-opts.h@1.138 +3 -3
+ NTP_4_2_7P136
+
+ ntpdc/ntpdc-opts.texi@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpdc/ntpdc.1@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpq/ntpq-opts.c@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpq/ntpq-opts.h@1.138 +3 -3
+ NTP_4_2_7P136
+
+ ntpq/ntpq-opts.texi@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpq/ntpq.1@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.138 +3 -3
+ NTP_4_2_7P136
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.138 +2 -2
+ NTP_4_2_7P136
+
+ ntpsnmpd/ntpsnmpd.1@1.138 +2 -2
+ NTP_4_2_7P136
+
+ packageinfo.sh@1.138 +1 -1
+ NTP_4_2_7P136
+
+ sntp/sntp-opts.c@1.132 +2 -2
+ NTP_4_2_7P136
+
+ sntp/sntp-opts.h@1.132 +3 -3
+ NTP_4_2_7P136
+
+ sntp/sntp-opts.texi@1.132 +2 -2
+ NTP_4_2_7P136
+
+ sntp/sntp.1@1.132 +2 -2
+ NTP_4_2_7P136
+
+ sntp/sntp.html@1.132 +1 -1
+ NTP_4_2_7P136
+
+ util/ntp-keygen-opts.c@1.136 +2 -2
+ NTP_4_2_7P136
+
+ util/ntp-keygen-opts.h@1.136 +3 -3
+ NTP_4_2_7P136
+
+ util/ntp-keygen-opts.texi@1.139 +2 -2
+ NTP_4_2_7P136
+
+ util/ntp-keygen.1@1.139 +2 -2
+ NTP_4_2_7P136
+
+ChangeSet@1.2479.1.10, 2011-03-02 06:13:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1839] 4.2.7p135 still installs libevent ev*.h headers.
+
+ ChangeLog@1.806 +1 -0
+ [Bug 1839] 4.2.7p135 still installs libevent ev*.h headers.
+
+ sntp/libevent/Makefile.am@1.3 +8 -2
+ [Bug 1839] 4.2.7p135 still installs libevent ev*.h headers.
+
+ChangeSet@1.2479.1.9, 2011-03-02 00:29:27+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P135
+ TAG: NTP_4_2_7P135
+
+ ChangeLog@1.805 +1 -0
+ NTP_4_2_7P135
+
+ clockstuff/clktest-opts.c@1.61 +2 -2
+ NTP_4_2_7P135
+
+ clockstuff/clktest-opts.h@1.61 +3 -3
+ NTP_4_2_7P135
+
+ ntpd/ntpd-opts.c@1.140 +2 -2
+ NTP_4_2_7P135
+
+ ntpd/ntpd-opts.h@1.140 +3 -3
+ NTP_4_2_7P135
+
+ ntpd/ntpd-opts.texi@1.138 +2 -2
+ NTP_4_2_7P135
+
+ ntpd/ntpd.1@1.138 +2 -2
+ NTP_4_2_7P135
+
+ ntpdc/ntpdc-opts.c@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpdc/ntpdc-opts.h@1.137 +3 -3
+ NTP_4_2_7P135
+
+ ntpdc/ntpdc-opts.texi@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpdc/ntpdc.1@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpq/ntpq-opts.c@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpq/ntpq-opts.h@1.137 +3 -3
+ NTP_4_2_7P135
+
+ ntpq/ntpq-opts.texi@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpq/ntpq.1@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.137 +3 -3
+ NTP_4_2_7P135
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.137 +2 -2
+ NTP_4_2_7P135
+
+ ntpsnmpd/ntpsnmpd.1@1.137 +2 -2
+ NTP_4_2_7P135
+
+ packageinfo.sh@1.137 +1 -1
+ NTP_4_2_7P135
+
+ sntp/sntp-opts.c@1.131 +2 -2
+ NTP_4_2_7P135
+
+ sntp/sntp-opts.h@1.131 +3 -3
+ NTP_4_2_7P135
+
+ sntp/sntp-opts.texi@1.131 +2 -2
+ NTP_4_2_7P135
+
+ sntp/sntp.1@1.131 +2 -2
+ NTP_4_2_7P135
+
+ sntp/sntp.html@1.131 +1 -1
+ NTP_4_2_7P135
+
+ util/ntp-keygen-opts.c@1.135 +2 -2
+ NTP_4_2_7P135
+
+ util/ntp-keygen-opts.h@1.135 +3 -3
+ NTP_4_2_7P135
+
+ util/ntp-keygen-opts.texi@1.138 +2 -2
+ NTP_4_2_7P135
+
+ util/ntp-keygen.1@1.138 +2 -2
+ NTP_4_2_7P135
+
+ChangeSet@1.2479.1.8, 2011-03-01 04:48:43+00:00, davehart@shiny.ad.hartbrothers.com
+ libevent: When building on systems with CLOCK_MONOTONIC available,
+ separate the internal timeline (possibly counting since system boot)
+ from the gettimeofday() timeline in event_base cached timevals. Adds
+ new event_base_tv_cached() to retrieve cached callback round start
+ time on the internal timeline, and changes
+ event_based_gettimeofday_cached() to always return times using the
+ namesake timeline. This preserves the benefit of using the never-
+ stepped monotonic clock for event timeouts while providing clients
+ with times consistently using gettimeofday().
+ Correct event_base_gettimeofday_cached() workaround code in
+ sntp to work with corrected libevent.
+ Remove sntp l_fp_output() test now that it uses prettydate().
+
+ BitKeeper/deleted/9f/debug-input-lfp-hex~523a3dc59a6a4e86@1.3 +0 -0
+ Rename: sntp/tests/data/debug-input-lfp-hex -> BitKeeper/deleted/9f/debug-input-lfp-hex~523a3dc59a6a4e86
+
+ ChangeLog@1.804 +12 -0
+ libevent: When building on systems with CLOCK_MONOTONIC available,
+ separate the internal timeline (possibly counting since system boot)
+ from the gettimeofday() timeline in event_base cached timevals. Adds
+ new event_base_tv_cached() to retrieve cached callback round start
+ time on the internal timeline, and changes
+ event_based_gettimeofday_cached() to always return times using the
+ namesake timeline. This preserves the benefit of using the never-
+ stepped monotonic clock for event timeouts while providing clients
+ with times consistently using gettimeofday().
+ Correct event_base_gettimeofday_cached() workaround code in
+ sntp to work with corrected libevent.
+ Remove sntp l_fp_output() test now that it uses prettydate().
+
+ libntp/socket.c@1.6 +3 -6
+ Add \n termination overlooked in msyslog()->DPRINTF() changes
+
+ libntp/work_fork.c@1.8 +1 -1
+ Add \n termination overlooked in msyslog()->DPRINTF() changes
+
+ sntp/libevent/configure.in@1.3 +4 -0
+ Add AM_SILENT_RULES patch now in git libevent.
+
+ sntp/libevent/event-internal.h@1.2 +8 -1
+ Add struct timeval tod_tv_cache to struct event_base, analogous
+ to tv_cache but always using the gettimeofdday() timeline. Not
+ needed on systems without CLOCK_MONOTONIC.
+
+ sntp/libevent/event.c@1.2 +73 -5
+ When building on systems with CLOCK_MONOTONIC available, separate the
+ internal timeline (possibly counting since system boot) from the
+ gettimeofday() timeline in event_base cached timevals. Adds new
+ event_base_tv_cached() to retrieve cached callback round start time
+ on the internal timeline, and changes
+ event_based_gettimeofday_cached() to always return times using the
+ namesake timeline. This preserves the benefit of using the never-
+ stepped monotonic clock for event timeouts while providing clients
+ with times consistently using gettimeofday().
+
+ sntp/libevent/evthread.c@1.2 +11 -1
+ Add signature to struct debug_lock so that invalid lock pointers
+ can be caught sooner.
+
+ sntp/libevent/include/event2/event.h@1.2 +18 -3
+ Add event_base_tv_cached() to retrieve the start-of-callbacks
+ time on the internal timeline (possibly monotonic).
+
+ sntp/m4/ntp_libevent.m4@1.6 +2 -1
+ Respect a hypothetical -R/some/lib/path in libevent.pc.
+ Pass --enable-silent-rules to tearoff libevent configure.
+
+ sntp/m4/ntp_openssl.m4@1.17 +1 -1
+ Correct comment to match code.
+
+ sntp/main.c@1.69 +121 -49
+ Use pthread locks/mutexes/cond vars despite our so-far single-threaded
+ use of libevent.
+ Correct event_base_gettimeofday_cached() workaround code in
+ sntp to work with corrected libevent.
+
+ sntp/networking.c@1.58 +31 -25
+ Show server address in wrong org timestamp message.
+
+ sntp/tests/Makefile.am@1.24 +0 -2
+ Remove sntp l_fp_output() test now that it uses prettydate().
+
+ sntp/tests/packetProcessing.cpp@1.5 +4 -4
+ whitespace cleanup only
+
+ sntp/tests/utilities.cpp@1.7 +0 -16
+ Remove sntp l_fp_output() test now that it uses prettydate().
+
+ sntp/utilities.c@1.17 +5 -14
+ use prettydate() for l_fp_output()
+
+ChangeSet@1.2479.1.7, 2011-02-25 12:37:40+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1839] 4.2.7p131 installs libevent ev*.h headers.
+
+ ChangeLog@1.803 +1 -0
+ [Bug 1839] 4.2.7p131 installs libevent ev*.h headers.
+
+ sntp/libevent/include/Makefile.am@1.2 +9 -2
+ [Bug 1839] 4.2.7p131 installs libevent ev*.h headers.
+
+ChangeSet@1.2479.1.6, 2011-02-25 12:36:58+00:00, davehart@shiny.ad.hartbrothers.com
+ Ensure CONFIG_SHELL is not empty before relying on it for #! scripts.
+
+ ChangeLog@1.802 +1 -0
+ Ensure CONFIG_SHELL is not empty before relying on it for #! scripts.
+
+ configure.ac@1.519 +1 -0
+ Ensure CONFIG_SHELL is not empty before relying on it for #! scripts.
+
+ChangeSet@1.2479.1.5, 2011-02-24 10:50:23+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P134
+ TAG: NTP_4_2_7P134
+
+ ChangeLog@1.801 +1 -0
+ NTP_4_2_7P134
+
+ clockstuff/clktest-opts.c@1.60 +2 -2
+ NTP_4_2_7P134
+
+ clockstuff/clktest-opts.h@1.60 +3 -3
+ NTP_4_2_7P134
+
+ ntpd/ntpd-opts.c@1.139 +2 -2
+ NTP_4_2_7P134
+
+ ntpd/ntpd-opts.h@1.139 +3 -3
+ NTP_4_2_7P134
+
+ ntpd/ntpd-opts.texi@1.137 +2 -2
+ NTP_4_2_7P134
+
+ ntpd/ntpd.1@1.137 +2 -2
+ NTP_4_2_7P134
+
+ ntpdc/ntpdc-opts.c@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpdc/ntpdc-opts.h@1.136 +3 -3
+ NTP_4_2_7P134
+
+ ntpdc/ntpdc-opts.texi@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpdc/ntpdc.1@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpq/ntpq-opts.c@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpq/ntpq-opts.h@1.136 +3 -3
+ NTP_4_2_7P134
+
+ ntpq/ntpq-opts.texi@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpq/ntpq.1@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.136 +3 -3
+ NTP_4_2_7P134
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.136 +2 -2
+ NTP_4_2_7P134
+
+ ntpsnmpd/ntpsnmpd.1@1.136 +2 -2
+ NTP_4_2_7P134
+
+ packageinfo.sh@1.136 +1 -1
+ NTP_4_2_7P134
+
+ sntp/sntp-opts.c@1.130 +2 -2
+ NTP_4_2_7P134
+
+ sntp/sntp-opts.h@1.130 +3 -3
+ NTP_4_2_7P134
+
+ sntp/sntp-opts.texi@1.130 +2 -2
+ NTP_4_2_7P134
+
+ sntp/sntp.1@1.130 +2 -2
+ NTP_4_2_7P134
+
+ sntp/sntp.html@1.130 +1 -1
+ NTP_4_2_7P134
+
+ util/ntp-keygen-opts.c@1.134 +2 -2
+ NTP_4_2_7P134
+
+ util/ntp-keygen-opts.h@1.134 +3 -3
+ NTP_4_2_7P134
+
+ util/ntp-keygen-opts.texi@1.137 +2 -2
+ NTP_4_2_7P134
+
+ util/ntp-keygen.1@1.137 +2 -2
+ NTP_4_2_7P134
+
+ChangeSet@1.2479.2.4, 2011-02-24 04:21:34+00:00, davehart@shiny.ad.hartbrothers.com
+ Another ac_cv_path* variable needs clearing to prevent caching the
+ full path to pkg-config.
+
+ sntp/m4/ntp_pkg_config.m4@1.2 +1 -0
+ Another ac_cv_path* variable needs clearing to prevent caching the
+ full path to pkg-config.
+
+ChangeSet@1.2479.1.3, 2011-02-23 16:58:30-05:00, stenn@deacon.udel.edu
+ merge cleanup
+
+ ChangeLog@1.800 +7 -7
+ merge cleanup
+
+ChangeSet@1.2479.2.3, 2011-02-23 20:34:51+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix make distcheck failure seen on psp-deb1 by distributing
+ sntp/tests/data files individually by name rather than
+ listing "data".
+
+ sntp/tests/Makefile.am@1.23 +16 -1
+ Fix make distcheck failure seen on psp-deb1 by distributing
+ sntp/tests/data files individually by name rather than
+ listing "data".
+
+ChangeSet@1.2479.2.1, 2011-02-23 18:57:00+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1837] Build fails on Win7 due to regedit requiring privilege.
+ Provide fallback definitions for GetAdaptersAddresses() for Windows
+ build environments lacking iphlpapi.h.
+ Rename file containing 1.xxxx ChangeSet revision from version to
+ scm-rev to avoid invoking GNU make implicit rules attempting to
+ compile version.c into version. Problem was with sntp/version.o
+ during make distcheck after fix for spurious sntp rebuilds.
+
+ ChangeLog@1.797.1.1 +7 -0
+ [Bug 1837] Build fails on Win7 due to regedit requiring privilege.
+ Provide fallback definitions for GetAdaptersAddresses() for Windows
+ build environments lacking iphlpapi.h.
+ Rename file containing 1.xxxx ChangeSet revision from version to
+ scm-rev to avoid invoking GNU make implicit rules attempting to
+ compile version.c into version. Problem was with sntp/version.o
+ during make distcheck after fix for spurious sntp rebuilds.
+
+ lib/isc/win32/interfaceiter.c@1.21 +4 -4
+ Provide fallback definitions for GetAdaptersAddresses() for Windows
+ build environments lacking iphlpapi.h.
+
+ ntpd/Makefile.am@1.102 +7 -5
+ Rename cset file from sntp/version to sntp/scm-rev.
+
+ ntpdate/Makefile.am@1.30 +7 -5
+ Rename cset file from sntp/version to sntp/scm-rev.
+
+ ntpdc/Makefile.am@1.60 +7 -5
+ Rename cset file from sntp/version to sntp/scm-rev.
+
+ ntpq/Makefile.am@1.56 +8 -6
+ Rename cset file from sntp/version to sntp/scm-rev.
+
+ ports/winnt/include/gaa_compat.h@1.1 +771 -0
+ BitKeeper file C:/ntp/ntp-dev-1837/ports/winnt/include/gaa_compat.h
+
+ ports/winnt/include/gaa_compat.h@1.0 +0 -0
+
+ ports/winnt/scripts/mkver.bat@1.14 +11 -7
+ [Bug 1837] Build fails on Win7 due to regedit requiring privilege.
+ Rename file containing 1.xxxx ChangeSet revision from version to
+ scm-rev to avoid invoking GNU make implicit rules attempting to
+ compile version.c into version. Problem was with sntp/version.o
+ during make distcheck after fix for spurious sntp rebuilds.
+
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.39 +6 -2
+ add gaa_compat.h reference
+
+ sntp/Makefile.am@1.57.1.1 +14 -9
+ Rename cset file from sntp/version to sntp/scm-rev.
+ Fixes psp-deb1 make distcheck failure on sntp/version.o, which was
+ using an implicit rule to build presumed-executable "version" from
+ ../../sntp/../../sntp/version.c.
+
+ sntp/libevent/test/Makefile.am@1.3 +1 -1
+ http://sourceforge.net/tracker/?func=detail&aid=3189896&group_id=50884&atid=461324
+
+ util/Makefile.am@1.59 +8 -6
+ Rename cset file from sntp/version to sntp/scm-rev.
+
+ChangeSet@1.2479.1.1, 2011-02-23 11:06:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P133
+ TAG: NTP_4_2_7P133
+
+ ChangeLog@1.798 +1 -0
+ NTP_4_2_7P133
+
+ clockstuff/clktest-opts.c@1.59 +2 -2
+ NTP_4_2_7P133
+
+ clockstuff/clktest-opts.h@1.59 +3 -3
+ NTP_4_2_7P133
+
+ ntpd/ntpd-opts.c@1.138 +2 -2
+ NTP_4_2_7P133
+
+ ntpd/ntpd-opts.h@1.138 +3 -3
+ NTP_4_2_7P133
+
+ ntpd/ntpd-opts.texi@1.136 +2 -2
+ NTP_4_2_7P133
+
+ ntpd/ntpd.1@1.136 +2 -2
+ NTP_4_2_7P133
+
+ ntpdc/ntpdc-opts.c@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpdc/ntpdc-opts.h@1.135 +3 -3
+ NTP_4_2_7P133
+
+ ntpdc/ntpdc-opts.texi@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpdc/ntpdc.1@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpq/ntpq-opts.c@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpq/ntpq-opts.h@1.135 +3 -3
+ NTP_4_2_7P133
+
+ ntpq/ntpq-opts.texi@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpq/ntpq.1@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.135 +3 -3
+ NTP_4_2_7P133
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.135 +2 -2
+ NTP_4_2_7P133
+
+ ntpsnmpd/ntpsnmpd.1@1.135 +2 -2
+ NTP_4_2_7P133
+
+ packageinfo.sh@1.135 +1 -1
+ NTP_4_2_7P133
+
+ sntp/sntp-opts.c@1.129 +2 -2
+ NTP_4_2_7P133
+
+ sntp/sntp-opts.h@1.129 +3 -3
+ NTP_4_2_7P133
+
+ sntp/sntp-opts.texi@1.129 +2 -2
+ NTP_4_2_7P133
+
+ sntp/sntp.1@1.129 +2 -2
+ NTP_4_2_7P133
+
+ sntp/sntp.html@1.129 +1 -1
+ NTP_4_2_7P133
+
+ util/ntp-keygen-opts.c@1.133 +2 -2
+ NTP_4_2_7P133
+
+ util/ntp-keygen-opts.h@1.133 +3 -3
+ NTP_4_2_7P133
+
+ util/ntp-keygen-opts.texi@1.136 +2 -2
+ NTP_4_2_7P133
+
+ util/ntp-keygen.1@1.136 +2 -2
+ NTP_4_2_7P133
+
+ChangeSet@1.2478.1.1, 2011-02-22 19:38:18-05:00, stenn@psp-deb1.ntp.org
+ Start using the new autogen doc template
+
+ sntp/Makefile.am@1.56.1.1 +1 -1
+ Start using the new autogen doc template
+
+ChangeSet@1.2479, 2011-02-22 23:21:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1834] ntpdate 4.2.7p131 aborts with assertion failure.
+ Move sntp last in top-level Makefile.am SUBDIRS so that the libevent
+ tearoff (if required) and sntp are compiled after the rest.
+ Use a single set of Automake options for each package in configure.ac
+ AM_INIT, remove Makefile.am AUTOMAKE_OPTIONS= lines.
+ Correct spurious sntp rebuilds triggered by a make misperception
+ sntp/version was out-of-date relative to phony target FRC.version.
+ Do not cache paths to perl, test, or pkg-config, searching the PATH
+ at configure time is worth it to pick up tool updates.
+
+ ChangeLog@1.797 +9 -0
+ [Bug 1834] ntpdate 4.2.7p131 aborts with assertion failure.
+ Move sntp last in top-level Makefile.am SUBDIRS so that the libevent
+ tearoff (if required) and sntp are compiled after the rest.
+ Use a single set of Automake options for each package in configure.ac
+ AM_INIT, remove Makefile.am AUTOMAKE_OPTIONS= lines.
+ Correct spurious sntp rebuilds triggered by a make misperception
+ sntp/version was out-of-date relative to phony target FRC.version.
+ Do not cache paths to perl, test, or pkg-config, searching the PATH
+ at configure time is worth it to pick up tool updates.
+
+ Makefile.am@1.108 +1 -5
+ Distribute includes.mf.
+ Build sntp late in the game to exhibit problems elsewhere first.
+
+ adjtimed/Makefile.am@1.12 +6 -11
+ use check-libntp.mf.
+
+ check-libopts.mf@1.1 +14 -0
+ BitKeeper file C:/ntp/ntp-dev-1834/check-libopts.mf
+
+ check-libopts.mf@1.0 +0 -0
+
+ clockstuff/Makefile.am@1.19 +3 -12
+ use check-libntp.mf and check-libopts.mf.
+
+ configure.ac@1.518 +12 -2
+ Do not cache paths to perl, test, or pkg-config, searching the PATH
+ at configure time is worth it to pick up tool updates.
+
+ include/Makefile.am@1.47 +0 -2
+ Use a single set of Automake options per package in AM_INIT
+
+ include/isc/Makefile.am@1.2 +0 -2
+ Use a single set of Automake options per package in AM_INIT
+
+ libparse/Makefile.am@1.26 +7 -10
+ add check-libparse target for ntpd/Makefile.am use
+
+ ntpd/Makefile.am@1.101 +12 -20
+ Use a single set of Automake options per package in AM_INIT
+
+ ntpdate/Makefile.am@1.29 +8 -15
+ use check-libntp.mf.
+
+ ntpdate/ntpdate.c@1.85 +1 -1
+ [Bug 1834] ntpdate 4.2.7p131 aborts with assertion failure.
+
+ ntpdc/Makefile.am@1.59 +3 -9
+ make sure libopts.la is up-to-date.
+
+ ntpq/Makefile.am@1.55 +3 -9
+ make sure libopts.la is up-to-date.
+
+ ntpsnmpd/Makefile.am@1.27 +3 -9
+ use check-libntp.mf and check-libopts.mf.
+
+ scripts/mkver.in@1.13 +1 -1
+ Use CONFIG_SHELL for #! line instead of AC_PATH_PROG(sh).
+
+ scripts/ntpver.in@1.3 +2 -2
+ Use CONFIG_SHELL for #! line instead of AC_PATH_PROG(sh).
+ Use @AWK@ from AC_PROG_AWK instead of 'awk'.
+
+ sntp/Makefile.am@1.57 +14 -20
+ Distribute includes.mf.
+
+ sntp/check-libntp.mf@1.1 +15 -0
+ BitKeeper file C:/ntp/ntp-dev-1834/sntp/check-libntp.mf
+
+ sntp/check-libntp.mf@1.0 +0 -0
+
+ sntp/check-libopts.mf@1.1 +14 -0
+ BitKeeper file C:/ntp/ntp-dev-1834/sntp/check-libopts.mf
+
+ sntp/check-libopts.mf@1.0 +0 -0
+
+ sntp/m4/ntp_googletest.m4@1.3 +1 -0
+ Do not cache paths to perl, test, or pkg-config, searching the PATH
+ at configure time is worth it to pick up tool updates.
+
+ sntp/m4/ntp_libevent.m4@1.5 +1 -15
+ Use NTP_PKG_CONFIG.
+
+ sntp/m4/ntp_openssl.m4@1.16 +10 -23
+ Use NTP_PKG_CONFIG.
+ Attempt to fix broken need_dash_r logic.
+
+ sntp/m4/ntp_pkg_config.m4@1.1 +26 -0
+ BitKeeper file C:/ntp/ntp-dev-1834/sntp/m4/ntp_pkg_config.m4
+
+ sntp/m4/ntp_pkg_config.m4@1.0 +0 -0
+
+ sntp/tests/Makefile.am@1.22 +12 -0
+ use adapted check-libntp.mf snippet
+
+ tests/libntp/Makefile.am@1.36 +12 -0
+ use adapted check-libntp.mf snippet
+
+ util/Makefile.am@1.58 +3 -8
+ use check-libntp.mf and check-libopts.mf.
+
+ChangeSet@1.2478, 2011-02-22 08:28:31+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P132
+ TAG: NTP_4_2_7P132
+
+ ChangeLog@1.796 +1 -0
+ NTP_4_2_7P132
+
+ clockstuff/clktest-opts.c@1.58 +2 -2
+ NTP_4_2_7P132
+
+ clockstuff/clktest-opts.h@1.58 +3 -3
+ NTP_4_2_7P132
+
+ ntpd/ntpd-opts.c@1.137 +2 -2
+ NTP_4_2_7P132
+
+ ntpd/ntpd-opts.h@1.137 +3 -3
+ NTP_4_2_7P132
+
+ ntpd/ntpd-opts.texi@1.135 +4 -4
+ NTP_4_2_7P132
+
+ ntpd/ntpd.1@1.135 +2 -2
+ NTP_4_2_7P132
+
+ ntpdc/ntpdc-opts.c@1.134 +2 -2
+ NTP_4_2_7P132
+
+ ntpdc/ntpdc-opts.h@1.134 +3 -3
+ NTP_4_2_7P132
+
+ ntpdc/ntpdc-opts.texi@1.134 +4 -4
+ NTP_4_2_7P132
+
+ ntpdc/ntpdc.1@1.134 +2 -2
+ NTP_4_2_7P132
+
+ ntpq/ntpq-opts.c@1.134 +2 -2
+ NTP_4_2_7P132
+
+ ntpq/ntpq-opts.h@1.134 +3 -3
+ NTP_4_2_7P132
+
+ ntpq/ntpq-opts.texi@1.134 +4 -4
+ NTP_4_2_7P132
+
+ ntpq/ntpq.1@1.134 +2 -2
+ NTP_4_2_7P132
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.134 +2 -2
+ NTP_4_2_7P132
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.134 +3 -3
+ NTP_4_2_7P132
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.134 +4 -4
+ NTP_4_2_7P132
+
+ ntpsnmpd/ntpsnmpd.1@1.134 +2 -2
+ NTP_4_2_7P132
+
+ packageinfo.sh@1.134 +1 -1
+ NTP_4_2_7P132
+
+ sntp/sntp-opts.c@1.128 +2 -2
+ NTP_4_2_7P132
+
+ sntp/sntp-opts.h@1.128 +3 -3
+ NTP_4_2_7P132
+
+ sntp/sntp-opts.texi@1.128 +4 -4
+ NTP_4_2_7P132
+
+ sntp/sntp.1@1.128 +2 -2
+ NTP_4_2_7P132
+
+ sntp/sntp.html@1.128 +3 -3
+ NTP_4_2_7P132
+
+ util/ntp-keygen-opts.c@1.132 +2 -2
+ NTP_4_2_7P132
+
+ util/ntp-keygen-opts.h@1.132 +3 -3
+ NTP_4_2_7P132
+
+ util/ntp-keygen-opts.texi@1.135 +4 -4
+ NTP_4_2_7P132
+
+ util/ntp-keygen.1@1.135 +2 -2
+ NTP_4_2_7P132
+
+ChangeSet@1.2477, 2011-02-22 08:01:28+00:00, davehart@shiny.ad.hartbrothers.com
+ Avoid relying on remake rules for routine build/flock-build for
+ libevent as for the top-level and sntp subproject.
+
+ ChangeLog@1.795 +3 -1
+ Avoid relying on remake rules for routine build/flock-build for
+ libevent as for the top-level and sntp subproject.
+
+ build@1.44 +8 -1
+ Avoid relying on remake rules for routine build/flock-build for
+ libevent as for the top-level and sntp subproject.
+
+ChangeSet@1.2476, 2011-02-22 02:51:42-05:00, stenn@deacon.udel.edu
+ ElectricFence was suffering bitrot - remove it. valgrind seems better.
+
+ BitKeeper/deleted/04/COPYING~52231e38@1.3 +0 -0
+ Delete: ElectricFence/COPYING
+
+ BitKeeper/deleted/26/Makefile-~52231e38@1.3 +0 -0
+ Delete: ElectricFence/Makefile-
+
+ BitKeeper/deleted/28/efence.h~52231e38@1.3 +0 -0
+ Delete: ElectricFence/efence.h
+
+ BitKeeper/deleted/49/Makefile.am~52231e38@1.8 +0 -0
+ Delete: ElectricFence/Makefile.am
+
+ BitKeeper/deleted/4b/README~52231e38@1.3 +0 -0
+ Delete: ElectricFence/README
+
+ BitKeeper/deleted/54/efence.c~52231e38@1.3 +0 -0
+ Delete: ElectricFence/efence.c
+
+ BitKeeper/deleted/59/print.c~52231e38@1.3 +0 -0
+ Delete: ElectricFence/print.c
+
+ BitKeeper/deleted/8b/page.c~52231e38@1.6 +0 -0
+ Delete: ElectricFence/page.c
+
+ BitKeeper/deleted/a8/eftest.c~52231e38@1.3 +0 -0
+ Delete: ElectricFence/eftest.c
+
+ BitKeeper/deleted/de/CHANGES~52231e38@1.3 +0 -0
+ Delete: ElectricFence/CHANGES
+
+ BitKeeper/deleted/e4/libefence.3~52231e38@1.3 +0 -0
+ Delete: ElectricFence/libefence.3
+
+ BitKeeper/deleted/e8/tstheap.c~52231e38@1.3 +0 -0
+ Delete: ElectricFence/tstheap.c
+
+ ChangeLog@1.794 +1 -0
+ ElectricFence was suffering bitrot - remove it. valgrind seems better.
+
+ Makefile.am@1.107 +0 -1
+ ElectricFence was suffering bitrot - remove it. valgrind seems better.
+
+ configure.ac@1.517 +0 -24
+ ElectricFence was suffering bitrot - remove it. valgrind seems better.
+
+ChangeSet@1.2471.1.2, 2011-02-22 01:35:03-05:00, stenn@deacon.udel.edu
+ Updated to AutoGen-5.11.6
+
+ clockstuff/clktest-opts.c@1.57 +27 -11
+ Updated to AutoGen-5.11.6
+
+ clockstuff/clktest-opts.h@1.57 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpd/ntpd-opts.c@1.136 +24 -8
+ Updated to AutoGen-5.11.6
+
+ ntpd/ntpd-opts.h@1.136 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpd/ntpd-opts.texi@1.134 +3 -3
+ Updated to AutoGen-5.11.6
+
+ ntpd/ntpd.1@1.134 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpdc/ntpdc-opts.c@1.133 +34 -25
+ Updated to AutoGen-5.11.6
+
+ ntpdc/ntpdc-opts.h@1.133 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpdc/ntpdc-opts.texi@1.133 +11 -18
+ Updated to AutoGen-5.11.6
+
+ ntpdc/ntpdc.1@1.133 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpq/ntpq-opts.c@1.133 +32 -18
+ Updated to AutoGen-5.11.6
+
+ ntpq/ntpq-opts.h@1.133 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpq/ntpq-opts.texi@1.133 +9 -11
+ Updated to AutoGen-5.11.6
+
+ ntpq/ntpq.1@1.133 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.133 +24 -8
+ Updated to AutoGen-5.11.6
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.133 +2 -2
+ Updated to AutoGen-5.11.6
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.133 +3 -3
+ Updated to AutoGen-5.11.6
+
+ ntpsnmpd/ntpsnmpd.1@1.133 +2 -2
+ Updated to AutoGen-5.11.6
+
+ sntp/sntp-opts.c@1.127 +28 -12
+ Updated to AutoGen-5.11.6
+
+ sntp/sntp-opts.h@1.127 +2 -2
+ Updated to AutoGen-5.11.6
+
+ sntp/sntp-opts.texi@1.127 +6 -6
+ Updated to AutoGen-5.11.6
+
+ sntp/sntp.1@1.127 +2 -2
+ Updated to AutoGen-5.11.6
+
+ sntp/sntp.html@1.127 +5 -5
+ Updated to AutoGen-5.11.6
+
+ util/ntp-keygen-opts.c@1.131 +28 -12
+ Updated to AutoGen-5.11.6
+
+ util/ntp-keygen-opts.h@1.131 +2 -2
+ Updated to AutoGen-5.11.6
+
+ util/ntp-keygen-opts.texi@1.134 +5 -5
+ Updated to AutoGen-5.11.6
+
+ util/ntp-keygen.1@1.134 +2 -2
+ Updated to AutoGen-5.11.6
+
+ChangeSet@1.2473, 2011-02-22 06:06:28+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1832] ntpdate doesn't allow timeout > 2s.
+ [Bug 1833] The checking sem_timedwait() fails without -pthread.
+ Enable all relevant automake warnings.
+ Correct Solaris 2.1x PTHREAD_ONCE_INIT extra braces test to avoid
+ triggering warnings due to excess braces.
+ Remove libevent-cfg from sntp/Makefile.am.
+ Provide bug report and URL options to Autoconf.
+
+ ChangeLog@1.793 +7 -1
+ [Bug 1832] ntpdate doesn't allow timeout > 2s.
+ [Bug 1833] The checking sem_timedwait() fails without -pthread.
+ Enable all relevant automake warnings.
+ Correct Solaris 2.1x PTHREAD_ONCE_INIT extra braces test to avoid
+ triggering warnings due to excess braces.
+ Remove libevent-cfg from sntp/Makefile.am.
+ Provide bug report and URL options to Autoconf.
+
+ Makefile.am@1.106 +1 -3
+ Enable all relevant automake warnings.
+
+
+ adjtimed/Makefile.am@1.11 +7 -10
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ clockstuff/Makefile.am@1.18 +7 -9
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ configure.ac@1.516 +11 -4
+ Pass automake options via AM_INIT_AUTOMAKE so they apply to all Makefile.am
+ without requiring duplicative AUTOMAKE_OPTIONS = lines.
+ Enable all relevant automake warnings.
+
+ includes.mf@1.1 +6 -0
+ BitKeeper file C:/ntp/ntp-dev-m4quote/includes.mf
+
+ includes.mf@1.0 +0 -0
+
+ kernel/Makefile.am@1.5 +0 -2
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ kernel/sys/Makefile.am@1.6 +0 -5
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ libntp/Makefile.am@1.61 +7 -11
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ libparse/Makefile.am@1.25 +5 -10
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ ntpd/Makefile.am@1.100 +6 -8
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ ntpd/refclock_true.c@1.18 +3 -3
+ include system and C runtime headers before NTP's
+
+ ntpdate/Makefile.am@1.28 +6 -10
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ ntpdate/ntpdate.c@1.84 +1 -12
+ [Bug 1832] ntpdate doesn't allow timeout > 2s.
+
+ ntpdate/ntpdate.h@1.13 +6 -3
+ [Bug 1832] ntpdate doesn't allow timeout > 2s.
+
+ ntpdc/Makefile.am@1.58 +8 -10
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ ntpq/Makefile.am@1.54 +8 -10
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ ntpsnmpd/Makefile.am@1.26 +10 -12
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ parseutil/Makefile.am@1.15 +7 -9
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ sntp/Makefile.am@1.56 +15 -17
+ Enable all relevant automake warnings.
+
+
+ sntp/configure.ac@1.58 +10 -4
+ Pass automake options via AM_INIT_AUTOMAKE so they apply to all Makefile.am
+ without requiring duplicative AUTOMAKE_OPTIONS = lines.
+ Enable all relevant automake warnings.
+
+ sntp/includes.mf@1.1 +6 -0
+ BitKeeper file C:/ntp/ntp-dev-m4quote/sntp/includes.mf
+
+ sntp/includes.mf@1.0 +0 -0
+
+ sntp/m4/ntp_libevent.m4@1.4 +3 -3
+ $ac_configure_args is maintained with a leading space, particularly important
+ with Autoconf 2.61, not so much with 2.68.
+
+ sntp/m4/ntp_libntp.m4@1.7 +27 -10
+ [Bug 1833] The checking sem_timedwait() fails without -pthread.
+
+ sntp/tests/Makefile.am@1.21 +20 -17
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ tests/libntp/Makefile.am@1.35 +18 -15
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ util/Makefile.am@1.57 +8 -13
+ automake deprecates INCLUDES, use AM_CPPFLAGS instead
+
+ChangeSet@1.2082.4.204, 2011-02-22 00:38:53-05:00, stenn@deacon.udel.edu
+ upgrade to libopts-34.0.9
+
+ clockstuff/clktest-opts.c@1.12.1.1 +100 -76
+ upgrade to libopts-34.0.9
+
+ clockstuff/clktest-opts.h@1.12.1.1 +32 -25
+ upgrade to libopts-34.0.9
+
+ ntpd/ntpd-opts.c@1.248.34.1 +24 -8
+ upgrade to libopts-34.0.9
+
+ ntpd/ntpd-opts.h@1.248.34.1 +2 -2
+ upgrade to libopts-34.0.9
+
+ ntpd/ntpdsim-opts.c@1.18 +202 -171
+ upgrade to libopts-34.0.9
+
+ ntpd/ntpdsim-opts.h@1.18 +32 -28
+ upgrade to libopts-34.0.9
+
+ ntpdc/ntpdc-opts.c@1.244.34.1 +34 -25
+ upgrade to libopts-34.0.9
+
+ ntpdc/ntpdc-opts.h@1.244.34.1 +2 -2
+ upgrade to libopts-34.0.9
+
+ ntpq/ntpq-opts.c@1.245.34.1 +32 -18
+ upgrade to libopts-34.0.9
+
+ ntpq/ntpq-opts.h@1.245.34.1 +2 -2
+ upgrade to libopts-34.0.9
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.35.1 +24 -8
+ upgrade to libopts-34.0.9
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.35.1 +2 -2
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/COPYING.gplv3@1.4 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/COPYING.lgplv3@1.4 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/Makefile.am@1.9 +3 -3
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/README@1.6 +63 -34
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/ag-char-map.h@1.12 +3 -3
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/autoopts.c@1.9 +23 -19
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/autoopts.h@1.8 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/autoopts/options.h@1.11 +11 -10
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/autoopts/usage-txt.h@1.11 +4 -4
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/boolean.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/compat/compat.h@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/compat/windows-config.h@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/configfile.c@1.10 +174 -51
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/cook.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/enumeration.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/environment.c@1.9 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/file.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/genshell.c@1.12 +29 -13
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/genshell.h@1.12 +3 -3
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/load.c@1.9 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/m4/libopts.m4@1.15 +10 -21
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/m4/liboptschk.m4@1.8 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/makeshell.c@1.8 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/nested.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/numeric.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/parse-duration.c@1.4 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/parse-duration.h@1.4 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/pgusage.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/proto.h@1.12 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/putshell.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/reset.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/restore.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/save.c@1.8 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/sort.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/stack.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/streqvcmp.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/text_mmap.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/time.c@1.7 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/tokenize.c@1.5 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/usage.c@1.8 +11 -7
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/value-type.h@1.12 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/version.c@1.7 +9 -12
+ upgrade to libopts-34.0.9
+
+ sntp/libopts/xat-attribute.h@1.12 +1 -1
+ upgrade to libopts-34.0.9
+
+ sntp/sntp-opts.c@1.117.32.1 +27 -11
+ upgrade to libopts-34.0.9
+
+ sntp/sntp-opts.h@1.117.32.1 +2 -2
+ upgrade to libopts-34.0.9
+
+ util/ntp-keygen-opts.c@1.247.34.1 +28 -12
+ upgrade to libopts-34.0.9
+
+ util/ntp-keygen-opts.h@1.247.34.1 +2 -2
+ upgrade to libopts-34.0.9
+
+ChangeSet@1.2467.1.1, 2011-02-21 20:50:01+00:00, davehart@shiny.ad.hartbrothers.com
+ Autoconf 2.61 workarounds
+
+ sntp/m4/ntp_cacheversion.m4@1.13 +8 -1
+ Autoconf 2.61 workaround: do not use AS_UNSET with a variable variable name.
+
+ sntp/m4/ntp_libntp.m4@1.4.1.1 +12 -13
+ Autoconf 2.61 workarounds: do not use [] for action-if-not-found with
+ AC_CHECK_LIB and AC_CHECK_FUNC
+
+ChangeSet@1.2471, 2011-02-21 06:04:08-05:00, stenn@deacon.udel.edu
+ Remove libevent-cfg from sntp/Makefile.am
+
+ ChangeLog@1.792 +1 -0
+ Remove libevent-cfg from sntp/Makefile.am
+
+ sntp/Makefile.am@1.55 +0 -1
+ Remove libevent-cfg from sntp/Makefile.am
+
+ChangeSet@1.2470, 2011-02-21 09:21:02+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P131
+ TAG: NTP_4_2_7P131
+
+ ChangeLog@1.791 +1 -0
+ NTP_4_2_7P131
+
+ clockstuff/clktest-opts.c@1.55 +2 -2
+ NTP_4_2_7P131
+
+ clockstuff/clktest-opts.h@1.55 +3 -3
+ NTP_4_2_7P131
+
+ ntpd/ntpd-opts.c@1.135 +2 -2
+ NTP_4_2_7P131
+
+ ntpd/ntpd-opts.h@1.135 +3 -3
+ NTP_4_2_7P131
+
+ ntpd/ntpd-opts.texi@1.133 +2 -2
+ NTP_4_2_7P131
+
+ ntpd/ntpd.1@1.133 +2 -2
+ NTP_4_2_7P131
+
+ ntpdc/ntpdc-opts.c@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpdc/ntpdc-opts.h@1.132 +3 -3
+ NTP_4_2_7P131
+
+ ntpdc/ntpdc-opts.texi@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpdc/ntpdc.1@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpq/ntpq-opts.c@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpq/ntpq-opts.h@1.132 +3 -3
+ NTP_4_2_7P131
+
+ ntpq/ntpq-opts.texi@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpq/ntpq.1@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.132 +3 -3
+ NTP_4_2_7P131
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.132 +2 -2
+ NTP_4_2_7P131
+
+ ntpsnmpd/ntpsnmpd.1@1.132 +2 -2
+ NTP_4_2_7P131
+
+ packageinfo.sh@1.133 +1 -1
+ NTP_4_2_7P131
+
+ sntp/sntp-opts.c@1.126 +13 -29
+ NTP_4_2_7P131
+
+ sntp/sntp-opts.h@1.126 +4 -4
+ NTP_4_2_7P131
+
+ sntp/sntp-opts.texi@1.126 +7 -8
+ NTP_4_2_7P131
+
+ sntp/sntp.1@1.126 +2 -2
+ NTP_4_2_7P131
+
+ sntp/sntp.html@1.126 +56 -84
+ NTP_4_2_7P131
+
+ util/ntp-keygen-opts.c@1.130 +2 -2
+ NTP_4_2_7P131
+
+ util/ntp-keygen-opts.h@1.130 +3 -3
+ NTP_4_2_7P131
+
+ util/ntp-keygen-opts.texi@1.133 +2 -2
+ NTP_4_2_7P131
+
+ util/ntp-keygen.1@1.133 +2 -2
+ NTP_4_2_7P131
+
+ChangeSet@1.2469, 2011-02-21 03:59:49-05:00, stenn@deacon.udel.edu
+ The fixes for bugs 1087 and 1088 are in the udated SNTP code
+
+ ChangeLog@1.790 +2 -0
+ The fixes for bugs 1087 and 1088 are in the udated SNTP code
+
+ChangeSet@1.2468, 2011-02-21 00:26:17-08:00, harlan@hms-mbp.local
+ older autoconf sometimes dislikes [].
+
+ ChangeLog@1.789 +1 -0
+ older autoconf sometimes dislikes [].
+
+ sntp/m4/ntp_libntp.m4@1.5 +4 -6
+ older autoconf sometimes dislikes [].
+
+ChangeSet@1.2422.10.1, 2011-02-20 23:11:05-05:00, stenn@deacon.udel.edu
+ refclock_acts.c cleanup from Dave Mills
+
+ ChangeLog@1.784.2.1 +1 -0
+ refclock_acts.c cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.46.1.1 +4 -3
+ refclock_acts.c cleanup from Dave Mills
+
+ChangeSet@1.2466, 2011-02-20 21:20:21+00:00, davehart@shiny.ad.hartbrothers.com
+ Cleanup for prior merge cset
+
+ include/ntp_machine.h@1.33 +5 -1
+ Cleanup for prior merge cset
+
+ include/ntp_unixtime.h@1.10 +1 -6
+ Cleanup for prior merge cset
+
+ libntp/systime.c@1.53 +2 -2
+ Cleanup for prior merge cset
+
+ ports/winnt/libntp/SetSystemTime.c@1.10 +2 -0
+ Cleanup for prior merge cset
+
+ ports/winnt/libntp/getclock.c@1.3 +2 -0
+ Cleanup for prior merge cset
+
+ ports/winnt/libntp/util_clockstuff.c@1.5 +1 -0
+ Cleanup for prior merge cset
+
+ util/ntp-keygen.c@1.78 +2 -2
+ Cleanup for prior merge cset
+
+ChangeSet@1.2464, 2011-02-20 20:23:00+00:00, davehart@shiny.ad.hartbrothers.com
+ Attempt typical subpackage approach for libevent
+ sntp test cleanup
+ IPv6 hackery
+ Split up ntp_lib.m4 into smaller, more specific subsets
+ Use {step,adj}_systime from libntp. Use EX_* codes for exit status.
+ libevent cleanup
+ libevent upgrade
+ Move blocking worker and intres from ntpd to libntp.
+ Move AC_FUNC_FORK and AC_FUNC_ALLOCA to ntp_libntp.m4 along with move
+ of intres/blocking worker to libntp.
+ Use %m instead of strerror().
+ make -lz depend on zlib.h
+ hp-ux portability fix
+ portability
+ Allow libevent's regress to be skipped in make check.
+ Switch sntp from evdns to blocking worker intres.
+ Quiet "signal_no_reset: signal 18 had flags 20000" on OpenSolaris,
+ adding SA_NOCLDSTOP to IGNORED_SA_FLAGS.
+ Be consistent about how blocking children go away:
+ 1. Parent requests them to go by closing pipe or CHILD_EXIT_REQ.
+ 2. Child goes away quietly.
+ 3. Parent sees them gone via broken resp pipe or CHILD_GONE_RESP.
+ 4. Parent clears blocking_children entry for reuse.
+ Make delay between queries to addresses resolved from same hostname
+ per-family in sntp, as ntpd won't consider our v4 and v6 source
+ addresses to be one remote rate-limit target.
+ use freeaddrinfo() in ntpq's getnetnum().
+ valgrind warned of branch dependent on uninitialized value,
+ irig_decode()'s local syncdig.
+ Free OpenSSL dynamic allocations atexit.
+ Enable pthreads build
+ libntp autoconf macro cleanup
+ Move "can't write KoD file" warning from sntp shutdown to startup.
+ Use libevent log callback to redirect messages from stderr to msyslog()
+ enable libevent debug mode if sntp debug > 0
+ Issue a single read event for each socket, rather than one per query.
+ Do not attempt to read in socket callback for EV_TIMEOUT.
+ ipv6 fixes for sntp
+ Crib some pthread m4 from BIND for libisc.
+ Fix step/slew logic in sntp.
+ sntp --headspace option (default 10ms) spaces queries.
+ Provide less-broken gettimeofday_cached().
+ Add support for --(no-)wait and -uctimeout
+ Remove duplicate clock_gettime/clock_settime logic from sntp/configure.ac,
+ it's now in sntp/m4/ntp_libntp.m4.
+ Bump config.cache version stamps to account for cache-incompatible change
+ to librt detection.
+ Omit unused code with recent gcc and gnu ld.
+ AC_LANG update for openldap autoconf macros
+ Clean up AC_DEFINE and AC_DEFINE_UNQUOTED arg quoting in openldap*.m4
+ add a timeout for test-eof.c as it may hang under HP-UX 10.20
+ Use pthreads for blocking worker rather than fork, if possible.
+ Quiet alignment warning due to casting sockaddr * to sockaddr_u *
+ Quiet ntp_control.c and ntp_request.c warnings about casting char *
+ to u_int32 * using unions.
+ Use void * rather than char * for variant pointers to help with
+ pointer cast increases required alignment warnings.
+ Fix many warnings enabled with -Wcast-align, when casting
+ a pointer to a more-strictly-aligned underlying type.
+ preset ol_with_yielding_select=${ol_with_yielding_select-auto}
+ Also change tests to use x prefix as insurance against other issues.
+ We always need the PTHREADS AM_CONDITIONAL. Use the OL check.
+ Use NTP_LIBEVENT m4sh macro to decide between installed and tearoff
+ libevent.
+ Add readonly arg to kod_init_kod_db() for tests -- prevents editing
+ test baseline input KoD files during make check, regression limited
+ to sntp/libevent branch.
+ Switch libevent-2.0.10-stable from ACX_PTHREADS to OL_THREAD_CHECK
+ Use socketpair() instead of pipe() when available, as avoiding
+ EV_FEATURE_FDS allows libevent to use a faster backend on
+ systems like Linux without an O(1) backend that handles pipes.
+ Remove contentious libevent-cfg sentinel files, modify libevent's
+ confgure args via $ac_configure_args.
+ Strip unneeded checks from ntp_ipv6.m4:
+ for struct sockaddr_storage member ss_family
+ for struct sockaddr_storage member ss_len
+ for struct sockaddr_storage member __ss_len
+ Move things used by libntp from top-level configure.ac to NTP_LIBNTP and NTP_IPV6
+ Change "forked worker child (pid 0)" from msyslog() to DPRINTF().
+ Change initial socket boundary message from DEBUG-only msyslog() to DPRINTF().
+
+ BitKeeper/deleted/2b/regress.gen.c~aa03b6be21193937@1.2 +0 -0
+ Rename: sntp/libevent/test/regress.gen.c -> BitKeeper/deleted/2b/regress.gen.c~aa03b6be21193937
+
+ BitKeeper/deleted/31/Makefile.am~a4dc04c7982322c0@1.2 +0 -0
+ Rename: sntp/build-libevent/Makefile.am -> BitKeeper/deleted/31/Makefile.am~a4dc04c7982322c0
+
+ BitKeeper/deleted/5f/acx_pthread.m4~2200dd7a1a4e6b33@1.2 +0 -0
+ Rename: sntp/libevent/m4/acx_pthread.m4 -> BitKeeper/deleted/5f/acx_pthread.m4~2200dd7a1a4e6b33
+
+ BitKeeper/deleted/67/regress.gen.h~23d0c5b9df595958@1.2 +0 -0
+ Rename: sntp/libevent/test/regress.gen.h -> BitKeeper/deleted/67/regress.gen.h~23d0c5b9df595958
+
+ BitKeeper/etc/ignore@1.78 +2 -0
+ added regress.gen.c regress.gen.h
+
+ ChangeLog@1.786 +19 -1
+ Convert sntp to libevent event-driven socket programming. Instead of
+ blocking name resolution and querying one NTP server at a time,
+ resolve server names and send NTP queries without blocking. Add
+ sntp command-line options to adjust timing and optionally wait for all
+ servers to respond instead of exiting after the first.
+ Move "can't write KoD file" warning from sntp shutdown to startup.
+ Import libevent 2.0.10-stable plus local patches as a tearoff, used
+ only if the target system lacks an installed libevent 2.0.9 or later.
+ Move blocking worker and resolver to libntp from ntpd.
+ Use threads rather than forked child processes for blocking worker
+ when possible. Override with configure --disable-thread-support.
+ Move init_logging(), change_logfile(), and setup_logfile() from ntpd
+ to libntp, use them in sntp.
+ Test --without-sntp in flock-build script's -no-refclocks variety.
+ Avoid invoking config.status twice in a row in build script.
+ Move more m4sh tests needed by libntp to shared .m4 files.
+ Split up ntp_libntp.m4 into smaller, more specific subsets.
+ Enable gcc -Wcast-align, fix many instances of warnings when casting
+ a pointer to a more-strictly-aligned underlying type.
+
+
+ Makefile.am@1.105 +2 -23
+ SUBDIRS and DIST_SUBDIRS were identical, remove definition of DIST_SUBDIRS
+ and allow Automake to default it to SUBDIRS.
+ Add -I sntp/libevent/m4 to ACLOCAL_AMFLAGS to find openldap*.m4.
+
+ adjtimed/Makefile.am@1.10 +2 -2
+ enable pthreads build.
+
+ build@1.43 +5 -4
+ build: Do not invoke config.status unless Makefile is out of date.
+ Avoids re-running config.status right after configure ran it, which
+ triggers spurious am--remake because Makefile is newer than config.h
+
+ clockstuff/Makefile.am@1.17 +2 -2
+ enable pthreads build.
+
+ configure.ac@1.515 +41 -806
+ Split up ntp_lib.m4 into smaller, more specific subsets
+ Move AC_FUNC_FORK and AC_FUNC_ALLOCA to ntp_libntp.m4 along with move
+ of intres/blocking worker to libntp.
+ Move droproot configure test to libntp with intres.
+ Bump config.cache version stamps to account for cache-incompatible change
+ to librt detection.
+ Move more m4 code needed by libntp to sntp/m4/*.m4 from top-level configure.ac
+
+ deps-ver@1.5 +1 -1
+ bump deps-ver to avoid build breaks from moved source files.
+
+ flock-build@1.49 +2 -2
+ test --without-sntp in one of the flock-build variants
+
+ include/Makefile.am@1.44.1.1 +1 -0
+ rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+
+ include/intreswork.h@1.5 +11 -5
+ Move blocking worker and intres from ntpd to libntp.
+ rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+
+ include/intreswork.h@1.4 +0 -0
+ Rename: include/ntp_intres.h -> include/intreswork.h
+
+ include/libntp.h@1.2 +3 -1
+ use getdtablesize() if available and _SC_OPEN_MAX is not.
+
+ include/ntp_calendar.h@1.9 +2 -0
+ include time.h in ntp_calendar.h which uses struct tm.
+
+ include/ntp_control.h@1.57 +7 -2
+ Quiet ntp_control.c and ntp_request.c -Wcast-align warnings.
+
+ include/ntp_debug.h@1.4 +2 -1
+ Allow %m in DPRINTF
+
+ include/ntp_intres.h@1.1 +45 -0
+ Former ntp_intres.h renamed to intreswork.h.
+ New public interface header for intres, contents moved from ntpd.h.
+
+ include/ntp_intres.h@1.0 +0 -0
+
+ include/ntp_io.h@1.21 +4 -5
+ Move blocking worker and intres from ntpd to libntp.
+ Move close_all_beyond() and close_all_except() to libntp.
+
+ include/ntp_lists.h@1.8.1.1 +3 -3
+ Do not invoke (beforecur) test in LINK_SORT_SLIST with a previously-empty list.
+
+ include/ntp_machine.h@1.32 +1 -11
+ Nothing sets TIME_WITH_SYS_TIME, remove it.
+
+ include/ntp_refclock.h@1.29 +2 -17
+ Use void * for variant clock/unit pointers.
+ Remove duplicate LDISC_* definitions.
+
+ include/ntp_request.h@1.42 +26 -17
+ Quiet ntp_control.c and ntp_request.c -Wcast-align warnings.
+
+ include/ntp_rfc2553.h@1.38 +9 -0
+ Add copy_addrinfo() to copy a single addrinfo and pointed-to
+ constituents.
+
+ include/ntp_stdlib.h@1.57.1.1 +14 -3
+ Add more m*printf() varieties.
+ Move init_logging(), change_logfile(), and setup_logfile() from ntpd
+ to libntp.
+
+ include/ntp_tty.h@1.5 +10 -10
+ Whitespace, imply maximum LDISC_ flag value with leading 0s.
+
+ include/ntp_unixtime.h@1.7.1.1 +6 -5
+ Several files comment that ntp_unixtime.h includes sys/time.h and
+ time.h, make it so.
+ Provide GETTIMEOFDAY() macro on systems with getclock() for sntp.
+
+
+ include/ntp_worker.h@1.2 +120 -10
+ Move blocking worker and intres from ntpd to libntp.
+ Be consistent about how blocking children go away:
+ 1. Parent requests them to go by closing pipe or CHILD_EXIT_REQ.
+ 2. Child goes away quietly.
+ 3. Parent sees them gone via broken resp pipe or CHILD_GONE_RESP.
+ 4. Parent clears blocking_children entry for reuse.
+ Use pthreads for blocking worker rather than fork, if possible.
+ Use socketpair() instead of pipe() when available, as avoiding
+ EV_FEATURE_FDS allows libevent to use a faster backend on
+ systems like Linux without an O(1) backend that handles pipes.
+
+ include/ntp_workimpl.h@1.2 +6 -1
+ Move blocking worker and intres from ntpd to libntp.
+ Use pthreads for blocking worker rather than fork, if possible.
+
+ include/ntpd.h@1.159 +4 -61
+ Move blocking worker and intres from ntpd to libntp.
+ Rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+ Move close_all_beyond() and close_all_except() to libntp.
+
+ include/recvbuff.h@1.23 +1 -1
+ include ntp_net.h for sockaddr_u declaration
+
+ lib/isc/pthreads/mutex.c@1.2 +9 -0
+ Work with very first draft posix M:N threads on HP-UX 10.20
+
+ lib/isc/unix/ifiter_ioctl.c@1.30 +2 -2
+ lib/isc/unix/ifiter_ioctl.c:456: warning: cast increases required alignment of target type
+ lib/isc/unix/ifiter_ioctl.c:669: warning: cast increases required alignment of target type
+
+
+ lib/isc/unix/interfaceiter.c@1.20 +2 -2
+ lib/isc/unix/interfaceiter.c:83: warning: cast increases required alignment of target type
+ lib/isc/unix/interfaceiter.c:87: warning: cast increases required alignment of target type
+
+ libntp/Makefile.am@1.58.1.1 +43 -29
+ Move blocking worker and intres from ntpd to libntp.
+ Enable pthreads build.
+
+ libntp/a_md5encrypt.c@1.30 +1 -1
+ Use sizeof() rather than hard-coding in addr2refid().
+
+ libntp/caljulian.c@1.14 +5 -4
+ style only
+
+ libntp/humandate.c@1.10 +2 -1
+ whitespace
+
+ libntp/lib_strbuf.c@1.8 +2 -0
+ Make sure init_lib() is called before ssl_init() returns.
+
+ libntp/machines.c@1.23 +14 -32
+ use %m instead of strerror()
+
+ libntp/msyslog.c@1.35 +281 -0
+ Add more m*printf() varieties.
+ Move init_logging(), change_logfile(), and setup_logfile() from ntpd
+ to libntp.
+ strip .exe from program name in init_logging().
+ Log new logfile name to syslog on switching, as we do when switching
+ from one logfile to another.
+
+ libntp/ntp_intres.c@1.93 +322 -122
+ Move blocking worker and intres from ntpd to libntp.
+ Rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+ Use freeaddrinfo() in blocking_getaddrinfo().
+ Use pthreads for blocking worker rather than fork, if possible.
+
+ libntp/ntp_intres.c@1.92 +0 -0
+ Rename: ntpd/ntp_intres.c -> libntp/ntp_intres.c
+
+ libntp/ntp_libopts.c@1.4 +18 -12
+ Quiet -Wcast-align warnings in ntpOptionProcess const-silliness workaround.
+
+ libntp/ntp_lineedit.c@1.11 +1 -2
+ use %m instead of strerror()
+
+ libntp/ntp_random.c@1.8 +20 -7
+ #ifdef away unused code that triggers alignment warnings.
+
+ libntp/ntp_rfc2553.c@1.45 +40 -1
+ Add copy_addrinfo() to copy a single addrinfo and pointed-to
+ constituents.
+
+ libntp/ntp_worker.c@1.4 +221 -36
+ Move blocking worker and intres from ntpd to libntp.
+ Rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+ Quiet worker process startup/shutdown.
+ Be consistent about how blocking children go away:
+ 1. Parent requests them to go by closing pipe or CHILD_EXIT_REQ.
+ 2. Child goes away quietly.
+ 3. Parent sees them gone via broken resp pipe or CHILD_GONE_RESP.
+ 4. Parent clears blocking_children entry for reuse.
+ Use pthreads for blocking worker rather than fork, if possible.
+ Use socketpair() instead of pipe() when available, as avoiding
+ EV_FEATURE_FDS allows libevent to use a faster backend on
+ systems like Linux without an O(1) backend that handles pipes.
+
+ libntp/ntp_worker.c@1.3 +0 -0
+ Rename: ntpd/ntp_worker.c -> libntp/ntp_worker.c
+
+ libntp/socket.c@1.5 +6 -8
+ Change initial socket boundary message from DEBUG-only msyslog() to DPRINTF().
+
+ libntp/socktohost.c@1.13 +15 -2
+ Quiet -Wcast-align warning due to casting sockaddr * to sockaddr_u *
+
+ libntp/ssl_init.c@1.14 +17 -1
+ Free OpenSSL dynamic allocations atexit.
+ Make sure init_lib() is called before ssl_init() returns.
+
+ libntp/syssignal.c@1.12 +24 -9
+ quiet "signal_no_reset: signal 18 had flags 20000" on OpenSolaris,
+ adding SA_NOCLDSTOP to IGNORED_SA_FLAGS.
+ Enable pthreads build.
+
+ libntp/work_fork.c@1.7 +211 -148
+ Move blocking worker and intres from ntpd to libntp.
+ Move init_logging(), change_logfile(), and setup_logfile() from ntpd
+ to libntp.
+ Do not complain of short read 0 of 24 on normal forked worker exit.
+ Be consistent about how blocking children go away:
+ 1. Parent requests them to go by closing pipe or CHILD_EXIT_REQ.
+ 2. Child goes away quietly.
+ 3. Parent sees them gone via broken resp pipe or CHILD_GONE_RESP.
+ 4. Parent clears blocking_children entry for reuse.
+ Use pthreads for blocking worker rather than fork, if possible.
+ Use socketpair() instead of pipe() when available, as avoiding
+ EV_FEATURE_FDS allows libevent to use a faster backend on
+ systems like Linux without an O(1) backend that handles pipes.
+ Change "forked worker child (pid 0)" from msyslog() to DPRINTF().
+
+ libntp/work_fork.c@1.6 +0 -0
+ Rename: ntpd/work_fork.c -> libntp/work_fork.c
+
+ libntp/work_thread.c@1.5 +479 -179
+ Move blocking worker and intres from ntpd to libntp.
+ Be consistent about how blocking children go away:
+ 1. Parent requests them to go by closing pipe or CHILD_EXIT_REQ.
+ 2. Child goes away quietly.
+ 3. Parent sees them gone via broken resp pipe or CHILD_GONE_RESP.
+ 4. Parent clears blocking_children entry for reuse.
+ Use pthreads for blocking worker rather than fork, if possible.
+ Use socketpair() instead of pipe() when available, as avoiding
+ EV_FEATURE_FDS allows libevent to use a faster backend on
+ systems like Linux without an O(1) backend that handles pipes.
+ Work around cast discards volatile qualifier realloc'ing request and
+ response arrays.
+
+ libntp/work_thread.c@1.4 +0 -0
+ Rename: ntpd/work_thread.c -> libntp/work_thread.c
+
+ libparse/Makefile.am@1.24 +1 -1
+ Enable pthreads build.
+
+ libparse/parsesolaris.c@1.10 +6 -5
+ Silence cast increases required alignment warnings.
+
+ ntpd/Makefile.am@1.99 +11 -12
+ Move blocking worker and intres from ntpd to libntp.
+ Enable pthreads build.
+
+ ntpd/cmd_args.c@1.59 +4 -1
+ Make user and group string pointers distinct allocations.
+
+ ntpd/ntp_config.c@1.284 +17 -20
+ Use %m instead of strerror().
+ Rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+ Avoid "gai_error" shadowing warning using "gai_err" instead.
+
+ ntpd/ntp_control.c@1.161.1.1 +8 -8
+ Quiet ntp_control.c and ntp_request.c -Wcast-align warnings.
+
+ ntpd/ntp_io.c@1.348 +54 -221
+ Move blocking worker and intres from ntpd to libntp.
+ Move close_all_beyond() and close_all_except() to libntp.
+ Use pthreads for blocking worker rather than fork, if possible.
+ Avoid -Wcast-align warnings in routing message handling.
+ Use socketpair() instead of pipe() when available, as avoiding
+ EV_FEATURE_FDS allows libevent to use a faster backend on
+ systems like Linux without an O(1) backend that handles pipes.
+
+ ntpd/ntp_request.c@1.103 +305 -358
+ Quiet ntp_control.c and ntp_request.c -Wcast-align warnings.
+ struct interface -> endpt.
+
+ ntpd/ntp_timer.c@1.63 +22 -9
+ Move blocking worker and intres from ntpd to libntp.
+ Generalize intres_timeout_req(), provide ntpd and sntp implementations.
+
+ ntpd/ntpd.c@1.121.1.1 +32 -226
+ move init_logging(), change_logfile(), and setup_logfile() from ntpd
+ to libntp.
+ free(user) before replacement estrdup().
+ Call INIT_SSL() early with other init_*() routines.
+
+ ntpd/refclock_acts.c@1.45.1.1 +12 -13
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_arbiter.c@1.19 +7 -8
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_arc.c@1.24 +9 -10
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_as2201.c@1.13.1.1 +6 -7
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_atom.c@1.62 +3 -3
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_bancomm.c@1.14 +5 -6
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_chronolog.c@1.12 +7 -8
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_chu.c@1.51 +20 -21
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_datum.c@1.16 +32 -127
+ Get rid of units array, follow common idioms.
+
+ ntpd/refclock_dumbclock.c@1.18 +7 -8
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_fg.c@1.13 +5 -5
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_gpsvme.c@1.9 +2 -2
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_heath.c@1.17 +2 -2
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_hopfpci.c@1.12 +3 -4
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_hopfser.c@1.15 +7 -8
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_hpgps.c@1.13 +7 -8
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_irig.c@1.35 +13 -13
+ valgrind warned of branch dependent on uninitialized value,
+ irig_decode()'s local syncdig.
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_jjy.c@1.22 +16 -16
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_jupiter.c@1.27 +28 -40
+ Use %m instead of strerror().
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_leitch.c@1.13 +2 -2
+ silence increased alignment requirement from pointer cast.
+
+ ntpd/refclock_msfees.c@1.15 +2 -2
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_mx4200.c@1.29 +18 -32
+ Use %m instead of strerror().
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_neoclock4x.c@1.20 +8 -8
+ Use %m instead of strerror().
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_nmea.c@1.59 +40 -28
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_oncore.c@1.92 +6 -6
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_palisade.c@1.38 +20 -17
+ Use %m instead of strerror().
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_parse.c@1.57 +9 -9
+ silence cast increases required alignment warning.
+
+ ntpd/refclock_pcf.c@1.12 +2 -2
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_pst.c@1.12 +7 -8
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_ripencc.c@1.16 +9 -10
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_shm.c@1.22 +9 -9
+ Use %m instead of strerror().
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_tpro.c@1.12 +5 -6
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_trak.c@1.11 +7 -8
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_true.c@1.17 +9 -10
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_ulink.c@1.16 +5 -5
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_wwv.c@1.74 +23 -27
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_wwvb.c@1.27 +9 -10
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpd/refclock_zyfer.c@1.8 +6 -6
+ nonfunctional:
+ Use rbufp->recv_peer instead of casting rbufp->recv_srcclock.
+ pp->unitptr is now void *, no cast needed.
+
+ ntpdate/Makefile.am@1.27 +4 -3
+ Enable pthreads build.
+
+ ntpdate/ntpdate.c@1.83 +19 -11
+ Avoid alignment warnings from casting sockaddr * to sockaddr_u *.
+
+ ntpdc/Makefile.am@1.57 +5 -4
+ Enable pthreads build.
+ Make $(PROGRAMS) depend solely on version.o, whose dependencies should
+ take care of the rest.
+
+ ntpdc/layout.std@1.11 +10 -2
+ Adjust to less-trivial ntp_request.h.
+
+ ntpdc/nl.pl.in@1.9 +8 -2
+ Adjust to less-trivial ntp_request.h.
+
+ ntpdc/ntpdc.c@1.94 +33 -40
+ Quiet -Wcast-align warnings.
+ JAN_1970 definition now provided by ntp_unixtime.h
+
+ ntpdc/ntpdc_ops.c@1.76 +55 -52
+ Avoid increased required alignment warnings casting pointers.
+
+ ntpq/Makefile.am@1.53 +5 -5
+ Enable pthreads build.
+ Make $(PROGRAMS) depend on version.o alone, its dependencies should
+ handle the rest.
+
+ ntpq/ntpq.c@1.130.1.1 +35 -26
+ Use %m instead of strerror().
+ Use freeaddrinfo() in ntpq's getnetnum().
+ Quiet -Wcast-align warnings.
+
+ ntpsnmpd/Makefile.am@1.25 +5 -4
+ Enable pthreads build.
+
+ parseutil/Makefile.am@1.14 +5 -3
+ Enable pthreads build.
+ pick up -lresolv, needed by dcfd, via LDADD_LIBNTP.
+
+ ports/winnt/include/ntp_iocompletionport.h@1.19 +3 -3
+ Move blocking worker and intres from ntpd to libntp.
+ Get rid of accessor for WaitableExitEventHandle.
+
+ ports/winnt/include/ntp_timer.h@1.7 +0 -4
+ Move blocking worker and intres from ntpd to libntp.
+
+ ports/winnt/libntp/win32_io.c@1.2 +3 -2
+ Use %m instead of strerror().
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.57 +92 -53
+ Move blocking worker and intres from ntpd to libntp.
+ Get rid of accessor for WaitableExitEventHandle.
+ Use pthreads for blocking worker rather than fork, if possible.
+
+ ports/winnt/ntpd/ntservice.c@1.27 +11 -13
+ Get rid of accessor for WaitableExitEventHandle.
+
+ ports/winnt/vc6/libntp.dsp@1.59.1.1 +24 -0
+ Move blocking worker and intres from ntpd to libntp.
+ rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+
+ ports/winnt/vc6/ntpd.dsp@1.53 +0 -20
+ Move blocking worker and intres from ntpd to libntp.
+
+ ports/winnt/vs2003/libntp.vcproj@1.17.1.1 +18 -90
+ Move blocking worker and intres from ntpd to libntp.
+ rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+
+ ports/winnt/vs2003/ntpd.vcproj@1.14 +0 -32
+ Move blocking worker and intres from ntpd to libntp.
+
+ ports/winnt/vs2005/libntp.vcproj@1.15.1.1 +24 -1404
+ Move blocking worker and intres from ntpd to libntp.
+ rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.14 +0 -34
+ Move blocking worker and intres from ntpd to libntp.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.36.1.1 +30 -2
+ Move blocking worker and intres from ntpd to libntp.
+ Rename former ntp_intres.h to intreswork.h, move intres public
+ interface declarations from ntpd.h to new ntp_intres.h.
+ Add lib/isc/win32/include/isc/mutex.h reference.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.38 +4 -1031
+ Move blocking worker and intres from ntpd to libntp.
+ Add refclock_wwv.c reference.
+
+ sntp/Makefile.am@1.53 +50 -16
+ Enable pthreads build.
+ Link against the smaller libevent_core.la which suits us since sntp
+ no longer uses evdns.
+ Use NTP_LIBEVENT m4sh macro to decide between installed and tearoff
+ libevent.
+
+ sntp/configure.ac@1.57 +12 -96
+ Split up ntp_lib.m4 into smaller, more specific subsets
+ Remove duplicate clock_gettime/clock_settime logic now in ntp_libntp.m4.
+ Bump config.cache version stamps to account for cache-incompatible change
+ to librt detection.
+ Use NTP_LIBEVENT m4sh macro to decide between installed and tearoff
+ libevent.
+ Move more m4 code needed by libntp to sntp/m4/*.m4 from top-level configure.ac
+
+ sntp/deps-ver@1.3 +1 -1
+ bump deps-ver to avoid build breaks from moved source files.
+
+ sntp/kod_management.c@1.26 +29 -15
+ Do not write_kod_db() work atexit in forked children.
+ Move "can't write KoD file" warning from sntp shutdown to startup.
+ Use pthreads for blocking worker rather than fork, if possible.
+ Add readonly arg to kod_init_kod_db() for tests
+
+ sntp/kod_management.h@1.10 +3 -2
+ Move "can't write KoD file" warning from sntp shutdown to startup.
+ Add readonly arg to kod_init_kod_db() for tests.
+
+ sntp/libevent/Makefile.am@1.2 +14 -6
+ make -lz depend on zlib.h
+ We always need the PTHREADS AM_CONDITIONAL. Use the OL check.
+
+ sntp/libevent/WIN32-Code/event2/event-config.h@1.2 +2 -2
+ libevent upgrade
+
+ sntp/libevent/arc4random.c@1.2 +5 -1
+ update from upstream
+
+ sntp/libevent/configure.in@1.2 +137 -33
+ Attempt typical subpackage approach for libevent
+ IPv6 hackery
+ Update from upstream.
+ make -lz depend on zlib.h
+ Allow libevent's regress to be skipped in make check.
+ Detect gcc (ld) support for --gc-sections and use it if available along
+ with --fdata-sections and -ffunction-sections to omit unused code and
+ data.
+ Add openldap thread check, remove ACX_PTHREAD
+ upstream patch to quiet autoreconf warnings
+ http://levent.git.sourceforge.net/git/gitweb.cgi?p=levent/libevent;a=commit;h=f663112fa238a3f5a1bdfddfd26c17e625e182df
+ We always need the PTHREADS AM_CONDITIONAL. Use the OL check.
+
+ sntp/libevent/evdns.c@1.2 +4 -0
+ libevent upgrade
+
+ sntp/libevent/evport.c@1.2 +6 -0
+ libevent upgrade
+
+ sntp/libevent/evthread_pthread.c@1.2 +13 -1
+ Work with very first draft posix M:N threads on HP-UX 10.20
+
+ sntp/libevent/evutil.c@1.2 +44 -3
+ IPv6 hackery.
+ libevent upgrade.
+
+ sntp/libevent/http.c@1.2 +47 -6
+ libevent upgrade.
+
+ sntp/libevent/ipv6-internal.h@1.2 +9 -0
+ libevent upgrade
+
+ sntp/libevent/m4/LICENSE-OPENLDAP@1.1 +47 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent-subpkg/sntp/m4/LICENSE-OPENLDAP
+
+ sntp/libevent/m4/LICENSE-OPENLDAP@1.0 +0 -0
+
+ sntp/libevent/m4/openldap-thread-check.m4@1.1 +681 -0
+ AC_LANG update for openldap autoconf macros
+ Clean up AC_DEFINE and AC_DEFINE_UNQUOTED arg quoting.
+ preset ol_with_yielding_select=${ol_with_yielding_select-auto}
+ Also change tests to use x prefix as insurance against other issues.
+ Move PTHREAD_LIBS AC_SUBST to ntp_libntp.m4
+
+ sntp/libevent/m4/openldap-thread-check.m4@1.0 +0 -0
+
+ sntp/libevent/m4/openldap.m4@1.1 +1131 -0
+ AC_LANG_SOURCE: unknown language: _AC_LANG on 588
+ Clean up AC_DEFINE and AC_DEFINE_UNQUOTED arg quoting.
+
+ sntp/libevent/m4/openldap.m4@1.0 +0 -0
+
+ sntp/libevent/sample/Makefile.am@1.2 +1 -1
+ Detect gcc (ld) support for --gc-sections and use it if available along
+ with --fdata-sections and -ffunction-sections to omit unused code and
+ data.
+
+ sntp/libevent/sample/dns-example.c@1.2 +2 -0
+ libevent upgrade
+
+ sntp/libevent/sample/hello-world.c@1.2 +3 -0
+ hp-ux portability fix.
+
+ sntp/libevent/sample/http-server.c@1.2 +7 -0
+ libevent upgrade
+ portability
+
+ sntp/libevent/select.c@1.2 +27 -9
+ libevent upgrade
+
+ sntp/libevent/test/Makefile.am@1.2 +13 -8
+ Allow libevent's regress to be skipped in make check.
+ Detect gcc (ld) support for --gc-sections and use it if available along
+ with --fdata-sections and -ffunction-sections to omit unused code and
+ data.
+
+ sntp/libevent/test/bench_httpclient.c@1.2 +3 -0
+ portability
+
+ sntp/libevent/test/regress_dns.c@1.2 +2 -0
+ cleanup
+
+ sntp/libevent/test/regress_http.c@1.2 +5 -21
+ libevent upgrade
+
+ sntp/libevent/test/regress_listener.c@1.2 +3 -0
+ cleanup
+
+ sntp/libevent/test/regress_testutils.c@1.2 +2 -0
+ libevent upgrade
+
+
+ sntp/libevent/test/test-eof.c@1.2 +9 -3
+ Add a timeout for test-eof.c as it may hang under HP-UX 10.20.
+
+
+ sntp/libevent/test/test-ratelim.c@1.2 +5 -0
+ cleanup
+
+ sntp/libevent/test/test.sh@1.2 +10 -4
+ Allow libevent's regress to be skipped in make check.
+
+ sntp/libevent/util-internal.h@1.2 +23 -2
+ update
+ ---
+ libevent upgrade
+
+ sntp/log.c@1.20 +6 -10
+ Rename init_logging() to sntp_init_logging() to avoid libntp conflict.
+ Use msyslog common code relocated from ntpd.
+
+ sntp/log.h@1.11 +3 -1
+ Rename init_logging() to sntp_init_logging() to avoid libntp conflict.
+ Use msyslog common code relocated from ntpd.
+ Declare extern char *progname.
+
+ sntp/m4/ntp_bindir.m4@1.1 +31 -0
+ Split up ntp_lib.m4 into smaller, more specific subsets.
+
+ sntp/m4/ntp_bindir.m4@1.0 +0 -0
+
+ sntp/m4/ntp_cacheversion.m4@1.12 +11 -9
+ Attempt to make better use of header comment space.
+
+ sntp/m4/ntp_compiler.m4@1.1 +124 -0
+ Split up ntp_lib.m4 into smaller, more specific subsets.
+ Omit unused code with gcc and gnu LD of recent vintage.
+ Ask autoconf for c89 only, AC_PROG_CC_STDC now means c99.
+
+ sntp/m4/ntp_compiler.m4@1.0 +0 -0
+
+ sntp/m4/ntp_crosscompile.m4@1.1 +8 -0
+ Split up ntp_lib.m4 into smaller, more specific subsets.
+
+ sntp/m4/ntp_crosscompile.m4@1.0 +0 -0
+
+ sntp/m4/ntp_debug.m4@1.1 +22 -0
+ Split up ntp_lib.m4 into smaller, more specific subsets.
+
+ sntp/m4/ntp_debug.m4@1.0 +0 -0
+
+ sntp/m4/ntp_ipv6.m4@1.2 +127 -112
+ Strip unneeded checks from ntp_ipv6.m4:
+ for struct sockaddr_storage member ss_family
+ for struct sockaddr_storage member ss_len
+ for struct sockaddr_storage member __ss_len
+ Move things used by libntp from top-level configure.ac to NTP_IPV6
+
+ sntp/m4/ntp_libevent.m4@1.3 +82 -35
+ Use NTP_LIBEVENT m4sh macro to decide between installed and tearoff
+ libevent.
+ Remove contentious libevent-cfg sentinel files, modify libevent's
+ confgure args via $ac_configure_args.
+
+ sntp/m4/ntp_libntp.m4@1.4 +753 -156
+ Split up ntp_lib.m4 into smaller, more specific subsets.
+ Move AC_FUNC_FORK and AC_FUNC_ALLOCA to ntp_libntp.m4 along with move
+ of intres/blocking worker to libntp.
+ Move droproot configure test to libntp with intres.
+ Enable pthreads build.
+ crib some pthread m4 from BIND for libisc
+ move clock_gettime/clock_settime earlier within NTP_LIBNTP
+ check for socketpair()
+ Move more m4 code needed by libntp to sntp/m4/*.m4 from top-level configure.ac
+
+ sntp/m4/ntp_sntp.m4@1.1 +29 -0
+ Split up ntp_lib.m4 into smaller, more specific subsets.
+
+ sntp/m4/ntp_sntp.m4@1.0 +0 -0
+
+ sntp/main.c@1.68 +820 -313
+ Use {step,adj}_systime from libntp. Use EX_* codes for exit status.
+ Switch sntp from evdns to blocking worker intres.
+ Make delay between queries to addresses resolved from same hostname
+ per-family in sntp, as ntpd won't consider our v4 and v6 source
+ addresses to be one remote rate-limit target.
+ use ntpOptionProcess() to get verbose --version output.
+ Use libevent log callback to redirect messages from stderr to msyslog()
+ enable libevent debug mode if sntp debug > 0
+ Issue a single read event for each socket, rather than one per query.
+ Do not attempt to read in socket callback for EV_TIMEOUT.
+ Be conservative in KoD response claim
+ Fix step/slew logic in sntp
+ sntp --headroom option (default 10ms) spaces queries.
+ Provide less-broken gettimeofday_cached()
+ Add support for --(no-)wait and -uctimeout
+ remove duplicate progname declaration (log.c has it).
+ add readonly arg to kod_init_kod_db() for tests
+ Use socketpair() instead of pipe() when available, as avoiding
+ EV_FEATURE_FDS allows libevent to use a faster backend on
+ systems like Linux without an O(1) backend that handles pipes.
+
+ sntp/main.h@1.6 +18 -16
+ Switch sntp from evdns to blocking worker intres.
+ More -Wcast-align warnings workarounds.
+
+ sntp/networking.c@1.57 +36 -51
+ Authentication and debug cleanup.
+ remove recvpkt(), its two parts now done separately in sock_cb()
+ Quiet -Wcast-align warnings.
+
+ sntp/networking.h@1.25 +7 -8
+ Quiet -Wcast-align warnings.
+
+ sntp/sntp-opts.c@1.124 +499 -145
+ generated file updates from sntp def file changes
+
+ sntp/sntp-opts.def@1.25 +51 -11
+ generated file updates from sntp def file changes
+
+ sntp/sntp-opts.h@1.124 +135 -68
+ generated file updates from sntp def file changes
+
+ sntp/sntp-opts.texi@1.124 +168 -88
+ generated file updates from sntp def file changes
+
+ sntp/sntp.1@1.124 +135 -60
+ generated file updates from sntp def file changes
+
+ sntp/sntp.html@1.124 +95 -30
+ generated file updates from sntp def file changes
+
+ sntp/tests/Makefile.am@1.20 +54 -45
+ Enable pthreads build.
+ Link against the smaller libevent_core.la which suits us since sntp
+ no longer uses evdns.
+ Use NTP_LIBEVENT m4sh macro to decide between installed and tearoff
+ libevent.
+ Pick up -lresolv from @LDADD_LIBNTP@,
+
+ sntp/tests/kodDatabase.cpp@1.3 +1 -1
+ Add readonly arg to kod_init_kod_db() for tests.
+
+ sntp/tests/kodFile.cpp@1.8 +3 -11
+ Add readonly arg to kod_init_kod_db() for tests -- prevents editing
+ test baseline input KoD files during make check.
+
+ sntp/tests/nameresolution.cpp@1.1 +171 -0
+ Move name resolution unit test code to nameresolution.cpp.
+
+ sntp/tests/nameresolution.cpp@1.0 +0 -0
+
+ sntp/tests/networking.cpp@1.8 +0 -166
+ Move name resolution unit test code to nameresolution.cpp.
+
+ sntp/tests/packetHandling.cpp@1.7 +58 -46
+ Change handle_pkt() args to include hostname.
+ Add readonly arg to kod_init_kod_db() for tests.
+
+ sntp/utilities.c@1.16 +5 -5
+ const-ify addrinfo_to_str()
+
+ sntp/utilities.h@1.10 +1 -1
+ const-ify addrinfo_to_str()
+
+ tests/libntp/Makefile.am@1.30.1.1 +8 -6
+ Enable pthreads build.
+
+ tests/libntp/clocktime.cpp@1.4 +19 -7
+ Reduce runtime of AlwaysInLimit by an order of magnitude.
+
+ util/Makefile.am@1.56 +9 -7
+ Enable pthreads build.
+ correct cut-n-paste reference to ntpq_OBJECTS, make $(PROGRAMS) depend
+ on version.o.
+
+ util/ntp-keygen.c@1.77 +0 -1
+ JAN_1970 definition provided by ntp_unixtime.h now
+
+ChangeSet@1.2422.1.61, 2011-02-19 03:29:55+00:00, davehart@shiny.ad.hartbrothers.com
+ Add INC_ALIGNED_PTR() macro to align pointers like malloc().
+
+ ChangeLog@1.784.1.21 +1 -0
+ Add INC_ALIGNED_PTR() macro to align pointers like malloc().
+
+ include/ntp_types.h@1.23 +26 -0
+ Add INC_ALIGNED_PTR() macro to align pointers like malloc().
+
+ ntpd/ntp_crypto.c@1.154 +16 -9
+ strdup() -> estrdup()
+
+ ntpd/ntp_proto.c@1.319 +11 -10
+ Add INC_ALIGNED_PTR() macro to align pointers like malloc().
+
+ ntpd/refclock_as2201.c@1.14 +2 -2
+ Use memcpy() after bounds check instead of strcpy().
+ Correct a different bounds check that was off by one.
+
+ sntp/tests_main.h@1.7 +3 -2
+ #include config.h before all others, system before lib/app.
+
+ChangeSet@1.2422.1.60, 2011-02-12 11:07:51+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P130
+ TAG: NTP_4_2_7P130
+
+ ChangeLog@1.784.1.20 +1 -0
+ NTP_4_2_7P130
+
+ clockstuff/clktest-opts.c@1.54 +2 -2
+ NTP_4_2_7P130
+
+ clockstuff/clktest-opts.h@1.54 +3 -3
+ NTP_4_2_7P130
+
+ ntpd/ntpd-opts.c@1.134 +2 -2
+ NTP_4_2_7P130
+
+ ntpd/ntpd-opts.h@1.134 +3 -3
+ NTP_4_2_7P130
+
+ ntpd/ntpd-opts.texi@1.132 +2 -2
+ NTP_4_2_7P130
+
+ ntpd/ntpd.1@1.132 +2 -2
+ NTP_4_2_7P130
+
+ ntpdc/ntpdc-opts.c@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpdc/ntpdc-opts.h@1.131 +3 -3
+ NTP_4_2_7P130
+
+ ntpdc/ntpdc-opts.texi@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpdc/ntpdc.1@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpq/ntpq-opts.c@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpq/ntpq-opts.h@1.131 +3 -3
+ NTP_4_2_7P130
+
+ ntpq/ntpq-opts.texi@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpq/ntpq.1@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.131 +3 -3
+ NTP_4_2_7P130
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.131 +2 -2
+ NTP_4_2_7P130
+
+ ntpsnmpd/ntpsnmpd.1@1.131 +2 -2
+ NTP_4_2_7P130
+
+ packageinfo.sh@1.132 +1 -1
+ NTP_4_2_7P130
+
+ sntp/sntp-opts.c@1.115.1.16 +2 -2
+ NTP_4_2_7P130
+
+ sntp/sntp-opts.h@1.115.1.16 +3 -3
+ NTP_4_2_7P130
+
+ sntp/sntp-opts.texi@1.115.1.16 +2 -2
+ NTP_4_2_7P130
+
+ sntp/sntp.1@1.115.1.16 +2 -2
+ NTP_4_2_7P130
+
+ sntp/sntp.html@1.115.1.16 +1 -1
+ NTP_4_2_7P130
+
+ util/ntp-keygen-opts.c@1.129 +2 -2
+ NTP_4_2_7P130
+
+ util/ntp-keygen-opts.h@1.129 +3 -3
+ NTP_4_2_7P130
+
+ util/ntp-keygen-opts.texi@1.132 +2 -2
+ NTP_4_2_7P130
+
+ util/ntp-keygen.1@1.132 +2 -2
+ NTP_4_2_7P130
+
+ChangeSet@1.2422.1.59, 2011-02-11 07:26:12-05:00, stenn@deacon.udel.edu
+ [Bug 1811] Update the download location in WHERE-TO-START
+
+ ChangeLog@1.784.1.19 +1 -0
+ [Bug 1811] Update the download location in WHERE-TO-START
+
+ WHERE-TO-START@1.9 +2 -1
+ [Bug 1811] Update the download location in WHERE-TO-START
+
+ChangeSet@1.2422.1.58, 2011-02-09 08:55:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P129
+ TAG: NTP_4_2_7P129
+
+ ChangeLog@1.784.1.18 +1 -0
+ NTP_4_2_7P129
+
+ clockstuff/clktest-opts.c@1.53 +2 -2
+ NTP_4_2_7P129
+
+ clockstuff/clktest-opts.h@1.53 +3 -3
+ NTP_4_2_7P129
+
+ ntpd/ntpd-opts.c@1.133 +2 -2
+ NTP_4_2_7P129
+
+ ntpd/ntpd-opts.h@1.133 +3 -3
+ NTP_4_2_7P129
+
+ ntpd/ntpd-opts.texi@1.131 +2 -2
+ NTP_4_2_7P129
+
+ ntpd/ntpd.1@1.131 +2 -2
+ NTP_4_2_7P129
+
+ ntpdc/ntpdc-opts.c@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpdc/ntpdc-opts.h@1.130 +3 -3
+ NTP_4_2_7P129
+
+ ntpdc/ntpdc-opts.texi@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpdc/ntpdc.1@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpq/ntpq-opts.c@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpq/ntpq-opts.h@1.130 +3 -3
+ NTP_4_2_7P129
+
+ ntpq/ntpq-opts.texi@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpq/ntpq.1@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.130 +3 -3
+ NTP_4_2_7P129
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.130 +2 -2
+ NTP_4_2_7P129
+
+ ntpsnmpd/ntpsnmpd.1@1.130 +2 -2
+ NTP_4_2_7P129
+
+ packageinfo.sh@1.131 +1 -1
+ NTP_4_2_7P129
+
+ sntp/sntp-opts.c@1.115.1.15 +2 -2
+ NTP_4_2_7P129
+
+ sntp/sntp-opts.h@1.115.1.15 +3 -3
+ NTP_4_2_7P129
+
+ sntp/sntp-opts.texi@1.115.1.15 +2 -2
+ NTP_4_2_7P129
+
+ sntp/sntp.1@1.115.1.15 +2 -2
+ NTP_4_2_7P129
+
+ sntp/sntp.html@1.115.1.15 +1 -1
+ NTP_4_2_7P129
+
+ util/ntp-keygen-opts.c@1.128 +2 -2
+ NTP_4_2_7P129
+
+ util/ntp-keygen-opts.h@1.128 +3 -3
+ NTP_4_2_7P129
+
+ util/ntp-keygen-opts.texi@1.131 +2 -2
+ NTP_4_2_7P129
+
+ util/ntp-keygen.1@1.131 +2 -2
+ NTP_4_2_7P129
+
+ChangeSet@1.2422.1.57, 2011-02-09 07:14:49+00:00, davehart@shiny.ad.hartbrothers.com
+ Add missing "break;" to ntp_control.c ctl_putsys() for caliberrs, used
+ by ntpq -c kerninfo introduced in 4.2.7p104.
+ Fix leak in ntp_control.c read_mru_list().
+
+ ChangeLog@1.784.1.17 +3 -0
+ Add missing "break;" to ntp_control.c ctl_putsys() for caliberrs, used
+ by ntpq -c kerninfo introduced in 4.2.7p104.
+ Fix leak in ntp_control.c read_mru_list().
+
+ include/ntp_assert.h@1.5 +7 -1
+ Attempt allowing Coverity to analyze our actual assertion paths.
+
+ include/ntp_lists.h@1.9 +4 -19
+ Correct bug in LINK_SORT_SLIST() with an empty list.
+
+ ntpd/ntp_control.c@1.162 +5 -2
+ Fix leak in ntp_control.c read_mru_list().
+ Add missing "break;" to ntp_control.c ctl_putsys() for caliberrs, used
+ by ntpq -c kerninfo introduced in 4.2.7p104.
+
+
+ ntpd/ntp_io.c@1.346.1.1 +5 -0
+ Do not attempt setsockopt() for unopened -1 descriptors.
+
+ ntpd/ntp_monitor.c@1.38 +4 -2
+ Add debug-only assertion of non-NULL argument to mon_reclaim_entry().
+
+ChangeSet@1.2422.1.56, 2011-01-30 11:40:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P128
+ TAG: NTP_4_2_7P128
+
+ ChangeLog@1.784.1.16 +1 -0
+ NTP_4_2_7P128
+
+ clockstuff/clktest-opts.c@1.52 +2 -2
+ NTP_4_2_7P128
+
+ clockstuff/clktest-opts.h@1.52 +3 -3
+ NTP_4_2_7P128
+
+ ntpd/ntpd-opts.c@1.132 +2 -2
+ NTP_4_2_7P128
+
+ ntpd/ntpd-opts.h@1.132 +3 -3
+ NTP_4_2_7P128
+
+ ntpd/ntpd-opts.texi@1.130 +2 -2
+ NTP_4_2_7P128
+
+ ntpd/ntpd.1@1.130 +2 -2
+ NTP_4_2_7P128
+
+ ntpdc/ntpdc-opts.c@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpdc/ntpdc-opts.h@1.129 +3 -3
+ NTP_4_2_7P128
+
+ ntpdc/ntpdc-opts.texi@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpdc/ntpdc.1@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpq/ntpq-opts.c@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpq/ntpq-opts.h@1.129 +3 -3
+ NTP_4_2_7P128
+
+ ntpq/ntpq-opts.texi@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpq/ntpq.1@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.129 +3 -3
+ NTP_4_2_7P128
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.129 +2 -2
+ NTP_4_2_7P128
+
+ ntpsnmpd/ntpsnmpd.1@1.129 +2 -2
+ NTP_4_2_7P128
+
+ packageinfo.sh@1.130 +1 -1
+ NTP_4_2_7P128
+
+ sntp/sntp-opts.c@1.115.1.14 +2 -2
+ NTP_4_2_7P128
+
+ sntp/sntp-opts.h@1.115.1.14 +3 -3
+ NTP_4_2_7P128
+
+ sntp/sntp-opts.texi@1.115.1.14 +2 -2
+ NTP_4_2_7P128
+
+ sntp/sntp.1@1.115.1.14 +2 -2
+ NTP_4_2_7P128
+
+ sntp/sntp.html@1.115.1.14 +1 -1
+ NTP_4_2_7P128
+
+ util/ntp-keygen-opts.c@1.127 +2 -2
+ NTP_4_2_7P128
+
+ util/ntp-keygen-opts.h@1.127 +3 -3
+ NTP_4_2_7P128
+
+ util/ntp-keygen-opts.texi@1.130 +2 -2
+ NTP_4_2_7P128
+
+ util/ntp-keygen.1@1.130 +2 -2
+ NTP_4_2_7P128
+
+ChangeSet@1.2422.1.55, 2011-01-29 23:06:16+00:00, davehart@shiny.ad.hartbrothers.com
+ * [Bug 1799] ntpq mrv crash.
+ * [Bug 1801] ntpq mreadvar requires prior association caching.
+
+ ChangeLog@1.784.1.15 +3 -1
+ * [Bug 1799] ntpq mrv crash.
+ * [Bug 1801] ntpq mreadvar requires prior association caching.
+ Correct p126 ChangeLog entry to refer to format_time_fraction().
+
+ ntpq/ntpq-subs.c@1.84 +26 -19
+ * [Bug 1799] ntpq mrv crash.
+ * [Bug 1801] ntpq mreadvar requires prior association caching.
+
+ChangeSet@1.2422.1.54, 2011-01-28 06:31:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P127
+ TAG: NTP_4_2_7P127
+
+ ChangeLog@1.784.1.14 +1 -0
+ NTP_4_2_7P127
+
+ clockstuff/clktest-opts.c@1.51 +2 -2
+ NTP_4_2_7P127
+
+ clockstuff/clktest-opts.h@1.51 +3 -3
+ NTP_4_2_7P127
+
+ ntpd/ntpd-opts.c@1.131 +2 -2
+ NTP_4_2_7P127
+
+ ntpd/ntpd-opts.h@1.131 +3 -3
+ NTP_4_2_7P127
+
+ ntpd/ntpd-opts.texi@1.129 +2 -2
+ NTP_4_2_7P127
+
+ ntpd/ntpd.1@1.129 +2 -2
+ NTP_4_2_7P127
+
+ ntpdc/ntpdc-opts.c@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpdc/ntpdc-opts.h@1.128 +3 -3
+ NTP_4_2_7P127
+
+ ntpdc/ntpdc-opts.texi@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpdc/ntpdc.1@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpq/ntpq-opts.c@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpq/ntpq-opts.h@1.128 +3 -3
+ NTP_4_2_7P127
+
+ ntpq/ntpq-opts.texi@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpq/ntpq.1@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.128 +3 -3
+ NTP_4_2_7P127
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.128 +2 -2
+ NTP_4_2_7P127
+
+ ntpsnmpd/ntpsnmpd.1@1.128 +2 -2
+ NTP_4_2_7P127
+
+ packageinfo.sh@1.129 +1 -1
+ NTP_4_2_7P127
+
+ sntp/sntp-opts.c@1.115.1.13 +2 -2
+ NTP_4_2_7P127
+
+ sntp/sntp-opts.h@1.115.1.13 +3 -3
+ NTP_4_2_7P127
+
+ sntp/sntp-opts.texi@1.115.1.13 +2 -2
+ NTP_4_2_7P127
+
+ sntp/sntp.1@1.115.1.13 +2 -2
+ NTP_4_2_7P127
+
+ sntp/sntp.html@1.115.1.13 +1 -1
+ NTP_4_2_7P127
+
+ util/ntp-keygen-opts.c@1.126 +2 -2
+ NTP_4_2_7P127
+
+ util/ntp-keygen-opts.h@1.126 +3 -3
+ NTP_4_2_7P127
+
+ util/ntp-keygen-opts.texi@1.129 +2 -2
+ NTP_4_2_7P127
+
+ util/ntp-keygen.1@1.129 +2 -2
+ NTP_4_2_7P127
+
+ChangeSet@1.2422.1.53, 2011-01-28 01:07:13-05:00, stenn@deacon.udel.edu
+ [Bug 1797] Restore stale timestamp check from the RANGEGATE cleanup
+
+ ChangeLog@1.784.1.13 +1 -0
+ [Bug 1797] Restore stale timestamp check from the RANGEGATE cleanup
+
+ ntpd/ntp_refclock.c@1.103 +3 -0
+ [Bug 1797] Restore stale timestamp check from the RANGEGATE cleanup
+
+ChangeSet@1.2422.1.52, 2011-01-27 10:28:37+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P126
+ TAG: NTP_4_2_7P126
+
+ ChangeLog@1.784.1.12 +1 -0
+ NTP_4_2_7P126
+
+ clockstuff/clktest-opts.c@1.50 +2 -2
+ NTP_4_2_7P126
+
+ clockstuff/clktest-opts.h@1.50 +3 -3
+ NTP_4_2_7P126
+
+ ntpd/ntpd-opts.c@1.130 +2 -2
+ NTP_4_2_7P126
+
+ ntpd/ntpd-opts.h@1.130 +3 -3
+ NTP_4_2_7P126
+
+ ntpd/ntpd-opts.texi@1.128 +2 -2
+ NTP_4_2_7P126
+
+ ntpd/ntpd.1@1.128 +2 -2
+ NTP_4_2_7P126
+
+ ntpdc/ntpdc-opts.c@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpdc/ntpdc-opts.h@1.127 +3 -3
+ NTP_4_2_7P126
+
+ ntpdc/ntpdc-opts.texi@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpdc/ntpdc.1@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpq/ntpq-opts.c@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpq/ntpq-opts.h@1.127 +3 -3
+ NTP_4_2_7P126
+
+ ntpq/ntpq-opts.texi@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpq/ntpq.1@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.127 +3 -3
+ NTP_4_2_7P126
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.127 +2 -2
+ NTP_4_2_7P126
+
+ ntpsnmpd/ntpsnmpd.1@1.127 +2 -2
+ NTP_4_2_7P126
+
+ packageinfo.sh@1.128 +1 -1
+ NTP_4_2_7P126
+
+ sntp/sntp-opts.c@1.115.1.12 +2 -2
+ NTP_4_2_7P126
+
+ sntp/sntp-opts.h@1.115.1.12 +3 -3
+ NTP_4_2_7P126
+
+ sntp/sntp-opts.texi@1.115.1.12 +2 -2
+ NTP_4_2_7P126
+
+ sntp/sntp.1@1.115.1.12 +2 -2
+ NTP_4_2_7P126
+
+ sntp/sntp.html@1.115.1.12 +1 -1
+ NTP_4_2_7P126
+
+ util/ntp-keygen-opts.c@1.125 +2 -2
+ NTP_4_2_7P126
+
+ util/ntp-keygen-opts.h@1.125 +3 -3
+ NTP_4_2_7P126
+
+ util/ntp-keygen-opts.texi@1.128 +2 -2
+ NTP_4_2_7P126
+
+ util/ntp-keygen.1@1.128 +2 -2
+ NTP_4_2_7P126
+
+ChangeSet@1.2422.1.51, 2011-01-27 01:38:59-05:00, stenn@deacon.udel.edu
+ Add entries for updates from Dave Hart
+
+ ChangeLog@1.784.1.11 +2 -0
+ Add entries for updates from Dave Hart
+
+ChangeSet@1.2422.9.3, 2011-01-26 19:39:27+00:00, davehart@shiny.ad.hartbrothers.com
+ silence signed overflow warning
+ mark isc_assertioncallback_t __attribute((__noreturn__))
+
+ include/ntp_stdlib.h@1.58 +9 -6
+ add __attribute((__noreturn__)) to __attribute__ compat header snippet.
+
+ lib/isc/assertions.c@1.5 +2 -1
+ mark default_callback() __attribute__ ((__noreturn__))
+
+ lib/isc/include/isc/assertions.h@1.5 +21 -1
+ Mark isc_assertioncallback_t __attribute((__noreturn__))
+
+ libntp/timetoa.c@1.4 +18 -16
+ silence warning from recent gcc:
+ libntp/timetoa.c:53:1: warning: assuming signed overflow does not occur when simplifying conditional to constant
+
+ ntpd/ntpd.c@1.122 +2 -1
+ mark assertion_failed() __attribute__ ((__noreturn__))
+
+ChangeSet@1.2422.9.2, 2011-01-26 17:03:48+00:00, davehart@shiny.ad.hartbrothers.com
+ Rename tests/libntp/t{val|spec}ops.cpp to time{val|spec}ops.cpp so
+ base filename matches tested source file, as with others.
+
+ tests/libntp/Makefile.am@1.33 +2 -2
+ Rename tests/libntp/t{val|spec}ops.cpp to time{val|spec}ops.cpp so
+ base filename matches tested source file, as with others.
+
+ tests/libntp/timespecops.cpp@1.6 +0 -0
+ Rename: tests/libntp/tspecops.cpp -> tests/libntp/timespecops.cpp
+
+ tests/libntp/timevalops.cpp@1.6 +0 -0
+ Rename: tests/libntp/tvalops.cpp -> tests/libntp/timevalops.cpp
+
+ChangeSet@1.2422.9.1, 2011-01-26 16:50:03+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix off-by-one bug in format_time_fraction() introduced by hart@ntp.org.
+ Remove abs(prec) <= 9 requirement from format_time_fraction().
+ Add more time{spec|val}_tostr() tests.
+
+ include/timetoa.h@1.3 +3 -5
+ remove abs(prec) <= 9 limitation from format_time_fraction()
+
+ libntp/timetoa.c@1.3 +18 -26
+ remove abs(prec) <= 9 limitation from format_time_fraction().
+ calculate fraclimit from prec rather than use powers of ten lookup table.
+ fixes off-by-one bug introduced by hart@ntp.org (COUNTOF(limit) should have
+ been COUNTOF(limit) - 1).
+
+ tests/libntp/tspecops.cpp@1.5 +3 -1
+ add more timespec_tostr() tests
+
+ tests/libntp/tvalops.cpp@1.5 +3 -1
+ add more timeval_tostr() tests
+
+ChangeSet@1.2422.1.49, 2011-01-26 10:31:57+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P125
+ TAG: NTP_4_2_7P125
+
+ ChangeLog@1.784.1.10 +1 -0
+ NTP_4_2_7P125
+
+ clockstuff/clktest-opts.c@1.49 +2 -2
+ NTP_4_2_7P125
+
+ clockstuff/clktest-opts.h@1.49 +3 -3
+ NTP_4_2_7P125
+
+ ntpd/ntpd-opts.c@1.129 +2 -2
+ NTP_4_2_7P125
+
+ ntpd/ntpd-opts.h@1.129 +3 -3
+ NTP_4_2_7P125
+
+ ntpd/ntpd-opts.texi@1.127 +2 -2
+ NTP_4_2_7P125
+
+ ntpd/ntpd.1@1.127 +2 -2
+ NTP_4_2_7P125
+
+ ntpdc/ntpdc-opts.c@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpdc/ntpdc-opts.h@1.126 +3 -3
+ NTP_4_2_7P125
+
+ ntpdc/ntpdc-opts.texi@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpdc/ntpdc.1@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpq/ntpq-opts.c@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpq/ntpq-opts.h@1.126 +3 -3
+ NTP_4_2_7P125
+
+ ntpq/ntpq-opts.texi@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpq/ntpq.1@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.126 +3 -3
+ NTP_4_2_7P125
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.126 +2 -2
+ NTP_4_2_7P125
+
+ ntpsnmpd/ntpsnmpd.1@1.126 +2 -2
+ NTP_4_2_7P125
+
+ packageinfo.sh@1.127 +1 -1
+ NTP_4_2_7P125
+
+ sntp/sntp-opts.c@1.115.1.11 +2 -2
+ NTP_4_2_7P125
+
+ sntp/sntp-opts.h@1.115.1.11 +3 -3
+ NTP_4_2_7P125
+
+ sntp/sntp-opts.texi@1.115.1.11 +2 -2
+ NTP_4_2_7P125
+
+ sntp/sntp.1@1.115.1.11 +2 -2
+ NTP_4_2_7P125
+
+ sntp/sntp.html@1.115.1.11 +1 -1
+ NTP_4_2_7P125
+
+ util/ntp-keygen-opts.c@1.124 +2 -2
+ NTP_4_2_7P125
+
+ util/ntp-keygen-opts.h@1.124 +3 -3
+ NTP_4_2_7P125
+
+ util/ntp-keygen-opts.texi@1.127 +2 -2
+ NTP_4_2_7P125
+
+ util/ntp-keygen.1@1.127 +2 -2
+ NTP_4_2_7P125
+
+ChangeSet@1.2422.8.3, 2011-01-26 03:07:53+00:00, davehart@shiny.ad.hartbrothers.com
+ Add new files to Windows build.
+ Fix make distcheck by distributing include/timetoa.h and
+ tests/libntp/timestructs.h
+
+ include/Makefile.am@1.45 +1 -0
+ distribute include/timetoa.h
+
+ include/timetoa.h@1.2 +0 -1
+ config.h should be included only once, first, by each .c file
+
+ libntp/timetoa.c@1.2 +21 -18
+ nonfunctional style cleanup
+
+ ports/winnt/vc6/libntp.dsp@1.60 +4 -0
+ add libntp/timetoa.c reference
+
+ ports/winnt/vs2003/libntp.vcproj@1.18 +5 -2
+ add libntp/timetoa.c reference
+
+ ports/winnt/vs2005/libntp.vcproj@1.16 +4 -0
+ add libntp/timetoa.c reference
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.37 +10 -2
+ add libntp/timetoa.c, include/timetoa.h references
+
+ tests/libntp/Makefile.am@1.32 +5 -2
+ distribute tests/libntp/timestructs.h
+
+ChangeSet@1.2422.8.2, 2011-01-25 22:04:11+01:00, jnperlin@hydra.localnet
+ fixed cut&paste error in tests/libntp/tvalops.cpp
+
+ tests/libntp/tvalops.cpp@1.4 +1 -1
+ fixed cut&paste error
+
+ChangeSet@1.2422.7.1, 2011-01-25 21:08:29+01:00, jnperlin@hydra.localnet
+ Refactoring of struct timeval string conversion, extended regression tests for struct timeval processing
+
+ include/timespecops.h@1.4 +1 -1
+ cleaner expression for normality test (leave optimisation to the optimiser)
+
+ include/timetoa.h@1.1 +85 -0
+ new module for string conversion of time_t related values
+
+ include/timetoa.h@1.0 +0 -0
+
+ include/timevalops.h@1.3 +1 -1
+ cleaner expression for normality test (leave optimisation to the optimiser)
+
+ libntp/Makefile.am@1.59 +1 -0
+ new module for string conversion of time_t related values
+
+ libntp/timetoa.c@1.1 +112 -0
+ new module for string conversion of time_t related values
+
+ libntp/timetoa.c@1.0 +0 -0
+
+ libntp/timevalops.c@1.6 +4 -58
+ moved string formatting stuff to 'timetoa.c'
+
+ tests/libntp/Makefile.am@1.31 +1 -0
+ timestruct.cpp added
+
+ tests/libntp/timestructs.cpp@1.1 +127 -0
+ new module for adapting / testing time-related structures (l_fp, struct timeval, struct timespec)
+
+ tests/libntp/timestructs.cpp@1.0 +0 -0
+
+ tests/libntp/timestructs.h@1.1 +159 -0
+ new module for adapting / testing time-related structures (l_fp, struct timeval, struct timespec)
+
+ tests/libntp/timestructs.h@1.0 +0 -0
+
+ tests/libntp/tvalops.cpp@1.3 +162 -141
+ moved useful code to timestructs.{h,cpp};
+ closeness of l_fp and timeval values tested by special predicate objects;
+ added some roundtrip tests;
+
+
+ChangeSet@1.2422.1.47, 2011-01-25 19:25:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1794] ntpq -c rv missing clk_wander information.
+ [Bug 1795] ntpq readvar does not display last variable.
+ bk rm libntp/tvtoa.c libntp/utvtoa.c
+ Thanks to Pearly for noticing these dead, nondistributed files in
+ the version control system.
+
+ BitKeeper/deleted/4a/tvtoa.c~3aed0663@1.5 +0 -0
+ Delete: libntp/tvtoa.c
+
+ BitKeeper/deleted/ee/utvtoa.c~3aed0663@1.5 +0 -0
+ Delete: libntp/utvtoa.c
+
+ ChangeLog@1.784.1.9 +2 -0
+ [Bug 1794] ntpq -c rv missing clk_wander information.
+ [Bug 1795] ntpq readvar does not display last variable.
+
+
+ ntpq/ntpq-subs.c@1.83 +12 -11
+ nonfunctional cleanup
+
+ ntpq/ntpq.c@1.131 +7 -6
+ [Bug 1794] ntpq -c rv missing clk_wander information.
+ [Bug 1795] ntpq readvar does not display last variable.
+
+
+ChangeSet@1.2422.1.46, 2011-01-25 11:16:51+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P124
+ TAG: NTP_4_2_7P124
+
+ ChangeLog@1.784.1.8 +1 -0
+ NTP_4_2_7P124
+
+ clockstuff/clktest-opts.c@1.48 +2 -2
+ NTP_4_2_7P124
+
+ clockstuff/clktest-opts.h@1.48 +3 -3
+ NTP_4_2_7P124
+
+ ntpd/ntpd-opts.c@1.128 +2 -2
+ NTP_4_2_7P124
+
+ ntpd/ntpd-opts.h@1.128 +3 -3
+ NTP_4_2_7P124
+
+ ntpd/ntpd-opts.texi@1.126 +2 -2
+ NTP_4_2_7P124
+
+ ntpd/ntpd.1@1.126 +2 -2
+ NTP_4_2_7P124
+
+ ntpdc/ntpdc-opts.c@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpdc/ntpdc-opts.h@1.125 +3 -3
+ NTP_4_2_7P124
+
+ ntpdc/ntpdc-opts.texi@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpdc/ntpdc.1@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpq/ntpq-opts.c@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpq/ntpq-opts.h@1.125 +3 -3
+ NTP_4_2_7P124
+
+ ntpq/ntpq-opts.texi@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpq/ntpq.1@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.125 +3 -3
+ NTP_4_2_7P124
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.125 +2 -2
+ NTP_4_2_7P124
+
+ ntpsnmpd/ntpsnmpd.1@1.125 +2 -2
+ NTP_4_2_7P124
+
+ packageinfo.sh@1.126 +1 -1
+ NTP_4_2_7P124
+
+ sntp/sntp-opts.c@1.115.1.10 +2 -2
+ NTP_4_2_7P124
+
+ sntp/sntp-opts.h@1.115.1.10 +3 -3
+ NTP_4_2_7P124
+
+ sntp/sntp-opts.texi@1.115.1.10 +2 -2
+ NTP_4_2_7P124
+
+ sntp/sntp.1@1.115.1.10 +2 -2
+ NTP_4_2_7P124
+
+ sntp/sntp.html@1.115.1.10 +1 -1
+ NTP_4_2_7P124
+
+ util/ntp-keygen-opts.c@1.123 +2 -2
+ NTP_4_2_7P124
+
+ util/ntp-keygen-opts.h@1.123 +3 -3
+ NTP_4_2_7P124
+
+ util/ntp-keygen-opts.texi@1.126 +2 -2
+ NTP_4_2_7P124
+
+ util/ntp-keygen.1@1.126 +2 -2
+ NTP_4_2_7P124
+
+ChangeSet@1.2422.1.45, 2011-01-24 22:35:18-05:00, stenn@deacon.udel.edu
+ On second thought...
+
+ sntp/Makefile.am@1.47.1.8 +1 -1
+ On second thought...
+
+ChangeSet@1.2422.1.44, 2011-01-24 22:05:31-05:00, stenn@deacon.udel.edu
+ sntp/Makefile.am needs any passed-in CFLAGS.
+
+ ChangeLog@1.784.1.7 +1 -0
+ sntp/Makefile.am needs any passed-in CFLAGS.
+
+ sntp/Makefile.am@1.47.1.7 +1 -1
+ sntp/Makefile.am needs any passed-in CFLAGS.
+
+ChangeSet@1.2422.1.43, 2011-01-24 11:19:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P123
+ TAG: NTP_4_2_7P123
+
+ ChangeLog@1.784.1.6 +1 -0
+ NTP_4_2_7P123
+
+ clockstuff/clktest-opts.c@1.47 +2 -2
+ NTP_4_2_7P123
+
+ clockstuff/clktest-opts.h@1.47 +3 -3
+ NTP_4_2_7P123
+
+ ntpd/ntpd-opts.c@1.127 +2 -2
+ NTP_4_2_7P123
+
+ ntpd/ntpd-opts.h@1.127 +3 -3
+ NTP_4_2_7P123
+
+ ntpd/ntpd-opts.texi@1.125 +2 -2
+ NTP_4_2_7P123
+
+ ntpd/ntpd.1@1.125 +2 -2
+ NTP_4_2_7P123
+
+ ntpdc/ntpdc-opts.c@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpdc/ntpdc-opts.h@1.124 +3 -3
+ NTP_4_2_7P123
+
+ ntpdc/ntpdc-opts.texi@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpdc/ntpdc.1@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpq/ntpq-opts.c@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpq/ntpq-opts.h@1.124 +3 -3
+ NTP_4_2_7P123
+
+ ntpq/ntpq-opts.texi@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpq/ntpq.1@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.124 +3 -3
+ NTP_4_2_7P123
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.124 +2 -2
+ NTP_4_2_7P123
+
+ ntpsnmpd/ntpsnmpd.1@1.124 +2 -2
+ NTP_4_2_7P123
+
+ packageinfo.sh@1.125 +1 -1
+ NTP_4_2_7P123
+
+ sntp/sntp-opts.c@1.115.1.9 +2 -2
+ NTP_4_2_7P123
+
+ sntp/sntp-opts.h@1.115.1.9 +3 -3
+ NTP_4_2_7P123
+
+ sntp/sntp-opts.texi@1.115.1.9 +2 -2
+ NTP_4_2_7P123
+
+ sntp/sntp.1@1.115.1.9 +2 -2
+ NTP_4_2_7P123
+
+ sntp/sntp.html@1.115.1.9 +1 -1
+ NTP_4_2_7P123
+
+ util/ntp-keygen-opts.c@1.122 +2 -2
+ NTP_4_2_7P123
+
+ util/ntp-keygen-opts.h@1.122 +3 -3
+ NTP_4_2_7P123
+
+ util/ntp-keygen-opts.texi@1.125 +2 -2
+ NTP_4_2_7P123
+
+ util/ntp-keygen.1@1.125 +2 -2
+ NTP_4_2_7P123
+
+ChangeSet@1.2422.1.42, 2011-01-23 12:08:42+01:00, jnperlin@hydra.localnet
+ [Bug 1788] tables in libntp/tvtots.c imprecise
+
+ ChangeLog@1.784.1.5 +1 -0
+ [Bug 1788] tables in libntp/tvtots.c imprecise; tables used long/u_long values instead of 'const u_int32'
+
+ clockstuff/chutest.c@1.5 +0 -12
+ removed unused declarations of conversion timestamp conversion tables
+
+ clockstuff/clktest.c@1.6 +0 -4
+ removed unused declarations of conversion timestamp conversion tables
+
+ include/ntp_unixtime.h@1.8 +8 -8
+ timestamp conversion tables type changed to 'const u_int32' arrays
+
+ libntp/msutotsf.c@1.4 +2 -2
+ table type changed to 'const u_int32' arrays
+
+ libntp/tstotv.c@1.4 +3 -3
+ table type changed to 'const u_int32' arrays
+
+ libntp/tvtots.c@1.4 +75 -75
+ values recalculated and table type changed to 'const u_int32' arrays
+
+ libparse/parse.c@1.14 +0 -4
+ removed unused declarations of conversion timestamp conversion tables
+
+ChangeSet@1.2422.1.41, 2011-01-22 11:28:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P122
+ TAG: NTP_4_2_7P122
+
+ ChangeLog@1.784.1.4 +1 -0
+ NTP_4_2_7P122
+
+ clockstuff/clktest-opts.c@1.46 +2 -2
+ NTP_4_2_7P122
+
+ clockstuff/clktest-opts.h@1.46 +3 -3
+ NTP_4_2_7P122
+
+ ntpd/ntpd-opts.c@1.126 +2 -2
+ NTP_4_2_7P122
+
+ ntpd/ntpd-opts.h@1.126 +3 -3
+ NTP_4_2_7P122
+
+ ntpd/ntpd-opts.texi@1.124 +2 -2
+ NTP_4_2_7P122
+
+ ntpd/ntpd.1@1.124 +2 -2
+ NTP_4_2_7P122
+
+ ntpdc/ntpdc-opts.c@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpdc/ntpdc-opts.h@1.123 +3 -3
+ NTP_4_2_7P122
+
+ ntpdc/ntpdc-opts.texi@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpdc/ntpdc.1@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpq/ntpq-opts.c@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpq/ntpq-opts.h@1.123 +3 -3
+ NTP_4_2_7P122
+
+ ntpq/ntpq-opts.texi@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpq/ntpq.1@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123 +3 -3
+ NTP_4_2_7P122
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123 +2 -2
+ NTP_4_2_7P122
+
+ ntpsnmpd/ntpsnmpd.1@1.123 +2 -2
+ NTP_4_2_7P122
+
+ packageinfo.sh@1.124 +1 -1
+ NTP_4_2_7P122
+
+ sntp/sntp-opts.c@1.115.1.8 +2 -2
+ NTP_4_2_7P122
+
+ sntp/sntp-opts.h@1.115.1.8 +3 -3
+ NTP_4_2_7P122
+
+ sntp/sntp-opts.texi@1.115.1.8 +2 -2
+ NTP_4_2_7P122
+
+ sntp/sntp.1@1.115.1.8 +2 -2
+ NTP_4_2_7P122
+
+ sntp/sntp.html@1.115.1.8 +1 -1
+ NTP_4_2_7P122
+
+ util/ntp-keygen-opts.c@1.121 +2 -2
+ NTP_4_2_7P122
+
+ util/ntp-keygen-opts.h@1.121 +3 -3
+ NTP_4_2_7P122
+
+ util/ntp-keygen-opts.texi@1.124 +2 -2
+ NTP_4_2_7P122
+
+ util/ntp-keygen.1@1.124 +2 -2
+ NTP_4_2_7P122
+
+ChangeSet@1.2422.1.40, 2011-01-22 01:22:35-05:00, stenn@deacon.udel.edu
+ ACTS refclock cleanup from Dave Mills
+
+ ChangeLog@1.784.1.3 +1 -0
+ ACTS refclock cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.46 +8 -17
+ ACTS refclock cleanup from Dave Mills
+
+ChangeSet@1.2422.1.39, 2011-01-22 01:16:02-05:00, stenn@deacon.udel.edu
+ Avoid shadowing the "group" global variable
+
+ ChangeLog@1.784.1.2 +1 -0
+ Avoid shadowing the "group" global variable
+
+ ntpd/ntp_proto.c@1.318 +8 -8
+ Avoid shadowing the "group" global variable
+
+ChangeSet@1.2422.1.38, 2011-01-21 11:15:05+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P121
+ TAG: NTP_4_2_7P121
+
+ ChangeLog@1.784.1.1 +1 -0
+ NTP_4_2_7P121
+
+ clockstuff/clktest-opts.c@1.45 +2 -2
+ NTP_4_2_7P121
+
+ clockstuff/clktest-opts.h@1.45 +3 -3
+ NTP_4_2_7P121
+
+ ntpd/ntpd-opts.c@1.125 +2 -2
+ NTP_4_2_7P121
+
+ ntpd/ntpd-opts.h@1.125 +3 -3
+ NTP_4_2_7P121
+
+ ntpd/ntpd-opts.texi@1.123 +2 -2
+ NTP_4_2_7P121
+
+ ntpd/ntpd.1@1.123 +2 -2
+ NTP_4_2_7P121
+
+ ntpdc/ntpdc-opts.c@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpdc/ntpdc-opts.h@1.122 +3 -3
+ NTP_4_2_7P121
+
+ ntpdc/ntpdc-opts.texi@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpdc/ntpdc.1@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpq/ntpq-opts.c@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpq/ntpq-opts.h@1.122 +3 -3
+ NTP_4_2_7P121
+
+ ntpq/ntpq-opts.texi@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpq/ntpq.1@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.122 +3 -3
+ NTP_4_2_7P121
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.122 +2 -2
+ NTP_4_2_7P121
+
+ ntpsnmpd/ntpsnmpd.1@1.122 +2 -2
+ NTP_4_2_7P121
+
+ packageinfo.sh@1.123 +1 -1
+ NTP_4_2_7P121
+
+ sntp/sntp-opts.c@1.115.1.7 +2 -2
+ NTP_4_2_7P121
+
+ sntp/sntp-opts.h@1.115.1.7 +3 -3
+ NTP_4_2_7P121
+
+ sntp/sntp-opts.texi@1.115.1.7 +2 -2
+ NTP_4_2_7P121
+
+ sntp/sntp.1@1.115.1.7 +2 -2
+ NTP_4_2_7P121
+
+ sntp/sntp.html@1.115.1.7 +1 -1
+ NTP_4_2_7P121
+
+ util/ntp-keygen-opts.c@1.120 +2 -2
+ NTP_4_2_7P121
+
+ util/ntp-keygen-opts.h@1.120 +3 -3
+ NTP_4_2_7P121
+
+ util/ntp-keygen-opts.texi@1.123 +2 -2
+ NTP_4_2_7P121
+
+ util/ntp-keygen.1@1.123 +2 -2
+ NTP_4_2_7P121
+
+ChangeSet@1.2422.1.37, 2011-01-21 01:36:18-05:00, stenn@deacon.udel.edu
+ [Bug 1786] Remove extra semicolon from ntp_proto.c
+
+ ChangeLog@1.784 +1 -0
+ [Bug 1786] Remove extra semicolon from ntp_proto.c
+
+ ntpd/ntp_proto.c@1.317 +1 -1
+ [Bug 1786] Remove extra semicolon from ntp_proto.c
+
+ChangeSet@1.2422.1.36, 2011-01-20 11:33:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P120
+ TAG: NTP_4_2_7P120
+
+ ChangeLog@1.783 +1 -0
+ NTP_4_2_7P120
+
+ clockstuff/clktest-opts.c@1.44 +2 -2
+ NTP_4_2_7P120
+
+ clockstuff/clktest-opts.h@1.44 +3 -3
+ NTP_4_2_7P120
+
+ ntpd/ntpd-opts.c@1.124 +2 -2
+ NTP_4_2_7P120
+
+ ntpd/ntpd-opts.h@1.124 +3 -3
+ NTP_4_2_7P120
+
+ ntpd/ntpd-opts.texi@1.122 +2 -2
+ NTP_4_2_7P120
+
+ ntpd/ntpd.1@1.122 +2 -2
+ NTP_4_2_7P120
+
+ ntpdc/ntpdc-opts.c@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpdc/ntpdc-opts.h@1.121 +3 -3
+ NTP_4_2_7P120
+
+ ntpdc/ntpdc-opts.texi@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpdc/ntpdc.1@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpq/ntpq-opts.c@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpq/ntpq-opts.h@1.121 +3 -3
+ NTP_4_2_7P120
+
+ ntpq/ntpq-opts.texi@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpq/ntpq.1@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.121 +3 -3
+ NTP_4_2_7P120
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.121 +2 -2
+ NTP_4_2_7P120
+
+ ntpsnmpd/ntpsnmpd.1@1.121 +2 -2
+ NTP_4_2_7P120
+
+ packageinfo.sh@1.122 +1 -1
+ NTP_4_2_7P120
+
+ sntp/sntp-opts.c@1.115.1.6 +2 -2
+ NTP_4_2_7P120
+
+ sntp/sntp-opts.h@1.115.1.6 +3 -3
+ NTP_4_2_7P120
+
+ sntp/sntp-opts.texi@1.115.1.6 +2 -2
+ NTP_4_2_7P120
+
+ sntp/sntp.1@1.115.1.6 +2 -2
+ NTP_4_2_7P120
+
+ sntp/sntp.html@1.115.1.6 +1 -1
+ NTP_4_2_7P120
+
+ util/ntp-keygen-opts.c@1.119 +2 -2
+ NTP_4_2_7P120
+
+ util/ntp-keygen-opts.h@1.119 +3 -3
+ NTP_4_2_7P120
+
+ util/ntp-keygen-opts.texi@1.122 +2 -2
+ NTP_4_2_7P120
+
+ util/ntp-keygen.1@1.122 +2 -2
+ NTP_4_2_7P120
+
+ChangeSet@1.2422.1.35, 2011-01-20 08:27:32+00:00, davehart@shiny.ad.hartbrothers.com
+ Change new timeval and timespec to string routines to use snprintf()
+ rather than hand-crafted conversion, avoid signed int overflow there.
+ Add configure support for SIZEOF_LONG_LONG to enable portable use of
+ snprintf() with time_t.
+
+ ChangeLog@1.782 +4 -3
+ Change new timeval and timespec to string routines to use snprintf()
+ rather than hand-crafted conversion, avoid signed int overflow there.
+ Add configure support for SIZEOF_LONG_LONG to enable portable use of
+ snprintf() with time_t.
+
+ configure.ac@1.512.1.1 +0 -44
+ move more m4 code to ntp_libntp.m4
+
+ libntp/timespecops.c@1.5 +2 -2
+ Change new timeval and timespec to string routines to use snprintf()
+ rather than hand-crafted conversion, avoid signed int overflow there.
+
+ libntp/timevalops.c@1.5 +2 -2
+ Change new timeval and timespec to string routines to use snprintf()
+ rather than hand-crafted conversion, avoid signed int overflow there.
+
+ ports/winnt/include/config.h@1.93 +3 -1
+ SIZEOF_LONG, SIZEOF_LONG_LONG definitions for Win32
+
+ sntp/configure.ac@1.50.1.5 +0 -42
+ move more m4 code to ntp_libntp.m4
+
+ sntp/m4/ntp_libntp.m4@1.1.1.1 +53 -0
+ Add configure support for SIZEOF_LONG_LONG to enable portable use of
+ snprintf() with time_t.
+
+
+ChangeSet@1.2462, 2011-01-20 03:07:50-05:00, stenn@psp-deb1.ntp.org
+ Import libevent
+
+ ChangeLog@1.780.1.1 +1 -0
+ Import libevent
+
+ChangeSet@1.2461, 2011-01-20 03:07:20-05:00, stenn@psp-deb1.ntp.org
+ Import libevent
+
+ BitKeeper/etc/ignore@1.77 +7 -7
+
+ sntp/libevent/ChangeLog@1.1 +951 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/ChangeLog
+
+ sntp/libevent/ChangeLog@1.0 +0 -0
+
+ sntp/libevent/Doxyfile@1.1 +244 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/Doxyfile
+
+ sntp/libevent/Doxyfile@1.0 +0 -0
+
+ sntp/libevent/LICENSE@1.1 +74 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/LICENSE
+
+ sntp/libevent/LICENSE@1.0 +0 -0
+
+ sntp/libevent/Makefile.am@1.1 +223 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/Makefile.am
+
+ sntp/libevent/Makefile.am@1.0 +0 -0
+
+ sntp/libevent/Makefile.nmake@1.1 +47 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/Makefile.nmake
+
+ sntp/libevent/Makefile.nmake@1.0 +0 -0
+
+ sntp/libevent/README@1.1 +152 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/README
+
+ sntp/libevent/README@1.0 +0 -0
+
+ sntp/libevent/WIN32-Code/event2/event-config.h@1.1 +360 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/WIN32-Code/event2/event-config.h
+
+ sntp/libevent/WIN32-Code/event2/event-config.h@1.0 +0 -0
+
+ sntp/libevent/WIN32-Code/tree.h@1.1 +1354 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/WIN32-Code/tree.h
+
+ sntp/libevent/WIN32-Code/tree.h@1.0 +0 -0
+
+ sntp/libevent/arc4random.c@1.1 +534 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/arc4random.c
+
+ sntp/libevent/arc4random.c@1.0 +0 -0
+
+ sntp/libevent/autogen.sh@1.1 +15 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/autogen.sh
+
+ sntp/libevent/autogen.sh@1.0 +0 -0
+
+ sntp/libevent/buffer.c@1.1 +2985 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/buffer.c
+
+ sntp/libevent/buffer.c@1.0 +0 -0
+
+ sntp/libevent/buffer_iocp.c@1.1 +320 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/buffer_iocp.c
+
+ sntp/libevent/buffer_iocp.c@1.0 +0 -0
+
+ sntp/libevent/bufferevent-internal.h@1.1 +392 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent-internal.h
+
+ sntp/libevent/bufferevent-internal.h@1.0 +0 -0
+
+ sntp/libevent/bufferevent.c@1.1 +842 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent.c
+
+ sntp/libevent/bufferevent.c@1.0 +0 -0
+
+ sntp/libevent/bufferevent_async.c@1.1 +655 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent_async.c
+
+ sntp/libevent/bufferevent_async.c@1.0 +0 -0
+
+ sntp/libevent/bufferevent_filter.c@1.1 +509 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent_filter.c
+
+ sntp/libevent/bufferevent_filter.c@1.0 +0 -0
+
+ sntp/libevent/bufferevent_openssl.c@1.1 +1345 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent_openssl.c
+
+ sntp/libevent/bufferevent_openssl.c@1.0 +0 -0
+
+ sntp/libevent/bufferevent_pair.c@1.1 +333 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent_pair.c
+
+ sntp/libevent/bufferevent_pair.c@1.0 +0 -0
+
+ sntp/libevent/bufferevent_ratelim.c@1.1 +980 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent_ratelim.c
+
+ sntp/libevent/bufferevent_ratelim.c@1.0 +0 -0
+
+ sntp/libevent/bufferevent_sock.c@1.1 +689 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/bufferevent_sock.c
+
+ sntp/libevent/bufferevent_sock.c@1.0 +0 -0
+
+ sntp/libevent/changelist-internal.h@1.1 +101 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/changelist-internal.h
+
+ sntp/libevent/changelist-internal.h@1.0 +0 -0
+
+ sntp/libevent/compat/sys/queue.h@1.1 +488 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/compat/sys/queue.h
+
+ sntp/libevent/compat/sys/queue.h@1.0 +0 -0
+
+ sntp/libevent/configure.in@1.1 +603 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/configure.in
+
+ sntp/libevent/configure.in@1.0 +0 -0
+
+ sntp/libevent/defer-internal.h@1.1 +100 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/defer-internal.h
+
+ sntp/libevent/defer-internal.h@1.0 +0 -0
+
+ sntp/libevent/devpoll.c@1.1 +306 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/devpoll.c
+
+ sntp/libevent/devpoll.c@1.0 +0 -0
+
+ sntp/libevent/epoll.c@1.1 +470 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/epoll.c
+
+ sntp/libevent/epoll.c@1.0 +0 -0
+
+ sntp/libevent/epoll_sub.c@1.1 +52 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/epoll_sub.c
+
+ sntp/libevent/epoll_sub.c@1.0 +0 -0
+
+ sntp/libevent/evbuffer-internal.h@1.1 +277 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evbuffer-internal.h
+
+ sntp/libevent/evbuffer-internal.h@1.0 +0 -0
+
+ sntp/libevent/evdns.c@1.1 +4544 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evdns.c
+
+ sntp/libevent/evdns.c@1.0 +0 -0
+
+ sntp/libevent/evdns.h@1.1 +35 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evdns.h
+
+ sntp/libevent/evdns.h@1.0 +0 -0
+
+ sntp/libevent/event-internal.h@1.1 +339 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/event-internal.h
+
+ sntp/libevent/event-internal.h@1.0 +0 -0
+
+ sntp/libevent/event.c@1.1 +2794 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/event.c
+
+ sntp/libevent/event.c@1.0 +0 -0
+
+ sntp/libevent/event.h@1.1 +206 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/event.h
+
+ sntp/libevent/event.h@1.0 +0 -0
+
+ sntp/libevent/event_iocp.c@1.1 +286 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/event_iocp.c
+
+ sntp/libevent/event_iocp.c@1.0 +0 -0
+
+ sntp/libevent/event_rpcgen.py@1.1 +1716 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/event_rpcgen.py
+
+ sntp/libevent/event_rpcgen.py@1.0 +0 -0
+
+ sntp/libevent/event_tagging.c@1.1 +590 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/event_tagging.c
+
+ sntp/libevent/event_tagging.c@1.0 +0 -0
+
+ sntp/libevent/evhttp.h@1.1 +35 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evhttp.h
+
+ sntp/libevent/evhttp.h@1.0 +0 -0
+
+ sntp/libevent/evmap-internal.h@1.1 +90 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evmap-internal.h
+
+ sntp/libevent/evmap-internal.h@1.0 +0 -0
+
+ sntp/libevent/evmap.c@1.1 +724 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evmap.c
+
+ sntp/libevent/evmap.c@1.0 +0 -0
+
+ sntp/libevent/evport.c@1.1 +460 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evport.c
+
+ sntp/libevent/evport.c@1.0 +0 -0
+
+ sntp/libevent/evrpc-internal.h@1.1 +204 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evrpc-internal.h
+
+ sntp/libevent/evrpc-internal.h@1.0 +0 -0
+
+ sntp/libevent/evrpc.c@1.1 +1163 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evrpc.c
+
+ sntp/libevent/evrpc.c@1.0 +0 -0
+
+ sntp/libevent/evrpc.h@1.1 +35 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evrpc.h
+
+ sntp/libevent/evrpc.h@1.0 +0 -0
+
+ sntp/libevent/evsignal-internal.h@1.1 +64 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evsignal-internal.h
+
+ sntp/libevent/evsignal-internal.h@1.0 +0 -0
+
+ sntp/libevent/evthread-internal.h@1.1 +354 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evthread-internal.h
+
+ sntp/libevent/evthread-internal.h@1.0 +0 -0
+
+ sntp/libevent/evthread.c@1.1 +341 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evthread.c
+
+ sntp/libevent/evthread.c@1.0 +0 -0
+
+ sntp/libevent/evthread_pthread.c@1.1 +189 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evthread_pthread.c
+
+ sntp/libevent/evthread_pthread.c@1.0 +0 -0
+
+ sntp/libevent/evthread_win32.c@1.1 +335 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evthread_win32.c
+
+ sntp/libevent/evthread_win32.c@1.0 +0 -0
+
+ sntp/libevent/evutil.c@1.1 +2095 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evutil.c
+
+ sntp/libevent/evutil.c@1.0 +0 -0
+
+ sntp/libevent/evutil.h@1.1 +31 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evutil.h
+
+ sntp/libevent/evutil.h@1.0 +0 -0
+
+ sntp/libevent/evutil_rand.c@1.1 +126 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/evutil_rand.c
+
+ sntp/libevent/evutil_rand.c@1.0 +0 -0
+
+ sntp/libevent/ht-internal.h@1.1 +486 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/ht-internal.h
+
+ sntp/libevent/ht-internal.h@1.0 +0 -0
+
+ sntp/libevent/http-internal.h@1.1 +195 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/http-internal.h
+
+ sntp/libevent/http-internal.h@1.0 +0 -0
+
+ sntp/libevent/http.c@1.1 +4315 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/http.c
+
+ sntp/libevent/http.c@1.0 +0 -0
+
+ sntp/libevent/include/Makefile.am@1.1 +34 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/Makefile.am
+
+ sntp/libevent/include/Makefile.am@1.0 +0 -0
+
+ sntp/libevent/include/event2/buffer.h@1.1 +736 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/buffer.h
+
+ sntp/libevent/include/event2/buffer.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/buffer_compat.h@1.1 +110 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/buffer_compat.h
+
+ sntp/libevent/include/event2/buffer_compat.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/bufferevent.h@1.1 +759 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/bufferevent.h
+
+ sntp/libevent/include/event2/bufferevent.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/bufferevent_compat.h@1.1 +96 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/bufferevent_compat.h
+
+ sntp/libevent/include/event2/bufferevent_compat.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/bufferevent_ssl.h@1.1 +78 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/bufferevent_ssl.h
+
+ sntp/libevent/include/event2/bufferevent_ssl.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/bufferevent_struct.h@1.1 +113 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/bufferevent_struct.h
+
+ sntp/libevent/include/event2/bufferevent_struct.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/dns.h@1.1 +639 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/dns.h
+
+ sntp/libevent/include/event2/dns.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/dns_compat.h@1.1 +335 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/dns_compat.h
+
+ sntp/libevent/include/event2/dns_compat.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/dns_struct.h@1.1 +80 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/dns_struct.h
+
+ sntp/libevent/include/event2/dns_struct.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/event.h@1.1 +785 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/event.h
+
+ sntp/libevent/include/event2/event.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/event_compat.h@1.1 +324 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/event_compat.h
+
+ sntp/libevent/include/event2/event_compat.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/event_struct.h@1.1 +139 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/event_struct.h
+
+ sntp/libevent/include/event2/event_struct.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/http.h@1.1 +828 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/http.h
+
+ sntp/libevent/include/event2/http.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/http_compat.h@1.1 +90 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/http_compat.h
+
+ sntp/libevent/include/event2/http_compat.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/http_struct.h@1.1 +130 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/http_struct.h
+
+ sntp/libevent/include/event2/http_struct.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/keyvalq_struct.h@1.1 +80 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/keyvalq_struct.h
+
+ sntp/libevent/include/event2/keyvalq_struct.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/listener.h@1.1 +143 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/listener.h
+
+ sntp/libevent/include/event2/listener.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/rpc.h@1.1 +596 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/rpc.h
+
+ sntp/libevent/include/event2/rpc.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/rpc_compat.h@1.1 +61 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/rpc_compat.h
+
+ sntp/libevent/include/event2/rpc_compat.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/rpc_struct.h@1.1 +100 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/rpc_struct.h
+
+ sntp/libevent/include/event2/rpc_struct.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/tag.h@1.1 +124 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/tag.h
+
+ sntp/libevent/include/event2/tag.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/tag_compat.h@1.1 +39 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/tag_compat.h
+
+ sntp/libevent/include/event2/tag_compat.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/thread.h@1.1 +225 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/thread.h
+
+ sntp/libevent/include/event2/thread.h@1.0 +0 -0
+
+ sntp/libevent/include/event2/util.h@1.1 +593 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/include/event2/util.h
+
+ sntp/libevent/include/event2/util.h@1.0 +0 -0
+
+ sntp/libevent/iocp-internal.h@1.1 +201 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/iocp-internal.h
+
+ sntp/libevent/iocp-internal.h@1.0 +0 -0
+
+ sntp/libevent/ipv6-internal.h@1.1 +72 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/ipv6-internal.h
+
+ sntp/libevent/ipv6-internal.h@1.0 +0 -0
+
+ sntp/libevent/kqueue.c@1.1 +415 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/kqueue.c
+
+ sntp/libevent/kqueue.c@1.0 +0 -0
+
+ sntp/libevent/libevent.pc.in@1.1 +16 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/libevent.pc.in
+
+ sntp/libevent/libevent.pc.in@1.0 +0 -0
+
+ sntp/libevent/libevent_openssl.pc.in@1.1 +16 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/libevent_openssl.pc.in
+
+ sntp/libevent/libevent_openssl.pc.in@1.0 +0 -0
+
+ sntp/libevent/libevent_pthreads.pc.in@1.1 +16 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/libevent_pthreads.pc.in
+
+ sntp/libevent/libevent_pthreads.pc.in@1.0 +0 -0
+
+ sntp/libevent/listener.c@1.1 +865 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/listener.c
+
+ sntp/libevent/listener.c@1.0 +0 -0
+
+ sntp/libevent/log-internal.h@1.1 +59 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/log-internal.h
+
+ sntp/libevent/log-internal.h@1.0 +0 -0
+
+ sntp/libevent/log.c@1.1 +224 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/log.c
+
+ sntp/libevent/log.c@1.0 +0 -0
+
+ sntp/libevent/m4/acx_pthread.m4@1.1 +279 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/m4/acx_pthread.m4
+
+ sntp/libevent/m4/acx_pthread.m4@1.0 +0 -0
+
+ sntp/libevent/minheap-internal.h@1.1 +160 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/minheap-internal.h
+
+ sntp/libevent/minheap-internal.h@1.0 +0 -0
+
+ sntp/libevent/mm-internal.h@1.1 +61 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/mm-internal.h
+
+ sntp/libevent/mm-internal.h@1.0 +0 -0
+
+ sntp/libevent/poll.c@1.1 +333 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/poll.c
+
+ sntp/libevent/poll.c@1.0 +0 -0
+
+ sntp/libevent/ratelim-internal.h@1.1 +105 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/ratelim-internal.h
+
+ sntp/libevent/ratelim-internal.h@1.0 +0 -0
+
+ sntp/libevent/sample/Makefile.am@1.1 +23 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/Makefile.am
+
+ sntp/libevent/sample/Makefile.am@1.0 +0 -0
+
+ sntp/libevent/sample/dns-example.c@1.1 +221 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/dns-example.c
+
+ sntp/libevent/sample/dns-example.c@1.0 +0 -0
+
+ sntp/libevent/sample/event-test.c@1.1 +143 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/event-test.c
+
+ sntp/libevent/sample/event-test.c@1.0 +0 -0
+
+ sntp/libevent/sample/hello-world.c@1.1 +138 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/hello-world.c
+
+ sntp/libevent/sample/hello-world.c@1.0 +0 -0
+
+ sntp/libevent/sample/http-server.c@1.1 +392 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/http-server.c
+
+ sntp/libevent/sample/http-server.c@1.0 +0 -0
+
+ sntp/libevent/sample/le-proxy.c@1.1 +278 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/le-proxy.c
+
+ sntp/libevent/sample/le-proxy.c@1.0 +0 -0
+
+ sntp/libevent/sample/signal-test.c@1.1 +77 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/signal-test.c
+
+ sntp/libevent/sample/signal-test.c@1.0 +0 -0
+
+ sntp/libevent/sample/time-test.c@1.1 +108 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/sample/time-test.c
+
+ sntp/libevent/sample/time-test.c@1.0 +0 -0
+
+ sntp/libevent/select.c@1.1 +311 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/select.c
+
+ sntp/libevent/select.c@1.0 +0 -0
+
+ sntp/libevent/signal.c@1.1 +438 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/signal.c
+
+ sntp/libevent/signal.c@1.0 +0 -0
+
+ sntp/libevent/strlcpy-internal.h@1.1 +21 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/strlcpy-internal.h
+
+ sntp/libevent/strlcpy-internal.h@1.0 +0 -0
+
+ sntp/libevent/strlcpy.c@1.1 +74 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/strlcpy.c
+
+ sntp/libevent/strlcpy.c@1.0 +0 -0
+
+ sntp/libevent/test/Makefile.am@1.1 +74 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/Makefile.am
+
+ sntp/libevent/test/Makefile.am@1.0 +0 -0
+
+ sntp/libevent/test/Makefile.nmake@1.1 +56 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/Makefile.nmake
+
+ sntp/libevent/test/Makefile.nmake@1.0 +0 -0
+
+ sntp/libevent/test/bench.c@1.1 +191 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/bench.c
+
+ sntp/libevent/test/bench.c@1.0 +0 -0
+
+ sntp/libevent/test/bench_cascade.c@1.1 +169 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/bench_cascade.c
+
+ sntp/libevent/test/bench_cascade.c@1.0 +0 -0
+
+ sntp/libevent/test/bench_http.c@1.1 +178 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/bench_http.c
+
+ sntp/libevent/test/bench_http.c@1.0 +0 -0
+
+ sntp/libevent/test/bench_httpclient.c@1.1 +216 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/bench_httpclient.c
+
+ sntp/libevent/test/bench_httpclient.c@1.0 +0 -0
+
+ sntp/libevent/test/regress.c@1.1 +2339 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress.c
+
+ sntp/libevent/test/regress.c@1.0 +0 -0
+
+ sntp/libevent/test/regress.gen.c@1.1 +1225 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress.gen.c
+
+ sntp/libevent/test/regress.gen.c@1.0 +0 -0
+
+ sntp/libevent/test/regress.gen.h@1.1 +207 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress.gen.h
+
+ sntp/libevent/test/regress.gen.h@1.0 +0 -0
+
+ sntp/libevent/test/regress.h@1.1 +125 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress.h
+
+ sntp/libevent/test/regress.h@1.0 +0 -0
+
+ sntp/libevent/test/regress.rpc@1.1 +25 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress.rpc
+
+ sntp/libevent/test/regress.rpc@1.0 +0 -0
+
+ sntp/libevent/test/regress_buffer.c@1.1 +1567 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_buffer.c
+
+ sntp/libevent/test/regress_buffer.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_bufferevent.c@1.1 +835 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_bufferevent.c
+
+ sntp/libevent/test/regress_bufferevent.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_dns.c@1.1 +1706 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_dns.c
+
+ sntp/libevent/test/regress_dns.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_et.c@1.1 +197 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_et.c
+
+ sntp/libevent/test/regress_et.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_http.c@1.1 +3542 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_http.c
+
+ sntp/libevent/test/regress_http.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_iocp.c@1.1 +352 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_iocp.c
+
+ sntp/libevent/test/regress_iocp.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_listener.c@1.1 +211 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_listener.c
+
+ sntp/libevent/test/regress_listener.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_main.c@1.1 +392 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_main.c
+
+ sntp/libevent/test/regress_main.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_minheap.c@1.1 +98 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_minheap.c
+
+ sntp/libevent/test/regress_minheap.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_rpc.c@1.1 +884 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_rpc.c
+
+ sntp/libevent/test/regress_rpc.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_ssl.c@1.1 +448 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_ssl.c
+
+ sntp/libevent/test/regress_ssl.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_testutils.c@1.1 +196 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_testutils.c
+
+ sntp/libevent/test/regress_testutils.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_testutils.h@1.1 +66 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_testutils.h
+
+ sntp/libevent/test/regress_testutils.h@1.0 +0 -0
+
+ sntp/libevent/test/regress_thread.c@1.1 +511 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_thread.c
+
+ sntp/libevent/test/regress_thread.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_util.c@1.1 +1076 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_util.c
+
+ sntp/libevent/test/regress_util.c@1.0 +0 -0
+
+ sntp/libevent/test/regress_zlib.c@1.1 +322 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/regress_zlib.c
+
+ sntp/libevent/test/regress_zlib.c@1.0 +0 -0
+
+ sntp/libevent/test/test-changelist.c@1.1 +198 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/test-changelist.c
+
+ sntp/libevent/test/test-changelist.c@1.0 +0 -0
+
+ sntp/libevent/test/test-eof.c@1.1 +96 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/test-eof.c
+
+ sntp/libevent/test/test-eof.c@1.0 +0 -0
+
+ sntp/libevent/test/test-init.c@1.1 +44 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/test-init.c
+
+ sntp/libevent/test/test-init.c@1.0 +0 -0
+
+ sntp/libevent/test/test-ratelim.c@1.1 +456 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/test-ratelim.c
+
+ sntp/libevent/test/test-ratelim.c@1.0 +0 -0
+
+ sntp/libevent/test/test-time.c@1.1 +92 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/test-time.c
+
+ sntp/libevent/test/test-time.c@1.0 +0 -0
+
+ sntp/libevent/test/test-weof.c@1.1 +96 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/test-weof.c
+
+ sntp/libevent/test/test-weof.c@1.0 +0 -0
+
+ sntp/libevent/test/test.sh@1.1 +156 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/test.sh
+
+ sntp/libevent/test/test.sh@1.0 +0 -0
+
+ sntp/libevent/test/tinytest.c@1.1 +383 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/tinytest.c
+
+ sntp/libevent/test/tinytest.c@1.0 +0 -0
+
+ sntp/libevent/test/tinytest.h@1.1 +87 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/tinytest.h
+
+ sntp/libevent/test/tinytest.h@1.0 +0 -0
+
+ sntp/libevent/test/tinytest_local.h@1.1 +9 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/tinytest_local.h
+
+ sntp/libevent/test/tinytest_local.h@1.0 +0 -0
+
+ sntp/libevent/test/tinytest_macros.h@1.1 +184 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/test/tinytest_macros.h
+
+ sntp/libevent/test/tinytest_macros.h@1.0 +0 -0
+
+ sntp/libevent/util-internal.h@1.1 +256 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/util-internal.h
+
+ sntp/libevent/util-internal.h@1.0 +0 -0
+
+ sntp/libevent/whatsnew-2.0.txt@1.1 +609 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/whatsnew-2.0.txt
+
+ sntp/libevent/whatsnew-2.0.txt@1.0 +0 -0
+
+ sntp/libevent/win32select.c@1.1 +376 -0
+ BitKeeper file /home/stenn/ntp-dev-libevent/sntp/libevent/win32select.c
+
+ sntp/libevent/win32select.c@1.0 +0 -0
+
+ChangeSet@1.2460, 2011-01-20 02:57:31-05:00, stenn@psp-deb1.ntp.org
+ Add #ifdef DEBUG lines to sntp/main.c
+
+ sntp/main.c@1.67 +16 -0
+ Add #ifdef DEBUG lines to sntp/main.c
+
+ChangeSet@1.2422.1.34, 2011-01-19 20:43:27+01:00, jnperlin@hydra.localnet
+ changed timeval / timespec string conversion (snprintf() format strings for time_t vs. int / long / long long; avoid signed integer overflow)
+
+ ChangeLog@1.781 +3 -0
+ struct timeval / struct timespec string formatting changes
+
+ libntp/timespecops.c@1.4 +79 -85
+ changed struct timespec string conversion (snprintf() format for time_t)
+
+ libntp/timevalops.c@1.4 +82 -56
+ changed struct timeval string conversion (snprintf() format for time_t)
+
+ChangeSet@1.2422.1.33, 2011-01-19 12:26:17+00:00, davehart@shiny.ad.hartbrothers.com
+ Grow ntpd/work_thread.c arrays as needed.
+ Add DEBUG_* variants of ntp_assert.h macros which compile away using
+ ./configure --disable-debugging.
+ Fix tvalops.cpp unit test failures for 32-bit builds.
+ Return to a single autoreconf invocation in ./bootstrap script.
+ Fix warnings seen on FreeBSD 9.
+ NMEA driver documentation update from Juergen Perlinger.
+
+ ChangeLog@1.780 +8 -1
+ Grow ntpd/work_thread.c arrays as needed.
+ Add DEBUG_* variants of ntp_assert.h macros which compile away using
+ ./configure --disable-debugging.
+ Fix tvalops.cpp unit test failures for 32-bit builds.
+ Return to a single autoreconf invocation in ./bootstrap script.
+ Fix warnings seen on FreeBSD 9.
+ NMEA driver documentation update from Juergen Perlinger.
+
+ bootstrap@1.38 +6 -2
+ Use recursive autoreconf again now that we don't trigger bug.
+
+ include/ntp_assert.h@1.4 +47 -16
+ provide assertion macros without NTP_ prefix.
+ provide debug-only DEBUG_REQUIRE(), DEBUG_INSIST(), etc.
+
+ include/ntp_md5.h@1.8 +3 -2
+ silence warning seen on FreeBSD 9
+
+ include/timespecops.h@1.3 +37 -27
+ style cleanup.
+ reduce duplication.
+ comment fixes and additions.
+ TIMESPECOPS_H typos.
+
+ include/timevalops.h@1.2 +42 -35
+ style cleanup.
+ reduce duplication.
+ comment fixes and additions.
+ TIMEVALOPS_H typos.
+
+ libntp/socket.c@1.4 +0 -3
+ isc/util.h is for use by lib/isc code only, not clients
+
+ libntp/timespecops.c@1.3 +91 -88
+ style cleanup.
+ comment fixes and additions.
+ use abs(), labs() where appropriate.
+ reduce duplication.
+ silence int->char trucation warnings.
+
+ libntp/timevalops.c@1.3 +99 -103
+ style cleanup.
+ comment fixes and additions.
+ use abs(), labs() where appropriate.
+ reduce duplication.
+ silence int->char trucation warnings.
+
+ ntpd/refclock_zyfer.c@1.7 +3 -1
+ FreeBSD 9 warns of sys/termios.h deprecation, prefer termios.h
+
+ ntpd/work_thread.c@1.3 +92 -46
+ use dynamic-sized request and response arrays of pointers
+
+ ports/winnt/vc6/libntp.dsp@1.59 +10 -2
+ add timespecops.c, timevalops.c references
+
+ ports/winnt/vs2003/libntp.vcproj@1.17 +7 -19
+ add timespecops.c, timevalops.c references
+
+ ports/winnt/vs2005/libntp.vcproj@1.15 +8 -18
+ add timespecops.c, timevalops.c references
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.36 +17 -1
+ add references to timespecops.c and timevalops.c
+
+ tests/libntp/tspecops.cpp@1.4 +54 -33
+ style cleanup.
+ use class not struct for TVAL, LFP.
+
+ tests/libntp/tvalops.cpp@1.2 +109 -75
+ style cleanup.
+ use class not struct for TVAL, LFP.
+ use ASSERT_NEAR() for fuzzy double equality test, fixes 32-bit failures.
+
+ util/ntp-keygen.c@1.76 +1 -1
+ silence time_t -> u_int truncation warning.
+
+ChangeSet@1.2422.1.32, 2011-01-19 02:07:09-05:00, stenn@deacon.udel.edu
+ crypo group changes from Dave Mills
+
+ ChangeLog@1.779 +1 -0
+ crypo group changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.153 +20 -23
+ crypo group changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.316 +119 -9
+ crypo group changes from Dave Mills
+
+ChangeSet@1.2422.1.31, 2011-01-19 02:03:53-05:00, stenn@deacon.udel.edu
+ Lose the RANGEGATE check in PPS, from Dave Mills
+
+ ChangeLog@1.778 +1 -0
+ Lose the RANGEGATE check in PPS, from Dave Mills
+
+ include/refclock_atom.h@1.3 +0 -1
+ Lose the RANGEGATE check in PPS, from Dave Mills
+
+ ntpd/ntp_refclock.c@1.102 +0 -10
+ Lose the RANGEGATE check in PPS, from Dave Mills
+
+ChangeSet@1.2422.1.30, 2011-01-19 02:01:33-05:00, stenn@deacon.udel.edu
+ ACTS refclock cleanup from Dave Mills
+
+ ChangeLog@1.777 +1 -0
+ ACTS refclock cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.45 +2 -28
+ ACTS refclock cleanup from Dave Mills
+
+ChangeSet@1.2422.1.29, 2011-01-19 01:58:52-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.776 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.70 +5 -5
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.19 +14 -10
+ Documentation updates from Dave Mills
+
+ html/copyright.html@1.57 +2 -2
+ Documentation updates from Dave Mills
+
+ html/drivers/driver20.html@1.24 +339 -101
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.28 +4 -9
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.64 +2 -2
+ Documentation updates from Dave Mills
+
+ html/select.html@1.2 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2458, 2011-01-19 06:06:52+00:00, stenn@psp-fb1.ntp.org
+ Move DEBUG-enablement checks to ntp_libntp.m4
+
+ configure.ac@1.513 +0 -16
+ Move DEBUG-enablement checks to ntp_libntp.m4
+
+ sntp/m4/ntp_libntp.m4@1.2 +17 -1
+ Move DEBUG-enablement checks to ntp_libntp.m4
+
+ChangeSet@1.2457, 2011-01-19 06:05:57+00:00, stenn@psp-fb1.ntp.org
+ DEBUG cleanup
+
+ sntp/header.h@1.7 +0 -4
+ DEBUG cleanup
+
+ sntp/main.h@1.5 +0 -1
+ DEBUG cleanup
+
+ChangeSet@1.2422.6.2, 2011-01-18 19:35:18+01:00, jnperlin@hydra.localnet
+ added tests for timevalops.c, enhancements for timespecops.c tests
+
+ tests/libntp/Makefile.am@1.30 +1 -0
+ added timeval tests
+
+ tests/libntp/tspecops.cpp@1.3 +39 -47
+ refactoring and signed conversion tests
+
+ tests/libntp/tvalops.cpp@1.1 +342 -0
+ tests for tvalops
+
+ tests/libntp/tvalops.cpp@1.0 +0 -0
+
+ChangeSet@1.2422.5.1, 2011-01-18 18:09:37+01:00, jnperlin@hydra.localnet
+ Improvements on timeval / timespec ops
+
+ include/lib_strbuf.h@1.10 +3 -2
+ made LIB_BUFLENGTH useable for preprocessor tests
+
+ include/timespecops.h@1.2 +3 -0
+ additional explanation
+
+ libntp/timespecops.c@1.2 +108 -22
+ fixed string conversion and signed conversion
+
+ libntp/timevalops.c@1.2 +75 -27
+ fixed string conversion and signed conversion
+
+ tests/libntp/tspecops.cpp@1.2 +22 -0
+ added string conversion tests
+
+ChangeSet@1.2456, 2011-01-18 12:35:26+00:00, stenn@psp-fb1.ntp.org
+ autogen and debug cleanup
+
+ sntp/main.c@1.66 +4 -13
+ autogen and debug cleanup
+
+ sntp/main.h@1.4 +1 -0
+ autogen and debug cleanup
+
+ChangeSet@1.2422.1.27, 2011-01-18 11:32:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P119
+ TAG: NTP_4_2_7P119
+
+ ChangeLog@1.775 +1 -0
+ NTP_4_2_7P119
+
+ clockstuff/clktest-opts.c@1.43 +2 -2
+ NTP_4_2_7P119
+
+ clockstuff/clktest-opts.h@1.43 +3 -3
+ NTP_4_2_7P119
+
+ ntpd/ntpd-opts.c@1.123 +2 -2
+ NTP_4_2_7P119
+
+ ntpd/ntpd-opts.h@1.123 +3 -3
+ NTP_4_2_7P119
+
+ ntpd/ntpd-opts.texi@1.121 +2 -2
+ NTP_4_2_7P119
+
+ ntpd/ntpd.1@1.121 +2 -2
+ NTP_4_2_7P119
+
+ ntpdc/ntpdc-opts.c@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpdc/ntpdc-opts.h@1.120 +3 -3
+ NTP_4_2_7P119
+
+ ntpdc/ntpdc-opts.texi@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpdc/ntpdc.1@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpq/ntpq-opts.c@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpq/ntpq-opts.h@1.120 +3 -3
+ NTP_4_2_7P119
+
+ ntpq/ntpq-opts.texi@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpq/ntpq.1@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.120 +3 -3
+ NTP_4_2_7P119
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.120 +2 -2
+ NTP_4_2_7P119
+
+ ntpsnmpd/ntpsnmpd.1@1.120 +2 -2
+ NTP_4_2_7P119
+
+ packageinfo.sh@1.121 +1 -1
+ NTP_4_2_7P119
+
+ sntp/sntp-opts.c@1.115.1.5 +2 -2
+ NTP_4_2_7P119
+
+ sntp/sntp-opts.h@1.115.1.5 +3 -3
+ NTP_4_2_7P119
+
+ sntp/sntp-opts.texi@1.115.1.5 +2 -2
+ NTP_4_2_7P119
+
+ sntp/sntp.1@1.115.1.5 +2 -2
+ NTP_4_2_7P119
+
+ sntp/sntp.html@1.115.1.5 +1 -1
+ NTP_4_2_7P119
+
+ util/ntp-keygen-opts.c@1.118 +2 -2
+ NTP_4_2_7P119
+
+ util/ntp-keygen-opts.h@1.118 +3 -3
+ NTP_4_2_7P119
+
+ util/ntp-keygen-opts.texi@1.121 +2 -2
+ NTP_4_2_7P119
+
+ util/ntp-keygen.1@1.121 +2 -2
+ NTP_4_2_7P119
+
+ChangeSet@1.2422.4.6, 2011-01-18 07:14:14+00:00, stenn@psp-fb1.ntp.org
+ Distribute timespecops.h and timevalops.h
+
+ include/Makefile.am@1.44 +2 -0
+ Distribute timespecops.h and timevalops.h
+
+ChangeSet@1.2422.4.5, 2011-01-16 14:56:08+01:00, jnperlin@hydra.localnet
+ added timespecops and timevalops for operations on struct timespec and struct timeval
+
+ ChangeLog@1.771.1.4 +2 -0
+ added timespecops and timevalops for operations on struct timespec and struct timeval
+
+ include/timespecops.h@1.1 +131 -0
+ operations on struct timespec
+
+ include/timespecops.h@1.0 +0 -0
+
+ include/timevalops.h@1.1 +108 -0
+ operations on struct timeval
+
+ include/timevalops.h@1.0 +0 -0
+
+ libntp/Makefile.am@1.58 +2 -0
+ added timespecops and timevalops for operations on struct timespec and struct timeval
+
+ libntp/timespecops.c@1.1 +347 -0
+ operations on struct timespec
+
+ libntp/timespecops.c@1.0 +0 -0
+
+ libntp/timevalops.c@1.1 +346 -0
+ operations on struct timeval
+
+ libntp/timevalops.c@1.0 +0 -0
+
+ tests/libntp/Makefile.am@1.29 +2 -1
+ added test for timespecops
+
+ tests/libntp/tspecops.cpp@1.1 +327 -0
+ tests for timespecops
+
+ tests/libntp/tspecops.cpp@1.0 +0 -0
+
+ChangeSet@1.2455, 2011-01-16 10:49:33+00:00, stenn@psp-fb1.ntp.org
+ sntp option cleanup
+
+ sntp/main.c@1.65 +49 -24
+ sntp option cleanup
+
+ sntp/sntp-opts.c@1.121 +267 -184
+ sntp option cleanup
+
+ sntp/sntp-opts.def@1.24 +93 -94
+ sntp option cleanup
+
+ sntp/sntp-opts.h@1.121 +73 -71
+ sntp option cleanup
+
+ sntp/sntp-opts.texi@1.121 +55 -104
+ sntp option cleanup
+
+ sntp/sntp.1@1.121 +75 -66
+ sntp option cleanup
+
+ sntp/sntp.html@1.121 +94 -133
+ sntp option cleanup
+
+ sntp/sntp.texi@1.7 +6 -2
+ sntp option cleanup
+
+ChangeSet@1.2454, 2011-01-16 10:48:00+00:00, stenn@psp-fb1.ntp.org
+ libevent cleanup
+
+ sntp/Makefile.am@1.52 +1 -10
+ libevent cleanup
+
+ sntp/m4/ntp_libevent.m4@1.2, stenn@psp-deb1.ntp.org +0 -0
+ Rename: m4/ntp_libevent.m4 -> sntp/m4/ntp_libevent.m4
+
+ChangeSet@1.2422.4.4, 2011-01-15 10:47:08+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P118
+ TAG: NTP_4_2_7P118
+
+ ChangeLog@1.771.1.3 +1 -0
+ NTP_4_2_7P118
+
+ clockstuff/clktest-opts.c@1.42 +2 -2
+ NTP_4_2_7P118
+
+ clockstuff/clktest-opts.h@1.42 +3 -3
+ NTP_4_2_7P118
+
+ ntpd/ntpd-opts.c@1.122 +2 -2
+ NTP_4_2_7P118
+
+ ntpd/ntpd-opts.h@1.122 +3 -3
+ NTP_4_2_7P118
+
+ ntpd/ntpd-opts.texi@1.120 +2 -2
+ NTP_4_2_7P118
+
+ ntpd/ntpd.1@1.120 +2 -2
+ NTP_4_2_7P118
+
+ ntpdc/ntpdc-opts.c@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpdc/ntpdc-opts.h@1.119 +3 -3
+ NTP_4_2_7P118
+
+ ntpdc/ntpdc-opts.texi@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpdc/ntpdc.1@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpq/ntpq-opts.c@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpq/ntpq-opts.h@1.119 +3 -3
+ NTP_4_2_7P118
+
+ ntpq/ntpq-opts.texi@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpq/ntpq.1@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.119 +3 -3
+ NTP_4_2_7P118
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.119 +2 -2
+ NTP_4_2_7P118
+
+ ntpsnmpd/ntpsnmpd.1@1.119 +2 -2
+ NTP_4_2_7P118
+
+ packageinfo.sh@1.120 +1 -1
+ NTP_4_2_7P118
+
+ sntp/sntp-opts.c@1.115.1.4 +2 -2
+ NTP_4_2_7P118
+
+ sntp/sntp-opts.h@1.115.1.4 +3 -3
+ NTP_4_2_7P118
+
+ sntp/sntp-opts.texi@1.115.1.4 +2 -2
+ NTP_4_2_7P118
+
+ sntp/sntp.1@1.115.1.4 +2 -2
+ NTP_4_2_7P118
+
+ sntp/sntp.html@1.115.1.4 +1 -1
+ NTP_4_2_7P118
+
+ util/ntp-keygen-opts.c@1.117 +2 -2
+ NTP_4_2_7P118
+
+ util/ntp-keygen-opts.h@1.117 +3 -3
+ NTP_4_2_7P118
+
+ util/ntp-keygen-opts.texi@1.120 +2 -2
+ NTP_4_2_7P118
+
+ util/ntp-keygen.1@1.120 +2 -2
+ NTP_4_2_7P118
+
+ChangeSet@1.2422.4.3, 2011-01-15 02:04:43-05:00, stenn@deacon.udel.edu
+ Use a do-nothing rule to avoid an SCCS "get"
+
+ sntp/Makefile.am@1.47.1.6 +1 -0
+ Use a do-nothing rule to avoid an SCCS "get"
+
+ChangeSet@1.2422.4.2, 2011-01-15 00:16:55-05:00, stenn@deacon.udel.edu
+ Simplify the built-sources stuff in sntp/
+
+ ChangeLog@1.771.1.2 +1 -0
+ Simplify the built-sources stuff in sntp/
+
+ sntp/Makefile.am@1.47.1.5 +0 -1
+ Simplify the built-sources stuff in sntp/
+
+ChangeSet@1.2422.4.1, 2011-01-14 23:06:12-05:00, stenn@deacon.udel.edu
+ Fix check for -lipv6 on HP-UX 11
+
+ ChangeLog@1.771.1.1 +1 -0
+
+ configure.ac@1.512 +4 -8
+
+ChangeSet@1.2422.1.24, 2011-01-14 07:50:28+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct msyslog.c build break on Solaris 2.9 from #ifdef/#if mixup.
+
+ ChangeLog@1.772 +1 -0
+ Correct msyslog.c build break on Solaris 2.9 from #ifdef/#if mixup.
+
+ libntp/msyslog.c@1.34 +12 -3
+ Correct msyslog.c build break on Solaris 2.9 from #ifdef/#if mixup.
+
+ChangeSet@1.2422.1.23, 2011-01-13 07:32:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P117
+ TAG: NTP_4_2_7P117
+
+ ChangeLog@1.771 +1 -0
+ NTP_4_2_7P117
+
+ clockstuff/clktest-opts.c@1.41 +3 -3
+ NTP_4_2_7P117
+
+ clockstuff/clktest-opts.h@1.41 +3 -3
+ NTP_4_2_7P117
+
+ ntpd/ntpd-opts.c@1.121 +3 -3
+ NTP_4_2_7P117
+
+ ntpd/ntpd-opts.h@1.121 +3 -3
+ NTP_4_2_7P117
+
+ ntpd/ntpd-opts.texi@1.119 +2 -2
+ NTP_4_2_7P117
+
+ ntpd/ntpd.1@1.119 +2 -2
+ NTP_4_2_7P117
+
+ ntpdc/ntpdc-opts.c@1.118 +4 -4
+ NTP_4_2_7P117
+
+ ntpdc/ntpdc-opts.h@1.118 +3 -3
+ NTP_4_2_7P117
+
+ ntpdc/ntpdc-opts.texi@1.118 +2 -2
+ NTP_4_2_7P117
+
+ ntpdc/ntpdc.1@1.118 +2 -2
+ NTP_4_2_7P117
+
+ ntpq/ntpq-opts.c@1.118 +4 -4
+ NTP_4_2_7P117
+
+ ntpq/ntpq-opts.h@1.118 +3 -3
+ NTP_4_2_7P117
+
+ ntpq/ntpq-opts.texi@1.118 +2 -2
+ NTP_4_2_7P117
+
+ ntpq/ntpq.1@1.118 +2 -2
+ NTP_4_2_7P117
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.118 +3 -3
+ NTP_4_2_7P117
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.118 +3 -3
+ NTP_4_2_7P117
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.118 +2 -2
+ NTP_4_2_7P117
+
+ ntpsnmpd/ntpsnmpd.1@1.118 +2 -2
+ NTP_4_2_7P117
+
+ packageinfo.sh@1.119 +1 -1
+ NTP_4_2_7P117
+
+ sntp/sntp-opts.c@1.115.1.3 +3 -3
+ NTP_4_2_7P117
+
+ sntp/sntp-opts.h@1.115.1.3 +3 -3
+ NTP_4_2_7P117
+
+ sntp/sntp-opts.texi@1.115.1.3 +2 -2
+ NTP_4_2_7P117
+
+ sntp/sntp.1@1.115.1.3 +2 -2
+ NTP_4_2_7P117
+
+ sntp/sntp.html@1.115.1.3 +1 -1
+ NTP_4_2_7P117
+
+ util/ntp-keygen-opts.c@1.116 +4 -4
+ NTP_4_2_7P117
+
+ util/ntp-keygen-opts.h@1.116 +3 -3
+ NTP_4_2_7P117
+
+ util/ntp-keygen-opts.texi@1.119 +2 -2
+ NTP_4_2_7P117
+
+ util/ntp-keygen.1@1.119 +2 -2
+ NTP_4_2_7P117
+
+ChangeSet@1.2422.1.22, 2011-01-13 01:53:03-05:00, stenn@deacon.udel.edu
+ Make sure the built-sources-only target is writable
+
+ sntp/Makefile.am@1.47.1.4 +1 -1
+ Make sure the built-sources-only target is writable
+
+ChangeSet@1.2422.1.21, 2011-01-12 18:57:28-05:00, stenn@deacon.udel.edu
+ Some systems do not have strerror_r
+
+ libntp/msyslog.c@1.33 +3 -12
+ Some systems do not have strerror_r
+
+ChangeSet@1.2422.1.20, 2011-01-12 16:11:01-05:00, stenn@deacon.udel.edu
+ Improve libntp.a dependency checking
+
+ adjtimed/Makefile.am@1.9 +6 -1
+ Improve libntp.a dependency checking
+
+ clockstuff/Makefile.am@1.16 +6 -1
+ Improve libntp.a dependency checking
+
+ libparse/Makefile.am@1.23 +6 -1
+ Improve libntp.a dependency checking
+
+ ntpd/Makefile.am@1.98 +7 -1
+ Improve libntp.a dependency checking
+
+ ntpdate/Makefile.am@1.26 +6 -1
+ Improve libntp.a dependency checking
+
+ ntpdc/Makefile.am@1.56 +7 -2
+ Improve libntp.a dependency checking
+
+ ntpq/Makefile.am@1.52 +6 -1
+ Improve libntp.a dependency checking
+
+ ntpsnmpd/Makefile.am@1.24 +9 -1
+ Improve libntp.a dependency checking
+
+ sntp/Makefile.am@1.47.1.3 +5 -1
+ Improve libntp.a dependency checking
+
+ util/Makefile.am@1.55 +6 -1
+ Improve libntp.a dependency checking
+
+ChangeSet@1.2422.1.19, 2011-01-12 15:59:20-05:00, stenn@deacon.udel.edu
+ Keep AC_PROG_LIBTOOL, instead of changing to LT_INIT
+
+ configure.ac@1.511 +1 -1
+ Keep AC_PROG_LIBTOOL, instead of changing to LT_INIT
+
+ sntp/configure.ac@1.50.1.4 +1 -1
+ Keep AC_PROG_LIBTOOL, instead of changing to LT_INIT
+
+ChangeSet@1.2422.1.18, 2011-01-12 05:23:49+00:00, davehart@shiny.ad.hartbrothers.com
+ Add configure --without-sntp option to disable building sntp and
+ sntp/tests. withsntp=no in the environment changes the default.
+ Build infrastructure cleanup:
+ Move m4 directory to sntp/m4.
+ Share a single set of genver output between sntp and the top level.
+ Share a single set of autogen included .defs in sntp/include.
+ Share a single set of build-aux scripts (e.g. config.guess, missing).
+ Add ntp_libntp.m4 and ntp_ipv6.m4 to reduce configure.ac duplication.
+ Warn and exit build/flock-build if bootstrap needs to be run.
+
+ BitKeeper/deleted/cc/excludes~3e480692@1.6 +0 -0
+ Rename: excludes -> BitKeeper/deleted/cc/excludes~3e480692
+
+ ChangeLog@1.770 +9 -0
+ Add configure --without-sntp option to disable building sntp and
+ sntp/tests. withsntp=no in the environment changes the default.
+ Build infrastructure cleanup:
+ Move m4 directory to sntp/m4.
+ Share a single set of genver output between sntp and the top level.
+ Share a single set of autogen included .defs in sntp/include.
+ Share a single set of build-aux scripts (e.g. config.guess, missing).
+ Add ntp_libntp.m4 and ntp_ipv6.m4 to reduce configure.ac duplication.
+ Warn and exit build/flock-build if bootstrap needs to be run.
+
+
+ Makefile.am@1.104 +10 -40
+ move m4 subdir to sntp/m4.
+ use sntp/version.* files directly in top-level.
+ remove old CVS leftover file "excludes"
+
+ adjtimed/Makefile.am@1.8 +10 -1
+ Use CFGLAGS_NTP, AM_CFLAGS and leave CFLAGS to end user.
+
+ bootstrap@1.37 +12 -17
+ no more duplication of version.* to sntp subdir
+
+ build@1.42 +7 -4
+ use build-aux directory for autotools scripts.
+ Error out if bootstrap is needed.
+
+ clockstuff/Makefile.am@1.15 +15 -8
+ move autogen included .def files to sntp/include
+
+ configure.ac@1.510 +13 -805
+ move m4 subdir to sntp/m4
+ use sntp/version.* files directly in top-level
+ move hunks of common code to ntp_libntp.m4 and ntp_ipv6.m4
+
+ flock-build@1.48 +5 -1
+ Error out if bootstrap is needed.
+ Change with the times, default LIST=pogo
+
+ include/Makefile.am@1.43 +0 -1
+ move autogen included files to sntp/include.
+
+ include/lib_strbuf.h@1.9 +1 -2
+ No need to call init_lib(), lib_nextbuf is already zero initially.
+
+ include/ntp_stdlib.h@1.57 +3 -0
+ add errno_to_str() thread-safe alternative to strerror()
+
+ kernel/Makefile.am@1.4 +0 -1
+ remove ancient cruft
+
+ kernel/sys/Makefile.am@1.5 +0 -1
+ remove old cruft
+
+ libntp/Makefile.am@1.57 +9 -4
+ Use CFGLAGS_NTP, AM_CFLAGS and leave CFLAGS to end user.
+
+ libntp/lib_strbuf.c@1.7 +2 -3
+ no need to zero lib_nextbuf in init_lib(), it's zero initially.
+
+ libntp/msyslog.c@1.32 +45 -4
+ add errno_to_str(), thread-safe alternative to strerror()
+
+ libparse/Makefile.am@1.22 +7 -3
+ Use CFGLAGS_NTP, AM_CFLAGS and leave CFLAGS to end user.
+
+ ntpd/Makefile.am@1.97 +20 -11
+ move autogen included .def files to sntp/include
+
+ ntpdate/Makefile.am@1.25 +12 -8
+ move version to sntp/version
+
+ ntpdc/Makefile.am@1.55 +23 -14
+ move autogen included .def files to sntp/include
+
+ ntpq/Makefile.am@1.51 +20 -13
+ move autogen included .def files to sntp/include
+
+ ntpsnmpd/Makefile.am@1.23 +17 -11
+ move autogen included .def files to sntp/include
+
+ parseutil/Makefile.am@1.13 +4 -2
+ Use CFGLAGS_NTP, AM_CFLAGS and leave CFLAGS to end user.
+
+ ports/winnt/include/config.h@1.92 +4 -4
+ add errno_to_str(), thread-safe alternative to strerror()
+
+ ports/winnt/libntp/syslog.c@1.8 +5 -3
+ Use LIB_GETBUF instead of a static buffer for ntp_strerror()
+
+ ports/winnt/scripts/mkver.bat@1.13 +4 -4
+ move version to sntp/version
+
+ scripts/genver@1.7 +7 -7
+ move m4 subdir to sntp/m4
+ use sntp/version.* files directly in top-level
+
+ sntp/Makefile.am@1.47.1.2 +63 -75
+ move m4 subdir to sntp/m4
+ use sntp/version.* files directly in top-level
+ add --without-sntp configure option
+ remove FRC from libntp.a rule, it trips up BSD make
+
+ sntp/configure.ac@1.50.1.3 +11 -751
+ move m4 subdir to sntp/m4
+ use sntp/version.* files directly in top-level
+ move hunks of common m4sh code to ntp_libntp.m4 and ntp_ipv6.m4
+
+ sntp/include/Makefile.am@1.1 +18 -0
+ move autogen-included .def files to sntp/include
+
+ sntp/include/Makefile.am@1.0 +0 -0
+
+ sntp/include/autogen-version.def@1.5 +0 -0
+ Rename: include/autogen-version.def -> sntp/include/autogen-version.def
+
+ sntp/include/copyright.def@1.15 +1 -1
+ move version.m4 to sntp/m4
+
+ sntp/include/copyright.def@1.14 +0 -0
+ Rename: include/copyright.def -> sntp/include/copyright.def
+
+ sntp/include/debug-opt.def@1.6 +0 -0
+ Rename: include/debug-opt.def -> sntp/include/debug-opt.def
+
+ sntp/include/homerc.def@1.2 +0 -0
+ Rename: include/homerc.def -> sntp/include/homerc.def
+
+ sntp/m4/define_dir.m4@1.3 +0 -0
+ Rename: m4/define_dir.m4 -> sntp/m4/define_dir.m4
+
+ sntp/m4/ntp_cacheversion.m4@1.11 +0 -0
+ Rename: m4/ntp_cacheversion.m4 -> sntp/m4/ntp_cacheversion.m4
+
+ sntp/m4/ntp_dir_sep.m4@1.4 +0 -0
+ Rename: m4/ntp_dir_sep.m4 -> sntp/m4/ntp_dir_sep.m4
+
+ sntp/m4/ntp_googletest.m4@1.2 +0 -0
+ Rename: m4/ntp_googletest.m4 -> sntp/m4/ntp_googletest.m4
+
+ sntp/m4/ntp_ipv6.m4@1.1 +527 -0
+ Consolidate duplicated IPv6 detection between configure.ac and sntp/configure.ac
+
+ sntp/m4/ntp_ipv6.m4@1.0 +0 -0
+
+ sntp/m4/ntp_lib_m.m4@1.3 +0 -0
+ Rename: m4/ntp_lib_m.m4 -> sntp/m4/ntp_lib_m.m4
+
+ sntp/m4/ntp_libntp.m4@1.1 +281 -0
+ Add configure --without-sntp option to disable building sntp and
+ sntp/tests. withsntp=no in the environment changes the default.
+
+
+ sntp/m4/ntp_libntp.m4@1.0 +0 -0
+
+ sntp/m4/ntp_lineeditlibs.m4@1.11 +0 -0
+ Rename: m4/ntp_lineeditlibs.m4 -> sntp/m4/ntp_lineeditlibs.m4
+
+ sntp/m4/ntp_openssl.m4@1.15 +18 -8
+ modify CPPFLAGS_NTP not end-user variable CPPFLAGS
+
+ sntp/m4/ntp_openssl.m4@1.14 +0 -0
+ Rename: m4/ntp_openssl.m4 -> sntp/m4/ntp_openssl.m4
+
+ sntp/m4/ntp_vpathhack.m4@1.5 +0 -0
+ Rename: m4/ntp_vpathhack.m4 -> sntp/m4/ntp_vpathhack.m4
+
+ sntp/m4/os_cflags.m4@1.8 +2 -2
+ modify CFLAGS_NTP not end-user variable CFLAGS
+
+ sntp/m4/os_cflags.m4@1.7 +0 -0
+ Rename: m4/os_cflags.m4 -> sntp/m4/os_cflags.m4
+
+ sntp/tests/Makefile.am@1.19 +9 -4
+ use a single NTP_CROSSCOMPILE conditional for sntp and top-level
+ stay out of user CFLAGS, CPPFLAGS
+
+ tests/libntp/Makefile.am@1.28 +14 -3
+ use AM_CFLAGS and leave CFLAGS to end-user
+
+ util/Makefile.am@1.54 +20 -13
+ move autogen included .def files to sntp/include
+ keep hands off CFLAGS, CPPFLAGS so end-user can override at make time.
+
+ChangeSet@1.2452, 2011-01-11 11:18:09+00:00, stenn@psp-fb1.ntp.org
+ Implement -u for sntp
+
+ sntp/main.c@1.64 +1 -1
+ Implement -u for sntp
+
+ChangeSet@1.2451, 2011-01-11 11:01:26+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/networking.h@1.24 +0 -11
+ cleanup
+
+ChangeSet@1.2450, 2011-01-11 08:38:31+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/networking.c@1.56 +25 -317
+ cleanup
+
+ sntp/sntp-opts.c@1.119 +23 -2
+ cleanup
+
+ sntp/sntp-opts.def@1.23 +8 -0
+ cleanup
+
+ sntp/sntp-opts.h@1.119 +14 -7
+ cleanup
+
+ sntp/sntp-opts.texi@1.119 +9 -1
+ cleanup
+
+ sntp/sntp.1@1.119 +6 -1
+ cleanup
+
+ sntp/sntp.html@1.119 +17 -0
+ cleanup
+
+ChangeSet@1.2449, 2011-01-11 07:49:54+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.63 +5 -0
+ cleanup
+
+ChangeSet@1.2448, 2011-01-11 06:43:59+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.62 +2 -1
+ cleanup
+
+ChangeSet@1.2447, 2011-01-11 05:39:51+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.61 +1 -1
+ cleanup
+
+ChangeSet@1.2446, 2011-01-11 05:34:29+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/kod_management.c@1.25 +2 -2
+ cleanup
+
+ sntp/main.c@1.60 +4 -4
+ cleanup
+
+ sntp/networking.c@1.55 +2 -2
+ cleanup
+
+ChangeSet@1.2445, 2011-01-11 05:17:39+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.59 +205 -101
+ cleanup
+
+ChangeSet@1.2444, 2011-01-11 01:41:18+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.58 +2 -2
+ cleanup
+
+ChangeSet@1.2443, 2011-01-11 01:32:44+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.57 +71 -111
+ cleanup
+
+ sntp/sntp-opts.c@1.118 +6 -5
+ cleanup
+
+ sntp/sntp-opts.def@1.22 +3 -0
+ cleanup
+
+ sntp/sntp-opts.h@1.118 +1 -1
+ cleanup
+
+ sntp/sntp-opts.texi@1.118 +9 -1
+ cleanup
+
+ sntp/sntp.1@1.118 +6 -2
+ cleanup
+
+ sntp/sntp.html@1.118 +9 -2
+ cleanup
+
+ChangeSet@1.2442, 2011-01-10 23:45:26+00:00, stenn@psp-fb1.ntp.org
+ debug level cleanup
+
+ sntp/main.c@1.56 +3 -5
+ debug level cleanup
+
+ sntp/networking.c@1.54 +1 -4
+ debug level cleanup
+
+ChangeSet@1.2441, 2011-01-10 23:29:43+00:00, stenn@psp-fb1.ntp.org
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ sntp/main.c@1.55 +16 -4
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ sntp/sntp-opts.c@1.117 +134 -29
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ sntp/sntp-opts.def@1.21 +48 -16
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ sntp/sntp-opts.h@1.117 +29 -13
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ sntp/sntp-opts.texi@1.117 +57 -9
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ sntp/sntp.1@1.117 +28 -6
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ sntp/sntp.html@1.117 +89 -27
+ autogen cleanup, debug level cleanup, add --concurrent support
+
+ChangeSet@1.2422.1.17, 2011-01-10 11:38:28+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P116
+ TAG: NTP_4_2_7P116
+
+ ChangeLog@1.769 +1 -0
+ NTP_4_2_7P116
+
+ clockstuff/clktest-opts.c@1.40 +2 -2
+ NTP_4_2_7P116
+
+ clockstuff/clktest-opts.h@1.40 +3 -3
+ NTP_4_2_7P116
+
+ ntpd/ntpd-opts.c@1.120 +2 -2
+ NTP_4_2_7P116
+
+ ntpd/ntpd-opts.h@1.120 +3 -3
+ NTP_4_2_7P116
+
+ ntpd/ntpd-opts.texi@1.118 +2 -2
+ NTP_4_2_7P116
+
+ ntpd/ntpd.1@1.118 +2 -2
+ NTP_4_2_7P116
+
+ ntpdc/ntpdc-opts.c@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpdc/ntpdc-opts.h@1.117 +3 -3
+ NTP_4_2_7P116
+
+ ntpdc/ntpdc-opts.texi@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpdc/ntpdc.1@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpq/ntpq-opts.c@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpq/ntpq-opts.h@1.117 +3 -3
+ NTP_4_2_7P116
+
+ ntpq/ntpq-opts.texi@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpq/ntpq.1@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.117 +3 -3
+ NTP_4_2_7P116
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.117 +2 -2
+ NTP_4_2_7P116
+
+ ntpsnmpd/ntpsnmpd.1@1.117 +2 -2
+ NTP_4_2_7P116
+
+ packageinfo.sh@1.118 +1 -1
+ NTP_4_2_7P116
+
+ sntp/sntp-opts.c@1.115.1.2 +2 -2
+ NTP_4_2_7P116
+
+ sntp/sntp-opts.h@1.115.1.2 +3 -3
+ NTP_4_2_7P116
+
+ sntp/sntp-opts.texi@1.115.1.2 +2 -2
+ NTP_4_2_7P116
+
+ sntp/sntp.1@1.115.1.2 +2 -2
+ NTP_4_2_7P116
+
+ sntp/sntp.html@1.115.1.2 +2 -2
+ NTP_4_2_7P116
+
+ util/ntp-keygen-opts.c@1.115 +2 -2
+ NTP_4_2_7P116
+
+ util/ntp-keygen-opts.h@1.115 +3 -3
+ NTP_4_2_7P116
+
+ util/ntp-keygen-opts.texi@1.118 +2 -2
+ NTP_4_2_7P116
+
+ util/ntp-keygen.1@1.118 +2 -2
+ NTP_4_2_7P116
+
+ChangeSet@1.2422.1.16, 2011-01-10 00:22:04+00:00, davehart@shiny.ad.hartbrothers.com
+ refclock_nmea.c refactoring by Juergen Perlinger.
+
+ ChangeLog@1.768 +1 -0
+ refclock_nmea.c refactoring by Juergen Perlinger.
+
+ html/drivers/driver20.html@1.23 +99 -341
+ restore current ntp-dev driver20.html, all html edits need to
+ flow through Dr. Mills.
+
+ ntpd/refclock_nmea.c@1.58 +24 -22
+ refclock_nmea.c refactoring by Juergen Perlinger.
+
+ChangeSet@1.2254.1.3, 2011-01-09 20:19:31+00:00, davehart@shiny.ad.hartbrothers.com
+ minor style cleanup of Juergen's refactored NMEA driver
+
+ libntp/atouint.c@1.4 +18 -12
+ Add detailed atouint() doc comment
+
+ ntpd/refclock_nmea.c@1.57 +142 -91
+ minor style cleanup of Juergen's refactored NMEA driver
+
+ChangeSet@1.2422.1.14, 2011-01-09 12:55:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P115
+ TAG: NTP_4_2_7P115
+
+ ChangeLog@1.767 +1 -0
+ NTP_4_2_7P115
+
+ clockstuff/clktest-opts.c@1.39 +2 -2
+ NTP_4_2_7P115
+
+ clockstuff/clktest-opts.h@1.39 +3 -3
+ NTP_4_2_7P115
+
+ ntpd/ntpd-opts.c@1.119 +2 -2
+ NTP_4_2_7P115
+
+ ntpd/ntpd-opts.h@1.119 +3 -3
+ NTP_4_2_7P115
+
+ ntpd/ntpd-opts.texi@1.117 +2 -2
+ NTP_4_2_7P115
+
+ ntpd/ntpd.1@1.117 +2 -2
+ NTP_4_2_7P115
+
+ ntpdc/ntpdc-opts.c@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpdc/ntpdc-opts.h@1.116 +3 -3
+ NTP_4_2_7P115
+
+ ntpdc/ntpdc-opts.texi@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpdc/ntpdc.1@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpq/ntpq-opts.c@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpq/ntpq-opts.h@1.116 +3 -3
+ NTP_4_2_7P115
+
+ ntpq/ntpq-opts.texi@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpq/ntpq.1@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.116 +3 -3
+ NTP_4_2_7P115
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.116 +2 -2
+ NTP_4_2_7P115
+
+ ntpsnmpd/ntpsnmpd.1@1.116 +2 -2
+ NTP_4_2_7P115
+
+ packageinfo.sh@1.117 +1 -1
+ NTP_4_2_7P115
+
+ sntp/sntp-opts.c@1.115.1.1 +2 -2
+ NTP_4_2_7P115
+
+ sntp/sntp-opts.h@1.115.1.1 +3 -3
+ NTP_4_2_7P115
+
+ sntp/sntp-opts.texi@1.115.1.1 +2 -2
+ NTP_4_2_7P115
+
+ sntp/sntp.1@1.115.1.1 +2 -2
+ NTP_4_2_7P115
+
+ sntp/sntp.html@1.115.1.1 +2 -2
+ NTP_4_2_7P115
+
+ util/ntp-keygen-opts.c@1.114 +2 -2
+ NTP_4_2_7P115
+
+ util/ntp-keygen-opts.h@1.114 +3 -3
+ NTP_4_2_7P115
+
+ util/ntp-keygen-opts.texi@1.117 +2 -2
+ NTP_4_2_7P115
+
+ util/ntp-keygen.1@1.117 +2 -2
+ NTP_4_2_7P115
+
+ChangeSet@1.2440, 2011-01-09 12:14:54+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/kod_management.c@1.24 +6 -12
+ cleanup
+
+ sntp/main.c@1.54 +81 -104
+ cleanup
+
+ sntp/networking.c@1.53 +7 -5
+ cleanup
+
+ChangeSet@1.2439, 2011-01-09 10:34:59+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.53 +6 -1
+ cleanup
+
+ChangeSet@1.2438, 2011-01-09 10:23:51+00:00, stenn@psp-fb1.ntp.org
+ progress and cleanup
+
+ sntp/main.c@1.52 +15 -77
+ progress and cleanup
+
+ sntp/networking.c@1.52 +38 -63
+ progress and cleanup
+
+ChangeSet@1.2437, 2011-01-09 08:32:33+00:00, stenn@psp-fb1.ntp.org
+ debug cleanup. Use our stock Version string stuff
+
+ sntp/Makefile.am@1.50 +18 -1
+ debug cleanup. Use our stock Version string stuff
+
+ sntp/networking.c@1.51 +13 -8
+ debug cleanup. Use our stock Version string stuff
+
+ChangeSet@1.2436, 2011-01-09 06:52:29+00:00, stenn@psp-fb1.ntp.org
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/configure.ac@1.54 +16 -0
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/crypto.c@1.16 +2 -2
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/kod_management.c@1.23 +1 -1
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/main.c@1.51 +15 -9
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/main.h@1.3 +1 -0
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/networking.c@1.50 +24 -24
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/sntp-opts.c@1.116 +107 -49
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/sntp-opts.def@1.20 +1 -12
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/sntp-opts.h@1.116 +34 -27
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/sntp-opts.texi@1.116 +35 -12
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/sntp.1@1.116 +15 -10
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ sntp/sntp.html@1.116 +107 -58
+ Use the same "debug" mechanism that the rest of NTP uses
+
+ChangeSet@1.2435, 2011-01-09 05:00:18+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_io.c minor cleanup
+ sntp/main.c use sockaddr_u in new code
+
+ ntpd/ntp_io.c@1.347 +2 -2
+ INADDR_ANY is in network order, match IPv6 code
+
+ sntp/main.c@1.50 +31 -33
+ use sockaddr_u, ntp_net.h macros
+ memset() -> ZERO()
+
+ChangeSet@1.2434, 2011-01-09 04:28:36+00:00, stenn@psp-fb1.ntp.org
+ Use sptoa() in various places, so we can see the port #
+
+ sntp/networking.c@1.49 +7 -9
+ Use sptoa() in various places, so we can see the port #
+
+ChangeSet@1.2433, 2011-01-09 03:44:33+00:00, stenn@psp-fb1.ntp.org
+ cleanup
+
+ sntp/main.c@1.49 +54 -25
+ cleanup
+
+ChangeSet@1.2422.1.13, 2011-01-09 02:46:20+00:00, davehart@shiny.ad.hartbrothers.com
+ correct ntpq nextvar() warning cleanp
+
+ ntpq/ntpq.c@1.130 +2 -2
+ min()/max() mixup
+
+ChangeSet@1.2431, 2011-01-09 01:21:24+00:00, stenn@psp-fb1.ntp.org
+ cleanup, and start in on the NTP packet callback
+
+ sntp/main.c@1.47 +63 -34
+ cleanup, and start in on the NTP packet callback
+
+ChangeSet@1.2422.1.12, 2011-01-08 20:34:39+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1781] longlong undefined in sntp handle_pkt() on Debian amd64.
+ Bump deps-ver and sntp/deps-ver to force each directory to be cleaned once,
+ to work around build breaks triggered by changing erealloc() and
+ estrdup() from functions to macros.
+
+ ChangeLog@1.766 +1 -0
+ [Bug 1781] longlong undefined in sntp handle_pkt() on Debian amd64.
+
+ deps-ver@1.4 +1 -1
+ force each directory to be cleaned once, to work around build
+ breaks triggered by changing erealloc() and estrdup() from
+ functions to macros.
+
+ ntpd/ntp_control.c@1.161 +1 -1
+ more gcc 4.5.2 warning hunting
+
+ ntpq/ntpq.c@1.129 +23 -22
+ more gcc 4.5.2 warning hunting
+
+ sntp/Makefile.am@1.47.1.1 +1 -1
+ let libntp Makefile decide if libntp.a is up to date, fixes
+ building in sntp subdir before top level.
+
+ sntp/deps-ver@1.2 +1 -1
+ force each directory to be cleaned once, to work around build
+ breaks triggered by changing erealloc() and estrdup() from
+ functions to macros.
+
+ sntp/main.c@1.41.1.2 +1 -1
+ [Bug 1781] longlong undefined in sntp handle_pkt() on Debian amd64.
+
+ tests/libntp/Makefile.am@1.27 +1 -1
+ @LCRYPTO@ after libntp.a in LDADD
+
+ChangeSet@1.2422.1.11, 2011-01-08 10:54:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1780] Windows ntpd 4.2.7p114 crashes in ioctl().
+
+ ChangeLog@1.765 +1 -0
+ [Bug 1780] Windows ntpd 4.2.7p114 crashes in ioctl().
+
+ libntp/socket.c@1.3 +8 -0
+ [Bug 1780] Windows ntpd 4.2.7p114 crashes in ioctl().
+
+ ntpd/ntp_io.c@1.346 +1 -69
+ [Bug 1780] Windows ntpd 4.2.7p114 crashes in ioctl().
+
+ChangeSet@1.2422.1.10, 2011-01-08 09:53:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P114
+ TAG: NTP_4_2_7P114
+
+ ChangeLog@1.764 +1 -0
+ NTP_4_2_7P114
+
+ clockstuff/clktest-opts.c@1.38 +2 -2
+ NTP_4_2_7P114
+
+ clockstuff/clktest-opts.h@1.38 +3 -3
+ NTP_4_2_7P114
+
+ ntpd/ntpd-opts.c@1.118 +2 -2
+ NTP_4_2_7P114
+
+ ntpd/ntpd-opts.h@1.118 +3 -3
+ NTP_4_2_7P114
+
+ ntpd/ntpd-opts.texi@1.116 +2 -2
+ NTP_4_2_7P114
+
+ ntpd/ntpd.1@1.116 +2 -2
+ NTP_4_2_7P114
+
+ ntpdc/ntpdc-opts.c@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpdc/ntpdc-opts.h@1.115 +3 -3
+ NTP_4_2_7P114
+
+ ntpdc/ntpdc-opts.texi@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpdc/ntpdc.1@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpq/ntpq-opts.c@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpq/ntpq-opts.h@1.115 +3 -3
+ NTP_4_2_7P114
+
+ ntpq/ntpq-opts.texi@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpq/ntpq.1@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.115 +3 -3
+ NTP_4_2_7P114
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.115 +2 -2
+ NTP_4_2_7P114
+
+ ntpsnmpd/ntpsnmpd.1@1.115 +2 -2
+ NTP_4_2_7P114
+
+ packageinfo.sh@1.116 +1 -1
+ NTP_4_2_7P114
+
+ sntp/sntp-opts.c@1.115 +2 -2
+ NTP_4_2_7P114
+
+ sntp/sntp-opts.h@1.115 +3 -3
+ NTP_4_2_7P114
+
+ sntp/sntp-opts.texi@1.115 +2 -2
+ NTP_4_2_7P114
+
+ sntp/sntp.1@1.115 +2 -2
+ NTP_4_2_7P114
+
+ sntp/sntp.html@1.115 +2 -2
+ NTP_4_2_7P114
+
+ util/ntp-keygen-opts.c@1.113 +2 -2
+ NTP_4_2_7P114
+
+ util/ntp-keygen-opts.h@1.113 +3 -3
+ NTP_4_2_7P114
+
+ util/ntp-keygen-opts.texi@1.116 +2 -2
+ NTP_4_2_7P114
+
+ util/ntp-keygen.1@1.116 +2 -2
+ NTP_4_2_7P114
+
+ChangeSet@1.2422.1.9, 2011-01-08 08:45:17+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix for openssl pkg-config detection eval failure.
+ (applies to prior cset)
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ ChangeLog@1.763 +4 -0
+ Fix for openssl pkg-config detection eval failure.
+ (applies to prior cset)
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ configure.ac@1.509 +1 -43
+ Accept gtest versions greater than 1.5
+ Move google test detection to m4\ntp_googletest.m4
+
+ include/lib_strbuf.h@1.8 +1 -1
+ memset() -> ZERO()
+
+ include/ntp_control.h@1.56 +1 -1
+ rename ctl_trap[] to ctl_traps[] to be distinct from struct tag
+
+ include/ntp_malloc.h@1.5 +17 -0
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ include/ntp_net.h@1.11 +2 -1
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ include/ntp_rfc2553.h@1.37 +11 -7
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ include/ntp_stdlib.h@1.56 +27 -14
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ libntp/authkeys.c@1.21 +2 -2
+ memset() -> ZERO()
+
+ libntp/decodenetnum.c@1.13 +1 -1
+ memset() -> ZERO()
+
+ libntp/dofptoa.c@1.8 +1 -1
+ memset() -> ZERO()
+
+ libntp/dolfptoa.c@1.10 +1 -1
+ memset() -> ZERO()
+
+ libntp/emalloc.c@1.14 +56 -102
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ libntp/netof.c@1.9 +1 -1
+ memset() -> zero_mem()
+
+ libntp/ntp_lineedit.c@1.10 +1 -1
+ memset() -> ZERO()
+
+ libntp/ntp_rfc2553.c@1.44 +7 -16
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ libntp/recvbuff.c@1.36 +3 -4
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ libntp/socktohost.c@1.12 +1 -1
+ memset() -> ZERO()
+
+ libntp/syssignal.c@1.11 +1 -1
+ memset() -> ZERO()
+
+ libntp/systime.c@1.52 +2 -2
+ memset() -> ZERO()
+
+ m4/ntp_googletest.m4@1.1 +52 -0
+ BitKeeper file C:/ntp/ntp-dev-erealloc-zero/m4/ntp_googletest.m4
+
+ m4/ntp_googletest.m4@1.0 +0 -0
+
+ ntpd/keyword-gen.c@1.17 +1 -2
+ memset() -> ZERO()
+
+ ntpd/ntp_config.c@1.283 +12 -12
+ memset() -> ZERO()
+
+ ntpd/ntp_control.c@1.160 +126 -135
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpd/ntp_intres.c@1.91 +3 -6
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpd/ntp_io.c@1.345 +16 -18
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpd/ntp_monitor.c@1.37 +4 -5
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpd/ntp_peer.c@1.146 +2 -3
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpd/ntp_refclock.c@1.101 +3 -4
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpd/ntp_request.c@1.102 +20 -43
+ memset() -> ZERO()
+
+ ntpd/ntp_restrict.c@1.34 +5 -7
+ memset() -> ZERO()
+ memset() -> zero_mem()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpd/ntp_signd.c@1.3 +5 -5
+ memset() -> ZERO()
+
+ ntpd/ntp_util.c@1.92 +2 -0
+ save a hundred bytes or so on Windows
+
+ ntpd/ntpsim.c@1.31 +2 -2
+ memset() -> ZERO()
+
+ ntpdate/ntpdate.c@1.82 +8 -8
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpdc/ntpdc.c@1.93 +10 -9
+ use erealloc_zero
+
+ ntpdc/ntpdc_ops.c@1.75 +28 -55
+ memset() -> ZERO()
+
+ ntpq/ntpq-subs.c@1.82 +36 -41
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ntpq/ntpq.c@1.128 +21 -26
+ memset() -> ZERO()
+
+ ports/winnt/include/config.h@1.91 +7 -5
+ Add erealloc_zero(), refactor estrdup(), emalloc(), emalloc_zero() to
+ separate tracking callsite file/line from using debug MS C runtime,
+ and to reduce code duplication.
+
+ ports/winnt/libntp/termios.c@1.26 +2 -3
+ erealloc() + memset() -> erealloc_zero()
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.49 +2 -2
+ memset() -> ZERO()
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.56 +2 -3
+ memset() -> ZERO()
+ emalloc() + memset() -> emalloc_zero()
+
+ ports/winnt/ntpd/ntservice.c@1.26 +1 -1
+ memset() -> ZERO()
+
+ sntp/configure.ac@1.50.1.2 +3 -42
+ Move google test detection to m4\ntp_googletest.m4
+
+ sntp/tests/Makefile.am@1.18 +4 -4
+ put @GTEST_LDFLAGS@ @GTEST_LIBS@ after @LCRYPTO@ in LDADD
+
+ChangeSet@1.2422.3.2, 2011-01-07 17:46:18+00:00, davehart@shiny.ad.hartbrothers.com
+ use tr to deal with trailing newline from pkg-config in ntp_openssl.m4
+
+ m4/ntp_openssl.m4@1.13 +4 -6
+ use tr to deal with trailing newline from pkg-config in ntp_openssl.m4
+
+ChangeSet@1.2422.3.1, 2011-01-07 15:31:38+00:00, davehart@shiny.ad.hartbrothers.com
+ add libntp/socket.c references to Windows libntp projects.
+
+ ports/winnt/vc6/libntp.dsp@1.58 +4 -0
+ add libntp/socket.c references to Windows libntp projects.
+
+ ports/winnt/vs2003/libntp.vcproj@1.16 +3 -18
+ add libntp/socket.c references to Windows libntp projects.
+
+ ports/winnt/vs2005/libntp.vcproj@1.14 +4 -18
+ add libntp/socket.c references to Windows libntp projects.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.35 +6 -16
+ add libntp/socket.c references to Windows libntp projects.
+
+ChangeSet@1.2429, 2011-01-07 11:34:06+00:00, stenn@psp-fb1.ntp.org
+ first cut at key auth and the initial packet send for SNTP
+
+ sntp/main.c@1.46 +83 -1
+ first cut at key auth and the initial packet send
+
+ChangeSet@1.2422.1.7, 2011-01-07 11:16:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P113
+ TAG: NTP_4_2_7P113
+
+ ChangeLog@1.762 +1 -0
+ NTP_4_2_7P113
+
+ clockstuff/clktest-opts.c@1.37 +2 -2
+ NTP_4_2_7P113
+
+ clockstuff/clktest-opts.h@1.37 +3 -3
+ NTP_4_2_7P113
+
+ ntpd/ntpd-opts.c@1.117 +2 -2
+ NTP_4_2_7P113
+
+ ntpd/ntpd-opts.h@1.117 +3 -3
+ NTP_4_2_7P113
+
+ ntpd/ntpd-opts.texi@1.115 +2 -2
+ NTP_4_2_7P113
+
+ ntpd/ntpd.1@1.115 +2 -2
+ NTP_4_2_7P113
+
+ ntpdc/ntpdc-opts.c@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpdc/ntpdc-opts.h@1.114 +3 -3
+ NTP_4_2_7P113
+
+ ntpdc/ntpdc-opts.texi@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpdc/ntpdc.1@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpq/ntpq-opts.c@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpq/ntpq-opts.h@1.114 +3 -3
+ NTP_4_2_7P113
+
+ ntpq/ntpq-opts.texi@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpq/ntpq.1@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.114 +3 -3
+ NTP_4_2_7P113
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.114 +2 -2
+ NTP_4_2_7P113
+
+ ntpsnmpd/ntpsnmpd.1@1.114 +2 -2
+ NTP_4_2_7P113
+
+ packageinfo.sh@1.115 +1 -1
+ NTP_4_2_7P113
+
+ sntp/sntp-opts.c@1.114 +2 -2
+ NTP_4_2_7P113
+
+ sntp/sntp-opts.h@1.114 +3 -3
+ NTP_4_2_7P113
+
+ sntp/sntp-opts.texi@1.114 +2 -2
+ NTP_4_2_7P113
+
+ sntp/sntp.1@1.114 +2 -2
+ NTP_4_2_7P113
+
+ sntp/sntp.html@1.114 +2 -2
+ NTP_4_2_7P113
+
+ util/ntp-keygen-opts.c@1.112 +2 -2
+ NTP_4_2_7P113
+
+ util/ntp-keygen-opts.h@1.112 +3 -3
+ NTP_4_2_7P113
+
+ util/ntp-keygen-opts.texi@1.115 +2 -2
+ NTP_4_2_7P113
+
+ util/ntp-keygen.1@1.115 +2 -2
+ NTP_4_2_7P113
+
+ChangeSet@1.2428, 2011-01-07 09:30:07+00:00, stenn@psp-fb1.ntp.org
+ Handle initial socket creation for sntp
+
+ sntp/main.c@1.45 +27 -5
+ progress
+
+ChangeSet@1.2422.1.6, 2011-01-07 04:16:46-05:00, stenn@deacon.udel.edu
+ portability adjustment
+
+ include/ntp_io.h@1.20 +2 -1
+ portability adjustment
+
+ChangeSet@1.2422.1.5, 2011-01-07 04:03:07-05:00, stenn@deacon.udel.edu
+ typo
+
+ libntp/socket.c@1.2 +1 -1
+ typo
+
+ChangeSet@1.2422.1.4, 2011-01-07 03:38:35-05:00, stenn@deacon.udel.edu
+ Begin moving some of the low-level socket stuff to libntp
+
+ ChangeLog@1.761 +1 -0
+ Begin moving some of the low-level socket stuff to libntp
+
+ include/Makefile.am@1.42 +1 -0
+ Begin moving some of the low-level socket stuff to libntp
+
+ include/libntp.h@1.1 +16 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/libntp.h
+
+ include/libntp.h@1.0 +0 -0
+
+ include/ntp_io.h@1.19 +1 -0
+ Begin moving some of the low-level socket stuff to libntp
+
+ libntp/Makefile.am@1.56 +1 -0
+ Begin moving some of the low-level socket stuff to libntp
+
+ libntp/socket.c@1.1 +732 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libntp/socket.c
+
+ libntp/socket.c@1.0 +0 -0
+
+ ntpd/ntp_io.c@1.344 +8 -11
+ Begin moving some of the low-level socket stuff to libntp
+
+ChangeSet@1.2422.2.1, 2011-01-06 23:06:38-05:00, stenn@deacon.udel.edu
+ If the subject-name begins with @, prefix it with the certname
+
+ util/ntp-keygen.c@1.73.1.1 +10 -2
+ If the subject-name begins with @, prefix it with the certname
+
+ChangeSet@1.2422.1.2, 2011-01-06 20:56:23+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1776] sntp mishandles -t/--timeout and -a/--authentication.
+ Default to silent make rules, override with make V=1 or ./configure
+ --disable-silent-rules.
+ Correct --with-openssl-incdir defaulting with pkg-config.
+ Correct ./build on systems without gtest available.
+
+ ChangeLog@1.760 +5 -0
+ [Bug 1776] sntp mishandles -t/--timeout and -a/--authentication.
+ Default to silent make rules, override with make V=1 or ./configure
+ --disable-silent-rules.
+ Correct --with-openssl-incdir defaulting with pkg-config.
+ Correct ./build on systems without gtest available.
+
+ build@1.41 +1 -5
+ Do not attempt to build tests unconditionally, some systems do not have gtest.
+
+ configure.ac@1.508 +2 -40
+ default to silent make rules.
+ move --without-rpath/need_dash_r logic to m4/ntp_openssl.m4 which depends on it.
+
+ include/ntp_md5.h@1.7 +1 -1
+ quiet gcc 4.5.1 warning re: pointers to incompatible types
+
+ libntp/ssl_init.c@1.13 +1 -1
+ quiet unused local warning building w/o openssl
+
+ libparse/Makefile.am@1.21 +2 -17
+ Remove old transitional rule from move of generated .c to $srcdir
+
+ m4/ntp_openssl.m4@1.12 +58 -7
+ Correct --with-openssl-incdir defaulting with pkg-config.
+
+ ntpd/ntp_control.c@1.159 +2 -2
+ quiet shadowing warning seen on linux
+
+ ntpd/ntp_io.c@1.343 +1 -0
+ quiet used potentially uninit warning for some members of sockaddr_u
+
+ ntpd/ntp_peer.c@1.145 +5 -5
+ quiet "group" shadows global warning
+
+ ntpd/ntp_refclock.c@1.100 +1 -1
+ correct printf() format to match change from int to size_t
+
+ ntpd/refclock_acts.c@1.44 +1 -1
+ printf format mismatch %d vs size_t
+
+ ntpdate/ntpdate.c@1.81 +1 -1
+ quiet warning re: recvfrom() fromlen arg by using socklen_t not int.
+
+ ntpdc/ntpdc.c@1.92 +2 -1
+ correct printf() args to match change from int to size_t
+
+ ntpq/ntpq-subs.c@1.81 +16 -15
+ correct printf format mismatch warnings.
+
+ ntpq/ntpq.c@1.127 +12 -16
+ correct printf format mismatch warnings.
+
+ sntp/configure.ac@1.50.1.1 +2 -2
+ default to silent make rules
+
+ sntp/main.c@1.41.1.1 +22 -9
+ [Bug 1776] sntp mishandles -t/--timeout and -a/--authentication.
+ tighten resolve_hosts 1st arg constness to quiet gcc 4.5.1 warning.
+
+ sntp/networking.c@1.46.1.1 +10 -8
+ [Bug 1776] sntp mishandles -t/--timeout and -a/--authentication.
+ tighten resolve_hosts 1st arg constness to quiet gcc 4.5.1 warning.
+
+ sntp/networking.h@1.23 +2 -1
+ tighten resolve_hosts 1st arg constness to quiet gcc 4.5.1 warning.
+
+ util/ntp-keygen.c@1.74 +1 -1
+ quiet warning when building without AUTOKEY
+
+ChangeSet@1.2424, 2011-01-06 10:04:48+00:00, stenn@psp-fb1.ntp.org
+ libevent
+
+ sntp/main.c@1.43 +93 -73
+ libevent
+
+ChangeSet@1.2422.1.1, 2011-01-06 08:55:50+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P112
+ TAG: NTP_4_2_7P112
+
+ ChangeLog@1.759 +1 -0
+ NTP_4_2_7P112
+
+ clockstuff/clktest-opts.c@1.36 +2 -2
+ NTP_4_2_7P112
+
+ clockstuff/clktest-opts.h@1.36 +3 -3
+ NTP_4_2_7P112
+
+ ntpd/ntpd-opts.c@1.116 +2 -2
+ NTP_4_2_7P112
+
+ ntpd/ntpd-opts.h@1.116 +3 -3
+ NTP_4_2_7P112
+
+ ntpd/ntpd-opts.texi@1.114 +2 -2
+ NTP_4_2_7P112
+
+ ntpd/ntpd.1@1.114 +2 -2
+ NTP_4_2_7P112
+
+ ntpdc/ntpdc-opts.c@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpdc/ntpdc-opts.h@1.113 +3 -3
+ NTP_4_2_7P112
+
+ ntpdc/ntpdc-opts.texi@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpdc/ntpdc.1@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpq/ntpq-opts.c@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpq/ntpq-opts.h@1.113 +3 -3
+ NTP_4_2_7P112
+
+ ntpq/ntpq-opts.texi@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpq/ntpq.1@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.113 +3 -3
+ NTP_4_2_7P112
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.113 +2 -2
+ NTP_4_2_7P112
+
+ ntpsnmpd/ntpsnmpd.1@1.113 +2 -2
+ NTP_4_2_7P112
+
+ packageinfo.sh@1.114 +1 -1
+ NTP_4_2_7P112
+
+ sntp/sntp-opts.c@1.113 +2 -2
+ NTP_4_2_7P112
+
+ sntp/sntp-opts.h@1.113 +3 -3
+ NTP_4_2_7P112
+
+ sntp/sntp-opts.texi@1.113 +2 -2
+ NTP_4_2_7P112
+
+ sntp/sntp.1@1.113 +2 -2
+ NTP_4_2_7P112
+
+ sntp/sntp.html@1.113 +2 -2
+ NTP_4_2_7P112
+
+ util/ntp-keygen-opts.c@1.111 +2 -2
+ NTP_4_2_7P112
+
+ util/ntp-keygen-opts.h@1.111 +3 -3
+ NTP_4_2_7P112
+
+ util/ntp-keygen-opts.texi@1.114 +2 -2
+ NTP_4_2_7P112
+
+ util/ntp-keygen.1@1.114 +2 -2
+ NTP_4_2_7P112
+
+ChangeSet@1.2393.1.1, 2011-01-06 07:58:30+00:00, stenn@psp-fb1.ntp.org
+ libevent changes
+
+ m4/ntp_libevent.m4@1.1 +80 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-libevent/m4/ntp_libevent.m4
+
+ m4/ntp_libevent.m4@1.0 +0 -0
+
+ sntp/Makefile.am@1.48 +14 -7
+ libevent changes
+
+ sntp/build-libevent/Makefile.am@1.1 +61 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-dev-libevent/sntp/build-libevent/Makefile.am
+
+ sntp/build-libevent/Makefile.am@1.0 +0 -0
+
+ sntp/configure.ac@1.49.1.1 +8 -0
+ libevent changes
+
+ sntp/main.c@1.42 +252 -53
+ libevent changes
+
+ sntp/networking.c@1.47 +86 -42
+ libevent changes
+
+ChangeSet@1.2422, 2011-01-06 04:43:56+00:00, davehart@shiny.ad.hartbrothers.com
+ ./build makes unit tests with V=0 before make check
+
+ build@1.40 +4 -0
+ Build unit tests first with V=0
+
+ tests/libntp/Makefile.am@1.26 +5 -6
+ Remove tabs from $INCLUDES to make compiler command lines less sparse
+
+ChangeSet@1.2421, 2011-01-06 04:37:31+00:00, hart@psp-deb1.ntp.org
+ Use silent rules for first make invocation in build
+
+ ChangeLog@1.758 +1 -0
+ Use make V=0 in build script to increase signal/noise ratio.
+
+ build@1.39 +1 -1
+ Use make V=0 in build script to increase signal/noise ratio.
+
+ChangeSet@1.2420, 2011-01-06 04:02:24+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1773] openssl not detected during ./configure.
+ [Bug 1774] Segfaults if cryptostats enabled and built without OpenSSL.
+
+ ChangeLog@1.757 +2 -0
+ [Bug 1773] openssl not detected during ./configure.
+ [Bug 1774] Segfaults if cryptostats enabled and built without OpenSSL.
+
+
+ m4/ntp_openssl.m4@1.11 +16 -22
+ [Bug 1773] openssl not detected during ./configure.
+
+
+ ntpd/ntp_config.c@1.282 +12 -0
+ [Bug 1774] Segfaults if cryptostats enabled and built without OpenSSL.
+
+
+ ntpd/ntp_util.c@1.91 +2 -10
+ filegen_register() timingstats and cryptostats unconditionally, so we do
+ not consider them unrecognized, as it's harmless to attempt to enable
+ cryptostats with a non-autokey ntpd.
+
+ChangeSet@1.2419, 2011-01-05 08:46:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P111
+ TAG: NTP_4_2_7P111
+
+ ChangeLog@1.756 +1 -0
+ NTP_4_2_7P111
+
+ clockstuff/clktest-opts.c@1.35 +2 -2
+ NTP_4_2_7P111
+
+ clockstuff/clktest-opts.h@1.35 +3 -3
+ NTP_4_2_7P111
+
+ ntpd/ntpd-opts.c@1.115 +2 -2
+ NTP_4_2_7P111
+
+ ntpd/ntpd-opts.h@1.115 +3 -3
+ NTP_4_2_7P111
+
+ ntpd/ntpd-opts.texi@1.113 +2 -2
+ NTP_4_2_7P111
+
+ ntpd/ntpd.1@1.113 +2 -2
+ NTP_4_2_7P111
+
+ ntpdc/ntpdc-opts.c@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpdc/ntpdc-opts.h@1.112 +3 -3
+ NTP_4_2_7P111
+
+ ntpdc/ntpdc-opts.texi@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpdc/ntpdc.1@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpq/ntpq-opts.c@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpq/ntpq-opts.h@1.112 +3 -3
+ NTP_4_2_7P111
+
+ ntpq/ntpq-opts.texi@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpq/ntpq.1@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.112 +3 -3
+ NTP_4_2_7P111
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.112 +2 -2
+ NTP_4_2_7P111
+
+ ntpsnmpd/ntpsnmpd.1@1.112 +2 -2
+ NTP_4_2_7P111
+
+ packageinfo.sh@1.113 +1 -1
+ NTP_4_2_7P111
+
+ sntp/sntp-opts.c@1.112 +2 -2
+ NTP_4_2_7P111
+
+ sntp/sntp-opts.h@1.112 +3 -3
+ NTP_4_2_7P111
+
+ sntp/sntp-opts.texi@1.112 +2 -2
+ NTP_4_2_7P111
+
+ sntp/sntp.1@1.112 +2 -2
+ NTP_4_2_7P111
+
+ sntp/sntp.html@1.112 +2 -2
+ NTP_4_2_7P111
+
+ util/ntp-keygen-opts.c@1.110 +2 -2
+ NTP_4_2_7P111
+
+ util/ntp-keygen-opts.h@1.110 +3 -3
+ NTP_4_2_7P111
+
+ util/ntp-keygen-opts.texi@1.113 +2 -2
+ NTP_4_2_7P111
+
+ util/ntp-keygen.1@1.113 +2 -2
+ NTP_4_2_7P111
+
+ChangeSet@1.2418, 2011-01-05 08:08:26+00:00, davehart@shiny.ad.hartbrothers.com
+ Quiet warnings
+
+ libntp/ntp_calendar.c@1.6 +15 -15
+ Quiet definition isn't declaration warning for now(), use
+ leading tabs for indents.
+
+ libntp/ssl_init.c@1.12 +2 -2
+ Quiet warning about printf formaat mismatch re: OPENSSL_VERSION_NUMBER
+ building against OpenSSL 1.0.0c.
+
+ChangeSet@1.2417, 2011-01-05 07:35:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1772] refclock_open() return value check wrong for ACTS.
+ Default --with-openssl-libdir and --with-openssl-incdir to the values
+ from pkg-config, falling back on our usual search paths if pkg-config
+ is not available or does not have openssl.pc on PKG_CONFIG_PATH.
+ Change refclock_open() to return -1 on failure like open().
+ Update all refclock_open() callers to check for fd <= 0 indicating
+ failure, so they work with older and newer refclock_open() and can
+ easily backport.
+ Initialize refclockproc.rio.fd to -1, harmonize refclock shutdown
+ entrypoints to avoid crashing, particularly if refclock_open() fails.
+ Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+
+ ChangeLog@1.755 +12 -0
+ [Bug 1772] refclock_open() return value check wrong for ACTS.
+ Change refclock_open() to return -1 on failure like open().
+ Update all refclock_open() callers to check for fd <= 0 indicating
+ failure, so they work with older and newer refclock_open() and can
+ easily backport.
+ Initialize refclockproc.rio.fd to -1, harmonize refclock shutdown
+ entrypoints to avoid crashing, particularly if refclock_open() fails.
+ Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+
+
+ include/ntp_refclock.h@1.28 +1 -2
+ Remove refclock_ioctl() declaration, it's private to ntp_refclock.c
+
+ include/ntp_stdlib.h@1.55 +11 -0
+ SAVE_ERRNO(somecode();) macro
+
+ m4/ntp_openssl.m4@1.10 +37 -3
+ try pkg-config for openssl default location, then our traditional
+ lib and include search paths.
+
+ ntpd/ntp_io.c@1.342 +1 -0
+ initialize refclockproc.rio.fd to -1
+
+ ntpd/ntp_refclock.c@1.99 +72 -41
+ Follow open() convention for refclock_open(), returning -1 on failure.
+
+ ntpd/refclock_acts.c@1.43 +3 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_arbiter.c@1.18 +2 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_arc.c@1.23 +2 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_as2201.c@1.13 +2 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_bancomm.c@1.13 +1 -0
+ add comment about lack of io_addclock()
+
+ ntpd/refclock_chronolog.c@1.11 +2 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_dumbclock.c@1.17 +1 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_fg.c@1.12 +22 -24
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_heath.c@1.16 +3 -2
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_hpgps.c@1.12 +7 -8
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_irig.c@1.34 +1 -2
+ minor cleanup
+
+ ntpd/refclock_jjy.c@1.21 +2 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_jupiter.c@1.26 +2 -2
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_mx4200.c@1.28 +3 -3
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_oncore.c@1.91 +16 -11
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_palisade.c@1.37 +2 -3
+ minor cleanup
+
+ ntpd/refclock_pst.c@1.11 +2 -1
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_ripencc.c@1.15 +5 -8
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_trak.c@1.10 +7 -6
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_true.c@1.16 +11 -11
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_ulink.c@1.15 +11 -28
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_wwvb.c@1.26 +3 -3
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ntpd/refclock_zyfer.c@1.6 +11 -11
+ Update refclocks to treat 0 and -1 as failure so they can backport.
+
+ ports/winnt/libntp/termios.c@1.25 +44 -22
+ Follow open() convention for refclock_open(), returning -1 on failure.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.48 +26 -3
+ Enable tickadj-like taming of wildly off-spec Windows clock using
+ NTPD_TICKADJ_PPM env. var. specifying baseline slew.
+
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.37 +13 -25
+ Add refclock_fg, refclock_ulink, refclock_zyfer.c references.
+ Remove reference to nonexistent refclock_usno.c
+
+ChangeSet@1.2416, 2011-01-04 10:07:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P110
+ TAG: NTP_4_2_7P110
+
+ ChangeLog@1.754 +1 -0
+ NTP_4_2_7P110
+
+ clockstuff/clktest-opts.c@1.34 +2 -2
+ NTP_4_2_7P110
+
+ clockstuff/clktest-opts.h@1.34 +3 -3
+ NTP_4_2_7P110
+
+ ntpd/ntpd-opts.c@1.114 +2 -2
+ NTP_4_2_7P110
+
+ ntpd/ntpd-opts.h@1.114 +3 -3
+ NTP_4_2_7P110
+
+ ntpd/ntpd-opts.texi@1.112 +2 -2
+ NTP_4_2_7P110
+
+ ntpd/ntpd.1@1.112 +2 -2
+ NTP_4_2_7P110
+
+ ntpdc/ntpdc-opts.c@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpdc/ntpdc-opts.h@1.111 +3 -3
+ NTP_4_2_7P110
+
+ ntpdc/ntpdc-opts.texi@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpdc/ntpdc.1@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpq/ntpq-opts.c@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpq/ntpq-opts.h@1.111 +3 -3
+ NTP_4_2_7P110
+
+ ntpq/ntpq-opts.texi@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpq/ntpq.1@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.111 +3 -3
+ NTP_4_2_7P110
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.111 +2 -2
+ NTP_4_2_7P110
+
+ ntpsnmpd/ntpsnmpd.1@1.111 +2 -2
+ NTP_4_2_7P110
+
+ packageinfo.sh@1.112 +1 -1
+ NTP_4_2_7P110
+
+ sntp/sntp-opts.c@1.111 +2 -2
+ NTP_4_2_7P110
+
+ sntp/sntp-opts.h@1.111 +3 -3
+ NTP_4_2_7P110
+
+ sntp/sntp-opts.texi@1.111 +2 -2
+ NTP_4_2_7P110
+
+ sntp/sntp.1@1.111 +2 -2
+ NTP_4_2_7P110
+
+ sntp/sntp.html@1.111 +2 -2
+ NTP_4_2_7P110
+
+ util/ntp-keygen-opts.c@1.109 +2 -2
+ NTP_4_2_7P110
+
+ util/ntp-keygen-opts.h@1.109 +3 -3
+ NTP_4_2_7P110
+
+ util/ntp-keygen-opts.texi@1.112 +2 -2
+ NTP_4_2_7P110
+
+ util/ntp-keygen.1@1.112 +2 -2
+ NTP_4_2_7P110
+
+ChangeSet@1.2415, 2011-01-04 08:47:26+00:00, davehart@shiny.ad.hartbrothers.com
+ don't stop the search on a prefix match in get_ext_sys_var()
+
+ ntpd/ntp_control.c@1.158 +5 -3
+ don't stop the search on a prefix match in get_ext_sys_var()
+
+ChangeSet@1.2414, 2011-01-04 07:06:40+00:00, davehart@shiny.ad.hartbrothers.com
+ make V=0 and configure --enable-silent-rules supported.
+
+ ChangeLog@1.753 +1 -0
+ make V=0 and configure --enable-silent-rules supported.
+
+ configure.ac@1.507 +5 -0
+ support make V=0 and configure --enable-silent-rules
+
+ sntp/configure.ac@1.50 +5 -0
+ support make V=0 and configure --enable-silent-rules
+
+ChangeSet@1.2413, 2011-01-04 06:27:59+00:00, davehart@shiny.ad.hartbrothers.com
+ setvar modemsetup = ATE0... overrides ACTS driver default.
+ Preserve last timecode in ACTS driver (ntpq -ccv).
+ Tolerate previous ATE1 state when sending ACTS setup.
+ Enable raw tty line discipline in Windows port.
+ Allow tty open/close/open to succeed on Windows port.
+ Enable ACTS and CHU reference clock drivers on Windows.
+
+ ChangeLog@1.752 +8 -2
+ setvar modemsetup = ATE0... overrides ACTS driver default.
+ Preserve last timecode in ACTS driver (ntpq -ccv).
+ Tolerate previous ATE1 state when sending ACTS setup.
+ Enable raw tty line discipline in Windows port.
+ Allow tty open/close/open to succeed on Windows port.
+ Enable ACTS and CHU reference clock drivers on Windows.
+
+
+ include/ntp_machine.h@1.31 +0 -17
+ consolidate windows/posix compatibility shims in ntp_types.h
+
+ include/ntp_refclock.h@1.27 +2 -1
+ add active flag to struct refclockio to help dispense with pending
+ refclock input on Windows serial port close.
+
+ include/ntp_types.h@1.22 +12 -1
+ consolidate windows/posix compatibility shims in ntp_types.h
+
+ include/ntpd.h@1.158 +1 -0
+ add get_ext_sys_var() to retrieve value of user-defined vars
+
+ libntp/dolfptoa.c@1.9 +3 -3
+ quiet warning about signed/unsigned > comparison
+
+ libntp/icom.c@1.14 +10 -2
+ enable CHU refclock for Windows ntpd
+
+ libntp/msyslog.c@1.31 +1 -3
+ slight cleanup
+
+ libntp/recvbuff.c@1.35 +18 -14
+ cleanup
+
+ ntpd/complete.conf@1.15 +1 -0
+ add coverage for phone directive
+
+ ntpd/ntp_config.c@1.281 +1 -1
+ quote phone strings in saveconfig output
+
+ ntpd/ntp_control.c@1.157 +30 -1
+ add get_ext_sys_var() to retrieve value of user-defined vars
+
+ ntpd/ntp_io.c@1.341 +26 -21
+ add active flag to struct refclockio to help dispense with pending
+ refclock input on Windows serial port close.
+ use closeserial() instead of close() for refclock ttys for Windows'
+ port benefit.
+
+ ntpd/refclock_acts.c@1.42 +96 -64
+ Increment pp->polls in acts_poll().
+ Change UART rate from 9600 to 19200.
+ Allow modem setup string override using: setvar modemsetup = ATE0...
+ Tolerate echo of the setup string in case ATE1 was set previously.
+ Buffer incomplete input lines in unit struct leaving pp->a_lastcode with
+ the last complete line, allowing "ntpq -c cv" to retrieve it.
+ Enable ACTS driver in the Windows port.
+
+ ntpd/refclock_chu.c@1.50 +2 -2
+ Enable CHU driver in the Windows port (MINCHAR in Windows .h files).
+
+ ntpd/refclock_pcf.c@1.11 +2 -1
+ attempt to avoid fault in pcf_shutdown() after unsuccessful start.
+
+ ports/winnt/include/config.h@1.90 +3 -0
+ Enable ACTS and CHU refclock drivers in Windows port.
+
+ ports/winnt/include/termios.h@1.14 +8 -12
+ Support raw line discipline and serial open/close/open in Windows port.
+
+ ports/winnt/libntp/termios.c@1.24 +134 -40
+ Support raw line discipline and serial open/close/open in Windows port.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.55 +196 -70
+ Support raw line discipline and serial open/close/open in Windows port.
+
+ ports/winnt/vc6/libntp.dsp@1.57 +4 -0
+ Enable icom.c compile on Windows.
+
+ ports/winnt/vc6/ntpd.dsp@1.52 +0 -2
+ Enable ACTS and CHU refclocks on Windows.
+
+ ports/winnt/vs2003/libntp.vcproj@1.15 +3 -0
+ Enable icom.c compile on Windows.
+
+ ports/winnt/vs2003/ntpd.vcproj@1.13 +0 -42
+ Enable ACTS and CHU refclocks on Windows.
+
+ ports/winnt/vs2005/libntp.vcproj@1.13 +4 -0
+ Enable icom.c compile on Windows.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.13 +0 -40
+ Enable ACTS and CHU refclocks on Windows.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.34 +2 -4
+ Enable icom.c compile on Windows.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.36 +2 -6
+ Enable ACTS and CHU refclocks on Windows.
+
+ChangeSet@1.2082.4.203, 2011-01-03 21:20:42-05:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3
+ TAG: NTP_4_2_6P3
+
+ ChangeLog@1.496.26.142 +1 -0
+ NTP_4_2_6P3
+
+ ntpd/ntpd-opts.c@1.248.33.1 +5 -5
+ NTP_4_2_6P3
+
+ ntpd/ntpd-opts.h@1.248.33.1 +4 -4
+ NTP_4_2_6P3
+
+ ntpd/ntpd-opts.texi@1.246.33.1 +61 -2
+ NTP_4_2_6P3
+
+ ntpd/ntpd.1@1.246.33.1 +2 -2
+ NTP_4_2_6P3
+
+ ntpdc/ntpdc-opts.c@1.244.33.1 +5 -5
+ NTP_4_2_6P3
+
+ ntpdc/ntpdc-opts.h@1.244.33.1 +4 -4
+ NTP_4_2_6P3
+
+ ntpdc/ntpdc-opts.texi@1.243.33.1 +66 -2
+ NTP_4_2_6P3
+
+ ntpdc/ntpdc.1@1.243.33.1 +2 -2
+ NTP_4_2_6P3
+
+ ntpq/ntpq-opts.c@1.245.33.1 +5 -5
+ NTP_4_2_6P3
+
+ ntpq/ntpq-opts.h@1.245.33.1 +4 -4
+ NTP_4_2_6P3
+
+ ntpq/ntpq-opts.texi@1.244.33.1 +51 -2
+ NTP_4_2_6P3
+
+ ntpq/ntpq.1@1.244.33.1 +2 -2
+ NTP_4_2_6P3
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.34.1 +5 -5
+ NTP_4_2_6P3
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.34.1 +4 -4
+ NTP_4_2_6P3
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.34.1 +24 -2
+ NTP_4_2_6P3
+
+ ntpsnmpd/ntpsnmpd.1@1.122.34.1 +2 -2
+ NTP_4_2_6P3
+
+ packageinfo.sh@1.255.31.2 +3 -3
+ NTP_4_2_6P3
+
+ sntp/sntp-opts.c@1.117.31.1 +5 -5
+ NTP_4_2_6P3
+
+ sntp/sntp-opts.h@1.117.31.1 +4 -4
+ NTP_4_2_6P3
+
+ sntp/sntp-opts.texi@1.117.31.1 +56 -2
+ NTP_4_2_6P3
+
+ sntp/sntp.1@1.117.31.1 +2 -2
+ NTP_4_2_6P3
+
+ sntp/sntp.html@1.7.32.1 +56 -2
+ NTP_4_2_6P3
+
+ util/ntp-keygen-opts.c@1.247.33.1 +5 -5
+ NTP_4_2_6P3
+
+ util/ntp-keygen-opts.h@1.247.33.1 +4 -4
+ NTP_4_2_6P3
+
+ util/ntp-keygen-opts.texi@1.246.33.1 +45 -2
+ NTP_4_2_6P3
+
+ util/ntp-keygen.1@1.246.33.1 +2 -2
+ NTP_4_2_6P3
+
+ChangeSet@1.2082.4.202, 2011-01-03 17:52:19-05:00, stenn@deacon.udel.edu
+ 4.2.6p3
+
+ packageinfo.sh@1.255.31.1 +1 -1
+ 4.2.6p3
+
+ChangeSet@1.2082.4.201, 2011-01-03 17:50:01-05:00, stenn@deacon.udel.edu
+ Fix release date
+
+ NEWS@1.117 +1 -1
+ Fix release date
+
+ChangeSet@1.2082.4.200, 2011-01-03 17:04:32-05:00, stenn@deacon.udel.edu
+ cleanup NEWS file for 4.2.6p3
+
+ NEWS@1.116 +4 -5
+ cleanup
+
+ChangeSet@1.2411, 2011-01-03 20:19:11+01:00, jnperlin@hydra.localnet
+ [Bug 1771] fixed and test cases provided
+
+ ChangeLog@1.750 +2 -0
+ Bug 1771
+
+ include/ntp_calendar.h@1.8 +9 -0
+ [Bug 1771] add 'time()' mockup facility
+
+ libntp/clocktime.c@1.6 +10 -29
+ [Bug 1771] fix algorithmic problem (result should ALWAYS be in +/- 0.5yrs around receive time)
+
+ libntp/ntp_calendar.c@1.5 +36 -4
+ [Bug 1771] add 'time()' mockup facility
+
+ tests/libntp/caljulian.cpp@1.5 +15 -0
+ [Bug 1771] use 'time()' mockup facility
+
+ tests/libntp/calyearstart.cpp@1.3 +21 -11
+ [Bug 1771] use 'time()' mockup facility
+
+ tests/libntp/clocktime.cpp@1.3 +58 -18
+ [Bug 1771] use 'time()' mockup facility, added test for 'wild' clocktime input (lengthy)
+
+ tests/libntp/libntptest.cpp@1.2 +19 -0
+ [Bug 1771] use 'time()' mockup facility
+
+ tests/libntp/libntptest.h@1.4 +6 -0
+ [Bug 1771] use 'time()' mockup facility
+
+ChangeSet@1.2410, 2011-01-02 10:23:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P109
+ TAG: NTP_4_2_7P109
+
+ ChangeLog@1.749 +1 -0
+ NTP_4_2_7P109
+
+ clockstuff/clktest-opts.c@1.33 +2 -2
+ NTP_4_2_7P109
+
+ clockstuff/clktest-opts.h@1.33 +3 -3
+ NTP_4_2_7P109
+
+ ntpd/ntpd-opts.c@1.113 +2 -2
+ NTP_4_2_7P109
+
+ ntpd/ntpd-opts.h@1.113 +3 -3
+ NTP_4_2_7P109
+
+ ntpd/ntpd-opts.texi@1.111 +2 -2
+ NTP_4_2_7P109
+
+ ntpd/ntpd.1@1.111 +2 -2
+ NTP_4_2_7P109
+
+ ntpdc/ntpdc-opts.c@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpdc/ntpdc-opts.h@1.110 +3 -3
+ NTP_4_2_7P109
+
+ ntpdc/ntpdc-opts.texi@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpdc/ntpdc.1@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpq/ntpq-opts.c@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpq/ntpq-opts.h@1.110 +3 -3
+ NTP_4_2_7P109
+
+ ntpq/ntpq-opts.texi@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpq/ntpq.1@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.110 +3 -3
+ NTP_4_2_7P109
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.110 +2 -2
+ NTP_4_2_7P109
+
+ ntpsnmpd/ntpsnmpd.1@1.110 +2 -2
+ NTP_4_2_7P109
+
+ packageinfo.sh@1.111 +1 -1
+ NTP_4_2_7P109
+
+ sntp/sntp-opts.c@1.110 +2 -2
+ NTP_4_2_7P109
+
+ sntp/sntp-opts.h@1.110 +3 -3
+ NTP_4_2_7P109
+
+ sntp/sntp-opts.texi@1.110 +2 -2
+ NTP_4_2_7P109
+
+ sntp/sntp.1@1.110 +2 -2
+ NTP_4_2_7P109
+
+ sntp/sntp.html@1.110 +2 -2
+ NTP_4_2_7P109
+
+ util/ntp-keygen-opts.c@1.108 +2 -2
+ NTP_4_2_7P109
+
+ util/ntp-keygen-opts.h@1.108 +3 -3
+ NTP_4_2_7P109
+
+ util/ntp-keygen-opts.texi@1.111 +2 -2
+ NTP_4_2_7P109
+
+ util/ntp-keygen.1@1.111 +2 -2
+ NTP_4_2_7P109
+
+ChangeSet@1.2409, 2011-01-02 09:50:53+00:00, davehart@shiny.ad.hartbrothers.com
+ quiet warning about n potentially used uninit in ntpq's collect_display_vdc()
+
+ ntpq/ntpq-subs.c@1.80 +1 -0
+ quiet warning about n potentially used uninit in collect_display_vdc()
+
+ChangeSet@1.2408, 2011-01-02 09:41:39+00:00, davehart@shiny.ad.hartbrothers.com
+ refactor peer_st_flags() and kstatus_to_text() to use common
+ data-driven loop instead of repeated macro expansions.
+
+ include/lib_strbuf.h@1.7 +15 -15
+ increase LIB_GETBUF() line limit to 128 from 80, reduce number
+ of buffers from 200 to 16. Reduces memory footprint from 16k
+ to 4k. k_st_flags() in statestr.c needs more than 80.
+
+ include/ntp.h@1.192 +0 -6
+ move TRUE/FALSE defines to ntp_types.h so lib_strbuf.h has them.
+
+ include/ntp_stdlib.h@1.54 +3 -5
+ add k_st_flags() declaration, remove declarations for three functions
+ apparently removed long ago.
+
+ include/ntp_types.h@1.21 +8 -0
+ move TRUE/FALSE defines to ntp_types.h so lib_strbuf.h has them.
+
+ libntp/lib_strbuf.c@1.6 +1 -1
+ increase LIB_GETBUF() line limit to 128 from 80, reduce number
+ of buffers from 200 to 16. Reduces memory footprint from 16k
+ to 4k. k_st_flags() in statestr.c needs more than 80.
+
+ libntp/statestr.c@1.24 +140 -26
+ refactor peer_st_flags() and kstatus_to_text() to use common
+ data-driven loop instead of repeated macro expansions.
+
+ ntpd/ntp_control.c@1.156 +3 -133
+ use common code from statestr.c for server side of ntpq -c kerninfo's
+ decoding of kernel loop status bits.
+
+ ntpq/ntpq-subs.c@1.79 +2 -0
+ Do not crash on an empty value in collect_display_vdc()
+
+ChangeSet@1.2407, 2011-01-02 06:15:33+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog was omitted accidentally from last cset
+
+ ChangeLog@1.748 +3 -0
+ Remove nearly all strcpy() and most strcat() from NTP distribution.
+ One major pocket remains in ntp_crypto.c. libopts & libisc also have
+ (safe) uses of strcpy() and strcat() remaining.
+
+ChangeSet@1.2406, 2011-01-02 05:13:56+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove nearly all strcpy() and most strcat() from NTP distribution.
+ One major pocket remains in ntp_crypto.c. libopts & libisc also have
+ (safe) uses of strcpy() and strcat() remaining
+
+ include/ntpd.h@1.157 +2 -0
+ add mprintf_event() alternative to report_event()
+
+ libntp/findconfig.c@1.4 +4 -2
+ strcpy() -> strncpy()
+
+ libntp/statestr.c@1.23 +88 -82
+ get rid of strcpy(), strcat() use in statustoa()
+ mark constant statestr.c arrays such.
+
+ libntp/systime.c@1.51 +10 -10
+ strcpy() -> strncpy()
+
+ ntpd/ntp_control.c@1.155 +41 -22
+ add mprintf_event() alternative to report_event()
+
+ ntpd/ntp_peer.c@1.144 +2 -7
+ use mprintf_event() in a two places
+
+ ntpd/ntp_util.c@1.90 +38 -33
+ strcpy() -> strncpy()
+
+ ntpd/refclock_arbiter.c@1.17 +3 -2
+ strcpy() -> strncpy()
+
+ ntpd/refclock_as2201.c@1.12 +9 -4
+ bounds-checked strcpy() -> memcpy()
+
+ ntpd/refclock_chu.c@1.49 +1 -1
+ strcpy() -> strncpy()
+
+ ntpd/refclock_hpgps.c@1.11 +2 -2
+ bounds-checked strcpy() -> memcpy(), strcpy() -> strncpy()
+
+ ntpd/refclock_neoclock4x.c@1.19 +9 -8
+ strcpy() -> strncpy()
+
+ ntpd/refclock_oncore.c@1.90 +2 -1
+ add gcc printf format attribute to oncore_log_f declaration.
+
+ ntpd/refclock_parse.c@1.56 +4 -3
+ bounds-checked strcpy() -> memcpy()
+
+ ntpd/refclock_true.c@1.15 +1 -1
+ strcpy() -> strncpy()
+
+ ntpdate/ntpdate.c@1.80 +6 -6
+ strcpy() -> strncpy()
+
+ ntpdc/ntpdc.c@1.91 +2 -2
+ strcpy() -> strncpy()
+
+ ntpdc/ntpdc_ops.c@1.74 +1 -1
+ strcpy() -> strncpy()
+
+ ntpq/ntpq.c@1.126 +1 -1
+ strcpy() -> strncpy()
+
+ ports/winnt/libntp/randfile.c@1.5 +1 -2
+ strcpy()+strcat() -> snprintf()
+
+ChangeSet@1.2405, 2011-01-01 11:30:29+00:00, hart@psp-os1.ntp.org
+ copyright.html:
+ bump copyright.html for 2011
+
+ html/copyright.html@1.56 +2 -2
+ bump copyright.html for 2011
+
+ChangeSet@1.2403, 2011-01-01 06:23:20-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.747 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.18 +2 -3
+ Documentation updates from Dave Mills
+
+ html/copyright.html@1.54 +19 -1
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2402, 2011-01-01 10:32:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P108
+ TAG: NTP_4_2_7P108
+
+ ChangeLog@1.746 +1 -0
+ NTP_4_2_7P108
+
+ clockstuff/clktest-opts.c@1.32 +4 -4
+ NTP_4_2_7P108
+
+ clockstuff/clktest-opts.h@1.32 +4 -4
+ NTP_4_2_7P108
+
+ ntpd/ntpd-opts.c@1.112 +4 -4
+ NTP_4_2_7P108
+
+ ntpd/ntpd-opts.h@1.112 +4 -4
+ NTP_4_2_7P108
+
+ ntpd/ntpd-opts.texi@1.110 +2 -2
+ NTP_4_2_7P108
+
+ ntpd/ntpd.1@1.110 +2 -2
+ NTP_4_2_7P108
+
+ ntpdc/ntpdc-opts.c@1.109 +4 -4
+ NTP_4_2_7P108
+
+ ntpdc/ntpdc-opts.h@1.109 +4 -4
+ NTP_4_2_7P108
+
+ ntpdc/ntpdc-opts.texi@1.109 +2 -2
+ NTP_4_2_7P108
+
+ ntpdc/ntpdc.1@1.109 +2 -2
+ NTP_4_2_7P108
+
+ ntpq/ntpq-opts.c@1.109 +4 -4
+ NTP_4_2_7P108
+
+ ntpq/ntpq-opts.h@1.109 +4 -4
+ NTP_4_2_7P108
+
+ ntpq/ntpq-opts.texi@1.109 +2 -2
+ NTP_4_2_7P108
+
+ ntpq/ntpq.1@1.109 +2 -2
+ NTP_4_2_7P108
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.109 +4 -4
+ NTP_4_2_7P108
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.109 +4 -4
+ NTP_4_2_7P108
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.109 +2 -2
+ NTP_4_2_7P108
+
+ ntpsnmpd/ntpsnmpd.1@1.109 +2 -2
+ NTP_4_2_7P108
+
+ packageinfo.sh@1.110 +1 -1
+ NTP_4_2_7P108
+
+ sntp/sntp-opts.c@1.109 +4 -4
+ NTP_4_2_7P108
+
+ sntp/sntp-opts.h@1.109 +4 -4
+ NTP_4_2_7P108
+
+ sntp/sntp-opts.texi@1.109 +2 -2
+ NTP_4_2_7P108
+
+ sntp/sntp.1@1.109 +2 -2
+ NTP_4_2_7P108
+
+ sntp/sntp.html@1.109 +2 -2
+ NTP_4_2_7P108
+
+ util/ntp-keygen-opts.c@1.107 +4 -4
+ NTP_4_2_7P108
+
+ util/ntp-keygen-opts.h@1.107 +4 -4
+ NTP_4_2_7P108
+
+ util/ntp-keygen-opts.texi@1.110 +2 -2
+ NTP_4_2_7P108
+
+ util/ntp-keygen.1@1.110 +2 -2
+ NTP_4_2_7P108
+
+ChangeSet@1.2082.4.199, 2011-01-01 08:35:01+00:00, hart@psp-os1.ntp.org
+ copyright.html:
+ bump copyright.html to 2011
+
+ html/copyright.html@1.46.1.3 +2 -2
+ bump copyright.html to 2011
+
+ChangeSet@1.2400, 2010-12-31 20:41:55-05:00, stenn@deacon.udel.edu
+ Typo cleanup from DLM's recent changes
+
+ ntpd/ntp_control.c@1.154 +1 -1
+ Typo cleanup from DLM's recent changes
+
+ ntpd/ntp_crypto.c@1.152 +0 -1
+ Typo cleanup from DLM's recent changes
+
+ChangeSet@1.2082.4.198, 2010-12-31 20:38:09-05:00, stenn@deacon.udel.edu
+ Update the copyright year
+
+ ChangeLog@1.496.26.141 +1 -0
+ Update the copyright year
+
+ include/copyright.def@1.13 +1 -1
+ Update the copyright year
+
+ChangeSet@1.2396.1.1, 2010-12-31 19:47:13-05:00, stenn@deacon.udel.edu
+ typo
+
+ ChangeLog@1.742.1.1 +1 -1
+ typo
+
+ChangeSet@1.2398, 2010-12-31 23:55:50+00:00, davehart@shiny.ad.hartbrothers.com
+ remove -dev-only remains of earlier [Bug 1764] fix from
+ ntpd/refclock_conf.c
+
+ include/ntpd.h@1.156 +4 -3
+ use gcc printf() format attribute in mprintf_clock_stats() decl
+
+ ntpd/ntp_util.c@1.89 +2 -3
+ fix warning about return; from mprintf_clock_stats() without value.
+
+ ntpd/refclock_conf.c@1.31 +0 -6
+ remove -dev-only remains of earlier [Bug 1764] fix
+
+ChangeSet@1.2082.4.197, 2010-12-31 23:12:25+00:00, davehart@shiny.ad.hartbrothers.com
+ Test for modem control just once in configure.ac
+
+ configure.ac@1.465.1.26 +39 -45
+ Test for modem control support just once
+
+ include/ntpd.h@1.137.2.5 +2 -1
+ make refclock_conf[] pointers const
+
+ ntpd/refclock_conf.c@1.28.1.2 +2 -2
+ make refclock_conf[] pointers const
+
+ChangeSet@1.2396, 2010-12-31 17:34:44-05:00, stenn@deacon.udel.edu
+ Autokey multiple identity group improvements from Dave Mills
+
+ ChangeLog@1.742 +1 -0
+ Autokey multiple identity group improvements from Dave Mills
+
+ html/authopt.html@1.69 +11 -8
+ Autokey multiple identity group improvements from Dave Mills
+
+ html/confopt.html@1.55 +2 -2
+ Autokey multiple identity group improvements from Dave Mills
+
+ ntpd/ntp_control.c@1.153 +2 -2
+ Autokey multiple identity group improvements from Dave Mills
+
+ ntpd/ntp_crypto.c@1.151 +24 -19
+ Autokey multiple identity group improvements from Dave Mills
+
+ util/ntp-keygen.c@1.73 +3 -8
+ Autokey multiple identity group improvements from Dave Mills
+
+ChangeSet@1.2395, 2010-12-31 17:29:22-05:00, stenn@deacon.udel.edu
+ [Bug 1768] TIOCFLUSH undefined in linux for refclock_acts
+
+ ChangeLog@1.741 +1 -0
+ [Bug 1768] TIOCFLUSH undefined in linux for refclock_acts
+
+ ntpd/refclock_acts.c@1.41 +47 -29
+ [Bug 1768] TIOCFLUSH undefined in linux for refclock_acts
+
+ChangeSet@1.2082.4.196, 2010-12-31 16:28:55-05:00, murray@malarky.udel.edu
+ refclock_conf.c, configure.ac, refclock_palisade.c, ChangeLog:
+ [Bug 1764] Palisade driver doesn't build on Linux. (cleanup)
+
+ ChangeLog@1.496.26.140 +1 -0
+ [Bug 1764] Palisade driver doesn't build on Linux. (cleanup)
+
+ configure.ac@1.465.1.25 +16 -9
+ [Bug 1764] Palisade driver doesn't build on Linux. (cleanup)
+
+ ntpd/refclock_conf.c@1.28.1.1 +1 -1
+ [Bug 1764] Palisade driver doesn't build on Linux. (cleanup)
+
+ ntpd/refclock_palisade.c@1.31.1.3 +0 -5
+ [Bug 1764] Palisade driver doesn't build on Linux. (cleanup)
+
+ChangeSet@1.2394, 2010-12-31 10:50:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P107
+ TAG: NTP_4_2_7P107
+
+ ChangeLog@1.740 +1 -0
+ NTP_4_2_7P107
+
+ clockstuff/clktest-opts.c@1.31 +2 -2
+ NTP_4_2_7P107
+
+ clockstuff/clktest-opts.h@1.31 +3 -3
+ NTP_4_2_7P107
+
+ ntpd/ntpd-opts.c@1.111 +2 -2
+ NTP_4_2_7P107
+
+ ntpd/ntpd-opts.h@1.111 +3 -3
+ NTP_4_2_7P107
+
+ ntpd/ntpd-opts.texi@1.109 +2 -2
+ NTP_4_2_7P107
+
+ ntpd/ntpd.1@1.109 +2 -2
+ NTP_4_2_7P107
+
+ ntpdc/ntpdc-opts.c@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpdc/ntpdc-opts.h@1.108 +3 -3
+ NTP_4_2_7P107
+
+ ntpdc/ntpdc-opts.texi@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpdc/ntpdc.1@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpq/ntpq-opts.c@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpq/ntpq-opts.h@1.108 +3 -3
+ NTP_4_2_7P107
+
+ ntpq/ntpq-opts.texi@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpq/ntpq.1@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.108 +3 -3
+ NTP_4_2_7P107
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.108 +2 -2
+ NTP_4_2_7P107
+
+ ntpsnmpd/ntpsnmpd.1@1.108 +2 -2
+ NTP_4_2_7P107
+
+ packageinfo.sh@1.109 +1 -1
+ NTP_4_2_7P107
+
+ sntp/sntp-opts.c@1.108 +2 -2
+ NTP_4_2_7P107
+
+ sntp/sntp-opts.h@1.108 +3 -3
+ NTP_4_2_7P107
+
+ sntp/sntp-opts.texi@1.108 +2 -2
+ NTP_4_2_7P107
+
+ sntp/sntp.1@1.108 +2 -2
+ NTP_4_2_7P107
+
+ sntp/sntp.html@1.108 +2 -2
+ NTP_4_2_7P107
+
+ util/ntp-keygen-opts.c@1.106 +2 -2
+ NTP_4_2_7P107
+
+ util/ntp-keygen-opts.h@1.106 +3 -3
+ NTP_4_2_7P107
+
+ util/ntp-keygen-opts.texi@1.109 +2 -2
+ NTP_4_2_7P107
+
+ util/ntp-keygen.1@1.109 +2 -2
+ NTP_4_2_7P107
+
+ChangeSet@1.2393, 2010-12-31 01:45:11-05:00, stenn@deacon.udel.edu
+ refclock_acts.c updates from Dave Mills
+
+ ChangeLog@1.739 +1 -0
+ refclock_acts.c updates from Dave Mills
+
+ ntpd/refclock_acts.c@1.40 +335 -380
+ refclock_acts.c updates from Dave Mills
+
+ChangeSet@1.2392, 2010-12-31 03:31:28+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1766] Oncore clock has offset/high jitter at startup.
+
+ ChangeLog@1.738 +1 -0
+ [Bug 1766] Oncore clock has offset/high jitter at startup.
+
+ include/ntp_stdlib.h@1.53 +2 -2
+ correct return types of mvsnprintf() and msnprintf() to match
+ vsnprintf() and snprintf().
+
+ include/ntpd.h@1.154 +1 -0
+ add mprintf_clock_stats() vararg alternative to record_clock_stats()
+
+ libntp/msyslog.c@1.30 +9 -3
+ correct return types of mvsnprintf() and msnprintf() to match
+ vsnprintf() and snprintf().
+
+ ntpd/ntp_util.c@1.88 +25 -0
+ add mprintf_clock_stats() vararg alternative to record_clock_stats()
+
+ ntpd/refclock_oncore.c@1.89 +263 -358
+ [Bug 1766] Oncore clock has offset/high jitter at startup.
+
+ ntpd/refclock_parse.c@1.55 +1 -1
+ eliminate warning
+
+ChangeSet@1.2389.1.1, 2010-12-30 10:52:24+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1764] Palisade driver doesn't build on Linux.
+ Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+
+ ChangeLog@1.735.1.1 +4 -0
+ [Bug 1764] Palisade driver doesn't build on Linux.
+ Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+
+ include/ntp_control.h@1.55 +0 -178
+ Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+
+ libntp/refnumtoa.c@1.10 +12 -13
+ make refnumtoa() return socktoa() for non-refclock addresses to
+ simplify ntpq peers billboard use.
+
+ ntpd/ntp_control.c@1.152 +178 -0
+ Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+
+ ntpd/ntp_io.c@1.340 +2 -1
+ Do not log an error if setsockopt(IPV6_MULTICAST_IF) returns an error and
+ the ifindex we attempted to set is already the scope in the bound address.
+
+ ntpd/refclock_conf.c@1.29 +6 -0
+ [Bug 1764] Palisade driver doesn't build on Linux.
+
+ ntpd/refclock_palisade.c@1.35 +3 -0
+ [Bug 1764] Palisade driver doesn't build on Linux.
+
+ ntpq/ntpq-subs.c@1.78 +46 -123
+ Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+
+ ntpq/ntpq.c@1.125 +124 -290
+ Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+
+ ntpq/ntpq.h@1.23 +5 -8
+ Move ntp_control.h variable IDs to ntp_control.c, remove their use by
+ ntpq. They are implementation details private to ntpd. [Bug 597] was
+ caused by ntpq's reliance on these IDs it need not know about.
+
+ChangeSet@1.2390, 2010-12-30 10:32:31+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P106
+ TAG: NTP_4_2_7P106
+
+ ChangeLog@1.736 +1 -0
+ NTP_4_2_7P106
+
+ clockstuff/clktest-opts.c@1.30 +2 -2
+ NTP_4_2_7P106
+
+ clockstuff/clktest-opts.h@1.30 +3 -3
+ NTP_4_2_7P106
+
+ ntpd/ntpd-opts.c@1.110 +2 -2
+ NTP_4_2_7P106
+
+ ntpd/ntpd-opts.h@1.110 +3 -3
+ NTP_4_2_7P106
+
+ ntpd/ntpd-opts.texi@1.108 +2 -2
+ NTP_4_2_7P106
+
+ ntpd/ntpd.1@1.108 +2 -2
+ NTP_4_2_7P106
+
+ ntpdc/ntpdc-opts.c@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpdc/ntpdc-opts.h@1.107 +3 -3
+ NTP_4_2_7P106
+
+ ntpdc/ntpdc-opts.texi@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpdc/ntpdc.1@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpq/ntpq-opts.c@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpq/ntpq-opts.h@1.107 +3 -3
+ NTP_4_2_7P106
+
+ ntpq/ntpq-opts.texi@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpq/ntpq.1@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.107 +3 -3
+ NTP_4_2_7P106
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.107 +2 -2
+ NTP_4_2_7P106
+
+ ntpsnmpd/ntpsnmpd.1@1.107 +2 -2
+ NTP_4_2_7P106
+
+ packageinfo.sh@1.108 +1 -1
+ NTP_4_2_7P106
+
+ sntp/sntp-opts.c@1.107 +2 -2
+ NTP_4_2_7P106
+
+ sntp/sntp-opts.h@1.107 +3 -3
+ NTP_4_2_7P106
+
+ sntp/sntp-opts.texi@1.107 +2 -2
+ NTP_4_2_7P106
+
+ sntp/sntp.1@1.107 +2 -2
+ NTP_4_2_7P106
+
+ sntp/sntp.html@1.107 +2 -2
+ NTP_4_2_7P106
+
+ util/ntp-keygen-opts.c@1.105 +2 -2
+ NTP_4_2_7P106
+
+ util/ntp-keygen-opts.h@1.105 +3 -3
+ NTP_4_2_7P106
+
+ util/ntp-keygen-opts.texi@1.108 +2 -2
+ NTP_4_2_7P106
+
+ util/ntp-keygen.1@1.108 +2 -2
+ NTP_4_2_7P106
+
+ChangeSet@1.2082.4.195, 2010-12-29 19:24:12-05:00, stenn@deacon.udel.edu
+ Update genCommitLog for the bk-5 release
+
+ ChangeLog@1.496.26.139 +1 -0
+ Update genCommitLog for the bk-5 release
+
+ scripts/genCommitLog@1.5.1.2 +1 -1
+ Update genCommitLog for the bk-5 release
+
+ChangeSet@1.2388, 2010-12-29 08:13:01+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P105
+ TAG: NTP_4_2_7P105
+
+ ChangeLog@1.734 +1 -0
+ NTP_4_2_7P105
+
+ clockstuff/clktest-opts.c@1.29 +2 -2
+ NTP_4_2_7P105
+
+ clockstuff/clktest-opts.h@1.29 +3 -3
+ NTP_4_2_7P105
+
+ ntpd/ntpd-opts.c@1.109 +2 -2
+ NTP_4_2_7P105
+
+ ntpd/ntpd-opts.h@1.109 +3 -3
+ NTP_4_2_7P105
+
+ ntpd/ntpd-opts.texi@1.107 +2 -2
+ NTP_4_2_7P105
+
+ ntpd/ntpd.1@1.107 +2 -2
+ NTP_4_2_7P105
+
+ ntpdc/ntpdc-opts.c@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpdc/ntpdc-opts.h@1.106 +3 -3
+ NTP_4_2_7P105
+
+ ntpdc/ntpdc-opts.texi@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpdc/ntpdc.1@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpq/ntpq-opts.c@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpq/ntpq-opts.h@1.106 +3 -3
+ NTP_4_2_7P105
+
+ ntpq/ntpq-opts.texi@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpq/ntpq.1@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.106 +3 -3
+ NTP_4_2_7P105
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.106 +2 -2
+ NTP_4_2_7P105
+
+ ntpsnmpd/ntpsnmpd.1@1.106 +2 -2
+ NTP_4_2_7P105
+
+ packageinfo.sh@1.107 +1 -1
+ NTP_4_2_7P105
+
+ sntp/sntp-opts.c@1.106 +2 -2
+ NTP_4_2_7P105
+
+ sntp/sntp-opts.h@1.106 +3 -3
+ NTP_4_2_7P105
+
+ sntp/sntp-opts.texi@1.106 +56 -2
+ NTP_4_2_7P105
+
+ sntp/sntp.1@1.106 +2 -2
+ NTP_4_2_7P105
+
+ sntp/sntp.html@1.106 +56 -2
+ NTP_4_2_7P105
+
+ util/ntp-keygen-opts.c@1.104 +2 -2
+ NTP_4_2_7P105
+
+ util/ntp-keygen-opts.h@1.104 +3 -3
+ NTP_4_2_7P105
+
+ util/ntp-keygen-opts.texi@1.107 +2 -2
+ NTP_4_2_7P105
+
+ util/ntp-keygen.1@1.107 +2 -2
+ NTP_4_2_7P105
+
+ChangeSet@1.2082.4.194, 2010-12-29 02:06:21-05:00, stenn@deacon.udel.edu
+ Distribute check--help from the correct variable
+
+ scripts/Makefile.am@1.17.1.4 +1 -1
+ Distribute check--help from the correct variable
+
+ChangeSet@1.2386, 2010-12-28 09:37:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P104
+ TAG: NTP_4_2_7P104
+
+ ChangeLog@1.733 +1 -0
+ NTP_4_2_7P104
+
+ clockstuff/clktest-opts.c@1.28 +2 -2
+ NTP_4_2_7P104
+
+ clockstuff/clktest-opts.h@1.28 +3 -3
+ NTP_4_2_7P104
+
+ ntpd/ntpd-opts.c@1.108 +2 -2
+ NTP_4_2_7P104
+
+ ntpd/ntpd-opts.h@1.108 +3 -3
+ NTP_4_2_7P104
+
+ ntpd/ntpd-opts.texi@1.106 +75 -2
+ NTP_4_2_7P104
+
+ ntpd/ntpd.1@1.106 +2 -2
+ NTP_4_2_7P104
+
+ ntpdc/ntpdc-opts.c@1.105 +2 -2
+ NTP_4_2_7P104
+
+ ntpdc/ntpdc-opts.h@1.105 +3 -3
+ NTP_4_2_7P104
+
+ ntpdc/ntpdc-opts.texi@1.105 +66 -2
+ NTP_4_2_7P104
+
+ ntpdc/ntpdc.1@1.105 +2 -2
+ NTP_4_2_7P104
+
+ ntpq/ntpq-opts.c@1.105 +2 -2
+ NTP_4_2_7P104
+
+ ntpq/ntpq-opts.h@1.105 +3 -3
+ NTP_4_2_7P104
+
+ ntpq/ntpq-opts.texi@1.105 +51 -2
+ NTP_4_2_7P104
+
+ ntpq/ntpq.1@1.105 +2 -2
+ NTP_4_2_7P104
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.105 +2 -2
+ NTP_4_2_7P104
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.105 +3 -3
+ NTP_4_2_7P104
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.105 +24 -2
+ NTP_4_2_7P104
+
+ ntpsnmpd/ntpsnmpd.1@1.105 +2 -2
+ NTP_4_2_7P104
+
+ packageinfo.sh@1.106 +1 -1
+ NTP_4_2_7P104
+
+ sntp/sntp-opts.c@1.105 +2 -2
+ NTP_4_2_7P104
+
+ sntp/sntp-opts.h@1.105 +3 -3
+ NTP_4_2_7P104
+
+ sntp/sntp-opts.texi@1.105 +1 -1
+ NTP_4_2_7P104
+
+ sntp/sntp.1@1.105 +2 -2
+ NTP_4_2_7P104
+
+ sntp/sntp.html@1.105 +1 -1
+ NTP_4_2_7P104
+
+ util/ntp-keygen-opts.c@1.103 +2 -2
+ NTP_4_2_7P104
+
+ util/ntp-keygen-opts.h@1.103 +3 -3
+ NTP_4_2_7P104
+
+ util/ntp-keygen-opts.texi@1.106 +46 -2
+ NTP_4_2_7P104
+
+ util/ntp-keygen.1@1.106 +2 -2
+ NTP_4_2_7P104
+
+ChangeSet@1.2082.4.193, 2010-12-28 04:20:11-05:00, stenn@deacon.udel.edu
+ Fix location of check--help for sntp
+
+ sntp/Makefile.am@1.21.1.16 +1 -1
+ Fix location of check--help for sntp
+
+ChangeSet@1.2385, 2010-12-28 04:17:05-05:00, stenn@deacon.udel.edu
+ Fix location of check--help for sntp
+
+ sntp/Makefile.am@1.46 +1 -1
+ Fix location of check--help for sntp
+
+ChangeSet@1.2082.4.192, 2010-12-28 03:30:18-05:00, stenn@deacon.udel.edu
+ typo
+
+ scripts/check--help@1.2 +1 -1
+ typo
+
+ChangeSet@1.2082.4.191, 2010-12-28 03:16:01-05:00, stenn@deacon.udel.edu
+ Create and use scripts/check--help when generating .texi files
+
+ ChangeLog@1.496.26.138 +2 -0
+ Create and use scripts/check--help when generating .texi files
+
+ ntpd/Makefile.am@1.80.1.8 +1 -0
+ Create and use scripts/check--help when generating .texi files
+
+ ntpdc/Makefile.am@1.48.1.5 +1 -0
+ Create and use scripts/check--help when generating .texi files
+
+ ntpq/Makefile.am@1.43.1.5 +1 -0
+ Create and use scripts/check--help when generating .texi files
+
+ ntpsnmpd/Makefile.am@1.16.1.5 +1 -0
+ Create and use scripts/check--help when generating .texi files
+
+ scripts/Makefile.am@1.17.1.3 +1 -0
+ Create and use scripts/check--help when generating .texi files
+
+ scripts/check--help@1.1 +22 -0
+ BitKeeper file /deacon/backroom/ntp-stable/scripts/check--help
+
+ scripts/check--help@1.0 +0 -0
+
+ sntp/Makefile.am@1.21.1.15 +1 -0
+ Create and use scripts/check--help when generating .texi files
+
+ util/Makefile.am@1.45.1.6 +1 -0
+ Create and use scripts/check--help when generating .texi files
+
+ChangeSet@1.2382, 2010-12-28 01:35:52-05:00, stenn@deacon.udel.edu
+ Support for multiple Autokey identity groups from Dave Mills
+
+ ChangeLog@1.730 +2 -0
+ Support for multiple Autokey identity groups from Dave Mills
+
+ html/autokey.html@1.17 +8 -44
+ Support for multiple Autokey identity groups from Dave Mills
+
+ include/ntp_control.h@1.54 +1 -1
+ Support for multiple Autokey identity groups from Dave Mills
+
+ include/ntpd.h@1.153 +1 -0
+ Support for multiple Autokey identity groups from Dave Mills
+
+ ntpd/ntp_config.c@1.280 +1 -1
+ Support for multiple Autokey identity groups from Dave Mills
+
+ ntpd/ntp_control.c@1.151 +6 -6
+ Support for multiple Autokey identity groups from Dave Mills
+
+ ntpd/ntp_crypto.c@1.150 +48 -58
+ Support for multiple Autokey identity groups from Dave Mills
+
+ ntpd/ntp_proto.c@1.315 +5 -4
+ Support for multiple Autokey identity groups from Dave Mills
+
+ChangeSet@1.2082.4.190, 2010-12-28 01:22:04-05:00, stenn@deacon.udel.edu
+ Update bk triggers for the bk-5 release
+
+ BitKeeper/triggers/post-incoming.license-warn@1.8 +3 -0
+ Update bk triggers for the bk-5 release
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.9 +3 -0
+ Update bk triggers for the bk-5 release
+
+ BitKeeper/triggers/send@1.15 +2 -2
+ Update bk triggers for the bk-5 release
+
+ ChangeLog@1.496.26.137 +3 -0
+ Update bk triggers for the bk-5 release
+
+ChangeSet@1.2381, 2010-12-27 21:29:19+00:00, davehart@shiny.ad.hartbrothers.com
+ Add ntpq kerninfo command similar to ntpdc's.
+
+ ChangeLog@1.729 +1 -2
+ Add ntpq kerninfo, authinfo, and sysinfo commands similar to ntpdc's.
+
+ include/ntp_control.h@1.53 +19 -1
+ Add variables needed by ntpq -c kerninfo
+
+ include/ntp_stdlib.h@1.52 +1 -1
+ make socktohost() return const char * now that stoa() and friends do.
+
+ include/ntpd.h@1.152 +1 -1
+ make stoa() clone localaddrtoa() return const char * as socktoa() now does.
+
+ libntp/socktohost.c@1.11 +1 -1
+ make socktohost() return const char * now that stoa() and friends do.
+
+ ntpd/ntp_control.c@1.150 +410 -84
+ Add variables needed by ntpq -c kerninfo
+
+ ntpd/ntp_io.c@1.339 +2 -2
+ make stoa() clone localaddrtoa() return const char * as socktoa() now does.
+
+ ntpd/ntp_request.c@1.101 +4 -4
+ declare constant tables using const.
+
+ ntpdate/ntpdate.c@1.79 +1 -1
+ respect const stoa()
+
+ ntpdc/ntpdc.c@1.90 +1 -1
+ make nntohost() return const char * now that stao() and friends do.
+
+ ntpdc/ntpdc.h@1.10 +1 -1
+ make nntohost() return const char * now that stao() and friends do.
+
+ ntpdc/ntpdc_ops.c@1.73 +4 -4
+ correct kerninfo maxerror/esterror scaling
+
+ ntpq/ntpq-subs.c@1.77 +53 -7
+ Add ntpq kerninfo command similar to ntpdc's.
+
+ ntpq/ntpq.c@1.124 +5 -5
+ make nntohost() const char * to match similar change to stoa() etc.
+
+ ntpq/ntpq.h@1.22 +2 -2
+ make nntohost() const char * to match similar change to stoa() etc.
+
+ sntp/kod_management.c@1.22 +8 -9
+ quiet sntp/tests deprecated conversion from string constant to char *
+ warnings by making search_entry(), add_entry(), and del_entry()
+ hostname args const char *.
+
+ sntp/kod_management.h@1.9 +3 -4
+ quiet sntp/tests deprecated conversion from string constant to char *
+ warnings by making search_entry(), add_entry(), and del_entry()
+ hostname args const char *.
+
+ChangeSet@1.2380, 2010-12-25 23:34:57+00:00, davehart@shiny.ad.hartbrothers.com
+ Add ntpq authinfo command, similar to ntpdc's authinfo.
+
+ ChangeLog@1.728 +1 -0
+ Add ntpq authinfo command, similar to ntpdc's authinfo.
+
+ include/ntp_control.h@1.52 +10 -1
+ add variables for ntpq -c authinfo
+
+ include/ntpd.h@1.151 +1 -0
+ extern auth_timereset from ntp_request.c
+
+ ntpd/ntp_control.c@1.149 +47 -1
+ add variables for ntpq -c authinfo
+
+ ntpd/ntp_request.c@1.100 +1 -1
+ extern auth_timereset from ntp_request.c
+
+ ntpq/ntpq-subs.c@1.76 +31 -1
+ Add ntpq authinfo command, similar to ntpdc's authinfo.
+
+ChangeSet@1.2082.4.189, 2010-12-25 16:24:06-05:00, stenn@deacon.udel.edu
+ Fix typo in NEWS file
+
+ NEWS@1.115 +1 -1
+ Fix typo in NEWS file
+
+ChangeSet@1.2082.4.188, 2010-12-25 10:23:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC12
+ TAG: NTP_4_2_6P3_RC12
+
+ ChangeLog@1.496.26.136 +1 -0
+ NTP_4_2_6P3_RC12
+
+ ntpd/ntpd-opts.c@1.248.32.1 +5 -5
+ NTP_4_2_6P3_RC12
+
+ ntpd/ntpd-opts.h@1.248.32.1 +4 -4
+ NTP_4_2_6P3_RC12
+
+ ntpd/ntpd-opts.texi@1.246.32.1 +2 -61
+ NTP_4_2_6P3_RC12
+
+ ntpd/ntpd.1@1.246.32.1 +2 -2
+ NTP_4_2_6P3_RC12
+
+ ntpdc/ntpdc-opts.c@1.244.32.1 +5 -5
+ NTP_4_2_6P3_RC12
+
+ ntpdc/ntpdc-opts.h@1.244.32.1 +4 -4
+ NTP_4_2_6P3_RC12
+
+ ntpdc/ntpdc-opts.texi@1.243.32.1 +2 -66
+ NTP_4_2_6P3_RC12
+
+ ntpdc/ntpdc.1@1.243.32.1 +2 -2
+ NTP_4_2_6P3_RC12
+
+ ntpq/ntpq-opts.c@1.245.32.1 +5 -5
+ NTP_4_2_6P3_RC12
+
+ ntpq/ntpq-opts.h@1.245.32.1 +4 -4
+ NTP_4_2_6P3_RC12
+
+ ntpq/ntpq-opts.texi@1.244.32.1 +2 -51
+ NTP_4_2_6P3_RC12
+
+ ntpq/ntpq.1@1.244.32.1 +2 -2
+ NTP_4_2_6P3_RC12
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.33.1 +5 -5
+ NTP_4_2_6P3_RC12
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.33.1 +4 -4
+ NTP_4_2_6P3_RC12
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.33.1 +1 -1
+ NTP_4_2_6P3_RC12
+
+ ntpsnmpd/ntpsnmpd.1@1.122.33.1 +2 -2
+ NTP_4_2_6P3_RC12
+
+ packageinfo.sh@1.255.30.1 +1 -1
+ NTP_4_2_6P3_RC12
+
+ sntp/sntp-opts.c@1.117.30.1 +5 -5
+ NTP_4_2_6P3_RC12
+
+ sntp/sntp-opts.h@1.117.30.1 +4 -4
+ NTP_4_2_6P3_RC12
+
+ sntp/sntp-opts.texi@1.117.30.1 +6 -59
+ NTP_4_2_6P3_RC12
+
+ sntp/sntp.1@1.117.30.1 +8 -4
+ NTP_4_2_6P3_RC12
+
+ sntp/sntp.html@1.7.31.1 +6 -59
+ NTP_4_2_6P3_RC12
+
+ util/ntp-keygen-opts.c@1.247.32.1 +5 -5
+ NTP_4_2_6P3_RC12
+
+ util/ntp-keygen-opts.h@1.247.32.1 +4 -4
+ NTP_4_2_6P3_RC12
+
+ util/ntp-keygen-opts.texi@1.246.32.1 +2 -45
+ NTP_4_2_6P3_RC12
+
+ util/ntp-keygen.1@1.246.32.1 +2 -2
+ NTP_4_2_6P3_RC12
+
+ChangeSet@1.2082.4.187, 2010-12-25 04:14:17-05:00, stenn@deacon.udel.edu
+ RC12 NEWS updates
+
+ NEWS@1.114 +23 -4
+ RC12 NEWS updates
+
+ChangeSet@1.2379, 2010-12-25 06:12:51+00:00, davehart@shiny.ad.hartbrothers.com
+ Add ntpq sysinfo command, similar to ntpdc's sysinfo.
+
+ ChangeLog@1.727 +1 -0
+ Add ntpq sysinfo command, similar to ntpdc's sysinfo.
+
+ include/ntp_control.h@1.51 +5 -1
+ add variables needed by ntpq -c sysinfo
+
+ include/ntp_stdlib.h@1.51 +4 -3
+ make stoa() and friends return const char *
+
+ libntp/modetoa.c@1.5 +1 -1
+ make modestrings[] pointers const
+
+ libntp/numtoa.c@1.6 +26 -0
+ add refid_str() using code lifted from ntp_control.c
+
+ libntp/refnumtoa.c@1.9 +4 -4
+ make stoa() and friends return const char *
+
+ libntp/socktoa.c@1.15 +2 -2
+ make stoa() and friends return const char *
+
+ ntpd/ntp_control.c@1.148 +44 -14
+ add variables needed by ntpq -c sysinfo
+
+ ntpd/ntp_request.c@1.99 +1 -1
+ ntpdc -c sysinfo stability units are supposed to be ppm but were s/s
+
+ ntpdc/ntpdc_ops.c@1.72 +5 -5
+ correct bug in last change to print_pflag()
+
+ ntpq/ntpq-subs.c@1.75 +94 -20
+ Add ntpq sysinfo command, similar to ntpdc's sysinfo.
+
+ ntpq/ntpq.h@1.21 +4 -0
+ Add ntpq sysinfo command, similar to ntpdc's sysinfo.
+
+ sntp/networking.c@1.46 +1 -1
+ Silence warnings about deprecated conversion from string constant to
+ char *.
+
+ sntp/networking.h@1.22 +2 -1
+ Silence warnings about deprecated conversion from string constant to
+ char *.
+
+ChangeSet@1.2378, 2010-12-24 09:44:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P103
+ TAG: NTP_4_2_7P103
+
+ ChangeLog@1.726 +1 -0
+ NTP_4_2_7P103
+
+ clockstuff/clktest-opts.c@1.27 +2 -2
+ NTP_4_2_7P103
+
+ clockstuff/clktest-opts.h@1.27 +3 -3
+ NTP_4_2_7P103
+
+ ntpd/ntpd-opts.c@1.107 +2 -2
+ NTP_4_2_7P103
+
+ ntpd/ntpd-opts.h@1.107 +3 -3
+ NTP_4_2_7P103
+
+ ntpd/ntpd-opts.texi@1.105 +1 -1
+ NTP_4_2_7P103
+
+ ntpd/ntpd.1@1.105 +2 -2
+ NTP_4_2_7P103
+
+ ntpdc/ntpdc-opts.c@1.104 +2 -2
+ NTP_4_2_7P103
+
+ ntpdc/ntpdc-opts.h@1.104 +3 -3
+ NTP_4_2_7P103
+
+ ntpdc/ntpdc-opts.texi@1.104 +1 -1
+ NTP_4_2_7P103
+
+ ntpdc/ntpdc.1@1.104 +2 -2
+ NTP_4_2_7P103
+
+ ntpq/ntpq-opts.c@1.104 +2 -2
+ NTP_4_2_7P103
+
+ ntpq/ntpq-opts.h@1.104 +3 -3
+ NTP_4_2_7P103
+
+ ntpq/ntpq-opts.texi@1.104 +1 -1
+ NTP_4_2_7P103
+
+ ntpq/ntpq.1@1.104 +2 -2
+ NTP_4_2_7P103
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.104 +2 -2
+ NTP_4_2_7P103
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.104 +3 -3
+ NTP_4_2_7P103
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.104 +1 -1
+ NTP_4_2_7P103
+
+ ntpsnmpd/ntpsnmpd.1@1.104 +2 -2
+ NTP_4_2_7P103
+
+ packageinfo.sh@1.105 +1 -1
+ NTP_4_2_7P103
+
+ sntp/sntp-opts.c@1.104 +2 -2
+ NTP_4_2_7P103
+
+ sntp/sntp-opts.h@1.104 +3 -3
+ NTP_4_2_7P103
+
+ sntp/sntp-opts.texi@1.104 +1 -1
+ NTP_4_2_7P103
+
+ sntp/sntp.1@1.104 +2 -2
+ NTP_4_2_7P103
+
+ sntp/sntp.html@1.104 +1 -1
+ NTP_4_2_7P103
+
+ util/ntp-keygen-opts.c@1.102 +2 -2
+ NTP_4_2_7P103
+
+ util/ntp-keygen-opts.h@1.102 +3 -3
+ NTP_4_2_7P103
+
+ util/ntp-keygen-opts.texi@1.105 +1 -1
+ NTP_4_2_7P103
+
+ util/ntp-keygen.1@1.105 +2 -2
+ NTP_4_2_7P103
+
+ChangeSet@1.2377, 2010-12-24 04:03:04-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.725 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.16 +33 -40
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2376, 2010-12-24 08:05:27+00:00, davehart@shiny.ad.hartbrothers.com
+ Add ntpq pstats command similar to ntpdc's.
+ Remove ntpq pstatus command, rv/readvar does the same and more.
+
+ ChangeLog@1.724 +2 -0
+ Add ntpq pstats command similar to ntpdc's.
+ Remove ntpq pstatus command, rv/readvar does the same and more.
+
+ include/ntp_control.h@1.50 +9 -1
+ add peer variables needed for ntpq -c "pstats &1" similar to
+ ntpdc -c "pstats 127.127.20.0".
+
+ libntp/statestr.c@1.22 +4 -4
+ correct switch/case indents.
+
+ ntpd/ntp_control.c@1.147 +59 -16
+ add peer variables needed for ntpq -c "pstats &1" similar to
+ ntpdc -c "pstats 127.127.20.0".
+
+ ntpdc/ntpdc_ops.c@1.71 +47 -40
+ repair print_pflag() removing inappropriate bclient, add missing flags.
+
+ ntpq/ntpq-subs.c@1.74 +120 -62
+ Add ntpq pstats command similar to ntpdc's.
+ Remove ntpq pstatus command, rv/readvar does the same and more.
+
+ ntpq/ntpq.c@1.123 +24 -0
+ add nntohostp() like nntohost() but including port.
+
+ ntpq/ntpq.h@1.20 +1 -0
+ add nntohostp()
+
+ChangeSet@1.2372.1.1, 2010-12-23 19:18:14+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct ntpq handling of &1 with multiple servers on cmd line.
+
+ include/ntp_calendar.h@1.7 +6 -5
+ make pointers in months[] and daynames[] const
+
+ libntp/prettydate.c@1.18 +2 -2
+ make pointers in months[] and daynames[] const
+
+ ntpq/ntpq-subs.c@1.73 +2 -2
+ clean up signed/unsigned comparison warnings
+
+ ntpq/ntpq.c@1.122 +10 -16
+ Correct ntpq handling of &1 with multiple servers on cmd line.
+
+ChangeSet@1.2374, 2010-12-23 11:12:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P102
+ TAG: NTP_4_2_7P102
+
+ ChangeLog@1.723 +1 -0
+ NTP_4_2_7P102
+
+ clockstuff/clktest-opts.c@1.26 +2 -2
+ NTP_4_2_7P102
+
+ clockstuff/clktest-opts.h@1.26 +3 -3
+ NTP_4_2_7P102
+
+ ntpd/ntpd-opts.c@1.106 +2 -2
+ NTP_4_2_7P102
+
+ ntpd/ntpd-opts.h@1.106 +3 -3
+ NTP_4_2_7P102
+
+ ntpd/ntpd-opts.texi@1.104 +1 -1
+ NTP_4_2_7P102
+
+ ntpd/ntpd.1@1.104 +2 -2
+ NTP_4_2_7P102
+
+ ntpdc/ntpdc-opts.c@1.103 +2 -2
+ NTP_4_2_7P102
+
+ ntpdc/ntpdc-opts.h@1.103 +3 -3
+ NTP_4_2_7P102
+
+ ntpdc/ntpdc-opts.texi@1.103 +1 -1
+ NTP_4_2_7P102
+
+ ntpdc/ntpdc.1@1.103 +2 -2
+ NTP_4_2_7P102
+
+ ntpq/ntpq-opts.c@1.103 +2 -2
+ NTP_4_2_7P102
+
+ ntpq/ntpq-opts.h@1.103 +3 -3
+ NTP_4_2_7P102
+
+ ntpq/ntpq-opts.texi@1.103 +1 -1
+ NTP_4_2_7P102
+
+ ntpq/ntpq.1@1.103 +2 -2
+ NTP_4_2_7P102
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.103 +2 -2
+ NTP_4_2_7P102
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.103 +3 -3
+ NTP_4_2_7P102
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.103 +1 -1
+ NTP_4_2_7P102
+
+ ntpsnmpd/ntpsnmpd.1@1.103 +2 -2
+ NTP_4_2_7P102
+
+ packageinfo.sh@1.104 +1 -1
+ NTP_4_2_7P102
+
+ sntp/sntp-opts.c@1.103 +2 -2
+ NTP_4_2_7P102
+
+ sntp/sntp-opts.h@1.103 +3 -3
+ NTP_4_2_7P102
+
+ sntp/sntp-opts.texi@1.103 +1 -1
+ NTP_4_2_7P102
+
+ sntp/sntp.1@1.103 +2 -2
+ NTP_4_2_7P102
+
+ sntp/sntp.html@1.103 +1 -1
+ NTP_4_2_7P102
+
+ util/ntp-keygen-opts.c@1.101 +2 -2
+ NTP_4_2_7P102
+
+ util/ntp-keygen-opts.h@1.101 +3 -3
+ NTP_4_2_7P102
+
+ util/ntp-keygen-opts.texi@1.104 +1 -1
+ NTP_4_2_7P102
+
+ util/ntp-keygen.1@1.104 +2 -2
+ NTP_4_2_7P102
+
+ChangeSet@1.2373, 2010-12-23 02:22:35-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.722 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.68 +2 -2
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.15 +33 -23
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.27 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.54 +14 -14
+ Documentation updates from Dave Mills
+
+ html/ntpq.html@1.43 +27 -23
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2372, 2010-12-23 07:03:00+00:00, davehart@shiny.ad.hartbrothers.com
+ Allow ntpq &1 associd use without preceding association-fetching.
+
+ ChangeLog@1.721 +1 -0
+ Allow ntpq &1 associd use without preceding association-fetching.
+
+ include/ntp_calendar.h@1.6 +2 -0
+ declare months[]
+
+ libntp/ntp_calendar.c@1.4 +7 -7
+ avoid shadows declaration warning with months[]
+
+ libntp/prettydate.c@1.17 +4 -4
+ match declaration to extern
+
+ ntpd/refclock_oncore.c@1.88 +5 -5
+ use libntp's months[] instead of local array
+
+ ntpdc/ntpdc.c@1.89 +0 -57
+ remove ntp_getopt() remains from ntpdc
+
+ ntpq/libntpq_subs.c@1.6 +7 -9
+ changes reflect dogetassoc() is no longer static
+
+ ntpq/ntpq-subs.c@1.72 +8 -11
+ make dogetassoc() global so ntpq.c getargs() can use it
+
+ ntpq/ntpq.c@1.121 +64 -123
+ Allow ntpq &1 associd use without preceding association-fetching.
+ Use libntp's months[]
+
+ ntpq/ntpq.h@1.19 +6 -3
+ use const
+
+ChangeSet@1.2371, 2010-12-22 12:37:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P101
+ TAG: NTP_4_2_7P101
+
+ ChangeLog@1.720 +1 -0
+ NTP_4_2_7P101
+
+ clockstuff/clktest-opts.c@1.25 +2 -2
+ NTP_4_2_7P101
+
+ clockstuff/clktest-opts.h@1.25 +3 -3
+ NTP_4_2_7P101
+
+ ntpd/ntpd-opts.c@1.105 +2 -2
+ NTP_4_2_7P101
+
+ ntpd/ntpd-opts.h@1.105 +3 -3
+ NTP_4_2_7P101
+
+ ntpd/ntpd-opts.texi@1.103 +1 -1
+ NTP_4_2_7P101
+
+ ntpd/ntpd.1@1.103 +2 -2
+ NTP_4_2_7P101
+
+ ntpdc/ntpdc-opts.c@1.102 +2 -2
+ NTP_4_2_7P101
+
+ ntpdc/ntpdc-opts.h@1.102 +3 -3
+ NTP_4_2_7P101
+
+ ntpdc/ntpdc-opts.texi@1.102 +1 -1
+ NTP_4_2_7P101
+
+ ntpdc/ntpdc.1@1.102 +2 -2
+ NTP_4_2_7P101
+
+ ntpq/ntpq-opts.c@1.102 +2 -2
+ NTP_4_2_7P101
+
+ ntpq/ntpq-opts.h@1.102 +3 -3
+ NTP_4_2_7P101
+
+ ntpq/ntpq-opts.texi@1.102 +1 -1
+ NTP_4_2_7P101
+
+ ntpq/ntpq.1@1.102 +2 -2
+ NTP_4_2_7P101
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.102 +2 -2
+ NTP_4_2_7P101
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.102 +3 -3
+ NTP_4_2_7P101
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.102 +1 -1
+ NTP_4_2_7P101
+
+ ntpsnmpd/ntpsnmpd.1@1.102 +2 -2
+ NTP_4_2_7P101
+
+ packageinfo.sh@1.103 +1 -1
+ NTP_4_2_7P101
+
+ sntp/sntp-opts.c@1.102 +2 -2
+ NTP_4_2_7P101
+
+ sntp/sntp-opts.h@1.102 +3 -3
+ NTP_4_2_7P101
+
+ sntp/sntp-opts.texi@1.102 +1 -1
+ NTP_4_2_7P101
+
+ sntp/sntp.1@1.102 +2 -2
+ NTP_4_2_7P101
+
+ sntp/sntp.html@1.102 +1 -1
+ NTP_4_2_7P101
+
+ util/ntp-keygen-opts.c@1.100 +2 -2
+ NTP_4_2_7P101
+
+ util/ntp-keygen-opts.h@1.100 +3 -3
+ NTP_4_2_7P101
+
+ util/ntp-keygen-opts.texi@1.103 +1 -1
+ NTP_4_2_7P101
+
+ util/ntp-keygen.1@1.103 +2 -2
+ NTP_4_2_7P101
+
+ChangeSet@1.2082.4.186, 2010-12-22 08:57:41+00:00, davehart@shiny.ad.hartbrothers.com
+ libopts 34.0.9 from AutoGen 5.11.6pre7
+ Relax minimum Automake version to 1.10 with updated libopts.m4.
+
+ ChangeLog@1.496.26.135 +2 -1
+ libopts 34.0.9 from AutoGen 5.11.6pre7
+ Relax minimum Automake version to 1.10 with updated libopts.m4.
+
+ Makefile.am@1.93.2.7 +2 -2
+ Relax minimum Automake version to 1.10 with updated libopts.m4.
+
+ configure.ac@1.465.1.24 +1 -1
+ libopts 34.0.9 from AutoGen 5.11.6pre7
+
+ sntp/Makefile.am@1.21.1.14 +2 -2
+ Relax minimum Automake version to 1.10 with updated libopts.m4.
+
+ sntp/libopts/m4/libopts.m4@1.14 +45 -17
+ libopts 34.0.9 from AutoGen 5.11.6pre7
+
+ChangeSet@1.2369, 2010-12-21 16:21:21-05:00, stenn@deacon.udel.edu
+ Documentation updates for sntp
+
+ ChangeLog@1.718 +2 -0
+ Documentation updates for sntp
+
+ChangeSet@1.2368, 2010-12-21 11:27:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P100
+ TAG: NTP_4_2_7P100
+
+ ChangeLog@1.717 +1 -0
+ NTP_4_2_7P100
+
+ clockstuff/clktest-opts.c@1.24 +3 -3
+ NTP_4_2_7P100
+
+ clockstuff/clktest-opts.h@1.24 +3 -3
+ NTP_4_2_7P100
+
+ ntpd/ntpd-opts.c@1.104 +3 -3
+ NTP_4_2_7P100
+
+ ntpd/ntpd-opts.h@1.104 +3 -3
+ NTP_4_2_7P100
+
+ ntpd/ntpd-opts.texi@1.102 +1 -1
+ NTP_4_2_7P100
+
+ ntpd/ntpd.1@1.102 +2 -2
+ NTP_4_2_7P100
+
+ ntpdc/ntpdc-opts.c@1.101 +3 -3
+ NTP_4_2_7P100
+
+ ntpdc/ntpdc-opts.h@1.101 +3 -3
+ NTP_4_2_7P100
+
+ ntpdc/ntpdc-opts.texi@1.101 +1 -1
+ NTP_4_2_7P100
+
+ ntpdc/ntpdc.1@1.101 +2 -2
+ NTP_4_2_7P100
+
+ ntpq/ntpq-opts.c@1.101 +3 -3
+ NTP_4_2_7P100
+
+ ntpq/ntpq-opts.h@1.101 +3 -3
+ NTP_4_2_7P100
+
+ ntpq/ntpq-opts.texi@1.101 +1 -1
+ NTP_4_2_7P100
+
+ ntpq/ntpq.1@1.101 +2 -2
+ NTP_4_2_7P100
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.101 +3 -3
+ NTP_4_2_7P100
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.101 +3 -3
+ NTP_4_2_7P100
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.101 +1 -1
+ NTP_4_2_7P100
+
+ ntpsnmpd/ntpsnmpd.1@1.101 +2 -2
+ NTP_4_2_7P100
+
+ packageinfo.sh@1.102 +1 -1
+ NTP_4_2_7P100
+
+ sntp/sntp-opts.c@1.101 +3 -3
+ NTP_4_2_7P100
+
+ sntp/sntp-opts.h@1.101 +3 -3
+ NTP_4_2_7P100
+
+ sntp/sntp-opts.texi@1.101 +5 -4
+ NTP_4_2_7P100
+
+ sntp/sntp.1@1.101 +8 -4
+ NTP_4_2_7P100
+
+ sntp/sntp.html@1.101 +5 -4
+ NTP_4_2_7P100
+
+ util/ntp-keygen-opts.c@1.99 +3 -3
+ NTP_4_2_7P100
+
+ util/ntp-keygen-opts.h@1.99 +3 -3
+ NTP_4_2_7P100
+
+ util/ntp-keygen-opts.texi@1.102 +1 -1
+ NTP_4_2_7P100
+
+ util/ntp-keygen.1@1.102 +2 -2
+ NTP_4_2_7P100
+
+ChangeSet@1.2366, 2010-12-21 09:36:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P99
+ TAG: NTP_4_2_7P99
+
+ ChangeLog@1.716 +1 -0
+ NTP_4_2_7P99
+
+ clockstuff/clktest-opts.c@1.23 +2 -2
+ NTP_4_2_7P99
+
+ clockstuff/clktest-opts.h@1.23 +3 -3
+ NTP_4_2_7P99
+
+ ntpd/ntpd-opts.c@1.103 +2 -2
+ NTP_4_2_7P99
+
+ ntpd/ntpd-opts.h@1.103 +3 -3
+ NTP_4_2_7P99
+
+ ntpd/ntpd-opts.texi@1.101 +1 -1
+ NTP_4_2_7P99
+
+ ntpd/ntpd.1@1.101 +2 -2
+ NTP_4_2_7P99
+
+ ntpdc/ntpdc-opts.c@1.100 +2 -2
+ NTP_4_2_7P99
+
+ ntpdc/ntpdc-opts.h@1.100 +3 -3
+ NTP_4_2_7P99
+
+ ntpdc/ntpdc-opts.texi@1.100 +1 -1
+ NTP_4_2_7P99
+
+ ntpdc/ntpdc.1@1.100 +2 -2
+ NTP_4_2_7P99
+
+ ntpq/ntpq-opts.c@1.100 +2 -2
+ NTP_4_2_7P99
+
+ ntpq/ntpq-opts.h@1.100 +3 -3
+ NTP_4_2_7P99
+
+ ntpq/ntpq-opts.texi@1.100 +1 -1
+ NTP_4_2_7P99
+
+ ntpq/ntpq.1@1.100 +2 -2
+ NTP_4_2_7P99
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.100 +2 -2
+ NTP_4_2_7P99
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.100 +3 -3
+ NTP_4_2_7P99
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.100 +1 -1
+ NTP_4_2_7P99
+
+ ntpsnmpd/ntpsnmpd.1@1.100 +2 -2
+ NTP_4_2_7P99
+
+ packageinfo.sh@1.101 +1 -1
+ NTP_4_2_7P99
+
+ sntp/sntp-opts.c@1.100 +2 -2
+ NTP_4_2_7P99
+
+ sntp/sntp-opts.h@1.100 +3 -3
+ NTP_4_2_7P99
+
+ sntp/sntp-opts.texi@1.100 +1 -1
+ NTP_4_2_7P99
+
+ sntp/sntp.1@1.100 +2 -2
+ NTP_4_2_7P99
+
+ sntp/sntp.html@1.100 +1 -1
+ NTP_4_2_7P99
+
+ util/ntp-keygen-opts.c@1.98 +2 -2
+ NTP_4_2_7P99
+
+ util/ntp-keygen-opts.h@1.98 +3 -3
+ NTP_4_2_7P99
+
+ util/ntp-keygen-opts.texi@1.101 +1 -1
+ NTP_4_2_7P99
+
+ util/ntp-keygen.1@1.101 +2 -2
+ NTP_4_2_7P99
+
+ChangeSet@1.2082.46.1, 2010-12-21 07:15:24+00:00, davehart@shiny.ad.hartbrothers.com
+ handle % at end of string correctly in format_errmsg().
+ do not force trailing newline in m[v]snprintf().
+
+ libntp/msyslog.c@1.24.1.3 +54 -29
+ handle % at end of string correctly in format_errmsg().
+ do not force trailing newline in m[v]snprintf().
+
+ChangeSet@1.2364, 2010-12-21 06:58:01+00:00, davehart@shiny.ad.hartbrothers.com
+ Add unit tests for msnprintf().
+ move responsibility for adding newline if not present from
+ format_errmsg() to addto_syslog() so that msnprintf() does
+ not also force a trailing newline.
+ Correct corner case of "%\0" in msyslog() and friends.
+
+ ChangeLog@1.715 +1 -0
+ Add unit tests for msnprintf().
+
+ libntp/msyslog.c@1.28 +49 -29
+ Move responsibility for adding newline if not present from
+ format_errmsg() to addto_syslog() so that msnprintf() does
+ not also force a trailing newline.
+ Correct corner case of %\0 in msyslog() and friends.
+
+ tests/libntp/Makefile.am@1.25 +1 -0
+ add msyslog.cpp
+
+ tests/libntp/msyslog.cpp@1.1 +84 -0
+ unit tests for msnprintf() and format_errmsg()
+
+ tests/libntp/msyslog.cpp@1.0 +0 -0
+
+ChangeSet@1.2082.4.184, 2010-12-20 18:41:39-08:00, stenn@stenn.ntp.org
+ [Bug 1743] update SNTP time reporting documentation
+
+ sntp/sntp-opts.def@1.19 +10 -5
+ [Bug 1743] update SNTP time reporting documentation
+
+ChangeSet@1.2363, 2010-12-20 18:13:16-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/pic/flt8.gif@1.1 +134 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt8.gif
+
+ html/pic/flt8.gif@1.0 +0 -0
+
+ html/pic/flt9.gif@1.1 +200 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt9.gif
+
+ html/pic/flt9.gif@1.0 +0 -0
+
+ChangeSet@1.2361, 2010-12-20 09:04:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P98
+ TAG: NTP_4_2_7P98
+
+ ChangeLog@1.713 +1 -0
+ NTP_4_2_7P98
+
+ clockstuff/clktest-opts.c@1.22 +2 -2
+ NTP_4_2_7P98
+
+ clockstuff/clktest-opts.h@1.22 +3 -3
+ NTP_4_2_7P98
+
+ ntpd/ntpd-opts.c@1.102 +2 -2
+ NTP_4_2_7P98
+
+ ntpd/ntpd-opts.h@1.102 +3 -3
+ NTP_4_2_7P98
+
+ ntpd/ntpd-opts.texi@1.100 +1 -1
+ NTP_4_2_7P98
+
+ ntpd/ntpd.1@1.100 +2 -2
+ NTP_4_2_7P98
+
+ ntpdc/ntpdc-opts.c@1.99 +2 -2
+ NTP_4_2_7P98
+
+ ntpdc/ntpdc-opts.h@1.99 +3 -3
+ NTP_4_2_7P98
+
+ ntpdc/ntpdc-opts.texi@1.99 +1 -1
+ NTP_4_2_7P98
+
+ ntpdc/ntpdc.1@1.99 +2 -2
+ NTP_4_2_7P98
+
+ ntpq/ntpq-opts.c@1.99 +2 -2
+ NTP_4_2_7P98
+
+ ntpq/ntpq-opts.h@1.99 +3 -3
+ NTP_4_2_7P98
+
+ ntpq/ntpq-opts.texi@1.99 +1 -1
+ NTP_4_2_7P98
+
+ ntpq/ntpq.1@1.99 +2 -2
+ NTP_4_2_7P98
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.99 +2 -2
+ NTP_4_2_7P98
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.99 +3 -3
+ NTP_4_2_7P98
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.99 +1 -1
+ NTP_4_2_7P98
+
+ ntpsnmpd/ntpsnmpd.1@1.99 +2 -2
+ NTP_4_2_7P98
+
+ packageinfo.sh@1.100 +1 -1
+ NTP_4_2_7P98
+
+ sntp/sntp-opts.c@1.99 +2 -2
+ NTP_4_2_7P98
+
+ sntp/sntp-opts.h@1.99 +3 -3
+ NTP_4_2_7P98
+
+ sntp/sntp-opts.texi@1.99 +1 -1
+ NTP_4_2_7P98
+
+ sntp/sntp.1@1.99 +2 -2
+ NTP_4_2_7P98
+
+ sntp/sntp.html@1.99 +1 -1
+ NTP_4_2_7P98
+
+ util/ntp-keygen-opts.c@1.97 +2 -2
+ NTP_4_2_7P98
+
+ util/ntp-keygen-opts.h@1.97 +3 -3
+ NTP_4_2_7P98
+
+ util/ntp-keygen-opts.texi@1.100 +1 -1
+ NTP_4_2_7P98
+
+ util/ntp-keygen.1@1.100 +2 -2
+ NTP_4_2_7P98
+
+ChangeSet@1.2360, 2010-12-20 03:50:47-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.712 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.14 +23 -17
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2359, 2010-12-20 08:24:12+00:00, hart@psp-fb1.ntp.org
+ ntp_parser.c:
+ Bison output
+ complete.conf:
+ add top-level ident directive
+
+ ntpd/complete.conf@1.14 +1 -0
+ add top-level ident directive
+
+ ntpd/ntp_parser.c@1.74 +393 -381
+ Bison output
+
+ChangeSet@1.2358, 2010-12-20 08:12:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1761] clockstuff/clktest-opts.h omitted from tarball.
+
+ ChangeLog@1.711 +1 -0
+ [Bug 1761] clockstuff/clktest-opts.h omitted from tarball.
+
+ clockstuff/Makefile.am@1.14 +1 -1
+ [Bug 1761] clockstuff/clktest-opts.h omitted from tarball.
+
+ ntpd/ntp_config.c@1.279 +4 -0
+ add "ident <group>" top-level directive at DLM request.
+
+ ntpd/ntp_parser.y@1.68 +2 -1
+ add "ident <group>" top-level directive at DLM request.
+
+ChangeSet@1.2082.44.8, 2010-12-20 07:54:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1458] Can not compile NTP on FreeBSD 4.7.
+ -- applies to prior lineedit cset which overlooked ChangeLog
+ [Bug 1762] manycastclient solicitation responses interfere.
+
+ ChangeLog@1.496.60.3 +2 -0
+ [Bug 1458] Can not compile NTP on FreeBSD 4.7.
+ -- applies to prior lineedit cset which overlooked ChangeLog
+ [Bug 1762] manycastclient solicitation responses interfere.
+
+ include/ntp.h@1.168.1.5 +1 -1
+ struct interface -> endpt
+
+ include/ntpd.h@1.137.2.4 +1 -1
+ [Bug 1762] manycastclient solicitation responses interfere.
+
+ include/recvbuff.h@1.19.1.1 +1 -1
+ struct interface -> endpt
+
+ ntpd/ntp_peer.c@1.126.1.3 +33 -13
+ [Bug 1762] manycastclient solicitation responses interfere.
+
+ ntpd/ntp_proto.c@1.297.2.2 +1 -2
+ [Bug 1762] manycastclient solicitation responses interfere.
+
+ChangeSet@1.2356, 2010-12-19 09:38:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P97
+ TAG: NTP_4_2_7P97
+
+ ChangeLog@1.709 +1 -0
+ NTP_4_2_7P97
+
+ clockstuff/clktest-opts.c@1.21 +21 -16
+ NTP_4_2_7P97
+
+ clockstuff/clktest-opts.h@1.21 +5 -5
+ NTP_4_2_7P97
+
+ ntpd/ntpd-opts.c@1.101 +16 -11
+ NTP_4_2_7P97
+
+ ntpd/ntpd-opts.h@1.101 +5 -5
+ NTP_4_2_7P97
+
+ ntpd/ntpd-opts.texi@1.99 +1 -1
+ NTP_4_2_7P97
+
+ ntpd/ntpd.1@1.99 +2 -2
+ NTP_4_2_7P97
+
+ ntpdc/ntpdc-opts.c@1.98 +21 -16
+ NTP_4_2_7P97
+
+ ntpdc/ntpdc-opts.h@1.98 +5 -5
+ NTP_4_2_7P97
+
+ ntpdc/ntpdc-opts.texi@1.98 +1 -1
+ NTP_4_2_7P97
+
+ ntpdc/ntpdc.1@1.98 +2 -2
+ NTP_4_2_7P97
+
+ ntpq/ntpq-opts.c@1.98 +21 -16
+ NTP_4_2_7P97
+
+ ntpq/ntpq-opts.h@1.98 +5 -5
+ NTP_4_2_7P97
+
+ ntpq/ntpq-opts.texi@1.98 +1 -1
+ NTP_4_2_7P97
+
+ ntpq/ntpq.1@1.98 +2 -2
+ NTP_4_2_7P97
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.98 +20 -15
+ NTP_4_2_7P97
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.98 +5 -5
+ NTP_4_2_7P97
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.98 +1 -1
+ NTP_4_2_7P97
+
+ ntpsnmpd/ntpsnmpd.1@1.98 +2 -2
+ NTP_4_2_7P97
+
+ packageinfo.sh@1.99 +1 -1
+ NTP_4_2_7P97
+
+ sntp/sntp-opts.c@1.98 +23 -18
+ NTP_4_2_7P97
+
+ sntp/sntp-opts.h@1.98 +5 -5
+ NTP_4_2_7P97
+
+ sntp/sntp-opts.texi@1.98 +1 -1
+ NTP_4_2_7P97
+
+ sntp/sntp.1@1.98 +2 -2
+ NTP_4_2_7P97
+
+ sntp/sntp.html@1.98 +1 -1
+ NTP_4_2_7P97
+
+ util/ntp-keygen-opts.c@1.96 +21 -16
+ NTP_4_2_7P97
+
+ util/ntp-keygen-opts.h@1.96 +5 -5
+ NTP_4_2_7P97
+
+ util/ntp-keygen-opts.texi@1.99 +1 -1
+ NTP_4_2_7P97
+
+ util/ntp-keygen.1@1.99 +2 -2
+ NTP_4_2_7P97
+
+ChangeSet@1.2082.44.7, 2010-12-19 00:04:39-05:00, stenn@deacon.udel.edu
+ Remove unused libntp/net.c.bak file
+
+ BitKeeper/deleted/.del-net.c.bak~d1c71b19@1.3 +0 -0
+ Delete: libntp/net.c.bak
+
+ChangeSet@1.2355, 2010-12-19 00:00:18-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.708 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.13 +17 -29
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2082.44.6, 2010-12-19 03:42:39+00:00, hart@psp-os1.ntp.org
+ sntp AutoGen 5.11.6pre5 output
+
+ sntp/sntp-opts.c@1.117.29.1 +29 -30
+ sntp AutoGen 5.11.6pre5 output
+
+ sntp/sntp-opts.h@1.117.29.1 +13 -4
+ sntp AutoGen 5.11.6pre5 output
+
+ sntp/sntp-opts.texi@1.117.29.1 +85 -19
+ sntp AutoGen 5.11.6pre5 output
+
+ sntp/sntp.1@1.117.29.1 +8 -6
+ sntp AutoGen 5.11.6pre5 output
+
+ sntp/sntp.html@1.7.30.1 +79 -16
+ sntp AutoGen 5.11.6pre5 output
+
+ChangeSet@1.2082.44.5, 2010-12-19 01:10:44+00:00, hart@psp-os1.ntp.org
+ AutoGen 5.11.6pre5 output
+
+ ntpd/ntpd-opts.c@1.248.31.1 +15 -10
+ AutoGen 5.11.6pre5 output
+
+ ntpd/ntpd-opts.h@1.248.31.1 +3 -3
+ AutoGen 5.11.6pre5 output
+
+ ntpd/ntpd-opts.texi@1.246.31.1 +61 -2
+ AutoGen 5.11.6pre5 output
+
+ ntpd/ntpd.1@1.246.31.1 +2 -2
+ AutoGen 5.11.6pre5 output
+
+ ntpdc/ntpdc-opts.c@1.244.31.1 +20 -15
+ AutoGen 5.11.6pre5 output
+
+ ntpdc/ntpdc-opts.h@1.244.31.1 +3 -3
+ AutoGen 5.11.6pre5 output
+
+ ntpdc/ntpdc-opts.texi@1.243.31.1 +66 -2
+ AutoGen 5.11.6pre5 output
+
+ ntpdc/ntpdc.1@1.243.31.1 +2 -2
+ AutoGen 5.11.6pre5 output
+
+ ntpq/ntpq-opts.c@1.245.31.1 +20 -15
+ AutoGen 5.11.6pre5 output
+
+ ntpq/ntpq-opts.h@1.245.31.1 +3 -3
+ AutoGen 5.11.6pre5 output
+
+ ntpq/ntpq-opts.texi@1.244.31.1 +51 -2
+ AutoGen 5.11.6pre5 output
+
+ ntpq/ntpq.1@1.244.31.1 +2 -2
+ AutoGen 5.11.6pre5 output
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.32.1 +19 -14
+ AutoGen 5.11.6pre5 output
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.32.1 +3 -3
+ AutoGen 5.11.6pre5 output
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.32.1 +1 -1
+ AutoGen 5.11.6pre5 output
+
+ ntpsnmpd/ntpsnmpd.1@1.122.32.1 +2 -2
+ AutoGen 5.11.6pre5 output
+
+ util/ntp-keygen-opts.c@1.247.31.1 +20 -15
+ AutoGen 5.11.6pre5 output
+
+ util/ntp-keygen-opts.h@1.247.31.1 +3 -3
+ AutoGen 5.11.6pre5 output
+
+ util/ntp-keygen-opts.texi@1.246.31.1 +45 -2
+ AutoGen 5.11.6pre5 output
+
+ util/ntp-keygen.1@1.246.31.1 +2 -2
+ AutoGen 5.11.6pre5 output
+
+ChangeSet@1.2082.44.4, 2010-12-19 00:59:46+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1760] ntpd Windows interpolation cannot be disabled.
+ Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre5.
+ applies to prior cset merged from ntp-stable-libopts-upstream
+
+ ChangeLog@1.496.60.2 +2 -1
+ [Bug 1760] ntpd Windows interpolation cannot be disabled.
+ Upgrade to libopts 34.0.9 from AutoGen 5.11.6pre5.
+
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.38.1.4 +3 -1
+ [Bug 1760] ntpd Windows interpolation cannot be disabled.
+
+ChangeSet@1.2082.45.1, 2010-12-19 00:50:10+00:00, davehart@shiny.ad.hartbrothers.com
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/Makefile.am@1.8 +5 -5
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/ag-char-map.h@1.11 +32 -32
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/autoopts.c@1.8 +21 -10
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/autoopts.h@1.7 +19 -18
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/autoopts/options.h@1.10 +11 -6
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/autoopts/usage-txt.h@1.10 +175 -168
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/genshell.c@1.11 +16 -11
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/genshell.h@1.11 +3 -3
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/load.c@1.8 +27 -31
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/m4/libopts.m4@1.11.1.1 +1 -1
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/proto.h@1.11 +1 -1
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/usage.c@1.7 +23 -24
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/value-type.h@1.11 +1 -1
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ sntp/libopts/xat-attribute.h@1.11 +1 -1
+ libopts 34.0.9 (AutoGen 5.11.6pre5)
+
+ChangeSet@1.2352, 2010-12-18 11:29:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P96
+ TAG: NTP_4_2_7P96
+
+ ChangeLog@1.706 +1 -0
+ NTP_4_2_7P96
+
+ clockstuff/clktest-opts.c@1.20 +3 -3
+ NTP_4_2_7P96
+
+ clockstuff/clktest-opts.h@1.20 +5 -5
+ NTP_4_2_7P96
+
+ ntpd/ntpd-opts.c@1.100 +3 -3
+ NTP_4_2_7P96
+
+ ntpd/ntpd-opts.h@1.100 +5 -5
+ NTP_4_2_7P96
+
+ ntpd/ntpd-opts.texi@1.98 +1 -1
+ NTP_4_2_7P96
+
+ ntpd/ntpd.1@1.98 +2 -2
+ NTP_4_2_7P96
+
+ ntpdc/ntpdc-opts.c@1.97 +3 -3
+ NTP_4_2_7P96
+
+ ntpdc/ntpdc-opts.h@1.97 +5 -5
+ NTP_4_2_7P96
+
+ ntpdc/ntpdc-opts.texi@1.97 +1 -1
+ NTP_4_2_7P96
+
+ ntpdc/ntpdc.1@1.97 +2 -2
+ NTP_4_2_7P96
+
+ ntpq/ntpq-opts.c@1.97 +3 -3
+ NTP_4_2_7P96
+
+ ntpq/ntpq-opts.h@1.97 +5 -5
+ NTP_4_2_7P96
+
+ ntpq/ntpq-opts.texi@1.97 +1 -1
+ NTP_4_2_7P96
+
+ ntpq/ntpq.1@1.97 +2 -2
+ NTP_4_2_7P96
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.97 +3 -3
+ NTP_4_2_7P96
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.97 +5 -5
+ NTP_4_2_7P96
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.97 +1 -1
+ NTP_4_2_7P96
+
+ ntpsnmpd/ntpsnmpd.1@1.97 +2 -2
+ NTP_4_2_7P96
+
+ packageinfo.sh@1.98 +1 -1
+ NTP_4_2_7P96
+
+ sntp/sntp-opts.c@1.97 +3 -3
+ NTP_4_2_7P96
+
+ sntp/sntp-opts.h@1.97 +5 -5
+ NTP_4_2_7P96
+
+ sntp/sntp-opts.texi@1.97 +1 -1
+ NTP_4_2_7P96
+
+ sntp/sntp.1@1.97 +2 -2
+ NTP_4_2_7P96
+
+ sntp/sntp.html@1.97 +1 -1
+ NTP_4_2_7P96
+
+ util/ntp-keygen-opts.c@1.95 +3 -3
+ NTP_4_2_7P96
+
+ util/ntp-keygen-opts.h@1.95 +5 -5
+ NTP_4_2_7P96
+
+ util/ntp-keygen-opts.texi@1.98 +1 -1
+ NTP_4_2_7P96
+
+ util/ntp-keygen.1@1.98 +2 -2
+ NTP_4_2_7P96
+
+ChangeSet@1.2082.44.2, 2010-12-18 06:57:45+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1458] Can not compile NTP on FreeBSD 4.7
+
+ libntp/ntp_lineedit.c@1.9 +17 -10
+ [Bug 1458] Can not compile NTP on FreeBSD 4.7
+
+ m4/ntp_lineeditlibs.m4@1.10 +26 -0
+ [Bug 1458] Can not compile NTP on FreeBSD 4.7
+
+ChangeSet@1.2351, 2010-12-18 01:07:11-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.705 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.12 +24 -3
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2350, 2010-12-18 03:22:45+00:00, davehart@shiny.ad.hartbrothers.com
+ Log listening address as addr:port.
+ remove assoc_number < 0 check now that it is unsigned.
+
+ ntpd/ntp_io.c@1.337 +2 -3
+ Log listening address as addr:port
+
+ ntpq/libntpq.c@1.10 +1 -1
+ remove assoc_number < 0 check now that it is unsigned.
+
+ChangeSet@1.2082.44.1, 2010-12-18 02:38:28+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex.
+
+ ChangeLog@1.496.60.1 +1 -0
+ [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex.
+
+ ntpd/ntp_io.c@1.306.3.1 +48 -72
+ [Bug 1758] setsockopt IPV6_MULTICAST_IF with wrong ifindex.
+
+ChangeSet@1.2348, 2010-12-17 04:38:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P95
+ TAG: NTP_4_2_7P95
+
+ ChangeLog@1.703 +1 -0
+ NTP_4_2_7P95
+
+ clockstuff/clktest-opts.c@1.19 +3 -3
+ NTP_4_2_7P95
+
+ clockstuff/clktest-opts.h@1.19 +15 -6
+ NTP_4_2_7P95
+
+ ntpd/ntpd-opts.c@1.99 +3 -3
+ NTP_4_2_7P95
+
+ ntpd/ntpd-opts.h@1.99 +15 -6
+ NTP_4_2_7P95
+
+ ntpd/ntpd-opts.texi@1.97 +2 -75
+ NTP_4_2_7P95
+
+ ntpd/ntpd.1@1.97 +2 -2
+ NTP_4_2_7P95
+
+ ntpdc/ntpdc-opts.c@1.96 +3 -3
+ NTP_4_2_7P95
+
+ ntpdc/ntpdc-opts.h@1.96 +15 -6
+ NTP_4_2_7P95
+
+ ntpdc/ntpdc-opts.texi@1.96 +2 -66
+ NTP_4_2_7P95
+
+ ntpdc/ntpdc.1@1.96 +2 -2
+ NTP_4_2_7P95
+
+ ntpq/ntpq-opts.c@1.96 +3 -3
+ NTP_4_2_7P95
+
+ ntpq/ntpq-opts.h@1.96 +15 -6
+ NTP_4_2_7P95
+
+ ntpq/ntpq-opts.texi@1.96 +2 -51
+ NTP_4_2_7P95
+
+ ntpq/ntpq.1@1.96 +2 -2
+ NTP_4_2_7P95
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.96 +3 -3
+ NTP_4_2_7P95
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.96 +15 -6
+ NTP_4_2_7P95
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.96 +2 -24
+ NTP_4_2_7P95
+
+ ntpsnmpd/ntpsnmpd.1@1.96 +2 -2
+ NTP_4_2_7P95
+
+ packageinfo.sh@1.97 +1 -1
+ NTP_4_2_7P95
+
+ sntp/sntp-opts.c@1.96 +3 -3
+ NTP_4_2_7P95
+
+ sntp/sntp-opts.h@1.96 +15 -6
+ NTP_4_2_7P95
+
+ sntp/sntp-opts.texi@1.96 +2 -56
+ NTP_4_2_7P95
+
+ sntp/sntp.1@1.96 +2 -2
+ NTP_4_2_7P95
+
+ sntp/sntp.html@1.96 +2 -56
+ NTP_4_2_7P95
+
+ util/ntp-keygen-opts.c@1.94 +3 -3
+ NTP_4_2_7P95
+
+ util/ntp-keygen-opts.h@1.94 +15 -6
+ NTP_4_2_7P95
+
+ util/ntp-keygen-opts.texi@1.97 +2 -47
+ NTP_4_2_7P95
+
+ util/ntp-keygen.1@1.97 +2 -2
+ NTP_4_2_7P95
+
+ChangeSet@1.2346, 2010-12-16 22:02:02-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.701 +1 -0
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.54 +10 -8
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2082.4.182, 2010-12-17 02:53:54+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1757] oncore snprintf("%m") doesn't expand %m.
+
+ ChangeLog@1.496.26.133 +1 -0
+ [Bug 1757] oncore snprintf("%m") doesn't expand %m.
+
+ include/ntp_stdlib.h@1.40.1.4 +4 -1
+ add mvsnprintf(), msnprintf() clones of vsnprintf() and snprintf() which
+ expand %m to strerror(errno) like msyslog()
+
+ libntp/msyslog.c@1.24.1.2 +43 -23
+ add mvsnprintf(), msnprintf() clones of vsnprintf() and snprintf() which
+ expand %m to strerror(errno) like msyslog()
+
+ ntpd/ntp_io.c@1.306.1.14 +1 -1
+ silence potentially uninit warning
+
+ ntpd/refclock_oncore.c@1.82.1.1 +5 -5
+ [Bug 1757] oncore snprintf("%m") doesn't expand %m.
+
+ChangeSet@1.2082.42.3, 2010-12-17 01:59:53+00:00, hart@psp-os1.ntp.org
+ Many files:
+ Autogen 5.11.6pre3 output
+
+ ntpd/ntpd-opts.c@1.248.30.1 +5 -5
+ Autogen 5.11.6pre3 output
+
+ ntpd/ntpd-opts.h@1.248.30.1 +13 -4
+ Autogen 5.11.6pre3 output
+
+ ntpd/ntpd-opts.texi@1.246.30.1 +1 -1
+ Autogen 5.11.6pre3 output
+
+ ntpd/ntpd.1@1.246.30.1 +2 -2
+ Autogen 5.11.6pre3 output
+
+ ntpdc/ntpdc-opts.c@1.244.30.1 +5 -5
+ Autogen 5.11.6pre3 output
+
+ ntpdc/ntpdc-opts.h@1.244.30.1 +13 -4
+ Autogen 5.11.6pre3 output
+
+ ntpdc/ntpdc-opts.texi@1.243.30.1 +1 -1
+ Autogen 5.11.6pre3 output
+
+ ntpdc/ntpdc.1@1.243.30.1 +2 -2
+ Autogen 5.11.6pre3 output
+
+ ntpq/ntpq-opts.c@1.245.30.1 +5 -5
+ Autogen 5.11.6pre3 output
+
+ ntpq/ntpq-opts.h@1.245.30.1 +13 -4
+ Autogen 5.11.6pre3 output
+
+ ntpq/ntpq-opts.texi@1.244.30.1 +1 -1
+ Autogen 5.11.6pre3 output
+
+ ntpq/ntpq.1@1.244.30.1 +2 -2
+ Autogen 5.11.6pre3 output
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.31.1 +5 -5
+ Autogen 5.11.6pre3 output
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.31.1 +13 -4
+ Autogen 5.11.6pre3 output
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.31.1 +1 -1
+ Autogen 5.11.6pre3 output
+
+ ntpsnmpd/ntpsnmpd.1@1.122.31.1 +2 -2
+ Autogen 5.11.6pre3 output
+
+ util/ntp-keygen-opts.c@1.247.30.1 +5 -5
+ Autogen 5.11.6pre3 output
+
+ util/ntp-keygen-opts.h@1.247.30.1 +13 -4
+ Autogen 5.11.6pre3 output
+
+ util/ntp-keygen-opts.texi@1.246.30.1 +1 -1
+ Autogen 5.11.6pre3 output
+
+ util/ntp-keygen.1@1.246.30.1 +2 -2
+ Autogen 5.11.6pre3 output
+
+ChangeSet@1.2082.42.2, 2010-12-17 01:46:51+00:00, davehart@shiny.ad.hartbrothers.com
+ restore NTP local patch to LIBOPTS_CHECK to not build libopts
+ from the top-level configure.ac.
+
+ sntp/libopts/m4/libopts.m4@1.12 +10 -7
+ restore NTP local patch to LIBOPTS_CHECK to not build libopts
+ from the top-level configure.ac.
+
+ChangeSet@1.2082.42.1, 2010-12-17 01:43:41+00:00, davehart@shiny.ad.hartbrothers.com
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ ChangeLog@1.496.26.132 +1 -1
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/Makefile.am@1.7 +5 -5
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/README@1.5 +1 -1
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/ag-char-map.h@1.10 +1 -1
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/autoopts/options.h@1.9 +12 -5
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/autoopts/usage-txt.h@1.9 +1 -1
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/configfile.c@1.9 +14 -7
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/genshell.c@1.10 +2 -2
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/genshell.h@1.10 +3 -3
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/m4/libopts.m4@1.11 +8 -11
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/makeshell.c@1.7 +17 -9
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/proto.h@1.10 +1 -1
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/value-type.h@1.10 +1 -1
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ sntp/libopts/xat-attribute.h@1.10 +1 -1
+ libopts 33.5.8 unmodified from AutoGen 5.11.6pre3
+
+ChangeSet@1.2082.4.179, 2010-12-16 20:22:36-05:00, stenn@deacon.udel.edu
+ libopts upgrade
+
+ ntpd/ntpd-opts.c@1.248.29.1 +5 -5
+ libopts upgrade
+
+ ntpd/ntpd-opts.h@1.248.29.1 +13 -4
+ libopts upgrade
+
+ ntpd/ntpd-opts.texi@1.246.29.1 +61 -2
+ libopts upgrade
+
+ ntpd/ntpd.1@1.246.29.1 +2 -2
+ libopts upgrade
+
+ ntpdc/ntpdc-opts.c@1.244.29.1 +5 -5
+ libopts upgrade
+
+ ntpdc/ntpdc-opts.h@1.244.29.1 +13 -4
+ libopts upgrade
+
+ ntpdc/ntpdc-opts.texi@1.243.29.1 +66 -2
+ libopts upgrade
+
+ ntpdc/ntpdc.1@1.243.29.1 +2 -2
+ libopts upgrade
+
+ ntpq/ntpq-opts.c@1.245.29.1 +5 -5
+ libopts upgrade
+
+ ntpq/ntpq-opts.h@1.245.29.1 +13 -4
+ libopts upgrade
+
+ ntpq/ntpq-opts.texi@1.244.29.1 +51 -2
+ libopts upgrade
+
+ ntpq/ntpq.1@1.244.29.1 +2 -2
+ libopts upgrade
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.30.1 +5 -5
+ libopts upgrade
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.30.1 +13 -4
+ libopts upgrade
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.30.1 +24 -2
+ libopts upgrade
+
+ ntpsnmpd/ntpsnmpd.1@1.122.30.1 +2 -2
+ libopts upgrade
+
+ util/ntp-keygen-opts.c@1.247.29.1 +5 -5
+ libopts upgrade
+
+ util/ntp-keygen-opts.h@1.247.29.1 +13 -4
+ libopts upgrade
+
+ util/ntp-keygen-opts.texi@1.246.29.1 +45 -2
+ libopts upgrade
+
+ util/ntp-keygen.1@1.246.29.1 +2 -2
+ libopts upgrade
+
+ChangeSet@1.2082.4.178, 2010-12-16 23:57:51+00:00, davehart@shiny.ad.hartbrothers.com
+ first verbose --version attempt caused --help to segfault.
+
+ libntp/ntp_libopts.c@1.3 +7 -6
+ first verbose --version attempt caused --help to segfault.
+
+ChangeSet@1.2082.4.177, 2010-12-16 09:07:58+00:00, davehart@shiny.ad.hartbrothers.com
+ Upgrade to libopts 33.4.8 from AutoGen 5.11.6pre1.
+
+ ChangeLog@1.496.26.131 +1 -0
+ Upgrade to libopts 33.4.8 from AutoGen 5.11.6pre1.
+
+ sntp/libopts/Makefile.am@1.6 +5 -5
+ libopts 33.4.8
+
+ sntp/libopts/ag-char-map.h@1.9 +1 -1
+ libopts 33.4.8
+
+ sntp/libopts/autoopts.c@1.7 +5 -5
+ libopts 33.4.8
+
+ sntp/libopts/autoopts/options.h@1.8 +4 -4
+ libopts 33.4.8
+
+ sntp/libopts/autoopts/usage-txt.h@1.8 +1 -1
+ libopts 33.4.8
+
+ sntp/libopts/configfile.c@1.8 +4 -1
+ libopts 33.4.8
+
+ sntp/libopts/environment.c@1.8 +26 -20
+ libopts 33.4.8
+
+ sntp/libopts/genshell.c@1.9 +2 -2
+ libopts 33.4.8
+
+ sntp/libopts/genshell.h@1.9 +13 -4
+ libopts 33.4.8
+
+ sntp/libopts/load.c@1.7 +2 -2
+ libopts 33.4.8
+
+ sntp/libopts/m4/libopts.m4@1.10 +6 -6
+ libopts 33.4.8
+ plus local patch to fix single shared libopts between sntp subproj
+ and top-level
+
+ sntp/libopts/m4/liboptschk.m4@1.7 +20 -33
+ libopts 33.4.8
+
+ sntp/libopts/proto.h@1.9 +2 -2
+ libopts 33.4.8
+
+ sntp/libopts/value-type.h@1.9 +1 -1
+ libopts 33.4.8
+
+ sntp/libopts/xat-attribute.h@1.9 +1 -1
+ libopts 33.4.8
+
+ChangeSet@1.2082.4.176, 2010-12-16 06:16:02+00:00, davehart@shiny.ad.hartbrothers.com
+ #include <config.h> in new file libntp/ntp_libopts.c
+ add libopts includes to libntp INCLUDES = now that ntp_libopts.c
+ uses them.
+
+ ChangeLog@1.496.26.130 +1 -1
+ typo
+
+ libntp/Makefile.am@1.51.1.2 +3 -3
+ add libopts includes to libntp INCLUDES = now that ntp_libopts.c
+ uses them.
+
+ libntp/ntp_libopts.c@1.2 +4 -1
+ #include <config.h> in new file libntp/ntp_libopts.c
+
+ChangeSet@1.2082.4.175, 2010-12-16 04:42:37+00:00, davehart@shiny.ad.hartbrothers.com
+ * [Bug 1740] ntpdc treats many counters as signed. (backport)
+ * [Bug 1754] --version output should be more verbose.
+ * Suppress ntp-keygen OpenSSL version display for --help, --version,
+ display both build and runtime OpenSLL versions when they differ.
+
+ ChangeLog@1.496.26.129 +4 -0
+ * [Bug 1740] ntpdc treats many counters as signed. (backport)
+ * [Bug 1754] --version output should be more verbose.
+ * Suppress ntp-keygen OpenSSL version display for --help, --version,
+ display both build and runtime OpenSLL versions when they differ.
+
+
+ include/Makefile.am@1.38.1.1 +1 -0
+ add ntp_libopts.h
+
+ include/ntp_libopts.h@1.1 +13 -0
+ new wrapper ntpOptionProcess() makes --version output more verbose.
+
+ include/ntp_libopts.h@1.0 +0 -0
+
+ libntp/Makefile.am@1.51.1.1 +1 -0
+ add ntp_libopts.c
+
+ libntp/ntp_libopts.c@1.1 +50 -0
+ new wrapper ntpOptionProcess() makes --version output more verbose.
+
+ libntp/ntp_libopts.c@1.0 +0 -0
+
+ ntpd/ntp_scanner.c@1.31.1.3 +2 -2
+ suppress gcc4 warning about signed overflow by using
+ unsigned counter and index
+
+ ntpd/ntpd.c@1.110.2.3 +2 -1
+ [Bug 1754] --version output should be more verbose.
+
+ ntpdc/ntpdc.c@1.75.1.4 +2 -1
+ [Bug 1754] --version output should be more verbose.
+
+ ntpdc/ntpdc_ops.c@1.62.1.3 +191 -197
+ [Bug 1740] ntpdc treats many counters as signed. (backport)
+
+ ntpq/ntpq.c@1.97.1.8 +2 -1
+ [Bug 1754] --version output should be more verbose.
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.11 +4 -0
+ add libntp/ntp_libopts.c reference
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.20.1.2 +2 -2
+ correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen
+
+ ports/winnt/vs2003/libntp.vcproj@1.4.1.5 +3 -0
+ add libntp/ntp_libopts.c reference
+
+ ports/winnt/vs2003/ntpkeygen.vcproj@1.3.1.2 +2 -2
+ correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen
+
+ ports/winnt/vs2005/libntp.vcproj@1.4.1.5 +4 -0
+ add libntp/ntp_libopts.c reference
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.3.1.2 +2 -2
+ correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20.3.1 +8 -0
+ add libntp/ntp_libopts.c reference
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.9.2.1 +2 -68
+ correct ntp-keygen Version string to mention ntp-keygen not ntpkeygen
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.21.2.1 +4 -0
+ add include/ntp_libopts.h reference
+
+ util/Makefile.am@1.45.1.5 +9 -1
+ Generate, use version.c for verbose --version output
+
+ util/ntp-keygen.c@1.64.1.2 +13 -2
+ [Bug 1754] --version output should be more verbose.
+
+ChangeSet@1.2082.4.174, 2010-12-15 20:23:17+00:00, davehart@shiny.ad.hartbrothers.com
+ Use LIBS not LDFLAGS for configure tests of -lcrypto, -lcrypto -lz
+
+ m4/ntp_openssl.m4@1.4.1.4 +6 -6
+ Use LIBS not LDFLAGS for configure tests of -lcrypto, -lcrypto -lz
+
+ChangeSet@1.2338, 2010-12-15 19:01:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1753] 4.2.7p94 faults on startup in newpeer(), strdup(NULL).
+
+ ChangeLog@1.696 +1 -0
+ [Bug 1753] 4.2.7p94 faults on startup in newpeer(), strdup(NULL).
+
+ ntpd/ntp_peer.c@1.142 +2 -1
+ [Bug 1753] 4.2.7p94 faults on startup in newpeer(), strdup(NULL).
+
+ChangeSet@1.2337, 2010-12-15 10:12:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P94
+ TAG: NTP_4_2_7P94
+
+ ChangeLog@1.695 +1 -0
+ NTP_4_2_7P94
+
+ clockstuff/clktest-opts.c@1.18 +2 -2
+ NTP_4_2_7P94
+
+ clockstuff/clktest-opts.h@1.18 +3 -3
+ NTP_4_2_7P94
+
+ ntpd/ntpd-opts.c@1.98 +2 -2
+ NTP_4_2_7P94
+
+ ntpd/ntpd-opts.h@1.98 +3 -3
+ NTP_4_2_7P94
+
+ ntpd/ntpd-opts.texi@1.96 +2 -2
+ NTP_4_2_7P94
+
+ ntpd/ntpd.1@1.96 +2 -2
+ NTP_4_2_7P94
+
+ ntpdc/ntpdc-opts.c@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpdc/ntpdc-opts.h@1.95 +3 -3
+ NTP_4_2_7P94
+
+ ntpdc/ntpdc-opts.texi@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpdc/ntpdc.1@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpq/ntpq-opts.c@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpq/ntpq-opts.h@1.95 +3 -3
+ NTP_4_2_7P94
+
+ ntpq/ntpq-opts.texi@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpq/ntpq.1@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.95 +3 -3
+ NTP_4_2_7P94
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.95 +2 -2
+ NTP_4_2_7P94
+
+ ntpsnmpd/ntpsnmpd.1@1.95 +2 -2
+ NTP_4_2_7P94
+
+ packageinfo.sh@1.96 +1 -1
+ NTP_4_2_7P94
+
+ sntp/sntp-opts.c@1.95 +2 -2
+ NTP_4_2_7P94
+
+ sntp/sntp-opts.h@1.95 +3 -3
+ NTP_4_2_7P94
+
+ sntp/sntp-opts.texi@1.95 +2 -2
+ NTP_4_2_7P94
+
+ sntp/sntp.1@1.95 +2 -2
+ NTP_4_2_7P94
+
+ sntp/sntp.html@1.95 +4 -7
+ NTP_4_2_7P94
+
+ util/ntp-keygen-opts.c@1.93 +2 -2
+ NTP_4_2_7P94
+
+ util/ntp-keygen-opts.h@1.93 +3 -3
+ NTP_4_2_7P94
+
+ util/ntp-keygen-opts.texi@1.96 +2 -2
+ NTP_4_2_7P94
+
+ util/ntp-keygen.1@1.96 +2 -2
+ NTP_4_2_7P94
+
+ChangeSet@1.2082.4.173, 2010-12-15 08:27:35+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1618] Unreachable code in jjy_start(). (backport from ntp-dev)
+ (applies to -stable changes previously pulled to -dev only)
+ [Bug 1719] ntp-keygen -V crash. (backport)
+
+ ChangeLog@1.496.26.128 +2 -0
+ [Bug 1618] Unreachable code in jjy_start(). (backport from ntp-dev)
+ [Bug 1719] ntp-keygen -V crash. (backport)
+
+ util/ntp-keygen.c@1.64.1.1 +0 -1
+ [Bug 1719] ntp-keygen -V crash. (backport)
+
+ChangeSet@1.2329.1.1, 2010-12-15 01:49:59-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills.
+
+ ChangeLog@1.691.1.1 +1 -0
+ Documentation updates from Dave Mills.
+
+ html/authopt.html@1.67 +13 -10
+ Documentation updates from Dave Mills.
+
+ html/autokey.html@1.11 +49 -62
+ Documentation updates from Dave Mills.
+
+ html/copyright.html@1.53 +61 -82
+ Documentation updates from Dave Mills.
+
+ html/drivers/driver8.html@1.26 +244 -278
+ Documentation updates from Dave Mills.
+
+ html/keygen.html@1.26 +9 -10
+ Documentation updates from Dave Mills.
+
+ChangeSet@1.2082.40.22, 2010-12-15 01:23:25+00:00, davehart@shiny.ad.hartbrothers.com
+ get along better with OpenSSL 1.0.0c headers by including
+ evp.h instead of rand.h in ssl_init.c and configure.ac tests.
+
+ libntp/ssl_init.c@1.4.1.3 +1 -1
+ get along better with OpenSSL 1.0.0c headers by including
+ evp.h instead of rand.h in ssl_init.c and configure.ac tests.
+
+ m4/ntp_openssl.m4@1.4.1.3 +2 -2
+ get along better with OpenSSL 1.0.0c headers by including
+ evp.h instead of rand.h in ssl_init.c and configure.ac tests.
+
+ChangeSet@1.2333, 2010-12-15 00:14:11+00:00, davehart@shiny.ad.hartbrothers.com
+ quiet gcc4 warnings
+ alloc/free peer group identity member
+
+ ntpd/ntp_control.c@1.146 +0 -1
+ remove unused local 'pkid' from ctl_error()
+
+ ntpd/ntp_io.c@1.334 +2 -1
+ use unsigned type for select_count to silence gcc signed
+ overflow warning.
+
+ ntpd/ntp_peer.c@1.141 +4 -1
+ make copy of group identity in newpeer()
+
+ ntpd/refclock_jjy.c@1.20 +15 -10
+ quiet gcc4 signed overflow warnings with unsigned use.
+
+ ntpd/refclock_mx4200.c@1.27 +1 -1
+ eliminate int compared to pointer warning
+
+ sntp/tests/packetHandling.cpp@1.6 +2 -2
+ suppress gcc4 warning of negative left shift count from use
+ of LOGTOD(), substitute ULOGTOD()
+
+ChangeSet@1.2082.40.21, 2010-12-14 20:49:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1751] correct -lcrypto -lz dependency test
+
+ m4/ntp_openssl.m4@1.4.1.2 +4 -0
+ [Bug 1751] correct -lcrypto -lz dependency test
+
+ChangeSet@1.2331, 2010-12-14 20:10:12+00:00, davehart@shiny.ad.hartbrothers.com
+ cleanup merge flub
+
+ ntpq/ntpq-subs.c@1.71 +4 -2
+ cleanup merge flub
+
+ChangeSet@1.2082.40.20, 2010-12-14 19:40:18+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1751] Support for Atari FreeMiNT OS.
+
+ ChangeLog@1.496.26.127 +1 -0
+ [Bug 1751] Support for Atari FreeMiNT OS.
+
+ configure.ac@1.465.1.23 +4 -1
+ [Bug 1751] Support for Atari FreeMiNT OS.
+
+ lib/isc/unix/net.c@1.15 +1 -1
+ [Bug 1751] Support for Atari FreeMiNT OS.
+
+ m4/ntp_openssl.m4@1.4.1.1 +52 -0
+ [Bug 1751] Atari FreeMiNT needs -lcrypto -lz for LCRYPTO
+
+ ntpd/ntp_config.c@1.241.1.8 +4 -5
+ attempt to silence gcc4 apparently bogus warning about simplifying
+ conditional "if (i)" to a constant.
+
+ ntpd/ntp_control.c@1.129.1.6 +3 -1
+ quiet gcc4 signed overflow warning
+
+ ntpd/ntp_refclock.c@1.92.1.2 +6 -32
+ quiet gcc4 signed overflow warning
+
+ ntpd/refclock_conf.c@1.28 +1 -1
+ [Bug 1751] Atari FreeMiNT termios.h doesn't have TIOCMSET
+
+ ntpd/refclock_palisade.c@1.31.1.2 +12 -6
+ [Bug 1751] Atari FreeMiNT termios.h doesn't have TIOCMSET
+
+ ntpdate/ntpdate.c@1.69.2.2 +32 -27
+ attempt to silence gcc4 signed wraparound/overflow warnings.
+
+ ntpdc/ntpdc.c@1.75.1.3 +35 -55
+ 4.2.6 requires ANSI C so qsort() signature is nailed down.
+
+ ntpdc/ntpdc_ops.c@1.62.1.2 +65 -67
+ Attempt to silence apparently bogus "simplifying conditional
+ to constant" warning from gcc4 re "if (res)"
+
+ ntpq/libntpq.c@1.3.1.5 +62 -73
+ use associd_t instead of int
+
+ ntpq/libntpq.h@1.3.1.3 +10 -12
+ use associd_t instead of int
+
+ ntpq/libntpq_subs.c@1.2.1.2 +4 -10
+ use associd_t instead of int
+
+ ntpq/ntpq-subs.c@1.39.2.5 +99 -88
+ use associd_t instead of int
+
+ ntpq/ntpq.c@1.97.1.7 +119 -174
+ use associd_t instead of int
+
+ ntpq/ntpq.h@1.10.1.4 +1 -1
+ use associd_t not int
+
+ sntp/main.c@1.24.1.9 +5 -4
+ toy with gcc4 apparently spurious "simplifying conditional to constant"
+ warning.
+
+ util/tickadj.c@1.9 +3 -1
+ [Bug 1751] Support for Atari FreeMiNT OS.
+
+ChangeSet@1.2329, 2010-12-13 08:28:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P93
+ TAG: NTP_4_2_7P93
+
+ ChangeLog@1.691 +1 -0
+ NTP_4_2_7P93
+
+ clockstuff/clktest-opts.c@1.17 +2 -2
+ NTP_4_2_7P93
+
+ clockstuff/clktest-opts.h@1.17 +3 -3
+ NTP_4_2_7P93
+
+ ntpd/ntpd-opts.c@1.97 +2 -2
+ NTP_4_2_7P93
+
+ ntpd/ntpd-opts.h@1.97 +3 -3
+ NTP_4_2_7P93
+
+ ntpd/ntpd-opts.texi@1.95 +2 -2
+ NTP_4_2_7P93
+
+ ntpd/ntpd.1@1.95 +2 -2
+ NTP_4_2_7P93
+
+ ntpdc/ntpdc-opts.c@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpdc/ntpdc-opts.h@1.94 +3 -3
+ NTP_4_2_7P93
+
+ ntpdc/ntpdc-opts.texi@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpdc/ntpdc.1@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpq/ntpq-opts.c@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpq/ntpq-opts.h@1.94 +3 -3
+ NTP_4_2_7P93
+
+ ntpq/ntpq-opts.texi@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpq/ntpq.1@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.94 +3 -3
+ NTP_4_2_7P93
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.94 +2 -2
+ NTP_4_2_7P93
+
+ ntpsnmpd/ntpsnmpd.1@1.94 +2 -2
+ NTP_4_2_7P93
+
+ packageinfo.sh@1.95 +1 -1
+ NTP_4_2_7P93
+
+ sntp/sntp-opts.c@1.94 +2 -2
+ NTP_4_2_7P93
+
+ sntp/sntp-opts.h@1.94 +3 -3
+ NTP_4_2_7P93
+
+ sntp/sntp-opts.texi@1.94 +2 -2
+ NTP_4_2_7P93
+
+ sntp/sntp.1@1.94 +2 -2
+ NTP_4_2_7P93
+
+ sntp/sntp.html@1.94 +2 -2
+ NTP_4_2_7P93
+
+ util/ntp-keygen-opts.c@1.92 +2 -2
+ NTP_4_2_7P93
+
+ util/ntp-keygen-opts.h@1.92 +3 -3
+ NTP_4_2_7P93
+
+ util/ntp-keygen-opts.texi@1.95 +2 -2
+ NTP_4_2_7P93
+
+ util/ntp-keygen.1@1.95 +2 -2
+ NTP_4_2_7P93
+
+ChangeSet@1.2328, 2010-12-13 01:55:38-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills.
+
+ html/autokey.html@1.10 +47 -48
+ Documentation updates from Dave Mills.
+
+ html/keygen.html@1.25 +2 -1
+ Documentation updates from Dave Mills.
+
+ChangeSet@1.2323.2.2, 2010-12-13 01:29:30-05:00, stenn@deacon.udel.edu
+ "server ... ident <groupname>" changes from Dave Mills
+
+ ChangeLog@1.687.1.2 +1 -0
+ "server ... ident <groupname>" changes from Dave Mills
+
+ include/ntp.h@1.188.1.1 +1 -0
+ "server ... ident <groupname>" changes from Dave Mills
+
+ include/ntp_control.h@1.47.1.1 +2 -1
+ "server ... ident <groupname>" changes from Dave Mills
+
+ include/ntpd.h@1.147.1.1 +1 -1
+ "server ... ident <groupname>" changes from Dave Mills
+
+ ntpd/ntp_control.c@1.141.1.1 +12 -2
+ "server ... ident <groupname>" changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.149 +7 -29
+ "server ... ident <groupname>" changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.138.1.1 +4 -2
+ "server ... ident <groupname>" changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.313 +4 -4
+ "server ... ident <groupname>" changes from Dave Mills
+
+ util/ntp-keygen.c@1.70 +7 -23
+ "server ... ident <groupname>" changes from Dave Mills
+
+ChangeSet@1.2323.2.1, 2010-12-13 01:16:09-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills.
+
+ ChangeLog@1.687.1.1 +1 -0
+ Documentation updates from Dave Mills.
+
+ html/autokey.html@1.9 +23 -3
+ Documentation updates from Dave Mills.
+
+ html/keygen.html@1.24 +39 -49
+ Documentation updates from Dave Mills.
+
+ html/miscopt.html@1.63 +3 -3
+ Documentation updates from Dave Mills.
+
+ChangeSet@1.2082.40.19, 2010-12-13 01:06:37-05:00, stenn@deacon.udel.edu
+ SNTP documentation cleanup
+
+ sntp/Makefile.am@1.21.1.13 +4 -0
+ SNTP documentation cleanup
+
+ sntp/sntp.html@1.7.29.1 +297 -11
+ SNTP documentation cleanup
+
+ sntp/sntp.texi@1.6 +2 -2
+ SNTP documentation cleanup
+
+ChangeSet@1.2323.1.3, 2010-12-12 08:30:28+00:00, davehart@shiny.ad.hartbrothers.com
+ Add test for socktoa(), sockporttoa() with scoped address.
+ Correct unit tests for sntp offset_calculation() arg change.
+
+ ntpd/ntp_control.c@1.143 +0 -2
+ Cleanup merge, remove redundant local maclen that triggered
+ shadow warning.
+
+ ntpd/ntpsim.c@1.30 +19 -17
+ correct ntpsim.c for peer_config group ident arg change.
+
+ sntp/tests/packetHandling.cpp@1.5 +4 -2
+ Correct unit tests for sntp offset_calculation() arg change.
+
+ sntp/tests/utilities.cpp@1.6 +3 -2
+ No stack garbage for scope ID, thanks.
+
+ tests/libntp/socktoa.cpp@1.2 +32 -5
+ Add test for socktoa(), sockporttoa() with scoped address.
+
+ChangeSet@1.2323.1.1, 2010-12-12 07:23:59+00:00, davehart@shiny.ad.hartbrothers.com
+ include non-zero scope in IPv6 stoa() output
+
+ libntp/socktoa.c@1.13 +24 -13
+ include non-zero scope in IPv6 stoa() output
+
+ChangeSet@1.2082.40.17, 2010-12-12 07:11:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1741] Enable multicast reception on each address (Windows).
+ Minimize local address flip-flopping by avoiding peer_refresh_allinterfaces()
+ if nothing has changed in the interface list since the last scan.
+ Separate handling of scope ID embedded in many in6_addr from ifindex used
+ for IPv6 multicasting ioctls.
+ Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses.
+ Enable outbound multicast from only one address per interface in the same
+ subnet, and in that case prefer embedded MAC address modified EUI-64 IPv6
+ addresses first, then static, and last RFC 4941 privacy addresses.
+ Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to select
+ the local source address, using the correct socket isn't enough.
+
+ ChangeLog@1.496.59.1 +12 -0
+ * [Bug 1741] Enable multicast reception on each address (Windows).
+ * Other manycastclient repairs:
+ Separate handling of scope ID embedded in many in6_addr from ifindex
+ used for IPv6 multicasting ioctls.
+ Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses.
+ Enable outbound multicast from only one address per interface in the
+ same subnet, and in that case prefer embedded MAC address modified
+ EUI-64 IPv6 addresses first, then static, and last RFC 4941 privacy
+ addresses.
+ Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to
+ select the local source address, using the correct socket is not
+ enough.
+
+
+ include/isc/mem.h@1.4 +9 -8
+ use macro-arg-protecting () only where helpful.
+
+ include/ntp.h@1.168.1.4 +3 -2
+ add INT_PRIVACY endpt.flags bit to indicate RFC 4941 privacy addresses
+
+ include/ntp_control.h@1.38.1.1 +1 -1
+ use offsetof instead of hard_coding CTL_HEADER_LEN
+
+ include/ntp_io.h@1.13.1.2 +4 -4
+ housekeeping (use #ifdef not #if for HAVE_*)
+
+ include/ntp_net.h@1.3.1.3 +4 -0
+ add IS_IID_UNIV() to test for universal scope interface identifier
+ to differentiate embedded-MAC modified EUI-64 from static and
+ privacy addresses.
+
+ include/ntp_stdlib.h@1.40.1.3 +2 -2
+ mark socktoa(), socktohost() args const
+
+ include/ntpd.h@1.137.2.3 +1 -1
+ whitespace only
+
+ lib/isc/include/isc/interfaceiter.h@1.8 +2 -0
+ add ifindex to struct isc_interface to manage need for index
+ distinct from sin6_scope_id for setsockopt IPV6_MULTICAST_IF
+ and IPV6_JOIN_GROUP.
+ add INTERFACE_F_PRIVACY flag set when the source of the IID
+ is RFC 4941 privacy addresses or another random scheme.
+
+ lib/isc/unix/ifiter_ioctl.c@1.29 +2 -6
+ set ifindex in libisc interface enumerator, and for link-local
+ addresses, use it as the scope ID (AKA zone).
+
+ lib/isc/unix/ifiter_sysctl.c@1.16 +1 -0
+ set ifindex in libisc interface enumerator
+
+ lib/isc/unix/interfaceiter.c@1.19 +3 -1
+ set ifindex in libisc interface enumerator
+
+ lib/isc/win32/include/isc/ipv6.h@1.10 +4 -4
+ Fix bugs in Windows libisc IN6_IS_ADDR_{LINK|SITE}LOCAL()
+
+ lib/isc/win32/interfaceiter.c@1.20 +29 -16
+ Add INTERFACE_F_PRIVACY detection, set new ifindex in isc_interface_t.
+ Skip deprecated addresses.
+ nonfunctional cleanup of [Bug 1738] changes.
+
+ libntp/socktoa.c@1.11.1.1 +1 -1
+ socktoa() input now const
+
+ libntp/socktohost.c@1.7.1.1 +1 -1
+ socktohost() input now const
+
+ ntpd/ntp_control.c@1.129.1.5 +0 -2
+ eliminate gcc4 warning in rendundant code by removing it.
+ authencrypt() jams the keyid into the packet structure.
+
+ ntpd/ntp_io.c@1.306.1.13 +357 -308
+ [Bug 1741] Enable multicast reception on each address (Windows).
+ Minimize local address flip-flopping by avoiding peer_refresh_allinterfaces()
+ if nothing has changed in the interface list since the last scan.
+ Separate handling of scope ID embedded in many in6_addr from ifindex used
+ for IPv6 multicasting ioctls.
+ Add INT_PRIVACY endpt bit flag for IPv6 RFC 4941 privacy addresses.
+ Enable outbound multicast from only one address per interface in the same
+ subnet, and in that case prefer embedded MAC address modified EUI-64 IPv6
+ addresses first, then static, and last RFC 4941 privacy addresses.
+ Use setsockopt(IP[V6]_MULTICAST_IF) before each send to multicast to select
+ the local source address, using the correct socket isn't enough.
+
+ ntpd/ntp_peer.c@1.126.1.2 +49 -50
+ cleanup
+
+ ntpd/ntp_request.c@1.82.1.4 +18 -16
+ scopeid member of endpt replaced with ifindex
+
+ ntpd/ntpd.c@1.110.2.2 +1 -1
+ typo in msyslog text "Attemping"
+
+ChangeSet@1.2082.41.5, 2010-12-10 12:52:28+01:00, burnicki@pogo.udel.edu
+ Updated changelog.
+
+ ChangeLog@1.496.26.125 +1 -0
+ Updated changelog.
+
+ChangeSet@1.2082.41.4, 2010-12-10 12:47:54+01:00, burnicki@pogo.udel.edu
+ [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud.
+
+ html/drivers/driver8.html@1.25 +12 -0
+ [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud.
+
+ ntpd/refclock_parse.c@1.52.1.1 +49 -0
+ [Bug 1510] Add modes 20/21 for driver 8 to support RAWDCF @ 75 baud.
+
+ChangeSet@1.2323, 2010-12-08 10:11:00+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P92
+ TAG: NTP_4_2_7P92
+
+ ChangeLog@1.687 +1 -0
+ NTP_4_2_7P92
+
+ clockstuff/clktest-opts.c@1.16 +2 -2
+ NTP_4_2_7P92
+
+ clockstuff/clktest-opts.h@1.16 +3 -3
+ NTP_4_2_7P92
+
+ ntpd/ntpd-opts.c@1.96 +2 -2
+ NTP_4_2_7P92
+
+ ntpd/ntpd-opts.h@1.96 +3 -3
+ NTP_4_2_7P92
+
+ ntpd/ntpd-opts.texi@1.94 +2 -2
+ NTP_4_2_7P92
+
+ ntpd/ntpd.1@1.94 +2 -2
+ NTP_4_2_7P92
+
+ ntpdc/ntpdc-opts.c@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpdc/ntpdc-opts.h@1.93 +3 -3
+ NTP_4_2_7P92
+
+ ntpdc/ntpdc-opts.texi@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpdc/ntpdc.1@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpq/ntpq-opts.c@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpq/ntpq-opts.h@1.93 +3 -3
+ NTP_4_2_7P92
+
+ ntpq/ntpq-opts.texi@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpq/ntpq.1@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.93 +3 -3
+ NTP_4_2_7P92
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.93 +2 -2
+ NTP_4_2_7P92
+
+ ntpsnmpd/ntpsnmpd.1@1.93 +2 -2
+ NTP_4_2_7P92
+
+ packageinfo.sh@1.94 +1 -1
+ NTP_4_2_7P92
+
+ sntp/sntp-opts.c@1.93 +3 -3
+ NTP_4_2_7P92
+
+ sntp/sntp-opts.h@1.93 +3 -3
+ NTP_4_2_7P92
+
+ sntp/sntp-opts.texi@1.93 +4 -3
+ NTP_4_2_7P92
+
+ sntp/sntp.1@1.93 +4 -2
+ NTP_4_2_7P92
+
+ sntp/sntp.html@1.93 +10 -9
+ NTP_4_2_7P92
+
+ util/ntp-keygen-opts.c@1.91 +2 -2
+ NTP_4_2_7P92
+
+ util/ntp-keygen-opts.h@1.91 +3 -3
+ NTP_4_2_7P92
+
+ util/ntp-keygen-opts.texi@1.94 +2 -2
+ NTP_4_2_7P92
+
+ util/ntp-keygen.1@1.94 +2 -2
+ NTP_4_2_7P92
+
+ChangeSet@1.2082.41.3, 2010-12-08 02:34:17-05:00, stenn@psp-deb1.ntp.org
+ [Bug 1743] Display timezone offset when showing time for sntp in the local timezone.
+
+ ChangeLog@1.496.26.124 +2 -0
+ [Bug 1743] Display timezone offset when showing time for sntp in the local timezone.
+
+ sntp/configure.ac@1.31.1.9 +1 -0
+ [Bug 1743] Display timezone offset when showing time for sntp in the local timezone.
+
+ sntp/main.c@1.24.1.8 +20 -2
+ [Bug 1743] Display timezone offset when showing time for sntp in the local timezone.
+
+ sntp/utilities.c@1.10.1.3 +40 -26
+ [Bug 1743] Display timezone offset when showing time for sntp in the local timezone.
+
+ sntp/utilities.h@1.9 +1 -1
+ [Bug 1743] Display timezone offset when showing time for sntp in the local timezone.
+
+ChangeSet@1.2082.41.2, 2010-12-08 02:28:13-05:00, stenn@deacon.udel.edu
+ Clean up the SNTP documentation
+
+ sntp/sntp-opts.def@1.18 +4 -0
+ Clean up the SNTP documentation
+
+ sntp/sntp.texi@1.5 +3 -3
+ Clean up the SNTP documentation
+
+ChangeSet@1.2321, 2010-12-07 10:11:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P91
+ TAG: NTP_4_2_7P91
+
+ ChangeLog@1.685 +1 -0
+ NTP_4_2_7P91
+
+ clockstuff/clktest-opts.c@1.15 +2 -2
+ NTP_4_2_7P91
+
+ clockstuff/clktest-opts.h@1.15 +3 -3
+ NTP_4_2_7P91
+
+ ntpd/ntpd-opts.c@1.95 +2 -2
+ NTP_4_2_7P91
+
+ ntpd/ntpd-opts.h@1.95 +3 -3
+ NTP_4_2_7P91
+
+ ntpd/ntpd-opts.texi@1.93 +2 -2
+ NTP_4_2_7P91
+
+ ntpd/ntpd.1@1.93 +2 -2
+ NTP_4_2_7P91
+
+ ntpdc/ntpdc-opts.c@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpdc/ntpdc-opts.h@1.92 +3 -3
+ NTP_4_2_7P91
+
+ ntpdc/ntpdc-opts.texi@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpdc/ntpdc.1@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpq/ntpq-opts.c@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpq/ntpq-opts.h@1.92 +3 -3
+ NTP_4_2_7P91
+
+ ntpq/ntpq-opts.texi@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpq/ntpq.1@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.92 +3 -3
+ NTP_4_2_7P91
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.92 +2 -2
+ NTP_4_2_7P91
+
+ ntpsnmpd/ntpsnmpd.1@1.92 +2 -2
+ NTP_4_2_7P91
+
+ packageinfo.sh@1.93 +1 -1
+ NTP_4_2_7P91
+
+ sntp/sntp-opts.c@1.92 +2 -2
+ NTP_4_2_7P91
+
+ sntp/sntp-opts.h@1.92 +3 -3
+ NTP_4_2_7P91
+
+ sntp/sntp-opts.texi@1.92 +2 -2
+ NTP_4_2_7P91
+
+ sntp/sntp.1@1.92 +2 -2
+ NTP_4_2_7P91
+
+ sntp/sntp.html@1.92 +2 -2
+ NTP_4_2_7P91
+
+ util/ntp-keygen-opts.c@1.90 +2 -2
+ NTP_4_2_7P91
+
+ util/ntp-keygen-opts.h@1.90 +3 -3
+ NTP_4_2_7P91
+
+ util/ntp-keygen-opts.texi@1.93 +2 -2
+ NTP_4_2_7P91
+
+ util/ntp-keygen.1@1.93 +2 -2
+ NTP_4_2_7P91
+
+ChangeSet@1.2319, 2010-12-07 08:42:46+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1732] ntpd ties up CPU on disconnected USB device.
+
+ ChangeLog@1.683 +1 -0
+ [Bug 1732] ntpd ties up CPU on disconnected USB device.
+
+ ntpd/ntp_io.c@1.332 +16 -9
+ Remove closed file descriptors from I/O loop select() set.
+
+ChangeSet@1.2082.41.1, 2010-12-07 03:37:36-05:00, stenn@deacon.udel.edu
+ [Bug 1742] Fix a typo in an error message in the "build" script
+
+ ChangeLog@1.496.26.123 +1 -0
+ [Bug 1742] Fix a typo in an error message in the "build" script
+
+ build@1.38 +1 -1
+ [Bug 1742] Fix a typo in an error message in the "build" script
+
+ChangeSet@1.2082.40.14, 2010-12-06 08:01:24+00:00, davehart@shiny.ad.hartbrothers.com
+ correct relatively harmless retrying GetAdaptersAddresses() on errors
+ other than ERROR_BUFFER_OVERFLOW.
+
+ lib/isc/win32/interfaceiter.c@1.19 +2 -2
+ correct relatively harmless retrying GetAdaptersAddresses() on errors
+ other than ERROR_BUFFER_OVERFLOW.
+
+ChangeSet@1.2317, 2010-12-06 07:49:43+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P90
+ TAG: NTP_4_2_7P90
+
+ ChangeLog@1.682 +1 -0
+ NTP_4_2_7P90
+
+ clockstuff/clktest-opts.c@1.14 +2 -2
+ NTP_4_2_7P90
+
+ clockstuff/clktest-opts.h@1.14 +3 -3
+ NTP_4_2_7P90
+
+ ntpd/ntpd-opts.c@1.94 +2 -2
+ NTP_4_2_7P90
+
+ ntpd/ntpd-opts.h@1.94 +3 -3
+ NTP_4_2_7P90
+
+ ntpd/ntpd-opts.texi@1.92 +2 -2
+ NTP_4_2_7P90
+
+ ntpd/ntpd.1@1.92 +2 -2
+ NTP_4_2_7P90
+
+ ntpdc/ntpdc-opts.c@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpdc/ntpdc-opts.h@1.91 +3 -3
+ NTP_4_2_7P90
+
+ ntpdc/ntpdc-opts.texi@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpdc/ntpdc.1@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpq/ntpq-opts.c@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpq/ntpq-opts.h@1.91 +3 -3
+ NTP_4_2_7P90
+
+ ntpq/ntpq-opts.texi@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpq/ntpq.1@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.91 +3 -3
+ NTP_4_2_7P90
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.91 +2 -2
+ NTP_4_2_7P90
+
+ ntpsnmpd/ntpsnmpd.1@1.91 +2 -2
+ NTP_4_2_7P90
+
+ packageinfo.sh@1.92 +1 -1
+ NTP_4_2_7P90
+
+ sntp/sntp-opts.c@1.91 +2 -2
+ NTP_4_2_7P90
+
+ sntp/sntp-opts.h@1.91 +3 -3
+ NTP_4_2_7P90
+
+ sntp/sntp-opts.texi@1.91 +2 -2
+ NTP_4_2_7P90
+
+ sntp/sntp.1@1.91 +2 -2
+ NTP_4_2_7P90
+
+ sntp/sntp.html@1.91 +2 -2
+ NTP_4_2_7P90
+
+ util/ntp-keygen-opts.c@1.89 +2 -2
+ NTP_4_2_7P90
+
+ util/ntp-keygen-opts.h@1.89 +3 -3
+ NTP_4_2_7P90
+
+ util/ntp-keygen-opts.texi@1.92 +2 -2
+ NTP_4_2_7P90
+
+ util/ntp-keygen.1@1.92 +2 -2
+ NTP_4_2_7P90
+
+ChangeSet@1.2316, 2010-12-06 05:04:53+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1740] ntpdc -c reslist packet count wrongly treated as signed.
+
+ ChangeLog@1.681 +1 -0
+ [Bug 1740] ntpdc -c reslist packet count wrongly treated as signed.
+
+ ntpdc/ntpdc_ops.c@1.68 +191 -197
+ [Bug 1740] ntpdc -c reslist packet count wrongly treated as signed.
+
+ChangeSet@1.2315, 2010-12-06 02:15:22+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1738] Windows ntpd has wrong net adapter name.
+ Applies to prior cset merged from ntp-stable-1738
+
+ ChangeLog@1.680 +1 -0
+ [Bug 1738] Windows ntpd has wrong net adapter name.
+
+ChangeSet@1.2082.40.13, 2010-12-06 02:14:03+00:00, davehart@shiny.ad.hartbrothers.com
+ Add GetAdaptersAddress()-based interface enumeration to libisc Windows code,
+ runtime linked on Windows XP SP1 and later only, which provides correct
+ interface name with each address.
+
+ include/isc/mem.h@1.3 +19 -7
+ Silence unreferenced warnings from Microsoft C compiler
+
+ lib/isc/inet_pton.c@1.5 +3 -3
+ Avoid C++ keyword "new" for variable name, silence Microsoft C
+ warning about truncation.
+
+ lib/isc/netaddr.c@1.9 +1 -1
+ Silence Microsoft C warning that const var 'zeros' should be initialized.
+
+ lib/isc/win32/include/isc/once.h@1.5 +1 -1
+ Use correct type for InterlockedExchange() target.
+
+ lib/isc/win32/interfaceiter.c@1.18 +264 -70
+ Add GetAdaptersAddress()-based interface enumeration, runtime linked on
+ Windows XP SP1 and later only, which provides correct interface name
+ with each address.
+
+ lib/isc/win32/net.c@1.15 +0 -1
+ Removed unused local, silencing warning.
+
+ lib/isc/win32/stdtime.c@1.2 +1 -1
+ Silence type conversion warning.
+
+ChangeSet@1.2313, 2010-12-04 20:54:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P89
+ TAG: NTP_4_2_7P89
+
+ ChangeLog@1.679 +1 -0
+ NTP_4_2_7P89
+
+ clockstuff/clktest-opts.c@1.13 +65 -62
+ NTP_4_2_7P89
+
+ clockstuff/clktest-opts.h@1.13 +23 -59
+ NTP_4_2_7P89
+
+ ntpd/ntpd-opts.c@1.93 +2 -2
+ NTP_4_2_7P89
+
+ ntpd/ntpd-opts.h@1.93 +3 -3
+ NTP_4_2_7P89
+
+ ntpd/ntpd-opts.texi@1.91 +2 -2
+ NTP_4_2_7P89
+
+ ntpd/ntpd.1@1.91 +2 -2
+ NTP_4_2_7P89
+
+ ntpdc/ntpdc-opts.c@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpdc/ntpdc-opts.h@1.90 +3 -3
+ NTP_4_2_7P89
+
+ ntpdc/ntpdc-opts.texi@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpdc/ntpdc.1@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpq/ntpq-opts.c@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpq/ntpq-opts.h@1.90 +3 -3
+ NTP_4_2_7P89
+
+ ntpq/ntpq-opts.texi@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpq/ntpq.1@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.90 +3 -3
+ NTP_4_2_7P89
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.90 +2 -2
+ NTP_4_2_7P89
+
+ ntpsnmpd/ntpsnmpd.1@1.90 +2 -2
+ NTP_4_2_7P89
+
+ packageinfo.sh@1.91 +1 -1
+ NTP_4_2_7P89
+
+ sntp/sntp-opts.c@1.90 +8 -14
+ NTP_4_2_7P89
+
+ sntp/sntp-opts.h@1.90 +3 -3
+ NTP_4_2_7P89
+
+ sntp/sntp-opts.texi@1.90 +38 -31
+ NTP_4_2_7P89
+
+ sntp/sntp.1@1.90 +6 -6
+ NTP_4_2_7P89
+
+ sntp/sntp.html@1.90 +356 -5
+ NTP_4_2_7P89
+
+ util/ntp-keygen-opts.c@1.88 +2 -2
+ NTP_4_2_7P89
+
+ util/ntp-keygen-opts.h@1.88 +3 -3
+ NTP_4_2_7P89
+
+ util/ntp-keygen-opts.texi@1.91 +2 -2
+ NTP_4_2_7P89
+
+ util/ntp-keygen.1@1.91 +2 -2
+ NTP_4_2_7P89
+
+ChangeSet@1.2312, 2010-12-04 15:54:37-05:00, stenn@deacon.udel.edu
+ Add clktest-opts.[ch] to .point-changed-filelist
+
+ .point-changed-filelist@1.8 +2 -0
+ Add clktest-opts.[ch] to .point-changed-filelist
+
+ChangeSet@1.2082.40.12, 2010-12-04 05:32:55-05:00, stenn@deacon.udel.edu
+ Clean up the SNTP documentation
+
+ ChangeLog@1.496.26.122 +1 -0
+ Clean up the SNTP documentation
+
+ sntp/sntp-opts.def@1.17 +49 -27
+ Clean up the SNTP documentation
+
+ sntp/sntp.texi@1.4 +2 -2
+ Clean up the SNTP documentation
+
+ChangeSet@1.2309, 2010-12-04 08:15:35+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1736] tos int, bool options broken in 4.2.7p66.
+
+ ChangeLog@1.675.1.1 +2 -1
+ [Bug 1736] tos int, bool options broken in 4.2.7p66.
+
+ clockstuff/Makefile.am@1.13 +2 -1
+ repair distcheck
+
+ ntpd/ntp_config.c@1.277 +3 -8
+ [Bug 1736] tos int, bool options broken in 4.2.7p66.
+
+ ntpd/ntp_parser.c@1.73 +2 -2
+ bison output
+
+ ntpd/ntp_parser.y@1.67 +2 -2
+ [Bug 1736] tos int, bool options broken in 4.2.7p66.
+
+ChangeSet@1.2308, 2010-12-04 07:42:26+00:00, davehart@shiny.ad.hartbrothers.com
+ centralize TTY header goop in ntp_tty.h.
+ move clockstuff utils closer to building cleanly.
+
+ clockstuff/Makefile.am@1.12 +2 -2
+ revive, repair bitrot
+
+ clockstuff/clktest-opts.def@1.8 +0 -32
+ remove hard-coded relative paths from #includes
+
+ clockstuff/clktest.c@1.5 +34 -0
+ include config.h
+
+ include/ntp_machine.h@1.30 +0 -35
+ move tty logic from ntp_machine.h to ntp_tty.h, include the latter
+ from ntp_refclock.h
+
+ include/ntp_refclock.h@1.26 +2 -32
+ move tty logic from ntp_machine.h to ntp_tty.h, include the latter
+ from ntp_refclock.h
+
+ include/ntp_tty.h@1.4 +57 -11
+ move tty logic from ntp_machine.h to ntp_tty.h, include the latter
+ from ntp_refclock.h
+
+ libntp/icom.c@1.13 +4 -4
+ use snprintf()
+
+ ntpd/refclock_datum.c@1.15 +1 -11
+ #include ntp_tty.h for TTY includes
+
+ChangeSet@1.2304.1.3, 2010-12-02 10:10:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P88
+ TAG: NTP_4_2_7P88
+
+ ChangeLog@1.676 +1 -0
+ NTP_4_2_7P88
+
+ ntpd/ntpd-opts.c@1.92 +2 -2
+ NTP_4_2_7P88
+
+ ntpd/ntpd-opts.h@1.92 +3 -3
+ NTP_4_2_7P88
+
+ ntpd/ntpd-opts.texi@1.90 +2 -2
+ NTP_4_2_7P88
+
+ ntpd/ntpd.1@1.90 +2 -2
+ NTP_4_2_7P88
+
+ ntpdc/ntpdc-opts.c@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpdc/ntpdc-opts.h@1.89 +3 -3
+ NTP_4_2_7P88
+
+ ntpdc/ntpdc-opts.texi@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpdc/ntpdc.1@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpq/ntpq-opts.c@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpq/ntpq-opts.h@1.89 +3 -3
+ NTP_4_2_7P88
+
+ ntpq/ntpq-opts.texi@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpq/ntpq.1@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.89 +3 -3
+ NTP_4_2_7P88
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.89 +2 -2
+ NTP_4_2_7P88
+
+ ntpsnmpd/ntpsnmpd.1@1.89 +2 -2
+ NTP_4_2_7P88
+
+ packageinfo.sh@1.90 +1 -1
+ NTP_4_2_7P88
+
+ sntp/sntp-opts.c@1.89 +2 -2
+ NTP_4_2_7P88
+
+ sntp/sntp-opts.h@1.89 +3 -3
+ NTP_4_2_7P88
+
+ sntp/sntp-opts.texi@1.89 +2 -2
+ NTP_4_2_7P88
+
+ sntp/sntp.1@1.89 +2 -2
+ NTP_4_2_7P88
+
+ sntp/sntp.html@1.89 +1 -1
+ NTP_4_2_7P88
+
+ util/ntp-keygen-opts.c@1.87 +2 -2
+ NTP_4_2_7P88
+
+ util/ntp-keygen-opts.h@1.87 +3 -3
+ NTP_4_2_7P88
+
+ util/ntp-keygen-opts.texi@1.90 +2 -2
+ NTP_4_2_7P88
+
+ util/ntp-keygen.1@1.90 +2 -2
+ NTP_4_2_7P88
+
+ChangeSet@1.2304.1.2, 2010-12-01 23:05:13+01:00, jnperlin@hydra.localnet
+ [Bug 1735] clocktime() aborts ntpd on bogus input: changed to regular error indication
+
+ ChangeLog@1.675 +1 -0
+ [Bug 1735] clocktime() aborts ntpd on bogus input: changed to regular error indication
+
+ libntp/clocktime.c@1.5 +8 -7
+ [Bug 1735] clocktime() aborts ntpd on bogus input: changed to regular error indication
+
+ChangeSet@1.2304.1.1, 2010-12-01 10:10:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P87
+ TAG: NTP_4_2_7P87
+
+ ChangeLog@1.674 +1 -0
+ NTP_4_2_7P87
+
+ ntpd/ntpd-opts.c@1.91 +2 -2
+ NTP_4_2_7P87
+
+ ntpd/ntpd-opts.h@1.91 +3 -3
+ NTP_4_2_7P87
+
+ ntpd/ntpd-opts.texi@1.89 +2 -2
+ NTP_4_2_7P87
+
+ ntpd/ntpd.1@1.89 +2 -2
+ NTP_4_2_7P87
+
+ ntpdc/ntpdc-opts.c@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpdc/ntpdc-opts.h@1.88 +3 -3
+ NTP_4_2_7P87
+
+ ntpdc/ntpdc-opts.texi@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpdc/ntpdc.1@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpq/ntpq-opts.c@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpq/ntpq-opts.h@1.88 +3 -3
+ NTP_4_2_7P87
+
+ ntpq/ntpq-opts.texi@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpq/ntpq.1@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.88 +3 -3
+ NTP_4_2_7P87
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.88 +2 -2
+ NTP_4_2_7P87
+
+ ntpsnmpd/ntpsnmpd.1@1.88 +2 -2
+ NTP_4_2_7P87
+
+ packageinfo.sh@1.89 +1 -1
+ NTP_4_2_7P87
+
+ sntp/sntp-opts.c@1.88 +2 -2
+ NTP_4_2_7P87
+
+ sntp/sntp-opts.h@1.88 +3 -3
+ NTP_4_2_7P87
+
+ sntp/sntp-opts.texi@1.88 +2 -2
+ NTP_4_2_7P87
+
+ sntp/sntp.1@1.88 +2 -2
+ NTP_4_2_7P87
+
+ sntp/sntp.html@1.88 +1 -1
+ NTP_4_2_7P87
+
+ util/ntp-keygen-opts.c@1.86 +2 -2
+ NTP_4_2_7P87
+
+ util/ntp-keygen-opts.h@1.86 +3 -3
+ NTP_4_2_7P87
+
+ util/ntp-keygen-opts.texi@1.89 +2 -2
+ NTP_4_2_7P87
+
+ util/ntp-keygen.1@1.89 +2 -2
+ NTP_4_2_7P87
+
+ChangeSet@1.2306, 2010-12-01 07:48:54+00:00, davehart@shiny.ad.hartbrothers.com
+ restore HP-UX net/if.h workaround to sntp subproj, needed by ntp.h
+ inclusion leading to isc/net.h and then net/if.h.
+
+ clockstuff/chutest.c@1.4 +18 -7
+ clean up bitrot in clockstuff
+
+ sntp/configure.ac@1.48 +71 -0
+ restore HP-UX net/if.h workaround to sntp subproj, needed by ntp.h
+ inclusion leading to isc/net.h and then net/if.h.
+
+ChangeSet@1.2305, 2010-12-01 04:50:51+00:00, davehart@shiny.ad.hartbrothers.com
+ Refine HP-UX mpinfou workaround to add predeclaration only if it helps.
+ Remove unused u_int8_t and u_int64_t tests.
+ Remove qsort type check, ANSI C nails it down.
+ Remove AC_C_CONST for similar reason.
+ Enable propdelay, chutest, clktest builds.
+
+ clockstuff/Makefile.am@1.11 +29 -13
+ revive, repair bitrot
+
+ clockstuff/chutest.c@1.3 +31 -24
+ include config.h
+
+ clockstuff/clktest.c@1.4 +3 -0
+ include config.h
+
+ clockstuff/propdelay.c@1.5 +3 -0
+ include config.h
+
+ configure.ac@1.503 +175 -197
+ Refine HP-UX mpinfou workaround to add predeclaration only if it helps.
+ Remove unused u_int8_t and u_int64_t tests.
+ Remove qsort type check, ANSI C nails it down.
+ Remove AC_C_CONST for similar reason.
+ Enable propdelay, chutest, clktest builds.
+
+ m4/ntp_openssl.m4@1.5 +1 -1
+ unset temp var
+
+ sntp/configure.ac@1.47 +2 -48
+ Remove HP-UX net/if.h workaround from sntp/configure.ac, no sntp code
+ uses net/if.h.
+
+ util/Makefile.am@1.51 +1 -2
+ remove archaic ansi2knr reference
+
+ChangeSet@1.2082.40.11, 2010-11-30 06:45:17+00:00, davehart@shiny.ad.hartbrothers.com
+ cleanup last changeset
+
+ configure.ac@1.465.1.22 +2 -1
+ AS_UNSET() works on only one variable, not a list
+
+ m4/ntp_cacheversion.m4@1.10 +3 -1
+ AS_UNSET() works on only one variable, not a list
+
+ m4/ntp_lineeditlibs.m4@1.9 +4 -1
+ AS_UNSET() works on only one variable, not a list
+
+ sntp/configure.ac@1.31.1.8 +2 -1
+ AS_UNSET() works on only one variable, not a list
+
+ChangeSet@1.2082.40.10, 2010-11-30 05:12:51+00:00, davehart@shiny.ad.hartbrothers.com
+ Clean up m4 quoting in configure.ac, *.m4 files, resolving
+ intermittent AC_LANG_PROGRAM possibly undefined errors.
+
+ ChangeLog@1.496.26.121 +5 -0
+ Clean up m4 quoting in configure.ac, *.m4 files, resolving
+ intermittent AC_LANG_PROGRAM possibly undefined errors.
+
+ configure.ac@1.465.1.21 +3076 -2291
+ M4 quoting cleanup
+
+ m4/define_dir.m4@1.2 +4 -4
+ M4 quoting cleanup
+
+ m4/ntp_cacheversion.m4@1.9 +4 -8
+ use AS_UNSET() equivalent consistently
+
+ m4/ntp_dir_sep.m4@1.3 +19 -13
+ m4 quoting cleanup
+
+ m4/ntp_lib_m.m4@1.2 +2 -1
+ m4 quoting cleannup
+ use AS_UNSET, m4/os_cflags has for a while without complaint.
+
+ m4/ntp_lineeditlibs.m4@1.8 +23 -16
+ m4 quoting cleannup
+ use AS_UNSET, m4/os_cflags has for a while without complaint.
+
+ m4/ntp_openssl.m4@1.4 +76 -39
+ m4 quoting cleannup
+
+ m4/ntp_vpathhack.m4@1.2.1.1 +1 -1
+ m4 quoting cleannup
+
+ sntp/configure.ac@1.31.1.7 +364 -298
+ M4 quoting cleanup, fix for 'possibly undefined AC_LANG_PROGRAM' seen
+ with bootstrap --force, triggered by errant getsockname() socklen type
+ check.
+
+ChangeSet@1.2302, 2010-11-29 09:19:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P86
+ TAG: NTP_4_2_7P86
+
+ ChangeLog@1.672 +1 -0
+ NTP_4_2_7P86
+
+ ntpd/ntpd-opts.c@1.90 +2 -2
+ NTP_4_2_7P86
+
+ ntpd/ntpd-opts.h@1.90 +3 -3
+ NTP_4_2_7P86
+
+ ntpd/ntpd-opts.texi@1.88 +2 -2
+ NTP_4_2_7P86
+
+ ntpd/ntpd.1@1.88 +2 -2
+ NTP_4_2_7P86
+
+ ntpdc/ntpdc-opts.c@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpdc/ntpdc-opts.h@1.87 +3 -3
+ NTP_4_2_7P86
+
+ ntpdc/ntpdc-opts.texi@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpdc/ntpdc.1@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpq/ntpq-opts.c@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpq/ntpq-opts.h@1.87 +3 -3
+ NTP_4_2_7P86
+
+ ntpq/ntpq-opts.texi@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpq/ntpq.1@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.87 +3 -3
+ NTP_4_2_7P86
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.87 +2 -2
+ NTP_4_2_7P86
+
+ ntpsnmpd/ntpsnmpd.1@1.87 +2 -2
+ NTP_4_2_7P86
+
+ packageinfo.sh@1.88 +1 -1
+ NTP_4_2_7P86
+
+ sntp/sntp-opts.c@1.87 +2 -2
+ NTP_4_2_7P86
+
+ sntp/sntp-opts.h@1.87 +3 -3
+ NTP_4_2_7P86
+
+ sntp/sntp-opts.texi@1.87 +2 -2
+ NTP_4_2_7P86
+
+ sntp/sntp.1@1.87 +2 -2
+ NTP_4_2_7P86
+
+ sntp/sntp.html@1.87 +1 -1
+ NTP_4_2_7P86
+
+ util/ntp-keygen-opts.c@1.85 +2 -2
+ NTP_4_2_7P86
+
+ util/ntp-keygen-opts.h@1.85 +3 -3
+ NTP_4_2_7P86
+
+ util/ntp-keygen-opts.texi@1.88 +2 -2
+ NTP_4_2_7P86
+
+ util/ntp-keygen.1@1.88 +2 -2
+ NTP_4_2_7P86
+
+ChangeSet@1.2301, 2010-11-28 19:24:29+00:00, davehart@shiny.ad.hartbrothers.com
+ implement configuration of association option ident specifying
+ the autokey group. Implementation not yet complete.
+
+ include/ntp_config.h@1.70 +1 -0
+ add group member to peer_node for ident option
+
+ include/ntpd.h@1.147 +1 -1
+ change previously unused last arg to peer_config() to group
+ for ident option.
+
+ ntpd/complete.conf@1.13 +1 -1
+ add peer ... ident test case
+
+ ntpd/ntp_config.c@1.276 +24 -19
+ add group member to peer_resolved_ctx, with group name from
+ ident option.
+
+ ntpd/ntp_parser.c@1.72 +691 -689
+ bison output
+
+ ntpd/ntp_parser.y@1.66 +12 -0
+ add ident option to association directives specifying Autokey group
+
+ ntpd/ntp_peer.c@1.138 +11 -11
+ change previously unused last arg to peer_config() to group
+ for ident option.
+
+ChangeSet@1.2082.40.9, 2010-11-28 01:03:45-05:00, stenn@deacon.udel.edu
+ Use A.host build directory names at ntp.org
+
+ build@1.37 +5 -1
+ Use A.host build directory names at ntp.org
+
+ChangeSet@1.2082.40.8, 2010-11-28 04:53:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC11
+ TAG: NTP_4_2_6P3_RC11
+
+ ChangeLog@1.496.26.120 +1 -0
+ NTP_4_2_6P3_RC11
+
+ ntpd/ntpd-opts.c@1.248.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ ntpd/ntpd-opts.h@1.248.28.1 +3 -3
+ NTP_4_2_6P3_RC11
+
+ ntpd/ntpd-opts.menu@1.3.1.1 +1 -122
+ NTP_4_2_6P3_RC11
+
+ ntpd/ntpd-opts.texi@1.246.28.1 +522 -0
+ NTP_4_2_6P3_RC11
+
+ ntpd/ntpd.1@1.246.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ ntpdc/ntpdc-opts.c@1.244.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ ntpdc/ntpdc-opts.h@1.244.28.1 +3 -3
+ NTP_4_2_6P3_RC11
+
+ ntpdc/ntpdc-opts.menu@1.3.1.1 +1 -122
+ NTP_4_2_6P3_RC11
+
+ ntpdc/ntpdc-opts.texi@1.243.28.1 +207 -0
+ NTP_4_2_6P3_RC11
+
+ ntpdc/ntpdc.1@1.243.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ ntpq/ntpq-opts.c@1.245.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ ntpq/ntpq-opts.h@1.245.28.1 +3 -3
+ NTP_4_2_6P3_RC11
+
+ ntpq/ntpq-opts.menu@1.3.1.1 +1 -96
+ NTP_4_2_6P3_RC11
+
+ ntpq/ntpq-opts.texi@1.244.28.1 +177 -0
+ NTP_4_2_6P3_RC11
+
+ ntpq/ntpq.1@1.244.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.29.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.29.1 +3 -3
+ NTP_4_2_6P3_RC11
+
+ ntpsnmpd/ntpsnmpd-opts.menu@1.3.1.1 +1 -56
+ NTP_4_2_6P3_RC11
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.29.1 +55 -0
+ NTP_4_2_6P3_RC11
+
+ ntpsnmpd/ntpsnmpd.1@1.122.29.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ packageinfo.sh@1.255.29.1 +1 -1
+ NTP_4_2_6P3_RC11
+
+ sntp/sntp-opts.c@1.117.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ sntp/sntp-opts.h@1.117.28.1 +3 -3
+ NTP_4_2_6P3_RC11
+
+ sntp/sntp-opts.menu@1.3.1.1 +1 -56
+ NTP_4_2_6P3_RC11
+
+ sntp/sntp-opts.texi@1.117.28.1 +213 -0
+ NTP_4_2_6P3_RC11
+
+ sntp/sntp.1@1.117.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ sntp/sntp.html@1.7.28.1 +6 -62
+ NTP_4_2_6P3_RC11
+
+ util/ntp-keygen-opts.c@1.247.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ util/ntp-keygen-opts.h@1.247.28.1 +3 -3
+ NTP_4_2_6P3_RC11
+
+ util/ntp-keygen-opts.menu@1.3.1.1 +1 -94
+ NTP_4_2_6P3_RC11
+
+ util/ntp-keygen-opts.texi@1.246.28.1 +314 -0
+ NTP_4_2_6P3_RC11
+
+ util/ntp-keygen.1@1.246.28.1 +2 -2
+ NTP_4_2_6P3_RC11
+
+ChangeSet@1.2082.40.7, 2010-11-27 23:10:00-05:00, stenn@deacon.udel.edu
+ Improvements to the 'build' script
+
+ ChangeLog@1.496.26.119 +1 -0
+ Improvements to the 'build' script
+
+ build@1.36 +60 -18
+ Improvements to the 'build' script
+
+ChangeSet@1.2299, 2010-11-27 17:56:17-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.670 +1 -0
+ Documentation updates from Dave Mills
+
+ html/pic/sx5.gif@1.1 +456 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/sx5.gif
+
+ html/pic/sx5.gif@1.0 +0 -0
+
+ChangeSet@1.2298, 2010-11-27 22:30:13+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P85
+ TAG: NTP_4_2_7P85
+
+ ChangeLog@1.669 +1 -0
+ NTP_4_2_7P85
+
+ ntpd/ntpd-opts.c@1.89 +2 -2
+ NTP_4_2_7P85
+
+ ntpd/ntpd-opts.h@1.89 +3 -3
+ NTP_4_2_7P85
+
+ ntpd/ntpd-opts.menu@1.5 +1 -64
+ NTP_4_2_7P85
+
+ ntpd/ntpd-opts.texi@1.87 +642 -0
+ NTP_4_2_7P85
+
+ ntpd/ntpd.1@1.87 +2 -2
+ NTP_4_2_7P85
+
+ ntpdc/ntpdc-opts.c@1.86 +2 -2
+ NTP_4_2_7P85
+
+ ntpdc/ntpdc-opts.h@1.86 +3 -3
+ NTP_4_2_7P85
+
+ ntpdc/ntpdc-opts.menu@1.5 +1 -58
+ NTP_4_2_7P85
+
+ ntpdc/ntpdc-opts.texi@1.86 +271 -0
+ NTP_4_2_7P85
+
+ ntpdc/ntpdc.1@1.86 +2 -2
+ NTP_4_2_7P85
+
+ ntpq/ntpq-opts.c@1.86 +2 -2
+ NTP_4_2_7P85
+
+ ntpq/ntpq-opts.h@1.86 +3 -3
+ NTP_4_2_7P85
+
+ ntpq/ntpq-opts.menu@1.5 +1 -47
+ NTP_4_2_7P85
+
+ ntpq/ntpq-opts.texi@1.86 +226 -0
+ NTP_4_2_7P85
+
+ ntpq/ntpq.1@1.86 +2 -2
+ NTP_4_2_7P85
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.86 +2 -2
+ NTP_4_2_7P85
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.86 +3 -3
+ NTP_4_2_7P85
+
+ ntpsnmpd/ntpsnmpd-opts.menu@1.5 +1 -34
+ NTP_4_2_7P85
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.86 +77 -0
+ NTP_4_2_7P85
+
+ ntpsnmpd/ntpsnmpd.1@1.86 +2 -2
+ NTP_4_2_7P85
+
+ packageinfo.sh@1.87 +1 -1
+ NTP_4_2_7P85
+
+ sntp/sntp-opts.c@1.86 +2 -2
+ NTP_4_2_7P85
+
+ sntp/sntp-opts.h@1.86 +3 -3
+ NTP_4_2_7P85
+
+ sntp/sntp-opts.menu@1.5 +1 -56
+ NTP_4_2_7P85
+
+ sntp/sntp-opts.texi@1.86 +271 -0
+ NTP_4_2_7P85
+
+ sntp/sntp.1@1.86 +2 -2
+ NTP_4_2_7P85
+
+ sntp/sntp.html@1.86 +6 -62
+ NTP_4_2_7P85
+
+ util/ntp-keygen-opts.c@1.84 +2 -2
+ NTP_4_2_7P85
+
+ util/ntp-keygen-opts.h@1.84 +3 -3
+ NTP_4_2_7P85
+
+ util/ntp-keygen-opts.menu@1.6 +1 -51
+ NTP_4_2_7P85
+
+ util/ntp-keygen-opts.texi@1.87 +374 -0
+ NTP_4_2_7P85
+
+ util/ntp-keygen.1@1.87 +2 -2
+ NTP_4_2_7P85
+
+ChangeSet@1.2297, 2010-11-24 05:32:32-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.668 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.8 +77 -69
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2082.40.6, 2010-11-24 04:13:50-05:00, stenn@deacon.udel.edu
+ Update the NEWS file to include work done in RC11
+
+ NEWS@1.113 +6 -1
+ Update the NEWS file to include work done in RC11
+
+ChangeSet@1.2082.40.5, 2010-11-24 04:00:30-05:00, stenn@deacon.udel.edu
+ [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog)
+
+ ChangeLog@1.496.26.118 +1 -0
+ [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog)
+
+ scripts/checkChangeLog@1.1.2.2 +2 -1
+ [Bug 1733] IRIX doesn't have 'head' (affects scripts/checkChangeLog)
+
+ChangeSet@1.2296, 2010-11-24 00:36:54+00:00, davehart@shiny.ad.hartbrothers.com
+ cleanup AC_LANG_PROGRAM quoting to silence autoreconf
+
+ configure.ac@1.500 +4 -4
+ cleanup AC_LANG_PROGRAM quoting to silence autoreconf
+
+ChangeSet@1.2082.40.4, 2010-11-23 14:58:05+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac m4 quoting cleanup
+ attempt to quiet expanded before required warnings from libopts
+
+ configure.ac@1.465.1.20 +8 -8
+ correct m4 quoting
+
+ sntp/configure.ac@1.31.1.6 +6 -6
+ configure.ac m4 quoting cleanup
+
+ sntp/libopts/m4/libopts.m4@1.9 +6 -9
+ attempt to quiet expanded before required warnings from libopts
+
+ChangeSet@1.2082.40.3, 2010-11-23 12:26:32+00:00, davehart@shiny.ad.hartbrothers.com
+ workaround for HP-UX /usr/include/machine/sys/getppdp.h gcc4 break.
+
+ configure.ac@1.465.1.19 +61 -26
+ workaround for HP-UX /usr/include/machine/sys/getppdp.h gcc4 break.
+
+ sntp/configure.ac@1.31.1.5 +49 -1
+ workaround for HP-UX /usr/include/machine/sys/getppdp.h gcc4 break.
+
+
+ChangeSet@1.2082.40.2, 2010-11-23 09:49:49+00:00, davehart@shiny.ad.hartbrothers.com
+ correct m4 quoting to quiet autoreconf warnings
+ enable ./bootstrap --force
+
+ bootstrap@1.28.1.7 +4 -2
+ enable ./bootstrap --force
+
+ configure.ac@1.465.1.18 +17 -14
+ correct m4 quoting to quiet autoreconf warnings
+
+ m4/ntp_openssl.m4@1.3 +7 -7
+ correct m4 quoting to quiet autoreconf warnings
+
+ sntp/configure.ac@1.31.1.4 +11 -8
+ correct m4 quoting to quiet autoreconf warnings
+
+ChangeSet@1.2082.39.4, 2010-11-23 03:54:56+00:00, hart@psp-fb1.ntp.org
+ build:
+ Do not skip configure if it is newer than config.status
+
+ build@1.35 +7 -3
+ Do not skip configure if it is newer than config.status
+
+ChangeSet@1.2082.39.3, 2010-11-22 22:54:53+00:00, davehart@shiny.ad.hartbrothers.com
+ Reduce bootstrap redundancy with autoreconf --no-recursive in the
+ top level, followed by recursive autoreconf in sntp.
+
+ bootstrap@1.28.1.6 +2 -1
+ Reduce bootstrap redundancy with autoreconf --no-recursive in the
+ top level, followed by recursive autoreconf in sntp.
+
+ChangeSet@1.2082.39.2, 2010-11-22 07:03:31+00:00, davehart@shiny.ad.hartbrothers.com
+ BBF to the rescue finding typos in #ifdef'd code
+
+ ntpd/ntp_io.c@1.306.1.12 +1 -1
+ BBF to the rescue finding typos in #ifdef'd code
+
+ sntp/networking.c@1.29.1.11 +2 -1
+ BBF to the rescue finding typos in #ifdef'd code
+
+ChangeSet@1.2293, 2010-11-22 05:27:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P84
+ TAG: NTP_4_2_7P84
+
+ ChangeLog@1.667 +1 -0
+ NTP_4_2_7P84
+
+ ntpd/ntpd-opts.c@1.88 +5 -5
+ NTP_4_2_7P84
+
+ ntpd/ntpd-opts.h@1.88 +4 -4
+ NTP_4_2_7P84
+
+ ntpd/ntpd-opts.menu@1.4 +3 -61
+ NTP_4_2_7P84
+
+ ntpd/ntpd-opts.texi@1.86 +0 -642
+ NTP_4_2_7P84
+
+ ntpd/ntpd.1@1.86 +4 -3
+ NTP_4_2_7P84
+
+ ntpdc/ntpdc-opts.c@1.85 +75 -72
+ NTP_4_2_7P84
+
+ ntpdc/ntpdc-opts.h@1.85 +22 -24
+ NTP_4_2_7P84
+
+ ntpdc/ntpdc-opts.menu@1.4 +2 -66
+ NTP_4_2_7P84
+
+ ntpdc/ntpdc-opts.texi@1.85 +0 -271
+ NTP_4_2_7P84
+
+ ntpdc/ntpdc.1@1.85 +2 -2
+ NTP_4_2_7P84
+
+ ntpq/ntpq-opts.c@1.85 +73 -68
+ NTP_4_2_7P84
+
+ ntpq/ntpq-opts.h@1.85 +22 -24
+ NTP_4_2_7P84
+
+ ntpq/ntpq-opts.menu@1.4 +2 -51
+ NTP_4_2_7P84
+
+ ntpq/ntpq-opts.texi@1.85 +0 -226
+ NTP_4_2_7P84
+
+ ntpq/ntpq.1@1.85 +2 -2
+ NTP_4_2_7P84
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.85 +55 -52
+ NTP_4_2_7P84
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.85 +22 -24
+ NTP_4_2_7P84
+
+ ntpsnmpd/ntpsnmpd-opts.menu@1.4 +2 -24
+ NTP_4_2_7P84
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.85 +0 -78
+ NTP_4_2_7P84
+
+ ntpsnmpd/ntpsnmpd.1@1.85 +2 -2
+ NTP_4_2_7P84
+
+ packageinfo.sh@1.86 +1 -1
+ NTP_4_2_7P84
+
+ sntp/sntp-opts.c@1.85 +81 -78
+ NTP_4_2_7P84
+
+ sntp/sntp-opts.h@1.85 +22 -24
+ NTP_4_2_7P84
+
+ sntp/sntp-opts.menu@1.4 +1 -1
+ NTP_4_2_7P84
+
+ sntp/sntp-opts.texi@1.85 +0 -213
+ NTP_4_2_7P84
+
+ sntp/sntp.1@1.85 +2 -2
+ NTP_4_2_7P84
+
+ sntp/sntp.html@1.85 +62 -6
+ NTP_4_2_7P84
+
+ util/ntp-keygen-opts.c@1.83 +5 -5
+ NTP_4_2_7P84
+
+ util/ntp-keygen-opts.h@1.83 +4 -4
+ NTP_4_2_7P84
+
+ util/ntp-keygen-opts.menu@1.5 +51 -1
+ NTP_4_2_7P84
+
+ util/ntp-keygen-opts.texi@1.86 +0 -374
+ NTP_4_2_7P84
+
+ util/ntp-keygen.1@1.86 +2 -2
+ NTP_4_2_7P84
+
+ChangeSet@1.2082.39.1, 2010-11-22 03:54:12+00:00, davehart@shiny.ad.hartbrothers.com
+ Bump minimum Automake version to 1.11, required for AM_COND_IF
+ use in LIBOPTS_CHECK.
+
+ ChangeLog@1.496.26.117 +3 -1
+ Bump minimum Automake version to 1.11, required for AM_COND_IF
+ use in LIBOPTS_CHECK.
+
+ Makefile.am@1.93.2.6 +2 -1
+ bump minimum Automake version to 1.11 for AM_COND_IF support
+ needed by local mod to libopts/m4/libopts.m4
+
+ sntp/Makefile.am@1.21.2.1 +2 -1
+ bump minimum Automake version to 1.11 for AM_COND_IF support
+ needed by local mod to libopts/m4/libopts.m4
+
+ChangeSet@1.2291, 2010-11-22 03:17:40+00:00, davehart@shiny.ad.hartbrothers.com
+ Add "nonvolatile" ntp.conf directive to control how often the
+ driftfile is written.
+
+ ChangeLog@1.665 +2 -0
+ Add "nonvolatile" ntp.conf directive to control how often the
+ driftfile is written.
+
+ include/ntp.h@1.188 +0 -1
+ "tos nonvolatile" was mistaken
+
+ ntpd/complete.conf@1.12 +3 -2
+ Add "nonvolatile" ntp.conf directive to control how often the
+ driftfile is written.
+
+ ntpd/ntp_config.c@1.275 +63 -34
+ Add "nonvolatile" ntp.conf directive to control how often the
+ driftfile is written.
+
+ ntpd/ntp_parser.c@1.71 +403 -401
+ bison output
+
+ ntpd/ntp_parser.y@1.65 +1 -1
+ Add "nonvolatile" ntp.conf directive to control how often the
+ driftfile is written.
+
+ ntpd/ntp_scanner.c@1.39 +6 -8
+ Allow doubles with exponent and without a decimal point.
+
+ChangeSet@1.2290, 2010-11-21 23:12:16+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1618] Unreachable code in jjy_start().
+ JJY driver improvements for Tristate JJY01/02, including changes
+ to its clockstats format.
+
+ applies to prior cset merged from a -stable repo
+
+ ChangeLog@1.664 +3 -0
+ [Bug 1618] Unreachable code in jjy_start().
+ JJY driver improvements for Tristate JJY01/02, including changes
+ to its clockstats format.
+
+
+ChangeSet@1.2082.4.171, 2010-11-21 23:03:15+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1618] jjy_start() unreachable code.
+ refclock_jjy.c Tristate JJY01/02 improvements.
+
+ html/copyright.html@1.46.1.2 +1 -0
+ Credit refclock_jjy author Takao Abe
+
+ ntpd/refclock_jjy.c@1.19 +586 -348
+ [Bug 1618] jjy_start() unreachable code.
+ refclock_jjy.c Tristate JJY01/02 improvements.
+
+ChangeSet@1.2287, 2010-11-20 23:22:10+00:00, davehart@shiny.ad.hartbrothers.com
+ remove Autogen 5.10 --wait-sync workaround from ntpdbase-opts.def, ntpd.c
+
+ ntpd/ntpd-opts.c@1.87 +147 -170
+ autogen output
+
+ ntpd/ntpd-opts.h@1.87 +24 -22
+ autogen output
+
+ ntpd/ntpd.c@1.119 +1 -2
+ remove Autogen 5.10 --wait-sync workaround from ntpdbase-opts.def, ntpd.c
+
+ ntpd/ntpdbase-opts.def@1.22 +1 -6
+ remove Autogen 5.10 --wait-sync workaround from ntpdbase-opts.def, ntpd.c
+
+ChangeSet@1.2082.4.170, 2010-11-20 17:18:02-05:00, stenn@deacon.udel.edu
+ hack around a problem building sntp/sntp.html
+
+ sntp/Makefile.am@1.21.1.11 +1 -1
+ hack around a problem building sntp/sntp.html
+
+ChangeSet@1.2082.4.169, 2010-11-20 16:54:28-05:00, stenn@deacon.udel.edu
+ Add support for "br-flock -1"
+
+ br-flock@1.15 +14 -1
+ Add support for "br-flock -1"
+
+ChangeSet@1.2082.4.168, 2010-11-20 20:53:00+00:00, davehart@shiny.ad.hartbrothers.com
+ repair make distcheck failure with sntp/libopts/Makefile
+
+ Makefile.am@1.93.2.5 +2 -8
+ move sntp earlier than libopts users in SUBDIRS,
+ remove sntp/libopts from SUBDIRS, to repair make distcheck
+ with a shared libopts.
+
+ bootstrap@1.28.1.5 +5 -1
+ once again use workaround of invoking autoreconf in sntp after the
+ top level, to ensure a correct sntp/libopts/Makefile.in.
+
+ configure.ac@1.465.1.17 +1 -1
+ do not AC_CONFIG_FILES(sntp/libopts/Makefile)
+
+ sntp/Makefile.am@1.21.1.10 +10 -11
+ remove . from SUBDIRS
+
+ sntp/libopts/m4/libopts.m4@1.8 +12 -7
+ add 2nd arg to LIBOPTS_CHECK controlling AC_CONFIG_FILES(libopts/Makefile])
+
+ChangeSet@1.2082.4.167, 2010-11-20 02:50:43-05:00, stenn@deacon.udel.edu
+ Remove top-level libopts/
+
+ BitKeeper/deleted/.del-COPYING.gplv3~f03d8366c675c284@1.1.1.1 +0 -0
+ Delete: libopts/COPYING.gplv3
+
+ BitKeeper/deleted/.del-COPYING.lgplv3~40be4cbf4ae10117@1.1.1.1 +0 -0
+ Delete: libopts/COPYING.lgplv3
+
+ BitKeeper/deleted/.del-COPYING.mbsd~a5472d893521969b@1.1.1.1 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc~c629403b9830e97a@1.1.1.1 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~b7467cbc80acbbcc@1.2.1.1 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README~5bc90a91ec6411e6@1.2.1.1 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-ag-char-map.h~bedbb0c05ab02a70@1.5.1.1 +0 -0
+ Delete: libopts/ag-char-map.h
+
+ BitKeeper/deleted/.del-autoopts.c~54350751ea38f4a9@1.4.1.1 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~56d3d4b1ff6e5a32@1.4.1.1 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~8e1af2515312893c@1.4.1.1 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h~7caca4e98e77c39@1.4.1.1 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c~edfc1b173dd4ca72@1.4.1.1 +0 -0
+ Delete: libopts/configfile.c
+
+ BitKeeper/deleted/.del-cook.c~a6052eddf9363b9@1.4.1.1 +0 -0
+ Delete: libopts/cook.c
+
+ BitKeeper/deleted/.del-enumeration.c~95e4ac5ad1bbc51d@1.4.1.1 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~3cd90226bb7b2b17@1.5.1.1 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-file.c~67e1b8b29a3953c9@1.4.1.1 +0 -0
+ Delete: libopts/file.c
+
+ BitKeeper/deleted/.del-genshell.c~3290a02566a5dbb7@1.5.1.1 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~c39a618c8d4061cd@1.5.1.1 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c~3ef92daf425d2b@1.1.1.1 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~93a05c922cf88420@1.5.1.1 +0 -0
+ Delete: libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~1413f38bcfcfd143@1.4.1.1 +0 -0
+ Delete: libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-load.c~1667134a8de0561c@1.4.1.1 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c~20cbf9416110166e@1.4.1.1 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c~f07a7d9124c8d2aa@1.4.1.1 +0 -0
+ Delete: libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c~2cd8f01381095e42@1.4.1.1 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~f2e0c23c8e5e59e8@1.5.1.1 +0 -0
+ Delete: libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-parse-duration.c~43baef4a99281837@1.1.1.1 +0 -0
+ Delete: libopts/parse-duration.c
+
+ BitKeeper/deleted/.del-parse-duration.h~17a3a3e1c22145d@1.1.1.1 +0 -0
+ Delete: libopts/parse-duration.h
+
+ BitKeeper/deleted/.del-pathfind.c~91eee34e6931c147@1.4.1.1 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~a31853764946ed10@1.4.1.1 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h~f433f2d660b72a7d@1.5.1.1 +0 -0
+ Delete: libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c~1e2cc4a1ffb8fafd@1.4.1.1 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-reset.c~676b344e8e06553d@1.4.1.1 +0 -0
+ Delete: libopts/reset.c
+
+ BitKeeper/deleted/.del-restore.c~7503fbe1eb367c27@1.4.1.1 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~c7023eeab566cc5a@1.5.1.1 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c~4020216a304b1fdf@1.1.1.1 +0 -0
+ Delete: libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sort.c~a0f0aca832b2554c@1.4.1.1 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~159a2b84f1ceafab@1.4.1.1 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-strchr.c~e00f88c19bec996f@1.1.1.1 +0 -0
+ Delete: libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strdup.c~d58e7b55af5b3f83@1.1.1.1 +0 -0
+ Delete: libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~59b1ce7223f3432@1.4.1.1 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c~b601dfb63675456e@1.4.1.1 +0 -0
+ Delete: libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-time.c~41f39a05ffd762ac@1.4.1.1 +0 -0
+ Delete: libopts/time.c
+
+ BitKeeper/deleted/.del-tokenize.c~c52b9718bf168782@1.2.1.1 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h~ca24f451aac51f1f@1.5.1.1 +0 -0
+ Delete: libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~5148c9dc95efdc1a@1.4.1.1 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-value-type.c~eab6702e458dce8d@1.2.1.1 +0 -0
+ Delete: libopts/value-type.c
+
+ BitKeeper/deleted/.del-value-type.h~8c9e9714f716dd59@1.5.1.1 +0 -0
+ Delete: libopts/value-type.h
+
+ BitKeeper/deleted/.del-version.c~c1c141f1786ce61c@1.4.1.1 +0 -0
+ Delete: libopts/version.c
+
+ BitKeeper/deleted/.del-windows-config.h~461ddbe1169c297b@1.4.1.1 +0 -0
+ Delete: libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-xat-attribute.c~8a808fcad835c47f@1.2.1.1 +0 -0
+ Delete: libopts/xat-attribute.c
+
+ BitKeeper/deleted/.del-xat-attribute.h~7d19c77e5ff1a904@1.5.1.1 +0 -0
+ Delete: libopts/xat-attribute.h
+
+ChangeSet@1.2082.4.166, 2010-11-20 02:18:46-05:00, stenn@deacon.udel.edu
+ backport the html timestamp fixes for bootstrap
+
+ bootstrap@1.28.1.4 +8 -4
+ backport the html timestamp fixes for bootstrap
+
+ChangeSet@1.2284, 2010-11-20 07:15:32+00:00, davehart@shiny.ad.hartbrothers.com
+ Add ntp-keygen -l/--lifetime to control certificate expiry.
+
+ ChangeLog@1.663 +1 -0
+ Add ntp-keygen -l/--lifetime to control certificate expiry.
+
+ util/ntp-keygen-opts.c@1.82 +149 -126
+ add ntp-keygen -l/--lifetime # to set days until expiration
+
+ util/ntp-keygen-opts.def@1.13 +13 -1
+ add ntp-keygen -l/--lifetime # to set days until expiration
+
+ util/ntp-keygen-opts.h@1.82 +47 -38
+ add ntp-keygen -l/--lifetime # to set days until expiration
+
+ util/ntp-keygen-opts.menu@1.2.1.1 +1 -94
+ add ntp-keygen -l/--lifetime # to set days until expiration
+
+ util/ntp-keygen-opts.texi@1.85 +95 -79
+ add ntp-keygen -l/--lifetime # to set days until expiration
+
+ util/ntp-keygen.1@1.85 +9 -3
+ add ntp-keygen -l/--lifetime # to set days until expiration
+
+ util/ntp-keygen.c@1.69 +4 -1
+ add ntp-keygen -l/--lifetime # to set days until expiration
+
+ChangeSet@1.2082.4.165, 2010-11-20 00:20:40-05:00, stenn@deacon.udel.edu
+ Properly quote the configure.ac LIBOPTS_CHECK argument
+
+ configure.ac@1.465.1.16 +1 -1
+ Properly quote the configure.ac LIBOPTS_CHECK argument
+
+ChangeSet@1.2082.4.164, 2010-11-20 00:18:39-05:00, stenn@deacon.udel.edu
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/Makefile.am@1.5 +3 -3
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/ag-char-map.h@1.8 +1 -1
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/configfile.c@1.7 +7 -5
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/genshell.c@1.8 +1 -1
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/genshell.h@1.8 +1 -1
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/proto.h@1.8 +1 -1
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/value-type.h@1.8 +1 -1
+ autogen-5.11.3 upgrade
+
+ sntp/libopts/xat-attribute.h@1.8 +1 -1
+ autogen-5.11.3 upgrade
+
+ChangeSet@1.2082.4.163, 2010-11-20 00:16:33-05:00, stenn@deacon.udel.edu
+ autogen upgrade
+
+ ntpd/ntpd-opts.menu@1.3 +1 -1
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.menu@1.3 +3 -3
+ autogen upgrade
+
+ ntpq/ntpq-opts.menu@1.3 +3 -3
+ autogen upgrade
+
+ ntpsnmpd/ntpsnmpd-opts.menu@1.3 +24 -2
+ autogen upgrade
+
+ sntp/sntp-opts.menu@1.3 +56 -1
+ autogen upgrade
+
+ util/ntp-keygen-opts.menu@1.3 +4 -4
+ autogen upgrade
+
+ChangeSet@1.2082.4.162, 2010-11-20 00:14:13-05:00, stenn@deacon.udel.edu
+ autogen upgrade
+
+ ntpd/ntpd-opts.c@1.248.27.1 +142 -140
+ autogen upgrade
+
+ ntpd/ntpd-opts.h@1.248.27.1 +20 -22
+ autogen upgrade
+
+ ntpd/ntpd-opts.texi@1.246.27.1 +0 -583
+ autogen upgrade
+
+ ntpd/ntpd.1@1.246.27.1 +2 -2
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.c@1.244.27.1 +74 -71
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.h@1.244.27.1 +20 -22
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.texi@1.243.27.1 +0 -271
+ autogen upgrade
+
+ ntpdc/ntpdc.1@1.243.27.1 +2 -2
+ autogen upgrade
+
+ ntpq/ntpq-opts.c@1.245.27.1 +72 -67
+ autogen upgrade
+
+ ntpq/ntpq-opts.h@1.245.27.1 +20 -22
+ autogen upgrade
+
+ ntpq/ntpq-opts.texi@1.244.27.1 +0 -226
+ autogen upgrade
+
+ ntpq/ntpq.1@1.244.27.1 +2 -2
+ autogen upgrade
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.28.1 +54 -51
+ autogen upgrade
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.28.1 +20 -22
+ autogen upgrade
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.28.1 +0 -78
+ autogen upgrade
+
+ ntpsnmpd/ntpsnmpd.1@1.122.28.1 +2 -2
+ autogen upgrade
+
+ sntp/sntp-opts.c@1.117.27.1 +80 -77
+ autogen upgrade
+
+ sntp/sntp-opts.h@1.117.27.1 +20 -22
+ autogen upgrade
+
+ sntp/sntp-opts.texi@1.117.27.1 +0 -213
+ autogen upgrade
+
+ sntp/sntp.1@1.117.27.1 +2 -2
+ autogen upgrade
+
+ sntp/sntp.html@1.7.27.1 +61 -5
+ autogen upgrade
+
+ util/ntp-keygen-opts.c@1.247.27.1 +98 -105
+ autogen upgrade
+
+ util/ntp-keygen-opts.h@1.247.27.1 +20 -22
+ autogen upgrade
+
+ util/ntp-keygen-opts.texi@1.246.27.1 +0 -358
+ autogen upgrade
+
+ util/ntp-keygen.1@1.246.27.1 +2 -2
+ autogen upgrade
+
+ChangeSet@1.2282, 2010-11-20 04:35:13+00:00, davehart@shiny.ad.hartbrothers.com
+ add "tos nonvolatile" to control interval between driftfile writes.
+
+ include/ntp.h@1.187 +1 -0
+ add "tos nonvolatile" to control interval between driftfile writes.
+
+ ntpd/complete.conf@1.11 +1 -1
+ add "tos nonvolatile" to control interval between driftfile writes.
+
+ ntpd/keyword-gen-utd@1.12 +1 -1
+ keyword-gen output
+
+ ntpd/keyword-gen.c@1.16 +1 -0
+ add "tos nonvolatile" to control interval between driftfile writes.
+
+ ntpd/ntp_config.c@1.274 +4 -0
+ add "tos nonvolatile" to control interval between driftfile writes.
+
+ ntpd/ntp_keyword.h@1.14 +512 -503
+ keyword-gen output
+
+ ntpd/ntp_parser.c@1.70 +810 -805
+ bison output
+
+ ntpd/ntp_parser.h@1.41 +149 -147
+ bison output
+
+ ntpd/ntp_parser.y@1.64 +2 -0
+ add "tos nonvolatile" to control interval between driftfile writes.
+
+ChangeSet@1.2082.4.161, 2010-11-19 23:29:22-05:00, stenn@psp-deb1.ntp.org
+ Update generated .menu files
+
+ ntpd/ntpd-opts.menu@1.2 +122 -1
+ Update generated .menu files
+
+ ntpdc/ntpdc-opts.menu@1.2 +122 -1
+ Update generated .menu files
+
+ ntpq/ntpq-opts.menu@1.2 +96 -1
+ Update generated .menu files
+
+ ntpsnmpd/ntpsnmpd-opts.menu@1.2 +34 -1
+ Update generated .menu files
+
+ util/ntp-keygen-opts.menu@1.2 +94 -1
+ Update generated .menu files
+
+ChangeSet@1.2082.4.160, 2010-11-19 23:27:51-05:00, stenn@psp-deb1.ntp.org
+ Use the new autoopts no-misuse-usage keyword
+
+ include/copyright.def@1.12 +1 -0
+ Use the new autoopts no-misuse-usage keyword
+
+ChangeSet@1.2082.4.159, 2010-11-19 23:26:17-05:00, stenn@psp-deb1.ntp.org
+ Upgrade libopts to 33.3.8 and autogen to 5.11.3
+
+ ChangeLog@1.496.26.116 +2 -0
+ Use a single copy of libopts/, in sntp/
+
+ Makefile.am@1.93.2.4 +11 -15
+ Use a single copy of libopts/, in sntp/
+
+ configure.ac@1.465.1.15 +1 -1
+ Use a single copy of libopts/, in sntp/
+
+ deps-ver@1.1.1.1 +1 -1
+ Use a single copy of libopts/, in sntp/
+
+ sntp/libopts/COPYING.gplv3@1.3 +1 -1
+ libopts-33.3.8
+
+ sntp/libopts/COPYING.lgplv3@1.3 +1 -1
+ libopts-33.3.8
+
+ sntp/libopts/Makefile.am@1.4 +5 -5
+ libopts-33.3.8
+
+ sntp/libopts/README@1.4 +1 -1
+ libopts-33.3.8
+
+ sntp/libopts/ag-char-map.h@1.7 +89 -57
+ libopts-33.3.8
+
+ sntp/libopts/autoopts.c@1.6 +84 -83
+ libopts-33.3.8
+
+ sntp/libopts/autoopts.h@1.6 +24 -21
+ libopts-33.3.8
+
+ sntp/libopts/autoopts/options.h@1.7 +48 -44
+ libopts-33.3.8
+
+ sntp/libopts/autoopts/usage-txt.h@1.7 +151 -144
+ libopts-33.3.8
+
+ sntp/libopts/boolean.c@1.6 +5 -4
+ libopts-33.3.8
+
+ sntp/libopts/compat/compat.h@1.6 +4 -5
+ libopts-33.3.8
+
+ sntp/libopts/compat/pathfind.c@1.6 +1 -4
+ libopts-33.3.8
+
+ sntp/libopts/compat/windows-config.h@1.6 +2 -3
+ libopts-33.3.8
+
+ sntp/libopts/configfile.c@1.6 +242 -219
+ libopts-33.3.8
+
+ sntp/libopts/cook.c@1.6 +5 -5
+ libopts-33.3.8
+
+ sntp/libopts/enumeration.c@1.6 +145 -140
+ libopts-33.3.8
+
+ sntp/libopts/environment.c@1.7 +27 -24
+ libopts-33.3.8
+
+ sntp/libopts/file.c@1.6 +5 -4
+ libopts-33.3.8
+
+ sntp/libopts/genshell.c@1.7 +36 -35
+ libopts-33.3.8
+
+ sntp/libopts/genshell.h@1.7 +20 -22
+ libopts-33.3.8
+
+ sntp/libopts/load.c@1.6 +47 -65
+ libopts-33.3.8
+
+ sntp/libopts/m4/libopts.m4@1.7 +48 -46
+ libopts-33.3.8
+
+ sntp/libopts/m4/liboptschk.m4@1.6 +2 -2
+ libopts-33.3.8
+
+ sntp/libopts/makeshell.c@1.6 +203 -188
+ libopts-33.3.8
+
+ sntp/libopts/nested.c@1.6 +116 -136
+ libopts-33.3.8
+
+ sntp/libopts/numeric.c@1.6 +5 -4
+ libopts-33.3.8
+
+ sntp/libopts/parse-duration.c@1.3 +2 -2
+ libopts-33.3.8
+
+ sntp/libopts/parse-duration.h@1.3 +9 -1
+ libopts-33.3.8
+
+ sntp/libopts/pgusage.c@1.6 +19 -18
+ libopts-33.3.8
+
+ sntp/libopts/proto.h@1.7 +20 -17
+ libopts-33.3.8
+
+ sntp/libopts/putshell.c@1.6 +179 -127
+ libopts-33.3.8
+
+ sntp/libopts/reset.c@1.6 +5 -4
+ libopts-33.3.8
+
+ sntp/libopts/restore.c@1.6 +20 -19
+ libopts-33.3.8
+
+ sntp/libopts/save.c@1.7 +77 -77
+ libopts-33.3.8
+
+ sntp/libopts/sort.c@1.6 +35 -35
+ libopts-33.3.8
+
+ sntp/libopts/stack.c@1.6 +19 -19
+ libopts-33.3.8
+
+ sntp/libopts/streqvcmp.c@1.6 +13 -12
+ libopts-33.3.8
+
+ sntp/libopts/text_mmap.c@1.6 +31 -31
+ libopts-33.3.8
+
+ sntp/libopts/time.c@1.6 +7 -6
+ libopts-33.3.8
+
+ sntp/libopts/tokenize.c@1.4 +117 -105
+ libopts-33.3.8
+
+ sntp/libopts/usage.c@1.6 +299 -196
+ libopts-33.3.8
+
+ sntp/libopts/value-type.c@1.4 +4 -1
+ libopts-33.3.8
+
+ sntp/libopts/value-type.h@1.7 +1 -1
+ libopts-33.3.8
+
+ sntp/libopts/version.c@1.6 +32 -28
+ libopts-33.3.8
+
+ sntp/libopts/xat-attribute.c@1.4 +4 -1
+ libopts-33.3.8
+
+ sntp/libopts/xat-attribute.h@1.7 +1 -1
+ libopts-33.3.8
+
+ChangeSet@1.2272.1.7, 2010-11-19 22:27:35-05:00, stenn@deacon.udel.edu
+ Initial loopfilter overhaul from Dave Mills
+
+ ChangeLog@1.655.1.7 +4 -0
+ Initial loopfilter overhaul from Dave Mills
+
+ html/keygen.html@1.23 +3 -1
+ Initial loopfilter overhaul from Dave Mills
+
+ html/miscopt.html@1.62 +16 -19
+ Initial loopfilter overhaul from Dave Mills
+
+ include/ntp.h@1.184.1.1 +4 -5
+ Initial loopfilter overhaul from Dave Mills
+
+ include/ntpd.h@1.143.1.1 +0 -3
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntp_config.c@1.271.1.1 +0 -8
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.162 +39 -53
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntp_proto.c@1.312 +5 -5
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntp_request.c@1.95.1.1 +0 -8
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntp_timer.c@1.62 +4 -6
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntp_util.c@1.87 +60 -73
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntpd.c@1.118 +1 -1
+ Initial loopfilter overhaul from Dave Mills
+
+ ntpd/ntpsim.c@1.29 +1 -1
+ Initial loopfilter overhaul from Dave Mills
+
+ChangeSet@1.2082.4.158, 2010-11-18 05:09:05+00:00, davehart@shiny.ad.hartbrothers.com
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.10 +3 -3
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vc6/ntpd.dsp@1.39.1.4 +4 -4
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vc6/ntpdc.dsp@1.28.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.20.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vc6/ntpq.dsp@1.29.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2003/libntp.vcproj@1.4.1.4 +3 -3
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2003/ntpd.vcproj@1.4.1.2 +3 -3
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2003/ntpdc.vcproj@1.4.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2003/ntpkeygen.vcproj@1.3.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2003/ntpq.vcproj@1.4.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2005/libntp.vcproj@1.4.1.4 +3 -3
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2005/ntpd.vcproj@1.4.1.2 +3 -3
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.4.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.3.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2005/ntpq.vcproj@1.4.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20.1.6 +4 -4
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.9.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.21.1.3 +3 -3
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.12.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.11.1.1 +2 -2
+ convert Windows build to share single sntp/libopts
+
+ChangeSet@1.2272.1.6, 2010-11-17 10:10:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P83
+ TAG: NTP_4_2_7P83
+
+ ChangeLog@1.655.1.6 +1 -0
+ NTP_4_2_7P83
+
+ ntpd/ntpd-opts.c@1.86 +2 -2
+ NTP_4_2_7P83
+
+ ntpd/ntpd-opts.h@1.86 +3 -3
+ NTP_4_2_7P83
+
+ ntpd/ntpd-opts.texi@1.85 +2 -2
+ NTP_4_2_7P83
+
+ ntpd/ntpd.1@1.85 +2 -2
+ NTP_4_2_7P83
+
+ ntpdc/ntpdc-opts.c@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpdc/ntpdc-opts.h@1.84 +3 -3
+ NTP_4_2_7P83
+
+ ntpdc/ntpdc-opts.texi@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpdc/ntpdc.1@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpq/ntpq-opts.c@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpq/ntpq-opts.h@1.84 +3 -3
+ NTP_4_2_7P83
+
+ ntpq/ntpq-opts.texi@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpq/ntpq.1@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.84 +3 -3
+ NTP_4_2_7P83
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.84 +2 -2
+ NTP_4_2_7P83
+
+ ntpsnmpd/ntpsnmpd.1@1.84 +2 -2
+ NTP_4_2_7P83
+
+ packageinfo.sh@1.85 +1 -1
+ NTP_4_2_7P83
+
+ sntp/sntp-opts.c@1.84 +2 -2
+ NTP_4_2_7P83
+
+ sntp/sntp-opts.h@1.84 +3 -3
+ NTP_4_2_7P83
+
+ sntp/sntp-opts.texi@1.84 +1 -1
+ NTP_4_2_7P83
+
+ sntp/sntp.1@1.84 +2 -2
+ NTP_4_2_7P83
+
+ sntp/sntp.html@1.84 +1 -1
+ NTP_4_2_7P83
+
+ util/ntp-keygen-opts.c@1.81 +2 -2
+ NTP_4_2_7P83
+
+ util/ntp-keygen-opts.h@1.81 +3 -3
+ NTP_4_2_7P83
+
+ util/ntp-keygen-opts.texi@1.84 +2 -2
+ NTP_4_2_7P83
+
+ util/ntp-keygen.1@1.84 +2 -2
+ NTP_4_2_7P83
+
+ChangeSet@1.2277, 2010-11-17 05:31:02+00:00, davehart@shiny.ad.hartbrothers.com
+ remove ChangeLog reference to 1727, integrated first from another branch.
+
+ ChangeLog@1.658 +0 -1
+ remove ChangeLog reference to 1727, integrated first from another branch.
+
+ChangeSet@1.2272.2.1, 2010-11-16 20:00:54-05:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.655.2.1 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.7 +2 -2
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.61 +4 -4
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2272.1.4, 2010-11-16 20:36:48+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1727] ntp-keygen PLEN, ILEN undeclared --without-crypto.
+
+ ChangeLog@1.655.1.4 +1 -0
+ [Bug 1727] ntp-keygen PLEN, ILEN undeclared --without-crypto.
+
+ util/ntp-keygen.c@1.66.1.1 +2 -2
+ [Bug 1727] ntp-keygen PLEN, ILEN undeclared --without-crypto.
+
+ChangeSet@1.2272.1.3, 2010-11-16 19:52:26+00:00, davehart@shiny.ad.hartbrothers.com
+ get rid of duplicate libopts copy
+
+ BitKeeper/deleted/04/README~5bc90a91ec6411e6@1.3 +0 -0
+ Rename: libopts/README -> BitKeeper/deleted/04/README~5bc90a91ec6411e6
+
+ BitKeeper/deleted/04/value-type.h~8c9e9714f716dd59@1.6 +0 -0
+ Rename: libopts/value-type.h -> BitKeeper/deleted/04/value-type.h~8c9e9714f716dd59
+
+ BitKeeper/deleted/07/usage.c~5148c9dc95efdc1a@1.5 +0 -0
+ Rename: libopts/usage.c -> BitKeeper/deleted/07/usage.c~5148c9dc95efdc1a
+
+ BitKeeper/deleted/0e/putshell.c~1e2cc4a1ffb8fafd@1.5 +0 -0
+ Rename: libopts/putshell.c -> BitKeeper/deleted/0e/putshell.c~1e2cc4a1ffb8fafd
+
+ BitKeeper/deleted/13/tokenize.c~c52b9718bf168782@1.3 +0 -0
+ Rename: libopts/tokenize.c -> BitKeeper/deleted/13/tokenize.c~c52b9718bf168782
+
+ BitKeeper/deleted/16/load.c~1667134a8de0561c@1.5 +0 -0
+ Rename: libopts/load.c -> BitKeeper/deleted/16/load.c~1667134a8de0561c
+
+ BitKeeper/deleted/18/streqvcmp.c~59b1ce7223f3432@1.5 +0 -0
+ Rename: libopts/streqvcmp.c -> BitKeeper/deleted/18/streqvcmp.c~59b1ce7223f3432
+
+ BitKeeper/deleted/1b/file.c~67e1b8b29a3953c9@1.5 +0 -0
+ Rename: libopts/file.c -> BitKeeper/deleted/1b/file.c~67e1b8b29a3953c9
+
+ BitKeeper/deleted/20/cook.c~a6052eddf9363b9@1.5 +0 -0
+ Rename: libopts/cook.c -> BitKeeper/deleted/20/cook.c~a6052eddf9363b9
+
+ BitKeeper/deleted/27/makeshell.c~20cbf9416110166e@1.5 +0 -0
+ Rename: libopts/makeshell.c -> BitKeeper/deleted/27/makeshell.c~20cbf9416110166e
+
+ BitKeeper/deleted/29/compat.h~7caca4e98e77c39@1.5 +0 -0
+ Rename: libopts/compat/compat.h -> BitKeeper/deleted/29/compat.h~7caca4e98e77c39
+
+ BitKeeper/deleted/29/enumeration.c~95e4ac5ad1bbc51d@1.5 +0 -0
+ Rename: libopts/enumeration.c -> BitKeeper/deleted/29/enumeration.c~95e4ac5ad1bbc51d
+
+ BitKeeper/deleted/2a/genshell.c~3290a02566a5dbb7@1.6 +0 -0
+ Rename: libopts/genshell.c -> BitKeeper/deleted/2a/genshell.c~3290a02566a5dbb7
+
+ BitKeeper/deleted/2b/sort.c~a0f0aca832b2554c@1.5 +0 -0
+ Rename: libopts/sort.c -> BitKeeper/deleted/2b/sort.c~a0f0aca832b2554c
+
+ BitKeeper/deleted/2c/pgusage.c~a31853764946ed10@1.5 +0 -0
+ Rename: libopts/pgusage.c -> BitKeeper/deleted/2c/pgusage.c~a31853764946ed10
+
+ BitKeeper/deleted/36/version.c~c1c141f1786ce61c@1.5 +0 -0
+ Rename: libopts/version.c -> BitKeeper/deleted/36/version.c~c1c141f1786ce61c
+
+ BitKeeper/deleted/3b/text_mmap.c~b601dfb63675456e@1.5 +0 -0
+ Rename: libopts/text_mmap.c -> BitKeeper/deleted/3b/text_mmap.c~b601dfb63675456e
+
+ BitKeeper/deleted/46/strchr.c~e00f88c19bec996f@1.2 +0 -0
+ Rename: libopts/compat/strchr.c -> BitKeeper/deleted/46/strchr.c~e00f88c19bec996f
+
+ BitKeeper/deleted/48/MakeDefs.inc~c629403b9830e97a@1.2 +0 -0
+ Rename: libopts/MakeDefs.inc -> BitKeeper/deleted/48/MakeDefs.inc~c629403b9830e97a
+
+ BitKeeper/deleted/4b/value-type.c~eab6702e458dce8d@1.3 +0 -0
+ Rename: libopts/value-type.c -> BitKeeper/deleted/4b/value-type.c~eab6702e458dce8d
+
+ BitKeeper/deleted/4c/boolean.c~8e1af2515312893c@1.5 +0 -0
+ Rename: libopts/boolean.c -> BitKeeper/deleted/4c/boolean.c~8e1af2515312893c
+
+ BitKeeper/deleted/67/environment.c~3cd90226bb7b2b17@1.6 +0 -0
+ Rename: libopts/environment.c -> BitKeeper/deleted/67/environment.c~3cd90226bb7b2b17
+
+ BitKeeper/deleted/6b/usage-txt.h~ca24f451aac51f1f@1.6 +0 -0
+ Rename: libopts/autoopts/usage-txt.h -> BitKeeper/deleted/6b/usage-txt.h~ca24f451aac51f1f
+
+ BitKeeper/deleted/6c/snprintf.c~4020216a304b1fdf@1.2 +0 -0
+ Rename: libopts/compat/snprintf.c -> BitKeeper/deleted/6c/snprintf.c~4020216a304b1fdf
+
+ BitKeeper/deleted/6c/windows-config.h~461ddbe1169c297b@1.5 +0 -0
+ Rename: libopts/compat/windows-config.h -> BitKeeper/deleted/6c/windows-config.h~461ddbe1169c297b
+
+ BitKeeper/deleted/7a/autoopts.c~54350751ea38f4a9@1.5 +0 -0
+ Rename: libopts/autoopts.c -> BitKeeper/deleted/7a/autoopts.c~54350751ea38f4a9
+
+ BitKeeper/deleted/82/xat-attribute.h~7d19c77e5ff1a904@1.6 +0 -0
+ Rename: libopts/xat-attribute.h -> BitKeeper/deleted/82/xat-attribute.h~7d19c77e5ff1a904
+
+ BitKeeper/deleted/8f/options.h~f2e0c23c8e5e59e8@1.6 +0 -0
+ Rename: libopts/autoopts/options.h -> BitKeeper/deleted/8f/options.h~f2e0c23c8e5e59e8
+
+ BitKeeper/deleted/91/parse-duration.c~43baef4a99281837@1.2 +0 -0
+ Rename: libopts/parse-duration.c -> BitKeeper/deleted/91/parse-duration.c~43baef4a99281837
+
+ BitKeeper/deleted/94/xat-attribute.c~8a808fcad835c47f@1.3 +0 -0
+ Rename: libopts/xat-attribute.c -> BitKeeper/deleted/94/xat-attribute.c~8a808fcad835c47f
+
+ BitKeeper/deleted/9b/genshell.h~c39a618c8d4061cd@1.6 +0 -0
+ Rename: libopts/genshell.h -> BitKeeper/deleted/9b/genshell.h~c39a618c8d4061cd
+
+ BitKeeper/deleted/9c/nested.c~f07a7d9124c8d2aa@1.5 +0 -0
+ Rename: libopts/nested.c -> BitKeeper/deleted/9c/nested.c~f07a7d9124c8d2aa
+
+ BitKeeper/deleted/a0/autoopts.h~56d3d4b1ff6e5a32@1.5 +0 -0
+ Rename: libopts/autoopts.h -> BitKeeper/deleted/a0/autoopts.h~56d3d4b1ff6e5a32
+
+ BitKeeper/deleted/a0/reset.c~676b344e8e06553d@1.5 +0 -0
+ Rename: libopts/reset.c -> BitKeeper/deleted/a0/reset.c~676b344e8e06553d
+
+ BitKeeper/deleted/bb/configfile.c~edfc1b173dd4ca72@1.5 +0 -0
+ Rename: libopts/configfile.c -> BitKeeper/deleted/bb/configfile.c~edfc1b173dd4ca72
+
+ BitKeeper/deleted/bc/COPYING.mbsd~a5472d893521969b@1.2 +0 -0
+ Rename: libopts/COPYING.mbsd -> BitKeeper/deleted/bc/COPYING.mbsd~a5472d893521969b
+
+ BitKeeper/deleted/c0/COPYING.lgplv3~40be4cbf4ae10117@1.2 +0 -0
+ Rename: libopts/COPYING.lgplv3 -> BitKeeper/deleted/c0/COPYING.lgplv3~40be4cbf4ae10117
+
+ BitKeeper/deleted/c4/strdup.c~d58e7b55af5b3f83@1.2 +0 -0
+ Rename: libopts/compat/strdup.c -> BitKeeper/deleted/c4/strdup.c~d58e7b55af5b3f83
+
+ BitKeeper/deleted/c6/stack.c~159a2b84f1ceafab@1.5 +0 -0
+ Rename: libopts/stack.c -> BitKeeper/deleted/c6/stack.c~159a2b84f1ceafab
+
+ BitKeeper/deleted/cd/libopts.c~3ef92daf425d2b@1.2 +0 -0
+ Rename: libopts/libopts.c -> BitKeeper/deleted/cd/libopts.c~3ef92daf425d2b
+
+ BitKeeper/deleted/ce/numeric.c~2cd8f01381095e42@1.5 +0 -0
+ Rename: libopts/numeric.c -> BitKeeper/deleted/ce/numeric.c~2cd8f01381095e42
+
+ BitKeeper/deleted/d4/pathfind.c~91eee34e6931c147@1.5 +0 -0
+ Rename: libopts/compat/pathfind.c -> BitKeeper/deleted/d4/pathfind.c~91eee34e6931c147
+
+ BitKeeper/deleted/d7/time.c~41f39a05ffd762ac@1.5 +0 -0
+ Rename: libopts/time.c -> BitKeeper/deleted/d7/time.c~41f39a05ffd762ac
+
+ BitKeeper/deleted/da/liboptschk.m4~1413f38bcfcfd143@1.5 +0 -0
+ Rename: libopts/m4/liboptschk.m4 -> BitKeeper/deleted/da/liboptschk.m4~1413f38bcfcfd143
+
+ BitKeeper/deleted/e1/Makefile.am~b7467cbc80acbbcc@1.3 +0 -0
+ Rename: libopts/Makefile.am -> BitKeeper/deleted/e1/Makefile.am~b7467cbc80acbbcc
+
+ BitKeeper/deleted/e5/ag-char-map.h~bedbb0c05ab02a70@1.6 +0 -0
+ Rename: libopts/ag-char-map.h -> BitKeeper/deleted/e5/ag-char-map.h~bedbb0c05ab02a70
+
+ BitKeeper/deleted/e8/libopts.m4~93a05c922cf88420@1.6 +0 -0
+ Rename: libopts/m4/libopts.m4 -> BitKeeper/deleted/e8/libopts.m4~93a05c922cf88420
+
+ BitKeeper/deleted/f4/proto.h~f433f2d660b72a7d@1.6 +0 -0
+ Rename: libopts/proto.h -> BitKeeper/deleted/f4/proto.h~f433f2d660b72a7d
+
+ BitKeeper/deleted/f6/COPYING.gplv3~f03d8366c675c284@1.2 +0 -0
+ Rename: libopts/COPYING.gplv3 -> BitKeeper/deleted/f6/COPYING.gplv3~f03d8366c675c284
+
+ BitKeeper/deleted/f7/parse-duration.h~17a3a3e1c22145d@1.2 +0 -0
+ Rename: libopts/parse-duration.h -> BitKeeper/deleted/f7/parse-duration.h~17a3a3e1c22145d
+
+ BitKeeper/deleted/f8/restore.c~7503fbe1eb367c27@1.5 +0 -0
+ Rename: libopts/restore.c -> BitKeeper/deleted/f8/restore.c~7503fbe1eb367c27
+
+ BitKeeper/deleted/fc/save.c~c7023eeab566cc5a@1.6 +0 -0
+ Rename: libopts/save.c -> BitKeeper/deleted/fc/save.c~c7023eeab566cc5a
+
+ ChangeLog@1.655.1.3 +1 -0
+ Remove top-level libopts, use sntp/libopts.
+
+ Makefile.am@1.99 +8 -12
+ Remove top-level libopts, use sntp/libopts.
+
+ configure.ac@1.496 +1 -1
+ Remove top-level libopts, use sntp/libopts.
+
+ deps-ver@1.2 +1 -1
+ bump deps-ver to trigger clean build with removal of top-level
+ copy of libopts
+
+ ports/winnt/vc6/libntp.dsp@1.54 +3 -3
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vc6/ntpd.dsp@1.50 +3 -3
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vc6/ntpdc.dsp@1.29 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.21 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vc6/ntpq.dsp@1.30 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2003/libntp.vcproj@1.12 +3 -3
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2003/ntpd.vcproj@1.11 +3 -3
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2003/ntpdc.vcproj@1.5 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2003/ntpkeygen.vcproj@1.4 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2003/ntpq.vcproj@1.5 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2005/libntp.vcproj@1.10 +3 -3
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.11 +3 -3
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.5 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.4 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2005/ntpq.vcproj@1.5 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.31 +4 -4
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.11 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.33 +3 -3
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.14 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.13 +2 -2
+ Remove top-level libopts, use sntp/libopts.
+
+ChangeSet@1.2272.1.2, 2010-11-16 10:10:15+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P82
+ TAG: NTP_4_2_7P82
+
+ ChangeLog@1.655.1.2 +1 -0
+ NTP_4_2_7P82
+
+ ntpd/ntpd-opts.c@1.85 +2 -2
+ NTP_4_2_7P82
+
+ ntpd/ntpd-opts.h@1.85 +3 -3
+ NTP_4_2_7P82
+
+ ntpd/ntpd-opts.texi@1.84 +2 -2
+ NTP_4_2_7P82
+
+ ntpd/ntpd.1@1.84 +2 -2
+ NTP_4_2_7P82
+
+ ntpdc/ntpdc-opts.c@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpdc/ntpdc-opts.h@1.83 +3 -3
+ NTP_4_2_7P82
+
+ ntpdc/ntpdc-opts.texi@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpdc/ntpdc.1@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpq/ntpq-opts.c@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpq/ntpq-opts.h@1.83 +3 -3
+ NTP_4_2_7P82
+
+ ntpq/ntpq-opts.texi@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpq/ntpq.1@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.83 +3 -3
+ NTP_4_2_7P82
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.83 +2 -2
+ NTP_4_2_7P82
+
+ ntpsnmpd/ntpsnmpd.1@1.83 +2 -2
+ NTP_4_2_7P82
+
+ packageinfo.sh@1.84 +1 -1
+ NTP_4_2_7P82
+
+ sntp/sntp-opts.c@1.83 +2 -2
+ NTP_4_2_7P82
+
+ sntp/sntp-opts.h@1.83 +3 -3
+ NTP_4_2_7P82
+
+ sntp/sntp-opts.texi@1.83 +1 -1
+ NTP_4_2_7P82
+
+ sntp/sntp.1@1.83 +2 -2
+ NTP_4_2_7P82
+
+ sntp/sntp.html@1.83 +1 -1
+ NTP_4_2_7P82
+
+ util/ntp-keygen-opts.c@1.80 +2 -2
+ NTP_4_2_7P82
+
+ util/ntp-keygen-opts.h@1.80 +3 -3
+ NTP_4_2_7P82
+
+ util/ntp-keygen-opts.texi@1.83 +2 -2
+ NTP_4_2_7P82
+
+ util/ntp-keygen.1@1.83 +2 -2
+ NTP_4_2_7P82
+
+ChangeSet@1.2082.38.1, 2010-11-15 23:53:16-05:00, stenn@deacon.udel.edu
+ [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib to CPPFLAGS or LDFLAGS
+
+ ChangeLog@1.496.58.1 +5 -0
+ [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib to CPPFLAGS or LDFLAGS
+
+ m4/ntp_openssl.m4@1.2 +12 -4
+ [Bug 1728] In ntp_openssl.m4, don't add -I/usr/include or -L/usr/lib to CPPFLAGS or LDFLAGS
+
+ChangeSet@1.2082.4.156, 2010-11-16 00:53:57+00:00, davehart@shiny.ad.hartbrothers.com
+ correct tests for link-local (fe80) and site-local (fec0) unicast
+ IPv6 addresses in selecting default multicast source addresses.
+
+ ntpd/ntp_io.c@1.306.1.11 +19 -18
+ correct tests for link-local (fe80) and site-local (fec0) unicast
+ IPv6 addresses in selecting default multicast source addresses.
+
+ChangeSet@1.2275, 2010-11-16 00:07:47+00:00, davehart@shiny.ad.hartbrothers.com
+ merge repair
+
+ BitKeeper/deleted/3e/log-expected-log~2cb22a7a98bc5f12@1.3 +0 -0
+ Rename: sntp/tests/data/log-expected-log -> BitKeeper/deleted/3e/log-expected-log~2cb22a7a98bc5f12
+
+ BitKeeper/deleted/70/log-expected-debug~2e237608238fd4f0@1.3 +0 -0
+ Rename: sntp/tests/data/log-expected-debug -> BitKeeper/deleted/70/log-expected-debug~2e237608238fd4f0
+
+ BitKeeper/deleted/cc/logFile.cpp~7fc28eb9a26c17c2@1.7 +0 -0
+ Rename: sntp/tests/logFile.cpp -> BitKeeper/deleted/cc/logFile.cpp~7fc28eb9a26c17c2
+
+ include/ntpd.h@1.145 +1 -1
+ merge repair
+
+ libntp/ntp_calendar.c@1.3 +10 -10
+ silence warnings about truncation
+
+ ntpd/ntp_control.c@1.141 +2 -2
+ merge repair
+
+ ntpd/ntp_filegen.c@1.22 +1 -2
+ silence warnings
+
+ ntpd/ntp_io.c@1.329 +5 -6
+ merge repair
+
+ ntpd/ntp_peer.c@1.137 +8 -10
+ merge repair
+
+ sntp/tests/Makefile.am@1.17 +1 -4
+ remove sntp logging unit tests, as sntp uses only msyslog now.
+
+ChangeSet@1.2082.4.155, 2010-11-15 22:39:31+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove log_msg() and debug_msg() from sntp in favor of msyslog().
+
+ ChangeLog@1.496.26.114 +1 -0
+ Remove log_msg() and debug_msg() from sntp in favor of msyslog().
+
+ sntp/log.c@1.11.1.4 +0 -19
+ Remove log_msg() and debug_msg() from sntp in favor of msyslog().
+
+ sntp/log.h@1.10 +0 -3
+ Remove log_msg() and debug_msg() from sntp in favor of msyslog().
+
+ sntp/main.c@1.24.1.7 +6 -11
+ Remove log_msg() and debug_msg() from sntp in favor of msyslog().
+
+ChangeSet@1.2273, 2010-11-15 22:30:55+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1727] ntp-keygen PLEN, ILEN undeclared --without-crypto.
+
+ ChangeLog@1.656 +1 -0
+ [Bug 1727] ntp-keygen PLEN, ILEN undeclared --without-crypto.
+
+ util/ntp-keygen.c@1.67 +2 -2
+ [Bug 1727] ntp-keygen PLEN, ILEN undeclared --without-crypto.
+
+ChangeSet@1.2082.4.154, 2010-11-15 20:09:00+00:00, davehart@shiny.ad.hartbrothers.com
+ Do not send multicast from both link-local and global addresses on
+ the same underlying network interface.
+
+ ntpd/ntp_io.c@1.306.1.10 +74 -32
+ Do not send multicast from both link-local and global addresses on
+ the same underlying network interface.
+
+ChangeSet@1.2082.4.153, 2010-11-15 18:24:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1725] ntpd sends multicast from only one address.
+
+ ChangeLog@1.496.26.113 +4 -0
+ [Bug 1725] ntpd sends multicast from only one address.
+
+ include/ntp.h@1.168.1.3 +29 -23
+ [Bug 1725] ntpd sends multicast from only one address.
+ begin changing internal references from "struct interface" to "endpt"
+
+ include/ntpd.h@1.137.2.2 +9 -9
+ [Bug 1725] ntpd sends multicast from only one address.
+ begin changing internal references from "struct interface" to "endpt"
+
+ ntpd/ntp_config.c@1.241.1.7 +2 -3
+ use ZERO_SOCK() in two places
+
+ ntpd/ntp_io.c@1.306.1.9 +320 -283
+ [Bug 1725] ntpd sends multicast from only one address.
+ begin changing internal references from "struct interface" to "endpt"
+
+ ntpd/ntp_peer.c@1.126.1.1 +62 -69
+ refactor select_peerinterface() to reduce duplication, indents
+ reduce #ifdef WINNT clutter
+
+ ntpd/ntp_request.c@1.82.1.3 +21 -21
+ [Bug 1725] ntpd sends multicast from only one address.
+ begin changing internal references from "struct interface" to "endpt"
+
+ ports/winnt/include/ntp_iocompletionport.h@1.18 +1 -2
+ reduce sendpkt() ifdefs around sendto()
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.49.1.1 +34 -32
+ reduce sendpkt() ifdefs around sendto()
+
+ ports/winnt/ntpd/ntservice.c@1.22.1.1 +3 -3
+ reduce #ifdef WINNT clutter
+
+ChangeSet@1.2272, 2010-11-14 23:36:16+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P81
+ TAG: NTP_4_2_7P81
+
+ ChangeLog@1.655 +1 -0
+ NTP_4_2_7P81
+
+ ntpd/ntpd-opts.c@1.84 +2 -2
+ NTP_4_2_7P81
+
+ ntpd/ntpd-opts.h@1.84 +3 -3
+ NTP_4_2_7P81
+
+ ntpd/ntpd-opts.texi@1.83 +2 -2
+ NTP_4_2_7P81
+
+ ntpd/ntpd.1@1.83 +2 -2
+ NTP_4_2_7P81
+
+ ntpdc/ntpdc-opts.c@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpdc/ntpdc-opts.h@1.82 +3 -3
+ NTP_4_2_7P81
+
+ ntpdc/ntpdc-opts.texi@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpdc/ntpdc.1@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpq/ntpq-opts.c@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpq/ntpq-opts.h@1.82 +3 -3
+ NTP_4_2_7P81
+
+ ntpq/ntpq-opts.texi@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpq/ntpq.1@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.82 +3 -3
+ NTP_4_2_7P81
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.82 +2 -2
+ NTP_4_2_7P81
+
+ ntpsnmpd/ntpsnmpd.1@1.82 +2 -2
+ NTP_4_2_7P81
+
+ packageinfo.sh@1.83 +1 -1
+ NTP_4_2_7P81
+
+ sntp/sntp-opts.c@1.82 +3 -3
+ NTP_4_2_7P81
+
+ sntp/sntp-opts.h@1.82 +3 -3
+ NTP_4_2_7P81
+
+ sntp/sntp-opts.texi@1.82 +2 -2
+ NTP_4_2_7P81
+
+ sntp/sntp.1@1.82 +3 -5
+ NTP_4_2_7P81
+
+ sntp/sntp.html@1.82 +1 -1
+ NTP_4_2_7P81
+
+ util/ntp-keygen-opts.c@1.79 +2 -2
+ NTP_4_2_7P81
+
+ util/ntp-keygen-opts.h@1.79 +3 -3
+ NTP_4_2_7P81
+
+ util/ntp-keygen-opts.texi@1.82 +2 -2
+ NTP_4_2_7P81
+
+ util/ntp-keygen.1@1.82 +2 -2
+ NTP_4_2_7P81
+
+ChangeSet@1.2271, 2010-11-14 18:13:53-05:00, stenn@deacon.udel.edu
+ [Bug 1719] Cleanup for ntp-keygen and fix -V crash, from Dave Mills
+
+ ChangeLog@1.654 +1 -0
+ [Bug 1719] Cleanup for ntp-keygen and fix -V crash, from Dave Mills
+
+ html/autokey.html@1.6 +11 -11
+ [Bug 1719] Cleanup for ntp-keygen and fix -V crash, from Dave Mills
+
+ util/ntp-keygen.c@1.66 +16 -21
+ [Bug 1719] Cleanup for ntp-keygen and fix -V crash, from Dave Mills
+
+ChangeSet@1.2082.4.152, 2010-11-14 08:56:20+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC10
+ TAG: NTP_4_2_6P3_RC10
+
+ ChangeLog@1.496.26.112 +1 -0
+ NTP_4_2_6P3_RC10
+
+ ntpd/ntpd-opts.c@1.248.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpd/ntpd-opts.h@1.248.26.1 +3 -3
+ NTP_4_2_6P3_RC10
+
+ ntpd/ntpd-opts.texi@1.246.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpd/ntpd.1@1.246.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpdc/ntpdc-opts.c@1.244.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpdc/ntpdc-opts.h@1.244.26.1 +3 -3
+ NTP_4_2_6P3_RC10
+
+ ntpdc/ntpdc-opts.texi@1.243.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpdc/ntpdc.1@1.243.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpq/ntpq-opts.c@1.245.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpq/ntpq-opts.h@1.245.26.1 +3 -3
+ NTP_4_2_6P3_RC10
+
+ ntpq/ntpq-opts.texi@1.244.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpq/ntpq.1@1.244.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.27.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.27.1 +3 -3
+ NTP_4_2_6P3_RC10
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.27.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ ntpsnmpd/ntpsnmpd.1@1.122.27.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ packageinfo.sh@1.255.28.1 +1 -1
+ NTP_4_2_6P3_RC10
+
+ sntp/sntp-opts.c@1.117.26.1 +3 -3
+ NTP_4_2_6P3_RC10
+
+ sntp/sntp-opts.h@1.117.26.1 +3 -3
+ NTP_4_2_6P3_RC10
+
+ sntp/sntp-opts.texi@1.117.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ sntp/sntp.1@1.117.26.1 +3 -5
+ NTP_4_2_6P3_RC10
+
+ sntp/sntp.html@1.7.26.1 +1 -1
+ NTP_4_2_6P3_RC10
+
+ util/ntp-keygen-opts.c@1.247.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ util/ntp-keygen-opts.h@1.247.26.1 +3 -3
+ NTP_4_2_6P3_RC10
+
+ util/ntp-keygen-opts.texi@1.246.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ util/ntp-keygen.1@1.246.26.1 +2 -2
+ NTP_4_2_6P3_RC10
+
+ChangeSet@1.2082.4.151, 2010-11-14 03:23:12-05:00, stenn@deacon.udel.edu
+ Update NEWS file for changes thru RC10
+
+ NEWS@1.112 +24 -15
+ Update NEWS file for changes thru RC10
+
+ChangeSet@1.2269, 2010-11-14 07:38:20+00:00, davehart@shiny.ad.hartbrothers.com
+ temporarily disable sntp unit tests that need rework after changes to use msyslog
+
+ sntp/tests/logFile.cpp@1.6 +2 -0
+ temporarily disable sntp unit tests that need rework after changes to use msyslog
+
+ sntp/tests/sntptest.cpp@1.3 +0 -1
+ we need the progname to match sntp to ease comparing output
+
+ChangeSet@1.2082.4.150, 2010-11-14 07:00:29+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1681] More sntp logging cleanup.
+
+ ChangeLog@1.496.26.111 +1 -0
+ [Bug 1681] More sntp logging cleanup.
+
+ include/ntp_syslog.h@1.3.1.1 +3 -1
+ expose msyslog_term flag to duplicate msyslog() output to stdout/stderr
+
+ libntp/msyslog.c@1.24.1.1 +52 -38
+ expose msyslog_term flag to duplicate msyslog() output to stdout/stderr
+
+ sntp/crypto.c@1.10.1.5 +2 -24
+ [Bug 1681] More sntp logging cleanup.
+
+ sntp/kod_management.c@1.16.1.3 +11 -35
+ [Bug 1681] More sntp logging cleanup.
+
+ sntp/log.c@1.11.1.3 +39 -44
+ [Bug 1681] More sntp logging cleanup.
+
+ sntp/log.h@1.9 +15 -6
+ [Bug 1681] More sntp logging cleanup.
+
+ sntp/main.c@1.24.1.6 +34 -39
+ [Bug 1681] More sntp logging cleanup.
+
+ sntp/main.h@1.2 +0 -1
+ move config.h include to main.c for consistency and because it has no
+ multiple-inclusion guard.
+
+ sntp/networking.c@1.29.1.10 +14 -14
+ [Bug 1681] More sntp logging cleanup.
+
+ sntp/sntp-opts.def@1.16 +2 -4
+ update RFC status
+
+ sntp/sntp.c@1.2 +2 -1
+ #include <config.h> first
+
+ChangeSet@1.2267, 2010-11-11 20:37:23+00:00, davehart@shiny.ad.hartbrothers.com
+ fix merge typo
+
+ ntpd/ntp_config.c@1.271 +2 -19
+ merge cleanup -- -dev only uses of is_ip_address()
+
+ ntpd/ntp_io.c@1.327 +1 -1
+ fix merge typo
+
+ChangeSet@1.2082.4.149, 2010-11-11 19:20:40+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1683] Non-localhost on loopback exempted from nic rules.
+
+ ChangeLog@1.496.26.110 +4 -0
+ [Bug 1683] Non-localhost on loopback exempted from nic rules.
+
+ include/ntp.h@1.168.1.2 +1 -1
+ nail down size of struct interface.flags to 32 bits.
+
+ include/ntp_io.h@1.13.1.1 +1 -1
+ [Bug 1683] Non-localhost on loopback exempted from nic rules.
+
+ ntpd/ntp_config.c@1.241.1.6 +13 -11
+ [Bug 1683] Non-localhost on loopback exempted from nic rules.
+
+ ntpd/ntp_io.c@1.306.1.8 +72 -58
+ [Bug 1683] Non-localhost on loopback exempted from nic rules.
+
+ ntpd/ntpd.c@1.110.2.1 +3 -3
+ [Bug 1683] Non-localhost on loopback exempted from nic rules.
+
+ChangeSet@1.2254.1.2, 2010-11-10 19:29:43+01:00, jnperlin@hydra.localnet
+ fixed doc error, improved comments
+
+ html/drivers/driver20.html@1.22 +1 -1
+ fixed wrong mode bit nuber
+
+ ntpd/refclock_nmea.c@1.56 +7 -4
+ changed / moved comments for better strategic grouping
+
+ChangeSet@1.2265, 2010-11-10 05:44:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P80
+ TAG: NTP_4_2_7P80
+
+ ChangeLog@1.650 +1 -0
+ NTP_4_2_7P80
+
+ ntpd/ntpd-opts.c@1.83 +2 -2
+ NTP_4_2_7P80
+
+ ntpd/ntpd-opts.h@1.83 +3 -3
+ NTP_4_2_7P80
+
+ ntpd/ntpd-opts.texi@1.82 +2 -2
+ NTP_4_2_7P80
+
+ ntpd/ntpd.1@1.82 +2 -2
+ NTP_4_2_7P80
+
+ ntpdc/ntpdc-opts.c@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpdc/ntpdc-opts.h@1.81 +3 -3
+ NTP_4_2_7P80
+
+ ntpdc/ntpdc-opts.texi@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpdc/ntpdc.1@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpq/ntpq-opts.c@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpq/ntpq-opts.h@1.81 +3 -3
+ NTP_4_2_7P80
+
+ ntpq/ntpq-opts.texi@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpq/ntpq.1@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.81 +3 -3
+ NTP_4_2_7P80
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.81 +2 -2
+ NTP_4_2_7P80
+
+ ntpsnmpd/ntpsnmpd.1@1.81 +2 -2
+ NTP_4_2_7P80
+
+ packageinfo.sh@1.82 +1 -1
+ NTP_4_2_7P80
+
+ sntp/sntp-opts.c@1.81 +2 -2
+ NTP_4_2_7P80
+
+ sntp/sntp-opts.h@1.81 +3 -3
+ NTP_4_2_7P80
+
+ sntp/sntp-opts.texi@1.81 +1 -1
+ NTP_4_2_7P80
+
+ sntp/sntp.1@1.81 +2 -2
+ NTP_4_2_7P80
+
+ sntp/sntp.html@1.81 +1 -1
+ NTP_4_2_7P80
+
+ util/ntp-keygen-opts.c@1.78 +2 -2
+ NTP_4_2_7P80
+
+ util/ntp-keygen-opts.h@1.78 +3 -3
+ NTP_4_2_7P80
+
+ util/ntp-keygen-opts.texi@1.81 +2 -2
+ NTP_4_2_7P80
+
+ util/ntp-keygen.1@1.81 +2 -2
+ NTP_4_2_7P80
+
+ChangeSet@1.2082.4.148, 2010-11-10 03:48:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC9
+ TAG: NTP_4_2_6P3_RC9
+
+ ChangeLog@1.496.26.109 +1 -0
+ NTP_4_2_6P3_RC9
+
+ ntpd/ntpd-opts.c@1.248.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpd/ntpd-opts.h@1.248.25.1 +3 -3
+ NTP_4_2_6P3_RC9
+
+ ntpd/ntpd-opts.texi@1.246.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpd/ntpd.1@1.246.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpdc/ntpdc-opts.c@1.244.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpdc/ntpdc-opts.h@1.244.25.1 +3 -3
+ NTP_4_2_6P3_RC9
+
+ ntpdc/ntpdc-opts.texi@1.243.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpdc/ntpdc.1@1.243.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpq/ntpq-opts.c@1.245.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpq/ntpq-opts.h@1.245.25.1 +3 -3
+ NTP_4_2_6P3_RC9
+
+ ntpq/ntpq-opts.texi@1.244.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpq/ntpq.1@1.244.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.26.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.26.1 +3 -3
+ NTP_4_2_6P3_RC9
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.26.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ ntpsnmpd/ntpsnmpd.1@1.122.26.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ packageinfo.sh@1.255.27.1 +1 -1
+ NTP_4_2_6P3_RC9
+
+ sntp/sntp-opts.c@1.117.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ sntp/sntp-opts.h@1.117.25.1 +3 -3
+ NTP_4_2_6P3_RC9
+
+ sntp/sntp-opts.texi@1.117.25.1 +1 -1
+ NTP_4_2_6P3_RC9
+
+ sntp/sntp.1@1.117.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ sntp/sntp.html@1.7.25.1 +1 -1
+ NTP_4_2_6P3_RC9
+
+ util/ntp-keygen-opts.c@1.247.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ util/ntp-keygen-opts.h@1.247.25.1 +3 -3
+ NTP_4_2_6P3_RC9
+
+ util/ntp-keygen-opts.texi@1.246.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ util/ntp-keygen.1@1.246.25.1 +2 -2
+ NTP_4_2_6P3_RC9
+
+ChangeSet@1.2082.4.147, 2010-11-09 22:07:27-05:00, stenn@deacon.udel.edu
+ Backport sntp from -dev
+
+ ChangeLog@1.496.26.108 +1 -0
+ Backport sntp from -dev
+
+ChangeSet@1.2262, 2010-11-10 02:52:31+00:00, davehart@shiny.ad.hartbrothers.com
+ pave the way for pulling -stable backport which has these as new files
+
+ BitKeeper/deleted/.del-main.h~17d37ce1cf2a5389@1.4 +0 -0
+ Delete: sntp/main.h
+
+ BitKeeper/deleted/.del-ntp_lib_m.m4~bbfbbd5c5add8c5@1.4 +0 -0
+ Delete: m4/ntp_lib_m.m4
+
+ BitKeeper/deleted/.del-sntp.c~ef953de048542b83@1.3 +0 -0
+ Delete: sntp/sntp.c
+
+ChangeSet@1.2082.4.146, 2010-11-10 02:29:39+00:00, davehart@shiny.ad.hartbrothers.com
+ Backport sntp changes from -dev
+
+ m4/ntp_lib_m.m4@1.1 +16 -0
+ Backport sntp changes from -dev
+
+ m4/ntp_lib_m.m4@1.0 +0 -0
+
+ sntp/Makefile.am@1.21.1.9 +3 -1
+ Backport sntp changes from -dev
+
+ sntp/configure.ac@1.31.1.3 +1 -0
+ Backport sntp changes from -dev
+
+ sntp/crypto.c@1.10.1.4 +1 -0
+ Backport sntp changes from -dev
+
+ sntp/header.h@1.4.1.1 +1 -1
+ Backport sntp changes from -dev
+
+ sntp/kod_management.c@1.16.1.2 +2 -1
+ Backport sntp changes from -dev
+
+ sntp/log.c@1.11.1.2 +3 -2
+ Backport sntp changes from -dev
+
+ sntp/main.c@1.24.1.5 +191 -166
+ Backport sntp changes from -dev
+
+ sntp/main.h@1.1 +29 -0
+ Backport sntp changes from -dev
+
+ sntp/main.h@1.0 +0 -0
+
+ sntp/networking.c@1.29.1.9 +22 -20
+ Backport sntp changes from -dev
+
+ sntp/networking.h@1.18.2.1 +13 -3
+ Backport sntp changes from -dev
+
+ sntp/sntp.c@1.1 +13 -0
+ Backport sntp changes from -dev
+
+ sntp/sntp.c@1.0 +0 -0
+
+ sntp/utilities.c@1.10.1.2 +14 -14
+ Backport sntp changes from -dev
+
+ChangeSet@1.2261, 2010-11-09 23:32:32+00:00, stenn@psp-fb1.ntp.org
+ ChangeLog:
+ [Bug 1708] "make check" fails with googletest 1.4.0
+ [Bug 1718] Improve gtest checks in configure.ac
+
+ ChangeLog@1.648 +2 -0
+ [Bug 1708] "make check" fails with googletest 1.4.0
+ [Bug 1718] Improve gtest checks in configure.ac
+ l
+
+ configure.ac@1.495 +38 -12
+
+ sntp/configure.ac@1.42 +39 -12
+
+ChangeSet@1.2082.37.1, 2010-11-09 16:50:10-05:00, stenn@deacon.udel.edu
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ ChangeLog@1.496.57.1 +4 -0
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ scripts/checkChangeLog@1.1.2.1 +1 -1
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ scripts/genCommitLog@1.5.1.1 +1 -1
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ChangeSet@1.2259, 2010-11-09 20:08:29+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1715] sntp utilitiesTest.IPv6Address failed.
+
+ ChangeLog@1.646 +1 -0
+ [Bug 1715] sntp utilitiesTest.IPv6Address failed.
+
+ sntp/tests/utilities.cpp@1.5 +11 -17
+ Nonfunctional (whitespace, use SIZEOF_SOCKADDR(), declare locals first).
+
+ sntp/utilities.c@1.13 +13 -14
+ [Bug 1715] sntp utilitiesTest.IPv6Address failed.
+
+ChangeSet@1.2252.1.1, 2010-11-09 19:38:19+01:00, jnperlin@hydra.localnet
+ reformed NMEA driver implementation and doc
+
+ html/drivers/driver20.html@1.21 +341 -99
+ updated / extended doc
+
+ ntpd/refclock_nmea.c@1.55 +712 -537
+ restructured ('reformed') driver
+
+ChangeSet@1.2082.4.144, 2010-11-09 06:01:12+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct missing leading zeros in sntp tv_usec display from tv_to_str().
+
+ sntp/utilities.c@1.10.1.1 +1 -1
+ Correct missing leading zeros in sntp tv_usec display from tv_to_str().
+
+ChangeSet@1.2082.4.143, 2010-11-09 05:52:27+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1681] sntp logging cleanup.
+
+ ChangeLog@1.496.26.106 +1 -0
+ [Bug 1681] sntp logging cleanup.
+
+ sntp/kod_management.c@1.16.1.1 +4 -4
+ [Bug 1681] sntp logging cleanup.
+
+ sntp/log.c@1.11.1.1 +3 -18
+ [Bug 1681] sntp logging cleanup.
+
+ sntp/log.h@1.8 +1 -1
+ [Bug 1681] sntp logging cleanup.
+
+ sntp/main.c@1.24.1.4 +4 -4
+ [Bug 1681] sntp logging cleanup.
+
+ sntp/networking.c@1.29.1.8 +1 -1
+ [Bug 1681] sntp logging cleanup.
+
+ChangeSet@1.2257, 2010-11-09 05:14:53+00:00, davehart@shiny.ad.hartbrothers.com
+ merge from -stable cleanup
+
+ ntpd/ntp_io.c@1.325 +1 -2
+ repair merge from -stable -- getinterface() is no longer static in -dev
+
+ sntp/main.c@1.35 +0 -9
+ merge from -stable repair -- sntp's main() has moved to sntp.c in -dev
+
+ChangeSet@1.2082.4.140, 2010-11-09 04:40:06+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1691] Use first NMEA sentence each second.
+ -- applies to prior cset
+
+ ChangeLog@1.496.56.1 +4 -0
+ [Bug 1691] Use first NMEA sentence each second.
+
+ChangeSet@1.2082.36.1, 2010-11-09 04:26:03+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps.
+
+ ChangeLog@1.496.55.1 +5 -0
+ [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps.
+
+ ntpdate/ntpdate.c@1.69.2.1 +1 -2
+ [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps.
+
+ChangeSet@1.2082.35.1, 2010-11-09 03:52:20+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1574] sntp:set_time doesn't set tv_usec correctly.
+
+ ChangeLog@1.496.54.1 +4 -0
+ [Bug 1574] sntp:set_time doesn't set tv_usec correctly.
+
+ sntp/main.c@1.24.1.3 +23 -8
+ [Bug 1574] sntp:set_time doesn't set tv_usec correctly.
+
+ChangeSet@1.2082.34.1, 2010-11-09 03:14:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1683] Interface binding does not seem to work as intended.
+
+ ChangeLog@1.496.26.102 +4 -0
+ [Bug 1683] Interface binding does not seem to work as intended.
+
+ include/ntp_machine.h@1.26.2.1 +3 -0
+ add socket_errno() to reduce #ifdef clutter
+
+ ntpd/ntp_io.c@1.306.1.7 +175 -125
+ [Bug 1683] Interface binding does not seem to work as intended.
+
+ChangeSet@1.2082.33.1, 2010-11-08 18:26:21+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps.
+
+ ntpdate/ntpdate.c@1.69.1.2 +1 -2
+ [Bug 1709] ntpdate ignores replies with equal receive and transmit timestamps.
+
+ChangeSet@1.2254, 2010-11-07 02:15:51+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P79
+ TAG: NTP_4_2_7P79
+
+ ChangeLog@1.643 +1 -0
+ NTP_4_2_7P79
+
+ ntpd/ntpd-opts.c@1.82 +2 -2
+ NTP_4_2_7P79
+
+ ntpd/ntpd-opts.h@1.82 +3 -3
+ NTP_4_2_7P79
+
+ ntpd/ntpd-opts.texi@1.81 +2 -2
+ NTP_4_2_7P79
+
+ ntpd/ntpd.1@1.81 +2 -2
+ NTP_4_2_7P79
+
+ ntpdc/ntpdc-opts.c@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpdc/ntpdc-opts.h@1.80 +3 -3
+ NTP_4_2_7P79
+
+ ntpdc/ntpdc-opts.texi@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpdc/ntpdc.1@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpq/ntpq-opts.c@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpq/ntpq-opts.h@1.80 +3 -3
+ NTP_4_2_7P79
+
+ ntpq/ntpq-opts.texi@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpq/ntpq.1@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.80 +3 -3
+ NTP_4_2_7P79
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.80 +2 -2
+ NTP_4_2_7P79
+
+ ntpsnmpd/ntpsnmpd.1@1.80 +2 -2
+ NTP_4_2_7P79
+
+ packageinfo.sh@1.81 +1 -1
+ NTP_4_2_7P79
+
+ sntp/sntp-opts.c@1.80 +2 -2
+ NTP_4_2_7P79
+
+ sntp/sntp-opts.h@1.80 +3 -3
+ NTP_4_2_7P79
+
+ sntp/sntp-opts.texi@1.80 +1 -1
+ NTP_4_2_7P79
+
+ sntp/sntp.1@1.80 +2 -2
+ NTP_4_2_7P79
+
+ sntp/sntp.html@1.80 +1 -1
+ NTP_4_2_7P79
+
+ util/ntp-keygen-opts.c@1.77 +2 -2
+ NTP_4_2_7P79
+
+ util/ntp-keygen-opts.h@1.77 +3 -3
+ NTP_4_2_7P79
+
+ util/ntp-keygen-opts.texi@1.80 +2 -2
+ NTP_4_2_7P79
+
+ util/ntp-keygen.1@1.80 +2 -2
+ NTP_4_2_7P79
+
+ChangeSet@1.2253, 2010-11-06 22:00:48-04:00, stenn@deacon.udel.edu
+ Correct frequency estimate with no drift file, from David Mills
+
+ ChangeLog@1.642 +1 -0
+ Correct frequency estimate with no drift file, from David Mills
+
+ ntpd/ntp_loopfilter.c@1.161 +1 -1
+ Correct frequency estimate with no drift file, from David Mills
+
+ChangeSet@1.2252, 2010-11-04 10:10:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P78
+ TAG: NTP_4_2_7P78
+
+ ChangeLog@1.641 +1 -0
+ NTP_4_2_7P78
+
+ ntpd/ntpd-opts.c@1.81 +2 -2
+ NTP_4_2_7P78
+
+ ntpd/ntpd-opts.h@1.81 +3 -3
+ NTP_4_2_7P78
+
+ ntpd/ntpd-opts.texi@1.80 +2 -2
+ NTP_4_2_7P78
+
+ ntpd/ntpd.1@1.80 +2 -2
+ NTP_4_2_7P78
+
+ ntpdc/ntpdc-opts.c@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpdc/ntpdc-opts.h@1.79 +3 -3
+ NTP_4_2_7P78
+
+ ntpdc/ntpdc-opts.texi@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpdc/ntpdc.1@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpq/ntpq-opts.c@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpq/ntpq-opts.h@1.79 +3 -3
+ NTP_4_2_7P78
+
+ ntpq/ntpq-opts.texi@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpq/ntpq.1@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.79 +3 -3
+ NTP_4_2_7P78
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.79 +2 -2
+ NTP_4_2_7P78
+
+ ntpsnmpd/ntpsnmpd.1@1.79 +2 -2
+ NTP_4_2_7P78
+
+ packageinfo.sh@1.80 +1 -1
+ NTP_4_2_7P78
+
+ sntp/sntp-opts.c@1.79 +2 -2
+ NTP_4_2_7P78
+
+ sntp/sntp-opts.h@1.79 +3 -3
+ NTP_4_2_7P78
+
+ sntp/sntp-opts.texi@1.79 +1 -1
+ NTP_4_2_7P78
+
+ sntp/sntp.1@1.79 +2 -2
+ NTP_4_2_7P78
+
+ sntp/sntp.html@1.79 +1 -1
+ NTP_4_2_7P78
+
+ util/ntp-keygen-opts.c@1.76 +2 -2
+ NTP_4_2_7P78
+
+ util/ntp-keygen-opts.h@1.76 +3 -3
+ NTP_4_2_7P78
+
+ util/ntp-keygen-opts.texi@1.79 +2 -2
+ NTP_4_2_7P78
+
+ util/ntp-keygen.1@1.79 +2 -2
+ NTP_4_2_7P78
+
+ChangeSet@1.2251, 2010-11-04 03:05:07-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.640 +1 -0
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.5 +28 -4
+ Documentation updates from Dave Mills
+
+ html/pps.html@1.23 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2250, 2010-11-04 02:24:39+00:00, hart@psp-deb1.ntp.org
+ Makefile.am:
+ move test-driver from EXTRA_DIST to noinst_check_SCRIPTS
+
+ sntp/tests/Makefile.am@1.16 +3 -3
+ move test-driver from EXTRA_DIST to noinst_check_SCRIPTS
+
+ChangeSet@1.2249, 2010-11-04 00:06:45+00:00, davehart@shiny.ad.hartbrothers.com
+ fix make distcheck with gtest by distributing test pieces
+
+ sntp/Makefile.am@1.37 +1 -0
+ fix make distcheck with gtest by distributing test pieces
+
+ sntp/tests/Makefile.am@1.15 +35 -11
+ fix make distcheck with gtest by distributing test pieces.
+ get rid of most tabs in INCLUDES which show up in command lines.
+
+ tests/libntp/Makefile.am@1.24 +3 -0
+ fix make distcheck with gtest by distributing test pieces
+
+ChangeSet@1.2248, 2010-11-03 21:24:43+00:00, davehart@shiny.ad.hartbrothers.com
+ Add ChangeLog entries, Windows build tweaks to Juergen Perlinger's
+ calendar refactoring and [Bug 1697]
+
+ ChangeLog@1.639 +2 -0
+ [Bug 1697] filegen implementation should be improved.
+ Refactor calendar functions in terms of new common code.
+
+
+ configure.ac@1.494 +4 -3
+ Add sizeof(short) test since we now depend on SIZEOF_SHORT
+
+ ports/winnt/include/config.h@1.89 +1 -0
+ add SIZEOF_SHORT needed by perlinger's calendar changes
+
+ ports/winnt/vc6/libntp.dsp@1.53 +4 -0
+ add libntp/ntp_calendar.c to Windows build
+
+ ports/winnt/vs2003/libntp.vcproj@1.11 +21 -0
+ add libntp/ntp_calendar.c to Windows build
+
+ ports/winnt/vs2005/libntp.vcproj@1.9 +22 -0
+ add libntp/ntp_calendar.c to Windows build
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.30 +6 -2
+ add libntp/ntp_calendar.c to Windows build
+
+ sntp/configure.ac@1.41 +1 -0
+ Add sizeof(short) test since we now depend on SIZEOF_SHORT
+
+ sntp/tests/crypto.cpp@1.4 +4 -0
+ conditionalize tests that only work with OPENSSL
+
+ tests/libntp/a_md5encrypt.cpp@1.4 +5 -0
+ ensure NID_md5 is defined (by openssl headers or ntp_stdlib.h)
+
+ tests/libntp/authkeys.cpp@1.6 +5 -0
+ ensure NID_md5 is defined (by openssl headers or ntp_stdlib.h)
+
+ tests/libntp/refnumtoa.cpp@1.2 +4 -0
+ conditionalize tests that require REFCLOCK
+
+ tests/libntp/ssl_init.cpp@1.3 +9 -0
+ ensure NID_md5 is defined (by openssl headers or ntp_stdlib.h)
+ conditionalize tests that only work with OPENSSL
+
+ChangeSet@1.2243.1.3, 2010-11-03 19:42:16+01:00, jnperlin@hydra.localnet
+ added calendar regression tests, fixed german umlaut mixup
+
+ include/ntp_filegen.h@1.9 +1 -1
+ fixed german umlaut codepage problem
+
+ libntp/ntp_calendar.c@1.2 +11 -73
+ removed runtime assert, since regression test is available
+
+ ntpd/ntp_filegen.c@1.21 +1 -1
+ fixed german umlaut codepage problem
+
+ tests/libntp/Makefile.am@1.23 +1 -0
+ added calendar regression tests
+
+ tests/libntp/calendar.cpp@1.1 +337 -0
+ calendar module regression tests
+
+ tests/libntp/calendar.cpp@1.0 +0 -0
+
+ChangeSet@1.2246, 2010-11-03 10:10:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P77
+ TAG: NTP_4_2_7P77
+
+ ChangeLog@1.638 +1 -0
+ NTP_4_2_7P77
+
+ ntpd/ntpd-opts.c@1.80 +2 -2
+ NTP_4_2_7P77
+
+ ntpd/ntpd-opts.h@1.80 +3 -3
+ NTP_4_2_7P77
+
+ ntpd/ntpd-opts.texi@1.79 +2 -2
+ NTP_4_2_7P77
+
+ ntpd/ntpd.1@1.79 +2 -2
+ NTP_4_2_7P77
+
+ ntpdc/ntpdc-opts.c@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpdc/ntpdc-opts.h@1.78 +3 -3
+ NTP_4_2_7P77
+
+ ntpdc/ntpdc-opts.texi@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpdc/ntpdc.1@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpq/ntpq-opts.c@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpq/ntpq-opts.h@1.78 +3 -3
+ NTP_4_2_7P77
+
+ ntpq/ntpq-opts.texi@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpq/ntpq.1@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.78 +3 -3
+ NTP_4_2_7P77
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.78 +2 -2
+ NTP_4_2_7P77
+
+ ntpsnmpd/ntpsnmpd.1@1.78 +2 -2
+ NTP_4_2_7P77
+
+ packageinfo.sh@1.79 +1 -1
+ NTP_4_2_7P77
+
+ sntp/sntp-opts.c@1.78 +2 -2
+ NTP_4_2_7P77
+
+ sntp/sntp-opts.h@1.78 +3 -3
+ NTP_4_2_7P77
+
+ sntp/sntp-opts.texi@1.78 +1 -1
+ NTP_4_2_7P77
+
+ sntp/sntp.1@1.78 +2 -2
+ NTP_4_2_7P77
+
+ sntp/sntp.html@1.78 +1 -1
+ NTP_4_2_7P77
+
+ util/ntp-keygen-opts.c@1.75 +2 -2
+ NTP_4_2_7P77
+
+ util/ntp-keygen-opts.h@1.75 +3 -3
+ NTP_4_2_7P77
+
+ util/ntp-keygen-opts.texi@1.78 +2 -2
+ NTP_4_2_7P77
+
+ util/ntp-keygen.1@1.78 +2 -2
+ NTP_4_2_7P77
+
+ChangeSet@1.2243.3.1, 2010-11-02 21:46:55-04:00, stenn@deacon.udel.edu
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ ChangeLog@1.635.1.1 +1 -0
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ scripts/checkChangeLog@1.1.1.1 +1 -1
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ scripts/genCommitLog@1.6 +1 -1
+ [Bug 1692] packageinfo.sh needs to be "sourced" using ./
+
+ChangeSet@1.2243.1.2, 2010-11-02 20:21:30+01:00, jnperlin@hydra.localnet
+ fixes for regression test
+
+ libntp/prettydate.c@1.16 +2 -2
+ changed format string back according to regression test expectation
+
+ libntp/ymd2yd.c@1.5 +13 -25
+ rewritten in terms of low-level calendar function
+
+ scripts/checkChangeLog@1.2 +1 -1
+ added path spec to '.' (source) command -- sh balked about it
+
+ tests/libntp/calyearstart.cpp@1.2 +14 -15
+ fixed testcases for new calyearstart() API
+
+ChangeSet@1.2243.2.1, 2010-11-02 18:55:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1695] ntpdate takes longer than necessary.
+
+ ChangeLog@1.636 +1 -0
+ [Bug 1695] ntpdate takes longer than necessary.
+
+ ntpdate/ntpdate.c@1.75 +11 -0
+ [Bug 1695] ntpdate takes longer than necessary.
+
+ChangeSet@1.2156.20.1, 2010-11-02 07:12:48+01:00, jnperlin@hydra.localnet
+ added modular calendar functions
+
+ include/ntp_calendar.h@1.5 +278 -23
+ added prototypes for modular calendar functions
+
+ include/ntp_filegen.h@1.8 +5 -4
+ fixed prototypes to use u_int32 for NTP timestamps
+
+ include/ntp_fp.h@1.22 +1 -1
+ fixed prototypes to use u_int32 for NTP timestamps
+
+ include/ntp_stdlib.h@1.48 +12 -2
+ fixed prototypes to use u_int32 for NTP timestamps; added functions for start of month/week/day
+
+ include/ntp_types.h@1.20 +92 -1
+ added 'vint64' type definition
+
+ include/ntp_unixtime.h@1.7 +5 -0
+ added multiple inclusion guard
+
+ libntp/Makefile.am@1.53 +1 -0
+ added calendar module
+
+ libntp/caljulian.c@1.13 +15 -173
+ rewritten in terms of modular calendar
+
+ libntp/caltontp.c@1.5 +19 -57
+ rewritten in terms of modular calendar
+
+ libntp/calyearstart.c@1.6 +70 -39
+ rewritten in terms of modular calendar; added month/wee/day start fuctions
+
+ libntp/clocktime.c@1.4 +128 -94
+ rewritten in terms of modular calendar; changed algorithm to *always* find the smallest difference solution for a time-of-year spec.
+
+ libntp/ntp_calendar.c@1.1 +1390 -0
+ modular calendar functions
+
+ libntp/ntp_calendar.c@1.0 +0 -0
+
+ libntp/prettydate.c@1.15 +149 -123
+ rewritten in terms of modular calendar
+
+ ntpd/ntp_filegen.c@1.20 +126 -126
+ minimise calendar calculations
+
+ ntpd/ntp_util.c@1.86 +35 -56
+ changed 'leap_month' to use modular alendar
+
+ChangeSet@1.2244, 2010-11-02 01:31:41-04:00, stenn@deacon.udel.edu
+ Distribute the test/ subdir
+
+ Makefile.am@1.98 +1 -3
+ Distribute the test/ subdir
+
+ChangeSet@1.2243, 2010-11-02 04:50:36+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P76
+ TAG: NTP_4_2_7P76
+
+ ChangeLog@1.635 +1 -0
+ NTP_4_2_7P76
+
+ ntpd/ntpd-opts.c@1.79 +2 -2
+ NTP_4_2_7P76
+
+ ntpd/ntpd-opts.h@1.79 +3 -3
+ NTP_4_2_7P76
+
+ ntpd/ntpd-opts.texi@1.78 +2 -2
+ NTP_4_2_7P76
+
+ ntpd/ntpd.1@1.78 +2 -2
+ NTP_4_2_7P76
+
+ ntpdc/ntpdc-opts.c@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpdc/ntpdc-opts.h@1.77 +3 -3
+ NTP_4_2_7P76
+
+ ntpdc/ntpdc-opts.texi@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpdc/ntpdc.1@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpq/ntpq-opts.c@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpq/ntpq-opts.h@1.77 +3 -3
+ NTP_4_2_7P76
+
+ ntpq/ntpq-opts.texi@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpq/ntpq.1@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.77 +3 -3
+ NTP_4_2_7P76
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.77 +2 -2
+ NTP_4_2_7P76
+
+ ntpsnmpd/ntpsnmpd.1@1.77 +2 -2
+ NTP_4_2_7P76
+
+ packageinfo.sh@1.78 +1 -1
+ NTP_4_2_7P76
+
+ sntp/sntp-opts.c@1.77 +2 -2
+ NTP_4_2_7P76
+
+ sntp/sntp-opts.h@1.77 +3 -3
+ NTP_4_2_7P76
+
+ sntp/sntp-opts.texi@1.77 +1 -1
+ NTP_4_2_7P76
+
+ sntp/sntp.1@1.77 +2 -2
+ NTP_4_2_7P76
+
+ sntp/sntp.html@1.77 +1 -1
+ NTP_4_2_7P76
+
+ util/ntp-keygen-opts.c@1.74 +2 -2
+ NTP_4_2_7P76
+
+ util/ntp-keygen-opts.h@1.74 +3 -3
+ NTP_4_2_7P76
+
+ util/ntp-keygen-opts.texi@1.77 +2 -2
+ NTP_4_2_7P76
+
+ util/ntp-keygen.1@1.77 +2 -2
+ NTP_4_2_7P76
+
+ChangeSet@1.2242, 2010-11-01 00:46:10-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.634 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.5 +9 -7
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.66 +16 -16
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.4 +10 -9
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.22 +9 -3
+ Documentation updates from Dave Mills
+
+ html/scripts/external.txt@1.5 +1 -0
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2240, 2010-11-01 00:29:29-04:00, stenn@deacon.udel.edu
+ [Bug 1692] in sntp/, -lrt may only be needed in tests/
+
+ sntp/configure.ac@1.40 +1 -0
+ [Bug 1692] in sntp/, -lrt may only be needed in tests/
+
+ChangeSet@1.2238.1.2, 2010-11-01 00:23:48+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog entry for [Bug 1691] -dev first
+
+ ChangeLog@1.631.1.1 +1 -0
+ [Bug 1691] Use first NMEA sentence each second.
+
+ChangeSet@1.2082.4.139, 2010-11-01 00:22:07+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1691] Use first NMEA sentence each second.
+
+ ntpd/refclock_nmea.c@1.46.1.10 +26 -9
+ [Bug 1691] Use first NMEA sentence each second.
+
+ChangeSet@1.2239, 2010-10-31 07:57:32-04:00, karlsson@psp-deb1.ntp.org
+ [BUG 1690] Unit tests fails to build on some systems
+
+ ChangeLog@1.632 +1 -0
+ [BUG 1690] Unit tests fails to build on some systems
+
+ sntp/configure.ac@1.39 +18 -0
+ [BUG 1690] Unit tests fails to build on some systems
+
+ChangeSet@1.2238, 2010-10-31 01:30:37-04:00, stenn@deacon.udel.edu
+ Only build/run the sntp tests if we have gtest
+
+ ChangeLog@1.631 +1 -0
+ Only build/run the sntp tests if we have gtest
+
+ sntp/Makefile.am@1.36 +3 -0
+ Only build/run the sntp tests if we have gtest
+
+ChangeSet@1.2235.1.1, 2010-10-30 20:28:54-07:00, harlan@hms-mbp.lan
+ Put the sntp tests under sntp/
+ ---
+ Put the sntp tests under sntp/
+
+ ChangeLog@1.628.1.1 +1 -0
+ Put the sntp tests under sntp/
+
+ configure.ac@1.493 +0 -1
+ Put the sntp tests under sntp/
+
+ sntp/Makefile.am@1.35 +1 -0
+ Put the sntp tests under sntp/
+
+ sntp/configure.ac@1.38 +20 -0
+ Put the sntp tests under sntp/
+
+ sntp/tests/Makefile.am@1.14 +19 -17
+ Put the sntp tests under sntp/
+
+ sntp/tests/Makefile.am@1.13 +0 -0
+ Rename: tests/sntp/Makefile.am -> sntp/tests/Makefile.am
+
+ sntp/tests/crypto.cpp@1.3 +0 -0
+ Rename: tests/sntp/crypto.cpp -> sntp/tests/crypto.cpp
+
+ sntp/tests/data/debug-input-lfp-bin@1.2 +0 -0
+ Rename: tests/sntp/data/debug-input-lfp-bin -> sntp/tests/data/debug-input-lfp-bin
+
+ sntp/tests/data/debug-input-lfp-dec@1.2 +0 -0
+ Rename: tests/sntp/data/debug-input-lfp-dec -> sntp/tests/data/debug-input-lfp-dec
+
+ sntp/tests/data/debug-input-lfp-hex@1.2 +0 -0
+ Rename: tests/sntp/data/debug-input-lfp-hex -> sntp/tests/data/debug-input-lfp-hex
+
+ sntp/tests/data/debug-input-pkt@1.2 +0 -0
+ Rename: tests/sntp/data/debug-input-pkt -> sntp/tests/data/debug-input-pkt
+
+ sntp/tests/data/key-test-ascii@1.2 +0 -0
+ Rename: tests/sntp/data/key-test-ascii -> sntp/tests/data/key-test-ascii
+
+ sntp/tests/data/key-test-comments@1.2 +0 -0
+ Rename: tests/sntp/data/key-test-comments -> sntp/tests/data/key-test-comments
+
+ sntp/tests/data/key-test-empty@1.2 +0 -0
+ Rename: tests/sntp/data/key-test-empty -> sntp/tests/data/key-test-empty
+
+ sntp/tests/data/key-test-hex@1.2 +0 -0
+ Rename: tests/sntp/data/key-test-hex -> sntp/tests/data/key-test-hex
+
+ sntp/tests/data/key-test-invalid-hex@1.2 +0 -0
+ Rename: tests/sntp/data/key-test-invalid-hex -> sntp/tests/data/key-test-invalid-hex
+
+ sntp/tests/data/kod-expected-multiple@1.2 +0 -0
+ Rename: tests/sntp/data/kod-expected-multiple -> sntp/tests/data/kod-expected-multiple
+
+ sntp/tests/data/kod-expected-single@1.2 +0 -0
+ Rename: tests/sntp/data/kod-expected-single -> sntp/tests/data/kod-expected-single
+
+ sntp/tests/data/kod-test-blanks@1.3 +0 -0
+ Rename: tests/sntp/data/kod-test-blanks -> sntp/tests/data/kod-test-blanks
+
+ sntp/tests/data/kod-test-correct@1.3 +0 -0
+ Rename: tests/sntp/data/kod-test-correct -> sntp/tests/data/kod-test-correct
+
+ sntp/tests/data/kod-test-empty@1.2 +0 -0
+ Rename: tests/sntp/data/kod-test-empty -> sntp/tests/data/kod-test-empty
+
+ sntp/tests/data/log-expected-debug@1.2 +0 -0
+ Rename: tests/sntp/data/log-expected-debug -> sntp/tests/data/log-expected-debug
+
+ sntp/tests/data/log-expected-log@1.2 +0 -0
+ Rename: tests/sntp/data/log-expected-log -> sntp/tests/data/log-expected-log
+
+ sntp/tests/fileHandlingTest.h@1.4 +0 -0
+ Rename: tests/sntp/fileHandlingTest.h -> sntp/tests/fileHandlingTest.h
+
+ sntp/tests/keyFile.cpp@1.3 +0 -0
+ Rename: tests/sntp/keyFile.cpp -> sntp/tests/keyFile.cpp
+
+ sntp/tests/kodDatabase.cpp@1.2 +0 -0
+ Rename: tests/sntp/kodDatabase.cpp -> sntp/tests/kodDatabase.cpp
+
+ sntp/tests/kodFile.cpp@1.7 +0 -0
+ Rename: tests/sntp/kodFile.cpp -> sntp/tests/kodFile.cpp
+
+ sntp/tests/logFile.cpp@1.5 +0 -0
+ Rename: tests/sntp/logFile.cpp -> sntp/tests/logFile.cpp
+
+ sntp/tests/networking.cpp@1.7 +0 -0
+ Rename: tests/sntp/networking.cpp -> sntp/tests/networking.cpp
+
+ sntp/tests/packetHandling.cpp@1.4 +0 -0
+ Rename: tests/sntp/packetHandling.cpp -> sntp/tests/packetHandling.cpp
+
+ sntp/tests/packetProcessing.cpp@1.4 +0 -0
+ Rename: tests/sntp/packetProcessing.cpp -> sntp/tests/packetProcessing.cpp
+
+ sntp/tests/sntptest.cpp@1.2 +0 -0
+ Rename: tests/sntp/sntptest.cpp -> sntp/tests/sntptest.cpp
+
+ sntp/tests/sntptest.h@1.5 +0 -0
+ Rename: tests/sntp/sntptest.h -> sntp/tests/sntptest.h
+
+ sntp/tests/test-driver@1.4 +0 -0
+ Rename: tests/sntp/test-driver -> sntp/tests/test-driver
+
+ sntp/tests/utilities.cpp@1.4 +0 -0
+ Rename: tests/sntp/utilities.cpp -> sntp/tests/utilities.cpp
+
+ sntp/tests_main.cpp@1.6 +0 -0
+ Rename: tests/tests_main.cpp -> sntp/tests_main.cpp
+
+ sntp/tests_main.h@1.6 +0 -0
+ Rename: tests/tests_main.h -> sntp/tests_main.h
+
+ tests/Makefile.am@1.4 +1 -1
+ Put the sntp tests under sntp/
+
+ tests/libntp/Makefile.am@1.22 +7 -5
+ Put the sntp tests under sntp/
+
+ChangeSet@1.2236, 2010-10-30 10:23:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P75
+ TAG: NTP_4_2_7P75
+
+ ChangeLog@1.629 +1 -0
+ NTP_4_2_7P75
+
+ ntpd/ntpd-opts.c@1.78 +2 -2
+ NTP_4_2_7P75
+
+ ntpd/ntpd-opts.h@1.78 +3 -3
+ NTP_4_2_7P75
+
+ ntpd/ntpd-opts.texi@1.77 +2 -2
+ NTP_4_2_7P75
+
+ ntpd/ntpd.1@1.77 +2 -2
+ NTP_4_2_7P75
+
+ ntpdc/ntpdc-opts.c@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpdc/ntpdc-opts.h@1.76 +3 -3
+ NTP_4_2_7P75
+
+ ntpdc/ntpdc-opts.texi@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpdc/ntpdc.1@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpq/ntpq-opts.c@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpq/ntpq-opts.h@1.76 +3 -3
+ NTP_4_2_7P75
+
+ ntpq/ntpq-opts.texi@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpq/ntpq.1@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.76 +3 -3
+ NTP_4_2_7P75
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.76 +2 -2
+ NTP_4_2_7P75
+
+ ntpsnmpd/ntpsnmpd.1@1.76 +2 -2
+ NTP_4_2_7P75
+
+ packageinfo.sh@1.77 +1 -1
+ NTP_4_2_7P75
+
+ sntp/sntp-opts.c@1.76 +2 -2
+ NTP_4_2_7P75
+
+ sntp/sntp-opts.h@1.76 +3 -3
+ NTP_4_2_7P75
+
+ sntp/sntp-opts.texi@1.76 +1 -1
+ NTP_4_2_7P75
+
+ sntp/sntp.1@1.76 +2 -2
+ NTP_4_2_7P75
+
+ sntp/sntp.html@1.76 +1 -1
+ NTP_4_2_7P75
+
+ util/ntp-keygen-opts.c@1.73 +2 -2
+ NTP_4_2_7P75
+
+ util/ntp-keygen-opts.h@1.73 +3 -3
+ NTP_4_2_7P75
+
+ util/ntp-keygen-opts.texi@1.76 +2 -2
+ NTP_4_2_7P75
+
+ util/ntp-keygen.1@1.76 +2 -2
+ NTP_4_2_7P75
+
+ChangeSet@1.2235, 2010-10-29 23:37:04-04:00, stenn@deacon.udel.edu
+ Include Linus Karlsson's GSoC 2010 testing code.
+
+ ChangeLog@1.628 +1 -0
+ Include Linus Karlsson's GSoC 2010 testing code.
+
+ChangeSet@1.2156.1.152, 2010-10-29 22:20:16-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.98 +1 -0
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.25 +13 -14
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2233, 2010-10-29 11:41:29-07:00, karlsson@psp-os1.ntp.org
+ Fixed required include on Solaris
+
+ tests/libntp/buftvtots.cpp@1.3 +3 -0
+ Fixed required include on Solaris
+
+ tests/libntp/tvtots.cpp@1.5 +3 -0
+ Fixed required include on Solaris
+
+ChangeSet@1.2232, 2010-10-29 20:13:53+02:00, linus@beam.lund.zozs.se
+ Fixed floating point test errors.
+
+ tests/libntp/buftvtots.cpp@1.2 +11 -2
+ Fixed floating point test errors.
+
+ tests/libntp/tvtots.cpp@1.4 +13 -5
+ Fixed floating point test errors.
+
+ChangeSet@1.2156.1.151, 2010-10-29 09:45:21+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P74
+ TAG: NTP_4_2_7P74
+
+ ChangeLog@1.622.1.97 +1 -0
+ NTP_4_2_7P74
+
+ ntpd/ntpd-opts.c@1.77 +2 -2
+ NTP_4_2_7P74
+
+ ntpd/ntpd-opts.h@1.77 +3 -3
+ NTP_4_2_7P74
+
+ ntpd/ntpd-opts.texi@1.76 +2 -2
+ NTP_4_2_7P74
+
+ ntpd/ntpd.1@1.76 +2 -2
+ NTP_4_2_7P74
+
+ ntpdc/ntpdc-opts.c@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpdc/ntpdc-opts.h@1.75 +3 -3
+ NTP_4_2_7P74
+
+ ntpdc/ntpdc-opts.texi@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpdc/ntpdc.1@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpq/ntpq-opts.c@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpq/ntpq-opts.h@1.75 +3 -3
+ NTP_4_2_7P74
+
+ ntpq/ntpq-opts.texi@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpq/ntpq.1@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.75 +3 -3
+ NTP_4_2_7P74
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.75 +2 -2
+ NTP_4_2_7P74
+
+ ntpsnmpd/ntpsnmpd.1@1.75 +2 -2
+ NTP_4_2_7P74
+
+ packageinfo.sh@1.76 +1 -1
+ NTP_4_2_7P74
+
+ sntp/sntp-opts.c@1.75 +2 -2
+ NTP_4_2_7P74
+
+ sntp/sntp-opts.h@1.75 +3 -3
+ NTP_4_2_7P74
+
+ sntp/sntp-opts.texi@1.75 +1 -1
+ NTP_4_2_7P74
+
+ sntp/sntp.1@1.75 +2 -2
+ NTP_4_2_7P74
+
+ sntp/sntp.html@1.75 +1 -1
+ NTP_4_2_7P74
+
+ util/ntp-keygen-opts.c@1.72 +2 -2
+ NTP_4_2_7P74
+
+ util/ntp-keygen-opts.h@1.72 +3 -3
+ NTP_4_2_7P74
+
+ util/ntp-keygen-opts.texi@1.75 +2 -2
+ NTP_4_2_7P74
+
+ util/ntp-keygen.1@1.75 +2 -2
+ NTP_4_2_7P74
+
+ChangeSet@1.2156.1.150, 2010-10-29 04:56:14-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.96 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.4 +10 -3
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2082.4.138, 2010-10-29 04:44:28-04:00, stenn@deacon.udel.edu
+ checkChangeLog fix for Makefile.am
+
+ Makefile.am@1.93.2.3 +1 -1
+ checkChangeLog fix for Makefile.am
+
+ChangeSet@1.2082.4.137, 2010-10-29 08:25:39+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC8
+ TAG: NTP_4_2_6P3_RC8
+
+ ChangeLog@1.496.26.101 +1 -0
+ NTP_4_2_6P3_RC8
+
+ ntpd/ntpd-opts.c@1.248.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpd/ntpd-opts.h@1.248.24.1 +3 -3
+ NTP_4_2_6P3_RC8
+
+ ntpd/ntpd-opts.texi@1.246.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpd/ntpd.1@1.246.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpdc/ntpdc-opts.c@1.244.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpdc/ntpdc-opts.h@1.244.24.1 +3 -3
+ NTP_4_2_6P3_RC8
+
+ ntpdc/ntpdc-opts.texi@1.243.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpdc/ntpdc.1@1.243.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpq/ntpq-opts.c@1.245.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpq/ntpq-opts.h@1.245.24.1 +3 -3
+ NTP_4_2_6P3_RC8
+
+ ntpq/ntpq-opts.texi@1.244.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpq/ntpq.1@1.244.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.25.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.25.1 +3 -3
+ NTP_4_2_6P3_RC8
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.25.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ ntpsnmpd/ntpsnmpd.1@1.122.25.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ packageinfo.sh@1.255.26.1 +1 -1
+ NTP_4_2_6P3_RC8
+
+ sntp/sntp-opts.c@1.117.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ sntp/sntp-opts.h@1.117.24.1 +3 -3
+ NTP_4_2_6P3_RC8
+
+ sntp/sntp-opts.texi@1.117.24.1 +1 -1
+ NTP_4_2_6P3_RC8
+
+ sntp/sntp.1@1.117.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ sntp/sntp.html@1.7.24.1 +1 -1
+ NTP_4_2_6P3_RC8
+
+ util/ntp-keygen-opts.c@1.247.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ util/ntp-keygen-opts.h@1.247.24.1 +3 -3
+ NTP_4_2_6P3_RC8
+
+ util/ntp-keygen-opts.texi@1.246.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ util/ntp-keygen.1@1.246.24.1 +2 -2
+ NTP_4_2_6P3_RC8
+
+ChangeSet@1.2082.4.136, 2010-10-29 04:13:47-04:00, stenn@deacon.udel.edu
+ First cut at using scripts/checkChangeLog
+
+ ChangeLog@1.496.26.100 +1 -0
+ First cut at using scripts/checkChangeLog
+
+ Makefile.am@1.93.2.2 +5 -0
+ First cut at using scripts/checkChangeLog
+
+ChangeSet@1.2082.4.135, 2010-10-29 03:39:15-04:00, stenn@psp-deb1.ntp.org
+ typo
+
+ ChangeLog@1.496.26.99 +1 -1
+ typo
+
+ChangeSet@1.2082.4.134, 2010-10-28 18:07:23+00:00, hart@psp-os1.ntp.org
+ for perlinger, [Bug 1685]
+
+ ChangeLog@1.496.26.98 +4 -0
+ for perlinger, [Bug 1685]
+
+ ntpd/refclock_nmea.c@1.46.1.9 +2 -1
+ for perlinger, [Bug 1685]
+
+ChangeSet@1.2156.1.148, 2010-10-27 07:35:29+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P73
+ TAG: NTP_4_2_7P73
+
+ ChangeLog@1.622.1.94 +1 -0
+ NTP_4_2_7P73
+
+ ntpd/ntpd-opts.c@1.76 +2 -2
+ NTP_4_2_7P73
+
+ ntpd/ntpd-opts.h@1.76 +3 -3
+ NTP_4_2_7P73
+
+ ntpd/ntpd-opts.texi@1.75 +2 -2
+ NTP_4_2_7P73
+
+ ntpd/ntpd.1@1.75 +2 -2
+ NTP_4_2_7P73
+
+ ntpdc/ntpdc-opts.c@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpdc/ntpdc-opts.h@1.74 +3 -3
+ NTP_4_2_7P73
+
+ ntpdc/ntpdc-opts.texi@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpdc/ntpdc.1@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpq/ntpq-opts.c@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpq/ntpq-opts.h@1.74 +3 -3
+ NTP_4_2_7P73
+
+ ntpq/ntpq-opts.texi@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpq/ntpq.1@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.74 +3 -3
+ NTP_4_2_7P73
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.74 +2 -2
+ NTP_4_2_7P73
+
+ ntpsnmpd/ntpsnmpd.1@1.74 +2 -2
+ NTP_4_2_7P73
+
+ packageinfo.sh@1.75 +1 -1
+ NTP_4_2_7P73
+
+ sntp/sntp-opts.c@1.74 +2 -2
+ NTP_4_2_7P73
+
+ sntp/sntp-opts.h@1.74 +3 -3
+ NTP_4_2_7P73
+
+ sntp/sntp-opts.texi@1.74 +1 -1
+ NTP_4_2_7P73
+
+ sntp/sntp.1@1.74 +2 -2
+ NTP_4_2_7P73
+
+ sntp/sntp.html@1.74 +1 -1
+ NTP_4_2_7P73
+
+ util/ntp-keygen-opts.c@1.71 +2 -2
+ NTP_4_2_7P73
+
+ util/ntp-keygen-opts.h@1.71 +3 -3
+ NTP_4_2_7P73
+
+ util/ntp-keygen-opts.texi@1.74 +2 -2
+ NTP_4_2_7P73
+
+ util/ntp-keygen.1@1.74 +2 -2
+ NTP_4_2_7P73
+
+ChangeSet@1.2156.1.147, 2010-10-26 21:24:02+00:00, davehart@shiny.ad.hartbrothers.com
+ add test case that would have caught [Bug 1678]
+
+ ChangeLog@1.622.1.93 +1 -0
+ add test case that would have caught [Bug 1678]
+
+ ntpd/complete.conf@1.10 +2 -0
+ add test case that would have caught [Bug 1678]
+
+ChangeSet@1.2156.1.146, 2010-10-26 17:20:17-04:00, stenn@deacon.udel.edu
+ ntp_loopfilter.c, ntpd.h, ChangeLog, ntp_proto.c:
+ * [Bug 1680] Fix alignment of clock_select() arrays.
+ * refinements to new startup behavior from David Mills.
+
+ ChangeLog@1.622.1.92 +2 -0
+ * [Bug 1680] Fix alignment of clock_select() arrays.
+ * refinements to new startup behavior from David Mills.
+
+ include/ntpd.h@1.143 +1 -0
+ * [Bug 1680] Fix alignment of clock_select() arrays.
+ * refinements to new startup behavior from David Mills.
+
+ ntpd/ntp_loopfilter.c@1.160 +8 -9
+ * [Bug 1680] Fix alignment of clock_select() arrays.
+ * refinements to new startup behavior from David Mills.
+
+ ntpd/ntp_proto.c@1.311 +12 -12
+ * [Bug 1680] Fix alignment of clock_select() arrays.
+ * refinements to new startup behavior from David Mills.
+
+ChangeSet@1.2156.1.145, 2010-10-26 16:42:45-04:00, stenn@deacon.udel.edu
+ For the bootstrap script, touch .html files last
+
+ ChangeLog@1.622.1.91 +1 -0
+ For the bootstrap script, touch .html files last
+
+ bootstrap@1.33 +8 -4
+ For the bootstrap script, touch .html files last
+
+ChangeSet@1.2156.1.144, 2010-10-26 09:20:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P72
+ TAG: NTP_4_2_7P72
+
+ ChangeLog@1.622.1.90 +1 -0
+ NTP_4_2_7P72
+
+ ntpd/ntpd-opts.c@1.75 +2 -2
+ NTP_4_2_7P72
+
+ ntpd/ntpd-opts.h@1.75 +3 -3
+ NTP_4_2_7P72
+
+ ntpd/ntpd-opts.texi@1.74 +2 -2
+ NTP_4_2_7P72
+
+ ntpd/ntpd.1@1.74 +2 -2
+ NTP_4_2_7P72
+
+ ntpdc/ntpdc-opts.c@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpdc/ntpdc-opts.h@1.73 +3 -3
+ NTP_4_2_7P72
+
+ ntpdc/ntpdc-opts.texi@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpdc/ntpdc.1@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpq/ntpq-opts.c@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpq/ntpq-opts.h@1.73 +3 -3
+ NTP_4_2_7P72
+
+ ntpq/ntpq-opts.texi@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpq/ntpq.1@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.73 +3 -3
+ NTP_4_2_7P72
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.73 +2 -2
+ NTP_4_2_7P72
+
+ ntpsnmpd/ntpsnmpd.1@1.73 +2 -2
+ NTP_4_2_7P72
+
+ packageinfo.sh@1.74 +1 -1
+ NTP_4_2_7P72
+
+ sntp/sntp-opts.c@1.73 +2 -2
+ NTP_4_2_7P72
+
+ sntp/sntp-opts.h@1.73 +3 -3
+ NTP_4_2_7P72
+
+ sntp/sntp-opts.texi@1.73 +1 -1
+ NTP_4_2_7P72
+
+ sntp/sntp.1@1.73 +2 -2
+ NTP_4_2_7P72
+
+ sntp/sntp.html@1.73 +1 -1
+ NTP_4_2_7P72
+
+ util/ntp-keygen-opts.c@1.70 +2 -2
+ NTP_4_2_7P72
+
+ util/ntp-keygen-opts.h@1.70 +3 -3
+ NTP_4_2_7P72
+
+ util/ntp-keygen-opts.texi@1.73 +2 -2
+ NTP_4_2_7P72
+
+ util/ntp-keygen.1@1.73 +2 -2
+ NTP_4_2_7P72
+
+ChangeSet@1.2156.1.143, 2010-10-26 05:05:56-04:00, stenn@deacon.udel.edu
+ [Bug 1679] Fix test for -lsocket.
+
+ sntp/configure.ac@1.37 +5 -0
+ [Bug 1679] Fix test for -lsocket.
+
+ChangeSet@1.2156.1.142, 2010-10-26 04:49:14-04:00, stenn@deacon.udel.edu
+ configure.ac, ChangeLog:
+ * [Bug 1679] Fix test for -lsocket.
+ * Clean up missing ;; entries in configure.ac
+
+ ChangeLog@1.622.1.89 +2 -0
+ * [Bug 1679] Fix test for -lsocket.
+ * Clean up missing ;; entries in configure.ac
+
+ configure.ac@1.483.1.11 +89 -27
+ * [Bug 1679] Fix test for -lsocket.
+ * Clean up missing ;; entries in configure.ac
+
+ChangeSet@1.2156.1.141, 2010-10-25 08:33:05+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P71
+ TAG: NTP_4_2_7P71
+
+ ChangeLog@1.622.1.88 +1 -0
+ NTP_4_2_7P71
+
+ ntpd/ntpd-opts.c@1.74 +2 -2
+ NTP_4_2_7P71
+
+ ntpd/ntpd-opts.h@1.74 +3 -3
+ NTP_4_2_7P71
+
+ ntpd/ntpd-opts.texi@1.73 +2 -2
+ NTP_4_2_7P71
+
+ ntpd/ntpd.1@1.73 +2 -2
+ NTP_4_2_7P71
+
+ ntpdc/ntpdc-opts.c@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpdc/ntpdc-opts.h@1.72 +3 -3
+ NTP_4_2_7P71
+
+ ntpdc/ntpdc-opts.texi@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpdc/ntpdc.1@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpq/ntpq-opts.c@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpq/ntpq-opts.h@1.72 +3 -3
+ NTP_4_2_7P71
+
+ ntpq/ntpq-opts.texi@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpq/ntpq.1@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.72 +3 -3
+ NTP_4_2_7P71
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.72 +2 -2
+ NTP_4_2_7P71
+
+ ntpsnmpd/ntpsnmpd.1@1.72 +2 -2
+ NTP_4_2_7P71
+
+ packageinfo.sh@1.73 +1 -1
+ NTP_4_2_7P71
+
+ sntp/sntp-opts.c@1.72 +2 -2
+ NTP_4_2_7P71
+
+ sntp/sntp-opts.h@1.72 +3 -3
+ NTP_4_2_7P71
+
+ sntp/sntp-opts.texi@1.72 +1 -1
+ NTP_4_2_7P71
+
+ sntp/sntp.1@1.72 +2 -2
+ NTP_4_2_7P71
+
+ sntp/sntp.html@1.72 +1 -1
+ NTP_4_2_7P71
+
+ util/ntp-keygen-opts.c@1.69 +2 -2
+ NTP_4_2_7P71
+
+ util/ntp-keygen-opts.h@1.69 +3 -3
+ NTP_4_2_7P71
+
+ util/ntp-keygen-opts.texi@1.72 +2 -2
+ NTP_4_2_7P71
+
+ util/ntp-keygen.1@1.72 +2 -2
+ NTP_4_2_7P71
+
+ChangeSet@1.2156.1.139, 2010-10-25 04:06:09-04:00, stenn@deacon.udel.edu
+ merge cleanup
+
+ ChangeLog@1.622.1.86 +3 -0
+ merge cleanup
+
+ChangeSet@1.2082.4.133, 2010-10-25 07:49:22+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC7
+ TAG: NTP_4_2_6P3_RC7
+
+ ChangeLog@1.496.26.97 +1 -0
+ NTP_4_2_6P3_RC7
+
+ ntpd/ntpd-opts.c@1.248.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpd/ntpd-opts.h@1.248.23.1 +3 -3
+ NTP_4_2_6P3_RC7
+
+ ntpd/ntpd-opts.texi@1.246.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpd/ntpd.1@1.246.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpdc/ntpdc-opts.c@1.244.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpdc/ntpdc-opts.h@1.244.23.1 +3 -3
+ NTP_4_2_6P3_RC7
+
+ ntpdc/ntpdc-opts.texi@1.243.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpdc/ntpdc.1@1.243.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpq/ntpq-opts.c@1.245.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpq/ntpq-opts.h@1.245.23.1 +3 -3
+ NTP_4_2_6P3_RC7
+
+ ntpq/ntpq-opts.texi@1.244.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpq/ntpq.1@1.244.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.24.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.24.1 +3 -3
+ NTP_4_2_6P3_RC7
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.24.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ ntpsnmpd/ntpsnmpd.1@1.122.24.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ packageinfo.sh@1.255.25.1 +1 -1
+ NTP_4_2_6P3_RC7
+
+ sntp/sntp-opts.c@1.117.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ sntp/sntp-opts.h@1.117.23.1 +3 -3
+ NTP_4_2_6P3_RC7
+
+ sntp/sntp-opts.texi@1.117.23.1 +1 -1
+ NTP_4_2_6P3_RC7
+
+ sntp/sntp.1@1.117.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ sntp/sntp.html@1.7.23.1 +1 -1
+ NTP_4_2_6P3_RC7
+
+ util/ntp-keygen-opts.c@1.247.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ util/ntp-keygen-opts.h@1.247.23.1 +3 -3
+ NTP_4_2_6P3_RC7
+
+ util/ntp-keygen-opts.texi@1.246.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ util/ntp-keygen.1@1.246.23.1 +2 -2
+ NTP_4_2_6P3_RC7
+
+ChangeSet@1.2156.1.138, 2010-10-25 03:34:31-04:00, stenn@deacon.udel.edu
+ merge cleanup
+
+ ChangeLog@1.622.1.85 +0 -1
+ merge cleanup
+
+ChangeSet@1.2082.4.132, 2010-10-25 03:26:31-04:00, stenn@deacon.udel.edu
+ Added scripts/checkChangeLog
+
+ ChangeLog@1.496.26.96 +4 -3
+ Added scripts/checkChangeLog
+
+ scripts/Makefile.am@1.17.1.2 +1 -0
+ Added scripts/checkChangeLog
+
+ scripts/checkChangeLog@1.1 +28 -0
+ BitKeeper file /deacon/backroom/ntp-stable/scripts/checkChangeLog
+
+ scripts/checkChangeLog@1.0 +0 -0
+
+ChangeSet@1.2156.19.1, 2010-10-25 02:19:58-04:00, stenn@deacon.udel.edu
+ typo fixes
+
+ ChangeLog@1.622.9.1 +2 -2
+ typo fixes
+
+ChangeSet@1.2156.1.135, 2010-10-25 05:42:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1678] "restrict source" treated as "restrict default".
+
+ ChangeLog@1.622.1.82 +1 -0
+ [Bug 1678] "restrict source" treated as "restrict default".
+
+ ntpd/Makefile.am@1.95 +1 -0
+ Make complete.conf roundtrip saveconfig failures easier to see.
+
+ ntpd/ntp_parser.c@1.69 +676 -723
+ Bison output
+
+ ntpd/ntp_parser.y@1.63 +16 -36
+ [Bug 1678] "restrict source" treated as "restrict default".
+
+ChangeSet@1.2082.4.131, 2010-10-24 06:17:47-04:00, perlinger@psp-deb1.ntp.org
+ [Bug 1676] fixed in refclock_nmea (GPGLL did not work after fix 1571)
+
+ ChangeLog@1.496.26.95 +4 -0
+ [Bug 1676] fixed in refclock_nmea (GPGLL did not work after fix 1571)
+
+ ntpd/refclock_nmea.c@1.46.1.8 +1 -1
+ fixed cut&paste error that lead to bug 1676
+
+ChangeSet@1.2156.1.134, 2010-10-24 07:48:42+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P70
+ TAG: NTP_4_2_7P70
+
+ ChangeLog@1.622.1.81 +1 -0
+ NTP_4_2_7P70
+
+ ntpd/ntpd-opts.c@1.73 +2 -2
+ NTP_4_2_7P70
+
+ ntpd/ntpd-opts.h@1.73 +3 -3
+ NTP_4_2_7P70
+
+ ntpd/ntpd-opts.texi@1.72 +2 -2
+ NTP_4_2_7P70
+
+ ntpd/ntpd.1@1.72 +2 -2
+ NTP_4_2_7P70
+
+ ntpdc/ntpdc-opts.c@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpdc/ntpdc-opts.h@1.71 +3 -3
+ NTP_4_2_7P70
+
+ ntpdc/ntpdc-opts.texi@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpdc/ntpdc.1@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpq/ntpq-opts.c@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpq/ntpq-opts.h@1.71 +3 -3
+ NTP_4_2_7P70
+
+ ntpq/ntpq-opts.texi@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpq/ntpq.1@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.71 +3 -3
+ NTP_4_2_7P70
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.71 +2 -2
+ NTP_4_2_7P70
+
+ ntpsnmpd/ntpsnmpd.1@1.71 +2 -2
+ NTP_4_2_7P70
+
+ packageinfo.sh@1.72 +1 -1
+ NTP_4_2_7P70
+
+ sntp/sntp-opts.c@1.71 +2 -2
+ NTP_4_2_7P70
+
+ sntp/sntp-opts.h@1.71 +3 -3
+ NTP_4_2_7P70
+
+ sntp/sntp-opts.texi@1.71 +1 -1
+ NTP_4_2_7P70
+
+ sntp/sntp.1@1.71 +2 -2
+ NTP_4_2_7P70
+
+ sntp/sntp.html@1.71 +1 -1
+ NTP_4_2_7P70
+
+ util/ntp-keygen-opts.c@1.68 +2 -2
+ NTP_4_2_7P70
+
+ util/ntp-keygen-opts.h@1.68 +3 -3
+ NTP_4_2_7P70
+
+ util/ntp-keygen-opts.texi@1.71 +2 -2
+ NTP_4_2_7P70
+
+ util/ntp-keygen.1@1.71 +2 -2
+ NTP_4_2_7P70
+
+ChangeSet@1.2156.1.133, 2010-10-24 03:36:28-04:00, stenn@deacon.udel.edu
+ merge cleanup
+
+ ChangeLog@1.622.1.80 +2 -0
+ merge cleanup
+
+ChangeSet@1.2156.1.132, 2010-10-24 03:28:33-04:00, stenn@deacon.udel.edu
+ Fix from Dave Mills for a rare singularity in clock_combine()
+
+ ChangeLog@1.622.1.79 +1 -0
+ Fix from Dave Mills for a rare singularity in clock_combine()
+
+ ntpd/ntp_proto.c@1.310 +1 -1
+ Fix from Dave Mills for a rare singularity in clock_combine()
+
+ChangeSet@1.2082.4.130, 2010-10-24 06:40:26+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC6
+ TAG: NTP_4_2_6P3_RC6
+
+ ChangeLog@1.496.26.94 +1 -0
+ NTP_4_2_6P3_RC6
+
+ ntpd/ntpd-opts.c@1.248.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpd/ntpd-opts.h@1.248.22.1 +3 -3
+ NTP_4_2_6P3_RC6
+
+ ntpd/ntpd-opts.texi@1.246.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpd/ntpd.1@1.246.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpdc/ntpdc-opts.c@1.244.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpdc/ntpdc-opts.h@1.244.22.1 +3 -3
+ NTP_4_2_6P3_RC6
+
+ ntpdc/ntpdc-opts.texi@1.243.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpdc/ntpdc.1@1.243.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpq/ntpq-opts.c@1.245.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpq/ntpq-opts.h@1.245.22.1 +3 -3
+ NTP_4_2_6P3_RC6
+
+ ntpq/ntpq-opts.texi@1.244.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpq/ntpq.1@1.244.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.23.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.23.1 +3 -3
+ NTP_4_2_6P3_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.23.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ ntpsnmpd/ntpsnmpd.1@1.122.23.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ packageinfo.sh@1.255.24.1 +1 -1
+ NTP_4_2_6P3_RC6
+
+ sntp/sntp-opts.c@1.117.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ sntp/sntp-opts.h@1.117.22.1 +3 -3
+ NTP_4_2_6P3_RC6
+
+ sntp/sntp-opts.texi@1.117.22.1 +1 -1
+ NTP_4_2_6P3_RC6
+
+ sntp/sntp.1@1.117.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ sntp/sntp.html@1.7.22.1 +1 -1
+ NTP_4_2_6P3_RC6
+
+ util/ntp-keygen-opts.c@1.247.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ util/ntp-keygen-opts.h@1.247.22.1 +3 -3
+ NTP_4_2_6P3_RC6
+
+ util/ntp-keygen-opts.texi@1.246.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ util/ntp-keygen.1@1.246.22.1 +2 -2
+ NTP_4_2_6P3_RC6
+
+ChangeSet@1.2156.17.4, 2010-10-24 06:29:15+00:00, davehart@shiny.ad.hartbrothers.com
+ revert prior overly-successful merge (ntp-dev and ntp-stable
+ tos attr_val types differ)
+
+ ntpd/ntp_parser.y@1.62 +1 -1
+ revert prior overly-successful merge (ntp-dev and ntp-stable
+ tos attr_val types differ)
+
+ChangeSet@1.2082.4.128, 2010-10-24 02:22:00-04:00, stenn@deacon.udel.edu
+ NEWS file update
+
+ NEWS@1.111 +3 -1
+ NEWS file update
+
+ChangeSet@1.2082.30.5, 2010-10-24 06:21:08+00:00, davehart@shiny.ad.hartbrothers.com
+ fix bad "tos cohort" backport from -dev
+
+ ntpd/ntp_parser.c@1.52.1.6 +1 -1
+ fix bad "tos cohort" backport from -dev
+
+ ntpd/ntp_parser.y@1.47.1.6 +1 -1
+ fix bad "tos cohort" backport from -dev
+
+ChangeSet@1.2082.30.4, 2010-10-24 03:23:09+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1675] Prohibit includefile remote config.
+
+ ChangeLog@1.496.53.1 +4 -0
+ [Bug 1675] Prohibit includefile remote config.
+
+ ntpd/ntp_parser.c@1.52.1.5 +939 -1247
+ ntp_parser.y Bison output
+
+ ntpd/ntp_parser.y@1.47.1.5 +266 -177
+ [Bug 1675] Prohibit includefile remote config.
+ Collapse duplicated C snippets into common actions.
+
+ ntpd/ntp_scanner.c@1.31.1.2 +4 -1
+ [Bug 1675] Prohibit includefile remote config.
+
+ChangeSet@1.2082.4.126, 2010-10-23 18:59:27+02:00, jnperlin@hydra.localnet
+ ntp_fp.h: HTONL_MFP() uses ntohl(), should use htonl() (benign error)
+
+ include/ntp_fp.h@1.15.1.1 +16 -16
+ HTONL_MFP() uses ntohl(), should use htonl() (benign error)
+
+ChangeSet@1.2156.17.1, 2010-10-23 10:09:49+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P69
+ TAG: NTP_4_2_7P69
+
+ ChangeLog@1.622.7.1 +1 -0
+ NTP_4_2_7P69
+
+ ntpd/ntpd-opts.c@1.72 +2 -2
+ NTP_4_2_7P69
+
+ ntpd/ntpd-opts.h@1.72 +3 -3
+ NTP_4_2_7P69
+
+ ntpd/ntpd-opts.texi@1.71 +2 -2
+ NTP_4_2_7P69
+
+ ntpd/ntpd.1@1.71 +2 -2
+ NTP_4_2_7P69
+
+ ntpdc/ntpdc-opts.c@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpdc/ntpdc-opts.h@1.70 +3 -3
+ NTP_4_2_7P69
+
+ ntpdc/ntpdc-opts.texi@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpdc/ntpdc.1@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpq/ntpq-opts.c@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpq/ntpq-opts.h@1.70 +3 -3
+ NTP_4_2_7P69
+
+ ntpq/ntpq-opts.texi@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpq/ntpq.1@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.70 +3 -3
+ NTP_4_2_7P69
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.70 +2 -2
+ NTP_4_2_7P69
+
+ ntpsnmpd/ntpsnmpd.1@1.70 +2 -2
+ NTP_4_2_7P69
+
+ packageinfo.sh@1.71 +1 -1
+ NTP_4_2_7P69
+
+ sntp/sntp-opts.c@1.70 +2 -2
+ NTP_4_2_7P69
+
+ sntp/sntp-opts.h@1.70 +3 -3
+ NTP_4_2_7P69
+
+ sntp/sntp-opts.texi@1.70 +1 -1
+ NTP_4_2_7P69
+
+ sntp/sntp.1@1.70 +2 -2
+ NTP_4_2_7P69
+
+ sntp/sntp.html@1.70 +1 -1
+ NTP_4_2_7P69
+
+ util/ntp-keygen-opts.c@1.67 +2 -2
+ NTP_4_2_7P69
+
+ util/ntp-keygen-opts.h@1.67 +3 -3
+ NTP_4_2_7P69
+
+ util/ntp-keygen-opts.texi@1.70 +2 -2
+ NTP_4_2_7P69
+
+ util/ntp-keygen.1@1.70 +2 -2
+ NTP_4_2_7P69
+
+ChangeSet@1.2082.4.125, 2010-10-23 03:07:11+02:00, jnperlin@hydra.localnet
+ polish to NMEA driver
+
+ ntpd/refclock_nmea.c@1.46.1.7 +55 -53
+ formatting issues
+
+ChangeSet@1.2082.4.124, 2010-10-23 02:24:08+02:00, jnperlin@hydra.localnet
+ final update for [Bug 1571] and [Bug 1572]
+
+ ChangeLog@1.496.26.92 +5 -0
+ [Bug 1571] NMEA does not relate data to PPS edge
+ [Bug 1572] NMEA time adjustment for GPZDG buggy
+
+ ntpd/refclock_nmea.c@1.46.1.6 +0 -10
+ removed tag for temporary version
+
+ChangeSet@1.2082.25.2, 2010-10-23 01:48:37+02:00, jnperlin@hydra.localnet
+ nmea calendar cleanup
+
+ ntpd/refclock_nmea.c@1.46.3.1 +16 -40
+ calendar cleanup
+
+ChangeSet@1.2156.1.127, 2010-10-22 23:13:04+00:00, hart@malarky.udel.edu
+ correct POSIX file permissions in ports/winnt
+
+ ports/winnt/libntp/MSG00001.bin@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/libntp/getclock.c@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/libntp/messages.h@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/libntp/messages.rc@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/libntp/setpriority.c@1.4 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/ntpd/ntservice.c@1.24 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/ppsapi/skelprov/sys/time.h@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/instsrv/instsrv.vcproj@1.5 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.29 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.10 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/ntp.sln@1.9 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat@1.2 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.32 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.13 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.13 +0 -0
+ Change mode to -rw-rw-r--
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.12 +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.2156.1.126, 2010-10-22 21:26:52+00:00, davehart@shiny.ad.hartbrothers.com
+ Enable generating ntpd/ntp_keyword.h after ntpd/keyword-gen.c changes
+ on Windows as well as POSIX platforms.
+
+ ChangeLog@1.622.1.75 +2 -0
+ Enable generating ntpd/ntp_keyword.h after ntpd/keyword-gen.c changes
+ on Windows as well as POSIX platforms.
+
+ ntpd/keyword-gen.c@1.15 +33 -32
+ use u_short instead of int for token/state vars.
+
+ ports/winnt/vs2008/ntp.sln@1.8 +14 -4
+ add ntpd-keyword-gen project to generate ntpd/ntp_keyword.h on Windows
+ using ntpd/keyword-gen.c.
+
+ ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj@1.1 +263 -0
+ BitKeeper file C:/ntp/ntp-dev-win-keyword/ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj
+
+ ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat@1.1 +39 -0
+ BitKeeper file C:/ntp/ntp-dev-win-keyword/ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat
+
+ ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat@1.0 +0 -0
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.31 +28 -5
+ Add custom build rule for ntp_keyword.h invoking keyword-gen.exe
+
+ChangeSet@1.2156.1.125, 2010-10-22 14:57:46-04:00, stenn@deacon.udel.edu
+ [Bug 1671] Audoomatic delay calibration is sometimes inaccurate
+
+ ChangeLog@1.622.1.74 +1 -0
+ [Bug 1671] Audoomatic delay calibration is sometimes inaccurate
+
+ ntpd/ntp_loopfilter.c@1.159 +1 -1
+ [Bug 1671] Audoomatic delay calibration is sometimes inaccurate
+
+ ntpd/ntp_proto.c@1.309 +1 -1
+ [Bug 1671] Audoomatic delay calibration is sometimes inaccurate
+
+ChangeSet@1.2156.1.124, 2010-10-22 08:31:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P68
+ TAG: NTP_4_2_7P68
+
+ ChangeLog@1.622.1.73 +1 -0
+ NTP_4_2_7P68
+
+ ntpd/ntpd-opts.c@1.71 +2 -2
+ NTP_4_2_7P68
+
+ ntpd/ntpd-opts.h@1.71 +3 -3
+ NTP_4_2_7P68
+
+ ntpd/ntpd-opts.texi@1.70 +2 -2
+ NTP_4_2_7P68
+
+ ntpd/ntpd.1@1.70 +2 -2
+ NTP_4_2_7P68
+
+ ntpdc/ntpdc-opts.c@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpdc/ntpdc-opts.h@1.69 +3 -3
+ NTP_4_2_7P68
+
+ ntpdc/ntpdc-opts.texi@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpdc/ntpdc.1@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpq/ntpq-opts.c@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpq/ntpq-opts.h@1.69 +3 -3
+ NTP_4_2_7P68
+
+ ntpq/ntpq-opts.texi@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpq/ntpq.1@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.69 +3 -3
+ NTP_4_2_7P68
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.69 +2 -2
+ NTP_4_2_7P68
+
+ ntpsnmpd/ntpsnmpd.1@1.69 +2 -2
+ NTP_4_2_7P68
+
+ packageinfo.sh@1.70 +1 -1
+ NTP_4_2_7P68
+
+ sntp/sntp-opts.c@1.69 +2 -2
+ NTP_4_2_7P68
+
+ sntp/sntp-opts.h@1.69 +3 -3
+ NTP_4_2_7P68
+
+ sntp/sntp-opts.texi@1.69 +1 -1
+ NTP_4_2_7P68
+
+ sntp/sntp.1@1.69 +2 -2
+ NTP_4_2_7P68
+
+ sntp/sntp.html@1.69 +1 -1
+ NTP_4_2_7P68
+
+ util/ntp-keygen-opts.c@1.66 +2 -2
+ NTP_4_2_7P68
+
+ util/ntp-keygen-opts.h@1.66 +3 -3
+ NTP_4_2_7P68
+
+ util/ntp-keygen-opts.texi@1.69 +2 -2
+ NTP_4_2_7P68
+
+ util/ntp-keygen.1@1.69 +2 -2
+ NTP_4_2_7P68
+
+ChangeSet@1.2082.30.3, 2010-10-22 07:46:08+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC5
+ TAG: NTP_4_2_6P3_RC5
+
+ ChangeLog@1.496.26.91 +1 -0
+ NTP_4_2_6P3_RC5
+
+ ntpd/ntpd-opts.c@1.248.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpd/ntpd-opts.h@1.248.21.1 +3 -3
+ NTP_4_2_6P3_RC5
+
+ ntpd/ntpd-opts.texi@1.246.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpd/ntpd.1@1.246.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpdc/ntpdc-opts.c@1.244.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpdc/ntpdc-opts.h@1.244.21.1 +3 -3
+ NTP_4_2_6P3_RC5
+
+ ntpdc/ntpdc-opts.texi@1.243.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpdc/ntpdc.1@1.243.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpq/ntpq-opts.c@1.245.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpq/ntpq-opts.h@1.245.21.1 +3 -3
+ NTP_4_2_6P3_RC5
+
+ ntpq/ntpq-opts.texi@1.244.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpq/ntpq.1@1.244.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.22.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.22.1 +3 -3
+ NTP_4_2_6P3_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.22.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ ntpsnmpd/ntpsnmpd.1@1.122.22.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ packageinfo.sh@1.255.23.1 +1 -1
+ NTP_4_2_6P3_RC5
+
+ sntp/sntp-opts.c@1.117.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ sntp/sntp-opts.h@1.117.21.1 +3 -3
+ NTP_4_2_6P3_RC5
+
+ sntp/sntp-opts.texi@1.117.21.1 +1 -1
+ NTP_4_2_6P3_RC5
+
+ sntp/sntp.1@1.117.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ sntp/sntp.html@1.7.21.1 +1 -1
+ NTP_4_2_6P3_RC5
+
+ util/ntp-keygen-opts.c@1.247.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ util/ntp-keygen-opts.h@1.247.21.1 +3 -3
+ NTP_4_2_6P3_RC5
+
+ util/ntp-keygen-opts.texi@1.246.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ util/ntp-keygen.1@1.246.21.1 +2 -2
+ NTP_4_2_6P3_RC5
+
+ChangeSet@1.2156.1.122, 2010-10-22 02:02:49-04:00, stenn@deacon.udel.edu
+ Documentation cleanup
+
+ BitKeeper/deleted/.del-manyopt.htm~8bee686d28f0c2b7@1.24 +0 -0
+ Delete: html/manyopt.html
+
+ChangeSet@1.2156.1.121, 2010-10-22 01:56:16-04:00, stenn@deacon.udel.edu
+ [Bug 1670] Fix peer->bias and broadcastdelay
+
+ ChangeLog@1.622.1.71 +1 -0
+ [Bug 1670] Fix peer->bias and broadcastdelay
+
+ html/miscopt.html@1.60 +4 -3
+ [Bug 1670] Fix peer->bias and broadcastdelay
+
+ include/ntp.h@1.183 +1 -1
+ [Bug 1670] Fix peer->bias and broadcastdelay
+
+ ntpd/ntp_proto.c@1.308 +2 -5
+ [Bug 1670] Fix peer->bias and broadcastdelay
+
+ChangeSet@1.2156.1.120, 2010-10-21 23:57:11-04:00, stenn@deacon.udel.edu
+ Documentation EOL cleanup
+
+ ChangeLog@1.622.1.70 +1 -0
+ Documentation EOL cleanup
+
+ html/config.html@1.24 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver16.html@1.12 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver2.html@1.13 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver27.html@1.16 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver29.html@1.16 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver30.html@1.20 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver31.html@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver32.html@1.13 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver33.html@1.13 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver35.html@1.15 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver37.html@1.13 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver38.html@1.15 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver39.html@1.14 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver42.html@1.13 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver43.html@1.11 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver44.html@1.14 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver5.html@1.14 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/driver9.html@1.15 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/mx4200data.html@1.2 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/oncore-shmem.html@1.13 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/scripts/footer.txt@1.2 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/scripts/style.css@1.2 +1 -1
+ Documentation EOL cleanup
+
+ html/drivers/tf582_4.html@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/hints/sco.html@1.11 +1 -1
+ Documentation EOL cleanup
+
+ html/hints/vxworks.html@1.10 +1 -1
+ Documentation EOL cleanup
+
+ html/parsedata.html@1.13 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/accopt.txt@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/audio.txt@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/authopt.txt@1.4 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/clockopt.txt@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/command.txt@1.4 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/confopt.txt@1.4 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/external.txt@1.4 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/footer.txt@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/hand.txt@1.2 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/install.txt@1.4 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/manual.txt@1.4 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/misc.txt@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/miscopt.txt@1.7 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/monopt.txt@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/refclock.txt@1.3 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/special.txt@1.6 +1 -1
+ Documentation EOL cleanup
+
+ html/scripts/style.css@1.3 +1 -1
+ Documentation EOL cleanup
+
+ChangeSet@1.2156.1.119, 2010-10-21 23:42:06-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.69 +1 -0
+ Documentation updates from Dave Mills
+
+ html/build.html@1.25 +1 -1
+ Documentation updates from Dave Mills
+
+ html/drivers/driver1.html@1.18 +5 -5
+ Documentation updates from Dave Mills
+
+ html/scripts/config.txt@1.4 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2082.31.1, 2010-10-22 00:33:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3.
+
+ ChangeLog@1.496.52.1 +4 -0
+ [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3.
+
+ ntpd/ntp_util.c@1.75.1.2 +9 -8
+ [Bug 1669] NTP 4.2.6p2 fails to compile on IBM AIX 5.3.
+
+ChangeSet@1.2156.1.117, 2010-10-21 10:10:05+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P67
+ TAG: NTP_4_2_7P67
+
+ ChangeLog@1.622.1.67 +1 -0
+ NTP_4_2_7P67
+
+ ntpd/ntpd-opts.c@1.70 +2 -2
+ NTP_4_2_7P67
+
+ ntpd/ntpd-opts.h@1.70 +3 -3
+ NTP_4_2_7P67
+
+ ntpd/ntpd-opts.texi@1.69 +2 -2
+ NTP_4_2_7P67
+
+ ntpd/ntpd.1@1.69 +2 -2
+ NTP_4_2_7P67
+
+ ntpdc/ntpdc-opts.c@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpdc/ntpdc-opts.h@1.68 +3 -3
+ NTP_4_2_7P67
+
+ ntpdc/ntpdc-opts.texi@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpdc/ntpdc.1@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpq/ntpq-opts.c@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpq/ntpq-opts.h@1.68 +3 -3
+ NTP_4_2_7P67
+
+ ntpq/ntpq-opts.texi@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpq/ntpq.1@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.68 +3 -3
+ NTP_4_2_7P67
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.68 +2 -2
+ NTP_4_2_7P67
+
+ ntpsnmpd/ntpsnmpd.1@1.68 +2 -2
+ NTP_4_2_7P67
+
+ packageinfo.sh@1.69 +1 -1
+ NTP_4_2_7P67
+
+ sntp/sntp-opts.c@1.68 +2 -2
+ NTP_4_2_7P67
+
+ sntp/sntp-opts.h@1.68 +3 -3
+ NTP_4_2_7P67
+
+ sntp/sntp-opts.texi@1.68 +1 -1
+ NTP_4_2_7P67
+
+ sntp/sntp.1@1.68 +2 -2
+ NTP_4_2_7P67
+
+ sntp/sntp.html@1.68 +1 -1
+ NTP_4_2_7P67
+
+ util/ntp-keygen-opts.c@1.65 +2 -2
+ NTP_4_2_7P67
+
+ util/ntp-keygen-opts.h@1.65 +3 -3
+ NTP_4_2_7P67
+
+ util/ntp-keygen-opts.texi@1.68 +2 -2
+ NTP_4_2_7P67
+
+ util/ntp-keygen.1@1.68 +2 -2
+ NTP_4_2_7P67
+
+ChangeSet@1.2156.1.116, 2010-10-19 21:30:15+00:00, davehart@shiny.ad.hartbrothers.com
+ Exclude keyword-gen.c and ntp_parser.y from release as well as
+ debug Windows builds.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.30 +16 -0
+ Exclude keyword-gen.c and ntp_parser.y from release as well as
+ debug Windows builds.
+
+ChangeSet@1.2082.30.1, 2010-10-19 21:10:14+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1649] Require NMEA checksum if $GPRMC or previously seen.
+
+ ChangeLog@1.496.26.89 +4 -0
+ [Bug 1649] Require NMEA checksum if $GPRMC or previously seen.
+
+ ntpd/refclock_nmea.c@1.46.2.1 +104 -56
+ [Bug 1649] Require NMEA checksum if $GPRMC or previously seen.
+
+ChangeSet@1.2156.1.114, 2010-10-19 10:10:23+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P66
+ TAG: NTP_4_2_7P66
+
+ ChangeLog@1.622.1.65 +1 -0
+ NTP_4_2_7P66
+
+ ntpd/ntpd-opts.c@1.69 +2 -2
+ NTP_4_2_7P66
+
+ ntpd/ntpd-opts.h@1.69 +3 -3
+ NTP_4_2_7P66
+
+ ntpd/ntpd-opts.texi@1.68 +2 -2
+ NTP_4_2_7P66
+
+ ntpd/ntpd.1@1.68 +2 -2
+ NTP_4_2_7P66
+
+ ntpdc/ntpdc-opts.c@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpdc/ntpdc-opts.h@1.67 +3 -3
+ NTP_4_2_7P66
+
+ ntpdc/ntpdc-opts.texi@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpdc/ntpdc.1@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpq/ntpq-opts.c@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpq/ntpq-opts.h@1.67 +3 -3
+ NTP_4_2_7P66
+
+ ntpq/ntpq-opts.texi@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpq/ntpq.1@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.67 +3 -3
+ NTP_4_2_7P66
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.67 +2 -2
+ NTP_4_2_7P66
+
+ ntpsnmpd/ntpsnmpd.1@1.67 +2 -2
+ NTP_4_2_7P66
+
+ packageinfo.sh@1.68 +1 -1
+ NTP_4_2_7P66
+
+ sntp/sntp-opts.c@1.67 +2 -2
+ NTP_4_2_7P66
+
+ sntp/sntp-opts.h@1.67 +3 -3
+ NTP_4_2_7P66
+
+ sntp/sntp-opts.texi@1.67 +1 -1
+ NTP_4_2_7P66
+
+ sntp/sntp.1@1.67 +2 -2
+ NTP_4_2_7P66
+
+ sntp/sntp.html@1.67 +1 -1
+ NTP_4_2_7P66
+
+ util/ntp-keygen-opts.c@1.64 +2 -2
+ NTP_4_2_7P66
+
+ util/ntp-keygen-opts.h@1.64 +3 -3
+ NTP_4_2_7P66
+
+ util/ntp-keygen-opts.texi@1.67 +2 -2
+ NTP_4_2_7P66
+
+ util/ntp-keygen.1@1.67 +2 -2
+ NTP_4_2_7P66
+
+ChangeSet@1.2156.1.113, 2010-10-18 20:15:32-04:00, stenn@deacon.udel.edu
+ ChangeLog:
+ * [Bug 1277] Provide and use O(1) FIFOs, esp. in the config tree code.
+ * Remove unused 'bias' configuration keyword.
+
+ ChangeLog@1.622.1.64 +2 -0
+ * [Bug 1277] Provide and use O(1) FIFOs, esp. in the config tree code.
+ * Remove unused 'bias' configuration keyword.
+
+ChangeSet@1.2156.1.112, 2010-10-18 15:42:39+00:00, davehart@shiny.ad.hartbrothers.com
+ quiet ntpdsim build warnings about unused funcs,
+
+ include/ntpd.h@1.142 +1 -2
+ quiet ntpdsim build warnings about unused funcs,
+
+ libntp/emalloc.c@1.13 +2 -0
+ warning pointed out bug
+
+ ntpd/ntp_config.c@1.269 +57 -33
+ quiet ntpdsim build warnings about unused funcs,
+
+ ntpd/ntp_scanner.h@1.17 +2 -0
+ quiet ntpdsim build warnings about unused funcs,
+
+ ntpd/ntpsim.c@1.28 +1 -1
+ do the header shuffle
+
+ChangeSet@1.2156.1.111, 2010-10-18 14:49:33+00:00, davehart@shiny.ad.hartbrothers.com
+ merge cleanup, simulator fixes, generated files from previous merge.
+
+ ntpd/keyword-gen-utd@1.11 +1 -1
+ generated from previously merged source
+
+ ntpd/ntp_keyword.h@1.13 +705 -709
+ generated from previously merged source
+
+ ntpd/ntp_parser.c@1.66 +1298 -1173
+ generated from previously merged source
+
+ ntpd/ntp_parser.h@1.40 +133 -132
+ generated from previously merged source
+
+ ntpd/ntp_parser.y@1.59 +6 -3
+ merge cleanup, simulator fix
+
+ ntpd/ntpsim.c@1.27 +5 -5
+ correct config tree walking in simulator
+
+ChangeSet@1.2156.16.1, 2010-10-18 13:35:09+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ include/Makefile.am@1.40 +1 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build
+
+ include/ntp_config.h@1.69 +204 -125
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ include/ntp_lists.h@1.8 +142 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Add FIFO (A.K.A. STAILQ) macros.
+
+ include/ntp_prio_q.h@1.7.1.2 +6 -7
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build
+
+ include/ntp_prio_q.h@1.7.1.1 +0 -0
+ Rename: include/ntp_data_structures.h -> include/ntp_prio_q.h
+
+ include/ntp_stdlib.h@1.47 +5 -3
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ add emalloc_zero()
+
+ include/ntpd.h@1.141 +2 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ include/ntpsim.h@1.15 +22 -17
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ libntp/emalloc.c@1.12 +20 -3
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ add emalloc_zero()
+
+ libntp/ntp_rfc2553.c@1.43 +2 -2
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ add emalloc_zero()
+
+ ntpd/Makefile.am@1.94 +1 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build
+
+ ntpd/complete.conf@1.9 +1 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Remove unused "bias" server option
+
+ ntpd/keyword-gen-utd@1.7.1.1 +1 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Remove unused "bias" server option
+
+ ntpd/keyword-gen.c@1.12.1.1 +0 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Remove unused "bias" server option
+
+ ntpd/ntp_config.c@1.263.1.1 +1008 -1074
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ ntpd/ntp_filegen.c@1.17.1.1 +1 -1
+ whitespace only
+
+ ntpd/ntp_keyword.h@1.9.1.1 +713 -717
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Remove unused "bias" server option
+
+ ntpd/ntp_parser.c@1.59.1.1 +1508 -1373
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ ntpd/ntp_parser.h@1.37.1.1 +139 -139
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ ntpd/ntp_parser.y@1.54.1.1 +483 -263
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ ntpd/ntp_prio_q.c@1.12.1.2 +5 -5
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build
+
+ ntpd/ntp_prio_q.c@1.12.1.1 +0 -0
+ Rename: ntpd/ntp_data_structures.c -> ntpd/ntp_prio_q.c
+
+ ntpd/ntp_scanner.h@1.16 +1 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ ntpd/ntp_util.c@1.82.1.1 +1 -1
+ whitespace only
+
+ ntpd/ntpsim.c@1.24.1.1 +0 -1
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+
+ ports/winnt/vc6/ntpd.dsp@1.47.1.1 +0 -4
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build.
+
+ ports/winnt/vs2003/ntpd.vcproj@1.8.1.1 +0 -22
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.8.1.1 +0 -22
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.27.1.1 +24 -8
+ [Bug 1277] provide, use O(1) FIFOs, esp. config tree.
+ Rename ntp_data_structures.[ch] to ntp_prio_q.[ch], use
+ them only in the simulator build.
+
+ChangeSet@1.2156.1.109, 2010-10-16 05:20:17+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P65
+ TAG: NTP_4_2_7P65
+
+ ChangeLog@1.622.1.63 +1 -0
+ NTP_4_2_7P65
+
+ ntpd/ntpd-opts.c@1.68 +2 -2
+ NTP_4_2_7P65
+
+ ntpd/ntpd-opts.h@1.68 +3 -3
+ NTP_4_2_7P65
+
+ ntpd/ntpd-opts.texi@1.67 +2 -2
+ NTP_4_2_7P65
+
+ ntpd/ntpd.1@1.67 +2 -2
+ NTP_4_2_7P65
+
+ ntpdc/ntpdc-opts.c@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpdc/ntpdc-opts.h@1.66 +3 -3
+ NTP_4_2_7P65
+
+ ntpdc/ntpdc-opts.texi@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpdc/ntpdc.1@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpq/ntpq-opts.c@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpq/ntpq-opts.h@1.66 +3 -3
+ NTP_4_2_7P65
+
+ ntpq/ntpq-opts.texi@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpq/ntpq.1@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.66 +3 -3
+ NTP_4_2_7P65
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.66 +2 -2
+ NTP_4_2_7P65
+
+ ntpsnmpd/ntpsnmpd.1@1.66 +2 -2
+ NTP_4_2_7P65
+
+ packageinfo.sh@1.67 +1 -1
+ NTP_4_2_7P65
+
+ sntp/sntp-opts.c@1.66 +2 -2
+ NTP_4_2_7P65
+
+ sntp/sntp-opts.h@1.66 +3 -3
+ NTP_4_2_7P65
+
+ sntp/sntp-opts.texi@1.66 +1 -1
+ NTP_4_2_7P65
+
+ sntp/sntp.1@1.66 +2 -2
+ NTP_4_2_7P65
+
+ sntp/sntp.html@1.66 +1 -1
+ NTP_4_2_7P65
+
+ util/ntp-keygen-opts.c@1.63 +2 -2
+ NTP_4_2_7P65
+
+ util/ntp-keygen-opts.h@1.63 +3 -3
+ NTP_4_2_7P65
+
+ util/ntp-keygen-opts.texi@1.66 +2 -2
+ NTP_4_2_7P65
+
+ util/ntp-keygen.1@1.66 +2 -2
+ NTP_4_2_7P65
+
+ChangeSet@1.2082.4.120, 2010-10-16 04:24:10+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC4
+ TAG: NTP_4_2_6P3_RC4
+
+ ChangeLog@1.496.26.88 +1 -0
+ NTP_4_2_6P3_RC4
+
+ ntpd/ntpd-opts.c@1.248.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpd/ntpd-opts.h@1.248.20.1 +3 -3
+ NTP_4_2_6P3_RC4
+
+ ntpd/ntpd-opts.texi@1.246.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpd/ntpd.1@1.246.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpdc/ntpdc-opts.c@1.244.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpdc/ntpdc-opts.h@1.244.20.1 +3 -3
+ NTP_4_2_6P3_RC4
+
+ ntpdc/ntpdc-opts.texi@1.243.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpdc/ntpdc.1@1.243.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpq/ntpq-opts.c@1.245.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpq/ntpq-opts.h@1.245.20.1 +3 -3
+ NTP_4_2_6P3_RC4
+
+ ntpq/ntpq-opts.texi@1.244.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpq/ntpq.1@1.244.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.21.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.21.1 +3 -3
+ NTP_4_2_6P3_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.21.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ ntpsnmpd/ntpsnmpd.1@1.122.21.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ packageinfo.sh@1.255.22.1 +1 -1
+ NTP_4_2_6P3_RC4
+
+ sntp/sntp-opts.c@1.117.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ sntp/sntp-opts.h@1.117.20.1 +3 -3
+ NTP_4_2_6P3_RC4
+
+ sntp/sntp-opts.texi@1.117.20.1 +1 -1
+ NTP_4_2_6P3_RC4
+
+ sntp/sntp.1@1.117.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ sntp/sntp.html@1.7.20.1 +1 -1
+ NTP_4_2_6P3_RC4
+
+ util/ntp-keygen-opts.c@1.247.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ util/ntp-keygen-opts.h@1.247.20.1 +3 -3
+ NTP_4_2_6P3_RC4
+
+ util/ntp-keygen-opts.texi@1.246.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ util/ntp-keygen.1@1.246.20.1 +2 -2
+ NTP_4_2_6P3_RC4
+
+ChangeSet@1.2082.29.1, 2010-10-16 04:02:17+00:00, davehart@shiny.ad.hartbrothers.com
+ min/max confusion in ntpsnmpd change
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.3.1.3 +4 -1
+ min/max confusion
+
+ChangeSet@1.2082.4.118, 2010-10-15 23:52:31-04:00, stenn@deacon.udel.edu
+ Update NEWS to 4.2.6p3-RC4
+
+ NEWS@1.110 +7 -0
+ Update to 4.2.6p3-RC4
+
+ChangeSet@1.2156.1.106, 2010-10-16 01:18:29+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove 'calldelay' and 'sign' remnants from parser, ntp_config.c.
+
+ ChangeLog@1.622.1.61 +1 -0
+ Remove 'calldelay' and 'sign' remnants from parser, ntp_config.c.
+
+ ntpd/keyword-gen-utd@1.9 +1 -1
+ cascade from ntp_parser.h update
+
+ ntpd/ntp_config.c@1.267 +0 -4
+ Remove 'calldelay' and 'sign' remnants from parser, ntp_config.c.
+
+ ntpd/ntp_keyword.h@1.11 +460 -462
+ cascade from ntp_parser.h update
+
+ ntpd/ntp_parser.c@1.64 +1308 -1334
+ Bison output fromm ntp_parser.y
+
+ ntpd/ntp_parser.h@1.38 +320 -325
+ Bison output fromm ntp_parser.y
+
+ ntpd/ntp_parser.y@1.57 +0 -6
+ Remove 'calldelay' and 'sign' remnants from parser, ntp_config.c.
+
+ChangeSet@1.2082.4.117, 2010-10-16 00:40:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1584] wrong SNMP type for precision, resolution.
+
+ ChangeLog@1.496.26.87 +1 -0
+ [Bug 1584] wrong SNMP type for precision, resolution.
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.3.1.2 +160 -130
+ Correct ASN type for ntp_EntTimeResolution and ntp_EntTimePrecision.
+ Use precision as best guess for unavailable resolution.
+
+ ntpsnmpd/ntpSnmpSubagentObject.h@1.4 +6 -6
+ const fun
+
+ChangeSet@1.2156.1.104, 2010-10-15 07:18:13+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P64
+ TAG: NTP_4_2_7P64
+
+ ChangeLog@1.622.1.59 +1 -0
+ NTP_4_2_7P64
+
+ ntpd/ntpd-opts.c@1.67 +2 -2
+ NTP_4_2_7P64
+
+ ntpd/ntpd-opts.h@1.67 +3 -3
+ NTP_4_2_7P64
+
+ ntpd/ntpd-opts.texi@1.66 +2 -2
+ NTP_4_2_7P64
+
+ ntpd/ntpd.1@1.66 +2 -2
+ NTP_4_2_7P64
+
+ ntpdc/ntpdc-opts.c@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpdc/ntpdc-opts.h@1.65 +3 -3
+ NTP_4_2_7P64
+
+ ntpdc/ntpdc-opts.texi@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpdc/ntpdc.1@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpq/ntpq-opts.c@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpq/ntpq-opts.h@1.65 +3 -3
+ NTP_4_2_7P64
+
+ ntpq/ntpq-opts.texi@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpq/ntpq.1@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.65 +3 -3
+ NTP_4_2_7P64
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.65 +2 -2
+ NTP_4_2_7P64
+
+ ntpsnmpd/ntpsnmpd.1@1.65 +2 -2
+ NTP_4_2_7P64
+
+ packageinfo.sh@1.66 +1 -1
+ NTP_4_2_7P64
+
+ sntp/sntp-opts.c@1.65 +2 -2
+ NTP_4_2_7P64
+
+ sntp/sntp-opts.h@1.65 +3 -3
+ NTP_4_2_7P64
+
+ sntp/sntp-opts.texi@1.65 +1 -1
+ NTP_4_2_7P64
+
+ sntp/sntp.1@1.65 +2 -2
+ NTP_4_2_7P64
+
+ sntp/sntp.html@1.65 +1 -1
+ NTP_4_2_7P64
+
+ util/ntp-keygen-opts.c@1.62 +2 -2
+ NTP_4_2_7P64
+
+ util/ntp-keygen-opts.h@1.62 +3 -3
+ NTP_4_2_7P64
+
+ util/ntp-keygen-opts.texi@1.65 +2 -2
+ NTP_4_2_7P64
+
+ util/ntp-keygen.1@1.65 +2 -2
+ NTP_4_2_7P64
+
+ChangeSet@1.2156.1.103, 2010-10-15 03:00:04-04:00, stenn@deacon.udel.edu
+ typo cleanup
+
+ ChangeLog@1.622.1.58 +2 -2
+ typo cleanup
+
+ChangeSet@1.2156.1.102, 2010-10-15 02:56:35-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.65 +4 -4
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.53 +9 -9
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.17 +15 -15
+ Documentation updates from Dave Mills
+
+ html/drivers/driver16.html@1.11 +24 -24
+ Documentation updates from Dave Mills
+
+ html/drivers/driver2.html@1.12 +50 -50
+ Documentation updates from Dave Mills
+
+ html/drivers/driver5.html@1.13 +65 -65
+ Documentation updates from Dave Mills
+
+ html/pic/fig_3_1.gif@1.2 +232 -527
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.12 +3 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.101, 2010-10-15 02:24:55-04:00, stenn@deacon.udel.edu
+ Remove 'calldelay' and 'sign' keywords (Dave Mills)
+
+ ChangeLog@1.622.1.57 +1 -0
+ Remove 'calldelay' and 'sign' keywords (Dave Mills)
+
+ include/ntp_crypto.h@1.50 +3 -4
+ Remove 'calldelay' and 'sign' keywords (Dave Mills)
+
+ ntpd/ntp_config.c@1.266 +1 -5
+ Remove 'calldelay' and 'sign' keywords (Dave Mills)
+
+ChangeSet@1.2156.1.100, 2010-10-15 01:56:16+00:00, davehart@shiny.ad.hartbrothers.com
+ removed unused "calldelay" and "sign" tokens from keyword
+ scanner, yet to be removed from parser once DLM's update
+ to ntp_config.c is integrated.
+
+ ntpd/keyword-gen-utd@1.8 +1 -1
+ removed unused "calldelay" and "sign" tokens from keyword
+ scanner, yet to be removed from parser once DLM's update
+ to ntp_config.c is integrated.
+
+ ntpd/keyword-gen.c@1.13 +0 -2
+ removed unused "calldelay" and "sign" tokens from keyword
+ scanner, yet to be removed from parser once DLM's update
+ to ntp_config.c is integrated.
+
+ ntpd/ntp_keyword.h@1.10 +571 -579
+ removed unused "calldelay" and "sign" tokens from keyword
+ scanner, yet to be removed from parser once DLM's update
+ to ntp_config.c is integrated.
+
+ChangeSet@1.2156.1.99, 2010-10-15 00:23:01+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1663] ntpdsim should not open net sockets.
+
+ ChangeLog@1.622.1.56 +1 -0
+ [Bug 1663] ntpdsim should not open net sockets.
+
+ include/ntp_data_structures.h@1.8 +13 -9
+ [Bug 1663] ntpdsim should not open net sockets.
+
+ ntpd/ntp_data_structures.c@1.13 +4 -6
+ [Bug 1663] ntpdsim should not open net sockets.
+
+ ntpd/ntp_io.c@1.323 +4 -4
+ [Bug 1663] ntpdsim should not open net sockets.
+
+ ntpd/ntp_timer.c@1.61 +2 -2
+ [Bug 1663] ntpdsim should not open net sockets.
+
+ ntpd/ntpsim.c@1.25 +102 -89
+ [Bug 1663] ntpdsim should not open net sockets.
+
+ChangeSet@1.2082.4.116, 2010-10-14 19:13:29+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE.
+
+ ChangeLog@1.496.26.86 +1 -0
+ [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE.
+
+ ports/winnt/include/config.h@1.79.1.3 +1 -1
+ [Bug 1659] Need CLOCK_TRUETIME not CLOCK_TRUE.
+
+ChangeSet@1.2082.4.115, 2010-10-14 14:47:37+00:00, davehart@shiny.ad.hartbrothers.com
+ constantly more fun
+
+ ntpq/libntpq.c@1.3.1.4 +6 -6
+ constantly more fun
+
+ChangeSet@1.2156.1.96, 2010-10-14 14:32:58+00:00, davehart@shiny.ad.hartbrothers.com
+ correct prior merge of ntpq.c
+
+ ntpq/libntpq.c@1.7 +6 -6
+ more const fun
+
+ ntpq/ntpq.c@1.118 +0 -70
+ correct prior merge of ntpq.c
+
+ChangeSet@1.2082.4.114, 2010-10-14 14:07:21+00:00, davehart@shiny.ad.hartbrothers.com
+ const additions needed for ntp-dev
+
+ ChangeLog@1.496.26.85 +1 -0
+ [Bug 1665] is_anycast() u_int32_t should be u_int32.
+ const additions needed for ntp-dev
+
+ ntpd/ntp_io.c@1.306.1.6 +1 -1
+ [Bug 1665] is_anycast() u_int32_t should be u_int32.
+
+ ntpq/libntpq.c@1.3.1.3 +66 -62
+ const additions needed for ntp-dev
+
+ ntpq/libntpq.h@1.3.1.2 +2 -2
+ const additions needed for ntp-dev
+
+ ntpq/libntpq_subs.c@1.2.1.1 +13 -3
+ const additions needed for ntp-dev
+
+ ntpq/ntpq-subs.c@1.39.2.4 +42 -38
+ const additions needed for ntp-dev
+
+ ntpq/ntpq.c@1.97.1.6 +144 -84
+ const additions needed for ntp-dev
+
+ ntpq/ntpq.h@1.10.1.3 +7 -3
+ const additions needed for ntp-dev
+
+ChangeSet@1.2082.4.113, 2010-10-14 09:38:42+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpsnmpd, libntpq warning cleanup.
+
+
+ ChangeLog@1.496.26.84 +5 -1
+ ntpsnmpd, libntpq warning cleanup.
+
+
+ ntpq/libntpq.c@1.3.1.2 +1 -1
+ ntpsnmpd, libntpq warning cleanup.
+
+
+ ntpsnmpd/ntpsnmpd.c@1.3.1.3 +1 -2
+ ntpsnmpd, libntpq warning cleanup.
+
+
+ChangeSet@1.2082.4.112, 2010-10-14 07:51:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC3
+ TAG: NTP_4_2_6P3_RC3
+
+ ChangeLog@1.496.26.83 +1 -0
+ NTP_4_2_6P3_RC3
+
+ ntpd/ntpd-opts.c@1.248.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpd/ntpd-opts.h@1.248.19.1 +3 -3
+ NTP_4_2_6P3_RC3
+
+ ntpd/ntpd-opts.texi@1.246.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpd/ntpd.1@1.246.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpdc/ntpdc-opts.c@1.244.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpdc/ntpdc-opts.h@1.244.19.1 +3 -3
+ NTP_4_2_6P3_RC3
+
+ ntpdc/ntpdc-opts.texi@1.243.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpdc/ntpdc.1@1.243.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpq/ntpq-opts.c@1.245.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpq/ntpq-opts.h@1.245.19.1 +3 -3
+ NTP_4_2_6P3_RC3
+
+ ntpq/ntpq-opts.texi@1.244.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpq/ntpq.1@1.244.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.20.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.20.1 +3 -3
+ NTP_4_2_6P3_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.20.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ ntpsnmpd/ntpsnmpd.1@1.122.20.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ packageinfo.sh@1.255.21.1 +1 -1
+ NTP_4_2_6P3_RC3
+
+ sntp/sntp-opts.c@1.117.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ sntp/sntp-opts.h@1.117.19.1 +3 -3
+ NTP_4_2_6P3_RC3
+
+ sntp/sntp-opts.texi@1.117.19.1 +1 -1
+ NTP_4_2_6P3_RC3
+
+ sntp/sntp.1@1.117.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ sntp/sntp.html@1.7.19.1 +1 -1
+ NTP_4_2_6P3_RC3
+
+ util/ntp-keygen-opts.c@1.247.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ util/ntp-keygen-opts.h@1.247.19.1 +3 -3
+ NTP_4_2_6P3_RC3
+
+ util/ntp-keygen-opts.texi@1.246.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ util/ntp-keygen.1@1.246.19.1 +2 -2
+ NTP_4_2_6P3_RC3
+
+ChangeSet@1.2082.4.110, 2010-10-14 03:19:02-04:00, stenn@deacon.udel.edu
+ Update the NEWS file
+
+ NEWS@1.109 +5 -1
+ Update the NEWS file
+
+ChangeSet@1.2156.1.93, 2010-10-14 02:34:58-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.52 +1 -0
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.34 +14 -18
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.16 +3 -3
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.11 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.92, 2010-10-13 10:13:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P63
+ TAG: NTP_4_2_7P63
+
+ ChangeLog@1.622.1.51 +1 -0
+ NTP_4_2_7P63
+
+ ntpd/ntpd-opts.c@1.66 +2 -2
+ NTP_4_2_7P63
+
+ ntpd/ntpd-opts.h@1.66 +3 -3
+ NTP_4_2_7P63
+
+ ntpd/ntpd-opts.texi@1.65 +2 -2
+ NTP_4_2_7P63
+
+ ntpd/ntpd.1@1.65 +2 -2
+ NTP_4_2_7P63
+
+ ntpdc/ntpdc-opts.c@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpdc/ntpdc-opts.h@1.64 +3 -3
+ NTP_4_2_7P63
+
+ ntpdc/ntpdc-opts.texi@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpdc/ntpdc.1@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpq/ntpq-opts.c@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpq/ntpq-opts.h@1.64 +3 -3
+ NTP_4_2_7P63
+
+ ntpq/ntpq-opts.texi@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpq/ntpq.1@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.64 +3 -3
+ NTP_4_2_7P63
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.64 +2 -2
+ NTP_4_2_7P63
+
+ ntpsnmpd/ntpsnmpd.1@1.64 +2 -2
+ NTP_4_2_7P63
+
+ packageinfo.sh@1.65 +1 -1
+ NTP_4_2_7P63
+
+ sntp/sntp-opts.c@1.64 +2 -2
+ NTP_4_2_7P63
+
+ sntp/sntp-opts.h@1.64 +3 -3
+ NTP_4_2_7P63
+
+ sntp/sntp-opts.texi@1.64 +1 -1
+ NTP_4_2_7P63
+
+ sntp/sntp.1@1.64 +2 -2
+ NTP_4_2_7P63
+
+ sntp/sntp.html@1.64 +1 -1
+ NTP_4_2_7P63
+
+ util/ntp-keygen-opts.c@1.61 +2 -2
+ NTP_4_2_7P63
+
+ util/ntp-keygen-opts.h@1.61 +3 -3
+ NTP_4_2_7P63
+
+ util/ntp-keygen-opts.texi@1.64 +2 -2
+ NTP_4_2_7P63
+
+ util/ntp-keygen.1@1.64 +2 -2
+ NTP_4_2_7P63
+
+ChangeSet@1.2156.15.1, 2010-10-13 02:10:33-04:00, stenn@deacon.udel.edu
+ Add missing [bug 750] update to Changelog
+
+ ChangeLog@1.622.6.1 +2 -0
+ Add missing [bug 750] update to Changelog
+
+ChangeSet@1.2156.1.89, 2010-10-12 21:33:17-07:00, stenn@stenn.ntp.org
+ Documentation nit cleanup
+
+ ChangeLog@1.622.1.48 +1 -0
+ Documentation nit cleanup
+
+ html/drivers/driver38.html@1.14 +1 -1
+ Documentation nit cleanup
+
+ html/parsenew.html@1.12 +2 -2
+ Documentation nit cleanup
+
+ChangeSet@1.2156.1.88, 2010-10-13 00:19:17-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.47 +1 -0
+ Documentation updates from Dave Mills
+
+ html/poll.html@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/poll.html
+
+ html/poll.html@1.0 +0 -0
+
+ChangeSet@1.2082.22.21, 2010-10-12 14:27:43+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1080] ntpd on ipv6 routers very chatty.
+
+ ChangeLog@1.496.47.17 +1 -0
+ [Bug 1080] ntpd on ipv6 routers very chatty.
+
+ configure.ac@1.465.1.14 +33 -11
+ [Bug 1080] ntpd on ipv6 routers very chatty.
+
+ include/ntp_net.h@1.3.1.2 +9 -0
+ [Bug 1080] ntpd on ipv6 routers very chatty.
+
+ ntpd/ntp_io.c@1.306.1.5 +39 -0
+ [Bug 1080] ntpd on ipv6 routers very chatty.
+ patch originally supplied to freebsd's head/contrib/ntp/ntpd/ntp_io.c
+ by ume@freebsd.org
+ http://www.mail-archive.com/svn-src-all@freebsd.org/msg16141.html
+
+ChangeSet@1.2156.1.87, 2010-10-12 10:13:07+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P62
+ TAG: NTP_4_2_7P62
+
+ ChangeLog@1.622.1.46 +1 -0
+ NTP_4_2_7P62
+
+ ntpd/ntpd-opts.c@1.65 +2 -2
+ NTP_4_2_7P62
+
+ ntpd/ntpd-opts.h@1.65 +3 -3
+ NTP_4_2_7P62
+
+ ntpd/ntpd-opts.texi@1.64 +2 -2
+ NTP_4_2_7P62
+
+ ntpd/ntpd.1@1.64 +2 -2
+ NTP_4_2_7P62
+
+ ntpdc/ntpdc-opts.c@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpdc/ntpdc-opts.h@1.63 +3 -3
+ NTP_4_2_7P62
+
+ ntpdc/ntpdc-opts.texi@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpdc/ntpdc.1@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpq/ntpq-opts.c@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpq/ntpq-opts.h@1.63 +3 -3
+ NTP_4_2_7P62
+
+ ntpq/ntpq-opts.texi@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpq/ntpq.1@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.63 +3 -3
+ NTP_4_2_7P62
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.63 +2 -2
+ NTP_4_2_7P62
+
+ ntpsnmpd/ntpsnmpd.1@1.63 +2 -2
+ NTP_4_2_7P62
+
+ packageinfo.sh@1.64 +1 -1
+ NTP_4_2_7P62
+
+ sntp/sntp-opts.c@1.63 +2 -2
+ NTP_4_2_7P62
+
+ sntp/sntp-opts.h@1.63 +3 -3
+ NTP_4_2_7P62
+
+ sntp/sntp-opts.texi@1.63 +1 -1
+ NTP_4_2_7P62
+
+ sntp/sntp.1@1.63 +2 -2
+ NTP_4_2_7P62
+
+ sntp/sntp.html@1.63 +1 -1
+ NTP_4_2_7P62
+
+ util/ntp-keygen-opts.c@1.60 +2 -2
+ NTP_4_2_7P62
+
+ util/ntp-keygen-opts.h@1.60 +3 -3
+ NTP_4_2_7P62
+
+ util/ntp-keygen-opts.texi@1.63 +2 -2
+ NTP_4_2_7P62
+
+ util/ntp-keygen.1@1.63 +2 -2
+ NTP_4_2_7P62
+
+ChangeSet@1.2082.22.20, 2010-10-12 01:28:24-04:00, stenn@deacon.udel.edu
+ [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver
+
+ ChangeLog@1.496.47.16 +7 -7
+ [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver
+
+ ntpd/refclock_ripencc.c@1.7.1.5 +1 -1
+ [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver
+
+ChangeSet@1.2082.22.19, 2010-10-12 01:06:48-04:00, stenn@deacon.udel.edu
+ [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver
+
+ ChangeLog@1.496.47.15 +3 -2
+ [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver
+
+ ntpd/refclock_ripencc.c@1.7.1.4 +18 -9
+ [Bug 750]: Non-existing device causes coredump with RIPE-NCC driver
+
+ChangeSet@1.2156.1.84, 2010-10-12 00:11:52-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.43 +1 -0
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.33 +8 -9
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.52 +38 -113
+ Documentation updates from Dave Mills
+
+ html/discipline.html@1.3 +2 -8
+ Documentation updates from Dave Mills
+
+ html/ntpq.html@1.42 +2 -2
+ Documentation updates from Dave Mills
+
+ html/scripts/special.txt@1.5 +1 -0
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.10 +12 -10
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.83, 2010-10-12 00:06:48-04:00, stenn@deacon.udel.edu
+ Lose peer_count from ntp_peer.c and ntp_proto.c (Dave Mills)
+
+ ChangeLog@1.622.1.42 +1 -0
+ Lose peer_count from ntp_peer.c and ntp_proto.c (Dave Mills)
+
+ ntpd/ntp_peer.c@1.135 +1 -8
+ Lose peer_count from ntp_peer.c and ntp_proto.c (Dave Mills)
+
+ ntpd/ntp_proto.c@1.307 +10 -5
+ Lose peer_count from ntp_peer.c and ntp_proto.c (Dave Mills)
+
+ChangeSet@1.2082.22.17, 2010-10-11 20:18:23-07:00, stenn@stenn.ntp.org
+ [Bug 1661]: Re-indent refclock_ripencc.c
+
+ ChangeLog@1.496.47.13 +1 -0
+ [Bug 1661]: Re-indent refclock_ripencc.c
+
+ ntpd/refclock_ripencc.c@1.7.1.3 +1909 -1530
+ [Bug 1661]: Re-indent refclock_ripencc.c
+
+ChangeSet@1.2082.28.1, 2010-10-11 22:36:49-04:00, stenn@deacon.udel.edu
+ [Bug 1660]: On some systems, test is in /usr/bin, not /bin
+
+ ChangeLog@1.496.51.1 +1 -0
+ [Bug 1660]: On some systems, test is in /usr/bin, not /bin
+
+ Makefile.am@1.93.2.1 +1 -1
+ [Bug 1660]: On some systems, test is in /usr/bin, not /bin
+
+ configure.ac@1.465.1.13 +3 -1
+ [Bug 1660]: On some systems, test is in /usr/bin, not /bin
+
+ChangeSet@1.2082.27.1, 2010-10-12 01:16:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ChangeLog@1.496.50.1 +1 -0
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ntpq/libntpq.c@1.3.1.1 +58 -65
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ntpq/libntpq.h@1.3.1.1 +5 -5
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ntpsnmpd/Makefile.am@1.16.1.4 +2 -2
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.3.1.1 +96 -285
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ntpsnmpd/ntpSnmpSubagentObject.h@1.3 +41 -35
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ntpsnmpd/ntp_snmp.h@1.1 +34 -0
+ work around PACKAGE_* redefinitions with net-snmp/net-snmp-config.h
+
+ ntpsnmpd/ntp_snmp.h@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.c@1.3.1.2 +1 -11
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ ntpsnmpd/ntpv4-mib.mib@1.2 +244 -357
+ [Bug 1584]: ntpsnmpd OID must be mib-2.197.
+
+ChangeSet@1.2082.26.3, 2010-10-09 10:10:10+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ ChangeLog@1.496.49.2 +4 -2
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ ntpd/refclock_arbiter.c@1.16 +34 -9
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+
+
+ ntpd/refclock_true.c@1.11.1.2 +15 -0
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ ports/winnt/include/config.h@1.79.1.2 +2 -0
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ ports/winnt/vc6/ntpd.dsp@1.39.1.3 +0 -2
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ ports/winnt/vs2003/ntpd.vcproj@1.4.1.1 +4 -8
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ ports/winnt/vs2005/ntpd.vcproj@1.4.1.1 +0 -4
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.21.1.2 +0 -4
+ [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+ [Bug 1659] Support Truetime Satellite Clocks on Windows.
+
+
+ChangeSet@1.2156.1.80, 2010-10-06 10:09:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P61
+ TAG: NTP_4_2_7P61
+
+ ChangeLog@1.622.1.39 +1 -0
+ NTP_4_2_7P61
+
+ ntpd/ntpd-opts.c@1.64 +2 -2
+ NTP_4_2_7P61
+
+ ntpd/ntpd-opts.h@1.64 +3 -3
+ NTP_4_2_7P61
+
+ ntpd/ntpd-opts.texi@1.63 +2 -2
+ NTP_4_2_7P61
+
+ ntpd/ntpd.1@1.63 +2 -2
+ NTP_4_2_7P61
+
+ ntpdc/ntpdc-opts.c@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpdc/ntpdc-opts.h@1.62 +3 -3
+ NTP_4_2_7P61
+
+ ntpdc/ntpdc-opts.texi@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpdc/ntpdc.1@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpq/ntpq-opts.c@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpq/ntpq-opts.h@1.62 +3 -3
+ NTP_4_2_7P61
+
+ ntpq/ntpq-opts.texi@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpq/ntpq.1@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.62 +3 -3
+ NTP_4_2_7P61
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.62 +2 -2
+ NTP_4_2_7P61
+
+ ntpsnmpd/ntpsnmpd.1@1.62 +2 -2
+ NTP_4_2_7P61
+
+ packageinfo.sh@1.63 +1 -1
+ NTP_4_2_7P61
+
+ sntp/sntp-opts.c@1.62 +2 -2
+ NTP_4_2_7P61
+
+ sntp/sntp-opts.h@1.62 +3 -3
+ NTP_4_2_7P61
+
+ sntp/sntp-opts.texi@1.62 +1 -1
+ NTP_4_2_7P61
+
+ sntp/sntp.1@1.62 +2 -2
+ NTP_4_2_7P61
+
+ sntp/sntp.html@1.62 +1 -1
+ NTP_4_2_7P61
+
+ util/ntp-keygen-opts.c@1.59 +2 -2
+ NTP_4_2_7P61
+
+ util/ntp-keygen-opts.h@1.59 +3 -3
+ NTP_4_2_7P61
+
+ util/ntp-keygen-opts.texi@1.62 +2 -2
+ NTP_4_2_7P61
+
+ util/ntp-keygen.1@1.62 +2 -2
+ NTP_4_2_7P61
+
+ChangeSet@1.2156.1.79, 2010-10-06 00:17:06-04:00, stenn@deacon.udel.edu
+ Documentation and code cleanup from Dave Mills. No more NTP_MAXASSOC.
+
+ ChangeLog@1.622.1.38 +1 -0
+ Documentation and code cleanup from Dave Mills. No more NTP_MAXASSOC.
+
+ html/cluster.html@1.2 +5 -6
+ Documentation and code cleanup from Dave Mills. No more NTP_MAXASSOC.
+
+ include/ntp.h@1.182 +0 -1
+ Documentation and code cleanup from Dave Mills. No more NTP_MAXASSOC.
+
+ ntpd/ntp_proto.c@1.306 +40 -63
+ Documentation and code cleanup from Dave Mills. No more NTP_MAXASSOC.
+
+ChangeSet@1.2156.1.78, 2010-10-04 10:13:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P60
+ TAG: NTP_4_2_7P60
+
+ ChangeLog@1.622.1.37 +1 -0
+ NTP_4_2_7P60
+
+ ntpd/ntpd-opts.c@1.63 +2 -2
+ NTP_4_2_7P60
+
+ ntpd/ntpd-opts.h@1.63 +3 -3
+ NTP_4_2_7P60
+
+ ntpd/ntpd-opts.texi@1.62 +2 -2
+ NTP_4_2_7P60
+
+ ntpd/ntpd.1@1.62 +2 -2
+ NTP_4_2_7P60
+
+ ntpdc/ntpdc-opts.c@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpdc/ntpdc-opts.h@1.61 +3 -3
+ NTP_4_2_7P60
+
+ ntpdc/ntpdc-opts.texi@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpdc/ntpdc.1@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpq/ntpq-opts.c@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpq/ntpq-opts.h@1.61 +3 -3
+ NTP_4_2_7P60
+
+ ntpq/ntpq-opts.texi@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpq/ntpq.1@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.61 +3 -3
+ NTP_4_2_7P60
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.61 +2 -2
+ NTP_4_2_7P60
+
+ ntpsnmpd/ntpsnmpd.1@1.61 +2 -2
+ NTP_4_2_7P60
+
+ packageinfo.sh@1.62 +1 -1
+ NTP_4_2_7P60
+
+ sntp/sntp-opts.c@1.61 +2 -2
+ NTP_4_2_7P60
+
+ sntp/sntp-opts.h@1.61 +3 -3
+ NTP_4_2_7P60
+
+ sntp/sntp-opts.texi@1.61 +1 -1
+ NTP_4_2_7P60
+
+ sntp/sntp.1@1.61 +2 -2
+ NTP_4_2_7P60
+
+ sntp/sntp.html@1.61 +1 -1
+ NTP_4_2_7P60
+
+ util/ntp-keygen-opts.c@1.58 +2 -2
+ NTP_4_2_7P60
+
+ util/ntp-keygen-opts.h@1.58 +3 -3
+ NTP_4_2_7P60
+
+ util/ntp-keygen-opts.texi@1.61 +2 -2
+ NTP_4_2_7P60
+
+ util/ntp-keygen.1@1.61 +2 -2
+ NTP_4_2_7P60
+
+ChangeSet@1.2156.1.77, 2010-10-04 01:30:19-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/pic/flt3.gif@1.1 +43 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt3.gif
+
+ html/pic/flt3.gif@1.0 +0 -0
+
+ html/pic/flt6.gif@1.1 +347 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt6.gif
+
+ html/pic/flt6.gif@1.0 +0 -0
+
+ html/pic/flt7.gif@1.1 +176 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt7.gif
+
+ html/pic/flt7.gif@1.0 +0 -0
+
+ChangeSet@1.2156.1.76, 2010-10-04 01:22:59-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/pic/flt4.gif@1.1 +88 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt4.gif
+
+ html/pic/flt4.gif@1.0 +0 -0
+
+ChangeSet@1.2156.1.75, 2010-10-04 01:14:16-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.36 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.3 +1 -1
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.64 +2 -1
+ Documentation updates from Dave Mills
+
+ html/cluster.html@1.1 +31 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/cluster.html
+
+ html/cluster.html@1.0 +0 -0
+
+ html/comdex.html@1.4 +3 -1
+ Documentation updates from Dave Mills
+
+ html/debug.html@1.31 +3 -2
+ Documentation updates from Dave Mills
+
+ html/ntp_conf.html@1.6 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpdsim_new.html@1.6 +2 -1
+ Documentation updates from Dave Mills
+
+ html/select.html@1.1 +32 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/select.html
+
+ html/select.html@1.0 +0 -0
+
+ html/warp.html@1.9 +12 -18
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.74, 2010-10-02 08:00:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P59
+ TAG: NTP_4_2_7P59
+
+ ChangeLog@1.622.1.35 +1 -0
+ NTP_4_2_7P59
+
+ ntpd/ntpd-opts.c@1.62 +2 -2
+ NTP_4_2_7P59
+
+ ntpd/ntpd-opts.h@1.62 +3 -3
+ NTP_4_2_7P59
+
+ ntpd/ntpd-opts.texi@1.61 +2 -2
+ NTP_4_2_7P59
+
+ ntpd/ntpd.1@1.61 +2 -2
+ NTP_4_2_7P59
+
+ ntpdc/ntpdc-opts.c@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpdc/ntpdc-opts.h@1.60 +3 -3
+ NTP_4_2_7P59
+
+ ntpdc/ntpdc-opts.texi@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpdc/ntpdc.1@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpq/ntpq-opts.c@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpq/ntpq-opts.h@1.60 +3 -3
+ NTP_4_2_7P59
+
+ ntpq/ntpq-opts.texi@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpq/ntpq.1@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.60 +3 -3
+ NTP_4_2_7P59
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.60 +2 -2
+ NTP_4_2_7P59
+
+ ntpsnmpd/ntpsnmpd.1@1.60 +2 -2
+ NTP_4_2_7P59
+
+ packageinfo.sh@1.61 +1 -1
+ NTP_4_2_7P59
+
+ sntp/sntp-opts.c@1.60 +2 -2
+ NTP_4_2_7P59
+
+ sntp/sntp-opts.h@1.60 +3 -3
+ NTP_4_2_7P59
+
+ sntp/sntp-opts.texi@1.60 +1 -1
+ NTP_4_2_7P59
+
+ sntp/sntp.1@1.60 +2 -2
+ NTP_4_2_7P59
+
+ sntp/sntp.html@1.60 +1 -1
+ NTP_4_2_7P59
+
+ util/ntp-keygen-opts.c@1.57 +2 -2
+ NTP_4_2_7P59
+
+ util/ntp-keygen-opts.h@1.57 +3 -3
+ NTP_4_2_7P59
+
+ util/ntp-keygen-opts.texi@1.60 +2 -2
+ NTP_4_2_7P59
+
+ util/ntp-keygen.1@1.60 +2 -2
+ NTP_4_2_7P59
+
+ChangeSet@1.2156.1.72, 2010-10-02 03:47:56-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.34 +1 -0
+ Documentation updates from Dave Mills
+
+ html/filter.html@1.2 +7 -6
+ Documentation updates from Dave Mills
+
+ html/huffpuff.html@1.2 +8 -3
+ Documentation updates from Dave Mills
+
+ html/scripts/special.txt@1.4 +3 -0
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.8 +9 -10
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.71, 2010-10-02 03:45:18-04:00, stenn@deacon.udel.edu
+ Variable name cleanup from Dave Mills
+
+ ChangeLog@1.622.1.33 +1 -0
+ Variable name cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.305 +4 -4
+ Variable name cleanup from Dave Mills
+
+ChangeSet@1.2156.1.70, 2010-10-02 00:36:46-07:00, harlan@hms-mbp.lan
+ [Bug 1657] darwin needs res_9_init, not res_init.
+
+ ChangeLog@1.622.1.32 +1 -0
+ [Bug 1657] darwin needs res_9_init, not res_init.
+
+ configure.ac@1.483.1.8 +5 -3
+ [Bug 1657] darwin needs res_9_init, not res_init.
+
+ChangeSet@1.2082.26.2, 2010-10-02 00:31:32-04:00, stenn@deacon.udel.edu
+ Update the NEWS file for 4.2.6p3
+
+ NEWS@1.108 +31 -0
+ Update the NEWS file for 4.2.6p3
+
+ChangeSet@1.2156.1.69, 2010-09-30 05:11:53+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P58
+ TAG: NTP_4_2_7P58
+
+ ChangeLog@1.622.1.31 +1 -0
+ NTP_4_2_7P58
+
+ ntpd/ntpd-opts.c@1.61 +2 -2
+ NTP_4_2_7P58
+
+ ntpd/ntpd-opts.h@1.61 +3 -3
+ NTP_4_2_7P58
+
+ ntpd/ntpd-opts.texi@1.60 +2 -2
+ NTP_4_2_7P58
+
+ ntpd/ntpd.1@1.60 +2 -2
+ NTP_4_2_7P58
+
+ ntpdc/ntpdc-opts.c@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpdc/ntpdc-opts.h@1.59 +3 -3
+ NTP_4_2_7P58
+
+ ntpdc/ntpdc-opts.texi@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpdc/ntpdc.1@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpq/ntpq-opts.c@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpq/ntpq-opts.h@1.59 +3 -3
+ NTP_4_2_7P58
+
+ ntpq/ntpq-opts.texi@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpq/ntpq.1@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.59 +3 -3
+ NTP_4_2_7P58
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.59 +2 -2
+ NTP_4_2_7P58
+
+ ntpsnmpd/ntpsnmpd.1@1.59 +2 -2
+ NTP_4_2_7P58
+
+ packageinfo.sh@1.60 +1 -1
+ NTP_4_2_7P58
+
+ sntp/sntp-opts.c@1.59 +2 -2
+ NTP_4_2_7P58
+
+ sntp/sntp-opts.h@1.59 +3 -3
+ NTP_4_2_7P58
+
+ sntp/sntp-opts.texi@1.59 +1 -1
+ NTP_4_2_7P58
+
+ sntp/sntp.1@1.59 +2 -2
+ NTP_4_2_7P58
+
+ sntp/sntp.html@1.59 +1 -1
+ NTP_4_2_7P58
+
+ util/ntp-keygen-opts.c@1.56 +2 -2
+ NTP_4_2_7P58
+
+ util/ntp-keygen-opts.h@1.56 +3 -3
+ NTP_4_2_7P58
+
+ util/ntp-keygen-opts.texi@1.59 +2 -2
+ NTP_4_2_7P58
+
+ util/ntp-keygen.1@1.59 +2 -2
+ NTP_4_2_7P58
+
+ChangeSet@1.2156.1.67, 2010-09-30 00:50:30-04:00, stenn@deacon.udel.edu
+ Clock select bugfix from Dave Mills.
+ [Bug 1554]: peer may stay selected as system peer after becoming
+ unreachable.
+
+ ChangeLog@1.622.1.29 +3 -0
+ Clock select bugfix from Dave Mills.
+ [Bug 155]: peer may stay selected as system peer after becoming
+ unreachable.
+
+ ntpd/ntp_proto.c@1.304 +10 -3
+ Clock select bugfix from Dave Mills.
+ [Bug 155]: peer may stay selected as system peer after becoming
+ unreachable.
+
+ChangeSet@1.2156.1.65, 2010-09-30 00:16:29-04:00, stenn@deacon.udel.edu
+ ChangeLog cleanup
+
+ ChangeLog@1.622.1.27 +1 -1
+ cleanup
+
+ChangeSet@1.2082.26.1, 2010-09-30 00:14:03-04:00, stenn@deacon.udel.edu
+ [Bug 1644]: cvo.sh should use lsb_release to identify linux distros.
+
+ ChangeLog@1.496.49.1 +2 -0
+ [Bug 1644]: cvo.sh should use lsb_release to identify linux distros.
+
+ scripts/cvo.sh@1.3.2.1 +4 -3
+ [Bug 1644]: cvo.sh should use lsb_release to identify linux distros.
+
+ChangeSet@1.2156.13.1, 2010-09-27 18:06:28+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1646] ntpd crashes with relative path to logfile.
+
+ ChangeLog@1.622.4.1 +1 -0
+ [Bug 1646] ntpd crashes with relative path to logfile.
+
+ ntpd/ntpd.c@1.116 +2 -5
+ [Bug 1646] ntpd crashes with relative path to logfile.
+
+ChangeSet@1.2156.12.1, 2010-09-27 10:11:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P57
+ TAG: NTP_4_2_7P57
+
+ ChangeLog@1.622.3.1 +1 -0
+ NTP_4_2_7P57
+
+ ntpd/ntpd-opts.c@1.60 +2 -2
+ NTP_4_2_7P57
+
+ ntpd/ntpd-opts.h@1.60 +3 -3
+ NTP_4_2_7P57
+
+ ntpd/ntpd-opts.texi@1.59 +2 -2
+ NTP_4_2_7P57
+
+ ntpd/ntpd.1@1.59 +2 -2
+ NTP_4_2_7P57
+
+ ntpdc/ntpdc-opts.c@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpdc/ntpdc-opts.h@1.58 +3 -3
+ NTP_4_2_7P57
+
+ ntpdc/ntpdc-opts.texi@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpdc/ntpdc.1@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpq/ntpq-opts.c@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpq/ntpq-opts.h@1.58 +3 -3
+ NTP_4_2_7P57
+
+ ntpq/ntpq-opts.texi@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpq/ntpq.1@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.58 +3 -3
+ NTP_4_2_7P57
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.58 +2 -2
+ NTP_4_2_7P57
+
+ ntpsnmpd/ntpsnmpd.1@1.58 +2 -2
+ NTP_4_2_7P57
+
+ packageinfo.sh@1.59 +1 -1
+ NTP_4_2_7P57
+
+ sntp/sntp-opts.c@1.58 +2 -2
+ NTP_4_2_7P57
+
+ sntp/sntp-opts.h@1.58 +3 -3
+ NTP_4_2_7P57
+
+ sntp/sntp-opts.texi@1.58 +1 -1
+ NTP_4_2_7P57
+
+ sntp/sntp.1@1.58 +2 -2
+ NTP_4_2_7P57
+
+ sntp/sntp.html@1.58 +1 -1
+ NTP_4_2_7P57
+
+ util/ntp-keygen-opts.c@1.55 +2 -2
+ NTP_4_2_7P57
+
+ util/ntp-keygen-opts.h@1.55 +3 -3
+ NTP_4_2_7P57
+
+ util/ntp-keygen-opts.texi@1.58 +2 -2
+ NTP_4_2_7P57
+
+ util/ntp-keygen.1@1.58 +2 -2
+ NTP_4_2_7P57
+
+ChangeSet@1.2082.22.15, 2010-09-27 01:33:39-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1644]: cvo.sh doesn't handle some unstable/testing linux distros
+
+ ChangeLog@1.496.47.11 +2 -0
+ [Bug 1644]: cvo.sh doesn't handle some unstable/testing linux distros
+
+ scripts/cvo.sh@1.3.1.1 +4 -3
+ [Bug 1644]: cvo.sh doesn't handle some unstable/testing linux distros
+
+ChangeSet@1.2156.1.63, 2010-09-27 01:31:15-04:00, stenn@psp-deb1.ntp.org
+ [Bug 1644] from 4.2.6p3: cvo.sh doesn't handle some unstable/testing linux distros
+
+ ChangeLog@1.622.1.25 +2 -0
+ [Bug 1644] from 4.2.6p3: cvo.sh doesn't handle some unstable/testing linux distros
+
+ scripts/cvo.sh@1.4 +4 -3
+ [Bug 1644] from 4.2.6p3: cvo.sh doesn't handle some unstable/testing linux distros
+
+ChangeSet@1.2156.1.62, 2010-09-26 15:27:53-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/pic/flt1.gif@1.1 +202 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt1.gif
+
+ html/pic/flt1.gif@1.0 +0 -0
+
+ html/pic/flt2.gif@1.1 +71 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt2.gif
+
+ html/pic/flt2.gif@1.0 +0 -0
+
+ html/pic/flt5.gif@1.1 +237 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flt5.gif
+
+ html/pic/flt5.gif@1.0 +0 -0
+
+ChangeSet@1.2156.1.61, 2010-09-26 15:23:27-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/filter.html@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/filter.html
+
+ html/filter.html@1.0 +0 -0
+
+ChangeSet@1.2156.1.60, 2010-09-26 14:40:09-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.24 +1 -0
+ Documentation updates from Dave Mills
+
+ html/scripts/special.txt@1.3 +1 -0
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.7 +2 -5
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.59, 2010-09-25 21:45:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P56
+ TAG: NTP_4_2_7P56
+
+ ChangeLog@1.622.1.23 +1 -0
+ NTP_4_2_7P56
+
+ ntpd/ntpd-opts.c@1.59 +2 -2
+ NTP_4_2_7P56
+
+ ntpd/ntpd-opts.h@1.59 +3 -3
+ NTP_4_2_7P56
+
+ ntpd/ntpd-opts.texi@1.58 +2 -2
+ NTP_4_2_7P56
+
+ ntpd/ntpd.1@1.58 +2 -2
+ NTP_4_2_7P56
+
+ ntpdc/ntpdc-opts.c@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpdc/ntpdc-opts.h@1.57 +3 -3
+ NTP_4_2_7P56
+
+ ntpdc/ntpdc-opts.texi@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpdc/ntpdc.1@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpq/ntpq-opts.c@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpq/ntpq-opts.h@1.57 +3 -3
+ NTP_4_2_7P56
+
+ ntpq/ntpq-opts.texi@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpq/ntpq.1@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.57 +3 -3
+ NTP_4_2_7P56
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.57 +2 -2
+ NTP_4_2_7P56
+
+ ntpsnmpd/ntpsnmpd.1@1.57 +2 -2
+ NTP_4_2_7P56
+
+ packageinfo.sh@1.58 +1 -1
+ NTP_4_2_7P56
+
+ sntp/sntp-opts.c@1.57 +2 -2
+ NTP_4_2_7P56
+
+ sntp/sntp-opts.h@1.57 +3 -3
+ NTP_4_2_7P56
+
+ sntp/sntp-opts.texi@1.57 +1 -1
+ NTP_4_2_7P56
+
+ sntp/sntp.1@1.57 +2 -2
+ NTP_4_2_7P56
+
+ sntp/sntp.html@1.57 +1 -1
+ NTP_4_2_7P56
+
+ util/ntp-keygen-opts.c@1.54 +2 -2
+ NTP_4_2_7P56
+
+ util/ntp-keygen-opts.h@1.54 +3 -3
+ NTP_4_2_7P56
+
+ util/ntp-keygen-opts.texi@1.57 +2 -2
+ NTP_4_2_7P56
+
+ util/ntp-keygen.1@1.57 +2 -2
+ NTP_4_2_7P56
+
+ChangeSet@1.2082.22.14, 2010-09-25 17:32:37-04:00, stenn@deacon.udel.edu
+ typo fix
+
+ ntpd/refclock_ripencc.c@1.7.1.2 +1 -1
+ typo fix
+
+ChangeSet@1.2082.22.13, 2010-09-25 21:14:57+00:00, stenn@psp-fb2.ntp.org
+ [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes
+
+ ChangeLog@1.496.47.10 +3 -0
+ [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes
+
+ ntpd/refclock_ripencc.c@1.7.1.1 +11 -6
+ [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes
+
+ChangeSet@1.2156.1.56, 2010-09-25 21:11:34+00:00, stenn@psp-fb2.ntp.org
+ [Bug 1643] from 4.2.6p3: Range-check the decoding of the RIPE-NCC status codes
+
+ ChangeLog@1.622.1.21 +2 -0
+ [Bug 1643] from 4.2.6p3: Range-check the decoding of the RIPE-NCC status codes
+
+ ntpd/refclock_ripencc.c@1.9 +8 -3
+ [Bug 1643] from 4.2.6p3: Range-check the decoding of the RIPE-NCC status codes
+
+ChangeSet@1.2082.22.12, 2010-09-25 18:22:19+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC2
+ TAG: NTP_4_2_6P3_RC2
+
+ ChangeLog@1.496.47.9 +1 -0
+ NTP_4_2_6P3_RC2
+
+ ntpd/ntpd-opts.c@1.248.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpd/ntpd-opts.h@1.248.18.1 +3 -3
+ NTP_4_2_6P3_RC2
+
+ ntpd/ntpd-opts.texi@1.246.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpd/ntpd.1@1.246.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpdc/ntpdc-opts.c@1.244.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpdc/ntpdc-opts.h@1.244.18.1 +3 -3
+ NTP_4_2_6P3_RC2
+
+ ntpdc/ntpdc-opts.texi@1.243.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpdc/ntpdc.1@1.243.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpq/ntpq-opts.c@1.245.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpq/ntpq-opts.h@1.245.18.1 +3 -3
+ NTP_4_2_6P3_RC2
+
+ ntpq/ntpq-opts.texi@1.244.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpq/ntpq.1@1.244.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.19.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.19.1 +3 -3
+ NTP_4_2_6P3_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.19.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ ntpsnmpd/ntpsnmpd.1@1.122.19.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ packageinfo.sh@1.255.20.1 +1 -1
+ NTP_4_2_6P3_RC2
+
+ sntp/sntp-opts.c@1.117.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ sntp/sntp-opts.h@1.117.18.1 +3 -3
+ NTP_4_2_6P3_RC2
+
+ sntp/sntp-opts.texi@1.117.18.1 +1 -1
+ NTP_4_2_6P3_RC2
+
+ sntp/sntp.1@1.117.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ sntp/sntp.html@1.7.18.1 +1 -1
+ NTP_4_2_6P3_RC2
+
+ util/ntp-keygen-opts.c@1.247.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ util/ntp-keygen-opts.h@1.247.18.1 +3 -3
+ NTP_4_2_6P3_RC2
+
+ util/ntp-keygen-opts.texi@1.246.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ util/ntp-keygen.1@1.246.18.1 +2 -2
+ NTP_4_2_6P3_RC2
+
+ChangeSet@1.2156.1.54, 2010-09-25 13:43:49-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.19 +1 -0
+ Documentation updates from Dave Mills
+
+ html/discipline.html@1.2 +11 -9
+ Documentation updates from Dave Mills
+
+ html/kern.html@1.19 +4 -3
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.24 +13 -6
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.53, 2010-09-25 13:39:59-04:00, stenn@deacon.udel.edu
+ Clock combining algorithm improvements from Dave Mills
+
+ ChangeLog@1.622.1.18 +1 -0
+ Clock combining algorithm improvements from Dave Mills
+
+ ntpd/ntp_proto.c@1.303 +7 -7
+ Clock combining algorithm improvements from Dave Mills
+
+ChangeSet@1.2156.1.52, 2010-09-25 07:44:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1642] ntpdsim can't find simulate block in config file.
+
+ ChangeLog@1.622.1.17 +1 -0
+ [Bug 1642] ntpdsim can't find simulate block in config file.
+
+ ntpd/ntp_config.c@1.265 +14 -13
+ Invert #ifdef SIM conditionalization of create_sim_script_info(),
+ create_sim_server(), and get_next_address().
+ Fix infinite loop in create_sim_script_info() caused by failing to
+ advance my_attr_val through script_queue before looping.
+
+ ntpd/ntp_scanner.c@1.37 +15 -6
+ Assumption that '=' is followed by a string (for setvar) is not
+ valid inside simulator configuration.
+ Assumption that 'server' is always followed by a string (not a
+ token) is not valid inside simulator config block.
+
+ ntpd/ntpd.c@1.115 +5 -1
+ Honor -d and -D in ntpdsim.
+
+ChangeSet@1.2082.24.1, 2010-09-22 20:14:51+02:00, jnperlin@hydra.localnet
+ [Bug 1571][Bug 1572] first clean-running version
+
+ ntpd/refclock_nmea.c@1.46.1.3 +42 -27
+ some more cleanup
+
+ ntpd/refclock_nmea.c@1.46.1.2 +310 -70
+ [Bug 1571][Bug 1572] first clean-running version
+
+ChangeSet@1.2156.1.51, 2010-09-22 10:10:38+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P55
+ TAG: NTP_4_2_7P55
+
+ ChangeLog@1.622.1.16 +1 -0
+ NTP_4_2_7P55
+
+ ntpd/ntpd-opts.c@1.58 +2 -2
+ NTP_4_2_7P55
+
+ ntpd/ntpd-opts.h@1.58 +3 -3
+ NTP_4_2_7P55
+
+ ntpd/ntpd-opts.texi@1.57 +2 -2
+ NTP_4_2_7P55
+
+ ntpd/ntpd.1@1.57 +2 -2
+ NTP_4_2_7P55
+
+ ntpdc/ntpdc-opts.c@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpdc/ntpdc-opts.h@1.56 +3 -3
+ NTP_4_2_7P55
+
+ ntpdc/ntpdc-opts.texi@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpdc/ntpdc.1@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpq/ntpq-opts.c@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpq/ntpq-opts.h@1.56 +3 -3
+ NTP_4_2_7P55
+
+ ntpq/ntpq-opts.texi@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpq/ntpq.1@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.56 +3 -3
+ NTP_4_2_7P55
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.56 +2 -2
+ NTP_4_2_7P55
+
+ ntpsnmpd/ntpsnmpd.1@1.56 +2 -2
+ NTP_4_2_7P55
+
+ packageinfo.sh@1.57 +1 -1
+ NTP_4_2_7P55
+
+ sntp/sntp-opts.c@1.56 +2 -2
+ NTP_4_2_7P55
+
+ sntp/sntp-opts.h@1.56 +3 -3
+ NTP_4_2_7P55
+
+ sntp/sntp-opts.texi@1.56 +1 -1
+ NTP_4_2_7P55
+
+ sntp/sntp.1@1.56 +2 -2
+ NTP_4_2_7P55
+
+ sntp/sntp.html@1.56 +1 -1
+ NTP_4_2_7P55
+
+ util/ntp-keygen-opts.c@1.53 +2 -2
+ NTP_4_2_7P55
+
+ util/ntp-keygen-opts.h@1.53 +3 -3
+ NTP_4_2_7P55
+
+ util/ntp-keygen-opts.texi@1.56 +2 -2
+ NTP_4_2_7P55
+
+ util/ntp-keygen.1@1.56 +2 -2
+ NTP_4_2_7P55
+
+ChangeSet@1.2156.1.50, 2010-09-22 01:22:45-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/pic/discipline.gif@1.1 +153 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/discipline.gif
+
+ html/pic/discipline.gif@1.0 +0 -0
+
+ChangeSet@1.2156.1.49, 2010-09-22 01:18:30-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ html/discipline.html@1.1 +45 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/discipline.html
+
+ html/discipline.html@1.0 +0 -0
+
+ChangeSet@1.2156.1.48, 2010-09-22 01:08:53-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.15 +1 -0
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.59 +2 -2
+ Documentation updates from Dave Mills
+
+ html/scripts/special.txt@1.2 +1 -0
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.6 +27 -91
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.47, 2010-09-21 17:10:47+00:00, davehart@shiny.ad.hartbrothers.com
+ correct Bison output of merged ntp_parser.y
+
+ ntpd/ntp_parser.c@1.63 +165 -155
+ correct Bison output of merged ntp_parser.y
+
+ChangeSet@1.2082.22.11, 2010-09-21 16:29:51+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1636] yyparse() segfault after denied filegen remote config.
+
+ ChangeLog@1.496.47.8 +1 -0
+ [Bug 1636] yyparse() segfault after denied filegen remote config.
+
+ ntpd/ntp_parser.c@1.52.1.4 +149 -139
+ [Bug 1636] yyparse() segfault after denied filegen remote config.
+
+ ntpd/ntp_parser.y@1.47.1.4 +13 -3
+ [Bug 1636] yyparse() segfault after denied filegen remote config.
+
+ChangeSet@1.2156.1.45, 2010-09-21 05:39:47+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P54
+ TAG: NTP_4_2_7P54
+
+ ChangeLog@1.622.1.13 +1 -0
+ NTP_4_2_7P54
+
+ ntpd/ntpd-opts.c@1.57 +2 -2
+ NTP_4_2_7P54
+
+ ntpd/ntpd-opts.h@1.57 +3 -3
+ NTP_4_2_7P54
+
+ ntpd/ntpd-opts.texi@1.56 +2 -2
+ NTP_4_2_7P54
+
+ ntpd/ntpd.1@1.56 +2 -2
+ NTP_4_2_7P54
+
+ ntpdc/ntpdc-opts.c@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpdc/ntpdc-opts.h@1.55 +3 -3
+ NTP_4_2_7P54
+
+ ntpdc/ntpdc-opts.texi@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpdc/ntpdc.1@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpq/ntpq-opts.c@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpq/ntpq-opts.h@1.55 +3 -3
+ NTP_4_2_7P54
+
+ ntpq/ntpq-opts.texi@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpq/ntpq.1@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.55 +3 -3
+ NTP_4_2_7P54
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.55 +2 -2
+ NTP_4_2_7P54
+
+ ntpsnmpd/ntpsnmpd.1@1.55 +2 -2
+ NTP_4_2_7P54
+
+ packageinfo.sh@1.56 +1 -1
+ NTP_4_2_7P54
+
+ sntp/sntp-opts.c@1.55 +2 -2
+ NTP_4_2_7P54
+
+ sntp/sntp-opts.h@1.55 +3 -3
+ NTP_4_2_7P54
+
+ sntp/sntp-opts.texi@1.55 +1 -1
+ NTP_4_2_7P54
+
+ sntp/sntp.1@1.55 +2 -2
+ NTP_4_2_7P54
+
+ sntp/sntp.html@1.55 +1 -1
+ NTP_4_2_7P54
+
+ util/ntp-keygen-opts.c@1.52 +2 -2
+ NTP_4_2_7P54
+
+ util/ntp-keygen-opts.h@1.52 +3 -3
+ NTP_4_2_7P54
+
+ util/ntp-keygen-opts.texi@1.55 +2 -2
+ NTP_4_2_7P54
+
+ util/ntp-keygen.1@1.55 +2 -2
+ NTP_4_2_7P54
+
+ChangeSet@1.2156.1.44, 2010-09-21 01:26:14-04:00, stenn@deacon.udel.edu
+ More initial convergence improvements from Dave Mills
+
+ ChangeLog@1.622.1.12 +1 -0
+ More initial convergence improvements from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.158 +4 -1
+ More initial convergence improvements from Dave Mills
+
+ChangeSet@1.2156.1.43, 2010-09-21 01:23:50-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.11 +1 -0
+ Documentation updates from Dave Mills
+
+ html/clock.html@1.2 +48 -15
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.58 +5 -5
+ Documentation updates from Dave Mills
+
+ html/monopt.html@1.34 +3 -3
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.5 +11 -18
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.42, 2010-09-20 23:22:02+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct skipped merge of generated file ntp_parser.c
+
+ ntpd/ntp_parser.c@1.61 +1174 -999
+ Bison output of merged ntp_parser.y
+
+ChangeSet@1.2082.22.10, 2010-09-20 22:41:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1635] "filegen ... enable" is not default.
+
+ ChangeLog@1.496.47.7 +4 -0
+ [Bug 1635] "filegen ... enable" is not default.
+
+ ntpd/ntp_config.c@1.241.1.5 +5 -2
+ [Bug 1635] "filegen ... enable" is not default.
+
+ ntpd/ntp_filegen.c@1.18 +5 -7
+ nonfunctional cleanup (whitespace, use estrdup()).
+
+ ntpd/ntp_parser.c@1.52.1.3 +383 -386
+ Bison output for ntp_parser.y
+
+ ntpd/ntp_parser.y@1.47.1.3 +4 -12
+ [Bug 1635] "filegen ... enable" is not default.
+
+ ntpd/ntp_util.c@1.75.1.1 +2 -2
+ whitespace
+
+ChangeSet@1.2156.1.40, 2010-09-20 04:27:28+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P53
+ TAG: NTP_4_2_7P53
+
+ ChangeLog@1.622.1.9 +1 -0
+ NTP_4_2_7P53
+
+ ntpd/ntpd-opts.c@1.56 +2 -2
+ NTP_4_2_7P53
+
+ ntpd/ntpd-opts.h@1.56 +3 -3
+ NTP_4_2_7P53
+
+ ntpd/ntpd-opts.texi@1.55 +2 -2
+ NTP_4_2_7P53
+
+ ntpd/ntpd.1@1.55 +2 -2
+ NTP_4_2_7P53
+
+ ntpdc/ntpdc-opts.c@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpdc/ntpdc-opts.h@1.54 +3 -3
+ NTP_4_2_7P53
+
+ ntpdc/ntpdc-opts.texi@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpdc/ntpdc.1@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpq/ntpq-opts.c@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpq/ntpq-opts.h@1.54 +3 -3
+ NTP_4_2_7P53
+
+ ntpq/ntpq-opts.texi@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpq/ntpq.1@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.54 +3 -3
+ NTP_4_2_7P53
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.54 +2 -2
+ NTP_4_2_7P53
+
+ ntpsnmpd/ntpsnmpd.1@1.54 +2 -2
+ NTP_4_2_7P53
+
+ packageinfo.sh@1.55 +1 -1
+ NTP_4_2_7P53
+
+ sntp/sntp-opts.c@1.54 +2 -2
+ NTP_4_2_7P53
+
+ sntp/sntp-opts.h@1.54 +3 -3
+ NTP_4_2_7P53
+
+ sntp/sntp-opts.texi@1.54 +1 -1
+ NTP_4_2_7P53
+
+ sntp/sntp.1@1.54 +2 -2
+ NTP_4_2_7P53
+
+ sntp/sntp.html@1.54 +1 -1
+ NTP_4_2_7P53
+
+ util/ntp-keygen-opts.c@1.51 +2 -2
+ NTP_4_2_7P53
+
+ util/ntp-keygen-opts.h@1.51 +3 -3
+ NTP_4_2_7P53
+
+ util/ntp-keygen-opts.texi@1.54 +2 -2
+ NTP_4_2_7P53
+
+ util/ntp-keygen.1@1.54 +2 -2
+ NTP_4_2_7P53
+
+ChangeSet@1.2156.1.39, 2010-09-19 23:41:49-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.622.1.8 +1 -0
+ Documentation updates from Dave Mills
+
+ html/release.html@1.39 +2 -1
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.4 +66 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.38, 2010-09-19 23:37:34-04:00, stenn@deacon.udel.edu
+ More initial convergence improvements from Dave Mills
+
+ ChangeLog@1.622.1.7 +1 -0
+ More initial convergence improvements from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.157 +15 -12
+ More initial convergence improvements from Dave Mills
+
+ChangeSet@1.2156.1.37, 2010-09-19 10:10:15+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P52
+ TAG: NTP_4_2_7P52
+
+ ChangeLog@1.622.1.6 +1 -0
+ NTP_4_2_7P52
+
+ ntpd/ntpd-opts.c@1.55 +2 -2
+ NTP_4_2_7P52
+
+ ntpd/ntpd-opts.h@1.55 +3 -3
+ NTP_4_2_7P52
+
+ ntpd/ntpd-opts.texi@1.54 +2 -2
+ NTP_4_2_7P52
+
+ ntpd/ntpd.1@1.54 +2 -2
+ NTP_4_2_7P52
+
+ ntpdc/ntpdc-opts.c@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpdc/ntpdc-opts.h@1.53 +3 -3
+ NTP_4_2_7P52
+
+ ntpdc/ntpdc-opts.texi@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpdc/ntpdc.1@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpq/ntpq-opts.c@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpq/ntpq-opts.h@1.53 +3 -3
+ NTP_4_2_7P52
+
+ ntpq/ntpq-opts.texi@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpq/ntpq.1@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.53 +3 -3
+ NTP_4_2_7P52
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.53 +2 -2
+ NTP_4_2_7P52
+
+ ntpsnmpd/ntpsnmpd.1@1.53 +2 -2
+ NTP_4_2_7P52
+
+ packageinfo.sh@1.54 +1 -1
+ NTP_4_2_7P52
+
+ sntp/sntp-opts.c@1.53 +2 -2
+ NTP_4_2_7P52
+
+ sntp/sntp-opts.h@1.53 +3 -3
+ NTP_4_2_7P52
+
+ sntp/sntp-opts.texi@1.53 +1 -1
+ NTP_4_2_7P52
+
+ sntp/sntp.1@1.53 +2 -2
+ NTP_4_2_7P52
+
+ sntp/sntp.html@1.53 +1 -1
+ NTP_4_2_7P52
+
+ util/ntp-keygen-opts.c@1.50 +2 -2
+ NTP_4_2_7P52
+
+ util/ntp-keygen-opts.h@1.50 +3 -3
+ NTP_4_2_7P52
+
+ util/ntp-keygen-opts.texi@1.53 +2 -2
+ NTP_4_2_7P52
+
+ util/ntp-keygen.1@1.53 +2 -2
+ NTP_4_2_7P52
+
+ChangeSet@1.2156.1.36, 2010-09-18 18:40:06-04:00, stenn@deacon.udel.edu
+ Initial convergence improvements from Dave Mills
+
+ ChangeLog@1.622.1.5 +1 -0
+ Initial convergence improvements from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.156 +52 -53
+ Initial convergence improvements from Dave Mills
+
+ChangeSet@1.2156.1.35, 2010-09-18 10:10:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P51
+ TAG: NTP_4_2_7P51
+
+ ChangeLog@1.622.1.4 +1 -0
+ NTP_4_2_7P51
+
+ ntpd/ntpd-opts.c@1.54 +2 -2
+ NTP_4_2_7P51
+
+ ntpd/ntpd-opts.h@1.54 +3 -3
+ NTP_4_2_7P51
+
+ ntpd/ntpd-opts.texi@1.53 +2 -2
+ NTP_4_2_7P51
+
+ ntpd/ntpd.1@1.53 +2 -2
+ NTP_4_2_7P51
+
+ ntpdc/ntpdc-opts.c@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpdc/ntpdc-opts.h@1.52 +3 -3
+ NTP_4_2_7P51
+
+ ntpdc/ntpdc-opts.texi@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpdc/ntpdc.1@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpq/ntpq-opts.c@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpq/ntpq-opts.h@1.52 +3 -3
+ NTP_4_2_7P51
+
+ ntpq/ntpq-opts.texi@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpq/ntpq.1@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.52 +3 -3
+ NTP_4_2_7P51
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.52 +2 -2
+ NTP_4_2_7P51
+
+ ntpsnmpd/ntpsnmpd.1@1.52 +2 -2
+ NTP_4_2_7P51
+
+ packageinfo.sh@1.53 +1 -1
+ NTP_4_2_7P51
+
+ sntp/sntp-opts.c@1.52 +2 -2
+ NTP_4_2_7P51
+
+ sntp/sntp-opts.h@1.52 +3 -3
+ NTP_4_2_7P51
+
+ sntp/sntp-opts.texi@1.52 +1 -1
+ NTP_4_2_7P51
+
+ sntp/sntp.1@1.52 +2 -2
+ NTP_4_2_7P51
+
+ sntp/sntp.html@1.52 +1 -1
+ NTP_4_2_7P51
+
+ util/ntp-keygen-opts.c@1.49 +2 -2
+ NTP_4_2_7P51
+
+ util/ntp-keygen-opts.h@1.49 +3 -3
+ NTP_4_2_7P51
+
+ util/ntp-keygen-opts.texi@1.52 +2 -2
+ NTP_4_2_7P51
+
+ util/ntp-keygen.1@1.52 +2 -2
+ NTP_4_2_7P51
+
+ChangeSet@1.2082.22.9, 2010-09-18 05:42:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_RC1
+ TAG: NTP_4_2_6P3_RC1
+
+ ChangeLog@1.496.47.6 +1 -0
+ NTP_4_2_6P3_RC1
+
+ ntpd/ntpd-opts.c@1.248.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpd/ntpd-opts.h@1.248.17.1 +3 -3
+ NTP_4_2_6P3_RC1
+
+ ntpd/ntpd-opts.texi@1.246.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpd/ntpd.1@1.246.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpdc/ntpdc-opts.c@1.244.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpdc/ntpdc-opts.h@1.244.17.1 +3 -3
+ NTP_4_2_6P3_RC1
+
+ ntpdc/ntpdc-opts.texi@1.243.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpdc/ntpdc.1@1.243.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpq/ntpq-opts.c@1.245.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpq/ntpq-opts.h@1.245.17.1 +3 -3
+ NTP_4_2_6P3_RC1
+
+ ntpq/ntpq-opts.texi@1.244.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpq/ntpq.1@1.244.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.18.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.18.1 +3 -3
+ NTP_4_2_6P3_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.18.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.18.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ packageinfo.sh@1.255.19.2 +1 -1
+ NTP_4_2_6P3_RC1
+
+ sntp/sntp-opts.c@1.117.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ sntp/sntp-opts.h@1.117.17.1 +3 -3
+ NTP_4_2_6P3_RC1
+
+ sntp/sntp-opts.texi@1.117.17.1 +1 -1
+ NTP_4_2_6P3_RC1
+
+ sntp/sntp.1@1.117.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ sntp/sntp.html@1.7.17.1 +1 -1
+ NTP_4_2_6P3_RC1
+
+ util/ntp-keygen-opts.c@1.247.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ util/ntp-keygen-opts.h@1.247.17.1 +3 -3
+ NTP_4_2_6P3_RC1
+
+ util/ntp-keygen-opts.texi@1.246.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ util/ntp-keygen.1@1.246.17.1 +2 -2
+ NTP_4_2_6P3_RC1
+
+ChangeSet@1.2082.22.8, 2010-09-18 01:25:26-04:00, stenn@deacon.udel.edu
+ 4.2.6p3-RC1
+
+ packageinfo.sh@1.255.19.1 +1 -1
+ 4.2.6p3-RC1
+
+ChangeSet@1.2082.22.7, 2010-09-17 04:20:03+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1344] ntpd on Windows exits without logging cause.
+
+
+ ChangeLog@1.496.47.5 +4 -0
+ [Bug 1344] ntpd on Windows exits without logging cause.
+
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.38.1.3 +4 -2
+ [Bug 1344] ntpd on Windows exits without logging cause.
+
+
+ChangeSet@1.2156.1.32, 2010-09-16 19:32:11+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache.
+ [Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61.
+
+
+ ChangeLog@1.622.1.1 +2 -0
+ [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache.
+ [Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61.
+
+
+ configure.ac@1.483.1.7 +34 -36
+ [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache.
+ [Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61.
+
+
+ sntp/configure.ac@1.36 +27 -13
+ [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache.
+ [Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61.
+
+
+ChangeSet@1.2156.1.31, 2010-09-16 06:21:34+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P50
+ TAG: NTP_4_2_7P50
+
+ ChangeLog@1.622 +1 -0
+ NTP_4_2_7P50
+
+ ntpd/ntpd-opts.c@1.53 +2 -2
+ NTP_4_2_7P50
+
+ ntpd/ntpd-opts.h@1.53 +3 -3
+ NTP_4_2_7P50
+
+ ntpd/ntpd-opts.texi@1.52 +2 -2
+ NTP_4_2_7P50
+
+ ntpd/ntpd.1@1.52 +2 -2
+ NTP_4_2_7P50
+
+ ntpdc/ntpdc-opts.c@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpdc/ntpdc-opts.h@1.51 +3 -3
+ NTP_4_2_7P50
+
+ ntpdc/ntpdc-opts.texi@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpdc/ntpdc.1@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpq/ntpq-opts.c@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpq/ntpq-opts.h@1.51 +3 -3
+ NTP_4_2_7P50
+
+ ntpq/ntpq-opts.texi@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpq/ntpq.1@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.51 +3 -3
+ NTP_4_2_7P50
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.51 +2 -2
+ NTP_4_2_7P50
+
+ ntpsnmpd/ntpsnmpd.1@1.51 +2 -2
+ NTP_4_2_7P50
+
+ packageinfo.sh@1.52 +1 -1
+ NTP_4_2_7P50
+
+ sntp/sntp-opts.c@1.51 +2 -2
+ NTP_4_2_7P50
+
+ sntp/sntp-opts.h@1.51 +3 -3
+ NTP_4_2_7P50
+
+ sntp/sntp-opts.texi@1.51 +1 -1
+ NTP_4_2_7P50
+
+ sntp/sntp.1@1.51 +2 -2
+ NTP_4_2_7P50
+
+ sntp/sntp.html@1.51 +1 -1
+ NTP_4_2_7P50
+
+ util/ntp-keygen-opts.c@1.48 +2 -2
+ NTP_4_2_7P50
+
+ util/ntp-keygen-opts.h@1.48 +3 -3
+ NTP_4_2_7P50
+
+ util/ntp-keygen-opts.texi@1.51 +2 -2
+ NTP_4_2_7P50
+
+ util/ntp-keygen.1@1.51 +2 -2
+ NTP_4_2_7P50
+
+ChangeSet@1.2156.1.30, 2010-09-16 01:59:29-04:00, stenn@deacon.udel.edu
+ Clean up NTP_LIB_M
+
+ ChangeLog@1.621 +1 -0
+ Clean up NTP_LIB_M
+
+ m4/ntp_lib_m.m4@1.3 +2 -0
+ Clean up NTP_LIB_M
+
+ChangeSet@1.2156.1.29, 2010-09-16 01:57:24-04:00, stenn@deacon.udel.edu
+ [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris
+
+ configure.ac@1.483.1.6 +14 -5
+ [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris
+
+ChangeSet@1.2156.1.28, 2010-09-15 23:49:40-04:00, stenn@deacon.udel.edu
+ [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris
+
+ ChangeLog@1.620 +1 -0
+ [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris
+
+ configure.ac@1.483.1.5 +7 -4
+ [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris
+
+ChangeSet@1.2156.1.27, 2010-09-13 05:32:06+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P49
+ TAG: NTP_4_2_7P49
+
+ ChangeLog@1.619 +1 -0
+ NTP_4_2_7P49
+
+ ntpd/ntpd-opts.c@1.52 +2 -2
+ NTP_4_2_7P49
+
+ ntpd/ntpd-opts.h@1.52 +3 -3
+ NTP_4_2_7P49
+
+ ntpd/ntpd-opts.texi@1.51 +2 -2
+ NTP_4_2_7P49
+
+ ntpd/ntpd.1@1.51 +2 -2
+ NTP_4_2_7P49
+
+ ntpdc/ntpdc-opts.c@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpdc/ntpdc-opts.h@1.50 +3 -3
+ NTP_4_2_7P49
+
+ ntpdc/ntpdc-opts.texi@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpdc/ntpdc.1@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpq/ntpq-opts.c@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpq/ntpq-opts.h@1.50 +3 -3
+ NTP_4_2_7P49
+
+ ntpq/ntpq-opts.texi@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpq/ntpq.1@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.50 +3 -3
+ NTP_4_2_7P49
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.50 +2 -2
+ NTP_4_2_7P49
+
+ ntpsnmpd/ntpsnmpd.1@1.50 +2 -2
+ NTP_4_2_7P49
+
+ packageinfo.sh@1.51 +1 -1
+ NTP_4_2_7P49
+
+ sntp/sntp-opts.c@1.50 +2 -2
+ NTP_4_2_7P49
+
+ sntp/sntp-opts.h@1.50 +3 -3
+ NTP_4_2_7P49
+
+ sntp/sntp-opts.texi@1.50 +1 -1
+ NTP_4_2_7P49
+
+ sntp/sntp.1@1.50 +2 -2
+ NTP_4_2_7P49
+
+ sntp/sntp.html@1.50 +1 -1
+ NTP_4_2_7P49
+
+ util/ntp-keygen-opts.c@1.47 +2 -2
+ NTP_4_2_7P49
+
+ util/ntp-keygen-opts.h@1.47 +3 -3
+ NTP_4_2_7P49
+
+ util/ntp-keygen-opts.texi@1.50 +2 -2
+ NTP_4_2_7P49
+
+ util/ntp-keygen.1@1.50 +2 -2
+ NTP_4_2_7P49
+
+ChangeSet@1.2156.1.26, 2010-09-13 01:21:03-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.618 +1 -0
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.32 +5 -5
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.63 +3 -3
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.3 +3 -3
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.51 +3 -3
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.21 +11 -58
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.57 +9 -14
+ Documentation updates from Dave Mills
+
+ html/ntp_conf.html@1.5 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.53 +0 -1
+ Documentation updates from Dave Mills
+
+ html/pps.html@1.22 +3 -2
+ Documentation updates from Dave Mills
+
+ html/quick.html@1.22 +3 -3
+ Documentation updates from Dave Mills
+
+ html/rate.html@1.8 +0 -2
+ Documentation updates from Dave Mills
+
+ html/release.html@1.38 +3 -3
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.3 +10 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.25, 2010-09-12 10:10:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P48
+ TAG: NTP_4_2_7P48
+
+ ChangeLog@1.617 +1 -0
+ NTP_4_2_7P48
+
+ ntpd/ntpd-opts.c@1.51 +2 -2
+ NTP_4_2_7P48
+
+ ntpd/ntpd-opts.h@1.51 +3 -3
+ NTP_4_2_7P48
+
+ ntpd/ntpd-opts.texi@1.50 +2 -2
+ NTP_4_2_7P48
+
+ ntpd/ntpd.1@1.50 +2 -2
+ NTP_4_2_7P48
+
+ ntpdc/ntpdc-opts.c@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpdc/ntpdc-opts.h@1.49 +3 -3
+ NTP_4_2_7P48
+
+ ntpdc/ntpdc-opts.texi@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpdc/ntpdc.1@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpq/ntpq-opts.c@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpq/ntpq-opts.h@1.49 +3 -3
+ NTP_4_2_7P48
+
+ ntpq/ntpq-opts.texi@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpq/ntpq.1@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.49 +3 -3
+ NTP_4_2_7P48
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.49 +2 -2
+ NTP_4_2_7P48
+
+ ntpsnmpd/ntpsnmpd.1@1.49 +2 -2
+ NTP_4_2_7P48
+
+ packageinfo.sh@1.50 +1 -1
+ NTP_4_2_7P48
+
+ sntp/sntp-opts.c@1.49 +2 -2
+ NTP_4_2_7P48
+
+ sntp/sntp-opts.h@1.49 +3 -3
+ NTP_4_2_7P48
+
+ sntp/sntp-opts.texi@1.49 +1 -1
+ NTP_4_2_7P48
+
+ sntp/sntp.1@1.49 +2 -2
+ NTP_4_2_7P48
+
+ sntp/sntp.html@1.49 +1 -1
+ NTP_4_2_7P48
+
+ util/ntp-keygen-opts.c@1.46 +2 -2
+ NTP_4_2_7P48
+
+ util/ntp-keygen-opts.h@1.46 +3 -3
+ NTP_4_2_7P48
+
+ util/ntp-keygen-opts.texi@1.49 +2 -2
+ NTP_4_2_7P48
+
+ util/ntp-keygen.1@1.49 +2 -2
+ NTP_4_2_7P48
+
+ChangeSet@1.2156.1.24, 2010-09-11 17:53:59-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.616 +1 -0
+ Documentation updates from Dave Mills
+
+ html/accopt.html@1.38 +5 -5
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.2 +10 -8
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.62 +1 -2
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.2 +3 -2
+ Documentation updates from Dave Mills
+
+ html/index.html@1.43 +8 -35
+ Documentation updates from Dave Mills
+
+ html/monopt.html@1.33 +2 -2
+ Documentation updates from Dave Mills
+
+ html/rate.html@1.7 +10 -2
+ Documentation updates from Dave Mills
+
+ html/scripts/miscopt.txt@1.6 +0 -1
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.2 +16 -7
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.10.2, 2010-09-11 10:16:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P47
+ TAG: NTP_4_2_7P47
+
+ ChangeLog@1.614 +1 -0
+ NTP_4_2_7P47
+
+ ntpd/ntpd-opts.c@1.50 +2 -2
+ NTP_4_2_7P47
+
+ ntpd/ntpd-opts.h@1.50 +3 -3
+ NTP_4_2_7P47
+
+ ntpd/ntpd-opts.texi@1.49 +2 -2
+ NTP_4_2_7P47
+
+ ntpd/ntpd.1@1.49 +2 -2
+ NTP_4_2_7P47
+
+ ntpdc/ntpdc-opts.c@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpdc/ntpdc-opts.h@1.48 +3 -3
+ NTP_4_2_7P47
+
+ ntpdc/ntpdc-opts.texi@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpdc/ntpdc.1@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpq/ntpq-opts.c@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpq/ntpq-opts.h@1.48 +3 -3
+ NTP_4_2_7P47
+
+ ntpq/ntpq-opts.texi@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpq/ntpq.1@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.48 +3 -3
+ NTP_4_2_7P47
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.48 +2 -2
+ NTP_4_2_7P47
+
+ ntpsnmpd/ntpsnmpd.1@1.48 +2 -2
+ NTP_4_2_7P47
+
+ packageinfo.sh@1.49 +1 -1
+ NTP_4_2_7P47
+
+ sntp/sntp-opts.c@1.48 +2 -2
+ NTP_4_2_7P47
+
+ sntp/sntp-opts.h@1.48 +3 -3
+ NTP_4_2_7P47
+
+ sntp/sntp-opts.texi@1.48 +1 -1
+ NTP_4_2_7P47
+
+ sntp/sntp.1@1.48 +2 -2
+ NTP_4_2_7P47
+
+ sntp/sntp.html@1.48 +1 -1
+ NTP_4_2_7P47
+
+ util/ntp-keygen-opts.c@1.45 +5 -5
+ NTP_4_2_7P47
+
+ util/ntp-keygen-opts.h@1.45 +4 -4
+ NTP_4_2_7P47
+
+ util/ntp-keygen-opts.texi@1.48 +17 -17
+ NTP_4_2_7P47
+
+ util/ntp-keygen.1@1.48 +2 -2
+ NTP_4_2_7P47
+
+ChangeSet@1.2082.22.6, 2010-09-11 06:50:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P3_BETA1
+ TAG: NTP_4_2_6P3_BETA1
+
+ ChangeLog@1.496.47.4 +1 -0
+ NTP_4_2_6P3_BETA1
+
+ ntpd/ntpd-opts.c@1.248.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpd/ntpd-opts.h@1.248.16.1 +3 -3
+ NTP_4_2_6P3_BETA1
+
+ ntpd/ntpd-opts.texi@1.246.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpd/ntpd.1@1.246.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpdc/ntpdc-opts.c@1.244.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpdc/ntpdc-opts.h@1.244.16.1 +3 -3
+ NTP_4_2_6P3_BETA1
+
+ ntpdc/ntpdc-opts.texi@1.243.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpdc/ntpdc.1@1.243.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpq/ntpq-opts.c@1.245.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpq/ntpq-opts.h@1.245.16.1 +3 -3
+ NTP_4_2_6P3_BETA1
+
+ ntpq/ntpq-opts.texi@1.244.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpq/ntpq.1@1.244.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.17.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.17.1 +3 -3
+ NTP_4_2_6P3_BETA1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.17.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.17.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ packageinfo.sh@1.255.18.1 +3 -3
+ NTP_4_2_6P3_BETA1
+
+ sntp/sntp-opts.c@1.117.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ sntp/sntp-opts.h@1.117.16.1 +3 -3
+ NTP_4_2_6P3_BETA1
+
+ sntp/sntp-opts.texi@1.117.16.1 +1 -1
+ NTP_4_2_6P3_BETA1
+
+ sntp/sntp.1@1.117.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ sntp/sntp.html@1.7.16.1 +1 -1
+ NTP_4_2_6P3_BETA1
+
+ util/ntp-keygen-opts.c@1.247.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ util/ntp-keygen-opts.h@1.247.16.1 +3 -3
+ NTP_4_2_6P3_BETA1
+
+ util/ntp-keygen-opts.texi@1.246.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ util/ntp-keygen.1@1.246.16.1 +2 -2
+ NTP_4_2_6P3_BETA1
+
+ChangeSet@1.2082.22.5, 2010-09-11 02:14:22-04:00, stenn@deacon.udel.edu
+ temporary mirror trigger update
+
+ BitKeeper/triggers/2mirrors@1.7 +2 -1
+ temporary mirror trigger update
+
+ChangeSet@1.2156.1.21, 2010-09-11 01:56:46-04:00, stenn@deacon.udel.edu
+ Documentation updates from Dave Mills
+
+ BitKeeper/deleted/.del-description.jpg~1683404a7f1dcae@1.2 +0 -0
+ Delete: html/description_files/description.jpg
+
+ BitKeeper/deleted/.del-gadget.html~155e509d29e44428@1.5 +0 -0
+ Delete: html/gadget.html
+
+ ChangeLog@1.613 +1 -0
+ Documentation updates from Dave Mills
+
+ html/access.html@1.1 +50 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/access.html
+
+ html/access.html@1.0 +0 -0
+
+ html/accopt.html@1.37 +65 -184
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.31 +83 -94
+ Documentation updates from Dave Mills
+
+ html/audio.html@1.22 +178 -179
+ Documentation updates from Dave Mills
+
+ html/authentic.html@1.1 +54 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/authentic.html
+
+ html/authentic.html@1.0 +0 -0
+
+ html/authopt.html@1.61 +68 -473
+ Documentation updates from Dave Mills
+
+ html/autokey.html@1.1 +206 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/autokey.html
+
+ html/autokey.html@1.0 +0 -0
+
+ html/bugs.html@1.6 +28 -30
+ Documentation updates from Dave Mills
+
+ html/build.html@1.24 +55 -57
+ Documentation updates from Dave Mills
+
+ html/clock.html@1.1 +31 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/clock.html
+
+ html/clock.html@1.0 +0 -0
+
+ html/clockopt.html@1.23 +55 -67
+ Documentation updates from Dave Mills
+
+ html/comdex.html@1.3 +24 -29
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.50 +13 -37
+ Documentation updates from Dave Mills
+
+ html/copyright.html@1.51 +75 -79
+ Documentation updates from Dave Mills
+
+ html/debug.html@1.30 +90 -94
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.15 +628 -806
+ Documentation updates from Dave Mills
+
+ html/discover.html@1.1 +72 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/discover.html
+
+ html/discover.html@1.0 +0 -0
+
+ html/drivers/driver1.html@1.17 +48 -48
+ Documentation updates from Dave Mills
+
+ html/drivers/driver10.html@1.13 +51 -51
+ Documentation updates from Dave Mills
+
+ html/drivers/driver11.html@1.13 +60 -60
+ Documentation updates from Dave Mills
+
+ html/drivers/driver12.html@1.12 +47 -47
+ Documentation updates from Dave Mills
+
+ html/drivers/driver18.html@1.17 +80 -80
+ Documentation updates from Dave Mills
+
+ html/drivers/driver19.html@1.12 +53 -53
+ Documentation updates from Dave Mills
+
+ html/drivers/driver22.html@1.19 +81 -93
+ Documentation updates from Dave Mills
+
+ html/drivers/driver3.html@1.12 +52 -52
+ Documentation updates from Dave Mills
+
+ html/drivers/driver36.html@1.33 +148 -145
+ Documentation updates from Dave Mills
+
+ html/drivers/driver4.html@1.16 +39 -71
+ Documentation updates from Dave Mills
+
+ html/drivers/driver6.html@1.26 +79 -74
+ Documentation updates from Dave Mills
+
+ html/drivers/driver7.html@1.28 +123 -129
+ Documentation updates from Dave Mills
+
+ html/extern.html@1.16 +46 -48
+ Documentation updates from Dave Mills
+
+ html/hints.html@1.18 +20 -22
+ Documentation updates from Dave Mills
+
+ html/howto.html@1.23 +106 -114
+ Documentation updates from Dave Mills
+
+ html/huffpuff.html@1.1 +20 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/huffpuff.html
+
+ html/huffpuff.html@1.0 +0 -0
+
+ html/index.html@1.42 +97 -89
+ Documentation updates from Dave Mills
+
+ html/kern.html@1.18 +29 -31
+ Documentation updates from Dave Mills
+
+ html/kernpps.html@1.3 +46 -47
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.20 +103 -174
+ Documentation updates from Dave Mills
+
+ html/leap.html@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/leap.html
+
+ html/leap.html@1.0 +0 -0
+
+ html/miscopt.html@1.56 +164 -167
+ Documentation updates from Dave Mills
+
+ html/monopt.html@1.32 +486 -487
+ Documentation updates from Dave Mills
+
+ html/msyslog.html@1.10 +127 -123
+ Documentation updates from Dave Mills
+
+ html/ntp_conf.html@1.4 +171 -171
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.52 +166 -223
+ Documentation updates from Dave Mills
+
+ html/ntpdate.html@1.19 +67 -69
+ Documentation updates from Dave Mills
+
+ html/ntpdc.html@1.32 +170 -213
+ Documentation updates from Dave Mills
+
+ html/ntpdsim.html@1.8 +61 -63
+ Documentation updates from Dave Mills
+
+ html/ntpdsim_new.html@1.5 +55 -55
+ Documentation updates from Dave Mills
+
+ html/ntpq.html@1.41 +639 -655
+ Documentation updates from Dave Mills
+
+ html/ntptime.html@1.17 +44 -46
+ Documentation updates from Dave Mills
+
+ html/ntptrace.html@1.15 +41 -43
+ Documentation updates from Dave Mills
+
+ html/orphan.html@1.1 +36 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/orphan.html
+
+ html/orphan.html@1.0 +0 -0
+
+ html/pic/fig_3_1.gif@1.1 +528 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/fig_3_1.gif
+
+ html/pic/fig_3_1.gif@1.0 +0 -0
+
+ html/pic/group.gif@1.1 +63 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/group.gif
+
+ html/pic/group.gif@1.0 +0 -0
+
+ html/pps.html@1.21 +44 -47
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.23 +61 -112
+ Documentation updates from Dave Mills
+
+ html/quick.html@1.21 +43 -44
+ Documentation updates from Dave Mills
+
+ html/rate.html@1.6 +53 -69
+ Documentation updates from Dave Mills
+
+ html/rdebug.html@1.17 +29 -29
+ Documentation updates from Dave Mills
+
+ html/refclock.html@1.35 +89 -88
+ Documentation updates from Dave Mills
+
+ html/release.html@1.37 +66 -59
+ Documentation updates from Dave Mills
+
+ html/scripts/accopt.txt@1.2 +4 -4
+ Documentation updates from Dave Mills
+
+ html/scripts/audio.txt@1.2 +6 -6
+ Documentation updates from Dave Mills
+
+ html/scripts/authopt.txt@1.3 +9 -9
+ Documentation updates from Dave Mills
+
+ html/scripts/clockopt.txt@1.2 +3 -3
+ Documentation updates from Dave Mills
+
+ html/scripts/command.txt@1.3 +9 -11
+ Documentation updates from Dave Mills
+
+ html/scripts/config.txt@1.3 +5 -7
+ Documentation updates from Dave Mills
+
+ html/scripts/confopt.txt@1.3 +11 -11
+ Documentation updates from Dave Mills
+
+ html/scripts/external.txt@1.3 +17 -15
+ Documentation updates from Dave Mills
+
+ html/scripts/hand.txt@1.1 +11 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/hand.txt
+
+ html/scripts/hand.txt@1.0 +0 -0
+
+ html/scripts/install.txt@1.3 +10 -12
+ Documentation updates from Dave Mills
+
+ html/scripts/manual.txt@1.3 +13 -13
+ Documentation updates from Dave Mills
+
+ html/scripts/misc.txt@1.2 +9 -9
+ Documentation updates from Dave Mills
+
+ html/scripts/miscopt.txt@1.5 +19 -19
+ Documentation updates from Dave Mills
+
+ html/scripts/monopt.txt@1.2 +4 -4
+ Documentation updates from Dave Mills
+
+ html/scripts/refclock.txt@1.2 +6 -6
+ Documentation updates from Dave Mills
+
+ html/scripts/special.txt@1.1 +11 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/special.txt
+
+ html/scripts/special.txt@1.0 +0 -0
+
+ html/sitemap.html@1.4 +31 -34
+ Documentation updates from Dave Mills
+
+ html/sntp.html@1.7 +52 -54
+ Documentation updates from Dave Mills
+
+ html/tickadj.html@1.16 +43 -44
+ Documentation updates from Dave Mills
+
+ html/warp.html@1.1 +51 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/warp.html
+
+ html/warp.html@1.0 +0 -0
+
+ html/xleave.html@1.5 +28 -39
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2156.1.20, 2010-09-11 01:16:34-04:00, stenn@deacon.udel.edu
+ [Bug 1616] refclock_acts.c: if (pp->leap == 2) is always false.
+
+ ChangeLog@1.612 +1 -0
+ [Bug 1616] refclock_acts.c: if (pp->leap == 2) is always false.
+
+ ntpd/refclock_acts.c@1.39 +1 -1
+ [Bug 1616] refclock_acts.c: if (pp->leap == 2) is always false.
+
+ChangeSet@1.2156.1.19, 2010-09-11 01:11:46-04:00, stenn@pogo.udel.edu
+ [Bug 1620] [Backward Incompatible] "discard minimum" value should be in seconds, not log2 seconds
+
+ ChangeLog@1.611 +2 -0
+ [Bug 1620] [Backward Incompatible] "discard minimum" value should be in seconds, not log2 seconds
+
+ include/ntp.h@1.181 +1 -1
+ [Bug 1620] [Backward Incompatible] "discard minimum" value should be in seconds, not log2 seconds
+
+ ntpd/ntp_monitor.c@1.36 +1 -1
+ [Bug 1620] [Backward Incompatible] "discard minimum" value should be in seconds, not log2 seconds
+
+ ntpd/ntp_proto.c@1.302 +4 -6
+ [Bug 1620] [Backward Incompatible] "discard minimum" value should be in seconds, not log2 seconds
+
+ChangeSet@1.2156.3.15, 2010-09-10 10:12:03+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P46
+ TAG: NTP_4_2_7P46
+
+ ChangeLog@1.607.8.5 +1 -0
+ NTP_4_2_7P46
+
+ ntpd/ntpd-opts.c@1.49 +2 -2
+ NTP_4_2_7P46
+
+ ntpd/ntpd-opts.h@1.49 +3 -3
+ NTP_4_2_7P46
+
+ ntpd/ntpd-opts.texi@1.48 +2 -2
+ NTP_4_2_7P46
+
+ ntpd/ntpd.1@1.48 +2 -2
+ NTP_4_2_7P46
+
+ ntpdc/ntpdc-opts.c@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpdc/ntpdc-opts.h@1.47 +3 -3
+ NTP_4_2_7P46
+
+ ntpdc/ntpdc-opts.texi@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpdc/ntpdc.1@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpq/ntpq-opts.c@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpq/ntpq-opts.h@1.47 +3 -3
+ NTP_4_2_7P46
+
+ ntpq/ntpq-opts.texi@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpq/ntpq.1@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.47 +3 -3
+ NTP_4_2_7P46
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.47 +2 -2
+ NTP_4_2_7P46
+
+ ntpsnmpd/ntpsnmpd.1@1.47 +2 -2
+ NTP_4_2_7P46
+
+ packageinfo.sh@1.48 +1 -1
+ NTP_4_2_7P46
+
+ sntp/sntp-opts.c@1.47 +2 -2
+ NTP_4_2_7P46
+
+ sntp/sntp-opts.h@1.47 +3 -3
+ NTP_4_2_7P46
+
+ sntp/sntp-opts.texi@1.47 +1 -1
+ NTP_4_2_7P46
+
+ sntp/sntp.1@1.47 +2 -2
+ NTP_4_2_7P46
+
+ sntp/sntp.html@1.47 +1 -1
+ NTP_4_2_7P46
+
+ util/ntp-keygen-opts.c@1.41.1.6 +2 -2
+ NTP_4_2_7P46
+
+ util/ntp-keygen-opts.h@1.41.1.6 +3 -3
+ NTP_4_2_7P46
+
+ util/ntp-keygen-opts.texi@1.47 +2 -2
+ NTP_4_2_7P46
+
+ util/ntp-keygen.1@1.47 +2 -2
+ NTP_4_2_7P46
+
+ChangeSet@1.2156.3.14, 2010-09-10 00:26:46-04:00, stenn@deacon.udel.edu
+ Use AC_SEARCH_LIBS instead of AC_CHECK_LIB for NTP_LIB_M
+
+ ChangeLog@1.607.8.4 +1 -0
+ Use AC_SEARCH_LIBS instead of AC_CHECK_LIB for NTP_LIB_M
+
+ m4/ntp_lib_m.m4@1.2 +1 -1
+ Use AC_SEARCH_LIBS instead of AC_CHECK_LIB for NTP_LIB_M
+
+ChangeSet@1.2156.3.13, 2010-09-05 10:11:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P45
+ TAG: NTP_4_2_7P45
+
+ ChangeLog@1.607.8.3 +1 -0
+ NTP_4_2_7P45
+
+ ntpd/ntpd-opts.c@1.48 +2 -2
+ NTP_4_2_7P45
+
+ ntpd/ntpd-opts.h@1.48 +3 -3
+ NTP_4_2_7P45
+
+ ntpd/ntpd-opts.texi@1.47 +2 -2
+ NTP_4_2_7P45
+
+ ntpd/ntpd.1@1.47 +2 -2
+ NTP_4_2_7P45
+
+ ntpdc/ntpdc-opts.c@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpdc/ntpdc-opts.h@1.46 +3 -3
+ NTP_4_2_7P45
+
+ ntpdc/ntpdc-opts.texi@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpdc/ntpdc.1@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpq/ntpq-opts.c@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpq/ntpq-opts.h@1.46 +3 -3
+ NTP_4_2_7P45
+
+ ntpq/ntpq-opts.texi@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpq/ntpq.1@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.46 +3 -3
+ NTP_4_2_7P45
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.46 +2 -2
+ NTP_4_2_7P45
+
+ ntpsnmpd/ntpsnmpd.1@1.46 +2 -2
+ NTP_4_2_7P45
+
+ packageinfo.sh@1.47 +1 -1
+ NTP_4_2_7P45
+
+ sntp/sntp-opts.c@1.46 +2 -2
+ NTP_4_2_7P45
+
+ sntp/sntp-opts.h@1.46 +3 -3
+ NTP_4_2_7P45
+
+ sntp/sntp-opts.texi@1.46 +1 -1
+ NTP_4_2_7P45
+
+ sntp/sntp.1@1.46 +2 -2
+ NTP_4_2_7P45
+
+ sntp/sntp.html@1.46 +1 -1
+ NTP_4_2_7P45
+
+ util/ntp-keygen-opts.c@1.41.1.5 +2 -2
+ NTP_4_2_7P45
+
+ util/ntp-keygen-opts.h@1.41.1.5 +3 -3
+ NTP_4_2_7P45
+
+ util/ntp-keygen-opts.texi@1.46 +2 -2
+ NTP_4_2_7P45
+
+ util/ntp-keygen.1@1.46 +2 -2
+ NTP_4_2_7P45
+
+ChangeSet@1.2156.3.12, 2010-09-05 02:41:15-04:00, stenn@deacon.udel.edu
+ [Bug 1578] Consistently use -lm when needed
+
+ ChangeLog@1.607.8.2 +1 -0
+ [Bug 1578] Consistently use -lm when needed
+
+ clockstuff/Makefile.am@1.10 +1 -2
+ [Bug 1578] Consistently use -lm when needed
+
+ configure.ac@1.483.2.1 +1 -0
+ [Bug 1578] Consistently use -lm when needed
+
+ m4/ntp_lib_m.m4@1.1 +14 -0
+ BitKeeper file /deacon/backroom/ntp-dev-1578/m4/ntp_lib_m.m4
+
+ m4/ntp_lib_m.m4@1.0 +0 -0
+
+ ntpd/Makefile.am@1.93 +2 -7
+ [Bug 1578] Consistently use -lm when needed
+
+ ntpdate/Makefile.am@1.24 +1 -1
+ [Bug 1578] Consistently use -lm when needed
+
+ ntpq/Makefile.am@1.49 +1 -1
+ [Bug 1578] Consistently use -lm when needed
+
+ sntp/Makefile.am@1.34 +1 -1
+ [Bug 1578] Consistently use -lm when needed
+
+ sntp/configure.ac@1.35 +1 -1
+ [Bug 1578] Consistently use -lm when needed
+
+ util/Makefile.am@1.50 +1 -1
+ [Bug 1578] Consistently use -lm when needed
+
+ChangeSet@1.2156.3.11, 2010-08-27 10:09:33+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P44
+ TAG: NTP_4_2_7P44
+
+ ChangeLog@1.607.8.1 +1 -0
+ NTP_4_2_7P44
+
+ ntpd/ntpd-opts.c@1.47 +2 -2
+ NTP_4_2_7P44
+
+ ntpd/ntpd-opts.h@1.47 +3 -3
+ NTP_4_2_7P44
+
+ ntpd/ntpd-opts.texi@1.46 +2 -2
+ NTP_4_2_7P44
+
+ ntpd/ntpd.1@1.46 +2 -2
+ NTP_4_2_7P44
+
+ ntpdc/ntpdc-opts.c@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpdc/ntpdc-opts.h@1.45 +3 -3
+ NTP_4_2_7P44
+
+ ntpdc/ntpdc-opts.texi@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpdc/ntpdc.1@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpq/ntpq-opts.c@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpq/ntpq-opts.h@1.45 +3 -3
+ NTP_4_2_7P44
+
+ ntpq/ntpq-opts.texi@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpq/ntpq.1@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.45 +3 -3
+ NTP_4_2_7P44
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.45 +2 -2
+ NTP_4_2_7P44
+
+ ntpsnmpd/ntpsnmpd.1@1.45 +2 -2
+ NTP_4_2_7P44
+
+ packageinfo.sh@1.46 +1 -1
+ NTP_4_2_7P44
+
+ sntp/sntp-opts.c@1.45 +2 -2
+ NTP_4_2_7P44
+
+ sntp/sntp-opts.h@1.45 +3 -3
+ NTP_4_2_7P44
+
+ sntp/sntp-opts.texi@1.45 +1 -1
+ NTP_4_2_7P44
+
+ sntp/sntp.1@1.45 +2 -2
+ NTP_4_2_7P44
+
+ sntp/sntp.html@1.45 +1 -1
+ NTP_4_2_7P44
+
+ util/ntp-keygen-opts.c@1.41.1.4 +2 -2
+ NTP_4_2_7P44
+
+ util/ntp-keygen-opts.h@1.41.1.4 +3 -3
+ NTP_4_2_7P44
+
+ util/ntp-keygen-opts.texi@1.45 +2 -2
+ NTP_4_2_7P44
+
+ util/ntp-keygen.1@1.45 +2 -2
+ NTP_4_2_7P44
+
+ChangeSet@1.2156.8.5, 2010-08-26 09:34:12+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P43
+ TAG: NTP_4_2_7P43
+
+ ChangeLog@1.607.7.3 +1 -0
+ NTP_4_2_7P43
+
+ ntpd/ntpd-opts.c@1.46 +2 -2
+ NTP_4_2_7P43
+
+ ntpd/ntpd-opts.h@1.46 +3 -3
+ NTP_4_2_7P43
+
+ ntpd/ntpd-opts.texi@1.45 +2 -2
+ NTP_4_2_7P43
+
+ ntpd/ntpd.1@1.45 +2 -2
+ NTP_4_2_7P43
+
+ ntpdc/ntpdc-opts.c@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpdc/ntpdc-opts.h@1.44 +3 -3
+ NTP_4_2_7P43
+
+ ntpdc/ntpdc-opts.texi@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpdc/ntpdc.1@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpq/ntpq-opts.c@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpq/ntpq-opts.h@1.44 +3 -3
+ NTP_4_2_7P43
+
+ ntpq/ntpq-opts.texi@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpq/ntpq.1@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.44 +3 -3
+ NTP_4_2_7P43
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.44 +2 -2
+ NTP_4_2_7P43
+
+ ntpsnmpd/ntpsnmpd.1@1.44 +2 -2
+ NTP_4_2_7P43
+
+ packageinfo.sh@1.45 +1 -1
+ NTP_4_2_7P43
+
+ sntp/sntp-opts.c@1.44 +2 -2
+ NTP_4_2_7P43
+
+ sntp/sntp-opts.h@1.44 +3 -3
+ NTP_4_2_7P43
+
+ sntp/sntp-opts.texi@1.44 +1 -1
+ NTP_4_2_7P43
+
+ sntp/sntp.1@1.44 +2 -2
+ NTP_4_2_7P43
+
+ sntp/sntp.html@1.44 +1 -1
+ NTP_4_2_7P43
+
+ util/ntp-keygen-opts.c@1.41.1.3 +2 -2
+ NTP_4_2_7P43
+
+ util/ntp-keygen-opts.h@1.41.1.3 +3 -3
+ NTP_4_2_7P43
+
+ util/ntp-keygen-opts.texi@1.44 +2 -2
+ NTP_4_2_7P43
+
+ util/ntp-keygen.1@1.44 +2 -2
+ NTP_4_2_7P43
+
+ChangeSet@1.2225, 2010-08-21 12:15:45+02:00, linus@beam.lund.zozs.se
+ Modified tests to redirect stderr themselves, instead of relying on an external variable in sntp/log.c
+
+ tests/sntp/logFile.cpp@1.4 +16 -3
+ Modified tests to redirect stderr themselves, instead of relying on an external variable in sntp/log.c
+
+ChangeSet@1.2156.9.1, 2010-08-21 12:05:58+02:00, linus@beam.lund.zozs.se
+ Reverted sntp/log.c refactoring.
+
+ sntp/log.c@1.15 +1 -2
+ Reverted sntp/log.c refactoring.
+
+ChangeSet@1.2156.8.3, 2010-08-19 06:16:56+00:00, stenn@psp-fb2.ntp.org
+ [Bug 1602] Refactor some of the sntp/ directory to facililtate testing
+
+ ChangeLog@1.607.7.2 +1 -0
+ [Bug 1602] Refactor some of the sntp/ directory to facililtate testing
+
+ChangeSet@1.2220, 2010-08-18 07:46:34-04:00, karlsson@psp-deb1.ntp.org
+ Fixed a testing bug, where key type was not null terminated
+
+ tests/sntp/crypto.cpp@1.2 +6 -6
+ Fixed a testing bug, where key type was not null terminated
+
+ChangeSet@1.2156.8.1, 2010-08-18 10:09:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P42
+ TAG: NTP_4_2_7P42
+
+ ChangeLog@1.607.7.1 +1 -0
+ NTP_4_2_7P42
+
+ ntpd/ntpd-opts.c@1.45 +2 -2
+ NTP_4_2_7P42
+
+ ntpd/ntpd-opts.h@1.45 +3 -3
+ NTP_4_2_7P42
+
+ ntpd/ntpd-opts.texi@1.44 +2 -2
+ NTP_4_2_7P42
+
+ ntpd/ntpd.1@1.44 +2 -2
+ NTP_4_2_7P42
+
+ ntpdc/ntpdc-opts.c@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpdc/ntpdc-opts.h@1.43 +3 -3
+ NTP_4_2_7P42
+
+ ntpdc/ntpdc-opts.texi@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpdc/ntpdc.1@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpq/ntpq-opts.c@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpq/ntpq-opts.h@1.43 +3 -3
+ NTP_4_2_7P42
+
+ ntpq/ntpq-opts.texi@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpq/ntpq.1@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.43 +3 -3
+ NTP_4_2_7P42
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.43 +2 -2
+ NTP_4_2_7P42
+
+ ntpsnmpd/ntpsnmpd.1@1.43 +2 -2
+ NTP_4_2_7P42
+
+ packageinfo.sh@1.44 +1 -1
+ NTP_4_2_7P42
+
+ sntp/sntp-opts.c@1.43 +2 -2
+ NTP_4_2_7P42
+
+ sntp/sntp-opts.h@1.43 +3 -3
+ NTP_4_2_7P42
+
+ sntp/sntp-opts.texi@1.43 +1 -1
+ NTP_4_2_7P42
+
+ sntp/sntp.1@1.43 +2 -2
+ NTP_4_2_7P42
+
+ sntp/sntp.html@1.43 +1 -1
+ NTP_4_2_7P42
+
+ util/ntp-keygen-opts.c@1.41.1.2 +2 -2
+ NTP_4_2_7P42
+
+ util/ntp-keygen-opts.h@1.41.1.2 +3 -3
+ NTP_4_2_7P42
+
+ util/ntp-keygen-opts.texi@1.43 +2 -2
+ NTP_4_2_7P42
+
+ util/ntp-keygen.1@1.43 +2 -2
+ NTP_4_2_7P42
+
+ChangeSet@1.2082.22.4, 2010-08-18 11:26:41+02:00, linus@beam.lund.zozs.se
+ [BUG 1573] Miscalculation of offset in sntp.
+
+ ChangeLog@1.496.47.3 +1 -0
+ [BUG 1573] Miscalculation of offset in sntp.
+
+ sntp/main.c@1.24.1.2 +2 -2
+ [BUG 1573] Miscalculation of offset in sntp.
+
+ChangeSet@1.2218, 2010-08-13 17:51:26+02:00, linus@beam.lund.zozs.se
+ Added test for debug_msg()
+
+ tests/sntp/data/log-expected-debug@1.1 +4 -0
+ Added test for debug_msg()
+
+ tests/sntp/data/log-expected-debug@1.0 +0 -0
+
+ tests/sntp/logFile.cpp@1.3 +25 -6
+ Added test for debug_msg()
+
+ tests/sntp/packetProcessing.cpp@1.3 +0 -17
+ Moved common code to superclass
+
+ tests/sntp/sntptest.h@1.4 +26 -0
+ Moved common code to superclass
+
+ChangeSet@1.2156.6.11, 2010-08-13 16:54:32+02:00, linus@beam.lund.zozs.se
+ Minor refactoring to allow redirection of debug messages from unit tests.
+
+ sntp/log.c@1.14 +2 -1
+ Minor refactoring to allow redirection of debug messages from unit tests.
+
+ChangeSet@1.2216, 2010-08-12 20:26:04+02:00, linus@beam.lund.zozs.se
+ Added tests for debug functions in utilities.c
+ Minor cleanups.
+
+ tests/sntp/data/debug-input-lfp-bin@1.1 +3 -0
+ Added tests for debug functions
+
+ tests/sntp/data/debug-input-lfp-bin@1.0 +0 -0
+
+ tests/sntp/data/debug-input-lfp-dec@1.1 +3 -0
+ Added tests for debug functions
+
+ tests/sntp/data/debug-input-lfp-dec@1.0 +0 -0
+
+ tests/sntp/data/debug-input-lfp-hex@1.1 +3 -0
+ Added tests for debug functions
+
+ tests/sntp/data/debug-input-lfp-hex@1.0 +0 -0
+
+ tests/sntp/data/debug-input-pkt@1.1 +8 -0
+ Added tests for debug functions
+
+ tests/sntp/data/debug-input-pkt@1.0 +0 -0
+
+ tests/sntp/fileHandlingTest.h@1.3 +11 -0
+ Added include guard, and moved common code to base class
+
+ tests/sntp/sntptest.h@1.3 +5 -0
+ Added include guard
+
+ tests/sntp/utilities.cpp@1.3 +103 -0
+ Added tests for debug functions in utilities.c
+
+ tests/tests_main.h@1.5 +5 -0
+ Added include guard.
+
+ChangeSet@1.2215, 2010-08-11 23:39:59+02:00, linus@beam.lund.zozs.se
+ Added more tests in different areas.
+
+ tests/sntp/data/key-test-invalid-hex@1.1 +2 -0
+ Added extra tests for reading of key files.
+
+ tests/sntp/data/key-test-invalid-hex@1.0 +0 -0
+
+ tests/sntp/keyFile.cpp@1.2 +18 -0
+ Added extra tests for reading of key files.
+
+ tests/sntp/networking.cpp@1.6 +30 -0
+ Added tests when preferring IPv4/IPv6 addresses in name resolution.
+
+ tests/sntp/utilities.cpp@1.2 +27 -0
+ Added tests for set_li_vn_mode()
+
+ChangeSet@1.2156.7.3, 2010-08-11 01:40:34+02:00, linus@beam.lund.zozs.se
+ [Bug 1597] packet processing ignores RATE KoD packets.
+
+ ChangeLog@1.607.4.3 +1 -1
+ [Bug 1597] packet processing ignores RATE KoD packets.
+
+ChangeSet@1.2156.7.2, 2010-08-11 01:34:52+02:00, linus@beam.lund.zozs.se
+ [Bug 1597] packet processing ignores RATE KoD packets, because of a bug in string comparision.
+
+ ChangeLog@1.607.4.2 +7 -2
+ [Bug 1597] packet processing ignores RATE KoD packets, because of a bug in string comparision.
+
+ChangeSet@1.2156.5.4, 2010-08-11 01:31:43+02:00, linus@beam.lund.zozs.se
+ [Bug 1595] empty last line in key file causes duplicate key to be added
+
+ ChangeLog@1.607.5.1 +6 -1
+ [Bug 1595] empty last line in key file causes duplicate key to be added
+
+ChangeSet@1.2212, 2010-08-10 18:30:22+02:00, linus@beam.lund.zozs.se
+ Creates the output directory before running the tests.
+
+ tests/sntp/Makefile.am@1.12 +4 -1
+ Some cleanup.
+
+ tests/sntp/test-driver@1.3 +3 -0
+ Create the output directory before running the tests.
+
+ChangeSet@1.2211, 2010-08-10 13:14:24+02:00, linus@beam.lund.zozs.se
+ Modified tests to use the new prototype of process_pkt()
+ Added tests for reply/response check moved to process_pkt() in refactoring.
+
+ tests/sntp/packetProcessing.cpp@1.2 +57 -18
+ Modified tests to use the new prototype of process_pkt()
+ Added tests for reply/response check moved to process_pkt() in refactoring.
+
+ChangeSet@1.2156.6.10, 2010-08-10 13:04:29+02:00, linus@beam.lund.zozs.se
+ Modified evaluation order to accept NULL as argument to spkt.
+
+ sntp/networking.c@1.37.1.2 +1 -1
+ Modified evaluation order to accept NULL as argument to spkt.
+
+ChangeSet@1.2156.6.9, 2010-08-10 12:09:28+02:00, linus@beam.lund.zozs.se
+ Moved check for valid response to process_pkt() to simplify testing.
+
+ sntp/networking.c@1.37.1.1 +21 -19
+ Moved check for valid response to process_pkt() to simplify testing.
+
+ sntp/networking.h@1.18.1.2 +1 -1
+ Moved check for valid response to process_pkt() to simplify testing.
+
+ChangeSet@1.2208, 2010-08-09 17:15:14+02:00, linus@beam.lund.zozs.se
+ Moved packet processing tests to a new unit.
+ Added tests for resolve_hosts()
+
+ tests/sntp/Makefile.am@1.11 +1 -0
+ Moved packet processing tests to a separate unit.
+
+ tests/sntp/logFile.cpp@1.2 +0 -2
+ Removed multiple calls to cleanup_log to prevent segfault.
+
+ tests/sntp/networking.cpp@1.5 +97 -271
+ Moved packet processing tests to a new unit.
+ Added tests for resolve_hosts()
+
+ tests/sntp/packetProcessing.cpp@1.1 +312 -0
+ Moved packet processing tests to a new unit.
+
+ tests/sntp/packetProcessing.cpp@1.0 +0 -0
+
+ChangeSet@1.2207, 2010-08-09 12:53:37+02:00, linus@beam.lund.zozs.se
+ Added tests for log file.
+ Added test for packets signed with SHA1.
+
+ tests/sntp/Makefile.am@1.10 +1 -0
+ Added tests for log file.
+
+ tests/sntp/data/log-expected-log@1.1 +4 -0
+ Added test for log file.
+
+ tests/sntp/data/log-expected-log@1.0 +0 -0
+
+ tests/sntp/logFile.cpp@1.1 +39 -0
+ Added test for log file.
+
+ tests/sntp/logFile.cpp@1.0 +0 -0
+
+ tests/sntp/networking.cpp@1.4 +29 -3
+ Added test for correct packet signed with SHA1.
+
+ChangeSet@1.2206, 2010-08-05 22:59:12+02:00, linus@beam.lund.zozs.se
+ Added tests for authentication
+
+ tests/sntp/Makefile.am@1.9 +1 -0
+ Added tests for authentication
+
+ tests/sntp/crypto.cpp@1.1 +125 -0
+ Added tests for authentication
+
+ tests/sntp/crypto.cpp@1.0 +0 -0
+
+ChangeSet@1.2205, 2010-08-05 15:10:49+02:00, linus@beam.lund.zozs.se
+ Added tests for handle_packet() function.
+
+ tests/sntp/packetHandling.cpp@1.3 +82 -0
+ Added tests for handle_packet() function.
+
+ChangeSet@1.2204, 2010-08-04 23:40:16+02:00, linus@beam.lund.zozs.se
+ Added test for negative offset calculation.
+
+ tests/sntp/packetHandling.cpp@1.2 +41 -0
+ Added test for negative offset calculation.
+
+ChangeSet@1.2203, 2010-08-04 00:37:25+02:00, linus@beam.lund.zozs.se
+ Renamed main class for tests.
+ Added tests for packet generation and time offset calculations.
+
+ tests/libntp/Makefile.am@1.21 +1 -1
+ Renamed main file for tests.
+
+ tests/libntp/libntptest.h@1.3 +1 -1
+ Renamed main file for tests.
+
+ tests/sntp/Makefile.am@1.8 +3 -1
+ Renamed main file for tests.
+ Added tests for packet generation.
+
+ tests/sntp/packetHandling.cpp@1.1 +124 -0
+ Added new tests for packet generation and time offset calculations.
+
+ tests/sntp/packetHandling.cpp@1.0 +0 -0
+
+ tests/sntp/sntptest.h@1.2 +1 -1
+ Renamed main file for tests.
+
+ tests/tests_main.cpp@1.5 +1 -1
+ Renamed main class for tests.
+
+ tests/tests_main.cpp@1.4 +0 -0
+ Rename: tests/main.cpp -> tests/tests_main.cpp
+
+ tests/tests_main.h@1.4 +0 -0
+ Rename: tests/main.h -> tests/tests_main.h
+
+ChangeSet@1.2156.6.8, 2010-08-03 23:44:21+02:00, linus@beam.lund.zozs.se
+ Moved time dependent code out of the offset calculations.
+
+ sntp/main.c@1.32 +3 -2
+ Moved time dependent code out of the offset calculations.
+
+ChangeSet@1.2156.6.7, 2010-08-03 15:10:22+02:00, linus@beam.lund.zozs.se
+ Moved definition of progname and debug to sntp.c
+
+ sntp/main.c@1.31 +0 -3
+ Moved definition of progname and debug to sntp.c
+
+ sntp/sntp.c@1.2 +3 -0
+ Moved definition of progname and debug to sntp.c
+
+ChangeSet@1.2156.6.6, 2010-08-03 13:26:19+02:00, linus@beam.lund.zozs.se
+ Moved the time offset calculations to a separate function.
+
+ sntp/main.c@1.30 +72 -56
+ Moved the time offset calculations to a separate function.
+
+ sntp/main.h@1.3 +4 -0
+ Added prototypes for the new functions.
+
+ChangeSet@1.2156.6.5, 2010-08-02 20:36:02+02:00, linus@beam.lund.zozs.se
+ Refactoring of packet parsing for unit testing.
+ Moved packet parsing to a new function.
+
+ sntp/main.c@1.29 +142 -126
+ Refactoring of packet parsing for unit testing.
+ Moved packet parsing to a new function.
+
+ChangeSet@1.2156.6.4, 2010-08-02 17:53:13+02:00, linus@beam.lund.zozs.se
+ Factored out packet generation to a new function.
+
+ sntp/main.c@1.28 +32 -19
+ Factored out packet generation to a new function.
+
+ sntp/main.h@1.2 +7 -3
+ Factored out packet generation to a new function.
+
+ChangeSet@1.2156.6.3, 2010-08-02 14:20:12+02:00, linus@beam.lund.zozs.se
+ Moved main() function to a new file to make unit testing easier.
+
+ sntp/Makefile.am@1.33 +2 -0
+ Moved main() function to a new file to make unit testing easier.
+
+ sntp/main.c@1.27 +1 -26
+ Moved main() function to a new file to make unit testing easier.
+
+ sntp/main.h@1.1 +21 -0
+ Moved main() function to a new file to make unit testing easier.
+
+ sntp/main.h@1.0 +0 -0
+
+ sntp/sntp.c@1.1 +10 -0
+ Moved main() function to a new file to make unit testing easier.
+
+ sntp/sntp.c@1.0 +0 -0
+
+ChangeSet@1.2199, 2010-07-31 23:13:39+02:00, linus@beam.lund.zozs.se
+ * Added more tests for packet processing.
+ * Refactored the authenticated tests.
+
+ tests/sntp/networking.cpp@1.3 +18 -37
+ Added more tests for packet processing, and refactored the tests using authenticated packets.
+
+ChangeSet@1.2198, 2010-07-31 22:49:46+02:00, linus@beam.lund.zozs.se
+ Added more tests for packet processing.
+
+ tests/sntp/networking.cpp@1.2 +142 -20
+ Added more tests.
+
+ChangeSet@1.2082.23.1, 2010-07-31 21:59:50+02:00, linus@beam.lund.zozs.se
+ [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string comparison.
+
+ ChangeLog@1.496.48.1 +5 -0
+ [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string comparison.
+
+ sntp/networking.c@1.29.1.7 +3 -3
+ [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string comparison.
+
+ChangeSet@1.2196, 2010-07-30 22:02:44+02:00, linus@beam.lund.zozs.se
+ Added tests for packet processing.
+
+ tests/sntp/Makefile.am@1.7 +2 -0
+ Added networking tests.
+
+ tests/sntp/networking.cpp@1.1 +186 -0
+ Added tests for packet processing.
+
+ tests/sntp/networking.cpp@1.0 +0 -0
+
+ChangeSet@1.2156.6.2, 2010-07-30 13:14:50+02:00, linus@beam.lund.zozs.se
+ Added prototype to header
+
+ sntp/networking.h@1.18.1.1 +2 -0
+ Added prototype to header
+
+ChangeSet@1.2156.6.1, 2010-07-30 12:37:05+02:00, linus@beam.lund.zozs.se
+ Made process_pkt() a public function to ease testing.
+
+ sntp/networking.c@1.37 +1 -1
+ Made process_pkt() a public function to ease testing.
+
+ChangeSet@1.2192, 2010-07-30 10:41:21+02:00, linus@beam.lund.zozs.se
+ Moved file handling code from test to superclass
+
+ tests/sntp/fileHandlingTest.h@1.2 +29 -0
+ Moved file handling code from test to superclass
+
+ tests/sntp/kodFile.cpp@1.6 +0 -27
+ Moved file handling code from test to superclass
+
+ChangeSet@1.2191, 2010-07-28 22:59:08+02:00, linus@beam.lund.zozs.se
+ Added tests for some utilities functions.
+
+ tests/sntp/Makefile.am@1.6 +4 -2
+ Added tests for some utilities functions.
+
+ tests/sntp/utilities.cpp@1.1 +66 -0
+ Added tests for some utilities functions.
+
+ tests/sntp/utilities.cpp@1.0 +0 -0
+
+ChangeSet@1.2082.22.2, 2010-07-28 18:30:17+02:00, linus@beam.lund.zozs.se
+ [Bug 1595] empty last line in key file causes duplicate key to be added
+
+ ChangeLog@1.496.47.1 +4 -0
+ [Bug 1595] empty last line in key file causes duplicate key to be added
+
+ChangeSet@1.2082.22.1, 2010-07-28 18:18:55+02:00, linus@beam.lund.zozs.se
+ [Bug 1595] empty last line in key file causes duplicate key to be added
+
+ sntp/crypto.c@1.10.1.3 +3 -1
+ [Bug 1595] empty last line in key file causes duplicate key to be added
+
+ChangeSet@1.2189, 2010-07-28 13:38:35+02:00, linus@beam.lund.zozs.se
+ Added tests for reading of key file.
+
+ tests/sntp/Makefile.am@1.5 +4 -1
+ Added tests for reading of key file.
+
+ tests/sntp/data/key-test-ascii@1.1 +2 -0
+ Input files for key file tests
+
+ tests/sntp/data/key-test-ascii@1.0 +0 -0
+
+ tests/sntp/data/key-test-comments@1.1 +3 -0
+ Input files for key file test
+
+ tests/sntp/data/key-test-comments@1.0 +0 -0
+
+ tests/sntp/data/key-test-empty@1.1 +0 -0
+ Input file for key file test
+
+ tests/sntp/data/key-test-empty@1.0 +0 -0
+
+ tests/sntp/data/key-test-hex@1.1 +3 -0
+ Input files for key file test
+
+ tests/sntp/data/key-test-hex@1.0 +0 -0
+
+ tests/sntp/fileHandlingTest.h@1.1 +24 -0
+ Moved file handling code to superclass
+
+ tests/sntp/fileHandlingTest.h@1.0 +0 -0
+
+ tests/sntp/keyFile.cpp@1.1 +112 -0
+ Added tests for key file reading.
+
+ tests/sntp/keyFile.cpp@1.0 +0 -0
+
+ tests/sntp/kodFile.cpp@1.5 +2 -22
+ Moved file handling code to superclass.
+
+ChangeSet@1.2156.5.1, 2010-07-28 05:48:23+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P41
+ TAG: NTP_4_2_7P41
+
+ ChangeLog@1.607.3.1 +1 -0
+ NTP_4_2_7P41
+
+ ntpd/ntpd-opts.c@1.44 +2 -2
+ NTP_4_2_7P41
+
+ ntpd/ntpd-opts.h@1.44 +3 -3
+ NTP_4_2_7P41
+
+ ntpd/ntpd-opts.texi@1.43 +2 -2
+ NTP_4_2_7P41
+
+ ntpd/ntpd.1@1.43 +2 -2
+ NTP_4_2_7P41
+
+ ntpdc/ntpdc-opts.c@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpdc/ntpdc-opts.h@1.42 +3 -3
+ NTP_4_2_7P41
+
+ ntpdc/ntpdc-opts.texi@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpdc/ntpdc.1@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpq/ntpq-opts.c@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpq/ntpq-opts.h@1.42 +3 -3
+ NTP_4_2_7P41
+
+ ntpq/ntpq-opts.texi@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpq/ntpq.1@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.42 +3 -3
+ NTP_4_2_7P41
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.42 +2 -2
+ NTP_4_2_7P41
+
+ ntpsnmpd/ntpsnmpd.1@1.42 +2 -2
+ NTP_4_2_7P41
+
+ packageinfo.sh@1.43 +1 -1
+ NTP_4_2_7P41
+
+ sntp/sntp-opts.c@1.42 +2 -2
+ NTP_4_2_7P41
+
+ sntp/sntp-opts.h@1.42 +3 -3
+ NTP_4_2_7P41
+
+ sntp/sntp-opts.texi@1.42 +1 -1
+ NTP_4_2_7P41
+
+ sntp/sntp.1@1.42 +2 -2
+ NTP_4_2_7P41
+
+ sntp/sntp.html@1.42 +1 -1
+ NTP_4_2_7P41
+
+ util/ntp-keygen-opts.c@1.41.1.1 +2 -2
+ NTP_4_2_7P41
+
+ util/ntp-keygen-opts.h@1.41.1.1 +3 -3
+ NTP_4_2_7P41
+
+ util/ntp-keygen-opts.texi@1.42 +2 -2
+ NTP_4_2_7P41
+
+ util/ntp-keygen.1@1.42 +2 -2
+ NTP_4_2_7P41
+
+ChangeSet@1.2156.3.5, 2010-07-28 05:33:53+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1593] ntpd abort in free() with logconfig syntax error.
+
+ ChangeLog@1.607.1.5 +1 -0
+ [Bug 1593] ntpd abort in free() with logconfig syntax error.
+
+ ntpd/ntp_parser.c@1.59 +62 -52
+ Bison output
+
+ ntpd/ntp_parser.y@1.54 +17 -7
+ [Bug 1593] ntpd abort in free() with logconfig syntax error.
+
+ChangeSet@1.2156.3.4, 2010-07-27 23:14:28-04:00, stenn@pogo.udel.edu
+ merge cleanup
+
+ ChangeLog@1.607.1.4 +2 -0
+ merge cleanup
+
+ChangeSet@1.2156.4.1, 2010-07-27 22:59:12-04:00, stenn@deacon.udel.edu
+ orphanwait documentation changes
+
+ ChangeLog@1.607.2.1 +1 -0
+ orphanwait documentation changes
+
+ html/assoc.html@1.30 +4 -3
+ orphanwait documentation changes
+
+ html/miscopt.html@1.55 +8 -4
+ orphanwait documentation changes
+
+ChangeSet@1.2187, 2010-07-27 23:54:49+02:00, linus@beam.lund.zozs.se
+ Removed DEBUG definitions so output from Google Test more clear.
+
+ sntp/header.h@1.5 +1 -1
+ Commented out DEBUG defintion to clean up test output.
+
+ sntp/kod_management.c@1.18 +1 -1
+ Commented out DEBUG definition to clear up test output.
+
+ tests/sntp/Makefile.am@1.4 +13 -8
+ Uses the built object files from sntp, instead of compiling the sntp sources again for the tests. This is a good thing to do, since sntp has it's own configure scripts.
+
+ChangeSet@1.2186, 2010-07-27 14:53:27-04:00, karlsson@psp-deb1.ntp.org
+ Fixed integer constants so they work on 32-bit systems, which have 32-bit time_t
+
+ tests/sntp/data/kod-test-blanks@1.2 +1 -1
+ Fixed integer constants so they work on 32-bit systems which have 32-bit time_t
+
+ tests/sntp/data/kod-test-correct@1.2 +1 -1
+ Fixed integer constants so they work on 32-bit systems which have 32-bit time_t
+
+ tests/sntp/kodFile.cpp@1.4 +2 -2
+ Fixed integer constants so they work on 32-bit systems which have 32-bit time_t
+
+ChangeSet@1.2185, 2010-07-27 20:38:53+02:00, linus@beam.lund.zozs.se
+ Added tests for writing of KoD database to file.
+
+ tests/sntp/data/kod-expected-multiple@1.1 +3 -0
+ Expected output of tests.
+
+ tests/sntp/data/kod-expected-multiple@1.0 +0 -0
+
+ tests/sntp/data/kod-expected-single@1.1 +1 -0
+ Expected output of tests
+
+ tests/sntp/data/kod-expected-single@1.0 +0 -0
+
+ tests/sntp/kodFile.cpp@1.3 +101 -4
+ Added tests for writing of KoD database.
+
+ChangeSet@1.2184, 2010-07-27 18:08:05+02:00, linus@beam.lund.zozs.se
+ Modified test code to accept multiple parameters.
+
+ tests/main.cpp@1.3 +8 -6
+ Modified code to accept multiple parameters.
+
+ tests/main.h@1.3 +3 -2
+ Modified code to accept multiple parameteres.
+
+ tests/sntp/Makefile.am@1.3 +1 -1
+ Pass the path to the build dir, in addition to the source dir.
+
+ tests/sntp/kodFile.cpp@1.2 +9 -5
+ Modified code to handle multiple parameters.
+
+ tests/sntp/test-driver@1.2 +1 -1
+ Two parameters can be sent to the test executable.
+
+ChangeSet@1.2183, 2010-07-27 14:42:53+02:00, linus@beam.lund.zozs.se
+ New tests for KoD-database file reading.
+
+ tests/main.cpp@1.2 +16 -2
+ Modified test base class to accept an extra parameter.
+
+ tests/main.h@1.2 +6 -1
+ Modified test base class to accept an extra parameter.
+
+ tests/sntp/Makefile.am@1.2 +8 -4
+ Provided another test runner, that passes the data directory as a parameter to the tests.
+
+ tests/sntp/data/kod-test-blanks@1.1 +6 -0
+ Input file for KoD-reading test.
+
+ tests/sntp/data/kod-test-blanks@1.0 +0 -0
+
+ tests/sntp/data/kod-test-correct@1.1 +2 -0
+ Input file for KoD-reading test.
+
+ tests/sntp/data/kod-test-correct@1.0 +0 -0
+
+ tests/sntp/data/kod-test-empty@1.1 +0 -0
+ Input file for KoD-reading test.
+
+ tests/sntp/data/kod-test-empty@1.0 +0 -0
+
+ tests/sntp/kodFile.cpp@1.1 +92 -0
+ Added tests for reading a KoD-database file.
+
+ tests/sntp/kodFile.cpp@1.0 +0 -0
+
+ tests/sntp/test-driver@1.1 +3 -0
+ A basic TESTS_ENVIRONMENT wrapper, that provides an extra parameter to the test executable
+
+ tests/sntp/test-driver@1.0 +0 -0
+
+ChangeSet@1.2182, 2010-07-26 23:27:05+02:00, linus@beam.lund.zozs.se
+ Boilerplate for sntp tests, and tests for KoD-database.
+
+ configure.ac@1.489 +1 -0
+ Added Makefile creation for sntp tests.
+
+ tests/Makefile.am@1.3 +1 -1
+ Added sntp subdir.
+
+ tests/sntp/Makefile.am@1.1 +28 -0
+ Added Makefile.am for sntp tests.
+
+ tests/sntp/Makefile.am@1.0 +0 -0
+
+ tests/sntp/kodDatabase.cpp@1.1 +118 -0
+ Tests for KoD-database.
+
+ tests/sntp/kodDatabase.cpp@1.0 +0 -0
+
+ tests/sntp/sntptest.cpp@1.1 +9 -0
+ Base class for sntp tests.
+
+ tests/sntp/sntptest.cpp@1.0 +0 -0
+
+ tests/sntp/sntptest.h@1.1 +4 -0
+ Base class for sntp tests.
+
+ tests/sntp/sntptest.h@1.0 +0 -0
+
+ChangeSet@1.2156.3.2, 2010-07-20 18:02:12+00:00, davehart@shiny.ad.hartbrothers.com
+ Avoid race with parallel builds using same source directory in
+ scripts/genver by using build directory for temporary files.
+
+ ChangeLog@1.607.1.2 +2 -0
+ Avoid race with parallel builds using same source directory in
+ scripts/genver by using build directory for temporary files.
+
+ Makefile.am@1.93.1.1 +3 -3
+ Avoid race with parallel builds using same source directory in
+ scripts/genver by using build directory for temporary files.
+
+ scripts/genver@1.6 +23 -15
+ Avoid race with parallel builds using same source directory in
+ scripts/genver by using build directory for temporary files.
+
+ChangeSet@1.2156.3.1, 2010-07-20 15:21:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+ Add closelog() before closing most or all descriptors after fork().
+
+ ChangeLog@1.607.1.1 +1 -0
+ [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+ Add closelog() before closing most or all descriptors after fork().
+
+ include/ntp_io.h@1.16 +1 -0
+ [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+
+ ntpd/ntp_io.c@1.320 +19 -0
+ [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+ Add closelog() before closing most or all descriptors after fork().
+ Close all descriptors (excepting waitsync_fd_to_close) not only those
+ after it. This was a merge failure.
+
+ ntpd/ntpd.c@1.114 +4 -3
+ [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+ Add closelog() before closing most or all descriptors after fork().
+ Close all descriptors (excepting waitsync_fd_to_close) not only those
+ after it. This was a merge failure.
+
+ ntpd/work_fork.c@1.5 +2 -1
+ [Bug 1586] ntpd 4.2.7p40 doesn't write to syslog after fork on QNX.
+ Add closelog() before closing most or all descriptors after fork().
+
+ChangeSet@1.2156.1.16, 2010-07-19 16:58:15+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1588] finish configure --disable-autokey implementation,
+ add --disable-autokey to flock-build -no-refclocks flavor.
+
+ ChangeLog@1.608 +1 -0
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ configure.ac@1.483.1.3 +1 -1
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ flock-build@1.47 +3 -2
+ add --disable-autokey to -no-refclocks flavor
+
+ include/ntp.h@1.180 +6 -8
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ include/ntp_control.h@1.47 +110 -109
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ include/ntp_crypto.h@1.49 +9 -8
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ include/ntp_md5.h@1.6 +17 -11
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ include/ntpd.h@1.140 +4 -4
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ libntp/a_md5encrypt.c@1.29 +1 -5
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ libntp/authreadkeys.c@1.17 +9 -8
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ libntp/ssl_init.c@1.10 +1 -0
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ libntp/statestr.c@1.21 +4 -4
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_config.c@1.263 +9 -9
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_control.c@1.140 +124 -131
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_crypto.c@1.148 +3 -3
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_peer.c@1.134 +4 -7
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_proto.c@1.301 +51 -51
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_request.c@1.95 +4 -4
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_timer.c@1.60 +13 -13
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpd/ntp_util.c@1.82 +25 -25
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpdc/ntpdc.c@1.86 +4 -0
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ntpq/ntpq.c@1.116 +4 -0
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ ports/winnt/include/ntp_timer.h@1.6 +4 -6
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ sntp/crypto.h@1.10 +1 -5
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ sntp/networking.h@1.19 +3 -3
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ util/ntp-keygen-opts.c@1.42 +46 -46
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ util/ntp-keygen-opts.def@1.12 +15 -15
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ util/ntp-keygen-opts.h@1.42 +8 -8
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ util/ntp-keygen.c@1.65 +19 -19
+ [Bug 1588] finish configure --disable-autokey implementation.
+
+ChangeSet@1.2156.1.15, 2010-07-12 10:09:56+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P40
+ TAG: NTP_4_2_7P40
+
+ ChangeLog@1.607 +1 -0
+ NTP_4_2_7P40
+
+ ntpd/ntpd-opts.c@1.43 +5 -5
+ NTP_4_2_7P40
+
+ ntpd/ntpd-opts.h@1.43 +4 -4
+ NTP_4_2_7P40
+
+ ntpd/ntpd-opts.texi@1.42 +2 -2
+ NTP_4_2_7P40
+
+ ntpd/ntpd.1@1.42 +2 -2
+ NTP_4_2_7P40
+
+ ntpdc/ntpdc-opts.c@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpdc/ntpdc-opts.h@1.41 +3 -3
+ NTP_4_2_7P40
+
+ ntpdc/ntpdc-opts.texi@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpdc/ntpdc.1@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpq/ntpq-opts.c@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpq/ntpq-opts.h@1.41 +3 -3
+ NTP_4_2_7P40
+
+ ntpq/ntpq-opts.texi@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpq/ntpq.1@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.41 +3 -3
+ NTP_4_2_7P40
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.41 +2 -2
+ NTP_4_2_7P40
+
+ ntpsnmpd/ntpsnmpd.1@1.41 +2 -2
+ NTP_4_2_7P40
+
+ packageinfo.sh@1.42 +1 -1
+ NTP_4_2_7P40
+
+ sntp/sntp-opts.c@1.41 +2 -2
+ NTP_4_2_7P40
+
+ sntp/sntp-opts.h@1.41 +3 -3
+ NTP_4_2_7P40
+
+ sntp/sntp-opts.texi@1.41 +1 -1
+ NTP_4_2_7P40
+
+ sntp/sntp.1@1.41 +2 -2
+ NTP_4_2_7P40
+
+ sntp/sntp.html@1.41 +1 -1
+ NTP_4_2_7P40
+
+ util/ntp-keygen-opts.c@1.41 +2 -2
+ NTP_4_2_7P40
+
+ util/ntp-keygen-opts.h@1.41 +3 -3
+ NTP_4_2_7P40
+
+ util/ntp-keygen-opts.texi@1.41 +2 -2
+ NTP_4_2_7P40
+
+ util/ntp-keygen.1@1.41 +2 -2
+ NTP_4_2_7P40
+
+ChangeSet@1.2082.4.108, 2010-07-10 18:11:54+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1581] missed one previously
+
+ ChangeLog@1.496.26.80 +4 -0
+ [Bug 1581] missed one previously
+
+ ntpd/ntp_intres.c@1.79.1.2 +1 -1
+ [Bug 1581] missed one previously
+
+ChangeSet@1.2156.1.14, 2010-07-09 23:35:54+00:00, davehart@shiny.ad.hartbrothers.com
+ updated output of ntpdbase-opts.def
+
+ ntpd/ntpd-opts.c@1.42 +2 -2
+ updated output of ntpdbase-opts.def
+
+ ntpd/ntpd-opts.h@1.42 +3 -3
+ updated output of ntpdbase-opts.def
+
+ ntpd/ntpd-opts.texi@1.41 +64 -5
+ updated output of ntpdbase-opts.def
+
+ ntpd/ntpd.1@1.41 +27 -5
+ updated output of ntpdbase-opts.def
+
+ChangeSet@1.2156.1.12, 2010-07-09 10:09:15+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P39
+ TAG: NTP_4_2_7P39
+
+ ChangeLog@1.605 +1 -0
+ NTP_4_2_7P39
+
+ ntpd/ntpd-opts.c@1.39.1.1 +2 -2
+ NTP_4_2_7P39
+
+ ntpd/ntpd-opts.h@1.39.1.1 +3 -3
+ NTP_4_2_7P39
+
+ ntpd/ntpd-opts.texi@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpd/ntpd.1@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpdc/ntpdc-opts.c@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpdc/ntpdc-opts.h@1.40 +3 -3
+ NTP_4_2_7P39
+
+ ntpdc/ntpdc-opts.texi@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpdc/ntpdc.1@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpq/ntpq-opts.c@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpq/ntpq-opts.h@1.40 +3 -3
+ NTP_4_2_7P39
+
+ ntpq/ntpq-opts.texi@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpq/ntpq.1@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.40 +3 -3
+ NTP_4_2_7P39
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.40 +2 -2
+ NTP_4_2_7P39
+
+ ntpsnmpd/ntpsnmpd.1@1.40 +2 -2
+ NTP_4_2_7P39
+
+ packageinfo.sh@1.41 +1 -1
+ NTP_4_2_7P39
+
+ sntp/sntp-opts.c@1.40 +2 -2
+ NTP_4_2_7P39
+
+ sntp/sntp-opts.h@1.40 +3 -3
+ NTP_4_2_7P39
+
+ sntp/sntp-opts.texi@1.40 +1 -1
+ NTP_4_2_7P39
+
+ sntp/sntp.1@1.40 +2 -2
+ NTP_4_2_7P39
+
+ sntp/sntp.html@1.40 +1 -1
+ NTP_4_2_7P39
+
+ util/ntp-keygen-opts.c@1.40 +2 -2
+ NTP_4_2_7P39
+
+ util/ntp-keygen-opts.h@1.40 +3 -3
+ NTP_4_2_7P39
+
+ util/ntp-keygen-opts.texi@1.40 +2 -2
+ NTP_4_2_7P39
+
+ util/ntp-keygen.1@1.40 +2 -2
+ NTP_4_2_7P39
+
+ChangeSet@1.2156.1.11, 2010-07-09 02:03:53-04:00, stenn@deacon.udel.edu
+ Fix typo in driver28.html
+
+ ChangeLog@1.604 +1 -0
+ Fix typo in driver28.html
+
+ html/drivers/driver28.html@1.13 +1 -1
+ Fix typo in driver28.html
+
+ChangeSet@1.2082.4.107, 2010-07-09 02:25:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2
+ TAG: NTP_4_2_6P2
+
+ ChangeLog@1.496.26.79 +1 -0
+ NTP_4_2_6P2
+
+ ntpd/ntpd-opts.c@1.248.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpd/ntpd-opts.h@1.248.15.1 +3 -3
+ NTP_4_2_6P2
+
+ ntpd/ntpd-opts.texi@1.246.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpd/ntpd.1@1.246.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpdc/ntpdc-opts.c@1.244.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpdc/ntpdc-opts.h@1.244.15.1 +3 -3
+ NTP_4_2_6P2
+
+ ntpdc/ntpdc-opts.texi@1.243.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpdc/ntpdc.1@1.243.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpq/ntpq-opts.c@1.245.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpq/ntpq-opts.h@1.245.15.1 +3 -3
+ NTP_4_2_6P2
+
+ ntpq/ntpq-opts.texi@1.244.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpq/ntpq.1@1.244.15.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.16.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.16.1 +3 -3
+ NTP_4_2_6P2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.16.1 +2 -2
+ NTP_4_2_6P2
+
+ ntpsnmpd/ntpsnmpd.1@1.122.16.1 +2 -2
+ NTP_4_2_6P2
+
+ packageinfo.sh@1.255.17.2 +2 -2
+ NTP_4_2_6P2
+
+ sntp/sntp-opts.c@1.117.15.1 +2 -2
+ NTP_4_2_6P2
+
+ sntp/sntp-opts.h@1.117.15.1 +3 -3
+ NTP_4_2_6P2
+
+ sntp/sntp-opts.texi@1.117.15.1 +1 -1
+ NTP_4_2_6P2
+
+ sntp/sntp.1@1.117.15.1 +2 -2
+ NTP_4_2_6P2
+
+ sntp/sntp.html@1.7.15.1 +1 -1
+ NTP_4_2_6P2
+
+ util/ntp-keygen-opts.c@1.247.15.1 +2 -2
+ NTP_4_2_6P2
+
+ util/ntp-keygen-opts.h@1.247.15.1 +3 -3
+ NTP_4_2_6P2
+
+ util/ntp-keygen-opts.texi@1.246.15.1 +2 -2
+ NTP_4_2_6P2
+
+ util/ntp-keygen.1@1.246.15.1 +2 -2
+ NTP_4_2_6P2
+
+ChangeSet@1.2156.1.9, 2010-07-09 01:59:14+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct the attribution of the next -stable tarball to 4.2.6p2
+
+ ChangeLog@1.602 +3 -3
+ Correct the attribution of the next -stable tarball to 4.2.6p2
+
+ChangeSet@1.2082.4.106, 2010-07-08 21:55:47-04:00, stenn@deacon.udel.edu
+ release 4.2.6p2
+
+ NEWS@1.107 +39 -0
+ NEWS file for 4.2.6p2
+
+ packageinfo.sh@1.255.17.1 +1 -1
+ release 4.2.6p2
+
+ChangeSet@1.2082.4.105, 2010-07-08 21:49:08-04:00, stenn@deacon.udel.edu
+ Use the new mirror server names for the trigger mirror update script
+
+ BitKeeper/triggers/2mirrors@1.6 +2 -2
+ Use the new mirror server names for the trigger mirror update script
+
+ChangeSet@1.2156.2.3, 2010-07-06 04:18:16+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove orphan mode startup workaround from ntp_proto.c, it's
+ not needed with the addition of sys_orphwait.
+ Add "tos orphanwait" to set sys_orphwait.
+
+ ntpd/complete.conf@1.8 +1 -1
+ add "tos orphanwait 300"
+
+ ntpd/keyword-gen-utd@1.7 +1 -1
+ sentinel that ntp_keyword.h is current with keyword-gen.c
+
+ ntpd/keyword-gen.c@1.12 +1 -0
+ add T_Orphanwait "orphanwait" for tos orphanwait
+
+ ntpd/ntp_config.c@1.260.1.3 +5 -0
+ tos orphanwait
+
+ ntpd/ntp_keyword.h@1.9 +498 -493
+ generated by keyword-gen.c
+
+ ntpd/ntp_parser.c@1.58 +907 -898
+ generated from ntp_parser.y
+
+ ntpd/ntp_parser.h@1.37 +131 -129
+ generated from ntp_parser.y
+
+ ntpd/ntp_parser.y@1.53 +3 -0
+ tos orphanwait
+
+ ntpd/ntp_proto.c@1.300 +1 -6
+ remove orphan mode at startup workaround, no longer needed for
+ [Bug 1395] --wait-sync with DLM's sys_orphwait change.
+
+ ntpd/ntpd.c@1.113 +0 -7
+ leftover merge cleanup, remove locals leftover from code
+ moved from ntpdmain() to close_all_beyond().
+
+ChangeSet@1.2156.2.2, 2010-07-05 14:58:16+00:00, davehart@shiny.ad.hartbrothers.com
+ merge cleanup
+
+ ntpd/ntp_config.c@1.260.1.2 +2 -2
+ correct merge for removal of default_ai_family from ntpd.
+
+ ntpd/ntpd-opts.c@1.40 +97 -20
+ Autogen output
+
+ ntpd/ntpd-opts.h@1.40 +18 -11
+ Autogen output
+
+ChangeSet@1.2180, 2010-07-04 21:56:55+02:00, linus@beam.lund.zozs.se
+ Fixed a bug that showed up when shuffling the tests, because the key cache was not emptied in test SetUp()
+
+ tests/libntp/authkeys.cpp@1.5 +12 -26
+ Fixed a bug that showed up when shuffling the tests, because the key cache was not emptied in test SetUp().
+
+ChangeSet@1.2082.4.104, 2010-07-02 07:43:21+01:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1581] size_t printf format string mismatches, IRIG string buffers
+ undersized. Mostly backported from earlier ntp-dev fixes by Jürgen
+ Perlinger, The exceptions are ntp_intres.c and refclock_irig.c.
+
+ ChangeLog@1.496.26.78 +6 -0
+ [Bug 1581] size_t printf format string mismatches, IRIG string buffers
+ undersized. Mostly backported from earlier ntp-dev fixes by Jürgen
+ Perlinger, The exceptions are ntp_intres.c and refclock_irig.c.
+
+ libntp/ssl_init.c@1.4.1.2 +5 -4
+ [Bug 1581] size_t printf format string mismatches (backported from ntp-dev).
+
+ ntpd/ntp_config.c@1.241.1.4 +4 -4
+ [Bug 1581] size_t printf format string mismatches (backported from ntp-dev).
+
+ ntpd/ntp_intres.c@1.79.1.1 +6 -4
+ [Bug 1581] size_t printf format string mismatches.
+
+ ntpd/ntp_request.c@1.82.1.2 +8 -7
+ [Bug 1581] size_t printf format string mismatches (backported from ntp-dev).
+
+ ntpd/ntp_scanner.c@1.31.1.1 +2 -2
+ [Bug 1581] size_t printf format string mismatches (backported from ntp-dev).
+
+ ntpd/refclock_acts.c@1.36.1.1 +3 -3
+ [Bug 1581] size_t printf format string mismatches (backported from ntp-dev).
+
+ ntpd/refclock_irig.c@1.33 +3 -3
+ [Bug 1581] sscanf() target buffers lack room for terminating null.
+
+ ntpdc/ntpdc.c@1.75.1.2 +7 -7
+ [Bug 1581] size_t printf format string mismatches (backported from ntp-dev).
+
+ ntpq/ntpq.c@1.97.1.5 +6 -6
+ [Bug 1581] size_t printf format string mismatches (backported from ntp-dev).
+
+ChangeSet@1.2179, 2010-06-29 12:20:10+02:00, linus@beam.lund.zozs.se
+ Fixed compilation warnings.
+
+ tests/libntp/prettydate.cpp@1.3 +1 -1
+ Fixed compilation warnings.
+
+ tests/libntp/uglydate.cpp@1.2 +1 -1
+ Fixed compilation warnings.
+
+ChangeSet@1.2178, 2010-06-29 10:18:55+00:00, karlsson@psp-fb1.ntp.org
+ Fixed compilation errors and warnings under FreeBSD
+
+ tests/libntp/ssl_init.cpp@1.2 +4 -4
+ Fixed compilation errors and warnings on FreeBSD
+
+ tests/libntp/strtolfp.cpp@1.8 +12 -3
+ Fixed compilation errors and warnings on FreeBSD
+
+ChangeSet@1.2177, 2010-06-29 00:17:05+02:00, linus@beam.lund.zozs.se
+ Added more tests.
+
+ tests/libntp/caljulian.cpp@1.4 +11 -0
+ Added tests for leap year.
+
+ tests/libntp/clocktime.cpp@1.2 +72 -2
+ Added more tests.
+
+ tests/libntp/prettydate.cpp@1.2 +0 -4
+ Removed empty test stub.
+
+ChangeSet@1.2176, 2010-06-28 00:18:01+02:00, linus@beam.lund.zozs.se
+ Added tests for buftvtots and recvbuff.
+ Also cleaned up code using the lfptest superclass.
+
+ tests/libntp/Makefile.am@1.20 +2 -0
+ Added tests for buftvtots and recvbuff
+
+ tests/libntp/buftvtots.cpp@1.1 +49 -0
+ New tests
+
+ tests/libntp/buftvtots.cpp@1.0 +0 -0
+
+ tests/libntp/hextolfp.cpp@1.5 +0 -3
+ Moved constants to lfptest superclass.
+
+ tests/libntp/lfptest.h@1.3 +6 -0
+ Moved constants to lfptest superclass.
+
+ tests/libntp/recvbuff.cpp@1.1 +38 -0
+ New tests
+
+ tests/libntp/recvbuff.cpp@1.0 +0 -0
+
+ tests/libntp/strtolfp.cpp@1.7 +0 -4
+ Moved constants to lfptest superclass.
+
+ tests/libntp/tvtots.cpp@1.3 +0 -4
+ Moved constants to lfptest superclass.
+
+ChangeSet@1.2175, 2010-06-24 23:26:58+02:00, linus@beam.lund.zozs.se
+ Added tests for calyearstart and clocktime.
+
+ tests/libntp/Makefile.am@1.19 +2 -0
+ Added tests for calyearstart, and some tests for clocktime
+
+ tests/libntp/calyearstart.cpp@1.1 +34 -0
+ Added tests
+
+ tests/libntp/calyearstart.cpp@1.0 +0 -0
+
+ tests/libntp/clocktime.cpp@1.1 +65 -0
+ Added some tests
+
+ tests/libntp/clocktime.cpp@1.0 +0 -0
+
+ tests/libntp/tvtots.cpp@1.2 +1 -1
+ Disabled one test until I figure out whether it is failing or if I'm just stupid.
+
+ChangeSet@1.2174, 2010-06-24 15:36:26+02:00, linus@beam.lund.zozs.se
+ Added tests for caltontp.c
+
+ tests/libntp/Makefile.am@1.18 +1 -0
+ Added tests for caltontp()
+
+ tests/libntp/caltontp.cpp@1.1 +49 -0
+ Added tests
+
+ tests/libntp/caltontp.cpp@1.0 +0 -0
+
+ChangeSet@1.2173, 2010-06-23 14:21:42+02:00, linus@beam.lund.zozs.se
+ Added tests for statestr, tstotv and tvtots.
+
+ tests/libntp/Makefile.am@1.17 +3 -0
+ Added tests for statestr, tstotv and tvtots.
+
+ tests/libntp/lfptest.h@1.2 +3 -1
+ Added extra debugging code in comparision code.
+
+ tests/libntp/statestr.cpp@1.1 +27 -0
+ Added tests
+
+ tests/libntp/statestr.cpp@1.0 +0 -0
+
+ tests/libntp/tstotv.cpp@1.1 +57 -0
+ Added tests
+
+ tests/libntp/tstotv.cpp@1.0 +0 -0
+
+ tests/libntp/tvtots.cpp@1.1 +47 -0
+ Added tests
+
+ tests/libntp/tvtots.cpp@1.0 +0 -0
+
+ChangeSet@1.2172, 2010-06-21 22:49:41+02:00, linus@beam.lund.zozs.se
+ Added tests for modetoa() and tsftomsu(), and added more tests for authkeys.
+
+ tests/libntp/Makefile.am@1.16 +2 -0
+ Added tests for modetoa() and tsftomsu()
+
+ tests/libntp/authkeys.cpp@1.4 +30 -17
+ Added some more tests for authusekey.cpp, and removed commented code.
+
+ tests/libntp/modetoa.cpp@1.1 +16 -0
+ Added new tests
+
+ tests/libntp/modetoa.cpp@1.0 +0 -0
+
+ tests/libntp/tsftomsu.cpp@1.1 +29 -0
+ Added new tests
+
+ tests/libntp/tsftomsu.cpp@1.0 +0 -0
+
+ChangeSet@1.2156.1.7, 2010-06-20 10:10:46+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P38
+ TAG: NTP_4_2_7P38
+
+ ChangeLog@1.600 +1 -0
+ NTP_4_2_7P38
+
+ ntpd/ntpd-opts.c@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpd/ntpd-opts.h@1.39 +3 -3
+ NTP_4_2_7P38
+
+ ntpd/ntpd-opts.texi@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpd/ntpd.1@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpdc/ntpdc-opts.c@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpdc/ntpdc-opts.h@1.39 +3 -3
+ NTP_4_2_7P38
+
+ ntpdc/ntpdc-opts.texi@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpdc/ntpdc.1@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpq/ntpq-opts.c@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpq/ntpq-opts.h@1.39 +3 -3
+ NTP_4_2_7P38
+
+ ntpq/ntpq-opts.texi@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpq/ntpq.1@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.39 +3 -3
+ NTP_4_2_7P38
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.39 +2 -2
+ NTP_4_2_7P38
+
+ ntpsnmpd/ntpsnmpd.1@1.39 +2 -2
+ NTP_4_2_7P38
+
+ packageinfo.sh@1.40 +1 -1
+ NTP_4_2_7P38
+
+ sntp/sntp-opts.c@1.39 +2 -2
+ NTP_4_2_7P38
+
+ sntp/sntp-opts.h@1.39 +3 -3
+ NTP_4_2_7P38
+
+ sntp/sntp-opts.texi@1.39 +1 -1
+ NTP_4_2_7P38
+
+ sntp/sntp.1@1.39 +2 -2
+ NTP_4_2_7P38
+
+ sntp/sntp.html@1.39 +1 -1
+ NTP_4_2_7P38
+
+ util/ntp-keygen-opts.c@1.39 +2 -2
+ NTP_4_2_7P38
+
+ util/ntp-keygen-opts.h@1.39 +3 -3
+ NTP_4_2_7P38
+
+ util/ntp-keygen-opts.texi@1.39 +2 -2
+ NTP_4_2_7P38
+
+ util/ntp-keygen.1@1.39 +2 -2
+ NTP_4_2_7P38
+
+ChangeSet@1.2156.1.6, 2010-06-19 18:28:21-04:00, stenn@deacon.udel.edu
+ typo fix in comment
+
+ ChangeLog@1.599 +1 -0
+ typo fix in comment
+
+ ntpd/ntp_proto.c@1.297.1.15 +1 -1
+ typo fix in comment
+
+ChangeSet@1.2156.1.4, 2010-06-19 10:09:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P37
+ TAG: NTP_4_2_7P37
+
+ ChangeLog@1.597 +1 -0
+ NTP_4_2_7P37
+
+ ntpd/ntpd-opts.c@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpd/ntpd-opts.h@1.38 +3 -3
+ NTP_4_2_7P37
+
+ ntpd/ntpd-opts.texi@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpd/ntpd.1@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpdc/ntpdc-opts.c@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpdc/ntpdc-opts.h@1.38 +3 -3
+ NTP_4_2_7P37
+
+ ntpdc/ntpdc-opts.texi@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpdc/ntpdc.1@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpq/ntpq-opts.c@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpq/ntpq-opts.h@1.38 +3 -3
+ NTP_4_2_7P37
+
+ ntpq/ntpq-opts.texi@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpq/ntpq.1@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.38 +3 -3
+ NTP_4_2_7P37
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.38 +2 -2
+ NTP_4_2_7P37
+
+ ntpsnmpd/ntpsnmpd.1@1.38 +2 -2
+ NTP_4_2_7P37
+
+ packageinfo.sh@1.39 +1 -1
+ NTP_4_2_7P37
+
+ sntp/sntp-opts.c@1.38 +2 -2
+ NTP_4_2_7P37
+
+ sntp/sntp-opts.h@1.38 +3 -3
+ NTP_4_2_7P37
+
+ sntp/sntp-opts.texi@1.38 +1 -1
+ NTP_4_2_7P37
+
+ sntp/sntp.1@1.38 +2 -2
+ NTP_4_2_7P37
+
+ sntp/sntp.html@1.38 +1 -1
+ NTP_4_2_7P37
+
+ util/ntp-keygen-opts.c@1.38 +2 -2
+ NTP_4_2_7P37
+
+ util/ntp-keygen-opts.h@1.38 +3 -3
+ NTP_4_2_7P37
+
+ util/ntp-keygen-opts.texi@1.38 +2 -2
+ NTP_4_2_7P37
+
+ util/ntp-keygen.1@1.38 +2 -2
+ NTP_4_2_7P37
+
+ChangeSet@1.2170, 2010-06-19 10:58:13+02:00, linus@beam.lund.zozs.se
+ Missed a change in the last commit.
+
+ tests/libntp/lfptostr.cpp@1.2 +8 -1
+ Forgot to check this file in...
+
+ChangeSet@1.2169, 2010-06-19 10:57:33+02:00, linus@beam.lund.zozs.se
+ Added tests for more prettydate, refnumtoa, uflydate, uinttoa and ymd2yd.
+
+ tests/libntp/Makefile.am@1.15 +6 -1
+ Added tests for prettydate, refnumtoa, uglydate, uinttoa and ymd2yd.
+
+ tests/libntp/prettydate.cpp@1.1 +20 -0
+ Added tests
+
+ tests/libntp/prettydate.cpp@1.0 +0 -0
+
+ tests/libntp/refnumtoa.cpp@1.1 +48 -0
+ Added tests
+
+ tests/libntp/refnumtoa.cpp@1.0 +0 -0
+
+ tests/libntp/uglydate.cpp@1.1 +18 -0
+ Added tests
+
+ tests/libntp/uglydate.cpp@1.0 +0 -0
+
+ tests/libntp/ymd2yd.cpp@1.1 +23 -0
+ Added tests
+
+ tests/libntp/ymd2yd.cpp@1.0 +0 -0
+
+ChangeSet@1.2082.4.103, 2010-06-19 02:49:04-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2_RC7
+ TAG: NTP_4_2_6P2_RC7
+
+ ChangeLog@1.496.26.77 +1 -0
+ NTP_4_2_6P2_RC7
+
+ ntpd/ntpd-opts.c@1.248.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpd/ntpd-opts.h@1.248.14.1 +3 -3
+ NTP_4_2_6P2_RC7
+
+ ntpd/ntpd-opts.texi@1.246.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpd/ntpd.1@1.246.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpdc/ntpdc-opts.c@1.244.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpdc/ntpdc-opts.h@1.244.14.1 +3 -3
+ NTP_4_2_6P2_RC7
+
+ ntpdc/ntpdc-opts.texi@1.243.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpdc/ntpdc.1@1.243.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpq/ntpq-opts.c@1.245.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpq/ntpq-opts.h@1.245.14.1 +3 -3
+ NTP_4_2_6P2_RC7
+
+ ntpq/ntpq-opts.texi@1.244.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpq/ntpq.1@1.244.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.15.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.15.1 +3 -3
+ NTP_4_2_6P2_RC7
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.15.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ ntpsnmpd/ntpsnmpd.1@1.122.15.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ packageinfo.sh@1.255.16.1 +1 -1
+ NTP_4_2_6P2_RC7
+
+ sntp/sntp-opts.c@1.117.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ sntp/sntp-opts.h@1.117.14.1 +3 -3
+ NTP_4_2_6P2_RC7
+
+ sntp/sntp-opts.texi@1.117.14.1 +1 -1
+ NTP_4_2_6P2_RC7
+
+ sntp/sntp.1@1.117.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ sntp/sntp.html@1.7.14.1 +1 -1
+ NTP_4_2_6P2_RC7
+
+ util/ntp-keygen-opts.c@1.247.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ util/ntp-keygen-opts.h@1.247.14.1 +3 -3
+ NTP_4_2_6P2_RC7
+
+ util/ntp-keygen-opts.texi@1.246.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ util/ntp-keygen.1@1.246.14.1 +2 -2
+ NTP_4_2_6P2_RC7
+
+ChangeSet@1.2082.4.102, 2010-06-19 02:32:32-04:00, stenn@deacon.udel.edu
+ [Bug 1570] serial clock drivers get outdated input from kernel tty line buffer after startup
+
+ ChangeLog@1.496.26.76 +2 -0
+ [Bug 1570] serial clock drivers get outdated input from kernel tty line buffer after startup
+
+ ntpd/ntp_refclock.c@1.92.1.1 +21 -0
+ [Bug 1570] serial clock drivers get outdated input from kernel tty line buffer after startup
+
+ChangeSet@1.2082.4.101, 2010-06-19 01:59:33-04:00, stenn@deacon.udel.edu
+ merge cleanup
+
+ ChangeLog@1.496.26.75 +2 -3
+ merge cleanup
+
+ChangeSet@1.2082.21.1, 2010-06-19 01:57:32-04:00, stenn@deacon.udel.edu
+ [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD
+
+ ChangeLog@1.496.46.1 +4 -0
+ [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD
+
+ configure.ac@1.465.1.12 +7 -2
+ [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD
+
+ChangeSet@1.2156.1.3, 2010-06-18 21:59:28-07:00, stenn@stenn.ntp.org
+ [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD
+
+ ChangeLog@1.596 +1 -0
+ [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD
+
+ configure.ac@1.483.1.1 +7 -2
+ [Bug 1576] sys/sysctl.h depends on sys/param.h on OpenBSD
+
+ChangeSet@1.2167, 2010-06-17 08:33:16-04:00, karlsson@psp-deb1.ntp.org
+ Fixed C90 warnings on psp-deb1, complaining about negative integer constants.
+
+ tests/libntp/hextolfp.cpp@1.4 +1 -1
+ Fixed warnings with C90 integer constants
+
+ tests/libntp/inttoa.cpp@1.4 +1 -1
+ Fixed warnings with C90 integer constants
+
+ tests/libntp/strtolfp.cpp@1.6 +1 -1
+ Fixed warnings with C90 integer constants
+
+ChangeSet@1.2166, 2010-06-17 13:44:17+02:00, linus@beam.lund.zozs.se
+ Cleanups, fixed some warnings issued when compiling on psp-deb1.
+
+ tests/libntp/caljulian.cpp@1.3 +2 -2
+ Fixed warnings about constant only being unsigned in ISO C90.
+
+ tests/libntp/hextoint.cpp@1.3 +1 -1
+ Fixed warnings about constant only being unsigned in ISO C90.
+
+ tests/libntp/hextolfp.cpp@1.3 +5 -2
+ Gave some magic constants a name.
+
+ tests/libntp/inttoa.cpp@1.3 +1 -1
+ Fixed warnings about constant only being unsigned in ISO C90.
+
+ tests/libntp/numtoa.cpp@1.2 +3 -2
+ Fixed integer overflow.
+
+ tests/libntp/octtoint.cpp@1.2 +1 -1
+ Fixed warnings about constant only being unsigned in ISO C90.
+
+ChangeSet@1.2165, 2010-06-17 13:20:09+02:00, linus@beam.lund.zozs.se
+ Added tests for functions in ssl_init.c and uinttoa.c
+
+ tests/libntp/Makefile.am@1.14 +3 -1
+ Added more tests.
+
+ tests/libntp/ssl_init.cpp@1.1 +41 -0
+ Added tests for keytype_from_text() and keytype_name()
+
+ tests/libntp/ssl_init.cpp@1.0 +0 -0
+
+ tests/libntp/uinttoa.cpp@1.1 +12 -0
+ Added tests
+
+ tests/libntp/uinttoa.cpp@1.0 +0 -0
+
+ChangeSet@1.2164, 2010-06-15 14:10:00-04:00, karlsson@psp-deb1.ntp.org
+ Fixed formatting issue in humandate() test
+
+ tests/libntp/humandate.cpp@1.2 +4 -3
+ Fixed formatting issue
+
+ChangeSet@1.2161.1.1, 2010-06-15 19:36:59+02:00, linus@beam.lund.zozs.se
+ Added tests for a number of functions. Tests for inttoa() won't pass until bug 1575 if pulled into repo.
+
+ tests/libntp/Makefile.am@1.13 +8 -2
+ Added new tests to build.
+
+ tests/libntp/decodenetnum.cpp@1.2 +2 -37
+ Moved comparision code to a super class for all sockaddr_u-related tests.
+
+ tests/libntp/humandate.cpp@1.1 +40 -0
+ Added tests for humandate()
+
+ tests/libntp/humandate.cpp@1.0 +0 -0
+
+ tests/libntp/inttoa.cpp@1.2 +3 -1
+ Make sure it is a long.
+
+ tests/libntp/netof.cpp@1.1 +69 -0
+ Added tests for netof()
+
+ tests/libntp/netof.cpp@1.0 +0 -0
+
+ tests/libntp/numtoa.cpp@1.1 +17 -0
+ New tests
+
+ tests/libntp/numtoa.cpp@1.0 +0 -0
+
+ tests/libntp/numtohost.cpp@1.1 +15 -0
+ New tests
+
+ tests/libntp/numtohost.cpp@1.0 +0 -0
+
+ tests/libntp/octtoint.cpp@1.1 +57 -0
+ New tests
+
+ tests/libntp/octtoint.cpp@1.0 +0 -0
+
+ tests/libntp/sockaddrtest.h@1.1 +58 -0
+ Extracted common comparision code to super class.
+
+ tests/libntp/sockaddrtest.h@1.0 +0 -0
+
+ tests/libntp/socktoa.cpp@1.1 +73 -0
+ New tests
+
+ tests/libntp/socktoa.cpp@1.0 +0 -0
+
+ tests/libntp/strtolfp.cpp@1.5 +68 -13
+ Renamed from atolfpTest to strtolfpTest, and add test cases for both atolfp and mstolfp.
+
+ tests/libntp/strtolfp.cpp@1.4 +0 -0
+ Rename: tests/libntp/atolfp.cpp -> tests/libntp/strtolfp.cpp
+
+ChangeSet@1.2082.4.99, 2010-06-15 08:25:18-04:00, perlinger@psp-deb1.ntp.org
+ [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c
+
+ ChangeLog@1.496.26.73 +3 -0
+ [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c
+
+ libntp/inttoa.c@1.4 +1 -1
+ [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c
+
+ libntp/tvtoa.c@1.4 +1 -1
+ [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c
+
+ libntp/utvtoa.c@1.4 +1 -1
+ [Bug 1575] use snprintf with LIB_BUFLENGTH in inttoa.c, tvtoa.c, utvtoa.c
+
+ChangeSet@1.2156.1.2, 2010-06-15 10:09:41+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P36
+ TAG: NTP_4_2_7P36
+
+ ChangeLog@1.595 +1 -0
+ NTP_4_2_7P36
+
+ ntpd/ntpd-opts.c@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpd/ntpd-opts.h@1.37 +3 -3
+ NTP_4_2_7P36
+
+ ntpd/ntpd-opts.texi@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpd/ntpd.1@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpdc/ntpdc-opts.c@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpdc/ntpdc-opts.h@1.37 +3 -3
+ NTP_4_2_7P36
+
+ ntpdc/ntpdc-opts.texi@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpdc/ntpdc.1@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpq/ntpq-opts.c@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpq/ntpq-opts.h@1.37 +3 -3
+ NTP_4_2_7P36
+
+ ntpq/ntpq-opts.texi@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpq/ntpq.1@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.37 +3 -3
+ NTP_4_2_7P36
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.37 +2 -2
+ NTP_4_2_7P36
+
+ ntpsnmpd/ntpsnmpd.1@1.37 +2 -2
+ NTP_4_2_7P36
+
+ packageinfo.sh@1.38 +1 -1
+ NTP_4_2_7P36
+
+ sntp/sntp-opts.c@1.37 +2 -2
+ NTP_4_2_7P36
+
+ sntp/sntp-opts.h@1.37 +3 -3
+ NTP_4_2_7P36
+
+ sntp/sntp-opts.texi@1.37 +1 -1
+ NTP_4_2_7P36
+
+ sntp/sntp.1@1.37 +2 -2
+ NTP_4_2_7P36
+
+ sntp/sntp.html@1.37 +1 -1
+ NTP_4_2_7P36
+
+ util/ntp-keygen-opts.c@1.37 +2 -2
+ NTP_4_2_7P36
+
+ util/ntp-keygen-opts.h@1.37 +3 -3
+ NTP_4_2_7P36
+
+ util/ntp-keygen-opts.texi@1.37 +2 -2
+ NTP_4_2_7P36
+
+ util/ntp-keygen.1@1.37 +2 -2
+ NTP_4_2_7P36
+
+ChangeSet@1.2161, 2010-06-15 12:05:16+02:00, linus@beam.lund.zozs.se
+ Added inttoa tests.
+
+ tests/libntp/Makefile.am@1.12 +1 -0
+ Added inttoa
+
+ tests/libntp/inttoa.cpp@1.1 +24 -0
+ Tests for inttoa.
+
+ tests/libntp/inttoa.cpp@1.0 +0 -0
+
+ChangeSet@1.2156.1.1, 2010-06-15 00:24:37-04:00, stenn@deacon.udel.edu
+ orphanwait changes (Bug 1560) and clockfilter/reachability fixes from Dave Mills
+
+ ChangeLog@1.594 +2 -0
+ orphanwait changes (Bug 1560) and clockfilter/reachability fixes from Dave Mills
+
+ include/ntp.h@1.179 +2 -0
+ orphanwait changes from Dave Mills
+
+ include/ntpd.h@1.137.1.16 +1 -0
+ orphanwait changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.297.1.14 +14 -6
+ orphanwait changes and clockfilter/reachability fixes from Dave Mills
+
+ ntpd/ntp_timer.c@1.59 +3 -1
+ orphanwait changes from Dave Mills
+
+ChangeSet@1.2160, 2010-06-14 20:20:24+02:00, linus@beam.lund.zozs.se
+ Added tests for l_fp string conversions.
+
+ tests/libntp/Makefile.am@1.11 +1 -0
+ Added tests for string conversions of l_fp.
+
+ tests/libntp/lfptostr.cpp@1.1 +96 -0
+ Added tests for mfptoa, mfptoms and dolfptoa.
+
+ tests/libntp/lfptostr.cpp@1.0 +0 -0
+
+ChangeSet@1.2159, 2010-06-14 03:26:21-07:00, karlsson@psp-os1.ntp.org
+ Corrected configure checks for google test
+
+ configure.ac@1.486 +11 -8
+ Added conditional used in automake to decide to build tests or not
+
+ tests/Makefile.am@1.2 +6 -1
+ Only recurse into libntp if we have google test installed
+
+ChangeSet@1.2158, 2010-06-14 11:11:54+02:00, linus@beam.lund.zozs.se
+ Uses configure script to check for gtest-config.
+
+ configure.ac@1.485 +11 -0
+ Uses gtest-config
+
+ tests/libntp/Makefile.am@1.10 +5 -2
+ Uses variables from configure script
+
+ tests/main.cpp@1.1 +6 -0
+ Main function.
+
+ tests/main.cpp@1.0 +0 -0
+
+ChangeSet@1.2152.2.3, 2010-06-13 16:04:31+02:00, linus@beam.lund.zozs.se
+ Fixed a serious bug when testing a_md5encrypt(), and added more tests for hextolfp
+
+ tests/libntp/a_md5encrypt.cpp@1.3 +10 -5
+ Fixed a number of embarrasing bugs (most serious taking memcmp() != 0 as a success when comparing two memory blocks...)
+
+ tests/libntp/hextolfp.cpp@1.2 +33 -0
+ Added more tests for hextolfp.
+
+ChangeSet@1.2156, 2010-06-12 04:25:31-04:00, stenn@deacon.udel.edu
+ NTP_4_2_7P35
+ TAG: NTP_4_2_7P35
+
+ ChangeLog@1.593 +1 -0
+ NTP_4_2_7P35
+
+ ntpd/ntpd-opts.c@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpd/ntpd-opts.h@1.36 +3 -3
+ NTP_4_2_7P35
+
+ ntpd/ntpd-opts.texi@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpd/ntpd.1@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpdc/ntpdc-opts.c@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpdc/ntpdc-opts.h@1.36 +3 -3
+ NTP_4_2_7P35
+
+ ntpdc/ntpdc-opts.texi@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpdc/ntpdc.1@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpq/ntpq-opts.c@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpq/ntpq-opts.h@1.36 +3 -3
+ NTP_4_2_7P35
+
+ ntpq/ntpq-opts.texi@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpq/ntpq.1@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.36 +3 -3
+ NTP_4_2_7P35
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.36 +2 -2
+ NTP_4_2_7P35
+
+ ntpsnmpd/ntpsnmpd.1@1.36 +2 -2
+ NTP_4_2_7P35
+
+ packageinfo.sh@1.37 +1 -1
+ NTP_4_2_7P35
+
+ sntp/sntp-opts.c@1.36 +2 -2
+ NTP_4_2_7P35
+
+ sntp/sntp-opts.h@1.36 +3 -3
+ NTP_4_2_7P35
+
+ sntp/sntp-opts.texi@1.36 +1 -1
+ NTP_4_2_7P35
+
+ sntp/sntp.1@1.36 +2 -2
+ NTP_4_2_7P35
+
+ sntp/sntp.html@1.36 +1 -1
+ NTP_4_2_7P35
+
+ util/ntp-keygen-opts.c@1.36 +2 -2
+ NTP_4_2_7P35
+
+ util/ntp-keygen-opts.h@1.36 +3 -3
+ NTP_4_2_7P35
+
+ util/ntp-keygen-opts.texi@1.36 +2 -2
+ NTP_4_2_7P35
+
+ util/ntp-keygen.1@1.36 +2 -2
+ NTP_4_2_7P35
+
+ChangeSet@1.2155, 2010-06-12 04:04:03-04:00, stenn@deacon.udel.edu
+ merge cleanup
+
+ ChangeLog@1.592 +0 -4
+ merge cleanup
+
+ChangeSet@1.2082.4.98, 2010-06-12 02:21:49-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2_RC6
+ TAG: NTP_4_2_6P2_RC6
+
+ ChangeLog@1.496.26.72 +1 -0
+ NTP_4_2_6P2_RC6
+
+ ntpd/ntpd-opts.c@1.248.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpd/ntpd-opts.h@1.248.13.1 +3 -3
+ NTP_4_2_6P2_RC6
+
+ ntpd/ntpd-opts.texi@1.246.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpd/ntpd.1@1.246.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpdc/ntpdc-opts.c@1.244.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpdc/ntpdc-opts.h@1.244.13.1 +3 -3
+ NTP_4_2_6P2_RC6
+
+ ntpdc/ntpdc-opts.texi@1.243.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpdc/ntpdc.1@1.243.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpq/ntpq-opts.c@1.245.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpq/ntpq-opts.h@1.245.13.1 +3 -3
+ NTP_4_2_6P2_RC6
+
+ ntpq/ntpq-opts.texi@1.244.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpq/ntpq.1@1.244.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.14.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.14.1 +3 -3
+ NTP_4_2_6P2_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.14.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ ntpsnmpd/ntpsnmpd.1@1.122.14.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ packageinfo.sh@1.255.15.1 +1 -1
+ NTP_4_2_6P2_RC6
+
+ sntp/sntp-opts.c@1.117.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ sntp/sntp-opts.h@1.117.13.1 +3 -3
+ NTP_4_2_6P2_RC6
+
+ sntp/sntp-opts.texi@1.117.13.1 +1 -1
+ NTP_4_2_6P2_RC6
+
+ sntp/sntp.1@1.117.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ sntp/sntp.html@1.7.13.1 +1 -1
+ NTP_4_2_6P2_RC6
+
+ util/ntp-keygen-opts.c@1.247.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ util/ntp-keygen-opts.h@1.247.13.1 +3 -3
+ NTP_4_2_6P2_RC6
+
+ util/ntp-keygen-opts.texi@1.246.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ util/ntp-keygen.1@1.246.13.1 +2 -2
+ NTP_4_2_6P2_RC6
+
+ChangeSet@1.2152.2.2, 2010-06-10 18:23:22+02:00, linus@beam.(none)
+ Tests for atolfp, hextoint, decodenetnum, hextolfp, fptoa and fptoms.
+
+ tests/libntp/Makefile.am@1.9 +4 -1
+ Added test source files to Makefile.am
+
+ tests/libntp/atolfp.cpp@1.3 +2 -16
+ Moved equality check to common base class.
+
+ tests/libntp/decodenetnum.cpp@1.1 +128 -0
+ Added tests for decodenetnum()
+
+ tests/libntp/decodenetnum.cpp@1.0 +0 -0
+
+ tests/libntp/hextoint.cpp@1.2 +33 -20
+ Added tests
+
+ tests/libntp/hextolfp.cpp@1.1 +25 -0
+ Tests for hextolfp()
+
+ tests/libntp/hextolfp.cpp@1.0 +0 -0
+
+ tests/libntp/lfptest.h@1.1 +23 -0
+ Extracted common code for tests that tests l_fp for equality.
+
+ tests/libntp/lfptest.h@1.0 +0 -0
+
+ tests/libntp/sfptostr.cpp@1.1 +71 -0
+ Tests for fptoa, fptoms and dofptoa.
+
+ tests/libntp/sfptostr.cpp@1.0 +0 -0
+
+ChangeSet@1.2147.1.6, 2010-06-09 22:56:19+02:00, linus@beam.(none)
+ Changes in caljulian tests.
+
+ tests/libntp/caljulian.cpp@1.2 +47 -14
+ Added comparition function for calendar structs.
+
+ChangeSet@1.2147.1.5, 2010-06-09 14:15:12+02:00, linus@beam.(none)
+ Added tests for atouint and atolfp.
+
+ tests/libntp/Makefile.am@1.8 +2 -0
+ Added atouint and caljulian to test suite.
+
+ tests/libntp/a_md5encrypt.cpp@1.2 +13 -12
+ Modified name of constants and changed comparision to memcmp instead of strcmp.
+
+ tests/libntp/atoint.cpp@1.2 +2 -6
+ Changed some assertions to ASSERT instead of EXPECT (no use to check the value if the conversion was aborted)
+
+ tests/libntp/atolfp.cpp@1.2 +48 -1
+ Added tests for atolfp
+
+ tests/libntp/atouint.cpp@1.1 +40 -0
+ Tests for atouint.
+
+ tests/libntp/atouint.cpp@1.0 +0 -0
+
+ tests/libntp/caljulian.cpp@1.1 +35 -0
+ Template for caljulian.
+
+ tests/libntp/caljulian.cpp@1.0 +0 -0
+
+ tests/libntp/libntptest.h@1.2 +4 -0
+ ntp_stdlib.h is required by all tests, put it here instead of in each separate test.
+
+ChangeSet@1.2147.1.4, 2010-06-08 17:07:07+02:00, linus@beam.(none)
+ Added tests for atoint and atolfp
+
+ tests/libntp/Makefile.am@1.7 +2 -0
+ Added atoint and atolfp files to SOURCES.
+
+ tests/libntp/atoint.cpp@1.1 +52 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/atoint.cpp
+
+ tests/libntp/atoint.cpp@1.0 +0 -0
+
+ tests/libntp/atolfp.cpp@1.1 +14 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/atolfp.cpp
+
+ tests/libntp/atolfp.cpp@1.0 +0 -0
+
+ChangeSet@1.2082.4.97, 2010-06-08 13:15:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags.
+
+ ChangeLog@1.496.26.71 +4 -0
+ [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags.
+
+ lib/isc/unix/interfaceiter.c@1.18 +32 -3
+ [Bug 715] libisc Linux IPv6 interface iteration drops multicast flags.
+ patch from joerg@dorchain.net adapted from original by
+ peter.pramberger@1012surf.net
+
+ChangeSet@1.2147.1.3, 2010-06-08 12:53:18+02:00, linus@beam.(none)
+ Added tests for a_md5encrypt.
+
+ tests/libntp/Makefile.am@1.6 +3 -2
+ Added tests for a_md5encrypt.
+
+ tests/libntp/a_md5encrypt.cpp@1.1 +78 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/a_md5encrypt.cpp
+
+ tests/libntp/a_md5encrypt.cpp@1.0 +0 -0
+
+ tests/libntp/authkeys.cpp@1.3 +31 -4
+ Modified some of the tests for authkeys
+
+ChangeSet@1.2147.1.2, 2010-06-08 09:44:46+02:00, linus@beam.(none)
+ Added tests for authkeys.
+
+ tests/libntp/Makefile.am@1.5 +4 -2
+ Fixed linking errors because a crypto library was needed
+
+ tests/libntp/authkeys.cpp@1.2 +48 -4
+ Added tests for both auth_havekey and authhavekey.
+
+ tests/libntp/authkeys.cpp@1.1 +29 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/authkeys.cpp
+
+ tests/libntp/authkeys.cpp@1.0 +0 -0
+
+ tests/libntp/libntptest.cpp@1.1 +9 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/libntptest.cpp
+
+ tests/libntp/libntptest.cpp@1.0 +0 -0
+
+ChangeSet@1.2153, 2010-06-08 02:24:01+02:00, jnperlin@hydra.localnet
+ Rewrite of multiprecision macros in 'ntp_fp.h' from J. Perlinger
+
+ ChangeLog@1.590 +2 -0
+ Rewrite of multiprecision macros in 'ntp_fp.h' from J. Perlinger
+
+ include/ntp_fp.h@1.20 +97 -132
+ Rewrite of M_xxx macros: cleanup in unsigned & overflow handling
+
+ChangeSet@1.2152, 2010-06-05 06:47:24+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P34
+ TAG: NTP_4_2_7P34
+
+ ChangeLog@1.589 +1 -0
+ NTP_4_2_7P34
+
+ ntpd/ntpd-opts.c@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpd/ntpd-opts.h@1.35 +3 -3
+ NTP_4_2_7P34
+
+ ntpd/ntpd-opts.texi@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpd/ntpd.1@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpdc/ntpdc-opts.c@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpdc/ntpdc-opts.h@1.35 +3 -3
+ NTP_4_2_7P34
+
+ ntpdc/ntpdc-opts.texi@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpdc/ntpdc.1@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpq/ntpq-opts.c@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpq/ntpq-opts.h@1.35 +3 -3
+ NTP_4_2_7P34
+
+ ntpq/ntpq-opts.texi@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpq/ntpq.1@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.35 +3 -3
+ NTP_4_2_7P34
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.35 +2 -2
+ NTP_4_2_7P34
+
+ ntpsnmpd/ntpsnmpd.1@1.35 +2 -2
+ NTP_4_2_7P34
+
+ packageinfo.sh@1.36 +1 -1
+ NTP_4_2_7P34
+
+ sntp/sntp-opts.c@1.35 +2 -2
+ NTP_4_2_7P34
+
+ sntp/sntp-opts.h@1.35 +3 -3
+ NTP_4_2_7P34
+
+ sntp/sntp-opts.texi@1.35 +1 -1
+ NTP_4_2_7P34
+
+ sntp/sntp.1@1.35 +2 -2
+ NTP_4_2_7P34
+
+ sntp/sntp.html@1.35 +1 -1
+ NTP_4_2_7P34
+
+ util/ntp-keygen-opts.c@1.35 +2 -2
+ NTP_4_2_7P34
+
+ util/ntp-keygen-opts.h@1.35 +3 -3
+ NTP_4_2_7P34
+
+ util/ntp-keygen-opts.texi@1.35 +2 -2
+ NTP_4_2_7P34
+
+ util/ntp-keygen.1@1.35 +2 -2
+ NTP_4_2_7P34
+
+ChangeSet@1.2150, 2010-06-04 23:12:55-07:00, stenn@stenn.ntp.org
+ fix typo
+
+ ntpd/ntp_refclock.c@1.96 +1 -1
+ fix typo
+
+ChangeSet@1.2149, 2010-06-04 19:21:26+02:00, jnperlin@hydra.localnet
+ [Bug 1570] serial line drivers get outdated data from kernel tty line buffer after startup
+
+ BitKeeper/etc/ignore@1.76 +5 -0
+ Added m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 to the ignore list
+
+ ChangeLog@1.587 +2 -2
+ [Bug 1570] serial line drivers get outdated data from kernel tty line buffer after startup
+
+ ntpd/ntp_refclock.c@1.95 +8 -9
+ [Bug 1570] flush I/O buffers and read all old data when opening a serial line
+
+ChangeSet@1.2146.1.2, 2010-06-04 03:26:47-04:00, perlinger@psp-deb1.ntp.org
+ bug 1580 fix
+
+ ChangeLog@1.584.1.1 +2 -0
+ added bug 1580
+
+ChangeSet@1.2146.1.1, 2010-06-04 08:34:03+02:00, jnperlin@hydra.localnet
+ [Bug 1580] Purge tty line buffers so serial refclocks do not get outdated data immediately after startup.
+
+ ntpd/ntp_refclock.c@1.94 +22 -0
+ [Bug 1580] Try to flush all buffers and/or read away old input data when opening a serial line for a refclock.
+
+ChangeSet@1.2147, 2010-06-04 02:10:49-04:00, stenn@deacon.udel.edu
+ NTP_4_2_7P33
+ TAG: NTP_4_2_7P33
+
+ ChangeLog@1.585 +1 -0
+ NTP_4_2_7P33
+
+ ntpd/ntpd-opts.c@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpd/ntpd-opts.h@1.34 +3 -3
+ NTP_4_2_7P33
+
+ ntpd/ntpd-opts.texi@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpd/ntpd.1@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpdc/ntpdc-opts.c@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpdc/ntpdc-opts.h@1.34 +3 -3
+ NTP_4_2_7P33
+
+ ntpdc/ntpdc-opts.texi@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpdc/ntpdc.1@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpq/ntpq-opts.c@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpq/ntpq-opts.h@1.34 +3 -3
+ NTP_4_2_7P33
+
+ ntpq/ntpq-opts.texi@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpq/ntpq.1@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.34 +2 -2
+ NTP_4_2_7P33
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.34 +3 -3
+ NTP_4_2_7P33
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.34 +24 -2
+ NTP_4_2_7P33
+
+ ntpsnmpd/ntpsnmpd.1@1.34 +2 -2
+ NTP_4_2_7P33
+
+ packageinfo.sh@1.35 +1 -1
+ NTP_4_2_7P33
+
+ sntp/sntp-opts.c@1.34 +2 -2
+ NTP_4_2_7P33
+
+ sntp/sntp-opts.h@1.34 +3 -3
+ NTP_4_2_7P33
+
+ sntp/sntp-opts.texi@1.34 +1 -1
+ NTP_4_2_7P33
+
+ sntp/sntp.1@1.34 +2 -2
+ NTP_4_2_7P33
+
+ sntp/sntp.html@1.34 +1 -1
+ NTP_4_2_7P33
+
+ util/ntp-keygen-opts.c@1.34 +2 -2
+ NTP_4_2_7P33
+
+ util/ntp-keygen-opts.h@1.34 +3 -3
+ NTP_4_2_7P33
+
+ util/ntp-keygen-opts.texi@1.34 +2 -2
+ NTP_4_2_7P33
+
+ util/ntp-keygen.1@1.34 +2 -2
+ NTP_4_2_7P33
+
+ChangeSet@1.2082.4.96, 2010-06-03 02:24:13-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2_RC5
+ TAG: NTP_4_2_6P2_RC5
+
+ ChangeLog@1.496.26.70 +1 -0
+ NTP_4_2_6P2_RC5
+
+ ntpd/ntpd-opts.c@1.248.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpd/ntpd-opts.h@1.248.12.1 +3 -3
+ NTP_4_2_6P2_RC5
+
+ ntpd/ntpd-opts.texi@1.246.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpd/ntpd.1@1.246.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpdc/ntpdc-opts.c@1.244.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpdc/ntpdc-opts.h@1.244.12.1 +3 -3
+ NTP_4_2_6P2_RC5
+
+ ntpdc/ntpdc-opts.texi@1.243.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpdc/ntpdc.1@1.243.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpq/ntpq-opts.c@1.245.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpq/ntpq-opts.h@1.245.12.1 +3 -3
+ NTP_4_2_6P2_RC5
+
+ ntpq/ntpq-opts.texi@1.244.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpq/ntpq.1@1.244.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.13.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.13.1 +3 -3
+ NTP_4_2_6P2_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.13.1 +24 -2
+ NTP_4_2_6P2_RC5
+
+ ntpsnmpd/ntpsnmpd.1@1.122.13.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ packageinfo.sh@1.255.14.1 +1 -1
+ NTP_4_2_6P2_RC5
+
+ sntp/sntp-opts.c@1.117.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ sntp/sntp-opts.h@1.117.12.1 +3 -3
+ NTP_4_2_6P2_RC5
+
+ sntp/sntp-opts.texi@1.117.12.1 +1 -1
+ NTP_4_2_6P2_RC5
+
+ sntp/sntp.1@1.117.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ sntp/sntp.html@1.7.12.1 +1 -1
+ NTP_4_2_6P2_RC5
+
+ util/ntp-keygen-opts.c@1.247.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ util/ntp-keygen-opts.h@1.247.12.1 +3 -3
+ NTP_4_2_6P2_RC5
+
+ util/ntp-keygen-opts.texi@1.246.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ util/ntp-keygen.1@1.246.12.1 +2 -2
+ NTP_4_2_6P2_RC5
+
+ChangeSet@1.2144.1.5, 2010-06-01 22:25:33+02:00, linus@beam.(none)
+ Modified Makefile for conditional testing
+
+ tests/libntp/Makefile.am@1.4 +3 -1
+ Modified conditionals
+
+ChangeSet@1.2144.1.4, 2010-06-01 20:21:04+02:00, linus@beam.(none)
+ Changed so that tests are not run during a cross compilation
+
+ tests/libntp/Makefile.am@1.3 +2 -0
+ Tests are not run when cross-compiling
+
+ChangeSet@1.2082.4.95, 2010-05-31 18:59:05+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf().
+
+
+ ChangeLog@1.496.26.69 +1 -0
+ [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf().
+
+
+ sntp/configure.ac@1.31.1.2 +1 -1
+ [Bug 1565] sntp/crypto.c compile fails on MacOS over vsnprintf().
+
+
+ChangeSet@1.2144.1.3, 2010-05-28 15:31:29+02:00, linus@beam.(none)
+ Tuned makefile.am
+
+ tests/libntp/Makefile.am@1.2 +5 -1
+ Copied include directories from Makefile.am in libntp/
+
+ChangeSet@1.2144.1.2, 2010-05-28 14:13:18+02:00, linus@beam.(none)
+ Added base test classes and makefiles to repo
+
+ tests/Makefile.am@1.1 +1 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/Makefile.am
+
+ tests/Makefile.am@1.0 +0 -0
+
+ tests/libntp/Makefile.am@1.1 +6 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/Makefile.am
+
+ tests/libntp/Makefile.am@1.0 +0 -0
+
+ tests/libntp/hextoint.cpp@1.1 +29 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/hextoint.cpp
+
+ tests/libntp/hextoint.cpp@1.0 +0 -0
+
+ tests/libntp/libntptest.h@1.1 +5 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/libntp/libntptest.h
+
+ tests/libntp/libntptest.h@1.0 +0 -0
+
+ tests/main.h@1.1 +7 -0
+ BitKeeper file /home/linus/programming/gsoc/ntp/ntp-gsoc-testing/tests/main.h
+
+ tests/main.h@1.0 +0 -0
+
+ChangeSet@1.2144.1.1, 2010-05-28 07:59:21-04:00, karlsson@psp-deb1.ntp.org
+ Modified autotools to recurse into tests
+
+ Makefile.am@1.94 +4 -0
+ Added tests subdir
+
+ configure.ac@1.484 +4 -0
+ Added configure changes to create makefiles
+
+ChangeSet@1.2082.4.94, 2010-05-24 15:46:36+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
+ Windows port: do not exit in ntp_timestamp_from_counter() without
+ first logging the reason.
+ Support "passwd blah" syntax in ntpq.
+
+ ChangeLog@1.496.26.68 +7 -0
+ [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
+ Windows port: do not exit in ntp_timestamp_from_counter() without
+ first logging the reason.
+ Support "passwd blah" syntax in ntpq.
+
+ include/ntp_stdlib.h@1.40.1.2 +1 -0
+ [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
+
+ libntp/ssl_init.c@1.4.1.1 +25 -0
+ [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
+
+ ntpdc/ntpdc.c@1.75.1.1 +2 -14
+ [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
+
+ ntpq/ntpq.c@1.97.1.4 +16 -21
+ [Bug 1561] ntpq, ntpdc "passwd" prompts for MD5 password w/SHA1.
+ Support "passwd blah" syntax in ntpq.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.38.1.2 +6 -3
+ Windows port: do not exit in ntp_timestamp_from_counter() without
+ first logging the reason.
+
+ChangeSet@1.2144, 2010-05-19 10:09:40+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P32
+ TAG: NTP_4_2_7P32
+
+ ChangeLog@1.582 +1 -0
+ NTP_4_2_7P32
+
+ ntpd/ntpd-opts.c@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpd/ntpd-opts.h@1.33 +3 -3
+ NTP_4_2_7P32
+
+ ntpd/ntpd-opts.texi@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpd/ntpd.1@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpdc/ntpdc-opts.c@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpdc/ntpdc-opts.h@1.33 +3 -3
+ NTP_4_2_7P32
+
+ ntpdc/ntpdc-opts.texi@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpdc/ntpdc.1@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpq/ntpq-opts.c@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpq/ntpq-opts.h@1.33 +3 -3
+ NTP_4_2_7P32
+
+ ntpq/ntpq-opts.texi@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpq/ntpq.1@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.33 +2 -2
+ NTP_4_2_7P32
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.33 +3 -3
+ NTP_4_2_7P32
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.33 +1 -1
+ NTP_4_2_7P32
+
+ ntpsnmpd/ntpsnmpd.1@1.33 +2 -2
+ NTP_4_2_7P32
+
+ packageinfo.sh@1.34 +1 -1
+ NTP_4_2_7P32
+
+ sntp/sntp-opts.c@1.33 +2 -2
+ NTP_4_2_7P32
+
+ sntp/sntp-opts.h@1.33 +3 -3
+ NTP_4_2_7P32
+
+ sntp/sntp-opts.texi@1.33 +1 -1
+ NTP_4_2_7P32
+
+ sntp/sntp.1@1.33 +2 -2
+ NTP_4_2_7P32
+
+ sntp/sntp.html@1.33 +1 -1
+ NTP_4_2_7P32
+
+ util/ntp-keygen-opts.c@1.33 +2 -2
+ NTP_4_2_7P32
+
+ util/ntp-keygen-opts.h@1.33 +3 -3
+ NTP_4_2_7P32
+
+ util/ntp-keygen-opts.texi@1.33 +2 -2
+ NTP_4_2_7P32
+
+ util/ntp-keygen.1@1.33 +2 -2
+ NTP_4_2_7P32
+
+ChangeSet@1.2143, 2010-05-19 00:55:54-04:00, stenn@deacon.udel.edu
+ Copyright file cleanup from Dave Mills
+
+ ChangeLog@1.581 +1 -0
+ Copyright file cleanup from Dave Mills
+
+ html/copyright.html@1.50 +4 -4
+ Copyright file cleanup from Dave Mills
+
+ChangeSet@1.2082.4.93, 2010-05-19 00:02:06-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2_RC4
+ TAG: NTP_4_2_6P2_RC4
+
+ ChangeLog@1.496.26.67 +1 -0
+ NTP_4_2_6P2_RC4
+
+ ntpd/ntpd-opts.c@1.248.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpd/ntpd-opts.h@1.248.11.1 +3 -3
+ NTP_4_2_6P2_RC4
+
+ ntpd/ntpd-opts.texi@1.246.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpd/ntpd.1@1.246.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpdc/ntpdc-opts.c@1.244.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpdc/ntpdc-opts.h@1.244.11.1 +3 -3
+ NTP_4_2_6P2_RC4
+
+ ntpdc/ntpdc-opts.texi@1.243.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpdc/ntpdc.1@1.243.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpq/ntpq-opts.c@1.245.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpq/ntpq-opts.h@1.245.11.1 +3 -3
+ NTP_4_2_6P2_RC4
+
+ ntpq/ntpq-opts.texi@1.244.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpq/ntpq.1@1.244.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.12.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.12.1 +3 -3
+ NTP_4_2_6P2_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.12.1 +1 -1
+ NTP_4_2_6P2_RC4
+
+ ntpsnmpd/ntpsnmpd.1@1.122.12.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ packageinfo.sh@1.255.13.1 +1 -1
+ NTP_4_2_6P2_RC4
+
+ sntp/sntp-opts.c@1.117.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ sntp/sntp-opts.h@1.117.11.1 +3 -3
+ NTP_4_2_6P2_RC4
+
+ sntp/sntp-opts.texi@1.117.11.1 +1 -1
+ NTP_4_2_6P2_RC4
+
+ sntp/sntp.1@1.117.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ sntp/sntp.html@1.7.11.1 +1 -1
+ NTP_4_2_6P2_RC4
+
+ util/ntp-keygen-opts.c@1.247.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ util/ntp-keygen-opts.h@1.247.11.1 +3 -3
+ NTP_4_2_6P2_RC4
+
+ util/ntp-keygen-opts.texi@1.246.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ util/ntp-keygen.1@1.246.11.1 +2 -2
+ NTP_4_2_6P2_RC4
+
+ChangeSet@1.2141, 2010-05-18 01:36:23+00:00, davehart@shiny.ad.hartbrothers.com
+ Windows port: Add msyslog() on path to exit(), relax PPS timestamp
+ within one minute of now check to be used only if debug tracing is
+ enabled.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.44 +6 -3
+ Windows port: Add msyslog() on path to exit(), relax PPS timestamp
+ within one minute of now check to be used only if debug tracing is
+ enabled.
+
+ChangeSet@1.2140, 2010-05-18 00:36:59+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1558] pool prototype associations have 0.0.0.0 for remote addr.
+
+ ChangeLog@1.579 +1 -0
+ [Bug 1558] pool prototype associations have 0.0.0.0 for remote addr.
+
+ ntpq/ntpq-subs.c@1.68 +3 -1
+ [Bug 1558] pool prototype associations have 0.0.0.0 for remote addr.
+
+ChangeSet@1.2139, 2010-05-17 21:32:08+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac: add --disable-autokey, #define AUTOKEY to enable future
+ support for building without Autokey, but with OpenSSL for its digest
+ algorithms (hash functions). Code must be modified to use #ifdef
+ AUTOKEY instead of #ifdef OPENSSL where appropriate to complete this.
+ include/ntp_crypto.h: make assumption AUTOKEY implies OPENSSL explicit.
+
+ ChangeLog@1.578 +5 -0
+ configure.ac: add --disable-autokey, #define AUTOKEY to enable future
+ support for building without Autokey, but with OpenSSL for its digest
+ algorithms (hash functions). Code must be modified to use #ifdef
+ AUTOKEY instead of #ifdef OPENSSL where appropriate to complete this.
+ include/ntp_crypto.h: make assumption AUTOKEY implies OPENSSL explicit.
+
+ configure.ac@1.483 +27 -9
+ Add --disable-autokey, #define AUTOKEY to enable future
+ support for building without Autokey, but with OpenSSL for its digest
+ algorithms (hash functions). Code must be modified to use #ifdef
+ AUTOKEY instead of #ifdef OPENSSL where appropriate to complete this.
+ Remove long-dead RSAREF-related configure.ac commented code.
+
+ include/ntp_crypto.h@1.48 +5 -0
+ Ensure code can assume OPENSSL is defined if AUTOKEY is.
+
+ChangeSet@1.2082.4.92, 2010-05-13 15:39:47+00:00, davehart@shiny.ad.hartbrothers.com
+ * [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations).
+
+
+ ChangeLog@1.496.26.66 +4 -0
+ * [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations).
+
+
+ sntp/networking.c@1.29.1.6 +5 -3
+ * [Bug 1555] 4.2.6p2-RC3 sntp illegal C (mixed code and declarations).
+
+
+ChangeSet@1.2137, 2010-05-11 10:10:19+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P31
+ TAG: NTP_4_2_7P31
+
+ ChangeLog@1.576 +1 -0
+ NTP_4_2_7P31
+
+ ntpd/ntpd-opts.c@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpd/ntpd-opts.h@1.32 +3 -3
+ NTP_4_2_7P31
+
+ ntpd/ntpd-opts.texi@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpd/ntpd.1@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpdc/ntpdc-opts.c@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpdc/ntpdc-opts.h@1.32 +3 -3
+ NTP_4_2_7P31
+
+ ntpdc/ntpdc-opts.texi@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpdc/ntpdc.1@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpq/ntpq-opts.c@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpq/ntpq-opts.h@1.32 +3 -3
+ NTP_4_2_7P31
+
+ ntpq/ntpq-opts.texi@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpq/ntpq.1@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.32 +2 -2
+ NTP_4_2_7P31
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.32 +3 -3
+ NTP_4_2_7P31
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.32 +1 -1
+ NTP_4_2_7P31
+
+ ntpsnmpd/ntpsnmpd.1@1.32 +2 -2
+ NTP_4_2_7P31
+
+ packageinfo.sh@1.33 +1 -1
+ NTP_4_2_7P31
+
+ sntp/sntp-opts.c@1.32 +2 -2
+ NTP_4_2_7P31
+
+ sntp/sntp-opts.h@1.32 +3 -3
+ NTP_4_2_7P31
+
+ sntp/sntp-opts.texi@1.32 +2 -60
+ NTP_4_2_7P31
+
+ sntp/sntp.1@1.32 +2 -2
+ NTP_4_2_7P31
+
+ sntp/sntp.html@1.32 +1 -1
+ NTP_4_2_7P31
+
+ util/ntp-keygen-opts.c@1.32 +2 -2
+ NTP_4_2_7P31
+
+ util/ntp-keygen-opts.h@1.32 +3 -3
+ NTP_4_2_7P31
+
+ util/ntp-keygen-opts.texi@1.32 +2 -2
+ NTP_4_2_7P31
+
+ util/ntp-keygen.1@1.32 +2 -2
+ NTP_4_2_7P31
+
+ChangeSet@1.2082.4.91, 2010-05-11 03:56:04-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2_RC3
+ TAG: NTP_4_2_6P2_RC3
+
+ ChangeLog@1.496.26.65 +1 -0
+ NTP_4_2_6P2_RC3
+
+ ntpd/ntpd-opts.c@1.248.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpd/ntpd-opts.h@1.248.10.1 +3 -3
+ NTP_4_2_6P2_RC3
+
+ ntpd/ntpd-opts.texi@1.246.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpd/ntpd.1@1.246.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpdc/ntpdc-opts.c@1.244.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpdc/ntpdc-opts.h@1.244.10.1 +3 -3
+ NTP_4_2_6P2_RC3
+
+ ntpdc/ntpdc-opts.texi@1.243.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpdc/ntpdc.1@1.243.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpq/ntpq-opts.c@1.245.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpq/ntpq-opts.h@1.245.10.1 +3 -3
+ NTP_4_2_6P2_RC3
+
+ ntpq/ntpq-opts.texi@1.244.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpq/ntpq.1@1.244.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.11.1 +5 -5
+ NTP_4_2_6P2_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.11.1 +4 -4
+ NTP_4_2_6P2_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.11.1 +2 -24
+ NTP_4_2_6P2_RC3
+
+ ntpsnmpd/ntpsnmpd.1@1.122.11.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ packageinfo.sh@1.255.12.1 +1 -1
+ NTP_4_2_6P2_RC3
+
+ sntp/sntp-opts.c@1.117.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ sntp/sntp-opts.h@1.117.10.1 +3 -3
+ NTP_4_2_6P2_RC3
+
+ sntp/sntp-opts.texi@1.117.10.1 +2 -60
+ NTP_4_2_6P2_RC3
+
+ sntp/sntp.1@1.117.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ sntp/sntp.html@1.7.10.1 +1 -1
+ NTP_4_2_6P2_RC3
+
+ util/ntp-keygen-opts.c@1.247.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ util/ntp-keygen-opts.h@1.247.10.1 +3 -3
+ NTP_4_2_6P2_RC3
+
+ util/ntp-keygen-opts.texi@1.246.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ util/ntp-keygen.1@1.246.10.1 +2 -2
+ NTP_4_2_6P2_RC3
+
+ChangeSet@1.2082.20.1, 2010-05-11 02:31:19-04:00, stenn@deacon.udel.edu
+ Windows compiling hints/winnt.html update from G. Sunil Tej
+
+ ChangeLog@1.496.45.1 +1 -0
+ Windows compiling hints/winnt.html update from G. Sunil Tej
+
+ html/hints/winnt.html@1.19.1.1 +13 -11
+ Windows compiling hints/winnt.html update from G. Sunil Tej
+
+ChangeSet@1.2082.4.89, 2010-05-11 04:44:37+00:00, davehart@shiny.ad.hartbrothers.com
+ Add Nelson B Bolyard to html/copyright.html.
+ Update ChangeLog entries to reflect filing of [Bug 1552], [Bug 1553].
+
+ ChangeLog@1.496.26.63 +2 -29
+ Update ChangeLog entries to reflect filing of [Bug 1552], [Bug 1553].
+
+ html/copyright.html@1.46.1.1 +4 -3
+ Add Nelson B Bolyard to html/copyright.html.
+
+ChangeSet@1.2082.4.88, 2010-05-10 13:16:18+00:00, davehart@shiny.ad.hartbrothers.com
+ Simplify hash client code by providing OpenSSL EVP_*() API when built
+ without OpenSSL. (from ntp-dev)
+ Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp.
+
+ ChangeLog@1.496.26.62 +3 -0
+ Simplify hash client code by providing OpenSSL EVP_*() API when built
+ without OpenSSL. (from ntp-dev)
+ Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp.
+
+ include/ntp_md5.h@1.3.1.1 +21 -5
+ expose OpenSSL hash API even when building without OpenSSL,
+ to simplify client code. Backport from ntp-dev.
+
+ libntp/a_md5encrypt.c@1.26.1.1 +3 -38
+ expose OpenSSL hash API even when building without OpenSSL,
+ to simplify client code. Backport from ntp-dev.
+
+ sntp/crypto.c@1.10.1.2 +34 -64
+ remove s_keytype_from_text(), use similar keytype_from_text() from libntp.
+
+ sntp/crypto.h@1.9 +4 -7
+ bring in line with other ntp_md5.h client code
+
+ sntp/networking.c@1.29.1.5 +15 -16
+ Simplify hash client code by providing OpenSSL EVP_*() API when built
+ without OpenSSL. (from ntp-dev)
+ Do not depend on ASCII values for ('A' - '0'), ('a' - '0') in sntp.
+
+ChangeSet@1.2082.4.87, 2010-05-09 10:38:44+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct ChangeLog spelling of Nelson Bolyard's name, add email address.
+
+ ChangeLog@1.496.26.61 +1 -1
+ Correct ChangeLog spelling of Nelson Bolyard's name, add email address.
+
+ChangeSet@1.2082.4.86, 2010-05-09 08:12:20+00:00, davehart@shiny.ad.hartbrothers.com
+ cleanup prior changeset, ease -dev merge.
+
+ ntpq/ntpq-subs.c@1.39.2.3 +7 -7
+ remove leftover of earlier approach, match AF_UNSPEC use to ntp-dev.
+ align with ntp-dev regarding empty refid= value from ntpd.
+
+ ntpq/ntpq.c@1.97.1.3 +1 -1
+ use const qualifier for makeascii char *.
+
+ ntpq/ntpq.h@1.10.1.2 +1 -1
+ use const qualifier for makeascii char *.
+
+ChangeSet@1.2082.4.85, 2010-05-09 06:33:09+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1325] unreachable code in sntp recv_bcst_data().
+ [Bug 1459] sntp MD5 authentication does not work with ntpd.
+ Many sntp fixes from Nelson Boyard:
+ 1. sntp properly handles hex key strings in the keyfile, instead of
+ just treating the text as binary strings.
+ 2. sntp handles SHA1 as well as MD5.
+ 3. If the key file contains more than one key, sntp can use keys
+ other than the first one in the file.
+ 4. sntp computes the MAC using the key, then the data (was other way).
+ 5. sntp handles responses with extensions now.
+ 6. sntp implements the -b (broadcast/multicast) option. Tested.
+ The -b option takes an argument which is the broadcast/multicast
+ address on which to listen for packets. The command still requires a
+ host address at the end of the command line. This is the address
+ expected to do the broadcasting/multicasting.
+ 7. sntp correctly handles network-order key IDs on little-endian.
+ 8. Eliminated a huge amount of code duplication between the sntp
+ unicast and multicast code paths, creating a single process_pkt()
+ function that is used for both paths after the packet is received.
+ 9. The -t timeout option now works with both unicast and multicast.
+ Previously it worked with neither. It wasn't coded for unicast, and
+ was incorrectly coded for multicast.
+ 10. In unicast mode, the requests are sent MACed using the key
+ specified with the -a command line option.
+ 11. Cleaned up indentation consistent with the predominant style in
+ the files changed, namely, using tab stop characters and not spaces
+ for indentation. This way, you can set your tab stop spacing as you
+ like it and the indentation looks correct. This was not a big change.
+ The files were mostly consistent before.
+ 12. Eliminated LOTS of blank lines.
+ sntp/configure.ac OpenSSL support now that sntp optionally uses it.
+ Escape unprintable characters in a refid in ntpq -p billboard.
+
+ ChangeLog@1.496.26.60 +32 -0
+ [Bug 1325] unreachable code in sntp recv_bcst_data().
+ [Bug 1459] sntp MD5 authentication does not work with ntpd.
+ Many sntp fixes from Nelson Boyard:
+ 1. sntp properly handles hex key strings in the keyfile, instead of
+ just treating the text as binary strings.
+ 2. sntp handles SHA1 as well as MD5.
+ 3. If the key file contains more than one key, sntp can use keys
+ other than the first one in the file.
+ 4. sntp computes the MAC using the key, then the data (was other way).
+ 5. sntp handles responses with extensions now.
+ 6. sntp implements the -b (broadcast/multicast) option. Tested.
+ The -b option takes an argument which is the broadcast/multicast
+ address on which to listen for packets. The command still requires a
+ host address at the end of the command line. This is the address
+ expected to do the broadcasting/multicasting.
+ 7. sntp correctly handles network-order key IDs on little-endian.
+ 8. Eliminated a huge amount of code duplication between the sntp
+ unicast and multicast code paths, creating a single process_pkt()
+ function that is used for both paths after the packet is received.
+ 9. The -t timeout option now works with both unicast and multicast.
+ Previously it worked with neither. It wasn't coded for unicast, and
+ was incorrectly coded for multicast.
+ 10. In unicast mode, the requests are sent MACed using the key
+ specified with the -a command line option.
+ 11. Cleaned up indentation consistent with the predominant style in
+ the files changed, namely, using tab stop characters and not spaces
+ for indentation. This way, you can set your tab stop spacing as you
+ like it and the indentation looks correct. This was not a big change.
+ The files were mostly consistent before.
+ 12. Eliminated LOTS of blank lines.
+ sntp/configure.ac OpenSSL support now that sntp optionally uses it.
+ Escape unprintable characters in a refid in ntpq -p billboard.
+
+ configure.ac@1.465.1.11 +1 -175
+ sntp/configure.ac OpenSSL support now that sntp optionally uses it.
+
+ m4/ntp_openssl.m4@1.1 +182 -0
+ moved from configure.ac to include to share with sntp/configure.ac
+
+ m4/ntp_openssl.m4@1.0 +0 -0
+
+ ntpq/ntpq-subs.c@1.39.2.2 +9 -3
+ Escape unprintable characters in a refid in ntpq -p billboard.
+
+ ntpq/ntpq.c@1.97.1.2 +1 -2
+ Escape unprintable characters in a refid in ntpq -p billboard.
+
+ ntpq/ntpq.h@1.10.1.1 +1 -0
+ Escape unprintable characters in a refid in ntpq -p billboard.
+
+ sntp/Makefile.am@1.21.1.8 +1 -1
+ add conditional -lcrypto to LDADD to link against OpenSSL.
+
+ sntp/configure.ac@1.31.1.1 +3 -0
+ sntp/configure.ac OpenSSL support now that sntp optionally uses it.
+
+ sntp/crypto.c@1.10.1.1 +134 -69
+ [Bug 1459] sntp MD5 authentication does not work with ntpd.
+ Many sntp fixes from Nelson Boyard:
+ 1. sntp properly handles hex key strings in the keyfile, instead of
+ just treating the text as binary strings.
+ 2. sntp handles SHA1 as well as MD5.
+ 3. If the key file contains more than one key, sntp can use keys
+ other than the first one in the file.
+ 4. sntp computes the MAC using the key, then the data (was other way).
+ 5. sntp handles responses with extensions now.
+ 6. sntp implements the -b (broadcast/multicast) option. Tested.
+ The -b option takes an argument which is the broadcast/multicast
+ address on which to listen for packets. The command still requires a
+ host address at the end of the command line. This is the address
+ expected to do the broadcasting/multicasting.
+ 7. sntp correctly handles network-order key IDs on little-endian.
+ 8. Eliminated a huge amount of code duplication between the sntp
+ unicast and multicast code paths, creating a single process_pkt()
+ function that is used for both paths after the packet is received.
+ 9. The -t timeout option now works with both unicast and multicast.
+ Previously it worked with neither. It wasn't coded for unicast, and
+ was incorrectly coded for multicast.
+ 10. In unicast mode, the requests are sent MACed using the key
+ specified with the -a command line option.
+ 11. Cleaned up indentation consistent with the predominant style in
+ the files changed, namely, using tab stop characters and not spaces
+ for indentation. This way, you can set your tab stop spacing as you
+ like it and the indentation looks correct. This was not a big change.
+ The files were mostly consistent before.
+ 12. Eliminated LOTS of blank lines.
+
+
+ sntp/crypto.h@1.8 +12 -6
+ [Bug 1459] sntp MD5 authentication does not work with ntpd.
+ Many sntp fixes from Nelson Boyard:
+ 1. sntp properly handles hex key strings in the keyfile, instead of
+ just treating the text as binary strings.
+ 2. sntp handles SHA1 as well as MD5.
+ 3. If the key file contains more than one key, sntp can use keys
+ other than the first one in the file.
+ 4. sntp computes the MAC using the key, then the data (was other way).
+ 5. sntp handles responses with extensions now.
+ 6. sntp implements the -b (broadcast/multicast) option. Tested.
+ The -b option takes an argument which is the broadcast/multicast
+ address on which to listen for packets. The command still requires a
+ host address at the end of the command line. This is the address
+ expected to do the broadcasting/multicasting.
+ 7. sntp correctly handles network-order key IDs on little-endian.
+ 8. Eliminated a huge amount of code duplication between the sntp
+ unicast and multicast code paths, creating a single process_pkt()
+ function that is used for both paths after the packet is received.
+ 9. The -t timeout option now works with both unicast and multicast.
+ Previously it worked with neither. It wasn't coded for unicast, and
+ was incorrectly coded for multicast.
+ 10. In unicast mode, the requests are sent MACed using the key
+ specified with the -a command line option.
+ 11. Cleaned up indentation consistent with the predominant style in
+ the files changed, namely, using tab stop characters and not spaces
+ for indentation. This way, you can set your tab stop spacing as you
+ like it and the indentation looks correct. This was not a big change.
+ The files were mostly consistent before.
+ 12. Eliminated LOTS of blank lines.
+
+
+ sntp/main.c@1.24.1.1 +110 -103
+ [Bug 1459] sntp MD5 authentication does not work with ntpd.
+ Many sntp fixes from Nelson Boyard:
+ 1. sntp properly handles hex key strings in the keyfile, instead of
+ just treating the text as binary strings.
+ 2. sntp handles SHA1 as well as MD5.
+ 3. If the key file contains more than one key, sntp can use keys
+ other than the first one in the file.
+ 4. sntp computes the MAC using the key, then the data (was other way).
+ 5. sntp handles responses with extensions now.
+ 6. sntp implements the -b (broadcast/multicast) option. Tested.
+ The -b option takes an argument which is the broadcast/multicast
+ address on which to listen for packets. The command still requires a
+ host address at the end of the command line. This is the address
+ expected to do the broadcasting/multicasting.
+ 7. sntp correctly handles network-order key IDs on little-endian.
+ 8. Eliminated a huge amount of code duplication between the sntp
+ unicast and multicast code paths, creating a single process_pkt()
+ function that is used for both paths after the packet is received.
+ 9. The -t timeout option now works with both unicast and multicast.
+ Previously it worked with neither. It wasn't coded for unicast, and
+ was incorrectly coded for multicast.
+ 10. In unicast mode, the requests are sent MACed using the key
+ specified with the -a command line option.
+ 11. Cleaned up indentation consistent with the predominant style in
+ the files changed, namely, using tab stop characters and not spaces
+ for indentation. This way, you can set your tab stop spacing as you
+ like it and the indentation looks correct. This was not a big change.
+ The files were mostly consistent before.
+ 12. Eliminated LOTS of blank lines.
+
+
+ sntp/networking.c@1.29.1.4 +216 -432
+ [Bug 1325] unreachable code in sntp recv_bcst_data().
+ [Bug 1459] sntp MD5 authentication does not work with ntpd.
+ Many sntp fixes from Nelson Boyard:
+ 1. sntp properly handles hex key strings in the keyfile, instead of
+ just treating the text as binary strings.
+ 2. sntp handles SHA1 as well as MD5.
+ 3. If the key file contains more than one key, sntp can use keys
+ other than the first one in the file.
+ 4. sntp computes the MAC using the key, then the data (was other way).
+ 5. sntp handles responses with extensions now.
+ 6. sntp implements the -b (broadcast/multicast) option. Tested.
+ The -b option takes an argument which is the broadcast/multicast
+ address on which to listen for packets. The command still requires a
+ host address at the end of the command line. This is the address
+ expected to do the broadcasting/multicasting.
+ 7. sntp correctly handles network-order key IDs on little-endian.
+ 8. Eliminated a huge amount of code duplication between the sntp
+ unicast and multicast code paths, creating a single process_pkt()
+ function that is used for both paths after the packet is received.
+ 9. The -t timeout option now works with both unicast and multicast.
+ Previously it worked with neither. It wasn't coded for unicast, and
+ was incorrectly coded for multicast.
+ 10. In unicast mode, the requests are sent MACed using the key
+ specified with the -a command line option.
+ 11. Cleaned up indentation consistent with the predominant style in
+ the files changed, namely, using tab stop characters and not spaces
+ for indentation. This way, you can set your tab stop spacing as you
+ like it and the indentation looks correct. This was not a big change.
+ The files were mostly consistent before.
+ 12. Eliminated LOTS of blank lines.
+
+
+ sntp/networking.h@1.18 +3 -3
+ [Bug 1459] sntp MD5 authentication does not work with ntpd.
+ Many sntp fixes from Nelson Boyard:
+ 1. sntp properly handles hex key strings in the keyfile, instead of
+ just treating the text as binary strings.
+ 2. sntp handles SHA1 as well as MD5.
+ 3. If the key file contains more than one key, sntp can use keys
+ other than the first one in the file.
+ 4. sntp computes the MAC using the key, then the data (was other way).
+ 5. sntp handles responses with extensions now.
+ 6. sntp implements the -b (broadcast/multicast) option. Tested.
+ The -b option takes an argument which is the broadcast/multicast
+ address on which to listen for packets. The command still requires a
+ host address at the end of the command line. This is the address
+ expected to do the broadcasting/multicasting.
+ 7. sntp correctly handles network-order key IDs on little-endian.
+ 8. Eliminated a huge amount of code duplication between the sntp
+ unicast and multicast code paths, creating a single process_pkt()
+ function that is used for both paths after the packet is received.
+ 9. The -t timeout option now works with both unicast and multicast.
+ Previously it worked with neither. It wasn't coded for unicast, and
+ was incorrectly coded for multicast.
+ 10. In unicast mode, the requests are sent MACed using the key
+ specified with the -a command line option.
+ 11. Cleaned up indentation consistent with the predominant style in
+ the files changed, namely, using tab stop characters and not spaces
+ for indentation. This way, you can set your tab stop spacing as you
+ like it and the indentation looks correct. This was not a big change.
+ The files were mostly consistent before.
+ 12. Eliminated LOTS of blank lines.
+
+
+ChangeSet@1.2133, 2010-05-06 10:09:32+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P30
+ TAG: NTP_4_2_7P30
+
+ ChangeLog@1.572 +1 -0
+ NTP_4_2_7P30
+
+ ntpd/ntpd-opts.c@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpd/ntpd-opts.h@1.31 +3 -3
+ NTP_4_2_7P30
+
+ ntpd/ntpd-opts.texi@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpd/ntpd.1@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpdc/ntpdc-opts.c@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpdc/ntpdc-opts.h@1.31 +3 -3
+ NTP_4_2_7P30
+
+ ntpdc/ntpdc-opts.texi@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpdc/ntpdc.1@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpq/ntpq-opts.c@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpq/ntpq-opts.h@1.31 +3 -3
+ NTP_4_2_7P30
+
+ ntpq/ntpq-opts.texi@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpq/ntpq.1@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.31 +2 -2
+ NTP_4_2_7P30
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.31 +3 -3
+ NTP_4_2_7P30
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.31 +1 -1
+ NTP_4_2_7P30
+
+ ntpsnmpd/ntpsnmpd.1@1.31 +2 -2
+ NTP_4_2_7P30
+
+ packageinfo.sh@1.32 +1 -1
+ NTP_4_2_7P30
+
+ sntp/sntp-opts.c@1.31 +2 -2
+ NTP_4_2_7P30
+
+ sntp/sntp-opts.h@1.31 +3 -3
+ NTP_4_2_7P30
+
+ sntp/sntp-opts.texi@1.31 +2 -2
+ NTP_4_2_7P30
+
+ sntp/sntp.1@1.31 +2 -2
+ NTP_4_2_7P30
+
+ sntp/sntp.html@1.31 +1 -1
+ NTP_4_2_7P30
+
+ util/ntp-keygen-opts.c@1.31 +2 -2
+ NTP_4_2_7P30
+
+ util/ntp-keygen-opts.h@1.31 +3 -3
+ NTP_4_2_7P30
+
+ util/ntp-keygen-opts.texi@1.31 +2 -2
+ NTP_4_2_7P30
+
+ util/ntp-keygen.1@1.31 +2 -2
+ NTP_4_2_7P30
+
+ChangeSet@1.2132, 2010-05-05 10:27:23+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1526] ntpd DNS pipe read EINTR with no network at startup.
+
+ ChangeLog@1.571 +1 -0
+ [Bug 1526] ntpd DNS pipe read EINTR with no network at startup.
+
+ ntpd/work_fork.c@1.4 +1 -9
+ [Bug 1526] ntpd DNS pipe read EINTR with no network at startup.
+
+ChangeSet@1.2131, 2010-05-05 03:58:07-04:00, stenn@deacon.udel.edu
+ Update the ChangeLog entries when merging items from -stable
+
+ ChangeLog@1.570 +52 -51
+ Update the ChangeLog entries when merging items from -stable
+
+ChangeSet@1.2126.1.5, 2010-05-04 22:34:37-04:00, stenn@deacon.udel.edu
+ NTP_4_2_7P29
+ TAG: NTP_4_2_7P29
+
+ ChangeLog@1.566.1.5 +1 -0
+ NTP_4_2_7P29
+
+ ntpd/ntpd-opts.c@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpd/ntpd-opts.h@1.30 +3 -3
+ NTP_4_2_7P29
+
+ ntpd/ntpd-opts.texi@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpd/ntpd.1@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpdc/ntpdc-opts.c@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpdc/ntpdc-opts.h@1.30 +3 -3
+ NTP_4_2_7P29
+
+ ntpdc/ntpdc-opts.texi@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpdc/ntpdc.1@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpq/ntpq-opts.c@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpq/ntpq-opts.h@1.30 +3 -3
+ NTP_4_2_7P29
+
+ ntpq/ntpq-opts.texi@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpq/ntpq.1@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.30 +2 -2
+ NTP_4_2_7P29
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.30 +3 -3
+ NTP_4_2_7P29
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.30 +1 -1
+ NTP_4_2_7P29
+
+ ntpsnmpd/ntpsnmpd.1@1.30 +2 -2
+ NTP_4_2_7P29
+
+ packageinfo.sh@1.31 +1 -1
+ NTP_4_2_7P29
+
+ sntp/sntp-opts.c@1.30 +2 -2
+ NTP_4_2_7P29
+
+ sntp/sntp-opts.h@1.30 +3 -3
+ NTP_4_2_7P29
+
+ sntp/sntp-opts.texi@1.30 +2 -2
+ NTP_4_2_7P29
+
+ sntp/sntp.1@1.30 +2 -2
+ NTP_4_2_7P29
+
+ sntp/sntp.html@1.30 +1 -1
+ NTP_4_2_7P29
+
+ util/ntp-keygen-opts.c@1.30 +2 -2
+ NTP_4_2_7P29
+
+ util/ntp-keygen-opts.h@1.30 +3 -3
+ NTP_4_2_7P29
+
+ util/ntp-keygen-opts.texi@1.30 +2 -2
+ NTP_4_2_7P29
+
+ util/ntp-keygen.1@1.30 +2 -2
+ NTP_4_2_7P29
+
+ChangeSet@1.2129, 2010-05-04 01:43:50-04:00, stenn@deacon.udel.edu
+ Documentation patches from Dave Mills
+
+ html/accopt.html@1.36 +1 -1
+ Documentation patches from Dave Mills
+
+ html/monopt.html@1.31 +3 -3
+ Documentation patches from Dave Mills
+
+ChangeSet@1.2126.1.4, 2010-05-03 10:15:58+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P28
+ TAG: NTP_4_2_7P28
+
+ ChangeLog@1.566.1.4 +1 -0
+ NTP_4_2_7P28
+
+ ntpd/ntpd-opts.c@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpd/ntpd-opts.h@1.29 +3 -3
+ NTP_4_2_7P28
+
+ ntpd/ntpd-opts.texi@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpd/ntpd.1@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpdc/ntpdc-opts.c@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpdc/ntpdc-opts.h@1.29 +3 -3
+ NTP_4_2_7P28
+
+ ntpdc/ntpdc-opts.texi@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpdc/ntpdc.1@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpq/ntpq-opts.c@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpq/ntpq-opts.h@1.29 +3 -3
+ NTP_4_2_7P28
+
+ ntpq/ntpq-opts.texi@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpq/ntpq.1@1.29 +2 -2
+ NTP_4_2_7P28
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.29 +27 -4
+ NTP_4_2_7P28
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.29 +18 -11
+ NTP_4_2_7P28
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.29 +10 -1
+ NTP_4_2_7P28
+
+ ntpsnmpd/ntpsnmpd.1@1.29 +11 -2
+ NTP_4_2_7P28
+
+ packageinfo.sh@1.30 +1 -1
+ NTP_4_2_7P28
+
+ sntp/sntp-opts.c@1.29 +2 -2
+ NTP_4_2_7P28
+
+ sntp/sntp-opts.h@1.29 +3 -3
+ NTP_4_2_7P28
+
+ sntp/sntp-opts.texi@1.29 +2 -2
+ NTP_4_2_7P28
+
+ sntp/sntp.1@1.29 +2 -2
+ NTP_4_2_7P28
+
+ sntp/sntp.html@1.29 +1 -1
+ NTP_4_2_7P28
+
+ util/ntp-keygen-opts.c@1.29 +2 -2
+ NTP_4_2_7P28
+
+ util/ntp-keygen-opts.h@1.29 +3 -3
+ NTP_4_2_7P28
+
+ util/ntp-keygen-opts.texi@1.29 +2 -2
+ NTP_4_2_7P28
+
+ util/ntp-keygen.1@1.29 +2 -2
+ NTP_4_2_7P28
+
+ChangeSet@1.2082.4.84, 2010-05-03 04:35:06-04:00, stenn@deacon.udel.edu
+ [Bug 1541] Fix wrong keyword for "maxclock".
+
+ ChangeLog@1.496.26.59 +1 -0
+ [Bug 1541] Fix wrong keyword for "maxclock".
+
+ html/decode.html@1.11.1.2 +2 -2
+ [Bug 1541] Fix wrong keyword for "maxclock".
+
+ChangeSet@1.2126.1.2, 2010-05-03 04:20:43-04:00, stenn@deacon.udel.edu
+ merge cleanup
+
+ ChangeLog@1.566.1.2 +5 -0
+ merge cleanup
+
+ChangeSet@1.2127, 2010-04-30 17:24:16+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1542] ntpd mrulist response may have incorrect last.older.
+ [Bug 1543] ntpq mrulist must refresh nonce when retrying.
+ [Bug 1544] ntpq mrulist sscanf timestamp format mismatch on 64-bit.
+ Windows compiling hints/winnt.html update from Sunil Tej S.
+
+ ChangeLog@1.567 +8 -2
+ [Bug 1542] ntpd mrulist response may have incorrect last.older.
+ [Bug 1543] ntpq mrulist must refresh nonce when retrying.
+ [Bug 1544] ntpq mrulist sscanf timestamp format mismatch on 64-bit.
+ Windows compiling hints/winnt.html update from Sunil Tej S.
+
+ html/hints/winnt.html@1.20 +13 -11
+ Windows compiling hints/winnt.html update from Sunil Tej S.
+
+ ntpd/ntp_control.c@1.139 +5 -2
+ [Bug 1542] ntpd mrulist response may have incorrect last.older.
+
+ ntpq/ntpq-subs.c@1.66 +145 -67
+ [Bug 1543] ntpq mrulist must refresh nonce when retrying.
+ [Bug 1544] ntpq mrulist sscanf timestamp format mismatch on 64-bit.
+
+ChangeSet@1.2082.4.83, 2010-04-30 09:03:12+00:00, stenn@psp-fb1.ntp.org
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ ChangeLog@1.496.26.58 +2 -0
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.10.1 +29 -6
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.2 +12 -0
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.10.1 +17 -10
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.10.1 +33 -2
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ ntpsnmpd/ntpsnmpd.1@1.122.10.1 +11 -2
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ ntpsnmpd/ntpsnmpd.c@1.3.1.1 +1 -1
+ [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain socket by default. Provide a command-line 'socket name' option.
+
+ChangeSet@1.2082.4.82, 2010-04-30 08:54:29+00:00, stenn@psp-fb1.ntp.org
+ [Bug 1538] update refclock_nmea.c's call to getprotobyname()
+
+ ChangeLog@1.496.26.57 +6 -0
+ [Bug 1538] update refclock_nmea.c's call to getprotobyname()
+
+ ntpd/refclock_nmea.c@1.46.1.1 +1 -1
+ [Bug 1538] update refclock_nmea.c's call to getprotobyname()
+
+ChangeSet@1.2126, 2010-04-27 10:08:54+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P27
+ TAG: NTP_4_2_7P27
+
+ ChangeLog@1.566 +1 -0
+ NTP_4_2_7P27
+
+ ntpd/ntpd-opts.c@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpd/ntpd-opts.h@1.28 +3 -3
+ NTP_4_2_7P27
+
+ ntpd/ntpd-opts.texi@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpd/ntpd.1@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpdc/ntpdc-opts.c@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpdc/ntpdc-opts.h@1.28 +3 -3
+ NTP_4_2_7P27
+
+ ntpdc/ntpdc-opts.texi@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpdc/ntpdc.1@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpq/ntpq-opts.c@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpq/ntpq-opts.h@1.28 +3 -3
+ NTP_4_2_7P27
+
+ ntpq/ntpq-opts.texi@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpq/ntpq.1@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.28 +2 -2
+ NTP_4_2_7P27
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.28 +3 -3
+ NTP_4_2_7P27
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.28 +1 -1
+ NTP_4_2_7P27
+
+ ntpsnmpd/ntpsnmpd.1@1.28 +2 -2
+ NTP_4_2_7P27
+
+ packageinfo.sh@1.29 +1 -1
+ NTP_4_2_7P27
+
+ sntp/sntp-opts.c@1.28 +2 -2
+ NTP_4_2_7P27
+
+ sntp/sntp-opts.h@1.28 +3 -3
+ NTP_4_2_7P27
+
+ sntp/sntp-opts.texi@1.28 +2 -2
+ NTP_4_2_7P27
+
+ sntp/sntp.1@1.28 +2 -2
+ NTP_4_2_7P27
+
+ sntp/sntp.html@1.28 +1 -1
+ NTP_4_2_7P27
+
+ util/ntp-keygen-opts.c@1.28 +2 -2
+ NTP_4_2_7P27
+
+ util/ntp-keygen-opts.h@1.28 +3 -3
+ NTP_4_2_7P27
+
+ util/ntp-keygen-opts.texi@1.28 +2 -2
+ NTP_4_2_7P27
+
+ util/ntp-keygen.1@1.28 +2 -2
+ NTP_4_2_7P27
+
+ChangeSet@1.2082.4.81, 2010-04-27 02:53:34-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2_RC2
+ TAG: NTP_4_2_6P2_RC2
+
+ ChangeLog@1.496.26.56 +1 -0
+ NTP_4_2_6P2_RC2
+
+ ntpd/ntpd-opts.c@1.248.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpd/ntpd-opts.h@1.248.9.1 +3 -3
+ NTP_4_2_6P2_RC2
+
+ ntpd/ntpd-opts.texi@1.246.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpd/ntpd.1@1.246.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpdc/ntpdc-opts.c@1.244.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpdc/ntpdc-opts.h@1.244.9.1 +3 -3
+ NTP_4_2_6P2_RC2
+
+ ntpdc/ntpdc-opts.texi@1.243.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpdc/ntpdc.1@1.243.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpq/ntpq-opts.c@1.245.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpq/ntpq-opts.h@1.245.9.1 +3 -3
+ NTP_4_2_6P2_RC2
+
+ ntpq/ntpq-opts.texi@1.244.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpq/ntpq.1@1.244.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.9.1 +3 -3
+ NTP_4_2_6P2_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.9.1 +1 -1
+ NTP_4_2_6P2_RC2
+
+ ntpsnmpd/ntpsnmpd.1@1.122.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ packageinfo.sh@1.255.11.1 +1 -1
+ NTP_4_2_6P2_RC2
+
+ sntp/sntp-opts.c@1.117.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ sntp/sntp-opts.h@1.117.9.1 +3 -3
+ NTP_4_2_6P2_RC2
+
+ sntp/sntp-opts.texi@1.117.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ sntp/sntp.1@1.117.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ sntp/sntp.html@1.7.9.1 +1 -1
+ NTP_4_2_6P2_RC2
+
+ util/ntp-keygen-opts.c@1.247.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ util/ntp-keygen-opts.h@1.247.9.1 +3 -3
+ NTP_4_2_6P2_RC2
+
+ util/ntp-keygen-opts.texi@1.246.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ util/ntp-keygen.1@1.246.9.1 +2 -2
+ NTP_4_2_6P2_RC2
+
+ChangeSet@1.2124, 2010-04-24 10:09:18+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P26
+ TAG: NTP_4_2_7P26
+
+ ChangeLog@1.564 +1 -0
+ NTP_4_2_7P26
+
+ ntpd/ntpd-opts.c@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpd/ntpd-opts.h@1.27 +3 -3
+ NTP_4_2_7P26
+
+ ntpd/ntpd-opts.texi@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpd/ntpd.1@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpdc/ntpdc-opts.c@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpdc/ntpdc-opts.h@1.27 +3 -3
+ NTP_4_2_7P26
+
+ ntpdc/ntpdc-opts.texi@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpdc/ntpdc.1@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpq/ntpq-opts.c@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpq/ntpq-opts.h@1.27 +3 -3
+ NTP_4_2_7P26
+
+ ntpq/ntpq-opts.texi@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpq/ntpq.1@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.27 +2 -2
+ NTP_4_2_7P26
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.27 +3 -3
+ NTP_4_2_7P26
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.27 +1 -1
+ NTP_4_2_7P26
+
+ ntpsnmpd/ntpsnmpd.1@1.27 +2 -2
+ NTP_4_2_7P26
+
+ packageinfo.sh@1.28 +1 -1
+ NTP_4_2_7P26
+
+ sntp/sntp-opts.c@1.27 +2 -2
+ NTP_4_2_7P26
+
+ sntp/sntp-opts.h@1.27 +3 -3
+ NTP_4_2_7P26
+
+ sntp/sntp-opts.texi@1.27 +2 -2
+ NTP_4_2_7P26
+
+ sntp/sntp.1@1.27 +2 -2
+ NTP_4_2_7P26
+
+ sntp/sntp.html@1.27 +1 -1
+ NTP_4_2_7P26
+
+ util/ntp-keygen-opts.c@1.27 +2 -2
+ NTP_4_2_7P26
+
+ util/ntp-keygen-opts.h@1.27 +3 -3
+ NTP_4_2_7P26
+
+ util/ntp-keygen-opts.texi@1.27 +2 -2
+ NTP_4_2_7P26
+
+ util/ntp-keygen.1@1.27 +2 -2
+ NTP_4_2_7P26
+
+ChangeSet@1.2082.4.80, 2010-04-24 05:57:35+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h.
+ [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored.
+
+ ChangeLog@1.496.26.55 +4 -1
+ [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h.
+ [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored.
+
+ lib/isc/win32/include/isc/net.h@1.10 +30 -0
+ [Bug 1534] win32/include/isc/net.h conflicts with VC++ 2010 errno.h.
+
+ ntpd/ntp_parser.c@1.52.1.2 +2 -2
+ Bison output from ntp_parser.y
+
+ ntpd/ntp_parser.y@1.47.1.2 +2 -2
+ [Bug 1535] "restrict -4 default" and "restrict -6 default" ignored.
+
+ChangeSet@1.2119.1.1, 2010-04-22 10:06:01+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1531] Require nonce with mrulist requests.
+ [Bug 1532] Remove ntpd support for ntpdc's monlist in favor of ntpq's
+ mrulist.
+
+ ChangeLog@1.559.1.1 +3 -0
+ [Bug 1531] Require nonce with mrulist requests.
+ [Bug 1532] Remove ntpd support for ntpdc's monlist in favor of ntpq's
+ mrulist.
+
+ include/ntp_control.h@1.46 +1 -0
+ [Bug 1531] Require nonce with mrulist requests.
+
+ include/ntp_md5.h@1.4 +21 -5
+ Hide #ifdefs related to selection between OpenSSL and host/libisc MD5
+ implementations in one place, NTP code can then use the OpenSSL API
+ regardless.
+
+ include/ntpd.h@1.137.1.15 +3 -0
+ expose ntp_scanner.c's conf_file_sum
+
+ libntp/a_md5encrypt.c@1.27 +3 -38
+ Hide #ifdefs related to selection between OpenSSL and host/libisc MD5
+ implementations in one place, NTP code can then use the OpenSSL API
+ regardless.
+
+ ntpd/ntp_control.c@1.138 +150 -9
+ [Bug 1531] Require nonce with mrulist requests.
+
+ ntpd/ntp_request.c@1.93 +5 -116
+ [Bug 1532] Remove ntpd support for ntpdc's monlist in favor of ntpq's
+ mrulist.
+
+ ntpd/ntp_scanner.c@1.35 +5 -0
+ [Bug 1531] Require nonce with mrulist requests.
+
+ ntpq/ntpq-subs.c@1.65 +38 -5
+ [Bug 1531] Require nonce with mrulist requests.
+
+ChangeSet@1.2121, 2010-04-20 21:58:50+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P25
+ TAG: NTP_4_2_7P25
+
+ ChangeLog@1.561 +1 -0
+ NTP_4_2_7P25
+
+ ntpd/ntpd-opts.c@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpd/ntpd-opts.h@1.26 +3 -3
+ NTP_4_2_7P25
+
+ ntpd/ntpd-opts.texi@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpd/ntpd.1@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpdc/ntpdc-opts.c@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpdc/ntpdc-opts.h@1.26 +3 -3
+ NTP_4_2_7P25
+
+ ntpdc/ntpdc-opts.texi@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpdc/ntpdc.1@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpq/ntpq-opts.c@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpq/ntpq-opts.h@1.26 +3 -3
+ NTP_4_2_7P25
+
+ ntpq/ntpq-opts.texi@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpq/ntpq.1@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.26 +2 -2
+ NTP_4_2_7P25
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.26 +3 -3
+ NTP_4_2_7P25
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.26 +1 -1
+ NTP_4_2_7P25
+
+ ntpsnmpd/ntpsnmpd.1@1.26 +2 -2
+ NTP_4_2_7P25
+
+ packageinfo.sh@1.27 +1 -1
+ NTP_4_2_7P25
+
+ sntp/sntp-opts.c@1.26 +2 -2
+ NTP_4_2_7P25
+
+ sntp/sntp-opts.h@1.26 +3 -3
+ NTP_4_2_7P25
+
+ sntp/sntp-opts.texi@1.26 +2 -2
+ NTP_4_2_7P25
+
+ sntp/sntp.1@1.26 +2 -2
+ NTP_4_2_7P25
+
+ sntp/sntp.html@1.26 +1 -1
+ NTP_4_2_7P25
+
+ util/ntp-keygen-opts.c@1.26 +2 -2
+ NTP_4_2_7P25
+
+ util/ntp-keygen-opts.h@1.26 +3 -3
+ NTP_4_2_7P25
+
+ util/ntp-keygen-opts.texi@1.26 +2 -2
+ NTP_4_2_7P25
+
+ util/ntp-keygen.1@1.26 +2 -2
+ NTP_4_2_7P25
+
+ChangeSet@1.2082.4.79, 2010-04-20 01:55:16-04:00, stenn@deacon.udel.edu
+ [Bug 1465] Make sure time from TS2100 is not invalid (backport from -dev)
+
+ ChangeLog@1.496.26.54 +1 -0
+ [Bug 1465] Make sure time from TS2100 is not invalid (backport from -dev)
+
+ ntpd/refclock_true.c@1.11.1.1 +2 -1
+ [Bug 1465] Make sure time from TS2100 is not invalid (backport from -dev)
+
+ChangeSet@1.2082.4.78, 2010-04-20 01:45:17-04:00, stenn@deacon.udel.edu
+ [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc
+
+ ChangeLog@1.496.26.53 +1 -0
+ [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc
+
+ ntpdc/Makefile.am@1.48.1.4 +2 -2
+ [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc
+
+ ntpq/Makefile.am@1.43.1.4 +2 -2
+ [Bug 1528] Fix EDITLINE_LIBS link order for ntpq and ntpdc
+
+ChangeSet@1.2082.4.77, 2010-04-20 01:30:11-04:00, stenn@deacon.udel.edu
+ Remove --with-arlib from br-flock
+
+ ChangeLog@1.496.26.52 +2 -0
+ Remove --with-arlib from br-flock
+
+ br-flock@1.14 +1 -1
+ Remove --with-arlib from br-flock
+
+ChangeSet@1.2082.4.76, 2010-04-18 04:14:33-04:00, stenn@deacon.udel.edu
+ NTP_4_2_6P2_RC1
+ TAG: NTP_4_2_6P2_RC1
+
+ ChangeLog@1.496.26.51 +1 -0
+ NTP_4_2_6P2_RC1
+
+ ntpd/ntpd-opts.c@1.248.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpd/ntpd-opts.h@1.248.8.1 +3 -3
+ NTP_4_2_6P2_RC1
+
+ ntpd/ntpd-opts.texi@1.246.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpd/ntpd.1@1.246.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpdc/ntpdc-opts.c@1.244.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpdc/ntpdc-opts.h@1.244.8.1 +3 -3
+ NTP_4_2_6P2_RC1
+
+ ntpdc/ntpdc-opts.texi@1.243.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpdc/ntpdc.1@1.243.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpq/ntpq-opts.c@1.245.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpq/ntpq-opts.h@1.245.8.1 +3 -3
+ NTP_4_2_6P2_RC1
+
+ ntpq/ntpq-opts.texi@1.244.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpq/ntpq.1@1.244.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.8.1 +3 -3
+ NTP_4_2_6P2_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.8.1 +1 -1
+ NTP_4_2_6P2_RC1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ packageinfo.sh@1.255.10.2 +2 -2
+ NTP_4_2_6P2_RC1
+
+ sntp/sntp-opts.c@1.117.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ sntp/sntp-opts.h@1.117.8.1 +3 -3
+ NTP_4_2_6P2_RC1
+
+ sntp/sntp-opts.texi@1.117.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ sntp/sntp.1@1.117.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ sntp/sntp.html@1.7.8.1 +1 -1
+ NTP_4_2_6P2_RC1
+
+ util/ntp-keygen-opts.c@1.247.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ util/ntp-keygen-opts.h@1.247.8.1 +3 -3
+ NTP_4_2_6P2_RC1
+
+ util/ntp-keygen-opts.texi@1.246.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ util/ntp-keygen.1@1.246.8.1 +2 -2
+ NTP_4_2_6P2_RC1
+
+ChangeSet@1.2082.4.75, 2010-04-18 03:57:37-04:00, stenn@deacon.udel.edu
+ 4.2.6p2-RC1
+
+ packageinfo.sh@1.255.10.1 +1 -1
+ 4.2.6p2-RC1
+
+ChangeSet@1.2082.4.74, 2010-04-16 13:59:44+00:00, davehart@shiny.ad.hartbrothers.com
+ fix backport (should have copied and pasted from -dev).
+
+ sntp/networking.c@1.29.1.3 +2 -2
+ fix backport (should have copied and pasted from -dev).
+
+ChangeSet@1.2082.4.71, 2010-04-14 21:16:25+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+
+
+ ChangeLog@1.496.44.1 +5 -0
+ [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+
+ applies to previous changeset, deferred to ease pulling the
+ prior changeset into -dev ahead of -stable.
+
+ChangeSet@1.2082.19.2, 2010-04-14 20:55:27+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
+ Update html/authopt.html controlkey, requestkey, and trustedkey docs.
+
+ ChangeLog@1.496.43.1 +5 -0
+ [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
+ Update html/authopt.html controlkey, requestkey, and trustedkey docs.
+
+ The first entry applies to the prior changeset, which intentionally
+ lacked a ChangeLog entry to smooth pulling into -dev before -stable.
+
+ html/authopt.html@1.60 +29 -7
+ Update html/authopt.html controlkey, requestkey, and trustedkey docs,
+ add range syntax to trustedkey docs.
+
+
+ChangeSet@1.2082.18.3, 2010-04-14 04:44:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+ [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if
+ "restrict ... limited" is used.
+
+ ChangeLog@1.496.26.48 +6 -0
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+ [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if
+ "restrict ... limited" is used.
+
+ include/ntp.h@1.168.1.1 +25 -16
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ include/ntp_lists.h@1.1.1.1 +163 -10
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ include/ntp_net.h@1.3.1.1 +34 -13
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ include/ntpd.h@1.137.2.1 +4 -4
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ ntpd/ntp_io.c@1.306.1.4 +2 -2
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ ntpd/ntp_monitor.c@1.25.1.1 +4 -4
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ ntpd/ntp_request.c@1.82.1.1 +72 -37
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ ntpd/ntp_restrict.c@1.27.1.1 +448 -429
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ ntpdate/ntpdate.c@1.69.1.1 +63 -55
+ [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if
+ "restrict ... limited" is used.
+
+ ntpdate/ntpdate.h@1.10.1.1 +2 -1
+ [Bug 1504] ntpdate tickles ntpd "discard minimum 1" rate limit if
+ "restrict ... limited" is used.
+
+ ntpdc/ntpdc_ops.c@1.62.1.1 +3 -3
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ sntp/networking.c@1.29.1.2 +2 -2
+ [Bug 1503] Auto-enabling of monitor for "restrict ... limited" wrong.
+
+ChangeSet@1.2116, 2010-04-13 21:19:19+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P24
+ TAG: NTP_4_2_7P24
+
+ ChangeLog@1.557 +1 -0
+ NTP_4_2_7P24
+
+ ntpd/ntpd-opts.c@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpd/ntpd-opts.h@1.25 +3 -3
+ NTP_4_2_7P24
+
+ ntpd/ntpd-opts.texi@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpd/ntpd.1@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpdc/ntpdc-opts.c@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpdc/ntpdc-opts.h@1.25 +3 -3
+ NTP_4_2_7P24
+
+ ntpdc/ntpdc-opts.texi@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpdc/ntpdc.1@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpq/ntpq-opts.c@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpq/ntpq-opts.h@1.25 +3 -3
+ NTP_4_2_7P24
+
+ ntpq/ntpq-opts.texi@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpq/ntpq.1@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.25 +2 -2
+ NTP_4_2_7P24
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.25 +3 -3
+ NTP_4_2_7P24
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.25 +1 -1
+ NTP_4_2_7P24
+
+ ntpsnmpd/ntpsnmpd.1@1.25 +2 -2
+ NTP_4_2_7P24
+
+ packageinfo.sh@1.26 +1 -1
+ NTP_4_2_7P24
+
+ sntp/sntp-opts.c@1.25 +2 -2
+ NTP_4_2_7P24
+
+ sntp/sntp-opts.h@1.25 +3 -3
+ NTP_4_2_7P24
+
+ sntp/sntp-opts.texi@1.25 +2 -2
+ NTP_4_2_7P24
+
+ sntp/sntp.1@1.25 +2 -2
+ NTP_4_2_7P24
+
+ sntp/sntp.html@1.25 +1 -1
+ NTP_4_2_7P24
+
+ util/ntp-keygen-opts.c@1.25 +2 -2
+ NTP_4_2_7P24
+
+ util/ntp-keygen-opts.h@1.25 +3 -3
+ NTP_4_2_7P24
+
+ util/ntp-keygen-opts.texi@1.25 +2 -2
+ NTP_4_2_7P24
+
+ util/ntp-keygen.1@1.25 +2 -2
+ NTP_4_2_7P24
+
+ChangeSet@1.2115, 2010-04-13 02:04:47-04:00, stenn@pogo.udel.edu
+ [Bug 1390] Control PPS on the Oncore M12
+
+ ChangeLog@1.556 +1 -0
+ [Bug 1390] Control PPS on the Oncore M12
+
+ChangeSet@1.2112.7.1, 2010-04-13 00:31:34-04:00, stenn@deacon.udel.edu
+ accopt.html: non-ntpport doc changes from Dave Mills
+
+ ChangeLog@1.551.2.1 +1 -0
+ accopt.html: non-ntpport doc changes from Dave Mills
+
+ html/accopt.html@1.33.1.1 +7 -8
+ accopt.html: non-ntpport doc changes from Dave Mills
+
+ChangeSet@1.2112.6.3, 2010-04-12 06:50:58+00:00, davehart@shiny.ad.hartbrothers.com
+ Hal Murray caught another html/manyopt.html typo.
+
+ html/manyopt.html@1.23 +1 -1
+ Hal Murray caught another html/manyopt.html typo.
+
+ChangeSet@1.2112.6.2, 2010-04-12 06:17:50+00:00, davehart@shiny.ad.hartbrothers.com
+ Rephrase awkward pool description, correct "descovery" typo.
+
+ html/manyopt.html@1.22 +10 -11
+ Rephrase awkward pool description, correct "descovery" typo
+ (thanks Hal Murray)
+
+ChangeSet@1.2112.6.1, 2010-04-11 23:13:44+00:00, davehart@shiny.ad.hartbrothers.com
+ Documentation updates for 4.2.7p22 changes and additions, updating
+ ntpdc.html, ntpq.html, accopt.html, confopt.html, manyopt.html,
+ miscopt.html, and miscopt.txt.
+ Modify full MRU list preemption when full to match "discard monitor"
+ documentation, by removing exception for count == 1.
+
+ ChangeLog@1.551.1.1 +5 -0
+ Documentation updates for 4.2.7p22 changes and additions, updating
+ ntpdc.html, ntpq.html, accopt.html, confopt.html, manyopt.html,
+ miscopt.html, and miscopt.txt.
+ Modify full MRU list preemption when full to match "discard monitor"
+ documentation, by removing exception for count == 1.
+
+
+ html/accopt.html@1.34 +19 -12
+ clarify "discard monitor".
+ clarify "restrict default", add "restrict source".
+ be more explicit about futility of kod restriction without limited.
+
+ html/confopt.html@1.49 +7 -6
+ correct link for automatic server discovery info from pool command.
+
+ html/manyopt.html@1.21 +20 -7
+ Document fully-formed "pool" command that act much like
+ "manycastclient".
+
+ html/miscopt.html@1.54 +37 -6
+ change "disable monitor" documentation to explain automatic
+ enabling by "restrict ... limited" and refer to ntpq's mrulist
+ instead of ntpdc's monlist.
+ correct logconfig's second example.
+ add "mru" command to set MRU list limits.
+
+ html/ntpdc.html@1.31 +2 -2
+ Note 600 row limitation of ntpdc -c monlist, refer to ntpq -c mrulist.
+
+ html/ntpq.html@1.40 +64 -1
+ add "mrulist", "monstats", "sysstats" commands.
+
+ html/scripts/miscopt.txt@1.4 +1 -0
+ add "mru" command
+
+ ntpd/ntp_monitor.c@1.34 +3 -11
+ Modify full MRU list preemption when full to match "discard monitor"
+ documentation, by removing exception for count == 1.
+
+ChangeSet@1.2112.1.20, 2010-04-10 03:55:22+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1520] '%u' formats for size_t gives warnings with 64-bit builds.
+
+ applies to prior merge
+
+ ChangeLog@1.553 +1 -0
+ [Bug 1520] '%u' formats for size_t gives warnings with 64-bit builds.
+
+ChangeSet@1.2112.1.18, 2010-04-10 03:29:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+ [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
+
+ covers previous two merges
+
+ ChangeLog@1.552 +3 -0
+ [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+ [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
+
+ChangeSet@1.2082.19.1, 2010-04-10 02:26:43+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1522] Enable range syntax "trustedkey (301 ... 399)".
+
+ include/ntp_config.h@1.66.2.1 +7 -5
+ add u_int u to attr_val.value union.
+
+ include/ntp_stdlib.h@1.40.1.1 +2 -0
+ add extern ref to int cache_key from authkeys.c
+
+ ntpd/complete.conf@1.3.1.1 +1 -1
+ add key ranges to trustedkey
+
+ ntpd/keyword-gen-utd@1.1.1.1 +1 -1
+ to indicate ntp_keyword.h is current with keyword-gen.c
+
+ ntpd/keyword-gen.c@1.5.1.1 +1 -0
+ add T_Ellipsis "..." for
+ trustedkey (1...65533) 65534
+ syntax support.
+
+ ntpd/ntp_config.c@1.241.1.3 +45 -14
+ support key ranges for trustedkey
+
+ ntpd/ntp_keyword.h@1.3.1.1 +848 -844
+ add "..." T_Ellipsis
+
+ ntpd/ntp_parser.c@1.52.1.1 +918 -894
+ Bison output
+
+ ntpd/ntp_parser.h@1.32.1.1 +265 -263
+ Bison output
+
+ ntpd/ntp_parser.y@1.47.1.1 +23 -1
+ support key ranges for trustedkey
+
+ChangeSet@1.2112.3.2, 2010-04-09 12:33:43-04:00, perlinger@psp-deb1.ntp.org
+ fixed minor format glitch in ntpd/ntpd.c
+
+ ntpd/ntpd.c@1.110.1.7 +4 -1
+ parametric length in format strings must be 'int' -- fixed that in 'change_logfile()'
+
+ChangeSet@1.2082.18.2, 2010-04-09 08:15:04+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P1
+ TAG: NTP_4_2_6P1
+
+ ChangeLog@1.496.26.47 +1 -0
+ NTP_4_2_6P1
+
+ ntpd/ntpd-opts.c@1.248.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpd/ntpd-opts.h@1.248.7.1 +3 -3
+ NTP_4_2_6P1
+
+ ntpd/ntpd-opts.texi@1.246.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpd/ntpd.1@1.246.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpdc/ntpdc-opts.c@1.244.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpdc/ntpdc-opts.h@1.244.7.1 +3 -3
+ NTP_4_2_6P1
+
+ ntpdc/ntpdc-opts.texi@1.243.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpdc/ntpdc.1@1.243.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpq/ntpq-opts.c@1.245.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpq/ntpq-opts.h@1.245.7.1 +3 -3
+ NTP_4_2_6P1
+
+ ntpq/ntpq-opts.texi@1.244.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpq/ntpq.1@1.244.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.7.1 +2 -2
+ NTP_4_2_6P1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.7.1 +3 -3
+ NTP_4_2_6P1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.7.1 +1 -1
+ NTP_4_2_6P1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.7.1 +2 -2
+ NTP_4_2_6P1
+
+ packageinfo.sh@1.255.9.2 +2 -2
+ NTP_4_2_6P1
+
+ sntp/sntp-opts.c@1.117.7.1 +2 -2
+ NTP_4_2_6P1
+
+ sntp/sntp-opts.h@1.117.7.1 +3 -3
+ NTP_4_2_6P1
+
+ sntp/sntp-opts.texi@1.117.7.1 +2 -2
+ NTP_4_2_6P1
+
+ sntp/sntp.1@1.117.7.1 +2 -2
+ NTP_4_2_6P1
+
+ sntp/sntp.html@1.7.7.1 +1 -1
+ NTP_4_2_6P1
+
+ util/ntp-keygen-opts.c@1.247.7.1 +2 -2
+ NTP_4_2_6P1
+
+ util/ntp-keygen-opts.h@1.247.7.1 +3 -3
+ NTP_4_2_6P1
+
+ util/ntp-keygen-opts.texi@1.246.7.1 +2 -2
+ NTP_4_2_6P1
+
+ util/ntp-keygen.1@1.246.7.1 +2 -2
+ NTP_4_2_6P1
+
+ChangeSet@1.2082.18.1, 2010-04-09 03:43:19-04:00, stenn@deacon.udel.edu
+ Release ntp-4.2.6p1
+
+ NEWS@1.106 +14 -0
+ Release ntp-4.2.6p1
+
+ packageinfo.sh@1.255.9.1 +1 -1
+ Release ntp-4.2.6p1
+
+ChangeSet@1.2112.3.1, 2010-04-06 19:08:47+02:00, jnperlin@hydra.localnet
+ fix format string warnings (64-bit); avoid (m)syslog format string attacks
+
+ ntpd/ntp_config.c@1.259 +4 -4
+ format 'size_t' with '%lu' (64-bit issue)
+
+ ntpd/ntp_control.c@1.137 +2 -2
+ avoid possible format string attack to msyslog()
+
+ ntpd/ntp_intres.c@1.88 +4 -4
+ format 'size_t' with '%lu' (64-bit issue)
+
+ ntpd/ntp_request.c@1.91 +7 -7
+ format 'size_t' with '%lu' (64-bit issue)
+
+ ntpd/ntp_scanner.c@1.34 +3 -3
+ format 'size_t' with '%lu' (64-bit issue); fixed is_special() (also 64-bit trouble)
+
+ ntpd/ntpd.c@1.110.1.6 +3 -3
+ format 'size_t' with '%lu' (64-bit issue); avoid possible format string attack to msyslog()
+
+ ntpd/refclock_acts.c@1.37 +2 -2
+ format 'size_t' with '%lu' (64-bit issue)
+
+ ntpd/work_fork.c@1.3 +8 -8
+ format 'size_t' with '%lu' (64-bit issue)
+
+ ntpdc/ntpdc.c@1.83 +7 -7
+ format 'size_t' with '%lu' (64-bit issue)
+
+ sntp/log.c@1.13 +2 -2
+ avoid possible format string attack to syslog()
+
+ChangeSet@1.2082.4.70, 2010-04-06 05:37:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.38.1.1 +144 -108
+ [Bug 1518] Windows ntpd should lock to one processor more
+ conservatively.
+
+ChangeSet@1.2112.1.15, 2010-04-04 10:09:44+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P23
+ TAG: NTP_4_2_7P23
+
+ ChangeLog@1.550 +1 -0
+ NTP_4_2_7P23
+
+ ntpd/ntpd-opts.c@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpd/ntpd-opts.h@1.24 +3 -3
+ NTP_4_2_7P23
+
+ ntpd/ntpd-opts.texi@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpd/ntpd.1@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpdc/ntpdc-opts.c@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpdc/ntpdc-opts.h@1.24 +3 -3
+ NTP_4_2_7P23
+
+ ntpdc/ntpdc-opts.texi@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpdc/ntpdc.1@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpq/ntpq-opts.c@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpq/ntpq-opts.h@1.24 +3 -3
+ NTP_4_2_7P23
+
+ ntpq/ntpq-opts.texi@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpq/ntpq.1@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.24 +2 -2
+ NTP_4_2_7P23
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.24 +3 -3
+ NTP_4_2_7P23
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.24 +1 -1
+ NTP_4_2_7P23
+
+ ntpsnmpd/ntpsnmpd.1@1.24 +2 -2
+ NTP_4_2_7P23
+
+ packageinfo.sh@1.25 +1 -1
+ NTP_4_2_7P23
+
+ sntp/sntp-opts.c@1.24 +2 -2
+ NTP_4_2_7P23
+
+ sntp/sntp-opts.h@1.24 +3 -3
+ NTP_4_2_7P23
+
+ sntp/sntp-opts.texi@1.24 +2 -2
+ NTP_4_2_7P23
+
+ sntp/sntp.1@1.24 +2 -2
+ NTP_4_2_7P23
+
+ sntp/sntp.html@1.24 +1 -1
+ NTP_4_2_7P23
+
+ util/ntp-keygen-opts.c@1.24 +2 -2
+ NTP_4_2_7P23
+
+ util/ntp-keygen-opts.h@1.24 +3 -3
+ NTP_4_2_7P23
+
+ util/ntp-keygen-opts.texi@1.24 +2 -2
+ NTP_4_2_7P23
+
+ util/ntp-keygen.1@1.24 +2 -2
+ NTP_4_2_7P23
+
+ChangeSet@1.2112.1.14, 2010-04-04 04:07:40+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1516] unpeer by IP address fails, DNS name works.
+ [Bug 1517] ntpq and ntpdc should verify reverse DNS before use.
+ ntpq and ntpdc now use the following format for showing purported
+ DNS names from IP address "reverse" DNS lookups when the DNS name
+ does not exist or does not include the original IP address among
+ the results: "192.168.1.2 (fake.dns.local)".
+
+ ChangeLog@1.549 +6 -0
+ [Bug 1516] unpeer by IP address fails, DNS name works.
+ [Bug 1517] ntpq and ntpdc should verify reverse DNS before use.
+ ntpq and ntpdc now use the following format for showing purported
+ DNS names from IP address "reverse" DNS lookups when the DNS name
+ does not exist or does not include the original IP address among
+ the results: "192.168.1.2 (fake.dns.local)".
+
+ libntp/socktohost.c@1.9 +66 -6
+ [Bug 1517] ntpq and ntpdc should verify reverse DNS before use.
+ ntpq and ntpdc now use the following format for showing purported
+ DNS names from IP address "reverse" DNS lookups when the DNS name
+ does not exist or does not include the original IP address among
+ the results: "192.168.1.2 (fake.dns.local)".
+
+ ntpd/ntp_config.c@1.258 +7 -14
+ * [Bug 1516] unpeer by IP address fails, DNS name works.
+
+ ntpq/ntpq.c@1.112 +7 -7
+ [Bug 1517] ntpq and ntpdc should verify reverse DNS before use.
+ ntpq and ntpdc now use the following format for showing purported
+ DNS names from IP address "reverse" DNS lookups when the DNS name
+ does not exist or does not include the original IP address among
+ the results: "192.168.1.2 (fake.dns.local)".
+
+ChangeSet@1.2112.1.13, 2010-04-02 02:08:59+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P22
+ TAG: NTP_4_2_7P22
+
+ ChangeLog@1.548 +1 -0
+ NTP_4_2_7P22
+
+ ntpd/ntpd-opts.c@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpd/ntpd-opts.h@1.23 +3 -3
+ NTP_4_2_7P22
+
+ ntpd/ntpd-opts.texi@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpd/ntpd.1@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpdc/ntpdc-opts.c@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpdc/ntpdc-opts.h@1.23 +3 -3
+ NTP_4_2_7P22
+
+ ntpdc/ntpdc-opts.texi@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpdc/ntpdc.1@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpq/ntpq-opts.c@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpq/ntpq-opts.h@1.23 +3 -3
+ NTP_4_2_7P22
+
+ ntpq/ntpq-opts.texi@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpq/ntpq.1@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.23 +2 -2
+ NTP_4_2_7P22
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.23 +3 -3
+ NTP_4_2_7P22
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.23 +1 -1
+ NTP_4_2_7P22
+
+ ntpsnmpd/ntpsnmpd.1@1.23 +2 -2
+ NTP_4_2_7P22
+
+ packageinfo.sh@1.24 +1 -1
+ NTP_4_2_7P22
+
+ sntp/sntp-opts.c@1.23 +2 -2
+ NTP_4_2_7P22
+
+ sntp/sntp-opts.h@1.23 +3 -3
+ NTP_4_2_7P22
+
+ sntp/sntp-opts.texi@1.23 +2 -2
+ NTP_4_2_7P22
+
+ sntp/sntp.1@1.23 +2 -2
+ NTP_4_2_7P22
+
+ sntp/sntp.html@1.23 +1 -1
+ NTP_4_2_7P22
+
+ util/ntp-keygen-opts.c@1.23 +2 -2
+ NTP_4_2_7P22
+
+ util/ntp-keygen-opts.h@1.23 +3 -3
+ NTP_4_2_7P22
+
+ util/ntp-keygen-opts.texi@1.23 +2 -2
+ NTP_4_2_7P22
+
+ util/ntp-keygen.1@1.23 +2 -2
+ NTP_4_2_7P22
+
+ChangeSet@1.2082.4.69, 2010-04-01 03:33:20-04:00, stenn@deacon.udel.edu
+ lose whimsy from br-flock
+
+ br-flock@1.13 +1 -1
+ lose whimsy from br-flock
+
+ChangeSet@1.2112.1.11, 2010-04-01 03:20:04-04:00, stenn@deacon.udel.edu
+ [Bug 1465] Make sure time from TS2100 is not invalid
+
+ ChangeLog@1.547 +1 -0
+ [Bug 1465] Make sure time from TS2100 is not invalid
+
+ ntpd/refclock_true.c@1.12 +2 -1
+ [Bug 1465] Make sure time from TS2100 is not invalid
+
+ChangeSet@1.2112.1.10, 2010-04-01 03:13:14-04:00, stenn@deacon.udel.edu
+ [Bug 1432] Don't set inheritable flag for linux capabilities
+
+ ChangeLog@1.546 +1 -0
+ [Bug 1432] Don't set inheritable flag for linux capabilities
+
+ ntpd/ntpd.c@1.110.1.5 +2 -2
+ [Bug 1432] Don't set inheritable flag for linux capabilities
+
+ChangeSet@1.2112.2.7, 2010-03-31 09:16:48+00:00, stenn@deacon.udel.edu
+ NTP_4_2_7P21
+ TAG: NTP_4_2_7P21
+
+ ChangeLog@1.543.1.3 +1 -0
+ NTP_4_2_7P21
+
+ ntpd/ntpd-opts.c@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpd/ntpd-opts.h@1.22 +3 -3
+ NTP_4_2_7P21
+
+ ntpd/ntpd-opts.texi@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpd/ntpd.1@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpdc/ntpdc-opts.c@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpdc/ntpdc-opts.h@1.22 +3 -3
+ NTP_4_2_7P21
+
+ ntpdc/ntpdc-opts.texi@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpdc/ntpdc.1@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpq/ntpq-opts.c@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpq/ntpq-opts.h@1.22 +3 -3
+ NTP_4_2_7P21
+
+ ntpq/ntpq-opts.texi@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpq/ntpq.1@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.22 +2 -2
+ NTP_4_2_7P21
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.22 +3 -3
+ NTP_4_2_7P21
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.22 +2 -23
+ NTP_4_2_7P21
+
+ ntpsnmpd/ntpsnmpd.1@1.22 +2 -2
+ NTP_4_2_7P21
+
+ packageinfo.sh@1.23 +1 -1
+ NTP_4_2_7P21
+
+ sntp/sntp-opts.c@1.22 +2 -2
+ NTP_4_2_7P21
+
+ sntp/sntp-opts.h@1.22 +3 -3
+ NTP_4_2_7P21
+
+ sntp/sntp-opts.texi@1.22 +2 -2
+ NTP_4_2_7P21
+
+ sntp/sntp.1@1.22 +2 -2
+ NTP_4_2_7P21
+
+ sntp/sntp.html@1.22 +10 -14
+ NTP_4_2_7P21
+
+ util/ntp-keygen-opts.c@1.22 +2 -2
+ NTP_4_2_7P21
+
+ util/ntp-keygen-opts.h@1.22 +3 -3
+ NTP_4_2_7P21
+
+ util/ntp-keygen-opts.texi@1.22 +2 -2
+ NTP_4_2_7P21
+
+ util/ntp-keygen.1@1.22 +2 -2
+ NTP_4_2_7P21
+
+ChangeSet@1.2082.4.68, 2010-03-31 08:45:31+00:00, stenn@deacon.udel.edu
+ NTP_4_2_6P1_RC6
+ TAG: NTP_4_2_6P1_RC6
+
+ ChangeLog@1.496.26.46 +1 -0
+ NTP_4_2_6P1_RC6
+
+ ntpd/ntpd-opts.c@1.248.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpd/ntpd-opts.h@1.248.6.1 +3 -3
+ NTP_4_2_6P1_RC6
+
+ ntpd/ntpd-opts.texi@1.246.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpd/ntpd.1@1.246.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpdc/ntpdc-opts.c@1.244.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpdc/ntpdc-opts.h@1.244.6.1 +3 -3
+ NTP_4_2_6P1_RC6
+
+ ntpdc/ntpdc-opts.texi@1.243.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpdc/ntpdc.1@1.243.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpq/ntpq-opts.c@1.245.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpq/ntpq-opts.h@1.245.6.1 +3 -3
+ NTP_4_2_6P1_RC6
+
+ ntpq/ntpq-opts.texi@1.244.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpq/ntpq.1@1.244.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.6.1 +3 -3
+ NTP_4_2_6P1_RC6
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.6.1 +2 -23
+ NTP_4_2_6P1_RC6
+
+ ntpsnmpd/ntpsnmpd.1@1.122.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ packageinfo.sh@1.255.8.1 +1 -1
+ NTP_4_2_6P1_RC6
+
+ sntp/sntp-opts.c@1.117.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ sntp/sntp-opts.h@1.117.6.1 +3 -3
+ NTP_4_2_6P1_RC6
+
+ sntp/sntp-opts.texi@1.117.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ sntp/sntp.1@1.117.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ sntp/sntp.html@1.7.6.1 +10 -14
+ NTP_4_2_6P1_RC6
+
+ util/ntp-keygen-opts.c@1.247.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ util/ntp-keygen-opts.h@1.247.6.1 +3 -3
+ NTP_4_2_6P1_RC6
+
+ util/ntp-keygen-opts.texi@1.246.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ util/ntp-keygen.1@1.246.6.1 +2 -2
+ NTP_4_2_6P1_RC6
+
+ChangeSet@1.2082.4.67, 2010-03-31 04:14:28-04:00, stenn@deacon.udel.edu
+ Quiet some trigger debugging
+
+ BitKeeper/triggers/triggert@1.6.1.2 +1 -1
+ Quiet some trigger debugging
+
+ChangeSet@1.2082.4.66, 2010-03-31 04:11:55-04:00, stenn@deacon.udel.edu
+ [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4
+
+ ChangeLog@1.496.26.45 +1 -0
+ [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4
+
+ ntpd/ntp_proto.c@1.297.2.1 +1 -1
+ [Bug 1514] Typo in ntp_proto.c: fabs(foo < .4) should be fabs(foo) < .4
+
+ChangeSet@1.2082.4.65, 2010-03-31 03:17:27-04:00, stenn@deacon.udel.edu
+ trigger cleanup
+
+ BitKeeper/triggers/trigger.README@1.4.1.1 +5 -3
+ trigger cleanup
+
+ BitKeeper/triggers/trigger.cfg@1.12.1.1 +6 -0
+ trigger cleanup
+
+ BitKeeper/triggers/trigger.mk@1.9.1.1 +3 -1
+ trigger cleanup
+
+ BitKeeper/triggers/triggert@1.6.1.1 +17 -6
+ trigger cleanup
+
+ChangeSet@1.2112.2.3, 2010-03-31 03:13:36-04:00, stenn@deacon.udel.edu
+ trigger cleanup
+
+ BitKeeper/triggers/trigger.README@1.5 +5 -3
+ trigger cleanup
+
+ BitKeeper/triggers/trigger.cfg@1.13 +6 -0
+ trigger cleanup
+
+ BitKeeper/triggers/trigger.mk@1.10 +3 -1
+ trigger cleanup
+
+ BitKeeper/triggers/triggert@1.7 +17 -6
+ trigger cleanup
+
+ChangeSet@1.2082.4.64, 2010-03-29 05:16:32-04:00, stenn@deacon.udel.edu
+ With the new bk, the trigger push needs the -q (quiet) flag
+
+ BitKeeper/triggers/2mirrors@1.5 +3 -3
+ With the new bk, the trigger push needs the -q (quiet) flag
+
+ChangeSet@1.2112.2.1, 2010-03-25 23:40:34-04:00, stenn@deacon.udel.edu
+ whitespace cleanup
+
+ html/copyright.html@1.48 +1 -1
+ whitespace cleanup
+
+ChangeSet@1.2112.1.8, 2010-03-25 16:12:20+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq-subs.c:
+ Add ntpq "mrulist limited" and "mrulist kod" support, equivalent to
+ ntpq -c "mrulist resany=0x20" and ntpq -c "mrulist resany=0x400"
+ respectively.
+ Add "r" rate limiting column to mrulist output containing a period,
+ or K for KoD sent in response to last packet, or L for no response
+ to last packet due to rate limiting. These are redundant with bits
+ 0x400 and 0x20 in the rstr column and treated differently than other
+ restrict bits, reflecting not if the restriction bit is enabled for
+ the remote address, but if RES_KOD or RES_LIMITED handling was
+ triggered by the last packet from them.
+ it.
+ ntp.h, ntpdc_ops.c, ntp_proto.c, ntp_config.c:
+ rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
+ drops 10% of incoming packets from matching addresses).
+ ntp_intres.c:
+ rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
+ drops 10% of incoming packets from matching addresses), eliminating
+ conflict with RES_TIMEOUT provided by some systems DNS headers.
+
+ include/ntp.h@1.177 +2 -2
+ rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
+ drops 10% of incoming packets from matching addresses).
+
+ ntpd/ntp_config.c@1.257 +1 -1
+ rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
+ drops 10% of incoming packets from matching addresses).
+
+ ntpd/ntp_intres.c@1.87 +0 -3
+ rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
+ drops 10% of incoming packets from matching addresses), eliminating
+ conflict with RES_TIMEOUT provided by some systems DNS headers.
+
+ ntpd/ntp_proto.c@1.297.1.12 +1 -1
+ rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
+ drops 10% of incoming packets from matching addresses).
+
+ ntpdc/ntpdc_ops.c@1.66 +1 -1
+ rename RES_TIMEOUT to RES_FLAKE to reflect v4 use (as a flakeway which
+ drops 10% of incoming packets from matching addresses).
+
+ ntpq/ntpq-subs.c@1.64 +25 -5
+ Add ntpq "mrulist limited" and "mrulist kod" support, equivalent to
+ ntpq -c "mrulist resany=0x20" and ntpq -c "mrulist resany=0x400"
+ respectively.
+ Add "r" rate limiting column to mrulist output containing a period,
+ or K for KoD sent in response to last packet, or L for no response
+ to last packet due to rate limiting. These are redundant with bits
+ 0x400 and 0x20 in the rstr column and treated differently than other
+ restrict bits, reflecting not if the restriction bit is enabled for
+ the remote address, but if RES_KOD or RES_LIMITED handling was
+ triggered by the last packet from them.
+ it.
+
+ChangeSet@1.2112.1.7, 2010-03-25 13:28:10+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_control.c:
+ use ctl_putts() instead of handrolled equivalent for read_mru_list().
+
+ ntpd/ntp_control.c@1.136 +9 -23
+ use ctl_putts() instead of handrolled equivalent for read_mru_list().
+
+ChangeSet@1.2112.1.6, 2010-03-25 03:54:17+00:00, davehart@shiny.ad.hartbrothers.com
+ ssl_init.c:
+ MAX_MAC_LEN will always be > sizeof(keyid_t) so make max_digest_len
+ const u_long instead of u_long, initialize unconditionally.
+
+ libntp/ssl_init.c@1.7 +7 -8
+ MAX_MAC_LEN will always be > sizeof(keyid_t) so make max_digest_len
+ const u_long instead of u_long, initialize unconditionally.
+
+ChangeSet@1.2110.1.30, 2010-03-25 01:42:06+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ Catch up ChangeLog with several weeks' changes.
+ ntpq-subs.c, ntp_peer.c, ntp_io.c, ntp_proto.c:
+ debug message cleanup for integration with ntp-dev
+
+ ChangeLog@1.541.1.2 +64 -1
+ Catch up ChangeLog with several weeks' changes.
+
+ ntpd/ntp_io.c@1.318 +2 -2
+ debug message cleanup for integration with ntp-dev
+
+ ntpd/ntp_peer.c@1.133 +0 -3
+ debug message cleanup for integration with ntp-dev
+
+ ntpd/ntp_proto.c@1.297.1.11 +1 -2
+ debug message cleanup for integration with ntp-dev
+
+ ntpq/ntpq-subs.c@1.63 +13 -14
+ debug message cleanup for integration with ntp-dev
+
+ChangeSet@1.2112.1.4, 2010-03-24 22:46:41+01:00, jnperlin@hydra.localnet
+ ntpq.c:
+ fix printf format warnings
+
+ ntpq/ntpq.c@1.100.1.1 +6 -6
+ fix printf format warnings
+
+ChangeSet@1.2112.1.3, 2010-03-24 20:04:35+01:00, jnperlin@hydra.localnet
+ ssl_init.c:
+ cast size_t expressions to u_long in formatting
+
+ libntp/ssl_init.c@1.6 +3 -3
+ cast size_t expressions to u_long in formatting
+
+ChangeSet@1.2112.1.2, 2010-03-23 22:05:52+01:00, jnperlin@hydra.localnet
+ ssl_init.c:
+ fixed printf format warnings
+
+ libntp/ssl_init.c@1.5 +7 -5
+ fixed printf format warnings
+
+ChangeSet@1.2112.1.1, 2010-03-23 20:40:52+01:00, jnperlin@hydra.localnet
+ ntp_fp.h:
+ fix prototype for 'dolfptoa'
+ dolfptoa.c:
+ avoid pointer wrap-around warnings, fixed prototype,
+ did some rework to make the implementation cleaner.
+
+ include/ntp_fp.h@1.16.1.1 +1 -1
+ fix prototype for 'dolfptoa'
+
+ libntp/dolfptoa.c@1.8 +62 -101
+ avoid pointer wrap-around warnings, fixed prototype,
+ did some rework to make the implementation cleaner.
+
+ChangeSet@1.2110.1.29, 2010-03-19 22:26:01+00:00, davehart@shiny.ad.hartbrothers.com
+ remove unused PEVNT_TAI
+
+ include/ntp.h@1.176 +0 -1
+ remove unused PEVNT_TAI
+
+ libntp/statestr.c@1.20 +0 -1
+ remove unused PEVNT_TAI
+
+ChangeSet@1.2110.1.28, 2010-03-19 04:09:05+00:00, davehart@shiny.ad.hartbrothers.com
+ Fine-tune "ntpq -c mrulimit" row limit backoff and growth after
+ testing over WiFi and a lossy go6.net UDP tunnel.
+
+ include/ntp.h@1.175 +2 -0
+ Add MRU_ROW_LIMIT to share between ntp_control.c and ntpq-subs.c
+
+ libntp/authusekey.c@1.9 +3 -5
+ eliminate redundant strlen()
+
+ ntpd/ntp_control.c@1.133.1.14 +2 -2
+ Add MRU_ROW_LIMIT to share between ntp_control.c and ntpq-subs.c,
+ use CERR_BADVALUE for error when exceeded.
+
+ ntpq/ntpq-subs.c@1.62 +11 -4
+ Add MRU_ROW_LIMIT to share between ntp_control.c and ntpq-subs.c,
+ use CERR_BADVALUE for error when exceeded.
+ Fine-tune row limit backoff and growth after testing over WiFi
+ and a lossy go6.net UDP tunnel.
+
+ ntpq/ntpq.c@1.110 +33 -17
+ Increase timeout for 2nd and later response packets from 2s to 3s,
+ elaborate on ntpq timeout behavior in comment.
+ Improve debug output in the case of a missing packet while
+ reassembling a response, making it easier to spot the hole.
+
+ ntpq/ntpq.h@1.15 +18 -2
+ Lower MAXFRAGS from experimental (never committed) 64 to 32, still
+ an increase over the historical value 24. Add comments exploring
+ impact of adjusting MAXFRAGS.
+
+ ports/winnt/include/config.h@1.86 +1 -1
+ note HAVE_STRCHR is left in for libopts (NTP itself requires
+ ANSI C which mandates strchr()).
+
+ChangeSet@1.2110.1.27, 2010-03-12 21:25:12+00:00, davehart@shiny.ad.hartbrothers.com
+ add "ntpq -c ifstats" modeled on "ntpdc -c ifstats"
+
+ include/ntp_control.h@1.45 +2 -1
+ add "ntpq -c ifstats" modeled on "ntpdc -c ifstats"
+
+ include/ntpd.h@1.137.1.13 +2 -0
+ add "ntpq -c ifstats" modeled on "ntpdc -c ifstats"
+
+ ntpd/ntp_control.c@1.133.1.13 +224 -47
+ add "ntpq -c ifstats" modeled on "ntpdc -c ifstats"
+
+ ntpd/ntp_io.c@1.317 +14 -9
+ expose sys_ifnum to ntp_control.c for ntpq -c ifstats.
+ add code to test if reset of addr_refid is needed.
+
+ ntpd/ntp_scanner.c@1.33 +3 -3
+ Do not abort on non-ASCII character in ntp.conf, ignore it.
+
+ ntpdc/ntpdc.c@1.82 +8 -11
+ correct "passwd" to only examine arg if present.
+
+ ntpq/ntpq-subs.c@1.61 +321 -45
+ add "ntpq -c ifstats" modeled on "ntpdc -c ifstats"
+
+ ntpq/ntpq.c@1.109 +13 -10
+ allow ntpq -c "passwd MYPASS" as with ntpdc
+
+ChangeSet@1.2110.1.26, 2010-03-10 03:02:42+00:00, davehart@shiny.ad.hartbrothers.com
+ Fetch 32 rows initially in ntpq -cmrulist.
+ Tweak runtime adjustment of limit in response to errors, now
+ will grow number of rows 50% each success and cut it in
+ half each failure.
+ Sleep 0.3s instead of 1s between requests in ntpq -cmrulist
+ on platforms that have nanosleep() or similar.
+
+ configure.ac@1.481 +34 -36
+ test for nanosleep() for ntpq -c mrulist
+
+ ntpd/ntp_control.c@1.133.1.12 +2 -2
+ change row limit for read_mru_list() to 256
+
+ ntpq/ntpq-subs.c@1.60 +14 -5
+ Fetch 32 rows initially in ntpq -cmrulist.
+ Tweak runtime adjustment of limit in response to errors, now
+ will grow number of rows 50% each success and cut it in
+ half each failure.
+ Sleep 0.3s instead of 1s between requests in ntpq -cmrulist
+ on platforms that have nanosleep() or similar.
+
+ChangeSet@1.2110.1.25, 2010-03-09 15:32:25+00:00, davehart@shiny.ad.hartbrothers.com
+ add "sort=count", "sort=-count" options to ntpq -c mrulist.
+
+ ntpq/ntpq-subs.c@1.59 +43 -0
+ add "sort=count", "sort=-count" options to ntpq -c mrulist.
+
+ChangeSet@1.2110.1.24, 2010-03-09 15:11:28+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq-subs.c:
+ use "sort=lstint" and "sort=-lstint" for default and reverse
+ default sort order of "ntpq -c mrulist"
+ ntp_control.c:
+ Attempt to enforce clients ignoring unknown tag=value pairs
+ in CTL_OP_READ_MRU (ntpq -c mrulist) by including a randomly-
+ named tag in the last row.
+
+ ntpd/ntp_control.c@1.133.1.11 +36 -10
+ Attempt to enforce clients ignoring unknown tag=value pairs
+ in CTL_OP_READ_MRU (ntpq -c mrulist) by including a randomly-
+ named tag in the last row.
+
+ ntpq/ntpq-subs.c@1.58 +2 -2
+ use "sort=lstint" and "sort=-lstint" for default and reverse
+ default sort order of "ntpq -c mrulist"
+
+ChangeSet@1.2110.1.23, 2010-03-09 03:32:38+00:00, davehart@shiny.ad.hartbrothers.com
+ add reverse sorting to ntpq -c mrulist, generalize.
+
+ include/ntp_lists.h@1.6 +15 -4
+ add REV_ITER_DLIST_BEGIN/END macros
+
+ ntpd/refclock_neoclock4x.c@1.18 +10 -10
+ leftover const chasing
+
+ ntpq/ntpq-subs.c@1.57 +94 -25
+ add reverse sorting to ntpq -c mrulist, generalize.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.27 +4 -0
+ add reference to ntpd/refclock_neoclock4x.c
+
+ChangeSet@1.2110.1.22, 2010-03-09 01:53:35+00:00, davehart@shiny.ad.hartbrothers.com
+ Add "sort=avgint" option to mrulist: ntpq -c "mru sort=avgint".
+ Add "sort=addr" option to mrulist to sort by remote address.
+ Remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ configure.ac@1.480 +0 -26
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ include/ntp_net.h@1.7 +5 -0
+ add SIZEOF_INADDR(family) macro to fetch sizeof either
+ struct in_addr or struct in_addr6.
+
+ ntpd/keyword-gen.c@1.10 +10 -16
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ ntpd/ntp_refclock.c@1.91.1.4 +1 -29
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ ntpd/refclock_msfees.c@1.14 +3 -23
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ ntpd/refclock_mx4200.c@1.26 +0 -4
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ ntpdc/ntpdc.c@1.81 +22 -43
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ ntpq/ntpq-subs.c@1.56 +164 -17
+ Add "sort=avgint" option to mrulist: ntpq -c "mru sort=avgint".
+ Add "sort=addr" option to mrulist to sort by remote address.
+ Remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ ntpq/ntpq.c@1.108 +11 -53
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ ports/winnt/include/config.h@1.85 +2 -2
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ util/hist.c@1.8 +16 -19
+ remove check for qsort() using other than void *, ANSI C is
+ required and it ensures void * for qsort().
+
+ChangeSet@1.2110.1.21, 2010-03-08 21:23:01+00:00, davehart@shiny.ad.hartbrothers.com
+ add support for filtering MRU list by interface (local addr):
+ ntpq -c "mru laddr=192.168.1.1"
+
+ include/ntpd.h@1.137.1.12 +3 -2
+ expose ntp_io.c getinterface() for ntp_control.c use.
+
+ ntpd/ntp_control.c@1.133.1.10 +133 -50
+ add support for filtering MRU list by interface (local addr):
+ ntpq -c "mru laddr=192.168.1.1"
+
+ ntpd/ntp_io.c@1.316 +1 -2
+ expose ntp_io.c getinterface() for ntp_control.c use.
+
+ ntpq/ntpq-subs.c@1.55 +7 -5
+ add support for filtering MRU list by interface (local addr):
+ ntpq -c "mru laddr=192.168.1.1"
+
+ChangeSet@1.2110.1.20, 2010-03-08 10:44:22+00:00, davehart@shiny.ad.hartbrothers.com
+ add "ntpq -c sysstats" modeled on "ntpdc -c sysstats"
+
+ include/ntp_control.h@1.44 +13 -2
+ expose variables needed for "ntpq -c sysstats" similar to "ntpdc -c sysstats"
+
+ ntpd/ntp_control.c@1.133.1.9 +74 -20
+ expose variables needed for "ntpq -c sysstats" similar to "ntpdc -c sysstats"
+
+ ntpd/ntp_proto.c@1.297.1.10 +2 -1
+ reset sys_kodsent in proto_clr_stats().
+
+ ntpd/ntp_request.c@1.90 +0 -3
+ remove no longer relevant comment
+
+ ntpq/libntpq.c@1.4 +106 -95
+ const chasing
+
+ ntpq/libntpq.h@1.4 +25 -17
+ const chasing
+
+ ntpq/libntpq_subs.c@1.3 +14 -3
+ const chasing
+
+ ntpq/ntpq-subs.c@1.54 +143 -48
+ add "ntpq -c sysstats" modeled on "ntpdc -c sysstats"
+
+ ntpq/ntpq.c@1.107 +26 -23
+ const chasing
+
+ ntpq/ntpq.h@1.14 +4 -4
+ const chasing
+
+ChangeSet@1.2110.1.19, 2010-03-07 20:01:29+00:00, davehart@shiny.ad.hartbrothers.com
+ rate limit ntpdate packets to 2s interval per server to stay
+ within the "restrict ... limited" default limit set by
+ "discard minimum 1", plus 1s of enforcement slop.
+ Respect KoD rate-limiting responses from ntpd.
+
+
+ ntpdate/ntpdate.c@1.73 +39 -11
+ rate limit ntpdate packets to 2s interval per server to stay
+ within the "restrict ... limited" default limit set by
+ "discard minimum 1", plus 1s of enforcement slop.
+ Respect KoD rate-limiting responses from ntpd.
+
+
+ ntpdate/ntpdate.h@1.11 +2 -1
+ rate limit ntpdate packets to 2s interval per server to stay
+ within the "restrict ... limited" default limit set by
+ "discard minimum 1", plus 1s of enforcement slop.
+
+ChangeSet@1.2110.1.18, 2010-03-07 17:36:49+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_util.c:
+ whitespace only
+ ntpq-subs.c:
+ split mrulist() into mrulist() and collect_mru_list().
+ adjust row limit based on success/failure of individual
+ queries for collect_mru_list().
+ revert to one MRU entry per IP address regardless of port.
+ ntp_monitor.c:
+ correct MRU list preemption logic.
+ revert to one MRU entry per IP address regardless of port.
+ ntp_control.h, ntp_control.c:
+ add "kod_sent" non-default system variable for sys_kodsent.
+ config.h:
+ #undef STRINGIZE after use to avoid accidentally using on
+ Windows without noticing it's specific to Windows port.
+ ntpq.c, ntpq.h:
+ move definitions to ntpq.h needed by mrulist code in
+ ntpq-subs.h.
+
+ include/ntp_control.h@1.43 +11 -9
+ add "kod_sent" non-default system variable for sys_kodsent.
+
+ ntpd/ntp_control.c@1.133.1.8 +66 -21
+ add "kod_sent" non-default system variable for sys_kodsent.
+
+ ntpd/ntp_monitor.c@1.33 +10 -3
+ correct MRU list preemption logic.
+ revert to one MRU entry per IP address regardless of port.
+
+ ntpd/ntp_util.c@1.81 +1 -1
+ whitespace only
+
+ ntpq/ntpq-subs.c@1.53 +155 -46
+ split mrulist() into mrulist() and collect_mru_list().
+ adjust row limit based on success/failure of individual
+ queries for collect_mru_list().
+ revert to one MRU entry per IP address regardless of port.
+
+ ntpq/ntpq.c@1.106 +4 -9
+ move definitions to ntpq.h needed by mrulist code in
+ ntpq-subs.h.
+
+ ntpq/ntpq.h@1.13 +11 -1
+ move definitions to ntpq.h needed by mrulist code in
+ ntpq-subs.h.
+
+ ports/winnt/include/config.h@1.84 +2 -0
+ #undef STRINGIZE after use to avoid accidentally using on
+ Windows without noticing it's specific to Windows port.
+
+ChangeSet@1.2110.1.17, 2010-03-05 19:22:27+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq-subs.c:
+ use ========= instead of --------- to separate column headings
+ from rows in mrulist().
+ ntp_config.c:
+ unpeer by hostname, needed to unpeer pool prototype
+ assocations.
+
+ ntpd/ntp_config.c@1.256 +72 -78
+ unpeer by hostname, needed to unpeer pool prototype
+ assocations.
+
+ ntpq/ntpq-subs.c@1.52 +1 -1
+ use ========= instead of --------- to separate column headings
+ from rows in mrulist().
+
+ChangeSet@1.2110.1.16, 2010-03-04 17:17:47+00:00, davehart@shiny.ad.hartbrothers.com
+ new "ntpq -c mrulist" along lines of "ntpdc -c monlist" but
+ without being limited to a single request response, and
+ designed to work reliably even with an arbitrarily large
+ MRU list.
+
+ include/ntp_fp.h@1.18 +1 -0
+ add sptoa()/sockporttoa() similar to stoa()/socktoa().
+
+ include/ntp_lists.h@1.5 +27 -5
+ add NEXT_DLIST(), PREV_DLIST(), LINK_TAIL_DLIST() macros.
+
+ include/ntp_stdlib.h@1.44 +3 -1
+ move sock_hash from ntpd/ntp_util.c to libntp/socktoa.c so
+ ntpq can use it.
+ add sptoa()/sockporttoa() similar to stoa()/socktoa().
+
+ include/ntpd.h@1.137.1.11 +6 -2
+ move sock_hash from ntpd/ntp_util.c to libntp/socktoa.c so
+ ntpq can use it.
+ expose MON_HASH(), mon_hash[] so ntp_control.c can use them.
+
+ libntp/decodenetnum.c@1.12 +40 -8
+ support 1.2.3.4:123, [2001::1]:123 port specification in
+ decodenetnum().
+
+ libntp/socktoa.c@1.12 +72 -2
+ move sock_hash from ntpd/ntp_util.c to libntp/socktoa.c so
+ ntpq can use it.
+ add sptoa()/sockporttoa() similar to stoa()/socktoa().
+
+ ntpd/ntp_control.c@1.133.1.7 +221 -21
+ read_mru_list() for ntpq -c mrulist
+
+ ntpd/ntp_monitor.c@1.32 +2 -5
+ expose MON_HASH(), mon_hash[] so ntp_control.c can use them.
+
+ ntpd/ntp_restrict.c@1.32 +2 -1
+ correct type for restrictions() local flags to u_short.
+
+ ntpd/ntp_util.c@1.80 +4 -50
+ move sock_hash from ntpd/ntp_util.c to libntp/socktoa.c so
+ ntpq can use it.
+ use memcpy() instead of memmove() when buffers can't overlap.
+
+ ntpq/ntpq-subs.c@1.51 +430 -28
+ new "ntpq -c mrulist" along lines of "ntpdc -c monlist" but
+ without being limited to a single request response, and
+ designed to work reliably even with an arbitrarily large
+ MRU list.
+
+ ntpq/ntpq.c@1.105 +100 -51
+ bump MAXFRAGS from 24 to 64 to enable larger responses.
+ add show_error_msg(), doqueryex() for mrulist().
+
+
+ ntpq/ntpq.h@1.12 +11 -2
+ add show_error_msg(), doqueryex() for mrulist().
+
+ChangeSet@1.2110.1.15, 2010-03-02 10:00:34+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_net.h:
+ add ADDR_EQ_PORT() like SOCK_EQ() but testing port as well.
+ ntpq-subs.c, ntpq.c, ntpq.h:
+ use associd_t for association IDs instead of int.
+ systime.c, ntp_fp.h:
+ provide callback from step_systime() to allow ntpd to flush
+ the MRU list when stepping the clock.
+ ntp_proto.c:
+ use u_short for restrict_mask type in receive(), expand comment.
+ ntp_util.c:
+ Use callback from step_systime() to flush the MRU list when
+ stepping the clock. Previously the MRU timestamps were in
+ current_time units, which are monotonically increasing despite
+ any steps of the system clock. Now they are l_fp and subject
+ to steps, so flush the MRU list when the clock is stepped to
+ ensure all timestamps are comparable.
+ recvbuff.h:
+ whitespace only
+ ntp_request.c:
+ prepare for ntpq mrulist command by converting MRU entry timestamps
+ from current_time (seconds) to l_fp (32:32 NTP standard).
+ rename info_monitor, info_monitor_1 fields to reflect their
+ use, lasttime -> avg_int and firsttime -> last_int.
+ ntp_iocompletionport.c:
+ validate recv_srcadr_len against (now smaller) sockaddr_u size.
+ ntp_control.h:
+ add CTL_OP_READMRU for ntpq mrulist
+ ntpd.h:
+ add prototype for win_time_stepped(), previously called
+ time_stepped().
+ ntp_control.c:
+ add CTL_OP_READ_MRU for ntpq -c mrulist
+ layout.std, ntpdc_ops.c:
+ rename info_monitor, info_monitor_1 fields to reflect their
+ use, lasttime -> avg_int and firsttime -> last_int
+ ntp_restrict.c:
+ wrap a long line
+ ntp_monitor.c, ntp.h:
+ prepare for ntpq mrulist command by converting MRU entry timestamps
+ from current_time (seconds) to l_fp (32:32 NTP standard).
+ ntp_request.h:
+ rename info_monitor, info_monitor_1 fields to reflect their
+ use, lasttime -> avg_int and firsttime -> last_int.
+ SetSystemTime.c, nt_clockstuff.c, clockstuff.h:
+ rename time_stepped() callback to win_time_stepped(), move
+ callback registration from Windows port to portable code
+ now that ntpd/ntp_util.c is using it.
+
+ include/ntp.h@1.174 +7 -7
+ prepare for ntpq mrulist command by converting MRU entry timestamps
+ from current_time (seconds) to l_fp (32:32 NTP standard).
+
+ include/ntp_control.h@1.42 +5 -4
+ add CTL_OP_READMRU for ntpq mrulist
+
+ include/ntp_fp.h@1.17 +8 -2
+ provide callback from step_systime() to allow ntpd to flush
+ the MRU list when stepping the clock.
+
+ include/ntp_net.h@1.6 +7 -1
+ add ADDR_EQ_PORT() like SOCK_EQ() but testing port as well.
+
+ include/ntp_request.h@1.41 +5 -5
+ rename info_monitor, info_monitor_1 fields to reflect their
+ use, lasttime -> avg_int and firsttime -> last_int.
+
+ include/ntpd.h@1.137.1.10 +7 -3
+ add prototype for win_time_stepped(), previously called
+ time_stepped().
+
+ include/recvbuff.h@1.21 +1 -1
+ whitespace only
+
+ libntp/systime.c@1.50 +3 -0
+ provide callback from step_systime() to allow ntpd to flush
+ the MRU list when stepping the clock.
+
+ ntpd/ntp_control.c@1.133.1.6 +93 -3
+ add CTL_OP_READ_MRU for ntpq -c mrulist
+
+ ntpd/ntp_monitor.c@1.31 +117 -102
+ prepare for ntpq mrulist command by converting MRU entry timestamps
+ from current_time (seconds) to l_fp (32:32 NTP standard).
+
+ ntpd/ntp_proto.c@1.297.1.9 +3 -1
+ use u_short for restrict_mask type in receive(), expand comment.
+
+ ntpd/ntp_request.c@1.89 +23 -13
+ prepare for ntpq mrulist command by converting MRU entry timestamps
+ from current_time (seconds) to l_fp (32:32 NTP standard).
+ rename info_monitor, info_monitor_1 fields to reflect their
+ use, lasttime -> avg_int and firsttime -> last_int.
+
+ ntpd/ntp_restrict.c@1.31 +3 -2
+ wrap a long line
+
+ ntpd/ntp_util.c@1.79 +37 -8
+ Use callback from step_systime() to flush the MRU list when
+ stepping the clock. Previously the MRU timestamps were in
+ current_time units, which are monotonically increasing despite
+ any steps of the system clock. Now they are l_fp and subject
+ to steps, so flush the MRU list when the clock is stepped to
+ ensure all timestamps are comparable.
+
+ ntpdc/layout.std@1.10 +4 -4
+ rename info_monitor, info_monitor_1 fields to reflect their
+ use, lasttime -> avg_int and firsttime -> last_int
+
+ ntpdc/ntpdc_ops.c@1.65 +4 -4
+ rename info_monitor, info_monitor_1 fields to reflect their
+ use, lasttime -> avg_int and firsttime -> last_int
+
+ ntpq/ntpq-subs.c@1.50 +25 -22
+ use associd_t for association IDs instead of int.
+
+ ntpq/ntpq.c@1.104 +4 -4
+ use associd_t for association IDs instead of int.
+
+ ntpq/ntpq.h@1.11 +1 -1
+ use associd_t for association IDs instead of int.
+
+ ports/winnt/include/clockstuff.h@1.11 +0 -11
+ rename time_stepped() callback to win_time_stepped(), move
+ callback registration from Windows port to portable code
+ now that ntpd/ntp_util.c is using it.
+
+ ports/winnt/libntp/SetSystemTime.c@1.9 +0 -5
+ rename time_stepped() callback to win_time_stepped(), move
+ callback registration from Windows port to portable code
+ now that ntpd/ntp_util.c is using it.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.42 +3 -9
+ rename time_stepped() callback to win_time_stepped(), move
+ callback registration from Windows port to portable code
+ now that ntpd/ntp_util.c is using it.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.53 +9 -5
+ validate recv_srcadr_len against (now smaller) sockaddr_u size.
+
+ChangeSet@1.2110.1.14, 2010-03-01 12:47:33+00:00, davehart@shiny.ad.hartbrothers.com
+ determine MRU hash table size at runtime, attempting to
+ average 8 entries per bucket at mru_maxdepth capacity.
+ adjust defaults for mru_maxdepth, mru_initmem.
+
+ include/ntp.h@1.173 +1 -1
+ determine MRU hash table size at runtime, attempting to
+ average 8 entries per bucket at mru_maxdepth capacity.
+
+ ntpd/ntp_monitor.c@1.30 +32 -10
+ determine MRU hash table size at runtime, attempting to
+ average 8 entries per bucket at mru_maxdepth capacity.
+ adjust defaults for mru_maxdepth, mru_initmem.
+
+ ntpd/ntp_util.c@1.78 +2 -3
+ determine MRU hash table size at runtime, attempting to
+ average 8 entries per bucket at mru_maxdepth capacity.
+
+ChangeSet@1.2110.1.13, 2010-03-01 09:20:28+00:00, davehart@shiny.ad.hartbrothers.com
+ remove bloated (128 byte on win32) sockaddr_storage from sockaddr_u
+ union since the largest we use is sockaddr_in6 (28 bytes on win32).
+
+ include/ntp_net.h@1.5 +2 -3
+ remove bloated (128 byte on win32) sockaddr_storage from sockaddr_u
+ union since the largest we use is sockaddr_in6 (28 bytes on win32).
+
+ ntpd/ntp_config.c@1.255 +1 -1
+ remove bloated (128 byte on win32) sockaddr_storage from sockaddr_u
+ union since the largest we use is sockaddr_in6 (28 bytes on win32).
+
+ ntpd/ntp_io.c@1.315 +3 -3
+ remove bloated (128 byte on win32) sockaddr_storage from sockaddr_u
+ union since the largest we use is sockaddr_in6 (28 bytes on win32).
+
+ ntpd/ntp_monitor.c@1.29 +5 -0
+ comment about mon_age implementation
+
+ ntpd/ntp_request.c@1.88 +10 -10
+ remove bloated (128 byte on win32) sockaddr_storage from sockaddr_u
+ union since the largest we use is sockaddr_in6 (28 bytes on win32).
+
+ ntpd/refclock_nmea.c@1.48 +0 -2
+ remove unused macros left over from distinct PPSAPI code
+
+ ntpdc/ntpdc_ops.c@1.64 +3 -3
+ remove bloated (128 byte on win32) sockaddr_storage from sockaddr_u
+ union since the largest we use is sockaddr_in6 (28 bytes on win32).
+
+ sntp/networking.c@1.32 +2 -2
+ remove bloated (128 byte on win32) sockaddr_storage from sockaddr_u
+ union since the largest we use is sockaddr_in6 (28 bytes on win32).
+
+ChangeSet@1.2110.1.12, 2010-02-27 23:34:22+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_proto.c:
+ broadcast demobilization fix from DLM
+
+ ntpd/ntp_proto.c@1.297.1.8 +4 -4
+ broadcast demobilization fix from DLM
+
+ChangeSet@1.2110.1.11, 2010-02-27 22:48:05+00:00, davehart@shiny.ad.hartbrothers.com
+ Many files:
+ more MRU knobs
+ ntp_keyword.h, keyword-gen-utd:
+ keyword-gen.c product
+ ntp_parser.h, ntp_parser.c:
+ ntp_parser.y product
+ ntp_request.c:
+ limit 'ntpdc -c monlist' response to most recent 600 entries, to
+ be consistent with the historical maximum MRU list size.
+ ntpq-subs.c:
+ read up to three named variables at once:
+ ntpq -c "rv 0 version mru_depth mru_maxmem"
+
+ include/ntp_control.h@1.41 +17 -9
+ more MRU knobs
+
+ include/ntpd.h@1.137.1.9 +11 -7
+ more MRU knobs
+
+ ntpd/complete.conf@1.6 +1 -1
+ more MRU knobs
+
+ ntpd/keyword-gen-utd@1.5 +1 -1
+ keyword-gen.c product
+
+ ntpd/keyword-gen.c@1.9 +5 -1
+ more MRU knobs
+
+ ntpd/ntp_config.c@1.254 +48 -15
+ more MRU knobs
+
+ ntpd/ntp_control.c@1.133.1.5 +59 -9
+ more MRU knobs
+
+ ntpd/ntp_keyword.h@1.7 +679 -657
+ keyword-gen.c product
+
+ ntpd/ntp_monitor.c@1.28 +145 -96
+ more MRU knobs
+
+ ntpd/ntp_parser.c@1.55 +992 -949
+ ntp_parser.y product
+
+ ntpd/ntp_parser.h@1.35 +247 -239
+ ntp_parser.y product
+
+ ntpd/ntp_parser.y@1.50 +12 -4
+ more MRU knobs
+
+ ntpd/ntp_request.c@1.87 +8 -2
+ limit 'ntpdc -c monlist' response to most recent 600 entries, to
+ be consistent with the historical maximum MRU list size.
+
+ ntpq/ntpq-subs.c@1.49 +12 -7
+ read up to three named variables at once:
+ ntpq -c "rv 0 version mru_depth mru_maxmem"
+
+ChangeSet@1.2110.1.10, 2010-02-27 10:03:55+00:00, davehart@shiny.ad.hartbrothers.com
+ keyword-gen.c:
+ include matching keyword prefix in ntp_keyword.h state entry comment.
+
+ ntpd/keyword-gen-utd@1.4 +1 -1
+ product of keyword-gen.c
+
+ ntpd/keyword-gen.c@1.8 +70 -13
+ include matching keyword prefix in ntp_keyword.h state entry comment.
+
+ ntpd/ntp_keyword.h@1.6 +579 -579
+ product of keyword-gen.c
+
+ChangeSet@1.2110.1.9, 2010-02-27 08:47:04+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_parser.h, ntp_parser.c:
+ product of ntp_parser.y
+ keyword-gen-utd:
+ accompanies new keyword-gen.c and ntp_keyword.h
+ Many files:
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+ ntp.h, ntp_request.c:
+ remove redundant storage of port in mon_entry, rmtadr has it.
+ ntp_keyword.h:
+ product of keyword-gen.c
+
+ include/ntp.h@1.172 +0 -1
+ remove redundant storage of port in mon_entry, rmtadr has it.
+
+ include/ntp_config.h@1.66.1.5 +1 -0
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+
+ include/ntpd.h@1.137.1.8 +4 -1
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+
+ ntpd/complete.conf@1.5 +2 -1
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+
+ ntpd/keyword-gen-utd@1.3 +1 -1
+ accompanies new keyword-gen.c and ntp_keyword.h
+
+ ntpd/keyword-gen.c@1.7 +6 -0
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+
+ ntpd/ntp_config.c@1.253 +67 -4
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+
+ ntpd/ntp_keyword.h@1.5 +534 -513
+ product of keyword-gen.c
+
+ ntpd/ntp_monitor.c@1.27 +61 -32
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+
+ ntpd/ntp_parser.c@1.54 +973 -897
+ product of ntp_parser.y
+
+ ntpd/ntp_parser.h@1.34 +191 -181
+ product of ntp_parser.y
+
+ ntpd/ntp_parser.y@1.49 +25 -0
+ add MRU sizing knobs:
+ mru mindepth 600 maxage 64 maxdepth 1024 maxmem 4096
+ entries beyond 600 which are older than 64s are reclaimed,
+ with a hard upper limit on the size of maxdepth (indirectly
+ set by maxmem).
+
+ ntpd/ntp_request.c@1.86 +2 -2
+ remove redundant storage of port in mon_entry, rmtadr has it.
+
+ChangeSet@1.2110.1.8, 2010-02-26 22:59:36+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_config.c:
+ Dr. Mills doesn't like depending on && not evaluating right side
+ if left is false.
+ ntp_proto.c:
+ timeout demobilizations don't seem to be working for preemptibles.
+
+ ntpd/ntp_config.c@1.252 +10 -6
+ Dr. Mills doesn't like depending on && not evaluating right side
+ if left is false.
+
+ ntpd/ntp_proto.c@1.297.1.7 +21 -12
+ timeout demobilizations don't seem to be working for preemptibles.
+
+ChangeSet@1.2110.1.7, 2010-02-26 15:53:49+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq-subs.c:
+ just the facts, ma'am
+ ntp_control.c:
+ DLM changes via email notes
+ ntp_proto.c:
+ DLM changes via email notes.
+ remove "unlucky" experiment to track DLM changes.
+
+ ntpd/ntp_control.c@1.133.1.4 +1 -1
+ DLM changes via email notes
+
+ ntpd/ntp_proto.c@1.297.1.6 +15 -42
+ DLM changes via email notes.
+ remove "unlucky" experiment to track DLM changes.
+
+ ntpq/ntpq-subs.c@1.48 +1 -2
+ just the facts, ma'am
+
+ChangeSet@1.2110.1.6, 2010-02-25 15:45:14+00:00, davehart@shiny.ad.hartbrothers.com
+ nt_clockstuff.c:
+ suppress reports of interpolated clock "would have" gone backward
+ for less than 10 usec.
+ ntp_proto.c:
+ experiment with turning over 50% of preemptibles daily
+
+ ntpd/ntp_proto.c@1.297.1.5 +26 -2
+ experiment with turning over 50% of preemptibles daily
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.41 +23 -19
+ suppress reports of interpolated clock "would have" gone backward
+ for less than 10 usec.
+
+ChangeSet@1.2110.1.5, 2010-02-25 06:34:58+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_proto.c:
+ cull from preemptibles randomly as well as when unreachable
+ long enough.
+ work_thread.c:
+ increase blocking_workitems max queue depth to 128 on Windows
+ ntp_control.h:
+ whitespace only
+ nt_clockstuff.c:
+ expose performance counter drift as ctr_frequency sysvar.
+ ntp_intres.c, ntpd.h, ntp_config.c:
+ add retry argument to getaddrinfo_sometime() so that pool lookups
+ can be one-shot.
+ ntp_peer.c:
+ test speer->flags not peer->flags for FLAG_PREEMPT
+
+ include/ntp_control.h@1.40 +3 -3
+ whitespace only
+
+ include/ntpd.h@1.137.1.7 +4 -2
+ add retry argument to getaddrinfo_sometime() so that pool lookups
+ can be one-shot.
+
+ ntpd/ntp_config.c@1.251 +14 -6
+ add retry argument to getaddrinfo_sometime() so that pool lookups
+ can be one-shot.
+
+ ntpd/ntp_intres.c@1.86 +2 -3
+ add retry argument to getaddrinfo_sometime() so that pool lookups
+ can be one-shot.
+
+ ntpd/ntp_peer.c@1.132 +11 -7
+ test speer->flags not peer->flags for FLAG_PREEMPT
+
+ ntpd/ntp_proto.c@1.297.1.4 +17 -11
+ cull from preemptibles randomly as well as when unreachable
+ long enough.
+
+ ntpd/work_thread.c@1.2 +1 -1
+ increase blocking_workitems max queue depth to 128 on Windows
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.40 +24 -16
+ expose performance counter drift as ctr_frequency sysvar.
+
+ChangeSet@1.2113, 2010-02-25 00:53:22-05:00, clemens@pogo.udel.edu
+ This is a group of 4 patches that
+ (1) replace blanks with tabs in the source.
+ (2) provide a cleaner solution to turning FLAG_PPS on/off in oncore_get_timestamp.
+ (3) change LOG_INFO -> LOG_DEFAULT for one message, reducing the extraneous message
+ in the messages log.
+ (4) an implementation of [Bug1390] initially provided by Russell Yount, to turn the
+ PPS signal on/off. Note that this does NOT affect timekeeping.
+
+ ntpd/refclock_oncore.c@1.86 +60 -3
+ Bug[1390] allows the user to turn PPS on/off, and determine what
+ causes it to go off (off, on always, on if tracking 1 or more satellites,
+ or controled by TRAIM).
+
+ Note that OFF is not implemented, since w/o the PPS, the oncore driver
+ will not run.
+
+ Note that we default to an initial OFF state, since this seems most
+ reasonable till the driver gets to the RUN state. Once in the RUN
+ state, we determine if we should turn the PPS signal on/off each cycle.
+
+
+ ntpd/refclock_oncore.c@1.85 +2 -2
+ Just an indent and change a LOG_INFO -> LOG_DEBUG to reduce default output.
+
+
+ ntpd/refclock_oncore.c@1.84 +3 -11
+ Cleaner solution to flipping FLAG_PPS on/off in oncore_get_timestamp.
+
+
+ ntpd/refclock_oncore.c@1.83 +12 -12
+ The source for the oncore driver uses tabs wherever possible to
+ replace strings of blanks. Replace blanks with tabs from a
+ previous patch that did not adhere to this strategy.
+
+
+ChangeSet@1.2110.1.4, 2010-02-24 06:25:27+00:00, davehart@shiny.ad.hartbrothers.com
+ new peer variable "srchost" shown instead of 0.0.0.0 srcadr in
+ ntpq peers billboard for .POOL. prototype associations.
+
+ include/ntp_control.h@1.39 +9 -8
+ new peer variable "srchost" shown instead of 0.0.0.0 srcadr in
+ ntpq peers billboard for .POOL. prototype associations.
+
+ ntpd/ntp_control.c@1.133.1.3 +16 -8
+ new peer variable "srchost" shown instead of 0.0.0.0 srcadr in
+ ntpq peers billboard for .POOL. prototype associations.
+
+ ntpd/ntp_peer.c@1.131 +8 -3
+ ignore "preempt" on manycastclient, pool prototype associations.
+
+ ntpq/ntpq-subs.c@1.47 +28 -11
+ new peer variable "srchost" shown instead of 0.0.0.0 srcadr in
+ ntpq peers billboard for .POOL. prototype associations.
+
+ ntpq/ntpq.c@1.103 +9 -8
+ new peer variable "srchost" shown instead of 0.0.0.0 srcadr in
+ ntpq peers billboard for .POOL. prototype associations.
+
+ChangeSet@1.2110.1.3, 2010-02-23 09:47:25+00:00, davehart@shiny.ad.hartbrothers.com
+ "restrict source ..." to set restrictions for peers.
+ [Bug 1497] fudge is broken by getnetnum() change
+
+ include/ntp.h@1.171 +2 -0
+ add RESM_SOURCE for "restrict source ..."
+
+ include/ntp_lists.h@1.4 +12 -0
+ add CHECK_SLIST() debugging helper macro to detect a couple of
+ ways a singly-linked list can go awry.
+
+ include/ntp_refclock.h@1.25 +11 -16
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+ remove prototypes for previously-removed functions.
+
+ include/ntpd.h@1.137.1.6 +3 -2
+ add restrict_source() to add/remove restrictions for each
+ association automatically ("restrict source ...")
+
+ ntpd/complete.conf@1.4 +2 -1
+ add "restrict source ..." test
+
+ ntpd/keyword-gen-utd@1.2 +1 -1
+ generated from ntp_keyword.c
+
+ ntpd/keyword-gen.c@1.6 +15 -1
+ add "source" as in "restrict source ..."
+
+ ntpd/ntp_config.c@1.250 +136 -105
+ "restrict source ..." to set restrictions for peers.
+ [Bug 1497] fudge is broken by getnetnum() change
+
+ ntpd/ntp_intres.c@1.85 +0 -9
+ test use of copy_addrinfo_list() no longer helpful as it has a real
+ consumer now.
+
+ ntpd/ntp_io.c@1.314 +2 -2
+ "restrict source ..." to set restrictions for peers.
+
+ ntpd/ntp_keyword.h@1.4 +421 -415
+ generated from ntp_keyword.c
+
+ ntpd/ntp_parser.c@1.53 +788 -774
+ ntp_parser.y compiled
+
+ ntpd/ntp_parser.h@1.33 +83 -81
+ ntp_parser.y compiled
+
+ ntpd/ntp_parser.y@1.48 +11 -2
+ "restrict source ..." to set restrictions for peers.
+
+ ntpd/ntp_peer.c@1.130 +17 -13
+ "restrict source ..." to set restrictions for peers.
+
+ ntpd/ntp_proto.c@1.297.1.3 +10 -0
+ "restrict source ..." to set restrictions for peers.
+
+ ntpd/ntp_refclock.c@1.91.1.3 +3 -2
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpd/ntp_request.c@1.85 +1 -1
+ "restrict source ..." to set restrictions for peers.
+
+ ntpd/ntp_restrict.c@1.30 +144 -32
+ "restrict source ..." to set restrictions for peers.
+
+ ntpd/refclock_datum.c@1.14 +3 -3
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpd/refclock_jupiter.c@1.25 +5 -5
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpd/refclock_leitch.c@1.12 +2 -2
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpd/refclock_nmea.c@1.47 +2 -2
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpd/refclock_parse.c@1.53 +3 -3
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpd/refclock_ripencc.c@1.8 +3 -3
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpd/refclock_wwvb.c@1.23.1.2 +2 -2
+ make refclock control entrypoint, refclock_control()'s input
+ struct refclockstat pointer const.
+
+ ntpdc/ntpdc_ops.c@1.63 +1 -0
+ "restrict source ..." to set restrictions for peers.
+
+ChangeSet@1.2110.1.2, 2010-02-20 17:52:58+00:00, davehart@shiny.ad.hartbrothers.com
+ new pool implementation modeled on manycastclient.
+
+ include/ntp.h@1.170 +26 -16
+ add hostname, addrs, ai members to struct peer for pool.
+ remove unused PPSREFID.
+ add MDF_POOL, rename MDF_ACLNT -> MDF_UCLNT to cover both
+ manycastclient and pool ephemeral associations.
+ add MDF_SOLICIT_MASK (MDF_ACAST | MDF_POOL).
+
+
+ include/ntp_config.h@1.66.1.4 +2 -2
+ change address_node->type (family) type from short to u_short.
+
+ include/ntpd.h@1.137.1.5 +10 -7
+ changes for pool
+
+ ntpd/ntp_config.c@1.249 +54 -53
+ changes for pool
+
+ ntpd/ntp_control.c@1.133.1.2 +1 -1
+ rename MDF_SRVCASTMASK -> MDF_TXONLY_MASK.
+
+ ntpd/ntp_peer.c@1.129 +198 -109
+ changes for pool
+
+ ntpd/ntp_proto.c@1.297.1.2 +215 -58
+ changes for pool
+
+ ntpd/ntp_refclock.c@1.91.1.2 +2 -2
+ changes for pool
+
+ ntpd/ntp_request.c@1.84 +12 -29
+ changes for pool
+
+ ntpd/ntp_worker.c@1.2 +1 -1
+ Change worker child idle timeout to 3 minutes (was 15s)
+
+ ntpd/ntpsim.c@1.24 +1 -0
+ changes for pool
+
+ ntpdc/ntpdc.c@1.80 +23 -13
+ fix sizeof() abuse in getnetnum(), incorrect assumption that ai_canonname
+ is always non-NULL
+
+ ntpq/ntpq-subs.c@1.46 +4 -2
+ correct T column comments, value for manycastclient (A -> a).
+
+ ntpq/ntpq.c@1.102 +22 -16
+ fix sizeof() abuse in getnetnum(), incorrect assumption that ai_canonname
+ is always non-NULL
+
+ChangeSet@1.2110.1.1, 2010-02-17 09:54:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1483] AI_NUMERICSERV undefined in 4.2.7p20.
+ Maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ Remove more workarounds unneeded since we require ISO C90 AKA ANSI C:
+ - remove fallback implementations for memmove(), memset, strstr().
+ - do not test for atexit() or memcpy().
+ Collapse a bunch of code duplication in ntpd/ntp_restrict.c added with
+ support for IPv6.
+ Correct some corner case failures in automatically enabling the MRU
+ list if any "restrict ... limited" is in effect, and in disabling MRU
+ maintenance. (ntp_monitor.c, ntp_restrict.c)
+ Reverse the internal sort order of the address restriction lists, but
+ preserve the same behavior. This allows removal of special-case code
+ related to the default restrictions and more straightforward lookups
+ of restrictions for a given address (now, stop on first match).
+ Move ntp_restrict.c MRU doubly-linked list maintenance code into
+ ntp_lists.h macros, allowing more duplicated source excision.
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+ Repair ntpdate.c to handle no longer testing HAVE_TIMER_SETTIME.
+ Do not reference peer_node/unpeer_node after freeing when built with
+ --disable-saveconfig and using DNS.
+
+ BitKeeper/deleted/.del-memmove.c~3e480692@1.4 +0 -0
+ Rename: libntp/memmove.c -> BitKeeper/deleted/.del-memmove.c~3e480692
+
+ BitKeeper/deleted/.del-strstr.c~55aa8716fa42aa@1.2 +0 -0
+ Rename: libntp/strstr.c -> BitKeeper/deleted/.del-strstr.c~55aa8716fa42aa
+
+ ChangeLog@1.541.1.1 +23 -0
+ [Bug 1483] AI_NUMERICSERV undefined in 4.2.7p20.
+ Maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ Remove more workarounds unneeded since we require ISO C90 AKA ANSI C:
+ - remove fallback implementations for memmove(), memset, strstr().
+ - do not test for atexit() or memcpy().
+ Collapse a bunch of code duplication in ntpd/ntp_restrict.c added with
+ support for IPv6.
+ Correct some corner case failures in automatically enabling the MRU
+ list if any "restrict ... limited" is in effect, and in disabling MRU
+ maintenance. (ntp_monitor.c, ntp_restrict.c)
+ Reverse the internal sort order of the address restriction lists, but
+ preserve the same behavior. This allows removal of special-case code
+ related to the default restrictions and more straightforward lookups
+ of restrictions for a given address (now, stop on first match).
+ Move ntp_restrict.c MRU doubly-linked list maintenance code into
+ ntp_lists.h macros, allowing more duplicated source excision.
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+ Repair ntpdate.c to handle no longer testing HAVE_TIMER_SETTIME.
+ Do not reference peer_node/unpeer_node after freeing when built with
+ --disable-saveconfig and using DNS.
+
+ configure.ac@1.479 +1 -2
+ Remove more workarounds unneeded since we require ISO C90 AKA ANSI C:
+ - remove fallback implementations for memmove(), memset, strstr().
+ - do not test for memcpy().
+
+
+ flock-build@1.44.1.1 +26 -21
+ fix bug with SIMUL=2 flock-build -1
+
+ include/ntp.h@1.169 +57 -46
+ maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ rename peer link members: next -> adr_link, ass_next->aid_link.
+ add VN_MODE() for MRU list, which doesn't store LI but does now
+ combine version and mode in one octet. use VN_MODE() in
+ PKT_LI_VN_MODE.
+ add mon_entry typedef for struct mon_data.
+ move ntp_restrict.c MRU doubly-linked list maintenance code into
+ ntp_lists.h macros, allowing more duplicated source excision.
+ rename struct mon_data.interface -> mon_entry.lcladr to mirror
+ mon_entry.rmtadr.
+ note disuse of MDF_LCAST without removing it.
+ add MDF_SRVCASTMASK (MDF_MCAST | MDF_BCAST | ACAST).
+ Combine IPv4 and IPv6 restrict list entry structures into one
+ variable-size structure with a union at the end of V4 and v6
+ addresses, enabling removal of duplicated code.
+
+
+ include/ntp_config.h@1.66.1.3 +19 -18
+ add uint u to attr_val.value union.
+
+ include/ntp_crypto.h@1.47 +1 -1
+ use void * for variant pointer struct value.ptr.
+
+ include/ntp_lists.h@1.3 +119 -7
+ Add LINK_SORT_SLIST() macro to insert into a sorted list.
+ Add doubly-linked list macros wrapping existing logic from ntp_restrict.c:
+ INIT_DLIST(), HEAD_DLIST(), TAIL_DLIST(), LINK_DLIST(), UNLINK_DLIST(),
+ ITER_DLIST_BEGIN(), ITER_DLIST_END().
+
+ include/ntp_net.h@1.4 +20 -9
+ remove unhelpful (void *) cast in MEMSET_ADDR6().
+ add ADDR6_CMP(), ADDR6_EQ() helpers for in6_addr.
+
+ include/ntp_rfc2553.h@1.36 +9 -1
+ handle AI_NUMERICSERV being unavailable.
+
+ include/ntp_stdlib.h@1.43 +0 -4
+ relocate latoa(), localaddrtoa() to ntpd.h
+
+ include/ntp_string.h@1.6 +1 -15
+ NTP requires ISO C90/ANSI C, remove workarounds for missing
+ strchr(), strrchr(), memcpy().
+
+ include/ntp_types.h@1.19 +3 -1
+ add ASSOCID_MAX, KEYID_T_MAX
+
+ include/ntpd.h@1.137.1.4 +73 -59
+ Add comments clarifying and demarcing division of file into
+ two parts, with only variable extern declarations in the
+ second half.
+ rename ntp_monclearinterface() -> mon_clearinterface().
+ correct many scalar type declarations and function argument
+ types to eliminate truncation and implicit pointer cast
+ warnings, particularly int -> u_char and int -> u_short.
+ introduce mon_entry typedef (alias of struct mon_data) and
+ convert most references.
+ include hash array size in external declaration to better
+ inform compilers.
+ maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ adds peer_list, peer_count globals.
+ rename restrictlist -> restrictlist4.
+
+ libntp/Makefile.am@1.52 +0 -2
+ NTP requires an ISO C90 (ANSI C) compiler:
+ - remove fallback memmove(), strstr()
+
+ libntp/decodenetnum.c@1.11 +1 -1
+ use Z_AI_NUMERICHOST to document it may be zero and should not
+ be used with bitwise NOT (~)
+
+ libntp/machines.c@1.22 +0 -13
+ NTP requires an ISO C90 (ANSI C) compiler:
+ - remove fallback memset()
+
+ libntp/strdup.c@1.7 +15 -14
+ minor cleanup, use memcpy() instead of strcpy()
+
+ ntpd/Makefile.am@1.91 +1 -1
+ ntp_data_structures does not need to be built in both SIM and
+ normal versions as it and its headers do not use #ifdef SIM.
+
+ ntpd/ntp_config.c@1.248 +129 -98
+ Eliminate warnings by correcting many scalar types.
+ Do not reference peer_node/unpeer_node after freeing when built with
+ --disable-saveconfig and using DNS.
+
+ ntpd/ntp_control.c@1.133.1.1 +571 -614
+ [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27)
+ and SHM (28).
+ Use memcpy() instead of memmove() where the buffers can not overlap.
+ Re-enable "Possible 'ntpdx' exploit" message with rate-limiting to
+ 12 per hour.
+ maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ adds peer_list, peer_count globals.
+ use erealloc() in place of free() then emalloc().
+
+ ntpd/ntp_crypto.c@1.147 +28 -25
+ eliminate warnings with casts and type corrections.
+
+ ntpd/ntp_intres.c@1.84 +3 -3
+ use \n with DPRINTF
+
+ ntpd/ntp_io.c@1.313 +12 -1
+ rename ntp_monclearinterface() -> mon_clearinterface().
+ implement localaddrtoa(), similar to socktoa().
+
+ ntpd/ntp_loopfilter.c@1.153.1.1 +0 -4
+ remove VMS-specific include that is no longer required.
+
+ ntpd/ntp_monitor.c@1.26 +98 -132
+ rename MAXMONMEM -> MAX_MONLIST
+ rename MONMEMINC -> INC_MONLIST
+ in both cases, respect the old name if defined (likely with -D).
+ change most struct mon_data references to mon_entry.
+ move doubly-linked list code to ntp_lists *_DLIST() macros.
+ use *_SLIST() macros for monitor hash lists.
+ rename ntp_monclearinterface() -> mon_clearinterface().
+ rename struct mon_data.interface -> mon_entry.lcladr to mirror
+ mon_entry.rmtadr.
+ no point in memset(p, 0, size); then memcpy(p, src, size);.
+ combine mon_entry.version and mon_entry.mode into mon_entry.vn_mode.
+
+
+ ntpd/ntp_peer.c@1.128 +184 -224
+ maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ change initial, incremental peer allocs from 15, 5 to 8, 4.
+ do not zero variables at startup that are zero-initialized.
+
+ ntpd/ntp_proto.c@1.297.1.1 +125 -137
+ remove VMS-specific include of ntp_refclock.h, appears unneeded.
+ silence many truncation and implicit conversion warnings by changing
+ types or typecasting.
+ maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ rename clock_select() array of peers from peer_list to peers to avoid
+ conflicting with new global listhead peers_list.
+ use erealloc() instead of free() then emalloc().
+ allocate clock_select()'s three peer-related arrays together to
+ minimize cache lines used.
+ do not reuse hpoll local in poll_update as scratch int.
+
+ ntpd/ntp_refclock.c@1.91.1.1 +3 -1
+ eliminate truncation warning for 64-bit time_t with (u_int32)
+
+ ntpd/ntp_request.c@1.83 +196 -253
+ maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+ rename peer_list() -> list_peers() to avoid conflict with new global
+ listhead peer_list.
+ rename peer_list_sum -> list_peers_sum() to maintain consistency.
+ add list_restrict4(), list_restrict6() helpers for list_restrict()
+ which reverse the order of the returned restrictions to match
+ previous behavior and documentation, now that it's maintained in
+ a reversed sort order internally vs. previously.
+ get rid of duplicative extern references to global variables in
+ a number of functions (rely on ntpd.h).
+
+ ntpd/ntp_restrict.c@1.29 +394 -419
+ collapse a bunch of code duplication in ntpd/ntp_restrict.c added with
+ support for IPv6. Correct mistaken split of res_limited_refcount
+ code and data, one RES_LIMITED reference count should apply to both.
+ reverse the internal sort order of the address restriction lists, but
+ preserve the same behavior. This allows removal of special-case code
+ related to the default restrictions and more straightforward lookups
+ of restrictions for a given address (we can stop on the first match).
+ move ntp_restrict.c MRU doubly-linked list maintenance code into
+ ntp_lists.h macros, allowing more duplicated source excision.
+ use *_SLIST() macros for mon_hash[] lists.
+
+ ntpd/ntp_timer.c@1.58 +23 -28
+ maintain and use linked list of associations (struct peer) in ntpd,
+ avoiding walking 128 hash table entries to iterate over peers.
+
+
+ ntpd/ntp_util.c@1.77 +3 -0
+ #include <unistd.h> for getpid().
+
+ ntpd/refclock_chronolog.c@1.10 +1 -1
+ fix truncation warning with typecast.
+
+ ntpd/refclock_chu.c@1.46.1.1 +1 -1
+ refclock_open() returns 0 on failure
+
+ ntpd/refclock_dumbclock.c@1.14.1.1 +1 -1
+ refclock_open() returns 0 on failure
+
+ ntpd/refclock_jupiter.c@1.24 +7 -7
+ eliminate a raft of truncation and type conversion warnings.
+
+ ntpd/refclock_wwvb.c@1.23.1.1 +1 -1
+ refclock_open() returns 0 on failure
+
+ ntpdate/ntpdate.c@1.72 +24 -44
+ configure.ac no longer tests for timer_settime() separately fromm
+ timer_create()..
+
+ ntpdc/ntpdc.c@1.79 +12 -9
+ #include <unistd.h>, <fcntl.h> for open(), close(), and isatty().
+
+ ntpq/ntpq.c@1.101 +15 -12
+ #include <unistd.h>, <fcntl.h> for open() and close().
+
+ ports/winnt/include/config.h@1.83 +0 -1
+ HAVE_STRCHR is no longer needed.
+
+ ports/winnt/libntp/termios.c@1.21.1.1 +14 -9
+ refclock_open() returns 0 on failure
+
+ ports/winnt/vc6/libntp.dsp@1.52 +0 -4
+ remove memmove.c reference.
+
+ ports/winnt/vs2003/libntp.vcproj@1.10 +0 -21
+ remove memmove.c reference.
+
+ ports/winnt/vs2005/libntp.vcproj@1.8 +0 -22
+ remove memmove.c reference.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.28 +6 -14
+ remove memmove.c and strstr.c references.
+
+ sntp/configure.ac@1.32 +1 -1
+ NTP requires ISO C90 (ANSI C) so don't test for atexit() or memset().
+
+ChangeSet@1.2112, 2010-02-16 09:40:11+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1306] constant conditionals in audio_gain().
+
+ ChangeLog@1.543 +1 -0
+ [Bug 1306] constant conditionals in audio_gain().
+
+ libntp/audio.c@1.28 +21 -21
+ [Bug 1306] constant conditionals in audio_gain().
+
+ChangeSet@1.2082.4.63, 2010-02-15 23:19:19+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27)
+ and SHM (28).
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+ Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one.
+
+
+ ChangeLog@1.496.26.44 +9 -0
+ [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27)
+ and SHM (28).
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+ Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one.
+
+
+ flock-build@1.45 +26 -21
+ Correct "SIMUL=4 ./flock-build -1" to prioritize -1/--one.
+
+ ntpd/ntp_control.c@1.129.1.4 +2 -2
+ [Bug 1464] synchronization source wrong for refclocks ARCRON_MSF (27)
+ and SHM (28).
+
+ ntpd/ntp_refclock.c@1.92 +4 -1
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+
+ ntpd/refclock_chu.c@1.47 +1 -1
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+
+ ntpd/refclock_dumbclock.c@1.15 +1 -1
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+
+ ntpd/refclock_wwvb.c@1.24 +1 -1
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+
+ ports/winnt/ntpd/win32_io.c@1.19.1.1 +15 -9
+ Correct Windows port's refclock_open() to return 0 on failure not -1.
+ Correct CHU, dumbclock, and WWVB drivers to check for 0 returned from
+ refclock_open() on failure.
+
+ChangeSet@1.2110, 2010-02-13 11:56:48+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P20
+ TAG: NTP_4_2_7P20
+
+ ChangeLog@1.541 +1 -0
+ NTP_4_2_7P20
+
+ ntpd/ntpd-opts.c@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpd/ntpd-opts.h@1.21 +3 -3
+ NTP_4_2_7P20
+
+ ntpd/ntpd-opts.texi@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpd/ntpd.1@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpdc/ntpdc-opts.c@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpdc/ntpdc-opts.h@1.21 +3 -3
+ NTP_4_2_7P20
+
+ ntpdc/ntpdc-opts.texi@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpdc/ntpdc.1@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpq/ntpq-opts.c@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpq/ntpq-opts.h@1.21 +3 -3
+ NTP_4_2_7P20
+
+ ntpq/ntpq-opts.texi@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpq/ntpq.1@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.21 +3 -3
+ NTP_4_2_7P20
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.21 +2 -2
+ NTP_4_2_7P20
+
+ ntpsnmpd/ntpsnmpd.1@1.21 +2 -2
+ NTP_4_2_7P20
+
+ packageinfo.sh@1.22 +1 -1
+ NTP_4_2_7P20
+
+ sntp/sntp-opts.c@1.21 +2 -2
+ NTP_4_2_7P20
+
+ sntp/sntp-opts.h@1.21 +3 -3
+ NTP_4_2_7P20
+
+ sntp/sntp-opts.texi@1.21 +2 -2
+ NTP_4_2_7P20
+
+ sntp/sntp.1@1.21 +2 -2
+ NTP_4_2_7P20
+
+ sntp/sntp.html@1.21 +1 -1
+ NTP_4_2_7P20
+
+ util/ntp-keygen-opts.c@1.21 +2 -2
+ NTP_4_2_7P20
+
+ util/ntp-keygen-opts.h@1.21 +3 -3
+ NTP_4_2_7P20
+
+ util/ntp-keygen-opts.texi@1.21 +2 -2
+ NTP_4_2_7P20
+
+ util/ntp-keygen.1@1.21 +2 -2
+ NTP_4_2_7P20
+
+ChangeSet@1.2102.2.1, 2010-02-09 18:19:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1483] hostname in ntp.conf "restrict" parameter rejected.
+ Use all addresses for each restrict by hostname.
+ Use async DNS to resolve trap directive hostnames.
+
+
+ ChangeLog@1.533.2.1 +3 -0
+ [Bug 1483] hostname in ntp.conf "restrict" parameter rejected.
+ Use all addresses for each restrict by hostname.
+ Use async DNS to resolve trap directive hostnames.
+
+
+ include/ntp_config.h@1.66.1.2 +13 -2
+ add settrap_params structure for trap_name_resolved()
+
+ include/ntp_stdlib.h@1.42 +4 -0
+ add localaddrtoa() alias latoa() macro evaluating to text of
+ a given struct interface *'s local address, or <null> in the
+ case of a NULL struct interface *.
+
+ ntpd/ntp_config.c@1.247 +177 -25
+ [Bug 1483] use blocking DNS resolution for restrict hostnames.
+ Use all addresses resolved from a restrict hostname, instead
+ of only the first.
+ Use async DNS for trap directive hostnames.
+
+ ntpd/ntp_peer.c@1.127 +4 -6
+ use latoa(peer->dstadr) instead of more verbose equivalent.
+
+ ntpd/ntp_restrict.c@1.28 +5 -5
+ DPRINTF args to hack_restrict() for v6 as well as v4 addresses.
+
+ChangeSet@1.2108, 2010-02-09 11:57:34+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P19
+ TAG: NTP_4_2_7P19
+
+ ChangeLog@1.539 +1 -0
+ NTP_4_2_7P19
+
+ ntpd/ntpd-opts.c@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpd/ntpd-opts.h@1.20 +3 -3
+ NTP_4_2_7P19
+
+ ntpd/ntpd-opts.texi@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpd/ntpd.1@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpdc/ntpdc-opts.c@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpdc/ntpdc-opts.h@1.20 +3 -3
+ NTP_4_2_7P19
+
+ ntpdc/ntpdc-opts.texi@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpdc/ntpdc.1@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpq/ntpq-opts.c@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpq/ntpq-opts.h@1.20 +3 -3
+ NTP_4_2_7P19
+
+ ntpq/ntpq-opts.texi@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpq/ntpq.1@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.20 +3 -3
+ NTP_4_2_7P19
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.20 +2 -2
+ NTP_4_2_7P19
+
+ ntpsnmpd/ntpsnmpd.1@1.20 +2 -2
+ NTP_4_2_7P19
+
+ packageinfo.sh@1.21 +1 -1
+ NTP_4_2_7P19
+
+ sntp/sntp-opts.c@1.20 +2 -2
+ NTP_4_2_7P19
+
+ sntp/sntp-opts.h@1.20 +3 -3
+ NTP_4_2_7P19
+
+ sntp/sntp-opts.texi@1.20 +2 -2
+ NTP_4_2_7P19
+
+ sntp/sntp.1@1.20 +2 -2
+ NTP_4_2_7P19
+
+ sntp/sntp.html@1.20 +1 -1
+ NTP_4_2_7P19
+
+ util/ntp-keygen-opts.c@1.20 +2 -2
+ NTP_4_2_7P19
+
+ util/ntp-keygen-opts.h@1.20 +3 -3
+ NTP_4_2_7P19
+
+ util/ntp-keygen-opts.texi@1.20 +2 -2
+ NTP_4_2_7P19
+
+ util/ntp-keygen.1@1.20 +2 -2
+ NTP_4_2_7P19
+
+ChangeSet@1.2082.4.62, 2010-02-09 10:34:59+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_6P1_RC5
+ TAG: NTP_4_2_6P1_RC5
+
+ ChangeLog@1.496.26.43 +1 -0
+ NTP_4_2_6P1_RC5
+
+ ntpd/ntpd-opts.c@1.248.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpd/ntpd-opts.h@1.248.5.1 +3 -3
+ NTP_4_2_6P1_RC5
+
+ ntpd/ntpd-opts.texi@1.246.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpd/ntpd.1@1.246.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpdc/ntpdc-opts.c@1.244.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpdc/ntpdc-opts.h@1.244.5.1 +3 -3
+ NTP_4_2_6P1_RC5
+
+ ntpdc/ntpdc-opts.texi@1.243.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpdc/ntpdc.1@1.243.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpq/ntpq-opts.c@1.245.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpq/ntpq-opts.h@1.245.5.1 +3 -3
+ NTP_4_2_6P1_RC5
+
+ ntpq/ntpq-opts.texi@1.244.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpq/ntpq.1@1.244.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.5.1 +3 -3
+ NTP_4_2_6P1_RC5
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ ntpsnmpd/ntpsnmpd.1@1.122.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ packageinfo.sh@1.255.7.1 +1 -1
+ NTP_4_2_6P1_RC5
+
+ sntp/sntp-opts.c@1.117.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ sntp/sntp-opts.h@1.117.5.1 +3 -3
+ NTP_4_2_6P1_RC5
+
+ sntp/sntp-opts.texi@1.117.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ sntp/sntp.1@1.117.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ sntp/sntp.html@1.7.5.1 +1 -1
+ NTP_4_2_6P1_RC5
+
+ util/ntp-keygen-opts.c@1.247.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ util/ntp-keygen-opts.h@1.247.5.1 +3 -3
+ NTP_4_2_6P1_RC5
+
+ util/ntp-keygen-opts.texi@1.246.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ util/ntp-keygen.1@1.246.5.1 +2 -2
+ NTP_4_2_6P1_RC5
+
+ChangeSet@1.2082.4.61, 2010-02-09 04:02:59-05:00, stenn@whimsy.udel.edu
+ [Bug 1438] Remove dead code from sntp/networking.c
+
+ ChangeLog@1.496.26.42 +1 -0
+ [Bug 1438] Remove dead code from sntp/networking.c
+
+ sntp/networking.c@1.29.1.1 +0 -1
+ [Bug 1438] Remove dead code from sntp/networking.c
+
+ChangeSet@1.2106, 2010-02-09 03:51:10-05:00, stenn@whimsy.udel.edu
+ [Bug 1338] Update the association type codes in ntpq.html.
+
+ ChangeLog@1.537 +1 -0
+ [Bug 1338] Update the association type codes in ntpq.html.
+
+ html/copyright.html@1.47 +1 -1
+ cleanup
+
+ html/ntpq.html@1.39 +5 -2
+ [Bug 1338] Update the association type codes in ntpq.html.
+
+ChangeSet@1.2102.1.1, 2010-02-09 03:23:58-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ChangeLog@1.533.1.1 +2 -1
+ cleanup
+
+ChangeSet@1.2082.17.1, 2010-02-09 02:49:34-05:00, stenn@whimsy.udel.edu
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ ChangeLog@1.496.42.1 +1 -0
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ html/debug.html@1.27.1.1 +3 -3
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ html/decode.html@1.11.1.1 +11 -7
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ html/ntpq.html@1.36.1.1 +11 -7
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ChangeSet@1.2082.4.59, 2010-02-08 14:11:12+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
+ [Bug 1479] Compilation fails because of not finding readline headers.
+ [Bug 1484] ushort is not defined in QNX6.
+
+ ChangeLog@1.496.26.40 +3 -0
+ [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
+ [Bug 1479] Compilation fails because of not finding readline headers.
+ [Bug 1484] ushort is not defined in QNX6.
+
+ include/mbg_gps166.h@1.10 +1 -1
+ [Bug 1484] ushort is not defined in QNX6.
+
+ libntp/ntp_lineedit.c@1.8 +29 -32
+ [Bug 1479] Compilation fails because of not finding readline headers.
+
+ m4/ntp_lineeditlibs.m4@1.7 +0 -2
+ [Bug 1479] Compilation fails because of not finding readline headers.
+
+ ntpd/ntp_control.c@1.129.1.3 +1 -0
+ [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
+
+ChangeSet@1.2102, 2010-02-07 10:31:29+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P18
+ TAG: NTP_4_2_7P18
+
+ ChangeLog@1.533 +1 -0
+ NTP_4_2_7P18
+
+ ntpd/ntpd-opts.c@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpd/ntpd-opts.h@1.19 +3 -3
+ NTP_4_2_7P18
+
+ ntpd/ntpd-opts.texi@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpd/ntpd.1@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpdc/ntpdc-opts.c@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpdc/ntpdc-opts.h@1.19 +3 -3
+ NTP_4_2_7P18
+
+ ntpdc/ntpdc-opts.texi@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpdc/ntpdc.1@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpq/ntpq-opts.c@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpq/ntpq-opts.h@1.19 +3 -3
+ NTP_4_2_7P18
+
+ ntpq/ntpq-opts.texi@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpq/ntpq.1@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.19 +3 -3
+ NTP_4_2_7P18
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.19 +2 -2
+ NTP_4_2_7P18
+
+ ntpsnmpd/ntpsnmpd.1@1.19 +2 -2
+ NTP_4_2_7P18
+
+ packageinfo.sh@1.20 +1 -1
+ NTP_4_2_7P18
+
+ sntp/sntp-opts.c@1.19 +2 -2
+ NTP_4_2_7P18
+
+ sntp/sntp-opts.h@1.19 +3 -3
+ NTP_4_2_7P18
+
+ sntp/sntp-opts.texi@1.19 +2 -2
+ NTP_4_2_7P18
+
+ sntp/sntp.1@1.19 +2 -2
+ NTP_4_2_7P18
+
+ sntp/sntp.html@1.19 +1 -1
+ NTP_4_2_7P18
+
+ util/ntp-keygen-opts.c@1.19 +2 -2
+ NTP_4_2_7P18
+
+ util/ntp-keygen-opts.h@1.19 +3 -3
+ NTP_4_2_7P18
+
+ util/ntp-keygen-opts.texi@1.19 +2 -2
+ NTP_4_2_7P18
+
+ util/ntp-keygen.1@1.19 +2 -2
+ NTP_4_2_7P18
+
+ChangeSet@1.2101, 2010-02-06 05:22:44+00:00, davehart@shiny.ad.hartbrothers.com
+ Stop using getaddrinfo() to convert numeric address strings to on-wire
+ addresses in favor of is_ip_address() alone.
+
+ ChangeLog@1.532 +2 -0
+ Stop using getaddrinfo() to convert numeric address strings to on-wire
+ addresses in favor of is_ip_address() alone.
+
+ include/ntp_rfc2553.h@1.35 +10 -1
+ add copy_addrinfo_list()
+
+ include/ntpd.h@1.137.1.3 +15 -6
+ mention copy_addrinfo_list() near getaddrinfo_sometime() prototype.
+
+ libntp/ntp_rfc2553.c@1.42 +92 -0
+ add copy_addrinfo_list()
+
+ ntpd/ntp_config.c@1.246 +18 -116
+ Stop using getaddrinfo() to convert numeric address strings to on-wire
+ addresses in favor of is_ip_address() alone.
+
+ ntpd/ntp_intres.c@1.83 +10 -1
+ add DEBUG code to exercise copy_addrinfo_list() harmlessly
+
+ChangeSet@1.2082.4.58, 2010-02-05 22:26:34+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
+
+ ChangeLog@1.496.26.39 +1 -0
+ [Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
+
+ ntpd/ntp_control.c@1.129.1.2 +1 -1
+ [Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
+
+ChangeSet@1.2099, 2010-02-05 10:31:56+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P17
+ TAG: NTP_4_2_7P17
+
+ ChangeLog@1.530 +1 -0
+ NTP_4_2_7P17
+
+ ntpd/ntpd-opts.c@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpd/ntpd-opts.h@1.18 +3 -3
+ NTP_4_2_7P17
+
+ ntpd/ntpd-opts.texi@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpd/ntpd.1@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpdc/ntpdc-opts.c@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpdc/ntpdc-opts.h@1.18 +3 -3
+ NTP_4_2_7P17
+
+ ntpdc/ntpdc-opts.texi@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpdc/ntpdc.1@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpq/ntpq-opts.c@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpq/ntpq-opts.h@1.18 +3 -3
+ NTP_4_2_7P17
+
+ ntpq/ntpq-opts.texi@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpq/ntpq.1@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.18 +3 -3
+ NTP_4_2_7P17
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.18 +2 -2
+ NTP_4_2_7P17
+
+ ntpsnmpd/ntpsnmpd.1@1.18 +2 -2
+ NTP_4_2_7P17
+
+ packageinfo.sh@1.19 +1 -1
+ NTP_4_2_7P17
+
+ sntp/sntp-opts.c@1.18 +2 -2
+ NTP_4_2_7P17
+
+ sntp/sntp-opts.h@1.18 +3 -3
+ NTP_4_2_7P17
+
+ sntp/sntp-opts.texi@1.18 +2 -2
+ NTP_4_2_7P17
+
+ sntp/sntp.1@1.18 +2 -2
+ NTP_4_2_7P17
+
+ sntp/sntp.html@1.18 +1 -1
+ NTP_4_2_7P17
+
+ util/ntp-keygen-opts.c@1.18 +2 -2
+ NTP_4_2_7P17
+
+ util/ntp-keygen-opts.h@1.18 +3 -3
+ NTP_4_2_7P17
+
+ util/ntp-keygen-opts.texi@1.18 +2 -2
+ NTP_4_2_7P17
+
+ util/ntp-keygen.1@1.18 +2 -2
+ NTP_4_2_7P17
+
+ChangeSet@1.2096.1.1, 2010-02-05 05:07:21+00:00, davehart@shiny.ad.hartbrothers.com
+ Attempts to cure CID 108 CID 118 CID 119 TAINTED_SCALAR warnings.
+ Broaden ylwrap workaround VPATH_HACK to all non-GNU make.
+
+ ChangeLog@1.527.1.1 +6 -0
+ Attempts to cure CID 108 CID 118 CID 119 TAINTED_SCALAR warnings.
+ Broaden ylwrap workaround VPATH_HACK to all non-GNU make.
+
+ include/ntp_debug.h@1.3 +2 -0
+ include ntp_assert.h so source files can include one less .h
+
+ m4/ntp_vpathhack.m4@1.3 +25 -11
+ ABroaden ylwrap workaround VPATH_HACK to all non-GNU make.
+
+ ntpd/Makefile.am@1.90 +3 -3
+ use $(srcdir)/ prefix for ntpd-opts.[ch] in BS_DIST
+
+ ntpd/ntp_scanner.c@1.32 +13 -6
+ Attempt to cure CID 108 TAINTED_SCALAR warning.
+
+ ntpd/work_fork.c@1.2 +10 -2
+ Attempts to cure CID 118 CID 119 TAINTED_SCALAR warnings.
+
+ChangeSet@1.2082.4.57, 2010-02-04 23:13:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
+
+ ChangeLog@1.496.26.38 +4 -0
+ [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
+
+ Makefile.am@1.93 +3 -3
+ [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
+
+ sntp/Makefile.am@1.21.1.7 +3 -3
+ [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
+
+ChangeSet@1.2096, 2010-02-04 10:32:08+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P16
+ TAG: NTP_4_2_7P16
+
+ ChangeLog@1.527 +1 -0
+ NTP_4_2_7P16
+
+ ntpd/ntpd-opts.c@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpd/ntpd-opts.h@1.17 +3 -3
+ NTP_4_2_7P16
+
+ ntpd/ntpd-opts.texi@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpd/ntpd.1@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpdc/ntpdc-opts.c@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpdc/ntpdc-opts.h@1.17 +3 -3
+ NTP_4_2_7P16
+
+ ntpdc/ntpdc-opts.texi@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpdc/ntpdc.1@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpq/ntpq-opts.c@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpq/ntpq-opts.h@1.17 +3 -3
+ NTP_4_2_7P16
+
+ ntpq/ntpq-opts.texi@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpq/ntpq.1@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.17 +3 -3
+ NTP_4_2_7P16
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.17 +2 -2
+ NTP_4_2_7P16
+
+ ntpsnmpd/ntpsnmpd.1@1.17 +2 -2
+ NTP_4_2_7P16
+
+ packageinfo.sh@1.18 +1 -1
+ NTP_4_2_7P16
+
+ sntp/sntp-opts.c@1.17 +2 -2
+ NTP_4_2_7P16
+
+ sntp/sntp-opts.h@1.17 +3 -3
+ NTP_4_2_7P16
+
+ sntp/sntp-opts.texi@1.17 +2 -2
+ NTP_4_2_7P16
+
+ sntp/sntp.1@1.17 +2 -2
+ NTP_4_2_7P16
+
+ sntp/sntp.html@1.17 +1 -1
+ NTP_4_2_7P16
+
+ util/ntp-keygen-opts.c@1.17 +2 -2
+ NTP_4_2_7P16
+
+ util/ntp-keygen-opts.h@1.17 +3 -3
+ NTP_4_2_7P16
+
+ util/ntp-keygen-opts.texi@1.17 +2 -2
+ NTP_4_2_7P16
+
+ util/ntp-keygen.1@1.17 +2 -2
+ NTP_4_2_7P16
+
+ChangeSet@1.2082.4.56, 2010-02-04 02:57:49-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_6P1_RC4
+ TAG: NTP_4_2_6P1_RC4
+
+ ChangeLog@1.496.26.37 +1 -0
+ NTP_4_2_6P1_RC4
+
+ ntpd/ntpd-opts.c@1.248.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpd/ntpd-opts.h@1.248.4.1 +3 -3
+ NTP_4_2_6P1_RC4
+
+ ntpd/ntpd-opts.texi@1.246.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpd/ntpd.1@1.246.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpdc/ntpdc-opts.c@1.244.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpdc/ntpdc-opts.h@1.244.4.1 +3 -3
+ NTP_4_2_6P1_RC4
+
+ ntpdc/ntpdc-opts.texi@1.243.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpdc/ntpdc.1@1.243.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpq/ntpq-opts.c@1.245.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpq/ntpq-opts.h@1.245.4.1 +3 -3
+ NTP_4_2_6P1_RC4
+
+ ntpq/ntpq-opts.texi@1.244.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpq/ntpq.1@1.244.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.4.1 +3 -3
+ NTP_4_2_6P1_RC4
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ ntpsnmpd/ntpsnmpd.1@1.122.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ packageinfo.sh@1.255.6.1 +1 -1
+ NTP_4_2_6P1_RC4
+
+ sntp/sntp-opts.c@1.117.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ sntp/sntp-opts.h@1.117.4.1 +3 -3
+ NTP_4_2_6P1_RC4
+
+ sntp/sntp-opts.texi@1.117.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ sntp/sntp.1@1.117.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ sntp/sntp.html@1.7.4.1 +1 -1
+ NTP_4_2_6P1_RC4
+
+ util/ntp-keygen-opts.c@1.247.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ util/ntp-keygen-opts.h@1.247.4.1 +3 -3
+ NTP_4_2_6P1_RC4
+
+ util/ntp-keygen-opts.texi@1.246.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ util/ntp-keygen.1@1.246.4.1 +2 -2
+ NTP_4_2_6P1_RC4
+
+ChangeSet@1.2082.4.55, 2010-02-04 03:01:42+00:00, hart@psp-fb1.ntp.org
+ Makefile.am:
+ fix make distdir before make all on FreeBSD make
+
+ Makefile.am@1.92 +5 -5
+ fix make distdir before make all on FreeBSD make
+
+ sntp/Makefile.am@1.21.1.6 +26 -25
+ fix make distdir before make all on FreeBSD make
+
+ChangeSet@1.2082.4.54, 2010-02-03 23:51:52+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove arlib.
+
+ BitKeeper/deleted/.del-COPYING~1e5c94deb8b25a03@1.3 +0 -0
+ Rename: arlib/COPYING -> BitKeeper/deleted/.del-COPYING~1e5c94deb8b25a03
+
+ BitKeeper/deleted/.del-INSTALL~4c77da0d9f1f3464@1.2 +0 -0
+ Rename: arlib/INSTALL -> BitKeeper/deleted/.del-INSTALL~4c77da0d9f1f3464
+
+ BitKeeper/deleted/.del-Makefile.am~501d14b0d06d3031@1.4 +0 -0
+ Rename: arlib/Makefile.am -> BitKeeper/deleted/.del-Makefile.am~501d14b0d06d3031
+
+ BitKeeper/deleted/.del-README~4de4615d76ebba47@1.2 +0 -0
+ Rename: arlib/README -> BitKeeper/deleted/.del-README~4de4615d76ebba47
+
+ BitKeeper/deleted/.del-UNSHAR.HDR~6aa2f933ef5d86df@1.2 +0 -0
+ Rename: arlib/UNSHAR.HDR -> BitKeeper/deleted/.del-UNSHAR.HDR~6aa2f933ef5d86df
+
+ BitKeeper/deleted/.del-arlib.3~11ae3dd9cdb6a32@1.2 +0 -0
+ Rename: arlib/arlib.3 -> BitKeeper/deleted/.del-arlib.3~11ae3dd9cdb6a32
+
+ BitKeeper/deleted/.del-arlib.c~fdde50d6ab7b6f64@1.2 +0 -0
+ Rename: arlib/arlib.c -> BitKeeper/deleted/.del-arlib.c~fdde50d6ab7b6f64
+
+ BitKeeper/deleted/.del-arlib.h~22218072d10baf8e@1.2 +0 -0
+ Rename: arlib/arlib.h -> BitKeeper/deleted/.del-arlib.h~22218072d10baf8e
+
+ BitKeeper/deleted/.del-arplib.h~8ccbd9af28d9aa3b@1.2 +0 -0
+ Rename: arlib/arplib.h -> BitKeeper/deleted/.del-arplib.h~8ccbd9af28d9aa3b
+
+ BitKeeper/deleted/.del-configure.in~282cad3ea077c564@1.4 +0 -0
+ Rename: arlib/configure.in -> BitKeeper/deleted/.del-configure.in~282cad3ea077c564
+
+ BitKeeper/deleted/.del-sample.c~4c74b15f3881e611@1.2 +0 -0
+ Rename: arlib/sample.c -> BitKeeper/deleted/.del-sample.c~4c74b15f3881e611
+
+ ChangeLog@1.496.26.36 +1 -0
+ Remove arlib.
+
+ Makefile.am@1.91 +1 -4
+ Remove arlib.
+
+ configure.ac@1.465.1.10 +7 -13
+ Remove arlib, replace --with-arlib handling with deprecation warning.
+
+ChangeSet@1.2091, 2010-02-03 10:36:19+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P15
+ TAG: NTP_4_2_7P15
+
+ ChangeLog@1.523 +1 -0
+ NTP_4_2_7P15
+
+ ntpd/ntpd-opts.c@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpd/ntpd-opts.h@1.16 +3 -3
+ NTP_4_2_7P15
+
+ ntpd/ntpd-opts.texi@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpd/ntpd.1@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpdc/ntpdc-opts.c@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpdc/ntpdc-opts.h@1.16 +3 -3
+ NTP_4_2_7P15
+
+ ntpdc/ntpdc-opts.texi@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpdc/ntpdc.1@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpq/ntpq-opts.c@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpq/ntpq-opts.h@1.16 +3 -3
+ NTP_4_2_7P15
+
+ ntpq/ntpq-opts.texi@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpq/ntpq.1@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.16 +3 -3
+ NTP_4_2_7P15
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.16 +2 -2
+ NTP_4_2_7P15
+
+ ntpsnmpd/ntpsnmpd.1@1.16 +2 -2
+ NTP_4_2_7P15
+
+ packageinfo.sh@1.17 +1 -1
+ NTP_4_2_7P15
+
+ sntp/sntp-opts.c@1.16 +2 -2
+ NTP_4_2_7P15
+
+ sntp/sntp-opts.h@1.16 +3 -3
+ NTP_4_2_7P15
+
+ sntp/sntp-opts.texi@1.16 +2 -2
+ NTP_4_2_7P15
+
+ sntp/sntp.1@1.16 +2 -2
+ NTP_4_2_7P15
+
+ sntp/sntp.html@1.16 +1 -1
+ NTP_4_2_7P15
+
+ util/ntp-keygen-opts.c@1.16 +2 -2
+ NTP_4_2_7P15
+
+ util/ntp-keygen-opts.h@1.16 +3 -3
+ NTP_4_2_7P15
+
+ util/ntp-keygen-opts.texi@1.16 +2 -2
+ NTP_4_2_7P15
+
+ util/ntp-keygen.1@1.16 +2 -2
+ NTP_4_2_7P15
+
+ChangeSet@1.2082.4.53, 2010-02-03 05:28:18-05:00, stenn@whimsy.udel.edu
+ [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a
+
+ ChangeLog@1.496.26.35 +1 -0
+ [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a
+
+ util/Makefile.am@1.45.1.4 +1 -1
+ [Bug 1474] ntp_keygen needs LCRYPTO after libntp.a
+
+ChangeSet@1.2082.4.52, 2010-02-03 04:58:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1455] ntpd does not try /etc/ntp.audio as documented.
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ChangeLog@1.496.26.34 +4 -0
+ [Bug 1455] ntpd does not try /etc/ntp.audio as documented.
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ lib/isc/win32/interfaceiter.c@1.17 +11 -8
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ libntp/audio.c@1.27 +8 -5
+ [Bug 1455] ntpd does not try /etc/ntp.audio as documented.
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ libntp/findconfig.c@1.3 +3 -3
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ libntp/humandate.c@1.7.1.1 +7 -6
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ libntp/modetoa.c@1.2.1.1 +2 -2
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ libntp/prettydate.c@1.12.1.1 +11 -10
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ libntp/uglydate.c@1.3.1.1 +5 -3
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ libntp/uinttoa.c@1.2.1.1 +1 -1
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ntpd/ntp_control.c@1.129.1.1 +35 -32
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ntpd/refclock_arbiter.c@1.15 +9 -9
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+
+ ntpd/refclock_arc.c@1.22 +13 -7
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_as2201.c@1.11 +9 -10
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_atom.c@1.61 +4 -3
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ntpd/refclock_bancomm.c@1.12 +28 -21
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+
+
+ ntpd/refclock_chronolog.c@1.9 +10 -10
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_chu.c@1.46 +44 -20
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_dumbclock.c@1.14 +10 -6
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_gpsvme.c@1.8 +10 -11
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_heath.c@1.15 +6 -4
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+
+ ntpd/refclock_hopfpci.c@1.11 +18 -26
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_hopfser.c@1.14 +13 -18
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_hpgps.c@1.10 +9 -10
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_irig.c@1.32 +11 -11
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_jjy.c@1.18 +22 -22
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_jupiter.c@1.21.1.1 +6 -10
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_leitch.c@1.11 +12 -3
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ call io_closeclock() on shutdown if io_addclock() succeeded.
+
+ ntpd/refclock_msfees.c@1.13 +20 -13
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ntpd/refclock_mx4200.c@1.25 +11 -12
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_palisade.c@1.31.1.1 +11 -6
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+
+ ntpd/refclock_parse.c@1.52 +3 -3
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ntpd/refclock_pcf.c@1.10 +2 -2
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ntpd/refclock_pst.c@1.10 +9 -9
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_shm.c@1.21 +8 -6
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_tpro.c@1.11 +12 -14
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_trak.c@1.9 +8 -9
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+ Remove some dead code checking for emalloc() returning NULL.
+
+ ntpd/refclock_wwvb.c@1.23 +10 -6
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ Fix widely cut-n-pasted bug in refclock shutdown after failed start.
+
+ ntpq/ntpq-subs.c@1.39.2.1 +28 -22
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ntpq/ntpq.c@1.97.1.1 +23 -12
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+
+ ports/winnt/ntpd/hopf_PCI_io.c@1.7 +173 -136
+ Convert many sprintf() calls to snprintf(), also strcpy(), strcat().
+ clean up indent mess.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20.1.5 +6 -2
+ add reference to libntp/audio.c
+
+ChangeSet@1.2089, 2010-02-02 10:34:20+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P14
+ TAG: NTP_4_2_7P14
+
+ ChangeLog@1.521 +1 -0
+ NTP_4_2_7P14
+
+ ntpd/ntpd-opts.c@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpd/ntpd-opts.h@1.15 +3 -3
+ NTP_4_2_7P14
+
+ ntpd/ntpd-opts.texi@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpd/ntpd.1@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpdc/ntpdc-opts.c@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpdc/ntpdc-opts.h@1.15 +3 -3
+ NTP_4_2_7P14
+
+ ntpdc/ntpdc-opts.texi@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpdc/ntpdc.1@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpq/ntpq-opts.c@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpq/ntpq-opts.h@1.15 +3 -3
+ NTP_4_2_7P14
+
+ ntpq/ntpq-opts.texi@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpq/ntpq.1@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.15 +3 -3
+ NTP_4_2_7P14
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.15 +2 -2
+ NTP_4_2_7P14
+
+ ntpsnmpd/ntpsnmpd.1@1.15 +2 -2
+ NTP_4_2_7P14
+
+ packageinfo.sh@1.16 +1 -1
+ NTP_4_2_7P14
+
+ sntp/sntp-opts.c@1.15 +2 -2
+ NTP_4_2_7P14
+
+ sntp/sntp-opts.h@1.15 +3 -3
+ NTP_4_2_7P14
+
+ sntp/sntp-opts.texi@1.15 +2 -2
+ NTP_4_2_7P14
+
+ sntp/sntp.1@1.15 +2 -2
+ NTP_4_2_7P14
+
+ sntp/sntp.html@1.15 +1 -1
+ NTP_4_2_7P14
+
+ util/ntp-keygen-opts.c@1.15 +2 -2
+ NTP_4_2_7P14
+
+ util/ntp-keygen-opts.h@1.15 +3 -3
+ NTP_4_2_7P14
+
+ util/ntp-keygen-opts.texi@1.15 +2 -2
+ NTP_4_2_7P14
+
+ util/ntp-keygen.1@1.15 +2 -2
+ NTP_4_2_7P14
+
+ChangeSet@1.2084.1.40, 2010-02-02 04:18:56-05:00, stenn@pogo.udel.edu
+ cleanup
+
+ configure.ac@1.477 +0 -1
+ cleanup
+
+ChangeSet@1.2084.1.37, 2010-02-02 08:28:17+00:00, stenn@poog.il.thewrittenword.com
+ [Bug 1469] more int32 cleanup
+
+ configure.ac@1.476 +1 -1
+ [Bug 1469] more int32 cleanup
+
+ include/ntp_types.h@1.18 +4 -3
+ [Bug 1469] more int32 cleanup
+
+ChangeSet@1.2082.4.51, 2010-02-02 08:09:04+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1473] "make distcheck" before build can't make sntp/version.m4.
+
+ ChangeLog@1.496.26.33 +1 -0
+ [Bug 1473] "make distcheck" before build can't make sntp/version.m4.
+
+ Makefile.am@1.90 +12 -1
+ add COPYRIGHT-please target for use by sntp/Makefile.am
+ minor tweak to COPYRIGHT action to create intermediate file in
+ build dir not $(srcdir) to minimize parallel VPATH makes
+ interfering with each other.
+ add do-nothing action for rule lacking one to avoid any use
+ of SCCS get default.
+
+ sntp/Makefile.am@1.21.1.5 +34 -5
+ [Bug 1473] "make distcheck" before build can't make sntp/version.m4.
+ add targets for autogen-version.def, version.def, version.m4, and
+ version.texi which invoke a submake on the corresponding check-*
+ targets, avoiding an explicit dependency which would cause Autogen
+ to be invoked to make sntp-opts.h, which would be considered out-
+ of-date because version.def is, and version,def because it depends
+ on non-existent check-version.def. The submake ensures the check
+ action is taken without introducing the troublesome dependency.
+ use "cd .. && $(MAKE) COPYRIGHT-please" to work around quirk with
+ FreeBSD 6.x make which fails with "make COPYRIGHT" when
+ "make ./COPYRIGHT" would work.
+
+ChangeSet@1.2082.4.50, 2010-02-02 01:29:56+00:00, davehart@shiny.ad.hartbrothers.com
+ Makefile.am:
+ keyword-gen-utd is intended to have one line of content.
+
+ ntpd/Makefile.am@1.80.1.7 +1 -1
+ keyword-gen-utd is intended to have one line of content.
+
+ChangeSet@1.2084.14.1, 2010-02-01 18:15:31+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_data_structures.h:
+ ensure size_t is available by including stddef.h
+
+ include/ntp_data_structures.h@1.7 +1 -0
+ ensure size_t is available by including stddef.h
+
+ChangeSet@1.2084.13.5, 2010-02-01 04:40:15+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1471] CID 120 CID 121 CID 122 is_ip_address() uninit family.
+ [Bug 1472] CID 116 CID 117 minor warnings in new DNS code.
+
+ ChangeLog@1.513.1.5 +2 -0
+ [Bug 1471] CID 120 CID 121 CID 122 is_ip_address() uninit family.
+ [Bug 1472] CID 116 CID 117 minor warnings in new DNS code.
+
+ include/ntp_io.h@1.15 +1 -1
+ [Bug 1471] CID 120 CID 121 CID 122 is_ip_address() uninit family.
+ [Bug 1472] CID 116 CID 117 minor warnings in new DNS code.
+
+ ntpd/ntp_config.c@1.245 +7 -9
+ [Bug 1471] CID 120 CID 121 CID 122 is_ip_address() uninit family.
+
+ ntpd/ntp_intres.c@1.80.1.1 +4 -1
+ [Bug 1472] CID 116 CID 117 minor warnings in new DNS code.
+
+ ntpd/ntp_io.c@1.312 +5 -3
+ [Bug 1471] CID 120 CID 121 CID 122 is_ip_address() uninit family.
+
+ ntpd/ntpd.c@1.110.1.4 +7 -4
+ [Bug 1471] CID 120 CID 121 CID 122 is_ip_address() uninit family.
+ [Bug 1472] CID 116 CID 117 minor warnings in new DNS code.
+
+ChangeSet@1.2082.4.49, 2010-02-01 01:56:41+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a.
+
+ ChangeLog@1.496.26.32 +1 -0
+ [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a.
+
+ bootstrap@1.28.1.3 +5 -6
+ add ntpd/keyword-gen.out to touch targets, at same time as ntp_parser.h.
+
+ ntpd/Makefile.am@1.80.1.6 +41 -26
+ [Bug 1470] "make distdir" in $srcdir builds keyword-gen, libntp.a.
+ Avoid building keyword-gen if its output is up-to-date in general.
+
+ ntpd/keyword-gen-utd@1.1 +1 -0
+ intermediate Makefile target used in avoiding building keyword-gen
+ after bootstrap or from tarball unless sources change, necessary
+ to ensure "make distdir" can succeed before compiling without
+ compiling. See [Bug 1470].
+
+ ntpd/keyword-gen-utd@1.0 +0 -0
+
+ChangeSet@1.2084.13.4, 2010-01-31 10:32:07+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P13
+ TAG: NTP_4_2_7P13
+
+ ChangeLog@1.513.1.4 +1 -0
+ NTP_4_2_7P13
+
+ ntpd/ntpd-opts.c@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpd/ntpd-opts.h@1.14 +3 -3
+ NTP_4_2_7P13
+
+ ntpd/ntpd-opts.texi@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpd/ntpd.1@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpdc/ntpdc-opts.c@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpdc/ntpdc-opts.h@1.14 +3 -3
+ NTP_4_2_7P13
+
+ ntpdc/ntpdc-opts.texi@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpdc/ntpdc.1@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpq/ntpq-opts.c@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpq/ntpq-opts.h@1.14 +3 -3
+ NTP_4_2_7P13
+
+ ntpq/ntpq-opts.texi@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpq/ntpq.1@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.14 +3 -3
+ NTP_4_2_7P13
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.14 +2 -2
+ NTP_4_2_7P13
+
+ ntpsnmpd/ntpsnmpd.1@1.14 +2 -2
+ NTP_4_2_7P13
+
+ packageinfo.sh@1.15 +1 -1
+ NTP_4_2_7P13
+
+ sntp/sntp-opts.c@1.14 +2 -2
+ NTP_4_2_7P13
+
+ sntp/sntp-opts.h@1.14 +3 -3
+ NTP_4_2_7P13
+
+ sntp/sntp-opts.texi@1.14 +2 -2
+ NTP_4_2_7P13
+
+ sntp/sntp.1@1.14 +2 -2
+ NTP_4_2_7P13
+
+ sntp/sntp.html@1.14 +1 -1
+ NTP_4_2_7P13
+
+ util/ntp-keygen-opts.c@1.14 +2 -2
+ NTP_4_2_7P13
+
+ util/ntp-keygen-opts.h@1.14 +3 -3
+ NTP_4_2_7P13
+
+ util/ntp-keygen-opts.texi@1.14 +2 -2
+ NTP_4_2_7P13
+
+ util/ntp-keygen.1@1.14 +2 -2
+ NTP_4_2_7P13
+
+ChangeSet@1.2084.13.3, 2010-01-31 02:18:32-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ChangeLog@1.513.1.3 +1 -1
+ cleanup
+
+ChangeSet@1.2082.4.48, 2010-01-30 18:06:35-05:00, stenn@whimsy.udel.edu
+ [Bug 1467] Fix bogus rebuild of sntp/sntp.html
+
+ ChangeLog@1.496.26.31 +4 -0
+ [Bug 1467] Fix bogus rebuild of sntp/sntp.html
+
+ bootstrap@1.28.1.2 +1 -1
+ [Bug 1467] Fix bogus rebuild of sntp/sntp.html
+
+ChangeSet@1.2084.13.2, 2010-01-30 18:02:25-05:00, stenn@whimsy.udel.edu
+ [Bug 1467] Fix bogus rebuild of sntp/sntp.html
+
+ ChangeLog@1.513.1.2 +1 -0
+ [Bug 1467] Fix bogus rebuild of sntp/sntp.html
+
+ bootstrap@1.31 +1 -1
+ [Bug 1467] Fix bogus rebuild of sntp/sntp.html
+
+ChangeSet@1.2084.1.35, 2010-01-30 22:35:13+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ reword to better fit with surrounding messages
+
+ configure.ac@1.475 +2 -2
+ reword to better fit with surrounding messages
+
+ChangeSet@1.2084.1.34, 2010-01-30 22:28:30+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ attempt to properly quote all args to AC_LANG_PROGRAM()
+
+ configure.ac@1.474 +39 -39
+ attempt to properly quote all args to AC_LANG_PROGRAM()
+
+ChangeSet@1.2084.1.33, 2010-01-30 22:16:54+00:00, davehart@shiny.ad.hartbrothers.com
+ check for int32, u_int32 before testing result.
+
+ configure.ac@1.473 +3 -1
+ check for int32, u_int32 before testing result.
+
+ChangeSet@1.2084.1.32, 2010-01-30 17:53:03+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ ChangeLog@1.516 +1 -1
+ [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ configure.ac@1.472 +56 -22
+ [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ include/ntp_types.h@1.17 +11 -7
+ [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ ntpd/ntp_intres.c@1.81 +6 -0
+ [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ChangeSet@1.2084.13.1, 2010-01-30 10:31:55+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P12
+ TAG: NTP_4_2_7P12
+
+ ChangeLog@1.513.1.1 +1 -0
+ NTP_4_2_7P12
+
+ ntpd/ntpd-opts.c@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpd/ntpd-opts.h@1.13 +3 -3
+ NTP_4_2_7P12
+
+ ntpd/ntpd-opts.texi@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpd/ntpd.1@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpdc/ntpdc-opts.c@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpdc/ntpdc-opts.h@1.13 +3 -3
+ NTP_4_2_7P12
+
+ ntpdc/ntpdc-opts.texi@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpdc/ntpdc.1@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpq/ntpq-opts.c@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpq/ntpq-opts.h@1.13 +3 -3
+ NTP_4_2_7P12
+
+ ntpq/ntpq-opts.texi@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpq/ntpq.1@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.13 +3 -3
+ NTP_4_2_7P12
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.13 +2 -2
+ NTP_4_2_7P12
+
+ ntpsnmpd/ntpsnmpd.1@1.13 +2 -2
+ NTP_4_2_7P12
+
+ packageinfo.sh@1.14 +1 -1
+ NTP_4_2_7P12
+
+ sntp/sntp-opts.c@1.13 +2 -2
+ NTP_4_2_7P12
+
+ sntp/sntp-opts.h@1.13 +3 -3
+ NTP_4_2_7P12
+
+ sntp/sntp-opts.texi@1.13 +2 -2
+ NTP_4_2_7P12
+
+ sntp/sntp.1@1.13 +2 -2
+ NTP_4_2_7P12
+
+ sntp/sntp.html@1.13 +1 -1
+ NTP_4_2_7P12
+
+ util/ntp-keygen-opts.c@1.13 +2 -2
+ NTP_4_2_7P12
+
+ util/ntp-keygen-opts.h@1.13 +3 -3
+ NTP_4_2_7P12
+
+ util/ntp-keygen-opts.texi@1.13 +2 -2
+ NTP_4_2_7P12
+
+ util/ntp-keygen.1@1.13 +2 -2
+ NTP_4_2_7P12
+
+ChangeSet@1.2084.1.30, 2010-01-30 06:26:12+00:00, davehart@shiny.ad.hartbrothers.com
+ * [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ ChangeLog@1.514 +1 -0
+ * [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ include/ntp_types.h@1.16 +8 -6
+ * [Bug 1469] u_int32, int32 changes broke HP-UX 10.20 build.
+
+ChangeSet@1.2084.1.29, 2010-01-29 20:11:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1468] 'make install' broken for root on default NFS mount.
+
+ ChangeLog@1.513 +3 -0
+ * [Bug 1468] 'make install' broken for root on default NFS mount.
+ Add a more explicit note to 4.2.7p11 section about new DNS code.
+
+ libparse/Makefile.am@1.20 +21 -37
+ [Bug 1468] 'make install' broken for root on default NFS mount.
+ Ensure workaround to clean any stale $(builddir)/info_trimble.c
+ completes its work in "make all" so it does not fire during
+ "make install" where creating files in $(builddir) may not be
+ possible, such as root on a default NFS-mounted directory.
+
+ChangeSet@1.2084.1.28, 2010-01-28 10:35:48+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P11
+ TAG: NTP_4_2_7P11
+
+ ChangeLog@1.512 +1 -0
+ NTP_4_2_7P11
+
+ ntpd/ntpd-opts.c@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpd/ntpd-opts.h@1.12 +3 -3
+ NTP_4_2_7P11
+
+ ntpd/ntpd-opts.texi@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpd/ntpd.1@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpdc/ntpdc-opts.c@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpdc/ntpdc-opts.h@1.12 +3 -3
+ NTP_4_2_7P11
+
+ ntpdc/ntpdc-opts.texi@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpdc/ntpdc.1@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpq/ntpq-opts.c@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpq/ntpq-opts.h@1.12 +3 -3
+ NTP_4_2_7P11
+
+ ntpq/ntpq-opts.texi@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpq/ntpq.1@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.12 +3 -3
+ NTP_4_2_7P11
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.12 +2 -2
+ NTP_4_2_7P11
+
+ ntpsnmpd/ntpsnmpd.1@1.12 +2 -2
+ NTP_4_2_7P11
+
+ packageinfo.sh@1.13 +1 -1
+ NTP_4_2_7P11
+
+ sntp/sntp-opts.c@1.12 +2 -2
+ NTP_4_2_7P11
+
+ sntp/sntp-opts.h@1.12 +3 -3
+ NTP_4_2_7P11
+
+ sntp/sntp-opts.texi@1.12 +2 -2
+ NTP_4_2_7P11
+
+ sntp/sntp.1@1.12 +2 -2
+ NTP_4_2_7P11
+
+ sntp/sntp.html@1.12 +1 -1
+ NTP_4_2_7P11
+
+ util/ntp-keygen-opts.c@1.12 +2 -2
+ NTP_4_2_7P11
+
+ util/ntp-keygen-opts.h@1.12 +3 -3
+ NTP_4_2_7P11
+
+ util/ntp-keygen-opts.texi@1.12 +2 -2
+ NTP_4_2_7P11
+
+ util/ntp-keygen.1@1.12 +2 -2
+ NTP_4_2_7P11
+
+ChangeSet@1.2084.1.27, 2010-01-27 21:16:20+00:00, davehart@shiny.ad.hartbrothers.com
+ convert leftover debugging msyslog() to DPRINTF()
+ "attempting to open log %s"
+
+ ntpd/ntpd.c@1.110.1.3 +1 -1
+ convert leftover debugging msyslog() to DPRINTF()
+ "attempting to open log %s"
+
+ChangeSet@1.2084.1.26, 2010-01-27 20:21:24+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix libparse build in $(srcdir)
+
+ libparse/Makefile.am@1.19 +1 -1
+ Fix libparse build in $(srcdir)
+
+ChangeSet@1.2084.1.25, 2010-01-27 18:45:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 47] Debugging and logging do not work after a fork.
+ [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+ #include <config.h> from all .c files and do not include it
+ from any .h files. Previously config.h appeared a dozen times in
+ preprocessed output of some .c files.
+ handle relative path to logfile correctly despite re-opening
+ after fork() with a different curdir.
+ eliminate hand-crafted byte-swapping code from refclock_palisade.c in
+ preference to using htonl(), htons(). Tested by Fernando Hauscarriaga.
+
+
+ BitKeeper/etc/ignore@1.75 +4 -2
+ add *.vcproj.*.user
+ correct .buildkey to .buildkey-* to reflect changed build script,
+ add .flockbuild-* along the same lines.
+ tell BK to not attempt any operations in A.*/ dirs via -prune,
+ particularly handy when there's a broken make dist distdir,
+ which may contain copies of BK metadata (s.* files).
+
+ ChangeLog@1.511 +3 -0
+ [Bug 47] Debugging and logging do not work after a fork.
+ [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+
+ configure.ac@1.471 +18 -18
+ add AC_FUNC_ALLOCA (used by ntp_malloc.h, ntp_intres.c).
+ add AC_CHECK_FUNCS(closefrom)
+ remove AC_CHECK_FUNCS(timer_settime) which is redundant with
+ AC_CHECK_FUNCS(timer_create).
+ add AC_CHECK_FUNCS(_exit)
+ remove --enable-force-defer-DNS switch to configure, as the intres
+ path is always taken now.
+
+ include/Makefile.am@1.39 +2 -0
+ add ntp_worker.h, ntp_workimpl.h
+
+ include/iosignal.h@1.5 +36 -8
+ Move USE_SIGIO/USE_SIGPOLL definition from iosignal.c to share with
+ ntpd/work_fork.c.
+ Stay out of system/compiler underscore-prefixed namespace.
+
+ include/l_stdlib.h@1.18 +4 -8
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ Stay out of system/compiler underscore-prefixed namespace.
+
+ include/ntp_data_structures.h@1.6 +39 -13
+ Preserve callsite __FILE__ and __LINE__ for create_priority_queue()
+ and get_node() for heap leak detection when available.
+ Stay out of system/compiler underscore-prefixed namespace.
+
+ include/ntp_fp.h@1.16 +2 -2
+ whitespace cleanup (spaces -> tabs)
+
+ include/ntp_intres.h@1.3 +19 -10
+ repurpose ntp_intres.h, which used to solely be responsible for
+ defining NO_INTRES if needed. Now ntp_workimpl.h handles the
+ declaration of the opposite-sense WORKER as needed, and
+ ntp_intres.h is an internal header for intres declarations
+ used by ntp_worker.c and ntp_intres.c.
+
+ include/ntp_io.h@1.14 +13 -7
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ Add close_all_beyond() and update_resp_pipe_fd() declarations.
+
+ include/ntp_lists.h@1.2 +0 -4
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ include/ntp_machine.h@1.26.1.1 +6 -170
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ Remove huge blob of #if 0 code from pre-Autoconf days, our
+ transition to handling most platform differences via
+ configure is long past.
+
+ include/ntp_malloc.h@1.4 +29 -4
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ Handle platform differences with alloca()
+
+ include/ntp_proto.h@1.4.1.1 +3 -7
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ Stay out of system/compiler underscore-prefixed namespace.
+
+ include/ntp_rfc2553.h@1.34 +0 -5
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ include/ntp_select.h@1.5 +16 -21
+ whitespace (indent preprocessor directives)
+
+ include/ntp_stdlib.h@1.41 +1 -1
+ add humantime() declaration (libntp/humandate.c)
+ remove superfluous #include "ntp_rfc2553.h"
+
+ include/ntp_string.h@1.5 +3 -7
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ Stay out of system/compiler underscore-prefixed namespace.
+
+ include/ntp_syscall.h@1.9 +0 -4
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ include/ntp_syslog.h@1.4 +11 -9
+ handle relative path to logfile correctly despite re-opening
+ after fork() with a different curdir.
+
+ include/ntp_types.h@1.15 +8 -8
+ Use typedef instead of #define to declare int32, u_int32.
+
+ include/ntp_worker.h@1.1 +52 -0
+ worker internals used by ntp_worker.c, work_fork.c, work_thread.c,
+ and ntp_intres.c.
+
+ include/ntp_worker.h@1.0 +0 -0
+
+ include/ntp_workimpl.h@1.1 +25 -0
+ defines WORKER, WORK_FORK, and WORK_THREAD as appropriate (chooses
+ implementation to use).
+
+ include/ntp_workimpl.h@1.0 +0 -0
+
+ include/ntpd.h@1.137.1.2 +72 -42
+ handle relative path to logfile correctly despite re-opening
+ after fork() with a different curdir.
+ remove declarations from old ntp_intres.c implementation, add
+ declarations for new ntp_intres.c, ntp_worker.c, work_fork.c,
+ and work_thread.c.
+ Correct a few misplaces variable and function declarations. ntpd.h
+ declares all the functions from various files first, then all
+ the variables, so there are two spots for declarations for each
+ source file.
+
+ include/recvbuff.h@1.20 +1 -5
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/atoint.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/atolfp.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/atouint.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/authusekey.c@1.8 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/caljulian.c@1.12 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/caltontp.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/calyearstart.c@1.5 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/clocktime.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/clocktypes.c@1.19 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/dofptoa.c@1.7 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/dolfptoa.c@1.7 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/emalloc.c@1.11 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/fptoa.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/fptoms.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/getopt.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/hextoint.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/hextolfp.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/humandate.c@1.8 +33 -6
+ sprintf() -> snprintf()
+ add humantime() used by ntp_intres.c DPRINTF() calls.
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/icom.c@1.12 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/iosignal.c@1.15 +0 -28
+ Move USE_SIGIO/USE_SIGPOLL definition to iosignal.h to share with
+ ntpd/work_fork.c.
+
+ libntp/mfptoa.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/mfptoms.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/mktime.c@1.9 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/modetoa.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/mstolfp.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/msutotsf.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/msyslog.c@1.25 +40 -38
+ handle relative path to logfile correctly despite re-opening
+ after fork() with a different curdir.
+ mimic syslog() behavior adding a trailing \n if not present
+ when logging to a file.
+
+ libntp/netof.c@1.8 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/octtoint.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/prettydate.c@1.13 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/refnumtoa.c@1.8 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/socktohost.c@1.8 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/strdup.c@1.6 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/syssignal.c@1.10 +40 -51
+ Do not msyslog(LOG_DEBUG) about signal flags simply because SA_SIGINFO
+ flag bit is set.
+ Define SIG_ERR, Z_SA_RESTART, Z_SA_SIGINFO to reduce #ifdef nesting.
+
+ libntp/systime.c@1.49 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/tsftomsu.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/tstotv.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/tvtots.c@1.3 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/uglydate.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/uinttoa.c@1.3 +2 -1
+ sprintf() -> snprintf()
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libntp/ymd2yd.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libparse/Makefile.am@1.18 +61 -69
+ Correct generation of info_trimble.c to create it in $(srcdir)
+ instead of $(builddir)
+ Add temporary workaround to avoid breaking existing build trees
+ with this change, which aggressively removes info_trimble.c
+ from $(builddir) where it tends to have precedence.
+ Correct k*.o rule dependencies to use $(srcdir)/ prefix.
+ Remove ansi2knr crud (such as kclk_computime_.o: clk_computime_.c
+ rule).
+ Correct workaround which generates local sys/systm.h to be able
+ to work more than once by not breaking if sys/ subdir exists.
+
+ libparse/binio.c@1.7 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libparse/data_mbg.c@1.10 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libparse/gpstolfp.c@1.10 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libparse/info_trimble.c@1.5 +1 -1
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ (produced by updated mkinfo_rcmd.sed and mkinfo_scmd.sed)
+
+ libparse/mfp_mul.c@1.8 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libparse/mkinfo_rcmd.sed@1.3 +4 -4
+ produce the same output using FreeBSD or GNU sed
+
+ libparse/mkinfo_scmd.sed@1.3 +5 -6
+ produce the same output using FreeBSD or GNU sed.
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libparse/parsesolaris.c@1.9 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ libparse/trim_info.c@1.5 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ntpd/Makefile.am@1.87 +4 -1
+ add ntp_worker.c, work_fork.c, work_thread.c references.
+
+ ntpd/cmd_args.c@1.56.1.3 +2 -3
+ remove unused leftover global specific_interface.
+ rindex() -> strrchr()
+
+ ntpd/ntp_config.c@1.244 +359 -589
+ [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+ handle relative path to logfile correctly despite re-opening
+ after fork() with a different curdir.
+ include system headers before NTP ones.
+ No need to include ntpsim.h in ntp_config.c these days.
+
+ ntpd/ntp_control.c@1.130 +2 -3
+ style only
+
+ ntpd/ntp_data_structures.c@1.12 +108 -67
+ Preserve callsite __FILE__ and __LINE__ for create_priority_queue()
+ and get_node() for heap leak detection when available.
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ntpd/ntp_intres.c@1.80 +765 -1119
+ [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+
+ ntpd/ntp_io.c@1.311 +134 -70
+ [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+
+ ntpd/ntp_timer.c@1.57 +53 -46
+ add worker_idle_timer and worker_idle_timer_fired() for
+ ntp_worker.c.
+ remove references to HAVE_TIMER_SETTIME which is redundant with
+ HAVE_TIMER_CREATE.
+ define TC_ERR macro to reduce #ifdef clutter.
+ eliminate global sys_time which was referenced only by timer(),
+ replacing with a local. call get_systime() only if the
+ result will be used in timer().
+
+ ntpd/ntp_worker.c@1.1 +155 -0
+ blocking worker child process/thread cross-platform code
+
+ ntpd/ntp_worker.c@1.0 +0 -0
+
+ ntpd/ntpd.c@1.110.1.2 +231 -123
+ [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+ remove unused leftover global specific_interface.
+ move close-all-descriptors code to ntp_io.c close_all_beyond(),
+ used by work_fork.c as well.
+ handle relative path to logfile correctly despite re-opening
+ after fork() with a different curdir.
+
+ ntpd/ntpsim.c@1.23 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ntpd/refclock_jupiter.c@1.22 +1 -1
+ XNTP_BIG_ENDIAN -> WORDS_BIG_ENDIAN (from config.h)
+
+ ntpd/refclock_palisade.c@1.32 +33 -58
+ eliminate hand-crafted byte-swapping code in preference
+ to using htonl(), htons(). Tested by Fernando Hauscarriaga.
+
+ ntpd/refclock_palisade.h@1.14 +8 -12
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ eliminate hand-crafted byte-swapping code in preference
+ to using htonl(), htons(). Tested by Fernando Hauscarriaga.
+ stay out of system/compiler underscore-prefixed namespace.
+
+ ntpd/work_fork.c@1.1 +460 -0
+ blocking worker child process fork()/pipe() platform code
+
+ ntpd/work_fork.c@1.0 +0 -0
+
+ ntpd/work_thread.c@1.1 +314 -0
+ blocking worker child thread platform code
+
+ ntpd/work_thread.c@1.0 +0 -0
+
+ ntpdc/ntpdc-layout.c@1.2 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ntpdc/ntpdc.c@1.78 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ntpq/ntpq-subs.c@1.39.1.3 +40 -40
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+ dump received association IDs if (debug).
+ Remove bogus sanity check (requiring all peers use port 123 or
+ be silently excluded from ntpq -p output).
+
+ ntpq/ntpq.c@1.99 +1 -1
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.4 +6 -0
+ #undef PACKAGE_* names that net-snmp-* headers often define
+ in conflict with ours.
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ntpsnmpd/ntpsnmpd.c@1.4 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ parseutil/testdcf.c@1.8 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ports/winnt/include/config.h@1.82 +43 -8
+ Use macros for ntohl() and friends, which are real function calls
+ by default on Windows.
+
+ ports/winnt/include/sys/time.h@1.6 +0 -2
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ports/winnt/include/win32_io.h@1.2 +2 -3
+ style
+
+ ports/winnt/libntp/SetSystemTime.c@1.8 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.39 +1 -1
+ Now that main ntpd directory is on include path, remove path to
+ ntpd-opts.h from #include.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.52 +18 -13
+ [Bug 1010] getaddrinfo() could block and thus should not be called by
+ the main thread/process.
+
+ ports/winnt/vc6/ntpd.dsp@1.47 +23 -0
+ add ntp_worker.c, work_fork.c, work_thread.c, ntp_worker.h,
+ ntp_workimpl.h references.
+
+ ports/winnt/vs2003/ntpd.vcproj@1.8 +15 -0
+ add ntp_worker.c, work_fork.c, work_thread.c, ntp_worker.h,
+ ntp_workimpl.h references.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.8 +20 -0
+ add ntp_worker.c, work_fork.c, work_thread.c, ntp_worker.h,
+ ntp_workimpl.h references.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.26 +28 -0
+ add icom.c, strdup.c, strstr.c references.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.26 +200 -0
+ add ntp_worker.c, work_fork.c, work_thread.c, ntp_worker.h,
+ ntp_workimpl.h, ntpsim.c, ntp_data_structures.h,
+ refclock_ripencc.c, libparse/binio.c, libparse/gsptolfp.c,
+ libparse/ieee754io.c, libparse/info_trimble.c,
+ libparse/mfp_mul.c, libparse/parsesolaris.c,
+ libparse/parsestreams.c, libparse/trim_info.c references.
+
+ sntp/crypto.c@1.11 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ sntp/kod_management.c@1.17 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ sntp/log.c@1.12 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ sntp/main.c@1.25 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ sntp/networking.c@1.30 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ sntp/utilities.c@1.11 +1 -0
+ #include <config.h> from all .c files and do not include it
+ from any .h files.
+
+ChangeSet@1.2084.1.24, 2010-01-24 11:44:49+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P10
+ TAG: NTP_4_2_7P10
+
+ ChangeLog@1.510 +1 -0
+ NTP_4_2_7P10
+
+ ntpd/ntpd-opts.c@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpd/ntpd-opts.h@1.11 +3 -3
+ NTP_4_2_7P10
+
+ ntpd/ntpd-opts.texi@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpd/ntpd.1@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpdc/ntpdc-opts.c@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpdc/ntpdc-opts.h@1.11 +3 -3
+ NTP_4_2_7P10
+
+ ntpdc/ntpdc-opts.texi@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpdc/ntpdc.1@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpq/ntpq-opts.c@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpq/ntpq-opts.h@1.11 +3 -3
+ NTP_4_2_7P10
+
+ ntpq/ntpq-opts.texi@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpq/ntpq.1@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.11 +3 -3
+ NTP_4_2_7P10
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.11 +2 -2
+ NTP_4_2_7P10
+
+ ntpsnmpd/ntpsnmpd.1@1.11 +2 -2
+ NTP_4_2_7P10
+
+ packageinfo.sh@1.12 +1 -1
+ NTP_4_2_7P10
+
+ sntp/sntp-opts.c@1.11 +2 -2
+ NTP_4_2_7P10
+
+ sntp/sntp-opts.h@1.11 +3 -3
+ NTP_4_2_7P10
+
+ sntp/sntp-opts.texi@1.11 +2 -2
+ NTP_4_2_7P10
+
+ sntp/sntp.1@1.11 +2 -2
+ NTP_4_2_7P10
+
+ sntp/sntp.html@1.11 +1 -1
+ NTP_4_2_7P10
+
+ util/ntp-keygen-opts.c@1.11 +2 -2
+ NTP_4_2_7P10
+
+ util/ntp-keygen-opts.h@1.11 +3 -3
+ NTP_4_2_7P10
+
+ util/ntp-keygen-opts.texi@1.11 +2 -2
+ NTP_4_2_7P10
+
+ util/ntp-keygen.1@1.11 +2 -2
+ NTP_4_2_7P10
+
+ChangeSet@1.2082.4.47, 2010-01-24 10:31:32+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_6P1_RC3
+ TAG: NTP_4_2_6P1_RC3
+
+ ChangeLog@1.496.26.30 +1 -0
+ NTP_4_2_6P1_RC3
+
+ ntpd/ntpd-opts.c@1.248.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpd/ntpd-opts.h@1.248.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpd/ntpd-opts.texi@1.246.3.1 +2 -2
+ NTP_4_2_6P1_RC3
+
+ ntpd/ntpd.1@1.246.3.1 +2 -2
+ NTP_4_2_6P1_RC3
+
+ ntpdc/ntpdc-opts.c@1.244.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpdc/ntpdc-opts.h@1.244.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpdc/ntpdc-opts.texi@1.243.3.1 +3 -3
+ NTP_4_2_6P1_RC3
+
+ ntpdc/ntpdc.1@1.243.3.1 +2 -2
+ NTP_4_2_6P1_RC3
+
+ ntpq/ntpq-opts.c@1.245.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpq/ntpq-opts.h@1.245.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpq/ntpq-opts.texi@1.244.3.1 +3 -3
+ NTP_4_2_6P1_RC3
+
+ ntpq/ntpq.1@1.244.3.1 +2 -2
+ NTP_4_2_6P1_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.3.1 +3 -3
+ NTP_4_2_6P1_RC3
+
+ ntpsnmpd/ntpsnmpd.1@1.122.3.1 +2 -2
+ NTP_4_2_6P1_RC3
+
+ packageinfo.sh@1.255.5.1 +1 -1
+ NTP_4_2_6P1_RC3
+
+ sntp/sntp-opts.c@1.117.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ sntp/sntp-opts.h@1.117.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ sntp/sntp-opts.texi@1.117.3.1 +3 -3
+ NTP_4_2_6P1_RC3
+
+ sntp/sntp.1@1.117.3.1 +2 -2
+ NTP_4_2_6P1_RC3
+
+ sntp/sntp.html@1.7.3.1 +1 -1
+ NTP_4_2_6P1_RC3
+
+ util/ntp-keygen-opts.c@1.247.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ util/ntp-keygen-opts.h@1.247.3.1 +4 -4
+ NTP_4_2_6P1_RC3
+
+ util/ntp-keygen-opts.texi@1.246.3.1 +3 -3
+ NTP_4_2_6P1_RC3
+
+ util/ntp-keygen.1@1.246.3.1 +2 -2
+ NTP_4_2_6P1_RC3
+
+ChangeSet@1.2084.1.23, 2010-01-24 04:30:32-05:00, stenn@whimsy.udel.edu
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ ChangeLog@1.509 +1 -0
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ html/debug.html@1.28 +3 -3
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ html/decode.html@1.12 +11 -7
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ html/ntpq.html@1.37 +11 -7
+ [Bug 1140] Clean up debug.html, decode.html, and ntpq.html
+
+ChangeSet@1.2082.4.46, 2010-01-24 03:49:59-05:00, stenn@whimsy.udel.edu
+ Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in
+
+ ChangeLog@1.496.26.29 +4 -3
+ Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in
+
+ scripts/mkver.in@1.12 +1 -1
+ Use TZ=UTC instead of TZ= when calling date in scripts/mkver.in
+
+ChangeSet@1.2082.4.45, 2010-01-24 03:44:05-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ChangeLog@1.496.26.28 +2 -2
+ cleanup
+
+ChangeSet@1.2082.4.44, 2010-01-24 03:39:27-05:00, stenn@whimsy.udel.edu
+ [Bug 1449] SLEW is no longer needed by the simulator
+
+ include/ntpsim.h@1.12.1.1 +0 -1
+ [Bug 1449] SLEW is no longer needed by the simulator
+
+ChangeSet@1.2084.1.21, 2010-01-24 00:16:39-05:00, mayer@pogo.udel.edu
+ Fix move results for vc6
+
+ ports/winnt/vc6/libntp.dsp@1.51 +17 -17
+ Fix move results for vc6
+
+ ports/winnt/vc6/ntpd.dsp@1.46 +3 -4
+ Fix move results for vc6
+
+ChangeSet@1.2084.1.20, 2010-01-24 00:03:42-05:00, mayer@pogo.udel.edu
+ Remerge of bugs 1448-1450
+
+ ChangeLog@1.507 +4 -0
+ Remerge of bugs 1448-1450
+
+ChangeSet@1.2082.4.43, 2010-01-23 23:09:00-05:00, mayer@pogo.udel.edu
+ Bad inputdir reference
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.9 +1 -1
+ Bad inputdir reference
+
+ChangeSet@1.2082.4.42, 2010-01-22 11:49:48+01:00, burnicki@pogo.udel.edu
+ Create the instserv binaries in the correct directories.
+
+ ports/winnt/vc6/Instsrv.dsp@1.12 +2 -2
+ Create the instserv binaries in the correct directories.
+
+ChangeSet@1.2082.4.41, 2010-01-21 23:37:23-05:00, mayer@pogo.udel.edu
+ Remove ipv6.c as unnecessary
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.8 +0 -4
+ Remove ipv6.c as unnecessary
+
+ChangeSet@1.2082.4.40, 2010-01-17 22:28:21-05:00, mayer@pogo.udel.edu
+ Temporarily include ntpsim.h unconditionally
+
+ ntpd/ntp_config.c@1.241.1.2 +5 -2
+ Temporarily include ntpsim.h unconditionally
+
+ChangeSet@1.2082.4.38, 2010-01-16 23:20:10-05:00, mayer@pogo.udel.edu
+ [Bug 1448] Additional fixes for Windows VC6
+
+ lib/isc/win32/net.c@1.14 +2 -2
+ [Bug 1448] Additional fixes for Windows VC6
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.7 +23 -15
+ [Bug 1448] Additional fixes for Windows VC6
+
+ChangeSet@1.2084.1.18, 2010-01-13 10:30:51+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P9
+ TAG: NTP_4_2_7P9
+
+ ChangeLog@1.505 +1 -0
+ NTP_4_2_7P9
+
+ ntpd/ntpd-opts.c@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpd/ntpd-opts.h@1.10 +3 -3
+ NTP_4_2_7P9
+
+ ntpd/ntpd-opts.texi@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpd/ntpd.1@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpdc/ntpdc-opts.c@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpdc/ntpdc-opts.h@1.10 +3 -3
+ NTP_4_2_7P9
+
+ ntpdc/ntpdc-opts.texi@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpdc/ntpdc.1@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpq/ntpq-opts.c@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpq/ntpq-opts.h@1.10 +3 -3
+ NTP_4_2_7P9
+
+ ntpq/ntpq-opts.texi@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpq/ntpq.1@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.10 +3 -3
+ NTP_4_2_7P9
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.10 +2 -2
+ NTP_4_2_7P9
+
+ ntpsnmpd/ntpsnmpd.1@1.10 +2 -2
+ NTP_4_2_7P9
+
+ packageinfo.sh@1.11 +1 -1
+ NTP_4_2_7P9
+
+ sntp/sntp-opts.c@1.10 +2 -2
+ NTP_4_2_7P9
+
+ sntp/sntp-opts.h@1.10 +3 -3
+ NTP_4_2_7P9
+
+ sntp/sntp-opts.texi@1.10 +2 -2
+ NTP_4_2_7P9
+
+ sntp/sntp.1@1.10 +2 -2
+ NTP_4_2_7P9
+
+ sntp/sntp.html@1.10 +1 -1
+ NTP_4_2_7P9
+
+ util/ntp-keygen-opts.c@1.10 +2 -2
+ NTP_4_2_7P9
+
+ util/ntp-keygen-opts.h@1.10 +3 -3
+ NTP_4_2_7P9
+
+ util/ntp-keygen-opts.texi@1.10 +2 -2
+ NTP_4_2_7P9
+
+ util/ntp-keygen.1@1.10 +2 -2
+ NTP_4_2_7P9
+
+ChangeSet@1.2084.6.45, 2010-01-12 10:34:14+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P8
+ TAG: NTP_4_2_7P8
+
+ ChangeLog@1.501.1.37 +1 -0
+ NTP_4_2_7P8
+
+ ntpd/ntpd-opts.c@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpd/ntpd-opts.h@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpd/ntpd-opts.texi@1.9 +2 -2
+ NTP_4_2_7P8
+
+ ntpd/ntpd.1@1.9 +2 -2
+ NTP_4_2_7P8
+
+ ntpdc/ntpdc-opts.c@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpdc/ntpdc-opts.h@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpdc/ntpdc-opts.texi@1.9 +3 -3
+ NTP_4_2_7P8
+
+ ntpdc/ntpdc.1@1.9 +2 -2
+ NTP_4_2_7P8
+
+ ntpq/ntpq-opts.c@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpq/ntpq-opts.h@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpq/ntpq-opts.texi@1.9 +3 -3
+ NTP_4_2_7P8
+
+ ntpq/ntpq.1@1.9 +2 -2
+ NTP_4_2_7P8
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.9 +4 -4
+ NTP_4_2_7P8
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.9 +3 -3
+ NTP_4_2_7P8
+
+ ntpsnmpd/ntpsnmpd.1@1.9 +2 -2
+ NTP_4_2_7P8
+
+ packageinfo.sh@1.10 +1 -1
+ NTP_4_2_7P8
+
+ sntp/sntp-opts.c@1.9 +4 -4
+ NTP_4_2_7P8
+
+ sntp/sntp-opts.h@1.9 +4 -4
+ NTP_4_2_7P8
+
+ sntp/sntp-opts.texi@1.9 +3 -3
+ NTP_4_2_7P8
+
+ sntp/sntp.1@1.9 +2 -2
+ NTP_4_2_7P8
+
+ sntp/sntp.html@1.9 +1 -1
+ NTP_4_2_7P8
+
+ util/ntp-keygen-opts.c@1.9 +4 -4
+ NTP_4_2_7P8
+
+ util/ntp-keygen-opts.h@1.9 +4 -4
+ NTP_4_2_7P8
+
+ util/ntp-keygen-opts.texi@1.9 +3 -3
+ NTP_4_2_7P8
+
+ util/ntp-keygen.1@1.9 +2 -2
+ NTP_4_2_7P8
+
+ChangeSet@1.2084.10.4, 2010-01-11 17:06:06+01:00, burnicki@pogo.udel.edu
+ Syntax fix in ntp.dsw and ntpd.dsp for VC6.
+
+ ports/winnt/vc6/ntp.dsw@1.13 +0 -1
+ Syntax fix.
+
+ ports/winnt/vc6/ntpd.dsp@1.43.1.1 +2 -1
+ Syntax fix.
+
+ChangeSet@1.2084.12.2, 2010-01-08 20:00:10+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog: Include (4.2.6p1-RC3) - [Bug 1453] Use $CC in config.cache filename.
+
+ ChangeLog@1.501.6.2 +1 -0
+ ChangeLog: Include (4.2.6p1-RC3) - [Bug 1453] Use $CC in config.cache filename.
+
+ChangeSet@1.2082.16.3, 2010-01-08 19:11:53+00:00, davehart@shiny.ad.hartbrothers.com
+ Makefile.am:
+ add dependencies on copyright.def
+ correct dependencies to refer to $(srcdir)/version.def not
+ $(srcdir)/../include/version.def
+ add COPYRIGHT to BUILT_SOURCES, correct EXTRA_DIST reference to
+ remove unneeded $(srcdir)/ prefix
+
+ sntp/Makefile.am@1.21.1.4 +5 -4
+ add dependencies on copyright.def
+ correct dependencies to refer to $(srcdir)/version.def not
+ $(srcdir)/../include/version.def
+ add COPYRIGHT to BUILT_SOURCES, correct EXTRA_DIST reference to
+ remove unneeded $(srcdir)/ prefix
+
+ChangeSet@1.2082.16.2, 2010-01-08 17:21:14+00:00, davehart@shiny.ad.hartbrothers.com
+ bump copyright year to 2010
+
+ html/copyright.html@1.46 +2 -2
+ bump copyright year to 2010
+
+ include/copyright.def@1.11 +1 -1
+ bump copyright year to 2010
+
+ChangeSet@1.2082.16.1, 2010-01-06 18:52:49+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1453] Use $CC in config.cache filename in ./build script.
+
+ ChangeLog@1.496.41.1 +4 -3
+ [Bug 1453] Use $CC in config.cache filename in ./build script.
+
+ build@1.34 +26 -27
+ [Bug 1453] Use $CC in config.cache filename in ./build script.
+
+ChangeSet@1.2082.4.37, 2010-01-03 23:03:48-05:00, mayer@pogo.udel.edu
+ Undo unneeded change
+
+ lib/isc/netaddr.c@1.8 +1 -1
+ Undo unneeded change
+
+ChangeSet@1.2084.11.2, 2010-01-03 21:56:54+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct ChangeLog to reflect [Bug 1451] in -dev section as well.
+
+ ChangeLog@1.501.5.2 +1 -0
+ Correct ChangeLog to reflect [Bug 1451] in -dev section as well.
+
+ChangeSet@1.2082.15.1, 2010-01-03 21:52:33+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1451] CID 115: sntp leaks KoD entry when updating existing
+ entry.
+
+ ChangeLog@1.496.40.1 +4 -3
+ [Bug 1451] CID 115: sntp leaks KoD entry when updating existing
+ entry.
+
+ sntp/kod_management.c@1.16 +1 -0
+ [Bug 1451] CID 115: sntp leaks KoD entry when updating existing
+ entry.
+
+ChangeSet@1.2084.10.2, 2010-01-02 22:47:59-05:00, mayer@pogo.udel.edu
+ Fixes for Bugs 1448-1450
+
+ ChangeLog@1.501.4.2 +4 -0
+ Fixes for Bugs 1448-1450
+
+ChangeSet@1.2082.4.36, 2010-01-01 23:49:35-05:00, mayer@pogo.udel.edu
+ Fixes for bugs 1448-1450
+
+ ChangeLog@1.496.26.26 +4 -0
+ Fixes for bug 1448-1450
+
+ lib/isc/netaddr.c@1.7 +1 -1
+ [Bug 1448] scope_id and ipv6 any address not defined on vc6 compiler
+
+ lib/isc/win32/include/isc/platform.h@1.7 +2 -2
+ [Bug 1448] Macros not correctly conditionally defined
+
+ lib/isc/win32/interfaceiter.c@1.16 +2 -0
+ [Bug 1448] scope_id and ipv6 any address not defined on vc6 compiler
+
+ ntpd/ntp_config.c@1.241.1.1 +3 -1
+ [Bug 1449] ntpsim.h should only be conditionally included and after ntpd-opts.h
+
+ ports/winnt/include/config.h@1.79.1.1 +2 -2
+ [Bug 1448] Macros not correctly conditionally defined
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.6 +0 -4
+ [Bug 1448] stdtime.c misspelled but not needed at all
+
+ChangeSet@1.2084.6.41, 2009-12-30 21:55:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 702] ntpd service logic should use libopts to examine cmdline.
+
+ ChangeLog@1.501.1.33 +1 -0
+ [Bug 702] ntpd service logic should use libopts to examine cmdline.
+
+ include/ntp_cmdargs.h@1.6 +1 -4
+ remove unused cruft
+
+ include/ntpd.h@1.137.1.1 +1 -0
+ expose parse_cmdline_opts() for use by ntservice.c
+
+ ntpd/cmd_args.c@1.56.1.2 +6 -3
+ comment only
+
+ ntpd/ntp_config.c@1.242 +3 -3
+ minor cleanup
+
+ ntpd/ntpd.c@1.110.1.1 +12 -10
+ [Bug 702] ntpd service logic should use libopts to examine cmdline.
+
+ ports/winnt/include/ntservice.h@1.4 +4 -9
+ [Bug 702] ntpd service logic should use libopts to examine cmdline.
+
+ ports/winnt/ntpd/ntservice.c@1.23 +40 -49
+ [Bug 702] ntpd service logic should use libopts to examine cmdline.
+
+ ports/winnt/vc6/ntpd.dsp@1.44 +2 -2
+ top-level ntpd directory needs to be in include search path
+ for ntservice.c to #include "ntpd-opts.h"
+
+ ports/winnt/vs2003/ntpd.vcproj@1.7 +2 -2
+ top-level ntpd directory needs to be in include search path
+ for ntservice.c to #include "ntpd-opts.h"
+
+ ports/winnt/vs2005/ntpd.vcproj@1.7 +2 -2
+ top-level ntpd directory needs to be in include search path
+ for ntservice.c to #include "ntpd-opts.h"
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.25 +2 -2
+ top-level ntpd directory needs to be in include search path
+ for ntservice.c to #include "ntpd-opts.h"
+
+ChangeSet@1.2084.6.40, 2009-12-30 10:27:13+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P7
+ TAG: NTP_4_2_7P7
+
+ ChangeLog@1.501.1.32 +1 -0
+ NTP_4_2_7P7
+
+ ntpd/ntpd-opts.c@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpd/ntpd-opts.h@1.8 +3 -3
+ NTP_4_2_7P7
+
+ ntpd/ntpd-opts.texi@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpd/ntpd.1@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpdc/ntpdc-opts.c@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpdc/ntpdc-opts.h@1.8 +3 -3
+ NTP_4_2_7P7
+
+ ntpdc/ntpdc-opts.texi@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpdc/ntpdc.1@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpq/ntpq-opts.c@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpq/ntpq-opts.h@1.8 +3 -3
+ NTP_4_2_7P7
+
+ ntpq/ntpq-opts.texi@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpq/ntpq.1@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.8 +3 -3
+ NTP_4_2_7P7
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.8 +2 -2
+ NTP_4_2_7P7
+
+ ntpsnmpd/ntpsnmpd.1@1.8 +2 -2
+ NTP_4_2_7P7
+
+ packageinfo.sh@1.9 +1 -1
+ NTP_4_2_7P7
+
+ sntp/sntp-opts.c@1.8 +2 -2
+ NTP_4_2_7P7
+
+ sntp/sntp-opts.h@1.8 +3 -3
+ NTP_4_2_7P7
+
+ sntp/sntp-opts.texi@1.8 +2 -2
+ NTP_4_2_7P7
+
+ sntp/sntp.1@1.8 +2 -2
+ NTP_4_2_7P7
+
+ sntp/sntp.html@1.8 +1 -1
+ NTP_4_2_7P7
+
+ util/ntp-keygen-opts.c@1.8 +2 -2
+ NTP_4_2_7P7
+
+ util/ntp-keygen-opts.h@1.8 +3 -3
+ NTP_4_2_7P7
+
+ util/ntp-keygen-opts.texi@1.8 +2 -2
+ NTP_4_2_7P7
+
+ util/ntp-keygen.1@1.8 +2 -2
+ NTP_4_2_7P7
+
+ChangeSet@1.2084.9.2, 2009-12-30 05:56:00+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1446] 4.2.7p6 requires autogen, missing ntpd.1, *.texi, *.menu.
+ Applies to prior Makefile.am changesets pulled from ntp-stable,
+ where there is no ChangeLog entry as no tarball rolled with the bug.
+
+ ChangeLog@1.501.3.1 +1 -0
+ [Bug 1446] 4.2.7p6 requires autogen, missing ntpd.1, *.texi, *.menu.
+ Applies to prior Makefile.am changesets pulled from ntp-stable,
+ where there is no ChangeLog entry as no tarball rolled with the bug.
+
+ChangeSet@1.2082.4.35, 2009-12-30 05:48:36+00:00, davehart@shiny.ad.hartbrothers.com
+ With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in
+ *.1, *.texi, and *.html Makefile rules are not needed.
+
+ ntpd/Makefile.am@1.80.1.5 +2 -9
+ With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in
+ *.1, *.texi, and *.html rules are not needed.
+
+ ntpdc/Makefile.am@1.48.1.3 +2 -9
+ With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in
+ *.1, *.texi, and *.html rules are not needed.
+
+ ntpq/Makefile.am@1.43.1.3 +2 -9
+ With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in
+ *.1, *.texi, and *.html rules are not needed.
+
+ ntpsnmpd/Makefile.am@1.16.1.3 +2 -9
+ With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in
+ *.1, *.texi, and *.html rules are not needed.
+
+ sntp/Makefile.am@1.21.1.3 +3 -12
+ With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in
+ *.1, *.texi, and *.html rules are not needed.
+
+ util/Makefile.am@1.45.1.3 +2 -9
+ With EXTRA_DIST fix from [Bug 1446] read-only $(srcdir) hacks in
+ *.1, *.texi, and *.html rules are not needed.
+
+ChangeSet@1.2082.4.34, 2009-12-30 00:23:25+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1446] 4.2.7p6 requires autogen to build missing ntpd.1, *.texi, *.menu.
+
+ ntpd/Makefile.am@1.80.1.4 +4 -1
+ [Bug 1446] 4.2.7p6 requires autogen to build missing ntpd.1, *.texi, *.menu.
+
+ChangeSet@1.2084.6.38, 2009-12-29 16:07:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 620] ntpdc getresponse() esize != *rsize s/b size != *rsize.
+
+ ChangeLog@1.501.1.30 +1 -0
+ [Bug 620] ntpdc getresponse() esize != *rsize s/b size != *rsize.
+
+ ntpdc/ntpdc.c@1.77 +1 -1
+ [Bug 620] ntpdc getresponse() esize != *rsize s/b size != *rsize.
+
+ChangeSet@1.2084.6.37, 2009-12-28 10:30:49+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P6
+ TAG: NTP_4_2_7P6
+
+ ChangeLog@1.501.1.29 +1 -0
+ NTP_4_2_7P6
+
+ ntpd/ntpd-opts.c@1.7 +2 -2
+ NTP_4_2_7P6
+
+ ntpd/ntpd-opts.h@1.7 +3 -3
+ NTP_4_2_7P6
+
+ ntpd/ntpd-opts.texi@1.7 +61 -2
+ NTP_4_2_7P6
+
+ ntpd/ntpd.1@1.7 +2 -2
+ NTP_4_2_7P6
+
+ ntpdc/ntpdc-opts.c@1.7 +2 -2
+ NTP_4_2_7P6
+
+ ntpdc/ntpdc-opts.h@1.7 +3 -3
+ NTP_4_2_7P6
+
+ ntpdc/ntpdc-opts.texi@1.7 +66 -2
+ NTP_4_2_7P6
+
+ ntpdc/ntpdc.1@1.7 +2 -2
+ NTP_4_2_7P6
+
+ ntpq/ntpq-opts.c@1.7 +2 -2
+ NTP_4_2_7P6
+
+ ntpq/ntpq-opts.h@1.7 +3 -3
+ NTP_4_2_7P6
+
+ ntpq/ntpq-opts.texi@1.7 +51 -2
+ NTP_4_2_7P6
+
+ ntpq/ntpq.1@1.7 +2 -2
+ NTP_4_2_7P6
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.7 +2 -2
+ NTP_4_2_7P6
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.7 +3 -3
+ NTP_4_2_7P6
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.7 +23 -2
+ NTP_4_2_7P6
+
+ ntpsnmpd/ntpsnmpd.1@1.7 +2 -2
+ NTP_4_2_7P6
+
+ packageinfo.sh@1.8 +1 -1
+ NTP_4_2_7P6
+
+ sntp/sntp-opts.c@1.7 +2 -2
+ NTP_4_2_7P6
+
+ sntp/sntp-opts.h@1.7 +3 -3
+ NTP_4_2_7P6
+
+ sntp/sntp-opts.texi@1.7 +60 -2
+ NTP_4_2_7P6
+
+ sntp/sntp.1@1.7 +2 -2
+ NTP_4_2_7P6
+
+ sntp/sntp.html@1.7 +1 -1
+ NTP_4_2_7P6
+
+ util/ntp-keygen-opts.c@1.7 +2 -2
+ NTP_4_2_7P6
+
+ util/ntp-keygen-opts.h@1.7 +3 -3
+ NTP_4_2_7P6
+
+ util/ntp-keygen-opts.texi@1.7 +46 -2
+ NTP_4_2_7P6
+
+ util/ntp-keygen.1@1.7 +2 -2
+ NTP_4_2_7P6
+
+ChangeSet@1.2084.6.36, 2009-12-28 04:24:27-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ChangeLog@1.501.1.28 +2 -0
+ cleanup
+
+ChangeSet@1.2082.4.33, 2009-12-28 04:17:49-05:00, stenn@whimsy.udel.edu
+ [Bug 1445] IRIX does not have -lcap or support linux capabilities
+
+ ChangeLog@1.496.26.25 +2 -1
+ [Bug 1445] IRIX does not have -lcap or support linux capabilities
+
+ configure.ac@1.465.1.9 +7 -1
+ [Bug 1445] IRIX does not have -lcap or support linux capabilities
+
+ChangeSet@1.2084.6.33, 2009-12-28 00:57:22-05:00, stenn@whimsy.udel.edu
+ ntpdate.c still needs ntp_io.h
+
+ ntpdate/ntpdate.c@1.71 +1 -0
+ ntpdate.c still needs ntp_io.h
+
+ChangeSet@1.2084.8.7, 2009-12-28 05:24:22+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vs2003/libntp.vcproj@1.9 +1 -1
+ [Bug 1442] Move Windows functions into libntp files
+
+ChangeSet@1.2084.8.6, 2009-12-28 02:21:48+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vc6/libntp.dsp@1.48 +2 -2
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vs2003/libntp.vcproj@1.8 +2 -2
+ [Bug 1442] Move Windows functions into libntp files
+
+ChangeSet@1.2084.8.5, 2009-12-28 01:56:22+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.25 +2 -2
+ [Bug 1442] Move Windows functions into libntp files
+
+ChangeSet@1.2084.8.4, 2009-12-27 22:03:56+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/libntp/termios.c@1.21 +1 -0
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.24 +1 -1
+ [Bug 1442] Move Windows functions into libntp files
+
+ChangeSet@1.2084.8.3, 2009-12-27 21:35:25+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vc6/libntp.dsp@1.47 +12 -0
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vc6/ntp.dsw@1.12 +4 -0
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vc6/ntpd.dsp@1.43 +0 -6
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vs2003/libntp.vcproj@1.7 +42 -0
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vs2003/ntp.sln@1.2 +1 -0
+ [Bug 1442] Move Windows functions into libntp files
+
+ ports/winnt/vs2003/ntpd.vcproj@1.6 +0 -23
+ [Bug 1442] Move Windows functions into libntp files
+
+ChangeSet@1.2084.8.2, 2009-12-27 21:08:21+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442] and [Bug 1443]
+
+ ChangeLog@1.501.2.1 +2 -0
+ [Bug 1442] and [Bug 1443]
+
+ChangeSet@1.2084.7.3, 2009-12-27 21:02:00+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+
+ libntp/recvbuff.c@1.34 +0 -1
+ [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+
+ ntpd/ntp_io.c@1.310 +1 -37
+ [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+
+ ntpd/ntp_util.c@1.76 +0 -1
+ [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+
+ ntpdate/ntpdate.c@1.70 +0 -1
+ [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+
+ ntpdc/ntpdc.c@1.76 +0 -1
+ [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+
+ ntpq/ntpq.c@1.98 +0 -1
+ [Bug 1443] Remove unnecessary dependencies on ntp_io.h
+
+ChangeSet@1.2084.7.2, 2009-12-27 20:52:30+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/include/config.h@1.80 +0 -13
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/include/termios.h@1.13 +3 -3
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/include/win32_io.h@1.1 +8 -0
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/include/win32_io.h@1.0 +0 -0
+
+ ports/winnt/libntp/setpriority.c@1.3 +0 -30
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/libntp/win32_io.c@1.1 +80 -0
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/libntp/win32_io.c@1.0 +0 -0
+
+ ports/winnt/vs2005/Instsrv.vcproj@1.2 +2 -2
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/vs2005/libntp.vcproj@1.7 +12 -4
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/vs2005/ntp.sln@1.2 +3 -1
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/vs2005/ntpd.vcproj@1.6 +2 -24
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.23 +8 -0
+ [Bug 1442] Move functions into libntp files
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.24 +0 -22
+ [Bug 1442] Move functions into libntp files
+
+ChangeSet@1.2084.7.1, 2009-12-27 20:38:02+00:00, mayer@psp-fb1.ntp.org
+ [Bug 1442} Move some windows-specific files to linntp
+
+ BitKeeper/deleted/.del-termios.h~8b711e53@1.3 +0 -0
+ Delete: ports/winnt/include/termios.h
+
+ ports/winnt/include/termios.h@1.12 +0 -0
+ Rename: ports/winnt/include/win32_io.h -> ports/winnt/include/termios.h
+
+ ports/winnt/libntp/termios.c@1.20 +0 -0
+ Rename: ports/winnt/ntpd/win32_io.c -> ports/winnt/libntp/termios.c
+
+ChangeSet@1.2084.6.31, 2009-12-27 17:37:15+00:00, davehart@shiny.ad.hartbrothers.com
+ correct ChangeLog merge from -stable
+
+ ChangeLog@1.501.1.25 +1 -0
+ correct ChangeLog merge from -stable
+
+ChangeSet@1.2082.14.1, 2009-12-27 09:16:20+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1439] .texi generation must wait until after binary is linked.
+ Quiet RES_TIMEOUT redefinition warning compiling ntp_intres.c
+
+ ChangeLog@1.496.39.1 +4 -0
+ [Bug 1439] .texi generation must wait until after binary is linked.
+
+ ntpd/Makefile.am@1.80.1.3 +16 -10
+ remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1
+ to noinst_DATA, and remove sub-make hack to build binary [Bug 1439].
+ change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around
+ make distcheck R/O srcdir in .1 and ,texi rules.
+ separate .menu rule from .texi to avoid redundant Autogen invocation.
+
+ ntpd/ntp_intres.c@1.79 +7 -3
+ follow AC_HEADER_RESOLV suggestion to include sys/types.h ahead
+ of netinet/in.h
+ quiet RES_TIMEOUT redefinition warning (resolv.h vs. ntp.h)
+
+ ntpdc/Makefile.am@1.48.1.2 +17 -10
+ remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1
+ to noinst_DATA, and remove sub-make hack to build binary [Bug 1439].
+ change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around
+ make distcheck R/O srcdir in .1 and ,texi rules.
+ separate .menu rule from .texi to avoid redundant Autogen invocation.
+
+ ntpq/Makefile.am@1.43.1.2 +17 -10
+ remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1
+ to noinst_DATA, and remove sub-make hack to build binary [Bug 1439].
+ change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around
+ make distcheck R/O srcdir in .1 and ,texi rules.
+ separate .menu rule from .texi to avoid redundant Autogen invocation.
+
+ ntpsnmpd/Makefile.am@1.16.1.2 +17 -12
+ remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1
+ to noinst_DATA, and remove sub-make hack to build binary [Bug 1439].
+ change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around
+ make distcheck R/O srcdir in .1 and ,texi rules.
+ separate .menu rule from .texi to avoid redundant Autogen invocation.
+
+ sntp/Makefile.am@1.21.1.2 +26 -23
+ remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1
+ to noinst_DATA, and remove sub-make hack to build binary [Bug 1439].
+ change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around
+ make distcheck R/O srcdir in .1, .texi, and .html rules.
+ separate .menu rule from .texi to avoid redundant Autogen invocation.
+
+ util/Makefile.am@1.45.1.2 +17 -9
+ remove *.texi *.menu *.html *.1 from BUILT_SOURCES, add all except .1
+ to noinst_DATA, and remove sub-make hack to build binary [Bug 1439].
+ change man_MANS= reference to .1 to have $(srcdir)/ prefix, work around
+ make distcheck R/O srcdir in .1 and ,texi rules.
+ separate .menu rule from .texi to avoid redundant Autogen invocation.
+
+ChangeSet@1.2084.6.29, 2009-12-27 01:59:48-05:00, stenn@whimsy.udel.edu
+ merge cleanup
+
+ ChangeLog@1.501.1.23 +1 -0
+ merge cleanup
+
+ChangeSet@1.2082.4.31, 2009-12-27 01:54:07-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ChangeLog@1.496.26.23 +5 -2
+ cleanup
+
+ChangeSet@1.2082.4.30, 2009-12-27 01:47:48-05:00, stenn@whimsy.udel.edu
+ [Bug 1440] Update configure.ac to support kfreebsd
+
+ ChangeLog@1.496.26.22 +1 -0
+ [Bug 1440] Update configure.ac to support kfreebsd
+
+ configure.ac@1.465.1.8 +12 -0
+ [Bug 1440] Update configure.ac to support kfreebsd
+
+ChangeSet@1.2082.4.29, 2009-12-27 00:40:27-05:00, stenn@whimsy.udel.edu
+ [Bug 1127] Properly check the return of X590_verify() - missed one
+
+ ChangeLog@1.496.26.21 +1 -0
+ [Bug 1127] Properly check the return of X590_verify() - missed one
+
+ util/ntp-keygen.c@1.64 +1 -1
+ [Bug 1127] Properly check the return of X590_verify() - missed one
+
+ChangeSet@1.2084.6.26, 2009-12-25 10:34:17+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P5
+ TAG: NTP_4_2_7P5
+
+ ChangeLog@1.501.1.20 +1 -0
+ NTP_4_2_7P5
+
+ ntpd/ntpd-opts.c@1.6 +2 -2
+ NTP_4_2_7P5
+
+ ntpd/ntpd-opts.h@1.6 +3 -3
+ NTP_4_2_7P5
+
+ ntpd/ntpd-opts.texi@1.6 +1 -1
+ NTP_4_2_7P5
+
+ ntpd/ntpd.1@1.6 +2 -2
+ NTP_4_2_7P5
+
+ ntpdc/ntpdc-opts.c@1.6 +2 -2
+ NTP_4_2_7P5
+
+ ntpdc/ntpdc-opts.h@1.6 +3 -3
+ NTP_4_2_7P5
+
+ ntpdc/ntpdc-opts.texi@1.6 +1 -1
+ NTP_4_2_7P5
+
+ ntpdc/ntpdc.1@1.6 +2 -2
+ NTP_4_2_7P5
+
+ ntpq/ntpq-opts.c@1.6 +2 -2
+ NTP_4_2_7P5
+
+ ntpq/ntpq-opts.h@1.6 +3 -3
+ NTP_4_2_7P5
+
+ ntpq/ntpq-opts.texi@1.6 +1 -1
+ NTP_4_2_7P5
+
+ ntpq/ntpq.1@1.6 +2 -2
+ NTP_4_2_7P5
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.6 +2 -2
+ NTP_4_2_7P5
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.6 +3 -3
+ NTP_4_2_7P5
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.6 +1 -1
+ NTP_4_2_7P5
+
+ ntpsnmpd/ntpsnmpd.1@1.6 +2 -2
+ NTP_4_2_7P5
+
+ packageinfo.sh@1.7 +1 -1
+ NTP_4_2_7P5
+
+ sntp/sntp-opts.c@1.6 +2 -2
+ NTP_4_2_7P5
+
+ sntp/sntp-opts.h@1.6 +3 -3
+ NTP_4_2_7P5
+
+ sntp/sntp-opts.texi@1.6 +1 -1
+ NTP_4_2_7P5
+
+ sntp/sntp.1@1.6 +2 -2
+ NTP_4_2_7P5
+
+ sntp/sntp.html@1.6 +1 -1
+ NTP_4_2_7P5
+
+ util/ntp-keygen-opts.c@1.6 +2 -2
+ NTP_4_2_7P5
+
+ util/ntp-keygen-opts.h@1.6 +3 -3
+ NTP_4_2_7P5
+
+ util/ntp-keygen-opts.texi@1.6 +1 -1
+ NTP_4_2_7P5
+
+ util/ntp-keygen.1@1.6 +2 -2
+ NTP_4_2_7P5
+
+ChangeSet@1.2082.4.28, 2009-12-25 09:31:42+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_6P1_RC2
+ TAG: NTP_4_2_6P1_RC2
+
+ ChangeLog@1.496.26.20 +1 -0
+ NTP_4_2_6P1_RC2
+
+ ntpd/ntpd-opts.c@1.248.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpd/ntpd-opts.h@1.248.2.1 +3 -3
+ NTP_4_2_6P1_RC2
+
+ ntpd/ntpd-opts.texi@1.246.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpd/ntpd.1@1.246.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpdc/ntpdc-opts.c@1.244.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpdc/ntpdc-opts.h@1.244.2.1 +3 -3
+ NTP_4_2_6P1_RC2
+
+ ntpdc/ntpdc-opts.texi@1.243.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpdc/ntpdc.1@1.243.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpq/ntpq-opts.c@1.245.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpq/ntpq-opts.h@1.245.2.1 +3 -3
+ NTP_4_2_6P1_RC2
+
+ ntpq/ntpq-opts.texi@1.244.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpq/ntpq.1@1.244.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.2.1 +3 -3
+ NTP_4_2_6P1_RC2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ ntpsnmpd/ntpsnmpd.1@1.122.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ packageinfo.sh@1.255.4.1 +1 -1
+ NTP_4_2_6P1_RC2
+
+ sntp/sntp-opts.c@1.117.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ sntp/sntp-opts.h@1.117.2.1 +3 -3
+ NTP_4_2_6P1_RC2
+
+ sntp/sntp-opts.texi@1.117.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ sntp/sntp.1@1.117.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ sntp/sntp.html@1.7.2.1 +1 -1
+ NTP_4_2_6P1_RC2
+
+ util/ntp-keygen-opts.c@1.247.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ util/ntp-keygen-opts.h@1.247.2.1 +3 -3
+ NTP_4_2_6P1_RC2
+
+ util/ntp-keygen-opts.texi@1.246.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ util/ntp-keygen.1@1.246.2.1 +2 -2
+ NTP_4_2_6P1_RC2
+
+ChangeSet@1.2082.13.1, 2009-12-25 00:19:40-05:00, stenn@whimsy.udel.edu
+ [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp
+
+ ChangeLog@1.496.38.1 +1 -0
+ [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp
+
+ sntp/configure.ac@1.29.1.1 +3 -0
+ [Bug 1435] sntp: Test for -lresolv using the same tests as in ntp
+
+ChangeSet@1.2082.4.26, 2009-12-24 22:04:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1425] unpeer by association ID sets up for duplicate free().
+ [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
+ Use HAVE_WORKING_FORK instead of HAVE_FORK to avoid broken fork().
+
+ ChangeLog@1.496.26.18 +2 -0
+ [Bug 1425] unpeer by association ID sets up for duplicate free().
+ [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
+
+ configure.ac@1.465.1.7 +50 -29
+ [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
+
+ include/ntp_intres.h@1.2 +1 -1
+ Use HAVE_WORKING_FORK instead of HAVE_FORK preemptively, some rare
+ systems have a broken fork()
+
+ m4/os_cflags.m4@1.6 +2 -0
+ [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
+
+ ntpd/ntp_config.c@1.241 +0 -2
+ [Bug 1425] unpeer by association ID sets up for duplicate free().
+
+ ntpsnmpd/netsnmp_daemonize.c@1.1.1.1 +2 -2
+ Use HAVE_WORKING_FORK instead of HAVE_FORK preemptively, some rare
+ systems have a broken fork()
+
+ sntp/configure.ac@1.30 +53 -0
+ [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
+
+ sntp/networking.c@1.29 +7 -1
+ [Bug 1434] HP-UX 11 ip_mreq undeclared, _HPUX_SOURCE helps some.
+
+ChangeSet@1.2084.6.24, 2009-12-24 10:27:41+00:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P4
+ TAG: NTP_4_2_7P4
+
+ ChangeLog@1.501.1.18 +1 -0
+ NTP_4_2_7P4
+
+ ntpd/ntpd-opts.c@1.5 +2 -2
+ NTP_4_2_7P4
+
+ ntpd/ntpd-opts.h@1.5 +3 -3
+ NTP_4_2_7P4
+
+ ntpd/ntpd-opts.texi@1.5 +1 -1
+ NTP_4_2_7P4
+
+ ntpd/ntpd.1@1.5 +2 -2
+ NTP_4_2_7P4
+
+ ntpdc/ntpdc-opts.c@1.5 +2 -2
+ NTP_4_2_7P4
+
+ ntpdc/ntpdc-opts.h@1.5 +3 -3
+ NTP_4_2_7P4
+
+ ntpdc/ntpdc-opts.texi@1.5 +1 -1
+ NTP_4_2_7P4
+
+ ntpdc/ntpdc.1@1.5 +2 -2
+ NTP_4_2_7P4
+
+ ntpq/ntpq-opts.c@1.5 +2 -2
+ NTP_4_2_7P4
+
+ ntpq/ntpq-opts.h@1.5 +3 -3
+ NTP_4_2_7P4
+
+ ntpq/ntpq-opts.texi@1.5 +1 -1
+ NTP_4_2_7P4
+
+ ntpq/ntpq.1@1.5 +2 -2
+ NTP_4_2_7P4
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.5 +2 -2
+ NTP_4_2_7P4
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.5 +3 -3
+ NTP_4_2_7P4
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.5 +1 -1
+ NTP_4_2_7P4
+
+ ntpsnmpd/ntpsnmpd.1@1.5 +2 -2
+ NTP_4_2_7P4
+
+ packageinfo.sh@1.6 +1 -1
+ NTP_4_2_7P4
+
+ sntp/sntp-opts.c@1.5 +2 -2
+ NTP_4_2_7P4
+
+ sntp/sntp-opts.h@1.5 +3 -3
+ NTP_4_2_7P4
+
+ sntp/sntp-opts.texi@1.5 +1 -1
+ NTP_4_2_7P4
+
+ sntp/sntp.1@1.5 +2 -2
+ NTP_4_2_7P4
+
+ sntp/sntp.html@1.5 +1 -1
+ NTP_4_2_7P4
+
+ util/ntp-keygen-opts.c@1.5 +2 -2
+ NTP_4_2_7P4
+
+ util/ntp-keygen-opts.h@1.5 +3 -3
+ NTP_4_2_7P4
+
+ util/ntp-keygen-opts.texi@1.5 +1 -1
+ NTP_4_2_7P4
+
+ util/ntp-keygen.1@1.5 +2 -2
+ NTP_4_2_7P4
+
+ChangeSet@1.2084.6.23, 2009-12-24 07:42:08+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct ChangeLog merge from stable
+
+ ChangeLog@1.501.1.17 +2 -0
+ Correct ChangeLog merge from stable
+
+ChangeSet@1.2082.12.1, 2009-12-24 02:27:39-05:00, stenn@deacon.udel.edu
+ System headers must come before ntp headers in ntp_intres.c
+
+ ChangeLog@1.496.37.1 +1 -0
+ System headers must come before ntp headers in ntp_intres.c
+
+ include/Makefile.am@1.38 +1 -0
+ System headers must come before ntp headers in ntp_intres.c
+
+ include/ntp_config.h@1.66.1.1 +0 -10
+ System headers must come before ntp headers in ntp_intres.c
+
+ include/ntp_intres.h@1.1 +14 -0
+ BitKeeper file /deacon/backroom/ntp-stable/include/ntp_intres.h
+
+ include/ntp_intres.h@1.0 +0 -0
+
+ ntpd/ntp_config.c@1.238.1.1 +1 -0
+ System headers must come before ntp headers in ntp_intres.c
+
+ ntpd/ntp_intres.c@1.78 +10 -8
+ System headers must come before ntp headers in ntp_intres.c
+
+ChangeSet@1.2082.4.24, 2009-12-23 11:01:44+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution
+
+ ChangeLog@1.496.26.16 +1 -0
+ [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution
+
+ ntpd/cmd_args.c@1.56.1.1 +12 -5
+ [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution
+
+ ntpd/ntp_config.c@1.239 +2 -8
+ [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution
+
+ ntpd/ntp_scanner.h@1.15 +0 -1
+ [Bug 1429] -4 command line option to ntpd does not reliably force IPv4 resolution
+
+ChangeSet@1.2084.1.16, 2009-12-22 12:10:14-05:00, murray@pogo.udel.edu
+ tg2.c:
+ Change mode to -rw-rw-r--
+
+ util/tg2.c@1.3, stenn@pogo.udel.edu +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.2084.6.20, 2009-12-22 05:29:27-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P3
+ TAG: NTP_4_2_7P3
+
+ ChangeLog@1.501.1.14 +1 -0
+ NTP_4_2_7P3
+
+ ntpd/ntpd-opts.c@1.4 +2 -2
+ NTP_4_2_7P3
+
+ ntpd/ntpd-opts.h@1.4 +3 -3
+ NTP_4_2_7P3
+
+ ntpd/ntpd-opts.texi@1.4 +1 -1
+ NTP_4_2_7P3
+
+ ntpd/ntpd.1@1.4 +2 -2
+ NTP_4_2_7P3
+
+ ntpdc/ntpdc-opts.c@1.4 +2 -2
+ NTP_4_2_7P3
+
+ ntpdc/ntpdc-opts.h@1.4 +3 -3
+ NTP_4_2_7P3
+
+ ntpdc/ntpdc-opts.texi@1.4 +1 -1
+ NTP_4_2_7P3
+
+ ntpdc/ntpdc.1@1.4 +2 -2
+ NTP_4_2_7P3
+
+ ntpq/ntpq-opts.c@1.4 +2 -2
+ NTP_4_2_7P3
+
+ ntpq/ntpq-opts.h@1.4 +3 -3
+ NTP_4_2_7P3
+
+ ntpq/ntpq-opts.texi@1.4 +1 -1
+ NTP_4_2_7P3
+
+ ntpq/ntpq.1@1.4 +2 -2
+ NTP_4_2_7P3
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.4 +2 -2
+ NTP_4_2_7P3
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.4 +3 -3
+ NTP_4_2_7P3
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.4 +1 -1
+ NTP_4_2_7P3
+
+ ntpsnmpd/ntpsnmpd.1@1.4 +2 -2
+ NTP_4_2_7P3
+
+ packageinfo.sh@1.5 +1 -1
+ NTP_4_2_7P3
+
+ sntp/sntp-opts.c@1.4 +2 -2
+ NTP_4_2_7P3
+
+ sntp/sntp-opts.h@1.4 +3 -3
+ NTP_4_2_7P3
+
+ sntp/sntp-opts.texi@1.4 +1 -1
+ NTP_4_2_7P3
+
+ sntp/sntp.1@1.4 +2 -2
+ NTP_4_2_7P3
+
+ sntp/sntp.html@1.4 +1 -1
+ NTP_4_2_7P3
+
+ util/ntp-keygen-opts.c@1.4 +2 -2
+ NTP_4_2_7P3
+
+ util/ntp-keygen-opts.h@1.4 +3 -3
+ NTP_4_2_7P3
+
+ util/ntp-keygen-opts.texi@1.4 +1 -1
+ NTP_4_2_7P3
+
+ util/ntp-keygen.1@1.4 +2 -2
+ NTP_4_2_7P3
+
+ChangeSet@1.2082.4.23, 2009-12-22 08:36:49+00:00, hart@psp-deb1.ntp.org
+ UpdatePoint:
+ correct handling of beta-free stable RC bumps
+
+ scripts/UpdatePoint@1.4 +15 -7
+ correct handling of beta-free stable RC bumps
+
+ChangeSet@1.2082.4.22, 2009-12-22 03:00:22-05:00, stenn@whimsy.udel.edu
+ [Bug 1424] Fix check for rtattr (rtnetlink.h)
+
+ ChangeLog@1.496.26.15 +1 -0
+ [Bug 1424] Fix check for rtattr (rtnetlink.h)
+
+ configure.ac@1.465.1.6 +1 -0
+ [Bug 1424] Fix check for rtattr (rtnetlink.h)
+
+ChangeSet@1.2082.4.21, 2009-12-22 02:52:08-05:00, stenn@whimsy.udel.edu
+ [Bug 1416] MAXDNAME undefined on Solaris 2.6
+
+ ChangeLog@1.496.26.14 +1 -0
+ [Bug 1416] MAXDNAME undefined on Solaris 2.6
+
+ChangeSet@1.2082.4.20, 2009-12-22 02:29:35-05:00, stenn@whimsy.udel.edu
+ Bootstrap script should also touch .html files
+
+ bootstrap@1.28.1.1 +1 -1
+ Bootstrap script should also touch .html files
+
+ChangeSet@1.2082.4.19, 2009-12-22 02:26:26-05:00, stenn@whimsy.udel.edu
+ [Bug 1411] Fix status messages in refclock_oncore.c
+
+ ChangeLog@1.496.26.13 +1 -0
+ [Bug 1411] Fix status messages in refclock_oncore.c
+
+ ntpd/refclock_oncore.c@1.82 +31 -8
+ [Bug 1411] Fix status messages in refclock_oncore.c
+
+ChangeSet@1.2082.4.18, 2009-12-22 04:15:31+00:00, davehart@shiny.ad.hartbrothers.com
+ bring Windows mkver.bat in line with packaginfo.sh and
+ scripts/VersionName changes
+
+ ports/winnt/scripts/mkver.bat@1.12 +14 -11
+ bring Windows mkver.bat in line with packaginfo.sh and
+ scripts/VersionName changes
+
+ChangeSet@1.2082.11.1, 2009-12-22 00:55:19+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h
+
+ ChangeLog@1.496.36.1 +4 -0
+ [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h
+
+ configure.ac@1.465.1.4 +1 -0
+ [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h
+
+ ntpd/ntp_intres.c@1.77 +16 -3
+ [Bug 1428] Use AC_HEADER_RESOLV to fix breaks from resolv.h
+ changes include of resolv.h to match Autoconf doc suggestion
+
+ChangeSet@1.2082.4.15, 2009-12-21 06:26:25+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1427] quote missing in ./build - shows up on NetBSD.
+
+ ChangeLog@1.496.26.10 +1 -0
+ [Bug 1427] quote missing in ./build - shows up on NetBSD.
+
+ build@1.33 +1 -1
+ [Bug 1427] quote missing in ./build - shows up on NetBSD.
+
+ChangeSet@1.2082.4.14, 2009-12-21 05:19:15+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1426] scripts/VersionName needs . on the search path.
+ correct permissions to 0775 for scripts/UpdatePoint.
+
+ ChangeLog@1.496.26.9 +4 -0
+ [Bug 1426] scripts/VersionName needs . on the search path.
+
+ scripts/UpdatePoint@1.3 +2 -2
+ work correctly without . on $PATH
+
+ scripts/UpdatePoint@1.2 +0 -0
+ Change mode to -rwxrwxr-x
+
+ scripts/VersionName@1.6 +3 -3
+ [Bug 1426] scripts/VersionName needs . on the search path.
+
+ChangeSet@1.2084.6.13, 2009-12-20 05:29:12-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P2
+ TAG: NTP_4_2_7P2
+
+ ChangeLog@1.501.1.9 +1 -0
+ NTP_4_2_7P2
+
+ ntpd/ntpd-opts.c@1.3 +2 -2
+ NTP_4_2_7P2
+
+ ntpd/ntpd-opts.h@1.3 +3 -3
+ NTP_4_2_7P2
+
+ ntpd/ntpd-opts.texi@1.3 +1 -1
+ NTP_4_2_7P2
+
+ ntpd/ntpd.1@1.3 +2 -2
+ NTP_4_2_7P2
+
+ ntpdc/ntpdc-opts.c@1.3 +2 -2
+ NTP_4_2_7P2
+
+ ntpdc/ntpdc-opts.h@1.3 +3 -3
+ NTP_4_2_7P2
+
+ ntpdc/ntpdc-opts.texi@1.3 +1 -1
+ NTP_4_2_7P2
+
+ ntpdc/ntpdc.1@1.3 +2 -2
+ NTP_4_2_7P2
+
+ ntpq/ntpq-opts.c@1.3 +2 -2
+ NTP_4_2_7P2
+
+ ntpq/ntpq-opts.h@1.3 +3 -3
+ NTP_4_2_7P2
+
+ ntpq/ntpq-opts.texi@1.3 +1 -1
+ NTP_4_2_7P2
+
+ ntpq/ntpq.1@1.3 +2 -2
+ NTP_4_2_7P2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.3 +2 -2
+ NTP_4_2_7P2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.3 +3 -3
+ NTP_4_2_7P2
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.3 +1 -1
+ NTP_4_2_7P2
+
+ ntpsnmpd/ntpsnmpd.1@1.3 +2 -2
+ NTP_4_2_7P2
+
+ packageinfo.sh@1.4 +1 -1
+ NTP_4_2_7P2
+
+ sntp/sntp-opts.c@1.3 +2 -2
+ NTP_4_2_7P2
+
+ sntp/sntp-opts.h@1.3 +3 -3
+ NTP_4_2_7P2
+
+ sntp/sntp-opts.texi@1.3 +1 -1
+ NTP_4_2_7P2
+
+ sntp/sntp.1@1.3 +2 -2
+ NTP_4_2_7P2
+
+ sntp/sntp.html@1.3 +1 -1
+ NTP_4_2_7P2
+
+ util/ntp-keygen-opts.c@1.3 +2 -2
+ NTP_4_2_7P2
+
+ util/ntp-keygen-opts.h@1.3 +3 -3
+ NTP_4_2_7P2
+
+ util/ntp-keygen-opts.texi@1.3 +1 -1
+ NTP_4_2_7P2
+
+ util/ntp-keygen.1@1.3 +2 -2
+ NTP_4_2_7P2
+
+ChangeSet@1.2084.6.11, 2009-12-20 01:04:33-05:00, stenn@whimsy.udel.edu
+ Touch any html file from autogen
+
+ bootstrap@1.29 +1 -1
+ Touch any html file from autogen
+
+ChangeSet@1.2082.4.13, 2009-12-20 00:52:48-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_6P1_RC1
+ TAG: NTP_4_2_6P1_RC1
+
+ ChangeLog@1.496.26.8 +1 -0
+ NTP_4_2_6P1_RC1
+
+ ntpd/ntpd-opts.c@1.248.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpd/ntpd-opts.h@1.248.1.1 +3 -3
+ NTP_4_2_6P1_RC1
+
+ ntpd/ntpd-opts.texi@1.246.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpd/ntpd.1@1.246.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpdc/ntpdc-opts.c@1.244.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpdc/ntpdc-opts.h@1.244.1.1 +3 -3
+ NTP_4_2_6P1_RC1
+
+ ntpdc/ntpdc-opts.texi@1.243.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpdc/ntpdc.1@1.243.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpq/ntpq-opts.c@1.245.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpq/ntpq-opts.h@1.245.1.1 +3 -3
+ NTP_4_2_6P1_RC1
+
+ ntpq/ntpq-opts.texi@1.244.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpq/ntpq.1@1.244.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123.1.1 +3 -3
+ NTP_4_2_6P1_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ ntpsnmpd/ntpsnmpd.1@1.122.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ packageinfo.sh@1.255.3.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ sntp/sntp-opts.c@1.117.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ sntp/sntp-opts.h@1.117.1.1 +3 -3
+ NTP_4_2_6P1_RC1
+
+ sntp/sntp-opts.texi@1.117.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ sntp/sntp.1@1.117.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ sntp/sntp.html@1.7.1.1 +1 -1
+ NTP_4_2_6P1_RC1
+
+ util/ntp-keygen-opts.c@1.247.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ util/ntp-keygen-opts.h@1.247.1.1 +3 -3
+ NTP_4_2_6P1_RC1
+
+ util/ntp-keygen-opts.texi@1.246.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ util/ntp-keygen.1@1.246.1.1 +2 -2
+ NTP_4_2_6P1_RC1
+
+ChangeSet@1.2082.4.12, 2009-12-19 23:55:09-05:00, stenn@pogo.udel.edu
+ Put refclock_neoclock4x.c under the NTP COPYRIGHT
+
+ ChangeLog@1.496.26.7 +4 -0
+ Put refclock_neoclock4x.c under the NTP COPYRIGHT
+
+ html/copyright.html@1.45 +1 -0
+ Put refclock_neoclock4x.c under the NTP COPYRIGHT
+
+ ntpd/refclock_neoclock4x.c@1.17 +20 -9
+ Put refclock_neoclock4x.c under the NTP COPYRIGHT
+
+ChangeSet@1.2082.4.11, 2009-12-19 22:05:09-05:00, stenn@whimsy.udel.edu
+ Start the 4.2.6p1-RC cycle
+
+ packageinfo.sh@1.255.2.1 +14 -1
+ Start the 4.2.6p1-RC cycle
+
+ChangeSet@1.2082.4.10, 2009-12-19 21:47:40-05:00, stenn@whimsy.udel.edu
+ [Bug 1415] Fix Mac OS X link problem
+
+ ChangeLog@1.496.26.6 +1 -0
+ [Bug 1415] Fix Mac OS X link problem
+
+ configure.ac@1.465.1.3 +5 -0
+ [Bug 1415] Fix Mac OS X link problem
+
+ ntpsnmpd/Makefile.am@1.15.1.1 +1 -1
+ [Bug 1415] Fix Mac OS X link problem
+
+ChangeSet@1.2060.25.1, 2009-12-19 03:29:38+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1395] ease ntpdate elimination with ntpd -w/--wait-sync
+ [Bug 1396] allow servers on ntpd command line like ntpdate
+
+ ChangeLog@1.496.35.1 +2 -0
+ [Bug 1395] ease ntpdate elimination with ntpd -w/--wait-sync
+ [Bug 1396] allow servers on ntpd command line like ntpdate
+
+ include/ntp_config.h@1.67 +5 -1
+ [Bug 1396] allow servers on ntpd command line like ntpdate
+
+ include/ntp_machine.h@1.27 +0 -2
+ remove NODETACH, nptd uses HAVE_WORKING_FORK instead
+
+ include/ntp_proto.h@1.5 +3 -3
+ stay out of system/compiler underscore namespace
+
+ include/ntpd.h@1.138 +5 -1
+ add waitsync_fd_to_close from ntpd.c
+
+ include/ntpsim.h@1.13 +0 -1
+ remove no-longer-used SLEW which conflicted with autoopts over -x/--slew
+
+ ntpd/Makefile.am@1.78.1.1 +1 -1
+ cmd_args.c no longer differs between SIM and !SIM
+
+ ntpd/cmd_args.c@1.57 +18 -19
+ [Bug 1396] allow servers on ntpd command line like ntpdate
+
+ ntpd/ntp_config.c@1.237.1.1 +65 -22
+ [Bug 1396] allow servers on ntpd command line like ntpdate
+
+ ntpd/ntp_loopfilter.c@1.154 +7 -7
+ comment typo corrections, leading tabs cleanup, msyslog
+ "kernel time sync disabledx"
+ excess 'x' excised.
+
+ ntpd/ntp_proto.c@1.298 +21 -3
+ [Bug 1396] allow servers on ntpd command line like ntpdate
+
+ ntpd/ntpd-opts.c@1.242.1.1 +97 -20
+ Autogen output
+
+ ntpd/ntpd-opts.def@1.6 +3 -2
+ [Bug 1396] allow servers on ntpd command line like ntpdate
+
+ ntpd/ntpd-opts.h@1.242.1.1 +18 -11
+ Autogen output
+
+ ntpd/ntpd-opts.texi@1.240.1.1 +72 -8
+ Autogen output
+
+ ntpd/ntpd.1@1.240.1.1 +28 -6
+ Autogen output
+
+ ntpd/ntpd.c@1.111 +440 -309
+ [Bug 1395] ease ntpdate elimination with ntpd -w/--wait-sync
+
+ ntpd/ntpdbase-opts.def@1.21 +34 -2
+ [Bug 1395] ease ntpdate elimination with ntpd -w/--wait-sync
+
+ ntpsnmpd/netsnmp_daemonize.c@1.2 +7 -3
+ HAVE_WORKING_FORK is more appropriate than HAVE_FORK here
+
+ChangeSet@1.2084.1.15, 2009-12-18 03:39:13-05:00, murray@pogo.udel.edu
+ ChangeLog:
+ Add bug number to tg2 comment
+
+ ChangeLog@1.503 +1 -1
+ Add bug number to tg2 comment
+
+ChangeSet@1.2082.10.1, 2009-12-18 05:18:12+00:00, davehart@shiny.ad.hartbrothers.com
+ correct NTP_OS_CFLAGS [Bug 1412]
+ allow $CC to contain slash and space in build
+
+ build@1.32 +3 -3
+ allow space and slash in $CC without breaking build/flock-build
+
+ m4/os_cflags.m4@1.5 +90 -93
+ the name of the macro to define must be on the same line as AC_DEFUN(
+
+ChangeSet@1.2084.6.5, 2009-12-17 09:17:17+00:00, davehart@shiny.ad.hartbrothers.com
+ correct ChangeLog merge from ntp-stable-updatepoint
+
+ ChangeLog@1.501.1.4 +1 -3
+ correct ChangeLog merge from ntp-stable-updatepoint
+
+ChangeSet@1.2084.6.4, 2009-12-17 08:27:16+00:00, davehart@shiny.ad.hartbrothers.com
+ scripts/UpdatePoint changes to packageinfo.sh's -dev copy
+ adds support for beta releases in ntp-stable
+
+ packageinfo.sh@1.3 +68 -15
+ scripts/UpdatePoint changes to packageinfo.sh's -dev copy
+ adds support for beta releases in ntp-stable
+
+ChangeSet@1.2084.6.2, 2009-12-17 04:25:31+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ correct ChangeLog merge from ntp-stable-1419, bk remerge/fm3tool hates me
+
+ ChangeLog@1.501.1.2 +1 -3
+ correct ChangeLog merge from ntp-stable-1419, bk remerge/fm3tool hates me
+
+ChangeSet@1.2084.1.14, 2009-12-16 21:00:16-05:00, murray@malarky.udel.edu
+ tg2.c:
+ Fix warnings on Solaris.
+
+ util/tg2.c@1.2 +4 -2
+ Fix warnings on Solaris.
+
+ChangeSet@1.2082.9.1, 2009-12-16 21:26:45+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ ChangeLog@1.496.34.1 +4 -0
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ adjtimed/Makefile.am@1.7 +5 -1
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ bincheck.mf@1.3 +5 -5
+ respect $bindir, $sbindir instead of assuming $exec_prefix/$BINSUBDIR
+
+ configure.ac@1.465.3.1 +2 -0
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ ntpd/Makefile.am@1.79.2.1 +4 -2
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ ntpdate/Makefile.am@1.23 +6 -2
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ ntpdc/Makefile.am@1.47.1.1 +5 -1
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ ntpq/Makefile.am@1.42.1.1 +4 -0
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ ntpsnmpd/Makefile.am@1.16 +5 -0
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ scripts/Makefile.am@1.16.1.1 +4 -0
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ sntp/Makefile.am@1.20.1.1 +5 -1
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ sntp/configure.ac@1.29 +2 -0
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ util/Makefile.am@1.45.1.1 +6 -0
+ [Bug 1419] ntpdate, ntpdc, sntp, ntpd ignore configure --bindir.
+
+ChangeSet@1.2082.8.1, 2009-12-16 20:21:10+00:00, davehart@shiny.ad.hartbrothers.com
+ updated packageinfo.sh, VersionName, and UpdatePoint to use prerelease=
+ from packageinfo.sh instead of releasecandidate= and added support for
+ beta releases.
+
+ ChangeLog@1.496.33.1 +4 -0
+ Build infrastructure updates to enable beta releases of ntp-stable.
+
+ packageinfo.sh@1.255.1.3 +69 -16
+ updated to use prerelease= instead of releasecandidate=, with support
+ for prerelease=beta for ntp-stable pre-RC1 test releases
+
+ scripts/Makefile.am@1.17 +36 -5
+ reformat, add UpdatePoint to EXTRA_DIST
+
+ scripts/UpdatePoint@1.1 +323 -0
+ updated to use prerelease= from packageinfo.sh instead of releasecandidate=
+ added support for beta releases
+
+ scripts/UpdatePoint@1.0 +0 -0
+
+ scripts/VersionName@1.5 +32 -18
+ updated to use prerelease= from packageinfo.sh instead of releasecandidate=
+ added support for beta releases
+
+ChangeSet@1.2084.1.12, 2009-12-15 05:28:39-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P1
+ TAG: NTP_4_2_7P1
+
+ ChangeLog@1.501 +1 -0
+ NTP_4_2_7P1
+
+ ntpd/ntpd-opts.c@1.2 +2 -2
+ NTP_4_2_7P1
+
+ ntpd/ntpd-opts.h@1.2 +3 -3
+ NTP_4_2_7P1
+
+ ntpd/ntpd-opts.texi@1.2 +1 -1
+ NTP_4_2_7P1
+
+ ntpd/ntpd.1@1.2 +2 -2
+ NTP_4_2_7P1
+
+ ntpdc/ntpdc-opts.c@1.2 +2 -2
+ NTP_4_2_7P1
+
+ ntpdc/ntpdc-opts.h@1.2 +3 -3
+ NTP_4_2_7P1
+
+ ntpdc/ntpdc-opts.texi@1.2 +1 -1
+ NTP_4_2_7P1
+
+ ntpdc/ntpdc.1@1.2 +2 -2
+ NTP_4_2_7P1
+
+ ntpq/ntpq-opts.c@1.2 +2 -2
+ NTP_4_2_7P1
+
+ ntpq/ntpq-opts.h@1.2 +3 -3
+ NTP_4_2_7P1
+
+ ntpq/ntpq-opts.texi@1.2 +1 -1
+ NTP_4_2_7P1
+
+ ntpq/ntpq.1@1.2 +2 -2
+ NTP_4_2_7P1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.2 +2 -2
+ NTP_4_2_7P1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.2 +3 -3
+ NTP_4_2_7P1
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.2 +1 -1
+ NTP_4_2_7P1
+
+ ntpsnmpd/ntpsnmpd.1@1.2 +2 -2
+ NTP_4_2_7P1
+
+ packageinfo.sh@1.2 +1 -1
+ NTP_4_2_7P1
+
+ sntp/sntp-opts.c@1.2 +2 -2
+ NTP_4_2_7P1
+
+ sntp/sntp-opts.h@1.2 +3 -3
+ NTP_4_2_7P1
+
+ sntp/sntp-opts.texi@1.2 +1 -1
+ NTP_4_2_7P1
+
+ sntp/sntp.1@1.2 +2 -2
+ NTP_4_2_7P1
+
+ sntp/sntp.html@1.2 +1 -1
+ NTP_4_2_7P1
+
+ util/ntp-keygen-opts.c@1.2 +2 -2
+ NTP_4_2_7P1
+
+ util/ntp-keygen-opts.h@1.2 +3 -3
+ NTP_4_2_7P1
+
+ util/ntp-keygen-opts.texi@1.2 +1 -1
+ NTP_4_2_7P1
+
+ util/ntp-keygen.1@1.2 +2 -2
+ NTP_4_2_7P1
+
+ChangeSet@1.2084.5.2, 2009-12-14 21:45:36+00:00, davehart@shiny.ad.hartbrothers.com
+ Correct ChangeLog merge from ntp-stable-1418
+
+ ChangeLog@1.496.32.2 +1 -3
+ Correct ChangeLog merge from ntp-stable-1418
+
+ChangeSet@1.2082.7.1, 2009-12-14 21:18:10+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1418] building ntpd/ntpdc/ntpq statically with ssl fails.
+
+ ChangeLog@1.496.31.1 +4 -0
+ [Bug 1418] building ntpd/ntpdc/ntpq statically with ssl fails.
+
+ ntpd/Makefile.am@1.79.1.1 +2 -2
+ move libntp.a ahead of @LCRYPTO@ to fix static openssl link
+
+ ntpdc/Makefile.am@1.48 +2 -2
+ move libntp.a ahead of @LCRYPTO@ to fix static openssl link
+
+ ntpq/Makefile.am@1.43 +2 -2
+ move libntp.a ahead of @LCRYPTO@ to fix static openssl link
+
+ChangeSet@1.2084.1.9, 2009-12-14 02:51:13+00:00, davehart@shiny.ad.hartbrothers.com
+ correct merge of [Bug 1413] ChangeLog line from ntp-stable-1413
+
+ ChangeLog@1.496.25.7 +1 -3
+ correct merge of [Bug 1413] line from ntp-stable-1413
+
+ChangeSet@1.2084.4.2, 2009-12-14 02:32:16+00:00, davehart@shiny.ad.hartbrothers.com
+ transmitbuff.h is gone
+
+ ntpd/ntp_io.c@1.309 +0 -1
+ transmitbuff.h is gone
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.51 +0 -1
+ transmitbuff.h is gone
+
+ChangeSet@1.2084.1.8, 2009-12-13 21:05:40+00:00, davehart@shiny.ad.hartbrothers.com
+ bk rm 4.2.6 version-dependent files, bk new identical replacements
+
+ BitKeeper/deleted/.del-ntp-keygen-opts.c~d0a1ce0533b25b2@1.250 +0 -0
+ Delete: util/ntp-keygen-opts.c
+
+ BitKeeper/deleted/.del-ntp-keygen-opts.h~f0717b94e4446b26@1.250 +0 -0
+ Delete: util/ntp-keygen-opts.h
+
+ BitKeeper/deleted/.del-ntp-keygen-opts.texi~8c66011d5d8b8946@1.249 +0 -0
+ Delete: util/ntp-keygen-opts.texi
+
+ BitKeeper/deleted/.del-ntp-keygen.1~5f9bc1fd9c40085a@1.249 +0 -0
+ Delete: util/ntp-keygen.1
+
+ BitKeeper/deleted/.del-ntpd-opts.c~144b52caa1ef699c@1.251 +0 -0
+ Delete: ntpd/ntpd-opts.c
+
+ BitKeeper/deleted/.del-ntpd-opts.h~2b00d71c3cee10a7@1.251 +0 -0
+ Delete: ntpd/ntpd-opts.h
+
+ BitKeeper/deleted/.del-ntpd-opts.texi~9cb5bac4bf6450c1@1.249 +0 -0
+ Delete: ntpd/ntpd-opts.texi
+
+ BitKeeper/deleted/.del-ntpd.1~28d9b05264c45059@1.249 +0 -0
+ Delete: ntpd/ntpd.1
+
+ BitKeeper/deleted/.del-ntpdc-opts.c~58e4a492bd134fb8@1.247 +0 -0
+ Delete: ntpdc/ntpdc-opts.c
+
+ BitKeeper/deleted/.del-ntpdc-opts.h~b31c10ed4f5c2052@1.247 +0 -0
+ Delete: ntpdc/ntpdc-opts.h
+
+ BitKeeper/deleted/.del-ntpdc-opts.texi~5fe1056039fe6e4f@1.246 +0 -0
+ Delete: ntpdc/ntpdc-opts.texi
+
+ BitKeeper/deleted/.del-ntpdc.1~574c84f3f3e91d36@1.246 +0 -0
+ Delete: ntpdc/ntpdc.1
+
+ BitKeeper/deleted/.del-ntpq-opts.c~e22ebc44f822119e@1.248 +0 -0
+ Delete: ntpq/ntpq-opts.c
+
+ BitKeeper/deleted/.del-ntpq-opts.h~bebfd8975972779e@1.248 +0 -0
+ Delete: ntpq/ntpq-opts.h
+
+ BitKeeper/deleted/.del-ntpq-opts.texi~fd912c16181424e@1.247 +0 -0
+ Delete: ntpq/ntpq-opts.texi
+
+ BitKeeper/deleted/.del-ntpq.1~abfc5609a4b9cf4d@1.247 +0 -0
+ Delete: ntpq/ntpq.1
+
+ BitKeeper/deleted/.del-ntpsnmpd-opts.c~8c4453f3336dd4b7@1.126 +0 -0
+ Delete: ntpsnmpd/ntpsnmpd-opts.c
+
+ BitKeeper/deleted/.del-ntpsnmpd-opts.h~59291b93d938a895@1.126 +0 -0
+ Delete: ntpsnmpd/ntpsnmpd-opts.h
+
+ BitKeeper/deleted/.del-ntpsnmpd-opts.texi~4cc265b9fc7e692d@1.126 +0 -0
+ Delete: ntpsnmpd/ntpsnmpd-opts.texi
+
+ BitKeeper/deleted/.del-ntpsnmpd.1~489dddca797b117c@1.125 +0 -0
+ Delete: ntpsnmpd/ntpsnmpd.1
+
+ BitKeeper/deleted/.del-packageinfo.sh~ff4c82dd98fc4a4@1.260 +0 -0
+ Delete: packageinfo.sh
+
+ BitKeeper/deleted/.del-sntp-opts.c~134d906c1bc0bd88@1.120 +0 -0
+ Delete: sntp/sntp-opts.c
+
+ BitKeeper/deleted/.del-sntp-opts.h~5df6f04e80275ab3@1.120 +0 -0
+ Delete: sntp/sntp-opts.h
+
+ BitKeeper/deleted/.del-sntp-opts.texi~313e154133ec6f3c@1.120 +0 -0
+ Delete: sntp/sntp-opts.texi
+
+ BitKeeper/deleted/.del-sntp.1~4b2813589f2f7814@1.120 +0 -0
+ Delete: sntp/sntp.1
+
+ BitKeeper/deleted/.del-sntp.html~ca24a75c4b6cb914@1.10 +0 -0
+ Delete: sntp/sntp.html
+
+ ntpd/ntpd-opts.c@1.1 +1144 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpd/ntpd-opts.c
+
+ ntpd/ntpd-opts.c@1.0 +0 -0
+
+ ntpd/ntpd-opts.h@1.1 +385 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpd/ntpd-opts.h
+
+ ntpd/ntpd-opts.h@1.0 +0 -0
+
+ ntpd/ntpd-opts.texi@1.1 +529 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpd/ntpd-opts.texi
+
+ ntpd/ntpd-opts.texi@1.0 +0 -0
+
+ ntpd/ntpd.1@1.1 +338 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpd/ntpd.1
+
+ ntpd/ntpd.1@1.0 +0 -0
+
+ ntpdc/ntpdc-opts.c@1.1 +656 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpdc/ntpdc-opts.c
+
+ ntpdc/ntpdc-opts.c@1.0 +0 -0
+
+ ntpdc/ntpdc-opts.h@1.1 +235 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpdc/ntpdc-opts.h
+
+ ntpdc/ntpdc-opts.h@1.0 +0 -0
+
+ ntpdc/ntpdc-opts.texi@1.1 +212 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpdc/ntpdc-opts.texi
+
+ ntpdc/ntpdc-opts.texi@1.0 +0 -0
+
+ ntpdc/ntpdc.1@1.1 +160 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpdc/ntpdc.1
+
+ ntpdc/ntpdc.1@1.0 +0 -0
+
+ ntpq/ntpq-opts.c@1.1 +623 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpq/ntpq-opts.c
+
+ ntpq/ntpq-opts.c@1.0 +0 -0
+
+ ntpq/ntpq-opts.h@1.1 +228 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpq/ntpq-opts.h
+
+ ntpq/ntpq-opts.h@1.0 +0 -0
+
+ ntpq/ntpq-opts.texi@1.1 +182 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpq/ntpq-opts.texi
+
+ ntpq/ntpq-opts.texi@1.0 +0 -0
+
+ ntpq/ntpq.1@1.1 +398 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpq/ntpq.1
+
+ ntpq/ntpq.1@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.1 +408 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpsnmpd/ntpsnmpd-opts.c
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.1 +179 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpsnmpd/ntpsnmpd-opts.h
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.1 +52 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpsnmpd/ntpsnmpd-opts.texi
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.1@1.1 +77 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/ntpsnmpd/ntpsnmpd.1
+
+ ntpsnmpd/ntpsnmpd.1@1.0 +0 -0
+
+ packageinfo.sh@1.1 +28 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/packageinfo.sh
+
+ packageinfo.sh@1.0 +0 -0
+
+ sntp/sntp-opts.c@1.1 +661 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/sntp/sntp-opts.c
+
+ sntp/sntp-opts.c@1.0 +0 -0
+
+ sntp/sntp-opts.h@1.1 +253 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/sntp/sntp-opts.h
+
+ sntp/sntp-opts.h@1.0 +0 -0
+
+ sntp/sntp-opts.texi@1.1 +218 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/sntp/sntp-opts.texi
+
+ sntp/sntp-opts.texi@1.0 +0 -0
+
+ sntp/sntp.1@1.1 +214 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/sntp/sntp.1
+
+ sntp/sntp.1@1.0 +0 -0
+
+ sntp/sntp.html@1.1 +105 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/sntp/sntp.html
+
+ sntp/sntp.html@1.0 +0 -0
+
+ util/ntp-keygen-opts.c@1.1 +981 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/util/ntp-keygen-opts.c
+
+ util/ntp-keygen-opts.c@1.0 +0 -0
+
+ util/ntp-keygen-opts.h@1.1 +303 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/util/ntp-keygen-opts.h
+
+ util/ntp-keygen-opts.h@1.0 +0 -0
+
+ util/ntp-keygen-opts.texi@1.1 +319 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/util/ntp-keygen-opts.texi
+
+ util/ntp-keygen-opts.texi@1.0 +0 -0
+
+ util/ntp-keygen.1@1.1 +189 -0
+ BitKeeper file C:/ntp/ntp-dev-1413/util/ntp-keygen.1
+
+ util/ntp-keygen.1@1.0 +0 -0
+
+ChangeSet@1.2082.6.1, 2009-12-13 19:45:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1413] test OpenSSL headers regarding -Wno-strict-prototypes.
+
+ ChangeLog@1.496.30.1 +4 -0
+ [Bug 1413] test OpenSSL headers regarding -Wno-strict-prototypes.
+
+ configure.ac@1.465.2.1 +52 -10
+ [Bug 1413] test OpenSSL headers to see if they trigger warnings before
+ enablng -Wno-strict-prototypes for gcc.
+ -Wall does not include -Wstrict-prototypes, so add it expclitly.
+
+ChangeSet@1.2084.1.6, 2009-12-13 05:28:33-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_7P0
+ TAG: NTP_4_2_7P0
+
+ ChangeLog@1.496.25.5 +1 -0
+ NTP_4_2_7P0
+
+ ntpd/ntpd-opts.c@1.250 +2 -2
+ NTP_4_2_7P0
+
+ ntpd/ntpd-opts.h@1.250 +3 -3
+ NTP_4_2_7P0
+
+ ntpd/ntpd-opts.texi@1.248 +1 -1
+ NTP_4_2_7P0
+
+ ntpd/ntpd.1@1.248 +2 -2
+ NTP_4_2_7P0
+
+ ntpdc/ntpdc-opts.c@1.246 +2 -2
+ NTP_4_2_7P0
+
+ ntpdc/ntpdc-opts.h@1.246 +3 -3
+ NTP_4_2_7P0
+
+ ntpdc/ntpdc-opts.texi@1.245 +1 -1
+ NTP_4_2_7P0
+
+ ntpdc/ntpdc.1@1.245 +2 -2
+ NTP_4_2_7P0
+
+ ntpq/ntpq-opts.c@1.247 +2 -2
+ NTP_4_2_7P0
+
+ ntpq/ntpq-opts.h@1.247 +3 -3
+ NTP_4_2_7P0
+
+ ntpq/ntpq-opts.texi@1.246 +1 -1
+ NTP_4_2_7P0
+
+ ntpq/ntpq.1@1.246 +2 -2
+ NTP_4_2_7P0
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.125 +2 -2
+ NTP_4_2_7P0
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.125 +3 -3
+ NTP_4_2_7P0
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.125 +1 -1
+ NTP_4_2_7P0
+
+ ntpsnmpd/ntpsnmpd.1@1.124 +2 -2
+ NTP_4_2_7P0
+
+ packageinfo.sh@1.259 +1 -1
+ NTP_4_2_7P0
+
+ sntp/sntp-opts.c@1.119 +2 -2
+ NTP_4_2_7P0
+
+ sntp/sntp-opts.h@1.119 +3 -3
+ NTP_4_2_7P0
+
+ sntp/sntp-opts.texi@1.119 +1 -1
+ NTP_4_2_7P0
+
+ sntp/sntp.1@1.119 +2 -2
+ NTP_4_2_7P0
+
+ sntp/sntp.html@1.9 +1 -1
+ NTP_4_2_7P0
+
+ util/ntp-keygen-opts.c@1.249 +2 -2
+ NTP_4_2_7P0
+
+ util/ntp-keygen-opts.h@1.249 +3 -3
+ NTP_4_2_7P0
+
+ util/ntp-keygen-opts.texi@1.248 +1 -1
+ NTP_4_2_7P0
+
+ util/ntp-keygen.1@1.248 +2 -2
+ NTP_4_2_7P0
+
+ChangeSet@1.2084.3.2, 2009-12-13 04:45:48-05:00, murray@malarky.udel.edu
+ README:
+ Add a few words about tg and tg2.
+
+ util/README@1.5 +7 -0
+ Add a few words about tg and tg2.
+
+ChangeSet@1.2084.3.1, 2009-12-13 03:23:02-05:00, murray@malarky.udel.edu
+ configure.ac:
+ comment for Bug 254
+ ChangeLog:
+ Adding tg2.c
+ tg2.c:
+ BitKeeper file /m/pogo/users/murray/tg2/util/tg2.c
+ Makefile.am:
+ Adding tg2
+
+ ChangeLog@1.496.29.1 +1 -0
+ Adding tg2.c
+
+ configure.ac@1.466.1.1 +1 -1
+ comment for Bug 254
+
+ util/Makefile.am@1.46 +2 -1
+ Adding tg2
+
+ util/tg2.c@1.1 +2499 -0
+ BitKeeper file /m/pogo/users/murray/tg2/util/tg2.c
+
+ util/tg2.c@1.0 +0 -0
+
+ChangeSet@1.2084.2.2, 2009-12-13 05:10:51+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ correct merge from ntp-stable-1412
+
+ ChangeLog@1.496.28.2 +1 -4
+ correct merge from ntp-stable-1412
+
+ChangeSet@1.2084.1.4, 2009-12-13 04:18:43+00:00, davehart@shiny.ad.hartbrothers.com
+ correct merge from ntp-stable-1414
+
+ ChangeLog@1.496.25.3 +1 -4
+ correct merge from ntp-stable-1414
+
+ChangeSet@1.2082.5.1, 2009-12-12 19:55:30+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1414] Enable "make distcheck" success with BSD make.
+
+ ChangeLog@1.496.27.1 +4 -0
+ [Bug 1414] Enable "make distcheck" success with BSD make.
+
+ libparse/Makefile.am@1.17 +23 -22
+ add info_trimble.c to CLEANFILES [Bug 1414].
+ remove references to $U leftover from ansi2knr use.
+
+ ntpd/Makefile.am@1.80 +18 -4
+ remove $VPHACK and $VPHACK_AFTER from EXTRA_DIST [Bug 1414]
+
+ sntp/Makefile.am@1.21 +1 -1
+ reference $(srcdir)/COPYRIGHT in EXTRA_DIST not COPYRIGHT [Bug 1414]
+
+ChangeSet@1.2082.4.4, 2009-12-12 08:31:39+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC.
+
+ ChangeLog@1.496.26.1 +4 -0
+ [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC.
+
+ configure.ac@1.465.1.1 +1 -47
+ [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC.
+
+ m4/os_cflags.m4@1.4 +82 -72
+ [Bug 1412] m4/os_cflags.m4 caches results that depend on $CC.
+
+ChangeSet@1.2084.1.1, 2009-12-10 06:24:33-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_7
+ TAG: NTP_4_2_7
+
+ ChangeLog@1.496.25.1 +1 -0
+ NTP_4_2_7
+
+ ntpd/ntpd-opts.c@1.247.1.1 +2 -2
+ NTP_4_2_7
+
+ ntpd/ntpd-opts.h@1.247.1.1 +3 -3
+ NTP_4_2_7
+
+ ntpd/ntpd-opts.texi@1.245.1.1 +2 -61
+ NTP_4_2_7
+
+ ntpd/ntpd.1@1.245.1.1 +2 -2
+ NTP_4_2_7
+
+ ntpdc/ntpdc-opts.c@1.243.1.1 +2 -2
+ NTP_4_2_7
+
+ ntpdc/ntpdc-opts.h@1.243.1.1 +3 -3
+ NTP_4_2_7
+
+ ntpdc/ntpdc-opts.texi@1.242.1.1 +2 -66
+ NTP_4_2_7
+
+ ntpdc/ntpdc.1@1.242.1.1 +2 -2
+ NTP_4_2_7
+
+ ntpq/ntpq-opts.c@1.244.1.1 +2 -2
+ NTP_4_2_7
+
+ ntpq/ntpq-opts.h@1.244.1.1 +3 -3
+ NTP_4_2_7
+
+ ntpq/ntpq-opts.texi@1.243.1.1 +2 -51
+ NTP_4_2_7
+
+ ntpq/ntpq.1@1.243.1.1 +2 -2
+ NTP_4_2_7
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.122.1.1 +2 -2
+ NTP_4_2_7
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.122.1.1 +3 -3
+ NTP_4_2_7
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.122.1.1 +1 -1
+ NTP_4_2_7
+
+ ntpsnmpd/ntpsnmpd.1@1.121.1.1 +2 -2
+ NTP_4_2_7
+
+ packageinfo.sh@1.258 +1 -1
+ NTP_4_2_7
+
+ sntp/sntp-opts.c@1.116.1.1 +2 -2
+ NTP_4_2_7
+
+ sntp/sntp-opts.h@1.116.1.1 +3 -3
+ NTP_4_2_7
+
+ sntp/sntp-opts.texi@1.116.1.1 +2 -60
+ NTP_4_2_7
+
+ sntp/sntp.1@1.116.1.1 +2 -2
+ NTP_4_2_7
+
+ sntp/sntp.html@1.6.1.1 +14 -10
+ NTP_4_2_7
+
+ util/ntp-keygen-opts.c@1.246.1.1 +2 -2
+ NTP_4_2_7
+
+ util/ntp-keygen-opts.h@1.246.1.1 +3 -3
+ NTP_4_2_7
+
+ util/ntp-keygen-opts.texi@1.245.1.1 +2 -46
+ NTP_4_2_7
+
+ util/ntp-keygen.1@1.245.1.1 +2 -2
+ NTP_4_2_7
+
+ChangeSet@1.2082.4.3, 2009-12-10 05:49:19-05:00, stenn@whimsy.udel.edu
+ 4.2.6
+ TAG: NTP_4_2_6
+
+ ntpd/ntpd-opts.c@1.248 +1 -1
+ 4.2.6
+
+ ntpd/ntpd-opts.h@1.248 +1 -1
+ 4.2.6
+
+ ntpd/ntpd-opts.texi@1.246 +1 -1
+ 4.2.6
+
+ ntpd/ntpd.1@1.246 +2 -2
+ 4.2.6
+
+ ntpdc/ntpdc-opts.c@1.244 +1 -1
+ 4.2.6
+
+ ntpdc/ntpdc-opts.h@1.244 +1 -1
+ 4.2.6
+
+ ntpdc/ntpdc-opts.texi@1.243 +2 -2
+ 4.2.6
+
+ ntpdc/ntpdc.1@1.243 +2 -2
+ 4.2.6
+
+ ntpq/ntpq-opts.c@1.245 +1 -1
+ 4.2.6
+
+ ntpq/ntpq-opts.h@1.245 +1 -1
+ 4.2.6
+
+ ntpq/ntpq-opts.texi@1.244 +2 -2
+ 4.2.6
+
+ ntpq/ntpq.1@1.244 +2 -2
+ 4.2.6
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.123 +1 -1
+ 4.2.6
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.123 +1 -1
+ 4.2.6
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.123 +23 -2
+ 4.2.6
+
+ ntpsnmpd/ntpsnmpd.1@1.122 +2 -2
+ 4.2.6
+
+ sntp/sntp-opts.c@1.117 +1 -1
+ 4.2.6
+
+ sntp/sntp-opts.h@1.117 +1 -1
+ 4.2.6
+
+ sntp/sntp-opts.texi@1.117 +2 -2
+ 4.2.6
+
+ sntp/sntp.1@1.117 +2 -2
+ 4.2.6
+
+ sntp/sntp.html@1.7 +13 -9
+ 4.2.6
+
+ util/ntp-keygen-opts.c@1.247 +1 -1
+ 4.2.6
+
+ util/ntp-keygen-opts.h@1.247 +1 -1
+ 4.2.6
+
+ util/ntp-keygen-opts.texi@1.246 +2 -2
+ 4.2.6
+
+ util/ntp-keygen.1@1.246 +2 -2
+ 4.2.6
+
+ChangeSet@1.2087, 2009-12-10 04:55:00+00:00, davehart@shiny.ad.hartbrothers.com
+ use 's' for symmetric mode in billboard type column
+
+ ntpq/ntpq-subs.c@1.43 +1 -1
+ use 's' for symmetric mode in billboard type column
+
+ChangeSet@1.2086, 2009-12-10 02:30:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1338] ntpq displays incorrect association type codes.
+
+ ChangeLog@1.496.1.67 +1 -0
+ [Bug 1338] ntpq displays incorrect association type codes.
+
+ChangeSet@1.2050.3.2, 2009-12-10 02:09:19+00:00, davehart@shiny.ad.hartbrothers.com
+ use 'A' for manycast server to be consistent with B, M
+
+ ntpq/ntpq-subs.c@1.41 +1 -1
+ use 'A' for manycast server to be consistent with B, M
+
+ChangeSet@1.2082.1.8, 2009-12-09 03:55:07-05:00, stenn@deacon.udel.edu
+ -dev is now 4.2.7
+
+ ChangeLog@1.496.23.8 +1 -0
+ -dev is now 4.2.7
+
+ChangeSet@1.2082.4.2, 2009-12-09 03:46:30-05:00, stenn@deacon.udel.edu
+ cleanup
+
+ ChangeLog@1.496.23.7 +1 -1
+ cleanup
+
+ ntpd/ntpd-opts.c@1.247 +2 -2
+ cleanup
+
+ ntpd/ntpd-opts.h@1.247 +3 -3
+ cleanup
+
+ ntpd/ntpd-opts.texi@1.245 +2 -2
+ cleanup
+
+ ntpd/ntpd.1@1.245 +2 -2
+ cleanup
+
+ ntpdc/ntpdc-opts.c@1.243 +2 -2
+ cleanup
+
+ ntpdc/ntpdc-opts.h@1.243 +3 -3
+ cleanup
+
+ ntpdc/ntpdc-opts.texi@1.242 +3 -3
+ cleanup
+
+ ntpdc/ntpdc.1@1.242 +2 -2
+ cleanup
+
+ ntpq/ntpq-opts.c@1.244 +2 -2
+ cleanup
+
+ ntpq/ntpq-opts.h@1.244 +3 -3
+ cleanup
+
+ ntpq/ntpq-opts.texi@1.243 +3 -3
+ cleanup
+
+ ntpq/ntpq.1@1.243 +2 -2
+ cleanup
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.122 +2 -2
+ cleanup
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.122 +3 -3
+ cleanup
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.122 +1 -1
+ cleanup
+
+ ntpsnmpd/ntpsnmpd.1@1.121 +2 -2
+ cleanup
+
+ packageinfo.sh@1.255.1.2 +1 -1
+ cleanup
+
+ sntp/sntp-opts.c@1.116 +2 -2
+ cleanup
+
+ sntp/sntp-opts.h@1.116 +3 -3
+ cleanup
+
+ sntp/sntp-opts.texi@1.116 +3 -3
+ cleanup
+
+ sntp/sntp.1@1.116 +2 -2
+ cleanup
+
+ sntp/sntp.html@1.6 +1 -1
+ cleanup
+
+ util/ntp-keygen-opts.c@1.246 +2 -2
+ cleanup
+
+ util/ntp-keygen-opts.h@1.246 +3 -3
+ cleanup
+
+ util/ntp-keygen-opts.texi@1.245 +3 -3
+ cleanup
+
+ util/ntp-keygen.1@1.245 +2 -2
+ cleanup
+
+ChangeSet@1.2082.4.1, 2009-12-09 02:58:13-05:00, stenn@deacon.udel.edu
+ NTP_4_2_6_RC
+ TAG: NTP_4_2_6_RC
+
+ ChangeLog@1.496.23.6 +1 -0
+ NTP_4_2_6_RC
+
+ ntpd/ntpd-opts.c@1.246 +2 -2
+ NTP_4_2_6_RC
+
+ ntpd/ntpd-opts.h@1.246 +3 -3
+ NTP_4_2_6_RC
+
+ ntpd/ntpd-opts.texi@1.244 +61 -2
+ NTP_4_2_6_RC
+
+ ntpd/ntpd.1@1.244 +2 -2
+ NTP_4_2_6_RC
+
+ ntpdc/ntpdc-opts.c@1.242 +2 -2
+ NTP_4_2_6_RC
+
+ ntpdc/ntpdc-opts.h@1.242 +3 -3
+ NTP_4_2_6_RC
+
+ ntpdc/ntpdc-opts.texi@1.241 +66 -2
+ NTP_4_2_6_RC
+
+ ntpdc/ntpdc.1@1.241 +2 -2
+ NTP_4_2_6_RC
+
+ ntpq/ntpq-opts.c@1.243 +2 -2
+ NTP_4_2_6_RC
+
+ ntpq/ntpq-opts.h@1.243 +3 -3
+ NTP_4_2_6_RC
+
+ ntpq/ntpq-opts.texi@1.242 +51 -2
+ NTP_4_2_6_RC
+
+ ntpq/ntpq.1@1.242 +2 -2
+ NTP_4_2_6_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.121 +2 -2
+ NTP_4_2_6_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.121 +3 -3
+ NTP_4_2_6_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.121 +1 -1
+ NTP_4_2_6_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.120 +2 -2
+ NTP_4_2_6_RC
+
+ packageinfo.sh@1.255.1.1 +3 -3
+ NTP_4_2_6_RC
+
+ sntp/sntp-opts.c@1.115 +2 -2
+ NTP_4_2_6_RC
+
+ sntp/sntp-opts.h@1.115 +3 -3
+ NTP_4_2_6_RC
+
+ sntp/sntp-opts.texi@1.115 +60 -2
+ NTP_4_2_6_RC
+
+ sntp/sntp.1@1.115 +2 -2
+ NTP_4_2_6_RC
+
+ sntp/sntp.html@1.5 +10 -14
+ NTP_4_2_6_RC
+
+ util/ntp-keygen-opts.c@1.245 +2 -2
+ NTP_4_2_6_RC
+
+ util/ntp-keygen-opts.h@1.245 +3 -3
+ NTP_4_2_6_RC
+
+ util/ntp-keygen-opts.texi@1.244 +46 -2
+ NTP_4_2_6_RC
+
+ util/ntp-keygen.1@1.244 +2 -2
+ NTP_4_2_6_RC
+
+ChangeSet@1.2082.3.1, 2009-12-09 00:16:12-05:00, stenn@deacon.udel.edu
+ 4.2.7
+
+ packageinfo.sh@1.254.1.1 +4 -4
+ 4.2.7
+
+ChangeSet@1.2082.1.5, 2009-12-09 00:06:06-05:00, stenn@deacon.udel.edu
+ 4.2.6
+
+ ChangeLog@1.496.23.5 +1 -0
+ 4.2.6
+
+ packageinfo.sh@1.255 +5 -5
+ 4.2.6
+
+ChangeSet@1.2082.1.4, 2009-12-08 10:09:30-05:00, stenn@deacon.udel.edu
+ Include 4.2.4p8
+
+ ChangeLog@1.496.23.4 +1 -0
+
+ChangeSet@1.1436.15.75, 2009-12-08 08:30:54-05:00, stenn@whimsy.udel.edu
+ ChangeLog:
+ typo
+
+ ChangeLog@1.1.1.94 +0 -1
+ typo
+
+ChangeSet@1.1436.15.74, 2009-12-08 08:23:12-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P8
+ TAG: NTP_4_2_4P8
+
+ ChangeLog@1.1.1.93 +1 -0
+ NTP_4_2_4P8
+
+ ntpd/ntpd-opts.c@1.50.26.2 +2 -2
+ NTP_4_2_4P8
+
+ ntpd/ntpd-opts.h@1.50.26.2 +3 -3
+ NTP_4_2_4P8
+
+ ntpd/ntpd-opts.texi@1.49.26.2 +1 -1
+ NTP_4_2_4P8
+
+ ntpd/ntpd.1@1.48.26.2 +2 -2
+ NTP_4_2_4P8
+
+ ntpd/ntpdsim-opts.c@1.50.26.2 +2 -2
+ NTP_4_2_4P8
+
+ ntpd/ntpdsim-opts.h@1.50.26.2 +3 -3
+ NTP_4_2_4P8
+
+ ntpd/ntpdsim-opts.texi@1.48.26.2 +1 -1
+ NTP_4_2_4P8
+
+ ntpd/ntpdsim.1@1.48.26.2 +2 -2
+ NTP_4_2_4P8
+
+ ntpdc/ntpdc-opts.c@1.50.26.2 +2 -2
+ NTP_4_2_4P8
+
+ ntpdc/ntpdc-opts.h@1.50.26.2 +3 -3
+ NTP_4_2_4P8
+
+ ntpdc/ntpdc-opts.texi@1.48.26.2 +1 -1
+ NTP_4_2_4P8
+
+ ntpdc/ntpdc.1@1.48.26.2 +2 -2
+ NTP_4_2_4P8
+
+ ntpq/ntpq-opts.c@1.52.26.2 +2 -2
+ NTP_4_2_4P8
+
+ ntpq/ntpq-opts.h@1.52.26.2 +3 -3
+ NTP_4_2_4P8
+
+ ntpq/ntpq-opts.texi@1.49.26.2 +1 -1
+ NTP_4_2_4P8
+
+ ntpq/ntpq.1@1.48.26.2 +2 -2
+ NTP_4_2_4P8
+
+ packageinfo.sh@1.65.34.3 +4 -4
+ NTP_4_2_4P8
+
+ sntp/sntp-opts.c@1.49.26.2 +2 -2
+ NTP_4_2_4P8
+
+ sntp/sntp-opts.h@1.49.26.2 +3 -3
+ NTP_4_2_4P8
+
+ sntp/sntp-opts.texi@1.46.26.2 +1 -1
+ NTP_4_2_4P8
+
+ sntp/sntp.1@1.49.26.2 +2 -2
+ NTP_4_2_4P8
+
+ util/ntp-keygen-opts.c@1.49.26.2 +2 -2
+ NTP_4_2_4P8
+
+ util/ntp-keygen-opts.h@1.49.26.2 +3 -3
+ NTP_4_2_4P8
+
+ util/ntp-keygen-opts.texi@1.47.26.2 +1 -1
+ NTP_4_2_4P8
+
+ util/ntp-keygen.1@1.47.26.2 +2 -2
+ NTP_4_2_4P8
+
+ChangeSet@1.1436.15.73, 2009-12-08 07:45:28-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P9_RC1
+ TAG: NTP_4_2_4P9_RC1
+
+ ChangeLog@1.1.1.92 +1 -0
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpd-opts.c@1.50.26.1 +5 -5
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpd-opts.h@1.50.26.1 +4 -4
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpd-opts.texi@1.49.26.1 +13 -6
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpd.1@1.48.26.1 +2 -2
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.26.1 +5 -5
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.26.1 +4 -4
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.26.1 +61 -2
+ NTP_4_2_4P9_RC1
+
+ ntpd/ntpdsim.1@1.48.26.1 +2 -2
+ NTP_4_2_4P9_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.26.1 +5 -5
+ NTP_4_2_4P9_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.26.1 +4 -4
+ NTP_4_2_4P9_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.26.1 +7 -4
+ NTP_4_2_4P9_RC1
+
+ ntpdc/ntpdc.1@1.48.26.1 +2 -2
+ NTP_4_2_4P9_RC1
+
+ ntpq/ntpq-opts.c@1.52.26.1 +5 -5
+ NTP_4_2_4P9_RC1
+
+ ntpq/ntpq-opts.h@1.52.26.1 +4 -4
+ NTP_4_2_4P9_RC1
+
+ ntpq/ntpq-opts.texi@1.49.26.1 +8 -4
+ NTP_4_2_4P9_RC1
+
+ ntpq/ntpq.1@1.48.26.1 +2 -2
+ NTP_4_2_4P9_RC1
+
+ packageinfo.sh@1.65.34.2 +3 -3
+ NTP_4_2_4P9_RC1
+
+ sntp/sntp-opts.c@1.49.26.1 +5 -5
+ NTP_4_2_4P9_RC1
+
+ sntp/sntp-opts.h@1.49.26.1 +4 -4
+ NTP_4_2_4P9_RC1
+
+ sntp/sntp-opts.texi@1.46.26.1 +54 -2
+ NTP_4_2_4P9_RC1
+
+ sntp/sntp.1@1.49.26.1 +2 -2
+ NTP_4_2_4P9_RC1
+
+ util/ntp-keygen-opts.c@1.49.26.1 +5 -5
+ NTP_4_2_4P9_RC1
+
+ util/ntp-keygen-opts.h@1.49.26.1 +4 -4
+ NTP_4_2_4P9_RC1
+
+ util/ntp-keygen-opts.texi@1.47.26.1 +4 -4
+ NTP_4_2_4P9_RC1
+
+ util/ntp-keygen.1@1.47.26.1 +2 -2
+ NTP_4_2_4P9_RC1
+
+ChangeSet@1.1436.15.72, 2009-12-08 05:36:47-05:00, stenn@whimsy.udel.edu
+ [Sec 1331] DoS with mode 7 packets - CVE-2009-3563
+
+ NEWS@1.86.1.16 +34 -0
+ [Sec 1331] DoS with mode 7 packets - CVE-2009-3563
+
+ packageinfo.sh@1.65.34.1 +2 -2
+ [Sec 1331] DoS with mode 7 packets - CVE-2009-3563
+
+ChangeSet@1.2082.1.1, 2009-12-07 11:58:19+01:00, burnicki@pogo.udel.edu
+ [Bug 508] Fixed leap second handling for Windows.
+
+ ChangeLog@1.496.23.1 +1 -0
+ [Bug 508] Fixed leap second handling for Windows.
+
+ ntpd/ntp_timer.c@1.56 +2 -0
+ [Bug 508] Fixed leap second handling for Windows.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.38 +17 -2
+ [Bug 508] Fixed leap second handling for Windows.
+
+ChangeSet@1.2083, 2009-12-06 20:46:44+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1407] configure.ac: recent GNU Make -v does not include "version".
+
+ ChangeLog@1.496.1.65 +1 -0
+ [Bug 1407] configure.ac: recent GNU Make -v does not include "version".
+
+ configure.ac@1.466 +1 -4
+ clone GNU Make test from m4/ntp_vpathhack.m4, recognize newer GNU Make
+ which does not include "version" in its -v output
+
+ChangeSet@1.2082, 2009-11-30 05:29:50-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P250_RC
+ TAG: NTP_4_2_5P250_RC
+
+ ChangeLog@1.496.1.64 +1 -0
+ NTP_4_2_5P250_RC
+
+ ntpd/ntpd-opts.c@1.245 +2 -2
+ NTP_4_2_5P250_RC
+
+ ntpd/ntpd-opts.h@1.245 +3 -3
+ NTP_4_2_5P250_RC
+
+ ntpd/ntpd-opts.texi@1.243 +1 -1
+ NTP_4_2_5P250_RC
+
+ ntpd/ntpd.1@1.243 +2 -2
+ NTP_4_2_5P250_RC
+
+ ntpdc/ntpdc-opts.c@1.241 +2 -2
+ NTP_4_2_5P250_RC
+
+ ntpdc/ntpdc-opts.h@1.241 +3 -3
+ NTP_4_2_5P250_RC
+
+ ntpdc/ntpdc-opts.texi@1.240 +1 -1
+ NTP_4_2_5P250_RC
+
+ ntpdc/ntpdc.1@1.240 +2 -2
+ NTP_4_2_5P250_RC
+
+ ntpq/ntpq-opts.c@1.242 +2 -2
+ NTP_4_2_5P250_RC
+
+ ntpq/ntpq-opts.h@1.242 +3 -3
+ NTP_4_2_5P250_RC
+
+ ntpq/ntpq-opts.texi@1.241 +1 -1
+ NTP_4_2_5P250_RC
+
+ ntpq/ntpq.1@1.241 +2 -2
+ NTP_4_2_5P250_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.120 +2 -2
+ NTP_4_2_5P250_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.120 +3 -3
+ NTP_4_2_5P250_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.120 +1 -1
+ NTP_4_2_5P250_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.119 +2 -2
+ NTP_4_2_5P250_RC
+
+ packageinfo.sh@1.254 +1 -1
+ NTP_4_2_5P250_RC
+
+ sntp/sntp-opts.c@1.114 +4 -4
+ NTP_4_2_5P250_RC
+
+ sntp/sntp-opts.h@1.114 +3 -3
+ NTP_4_2_5P250_RC
+
+ sntp/sntp-opts.texi@1.114 +7 -7
+ NTP_4_2_5P250_RC
+
+ sntp/sntp.1@1.114 +37 -37
+ NTP_4_2_5P250_RC
+
+ sntp/sntp.html@1.4 +5 -5
+ NTP_4_2_5P250_RC
+
+ util/ntp-keygen-opts.c@1.244 +2 -2
+ NTP_4_2_5P250_RC
+
+ util/ntp-keygen-opts.h@1.244 +3 -3
+ NTP_4_2_5P250_RC
+
+ util/ntp-keygen-opts.texi@1.243 +1 -1
+ NTP_4_2_5P250_RC
+
+ util/ntp-keygen.1@1.243 +2 -2
+ NTP_4_2_5P250_RC
+
+ChangeSet@1.2081, 2009-11-30 04:19:28-05:00, stenn@whimsy.udel.edu
+ sntp documentation updates
+
+ sntp/sntp.texi@1.3 +2 -2
+ sntp documentation updates
+
+ChangeSet@1.2080, 2009-11-30 04:15:15-05:00, stenn@whimsy.udel.edu
+ sntp documentation updates
+
+ sntp/sntp.texi@1.2 +4 -4
+ sntp documentation updates
+
+ChangeSet@1.2079, 2009-11-30 04:06:48-05:00, stenn@whimsy.udel.edu
+ sntp documentation updates
+
+ ChangeLog@1.496.1.63 +1 -0
+ sntp documentation updates
+
+ sntp/sntp-opts.def@1.15 +21 -12
+ sntp documentation updates
+
+ChangeSet@1.2075.1.2, 2009-11-29 23:36:52-05:00, murray@malarky.udel.edu
+ ntp_intres.c, ChangeLog:
+ Fix for bug 1386: Deferred DNS doesn't work on NetBSD
+
+ ChangeLog@1.496.20.10 +1 -0
+ Fix for bug 1386: Deferred DNS doesn't work on NetBSD
+
+ ntpd/ntp_intres.c@1.76 +28 -12
+ Fix for bug 1386: Deferred DNS doesn't work on NetBSD
+
+ChangeSet@1.2075.1.1, 2009-11-28 21:30:09-05:00, murray@malarky.udel.edu
+ configure.ac:
+ Add --enable-force-defer-DNS
+ Helps debugging deferred DNS lookups.
+ ChangeLog:
+ Bug 761: internal resolver does not seem to honor -4/-6 qualifiers
+ ntp_config.c:
+ Bug 761: internal resolver does not seem to honor -4/-6 qualifiers
+ FORCE_DEFER_DNS helps debugging.
+ Pass no_needed to ntp_intres, first step on Bug 975.
+ ntp_intres.c:
+ Bug 761: internal resolver does not seem to honor -4/-6 qualifiers
+ Take no_needed from ntp_config, first step on Bug 975.
+
+ ChangeLog@1.496.20.9 +3 -0
+ Bug 761: internal resolver does not seem to honor -4/-6 qualifiers
+
+ configure.ac@1.465 +16 -0
+ Add --enable-force-defer-DNS
+ Helps debugging deferred DNS lookups.
+
+ ntpd/ntp_config.c@1.238 +20 -10
+ Bug 761: internal resolver does not seem to honor -4/-6 qualifiers
+ FORCE_DEFER_DNS helps debugging.
+ Pass no_needed to ntp_intres, first step on Bug 975.
+
+ ntpd/ntp_intres.c@1.75 +31 -17
+ Bug 761: internal resolver does not seem to honor -4/-6 qualifiers
+ Take no_needed from ntp_config, first step on Bug 975.
+
+ChangeSet@1.2077, 2009-11-28 23:42:10+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+
+ ChangeLog@1.496.1.61 +1 -0
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+
+ ntpd/Makefile.am@1.79 +6 -2
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+
+ ntpdc/Makefile.am@1.47 +4 -1
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+
+ ntpq/Makefile.am@1.42 +4 -1
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+
+ ntpsnmpd/Makefile.am@1.15 +4 -1
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+
+ sntp/Makefile.am@1.20 +12 -3
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+ when recursively building sntp binary for .texi rule, make libopts.la first
+
+ util/Makefile.am@1.45 +4 -1
+ [Bug 1391] avoid invoking autogen twice for .c and .h files.
+
+ChangeSet@1.2075, 2009-11-28 05:29:18-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P249_RC
+ TAG: NTP_4_2_5P249_RC
+
+ ChangeLog@1.496.20.8 +1 -0
+ NTP_4_2_5P249_RC
+
+ ntpd/ntpd-opts.c@1.244 +2 -2
+ NTP_4_2_5P249_RC
+
+ ntpd/ntpd-opts.h@1.244 +3 -3
+ NTP_4_2_5P249_RC
+
+ ntpd/ntpd-opts.texi@1.242 +2 -61
+ NTP_4_2_5P249_RC
+
+ ntpd/ntpd.1@1.242 +2 -2
+ NTP_4_2_5P249_RC
+
+ ntpdc/ntpdc-opts.c@1.240 +2 -2
+ NTP_4_2_5P249_RC
+
+ ntpdc/ntpdc-opts.h@1.240 +3 -3
+ NTP_4_2_5P249_RC
+
+ ntpdc/ntpdc-opts.texi@1.239 +2 -66
+ NTP_4_2_5P249_RC
+
+ ntpdc/ntpdc.1@1.239 +2 -2
+ NTP_4_2_5P249_RC
+
+ ntpq/ntpq-opts.c@1.241 +2 -2
+ NTP_4_2_5P249_RC
+
+ ntpq/ntpq-opts.h@1.241 +3 -3
+ NTP_4_2_5P249_RC
+
+ ntpq/ntpq-opts.texi@1.240 +2 -51
+ NTP_4_2_5P249_RC
+
+ ntpq/ntpq.1@1.240 +2 -2
+ NTP_4_2_5P249_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.119 +2 -2
+ NTP_4_2_5P249_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.119 +3 -3
+ NTP_4_2_5P249_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.119 +2 -23
+ NTP_4_2_5P249_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.118 +2 -2
+ NTP_4_2_5P249_RC
+
+ packageinfo.sh@1.253 +1 -1
+ NTP_4_2_5P249_RC
+
+ sntp/sntp-opts.c@1.113 +6 -5
+ NTP_4_2_5P249_RC
+
+ sntp/sntp-opts.h@1.113 +3 -3
+ NTP_4_2_5P249_RC
+
+ sntp/sntp-opts.texi@1.113 +4 -55
+ NTP_4_2_5P249_RC
+
+ sntp/sntp.1@1.113 +18 -75
+ NTP_4_2_5P249_RC
+
+ sntp/sntp.html@1.3 +26 -22
+ NTP_4_2_5P249_RC
+
+ util/ntp-keygen-opts.c@1.243 +2 -2
+ NTP_4_2_5P249_RC
+
+ util/ntp-keygen-opts.h@1.243 +3 -3
+ NTP_4_2_5P249_RC
+
+ util/ntp-keygen-opts.texi@1.242 +2 -46
+ NTP_4_2_5P249_RC
+
+ util/ntp-keygen.1@1.242 +2 -2
+ NTP_4_2_5P249_RC
+
+ChangeSet@1.2074, 2009-11-28 04:25:13-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ sntp/main.c@1.24 +2 -1
+ cleanup
+
+ChangeSet@1.2072, 2009-11-28 01:43:01-05:00, stenn@whimsy.udel.edu
+ sntp cleanup
+
+ ChangeLog@1.496.20.6 +1 -0
+ sntp documentation cleanup
+
+ ChangeLog@1.496.20.5 +3 -0
+ sntp: Show dispersion. Clean up error messages and offset
+
+ sntp/main.c@1.23 +33 -18
+ sntp: Show dispersion. Clean up error messages and offset
+
+ sntp/networking.h@1.17 +1 -1
+ cleanup
+
+ sntp/sntp-opts.def@1.14 +16 -74
+ sntp documentation cleanup
+
+ChangeSet@1.2070.1.1, 2009-11-28 06:31:50+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1400] An empty KOD DB file causes sntp to coredump.
+
+ ChangeLog@1.496.22.1 +1 -0
+ [Bug 1400] An empty KOD DB file causes sntp to coredump.
+
+ sntp/kod_management.c@1.15 +45 -26
+ [Bug 1400] An empty KOD DB file causes sntp to coredump.
+
+ChangeSet@1.2071, 2009-11-28 01:27:47-05:00, stenn@whimsy.udel.edu
+ Cleanup from the autoconf/automake upgrades
+
+ ChangeLog@1.496.20.4 +1 -0
+ Cleanup from the autoconf/automake upgrades
+
+ Makefile.am@1.89 +1 -1
+ Cleanup from the autoconf/automake upgrades
+
+ configure.ac@1.464 +1 -1
+ Cleanup from the autoconf/automake upgrades
+
+ sntp/Makefile.am@1.19 +18 -12
+ Cleanup from the autoconf/automake upgrades
+
+ sntp/configure.ac@1.28 +1 -0
+ Cleanup from the autoconf/automake upgrades
+
+ChangeSet@1.2070, 2009-11-26 05:39:41-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P248_RC
+ TAG: NTP_4_2_5P248_RC
+
+ ChangeLog@1.496.20.3 +1 -0
+ NTP_4_2_5P248_RC
+
+ ntpd/ntpd-opts.c@1.243 +2 -2
+ NTP_4_2_5P248_RC
+
+ ntpd/ntpd-opts.h@1.243 +3 -3
+ NTP_4_2_5P248_RC
+
+ ntpd/ntpd-opts.texi@1.241 +9 -4
+ NTP_4_2_5P248_RC
+
+ ntpd/ntpd.1@1.241 +2 -2
+ NTP_4_2_5P248_RC
+
+ ntpdc/ntpdc-opts.c@1.239 +2 -2
+ NTP_4_2_5P248_RC
+
+ ntpdc/ntpdc-opts.h@1.239 +3 -3
+ NTP_4_2_5P248_RC
+
+ ntpdc/ntpdc-opts.texi@1.238 +7 -4
+ NTP_4_2_5P248_RC
+
+ ntpdc/ntpdc.1@1.238 +2 -2
+ NTP_4_2_5P248_RC
+
+ ntpq/ntpq-opts.c@1.240 +2 -2
+ NTP_4_2_5P248_RC
+
+ ntpq/ntpq-opts.h@1.240 +3 -3
+ NTP_4_2_5P248_RC
+
+ ntpq/ntpq-opts.texi@1.239 +3 -3
+ NTP_4_2_5P248_RC
+
+ ntpq/ntpq.1@1.239 +2 -2
+ NTP_4_2_5P248_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.118 +2 -2
+ NTP_4_2_5P248_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.118 +3 -3
+ NTP_4_2_5P248_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.118 +23 -2
+ NTP_4_2_5P248_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.117 +2 -2
+ NTP_4_2_5P248_RC
+
+ packageinfo.sh@1.252 +1 -1
+ NTP_4_2_5P248_RC
+
+ sntp/sntp-opts.c@1.112 +13 -9
+ NTP_4_2_5P248_RC
+
+ sntp/sntp-opts.h@1.112 +3 -3
+ NTP_4_2_5P248_RC
+
+ sntp/sntp-opts.texi@1.112 +18 -10
+ NTP_4_2_5P248_RC
+
+ sntp/sntp.1@1.112 +7 -38
+ NTP_4_2_5P248_RC
+
+ sntp/sntp.html@1.2 +22 -26
+ NTP_4_2_5P248_RC
+
+ util/ntp-keygen-opts.c@1.242 +2 -2
+ NTP_4_2_5P248_RC
+
+ util/ntp-keygen-opts.h@1.242 +3 -3
+ NTP_4_2_5P248_RC
+
+ util/ntp-keygen-opts.texi@1.241 +3 -3
+ NTP_4_2_5P248_RC
+
+ util/ntp-keygen.1@1.241 +2 -2
+ NTP_4_2_5P248_RC
+
+ChangeSet@1.2069, 2009-11-26 03:45:44-05:00, stenn@whimsy.udel.edu
+ updates for sntp/sntp.html
+
+ .point-changed-filelist@1.7 +1 -0
+ updates for sntp/sntp.html
+
+ BitKeeper/deleted/.del-version.texi~39e8aa5321c3de71@1.2 +0 -0
+ Delete: include/version.texi
+
+ BitKeeper/deleted/.del-version.texi~dc1d08ee311794@1.2 +0 -0
+ Delete: sntp/version.texi
+
+ BitKeeper/etc/ignore@1.74 +4 -3
+ updates for sntp/sntp.html
+
+ BitKeeper/etc/ignore@1.73 +1 -0
+ added version.texi
+
+ChangeSet@1.2068, 2009-11-26 07:04:26+00:00, hart@pogo.udel.edu
+ .del-depsver.mf~797b9b4e1db319be:
+ Delete: sntp/depsver.mf
+ ignore:
+ added sntp/depsver.mf
+
+ sntp/depsver.mf is 'generated' (copied) from top-level depsver.mf
+ by bootstrap script
+
+
+ BitKeeper/deleted/.del-depsver.mf~797b9b4e1db319be@1.2 +0 -0
+ Delete: sntp/depsver.mf
+
+ BitKeeper/etc/ignore@1.72 +1 -0
+ added sntp/depsver.mf
+
+ChangeSet@1.2067, 2009-11-26 01:42:32-05:00, stenn@psp-deb1.ntp.org
+ bk: ignore ltmain.sh
+
+ BitKeeper/etc/ignore@1.71 +1 -0
+ added ltmain.sh
+
+ChangeSet@1.2065, 2009-11-26 01:33:57-05:00, stenn@psp-deb1.ntp.org
+ Prepare for the generation of sntp.html
+
+ BitKeeper/etc/ignore@1.70 +1 -9
+ Update the bk ignore list
+
+ BitKeeper/etc/ignore@1.69 +1 -0
+ added config.cache-*
+
+ ChangeLog@1.496.21.1 +1 -0
+ Prepare for the generation of sntp.html
+
+ include/version.texi@1.1 +3 -0
+ BitKeeper file /home/stenn/ntp-dev-sntp/include/version.texi
+
+ include/version.texi@1.0 +0 -0
+
+ sntp/Makefile.am@1.17 +1 -5
+ Prepare for the generation of sntp.html
+
+ sntp/depsver.mf@1.1 +67 -0
+ BitKeeper file /home/stenn/ntp-dev-sntp/sntp/depsver.mf
+
+ sntp/depsver.mf@1.0 +0 -0
+
+ sntp/sntp.html@1.1 +105 -0
+ BitKeeper file /home/stenn/ntp-dev-sntp/sntp/sntp.html
+
+ sntp/sntp.html@1.0 +0 -0
+
+ sntp/version.texi@1.1 +3 -0
+ BitKeeper file /home/stenn/ntp-dev-sntp/sntp/version.texi
+
+ sntp/version.texi@1.0 +0 -0
+
+ChangeSet@1.2060.24.1, 2009-11-26 01:16:35-05:00, stenn@whimsy.udel.edu
+ Documentation changes from Dave Mills
+
+ ChangeLog@1.496.20.1 +1 -0
+ Documentation changes from Dave Mills
+
+ html/confopt.html@1.48 +53 -60
+ Documentation changes from Dave Mills
+
+ html/manyopt.html@1.20 +5 -3
+ Documentation changes from Dave Mills
+
+ html/quick.html@1.20 +17 -4
+ Documentation changes from Dave Mills
+
+ChangeSet@1.2060.3.52, 2009-11-26 01:06:36-05:00, stenn@pogo.udel.edu
+ typo nit
+
+ ChangeLog@1.496.1.59 +1 -1
+
+ChangeSet@1.2060.23.1, 2009-11-25 14:19:20-05:00, murray@malarky.udel.edu
+ refclock_shm.c, ChangeLog:
+ Bug-1397: shmget() failing because of file mode
+
+ ChangeLog@1.496.19.1 +1 -0
+ Bug-1397: shmget() failing because of file mode
+
+ ntpd/refclock_shm.c@1.20 +1 -1
+ Bug-1397: shmget() failing because of file mode
+
+ChangeSet@1.2060.3.50, 2009-11-24 22:05:54+00:00, davehart@shiny.ad.hartbrothers.com
+ One more missing free(), thanks to Hal Murray's sharp eyes
+
+ ntpd/ntp_intres.c@1.74 +2 -0
+ One more missing free(), thanks to Hal Murray's sharp eyes
+
+ChangeSet@1.2060.3.49, 2009-11-24 14:51:38+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1387] free() conf_entry in ntp_intres removeentry().
+ [Bug 1392] intres retries duplicate assocations endlessly.
+
+ ChangeLog@1.496.1.57 +1 -0
+ [Bug 1387] free() conf_entry in ntp_intres removeentry().
+ [Bug 1392] intres retries duplicate assocations endlessly.
+
+ ntpd/ntp_intres.c@1.73 +31 -26
+ [Bug 1387] free() conf_entry in ntp_intres removeentry().
+ [Bug 1392] intres retries duplicate assocations endlessly.
+
+ ntpd/ntp_peer.c@1.126 +6 -11
+ use DPRINTF
+
+ChangeSet@1.2060.3.48, 2009-11-23 17:43:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1387] Storage leak in ntp_intres (minor).
+ [Bug 1389] buffer overflow in refclock_oncore.c
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+
+ ChangeLog@1.496.1.56 +4 -0
+ [Bug 1387] Storage leak in ntp_intres (minor).
+ [Bug 1389] buffer overflow in refclock_oncore.c
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+
+ configure.ac@1.459.1.14 +3 -4
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ no functional change to configure.ac, eliminate duplicate
+ "checking for net-snmp-config" messages and clarify help text
+ for --with-ntpsnmpd.
+
+ ntpd/Makefile.am@1.78 +5 -3
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+ ntpd/ntp_intres.c@1.72 +1 -0
+ [Bug 1387] Storage leak in ntp_intres (minor).
+
+ ntpd/refclock_oncore.c@1.81 +306 -191
+ * [Bug 1389] buffer overflow in refclock_oncore.c
+
+ ntpdc/Makefile.am@1.46 +5 -3
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+ ntpq/Makefile.am@1.41 +5 -3
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+ ntpsnmpd/Makefile.am@1.14 +8 -3
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+ sntp/Makefile.am@1.13.1.6 +5 -3
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+ util/Makefile.am@1.44 +5 -3
+ [Bug 1391] .texi usage text from installed, not built binaries.
+ Correct *-opts.h dependency so default 'get' action isn't used.
+
+ChangeSet@1.2060.3.47, 2009-11-20 05:36:49-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P247_RC
+ TAG: NTP_4_2_5P247_RC
+
+ ChangeLog@1.496.1.55 +1 -0
+ NTP_4_2_5P247_RC
+
+ ntpd/ntpd-opts.c@1.242 +5 -5
+ NTP_4_2_5P247_RC
+
+ ntpd/ntpd-opts.h@1.242 +4 -4
+ NTP_4_2_5P247_RC
+
+ ntpd/ntpd-opts.texi@1.240 +2 -2
+ NTP_4_2_5P247_RC
+
+ ntpd/ntpd.1@1.240 +2 -2
+ NTP_4_2_5P247_RC
+
+ ntpdc/ntpdc-opts.c@1.238 +5 -5
+ NTP_4_2_5P247_RC
+
+ ntpdc/ntpdc-opts.h@1.238 +4 -4
+ NTP_4_2_5P247_RC
+
+ ntpdc/ntpdc-opts.texi@1.237 +4 -4
+ NTP_4_2_5P247_RC
+
+ ntpdc/ntpdc.1@1.237 +2 -2
+ NTP_4_2_5P247_RC
+
+ ntpq/ntpq-opts.c@1.239 +5 -5
+ NTP_4_2_5P247_RC
+
+ ntpq/ntpq-opts.h@1.239 +4 -4
+ NTP_4_2_5P247_RC
+
+ ntpq/ntpq-opts.texi@1.238 +4 -4
+ NTP_4_2_5P247_RC
+
+ ntpq/ntpq.1@1.238 +2 -2
+ NTP_4_2_5P247_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.117 +5 -5
+ NTP_4_2_5P247_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.117 +4 -4
+ NTP_4_2_5P247_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.117 +2 -23
+ NTP_4_2_5P247_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.116 +2 -2
+ NTP_4_2_5P247_RC
+
+ packageinfo.sh@1.251 +1 -1
+ NTP_4_2_5P247_RC
+
+ sntp/sntp-opts.c@1.111 +5 -5
+ NTP_4_2_5P247_RC
+
+ sntp/sntp-opts.h@1.111 +4 -4
+ NTP_4_2_5P247_RC
+
+ sntp/sntp-opts.texi@1.111 +4 -4
+ NTP_4_2_5P247_RC
+
+ sntp/sntp.1@1.111 +2 -2
+ NTP_4_2_5P247_RC
+
+ util/ntp-keygen-opts.c@1.241 +5 -5
+ NTP_4_2_5P247_RC
+
+ util/ntp-keygen-opts.h@1.241 +4 -4
+ NTP_4_2_5P247_RC
+
+ util/ntp-keygen-opts.texi@1.240 +5 -5
+ NTP_4_2_5P247_RC
+
+ util/ntp-keygen.1@1.240 +2 -2
+ NTP_4_2_5P247_RC
+
+ChangeSet@1.2060.3.46, 2009-11-18 04:29:17+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1308] support systems that lack fork().
+
+ ChangeLog@1.496.1.54 +1 -0
+ [Bug 1308] support systems that lack fork().
+
+ configure.ac@1.459.1.13 +2 -0
+ [Bug 1308] support systems that lack fork().
+
+ include/ntp_config.h@1.66 +12 -1
+ setup NO_INTRES macro on systems which do not support fork or threads
+
+ include/ntp_machine.h@1.26 +3 -3
+ stay out of compiler/system underscore namespace
+
+ ntpd/ntp_config.c@1.237 +12 -23
+ [Bug 1308] support systems that lack fork().
+
+ ntpd/ntp_intres.c@1.71 +7 -0
+ [Bug 1308] support systems that lack fork().
+
+ChangeSet@1.2060.3.45, 2009-11-17 19:43:44+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1142] nodebug builds shed no light on -d, -D option failure.
+ [Bug 1179] point out the problem with -i/--jaildir and -u/--user when
+ they are disabled by configure.
+ -4/-6 are not equivalent in the libopts sense
+
+ ChangeLog@1.496.1.53 +3 -0
+ * [Bug 1142] nodebug builds shed no light on -d, -D option failure.
+ * [Bug 1179] point out the problem with -i/--jaildir and -u/--user when
+ they are disabled by configure.
+
+
+ ntpd/cmd_args.c@1.56 +9 -41
+ [Bug 1142] nodebug builds shed no light on -d, -D option failure.
+ [Bug 1179] point out the problem with -i/--jaildir and -u/--user when
+ they are disabled by configure.
+ -4/-6 are not equivalent in the libopts sense
+ --authreq and --authnoreq are mutually exclusive
+
+ ntpd/ntpd-opts.c@1.241 +28 -20
+ updated Autogen output
+
+ ntpd/ntpd-opts.h@1.241 +2 -5
+ updated Autogen output
+
+ ntpd/ntpd-opts.texi@1.239 +17 -7
+ updated Autogen output
+
+ ntpd/ntpd.1@1.239 +16 -6
+ updated Autogen output
+
+ ntpd/ntpdbase-opts.def@1.20 +18 -6
+ [Bug 1142] nodebug builds shed no light on -d, -D option failure.
+ [Bug 1179] point out the problem with -i/--jaildir and -u/--user when
+ they are disabled by configure.
+ -4/-6 are not equivalent in the libopts sense
+
+ ntpdc/ntpdc-opts.c@1.237 +19 -11
+ updated Autogen output
+
+ ntpdc/ntpdc-opts.def@1.14 +2 -2
+ -4/-6 are not equivalent in the libopts sense
+
+ ntpdc/ntpdc-opts.h@1.237 +2 -5
+ updated Autogen output
+
+ ntpdc/ntpdc-opts.texi@1.236 +8 -6
+ updated Autogen output
+
+ ntpdc/ntpdc.1@1.236 +5 -3
+ updated Autogen output
+
+ ntpdc/ntpdc.c@1.75 +3 -8
+ -4/-6 are not equivalent in the libopts sense
+
+ ntpq/ntpq-opts.c@1.238 +4 -4
+ updated Autogen output
+
+ ntpq/ntpq-opts.h@1.238 +2 -2
+ updated Autogen output
+
+ ntpq/ntpq-opts.texi@1.237 +4 -4
+ updated Autogen output
+
+ ntpq/ntpq.1@1.237 +1 -1
+ updated Autogen output
+
+ ntpq/ntpq.c@1.97 +2 -1
+ Don't use DPRINTF because #ifdef DEBUG isn't valid in utils
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.116 +4 -4
+ updated Autogen output
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.116 +2 -2
+ updated Autogen output
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.116 +23 -2
+ updated Autogen output
+
+ sntp/main.c@1.22 +3 -5
+ -4/-6 are not equivalent in the libopts sense
+
+ sntp/sntp-opts.c@1.110 +19 -11
+ updated Autogen output
+
+ sntp/sntp-opts.def@1.11.1.1 +3 -2
+ -4/-6 are not equivalent in the libopts sense
+
+ sntp/sntp-opts.h@1.110 +2 -5
+ updated Autogen output
+
+ sntp/sntp-opts.texi@1.110 +8 -6
+ updated Autogen output
+
+ sntp/sntp.1@1.110 +5 -3
+ updated Autogen output
+
+ util/ntp-keygen-opts.c@1.240 +4 -4
+ updated Autogen output
+
+ util/ntp-keygen-opts.h@1.240 +2 -2
+ updated Autogen output
+
+ util/ntp-keygen-opts.texi@1.239 +5 -5
+ updated Autogen output
+
+ util/ntp-keygen.1@1.239 +1 -1
+ updated Autogen output
+
+ChangeSet@1.2060.3.44, 2009-11-17 16:15:53+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1343] sntp doesn't link on Solaris 7, needs -lresolv.
+
+ ChangeLog@1.496.1.52 +1 -0
+ [Bug 1343] sntp doesn't link on Solaris 7, needs -lresolv.
+
+ configure.ac@1.459.1.12 +2 -1
+ Search for inet_ntop in -lresolv if not in default libs, needed
+ for sntp on Solaris 7
+
+ sntp/configure.ac@1.27 +2 -1
+ Search for inet_ntop in -lresolv if not in default libs, needed
+ for sntp on Solaris 7
+
+ChangeSet@1.2060.3.43, 2009-11-17 07:34:00-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P246_RC
+ TAG: NTP_4_2_5P246_RC
+
+ ChangeLog@1.496.1.51 +1 -0
+ NTP_4_2_5P246_RC
+
+ ntpd/ntpd-opts.c@1.240 +32 -33
+ NTP_4_2_5P246_RC
+
+ ntpd/ntpd-opts.h@1.240 +8 -21
+ NTP_4_2_5P246_RC
+
+ ntpd/ntpd-opts.texi@1.238 +1 -1
+ NTP_4_2_5P246_RC
+
+ ntpd/ntpd.1@1.238 +3 -3
+ NTP_4_2_5P246_RC
+
+ ntpdc/ntpdc-opts.c@1.236 +24 -17
+ NTP_4_2_5P246_RC
+
+ ntpdc/ntpdc-opts.h@1.236 +6 -5
+ NTP_4_2_5P246_RC
+
+ ntpdc/ntpdc-opts.texi@1.235 +1 -1
+ NTP_4_2_5P246_RC
+
+ ntpdc/ntpdc.1@1.235 +3 -3
+ NTP_4_2_5P246_RC
+
+ ntpq/ntpq-opts.c@1.237 +24 -17
+ NTP_4_2_5P246_RC
+
+ ntpq/ntpq-opts.h@1.237 +5 -5
+ NTP_4_2_5P246_RC
+
+ ntpq/ntpq-opts.texi@1.236 +1 -1
+ NTP_4_2_5P246_RC
+
+ ntpq/ntpq.1@1.236 +3 -3
+ NTP_4_2_5P246_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.115 +24 -17
+ NTP_4_2_5P246_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.115 +5 -5
+ NTP_4_2_5P246_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.115 +1 -1
+ NTP_4_2_5P246_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.115 +3 -3
+ NTP_4_2_5P246_RC
+
+ packageinfo.sh@1.250 +1 -1
+ NTP_4_2_5P246_RC
+
+ sntp/sntp-opts.c@1.109 +24 -17
+ NTP_4_2_5P246_RC
+
+ sntp/sntp-opts.h@1.109 +8 -5
+ NTP_4_2_5P246_RC
+
+ sntp/sntp-opts.texi@1.109 +1 -1
+ NTP_4_2_5P246_RC
+
+ sntp/sntp.1@1.109 +3 -3
+ NTP_4_2_5P246_RC
+
+ util/ntp-keygen-opts.c@1.239 +39 -47
+ NTP_4_2_5P246_RC
+
+ util/ntp-keygen-opts.h@1.239 +11 -32
+ NTP_4_2_5P246_RC
+
+ util/ntp-keygen-opts.texi@1.238 +1 -1
+ NTP_4_2_5P246_RC
+
+ util/ntp-keygen.1@1.238 +3 -3
+ NTP_4_2_5P246_RC
+
+ChangeSet@1.2060.3.42, 2009-11-17 06:53:35-05:00, stenn@whimsy.udel.edu
+ autogen upgrade cleanup
+
+ clockstuff/clktest-opts.c@1.12 +130 -361
+ autogen upgrade cleanup
+
+ clockstuff/clktest-opts.h@1.12 +90 -100
+ autogen upgrade cleanup
+
+ libopts/autoopts/options.h@1.5 +7 -5
+ autogen upgrade cleanup
+
+ libopts/autoopts/usage-txt.h@1.5 +161 -152
+ autogen upgrade cleanup
+
+ libopts/genshell.c@1.5 +22 -15
+ autogen upgrade cleanup
+
+ libopts/genshell.h@1.5 +2 -2
+ autogen upgrade cleanup
+
+ ntpd/ntpdsim-opts.c@1.17 +237 -319
+ autogen upgrade cleanup
+
+ ntpd/ntpdsim-opts.h@1.17 +112 -139
+ autogen upgrade cleanup
+
+ sntp/libopts/autoopts/options.h@1.6 +7 -5
+ autogen upgrade cleanup
+
+ sntp/libopts/autoopts/usage-txt.h@1.6 +161 -152
+ autogen upgrade cleanup
+
+ sntp/libopts/genshell.c@1.6 +22 -15
+ autogen upgrade cleanup
+
+ sntp/libopts/genshell.h@1.6 +2 -2
+ autogen upgrade cleanup
+
+ChangeSet@1.2060.3.41, 2009-11-17 06:44:44-05:00, stenn@whimsy.udel.edu
+ Upgrade to autogen 5.10
+
+ ChangeLog@1.496.1.50 +1 -0
+ Upgrade to autogen 5.10
+
+ libopts/Makefile.am@1.2 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/ag-char-map.h@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/autoopts.c@1.4 +43 -26
+ Upgrade to autogen 5.10
+
+ libopts/autoopts.h@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/boolean.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/compat/compat.h@1.4 +48 -25
+ Upgrade to autogen 5.10
+
+ libopts/compat/pathfind.c@1.4 +1 -2
+ Upgrade to autogen 5.10
+
+ libopts/compat/windows-config.h@1.4 +0 -1
+ Upgrade to autogen 5.10
+
+ libopts/configfile.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/cook.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/enumeration.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/environment.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/file.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/load.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/m4/libopts.m4@1.5 +2 -8
+ Upgrade to autogen 5.10
+
+ libopts/m4/liboptschk.m4@1.4 +0 -1
+ Upgrade to autogen 5.10
+
+ libopts/makeshell.c@1.4 +41 -41
+ Upgrade to autogen 5.10
+
+ libopts/nested.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/numeric.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/pgusage.c@1.4 +5 -4
+ Upgrade to autogen 5.10
+
+ libopts/proto.h@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/putshell.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/reset.c@1.4 +8 -2
+ Upgrade to autogen 5.10
+
+ libopts/restore.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/save.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/sort.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/stack.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/streqvcmp.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/text_mmap.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/time.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/usage.c@1.4 +53 -18
+ Upgrade to autogen 5.10
+
+ libopts/value-type.h@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/version.c@1.4 +1 -1
+ Upgrade to autogen 5.10
+
+ libopts/xat-attribute.h@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/Makefile.am@1.3 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/ag-char-map.h@1.6 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/autoopts.c@1.5 +43 -26
+ Upgrade to autogen 5.10
+
+ sntp/libopts/autoopts.h@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/boolean.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/compat/compat.h@1.5 +48 -25
+ Upgrade to autogen 5.10
+
+ sntp/libopts/compat/pathfind.c@1.5 +1 -2
+ Upgrade to autogen 5.10
+
+ sntp/libopts/compat/windows-config.h@1.5 +0 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/configfile.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/cook.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/enumeration.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/environment.c@1.6 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/file.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/load.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/m4/libopts.m4@1.6 +2 -8
+ Upgrade to autogen 5.10
+
+ sntp/libopts/m4/liboptschk.m4@1.5 +0 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/makeshell.c@1.5 +41 -41
+ Upgrade to autogen 5.10
+
+ sntp/libopts/nested.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/numeric.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/pgusage.c@1.5 +5 -4
+ Upgrade to autogen 5.10
+
+ sntp/libopts/proto.h@1.6 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/putshell.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/reset.c@1.5 +8 -2
+ Upgrade to autogen 5.10
+
+ sntp/libopts/restore.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/save.c@1.6 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/sort.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/stack.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/streqvcmp.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/text_mmap.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/time.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/usage.c@1.5 +53 -18
+ Upgrade to autogen 5.10
+
+ sntp/libopts/value-type.h@1.6 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/version.c@1.5 +1 -1
+ Upgrade to autogen 5.10
+
+ sntp/libopts/xat-attribute.h@1.6 +1 -1
+ Upgrade to autogen 5.10
+
+ChangeSet@1.2060.3.40, 2009-11-17 07:27:53+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1384] ntpq :config core dumped with a blank password.
+
+ ChangeLog@1.496.1.49 +1 -0
+ [Bug 1384] ntpq :config core dumped with a blank password.
+
+ ntpq/ntpq-subs.c@1.39.1.2 +60 -41
+ [Bug 1384] ntpq :config core dumped with a blank password.
+
+ChangeSet@1.2060.22.1, 2009-11-17 04:25:42+00:00, davehart@shiny.ad.hartbrothers.com
+ use (peer->pmode == MODE_BROADCAST) rather than
+ (peer->castflags & MDF_BCLNT) to detect ephemeral broadcastclient
+ associations to exempt from peer_clear("XFAC")
+
+ ChangeLog@1.496.18.1 +1 -0
+ [Bug 1378] Unnecessary resetting of peers during interface update.
+
+ ntpd/ntp_peer.c@1.125 +1 -1
+ use (peer->pmode == MODE_BROADCAST) rather than
+ (peer->castflags & MDF_BCLNT) to detect broadcastclient
+ associations to exempt from peer_clear("XFAC"), suggested
+ by Frank Kardel.
+
+ChangeSet@1.2060.3.38, 2009-11-16 05:41:46+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1382] p245 configure --disable-dependency-tracking won't build
+
+ ChangeLog@1.496.1.47 +1 -0
+ [Bug 1382] p245 configure --disable-dependency-tracking won't build
+
+ Makefile.am@1.86.1.3 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ adjtimed/Makefile.am@1.6 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ clockstuff/Makefile.am@1.9 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ depsver.mf@1.2 +31 -7
+ tolerate --disable-dependency-tracking
+ use a more targeted ./config.status run
+
+ include/ntpd.h@1.137 +1 -1
+ silence "assignment discards qualifier" warning by using const char *
+
+ libntp/Makefile.am@1.51 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ ntpd/cmd_args.c@1.55 +1 -4
+ silence assignment discards qualifiers warning by eliminating assignment
+
+ ntpd/ntpd.c@1.110 +1 -1
+ silence "assignment discards qualifier" warning by using const char *
+
+ ntpdate/Makefile.am@1.22 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ ntpq/Makefile.am@1.40 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ ntpsnmpd/Makefile.am@1.13 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ parseutil/Makefile.am@1.12 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ sntp/Makefile.am@1.13.1.5 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ util/Makefile.am@1.43 +1 -0
+ depsver.mf requires CLEANFILES be set even if empty
+
+ChangeSet@1.2060.3.37, 2009-11-14 08:29:21-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P245_RC
+ TAG: NTP_4_2_5P245_RC
+
+ ChangeLog@1.496.1.46 +1 -0
+ NTP_4_2_5P245_RC
+
+ ntpd/ntpd-opts.c@1.239 +2 -2
+ NTP_4_2_5P245_RC
+
+ ntpd/ntpd-opts.h@1.239 +3 -3
+ NTP_4_2_5P245_RC
+
+ ntpd/ntpd-opts.texi@1.237 +1 -1
+ NTP_4_2_5P245_RC
+
+ ntpd/ntpd.1@1.237 +2 -2
+ NTP_4_2_5P245_RC
+
+ ntpdc/ntpdc-opts.c@1.235 +2 -2
+ NTP_4_2_5P245_RC
+
+ ntpdc/ntpdc-opts.h@1.235 +3 -3
+ NTP_4_2_5P245_RC
+
+ ntpdc/ntpdc-opts.texi@1.234 +1 -1
+ NTP_4_2_5P245_RC
+
+ ntpdc/ntpdc.1@1.234 +2 -2
+ NTP_4_2_5P245_RC
+
+ ntpq/ntpq-opts.c@1.236 +2 -2
+ NTP_4_2_5P245_RC
+
+ ntpq/ntpq-opts.h@1.236 +3 -3
+ NTP_4_2_5P245_RC
+
+ ntpq/ntpq-opts.texi@1.235 +1 -1
+ NTP_4_2_5P245_RC
+
+ ntpq/ntpq.1@1.235 +2 -2
+ NTP_4_2_5P245_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.114 +2 -2
+ NTP_4_2_5P245_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.114 +3 -3
+ NTP_4_2_5P245_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.114 +1 -1
+ NTP_4_2_5P245_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.114 +2 -2
+ NTP_4_2_5P245_RC
+
+ packageinfo.sh@1.249 +1 -1
+ NTP_4_2_5P245_RC
+
+ sntp/sntp-opts.c@1.108 +2 -2
+ NTP_4_2_5P245_RC
+
+ sntp/sntp-opts.h@1.108 +3 -3
+ NTP_4_2_5P245_RC
+
+ sntp/sntp-opts.texi@1.108 +1 -1
+ NTP_4_2_5P245_RC
+
+ sntp/sntp.1@1.108 +2 -2
+ NTP_4_2_5P245_RC
+
+ util/ntp-keygen-opts.c@1.238 +2 -2
+ NTP_4_2_5P245_RC
+
+ util/ntp-keygen-opts.h@1.238 +3 -3
+ NTP_4_2_5P245_RC
+
+ util/ntp-keygen-opts.texi@1.237 +1 -1
+ NTP_4_2_5P245_RC
+
+ util/ntp-keygen.1@1.237 +2 -2
+ NTP_4_2_5P245_RC
+
+ChangeSet@1.2060.3.36, 2009-11-14 07:23:50-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ChangeLog@1.496.1.45 +1 -0
+ Changes from Dave Mills
+
+ html/authopt.html@1.59 +6 -5
+ Cleanup from Dave Mills
+
+ html/keygen.html@1.19 +6 -6
+ Cleanup from Dave Mills
+
+ html/miscopt.html@1.53 +9 -3
+ Cleanup from Dave Mills
+
+ libntp/authreadkeys.c@1.16 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.153 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/refclock_local.c@1.20 +0 -9
+ Cleanup from Dave Mills
+
+ChangeSet@1.2060.21.1, 2009-11-14 02:20:06+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1381] Version .deps generated include file dependencies to allow
+ known dependecy-breaking changes to force .deps to be cleaned,
+ triggered by changing the contents of deps-ver and/or sntp/deps-ver.
+
+ ChangeLog@1.496.17.1 +3 -0
+ [Bug 1381] Version .deps generated include file dependencies to allow
+ known dependecy-breaking changes to force .deps to be cleaned,
+ triggered by changing the contents of deps-ver and/or sntp/deps-ver.
+
+ Makefile.am@1.86.1.2 +39 -39
+ whitespace cleanup
+ no longer hunt down and remove CVS directories in distclean,
+ as we don't have them.
+
+ adjtimed/Makefile.am@1.5 +3 -1
+ include depsver.mf
+
+ arlib/configure.in@1.3 +6 -3
+ bring res_init check in line with main configure.ac to fix
+ arlib build break
+
+ bootstrap@1.28 +1 -17
+ remove disabled first whack at this issue
+
+ clockstuff/Makefile.am@1.8 +3 -0
+ include depsver.mf
+
+ configure.ac@1.459.3.1 +0 -3
+ remove duplicate AC_SEARCH_LIBS for setsockopt
+
+ deps-ver@1.1 +1 -0
+ a change to the contents of this file cleans any existing .deps
+
+ deps-ver@1.0 +0 -0
+
+ depsver.mf@1.1 +43 -0
+ .am include to implement .deps include file dependency versioning
+
+ depsver.mf@1.0 +0 -0
+
+ libntp/Makefile.am@1.50 +2 -3
+ include depsver.mf
+ remove ../include/des.h rule, no longer used
+
+ libparse/Makefile.am@1.16 +3 -0
+ include depsver.mf
+
+ ntpd/Makefile.am@1.77 +2 -1
+ include depsver.mf
+
+ ntpd/ntp_peer.c@1.124 +0 -1
+ remove stale comment, stoa() uses LIB_GETBUF() and is safe to call
+ repeatedly in the same printf().
+
+ ntpdate/Makefile.am@1.21 +4 -2
+ include depsver.mf
+
+ ntpdc/Makefile.am@1.45 +2 -1
+ include depsver.mf
+
+ ntpq/Makefile.am@1.39 +3 -0
+ include depsver.mf
+
+ ntpsnmpd/Makefile.am@1.12 +2 -0
+ include depsver.mf
+
+ parseutil/Makefile.am@1.11 +3 -0
+ include depsver.mf
+
+ sntp/Makefile.am@1.13.1.4 +4 -1
+ include depsver.mf
+
+ sntp/configure.ac@1.24.1.1 +1 -2
+ AC_SEARCH_LIBS already tries without any libs, so wrapping with
+ AC_CHECK_FUNC just bloats
+
+ sntp/deps-ver@1.1 +1 -0
+ a change to the contents of this file cleans any existing .deps
+
+ sntp/deps-ver@1.0 +0 -0
+
+ util/Makefile.am@1.42 +3 -0
+ include depsver.mf
+
+ChangeSet@1.2060.3.34, 2009-11-13 13:31:39+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ mirror inet_ntop(), inet_pton() tests from top configure.ac
+ remomve ISC_PLATFORM_NEEDATON test, no longer used by libisc
+
+ configure.ac@1.459.1.10 +0 -1
+ remomve ISC_PLATFORM_NEEDATON test, no longer used by libisc
+
+ sntp/configure.ac@1.25 +3 -0
+ mirror inet_ntop(), inet_pton() tests from top configure.ac
+
+ChangeSet@1.2060.3.33, 2009-11-12 13:37:43+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1343] sntp illegal C does not compile on Solaris 7.
+ Windows VC9/VS2008: use generic library name libeay32.lib
+ instead of variants encoding build type to match what you
+ get building OpenSSL from source.
+
+ ChangeLog@1.496.1.43 +1 -0
+ [Bug 1343] sntp illegal C does not compile on Solaris 7.
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.9 +2 -2
+ use generic library name libeay32.lib instead of variants
+ encoding build type to match what you get building OpenSSL
+ from source.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.21.1.1 +2 -2
+ use generic library name libeay32.lib instead of variants
+ encoding build type to match what you get building OpenSSL
+ from source.
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.12 +2 -2
+ use generic library name libeay32.lib instead of variants
+ encoding build type to match what you get building OpenSSL
+ from source.
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.12 +2 -2
+ use generic library name libeay32.lib instead of variants
+ encoding build type to match what you get building OpenSSL
+ from source.
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.11 +2 -2
+ use generic library name libeay32.lib instead of variants
+ encoding build type to match what you get building OpenSSL
+ from source.
+
+ sntp/log.c@1.11 +9 -9
+ [Bug 1343] sntp illegal C does not compile on Solaris 7.
+
+ sntp/main.c@1.21 +5 -8
+ [Bug 1343] sntp illegal C does not compile on Solaris 7.
+
+ sntp/networking.c@1.28 +14 -11
+ [Bug 1343] sntp illegal C does not compile on Solaris 7.
+
+ChangeSet@1.2060.3.32, 2009-11-12 06:10:27-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P244_RC
+ TAG: NTP_4_2_5P244_RC
+
+ ChangeLog@1.496.1.42 +1 -0
+ NTP_4_2_5P244_RC
+
+ ntpd/ntpd-opts.c@1.238 +2 -2
+ NTP_4_2_5P244_RC
+
+ ntpd/ntpd-opts.h@1.238 +3 -3
+ NTP_4_2_5P244_RC
+
+ ntpd/ntpd-opts.texi@1.236 +1 -1
+ NTP_4_2_5P244_RC
+
+ ntpd/ntpd.1@1.236 +2 -2
+ NTP_4_2_5P244_RC
+
+ ntpdc/ntpdc-opts.c@1.234 +2 -2
+ NTP_4_2_5P244_RC
+
+ ntpdc/ntpdc-opts.h@1.234 +3 -3
+ NTP_4_2_5P244_RC
+
+ ntpdc/ntpdc-opts.texi@1.233 +1 -1
+ NTP_4_2_5P244_RC
+
+ ntpdc/ntpdc.1@1.233 +2 -2
+ NTP_4_2_5P244_RC
+
+ ntpq/ntpq-opts.c@1.235 +2 -2
+ NTP_4_2_5P244_RC
+
+ ntpq/ntpq-opts.h@1.235 +3 -3
+ NTP_4_2_5P244_RC
+
+ ntpq/ntpq-opts.texi@1.234 +1 -1
+ NTP_4_2_5P244_RC
+
+ ntpq/ntpq.1@1.234 +2 -2
+ NTP_4_2_5P244_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.113 +2 -2
+ NTP_4_2_5P244_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.113 +3 -3
+ NTP_4_2_5P244_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.113 +1 -1
+ NTP_4_2_5P244_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.113 +2 -2
+ NTP_4_2_5P244_RC
+
+ packageinfo.sh@1.248 +1 -1
+ NTP_4_2_5P244_RC
+
+ sntp/sntp-opts.c@1.107 +2 -2
+ NTP_4_2_5P244_RC
+
+ sntp/sntp-opts.h@1.107 +3 -3
+ NTP_4_2_5P244_RC
+
+ sntp/sntp-opts.texi@1.107 +1 -1
+ NTP_4_2_5P244_RC
+
+ sntp/sntp.1@1.107 +2 -2
+ NTP_4_2_5P244_RC
+
+ util/ntp-keygen-opts.c@1.237 +2 -2
+ NTP_4_2_5P244_RC
+
+ util/ntp-keygen-opts.h@1.237 +3 -3
+ NTP_4_2_5P244_RC
+
+ util/ntp-keygen-opts.texi@1.236 +1 -1
+ NTP_4_2_5P244_RC
+
+ util/ntp-keygen.1@1.236 +2 -2
+ NTP_4_2_5P244_RC
+
+ChangeSet@1.2060.3.31, 2009-11-12 04:26:17-05:00, stenn@whimsy.udel.edu
+ keygen.html updates from Dave Mills
+
+ ChangeLog@1.496.1.41 +1 -0
+ keygen.html updates from Dave Mills
+
+ html/keygen.html@1.18 +46 -26
+ keygen.html updates from Dave Mills
+
+ChangeSet@1.2060.3.30, 2009-11-12 02:29:11+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp-keygen.c:
+ 21 bytes don't fit well in a 17 byte buffer
+
+ util/ntp-keygen.c@1.63 +1 -1
+ 21 bytes don't fit well in a 17 byte buffer
+
+ChangeSet@1.2060.3.29, 2009-11-12 00:51:35+00:00, davehart@shiny.ad.hartbrothers.com
+ Cleanup, fix ntp_intres when requestkey type means digests
+ larger than 16 octets.
+ Add /lib to OpenSSL library search path, OpenSolaris has it there.
+
+ configure.ac@1.459.1.9 +1 -2
+ Add /lib to OpenSSL library search path, OpenSolaris has it there.
+
+ include/ntp_request.h@1.40 +5 -2
+ accomodate larger digests in mode 7 struct req_pkt.
+ introduce REQ_TAIL_MIN to represent struct req_pkt_tail size with a
+ 16-octet digest.
+
+ include/ntpd.h@1.136 +2 -0
+ expose req_keytype, req_hashlen for ntp_config.c use
+
+ libntp/authreadkeys.c@1.15 +6 -4
+ bounds check keystr[] access, eliminate truncation warning
+
+ libntp/hextoint.c@1.3 +14 -12
+ fix indents, more error checks
+
+ libntp/ssl_init.c@1.4 +17 -5
+ #include <ctype.h> for toupper()
+
+ ntpd/ntp_config.c@1.236 +21 -6
+ change #if 0 to #ifdef FORCE_DEFER_DNS
+
+ ntpd/ntp_intres.c@1.70 +67 -27
+ support new authentication layout with larger digests
+ remove dead debugging code, style
+
+ ntpd/ntp_request.c@1.80.1.6 +3 -3
+ account for growth of struct req_pkt_tail beyond 16-octet digest
+ by using REQ_TAIL_MIN instead of sizeof(req_pkt_tail).
+ fix format string warnings.
+
+ ntpdc/layout.std@1.9 +2 -2
+ req_pkt and req_pkt_tail both grew by 4 octets, but interop is
+ preserved
+
+ ntpdc/ntpdc.c@1.74 +4 -4
+ quiet shadows global warning
+
+ChangeSet@1.2060.20.1, 2009-11-11 12:36:24+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1003] ntpdc unconfig command doesn't prompt for keyid.
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+ ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a
+ non-fatal warning.
+
+ ChangeLog@1.496.16.1 +5 -0
+ [Bug 1003] ntpdc unconfig command doesn't prompt for keyid.
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+ ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a
+ non-fatal warning.
+
+ include/ntp_request.h@1.39 +10 -11
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ include/ntp_stdlib.h@1.40 +7 -2
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ libntp/a_md5encrypt.c@1.26 +2 -2
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ libntp/authreadkeys.c@1.12.1.1 +5 -10
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ libntp/ssl_init.c@1.3 +88 -5
+ ntp-keygen, Autokey OpenSSL build vs. run version mismatch is now a
+ non-fatal warning.
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ ntpd/keyword-gen.c@1.5 +5 -5
+ use
+
+ do
+ a;
+ while (b);
+
+ rather than equivalent
+
+ a;
+ while(b)
+ a;
+
+ ntpd/ntp_intres.c@1.67.1.1 +1 -1
+ use sizeof buffer not (formerly) equivalent macro
+
+ ntpd/ntp_request.c@1.80.1.5 +80 -88
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ ntpdc/ntpdc.c@1.73 +143 -94
+ [Bug 1003] ntpdc unconfig command doesn't prompt for keyid.
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ ntpdc/ntpdc_ops.c@1.62 +2 -2
+ whitespace only
+
+ ntpq/ntpq-subs.c@1.39.1.1 +1 -1
+ typo pointed out by Michael Tatarinov
+
+ ntpq/ntpq.c@1.96 +93 -69
+ [Bug 1376] Enable authenticated ntpq and ntpdc using newly-available
+ digest types.
+
+ChangeSet@1.2060.3.27, 2009-11-11 05:46:08-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P243_RC
+ TAG: NTP_4_2_5P243_RC
+
+ ChangeLog@1.496.1.39 +1 -0
+ NTP_4_2_5P243_RC
+
+ ntpd/ntpd-opts.c@1.237 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpd/ntpd-opts.h@1.237 +3 -3
+ NTP_4_2_5P243_RC
+
+ ntpd/ntpd-opts.texi@1.235 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpd/ntpd.1@1.235 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpdc/ntpdc-opts.c@1.233 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpdc/ntpdc-opts.h@1.233 +3 -3
+ NTP_4_2_5P243_RC
+
+ ntpdc/ntpdc-opts.texi@1.232 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpdc/ntpdc.1@1.232 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpq/ntpq-opts.c@1.234 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpq/ntpq-opts.h@1.234 +3 -3
+ NTP_4_2_5P243_RC
+
+ ntpq/ntpq-opts.texi@1.233 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpq/ntpq.1@1.233 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.112 +2 -2
+ NTP_4_2_5P243_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.112 +3 -3
+ NTP_4_2_5P243_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.112 +1 -1
+ NTP_4_2_5P243_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.112 +2 -2
+ NTP_4_2_5P243_RC
+
+ packageinfo.sh@1.247 +1 -1
+ NTP_4_2_5P243_RC
+
+ sntp/sntp-opts.c@1.106 +2 -2
+ NTP_4_2_5P243_RC
+
+ sntp/sntp-opts.h@1.106 +3 -3
+ NTP_4_2_5P243_RC
+
+ sntp/sntp-opts.texi@1.106 +2 -2
+ NTP_4_2_5P243_RC
+
+ sntp/sntp.1@1.106 +2 -2
+ NTP_4_2_5P243_RC
+
+ util/ntp-keygen-opts.c@1.236 +2 -2
+ NTP_4_2_5P243_RC
+
+ util/ntp-keygen-opts.h@1.236 +3 -3
+ NTP_4_2_5P243_RC
+
+ util/ntp-keygen-opts.texi@1.235 +2 -2
+ NTP_4_2_5P243_RC
+
+ util/ntp-keygen.1@1.235 +2 -2
+ NTP_4_2_5P243_RC
+
+ChangeSet@1.2060.3.26, 2009-11-11 04:04:33-05:00, stenn@pogo.udel.edu
+ [Bug 1226] Fix deferred DNS lookups
+
+ ChangeLog@1.496.1.38 +1 -0
+ [Bug 1226] Fix deferred DNS lookups
+
+ChangeSet@1.2060.19.2, 2009-11-11 03:08:32-05:00, stenn@whimsy.udel.edu
+ new crypto signature cleanup
+
+ ChangeLog@1.496.1.37 +1 -0
+ new crypto signature cleanup
+
+ html/authopt.html@1.58 +14 -5
+ new crypto signature cleanup
+
+ html/keygen.html@1.17 +12 -3
+ new crypto signature cleanup
+
+ libntp/authkeys.c@1.20 +11 -2
+ new crypto signature cleanup
+
+ libntp/authreadkeys.c@1.13 +38 -12
+ new crypto signature cleanup
+
+ util/ntp-keygen.c@1.62 +24 -4
+ new crypto signature cleanup
+
+ChangeSet@1.2060.19.1, 2009-11-10 05:02:56-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P242_RC
+ TAG: NTP_4_2_5P242_RC
+
+ ChangeLog@1.496.1.36 +1 -0
+ NTP_4_2_5P242_RC
+
+ ntpd/ntpd-opts.c@1.236 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpd/ntpd-opts.h@1.236 +3 -3
+ NTP_4_2_5P242_RC
+
+ ntpd/ntpd-opts.texi@1.234 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpd/ntpd.1@1.234 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpdc/ntpdc-opts.c@1.232 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpdc/ntpdc-opts.h@1.232 +3 -3
+ NTP_4_2_5P242_RC
+
+ ntpdc/ntpdc-opts.texi@1.231 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpdc/ntpdc.1@1.231 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpq/ntpq-opts.c@1.233 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpq/ntpq-opts.h@1.233 +3 -3
+ NTP_4_2_5P242_RC
+
+ ntpq/ntpq-opts.texi@1.232 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpq/ntpq.1@1.232 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.111 +2 -2
+ NTP_4_2_5P242_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.111 +3 -3
+ NTP_4_2_5P242_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.111 +1 -1
+ NTP_4_2_5P242_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.111 +2 -2
+ NTP_4_2_5P242_RC
+
+ packageinfo.sh@1.246 +1 -1
+ NTP_4_2_5P242_RC
+
+ sntp/sntp-opts.c@1.105 +2 -2
+ NTP_4_2_5P242_RC
+
+ sntp/sntp-opts.h@1.105 +3 -3
+ NTP_4_2_5P242_RC
+
+ sntp/sntp-opts.texi@1.105 +2 -2
+ NTP_4_2_5P242_RC
+
+ sntp/sntp.1@1.105 +2 -2
+ NTP_4_2_5P242_RC
+
+ util/ntp-keygen-opts.c@1.235 +2 -2
+ NTP_4_2_5P242_RC
+
+ util/ntp-keygen-opts.h@1.235 +3 -3
+ NTP_4_2_5P242_RC
+
+ util/ntp-keygen-opts.texi@1.234 +2 -2
+ NTP_4_2_5P242_RC
+
+ util/ntp-keygen.1@1.234 +2 -2
+ NTP_4_2_5P242_RC
+
+ChangeSet@1.2060.3.24, 2009-11-09 18:15:07-05:00, murray@malarky.udel.edu
+ configure.ac, ntp_intres.c:
+ Fix for bug-1266: reload /etc/resolv.conf on deferred DNS
+ ntp_config.c:
+ Hacks to help debug deferred DNS
+ (default off)
+
+ configure.ac@1.459.1.8 +4 -0
+ Fix for bug-1266: reload /etc/resolv.conf on deferred DNS
+
+ ntpd/ntp_config.c@1.235 +16 -0
+ Hacks to help debug deferred DNS
+ (default off)
+
+ ntpd/ntp_intres.c@1.68 +15 -7
+ Fix for bug-1266: reload /etc/resolv.conf on deferred DNS
+
+ChangeSet@1.2060.18.2, 2009-11-09 04:14:13-05:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.496.15.2 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.57 +5 -3
+ Documentation updates from Dave Mills
+
+ html/index.html@1.41 +25 -4
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2060.18.1, 2009-11-09 04:08:41-05:00, stenn@whimsy.udel.edu
+ authkeys.c cleanup from Dave Mills
+
+ ChangeLog@1.496.15.1 +1 -0
+ authkeys.c cleanup from Dave Mills
+
+ libntp/authkeys.c@1.17.1.1 +3 -4
+ authkeys.c cleanup from Dave Mills
+
+ChangeSet@1.2060.3.22, 2009-11-09 08:03:02+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1371] deferred DNS lookup failing with INFO_ERR_AUTH.
+ fixed in prior changeset with ntp_request.h modification
+ to REQ_LEN_NOMAC.
+
+ ChangeLog@1.496.1.34 +1 -0
+ [Bug 1371] deferred DNS lookup failing with INFO_ERR_AUTH.
+
+ChangeSet@1.2060.5.2, 2009-11-09 07:19:52+00:00, davehart@shiny.ad.hartbrothers.com
+ Shrink keyword scanner FSM entries from 64 to 32 bits apiece.
+ applies to prior changeset and this ChangeLog update
+
+ ChangeLog@1.496.14.1 +1 -0
+ Shrink keyword scanner FSM entries from 64 to 32 bits apiece.
+
+ChangeSet@1.2060.3.19, 2009-11-09 07:17:29+00:00, davehart@shiny.ad.hartbrothers.com
+ Stub out isc/mem.h, shaving 47k from a MIPS ntpd binary.
+ (applies to prior changeset along with this one)
+
+ ChangeLog@1.496.13.1 +1 -0
+ Stub out isc/mem.h, shaving 47k from a MIPS ntpd binary.
+
+ include/isc/mem.h@1.2 +1 -0
+ also stub out isc_mem_printallactive() to silence warning and avoid
+ trouble down the road, it's referenced by tasks.c
+
+ChangeSet@1.2060.17.1, 2009-11-08 12:32:55+00:00, kardel@pogo.udel.edu
+ clk_trimtsip.c:
+ [Bug 1363] CID 92 clarify fallthrough case
+ ChangeLog:
+ [Bug 1363] CID 92 clarify fallthrough case in clk_trimtsip.c
+
+ ChangeLog@1.496.12.1 +1 -0
+ [Bug 1363] CID 92 clarify fallthrough case in clk_trimtsip.c
+
+ libparse/clk_trimtsip.c@1.10 +10 -3
+ [Bug 1363] CID 92 clarify fallthrough case
+
+ChangeSet@1.2060.9.22, 2009-11-07 23:44:10+00:00, davehart@shiny.ad.hartbrothers.com
+ Use Frank Kardel's suggestion to collapse 3 cases to 1 for NetBSD
+ USE_FSETOWNCTTY test.
+
+ configure.ac@1.459.2.4 +4 -9
+ Use Frank Kardel's suggestion to collapse 3 cases to 1 for NetBSD
+ USE_FSETOWNCTTY test.
+
+ChangeSet@1.2060.16.2, 2009-11-07 22:46:41+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix authenticated ntpdc, broken in p240.
+
+ ChangeLog@1.496.11.2 +1 -0
+ Fix authenticated ntpdc, broken in p240.
+
+ include/ntp.h@1.168 +4 -4
+ parenthesize macro expansions such as:
+ 12 * sizeof(u_int32)
+
+ include/ntp_request.h@1.38 +4 -4
+ comments only
+
+ include/ntp_stdlib.h@1.39 +3 -2
+ separate OpenSSL version check from INIT_SSL()
+
+ libntp/a_md5encrypt.c@1.23.1.2 +2 -2
+ [Bug 1368] libntp does not compile --without-crypto
+ merge cleanup
+
+ libntp/authkeys.c@1.18 +3 -4
+ move break; in authhavekey() back where it belongs after recent
+ flub
+
+ libntp/authreadkeys.c@1.10.1.2 +1 -1
+ [Bug 1368] libntp doesn't compile --without-crypto
+
+ libntp/ssl_init.c@1.2 +11 -3
+ separate OpenSSL version check from INIT_SSL()
+
+ ntpd/ntp_control.c@1.129 +1 -1
+ correct harmless htons()/ntohs() mixup
+
+ ntpd/ntp_crypto.c@1.146 +3 -2
+ separate OpenSSL version check from INIT_SSL()
+
+ ntpd/ntp_intres.c@1.67 +2 -2
+ use sizeof rather than REQ_MAC_LEN for recv buffer size to prepare
+ for enabling authenticated mode 7 with non-MD5 keys
+
+ ntpd/ntp_request.c@1.80.1.4 +8 -7
+ eliminate extra parentheses, return after req_ack()
+
+ ntpdc/ntpdc.c@1.72 +11 -11
+ Fix authenticated ntpdc, broken in p240.
+
+ util/ntp-keygen.c@1.61 +1 -1
+ separate OpenSSL version check from INIT_SSL()
+
+ChangeSet@1.2060.9.20, 2009-11-07 12:16:01-05:00, murray@pogo.udel.edu
+ a_md5encrypt.c, authreadkeys.c, ChangeLog:
+ Fix for bug 1368 - typos in --without-crypto case
+
+ ChangeLog@1.496.1.30 +1 -0
+ Fix for bug 1368
+
+ libntp/a_md5encrypt.c@1.24 +1 -0
+ Fix for bug 1368
+
+ libntp/authreadkeys.c@1.11 +1 -1
+ Fix for bug 1368
+
+ChangeSet@1.2060.9.19, 2009-11-07 05:42:36-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P241_RC
+ TAG: NTP_4_2_5P241_RC
+
+ ChangeLog@1.496.1.29 +1 -0
+ NTP_4_2_5P241_RC
+
+ ntpd/ntpd-opts.c@1.235 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpd/ntpd-opts.h@1.235 +3 -3
+ NTP_4_2_5P241_RC
+
+ ntpd/ntpd-opts.texi@1.233 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpd/ntpd.1@1.233 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpdc/ntpdc-opts.c@1.231 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpdc/ntpdc-opts.h@1.231 +3 -3
+ NTP_4_2_5P241_RC
+
+ ntpdc/ntpdc-opts.texi@1.230 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpdc/ntpdc.1@1.230 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpq/ntpq-opts.c@1.232 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpq/ntpq-opts.h@1.232 +3 -3
+ NTP_4_2_5P241_RC
+
+ ntpq/ntpq-opts.texi@1.231 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpq/ntpq.1@1.231 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.110 +2 -2
+ NTP_4_2_5P241_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.110 +3 -3
+ NTP_4_2_5P241_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.110 +1 -1
+ NTP_4_2_5P241_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.110 +2 -2
+ NTP_4_2_5P241_RC
+
+ packageinfo.sh@1.245 +1 -1
+ NTP_4_2_5P241_RC
+
+ sntp/sntp-opts.c@1.104 +2 -2
+ NTP_4_2_5P241_RC
+
+ sntp/sntp-opts.h@1.104 +3 -3
+ NTP_4_2_5P241_RC
+
+ sntp/sntp-opts.texi@1.104 +2 -2
+ NTP_4_2_5P241_RC
+
+ sntp/sntp.1@1.104 +2 -2
+ NTP_4_2_5P241_RC
+
+ util/ntp-keygen-opts.c@1.234 +2 -2
+ NTP_4_2_5P241_RC
+
+ util/ntp-keygen-opts.h@1.234 +3 -3
+ NTP_4_2_5P241_RC
+
+ util/ntp-keygen-opts.texi@1.233 +2 -2
+ NTP_4_2_5P241_RC
+
+ util/ntp-keygen.1@1.233 +2 -2
+ NTP_4_2_5P241_RC
+
+ChangeSet@1.2060.15.1, 2009-11-07 07:57:11+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7.
+ initialize OpenSSL before first use in libntp
+ ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows
+ add crypto digest and setvar default tests to ntpd/complete.conf
+
+ ChangeLog@1.496.10.1 +2 -0
+ [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7.
+ CID 87 dead code in ntpq.c atoascii().
+
+
+ configure.ac@1.459.2.3 +44 -26
+ [Bug 1366] ioctl(TIOCSCTTY, 0) fails on NetBSD *[0-2].* > 3.99.7.
+
+ include/Makefile.am@1.35.2.2 +1 -0
+ new file include/ssl_applink.c
+
+ include/ntp.h@1.167 +2 -1
+ make KEY_TYPE_MD5 equivalence to NID_md5 explicit
+
+ include/ntp_request.h@1.37 +1 -1
+ req_pkt uses MAX_MD5_LEN not MAX_MAC_LEN now
+
+ include/ntp_stdlib.h@1.38 +13 -0
+ add ssl_init.c references
+
+ include/ssl_applink.c@1.1 +74 -0
+ common code for Windows OpenSSL applink (ntpd, ntpdate, ntpdc, ntpq, ntp-keygen)
+
+ include/ssl_applink.c@1.0 +0 -0
+
+ libntp/Makefile.am@1.47.1.1 +65 -13
+ add ssl_init.c
+
+ libntp/a_md5encrypt.c@1.22.1.1 +15 -6
+ ensure OpenSSL has been initialized before use
+ use u_int instead of unsigned consistently
+
+ libntp/authreadkeys.c@1.9.1.1 +3 -7
+ warning
+
+ libntp/ssl_init.c@1.1 +42 -0
+ Shared OpenSSL initialization code for libntp, ntpd, ntp-keygen
+
+ libntp/ssl_init.c@1.0 +0 -0
+
+ ntpd/complete.conf@1.3 +3 -2
+ add crypto digest test, setvar default test
+
+ ntpd/ntp_config.c@1.234 +1 -1
+ KEY_TYPE_MD5 -> NID_md5
+
+ ntpd/ntp_crypto.c@1.145 +13 -23
+ use common libntp OpenSSL initialization code
+
+ ntpd/ntp_request.c@1.80.1.3 +3 -5
+ don't compare floats for equality, use DPRINTF
+
+ ntpdate/ntpdate.c@1.69 +10 -16
+ ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows
+
+ ntpdc/ntpdc.c@1.71 +6 -11
+ ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows
+
+ ntpq/Makefile.am@1.38 +3 -0
+ add rule to build libntp.a
+
+ ntpq/ntpq.c@1.95 +77 -78
+ ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows
+
+ ports/winnt/ntpd/ntservice.c@1.22 +3 -39
+ ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows
+
+ ports/winnt/vc6/libntp.dsp@1.43.3.1 +4 -0
+ add ssl_init.c
+
+ ports/winnt/vs2003/libntp.vcproj@1.4.2.1 +4 -0
+ add ssl_init.c
+
+ ports/winnt/vs2005/libntp.vcproj@1.4.2.1 +4 -0
+ add ssl_init.c
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20.2.1 +6 -2
+ add ssl_init.c
+
+ sntp/Makefile.am@1.13.2.1 +9 -1
+ remove reference to bk rm'd netutils.h
+ add rule to build libntp.a
+ add rule to build COPYRIGHT with zero-byte version bk rm'd
+
+ util/ntp-keygen.c@1.60 +7 -23
+ Use common OpenSSL initialization from libntp
+ ntpq, ntpdc, ntpdate use OpenSSL and need applink on Windows
+
+ChangeSet@1.2060.9.18, 2009-11-07 01:15:29-05:00, stenn@whimsy.udel.edu
+ authopt.html update from Dave Mills
+
+ ChangeLog@1.496.1.28 +1 -0
+ authopt.html update from Dave Mills
+
+ html/authopt.html@1.56 +59 -29
+ authopt.html update from Dave Mills
+
+ChangeSet@1.2060.9.17, 2009-11-07 01:09:12-05:00, stenn@whimsy.udel.edu
+ Remove unused file from the sntp/Makefile.am
+
+ ChangeLog@1.496.1.27 +1 -0
+ Remove unused file from the sntp/Makefile.am
+
+ ChangeLog@1.496.1.26 +1 -0
+ new crypto signature cleanup
+
+ libntp/a_md5encrypt.c@1.23 +23 -23
+ new crypto signature cleanup
+
+ libntp/authkeys.c@1.17 +54 -13
+ new crypto signature cleanup
+
+ libntp/authreadkeys.c@1.10 +31 -22
+ new crypto signature cleanup
+
+ sntp/Makefile.am@1.13.1.2 +0 -1
+ Remove unused file from the sntp/Makefile.am
+
+ChangeSet@1.2060.9.16, 2009-11-05 04:05:18-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P240_RC
+ TAG: NTP_4_2_5P240_RC
+
+ ChangeLog@1.496.1.25 +1 -0
+ NTP_4_2_5P240_RC
+
+ ntpd/ntpd-opts.c@1.234 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpd/ntpd-opts.h@1.234 +3 -3
+ NTP_4_2_5P240_RC
+
+ ntpd/ntpd-opts.texi@1.232 +4 -4
+ NTP_4_2_5P240_RC
+
+ ntpd/ntpd.1@1.232 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpdc/ntpdc-opts.c@1.230 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpdc/ntpdc-opts.h@1.230 +3 -3
+ NTP_4_2_5P240_RC
+
+ ntpdc/ntpdc-opts.texi@1.229 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpdc/ntpdc.1@1.229 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpq/ntpq-opts.c@1.231 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpq/ntpq-opts.h@1.231 +3 -3
+ NTP_4_2_5P240_RC
+
+ ntpq/ntpq-opts.texi@1.230 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpq/ntpq.1@1.230 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.109 +2 -2
+ NTP_4_2_5P240_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.109 +3 -3
+ NTP_4_2_5P240_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.109 +1 -1
+ NTP_4_2_5P240_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.109 +2 -2
+ NTP_4_2_5P240_RC
+
+ packageinfo.sh@1.244 +1 -1
+ NTP_4_2_5P240_RC
+
+ sntp/sntp-opts.c@1.103 +2 -2
+ NTP_4_2_5P240_RC
+
+ sntp/sntp-opts.h@1.103 +3 -3
+ NTP_4_2_5P240_RC
+
+ sntp/sntp-opts.texi@1.103 +2 -2
+ NTP_4_2_5P240_RC
+
+ sntp/sntp.1@1.103 +2 -2
+ NTP_4_2_5P240_RC
+
+ util/ntp-keygen-opts.c@1.233 +2 -2
+ NTP_4_2_5P240_RC
+
+ util/ntp-keygen-opts.h@1.233 +3 -3
+ NTP_4_2_5P240_RC
+
+ util/ntp-keygen-opts.texi@1.232 +2 -2
+ NTP_4_2_5P240_RC
+
+ util/ntp-keygen.1@1.232 +2 -2
+ NTP_4_2_5P240_RC
+
+ChangeSet@1.2060.14.2, 2009-11-05 02:04:25-05:00, stenn@whimsy.udel.edu
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2)
+
+ ChangeLog@1.496.9.2 +1 -1
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2)
+
+ html/authopt.html@1.55 +20 -17
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2)
+
+ html/keygen.html@1.16 +33 -9
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2)
+
+ libntp/a_md5encrypt.c@1.20.1.1 +2 -2
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2)
+
+ libntp/authkeys.c@1.16 +1 -2
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS 140-2)
+
+ChangeSet@1.2060.9.14, 2009-11-05 01:33:53+00:00, davehart@shiny.ad.hartbrothers.com
+ remove leftover RSAREF tidbit global.h no longer used
+
+ BitKeeper/deleted/.del-global.h~3aed0663@1.5 +0 -0
+ Delete: include/global.h
+
+ include/Makefile.am@1.35.2.1 +0 -1
+ remove leftover RSAREF tidbit global.h no longer used
+
+ChangeSet@1.2060.9.13, 2009-11-05 00:24:26+00:00, davehart@shiny.ad.hartbrothers.com
+ remove testing leftover #undef OPENSSL
+ warning cleanup
+ linking with libntp now requires -lcrypto / libeay32.lib
+
+
+ include/ntp_stdlib.h@1.37 +8 -0
+ #define NID_md5 when not building with OpenSSL
+
+ libntp/a_md5encrypt.c@1.21 +22 -28
+ remove testing leftover #undef OPENSSL
+ warning cleanup
+ assert rather than crash if openssl isn't working
+
+ libntp/authreadkeys.c@1.9 +6 -6
+ remove testing leftover #undef OPENSSL
+ warning cleanup
+
+ ntpdate/Makefile.am@1.20 +1 -0
+ add -lcrypto to ntpdate_LDADD now that libntp references openssl
+
+ ntpdc/Makefile.am@1.44 +2 -1
+ linking with libntp now requires -lcrypto
+
+ ntpq/Makefile.am@1.37 +2 -1
+ linking with libntp now requires -lcrypto
+
+ ports/winnt/vc6/ntpdate.dsp@1.25 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vc6/ntpdc.dsp@1.28 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vc6/ntpq.dsp@1.29 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2003/ntpdate.vcproj@1.4 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2003/ntpdc.vcproj@1.4 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2003/ntpq.vcproj@1.4 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2005/ntpdate.vcproj@1.4 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.4 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2005/ntpq.vcproj@1.4 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.11 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.11 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.10 +2 -2
+ add reference to libeay32.lib needed by symmetric key crypto now
+
+ChangeSet@1.2060.14.1, 2009-11-04 14:53:24-05:00, stenn@whimsy.udel.edu
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ChangeLog@1.496.9.1 +1 -0
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ html/authopt.html@1.54 +32 -3
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ html/ntpq.html@1.36 +12 -4
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ include/ntp.h@1.166 +4 -4
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ include/ntp_control.h@1.38 +5 -4
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ include/ntp_crypto.h@1.46 +2 -0
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ include/ntp_request.h@1.36 +2 -2
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ include/ntp_stdlib.h@1.36 +3 -3
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ libntp/a_md5encrypt.c@1.20 +63 -21
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ libntp/authkeys.c@1.15 +13 -17
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ libntp/authreadkeys.c@1.8 +50 -38
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ libntp/authusekey.c@1.7 +1 -13
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/keyword-gen.c@1.1.1.2 +1 -0
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_config.c@1.233 +8 -18
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_control.c@1.128 +17 -7
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_crypto.c@1.144 +17 -3
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_keyword.h@1.1.1.1 +737 -732
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_parser.c@1.52 +1031 -1013
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_parser.h@1.32 +277 -275
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_parser.y@1.47 +3 -0
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ ntpd/ntp_proto.c@1.297 +13 -18
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ sntp/crypto.h@1.5.1.1 +1 -0
+ Provide all of OpenSSL's signature methods for ntp.keys (FIPS xxx)
+
+ChangeSet@1.2060.9.11, 2009-11-02 19:31:57+00:00, davehart@shiny.ad.hartbrothers.com
+ correct linuxcaps AC_MSG_RESULT() to occur after considering
+ --enable-linuxcaps
+
+ configure.ac@1.459.2.2 +1 -4
+ correct linuxcaps AC_MSG_RESULT() to occur after considering
+ --enable-linuxcaps
+
+ChangeSet@1.2060.13.1, 2009-11-02 06:08:22+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3.
+
+ ChangeLog@1.496.1.22 +1 -0
+ [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3.
+
+ configure.ac@1.459.2.1 +4 -2
+ [Bug 1364] clock_gettime() not detected, need -lrt on Debian 5.0.3.
+ bump cache version so previous results not finding clock_gettime() will
+ be tossed.
+
+ChangeSet@1.2060.9.9, 2009-10-31 06:38:39+09:00, Amidamaru@yumi.mxiesoft.com
+ .del-netutils.c~1f7e234e73bebdf5:
+ Delete: sntp/netutils.c
+ .del-COPYRIGHT~cdd0795ee52aa7b5:
+ Delete: sntp/COPYRIGHT
+ .del-netutils.h~b347f6069a2cfce1:
+ Delete: sntp/netutils.h
+ Many files:
+ Removed copyright statement
+
+ BitKeeper/deleted/.del-COPYRIGHT~cdd0795ee52aa7b5@1.3 +0 -0
+ Delete: sntp/COPYRIGHT
+
+ BitKeeper/deleted/.del-netutils.c~1f7e234e73bebdf5@1.4 +0 -0
+ Delete: sntp/netutils.c
+
+ BitKeeper/deleted/.del-netutils.h~b347f6069a2cfce1@1.3 +0 -0
+ Delete: sntp/netutils.h
+
+ sntp/crypto.c@1.10 +0 -17
+ Removed copyright statement
+
+ sntp/crypto.h@1.6 +0 -17
+ Removed copyright statement
+
+ sntp/kod_management.c@1.14 +0 -18
+ Removed copyright statement
+
+ sntp/kod_management.h@1.8 +0 -17
+ Removed copyright statement
+
+ sntp/log.c@1.10 +0 -17
+ Removed copyright statement
+
+ sntp/log.h@1.7 +0 -17
+ Removed copyright statement
+
+ sntp/networking.c@1.27 +0 -17
+ Removed copyright statement
+
+ sntp/networking.h@1.16 +0 -17
+ Removed copyright statement
+
+ sntp/utilities.c@1.10 +0 -17
+ Removed copyright statement
+
+ sntp/utilities.h@1.8 +0 -34
+ Removed copyright statement
+
+ChangeSet@1.2060.9.8, 2009-10-30 01:30:30-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P239_RC
+ TAG: NTP_4_2_5P239_RC
+
+ ChangeLog@1.496.1.21 +1 -0
+ NTP_4_2_5P239_RC
+
+ ntpd/ntpd-opts.c@1.233 +2 -2
+ NTP_4_2_5P239_RC
+
+ ntpd/ntpd-opts.h@1.233 +3 -3
+ NTP_4_2_5P239_RC
+
+ ntpd/ntpd-opts.texi@1.231 +1 -1
+ NTP_4_2_5P239_RC
+
+ ntpd/ntpd.1@1.231 +2 -2
+ NTP_4_2_5P239_RC
+
+ ntpdc/ntpdc-opts.c@1.229 +2 -2
+ NTP_4_2_5P239_RC
+
+ ntpdc/ntpdc-opts.h@1.229 +3 -3
+ NTP_4_2_5P239_RC
+
+ ntpdc/ntpdc-opts.texi@1.228 +1 -1
+ NTP_4_2_5P239_RC
+
+ ntpdc/ntpdc.1@1.228 +2 -2
+ NTP_4_2_5P239_RC
+
+ ntpq/ntpq-opts.c@1.230 +2 -2
+ NTP_4_2_5P239_RC
+
+ ntpq/ntpq-opts.h@1.230 +3 -3
+ NTP_4_2_5P239_RC
+
+ ntpq/ntpq-opts.texi@1.229 +1 -1
+ NTP_4_2_5P239_RC
+
+ ntpq/ntpq.1@1.229 +2 -2
+ NTP_4_2_5P239_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.108 +2 -2
+ NTP_4_2_5P239_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.108 +3 -3
+ NTP_4_2_5P239_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.108 +1 -1
+ NTP_4_2_5P239_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.108 +2 -2
+ NTP_4_2_5P239_RC
+
+ packageinfo.sh@1.243 +1 -1
+ NTP_4_2_5P239_RC
+
+ sntp/sntp-opts.c@1.102 +2 -2
+ NTP_4_2_5P239_RC
+
+ sntp/sntp-opts.h@1.102 +3 -3
+ NTP_4_2_5P239_RC
+
+ sntp/sntp-opts.texi@1.102 +1 -1
+ NTP_4_2_5P239_RC
+
+ sntp/sntp.1@1.102 +2 -2
+ NTP_4_2_5P239_RC
+
+ util/ntp-keygen-opts.c@1.232 +2 -2
+ NTP_4_2_5P239_RC
+
+ util/ntp-keygen-opts.h@1.232 +3 -3
+ NTP_4_2_5P239_RC
+
+ util/ntp-keygen-opts.texi@1.231 +1 -1
+ NTP_4_2_5P239_RC
+
+ util/ntp-keygen.1@1.231 +2 -2
+ NTP_4_2_5P239_RC
+
+ChangeSet@1.2060.12.1, 2009-10-29 02:55:07-05:00, stenn@whimsy.udel.edu
+ CID 101 and Bug 1359
+
+ ChangeLog@1.496.8.2 +1 -0
+ CID 101: more pointer/array cleanup
+
+ ChangeLog@1.496.8.1 +1 -0
+ CID 101: more pointer/array cleanup
+
+ ntpd/ntp_crypto.c@1.143 +2 -1
+ CID 101: more pointer/array cleanup
+
+ ntpd/ntp_loopfilter.c@1.152 +2 -1
+ CID 101: more pointer/array cleanup
+
+ChangeSet@1.2060.9.6, 2009-10-28 15:49:51-04:00, murray@pogo.udel.edu
+ ChangeLog:
+ Bug-1357: bogus assert in refclock_shm
+
+ ChangeLog@1.496.1.19 +1 -0
+ Bug-1357: bogus assert in refclock_shm
+
+ChangeSet@1.2060.9.5, 2009-10-28 13:32:36-04:00, murray@pogo.udel.edu
+ refclock_shm.c:
+ Fix for bug-1357: bogus assert in refclock_shm
+
+ ntpd/refclock_shm.c@1.19 +4 -1
+ Fix for bug-1357: bogus assert in refclock_shm
+
+ChangeSet@1.2060.10.2, 2009-10-28 09:19:39+00:00, davehart@shiny.ad.hartbrothers.com
+ networking.c:
+ 2nd half of [Bug 1158] in recv_bcast_data()
+
+ sntp/networking.c@1.26 +1 -1
+ 2nd half of [Bug 1158] in recv_bcast_data()
+
+ChangeSet@1.2060.11.1, 2009-10-28 03:47:47-05:00, stenn@whimsy.udel.edu
+ CID 101: pointer/array cleanup
+
+ ChangeLog@1.496.7.1 +1 -0
+ CID 101: pointer/array cleanup
+
+ ntpd/ntp_crypto.c@1.142 +10 -10
+ CID 101: pointer/array cleanup
+
+ChangeSet@1.2060.10.1, 2009-10-28 07:35:54+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared.
+
+ ChangeLog@1.496.6.1 +1 -0
+ [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared.
+
+ include/ntp_rfc2553.h@1.33 +17 -2
+ conditionalize definition of AI_ flags on AI_PASSIVE instead of
+ AI_NUMERICHOST, as the latter isn't defined on AIX 4.3 while
+ AI_PASSIVE is.
+ provide a 0 definition for AI_NUMERICHOST for those platforms
+ that don't have that flag.
+
+ ntpd/ntp_io.c@1.306.2.1 +0 -14
+ move INCLUDE_IPV6_SUPPORT and INCLUDE_IPV6_MULTICAST_SUPPORT
+ definitions to ntp_rfc2553.h to share with sntp
+
+ sntp/networking.c@1.25 +8 -3
+ Compile on systems such as AIX 4.3 with IPv6 but without IPv6 multicast
+ support via setsockopt(),
+ [Bug 1358] AIX 4.3 sntp/networking.c IPV6_JOIN_GROUP undeclared.
+
+ sntp/networking.h@1.15 +1 -0
+ pick up INCLUDE_IPV6_MULTICAST_SUPPORT from ntp_rfc2553.h
+
+ChangeSet@1.2060.9.1, 2009-10-28 03:42:47+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU.
+
+ ChangeLog@1.496.1.16 +1 -0
+ [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU.
+
+ ntpd/refclock_nmea.c@1.46 +17 -8
+ [Bug 1356] core dump from refclock_nmea when can't open /dev/gpsU.
+
+ChangeSet@1.2060.3.18, 2009-10-27 21:53:59+00:00, davehart@shiny.ad.hartbrothers.com
+ stub out isc/mem.c using NTP-local /include/isc/mem.h (leaving
+ /lib/isc/include/isc/mem.h untouched).
+
+ configure.ac@1.459.1.6 +1 -0
+ add reference to include/isc/Makefile
+
+ include/Makefile.am@1.35.1.2 +3 -2
+ add reference to include/isc/Makefile.am
+
+ include/isc/Makefile.am@1.1 +7 -0
+ Override isc/mem.h for NTP to stub it out and save ~50KB
+
+ include/isc/Makefile.am@1.0 +0 -0
+
+ include/isc/mem.h@1.1 +54 -0
+ Override isc/mem.h for NTP to stub it out and save ~50KB
+
+ include/isc/mem.h@1.0 +0 -0
+
+ libntp/Makefile.am@1.48 +0 -1
+ mem.c is stubbed out
+
+ libntp/emalloc.c@1.10 +3 -2
+ implement GNU malloc behavior in emalloc() and erealloc(), libisc mem.h
+ stubs depend on it (could be implemented in mem.h, but other code may
+ grow a dependency being tested only on GNU malloc, so play it safe.)
+
+ ntpd/ntp_io.c@1.306.1.2 +1 -37
+ remove ntp_memalloc(), ntp_memfree(), pass dummy non-null mctx
+ to to libisc interface iterator.
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.4 +0 -4
+ lib/isc/mem.c is no longer compiled
+
+ ports/winnt/vs2003/libntp.vcproj@1.4.1.2 +1 -4
+ remove change mem.h reference to NTP override copy in include/isc
+ lib/isc/mem.c is no longer compiled.
+
+ ports/winnt/vs2005/libntp.vcproj@1.4.1.2 +1 -5
+ remove change mem.h reference to NTP override copy in include/isc
+ lib/isc/mem.c is no longer compiled.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20.1.3 +1 -5
+ remove change mem.h reference to NTP override copy in include/isc
+ lib/isc/mem.c is no longer compiled.
+
+ util/ntptime.c@1.21 +1 -0
+ add "int debug;" global for libntp consumption
+
+ChangeSet@1.2060.3.17, 2009-10-27 05:47:37-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P238_RC
+ TAG: NTP_4_2_5P238_RC
+
+ ChangeLog@1.496.1.15 +1 -0
+ NTP_4_2_5P238_RC
+
+ ntpd/ntpd-opts.c@1.232 +2 -2
+ NTP_4_2_5P238_RC
+
+ ntpd/ntpd-opts.h@1.232 +3 -3
+ NTP_4_2_5P238_RC
+
+ ntpd/ntpd-opts.texi@1.230 +1 -1
+ NTP_4_2_5P238_RC
+
+ ntpd/ntpd.1@1.230 +2 -2
+ NTP_4_2_5P238_RC
+
+ ntpdc/ntpdc-opts.c@1.228 +2 -2
+ NTP_4_2_5P238_RC
+
+ ntpdc/ntpdc-opts.h@1.228 +3 -3
+ NTP_4_2_5P238_RC
+
+ ntpdc/ntpdc-opts.texi@1.227 +1 -1
+ NTP_4_2_5P238_RC
+
+ ntpdc/ntpdc.1@1.227 +2 -2
+ NTP_4_2_5P238_RC
+
+ ntpq/ntpq-opts.c@1.229 +2 -2
+ NTP_4_2_5P238_RC
+
+ ntpq/ntpq-opts.h@1.229 +3 -3
+ NTP_4_2_5P238_RC
+
+ ntpq/ntpq-opts.texi@1.228 +1 -1
+ NTP_4_2_5P238_RC
+
+ ntpq/ntpq.1@1.228 +2 -2
+ NTP_4_2_5P238_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.107 +2 -2
+ NTP_4_2_5P238_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.107 +3 -3
+ NTP_4_2_5P238_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.107 +1 -1
+ NTP_4_2_5P238_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.107 +2 -2
+ NTP_4_2_5P238_RC
+
+ packageinfo.sh@1.242 +1 -1
+ NTP_4_2_5P238_RC
+
+ sntp/sntp-opts.c@1.101 +2 -2
+ NTP_4_2_5P238_RC
+
+ sntp/sntp-opts.h@1.101 +3 -3
+ NTP_4_2_5P238_RC
+
+ sntp/sntp-opts.texi@1.101 +1 -1
+ NTP_4_2_5P238_RC
+
+ sntp/sntp.1@1.101 +2 -2
+ NTP_4_2_5P238_RC
+
+ util/ntp-keygen-opts.c@1.231 +2 -2
+ NTP_4_2_5P238_RC
+
+ util/ntp-keygen-opts.h@1.231 +3 -3
+ NTP_4_2_5P238_RC
+
+ util/ntp-keygen-opts.texi@1.230 +1 -1
+ NTP_4_2_5P238_RC
+
+ util/ntp-keygen.1@1.230 +2 -2
+ NTP_4_2_5P238_RC
+
+ChangeSet@1.2060.8.3, 2009-10-26 22:25:38-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ChangeLog@1.496.5.3 +1 -0
+ Changes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.91 +1 -1
+ Changes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.73 +0 -1
+ Changes from Dave Mills
+
+ChangeSet@1.2060.8.2, 2009-10-26 22:20:49-05:00, stenn@whimsy.udel.edu
+ driver4.html updates from Dave Mills
+
+ ChangeLog@1.496.5.2 +1 -0
+ driver4.html updates from Dave Mills
+
+ html/drivers/driver4.html@1.15 +2 -2
+ driver4.html updates from Dave Mills
+
+ChangeSet@1.2060.8.1, 2009-10-26 22:16:02-05:00, stenn@whimsy.udel.edu
+ PPSAPI Cleanup of ntpd/refclock_wwvb.c
+
+ ChangeLog@1.496.5.1 +1 -0
+ PPSAPI Cleanup of ntpd/refclock_wwvb.c
+
+ ntpd/refclock_wwvb.c@1.22 +73 -23
+ PPSAPI Cleanup of ntpd/refclock_wwvb.c
+
+ChangeSet@1.2060.3.15, 2009-10-27 00:16:02+00:00, davehart@shiny.ad.hartbrothers.com
+ Get rid of configure tests for __ss_family and __ss_len when the more
+ common ss_family and ss_len are present.
+
+ ChangeLog@1.496.1.13 +2 -0
+ Get rid of configure tests for __ss_family and __ss_len when the more
+ common ss_family and ss_len are present.
+
+ configure.ac@1.459.1.5 +175 -107
+ Get rid of configure tests for __ss_family and __ss_len when the more
+ common ss_family and ss_len are present.
+
+ sntp/configure.ac@1.24 +141 -46
+ Get rid of configure tests for __ss_family and __ss_len when the more
+ common ss_family and ss_len are present.
+
+ChangeSet@1.2060.3.14, 2009-10-26 20:49:30+00:00, davehart@shiny.ad.hartbrothers.com
+ CIDs 94-99 make it more clearly impossible for sock_hash() to return
+ a negative number.
+ CID 105, 106 ensure ntpdc arrays are not overrun even if callers
+ misbehave.
+ CID 113 use va_end() in refclock_true.c true_debug().
+
+ ChangeLog@1.496.1.12 +5 -0
+ CIDs 94-99 make it more clearly impossible for sock_hash() to return
+ a negative number.
+ CID 105, 106 ensure ntpdc arrays are not overrun even if callers
+ misbehave.
+ CID 113 use va_end() in refclock_true.c true_debug().
+
+ include/ntpd.h@1.135 +1 -1
+ CIDs 94-99 -- make it more clearly impossible for sock_hash to
+ return a negative number
+
+ libntp/ntp_rfc2553.c@1.41 +2 -0
+ protect sys/socket.h inclusion with #ifdef HAVE_SYS_SOCKET_H
+
+ ntpd/ntp_monitor.c@1.25 +6 -6
+ CIDs 94-99 -- make it more clearly impossible for sock_hash to
+ return a negative number
+
+ ntpd/ntp_peer.c@1.123 +9 -9
+ CIDs 94-99 -- make it more clearly impossible for sock_hash to
+ return a negative number
+
+ ntpd/ntp_util.c@1.75 +15 -18
+ CIDs 94-99 -- make it more clearly impossible for sock_hash to
+ return a negative number
+
+ ntpd/refclock_true.c@1.11 +1 -0
+ CID 113 use va_end()
+
+ ntpdc/ntpdc_ops.c@1.61 +23 -14
+ CID 105, 106 -- ensure array are not overrun even if callers
+ misbehave
+
+ChangeSet@1.2060.3.12, 2009-10-26 05:45:09-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P237_RC
+ TAG: NTP_4_2_5P237_RC
+
+ ChangeLog@1.496.1.10 +1 -0
+ NTP_4_2_5P237_RC
+
+ ntpd/ntpd-opts.c@1.231 +2 -2
+ NTP_4_2_5P237_RC
+
+ ntpd/ntpd-opts.h@1.231 +3 -3
+ NTP_4_2_5P237_RC
+
+ ntpd/ntpd-opts.texi@1.229 +1 -1
+ NTP_4_2_5P237_RC
+
+ ntpd/ntpd.1@1.229 +2 -2
+ NTP_4_2_5P237_RC
+
+ ntpdc/ntpdc-opts.c@1.227 +2 -2
+ NTP_4_2_5P237_RC
+
+ ntpdc/ntpdc-opts.h@1.227 +3 -3
+ NTP_4_2_5P237_RC
+
+ ntpdc/ntpdc-opts.texi@1.226 +1 -1
+ NTP_4_2_5P237_RC
+
+ ntpdc/ntpdc.1@1.226 +2 -2
+ NTP_4_2_5P237_RC
+
+ ntpq/ntpq-opts.c@1.228 +2 -2
+ NTP_4_2_5P237_RC
+
+ ntpq/ntpq-opts.h@1.228 +3 -3
+ NTP_4_2_5P237_RC
+
+ ntpq/ntpq-opts.texi@1.227 +1 -1
+ NTP_4_2_5P237_RC
+
+ ntpq/ntpq.1@1.227 +2 -2
+ NTP_4_2_5P237_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.106 +2 -2
+ NTP_4_2_5P237_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.106 +3 -3
+ NTP_4_2_5P237_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.106 +1 -1
+ NTP_4_2_5P237_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.106 +2 -2
+ NTP_4_2_5P237_RC
+
+ packageinfo.sh@1.241 +1 -1
+ NTP_4_2_5P237_RC
+
+ sntp/sntp-opts.c@1.100 +2 -2
+ NTP_4_2_5P237_RC
+
+ sntp/sntp-opts.h@1.100 +3 -3
+ NTP_4_2_5P237_RC
+
+ sntp/sntp-opts.texi@1.100 +1 -1
+ NTP_4_2_5P237_RC
+
+ sntp/sntp.1@1.100 +2 -2
+ NTP_4_2_5P237_RC
+
+ util/ntp-keygen-opts.c@1.230 +2 -2
+ NTP_4_2_5P237_RC
+
+ util/ntp-keygen-opts.h@1.230 +3 -3
+ NTP_4_2_5P237_RC
+
+ util/ntp-keygen-opts.texi@1.229 +1 -1
+ NTP_4_2_5P237_RC
+
+ util/ntp-keygen.1@1.229 +2 -2
+ NTP_4_2_5P237_RC
+
+ChangeSet@1.2060.7.1, 2009-10-25 11:25:16+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1355] ntp-dev won't compile on OpenBSD 4.6.
+
+ BitKeeper/deleted/.del-in.h~29080509@1.4 +0 -0
+ Rename: ports/winnt/include/netinet/in.h -> BitKeeper/deleted/.del-in.h~29080509
+
+ BitKeeper/deleted/.del-in_system.h~c86910dc@1.3 +0 -0
+ Rename: ports/winnt/include/netinet/in_system.h -> BitKeeper/deleted/.del-in_system.h~c86910dc
+
+ BitKeeper/deleted/.del-ip.h~eb192092@1.3 +0 -0
+ Rename: ports/winnt/include/netinet/ip.h -> BitKeeper/deleted/.del-ip.h~eb192092
+
+ BitKeeper/deleted/.del-socket.h~29080509@1.4 +0 -0
+ Rename: ports/winnt/include/sys/socket.h -> BitKeeper/deleted/.del-socket.h~29080509
+
+ ChangeLog@1.496.4.1 +1 -0
+ [Bug 1355] ntp-dev won't compile on OpenBSD 4.6.
+
+ include/Makefile.am@1.35.1.1 +1 -0
+ move lib_strbuf.h from libntp to include
+
+ include/l_stdlib.h@1.17 +1 -4
+ require sys/types.h
+
+ include/lib_strbuf.h@1.6 +0 -0
+ Rename: libntp/lib_strbuf.h -> include/lib_strbuf.h
+
+ include/ntp_io.h@1.13 +1 -3
+ require sys/types.h
+
+ include/ntp_net.h@1.3 +4 -0
+ protect sys/socket.h, netinet/in.h inclusion with config.h macros
+
+ include/ntp_stdlib.h@1.35 +2 -0
+ protect sys/socket.h inclusion with #ifdef HAVE_SYS_SOCKET_H
+
+ include/ntp_types.h@1.14 +4 -5
+ stay out of system/compiler underscore namespace
+
+ include/ntpsim.h@1.12 +8 -7
+ protect sys/socket.h inclusion with #ifdef HAVE_SYS_SOCKET_H
+
+ libntp/Makefile.am@1.47 +0 -2
+ move lib_strbuf.h from libntp to include
+
+ libntp/decodenetnum.c@1.10 +5 -0
+ include config.h
+ protect sys/socket.h, netinet/in.h inclusion with config.h macros
+
+ libntp/inttoa.c@1.3 +3 -2
+ include config.h
+ use snprintf() in favor of sprintf()
+
+ libntp/msyslog.c@1.24 +1 -3
+ require sys/types.h
+
+ libntp/ntp_random.c@1.7 +1 -3
+ require sys/types.h
+
+ libntp/numtoa.c@1.5 +2 -3
+ [Bug 1355] ntp-dev won't compile on OpenBSD 4.6.
+ protect netinet/in.h inclusion with HAVE_NETINET_IN_H
+
+ libntp/numtohost.c@1.5 +2 -4
+ [Bug 1355] ntp-dev won't compile on OpenBSD 4.6.
+ protect netinet/in.h inclusion with HAVE_NETINET_IN_H
+
+ libntp/socktoa.c@1.11 +4 -0
+ protect sys/socket.h, netinet/in.h inclusion with config.h macros
+
+ libntp/socktohost.c@1.7 +4 -0
+ protect sys/socket.h, netinet/in.h inclusion with config.h macros
+
+ ntpd/keyword-gen.c@1.1.1.1 +1 -1
+ [Bug 1355] ntp-dev won't compile on OpenBSD 4.6.
+
+ ntpd/ntp_control.c@1.127 +2 -0
+ protect netinet/in.h inclusion with HAVE_NETINET_IN_H
+
+ ntpd/ntp_intres.c@1.66 +2 -0
+ protect netinet/in.h inclusion with HAVE_NETINET_IN_H
+
+ ntpd/ntp_request.c@1.80.1.2 +2 -0
+ protect netinet/in.h inclusion with HAVE_NETINET_IN_H
+
+ ntpdc/ntpdc_ops.c@1.60 +9 -4
+ protect netinet/in.h inclusion with #ifdef HAVE_NETINET_IN_H.
+ stay within array bounds in clockstat() even if calling code
+ misbehaves.
+
+
+ ports/winnt/vc6/libntp.dsp@1.43.2.1 +1 -1
+ move lib_strbuf.h from libntp to include
+
+ ports/winnt/vs2003/libntp.vcproj@1.4.1.1 +1 -1
+ move lib_strbuf.h from libntp to include
+
+ ports/winnt/vs2005/libntp.vcproj@1.4.1.1 +1 -1
+ move lib_strbuf.h from libntp to include
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20.1.2 +1 -1
+ move lib_strbuf.h from libntp to include
+
+ util/ntp-keygen.c@1.59 +1 -9
+ require sys/types.h
+ remove old #ifdef SYS_WINNT related to ntp_getopt, ntp-keygen uses libopts
+
+ChangeSet@1.2060.6.1, 2009-10-25 03:06:29+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1354] libtool error building after bootstrap with Autoconf 2.64.
+ Allow NTP_VPATH_HACK configure test to handle newer gmake versions.
+
+ BitKeeper/deleted/.del-ltmain.sh~1dcd783dfc596fc7@1.3 +0 -0
+ Rename: sntp/ltmain.sh -> BitKeeper/deleted/.del-ltmain.sh~1dcd783dfc596fc7
+
+ BitKeeper/deleted/.del-ltmain.sh~2b9d9fc0af8c0735@1.2 +0 -0
+ Rename: ltmain.sh -> BitKeeper/deleted/.del-ltmain.sh~2b9d9fc0af8c0735
+
+ ChangeLog@1.496.3.1 +2 -0
+ [Bug 1354] libtool error building after bootstrap with Autoconf 2.64.
+ Allow NTP_VPATH_HACK configure test to handle newer gmake versions.
+
+ Makefile.am@1.86.1.1 +11 -3
+ add rule to rebuild libtool if needed.
+ no need to use unix2dos on *.ds* after bk admin -fEOLN_WINDOWS
+
+ configure.ac@1.459.1.4 +3 -1
+ use AC_CONFIG_MACRO_DIR() to keep m4 files in m4
+
+ m4/ntp_vpathhack.m4@1.2 +23 -17
+ NTP_VPATH_HACK was misfiring on FreeBSD with recent GNU Make due to
+ a change from "GNU Make version" to "GNU Make" as the gmake -v output.
+ Also do not cache the result, running make -v and grep is worth it to
+ allow changing make without flushing the cache.
+
+ ports/winnt/vc6/Instsrv.dsp@1.11 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/Instsrv.dsp@1.10 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.2 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/libntp.dsp@1.43.1.1 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ ports/winnt/vc6/ntp.dsw@1.11 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/ntp.dsw@1.10 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ ports/winnt/vc6/ntpd.dsp@1.39.1.2 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/ntpd.dsp@1.39.1.1 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ ports/winnt/vc6/ntpdate.dsp@1.24 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/ntpdate.dsp@1.23 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ ports/winnt/vc6/ntpdc.dsp@1.27 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/ntpdc.dsp@1.26 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.20 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.19 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ ports/winnt/vc6/ntpq.dsp@1.28 +0 -0
+ Turn on EOLN_WINDOWS flag
+
+ ports/winnt/vc6/ntpq.dsp@1.27 +0 -0
+ Turn off EOLN_NATIVE flag
+
+ scripts/genCommitLog@1.5 +9 -0
+ crude workaround for read-only srcdir seen in make distcheck
+
+ sntp/Makefile.am@1.13.1.1 +13 -2
+ add rule to rebuild libtool if needed
+
+ sntp/configure.ac@1.23 +2 -0
+ use AC_CONFIG_MACRO_DIR() to keep m4 files in m4
+
+ChangeSet@1.2060.3.10, 2009-10-24 05:55:49+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 610] NMEA support for using PPSAPI on a different device.
+ [Bug 1238] use only fudge time2 to offset NMEA serial timestamp.
+
+ ChangeLog@1.496.1.8 +2 -0
+ [Bug 610] NMEA support for using PPSAPI on a different device.
+ [Bug 1238] use only fudge time2 to offset NMEA serial timestamp.
+
+ include/ntp_refclock.h@1.24 +2 -1
+ [Bug 1238] use only fudge time2 to offset NMEA serial timestamp.
+
+ ntpd/ntp_refclock.c@1.90 +15 -5
+ [Bug 1238] use only fudge time2 to offset NMEA serial timestamp.
+
+ ntpd/refclock_nmea.c@1.45 +45 -13
+ [Bug 610] NMEA support for using PPSAPI on a different device.
+ [Bug 1238] use only fudge time2 to offset NMEA serial timestamp.
+
+ChangeSet@1.2060.5.1, 2009-10-23 16:57:07+00:00, davehart@shiny.ad.hartbrothers.com
+ shrink 750 keyword scanner states from 64 to 32 bits apiece
+
+ ntpd/keyword-gen.c@1.2 +133 -18
+ shrink 750 keyword scanner states from 64 to 32 bits apiece
+
+ ntpd/ntp_keyword.h@1.2 +741 -741
+ shrink 750 keyword scanner states from 64 to 32 bits apiece
+
+ ntpd/ntp_scanner.c@1.31 +20 -16
+ shrink 750 keyword scanner states from 64 to 32 bits apiece
+
+ ntpd/ntp_scanner.h@1.14 +37 -10
+ shrink 750 keyword scanner states from 64 to 32 bits apiece
+
+ChangeSet@1.2060.3.9, 2009-10-22 06:47:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P236_RC
+ TAG: NTP_4_2_5P236_RC
+
+ ChangeLog@1.496.1.7 +1 -0
+ NTP_4_2_5P236_RC
+
+ ntpd/ntpd-opts.c@1.230 +2 -2
+ NTP_4_2_5P236_RC
+
+ ntpd/ntpd-opts.h@1.230 +3 -3
+ NTP_4_2_5P236_RC
+
+ ntpd/ntpd-opts.texi@1.228 +1 -1
+ NTP_4_2_5P236_RC
+
+ ntpd/ntpd.1@1.228 +2 -2
+ NTP_4_2_5P236_RC
+
+ ntpdc/ntpdc-opts.c@1.226 +2 -2
+ NTP_4_2_5P236_RC
+
+ ntpdc/ntpdc-opts.h@1.226 +3 -3
+ NTP_4_2_5P236_RC
+
+ ntpdc/ntpdc-opts.texi@1.225 +1 -1
+ NTP_4_2_5P236_RC
+
+ ntpdc/ntpdc.1@1.225 +2 -2
+ NTP_4_2_5P236_RC
+
+ ntpq/ntpq-opts.c@1.227 +2 -2
+ NTP_4_2_5P236_RC
+
+ ntpq/ntpq-opts.h@1.227 +3 -3
+ NTP_4_2_5P236_RC
+
+ ntpq/ntpq-opts.texi@1.226 +1 -1
+ NTP_4_2_5P236_RC
+
+ ntpq/ntpq.1@1.226 +2 -2
+ NTP_4_2_5P236_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.105 +2 -2
+ NTP_4_2_5P236_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.105 +3 -3
+ NTP_4_2_5P236_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.105 +1 -1
+ NTP_4_2_5P236_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.105 +2 -2
+ NTP_4_2_5P236_RC
+
+ packageinfo.sh@1.240 +1 -1
+ NTP_4_2_5P236_RC
+
+ sntp/sntp-opts.c@1.99 +2 -2
+ NTP_4_2_5P236_RC
+
+ sntp/sntp-opts.h@1.99 +3 -3
+ NTP_4_2_5P236_RC
+
+ sntp/sntp-opts.texi@1.99 +1 -1
+ NTP_4_2_5P236_RC
+
+ sntp/sntp.1@1.99 +2 -2
+ NTP_4_2_5P236_RC
+
+ util/ntp-keygen-opts.c@1.229 +2 -2
+ NTP_4_2_5P236_RC
+
+ util/ntp-keygen-opts.h@1.229 +3 -3
+ NTP_4_2_5P236_RC
+
+ util/ntp-keygen-opts.texi@1.228 +1 -1
+ NTP_4_2_5P236_RC
+
+ util/ntp-keygen.1@1.228 +2 -2
+ NTP_4_2_5P236_RC
+
+ChangeSet@1.2060.3.8, 2009-10-22 05:02:37-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ ChangeLog@1.496.1.6 +1 -0
+ Cleanup from Dave Mills
+
+ html/authopt.html@1.53 +42 -9
+ Cleanup from Dave Mills
+
+ html/ntpq.html@1.35 +10 -9
+ Cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.151 +4 -5
+ Cleanup from Dave Mills
+
+ChangeSet@1.2060.4.1, 2009-10-21 21:59:17+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+
+ ChangeLog@1.496.2.1 +1 -0
+ [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+
+ include/ntp_stdlib.h@1.34 +7 -1
+ [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+
+ libntp/machines.c@1.21 +49 -16
+ [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+
+ ntpd/ntp_config.c@1.232 +25 -4
+ [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+
+ ports/winnt/libntp/SetSystemTime.c@1.7 +1 -1
+ [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.37 +6 -0
+ [Bug 1353] ntpq "rv 0 settimeofday" always shows UNKNOWN on unix.
+
+ChangeSet@1.2060.3.6, 2009-10-21 15:38:30+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ AC_FUNC_MALLOC is unneeded, breaks cross-compile with uClibc with
+ undefined references to rpl_malloc
+
+ sntp/configure.ac@1.22 +0 -1
+ AC_FUNC_MALLOC is unneeded, breaks cross-compile with uClibc with
+ undefined references to rpl_malloc
+
+ChangeSet@1.2060.3.5, 2009-10-21 04:27:03+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ correct sa_len test butchered recently
+
+ configure.ac@1.459.1.3 +20 -2
+ correct sa_len test butchered recently
+
+ChangeSet@1.2060.3.4, 2009-10-20 17:47:04+00:00, davehart@shiny.ad.hartbrothers.com
+ Do not attempt to execute built binaries from ntpd/Makefile when
+ cross-compiling (keyword-gen and ntpd --saveconfigquit).
+ sntp/main.c: Remove duplicate global adr_buf[] (also defined in
+ networking.c) which Piotr Grudzinski identified breaking his build.
+ Correct in6addr_any test in configure.ac to attempt link too.
+
+ ChangeLog@1.496.1.4 +5 -0
+ Do not attempt to execute built binaries from ntpd/Makefile when
+ cross-compiling (keyword-gen and ntpd --saveconfigquit).
+ sntp/main.c: Remove duplicate global adr_buf[] (also defined in
+ networking.c) which Piotr Grudzinski identified breaking his build.
+ Correct in6addr_any test in configure.ac to attempt link too.
+
+ configure.ac@1.459.1.2 +8 -6
+ Correct in6addr_any test in configure.ac to attempt link too.
+ Introduce NTP_CROSSCOMPILE automake conditional
+
+ ntpd/Makefile.am@1.76 +17 -3
+ Use NTP_CROSSCOMPILE automake conditional to avoid attempting to execute
+ built binaries when cross-compiling (keyword-gen and ntpd --saveconfigquit)
+
+ sntp/configure.ac@1.21 +6 -5
+ Correct in6addr_any test in configure.ac to attempt link too.
+
+ sntp/main.c@1.20 +9 -9
+ sntp/main.c: Remove duplicate global adr_buf[] (also defined in
+ networking.c) which Piotr Grudzinski identified breaking his build.
+
+ChangeSet@1.2060.3.3, 2009-10-19 17:23:04+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1343] ntpd/ntp_io.c close_fd() does not compile on Solaris 7.
+ Also includes similar fix to sntp/crypto.c identified on same machine.
+
+ ChangeLog@1.496.1.3 +1 -0
+ [Bug 1343] ntpd/ntp_io.c close_fd() does not compile on Solaris 7.
+ Also includes similar fix to sntp/crypto.c identified on same machine.
+
+ ntpd/ntp_io.c@1.306.1.1 +4 -2
+ move code after local variable declaration in move_fd() to cure
+ compiling with compilers that know the difference between C and C++
+
+ sntp/crypto.c@1.9 +44 -43
+ move digest_data variable declaration ahead of code in auth_md5() for
+ compatibility with ANSI C.
+
+ChangeSet@1.2060.3.2, 2009-10-18 06:46:43-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P235_RC
+ TAG: NTP_4_2_5P235_RC
+
+ ChangeLog@1.496.1.2 +1 -0
+ NTP_4_2_5P235_RC
+
+ ntpd/ntpd-opts.c@1.229 +2 -2
+ NTP_4_2_5P235_RC
+
+ ntpd/ntpd-opts.h@1.229 +3 -3
+ NTP_4_2_5P235_RC
+
+ ntpd/ntpd-opts.texi@1.227 +1 -1
+ NTP_4_2_5P235_RC
+
+ ntpd/ntpd.1@1.227 +2 -2
+ NTP_4_2_5P235_RC
+
+ ntpdc/ntpdc-opts.c@1.225 +2 -2
+ NTP_4_2_5P235_RC
+
+ ntpdc/ntpdc-opts.h@1.225 +3 -3
+ NTP_4_2_5P235_RC
+
+ ntpdc/ntpdc-opts.texi@1.224 +1 -1
+ NTP_4_2_5P235_RC
+
+ ntpdc/ntpdc.1@1.224 +2 -2
+ NTP_4_2_5P235_RC
+
+ ntpq/ntpq-opts.c@1.226 +2 -2
+ NTP_4_2_5P235_RC
+
+ ntpq/ntpq-opts.h@1.226 +3 -3
+ NTP_4_2_5P235_RC
+
+ ntpq/ntpq-opts.texi@1.225 +1 -1
+ NTP_4_2_5P235_RC
+
+ ntpq/ntpq.1@1.225 +2 -2
+ NTP_4_2_5P235_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.104 +2 -2
+ NTP_4_2_5P235_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.104 +3 -3
+ NTP_4_2_5P235_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.104 +1 -1
+ NTP_4_2_5P235_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.104 +2 -2
+ NTP_4_2_5P235_RC
+
+ packageinfo.sh@1.239 +1 -1
+ NTP_4_2_5P235_RC
+
+ sntp/sntp-opts.c@1.98 +2 -2
+ NTP_4_2_5P235_RC
+
+ sntp/sntp-opts.h@1.98 +3 -3
+ NTP_4_2_5P235_RC
+
+ sntp/sntp-opts.texi@1.98 +1 -1
+ NTP_4_2_5P235_RC
+
+ sntp/sntp.1@1.98 +2 -2
+ NTP_4_2_5P235_RC
+
+ util/ntp-keygen-opts.c@1.228 +2 -2
+ NTP_4_2_5P235_RC
+
+ util/ntp-keygen-opts.h@1.228 +3 -3
+ NTP_4_2_5P235_RC
+
+ util/ntp-keygen-opts.texi@1.227 +1 -1
+ NTP_4_2_5P235_RC
+
+ util/ntp-keygen.1@1.227 +2 -2
+ NTP_4_2_5P235_RC
+
+ChangeSet@1.2060.3.1, 2009-10-18 01:54:01+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ ChangeLog@1.496.1.1 +1 -0
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ configure.ac@1.459.1.1 +22 -23
+ remove one of two sockaddr sa_len tests.
+ convert in_port_t tested to cached.
+
+ include/ntp_rfc2553.h@1.32 +4 -87
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ lib/isc/unix/include/isc/net.h@1.11 +1 -1
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ lib/isc/unix/net.c@1.14 +4 -3
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ lib/isc/win32/include/isc/ipv6.h@1.9 +2 -2
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ lib/isc/win32/include/isc/net.h@1.9 +2 -2
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ lib/isc/win32/net.c@1.13 +5 -0
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ libntp/ntp_rfc2553.c@1.40 +2 -2
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ ntpd/ntp_request.c@1.80.1.1 +10 -10
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ ntpdc/ntpdc_ops.c@1.59 +2 -2
+ [Bug 1343] lib/isc build breaks on systems without IPv6 headers.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20.1.1 +3 -3
+ correct isc/net.h path
+
+ sntp/configure.ac@1.20 +56 -21
+ libisc on systems without in_port_t wasn't compiling.
+ cache in_port_t test.
+
+ChangeSet@1.2060.1.5, 2009-10-16 21:00:05+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1348] ntpd Windows port should wait for sendto() completion.
+
+ BitKeeper/deleted/.del-transmitbuff.c~29080509@1.10 +0 -0
+ Delete: ports/winnt/libntp/transmitbuff.c
+
+ BitKeeper/deleted/.del-transmitbuff.h~29080509@1.9 +0 -0
+ Delete: ports/winnt/include/transmitbuff.h
+
+ ChangeLog@1.497 +1 -0
+ [Bug 1348] ntpd Windows port should wait for sendto() completion.
+
+ ntpd/ntp_io.c@1.307 +4 -5
+ [Bug 1348] ntpd Windows port should wait for sendto() completion.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.50 +65 -162
+ [Bug 1348] ntpd Windows port should wait for sendto() completion.
+
+ ports/winnt/vc6/libntp.dsp@1.44 +0 -8
+ remove references to transmitbuff.[ch]
+
+ ports/winnt/vc6/ntpd.dsp@1.40 +0 -4
+ remove references to transmitbuff.[ch]
+
+ ports/winnt/vs2003/libntp.vcproj@1.5 +0 -24
+ remove references to transmitbuff.[ch]
+
+ ports/winnt/vs2003/ntpd.vcproj@1.5 +0 -3
+ remove references to transmitbuff.[ch]
+
+ ports/winnt/vs2005/libntp.vcproj@1.5 +0 -26
+ remove references to transmitbuff.[ch]
+
+ ports/winnt/vs2005/ntpd.vcproj@1.5 +0 -4
+ remove references to transmitbuff.[ch]
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.21 +1 -9
+ remove references to transmitbuff.[ch]
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.22 +0 -4
+ remove references to transmitbuff.[ch]
+
+ChangeSet@1.2060.1.4, 2009-10-16 06:48:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P234_RC
+ TAG: NTP_4_2_5P234_RC
+
+ ChangeLog@1.496 +1 -0
+ NTP_4_2_5P234_RC
+
+ ntpd/ntpd-opts.c@1.228 +2 -2
+ NTP_4_2_5P234_RC
+
+ ntpd/ntpd-opts.h@1.228 +3 -3
+ NTP_4_2_5P234_RC
+
+ ntpd/ntpd-opts.texi@1.226 +1 -1
+ NTP_4_2_5P234_RC
+
+ ntpd/ntpd.1@1.226 +2 -2
+ NTP_4_2_5P234_RC
+
+ ntpdc/ntpdc-opts.c@1.224 +2 -2
+ NTP_4_2_5P234_RC
+
+ ntpdc/ntpdc-opts.h@1.224 +3 -3
+ NTP_4_2_5P234_RC
+
+ ntpdc/ntpdc-opts.texi@1.223 +1 -1
+ NTP_4_2_5P234_RC
+
+ ntpdc/ntpdc.1@1.223 +2 -2
+ NTP_4_2_5P234_RC
+
+ ntpq/ntpq-opts.c@1.225 +2 -2
+ NTP_4_2_5P234_RC
+
+ ntpq/ntpq-opts.h@1.225 +3 -3
+ NTP_4_2_5P234_RC
+
+ ntpq/ntpq-opts.texi@1.224 +1 -1
+ NTP_4_2_5P234_RC
+
+ ntpq/ntpq.1@1.224 +2 -2
+ NTP_4_2_5P234_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.103 +2 -2
+ NTP_4_2_5P234_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.103 +3 -3
+ NTP_4_2_5P234_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.103 +1 -1
+ NTP_4_2_5P234_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.103 +2 -2
+ NTP_4_2_5P234_RC
+
+ packageinfo.sh@1.238 +1 -1
+ NTP_4_2_5P234_RC
+
+ sntp/sntp-opts.c@1.97 +2 -2
+ NTP_4_2_5P234_RC
+
+ sntp/sntp-opts.h@1.97 +3 -3
+ NTP_4_2_5P234_RC
+
+ sntp/sntp-opts.texi@1.97 +1 -1
+ NTP_4_2_5P234_RC
+
+ sntp/sntp.1@1.97 +2 -2
+ NTP_4_2_5P234_RC
+
+ util/ntp-keygen-opts.c@1.227 +2 -2
+ NTP_4_2_5P234_RC
+
+ util/ntp-keygen-opts.h@1.227 +3 -3
+ NTP_4_2_5P234_RC
+
+ util/ntp-keygen-opts.texi@1.226 +1 -1
+ NTP_4_2_5P234_RC
+
+ util/ntp-keygen.1@1.226 +2 -2
+ NTP_4_2_5P234_RC
+
+ChangeSet@1.2060.2.1, 2009-10-16 07:32:59+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
+ move #define strerror... to a header not used by lib/isc code.
+
+ ChangeLog@1.493.1.1 +2 -0
+ [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
+ move #define strerror... to a header not used by lib/isc code.
+
+ include/ntp_stdlib.h@1.33 +12 -3
+ [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
+ move #define strerror... to a header not used by lib/isc code.
+
+ lib/isc/win32/strerror.c@1.13 +10 -18
+ [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
+ move #define strerror... to a header not used by lib/isc code.
+
+ ports/winnt/include/config.h@1.79 +12 -8
+ [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
+ move #define strerror... to a header not used by lib/isc code.
+
+ ports/winnt/include/syslog.h@1.6 +0 -3
+ [Bug 1339] redux, use unmodified lib/isc/win32/strerror.c and
+ move #define strerror... to a header not used by lib/isc code.
+
+ChangeSet@1.2060.1.2, 2009-10-15 22:09:06+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1345] illegal 'grep' option prevents compilation.
+ [Bug 1346] keyword scanner broken where char defaults to unsigned.
+ [Bug 1347] ntpd/complete.conf missing multicastclient test case.
+
+ ChangeLog@1.494 +3 -0
+ [Bug 1345] illegal 'grep' option prevents compilation.
+ [Bug 1346] keyword scanner broken where char defaults to unsigned.
+ [Bug 1347] ntpd/complete.conf missing multicastclient test case.
+
+ ntpd/Makefile.am@1.75 +2 -2
+ [Bug 1345] illegal 'grep' option prevents compilation.
+
+ ntpd/complete.conf@1.2 +1 -0
+ [Bug 1347] ntpd/complete.conf missing multicastclient test case.
+
+ ntpd/ntp_config.c@1.231 +9 -15
+ [Bug 1347] ntpd/complete.conf missing multicastclient test case.
+
+ ntpd/ntp_scanner.c@1.30 +20 -18
+ [Bug 1346] keyword scanner broken where char defaults to unsigned.
+
+ ntpd/ntp_scanner.h@1.13 +0 -1
+ [Bug 1346] keyword scanner broken where char defaults to unsigned.
+
+ChangeSet@1.2062, 2009-10-15 04:15:55-07:00, hstenn@lgmac-hstenn.local
+ sntp doc updates
+
+ sntp/Makefile.am@1.15 +1 -0
+ distribute sntp.texi
+
+ sntp/sntp.texi@1.1 +84 -0
+ BitKeeper file /Users/hstenn/src/ntp-dev-snmp/sntp/sntp.texi
+
+ sntp/sntp.texi@1.0 +0 -0
+
+ChangeSet@1.2060.1.1, 2009-10-15 06:43:07-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P233_RC
+ TAG: NTP_4_2_5P233_RC
+
+ ChangeLog@1.493 +1 -0
+ NTP_4_2_5P233_RC
+
+ ntpd/ntpd-opts.c@1.227 +2 -2
+ NTP_4_2_5P233_RC
+
+ ntpd/ntpd-opts.h@1.227 +3 -3
+ NTP_4_2_5P233_RC
+
+ ntpd/ntpd-opts.texi@1.225 +1 -1
+ NTP_4_2_5P233_RC
+
+ ntpd/ntpd.1@1.225 +2 -2
+ NTP_4_2_5P233_RC
+
+ ntpdc/ntpdc-opts.c@1.223 +2 -2
+ NTP_4_2_5P233_RC
+
+ ntpdc/ntpdc-opts.h@1.223 +3 -3
+ NTP_4_2_5P233_RC
+
+ ntpdc/ntpdc-opts.texi@1.222 +1 -1
+ NTP_4_2_5P233_RC
+
+ ntpdc/ntpdc.1@1.222 +2 -2
+ NTP_4_2_5P233_RC
+
+ ntpq/ntpq-opts.c@1.224 +2 -2
+ NTP_4_2_5P233_RC
+
+ ntpq/ntpq-opts.h@1.224 +3 -3
+ NTP_4_2_5P233_RC
+
+ ntpq/ntpq-opts.texi@1.223 +1 -1
+ NTP_4_2_5P233_RC
+
+ ntpq/ntpq.1@1.223 +2 -2
+ NTP_4_2_5P233_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.102 +2 -2
+ NTP_4_2_5P233_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.102 +3 -3
+ NTP_4_2_5P233_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.102 +1 -1
+ NTP_4_2_5P233_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.102 +2 -2
+ NTP_4_2_5P233_RC
+
+ packageinfo.sh@1.237 +1 -1
+ NTP_4_2_5P233_RC
+
+ sntp/sntp-opts.c@1.96 +2 -2
+ NTP_4_2_5P233_RC
+
+ sntp/sntp-opts.h@1.96 +3 -3
+ NTP_4_2_5P233_RC
+
+ sntp/sntp-opts.texi@1.96 +1 -1
+ NTP_4_2_5P233_RC
+
+ sntp/sntp.1@1.96 +2 -2
+ NTP_4_2_5P233_RC
+
+ util/ntp-keygen-opts.c@1.226 +2 -2
+ NTP_4_2_5P233_RC
+
+ util/ntp-keygen-opts.h@1.226 +3 -3
+ NTP_4_2_5P233_RC
+
+ util/ntp-keygen-opts.texi@1.225 +1 -1
+ NTP_4_2_5P233_RC
+
+ util/ntp-keygen.1@1.225 +2 -2
+ NTP_4_2_5P233_RC
+
+ChangeSet@1.2061, 2009-10-15 03:43:07-07:00, hstenn@lgmac-hstenn.local
+ Prep for sntp docs
+
+ Makefile.am@1.87 +5 -1
+ Create include/version.texi
+
+ configure.ac@1.460 +7 -2
+ K_open() is not used anymore. kvm_open() needs kvm.h
+
+ include/Makefile.am@1.36 +1 -1
+ include version.texi
+
+ scripts/genver@1.5 +22 -1
+ Handle version.texi
+
+ sntp/Makefile.am@1.14 +17 -2
+ Prep for building sntp.html
+
+ sntp/sntp-opts.def@1.12 +15 -41
+ updates
+
+ChangeSet@1.2057.1.1, 2009-10-15 00:53:23-04:00, stenn@whimsy.udel.edu
+ Documentation cleanup and updates
+
+ ChangeLog@1.489.1.1 +1 -0
+ Documentation cleanup and updates
+
+ html/miscopt.html@1.52 +1 -1
+ Documentation cleanup and updates
+
+ html/ntpd.html@1.51 +72 -54
+ Documentation cleanup and updates
+
+ html/ntpq.html@1.34 +99 -73
+ Documentation cleanup and updates
+
+ChangeSet@1.2058, 2009-10-15 03:30:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1342] ignore|drop one IPv6 address on an interface blocks all
+ addresses on that interface.
+
+ ChangeLog@1.490 +2 -0
+ [Bug 1342] ignore|drop one IPv6 address on an interface blocks all
+ addresses on that interface.
+
+ lib/isc/win32/interfaceiter.c@1.15 +10 -25
+ Cleanup incomplete merge of NTP local changes from recent libisc update
+
+ ntpd/ntp_config.c@1.230 +1 -1
+ Use NULL for peer_config() interface arg instead of wildcard
+ to ensure the correct interface is used from the start.
+
+ ntpd/ntp_io.c@1.304.1.1 +17 -14
+ [Bug 1342] ignore|drop one IPv6 address on an interface blocks all
+ addresses on that interface.
+
+ ntpd/ntp_peer.c@1.122 +1 -1
+ Do not peer_clear("XFAC") manycast server associations or they will
+ never regain their ACST refid.
+
+ ports/winnt/ntpd/ntservice.c@1.21 +20 -8
+ Make windows-only command-line hack a little less broken
+
+ChangeSet@1.2057, 2009-10-14 04:22:12-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P232_RC
+ TAG: NTP_4_2_5P232_RC
+
+ ChangeLog@1.489 +1 -0
+ NTP_4_2_5P232_RC
+
+ ntpd/ntpd-opts.c@1.226 +4 -4
+ NTP_4_2_5P232_RC
+
+ ntpd/ntpd-opts.h@1.226 +3 -3
+ NTP_4_2_5P232_RC
+
+ ntpd/ntpd-opts.texi@1.224 +15 -6
+ NTP_4_2_5P232_RC
+
+ ntpd/ntpd.1@1.224 +16 -7
+ NTP_4_2_5P232_RC
+
+ ntpdc/ntpdc-opts.c@1.222 +2 -2
+ NTP_4_2_5P232_RC
+
+ ntpdc/ntpdc-opts.h@1.222 +3 -3
+ NTP_4_2_5P232_RC
+
+ ntpdc/ntpdc-opts.texi@1.221 +1 -1
+ NTP_4_2_5P232_RC
+
+ ntpdc/ntpdc.1@1.221 +2 -2
+ NTP_4_2_5P232_RC
+
+ ntpq/ntpq-opts.c@1.223 +2 -2
+ NTP_4_2_5P232_RC
+
+ ntpq/ntpq-opts.h@1.223 +3 -3
+ NTP_4_2_5P232_RC
+
+ ntpq/ntpq-opts.texi@1.222 +1 -1
+ NTP_4_2_5P232_RC
+
+ ntpq/ntpq.1@1.222 +2 -2
+ NTP_4_2_5P232_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.101 +2 -2
+ NTP_4_2_5P232_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.101 +3 -3
+ NTP_4_2_5P232_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.101 +1 -1
+ NTP_4_2_5P232_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.101 +2 -2
+ NTP_4_2_5P232_RC
+
+ packageinfo.sh@1.236 +1 -1
+ NTP_4_2_5P232_RC
+
+ sntp/sntp-opts.c@1.95 +2 -2
+ NTP_4_2_5P232_RC
+
+ sntp/sntp-opts.h@1.95 +3 -3
+ NTP_4_2_5P232_RC
+
+ sntp/sntp-opts.texi@1.95 +1 -1
+ NTP_4_2_5P232_RC
+
+ sntp/sntp.1@1.95 +2 -2
+ NTP_4_2_5P232_RC
+
+ util/ntp-keygen-opts.c@1.225 +2 -2
+ NTP_4_2_5P232_RC
+
+ util/ntp-keygen-opts.h@1.225 +3 -3
+ NTP_4_2_5P232_RC
+
+ util/ntp-keygen-opts.texi@1.224 +1 -1
+ NTP_4_2_5P232_RC
+
+ util/ntp-keygen.1@1.224 +2 -2
+ NTP_4_2_5P232_RC
+
+ChangeSet@1.2050.6.1, 2009-10-13 23:48:18+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI.
+
+ ChangeLog@1.482.5.1 +1 -0
+ [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI.
+
+ libntp/refnumtoa.c@1.7 +2 -5
+ do not require refnumtoa() callers to have called ISREFCLOCKADR() first
+
+ ntpd/ntp_control.c@1.126 +1 -2
+ remove unneeded #ifdef REFCLOCK, ISREFCLOCKADR() is now always present
+ and refnumtoa() has long been always present, even without REFCLOCK.
+
+ ntpd/refclock_nmea.c@1.44 +73 -22
+ [Bug 1341] NMEA driver requires working PPSAPI #ifdef HAVE_PPSAPI.
+
+ChangeSet@1.2050.5.1, 2009-10-13 02:24:57+00:00, davehart@shiny.ad.hartbrothers.com
+ Documentation updates for ntpq --oldrv, saveconfig, saveconfigdir,
+ ntpd -I -L and -M switches and interface/nic directive
+
+ ChangeLog@1.482.4.1 +2 -0
+ Update documentation for ntpq --old-rv, saveconfig, saveconfigdir,
+ ntpd -I -L and -M, and interface/nic rules. (From Dave Hart)
+
+ html/miscopt.html@1.51 +4 -2
+ Add saveconfigdir docs.
+ Add wildcard match class to interface/nic docs.
+
+ html/ntpd.html@1.50 +7 -3
+ Update -L docs, add -I
+
+ html/ntpq.html@1.33 +5 -3
+ Add ntpq --old-rv docs.
+ Update saveconfig docs to mention saveconfigdir.
+
+ html/scripts/miscopt.txt@1.3 +1 -0
+ Add saveconfigdir
+
+ ntpd/ntpdbase-opts.def@1.19 +14 -4
+ Update -L and -I docs to match HTML updates.
+ Expand -M docs.
+
+ChangeSet@1.2050.4.1, 2009-10-12 15:24:02+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
+
+ ChangeLog@1.482.3.1 +1 -0
+ [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
+
+ lib/isc/win32/strerror.c@1.12 +7 -4
+ [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
+
+ ports/winnt/include/config.h@1.78 +0 -3
+ [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
+
+ ports/winnt/include/syslog.h@1.5 +3 -0
+ [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
+
+ ports/winnt/libntp/syslog.c@1.7 +4 -10
+ [Bug 1339] Fix Windows-only ntp_strerror() infinite recursion.
+
+ChangeSet@1.2050.3.1, 2009-10-12 04:48:04+00:00, davehart@shiny.ad.hartbrothers.com
+ better t column in peers/opeers using hmode peer variable
+
+ ntpq/ntpq-subs.c@1.40 +86 -53
+ better t column in peers/opeers using hmode peer variable
+
+ChangeSet@1.2050.1.2, 2009-10-12 03:40:08+00:00, kardel@pogo.udel.edu
+ ntp_io.c, ChangeLog:
+ cast address pointer to void * for bug 1337
+
+ ChangeLog@1.482.1.2 +1 -0
+ cast address pointer to void * for bug 1337
+
+ ntpd/ntp_io.c@1.305 +1 -1
+ cast address pointer to void * for bug 1337
+
+ChangeSet@1.2050.2.2, 2009-10-11 22:09:53+00:00, davehart@shiny.ad.hartbrothers.com
+ Fix build break --with-arlib and config.cache
+
+ arlib/configure.in@1.2 +6 -7
+ Fix build break --with-arlib and config.cache
+
+ChangeSet@1.2050.2.1, 2009-10-11 19:27:05+00:00, davehart@shiny.ad.hartbrothers.com
+ Construct ntpd keyword scanner finite state machine at compile time
+ rather than at runtime, shrink entries from 40+ to 8 bytes.
+
+ ChangeLog@1.482.2.1 +2 -0
+ Construct ntpd keyword scanner finite state machine at compile time
+ rather than at runtime, shrink entries from 40+ to 8 bytes.
+
+ bootstrap@1.27 +4 -0
+ touch new generated file ntp_keyword.h after ntp_parser.[ch]
+
+ include/ntp_filegen.h@1.7 +11 -11
+ const is a virus
+
+ ntpd/Makefile.am@1.74 +17 -4
+ add keyword-gen program which produces ntp_keyword.h
+
+ ntpd/keyword-gen.c@1.1 +546 -0
+ new build-time tool to generate ntp_keyword.h with keyword scanner
+ finite state machine and token text array.
+ remove duplicate token table entries for "disable", "enable",
+ "monitor", and "version".
+
+ ntpd/keyword-gen.c@1.0 +0 -0
+
+ ntpd/ntp_config.c@1.229 +2 -10
+ remove references to create/delete_keyword_scanner()
+
+ ntpd/ntp_filegen.c@1.17 +12 -14
+ const is a virus
+
+ ntpd/ntp_keyword.h@1.1 +920 -0
+ generated by keyword-gen.c, contains keyword_text array and
+ keyword scanner finite state machine.
+
+ ntpd/ntp_keyword.h@1.0 +0 -0
+
+ ntpd/ntp_scanner.c@1.29 +26 -343
+ remove pieces to keyword-gen.c, new generated ntp_keyword.h
+
+ ntpd/ntp_scanner.h@1.12 +19 -16
+ move struct key_tok to keyword-gen.c, add scan_state struct replacing
+ previous struct state.
+ add multiple-inclusion protection
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.21 +4 -0
+ add reference to ntp_keyword.h
+
+ChangeSet@1.2050.1.1, 2009-10-11 11:50:51+00:00, kardel@pogo.udel.edu
+ ntp_io.c, ChangeLog:
+ [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...)
+
+ ChangeLog@1.482.1.1 +1 -0
+ [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...)
+
+ ntpd/ntp_io.c@1.304 +1 -1
+ [Bug 1337] fix incorrect args to setsockopt(fd, IP_MULTICAST_IF,...)
+
+ChangeSet@1.2051, 2009-10-11 02:36:55+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1302] OpenSSL under Windows needs applink support.
+
+ ChangeLog@1.483 +1 -0
+ [Bug 1302] OpenSSL under Windows needs applink support.
+
+ ports/winnt/ntpd/ntservice.c@1.20 +54 -12
+ [Bug 1302] OpenSSL under Windows needs applink support.
+
+ util/ntp-keygen.c@1.58 +7 -1
+ [Bug 1302] OpenSSL under Windows needs applink support.
+
+ChangeSet@1.2050, 2009-10-10 06:41:51-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P231_RC
+ TAG: NTP_4_2_5P231_RC
+
+ ChangeLog@1.482 +1 -0
+ NTP_4_2_5P231_RC
+
+ ntpd/ntpd-opts.c@1.225 +2 -2
+ NTP_4_2_5P231_RC
+
+ ntpd/ntpd-opts.h@1.225 +3 -3
+ NTP_4_2_5P231_RC
+
+ ntpd/ntpd-opts.texi@1.223 +1 -1
+ NTP_4_2_5P231_RC
+
+ ntpd/ntpd.1@1.223 +2 -2
+ NTP_4_2_5P231_RC
+
+ ntpdc/ntpdc-opts.c@1.221 +2 -2
+ NTP_4_2_5P231_RC
+
+ ntpdc/ntpdc-opts.h@1.221 +3 -3
+ NTP_4_2_5P231_RC
+
+ ntpdc/ntpdc-opts.texi@1.220 +1 -1
+ NTP_4_2_5P231_RC
+
+ ntpdc/ntpdc.1@1.220 +2 -2
+ NTP_4_2_5P231_RC
+
+ ntpq/ntpq-opts.c@1.222 +2 -2
+ NTP_4_2_5P231_RC
+
+ ntpq/ntpq-opts.h@1.222 +3 -3
+ NTP_4_2_5P231_RC
+
+ ntpq/ntpq-opts.texi@1.221 +1 -1
+ NTP_4_2_5P231_RC
+
+ ntpq/ntpq.1@1.221 +2 -2
+ NTP_4_2_5P231_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.100 +2 -2
+ NTP_4_2_5P231_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.100 +3 -3
+ NTP_4_2_5P231_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.100 +1 -1
+ NTP_4_2_5P231_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.100 +2 -2
+ NTP_4_2_5P231_RC
+
+ packageinfo.sh@1.235 +1 -1
+ NTP_4_2_5P231_RC
+
+ sntp/sntp-opts.c@1.94 +2 -2
+ NTP_4_2_5P231_RC
+
+ sntp/sntp-opts.h@1.94 +3 -3
+ NTP_4_2_5P231_RC
+
+ sntp/sntp-opts.texi@1.94 +1 -1
+ NTP_4_2_5P231_RC
+
+ sntp/sntp.1@1.94 +2 -2
+ NTP_4_2_5P231_RC
+
+ util/ntp-keygen-opts.c@1.224 +2 -2
+ NTP_4_2_5P231_RC
+
+ util/ntp-keygen-opts.h@1.224 +3 -3
+ NTP_4_2_5P231_RC
+
+ util/ntp-keygen-opts.texi@1.223 +1 -1
+ NTP_4_2_5P231_RC
+
+ util/ntp-keygen.1@1.223 +2 -2
+ NTP_4_2_5P231_RC
+
+ChangeSet@1.2049, 2009-10-09 17:15:23+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1335] Broadcast client degraded by wildcard default change.
+
+ ChangeLog@1.481 +1 -0
+ [Bug 1335] Broadcast client degraded by wildcard default change.
+
+ ntpd/ntp_io.c@1.303 +16 -3
+ default wildcard addresses to drop, exclude from "all" match class
+
+ChangeSet@1.2048, 2009-10-09 02:25:40-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P230_RC
+ TAG: NTP_4_2_5P230_RC
+
+ ChangeLog@1.480 +1 -0
+ NTP_4_2_5P230_RC
+
+ ntpd/ntpd-opts.c@1.224 +2 -2
+ NTP_4_2_5P230_RC
+
+ ntpd/ntpd-opts.h@1.224 +3 -3
+ NTP_4_2_5P230_RC
+
+ ntpd/ntpd-opts.texi@1.222 +1 -1
+ NTP_4_2_5P230_RC
+
+ ntpd/ntpd.1@1.222 +2 -2
+ NTP_4_2_5P230_RC
+
+ ntpdc/ntpdc-opts.c@1.220 +2 -2
+ NTP_4_2_5P230_RC
+
+ ntpdc/ntpdc-opts.h@1.220 +3 -3
+ NTP_4_2_5P230_RC
+
+ ntpdc/ntpdc-opts.texi@1.219 +1 -1
+ NTP_4_2_5P230_RC
+
+ ntpdc/ntpdc.1@1.219 +2 -2
+ NTP_4_2_5P230_RC
+
+ ntpq/ntpq-opts.c@1.221 +2 -2
+ NTP_4_2_5P230_RC
+
+ ntpq/ntpq-opts.h@1.221 +3 -3
+ NTP_4_2_5P230_RC
+
+ ntpq/ntpq-opts.texi@1.220 +1 -1
+ NTP_4_2_5P230_RC
+
+ ntpq/ntpq.1@1.220 +2 -2
+ NTP_4_2_5P230_RC
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.99 +2 -2
+ NTP_4_2_5P230_RC
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.99 +3 -3
+ NTP_4_2_5P230_RC
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.99 +1 -1
+ NTP_4_2_5P230_RC
+
+ ntpsnmpd/ntpsnmpd.1@1.99 +2 -2
+ NTP_4_2_5P230_RC
+
+ packageinfo.sh@1.234 +1 -1
+ NTP_4_2_5P230_RC
+
+ sntp/sntp-opts.c@1.93 +2 -2
+ NTP_4_2_5P230_RC
+
+ sntp/sntp-opts.h@1.93 +3 -3
+ NTP_4_2_5P230_RC
+
+ sntp/sntp-opts.texi@1.93 +1 -1
+ NTP_4_2_5P230_RC
+
+ sntp/sntp.1@1.93 +2 -2
+ NTP_4_2_5P230_RC
+
+ util/ntp-keygen-opts.c@1.223 +2 -2
+ NTP_4_2_5P230_RC
+
+ util/ntp-keygen-opts.h@1.223 +3 -3
+ NTP_4_2_5P230_RC
+
+ util/ntp-keygen-opts.texi@1.222 +1 -1
+ NTP_4_2_5P230_RC
+
+ util/ntp-keygen.1@1.222 +2 -2
+ NTP_4_2_5P230_RC
+
+ChangeSet@1.2047, 2009-10-08 23:54:02-04:00, stenn@whimsy.udel.edu
+ Start the 4.2.6 Release Candidate cycle
+
+ ChangeLog@1.479 +1 -0
+ Start the 4.2.6 Release Candidate cycle
+
+ packageinfo.sh@1.233 +2 -2
+ Start the 4.2.6 Release Candidate cycle
+
+ChangeSet@1.2046, 2009-10-08 19:48:15-04:00, stenn@whimsy.udel.edu
+ Broadcast and transit phase cleanup from Dave Mills
+
+ ChangeLog@1.478 +1 -0
+ Broadcast and transit phase cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.141 +2 -2
+ Broadcast and transit phase cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.296 +7 -1
+ Broadcast and transit phase cleanup from Dave Mills
+
+ChangeSet@1.2045, 2009-10-07 06:41:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P229
+ TAG: NTP_4_2_5P229
+
+ ChangeLog@1.477 +1 -0
+ NTP_4_2_5P229
+
+ ntpd/ntpd-opts.c@1.223 +2 -2
+ NTP_4_2_5P229
+
+ ntpd/ntpd-opts.h@1.223 +3 -3
+ NTP_4_2_5P229
+
+ ntpd/ntpd-opts.texi@1.221 +4 -2
+ NTP_4_2_5P229
+
+ ntpd/ntpd.1@1.221 +2 -2
+ NTP_4_2_5P229
+
+ ntpdc/ntpdc-opts.c@1.219 +2 -2
+ NTP_4_2_5P229
+
+ ntpdc/ntpdc-opts.h@1.219 +3 -3
+ NTP_4_2_5P229
+
+ ntpdc/ntpdc-opts.texi@1.218 +2 -2
+ NTP_4_2_5P229
+
+ ntpdc/ntpdc.1@1.218 +2 -2
+ NTP_4_2_5P229
+
+ ntpq/ntpq-opts.c@1.220 +2 -2
+ NTP_4_2_5P229
+
+ ntpq/ntpq-opts.h@1.220 +3 -3
+ NTP_4_2_5P229
+
+ ntpq/ntpq-opts.texi@1.219 +7 -3
+ NTP_4_2_5P229
+
+ ntpq/ntpq.1@1.219 +2 -2
+ NTP_4_2_5P229
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.98 +2 -2
+ NTP_4_2_5P229
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.98 +3 -3
+ NTP_4_2_5P229
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.98 +1 -1
+ NTP_4_2_5P229
+
+ ntpsnmpd/ntpsnmpd.1@1.98 +2 -2
+ NTP_4_2_5P229
+
+ packageinfo.sh@1.232 +1 -1
+ NTP_4_2_5P229
+
+ sntp/sntp-opts.c@1.92 +2 -2
+ NTP_4_2_5P229
+
+ sntp/sntp-opts.h@1.92 +3 -3
+ NTP_4_2_5P229
+
+ sntp/sntp-opts.texi@1.92 +2 -2
+ NTP_4_2_5P229
+
+ sntp/sntp.1@1.92 +2 -2
+ NTP_4_2_5P229
+
+ util/ntp-keygen-opts.c@1.222 +2 -2
+ NTP_4_2_5P229
+
+ util/ntp-keygen-opts.h@1.222 +3 -3
+ NTP_4_2_5P229
+
+ util/ntp-keygen-opts.texi@1.221 +2 -2
+ NTP_4_2_5P229
+
+ util/ntp-keygen.1@1.221 +2 -2
+ NTP_4_2_5P229
+
+ChangeSet@1.1436.15.71, 2009-10-07 01:33:22+00:00, davehart@shiny.ad.hartbrothers.com
+ [Sec 1331] DoS with mode 7 packets - CVE-2009-3563.
+
+ ChangeLog@1.1.1.91 +4 -0
+ [Sec 1331] DoS with mode 7 packets - CVE-2009-3563.
+
+ ntpd/ntp_request.c@1.65.1.3 +9 -2
+ [Sec 1331] DoS with mode 7 packets - CVE-2009-3563.
+
+ChangeSet@1.2044, 2009-10-06 15:37:07+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'.
+ Change ntpsnmpd/Makefile.am include file order to fix FreeBSD build.
+
+ ChangeLog@1.476 +2 -0
+ [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'.
+ Change ntpsnmpd/Makefile.am include file order to fix FreeBSD build.
+
+ ntpq/ntpq-subs.c@1.39 +1 -1
+ [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'.
+
+ ntpq/ntpq.c@1.94 +11 -0
+ [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'.
+
+ ntpq/ntpq.h@1.10 +1 -0
+ [Bug 1334] ntpsnmpd undefined reference to `ntpqOptions'.
+
+ ntpsnmpd/Makefile.am@1.11 +1 -1
+ list $(LIBOPTS_CFLAGS) ahead of @SNMP_CPPFLAGS@ to pick up our copy
+ of autoopts/options.h ahead of any on the generous include search
+ path in @SNMP_CPPFLAGS@
+
+ChangeSet@1.2043, 2009-10-06 04:55:16-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P228
+ TAG: NTP_4_2_5P228
+
+ ChangeLog@1.475 +1 -0
+ NTP_4_2_5P228
+
+ ntpd/ntpd-opts.c@1.222 +2 -2
+ NTP_4_2_5P228
+
+ ntpd/ntpd-opts.h@1.222 +3 -3
+ NTP_4_2_5P228
+
+ ntpd/ntpd-opts.texi@1.220 +1 -1
+ NTP_4_2_5P228
+
+ ntpd/ntpd.1@1.220 +2 -2
+ NTP_4_2_5P228
+
+ ntpdc/ntpdc-opts.c@1.218 +2 -2
+ NTP_4_2_5P228
+
+ ntpdc/ntpdc-opts.h@1.218 +3 -3
+ NTP_4_2_5P228
+
+ ntpdc/ntpdc-opts.texi@1.217 +1 -1
+ NTP_4_2_5P228
+
+ ntpdc/ntpdc.1@1.217 +2 -2
+ NTP_4_2_5P228
+
+ ntpq/ntpq-opts.c@1.219 +2 -2
+ NTP_4_2_5P228
+
+ ntpq/ntpq-opts.h@1.219 +3 -3
+ NTP_4_2_5P228
+
+ ntpq/ntpq-opts.texi@1.218 +1 -1
+ NTP_4_2_5P228
+
+ ntpq/ntpq.1@1.218 +2 -2
+ NTP_4_2_5P228
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.97 +2 -2
+ NTP_4_2_5P228
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.97 +3 -3
+ NTP_4_2_5P228
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.97 +1 -1
+ NTP_4_2_5P228
+
+ ntpsnmpd/ntpsnmpd.1@1.97 +2 -2
+ NTP_4_2_5P228
+
+ packageinfo.sh@1.231 +1 -1
+ NTP_4_2_5P228
+
+ sntp/sntp-opts.c@1.91 +2 -2
+ NTP_4_2_5P228
+
+ sntp/sntp-opts.h@1.91 +3 -3
+ NTP_4_2_5P228
+
+ sntp/sntp-opts.texi@1.91 +1 -1
+ NTP_4_2_5P228
+
+ sntp/sntp.1@1.91 +2 -2
+ NTP_4_2_5P228
+
+ util/ntp-keygen-opts.c@1.221 +2 -2
+ NTP_4_2_5P228
+
+ util/ntp-keygen-opts.h@1.221 +3 -3
+ NTP_4_2_5P228
+
+ util/ntp-keygen-opts.texi@1.220 +1 -1
+ NTP_4_2_5P228
+
+ util/ntp-keygen.1@1.220 +2 -2
+ NTP_4_2_5P228
+
+ChangeSet@1.2042, 2009-10-06 06:48:31+00:00, davehart@shiny.ad.hartbrothers.com
+ Reclaim syntax tree memory after application in ntpd built with
+ configure --disable-saveconfig.
+
+ ChangeLog@1.474 +2 -0
+ Reclaim syntax tree memory after application in ntpd built with
+ configure --disable-saveconfig.
+
+ include/ntp_config.h@1.65 +10 -0
+ Reclaim syntax tree memory after application in ntpd built with
+ configure --disable-saveconfig.
+
+ ntpd/ntp_config.c@1.228 +57 -43
+ Reclaim syntax tree memory after application in ntpd built with
+ configure --disable-saveconfig.
+
+ChangeSet@1.2039.1.1, 2009-10-06 03:49:05+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant.
+ add new file ntpd/complete.conf to ntpd/Makefile.am EXTRA_DIST
+
+ ChangeLog@1.471.1.1 +2 -1
+ [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant.
+ wrap [Bug 1327] line at 72 chars
+
+ Makefile.am@1.86 +1 -1
+ run distcheck configure with -C so arlib, sntp configure runs benefit
+ from top-level configure.cache
+
+ ntpd/Makefile.am@1.73 +6 -2
+ add new file ntpd/complete.conf to ntpd/Makefile.am EXTRA_DIST
+
+ ntpq/ntpq.c@1.93 +16 -17
+ [Bug 1135] ntpq uses sizeof(u_long) where sizeof(u_int32) is meant.
+
+ChangeSet@1.2040, 2009-10-05 16:34:09+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1333] ntpd --interface precedence over --novirtualips lost.
+
+ ChangeLog@1.472 +1 -0
+ [Bug 1333] ntpd --interface precedence over --novirtualips lost.
+
+ ntpd/ntp_io.c@1.302 +39 -26
+ [Bug 1333] ntpd --interface precedence over --novirtualips lost.
+
+ChangeSet@1.2039, 2009-10-05 07:45:16-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P227
+ TAG: NTP_4_2_5P227
+
+ ChangeLog@1.471 +1 -0
+ NTP_4_2_5P227
+
+ ntpd/ntpd-opts.c@1.221 +2 -2
+ NTP_4_2_5P227
+
+ ntpd/ntpd-opts.h@1.221 +3 -3
+ NTP_4_2_5P227
+
+ ntpd/ntpd-opts.texi@1.219 +1 -1
+ NTP_4_2_5P227
+
+ ntpd/ntpd.1@1.219 +2 -2
+ NTP_4_2_5P227
+
+ ntpdc/ntpdc-opts.c@1.217 +2 -2
+ NTP_4_2_5P227
+
+ ntpdc/ntpdc-opts.h@1.217 +3 -3
+ NTP_4_2_5P227
+
+ ntpdc/ntpdc-opts.texi@1.216 +1 -1
+ NTP_4_2_5P227
+
+ ntpdc/ntpdc.1@1.216 +2 -2
+ NTP_4_2_5P227
+
+ ntpq/ntpq-opts.c@1.218 +3 -3
+ NTP_4_2_5P227
+
+ ntpq/ntpq-opts.h@1.218 +4 -4
+ NTP_4_2_5P227
+
+ ntpq/ntpq-opts.texi@1.217 +3 -3
+ NTP_4_2_5P227
+
+ ntpq/ntpq.1@1.217 +2 -2
+ NTP_4_2_5P227
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.96 +2 -2
+ NTP_4_2_5P227
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.96 +3 -3
+ NTP_4_2_5P227
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.96 +1 -1
+ NTP_4_2_5P227
+
+ ntpsnmpd/ntpsnmpd.1@1.96 +2 -2
+ NTP_4_2_5P227
+
+ packageinfo.sh@1.230 +1 -1
+ NTP_4_2_5P227
+
+ sntp/sntp-opts.c@1.90 +2 -2
+ NTP_4_2_5P227
+
+ sntp/sntp-opts.h@1.90 +3 -3
+ NTP_4_2_5P227
+
+ sntp/sntp-opts.texi@1.90 +1 -1
+ NTP_4_2_5P227
+
+ sntp/sntp.1@1.90 +2 -2
+ NTP_4_2_5P227
+
+ util/ntp-keygen-opts.c@1.220 +2 -2
+ NTP_4_2_5P227
+
+ util/ntp-keygen-opts.h@1.220 +3 -3
+ NTP_4_2_5P227
+
+ util/ntp-keygen-opts.texi@1.219 +1 -1
+ NTP_4_2_5P227
+
+ util/ntp-keygen.1@1.219 +2 -2
+ NTP_4_2_5P227
+
+ChangeSet@1.2038, 2009-10-05 07:29:55+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1135] :config fails with "Server disallowed request"
+
+ ChangeLog@1.470 +1 -0
+ [Bug 1135] :config fails with "Server disallowed request"
+
+ ntpd/ntp_control.c@1.125 +1 -1
+ [Bug 1135] :config fails with "Server disallowed request"
+
+ChangeSet@1.2037, 2009-10-05 06:35:21+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff.
+ add ntpq --old-rv
+ fix ipv4/ipv6 which are not equivalent in the libopts sense
+
+ ChangeLog@1.469 +1 -0
+ [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff.
+
+ ntpq/ntpq-opts.c@1.217 +39 -10
+ autogen output
+
+ ntpq/ntpq-opts.def@1.14 +16 -2
+ add ntpq --old-rv
+ fix ipv4/ipv6 which are not equivalent in the libopts sense
+
+ ntpq/ntpq-opts.h@1.217 +15 -10
+ autogen output
+
+ ntpq/ntpq-opts.texi@1.216 +21 -5
+ autogen output
+
+ ntpq/ntpq-subs.c@1.38 +38 -21
+ [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff.
+ add ntpq --old-rv
+
+ ntpq/ntpq.1@1.216 +17 -4
+ autogen output
+
+ ntpq/ntpq.c@1.92 +22 -25
+ [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff.
+
+ ntpq/ntpq.h@1.9 +1 -1
+ [Bug 1332] ntpq -c 'rv 0 variablename' returns extra stuff.
+
+ChangeSet@1.2032.1.1, 2009-10-04 18:35:23-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Hart/Dave Mills
+
+ ChangeLog@1.465.1.1 +1 -0
+ Documentation updates from Dave Hart/Dave Mills
+
+ html/clockopt.html@1.22 +7 -5
+ Documentation updates from Dave Hart/Dave Mills
+
+ html/miscopt.html@1.50 +32 -35
+ Documentation updates from Dave Hart/Dave Mills
+
+ChangeSet@1.2035, 2009-10-04 22:17:11+00:00, davehart@shiny.ad.hartbrothers.com
+ actually ignore nic/interface via :config with -I or -L, saying so
+ isn't enough.
+
+ ntpd/ntp_config.c@1.227 +2 -0
+ actually ignore nic/interface via :config with -I or -L, saying so
+ isn't enough.
+
+ChangeSet@1.2034, 2009-10-04 20:28:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1330] disallow interface/nic rules when --novirtualips or
+ --interface are used.
+
+ ChangeLog@1.467 +4 -2
+ [Bug 1330] disallow interface/nic rules when --novirtualips or
+ --interface are used.
+ add missing "* " prefix to 1318, 1327 entries
+
+ ntpd/ntp_config.c@1.226 +12 -1
+ [Bug 1330] disallow interface/nic rules when --novirtualips or
+ --interface are used.
+
+ChangeSet@1.2033, 2009-10-04 18:14:14+00:00, davehart@shiny.ad.hartbrothers.com
+ Add test of ntpd --saveconfigquit fidelity using new complete.conf.
+
+ ChangeLog@1.466 +1 -0
+ Add test of ntpd --saveconfigquit fidelity using new complete.conf.
+
+ configure.ac@1.459 +3 -0
+ make "if SAVECONFIG_ENABLED" work in ntpd/Makefile.am
+
+ ntpd/Makefile.am@1.72 +14 -1
+ add check_saveconfig target and list in check-local: to validate
+ --saveconfigquit produces the same configuration it is given.
+
+ ntpd/complete.conf@1.1 +54 -0
+ This file represents an attempt to hit every keyword and syntax nook
+
+ ntpd/complete.conf@1.0 +0 -0
+
+ ntpd/ntp_config.c@1.225 +39 -19
+ move --saveconfigquit handling to before application of initial
+ syntax tree
+
+ ntpdc/Makefile.am@1.43 +1 -1
+ correct reference to $(srcdir)/layout.std
+
+ChangeSet@1.2032, 2009-10-04 07:49:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P226
+ TAG: NTP_4_2_5P226
+
+ ChangeLog@1.465 +1 -0
+ NTP_4_2_5P226
+
+ ntpd/ntpd-opts.c@1.220 +3 -3
+ NTP_4_2_5P226
+
+ ntpd/ntpd-opts.h@1.220 +4 -4
+ NTP_4_2_5P226
+
+ ntpd/ntpd-opts.texi@1.218 +1 -1
+ NTP_4_2_5P226
+
+ ntpd/ntpd.1@1.218 +2 -2
+ NTP_4_2_5P226
+
+ ntpdc/ntpdc-opts.c@1.216 +3 -3
+ NTP_4_2_5P226
+
+ ntpdc/ntpdc-opts.h@1.216 +4 -4
+ NTP_4_2_5P226
+
+ ntpdc/ntpdc-opts.texi@1.215 +3 -3
+ NTP_4_2_5P226
+
+ ntpdc/ntpdc.1@1.215 +2 -2
+ NTP_4_2_5P226
+
+ ntpq/ntpq-opts.c@1.216 +3 -3
+ NTP_4_2_5P226
+
+ ntpq/ntpq-opts.h@1.216 +4 -4
+ NTP_4_2_5P226
+
+ ntpq/ntpq-opts.texi@1.215 +3 -3
+ NTP_4_2_5P226
+
+ ntpq/ntpq.1@1.215 +2 -2
+ NTP_4_2_5P226
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.95 +2 -2
+ NTP_4_2_5P226
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.95 +3 -3
+ NTP_4_2_5P226
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.95 +1 -1
+ NTP_4_2_5P226
+
+ ntpsnmpd/ntpsnmpd.1@1.95 +2 -2
+ NTP_4_2_5P226
+
+ packageinfo.sh@1.229 +1 -1
+ NTP_4_2_5P226
+
+ sntp/sntp-opts.c@1.89 +2 -2
+ NTP_4_2_5P226
+
+ sntp/sntp-opts.h@1.89 +3 -3
+ NTP_4_2_5P226
+
+ sntp/sntp-opts.texi@1.89 +2 -2
+ NTP_4_2_5P226
+
+ sntp/sntp.1@1.89 +2 -2
+ NTP_4_2_5P226
+
+ util/ntp-keygen-opts.c@1.219 +3 -3
+ NTP_4_2_5P226
+
+ util/ntp-keygen-opts.h@1.219 +4 -4
+ NTP_4_2_5P226
+
+ util/ntp-keygen-opts.texi@1.218 +3 -3
+ NTP_4_2_5P226
+
+ util/ntp-keygen.1@1.218 +2 -2
+ NTP_4_2_5P226
+
+ChangeSet@1.2029.1.2, 2009-10-03 01:26:37-04:00, stenn@whimsy.udel.edu
+ Clockhop and autokey cleanup from Dave Mills
+
+ ChangeLog@1.462.1.2 +1 -0
+ Clockhop and autokey cleanup from Dave Mills
+
+ include/ntp.h@1.165 +1 -1
+ Clockhop and autokey cleanup from Dave Mills
+
+ libntp/statestr.c@1.19 +3 -3
+ Clockhop and autokey cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.140 +8 -10
+ Clockhop and autokey cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.295 +10 -9
+ Clockhop and autokey cleanup from Dave Mills
+
+ChangeSet@1.2029.1.1, 2009-10-03 01:19:40-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.462.1.1 +1 -0
+ Documentation updates from Dave Mills
+
+ html/accopt.html@1.33 +6 -6
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.29 +8 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.2030, 2009-10-03 05:13:07+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1318] Allow multiple -g options on ntpd command line.
+ [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure
+ --disable-debugging.
+ Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+
+ ChangeLog@1.463 +5 -0
+ [Bug 1318] Allow multiple -g options on ntpd command line.
+ [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure
+ --disable-debugging.
+ Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+
+ configure.ac@1.458 +3 -3
+ [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure
+ --disable-debugging.
+
+ include/debug-opt.def@1.5 +0 -2
+ [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure
+ --disable-debugging.
+
+ include/ntp_config.h@1.64 +2 -2
+ add comment parameter to dump_config_tree() and dump_all_config_trees()
+
+ libntp/Makefile.am@1.46 +3 -9
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ libparse/Makefile.am@1.15 +13 -15
+ convert leading spaces to tabs.
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ ntpd/Makefile.am@1.71 +87 -39
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+ [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure
+ --disable-debugging.
+
+ ntpd/ntp_config.c@1.224 +41 -17
+ Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+
+ ntpd/ntp_control.c@1.124 +1 -1
+ Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+
+ ntpd/ntp_io.c@1.301 +2 -1
+ Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+
+ ntpd/ntpd-opts.c@1.219 +55 -24
+ autogen output
+
+ ntpd/ntpd-opts.h@1.219 +28 -19
+ autogen output
+
+ ntpd/ntpd-opts.texi@1.217 +26 -2
+ autogen output
+
+ ntpd/ntpd.1@1.217 +10 -2
+ autogen output
+
+ ntpd/ntpd.c@1.109 +36 -28
+ ntpdsim --help was crashing due to failure to init autoopts.
+ Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+
+ ntpd/ntpdbase-opts.def@1.18 +46 -1
+ [Bug 1318] Allow multiple -g options on ntpd command line.
+ [Bug 1327] ntpq, ntpdc, ntp-keygen -d and -D should work with configure
+ --disable-debugging.
+ Add ntpd --saveconfigquit <filename> option for future build-time
+ testing of saveconfig fidelity.
+
+ ntpdate/Makefile.am@1.19 +5 -5
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ ntpdc/Makefile.am@1.42 +3 -6
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ ntpdc/ntpdc-opts.c@1.215 +5 -30
+ autogen output
+
+ ntpdc/ntpdc-opts.h@1.215 +2 -6
+ autogen output
+
+ ntpdc/ntpdc-opts.texi@1.214 +4 -8
+ autogen output
+
+ ntpdc/ntpdc.1@1.214 +2 -2
+ autogen output
+
+ ntpq/Makefile.am@1.36 +5 -6
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ ntpq/ntpq-opts.c@1.215 +5 -30
+ autogen output
+
+ ntpq/ntpq-opts.h@1.215 +2 -6
+ autogen output
+
+ ntpq/ntpq-opts.texi@1.214 +4 -8
+ autogen output
+
+ ntpq/ntpq.1@1.214 +2 -2
+ autogen output
+
+ ntpsnmpd/Makefile.am@1.10 +7 -10
+ ntpsnmpd-opts.def doesn't include debug-opt.def.
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ parseutil/Makefile.am@1.10 +5 -5
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ ports/winnt/ntpd/ntservice.c@1.19 +7 -1
+ recognize alternate spellings of option names in win32 service startup hack
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.20 +6 -2
+ add reference to ntp_md5.h
+
+ sntp/Makefile.am@1.13 +5 -6
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ util/Makefile.am@1.41 +4 -6
+ remove as much whitespace as possible from -I include dir sequence to
+ keep the signal-to-noise ratio higher on BSD make, which leaves tabs
+ in the constructed gcc command lines.
+
+ util/ntp-keygen-opts.c@1.218 +5 -30
+ autogen output
+
+ util/ntp-keygen-opts.h@1.218 +2 -6
+ autogen output
+
+ util/ntp-keygen-opts.texi@1.217 +4 -8
+ autogen output
+
+ util/ntp-keygen.1@1.217 +2 -2
+ autogen output
+
+ChangeSet@1.2029, 2009-09-30 07:43:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P225
+ TAG: NTP_4_2_5P225
+
+ ChangeLog@1.462 +1 -0
+ NTP_4_2_5P225
+
+ ntpd/ntpd-opts.c@1.218 +2 -2
+ NTP_4_2_5P225
+
+ ntpd/ntpd-opts.h@1.218 +3 -3
+ NTP_4_2_5P225
+
+ ntpd/ntpd-opts.texi@1.216 +1 -1
+ NTP_4_2_5P225
+
+ ntpd/ntpd.1@1.216 +2 -2
+ NTP_4_2_5P225
+
+ ntpdc/ntpdc-opts.c@1.214 +2 -2
+ NTP_4_2_5P225
+
+ ntpdc/ntpdc-opts.h@1.214 +3 -3
+ NTP_4_2_5P225
+
+ ntpdc/ntpdc-opts.texi@1.213 +1 -1
+ NTP_4_2_5P225
+
+ ntpdc/ntpdc.1@1.213 +2 -2
+ NTP_4_2_5P225
+
+ ntpq/ntpq-opts.c@1.214 +2 -2
+ NTP_4_2_5P225
+
+ ntpq/ntpq-opts.h@1.214 +3 -3
+ NTP_4_2_5P225
+
+ ntpq/ntpq-opts.texi@1.213 +1 -1
+ NTP_4_2_5P225
+
+ ntpq/ntpq.1@1.213 +2 -2
+ NTP_4_2_5P225
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.94 +2 -2
+ NTP_4_2_5P225
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.94 +3 -3
+ NTP_4_2_5P225
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.94 +1 -1
+ NTP_4_2_5P225
+
+ ntpsnmpd/ntpsnmpd.1@1.94 +2 -2
+ NTP_4_2_5P225
+
+ packageinfo.sh@1.228 +1 -1
+ NTP_4_2_5P225
+
+ sntp/sntp-opts.c@1.88 +2 -2
+ NTP_4_2_5P225
+
+ sntp/sntp-opts.h@1.88 +3 -3
+ NTP_4_2_5P225
+
+ sntp/sntp-opts.texi@1.88 +1 -1
+ NTP_4_2_5P225
+
+ sntp/sntp.1@1.88 +2 -2
+ NTP_4_2_5P225
+
+ util/ntp-keygen-opts.c@1.217 +2 -2
+ NTP_4_2_5P225
+
+ util/ntp-keygen-opts.h@1.217 +3 -3
+ NTP_4_2_5P225
+
+ util/ntp-keygen-opts.texi@1.216 +1 -1
+ NTP_4_2_5P225
+
+ util/ntp-keygen.1@1.216 +2 -2
+ NTP_4_2_5P225
+
+ChangeSet@1.2026.1.1, 2009-09-30 06:32:09+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1324] support bracketed IPv6 numeric addresses for restrict.
+
+ ChangeLog@1.459.1.1 +1 -0
+ [Bug 1324] support bracketed IPv6 numeric addresses for restrict.
+
+ ntpd/ntp_config.c@1.223 +73 -43
+ [Bug 1324] support bracketed IPv6 numeric addresses for restrict.
+
+ ntpd/ntp_io.c@1.300 +13 -7
+ [Bug 1324] support bracketed IPv6 numeric addresses for restrict.
+
+ChangeSet@1.2027, 2009-09-30 02:10:49-04:00, stenn@whimsy.udel.edu
+ authopt documentation changes from Dave Mills/Dave Hart
+
+ ChangeLog@1.460 +1 -0
+ authopt documentation changes from Dave Mills/Dave Hart
+
+ html/authopt.html@1.52 +2 -2
+ authopt documentation changes from Dave Mills/Dave Hart
+
+ html/scripts/authopt.txt@1.2 +3 -4
+ authopt documentation changes from Dave Mills/Dave Hart
+
+ChangeSet@1.2026, 2009-09-29 07:44:52-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P224
+ TAG: NTP_4_2_5P224
+
+ ChangeLog@1.459 +1 -0
+ NTP_4_2_5P224
+
+ ntpd/ntpd-opts.c@1.217 +2 -2
+ NTP_4_2_5P224
+
+ ntpd/ntpd-opts.h@1.217 +3 -3
+ NTP_4_2_5P224
+
+ ntpd/ntpd-opts.texi@1.215 +1 -1
+ NTP_4_2_5P224
+
+ ntpd/ntpd.1@1.215 +2 -2
+ NTP_4_2_5P224
+
+ ntpdc/ntpdc-opts.c@1.213 +2 -2
+ NTP_4_2_5P224
+
+ ntpdc/ntpdc-opts.h@1.213 +3 -3
+ NTP_4_2_5P224
+
+ ntpdc/ntpdc-opts.texi@1.212 +1 -1
+ NTP_4_2_5P224
+
+ ntpdc/ntpdc.1@1.212 +2 -2
+ NTP_4_2_5P224
+
+ ntpq/ntpq-opts.c@1.213 +2 -2
+ NTP_4_2_5P224
+
+ ntpq/ntpq-opts.h@1.213 +3 -3
+ NTP_4_2_5P224
+
+ ntpq/ntpq-opts.texi@1.212 +1 -1
+ NTP_4_2_5P224
+
+ ntpq/ntpq.1@1.212 +2 -2
+ NTP_4_2_5P224
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.93 +2 -2
+ NTP_4_2_5P224
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.93 +3 -3
+ NTP_4_2_5P224
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.93 +1 -1
+ NTP_4_2_5P224
+
+ ntpsnmpd/ntpsnmpd.1@1.93 +2 -2
+ NTP_4_2_5P224
+
+ packageinfo.sh@1.227 +1 -1
+ NTP_4_2_5P224
+
+ sntp/sntp-opts.c@1.87 +2 -2
+ NTP_4_2_5P224
+
+ sntp/sntp-opts.h@1.87 +3 -3
+ NTP_4_2_5P224
+
+ sntp/sntp-opts.texi@1.87 +1 -1
+ NTP_4_2_5P224
+
+ sntp/sntp.1@1.87 +2 -2
+ NTP_4_2_5P224
+
+ util/ntp-keygen-opts.c@1.216 +2 -2
+ NTP_4_2_5P224
+
+ util/ntp-keygen-opts.h@1.216 +3 -3
+ NTP_4_2_5P224
+
+ util/ntp-keygen-opts.texi@1.215 +1 -1
+ NTP_4_2_5P224
+
+ util/ntp-keygen.1@1.215 +2 -2
+ NTP_4_2_5P224
+
+ChangeSet@1.2025, 2009-09-29 06:38:31+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove "tos maxhop" ntp.conf knob.
+
+ ChangeLog@1.458 +1 -0
+ Remove "tos maxhop" ntp.conf knob.
+
+ ntpd/ntp_parser.c@1.51 +888 -902
+ Bison output from ntp_parser.y
+
+ ntpd/ntp_parser.h@1.31 +175 -177
+ Bison output from ntp_parser.y
+
+ ntpd/ntp_parser.y@1.46 +0 -3
+ Remove "tos maxhop" ntp.conf knob.
+
+ ntpd/ntp_scanner.c@1.28 +0 -1
+ Remove "tos maxhop" ntp.conf knob.
+
+ChangeSet@1.2024, 2009-09-28 22:36:59-04:00, stenn@whimsy.udel.edu
+ Clockhop and documentation fixes from Dave Mills
+
+ ChangeLog@1.457 +1 -0
+ Clockhop and documentation fixes from Dave Mills
+
+ html/confopt.html@1.47 +1 -3
+ Clockhop and documentation fixes from Dave Mills
+
+ html/copyright.html@1.44 +7 -4
+ Clockhop and documentation fixes from Dave Mills
+
+ html/decode.html@1.11 +6 -1
+ Clockhop and documentation fixes from Dave Mills
+
+ html/miscopt.html@1.49 +7 -2
+ Clockhop and documentation fixes from Dave Mills
+
+ include/ntp.h@1.164 +1 -0
+ Clockhop and documentation fixes from Dave Mills
+
+ libntp/statestr.c@1.18 +1 -0
+ Clockhop and documentation fixes from Dave Mills
+
+ ntpd/ntp_config.c@1.222 +0 -5
+ Clockhop and documentation fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.294 +49 -31
+ Clockhop and documentation fixes from Dave Mills
+
+ChangeSet@1.2023, 2009-09-28 07:43:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P223
+ TAG: NTP_4_2_5P223
+
+ ChangeLog@1.456 +1 -0
+ NTP_4_2_5P223
+
+ ntpd/ntpd-opts.c@1.216 +2 -2
+ NTP_4_2_5P223
+
+ ntpd/ntpd-opts.h@1.216 +3 -3
+ NTP_4_2_5P223
+
+ ntpd/ntpd-opts.texi@1.214 +1 -1
+ NTP_4_2_5P223
+
+ ntpd/ntpd.1@1.214 +2 -2
+ NTP_4_2_5P223
+
+ ntpdc/ntpdc-opts.c@1.212 +2 -2
+ NTP_4_2_5P223
+
+ ntpdc/ntpdc-opts.h@1.212 +3 -3
+ NTP_4_2_5P223
+
+ ntpdc/ntpdc-opts.texi@1.211 +1 -1
+ NTP_4_2_5P223
+
+ ntpdc/ntpdc.1@1.211 +2 -2
+ NTP_4_2_5P223
+
+ ntpq/ntpq-opts.c@1.212 +2 -2
+ NTP_4_2_5P223
+
+ ntpq/ntpq-opts.h@1.212 +3 -3
+ NTP_4_2_5P223
+
+ ntpq/ntpq-opts.texi@1.211 +1 -1
+ NTP_4_2_5P223
+
+ ntpq/ntpq.1@1.211 +2 -2
+ NTP_4_2_5P223
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.92 +2 -2
+ NTP_4_2_5P223
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.92 +3 -3
+ NTP_4_2_5P223
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.92 +1 -1
+ NTP_4_2_5P223
+
+ ntpsnmpd/ntpsnmpd.1@1.92 +2 -2
+ NTP_4_2_5P223
+
+ packageinfo.sh@1.226 +1 -1
+ NTP_4_2_5P223
+
+ sntp/sntp-opts.c@1.86 +2 -2
+ NTP_4_2_5P223
+
+ sntp/sntp-opts.h@1.86 +3 -3
+ NTP_4_2_5P223
+
+ sntp/sntp-opts.texi@1.86 +1 -1
+ NTP_4_2_5P223
+
+ sntp/sntp.1@1.86 +2 -2
+ NTP_4_2_5P223
+
+ util/ntp-keygen-opts.c@1.215 +2 -2
+ NTP_4_2_5P223
+
+ util/ntp-keygen-opts.h@1.215 +3 -3
+ NTP_4_2_5P223
+
+ util/ntp-keygen-opts.texi@1.214 +1 -1
+ NTP_4_2_5P223
+
+ util/ntp-keygen.1@1.214 +2 -2
+ NTP_4_2_5P223
+
+ChangeSet@1.2020.1.1, 2009-09-28 00:58:51+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1323] Implement "revoke #" to match documentation, deprecate
+ "crypto revoke #".
+
+ ChangeLog@1.453.1.1 +2 -0
+ [Bug 1323] Implement "revoke #" to match documentation, deprecate
+ "crypto revoke #".
+
+ ntpd/ntp_config.c@1.221 +4 -4
+ [Bug 1323] Implement "revoke #" to match documentation, deprecate
+ "crypto revoke #".
+
+ ntpd/ntp_parser.c@1.50 +675 -661
+ Bison output from ntp_parser.y
+
+ ntpd/ntp_parser.y@1.45 +6 -0
+ [Bug 1323] Implement "revoke #" to match documentation, deprecate
+ "crypto revoke #".
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.8 +2 -2
+ fix lingering references to $(OPENSSL)\lib to $(OPENSSL_LIB)
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.20 +2 -2
+ fix lingering references to $(OPENSSL)\lib to $(OPENSSL_LIB)
+
+ChangeSet@1.2021, 2009-09-27 20:24:13+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1321] build doesn't work if . isn't on $PATH.
+
+ ChangeLog@1.454 +1 -0
+ [Bug 1321] build doesn't work if . isn't on $PATH.
+
+ build@1.31 +6 -1
+ [Bug 1321] build doesn't work if . isn't on $PATH.
+
+ChangeSet@1.2020, 2009-09-27 15:31:58-04:00, stenn@whimsy.udel.edu
+ Hold off on the .deps cleanup for now
+
+ bootstrap@1.26 +13 -3
+ Hold off on the .deps cleanup for now
+
+ChangeSet@1.2019, 2009-09-27 07:50:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P222
+ TAG: NTP_4_2_5P222
+
+ ChangeLog@1.453 +1 -0
+ NTP_4_2_5P222
+
+ ntpd/ntpd-opts.c@1.215 +2 -2
+ NTP_4_2_5P222
+
+ ntpd/ntpd-opts.h@1.215 +3 -3
+ NTP_4_2_5P222
+
+ ntpd/ntpd-opts.texi@1.213 +1 -1
+ NTP_4_2_5P222
+
+ ntpd/ntpd.1@1.213 +2 -2
+ NTP_4_2_5P222
+
+ ntpdc/ntpdc-opts.c@1.211 +2 -2
+ NTP_4_2_5P222
+
+ ntpdc/ntpdc-opts.h@1.211 +3 -3
+ NTP_4_2_5P222
+
+ ntpdc/ntpdc-opts.texi@1.210 +1 -1
+ NTP_4_2_5P222
+
+ ntpdc/ntpdc.1@1.210 +2 -2
+ NTP_4_2_5P222
+
+ ntpq/ntpq-opts.c@1.211 +2 -2
+ NTP_4_2_5P222
+
+ ntpq/ntpq-opts.h@1.211 +3 -3
+ NTP_4_2_5P222
+
+ ntpq/ntpq-opts.texi@1.210 +1 -1
+ NTP_4_2_5P222
+
+ ntpq/ntpq.1@1.210 +2 -2
+ NTP_4_2_5P222
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.91 +2 -2
+ NTP_4_2_5P222
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.91 +3 -3
+ NTP_4_2_5P222
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.91 +1 -1
+ NTP_4_2_5P222
+
+ ntpsnmpd/ntpsnmpd.1@1.91 +2 -2
+ NTP_4_2_5P222
+
+ packageinfo.sh@1.225 +1 -1
+ NTP_4_2_5P222
+
+ sntp/sntp-opts.c@1.85 +2 -2
+ NTP_4_2_5P222
+
+ sntp/sntp-opts.h@1.85 +3 -3
+ NTP_4_2_5P222
+
+ sntp/sntp-opts.texi@1.85 +1 -1
+ NTP_4_2_5P222
+
+ sntp/sntp.1@1.85 +2 -2
+ NTP_4_2_5P222
+
+ util/ntp-keygen-opts.c@1.214 +2 -2
+ NTP_4_2_5P222
+
+ util/ntp-keygen-opts.h@1.214 +3 -3
+ NTP_4_2_5P222
+
+ util/ntp-keygen-opts.texi@1.213 +1 -1
+ NTP_4_2_5P222
+
+ util/ntp-keygen.1@1.213 +2 -2
+ NTP_4_2_5P222
+
+ChangeSet@1.2018, 2009-09-27 06:07:50-04:00, stenn@whimsy.udel.edu
+ Use find/xargs to remove .deps files
+
+ bootstrap@1.25 +1 -2
+ Use find/xargs to remove .deps files
+
+ChangeSet@1.2017, 2009-09-27 09:34:20+00:00, davehart@shiny.ad.hartbrothers.com
+ .del-Makefile.am~f0c497c686043766:
+ Delete: lib/isc/nothreads/include/isc/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~f0c497c686043766@1.2 +0 -0
+ Delete: lib/isc/nothreads/include/isc/Makefile.am
+
+ChangeSet@1.2011.1.3, 2009-09-27 05:22:57-04:00, stenn@whimsy.udel.edu
+ Remove unneeded Makefile.am files from lib/isc/include
+
+ BitKeeper/deleted/.del-Makefile.am~3d21d1b06f4d0a5e@1.1.1.1 +0 -0
+ Delete: lib/isc/unix/include/isc/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~5be91011328ee7b@1.9.1.1 +0 -0
+ Delete: lib/isc/include/isc/Makefile.am
+
+ ChangeLog@1.450.1.1 +1 -0
+ Remove unneeded Makefile.am files from lib/isc/include
+
+ Makefile.am@1.83.1.1 +0 -2
+ Remove unneeded Makefile.am files from lib/isc/include
+
+ configure.ac@1.455.1.1 +0 -2
+ Remove unneeded Makefile.am files from lib/isc/include
+
+ChangeSet@1.2014, 2009-09-27 06:53:59+00:00, davehart@shiny.ad.hartbrothers.com
+ Updated build and flock-build scripts. flock-build --one is a way
+ to perform a flock-build compatible solitary build, handy for a repo
+ clone's first build on a machine with autoconf, automake, etc.
+ Compiling ntp_parser.y using BSD make correctly places ntp_parser.h
+ in the top-level ntpd directory instead of A.*/ntpd.
+ bootstrap script updated to remove potentially stale .deps dirs.
+
+
+ ChangeLog@1.449.1.2 +6 -0
+ Updated build and flock-build scripts. flock-build --one is a way
+ to perform a flock-build compatible solitary build, handy for a repo
+ clone's first build on a machine with autoconf, automake, etc.
+ Compiling ntp_parser.y using BSD make correctly places ntp_parser.h
+ in the top-level ntpd directory instead of A.*/ntpd.
+ bootstrap script updated to remove potentially stale .deps dirs.
+
+
+ bootstrap@1.24 +8 -0
+ remove .deps directories to handle source code shuffles
+
+ build@1.30 +26 -19
+ store configure cache in top srcdir config.cache-{hostname}
+ so flock-build runs configure uncached once
+
+ flock-build@1.44 +54 -37
+ add --one option to invoke a single build on the invoking
+ host using flock-build's options to configure, useful to
+ bring a repo clone tree to a state like a tarball, ready
+ for flock-building on hosts without all dev tools (such
+ as autoconf, automake, bison).
+ update udel flock default LIST
+
+ ntpd/Makefile.am@1.70 +27 -1
+ introduce vphack_after rule to fix ntp_parser.h placement when
+ using build and BSD make. Thanks for Harlan's help on this.
+
+ChangeSet@1.2011.1.2, 2009-09-26 07:42:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P221
+ TAG: NTP_4_2_5P221
+
+ ChangeLog@1.450 +1 -0
+ NTP_4_2_5P221
+
+ ntpd/ntpd-opts.c@1.214 +2 -2
+ NTP_4_2_5P221
+
+ ntpd/ntpd-opts.h@1.214 +3 -3
+ NTP_4_2_5P221
+
+ ntpd/ntpd-opts.texi@1.212 +2 -2
+ NTP_4_2_5P221
+
+ ntpd/ntpd.1@1.212 +2 -2
+ NTP_4_2_5P221
+
+ ntpdc/ntpdc-opts.c@1.210 +2 -2
+ NTP_4_2_5P221
+
+ ntpdc/ntpdc-opts.h@1.210 +3 -3
+ NTP_4_2_5P221
+
+ ntpdc/ntpdc-opts.texi@1.209 +2 -2
+ NTP_4_2_5P221
+
+ ntpdc/ntpdc.1@1.209 +2 -2
+ NTP_4_2_5P221
+
+ ntpq/ntpq-opts.c@1.210 +2 -2
+ NTP_4_2_5P221
+
+ ntpq/ntpq-opts.h@1.210 +3 -3
+ NTP_4_2_5P221
+
+ ntpq/ntpq-opts.texi@1.209 +2 -2
+ NTP_4_2_5P221
+
+ ntpq/ntpq.1@1.209 +2 -2
+ NTP_4_2_5P221
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.90 +2 -2
+ NTP_4_2_5P221
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.90 +3 -3
+ NTP_4_2_5P221
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.90 +1 -1
+ NTP_4_2_5P221
+
+ ntpsnmpd/ntpsnmpd.1@1.90 +2 -2
+ NTP_4_2_5P221
+
+ packageinfo.sh@1.224 +1 -1
+ NTP_4_2_5P221
+
+ sntp/sntp-opts.c@1.84 +2 -2
+ NTP_4_2_5P221
+
+ sntp/sntp-opts.h@1.84 +3 -3
+ NTP_4_2_5P221
+
+ sntp/sntp-opts.texi@1.84 +2 -2
+ NTP_4_2_5P221
+
+ sntp/sntp.1@1.84 +2 -2
+ NTP_4_2_5P221
+
+ util/ntp-keygen-opts.c@1.213 +2 -2
+ NTP_4_2_5P221
+
+ util/ntp-keygen-opts.h@1.213 +3 -3
+ NTP_4_2_5P221
+
+ util/ntp-keygen-opts.texi@1.212 +2 -2
+ NTP_4_2_5P221
+
+ util/ntp-keygen.1@1.212 +2 -2
+ NTP_4_2_5P221
+
+ChangeSet@1.2010.1.1, 2009-09-26 03:55:56-04:00, murray@pogo.udel.edu
+ ChangeLog, refclock_nmea.c:
+ Fix for Bug 1316: segfault from refclock_nmea
+
+ ChangeLog@1.448 +1 -0
+ Fix for Bug 1316
+
+ ntpd/refclock_nmea.c@1.43 +4 -2
+ Fix for Bug 1316
+
+ChangeSet@1.2011, 2009-09-25 19:32:13-04:00, stenn@whimsy.udel.edu
+ [Bug 1317] Distribute cvo.sh
+
+ ChangeLog@1.447.1.1 +1 -0
+ [Bug 1317] Distribute cvo.sh
+
+ scripts/Makefile.am@1.16 +2 -2
+ [Bug 1317] Distribute cvo.sh
+
+ChangeSet@1.2004.2.1, 2009-09-25 19:30:24+00:00, davehart@shiny.ad.hartbrothers.com
+ correct a few overlooked bk mv's in upstream libisc repo related to
+ lib/isc/nothreads/include/isc
+
+ BitKeeper/deleted/.del-mutex.h~d46b831ccac8e078@1.2 +0 -0
+ Delete: lib/isc/nothreads/include/isc/mutex.h
+
+ BitKeeper/deleted/.del-once.h~79619f1c64fdf49b@1.2 +0 -0
+ Delete: lib/isc/nothreads/include/isc/once.h
+
+ BitKeeper/deleted/.del-strerror.c~5704d44@1.2.1.1 +0 -0
+ Delete: ports/winnt/libntp/strerror.c
+
+ lib/isc/nothreads/include/isc/mutex.h@1.3.1.2 +10 -10
+ correct a few overlooked bk mv's in upstream libisc repo related to
+ lib/isc/nothreads/include/isc
+
+ lib/isc/nothreads/include/isc/mutex.h@1.3.1.1 +0 -0
+ Rename: lib/isc/include/isc/mutex.h -> lib/isc/nothreads/include/isc/mutex.h
+
+ lib/isc/nothreads/include/isc/once.h@1.3.1.2 +10 -10
+ correct a few overlooked bk mv's in upstream libisc repo related to
+ lib/isc/nothreads/include/isc
+
+ lib/isc/nothreads/include/isc/once.h@1.3.1.1 +0 -0
+ Rename: lib/isc/include/isc/once.h -> lib/isc/nothreads/include/isc/once.h
+
+ChangeSet@1.2004.1.3, 2009-09-25 19:17:24+00:00, davehart@shiny.ad.hartbrothers.com
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ BitKeeper/deleted/.del-mutex.h~cf2fbab1@1.4 +0 -0
+ Rename: lib/isc/include/isc/mutex.h -> BitKeeper/deleted/.del-mutex.h~cf2fbab1
+
+ BitKeeper/deleted/.del-once.h~cfad354a@1.4 +0 -0
+ Rename: lib/isc/include/isc/once.h -> BitKeeper/deleted/.del-once.h~cfad354a
+
+ BitKeeper/deleted/.del-strerror.c~5704d44@1.3 +0 -0
+ Rename: ports/winnt/libntp/strerror.c -> BitKeeper/deleted/.del-strerror.c~5704d44
+
+ ChangeLog@1.443.1.1 +6 -0
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ Makefile.am@1.82.1.1 +2 -1
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ configure.ac@1.456 +1 -0
+ add reference to lib/isc/nothreads/include/isc/Makefile.am
+
+ lib/isc/include/isc/Makefile.am@1.10 +71 -30
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ lib/isc/include/isc/interfaceiter.h@1.7 +3 -0
+ add NTP-local broadcast address, broadcast & multicast bitflags
+ to libisc network interface iterator
+
+ lib/isc/include/isc/msgs.h@1.6 +1 -0
+ add ISC_MSG_GETBCSTADDR used by NTP-local interface iterator changes
+
+ lib/isc/inet_ntop.c@1.8 +6 -2
+ use ntp_snprintf.h's SNPRINTF for SunOS 4 compat
+
+ lib/isc/nothreads/include/isc/Makefile.am@1.1 +12 -0
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ lib/isc/nothreads/include/isc/Makefile.am@1.0 +0 -0
+
+ lib/isc/sockaddr.c@1.9 +1 -1
+ cast to silence warning
+
+ lib/isc/unix/ifiter_getifaddrs.c@1.8 +14 -1
+ add NTP-local broadcast address, broadcast & multicast bitflags
+ to libisc network interface iterator
+
+ lib/isc/unix/ifiter_ioctl.c@1.28 +76 -0
+ add NTP-local broadcast address, broadcast & multicast bitflags
+ to libisc network interface iterator
+
+ lib/isc/unix/ifiter_sysctl.c@1.15 +13 -0
+ add NTP-local broadcast address, broadcast & multicast bitflags
+ to libisc network interface iterator
+
+ lib/isc/unix/include/isc/Makefile.am@1.2 +12 -8
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ lib/isc/unix/net.c@1.13 +2 -2
+ NTP-local change, use GETSOCKNAME_SOCKLEN_TYPE
+
+ lib/isc/unix/strerror.c@1.6 +2 -0
+ NTP local change, #include "l_stdlib.h"
+
+ lib/isc/win32/include/isc/platform.h@1.6 +20 -11
+ NTP-local change, disable __declspec(dllimport) for libisc public
+ interfaces with #define ISC_STATIC_WIN
+
+ lib/isc/win32/include/isc/stat.h@1.4 +15 -0
+ NTP-local changes: alias more identifiers from POSIX names to Microsoft's,
+ with leading underscores, so libopts builds on Windows
+
+ lib/isc/win32/include/isc/thread.h@1.2 +1 -1
+ NTP-local fix type, silence warning
+
+ lib/isc/win32/interfaceiter.c@1.10.1.3 +36 -1
+ add NTP-local broadcast address, broadcast & multicast bitflags
+ to libisc network interface iterator
+
+ lib/isc/win32/net.c@1.12 +3 -3
+ NTP-local changes fix closeocket(s) typo, silence two warnings with casts
+
+ lib/isc/win32/strerror.c@1.11 +15 -10
+ NTP-local changes: use CRT_strerror() not strerror() to avoid our
+ #define strerror, do not reference _sys_nerr when calling strerror()
+ will do and avoids a deprecation warning for _sys_nerr
+
+ lib/isc/win32/thread.c@1.2 +7 -3
+ NTP-local change, handle 64-bit isc_threadresult_t correctly
+
+ libntp/Makefile.am@1.45 +44 -19
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ libparse/Makefile.am@1.14 +9 -6
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ ntpd/Makefile.am@1.69 +9 -7
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ ntpd/ntp_io.c@1.297.1.1 +54 -11
+ libisc network interface iterator now requires a mctx, build one
+ on top of emalloc()
+
+ ntpdate/Makefile.am@1.18 +4 -3
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ ntpdc/Makefile.am@1.41 +5 -4
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ ntpq/Makefile.am@1.35 +5 -4
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ ntpsnmpd/Makefile.am@1.9 +7 -6
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ parseutil/Makefile.am@1.9 +4 -3
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ ports/winnt/include/config.h@1.77 +9 -2
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/libntp/syslog.c@1.6 +28 -1
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/ntpd/ntservice.c@1.18 +4 -14
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/ntpd/win32_io.c@1.19 +1 -0
+ #include <io.h> to quiet warning about _open_osfhandle
+
+ ports/winnt/vc6/libntp.dsp@1.43 +38 -2
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/vc6/ntpd.dsp@1.39 +5 -5
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/vs2003/libntp.vcproj@1.4 +98 -47
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/vs2003/ntpd.vcproj@1.4 +5 -5
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/vs2005/libntp.vcproj@1.4 +102 -46
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/vs2005/ntpd.vcproj@1.4 +5 -5
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.19 +102 -1358
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.19 +6 -6
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream, reapply NTP-local changes.
+
+ sntp/Makefile.am@1.12 +5 -4
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ sntp/main.c@1.19 +2 -2
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ util/Makefile.am@1.40 +5 -4
+ Update libisc from bind-9.6.1-P1.tar.gz, rearrange directory layout
+ to match upstream
+
+ChangeSet@1.2008.1.1, 2009-09-25 15:48:47+00:00, davehart@shiny.ad.hartbrothers.com
+ Makefile.am: correct EXTRA_DIST reference from libisc to lib/isc
+
+ Makefile.am@1.83 +1 -1
+ correct EXTRA_DIST reference from libisc to lib/isc
+
+ChangeSet@1.2009, 2009-09-25 07:47:32-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P220
+ TAG: NTP_4_2_5P220
+
+ ChangeLog@1.447 +1 -0
+ NTP_4_2_5P220
+
+ ntpd/ntpd-opts.c@1.213 +2 -2
+ NTP_4_2_5P220
+
+ ntpd/ntpd-opts.h@1.213 +3 -3
+ NTP_4_2_5P220
+
+ ntpd/ntpd-opts.texi@1.211 +1 -1
+ NTP_4_2_5P220
+
+ ntpd/ntpd.1@1.211 +2 -2
+ NTP_4_2_5P220
+
+ ntpdc/ntpdc-opts.c@1.209 +2 -2
+ NTP_4_2_5P220
+
+ ntpdc/ntpdc-opts.h@1.209 +3 -3
+ NTP_4_2_5P220
+
+ ntpdc/ntpdc-opts.texi@1.208 +1 -1
+ NTP_4_2_5P220
+
+ ntpdc/ntpdc.1@1.208 +2 -2
+ NTP_4_2_5P220
+
+ ntpq/ntpq-opts.c@1.209 +2 -2
+ NTP_4_2_5P220
+
+ ntpq/ntpq-opts.h@1.209 +3 -3
+ NTP_4_2_5P220
+
+ ntpq/ntpq-opts.texi@1.208 +1 -1
+ NTP_4_2_5P220
+
+ ntpq/ntpq.1@1.208 +2 -2
+ NTP_4_2_5P220
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.89 +2 -2
+ NTP_4_2_5P220
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.89 +3 -3
+ NTP_4_2_5P220
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.89 +1 -1
+ NTP_4_2_5P220
+
+ ntpsnmpd/ntpsnmpd.1@1.89 +2 -2
+ NTP_4_2_5P220
+
+ packageinfo.sh@1.223 +1 -1
+ NTP_4_2_5P220
+
+ sntp/sntp-opts.c@1.83 +2 -2
+ NTP_4_2_5P220
+
+ sntp/sntp-opts.h@1.83 +3 -3
+ NTP_4_2_5P220
+
+ sntp/sntp-opts.texi@1.83 +1 -1
+ NTP_4_2_5P220
+
+ sntp/sntp.1@1.83 +2 -2
+ NTP_4_2_5P220
+
+ util/ntp-keygen-opts.c@1.212 +2 -2
+ NTP_4_2_5P220
+
+ util/ntp-keygen-opts.h@1.212 +3 -3
+ NTP_4_2_5P220
+
+ util/ntp-keygen-opts.texi@1.211 +1 -1
+ NTP_4_2_5P220
+
+ util/ntp-keygen.1@1.211 +2 -2
+ NTP_4_2_5P220
+
+ChangeSet@1.2008, 2009-09-25 07:09:49+00:00, davehart@shiny.ad.hartbrothers.com
+ Rearrange libisc code to match the upstream layout in BIND. This is
+ step one of two, changing the layout but keeping our existing libisc.
+
+ ChangeLog@1.446 +2 -0
+ Rearrange libisc code to match the upstream layout in BIND. This is
+ step one of two, changing the layout but keeping our existing libisc.
+
+ChangeSet@1.2004.1.2, 2009-09-24 15:52:46+00:00, davehart@shiny.ad.hartbrothers.com
+ import unmodified lib/isc from ISC bind-9.6.1-P1.tar.gz
+
+ lib/isc/alpha/include/isc/atomic.h@1.1 +184 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/alpha/include/isc/atomic.h@1.0 +0 -0
+
+ lib/isc/api@1.1 +3 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/api@1.0 +0 -0
+
+ lib/isc/assertions.c@1.4 +17 -13
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/base32.c@1.1 +371 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/base32.c@1.0 +0 -0
+
+ lib/isc/base64.c@1.1 +250 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/base64.c@1.0 +0 -0
+
+ lib/isc/bitstring.c@1.1 +127 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/bitstring.c@1.0 +0 -0
+
+ lib/isc/buffer.c@1.1 +489 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/buffer.c@1.0 +0 -0
+
+ lib/isc/bufferlist.c@1.1 +64 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/bufferlist.c@1.0 +0 -0
+
+ lib/isc/commandline.c@1.1 +225 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/commandline.c@1.0 +0 -0
+
+ lib/isc/entropy.c@1.1 +1274 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/entropy.c@1.0 +0 -0
+
+ lib/isc/error.c@1.4 +15 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/event.c@1.1 +88 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/event.c@1.0 +0 -0
+
+ lib/isc/fsaccess.c@1.1 +102 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/fsaccess.c@1.0 +0 -0
+
+ lib/isc/hash.c@1.1 +390 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/hash.c@1.0 +0 -0
+
+ lib/isc/heap.c@1.1 +262 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/heap.c@1.0 +0 -0
+
+ lib/isc/hex.c@1.1 +201 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/hex.c@1.0 +0 -0
+
+ lib/isc/hmacmd5.c@1.1 +118 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/hmacmd5.c@1.0 +0 -0
+
+ lib/isc/hmacsha.c@1.1 +438 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/hmacsha.c@1.0 +0 -0
+
+ lib/isc/httpd.c@1.1 +987 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/httpd.c@1.0 +0 -0
+
+ lib/isc/ia64/include/isc/atomic.h@1.1 +100 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/ia64/include/isc/atomic.h@1.0 +0 -0
+
+ lib/isc/include/isc/app.h@1.4 +57 -57
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/assertions.h@1.4 +16 -12
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/base32.h@1.1 +128 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/base32.h@1.0 +0 -0
+
+ lib/isc/include/isc/base64.h@1.1 +99 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/base64.h@1.0 +0 -0
+
+ lib/isc/include/isc/bitstring.h@1.1 +157 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/bitstring.h@1.0 +0 -0
+
+ lib/isc/include/isc/boolean.h@1.4 +12 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/buffer.h@1.4 +251 -147
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/bufferlist.h@1.1 +86 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/bufferlist.h@1.0 +0 -0
+
+ lib/isc/include/isc/commandline.h@1.1 +50 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/commandline.h@1.0 +0 -0
+
+ lib/isc/include/isc/entropy.h@1.1 +314 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/entropy.h@1.0 +0 -0
+
+ lib/isc/include/isc/error.h@1.4 +17 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/event.h@1.1 +121 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/event.h@1.0 +0 -0
+
+ lib/isc/include/isc/eventclass.h@1.1 +53 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/eventclass.h@1.0 +0 -0
+
+ lib/isc/include/isc/file.h@1.4 +8 -8
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/formatcheck.h@1.4 +20 -14
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/fsaccess.h@1.1 +178 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/fsaccess.h@1.0 +0 -0
+
+ lib/isc/include/isc/hash.h@1.1 +185 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/hash.h@1.0 +0 -0
+
+ lib/isc/include/isc/heap.h@1.1 +170 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/heap.h@1.0 +0 -0
+
+ lib/isc/include/isc/hex.h@1.1 +98 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/hex.h@1.0 +0 -0
+
+ lib/isc/include/isc/hmacmd5.h@1.1 +63 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/hmacmd5.h@1.0 +0 -0
+
+ lib/isc/include/isc/hmacsha.h@1.1 +156 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/hmacsha.h@1.0 +0 -0
+
+ lib/isc/include/isc/httpd.h@1.1 +64 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/httpd.h@1.0 +0 -0
+
+ lib/isc/include/isc/interfaceiter.h@1.6 +46 -50
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/ipv6.h@1.9 +22 -29
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/iterated_hash.h@1.1 +47 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/iterated_hash.h@1.0 +0 -0
+
+ lib/isc/include/isc/lang.h@1.4 +12 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/lex.h@1.1 +431 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/lex.h@1.0 +0 -0
+
+ lib/isc/include/isc/lfsr.h@1.1 +130 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/lfsr.h@1.0 +0 -0
+
+ lib/isc/include/isc/lib.h@1.4 +14 -12
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/list.h@1.4 +17 -13
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/log.h@1.3 +15 -14
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/magic.h@1.4 +13 -12
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/mem.h@1.5 +612 -19
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/msgcat.h@1.4 +33 -34
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/msgs.h@1.5 +137 -126
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/mutexblock.h@1.1 +71 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/mutexblock.h@1.0 +0 -0
+
+ lib/isc/include/isc/netaddr.h@1.6 +58 -27
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/netscope.h@1.3 +9 -6
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/ondestroy.h@1.1 +116 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/ondestroy.h@1.0 +0 -0
+
+ lib/isc/include/isc/os.h@1.1 +38 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/os.h@1.0 +0 -0
+
+ lib/isc/include/isc/parseint.h@1.1 +64 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/parseint.h@1.0 +0 -0
+
+ lib/isc/include/isc/platform.h.in@1.1 +339 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/platform.h.in@1.0 +0 -0
+
+ lib/isc/include/isc/portset.h@1.1 +141 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/portset.h@1.0 +0 -0
+
+ lib/isc/include/isc/print.h@1.4 +31 -13
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/quota.h@1.1 +119 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/quota.h@1.0 +0 -0
+
+ lib/isc/include/isc/radix.h@1.1 +240 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/radix.h@1.0 +0 -0
+
+ lib/isc/include/isc/random.h@1.1 +62 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/random.h@1.0 +0 -0
+
+ lib/isc/include/isc/ratelimiter.h@1.1 +134 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/ratelimiter.h@1.0 +0 -0
+
+ lib/isc/include/isc/refcount.h@1.1 +233 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/refcount.h@1.0 +0 -0
+
+ lib/isc/include/isc/region.h@1.3 +14 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/resource.h@1.1 +97 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/resource.h@1.0 +0 -0
+
+ lib/isc/include/isc/result.h@1.5 +69 -68
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/resultclass.h@1.1 +50 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/resultclass.h@1.0 +0 -0
+
+ lib/isc/include/isc/rwlock.h@1.1 +135 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/rwlock.h@1.0 +0 -0
+
+ lib/isc/include/isc/serial.h@1.1 +75 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/serial.h@1.0 +0 -0
+
+ lib/isc/include/isc/sha1.h@1.1 +59 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/sha1.h@1.0 +0 -0
+
+ lib/isc/include/isc/sha2.h@1.1 +132 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/sha2.h@1.0 +0 -0
+
+ lib/isc/include/isc/sockaddr.h@1.5 +83 -44
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/socket.h@1.1 +1007 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/socket.h@1.0 +0 -0
+
+ lib/isc/include/isc/stats.h@1.1 +121 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/stats.h@1.0 +0 -0
+
+ lib/isc/include/isc/stdio.h@1.3 +4 -4
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/stdlib.h@1.1 +40 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/stdlib.h@1.0 +0 -0
+
+ lib/isc/include/isc/string.h@1.4 +188 -13
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/symtab.h@1.1 +131 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/symtab.h@1.0 +0 -0
+
+ lib/isc/include/isc/task.h@1.1 +624 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/task.h@1.0 +0 -0
+
+ lib/isc/include/isc/taskpool.h@1.1 +105 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/taskpool.h@1.0 +0 -0
+
+ lib/isc/include/isc/timer.h@1.1 +344 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/timer.h@1.0 +0 -0
+
+ lib/isc/include/isc/types.h@1.4 +81 -59
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/util.h@1.4 +26 -18
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/version.h@1.1 +28 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/version.h@1.0 +0 -0
+
+ lib/isc/include/isc/xml.h@1.1 +41 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/include/isc/xml.h@1.0 +0 -0
+
+ lib/isc/inet_aton.c@1.4 +9 -8
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/inet_ntop.c@1.7 +25 -31
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/inet_pton.c@1.4 +34 -37
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/iterated_hash.c@1.1 +48 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/iterated_hash.c@1.0 +0 -0
+
+ lib/isc/lex.c@1.1 +959 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/lex.c@1.0 +0 -0
+
+ lib/isc/lfsr.c@1.1 +161 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/lfsr.c@1.0 +0 -0
+
+ lib/isc/lib.c@1.4 +13 -11
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/log.c@1.3 +15 -15
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/mem.c@1.5 +2181 -23
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/mips/include/isc/atomic.h@1.1 +98 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/mips/include/isc/atomic.h@1.0 +0 -0
+
+ lib/isc/mutexblock.c@1.1 +59 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/mutexblock.c@1.0 +0 -0
+
+ lib/isc/netaddr.c@1.6 +83 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/netscope.c@1.3 +5 -3
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nls/msgcat.c@1.6 +14 -13
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/noatomic/include/isc/atomic.h@1.1 +24 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/noatomic/include/isc/atomic.h@1.0 +0 -0
+
+ lib/isc/nothreads/condition.c@1.1 +24 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nothreads/condition.c@1.0 +0 -0
+
+ lib/isc/nothreads/include/isc/condition.h@1.1 +59 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nothreads/include/isc/condition.h@1.0 +0 -0
+
+ lib/isc/nothreads/include/isc/mutex.h@1.1 +39 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nothreads/include/isc/mutex.h@1.0 +0 -0
+
+ lib/isc/nothreads/include/isc/once.h@1.1 +32 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nothreads/include/isc/once.h@1.0 +0 -0
+
+ lib/isc/nothreads/include/isc/thread.h@1.1 +35 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nothreads/include/isc/thread.h@1.0 +0 -0
+
+ lib/isc/nothreads/mutex.c@1.1 +25 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nothreads/mutex.c@1.0 +0 -0
+
+ lib/isc/nothreads/thread.c@1.1 +28 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/nothreads/thread.c@1.0 +0 -0
+
+ lib/isc/ondestroy.c@1.1 +85 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/ondestroy.c@1.0 +0 -0
+
+ lib/isc/parseint.c@1.1 +72 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/parseint.c@1.0 +0 -0
+
+ lib/isc/portset.c@1.1 +143 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/portset.c@1.0 +0 -0
+
+ lib/isc/powerpc/include/isc/atomic.h@1.1 +160 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/powerpc/include/isc/atomic.h@1.0 +0 -0
+
+ lib/isc/print.c@1.1 +624 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/print.c@1.0 +0 -0
+
+ lib/isc/pthreads/condition.c@1.1 +74 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/pthreads/condition.c@1.0 +0 -0
+
+ lib/isc/pthreads/include/isc/condition.h@1.1 +65 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/pthreads/include/isc/condition.h@1.0 +0 -0
+
+ lib/isc/pthreads/include/isc/mutex.h@1.1 +145 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/pthreads/include/isc/mutex.h@1.0 +0 -0
+
+ lib/isc/pthreads/include/isc/once.h@1.1 +50 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/pthreads/include/isc/once.h@1.0 +0 -0
+
+ lib/isc/pthreads/include/isc/thread.h@1.1 +60 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/pthreads/include/isc/thread.h@1.0 +0 -0
+
+ lib/isc/pthreads/mutex.c@1.1 +272 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/pthreads/mutex.c@1.0 +0 -0
+
+ lib/isc/pthreads/thread.c@1.1 +76 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/pthreads/thread.c@1.0 +0 -0
+
+ lib/isc/quota.c@1.1 +101 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/quota.c@1.0 +0 -0
+
+ lib/isc/radix.c@1.1 +706 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/radix.c@1.0 +0 -0
+
+ lib/isc/random.c@1.1 +104 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/random.c@1.0 +0 -0
+
+ lib/isc/ratelimiter.c@1.1 +328 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/ratelimiter.c@1.0 +0 -0
+
+ lib/isc/refcount.c@1.1 +37 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/refcount.c@1.0 +0 -0
+
+ lib/isc/region.c@1.1 +45 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/region.c@1.0 +0 -0
+
+ lib/isc/result.c@1.1 +213 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/result.c@1.0 +0 -0
+
+ lib/isc/rwlock.c@1.1 +808 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/rwlock.c@1.0 +0 -0
+
+ lib/isc/serial.c@1.1 +59 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/serial.c@1.0 +0 -0
+
+ lib/isc/sha1.c@1.1 +315 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/sha1.c@1.0 +0 -0
+
+ lib/isc/sha2.c@1.1 +1234 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/sha2.c@1.0 +0 -0
+
+ lib/isc/sockaddr.c@1.8 +87 -64
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/sparc64/include/isc/atomic.h@1.1 +127 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/sparc64/include/isc/atomic.h@1.0 +0 -0
+
+ lib/isc/stats.c@1.1 +326 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/stats.c@1.0 +0 -0
+
+ lib/isc/string.c@1.1 +270 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/string.c@1.0 +0 -0
+
+ lib/isc/strtoul.c@1.1 +129 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/strtoul.c@1.0 +0 -0
+
+ lib/isc/symtab.c@1.1 +252 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/symtab.c@1.0 +0 -0
+
+ lib/isc/task.c@1.1 +1376 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/task.c@1.0 +0 -0
+
+ lib/isc/task_p.h@1.1 +31 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/task_p.h@1.0 +0 -0
+
+ lib/isc/taskpool.c@1.1 +96 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/taskpool.c@1.0 +0 -0
+
+ lib/isc/timer.c@1.1 +933 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/timer.c@1.0 +0 -0
+
+ lib/isc/timer_p.h@1.1 +31 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/timer_p.h@1.0 +0 -0
+
+ lib/isc/unix/app.c@1.1 +684 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/app.c@1.0 +0 -0
+
+ lib/isc/unix/dir.c@1.1 +251 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/dir.c@1.0 +0 -0
+
+ lib/isc/unix/entropy.c@1.1 +605 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/entropy.c@1.0 +0 -0
+
+ lib/isc/unix/errno2result.c@1.1 +123 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/errno2result.c@1.0 +0 -0
+
+ lib/isc/unix/errno2result.h@1.1 +39 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/errno2result.h@1.0 +0 -0
+
+ lib/isc/unix/file.c@1.1 +444 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/file.c@1.0 +0 -0
+
+ lib/isc/unix/fsaccess.c@1.1 +93 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/fsaccess.c@1.0 +0 -0
+
+ lib/isc/unix/ifiter_getifaddrs.c@1.7 +72 -29
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/ifiter_ioctl.c@1.27 +49 -236
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/ifiter_sysctl.c@1.14 +6 -19
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/dir.h@1.3 +3 -3
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/int.h@1.4 +13 -11
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/keyboard.h@1.1 +52 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/keyboard.h@1.0 +0 -0
+
+ lib/isc/unix/include/isc/net.h@1.10 +91 -56
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/netdb.h@1.1 +57 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/netdb.h@1.0 +0 -0
+
+ lib/isc/unix/include/isc/offset.h@1.4 +14 -12
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/stat.h@1.3 +3 -3
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/stdtime.h@1.1 +60 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/stdtime.h@1.0 +0 -0
+
+ lib/isc/unix/include/isc/strerror.h@1.4 +15 -12
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/syslog.h@1.1 +47 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/include/isc/syslog.h@1.0 +0 -0
+
+ lib/isc/unix/include/isc/time.h@1.3 +40 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/interfaceiter.c@1.17 +99 -7
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/ipv6.c@1.1 +27 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/ipv6.c@1.0 +0 -0
+
+ lib/isc/unix/keyboard.c@1.1 +126 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/keyboard.c@1.0 +0 -0
+
+ lib/isc/unix/net.c@1.12 +232 -19
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/os.c@1.1 +94 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/os.c@1.0 +0 -0
+
+ lib/isc/unix/resource.c@1.1 +231 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/resource.c@1.0 +0 -0
+
+ lib/isc/unix/socket.c@1.1 +5550 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/socket.c@1.0 +0 -0
+
+ lib/isc/unix/socket_p.h@1.1 +32 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/socket_p.h@1.0 +0 -0
+
+ lib/isc/unix/stdio.c@1.1 +117 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/stdio.c@1.0 +0 -0
+
+ lib/isc/unix/stdtime.c@1.1 +86 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/stdtime.c@1.0 +0 -0
+
+ lib/isc/unix/strerror.c@1.5 +15 -15
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/syslog.c@1.1 +84 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/syslog.c@1.0 +0 -0
+
+ lib/isc/unix/time.c@1.1 +438 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/unix/time.c@1.0 +0 -0
+
+ lib/isc/version.c@1.1 +28 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/version.c@1.0 +0 -0
+
+ lib/isc/win32/DLLMain.c@1.1 +58 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/DLLMain.c@1.0 +0 -0
+
+ lib/isc/win32/app.c@1.1 +260 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/app.c@1.0 +0 -0
+
+ lib/isc/win32/condition.c@1.1 +258 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/condition.c@1.0 +0 -0
+
+ lib/isc/win32/dir.c@1.1 +312 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/dir.c@1.0 +0 -0
+
+ lib/isc/win32/entropy.c@1.1 +307 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/entropy.c@1.0 +0 -0
+
+ lib/isc/win32/errno2result.c@1.1 +113 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/errno2result.c@1.0 +0 -0
+
+ lib/isc/win32/errno2result.h@1.1 +40 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/errno2result.h@1.0 +0 -0
+
+ lib/isc/win32/file.c@1.1 +507 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/file.c@1.0 +0 -0
+
+ lib/isc/win32/fsaccess.c@1.1 +375 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/fsaccess.c@1.0 +0 -0
+
+ lib/isc/win32/include/isc/bind_registry.h@1.1 +50 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/bind_registry.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/bindevt.h@1.1 +91 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/bindevt.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/condition.h@1.1 +67 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/condition.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/dir.h@1.1 +83 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/dir.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/int.h@1.4 +10 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/ipv6.h@1.8 +10 -15
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/keyboard.h@1.1 +47 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/keyboard.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/mutex.h@1.4 +17 -13
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/netdb.h@1.1 +54 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/netdb.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/ntgroups.h@1.1 +35 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/ntgroups.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/ntpaths.h@1.1 +71 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/ntpaths.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/offset.h@1.4 +11 -12
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/once.h@1.4 +10 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/platform.h@1.5 +26 -23
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/stat.h@1.3 +3 -23
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/stdtime.h@1.1 +58 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/stdtime.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/strerror.h@1.4 +10 -10
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/syslog.h@1.1 +45 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/syslog.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/thread.h@1.1 +100 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/thread.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/time.h@1.1 +291 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/include/isc/time.h@1.0 +0 -0
+
+ lib/isc/win32/include/isc/win32os.h@1.4 +11 -11
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/interfaceiter.c@1.10.1.2 +11 -45
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/ipv6.c@1.1 +27 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/ipv6.c@1.0 +0 -0
+
+ lib/isc/win32/keyboard.c@1.1 +89 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/keyboard.c@1.0 +0 -0
+
+ lib/isc/win32/libisc.def@1.1 +551 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/libisc.def@1.0 +0 -0
+
+ lib/isc/win32/libisc.dsp@1.1 +784 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/libisc.dsp@1.0 +0 -0
+
+ lib/isc/win32/libisc.dsw@1.1 +29 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/libisc.dsw@1.0 +0 -0
+
+ lib/isc/win32/libisc.mak@1.1 +2006 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/libisc.mak@1.0 +0 -0
+
+ lib/isc/win32/net.c@1.11 +4 -4
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/netdb.h@1.1 +187 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/netdb.h@1.0 +0 -0
+
+ lib/isc/win32/ntgroups.c@1.1 +186 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/ntgroups.c@1.0 +0 -0
+
+ lib/isc/win32/ntpaths.c@1.1 +140 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/ntpaths.c@1.0 +0 -0
+
+ lib/isc/win32/once.c@1.4 +15 -12
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/os.c@1.1 +45 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/os.c@1.0 +0 -0
+
+ lib/isc/win32/resource.c@1.1 +72 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/resource.c@1.0 +0 -0
+
+ lib/isc/win32/socket.c@1.1 +3674 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/socket.c@1.0 +0 -0
+
+ lib/isc/win32/stdio.c@1.1 +117 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/stdio.c@1.0 +0 -0
+
+ lib/isc/win32/stdtime.c@1.1 +37 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/stdtime.c@1.0 +0 -0
+
+ lib/isc/win32/strerror.c@1.10 +71 -221
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/syslog.c@1.1 +181 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/syslog.c@1.0 +0 -0
+
+ lib/isc/win32/syslog.h@1.1 +76 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/syslog.h@1.0 +0 -0
+
+ lib/isc/win32/thread.c@1.1 +90 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/thread.c@1.0 +0 -0
+
+ lib/isc/win32/time.c@1.1 +295 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/time.c@1.0 +0 -0
+
+ lib/isc/win32/unistd.h@1.1 +53 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/unistd.h@1.0 +0 -0
+
+ lib/isc/win32/version.c@1.1 +28 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/win32/version.c@1.0 +0 -0
+
+ lib/isc/win32/win32os.c@1.4 +11 -11
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/x86_32/include/isc/atomic.h@1.1 +176 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/x86_32/include/isc/atomic.h@1.0 +0 -0
+
+ lib/isc/x86_64/include/isc/atomic.h@1.1 +123 -0
+ bind-9.6.1-P1.tar.gz
+
+ lib/isc/x86_64/include/isc/atomic.h@1.0 +0 -0
+
+ChangeSet@1.2006, 2009-09-24 07:52:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P219
+ TAG: NTP_4_2_5P219
+
+ ChangeLog@1.445 +1 -0
+ NTP_4_2_5P219
+
+ ntpd/ntpd-opts.c@1.212 +2 -2
+ NTP_4_2_5P219
+
+ ntpd/ntpd-opts.h@1.212 +3 -3
+ NTP_4_2_5P219
+
+ ntpd/ntpd-opts.texi@1.210 +1 -1
+ NTP_4_2_5P219
+
+ ntpd/ntpd.1@1.210 +2 -2
+ NTP_4_2_5P219
+
+ ntpdc/ntpdc-opts.c@1.208 +2 -2
+ NTP_4_2_5P219
+
+ ntpdc/ntpdc-opts.h@1.208 +3 -3
+ NTP_4_2_5P219
+
+ ntpdc/ntpdc-opts.texi@1.207 +1 -1
+ NTP_4_2_5P219
+
+ ntpdc/ntpdc.1@1.207 +2 -2
+ NTP_4_2_5P219
+
+ ntpq/ntpq-opts.c@1.208 +2 -2
+ NTP_4_2_5P219
+
+ ntpq/ntpq-opts.h@1.208 +3 -3
+ NTP_4_2_5P219
+
+ ntpq/ntpq-opts.texi@1.207 +1 -1
+ NTP_4_2_5P219
+
+ ntpq/ntpq.1@1.207 +2 -2
+ NTP_4_2_5P219
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.88 +2 -2
+ NTP_4_2_5P219
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.88 +3 -3
+ NTP_4_2_5P219
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.88 +1 -1
+ NTP_4_2_5P219
+
+ ntpsnmpd/ntpsnmpd.1@1.88 +2 -2
+ NTP_4_2_5P219
+
+ packageinfo.sh@1.222 +1 -1
+ NTP_4_2_5P219
+
+ sntp/sntp-opts.c@1.82 +2 -2
+ NTP_4_2_5P219
+
+ sntp/sntp-opts.h@1.82 +3 -3
+ NTP_4_2_5P219
+
+ sntp/sntp-opts.texi@1.82 +1 -1
+ NTP_4_2_5P219
+
+ sntp/sntp.1@1.82 +2 -2
+ NTP_4_2_5P219
+
+ util/ntp-keygen-opts.c@1.211 +2 -2
+ NTP_4_2_5P219
+
+ util/ntp-keygen-opts.h@1.211 +3 -3
+ NTP_4_2_5P219
+
+ util/ntp-keygen-opts.texi@1.210 +1 -1
+ NTP_4_2_5P219
+
+ util/ntp-keygen.1@1.210 +2 -2
+ NTP_4_2_5P219
+
+ChangeSet@1.2004.1.1, 2009-09-24 07:27:15+00:00, davehart@shiny.ad.hartbrothers.com
+ Reorganize our copy of libisc code to match BIND 9 tarball layout, preparing
+ for easier drop-in of newer libisc code in the future via a
+ "ntp-dev-libisc-upstream" repo which gets only unmodified ISC source, and is
+ pulled into ntp-dev allowing BK to assist with the merge of local changes in
+ the future.
+
+ BitKeeper/deleted/.del-interfaceiter.c~554505c@1.4 +0 -0
+ Rename: ports/winnt/libntp/interfaceiter.c -> BitKeeper/deleted/.del-interfaceiter.c~554505c
+
+ BitKeeper/deleted/.del-strerror.c~7b58fc6b@1.3 +0 -0
+ Rename: libisc/strerror.c -> BitKeeper/deleted/.del-strerror.c~7b58fc6b
+
+ Makefile.am@1.82 +7 -4
+ out with include/isc, in with lib/isc/include/isc and
+ lib/isc/unix/include/isc
+
+ configure.ac@1.455 +2 -1
+ out with include/isc, in with lib/isc/include/isc and
+ lib/isc/unix/include/isc
+
+ include/Makefile.am@1.35 +0 -2
+ out with include/isc, in with lib/isc/include/isc and
+ lib/isc/unix/include/isc
+
+ lib/isc/assertions.c@1.3 +0 -0
+ Rename: libisc/assertions.c -> lib/isc/assertions.c
+
+ lib/isc/error.c@1.3 +0 -0
+ Rename: libisc/error.c -> lib/isc/error.c
+
+ lib/isc/include/isc/Makefile.am@1.9 +3 -8
+ out with include/isc, in with lib/isc/include/isc and
+ lib/isc/unix/include/isc
+
+ lib/isc/include/isc/Makefile.am@1.8 +0 -0
+ Rename: include/isc/Makefile.am -> lib/isc/include/isc/Makefile.am
+
+ lib/isc/include/isc/app.h@1.3 +0 -0
+ Rename: include/isc/app.h -> lib/isc/include/isc/app.h
+
+ lib/isc/include/isc/assertions.h@1.3 +0 -0
+ Rename: include/isc/assertions.h -> lib/isc/include/isc/assertions.h
+
+ lib/isc/include/isc/boolean.h@1.3 +0 -0
+ Rename: include/isc/boolean.h -> lib/isc/include/isc/boolean.h
+
+ lib/isc/include/isc/buffer.h@1.3 +0 -0
+ Rename: include/isc/buffer.h -> lib/isc/include/isc/buffer.h
+
+ lib/isc/include/isc/error.h@1.3 +0 -0
+ Rename: include/isc/error.h -> lib/isc/include/isc/error.h
+
+ lib/isc/include/isc/file.h@1.3 +0 -0
+ Rename: include/isc/file.h -> lib/isc/include/isc/file.h
+
+ lib/isc/include/isc/formatcheck.h@1.3 +0 -0
+ Rename: include/isc/formatcheck.h -> lib/isc/include/isc/formatcheck.h
+
+ lib/isc/include/isc/interfaceiter.h@1.5 +0 -0
+ Rename: include/isc/interfaceiter.h -> lib/isc/include/isc/interfaceiter.h
+
+ lib/isc/include/isc/ipv6.h@1.8 +0 -0
+ Rename: include/isc/ipv6.h -> lib/isc/include/isc/ipv6.h
+
+ lib/isc/include/isc/lang.h@1.3 +0 -0
+ Rename: include/isc/lang.h -> lib/isc/include/isc/lang.h
+
+ lib/isc/include/isc/lib.h@1.3 +0 -0
+ Rename: include/isc/lib.h -> lib/isc/include/isc/lib.h
+
+ lib/isc/include/isc/list.h@1.3 +0 -0
+ Rename: include/isc/list.h -> lib/isc/include/isc/list.h
+
+ lib/isc/include/isc/log.h@1.2 +0 -0
+ Rename: include/isc/log.h -> lib/isc/include/isc/log.h
+
+ lib/isc/include/isc/magic.h@1.3 +0 -0
+ Rename: include/isc/magic.h -> lib/isc/include/isc/magic.h
+
+ lib/isc/include/isc/md5.h@1.2 +0 -0
+ Rename: include/isc/md5.h -> lib/isc/include/isc/md5.h
+
+ lib/isc/include/isc/mem.h@1.4 +0 -0
+ Rename: include/isc/mem.h -> lib/isc/include/isc/mem.h
+
+ lib/isc/include/isc/msgcat.h@1.3 +0 -0
+ Rename: include/isc/msgcat.h -> lib/isc/include/isc/msgcat.h
+
+ lib/isc/include/isc/msgs.h@1.4 +0 -0
+ Rename: include/isc/msgs.h -> lib/isc/include/isc/msgs.h
+
+ lib/isc/include/isc/mutex.h@1.3 +0 -0
+ Rename: include/isc/mutex.h -> lib/isc/include/isc/mutex.h
+
+ lib/isc/include/isc/netaddr.h@1.5 +0 -0
+ Rename: include/isc/netaddr.h -> lib/isc/include/isc/netaddr.h
+
+ lib/isc/include/isc/netscope.h@1.2 +0 -0
+ Rename: include/isc/netscope.h -> lib/isc/include/isc/netscope.h
+
+ lib/isc/include/isc/once.h@1.3 +0 -0
+ Rename: include/isc/once.h -> lib/isc/include/isc/once.h
+
+ lib/isc/include/isc/platform.h@1.3 +0 -0
+ Rename: include/isc/platform.h -> lib/isc/include/isc/platform.h
+
+ lib/isc/include/isc/print.h@1.3 +0 -0
+ Rename: include/isc/print.h -> lib/isc/include/isc/print.h
+
+ lib/isc/include/isc/region.h@1.2 +0 -0
+ Rename: include/isc/region.h -> lib/isc/include/isc/region.h
+
+ lib/isc/include/isc/result.h@1.4 +0 -0
+ Rename: include/isc/result.h -> lib/isc/include/isc/result.h
+
+ lib/isc/include/isc/sockaddr.h@1.4 +0 -0
+ Rename: include/isc/sockaddr.h -> lib/isc/include/isc/sockaddr.h
+
+ lib/isc/include/isc/stdio.h@1.2 +0 -0
+ Rename: include/isc/stdio.h -> lib/isc/include/isc/stdio.h
+
+ lib/isc/include/isc/string.h@1.3 +0 -0
+ Rename: include/isc/string.h -> lib/isc/include/isc/string.h
+
+ lib/isc/include/isc/types.h@1.3 +0 -0
+ Rename: include/isc/types.h -> lib/isc/include/isc/types.h
+
+ lib/isc/include/isc/util.h@1.3 +0 -0
+ Rename: include/isc/util.h -> lib/isc/include/isc/util.h
+
+ lib/isc/inet_aton.c@1.3 +0 -0
+ Rename: libisc/inet_aton.c -> lib/isc/inet_aton.c
+
+ lib/isc/inet_ntop.c@1.6 +0 -0
+ Rename: libisc/inet_ntop.c -> lib/isc/inet_ntop.c
+
+ lib/isc/inet_pton.c@1.3 +0 -0
+ Rename: libisc/inet_pton.c -> lib/isc/inet_pton.c
+
+ lib/isc/lib.c@1.3 +0 -0
+ Rename: libisc/lib.c -> lib/isc/lib.c
+
+ lib/isc/log.c@1.2 +0 -0
+ Rename: libisc/log.c -> lib/isc/log.c
+
+ lib/isc/md5.c@1.2 +0 -0
+ Rename: libisc/md5.c -> lib/isc/md5.c
+
+ lib/isc/mem.c@1.4 +0 -0
+ Rename: libisc/mem.c -> lib/isc/mem.c
+
+ lib/isc/netaddr.c@1.5 +0 -0
+ Rename: libisc/netaddr.c -> lib/isc/netaddr.c
+
+ lib/isc/netscope.c@1.2 +0 -0
+ Rename: libisc/netscope.c -> lib/isc/netscope.c
+
+ lib/isc/nls/msgcat.c@1.5 +0 -0
+ Rename: lib/isc/msgcat.c -> lib/isc/nls/msgcat.c
+
+ lib/isc/msgcat.c@1.4 +0 -0
+ Rename: libisc/msgcat.c -> lib/isc/msgcat.c
+
+ lib/isc/sockaddr.c@1.7 +0 -0
+ Rename: libisc/sockaddr.c -> lib/isc/sockaddr.c
+
+ lib/isc/unix/ifiter_getifaddrs.c@1.6 +0 -0
+ Rename: libisc/ifiter_getifaddrs.c -> lib/isc/unix/ifiter_getifaddrs.c
+
+ lib/isc/unix/ifiter_ioctl.c@1.26 +0 -0
+ Rename: libisc/ifiter_ioctl.c -> lib/isc/unix/ifiter_ioctl.c
+
+ lib/isc/unix/ifiter_sysctl.c@1.13 +0 -0
+ Rename: libisc/ifiter_sysctl.c -> lib/isc/unix/ifiter_sysctl.c
+
+ lib/isc/unix/include/isc/Makefile.am@1.1 +15 -0
+ overlooked lib/isc/unix/include/isc
+
+ lib/isc/unix/include/isc/Makefile.am@1.0 +0 -0
+
+ lib/isc/unix/include/isc/dir.h@1.2 +0 -0
+ Rename: include/isc/dir.h -> lib/isc/unix/include/isc/dir.h
+
+ lib/isc/unix/include/isc/int.h@1.3 +0 -0
+ Rename: include/isc/int.h -> lib/isc/unix/include/isc/int.h
+
+ lib/isc/unix/include/isc/net.h@1.9 +0 -0
+ Rename: include/isc/net.h -> lib/isc/unix/include/isc/net.h
+
+ lib/isc/unix/include/isc/offset.h@1.3 +0 -0
+ Rename: include/isc/offset.h -> lib/isc/unix/include/isc/offset.h
+
+ lib/isc/unix/include/isc/stat.h@1.2 +0 -0
+ Rename: include/isc/stat.h -> lib/isc/unix/include/isc/stat.h
+
+ lib/isc/unix/include/isc/strerror.h@1.3 +0 -0
+ Rename: include/isc/strerror.h -> lib/isc/unix/include/isc/strerror.h
+
+ lib/isc/unix/include/isc/time.h@1.2 +0 -0
+ Rename: include/isc/time.h -> lib/isc/unix/include/isc/time.h
+
+ lib/isc/unix/interfaceiter.c@1.16 +0 -0
+ Rename: libisc/interfaceiter.c -> lib/isc/unix/interfaceiter.c
+
+ lib/isc/unix/net.c@1.11 +0 -0
+ Rename: libisc/net.c -> lib/isc/unix/net.c
+
+ lib/isc/unix/strerror.c@1.4 +0 -0
+ Rename: libisc/isc_strerror.c -> lib/isc/unix/strerror.c
+
+ lib/isc/win32/include/isc/int.h@1.3 +0 -0
+ Rename: ports/winnt/include/isc/int.h -> lib/isc/win32/include/isc/int.h
+
+ lib/isc/win32/include/isc/ipv6.h@1.7 +0 -0
+ Rename: ports/winnt/include/isc/ipv6.h -> lib/isc/win32/include/isc/ipv6.h
+
+ lib/isc/win32/include/isc/mutex.h@1.3 +0 -0
+ Rename: ports/winnt/include/isc/mutex.h -> lib/isc/win32/include/isc/mutex.h
+
+ lib/isc/win32/include/isc/net.h@1.8 +0 -0
+ Rename: ports/winnt/include/isc/net.h -> lib/isc/win32/include/isc/net.h
+
+ lib/isc/win32/include/isc/offset.h@1.3 +0 -0
+ Rename: ports/winnt/include/isc/offset.h -> lib/isc/win32/include/isc/offset.h
+
+ lib/isc/win32/include/isc/once.h@1.3 +0 -0
+ Rename: ports/winnt/include/isc/once.h -> lib/isc/win32/include/isc/once.h
+
+ lib/isc/win32/include/isc/platform.h@1.4 +0 -0
+ Rename: ports/winnt/include/isc/platform.h -> lib/isc/win32/include/isc/platform.h
+
+ lib/isc/win32/include/isc/stat.h@1.2 +0 -0
+ Rename: ports/winnt/include/isc/stat.h -> lib/isc/win32/include/isc/stat.h
+
+ lib/isc/win32/include/isc/strerror.h@1.3 +0 -0
+ Rename: ports/winnt/include/isc/strerror.h -> lib/isc/win32/include/isc/strerror.h
+
+ lib/isc/win32/include/isc/win32os.h@1.3 +0 -0
+ Rename: ports/winnt/include/isc/win32os.h -> lib/isc/win32/include/isc/win32os.h
+
+ lib/isc/win32/interfaceiter.c@1.10.1.1 +0 -0
+ Rename: ports/winnt/libisc/interfaceiter.c -> lib/isc/win32/interfaceiter.c
+
+ lib/isc/win32/net.c@1.10 +0 -0
+ Rename: ports/winnt/libisc/net.c -> lib/isc/win32/net.c
+
+ lib/isc/win32/once.c@1.3 +0 -0
+ Rename: ports/winnt/libisc/once.c -> lib/isc/win32/once.c
+
+ lib/isc/win32/strerror.c@1.9 +0 -0
+ Rename: ports/winnt/libisc/isc_strerror.c -> lib/isc/win32/strerror.c
+
+ lib/isc/win32/win32os.c@1.3 +0 -0
+ Rename: ports/winnt/libisc/win32os.c -> lib/isc/win32/win32os.c
+
+ libntp/Makefile.am@1.44 +16 -9
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ libntp/bsd_strerror.c@1.5 +0 -0
+ Rename: libntp/strerror.c -> libntp/bsd_strerror.c
+
+ libparse/Makefile.am@1.13 +6 -1
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ ntpd/Makefile.am@1.68 +9 -1
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ ntpdate/Makefile.am@1.17 +5 -1
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ ntpdc/Makefile.am@1.40 +6 -1
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ ntpq/Makefile.am@1.34 +6 -1
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ ntpsnmpd/Makefile.am@1.8 +8 -2
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ parseutil/Makefile.am@1.8 +5 -1
+ Reorganize our copy of libisc code to match BIND 9 tarball layout
+
+ ports/winnt/vc6/libntp.dsp@1.42 +18 -18
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vc6/ntpd.dsp@1.38 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vc6/ntpdate.dsp@1.22 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vc6/ntpdc.dsp@1.25 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.18 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vc6/ntpq.dsp@1.26 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2003/libntp.vcproj@1.3 +18 -18
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2003/ntpd.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2003/ntpdate.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2003/ntpdc.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2003/ntpkeygen.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2003/ntpq.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2005/libntp.vcproj@1.3 +18 -18
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2005/ntpd.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2005/ntpdate.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2005/ntpq.vcproj@1.3 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.18 +18 -36
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.7 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.18 +12 -12
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.10 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.10 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.9 +2 -2
+ out with ports/winnt/include/isc and include/isc, in with
+ lib/isc/include/win32/isc and lib/isc/include/isc
+
+ sntp/Makefile.am@1.11 +7 -3
+ out with include/isc, in with lib/isc/include/isc and
+ lib/isc/unix/include/isc
+
+ util/Makefile.am@1.39 +6 -1
+ out with include/isc, in with lib/isc/include/isc and
+ lib/isc/unix/include/isc
+
+ChangeSet@1.2005, 2009-09-22 19:22:09+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1315] "interface ignore 0.0.0.0" is ignored.
+ add implicit "nic ignore all" rule before any rules from ntp.conf, so
+ "nic listen eth0" alone means the same as "-I eth0".
+ add wildcard match class for interface/nic rules.
+ fix mistaken carryover of prefixlen from one rule to the next.
+ Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6
+ address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1
+ on Windows to end.
+
+ ChangeLog@1.444 +8 -0
+ [Bug 1315] "interface ignore 0.0.0.0" is ignored.
+ add implicit "nic ignore all" rule before any rules from ntp.conf, so
+ "nic listen eth0" alone means the same as "-I eth0".
+ add wildcard match class for interface/nic rules.
+ fix mistaken carryover of prefixlen from one rule to the next.
+ Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6
+ address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1
+ on Windows to end.
+
+ include/ntp_io.h@1.12 +4 -2
+ add wildcard match class for interface/nic rules.
+ add sau_from_netaddr() prototype
+
+ ntpd/ntp_config.c@1.220 +26 -9
+ fix mistaken carryover of prefixlen from one rule to the next.
+ add wildcard match class for interface/nic rules.
+
+ ntpd/ntp_io.c@1.298 +193 -76
+ [Bug 1315] "interface ignore 0.0.0.0" is ignored.
+ add implicit "nic ignore all" rule before any rules from ntp.conf, so
+ "nic listen eth0" alone means the same as "-I eth0".
+ add wildcard match class for interface/nic rules.
+
+
+ ntpd/ntp_parser.c@1.49 +595 -595
+ Bison product
+
+ ntpd/ntp_parser.h@1.30 +33 -31
+ Bison product
+
+ ntpd/ntp_parser.y@1.44 +2 -0
+ add wildcard match class for interface/nic rules.
+
+ ntpd/ntp_scanner.c@1.27 +18 -9
+ add wildcard match class for interface/nic rules.
+ better fix for Sunday's change to close-double-quote handling.
+
+ ntpd/ntp_scanner.h@1.11 +4 -0
+ FOLLBY_TOKEN/FOLLBY_STRING use clarification comment
+
+ ntpd/ntpd.c@1.108 +0 -6
+ add implicit "nic ignore all" rule before any rules from ntp.conf, so
+ "nic listen eth0" alone means the same as "-I eth0".
+
+ ntpdc/ntpdc.c@1.70 +0 -8
+ Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6
+ address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1
+ on Windows to end.
+
+ ntpq/ntpq.c@1.91 +0 -8
+ Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6
+ address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1
+ on Windows to end.
+
+ ports/winnt/libisc/interfaceiter.c@1.11 +72 -11
+ Ensure IPv6 localhost address ::1 is included in libisc's Windows IPv6
+ address enumeration, allowing ntpq and ntpdc's hardcoding to 127.0.0.1
+ on Windows to end.
+
+ChangeSet@1.2004, 2009-09-21 07:51:38-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P218
+ TAG: NTP_4_2_5P218
+
+ ChangeLog@1.443 +1 -0
+ NTP_4_2_5P218
+
+ ntpd/ntpd-opts.c@1.211 +2 -2
+ NTP_4_2_5P218
+
+ ntpd/ntpd-opts.h@1.211 +3 -3
+ NTP_4_2_5P218
+
+ ntpd/ntpd-opts.texi@1.209 +1 -1
+ NTP_4_2_5P218
+
+ ntpd/ntpd.1@1.209 +2 -2
+ NTP_4_2_5P218
+
+ ntpdc/ntpdc-opts.c@1.207 +2 -2
+ NTP_4_2_5P218
+
+ ntpdc/ntpdc-opts.h@1.207 +3 -3
+ NTP_4_2_5P218
+
+ ntpdc/ntpdc-opts.texi@1.206 +1 -1
+ NTP_4_2_5P218
+
+ ntpdc/ntpdc.1@1.206 +2 -2
+ NTP_4_2_5P218
+
+ ntpq/ntpq-opts.c@1.207 +2 -2
+ NTP_4_2_5P218
+
+ ntpq/ntpq-opts.h@1.207 +3 -3
+ NTP_4_2_5P218
+
+ ntpq/ntpq-opts.texi@1.206 +1 -1
+ NTP_4_2_5P218
+
+ ntpq/ntpq.1@1.206 +2 -2
+ NTP_4_2_5P218
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.87 +2 -2
+ NTP_4_2_5P218
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.87 +3 -3
+ NTP_4_2_5P218
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.87 +1 -1
+ NTP_4_2_5P218
+
+ ntpsnmpd/ntpsnmpd.1@1.87 +2 -2
+ NTP_4_2_5P218
+
+ packageinfo.sh@1.221 +1 -1
+ NTP_4_2_5P218
+
+ sntp/sntp-opts.c@1.81 +2 -2
+ NTP_4_2_5P218
+
+ sntp/sntp-opts.h@1.81 +3 -3
+ NTP_4_2_5P218
+
+ sntp/sntp-opts.texi@1.81 +1 -1
+ NTP_4_2_5P218
+
+ sntp/sntp.1@1.81 +2 -2
+ NTP_4_2_5P218
+
+ util/ntp-keygen-opts.c@1.210 +2 -2
+ NTP_4_2_5P218
+
+ util/ntp-keygen-opts.h@1.210 +3 -3
+ NTP_4_2_5P218
+
+ util/ntp-keygen-opts.texi@1.209 +1 -1
+ NTP_4_2_5P218
+
+ util/ntp-keygen.1@1.209 +2 -2
+ NTP_4_2_5P218
+
+ChangeSet@1.2003, 2009-09-21 04:57:32+00:00, davehart@shiny.ad.hartbrothers.com
+ correct parsing and processing of setvar directive.
+ highlight location of ntpq :config syntax errors with ^.
+
+ ChangeLog@1.442 +2 -0
+ correct parsing and processing of setvar directive.
+ highlight location of ntpq :config syntax errors with ^.
+
+ include/ntp_config.h@1.63 +2 -1
+ correct parsing and processing of setvar directive.
+
+ ntpd/ntp_config.c@1.219 +62 -55
+ correct parsing and processing of setvar directive.
+
+ ntpd/ntp_scanner.c@1.26 +35 -5
+ correct parsing and processing of setvar directive.
+
+ ntpd/ntp_scanner.h@1.10 +7 -6
+ correct parsing and processing of setvar directive.
+
+ ntpq/ntpq-subs.c@1.37 +25 -9
+ highlight location of ntpq :config syntax errors with ^.
+
+ ntpq/ntpq.h@1.8 +2 -0
+ expose interactive variable to ntpq-subs.c
+
+ChangeSet@1.2000.1.1, 2009-09-21 00:10:58+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1314] saveconfig emits -4 and -6 on when not given.
+ clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to
+ FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC.
+ parser, saveconfig cleanup to store T_ identifiers in syntax tree.
+
+ ChangeLog@1.439.1.1 +4 -0
+ [Bug 1314] saveconfig emits -4 and -6 on when not given.
+ clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to
+ FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC.
+ parser, saveconfig cleanup to store T_ identifiers in syntax tree.
+
+ include/ntp_config.h@1.62 +8 -9
+ parser, saveconfig cleanup to store T_ identifiers in syntax tree.
+
+ ntpd/ntp_config.c@1.218 +612 -947
+ parser, saveconfig cleanup to store T_ identifiers in syntax tree.
+ move scanner's keyword table from ntp_config.c to ntp_scanner.c
+
+ ntpd/ntp_parser.c@1.48 +275 -466
+ Bison product
+
+ ntpd/ntp_parser.h@1.29 +3 -3
+ Bison output
+
+ ntpd/ntp_parser.y@1.43 +100 -96
+ parser, saveconfig cleanup to store T_ identifiers in syntax tree.
+
+ ntpd/ntp_scanner.c@1.25 +269 -64
+ clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to
+ FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC.
+ move scanner's keyword table from ntp_config.c to ntp_scanner.c
+
+ ntpd/ntp_scanner.h@1.9 +25 -9
+ clarify (former) NO_ARG, SINGLE_ARG, MULTIPLE_ARG renaming to
+ FOLLBY_TOKEN, FOLLBY_STRING, FOLLBY_STRINGS_TO_EOC.
+
+ChangeSet@1.2001, 2009-09-20 07:51:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P217
+ TAG: NTP_4_2_5P217
+
+ ChangeLog@1.440 +1 -0
+ NTP_4_2_5P217
+
+ ntpd/ntpd-opts.c@1.210 +2 -2
+ NTP_4_2_5P217
+
+ ntpd/ntpd-opts.h@1.210 +3 -3
+ NTP_4_2_5P217
+
+ ntpd/ntpd-opts.texi@1.208 +1 -1
+ NTP_4_2_5P217
+
+ ntpd/ntpd.1@1.208 +2 -2
+ NTP_4_2_5P217
+
+ ntpdc/ntpdc-opts.c@1.206 +2 -2
+ NTP_4_2_5P217
+
+ ntpdc/ntpdc-opts.h@1.206 +3 -3
+ NTP_4_2_5P217
+
+ ntpdc/ntpdc-opts.texi@1.205 +1 -1
+ NTP_4_2_5P217
+
+ ntpdc/ntpdc.1@1.205 +2 -2
+ NTP_4_2_5P217
+
+ ntpq/ntpq-opts.c@1.206 +2 -2
+ NTP_4_2_5P217
+
+ ntpq/ntpq-opts.h@1.206 +3 -3
+ NTP_4_2_5P217
+
+ ntpq/ntpq-opts.texi@1.205 +1 -1
+ NTP_4_2_5P217
+
+ ntpq/ntpq.1@1.205 +2 -2
+ NTP_4_2_5P217
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.86 +2 -2
+ NTP_4_2_5P217
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.86 +3 -3
+ NTP_4_2_5P217
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.86 +1 -1
+ NTP_4_2_5P217
+
+ ntpsnmpd/ntpsnmpd.1@1.86 +2 -2
+ NTP_4_2_5P217
+
+ packageinfo.sh@1.220 +1 -1
+ NTP_4_2_5P217
+
+ sntp/sntp-opts.c@1.80 +2 -2
+ NTP_4_2_5P217
+
+ sntp/sntp-opts.h@1.80 +3 -3
+ NTP_4_2_5P217
+
+ sntp/sntp-opts.texi@1.80 +1 -1
+ NTP_4_2_5P217
+
+ sntp/sntp.1@1.80 +2 -2
+ NTP_4_2_5P217
+
+ util/ntp-keygen-opts.c@1.209 +2 -2
+ NTP_4_2_5P217
+
+ util/ntp-keygen-opts.h@1.209 +3 -3
+ NTP_4_2_5P217
+
+ util/ntp-keygen-opts.texi@1.208 +1 -1
+ NTP_4_2_5P217
+
+ util/ntp-keygen.1@1.208 +2 -2
+ NTP_4_2_5P217
+
+ChangeSet@1.2000, 2009-09-19 16:52:44+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1300] reject remote configuration of dangerous items.
+
+ ChangeLog@1.439 +1 -0
+ [Bug 1300] reject remote configuration of dangerous items.
+
+ include/ntpd.h@1.134 +1 -0
+ [Bug 1300] reject remote configuration of dangerous items.
+
+ ntpd/ntp_config.c@1.217 +43 -10
+ [Bug 1300] reject remote configuration of dangerous items.
+
+ ntpd/ntp_control.c@1.123 +61 -74
+ [Bug 1300] reject remote configuration of dangerous items.
+
+ ntpd/ntp_parser.c@1.47 +838 -743
+ Bison output
+
+ ntpd/ntp_parser.h@1.28 +87 -85
+ Bison output
+
+ ntpd/ntp_parser.y@1.42 +106 -17
+ [Bug 1300] reject remote configuration of dangerous items.
+
+ ntpd/refclock_palisade.c@1.31 +2 -5
+ un-revert another earlier fix (no need for Windows-specific COM%d:)
+
+ ntpq/ntpq-subs.c@1.36 +19 -15
+ trim one trailing newline from :config response
+
+ChangeSet@1.1999, 2009-09-19 07:53:27-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P216
+ TAG: NTP_4_2_5P216
+
+ ChangeLog@1.438 +1 -0
+ NTP_4_2_5P216
+
+ ntpd/ntpd-opts.c@1.209 +2 -2
+ NTP_4_2_5P216
+
+ ntpd/ntpd-opts.h@1.209 +3 -3
+ NTP_4_2_5P216
+
+ ntpd/ntpd-opts.texi@1.207 +1 -1
+ NTP_4_2_5P216
+
+ ntpd/ntpd.1@1.207 +2 -2
+ NTP_4_2_5P216
+
+ ntpdc/ntpdc-opts.c@1.205 +2 -2
+ NTP_4_2_5P216
+
+ ntpdc/ntpdc-opts.h@1.205 +3 -3
+ NTP_4_2_5P216
+
+ ntpdc/ntpdc-opts.texi@1.204 +1 -1
+ NTP_4_2_5P216
+
+ ntpdc/ntpdc.1@1.204 +2 -2
+ NTP_4_2_5P216
+
+ ntpq/ntpq-opts.c@1.205 +2 -2
+ NTP_4_2_5P216
+
+ ntpq/ntpq-opts.h@1.205 +3 -3
+ NTP_4_2_5P216
+
+ ntpq/ntpq-opts.texi@1.204 +1 -1
+ NTP_4_2_5P216
+
+ ntpq/ntpq.1@1.204 +2 -2
+ NTP_4_2_5P216
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.85 +2 -2
+ NTP_4_2_5P216
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.85 +3 -3
+ NTP_4_2_5P216
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.85 +1 -1
+ NTP_4_2_5P216
+
+ ntpsnmpd/ntpsnmpd.1@1.85 +2 -2
+ NTP_4_2_5P216
+
+ packageinfo.sh@1.219 +1 -1
+ NTP_4_2_5P216
+
+ sntp/sntp-opts.c@1.79 +2 -2
+ NTP_4_2_5P216
+
+ sntp/sntp-opts.h@1.79 +3 -3
+ NTP_4_2_5P216
+
+ sntp/sntp-opts.texi@1.79 +1 -1
+ NTP_4_2_5P216
+
+ sntp/sntp.1@1.79 +2 -2
+ NTP_4_2_5P216
+
+ util/ntp-keygen-opts.c@1.208 +2 -2
+ NTP_4_2_5P216
+
+ util/ntp-keygen-opts.h@1.208 +3 -3
+ NTP_4_2_5P216
+
+ util/ntp-keygen-opts.texi@1.207 +1 -1
+ NTP_4_2_5P216
+
+ util/ntp-keygen.1@1.207 +2 -2
+ NTP_4_2_5P216
+
+ChangeSet@1.1998, 2009-09-19 06:21:08+00:00, davehart@shiny.ad.hartbrothers.com
+ CID 10 missing free(up); in refclock_palisade.c error return, again.
+ CID 83 added assertion to demonstrate config_nic_rules() does not
+ call strchr(NULL, '/').
+
+ ChangeLog@1.437 +3 -0
+ CID 10 missing free(up); in refclock_palisade.c error return, again.
+ CID 83 added assertion to demonstrate config_nic_rules() does not
+ call strchr(NULL, '/').
+
+ ntpd/ntp_config.c@1.216 +1 -0
+ CID 83 added assertion to demonstrate config_nic_rules() does not
+ call strchr(NULL, '/').
+
+ ntpd/refclock_palisade.c@1.30 +3 -9
+ CID 10 missing free(up); in refclock_palisade.c error return, again.
+
+ChangeSet@1.1997, 2009-09-19 02:18:44+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns.
+
+ ChangeLog@1.436 +1 -0
+ [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns.
+
+ configure.ac@1.454 +16 -0
+ [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns.
+
+ include/ntp_stdlib.h@1.32 +4 -3
+ make #include "ntp_stdlib.h" all that's needed to use msyslog() by
+ including ntp_syslog.h from ntp_stdlib.h
+
+ ntpdc/ntpdc.c@1.69 +12 -4
+ [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns.
+ Clean up authenticated request codepath.
+
+ ntpq/ntpq.c@1.90 +13 -17
+ [Bug 1312] ntpq/ntpdc MD5 passwords truncated to 8 chars on Suns.
+ Clean up authenticated request codepath.
+ Remove unneeded SYS_WINNT libntp workarounds from last century.
+
+ChangeSet@1.1996, 2009-09-18 07:51:03-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P215
+ TAG: NTP_4_2_5P215
+
+ ChangeLog@1.435 +1 -0
+ NTP_4_2_5P215
+
+ ntpd/ntpd-opts.c@1.208 +2 -2
+ NTP_4_2_5P215
+
+ ntpd/ntpd-opts.h@1.208 +3 -3
+ NTP_4_2_5P215
+
+ ntpd/ntpd-opts.texi@1.206 +1 -1
+ NTP_4_2_5P215
+
+ ntpd/ntpd.1@1.206 +2 -2
+ NTP_4_2_5P215
+
+ ntpdc/ntpdc-opts.c@1.204 +2 -2
+ NTP_4_2_5P215
+
+ ntpdc/ntpdc-opts.h@1.204 +3 -3
+ NTP_4_2_5P215
+
+ ntpdc/ntpdc-opts.texi@1.203 +1 -1
+ NTP_4_2_5P215
+
+ ntpdc/ntpdc.1@1.203 +2 -2
+ NTP_4_2_5P215
+
+ ntpq/ntpq-opts.c@1.204 +2 -2
+ NTP_4_2_5P215
+
+ ntpq/ntpq-opts.h@1.204 +3 -3
+ NTP_4_2_5P215
+
+ ntpq/ntpq-opts.texi@1.203 +1 -1
+ NTP_4_2_5P215
+
+ ntpq/ntpq.1@1.203 +2 -2
+ NTP_4_2_5P215
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.84 +2 -2
+ NTP_4_2_5P215
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.84 +3 -3
+ NTP_4_2_5P215
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.84 +1 -1
+ NTP_4_2_5P215
+
+ ntpsnmpd/ntpsnmpd.1@1.84 +2 -2
+ NTP_4_2_5P215
+
+ packageinfo.sh@1.218 +1 -1
+ NTP_4_2_5P215
+
+ sntp/sntp-opts.c@1.78 +2 -2
+ NTP_4_2_5P215
+
+ sntp/sntp-opts.h@1.78 +3 -3
+ NTP_4_2_5P215
+
+ sntp/sntp-opts.texi@1.78 +1 -1
+ NTP_4_2_5P215
+
+ sntp/sntp.1@1.78 +2 -2
+ NTP_4_2_5P215
+
+ util/ntp-keygen-opts.c@1.207 +2 -2
+ NTP_4_2_5P215
+
+ util/ntp-keygen-opts.h@1.207 +3 -3
+ NTP_4_2_5P215
+
+ util/ntp-keygen-opts.texi@1.206 +1 -1
+ NTP_4_2_5P215
+
+ util/ntp-keygen.1@1.206 +2 -2
+ NTP_4_2_5P215
+
+ChangeSet@1.1995, 2009-09-17 23:25:59-04:00, stenn@pogo.udel.edu
+ [Bug 1292] Workaround last VC6 unsigned __int64 kink
+
+ ChangeLog@1.434 +1 -0
+ [Bug 1292] Workaround last VC6 unsigned __int64 kink
+
+ChangeSet@1.1994, 2009-09-17 15:28:57+02:00, burnicki@pogo.udel.edu
+ [Bug 1292] Workaround last VC6 unsigned __int64 kink.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.36 +1 -1
+ [Bug 1292] Workaround last VC6 unsigned __int64 kink.
+
+ChangeSet@1.1993, 2009-09-17 07:55:35-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P214
+ TAG: NTP_4_2_5P214
+
+ ChangeLog@1.433 +1 -0
+ NTP_4_2_5P214
+
+ ntpd/ntpd-opts.c@1.207 +2 -2
+ NTP_4_2_5P214
+
+ ntpd/ntpd-opts.h@1.207 +3 -3
+ NTP_4_2_5P214
+
+ ntpd/ntpd-opts.texi@1.205 +1 -1
+ NTP_4_2_5P214
+
+ ntpd/ntpd.1@1.205 +2 -2
+ NTP_4_2_5P214
+
+ ntpdc/ntpdc-opts.c@1.203 +2 -2
+ NTP_4_2_5P214
+
+ ntpdc/ntpdc-opts.h@1.203 +3 -3
+ NTP_4_2_5P214
+
+ ntpdc/ntpdc-opts.texi@1.202 +1 -1
+ NTP_4_2_5P214
+
+ ntpdc/ntpdc.1@1.202 +2 -2
+ NTP_4_2_5P214
+
+ ntpq/ntpq-opts.c@1.203 +2 -2
+ NTP_4_2_5P214
+
+ ntpq/ntpq-opts.h@1.203 +3 -3
+ NTP_4_2_5P214
+
+ ntpq/ntpq-opts.texi@1.202 +1 -1
+ NTP_4_2_5P214
+
+ ntpq/ntpq.1@1.202 +2 -2
+ NTP_4_2_5P214
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.83 +2 -2
+ NTP_4_2_5P214
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.83 +3 -3
+ NTP_4_2_5P214
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.83 +1 -1
+ NTP_4_2_5P214
+
+ ntpsnmpd/ntpsnmpd.1@1.83 +2 -2
+ NTP_4_2_5P214
+
+ packageinfo.sh@1.217 +1 -1
+ NTP_4_2_5P214
+
+ sntp/sntp-opts.c@1.77 +2 -2
+ NTP_4_2_5P214
+
+ sntp/sntp-opts.h@1.77 +3 -3
+ NTP_4_2_5P214
+
+ sntp/sntp-opts.texi@1.77 +1 -1
+ NTP_4_2_5P214
+
+ sntp/sntp.1@1.77 +2 -2
+ NTP_4_2_5P214
+
+ util/ntp-keygen-opts.c@1.206 +2 -2
+ NTP_4_2_5P214
+
+ util/ntp-keygen-opts.h@1.206 +3 -3
+ NTP_4_2_5P214
+
+ util/ntp-keygen-opts.texi@1.205 +1 -1
+ NTP_4_2_5P214
+
+ util/ntp-keygen.1@1.205 +2 -2
+ NTP_4_2_5P214
+
+ChangeSet@1.1992, 2009-09-17 01:31:14+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1303] remove top-level "autokey" directive.
+ correct "checking" message for --disable-bug1243-fix.
+ use "nic listen 192.168.0.0/16" instead of
+ "nic listen 192.168.0.0 prefixlen 16"
+
+ ChangeLog@1.432 +3 -0
+ [Bug 1303] remove top-level "autokey" directive.
+ use "nic listen 192.168.0.0/16" instead of
+ "nic listen 192.168.0.0 prefixlen 16".
+
+ configure.ac@1.453 +1 -1
+ correct "checking" message for --disable-bug1243-fix.
+
+ html/miscopt.html@1.48 +2 -2
+ use "nic listen 192.168.0.0/16" instead of
+ "nic listen 192.168.0.0 prefixlen 16".
+
+ include/ntp_config.h@1.61 +1 -3
+ [Bug 1303] remove top-level "autokey" directive.
+
+ ntpd/ntp_config.c@1.215 +28 -10
+ use "nic listen 192.168.0.0/16" instead of
+ "nic listen 192.168.0.0 prefixlen 16".
+
+ ntpd/ntp_parser.c@1.46 +758 -789
+ Bison output
+
+ ntpd/ntp_parser.h@1.27 +103 -105
+ use "nic listen 192.168.0.0/16" instead of
+ "nic listen 192.168.0.0 prefixlen 16".
+
+ ntpd/ntp_parser.y@1.41 +4 -12
+ [Bug 1303] remove top-level "autokey" directive.
+ use "nic listen 192.168.0.0/16" instead of
+ "nic listen 192.168.0.0 prefixlen 16".
+
+ChangeSet@1.1991, 2009-09-16 07:51:15-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P213
+ TAG: NTP_4_2_5P213
+
+ ChangeLog@1.431 +1 -0
+ NTP_4_2_5P213
+
+ ntpd/ntpd-opts.c@1.206 +2 -2
+ NTP_4_2_5P213
+
+ ntpd/ntpd-opts.h@1.206 +3 -3
+ NTP_4_2_5P213
+
+ ntpd/ntpd-opts.texi@1.204 +1 -1
+ NTP_4_2_5P213
+
+ ntpd/ntpd.1@1.204 +2 -2
+ NTP_4_2_5P213
+
+ ntpdc/ntpdc-opts.c@1.202 +2 -2
+ NTP_4_2_5P213
+
+ ntpdc/ntpdc-opts.h@1.202 +3 -3
+ NTP_4_2_5P213
+
+ ntpdc/ntpdc-opts.texi@1.201 +1 -1
+ NTP_4_2_5P213
+
+ ntpdc/ntpdc.1@1.201 +2 -2
+ NTP_4_2_5P213
+
+ ntpq/ntpq-opts.c@1.202 +2 -2
+ NTP_4_2_5P213
+
+ ntpq/ntpq-opts.h@1.202 +3 -3
+ NTP_4_2_5P213
+
+ ntpq/ntpq-opts.texi@1.201 +1 -1
+ NTP_4_2_5P213
+
+ ntpq/ntpq.1@1.201 +2 -2
+ NTP_4_2_5P213
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.82 +2 -2
+ NTP_4_2_5P213
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.82 +3 -3
+ NTP_4_2_5P213
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.82 +1 -1
+ NTP_4_2_5P213
+
+ ntpsnmpd/ntpsnmpd.1@1.82 +2 -2
+ NTP_4_2_5P213
+
+ packageinfo.sh@1.216 +1 -1
+ NTP_4_2_5P213
+
+ sntp/sntp-opts.c@1.76 +2 -2
+ NTP_4_2_5P213
+
+ sntp/sntp-opts.h@1.76 +3 -3
+ NTP_4_2_5P213
+
+ sntp/sntp-opts.texi@1.76 +1 -1
+ NTP_4_2_5P213
+
+ sntp/sntp.1@1.76 +2 -2
+ NTP_4_2_5P213
+
+ util/ntp-keygen-opts.c@1.205 +2 -2
+ NTP_4_2_5P213
+
+ util/ntp-keygen-opts.h@1.205 +3 -3
+ NTP_4_2_5P213
+
+ util/ntp-keygen-opts.texi@1.204 +1 -1
+ NTP_4_2_5P213
+
+ util/ntp-keygen.1@1.204 +2 -2
+ NTP_4_2_5P213
+
+ChangeSet@1.1988.1.1, 2009-09-15 13:08:48-04:00, murray@pogo.udel.edu
+ refclock_palisade.c, ChangeLog:
+ Fix for bug 1310
+
+ ChangeLog@1.428.1.1 +1 -0
+ Fix for bug 1310
+
+ ntpd/refclock_palisade.c@1.29 +12 -9
+ Fix for bug 1310
+
+ChangeSet@1.1989, 2009-09-15 07:57:12-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P212
+ TAG: NTP_4_2_5P212
+
+ ChangeLog@1.429 +1 -0
+ NTP_4_2_5P212
+
+ ntpd/ntpd-opts.c@1.205 +2 -2
+ NTP_4_2_5P212
+
+ ntpd/ntpd-opts.h@1.205 +3 -3
+ NTP_4_2_5P212
+
+ ntpd/ntpd-opts.texi@1.203 +1 -1
+ NTP_4_2_5P212
+
+ ntpd/ntpd.1@1.203 +2 -2
+ NTP_4_2_5P212
+
+ ntpdc/ntpdc-opts.c@1.201 +2 -2
+ NTP_4_2_5P212
+
+ ntpdc/ntpdc-opts.h@1.201 +3 -3
+ NTP_4_2_5P212
+
+ ntpdc/ntpdc-opts.texi@1.200 +1 -1
+ NTP_4_2_5P212
+
+ ntpdc/ntpdc.1@1.200 +2 -2
+ NTP_4_2_5P212
+
+ ntpq/ntpq-opts.c@1.201 +2 -2
+ NTP_4_2_5P212
+
+ ntpq/ntpq-opts.h@1.201 +3 -3
+ NTP_4_2_5P212
+
+ ntpq/ntpq-opts.texi@1.200 +1 -1
+ NTP_4_2_5P212
+
+ ntpq/ntpq.1@1.200 +2 -2
+ NTP_4_2_5P212
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.81 +2 -2
+ NTP_4_2_5P212
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.81 +3 -3
+ NTP_4_2_5P212
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.81 +1 -1
+ NTP_4_2_5P212
+
+ ntpsnmpd/ntpsnmpd.1@1.81 +2 -2
+ NTP_4_2_5P212
+
+ packageinfo.sh@1.215 +1 -1
+ NTP_4_2_5P212
+
+ sntp/sntp-opts.c@1.75 +2 -2
+ NTP_4_2_5P212
+
+ sntp/sntp-opts.h@1.75 +3 -3
+ NTP_4_2_5P212
+
+ sntp/sntp-opts.texi@1.75 +1 -1
+ NTP_4_2_5P212
+
+ sntp/sntp.1@1.75 +2 -2
+ NTP_4_2_5P212
+
+ util/ntp-keygen-opts.c@1.204 +2 -2
+ NTP_4_2_5P212
+
+ util/ntp-keygen-opts.h@1.204 +3 -3
+ NTP_4_2_5P212
+
+ util/ntp-keygen-opts.texi@1.203 +1 -1
+ NTP_4_2_5P212
+
+ util/ntp-keygen.1@1.203 +2 -2
+ NTP_4_2_5P212
+
+ChangeSet@1.1988, 2009-09-15 03:49:51-04:00, stenn@whimsy.udel.edu
+ Typo cleanup
+
+ ChangeLog@1.428 +1 -2
+ Typo cleanup
+
+ChangeSet@1.1987, 2009-09-15 07:25:11+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1311] 4.2.5p211 doesn't build in no-debug mode.
+
+ ChangeLog@1.427 +3 -1
+ [Bug 1311] 4.2.5p211 doesn't build in no-debug mode.
+
+ ntpd/refclock_palisade.c@1.28 +73 -68
+ [Bug 1311] 4.2.5p211 doesn't build in no-debug mode.
+ convert leading whitespace to tabs
+
+ ntpd/refclock_palisade.h@1.13 +12 -10
+ convert leading whitespace to tabs
+
+ChangeSet@1.1984.1.3, 2009-09-15 02:21:46-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.421.2.6 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.51 +2 -2
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.43.1.1 +2 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1984.1.2, 2009-09-15 01:28:52-04:00, stenn@whimsy.udel.edu
+ Make the code agree with the spec and the book (Dave Mills)
+
+ ChangeLog@1.421.2.5 +1 -0
+ Make the code agree with the spec and the book (Dave Mills)
+
+ include/ntp.h@1.163 +1 -1
+ Make the code agree with the spec and the book (Dave Mills)
+
+ libntp/systime.c@1.48 +24 -19
+ Make the code agree with the spec and the book (Dave Mills)
+
+ ntpd/ntp_proto.c@1.293 +22 -29
+ Make the code agree with the spec and the book (Dave Mills)
+
+ ntpd/ntp_timer.c@1.55 +1 -1
+ Make the code agree with the spec and the book (Dave Mills)
+
+ChangeSet@1.1984.1.1, 2009-09-14 07:52:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P211
+ TAG: NTP_4_2_5P211
+
+ ChangeLog@1.421.2.4 +1 -0
+ NTP_4_2_5P211
+
+ ntpd/ntpd-opts.c@1.204 +2 -2
+ NTP_4_2_5P211
+
+ ntpd/ntpd-opts.h@1.204 +3 -3
+ NTP_4_2_5P211
+
+ ntpd/ntpd-opts.texi@1.202 +2 -2
+ NTP_4_2_5P211
+
+ ntpd/ntpd.1@1.202 +2 -2
+ NTP_4_2_5P211
+
+ ntpdc/ntpdc-opts.c@1.200 +2 -2
+ NTP_4_2_5P211
+
+ ntpdc/ntpdc-opts.h@1.200 +3 -3
+ NTP_4_2_5P211
+
+ ntpdc/ntpdc-opts.texi@1.199 +2 -2
+ NTP_4_2_5P211
+
+ ntpdc/ntpdc.1@1.199 +2 -2
+ NTP_4_2_5P211
+
+ ntpq/ntpq-opts.c@1.200 +12 -6
+ NTP_4_2_5P211
+
+ ntpq/ntpq-opts.h@1.200 +3 -3
+ NTP_4_2_5P211
+
+ ntpq/ntpq-opts.texi@1.199 +2 -2
+ NTP_4_2_5P211
+
+ ntpq/ntpq.1@1.199 +2 -2
+ NTP_4_2_5P211
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.80 +2 -2
+ NTP_4_2_5P211
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.80 +3 -3
+ NTP_4_2_5P211
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.80 +1 -1
+ NTP_4_2_5P211
+
+ ntpsnmpd/ntpsnmpd.1@1.80 +2 -2
+ NTP_4_2_5P211
+
+ packageinfo.sh@1.214 +1 -1
+ NTP_4_2_5P211
+
+ sntp/sntp-opts.c@1.74 +2 -2
+ NTP_4_2_5P211
+
+ sntp/sntp-opts.h@1.74 +3 -3
+ NTP_4_2_5P211
+
+ sntp/sntp-opts.texi@1.74 +51 -2
+ NTP_4_2_5P211
+
+ sntp/sntp.1@1.74 +2 -2
+ NTP_4_2_5P211
+
+ util/ntp-keygen-opts.c@1.203 +2 -2
+ NTP_4_2_5P211
+
+ util/ntp-keygen-opts.h@1.203 +3 -3
+ NTP_4_2_5P211
+
+ util/ntp-keygen-opts.texi@1.202 +3 -3
+ NTP_4_2_5P211
+
+ util/ntp-keygen.1@1.202 +2 -2
+ NTP_4_2_5P211
+
+ChangeSet@1.1983, 2009-09-14 03:30:37-04:00, stenn@pogo.udel.edu
+ [Bug 1296] Added Support for Trimble Acutime Gold
+
+ ChangeLog@1.421.4.1 +1 -0
+ [Bug 1296] Added Support for Trimble Acutime Gold
+
+ChangeSet@1.1981.4.1, 2009-09-12 11:54:54+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1292] more VC6 unsigned __int64 workarounds.
+
+ ChangeLog@1.421.3.1 +1 -0
+ [Bug 1292] more VC6 unsigned __int64 workarounds.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.35 +11 -4
+ [Bug 1292] more VC6 unsigned __int64 workarounds.
+
+ChangeSet@1.1981.3.1, 2009-09-12 07:25:45+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 663] respect ntpq -c and -p order on command line.
+
+ ChangeLog@1.421.2.1 +1 -0
+ [Bug 663] respect ntpq -c and -p order on command line.
+
+ ntpq/ntpq-opts.def@1.13 +2 -1
+ [Bug 663] respect ntpq -c and -p order on command line.
+
+ ntpq/ntpq.c@1.89 +37 -13
+ [Bug 663] respect ntpq -c and -p order on command line.
+
+ChangeSet@1.1981.2.1, 2009-09-11 06:55:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1243] MD5auth_setkey zero-fills key from first zero octet.
+ [Bug 1295] leftover fix, do not crash on exit in free_config_trap()
+ when "trap 1.2.3.4" is used without any further options.
+ CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths.
+ CID 80: attempt to quiet Coverity false positive re: leaking "reason"
+ in main().
+ CID 81: savedconfig leaked in save_config().
+
+ ChangeLog@1.421.1.1 +7 -0
+ [Bug 1243] MD5auth_setkey zero-fills key from first zero octet.
+ [Bug 1295] leftover fix, do not crash on exit in free_config_trap()
+ when "trap 1.2.3.4" is used without any further options.
+ CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths.
+ CID 80: attempt to quiet Coverity false positive re: leaking "reason"
+ in main().
+ CID 81: savedconfig leaked in save_config().
+
+ configure.ac@1.450.1.1 +20 -0
+ add support for --disable-bug1243-fix
+
+ include/ntpd.h@1.131.1.1 +12 -0
+ add framework from "enable bc_bug1243" under #ifdef for future use
+
+ libntp/authkeys.c@1.14 +18 -16
+ [Bug 1243] MD5auth_setkey zero-fills key from first zero octet.
+
+ ntpd/ntp_config.c@1.211.1.1 +122 -84
+ add framework from "enable bc_bug1243" under #ifdef for future use.
+ [Bug 1295] leftover fix, do not crash on exit in free_config_trap() when
+ "trap 1.2.3.4" is used without any further options.
+
+ ntpd/ntp_control.c@1.120.1.1 +2 -2
+ CID 81: savedconfig leaked in save_config()
+
+ ntpd/ntp_parser.c@1.42.1.1 +207 -210
+ Bison product
+
+ ntpd/ntp_parser.y@1.37.1.1 +11 -15
+ do not crash applying "crypto" command with no options.
+ add framework from "enable bc_bug1243" under #ifdef for future use.
+
+ sntp/kod_management.c@1.13 +6 -2
+ CID 79: kod_init_kod_db() fails to fclose(db_s) in two error paths
+ CID 80: attempt to quiet Coverity false positive re: leaking
+ "reason" in main()
+
+ChangeSet@1.1981.1.3, 2009-09-10 20:12:31+00:00, davehart@shiny.ad.hartbrothers.com
+ pick up Dr. Mills' miscopt.html leapfile indent correction from 8-Sep
+
+ html/miscopt.html@1.46 +2 -2
+ pick up Dr. Mills' leapfile indent correction from 8-Sep
+
+ChangeSet@1.1981.1.2, 2009-09-10 04:31:45+00:00, davehart@shiny.ad.hartbrothers.com
+ switch to verb then object order, "nic listen all", "interface drop eth0"
+ Correct syntax error line & column numbers.
+
+ ChangeLog@1.423 +2 -1
+ switch to verb then object order, "nic listen all", "interface drop eth0"
+ Correct syntax error line & column numbers.
+
+ html/miscopt.html@1.45 +2 -2
+ switch to verb then object order, "nic listen all", "interface drop eth0"
+
+ ntpd/ntp_config.c@1.213 +27 -21
+ switch to verb then object order, "nic listen all", "interface drop eth0"
+
+ ntpd/ntp_control.c@1.121 +4 -8
+ pass parser error message on to ntpq :config/config-from-file
+
+ ntpd/ntp_parser.c@1.44 +338 -346
+ Bison product
+
+ ntpd/ntp_parser.y@1.39 +22 -30
+ switch to verb then object order, "nic listen all", "interface drop eth0"
+
+ ntpd/ntp_scanner.c@1.24 +23 -4
+ get syntax error position right in more cases
+
+ ntpd/ntp_scanner.h@1.8 +4 -0
+ get syntax error position right in more cases
+
+ChangeSet@1.1981.1.1, 2009-09-09 16:58:54+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+ document interface (alias nic) and unpeer
+ make sure accessing ip_file->line_no is safe for :config
+
+ ChangeLog@1.422 +2 -0
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+ document interface (alias nic) and unpeer
+
+ configure.ac@1.451 +0 -17
+ remove --disable-listen-read-drop
+
+ html/confopt.html@1.46 +10 -4
+ document unpeer ntp.conf/ntpq :config directive
+
+ html/copyright.html@1.43 +2 -1
+ add Dave Hart, fix @@ typo for John Hay
+
+ html/miscopt.html@1.44 +2 -0
+ document interface ... [listen | ignore | drop]
+
+ html/scripts/confopt.txt@1.2 +1 -0
+ add unpeer
+
+ html/scripts/miscopt.txt@1.2 +2 -0
+ add interface and alias nic
+
+ include/ntp_config.h@1.60 +25 -7
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+
+ include/ntp_io.h@1.11 +26 -3
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+
+ include/ntpd.h@1.132 +1 -0
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+
+ ntpd/ntp_config.c@1.212 +224 -31
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+ make sure accessing ipfile->line_no and similar is safe during
+ runtime configuration
+
+ ntpd/ntp_io.c@1.297 +193 -132
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+
+ ntpd/ntp_parser.c@1.43 +1055 -984
+ Bison output
+
+ ntpd/ntp_parser.h@1.26 +321 -307
+ Bison output
+
+ ntpd/ntp_parser.y@1.38 +53 -4
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+
+ ntpd/ntpd.c@1.107 +16 -3
+ [Bug 983] add interface ... [listen | ignore | drop] directive.
+
+ChangeSet@1.1982, 2009-09-06 12:00:45-04:00, fernandoph@pogo.udel.edu
+ refclock_palisade.c, refclock_palisade.h:
+ [BUG 1296] Added Support for Trimble Acutime Gold.
+
+ ntpd/refclock_palisade.c@1.27 +131 -23
+ [BUG 1296] Added Support for Trimble Acutime Gold.
+
+ ntpd/refclock_palisade.h@1.12 +6 -4
+ [BUG 1296] Added Support for Trimble Acutime Gold.
+
+ChangeSet@1.1981, 2009-09-06 07:51:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P210
+ TAG: NTP_4_2_5P210
+
+ ChangeLog@1.421 +1 -0
+ NTP_4_2_5P210
+
+ ntpd/ntpd-opts.c@1.203 +2 -2
+ NTP_4_2_5P210
+
+ ntpd/ntpd-opts.h@1.203 +3 -3
+ NTP_4_2_5P210
+
+ ntpd/ntpd-opts.texi@1.201 +1 -1
+ NTP_4_2_5P210
+
+ ntpd/ntpd.1@1.201 +2 -2
+ NTP_4_2_5P210
+
+ ntpdc/ntpdc-opts.c@1.199 +2 -2
+ NTP_4_2_5P210
+
+ ntpdc/ntpdc-opts.h@1.199 +3 -3
+ NTP_4_2_5P210
+
+ ntpdc/ntpdc-opts.texi@1.198 +1 -1
+ NTP_4_2_5P210
+
+ ntpdc/ntpdc.1@1.198 +2 -2
+ NTP_4_2_5P210
+
+ ntpq/ntpq-opts.c@1.199 +2 -2
+ NTP_4_2_5P210
+
+ ntpq/ntpq-opts.h@1.199 +3 -3
+ NTP_4_2_5P210
+
+ ntpq/ntpq-opts.texi@1.198 +1 -1
+ NTP_4_2_5P210
+
+ ntpq/ntpq.1@1.198 +2 -2
+ NTP_4_2_5P210
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.79 +2 -2
+ NTP_4_2_5P210
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.79 +3 -3
+ NTP_4_2_5P210
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.79 +1 -1
+ NTP_4_2_5P210
+
+ ntpsnmpd/ntpsnmpd.1@1.79 +2 -2
+ NTP_4_2_5P210
+
+ packageinfo.sh@1.213 +1 -1
+ NTP_4_2_5P210
+
+ sntp/sntp-opts.c@1.73 +2 -2
+ NTP_4_2_5P210
+
+ sntp/sntp-opts.h@1.73 +3 -3
+ NTP_4_2_5P210
+
+ sntp/sntp-opts.texi@1.73 +1 -1
+ NTP_4_2_5P210
+
+ sntp/sntp.1@1.73 +2 -2
+ NTP_4_2_5P210
+
+ util/ntp-keygen-opts.c@1.202 +2 -2
+ NTP_4_2_5P210
+
+ util/ntp-keygen-opts.h@1.202 +3 -3
+ NTP_4_2_5P210
+
+ util/ntp-keygen-opts.texi@1.201 +1 -1
+ NTP_4_2_5P210
+
+ util/ntp-keygen.1@1.201 +2 -2
+ NTP_4_2_5P210
+
+ChangeSet@1.1979, 2009-09-06 08:38:28+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1294] change vs2008 include search path for OpenSSL from
+ $(OPENSSL)\inc32,$(OPENSSL)\include
+ to
+ $(OPENSSL_INC)
+ to match vc6, vs2003, and vs2005 changes from Danny
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.17 +2 -2
+ [Bug 1294] change vs2008 include search path for OpenSSL from
+ $(OPENSSL)\inc32,$(OPENSSL)\include
+ to
+ $(OPENSSL_INC)
+ to match vc6, vs2003, and vs2005 changes from Danny
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.6 +2 -2
+ [Bug 1294] change vs2008 include search path for OpenSSL from
+ $(OPENSSL)\inc32,$(OPENSSL)\include
+ to
+ $(OPENSSL_INC)
+ to match vc6, vs2003, and vs2005 changes from Danny
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.17 +2 -2
+ [Bug 1294] change vs2008 include search path for OpenSSL from
+ $(OPENSSL)\inc32,$(OPENSSL)\include
+ to
+ $(OPENSSL_INC)
+ to match vc6, vs2003, and vs2005 changes from Danny
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.9 +2 -2
+ [Bug 1294] change vs2008 include search path for OpenSSL from
+ $(OPENSSL)\inc32,$(OPENSSL)\include
+ to
+ $(OPENSSL_INC)
+ to match vc6, vs2003, and vs2005 changes from Danny
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.9 +2 -2
+ [Bug 1294] change vs2008 include search path for OpenSSL from
+ $(OPENSSL)\inc32,$(OPENSSL)\include
+ to
+ $(OPENSSL_INC)
+ to match vc6, vs2003, and vs2005 changes from Danny
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.8 +2 -2
+ [Bug 1294] change vs2008 include search path for OpenSSL from
+ $(OPENSSL)\inc32,$(OPENSSL)\include
+ to
+ $(OPENSSL_INC)
+ to match vc6, vs2003, and vs2005 changes from Danny
+
+ChangeSet@1.1976.1.1, 2009-09-06 04:00:32+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1295] trap directive options are not optional.
+ [Bug 1297] yylex() must always set yylval before returning.
+
+ ChangeLog@1.418.1.1 +2 -0
+ [Bug 1295] trap directive options are not optional.
+ [Bug 1297] yylex() must always set yylval before returning.
+
+ include/ntp.h@1.162 +1 -1
+ comment typo
+
+ include/ntp_config.h@1.59 +3 -0
+ add token_name() declaration
+
+ ntpd/Makefile.am@1.67 +1 -1
+ enable yacc/Bison report file (ntp_parser.output) generation
+ when making ntp_parser.[ch]. There is no need to commit
+ or distribute ntp_parser.output, it is only useful when
+ testing ntp_parser.y changes.
+
+
+ ntpd/ntp_config.c@1.211 +11 -10
+ enable yydebug verbose parser output with -D5 and higher
+ [Bug 1295] config_trap() bug introduced with dumper in 4.2.5p203
+
+
+ ntpd/ntp_control.c@1.120 +2 -1
+ truncate saveconfig output file at open so remnants of longer file
+ do not remain at the end after overwriting.
+
+ ntpd/ntp_parser.c@1.42 +876 -924
+ Bison product
+
+ ntpd/ntp_parser.h@1.25 +200 -204
+ Bison product
+
+ ntpd/ntp_parser.y@1.37 +230 -208
+ [Bug 1295] trap directive options are not optional.
+ [Bug 1297] yylex() debug output improvement needs %token-table and
+ new function to access it, token_name()
+ make all terminal T_ tokens type Integer so they can be used in
+ actions as $1, $2, etc: { imaginary_func($2) } instead of
+ { imaginary_func(T_Sometoken) }
+
+
+ ntpd/ntp_scanner.c@1.23 +56 -27
+ fix $1 style references to T_ values by setting yylval.Integer to the
+ T_ token for simple tokens with no other semantic value
+ improve debug output: yylex: lexeme 'trap' -> T_Trap
+
+
+ChangeSet@1.1978, 2009-09-02 14:15:16-04:00, mayer@pogo.udel.edu
+ [Bug 1294]
+
+ ChangeLog@1.419 +2 -0
+ [Bug 1294]
+
+ChangeSet@1.1977, 2009-09-02 14:13:00-04:00, mayer@pogo.udel.edu
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros for windows and Remove unnecessary OPENSSL applink.c include
+
+ ntpdc/ntpdc.c@1.68 +0 -6
+ [Bug1294] Remove unnecessary OPENSSL applink.c include
+
+ ntpq/ntpq.c@1.88 +0 -6
+ [Bug1294] Remove unnecessary OPENSSL applink.c include
+
+ ports/winnt/vc6/libntp.dsp@1.41 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vc6/ntpd.dsp@1.37 +4 -4
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vc6/ntpdate.dsp@1.21 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vc6/ntpdc.dsp@1.24 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.17 +4 -4
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vc6/ntpq.dsp@1.25 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2003/libntp.vcproj@1.2 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2003/ntpd.vcproj@1.2 +6 -6
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2003/ntpdate.vcproj@1.2 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2003/ntpdc.vcproj@1.2 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2003/ntpkeygen.vcproj@1.2 +4 -4
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2003/ntpq.vcproj@1.2 +2 -2
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2005/libntp.vcproj@1.2 +3 -3
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2005/ntpd.vcproj@1.2 +7 -7
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2005/ntpdate.vcproj@1.2 +3 -3
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.2 +3 -3
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.2 +5 -5
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ ports/winnt/vs2005/ntpq.vcproj@1.2 +3 -3
+ [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros
+
+ChangeSet@1.1976, 2009-09-01 07:51:38-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P209
+ TAG: NTP_4_2_5P209
+
+ ChangeLog@1.418 +1 -0
+ NTP_4_2_5P209
+
+ ntpd/ntpd-opts.c@1.202 +2 -2
+ NTP_4_2_5P209
+
+ ntpd/ntpd-opts.h@1.202 +3 -3
+ NTP_4_2_5P209
+
+ ntpd/ntpd-opts.texi@1.200 +1 -1
+ NTP_4_2_5P209
+
+ ntpd/ntpd.1@1.200 +2 -2
+ NTP_4_2_5P209
+
+ ntpdc/ntpdc-opts.c@1.198 +2 -2
+ NTP_4_2_5P209
+
+ ntpdc/ntpdc-opts.h@1.198 +3 -3
+ NTP_4_2_5P209
+
+ ntpdc/ntpdc-opts.texi@1.197 +1 -1
+ NTP_4_2_5P209
+
+ ntpdc/ntpdc.1@1.197 +2 -2
+ NTP_4_2_5P209
+
+ ntpq/ntpq-opts.c@1.198 +2 -2
+ NTP_4_2_5P209
+
+ ntpq/ntpq-opts.h@1.198 +3 -3
+ NTP_4_2_5P209
+
+ ntpq/ntpq-opts.texi@1.197 +1 -1
+ NTP_4_2_5P209
+
+ ntpq/ntpq.1@1.197 +2 -2
+ NTP_4_2_5P209
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.78 +2 -2
+ NTP_4_2_5P209
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.78 +3 -3
+ NTP_4_2_5P209
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.78 +1 -1
+ NTP_4_2_5P209
+
+ ntpsnmpd/ntpsnmpd.1@1.78 +2 -2
+ NTP_4_2_5P209
+
+ packageinfo.sh@1.212 +1 -1
+ NTP_4_2_5P209
+
+ sntp/sntp-opts.c@1.72 +2 -2
+ NTP_4_2_5P209
+
+ sntp/sntp-opts.h@1.72 +3 -3
+ NTP_4_2_5P209
+
+ sntp/sntp-opts.texi@1.72 +1 -1
+ NTP_4_2_5P209
+
+ sntp/sntp.1@1.72 +2 -2
+ NTP_4_2_5P209
+
+ util/ntp-keygen-opts.c@1.201 +2 -2
+ NTP_4_2_5P209
+
+ util/ntp-keygen-opts.h@1.201 +3 -3
+ NTP_4_2_5P209
+
+ util/ntp-keygen-opts.texi@1.200 +1 -1
+ NTP_4_2_5P209
+
+ util/ntp-keygen.1@1.200 +2 -2
+ NTP_4_2_5P209
+
+ChangeSet@1.1974, 2009-09-01 08:20:19+00:00, davehart@shiny.ad.hartbrothers.com
+ revert accidental pull of wrong repo (windowscompiler)
+
+ BitKeeper/deleted/.del-instsrv-VS2008.vcproj~af3a7a4284dd8b4f@1.2 +0 -0
+ Delete: ports/winnt/instsrv/instsrv-VS2008.vcproj
+
+ BitKeeper/deleted/.del-libntp-VS2008.vcproj~e944822ae4545d06@1.2 +0 -0
+ Delete: ports/winnt/libntp/libntp-VS2008.vcproj
+
+ BitKeeper/deleted/.del-ntp-VS2008.sln~b08951bb97303271@1.2 +0 -0
+ Delete: ports/winnt/ntp-VS2008.sln
+
+ BitKeeper/deleted/.del-ntp-keygen-VS2008.vcproj~f2e7f85d5942b392@1.2 +0 -0
+ Delete: ports/winnt/ntp-keygen/ntp-keygen-VS2008.vcproj
+
+ BitKeeper/deleted/.del-ntpd-VS2008.vcproj~63a1a8b5a4f17de8@1.2 +0 -0
+ Delete: ports/winnt/ntpd/ntpd-VS2008.vcproj
+
+ BitKeeper/deleted/.del-ntpdate-VS2008.vcproj~dcb57743d0d7d96d@1.2 +0 -0
+ Delete: ports/winnt/ntpdate/ntpdate-VS2008.vcproj
+
+ BitKeeper/deleted/.del-ntpdc-VS2008.vcproj~6b071c10ef40334b@1.2 +0 -0
+ Delete: ports/winnt/ntpdc/ntpdc-VS2008.vcproj
+
+ BitKeeper/deleted/.del-ntpkeygen.vcproj~9130c0edbfb4b39b@1.2 +0 -0
+ Delete: ports/winnt/ntp-keygen/ntpkeygen.vcproj
+
+ BitKeeper/deleted/.del-ntpq-VS2008.vcproj~3d9c726f33ecd5f@1.2 +0 -0
+ Delete: ports/winnt/ntpq/ntpq-VS2008.vcproj
+
+ ChangeLog@1.416 +0 -2
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/libntp/libntp.dsp@1.38 +0 -4
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/libntp/libntp.vcproj@1.14 +47 -148
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.14 +4 -0
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntp.sln@1.5 +46 -43
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpd/ntpd.dsp@1.34 +4 -0
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpd/ntpd.vcproj@1.14 +117 -119
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpdate/ntpdate.dsp@1.18 +4 -0
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.6 +85 -20
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.21 +4 -0
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.6 +46 -20
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpq/ntpq.dsp@1.22 +4 -0
+ revert accidental pull of wrong repo (windowscompiler)
+
+ ports/winnt/ntpq/ntpq.vcproj@1.5 +36 -20
+ revert accidental pull of wrong repo (windowscompiler)
+
+ChangeSet@1.1968.1.18, 2009-08-31 21:57:23-04:00, mayer@pogo.udel.edu
+ [Bug 1289] update to add VS2003
+
+ ChangeLog@1.413.1.11 +1 -1
+ [Bug 1289] update to add VS2003
+
+ChangeSet@1.1968.1.17, 2009-08-31 16:58:47-04:00, mayer@pogo.udel.edu
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/Instsrv.vcproj@1.1 +174 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/Instsrv.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2003/libntp.vcproj@1.1 +2058 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/libntp.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2003/ntp.sln@1.1 +73 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/ntp.sln@1.0 +0 -0
+
+ ports/winnt/vs2003/ntpd.vcproj@1.1 +2113 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/ntpd.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2003/ntpdate.vcproj@1.1 +221 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/ntpdate.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2003/ntpdc.vcproj@1.1 +265 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/ntpdc.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2003/ntpkeygen.vcproj@1.1 +302 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/ntpkeygen.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2003/ntpq.vcproj@1.1 +263 -0
+ [Bug 1289] Add vs2003 compiler files
+
+ ports/winnt/vs2003/ntpq.vcproj@1.0 +0 -0
+
+ChangeSet@1.1968.1.16, 2009-08-31 09:56:29-04:00, mayer@pogo.udel.edu
+ [Bug 1290]
+
+ ChangeLog@1.413.1.10 +2 -1
+ [Bug 1290]
+
+ChangeSet@1.1968.1.15, 2009-08-31 09:54:57-04:00, mayer@pogo.udel.edu
+ [Bug 1290] Fix to use GETTIMEOFDAY macro
+
+ ntpd/refclock_oncore.c@1.78.1.1 +1 -1
+ [Bug 1290] Fix to use GETTIMEOFDAY macro
+
+ChangeSet@1.1968.1.14, 2009-08-31 09:50:13-04:00, mayer@pogo.udel.edu
+ [Bug 1289] Use quotes instead of angle brackets for include of messages.h
+
+ ports/winnt/libntp/syslog.c@1.5 +1 -1
+ [Bug 1289] Use quotes instead of angle brackets for include of messages.h
+
+ChangeSet@1.1968.1.13, 2009-08-30 23:47:19-04:00, mayer@pogo.udel.edu
+ [Bug 1289]
+
+ ChangeLog@1.413.1.9 +1 -0
+ [Bug 1289]
+
+ChangeSet@1.1968.1.12, 2009-08-30 23:36:44-04:00, mayer@pogo.udel.edu
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/Instsrv.vcproj@1.1 +242 -0
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/Instsrv.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2005/libntp.vcproj@1.1 +2250 -0
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/libntp.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2005/ntp.sln@1.1 +68 -0
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vs2005/ntp.sln@1.0 +0 -0
+
+ ports/winnt/vs2005/ntpd.vcproj@1.1 +2237 -0
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/ntpd.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2005/ntpdate.vcproj@1.1 +292 -0
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/ntpdate.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.1 +336 -0
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/ntpdc.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.1 +376 -0
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/ntpkeygen.vcproj@1.0 +0 -0
+
+ ports/winnt/vs2005/ntpq.vcproj@1.1 +336 -0
+ [Bug #1289] Update project files for VS2005
+
+ ports/winnt/vs2005/ntpq.vcproj@1.0 +0 -0
+
+ChangeSet@1.1968.1.11, 2009-08-30 23:30:53-04:00, mayer@pogo.udel.edu
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/Instsrv.dsp@1.9 +9 -9
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/libntp.dsp@1.36.1.2 +23 -19
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/ntp.dsw@1.9 +7 -7
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/ntpd.dsp@1.32.1.2 +17 -21
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/ntpdate.dsp@1.16.1.2 +12 -16
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/ntpdc.dsp@1.19.1.2 +13 -17
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.12.1.2 +10 -14
+ [Bug #1289] Update project files for VS6
+
+ ports/winnt/vc6/ntpq.dsp@1.20.1.2 +12 -16
+ [Bug #1289] Update project files for VS6
+
+ChangeSet@1.1968.1.10, 2009-08-30 23:28:42-04:00, mayer@pogo.udel.edu
+ [Bug #1289] Move compiler project for VS6
+
+ ports/winnt/vc6/Instsrv.dsp@1.8 +0 -0
+ Rename: ports/winnt/instsrv/Instsrv.dsp -> ports/winnt/vc6/Instsrv.dsp
+
+ ports/winnt/vc6/libntp.dsp@1.36.1.1 +0 -0
+ Rename: ports/winnt/libntp/libntp.dsp -> ports/winnt/vc6/libntp.dsp
+
+ ports/winnt/vc6/ntp.dsw@1.8 +0 -0
+ Rename: ports/winnt/ntp.dsw -> ports/winnt/vc6/ntp.dsw
+
+ ports/winnt/vc6/ntpd.dsp@1.32.1.1 +0 -0
+ Rename: ports/winnt/ntpd/ntpd.dsp -> ports/winnt/vc6/ntpd.dsp
+
+ ports/winnt/vc6/ntpdate.dsp@1.16.1.1 +0 -0
+ Rename: ports/winnt/ntpdate/ntpdate.dsp -> ports/winnt/vc6/ntpdate.dsp
+
+ ports/winnt/vc6/ntpdc.dsp@1.19.1.1 +0 -0
+ Rename: ports/winnt/ntpdc/ntpdc.dsp -> ports/winnt/vc6/ntpdc.dsp
+
+ ports/winnt/vc6/ntpkeygen.dsp@1.12.1.1 +0 -0
+ Rename: ports/winnt/ntp-keygen/ntpkeygen.dsp -> ports/winnt/vc6/ntpkeygen.dsp
+
+ ports/winnt/vc6/ntpq.dsp@1.20.1.1 +0 -0
+ Rename: ports/winnt/ntpq/ntpq.dsp -> ports/winnt/vc6/ntpq.dsp
+
+ChangeSet@1.1968.1.8, 2009-08-30 03:02:04-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P208
+ TAG: NTP_4_2_5P208
+
+ ChangeLog@1.413.1.7 +1 -0
+ NTP_4_2_5P208
+
+ ntpd/ntpd-opts.c@1.201 +2 -2
+ NTP_4_2_5P208
+
+ ntpd/ntpd-opts.h@1.201 +3 -3
+ NTP_4_2_5P208
+
+ ntpd/ntpd-opts.texi@1.199 +1 -1
+ NTP_4_2_5P208
+
+ ntpd/ntpd.1@1.199 +2 -2
+ NTP_4_2_5P208
+
+ ntpdc/ntpdc-opts.c@1.197 +2 -2
+ NTP_4_2_5P208
+
+ ntpdc/ntpdc-opts.h@1.197 +3 -3
+ NTP_4_2_5P208
+
+ ntpdc/ntpdc-opts.texi@1.196 +1 -1
+ NTP_4_2_5P208
+
+ ntpdc/ntpdc.1@1.196 +2 -2
+ NTP_4_2_5P208
+
+ ntpq/ntpq-opts.c@1.197 +2 -2
+ NTP_4_2_5P208
+
+ ntpq/ntpq-opts.h@1.197 +3 -3
+ NTP_4_2_5P208
+
+ ntpq/ntpq-opts.texi@1.196 +1 -1
+ NTP_4_2_5P208
+
+ ntpq/ntpq.1@1.196 +2 -2
+ NTP_4_2_5P208
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.77 +2 -2
+ NTP_4_2_5P208
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.77 +3 -3
+ NTP_4_2_5P208
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.77 +1 -1
+ NTP_4_2_5P208
+
+ ntpsnmpd/ntpsnmpd.1@1.77 +2 -2
+ NTP_4_2_5P208
+
+ packageinfo.sh@1.211 +1 -1
+ NTP_4_2_5P208
+
+ sntp/sntp-opts.c@1.71 +2 -2
+ NTP_4_2_5P208
+
+ sntp/sntp-opts.h@1.71 +3 -3
+ NTP_4_2_5P208
+
+ sntp/sntp-opts.texi@1.71 +1 -1
+ NTP_4_2_5P208
+
+ sntp/sntp.1@1.71 +2 -2
+ NTP_4_2_5P208
+
+ util/ntp-keygen-opts.c@1.200 +2 -2
+ NTP_4_2_5P208
+
+ util/ntp-keygen-opts.h@1.200 +3 -3
+ NTP_4_2_5P208
+
+ util/ntp-keygen-opts.texi@1.199 +1 -1
+ NTP_4_2_5P208
+
+ util/ntp-keygen.1@1.199 +2 -2
+ NTP_4_2_5P208
+
+ChangeSet@1.1968.3.2, 2009-08-29 21:22:45+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1293] make configuration dumper ready for release, specifically:
+ rename ntpq dumpcfg command to "saveconfig".
+ require authentication for saveconfig.
+ "restrict ... nomodify" prevents saveconfig and :config.
+ "saveconfig ." shorthand to save to startup configuration file.
+ support strftime() substitution in saveconfig arg to timestamp
+ the output filename, for example "saveconfig %Y%m%d-%H%M%S.conf".
+ display saveconfig response message from ntpd in ntpq.
+ save output filename in "savedconfig" variable, fetched with ntpq -c
+ "rv 0 savedconfig".
+ document saveconfig in html/ntpq.html.
+ add ./configure --disable-saveconfig to build a smaller ntpd.
+ log saveconfig failures and successes to syslog.
+
+
+ ChangeLog@1.413.3.1 +13 -0
+ [Bug 1293] make configuration dumper ready for release, specifically:
+ rename ntpq dumpcfg command to "saveconfig".
+ require authentication for saveconfig.
+ "restrict ... nomodify" prevents saveconfig and :config.
+ "saveconfig ." shorthand to save to startup configuration file.
+ support strftime() substitution in saveconfig arg to timestamp
+ the output filename, for example "saveconfig %Y%m%d-%H%M%S.conf".
+ display saveconfig response message from ntpd in ntpq.
+ save output filename in "savedconfig" variable, fetched with ntpq -c
+ "rv 0 savedconfig".
+ document saveconfig in html/ntpq.html.
+ add ./configure --disable-saveconfig to build a smaller ntpd.
+ log saveconfig failures and successes to syslog.
+
+
+ html/ntpq.html@1.32 +13 -8
+ document "config-from-file" and "saveconfig"
+ use <br> and no <dt> between "cv" and "clockvar" as with other synonyms.
+ typo "helpl" -> "help".
+ typo "apear" -> "appear"
+
+ include/ntp_config.h@1.58 +2 -1
+ support ./configure --disable-saveconfig
+
+ include/ntp_control.h@1.37 +2 -2
+ CTL_OP_DUMPCONFIG renamed CTL_OP_SAVECONFIG
+
+ include/ntpd.h@1.131 +1 -1
+ expose cfg_tree_history as extern for ntp_control.c save_config()
+
+ ntpd/ntp_config.c@1.210 +5 -1
+ support ./configure --disable-saveconfig
+
+ ntpd/ntp_control.c@1.119 +101 -35
+ dump_config() renamed save_config()
+ CTL_OP_DUMPCONFIG renamed CTL_OP_SAVECONFIG
+ add "savedconfig" system variable containing last saveconfig filename
+ support ./configure --disable-saveconfig
+ log saveconfig failures and successes to syslog
+ enforce "restrict ... nomodify" preventing ntpq :config, config-from-file,
+ and saveconfig
+ require authentication for saveconfig
+ remove restrictions on saveconfig output directory, allow overwriting
+ exiting files
+ support "saveconfig ." to replace the startup configuration file
+ allow strftime() format specifiers in saveconfig filename, such as
+ "saveconfig ntp-%Y%m%d-%H%M%S.conf"
+
+ ntpd/ntp_intres.c@1.65 +2 -2
+ clean up unreferenced local warnings
+
+ ntpd/ntp_io.c@1.296 +1 -2
+ clean up unreferenced local warning
+
+ ntpq/ntpq-subs.c@1.35 +21 -13
+ rename ntpq dumpcfg to saveconfig, require authentication
+
+ ports/winnt/include/config.h@1.74.1.1 +1 -1
+ default to equivalent of --enable-saveconfig as with Unix
+ warn on unreferenced local variables
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.49 +0 -2
+ remove unreferenced locals
+
+ChangeSet@1.1968.1.6, 2009-08-29 07:50:13-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P207
+ TAG: NTP_4_2_5P207
+
+ ChangeLog@1.413.1.5 +1 -0
+ NTP_4_2_5P207
+
+ ntpd/ntpd-opts.c@1.200 +2 -2
+ NTP_4_2_5P207
+
+ ntpd/ntpd-opts.h@1.200 +3 -3
+ NTP_4_2_5P207
+
+ ntpd/ntpd-opts.texi@1.198 +1 -1
+ NTP_4_2_5P207
+
+ ntpd/ntpd.1@1.198 +2 -2
+ NTP_4_2_5P207
+
+ ntpdc/ntpdc-opts.c@1.196 +2 -2
+ NTP_4_2_5P207
+
+ ntpdc/ntpdc-opts.h@1.196 +3 -3
+ NTP_4_2_5P207
+
+ ntpdc/ntpdc-opts.texi@1.195 +1 -1
+ NTP_4_2_5P207
+
+ ntpdc/ntpdc.1@1.195 +2 -2
+ NTP_4_2_5P207
+
+ ntpq/ntpq-opts.c@1.196 +2 -2
+ NTP_4_2_5P207
+
+ ntpq/ntpq-opts.h@1.196 +3 -3
+ NTP_4_2_5P207
+
+ ntpq/ntpq-opts.texi@1.195 +1 -1
+ NTP_4_2_5P207
+
+ ntpq/ntpq.1@1.195 +2 -2
+ NTP_4_2_5P207
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.76 +2 -2
+ NTP_4_2_5P207
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.76 +3 -3
+ NTP_4_2_5P207
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.76 +1 -1
+ NTP_4_2_5P207
+
+ ntpsnmpd/ntpsnmpd.1@1.76 +2 -2
+ NTP_4_2_5P207
+
+ packageinfo.sh@1.210 +1 -1
+ NTP_4_2_5P207
+
+ sntp/sntp-opts.c@1.70 +2 -2
+ NTP_4_2_5P207
+
+ sntp/sntp-opts.h@1.70 +3 -3
+ NTP_4_2_5P207
+
+ sntp/sntp-opts.texi@1.70 +1 -1
+ NTP_4_2_5P207
+
+ sntp/sntp.1@1.70 +2 -2
+ NTP_4_2_5P207
+
+ util/ntp-keygen-opts.c@1.199 +2 -2
+ NTP_4_2_5P207
+
+ util/ntp-keygen-opts.h@1.199 +3 -3
+ NTP_4_2_5P207
+
+ util/ntp-keygen-opts.texi@1.198 +1 -1
+ NTP_4_2_5P207
+
+ util/ntp-keygen.1@1.198 +2 -2
+ NTP_4_2_5P207
+
+ChangeSet@1.1968.3.1, 2009-08-29 05:08:56-04:00, stenn@pogo.udel.edu
+ [Bug 1293] add support for --disable-saveconfig to configure.ac
+
+ configure.ac@1.450 +10 -0
+ [Bug 1293] add support for --disable-saveconfig to configure.ac
+
+ChangeSet@1.1968.2.1, 2009-08-28 07:40:42+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ChangeLog@1.413.2.1 +1 -0
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/scripts/mkver.bat@1.11 +19 -24
+ support per-compiler build subdirs under winnt
+ remove no-longer-needed support for getting version from version.m4
+ (packageinfo.sh has been used for some time)
+
+ ports/winnt/vs2008/instsrv/instsrv.vcproj@1.4 +15 -15
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/vs2008/instsrv/instsrv.vcproj@1.3 +0 -0
+ Rename: ports/winnt/vs2008/instsrv.vcproj -> ports/winnt/vs2008/instsrv/instsrv.vcproj
+
+ ports/winnt/vs2008/instsrv.vcproj@1.2 +0 -0
+ Rename: ports/winnt/instsrv/instsrv.vcproj -> ports/winnt/vs2008/instsrv.vcproj
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.12.1.3 +150 -150
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/vs2008/libntp/libntp.vcproj@1.12.1.2 +0 -0
+ Rename: ports/winnt/vs2008/libntp.vcproj -> ports/winnt/vs2008/libntp/libntp.vcproj
+
+ ports/winnt/vs2008/libntp.vcproj@1.12.1.1 +0 -0
+ Rename: ports/winnt/libntp/libntp.vcproj -> ports/winnt/vs2008/libntp.vcproj
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.5 +27 -27
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj@1.4 +0 -0
+ Rename: ports/winnt/vs2008/ntp-keygen.vcproj -> ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj
+
+ ports/winnt/vs2008/ntp-keygen.vcproj@1.3 +0 -0
+ Rename: ports/winnt/ntp-keygen/ntp-keygen.vcproj -> ports/winnt/vs2008/ntp-keygen.vcproj
+
+ ports/winnt/vs2008/ntp.sln@1.3.1.1 +0 -0
+ Rename: ports/winnt/ntp.sln -> ports/winnt/vs2008/ntp.sln
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.12.1.3 +169 -169
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.12.1.2 +0 -0
+ Rename: ports/winnt/vs2008/ntpd.vcproj -> ports/winnt/vs2008/ntpd/ntpd.vcproj
+
+ ports/winnt/vs2008/ntpd.vcproj@1.12.1.1 +0 -0
+ Rename: ports/winnt/ntpd/ntpd.vcproj -> ports/winnt/vs2008/ntpd.vcproj
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.4.1.3 +35 -35
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/vs2008/ntpdate/ntpdate.vcproj@1.4.1.2 +0 -0
+ Rename: ports/winnt/vs2008/ntpdate.vcproj -> ports/winnt/vs2008/ntpdate/ntpdate.vcproj
+
+ ports/winnt/vs2008/ntpdate.vcproj@1.4.1.1 +0 -0
+ Rename: ports/winnt/ntpdate/ntpdate.vcproj -> ports/winnt/vs2008/ntpdate.vcproj
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.4.1.3 +26 -26
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/vs2008/ntpdc/ntpdc.vcproj@1.4.1.2 +0 -0
+ Rename: ports/winnt/vs2008/ntpdc.vcproj -> ports/winnt/vs2008/ntpdc/ntpdc.vcproj
+
+ ports/winnt/vs2008/ntpdc.vcproj@1.4.1.1 +0 -0
+ Rename: ports/winnt/ntpdc/ntpdc.vcproj -> ports/winnt/vs2008/ntpdc.vcproj
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.3.1.3 +25 -25
+ [Bug 1289] Move vc9/vs2008 build to ports\winnt\vs2008.
+
+ ports/winnt/vs2008/ntpq/ntpq.vcproj@1.3.1.2 +0 -0
+ Rename: ports/winnt/vs2008/ntpq.vcproj -> ports/winnt/vs2008/ntpq/ntpq.vcproj
+
+ ports/winnt/vs2008/ntpq.vcproj@1.3.1.1 +0 -0
+ Rename: ports/winnt/ntpq/ntpq.vcproj -> ports/winnt/vs2008/ntpq.vcproj
+
+ChangeSet@1.1968.1.5, 2009-08-27 20:02:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1292] Minor Windows source tweaks for VC6-era SDK headers.
+ From Martin Burnicki
+
+ ChangeLog@1.413.1.4 +1 -0
+ [Bug 1292] Minor Windows source tweaks for VC6-era SDK headers.
+ From Martin Burnicki
+
+ ports/winnt/include/config.h@1.75 +3 -1
+ #include <malloc.h> before <crtdbg.h> for VC6 header compatibility
+ unconditionally #define ISC_PLATFORM_HAVEIN6PKTINFO
+ Thanks Martin Burnicki
+
+ ports/winnt/libisc/interfaceiter.c@1.10 +2 -0
+ protect reference to sin6_scope_id with ISC_PLATFORM_HAVESCOPEID for
+ VC6 SDK headers compatibility
+
+ChangeSet@1.1972, 2009-08-26 23:42:30-04:00, mayer@pogo.udel.edu
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/instsrv/instsrv-VS2008.vcproj@1.1 +253 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/instsrv/instsrv-VS2008.vcproj@1.0 +0 -0
+
+ ports/winnt/libntp/libntp-VS2008.vcproj@1.1 +2149 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/libntp/libntp-VS2008.vcproj@1.0 +0 -0
+
+ ports/winnt/ntp-VS2008.sln@1.1 +71 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/ntp-VS2008.sln@1.0 +0 -0
+
+ ports/winnt/ntp-keygen/ntp-keygen-VS2008.vcproj@1.1 +397 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/ntp-keygen/ntp-keygen-VS2008.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpd/ntpd-VS2008.vcproj@1.1 +2235 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/ntpd/ntpd-VS2008.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpdate/ntpdate-VS2008.vcproj@1.1 +357 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/ntpdate/ntpdate-VS2008.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpdc/ntpdc-VS2008.vcproj@1.1 +362 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/ntpdc/ntpdc-VS2008.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpq/ntpq-VS2008.vcproj@1.1 +352 -0
+ Bug #1289 - separate compiler files for VS 2008
+
+ ports/winnt/ntpq/ntpq-VS2008.vcproj@1.0 +0 -0
+
+ChangeSet@1.1968.1.4, 2009-08-26 07:54:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P206
+ TAG: NTP_4_2_5P206
+
+ ChangeLog@1.413.1.3 +1 -0
+ NTP_4_2_5P206
+
+ ntpd/ntpd-opts.c@1.199 +2 -2
+ NTP_4_2_5P206
+
+ ntpd/ntpd-opts.h@1.199 +3 -3
+ NTP_4_2_5P206
+
+ ntpd/ntpd-opts.texi@1.197 +1 -1
+ NTP_4_2_5P206
+
+ ntpd/ntpd.1@1.197 +2 -2
+ NTP_4_2_5P206
+
+ ntpdc/ntpdc-opts.c@1.195 +2 -2
+ NTP_4_2_5P206
+
+ ntpdc/ntpdc-opts.h@1.195 +3 -3
+ NTP_4_2_5P206
+
+ ntpdc/ntpdc-opts.texi@1.194 +1 -1
+ NTP_4_2_5P206
+
+ ntpdc/ntpdc.1@1.194 +2 -2
+ NTP_4_2_5P206
+
+ ntpq/ntpq-opts.c@1.195 +2 -2
+ NTP_4_2_5P206
+
+ ntpq/ntpq-opts.h@1.195 +3 -3
+ NTP_4_2_5P206
+
+ ntpq/ntpq-opts.texi@1.194 +1 -1
+ NTP_4_2_5P206
+
+ ntpq/ntpq.1@1.194 +2 -2
+ NTP_4_2_5P206
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.75 +2 -2
+ NTP_4_2_5P206
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.75 +3 -3
+ NTP_4_2_5P206
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.75 +1 -1
+ NTP_4_2_5P206
+
+ ntpsnmpd/ntpsnmpd.1@1.75 +2 -2
+ NTP_4_2_5P206
+
+ packageinfo.sh@1.209 +1 -1
+ NTP_4_2_5P206
+
+ sntp/sntp-opts.c@1.69 +11 -11
+ NTP_4_2_5P206
+
+ sntp/sntp-opts.h@1.69 +6 -6
+ NTP_4_2_5P206
+
+ sntp/sntp-opts.texi@1.69 +11 -9
+ NTP_4_2_5P206
+
+ sntp/sntp.1@1.69 +15 -13
+ NTP_4_2_5P206
+
+ util/ntp-keygen-opts.c@1.198 +2 -2
+ NTP_4_2_5P206
+
+ util/ntp-keygen-opts.h@1.198 +3 -3
+ NTP_4_2_5P206
+
+ util/ntp-keygen-opts.texi@1.197 +1 -1
+ NTP_4_2_5P206
+
+ util/ntp-keygen.1@1.197 +2 -2
+ NTP_4_2_5P206
+
+ChangeSet@1.1968.1.3, 2009-08-26 04:48:50-04:00, stenn@whimsy.udel.edu
+ accopt.html typo fixes from Dave Mills
+
+ ChangeLog@1.413.1.2 +1 -0
+ accopt.html typo fixes from Dave Mills
+
+ html/accopt.html@1.32 +3 -3
+ accopt.html typo fixes from Dave Mills
+
+ChangeSet@1.1968.1.2, 2009-08-26 04:14:45-04:00, stenn@whimsy.udel.edu
+ The 2nd fopen in write_kod_db() must be inside the block. From Dave Hart.
+
+ sntp/kod_management.c@1.12 +16 -17
+ The 2nd fopen in write_kod_db() must be inside the block. From Dave Hart.
+
+ChangeSet@1.1968.1.1, 2009-08-26 00:48:46+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1283] default to remembering KoD in sntp
+ clean up numerous sntp/kod_management.c bugs
+ use all addresses resolved from each DNS name
+
+ ChangeLog@1.413.1.1 +3 -0
+ [Bug 1283] default to remembering KoD in sntp.
+ clean up numerous sntp/kod_management.c bugs.
+ use all addresses resolved from each DNS name.
+
+ configure.ac@1.449 +1 -1
+ change "permanent DNS errors" to "permanent DNS failures" to make
+ it simpler to grep for errors in make.log
+
+ libntp/emalloc.c@1.9 +22 -9
+ send emalloc() and friends fatal error messages to stderr as well as syslog
+
+ ntpd/ntp_config.c@1.209 +6 -11
+ clean up unreferenced locals warnings in free_config_*()
+
+ sntp/configure.ac@1.19 +1 -0
+ add NTP_DIR_SEP to define DIR_SEP (/ or \)
+
+ sntp/crypto.c@1.8 +2 -2
+ malloc() -> emalloc()
+
+ sntp/kod_management.c@1.11 +148 -142
+ KOD -> KoD
+ Do not complain about KoD file format if it's named /dev/null
+ change KoD field separator from colon to space to support IPv6 addresses
+ save KoD file even if one wasn't loaded
+ create directories if needed while writing KoD file
+ clean up confusion over kod_db being an array of pointers or structs
+
+
+ sntp/kod_management.h@1.7 +8 -9
+ use time_t for KoD timestamp instead of uint
+ remove unused items
+
+ sntp/main.c@1.18 +83 -68
+ [Bug 1283] default to remembering KoD in sntp
+ use all addresses resolved from each DNS name
+ add test code for KoD DB (disabled by #ifdef)
+ resolve alloca() implicit decl warnings by eliminating its use
+ don't treat pkt.refid as zero terminated, it's not
+
+ sntp/netutils.c@1.3 +5 -5
+ malloc() -> emalloc()
+
+ sntp/networking.c@1.24 +5 -5
+ malloc() -> emalloc()
+ change default broadcast timeout from 60 to 68 since ntpd
+ broadcasts every 64 seconds
+
+ sntp/sntp-opts.def@1.11 +11 -17
+ Update --kod/-K descrip and doc
+ use common copyright.def instead of explicit copyright block
+ Update -b & -t descrip/doc to reflect change to 68 second timeout
+
+ sntp/utilities.c@1.9 +8 -19
+ malloc() -> emalloc()
+ use pointer cast instead of copy in pkt_output()
+
+ sntp/utilities.h@1.7 +1 -0
+ include ntp_stdlib.h for emalloc()
+
+ChangeSet@1.1971, 2009-08-24 15:25:59-04:00, mayer@pogo.udel.edu
+ Bug fixes 1289 and 1290
+
+ ChangeLog@1.414 +2 -0
+ Bug fixes 1289 and 1290
+
+ ntpd/refclock_oncore.c@1.79 +1 -1
+ [Bug 1290] use macro GETTIMEOFDAY instead of gettimeofday()
+
+ChangeSet@1.1970, 2009-08-24 15:19:05-04:00, mayer@pogo.udel.edu
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.1 +376 -0
+ keygen file
+
+ ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.0 +0 -0
+
+ChangeSet@1.1969, 2009-08-24 15:14:02-04:00, mayer@pogo.udel.edu
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/libntp/libntp.dsp@1.37 +4 -0
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/libntp/libntp.vcproj@1.13 +148 -47
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.13 +0 -4
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntp.sln@1.4 +43 -46
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpd/ntpd.dsp@1.33 +0 -4
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpd/ntpd.vcproj@1.13 +119 -117
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpdate/ntpdate.dsp@1.17 +0 -4
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.5 +20 -85
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.20 +0 -4
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.5 +20 -46
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpq/ntpq.dsp@1.21 +0 -4
+ [Bug 1289] Fix compiler files for Windows
+
+ ports/winnt/ntpq/ntpq.vcproj@1.4 +20 -36
+ [Bug 1289] Fix compiler files for Windows
+
+ChangeSet@1.1968, 2009-08-18 07:50:08-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P205
+ TAG: NTP_4_2_5P205
+
+ ChangeLog@1.413 +1 -0
+ NTP_4_2_5P205
+
+ ntpd/ntpd-opts.c@1.198 +2 -2
+ NTP_4_2_5P205
+
+ ntpd/ntpd-opts.h@1.198 +3 -3
+ NTP_4_2_5P205
+
+ ntpd/ntpd-opts.texi@1.196 +1 -1
+ NTP_4_2_5P205
+
+ ntpd/ntpd.1@1.196 +2 -2
+ NTP_4_2_5P205
+
+ ntpdc/ntpdc-opts.c@1.194 +2 -2
+ NTP_4_2_5P205
+
+ ntpdc/ntpdc-opts.h@1.194 +3 -3
+ NTP_4_2_5P205
+
+ ntpdc/ntpdc-opts.texi@1.193 +1 -1
+ NTP_4_2_5P205
+
+ ntpdc/ntpdc.1@1.193 +2 -2
+ NTP_4_2_5P205
+
+ ntpq/ntpq-opts.c@1.194 +2 -2
+ NTP_4_2_5P205
+
+ ntpq/ntpq-opts.h@1.194 +3 -3
+ NTP_4_2_5P205
+
+ ntpq/ntpq-opts.texi@1.193 +1 -1
+ NTP_4_2_5P205
+
+ ntpq/ntpq.1@1.193 +2 -2
+ NTP_4_2_5P205
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.74 +2 -2
+ NTP_4_2_5P205
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.74 +3 -3
+ NTP_4_2_5P205
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.74 +1 -1
+ NTP_4_2_5P205
+
+ ntpsnmpd/ntpsnmpd.1@1.74 +2 -2
+ NTP_4_2_5P205
+
+ packageinfo.sh@1.208 +1 -1
+ NTP_4_2_5P205
+
+ sntp/sntp-opts.c@1.68 +2 -2
+ NTP_4_2_5P205
+
+ sntp/sntp-opts.h@1.68 +3 -3
+ NTP_4_2_5P205
+
+ sntp/sntp-opts.texi@1.68 +1 -1
+ NTP_4_2_5P205
+
+ sntp/sntp.1@1.68 +2 -2
+ NTP_4_2_5P205
+
+ util/ntp-keygen-opts.c@1.197 +2 -2
+ NTP_4_2_5P205
+
+ util/ntp-keygen-opts.h@1.197 +3 -3
+ NTP_4_2_5P205
+
+ util/ntp-keygen-opts.texi@1.196 +1 -1
+ NTP_4_2_5P205
+
+ util/ntp-keygen.1@1.196 +2 -2
+ NTP_4_2_5P205
+
+ChangeSet@1.1967, 2009-08-18 02:18:21-04:00, stenn@whimsy.udel.edu
+ accopt.html typo fixes from Dave Mills
+
+ ChangeLog@1.412 +1 -0
+ accopt.html typo fixes from Dave Mills
+
+ html/accopt.html@1.31 +7 -11
+ accopt.html typo fixes from Dave Mills
+
+ChangeSet@1.1966, 2009-08-18 05:05:46+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1285] Log ntpq :config/config-from-file events.
+
+ ChangeLog@1.411 +1 -0
+ [Bug 1285] Log ntpq :config/config-from-file events.
+
+ include/ntp_config.h@1.57 +1 -1
+ provide source address to config_remotely
+
+ ntpd/ntp_config.c@1.208 +17 -1
+ Log source of each dumpcfg section (startup config or ntpq)
+
+ ntpd/ntp_control.c@1.118 +52 -30
+ [Bug 1285] Log ntpq :config/config-from-file events.
+
+ ntpq/ntpq-subs.c@1.34 +11 -2
+ display each line while sending in ntpq config-from-file
+
+ChangeSet@1.1965, 2009-08-17 16:32:18+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1286] dumpcfg omits statsdir, mangles filegen
+
+ ChangeLog@1.410 +1 -0
+ [Bug 1286] dumpcfg omits statsdir, mangles filegen
+
+ ntpd/ntp_config.c@1.207 +425 -432
+ [Bug 1286] dumpcfg omits statsdir, mangles filegen
+ rearrange dump output to group related items, come closer to examples
+
+ChangeSet@1.1964, 2009-08-17 07:50:54-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P204
+ TAG: NTP_4_2_5P204
+
+ ChangeLog@1.409 +1 -0
+ NTP_4_2_5P204
+
+ ntpd/ntpd-opts.c@1.197 +2 -2
+ NTP_4_2_5P204
+
+ ntpd/ntpd-opts.h@1.197 +3 -3
+ NTP_4_2_5P204
+
+ ntpd/ntpd-opts.texi@1.195 +1 -1
+ NTP_4_2_5P204
+
+ ntpd/ntpd.1@1.195 +2 -2
+ NTP_4_2_5P204
+
+ ntpdc/ntpdc-opts.c@1.193 +2 -2
+ NTP_4_2_5P204
+
+ ntpdc/ntpdc-opts.h@1.193 +3 -3
+ NTP_4_2_5P204
+
+ ntpdc/ntpdc-opts.texi@1.192 +1 -1
+ NTP_4_2_5P204
+
+ ntpdc/ntpdc.1@1.192 +2 -2
+ NTP_4_2_5P204
+
+ ntpq/ntpq-opts.c@1.193 +2 -2
+ NTP_4_2_5P204
+
+ ntpq/ntpq-opts.h@1.193 +3 -3
+ NTP_4_2_5P204
+
+ ntpq/ntpq-opts.texi@1.192 +1 -1
+ NTP_4_2_5P204
+
+ ntpq/ntpq.1@1.192 +2 -2
+ NTP_4_2_5P204
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.73 +2 -2
+ NTP_4_2_5P204
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.73 +3 -3
+ NTP_4_2_5P204
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.73 +1 -1
+ NTP_4_2_5P204
+
+ ntpsnmpd/ntpsnmpd.1@1.73 +2 -2
+ NTP_4_2_5P204
+
+ packageinfo.sh@1.207 +1 -1
+ NTP_4_2_5P204
+
+ sntp/sntp-opts.c@1.67 +2 -2
+ NTP_4_2_5P204
+
+ sntp/sntp-opts.h@1.67 +3 -3
+ NTP_4_2_5P204
+
+ sntp/sntp-opts.texi@1.67 +1 -1
+ NTP_4_2_5P204
+
+ sntp/sntp.1@1.67 +2 -2
+ NTP_4_2_5P204
+
+ util/ntp-keygen-opts.c@1.196 +2 -2
+ NTP_4_2_5P204
+
+ util/ntp-keygen-opts.h@1.196 +3 -3
+ NTP_4_2_5P204
+
+ util/ntp-keygen-opts.texi@1.195 +1 -1
+ NTP_4_2_5P204
+
+ util/ntp-keygen.1@1.195 +2 -2
+ NTP_4_2_5P204
+
+ChangeSet@1.1963, 2009-08-17 03:07:26+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1284] infinite loop in ntpd dumping more than one trustedkey
+ use free_config_*() routines at exit on DEBUG builds to free
+ config tree and expose remaining leaks
+
+ ChangeLog@1.408 +1 -0
+ [Bug 1284] infinite loop in ntpd dumping more than one trustedkey
+
+ ntpd/ntp_config.c@1.206 +55 -10
+ [Bug 1284] infinite loop in ntpd dumping more than one trustedkey
+ use free_config_*() routines at exit on DEBUG builds to free
+ config tree and expose remaining leaks
+
+ChangeSet@1.1962, 2009-08-16 20:53:29-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P203
+ TAG: NTP_4_2_5P203
+
+ ChangeLog@1.407 +1 -0
+ NTP_4_2_5P203
+
+ ntpd/ntpd-opts.c@1.196 +2 -2
+ NTP_4_2_5P203
+
+ ntpd/ntpd-opts.h@1.196 +3 -3
+ NTP_4_2_5P203
+
+ ntpd/ntpd-opts.texi@1.194 +1 -1
+ NTP_4_2_5P203
+
+ ntpd/ntpd.1@1.194 +2 -2
+ NTP_4_2_5P203
+
+ ntpdc/ntpdc-opts.c@1.192 +2 -2
+ NTP_4_2_5P203
+
+ ntpdc/ntpdc-opts.h@1.192 +3 -3
+ NTP_4_2_5P203
+
+ ntpdc/ntpdc-opts.texi@1.191 +1 -1
+ NTP_4_2_5P203
+
+ ntpdc/ntpdc.1@1.191 +2 -2
+ NTP_4_2_5P203
+
+ ntpq/ntpq-opts.c@1.192 +2 -2
+ NTP_4_2_5P203
+
+ ntpq/ntpq-opts.h@1.192 +3 -3
+ NTP_4_2_5P203
+
+ ntpq/ntpq-opts.texi@1.191 +1 -1
+ NTP_4_2_5P203
+
+ ntpq/ntpq.1@1.191 +2 -2
+ NTP_4_2_5P203
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.72 +2 -2
+ NTP_4_2_5P203
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.72 +3 -3
+ NTP_4_2_5P203
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.72 +1 -1
+ NTP_4_2_5P203
+
+ ntpsnmpd/ntpsnmpd.1@1.72 +2 -2
+ NTP_4_2_5P203
+
+ packageinfo.sh@1.206 +1 -1
+ NTP_4_2_5P203
+
+ sntp/sntp-opts.c@1.66 +2 -2
+ NTP_4_2_5P203
+
+ sntp/sntp-opts.h@1.66 +3 -3
+ NTP_4_2_5P203
+
+ sntp/sntp-opts.texi@1.66 +1 -1
+ NTP_4_2_5P203
+
+ sntp/sntp.1@1.66 +2 -2
+ NTP_4_2_5P203
+
+ util/ntp-keygen-opts.c@1.195 +2 -2
+ NTP_4_2_5P203
+
+ util/ntp-keygen-opts.h@1.195 +3 -3
+ NTP_4_2_5P203
+
+ util/ntp-keygen-opts.texi@1.194 +1 -1
+ NTP_4_2_5P203
+
+ util/ntp-keygen.1@1.194 +2 -2
+ NTP_4_2_5P203
+
+ChangeSet@1.1961, 2009-08-16 17:41:19+00:00, davehart@shiny.ad.hartbrothers.com
+ Add extra heap-checking calls to atexit-invoked routines
+ dump -4 and -6 switches to server/peer
+ use %g printf format instead of %f to trim uninformative zeros
+ switch enable/disable dumper to correct oddball identifiers
+ Do not free in-use receive buffers at exit to avoid race for now
+
+ ntpd/ntp_config.c@1.205 +77 -114
+ Add extra heap-checking calls to atexit-invoked routines
+ dump -4 and -6 switches to server/peer
+ use %g printf format instead of %f to trim uninformative zeros
+ switch enable/disable dumper to correct oddball identifiers
+
+ ntpd/ntp_util.c@1.74 +7 -0
+ Add extra heap-checking calls to atexit-invoked routines
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.48 +15 -1
+ Do not free in-use receive buffers at exit to avoid race for now
+ Add extra heap-checking calls to atexit-invoked routines
+
+ChangeSet@1.1960, 2009-08-16 14:08:44+00:00, hart@pogo.udel.edu
+ ntp_control.c:
+ include <sys/stat.h> for S_IRUSR, S_IWUSR
+
+ ntpd/ntp_control.c@1.117 +1 -0
+ include <sys/stat.h> for S_IRUSR, S_IWUSR
+
+ChangeSet@1.1959, 2009-08-16 13:59:26+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq -c "dumpcfg ntp.conf.out" works ok for me now
+
+ include/ntp_config.h@1.56 +4 -4
+ rename config_tree.prior to link to reflect use
+
+ ntpd/ntp_config.c@1.204 +139 -118
+ correct merge with ntp-dev regarding default_ntp_signd_socket
+ rename config_tree.prior to link to reflect use
+ dump keysdir, keys, trustedkey, requestkey, controlkey
+ collapse multiple manycastserver, multicastclient lines to one each
+ correct tinker, tos, restrict dump code to use oddball identifiers
+ fix ntpq :config (process correct config tree)
+
+ ntpd/ntp_control.c@1.116 +6 -3
+ use macros for open() perm bits, different values on Windows
+
+ChangeSet@1.1958, 2009-08-16 09:38:50+00:00, davehart@shiny.ad.hartbrothers.com
+ add dumpcfg ChangeLog entry
+ fix unix build
+
+ ChangeLog@1.406 +1 -0
+ Add ntpq -c dumpcfg, Google Summer of Code project of Max Kuehn
+
+ ntpd/ntp_control.c@1.115 +1 -1
+ no MAX_PATH on unix apparently
+
+ChangeSet@1.1957, 2009-08-16 09:31:04+00:00, hart@pogo.udel.edu
+ ntp_parser.h, ntp_parser.c:
+ Bison products
+
+ ntpd/ntp_parser.c@1.41 +950 -960
+ Bison products
+
+ ntpd/ntp_parser.h@1.24 +133 -135
+ Bison products
+
+ChangeSet@1.1956, 2009-08-16 09:14:30+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_config.c:
+ use correct union member not union itself
+
+ ntpd/ntp_config.c@1.203 +2 -2
+ use correct union member not union itself
+
+ChangeSet@1.1955, 2009-08-16 09:10:06+00:00, davehart@shiny.ad.hartbrothers.com
+ preserve peer options queue for dumper
+ remove remnants of "broadcastclient novolley"
+ dump correct peer keywords (server, pool, etc)
+ dump peer options (minpoll, iburst, etc)
+ quote dumped filenames (better to do so only if needed)
+ dump only to /var/tmp (unix) or %TEMP% (windows) directories
+ create dump file with 0600 (owner-only) permission
+
+ include/ntp_config.h@1.55 +1 -5
+ preserve peer options queue for dumper
+ remove remnants of "broadcastclient novolley"
+
+ ntpd/ntp_config.c@1.202 +152 -28
+ preserve peer options queue for dumper
+ remove remnants of "broadcastclient novolley"
+ dump correct peer keywords (server, pool, etc)
+ dump peer options (minpoll, iburst, etc)
+ quote dumped filenames (better to do so only if needed)
+
+ ntpd/ntp_control.c@1.114 +27 -10
+ dump only to /var/tmp (unix) or %TEMP% (windows) directories
+ create dump file with 0600 (owner-only) permission
+
+ ntpd/ntp_parser.y@1.36 +1 -4
+ remove remnants of "broadcastclient novolley"
+
+ ports/winnt/include/config.h@1.74 +1 -1
+ comment only
+
+ChangeSet@1.1954, 2009-08-16 04:45:36+00:00, davehart@shiny.ad.hartbrothers.com
+ more ntp_config.c merge cleanup
+
+ ntpd/ntp_config.c@1.201 +4 -4
+ more merge cleanup
+
+ChangeSet@1.1877.3.11, 2009-08-16 02:58:43+00:00, davehart@shiny.ad.hartbrothers.com
+ add default: cases to config dumper switch statements
+ move variable declarations ahead of code for C compliance
+ use sizeof(buf) not hardcoded constants
+
+ ntpd/ntp_config.c@1.193.1.8 +164 -82
+ move variable declarations before code for C compliance
+ add default: cases to config dumper switch statements
+
+ ntpd/ntp_control.c@1.110.1.3 +9 -10
+ use sizeof(buf) not hardcoded constants
+
+ ntpq/ntpq-subs.c@1.30.1.3 +1 -3
+ remove unused local a
+
+ChangeSet@1.1877.3.10, 2009-08-16 02:47:29+09:00, Amidamaru@yumi.mxiesoft.com
+ ntp_config.h:
+ Added source and timestamp to the config_tree structure
+
+ include/ntp_config.h@1.52.1.4 +9 -0
+ Added source and timestamp to the config_tree structure
+
+ChangeSet@1.1877.3.9, 2009-08-15 02:15:30+09:00, Amidamaru@yumi.mxiesoft.com
+ ntp_control.c:
+ Handling the dumpfile argument of the dumpcfg command
+ ntp_config.c:
+ Config dumper: Combined the server and fudge output
+ ntpq-subs.c:
+ Added the dumpfile argument to the dumpcfg command
+
+ ntpd/ntp_config.c@1.193.1.7 +38 -5
+ Config dumper: Combined the server and fudge output
+
+ ntpd/ntp_control.c@1.110.1.2 +13 -2
+ Handling the dumpfile argument of the dumpcfg command
+
+ ntpq/ntpq-subs.c@1.30.1.2 +12 -13
+ Added the dumpfile argument to the dumpcfg command
+
+ChangeSet@1.1952, 2009-08-14 07:51:00-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P202
+ TAG: NTP_4_2_5P202
+
+ ChangeLog@1.405 +1 -0
+ NTP_4_2_5P202
+
+ ntpd/ntpd-opts.c@1.195 +2 -2
+ NTP_4_2_5P202
+
+ ntpd/ntpd-opts.h@1.195 +3 -3
+ NTP_4_2_5P202
+
+ ntpd/ntpd-opts.texi@1.193 +1 -1
+ NTP_4_2_5P202
+
+ ntpd/ntpd.1@1.193 +2 -2
+ NTP_4_2_5P202
+
+ ntpdc/ntpdc-opts.c@1.191 +2 -2
+ NTP_4_2_5P202
+
+ ntpdc/ntpdc-opts.h@1.191 +3 -3
+ NTP_4_2_5P202
+
+ ntpdc/ntpdc-opts.texi@1.190 +1 -1
+ NTP_4_2_5P202
+
+ ntpdc/ntpdc.1@1.190 +2 -2
+ NTP_4_2_5P202
+
+ ntpq/ntpq-opts.c@1.191 +2 -2
+ NTP_4_2_5P202
+
+ ntpq/ntpq-opts.h@1.191 +3 -3
+ NTP_4_2_5P202
+
+ ntpq/ntpq-opts.texi@1.190 +1 -1
+ NTP_4_2_5P202
+
+ ntpq/ntpq.1@1.190 +2 -2
+ NTP_4_2_5P202
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.71 +2 -2
+ NTP_4_2_5P202
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.71 +3 -3
+ NTP_4_2_5P202
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.71 +1 -1
+ NTP_4_2_5P202
+
+ ntpsnmpd/ntpsnmpd.1@1.71 +2 -2
+ NTP_4_2_5P202
+
+ packageinfo.sh@1.205 +1 -1
+ NTP_4_2_5P202
+
+ sntp/sntp-opts.c@1.65 +2 -2
+ NTP_4_2_5P202
+
+ sntp/sntp-opts.h@1.65 +3 -3
+ NTP_4_2_5P202
+
+ sntp/sntp-opts.texi@1.65 +1 -1
+ NTP_4_2_5P202
+
+ sntp/sntp.1@1.65 +2 -2
+ NTP_4_2_5P202
+
+ util/ntp-keygen-opts.c@1.194 +2 -2
+ NTP_4_2_5P202
+
+ util/ntp-keygen-opts.h@1.194 +3 -3
+ NTP_4_2_5P202
+
+ util/ntp-keygen-opts.texi@1.193 +1 -1
+ NTP_4_2_5P202
+
+ util/ntp-keygen.1@1.193 +2 -2
+ NTP_4_2_5P202
+
+ChangeSet@1.1951, 2009-08-13 16:27:44-04:00, stenn@whimsy.udel.edu
+ install the binary and man page for sntp
+
+ ChangeLog@1.404 +1 -0
+ install the binary and man page for sntp
+
+ sntp/Makefile.am@1.10 +7 -11
+ install the binary and man page for sntp
+
+ChangeSet@1.1950, 2009-08-13 07:57:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P201
+ TAG: NTP_4_2_5P201
+
+ ChangeLog@1.403 +1 -0
+ NTP_4_2_5P201
+
+ ntpd/ntpd-opts.c@1.194 +2 -2
+ NTP_4_2_5P201
+
+ ntpd/ntpd-opts.h@1.194 +3 -3
+ NTP_4_2_5P201
+
+ ntpd/ntpd-opts.texi@1.192 +1 -1
+ NTP_4_2_5P201
+
+ ntpd/ntpd.1@1.192 +2 -2
+ NTP_4_2_5P201
+
+ ntpdc/ntpdc-opts.c@1.190 +2 -2
+ NTP_4_2_5P201
+
+ ntpdc/ntpdc-opts.h@1.190 +3 -3
+ NTP_4_2_5P201
+
+ ntpdc/ntpdc-opts.texi@1.189 +1 -1
+ NTP_4_2_5P201
+
+ ntpdc/ntpdc.1@1.189 +2 -2
+ NTP_4_2_5P201
+
+ ntpq/ntpq-opts.c@1.190 +2 -2
+ NTP_4_2_5P201
+
+ ntpq/ntpq-opts.h@1.190 +3 -3
+ NTP_4_2_5P201
+
+ ntpq/ntpq-opts.texi@1.189 +1 -1
+ NTP_4_2_5P201
+
+ ntpq/ntpq.1@1.189 +2 -2
+ NTP_4_2_5P201
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.70 +2 -2
+ NTP_4_2_5P201
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.70 +3 -3
+ NTP_4_2_5P201
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.70 +1 -1
+ NTP_4_2_5P201
+
+ ntpsnmpd/ntpsnmpd.1@1.70 +2 -2
+ NTP_4_2_5P201
+
+ packageinfo.sh@1.204 +1 -1
+ NTP_4_2_5P201
+
+ sntp/sntp-opts.c@1.64 +1 -1
+ NTP_4_2_5P201
+
+ sntp/sntp-opts.h@1.64 +1 -1
+ NTP_4_2_5P201
+
+ sntp/sntp-opts.texi@1.64 +1 -1
+ NTP_4_2_5P201
+
+ sntp/sntp.1@1.64 +2 -2
+ NTP_4_2_5P201
+
+ util/ntp-keygen-opts.c@1.193 +2 -2
+ NTP_4_2_5P201
+
+ util/ntp-keygen-opts.h@1.193 +3 -3
+ NTP_4_2_5P201
+
+ util/ntp-keygen-opts.texi@1.192 +1 -1
+ NTP_4_2_5P201
+
+ util/ntp-keygen.1@1.192 +2 -2
+ NTP_4_2_5P201
+
+ChangeSet@1.1947.1.1, 2009-08-12 07:57:54-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P200
+ TAG: NTP_4_2_5P200
+
+ ChangeLog@1.400.1.1 +1 -0
+ NTP_4_2_5P200
+
+ gsoc_sntp/sntp-opts.c@1.61.1.1 +2 -2
+ NTP_4_2_5P200
+
+ gsoc_sntp/sntp-opts.h@1.61.1.1 +3 -3
+ NTP_4_2_5P200
+
+ gsoc_sntp/sntp-opts.texi@1.61.1.1 +1 -1
+ NTP_4_2_5P200
+
+ gsoc_sntp/sntp.1@1.61.1.1 +2 -2
+ NTP_4_2_5P200
+
+ ntpd/ntpd-opts.c@1.193 +2 -2
+ NTP_4_2_5P200
+
+ ntpd/ntpd-opts.h@1.193 +3 -3
+ NTP_4_2_5P200
+
+ ntpd/ntpd-opts.texi@1.191 +1 -1
+ NTP_4_2_5P200
+
+ ntpd/ntpd.1@1.191 +2 -2
+ NTP_4_2_5P200
+
+ ntpdc/ntpdc-opts.c@1.189 +2 -2
+ NTP_4_2_5P200
+
+ ntpdc/ntpdc-opts.h@1.189 +3 -3
+ NTP_4_2_5P200
+
+ ntpdc/ntpdc-opts.texi@1.188 +1 -1
+ NTP_4_2_5P200
+
+ ntpdc/ntpdc.1@1.188 +2 -2
+ NTP_4_2_5P200
+
+ ntpq/ntpq-opts.c@1.189 +2 -2
+ NTP_4_2_5P200
+
+ ntpq/ntpq-opts.h@1.189 +3 -3
+ NTP_4_2_5P200
+
+ ntpq/ntpq-opts.texi@1.188 +1 -1
+ NTP_4_2_5P200
+
+ ntpq/ntpq.1@1.188 +2 -2
+ NTP_4_2_5P200
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.69 +2 -2
+ NTP_4_2_5P200
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.69 +3 -3
+ NTP_4_2_5P200
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.69 +1 -1
+ NTP_4_2_5P200
+
+ ntpsnmpd/ntpsnmpd.1@1.69 +2 -2
+ NTP_4_2_5P200
+
+ packageinfo.sh@1.203 +1 -1
+ NTP_4_2_5P200
+
+ sntp/sntp-opts.c@1.188.1.1 +2 -2
+ NTP_4_2_5P200
+
+ sntp/sntp-opts.h@1.188.1.1 +3 -3
+ NTP_4_2_5P200
+
+ sntp/sntp-opts.texi@1.187.1.1 +1 -1
+ NTP_4_2_5P200
+
+ sntp/sntp.1@1.187.1.1 +2 -2
+ NTP_4_2_5P200
+
+ util/ntp-keygen-opts.c@1.192 +2 -2
+ NTP_4_2_5P200
+
+ util/ntp-keygen-opts.h@1.192 +3 -3
+ NTP_4_2_5P200
+
+ util/ntp-keygen-opts.texi@1.191 +1 -1
+ NTP_4_2_5P200
+
+ util/ntp-keygen.1@1.191 +2 -2
+ NTP_4_2_5P200
+
+ChangeSet@1.1948, 2009-08-12 07:09:37-04:00, stenn@whimsy.udel.edu
+ sntp: out with the old, in with the new
+
+ .point-changed-filelist@1.6 +0 -4
+ sntp: out with the old, in with the new
+
+ BitKeeper/deleted/.del-COPYING.gplv3@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.gplv3
+
+ BitKeeper/deleted/.del-COPYING.lgplv3@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.lgplv3
+
+ BitKeeper/deleted/.del-COPYING.mbsd~dfd1a50aaa7f1a01@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYRIGHT@1.3 +0 -0
+ Delete: sntp/COPYRIGHT
+
+ BitKeeper/deleted/.del-MakeDefs.inc~f7b11e92a11b82c@1.2 +0 -0
+ Delete: sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~7eb131bb540e19f2@1.26 +0 -0
+ Delete: sntp/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~84a984572db47579@1.2 +0 -0
+ Delete: sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Mf@1.2 +0 -0
+ Delete: sntp/Mf
+
+ BitKeeper/deleted/.del-README~9ce987ed19d4905a@1.3 +0 -0
+ Delete: sntp/README
+
+ BitKeeper/deleted/.del-README~cb95e57599607dd8@1.3 +0 -0
+ Delete: sntp/libopts/README
+
+ BitKeeper/deleted/.del-RFC2030.TXT@1.2 +0 -0
+ Delete: sntp/RFC2030.TXT
+
+ BitKeeper/deleted/.del-RFC4330.TXT@1.2 +0 -0
+ Delete: sntp/RFC4330.TXT
+
+ BitKeeper/deleted/.del-ag-char-map.h@1.5 +0 -0
+ Delete: sntp/libopts/ag-char-map.h
+
+ BitKeeper/deleted/.del-autoopts.c~524f4366bd5298d@1.4 +0 -0
+ Delete: sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~8da4370be20d3b14@1.4 +0 -0
+ Delete: sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~b7c57a2b81d3da1d@1.4 +0 -0
+ Delete: sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h~e2f82823ab217382@1.4 +0 -0
+ Delete: sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c~107d2e38a77fa938@1.4 +0 -0
+ Delete: sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-configure.ac@1.24 +0 -0
+ Delete: sntp/configure.ac
+
+ BitKeeper/deleted/.del-cook.c~dabc0ea67f8d04b@1.4 +0 -0
+ Delete: sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-draft-mills-sntp-v4-00.txt@1.2 +0 -0
+ Delete: sntp/draft-mills-sntp-v4-00.txt
+
+ BitKeeper/deleted/.del-enumeration.c~bb2f678a6e7847e4@1.4 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~a4572011a478e1f8@1.5 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-file.c@1.4 +0 -0
+ Delete: sntp/libopts/file.c
+
+ BitKeeper/deleted/.del-genshell.c~b902390cefc557fe@1.5 +0 -0
+ Delete: sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~3aefffa4f2e6155e@1.5 +0 -0
+ Delete: sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-header.h@1.7 +0 -0
+ Delete: sntp/header.h
+
+ BitKeeper/deleted/.del-internet.c@1.5 +0 -0
+ Delete: sntp/internet.c
+
+ BitKeeper/deleted/.del-internet.h@1.4 +0 -0
+ Delete: sntp/internet.h
+
+ BitKeeper/deleted/.del-kludges.h@1.2 +0 -0
+ Delete: sntp/kludges.h
+
+ BitKeeper/deleted/.del-libopts.c~fa546a962604b990@1.2 +0 -0
+ Delete: sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~cea4d9dfe3c6ddbf@1.5 +0 -0
+ Delete: sntp/libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~3a61aba4c71ee48a@1.4 +0 -0
+ Delete: sntp/libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-load.c~d526b4ded3e5d941@1.4 +0 -0
+ Delete: sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-ltmain.sh@1.2 +0 -0
+ Delete: sntp/ltmain.sh
+
+ BitKeeper/deleted/.del-main.c@1.11 +0 -0
+ Delete: sntp/main.c
+
+ BitKeeper/deleted/.del-makeshell.c~dcec62d7527150f2@1.4 +0 -0
+ Delete: sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c~9a65b1b3c71987c2@1.4 +0 -0
+ Delete: sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c~6843f965b3b4e5d4@1.4 +0 -0
+ Delete: sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~756b87b5d8493503@1.5 +0 -0
+ Delete: sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-parse-duration.c@1.2 +0 -0
+ Delete: sntp/libopts/parse-duration.c
+
+ BitKeeper/deleted/.del-parse-duration.h@1.2 +0 -0
+ Delete: sntp/libopts/parse-duration.h
+
+ BitKeeper/deleted/.del-pathfind.c~d124c4b9c98df625@1.4 +0 -0
+ Delete: sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~7f2f61c96b4f690@1.4 +0 -0
+ Delete: sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h~3f55e562dfc99640@1.5 +0 -0
+ Delete: sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c~6ddb7f83260a15cb@1.4 +0 -0
+ Delete: sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-reset.c@1.4 +0 -0
+ Delete: sntp/libopts/reset.c
+
+ BitKeeper/deleted/.del-restore.c~36055bf073cf20d2@1.4 +0 -0
+ Delete: sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~818d9fbdc6efce79@1.5 +0 -0
+ Delete: sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c~e2a566791af51ab1@1.2 +0 -0
+ Delete: sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sntp-opts.c~4bdc915913c58b8d@1.189 +0 -0
+ Delete: sntp/sntp-opts.c
+
+ BitKeeper/deleted/.del-sntp-opts.def@1.13 +0 -0
+ Delete: sntp/sntp-opts.def
+
+ BitKeeper/deleted/.del-sntp-opts.h~6c9afb942ebc8da5@1.189 +0 -0
+ Delete: sntp/sntp-opts.h
+
+ BitKeeper/deleted/.del-sntp-opts.menu@1.5 +0 -0
+ Delete: sntp/sntp-opts.menu
+
+ BitKeeper/deleted/.del-sntp-opts.texi~a472a50d2839eadc@1.188 +0 -0
+ Delete: sntp/sntp-opts.texi
+
+ BitKeeper/deleted/.del-sntp.1~852b6b2cb9eef68@1.188 +0 -0
+ Delete: sntp/sntp.1
+
+ BitKeeper/deleted/.del-socket.c@1.9 +0 -0
+ Delete: sntp/socket.c
+
+ BitKeeper/deleted/.del-sort.c~2b3c290f2056ef51@1.4 +0 -0
+ Delete: sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~275738ac7e7d319d@1.4 +0 -0
+ Delete: sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-strchr.c~1aac99425a598121@1.2 +0 -0
+ Delete: sntp/libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strdup.c~5fa61194752a37e3@1.2 +0 -0
+ Delete: sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~e58f9bd033a84719@1.4 +0 -0
+ Delete: sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c~7c49bd8e3f86066f@1.4 +0 -0
+ Delete: sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-time.c@1.4 +0 -0
+ Delete: sntp/libopts/time.c
+
+ BitKeeper/deleted/.del-timing.c@1.4 +0 -0
+ Delete: sntp/timing.c
+
+ BitKeeper/deleted/.del-tokenize.c~be5669e7aebf805@1.3 +0 -0
+ Delete: sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-unix.c@1.4 +0 -0
+ Delete: sntp/unix.c
+
+ BitKeeper/deleted/.del-usage-txt.h~e9f5b7f89caa54c2@1.5 +0 -0
+ Delete: sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~84e8c04ecb3c0839@1.4 +0 -0
+ Delete: sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-value-type.c@1.3 +0 -0
+ Delete: sntp/libopts/value-type.c
+
+ BitKeeper/deleted/.del-value-type.h@1.5 +0 -0
+ Delete: sntp/libopts/value-type.h
+
+ BitKeeper/deleted/.del-version.c~f331be699b32ed05@1.4 +0 -0
+ Delete: sntp/libopts/version.c
+
+ BitKeeper/deleted/.del-windows-config.h~c97f2a667a4b84f5@1.4 +0 -0
+ Delete: sntp/libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-xat-attribute.c@1.3 +0 -0
+ Delete: sntp/libopts/xat-attribute.c
+
+ BitKeeper/deleted/.del-xat-attribute.h@1.5 +0 -0
+ Delete: sntp/libopts/xat-attribute.h
+
+ ChangeLog@1.401 +1 -0
+ sntp: out with the old, in with the new
+
+ Makefile.am@1.81 +0 -2
+ sntp: out with the old, in with the new
+
+ bootstrap@1.23 +0 -1
+ sntp: out with the old, in with the new
+
+ configure.ac@1.448 +0 -1
+ sntp: out with the old, in with the new
+
+ sntp/COPYRIGHT@1.2 +0 -0
+ Rename: gsoc_sntp/COPYRIGHT -> sntp/COPYRIGHT
+
+ sntp/Makefile.am@1.9 +0 -0
+ Rename: gsoc_sntp/Makefile.am -> sntp/Makefile.am
+
+ sntp/configure.ac@1.18 +0 -0
+ Rename: gsoc_sntp/configure.ac -> sntp/configure.ac
+
+ sntp/crypto.c@1.7 +0 -0
+ Rename: gsoc_sntp/crypto.c -> sntp/crypto.c
+
+ sntp/crypto.h@1.5 +0 -0
+ Rename: gsoc_sntp/crypto.h -> sntp/crypto.h
+
+ sntp/data_formats.h@1.5 +0 -0
+ Rename: gsoc_sntp/data_formats.h -> sntp/data_formats.h
+
+ sntp/fetch-stubs@1.6 +0 -0
+ Rename: gsoc_sntp/fetch-stubs -> sntp/fetch-stubs
+
+ sntp/header.h@1.4 +0 -0
+ Rename: gsoc_sntp/header.h -> sntp/header.h
+
+ sntp/kod_management.c@1.10 +0 -0
+ Rename: gsoc_sntp/kod_management.c -> sntp/kod_management.c
+
+ sntp/kod_management.h@1.6 +0 -0
+ Rename: gsoc_sntp/kod_management.h -> sntp/kod_management.h
+
+ sntp/libopts/COPYING.gplv3@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/COPYING.gplv3 -> sntp/libopts/COPYING.gplv3
+
+ sntp/libopts/COPYING.lgplv3@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/COPYING.lgplv3 -> sntp/libopts/COPYING.lgplv3
+
+ sntp/libopts/COPYING.mbsd@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/COPYING.mbsd -> sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/MakeDefs.inc@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/MakeDefs.inc -> sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/Makefile.am@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/Makefile.am -> sntp/libopts/Makefile.am
+
+ sntp/libopts/README@1.3 +0 -0
+ Rename: gsoc_sntp/libopts/README -> sntp/libopts/README
+
+ sntp/libopts/ag-char-map.h@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/ag-char-map.h -> sntp/libopts/ag-char-map.h
+
+ sntp/libopts/autoopts.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/autoopts.c -> sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.h@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/autoopts.h -> sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts/options.h@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/autoopts/options.h -> sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/autoopts/usage-txt.h -> sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/boolean.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/boolean.c -> sntp/libopts/boolean.c
+
+ sntp/libopts/compat/compat.h@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/compat/compat.h -> sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/pathfind.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/compat/pathfind.c -> sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/compat/snprintf.c@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/compat/snprintf.c -> sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/strchr.c@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/compat/strchr.c -> sntp/libopts/compat/strchr.c
+
+ sntp/libopts/compat/strdup.c@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/compat/strdup.c -> sntp/libopts/compat/strdup.c
+
+ sntp/libopts/compat/windows-config.h@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/compat/windows-config.h -> sntp/libopts/compat/windows-config.h
+
+ sntp/libopts/configfile.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/configfile.c -> sntp/libopts/configfile.c
+
+ sntp/libopts/cook.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/cook.c -> sntp/libopts/cook.c
+
+ sntp/libopts/enumeration.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/enumeration.c -> sntp/libopts/enumeration.c
+
+ sntp/libopts/environment.c@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/environment.c -> sntp/libopts/environment.c
+
+ sntp/libopts/file.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/file.c -> sntp/libopts/file.c
+
+ sntp/libopts/genshell.c@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/genshell.c -> sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.h@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/genshell.h -> sntp/libopts/genshell.h
+
+ sntp/libopts/libopts.c@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/libopts.c -> sntp/libopts/libopts.c
+
+ sntp/libopts/load.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/load.c -> sntp/libopts/load.c
+
+ sntp/libopts/m4/libopts.m4@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/m4/libopts.m4 -> sntp/libopts/m4/libopts.m4
+
+ sntp/libopts/m4/liboptschk.m4@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/m4/liboptschk.m4 -> sntp/libopts/m4/liboptschk.m4
+
+ sntp/libopts/makeshell.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/makeshell.c -> sntp/libopts/makeshell.c
+
+ sntp/libopts/nested.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/nested.c -> sntp/libopts/nested.c
+
+ sntp/libopts/numeric.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/numeric.c -> sntp/libopts/numeric.c
+
+ sntp/libopts/parse-duration.c@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/parse-duration.c -> sntp/libopts/parse-duration.c
+
+ sntp/libopts/parse-duration.h@1.2 +0 -0
+ Rename: gsoc_sntp/libopts/parse-duration.h -> sntp/libopts/parse-duration.h
+
+ sntp/libopts/pgusage.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/pgusage.c -> sntp/libopts/pgusage.c
+
+ sntp/libopts/proto.h@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/proto.h -> sntp/libopts/proto.h
+
+ sntp/libopts/putshell.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/putshell.c -> sntp/libopts/putshell.c
+
+ sntp/libopts/reset.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/reset.c -> sntp/libopts/reset.c
+
+ sntp/libopts/restore.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/restore.c -> sntp/libopts/restore.c
+
+ sntp/libopts/save.c@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/save.c -> sntp/libopts/save.c
+
+ sntp/libopts/sort.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/sort.c -> sntp/libopts/sort.c
+
+ sntp/libopts/stack.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/stack.c -> sntp/libopts/stack.c
+
+ sntp/libopts/streqvcmp.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/streqvcmp.c -> sntp/libopts/streqvcmp.c
+
+ sntp/libopts/text_mmap.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/text_mmap.c -> sntp/libopts/text_mmap.c
+
+ sntp/libopts/time.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/time.c -> sntp/libopts/time.c
+
+ sntp/libopts/tokenize.c@1.3 +0 -0
+ Rename: gsoc_sntp/libopts/tokenize.c -> sntp/libopts/tokenize.c
+
+ sntp/libopts/usage.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/usage.c -> sntp/libopts/usage.c
+
+ sntp/libopts/value-type.c@1.3 +0 -0
+ Rename: gsoc_sntp/libopts/value-type.c -> sntp/libopts/value-type.c
+
+ sntp/libopts/value-type.h@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/value-type.h -> sntp/libopts/value-type.h
+
+ sntp/libopts/version.c@1.4 +0 -0
+ Rename: gsoc_sntp/libopts/version.c -> sntp/libopts/version.c
+
+ sntp/libopts/xat-attribute.c@1.3 +0 -0
+ Rename: gsoc_sntp/libopts/xat-attribute.c -> sntp/libopts/xat-attribute.c
+
+ sntp/libopts/xat-attribute.h@1.5 +0 -0
+ Rename: gsoc_sntp/libopts/xat-attribute.h -> sntp/libopts/xat-attribute.h
+
+ sntp/log.c@1.9 +0 -0
+ Rename: gsoc_sntp/log.c -> sntp/log.c
+
+ sntp/log.h@1.6 +0 -0
+ Rename: gsoc_sntp/log.h -> sntp/log.h
+
+ sntp/ltmain.sh@1.2 +0 -0
+ Rename: gsoc_sntp/ltmain.sh -> sntp/ltmain.sh
+
+ sntp/main.c@1.17 +0 -0
+ Rename: gsoc_sntp/main.c -> sntp/main.c
+
+ sntp/netutils.c@1.2 +0 -0
+ Rename: gsoc_sntp/netutils.c -> sntp/netutils.c
+
+ sntp/netutils.h@1.2 +0 -0
+ Rename: gsoc_sntp/netutils.h -> sntp/netutils.h
+
+ sntp/networking.c@1.23 +0 -0
+ Rename: gsoc_sntp/networking.c -> sntp/networking.c
+
+ sntp/networking.h@1.14 +0 -0
+ Rename: gsoc_sntp/networking.h -> sntp/networking.h
+
+ sntp/sntp-opts.c@1.62 +0 -0
+ Rename: gsoc_sntp/sntp-opts.c -> sntp/sntp-opts.c
+
+ sntp/sntp-opts.def@1.10 +0 -0
+ Rename: gsoc_sntp/sntp-opts.def -> sntp/sntp-opts.def
+
+ sntp/sntp-opts.h@1.62 +0 -0
+ Rename: gsoc_sntp/sntp-opts.h -> sntp/sntp-opts.h
+
+ sntp/sntp-opts.menu@1.2 +0 -0
+ Rename: gsoc_sntp/sntp-opts.menu -> sntp/sntp-opts.menu
+
+ sntp/sntp-opts.texi@1.62 +0 -0
+ Rename: gsoc_sntp/sntp-opts.texi -> sntp/sntp-opts.texi
+
+ sntp/sntp.1@1.62 +0 -0
+ Rename: gsoc_sntp/sntp.1 -> sntp/sntp.1
+
+ sntp/utilities.c@1.8 +0 -0
+ Rename: gsoc_sntp/utilities.c -> sntp/utilities.c
+
+ sntp/utilities.h@1.6 +0 -0
+ Rename: gsoc_sntp/utilities.h -> sntp/utilities.h
+
+ChangeSet@1.1877.3.7, 2009-08-12 17:25:58+09:00, Amidamaru@yumi.mxiesoft.com
+ ntp_config.c:
+ Config dumper: Added fudge output to server/peer output
+
+ ntpd/ntp_config.c@1.193.1.6 +96 -78
+ Config dumper: Added fudge output to server/peer output
+
+ChangeSet@1.1877.4.1, 2009-08-12 17:09:40+09:00, Amidamaru@yumi.mxiesoft.com
+ ntp_control.c:
+ Added handler for dump opcode
+
+ ntpd/ntp_control.c@1.110.1.1 +25 -0
+ Added handler for dump opcode
+
+ChangeSet@1.1947, 2009-08-10 23:09:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1281] Build ntpd on Windows without big SDK download, burn,
+ and install by checking in essentially unchanging messages.mc build
+ products to avoid requiring mc.exe, which is not included with VC++
+ 2008 EE.
+
+ ChangeLog@1.400 +4 -0
+ [Bug 1281] Build ntpd on Windows without big SDK download, burn,
+ and install by checking in essentially unchanging messages.mc build
+ products to avoid requiring mc.exe, which is not included with VC++
+ 2008 EE.
+
+ ports/winnt/libntp/MSG00001.bin@1.1 +4 -0
+ BitKeeper file C:/ntp/ntp-dev-1281/ports/winnt/libntp/MSG00001.bin
+
+ ports/winnt/libntp/MSG00001.bin@1.0 +0 -0
+
+ ports/winnt/libntp/messages.h@1.1 +199 -0
+ BitKeeper file C:/ntp/ntp-dev-1281/ports/winnt/libntp/messages.h
+
+ ports/winnt/libntp/messages.h@1.0 +0 -0
+
+ ports/winnt/libntp/messages.rc@1.1 +2 -0
+ BitKeeper file C:/ntp/ntp-dev-1281/ports/winnt/libntp/messages.rc
+
+ ports/winnt/libntp/messages.rc@1.0 +0 -0
+
+ChangeSet@1.1946, 2009-08-09 07:55:30-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P199
+ TAG: NTP_4_2_5P199
+
+ ChangeLog@1.399 +1 -0
+ NTP_4_2_5P199
+
+ gsoc_sntp/sntp-opts.c@1.61 +2 -2
+ NTP_4_2_5P199
+
+ gsoc_sntp/sntp-opts.h@1.61 +3 -3
+ NTP_4_2_5P199
+
+ gsoc_sntp/sntp-opts.texi@1.61 +1 -1
+ NTP_4_2_5P199
+
+ gsoc_sntp/sntp.1@1.61 +2 -2
+ NTP_4_2_5P199
+
+ ntpd/ntpd-opts.c@1.192 +2 -2
+ NTP_4_2_5P199
+
+ ntpd/ntpd-opts.h@1.192 +3 -3
+ NTP_4_2_5P199
+
+ ntpd/ntpd-opts.texi@1.190 +1 -1
+ NTP_4_2_5P199
+
+ ntpd/ntpd.1@1.190 +2 -2
+ NTP_4_2_5P199
+
+ ntpdc/ntpdc-opts.c@1.188 +2 -2
+ NTP_4_2_5P199
+
+ ntpdc/ntpdc-opts.h@1.188 +3 -3
+ NTP_4_2_5P199
+
+ ntpdc/ntpdc-opts.texi@1.187 +1 -1
+ NTP_4_2_5P199
+
+ ntpdc/ntpdc.1@1.187 +2 -2
+ NTP_4_2_5P199
+
+ ntpq/ntpq-opts.c@1.188 +2 -2
+ NTP_4_2_5P199
+
+ ntpq/ntpq-opts.h@1.188 +3 -3
+ NTP_4_2_5P199
+
+ ntpq/ntpq-opts.texi@1.187 +1 -1
+ NTP_4_2_5P199
+
+ ntpq/ntpq.1@1.187 +2 -2
+ NTP_4_2_5P199
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.68 +2 -2
+ NTP_4_2_5P199
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.68 +3 -3
+ NTP_4_2_5P199
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.68 +1 -1
+ NTP_4_2_5P199
+
+ ntpsnmpd/ntpsnmpd.1@1.68 +2 -2
+ NTP_4_2_5P199
+
+ packageinfo.sh@1.202 +1 -1
+ NTP_4_2_5P199
+
+ sntp/sntp-opts.c@1.188 +2 -2
+ NTP_4_2_5P199
+
+ sntp/sntp-opts.h@1.188 +3 -3
+ NTP_4_2_5P199
+
+ sntp/sntp-opts.texi@1.187 +1 -1
+ NTP_4_2_5P199
+
+ sntp/sntp.1@1.187 +2 -2
+ NTP_4_2_5P199
+
+ util/ntp-keygen-opts.c@1.191 +2 -2
+ NTP_4_2_5P199
+
+ util/ntp-keygen-opts.h@1.191 +3 -3
+ NTP_4_2_5P199
+
+ util/ntp-keygen-opts.texi@1.190 +1 -1
+ NTP_4_2_5P199
+
+ util/ntp-keygen.1@1.190 +2 -2
+ NTP_4_2_5P199
+
+ChangeSet@1.1945, 2009-08-08 16:39:12-04:00, stenn@whimsy.udel.edu
+ [Bug 1279] Cleanup for warnings from Veracode static analysis
+
+ ChangeLog@1.398 +1 -0
+ [Bug 1279] Cleanup for warnings from Veracode static analysis
+
+ChangeSet@1.1944, 2009-08-08 17:30:14+00:00, davehart@shiny.ad.hartbrothers.com
+ First pass at quieting Veracode static analysis warnings,
+ mostly buffer manipulation that is already safe but used
+ unsafe interface functions such as strcpy() and sprintf().
+ use emalloc(), estrdup() where appropriate.
+
+ libntp/msyslog.c@1.23 +7 -6
+ use memcpy instead of strcpy to quiet Veracode analysis warning
+
+ libntp/ntp_rfc2553.c@1.39 +2 -6
+ use estrdup() instead of malloc() then strcpy()
+
+ libntp/statestr.c@1.17 +5 -4
+ sprintf() -> snprintf() Veracode
+
+ libparse/parse.c@1.13 +1 -1
+ See if cast is enough to quiet Veracode int truncation warning
+
+ ntpd/ntp_config.c@1.199 +7 -3
+ sprintf()->snprintf()
+ check for unlink() failure
+
+ ntpd/ntp_control.c@1.112 +28 -27
+ strcpy() + strcat() -> snprintf()
+ strcpy() -> memcpy()
+ correct 'be" buffer end calculations
+
+ ntpd/ntp_intres.c@1.64 +7 -3
+ check for unlink() failure
+ ensure zero termination with strncpy()
+
+ ntpd/ntp_io.c@1.295 +1 -0
+ ensure null termination with strncpy
+
+ ntpd/ntp_scanner.c@1.22 +30 -5
+ bounds-check access to yytext[]
+
+ ntpd/ntp_signd.c@1.2 +1 -4
+ use emalloc()
+
+ ntpd/ntp_util.c@1.73 +8 -3
+ check for rename(), _unlink() failures
+
+ ntpd/ntpd.c@1.106 +7 -3
+ add chdir("/") after chroot(), can't hurt and Veracode wants it
+
+ ntpd/refclock_acts.c@1.36 +0 -3
+ emalloc() never returns NULL
+
+ ntpd/refclock_bancomm.c@1.11 +2 -3
+ use emalloc()
+
+ ntpd/refclock_datum.c@1.13 +1 -1
+ use emalloc()
+
+ ntpd/refclock_oncore.c@1.78 +7 -24
+ use emalloc()
+
+ ntpdate/ntpdate.c@1.68 +1 -1
+ use emalloc()
+
+ ntpdc/ntpdc.c@1.67 +1 -5
+ use emalloc()
+
+ ntpq/ntpq-subs.c@1.32 +2 -26
+ remove strsave from ntpq, same as libntp's estrdup()
+
+ ports/winnt/libisc/isc_strerror.c@1.8 +9 -6
+ use emalloc()
+ #undef our strerror() before calling the CRT version, infinite
+ recursion is no fun
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.47 +8 -5
+ calloc() -> emalloc() then memset zero
+
+ChangeSet@1.1877.3.6, 2009-08-06 12:04:59+00:00, davehart@shiny.ad.hartbrothers.com
+ maintain history of config trees
+
+ include/ntp_config.h@1.52.1.3 +2 -40
+ remove unused leftovers, add list link field to struct config_tree
+
+ include/ntp_data_structures.h@1.5 +0 -8
+ remove unused s_list
+
+ libntp/ntp_lineedit.c@1.7 +4 -5
+ use estrdup() instead of strdup()
+
+ ntpd/ntp_config.c@1.193.1.5 +112 -79
+ maintain history of config trees
+
+ ntpd/ntp_data_structures.c@1.11 +5 -2
+ make next_node() actually work
+
+ ntpd/ntp_parser.c@1.38.1.1 +50 -50
+ parse to struct config_tree cfgt rather than my_config
+
+ ntpd/ntp_parser.y@1.33.1.1 +50 -50
+ parse to struct config_tree cfgt rather than my_config
+
+ ntpd/ntp_scanner.h@1.7 +4 -4
+ parse to struct config_tree cfgt rather than my_config
+
+ChangeSet@1.1877.3.5, 2009-08-05 21:13:22+00:00, davehart@shiny.ad.hartbrothers.com
+ separate consumption (freeing) of syntax tree from application
+ by introducing free_config_*() routines for each config_*()
+ which allocates memory pointed to by a node.
+
+ include/ntpd.h@1.127.1.1 +1 -1
+ make sizeof(sys_ttl) work
+
+ ntpd/ntp_config.c@1.193.1.4 +526 -194
+ separate consumption (freeing) of syntax tree from application
+ by introducing free_config_*() routines for each config_*()
+ which allocates memory pointed to by a node.
+
+ ntpd/ntp_filegen.c@1.16 +4 -2
+ use bounded copy function (memcpy instead of strcpy)
+
+ChangeSet@1.1877.3.4, 2009-08-05 14:26:32+00:00, davehart@shiny.ad.hartbrothers.com
+ Dump from config tree not s_list clone
+
+ include/ntp_config.h@1.52.1.2 +1 -1
+ Dump from config tree not clone
+
+ include/ntp_data_structures.h@1.4 +2 -2
+ add routines to walk queue without destroying
+
+ ntpd/ntp_config.c@1.193.1.3 +389 -402
+ lay groundwork for keeping list of config trees, one from file then
+ one from each ntpq :config
+
+ ntpd/ntp_data_structures.c@1.10 +27 -48
+ add routines to walk queue without destroying
+
+ChangeSet@1.1877.3.3, 2009-08-05 00:45:45+00:00, davehart@shiny.ad.hartbrothers.com
+ fix problems compiling as C with Visual C++
+
+ ntpd/ntp_config.c@1.193.1.2 +20 -15
+ fix problems compiling as C with Visual C++
+
+ ntpd/ntp_data_structures.c@1.9 +10 -6
+ fix problems compiling as C with Visual C++
+
+ChangeSet@1.1877.3.2, 2009-08-04 19:40:02+02:00, amidamaru@melchior.mxiesoft.com
+ ntp_control.h:
+ Added dumpcfg bindings
+
+ include/ntp_control.h@1.34.1.1 +1 -0
+ Added dumpcfg bindings
+
+ChangeSet@1.1877.3.1, 2009-08-04 17:31:42+02:00, amidamaru@melchior.mxiesoft.com
+ ntp_data_structures.h:
+ Added singly-linked list datatype s_list
+ ntp_data_structures.c:
+ Added functions for dealing with singly linked lists
+ ntp_config.c:
+ Added config dumper and functions dealing with the linked-list copy of the configuration tree
+ ntpq-subs.c:
+ Added config dumper bindings
+ ntp_config.h:
+ Added config dumper prototypes
+
+ include/ntp_config.h@1.52.1.1 +43 -0
+ Added config dumper prototypes
+
+ include/ntp_data_structures.h@1.3 +10 -0
+ Added singly-linked list datatype s_list
+
+ ntpd/ntp_config.c@1.193.1.1 +891 -31
+ Added config dumper and functions dealing with the linked-list copy of the configuration tree
+
+ ntpd/ntp_data_structures.c@1.8 +44 -0
+ Added functions for dealing with singly linked lists
+
+ ntpq/ntpq-subs.c@1.30.1.1 +33 -1
+ Added config dumper bindings
+
+ChangeSet@1.1943, 2009-08-03 08:00:33-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P198
+ TAG: NTP_4_2_5P198
+
+ ChangeLog@1.397 +1 -0
+ NTP_4_2_5P198
+
+ gsoc_sntp/sntp-opts.c@1.60 +3 -3
+ NTP_4_2_5P198
+
+ gsoc_sntp/sntp-opts.h@1.60 +4 -4
+ NTP_4_2_5P198
+
+ gsoc_sntp/sntp-opts.texi@1.60 +1 -1
+ NTP_4_2_5P198
+
+ gsoc_sntp/sntp.1@1.60 +2 -2
+ NTP_4_2_5P198
+
+ ntpd/ntpd-opts.c@1.191 +3 -3
+ NTP_4_2_5P198
+
+ ntpd/ntpd-opts.h@1.191 +4 -4
+ NTP_4_2_5P198
+
+ ntpd/ntpd-opts.texi@1.189 +1 -1
+ NTP_4_2_5P198
+
+ ntpd/ntpd.1@1.189 +2 -2
+ NTP_4_2_5P198
+
+ ntpdc/ntpdc-opts.c@1.187 +3 -3
+ NTP_4_2_5P198
+
+ ntpdc/ntpdc-opts.h@1.187 +4 -4
+ NTP_4_2_5P198
+
+ ntpdc/ntpdc-opts.texi@1.186 +1 -1
+ NTP_4_2_5P198
+
+ ntpdc/ntpdc.1@1.186 +2 -2
+ NTP_4_2_5P198
+
+ ntpq/ntpq-opts.c@1.187 +3 -3
+ NTP_4_2_5P198
+
+ ntpq/ntpq-opts.h@1.187 +4 -4
+ NTP_4_2_5P198
+
+ ntpq/ntpq-opts.texi@1.186 +1 -1
+ NTP_4_2_5P198
+
+ ntpq/ntpq.1@1.186 +2 -2
+ NTP_4_2_5P198
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.67 +3 -3
+ NTP_4_2_5P198
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.67 +4 -4
+ NTP_4_2_5P198
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.67 +1 -1
+ NTP_4_2_5P198
+
+ ntpsnmpd/ntpsnmpd.1@1.67 +2 -2
+ NTP_4_2_5P198
+
+ packageinfo.sh@1.201 +1 -1
+ NTP_4_2_5P198
+
+ sntp/sntp-opts.c@1.187 +3 -3
+ NTP_4_2_5P198
+
+ sntp/sntp-opts.h@1.187 +4 -4
+ NTP_4_2_5P198
+
+ sntp/sntp-opts.texi@1.186 +1 -1
+ NTP_4_2_5P198
+
+ sntp/sntp.1@1.186 +2 -2
+ NTP_4_2_5P198
+
+ util/ntp-keygen-opts.c@1.190 +3 -3
+ NTP_4_2_5P198
+
+ util/ntp-keygen-opts.h@1.190 +4 -4
+ NTP_4_2_5P198
+
+ util/ntp-keygen-opts.texi@1.189 +1 -1
+ NTP_4_2_5P198
+
+ util/ntp-keygen.1@1.189 +2 -2
+ NTP_4_2_5P198
+
+ChangeSet@1.1940.1.1, 2009-08-03 01:32:51-04:00, stenn@whimsy.udel.edu
+ Upgraded to autogen-5.9.9-pre5
+
+ ChangeLog@1.396 +1 -0
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/ag-char-map.h@1.4 +37 -6
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/autoopts.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/autoopts.h@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/autoopts/options.h@1.4 +34 -40
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/boolean.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/compat/compat.h@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/compat/pathfind.c@1.3 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/compat/windows-config.h@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/configfile.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/cook.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/enumeration.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/environment.c@1.4 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/file.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/genshell.c@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/genshell.h@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/load.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/m4/liboptschk.m4@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/makeshell.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/nested.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/numeric.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/pgusage.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/proto.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/putshell.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/reset.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/restore.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/save.c@1.4 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/sort.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/stack.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/streqvcmp.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/text_mmap.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/time.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/tokenize.c@1.2 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/usage.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/value-type.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/version.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ gsoc_sntp/libopts/xat-attribute.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/ag-char-map.h@1.4 +37 -6
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/autoopts.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/autoopts.h@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/autoopts/options.h@1.4 +34 -40
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/autoopts/usage-txt.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/boolean.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/compat/compat.h@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/compat/pathfind.c@1.3 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/compat/windows-config.h@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/configfile.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/cook.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/enumeration.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/environment.c@1.4 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/file.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/genshell.c@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/genshell.h@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/load.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/m4/libopts.m4@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/m4/liboptschk.m4@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/makeshell.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/nested.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/numeric.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/pgusage.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/proto.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/putshell.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/reset.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/restore.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/save.c@1.4 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/sort.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/stack.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/streqvcmp.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/text_mmap.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/time.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/tokenize.c@1.2 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/usage.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/value-type.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/version.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ libopts/xat-attribute.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/ag-char-map.h@1.4 +37 -6
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/autoopts.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/autoopts.h@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/autoopts/options.h@1.4 +34 -40
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/autoopts/usage-txt.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/boolean.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/compat/compat.h@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/compat/pathfind.c@1.3 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/compat/windows-config.h@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/configfile.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/cook.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/enumeration.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/environment.c@1.4 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/file.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/genshell.c@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/genshell.h@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/load.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/m4/libopts.m4@1.4 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/m4/liboptschk.m4@1.3 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/makeshell.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/nested.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/numeric.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/pgusage.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/proto.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/putshell.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/reset.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/restore.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/save.c@1.4 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/sort.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/stack.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/streqvcmp.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/text_mmap.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/time.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/tokenize.c@1.2 +2 -2
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/usage.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/value-type.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/version.c@1.3 +3 -3
+ Upgraded to autogen-5.9.9-pre5
+
+ sntp/libopts/xat-attribute.h@1.4 +1 -1
+ Upgraded to autogen-5.9.9-pre5
+
+ChangeSet@1.1941, 2009-08-03 05:01:24+00:00, davehart@shiny.ad.hartbrothers.com
+ remove workaround ports/winnt/include/inttypes.h for Autogen 5.98
+ problem fixed in 5.99
+
+ BitKeeper/deleted/.del-inttypes.h~d8eb65583f310a51@1.2 +0 -0
+ Delete: ports/winnt/include/inttypes.h
+
+ ports/winnt/include/config.h@1.73 +0 -1
+ remove empty inttypes.h workaround for Autogen 5.98 problem fixed in 5.99
+
+ ports/winnt/libntp/libntp.vcproj@1.12 +4 -4
+ add libopts\ag-char-map.h reference, remove workaround inttypes.h
+
+ChangeSet@1.1940, 2009-07-30 07:53:13-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P197
+ TAG: NTP_4_2_5P197
+
+ ChangeLog@1.395 +1 -0
+ NTP_4_2_5P197
+
+ gsoc_sntp/sntp-opts.c@1.59 +2 -2
+ NTP_4_2_5P197
+
+ gsoc_sntp/sntp-opts.h@1.59 +3 -3
+ NTP_4_2_5P197
+
+ gsoc_sntp/sntp-opts.texi@1.59 +1 -1
+ NTP_4_2_5P197
+
+ gsoc_sntp/sntp.1@1.59 +2 -2
+ NTP_4_2_5P197
+
+ ntpd/ntpd-opts.c@1.190 +2 -2
+ NTP_4_2_5P197
+
+ ntpd/ntpd-opts.h@1.190 +3 -3
+ NTP_4_2_5P197
+
+ ntpd/ntpd-opts.texi@1.188 +1 -1
+ NTP_4_2_5P197
+
+ ntpd/ntpd.1@1.188 +2 -2
+ NTP_4_2_5P197
+
+ ntpdc/ntpdc-opts.c@1.186 +2 -2
+ NTP_4_2_5P197
+
+ ntpdc/ntpdc-opts.h@1.186 +3 -3
+ NTP_4_2_5P197
+
+ ntpdc/ntpdc-opts.texi@1.185 +1 -1
+ NTP_4_2_5P197
+
+ ntpdc/ntpdc.1@1.185 +2 -2
+ NTP_4_2_5P197
+
+ ntpq/ntpq-opts.c@1.186 +2 -2
+ NTP_4_2_5P197
+
+ ntpq/ntpq-opts.h@1.186 +3 -3
+ NTP_4_2_5P197
+
+ ntpq/ntpq-opts.texi@1.185 +1 -1
+ NTP_4_2_5P197
+
+ ntpq/ntpq.1@1.185 +2 -2
+ NTP_4_2_5P197
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.66 +2 -2
+ NTP_4_2_5P197
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.66 +3 -3
+ NTP_4_2_5P197
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.66 +1 -1
+ NTP_4_2_5P197
+
+ ntpsnmpd/ntpsnmpd.1@1.66 +2 -2
+ NTP_4_2_5P197
+
+ packageinfo.sh@1.200 +1 -1
+ NTP_4_2_5P197
+
+ sntp/sntp-opts.c@1.186 +2 -2
+ NTP_4_2_5P197
+
+ sntp/sntp-opts.h@1.186 +3 -3
+ NTP_4_2_5P197
+
+ sntp/sntp-opts.texi@1.185 +1 -1
+ NTP_4_2_5P197
+
+ sntp/sntp.1@1.185 +2 -2
+ NTP_4_2_5P197
+
+ util/ntp-keygen-opts.c@1.189 +2 -2
+ NTP_4_2_5P197
+
+ util/ntp-keygen-opts.h@1.189 +3 -3
+ NTP_4_2_5P197
+
+ util/ntp-keygen-opts.texi@1.188 +1 -1
+ NTP_4_2_5P197
+
+ util/ntp-keygen.1@1.188 +2 -2
+ NTP_4_2_5P197
+
+ChangeSet@1.1939, 2009-07-30 02:38:38-04:00, stenn@whimsy.udel.edu
+ The build script now has . at the end of PATH for config.guess
+
+ ChangeLog@1.394 +1 -0
+ The build script now has . at the end of PATH for config.guess
+
+ build@1.29 +3 -0
+ The build script now has . at the end of PATH for config.guess
+
+ChangeSet@1.1938, 2009-07-29 07:54:11-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P196
+ TAG: NTP_4_2_5P196
+
+ ChangeLog@1.393 +1 -0
+ NTP_4_2_5P196
+
+ gsoc_sntp/sntp-opts.c@1.58 +2 -2
+ NTP_4_2_5P196
+
+ gsoc_sntp/sntp-opts.h@1.58 +3 -3
+ NTP_4_2_5P196
+
+ gsoc_sntp/sntp-opts.texi@1.58 +1 -1
+ NTP_4_2_5P196
+
+ gsoc_sntp/sntp.1@1.58 +2 -2
+ NTP_4_2_5P196
+
+ ntpd/ntpd-opts.c@1.189 +2 -2
+ NTP_4_2_5P196
+
+ ntpd/ntpd-opts.h@1.189 +3 -3
+ NTP_4_2_5P196
+
+ ntpd/ntpd-opts.texi@1.187 +1 -1
+ NTP_4_2_5P196
+
+ ntpd/ntpd.1@1.187 +2 -2
+ NTP_4_2_5P196
+
+ ntpdc/ntpdc-opts.c@1.185 +2 -2
+ NTP_4_2_5P196
+
+ ntpdc/ntpdc-opts.h@1.185 +3 -3
+ NTP_4_2_5P196
+
+ ntpdc/ntpdc-opts.texi@1.184 +1 -1
+ NTP_4_2_5P196
+
+ ntpdc/ntpdc.1@1.184 +2 -2
+ NTP_4_2_5P196
+
+ ntpq/ntpq-opts.c@1.185 +2 -2
+ NTP_4_2_5P196
+
+ ntpq/ntpq-opts.h@1.185 +3 -3
+ NTP_4_2_5P196
+
+ ntpq/ntpq-opts.texi@1.184 +1 -1
+ NTP_4_2_5P196
+
+ ntpq/ntpq.1@1.184 +2 -2
+ NTP_4_2_5P196
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.65 +2 -2
+ NTP_4_2_5P196
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.65 +3 -3
+ NTP_4_2_5P196
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.65 +1 -1
+ NTP_4_2_5P196
+
+ ntpsnmpd/ntpsnmpd.1@1.65 +2 -2
+ NTP_4_2_5P196
+
+ packageinfo.sh@1.199 +1 -1
+ NTP_4_2_5P196
+
+ sntp/sntp-opts.c@1.185 +2 -2
+ NTP_4_2_5P196
+
+ sntp/sntp-opts.h@1.185 +3 -3
+ NTP_4_2_5P196
+
+ sntp/sntp-opts.texi@1.184 +1 -1
+ NTP_4_2_5P196
+
+ sntp/sntp.1@1.184 +2 -2
+ NTP_4_2_5P196
+
+ util/ntp-keygen-opts.c@1.188 +2 -2
+ NTP_4_2_5P196
+
+ util/ntp-keygen-opts.h@1.188 +3 -3
+ NTP_4_2_5P196
+
+ util/ntp-keygen-opts.texi@1.187 +1 -1
+ NTP_4_2_5P196
+
+ util/ntp-keygen.1@1.187 +2 -2
+ NTP_4_2_5P196
+
+ChangeSet@1.1937, 2009-07-29 02:25:28-04:00, stenn@whimsy.udel.edu
+ Typo fix, and note cvo.sh supports QNX now, too
+
+ ChangeLog@1.392 +1 -1
+ cvo.sh now supports QNX
+
+ ChangeLog@1.391 +1 -1
+ typo
+
+ChangeSet@1.1934.1.1, 2009-07-29 02:03:51-04:00, stenn@whimsy.udel.edu
+ [Bug 1276 normal] CID 52: crypto_xmit() may call crypto_alice[23]() with NULL peer
+
+ ChangeLog@1.388.1.1 +2 -0
+ [Bug 1276 normal] CID 52: crypto_xmit() may call crypto_alice[23]() with NULL peer
+
+ ntpd/ntp_crypto.c@1.139 +9 -0
+ [Bug 1276 normal] CID 52: crypto_xmit() may call crypto_alice[23]() with NULL peer
+
+ChangeSet@1.1935, 2009-07-29 04:13:53+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10.
+ [Bug 1273] CID 10: Palisade leaks unit struct in error path.
+ [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers
+ are consistent.
+ [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0],
+ precs[0].
+
+
+ ChangeLog@1.389 +6 -0
+ [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10.
+ [Bug 1273] CID 10: Palisade leaks unit struct in error path.
+ [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers
+ are consistent.
+ [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0],
+ precs[0].
+
+
+ gsoc_sntp/networking.c@1.22 +11 -3
+ [Bug 1272] gsoc_sntp IPv6 build problems under HP-UX 10.
+ [Bug 1274] CID 67: ensure resolve_hosts() output count and pointers
+ are consistent.
+
+ ntpd/ntp_io.c@1.294 +1 -1
+ cleanup from sockaddr_u introduction, stoa needs pointer to sockaddr_u not interface
+
+ ntpd/refclock_palisade.c@1.26 +3 -9
+ [Bug 1273] CID 10: Palisade leaks unit struct in error path.
+
+
+ sntp/main.c@1.10 +3 -0
+ [Bug 1275] CID 45: CID 46: old sntp uses uninitialized guesses[0],
+ precs[0].
+
+
+ChangeSet@1.1934, 2009-07-27 07:54:24-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P195
+ TAG: NTP_4_2_5P195
+
+ ChangeLog@1.388 +1 -0
+ NTP_4_2_5P195
+
+ gsoc_sntp/sntp-opts.c@1.57 +2 -2
+ NTP_4_2_5P195
+
+ gsoc_sntp/sntp-opts.h@1.57 +3 -3
+ NTP_4_2_5P195
+
+ gsoc_sntp/sntp-opts.texi@1.57 +1 -1
+ NTP_4_2_5P195
+
+ gsoc_sntp/sntp.1@1.57 +2 -2
+ NTP_4_2_5P195
+
+ ntpd/ntpd-opts.c@1.188 +2 -2
+ NTP_4_2_5P195
+
+ ntpd/ntpd-opts.h@1.188 +3 -3
+ NTP_4_2_5P195
+
+ ntpd/ntpd-opts.texi@1.186 +1 -1
+ NTP_4_2_5P195
+
+ ntpd/ntpd.1@1.186 +2 -2
+ NTP_4_2_5P195
+
+ ntpdc/ntpdc-opts.c@1.184 +2 -2
+ NTP_4_2_5P195
+
+ ntpdc/ntpdc-opts.h@1.184 +3 -3
+ NTP_4_2_5P195
+
+ ntpdc/ntpdc-opts.texi@1.183 +1 -1
+ NTP_4_2_5P195
+
+ ntpdc/ntpdc.1@1.183 +2 -2
+ NTP_4_2_5P195
+
+ ntpq/ntpq-opts.c@1.184 +2 -2
+ NTP_4_2_5P195
+
+ ntpq/ntpq-opts.h@1.184 +3 -3
+ NTP_4_2_5P195
+
+ ntpq/ntpq-opts.texi@1.183 +1 -1
+ NTP_4_2_5P195
+
+ ntpq/ntpq.1@1.183 +2 -2
+ NTP_4_2_5P195
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.64 +2 -2
+ NTP_4_2_5P195
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.64 +3 -3
+ NTP_4_2_5P195
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.64 +1 -1
+ NTP_4_2_5P195
+
+ ntpsnmpd/ntpsnmpd.1@1.64 +2 -2
+ NTP_4_2_5P195
+
+ packageinfo.sh@1.198 +1 -1
+ NTP_4_2_5P195
+
+ sntp/sntp-opts.c@1.184 +2 -2
+ NTP_4_2_5P195
+
+ sntp/sntp-opts.h@1.184 +3 -3
+ NTP_4_2_5P195
+
+ sntp/sntp-opts.texi@1.183 +1 -1
+ NTP_4_2_5P195
+
+ sntp/sntp.1@1.183 +2 -2
+ NTP_4_2_5P195
+
+ util/ntp-keygen-opts.c@1.187 +2 -2
+ NTP_4_2_5P195
+
+ util/ntp-keygen-opts.h@1.187 +3 -3
+ NTP_4_2_5P195
+
+ util/ntp-keygen-opts.texi@1.186 +1 -1
+ NTP_4_2_5P195
+
+ util/ntp-keygen.1@1.186 +2 -2
+ NTP_4_2_5P195
+
+ChangeSet@1.1933, 2009-07-27 06:57:03+00:00, stenn@psp-fb1.ntp.org
+ cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE
+
+ ChangeLog@1.387 +1 -0
+ cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE
+
+ scripts/cvo.sh@1.3 +30 -6
+ cvo.sh: Add support for CentOS, Fedora, Slackware, SuSE
+
+ChangeSet@1.1932, 2009-07-26 07:54:22-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P194
+ TAG: NTP_4_2_5P194
+
+ ChangeLog@1.386 +1 -0
+ NTP_4_2_5P194
+
+ gsoc_sntp/sntp-opts.c@1.56 +2 -2
+ NTP_4_2_5P194
+
+ gsoc_sntp/sntp-opts.h@1.56 +3 -3
+ NTP_4_2_5P194
+
+ gsoc_sntp/sntp-opts.texi@1.56 +1 -1
+ NTP_4_2_5P194
+
+ gsoc_sntp/sntp.1@1.56 +2 -2
+ NTP_4_2_5P194
+
+ ntpd/ntpd-opts.c@1.187 +2 -2
+ NTP_4_2_5P194
+
+ ntpd/ntpd-opts.h@1.187 +3 -3
+ NTP_4_2_5P194
+
+ ntpd/ntpd-opts.texi@1.185 +1 -1
+ NTP_4_2_5P194
+
+ ntpd/ntpd.1@1.185 +2 -2
+ NTP_4_2_5P194
+
+ ntpdc/ntpdc-opts.c@1.183 +2 -2
+ NTP_4_2_5P194
+
+ ntpdc/ntpdc-opts.h@1.183 +3 -3
+ NTP_4_2_5P194
+
+ ntpdc/ntpdc-opts.texi@1.182 +1 -1
+ NTP_4_2_5P194
+
+ ntpdc/ntpdc.1@1.182 +2 -2
+ NTP_4_2_5P194
+
+ ntpq/ntpq-opts.c@1.183 +2 -2
+ NTP_4_2_5P194
+
+ ntpq/ntpq-opts.h@1.183 +3 -3
+ NTP_4_2_5P194
+
+ ntpq/ntpq-opts.texi@1.182 +1 -1
+ NTP_4_2_5P194
+
+ ntpq/ntpq.1@1.182 +2 -2
+ NTP_4_2_5P194
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.63 +2 -2
+ NTP_4_2_5P194
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.63 +3 -3
+ NTP_4_2_5P194
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.63 +1 -1
+ NTP_4_2_5P194
+
+ ntpsnmpd/ntpsnmpd.1@1.63 +2 -2
+ NTP_4_2_5P194
+
+ packageinfo.sh@1.197 +1 -1
+ NTP_4_2_5P194
+
+ sntp/sntp-opts.c@1.183 +2 -2
+ NTP_4_2_5P194
+
+ sntp/sntp-opts.h@1.183 +3 -3
+ NTP_4_2_5P194
+
+ sntp/sntp-opts.texi@1.182 +1 -1
+ NTP_4_2_5P194
+
+ sntp/sntp.1@1.182 +2 -2
+ NTP_4_2_5P194
+
+ util/ntp-keygen-opts.c@1.186 +2 -2
+ NTP_4_2_5P194
+
+ util/ntp-keygen-opts.h@1.186 +3 -3
+ NTP_4_2_5P194
+
+ util/ntp-keygen-opts.texi@1.185 +1 -1
+ NTP_4_2_5P194
+
+ util/ntp-keygen.1@1.185 +2 -2
+ NTP_4_2_5P194
+
+ChangeSet@1.1931, 2009-07-25 22:36:56-04:00, stenn@psp-deb1.ntp.org
+ Handle debian
+
+ scripts/cvo.sh@1.2 +5 -0
+ Handle debian
+
+ChangeSet@1.1930, 2009-07-25 22:36:32-04:00, stenn@psp-deb1.ntp.org
+ better sanity checking in "build"
+
+ build@1.28 +3 -0
+ better sanity checking in "build"
+
+ChangeSet@1.1929, 2009-07-25 21:47:07-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.385 +1 -0
+ Documentation updates from Dave Mills
+
+ html/debug.html@1.27 +6 -5
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1928, 2009-07-25 21:41:08-04:00, stenn@whimsy.udel.edu
+ Use scripts/cvo.sh in the build script to get better subdir names
+
+ ChangeLog@1.384 +1 -0
+ Use scripts/cvo.sh in the build script to get better subdir names
+
+ build@1.27 +1 -1
+ Use scripts/cvo.sh in the build script to get better subdir names
+
+ scripts/cvo.sh@1.1 +120 -0
+ BitKeeper file /deacon/backroom/ntp-dev/scripts/cvo.sh
+
+ scripts/cvo.sh@1.0 +0 -0
+
+ChangeSet@1.1927, 2009-07-25 07:54:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P193
+ TAG: NTP_4_2_5P193
+
+ ChangeLog@1.383 +1 -0
+ NTP_4_2_5P193
+
+ gsoc_sntp/sntp-opts.c@1.55 +2 -2
+ NTP_4_2_5P193
+
+ gsoc_sntp/sntp-opts.h@1.55 +3 -3
+ NTP_4_2_5P193
+
+ gsoc_sntp/sntp-opts.texi@1.55 +1 -1
+ NTP_4_2_5P193
+
+ gsoc_sntp/sntp.1@1.55 +2 -2
+ NTP_4_2_5P193
+
+ ntpd/ntpd-opts.c@1.186 +2 -2
+ NTP_4_2_5P193
+
+ ntpd/ntpd-opts.h@1.186 +3 -3
+ NTP_4_2_5P193
+
+ ntpd/ntpd-opts.texi@1.184 +1 -1
+ NTP_4_2_5P193
+
+ ntpd/ntpd.1@1.184 +2 -2
+ NTP_4_2_5P193
+
+ ntpdc/ntpdc-opts.c@1.182 +2 -2
+ NTP_4_2_5P193
+
+ ntpdc/ntpdc-opts.h@1.182 +3 -3
+ NTP_4_2_5P193
+
+ ntpdc/ntpdc-opts.texi@1.181 +1 -1
+ NTP_4_2_5P193
+
+ ntpdc/ntpdc.1@1.181 +2 -2
+ NTP_4_2_5P193
+
+ ntpq/ntpq-opts.c@1.182 +2 -2
+ NTP_4_2_5P193
+
+ ntpq/ntpq-opts.h@1.182 +3 -3
+ NTP_4_2_5P193
+
+ ntpq/ntpq-opts.texi@1.181 +1 -1
+ NTP_4_2_5P193
+
+ ntpq/ntpq.1@1.181 +2 -2
+ NTP_4_2_5P193
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.62 +2 -2
+ NTP_4_2_5P193
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.62 +3 -3
+ NTP_4_2_5P193
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.62 +1 -1
+ NTP_4_2_5P193
+
+ ntpsnmpd/ntpsnmpd.1@1.62 +2 -2
+ NTP_4_2_5P193
+
+ packageinfo.sh@1.196 +1 -1
+ NTP_4_2_5P193
+
+ sntp/sntp-opts.c@1.182 +2 -2
+ NTP_4_2_5P193
+
+ sntp/sntp-opts.h@1.182 +3 -3
+ NTP_4_2_5P193
+
+ sntp/sntp-opts.texi@1.181 +1 -1
+ NTP_4_2_5P193
+
+ sntp/sntp.1@1.181 +2 -2
+ NTP_4_2_5P193
+
+ util/ntp-keygen-opts.c@1.185 +2 -2
+ NTP_4_2_5P193
+
+ util/ntp-keygen-opts.h@1.185 +3 -3
+ NTP_4_2_5P193
+
+ util/ntp-keygen-opts.texi@1.184 +1 -1
+ NTP_4_2_5P193
+
+ util/ntp-keygen.1@1.184 +2 -2
+ NTP_4_2_5P193
+
+ChangeSet@1.1926, 2009-07-25 01:12:25+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized.
+ [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server().
+ [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks
+ uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
+ [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD.
+ [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt.
+ [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed.
+ [Bug 1267] CID 44: old sntp handle_saving() writes stack garbage to
+ file when clearing.
+ [Bug 1268] CID 63: resolve_hosts() leaks error message buffer.
+ [Bug 1269] CID 74: use assertion to ensure move_fd() does not return
+ negative descriptors.
+ [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface
+ uninitialized.
+
+
+ ChangeLog@1.382 +14 -0
+ [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized.
+ [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server().
+ [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks
+ uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
+ [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD.
+ [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt.
+ [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed.
+ [Bug 1267] CID 44: old sntp handle_saving() writes stack garbage to
+ file when clearing.
+ [Bug 1268] CID 63: resolve_hosts() leaks error message buffer.
+ [Bug 1269] CID 74: use assertion to ensure move_fd() does not return
+ negative descriptors.
+ [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface
+ uninitialized.
+
+
+ gsoc_sntp/main.c@1.16 +7 -10
+ [Bug 1264] CID 64: gsoc_sntp on_wire() frees wrong ptr receiving KoD.
+ [Bug 1265] CID 65: CID 66: gsoc_sntp on_wire() leaks x_pkt, r_pkt.
+
+
+ gsoc_sntp/networking.c@1.21 +3 -3
+ [Bug 1268] CID 63: resolve_hosts() leaks error message buffer.
+ [Bug 1270] CID 70: gsoc_sntp recv_bcst_data mdevadr.ipv6mr_interface
+ uninitialized.
+
+
+ ntpd/ntp_io.c@1.293 +2 -0
+ [Bug 1269] CID 74: use assertion to ensure move_fd() does not return
+ negative descriptors.
+
+ ntpd/ntpsim.c@1.22 +3 -0
+ [Bug 1261] CID 34: simulate_server() rbuf.msg_flags uninitialized.
+ [Bug 1262] CID 35: xpkt.mac uninitialized in simulate_server().
+
+
+ ntpd/refclock_arc.c@1.21 +129 -127
+ [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks
+ uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
+
+
+ ntpd/refclock_chronolog.c@1.8 +2 -0
+ [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks
+ uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
+
+
+ ntpd/refclock_datum.c@1.12 +2 -0
+ [Bug 1266] CID 39: datum_pts_start() uninitialized arg.c_ospeed.
+
+
+ ntpd/refclock_dumbclock.c@1.13 +20 -26
+ [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks
+ uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
+
+
+ ntpd/refclock_pcf.c@1.9 +2 -0
+ [Bug 1263] CID 37: CID 38: CID 40: CID 43: multiple refclocks
+ uninitialized tm_zone (arc, chronolog, dumbclock, pcf).
+
+
+ ports/winnt/include/config.h@1.72 +2 -1
+ Enable dumbclock, Chronolog refclock drivers in Windows ntpd
+
+ ports/winnt/ntpd/ntpd.dsp@1.32 +4 -0
+ add refclock_chronolog.c
+
+ ports/winnt/ntpd/ntpd.vcproj@1.12 +4 -0
+ add refclock_chronolog.c
+
+ sntp/main.c@1.9 +2 -0
+ zero stack buffer before writing to file in save_clear operation
+
+ChangeSet@1.1925, 2009-07-24 08:00:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P192
+ TAG: NTP_4_2_5P192
+
+ ChangeLog@1.381 +1 -0
+ NTP_4_2_5P192
+
+ gsoc_sntp/sntp-opts.c@1.54 +2 -2
+ NTP_4_2_5P192
+
+ gsoc_sntp/sntp-opts.h@1.54 +3 -3
+ NTP_4_2_5P192
+
+ gsoc_sntp/sntp-opts.texi@1.54 +1 -1
+ NTP_4_2_5P192
+
+ gsoc_sntp/sntp.1@1.54 +2 -2
+ NTP_4_2_5P192
+
+ ntpd/ntpd-opts.c@1.185 +2 -2
+ NTP_4_2_5P192
+
+ ntpd/ntpd-opts.h@1.185 +3 -3
+ NTP_4_2_5P192
+
+ ntpd/ntpd-opts.texi@1.183 +1 -1
+ NTP_4_2_5P192
+
+ ntpd/ntpd.1@1.183 +2 -2
+ NTP_4_2_5P192
+
+ ntpdc/ntpdc-opts.c@1.181 +2 -2
+ NTP_4_2_5P192
+
+ ntpdc/ntpdc-opts.h@1.181 +3 -3
+ NTP_4_2_5P192
+
+ ntpdc/ntpdc-opts.texi@1.180 +1 -1
+ NTP_4_2_5P192
+
+ ntpdc/ntpdc.1@1.180 +2 -2
+ NTP_4_2_5P192
+
+ ntpq/ntpq-opts.c@1.181 +2 -2
+ NTP_4_2_5P192
+
+ ntpq/ntpq-opts.h@1.181 +3 -3
+ NTP_4_2_5P192
+
+ ntpq/ntpq-opts.texi@1.180 +1 -1
+ NTP_4_2_5P192
+
+ ntpq/ntpq.1@1.180 +2 -2
+ NTP_4_2_5P192
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.61 +2 -2
+ NTP_4_2_5P192
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.61 +3 -3
+ NTP_4_2_5P192
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.61 +1 -1
+ NTP_4_2_5P192
+
+ ntpsnmpd/ntpsnmpd.1@1.61 +2 -2
+ NTP_4_2_5P192
+
+ packageinfo.sh@1.195 +1 -1
+ NTP_4_2_5P192
+
+ sntp/sntp-opts.c@1.181 +2 -2
+ NTP_4_2_5P192
+
+ sntp/sntp-opts.h@1.181 +3 -3
+ NTP_4_2_5P192
+
+ sntp/sntp-opts.texi@1.180 +1 -1
+ NTP_4_2_5P192
+
+ sntp/sntp.1@1.180 +2 -2
+ NTP_4_2_5P192
+
+ util/ntp-keygen-opts.c@1.184 +2 -2
+ NTP_4_2_5P192
+
+ util/ntp-keygen-opts.h@1.184 +3 -3
+ NTP_4_2_5P192
+
+ util/ntp-keygen-opts.texi@1.183 +1 -1
+ NTP_4_2_5P192
+
+ util/ntp-keygen.1@1.183 +2 -2
+ NTP_4_2_5P192
+
+ChangeSet@1.1922.1.1, 2009-07-24 06:41:17+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 965] CID 42: ss_family uninitialized.
+ [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer.
+ [Bug 1251] CID 68: search_entry() mishandles dst argument.
+ [Bug 1252] CID 32: Quiet Coverity warning with assertion.
+ [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a
+ list with one entry.
+ [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call.
+ [Bug 1255] CID 55: pkt_output() leaks a copy of each packet.
+ [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as
+ terminal.
+ [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile).
+ [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification.
+ [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata)
+ on error paths.
+ [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata).
+
+
+ ChangeLog@1.378.1.1 +15 -0
+ [Bug 965] CID 42: ss_family uninitialized.
+ [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer.
+ [Bug 1251] CID 68: search_entry() mishandles dst argument.
+ [Bug 1252] CID 32: Quiet Coverity warning with assertion.
+ [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a
+ list with one entry.
+ [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call.
+ [Bug 1255] CID 55: pkt_output() leaks a copy of each packet.
+ [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as
+ terminal.
+ [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile).
+ [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification.
+ [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata)
+ on error paths.
+ [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata).
+
+
+ gsoc_sntp/crypto.c@1.6 +8 -10
+ use sizeof(buf) rather than hardcode
+ [Bug 1253] CID 50: gsoc_sntp/crypto.c auth_init() always returns a
+ list with one entry.
+ [Bug 1257] CID 57: gsoc_sntp auth_init() fails to fclose(keyfile).
+
+
+ gsoc_sntp/kod_management.c@1.9 +55 -40
+ [Bug 1250] CID 53: kod_init_kod_db() overruns kod_db malloc'd buffer.
+ [Bug 1251] CID 68: search_entry() mishandles dst argument.
+
+
+ gsoc_sntp/main.c@1.15 +25 -26
+ [Bug 1251] CID 68: search_entry() mishandles dst argument.
+ [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification.
+
+
+ gsoc_sntp/networking.c@1.20 +35 -58
+ [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification.
+ [Bug 1259] CID 59: gsoc_sntp recv_bcast_data() fails to free(rdata)
+ on error paths.
+ [Bug 1260] CID 60: gsoc_sntp recvpkt() fails to free(rdata).
+
+
+ gsoc_sntp/networking.h@1.13 +1 -1
+ [Bug 1258] CID 54: gsoc_sntp resolve_hosts() needs simplification.
+
+
+ gsoc_sntp/utilities.c@1.7 +9 -2
+ [Bug 1254] CID 56: tv_to_str() leaks a struct tm each call.
+ [Bug 1255] CID 55: pkt_output() leaks a copy of each packet.
+
+
+ include/ntp_assert.h@1.3 +46 -13
+ [Bug 1256] CID 51: Coverity doesn't recognize our assertion macros as
+ terminal.
+
+
+ ntpd/refclock_nmea.c@1.42 +1 -0
+ [Bug 965] CID 42: ss_family uninitialized.
+
+ ntpdc/ntpdc.c@1.66 +9 -2
+ [Bug 1252] CID 32: Quiet Coverity warning with assertion.
+
+
+ ports/winnt/libntp/libntp.vcproj@1.11 +4 -0
+ add ntp_assert.h reference
+
+ ports/winnt/ntpd/ntpd.vcproj@1.11 +4 -0
+ add ntp_assert.h reference
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.4 +4 -0
+ add ntp_assert.h reference
+
+ChangeSet@1.1923, 2009-07-24 01:21:05-04:00, stenn@whimsy.udel.edu
+ Upgrade to autogen-5.9.9pre2
+
+ ChangeLog@1.379 +1 -0
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/README@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/ag-char-map.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/autoopts.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/autoopts.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/autoopts/options.h@1.3 +2 -2
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/boolean.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/compat/compat.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/compat/pathfind.c@1.2 +2 -2
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/compat/windows-config.h@1.2 +3 -3
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/configfile.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/cook.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/enumeration.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/environment.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/file.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/genshell.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/genshell.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/load.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.3 +4 -4
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/m4/liboptschk.m4@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/makeshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/nested.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/numeric.c@1.2 +9 -8
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/pgusage.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/proto.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/putshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/reset.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/restore.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/save.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/sort.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/stack.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/streqvcmp.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/text_mmap.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/time.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/usage.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/value-type.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/version.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ gsoc_sntp/libopts/xat-attribute.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/README@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/ag-char-map.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/autoopts.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/autoopts.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/autoopts/options.h@1.3 +2 -2
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/autoopts/usage-txt.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/boolean.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/compat/compat.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/compat/pathfind.c@1.2 +2 -2
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/compat/windows-config.h@1.2 +3 -3
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/configfile.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/cook.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/enumeration.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/environment.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/file.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/genshell.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/genshell.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/load.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/m4/libopts.m4@1.3 +4 -4
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/m4/liboptschk.m4@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/makeshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/nested.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/numeric.c@1.2 +9 -8
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/pgusage.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/proto.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/putshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/reset.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/restore.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/save.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/sort.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/stack.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/streqvcmp.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/text_mmap.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/time.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/usage.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/value-type.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/version.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ libopts/xat-attribute.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/README@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/ag-char-map.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/autoopts.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/autoopts.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/autoopts/options.h@1.3 +2 -2
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/autoopts/usage-txt.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/boolean.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/compat/compat.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/compat/pathfind.c@1.2 +2 -2
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/compat/windows-config.h@1.2 +3 -3
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/configfile.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/cook.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/enumeration.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/environment.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/file.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/genshell.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/genshell.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/load.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/m4/libopts.m4@1.3 +4 -4
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/m4/liboptschk.m4@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/makeshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/nested.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/numeric.c@1.2 +9 -8
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/pgusage.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/proto.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/putshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/reset.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/restore.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/save.c@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/sort.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/stack.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/streqvcmp.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/text_mmap.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/time.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/usage.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/value-type.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/version.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ sntp/libopts/xat-attribute.h@1.3 +1 -1
+ Upgrade to autogen-5.9.9pre2
+
+ChangeSet@1.1922, 2009-07-21 07:59:39-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P191
+ TAG: NTP_4_2_5P191
+
+ ChangeLog@1.378 +1 -0
+ NTP_4_2_5P191
+
+ gsoc_sntp/sntp-opts.c@1.53 +2 -2
+ NTP_4_2_5P191
+
+ gsoc_sntp/sntp-opts.h@1.53 +3 -3
+ NTP_4_2_5P191
+
+ gsoc_sntp/sntp-opts.texi@1.53 +1 -1
+ NTP_4_2_5P191
+
+ gsoc_sntp/sntp.1@1.53 +2 -2
+ NTP_4_2_5P191
+
+ ntpd/ntpd-opts.c@1.184 +2 -2
+ NTP_4_2_5P191
+
+ ntpd/ntpd-opts.h@1.184 +3 -3
+ NTP_4_2_5P191
+
+ ntpd/ntpd-opts.texi@1.182 +1 -1
+ NTP_4_2_5P191
+
+ ntpd/ntpd.1@1.182 +2 -2
+ NTP_4_2_5P191
+
+ ntpdc/ntpdc-opts.c@1.180 +2 -2
+ NTP_4_2_5P191
+
+ ntpdc/ntpdc-opts.h@1.180 +3 -3
+ NTP_4_2_5P191
+
+ ntpdc/ntpdc-opts.texi@1.179 +1 -1
+ NTP_4_2_5P191
+
+ ntpdc/ntpdc.1@1.179 +2 -2
+ NTP_4_2_5P191
+
+ ntpq/ntpq-opts.c@1.180 +2 -2
+ NTP_4_2_5P191
+
+ ntpq/ntpq-opts.h@1.180 +3 -3
+ NTP_4_2_5P191
+
+ ntpq/ntpq-opts.texi@1.179 +1 -1
+ NTP_4_2_5P191
+
+ ntpq/ntpq.1@1.179 +2 -2
+ NTP_4_2_5P191
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.60 +2 -2
+ NTP_4_2_5P191
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.60 +3 -3
+ NTP_4_2_5P191
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.60 +1 -1
+ NTP_4_2_5P191
+
+ ntpsnmpd/ntpsnmpd.1@1.60 +2 -2
+ NTP_4_2_5P191
+
+ packageinfo.sh@1.194 +1 -1
+ NTP_4_2_5P191
+
+ sntp/sntp-opts.c@1.180 +2 -2
+ NTP_4_2_5P191
+
+ sntp/sntp-opts.h@1.180 +3 -3
+ NTP_4_2_5P191
+
+ sntp/sntp-opts.texi@1.179 +1 -1
+ NTP_4_2_5P191
+
+ sntp/sntp.1@1.179 +2 -2
+ NTP_4_2_5P191
+
+ util/ntp-keygen-opts.c@1.183 +2 -2
+ NTP_4_2_5P191
+
+ util/ntp-keygen-opts.h@1.183 +3 -3
+ NTP_4_2_5P191
+
+ util/ntp-keygen-opts.texi@1.182 +1 -1
+ NTP_4_2_5P191
+
+ util/ntp-keygen.1@1.182 +2 -2
+ NTP_4_2_5P191
+
+ChangeSet@1.1921, 2009-07-21 04:22:31-04:00, stenn@whimsy.udel.edu
+ Upgrade to autogen-5.9.9pre1
+
+ ChangeLog@1.377 +1 -0
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/ag-char-map.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/autoopts/options.h@1.2 +2 -2
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/environment.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/genshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/genshell.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/proto.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/save.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/value-type.c@1.2 +1 -4
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/value-type.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/xat-attribute.c@1.2 +1 -4
+ Upgrade to autogen-5.9.9pre1
+
+ gsoc_sntp/libopts/xat-attribute.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/ag-char-map.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/autoopts/options.h@1.2 +2 -2
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/autoopts/usage-txt.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/environment.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/genshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/genshell.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/m4/libopts.m4@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/proto.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/save.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/value-type.c@1.2 +1 -4
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/value-type.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/xat-attribute.c@1.2 +1 -4
+ Upgrade to autogen-5.9.9pre1
+
+ libopts/xat-attribute.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/ag-char-map.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/autoopts/options.h@1.2 +2 -2
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/autoopts/usage-txt.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/environment.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/genshell.c@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/genshell.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/m4/libopts.m4@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/proto.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/save.c@1.2 +4 -3
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/value-type.c@1.2 +1 -4
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/value-type.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/xat-attribute.c@1.2 +1 -4
+ Upgrade to autogen-5.9.9pre1
+
+ sntp/libopts/xat-attribute.h@1.2 +1 -1
+ Upgrade to autogen-5.9.9pre1
+
+ChangeSet@1.1920, 2009-07-20 08:08:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P190
+ TAG: NTP_4_2_5P190
+
+ ChangeLog@1.376 +1 -0
+ NTP_4_2_5P190
+
+ gsoc_sntp/sntp-opts.c@1.52 +2 -2
+ NTP_4_2_5P190
+
+ gsoc_sntp/sntp-opts.h@1.52 +3 -3
+ NTP_4_2_5P190
+
+ gsoc_sntp/sntp-opts.texi@1.52 +1 -1
+ NTP_4_2_5P190
+
+ gsoc_sntp/sntp.1@1.52 +2 -2
+ NTP_4_2_5P190
+
+ ntpd/ntpd-opts.c@1.183 +66 -60
+ NTP_4_2_5P190
+
+ ntpd/ntpd-opts.h@1.183 +75 -56
+ NTP_4_2_5P190
+
+ ntpd/ntpd-opts.texi@1.181 +1 -1
+ NTP_4_2_5P190
+
+ ntpd/ntpd.1@1.181 +4 -4
+ NTP_4_2_5P190
+
+ ntpdc/ntpdc-opts.c@1.179 +2 -2
+ NTP_4_2_5P190
+
+ ntpdc/ntpdc-opts.h@1.179 +3 -3
+ NTP_4_2_5P190
+
+ ntpdc/ntpdc-opts.texi@1.178 +2 -2
+ NTP_4_2_5P190
+
+ ntpdc/ntpdc.1@1.178 +2 -2
+ NTP_4_2_5P190
+
+ ntpq/ntpq-opts.c@1.179 +2 -2
+ NTP_4_2_5P190
+
+ ntpq/ntpq-opts.h@1.179 +3 -3
+ NTP_4_2_5P190
+
+ ntpq/ntpq-opts.texi@1.178 +2 -2
+ NTP_4_2_5P190
+
+ ntpq/ntpq.1@1.178 +2 -2
+ NTP_4_2_5P190
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.59 +66 -63
+ NTP_4_2_5P190
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.59 +48 -29
+ NTP_4_2_5P190
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.59 +1 -1
+ NTP_4_2_5P190
+
+ ntpsnmpd/ntpsnmpd.1@1.59 +4 -4
+ NTP_4_2_5P190
+
+ packageinfo.sh@1.193 +1 -1
+ NTP_4_2_5P190
+
+ sntp/sntp-opts.c@1.179 +2 -2
+ NTP_4_2_5P190
+
+ sntp/sntp-opts.h@1.179 +3 -3
+ NTP_4_2_5P190
+
+ sntp/sntp-opts.texi@1.178 +1 -1
+ NTP_4_2_5P190
+
+ sntp/sntp.1@1.178 +2 -2
+ NTP_4_2_5P190
+
+ util/ntp-keygen-opts.c@1.182 +2 -2
+ NTP_4_2_5P190
+
+ util/ntp-keygen-opts.h@1.182 +3 -3
+ NTP_4_2_5P190
+
+ util/ntp-keygen-opts.texi@1.181 +2 -2
+ NTP_4_2_5P190
+
+ util/ntp-keygen.1@1.181 +2 -2
+ NTP_4_2_5P190
+
+ChangeSet@1.1919, 2009-07-20 09:39:06+00:00, davehart@shiny.ad.hartbrothers.com
+ Windows port fixes for new Autogen and libopts
+
+ ports/winnt/include/config.h@1.71 +5 -0
+ Windows port fixes for new Autogen and libopts
+
+ ports/winnt/include/inttypes.h@1.1 +1 -0
+ add dummy (empty) inttypes.h to work around problem with new libopts
+
+ ports/winnt/include/inttypes.h@1.0 +0 -0
+
+ ports/winnt/libntp/libntp.dsp@1.36 +4 -0
+ add dummy (empty) inttypes.h to work around problem with new libopts
+
+ ports/winnt/libntp/libntp.vcproj@1.10 +4 -0
+ add dummy (empty) inttypes.h to work around problem with new libopts
+
+ChangeSet@1.1918, 2009-07-20 05:20:37-04:00, stenn@whimsy.udel.edu
+ Updated to AutoGen-5.9.8
+
+ gsoc_sntp/sntp-opts.c@1.51 +65 -62
+ Updated to AutoGen-5.9.8
+
+ gsoc_sntp/sntp-opts.h@1.51 +56 -37
+ Updated to AutoGen-5.9.8
+
+ gsoc_sntp/sntp-opts.texi@1.51 +1 -1
+ Updated to AutoGen-5.9.8
+
+ gsoc_sntp/sntp.1@1.51 +4 -4
+ Updated to AutoGen-5.9.8
+
+ ntpdc/ntpdc-opts.c@1.178 +67 -68
+ Updated to AutoGen-5.9.8
+
+ ntpdc/ntpdc-opts.h@1.178 +54 -35
+ Updated to AutoGen-5.9.8
+
+ ntpdc/ntpdc-opts.texi@1.177 +2 -2
+ Updated to AutoGen-5.9.8
+
+ ntpdc/ntpdc.1@1.177 +4 -4
+ Updated to AutoGen-5.9.8
+
+ ntpq/ntpq-opts.c@1.178 +67 -68
+ Updated to AutoGen-5.9.8
+
+ ntpq/ntpq-opts.h@1.178 +52 -33
+ Updated to AutoGen-5.9.8
+
+ ntpq/ntpq-opts.texi@1.177 +2 -2
+ Updated to AutoGen-5.9.8
+
+ ntpq/ntpq.1@1.177 +4 -4
+ Updated to AutoGen-5.9.8
+
+ sntp/sntp-opts.c@1.178 +81 -81
+ Updated to AutoGen-5.9.8
+
+ sntp/sntp-opts.h@1.178 +52 -33
+ Updated to AutoGen-5.9.8
+
+ sntp/sntp-opts.texi@1.177 +1 -1
+ Updated to AutoGen-5.9.8
+
+ sntp/sntp.1@1.177 +4 -4
+ Updated to AutoGen-5.9.8
+
+ util/ntp-keygen-opts.c@1.181 +90 -91
+ Updated to AutoGen-5.9.8
+
+ util/ntp-keygen-opts.h@1.181 +62 -43
+ Updated to AutoGen-5.9.8
+
+ util/ntp-keygen-opts.texi@1.180 +2 -2
+ Updated to AutoGen-5.9.8
+
+ util/ntp-keygen.1@1.180 +4 -4
+ Updated to AutoGen-5.9.8
+
+ChangeSet@1.1917, 2009-07-20 04:59:15-04:00, stenn@whimsy.udel.edu
+ Updated to AutoGen-5.9.8
+
+ gsoc_sntp/Makefile.am@1.8 +1 -1
+ Updated to AutoGen-5.9.8
+
+ChangeSet@1.1916, 2009-07-20 04:52:47-04:00, stenn@whimsy.udel.edu
+ Updated to AutoGen-5.9.8
+
+ ChangeLog@1.375 +1 -0
+ Updated to AutoGen-5.9.8
+
+ChangeSet@1.1915, 2009-07-20 04:45:24-04:00, stenn@whimsy.udel.edu
+ Updated to AutoGen-5.9.8
+
+ BitKeeper/deleted/.del-COPYING.lgpl~1ddc43fbfc0a8d91@1.2 +0 -0
+ Delete: libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.lgpl~356acd7e9a658616@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.lgpl~91629dd76e5e4436@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd~506f41bf4379b14b@1.2 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYING.mbsd~c869a8655e2d3668@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYING.mbsd~dc651c8bedf8ab57@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc~31cdb1dbe002e14a@1.2 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-MakeDefs.inc~3c0055ac72058207@1.2 +0 -0
+ Delete: sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-MakeDefs.inc~eeacd10582f902ab@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~2469a6a54aac94a1@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~83bfe0c1134a9dfb@1.2 +0 -0
+ Delete: sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~92f4a0c4f9cd9ea9@1.2 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README~6c0e8c52bc2917b1@1.2 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-README~b02c8a60f4cf32fe@1.2 +0 -0
+ Delete: sntp/libopts/README
+
+ BitKeeper/deleted/.del-README~f742f7fd37644d2@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/README
+
+ BitKeeper/deleted/.del-autoopts.c~3e84323623aff6e7@1.2 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.c~9fb35908790bfaa9@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.c~b42b972a53764910@1.2 +0 -0
+ Delete: sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~5bc4082052258182@1.2 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-autoopts.h~63e256b712b3cc83@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-autoopts.h~7ed5c5ad6dbc0297@1.2 +0 -0
+ Delete: sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~131707465ccb681@1.2 +0 -0
+ Delete: sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-boolean.c~3fc4c58774ba3ff@1.2 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-boolean.c~7e6a10bd3f3866cf@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h~d62907f830867563@1.2 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-compat.h~d716e3994afa17ee@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-compat.h~ff97c2854c9b9586@1.2 +0 -0
+ Delete: sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c~b6f779d27e6c4608@1.2 +0 -0
+ Delete: libopts/configfile.c
+
+ BitKeeper/deleted/.del-configfile.c~b9949d5548dc9e7d@1.2 +0 -0
+ Delete: sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-configfile.c~bc87cafa8bb69d84@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-cook.c~23f6c5524e2fd0b9@1.2 +0 -0
+ Delete: sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-cook.c~d29aaca7ee3c2e03@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-cook.c~e72da2a3e260c2ae@1.2 +0 -0
+ Delete: libopts/cook.c
+
+ BitKeeper/deleted/.del-enumeration.c~1a1ac98e84630322@1.2 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-enumeration.c~56f8f00f64229802@1.2 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-enumeration.c~73f8914b25fdf1cb@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~3fc0f27d83271522@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-environment.c~43f215aff8170b0d@1.2 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-environment.c~654c5635a28f680a@1.2 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c~19c1b0098a7d195e@1.2 +0 -0
+ Delete: sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.c~8cec4f90c9677dad@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.c~d151b9234159786e@1.2 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~39a68cd82b716d3d@1.2 +0 -0
+ Delete: sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-genshell.h~4684aecaf31474bd@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-genshell.h~fba29f6d134cf39@1.2 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c~3fdfbf411c197e0b@1.2 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.c~d2eaf9d4d9c22da8@1.2 +0 -0
+ Delete: sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.c~e6b4ffdc895fd9c7@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~1e6c2484e7bcaa8e@1.2 +0 -0
+ Delete: sntp/libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~22764fd769234d87@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~babfee32f8439fb7@1.2 +0 -0
+ Delete: libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~5684906422d310d5@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~7f8c6092b16525fa@1.2 +0 -0
+ Delete: libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~f7c5b75baf234b93@1.2 +0 -0
+ Delete: sntp/libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-load.c~49f0fde1bda6dab1@1.2 +0 -0
+ Delete: sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-load.c~7fe0c22d7c968b7@1.2 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-load.c~e9afe1c55b052708@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c~271eaff05907e0a2@1.2 +0 -0
+ Delete: sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-makeshell.c~67d09f76ea0a6ed5@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-makeshell.c~ba6349435fd3fc83@1.2 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c~5752e76eefab7f9f@1.2 +0 -0
+ Delete: libopts/nested.c
+
+ BitKeeper/deleted/.del-nested.c~7f5db28ad8a858b9@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-nested.c~a7ab0b07538b5e49@1.2 +0 -0
+ Delete: sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c~a21fe674dc3847e2@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-numeric.c~ab97d8c3d6609e2a@1.2 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-numeric.c~e1d7cbb7cecbff8c@1.2 +0 -0
+ Delete: sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~56723cc66b175bd8@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-options.h~ce496734ff365a8f@1.2 +0 -0
+ Delete: libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-options.h~eaf98d11dd68785b@1.2 +0 -0
+ Delete: sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c~5eb7c4a7238a3334@1.2 +0 -0
+ Delete: sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pathfind.c~660d016d9d4bfaf0@1.2 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pathfind.c~ad86b5a5886760c0@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~7a129c2a1b3dc002@1.2 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-pgusage.c~8894b938253faf7a@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-pgusage.c~f3a06f0e78822dea@1.2 +0 -0
+ Delete: sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h~322bc5cfd3f14a53@1.2 +0 -0
+ Delete: libopts/proto.h
+
+ BitKeeper/deleted/.del-proto.h~600f5c521621fb7@1.2 +0 -0
+ Delete: sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-proto.h~77f289b58b0425ed@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c~454ab3a4821e880@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-putshell.c~afc504b27eed29b0@1.2 +0 -0
+ Delete: sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-putshell.c~b671799440bdb0e6@1.2 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c~11e16df450dfc6be@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-restore.c~4e87dc67454a7987@1.2 +0 -0
+ Delete: sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-restore.c~a699a151ee8b8476@1.2 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~4b1d83a0b1611d7c@1.3 +0 -0
+ Delete: sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-save.c~efa5c354e672893a@1.4 +0 -0
+ Delete: gsoc_sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-save.c~f88133d32eccbf4b@1.3 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c~147cb0d37c1e7307@1.2 +0 -0
+ Delete: sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-snprintf.c~8f0c3b04d748ef30@1.2 +0 -0
+ Delete: libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-snprintf.c~d3120f77949ff1f1@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sort.c~2a84210ffa0f5197@1.2 +0 -0
+ Delete: sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-sort.c~3d68b8c2f01ade31@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-sort.c~91f412b45a139031@1.2 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~3275408d176af9c1@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-stack.c~591385237e0f3ce2@1.2 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-stack.c~ade9ed5bb7b8fb6c@1.2 +0 -0
+ Delete: sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-strchr.c~45ec0a98e0025509@1.2 +0 -0
+ Delete: libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strchr.c~62e63feb4f1bb259@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strchr.c~ee5d954d3d137acf@1.2 +0 -0
+ Delete: sntp/libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strdup.c~516aa8c43634df59@1.2 +0 -0
+ Delete: sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-strdup.c~bf4073cb7820ac7e@1.2 +0 -0
+ Delete: libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-strdup.c~f6c99142400aadb0@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~2b8aaed8d8cbdfa@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~3a8c4c9ed2c0bb96@1.2 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~7c57f427df22897@1.2 +0 -0
+ Delete: sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c~24b4f1774aa17978@1.2 +0 -0
+ Delete: sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-text_mmap.c~73112689c5763d@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-text_mmap.c~d9d668bcff3485b5@1.2 +0 -0
+ Delete: libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-tokenize.c~4fd8a727c28d24c@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.c~a50a40638aa720cf@1.2 +0 -0
+ Delete: sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.c~fffe49aa64a78644@1.2 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h~36c2f46a3cd8cbd@1.2 +0 -0
+ Delete: sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage-txt.h~6abe748ce418395@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage-txt.h~6fa28bed13f28bc9@1.2 +0 -0
+ Delete: libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~79a0f715733bdccf@1.2 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-usage.c~e8da7f6b2f71a374@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-usage.c~eb257c90352f0b1a@1.2 +0 -0
+ Delete: sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c~45de4739ab05f47b@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/version.c
+
+ BitKeeper/deleted/.del-version.c~96adea57d42d29f6@1.2 +0 -0
+ Delete: sntp/libopts/version.c
+
+ BitKeeper/deleted/.del-version.c~f18bf6a7860ad7f7@1.2 +0 -0
+ Delete: libopts/version.c
+
+ BitKeeper/deleted/.del-windows-config.h~1665be9c16e9725d@1.2 +0 -0
+ Delete: sntp/libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-windows-config.h~c8c7442a9420d50@1.2 +0 -0
+ Delete: libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-windows-config.h~e3ddaca75ec0f439@1.3 +0 -0
+ Delete: gsoc_sntp/libopts/compat/windows-config.h
+
+ gsoc_sntp/libopts/COPYING.gplv3@1.1 +674 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/COPYING.gplv3
+
+ gsoc_sntp/libopts/COPYING.gplv3@1.0 +0 -0
+
+ gsoc_sntp/libopts/COPYING.lgplv3@1.1 +165 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/COPYING.lgplv3
+
+ gsoc_sntp/libopts/COPYING.lgplv3@1.0 +0 -0
+
+ gsoc_sntp/libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/COPYING.mbsd
+
+ gsoc_sntp/libopts/COPYING.mbsd@1.0 +0 -0
+
+ gsoc_sntp/libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/MakeDefs.inc
+
+ gsoc_sntp/libopts/MakeDefs.inc@1.0 +0 -0
+
+ gsoc_sntp/libopts/Makefile.am@1.1 +28 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/Makefile.am
+
+ gsoc_sntp/libopts/Makefile.am@1.0 +0 -0
+
+ gsoc_sntp/libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/README
+
+ gsoc_sntp/libopts/README@1.0 +0 -0
+
+ gsoc_sntp/libopts/ag-char-map.h@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/ag-char-map.h
+
+ gsoc_sntp/libopts/ag-char-map.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/autoopts.c@1.1 +1164 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts.c
+
+ gsoc_sntp/libopts/autoopts.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/autoopts.h@1.1 +364 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts.h
+
+ gsoc_sntp/libopts/autoopts.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/autoopts/options.h@1.1 +1055 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts/options.h
+
+ gsoc_sntp/libopts/autoopts/options.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.1 +393 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/autoopts/usage-txt.h
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/boolean.c@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/boolean.c
+
+ gsoc_sntp/libopts/boolean.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/compat/compat.h@1.1 +366 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/compat.h
+
+ gsoc_sntp/libopts/compat/compat.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/compat/pathfind.c@1.1 +338 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/pathfind.c
+
+ gsoc_sntp/libopts/compat/pathfind.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/snprintf.c
+
+ gsoc_sntp/libopts/compat/snprintf.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/strchr.c
+
+ gsoc_sntp/libopts/compat/strchr.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/strdup.c
+
+ gsoc_sntp/libopts/compat/strdup.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/compat/windows-config.h@1.1 +147 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/compat/windows-config.h
+
+ gsoc_sntp/libopts/compat/windows-config.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/configfile.c@1.1 +1251 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/configfile.c
+
+ gsoc_sntp/libopts/configfile.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/cook.c@1.1 +293 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/cook.c
+
+ gsoc_sntp/libopts/cook.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/enumeration.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/enumeration.c
+
+ gsoc_sntp/libopts/enumeration.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/environment.c@1.1 +240 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/environment.c
+
+ gsoc_sntp/libopts/environment.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/file.c@1.1 +169 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/file.c
+
+ gsoc_sntp/libopts/file.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/genshell.c@1.1 +358 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/genshell.c
+
+ gsoc_sntp/libopts/genshell.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/genshell.h@1.1 +165 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/genshell.h
+
+ gsoc_sntp/libopts/genshell.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/libopts.c@1.1 +38 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/libopts.c
+
+ gsoc_sntp/libopts/libopts.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/load.c@1.1 +540 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/load.c
+
+ gsoc_sntp/libopts/load.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.1 +548 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/m4/libopts.m4
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.0 +0 -0
+
+ gsoc_sntp/libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/m4/liboptschk.m4
+
+ gsoc_sntp/libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ gsoc_sntp/libopts/makeshell.c@1.1 +1099 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/makeshell.c
+
+ gsoc_sntp/libopts/makeshell.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/nested.c@1.1 +843 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/nested.c
+
+ gsoc_sntp/libopts/nested.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/numeric.c@1.1 +175 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/numeric.c
+
+ gsoc_sntp/libopts/numeric.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/parse-duration.c@1.1 +582 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/parse-duration.c
+
+ gsoc_sntp/libopts/parse-duration.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/parse-duration.h@1.1 +82 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/parse-duration.h
+
+ gsoc_sntp/libopts/parse-duration.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/pgusage.c@1.1 +140 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/pgusage.c
+
+ gsoc_sntp/libopts/pgusage.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/proto.h@1.1 +112 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/proto.h
+
+ gsoc_sntp/libopts/proto.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/putshell.c@1.1 +320 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/putshell.c
+
+ gsoc_sntp/libopts/putshell.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/reset.c@1.1 +128 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/reset.c
+
+ gsoc_sntp/libopts/reset.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/restore.c@1.1 +227 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/restore.c
+
+ gsoc_sntp/libopts/restore.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/save.c@1.1 +790 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/save.c
+
+ gsoc_sntp/libopts/save.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/sort.c@1.1 +336 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/sort.c
+
+ gsoc_sntp/libopts/sort.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/stack.c@1.1 +264 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/stack.c
+
+ gsoc_sntp/libopts/stack.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/streqvcmp.c@1.1 +266 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/streqvcmp.c
+
+ gsoc_sntp/libopts/streqvcmp.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/text_mmap.c@1.1 +383 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/text_mmap.c
+
+ gsoc_sntp/libopts/text_mmap.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/time.c@1.1 +88 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/time.c
+
+ gsoc_sntp/libopts/time.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/tokenize.c@1.1 +323 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/tokenize.c
+
+ gsoc_sntp/libopts/tokenize.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/usage.c@1.1 +756 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/usage.c
+
+ gsoc_sntp/libopts/usage.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/value-type.c@1.1 +123 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/value-type.c
+
+ gsoc_sntp/libopts/value-type.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/value-type.h@1.1 +25 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/value-type.h
+
+ gsoc_sntp/libopts/value-type.h@1.0 +0 -0
+
+ gsoc_sntp/libopts/version.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/version.c
+
+ gsoc_sntp/libopts/version.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/xat-attribute.c@1.1 +114 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/xat-attribute.c
+
+ gsoc_sntp/libopts/xat-attribute.c@1.0 +0 -0
+
+ gsoc_sntp/libopts/xat-attribute.h@1.1 +22 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/libopts/xat-attribute.h
+
+ gsoc_sntp/libopts/xat-attribute.h@1.0 +0 -0
+
+ libopts/COPYING.gplv3@1.1 +674 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.gplv3
+
+ libopts/COPYING.gplv3@1.0 +0 -0
+
+ libopts/COPYING.lgplv3@1.1 +165 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.lgplv3
+
+ libopts/COPYING.lgplv3@1.0 +0 -0
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.mbsd
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+
+ libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/MakeDefs.inc
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+
+ libopts/Makefile.am@1.1 +28 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/Makefile.am
+
+ libopts/Makefile.am@1.0 +0 -0
+
+ libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/README
+
+ libopts/README@1.0 +0 -0
+
+ libopts/ag-char-map.h@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/ag-char-map.h
+
+ libopts/ag-char-map.h@1.0 +0 -0
+
+ libopts/autoopts.c@1.1 +1164 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.c
+
+ libopts/autoopts.c@1.0 +0 -0
+
+ libopts/autoopts.h@1.1 +364 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.h
+
+ libopts/autoopts.h@1.0 +0 -0
+
+ libopts/autoopts/options.h@1.1 +1055 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/options.h
+
+ libopts/autoopts/options.h@1.0 +0 -0
+
+ libopts/autoopts/usage-txt.h@1.1 +393 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/usage-txt.h
+
+ libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ libopts/boolean.c@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/boolean.c
+
+ libopts/boolean.c@1.0 +0 -0
+
+ libopts/compat/compat.h@1.1 +366 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/compat.h
+
+ libopts/compat/compat.h@1.0 +0 -0
+
+ libopts/compat/pathfind.c@1.1 +338 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/pathfind.c
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+
+ libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/snprintf.c
+
+ libopts/compat/snprintf.c@1.0 +0 -0
+
+ libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c
+
+ libopts/compat/strchr.c@1.0 +0 -0
+
+ libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strdup.c
+
+ libopts/compat/strdup.c@1.0 +0 -0
+
+ libopts/compat/windows-config.h@1.1 +147 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h
+
+ libopts/compat/windows-config.h@1.0 +0 -0
+
+ libopts/configfile.c@1.1 +1251 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/configfile.c
+
+ libopts/configfile.c@1.0 +0 -0
+
+ libopts/cook.c@1.1 +293 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/cook.c
+
+ libopts/cook.c@1.0 +0 -0
+
+ libopts/enumeration.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/enumeration.c
+
+ libopts/enumeration.c@1.0 +0 -0
+
+ libopts/environment.c@1.1 +240 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/environment.c
+
+ libopts/environment.c@1.0 +0 -0
+
+ libopts/file.c@1.1 +169 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/file.c
+
+ libopts/file.c@1.0 +0 -0
+
+ libopts/genshell.c@1.1 +358 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.c
+
+ libopts/genshell.c@1.0 +0 -0
+
+ libopts/genshell.h@1.1 +165 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.h
+
+ libopts/genshell.h@1.0 +0 -0
+
+ libopts/libopts.c@1.1 +38 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/libopts.c
+
+ libopts/libopts.c@1.0 +0 -0
+
+ libopts/load.c@1.1 +540 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/load.c
+
+ libopts/load.c@1.0 +0 -0
+
+ libopts/m4/libopts.m4@1.1 +548 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libopts.m4
+
+ libopts/m4/libopts.m4@1.0 +0 -0
+
+ libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/liboptschk.m4
+
+ libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ libopts/makeshell.c@1.1 +1099 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/makeshell.c
+
+ libopts/makeshell.c@1.0 +0 -0
+
+ libopts/nested.c@1.1 +843 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/nested.c
+
+ libopts/nested.c@1.0 +0 -0
+
+ libopts/numeric.c@1.1 +175 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/numeric.c
+
+ libopts/numeric.c@1.0 +0 -0
+
+ libopts/parse-duration.c@1.1 +582 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/parse-duration.c
+
+ libopts/parse-duration.c@1.0 +0 -0
+
+ libopts/parse-duration.h@1.1 +82 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/parse-duration.h
+
+ libopts/parse-duration.h@1.0 +0 -0
+
+ libopts/pgusage.c@1.1 +140 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/pgusage.c
+
+ libopts/pgusage.c@1.0 +0 -0
+
+ libopts/proto.h@1.1 +112 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/proto.h
+
+ libopts/proto.h@1.0 +0 -0
+
+ libopts/putshell.c@1.1 +320 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/putshell.c
+
+ libopts/putshell.c@1.0 +0 -0
+
+ libopts/reset.c@1.1 +128 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/reset.c
+
+ libopts/reset.c@1.0 +0 -0
+
+ libopts/restore.c@1.1 +227 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/restore.c
+
+ libopts/restore.c@1.0 +0 -0
+
+ libopts/save.c@1.1 +790 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/save.c
+
+ libopts/save.c@1.0 +0 -0
+
+ libopts/sort.c@1.1 +336 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/sort.c
+
+ libopts/sort.c@1.0 +0 -0
+
+ libopts/stack.c@1.1 +264 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/stack.c
+
+ libopts/stack.c@1.0 +0 -0
+
+ libopts/streqvcmp.c@1.1 +266 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/streqvcmp.c
+
+ libopts/streqvcmp.c@1.0 +0 -0
+
+ libopts/text_mmap.c@1.1 +383 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/text_mmap.c
+
+ libopts/text_mmap.c@1.0 +0 -0
+
+ libopts/time.c@1.1 +88 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/time.c
+
+ libopts/time.c@1.0 +0 -0
+
+ libopts/tokenize.c@1.1 +323 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/tokenize.c
+
+ libopts/tokenize.c@1.0 +0 -0
+
+ libopts/usage.c@1.1 +756 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/usage.c
+
+ libopts/usage.c@1.0 +0 -0
+
+ libopts/value-type.c@1.1 +123 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/value-type.c
+
+ libopts/value-type.c@1.0 +0 -0
+
+ libopts/value-type.h@1.1 +25 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/value-type.h
+
+ libopts/value-type.h@1.0 +0 -0
+
+ libopts/version.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/version.c
+
+ libopts/version.c@1.0 +0 -0
+
+ libopts/xat-attribute.c@1.1 +114 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/xat-attribute.c
+
+ libopts/xat-attribute.c@1.0 +0 -0
+
+ libopts/xat-attribute.h@1.1 +22 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/xat-attribute.h
+
+ libopts/xat-attribute.h@1.0 +0 -0
+
+ sntp/libopts/COPYING.gplv3@1.1 +674 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.gplv3
+
+ sntp/libopts/COPYING.gplv3@1.0 +0 -0
+
+ sntp/libopts/COPYING.lgplv3@1.1 +165 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.lgplv3
+
+ sntp/libopts/COPYING.lgplv3@1.0 +0 -0
+
+ sntp/libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/COPYING.mbsd@1.0 +0 -0
+
+ sntp/libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/MakeDefs.inc@1.0 +0 -0
+
+ sntp/libopts/Makefile.am@1.1 +28 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/Makefile.am
+
+ sntp/libopts/Makefile.am@1.0 +0 -0
+
+ sntp/libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/README
+
+ sntp/libopts/README@1.0 +0 -0
+
+ sntp/libopts/ag-char-map.h@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/ag-char-map.h
+
+ sntp/libopts/ag-char-map.h@1.0 +0 -0
+
+ sntp/libopts/autoopts.c@1.1 +1164 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.c@1.0 +0 -0
+
+ sntp/libopts/autoopts.h@1.1 +364 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/options.h@1.1 +1055 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/options.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.1 +393 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ sntp/libopts/boolean.c@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/boolean.c
+
+ sntp/libopts/boolean.c@1.0 +0 -0
+
+ sntp/libopts/compat/compat.h@1.1 +366 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/compat.h@1.0 +0 -0
+
+ sntp/libopts/compat/pathfind.c@1.1 +338 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/compat/pathfind.c@1.0 +0 -0
+
+ sntp/libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/snprintf.c@1.0 +0 -0
+
+ sntp/libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c
+
+ sntp/libopts/compat/strchr.c@1.0 +0 -0
+
+ sntp/libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strdup.c
+
+ sntp/libopts/compat/strdup.c@1.0 +0 -0
+
+ sntp/libopts/compat/windows-config.h@1.1 +147 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h
+
+ sntp/libopts/compat/windows-config.h@1.0 +0 -0
+
+ sntp/libopts/configfile.c@1.1 +1251 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/configfile.c
+
+ sntp/libopts/configfile.c@1.0 +0 -0
+
+ sntp/libopts/cook.c@1.1 +293 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/cook.c
+
+ sntp/libopts/cook.c@1.0 +0 -0
+
+ sntp/libopts/enumeration.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/enumeration.c
+
+ sntp/libopts/enumeration.c@1.0 +0 -0
+
+ sntp/libopts/environment.c@1.1 +240 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/environment.c
+
+ sntp/libopts/environment.c@1.0 +0 -0
+
+ sntp/libopts/file.c@1.1 +169 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/file.c
+
+ sntp/libopts/file.c@1.0 +0 -0
+
+ sntp/libopts/genshell.c@1.1 +358 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.c@1.0 +0 -0
+
+ sntp/libopts/genshell.h@1.1 +165 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.h
+
+ sntp/libopts/genshell.h@1.0 +0 -0
+
+ sntp/libopts/libopts.c@1.1 +38 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/libopts.c
+
+ sntp/libopts/libopts.c@1.0 +0 -0
+
+ sntp/libopts/load.c@1.1 +540 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/load.c
+
+ sntp/libopts/load.c@1.0 +0 -0
+
+ sntp/libopts/m4/libopts.m4@1.1 +548 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libopts.m4
+
+ sntp/libopts/m4/libopts.m4@1.0 +0 -0
+
+ sntp/libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/liboptschk.m4
+
+ sntp/libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ sntp/libopts/makeshell.c@1.1 +1099 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/makeshell.c
+
+ sntp/libopts/makeshell.c@1.0 +0 -0
+
+ sntp/libopts/nested.c@1.1 +843 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/nested.c
+
+ sntp/libopts/nested.c@1.0 +0 -0
+
+ sntp/libopts/numeric.c@1.1 +175 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/numeric.c
+
+ sntp/libopts/numeric.c@1.0 +0 -0
+
+ sntp/libopts/parse-duration.c@1.1 +582 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/parse-duration.c
+
+ sntp/libopts/parse-duration.c@1.0 +0 -0
+
+ sntp/libopts/parse-duration.h@1.1 +82 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/parse-duration.h
+
+ sntp/libopts/parse-duration.h@1.0 +0 -0
+
+ sntp/libopts/pgusage.c@1.1 +140 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/pgusage.c
+
+ sntp/libopts/pgusage.c@1.0 +0 -0
+
+ sntp/libopts/proto.h@1.1 +112 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/proto.h
+
+ sntp/libopts/proto.h@1.0 +0 -0
+
+ sntp/libopts/putshell.c@1.1 +320 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/putshell.c
+
+ sntp/libopts/putshell.c@1.0 +0 -0
+
+ sntp/libopts/reset.c@1.1 +128 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/reset.c
+
+ sntp/libopts/reset.c@1.0 +0 -0
+
+ sntp/libopts/restore.c@1.1 +227 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/restore.c
+
+ sntp/libopts/restore.c@1.0 +0 -0
+
+ sntp/libopts/save.c@1.1 +790 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/save.c
+
+ sntp/libopts/save.c@1.0 +0 -0
+
+ sntp/libopts/sort.c@1.1 +336 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/sort.c
+
+ sntp/libopts/sort.c@1.0 +0 -0
+
+ sntp/libopts/stack.c@1.1 +264 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/stack.c
+
+ sntp/libopts/stack.c@1.0 +0 -0
+
+ sntp/libopts/streqvcmp.c@1.1 +266 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/streqvcmp.c
+
+ sntp/libopts/streqvcmp.c@1.0 +0 -0
+
+ sntp/libopts/text_mmap.c@1.1 +383 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/text_mmap.c
+
+ sntp/libopts/text_mmap.c@1.0 +0 -0
+
+ sntp/libopts/time.c@1.1 +88 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/time.c
+
+ sntp/libopts/time.c@1.0 +0 -0
+
+ sntp/libopts/tokenize.c@1.1 +323 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/tokenize.c
+
+ sntp/libopts/tokenize.c@1.0 +0 -0
+
+ sntp/libopts/usage.c@1.1 +756 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/usage.c
+
+ sntp/libopts/usage.c@1.0 +0 -0
+
+ sntp/libopts/value-type.c@1.1 +123 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/value-type.c
+
+ sntp/libopts/value-type.c@1.0 +0 -0
+
+ sntp/libopts/value-type.h@1.1 +25 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/value-type.h
+
+ sntp/libopts/value-type.h@1.0 +0 -0
+
+ sntp/libopts/version.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/version.c
+
+ sntp/libopts/version.c@1.0 +0 -0
+
+ sntp/libopts/xat-attribute.c@1.1 +114 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/xat-attribute.c
+
+ sntp/libopts/xat-attribute.c@1.0 +0 -0
+
+ sntp/libopts/xat-attribute.h@1.1 +22 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/xat-attribute.h
+
+ sntp/libopts/xat-attribute.h@1.0 +0 -0
+
+ChangeSet@1.1914, 2009-07-20 00:18:45-04:00, stenn@whimsy.udel.edu
+ [Bug 1248] RES_MSSNTP typo in ntp_proto.c
+
+ ChangeLog@1.374 +1 -0
+ [Bug 1248] RES_MSSNTP typo in ntp_proto.c
+
+ ntpd/ntp_proto.c@1.292 +1 -1
+ [Bug 1248] RES_MSSNTP typo in ntp_proto.c
+
+ChangeSet@1.1913, 2009-07-19 22:02:21-04:00, stenn@pogo.udel.edu
+ distribute ntp_lists.h
+
+ include/Makefile.am@1.34 +1 -0
+ distribute ntp_lists.h
+
+ChangeSet@1.1910.1.1, 2009-07-20 00:11:58+00:00, davehart@shiny.ad.hartbrothers.com
+ Log warning about signd operations blocking ntpd when mssntp restrict keyword seen
+
+ ChangeLog@1.371.1.1 +1 -0
+ Log warning about signd operations blocking ntpd when mssntp restrict keyword seen
+
+ ntpd/ntp_config.c@1.198 +13 -0
+ Log warning about signd operations blocking ntpd when mssntp restrict keyword seen
+
+ChangeSet@1.1901.4.1, 2009-07-16 16:23:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1246] use a common template for singly-linked lists, convert most
+ doubly-linked lists to singly-linked.
+
+ ChangeLog@1.362.4.1 +2 -0
+ [Bug 1246] use a common template for singly-linked lists, convert most
+ doubly-linked lists to singly-linked.
+
+ include/ntp.h@1.159.1.1 +24 -25
+ use singly-linked lists instead of ISC's doubly-linked
+
+ include/ntp_io.h@1.10 +3 -5
+ remove no-longer-needed doubly-linked list initialization routines
+
+ include/ntp_lists.h@1.1 +104 -0
+ singly-linked list template macros
+
+ include/ntp_lists.h@1.0 +0 -0
+
+ include/recvbuff.h@1.19 +5 -6
+ use singly-linked list for free_recv_buff
+
+ libntp/recvbuff.c@1.33 +29 -42
+ use singly-linked list for free_recv_buff
+
+ ntpd/ntp_io.c@1.289.2.1 +128 -203
+ use singly-linked lists instead of ISC's doubly-linked
+
+ ntpd/ntp_peer.c@1.121 +51 -72
+ use new common singly-linked list template macros for
+ peer_hash and assoc_hash
+
+ ntpd/ntpd.c@1.105 +1 -5
+ remove no-longer-needed doubly-linked list initialization routines
+
+ ports/winnt/libntp/libntp.dsp@1.35 +4 -0
+ add include/ntp_lists.h reference
+
+ ports/winnt/libntp/libntp.vcproj@1.9 +4 -0
+ add include/ntp_lists.h reference
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.44.1.1 +20 -13
+ use singly-linked list for compl_info_list
+
+ ports/winnt/ntpd/ntpd.vcproj@1.10 +5 -0
+ add include/ntp_lists.h reference
+
+ChangeSet@1.1910, 2009-07-16 07:54:10-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P189
+ TAG: NTP_4_2_5P189
+
+ ChangeLog@1.371 +1 -0
+ NTP_4_2_5P189
+
+ gsoc_sntp/sntp-opts.c@1.50 +2 -2
+ NTP_4_2_5P189
+
+ gsoc_sntp/sntp-opts.h@1.50 +3 -3
+ NTP_4_2_5P189
+
+ gsoc_sntp/sntp-opts.texi@1.50 +1 -1
+ NTP_4_2_5P189
+
+ gsoc_sntp/sntp.1@1.50 +2 -2
+ NTP_4_2_5P189
+
+ ntpd/ntpd-opts.c@1.182 +2 -2
+ NTP_4_2_5P189
+
+ ntpd/ntpd-opts.h@1.182 +3 -3
+ NTP_4_2_5P189
+
+ ntpd/ntpd-opts.texi@1.180 +1 -1
+ NTP_4_2_5P189
+
+ ntpd/ntpd.1@1.180 +2 -2
+ NTP_4_2_5P189
+
+ ntpdc/ntpdc-opts.c@1.177 +2 -2
+ NTP_4_2_5P189
+
+ ntpdc/ntpdc-opts.h@1.177 +3 -3
+ NTP_4_2_5P189
+
+ ntpdc/ntpdc-opts.texi@1.176 +1 -1
+ NTP_4_2_5P189
+
+ ntpdc/ntpdc.1@1.176 +2 -2
+ NTP_4_2_5P189
+
+ ntpq/ntpq-opts.c@1.177 +2 -2
+ NTP_4_2_5P189
+
+ ntpq/ntpq-opts.h@1.177 +3 -3
+ NTP_4_2_5P189
+
+ ntpq/ntpq-opts.texi@1.176 +1 -1
+ NTP_4_2_5P189
+
+ ntpq/ntpq.1@1.176 +2 -2
+ NTP_4_2_5P189
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.58 +2 -2
+ NTP_4_2_5P189
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.58 +3 -3
+ NTP_4_2_5P189
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.58 +1 -1
+ NTP_4_2_5P189
+
+ ntpsnmpd/ntpsnmpd.1@1.58 +2 -2
+ NTP_4_2_5P189
+
+ packageinfo.sh@1.192 +1 -1
+ NTP_4_2_5P189
+
+ sntp/sntp-opts.c@1.177 +2 -2
+ NTP_4_2_5P189
+
+ sntp/sntp-opts.h@1.177 +3 -3
+ NTP_4_2_5P189
+
+ sntp/sntp-opts.texi@1.176 +1 -1
+ NTP_4_2_5P189
+
+ sntp/sntp.1@1.176 +2 -2
+ NTP_4_2_5P189
+
+ util/ntp-keygen-opts.c@1.180 +2 -2
+ NTP_4_2_5P189
+
+ util/ntp-keygen-opts.h@1.180 +3 -3
+ NTP_4_2_5P189
+
+ util/ntp-keygen-opts.texi@1.179 +1 -1
+ NTP_4_2_5P189
+
+ util/ntp-keygen.1@1.179 +2 -2
+ NTP_4_2_5P189
+
+ChangeSet@1.1909, 2009-07-15 16:51:50-04:00, stenn@whimsy.udel.edu
+ Documentation cleanup from Dave Mills
+
+ ChangeLog@1.370 +1 -0
+ Documentation cleanup from Dave Mills
+
+ html/accopt.html@1.30 +99 -28
+ Documentation cleanup from Dave Mills
+
+ html/assoc.html@1.28 +10 -1
+ Documentation cleanup from Dave Mills
+
+ html/audio.html@1.21 +29 -4
+ Documentation cleanup from Dave Mills
+
+ html/authopt.html@1.50 +18 -2
+ Documentation cleanup from Dave Mills
+
+ html/bugs.html@1.5 +4 -1
+ Documentation cleanup from Dave Mills
+
+ html/config.html@1.23 +1 -1
+ Documentation cleanup from Dave Mills
+
+ html/confopt.html@1.45 +15 -13
+ Documentation cleanup from Dave Mills
+
+ html/debug.html@1.26 +29 -5
+ Documentation cleanup from Dave Mills
+
+ html/decode.html@1.10 +9 -5
+ Documentation cleanup from Dave Mills
+
+ html/extern.html@1.15 +21 -4
+ Documentation cleanup from Dave Mills
+
+ html/gadget.html@1.4 +9 -1
+ Documentation cleanup from Dave Mills
+
+ html/howto.html@1.22 +19 -4
+ Documentation cleanup from Dave Mills
+
+ html/index.html@1.40 +7 -2
+ Documentation cleanup from Dave Mills
+
+ html/manyopt.html@1.19 +5 -1
+ Documentation cleanup from Dave Mills
+
+ChangeSet@1.1908, 2009-07-15 07:52:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P188
+ TAG: NTP_4_2_5P188
+
+ ChangeLog@1.369 +1 -0
+ NTP_4_2_5P188
+
+ gsoc_sntp/sntp-opts.c@1.49 +2 -2
+ NTP_4_2_5P188
+
+ gsoc_sntp/sntp-opts.h@1.49 +3 -3
+ NTP_4_2_5P188
+
+ gsoc_sntp/sntp-opts.texi@1.49 +1 -1
+ NTP_4_2_5P188
+
+ gsoc_sntp/sntp.1@1.49 +2 -2
+ NTP_4_2_5P188
+
+ ntpd/ntpd-opts.c@1.181 +2 -2
+ NTP_4_2_5P188
+
+ ntpd/ntpd-opts.h@1.181 +3 -3
+ NTP_4_2_5P188
+
+ ntpd/ntpd-opts.texi@1.179 +2 -2
+ NTP_4_2_5P188
+
+ ntpd/ntpd.1@1.179 +2 -2
+ NTP_4_2_5P188
+
+ ntpdc/ntpdc-opts.c@1.176 +2 -2
+ NTP_4_2_5P188
+
+ ntpdc/ntpdc-opts.h@1.176 +3 -3
+ NTP_4_2_5P188
+
+ ntpdc/ntpdc-opts.texi@1.175 +2 -2
+ NTP_4_2_5P188
+
+ ntpdc/ntpdc.1@1.175 +2 -2
+ NTP_4_2_5P188
+
+ ntpq/ntpq-opts.c@1.176 +2 -2
+ NTP_4_2_5P188
+
+ ntpq/ntpq-opts.h@1.176 +3 -3
+ NTP_4_2_5P188
+
+ ntpq/ntpq-opts.texi@1.175 +2 -2
+ NTP_4_2_5P188
+
+ ntpq/ntpq.1@1.175 +2 -2
+ NTP_4_2_5P188
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.57 +2 -2
+ NTP_4_2_5P188
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.57 +3 -3
+ NTP_4_2_5P188
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.57 +1 -1
+ NTP_4_2_5P188
+
+ ntpsnmpd/ntpsnmpd.1@1.57 +2 -2
+ NTP_4_2_5P188
+
+ packageinfo.sh@1.191 +1 -1
+ NTP_4_2_5P188
+
+ sntp/sntp-opts.c@1.176 +2 -2
+ NTP_4_2_5P188
+
+ sntp/sntp-opts.h@1.176 +3 -3
+ NTP_4_2_5P188
+
+ sntp/sntp-opts.texi@1.175 +1 -1
+ NTP_4_2_5P188
+
+ sntp/sntp.1@1.175 +2 -2
+ NTP_4_2_5P188
+
+ util/ntp-keygen-opts.c@1.179 +2 -2
+ NTP_4_2_5P188
+
+ util/ntp-keygen-opts.h@1.179 +3 -3
+ NTP_4_2_5P188
+
+ util/ntp-keygen-opts.texi@1.178 +2 -2
+ NTP_4_2_5P188
+
+ util/ntp-keygen.1@1.178 +2 -2
+ NTP_4_2_5P188
+
+ChangeSet@1.1907, 2009-07-15 00:35:46-04:00, stenn@whimsy.udel.edu
+ [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187
+
+ ChangeLog@1.368 +1 -0
+ [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187
+
+ ntpd/ntp_proto.c@1.291 +1 -2
+ [Bug 1245] Broken xmt time sent in fast_xmit() of 4.2.5p187
+
+ChangeSet@1.1906, 2009-07-11 07:57:23-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P187
+ TAG: NTP_4_2_5P187
+
+ ChangeLog@1.367 +1 -0
+ NTP_4_2_5P187
+
+ gsoc_sntp/sntp-opts.c@1.48 +2 -2
+ NTP_4_2_5P187
+
+ gsoc_sntp/sntp-opts.h@1.48 +3 -3
+ NTP_4_2_5P187
+
+ gsoc_sntp/sntp-opts.texi@1.48 +1 -1
+ NTP_4_2_5P187
+
+ gsoc_sntp/sntp.1@1.48 +2 -2
+ NTP_4_2_5P187
+
+ ntpd/ntpd-opts.c@1.180 +2 -2
+ NTP_4_2_5P187
+
+ ntpd/ntpd-opts.h@1.180 +3 -3
+ NTP_4_2_5P187
+
+ ntpd/ntpd-opts.texi@1.178 +1 -1
+ NTP_4_2_5P187
+
+ ntpd/ntpd.1@1.178 +2 -2
+ NTP_4_2_5P187
+
+ ntpdc/ntpdc-opts.c@1.175 +2 -2
+ NTP_4_2_5P187
+
+ ntpdc/ntpdc-opts.h@1.175 +3 -3
+ NTP_4_2_5P187
+
+ ntpdc/ntpdc-opts.texi@1.174 +1 -1
+ NTP_4_2_5P187
+
+ ntpdc/ntpdc.1@1.174 +2 -2
+ NTP_4_2_5P187
+
+ ntpq/ntpq-opts.c@1.175 +2 -2
+ NTP_4_2_5P187
+
+ ntpq/ntpq-opts.h@1.175 +3 -3
+ NTP_4_2_5P187
+
+ ntpq/ntpq-opts.texi@1.174 +1 -1
+ NTP_4_2_5P187
+
+ ntpq/ntpq.1@1.174 +2 -2
+ NTP_4_2_5P187
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.56 +2 -2
+ NTP_4_2_5P187
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.56 +3 -3
+ NTP_4_2_5P187
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.56 +1 -1
+ NTP_4_2_5P187
+
+ ntpsnmpd/ntpsnmpd.1@1.56 +2 -2
+ NTP_4_2_5P187
+
+ packageinfo.sh@1.190 +1 -1
+ NTP_4_2_5P187
+
+ sntp/sntp-opts.c@1.175 +2 -2
+ NTP_4_2_5P187
+
+ sntp/sntp-opts.h@1.175 +3 -3
+ NTP_4_2_5P187
+
+ sntp/sntp-opts.texi@1.174 +1 -1
+ NTP_4_2_5P187
+
+ sntp/sntp.1@1.174 +2 -2
+ NTP_4_2_5P187
+
+ util/ntp-keygen-opts.c@1.178 +2 -2
+ NTP_4_2_5P187
+
+ util/ntp-keygen-opts.h@1.178 +3 -3
+ NTP_4_2_5P187
+
+ util/ntp-keygen-opts.texi@1.177 +1 -1
+ NTP_4_2_5P187
+
+ util/ntp-keygen.1@1.177 +2 -2
+ NTP_4_2_5P187
+
+ChangeSet@1.1901.2.2, 2009-07-11 01:48:52-04:00, stenn@whimsy.udel.edu
+ [Bug 1242] Remove --enable-wintime
+
+ configure.ac@1.447 +0 -25
+ [Bug 1242] Remove --enable-wintime
+
+ChangeSet@1.1901.3.1, 2009-07-11 05:47:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1237] Windows serial code treat CR and LF both as line
+ terminators.
+ [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver.
+ document fudge time1 as PPS offset, fudge time2 as serial timecode offset
+ for driver20.html (NMEA)
+
+ ChangeLog@1.362.3.1 +5 -1
+ [Bug 1237] Windows serial code treat CR and LF both as line
+ terminators.
+ [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver.
+
+ html/drivers/driver20.html@1.20 +2 -2
+ Document fudge time2 as serial-only offset, time1 as PPS-only
+
+ ntpd/refclock_nmea.c@1.41 +14 -2
+ [Bug 1238] use fudge time2 for serial timecode offset in NMEA driver.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.45 +22 -2
+ [Bug 1237] Windows serial code treat CR and LF both as line terminators.
+
+ChangeSet@1.1901.2.1, 2009-07-11 01:37:42-04:00, stenn@whimsy.udel.edu
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ ChangeLog@1.362.2.1 +3 -0
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ html/accopt.html@1.29 +13 -12
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ include/ntp.h@1.160 +15 -16
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ ntpd/ntp_config.c@1.197 +1 -0
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ ntpd/ntp_parser.c@1.39 +897 -887
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ ntpd/ntp_parser.h@1.23 +203 -201
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ ntpd/ntp_parser.y@1.34 +2 -0
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ ntpd/ntp_proto.c@1.290 +35 -39
+ Added restrict keyword "mssntp" for Samba4 DC operation, by Dave Mills
+
+ChangeSet@1.1901.1.3, 2009-07-11 04:41:58+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child
+
+ ChangeLog@1.362.1.3 +1 -0
+ [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child
+
+ include/ntpd.h@1.129 +3 -1
+ conditionalize kill_asyncio(), not used on Windows
+
+ ntpd/ntp_io.c@1.289.1.1 +13 -0
+ [Bug 1244] NTP_INSIST(fd != maxactivefd) failure in intres child
+
+ChangeSet@1.1901.1.2, 2009-07-08 07:53:10-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P186
+ TAG: NTP_4_2_5P186
+
+ ChangeLog@1.362.1.2 +1 -0
+ NTP_4_2_5P186
+
+ gsoc_sntp/sntp-opts.c@1.47 +2 -2
+ NTP_4_2_5P186
+
+ gsoc_sntp/sntp-opts.h@1.47 +3 -3
+ NTP_4_2_5P186
+
+ gsoc_sntp/sntp-opts.texi@1.47 +1 -1
+ NTP_4_2_5P186
+
+ gsoc_sntp/sntp.1@1.47 +2 -2
+ NTP_4_2_5P186
+
+ ntpd/ntpd-opts.c@1.179 +2 -2
+ NTP_4_2_5P186
+
+ ntpd/ntpd-opts.h@1.179 +3 -3
+ NTP_4_2_5P186
+
+ ntpd/ntpd-opts.texi@1.177 +1 -1
+ NTP_4_2_5P186
+
+ ntpd/ntpd.1@1.177 +2 -2
+ NTP_4_2_5P186
+
+ ntpdc/ntpdc-opts.c@1.174 +2 -2
+ NTP_4_2_5P186
+
+ ntpdc/ntpdc-opts.h@1.174 +3 -3
+ NTP_4_2_5P186
+
+ ntpdc/ntpdc-opts.texi@1.173 +1 -1
+ NTP_4_2_5P186
+
+ ntpdc/ntpdc.1@1.173 +2 -2
+ NTP_4_2_5P186
+
+ ntpq/ntpq-opts.c@1.174 +2 -2
+ NTP_4_2_5P186
+
+ ntpq/ntpq-opts.h@1.174 +3 -3
+ NTP_4_2_5P186
+
+ ntpq/ntpq-opts.texi@1.173 +1 -1
+ NTP_4_2_5P186
+
+ ntpq/ntpq.1@1.173 +2 -2
+ NTP_4_2_5P186
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.55 +2 -2
+ NTP_4_2_5P186
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.55 +3 -3
+ NTP_4_2_5P186
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.55 +1 -1
+ NTP_4_2_5P186
+
+ ntpsnmpd/ntpsnmpd.1@1.55 +2 -2
+ NTP_4_2_5P186
+
+ packageinfo.sh@1.189 +1 -1
+ NTP_4_2_5P186
+
+ sntp/sntp-opts.c@1.174 +2 -2
+ NTP_4_2_5P186
+
+ sntp/sntp-opts.h@1.174 +3 -3
+ NTP_4_2_5P186
+
+ sntp/sntp-opts.texi@1.173 +1 -1
+ NTP_4_2_5P186
+
+ sntp/sntp.1@1.173 +2 -2
+ NTP_4_2_5P186
+
+ util/ntp-keygen-opts.c@1.177 +2 -2
+ NTP_4_2_5P186
+
+ util/ntp-keygen-opts.h@1.177 +3 -3
+ NTP_4_2_5P186
+
+ util/ntp-keygen-opts.texi@1.176 +1 -1
+ NTP_4_2_5P186
+
+ util/ntp-keygen.1@1.176 +2 -2
+ NTP_4_2_5P186
+
+ChangeSet@1.1901.1.1, 2009-07-08 02:47:48-04:00, stenn@whimsy.udel.edu
+ ntp_proto.c cleanup from Dave Mills
+
+ ChangeLog@1.362.1.1 +1 -0
+ ntp_proto.c cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.289 +19 -30
+ cleanup from Dave Mills
+
+ChangeSet@1.1889.2.1, 2009-07-03 03:26:28+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ [Bug 1042] multicast listeners IPv4+6 ignore new interfaces
+ ntp_io.c:
+ [Bug 1042] multicast listeners IPv4+6 ignore new interfaces
+ more detailed DPRINTFs
+
+ ChangeLog@1.351.2.1 +1 -0
+ [Bug 1042] multicast listeners IPv4+6 ignore new interfaces
+
+ ntpd/ntp_io.c@1.288.1.1 +10 -3
+ [Bug 1042] multicast listeners IPv4+6 ignore new interfaces
+ more detailed DPRINTFs
+
+ChangeSet@1.1901, 2009-07-01 07:53:52-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P185
+ TAG: NTP_4_2_5P185
+
+ ChangeLog@1.362 +1 -0
+ NTP_4_2_5P185
+
+ gsoc_sntp/sntp-opts.c@1.46 +2 -2
+ NTP_4_2_5P185
+
+ gsoc_sntp/sntp-opts.h@1.46 +3 -3
+ NTP_4_2_5P185
+
+ gsoc_sntp/sntp-opts.texi@1.46 +1 -1
+ NTP_4_2_5P185
+
+ gsoc_sntp/sntp.1@1.46 +2 -2
+ NTP_4_2_5P185
+
+ ntpd/ntpd-opts.c@1.178 +2 -2
+ NTP_4_2_5P185
+
+ ntpd/ntpd-opts.h@1.178 +3 -3
+ NTP_4_2_5P185
+
+ ntpd/ntpd-opts.texi@1.176 +1 -1
+ NTP_4_2_5P185
+
+ ntpd/ntpd.1@1.176 +2 -2
+ NTP_4_2_5P185
+
+ ntpdc/ntpdc-opts.c@1.173 +2 -2
+ NTP_4_2_5P185
+
+ ntpdc/ntpdc-opts.h@1.173 +3 -3
+ NTP_4_2_5P185
+
+ ntpdc/ntpdc-opts.texi@1.172 +1 -1
+ NTP_4_2_5P185
+
+ ntpdc/ntpdc.1@1.172 +2 -2
+ NTP_4_2_5P185
+
+ ntpq/ntpq-opts.c@1.173 +2 -2
+ NTP_4_2_5P185
+
+ ntpq/ntpq-opts.h@1.173 +3 -3
+ NTP_4_2_5P185
+
+ ntpq/ntpq-opts.texi@1.172 +1 -1
+ NTP_4_2_5P185
+
+ ntpq/ntpq.1@1.172 +2 -2
+ NTP_4_2_5P185
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.54 +2 -2
+ NTP_4_2_5P185
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.54 +3 -3
+ NTP_4_2_5P185
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.54 +1 -1
+ NTP_4_2_5P185
+
+ ntpsnmpd/ntpsnmpd.1@1.54 +2 -2
+ NTP_4_2_5P185
+
+ packageinfo.sh@1.188 +1 -1
+ NTP_4_2_5P185
+
+ sntp/sntp-opts.c@1.173 +2 -2
+ NTP_4_2_5P185
+
+ sntp/sntp-opts.h@1.173 +3 -3
+ NTP_4_2_5P185
+
+ sntp/sntp-opts.texi@1.172 +1 -1
+ NTP_4_2_5P185
+
+ sntp/sntp.1@1.172 +2 -2
+ NTP_4_2_5P185
+
+ util/ntp-keygen-opts.c@1.176 +2 -2
+ NTP_4_2_5P185
+
+ util/ntp-keygen-opts.h@1.176 +3 -3
+ NTP_4_2_5P185
+
+ util/ntp-keygen-opts.texi@1.175 +1 -1
+ NTP_4_2_5P185
+
+ util/ntp-keygen.1@1.175 +2 -2
+ NTP_4_2_5P185
+
+ChangeSet@1.1900, 2009-07-01 03:06:34-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.361 +2 -1
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.43 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.49 +2 -2
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.22 +134 -31
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1898, 2009-06-30 14:46:05-04:00, clemens@pogo.udel.edu
+ Fix order of declarations.
+
+ ntpd/refclock_oncore.c@1.77 +1 -2
+
+ChangeSet@1.1895.1.2, 2009-06-30 07:59:26+00:00, davehart@shiny.ad.hartbrothers.com
+ driver20.html:
+ note fudge flag1 now enables/disables (default) PPSAPI support
+ make bitrate setting values more obvious to those not fluent in binary shifting
+ ChangeLog:
+ punctuation
+
+ ChangeLog@1.359 +1 -1
+ punctuation
+
+ html/drivers/driver20.html@1.19 +6 -6
+ note fudge flag1 now enables/disables (default) PPSAPI support
+ make bitrate setting values more obvious to those not fluent in binary shifting
+
+ChangeSet@1.1897, 2009-06-30 03:41:23-04:00, stenn@pogo.udel.edu
+ typos
+
+ ChangeLog@1.357.1.2 +2 -2
+ typos
+
+ ChangeLog@1.357.1.1, clemens@pogo.udel.edu +3 -0
+ Declaration order fixed.
+
+ChangeSet@1.1896, 2009-06-25 02:13:57-04:00, clemens@pogo.udel.edu
+ ChangeLog additon, ONCORE use of #if 0 where it used #ifdef DEBUG
+
+ ntpd/refclock_oncore.c@1.76 +14 -22
+ No BUG[]. NTP now uses the DEBUG preprocessor variable. I have now bracketed
+ private debug statements with #if 0 rather than #ifdef DEBUG
+
+ChangeSet@1.1895, 2009-06-24 07:52:37-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P184
+ TAG: NTP_4_2_5P184
+
+ ChangeLog@1.357 +1 -0
+ NTP_4_2_5P184
+
+ gsoc_sntp/sntp-opts.c@1.45 +2 -2
+ NTP_4_2_5P184
+
+ gsoc_sntp/sntp-opts.h@1.45 +3 -3
+ NTP_4_2_5P184
+
+ gsoc_sntp/sntp-opts.texi@1.45 +1 -1
+ NTP_4_2_5P184
+
+ gsoc_sntp/sntp.1@1.45 +2 -2
+ NTP_4_2_5P184
+
+ ntpd/ntpd-opts.c@1.177 +2 -2
+ NTP_4_2_5P184
+
+ ntpd/ntpd-opts.h@1.177 +3 -3
+ NTP_4_2_5P184
+
+ ntpd/ntpd-opts.texi@1.175 +1 -1
+ NTP_4_2_5P184
+
+ ntpd/ntpd.1@1.175 +2 -2
+ NTP_4_2_5P184
+
+ ntpdc/ntpdc-opts.c@1.172 +2 -2
+ NTP_4_2_5P184
+
+ ntpdc/ntpdc-opts.h@1.172 +3 -3
+ NTP_4_2_5P184
+
+ ntpdc/ntpdc-opts.texi@1.171 +1 -1
+ NTP_4_2_5P184
+
+ ntpdc/ntpdc.1@1.171 +2 -2
+ NTP_4_2_5P184
+
+ ntpq/ntpq-opts.c@1.172 +2 -2
+ NTP_4_2_5P184
+
+ ntpq/ntpq-opts.h@1.172 +3 -3
+ NTP_4_2_5P184
+
+ ntpq/ntpq-opts.texi@1.171 +1 -1
+ NTP_4_2_5P184
+
+ ntpq/ntpq.1@1.171 +2 -2
+ NTP_4_2_5P184
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.53 +2 -2
+ NTP_4_2_5P184
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.53 +3 -3
+ NTP_4_2_5P184
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.53 +1 -1
+ NTP_4_2_5P184
+
+ ntpsnmpd/ntpsnmpd.1@1.53 +2 -2
+ NTP_4_2_5P184
+
+ packageinfo.sh@1.187 +1 -1
+ NTP_4_2_5P184
+
+ sntp/sntp-opts.c@1.172 +2 -2
+ NTP_4_2_5P184
+
+ sntp/sntp-opts.h@1.172 +3 -3
+ NTP_4_2_5P184
+
+ sntp/sntp-opts.texi@1.171 +1 -1
+ NTP_4_2_5P184
+
+ sntp/sntp.1@1.171 +2 -2
+ NTP_4_2_5P184
+
+ util/ntp-keygen-opts.c@1.175 +2 -2
+ NTP_4_2_5P184
+
+ util/ntp-keygen-opts.h@1.175 +3 -3
+ NTP_4_2_5P184
+
+ util/ntp-keygen-opts.texi@1.174 +1 -1
+ NTP_4_2_5P184
+
+ util/ntp-keygen.1@1.174 +2 -2
+ NTP_4_2_5P184
+
+ChangeSet@1.1894, 2009-06-24 01:25:37-04:00, stenn@whimsy.udel.edu
+ [Bg 1233] atom refclock fudge time1 sign flipped in 4.2.4p164
+
+ ChangeLog@1.356 +1 -0
+ [Bg 1233] atom refclock fudge time1 sign flipped in 4.2.4p164
+
+ ntpd/ntp_refclock.c@1.89 +1 -1
+ [Bg 1233] atom refclock fudge time1 sign flipped in 4.2.4p164
+
+ChangeSet@1.1893, 2009-06-23 07:55:19-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P183
+ TAG: NTP_4_2_5P183
+
+ ChangeLog@1.355 +1 -0
+ NTP_4_2_5P183
+
+ gsoc_sntp/sntp-opts.c@1.44 +2 -2
+ NTP_4_2_5P183
+
+ gsoc_sntp/sntp-opts.h@1.44 +3 -3
+ NTP_4_2_5P183
+
+ gsoc_sntp/sntp-opts.texi@1.44 +1 -1
+ NTP_4_2_5P183
+
+ gsoc_sntp/sntp.1@1.44 +2 -2
+ NTP_4_2_5P183
+
+ ntpd/ntpd-opts.c@1.176 +2 -2
+ NTP_4_2_5P183
+
+ ntpd/ntpd-opts.h@1.176 +3 -3
+ NTP_4_2_5P183
+
+ ntpd/ntpd-opts.texi@1.174 +2 -2
+ NTP_4_2_5P183
+
+ ntpd/ntpd.1@1.174 +2 -2
+ NTP_4_2_5P183
+
+ ntpdc/ntpdc-opts.c@1.171 +2 -2
+ NTP_4_2_5P183
+
+ ntpdc/ntpdc-opts.h@1.171 +3 -3
+ NTP_4_2_5P183
+
+ ntpdc/ntpdc-opts.texi@1.170 +2 -2
+ NTP_4_2_5P183
+
+ ntpdc/ntpdc.1@1.170 +2 -2
+ NTP_4_2_5P183
+
+ ntpq/ntpq-opts.c@1.171 +2 -2
+ NTP_4_2_5P183
+
+ ntpq/ntpq-opts.h@1.171 +3 -3
+ NTP_4_2_5P183
+
+ ntpq/ntpq-opts.texi@1.170 +2 -2
+ NTP_4_2_5P183
+
+ ntpq/ntpq.1@1.170 +2 -2
+ NTP_4_2_5P183
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.52 +2 -2
+ NTP_4_2_5P183
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.52 +3 -3
+ NTP_4_2_5P183
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.52 +1 -1
+ NTP_4_2_5P183
+
+ ntpsnmpd/ntpsnmpd.1@1.52 +2 -2
+ NTP_4_2_5P183
+
+ packageinfo.sh@1.186 +1 -1
+ NTP_4_2_5P183
+
+ sntp/sntp-opts.c@1.171 +2 -2
+ NTP_4_2_5P183
+
+ sntp/sntp-opts.h@1.171 +3 -3
+ NTP_4_2_5P183
+
+ sntp/sntp-opts.texi@1.170 +1 -1
+ NTP_4_2_5P183
+
+ sntp/sntp.1@1.170 +2 -2
+ NTP_4_2_5P183
+
+ util/ntp-keygen-opts.c@1.174 +2 -2
+ NTP_4_2_5P183
+
+ util/ntp-keygen-opts.h@1.174 +3 -3
+ NTP_4_2_5P183
+
+ util/ntp-keygen-opts.texi@1.173 +2 -2
+ NTP_4_2_5P183
+
+ util/ntp-keygen.1@1.173 +2 -2
+ NTP_4_2_5P183
+
+ChangeSet@1.1881.3.2, 2009-06-19 02:45:57+00:00, hart@pogo.udel.edu
+ ChangeLog:
+ [Bug 1210], [Bug 1218], ONCORE logs to msyslog as well as clockstats
+
+ ChangeLog@1.343.3.2 +5 -2
+ [Bug 1210], [Bug 1218], ONCORE logs to msyslog as well as clockstats
+
+ChangeSet@1.1889.1.1, 2009-06-18 21:28:09+00:00, davehart@shiny.ad.hartbrothers.com
+ libntpq.h, ChangeLog:
+ [Bug 1231] ntpsnmpd build fails after sockaddr union changes
+
+ ChangeLog@1.351.1.1 +1 -0
+ [Bug 1231] ntpsnmpd build fails after sockaddr union changes
+
+ ntpq/libntpq.h@1.3 +2 -0
+ [Bug 1231] ntpsnmpd build fails after sockaddr union changes
+
+ChangeSet@1.1890, 2009-06-18 12:35:02+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_io.c, ChangeLog:
+ [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000
+ and earlier with WSAINVAL, do not log a complaint in that case.
+ nt_clockstuff.c:
+ fix EOPNOTSUPP macro redefinition warning introduced with support for
+ PPSAPI on Windows.
+
+ ChangeLog@1.352 +2 -0
+ [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000
+ and earlier with WSAINVAL, do not log a complaint in that case.
+
+ ntpd/ntp_io.c@1.289 +24 -4
+ [Bug 1196] setsockopt(SO_EXCLUSIVEADDRUSE) can fail on Windows 2000
+ and earlier with WSAINVAL, do not log a complaint in that case.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.34 +8 -1
+ fix EOPNOTSUPP macro redefinition warning introduced with support for
+ PPSAPI on Windows.
+
+ChangeSet@1.1889, 2009-06-18 08:00:58-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P182
+ TAG: NTP_4_2_5P182
+
+ ChangeLog@1.351 +1 -0
+ NTP_4_2_5P182
+
+ gsoc_sntp/sntp-opts.c@1.43 +2 -2
+ NTP_4_2_5P182
+
+ gsoc_sntp/sntp-opts.h@1.43 +3 -3
+ NTP_4_2_5P182
+
+ gsoc_sntp/sntp-opts.texi@1.43 +1 -1
+ NTP_4_2_5P182
+
+ gsoc_sntp/sntp.1@1.43 +2 -2
+ NTP_4_2_5P182
+
+ ntpd/ntpd-opts.c@1.175 +2 -2
+ NTP_4_2_5P182
+
+ ntpd/ntpd-opts.h@1.175 +3 -3
+ NTP_4_2_5P182
+
+ ntpd/ntpd-opts.texi@1.173 +37 -2
+ NTP_4_2_5P182
+
+ ntpd/ntpd.1@1.173 +17 -2
+ NTP_4_2_5P182
+
+ ntpdc/ntpdc-opts.c@1.170 +2 -2
+ NTP_4_2_5P182
+
+ ntpdc/ntpdc-opts.h@1.170 +3 -3
+ NTP_4_2_5P182
+
+ ntpdc/ntpdc-opts.texi@1.169 +2 -2
+ NTP_4_2_5P182
+
+ ntpdc/ntpdc.1@1.169 +2 -2
+ NTP_4_2_5P182
+
+ ntpq/ntpq-opts.c@1.170 +2 -2
+ NTP_4_2_5P182
+
+ ntpq/ntpq-opts.h@1.170 +3 -3
+ NTP_4_2_5P182
+
+ ntpq/ntpq-opts.texi@1.169 +2 -2
+ NTP_4_2_5P182
+
+ ntpq/ntpq.1@1.169 +2 -2
+ NTP_4_2_5P182
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.51 +2 -2
+ NTP_4_2_5P182
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.51 +3 -3
+ NTP_4_2_5P182
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.51 +1 -1
+ NTP_4_2_5P182
+
+ ntpsnmpd/ntpsnmpd.1@1.51 +2 -2
+ NTP_4_2_5P182
+
+ packageinfo.sh@1.185 +1 -1
+ NTP_4_2_5P182
+
+ sntp/sntp-opts.c@1.170 +2 -2
+ NTP_4_2_5P182
+
+ sntp/sntp-opts.h@1.170 +3 -3
+ NTP_4_2_5P182
+
+ sntp/sntp-opts.texi@1.169 +1 -1
+ NTP_4_2_5P182
+
+ sntp/sntp.1@1.169 +2 -2
+ NTP_4_2_5P182
+
+ util/ntp-keygen-opts.c@1.173 +2 -2
+ NTP_4_2_5P182
+
+ util/ntp-keygen-opts.h@1.173 +3 -3
+ NTP_4_2_5P182
+
+ util/ntp-keygen-opts.texi@1.172 +2 -2
+ NTP_4_2_5P182
+
+ util/ntp-keygen.1@1.172 +2 -2
+ NTP_4_2_5P182
+
+ChangeSet@1.1888, 2009-06-18 05:09:12-04:00, stenn@whimsy.udel.edu
+ Add missing header dependencies to the ntpdc layout verification
+
+ ChangeLog@1.350 +1 -0
+ Add missing header dependencies to the ntpdc layout verification
+
+ ntpdc/Makefile.am@1.39 +1 -1
+ Add missing header dependencies to the ntpdc layout verification
+
+ChangeSet@1.1887, 2009-06-18 05:04:55-04:00, stenn@whimsy.udel.edu
+ prefer.html updates from Dave Mills
+
+ ChangeLog@1.349 +1 -0
+ prefer.html updates from Dave Mills
+
+ html/prefer.html@1.21 +31 -134
+ prefer.html updates from Dave Mills
+
+ChangeSet@1.1886, 2009-06-18 08:10:30+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ merge cleanup cleanup
+
+ ChangeLog@1.348 +2 -2
+ merge cleanup cleanup
+
+ChangeSet@1.1881.4.1, 2009-06-18 03:54:37-04:00, stenn@whimsy.udel.edu
+ [Bug 1229] autokey segfaults in cert_install()
+
+ ChangeLog@1.343.4.1 +1 -0
+ [Bug 1229] autokey segfaults in cert_install()
+
+ ntpd/ntp_crypto.c@1.136.1.1 +7 -8
+ [Bug 1229] autokey segfaults in cert_install()
+
+ChangeSet@1.1881.3.1, 2009-06-17 17:02:49-04:00, clemens@pogo.udel.edu
+ refclock_oncore.c:
+ BUG[no bug report] A bytes available message for the input subsystem (Debug message).
+ BUG[no bug report] Change exit statements to return(0) in ONCORE driver top
+ level program. This signals an error to the calling code.
+ BUG[1218] The comment on where the oncore driver gets its input file does not
+ * agree with the code. Change the comment.
+ BUGS[no bug report] This patch puts back in some code to interpret @@Bl messages
+ on the VP and extract LEAP SECOND information. See the code for a more complete
+ comment.
+ ChangeLog:
+ Add comment re ONCORE changes to message subsystem.
+ refclock_oncore.c:
+ BUG[no bug report] This code adds a message for TRAIM messages. Users often worry about the
+ driver not starting up, and it is often because of signal strength being low.
+ Low signal strength will give TRAIM messages.
+ BUG[1220] OK, big patch, but mostly done mechanically. Change direct calls to write
+ to clockstats to a call to oncore_log, which now calls the old routine plus msyslog.
+ Have to set the LOG_LEVELS of the calls for msyslog, and this was done by hand. New
+ routine oncore_log.
+ BUGS[no bug report] Users often worry that the code is hung when there is
+ no output after a restart. If the receiver does not have battery backup
+ can take up to 30minutes to acuqire an almanac and this is necessary before
+ the driver can start. This message should reasurre the user that the driver
+ has not died.
+
+ ChangeLog@1.343.3.1 +2 -0
+ Add comment re ONCORE changes to message subsystem.
+
+ ntpd/refclock_oncore.c@1.75 +387 -331
+ BUG[1220] OK, big patch, but mostly done mechanically. Change direct calls to write
+ to clockstats to a call to oncore_log, which now calls the old routine plus msyslog.
+ Have to set the LOG_LEVELS of the calls for msyslog, and this was done by hand. New
+ routine oncore_log.
+
+ ntpd/refclock_oncore.c@1.74 +6 -2
+ BUG[1218] The comment on where the oncore driver gets its input file does not
+ * agree with the code. Change the comment.
+
+
+ ntpd/refclock_oncore.c@1.73 +11 -6
+ BUG[no bug report] Change exit statements to return(0) in ONCORE driver top
+ level program. This signals an error to the calling code.
+
+ ntpd/refclock_oncore.c@1.72 +4 -0
+ BUG[no bug report] A bytes available message for the input subsystem (Debug message).
+
+
+ ntpd/refclock_oncore.c@1.71 +8 -1
+ BUG[no bug report] This code adds a message for TRAIM messages. Users often worry about the
+ driver not starting up, and it is often because of signal strength being low.
+ Low signal strength will give TRAIM messages.
+
+ ntpd/refclock_oncore.c@1.70 +11 -4
+ BUGS[no bug report] Users often worry that the code is hung when there is
+ no output after a restart. If the receiver does not have battery backup
+ can take up to 30minutes to acuqire an almanac and this is necessary before
+ the driver can start. This message should reasurre the user that the driver
+ has not died.
+
+ ntpd/refclock_oncore.c@1.69 +149 -1
+ BUGS[no bug report] This patch puts back in some code to interpret @@Bl messages
+ on the VP and extract LEAP SECOND information. See the code for a more complete
+ comment.
+
+ChangeSet@1.1881.2.2, 2009-06-16 04:22:15+00:00, davehart@shiny.ad.hartbrothers.com
+ remove netsyslog(), equivalent to msyslog()
+ update ports/winnt/libisc/net.c winnt/include/net.h from BIND 9.6.1b1
+ to pick up change to call InitSockets (WSAStartup) in net.c
+ initialize_action (used by isc_net_probe...() routines), making
+ it safe to initialize ipv4_works and ipv6_works before init_io()
+ various fixes for build and runtime issues exposed by building
+ on Solaris, FreeBSD and Linux and testing on Linux
+
+ ChangeLog@1.343.2.2 +1 -0
+ [Bug 1225] Broadcast address miscalculated on Windows 4.2.5p180
+
+ gsoc_sntp/main.c@1.14 +1 -1
+ close_socket -> closesocket
+
+ include/ntp.h@1.159 +3 -2
+ spaces -> tab
+
+ include/ntp_rfc2553.h@1.31 +7 -7
+ stay out of system namespace by avoiding leading underscore
+
+ include/ntp_select.h@1.4 +10 -5
+ add InitSockets prototype (new with updated win32 libisc net.c)
+
+ include/ntp_stdlib.h@1.31 +0 -2
+ remove netsyslog, WSAGetLastError tested equivalent to GetLastError
+ in Windows NT 4.0 and later at least.
+
+ libntp/lib_strbuf.c@1.5 +3 -2
+ correct test for isc_net_probeipvX() return value
+
+ libntp/lib_strbuf.h@1.5 +0 -2
+ ipv4_works, ipv6_works are in ntp_stdlib.h
+
+ libntp/msyslog.c@1.22 +0 -51
+ remove netsyslog, WSAGetLastError tested equivalent to GetLastError
+ in Windows NT 4.0 and later at least.
+
+ libntp/socktoa.c@1.10 +10 -7
+ allow AF_UNSPEC again, add missing break to case AF_INET6
+
+ ntpd/ntp_intres.c@1.63 +7 -14
+ remove unused LOCALHOST #define, use ipv6_works instead of isc_net_probeipv6()
+ use estrdup()
+ remove \n from msyslog() format string
+
+ ntpd/ntp_io.c@1.288 +40 -51
+ one missed merge cleanup
+ header shuffle to fix unix build
+ a = b = c == d is an assignment but not the one intended
+ itf_flags = -> itf_flags |=, parentheses
+ use isc_net_probe_ipv6only() to decide if we setsockopt(IPV6_V6ONLY)
+ extraneous '&' broke unix recvfrom/recvmsg
+
+ ntpd/ntpd.c@1.102.1.2 +3 -3
+ move init_lib() call back to original location
+ remove netsyslog, WSAGetLastError tested equivalent to GetLastError
+ in Windows NT 4.0 and later at least.
+
+ ntpdate/ntpdate.c@1.67 +24 -34
+ if (isc_net_probeipv6() != ISC_R_SUCCESS) -> if (!ipv6_works)
+ remove netsyslog, WSAGetLastError tested equivalent to GetLastError
+ in Windows NT 4.0 and later at least.
+ remove explicit WSAStartup() call on Windows, now handled in init_lib()
+
+ ntpdc/ntpdc.c@1.65 +3 -10
+ if (isc_net_probeipv6() != ISC_R_SUCCESS) -> if (!ipv6_works)
+ remove Win32InitSockets call, handled by init_lib() now
+
+ ntpq/ntpq.c@1.87 +2 -8
+ if (isc_net_probeipv6() != ISC_R_SUCCESS) -> if (!ipv6_works)
+ remove Win32InitSockets call, handled by init_lib() now
+
+ ports/winnt/include/config.h@1.67.2.2 +0 -2
+ remove INCLUDE_IPV6_SUPPORT, INCLUDE_IPV6_MULTICAST_SUPPORT, unneeded
+
+ ports/winnt/include/isc/net.h@1.7 +50 -31
+ updated from BIND 9.6.1.b1
+
+ ports/winnt/libisc/interfaceiter.c@1.9 +6 -6
+ [Bug 1225] set netmask before using it to calculate broadcast address
+ in internal_current()
+
+ ports/winnt/libisc/net.c@1.9 +79 -72
+ updated from BIND 9.6.1.b1
+
+ ports/winnt/libntp/libntp.vcproj@1.8 +0 -22
+ remove dnslookup.c reference, unused code unlikely to be revived
+
+ ports/winnt/libntp/setpriority.c@1.2 +28 -0
+ Add InitSockets() to libntp for Windows (needed by updated
+ ports/winnt/libisc/net.c)
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.42.1.2 +1 -13
+ remove short-lived dummy InitSockets from mixed libisc versions,
+ now lives in libntp (ports/winnt/libntp/setpriority.c)
+ remove netsyslog, WSAGetLastError tested equivalent to GetLastError
+ in Windows NT 4.0 and later at least.
+
+ChangeSet@1.1873.1.1, 2009-06-15 03:46:17+00:00, davehart@shiny.ad.hartbrothers.com
+ Use a union for structs sockaddr, sockaddr_storage, sockaddr_in, and
+ sockaddr_in6 to remove casts and enable type checking. Collapse
+ some previously separate IPv4/IPv6 paths into a single codepath.
+
+ ChangeLog@1.336.1.1 +4 -1
+ Use a union for structs sockaddr, sockaddr_storage, sockaddr_in, and
+ sockaddr_in6 to remove casts and enable type checking. Collapse
+ some previously separate IPv4/IPv6 paths into a single codepath.
+
+ gsoc_sntp/main.c@1.13 +5 -5
+ struct sockaddr_storage -> sockaddr_u
+ use sizeof instead of constant
+
+ gsoc_sntp/networking.c@1.19 +117 -130
+ struct sockaddr_storage -> sockaddr_u
+ use sizeof instead of constant
+
+ gsoc_sntp/networking.h@1.12 +6 -8
+ struct sockaddr_storage -> sockaddr_u
+
+ gsoc_sntp/utilities.c@1.6 +5 -3
+ struct sockaddr_storage -> sockaddr_u
+
+ gsoc_sntp/utilities.h@1.5 +1 -1
+ struct sockaddr_storage -> sockaddr_u
+
+ include/interfaceiter.h@1.4 +0 -0
+ Rename: BitKeeper/deleted/.del-interfaceiter.h~52531bc -> include/interfaceiter.h
+
+ BitKeeper/deleted/.del-interfaceiter.h~52531bc@1.3 +0 -0
+ Rename: include/interfaceiter.h -> BitKeeper/deleted/.del-interfaceiter.h~52531bc
+
+ include/iosignal.h@1.4 +8 -8
+ whitespace cleanup
+
+ include/ntp.h@1.155.2.1 +16 -102
+ whitespace cleanup, move sockaddr macros to ntp_net.h
+
+ include/ntp_control.h@1.35 +1 -1
+ struct sockaddr_storage -> sockaddr_u
+
+ include/ntp_fp.h@1.15 +10 -12
+ whitespace cleanup, stay out of system namespace by avoiding
+ leading underscore for identifiers
+
+ include/ntp_malloc.h@1.3 +5 -5
+ stay out of system namespace _ntp_malloc_h -> NTP_MALLOC_H
+
+ include/ntp_net.h@1.2 +189 -0
+ move sockaddr macros from ntp.h, add more
+
+ include/ntp_refclock.h@1.23 +2 -2
+ struct sockaddr_storage -> sockaddr_u
+
+ include/ntp_request.h@1.35 +5 -5
+ rename struct info_monitor.lastdrop to restr to reflect its use
+
+ include/ntp_stdlib.h@1.30 +13 -6
+ struct sockaddr_storage -> sockaddr_u
+
+ include/ntpd.h@1.128 +37 -39
+ struct sockaddr_storage -> sockaddr_u
+ whitespace cleanup
+
+ include/ntpsim.h@1.11 +2 -2
+ struct sockaddr_storage -> sockaddr_u
+
+ include/recvbuff.h@1.16.1.1 +5 -6
+ struct sockaddr_storage -> sockaddr_u
+
+ libntp/a_md5encrypt.c@1.19 +4 -4
+ struct sockaddr_storage -> sockaddr_u
+
+ libntp/clocktypes.c@1.18 +4 -4
+ spaces to tabs
+
+ libntp/decodenetnum.c@1.6.1.1 +2 -2
+ struct sockaddr_storage -> sockaddr_u
+
+ libntp/lib_strbuf.c@1.4 +8 -0
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ libntp/lib_strbuf.h@1.4 +2 -0
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ libntp/netof.c@1.7 +30 -24
+ struct sockaddr_storage -> sockaddr_u
+
+ libntp/numtoa.c@1.4 +5 -3
+ sprintf -> snprintf
+
+ libntp/recvbuff.c@1.29.1.1 +2 -7
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ libntp/refnumtoa.c@1.6 +13 -10
+ struct sockaddr_storage -> sockaddr_u
+ sprintf -> snprintf
+
+ libntp/socktoa.c@1.9 +12 -13
+ struct sockaddr_storage -> sockaddr_u
+ strcpy -> strncpy
+
+ libntp/socktohost.c@1.6 +4 -4
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_config.c@1.192.1.1 +93 -124
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_control.c@1.111 +9 -9
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_crypto.c@1.137 +15 -23
+ struct sockaddr_storage -> sockaddr_u
+ use DPRINTF
+ emalloc + strcpy -> estrdup
+
+ ntpd/ntp_intres.c@1.62 +12 -12
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_io.c@1.285.1.1 +1470 -1649
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_monitor.c@1.24 +2 -2
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_peer.c@1.118.1.1 +45 -50
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_proto.c@1.286.1.1 +11 -13
+ struct sockaddr_storage -> sockaddr_u
+ use DPRINTF
+
+ ntpd/ntp_refclock.c@1.86.1.1 +2 -14
+ struct sockaddr_storage -> sockaddr_u
+ ISREFCLOCKADR() no longer assumes address given is IPv4
+
+ ntpd/ntp_request.c@1.78.1.1 +323 -339
+ struct sockaddr_storage -> sockaddr_u
+ ISREFCLOCKADR() no longer assumes address given is IPv4
+
+ ntpd/ntp_restrict.c@1.27 +19 -23
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntp_timer.c@1.54 +2 -2
+ eliminate truncation warning, whitespace
+
+ ntpd/ntp_util.c@1.72 +14 -14
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpd/ntpd.c@1.102.1.1 +18 -15
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+ remove 3rd call to setup_logfile(), only needed once after daemonizing
+
+ ntpd/ntpsim.c@1.21 +132 -133
+ struct sockaddr_storage -> sockaddr_u
+ use sizeof(var) not sizeof(typeof(var)) to insulate against breakage
+ whitespace cleanup
+
+ ntpd/refclock_nmea.c@1.37.1.1 +2 -2
+ SOCKLEN misuse
+ use struct recvbuff.recv_peer instead of unioned recv_srcclock to avoid cast
+
+ ntpdate/ntpdate.c@1.66 +28 -45
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpdate/ntpdate.h@1.10 +1 -1
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpdc/layout.std@1.8 +2 -2
+ rename monlist lastdrop field to restr as it hold restrict bits not time
+
+ ntpdc/ntpdc.c@1.62.1.1 +8 -10
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpdc/ntpdc.h@1.9 +2 -2
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpdc/ntpdc_ops.c@1.56.1.1 +165 -219
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpq/libntpq.c@1.3 +4 -4
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpq/libntpq.h@1.2 +1 -1
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpq/libntpq_subs.c@1.2 +2 -2
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpq/ntpq-subs.c@1.31 +23 -26
+ struct sockaddr_storage -> sockaddr_u
+
+ ntpq/ntpq.c@1.84.1.1 +8 -11
+ struct sockaddr_storage -> sockaddr_u
+ ISREFCLOCKADR() includes IS_IPV4 check
+
+ ntpq/ntpq.h@1.7 +3 -3
+ struct sockaddr_storage -> sockaddr_u
+
+ ports/winnt/include/config.h@1.65.1.1 +29 -12
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ ports/winnt/include/ntp_iocompletionport.h@1.17 +8 -9
+ struct sockaddr_storage -> sockaddr_u
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ ports/winnt/include/transmitbuff.h@1.6.1.1 +3 -7
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ ports/winnt/include/win32_io.h@1.9.1.1 +3 -1
+ groundwork for bug 1016 (refclock_arc.c support on Windows)
+
+ ports/winnt/libntp/libntp.vcproj@1.5.1.1 +4 -0
+ add ntp_net.h reference
+
+ ports/winnt/libntp/transmitbuff.c@1.7.1.1 +10 -6
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.29.1.1 +14 -1
+ abort if SIZEOF_ macros are wrong on DEBUG
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.41.1.1 +68 -67
+ struct sockaddr_storage -> sockaddr_u
+ IPv6 on Windows (cherry picked and previously committed, [Bug 1200])
+
+ ports/winnt/ntpd/ntpd.vcproj@1.5.1.1 +8 -1
+ add ntp_net.h, ntp_signd.c references
+ no need to exclude refclock_arc.c from build, CLOCK_ARCRON_MSF is not
+ defined in ports/winnt/include/config.h yet
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.2.1.1 +52 -0
+ add references to a bunch of headers ntpdate uses
+
+ChangeSet@1.1881.1.2, 2009-06-12 21:05:42+00:00, davehart@shiny.ad.hartbrothers.com
+ document Windows-specific ntpd options -M, --pccfreq, --usepcc
+
+ html/ntpd.html@1.48 +6 -0
+ document Windows-specific ntpd options -M, --pccfreq, --usepcc
+
+ChangeSet@1.1881.1.1, 2009-06-12 17:53:01+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
+
+ ChangeLog@1.343.1.1 +1 -0
+ [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
+
+ ntpd/ntpd-opts.c@1.174 +63 -2
+ [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
+ generated by autogen autoopts
+
+ ntpd/ntpd-opts.h@1.174 +23 -5
+ [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
+ generated by autogen autoopts
+
+ ntpd/ntpd.c@1.103 +2 -2
+ Switch to configured logfile from syslog just before init_winnt_time()
+ (rather than just after)
+
+ ntpd/ntpdbase-opts.def@1.17 +24 -0
+ [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.32 +10 -5
+ [Bug 1205] Add ntpd --usepcc and --pccfreq options on Windows
+
+ChangeSet@1.1880.1.1, 2009-06-09 22:36:51+00:00, davehart@shiny.ad.hartbrothers.com
+ timepps-Solaris.h pps_handle_t changed from pointer to scalar
+ NMEA refclock converted to use common PPSAPI code
+ Spectracom refclock added to Windows port of ntpd
+
+ ChangeLog@1.342.1.1 +3 -0
+ timepps-Solaris.h pps_handle_t changed from pointer to scalar
+ NMEA refclock converted to use common PPSAPI code
+ Spectracom refclock added to Windows port of ntpd
+
+ include/timepps-Solaris.h@1.6 +50 -31
+ timepps-Solaris.h pps_handle_t changed from pointer to scalar
+
+ ntpd/refclock_nmea.c@1.39 +77 -242
+ NMEA refclock converted to use common PPSAPI code
+
+ ports/winnt/include/config.h@1.67.1.1 +3 -2
+ Spectracom refclock added to Windows port of ntpd
+
+ ports/winnt/ntpd/ntpd.vcproj@1.8 +0 -2
+ Spectracom refclock added to Windows port of ntpd
+
+ChangeSet@1.1882, 2009-06-08 17:51:47+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1215] unpeer by association ID
+
+ ChangeLog@1.344 +1 -0
+ [Bug 1215] unpeer by association ID
+
+ include/ntp_config.h@1.53 +7 -6
+ [Bug 1215] unpeer by association ID
+
+ libntp/recvbuff.c@1.31 +49 -5
+ free receive buffers on free, full lists at shutdown on DEBUG
+
+ ntpd/ntp_config.c@1.195 +43 -7
+ [Bug 1215] unpeer by association ID
+
+ ports/winnt/include/config.h@1.68 +1 -0
+ added commented #define MALLOC_LINT for ease of enabling it
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.43 +79 -19
+ free receive buffers on free, full lists at shutdown on DEBUG
+ free in-use (receive or send) I/O buffers at shutdown on DEBUG
+
+ChangeSet@1.1881, 2009-06-06 07:53:58-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P181
+ TAG: NTP_4_2_5P181
+
+ ChangeLog@1.343 +1 -0
+ NTP_4_2_5P181
+
+ gsoc_sntp/sntp-opts.c@1.42 +2 -2
+ NTP_4_2_5P181
+
+ gsoc_sntp/sntp-opts.h@1.42 +3 -3
+ NTP_4_2_5P181
+
+ gsoc_sntp/sntp-opts.texi@1.42 +1 -1
+ NTP_4_2_5P181
+
+ gsoc_sntp/sntp.1@1.42 +2 -2
+ NTP_4_2_5P181
+
+ ntpd/ntpd-opts.c@1.173 +2 -2
+ NTP_4_2_5P181
+
+ ntpd/ntpd-opts.h@1.173 +3 -3
+ NTP_4_2_5P181
+
+ ntpd/ntpd-opts.texi@1.172 +1 -1
+ NTP_4_2_5P181
+
+ ntpd/ntpd.1@1.172 +2 -2
+ NTP_4_2_5P181
+
+ ntpdc/ntpdc-opts.c@1.169 +2 -2
+ NTP_4_2_5P181
+
+ ntpdc/ntpdc-opts.h@1.169 +3 -3
+ NTP_4_2_5P181
+
+ ntpdc/ntpdc-opts.texi@1.168 +1 -1
+ NTP_4_2_5P181
+
+ ntpdc/ntpdc.1@1.168 +2 -2
+ NTP_4_2_5P181
+
+ ntpq/ntpq-opts.c@1.169 +2 -2
+ NTP_4_2_5P181
+
+ ntpq/ntpq-opts.h@1.169 +3 -3
+ NTP_4_2_5P181
+
+ ntpq/ntpq-opts.texi@1.168 +1 -1
+ NTP_4_2_5P181
+
+ ntpq/ntpq.1@1.168 +2 -2
+ NTP_4_2_5P181
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.50 +2 -2
+ NTP_4_2_5P181
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.50 +3 -3
+ NTP_4_2_5P181
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.50 +1 -1
+ NTP_4_2_5P181
+
+ ntpsnmpd/ntpsnmpd.1@1.50 +2 -2
+ NTP_4_2_5P181
+
+ packageinfo.sh@1.184 +1 -1
+ NTP_4_2_5P181
+
+ sntp/sntp-opts.c@1.169 +2 -2
+ NTP_4_2_5P181
+
+ sntp/sntp-opts.h@1.169 +3 -3
+ NTP_4_2_5P181
+
+ sntp/sntp-opts.texi@1.168 +1 -1
+ NTP_4_2_5P181
+
+ sntp/sntp.1@1.168 +2 -2
+ NTP_4_2_5P181
+
+ util/ntp-keygen-opts.c@1.172 +2 -2
+ NTP_4_2_5P181
+
+ util/ntp-keygen-opts.h@1.172 +3 -3
+ NTP_4_2_5P181
+
+ util/ntp-keygen-opts.texi@1.171 +1 -1
+ NTP_4_2_5P181
+
+ util/ntp-keygen.1@1.171 +2 -2
+ NTP_4_2_5P181
+
+ChangeSet@1.1877.1.4, 2009-06-06 04:29:46+00:00, davehart@shiny.ad.hartbrothers.com
+ timepps.h:
+ Use FreeLibrary in load_pps_provider failure paths, correct
+ (provtime_pps_destroy) cast, and fix for always returning -1
+ meaning failure but errno 0 on successful time_pps_destroy()
+
+ ports/winnt/include/timepps.h@1.2 +10 -2
+ Use FreeLibrary in load_pps_provider failure paths, correct
+ (provtime_pps_destroy) cast, and fix for always returning -1
+ meaning failure but errno 0 on successful time_pps_destroy()
+
+ChangeSet@1.1877.2.1, 2009-06-05 23:35:04+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1084] PPSAPI for ntpd on Windows with DLL backends
+ [Bug 1204] Unix-style refclock device paths on Windows
+ [Bug 1205] partial fix, disable RDTSC use by default on Windows
+ Enable ONCORE, ARCRON refclocks on Windows (untested)
+
+
+
+ ChangeLog@1.340.2.1 +4 -0
+ [Bug 1084] PPSAPI for ntpd on Windows with DLL backends
+ [Bug 1204] Unix-style refclock device paths on Windows
+ [Bug 1205] partial fix, disable RDTSC use by default on Windows
+ Enable ONCORE, ARCRON refclocks on Windows (untested)
+
+
+ include/ntp_types.h@1.13 +14 -0
+ [Bug 1204] Unix-style refclock device paths on Windows
+
+ ntpd/refclock_arc.c@1.20 +4 -2
+ Enable ONCORE, ARCRON refclocks on Windows (untested)
+
+ ntpd/refclock_atom.c@1.60 +1 -1
+ [Bug 1204] Unix-style refclock device paths on Windows
+
+ ntpd/refclock_hopfser.c@1.13 +1 -4
+ [Bug 1204] Unix-style refclock device paths on Windows
+
+ ntpd/refclock_nmea.c@1.38 +12 -12
+ [Bug 1204] Unix-style refclock device paths on Windows
+ quiet type conversion warning
+
+ ntpd/refclock_oncore.c@1.68 +12 -4
+ Enable ONCORE, ARCRON refclocks on Windows (untested)
+
+ ntpd/refclock_palisade.c@1.25 +2 -4
+ [Bug 1204] Unix-style refclock device paths on Windows
+
+ ports/winnt/include/clockstuff.h@1.10 +1 -1
+ #include "ntp_fp.h"
+
+ ports/winnt/include/config.h@1.67 +21 -5
+ Enable ONCORE, ARCRON refclocks on Windows (untested)
+
+ ports/winnt/include/timepps.h@1.1 +803 -0
+ [Bug 1084] PPSAPI for ntpd on Windows with DLL backends
+
+ ports/winnt/include/timepps.h@1.0 +0 -0
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.31 +46 -1
+ [Bug 1205] partial fix, disable RDTSC use by default on Windows
+
+ ports/winnt/ntpd/ntpd.vcproj@1.7 +0 -3
+ Enable ONCORE, ARCRON refclocks on Windows (untested)
+
+ ports/winnt/ntpd/win32_io.c@1.18 +75 -34
+ [Bug 1204] Unix-style refclock device paths on Windows
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c@1.1 +382 -0
+ Sample source for Windows PPSAPI provider DLL implementing interface
+ defined in ports/winnt/include/timepps.h
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c@1.0 +0 -0
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def@1.1 +9 -0
+ Sample source for Windows PPSAPI provider DLL implementing interface
+ defined in ports/winnt/include/timepps.h
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def@1.0 +0 -0
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h@1.1 +22 -0
+ Sample source for Windows PPSAPI provider DLL implementing interface
+ defined in ports/winnt/include/timepps.h
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h@1.0 +0 -0
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln@1.1 +19 -0
+ Sample source for Windows PPSAPI provider DLL implementing interface
+ defined in ports/winnt/include/timepps.h
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln@1.0 +0 -0
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj@1.1 +227 -0
+ Sample source for Windows PPSAPI provider DLL implementing interface
+ defined in ports/winnt/include/timepps.h
+
+ ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj@1.0 +0 -0
+
+ ports/winnt/ppsapi/skelprov/sys/time.h@1.1 +18 -0
+ Sample source for Windows PPSAPI provider DLL implementing interface
+ defined in ports/winnt/include/timepps.h
+
+ ports/winnt/ppsapi/skelprov/sys/time.h@1.0 +0 -0
+
+ChangeSet@1.1877.1.2, 2009-06-03 01:35:02+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1211] keysdir free()d twice #ifdef DEBUG
+
+ ChangeLog@1.340.1.2 +1 -0
+ [Bug 1211] keysdir free()d twice #ifdef DEBUG
+
+ libntp/decodenetnum.c@1.8 +3 -3
+ this 1208 fix works
+
+ ntpd/ntp_config.c@1.194 +10 -32
+ [Bug 1211] keysdir free()d twice #ifdef DEBUG
+
+ ports/winnt/ntpd/ntservice.c@1.17 +23 -10
+ turn on more heap checking on Windows DEBUG build
+
+ChangeSet@1.1877.1.1, 2009-06-02 22:04:37+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1208] decodenetnum() buffer overrun on [ with no ]
+
+ ChangeLog@1.340.1.1 +1 -0
+ [Bug 1208] decodenetnum() buffer overrun on [ with no ]
+
+ libntp/decodenetnum.c@1.7 +17 -11
+ [Bug 1208] decodenetnum() buffer overrun on [ with no ]
+
+ChangeSet@1.1878, 2009-06-01 08:52:39-04:00, mayer@pogo.udel.edu
+ [Bug 1206] Required compiler changes for Windows
+
+ ChangeLog@1.341 +1 -0
+ [Bug 1206] Required compiler changes for Windows
+
+ ports/winnt/libntp/libntp.dsp@1.34 +8 -12
+ [Bug 1206] Required compiler changes for Windows
+
+ChangeSet@1.1877, 2009-05-29 07:54:39-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P180
+ TAG: NTP_4_2_5P180
+
+ ChangeLog@1.340 +1 -0
+ NTP_4_2_5P180
+
+ gsoc_sntp/sntp-opts.c@1.41 +2 -2
+ NTP_4_2_5P180
+
+ gsoc_sntp/sntp-opts.h@1.41 +3 -3
+ NTP_4_2_5P180
+
+ gsoc_sntp/sntp-opts.texi@1.41 +1 -1
+ NTP_4_2_5P180
+
+ gsoc_sntp/sntp.1@1.41 +2 -2
+ NTP_4_2_5P180
+
+ ntpd/ntpd-opts.c@1.172 +2 -2
+ NTP_4_2_5P180
+
+ ntpd/ntpd-opts.h@1.172 +3 -3
+ NTP_4_2_5P180
+
+ ntpd/ntpd-opts.texi@1.171 +2 -2
+ NTP_4_2_5P180
+
+ ntpd/ntpd.1@1.171 +2 -2
+ NTP_4_2_5P180
+
+ ntpdc/ntpdc-opts.c@1.168 +2 -2
+ NTP_4_2_5P180
+
+ ntpdc/ntpdc-opts.h@1.168 +3 -3
+ NTP_4_2_5P180
+
+ ntpdc/ntpdc-opts.texi@1.167 +2 -2
+ NTP_4_2_5P180
+
+ ntpdc/ntpdc.1@1.167 +2 -2
+ NTP_4_2_5P180
+
+ ntpq/ntpq-opts.c@1.168 +2 -2
+ NTP_4_2_5P180
+
+ ntpq/ntpq-opts.h@1.168 +3 -3
+ NTP_4_2_5P180
+
+ ntpq/ntpq-opts.texi@1.167 +2 -2
+ NTP_4_2_5P180
+
+ ntpq/ntpq.1@1.167 +2 -2
+ NTP_4_2_5P180
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.49 +2 -2
+ NTP_4_2_5P180
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.49 +3 -3
+ NTP_4_2_5P180
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.49 +1 -1
+ NTP_4_2_5P180
+
+ ntpsnmpd/ntpsnmpd.1@1.49 +2 -2
+ NTP_4_2_5P180
+
+ packageinfo.sh@1.183 +1 -1
+ NTP_4_2_5P180
+
+ sntp/sntp-opts.c@1.168 +2 -2
+ NTP_4_2_5P180
+
+ sntp/sntp-opts.h@1.168 +3 -3
+ NTP_4_2_5P180
+
+ sntp/sntp-opts.texi@1.167 +1 -1
+ NTP_4_2_5P180
+
+ sntp/sntp.1@1.167 +2 -2
+ NTP_4_2_5P180
+
+ util/ntp-keygen-opts.c@1.171 +2 -2
+ NTP_4_2_5P180
+
+ util/ntp-keygen-opts.h@1.171 +3 -3
+ NTP_4_2_5P180
+
+ util/ntp-keygen-opts.texi@1.170 +2 -2
+ NTP_4_2_5P180
+
+ util/ntp-keygen.1@1.170 +2 -2
+ NTP_4_2_5P180
+
+ChangeSet@1.1874.1.1, 2009-05-29 03:50:53-04:00, stenn@whimsy.udel.edu
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ ChangeLog@1.337.1.1 +1 -0
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ include/ntp.h@1.155.1.1 +3 -4
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ ntpd/ntp_config.c@1.193 +2 -2
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ ntpd/ntp_peer.c@1.119 +20 -3
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ ntpd/ntp_proto.c@1.287 +1 -2
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ ntpd/ntp_refclock.c@1.87 +1 -1
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ ntpd/refclock_acts.c@1.35 +0 -1
+ Lose FLAG_FIXPOLL, from Dave Mills
+
+ChangeSet@1.1875, 2009-05-29 04:29:18+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1200] Enable IPv6 in Windows port
+
+ ChangeLog@1.338 +1 -0
+ [Bug 1200] Enable IPv6 in Windows port
+
+ include/isc/interfaceiter.h@1.4 +1 -3
+ remove unnecessary additions to struct isc_interface, eases
+ future integration of libisc drops
+
+ include/ntp.h@1.156 +7 -8
+ [Bug 1200] Enable IPv6 in Windows port
+ remove never used ifindex from struct interface, make phase u_short
+ instead of u_char, move next to u_short family for better packing
+
+ include/recvbuff.h@1.17 +4 -5
+ [Bug 1200] Enable IPv6 in Windows port
+ rename Windows-only src_addr_len to recv_srcadr_len to clarify it is
+ associated with recv_srcadr
+ remove wsabuff, send/recv routines can safely put it on stack
+
+ libntp/recvbuff.c@1.30 +0 -5
+ recvbuff.wsabuff removal
+
+ ntpd/ntp_io.c@1.286 +4 -21
+ [Bug 1200] Enable IPv6 in Windows port
+ remove unused ifindex from struct interface
+ do not initialize unused transmitbuff.c code
+
+ ntpd/ntp_request.c@1.79 +2 -1
+ remove unused ifindex from struct interface
+
+ ntpdc/ntpdc.c@1.63 +9 -1
+ [Bug 1200] Enable IPv6 in Windows port
+
+ ntpdc/ntpdc_ops.c@1.57 +4 -5
+ do not display ifindex in ifstats, was always zero and now removed
+
+ ntpq/ntpq.c@1.85 +13 -4
+ [Bug 1200] Enable IPv6 in Windows port
+
+ ports/winnt/include/config.h@1.66 +39 -14
+ [Bug 1200] Enable IPv6 in Windows port
+
+ ports/winnt/include/transmitbuff.h@1.7 +3 -7
+ remove wsabuff, stack allocation is no problem for it
+
+ ports/winnt/include/win32_io.h@1.10 +3 -1
+ prep for future refclock_arc.c support on windows
+
+ ports/winnt/libisc/interfaceiter.c@1.8 +203 -92
+ [Bug 1200] Enable IPv6 in Windows port
+
+ ports/winnt/libisc/net.c@1.8 +8 -18
+ [Bug 1200] Enable IPv6 in Windows port
+
+ ports/winnt/libntp/interfaceiter.c@1.3 +188 -68
+ not used, upstream drop from BIND 9.6.1b1 is baseline for
+ ports/winnt/libisc/interfaceiter.c
+
+ ports/winnt/libntp/libntp.vcproj@1.6 +4 -0
+ add ntp_net.h reference
+
+ ports/winnt/libntp/transmitbuff.c@1.8 +10 -6
+ remove wsabuf initialization, note the code is dead in top comment
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.30 +16 -1
+ complain on DEBUG builds if hardcoded SIZEOF_ macros are wrong
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.42 +86 -79
+ [Bug 1200] Enable IPv6 on Windows
+ remove wsabuf from transmitbuff_t, recvbuff
+
+ ports/winnt/ntpd/ntpd.vcproj@1.6 +8 -1
+ add ntp_signd.c, ntp_net.h references
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.3 +52 -0
+ add a bunch of missing header references (not all by far though)
+
+ChangeSet@1.1874, 2009-05-23 07:55:15-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P179
+ TAG: NTP_4_2_5P179
+
+ ChangeLog@1.337 +1 -0
+ NTP_4_2_5P179
+
+ gsoc_sntp/sntp-opts.c@1.40 +2 -2
+ NTP_4_2_5P179
+
+ gsoc_sntp/sntp-opts.h@1.40 +3 -3
+ NTP_4_2_5P179
+
+ gsoc_sntp/sntp-opts.texi@1.40 +1 -1
+ NTP_4_2_5P179
+
+ gsoc_sntp/sntp.1@1.40 +2 -2
+ NTP_4_2_5P179
+
+ ntpd/ntpd-opts.c@1.171 +2 -2
+ NTP_4_2_5P179
+
+ ntpd/ntpd-opts.h@1.171 +3 -3
+ NTP_4_2_5P179
+
+ ntpd/ntpd-opts.texi@1.170 +2 -2
+ NTP_4_2_5P179
+
+ ntpd/ntpd.1@1.170 +2 -2
+ NTP_4_2_5P179
+
+ ntpdc/ntpdc-opts.c@1.167 +2 -2
+ NTP_4_2_5P179
+
+ ntpdc/ntpdc-opts.h@1.167 +3 -3
+ NTP_4_2_5P179
+
+ ntpdc/ntpdc-opts.texi@1.166 +2 -2
+ NTP_4_2_5P179
+
+ ntpdc/ntpdc.1@1.166 +2 -2
+ NTP_4_2_5P179
+
+ ntpq/ntpq-opts.c@1.167 +2 -2
+ NTP_4_2_5P179
+
+ ntpq/ntpq-opts.h@1.167 +3 -3
+ NTP_4_2_5P179
+
+ ntpq/ntpq-opts.texi@1.166 +2 -2
+ NTP_4_2_5P179
+
+ ntpq/ntpq.1@1.166 +2 -2
+ NTP_4_2_5P179
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.48 +2 -2
+ NTP_4_2_5P179
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.48 +3 -3
+ NTP_4_2_5P179
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.48 +1 -1
+ NTP_4_2_5P179
+
+ ntpsnmpd/ntpsnmpd.1@1.48 +2 -2
+ NTP_4_2_5P179
+
+ packageinfo.sh@1.182 +1 -1
+ NTP_4_2_5P179
+
+ sntp/sntp-opts.c@1.167 +2 -2
+ NTP_4_2_5P179
+
+ sntp/sntp-opts.h@1.167 +3 -3
+ NTP_4_2_5P179
+
+ sntp/sntp-opts.texi@1.166 +1 -1
+ NTP_4_2_5P179
+
+ sntp/sntp.1@1.166 +2 -2
+ NTP_4_2_5P179
+
+ util/ntp-keygen-opts.c@1.170 +2 -2
+ NTP_4_2_5P179
+
+ util/ntp-keygen-opts.h@1.170 +3 -3
+ NTP_4_2_5P179
+
+ util/ntp-keygen-opts.texi@1.169 +2 -2
+ NTP_4_2_5P179
+
+ util/ntp-keygen.1@1.169 +2 -2
+ NTP_4_2_5P179
+
+ChangeSet@1.1871.1.1, 2009-05-22 22:13:36-04:00, stenn@whimsy.udel.edu
+ Dave's latest change fixes a reported bug - update the ChangeLog
+
+ ChangeLog@1.334.1.1 +3 -2
+ Dave's latest change fixes a reported bug - update the ChangeLog
+
+ChangeSet@1.1872, 2009-05-23 02:02:18+00:00, davehart@shiny.ad.hartbrothers.com
+ Bug [1041] manycastclient fails with 4.2.5p120.
+ (fixed by Dave Mills' prior delta to ntp_peer.c xmt -> aorg)
+ Bug [1196] VC6 winsock2.h does not define SO_EXLUSIVEADDRUSE.
+
+
+ ChangeLog@1.335 +3 -1
+ Bug [1041] manycastclient fails with 4.2.5p120.
+ Bug [1196] VC6 winsock2.h does not define SO_EXLUSIVEADDRUSE.
+
+
+ ntpd/ntp_io.c@1.285 +17 -6
+ disambiguate two identical DPRINTFs in findbcastinter()
+
+ ports/winnt/include/config.h@1.65 +7 -0
+ Bug [1196] VC6 winsock2.h does not define SO_EXLUSIVEADDRUSE.
+
+
+ChangeSet@1.1869.1.1, 2009-05-22 21:16:18-04:00, stenn@whimsy.udel.edu
+ xmt/aorg and leap_expire fixes from Dave Mills
+
+ ChangeLog@1.332.1.2 +1 -0
+ xmt -> aorg timestamp cleanup from Dave Mills, reported by Dave Hart
+
+ ChangeLog@1.332.1.1 +1 -0
+ Leap/expire cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.136 +1 -0
+ Leap/expire cleanup from Dave Mills
+
+ ntpd/ntp_peer.c@1.118 +1 -1
+ xmt -> aorg timestamp cleanup from Dave Mills, reported by Dave Hart
+
+ ntpd/ntp_proto.c@1.286 +7 -6
+ xmt -> aorg timestamp cleanup from Dave Mills, reported by Dave Hart
+
+ChangeSet@1.1870, 2009-05-21 18:34:36+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1193] Compile error: conflicting types for emalloc
+
+ ChangeLog@1.333 +1 -0
+ [Bug 1193] Compile error: conflicting types for emalloc
+
+ libntp/emalloc.c@1.8 +3 -3
+ [Bug 1193] correct emalloc arg type from u_int -> size_t to match header
+ correct printf format specifier mismatch of %d (int) and strlen (size_t)
+
+ChangeSet@1.1869, 2009-05-21 07:54:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P178
+ TAG: NTP_4_2_5P178
+
+ ChangeLog@1.332 +1 -0
+ NTP_4_2_5P178
+
+ gsoc_sntp/sntp-opts.c@1.39 +2 -2
+ NTP_4_2_5P178
+
+ gsoc_sntp/sntp-opts.h@1.39 +3 -3
+ NTP_4_2_5P178
+
+ gsoc_sntp/sntp-opts.texi@1.39 +1 -1
+ NTP_4_2_5P178
+
+ gsoc_sntp/sntp.1@1.39 +2 -2
+ NTP_4_2_5P178
+
+ ntpd/ntpd-opts.c@1.170 +2 -2
+ NTP_4_2_5P178
+
+ ntpd/ntpd-opts.h@1.170 +3 -3
+ NTP_4_2_5P178
+
+ ntpd/ntpd-opts.texi@1.169 +1 -1
+ NTP_4_2_5P178
+
+ ntpd/ntpd.1@1.169 +2 -2
+ NTP_4_2_5P178
+
+ ntpdc/ntpdc-opts.c@1.166 +2 -2
+ NTP_4_2_5P178
+
+ ntpdc/ntpdc-opts.h@1.166 +3 -3
+ NTP_4_2_5P178
+
+ ntpdc/ntpdc-opts.texi@1.165 +1 -1
+ NTP_4_2_5P178
+
+ ntpdc/ntpdc.1@1.165 +2 -2
+ NTP_4_2_5P178
+
+ ntpq/ntpq-opts.c@1.166 +2 -2
+ NTP_4_2_5P178
+
+ ntpq/ntpq-opts.h@1.166 +3 -3
+ NTP_4_2_5P178
+
+ ntpq/ntpq-opts.texi@1.165 +1 -1
+ NTP_4_2_5P178
+
+ ntpq/ntpq.1@1.165 +2 -2
+ NTP_4_2_5P178
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.47 +2 -2
+ NTP_4_2_5P178
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.47 +3 -3
+ NTP_4_2_5P178
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.47 +1 -1
+ NTP_4_2_5P178
+
+ ntpsnmpd/ntpsnmpd.1@1.47 +2 -2
+ NTP_4_2_5P178
+
+ packageinfo.sh@1.181 +1 -1
+ NTP_4_2_5P178
+
+ sntp/sntp-opts.c@1.166 +2 -2
+ NTP_4_2_5P178
+
+ sntp/sntp-opts.h@1.166 +3 -3
+ NTP_4_2_5P178
+
+ sntp/sntp-opts.texi@1.165 +1 -1
+ NTP_4_2_5P178
+
+ sntp/sntp.1@1.165 +2 -2
+ NTP_4_2_5P178
+
+ util/ntp-keygen-opts.c@1.169 +2 -2
+ NTP_4_2_5P178
+
+ util/ntp-keygen-opts.h@1.169 +3 -3
+ NTP_4_2_5P178
+
+ util/ntp-keygen-opts.texi@1.168 +1 -1
+ NTP_4_2_5P178
+
+ util/ntp-keygen.1@1.168 +2 -2
+ NTP_4_2_5P178
+
+ChangeSet@1.1868, 2009-05-21 03:03:04-04:00, stenn@whimsy.udel.edu
+ Note fixes for bugs 320 and 1192, and erealloc() and estrdup(), along with better config parser error messages.
+
+ ChangeLog@1.331 +4 -0
+ Note fixes for bugs 320 and 1192, and erealloc() and estrdup(), along with better config parser error messages.
+
+ChangeSet@1.1867, 2009-05-21 05:30:18+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 320] restrict default should apply to both IPv4 and IPv6
+ [Bug 1192] restrict -4 default / restrict -6 default lost with new
+ ntp.conf parser.
+ Dynamically allocate Windows serial handles array to save 1KB static
+ show column of syntax errors as well as line
+ add erealloc(), estrdup()
+ save column number at start of each token for more precise syntax
+ error messages
+
+ include/ntp_calendar.h@1.4 +13 -13
+ whitespace cleanup, parenthesize macro arg
+
+ include/ntp_config.h@1.52 +1 -1
+ whitespace
+
+ include/ntp_filegen.h@1.6 +1 -1
+ changed prototype for filegen_unregister()
+
+ include/ntp_stdlib.h@1.29 +10 -5
+ add erealloc(), estrdup()
+
+ include/ntp_types.h@1.12 +5 -0
+ add COUNTOF(array) macro
+
+ include/ntpd.h@1.127 +1 -1
+ add comment that fstostr time_t arg isn't a typical time_t
+
+ libntp/emalloc.c@1.7 +75 -14
+ add erealloc(), estrdup()
+
+ libntp/ntp_lineedit.c@1.6 +2 -1
+ strdup() -> estrdup()
+
+ ntpd/ntp_config.c@1.192 +310 -244
+ [Bug 320] restrict default should apply to both IPv4 and IPv6
+ [Bug 1192] restrict -4 default / restrict -6 default lost with new
+ ntp.conf parser.
+ Remove unnecessary casts, use sizeof(*ptr) instead of sizeof(ptr_type)
+ change switch/case indents to NTP style
+ wrap long lines, remove unneeded casts, silence uninit warning
+ strdup() -> estrdup()
+
+ ntpd/ntp_filegen.c@1.15 +226 -194
+ free more malloc()'d memory at shutdown #ifdef DEBUG
+ whitespace cleanup, wrap long lines
+ remove unnecessary casts
+ sprintf()->snprintf()
+ constants on left side of == to catch accidental change to =, and put
+ more informative item first
+ '/' -> DIR_SEP
+ restore DPRINTF()s that gave Alpha compiler fits by using %p printf format
+
+ ntpd/ntp_parser.c@1.38 +1000 -955
+ Bison output from ntp_parser.y
+
+
+ ntpd/ntp_parser.h@1.22 +225 -225
+ Bison output from ntp_parser.y
+
+
+ ntpd/ntp_parser.y@1.33 +50 -22
+ [Bug 1192] restrict -4 default / restrict -6 default lost with new
+ ntp.conf parser.
+ correct else block indent in include processing code
+ remove unwanted \n from end of msyslog() in yyerror()
+ strdup() -> estrdup()
+ display line and column numbers in syntax error messages
+ save column number at start of each token for more precise syntax
+ error messages
+
+ ntpd/ntp_scanner.c@1.21 +110 -118
+ strdup() -> estrdup()
+ first line number is one not zero
+ save column number at start of each token for more precise syntax
+ error messages
+ clarify reason for -4/-6 hack in yylex() comment
+
+ ntpd/ntp_scanner.h@1.6 +16 -13
+ save column number at start of each token for more precise syntax
+ error messages
+ whitespace cleanup
+
+ ntpd/ntp_util.c@1.71 +42 -52
+ free() then emalloc() becomes erealloc()
+ thin #ifdef forest
+
+ ports/winnt/include/win32_io.h@1.9 +95 -85
+ whitespace and indent cleanup
+ stay out of system namespace (leading _)
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.29 +0 -3
+ COUNTOF() macro moved to ntp_types.h
+
+ ports/winnt/ntpd/win32_io.c@1.17 +420 -202
+ dynamically allocate serial handles array (saves 1 KB static)
+ change switch/case intents to NTP style
+ add TIOCMGET tty ioctl emulation, improve TIOCMSET emulation
+ correct tcsetattr() & tcgetattr() return values
+ remove superfluous NT_COM: prefix from error texts
+
+ChangeSet@1.1866, 2009-05-18 08:14:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P177
+ TAG: NTP_4_2_5P177
+
+ ChangeLog@1.330 +1 -0
+ NTP_4_2_5P177
+
+ gsoc_sntp/sntp-opts.c@1.38 +2 -2
+ NTP_4_2_5P177
+
+ gsoc_sntp/sntp-opts.h@1.38 +3 -3
+ NTP_4_2_5P177
+
+ gsoc_sntp/sntp-opts.texi@1.38 +1 -1
+ NTP_4_2_5P177
+
+ gsoc_sntp/sntp.1@1.38 +2 -2
+ NTP_4_2_5P177
+
+ ntpd/ntpd-opts.c@1.169 +4 -4
+ NTP_4_2_5P177
+
+ ntpd/ntpd-opts.h@1.169 +4 -4
+ NTP_4_2_5P177
+
+ ntpd/ntpd-opts.texi@1.168 +1 -1
+ NTP_4_2_5P177
+
+ ntpd/ntpd.1@1.168 +2 -2
+ NTP_4_2_5P177
+
+ ntpdc/ntpdc-opts.c@1.165 +4 -4
+ NTP_4_2_5P177
+
+ ntpdc/ntpdc-opts.h@1.165 +4 -4
+ NTP_4_2_5P177
+
+ ntpdc/ntpdc-opts.texi@1.164 +1 -1
+ NTP_4_2_5P177
+
+ ntpdc/ntpdc.1@1.164 +2 -2
+ NTP_4_2_5P177
+
+ ntpq/ntpq-opts.c@1.165 +4 -4
+ NTP_4_2_5P177
+
+ ntpq/ntpq-opts.h@1.165 +4 -4
+ NTP_4_2_5P177
+
+ ntpq/ntpq-opts.texi@1.164 +1 -1
+ NTP_4_2_5P177
+
+ ntpq/ntpq.1@1.164 +2 -2
+ NTP_4_2_5P177
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.46 +4 -4
+ NTP_4_2_5P177
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.46 +4 -4
+ NTP_4_2_5P177
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.46 +1 -1
+ NTP_4_2_5P177
+
+ ntpsnmpd/ntpsnmpd.1@1.46 +2 -2
+ NTP_4_2_5P177
+
+ packageinfo.sh@1.180 +1 -1
+ NTP_4_2_5P177
+
+ sntp/sntp-opts.c@1.165 +2 -2
+ NTP_4_2_5P177
+
+ sntp/sntp-opts.h@1.165 +3 -3
+ NTP_4_2_5P177
+
+ sntp/sntp-opts.texi@1.164 +1 -1
+ NTP_4_2_5P177
+
+ sntp/sntp.1@1.164 +2 -2
+ NTP_4_2_5P177
+
+ util/ntp-keygen-opts.c@1.168 +4 -4
+ NTP_4_2_5P177
+
+ util/ntp-keygen-opts.h@1.168 +4 -4
+ NTP_4_2_5P177
+
+ util/ntp-keygen-opts.texi@1.167 +1 -1
+ NTP_4_2_5P177
+
+ util/ntp-keygen.1@1.167 +2 -2
+ NTP_4_2_5P177
+
+ChangeSet@1.1436.15.70, 2009-05-18 05:04:41-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7
+ TAG: NTP_4_2_4P7
+
+ ChangeLog@1.1.1.90 +1 -0
+ NTP_4_2_4P7
+
+ ntpd/ntpd-opts.c@1.50.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpd/ntpd-opts.h@1.50.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpd/ntpd-opts.texi@1.49.25.1 +1 -1
+ NTP_4_2_4P7
+
+ ntpd/ntpd.1@1.48.25.1 +2 -2
+ NTP_4_2_4P7
+
+ ntpd/ntpdsim-opts.c@1.50.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpd/ntpdsim-opts.h@1.50.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpd/ntpdsim-opts.texi@1.48.25.1 +1 -1
+ NTP_4_2_4P7
+
+ ntpd/ntpdsim.1@1.48.25.1 +2 -2
+ NTP_4_2_4P7
+
+ ntpdc/ntpdc-opts.c@1.50.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpdc/ntpdc-opts.h@1.50.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpdc/ntpdc-opts.texi@1.48.25.1 +1 -1
+ NTP_4_2_4P7
+
+ ntpdc/ntpdc.1@1.48.25.1 +2 -2
+ NTP_4_2_4P7
+
+ ntpq/ntpq-opts.c@1.52.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpq/ntpq-opts.h@1.52.25.1 +4 -4
+ NTP_4_2_4P7
+
+ ntpq/ntpq-opts.texi@1.49.25.1 +1 -1
+ NTP_4_2_4P7
+
+ ntpq/ntpq.1@1.48.25.1 +2 -2
+ NTP_4_2_4P7
+
+ packageinfo.sh@1.65.33.2 +2 -2
+ NTP_4_2_4P7
+
+ sntp/sntp-opts.c@1.49.25.1 +2 -2
+ NTP_4_2_4P7
+
+ sntp/sntp-opts.h@1.49.25.1 +3 -3
+ NTP_4_2_4P7
+
+ sntp/sntp-opts.texi@1.46.25.1 +1 -1
+ NTP_4_2_4P7
+
+ sntp/sntp.1@1.49.25.1 +2 -2
+ NTP_4_2_4P7
+
+ util/ntp-keygen-opts.c@1.49.25.1 +4 -4
+ NTP_4_2_4P7
+
+ util/ntp-keygen-opts.h@1.49.25.1 +4 -4
+ NTP_4_2_4P7
+
+ util/ntp-keygen-opts.texi@1.47.25.1 +1 -1
+ NTP_4_2_4P7
+
+ util/ntp-keygen.1@1.47.25.1 +2 -2
+ NTP_4_2_4P7
+
+ChangeSet@1.1436.15.69, 2009-05-18 03:14:59-04:00, stenn@whimsy.udel.edu
+ 4.2.4p7
+
+ NEWS@1.86.1.15 +38 -0
+ 4.2.4p7
+
+ packageinfo.sh@1.65.33.1 +1 -1
+ 4.2.4p7
+
+ChangeSet@1.1436.15.68, 2009-05-18 02:56:36-04:00, stenn@whimsy.udel.edu
+ [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252
+
+ ChangeLog@1.1.1.89 +1 -0
+ [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252
+
+ ntpd/ntp_crypto.c@1.107.1.3 +22 -17
+ [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252
+
+ChangeSet@1.1436.15.67, 2009-05-18 02:24:31-04:00, stenn@whimsy.udel.edu
+ [Bug 1187] Update the copyright date.
+
+ ChangeLog@1.1.1.88 +1 -0
+ [Bug 1187] Update the copyright date.
+
+ include/copyright.def@1.5.1.3 +1 -1
+ [Bug 1187] Update the copyright date.
+
+ChangeSet@1.1436.15.66, 2009-05-17 08:59:06+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix
+ for [Sec 1149].
+
+ ChangeLog@1.1.1.87 +5 -0
+ [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix
+ for [Sec 1149].
+
+ ntpd/ntp_io.c@1.244.2.17 +45 -34
+ [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix
+ for [Sec 1149].
+
+ChangeSet@1.1860.1.2, 2009-05-15 19:54:46+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned
+
+ ChangeLog@1.325.1.2 +1 -0
+ [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned
+
+ ntpd/refclock_nmea.c@1.37 +6 -2
+ [Bug 1174] nmea_shutdown assumes that nmea has a unit assigned
+
+ChangeSet@1.1860.1.1, 2009-05-15 19:37:17+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode
+ Update NMEA documentation for a number of changes over the last year
+
+ ChangeLog@1.325.1.1 +2 -0
+ [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode
+ Update NMEA documentation for a number of changes over the last year
+
+ html/drivers/driver20.html@1.18 +18 -21
+ Update NMEA documentation for a number of changes over the last year
+
+ ntpd/refclock_nmea.c@1.36 +89 -13
+ [Bug 1190] NMEA refclock fudge flag4 1 obscures position in timecode
+
+ChangeSet@1.1436.15.65, 2009-05-14 04:42:10+00:00, davehart@shiny.ad.hartbrothers.com
+ fix error from BitKeeper/triggers/pre-resolve.licfix triggered (ahem)
+ by recent BitKeeper/etc/config delta updating repologs email address
+
+ BitKeeper/triggers/pre-resolve.licfix@1.5 +4 -1
+ bk sccscat has been removed, replaced by bk annotate -R
+ -q grep -> grep -q (untested until recent BitKeeper/etc/config commit
+ changing repologs@ntp.isc.org to repologs@ntp.org
+
+ChangeSet@1.1861, 2009-05-14 01:33:16+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ remove duplicate [Bug 1154] entry from failed first fix
+
+ ChangeLog@1.326 +0 -2
+ remove duplicate [Bug 1154] entry from failed first fix
+
+ChangeSet@1.1860, 2009-05-13 07:54:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P176
+ TAG: NTP_4_2_5P176
+
+ ChangeLog@1.325 +1 -0
+ NTP_4_2_5P176
+
+ gsoc_sntp/sntp-opts.c@1.37 +2 -2
+ NTP_4_2_5P176
+
+ gsoc_sntp/sntp-opts.h@1.37 +3 -3
+ NTP_4_2_5P176
+
+ gsoc_sntp/sntp-opts.texi@1.37 +1 -1
+ NTP_4_2_5P176
+
+ gsoc_sntp/sntp.1@1.37 +2 -2
+ NTP_4_2_5P176
+
+ ntpd/ntpd-opts.c@1.168 +2 -2
+ NTP_4_2_5P176
+
+ ntpd/ntpd-opts.h@1.168 +3 -3
+ NTP_4_2_5P176
+
+ ntpd/ntpd-opts.texi@1.167 +1 -1
+ NTP_4_2_5P176
+
+ ntpd/ntpd.1@1.167 +2 -2
+ NTP_4_2_5P176
+
+ ntpdc/ntpdc-opts.c@1.164 +2 -2
+ NTP_4_2_5P176
+
+ ntpdc/ntpdc-opts.h@1.164 +3 -3
+ NTP_4_2_5P176
+
+ ntpdc/ntpdc-opts.texi@1.163 +1 -1
+ NTP_4_2_5P176
+
+ ntpdc/ntpdc.1@1.163 +2 -2
+ NTP_4_2_5P176
+
+ ntpq/ntpq-opts.c@1.164 +2 -2
+ NTP_4_2_5P176
+
+ ntpq/ntpq-opts.h@1.164 +3 -3
+ NTP_4_2_5P176
+
+ ntpq/ntpq-opts.texi@1.163 +1 -1
+ NTP_4_2_5P176
+
+ ntpq/ntpq.1@1.163 +2 -2
+ NTP_4_2_5P176
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.45 +2 -2
+ NTP_4_2_5P176
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.45 +3 -3
+ NTP_4_2_5P176
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.45 +1 -1
+ NTP_4_2_5P176
+
+ ntpsnmpd/ntpsnmpd.1@1.45 +2 -2
+ NTP_4_2_5P176
+
+ packageinfo.sh@1.179 +1 -1
+ NTP_4_2_5P176
+
+ sntp/sntp-opts.c@1.164 +2 -2
+ NTP_4_2_5P176
+
+ sntp/sntp-opts.h@1.164 +3 -3
+ NTP_4_2_5P176
+
+ sntp/sntp-opts.texi@1.163 +1 -1
+ NTP_4_2_5P176
+
+ sntp/sntp.1@1.163 +2 -2
+ NTP_4_2_5P176
+
+ util/ntp-keygen-opts.c@1.167 +2 -2
+ NTP_4_2_5P176
+
+ util/ntp-keygen-opts.h@1.167 +3 -3
+ NTP_4_2_5P176
+
+ util/ntp-keygen-opts.texi@1.166 +1 -1
+ NTP_4_2_5P176
+
+ util/ntp-keygen.1@1.166 +2 -2
+ NTP_4_2_5P176
+
+ChangeSet@1.1845.6.2, 2009-05-12 08:57:55-04:00, utterback@pogo.udel.edu
+ ntpd.c:
+ [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for.
+
+ ntpd/ntpd.c@1.100.1.1 +29 -7
+ [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for.
+
+ChangeSet@1.1845.6.1, 2009-05-12 08:51:48-04:00, utterback@pogo.udel.edu
+ ChangeLog:
+ [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for.
+
+ ChangeLog@1.310.5.1 +2 -0
+ [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for.
+
+ChangeSet@1.1858, 2009-05-12 08:07:45-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P175
+ TAG: NTP_4_2_5P175
+
+ ChangeLog@1.323 +1 -0
+ NTP_4_2_5P175
+
+ gsoc_sntp/sntp-opts.c@1.36 +2 -2
+ NTP_4_2_5P175
+
+ gsoc_sntp/sntp-opts.h@1.36 +3 -3
+ NTP_4_2_5P175
+
+ gsoc_sntp/sntp-opts.texi@1.36 +1 -1
+ NTP_4_2_5P175
+
+ gsoc_sntp/sntp.1@1.36 +2 -2
+ NTP_4_2_5P175
+
+ ntpd/ntpd-opts.c@1.167 +2 -2
+ NTP_4_2_5P175
+
+ ntpd/ntpd-opts.h@1.167 +3 -3
+ NTP_4_2_5P175
+
+ ntpd/ntpd-opts.texi@1.166 +1 -1
+ NTP_4_2_5P175
+
+ ntpd/ntpd.1@1.166 +2 -2
+ NTP_4_2_5P175
+
+ ntpdc/ntpdc-opts.c@1.163 +2 -2
+ NTP_4_2_5P175
+
+ ntpdc/ntpdc-opts.h@1.163 +3 -3
+ NTP_4_2_5P175
+
+ ntpdc/ntpdc-opts.texi@1.162 +1 -1
+ NTP_4_2_5P175
+
+ ntpdc/ntpdc.1@1.162 +2 -2
+ NTP_4_2_5P175
+
+ ntpq/ntpq-opts.c@1.163 +2 -2
+ NTP_4_2_5P175
+
+ ntpq/ntpq-opts.h@1.163 +3 -3
+ NTP_4_2_5P175
+
+ ntpq/ntpq-opts.texi@1.162 +1 -1
+ NTP_4_2_5P175
+
+ ntpq/ntpq.1@1.162 +2 -2
+ NTP_4_2_5P175
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.44 +2 -2
+ NTP_4_2_5P175
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.44 +3 -3
+ NTP_4_2_5P175
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.44 +1 -1
+ NTP_4_2_5P175
+
+ ntpsnmpd/ntpsnmpd.1@1.44 +2 -2
+ NTP_4_2_5P175
+
+ packageinfo.sh@1.178 +1 -1
+ NTP_4_2_5P175
+
+ sntp/sntp-opts.c@1.163 +2 -2
+ NTP_4_2_5P175
+
+ sntp/sntp-opts.h@1.163 +3 -3
+ NTP_4_2_5P175
+
+ sntp/sntp-opts.texi@1.162 +1 -1
+ NTP_4_2_5P175
+
+ sntp/sntp.1@1.162 +2 -2
+ NTP_4_2_5P175
+
+ util/ntp-keygen-opts.c@1.166 +2 -2
+ NTP_4_2_5P175
+
+ util/ntp-keygen-opts.h@1.166 +3 -3
+ NTP_4_2_5P175
+
+ util/ntp-keygen-opts.texi@1.165 +1 -1
+ NTP_4_2_5P175
+
+ util/ntp-keygen.1@1.165 +2 -2
+ NTP_4_2_5P175
+
+ChangeSet@1.1857, 2009-05-12 05:37:53-04:00, stenn@whimsy.udel.edu
+ Merge cleanup
+
+ ChangeLog@1.322 +1 -0
+ Merge cleanup
+
+ChangeSet@1.1436.15.64, 2009-05-12 02:41:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7_RC7
+ TAG: NTP_4_2_4P7_RC7
+
+ ChangeLog@1.1.1.86 +1 -0
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpd-opts.c@1.50.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpd-opts.h@1.50.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpd-opts.texi@1.49.24.1 +1 -1
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpd.1@1.48.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpdsim-opts.c@1.50.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpdsim-opts.h@1.50.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpdsim-opts.texi@1.48.24.1 +1 -1
+ NTP_4_2_4P7_RC7
+
+ ntpd/ntpdsim.1@1.48.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpdc/ntpdc-opts.c@1.50.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpdc/ntpdc-opts.h@1.50.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpdc/ntpdc-opts.texi@1.48.24.1 +1 -1
+ NTP_4_2_4P7_RC7
+
+ ntpdc/ntpdc.1@1.48.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpq/ntpq-opts.c@1.52.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpq/ntpq-opts.h@1.52.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ ntpq/ntpq-opts.texi@1.49.24.1 +1 -1
+ NTP_4_2_4P7_RC7
+
+ ntpq/ntpq.1@1.48.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ packageinfo.sh@1.65.32.1 +1 -1
+ NTP_4_2_4P7_RC7
+
+ sntp/sntp-opts.c@1.49.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ sntp/sntp-opts.h@1.49.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ sntp/sntp-opts.texi@1.46.24.1 +1 -1
+ NTP_4_2_4P7_RC7
+
+ sntp/sntp.1@1.49.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ util/ntp-keygen-opts.c@1.49.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ util/ntp-keygen-opts.h@1.49.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ util/ntp-keygen-opts.texi@1.47.24.1 +1 -1
+ NTP_4_2_4P7_RC7
+
+ util/ntp-keygen.1@1.47.24.1 +3 -3
+ NTP_4_2_4P7_RC7
+
+ChangeSet@1.1436.15.63, 2009-05-12 01:07:37-04:00, stenn@whimsy.udel.edu
+ ntp.isc.org -> ntp.org cleanup
+
+ BitKeeper/etc/config@1.10 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ ChangeLog@1.1.1.85 +1 -0
+ ntp.isc.org -> ntp.org cleanup
+
+ README@1.22.1.1 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ README.bk@1.18.1.1 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ README.patches@1.3.1.1 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ WHERE-TO-START@1.6.1.1 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ configure.ac@1.400.1.18 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ include/copyright.def@1.5.1.2 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ sntp/sntp-opts.def@1.10.1.1 +1 -1
+ ntp.isc.org -> ntp.org cleanup
+
+ChangeSet@1.1845.5.1, 2009-05-11 21:43:27-04:00, stenn@whimsy.udel.edu
+ [Bug 1182] Documentation typos and missing bits
+
+ ChangeLog@1.310.4.1 +1 -0
+ [Bug 1182] Documentation typos and missing bits
+
+ html/accopt.html@1.28 +120 -67
+ [Bug 1182] Documentation typos and missing bits
+
+ html/decode.html@1.9 +37 -25
+ [Bug 1182] Documentation typos and missing bits
+
+ html/monopt.html@1.30 +511 -457
+ [Bug 1182] Documentation typos and missing bits
+
+ChangeSet@1.1845.4.2, 2009-05-12 00:58:59+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1183] COM port support should extend past COM3
+
+ ChangeLog@1.310.3.2 +1 -0
+ [Bug 1183] COM port support should extend past COM3
+
+ libisc/sockaddr.c@1.6 +1 -1
+ silence truncation warning
+
+ ntpd/ntp_control.c@1.110 +1 -1
+ silence truncation warning
+
+ ntpd/ntp_peer.c@1.117 +7 -10
+ silence truncation warnings, use NULL not 0 for pointers
+
+ ntpd/ntp_refclock.c@1.86 +57 -81
+ [Bug 1183] COM port support should extend past COM3
+ silence a few truncation warnings, clean up indents
+
+ ntpd/ntp_scanner.c@1.20 +0 -1
+ remove dead code "return 1" at end of yylex(), silencing warning and
+ allowing the compiler to catch any future change which revives it, as
+ then the compiler would error on the missing "return"
+
+ ntpd/ntpd.c@1.101 +2 -2
+ fix leading whitespace, correct #endif comment
+
+ ports/winnt/include/config.h@1.62.1.1 +1 -1
+ disable CLOCK_DUMBCLOCK on Windows, it needs work first
+
+ ports/winnt/ntpd/win32_io.c@1.16 +6 -4
+ [Bug 1183] COM port support should extend past COM3
+
+ChangeSet@1.1845.2.5, 2009-05-11 19:01:24+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1184] ntpd is deaf when restricted to second IP on the same net
+
+ ChangeLog@1.310.2.3 +1 -0
+ [Bug 1184] ntpd is deaf when restricted to second IP on the same net
+
+ include/ntp.h@1.155 +10 -9
+ add indents, parentheses to clarify SOCKCMP macro
+
+ ntpd/ntp_io.c@1.283 +163 -34
+ [Bug 1184] ntpd is deaf when restricted to second IP on the same net
+
+ChangeSet@1.1845.2.4, 2009-05-09 17:54:29+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ correct config.h comment quoting
+
+ configure.ac@1.441.2.2 +7 -7
+ correct config.h comment quoting, use AS_HELP_STRING
+
+ChangeSet@1.1845.4.1, 2009-05-09 07:55:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P174
+ TAG: NTP_4_2_5P174
+
+ ChangeLog@1.310.3.1 +1 -0
+ NTP_4_2_5P174
+
+ gsoc_sntp/sntp-opts.c@1.35 +2 -2
+ NTP_4_2_5P174
+
+ gsoc_sntp/sntp-opts.h@1.35 +3 -3
+ NTP_4_2_5P174
+
+ gsoc_sntp/sntp-opts.texi@1.35 +1 -1
+ NTP_4_2_5P174
+
+ gsoc_sntp/sntp.1@1.35 +2 -2
+ NTP_4_2_5P174
+
+ ntpd/ntpd-opts.c@1.166 +2 -2
+ NTP_4_2_5P174
+
+ ntpd/ntpd-opts.h@1.166 +3 -3
+ NTP_4_2_5P174
+
+ ntpd/ntpd-opts.texi@1.165 +1 -1
+ NTP_4_2_5P174
+
+ ntpd/ntpd.1@1.165 +2 -2
+ NTP_4_2_5P174
+
+ ntpdc/ntpdc-opts.c@1.162 +2 -2
+ NTP_4_2_5P174
+
+ ntpdc/ntpdc-opts.h@1.162 +3 -3
+ NTP_4_2_5P174
+
+ ntpdc/ntpdc-opts.texi@1.161 +1 -1
+ NTP_4_2_5P174
+
+ ntpdc/ntpdc.1@1.161 +2 -2
+ NTP_4_2_5P174
+
+ ntpq/ntpq-opts.c@1.162 +2 -2
+ NTP_4_2_5P174
+
+ ntpq/ntpq-opts.h@1.162 +3 -3
+ NTP_4_2_5P174
+
+ ntpq/ntpq-opts.texi@1.161 +1 -1
+ NTP_4_2_5P174
+
+ ntpq/ntpq.1@1.161 +2 -2
+ NTP_4_2_5P174
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.43 +2 -2
+ NTP_4_2_5P174
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.43 +3 -3
+ NTP_4_2_5P174
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.43 +1 -1
+ NTP_4_2_5P174
+
+ ntpsnmpd/ntpsnmpd.1@1.43 +2 -2
+ NTP_4_2_5P174
+
+ packageinfo.sh@1.177 +1 -1
+ NTP_4_2_5P174
+
+ sntp/sntp-opts.c@1.162 +2 -2
+ NTP_4_2_5P174
+
+ sntp/sntp-opts.h@1.162 +3 -3
+ NTP_4_2_5P174
+
+ sntp/sntp-opts.texi@1.161 +1 -1
+ NTP_4_2_5P174
+
+ sntp/sntp.1@1.161 +2 -2
+ NTP_4_2_5P174
+
+ util/ntp-keygen-opts.c@1.165 +2 -2
+ NTP_4_2_5P174
+
+ util/ntp-keygen-opts.h@1.165 +3 -3
+ NTP_4_2_5P174
+
+ util/ntp-keygen-opts.texi@1.164 +1 -1
+ NTP_4_2_5P174
+
+ util/ntp-keygen.1@1.164 +2 -2
+ NTP_4_2_5P174
+
+ChangeSet@1.1845.2.3, 2009-05-09 09:00:06+00:00, davehart@shiny.ad.hartbrothers.com
+ add --disable-listen-read-drop configure option for machines with more
+ interfaces than FD_SETSIZE [Bug 1180]
+
+ ChangeLog@1.310.2.2 +1 -0
+ [Bug 1180] ntpd won't start with more than ~1000 interfaces
+
+ configure.ac@1.441.2.1 +18 -0
+ add --disable-listen-read-drop configure option for machines with more
+ interfaces than FD_SETSIZE [Bug 1180]
+
+ ntpd/ntp_io.c@1.282 +27 -7
+ add --disable-listen-read-drop configure option for machines with more
+ interfaces than FD_SETSIZE [Bug 1180]
+
+ ports/winnt/ntpd/ntpd.vcproj@1.5 +4 -22
+ relocate cmd_args.c from ntpd header files to ntp source code in VS
+
+ChangeSet@1.1845.3.1, 2009-05-08 22:44:33+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_io.c:
+ make -I override -L, do not listen on unused interfaces
+
+ ntpd/ntp_io.c@1.281 +9 -16
+ make -I override -L, do not listen on unused interfaces
+
+ChangeSet@1.1845.2.1, 2009-05-08 17:32:49-04:00, stenn@whimsy.udel.edu
+ Stale leapsecond file fixes from Dave Mills
+
+ ChangeLog@1.310.2.1 +1 -0
+ Stale leapsecond file fixes from Dave Mills
+
+ html/decode.html@1.8 +844 -683
+ Stale leapsecond file fixes from Dave Mills
+
+ include/ntp.h@1.154 +4 -0
+ Stale leapsecond file fixes from Dave Mills
+
+ include/ntpd.h@1.126 +1 -0
+ Stale leapsecond file fixes from Dave Mills
+
+ libntp/statestr.c@1.16 +3 -0
+ Stale leapsecond file fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.109 +2 -2
+ Stale leapsecond file fixes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.134 +8 -1
+ Stale leapsecond file fixes from Dave Mills
+
+ ntpd/ntp_timer.c@1.51.1.1 +5 -1
+ Stale leapsecond file fixes from Dave Mills
+
+ ntpd/ntp_util.c@1.70 +33 -7
+ Stale leapsecond file fixes from Dave Mills
+
+ChangeSet@1.1436.23.1, 2009-05-08 18:11:36+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ correct help text
+
+ configure.ac@1.400.2.1 +11 -5
+ correct help text
+
+ChangeSet@1.1436.15.61, 2009-05-08 17:50:37+00:00, davehart@shiny.ad.hartbrothers.com
+ add configure --enable-ignore-dns-errors to retry on any failure
+
+ ChangeLog@1.1.1.84 +2 -1
+ add configure --enable-ignore-dns-errors to retry on any failure
+
+ configure.ac@1.400.1.16 +26 -4
+ add configure --enable-ignore-dns-errors to retry on any failure
+
+ ntpd/ntp_intres.c@1.48.1.7 +2 -0
+ add configure --enable-ignore-dns-errors to retry on any failure
+
+ChangeSet@1.1436.15.60, 2009-05-08 15:34:46+00:00, davehart@shiny.ad.hartbrothers.com
+ Do not exceed FD_SETSIZE in ntp_intres.c
+ ---
+ ntp_intres.c:
+ typo
+ ---
+ ntp_intres.c:
+ missing comma typo
+ ---
+ ntp_intres.c:
+ typo
+
+ ntpd/ntp_intres.c@1.48.1.6 +64 -33
+ fix typos, refine "host name not found" log message, stay under FD_SETSIZE
+
+ ntpd/ntp_request.c@1.65.1.2 +21 -3
+ after ntp_intres adds a server entry, rescan interfaces, to notice the
+ return of connectivity sooner.
+
+ ntpd/ntp_timer.c@1.33.1.1 +3 -5
+ indent cleanup
+
+ ports/winnt/include/config.h@1.46.1.6 +4 -10
+ remove FORCE_DNSRETRY, no longer used
+ indent cleanup
+
+ChangeSet@1.1845.1.8, 2009-05-08 08:07:08-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P173
+ TAG: NTP_4_2_5P173
+
+ ChangeLog@1.310.1.6 +1 -0
+ NTP_4_2_5P173
+
+ gsoc_sntp/sntp-opts.c@1.34 +2 -2
+ NTP_4_2_5P173
+
+ gsoc_sntp/sntp-opts.h@1.34 +3 -3
+ NTP_4_2_5P173
+
+ gsoc_sntp/sntp-opts.texi@1.34 +1 -1
+ NTP_4_2_5P173
+
+ gsoc_sntp/sntp.1@1.34 +2 -2
+ NTP_4_2_5P173
+
+ ntpd/ntpd-opts.c@1.165 +2 -2
+ NTP_4_2_5P173
+
+ ntpd/ntpd-opts.h@1.165 +3 -3
+ NTP_4_2_5P173
+
+ ntpd/ntpd-opts.texi@1.164 +2 -2
+ NTP_4_2_5P173
+
+ ntpd/ntpd.1@1.164 +2 -2
+ NTP_4_2_5P173
+
+ ntpdc/ntpdc-opts.c@1.161 +2 -2
+ NTP_4_2_5P173
+
+ ntpdc/ntpdc-opts.h@1.161 +3 -3
+ NTP_4_2_5P173
+
+ ntpdc/ntpdc-opts.texi@1.160 +2 -2
+ NTP_4_2_5P173
+
+ ntpdc/ntpdc.1@1.160 +2 -2
+ NTP_4_2_5P173
+
+ ntpq/ntpq-opts.c@1.161 +2 -2
+ NTP_4_2_5P173
+
+ ntpq/ntpq-opts.h@1.161 +3 -3
+ NTP_4_2_5P173
+
+ ntpq/ntpq-opts.texi@1.160 +2 -2
+ NTP_4_2_5P173
+
+ ntpq/ntpq.1@1.160 +2 -2
+ NTP_4_2_5P173
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.42 +2 -2
+ NTP_4_2_5P173
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.42 +3 -3
+ NTP_4_2_5P173
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.42 +1 -1
+ NTP_4_2_5P173
+
+ ntpsnmpd/ntpsnmpd.1@1.42 +2 -2
+ NTP_4_2_5P173
+
+ packageinfo.sh@1.176 +1 -1
+ NTP_4_2_5P173
+
+ sntp/sntp-opts.c@1.161 +2 -2
+ NTP_4_2_5P173
+
+ sntp/sntp-opts.h@1.161 +3 -3
+ NTP_4_2_5P173
+
+ sntp/sntp-opts.texi@1.160 +1 -1
+ NTP_4_2_5P173
+
+ sntp/sntp.1@1.160 +2 -2
+ NTP_4_2_5P173
+
+ util/ntp-keygen-opts.c@1.164 +2 -2
+ NTP_4_2_5P173
+
+ util/ntp-keygen-opts.h@1.164 +3 -3
+ NTP_4_2_5P173
+
+ util/ntp-keygen-opts.texi@1.163 +2 -2
+ NTP_4_2_5P173
+
+ util/ntp-keygen.1@1.163 +2 -2
+ NTP_4_2_5P173
+
+ChangeSet@1.1436.22.1, 2009-05-08 11:24:43+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime
+
+ ChangeLog@1.1.17.1 +4 -0
+ [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime
+
+ ntpd/ntp_intres.c@1.48.1.5 +53 -55
+ [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime
+
+ChangeSet@1.1436.15.58, 2009-05-08 04:42:52-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7_RC6
+ TAG: NTP_4_2_4P7_RC6
+
+ ChangeLog@1.1.1.82 +1 -0
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpd-opts.c@1.50.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpd-opts.h@1.50.23.1 +3 -3
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpd-opts.texi@1.49.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpd.1@1.48.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpdsim-opts.c@1.50.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpdsim-opts.h@1.50.23.1 +3 -3
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpdsim-opts.texi@1.48.23.1 +1 -1
+ NTP_4_2_4P7_RC6
+
+ ntpd/ntpdsim.1@1.48.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpdc/ntpdc-opts.c@1.50.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpdc/ntpdc-opts.h@1.50.23.1 +3 -3
+ NTP_4_2_4P7_RC6
+
+ ntpdc/ntpdc-opts.texi@1.48.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpdc/ntpdc.1@1.48.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpq/ntpq-opts.c@1.52.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpq/ntpq-opts.h@1.52.23.1 +3 -3
+ NTP_4_2_4P7_RC6
+
+ ntpq/ntpq-opts.texi@1.49.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ ntpq/ntpq.1@1.48.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ packageinfo.sh@1.65.31.1 +1 -1
+ NTP_4_2_4P7_RC6
+
+ sntp/sntp-opts.c@1.49.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ sntp/sntp-opts.h@1.49.23.1 +3 -3
+ NTP_4_2_4P7_RC6
+
+ sntp/sntp-opts.texi@1.46.23.1 +1 -1
+ NTP_4_2_4P7_RC6
+
+ sntp/sntp.1@1.49.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ util/ntp-keygen-opts.c@1.49.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ util/ntp-keygen-opts.h@1.49.23.1 +3 -3
+ NTP_4_2_4P7_RC6
+
+ util/ntp-keygen-opts.texi@1.47.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ util/ntp-keygen.1@1.47.23.1 +2 -2
+ NTP_4_2_4P7_RC6
+
+ChangeSet@1.1436.15.57, 2009-05-08 03:29:16-04:00, stenn@pogo.udel.edu
+ typo
+
+ ChangeLog@1.1.1.81 +1 -1
+ typo
+
+ChangeSet@1.1436.15.56, 2009-05-08 02:13:17+00:00, davehart@shiny.ad.hartbrothers.com
+ Add [Bug 1071] reference to ChangeLog entry
+
+ ChangeLog@1.1.1.80 +2 -2
+ [Bug 1071] Log a message and exit before trying to use FD_SET with a
+ descriptor larger than FD_SETSIZE, which will corrupt memory
+ (adds reference to 1071 to existing description)
+
+ChangeSet@1.1436.15.55, 2009-05-08 01:23:43+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1179] error messages for -u/--user and -i when built w/o droproot
+
+ ChangeLog@1.1.1.79 +1 -0
+ [Bug 1179] error messages for -u/--user and -i when built w/o droproot
+
+ ntpd/cmd_args.c@1.45.3.4 +39 -19
+ descriptive error messages for -u/--user and -i without droproot
+
+ChangeSet@1.1436.15.54, 2009-05-07 22:15:41+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_io.c: do not use FD_SET beyond FD_SETSIZE, watch for corruption of inter_list.head
+
+ ChangeLog@1.1.1.78 +3 -0
+ do not use FD_SET beyond FD_SETSIZE, watch for corruption of inter_list.head
+
+ ntpd/ntp_io.c@1.244.2.16 +23 -0
+ do not use FD_SET beyond FD_SETSIZE, watch for corruption of inter_list.head
+
+ChangeSet@1.1436.15.53, 2009-05-07 07:39:41+00:00, davehart@shiny.ad.hartbrothers.com
+ refclock_jjy.c:
+ add missing newline before EOF
+
+ ntpd/refclock_jjy.c@1.13.1.2 +1 -1
+ add missing newline before EOF
+
+ChangeSet@1.1845.1.2, 2009-05-07 05:58:42+00:00, davehart@shiny.ad.hartbrothers.com
+ refclock_jjy.c merge from stable cleanup
+
+ ntpd/refclock_jjy.c@1.16 +1 -0
+ dropped a prototype in merge from stable
+
+ ports/winnt/ntp.sln@1.3 +4 -4
+ moving ntpd.vcproj to be listed first should make it the default project
+
+ ports/winnt/ntpd/ntpd.vcproj@1.4 +4 -0
+ add refclock_jjy.c reference
+
+ChangeSet@1.1436.15.52, 2009-05-07 05:19:36+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 784] Make --enable-linuxcaps the default when available
+ add reference to refclock_jjy.c to ports/winnt/ntpd/ntpd.vcproj
+
+ ChangeLog@1.1.1.77 +1 -0
+ [Bug 784] Make --enable-linuxcaps the default when available
+
+ configure.ac@1.400.1.15 +34 -33
+ [Bug 784] Make --enable-linuxcaps the default when available
+
+ ports/winnt/ntpd/ntpd.vcproj@1.1.1.1 +4 -0
+ add reference to refclock_jjy.c to ports/winnt/ntpd/ntpd.vcproj
+
+ChangeSet@1.1436.15.51, 2009-05-07 05:10:54+00:00, davehart@shiny.ad.hartbrothers.com
+ Updated JJY reference clock driver from Takao abe
+ Make ntpd the default project in Visual C++/Visual Studio
+
+ ChangeLog@1.1.1.76 +4 -0
+ Updated JJY reference clock driver from Takao abe
+
+ html/drivers/driver40.html@1.14 +103 -48
+ Updated JJY reference clock driver from Takao abe
+
+ ntpd/refclock_jjy.c@1.13.1.1 +153 -5
+ Updated JJY reference clock driver from Takao abe
+
+ ports/winnt/ntp.sln@1.1.1.1 +4 -4
+ Make ntpd the default project in Visual C++/Visual Studio
+
+ChangeSet@1.1846, 2009-05-06 17:29:45+00:00, davehart@shiny.ad.hartbrothers.com
+ Simplify configure.ac NTP_CACHEVERSION interface, update comments
+
+ ChangeLog@1.311 +2 -0
+ Clean up configure.ac NTP_CACHEVERSION interface, display cache version
+ when clearing. Fixes a regression.
+
+
+ configure.ac@1.442 +16 -25
+ Simplify configure.ac NTP_CACHEVERSION interface, update comments
+
+ gsoc_sntp/configure.ac@1.17 +16 -14
+ Simplify configure.ac NTP_CACHEVERSION interface, update comments
+
+ m4/ntp_cacheversion.m4@1.8 +18 -48
+ Simplify configure.ac NTP_CACHEVERSION interface, display cache version
+ for top configure when clearing due to mismatch (fix regression)
+
+ sntp/configure.ac@1.23 +19 -17
+ Simplify configure.ac NTP_CACHEVERSION interface, update comments
+
+ChangeSet@1.1845, 2009-05-06 07:55:27-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P172
+ TAG: NTP_4_2_5P172
+
+ ChangeLog@1.310 +1 -0
+ NTP_4_2_5P172
+
+ gsoc_sntp/sntp-opts.c@1.33 +2 -2
+ NTP_4_2_5P172
+
+ gsoc_sntp/sntp-opts.h@1.33 +3 -3
+ NTP_4_2_5P172
+
+ gsoc_sntp/sntp-opts.texi@1.33 +1 -1
+ NTP_4_2_5P172
+
+ gsoc_sntp/sntp.1@1.33 +2 -2
+ NTP_4_2_5P172
+
+ ntpd/ntpd-opts.c@1.164 +2 -2
+ NTP_4_2_5P172
+
+ ntpd/ntpd-opts.h@1.164 +3 -3
+ NTP_4_2_5P172
+
+ ntpd/ntpd-opts.texi@1.163 +2 -2
+ NTP_4_2_5P172
+
+ ntpd/ntpd.1@1.163 +2 -2
+ NTP_4_2_5P172
+
+ ntpdc/ntpdc-opts.c@1.160 +2 -2
+ NTP_4_2_5P172
+
+ ntpdc/ntpdc-opts.h@1.160 +3 -3
+ NTP_4_2_5P172
+
+ ntpdc/ntpdc-opts.texi@1.159 +2 -2
+ NTP_4_2_5P172
+
+ ntpdc/ntpdc.1@1.159 +2 -2
+ NTP_4_2_5P172
+
+ ntpq/ntpq-opts.c@1.160 +2 -2
+ NTP_4_2_5P172
+
+ ntpq/ntpq-opts.h@1.160 +3 -3
+ NTP_4_2_5P172
+
+ ntpq/ntpq-opts.texi@1.159 +2 -2
+ NTP_4_2_5P172
+
+ ntpq/ntpq.1@1.159 +2 -2
+ NTP_4_2_5P172
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.41 +2 -2
+ NTP_4_2_5P172
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.41 +3 -3
+ NTP_4_2_5P172
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.41 +1 -1
+ NTP_4_2_5P172
+
+ ntpsnmpd/ntpsnmpd.1@1.41 +2 -2
+ NTP_4_2_5P172
+
+ packageinfo.sh@1.175 +1 -1
+ NTP_4_2_5P172
+
+ sntp/sntp-opts.c@1.160 +2 -2
+ NTP_4_2_5P172
+
+ sntp/sntp-opts.h@1.160 +3 -3
+ NTP_4_2_5P172
+
+ sntp/sntp-opts.texi@1.159 +1 -1
+ NTP_4_2_5P172
+
+ sntp/sntp.1@1.159 +2 -2
+ NTP_4_2_5P172
+
+ util/ntp-keygen-opts.c@1.163 +2 -2
+ NTP_4_2_5P172
+
+ util/ntp-keygen-opts.h@1.163 +3 -3
+ NTP_4_2_5P172
+
+ util/ntp-keygen-opts.texi@1.162 +2 -2
+ NTP_4_2_5P172
+
+ util/ntp-keygen.1@1.162 +2 -2
+ NTP_4_2_5P172
+
+ChangeSet@1.1844, 2009-05-06 02:47:31-04:00, stenn@whimsy.udel.edu
+ [Bug 1175] Instability in PLL daemon mode
+
+ ChangeLog@1.309 +2 -1
+ [Bug 1175] Instability in PLL daemon mode
+
+ include/Makefile.am@1.33 +57 -55
+ typo
+
+ include/ntpd.h@1.125 +1 -1
+ [Bug 1175] Instability in PLL daemon mode
+
+ ntpd/ntp_loopfilter.c@1.150 +14 -12
+ [Bug 1175] Instability in PLL daemon mode
+
+ ntpd/ntp_proto.c@1.285 +1 -1
+ [Bug 1175] Instability in PLL daemon mode
+
+ChangeSet@1.1840.1.1, 2009-05-05 21:07:51+00:00, davehart@shiny.ad.hartbrothers.com
+ Makefile.am:
+ add new file ntp_lineedit.h to noinst_HEADERS
+
+ include/Makefile.am@1.32 +1 -0
+ add new file ntp_lineedit.h to noinst_HEADERS
+
+ChangeSet@1.1842, 2009-05-05 19:19:25+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1176] refclock_parse.c does not compile without PPSAPI
+
+ ChangeLog@1.308 +1 -0
+ [Bug 1176] refclock_parse.c does not compile without PPSAPI
+
+ ntpd/refclock_parse.c@1.51 +2 -0
+ [Bug 1176] refclock_parse.c does not compile without PPSAPI
+
+ChangeSet@1.1841, 2009-05-04 08:02:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P171
+ TAG: NTP_4_2_5P171
+
+ ChangeLog@1.307 +1 -0
+ NTP_4_2_5P171
+
+ gsoc_sntp/sntp-opts.c@1.32 +2 -2
+ NTP_4_2_5P171
+
+ gsoc_sntp/sntp-opts.h@1.32 +3 -3
+ NTP_4_2_5P171
+
+ gsoc_sntp/sntp-opts.texi@1.32 +1 -1
+ NTP_4_2_5P171
+
+ gsoc_sntp/sntp.1@1.32 +2 -2
+ NTP_4_2_5P171
+
+ ntpd/ntpd-opts.c@1.163 +2 -2
+ NTP_4_2_5P171
+
+ ntpd/ntpd-opts.h@1.163 +3 -3
+ NTP_4_2_5P171
+
+ ntpd/ntpd-opts.texi@1.162 +2 -2
+ NTP_4_2_5P171
+
+ ntpd/ntpd.1@1.162 +2 -2
+ NTP_4_2_5P171
+
+ ntpdc/ntpdc-opts.c@1.159 +2 -2
+ NTP_4_2_5P171
+
+ ntpdc/ntpdc-opts.h@1.159 +3 -3
+ NTP_4_2_5P171
+
+ ntpdc/ntpdc-opts.texi@1.158 +2 -2
+ NTP_4_2_5P171
+
+ ntpdc/ntpdc.1@1.158 +2 -2
+ NTP_4_2_5P171
+
+ ntpq/ntpq-opts.c@1.159 +2 -2
+ NTP_4_2_5P171
+
+ ntpq/ntpq-opts.h@1.159 +3 -3
+ NTP_4_2_5P171
+
+ ntpq/ntpq-opts.texi@1.158 +2 -2
+ NTP_4_2_5P171
+
+ ntpq/ntpq.1@1.158 +2 -2
+ NTP_4_2_5P171
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.40 +2 -2
+ NTP_4_2_5P171
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.40 +3 -3
+ NTP_4_2_5P171
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.40 +1 -1
+ NTP_4_2_5P171
+
+ ntpsnmpd/ntpsnmpd.1@1.40 +2 -2
+ NTP_4_2_5P171
+
+ packageinfo.sh@1.174 +1 -1
+ NTP_4_2_5P171
+
+ sntp/sntp-opts.c@1.159 +2 -2
+ NTP_4_2_5P171
+
+ sntp/sntp-opts.h@1.159 +3 -3
+ NTP_4_2_5P171
+
+ sntp/sntp-opts.texi@1.158 +1 -1
+ NTP_4_2_5P171
+
+ sntp/sntp.1@1.158 +2 -2
+ NTP_4_2_5P171
+
+ util/ntp-keygen-opts.c@1.162 +2 -2
+ NTP_4_2_5P171
+
+ util/ntp-keygen-opts.h@1.162 +3 -3
+ NTP_4_2_5P171
+
+ util/ntp-keygen-opts.texi@1.161 +2 -2
+ NTP_4_2_5P171
+
+ util/ntp-keygen.1@1.161 +2 -2
+ NTP_4_2_5P171
+
+ChangeSet@1.1837.1.2, 2009-05-04 06:41:39+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_cacheversion.m4:
+ iterate to find the quoting problem
+
+ m4/ntp_cacheversion.m4@1.7 +8 -8
+ iterate to find the quoting problem
+
+ChangeSet@1.1837.1.1, 2009-05-04 06:23:22+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_cacheversion.m4:
+ m4 goes infinite
+
+ m4/ntp_cacheversion.m4@1.6 +11 -11
+ m4 goes infinite
+
+ChangeSet@1.1837, 2009-05-04 02:05:29+00:00, davehart@shiny.ad.hartbrothers.com
+ solve occasional sntp link problems with socket APIs by bringing its
+ AC_SEARCH_LIBS for gethostent in line with main and gsoc_sntp configure
+ tests, bump sntp/configure.ac cache version to 20090503 as a result
+ ---
+ ntp_cacheversion.m4: clear even other version stamps when flushing
+ cache iff we are the top configure this invocation.
+
+
+ ChangeLog@1.305 +3 -1
+ Fix msntp link problem on Solaris when configured before parent
+
+ configure.ac@1.439.1.1 +22 -1
+ finally an idiom for "default to null not unset" that works
+ ---
+ bump cache version due to changes in sntp and gsoc_sntp gethostent
+ library search order, the result of which is cached and shared with
+ this configure.
+
+ gsoc_sntp/configure.ac@1.16 +5 -4
+ make gethostent library search compatible with parent configure, and
+ bump cache version because it is cached.
+
+ m4/ntp_cacheversion.m4@1.5 +67 -36
+ clear even other version stamps when flushing cache iff we are the
+ top configure this invocation. Prevents bump of child version stamp
+ and parent version stamp at the same time from causing a useless
+ second flush by the child just after the parent has recreated it from
+ empty.
+
+ sntp/configure.ac@1.22 +15 -2
+ solve occasional sntp link problems with socket APIs by bringing its
+ AC_SEARCH_LIBS for gethostent in line with main and gsoc_sntp configure
+ ---
+ bump config.cache version for incompatible gethostent library search
+
+ChangeSet@1.1833.2.1, 2009-05-03 15:21:37-04:00, stenn@whimsy.udel.edu
+ Autokey documentation cleanup from Dave Mills
+
+ ChangeLog@1.302.2.1 +1 -0
+ Autokey documentation cleanup from Dave Mills
+
+ html/authopt.html@1.49 +345 -217
+ Autokey documentation cleanup from Dave Mills
+
+ html/decode.html@1.7 +8 -8
+ Autokey documentation cleanup from Dave Mills
+
+ html/rate.html@1.5 +4 -2
+ Autokey documentation cleanup from Dave Mills
+
+ html/xleave.html@1.4 +4 -2
+ Autokey documentation cleanup from Dave Mills
+
+ChangeSet@1.1835, 2009-05-03 14:43:41+00:00, davehart@shiny.ad.hartbrothers.com
+ reliably detect invocation of child configure (NTP_CONFIGURE_PARENT)
+
+ gsoc_sntp/configure.ac@1.15 +10 -0
+ reliably detect invocation of child configure (NTP_CONFIGURE_PARENT)
+
+ m4/ntp_cacheversion.m4@1.4 +44 -17
+ reliably detect invocation of child configure (NTP_CONFIGURE_PARENT)
+
+ sntp/configure.ac@1.21 +10 -0
+ reliably detect invocation of child configure (NTP_CONFIGURE_PARENT)
+
+ChangeSet@1.1833.1.5, 2009-05-03 09:15:12+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_lineedit.c:
+ remove leftover of another approach
+
+ libntp/ntp_lineedit.c@1.5 +0 -2
+ remove leftover of another approach
+
+ChangeSet@1.1833.1.4, 2009-05-03 08:37:39+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_lineedit.c:
+ emit newline at interactive EOF to avoid ntpq> osprompt$
+ ---
+ ntp_lineedit.c:
+ alternating between readline and stone hammers is not good
+ ---
+ ntp_lineedit.c:
+ keep preprocessor # in column one, fix readline path bug
+
+ libntp/ntp_lineedit.c@1.4 +102 -92
+ emit newline at interactive EOF to avoid ntpq> osprompt$
+ ---
+ alternating between readline and stone hammers is not good
+ ---
+ keep preprocessor # in column one, fix readline path bug
+
+ChangeSet@1.1833.1.3, 2009-05-03 06:25:51+00:00, davehart@shiny.ad.hartbrothers.com
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ libparse/clk_computime.c@1.10 +1 -1
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ libparse/clk_dcf7000.c@1.10 +1 -1
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ libparse/clk_hopf6021.c@1.10 +1 -1
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ libparse/clk_rcc8000.c@1.10 +1 -1
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ libparse/clk_schmid.c@1.10 +1 -1
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ libparse/clk_trimtaip.c@1.10 +1 -1
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ libparse/clk_varitext.c@1.9 +1 -1
+ void printf(...) -> int printf(...) quiets gcc warning
+ ../../libparse/clk_computime.c:57: warning: conflicting types for built-in function 'printf'
+
+ ports/winnt/ntpd/ntpd.vcproj@1.3 +12 -0
+ add libparse/clk_varitext.c (excluded from Windows build)
+
+ChangeSet@1.1833.1.2, 2009-05-03 05:08:34+00:00, davehart@shiny.ad.hartbrothers.com
+ ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy'
+ ../../libparse/parse.c:211: warning: incompatible implicit declaration of built-
+ in function 'bcopy'
+
+ #include <stdlib.h> in ntp_lineedit.c which uses free()
+
+ configure.ac@1.440 +1 -0
+ ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy'
+ ../../libparse/parse.c:211: warning: incompatible implicit declaration of built-
+ in function 'bcopy'
+
+
+ include/ntp_string.h@1.4 +12 -5
+ ../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy'
+ ../../libparse/parse.c:211: warning: incompatible implicit declaration of built-
+ in function 'bcopy'
+
+
+ libntp/ntp_lineedit.c@1.3 +1 -0
+ implicit free decl warning
+
+ChangeSet@1.1833.1.1, 2009-05-03 01:47:51+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1171] line editing in ntpq/ntpdc
+ [Bug 1173] NMEA PPSAPI fails on Solaris
+
+ ChangeLog@1.302.1.1 +2 -0
+ [Bug 1171] [Bug 1173]
+
+ include/ntp_lineedit.h@1.1 +13 -0
+ centralize ntpq/ntpdc interactive line editing
+
+ include/ntp_lineedit.h@1.0 +0 -0
+
+ libntp/Makefile.am@1.43 +1 -1
+ add libntp/ntp_lineedit.c
+
+ libntp/ntp_lineedit.c@1.2 +13 -6
+ always return a non-empty string or NULL
+
+ libntp/ntp_lineedit.c@1.1 +227 -0
+ centralize ntpq/ntpdc interactive line editing
+
+ libntp/ntp_lineedit.c@1.0 +0 -0
+
+ m4/ntp_lineeditlibs.m4@1.6 +53 -53
+ [Bug 1171]
+
+ ntpd/refclock_nmea.c@1.35 +1 -0
+ [Bug 1173] set pps_params.api_version = PPS_API_VERS_1 before calling pps_params
+
+ ntpdc/ntpdc.c@1.62 +9 -30
+ [Bug 1171]
+
+ ntpq/ntpq.c@1.84 +10 -30
+ [Bug 1171]
+
+ ports/winnt/libntp/libntp.vcproj@1.5 +8 -0
+ add ntp_lineedit.c ntp_lineedit.h references
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.3 +4 -0
+ add ntp_lineedit.h reference
+
+ ports/winnt/ntpq/ntpq.vcproj@1.3 +4 -0
+ add ntp_lineedit.h reference
+
+ChangeSet@1.1833, 2009-05-02 08:06:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P170
+ TAG: NTP_4_2_5P170
+
+ ChangeLog@1.302 +1 -0
+ NTP_4_2_5P170
+
+ gsoc_sntp/sntp-opts.c@1.31 +2 -2
+ NTP_4_2_5P170
+
+ gsoc_sntp/sntp-opts.h@1.31 +3 -3
+ NTP_4_2_5P170
+
+ gsoc_sntp/sntp-opts.texi@1.31 +1 -1
+ NTP_4_2_5P170
+
+ gsoc_sntp/sntp.1@1.31 +2 -2
+ NTP_4_2_5P170
+
+ ntpd/ntpd-opts.c@1.162 +2 -2
+ NTP_4_2_5P170
+
+ ntpd/ntpd-opts.h@1.162 +3 -3
+ NTP_4_2_5P170
+
+ ntpd/ntpd-opts.texi@1.161 +1 -1
+ NTP_4_2_5P170
+
+ ntpd/ntpd.1@1.161 +2 -2
+ NTP_4_2_5P170
+
+ ntpdc/ntpdc-opts.c@1.158 +2 -2
+ NTP_4_2_5P170
+
+ ntpdc/ntpdc-opts.h@1.158 +3 -3
+ NTP_4_2_5P170
+
+ ntpdc/ntpdc-opts.texi@1.157 +1 -1
+ NTP_4_2_5P170
+
+ ntpdc/ntpdc.1@1.157 +2 -2
+ NTP_4_2_5P170
+
+ ntpq/ntpq-opts.c@1.158 +2 -2
+ NTP_4_2_5P170
+
+ ntpq/ntpq-opts.h@1.158 +3 -3
+ NTP_4_2_5P170
+
+ ntpq/ntpq-opts.texi@1.157 +1 -1
+ NTP_4_2_5P170
+
+ ntpq/ntpq.1@1.157 +2 -2
+ NTP_4_2_5P170
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.39 +2 -2
+ NTP_4_2_5P170
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.39 +3 -3
+ NTP_4_2_5P170
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.39 +1 -1
+ NTP_4_2_5P170
+
+ ntpsnmpd/ntpsnmpd.1@1.39 +2 -2
+ NTP_4_2_5P170
+
+ packageinfo.sh@1.173 +1 -1
+ NTP_4_2_5P170
+
+ sntp/sntp-opts.c@1.158 +2 -2
+ NTP_4_2_5P170
+
+ sntp/sntp-opts.h@1.158 +3 -3
+ NTP_4_2_5P170
+
+ sntp/sntp-opts.texi@1.157 +1 -1
+ NTP_4_2_5P170
+
+ sntp/sntp.1@1.157 +2 -2
+ NTP_4_2_5P170
+
+ util/ntp-keygen-opts.c@1.161 +2 -2
+ NTP_4_2_5P170
+
+ util/ntp-keygen-opts.h@1.161 +3 -3
+ NTP_4_2_5P170
+
+ util/ntp-keygen-opts.texi@1.160 +1 -1
+ NTP_4_2_5P170
+
+ util/ntp-keygen.1@1.160 +2 -2
+ NTP_4_2_5P170
+
+ChangeSet@1.1830.4.3, 2009-05-02 10:26:07+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_cacheversion.m4:
+ remove diagnostic after successful tests
+
+ m4/ntp_cacheversion.m4@1.3 +0 -1
+ remove diagnostic after successful tests
+
+ChangeSet@1.1830.4.2, 2009-05-02 08:37:14+00:00, davehart@shiny.ad.hartbrothers.com
+ do not clear config.cache immediately after it is created empty
+
+ ChangeLog@1.299.4.2 +1 -0
+ do not clear config.cache immediately after it is created empty
+
+ m4/ntp_cacheversion.m4@1.2 +19 -6
+ do not clear config.cache immediately after it is created empty
+
+ChangeSet@1.1436.15.50, 2009-05-02 02:38:49-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7_RC5
+ TAG: NTP_4_2_4P7_RC5
+
+ ChangeLog@1.1.1.75 +1 -0
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpd-opts.c@1.50.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpd-opts.h@1.50.22.1 +3 -3
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpd-opts.texi@1.49.22.1 +1 -1
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpd.1@1.48.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpdsim-opts.c@1.50.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpdsim-opts.h@1.50.22.1 +3 -3
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpdsim-opts.texi@1.48.22.1 +1 -1
+ NTP_4_2_4P7_RC5
+
+ ntpd/ntpdsim.1@1.48.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ ntpdc/ntpdc-opts.c@1.50.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ ntpdc/ntpdc-opts.h@1.50.22.1 +3 -3
+ NTP_4_2_4P7_RC5
+
+ ntpdc/ntpdc-opts.texi@1.48.22.1 +1 -1
+ NTP_4_2_4P7_RC5
+
+ ntpdc/ntpdc.1@1.48.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ ntpq/ntpq-opts.c@1.52.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ ntpq/ntpq-opts.h@1.52.22.1 +3 -3
+ NTP_4_2_4P7_RC5
+
+ ntpq/ntpq-opts.texi@1.49.22.1 +1 -1
+ NTP_4_2_4P7_RC5
+
+ ntpq/ntpq.1@1.48.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ packageinfo.sh@1.65.30.1 +1 -1
+ NTP_4_2_4P7_RC5
+
+ sntp/sntp-opts.c@1.49.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ sntp/sntp-opts.h@1.49.22.1 +3 -3
+ NTP_4_2_4P7_RC5
+
+ sntp/sntp-opts.texi@1.46.22.1 +1 -1
+ NTP_4_2_4P7_RC5
+
+ sntp/sntp.1@1.49.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ util/ntp-keygen-opts.c@1.49.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ util/ntp-keygen-opts.h@1.49.22.1 +3 -3
+ NTP_4_2_4P7_RC5
+
+ util/ntp-keygen-opts.texi@1.47.22.1 +1 -1
+ NTP_4_2_4P7_RC5
+
+ util/ntp-keygen.1@1.47.22.1 +2 -2
+ NTP_4_2_4P7_RC5
+
+ChangeSet@1.1830.3.1, 2009-05-02 00:13:27-04:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills
+
+ ChangeLog@1.299.3.4 +1 -0
+ loopfilter FLL/PLL crossover cleanup from Dave Mills
+
+ ChangeLog@1.299.3.3 +1 -0
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.299.3.2 +1 -0
+ Cleanup from Dave Mills
+
+ ChangeLog@1.299.3.1 +1 -0
+ crypto API cleanup from Dave Mills
+
+ html/authopt.html@1.48 +4 -2
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.15 +20 -63
+ Documentation updates from Dave Mills
+
+ include/ntpd.h@1.124 +1 -1
+ crypto API cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.133 +38 -55
+ crypto API cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.149 +12 -19
+ loopfilter FLL/PLL crossover cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.284 +9 -11
+ crypto API cleanup from Dave Mills
+
+ util/ntp-keygen.c@1.57 +2 -6
+ Cleanup from Dave Mills
+
+ChangeSet@1.1830.2.2, 2009-05-02 01:55:12+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ restore -dev version of HAS_ROUTING_SOCKET stuff after merging from
+ -stable un-backporting of same
+
+ configure.ac@1.437.2.2 +12 -1
+ restore -dev version of HAS_ROUTING_SOCKET stuff after merging from
+ -stable un-backporting of same
+
+ChangeSet@1.1436.15.49, 2009-05-02 01:49:02+00:00, davehart@shiny.ad.hartbrothers.com
+ flock-build:
+ set -m wasn't needed with ssh -tt and caused problems, remove
+ ChangeLog:
+ [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux.
+ remove unportable 'set -m' from flock-build script
+ configure.ac:
+ reverse accidental backport from -dev of struct rtattr test in
+ configure.ac without corresponding ntp_io.c code for HAVE_RTNETLINK
+
+ ChangeLog@1.1.1.74 +5 -0
+ [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux.
+ remove unportable 'set -m' from flock-build script
+
+ configure.ac@1.400.1.14 +1 -12
+ reverse accidental backport from -dev of struct rtattr test in
+ configure.ac without corresponding ntp_io.c code for HAVE_RTNETLINK
+
+ flock-build@1.39.1.2 +3 -5
+ set -m wasn't needed with ssh -tt and caused problems, remove
+
+ChangeSet@1.1828.1.1, 2009-05-01 20:05:24+00:00, davehart@shiny.ad.hartbrothers.com
+ add NTP_CACHEVERSION to toss config.cache from different version
+ ---
+ enable gcc -Wstrict-overflow for gsoc_sntp
+
+ ChangeLog@1.297.1.1 +2 -0
+ Add NTP_CACHEVERSION to configure.ac m4/ntp_cacheversion.m4
+
+ configure.ac@1.437.1.1 +21 -5
+ add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache
+
+ gsoc_sntp/Makefile.am@1.7 +1 -1
+ ACLOCAL_AMFLAGS += -I ../m4
+
+ gsoc_sntp/configure.ac@1.14 +17 -1
+ add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache
+ ---
+ enable gcc -Wstrict-overflow
+
+ include/ntp.h@1.153 +1 -0
+ references l_fp type, needs #include <ntp_fp.h>
+
+ m4/ntp_cacheversion.m4@1.1 +82 -0
+ add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache
+
+ m4/ntp_cacheversion.m4@1.0 +0 -0
+
+ ntpd/ntp_refclock.c@1.85 +2 -2
+ pps_handle_t is properly an opaque scalar, timepps-Solaris.h will be fixed
+
+ sntp/Makefile.am@1.25 +1 -1
+ ACLOCAL_AMFLAGS += -I ../m4
+
+ sntp/configure.ac@1.20 +17 -1
+ add NTP_CACHEVERSION() m4 macro to flush incompatible config.cache
+
+ChangeSet@1.1831, 2009-05-01 15:05:10+00:00, kardel@pogo.udel.edu
+ configure.ac, refclock_parse.c, ChangeLog:
+ [Bug 1152] adjust PARSE to new refclock_pps logic
+
+ ChangeLog@1.300 +1 -0
+ [Bug 1152] adjust PARSE to new refclock_pps logic
+
+ configure.ac@1.438 +0 -4
+ [Bug 1152] adjust PARSE to new refclock_pps logic
+
+ ntpd/refclock_parse.c@1.50 +55 -42
+ [Bug 1152] adjust PARSE to new refclock_pps logic
+
+ChangeSet@1.1830, 2009-04-30 07:58:03-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P169
+ TAG: NTP_4_2_5P169
+
+ ChangeLog@1.299 +1 -0
+ NTP_4_2_5P169
+
+ gsoc_sntp/sntp-opts.c@1.30 +2 -2
+ NTP_4_2_5P169
+
+ gsoc_sntp/sntp-opts.h@1.30 +3 -3
+ NTP_4_2_5P169
+
+ gsoc_sntp/sntp-opts.texi@1.30 +1 -1
+ NTP_4_2_5P169
+
+ gsoc_sntp/sntp.1@1.30 +2 -2
+ NTP_4_2_5P169
+
+ ntpd/ntpd-opts.c@1.161 +2 -2
+ NTP_4_2_5P169
+
+ ntpd/ntpd-opts.h@1.161 +3 -3
+ NTP_4_2_5P169
+
+ ntpd/ntpd-opts.texi@1.160 +1 -1
+ NTP_4_2_5P169
+
+ ntpd/ntpd.1@1.160 +2 -2
+ NTP_4_2_5P169
+
+ ntpdc/ntpdc-opts.c@1.157 +2 -2
+ NTP_4_2_5P169
+
+ ntpdc/ntpdc-opts.h@1.157 +3 -3
+ NTP_4_2_5P169
+
+ ntpdc/ntpdc-opts.texi@1.156 +1 -1
+ NTP_4_2_5P169
+
+ ntpdc/ntpdc.1@1.156 +2 -2
+ NTP_4_2_5P169
+
+ ntpq/ntpq-opts.c@1.157 +2 -2
+ NTP_4_2_5P169
+
+ ntpq/ntpq-opts.h@1.157 +3 -3
+ NTP_4_2_5P169
+
+ ntpq/ntpq-opts.texi@1.156 +1 -1
+ NTP_4_2_5P169
+
+ ntpq/ntpq.1@1.156 +2 -2
+ NTP_4_2_5P169
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.38 +2 -2
+ NTP_4_2_5P169
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.38 +3 -3
+ NTP_4_2_5P169
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.38 +1 -1
+ NTP_4_2_5P169
+
+ ntpsnmpd/ntpsnmpd.1@1.38 +2 -2
+ NTP_4_2_5P169
+
+ packageinfo.sh@1.172 +1 -1
+ NTP_4_2_5P169
+
+ sntp/sntp-opts.c@1.157 +2 -2
+ NTP_4_2_5P169
+
+ sntp/sntp-opts.h@1.157 +3 -3
+ NTP_4_2_5P169
+
+ sntp/sntp-opts.texi@1.156 +1 -1
+ NTP_4_2_5P169
+
+ sntp/sntp.1@1.156 +2 -2
+ NTP_4_2_5P169
+
+ util/ntp-keygen-opts.c@1.160 +2 -2
+ NTP_4_2_5P169
+
+ util/ntp-keygen-opts.h@1.160 +3 -3
+ NTP_4_2_5P169
+
+ util/ntp-keygen-opts.texi@1.159 +1 -1
+ NTP_4_2_5P169
+
+ util/ntp-keygen.1@1.159 +2 -2
+ NTP_4_2_5P169
+
+ChangeSet@1.1829, 2009-04-30 02:59:43-04:00, stenn@whimsy.udel.edu
+ [Bug 1171] Note that we never look for -lreadline by default
+
+ ChangeLog@1.298 +1 -0
+ [Bug 1171] Note that we never look for -lreadline by default
+
+ m4/ntp_lineeditlibs.m4@1.5 +1 -1
+ [Bug 1171] Note that we never look for -lreadline by default
+
+ChangeSet@1.1826.1.1, 2009-04-29 18:46:50-04:00, stenn@whimsy.udel.edu
+ typo fix on [Bug 1166] entry
+
+ ChangeLog@1.295.1.1 +1 -1
+ typo fix on [Bug 1166] entry
+
+ChangeSet@1.1826, 2009-04-29 08:04:45-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P168
+ TAG: NTP_4_2_5P168
+
+ ChangeLog@1.295 +1 -0
+ NTP_4_2_5P168
+
+ gsoc_sntp/sntp-opts.c@1.29 +2 -2
+ NTP_4_2_5P168
+
+ gsoc_sntp/sntp-opts.h@1.29 +3 -3
+ NTP_4_2_5P168
+
+ gsoc_sntp/sntp-opts.texi@1.29 +1 -1
+ NTP_4_2_5P168
+
+ gsoc_sntp/sntp.1@1.29 +2 -2
+ NTP_4_2_5P168
+
+ ntpd/ntpd-opts.c@1.160 +2 -2
+ NTP_4_2_5P168
+
+ ntpd/ntpd-opts.h@1.160 +3 -3
+ NTP_4_2_5P168
+
+ ntpd/ntpd-opts.texi@1.159 +1 -1
+ NTP_4_2_5P168
+
+ ntpd/ntpd.1@1.159 +2 -2
+ NTP_4_2_5P168
+
+ ntpdc/ntpdc-opts.c@1.156 +2 -2
+ NTP_4_2_5P168
+
+ ntpdc/ntpdc-opts.h@1.156 +3 -3
+ NTP_4_2_5P168
+
+ ntpdc/ntpdc-opts.texi@1.155 +1 -1
+ NTP_4_2_5P168
+
+ ntpdc/ntpdc.1@1.155 +2 -2
+ NTP_4_2_5P168
+
+ ntpq/ntpq-opts.c@1.156 +2 -2
+ NTP_4_2_5P168
+
+ ntpq/ntpq-opts.h@1.156 +3 -3
+ NTP_4_2_5P168
+
+ ntpq/ntpq-opts.texi@1.155 +1 -1
+ NTP_4_2_5P168
+
+ ntpq/ntpq.1@1.155 +2 -2
+ NTP_4_2_5P168
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.37 +2 -2
+ NTP_4_2_5P168
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.37 +3 -3
+ NTP_4_2_5P168
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.37 +1 -1
+ NTP_4_2_5P168
+
+ ntpsnmpd/ntpsnmpd.1@1.37 +2 -2
+ NTP_4_2_5P168
+
+ packageinfo.sh@1.171 +1 -1
+ NTP_4_2_5P168
+
+ sntp/sntp-opts.c@1.156 +2 -2
+ NTP_4_2_5P168
+
+ sntp/sntp-opts.h@1.156 +3 -3
+ NTP_4_2_5P168
+
+ sntp/sntp-opts.texi@1.155 +1 -1
+ NTP_4_2_5P168
+
+ sntp/sntp.1@1.155 +2 -2
+ NTP_4_2_5P168
+
+ util/ntp-keygen-opts.c@1.159 +2 -2
+ NTP_4_2_5P168
+
+ util/ntp-keygen-opts.h@1.159 +3 -3
+ NTP_4_2_5P168
+
+ util/ntp-keygen-opts.texi@1.158 +1 -1
+ NTP_4_2_5P168
+
+ util/ntp-keygen.1@1.158 +2 -2
+ NTP_4_2_5P168
+
+ChangeSet@1.1436.15.48, 2009-04-29 04:03:41-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7_RC4
+ TAG: NTP_4_2_4P7_RC4
+
+ ChangeLog@1.1.1.73 +1 -0
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpd-opts.c@1.50.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpd-opts.h@1.50.21.1 +3 -3
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpd-opts.texi@1.49.21.1 +1 -1
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpd.1@1.48.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpdsim-opts.c@1.50.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpdsim-opts.h@1.50.21.1 +3 -3
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpdsim-opts.texi@1.48.21.1 +1 -1
+ NTP_4_2_4P7_RC4
+
+ ntpd/ntpdsim.1@1.48.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ ntpdc/ntpdc-opts.c@1.50.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ ntpdc/ntpdc-opts.h@1.50.21.1 +3 -3
+ NTP_4_2_4P7_RC4
+
+ ntpdc/ntpdc-opts.texi@1.48.21.1 +1 -1
+ NTP_4_2_4P7_RC4
+
+ ntpdc/ntpdc.1@1.48.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ ntpq/ntpq-opts.c@1.52.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ ntpq/ntpq-opts.h@1.52.21.1 +3 -3
+ NTP_4_2_4P7_RC4
+
+ ntpq/ntpq-opts.texi@1.49.21.1 +1 -1
+ NTP_4_2_4P7_RC4
+
+ ntpq/ntpq.1@1.48.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ packageinfo.sh@1.65.29.1 +1 -1
+ NTP_4_2_4P7_RC4
+
+ sntp/sntp-opts.c@1.49.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ sntp/sntp-opts.h@1.49.21.1 +3 -3
+ NTP_4_2_4P7_RC4
+
+ sntp/sntp-opts.texi@1.46.21.1 +1 -1
+ NTP_4_2_4P7_RC4
+
+ sntp/sntp.1@1.49.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ util/ntp-keygen-opts.c@1.49.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ util/ntp-keygen-opts.h@1.49.21.1 +3 -3
+ NTP_4_2_4P7_RC4
+
+ util/ntp-keygen-opts.texi@1.47.21.1 +1 -1
+ NTP_4_2_4P7_RC4
+
+ util/ntp-keygen.1@1.47.21.1 +2 -2
+ NTP_4_2_4P7_RC4
+
+ChangeSet@1.1436.15.47, 2009-04-29 01:50:44-04:00, stenn@pogo.udel.edu
+ No need to know the GCC -W items in config.h
+
+ configure.ac@1.400.1.13 +2 -12
+ No need to know the GCC -W items in config.h
+
+ChangeSet@1.1817.4.1, 2009-04-29 01:40:19-04:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills
+
+ ChangeLog@1.286.4.6 +1 -0
+ Updates from Dave Mills
+
+ ChangeLog@1.286.4.5 +1 -0
+ updates
+
+ ChangeLog@1.286.4.4 +1 -0
+ Fix the error return and syslog function ID in refclock_{param,ppsapi}
+
+ ChangeLog@1.286.4.3 +1 -0
+ Make sure syspoll is within the peer's minpoll/maxpoll bounds
+
+ ChangeLog@1.286.4.2 +1 -0
+ ntp_crypto.c: Use sign_siglen, not len. sign key filename cleanup.
+
+ ChangeLog@1.286.4.1 +1 -0
+ Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths
+
+ html/keygen.html@1.14 +222 -133
+ ntp-keygen updates
+
+ include/ntp.h@1.152 +3 -3
+ Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths
+
+ include/ntp_crypto.h@1.45 +1 -1
+ Bump NTP_MAXEXTEN from 1024 to 2048, update values for some field lengths
+
+ ntpd/ntp_crypto.c@1.132 +19 -23
+ ntp_crypto.c: Use sign_siglen, not len. sign key filename cleanup.
+
+ ntpd/ntp_proto.c@1.283 +18 -2
+ Make sure syspoll is within the peer's minpoll/maxpoll bounds
+
+ ntpd/ntp_refclock.c@1.82.1.1 +7 -7
+ Fix the error return and syslog function ID in refclock_{param,ppsapi}
+
+ util/ntp-keygen.c@1.54.1.1 +27 -16
+ updates
+
+ChangeSet@1.1817.3.1, 2009-04-28 08:09:13-04:00, murray@pogo.udel.edu
+ refclock_hpgps.c:
+ Fix for bug 1090, bogus leapseconds
+ ChangeLog:
+ Fix for bug 1090, bogus leapseconds in refclock_hpgps
+
+ ChangeLog@1.286.3.1 +1 -0
+ Fix for bug 1090, bogus leapseconds in refclock_hpgps
+
+ ntpd/refclock_hpgps.c@1.9 +12 -5
+ Fix for bug 1090, bogus leapseconds
+
+ChangeSet@1.1817.2.2, 2009-04-28 08:23:30+00:00, davehart@shiny.ad.hartbrothers.com
+ dcfd.c:
+ tvsec -> tv_sec typo
+
+ parseutil/dcfd.c@1.22 +1 -1
+ tvsec -> tv_sec typo
+
+ChangeSet@1.1816.1.2, 2009-04-28 07:00:17+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_parser.h, ntp_parser.c:
+ bison 2.4.1 generated files
+
+ ntpd/ntp_parser.c@1.37 +372 -214
+ bison 2.4.1 generated files
+
+ ntpd/ntp_parser.h@1.21 +159 -1
+ bison 2.4.1 generated files
+
+ChangeSet@1.1816.1.1, 2009-04-28 06:59:44+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1169] quiet compiler warnings
+ Re-enable gcc -Wstrict-prototypes when not building with OpenSSL
+ Enable gcc -Wstrict-overflow
+ ntpq/ntpdc emit newline after accepting password on Windows
+
+ ChangeLog@1.285.1.1 +4 -0
+ * [Bug 1169] quiet compiler warnings
+ * Re-enable gcc -Wstrict-prototypes when not building with OpenSSL
+ * Enable gcc -Wstrict-overflow
+ * ntpq/ntpdc emit newline after accepting password on Windows
+
+
+ configure.ac@1.434.1.1 +40 -26
+ enable -Wstrict-overflow, use -Wno-strict-prototypes only w/OpenSSL
+
+ gsoc_sntp/crypto.c@1.5 +3 -3
+ auth_init() local key_cnt shadowed global of same name
+ ---
+ add const qualifier to auth_init() keyfile argument
+
+ gsoc_sntp/crypto.h@1.4 +1 -1
+ add const qualifier to auth_init() keyfile argument
+
+ gsoc_sntp/kod_management.c@1.8 +2 -2
+ add const qualifier to kod_db_file, kod_init_kod_db() arg
+
+ gsoc_sntp/kod_management.h@1.5 +1 -1
+ add const qualifier to kod_db_file, kod_init_kod_db() arg
+
+ gsoc_sntp/log.c@1.8 +1 -1
+ add const qualifier
+
+ gsoc_sntp/log.h@1.5 +1 -1
+ add const qualifier
+
+ gsoc_sntp/main.c@1.12 +4 -3
+ #include <isc/net.h> for isc_net_probeipv6 prototype
+ ---
+ remove three casts with const qualifiers fixed
+
+ gsoc_sntp/networking.c@1.18 +7 -17
+ remove unused sockaddr_in, sockaddr_in6
+ ---
+ char *buf shadowed declaration warning, printf %li not %i
+ ---
+ two more char *buf shadowy declarations
+
+ include/isc/file.h@1.2 +2 -2
+ change parameter name in prototype from time to mtime to avoid (noisy)
+ warning about shadowing another "time" declaration
+
+ include/isc/mem.h@1.3 +10 -5
+ macro away troublesom isc_mem_t incomplete type warnings
+ ---
+ #include <stdlib.h> (probably redundant with <string.h>)
+
+ include/ntp_config.h@1.51 +1 -0
+ prototype destroy_address_node()
+
+ include/ntp_stdlib.h@1.28 +5 -5
+ indent, whitespace cleanup
+
+ include/ntpsim.h@1.10 +1 -0
+ prototype entrypoint ntpsim(argc, argv)
+
+ libisc/inet_ntop.c@1.5 +6 -0
+ conditionalize code to match header
+
+ libisc/inet_pton.c@1.2 +6 -0
+ conditionalize code to match header
+
+ libisc/mem.c@1.3 +5 -0
+ note disuse of mem.c
+
+ libntp/Makefile.am@1.42 +2 -4
+ let's see if libisc/log.c is really used
+ ---
+ remove mem.c from build in favor of isc/mem.h macros
+
+ libntp/machines.c@1.20 +3 -0
+ emit newline after ntpq/ntpdc passwd prompt on Windows
+
+ libntp/numtoa.c@1.3 +8 -0
+ include config.h, netinet/in.h for htonl
+
+ libntp/numtohost.c@1.4 +8 -0
+ include config.h, netinet/in.h for htonl
+
+ libntp/prettydate.c@1.12 +3 -1
+ prototype common_prettydate()
+
+ libntp/statestr.c@1.15 +5 -1
+ flash_codes unused, see ntpq.c tstflagnames
+
+ libparse/parsesolaris.c@1.8 +12 -12
+ ctime -> c_time to quiet shadowed declaration warning
+ remove const from pprintf format string to match use
+
+ ntpd/ntp_config.c@1.191 +6 -0
+ missed DESTROY_QUEUE(unpeers) in merge into 1165 repo
+ ---
+ quiet compiler warning about unused get_next_address for !SIM
+
+ ntpd/ntp_intres.c@1.59 +0 -1
+ ding dong, the bong is dead. (remove unused bong() prototype)
+
+ ntpd/ntp_parser.y@1.32 +2 -2
+ missing semicolons on Unpeer, Unconfig trip up original yacc, bison -y
+
+ ntpd/ntp_refclock.c@1.83 +2 -2
+ quiet two warnings comparing scalar ap->handle with pointer NULL
+
+ ntpd/ntp_util.c@1.69 +7 -0
+ prototype uninit_util()
+
+ ntpd/ntpsim.c@1.20 +0 -1
+ prototype entry point ntpsim(argc, argv) moves to ntpdsim.h
+
+ ntpd/refclock_mx4200.c@1.24 +12 -12
+ %lu not %ul printf format specifier
+ local leapsec -> leapsec_warn to avoid shadowing global leapsec
+
+ ntpd/refclock_palisade.c@1.24 +5 -3
+ wrap dead sendcmd() in #ifdef UNUSED
+
+ ntpd/refclock_palisade.h@1.11 +2 -0
+ wrap sendcmd() prototype with #ifdef UNUSED
+
+ ntpq/ntpq.c@1.83 +181 -162
+ conditionalize VxWorks-only clear_globals so it doesn't compile others
+ ---
+ quiet warnings building ntpq.c for libntpq, getcmds and abortcmd
+ ---
+ quiet tokenize, getarg defined but not used for libntpq
+ ---
+ quiet xcp possibly uninitialized in help
+ clean up indents, whitespace
+
+ parseutil/dcfd.c@1.21 +5 -4
+ use explicit offset test rather than timercmp() to avoid 'simplifying
+ conditional to constant' warning with -Wstrict-overflow from testing if
+ constant 0 max_adj_offset.tv_sec is greater than something else.
+
+ ports/winnt/libntp/libntp.vcproj@1.4 +0 -22
+ remove libisc/mem.c from build in favor of isc/mem.h macros
+
+ ports/winnt/ntpd/ntpd.vcproj@1.2 +4 -0
+ add reference to ntpsim.h
+
+ ports/winnt/ntpd/ntservice.c@1.16 +5 -5
+ correct #ifdefs for leak debugging
+
+ util/ntp-keygen.c@1.55 +7 -7
+ use strdup to get non-const copies of string args
+ cast time_t to long/u_long explicitly for 64-bit time_t
+
+ChangeSet@1.1436.15.46, 2009-04-27 11:47:49+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ add [Bug 1167] to ChangeLog entry
+
+ ChangeLog@1.1.1.72 +1 -1
+ add [Bug 1167] to ChangeLog entry
+
+ChangeSet@1.1817.1.2, 2009-04-26 14:17:47+00:00, davehart@shiny.ad.hartbrothers.com
+ Remove truncation of position (blanking) code in refclock_nmea.c
+
+ ChangeLog@1.286.1.2 +1 -0
+ Remove truncation of position (blanking) code in refclock_nmea.c
+
+ ntpd/refclock_nmea.c@1.34 +1 -71
+ Remove truncation of position (blanking) code in refclock_nmea.c
+
+ChangeSet@1.1817.1.1, 2009-04-26 07:54:41-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P167
+ TAG: NTP_4_2_5P167
+
+ ChangeLog@1.286.1.1 +1 -0
+ NTP_4_2_5P167
+
+ gsoc_sntp/sntp-opts.c@1.28 +2 -2
+ NTP_4_2_5P167
+
+ gsoc_sntp/sntp-opts.h@1.28 +3 -3
+ NTP_4_2_5P167
+
+ gsoc_sntp/sntp-opts.texi@1.28 +1 -1
+ NTP_4_2_5P167
+
+ gsoc_sntp/sntp.1@1.28 +2 -2
+ NTP_4_2_5P167
+
+ ntpd/ntpd-opts.c@1.159 +2 -2
+ NTP_4_2_5P167
+
+ ntpd/ntpd-opts.h@1.159 +3 -3
+ NTP_4_2_5P167
+
+ ntpd/ntpd-opts.texi@1.158 +1 -1
+ NTP_4_2_5P167
+
+ ntpd/ntpd.1@1.158 +2 -2
+ NTP_4_2_5P167
+
+ ntpdc/ntpdc-opts.c@1.155 +2 -2
+ NTP_4_2_5P167
+
+ ntpdc/ntpdc-opts.h@1.155 +3 -3
+ NTP_4_2_5P167
+
+ ntpdc/ntpdc-opts.texi@1.154 +1 -1
+ NTP_4_2_5P167
+
+ ntpdc/ntpdc.1@1.154 +2 -2
+ NTP_4_2_5P167
+
+ ntpq/ntpq-opts.c@1.155 +2 -2
+ NTP_4_2_5P167
+
+ ntpq/ntpq-opts.h@1.155 +3 -3
+ NTP_4_2_5P167
+
+ ntpq/ntpq-opts.texi@1.154 +1 -1
+ NTP_4_2_5P167
+
+ ntpq/ntpq.1@1.154 +2 -2
+ NTP_4_2_5P167
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.36 +2 -2
+ NTP_4_2_5P167
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.36 +3 -3
+ NTP_4_2_5P167
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.36 +1 -1
+ NTP_4_2_5P167
+
+ ntpsnmpd/ntpsnmpd.1@1.36 +2 -2
+ NTP_4_2_5P167
+
+ packageinfo.sh@1.170 +1 -1
+ NTP_4_2_5P167
+
+ sntp/sntp-opts.c@1.155 +2 -2
+ NTP_4_2_5P167
+
+ sntp/sntp-opts.h@1.155 +3 -3
+ NTP_4_2_5P167
+
+ sntp/sntp-opts.texi@1.154 +1 -1
+ NTP_4_2_5P167
+
+ sntp/sntp.1@1.154 +2 -2
+ NTP_4_2_5P167
+
+ util/ntp-keygen-opts.c@1.158 +2 -2
+ NTP_4_2_5P167
+
+ util/ntp-keygen-opts.h@1.158 +3 -3
+ NTP_4_2_5P167
+
+ util/ntp-keygen-opts.texi@1.157 +1 -1
+ NTP_4_2_5P167
+
+ util/ntp-keygen.1@1.157 +2 -2
+ NTP_4_2_5P167
+
+ChangeSet@1.1819, 2009-04-26 06:18:21+00:00, davehart@shiny.ad.hartbrothers.com
+ NTP_LINEEDITLIBS refinements for Autoconf 2.62 warnings
+
+ ChangeLog@1.288 +1 -0
+ NTP_LINEEDITLIBS refinements for Autoconf 2.62 warnings
+
+ m4/ntp_lineeditlibs.m4@1.4 +46 -40
+ NTP_LINEEDITLIBS refinements for Autoconf 2.62 warnings
+
+ChangeSet@1.1436.15.45, 2009-04-26 06:10:27+00:00, davehart@shiny.ad.hartbrothers.com
+ gcc -Winit-self is used only if it is understood
+
+ ChangeLog@1.1.1.71 +4 -0
+ gcc -Winit-self is used only if it is understood
+
+ configure.ac@1.400.1.12 +34 -2
+ gcc -Winit-self is used only if it is understood
+
+ChangeSet@1.1817, 2009-04-25 20:02:54-04:00, stenn@whimsy.udel.edu
+ Crypto cleanup from Dave Mills
+
+ ChangeLog@1.286 +1 -0
+ Crypto cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.131 +4 -6
+ Crypto cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.282 +16 -11
+ Crypto cleanup from Dave Mills
+
+ChangeSet@1.1816, 2009-04-25 07:55:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P166
+ TAG: NTP_4_2_5P166
+
+ ChangeLog@1.285 +1 -0
+ NTP_4_2_5P166
+
+ gsoc_sntp/sntp-opts.c@1.27 +2 -2
+ NTP_4_2_5P166
+
+ gsoc_sntp/sntp-opts.h@1.27 +3 -3
+ NTP_4_2_5P166
+
+ gsoc_sntp/sntp-opts.texi@1.27 +1 -1
+ NTP_4_2_5P166
+
+ gsoc_sntp/sntp.1@1.27 +2 -2
+ NTP_4_2_5P166
+
+ ntpd/ntpd-opts.c@1.158 +2 -2
+ NTP_4_2_5P166
+
+ ntpd/ntpd-opts.h@1.158 +3 -3
+ NTP_4_2_5P166
+
+ ntpd/ntpd-opts.texi@1.157 +1 -1
+ NTP_4_2_5P166
+
+ ntpd/ntpd.1@1.157 +2 -2
+ NTP_4_2_5P166
+
+ ntpdc/ntpdc-opts.c@1.154 +2 -2
+ NTP_4_2_5P166
+
+ ntpdc/ntpdc-opts.h@1.154 +3 -3
+ NTP_4_2_5P166
+
+ ntpdc/ntpdc-opts.texi@1.153 +1 -1
+ NTP_4_2_5P166
+
+ ntpdc/ntpdc.1@1.153 +2 -2
+ NTP_4_2_5P166
+
+ ntpq/ntpq-opts.c@1.154 +2 -2
+ NTP_4_2_5P166
+
+ ntpq/ntpq-opts.h@1.154 +3 -3
+ NTP_4_2_5P166
+
+ ntpq/ntpq-opts.texi@1.153 +1 -1
+ NTP_4_2_5P166
+
+ ntpq/ntpq.1@1.153 +2 -2
+ NTP_4_2_5P166
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.35 +2 -2
+ NTP_4_2_5P166
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.35 +3 -3
+ NTP_4_2_5P166
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.35 +1 -1
+ NTP_4_2_5P166
+
+ ntpsnmpd/ntpsnmpd.1@1.35 +2 -2
+ NTP_4_2_5P166
+
+ packageinfo.sh@1.169 +1 -1
+ NTP_4_2_5P166
+
+ sntp/sntp-opts.c@1.154 +2 -2
+ NTP_4_2_5P166
+
+ sntp/sntp-opts.h@1.154 +3 -3
+ NTP_4_2_5P166
+
+ sntp/sntp-opts.texi@1.153 +1 -1
+ NTP_4_2_5P166
+
+ sntp/sntp.1@1.153 +2 -2
+ NTP_4_2_5P166
+
+ util/ntp-keygen-opts.c@1.157 +2 -2
+ NTP_4_2_5P166
+
+ util/ntp-keygen-opts.h@1.157 +3 -3
+ NTP_4_2_5P166
+
+ util/ntp-keygen-opts.texi@1.156 +1 -1
+ NTP_4_2_5P166
+
+ util/ntp-keygen.1@1.156 +2 -2
+ NTP_4_2_5P166
+
+ChangeSet@1.1815, 2009-04-25 08:22:13+00:00, davehart@shiny.ad.hartbrothers.com
+ bison products
+
+ ntpd/ntp_parser.c@1.36 +649 -373
+ generated from [Bug 1165] ChangeSet's ntp_parser.y
+
+ ntpd/ntp_parser.h@1.20 +25 -177
+ generated from [Bug 1165] ChangeSet's ntp_parser.y
+
+ChangeSet@1.1807.2.1, 2009-04-25 08:08:01+00:00, davehart@shiny.ad.hartbrothers.com
+ * [Bug 1165] Clean up small memory leaks in the config file parser
+ * Correct logconfig keyword declaration to MULTIPLE_ARG
+ * Enable filename and line number leak reporting on Windows when built
+ DEBUG for all the typical C runtime allocators such as calloc,
+ malloc, and strdup. Previously only emalloc calls were covered.
+ * Add DEBUG-only code to free dynamically allocated memory that would
+ otherwise remain allocated at ntpd exit, to allow less forgivable
+ leaks to stand out in leaks reported after exit.
+ * Ensure termination of strings in ports/winnt/libisc/isc_strerror.c
+ and quiet compiler warnings.
+
+
+ ChangeLog@1.280.2.1 +10 -0
+ [Bug 1165] config parser leak
+ logconfig keyword correction
+ DEBUG-only freeing of allocated memory at exit
+ Windows CRT leak debugging enhanced
+ isc_strerror compile warnings quieted
+
+ include/ntp_filegen.h@1.5 +3 -0
+ DEBUG-only freeing of allocated memory at exit
+
+ include/ntp_stdlib.h@1.27 +4 -4
+ Windows CRT leak debugging enhanced
+
+ include/ntpd.h@1.121.1.1 +1 -1
+ no const qualifier for ntp_signd_socket matches parser return types
+
+ libntp/emalloc.c@1.6 +17 -18
+ Windows CRT leak debugging enhanced
+
+ libntp/msyslog.c@1.21 +7 -4
+ use errno for msyslog on Windows if (NO_ERROR == GetLastError())
+
+ ntpd/ntp_config.c@1.188.1.1 +152 -60
+ [Bug 1165] config parser leak
+ logconfig keyword correction
+ DEBUG-only freeing of allocated memory at exit
+
+ ntpd/ntp_data_structures.c@1.7 +5 -10
+ C doesn't require casts from void *, emalloc doesn't return NULL
+
+ ntpd/ntp_filegen.c@1.14 +8 -6
+ DEBUG-only freeing of allocated memory at exit
+
+ ntpd/ntp_parser.y@1.29.1.1 +10 -8
+ [Bug 1165] config parser leak
+
+ ntpd/ntp_scanner.c@1.19 +1 -1
+ DEBUG-only freeing of allocated memory at exit
+
+ ntpd/ntp_scanner.h@1.5 +1 -0
+ DEBUG-only freeing of allocated memory at exit
+
+ ntpd/ntp_util.c@1.68 +49 -12
+ DEBUG-only freeing of allocated memory at exit
+
+ ports/winnt/include/config.h@1.62 +10 -1
+ Windows CRT leak debugging enhanced
+
+ ports/winnt/libisc/isc_strerror.c@1.7 +137 -31
+ ensure NULL termination of error messages
+ quiet compiler warnings
+
+ ports/winnt/libntp/randfile.c@1.4 +1 -6
+ quiet compiler warnings by including config.h
+
+ ports/winnt/ntpd/ntservice.c@1.15 +22 -7
+ DEBUG-only freeing of allocated memory at exit
+
+ChangeSet@1.1807.1.2, 2009-04-25 00:34:16-04:00, stenn@whimsy.udel.edu
+ PPS and crypto cleanup in ntp_proto.c from Dave Mills
+
+ ChangeLog@1.280.1.1 +1 -0
+ PPS and crypto cleanup in ntp_proto.c from Dave Mills
+
+ ntpd/ntp_proto.c@1.281 +3 -3
+ PPS and crypto cleanup in ntp_proto.c from Dave Mills
+
+ChangeSet@1.1812, 2009-04-24 00:01:08+00:00, davehart@shiny.ad.hartbrothers.com
+ bison-generated files from ntp_parser.y for [Bug 1161]
+
+ ntpd/ntp_parser.c@1.35 +949 -914
+ bison-generated files from ntp_parser.y
+
+ ntpd/ntp_parser.h@1.19 +39 -35
+ bison-generated files from ntp_parser.y
+
+ChangeSet@1.1811, 2009-04-23 23:58:33+00:00, davehart@shiny.ad.hartbrothers.com
+ Many files:
+ [Bug 1161] unpeer AKA unconfig command for ntpq :config
+
+ ChangeLog@1.282 +1 -0
+ [Bug 1161] unpeer AKA unconfig command for ntpq :config
+
+ include/ntp_config.h@1.50 +6 -0
+ [Bug 1161] unpeer AKA unconfig command for ntpq :config
+
+ ntpd/ntp_config.c@1.189 +104 -8
+ [Bug 1161] unpeer AKA unconfig command for ntpq :config
+
+ ntpd/ntp_parser.y@1.30 +23 -1
+ [Bug 1161] unpeer AKA unconfig command for ntpq :config
+
+ChangeSet@1.1809, 2009-04-23 19:45:43+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ [Bug 1057] ntpdc unconfig failure
+
+ ChangeLog@1.279.1.1 +1 -0
+ [Bug 1057] ntpdc unconfig failure
+
+ChangeSet@1.1807.1.1, 2009-04-23 08:03:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P165
+ TAG: NTP_4_2_5P165
+
+ ChangeLog@1.280 +1 -0
+ NTP_4_2_5P165
+
+ gsoc_sntp/sntp-opts.c@1.26 +2 -2
+ NTP_4_2_5P165
+
+ gsoc_sntp/sntp-opts.h@1.26 +3 -3
+ NTP_4_2_5P165
+
+ gsoc_sntp/sntp-opts.texi@1.26 +1 -1
+ NTP_4_2_5P165
+
+ gsoc_sntp/sntp.1@1.26 +2 -2
+ NTP_4_2_5P165
+
+ ntpd/ntpd-opts.c@1.157 +2 -2
+ NTP_4_2_5P165
+
+ ntpd/ntpd-opts.h@1.157 +3 -3
+ NTP_4_2_5P165
+
+ ntpd/ntpd-opts.texi@1.156 +1 -1
+ NTP_4_2_5P165
+
+ ntpd/ntpd.1@1.156 +2 -2
+ NTP_4_2_5P165
+
+ ntpdc/ntpdc-opts.c@1.153 +2 -2
+ NTP_4_2_5P165
+
+ ntpdc/ntpdc-opts.h@1.153 +3 -3
+ NTP_4_2_5P165
+
+ ntpdc/ntpdc-opts.texi@1.152 +1 -1
+ NTP_4_2_5P165
+
+ ntpdc/ntpdc.1@1.152 +2 -2
+ NTP_4_2_5P165
+
+ ntpq/ntpq-opts.c@1.153 +2 -2
+ NTP_4_2_5P165
+
+ ntpq/ntpq-opts.h@1.153 +3 -3
+ NTP_4_2_5P165
+
+ ntpq/ntpq-opts.texi@1.152 +1 -1
+ NTP_4_2_5P165
+
+ ntpq/ntpq.1@1.152 +2 -2
+ NTP_4_2_5P165
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.34 +2 -2
+ NTP_4_2_5P165
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.34 +3 -3
+ NTP_4_2_5P165
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.34 +1 -1
+ NTP_4_2_5P165
+
+ ntpsnmpd/ntpsnmpd.1@1.34 +2 -2
+ NTP_4_2_5P165
+
+ packageinfo.sh@1.168 +1 -1
+ NTP_4_2_5P165
+
+ sntp/sntp-opts.c@1.153 +2 -2
+ NTP_4_2_5P165
+
+ sntp/sntp-opts.h@1.153 +3 -3
+ NTP_4_2_5P165
+
+ sntp/sntp-opts.texi@1.152 +1 -1
+ NTP_4_2_5P165
+
+ sntp/sntp.1@1.152 +2 -2
+ NTP_4_2_5P165
+
+ util/ntp-keygen-opts.c@1.156 +2 -2
+ NTP_4_2_5P165
+
+ util/ntp-keygen-opts.h@1.156 +3 -3
+ NTP_4_2_5P165
+
+ util/ntp-keygen-opts.texi@1.155 +1 -1
+ NTP_4_2_5P165
+
+ util/ntp-keygen.1@1.155 +2 -2
+ NTP_4_2_5P165
+
+ChangeSet@1.1808, 2009-04-23 11:51:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1057] partial fix, re-enable ntpdc unconfig
+
+ include/ntpd.h@1.122 +2 -3
+ [Bug 1057] partial fix, re-enable ntpdc unconfig
+
+ ntpd/ntp_peer.c@1.116 +0 -15
+ [Bug 1057] partial fix, re-enable ntpdc unconfig
+
+ ntpd/ntp_request.c@1.77 +26 -16
+ [Bug 1057] partial fix, re-enable ntpdc unconfig
+
+ChangeSet@1.1807, 2009-04-23 06:42:56-04:00, stenn@whimsy.udel.edu
+ WWVB refclock cleanup from Dave Mills
+
+ ChangeLog@1.279 +1 -0
+ WWVB refclock cleanup from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.21 +3 -3
+ WWVB refclock cleanup from Dave Mills
+
+ChangeSet@1.1806, 2009-04-23 06:35:25-04:00, stenn@whimsy.udel.edu
+ Code cleanup: requested_key -> request_key
+
+ ChangeLog@1.278 +1 -0
+ Code cleanup: requested_key -> request_key
+
+ include/ntp_config.h@1.49 +1 -1
+ Code cleanup: requested_key -> request_key
+
+ ntpd/ntp_config.c@1.188 +4 -4
+ Code cleanup: requested_key -> request_key
+
+ ntpd/ntp_parser.c@1.34 +5 -5
+ Code cleanup: requested_key -> request_key
+
+ ntpd/ntp_parser.h@1.18 +2 -2
+ Code cleanup: requested_key -> request_key
+
+ ntpd/ntp_parser.y@1.29 +1 -1
+ Code cleanup: requested_key -> request_key
+
+ChangeSet@1.1801.1.6, 2009-04-23 08:23:49+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ belated ntp_parser.y malloc redeclaration entry
+
+ ChangeLog@1.273.1.2 +1 -0
+ belated ntp_parser.y malloc redeclaration entry
+
+ChangeSet@1.1801.1.5, 2009-04-23 08:18:08+00:00, hart@pogo.udel.edu
+ ntp_parser.c:
+ generated from updated ntp_parser.y by bison 2.3
+ ntp_parser.h:
+ force a null delta to keep this file newer than ntp_parser.y
+
+ ntpd/ntp_parser.c@1.33 +365 -355
+ generated from updated ntp_parser.y by bison 2.3
+
+ ntpd/ntp_parser.h@1.17 +0 -0
+ force a null delta to keep this file newer than ntp_parser.y
+
+ChangeSet@1.1801.1.4, 2009-04-23 08:08:30+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_parser.y:
+ quiet malloc redeclaration warning compiling ntp_parser.c
+
+ ntpd/ntp_parser.y@1.28 +2 -0
+ quiet malloc redeclaration warning compiling ntp_parser.c
+
+ChangeSet@1.1804, 2009-04-23 03:43:50-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ChangeLog@1.276 +2 -1
+ cleanup
+
+ChangeSet@1.1801.1.3, 2009-04-23 07:31:41+00:00, davehart@shiny.ad.hartbrothers.com
+ allow OpenSSL DLLs' C runtime version to differ from ntpq's and ntpdc's
+ [Bug 833] ignore whitespace at end of remote configuration lines
+ [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows
+
+ ChangeLog@1.273.1.1 +2 -0
+ [Bug 833] ignore whitespace at end of remote configuration lines
+ [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows
+
+ ntpd/ntp_scanner.c@1.18 +14 -3
+ [Bug 833] ignore whitespace at end of remote configuration lines
+
+ ntpdc/ntpdc.c@1.61 +7 -1
+ allow OpenSSL DLLs' C runtime version to differ from ntpdc's
+ [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows
+
+ ntpq/ntpq.c@1.82 +7 -1
+ allow OpenSSL DLLs' C runtime version to differ from ntpq's
+ [Bug 1033] ntpdc/ntpq crash prompting for keyid on Windows
+
+ChangeSet@1.1801.1.2, 2009-04-23 07:04:18+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_scanner.c:
+ quiet type conversion warnings, do not push back EOF
+
+ ntpd/ntp_scanner.c@1.17 +10 -11
+ quiet type conversion warnings, do not push back EOF
+
+ChangeSet@1.1801.1.1, 2009-04-23 06:59:15+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_parser.y, ntp_scanner.c:
+ whitespace and indent cleanup only
+
+ ntpd/ntp_parser.y@1.27 +516 -510
+ whitespace and indent cleanup only
+
+ ntpd/ntp_scanner.c@1.16 +47 -50
+ whitespace and indent cleanup only
+
+ChangeSet@1.1796.12.31, 2009-04-22 18:33:43-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ html/drivers/driver22.html@1.18 +76 -27
+ Documentation updates from Dave Mills
+
+ html/drivers/driver4.html@1.14 +103 -60
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1796.12.30, 2009-04-22 18:26:09-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.268.11.16 +1 -0
+ Mitigation and PPS/PPSAPI cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.276.1.5 +2 -1
+ Mitigation and PPS/PPSAPI cleanup from Dave Mills
+
+ ntpd/refclock_atom.c@1.59 +21 -11
+ Mitigation and PPS/PPSAPI cleanup from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.20 +30 -6
+ Mitigation and PPS/PPSAPI cleanup from Dave Mills
+
+ChangeSet@1.1796.12.29, 2009-04-22 18:20:19-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.268.11.15 +1 -0
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.42 +2 -2
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.20 +36 -11
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1796.12.28, 2009-04-22 18:14:48-04:00, stenn@whimsy.udel.edu
+ timepps-Solaris.h patches from Dave Hart
+
+ ChangeLog@1.268.11.14 +1 -0
+ timepps-Solaris.h patches from Dave Hart
+
+ include/timepps-Solaris.h@1.5 +68 -19
+ timepps-Solaris.h patches from Dave Hart
+
+ChangeSet@1.1796.12.27, 2009-04-22 10:38:59-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P164
+ TAG: NTP_4_2_5P164
+
+ ChangeLog@1.268.11.13 +1 -0
+ NTP_4_2_5P164
+
+ gsoc_sntp/sntp-opts.c@1.25 +2 -2
+ NTP_4_2_5P164
+
+ gsoc_sntp/sntp-opts.h@1.25 +3 -3
+ NTP_4_2_5P164
+
+ gsoc_sntp/sntp-opts.texi@1.25 +1 -1
+ NTP_4_2_5P164
+
+ gsoc_sntp/sntp.1@1.25 +2 -2
+ NTP_4_2_5P164
+
+ ntpd/ntpd-opts.c@1.156 +2 -2
+ NTP_4_2_5P164
+
+ ntpd/ntpd-opts.h@1.156 +3 -3
+ NTP_4_2_5P164
+
+ ntpd/ntpd-opts.texi@1.155 +2 -2
+ NTP_4_2_5P164
+
+ ntpd/ntpd.1@1.155 +2 -2
+ NTP_4_2_5P164
+
+ ntpdc/ntpdc-opts.c@1.152 +2 -2
+ NTP_4_2_5P164
+
+ ntpdc/ntpdc-opts.h@1.152 +3 -3
+ NTP_4_2_5P164
+
+ ntpdc/ntpdc-opts.texi@1.151 +2 -2
+ NTP_4_2_5P164
+
+ ntpdc/ntpdc.1@1.151 +2 -2
+ NTP_4_2_5P164
+
+ ntpq/ntpq-opts.c@1.152 +2 -2
+ NTP_4_2_5P164
+
+ ntpq/ntpq-opts.h@1.152 +3 -3
+ NTP_4_2_5P164
+
+ ntpq/ntpq-opts.texi@1.151 +2 -2
+ NTP_4_2_5P164
+
+ ntpq/ntpq.1@1.151 +2 -2
+ NTP_4_2_5P164
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.33 +2 -2
+ NTP_4_2_5P164
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.33 +3 -3
+ NTP_4_2_5P164
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.33 +1 -1
+ NTP_4_2_5P164
+
+ ntpsnmpd/ntpsnmpd.1@1.33 +2 -2
+ NTP_4_2_5P164
+
+ packageinfo.sh@1.167 +1 -1
+ NTP_4_2_5P164
+
+ sntp/sntp-opts.c@1.152 +2 -2
+ NTP_4_2_5P164
+
+ sntp/sntp-opts.h@1.152 +3 -3
+ NTP_4_2_5P164
+
+ sntp/sntp-opts.texi@1.151 +1 -1
+ NTP_4_2_5P164
+
+ sntp/sntp.1@1.151 +2 -2
+ NTP_4_2_5P164
+
+ util/ntp-keygen-opts.c@1.155 +2 -2
+ NTP_4_2_5P164
+
+ util/ntp-keygen-opts.h@1.155 +3 -3
+ NTP_4_2_5P164
+
+ util/ntp-keygen-opts.texi@1.154 +2 -2
+ NTP_4_2_5P164
+
+ util/ntp-keygen.1@1.154 +2 -2
+ NTP_4_2_5P164
+
+ChangeSet@1.1436.15.44, 2009-04-22 08:18:29-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7_RC3
+ TAG: NTP_4_2_4P7_RC3
+
+ ChangeLog@1.1.1.70 +1 -0
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpd-opts.c@1.50.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpd-opts.h@1.50.20.1 +3 -3
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpd-opts.texi@1.49.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpd.1@1.48.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpdsim-opts.c@1.50.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpdsim-opts.h@1.50.20.1 +3 -3
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpdsim-opts.texi@1.48.20.1 +1 -1
+ NTP_4_2_4P7_RC3
+
+ ntpd/ntpdsim.1@1.48.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpdc/ntpdc-opts.c@1.50.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpdc/ntpdc-opts.h@1.50.20.1 +3 -3
+ NTP_4_2_4P7_RC3
+
+ ntpdc/ntpdc-opts.texi@1.48.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpdc/ntpdc.1@1.48.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpq/ntpq-opts.c@1.52.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpq/ntpq-opts.h@1.52.20.1 +3 -3
+ NTP_4_2_4P7_RC3
+
+ ntpq/ntpq-opts.texi@1.49.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ ntpq/ntpq.1@1.48.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ packageinfo.sh@1.65.28.1 +1 -1
+ NTP_4_2_4P7_RC3
+
+ sntp/sntp-opts.c@1.49.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ sntp/sntp-opts.h@1.49.20.1 +3 -3
+ NTP_4_2_4P7_RC3
+
+ sntp/sntp-opts.texi@1.46.20.1 +1 -1
+ NTP_4_2_4P7_RC3
+
+ sntp/sntp.1@1.49.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ util/ntp-keygen-opts.c@1.49.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ util/ntp-keygen-opts.h@1.49.20.1 +3 -3
+ NTP_4_2_4P7_RC3
+
+ util/ntp-keygen-opts.texi@1.47.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ util/ntp-keygen.1@1.47.20.1 +2 -2
+ NTP_4_2_4P7_RC3
+
+ChangeSet@1.1436.15.43, 2009-04-22 07:00:20-04:00, stenn@whimsy.udel.edu
+ [Bug 1155] Fix compile problem on Windows with VS2005
+
+ ChangeLog@1.1.1.69 +1 -0
+ [Bug 1155] Fix compile problem on Windows with VS2005
+
+ChangeSet@1.1436.15.42, 2009-04-22 06:06:53-04:00, stenn@whimsy.udel.edu
+ Cleanup
+
+ ChangeLog@1.1.1.68 +4 -2
+ Cleanup
+
+ChangeSet@1.1796.18.1, 2009-04-22 02:35:47-04:00, stenn@whimsy.udel.edu
+ PPS/PPSAPI cleanup from Dave Mills
+
+ ChangeLog@1.268.16.2 +1 -0
+ PPS/PPSAPI cleanup from Dave Mills
+
+ ChangeLog@1.268.16.1 +1 -0
+ Documentation updates from Dave Mills
+
+ html/howto.html@1.21 +54 -41
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.19 +38 -31
+ Documentation updates from Dave Mills
+
+ include/Makefile.am@1.31 +1 -0
+ PPS/PPSAPI cleanup from Dave Mills
+
+ include/ntp.h@1.148.1.2 +2 -1
+ PPS/PPSAPI cleanup from Dave Mills
+
+ include/ntpd.h@1.118.2.1 +0 -1
+ PPS/PPSAPI cleanup from Dave Mills
+
+ include/refclock_atom.h@1.2 +1 -1
+ PPS/PPSAPI cleanup from Dave Mills
+
+ include/refclock_atom.h@1.1 +15 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/refclock_atom.h
+
+ include/refclock_atom.h@1.0 +0 -0
+
+ ntpd/ntp_proto.c@1.276.1.4 +30 -31
+ PPS/PPSAPI cleanup from Dave Mills
+
+ ntpd/ntp_refclock.c@1.82 +156 -0
+ PPS/PPSAPI cleanup from Dave Mills
+
+ ntpd/ntp_request.c@1.76 +6 -0
+ PPS/PPSAPI cleanup from Dave Mills
+
+ ntpd/refclock_atom.c@1.58 +38 -182
+ PPS/PPSAPI cleanup from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.19 +30 -1
+ PPS/PPSAPI cleanup from Dave Mills
+
+ChangeSet@1.1436.15.41, 2009-04-20 22:55:13+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ auto merge not quite right
+
+ ChangeLog@1.1.1.67 +3 -7
+ auto merge not quite right
+
+ChangeSet@1.1436.15.40, 2009-04-20 22:42:59+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_iocompletionport.c:
+ revert overlooked CreateEvent naming/sharing change not conditionalized away already
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.11 +2 -2
+ revert overlooked CreateEvent naming/sharing change not conditionalized away already
+
+ChangeSet@1.1796.12.21, 2009-04-20 06:26:09+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ merge cleanup
+
+ ChangeLog@1.268.11.7 +1 -3
+ merge cleanup
+
+ChangeSet@1.1436.21.11, 2009-04-20 06:17:21+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ [Bug 1160] Mac OS X is like BSD regarding F_SETOWN
+
+ ChangeLog@1.1.16.3 +1 -0
+ [Bug 1160] Mac OS X is like BSD regarding F_SETOWN
+
+ChangeSet@1.1796.12.19, 2009-04-20 06:13:35+00:00, davehart@shiny.ad.hartbrothers.com
+ recvbuff.c:
+ ENSURE that get_free_recv_buffer_alloc does not return NULL
+
+ libntp/recvbuff.c@1.29 +2 -0
+ ENSURE that get_free_recv_buffer_alloc does not return NULL
+
+ChangeSet@1.1436.21.10, 2009-04-20 06:02:20+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ [Bug 1160] MacOS X is like BSD regarding F_SETOWN
+
+ configure.ac@1.400.1.11 +3 -0
+ [Bug 1160] MacOS X is like BSD regarding F_SETOWN
+
+ChangeSet@1.1796.17.1, 2009-04-19 17:50:29+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_intres.c, ntpd.h, ChangeLog, ntp_config.c:
+ [Bug 1125] C runtime per-thread initialization on Windows
+
+ ChangeLog@1.268.15.1 +1 -0
+ [Bug 1125] C runtime per-thread initialization on Windows
+
+ include/ntpd.h@1.118.1.2 +3 -0
+ [Bug 1125] C runtime per-thread initialization on Windows
+
+ ntpd/ntp_config.c@1.184.1.2 +12 -11
+ [Bug 1125] C runtime per-thread initialization on Windows
+
+ ntpd/ntp_intres.c@1.58 +16 -1
+ [Bug 1125] C runtime per-thread initialization on Windows
+
+ChangeSet@1.1796.16.3, 2009-04-18 14:23:56+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq.c:
+ fix false positive duplicate detection
+
+ ntpq/ntpq.c@1.77.1.3 +9 -3
+ fix false positive duplicate detection
+
+ChangeSet@1.1796.16.2, 2009-04-18 13:51:18+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq.c:
+ quiet gcc, msc type warnings from decodeint calls to [hex|oct]toint
+
+ ntpq/ntpq.c@1.77.1.2 +2 -2
+ quiet gcc, msc type warnings from decodeint calls to [hex|oct]toint
+
+ChangeSet@1.1796.16.1, 2009-04-18 04:46:01+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpq.c, ChangeLog:
+ [Bug 1159] ntpq overlap diagnostic message test buggy
+
+ ChangeLog@1.268.14.1 +1 -0
+ [Bug 1159] ntpq overlap diagnostic message test buggy
+
+ ntpq/ntpq.c@1.77.1.1 +303 -266
+ [Bug 1159] ntpq overlap diagnostic message test buggy
+
+ChangeSet@1.1796.15.1, 2009-04-16 19:09:05+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ do not disable refclock_true (CLOCK_TRUETIME) due to pps_sample disappearance, relevant code is under CLOCK_PPS720 ifdef which only affects rare systems with pcl720.h present
+
+ configure.ac@1.424.1.1 +0 -1
+ do not disable refclock_true (CLOCK_TRUETIME) due to pps_sample disappearance, relevant code is under CLOCK_PPS720 ifdef which only affects rare systems with pcl720.h present
+
+ChangeSet@1.1796.12.12, 2009-04-16 09:00:55+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ revert too-long, incorrect option text change
+
+ configure.ac@1.432 +1 -1
+ revert too-long, incorrect option text change
+
+ChangeSet@1.1436.21.9, 2009-04-16 02:39:01+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ fix for --enable-ntp-signd=/my/path
+
+ configure.ac@1.400.1.10 +1 -1
+ fix for --enable-ntp-signd=/my/path
+
+ChangeSet@1.1436.21.8, 2009-04-15 12:36:24+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ do not cache options fix
+
+ configure.ac@1.400.1.9 +1 -1
+ do not cache options fix
+
+ChangeSet@1.1796.12.9, 2009-04-15 11:21:07+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ choosing compilers: use C99 if available, warn if C89 is not
+
+ configure.ac@1.429 +19 -9
+ choosing compilers: use C99 if available, warn if C89 is not
+
+ gsoc_sntp/configure.ac@1.13 +15 -4
+ choosing compilers: use C99 if available, warn if C89 is not
+
+ChangeSet@1.1436.21.7, 2009-04-15 10:43:51+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ Do not cache configure --options, only current values matter
+ Default --enable-wintime when --enable-ntp-signd
+
+ configure.ac@1.400.1.8 +575 -403
+ Do not cache configure --options, only current values matter
+ Default --enable-wintime when --enable-ntp-signd
+
+ChangeSet@1.1796.12.7, 2009-04-15 01:47:06+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ switch AC_CHECK_LIB to AC_SEARCH_LIBS for sockets to avoid occasional failure to use -lsocket
+
+ gsoc_sntp/configure.ac@1.12 +4 -5
+ switch AC_CHECK_LIB to AC_SEARCH_LIBS for sockets to avoid occasional failure to use -lsocket
+
+ChangeSet@1.1436.21.6, 2009-04-15 01:32:33+00:00, davehart@shiny.ad.hartbrothers.com
+ use AC_SEARCH_LIBS to avoid problems with sntp
+
+ configure.ac@1.400.1.7 +12 -20
+ use AC_SEARCH_LIBS in preference to AC_CHECK_LIB particulary for sockets, use AM_PROG_CC_C_O which supersets prior AC_PROG_CC_C_O
+
+ sntp/configure.ac@1.15.1.2 +4 -4
+ use AC_SEARCH_LIBS which is recommended particularly for sockets over the older AC_CHECK_LIB
+
+ChangeSet@1.1796.12.5, 2009-04-14 13:56:37+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ merge improvments from configure.ac into gsoc_sntp/configure.ac
+
+ gsoc_sntp/configure.ac@1.11 +210 -108
+ merge improvments from configure.ac into gsoc_sntp/configure.ac
+
+ChangeSet@1.1436.21.5, 2009-04-14 13:47:29+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ tear off sntp/configure.ac from configure.ac
+
+ configure.ac@1.400.1.6 +6 -1
+ tear off sntp/configure.ac from configure.ac
+
+ChangeSet@1.1436.15.38, 2009-04-14 07:55:41-04:00, mayer@pogo.udel.edu
+ Added fix for Bug 813
+
+ ChangeLog@1.1.1.65 +1 -0
+ Added fix for Bug 813
+
+ChangeSet@1.1436.15.37, 2009-04-14 07:51:41-04:00, mayer@pogo.udel.edu
+ [Bug 813] Conditional naming of Event
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.10 +7 -1
+ [Bug 813] Conditional naming of Event
+
+ChangeSet@1.1796.14.1, 2009-04-14 09:31:17+00:00, davehart@shiny.ad.hartbrothers.com
+ ntpdc.c, ntpq.c:
+ remove duplicate #define closesocket, in .h now
+ ChangeLog, refclock_nmea.c:
+ [Bug 1153] refclock_nmea should not mix UTC with GPS time
+
+ ChangeLog@1.268.13.1 +1 -0
+ [Bug 1153] refclock_nmea should not mix UTC with GPS time
+
+ ntpd/refclock_nmea.c@1.33 +41 -31
+ [Bug 1153] refclock_nmea should not mix UTC with GPS time
+
+ ntpdc/ntpdc.c@1.60 +0 -2
+ remove duplicate #define closesocket, in .h now
+
+ ntpq/ntpq.c@1.78 +0 -2
+ remove duplicate #define closesocket, in .h now
+
+ChangeSet@1.1796.13.2, 2009-04-14 08:20:36+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ complete the merge from stable cleanup
+
+ configure.ac@1.423.1.2 +63 -1
+ complete the merge from stable cleanup
+
+ChangeSet@1.1436.21.4, 2009-04-14 05:21:17+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac:
+ use unset for tickadj utility test fix
+
+ configure.ac@1.400.1.5 +1 -1
+ use unset for tickadj utility test fix
+
+ChangeSet@1.1436.21.3, 2009-04-14 02:59:39+00:00, hart@pogo.udel.edu
+ build:
+ do not require nice
+
+ build@1.26 +21 -4
+ do not require nice
+
+ChangeSet@1.1436.21.2, 2009-04-14 01:33:01+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac, ChangeLog:
+ [Bug 1158] support for aix6.1
+
+ ChangeLog@1.1.16.2 +1 -0
+ [Bug 1158] support for aix6.1
+
+ configure.ac@1.400.1.4 +8 -8
+ [Bug 1158] support for aix6.1
+
+ChangeSet@1.1436.21.1, 2009-04-14 01:28:08+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1157] quiet OpenSSL warnings, clean up configure.ac
+ make flock-build quit before causing harm if another has not completed
+
+
+ ChangeLog@1.1.16.1 +4 -0
+ [Bug 1157] quiet OpenSSL warnings, clean up configure.ac
+
+ build@1.25 +6 -7
+ prevent multiple flock-builds from stepping on each others work
+
+ configure.ac@1.400.1.3 +613 -361
+ [Bug 1157] quiet OpenSSL warnings, configure.ac cleanup
+
+ flock-build@1.39.1.1 +76 -20
+ prevent multiple flock-builds from stepping on each others work
+
+ sntp/configure.ac@1.15.1.1 +14 -0
+ bring in line with -dev to ease merges, no functional change
+
+ChangeSet@1.1796.12.1, 2009-04-13 20:20:58+00:00, davehart@shiny.ad.hartbrothers.com
+ configure.ac, ChangeLog:
+ [Bug 1152] temporarily disable refclock_parse and refclock_true until maintainers repair pps_sample() build break
+
+ ChangeLog@1.268.11.1 +2 -0
+ [Bug 1152] temporarily disable refclock_parse and refclock_true until maintainers repair pps_sample() build break
+
+ configure.ac@1.424 +5 -2
+ [Bug 1152] temporarily disable refclock_parse and refclock_true until maintainers repair pps_sample() build break
+
+ChangeSet@1.1796.1.36, 2009-04-13 11:10:38-04:00, utterback@pogo.udel.edu
+ ChangeLog:
+ [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for.
+
+ ChangeLog@1.268.1.36 +1 -0
+ [Bug 1154] mDNS registration should be done later, repeatedly and only if asked for.
+
+ChangeSet@1.1436.15.36, 2009-04-13 00:00:55-04:00, mayer@pogo.udel.edu
+ Forgot the _WIN32_WINNT update
+
+ ports/winnt/include/config.h@1.46.1.5 +10 -23
+ Forgot the _WIN32_WINNT update
+
+ChangeSet@1.1436.15.35, 2009-04-12 00:55:24-04:00, mayer@pogo.udel.edu
+ Windows bug fixes
+
+ ChangeLog@1.1.1.64 +7 -2
+ Windows bug fixes
+
+ChangeSet@1.1436.15.34, 2009-04-12 00:45:48-04:00, mayer@pogo.udel.edu
+ [Bug 1156] lock_thread_to_processor() should be declared in header
+
+ ports/winnt/include/clockstuff.h@1.7.1.1 +1 -0
+ [Bug 1156] lock_thread_to_processor() should be declared in header
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.23.1.2 +0 -1
+ [Bug 1156] lock_thread_to_processor() should be declared in header
+
+ChangeSet@1.1436.15.33, 2009-04-12 00:38:47-04:00, mayer@pogo.udel.edu
+ [Bug 1147] System errors should be logged to msyslog()
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.9 +17 -14
+ [Bug 1147] System errors should be logged to msyslog()
+
+ChangeSet@1.1436.15.32, 2009-04-12 00:34:41-04:00, mayer@pogo.udel.edu
+ [Bug 1155] Wrong header included in config.h. Should have been winsock2.h
+
+ ports/winnt/include/config.h@1.46.1.4 +1 -2
+ [Bug 1155] Wrong header included in config.h. Should have been winsock2.h
+
+ChangeSet@1.1436.15.31, 2009-04-12 00:32:25-04:00, mayer@pogo.udel.edu
+ [Bug 787] Bug fixes for 64-bit time_t on Windows
+
+ ports/winnt/libntp/SetSystemTime.c@1.3.1.1 +2 -2
+ [Bug 787] Bug fixes for 64-bit time_t on Windows
+
+ChangeSet@1.1796.1.35, 2009-04-10 07:56:46-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P163
+ TAG: NTP_4_2_5P163
+
+ ChangeLog@1.268.1.35 +1 -0
+ NTP_4_2_5P163
+
+ gsoc_sntp/sntp-opts.c@1.24 +2 -2
+ NTP_4_2_5P163
+
+ gsoc_sntp/sntp-opts.h@1.24 +3 -3
+ NTP_4_2_5P163
+
+ gsoc_sntp/sntp-opts.texi@1.24 +1 -1
+ NTP_4_2_5P163
+
+ gsoc_sntp/sntp.1@1.24 +2 -2
+ NTP_4_2_5P163
+
+ ntpd/ntpd-opts.c@1.155 +2 -2
+ NTP_4_2_5P163
+
+ ntpd/ntpd-opts.h@1.155 +3 -3
+ NTP_4_2_5P163
+
+ ntpd/ntpd-opts.texi@1.154 +1 -1
+ NTP_4_2_5P163
+
+ ntpd/ntpd.1@1.154 +2 -2
+ NTP_4_2_5P163
+
+ ntpdc/ntpdc-opts.c@1.151 +2 -2
+ NTP_4_2_5P163
+
+ ntpdc/ntpdc-opts.h@1.151 +3 -3
+ NTP_4_2_5P163
+
+ ntpdc/ntpdc-opts.texi@1.150 +1 -1
+ NTP_4_2_5P163
+
+ ntpdc/ntpdc.1@1.150 +2 -2
+ NTP_4_2_5P163
+
+ ntpq/ntpq-opts.c@1.151 +2 -2
+ NTP_4_2_5P163
+
+ ntpq/ntpq-opts.h@1.151 +3 -3
+ NTP_4_2_5P163
+
+ ntpq/ntpq-opts.texi@1.150 +1 -1
+ NTP_4_2_5P163
+
+ ntpq/ntpq.1@1.150 +2 -2
+ NTP_4_2_5P163
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.32 +2 -2
+ NTP_4_2_5P163
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.32 +3 -3
+ NTP_4_2_5P163
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.32 +1 -1
+ NTP_4_2_5P163
+
+ ntpsnmpd/ntpsnmpd.1@1.32 +2 -2
+ NTP_4_2_5P163
+
+ packageinfo.sh@1.166 +1 -1
+ NTP_4_2_5P163
+
+ sntp/sntp-opts.c@1.151 +2 -2
+ NTP_4_2_5P163
+
+ sntp/sntp-opts.h@1.151 +3 -3
+ NTP_4_2_5P163
+
+ sntp/sntp-opts.texi@1.150 +1 -1
+ NTP_4_2_5P163
+
+ sntp/sntp.1@1.150 +2 -2
+ NTP_4_2_5P163
+
+ util/ntp-keygen-opts.c@1.154 +2 -2
+ NTP_4_2_5P163
+
+ util/ntp-keygen-opts.h@1.154 +3 -3
+ NTP_4_2_5P163
+
+ util/ntp-keygen-opts.texi@1.153 +1 -1
+ NTP_4_2_5P163
+
+ util/ntp-keygen.1@1.153 +2 -2
+ NTP_4_2_5P163
+
+ChangeSet@1.1796.1.33, 2009-04-09 09:58:19-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P162
+ TAG: NTP_4_2_5P162
+
+ ChangeLog@1.268.1.33 +1 -0
+ NTP_4_2_5P162
+
+ gsoc_sntp/sntp-opts.c@1.23 +2 -2
+ NTP_4_2_5P162
+
+ gsoc_sntp/sntp-opts.h@1.23 +3 -3
+ NTP_4_2_5P162
+
+ gsoc_sntp/sntp-opts.texi@1.23 +1 -1
+ NTP_4_2_5P162
+
+ gsoc_sntp/sntp.1@1.23 +2 -2
+ NTP_4_2_5P162
+
+ ntpd/ntpd-opts.c@1.154 +2 -2
+ NTP_4_2_5P162
+
+ ntpd/ntpd-opts.h@1.154 +3 -3
+ NTP_4_2_5P162
+
+ ntpd/ntpd-opts.texi@1.153 +2 -2
+ NTP_4_2_5P162
+
+ ntpd/ntpd.1@1.153 +2 -2
+ NTP_4_2_5P162
+
+ ntpdc/ntpdc-opts.c@1.150 +2 -2
+ NTP_4_2_5P162
+
+ ntpdc/ntpdc-opts.h@1.150 +3 -3
+ NTP_4_2_5P162
+
+ ntpdc/ntpdc-opts.texi@1.149 +2 -2
+ NTP_4_2_5P162
+
+ ntpdc/ntpdc.1@1.149 +2 -2
+ NTP_4_2_5P162
+
+ ntpq/ntpq-opts.c@1.150 +2 -2
+ NTP_4_2_5P162
+
+ ntpq/ntpq-opts.h@1.150 +3 -3
+ NTP_4_2_5P162
+
+ ntpq/ntpq-opts.texi@1.149 +2 -2
+ NTP_4_2_5P162
+
+ ntpq/ntpq.1@1.149 +2 -2
+ NTP_4_2_5P162
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.31 +2 -2
+ NTP_4_2_5P162
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.31 +3 -3
+ NTP_4_2_5P162
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.31 +1 -1
+ NTP_4_2_5P162
+
+ ntpsnmpd/ntpsnmpd.1@1.31 +2 -2
+ NTP_4_2_5P162
+
+ packageinfo.sh@1.165 +1 -1
+ NTP_4_2_5P162
+
+ sntp/sntp-opts.c@1.150 +2 -2
+ NTP_4_2_5P162
+
+ sntp/sntp-opts.h@1.150 +3 -3
+ NTP_4_2_5P162
+
+ sntp/sntp-opts.texi@1.149 +1 -1
+ NTP_4_2_5P162
+
+ sntp/sntp.1@1.149 +2 -2
+ NTP_4_2_5P162
+
+ util/ntp-keygen-opts.c@1.153 +2 -2
+ NTP_4_2_5P162
+
+ util/ntp-keygen-opts.h@1.153 +3 -3
+ NTP_4_2_5P162
+
+ util/ntp-keygen-opts.texi@1.152 +2 -2
+ NTP_4_2_5P162
+
+ util/ntp-keygen.1@1.152 +2 -2
+ NTP_4_2_5P162
+
+ChangeSet@1.1436.15.30, 2009-04-09 07:44:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7_RC2
+ TAG: NTP_4_2_4P7_RC2
+
+ ChangeLog@1.1.1.63 +1 -0
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpd-opts.c@1.50.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpd-opts.h@1.50.19.1 +3 -3
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpd-opts.texi@1.49.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpd.1@1.48.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpdsim-opts.c@1.50.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpdsim-opts.h@1.50.19.1 +3 -3
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpdsim-opts.texi@1.48.19.1 +1 -1
+ NTP_4_2_4P7_RC2
+
+ ntpd/ntpdsim.1@1.48.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpdc/ntpdc-opts.c@1.50.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpdc/ntpdc-opts.h@1.50.19.1 +3 -3
+ NTP_4_2_4P7_RC2
+
+ ntpdc/ntpdc-opts.texi@1.48.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpdc/ntpdc.1@1.48.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpq/ntpq-opts.c@1.52.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpq/ntpq-opts.h@1.52.19.1 +3 -3
+ NTP_4_2_4P7_RC2
+
+ ntpq/ntpq-opts.texi@1.49.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ ntpq/ntpq.1@1.48.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ packageinfo.sh@1.65.27.1 +1 -1
+ NTP_4_2_4P7_RC2
+
+ sntp/sntp-opts.c@1.49.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ sntp/sntp-opts.h@1.49.19.1 +3 -3
+ NTP_4_2_4P7_RC2
+
+ sntp/sntp-opts.texi@1.46.19.1 +1 -1
+ NTP_4_2_4P7_RC2
+
+ sntp/sntp.1@1.49.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ util/ntp-keygen-opts.c@1.49.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ util/ntp-keygen-opts.h@1.49.19.1 +3 -3
+ NTP_4_2_4P7_RC2
+
+ util/ntp-keygen-opts.texi@1.47.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ util/ntp-keygen.1@1.47.19.1 +2 -2
+ NTP_4_2_4P7_RC2
+
+ChangeSet@1.1796.11.2, 2009-04-09 04:49:27-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.268.10.2 +1 -0
+ Documentation updates from Dave Mills
+
+ html/comdex.html@1.2 +4 -2
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.6 +5 -3
+ Documentation updates from Dave Mills
+
+ html/index.html@1.39 +4 -3
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.41 +64 -54
+ Documentation updates from Dave Mills
+
+ html/monopt.html@1.29 +4 -2
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.18 +123 -58
+ Documentation updates from Dave Mills
+
+ html/sitemap.html@1.3 +5 -3
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1796.11.1, 2009-04-09 04:44:58-04:00, stenn@whimsy.udel.edu
+ Mitigation and PPS cleanup from Dave Mills
+
+ ChangeLog@1.268.10.1 +4 -3
+ Mitigation and PPS cleanup from Dave Mills
+
+ include/ntpd.h@1.118.1.1 +1 -2
+ Mitigation and PPS cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.148 +2 -6
+ Mitigation and PPS cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.276.1.3 +170 -161
+ Mitigation and PPS cleanup from Dave Mills
+
+ ntpd/ntp_timer.c@1.49.1.1 +7 -1
+ Mitigation and PPS cleanup from Dave Mills
+
+ ntpd/refclock_atom.c@1.57 +24 -170
+ Mitigation and PPS cleanup from Dave Mills
+
+ ntpd/refclock_conf.c@1.27 +1 -1
+ Mitigation and PPS cleanup from Dave Mills
+
+ ntpd/refclock_local.c@1.19 +18 -34
+ Mitigation and PPS cleanup from Dave Mills
+
+ChangeSet@1.1436.15.29, 2009-04-09 04:16:50-04:00, stenn@whimsy.udel.edu
+ ChangLog cleanup
+
+ ChangeLog@1.1.1.62 +1 -0
+ ChangLog cleanup
+
+ChangeSet@1.1436.15.28, 2009-04-09 04:13:41-04:00, stenn@whimsy.udel.edu
+ [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159
+
+ ChangeLog@1.1.1.61 +2 -0
+ [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159
+
+ ntpq/ntpq.c@1.65.2.1 +2 -2
+ [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159
+
+ChangeSet@1.1796.10.2, 2009-04-07 09:37:52+00:00, davehart@shiny.ad.hartbrothers.com
+ libntp.vcproj:
+ add overlooked ntp_debug.h
+
+ ports/winnt/libntp/libntp.vcproj@1.1.1.1 +4 -0
+ add overlooked ntp_debug.h
+
+ChangeSet@1.1436.15.27, 2009-04-07 09:14:58+00:00, davehart@shiny.ad.hartbrothers.com
+ [Sec 1149] use setsockopt(SO_EXCLUSIVEADDRUSE) on Windows
+
+ ChangeLog@1.1.1.60 +4 -0
+ [Sec 1149] use setsockopt(SO_EXCLUSIVEADDRUSE) on Windows
+
+ ntpd/ntp_io.c@1.244.2.15 +64 -31
+ [Sec 1149] use setsockopt(SO_EXCLUSIVEADDRUSE) on Windows
+
+ ports/winnt/libntp/libntp.vcproj@1.1.1.1 +4 -0
+ add ntp_debug.h
+
+ChangeSet@1.1796.9.2, 2009-04-03 19:06:56+00:00, davehart@shiny.ad.hartbrothers.com
+ config.h, nt_clockstuff.c:
+ VC6 compatibility (thanks Martin!)
+
+ ports/winnt/include/config.h@1.60 +2 -1
+ VC6 compatibility (thanks Martin!)
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.27 +27 -16
+ VC6 compatibility (thanks Martin!)
+
+ChangeSet@1.1796.9.1, 2009-04-03 03:49:05+00:00, davehart@shiny.ad.hartbrothers.com
+ new Windows interpolation knocks out 1ms jitter in previous
+ remove dead code
+ thin #ifdef SYS_WINNT forest
+ 64-bit time_t truncation fixes, warnings silenced
+ do not set hardware clock on exit unless system is shutting down
+
+ BitKeeper/deleted/.del-ntpkeygen.vcproj@1.2 +0 -0
+ Rename: ports/winnt/ntp-keygen/ntpkeygen.vcproj -> BitKeeper/deleted/.del-ntpkeygen.vcproj
+
+ ChangeLog@1.268.8.1 +5 -0
+ [Bug 216] new interpolation, reduce #ifdef SYS_WINNT, 64-bit time_t cleanup, only set Windows CMOS clock at ntpd exit if the computer is shutting down
+
+ include/ntp_machine.h@1.25 +3 -46
+ remove SYS_WINNT stuff (redundant with ports/winnt/config.h)
+
+ include/ntp_stdlib.h@1.26 +0 -1
+ remove dead humandate() code
+
+ include/ntp_types.h@1.11 +18 -0
+ UNUSED_ARG macro definition, used to quiet compiler warnings
+ ---
+ define sock_timeval for Windows 64-bit time_t compatibility
+
+ include/ntp_unixtime.h@1.6 +0 -3
+ remove dead code: tvtoa(), utvtoa() declarations
+
+ libntp/Makefile.am@1.41 +2 -2
+ remove dead tvtoa.c & utvtoa.c from libntp
+
+ libntp/buftvtots.c@1.5 +18 -0
+ Windows has no tty_clock discipline, don't look for timestamp in refclock recvbuff
+
+ libntp/humandate.c@1.7 +1 -30
+ remove dead humandate() code
+
+ libntp/prettydate.c@1.11 +17 -27
+ fix compiler warning with 64-bit time_t, fold duplicate code into common helper
+
+ libntp/systime.c@1.47 +1 -1
+ quiet compiler warning with 64-bit time_t
+
+ ntpd/ntp_config.c@1.184.1.1 +6 -6
+ quiet compiler warnings about storing int into u_short with casts
+
+ ntpd/ntp_crypto.c@1.130 +1 -1
+ quiet compiler warning with 64-bit time_t
+
+ ntpd/ntp_intres.c@1.57 +1 -1
+ struct sock_timeval for 64-bit time_t compatibility on Windows
+
+ ntpd/ntp_timer.c@1.50 +0 -27
+ remove redundant code, nt_clockstuff.c enables privs earlier
+
+ ntpd/ntpd.c@1.100 +0 -4
+ chop down some #ifdef forest
+
+ ntpd/refclock_dumbclock.c@1.12 +1 -1
+ 64-bit time_t compiler warning silenced
+
+ ntpdate/ntpdate.c@1.65 +5 -18
+ struct sock_timeval for 64-bit time_t compatibility on Windows, more #ifdef SYS_WINNT deforestation
+
+ ntpdc/ntpdc.c@1.59 +4 -16
+ struct sock_timeval for 64-bit time_t compatibility on Windows
+
+ ntpq/ntpq.c@1.76 +5 -5
+ struct sock_timeval for 64-bit time_t compatibility on Windows
+
+ ports/winnt/include/clockstuff.h@1.8 +32 -7
+ new interpolation scheme knocks out 1ms jitter inherent in previous
+
+ ports/winnt/include/config.h@1.59 +27 -5
+ struct sock_timeval for 64-bit time_t compatibility on Windows, more #ifdef SYS_WINNT deforestation
+
+ ports/winnt/include/ntservice.h@1.3 +2 -1
+ expose ntservice_systemisshuttingdown(), fix calling convention mismatch
+
+ ports/winnt/include/sys/resource.h@1.4 +10 -4
+ emulate BSD setpriority() to reduce #ifdef SYS_WINNT
+
+ ports/winnt/include/sys/time.h@1.5 +14 -6
+ new interpolation scheme knocks out 1ms jitter inherent in previous
+
+ ports/winnt/libntp/SetSystemTime.c@1.5 +18 -16
+ new interpolation scheme knocks out 1ms jitter inherent in previous
+ do not mix C runtime and Windows Gregorian calendar routines
+
+ ports/winnt/libntp/getclock.c@1.1 +49 -0
+ emulate BSD getclock() interface
+
+ ports/winnt/libntp/getclock.c@1.0 +0 -0
+
+ ports/winnt/libntp/libntp.dsp@1.33 +8 -0
+ add getclock.c setpriority.c
+
+ ports/winnt/libntp/libntp.vcproj@1.2 +13 -59
+ remove dead tvtoa.c & utvtoa.c from libntp, add getclock.c setpriority.c and util_clockstuff.c
+
+ ports/winnt/libntp/randfile.c@1.3 +3 -2
+ buffer overrun protection
+
+ ports/winnt/libntp/setpriority.c@1.1 +79 -0
+ emulate BSD setpriority() to thin #ifdef forest in ntpd.c
+
+ ports/winnt/libntp/setpriority.c@1.0 +0 -0
+
+ ports/winnt/libntp/syslog.c@1.4 +2 -1
+ use strncpy instead of strcpy, force null termination as Windows strncpy doesn't when buffer exceeded
+
+ ports/winnt/libntp/util_clockstuff.c@1.4 +9 -17
+ no longer conflicts with ports/winnt/ntpd/nt_clockstuff.c, can be added to libntp library.
+
+ ports/winnt/ntp-keygen/ntp-keygen.vcproj@1.2 +0 -22
+ remove util_clockstuff.c from individual projects, it's now in libntp library
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.26 +1180 -332
+ new interpolation scheme knocks out 1ms jitter inherent in previous
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.40 +3 -5
+ move lock_thread_to_processor prototype to clockstuff.h
+
+ ports/winnt/ntpd/ntservice.c@1.14 +52 -41
+ ntservice_systemisshuttingdown(), fix mismatched calling convention, remove erroneous SetServiceStatus calls, eliminate unreachable code warning by removing exit() calls from main()
+
+ ports/winnt/ntpd/win32_io.c@1.15 +0 -12
+ emulate BSD setpriority() to reduce #ifdef SYS_WINNT
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.2 +0 -22
+ remove util_clockstuff.c from individual projects, it's now in libntp library
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.2 +0 -22
+ remove util_clockstuff.c from individual projects, it's now in libntp library
+
+ ports/winnt/ntpq/ntpq.vcproj@1.2 +0 -22
+ remove util_clockstuff.c from individual projects, it's now in libntp library
+
+ ports/winnt/scripts/mkver.bat@1.10 +4 -4
+ fix VC++ 2008 parallel build collision on %TEMP%\TZ.TMP by using a different filename for each program
+
+ util/ntp-keygen.c@1.54 +1 -4
+ remove #ifdef SYS_WINNT, gettimeofday() prototype on Windows now matches Unix
+
+ChangeSet@1.1796.8.2, 2009-04-01 01:13:42+00:00, davehart@shiny.ad.hartbrothers.com
+ bk gone the former gsoc_sntp/utilities.o so that all .o files can be removed without corrupting the repo
+
+ BitKeeper/etc/gone@1.9 +1 -0
+ bk gone the former gsoc_sntp/utilities.o so that all .o files can be removed without corrupting the repo
+
+ ChangeLog@1.268.7.2 +2 -0
+ bk gone the former gsoc_sntp/utilities.o so that all .o files can be removed without corrupting the repo
+
+ChangeSet@1.1796.8.1, 2009-03-31 06:56:41-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P161
+ TAG: NTP_4_2_5P161
+
+ ChangeLog@1.268.7.1 +1 -0
+ NTP_4_2_5P161
+
+ gsoc_sntp/sntp-opts.c@1.22 +2 -2
+ NTP_4_2_5P161
+
+ gsoc_sntp/sntp-opts.h@1.22 +3 -3
+ NTP_4_2_5P161
+
+ gsoc_sntp/sntp-opts.texi@1.22 +1 -1
+ NTP_4_2_5P161
+
+ gsoc_sntp/sntp.1@1.22 +2 -2
+ NTP_4_2_5P161
+
+ ntpd/ntpd-opts.c@1.153 +2 -2
+ NTP_4_2_5P161
+
+ ntpd/ntpd-opts.h@1.153 +3 -3
+ NTP_4_2_5P161
+
+ ntpd/ntpd-opts.texi@1.152 +1 -1
+ NTP_4_2_5P161
+
+ ntpd/ntpd.1@1.152 +2 -2
+ NTP_4_2_5P161
+
+ ntpdc/ntpdc-opts.c@1.149 +2 -2
+ NTP_4_2_5P161
+
+ ntpdc/ntpdc-opts.h@1.149 +3 -3
+ NTP_4_2_5P161
+
+ ntpdc/ntpdc-opts.texi@1.148 +1 -1
+ NTP_4_2_5P161
+
+ ntpdc/ntpdc.1@1.148 +2 -2
+ NTP_4_2_5P161
+
+ ntpq/ntpq-opts.c@1.149 +2 -2
+ NTP_4_2_5P161
+
+ ntpq/ntpq-opts.h@1.149 +3 -3
+ NTP_4_2_5P161
+
+ ntpq/ntpq-opts.texi@1.148 +1 -1
+ NTP_4_2_5P161
+
+ ntpq/ntpq.1@1.148 +2 -2
+ NTP_4_2_5P161
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.30 +2 -2
+ NTP_4_2_5P161
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.30 +3 -3
+ NTP_4_2_5P161
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.30 +1 -1
+ NTP_4_2_5P161
+
+ ntpsnmpd/ntpsnmpd.1@1.30 +2 -2
+ NTP_4_2_5P161
+
+ packageinfo.sh@1.164 +1 -1
+ NTP_4_2_5P161
+
+ sntp/sntp-opts.c@1.149 +2 -2
+ NTP_4_2_5P161
+
+ sntp/sntp-opts.h@1.149 +3 -3
+ NTP_4_2_5P161
+
+ sntp/sntp-opts.texi@1.148 +1 -1
+ NTP_4_2_5P161
+
+ sntp/sntp.1@1.148 +2 -2
+ NTP_4_2_5P161
+
+ util/ntp-keygen-opts.c@1.152 +2 -2
+ NTP_4_2_5P161
+
+ util/ntp-keygen-opts.h@1.152 +3 -3
+ NTP_4_2_5P161
+
+ util/ntp-keygen-opts.texi@1.151 +1 -1
+ NTP_4_2_5P161
+
+ util/ntp-keygen.1@1.151 +2 -2
+ NTP_4_2_5P161
+
+ChangeSet@1.1796.1.28, 2009-03-31 09:33:53+00:00, davehart@shiny.ad.hartbrothers.com
+ refclock_nmea.c:
+ [Bug 1148] NMEA reference clock improvements
+
+ ChangeLog@1.268.1.28 +1 -0
+ [Bug 1148] NMEA reference clock improvements
+
+ ntpd/refclock_nmea.c@1.32 +377 -222
+ [Bug 1148] NMEA reference clock improvements
+
+ChangeSet@1.1796.1.27, 2009-03-30 14:44:58-05:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.268.1.27 +1 -0
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.44 +194 -89
+ Documentation updates from Dave Mills
+
+ html/ntpq.html@1.31 +23 -6
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1796.1.25, 2009-03-30 09:06:35-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P160
+ TAG: NTP_4_2_5P160
+
+ ChangeLog@1.268.1.25 +1 -0
+ NTP_4_2_5P160
+
+ gsoc_sntp/sntp-opts.c@1.21 +2 -2
+ NTP_4_2_5P160
+
+ gsoc_sntp/sntp-opts.h@1.21 +3 -3
+ NTP_4_2_5P160
+
+ gsoc_sntp/sntp-opts.texi@1.21 +1 -1
+ NTP_4_2_5P160
+
+ gsoc_sntp/sntp.1@1.21 +2 -2
+ NTP_4_2_5P160
+
+ ntpd/ntpd-opts.c@1.152 +2 -2
+ NTP_4_2_5P160
+
+ ntpd/ntpd-opts.h@1.152 +3 -3
+ NTP_4_2_5P160
+
+ ntpd/ntpd-opts.texi@1.151 +1 -1
+ NTP_4_2_5P160
+
+ ntpd/ntpd.1@1.151 +2 -2
+ NTP_4_2_5P160
+
+ ntpdc/ntpdc-opts.c@1.148 +2 -2
+ NTP_4_2_5P160
+
+ ntpdc/ntpdc-opts.h@1.148 +3 -3
+ NTP_4_2_5P160
+
+ ntpdc/ntpdc-opts.texi@1.147 +1 -1
+ NTP_4_2_5P160
+
+ ntpdc/ntpdc.1@1.147 +2 -2
+ NTP_4_2_5P160
+
+ ntpq/ntpq-opts.c@1.148 +2 -2
+ NTP_4_2_5P160
+
+ ntpq/ntpq-opts.h@1.148 +3 -3
+ NTP_4_2_5P160
+
+ ntpq/ntpq-opts.texi@1.147 +1 -1
+ NTP_4_2_5P160
+
+ ntpq/ntpq.1@1.147 +2 -2
+ NTP_4_2_5P160
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.29 +2 -2
+ NTP_4_2_5P160
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.29 +3 -3
+ NTP_4_2_5P160
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.29 +1 -1
+ NTP_4_2_5P160
+
+ ntpsnmpd/ntpsnmpd.1@1.29 +2 -2
+ NTP_4_2_5P160
+
+ packageinfo.sh@1.163 +1 -1
+ NTP_4_2_5P160
+
+ sntp/sntp-opts.c@1.148 +2 -2
+ NTP_4_2_5P160
+
+ sntp/sntp-opts.h@1.148 +3 -3
+ NTP_4_2_5P160
+
+ sntp/sntp-opts.texi@1.147 +1 -1
+ NTP_4_2_5P160
+
+ sntp/sntp.1@1.147 +2 -2
+ NTP_4_2_5P160
+
+ util/ntp-keygen-opts.c@1.151 +2 -2
+ NTP_4_2_5P160
+
+ util/ntp-keygen-opts.h@1.151 +3 -3
+ NTP_4_2_5P160
+
+ util/ntp-keygen-opts.texi@1.150 +1 -1
+ NTP_4_2_5P160
+
+ util/ntp-keygen.1@1.150 +2 -2
+ NTP_4_2_5P160
+
+ChangeSet@1.1436.15.26, 2009-03-30 06:47:41-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P7_RC1
+ TAG: NTP_4_2_4P7_RC1
+
+ ChangeLog@1.1.1.59 +1 -0
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpd-opts.c@1.50.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpd-opts.h@1.50.18.1 +3 -3
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpd-opts.texi@1.49.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpd.1@1.48.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.18.1 +3 -3
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.18.1 +1 -1
+ NTP_4_2_4P7_RC1
+
+ ntpd/ntpdsim.1@1.48.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.18.1 +3 -3
+ NTP_4_2_4P7_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpdc/ntpdc.1@1.48.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpq/ntpq-opts.c@1.52.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpq/ntpq-opts.h@1.52.18.1 +3 -3
+ NTP_4_2_4P7_RC1
+
+ ntpq/ntpq-opts.texi@1.49.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ ntpq/ntpq.1@1.48.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ packageinfo.sh@1.65.26.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ sntp/sntp-opts.c@1.49.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ sntp/sntp-opts.h@1.49.18.1 +3 -3
+ NTP_4_2_4P7_RC1
+
+ sntp/sntp-opts.texi@1.46.18.1 +1 -1
+ NTP_4_2_4P7_RC1
+
+ sntp/sntp.1@1.49.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ util/ntp-keygen-opts.c@1.49.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ util/ntp-keygen-opts.h@1.49.18.1 +3 -3
+ NTP_4_2_4P7_RC1
+
+ util/ntp-keygen-opts.texi@1.47.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ util/ntp-keygen.1@1.47.18.1 +2 -2
+ NTP_4_2_4P7_RC1
+
+ChangeSet@1.1436.15.25, 2009-03-30 02:31:49-05:00, stenn@whimsy.udel.edu
+ Release Candidate
+
+ packageinfo.sh@1.65.25.1 +1 -1
+ Release Candidate
+
+ChangeSet@1.1796.7.2, 2009-03-28 06:55:26-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P159
+ TAG: NTP_4_2_5P159
+
+ ChangeLog@1.268.6.2 +1 -0
+ NTP_4_2_5P159
+
+ gsoc_sntp/sntp-opts.c@1.20 +2 -2
+ NTP_4_2_5P159
+
+ gsoc_sntp/sntp-opts.h@1.20 +3 -3
+ NTP_4_2_5P159
+
+ gsoc_sntp/sntp-opts.texi@1.20 +1 -1
+ NTP_4_2_5P159
+
+ gsoc_sntp/sntp.1@1.20 +2 -2
+ NTP_4_2_5P159
+
+ ntpd/ntpd-opts.c@1.151 +2 -2
+ NTP_4_2_5P159
+
+ ntpd/ntpd-opts.h@1.151 +3 -3
+ NTP_4_2_5P159
+
+ ntpd/ntpd-opts.texi@1.150 +2 -2
+ NTP_4_2_5P159
+
+ ntpd/ntpd.1@1.150 +2 -2
+ NTP_4_2_5P159
+
+ ntpdc/ntpdc-opts.c@1.147 +2 -2
+ NTP_4_2_5P159
+
+ ntpdc/ntpdc-opts.h@1.147 +3 -3
+ NTP_4_2_5P159
+
+ ntpdc/ntpdc-opts.texi@1.146 +2 -2
+ NTP_4_2_5P159
+
+ ntpdc/ntpdc.1@1.146 +2 -2
+ NTP_4_2_5P159
+
+ ntpq/ntpq-opts.c@1.147 +2 -2
+ NTP_4_2_5P159
+
+ ntpq/ntpq-opts.h@1.147 +3 -3
+ NTP_4_2_5P159
+
+ ntpq/ntpq-opts.texi@1.146 +2 -2
+ NTP_4_2_5P159
+
+ ntpq/ntpq.1@1.146 +2 -2
+ NTP_4_2_5P159
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.28 +2 -2
+ NTP_4_2_5P159
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.28 +3 -3
+ NTP_4_2_5P159
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.28 +1 -1
+ NTP_4_2_5P159
+
+ ntpsnmpd/ntpsnmpd.1@1.28 +2 -2
+ NTP_4_2_5P159
+
+ packageinfo.sh@1.162 +1 -1
+ NTP_4_2_5P159
+
+ sntp/sntp-opts.c@1.147 +2 -2
+ NTP_4_2_5P159
+
+ sntp/sntp-opts.h@1.147 +3 -3
+ NTP_4_2_5P159
+
+ sntp/sntp-opts.texi@1.146 +1 -1
+ NTP_4_2_5P159
+
+ sntp/sntp.1@1.146 +2 -2
+ NTP_4_2_5P159
+
+ util/ntp-keygen-opts.c@1.150 +2 -2
+ NTP_4_2_5P159
+
+ util/ntp-keygen-opts.h@1.150 +3 -3
+ NTP_4_2_5P159
+
+ util/ntp-keygen-opts.texi@1.149 +2 -2
+ NTP_4_2_5P159
+
+ util/ntp-keygen.1@1.149 +2 -2
+ NTP_4_2_5P159
+
+ChangeSet@1.1436.15.23, 2009-03-28 02:46:45-05:00, stenn@whimsy.udel.edu
+ build system email address cleanup
+
+ BitKeeper/triggers/changelog@1.4 +1 -1
+ trigger email address cleanup
+
+ BitKeeper/triggers/commitlogs@1.6 +1 -1
+ trigger email address cleanup
+
+ BitKeeper/triggers/delta-changelog@1.8 +2 -2
+ trigger email address cleanup
+
+ BitKeeper/triggers/notify@1.4 +1 -1
+ trigger email address cleanup
+
+ BitKeeper/triggers/paranoid@1.4 +1 -1
+ trigger email address cleanup
+
+ BitKeeper/triggers/post-incoming.license-warn@1.7 +1 -1
+ trigger email address cleanup
+
+ BitKeeper/triggers/pre-resolve.licfix@1.4 +1 -1
+ trigger email address cleanup
+
+ BitKeeper/triggers/send@1.14 +2 -2
+ trigger email address cleanup
+
+ ChangeLog@1.1.1.57 +3 -1
+ build system email address cleanup
+
+ChangeSet@1.1796.7.1, 2009-03-28 02:14:41-05:00, stenn@whimsy.udel.edu
+ "bias" changes from Dave Mills
+
+ ChangeLog@1.268.6.1 +1 -0
+ "bias" changes from Dave Mills
+
+ include/ntp.h@1.148.1.1 +2 -1
+ "bias" changes from Dave Mills
+
+ include/ntp_control.h@1.34 +9 -8
+ "bias" changes from Dave Mills
+
+ ntpd/ntp_control.c@1.108 +18 -10
+ "bias" changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.129 +13 -11
+ "bias" changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.276.1.2 +69 -92
+ "bias" changes from Dave Mills
+
+ChangeSet@1.1796.1.21, 2009-03-28 05:37:50+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_refclock.c, ChangeLog:
+ [Bug 1141] refclock_report missing braces cause spurious 'peer event: clock clk_unspec' log entries
+
+ ChangeLog@1.268.1.21 +8 -5
+ [Bug 1141] refclock_report missing braces cause spurious 'peer event: clock clk_unspec' log entries
+
+ ntpd/ntp_refclock.c@1.81 +2 -1
+ [Bug 1141] refclock_report missing braces cause spurious 'peer event: clock clk_unspec' log entries
+
+ChangeSet@1.1796.1.20, 2009-03-24 15:23:07+00:00, davehart@shiny.ad.hartbrothers.com
+ config.h:
+ include winsock.h before ws2tcpip.h to fix VS 2005 build
+
+ ports/winnt/include/config.h@1.57 +8 -5
+ include winsock.h before ws2tcpip.h to fix VS 2005 build
+
+ChangeSet@1.1436.15.22, 2009-03-24 15:22:36+00:00, davehart@shiny.ad.hartbrothers.com
+ config.h:
+ include winsock.h before ws2tcpip.h to fix VS 2005 build
+
+ ports/winnt/include/config.h@1.46.1.3 +8 -5
+ include winsock.h before ws2tcpip.h to fix VS 2005 build
+
+ChangeSet@1.1436.20.2, 2009-03-24 15:14:36+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_iocompletionport.c:
+ use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.2.2 +10 -1
+ use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76
+
+ChangeSet@1.1796.6.2, 2009-03-24 15:04:27+00:00, davehart@shiny.ad.hartbrothers.com
+ ntp_iocompletionport.c:
+ use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.35.1.2 +10 -1
+ use one receive per socket to avoid Win2000 afd.sys bugcheck 0x76
+
+ChangeSet@1.1436.15.20, 2009-03-22 21:09:43+00:00, davehart@shiny.ad.hartbrothers.com
+ Makefile.am, ChangeLog:
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ ChangeLog@1.1.1.56 +1 -0
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ libparse/Makefile.am@1.8.1.1 +1 -1
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ChangeSet@1.1436.15.19, 2009-03-20 03:39:26+00:00, hart@pogo.udel.edu
+ ChangeLog:
+ bk for windows isn't converting line endings correctly, remove two blank lines visible only on Unix side
+
+ ChangeLog@1.1.1.55 +0 -2
+ bk for windows isn't converting line endings correctly, remove two blank lines visible only on Unix side
+
+ChangeSet@1.1796.1.18, 2009-03-20 03:34:09+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ I'm learning
+ add DPRINTF line omitted accidentally
+
+ ChangeLog@1.268.1.20 +1 -1
+ add DPRINTF line omitted accidentally
+
+ ChangeLog@1.268.1.19 +2 -0
+ I'm learning
+
+ChangeSet@1.1436.15.16, 2009-03-20 03:10:22+00:00, davehart@shiny.ad.hartbrothers.com
+ ChangeLog:
+ remove blank first line
+
+ ChangeLog@1.1.1.52 +0 -1
+ remove blank first line
+
+ChangeSet@1.1436.20.1, 2009-03-20 01:46:15+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ChangeLog@1.1.15.1 +2 -0
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/ntp_io.c@1.244.3.1 +26 -23
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/ntpd.c@1.82.2.4 +14 -25
+ slightly reduce #ifdef SYS_WINNT forest
+
+ ntpd/refclock_dumbclock.c@1.8.1.1 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/refclock_hopfser.c@1.9.1.1 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/refclock_nmea.c@1.25.1.1 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/refclock_palisade.c@1.18.1.1 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ports/winnt/include/ntp_iocompletionport.h@1.13.1.1 +8 -9
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.2.1 +331 -249
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ports/winnt/ntpd/win32_io.c@1.12.1.1 +172 -66
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ChangeSet@1.1796.6.1, 2009-03-20 01:31:56+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+ ---
+ Merge shiny.ad.hartbrothers.com:c:\ntp\ntp-stable-873
+ into shiny.ad.hartbrothers.com:C:/ntp/ntp-dev-873
+
+ ChangeLog@1.268.5.1 +1 -0
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+
+ ntpd/ntp_io.c@1.275.1.1 +25 -22
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+
+ ntpd/ntpd.c@1.98 +17 -29
+ slightly reduce #ifdef SYS_WINNT forest
+
+
+ ntpd/refclock_dumbclock.c@1.10 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/refclock_hopfser.c@1.11 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/refclock_nmea.c@1.30 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ntpd/refclock_palisade.c@1.22 +6 -5
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+
+ ports/winnt/include/ntp_iocompletionport.h@1.15 +8 -9
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.35.1.1 +335 -255
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ ports/winnt/ntpd/win32_io.c@1.13 +172 -66
+ [Bug 873] Windows serial refclock proper TTY line discipline emulation
+
+ChangeSet@1.1436.19.2, 2009-03-18 11:44:59+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK)
+
+ ChangeLog@1.1.14.1 +2 -0
+ [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK)
+
+ChangeSet@1.1796.5.2, 2009-03-18 11:42:38+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK)
+
+ ChangeLog@1.268.4.1 +1 -0
+ [Bug 1014] Enable building with VC9 (in Visual Studio 2008, Visual C++ 2008, or SDK)
+
+ChangeSet@1.1436.17.4, 2009-03-18 10:14:52+00:00, davehart@shiny.ad.hartbrothers.com
+ [Bug 1117] Deferred interface binding under Windows works only correctly if FORCE_DNSRETRY is defined
+
+ ChangeLog@1.1.12.3 +2 -0
+ [Bug 1117] Deferred interface binding under Windows works only correctly if FORCE_DNSRETRY is defined
+
+ChangeSet@1.1796.5.1, 2009-03-17 19:21:10+00:00, davehart@shiny.ad.hartbrothers.com
+ [bug 1014] compile on VC9 AKA VC++ 2008 EE AKA VS 2008
+
+ ports/winnt/instsrv/instsrv.vcproj@1.1 +253 -0
+ [bug 1014] VC9 equivalent to .dsp
+
+ ports/winnt/instsrv/instsrv.vcproj@1.0 +0 -0
+
+ ports/winnt/libntp/libntp.vcproj@1.1 +2211 -0
+ [bug 1014] VC9 equivalent to .dsp
+
+ ports/winnt/libntp/libntp.vcproj@1.0 +0 -0
+
+ ports/winnt/ntp-keygen/ntp-keygen.vcproj@1.1 +419 -0
+ [bug 1014] VC9 equivalent to .dsp
+
+ ports/winnt/ntp-keygen/ntp-keygen.vcproj@1.0 +0 -0
+
+ ports/winnt/ntp.sln@1.2 +1 -1
+ [bug 1014] VC9 equivalent to ntp.dsw (checkin comment only change)
+
+ ports/winnt/ntp.sln@1.1 +71 -0
+ BitKeeper file C:/ntp/ntp-dev-1014/ports/winnt/ntp.sln
+
+ ports/winnt/ntp.sln@1.0 +0 -0
+
+ ports/winnt/ntpd/ntpd.vcproj@1.1 +2218 -0
+ [bug 1014] VC9 equivalent to .dsp
+
+ ports/winnt/ntpd/ntpd.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.1 +327 -0
+ [bug 1014] VC9 equivalent to .dsp
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.1 +376 -0
+ [bug 1014] VC9 equivalent to .dsp
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpq/ntpq.vcproj@1.1 +370 -0
+ [bug 1014] VC9 equivalent to .dsp
+
+ ports/winnt/ntpq/ntpq.vcproj@1.0 +0 -0
+
+ChangeSet@1.1436.19.1, 2009-03-17 18:39:09+00:00, davehart@shiny.ad.hartbrothers.com
+ add .sln and .vcproj files for VC9
+
+ ports/winnt/instsrv/Instsrv.vcproj@1.1 +253 -0
+ VC9 equivalent to Instsrv.dsp
+
+ ports/winnt/instsrv/Instsrv.vcproj@1.0 +0 -0
+
+ ports/winnt/libntp/libntp.vcproj@1.1 +2229 -0
+ VC9 equivalent to libntp.dsp
+
+ ports/winnt/libntp/libntp.vcproj@1.0 +0 -0
+
+ ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.1 +419 -0
+ VC9 equivalent to ntpkeygen.dsp
+
+ ports/winnt/ntp-keygen/ntpkeygen.vcproj@1.0 +0 -0
+
+ ports/winnt/ntp.sln@1.1 +71 -0
+ VC9 equivalent to ntp.dsw
+
+ ports/winnt/ntp.sln@1.0 +0 -0
+
+ ports/winnt/ntpd/ntpd.vcproj@1.1 +2198 -0
+ VC9 equivalent to ntpd.dsp
+
+ ports/winnt/ntpd/ntpd.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.1 +327 -0
+ VC9 equivalent to ntpdate.dsp
+
+ ports/winnt/ntpdate/ntpdate.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.1 +376 -0
+ VC9 equivalent to ntpdc.dsp
+
+ ports/winnt/ntpdc/ntpdc.vcproj@1.0 +0 -0
+
+ ports/winnt/ntpq/ntpq.vcproj@1.1 +370 -0
+ VC9 equivalent to ntpq.dsp
+
+ ports/winnt/ntpq/ntpq.vcproj@1.0 +0 -0
+
+ChangeSet@1.1436.17.3, 2009-03-17 18:18:13+00:00, hart@pogo.udel.edu
+ config.h:
+ now works with VC6 and VC9 compilers, declares DWORD_PTR on VC6
+
+ ports/winnt/include/config.h@1.46.1.2 +243 -96
+ now works with VC6 and VC9 compilers, declares DWORD_PTR on VC6
+
+ChangeSet@1.1796.4.3, 2009-03-17 18:15:41+00:00, hart@pogo.udel.edu
+ config.h:
+ now works with VC6 and VC9 compilers, declares DWORD_PTR for VC6
+
+ ports/winnt/include/config.h@1.55 +238 -116
+ now works with VC6 and VC9 compilers
+
+ChangeSet@1.1436.18.1, 2009-02-21 07:45:56-05:00, utterback@pogo.udel.edu
+ configure.ac, ChangeLog:
+ [BUG 1131] UDP sockets should not use SIGPOLL on Solaris.
+
+ ChangeLog@1.1.13.1 +2 -0
+ [BUG 1131] UDP sockets should not use SIGPOLL on Solaris.
+
+ configure.ac@1.400.1.2 +3 -0
+ [BUG 1131] UDP sockets should not use SIGPOLL on Solaris.
+
+ChangeSet@1.1436.17.2, 2009-02-07 21:13:17+00:00, hart@pogo.udel.edu
+ ChangeLog:
+ formatting of newest line
+
+ ChangeLog@1.1.12.2 +1 -1
+ formatting of newest line
+
+ChangeSet@1.1436.17.1, 2009-02-07 21:05:32+00:00, hart@pogo.udel.edu
+ nt_clockstuff.c, ChangeLog, ntp_iocompletionport.c:
+ [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU
+
+ ChangeLog@1.1.12.1 +2 -0
+ [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.23.1.1 +89 -22
+ [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.6 +12 -0
+ [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU
+
+ChangeSet@1.1436.15.14, 2009-02-07 14:08:35-05:00, hart@pogo.udel.edu
+ ChangeLog:
+ DPRINTF safer
+
+ ChangeLog@1.1.1.50 +2 -0
+ DPRINTF safer
+
+ChangeSet@1.1436.15.13, 2009-02-06 19:00:15-05:00, hart@pogo.udel.edu
+ ntp_debug.h:
+ DPRINTF won't eat following else, always evaluates to a statement
+ ntp_io.c:
+ DPRINTF_INTERFACE always evaluates to a statement
+ fix DPRINTF use with misplaced semicolon
+
+ include/ntp_debug.h@1.2 +6 -4
+ DPRINTF won't eat following else, always evaluates to a statement
+
+ ntpd/ntp_io.c@1.244.2.13 +2 -2
+ DPRINTF_INTERFACE always evaluates to a statement
+ fix DPRINTF use with misplaced semicolon
+
+ChangeSet@1.1796.1.13, 2009-01-30 06:54:34-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P158
+ TAG: NTP_4_2_5P158
+
+ ChangeLog@1.268.1.13 +1 -0
+ NTP_4_2_5P158
+
+ gsoc_sntp/sntp-opts.c@1.19 +2 -2
+ NTP_4_2_5P158
+
+ gsoc_sntp/sntp-opts.h@1.19 +3 -3
+ NTP_4_2_5P158
+
+ gsoc_sntp/sntp-opts.texi@1.19 +1 -1
+ NTP_4_2_5P158
+
+ gsoc_sntp/sntp.1@1.19 +2 -2
+ NTP_4_2_5P158
+
+ ntpd/ntpd-opts.c@1.150 +2 -2
+ NTP_4_2_5P158
+
+ ntpd/ntpd-opts.h@1.150 +3 -3
+ NTP_4_2_5P158
+
+ ntpd/ntpd-opts.texi@1.149 +1 -1
+ NTP_4_2_5P158
+
+ ntpd/ntpd.1@1.149 +2 -2
+ NTP_4_2_5P158
+
+ ntpdc/ntpdc-opts.c@1.146 +2 -2
+ NTP_4_2_5P158
+
+ ntpdc/ntpdc-opts.h@1.146 +3 -3
+ NTP_4_2_5P158
+
+ ntpdc/ntpdc-opts.texi@1.145 +1 -1
+ NTP_4_2_5P158
+
+ ntpdc/ntpdc.1@1.145 +2 -2
+ NTP_4_2_5P158
+
+ ntpq/ntpq-opts.c@1.146 +2 -2
+ NTP_4_2_5P158
+
+ ntpq/ntpq-opts.h@1.146 +3 -3
+ NTP_4_2_5P158
+
+ ntpq/ntpq-opts.texi@1.145 +1 -1
+ NTP_4_2_5P158
+
+ ntpq/ntpq.1@1.145 +2 -2
+ NTP_4_2_5P158
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.27 +2 -2
+ NTP_4_2_5P158
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.27 +3 -3
+ NTP_4_2_5P158
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.27 +1 -1
+ NTP_4_2_5P158
+
+ ntpsnmpd/ntpsnmpd.1@1.27 +2 -2
+ NTP_4_2_5P158
+
+ packageinfo.sh@1.161 +1 -1
+ NTP_4_2_5P158
+
+ sntp/sntp-opts.c@1.146 +2 -2
+ NTP_4_2_5P158
+
+ sntp/sntp-opts.h@1.146 +3 -3
+ NTP_4_2_5P158
+
+ sntp/sntp-opts.texi@1.145 +1 -1
+ NTP_4_2_5P158
+
+ sntp/sntp.1@1.145 +2 -2
+ NTP_4_2_5P158
+
+ util/ntp-keygen-opts.c@1.149 +2 -2
+ NTP_4_2_5P158
+
+ util/ntp-keygen-opts.h@1.149 +3 -3
+ NTP_4_2_5P158
+
+ util/ntp-keygen-opts.texi@1.148 +1 -1
+ NTP_4_2_5P158
+
+ util/ntp-keygen.1@1.148 +2 -2
+ NTP_4_2_5P158
+
+ChangeSet@1.1796.1.12, 2009-01-30 03:47:58-05:00, stenn@whimsy.udel.edu
+ Fix [CID 72], a typo introduced at the latest fix to prettydate.c
+
+ ChangeLog@1.268.1.12 +1 -0
+ Fix [CID 72], a typo introduced at the latest fix to prettydate.c
+
+ libntp/prettydate.c@1.10 +2 -1
+ Fix [CID 72], a typo introduced at the latest fix to prettydate.c
+
+ChangeSet@1.1796.1.11, 2009-01-26 06:55:24-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P157
+ TAG: NTP_4_2_5P157
+
+ ChangeLog@1.268.1.11 +1 -0
+ NTP_4_2_5P157
+
+ gsoc_sntp/sntp-opts.c@1.18 +2 -2
+ NTP_4_2_5P157
+
+ gsoc_sntp/sntp-opts.h@1.18 +3 -3
+ NTP_4_2_5P157
+
+ gsoc_sntp/sntp-opts.texi@1.18 +1 -1
+ NTP_4_2_5P157
+
+ gsoc_sntp/sntp.1@1.18 +2 -2
+ NTP_4_2_5P157
+
+ ntpd/ntpd-opts.c@1.149 +2 -2
+ NTP_4_2_5P157
+
+ ntpd/ntpd-opts.h@1.149 +3 -3
+ NTP_4_2_5P157
+
+ ntpd/ntpd-opts.texi@1.148 +2 -2
+ NTP_4_2_5P157
+
+ ntpd/ntpd.1@1.148 +2 -2
+ NTP_4_2_5P157
+
+ ntpdc/ntpdc-opts.c@1.145 +2 -2
+ NTP_4_2_5P157
+
+ ntpdc/ntpdc-opts.h@1.145 +3 -3
+ NTP_4_2_5P157
+
+ ntpdc/ntpdc-opts.texi@1.144 +2 -2
+ NTP_4_2_5P157
+
+ ntpdc/ntpdc.1@1.144 +2 -2
+ NTP_4_2_5P157
+
+ ntpq/ntpq-opts.c@1.145 +2 -2
+ NTP_4_2_5P157
+
+ ntpq/ntpq-opts.h@1.145 +3 -3
+ NTP_4_2_5P157
+
+ ntpq/ntpq-opts.texi@1.144 +2 -2
+ NTP_4_2_5P157
+
+ ntpq/ntpq.1@1.144 +2 -2
+ NTP_4_2_5P157
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.26 +2 -2
+ NTP_4_2_5P157
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.26 +3 -3
+ NTP_4_2_5P157
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.26 +1 -1
+ NTP_4_2_5P157
+
+ ntpsnmpd/ntpsnmpd.1@1.26 +2 -2
+ NTP_4_2_5P157
+
+ packageinfo.sh@1.160 +1 -1
+ NTP_4_2_5P157
+
+ sntp/sntp-opts.c@1.145 +2 -2
+ NTP_4_2_5P157
+
+ sntp/sntp-opts.h@1.145 +3 -3
+ NTP_4_2_5P157
+
+ sntp/sntp-opts.texi@1.144 +1 -1
+ NTP_4_2_5P157
+
+ sntp/sntp.1@1.144 +2 -2
+ NTP_4_2_5P157
+
+ util/ntp-keygen-opts.c@1.148 +2 -2
+ NTP_4_2_5P157
+
+ util/ntp-keygen-opts.h@1.148 +3 -3
+ NTP_4_2_5P157
+
+ util/ntp-keygen-opts.texi@1.147 +2 -2
+ NTP_4_2_5P157
+
+ util/ntp-keygen.1@1.147 +2 -2
+ NTP_4_2_5P157
+
+ChangeSet@1.1796.1.10, 2009-01-26 02:08:57-05:00, stenn@whimsy.udel.edu
+ Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills
+
+ ChangeLog@1.268.1.10 +1 -0
+ Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills
+
+ ntpd/ntp_crypto.c@1.128 +31 -16
+ Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills
+
+ ntpd/ntp_proto.c@1.276.1.1 +7 -12
+ Cleanup/fixes for ntp_proto.c and ntp_crypto.c from Dave Mills
+
+ChangeSet@1.1796.1.9, 2009-01-19 06:56:21-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P156
+ TAG: NTP_4_2_5P156
+
+ ChangeLog@1.268.1.9 +1 -0
+ NTP_4_2_5P156
+
+ gsoc_sntp/sntp-opts.c@1.17 +2 -2
+ NTP_4_2_5P156
+
+ gsoc_sntp/sntp-opts.h@1.17 +3 -3
+ NTP_4_2_5P156
+
+ gsoc_sntp/sntp-opts.texi@1.17 +1 -1
+ NTP_4_2_5P156
+
+ gsoc_sntp/sntp.1@1.17 +2 -2
+ NTP_4_2_5P156
+
+ ntpd/ntpd-opts.c@1.148 +2 -2
+ NTP_4_2_5P156
+
+ ntpd/ntpd-opts.h@1.148 +3 -3
+ NTP_4_2_5P156
+
+ ntpd/ntpd-opts.texi@1.147 +1 -1
+ NTP_4_2_5P156
+
+ ntpd/ntpd.1@1.147 +2 -2
+ NTP_4_2_5P156
+
+ ntpdc/ntpdc-opts.c@1.144 +2 -2
+ NTP_4_2_5P156
+
+ ntpdc/ntpdc-opts.h@1.144 +3 -3
+ NTP_4_2_5P156
+
+ ntpdc/ntpdc-opts.texi@1.143 +1 -1
+ NTP_4_2_5P156
+
+ ntpdc/ntpdc.1@1.143 +2 -2
+ NTP_4_2_5P156
+
+ ntpq/ntpq-opts.c@1.144 +2 -2
+ NTP_4_2_5P156
+
+ ntpq/ntpq-opts.h@1.144 +3 -3
+ NTP_4_2_5P156
+
+ ntpq/ntpq-opts.texi@1.143 +1 -1
+ NTP_4_2_5P156
+
+ ntpq/ntpq.1@1.143 +2 -2
+ NTP_4_2_5P156
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.25 +2 -2
+ NTP_4_2_5P156
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.25 +3 -3
+ NTP_4_2_5P156
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.25 +1 -1
+ NTP_4_2_5P156
+
+ ntpsnmpd/ntpsnmpd.1@1.25 +2 -2
+ NTP_4_2_5P156
+
+ packageinfo.sh@1.159 +1 -1
+ NTP_4_2_5P156
+
+ sntp/sntp-opts.c@1.144 +2 -2
+ NTP_4_2_5P156
+
+ sntp/sntp-opts.h@1.144 +3 -3
+ NTP_4_2_5P156
+
+ sntp/sntp-opts.texi@1.143 +1 -1
+ NTP_4_2_5P156
+
+ sntp/sntp.1@1.143 +2 -2
+ NTP_4_2_5P156
+
+ util/ntp-keygen-opts.c@1.147 +2 -2
+ NTP_4_2_5P156
+
+ util/ntp-keygen-opts.h@1.147 +3 -3
+ NTP_4_2_5P156
+
+ util/ntp-keygen-opts.texi@1.146 +1 -1
+ NTP_4_2_5P156
+
+ util/ntp-keygen.1@1.146 +2 -2
+ NTP_4_2_5P156
+
+ChangeSet@1.1796.3.7, 2009-01-19 03:51:58-05:00, stenn@whimsy.udel.edu
+ [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c
+
+ ChangeLog@1.268.3.7 +1 -0
+ [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c
+
+ ntpd/ntp_crypto.c@1.127 +7 -7
+ [Bug 1119] [CID 52] Avoid a possible null-dereference in ntp_crypto.c
+
+ChangeSet@1.1796.3.6, 2009-01-19 03:41:10-05:00, stenn@whimsy.udel.edu
+ [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it
+
+ ChangeLog@1.268.3.6 +1 -0
+ [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it
+
+ ntpd/ntp_control.c@1.107 +2 -0
+ [Bug 1120] [CID 51] INSIST that peer is non-null before we dereference it
+
+ChangeSet@1.1796.3.5, 2009-01-19 02:58:27-05:00, stenn@whimsy.udel.edu
+ [Bug 1121] [CID 47] double fclose() in ntp-keygen.c
+
+ ChangeLog@1.268.3.5 +1 -0
+ [Bug 1121] [CID 47] double fclose() in ntp-keygen.c
+
+ util/ntp-keygen.c@1.53 +0 -1
+ [Bug 1121] [CID 47] double fclose() in ntp-keygen.c
+
+ChangeSet@1.1796.3.4, 2009-01-18 06:55:12-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P155
+ TAG: NTP_4_2_5P155
+
+ ChangeLog@1.268.3.4 +1 -0
+ NTP_4_2_5P155
+
+ gsoc_sntp/sntp-opts.c@1.16 +2 -2
+ NTP_4_2_5P155
+
+ gsoc_sntp/sntp-opts.h@1.16 +3 -3
+ NTP_4_2_5P155
+
+ gsoc_sntp/sntp-opts.texi@1.16 +1 -1
+ NTP_4_2_5P155
+
+ gsoc_sntp/sntp.1@1.16 +2 -2
+ NTP_4_2_5P155
+
+ ntpd/ntpd-opts.c@1.147 +2 -2
+ NTP_4_2_5P155
+
+ ntpd/ntpd-opts.h@1.147 +3 -3
+ NTP_4_2_5P155
+
+ ntpd/ntpd-opts.texi@1.146 +1 -1
+ NTP_4_2_5P155
+
+ ntpd/ntpd.1@1.146 +2 -2
+ NTP_4_2_5P155
+
+ ntpdc/ntpdc-opts.c@1.143 +2 -2
+ NTP_4_2_5P155
+
+ ntpdc/ntpdc-opts.h@1.143 +3 -3
+ NTP_4_2_5P155
+
+ ntpdc/ntpdc-opts.texi@1.142 +1 -1
+ NTP_4_2_5P155
+
+ ntpdc/ntpdc.1@1.142 +2 -2
+ NTP_4_2_5P155
+
+ ntpq/ntpq-opts.c@1.143 +2 -2
+ NTP_4_2_5P155
+
+ ntpq/ntpq-opts.h@1.143 +3 -3
+ NTP_4_2_5P155
+
+ ntpq/ntpq-opts.texi@1.142 +1 -1
+ NTP_4_2_5P155
+
+ ntpq/ntpq.1@1.142 +2 -2
+ NTP_4_2_5P155
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.24 +2 -2
+ NTP_4_2_5P155
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.24 +3 -3
+ NTP_4_2_5P155
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.24 +1 -1
+ NTP_4_2_5P155
+
+ ntpsnmpd/ntpsnmpd.1@1.24 +2 -2
+ NTP_4_2_5P155
+
+ packageinfo.sh@1.158 +1 -1
+ NTP_4_2_5P155
+
+ sntp/sntp-opts.c@1.143 +2 -2
+ NTP_4_2_5P155
+
+ sntp/sntp-opts.h@1.143 +3 -3
+ NTP_4_2_5P155
+
+ sntp/sntp-opts.texi@1.142 +1 -1
+ NTP_4_2_5P155
+
+ sntp/sntp.1@1.142 +2 -2
+ NTP_4_2_5P155
+
+ util/ntp-keygen-opts.c@1.146 +2 -2
+ NTP_4_2_5P155
+
+ util/ntp-keygen-opts.h@1.146 +3 -3
+ NTP_4_2_5P155
+
+ util/ntp-keygen-opts.texi@1.145 +1 -1
+ NTP_4_2_5P155
+
+ util/ntp-keygen.1@1.145 +2 -2
+ NTP_4_2_5P155
+
+ChangeSet@1.1796.3.3, 2009-01-17 19:30:18-05:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.268.3.3 +1 -0
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.27 +6 -1
+ Documentation updates from Dave Mills
+
+ html/config.html@1.22 +19 -149
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.5 +9 -4
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.47 +21 -5
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1796.3.2, 2009-01-17 19:25:33-05:00, stenn@whimsy.udel.edu
+ CHU Frequency updates
+
+ ChangeLog@1.268.3.2 +1 -0
+ CHU Frequency updates
+
+ html/drivers/driver7.html@1.27 +11 -2
+ CHU Frequency updates
+
+ ntpd/refclock_chu.c@1.45 +4 -4
+ CHU Frequency updates
+
+ChangeSet@1.1796.3.1, 2009-01-17 19:08:44-05:00, stenn@whimsy.udel.edu
+ Design assertion fixes for ntp_crypto.c from Dave Mills
+
+ ChangeLog@1.268.3.1 +1 -0
+ Design assertion fixes for ntp_crypto.c from Dave Mills
+
+ ntpd/ntp_crypto.c@1.126 +3 -6
+ Design assertion fixes for ntp_crypto.c from Dave Mills
+
+ChangeSet@1.1796.1.7, 2009-01-16 15:53:26+01:00, burnicki@pogo.udel.edu
+ Bug 1118: Fixed sign extension for 32 bit time_t in caljulian() and prettydate().
+ Fixed some compiler warnings about missing prototypes.
+ Fixed some other simple compiler warnings.
+
+ ChangeLog@1.268.1.7 +3 -0
+ Bug 1118: Fixed sign extension for 32 bit time_t in caljulian() and prettydate().
+ Fixed some compiler warnings about missing prototypes.
+ Fixed some other simple compiler warnings.
+
+ include/recvbuff.h@1.16 +2 -1
+ Added prototype for get_free_recv_buffer_alloc().
+
+ libntp/caljulian.c@1.11 +11 -2
+ Bug 1118: Fixed sign extension for 32 bit time_t.
+ Added 2 casts to fix compiler warnings.
+
+ libntp/prettydate.c@1.9 +10 -1
+ Bug 1118: Fixed sign extension for 32 bit time_t.
+ Fixed a compiler warning.
+
+ ntpd/ntp_timer.c@1.49 +4 -1
+ Include openssl/rand.h to have prototypes available.
+
+ChangeSet@1.1796.1.6, 2009-01-13 06:57:59-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P154
+ TAG: NTP_4_2_5P154
+
+ ChangeLog@1.268.1.6 +1 -0
+ NTP_4_2_5P154
+
+ gsoc_sntp/sntp-opts.c@1.15 +2 -2
+ NTP_4_2_5P154
+
+ gsoc_sntp/sntp-opts.h@1.15 +3 -3
+ NTP_4_2_5P154
+
+ gsoc_sntp/sntp-opts.texi@1.15 +1 -1
+ NTP_4_2_5P154
+
+ gsoc_sntp/sntp.1@1.15 +2 -2
+ NTP_4_2_5P154
+
+ ntpd/ntpd-opts.c@1.146 +2 -2
+ NTP_4_2_5P154
+
+ ntpd/ntpd-opts.h@1.146 +3 -3
+ NTP_4_2_5P154
+
+ ntpd/ntpd-opts.texi@1.145 +1 -1
+ NTP_4_2_5P154
+
+ ntpd/ntpd.1@1.145 +2 -2
+ NTP_4_2_5P154
+
+ ntpdc/ntpdc-opts.c@1.142 +2 -2
+ NTP_4_2_5P154
+
+ ntpdc/ntpdc-opts.h@1.142 +3 -3
+ NTP_4_2_5P154
+
+ ntpdc/ntpdc-opts.texi@1.141 +1 -1
+ NTP_4_2_5P154
+
+ ntpdc/ntpdc.1@1.141 +2 -2
+ NTP_4_2_5P154
+
+ ntpq/ntpq-opts.c@1.142 +2 -2
+ NTP_4_2_5P154
+
+ ntpq/ntpq-opts.h@1.142 +3 -3
+ NTP_4_2_5P154
+
+ ntpq/ntpq-opts.texi@1.141 +1 -1
+ NTP_4_2_5P154
+
+ ntpq/ntpq.1@1.141 +2 -2
+ NTP_4_2_5P154
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.23 +2 -2
+ NTP_4_2_5P154
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.23 +3 -3
+ NTP_4_2_5P154
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.23 +1 -1
+ NTP_4_2_5P154
+
+ ntpsnmpd/ntpsnmpd.1@1.23 +2 -2
+ NTP_4_2_5P154
+
+ packageinfo.sh@1.157 +1 -1
+ NTP_4_2_5P154
+
+ sntp/sntp-opts.c@1.142 +2 -2
+ NTP_4_2_5P154
+
+ sntp/sntp-opts.h@1.142 +3 -3
+ NTP_4_2_5P154
+
+ sntp/sntp-opts.texi@1.141 +1 -1
+ NTP_4_2_5P154
+
+ sntp/sntp.1@1.141 +2 -2
+ NTP_4_2_5P154
+
+ util/ntp-keygen-opts.c@1.145 +2 -2
+ NTP_4_2_5P154
+
+ util/ntp-keygen-opts.h@1.145 +3 -3
+ NTP_4_2_5P154
+
+ util/ntp-keygen-opts.texi@1.144 +1 -1
+ NTP_4_2_5P154
+
+ util/ntp-keygen.1@1.144 +2 -2
+ NTP_4_2_5P154
+
+ChangeSet@1.1796.1.5, 2009-01-11 16:53:36+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ bug 992 - support interface event change on Linux
+ configure.ac, ntp_io.c:
+ support interface event change on Linux
+
+ ChangeLog@1.268.1.5 +2 -0
+ bug 992 - support interface event change on Linux
+
+ configure.ac@1.422 +13 -1
+ support interface event change on Linux
+
+ ntpd/ntp_io.c@1.275 +55 -13
+ support interface event change on Linux
+
+ChangeSet@1.1796.1.4, 2009-01-09 07:20:22-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P153
+ TAG: NTP_4_2_5P153
+
+ ChangeLog@1.268.1.4 +1 -0
+ NTP_4_2_5P153
+
+ gsoc_sntp/sntp-opts.c@1.14 +2 -2
+ NTP_4_2_5P153
+
+ gsoc_sntp/sntp-opts.h@1.14 +3 -3
+ NTP_4_2_5P153
+
+ gsoc_sntp/sntp-opts.texi@1.14 +1 -1
+ NTP_4_2_5P153
+
+ gsoc_sntp/sntp.1@1.14 +2 -2
+ NTP_4_2_5P153
+
+ ntpd/ntpd-opts.c@1.145 +2 -2
+ NTP_4_2_5P153
+
+ ntpd/ntpd-opts.h@1.145 +3 -3
+ NTP_4_2_5P153
+
+ ntpd/ntpd-opts.texi@1.144 +1 -1
+ NTP_4_2_5P153
+
+ ntpd/ntpd.1@1.144 +2 -2
+ NTP_4_2_5P153
+
+ ntpdc/ntpdc-opts.c@1.141 +2 -2
+ NTP_4_2_5P153
+
+ ntpdc/ntpdc-opts.h@1.141 +3 -3
+ NTP_4_2_5P153
+
+ ntpdc/ntpdc-opts.texi@1.140 +1 -1
+ NTP_4_2_5P153
+
+ ntpdc/ntpdc.1@1.140 +2 -2
+ NTP_4_2_5P153
+
+ ntpq/ntpq-opts.c@1.141 +2 -2
+ NTP_4_2_5P153
+
+ ntpq/ntpq-opts.h@1.141 +3 -3
+ NTP_4_2_5P153
+
+ ntpq/ntpq-opts.texi@1.140 +1 -1
+ NTP_4_2_5P153
+
+ ntpq/ntpq.1@1.140 +2 -2
+ NTP_4_2_5P153
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.22 +2 -2
+ NTP_4_2_5P153
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.22 +3 -3
+ NTP_4_2_5P153
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.22 +1 -1
+ NTP_4_2_5P153
+
+ ntpsnmpd/ntpsnmpd.1@1.22 +2 -2
+ NTP_4_2_5P153
+
+ packageinfo.sh@1.156 +1 -1
+ NTP_4_2_5P153
+
+ sntp/sntp-opts.c@1.141 +2 -2
+ NTP_4_2_5P153
+
+ sntp/sntp-opts.h@1.141 +3 -3
+ NTP_4_2_5P153
+
+ sntp/sntp-opts.texi@1.140 +1 -1
+ NTP_4_2_5P153
+
+ sntp/sntp.1@1.140 +2 -2
+ NTP_4_2_5P153
+
+ util/ntp-keygen-opts.c@1.144 +2 -2
+ NTP_4_2_5P153
+
+ util/ntp-keygen-opts.h@1.144 +3 -3
+ NTP_4_2_5P153
+
+ util/ntp-keygen-opts.texi@1.143 +1 -1
+ NTP_4_2_5P153
+
+ util/ntp-keygen.1@1.143 +2 -2
+ NTP_4_2_5P153
+
+ChangeSet@1.1796.2.3, 2009-01-08 09:46:10-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P152
+ TAG: NTP_4_2_5P152
+
+ ChangeLog@1.268.2.2 +1 -0
+ NTP_4_2_5P152
+
+ gsoc_sntp/sntp-opts.c@1.13 +2 -2
+ NTP_4_2_5P152
+
+ gsoc_sntp/sntp-opts.h@1.13 +3 -3
+ NTP_4_2_5P152
+
+ gsoc_sntp/sntp-opts.texi@1.13 +1 -1
+ NTP_4_2_5P152
+
+ gsoc_sntp/sntp.1@1.13 +2 -2
+ NTP_4_2_5P152
+
+ ntpd/ntpd-opts.c@1.144 +2 -2
+ NTP_4_2_5P152
+
+ ntpd/ntpd-opts.h@1.144 +3 -3
+ NTP_4_2_5P152
+
+ ntpd/ntpd-opts.texi@1.143 +1 -1
+ NTP_4_2_5P152
+
+ ntpd/ntpd.1@1.143 +2 -2
+ NTP_4_2_5P152
+
+ ntpdc/ntpdc-opts.c@1.140 +2 -2
+ NTP_4_2_5P152
+
+ ntpdc/ntpdc-opts.h@1.140 +3 -3
+ NTP_4_2_5P152
+
+ ntpdc/ntpdc-opts.texi@1.139 +1 -1
+ NTP_4_2_5P152
+
+ ntpdc/ntpdc.1@1.139 +2 -2
+ NTP_4_2_5P152
+
+ ntpq/ntpq-opts.c@1.140 +2 -2
+ NTP_4_2_5P152
+
+ ntpq/ntpq-opts.h@1.140 +3 -3
+ NTP_4_2_5P152
+
+ ntpq/ntpq-opts.texi@1.139 +1 -1
+ NTP_4_2_5P152
+
+ ntpq/ntpq.1@1.139 +2 -2
+ NTP_4_2_5P152
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.21 +2 -2
+ NTP_4_2_5P152
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.21 +3 -3
+ NTP_4_2_5P152
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.21 +1 -1
+ NTP_4_2_5P152
+
+ ntpsnmpd/ntpsnmpd.1@1.21 +2 -2
+ NTP_4_2_5P152
+
+ packageinfo.sh@1.155 +1 -1
+ NTP_4_2_5P152
+
+ sntp/sntp-opts.c@1.140 +2 -2
+ NTP_4_2_5P152
+
+ sntp/sntp-opts.h@1.140 +3 -3
+ NTP_4_2_5P152
+
+ sntp/sntp-opts.texi@1.139 +1 -1
+ NTP_4_2_5P152
+
+ sntp/sntp.1@1.139 +2 -2
+ NTP_4_2_5P152
+
+ util/ntp-keygen-opts.c@1.143 +2 -2
+ NTP_4_2_5P152
+
+ util/ntp-keygen-opts.h@1.143 +3 -3
+ NTP_4_2_5P152
+
+ util/ntp-keygen-opts.texi@1.142 +1 -1
+ NTP_4_2_5P152
+
+ util/ntp-keygen.1@1.142 +2 -2
+ NTP_4_2_5P152
+
+ChangeSet@1.1796.2.2, 2009-01-08 08:07:59-05:00, stenn@whimsy.udel.edu
+ merge cleanup
+
+ ntpd/ntp_crypto.c@1.125 +1 -1
+ merge cleanup
+
+ChangeSet@1.1436.15.12, 2009-01-08 06:21:48-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P6
+ TAG: NTP_4_2_4P6
+
+ ChangeLog@1.1.1.49 +1 -2
+ NTP_4_2_4P6
+
+ ntpd/ntpd-opts.c@1.50.17.2 +2 -2
+ NTP_4_2_4P6
+
+ ntpd/ntpd-opts.h@1.50.17.2 +3 -3
+ NTP_4_2_4P6
+
+ ntpd/ntpd-opts.texi@1.49.17.2 +1 -1
+ NTP_4_2_4P6
+
+ ntpd/ntpd.1@1.48.17.2 +2 -2
+ NTP_4_2_4P6
+
+ ntpd/ntpdsim-opts.c@1.50.17.2 +2 -2
+ NTP_4_2_4P6
+
+ ntpd/ntpdsim-opts.h@1.50.17.2 +3 -3
+ NTP_4_2_4P6
+
+ ntpd/ntpdsim-opts.texi@1.48.17.2 +1 -1
+ NTP_4_2_4P6
+
+ ntpd/ntpdsim.1@1.48.17.2 +2 -2
+ NTP_4_2_4P6
+
+ ntpdc/ntpdc-opts.c@1.50.17.2 +2 -2
+ NTP_4_2_4P6
+
+ ntpdc/ntpdc-opts.h@1.50.17.2 +3 -3
+ NTP_4_2_4P6
+
+ ntpdc/ntpdc-opts.texi@1.48.17.2 +1 -1
+ NTP_4_2_4P6
+
+ ntpdc/ntpdc.1@1.48.17.2 +2 -2
+ NTP_4_2_4P6
+
+ ntpq/ntpq-opts.c@1.52.17.2 +2 -2
+ NTP_4_2_4P6
+
+ ntpq/ntpq-opts.h@1.52.17.2 +3 -3
+ NTP_4_2_4P6
+
+ ntpq/ntpq-opts.texi@1.49.17.2 +1 -1
+ NTP_4_2_4P6
+
+ ntpq/ntpq.1@1.48.17.2 +2 -2
+ NTP_4_2_4P6
+
+ packageinfo.sh@1.65.24.4 +1 -1
+ NTP_4_2_4P6
+
+ sntp/sntp-opts.c@1.49.17.2 +2 -2
+ NTP_4_2_4P6
+
+ sntp/sntp-opts.h@1.49.17.2 +3 -3
+ NTP_4_2_4P6
+
+ sntp/sntp-opts.texi@1.46.17.2 +1 -1
+ NTP_4_2_4P6
+
+ sntp/sntp.1@1.49.17.2 +2 -2
+ NTP_4_2_4P6
+
+ util/ntp-keygen-opts.c@1.49.17.2 +2 -2
+ NTP_4_2_4P6
+
+ util/ntp-keygen-opts.h@1.49.17.2 +3 -3
+ NTP_4_2_4P6
+
+ util/ntp-keygen-opts.texi@1.47.17.2 +1 -1
+ NTP_4_2_4P6
+
+ util/ntp-keygen.1@1.47.17.2 +2 -2
+ NTP_4_2_4P6
+
+ChangeSet@1.1436.15.11, 2009-01-08 04:49:23-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P5
+ TAG: NTP_4_2_4P5
+
+ ChangeLog@1.1.1.48 +1 -0
+ NTP_4_2_4P5
+
+ ntpd/ntpd-opts.c@1.50.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpd/ntpd-opts.h@1.50.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpd/ntpd-opts.texi@1.49.17.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpd/ntpd.1@1.48.17.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim-opts.c@1.50.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim-opts.h@1.50.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim-opts.texi@1.48.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim.1@1.48.17.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc-opts.c@1.50.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc-opts.h@1.50.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc-opts.texi@1.48.17.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc.1@1.48.17.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpq/ntpq-opts.c@1.52.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpq/ntpq-opts.h@1.52.17.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpq/ntpq-opts.texi@1.49.17.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpq/ntpq.1@1.48.17.1 +2 -2
+ NTP_4_2_4P5
+
+ packageinfo.sh@1.65.24.3 +2 -2
+ NTP_4_2_4P5
+
+ sntp/sntp-opts.c@1.49.17.1 +1 -1
+ NTP_4_2_4P5
+
+ sntp/sntp-opts.h@1.49.17.1 +1 -1
+ NTP_4_2_4P5
+
+ sntp/sntp-opts.texi@1.46.17.1 +1 -1
+ NTP_4_2_4P5
+
+ sntp/sntp.1@1.49.17.1 +2 -2
+ NTP_4_2_4P5
+
+ util/ntp-keygen-opts.c@1.49.17.1 +1 -1
+ NTP_4_2_4P5
+
+ util/ntp-keygen-opts.h@1.49.17.1 +1 -1
+ NTP_4_2_4P5
+
+ util/ntp-keygen-opts.texi@1.47.17.1 +2 -2
+ NTP_4_2_4P5
+
+ util/ntp-keygen.1@1.47.17.1 +2 -2
+ NTP_4_2_4P5
+
+ChangeSet@1.1436.15.10, 2009-01-08 03:21:09-05:00, stenn@whimsy.udel.edu
+ 4.2.4p6
+
+ packageinfo.sh@1.65.24.2 +1 -1
+ 4.2.4p6
+
+ChangeSet@1.1436.15.9, 2009-01-08 03:14:17-05:00, stenn@whimsy.udel.edu
+ merge cleanup
+
+ ChangeLog@1.1.1.47 +1 -1
+ merge cleanup
+
+ChangeSet@1.1436.16.1, 2009-01-08 02:57:52-05:00, stenn@whimsy.udel.edu
+ 4.2.4p6
+
+ ChangeLog@1.1.1.45 +6 -0
+ Fix incorrect check of EVP_VerifyFinal()'s return value.
+
+ NEWS@1.86.1.14 +16 -0
+ 4.2.4p6
+
+ html/copyright.html@1.36.1.2 +1 -1
+ Update the copyright year
+
+ ntpd/ntp_crypto.c@1.107.1.1 +1 -1
+ Fix incorrect check of EVP_VerifyFinal()'s return value.
+
+ packageinfo.sh@1.65.24.1 +1 -1
+ 4.2.4p6
+
+ChangeSet@1.1436.15.7, 2009-01-07 18:00:50+01:00, burnicki@pogo.udel.edu
+ [BUG 1113] Fixed build errors with recent versions of openSSL.
+
+ ChangeLog@1.1.11.1 +1 -0
+ [BUG 1113] Fixed build errors with recent versions of openSSL.
+
+ ntpd/ntp_crypto.c@1.107.2.1 +2 -2
+ [BUG 1113] Fixed build errors with recent versions of openSSL.
+
+ChangeSet@1.1796.1.2, 2009-01-07 15:18:18+01:00, burnicki@pogo.udel.edu
+ Renamed gsoc_sntp/:fetch-stubs to gsoc_sntp/fetch-stubs to avoid
+ file name problems under Windows.
+ Removed German umlaut from log msg for 4.2.5p142.
+
+ ChangeLog@1.268.1.2 +4 -1
+ Renamed gsoc_sntp/:fetch-stubs to gsoc_sntp/fetch-stubs to avoid
+ file name problems under Windows.
+ Removed German umlaut from log msg for 4.2.5p142.
+
+ gsoc_sntp/fetch-stubs@1.5 +0 -0
+ Rename: gsoc_sntp/:fetch-stubs -> gsoc_sntp/fetch-stubs
+
+ChangeSet@1.1796.1.1, 2008-12-23 06:53:33-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P151
+ TAG: NTP_4_2_5P151
+
+ ChangeLog@1.268.1.1 +1 -0
+ NTP_4_2_5P151
+
+ gsoc_sntp/sntp-opts.c@1.12 +2 -2
+ NTP_4_2_5P151
+
+ gsoc_sntp/sntp-opts.h@1.12 +3 -3
+ NTP_4_2_5P151
+
+ gsoc_sntp/sntp-opts.texi@1.12 +1 -1
+ NTP_4_2_5P151
+
+ gsoc_sntp/sntp.1@1.12 +2 -2
+ NTP_4_2_5P151
+
+ ntpd/ntpd-opts.c@1.143 +2 -2
+ NTP_4_2_5P151
+
+ ntpd/ntpd-opts.h@1.143 +3 -3
+ NTP_4_2_5P151
+
+ ntpd/ntpd-opts.texi@1.142 +1 -1
+ NTP_4_2_5P151
+
+ ntpd/ntpd.1@1.142 +2 -2
+ NTP_4_2_5P151
+
+ ntpdc/ntpdc-opts.c@1.139 +2 -2
+ NTP_4_2_5P151
+
+ ntpdc/ntpdc-opts.h@1.139 +3 -3
+ NTP_4_2_5P151
+
+ ntpdc/ntpdc-opts.texi@1.138 +1 -1
+ NTP_4_2_5P151
+
+ ntpdc/ntpdc.1@1.138 +2 -2
+ NTP_4_2_5P151
+
+ ntpq/ntpq-opts.c@1.139 +2 -2
+ NTP_4_2_5P151
+
+ ntpq/ntpq-opts.h@1.139 +3 -3
+ NTP_4_2_5P151
+
+ ntpq/ntpq-opts.texi@1.138 +1 -1
+ NTP_4_2_5P151
+
+ ntpq/ntpq.1@1.138 +2 -2
+ NTP_4_2_5P151
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.20 +2 -2
+ NTP_4_2_5P151
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.20 +3 -3
+ NTP_4_2_5P151
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.20 +1 -1
+ NTP_4_2_5P151
+
+ ntpsnmpd/ntpsnmpd.1@1.20 +2 -2
+ NTP_4_2_5P151
+
+ packageinfo.sh@1.154 +1 -1
+ NTP_4_2_5P151
+
+ sntp/sntp-opts.c@1.139 +2 -2
+ NTP_4_2_5P151
+
+ sntp/sntp-opts.h@1.139 +3 -3
+ NTP_4_2_5P151
+
+ sntp/sntp-opts.texi@1.138 +1 -1
+ NTP_4_2_5P151
+
+ sntp/sntp.1@1.138 +2 -2
+ NTP_4_2_5P151
+
+ util/ntp-keygen-opts.c@1.142 +2 -2
+ NTP_4_2_5P151
+
+ util/ntp-keygen-opts.h@1.142 +3 -3
+ NTP_4_2_5P151
+
+ util/ntp-keygen-opts.texi@1.141 +1 -1
+ NTP_4_2_5P151
+
+ util/ntp-keygen.1@1.141 +2 -2
+ NTP_4_2_5P151
+
+ChangeSet@1.1795.1.1, 2008-12-23 04:34:32-05:00, stenn@whimsy.udel.edu
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ChangeLog@1.267.1.1 +1 -0
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ include/ntp.h@1.149 +1 -0
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ include/ntp_config.h@1.48 +1 -0
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ include/ntpd.h@1.119 +14 -0
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ntpd/Makefile.am@1.66 +1 -1
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ntpd/ntp_config.c@1.185 +11 -0
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ntpd/ntp_parser.c@1.32 +908 -889
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ntpd/ntp_parser.h@1.16 +123 -121
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ntpd/ntp_parser.y@1.26 +3 -0
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ntpd/ntp_proto.c@1.277 +53 -11
+ [Bug 1028] Support for W32Time authentication via Samba
+
+ ntpd/ntp_signd.c@1.1 +242 -0
+ BitKeeper file /deacon/backroom/ntp-dev-samba/ntpd/ntp_signd.c
+
+ ntpd/ntp_signd.c@1.0 +0 -0
+
+ChangeSet@1.1796, 2008-12-23 02:59:12-05:00, stenn@whimsy.udel.edu
+ Stats file logging cleanup from Dave Mills
+
+ ChangeLog@1.268 +1 -0
+ Stats file logging cleanup from Dave Mills
+
+ ntpd/ntp_control.c@1.106 +31 -13
+ Stats file logging cleanup from Dave Mills
+
+ChangeSet@1.1795, 2008-12-15 06:54:36-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P150
+ TAG: NTP_4_2_5P150
+
+ ChangeLog@1.267 +1 -0
+ NTP_4_2_5P150
+
+ gsoc_sntp/sntp-opts.c@1.11 +2 -2
+ NTP_4_2_5P150
+
+ gsoc_sntp/sntp-opts.h@1.11 +3 -3
+ NTP_4_2_5P150
+
+ gsoc_sntp/sntp-opts.texi@1.11 +1 -1
+ NTP_4_2_5P150
+
+ gsoc_sntp/sntp.1@1.11 +2 -2
+ NTP_4_2_5P150
+
+ ntpd/ntpd-opts.c@1.142 +2 -2
+ NTP_4_2_5P150
+
+ ntpd/ntpd-opts.h@1.142 +3 -3
+ NTP_4_2_5P150
+
+ ntpd/ntpd-opts.texi@1.141 +1 -1
+ NTP_4_2_5P150
+
+ ntpd/ntpd.1@1.141 +2 -2
+ NTP_4_2_5P150
+
+ ntpdc/ntpdc-opts.c@1.138 +2 -2
+ NTP_4_2_5P150
+
+ ntpdc/ntpdc-opts.h@1.138 +3 -3
+ NTP_4_2_5P150
+
+ ntpdc/ntpdc-opts.texi@1.137 +1 -1
+ NTP_4_2_5P150
+
+ ntpdc/ntpdc.1@1.137 +2 -2
+ NTP_4_2_5P150
+
+ ntpq/ntpq-opts.c@1.138 +2 -2
+ NTP_4_2_5P150
+
+ ntpq/ntpq-opts.h@1.138 +3 -3
+ NTP_4_2_5P150
+
+ ntpq/ntpq-opts.texi@1.137 +1 -1
+ NTP_4_2_5P150
+
+ ntpq/ntpq.1@1.137 +2 -2
+ NTP_4_2_5P150
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.19 +2 -2
+ NTP_4_2_5P150
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.19 +3 -3
+ NTP_4_2_5P150
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.19 +1 -1
+ NTP_4_2_5P150
+
+ ntpsnmpd/ntpsnmpd.1@1.19 +2 -2
+ NTP_4_2_5P150
+
+ packageinfo.sh@1.153 +1 -1
+ NTP_4_2_5P150
+
+ sntp/sntp-opts.c@1.138 +2 -2
+ NTP_4_2_5P150
+
+ sntp/sntp-opts.h@1.138 +3 -3
+ NTP_4_2_5P150
+
+ sntp/sntp-opts.texi@1.137 +1 -1
+ NTP_4_2_5P150
+
+ sntp/sntp.1@1.137 +2 -2
+ NTP_4_2_5P150
+
+ util/ntp-keygen-opts.c@1.141 +2 -2
+ NTP_4_2_5P150
+
+ util/ntp-keygen-opts.h@1.141 +3 -3
+ NTP_4_2_5P150
+
+ util/ntp-keygen-opts.texi@1.140 +1 -1
+ NTP_4_2_5P150
+
+ util/ntp-keygen.1@1.140 +2 -2
+ NTP_4_2_5P150
+
+ChangeSet@1.1791.1.3, 2008-12-15 04:12:45-05:00, stenn@pogo.udel.edu
+ [Bug 1103] Fix 64-bit issues in the new calendar code
+
+ ChangeLog@1.264.1.9 +1 -1
+ [Bug 1103] Fix 64-bit issues in the new calendar code
+
+ChangeSet@1.1791.2.11, 2008-12-05 07:13:56-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P149
+ TAG: NTP_4_2_5P149
+
+ ChangeLog@1.264.1.8 +1 -0
+ NTP_4_2_5P149
+
+ gsoc_sntp/sntp-opts.c@1.10 +2 -2
+ NTP_4_2_5P149
+
+ gsoc_sntp/sntp-opts.h@1.10 +3 -3
+ NTP_4_2_5P149
+
+ gsoc_sntp/sntp-opts.texi@1.10 +1 -1
+ NTP_4_2_5P149
+
+ gsoc_sntp/sntp.1@1.10 +2 -2
+ NTP_4_2_5P149
+
+ ntpd/ntpd-opts.c@1.141 +2 -2
+ NTP_4_2_5P149
+
+ ntpd/ntpd-opts.h@1.141 +3 -3
+ NTP_4_2_5P149
+
+ ntpd/ntpd-opts.texi@1.140 +1 -1
+ NTP_4_2_5P149
+
+ ntpd/ntpd.1@1.140 +2 -2
+ NTP_4_2_5P149
+
+ ntpdc/ntpdc-opts.c@1.137 +2 -2
+ NTP_4_2_5P149
+
+ ntpdc/ntpdc-opts.h@1.137 +3 -3
+ NTP_4_2_5P149
+
+ ntpdc/ntpdc-opts.texi@1.136 +1 -1
+ NTP_4_2_5P149
+
+ ntpdc/ntpdc.1@1.136 +2 -2
+ NTP_4_2_5P149
+
+ ntpq/ntpq-opts.c@1.137 +2 -2
+ NTP_4_2_5P149
+
+ ntpq/ntpq-opts.h@1.137 +3 -3
+ NTP_4_2_5P149
+
+ ntpq/ntpq-opts.texi@1.136 +1 -1
+ NTP_4_2_5P149
+
+ ntpq/ntpq.1@1.136 +2 -2
+ NTP_4_2_5P149
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.18 +2 -2
+ NTP_4_2_5P149
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.18 +3 -3
+ NTP_4_2_5P149
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.18 +1 -1
+ NTP_4_2_5P149
+
+ ntpsnmpd/ntpsnmpd.1@1.18 +2 -2
+ NTP_4_2_5P149
+
+ packageinfo.sh@1.152 +1 -1
+ NTP_4_2_5P149
+
+ sntp/sntp-opts.c@1.137 +2 -2
+ NTP_4_2_5P149
+
+ sntp/sntp-opts.h@1.137 +3 -3
+ NTP_4_2_5P149
+
+ sntp/sntp-opts.texi@1.136 +1 -1
+ NTP_4_2_5P149
+
+ sntp/sntp.1@1.136 +2 -2
+ NTP_4_2_5P149
+
+ util/ntp-keygen-opts.c@1.140 +2 -2
+ NTP_4_2_5P149
+
+ util/ntp-keygen-opts.h@1.140 +3 -3
+ NTP_4_2_5P149
+
+ util/ntp-keygen-opts.texi@1.139 +1 -1
+ NTP_4_2_5P149
+
+ util/ntp-keygen.1@1.139 +2 -2
+ NTP_4_2_5P149
+
+ChangeSet@1.1791.2.10, 2008-12-05 05:48:37-05:00, stenn@pogo.udel.edu
+ Distribute ntpv4-mib.mib
+
+ ntpsnmpd/Makefile.am@1.7 +4 -2
+ Distribute ntpv4-mib.mib
+
+ChangeSet@1.1791.2.9, 2008-12-05 11:23:22+01:00, gerstung@pogo.udel.edu
+ * changelog comments added for changes regarding ntpSnmpSubAgent.c and ntpv4-mib.mib
+
+ ChangeLog@1.264.1.7 +3 -0
+ * changelog comments added for changes regarding ntpSnmpSubAgent.c and ntpv4-mib.mib
+
+ChangeSet@1.1791.2.8, 2008-12-05 11:13:33+01:00, gerstung@pogo.udel.edu
+ * fixed two wrong data types
+ * fixed wrong OID definitions
+ * added preliminaray and unofficial MIB for TESTING PURPOSES ONLY
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.3 +16 -17
+ * fixed two wrong data types
+ * fixed wrong OID definitions
+
+ ntpsnmpd/ntpv4-mib.mib@1.1 +1005 -0
+ * added for testing purposes --- DO NOT USE IN PRODUCTIVE ENVIRONMENTS --- this MIB file will change as soon as the NTPv4 MIB RFC has been approved and the required OID has been registered with IANA
+
+ ntpsnmpd/ntpv4-mib.mib@1.0 +0 -0
+
+ChangeSet@1.1791.2.7, 2008-12-04 06:53:18-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P148
+ TAG: NTP_4_2_5P148
+
+ ChangeLog@1.264.1.6 +1 -0
+ NTP_4_2_5P148
+
+ gsoc_sntp/sntp-opts.c@1.9 +2 -2
+ NTP_4_2_5P148
+
+ gsoc_sntp/sntp-opts.h@1.9 +3 -3
+ NTP_4_2_5P148
+
+ gsoc_sntp/sntp-opts.texi@1.9 +1 -1
+ NTP_4_2_5P148
+
+ gsoc_sntp/sntp.1@1.9 +2 -2
+ NTP_4_2_5P148
+
+ ntpd/ntpd-opts.c@1.140 +2 -2
+ NTP_4_2_5P148
+
+ ntpd/ntpd-opts.h@1.140 +3 -3
+ NTP_4_2_5P148
+
+ ntpd/ntpd-opts.texi@1.139 +1 -1
+ NTP_4_2_5P148
+
+ ntpd/ntpd.1@1.139 +2 -2
+ NTP_4_2_5P148
+
+ ntpdc/ntpdc-opts.c@1.136 +2 -2
+ NTP_4_2_5P148
+
+ ntpdc/ntpdc-opts.h@1.136 +3 -3
+ NTP_4_2_5P148
+
+ ntpdc/ntpdc-opts.texi@1.135 +1 -1
+ NTP_4_2_5P148
+
+ ntpdc/ntpdc.1@1.135 +2 -2
+ NTP_4_2_5P148
+
+ ntpq/ntpq-opts.c@1.136 +2 -2
+ NTP_4_2_5P148
+
+ ntpq/ntpq-opts.h@1.136 +3 -3
+ NTP_4_2_5P148
+
+ ntpq/ntpq-opts.texi@1.135 +1 -1
+ NTP_4_2_5P148
+
+ ntpq/ntpq.1@1.135 +2 -2
+ NTP_4_2_5P148
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.17 +2 -2
+ NTP_4_2_5P148
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.17 +3 -3
+ NTP_4_2_5P148
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.17 +1 -1
+ NTP_4_2_5P148
+
+ ntpsnmpd/ntpsnmpd.1@1.17 +2 -2
+ NTP_4_2_5P148
+
+ packageinfo.sh@1.151 +1 -1
+ NTP_4_2_5P148
+
+ sntp/sntp-opts.c@1.136 +2 -2
+ NTP_4_2_5P148
+
+ sntp/sntp-opts.h@1.136 +3 -3
+ NTP_4_2_5P148
+
+ sntp/sntp-opts.texi@1.135 +1 -1
+ NTP_4_2_5P148
+
+ sntp/sntp.1@1.135 +2 -2
+ NTP_4_2_5P148
+
+ util/ntp-keygen-opts.c@1.139 +2 -2
+ NTP_4_2_5P148
+
+ util/ntp-keygen-opts.h@1.139 +3 -3
+ NTP_4_2_5P148
+
+ util/ntp-keygen-opts.texi@1.138 +1 -1
+ NTP_4_2_5P148
+
+ util/ntp-keygen.1@1.138 +2 -2
+ NTP_4_2_5P148
+
+ChangeSet@1.1791.2.6, 2008-12-04 03:33:40-05:00, stenn@pogo.udel.edu
+ [Bug 1070] Fix use of ntpq_parsestring() in ntpsnmpd
+
+ ChangeLog@1.264.1.5 +1 -0
+ [Bug 1070] Fix use of ntpq_parsestring() in ntpsnmpd
+
+ChangeSet@1.1791.2.5, 2008-12-04 09:08:53+01:00, gerstung@pogo.udel.edu
+ * bug 1070 fixed (call to undefined function ntpq_parsestring)
+ * added new string handler functions for dealing with ntpd responses
+ * fixed handling of SoftwareName entity (unreachable code)
+ * added function prototypes to reduce/remove compiler warnings
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.2 +224 -8
+ * bug 1070 fixed (call to undefined function ntpq_parsestring)
+ * added new string handler functions for dealing with ntpd responses
+ * fixed handling of SoftwareName entity (unreachable code)
+
+
+ ntpsnmpd/ntpSnmpSubagentObject.h@1.2 +4 -1
+ * added function prototypes to avoid compiler warnings
+
+ChangeSet@1.1791.2.4, 2008-11-27 06:54:28-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P147
+ TAG: NTP_4_2_5P147
+
+ ChangeLog@1.264.1.4 +1 -0
+ NTP_4_2_5P147
+
+ gsoc_sntp/sntp-opts.c@1.8 +2 -2
+ NTP_4_2_5P147
+
+ gsoc_sntp/sntp-opts.h@1.8 +3 -3
+ NTP_4_2_5P147
+
+ gsoc_sntp/sntp-opts.texi@1.8 +1 -1
+ NTP_4_2_5P147
+
+ gsoc_sntp/sntp.1@1.8 +2 -2
+ NTP_4_2_5P147
+
+ ntpd/ntpd-opts.c@1.139 +2 -2
+ NTP_4_2_5P147
+
+ ntpd/ntpd-opts.h@1.139 +3 -3
+ NTP_4_2_5P147
+
+ ntpd/ntpd-opts.texi@1.138 +1 -1
+ NTP_4_2_5P147
+
+ ntpd/ntpd.1@1.138 +2 -2
+ NTP_4_2_5P147
+
+ ntpdc/ntpdc-opts.c@1.135 +2 -2
+ NTP_4_2_5P147
+
+ ntpdc/ntpdc-opts.h@1.135 +3 -3
+ NTP_4_2_5P147
+
+ ntpdc/ntpdc-opts.texi@1.134 +1 -1
+ NTP_4_2_5P147
+
+ ntpdc/ntpdc.1@1.134 +2 -2
+ NTP_4_2_5P147
+
+ ntpq/ntpq-opts.c@1.135 +2 -2
+ NTP_4_2_5P147
+
+ ntpq/ntpq-opts.h@1.135 +3 -3
+ NTP_4_2_5P147
+
+ ntpq/ntpq-opts.texi@1.134 +1 -1
+ NTP_4_2_5P147
+
+ ntpq/ntpq.1@1.134 +2 -2
+ NTP_4_2_5P147
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.16 +2 -2
+ NTP_4_2_5P147
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.16 +3 -3
+ NTP_4_2_5P147
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.16 +1 -1
+ NTP_4_2_5P147
+
+ ntpsnmpd/ntpsnmpd.1@1.16 +2 -2
+ NTP_4_2_5P147
+
+ packageinfo.sh@1.150 +1 -1
+ NTP_4_2_5P147
+
+ sntp/sntp-opts.c@1.135 +2 -2
+ NTP_4_2_5P147
+
+ sntp/sntp-opts.h@1.135 +3 -3
+ NTP_4_2_5P147
+
+ sntp/sntp-opts.texi@1.134 +1 -1
+ NTP_4_2_5P147
+
+ sntp/sntp.1@1.134 +2 -2
+ NTP_4_2_5P147
+
+ util/ntp-keygen-opts.c@1.138 +2 -2
+ NTP_4_2_5P147
+
+ util/ntp-keygen-opts.h@1.138 +3 -3
+ NTP_4_2_5P147
+
+ util/ntp-keygen-opts.texi@1.137 +1 -1
+ NTP_4_2_5P147
+
+ util/ntp-keygen.1@1.137 +2 -2
+ NTP_4_2_5P147
+
+ChangeSet@1.1791.2.3, 2008-11-27 02:56:55-05:00, stenn@whimsy.udel.edu
+ Update gsoc_sntp's GCC warning code
+
+ ChangeLog@1.264.1.3 +1 -0
+ Update gsoc_sntp's GCC warning code
+
+ gsoc_sntp/Makefile.am@1.6 +2 -2
+ Update gsoc_sntp's GCC warning code
+
+ gsoc_sntp/configure.ac@1.10 +21 -0
+ Update gsoc_sntp's GCC warning code
+
+ChangeSet@1.1791.2.2, 2008-11-26 07:09:34-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P146
+ TAG: NTP_4_2_5P146
+
+ ChangeLog@1.264.1.2 +1 -0
+ NTP_4_2_5P146
+
+ gsoc_sntp/sntp-opts.c@1.7 +2 -2
+ NTP_4_2_5P146
+
+ gsoc_sntp/sntp-opts.h@1.7 +3 -3
+ NTP_4_2_5P146
+
+ gsoc_sntp/sntp-opts.texi@1.7 +1 -1
+ NTP_4_2_5P146
+
+ gsoc_sntp/sntp.1@1.7 +2 -2
+ NTP_4_2_5P146
+
+ ntpd/ntpd-opts.c@1.138 +2 -2
+ NTP_4_2_5P146
+
+ ntpd/ntpd-opts.h@1.138 +3 -3
+ NTP_4_2_5P146
+
+ ntpd/ntpd-opts.texi@1.137 +1 -1
+ NTP_4_2_5P146
+
+ ntpd/ntpd.1@1.137 +2 -2
+ NTP_4_2_5P146
+
+ ntpdc/ntpdc-opts.c@1.134 +2 -2
+ NTP_4_2_5P146
+
+ ntpdc/ntpdc-opts.h@1.134 +3 -3
+ NTP_4_2_5P146
+
+ ntpdc/ntpdc-opts.texi@1.133 +1 -1
+ NTP_4_2_5P146
+
+ ntpdc/ntpdc.1@1.133 +2 -2
+ NTP_4_2_5P146
+
+ ntpq/ntpq-opts.c@1.134 +2 -2
+ NTP_4_2_5P146
+
+ ntpq/ntpq-opts.h@1.134 +3 -3
+ NTP_4_2_5P146
+
+ ntpq/ntpq-opts.texi@1.133 +1 -1
+ NTP_4_2_5P146
+
+ ntpq/ntpq.1@1.133 +2 -2
+ NTP_4_2_5P146
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.15 +2 -2
+ NTP_4_2_5P146
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.15 +3 -3
+ NTP_4_2_5P146
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.15 +1 -1
+ NTP_4_2_5P146
+
+ ntpsnmpd/ntpsnmpd.1@1.15 +2 -2
+ NTP_4_2_5P146
+
+ packageinfo.sh@1.149 +1 -1
+ NTP_4_2_5P146
+
+ sntp/sntp-opts.c@1.134 +2 -2
+ NTP_4_2_5P146
+
+ sntp/sntp-opts.h@1.134 +3 -3
+ NTP_4_2_5P146
+
+ sntp/sntp-opts.texi@1.133 +1 -1
+ NTP_4_2_5P146
+
+ sntp/sntp.1@1.133 +2 -2
+ NTP_4_2_5P146
+
+ util/ntp-keygen-opts.c@1.137 +2 -2
+ NTP_4_2_5P146
+
+ util/ntp-keygen-opts.h@1.137 +3 -3
+ NTP_4_2_5P146
+
+ util/ntp-keygen-opts.texi@1.136 +1 -1
+ NTP_4_2_5P146
+
+ util/ntp-keygen.1@1.136 +2 -2
+ NTP_4_2_5P146
+
+ChangeSet@1.1791.2.1, 2008-11-26 06:02:22-05:00, stenn@whimsy.udel.edu
+ Update Solaris CFLAGS for gsoc_sntp
+
+ ChangeLog@1.264.1.1 +1 -0
+ Update Solaris CFLAGS for gsoc_sntp
+
+ gsoc_sntp/configure.ac@1.9 +11 -0
+ Update Solaris CFLAGS for gsoc_sntp
+
+ChangeSet@1.1791.1.1, 2008-11-25 21:23:21+00:00, kuehn@pogo.udel.edu
+ prettydate.c, caljulian.c, calyearstart.c:
+ Added changes from Juergen
+
+ libntp/caljulian.c@1.10 +13 -10
+ Added changes from Juergen
+
+ libntp/calyearstart.c@1.4 +5 -2
+ Added changes from Juergen
+
+ libntp/prettydate.c@1.8 +5 -6
+ Added changes from Juergen
+
+ChangeSet@1.1793, 2008-11-22 00:54:08+00:00, kuehn@pogo.udel.edu
+ ChangeLog:
+ Added entry for bug #1099
+
+ ChangeLog@1.265 +1 -0
+ Added entry for bug #1099
+
+ChangeSet@1.1792, 2008-11-22 01:22:42+01:00, Amidamaru@melchior.mxiesoft.com
+ crypto.c:
+ Fixed auth_init to detect empty lines and malformed entries
+
+ gsoc_sntp/crypto.c@1.4 +25 -15
+ Fixed auth_init to detect empty lines and malformed entries
+
+ChangeSet@1.1791, 2008-11-20 06:54:56-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P145
+ TAG: NTP_4_2_5P145
+
+ ChangeLog@1.264 +1 -0
+ NTP_4_2_5P145
+
+ gsoc_sntp/sntp-opts.c@1.6 +2 -2
+ NTP_4_2_5P145
+
+ gsoc_sntp/sntp-opts.h@1.6 +3 -3
+ NTP_4_2_5P145
+
+ gsoc_sntp/sntp-opts.texi@1.6 +1 -1
+ NTP_4_2_5P145
+
+ gsoc_sntp/sntp.1@1.6 +2 -2
+ NTP_4_2_5P145
+
+ ntpd/ntpd-opts.c@1.137 +2 -2
+ NTP_4_2_5P145
+
+ ntpd/ntpd-opts.h@1.137 +3 -3
+ NTP_4_2_5P145
+
+ ntpd/ntpd-opts.texi@1.136 +1 -1
+ NTP_4_2_5P145
+
+ ntpd/ntpd.1@1.136 +2 -2
+ NTP_4_2_5P145
+
+ ntpdc/ntpdc-opts.c@1.133 +2 -2
+ NTP_4_2_5P145
+
+ ntpdc/ntpdc-opts.h@1.133 +3 -3
+ NTP_4_2_5P145
+
+ ntpdc/ntpdc-opts.texi@1.132 +1 -1
+ NTP_4_2_5P145
+
+ ntpdc/ntpdc.1@1.132 +2 -2
+ NTP_4_2_5P145
+
+ ntpq/ntpq-opts.c@1.133 +2 -2
+ NTP_4_2_5P145
+
+ ntpq/ntpq-opts.h@1.133 +3 -3
+ NTP_4_2_5P145
+
+ ntpq/ntpq-opts.texi@1.132 +1 -1
+ NTP_4_2_5P145
+
+ ntpq/ntpq.1@1.132 +2 -2
+ NTP_4_2_5P145
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.14 +2 -2
+ NTP_4_2_5P145
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.14 +3 -3
+ NTP_4_2_5P145
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.14 +1 -1
+ NTP_4_2_5P145
+
+ ntpsnmpd/ntpsnmpd.1@1.14 +2 -2
+ NTP_4_2_5P145
+
+ packageinfo.sh@1.148 +1 -1
+ NTP_4_2_5P145
+
+ sntp/sntp-opts.c@1.133 +2 -2
+ NTP_4_2_5P145
+
+ sntp/sntp-opts.h@1.133 +3 -3
+ NTP_4_2_5P145
+
+ sntp/sntp-opts.texi@1.132 +1 -1
+ NTP_4_2_5P145
+
+ sntp/sntp.1@1.132 +2 -2
+ NTP_4_2_5P145
+
+ util/ntp-keygen-opts.c@1.136 +2 -2
+ NTP_4_2_5P145
+
+ util/ntp-keygen-opts.h@1.136 +3 -3
+ NTP_4_2_5P145
+
+ util/ntp-keygen-opts.texi@1.135 +1 -1
+ NTP_4_2_5P145
+
+ util/ntp-keygen.1@1.135 +2 -2
+ NTP_4_2_5P145
+
+ChangeSet@1.1790, 2008-11-20 08:43:08+00:00, stenn@poog.il.thewrittenword.com
+ Deal with time.h for sntp under linux
+
+ ChangeLog@1.263 +1 -0
+ Deal with time.h for sntp under linux
+
+ gsoc_sntp/configure.ac@1.8 +3 -1
+ Deal with time.h for sntp under linux
+
+ChangeSet@1.1789, 2008-11-20 07:09:48+00:00, stenn@poog.il.thewrittenword.com
+ Provide rpl_malloc() for sntp for systems that need it
+
+ ChangeLog@1.262 +1 -0
+ Provide rpl_malloc() for sntp for systems that need it
+
+ gsoc_sntp/main.c@1.11 +10 -0
+ Provide rpl_malloc() for sntp for systems that need it
+
+ gsoc_sntp/networking.c@1.17 +3 -3
+ Handle ss_len and socklen type for sntp
+
+ChangeSet@1.1788, 2008-11-20 07:07:09+00:00, stenn@poog.il.thewrittenword.com
+ Handle ss_len and socklen type for sntp
+
+ ChangeLog@1.261 +1 -0
+ Handle ss_len and socklen type for sntp
+
+ gsoc_sntp/configure.ac@1.7 +74 -0
+ Handle ss_len and socklen type for sntp
+
+ChangeSet@1.1787, 2008-11-20 05:42:04+00:00, stenn@poog.il.thewrittenword.com
+ Fixes to the sntp configure.ac script.
+
+ ChangeLog@1.260 +1 -0
+ Fixes to the sntp configure.ac script.
+
+ gsoc_sntp/configure.ac@1.6 +227 -20
+ Fixes to the sntp configure.ac script.
+
+ChangeSet@1.1786, 2008-11-20 05:41:10+00:00, stenn@poog.il.thewrittenword.com
+ Provide INET6_ADDRSTRLEN if it is missing
+
+ ChangeLog@1.259 +1 -0
+ Provide INET6_ADDRSTRLEN if it is missing
+
+ include/ntp_rfc2553.h@1.30 +15 -11
+ Provide INET6_ADDRSTRLEN if it is missing
+
+ChangeSet@1.1785, 2008-11-19 22:18:03+00:00, stenn@poog.il.thewrittenword.com
+ [Bug 1095] overflow in caljulian.c
+
+ ChangeLog@1.258 +1 -0
+ [Bug 1095] overflow in caljulian.c
+
+ libntp/caljulian.c@1.9 +2 -1
+ [Bug 1095] overflow in caljulian.c
+
+ChangeSet@1.1784, 2008-11-19 06:58:01-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P144
+ TAG: NTP_4_2_5P144
+
+ ChangeLog@1.257 +1 -0
+ NTP_4_2_5P144
+
+ gsoc_sntp/sntp-opts.c@1.5 +2 -2
+ NTP_4_2_5P144
+
+ gsoc_sntp/sntp-opts.h@1.5 +3 -3
+ NTP_4_2_5P144
+
+ gsoc_sntp/sntp-opts.texi@1.5 +1 -1
+ NTP_4_2_5P144
+
+ gsoc_sntp/sntp.1@1.5 +2 -2
+ NTP_4_2_5P144
+
+ ntpd/ntpd-opts.c@1.136 +2 -2
+ NTP_4_2_5P144
+
+ ntpd/ntpd-opts.h@1.136 +3 -3
+ NTP_4_2_5P144
+
+ ntpd/ntpd-opts.texi@1.135 +1 -1
+ NTP_4_2_5P144
+
+ ntpd/ntpd.1@1.135 +2 -2
+ NTP_4_2_5P144
+
+ ntpdc/ntpdc-opts.c@1.132 +2 -2
+ NTP_4_2_5P144
+
+ ntpdc/ntpdc-opts.h@1.132 +3 -3
+ NTP_4_2_5P144
+
+ ntpdc/ntpdc-opts.texi@1.131 +1 -1
+ NTP_4_2_5P144
+
+ ntpdc/ntpdc.1@1.131 +2 -2
+ NTP_4_2_5P144
+
+ ntpq/ntpq-opts.c@1.132 +2 -2
+ NTP_4_2_5P144
+
+ ntpq/ntpq-opts.h@1.132 +3 -3
+ NTP_4_2_5P144
+
+ ntpq/ntpq-opts.texi@1.131 +1 -1
+ NTP_4_2_5P144
+
+ ntpq/ntpq.1@1.131 +2 -2
+ NTP_4_2_5P144
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.13 +2 -2
+ NTP_4_2_5P144
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.13 +3 -3
+ NTP_4_2_5P144
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.13 +1 -1
+ NTP_4_2_5P144
+
+ ntpsnmpd/ntpsnmpd.1@1.13 +2 -2
+ NTP_4_2_5P144
+
+ packageinfo.sh@1.147 +1 -1
+ NTP_4_2_5P144
+
+ sntp/sntp-opts.c@1.132 +2 -2
+ NTP_4_2_5P144
+
+ sntp/sntp-opts.h@1.132 +3 -3
+ NTP_4_2_5P144
+
+ sntp/sntp-opts.texi@1.131 +1 -1
+ NTP_4_2_5P144
+
+ sntp/sntp.1@1.131 +2 -2
+ NTP_4_2_5P144
+
+ util/ntp-keygen-opts.c@1.135 +2 -2
+ NTP_4_2_5P144
+
+ util/ntp-keygen-opts.h@1.135 +3 -3
+ NTP_4_2_5P144
+
+ util/ntp-keygen-opts.texi@1.134 +1 -1
+ NTP_4_2_5P144
+
+ util/ntp-keygen.1@1.134 +2 -2
+ NTP_4_2_5P144
+
+ChangeSet@1.1783, 2008-11-18 23:32:18+00:00, stenn@poog.il.thewrittenword.com
+ Use int32, not int32_t
+
+ ChangeLog@1.256 +1 -0
+ Use int32, not int32_t
+
+ ntpdc/ntpdc_ops.c@1.56 +3 -3
+ Use int32, not int32_t
+
+ChangeSet@1.1782, 2008-11-18 22:33:11+00:00, stenn@poog.il.thewrittenword.com
+ Avoid the sched*() functions under OSF - link problems
+
+ ChangeLog@1.255 +1 -0
+ Avoid the sched*() functions under OSF - link problems
+
+ configure.ac@1.421 +5 -0
+ Avoid the sched*() functions under OSF - link problems
+
+ChangeSet@1.1781, 2008-11-17 06:53:07-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P143
+ TAG: NTP_4_2_5P143
+
+ ChangeLog@1.254 +1 -0
+ NTP_4_2_5P143
+
+ gsoc_sntp/sntp-opts.c@1.4 +37 -7
+ NTP_4_2_5P143
+
+ gsoc_sntp/sntp-opts.h@1.4 +77 -6
+ NTP_4_2_5P143
+
+ gsoc_sntp/sntp-opts.texi@1.4 +1 -1
+ NTP_4_2_5P143
+
+ gsoc_sntp/sntp.1@1.4 +7 -2
+ NTP_4_2_5P143
+
+ ntpd/ntpd-opts.c@1.135 +2 -2
+ NTP_4_2_5P143
+
+ ntpd/ntpd-opts.h@1.135 +3 -3
+ NTP_4_2_5P143
+
+ ntpd/ntpd-opts.texi@1.134 +1 -1
+ NTP_4_2_5P143
+
+ ntpd/ntpd.1@1.134 +2 -2
+ NTP_4_2_5P143
+
+ ntpdc/ntpdc-opts.c@1.131 +2 -2
+ NTP_4_2_5P143
+
+ ntpdc/ntpdc-opts.h@1.131 +3 -3
+ NTP_4_2_5P143
+
+ ntpdc/ntpdc-opts.texi@1.130 +1 -1
+ NTP_4_2_5P143
+
+ ntpdc/ntpdc.1@1.130 +2 -2
+ NTP_4_2_5P143
+
+ ntpq/ntpq-opts.c@1.131 +2 -2
+ NTP_4_2_5P143
+
+ ntpq/ntpq-opts.h@1.131 +3 -3
+ NTP_4_2_5P143
+
+ ntpq/ntpq-opts.texi@1.130 +1 -1
+ NTP_4_2_5P143
+
+ ntpq/ntpq.1@1.130 +2 -2
+ NTP_4_2_5P143
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.12 +2 -2
+ NTP_4_2_5P143
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.12 +3 -3
+ NTP_4_2_5P143
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.12 +1 -1
+ NTP_4_2_5P143
+
+ ntpsnmpd/ntpsnmpd.1@1.12 +2 -2
+ NTP_4_2_5P143
+
+ packageinfo.sh@1.146 +1 -1
+ NTP_4_2_5P143
+
+ sntp/sntp-opts.c@1.131 +2 -2
+ NTP_4_2_5P143
+
+ sntp/sntp-opts.h@1.131 +3 -3
+ NTP_4_2_5P143
+
+ sntp/sntp-opts.texi@1.130 +1 -1
+ NTP_4_2_5P143
+
+ sntp/sntp.1@1.130 +2 -2
+ NTP_4_2_5P143
+
+ util/ntp-keygen-opts.c@1.134 +2 -2
+ NTP_4_2_5P143
+
+ util/ntp-keygen-opts.h@1.134 +3 -3
+ NTP_4_2_5P143
+
+ util/ntp-keygen-opts.texi@1.133 +1 -1
+ NTP_4_2_5P143
+
+ util/ntp-keygen.1@1.133 +2 -2
+ NTP_4_2_5P143
+
+ChangeSet@1.1780, 2008-11-17 03:29:26-05:00, stenn@whimsy.udel.edu
+ update generated files
+
+ gsoc_sntp/sntp-opts.c@1.3 +7 -37
+ update generated files
+
+ gsoc_sntp/sntp-opts.h@1.3 +7 -78
+ update generated files
+
+ gsoc_sntp/sntp-opts.texi@1.3 +3 -3
+ update generated files
+
+ gsoc_sntp/sntp.1@1.3 +3 -8
+ update generated files
+
+ChangeSet@1.1779, 2008-11-17 03:18:55-05:00, stenn@pogo.udel.edu
+ sntp cleanup and fixes
+
+ ChangeLog@1.253 +1 -0
+ sntp cleanup and fixes
+
+ChangeSet@1.1775.1.2, 2008-11-17 01:25:35+01:00, Amidamaru@melchior.mxiesoft.com
+ sntp-opts.def:
+ Set the normalverbose option to -d
+
+ gsoc_sntp/sntp-opts.def@1.9 +1 -1
+ Set the normalverbose option to -d
+
+ChangeSet@1.1775.1.1, 2008-11-17 01:16:44+01:00, Amidamaru@melchior.mxiesoft.com
+ utilities.h, utilities.c:
+ Added the tv_to_str function which converts a struct timeval to a timestamp string.
+ kod_management.c:
+ Replaced strlcpy with strncpy for compatibility reasons.
+ main.c:
+ Fixed the time difference report part and the set_time call part of bug #1088
+
+ gsoc_sntp/kod_management.c@1.7 +1 -1
+ Replaced strlcpy with strncpy for compatibility reasons.
+
+ gsoc_sntp/main.c@1.10 +23 -15
+ Fixed the time difference report part and the set_time call part of bug #1088
+
+ gsoc_sntp/networking.c@1.16 +2 -2
+
+ gsoc_sntp/utilities.c@1.5 +36 -0
+ Added the tv_to_str function which converts a struct timeval to a timestamp string.
+
+ gsoc_sntp/utilities.h@1.4 +1 -0
+ Added the tv_to_str function which converts a struct timeval to a timestamp string.
+
+ChangeSet@1.1777, 2008-11-16 07:03:17-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P142
+ TAG: NTP_4_2_5P142
+
+ ChangeLog@1.252 +1 -0
+ NTP_4_2_5P142
+
+ gsoc_sntp/sntp-opts.c@1.2 +2 -2
+ NTP_4_2_5P142
+
+ gsoc_sntp/sntp-opts.h@1.2 +3 -3
+ NTP_4_2_5P142
+
+ gsoc_sntp/sntp-opts.texi@1.2 +1 -1
+ NTP_4_2_5P142
+
+ gsoc_sntp/sntp.1@1.2 +2 -2
+ NTP_4_2_5P142
+
+ ntpd/ntpd-opts.c@1.134 +2 -2
+ NTP_4_2_5P142
+
+ ntpd/ntpd-opts.h@1.134 +3 -3
+ NTP_4_2_5P142
+
+ ntpd/ntpd-opts.texi@1.133 +1 -1
+ NTP_4_2_5P142
+
+ ntpd/ntpd.1@1.133 +2 -2
+ NTP_4_2_5P142
+
+ ntpdc/ntpdc-opts.c@1.130 +2 -2
+ NTP_4_2_5P142
+
+ ntpdc/ntpdc-opts.h@1.130 +3 -3
+ NTP_4_2_5P142
+
+ ntpdc/ntpdc-opts.texi@1.129 +1 -1
+ NTP_4_2_5P142
+
+ ntpdc/ntpdc.1@1.129 +2 -2
+ NTP_4_2_5P142
+
+ ntpq/ntpq-opts.c@1.130 +2 -2
+ NTP_4_2_5P142
+
+ ntpq/ntpq-opts.h@1.130 +3 -3
+ NTP_4_2_5P142
+
+ ntpq/ntpq-opts.texi@1.129 +1 -1
+ NTP_4_2_5P142
+
+ ntpq/ntpq.1@1.129 +2 -2
+ NTP_4_2_5P142
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.11 +2 -2
+ NTP_4_2_5P142
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.11 +3 -3
+ NTP_4_2_5P142
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.11 +1 -1
+ NTP_4_2_5P142
+
+ ntpsnmpd/ntpsnmpd.1@1.11 +2 -2
+ NTP_4_2_5P142
+
+ packageinfo.sh@1.145 +1 -1
+ NTP_4_2_5P142
+
+ sntp/sntp-opts.c@1.130 +2 -2
+ NTP_4_2_5P142
+
+ sntp/sntp-opts.h@1.130 +3 -3
+ NTP_4_2_5P142
+
+ sntp/sntp-opts.texi@1.129 +1 -1
+ NTP_4_2_5P142
+
+ sntp/sntp.1@1.129 +2 -2
+ NTP_4_2_5P142
+
+ util/ntp-keygen-opts.c@1.133 +2 -2
+ NTP_4_2_5P142
+
+ util/ntp-keygen-opts.h@1.133 +3 -3
+ NTP_4_2_5P142
+
+ util/ntp-keygen-opts.texi@1.132 +1 -1
+ NTP_4_2_5P142
+
+ util/ntp-keygen.1@1.132 +2 -2
+ NTP_4_2_5P142
+
+ChangeSet@1.1776, 2008-11-16 02:16:42-05:00, stenn@whimsy.udel.edu
+ Imported GSoC SNTP code from Johannes Maximilian Khn
+
+ .point-changed-filelist@1.5 +4 -0
+ Add gsoc-sntp files to .point-changed-filelist
+
+ BitKeeper/deleted/.del-bincheck.mf@1.2 +0 -0
+ Delete: gsoc_sntp/bincheck.mf
+
+ gsoc_sntp/bincheck.mf@1.1 +15 -0
+ BitKeeper file /deacon/backroom/ntp-dev/gsoc_sntp/bincheck.mf
+
+ gsoc_sntp/bincheck.mf@1.0 +0 -0
+
+ BitKeeper/etc/ignore@1.68 +14 -14
+ Added gsoc_sntp files to the ignore list
+
+ ChangeLog@1.251 +1 -0
+ Imported GSoC SNTP code from Johannes Maximilian Khn
+
+ bootstrap@1.22 +1 -0
+ Add gsoc_sntp files t bootstrap
+
+ChangeSet@1.1774, 2008-11-15 16:06:12-05:00, stenn@pogo.udel.edu
+ Hack gsoc_sntp for inclusion in the main tree
+
+ BitKeeper/etc/ignore@1.67 +1 -0
+ added bincheck.mf
+
+ BitKeeper/etc/ignore@1.66 +1 -0
+ added autogen-version.def
+
+ BitKeeper/etc/ignore@1.65 +1 -0
+ added version.def
+
+ gsoc_sntp/COPYRIGHT@1.1 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/COPYRIGHT
+
+ gsoc_sntp/COPYRIGHT@1.0 +0 -0
+
+ gsoc_sntp/Makefile.am@1.5 +44 -16
+ Hack gsoc_sntp for inclusion in the main tree
+
+ gsoc_sntp/configure.ac@1.5 +19 -2
+ Hack gsoc_sntp for inclusion in the main tree
+
+ gsoc_sntp/ltmain.sh@1.1 +6863 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/ltmain.sh
+
+ gsoc_sntp/ltmain.sh@1.0 +0 -0
+
+ gsoc_sntp/sntp-opts.c@1.1 +638 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.c
+
+ gsoc_sntp/sntp-opts.c@1.0 +0 -0
+
+ gsoc_sntp/sntp-opts.h@1.1 +234 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.h
+
+ gsoc_sntp/sntp-opts.h@1.0 +0 -0
+
+ gsoc_sntp/sntp-opts.menu@1.1 +1 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.menu
+
+ gsoc_sntp/sntp-opts.menu@1.0 +0 -0
+
+ gsoc_sntp/sntp-opts.texi@1.1 +208 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp-opts.texi
+
+ gsoc_sntp/sntp-opts.texi@1.0 +0 -0
+
+ gsoc_sntp/sntp.1@1.1 +298 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/sntp.1
+
+ gsoc_sntp/sntp.1@1.0 +0 -0
+
+ChangeSet@1.1771.1.1, 2008-11-14 17:32:58-05:00, stenn@pogo.udel.edu
+ updates
+
+ gsoc_sntp/:fetch-stubs@1.4 +0 -12
+ updates
+
+ChangeSet@1.1735.1.72, 2008-11-13 06:42:06-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P141
+ TAG: NTP_4_2_5P141
+
+ ChangeLog@1.250 +1 -0
+ NTP_4_2_5P141
+
+ ntpd/ntpd-opts.c@1.133 +2 -2
+ NTP_4_2_5P141
+
+ ntpd/ntpd-opts.h@1.133 +3 -3
+ NTP_4_2_5P141
+
+ ntpd/ntpd-opts.texi@1.132 +1 -1
+ NTP_4_2_5P141
+
+ ntpd/ntpd.1@1.132 +2 -2
+ NTP_4_2_5P141
+
+ ntpdc/ntpdc-opts.c@1.129 +2 -2
+ NTP_4_2_5P141
+
+ ntpdc/ntpdc-opts.h@1.129 +3 -3
+ NTP_4_2_5P141
+
+ ntpdc/ntpdc-opts.texi@1.128 +1 -1
+ NTP_4_2_5P141
+
+ ntpdc/ntpdc.1@1.128 +2 -2
+ NTP_4_2_5P141
+
+ ntpq/ntpq-opts.c@1.129 +2 -2
+ NTP_4_2_5P141
+
+ ntpq/ntpq-opts.h@1.129 +3 -3
+ NTP_4_2_5P141
+
+ ntpq/ntpq-opts.texi@1.128 +1 -1
+ NTP_4_2_5P141
+
+ ntpq/ntpq.1@1.128 +2 -2
+ NTP_4_2_5P141
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.10 +2 -2
+ NTP_4_2_5P141
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.10 +3 -3
+ NTP_4_2_5P141
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.10 +1 -1
+ NTP_4_2_5P141
+
+ ntpsnmpd/ntpsnmpd.1@1.10 +2 -2
+ NTP_4_2_5P141
+
+ packageinfo.sh@1.144 +1 -1
+ NTP_4_2_5P141
+
+ sntp/sntp-opts.c@1.129 +2 -2
+ NTP_4_2_5P141
+
+ sntp/sntp-opts.h@1.129 +3 -3
+ NTP_4_2_5P141
+
+ sntp/sntp-opts.texi@1.128 +1 -1
+ NTP_4_2_5P141
+
+ sntp/sntp.1@1.128 +2 -2
+ NTP_4_2_5P141
+
+ util/ntp-keygen-opts.c@1.132 +2 -2
+ NTP_4_2_5P141
+
+ util/ntp-keygen-opts.h@1.132 +3 -3
+ NTP_4_2_5P141
+
+ util/ntp-keygen-opts.texi@1.131 +1 -1
+ NTP_4_2_5P141
+
+ util/ntp-keygen.1@1.131 +2 -2
+ NTP_4_2_5P141
+
+ChangeSet@1.1735.1.71, 2008-11-12 16:09:45-05:00, stenn@whimsy.udel.edu
+ New caltontp.c and calyearstart.c from Juergen Perlinger
+
+ ChangeLog@1.249 +1 -0
+ New caltontp.c and calyearstart.c from Juergen Perlinger
+
+ libntp/caltontp.c@1.3 +88 -25
+ New caltontp.c and calyearstart.c from Juergen Perlinger
+
+ libntp/calyearstart.c@1.3 +38 -7
+ New caltontp.c and calyearstart.c from Juergen Perlinger
+
+ChangeSet@1.1735.1.70, 2008-11-12 06:43:31-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P140
+ TAG: NTP_4_2_5P140
+
+ ChangeLog@1.248 +1 -0
+ NTP_4_2_5P140
+
+ ntpd/ntpd-opts.c@1.132 +2 -2
+ NTP_4_2_5P140
+
+ ntpd/ntpd-opts.h@1.132 +3 -3
+ NTP_4_2_5P140
+
+ ntpd/ntpd-opts.texi@1.131 +1 -1
+ NTP_4_2_5P140
+
+ ntpd/ntpd.1@1.131 +2 -2
+ NTP_4_2_5P140
+
+ ntpdc/ntpdc-opts.c@1.128 +2 -2
+ NTP_4_2_5P140
+
+ ntpdc/ntpdc-opts.h@1.128 +3 -3
+ NTP_4_2_5P140
+
+ ntpdc/ntpdc-opts.texi@1.127 +1 -1
+ NTP_4_2_5P140
+
+ ntpdc/ntpdc.1@1.127 +2 -2
+ NTP_4_2_5P140
+
+ ntpq/ntpq-opts.c@1.128 +2 -2
+ NTP_4_2_5P140
+
+ ntpq/ntpq-opts.h@1.128 +3 -3
+ NTP_4_2_5P140
+
+ ntpq/ntpq-opts.texi@1.127 +1 -1
+ NTP_4_2_5P140
+
+ ntpq/ntpq.1@1.127 +2 -2
+ NTP_4_2_5P140
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.9 +2 -2
+ NTP_4_2_5P140
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.9 +3 -3
+ NTP_4_2_5P140
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.9 +1 -1
+ NTP_4_2_5P140
+
+ ntpsnmpd/ntpsnmpd.1@1.9 +2 -2
+ NTP_4_2_5P140
+
+ packageinfo.sh@1.143 +1 -1
+ NTP_4_2_5P140
+
+ sntp/sntp-opts.c@1.128 +2 -2
+ NTP_4_2_5P140
+
+ sntp/sntp-opts.h@1.128 +3 -3
+ NTP_4_2_5P140
+
+ sntp/sntp-opts.texi@1.127 +1 -1
+ NTP_4_2_5P140
+
+ sntp/sntp.1@1.127 +2 -2
+ NTP_4_2_5P140
+
+ util/ntp-keygen-opts.c@1.131 +2 -2
+ NTP_4_2_5P140
+
+ util/ntp-keygen-opts.h@1.131 +3 -3
+ NTP_4_2_5P140
+
+ util/ntp-keygen-opts.texi@1.130 +1 -1
+ NTP_4_2_5P140
+
+ util/ntp-keygen.1@1.130 +2 -2
+ NTP_4_2_5P140
+
+ChangeSet@1.1735.1.69, 2008-11-12 02:36:31-05:00, stenn@whimsy.udel.edu
+ ntp_scanner lint removal
+
+ ChangeLog@1.247 +1 -0
+ ntp_scanner lint removal
+
+ ntpd/ntp_scanner.c@1.15 +2 -1
+ ntp_scanner lint removal
+
+ ntpd/ntp_scanner.h@1.4 +1 -1
+ ntp_scanner lint removal
+
+ChangeSet@1.1735.1.68, 2008-11-12 02:18:18-05:00, stenn@pogo.udel.edu
+ Reindent ntp_scanner.c
+
+ ntpd/ntp_scanner.c@1.14 +109 -65
+ Reindent ntp_scanner.c
+
+ChangeSet@1.1735.1.67, 2008-11-11 16:49:27-05:00, stenn@whimsy.udel.edu
+ [Bug 1011] gmtime() returns NULL on windows where it would not under Unix
+
+ ChangeLog@1.246 +2 -0
+ [Bug 1011] gmtime() returns NULL on windows where it would not under Unix
+
+ libntp/caljulian.c@1.8 +121 -86
+ [Bug 1011] gmtime() returns NULL on windows where it would not under Unix
+
+ libntp/prettydate.c@1.7 +107 -39
+ [Bug 1011] gmtime() returns NULL on windows where it would not under Unix
+
+ChangeSet@1.1735.1.66, 2008-11-11 06:42:25-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P139
+ TAG: NTP_4_2_5P139
+
+ ChangeLog@1.245 +1 -0
+ NTP_4_2_5P139
+
+ ntpd/ntpd-opts.c@1.131 +2 -2
+ NTP_4_2_5P139
+
+ ntpd/ntpd-opts.h@1.131 +3 -3
+ NTP_4_2_5P139
+
+ ntpd/ntpd-opts.texi@1.130 +1 -1
+ NTP_4_2_5P139
+
+ ntpd/ntpd.1@1.130 +2 -2
+ NTP_4_2_5P139
+
+ ntpdc/ntpdc-opts.c@1.127 +2 -2
+ NTP_4_2_5P139
+
+ ntpdc/ntpdc-opts.h@1.127 +3 -3
+ NTP_4_2_5P139
+
+ ntpdc/ntpdc-opts.texi@1.126 +1 -1
+ NTP_4_2_5P139
+
+ ntpdc/ntpdc.1@1.126 +2 -2
+ NTP_4_2_5P139
+
+ ntpq/ntpq-opts.c@1.127 +2 -2
+ NTP_4_2_5P139
+
+ ntpq/ntpq-opts.h@1.127 +3 -3
+ NTP_4_2_5P139
+
+ ntpq/ntpq-opts.texi@1.126 +1 -1
+ NTP_4_2_5P139
+
+ ntpq/ntpq.1@1.126 +2 -2
+ NTP_4_2_5P139
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.8 +2 -2
+ NTP_4_2_5P139
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.8 +3 -3
+ NTP_4_2_5P139
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.8 +1 -1
+ NTP_4_2_5P139
+
+ ntpsnmpd/ntpsnmpd.1@1.8 +2 -2
+ NTP_4_2_5P139
+
+ packageinfo.sh@1.142 +1 -1
+ NTP_4_2_5P139
+
+ sntp/sntp-opts.c@1.127 +2 -2
+ NTP_4_2_5P139
+
+ sntp/sntp-opts.h@1.127 +3 -3
+ NTP_4_2_5P139
+
+ sntp/sntp-opts.texi@1.126 +1 -1
+ NTP_4_2_5P139
+
+ sntp/sntp.1@1.126 +2 -2
+ NTP_4_2_5P139
+
+ util/ntp-keygen-opts.c@1.130 +2 -2
+ NTP_4_2_5P139
+
+ util/ntp-keygen-opts.h@1.130 +3 -3
+ NTP_4_2_5P139
+
+ util/ntp-keygen-opts.texi@1.129 +1 -1
+ NTP_4_2_5P139
+
+ util/ntp-keygen.1@1.129 +2 -2
+ NTP_4_2_5P139
+
+ChangeSet@1.1735.1.65, 2008-11-11 01:39:34-05:00, stenn@whimsy.udel.edu
+ Typo fix to driver20.html
+
+ ChangeLog@1.244 +1 -0
+ Typo fix to driver20.html
+
+ html/drivers/driver20.html@1.17 +1 -1
+ Typo fix to driver20.html
+
+ChangeSet@1.1735.1.64, 2008-11-10 06:44:15-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P138
+ TAG: NTP_4_2_5P138
+
+ ChangeLog@1.243 +1 -0
+ NTP_4_2_5P138
+
+ ntpd/ntpd-opts.c@1.130 +2 -2
+ NTP_4_2_5P138
+
+ ntpd/ntpd-opts.h@1.130 +3 -3
+ NTP_4_2_5P138
+
+ ntpd/ntpd-opts.texi@1.129 +1 -1
+ NTP_4_2_5P138
+
+ ntpd/ntpd.1@1.129 +2 -2
+ NTP_4_2_5P138
+
+ ntpdc/ntpdc-opts.c@1.126 +2 -2
+ NTP_4_2_5P138
+
+ ntpdc/ntpdc-opts.h@1.126 +3 -3
+ NTP_4_2_5P138
+
+ ntpdc/ntpdc-opts.texi@1.125 +1 -1
+ NTP_4_2_5P138
+
+ ntpdc/ntpdc.1@1.125 +2 -2
+ NTP_4_2_5P138
+
+ ntpq/ntpq-opts.c@1.126 +2 -2
+ NTP_4_2_5P138
+
+ ntpq/ntpq-opts.h@1.126 +3 -3
+ NTP_4_2_5P138
+
+ ntpq/ntpq-opts.texi@1.125 +1 -1
+ NTP_4_2_5P138
+
+ ntpq/ntpq.1@1.125 +2 -2
+ NTP_4_2_5P138
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.7 +2 -2
+ NTP_4_2_5P138
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.7 +3 -3
+ NTP_4_2_5P138
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.7 +1 -1
+ NTP_4_2_5P138
+
+ ntpsnmpd/ntpsnmpd.1@1.7 +2 -2
+ NTP_4_2_5P138
+
+ packageinfo.sh@1.141 +1 -1
+ NTP_4_2_5P138
+
+ sntp/sntp-opts.c@1.126 +2 -2
+ NTP_4_2_5P138
+
+ sntp/sntp-opts.h@1.126 +3 -3
+ NTP_4_2_5P138
+
+ sntp/sntp-opts.texi@1.125 +1 -1
+ NTP_4_2_5P138
+
+ sntp/sntp.1@1.125 +2 -2
+ NTP_4_2_5P138
+
+ util/ntp-keygen-opts.c@1.129 +2 -2
+ NTP_4_2_5P138
+
+ util/ntp-keygen-opts.h@1.129 +3 -3
+ NTP_4_2_5P138
+
+ util/ntp-keygen-opts.texi@1.128 +1 -1
+ NTP_4_2_5P138
+
+ util/ntp-keygen.1@1.128 +2 -2
+ NTP_4_2_5P138
+
+ChangeSet@1.1735.1.63, 2008-11-10 02:00:40-05:00, stenn@whimsy.udel.edu
+ IPv6 interfaces were being looked for twice; fix bug 474
+
+ ChangeLog@1.242 +2 -0
+ IPv6 interfaces were being looked for twice; fix bug 474
+
+ ntpd/ntp_io.c@1.274 +1 -8
+ IPv6 interfaces were being looked for twice; fix bug 474
+
+ChangeSet@1.1735.1.62, 2008-11-09 23:19:25-05:00, stenn@pogo.udel.edu
+ Used ntp-4.2.5p138 instead of the date
+
+ html/drivers/driver28.html@1.12 +1 -1
+ Used ntp-4.2.5p138 instead of the date
+
+ChangeSet@1.1735.8.7, 2008-11-09 22:38:13-05:00, stenn@whimsy.udel.edu
+ decode.html and driver20.html updates from Dave Mills
+
+ ChangeLog@1.238.1.5 +1 -0
+ decode.html and driver20.html updates from Dave Mills
+
+ html/decode.html@1.4 +12 -6
+ decode.html and driver20.html updates from Dave Mills
+
+ html/drivers/driver20.html@1.16 +1 -1
+ decode.html and driver20.html updates from Dave Mills
+
+ChangeSet@1.1735.8.6, 2008-11-01 06:46:41-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P137
+ TAG: NTP_4_2_5P137
+
+ ChangeLog@1.238.1.4 +1 -0
+ NTP_4_2_5P137
+
+ ntpd/ntpd-opts.c@1.129 +2 -2
+ NTP_4_2_5P137
+
+ ntpd/ntpd-opts.h@1.129 +3 -3
+ NTP_4_2_5P137
+
+ ntpd/ntpd-opts.texi@1.128 +1 -1
+ NTP_4_2_5P137
+
+ ntpd/ntpd.1@1.128 +2 -2
+ NTP_4_2_5P137
+
+ ntpdc/ntpdc-opts.c@1.125 +2 -2
+ NTP_4_2_5P137
+
+ ntpdc/ntpdc-opts.h@1.125 +3 -3
+ NTP_4_2_5P137
+
+ ntpdc/ntpdc-opts.texi@1.124 +1 -1
+ NTP_4_2_5P137
+
+ ntpdc/ntpdc.1@1.124 +2 -2
+ NTP_4_2_5P137
+
+ ntpq/ntpq-opts.c@1.125 +2 -2
+ NTP_4_2_5P137
+
+ ntpq/ntpq-opts.h@1.125 +3 -3
+ NTP_4_2_5P137
+
+ ntpq/ntpq-opts.texi@1.124 +1 -1
+ NTP_4_2_5P137
+
+ ntpq/ntpq.1@1.124 +2 -2
+ NTP_4_2_5P137
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.6 +2 -2
+ NTP_4_2_5P137
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.6 +3 -3
+ NTP_4_2_5P137
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.6 +1 -1
+ NTP_4_2_5P137
+
+ ntpsnmpd/ntpsnmpd.1@1.6 +2 -2
+ NTP_4_2_5P137
+
+ packageinfo.sh@1.140 +1 -1
+ NTP_4_2_5P137
+
+ sntp/sntp-opts.c@1.125 +2 -2
+ NTP_4_2_5P137
+
+ sntp/sntp-opts.h@1.125 +3 -3
+ NTP_4_2_5P137
+
+ sntp/sntp-opts.texi@1.124 +1 -1
+ NTP_4_2_5P137
+
+ sntp/sntp.1@1.124 +2 -2
+ NTP_4_2_5P137
+
+ util/ntp-keygen-opts.c@1.128 +2 -2
+ NTP_4_2_5P137
+
+ util/ntp-keygen-opts.h@1.128 +3 -3
+ NTP_4_2_5P137
+
+ util/ntp-keygen-opts.texi@1.127 +1 -1
+ NTP_4_2_5P137
+
+ util/ntp-keygen.1@1.127 +2 -2
+ NTP_4_2_5P137
+
+ChangeSet@1.1735.8.5, 2008-11-01 00:22:33-05:00, stenn@whimsy.udel.edu
+ netsnmp_daemonize lib check cleanup
+
+ configure.ac@1.417.1.5 +1 -1
+ netsnmp_daemonize lib check cleanup
+
+ChangeSet@1.1735.8.4, 2008-10-31 23:31:45-05:00, stenn@whimsy.udel.edu
+ [Bug 1069] #undef netsnmp's PACKAGE_* macros
+
+ ChangeLog@1.238.1.3 +2 -0
+ [Bug 1069] #undef netsnmp's PACKAGE_* macros
+
+ ntpsnmpd/ntpsnmpd.c@1.3 +6 -0
+ [Bug 1069] #undef netsnmp's PACKAGE_* macros
+
+ChangeSet@1.1735.8.3, 2008-10-31 23:27:50-05:00, stenn@whimsy.udel.edu
+ [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize()
+
+ configure.ac@1.417.1.4 +12 -0
+ [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize()
+
+ ntpsnmpd/Makefile.am@1.6 +1 -1
+ [Bug 1068] Older versions of netsnmp do not have netsnmp_daemonize()
+
+ ntpsnmpd/netsnmp_daemonize.c@1.1 +266 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/netsnmp_daemonize.c
+
+ ntpsnmpd/netsnmp_daemonize.c@1.0 +0 -0
+
+ChangeSet@1.1735.8.2, 2008-10-27 06:43:43-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P136
+ TAG: NTP_4_2_5P136
+
+ ChangeLog@1.238.1.2 +1 -0
+ NTP_4_2_5P136
+
+ ntpd/ntpd-opts.c@1.128 +2 -2
+ NTP_4_2_5P136
+
+ ntpd/ntpd-opts.h@1.128 +3 -3
+ NTP_4_2_5P136
+
+ ntpd/ntpd-opts.texi@1.127 +1 -1
+ NTP_4_2_5P136
+
+ ntpd/ntpd.1@1.127 +2 -2
+ NTP_4_2_5P136
+
+ ntpdc/ntpdc-opts.c@1.124 +2 -2
+ NTP_4_2_5P136
+
+ ntpdc/ntpdc-opts.h@1.124 +3 -3
+ NTP_4_2_5P136
+
+ ntpdc/ntpdc-opts.texi@1.123 +1 -1
+ NTP_4_2_5P136
+
+ ntpdc/ntpdc.1@1.123 +2 -2
+ NTP_4_2_5P136
+
+ ntpq/ntpq-opts.c@1.124 +2 -2
+ NTP_4_2_5P136
+
+ ntpq/ntpq-opts.h@1.124 +3 -3
+ NTP_4_2_5P136
+
+ ntpq/ntpq-opts.texi@1.123 +1 -1
+ NTP_4_2_5P136
+
+ ntpq/ntpq.1@1.123 +2 -2
+ NTP_4_2_5P136
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.5 +2 -2
+ NTP_4_2_5P136
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.5 +3 -3
+ NTP_4_2_5P136
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.5 +1 -1
+ NTP_4_2_5P136
+
+ ntpsnmpd/ntpsnmpd.1@1.5 +2 -2
+ NTP_4_2_5P136
+
+ packageinfo.sh@1.139 +1 -1
+ NTP_4_2_5P136
+
+ sntp/sntp-opts.c@1.124 +2 -2
+ NTP_4_2_5P136
+
+ sntp/sntp-opts.h@1.124 +3 -3
+ NTP_4_2_5P136
+
+ sntp/sntp-opts.texi@1.123 +1 -1
+ NTP_4_2_5P136
+
+ sntp/sntp.1@1.123 +2 -2
+ NTP_4_2_5P136
+
+ util/ntp-keygen-opts.c@1.127 +2 -2
+ NTP_4_2_5P136
+
+ util/ntp-keygen-opts.h@1.127 +3 -3
+ NTP_4_2_5P136
+
+ util/ntp-keygen-opts.texi@1.126 +1 -1
+ NTP_4_2_5P136
+
+ util/ntp-keygen.1@1.126 +2 -2
+ NTP_4_2_5P136
+
+ChangeSet@1.1735.8.1, 2008-10-27 02:20:45-05:00, stenn@whimsy.udel.edu
+ [Bug 1078] statsdir configuration parsing is broken
+
+ ChangeLog@1.238.1.1 +1 -0
+ [Bug 1078] statsdir configuration parsing is broken
+
+ ntpd/ntp_util.c@1.67 +1 -1
+ [Bug 1078] statsdir configuration parsing is broken
+
+ChangeSet@1.1735.1.59, 2008-10-23 19:21:21-04:00, murray@pogo.udel.edu
+ ChangeLog:
+ SHM fix.
+ driver28.html:
+ Fix to probe once per second rather
+ than once per polling interval.
+ Add clockstats for debugging if flag4 is on. (just counters)
+ refclock_shm.c:
+ Fix to probe once per second rather
+ than once per polling interval.
+ Add clockstats for debugging if flag4 is on. (just counters)
+
+ ChangeLog@1.239 +1 -0
+ SHM fix.
+
+ html/drivers/driver28.html@1.11 +56 -9
+ Fix to probe once per second rather
+ than once per polling interval.
+ Add clockstats for debugging if flag4 is on. (just counters)
+
+ ntpd/refclock_shm.c@1.18 +151 -51
+ Fix to probe once per second rather
+ than once per polling interval.
+ Add clockstats for debugging if flag4 is on. (just counters)
+
+ChangeSet@1.1735.1.58, 2008-09-23 07:43:30-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P135
+ TAG: NTP_4_2_5P135
+
+ ChangeLog@1.238 +1 -0
+ NTP_4_2_5P135
+
+ ntpd/ntpd-opts.c@1.127 +2 -2
+ NTP_4_2_5P135
+
+ ntpd/ntpd-opts.h@1.127 +3 -3
+ NTP_4_2_5P135
+
+ ntpd/ntpd-opts.texi@1.126 +2 -2
+ NTP_4_2_5P135
+
+ ntpd/ntpd.1@1.126 +2 -2
+ NTP_4_2_5P135
+
+ ntpdc/ntpdc-opts.c@1.123 +2 -2
+ NTP_4_2_5P135
+
+ ntpdc/ntpdc-opts.h@1.123 +3 -3
+ NTP_4_2_5P135
+
+ ntpdc/ntpdc-opts.texi@1.122 +2 -2
+ NTP_4_2_5P135
+
+ ntpdc/ntpdc.1@1.122 +2 -2
+ NTP_4_2_5P135
+
+ ntpq/ntpq-opts.c@1.123 +2 -2
+ NTP_4_2_5P135
+
+ ntpq/ntpq-opts.h@1.123 +3 -3
+ NTP_4_2_5P135
+
+ ntpq/ntpq-opts.texi@1.122 +2 -2
+ NTP_4_2_5P135
+
+ ntpq/ntpq.1@1.122 +2 -2
+ NTP_4_2_5P135
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.4 +2 -2
+ NTP_4_2_5P135
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.4 +3 -3
+ NTP_4_2_5P135
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.4 +1 -1
+ NTP_4_2_5P135
+
+ ntpsnmpd/ntpsnmpd.1@1.4 +2 -2
+ NTP_4_2_5P135
+
+ packageinfo.sh@1.138 +1 -1
+ NTP_4_2_5P135
+
+ sntp/sntp-opts.c@1.123 +2 -2
+ NTP_4_2_5P135
+
+ sntp/sntp-opts.h@1.123 +3 -3
+ NTP_4_2_5P135
+
+ sntp/sntp-opts.texi@1.122 +1 -1
+ NTP_4_2_5P135
+
+ sntp/sntp.1@1.122 +2 -2
+ NTP_4_2_5P135
+
+ util/ntp-keygen-opts.c@1.126 +2 -2
+ NTP_4_2_5P135
+
+ util/ntp-keygen-opts.h@1.126 +3 -3
+ NTP_4_2_5P135
+
+ util/ntp-keygen-opts.texi@1.125 +2 -2
+ NTP_4_2_5P135
+
+ util/ntp-keygen.1@1.125 +2 -2
+ NTP_4_2_5P135
+
+ChangeSet@1.1735.1.57, 2008-09-22 20:30:50-04:00, stenn@whimsy.udel.edu
+ [Bug 1072] clock_update should not allow updates older than sys_epoch
+
+ ChangeLog@1.237 +1 -0
+ [Bug 1072] clock_update should not allow updates older than sys_epoch
+
+ ntpd/ntp_proto.c@1.276 +3 -3
+ [Bug 1072] clock_update should not allow updates older than sys_epoch
+
+ChangeSet@1.1735.1.56, 2008-09-17 07:46:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P134
+ TAG: NTP_4_2_5P134
+
+ ChangeLog@1.236 +1 -0
+ NTP_4_2_5P134
+
+ ntpd/ntpd-opts.c@1.126 +2 -2
+ NTP_4_2_5P134
+
+ ntpd/ntpd-opts.h@1.126 +3 -3
+ NTP_4_2_5P134
+
+ ntpd/ntpd-opts.texi@1.125 +1 -1
+ NTP_4_2_5P134
+
+ ntpd/ntpd.1@1.125 +2 -2
+ NTP_4_2_5P134
+
+ ntpdc/ntpdc-opts.c@1.122 +2 -2
+ NTP_4_2_5P134
+
+ ntpdc/ntpdc-opts.h@1.122 +3 -3
+ NTP_4_2_5P134
+
+ ntpdc/ntpdc-opts.texi@1.121 +1 -1
+ NTP_4_2_5P134
+
+ ntpdc/ntpdc.1@1.121 +2 -2
+ NTP_4_2_5P134
+
+ ntpq/ntpq-opts.c@1.122 +2 -2
+ NTP_4_2_5P134
+
+ ntpq/ntpq-opts.h@1.122 +3 -3
+ NTP_4_2_5P134
+
+ ntpq/ntpq-opts.texi@1.121 +1 -1
+ NTP_4_2_5P134
+
+ ntpq/ntpq.1@1.121 +2 -2
+ NTP_4_2_5P134
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.3 +2 -2
+ NTP_4_2_5P134
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.3 +3 -3
+ NTP_4_2_5P134
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.3 +1 -1
+ NTP_4_2_5P134
+
+ ntpsnmpd/ntpsnmpd.1@1.3 +2 -2
+ NTP_4_2_5P134
+
+ packageinfo.sh@1.137 +1 -1
+ NTP_4_2_5P134
+
+ sntp/sntp-opts.c@1.122 +2 -2
+ NTP_4_2_5P134
+
+ sntp/sntp-opts.h@1.122 +3 -3
+ NTP_4_2_5P134
+
+ sntp/sntp-opts.texi@1.121 +1 -1
+ NTP_4_2_5P134
+
+ sntp/sntp.1@1.121 +2 -2
+ NTP_4_2_5P134
+
+ util/ntp-keygen-opts.c@1.125 +2 -2
+ NTP_4_2_5P134
+
+ util/ntp-keygen-opts.h@1.125 +3 -3
+ NTP_4_2_5P134
+
+ util/ntp-keygen-opts.texi@1.124 +1 -1
+ NTP_4_2_5P134
+
+ util/ntp-keygen.1@1.124 +2 -2
+ NTP_4_2_5P134
+
+ChangeSet@1.1735.1.55, 2008-09-16 21:05:36-04:00, stenn@whimsy.udel.edu
+ Clean up build process for ntpsnmpd.
+
+ ChangeLog@1.235 +1 -0
+ Clean up build process for ntpsnmpd.
+
+ Makefile.am@1.76.1.2 +1 -1
+ Clean up build process for ntpsnmpd.
+
+ configure.ac@1.417.1.3 +2 -2
+ Clean up build process for ntpsnmpd.
+
+ ntpsnmpd/Makefile.am@1.5 +2 -1
+ Clean up build process for ntpsnmpd.
+
+ChangeSet@1.1735.1.54, 2008-09-16 19:12:17-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P133
+ TAG: NTP_4_2_5P133
+
+ ChangeLog@1.234 +1 -0
+ NTP_4_2_5P133
+
+ ntpd/ntpd-opts.c@1.125 +2 -2
+ NTP_4_2_5P133
+
+ ntpd/ntpd-opts.h@1.125 +3 -3
+ NTP_4_2_5P133
+
+ ntpd/ntpd-opts.texi@1.124 +1 -1
+ NTP_4_2_5P133
+
+ ntpd/ntpd.1@1.124 +2 -2
+ NTP_4_2_5P133
+
+ ntpdc/ntpdc-opts.c@1.121 +2 -2
+ NTP_4_2_5P133
+
+ ntpdc/ntpdc-opts.h@1.121 +3 -3
+ NTP_4_2_5P133
+
+ ntpdc/ntpdc-opts.texi@1.120 +1 -1
+ NTP_4_2_5P133
+
+ ntpdc/ntpdc.1@1.120 +2 -2
+ NTP_4_2_5P133
+
+ ntpq/ntpq-opts.c@1.121 +2 -2
+ NTP_4_2_5P133
+
+ ntpq/ntpq-opts.h@1.121 +3 -3
+ NTP_4_2_5P133
+
+ ntpq/ntpq-opts.texi@1.120 +1 -1
+ NTP_4_2_5P133
+
+ ntpq/ntpq.1@1.120 +2 -2
+ NTP_4_2_5P133
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.2 +2 -2
+ NTP_4_2_5P133
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.2 +3 -3
+ NTP_4_2_5P133
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.2 +1 -1
+ NTP_4_2_5P133
+
+ ntpsnmpd/ntpsnmpd.1@1.2 +2 -2
+ NTP_4_2_5P133
+
+ packageinfo.sh@1.136 +1 -1
+ NTP_4_2_5P133
+
+ sntp/sntp-opts.c@1.121 +2 -2
+ NTP_4_2_5P133
+
+ sntp/sntp-opts.h@1.121 +3 -3
+ NTP_4_2_5P133
+
+ sntp/sntp-opts.texi@1.120 +1 -1
+ NTP_4_2_5P133
+
+ sntp/sntp.1@1.120 +2 -2
+ NTP_4_2_5P133
+
+ util/ntp-keygen-opts.c@1.124 +2 -2
+ NTP_4_2_5P133
+
+ util/ntp-keygen-opts.h@1.124 +3 -3
+ NTP_4_2_5P133
+
+ util/ntp-keygen-opts.texi@1.123 +1 -1
+ NTP_4_2_5P133
+
+ util/ntp-keygen.1@1.123 +2 -2
+ NTP_4_2_5P133
+
+ChangeSet@1.1735.1.53, 2008-09-16 03:34:05-04:00, stenn@whimsy.udel.edu
+ Add options processing to ntpsnmpd.
+
+ .point-changed-filelist@1.4 +4 -0
+ Add options processing to ntpsnmpd.
+
+ ChangeLog@1.233 +1 -0
+ Add options processing to ntpsnmpd.
+
+ ntpsnmpd/Makefile.am@1.4 +26 -3
+ Add options processing to ntpsnmpd.
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.1 +398 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.c
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.1 +28 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.def
+
+ ntpsnmpd/ntpsnmpd-opts.def@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.1 +160 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.h
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd-opts.menu@1.1 +1 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.menu
+
+ ntpsnmpd/ntpsnmpd-opts.menu@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.1 +52 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd-opts.texi
+
+ ntpsnmpd/ntpsnmpd-opts.texi@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.1@1.1 +77 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpsnmpd/ntpsnmpd.1
+
+ ntpsnmpd/ntpsnmpd.1@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.c@1.2 +24 -8
+ Add options processing to ntpsnmpd.
+
+ChangeSet@1.1735.1.52, 2008-09-16 05:40:31+00:00, stenn@ntp1.isc.org
+ [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd.
+
+ ChangeLog@1.232 +1 -0
+ [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd.
+
+ configure.ac@1.417.1.2 +10 -1
+ [Bug 1062] Check net-snmp headers before deciding to build ntpsnmpd.
+
+ChangeSet@1.1735.1.51, 2008-09-15 23:06:04-04:00, stenn@whimsy.udel.edu
+ Clean up the libntpq.a build.
+
+ ChangeLog@1.231 +1 -0
+ Clean up the libntpq.a build.
+
+ ntpq/Makefile.am@1.33 +2 -1
+ Clean up the libntpq.a build.
+
+ChangeSet@1.1735.1.50, 2008-09-15 21:15:48-04:00, stenn@whimsy.udel.edu
+ Regenerate ntp_parser.[ch] from ntp_parser.y
+
+ ChangeLog@1.230 +1 -0
+ Regenerate ntp_parser.[ch] from ntp_parser.y
+
+ ntpd/ntp_parser.c@1.31 +8 -8
+ Regenerate ntp_parser.[ch] from ntp_parser.y
+
+ ntpd/ntp_parser.h@1.15 +1 -1
+ Regenerate ntp_parser.[ch] from ntp_parser.y
+
+ChangeSet@1.1735.1.49, 2008-09-15 07:43:30-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P132
+ TAG: NTP_4_2_5P132
+
+ ChangeLog@1.229 +1 -0
+ NTP_4_2_5P132
+
+ ntpd/ntpd-opts.c@1.124 +2 -2
+ NTP_4_2_5P132
+
+ ntpd/ntpd-opts.h@1.124 +3 -3
+ NTP_4_2_5P132
+
+ ntpd/ntpd-opts.texi@1.123 +1 -1
+ NTP_4_2_5P132
+
+ ntpd/ntpd.1@1.123 +2 -2
+ NTP_4_2_5P132
+
+ ntpdc/ntpdc-opts.c@1.120 +2 -2
+ NTP_4_2_5P132
+
+ ntpdc/ntpdc-opts.h@1.120 +3 -3
+ NTP_4_2_5P132
+
+ ntpdc/ntpdc-opts.texi@1.119 +1 -1
+ NTP_4_2_5P132
+
+ ntpdc/ntpdc.1@1.119 +2 -2
+ NTP_4_2_5P132
+
+ ntpq/ntpq-opts.c@1.120 +2 -2
+ NTP_4_2_5P132
+
+ ntpq/ntpq-opts.h@1.120 +3 -3
+ NTP_4_2_5P132
+
+ ntpq/ntpq-opts.texi@1.119 +1 -1
+ NTP_4_2_5P132
+
+ ntpq/ntpq.1@1.119 +2 -2
+ NTP_4_2_5P132
+
+ packageinfo.sh@1.135 +1 -1
+ NTP_4_2_5P132
+
+ sntp/sntp-opts.c@1.120 +2 -2
+ NTP_4_2_5P132
+
+ sntp/sntp-opts.h@1.120 +3 -3
+ NTP_4_2_5P132
+
+ sntp/sntp-opts.texi@1.119 +1 -1
+ NTP_4_2_5P132
+
+ sntp/sntp.1@1.119 +2 -2
+ NTP_4_2_5P132
+
+ util/ntp-keygen-opts.c@1.123 +2 -2
+ NTP_4_2_5P132
+
+ util/ntp-keygen-opts.h@1.123 +3 -3
+ NTP_4_2_5P132
+
+ util/ntp-keygen-opts.texi@1.122 +1 -1
+ NTP_4_2_5P132
+
+ util/ntp-keygen.1@1.122 +2 -2
+ NTP_4_2_5P132
+
+ChangeSet@1.1735.1.48, 2008-09-14 18:41:58-04:00, stenn@whimsy.udel.edu
+ Remove comment made spurious by the fix for [Bug 1067]
+
+ ntpd/ntpd.c@1.97 +0 -1
+ Remove comment made spurious by the fix for [Bug 1067]
+
+ChangeSet@1.1735.1.47, 2008-09-14 18:32:56-04:00, stenn@pogo.udel.edu
+ tidy a comment
+
+ ChangeLog@1.228 +3 -2
+ tidy a comment
+
+ChangeSet@1.1735.1.46, 2008-09-14 18:11:27-04:00, utterback@pogo.udel.edu
+ ntpd.c, ChangeLog:
+ Multicast DNS service registration must come after the fork on Solaris.
+
+ ChangeLog@1.227 +1 -0
+ Multicast DNS service registration must come after the fork on Solaris.
+
+ ntpd/ntpd.c@1.96 +8 -8
+ Multicast DNS service registration must come after the fork on Solaris.
+
+ChangeSet@1.1735.1.45, 2008-09-14 10:35:32-04:00, utterback@pogo.udel.edu
+ ChangeLog:
+ Error messages should log as errors.
+ ntp_parser.y, ntp_config.c:
+ Error messages should log as errors.
+
+ ChangeLog@1.226 +1 -0
+ Error messages should log as errors
+
+ ntpd/ntp_config.c@1.184 +1 -1
+ Error messages should log as errors.
+
+ ntpd/ntp_parser.y@1.25 +5 -5
+ Error messages should log as errors.
+
+ChangeSet@1.1735.1.44, 2008-09-14 07:43:33-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P131
+ TAG: NTP_4_2_5P131
+
+ ChangeLog@1.225 +1 -0
+ NTP_4_2_5P131
+
+ ntpd/ntpd-opts.c@1.123 +2 -2
+ NTP_4_2_5P131
+
+ ntpd/ntpd-opts.h@1.123 +3 -3
+ NTP_4_2_5P131
+
+ ntpd/ntpd-opts.texi@1.122 +1 -1
+ NTP_4_2_5P131
+
+ ntpd/ntpd.1@1.122 +2 -2
+ NTP_4_2_5P131
+
+ ntpdc/ntpdc-opts.c@1.119 +2 -2
+ NTP_4_2_5P131
+
+ ntpdc/ntpdc-opts.h@1.119 +3 -3
+ NTP_4_2_5P131
+
+ ntpdc/ntpdc-opts.texi@1.118 +1 -1
+ NTP_4_2_5P131
+
+ ntpdc/ntpdc.1@1.118 +2 -2
+ NTP_4_2_5P131
+
+ ntpq/ntpq-opts.c@1.119 +2 -2
+ NTP_4_2_5P131
+
+ ntpq/ntpq-opts.h@1.119 +3 -3
+ NTP_4_2_5P131
+
+ ntpq/ntpq-opts.texi@1.118 +1 -1
+ NTP_4_2_5P131
+
+ ntpq/ntpq.1@1.118 +2 -2
+ NTP_4_2_5P131
+
+ packageinfo.sh@1.134 +1 -1
+ NTP_4_2_5P131
+
+ sntp/sntp-opts.c@1.119 +2 -2
+ NTP_4_2_5P131
+
+ sntp/sntp-opts.h@1.119 +3 -3
+ NTP_4_2_5P131
+
+ sntp/sntp-opts.texi@1.118 +1 -1
+ NTP_4_2_5P131
+
+ sntp/sntp.1@1.118 +2 -2
+ NTP_4_2_5P131
+
+ util/ntp-keygen-opts.c@1.122 +2 -2
+ NTP_4_2_5P131
+
+ util/ntp-keygen-opts.h@1.122 +3 -3
+ NTP_4_2_5P131
+
+ util/ntp-keygen-opts.texi@1.121 +1 -1
+ NTP_4_2_5P131
+
+ util/ntp-keygen.1@1.121 +2 -2
+ NTP_4_2_5P131
+
+ChangeSet@1.1735.1.43, 2008-09-13 23:07:30-04:00, stenn@pogo.udel.edu
+ [Bug 1065] Re-enable support for the timingstats file
+
+ ChangeLog@1.224 +1 -0
+ [Bug 1065] Re-enable support for the timingstats file
+
+ChangeSet@1.1735.1.42, 2008-09-13 23:03:22-04:00, stenn@pogo.udel.edu
+ rebuild ntp_parser.[ch] with newer bison
+
+ ntpd/ntp_parser.c@1.30 +2449 -1618
+ rebuild with newer bison
+
+ ntpd/ntp_parser.h@1.14 +363 -161
+ rebuild with newer bison
+
+ChangeSet@1.1735.1.41, 2008-09-13 21:42:40-04:00, utterback@pogo.udel.edu
+ ntp_config.c:
+ Reinstate timingstats file
+
+ ntpd/ntp_config.c@1.183 +1 -0
+ Reinstate timingstats file
+
+ChangeSet@1.1735.7.4, 2008-09-13 07:49:17-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P130
+ TAG: NTP_4_2_5P130
+
+ ChangeLog@1.223 +1 -0
+ NTP_4_2_5P130
+
+ ntpd/ntpd-opts.c@1.122 +2 -2
+ NTP_4_2_5P130
+
+ ntpd/ntpd-opts.h@1.122 +3 -3
+ NTP_4_2_5P130
+
+ ntpd/ntpd-opts.texi@1.121 +1 -1
+ NTP_4_2_5P130
+
+ ntpd/ntpd.1@1.121 +2 -2
+ NTP_4_2_5P130
+
+ ntpdc/ntpdc-opts.c@1.118 +2 -2
+ NTP_4_2_5P130
+
+ ntpdc/ntpdc-opts.h@1.118 +3 -3
+ NTP_4_2_5P130
+
+ ntpdc/ntpdc-opts.texi@1.117 +1 -1
+ NTP_4_2_5P130
+
+ ntpdc/ntpdc.1@1.117 +2 -2
+ NTP_4_2_5P130
+
+ ntpq/ntpq-opts.c@1.118 +2 -2
+ NTP_4_2_5P130
+
+ ntpq/ntpq-opts.h@1.118 +3 -3
+ NTP_4_2_5P130
+
+ ntpq/ntpq-opts.texi@1.117 +1 -1
+ NTP_4_2_5P130
+
+ ntpq/ntpq.1@1.117 +2 -2
+ NTP_4_2_5P130
+
+ packageinfo.sh@1.133 +1 -1
+ NTP_4_2_5P130
+
+ sntp/sntp-opts.c@1.118 +2 -2
+ NTP_4_2_5P130
+
+ sntp/sntp-opts.h@1.118 +3 -3
+ NTP_4_2_5P130
+
+ sntp/sntp-opts.texi@1.117 +1 -1
+ NTP_4_2_5P130
+
+ sntp/sntp.1@1.117 +2 -2
+ NTP_4_2_5P130
+
+ util/ntp-keygen-opts.c@1.121 +2 -2
+ NTP_4_2_5P130
+
+ util/ntp-keygen-opts.h@1.121 +3 -3
+ NTP_4_2_5P130
+
+ util/ntp-keygen-opts.texi@1.120 +1 -1
+ NTP_4_2_5P130
+
+ util/ntp-keygen.1@1.120 +2 -2
+ NTP_4_2_5P130
+
+ChangeSet@1.1735.7.3, 2008-09-13 05:04:00-04:00, stenn@whimsy.udel.edu
+ [Bug 1064] Implement --with-net-snmp-config=progname
+
+ ChangeLog@1.222 +1 -1
+ [Bug 1064] Implement --with-net-snmp-config=progname
+
+ChangeSet@1.1735.7.2, 2008-09-13 04:58:45-04:00, stenn@whimsy.udel.edu
+ net-snmp-config cleanup
+
+ ChangeLog@1.221 +1 -0
+ net-snmp-config cleanup
+
+ configure.ac@1.417.1.1 +45 -3
+ net-snmp-config cleanup
+
+ ntpsnmpd/Makefile.am@1.3 +2 -13
+ net-snmp-config cleanup
+
+ChangeSet@1.1735.7.1, 2008-09-12 15:20:13-04:00, stenn@whimsy.udel.edu
+ [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution
+
+ ChangeLog@1.220 +1 -0
+ [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution
+
+ ntpsnmpd/Makefile.am@1.2 +1 -0
+ [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution
+
+ChangeSet@1.1735.1.39, 2008-09-12 09:39:33-04:00, utterback@pogo.udel.edu
+ ntp_util.c, ntp_parser.y, ntp_parser.h, ntp_parser.c:
+ Reinstate lost timingstats file
+
+ ntpd/ntp_parser.c@1.29 +1818 -2649
+ Reinstate lost timingstats file
+
+ ntpd/ntp_parser.h@1.13 +161 -361
+ Reinstate lost timingstats file
+
+ ntpd/ntp_parser.y@1.24 +3 -0
+ Reinstate lost timingstats file
+
+ ntpd/ntp_util.c@1.66 +8 -0
+ Reinstate lost timingstats file
+
+ChangeSet@1.1735.1.38, 2008-09-11 07:43:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P129
+ TAG: NTP_4_2_5P129
+
+ ChangeLog@1.219 +1 -0
+ NTP_4_2_5P129
+
+ ntpd/ntpd-opts.c@1.121 +2 -2
+ NTP_4_2_5P129
+
+ ntpd/ntpd-opts.h@1.121 +3 -3
+ NTP_4_2_5P129
+
+ ntpd/ntpd-opts.texi@1.120 +1 -1
+ NTP_4_2_5P129
+
+ ntpd/ntpd.1@1.120 +2 -2
+ NTP_4_2_5P129
+
+ ntpdc/ntpdc-opts.c@1.117 +2 -2
+ NTP_4_2_5P129
+
+ ntpdc/ntpdc-opts.h@1.117 +3 -3
+ NTP_4_2_5P129
+
+ ntpdc/ntpdc-opts.texi@1.116 +1 -1
+ NTP_4_2_5P129
+
+ ntpdc/ntpdc.1@1.116 +2 -2
+ NTP_4_2_5P129
+
+ ntpq/ntpq-opts.c@1.117 +2 -2
+ NTP_4_2_5P129
+
+ ntpq/ntpq-opts.h@1.117 +3 -3
+ NTP_4_2_5P129
+
+ ntpq/ntpq-opts.texi@1.116 +1 -1
+ NTP_4_2_5P129
+
+ ntpq/ntpq.1@1.116 +2 -2
+ NTP_4_2_5P129
+
+ packageinfo.sh@1.132 +1 -1
+ NTP_4_2_5P129
+
+ sntp/sntp-opts.c@1.117 +2 -2
+ NTP_4_2_5P129
+
+ sntp/sntp-opts.h@1.117 +3 -3
+ NTP_4_2_5P129
+
+ sntp/sntp-opts.texi@1.116 +1 -1
+ NTP_4_2_5P129
+
+ sntp/sntp.1@1.116 +2 -2
+ NTP_4_2_5P129
+
+ util/ntp-keygen-opts.c@1.120 +2 -2
+ NTP_4_2_5P129
+
+ util/ntp-keygen-opts.h@1.120 +3 -3
+ NTP_4_2_5P129
+
+ util/ntp-keygen-opts.texi@1.119 +1 -1
+ NTP_4_2_5P129
+
+ util/ntp-keygen.1@1.119 +2 -2
+ NTP_4_2_5P129
+
+ChangeSet@1.1735.1.37, 2008-09-11 02:52:01-04:00, stenn@whimsy.udel.edu
+ Quiet some libntpq-related warnings
+
+ ChangeLog@1.218 +1 -0
+ Quiet some libntpq-related warnings
+
+ ntpq/Makefile.am@1.32 +2 -2
+ Quiet some libntpq-related warnings
+
+ ntpq/libntpq.c@1.2 +1 -1
+ Quiet some libntpq-related warnings
+
+ChangeSet@1.1771, 2008-09-11 00:35:34-04:00, stenn@pogo.udel.edu
+ No c++ or F77 for libtool, get socket libraries
+
+ gsoc_sntp/configure.ac@1.4 +13 -0
+ No c++ or F77 for libtool, get socket libraries
+
+ChangeSet@1.1770, 2008-09-11 00:32:37-04:00, stenn@pogo.udel.edu
+ doc strings must be tab-indented, not space
+
+ gsoc_sntp/sntp-opts.def@1.8 +2 -4
+ doc strings must be tab-indented, not space
+
+ChangeSet@1.1768, 2008-09-10 20:26:26-04:00, stenn@pogo.udel.edu
+ updates
+
+ gsoc_sntp/Makefile.am@1.4 +1 -0
+ updates
+
+ gsoc_sntp/log.c@1.7 +5 -1
+ updates
+
+ gsoc_sntp/sntp-opts.def@1.7 +49 -33
+ updates
+
+ChangeSet@1.1767, 2008-09-10 23:37:56+00:00, kuehn@pogo.udel.edu
+ main.c:
+ fixed includes
+ crypto.c, networking.c:
+ Fixed compile errors
+
+ gsoc_sntp/crypto.c@1.3 +3 -3
+ Fixed compile errors
+
+ gsoc_sntp/crypto.h@1.3 +1 -1
+
+ gsoc_sntp/main.c@1.9 +2 -2
+ fixed includes
+
+ gsoc_sntp/networking.c@1.15 +8 -9
+ Fixed compile errors
+
+ gsoc_sntp/networking.h@1.11 +2 -0
+
+ChangeSet@1.1766, 2008-09-10 22:58:04+00:00, kuehn@pogo.udel.edu
+ log.h:
+ fixed missing timestamp for file logging
+ kod_management.c:
+ Fixed the core dump when no kod file is specified
+ networking.c:
+ Some fixes for broadcast mode
+ remove filter reachable (no use for this function)
+ utilities.c:
+ Added a function to convert a struct sockaddr_storage to a string containing its hostname
+ crypto.c:
+ Completeted auth md5 functions
+
+ BitKeeper/etc/gone@1.8 +14 -0
+
+ gsoc_sntp/crypto.c@1.2 +125 -39
+ Completeted auth md5 functions
+
+ gsoc_sntp/crypto.h@1.2 +35 -5
+
+ gsoc_sntp/header.h@1.3 +5 -3
+
+ gsoc_sntp/kod_management.c@1.6 +25 -4
+ Fixed the core dump when no kod file is specified
+
+ gsoc_sntp/kod_management.h@1.4 +18 -1
+
+ gsoc_sntp/log.c@1.6 +26 -5
+
+ gsoc_sntp/log.h@1.4 +20 -2
+ fixed missing timestamp for file logging
+
+ gsoc_sntp/main.c@1.8 +18 -11
+
+ gsoc_sntp/networking.c@1.14 +457 -94
+ Some fixes for broadcast mode
+ remove filter reachable (no use for this function)
+
+ gsoc_sntp/networking.h@1.10 +33 -3
+
+ gsoc_sntp/utilities.c@1.4 +46 -0
+ Added a function to convert a struct sockaddr_storage to a string containing its hostname
+
+ gsoc_sntp/utilities.h@1.3 +35 -0
+
+ChangeSet@1.1735.1.36, 2008-09-08 07:46:43-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P128
+ TAG: NTP_4_2_5P128
+
+ ChangeLog@1.217 +1 -0
+ NTP_4_2_5P128
+
+ ntpd/ntpd-opts.c@1.120 +2 -2
+ NTP_4_2_5P128
+
+ ntpd/ntpd-opts.h@1.120 +3 -3
+ NTP_4_2_5P128
+
+ ntpd/ntpd-opts.texi@1.119 +2 -2
+ NTP_4_2_5P128
+
+ ntpd/ntpd.1@1.119 +2 -2
+ NTP_4_2_5P128
+
+ ntpdc/ntpdc-opts.c@1.116 +2 -2
+ NTP_4_2_5P128
+
+ ntpdc/ntpdc-opts.h@1.116 +3 -3
+ NTP_4_2_5P128
+
+ ntpdc/ntpdc-opts.texi@1.115 +2 -2
+ NTP_4_2_5P128
+
+ ntpdc/ntpdc.1@1.115 +2 -2
+ NTP_4_2_5P128
+
+ ntpq/ntpq-opts.c@1.116 +2 -2
+ NTP_4_2_5P128
+
+ ntpq/ntpq-opts.h@1.116 +3 -3
+ NTP_4_2_5P128
+
+ ntpq/ntpq-opts.texi@1.115 +2 -2
+ NTP_4_2_5P128
+
+ ntpq/ntpq.1@1.115 +2 -2
+ NTP_4_2_5P128
+
+ packageinfo.sh@1.131 +1 -1
+ NTP_4_2_5P128
+
+ sntp/sntp-opts.c@1.116 +2 -2
+ NTP_4_2_5P128
+
+ sntp/sntp-opts.h@1.116 +3 -3
+ NTP_4_2_5P128
+
+ sntp/sntp-opts.texi@1.115 +1 -1
+ NTP_4_2_5P128
+
+ sntp/sntp.1@1.115 +2 -2
+ NTP_4_2_5P128
+
+ util/ntp-keygen-opts.c@1.119 +2 -2
+ NTP_4_2_5P128
+
+ util/ntp-keygen-opts.h@1.119 +3 -3
+ NTP_4_2_5P128
+
+ util/ntp-keygen-opts.texi@1.118 +2 -2
+ NTP_4_2_5P128
+
+ util/ntp-keygen.1@1.118 +2 -2
+ NTP_4_2_5P128
+
+ChangeSet@1.1735.6.4, 2008-09-08 03:57:36-04:00, stenn@whimsy.udel.edu
+ Cleanup missing ChangeLog message
+
+ ChangeLog@1.213.1.3 +1 -0
+ Cleanup missing ChangeLog message
+
+ChangeSet@1.1759.1.1, 2008-09-05 00:08:08+00:00, kuehn@pogo.udel.edu
+ kod_management.h, main.c, kod_management.c:
+ Fixes
+ networking.h:
+ fixes + broadcast mode
+ crypto.h:
+ BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.h
+ crypto.c:
+ BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.c
+ networking.c:
+ Fixes
+ Broadcast mode
+ sntp-opts.def:
+ Added new options, removed host list
+
+ gsoc_sntp/crypto.c@1.1 +97 -0
+ BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.c
+
+ gsoc_sntp/crypto.c@1.0 +0 -0
+
+ gsoc_sntp/crypto.h@1.1 +19 -0
+ BitKeeper file /pogo/users/kuehn/rsync_repo/ntp-dev/gsoc_sntp/crypto.h
+
+ gsoc_sntp/crypto.h@1.0 +0 -0
+
+ChangeSet@1.1735.6.3, 2008-09-01 07:42:29-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P127
+ TAG: NTP_4_2_5P127
+
+ ChangeLog@1.213.1.2 +1 -0
+ NTP_4_2_5P127
+
+ ntpd/ntpd-opts.c@1.119 +2 -2
+ NTP_4_2_5P127
+
+ ntpd/ntpd-opts.h@1.119 +3 -3
+ NTP_4_2_5P127
+
+ ntpd/ntpd-opts.texi@1.118 +1 -1
+ NTP_4_2_5P127
+
+ ntpd/ntpd.1@1.118 +2 -2
+ NTP_4_2_5P127
+
+ ntpdc/ntpdc-opts.c@1.115 +2 -2
+ NTP_4_2_5P127
+
+ ntpdc/ntpdc-opts.h@1.115 +3 -3
+ NTP_4_2_5P127
+
+ ntpdc/ntpdc-opts.texi@1.114 +1 -1
+ NTP_4_2_5P127
+
+ ntpdc/ntpdc.1@1.114 +2 -2
+ NTP_4_2_5P127
+
+ ntpq/ntpq-opts.c@1.115 +2 -2
+ NTP_4_2_5P127
+
+ ntpq/ntpq-opts.h@1.115 +3 -3
+ NTP_4_2_5P127
+
+ ntpq/ntpq-opts.texi@1.114 +1 -1
+ NTP_4_2_5P127
+
+ ntpq/ntpq.1@1.114 +2 -2
+ NTP_4_2_5P127
+
+ packageinfo.sh@1.130 +1 -1
+ NTP_4_2_5P127
+
+ sntp/sntp-opts.c@1.115 +2 -2
+ NTP_4_2_5P127
+
+ sntp/sntp-opts.h@1.115 +3 -3
+ NTP_4_2_5P127
+
+ sntp/sntp-opts.texi@1.114 +1 -1
+ NTP_4_2_5P127
+
+ sntp/sntp.1@1.114 +2 -2
+ NTP_4_2_5P127
+
+ util/ntp-keygen-opts.c@1.118 +2 -2
+ NTP_4_2_5P127
+
+ util/ntp-keygen-opts.h@1.118 +3 -3
+ NTP_4_2_5P127
+
+ util/ntp-keygen-opts.texi@1.117 +1 -1
+ NTP_4_2_5P127
+
+ util/ntp-keygen.1@1.117 +2 -2
+ NTP_4_2_5P127
+
+ChangeSet@1.1735.6.2, 2008-08-31 20:42:07-04:00, stenn@whimsy.udel.edu
+ regenerate ntp_parser.c
+
+ ntpd/ntp_parser.c@1.28 +802 -851
+ regenerate ntp_parser.c
+
+ChangeSet@1.1735.6.1, 2008-08-31 07:49:04-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P126
+ TAG: NTP_4_2_5P126
+
+ ChangeLog@1.213.1.1 +1 -0
+ NTP_4_2_5P126
+
+ ntpd/ntpd-opts.c@1.118 +2 -2
+ NTP_4_2_5P126
+
+ ntpd/ntpd-opts.h@1.118 +3 -3
+ NTP_4_2_5P126
+
+ ntpd/ntpd-opts.texi@1.117 +1 -1
+ NTP_4_2_5P126
+
+ ntpd/ntpd.1@1.117 +2 -2
+ NTP_4_2_5P126
+
+ ntpdc/ntpdc-opts.c@1.114 +2 -2
+ NTP_4_2_5P126
+
+ ntpdc/ntpdc-opts.h@1.114 +3 -3
+ NTP_4_2_5P126
+
+ ntpdc/ntpdc-opts.texi@1.113 +1 -1
+ NTP_4_2_5P126
+
+ ntpdc/ntpdc.1@1.113 +2 -2
+ NTP_4_2_5P126
+
+ ntpq/ntpq-opts.c@1.114 +2 -2
+ NTP_4_2_5P126
+
+ ntpq/ntpq-opts.h@1.114 +3 -3
+ NTP_4_2_5P126
+
+ ntpq/ntpq-opts.texi@1.113 +1 -1
+ NTP_4_2_5P126
+
+ ntpq/ntpq.1@1.113 +2 -2
+ NTP_4_2_5P126
+
+ packageinfo.sh@1.129 +1 -1
+ NTP_4_2_5P126
+
+ sntp/sntp-opts.c@1.114 +2 -2
+ NTP_4_2_5P126
+
+ sntp/sntp-opts.h@1.114 +3 -3
+ NTP_4_2_5P126
+
+ sntp/sntp-opts.texi@1.113 +1 -1
+ NTP_4_2_5P126
+
+ sntp/sntp.1@1.113 +2 -2
+ NTP_4_2_5P126
+
+ util/ntp-keygen-opts.c@1.117 +2 -2
+ NTP_4_2_5P126
+
+ util/ntp-keygen-opts.h@1.117 +3 -3
+ NTP_4_2_5P126
+
+ util/ntp-keygen-opts.texi@1.116 +1 -1
+ NTP_4_2_5P126
+
+ util/ntp-keygen.1@1.116 +2 -2
+ NTP_4_2_5P126
+
+ChangeSet@1.1764, 2008-08-31 07:15:07-04:00, stenn@pogo.udel.edu
+ portability fixes
+
+ configure.ac@1.416.1.1 +1 -0
+ build gsoc_snmp
+
+ChangeSet@1.1763, 2008-08-31 05:56:21-04:00, stenn@pogo.udel.edu
+ Have libtool ignore C++ and F77
+
+ChangeSet@1.1735.5.1, 2008-08-31 04:59:46-04:00, stenn@pogo.udel.edu
+ Prepare for GSoC2008 NTP MIB daemon import
+
+ ChangeLog@1.212.1.1 +1 -0
+ Prepare for GSoC2008 NTP MIB daemon import
+
+ Makefile.am@1.76.1.1 +2 -0
+ Prepare for GSoC2008 NTP MIB daemon import
+
+ configure.ac@1.415.1.1 +27 -0
+ Prepare for GSoC2008 NTP MIB daemon import
+
+ ntpq/Makefile.am@1.31 +6 -5
+ Prepare for GSoC2008 NTP MIB daemon import
+
+ ntpq/libntpq.c@1.1 +790 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpq/libntpq.c
+
+ ntpq/libntpq.c@1.0 +0 -0
+
+ ntpq/libntpq.h@1.1 +108 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpq/libntpq.h
+
+ ntpq/libntpq.h@1.0 +0 -0
+
+ ntpq/libntpq_subs.c@1.1 +50 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpq/libntpq_subs.c
+
+ ntpq/libntpq_subs.c@1.0 +0 -0
+
+ ntpq/ntpq.c@1.75 +7 -2
+ Prepare for GSoC2008 NTP MIB daemon import
+
+ ntpsnmpd/Makefile.am@1.1 +19 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/Makefile.am
+
+ ntpsnmpd/Makefile.am@1.0 +0 -0
+
+ ntpsnmpd/README@1.1 +40 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/README
+
+ ntpsnmpd/README@1.0 +0 -0
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.1 +490 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/ntpSnmpSubagentObject.c
+
+ ntpsnmpd/ntpSnmpSubagentObject.c@1.0 +0 -0
+
+ ntpsnmpd/ntpSnmpSubagentObject.h@1.1 +72 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/ntpSnmpSubagentObject.h
+
+ ntpsnmpd/ntpSnmpSubagentObject.h@1.0 +0 -0
+
+ ntpsnmpd/ntpsnmpd.c@1.1 +107 -0
+ BitKeeper file /pogo/users/gerstung/gsoc/ntp-dev/ntpsnmpd/ntpsnmpd.c
+
+ ntpsnmpd/ntpsnmpd.c@1.0 +0 -0
+
+ChangeSet@1.1735.1.32, 2008-08-31 04:43:40-04:00, stenn@whimsy.udel.edu
+ Stop libtool-1.5 from looking for C++ or Fortran
+
+ sntp/configure.ac@1.17 +3 -0
+ Stop libtool-1.5 from looking for C++ or Fortran
+
+ChangeSet@1.1735.1.31, 2008-08-31 04:33:40-04:00, stenn@whimsy.udel.edu
+ Stop libtool-1.5 from looking for C++ or Fortran
+
+ ChangeLog@1.213 +1 -0
+ Stop libtool-1.5 from looking for C++ or Fortran
+
+ configure.ac@1.416 +4 -0
+ Stop libtool-1.5 from looking for C++ or Fortran
+
+ChangeSet@1.1735.4.4, 2008-08-31 02:06:36-04:00, stenn@whimsy.udel.edu
+ [Bug 828] Fix IPv4/IPv6 address parsing
+
+ ChangeLog@1.210.1.4 +1 -0
+ [Bug 828] Fix IPv4/IPv6 address parsing
+
+ ntpd/ntp_config.c@1.182 +11 -2
+ [Bug 828] Fix IPv4/IPv6 address parsing
+
+ ntpd/ntp_parser.y@1.23 +9 -42
+ [Bug 828] Fix IPv4/IPv6 address parsing
+
+ ntpd/ntp_scanner.c@1.13 +43 -31
+ [Bug 828] Fix IPv4/IPv6 address parsing
+
+ChangeSet@1.1761, 2008-08-31 01:43:34-04:00, stenn@pogo.udel.edu
+ portability fixes
+
+ChangeSet@1.1735.4.3, 2008-08-30 23:19:40-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.210.1.3 +1 -0
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.43 +1 -1
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.3 +0 -1
+ Documentation updates from Dave Mills
+
+ html/gadget.html@1.3 +3 -3
+ Documentation updates from Dave Mills
+
+ html/howto.html@1.20 +3 -2
+ Documentation updates from Dave Mills
+
+ html/index.html@1.38 +9 -8
+ Documentation updates from Dave Mills
+
+ html/kern.html@1.17 +3 -3
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.13 +65 -20
+ Documentation updates from Dave Mills
+
+ html/manyopt.html@1.18 +3 -3
+ Documentation updates from Dave Mills
+
+ html/ntp_conf.html@1.3 +10 -9
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.46 +9 -9
+ Documentation updates from Dave Mills
+
+ html/ntpdsim_new.html@1.4 +8 -1
+ Documentation updates from Dave Mills
+
+ html/parsenew.html@1.11 +1 -3
+ Documentation updates from Dave Mills
+
+ html/pps.html@1.20 +6 -4
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.17 +14 -14
+ Documentation updates from Dave Mills
+
+ html/rate.html@1.4 +14 -8
+ Documentation updates from Dave Mills
+
+ html/refclock.html@1.34 +47 -47
+ Documentation updates from Dave Mills
+
+ html/release.html@1.36 +27 -24
+ Documentation updates from Dave Mills
+
+ html/xleave.html@1.3 +3 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1735.4.2, 2008-08-30 23:14:01-04:00, stenn@whimsy.udel.edu
+ Fix a corner case where a frequency update was reported but not set
+
+ ChangeLog@1.210.1.2 +1 -0
+ Fix a corner case where a frequency update was reported but not set
+
+ ntpd/ntp_loopfilter.c@1.147 +6 -5
+ Fix a corner case where a frequency update was reported but not set
+
+ChangeSet@1.1735.4.1, 2008-08-30 22:09:29-04:00, stenn@whimsy.udel.edu
+ When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have crypto_flags
+
+ ChangeLog@1.210.1.1 +3 -0
+ When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have crypto_flags
+
+ html/pic/boom4.gif@1.1 +361 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/boom4.gif
+
+ html/pic/boom4.gif@1.0 +0 -0
+
+ ntpd/ntp_proto.c@1.275 +6 -1
+ When LEAP_NOTINSYNC->LEAP_NOWARNING, call crypto_update() if we have crypto_flags
+
+ChangeSet@1.1759, 2008-08-22 21:27:59-04:00, stenn@pogo.udel.edu
+ remove bogus .o file
+
+ BitKeeper/deleted/.del-utilities.o@1.2 +0 -0
+ Delete: gsoc_sntp/utilities.o
+
+ChangeSet@1.1735.1.29, 2008-08-21 05:05:19+00:00, gopal@pogo.udel.edu
+ driver20.html:
+ [BUG 610] Documentation update for NMEA reference clock driver.
+ ChangeLog:
+ Added appropriate comments for documentation update.
+
+ ChangeLog@1.211 +1 -0
+ Added appropriate comments for documentation update.
+
+ html/drivers/driver20.html@1.15 +23 -6
+ [BUG 610] Documentation update for NMEA reference clock driver.
+
+ChangeSet@1.1757, 2008-08-18 21:37:27+09:00, Amidamaru@yumi.mxiesoft.com
+ utilities.c, networking.c:
+ Fixes
+ sntp-opts.def:
+ added broadcast and timeout options
+ log.c:
+ Fixes, one bug with filelogging left
+ main.c:
+ Fixed KOD handling in on_Ãwire
+
+ gsoc_sntp/log.c@1.5 +2 -4
+ Fixes, one bug with filelogging left
+
+ gsoc_sntp/main.c@1.7 +87 -35
+ Fixed KOD handling in on_Ãwire
+
+ gsoc_sntp/networking.c@1.13 +85 -75
+ Fixes
+
+ gsoc_sntp/networking.h@1.9 +85 -14
+
+ gsoc_sntp/sntp-opts.def@1.6 +23 -0
+ added broadcast and timeout options
+
+ gsoc_sntp/utilities.c@1.3 +12 -0
+ Fixes
+
+ gsoc_sntp/utilities.h@1.2 +1 -0
+
+ChangeSet@1.1735.1.28, 2008-08-18 07:43:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P125
+ TAG: NTP_4_2_5P125
+
+ ChangeLog@1.210 +1 -0
+ NTP_4_2_5P125
+
+ ntpd/ntpd-opts.c@1.117 +2 -2
+ NTP_4_2_5P125
+
+ ntpd/ntpd-opts.h@1.117 +3 -3
+ NTP_4_2_5P125
+
+ ntpd/ntpd-opts.texi@1.116 +1 -1
+ NTP_4_2_5P125
+
+ ntpd/ntpd.1@1.116 +2 -2
+ NTP_4_2_5P125
+
+ ntpdc/ntpdc-opts.c@1.113 +2 -2
+ NTP_4_2_5P125
+
+ ntpdc/ntpdc-opts.h@1.113 +3 -3
+ NTP_4_2_5P125
+
+ ntpdc/ntpdc-opts.texi@1.112 +1 -1
+ NTP_4_2_5P125
+
+ ntpdc/ntpdc.1@1.112 +2 -2
+ NTP_4_2_5P125
+
+ ntpq/ntpq-opts.c@1.113 +2 -2
+ NTP_4_2_5P125
+
+ ntpq/ntpq-opts.h@1.113 +3 -3
+ NTP_4_2_5P125
+
+ ntpq/ntpq-opts.texi@1.112 +1 -1
+ NTP_4_2_5P125
+
+ ntpq/ntpq.1@1.112 +2 -2
+ NTP_4_2_5P125
+
+ packageinfo.sh@1.128 +1 -1
+ NTP_4_2_5P125
+
+ sntp/sntp-opts.c@1.113 +2 -2
+ NTP_4_2_5P125
+
+ sntp/sntp-opts.h@1.113 +3 -3
+ NTP_4_2_5P125
+
+ sntp/sntp-opts.texi@1.112 +1 -1
+ NTP_4_2_5P125
+
+ sntp/sntp.1@1.112 +2 -2
+ NTP_4_2_5P125
+
+ util/ntp-keygen-opts.c@1.116 +2 -2
+ NTP_4_2_5P125
+
+ util/ntp-keygen-opts.h@1.116 +3 -3
+ NTP_4_2_5P125
+
+ util/ntp-keygen-opts.texi@1.115 +1 -1
+ NTP_4_2_5P125
+
+ util/ntp-keygen.1@1.115 +2 -2
+ NTP_4_2_5P125
+
+ChangeSet@1.1735.1.27, 2008-08-17 19:38:48-04:00, stenn@pogo.udel.edu
+ [Bug 1052] Add linuxPPS support to ONCORE driver
+
+ ChangeLog@1.209 +1 -0
+ [Bug 1052] Add linuxPPS support to ONCORE driver
+
+ChangeSet@1.1735.3.3, 2008-08-17 07:52:08-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P124
+ TAG: NTP_4_2_5P124
+
+ ChangeLog@1.208 +1 -0
+ NTP_4_2_5P124
+
+ ntpd/ntpd-opts.c@1.116 +2 -2
+ NTP_4_2_5P124
+
+ ntpd/ntpd-opts.h@1.116 +3 -3
+ NTP_4_2_5P124
+
+ ntpd/ntpd-opts.texi@1.115 +1 -1
+ NTP_4_2_5P124
+
+ ntpd/ntpd.1@1.115 +2 -2
+ NTP_4_2_5P124
+
+ ntpdc/ntpdc-opts.c@1.112 +2 -2
+ NTP_4_2_5P124
+
+ ntpdc/ntpdc-opts.h@1.112 +3 -3
+ NTP_4_2_5P124
+
+ ntpdc/ntpdc-opts.texi@1.111 +1 -1
+ NTP_4_2_5P124
+
+ ntpdc/ntpdc.1@1.111 +2 -2
+ NTP_4_2_5P124
+
+ ntpq/ntpq-opts.c@1.112 +2 -2
+ NTP_4_2_5P124
+
+ ntpq/ntpq-opts.h@1.112 +3 -3
+ NTP_4_2_5P124
+
+ ntpq/ntpq-opts.texi@1.111 +1 -1
+ NTP_4_2_5P124
+
+ ntpq/ntpq.1@1.111 +2 -2
+ NTP_4_2_5P124
+
+ packageinfo.sh@1.127 +1 -1
+ NTP_4_2_5P124
+
+ sntp/sntp-opts.c@1.112 +2 -2
+ NTP_4_2_5P124
+
+ sntp/sntp-opts.h@1.112 +3 -3
+ NTP_4_2_5P124
+
+ sntp/sntp-opts.texi@1.111 +1 -1
+ NTP_4_2_5P124
+
+ sntp/sntp.1@1.111 +2 -2
+ NTP_4_2_5P124
+
+ util/ntp-keygen-opts.c@1.115 +2 -2
+ NTP_4_2_5P124
+
+ util/ntp-keygen-opts.h@1.115 +3 -3
+ NTP_4_2_5P124
+
+ util/ntp-keygen-opts.texi@1.114 +1 -1
+ NTP_4_2_5P124
+
+ util/ntp-keygen.1@1.114 +2 -2
+ NTP_4_2_5P124
+
+ChangeSet@1.1735.3.2, 2008-08-17 06:57:54-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.207 +1 -0
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.45 +11 -1
+ Documentation updates from Dave Mills
+
+ html/xleave.html@1.2 +9 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1436.15.6, 2008-08-17 06:21:39-04:00, stenn@whimsy.udel.edu
+ typo
+
+ scripts/addChangeLogTag@1.3 +0 -3
+ typo
+
+ChangeSet@1.1436.15.5, 2008-08-17 06:16:19-04:00, stenn@whimsy.udel.edu
+ typo
+
+ ChangeLog@1.1.1.44 +0 -2
+ typo
+
+ChangeSet@1.1436.15.4, 2008-08-17 05:30:47-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P5
+ TAG: NTP_4_2_4P5
+
+ ChangeLog@1.1.1.43 +3 -0
+ NTP_4_2_4P5
+
+ ntpd/ntpd-opts.c@1.50.16.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpd/ntpd-opts.h@1.50.16.1 +3 -3
+ NTP_4_2_4P5
+
+ ntpd/ntpd-opts.texi@1.49.16.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpd/ntpd.1@1.48.16.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim-opts.c@1.50.16.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim-opts.h@1.50.16.1 +3 -3
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim-opts.texi@1.48.16.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpd/ntpdsim.1@1.48.16.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc-opts.c@1.50.16.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc-opts.h@1.50.16.1 +3 -3
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc-opts.texi@1.48.16.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpdc/ntpdc.1@1.48.16.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpq/ntpq-opts.c@1.52.16.1 +2 -2
+ NTP_4_2_4P5
+
+ ntpq/ntpq-opts.h@1.52.16.1 +3 -3
+ NTP_4_2_4P5
+
+ ntpq/ntpq-opts.texi@1.49.16.1 +1 -1
+ NTP_4_2_4P5
+
+ ntpq/ntpq.1@1.48.16.1 +2 -2
+ NTP_4_2_4P5
+
+ packageinfo.sh@1.65.23.2 +2 -2
+ NTP_4_2_4P5
+
+ sntp/sntp-opts.c@1.49.16.1 +2 -2
+ NTP_4_2_4P5
+
+ sntp/sntp-opts.h@1.49.16.1 +3 -3
+ NTP_4_2_4P5
+
+ sntp/sntp-opts.texi@1.46.16.1 +1 -1
+ NTP_4_2_4P5
+
+ sntp/sntp.1@1.49.16.1 +2 -2
+ NTP_4_2_4P5
+
+ util/ntp-keygen-opts.c@1.49.16.1 +2 -2
+ NTP_4_2_4P5
+
+ util/ntp-keygen-opts.h@1.49.16.1 +3 -3
+ NTP_4_2_4P5
+
+ util/ntp-keygen-opts.texi@1.47.16.1 +1 -1
+ NTP_4_2_4P5
+
+ util/ntp-keygen.1@1.47.16.1 +2 -2
+ NTP_4_2_4P5
+
+ChangeSet@1.1436.15.3, 2008-08-17 05:29:47-04:00, stenn@whimsy.udel.edu
+ typo
+
+ scripts/addChangeLogTag@1.2 +1 -1
+ typo
+
+ChangeSet@1.1436.15.2, 2008-08-17 03:28:53-04:00, stenn@whimsy.udel.edu
+ 4.2.4p5 prep
+
+ .point-changed-filelist@1.1.1.1 +1 -0
+ 4.2.4p5 prep
+
+ NEWS@1.86.1.13 +17 -0
+ 4.2.4p5 prep
+
+ packageinfo.sh@1.65.23.1 +1 -1
+ 4.2.4p5 prep
+
+ scripts/addChangeLogTag@1.1 +27 -0
+ BitKeeper file /deacon/backroom/ntp-stable/scripts/addChangeLogTag
+
+ scripts/addChangeLogTag@1.0 +0 -0
+
+ scripts/genChangeLogTag@1.1 +6 -0
+ BitKeeper file /deacon/backroom/ntp-stable/scripts/genChangeLogTag
+
+ scripts/genChangeLogTag@1.0 +0 -0
+
+ChangeSet@1.1436.15.1, 2008-08-16 22:42:08-04:00, stenn@whimsy.udel.edu
+ [BUG 1051] Month off by one in leap second message written to clockstats
+
+ ChangeLog@1.1.1.42 +2 -0
+ [BUG 1051] Month off by one in leap second message written to clockstats
+
+ ntpd/refclock_oncore.c@1.60.2.1 +1 -1
+ [BUG 1051] Month off by one in leap second message written to clockstats
+
+ChangeSet@1.1756, 2008-08-17 05:57:54+09:00, Amidamaru@yumi.mxiesoft.com
+ networking.h:
+ Removed useless prototype filter_ntp
+ main.c, utilities.c, networking.c, kod_management.c:
+ Cleaning up
+
+ gsoc_sntp/kod_management.c@1.5 +2 -4
+ Cleaning up
+
+ gsoc_sntp/main.c@1.6 +14 -12
+ Cleaning up
+
+ gsoc_sntp/networking.c@1.12 +4 -16
+ Cleaning up
+
+ gsoc_sntp/networking.h@1.8 +2 -18
+ Removed useless prototype filter_ntp
+
+ gsoc_sntp/utilities.c@1.2 +1 -1
+ Cleaning up
+
+ChangeSet@1.1755, 2008-08-16 06:41:28+09:00, Amidamaru@yumi.mxiesoft.com
+ utilities.h:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.h
+ Makefile.am:
+ Added sntp-opts.c to sources
+ + minor fixes
+ main.c:
+ on_wire, timesetting stuff etc.
+ log.c, kod_management.c:
+ Bug fixes
+ utilities.o:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.o
+ utilities.c:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.c
+ sntp-opts.def:
+ fixed arg-type stuff
+
+ gsoc_sntp/Makefile.am@1.3 +6 -2
+ Added sntp-opts.c to sources
+ + minor fixes
+
+ gsoc_sntp/kod_management.c@1.4 +9 -7
+ Bug fixes
+
+ gsoc_sntp/kod_management.h@1.3 +2 -1
+
+ gsoc_sntp/log.c@1.4 +10 -11
+ Bug fixes
+
+ gsoc_sntp/log.h@1.3 +0 -3
+
+ gsoc_sntp/main.c@1.5 +180 -56
+ on_wire, timesetting stuff etc.
+
+ gsoc_sntp/networking.c@1.11 +82 -72
+
+ gsoc_sntp/networking.h@1.7 +6 -4
+
+ gsoc_sntp/sntp-opts.def@1.5 +21 -6
+ fixed arg-type stuff
+
+ gsoc_sntp/utilities.c@1.1 +101 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.c
+
+ gsoc_sntp/utilities.c@1.0 +0 -0
+
+ gsoc_sntp/utilities.h@1.1 +21 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.h
+
+ gsoc_sntp/utilities.h@1.0 +0 -0
+
+ gsoc_sntp/utilities.o@1.1 +177 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/ntp-dev/gsoc_sntp/utilities.o
+
+ gsoc_sntp/utilities.o@1.0 +0 -0
+
+ChangeSet@1.1436.1.105, 2008-08-10 21:56:17-04:00, clemens@pogo.udel.edu
+ BUG[1052] Minor reordering of previous patch to make it more robust.
+
+ ntpd/refclock_oncore.c@1.60.1.6 +57 -58
+ BUG[1052] Minor reordering of previous patch to make it more robust.
+
+ChangeSet@1.1436.1.104, 2008-08-10 18:31:13-04:00, clemens@pogo.udel.edu
+ [BUG 1052] Modify ONCORE driver for linuxPPS which uses a line discipline for the
+ PPS source.
+
+ ntpd/refclock_oncore.c@1.60.1.5 +21 -6
+ [BUG 1052] Modify ONCORE driver for linuxPPS which uses a line discipline for the
+ PPS source.
+
+ChangeSet@1.1436.1.103, 2008-08-10 18:21:32-04:00, clemens@pogo.udel.edu
+ Remove unneeded variable.
+
+ ntpd/refclock_oncore.c@1.60.1.4 +2 -3
+ Remove unneeded variable.
+
+ChangeSet@1.1436.1.102, 2008-08-10 18:18:56-04:00, clemens@pogo.udel.edu
+ [BUG 1051] Month off by one in leap second message written to clockstats file, fixed.
+
+ ntpd/refclock_oncore.c@1.60.1.3 +1 -1
+ [BUG 1051] Month off by one in leap second message written to clockstats file, fixed.
+
+ChangeSet@1.1735.1.23, 2008-08-10 09:45:36-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P123
+ TAG: NTP_4_2_5P123
+
+ ntpd/ntpd-opts.c@1.115 +2 -2
+ NTP_4_2_5P123
+
+ ntpd/ntpd-opts.h@1.115 +3 -3
+ NTP_4_2_5P123
+
+ ntpd/ntpd-opts.texi@1.114 +1 -1
+ NTP_4_2_5P123
+
+ ntpd/ntpd.1@1.114 +2 -2
+ NTP_4_2_5P123
+
+ ntpdc/ntpdc-opts.c@1.111 +2 -2
+ NTP_4_2_5P123
+
+ ntpdc/ntpdc-opts.h@1.111 +3 -3
+ NTP_4_2_5P123
+
+ ntpdc/ntpdc-opts.texi@1.110 +1 -1
+ NTP_4_2_5P123
+
+ ntpdc/ntpdc.1@1.110 +2 -2
+ NTP_4_2_5P123
+
+ ntpq/ntpq-opts.c@1.111 +2 -2
+ NTP_4_2_5P123
+
+ ntpq/ntpq-opts.h@1.111 +3 -3
+ NTP_4_2_5P123
+
+ ntpq/ntpq-opts.texi@1.110 +1 -1
+ NTP_4_2_5P123
+
+ ntpq/ntpq.1@1.110 +2 -2
+ NTP_4_2_5P123
+
+ packageinfo.sh@1.126 +1 -1
+ NTP_4_2_5P123
+
+ sntp/sntp-opts.c@1.111 +4 -5
+ NTP_4_2_5P123
+
+ sntp/sntp-opts.h@1.111 +5 -6
+ NTP_4_2_5P123
+
+ sntp/sntp-opts.texi@1.110 +2 -3
+ NTP_4_2_5P123
+
+ sntp/sntp.1@1.110 +3 -3
+ NTP_4_2_5P123
+
+ util/ntp-keygen-opts.c@1.114 +2 -2
+ NTP_4_2_5P123
+
+ util/ntp-keygen-opts.h@1.114 +3 -3
+ NTP_4_2_5P123
+
+ util/ntp-keygen-opts.texi@1.113 +1 -1
+ NTP_4_2_5P123
+
+ util/ntp-keygen.1@1.113 +2 -2
+ NTP_4_2_5P123
+
+ChangeSet@1.1436.1.101, 2008-08-10 07:44:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P5_RC2
+ TAG: NTP_4_2_4P5_RC2
+
+ ntpd/ntpd-opts.c@1.50.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ ntpd/ntpd-opts.h@1.50.15.1 +3 -3
+ NTP_4_2_4P5_RC2
+
+ ntpd/ntpd-opts.texi@1.49.15.1 +1 -1
+ NTP_4_2_4P5_RC2
+
+ ntpd/ntpd.1@1.48.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ ntpd/ntpdsim-opts.c@1.50.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ ntpd/ntpdsim-opts.h@1.50.15.1 +3 -3
+ NTP_4_2_4P5_RC2
+
+ ntpd/ntpdsim-opts.texi@1.48.15.1 +1 -1
+ NTP_4_2_4P5_RC2
+
+ ntpd/ntpdsim.1@1.48.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ ntpdc/ntpdc-opts.c@1.50.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ ntpdc/ntpdc-opts.h@1.50.15.1 +3 -3
+ NTP_4_2_4P5_RC2
+
+ ntpdc/ntpdc-opts.texi@1.48.15.1 +1 -1
+ NTP_4_2_4P5_RC2
+
+ ntpdc/ntpdc.1@1.48.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ ntpq/ntpq-opts.c@1.52.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ ntpq/ntpq-opts.h@1.52.15.1 +3 -3
+ NTP_4_2_4P5_RC2
+
+ ntpq/ntpq-opts.texi@1.49.15.1 +1 -1
+ NTP_4_2_4P5_RC2
+
+ ntpq/ntpq.1@1.48.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ packageinfo.sh@1.65.22.1 +1 -1
+ NTP_4_2_4P5_RC2
+
+ sntp/sntp-opts.c@1.49.15.1 +4 -5
+ NTP_4_2_4P5_RC2
+
+ sntp/sntp-opts.h@1.49.15.1 +5 -6
+ NTP_4_2_4P5_RC2
+
+ sntp/sntp-opts.texi@1.46.15.1 +2 -3
+ NTP_4_2_4P5_RC2
+
+ sntp/sntp.1@1.49.15.1 +3 -3
+ NTP_4_2_4P5_RC2
+
+ util/ntp-keygen-opts.c@1.49.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ util/ntp-keygen-opts.h@1.49.15.1 +3 -3
+ NTP_4_2_4P5_RC2
+
+ util/ntp-keygen-opts.texi@1.47.15.1 +1 -1
+ NTP_4_2_4P5_RC2
+
+ util/ntp-keygen.1@1.47.15.1 +2 -2
+ NTP_4_2_4P5_RC2
+
+ChangeSet@1.1735.1.22, 2008-08-10 03:11:51-04:00, stenn@whimsy.udel.edu
+ [Bug 861] leap info was not being transmitted
+
+ ChangeLog@1.205 +1 -0
+ [Bug 861] leap info was not being transmitted
+
+ ntpd/ntp_crypto.c@1.123 +2 -2
+ [Bug 861] leap info was not being transmitted
+
+ ntpd/ntp_timer.c@1.48 +1 -1
+ [Bug 861] leap info was not being transmitted
+
+ ntpd/refclock_local.c@1.18 +4 -1
+ [Bug 861] leap info was not being transmitted
+
+ChangeSet@1.1436.14.1, 2008-08-10 02:22:22-04:00, stenn@whimsy.udel.edu
+ triggert needs to handle rooted RESYNC paths now
+
+ BitKeeper/triggers/triggert@1.4.1.1 +3 -2
+ triggert needs to handle rooted RESYNC paths now
+
+ChangeSet@1.1735.1.20, 2008-08-09 20:56:32-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ChangeLog@1.204 +4 -10
+ cleanup
+
+ChangeSet@1.1436.1.98, 2008-08-09 20:05:06-04:00, stenn@whimsy.udel.edu
+ AutoGen'd files must be writable
+
+ sntp/Makefile.am@1.21.1.2 +2 -2
+ AutoGen'd files must be writable
+
+ sntp/sntp-opts.menu@1.2.1.1 +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.1754, 2008-08-09 07:28:37+09:00, Amidamaru@yumi.mxiesoft.com
+ main.c:
+ bug fixes
+ networking.c, kod_management.c:
+ Bug fixes
+
+ gsoc_sntp/kod_management.c@1.3 +62 -18
+ Bug fixes
+
+ gsoc_sntp/log.c@1.3 +27 -6
+
+ gsoc_sntp/main.c@1.4 +124 -27
+ bug fixes
+
+ gsoc_sntp/networking.c@1.10 +115 -21
+ Bug fixes
+
+ChangeSet@1.1436.13.1, 2008-08-07 20:44:31+02:00, burnicki@pogo.udel.edu
+ [Bug 450] Windows only: Under original Windows NT we must not discard the
+ wildcard socket to workaround a bug in NT's getsockname().
+
+ ChangeLog@1.1.10.1 +2 -0
+ [Bug 450] Windows only: Under original Windows NT we must not discard the
+ wildcard socket to workaround a bug in NT's getsockname().
+
+ ntpd/ntp_peer.c@1.97.2.1 +10 -2
+ [Bug 450] Windows only: Under original Windows NT we must not discard the
+ wildcard socket to workaround a bug in NT's getsockname().
+
+ ports/winnt/ntpd/ntservice.c@1.9.1.2 +8 -1
+ [Bug 450] Windows only: Under original Windows NT we must not discard the
+ wildcard socket to workaround a bug in NT's getsockname().
+
+ChangeSet@1.1753, 2008-08-06 17:05:34+09:00, Amidamaru@yumi.mxiesoft.com
+ networking.c:
+ Fixed resolver and some minor stuff
+
+ gsoc_sntp/networking.c@1.9 +70 -22
+ Fixed resolver and some minor stuff
+
+ChangeSet@1.1735.1.15, 2008-08-05 19:56:11-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P122
+ TAG: NTP_4_2_5P122
+
+ ntpd/ntpd-opts.c@1.114 +2 -2
+ NTP_4_2_5P122
+
+ ntpd/ntpd-opts.h@1.114 +3 -3
+ NTP_4_2_5P122
+
+ ntpd/ntpd-opts.texi@1.113 +1 -1
+ NTP_4_2_5P122
+
+ ntpd/ntpd.1@1.113 +2 -2
+ NTP_4_2_5P122
+
+ ntpdc/ntpdc-opts.c@1.110 +2 -2
+ NTP_4_2_5P122
+
+ ntpdc/ntpdc-opts.h@1.110 +3 -3
+ NTP_4_2_5P122
+
+ ntpdc/ntpdc-opts.texi@1.109 +1 -1
+ NTP_4_2_5P122
+
+ ntpdc/ntpdc.1@1.109 +2 -2
+ NTP_4_2_5P122
+
+ ntpq/ntpq-opts.c@1.110 +2 -2
+ NTP_4_2_5P122
+
+ ntpq/ntpq-opts.h@1.110 +3 -3
+ NTP_4_2_5P122
+
+ ntpq/ntpq-opts.texi@1.109 +1 -1
+ NTP_4_2_5P122
+
+ ntpq/ntpq.1@1.109 +2 -2
+ NTP_4_2_5P122
+
+ packageinfo.sh@1.125 +1 -1
+ NTP_4_2_5P122
+
+ sntp/sntp-opts.c@1.110 +2 -2
+ NTP_4_2_5P122
+
+ sntp/sntp-opts.h@1.110 +3 -3
+ NTP_4_2_5P122
+
+ sntp/sntp-opts.texi@1.109 +1 -1
+ NTP_4_2_5P122
+
+ sntp/sntp.1@1.109 +2 -2
+ NTP_4_2_5P122
+
+ util/ntp-keygen-opts.c@1.113 +2 -2
+ NTP_4_2_5P122
+
+ util/ntp-keygen-opts.h@1.113 +3 -3
+ NTP_4_2_5P122
+
+ util/ntp-keygen-opts.texi@1.112 +1 -1
+ NTP_4_2_5P122
+
+ util/ntp-keygen.1@1.112 +2 -2
+ NTP_4_2_5P122
+
+ChangeSet@1.1735.1.14, 2008-08-05 06:07:25-04:00, stenn@whimsy.udel.edu
+ [Bug 1046] refnumtoa.c is using the wrong header file
+
+ ChangeLog@1.199 +1 -0
+ [Bug 1046] refnumtoa.c is using the wrong header file
+
+ libntp/refnumtoa.c@1.5 +1 -1
+ [Bug 1046] refnumtoa.c is using the wrong header file
+
+ChangeSet@1.1735.1.13, 2008-08-05 05:00:05-04:00, stenn@whimsy.udel.edu
+ [Bug 1047] enable/disable options processing fix
+
+ ChangeLog@1.198 +1 -0
+ [Bug 1047] enable/disable options processing fix
+
+ ntpd/ntp_config.c@1.180 +12 -15
+ [Bug 1047] enable/disable options processing fix
+
+ChangeSet@1.1436.12.2, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu
+ Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.5 +0 -8
+ Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable.
+
+ChangeSet@1.1436.12.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu
+ [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
+ to local interfaces the default.
+ Emit a warning if that keyword is used for configuration.
+
+ ChangeLog@1.1.9.1 +3 -0
+ [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
+ to local interfaces the default.
+ Emit a warning if that keyword is used for configuration.
+
+ html/confopt.html@1.35.1.1 +0 -2
+ Bug 841: Obsolete the "dynamic" keyword.
+
+ html/ntpdc.html@1.26.1.1 +2 -3
+ Bug 841: Obsolete the "dynamic" keyword.
+
+ include/ntp.h@1.128.1.1 +0 -1
+ Bug 841: Obsolete the "dynamic" keyword.
+
+ include/ntp_request.h@1.30.1.1 +0 -1
+ Bug 841: Obsolete the "dynamic" keyword.
+
+ ntpd/ntp_config.c@1.141.1.3 +4 -2
+ [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
+ to local interfaces the default.
+ Emit a warning if that keyword is used for configuration.
+
+ ntpd/ntp_intres.c@1.48.1.4 +1 -3
+ Bug 841: Obsolete the "dynamic" keyword.
+
+ ntpd/ntp_peer.c@1.97.1.3 +5 -25
+ [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
+ to local interfaces the default.
+
+ ntpd/ntp_request.c@1.65.1.1 +1 -3
+ Bug 841: Obsolete the "dynamic" keyword.
+
+ ntpdc/ntpdc_ops.c@1.46.1.4 +3 -3
+ [Bug 841] Obsolete the "dynamic" keyword and make deferred binding
+ to local interfaces the default.
+
+ChangeSet@1.1749.1.2, 2008-08-02 07:02:15-04:00, stenn@pogo.udel.edu
+ typo
+
+ gsoc_sntp/main.c@1.3 +2 -1
+ typo
+
+ChangeSet@1.1749.1.1, 2008-07-29 19:04:34-04:00, stenn@pogo.udel.edu
+ cleanups
+
+ gsoc_sntp/configure.ac@1.3 +1 -1
+ cleanups
+
+ gsoc_sntp/header.h@1.2 +0 -1
+ cleanups
+
+ gsoc_sntp/main.c@1.2 +9 -4
+ cleanups
+
+ gsoc_sntp/networking.h@1.6 +2 -1
+ cleanups
+
+ChangeSet@1.1747.1.1, 2008-07-28 04:38:59+09:00, Amidamaru@yumi.mxiesoft.com
+ sntp-opts.def:
+ removed unnecessary verbosity flags
+
+ gsoc_sntp/sntp-opts.def@1.2.1.1 +1 -15
+ removed unnecessary verbosity flags
+
+ChangeSet@1.1749, 2008-07-27 15:10:03-04:00, stenn@pogo.udel.edu
+ Use ntp_machine.h
+
+ gsoc_sntp/data_formats.h@1.4 +1 -0
+ Use ntp_machine.h
+
+ChangeSet@1.1748, 2008-07-27 15:09:23-04:00, stenn@pogo.udel.edu
+ Fix the "kod" keyword
+
+ gsoc_sntp/:fetch-stubs@1.3 +1 -1
+ Fix the "kod" keyword
+
+ gsoc_sntp/sntp-opts.def@1.3 +2 -3
+ Fix the "kod" keyword
+
+ChangeSet@1.1735.1.12, 2008-07-24 15:28:20-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P121
+ TAG: NTP_4_2_5P121
+
+ ntpd/ntpd-opts.c@1.113 +2 -2
+ NTP_4_2_5P121
+
+ ntpd/ntpd-opts.h@1.113 +3 -3
+ NTP_4_2_5P121
+
+ ntpd/ntpd-opts.texi@1.112 +1 -1
+ NTP_4_2_5P121
+
+ ntpd/ntpd.1@1.112 +2 -2
+ NTP_4_2_5P121
+
+ ntpdc/ntpdc-opts.c@1.109 +2 -2
+ NTP_4_2_5P121
+
+ ntpdc/ntpdc-opts.h@1.109 +3 -3
+ NTP_4_2_5P121
+
+ ntpdc/ntpdc-opts.texi@1.108 +1 -1
+ NTP_4_2_5P121
+
+ ntpdc/ntpdc.1@1.108 +2 -2
+ NTP_4_2_5P121
+
+ ntpq/ntpq-opts.c@1.109 +2 -2
+ NTP_4_2_5P121
+
+ ntpq/ntpq-opts.h@1.109 +3 -3
+ NTP_4_2_5P121
+
+ ntpq/ntpq-opts.texi@1.108 +1 -1
+ NTP_4_2_5P121
+
+ ntpq/ntpq.1@1.108 +2 -2
+ NTP_4_2_5P121
+
+ packageinfo.sh@1.124 +1 -1
+ NTP_4_2_5P121
+
+ sntp/sntp-opts.c@1.109 +2 -2
+ NTP_4_2_5P121
+
+ sntp/sntp-opts.h@1.109 +3 -3
+ NTP_4_2_5P121
+
+ sntp/sntp-opts.texi@1.108 +1 -1
+ NTP_4_2_5P121
+
+ sntp/sntp.1@1.108 +2 -2
+ NTP_4_2_5P121
+
+ util/ntp-keygen-opts.c@1.112 +2 -2
+ NTP_4_2_5P121
+
+ util/ntp-keygen-opts.h@1.112 +3 -3
+ NTP_4_2_5P121
+
+ util/ntp-keygen-opts.texi@1.111 +1 -1
+ NTP_4_2_5P121
+
+ util/ntp-keygen.1@1.111 +2 -2
+ NTP_4_2_5P121
+
+ChangeSet@1.1746, 2008-07-24 17:07:55+09:00, Amidamaru@yumi.mxiesoft.com
+ networking.c:
+ Fixing the mess
+
+ gsoc_sntp/networking.c@1.7 +3 -1
+ Fixing the mess
+
+ gsoc_sntp/networking.c@1.6 +0 -2
+
+ChangeSet@1.1745, 2008-07-24 16:53:33+09:00, Amidamaru@yumi.mxiesoft.com
+ networking.c:
+ redo include
+
+ gsoc_sntp/networking.c@1.5 +2 -0
+ redo include
+
+ChangeSet@1.1744, 2008-07-24 16:49:34+09:00, Amidamaru@yumi.mxiesoft.com
+ fixed includes
+
+ gsoc_sntp/networking.c@1.4 +2 -2
+
+ChangeSet@1.1739.1.8, 2008-07-24 03:47:48-04:00, stenn@pogo.udel.edu
+ header cleanup
+
+ gsoc_sntp/networking.c@1.1.1.3 +2 -1
+ header cleanup
+
+ gsoc_sntp/networking.h@1.1.1.3 +3 -1
+ header cleanup
+
+ChangeSet@1.1739.1.7, 2008-07-24 03:45:53-04:00, stenn@pogo.udel.edu
+ reorder headers
+
+ gsoc_sntp/data_formats.h@1.3 +1 -1
+ reorder headers
+
+ChangeSet@1.1739.1.6, 2008-07-24 03:44:24-04:00, stenn@pogo.udel.edu
+ hack ISC_PLATFORM_HAVEIPV6
+
+ gsoc_sntp/configure.ac@1.2 +1 -0
+ hack ISC_PLATFORM_HAVEIPV6
+
+ChangeSet@1.1739.1.5, 2008-07-24 03:23:31-04:00, stenn@pogo.udel.edu
+ header cleanup
+
+ gsoc_sntp/networking.c@1.1.1.2 +0 -1
+ header cleanup
+
+ChangeSet@1.1739.1.4, 2008-07-24 03:01:29-04:00, stenn@pogo.udel.edu
+ hacks
+
+ gsoc_sntp/data_formats.h@1.2 +0 -3
+ hacks
+
+ gsoc_sntp/networking.c@1.1.1.1 +1 -1
+ hacks
+
+ gsoc_sntp/networking.h@1.1.1.2 +8 -8
+ hacks
+
+ChangeSet@1.1739.1.3, 2008-07-24 02:06:52-04:00, stenn@pogo.udel.edu
+ cleanup
+
+ gsoc_sntp/networking.h@1.1.1.1 +2 -5
+ cleanup
+
+ChangeSet@1.1735.1.11, 2008-07-24 02:26:46+00:00, stenn@poog.il.thewrittenword.com
+ header file cleanup
+
+ ChangeLog@1.197 +1 -0
+ header file cleanup
+
+ include/Makefile.am@1.30 +1 -0
+ Added ntp_net.h
+
+ include/ntp.h@1.147 +4 -2
+ Header cleanup
+
+ include/ntp_fp.h@1.14 +0 -6
+ ntp_fp.h should have *never* been how we pulled in network stuff
+
+ include/ntp_net.h@1.1 +14 -0
+ BitKeeper file /home/stenn/ntp-dev/include/ntp_net.h
+
+ include/ntp_net.h@1.0 +0 -0
+
+ include/recvbuff.h@1.15 +0 -1
+ Header cleanup
+
+ChangeSet@1.1739.1.1, 2008-07-22 16:12:19-04:00, stenn@pogo.udel.edu
+ build infrastructure updates
+
+ gsoc_sntp/:fetch-stubs@1.2 +7 -0
+ updates
+
+ gsoc_sntp/configure.ac@1.1 +89 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/configure.ac
+
+ gsoc_sntp/configure.ac@1.0 +0 -0
+
+ChangeSet@1.1737.1.1, 2008-07-23 03:52:14+09:00, Amidamaru@yumi.mxiesoft.com
+ log.h, log.c:
+ Changed name of debug output function to avoid name collision with opt flag variable
+ kod_management.c:
+ Changed from fgets to fscanf (easier data extraction)
+
+ gsoc_sntp/Makefile@1.1.1.1 +16 -19
+
+ gsoc_sntp/Makefile.in@1.1.1.1 +3 -6
+
+ gsoc_sntp/kod_management.c@1.2 +22 -57
+ Changed from fgets to fscanf (easier data extraction)
+
+ gsoc_sntp/kod_management.h@1.2 +1 -1
+
+ gsoc_sntp/log.c@1.2 +1 -1
+ Changed name of debug output function to avoid name collision with opt flag variable
+
+ gsoc_sntp/log.h@1.2 +1 -1
+ Changed name of debug output function to avoid name collision with opt flag variable
+
+ gsoc_sntp/networking.c@1.2 +20 -11
+
+ gsoc_sntp/networking.h@1.2 +4 -4
+
+ChangeSet@1.1739, 2008-07-22 14:38:08-04:00, stenn@pogo.udel.edu
+ added :fetch-stubs
+
+ gsoc_sntp/:fetch-stubs@1.1 +13 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-kuehn/gsoc_sntp/:fetch-stubs
+
+ gsoc_sntp/:fetch-stubs@1.0 +0 -0
+
+ChangeSet@1.1738, 2008-07-22 14:29:55-04:00, stenn@pogo.udel.edu
+ sntp fixes
+
+ BitKeeper/deleted/.del-Makefile@1.2 +0 -0
+ Delete: gsoc_sntp/Makefile
+
+ BitKeeper/deleted/.del-Makefile.in@1.2 +0 -0
+ Delete: gsoc_sntp/Makefile.in
+
+ Makefile.am@1.77 +2 -0
+ Add gsoc_sntp to the build
+
+ gsoc_sntp/Makefile.am@1.2 +15 -18
+ autogen stuff
+
+ gsoc_sntp/libopts/COPYING.lgpl@1.2 +0 -0
+ bk cp COPYING.lgpl ../gsoc_sntp/libopts/COPYING.lgpl
+
+ gsoc_sntp/libopts/COPYING.lgpl@1.1, stenn@whimsy.udel.edu +502 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.lgpl
+
+ gsoc_sntp/libopts/COPYING.lgpl@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/COPYING.mbsd@1.2 +0 -0
+ bk cp COPYING.mbsd ../gsoc_sntp/libopts/COPYING.mbsd
+
+ gsoc_sntp/libopts/COPYING.mbsd@1.1, stenn@whimsy.udel.edu +26 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.mbsd
+
+ gsoc_sntp/libopts/COPYING.mbsd@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/MakeDefs.inc@1.2 +0 -0
+ bk cp MakeDefs.inc ../gsoc_sntp/libopts/MakeDefs.inc
+
+ gsoc_sntp/libopts/MakeDefs.inc@1.1, stenn@whimsy.udel.edu +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/MakeDefs.inc
+
+ gsoc_sntp/libopts/MakeDefs.inc@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/Makefile.am@1.2 +0 -0
+ bk cp Makefile.am ../gsoc_sntp/libopts/Makefile.am
+
+ gsoc_sntp/libopts/Makefile.am@1.1, stenn@whimsy.udel.edu +24 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/Makefile.am
+
+ gsoc_sntp/libopts/Makefile.am@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/README@1.2 +0 -0
+ bk cp README ../gsoc_sntp/libopts/README
+
+ gsoc_sntp/libopts/README@1.1, stenn@whimsy.udel.edu +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/README
+
+ gsoc_sntp/libopts/README@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/autoopts.c@1.2 +0 -0
+ bk cp autoopts.c ../gsoc_sntp/libopts/autoopts.c
+
+ gsoc_sntp/libopts/autoopts.c@1.1, stenn@whimsy.udel.edu +1120 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.c
+
+ gsoc_sntp/libopts/autoopts.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/autoopts.h@1.2 +0 -0
+ bk cp autoopts.h ../gsoc_sntp/libopts/autoopts.h
+
+ gsoc_sntp/libopts/autoopts.h@1.1, stenn@whimsy.udel.edu +387 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.h
+
+ gsoc_sntp/libopts/autoopts.h@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/autoopts/options.h@1.2 +0 -0
+ bk cp autoopts/options.h ../gsoc_sntp/libopts/autoopts/options.h
+
+ gsoc_sntp/libopts/autoopts/options.h@1.1, stenn@whimsy.udel.edu +977 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/options.h
+
+ gsoc_sntp/libopts/autoopts/options.h@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.2 +0 -0
+ bk cp autoopts/usage-txt.h ../gsoc_sntp/libopts/autoopts/usage-txt.h
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.1, stenn@whimsy.udel.edu +355 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/usage-txt.h
+
+ gsoc_sntp/libopts/autoopts/usage-txt.h@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/boolean.c@1.2 +0 -0
+ bk cp boolean.c ../gsoc_sntp/libopts/boolean.c
+
+ gsoc_sntp/libopts/boolean.c@1.1, stenn@whimsy.udel.edu +106 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/boolean.c
+
+ gsoc_sntp/libopts/boolean.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/compat/compat.h@1.2 +0 -0
+ bk cp compat/compat.h ../gsoc_sntp/libopts/compat/compat.h
+
+ gsoc_sntp/libopts/compat/compat.h@1.1, stenn@whimsy.udel.edu +319 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/compat.h
+
+ gsoc_sntp/libopts/compat/compat.h@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/compat/pathfind.c@1.2 +0 -0
+ bk cp compat/pathfind.c ../gsoc_sntp/libopts/compat/pathfind.c
+
+ gsoc_sntp/libopts/compat/pathfind.c@1.1, stenn@whimsy.udel.edu +339 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/pathfind.c
+
+ gsoc_sntp/libopts/compat/pathfind.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/compat/snprintf.c@1.2 +0 -0
+ bk cp compat/snprintf.c ../gsoc_sntp/libopts/compat/snprintf.c
+
+ gsoc_sntp/libopts/compat/snprintf.c@1.1, stenn@whimsy.udel.edu +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/snprintf.c
+
+ gsoc_sntp/libopts/compat/snprintf.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/compat/strchr.c@1.2 +0 -0
+ bk cp compat/strchr.c ../gsoc_sntp/libopts/compat/strchr.c
+
+ gsoc_sntp/libopts/compat/strchr.c@1.1, stenn@whimsy.udel.edu +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strchr.c
+
+ gsoc_sntp/libopts/compat/strchr.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/compat/strdup.c@1.2 +0 -0
+ bk cp compat/strdup.c ../gsoc_sntp/libopts/compat/strdup.c
+
+ gsoc_sntp/libopts/compat/strdup.c@1.1, stenn@whimsy.udel.edu +19 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strdup.c
+
+ gsoc_sntp/libopts/compat/strdup.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/compat/windows-config.h@1.2 +0 -0
+ bk cp compat/windows-config.h ../gsoc_sntp/libopts/compat/windows-config.h
+
+ gsoc_sntp/libopts/compat/windows-config.h@1.1, stenn@whimsy.udel.edu +130 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/windows-config.h
+
+ gsoc_sntp/libopts/compat/windows-config.h@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/configfile.c@1.2 +0 -0
+ bk cp configfile.c ../gsoc_sntp/libopts/configfile.c
+
+ gsoc_sntp/libopts/configfile.c@1.1, stenn@whimsy.udel.edu +1290 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/configfile.c
+
+ gsoc_sntp/libopts/configfile.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/cook.c@1.2 +0 -0
+ bk cp cook.c ../gsoc_sntp/libopts/cook.c
+
+ gsoc_sntp/libopts/cook.c@1.1, stenn@whimsy.udel.edu +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/cook.c
+
+ gsoc_sntp/libopts/cook.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/enumeration.c@1.2 +0 -0
+ bk cp enumeration.c ../gsoc_sntp/libopts/enumeration.c
+
+ gsoc_sntp/libopts/enumeration.c@1.1, stenn@whimsy.udel.edu +498 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/enumeration.c
+
+ gsoc_sntp/libopts/enumeration.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/environment.c@1.2 +0 -0
+ bk cp environment.c ../gsoc_sntp/libopts/environment.c
+
+ gsoc_sntp/libopts/environment.c@1.1, stenn@whimsy.udel.edu +279 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/environment.c
+
+ gsoc_sntp/libopts/environment.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/genshell.c@1.2 +0 -0
+ bk cp genshell.c ../gsoc_sntp/libopts/genshell.c
+
+ gsoc_sntp/libopts/genshell.c@1.1, stenn@whimsy.udel.edu +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.c
+
+ gsoc_sntp/libopts/genshell.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/genshell.h@1.2 +0 -0
+ bk cp genshell.h ../gsoc_sntp/libopts/genshell.h
+
+ gsoc_sntp/libopts/genshell.h@1.1, stenn@whimsy.udel.edu +149 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.h
+
+ gsoc_sntp/libopts/genshell.h@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/libopts.c@1.2 +0 -0
+ bk cp libopts.c ../gsoc_sntp/libopts/libopts.c
+
+ gsoc_sntp/libopts/libopts.c@1.1, stenn@whimsy.udel.edu +30 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/libopts.c
+
+ gsoc_sntp/libopts/libopts.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/load.c@1.2 +0 -0
+ bk cp load.c ../gsoc_sntp/libopts/load.c
+
+ gsoc_sntp/libopts/load.c@1.1, stenn@whimsy.udel.edu +563 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/load.c
+
+ gsoc_sntp/libopts/load.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.2 +0 -0
+ bk cp m4/libopts.m4 ../gsoc_sntp/libopts/m4/libopts.m4
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.1, stenn@whimsy.udel.edu +509 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/libopts.m4
+
+ gsoc_sntp/libopts/m4/libopts.m4@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/m4/liboptschk.m4@1.2 +0 -0
+ bk cp m4/liboptschk.m4 ../gsoc_sntp/libopts/m4/liboptschk.m4
+
+ gsoc_sntp/libopts/m4/liboptschk.m4@1.1, stenn@whimsy.udel.edu +42 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/liboptschk.m4
+
+ gsoc_sntp/libopts/m4/liboptschk.m4@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/makeshell.c@1.2 +0 -0
+ bk cp makeshell.c ../gsoc_sntp/libopts/makeshell.c
+
+ gsoc_sntp/libopts/makeshell.c@1.1, stenn@whimsy.udel.edu +1122 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/makeshell.c
+
+ gsoc_sntp/libopts/makeshell.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/nested.c@1.2 +0 -0
+ bk cp nested.c ../gsoc_sntp/libopts/nested.c
+
+ gsoc_sntp/libopts/nested.c@1.1, stenn@whimsy.udel.edu +733 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/nested.c
+
+ gsoc_sntp/libopts/nested.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/numeric.c@1.2 +0 -0
+ bk cp numeric.c ../gsoc_sntp/libopts/numeric.c
+
+ gsoc_sntp/libopts/numeric.c@1.1, stenn@whimsy.udel.edu +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/numeric.c
+
+ gsoc_sntp/libopts/numeric.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/pgusage.c@1.2 +0 -0
+ bk cp pgusage.c ../gsoc_sntp/libopts/pgusage.c
+
+ gsoc_sntp/libopts/pgusage.c@1.1, stenn@whimsy.udel.edu +157 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/pgusage.c
+
+ gsoc_sntp/libopts/pgusage.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/proto.h@1.2 +0 -0
+ bk cp proto.h ../gsoc_sntp/libopts/proto.h
+
+ gsoc_sntp/libopts/proto.h@1.1, stenn@whimsy.udel.edu +91 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/proto.h
+
+ gsoc_sntp/libopts/proto.h@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/putshell.c@1.2 +0 -0
+ bk cp putshell.c ../gsoc_sntp/libopts/putshell.c
+
+ gsoc_sntp/libopts/putshell.c@1.1, stenn@whimsy.udel.edu +335 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/putshell.c
+
+ gsoc_sntp/libopts/putshell.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/restore.c@1.2 +0 -0
+ bk cp restore.c ../gsoc_sntp/libopts/restore.c
+
+ gsoc_sntp/libopts/restore.c@1.1, stenn@whimsy.udel.edu +250 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/restore.c
+
+ gsoc_sntp/libopts/restore.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/save.c@1.3 +0 -0
+ bk cp save.c ../gsoc_sntp/libopts/save.c
+
+ gsoc_sntp/libopts/save.c@1.2, stenn@whimsy.udel.edu +11 -2
+ [Bug 902] Fix problems with the -6 flag
+
+ gsoc_sntp/libopts/save.c@1.1, stenn@whimsy.udel.edu +512 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/save.c
+
+ gsoc_sntp/libopts/save.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/sort.c@1.2 +0 -0
+ bk cp sort.c ../gsoc_sntp/libopts/sort.c
+
+ gsoc_sntp/libopts/sort.c@1.1, stenn@whimsy.udel.edu +359 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/sort.c
+
+ gsoc_sntp/libopts/sort.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/stack.c@1.2 +0 -0
+ bk cp stack.c ../gsoc_sntp/libopts/stack.c
+
+ gsoc_sntp/libopts/stack.c@1.1, stenn@whimsy.udel.edu +269 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/stack.c
+
+ gsoc_sntp/libopts/stack.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/streqvcmp.c@1.2 +0 -0
+ bk cp streqvcmp.c ../gsoc_sntp/libopts/streqvcmp.c
+
+ gsoc_sntp/libopts/streqvcmp.c@1.1, stenn@whimsy.udel.edu +289 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/streqvcmp.c
+
+ gsoc_sntp/libopts/streqvcmp.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/text_mmap.c@1.2 +0 -0
+ bk cp text_mmap.c ../gsoc_sntp/libopts/text_mmap.c
+
+ gsoc_sntp/libopts/text_mmap.c@1.1, stenn@whimsy.udel.edu +363 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/text_mmap.c
+
+ gsoc_sntp/libopts/text_mmap.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/tokenize.c@1.2 +0 -0
+ bk cp tokenize.c ../gsoc_sntp/libopts/tokenize.c
+
+ gsoc_sntp/libopts/tokenize.c@1.1, stenn@whimsy.udel.edu +321 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/tokenize.c
+
+ gsoc_sntp/libopts/tokenize.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/usage.c@1.2 +0 -0
+ bk cp usage.c ../gsoc_sntp/libopts/usage.c
+
+ gsoc_sntp/libopts/usage.c@1.1, stenn@whimsy.udel.edu +740 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/usage.c
+
+ gsoc_sntp/libopts/usage.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/libopts/version.c@1.2 +0 -0
+ bk cp version.c ../gsoc_sntp/libopts/version.c
+
+ gsoc_sntp/libopts/version.c@1.1, stenn@whimsy.udel.edu +178 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/version.c
+
+ gsoc_sntp/libopts/version.c@1.0, stenn@whimsy.udel.edu +0 -0
+
+ gsoc_sntp/sntp-opts.def@1.2 +1 -1
+ Update the copyright year
+
+ChangeSet@1.1436.1.96, 2008-07-22 11:41:26+02:00, burnicki@pogo.udel.edu
+ [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG.
+
+ ChangeLog@1.1.1.39 +1 -0
+ [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG.
+
+ libntp/machines.c@1.19 +2 -2
+ [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG.
+
+ChangeSet@1.1735.1.10, 2008-07-16 18:07:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P120
+ TAG: NTP_4_2_5P120
+
+ ntpd/ntpd-opts.c@1.112 +2 -2
+ NTP_4_2_5P120
+
+ ntpd/ntpd-opts.h@1.112 +3 -3
+ NTP_4_2_5P120
+
+ ntpd/ntpd-opts.texi@1.111 +1 -1
+ NTP_4_2_5P120
+
+ ntpd/ntpd.1@1.111 +2 -2
+ NTP_4_2_5P120
+
+ ntpdc/ntpdc-opts.c@1.108 +2 -2
+ NTP_4_2_5P120
+
+ ntpdc/ntpdc-opts.h@1.108 +3 -3
+ NTP_4_2_5P120
+
+ ntpdc/ntpdc-opts.texi@1.107 +1 -1
+ NTP_4_2_5P120
+
+ ntpdc/ntpdc.1@1.107 +2 -2
+ NTP_4_2_5P120
+
+ ntpq/ntpq-opts.c@1.108 +2 -2
+ NTP_4_2_5P120
+
+ ntpq/ntpq-opts.h@1.108 +3 -3
+ NTP_4_2_5P120
+
+ ntpq/ntpq-opts.texi@1.107 +1 -1
+ NTP_4_2_5P120
+
+ ntpq/ntpq.1@1.107 +2 -2
+ NTP_4_2_5P120
+
+ packageinfo.sh@1.123 +1 -1
+ NTP_4_2_5P120
+
+ sntp/sntp-opts.c@1.108 +2 -2
+ NTP_4_2_5P120
+
+ sntp/sntp-opts.h@1.108 +3 -3
+ NTP_4_2_5P120
+
+ sntp/sntp-opts.texi@1.107 +1 -1
+ NTP_4_2_5P120
+
+ sntp/sntp.1@1.107 +2 -2
+ NTP_4_2_5P120
+
+ util/ntp-keygen-opts.c@1.111 +2 -2
+ NTP_4_2_5P120
+
+ util/ntp-keygen-opts.h@1.111 +3 -3
+ NTP_4_2_5P120
+
+ util/ntp-keygen-opts.texi@1.110 +1 -1
+ NTP_4_2_5P120
+
+ util/ntp-keygen.1@1.110 +2 -2
+ NTP_4_2_5P120
+
+ChangeSet@1.1735.1.9, 2008-07-16 17:13:00-04:00, stenn@whimsy.udel.edu
+ [Bug 1037]: buffer in subroutine was 1 byte short
+
+ ChangeLog@1.196 +1 -0
+ [Bug 1037]: buffer in subroutine was 1 byte short
+
+ util/ntp-keygen.c@1.52 +1 -1
+ [Bug 1037]: buffer in subroutine was 1 byte short
+
+ChangeSet@1.1735.1.8, 2008-07-16 06:22:25-04:00, stenn@whimsy.udel.edu
+ .del-genkeys.html:
+ Delete: html/genkeys.html
+
+ BitKeeper/deleted/.del-genkeys.html@1.3 +0 -0
+ Delete: html/genkeys.html
+
+ChangeSet@1.1735.1.7, 2008-07-16 06:17:22-04:00, stenn@whimsy.udel.edu
+ interleave documentation
+
+ html/xleave.html@1.1 +32 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/xleave.html
+
+ html/xleave.html@1.0 +0 -0
+
+ChangeSet@1.1735.1.6, 2008-07-16 05:32:55-04:00, stenn@whimsy.udel.edu
+ configure.ac: cleanup, added wintime and bug 1028 options
+
+ ChangeLog@1.195 +2 -0
+ configure.ac: cleanup, added wintime and bug 1028 options
+
+ configure.ac@1.415 +46 -6
+ configure.ac: cleanup, added wintime and bug 1028 options
+
+ChangeSet@1.1735.1.5, 2008-07-16 05:26:43-04:00, stenn@whimsy.udel.edu
+ Bias and Interleave stuff from Dave Mills.
+
+ ChangeLog@1.194 +3 -0
+ Bias and Interleave stuff from Dave Mills.
+
+ include/ntp.h@1.146 +12 -3
+ Bias and Interleave stuff from Dave Mills.
+
+ include/ntp_config.h@1.47 +1 -0
+ Bias and Interleave stuff from Dave Mills.
+
+ libntp/statestr.c@1.14 +2 -0
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_config.c@1.179 +5 -0
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_control.c@1.105 +13 -8
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_loopfilter.c@1.146 +8 -9
+ separate phase/freq discipline.
+
+ ntpd/ntp_parser.c@1.27 +1092 -1065
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_parser.h@1.12 +289 -285
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_parser.y@1.22 +4 -0
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_proto.c@1.274 +332 -160
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_refclock.c@1.80 +2 -2
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_request.c@1.74 +1 -2
+ Bias and Interleave stuff from Dave Mills.
+
+ ntpd/ntp_util.c@1.65 +4 -9
+ Bias and Interleave stuff from Dave Mills.
+
+ChangeSet@1.1735.1.4, 2008-07-16 05:12:48-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.193 +1 -0
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.41 +28 -19
+ Documentation updates from Dave Mills
+
+ html/copyright.html@1.41 +1 -1
+ Documentation updates from Dave Mills
+
+ html/decode.html@1.2 +2 -2
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.12 +3 -2
+ Documentation updates from Dave Mills
+
+ html/monopt.html@1.28 +1 -1
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.44 +2 -1
+ Documentation updates from Dave Mills
+
+ html/ntpq.html@1.30 +6 -2
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1735.1.3, 2008-07-16 05:06:03-04:00, stenn@whimsy.udel.edu
+ jitter.c: make NBUF about 10x bigger
+
+ util/jitter.c@1.9 +1 -1
+ jitter.c: make NBUF about 10x bigger
+
+ChangeSet@1.1735.1.2, 2008-07-15 03:44:23-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P119
+ TAG: NTP_4_2_5P119
+
+ ntpd/ntpd-opts.c@1.111 +2 -2
+ NTP_4_2_5P119
+
+ ntpd/ntpd-opts.h@1.111 +3 -3
+ NTP_4_2_5P119
+
+ ntpd/ntpd-opts.texi@1.110 +1 -1
+ NTP_4_2_5P119
+
+ ntpd/ntpd.1@1.110 +2 -2
+ NTP_4_2_5P119
+
+ ntpdc/ntpdc-opts.c@1.107 +2 -2
+ NTP_4_2_5P119
+
+ ntpdc/ntpdc-opts.h@1.107 +3 -3
+ NTP_4_2_5P119
+
+ ntpdc/ntpdc-opts.texi@1.106 +1 -1
+ NTP_4_2_5P119
+
+ ntpdc/ntpdc.1@1.106 +2 -2
+ NTP_4_2_5P119
+
+ ntpq/ntpq-opts.c@1.107 +2 -2
+ NTP_4_2_5P119
+
+ ntpq/ntpq-opts.h@1.107 +3 -3
+ NTP_4_2_5P119
+
+ ntpq/ntpq-opts.texi@1.106 +1 -1
+ NTP_4_2_5P119
+
+ ntpq/ntpq.1@1.106 +2 -2
+ NTP_4_2_5P119
+
+ packageinfo.sh@1.122 +1 -1
+ NTP_4_2_5P119
+
+ sntp/sntp-opts.c@1.107 +2 -2
+ NTP_4_2_5P119
+
+ sntp/sntp-opts.h@1.107 +3 -3
+ NTP_4_2_5P119
+
+ sntp/sntp-opts.texi@1.106 +1 -1
+ NTP_4_2_5P119
+
+ sntp/sntp.1@1.106 +2 -2
+ NTP_4_2_5P119
+
+ util/ntp-keygen-opts.c@1.110 +2 -2
+ NTP_4_2_5P119
+
+ util/ntp-keygen-opts.h@1.110 +3 -3
+ NTP_4_2_5P119
+
+ util/ntp-keygen-opts.texi@1.109 +1 -1
+ NTP_4_2_5P119
+
+ util/ntp-keygen.1@1.109 +2 -2
+ NTP_4_2_5P119
+
+ChangeSet@1.1735.1.1, 2008-07-14 01:28:14-04:00, stenn@whimsy.udel.edu
+ [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen
+
+ ChangeLog@1.192 +1 -0
+ [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen
+
+ util/ntp-keygen.c@1.51 +1 -1
+ [Bug 1037] Use all 16 of the MD5 passwords generated by ntp-keygen
+
+ChangeSet@1.1737, 2008-07-09 05:45:39+09:00, Amidamaru@yumi.mxiesoft.com
+ networking.h:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.h
+ networking.c:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.c
+
+ gsoc_sntp/networking.c@1.1 +278 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.c
+
+ gsoc_sntp/networking.c@1.0 +0 -0
+
+ gsoc_sntp/networking.h@1.1 +48 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/networking.h
+
+ gsoc_sntp/networking.h@1.0 +0 -0
+
+ChangeSet@1.1736, 2008-07-09 05:14:24+09:00, Amidamaru@yumi.mxiesoft.com
+ ignore:
+ added config.guess config.h config.h.in config.log config.status config.sub
+ Makefile.in:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.in
+ netutils.c:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.c
+ header.h:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/header.h
+ sntp-opts.def:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/sntp-opts.def
+ netutils.h:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.h
+ kod_management.h:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.h
+ ignore:
+ added aclocal.m4
+ kod_management.c:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.c
+ Makefile:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile
+ ignore:
+ added config.h
+ main.c:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/main.c
+ ignore:
+ added test.kod
+ log.c:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.c
+ data_formats.h:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/data_formats.h
+ log.h:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.h
+ Makefile.am:
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.am
+
+ BitKeeper/etc/ignore@1.64 +1 -0
+ added test.kod
+
+ BitKeeper/etc/ignore@1.63 +1 -0
+ added aclocal.m4
+
+ BitKeeper/etc/ignore@1.62 +6 -0
+ added config.guess config.h config.h.in config.log config.status config.sub
+
+ BitKeeper/etc/ignore@1.61 +1 -0
+ added config.h
+
+ gsoc_sntp/Makefile@1.1 +694 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile
+
+ gsoc_sntp/Makefile@1.0 +0 -0
+
+ gsoc_sntp/Makefile.am@1.1 +69 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.am
+
+ gsoc_sntp/Makefile.am@1.0 +0 -0
+
+ gsoc_sntp/Makefile.in@1.1 +694 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/Makefile.in
+
+ gsoc_sntp/Makefile.in@1.0 +0 -0
+
+ gsoc_sntp/data_formats.h@1.1 +10 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/data_formats.h
+
+ gsoc_sntp/data_formats.h@1.0 +0 -0
+
+ gsoc_sntp/header.h@1.1 +87 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/header.h
+
+ gsoc_sntp/header.h@1.0 +0 -0
+
+ gsoc_sntp/kod_management.c@1.1 +258 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.c
+
+ gsoc_sntp/kod_management.c@1.0 +0 -0
+
+ gsoc_sntp/kod_management.h@1.1 +20 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/kod_management.h
+
+ gsoc_sntp/kod_management.h@1.0 +0 -0
+
+ gsoc_sntp/log.c@1.1 +52 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.c
+
+ gsoc_sntp/log.c@1.0 +0 -0
+
+ gsoc_sntp/log.h@1.1 +21 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/log.h
+
+ gsoc_sntp/log.h@1.0 +0 -0
+
+ gsoc_sntp/main.c@1.1 +86 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/main.c
+
+ gsoc_sntp/main.c@1.0 +0 -0
+
+ gsoc_sntp/netutils.c@1.1 +320 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.c
+
+ gsoc_sntp/netutils.c@1.0 +0 -0
+
+ gsoc_sntp/netutils.h@1.1 +10 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/netutils.h
+
+ gsoc_sntp/netutils.h@1.0 +0 -0
+
+ gsoc_sntp/sntp-opts.def@1.1 +293 -0
+ BitKeeper file /geom_mobile/home/Amidamaru/projects/sntp/repo/gsoc_sntp/sntp-opts.def
+
+ gsoc_sntp/sntp-opts.def@1.0 +0 -0
+
+ChangeSet@1.1735, 2008-06-06 19:56:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P118
+ TAG: NTP_4_2_5P118
+
+ ntpd/ntpd-opts.c@1.110 +2 -2
+ NTP_4_2_5P118
+
+ ntpd/ntpd-opts.h@1.110 +3 -3
+ NTP_4_2_5P118
+
+ ntpd/ntpd-opts.texi@1.109 +1 -1
+ NTP_4_2_5P118
+
+ ntpd/ntpd.1@1.109 +2 -2
+ NTP_4_2_5P118
+
+ ntpdc/ntpdc-opts.c@1.106 +2 -2
+ NTP_4_2_5P118
+
+ ntpdc/ntpdc-opts.h@1.106 +3 -3
+ NTP_4_2_5P118
+
+ ntpdc/ntpdc-opts.texi@1.105 +1 -1
+ NTP_4_2_5P118
+
+ ntpdc/ntpdc.1@1.105 +2 -2
+ NTP_4_2_5P118
+
+ ntpq/ntpq-opts.c@1.106 +2 -2
+ NTP_4_2_5P118
+
+ ntpq/ntpq-opts.h@1.106 +3 -3
+ NTP_4_2_5P118
+
+ ntpq/ntpq-opts.texi@1.105 +1 -1
+ NTP_4_2_5P118
+
+ ntpq/ntpq.1@1.105 +2 -2
+ NTP_4_2_5P118
+
+ packageinfo.sh@1.121 +1 -1
+ NTP_4_2_5P118
+
+ sntp/sntp-opts.c@1.106 +2 -2
+ NTP_4_2_5P118
+
+ sntp/sntp-opts.h@1.106 +3 -3
+ NTP_4_2_5P118
+
+ sntp/sntp-opts.texi@1.105 +1 -1
+ NTP_4_2_5P118
+
+ sntp/sntp.1@1.105 +2 -2
+ NTP_4_2_5P118
+
+ util/ntp-keygen-opts.c@1.109 +2 -2
+ NTP_4_2_5P118
+
+ util/ntp-keygen-opts.h@1.109 +3 -3
+ NTP_4_2_5P118
+
+ util/ntp-keygen-opts.texi@1.108 +1 -1
+ NTP_4_2_5P118
+
+ util/ntp-keygen.1@1.108 +2 -2
+ NTP_4_2_5P118
+
+ChangeSet@1.1728.1.4, 2008-05-30 00:54:03-04:00, stenn@whimsy.udel.edu
+ Triggers are fired with an absolute (v. relative) path.
+
+ BitKeeper/triggers/triggert@1.5 +3 -2
+ Triggers are fired with an absolute (v. relative) path.
+
+ChangeSet@1.1728.1.3, 2008-05-23 03:00:07-04:00, stenn@whimsy.udel.edu
+ Poll time and local refclock documentation updates from Dave Mills
+
+ ChangeLog@1.186.1.1 +2 -0
+ Poll time and local refclock documentation updates from Dave Mills
+
+ html/drivers/driver1.html@1.16 +3 -18
+ local refclock documentation updates from Dave Mills
+
+ ntpd/ntp_proto.c@1.273 +11 -2
+ poll time updates from Dave Mills
+
+ChangeSet@1.1728.1.2, 2008-05-21 07:48:20-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P117
+ TAG: NTP_4_2_5P117
+
+ ntpd/ntpd-opts.c@1.109 +2 -2
+ NTP_4_2_5P117
+
+ ntpd/ntpd-opts.h@1.109 +3 -3
+ NTP_4_2_5P117
+
+ ntpd/ntpd-opts.texi@1.108 +1 -1
+ NTP_4_2_5P117
+
+ ntpd/ntpd.1@1.108 +2 -2
+ NTP_4_2_5P117
+
+ ntpdc/ntpdc-opts.c@1.105 +2 -2
+ NTP_4_2_5P117
+
+ ntpdc/ntpdc-opts.h@1.105 +3 -3
+ NTP_4_2_5P117
+
+ ntpdc/ntpdc-opts.texi@1.104 +1 -1
+ NTP_4_2_5P117
+
+ ntpdc/ntpdc.1@1.104 +2 -2
+ NTP_4_2_5P117
+
+ ntpq/ntpq-opts.c@1.105 +2 -2
+ NTP_4_2_5P117
+
+ ntpq/ntpq-opts.h@1.105 +3 -3
+ NTP_4_2_5P117
+
+ ntpq/ntpq-opts.texi@1.104 +1 -1
+ NTP_4_2_5P117
+
+ ntpq/ntpq.1@1.104 +2 -2
+ NTP_4_2_5P117
+
+ packageinfo.sh@1.120 +1 -1
+ NTP_4_2_5P117
+
+ sntp/sntp-opts.c@1.105 +2 -2
+ NTP_4_2_5P117
+
+ sntp/sntp-opts.h@1.105 +3 -3
+ NTP_4_2_5P117
+
+ sntp/sntp-opts.texi@1.104 +1 -1
+ NTP_4_2_5P117
+
+ sntp/sntp.1@1.104 +2 -2
+ NTP_4_2_5P117
+
+ util/ntp-keygen-opts.c@1.108 +2 -2
+ NTP_4_2_5P117
+
+ util/ntp-keygen-opts.h@1.108 +3 -3
+ NTP_4_2_5P117
+
+ util/ntp-keygen-opts.texi@1.107 +1 -1
+ NTP_4_2_5P117
+
+ util/ntp-keygen.1@1.107 +2 -2
+ NTP_4_2_5P117
+
+ChangeSet@1.1731, 2008-05-21 09:32:13+05:30, venu@door.(none)
+ ChangeLog:
+ Corrected the comments for NMEA refclock driver.
+
+ ChangeLog@1.190 +2 -1
+ Corrected the comments for NMEA refclock driver.
+
+ChangeSet@1.1730, 2008-05-20 18:34:17+05:30, venu@door.(none)
+ ChangeLog:
+ Added comments for fixing the incorrect edge parameter passed to time_pps_kcbind.
+ refclock_nmea.c:
+ Fixed the incorrect edge parameter being passed to time_pps_kcbind.
+
+ ChangeLog@1.189 +1 -0
+ Added comments for fixing the incorrect edge parameter passed to time_pps_kcbind.
+
+ ntpd/refclock_nmea.c@1.29 +1 -1
+ Fixed the incorrect edge parameter being passed to time_pps_kcbind.
+
+ChangeSet@1.1729, 2008-05-20 08:13:42+00:00, gopal@pogo.udel.edu
+ ChangeLog:
+ Added comments for bug 985.
+ refclock_nmea.c:
+ [Bug 399] NMEA refclock driver does not honor time1 offset if flag3 set.
+ [Bug 985] Modifications to NMEA reference clock driver to support Accord GPS Clock.
+ ChangeLog:
+ Added comments for bug 399.
+
+ ChangeLog@1.188 +1 -0
+ Added comments for bug 399.
+
+ ChangeLog@1.187 +1 -0
+ Added comments for bug 985.
+
+ ntpd/refclock_nmea.c@1.28 +24 -4
+ [Bug 399] NMEA refclock driver does not honor time1 offset if flag3 set.
+
+ ntpd/refclock_nmea.c@1.27 +111 -21
+ [Bug 985] Modifications to NMEA reference clock driver to support Accord GPS Clock.
+
+ChangeSet@1.1436.1.95, 2008-05-20 03:51:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P5_RC1
+ TAG: NTP_4_2_4P5_RC1
+
+ ntpd/ntpd-opts.c@1.50.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpd/ntpd-opts.h@1.50.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpd/ntpd-opts.texi@1.49.14.1 +8 -11
+ NTP_4_2_4P5_RC1
+
+ ntpd/ntpd.1@1.48.14.1 +4 -4
+ NTP_4_2_4P5_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.14.1 +3 -4
+ NTP_4_2_4P5_RC1
+
+ ntpd/ntpdsim.1@1.48.14.1 +4 -4
+ NTP_4_2_4P5_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.14.1 +5 -6
+ NTP_4_2_4P5_RC1
+
+ ntpdc/ntpdc.1@1.48.14.1 +3 -3
+ NTP_4_2_4P5_RC1
+
+ ntpq/ntpq-opts.c@1.52.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpq/ntpq-opts.h@1.52.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ ntpq/ntpq-opts.texi@1.49.14.1 +5 -6
+ NTP_4_2_4P5_RC1
+
+ ntpq/ntpq.1@1.48.14.1 +3 -3
+ NTP_4_2_4P5_RC1
+
+ packageinfo.sh@1.65.21.1 +2 -2
+ NTP_4_2_4P5_RC1
+
+ sntp/sntp-opts.c@1.49.14.1 +2 -2
+ NTP_4_2_4P5_RC1
+
+ sntp/sntp-opts.h@1.49.14.1 +3 -3
+ NTP_4_2_4P5_RC1
+
+ sntp/sntp-opts.texi@1.46.14.1 +1 -1
+ NTP_4_2_4P5_RC1
+
+ sntp/sntp.1@1.49.14.1 +2 -2
+ NTP_4_2_4P5_RC1
+
+ util/ntp-keygen-opts.c@1.49.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ util/ntp-keygen-opts.h@1.49.14.1 +6 -7
+ NTP_4_2_4P5_RC1
+
+ util/ntp-keygen-opts.texi@1.47.14.1 +7 -9
+ NTP_4_2_4P5_RC1
+
+ util/ntp-keygen.1@1.47.14.1 +3 -3
+ NTP_4_2_4P5_RC1
+
+ChangeSet@1.1728, 2008-05-18 07:57:45-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P116
+ TAG: NTP_4_2_5P116
+
+ ntpd/ntpd-opts.c@1.108 +4 -4
+ NTP_4_2_5P116
+
+ ntpd/ntpd-opts.h@1.108 +4 -4
+ NTP_4_2_5P116
+
+ ntpd/ntpd-opts.texi@1.107 +1 -1
+ NTP_4_2_5P116
+
+ ntpd/ntpd.1@1.107 +2 -2
+ NTP_4_2_5P116
+
+ ntpdc/ntpdc-opts.c@1.104 +4 -4
+ NTP_4_2_5P116
+
+ ntpdc/ntpdc-opts.h@1.104 +4 -4
+ NTP_4_2_5P116
+
+ ntpdc/ntpdc-opts.texi@1.103 +1 -1
+ NTP_4_2_5P116
+
+ ntpdc/ntpdc.1@1.103 +2 -2
+ NTP_4_2_5P116
+
+ ntpq/ntpq-opts.c@1.104 +4 -4
+ NTP_4_2_5P116
+
+ ntpq/ntpq-opts.h@1.104 +4 -4
+ NTP_4_2_5P116
+
+ ntpq/ntpq-opts.texi@1.103 +1 -1
+ NTP_4_2_5P116
+
+ ntpq/ntpq.1@1.103 +2 -2
+ NTP_4_2_5P116
+
+ packageinfo.sh@1.119 +1 -1
+ NTP_4_2_5P116
+
+ sntp/sntp-opts.c@1.104 +5 -4
+ NTP_4_2_5P116
+
+ sntp/sntp-opts.h@1.104 +6 -5
+ NTP_4_2_5P116
+
+ sntp/sntp-opts.texi@1.103 +3 -2
+ NTP_4_2_5P116
+
+ sntp/sntp.1@1.103 +3 -3
+ NTP_4_2_5P116
+
+ util/ntp-keygen-opts.c@1.107 +4 -4
+ NTP_4_2_5P116
+
+ util/ntp-keygen-opts.h@1.107 +4 -4
+ NTP_4_2_5P116
+
+ util/ntp-keygen-opts.texi@1.106 +1 -1
+ NTP_4_2_5P116
+
+ util/ntp-keygen.1@1.106 +2 -2
+ NTP_4_2_5P116
+
+ChangeSet@1.1436.1.94, 2008-05-18 05:14:37-04:00, stenn@whimsy.udel.edu
+ Start the 4.2.4p5 release candidate cycle
+
+ packageinfo.sh@1.65.20.1 +1 -1
+ Start the 4.2.4p5 release candidate cycle
+
+ChangeSet@1.1726, 2008-05-18 04:59:09-04:00, stenn@whimsy.udel.edu
+ fix a merge conflict
+
+ ntpd/ntp_io.c@1.273 +1 -1
+ fix a merge conflict
+
+ChangeSet@1.1724, 2008-05-15 07:44:36-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P115
+ TAG: NTP_4_2_5P115
+
+ ntpd/ntpd-opts.c@1.107 +2 -2
+ NTP_4_2_5P115
+
+ ntpd/ntpd-opts.h@1.107 +3 -3
+ NTP_4_2_5P115
+
+ ntpd/ntpd-opts.texi@1.106 +1 -1
+ NTP_4_2_5P115
+
+ ntpd/ntpd.1@1.106 +2 -2
+ NTP_4_2_5P115
+
+ ntpdc/ntpdc-opts.c@1.103 +2 -2
+ NTP_4_2_5P115
+
+ ntpdc/ntpdc-opts.h@1.103 +3 -3
+ NTP_4_2_5P115
+
+ ntpdc/ntpdc-opts.texi@1.102 +1 -1
+ NTP_4_2_5P115
+
+ ntpdc/ntpdc.1@1.102 +2 -2
+ NTP_4_2_5P115
+
+ ntpq/ntpq-opts.c@1.103 +2 -2
+ NTP_4_2_5P115
+
+ ntpq/ntpq-opts.h@1.103 +3 -3
+ NTP_4_2_5P115
+
+ ntpq/ntpq-opts.texi@1.102 +1 -1
+ NTP_4_2_5P115
+
+ ntpq/ntpq.1@1.102 +2 -2
+ NTP_4_2_5P115
+
+ packageinfo.sh@1.118 +1 -1
+ NTP_4_2_5P115
+
+ sntp/sntp-opts.c@1.103 +2 -2
+ NTP_4_2_5P115
+
+ sntp/sntp-opts.h@1.103 +3 -3
+ NTP_4_2_5P115
+
+ sntp/sntp-opts.texi@1.102 +1 -1
+ NTP_4_2_5P115
+
+ sntp/sntp.1@1.102 +2 -2
+ NTP_4_2_5P115
+
+ util/ntp-keygen-opts.c@1.106 +2 -2
+ NTP_4_2_5P115
+
+ util/ntp-keygen-opts.h@1.106 +3 -3
+ NTP_4_2_5P115
+
+ util/ntp-keygen-opts.texi@1.105 +1 -1
+ NTP_4_2_5P115
+
+ util/ntp-keygen.1@1.105 +2 -2
+ NTP_4_2_5P115
+
+ChangeSet@1.1723, 2008-05-15 02:03:40-04:00, stenn@whimsy.udel.edu
+ [Bug 1022] Fix compilation problems with yesterday's commit
+
+ ChangeLog@1.185 +1 -0
+ [Bug 1022] Fix compilation problems with yesterday's commit
+
+ include/ntp.h@1.145 +1 -1
+ [Bug 1022] Fix compilation problems with yesterday's commit
+
+ ntpd/ntp_intres.c@1.54 +5 -0
+ [Bug 1022] Fix compilation problems with yesterday's commit
+
+ ntpd/ntp_peer.c@1.113 +2 -0
+ [Bug 1022] Fix compilation problems with yesterday's commit
+
+ ntpd/ntp_request.c@1.73 +5 -1
+ [Bug 1022] Fix compilation problems with yesterday's commit
+
+ ntpd/refclock_acts.c@1.34 +1 -1
+ [Bug 1022] Fix compilation problems with yesterday's commit
+
+ChangeSet@1.1722, 2008-05-13 07:49:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P114
+ TAG: NTP_4_2_5P114
+
+ ntpd/ntpd-opts.c@1.106 +2 -2
+ NTP_4_2_5P114
+
+ ntpd/ntpd-opts.h@1.106 +3 -3
+ NTP_4_2_5P114
+
+ ntpd/ntpd-opts.texi@1.105 +2 -2
+ NTP_4_2_5P114
+
+ ntpd/ntpd.1@1.105 +2 -2
+ NTP_4_2_5P114
+
+ ntpdc/ntpdc-opts.c@1.102 +2 -2
+ NTP_4_2_5P114
+
+ ntpdc/ntpdc-opts.h@1.102 +3 -3
+ NTP_4_2_5P114
+
+ ntpdc/ntpdc-opts.texi@1.101 +2 -2
+ NTP_4_2_5P114
+
+ ntpdc/ntpdc.1@1.101 +2 -2
+ NTP_4_2_5P114
+
+ ntpq/ntpq-opts.c@1.102 +2 -2
+ NTP_4_2_5P114
+
+ ntpq/ntpq-opts.h@1.102 +3 -3
+ NTP_4_2_5P114
+
+ ntpq/ntpq-opts.texi@1.101 +2 -2
+ NTP_4_2_5P114
+
+ ntpq/ntpq.1@1.101 +2 -2
+ NTP_4_2_5P114
+
+ packageinfo.sh@1.117 +1 -1
+ NTP_4_2_5P114
+
+ sntp/sntp-opts.c@1.102 +2 -2
+ NTP_4_2_5P114
+
+ sntp/sntp-opts.h@1.102 +3 -3
+ NTP_4_2_5P114
+
+ sntp/sntp-opts.texi@1.101 +1 -1
+ NTP_4_2_5P114
+
+ sntp/sntp.1@1.101 +2 -2
+ NTP_4_2_5P114
+
+ util/ntp-keygen-opts.c@1.105 +2 -2
+ NTP_4_2_5P114
+
+ util/ntp-keygen-opts.h@1.105 +3 -3
+ NTP_4_2_5P114
+
+ util/ntp-keygen-opts.texi@1.104 +2 -2
+ NTP_4_2_5P114
+
+ util/ntp-keygen.1@1.104 +2 -2
+ NTP_4_2_5P114
+
+ChangeSet@1.1721, 2008-05-13 05:18:04-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills (some backward-incompatible changes)
+
+ ChangeLog@1.184 +71 -0
+ Changes from Dave Mills (some backward-incompatible changes)
+
+ html/accopt.html@1.27 +30 -21
+ Documentation updated from Dave Mills
+
+ html/accopt.html@1.26 +4 -5
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.47 +38 -24
+ Documentation updated from Dave Mills
+
+ html/bugs.html@1.4 +2 -2
+ Documentation updated from Dave Mills
+
+ html/build.html@1.23 +9 -10
+ Documentation updated from Dave Mills
+
+ html/clockopt.html@1.21 +5 -5
+ Documentation updated from Dave Mills
+
+ html/comdex.html@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/comdex.html
+
+ html/comdex.html@1.0 +0 -0
+
+ html/config.html@1.21 +5 -5
+ Documentation updated from Dave Mills
+
+ html/confopt.html@1.40 +7 -6
+ Documentation updated from Dave Mills
+
+ html/copyright.html@1.39 +1 -2
+ Documentation updated from Dave Mills
+
+ html/debug.html@1.25 +20 -121
+ Documentation updated from Dave Mills
+
+ html/decode.html@1.1 +681 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/decode.html
+
+ html/decode.html@1.0 +0 -0
+
+ html/genkeys.html@1.2 +1 -1
+ Documentation updated from Dave Mills
+
+ html/hints/winnt.html@1.19 +4 -3
+ Documentation updated from Dave Mills
+
+ html/index.html@1.37 +5 -4
+ Documentation updated from Dave Mills
+
+ html/kern.html@1.16 +2 -2
+ Documentation updated from Dave Mills
+
+ html/kernpps.html@1.2 +3 -0
+ Documentation updated from Dave Mills
+
+ html/manyopt.html@1.17 +22 -19
+ Documentation updated from Dave Mills
+
+ html/miscopt.html@1.40 +47 -69
+ Documentation updated from Dave Mills
+
+ html/monopt.html@1.27 +388 -356
+ Documentation updated from Dave Mills
+
+ html/monopt.html@1.26 +363 -330
+ Documentation updates from Dave Mills
+
+ html/msyslog.html@1.9 +3 -3
+ Documentation updated from Dave Mills
+
+ html/msyslog.html@1.8 +5 -2
+ Documentation updates from Dave Mills
+
+ html/ntp_conf.html@1.2 +3 -3
+ Documentation updated from Dave Mills
+
+ html/ntpd.html@1.43 +50 -71
+ Documentation updated from Dave Mills
+
+ html/ntpd.html@1.42 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpdsim.html@1.7 +3 -3
+ Documentation updated from Dave Mills
+
+ html/ntpdsim_new.html@1.3 +3 -3
+ Documentation updated from Dave Mills
+
+ html/ntpq.html@1.29 +453 -190
+ Documentation updated from Dave Mills
+
+ html/ntptime.html@1.16 +3 -3
+ Documentation updated from Dave Mills
+
+ html/pic/alice15.gif@1.1 +587 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/alice15.gif
+
+ html/pic/alice15.gif@1.0 +0 -0
+
+ html/pic/flatheads.gif@1.1 +292 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/flatheads.gif
+
+ html/pic/flatheads.gif@1.0 +0 -0
+
+ html/pic/pogo7.gif@1.1 +309 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/pogo7.gif
+
+ html/pic/pogo7.gif@1.0 +0 -0
+
+ html/pic/tonea.gif@1.2 +251 -347
+ Documentation updated from Dave Mills
+
+ html/pic/tribeb.gif@1.1 +675 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/tribeb.gif
+
+ html/pic/tribeb.gif@1.0 +0 -0
+
+ html/pic/wingdorothy.gif@1.2 +226 -313
+ Documentation updated from Dave Mills
+
+ html/quick.html@1.19 +4 -4
+ Documentation updated from Dave Mills
+
+ html/rate.html@1.3 +24 -20
+ Documentation updated from Dave Mills
+
+ html/release.html@1.35 +2 -2
+ Documentation updated from Dave Mills
+
+ html/scripts/accopt.txt@1.1 +5 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/accopt.txt
+
+ html/scripts/accopt.txt@1.0 +0 -0
+
+ html/scripts/authopt.txt@1.1 +11 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/authopt.txt
+
+ html/scripts/authopt.txt@1.0 +0 -0
+
+ html/scripts/clockopt.txt@1.1 +5 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/clockopt.txt
+
+ html/scripts/clockopt.txt@1.0 +0 -0
+
+ html/scripts/command.txt@1.2 +1 -0
+ Documentation updated from Dave Mills
+
+ html/scripts/config.txt@1.2 +1 -1
+ Documentation updated from Dave Mills
+
+ html/scripts/confopt.txt@1.1 +11 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/confopt.txt
+
+ html/scripts/confopt.txt@1.0 +0 -0
+
+ html/scripts/external.txt@1.2 +6 -4
+ Documentation updated from Dave Mills
+
+ html/scripts/install.txt@1.2 +3 -2
+ Documentation updated from Dave Mills
+
+ html/scripts/manual.txt@1.2 +2 -2
+ Documentation updated from Dave Mills
+
+ html/scripts/miscopt.txt@1.1 +16 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/miscopt.txt
+
+ html/scripts/miscopt.txt@1.0 +0 -0
+
+ html/scripts/monopt.txt@1.1 +5 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/monopt.txt
+
+ html/scripts/monopt.txt@1.0 +0 -0
+
+ html/sitemap.html@1.2 +4 -4
+ Documentation updated from Dave Mills
+
+ html/sntp.html@1.6 +4 -4
+ Documentation updated from Dave Mills
+
+ include/ntp.h@1.144 +61 -46
+ Changes from Dave Mills
+
+ include/ntp_control.h@1.33 +47 -47
+ Changes from Dave Mills
+
+ include/ntp_crypto.h@1.44 +11 -10
+ Changes from Dave Mills
+
+ include/ntpd.h@1.117 +22 -24
+ Changes from Dave Mills
+
+ libntp/statestr.c@1.13 +120 -105
+ Changes from Dave Mills (some backward-incompatible changes)
+
+ ntpd/ntp_config.c@1.177 +4 -3
+ Changes from Dave Mills
+
+ ntpd/ntp_control.c@1.104 +98 -123
+ Changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.122 +337 -497
+ Changes from Dave Mills
+
+ ntpd/ntp_intres.c@1.53 +3 -6
+ Changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.145 +163 -177
+ Changes from Dave Mills
+
+ ntpd/ntp_monitor.c@1.23 +45 -35
+ Changes from Dave Mills
+
+ ntpd/ntp_parser.c@1.26 +964 -938
+ Changes from Dave Mills
+
+ ntpd/ntp_parser.h@1.11 +227 -223
+ Changes from Dave Mills
+
+ ntpd/ntp_parser.y@1.21 +7 -2
+ Changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.112 +113 -81
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.272 +511 -474
+ Changes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.79 +13 -40
+ Changes from Dave Mills
+
+ ntpd/ntp_request.c@1.72 +4 -12
+ Changes from Dave Mills
+
+ ntpd/ntp_timer.c@1.47 +6 -8
+ Changes from Dave Mills
+
+ ntpd/ntp_util.c@1.64 +78 -35
+ Changes from Dave Mills
+
+ ntpd/ntpd.c@1.94 +1 -7
+ Changes from Dave Mills
+
+ ntpd/refclock_acts.c@1.33 +30 -21
+ Changes from Dave Mills
+
+ ntpd/refclock_atom.c@1.56 +4 -3
+ Changes from Dave Mills
+
+ ntpd/refclock_local.c@1.17 +11 -17
+ Changes from Dave Mills
+
+ ntpq/ntpq-subs.c@1.30 +125 -88
+ Changes from Dave Mills (some backward-incompatible changes)
+
+ ntpq/ntpq.c@1.74 +11 -12
+ Changes from Dave Mills (some backward-incompatible changes)
+
+ scripts/ntp-wait.in@1.6 +23 -11
+ handle the new ntpq format
+
+ChangeSet@1.1436.1.93, 2008-04-11 18:41:57-04:00, stenn@whimsy.udel.edu
+ Solaris _XOPEN_SOURCE updates
+
+ configure.ac@1.400.1.1 +5 -1
+ Solaris _XOPEN_SOURCE updates
+
+ChangeSet@1.1436.11.3, 2008-04-10 02:09:52-04:00, stenn@pogo.udel.edu
+ Changelog cleanup
+
+ ChangeLog@1.1.8.2 +2 -1
+
+ChangeSet@1.1436.11.2, 2008-04-08 12:20:22+02:00, burnicki@pogo.udel.edu
+ Always sleep a little before calling doconfigure() to make sure the network is completely up.
+
+ ntpd/ntp_intres.c@1.48.1.3 +5 -6
+ Always sleep a little before calling doconfigure() to make sure the network is completely up.
+
+ChangeSet@1.1436.11.1, 2008-04-03 10:19:03-04:00, burnicki@pogo.udel.edu
+ [Bug 987] Wake up the resolver thread/process when a new interface has become available.
+
+ ChangeLog@1.1.8.1 +1 -0
+ [Bug 987] Wake up the resolver thread/process when a new interface has become available.
+
+ include/ntpd.h@1.97.1.1 +5 -0
+ Added vars used to wake up the resolver process/thread.
+
+ ntpd/ntp_config.c@1.141.1.2 +34 -1
+ Initialize synchronization variables when the resolver process/thread is started.
+
+ ntpd/ntp_intres.c@1.48.1.2 +64 -65
+ Enable the resolver to be woken up when a new interface has become available.
+
+ ntpd/ntp_io.c@1.244.2.12 +25 -5
+ Wake up the resolver thread/process when a new interface has become available.
+
+ChangeSet@1.1436.1.91, 2008-03-24 22:12:42-04:00, mayer@pogo.udel.edu
+ bugs 993 a d 959
+
+ ChangeLog@1.1.1.37 +2 -0
+ bugs 993 a d 959
+
+ChangeSet@1.1436.1.90, 2008-03-24 21:41:55-04:00, mayer@pogo.udel.edu
+ [Bug 959] Refclock on Windows not properly releasing recvbuffs
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.4 +25 -13
+ [Bug 959] Refclock on Windows not properly releasing recvbuffs
+
+ChangeSet@1.1436.1.89, 2008-03-24 21:40:32-04:00, mayer@pogo.udel.edu
+ [Bug 993] Windows: Fix memory leak when fetching system messages
+
+ ports/winnt/libisc/isc_strerror.c@1.4.1.1 +78 -18
+ [Bug 993] Windows: Fix memory leak when fetching system messages
+
+ChangeSet@1.1436.9.5, 2008-03-22 02:12:10-05:00, stenn@whimsy.udel.edu
+ [Bug 977] Fix mismatching #ifdefs for builds without IPv6
+
+ ChangeLog@1.1.6.4 +1 -0
+ [Bug 977] Fix mismatching #ifdefs for builds without IPv6
+
+ libisc/net.c@1.8.1.1 +1 -1
+ [Bug 977] Fix mismatching #ifdefs for builds without IPv6
+
+ChangeSet@1.1436.9.4, 2008-03-22 02:02:36-05:00, stenn@whimsy.udel.edu
+ Update the copyright year
+
+ ChangeLog@1.1.6.3 +8 -6
+ Update the copyright year
+
+ html/copyright.html@1.36.1.1 +1 -1
+ Update the copyright year
+
+ include/copyright.def@1.5.1.1 +1 -1
+ Update the copyright year
+
+ChangeSet@1.1436.9.3, 2008-03-22 01:58:52-05:00, stenn@whimsy.udel.edu
+ Make autogen-generated files writable
+
+ ntpd/Makefile.am@1.52.2.2 +1 -1
+ Make autogen-generated files writable
+
+ ntpdc/Makefile.am@1.33.1.2 +1 -1
+ Make autogen-generated files writable
+
+ ntpq/Makefile.am@1.25.1.2 +1 -1
+ Make autogen-generated files writable
+
+ sntp/Makefile.am@1.21.1.1 +1 -1
+ Make autogen-generated files writable
+
+ util/Makefile.am@1.34.1.2 +1 -1
+ Make autogen-generated files writable
+
+ChangeSet@1.1436.10.1, 2008-03-16 09:15:13-04:00, burnicki@pogo.udel.edu
+ [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key.
+
+ ChangeLog@1.1.7.1 +3 -0
+ [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key.
+
+ ports/winnt/ntpd/ntservice.c@1.9.1.1 +11 -2
+ [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key.
+
+ChangeSet@1.1436.9.1, 2008-03-03 11:50:50+01:00, martin@pc-martin.py.meinberg.de
+ [Bug 532] nptdate timeout is too long if several servers are supplied
+ [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools
+ [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't
+ [Bug 908] ntpdate crashes sometimes
+ [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908)
+ [Bug 997] ntpdate buffer too small and unsafe
+ Under Windows check whether NTP port in use under same conditions as under other OSs.
+ Fixed some typos and indents (tabs/spaces).
+
+ ChangeLog@1.1.6.1 +10 -0
+ [Bug 532] nptdate timeout is too long if several servers are supplied
+ [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools
+ [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't
+ [Bug 908] ntpdate crashes sometimes
+ [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908)
+ [Bug 997] ntpdate buffer too small and unsafe
+ Under Windows check whether NTP port in use under same conditions as under other OSs.
+ Fixed some typos and indents (tabs/spaces).
+
+ ntpdate/ntpdate.c@1.59.1.3 +101 -82
+ [Bug 532] nptdate timeout is too long if several servers are supplied
+ [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools
+ [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't
+ [Bug 908] ntpdate crashes sometimes
+ [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908)
+ [Bug 997] ntpdate buffer too small and unsafe
+ Under Windows check whether NTP port in use under same conditions as under other OSs.
+ Fixed some typos and indents (tabs/spaces).
+
+ChangeSet@1.1436.8.7, 2008-02-20 12:13:24+01:00, martin@pc-martin4.
+ [Bug 909] Define int32_t for Windows (backport from ntp-dev)
+
+ ChangeLog@1.1.5.3 +1 -0
+ [Bug 909] Define int32_t for Windows (backport from ntp-dev)
+
+ ports/winnt/include/config.h@1.46.1.1 +2 -0
+ [Bug 909] Define int32_t for Windows (backport from ntp-dev)
+
+ChangeSet@1.1436.8.6, 2008-02-19 11:08:55-05:00, burnicki@pogo.udel.edu
+ Fixed indentation.
+
+ ntpd/ntp_io.c@1.244.2.11 +1 -1
+ Fixed indentation.
+
+ChangeSet@1.1436.8.5, 2008-02-18 09:30:34-05:00, burnicki@pogo.udel.edu
+ Use new get_free_recv_buffer_alloc().
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.3 +4 -4
+ Use new get_free_recv_buffer_alloc().
+
+ChangeSet@1.1436.8.4, 2008-02-17 17:48:29+00:00, kardel@pogo.udel.edu
+ recvbuff.c:
+ Bug 1000: add some pico optimizations
+
+ libntp/recvbuff.c@1.26.1.3 +5 -8
+ Bug 1000: add some pico optimizations
+
+ChangeSet@1.1436.8.3, 2008-02-17 08:38:07+00:00, kardel@pogo.udel.edu
+ ntpd.c:
+ Bug 1000: avoid timer() starvation during high load conditions
+ ChangeLog:
+ Bug 1000: additionally fix timer() starvation during high load
+
+ ChangeLog@1.1.5.2 +1 -0
+ Bug 1000: additionally fix timer() starvation during high load
+
+ ntpd/ntpd.c@1.82.2.3 +11 -0
+ Bug 1000: avoid timer() starvation during high load conditions
+
+ChangeSet@1.1436.8.2, 2008-02-17 08:10:59+00:00, kardel@pogo.udel.edu
+ recvbuff.c:
+ Bug 1000: replenish when having expeirenced empty free lists
+
+ libntp/recvbuff.c@1.26.1.2 +1 -1
+ Bug 1000: replenish when having expeirenced empty free lists
+
+ChangeSet@1.1436.8.1, 2008-02-17 07:31:29+00:00, kardel@pogo.udel.edu
+ recvbuff.c, recvbuff.h, ntp_io.c, ChangeLog:
+ Bug 1000: Potentially insufficient number of receive buffers at startup
+
+ ChangeLog@1.1.5.1 +3 -0
+ Bug 1000: Potentially insufficient number of receive buffers at startup
+
+ include/recvbuff.h@1.11.1.2 +2 -1
+ Bug 1000: Potentially insufficient number of receive buffers at startup
+
+ libntp/recvbuff.c@1.26.1.1 +30 -11
+ Bug 1000: Potentially insufficient number of receive buffers at startup
+
+ ntpd/ntp_io.c@1.244.2.10 +6 -2
+ Bug 1000: Potentially insufficient number of receive buffers at startup
+
+ChangeSet@1.1720, 2008-02-08 06:48:48-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P113
+ TAG: NTP_4_2_5P113
+
+ ntpd/ntpd-opts.c@1.105 +2 -2
+ NTP_4_2_5P113
+
+ ntpd/ntpd-opts.h@1.105 +3 -3
+ NTP_4_2_5P113
+
+ ntpd/ntpd-opts.texi@1.104 +1 -1
+ NTP_4_2_5P113
+
+ ntpd/ntpd.1@1.104 +2 -2
+ NTP_4_2_5P113
+
+ ntpdc/ntpdc-opts.c@1.101 +2 -2
+ NTP_4_2_5P113
+
+ ntpdc/ntpdc-opts.h@1.101 +3 -3
+ NTP_4_2_5P113
+
+ ntpdc/ntpdc-opts.texi@1.100 +1 -1
+ NTP_4_2_5P113
+
+ ntpdc/ntpdc.1@1.100 +2 -2
+ NTP_4_2_5P113
+
+ ntpq/ntpq-opts.c@1.101 +2 -2
+ NTP_4_2_5P113
+
+ ntpq/ntpq-opts.h@1.101 +3 -3
+ NTP_4_2_5P113
+
+ ntpq/ntpq-opts.texi@1.100 +1 -1
+ NTP_4_2_5P113
+
+ ntpq/ntpq.1@1.100 +2 -2
+ NTP_4_2_5P113
+
+ packageinfo.sh@1.116 +1 -1
+ NTP_4_2_5P113
+
+ sntp/sntp-opts.c@1.101 +2 -2
+ NTP_4_2_5P113
+
+ sntp/sntp-opts.h@1.101 +3 -3
+ NTP_4_2_5P113
+
+ sntp/sntp-opts.texi@1.100 +1 -1
+ NTP_4_2_5P113
+
+ sntp/sntp.1@1.100 +2 -2
+ NTP_4_2_5P113
+
+ util/ntp-keygen-opts.c@1.104 +2 -2
+ NTP_4_2_5P113
+
+ util/ntp-keygen-opts.h@1.104 +3 -3
+ NTP_4_2_5P113
+
+ util/ntp-keygen-opts.texi@1.103 +1 -1
+ NTP_4_2_5P113
+
+ util/ntp-keygen.1@1.103 +2 -2
+ NTP_4_2_5P113
+
+ChangeSet@1.1719, 2008-02-08 05:59:25-05:00, stenn@whimsy.udel.edu
+ Updates and cleanup from Dave Mills
+
+ ChangeLog@1.183 +1 -0
+ Updates and cleanup from Dave Mills
+
+ html/bugs.html@1.3 +7 -6
+ Updates and cleanup from Dave Mills
+
+ html/miscopt.html@1.39 +7 -10
+ Updates and cleanup from Dave Mills
+
+ html/monopt.html@1.25 +26 -16
+ Updates and cleanup from Dave Mills
+
+ html/rate.html@1.2 +19 -19
+ Updates and cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.144 +0 -1
+ Updates and cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.271 +50 -48
+ Updates and cleanup from Dave Mills
+
+ChangeSet@1.1718, 2008-02-07 06:45:57-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P112
+ TAG: NTP_4_2_5P112
+
+ ntpd/ntpd-opts.c@1.104 +2 -2
+ NTP_4_2_5P112
+
+ ntpd/ntpd-opts.h@1.104 +3 -3
+ NTP_4_2_5P112
+
+ ntpd/ntpd-opts.texi@1.103 +1 -1
+ NTP_4_2_5P112
+
+ ntpd/ntpd.1@1.103 +2 -2
+ NTP_4_2_5P112
+
+ ntpdc/ntpdc-opts.c@1.100 +2 -2
+ NTP_4_2_5P112
+
+ ntpdc/ntpdc-opts.h@1.100 +3 -3
+ NTP_4_2_5P112
+
+ ntpdc/ntpdc-opts.texi@1.99 +1 -1
+ NTP_4_2_5P112
+
+ ntpdc/ntpdc.1@1.99 +2 -2
+ NTP_4_2_5P112
+
+ ntpq/ntpq-opts.c@1.100 +2 -2
+ NTP_4_2_5P112
+
+ ntpq/ntpq-opts.h@1.100 +3 -3
+ NTP_4_2_5P112
+
+ ntpq/ntpq-opts.texi@1.99 +1 -1
+ NTP_4_2_5P112
+
+ ntpq/ntpq.1@1.99 +2 -2
+ NTP_4_2_5P112
+
+ packageinfo.sh@1.115 +1 -1
+ NTP_4_2_5P112
+
+ sntp/sntp-opts.c@1.100 +2 -2
+ NTP_4_2_5P112
+
+ sntp/sntp-opts.h@1.100 +3 -3
+ NTP_4_2_5P112
+
+ sntp/sntp-opts.texi@1.99 +1 -1
+ NTP_4_2_5P112
+
+ sntp/sntp.1@1.99 +2 -2
+ NTP_4_2_5P112
+
+ util/ntp-keygen-opts.c@1.103 +2 -2
+ NTP_4_2_5P112
+
+ util/ntp-keygen-opts.h@1.103 +3 -3
+ NTP_4_2_5P112
+
+ util/ntp-keygen-opts.texi@1.102 +1 -1
+ NTP_4_2_5P112
+
+ util/ntp-keygen.1@1.102 +2 -2
+ NTP_4_2_5P112
+
+ChangeSet@1.1717, 2008-02-07 01:30:59-05:00, stenn@whimsy.udel.edu
+ [Bug 995] Remove spurious ; from ntp-keygen.c
+
+ ChangeLog@1.182 +1 -0
+ [Bug 995] Remove spurious ; from ntp-keygen.c
+
+ util/ntp-keygen.c@1.50 +1 -1
+ [Bug 995] Remove spurious ; from ntp-keygen.c
+
+ChangeSet@1.1716, 2008-02-01 06:46:14-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P111
+ TAG: NTP_4_2_5P111
+
+ ntpd/ntpd-opts.c@1.103 +2 -2
+ NTP_4_2_5P111
+
+ ntpd/ntpd-opts.h@1.103 +3 -3
+ NTP_4_2_5P111
+
+ ntpd/ntpd-opts.texi@1.102 +2 -2
+ NTP_4_2_5P111
+
+ ntpd/ntpd.1@1.102 +2 -2
+ NTP_4_2_5P111
+
+ ntpdc/ntpdc-opts.c@1.99 +2 -2
+ NTP_4_2_5P111
+
+ ntpdc/ntpdc-opts.h@1.99 +3 -3
+ NTP_4_2_5P111
+
+ ntpdc/ntpdc-opts.texi@1.98 +2 -2
+ NTP_4_2_5P111
+
+ ntpdc/ntpdc.1@1.98 +2 -2
+ NTP_4_2_5P111
+
+ ntpq/ntpq-opts.c@1.99 +2 -2
+ NTP_4_2_5P111
+
+ ntpq/ntpq-opts.h@1.99 +3 -3
+ NTP_4_2_5P111
+
+ ntpq/ntpq-opts.texi@1.98 +2 -2
+ NTP_4_2_5P111
+
+ ntpq/ntpq.1@1.98 +2 -2
+ NTP_4_2_5P111
+
+ packageinfo.sh@1.114 +1 -1
+ NTP_4_2_5P111
+
+ sntp/sntp-opts.c@1.99 +2 -2
+ NTP_4_2_5P111
+
+ sntp/sntp-opts.h@1.99 +3 -3
+ NTP_4_2_5P111
+
+ sntp/sntp-opts.texi@1.98 +1 -1
+ NTP_4_2_5P111
+
+ sntp/sntp.1@1.98 +2 -2
+ NTP_4_2_5P111
+
+ util/ntp-keygen-opts.c@1.102 +2 -2
+ NTP_4_2_5P111
+
+ util/ntp-keygen-opts.h@1.102 +3 -3
+ NTP_4_2_5P111
+
+ util/ntp-keygen-opts.texi@1.101 +2 -2
+ NTP_4_2_5P111
+
+ util/ntp-keygen.1@1.101 +2 -2
+ NTP_4_2_5P111
+
+ChangeSet@1.1715, 2008-02-01 01:42:27-05:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ ChangeLog@1.181 +4 -3
+ Cleanup from Dave Mills
+
+ include/ntp.h@1.143 +3 -11
+ Cleanup from Dave Mills
+
+ include/ntpd.h@1.116 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_config.c@1.176 +3 -3
+ Cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.143 +3 -4
+ Cleanup from Dave Mills
+
+ ntpd/ntp_monitor.c@1.22 +11 -6
+ Cleanup from Dave Mills
+
+ ntpd/ntp_parser.c@1.25 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_parser.y@1.20 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.270 +79 -116
+ Cleanup from Dave Mills
+
+ ntpd/ntp_timer.c@1.46 +0 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_util.c@1.63 +5 -2
+ Cleanup from Dave Mills
+
+ ntpdc/ntpdc_ops.c@1.54 +1 -1
+ Cleanup from Dave Mills
+
+ChangeSet@1.1714, 2008-01-27 21:42:55-05:00, mayer@pogo.udel.edu
+ [Bug #980] Direct ntptrace help to stdout
+
+ ChangeLog@1.180 +1 -0
+ [Bug #980]
+
+ scripts/ntptrace.in@1.6 +1 -0
+ [Bug #980] Direct help to stdout
+
+ChangeSet@1.1713, 2008-01-27 21:39:10-05:00, mayer@pogo.udel.edu
+ [Bug 959] Refclock on Windows not properly releasing recvbuffs
+
+ ChangeLog@1.179 +1 -0
+ Bug 959
+
+ libntp/recvbuff.c@1.27 +0 -4
+ [Bug 959] Refclock on Windows not properly releasing recvbuffs
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.33 +5 -9
+ [Bug 959] Refclock on Windows not properly releasing recvbuffs
+
+ChangeSet@1.1712, 2008-01-27 21:06:48-05:00, mayer@pogo.udel.edu
+ Bug 993
+
+ ChangeLog@1.178 +1 -0
+ Bug 993
+
+ChangeSet@1.1711, 2008-01-27 21:05:20-05:00, mayer@pogo.udel.edu
+ [Bug 993] Fix memory leak when fetching system messages
+
+ ports/winnt/libisc/isc_strerror.c@1.5 +78 -18
+ [Bug 993] Fix memory leak when fetching system messages
+
+ChangeSet@1.1710, 2008-01-26 06:51:10-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P110
+ TAG: NTP_4_2_5P110
+
+ ntpd/ntpd-opts.c@1.102 +2 -2
+ NTP_4_2_5P110
+
+ ntpd/ntpd-opts.h@1.102 +3 -3
+ NTP_4_2_5P110
+
+ ntpd/ntpd-opts.texi@1.101 +2 -2
+ NTP_4_2_5P110
+
+ ntpd/ntpd.1@1.101 +2 -2
+ NTP_4_2_5P110
+
+ ntpdc/ntpdc-opts.c@1.98 +2 -2
+ NTP_4_2_5P110
+
+ ntpdc/ntpdc-opts.h@1.98 +3 -3
+ NTP_4_2_5P110
+
+ ntpdc/ntpdc-opts.texi@1.97 +2 -2
+ NTP_4_2_5P110
+
+ ntpdc/ntpdc.1@1.97 +2 -2
+ NTP_4_2_5P110
+
+ ntpq/ntpq-opts.c@1.98 +2 -2
+ NTP_4_2_5P110
+
+ ntpq/ntpq-opts.h@1.98 +3 -3
+ NTP_4_2_5P110
+
+ ntpq/ntpq-opts.texi@1.97 +2 -2
+ NTP_4_2_5P110
+
+ ntpq/ntpq.1@1.97 +2 -2
+ NTP_4_2_5P110
+
+ packageinfo.sh@1.113 +1 -1
+ NTP_4_2_5P110
+
+ sntp/sntp-opts.c@1.98 +2 -2
+ NTP_4_2_5P110
+
+ sntp/sntp-opts.h@1.98 +3 -3
+ NTP_4_2_5P110
+
+ sntp/sntp-opts.texi@1.97 +1 -1
+ NTP_4_2_5P110
+
+ sntp/sntp.1@1.97 +2 -2
+ NTP_4_2_5P110
+
+ util/ntp-keygen-opts.c@1.101 +2 -2
+ NTP_4_2_5P110
+
+ util/ntp-keygen-opts.h@1.101 +3 -3
+ NTP_4_2_5P110
+
+ util/ntp-keygen-opts.texi@1.100 +2 -2
+ NTP_4_2_5P110
+
+ util/ntp-keygen.1@1.100 +2 -2
+ NTP_4_2_5P110
+
+ChangeSet@1.1709, 2008-01-26 04:02:52-05:00, stenn@whimsy.udel.edu
+ much cleanup, fixes, and changes from Dave Mills
+
+ ChangeLog@1.177 +1 -0
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.121 +156 -177
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_intres.c@1.52 +4 -3
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.142 +176 -163
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_monitor.c@1.21 +4 -4
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.111 +1 -2
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.269 +218 -142
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_timer.c@1.45 +22 -28
+ much cleanup, fixes, and changes from Dave Mills
+
+ ntpd/ntp_util.c@1.62 +108 -91
+ much cleanup, fixes, and changes from Dave Mills
+
+ChangeSet@1.1708, 2008-01-26 03:46:39-05:00, stenn@whimsy.udel.edu
+ ntp_control.c: LEAPTAB is a filestamp, not an unsigned. From Dave Mills.
+
+ ChangeLog@1.176 +1 -0
+ ntp_control.c: LEAPTAB is a filestamp, not an unsigned. From Dave Mills.
+
+ ntpd/ntp_control.c@1.103 +1 -1
+ ntp_control.c: LEAPTAB is a filestamp, not an unsigned. From Dave Mills.
+
+ChangeSet@1.1707, 2008-01-26 03:41:54-05:00, stenn@whimsy.udel.edu
+ ntp_config.c: ntp_minpoll fixes from Dave Mills
+
+ ChangeLog@1.175 +1 -0
+ ntp_config.c: ntp_minpoll fixes from Dave Mills
+
+ ntpd/ntp_config.c@1.175 +4 -4
+ ntp_config.c: ntp_minpoll fixes from Dave Mills
+
+ChangeSet@1.1706, 2008-01-26 03:36:11-05:00, stenn@whimsy.udel.edu
+ ntp-keygen updated from Dave Mills
+
+ ChangeLog@1.174 +1 -0
+ ntp-keygen updated from Dave Mills
+
+ util/ntp-keygen.c@1.49 +614 -460
+ ntp-keygen updated from Dave Mills
+
+ChangeSet@1.1705, 2008-01-26 03:30:14-05:00, stenn@whimsy.udel.edu
+ refresh epoch, throttle, and leap cleanup from Dave Mills
+
+ ChangeLog@1.173 +1 -0
+ refresh epoch, throttle, and leap cleanup from Dave Mills
+
+ include/ntp.h@1.142 +9 -14
+ refresh epoch, throttle, and leap cleanup from Dave Mills
+
+ include/ntp_crypto.h@1.43 +1 -0
+ refresh epoch, throttle, and leap cleanup from Dave Mills
+
+ include/ntpd.h@1.115 +7 -16
+ refresh epoch, throttle, and leap cleanup from Dave Mills
+
+ChangeSet@1.1704, 2008-01-26 03:16:13-05:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ BitKeeper/deleted/.del-footer.txt@1.2 +0 -0
+ Delete: html/build/scripts/footer.txt
+
+ BitKeeper/deleted/.del-groups.html@1.2 +0 -0
+ Delete: html/groups.html
+
+ BitKeeper/deleted/.del-ldisc.html@1.13 +0 -0
+ Delete: html/ldisc.html
+
+ BitKeeper/deleted/.del-links10.txt@1.2 +0 -0
+ Delete: html/build/scripts/links10.txt
+
+ BitKeeper/deleted/.del-links10.txt~2eb1ee39ee3ae750@1.3 +0 -0
+ Delete: html/scripts/links10.txt
+
+ BitKeeper/deleted/.del-links11.txt@1.2 +0 -0
+ Delete: html/build/scripts/links11.txt
+
+ BitKeeper/deleted/.del-links11.txt~6bbb69abc176cdfa@1.3 +0 -0
+ Delete: html/scripts/links11.txt
+
+ BitKeeper/deleted/.del-links12.txt@1.2 +0 -0
+ Delete: html/build/scripts/links12.txt
+
+ BitKeeper/deleted/.del-links12.txt~44ae7fa96b25e3d8@1.2 +0 -0
+ Delete: html/scripts/links12.txt
+
+ BitKeeper/deleted/.del-links7.txt@1.2 +0 -0
+ Delete: html/build/scripts/links7.txt
+
+ BitKeeper/deleted/.del-links7.txt~82fadd0532b4ef1f@1.5 +0 -0
+ Delete: html/scripts/links7.txt
+
+ BitKeeper/deleted/.del-links8.txt@1.2 +0 -0
+ Delete: html/build/scripts/links8.txt
+
+ BitKeeper/deleted/.del-links8.txt~af6a09ad412e8a40@1.3 +0 -0
+ Delete: html/scripts/links8.txt
+
+ BitKeeper/deleted/.del-links9.txt@1.2 +0 -0
+ Delete: html/build/scripts/links9.txt
+
+ BitKeeper/deleted/.del-links9.txt~8709272ab9515ec0@1.4 +0 -0
+ Delete: html/scripts/links9.txt
+
+ BitKeeper/deleted/.del-measure.html@1.12 +0 -0
+ Delete: html/measure.html
+
+ BitKeeper/deleted/.del-mx4200data.html@1.12 +0 -0
+ Delete: html/mx4200data.html
+
+ BitKeeper/deleted/.del-netbsd@1.4 +0 -0
+ Delete: html/hints/netbsd
+
+ html/hints/netbsd@1.3 +0 -0
+ Rename: html/build/hints/netbsd -> html/hints/netbsd
+
+ BitKeeper/deleted/.del-notes.html@1.19 +0 -0
+ Delete: html/notes.html
+
+ BitKeeper/deleted/.del-patches.html@1.19 +0 -0
+ Delete: html/patches.html
+
+ html/patches.html@1.18 +0 -0
+ Rename: html/build/patches.html -> html/patches.html
+
+ BitKeeper/deleted/.del-porting.html@1.15 +0 -0
+ Delete: html/porting.html
+
+ html/porting.html@1.14 +0 -0
+ Rename: html/build/porting.html -> html/porting.html
+
+ BitKeeper/deleted/.del-style.css@1.2 +0 -0
+ Delete: html/build/scripts/style.css
+
+ ChangeLog@1.172 +1 -0
+ Documentation updates from Dave Mills
+
+ html/accopt.html@1.25 +3 -3
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.26 +9 -9
+ Documentation updates from Dave Mills
+
+ html/audio.html@1.20 +3 -2
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.46 +123 -57
+ Documentation updates from Dave Mills
+
+ html/bugs.html@1.2 +8 -10
+ Documentation updates from Dave Mills
+
+ html/build.html@1.22 +53 -76
+ Documentation updates from Dave Mills
+
+ html/build.html@1.21 +0 -0
+ Rename: html/build/build.html -> html/build.html
+
+ html/clockopt.html@1.20 +4 -3
+ Documentation updates from Dave Mills
+
+ html/config.html@1.20 +48 -47
+ Documentation updates from Dave Mills
+
+ html/config.html@1.19 +0 -0
+ Rename: html/build/config.html -> html/config.html
+
+ html/confopt.html@1.39 +2 -2
+ Documentation updates from Dave Mills
+
+ html/copyright.html@1.38 +3 -4
+ Documentation updates from Dave Mills
+
+ html/debug.html@1.24 +2 -2
+ Documentation updates from Dave Mills
+
+ html/description_files/description.jpg@1.1 +761 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/description_files/description.jpg
+
+ html/description_files/description.jpg@1.0 +0 -0
+
+ html/drivers/driver10.html@1.12 +46 -46
+ Documentation updates from Dave Mills
+
+ html/drivers/driver11.html@1.12 +55 -57
+ Documentation updates from Dave Mills
+
+ html/drivers/driver18.html@1.16 +2 -2
+ Documentation updates from Dave Mills
+
+ html/drivers/driver19.html@1.11 +48 -48
+ Documentation updates from Dave Mills
+
+ html/drivers/driver27.html@1.15 +0 -2
+ Documentation updates from Dave Mills
+
+ html/drivers/driver34.html@1.12 +67 -105
+ Documentation updates from Dave Mills
+
+ html/drivers/driver4.html@1.13 +3 -4
+ Documentation updates from Dave Mills
+
+ html/drivers/driver9.html@1.14 +50 -51
+ Documentation updates from Dave Mills
+
+ html/drivers/mx4200data.html@1.1 +1074 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/drivers/mx4200data.html
+
+ html/drivers/mx4200data.html@1.0 +0 -0
+
+ html/gadget.html@1.2 +2 -1
+ Documentation updates from Dave Mills
+
+ html/genkeys.html@1.1 +94 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/genkeys.html
+
+ html/genkeys.html@1.0 +0 -0
+
+ html/hints.html@1.17 +17 -16
+ Documentation updates from Dave Mills
+
+ html/hints.html@1.16 +0 -0
+ Rename: html/build/hints.html -> html/hints.html
+
+ html/hints/a-ux@1.4 +0 -0
+ Rename: html/build/hints/a-ux -> html/hints/a-ux
+
+ html/hints/aix@1.4 +0 -0
+ Rename: html/build/hints/aix -> html/hints/aix
+
+ html/hints/bsdi@1.4 +0 -0
+ Rename: html/build/hints/bsdi -> html/hints/bsdi
+
+ html/hints/changes@1.4 +0 -0
+ Rename: html/build/hints/changes -> html/hints/changes
+
+ html/hints/decosf1@1.4 +0 -0
+ Rename: html/build/hints/decosf1 -> html/hints/decosf1
+
+ html/hints/decosf2@1.4 +0 -0
+ Rename: html/build/hints/decosf2 -> html/hints/decosf2
+
+ html/hints/freebsd@1.4 +0 -0
+ Rename: html/build/hints/freebsd -> html/hints/freebsd
+
+ html/hints/hpux@1.4 +0 -0
+ Rename: html/build/hints/hpux -> html/hints/hpux
+
+ html/hints/linux@1.4 +0 -0
+ Rename: html/build/hints/linux -> html/hints/linux
+
+ html/hints/mpeix@1.4 +0 -0
+ Rename: html/build/hints/mpeix -> html/hints/mpeix
+
+ html/hints/notes-xntp-v3@1.4 +0 -0
+ Rename: html/build/hints/notes-xntp-v3 -> html/hints/notes-xntp-v3
+
+ html/hints/parse@1.6 +1 -1
+ Documentation updates from Dave Mills
+
+ html/hints/parse@1.5 +0 -0
+ Rename: html/build/hints/parse -> html/hints/parse
+
+ html/hints/refclocks@1.4 +0 -0
+ Rename: html/build/hints/refclocks -> html/hints/refclocks
+
+ html/hints/rs6000@1.4 +0 -0
+ Rename: html/build/hints/rs6000 -> html/hints/rs6000
+
+ html/hints/sco.html@1.10 +10 -9
+ Documentation updates from Dave Mills
+
+ html/hints/sco.html@1.9 +0 -0
+ Rename: html/build/hints/sco.html -> html/hints/sco.html
+
+ html/hints/sgi@1.4 +0 -0
+ Rename: html/build/hints/sgi -> html/hints/sgi
+
+ html/hints/solaris-dosynctodr.html@1.7 +11 -11
+ Documentation updates from Dave Mills
+
+ html/hints/solaris-dosynctodr.html@1.6 +0 -0
+ Rename: html/build/hints/solaris-dosynctodr.html -> html/hints/solaris-dosynctodr.html
+
+ html/hints/solaris.html@1.10 +1 -1
+ Documentation updates from Dave Mills
+
+ html/hints/solaris.html@1.9 +0 -0
+ Rename: html/build/hints/solaris.html -> html/hints/solaris.html
+
+ html/hints/solaris.xtra.4023118@1.4 +0 -0
+ Rename: html/build/hints/solaris.xtra.4023118 -> html/hints/solaris.xtra.4023118
+
+ html/hints/solaris.xtra.4095849@1.4 +0 -0
+ Rename: html/build/hints/solaris.xtra.4095849 -> html/hints/solaris.xtra.4095849
+
+ html/hints/solaris.xtra.S99ntpd@1.5 +0 -0
+ Rename: html/build/hints/solaris.xtra.S99ntpd -> html/hints/solaris.xtra.S99ntpd
+
+ html/hints/solaris.xtra.patchfreq@1.4 +0 -0
+ Rename: html/build/hints/solaris.xtra.patchfreq -> html/hints/solaris.xtra.patchfreq
+
+ html/hints/sun4@1.4 +0 -0
+ Rename: html/build/hints/sun4 -> html/hints/sun4
+
+ html/hints/svr4-dell@1.4 +0 -0
+ Rename: html/build/hints/svr4-dell -> html/hints/svr4-dell
+
+ html/hints/svr4_package@1.4 +0 -0
+ Rename: html/build/hints/svr4_package -> html/hints/svr4_package
+
+ html/hints/todo@1.4 +0 -0
+ Rename: html/build/hints/todo -> html/hints/todo
+
+ html/hints/vxworks.html@1.9 +64 -61
+ Documentation updates from Dave Mills
+
+ html/hints/vxworks.html@1.8 +0 -0
+ Rename: html/build/hints/vxworks.html -> html/hints/vxworks.html
+
+ html/hints/winnt.html@1.18 +142 -239
+ Documentation updates from Dave Mills
+
+ html/hints/winnt.html@1.17 +0 -0
+ Rename: html/build/hints/winnt.html -> html/hints/winnt.html
+
+ html/howto.html@1.19 +31 -52
+ Documentation updates from Dave Mills
+
+ html/index.html@1.36 +28 -66
+ Documentation updates from Dave Mills
+
+ html/kern.html@1.15 +4 -5
+ Documentation updates from Dave Mills
+
+ html/kernpps.html@1.1 +47 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/kernpps.html
+
+ html/kernpps.html@1.0 +0 -0
+
+ html/keygen.html@1.11 +17 -25
+ Documentation updates from Dave Mills
+
+ html/manyopt.html@1.16 +22 -32
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.38 +8 -3
+ Documentation updates from Dave Mills
+
+ html/monopt.html@1.24 +360 -104
+ Documentation updates from Dave Mills
+
+ html/msyslog.html@1.7 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpd.html@1.41 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpdc.html@1.29 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpdsim.html@1.6 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntpdsim_new.html@1.2 +4 -4
+ Documentation updates from Dave Mills
+
+ html/ntpq.html@1.28 +2 -2
+ Documentation updates from Dave Mills
+
+ html/ntptrace.html@1.14 +3 -2
+ Documentation updates from Dave Mills
+
+ html/pic/broad.gif@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/broad.gif
+
+ html/pic/broad.gif@1.0 +0 -0
+
+ html/pic/peer.gif@1.1 +111 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/peer.gif
+
+ html/pic/peer.gif@1.0 +0 -0
+
+ html/pps.html@1.19 +26 -20
+ Documentation updates from Dave Mills
+
+ html/prefer.html@1.16 +2 -10
+ Documentation updates from Dave Mills
+
+ html/quick.html@1.18 +26 -23
+ Documentation updates from Dave Mills
+
+ html/quick.html@1.17 +0 -0
+ Rename: html/build/quick.html -> html/quick.html
+
+ html/rate.html@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/rate.html
+
+ html/rate.html@1.0 +0 -0
+
+ html/rdebug.html@1.16 +3 -4
+ Documentation updates from Dave Mills
+
+ html/refclock.html@1.33 +17 -30
+ Documentation updates from Dave Mills
+
+ html/release.html@1.34 +23 -33
+ Documentation updates from Dave Mills
+
+ html/scripts/audio.txt@1.1 +7 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/audio.txt
+
+ html/scripts/audio.txt@1.0 +0 -0
+
+ html/scripts/command.txt@1.1 +10 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/command.txt
+
+ html/scripts/command.txt@1.0 +0 -0
+
+ html/scripts/config.txt@1.1 +7 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/config.txt
+
+ html/scripts/config.txt@1.0 +0 -0
+
+ html/scripts/external.txt@1.1 +13 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/external.txt
+
+ html/scripts/external.txt@1.0 +0 -0
+
+ html/scripts/install.txt@1.1 +11 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/install.txt
+
+ html/scripts/install.txt@1.0 +0 -0
+
+ html/scripts/manual.txt@1.1 +13 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/manual.txt
+
+ html/scripts/manual.txt@1.0 +0 -0
+
+ html/scripts/misc.txt@1.1 +9 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/misc.txt
+
+ html/scripts/misc.txt@1.0 +0 -0
+
+ html/scripts/refclock.txt@1.1 +7 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/scripts/refclock.txt
+
+ html/scripts/refclock.txt@1.0 +0 -0
+
+ html/sitemap.html@1.1 +34 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/sitemap.html
+
+ html/sitemap.html@1.0 +0 -0
+
+ html/sntp.html@1.5 +2 -3
+ Documentation updates from Dave Mills
+
+ html/tickadj.html@1.15 +8 -11
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1436.7.1, 2008-01-26 06:43:33+00:00, kardel@pogo.udel.edu
+ ntpdbase-opts.def, ChangeLog, cmd_args.c:
+ remove minimum interface update interval restriction
+
+ ChangeLog@1.1.4.1 +2 -0
+ remove minimum interface update interval restriction
+
+ ntpd/cmd_args.c@1.45.3.3 +2 -2
+ remove minimum interface update interval restriction
+
+ ntpd/ntpdbase-opts.def@1.10.1.1 +1 -1
+ remove minimum interface update interval restriction
+
+ChangeSet@1.1703, 2007-12-19 06:45:26-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P109
+ TAG: NTP_4_2_5P109
+
+ ntpd/ntpd-opts.c@1.101 +2 -2
+ NTP_4_2_5P109
+
+ ntpd/ntpd-opts.h@1.101 +3 -3
+ NTP_4_2_5P109
+
+ ntpd/ntpd-opts.texi@1.100 +1 -1
+ NTP_4_2_5P109
+
+ ntpd/ntpd.1@1.100 +2 -2
+ NTP_4_2_5P109
+
+ ntpdc/ntpdc-opts.c@1.97 +2 -2
+ NTP_4_2_5P109
+
+ ntpdc/ntpdc-opts.h@1.97 +3 -3
+ NTP_4_2_5P109
+
+ ntpdc/ntpdc-opts.texi@1.96 +1 -1
+ NTP_4_2_5P109
+
+ ntpdc/ntpdc.1@1.96 +2 -2
+ NTP_4_2_5P109
+
+ ntpq/ntpq-opts.c@1.97 +2 -2
+ NTP_4_2_5P109
+
+ ntpq/ntpq-opts.h@1.97 +3 -3
+ NTP_4_2_5P109
+
+ ntpq/ntpq-opts.texi@1.96 +1 -1
+ NTP_4_2_5P109
+
+ ntpq/ntpq.1@1.96 +2 -2
+ NTP_4_2_5P109
+
+ packageinfo.sh@1.112 +1 -1
+ NTP_4_2_5P109
+
+ sntp/sntp-opts.c@1.97 +2 -2
+ NTP_4_2_5P109
+
+ sntp/sntp-opts.h@1.97 +3 -3
+ NTP_4_2_5P109
+
+ sntp/sntp-opts.texi@1.96 +1 -1
+ NTP_4_2_5P109
+
+ sntp/sntp.1@1.96 +2 -2
+ NTP_4_2_5P109
+
+ util/ntp-keygen-opts.c@1.100 +2 -2
+ NTP_4_2_5P109
+
+ util/ntp-keygen-opts.h@1.100 +3 -3
+ NTP_4_2_5P109
+
+ util/ntp-keygen-opts.texi@1.99 +1 -1
+ NTP_4_2_5P109
+
+ util/ntp-keygen.1@1.99 +2 -2
+ NTP_4_2_5P109
+
+ChangeSet@1.1702, 2007-12-18 12:05:55-05:00, burnicki@pogo.udel.edu
+ Account for changes due to bug 918.
+
+ ports/winnt/libntp/libntp.dsp@1.32 +1 -1
+ Account for changes due to bug 918.
+
+ChangeSet@1.1701, 2007-12-18 06:49:15-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P108
+ TAG: NTP_4_2_5P108
+
+ ntpd/ntpd-opts.c@1.100 +2 -2
+ NTP_4_2_5P108
+
+ ntpd/ntpd-opts.h@1.100 +3 -3
+ NTP_4_2_5P108
+
+ ntpd/ntpd-opts.texi@1.99 +2 -2
+ NTP_4_2_5P108
+
+ ntpd/ntpd.1@1.99 +2 -2
+ NTP_4_2_5P108
+
+ ntpdc/ntpdc-opts.c@1.96 +2 -2
+ NTP_4_2_5P108
+
+ ntpdc/ntpdc-opts.h@1.96 +3 -3
+ NTP_4_2_5P108
+
+ ntpdc/ntpdc-opts.texi@1.95 +2 -2
+ NTP_4_2_5P108
+
+ ntpdc/ntpdc.1@1.95 +2 -2
+ NTP_4_2_5P108
+
+ ntpq/ntpq-opts.c@1.96 +2 -2
+ NTP_4_2_5P108
+
+ ntpq/ntpq-opts.h@1.96 +3 -3
+ NTP_4_2_5P108
+
+ ntpq/ntpq-opts.texi@1.95 +2 -2
+ NTP_4_2_5P108
+
+ ntpq/ntpq.1@1.95 +2 -2
+ NTP_4_2_5P108
+
+ packageinfo.sh@1.111 +1 -1
+ NTP_4_2_5P108
+
+ sntp/sntp-opts.c@1.96 +2 -2
+ NTP_4_2_5P108
+
+ sntp/sntp-opts.h@1.96 +3 -3
+ NTP_4_2_5P108
+
+ sntp/sntp-opts.texi@1.95 +1 -1
+ NTP_4_2_5P108
+
+ sntp/sntp.1@1.95 +2 -2
+ NTP_4_2_5P108
+
+ util/ntp-keygen-opts.c@1.99 +2 -2
+ NTP_4_2_5P108
+
+ util/ntp-keygen-opts.h@1.99 +3 -3
+ NTP_4_2_5P108
+
+ util/ntp-keygen-opts.texi@1.98 +2 -2
+ NTP_4_2_5P108
+
+ util/ntp-keygen.1@1.98 +2 -2
+ NTP_4_2_5P108
+
+ChangeSet@1.1700, 2007-12-18 04:02:42-05:00, stenn@whimsy.udel.edu
+ [Bug 918] Only use a native md5.h if MD5Init() is available
+
+ ChangeLog@1.171 +1 -0
+ [Bug 918] Only use a native md5.h if MD5Init() is available
+
+ configure.ac@1.413 +2 -7
+ [Bug 918] Only use a native md5.h if MD5Init() is available
+
+ include/ntp_md5.h@1.3 +1 -1
+ [Bug 918] Only use a native md5.h if MD5Init() is available
+
+ChangeSet@1.1689.1.1, 2007-12-16 12:16:08-05:00, mayer@pogo.udel.edu
+ Bug #830 Fix interface count
+
+ ntpd/ntp_io.c@1.271 +3 -1
+ Bug #830 Fix interface count
+
+ChangeSet@1.1698, 2007-12-16 06:49:22-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P107
+ TAG: NTP_4_2_5P107
+
+ ntpd/ntpd-opts.c@1.99 +2 -2
+ NTP_4_2_5P107
+
+ ntpd/ntpd-opts.h@1.99 +3 -3
+ NTP_4_2_5P107
+
+ ntpd/ntpd-opts.texi@1.98 +2 -2
+ NTP_4_2_5P107
+
+ ntpd/ntpd.1@1.98 +2 -2
+ NTP_4_2_5P107
+
+ ntpdc/ntpdc-opts.c@1.95 +2 -2
+ NTP_4_2_5P107
+
+ ntpdc/ntpdc-opts.h@1.95 +3 -3
+ NTP_4_2_5P107
+
+ ntpdc/ntpdc-opts.texi@1.94 +2 -2
+ NTP_4_2_5P107
+
+ ntpdc/ntpdc.1@1.94 +2 -2
+ NTP_4_2_5P107
+
+ ntpq/ntpq-opts.c@1.95 +2 -2
+ NTP_4_2_5P107
+
+ ntpq/ntpq-opts.h@1.95 +3 -3
+ NTP_4_2_5P107
+
+ ntpq/ntpq-opts.texi@1.94 +2 -2
+ NTP_4_2_5P107
+
+ ntpq/ntpq.1@1.94 +2 -2
+ NTP_4_2_5P107
+
+ packageinfo.sh@1.110 +1 -1
+ NTP_4_2_5P107
+
+ sntp/sntp-opts.c@1.95 +2 -2
+ NTP_4_2_5P107
+
+ sntp/sntp-opts.h@1.95 +3 -3
+ NTP_4_2_5P107
+
+ sntp/sntp-opts.texi@1.94 +1 -1
+ NTP_4_2_5P107
+
+ sntp/sntp.1@1.94 +2 -2
+ NTP_4_2_5P107
+
+ util/ntp-keygen-opts.c@1.98 +2 -2
+ NTP_4_2_5P107
+
+ util/ntp-keygen-opts.h@1.98 +3 -3
+ NTP_4_2_5P107
+
+ util/ntp-keygen-opts.texi@1.97 +2 -2
+ NTP_4_2_5P107
+
+ util/ntp-keygen.1@1.97 +2 -2
+ NTP_4_2_5P107
+
+ChangeSet@1.1697, 2007-12-16 04:51:58-05:00, stenn@whimsy.udel.edu
+ [Bug 979] Provide ntptimeval if it is not otherwise present
+
+ ChangeLog@1.170 +1 -0
+ [Bug 979] Provide ntptimeval if it is not otherwise present
+
+ include/ntp_syscall.h@1.8 +9 -0
+ [Bug 979] Provide ntptimeval if it is not otherwise present
+
+ChangeSet@1.1696, 2007-12-16 02:44:58-05:00, stenn@whimsy.udel.edu
+ code cleanup
+
+ ntpd/ntpd.c@1.93 +37 -35
+ code cleanup
+
+ChangeSet@1.1695, 2007-12-15 23:29:17-05:00, stenn@whimsy.udel.edu
+ [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork
+
+ ChangeLog@1.169 +1 -0
+ [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork
+
+ ntpd/ntpd.c@1.92 +4 -0
+ [Bug 634] Re-instantiate syslog() and logfiles after the daemon fork
+
+ChangeSet@1.1694, 2007-12-15 22:41:36-05:00, stenn@whimsy.udel.edu
+ We no longer need to check for MD5Init()
+
+ configure.ac@1.412 +0 -1
+ We no longer need to check for MD5Init()
+
+ChangeSet@1.1693, 2007-12-15 07:33:48-05:00, stenn@whimsy.udel.edu
+ [Bug 952] Use md5 code with a friendlier license
+
+ BitKeeper/deleted/.del-md5c.c@1.9 +0 -0
+ Delete: libntp/md5c.c
+
+ BitKeeper/deleted/.del-rsa_md5.h@1.8 +0 -0
+ Delete: include/rsa_md5.h
+
+ include/Makefile.am@1.29 +0 -1
+ [Bug 952] Use md5 code with a friendlier license
+
+ include/ntp_md5.h@1.2 +5 -1
+ [Bug 952] Use md5 code with a friendlier license
+
+ChangeSet@1.1692, 2007-12-15 06:18:07-05:00, stenn@whimsy.udel.edu
+ [Bug 952] Use md5 code with a friendlier license
+
+ ChangeLog@1.168 +1 -0
+ [Bug 952] Use md5 code with a friendlier license
+
+ include/isc/Makefile.am@1.7 +1 -0
+ [Bug 952] Use md5 code with a friendlier license
+
+ include/isc/md5.h@1.1 +73 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/include/isc/md5.h
+
+ include/isc/md5.h@1.0 +0 -0
+
+ libisc/md5.c@1.1 +251 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libisc/md5.c
+
+ libisc/md5.c@1.0 +0 -0
+
+ libntp/Makefile.am@1.40 +2 -2
+ [Bug 952] Use md5 code with a friendlier license
+
+ChangeSet@1.1691, 2007-12-13 06:46:42-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P106
+ TAG: NTP_4_2_5P106
+
+ ntpd/ntpd-opts.c@1.98 +2 -2
+ NTP_4_2_5P106
+
+ ntpd/ntpd-opts.h@1.98 +3 -3
+ NTP_4_2_5P106
+
+ ntpd/ntpd-opts.texi@1.97 +2 -2
+ NTP_4_2_5P106
+
+ ntpd/ntpd.1@1.97 +2 -2
+ NTP_4_2_5P106
+
+ ntpdc/ntpdc-opts.c@1.94 +2 -2
+ NTP_4_2_5P106
+
+ ntpdc/ntpdc-opts.h@1.94 +3 -3
+ NTP_4_2_5P106
+
+ ntpdc/ntpdc-opts.texi@1.93 +2 -2
+ NTP_4_2_5P106
+
+ ntpdc/ntpdc.1@1.93 +2 -2
+ NTP_4_2_5P106
+
+ ntpq/ntpq-opts.c@1.94 +2 -2
+ NTP_4_2_5P106
+
+ ntpq/ntpq-opts.h@1.94 +3 -3
+ NTP_4_2_5P106
+
+ ntpq/ntpq-opts.texi@1.93 +2 -2
+ NTP_4_2_5P106
+
+ ntpq/ntpq.1@1.93 +2 -2
+ NTP_4_2_5P106
+
+ packageinfo.sh@1.109 +1 -1
+ NTP_4_2_5P106
+
+ sntp/sntp-opts.c@1.94 +2 -2
+ NTP_4_2_5P106
+
+ sntp/sntp-opts.h@1.94 +3 -3
+ NTP_4_2_5P106
+
+ sntp/sntp-opts.texi@1.93 +1 -1
+ NTP_4_2_5P106
+
+ sntp/sntp.1@1.93 +2 -2
+ NTP_4_2_5P106
+
+ util/ntp-keygen-opts.c@1.97 +2 -2
+ NTP_4_2_5P106
+
+ util/ntp-keygen-opts.h@1.97 +3 -3
+ NTP_4_2_5P106
+
+ util/ntp-keygen-opts.texi@1.96 +3 -4
+ NTP_4_2_5P106
+
+ util/ntp-keygen.1@1.96 +2 -2
+ NTP_4_2_5P106
+
+ChangeSet@1.1690, 2007-12-13 04:55:28-05:00, stenn@whimsy.udel.edu
+ [Bug 977] Fix mismatching #ifdefs for builds without IPv6
+
+ ChangeLog@1.167 +2 -1
+ [Bug 977] Fix mismatching #ifdefs for builds without IPv6
+
+ libisc/net.c@1.9 +1 -1
+ [Bug 977] Fix mismatching #ifdefs for builds without IPv6
+
+ChangeSet@1.1689, 2007-12-13 04:22:19-05:00, stenn@whimsy.udel.edu
+ hack around a problem
+
+ ntpd/ntp_io.c@1.270 +1 -1
+ hack around a problem
+
+ChangeSet@1.1685.1.1, 2007-12-13 03:47:59-05:00, stenn@whimsy.udel.edu
+ Clean up the logfile/syslog setup
+
+ ChangeLog@1.164.1.1 +1 -0
+ Clean up the logfile/syslog setup
+
+ include/ntpd.h@1.114 +2 -0
+ Cleanup log setup
+
+ ntpd/ntp_config.c@1.174 +159 -165
+ Cleanup log setup
+
+ ntpd/ntpd.c@1.91 +9 -7
+ Cleanup log setup
+
+ChangeSet@1.1687, 2007-12-12 16:59:29-05:00, mayer@pogo.udel.edu
+ [Bug 830]
+
+ ChangeLog@1.165 +1 -0
+ [Bug 830]
+
+ChangeSet@1.1686, 2007-12-12 16:57:34-05:00, mayer@pogo.udel.edu
+ [Bug #830] Fix the checking order of the interface options
+
+ ntpd/ntp_io.c@1.269 +15 -39
+ [Bug #830] Fix the checking order of the interface options
+
+ChangeSet@1.1685, 2007-12-05 06:46:56-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P105
+ TAG: NTP_4_2_5P105
+
+ ntpd/ntpd-opts.c@1.97 +2 -2
+ NTP_4_2_5P105
+
+ ntpd/ntpd-opts.h@1.97 +3 -3
+ NTP_4_2_5P105
+
+ ntpd/ntpd-opts.texi@1.96 +1 -1
+ NTP_4_2_5P105
+
+ ntpd/ntpd.1@1.96 +2 -2
+ NTP_4_2_5P105
+
+ ntpdc/ntpdc-opts.c@1.93 +2 -2
+ NTP_4_2_5P105
+
+ ntpdc/ntpdc-opts.h@1.93 +3 -3
+ NTP_4_2_5P105
+
+ ntpdc/ntpdc-opts.texi@1.92 +1 -1
+ NTP_4_2_5P105
+
+ ntpdc/ntpdc.1@1.92 +2 -2
+ NTP_4_2_5P105
+
+ ntpq/ntpq-opts.c@1.93 +2 -2
+ NTP_4_2_5P105
+
+ ntpq/ntpq-opts.h@1.93 +3 -3
+ NTP_4_2_5P105
+
+ ntpq/ntpq-opts.texi@1.92 +1 -1
+ NTP_4_2_5P105
+
+ ntpq/ntpq.1@1.92 +2 -2
+ NTP_4_2_5P105
+
+ packageinfo.sh@1.108 +1 -1
+ NTP_4_2_5P105
+
+ sntp/sntp-opts.c@1.93 +2 -2
+ NTP_4_2_5P105
+
+ sntp/sntp-opts.h@1.93 +3 -3
+ NTP_4_2_5P105
+
+ sntp/sntp-opts.texi@1.92 +1 -1
+ NTP_4_2_5P105
+
+ sntp/sntp.1@1.92 +2 -2
+ NTP_4_2_5P105
+
+ util/ntp-keygen-opts.c@1.96 +2 -2
+ NTP_4_2_5P105
+
+ util/ntp-keygen-opts.h@1.96 +3 -3
+ NTP_4_2_5P105
+
+ util/ntp-keygen-opts.texi@1.95 +2 -2
+ NTP_4_2_5P105
+
+ util/ntp-keygen.1@1.95 +2 -2
+ NTP_4_2_5P105
+
+ChangeSet@1.1684, 2007-12-05 02:21:17-05:00, stenn@whimsy.udel.edu
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ ChangeLog@1.164 +1 -0
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ util/ntp-keygen-opts.c@1.95 +28 -58
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ util/ntp-keygen-opts.def@1.11 +0 -12
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ util/ntp-keygen-opts.h@1.95 +20 -29
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ util/ntp-keygen-opts.texi@1.94 +1 -18
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ util/ntp-keygen.1@1.94 +1 -8
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ util/ntp-keygen.c@1.48 +0 -4
+ [Bug 970] Lose obsolete -g flag to ntp-keygen
+
+ChangeSet@1.1683, 2007-12-05 01:57:39-05:00, stenn@whimsy.udel.edu
+ The -e flag to ntp-keygen can write GQ keys now, too.
+
+ ChangeLog@1.163 +1 -0
+ The -e flag to ntp-keygen can write GQ keys now, too.
+
+ util/ntp-keygen-opts.c@1.94 +2 -2
+ The -e flag to ntp-keygen can write GQ keys now, too.
+
+ util/ntp-keygen-opts.def@1.10 +19 -19
+ The -e flag to ntp-keygen can write GQ keys now, too.
+
+ util/ntp-keygen-opts.h@1.94 +1 -1
+ The -e flag to ntp-keygen can write GQ keys now, too.
+
+ util/ntp-keygen-opts.texi@1.93 +4 -4
+ The -e flag to ntp-keygen can write GQ keys now, too.
+
+ util/ntp-keygen.1@1.93 +4 -4
+ The -e flag to ntp-keygen can write GQ keys now, too.
+
+ChangeSet@1.1682, 2007-12-05 01:34:40-05:00, stenn@whimsy.udel.edu
+ Fixes from Dave Mills
+
+ ChangeLog@1.162 +1 -0
+ sys_survivors and hpoll cleanup from Dave Mills
+
+ ChangeLog@1.161 +1 -0
+ sys_poll cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.141 +6 -7
+ sys_poll cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.268 +9 -6
+ sys_survivors and hpoll cleanup from Dave Mills
+
+ChangeSet@1.1681, 2007-12-05 01:24:01-05:00, stenn@whimsy.udel.edu
+ maximum-likelihood digit and DSYNC fixes from Dave Mills
+
+ ChangeLog@1.160 +1 -0
+ maximum-likelihood digit and DSYNC fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.72 +11 -15
+ maximum-likelihood digit and DSYNC fixes from Dave Mills
+
+ChangeSet@1.1680, 2007-11-27 06:45:40-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P104
+ TAG: NTP_4_2_5P104
+
+ ntpd/ntpd-opts.c@1.96 +2 -2
+ NTP_4_2_5P104
+
+ ntpd/ntpd-opts.h@1.96 +3 -3
+ NTP_4_2_5P104
+
+ ntpd/ntpd-opts.texi@1.95 +1 -1
+ NTP_4_2_5P104
+
+ ntpd/ntpd.1@1.95 +2 -2
+ NTP_4_2_5P104
+
+ ntpdc/ntpdc-opts.c@1.92 +2 -2
+ NTP_4_2_5P104
+
+ ntpdc/ntpdc-opts.h@1.92 +3 -3
+ NTP_4_2_5P104
+
+ ntpdc/ntpdc-opts.texi@1.91 +1 -1
+ NTP_4_2_5P104
+
+ ntpdc/ntpdc.1@1.91 +2 -2
+ NTP_4_2_5P104
+
+ ntpq/ntpq-opts.c@1.92 +2 -2
+ NTP_4_2_5P104
+
+ ntpq/ntpq-opts.h@1.92 +3 -3
+ NTP_4_2_5P104
+
+ ntpq/ntpq-opts.texi@1.91 +1 -1
+ NTP_4_2_5P104
+
+ ntpq/ntpq.1@1.91 +2 -2
+ NTP_4_2_5P104
+
+ packageinfo.sh@1.107 +1 -1
+ NTP_4_2_5P104
+
+ sntp/sntp-opts.c@1.92 +2 -2
+ NTP_4_2_5P104
+
+ sntp/sntp-opts.h@1.92 +3 -3
+ NTP_4_2_5P104
+
+ sntp/sntp-opts.texi@1.91 +1 -1
+ NTP_4_2_5P104
+
+ sntp/sntp.1@1.91 +2 -2
+ NTP_4_2_5P104
+
+ util/ntp-keygen-opts.c@1.93 +2 -2
+ NTP_4_2_5P104
+
+ util/ntp-keygen-opts.h@1.93 +3 -3
+ NTP_4_2_5P104
+
+ util/ntp-keygen-opts.texi@1.92 +1 -1
+ NTP_4_2_5P104
+
+ util/ntp-keygen.1@1.92 +2 -2
+ NTP_4_2_5P104
+
+ChangeSet@1.1679, 2007-11-26 17:04:10-05:00, stenn@whimsy.udel.edu
+ [Bug 967] preemptable associations are lost forever on a step
+
+ ChangeLog@1.159 +1 -0
+ [Bug 967] preemptable associations are lost forever on a step
+
+ ntpd/ntp_peer.c@1.110 +0 -3
+ [Bug 967] preemptable associations are lost forever on a step
+
+ChangeSet@1.1678, 2007-11-25 06:45:57-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P103
+ TAG: NTP_4_2_5P103
+
+ ntpd/ntpd-opts.c@1.95 +2 -2
+ NTP_4_2_5P103
+
+ ntpd/ntpd-opts.h@1.95 +3 -3
+ NTP_4_2_5P103
+
+ ntpd/ntpd-opts.texi@1.94 +1 -1
+ NTP_4_2_5P103
+
+ ntpd/ntpd.1@1.94 +2 -2
+ NTP_4_2_5P103
+
+ ntpdc/ntpdc-opts.c@1.91 +2 -2
+ NTP_4_2_5P103
+
+ ntpdc/ntpdc-opts.h@1.91 +3 -3
+ NTP_4_2_5P103
+
+ ntpdc/ntpdc-opts.texi@1.90 +1 -1
+ NTP_4_2_5P103
+
+ ntpdc/ntpdc.1@1.90 +2 -2
+ NTP_4_2_5P103
+
+ ntpq/ntpq-opts.c@1.91 +2 -2
+ NTP_4_2_5P103
+
+ ntpq/ntpq-opts.h@1.91 +3 -3
+ NTP_4_2_5P103
+
+ ntpq/ntpq-opts.texi@1.90 +1 -1
+ NTP_4_2_5P103
+
+ ntpq/ntpq.1@1.90 +2 -2
+ NTP_4_2_5P103
+
+ packageinfo.sh@1.106 +1 -1
+ NTP_4_2_5P103
+
+ sntp/sntp-opts.c@1.91 +2 -2
+ NTP_4_2_5P103
+
+ sntp/sntp-opts.h@1.91 +3 -3
+ NTP_4_2_5P103
+
+ sntp/sntp-opts.texi@1.90 +1 -1
+ NTP_4_2_5P103
+
+ sntp/sntp.1@1.90 +2 -2
+ NTP_4_2_5P103
+
+ util/ntp-keygen-opts.c@1.92 +2 -2
+ NTP_4_2_5P103
+
+ util/ntp-keygen-opts.h@1.92 +3 -3
+ NTP_4_2_5P103
+
+ util/ntp-keygen-opts.texi@1.91 +1 -1
+ NTP_4_2_5P103
+
+ util/ntp-keygen.1@1.91 +2 -2
+ NTP_4_2_5P103
+
+ChangeSet@1.1673.1.2, 2007-11-24 18:52:51-05:00, stenn@whimsy.udel.edu
+ documentation update from Dave Mills
+
+ html/assoc.html@1.25 +8 -8
+ documentation update from Dave Mills
+
+ html/bugs.html@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/bugs.html
+
+ html/bugs.html@1.0 +0 -0
+
+ChangeSet@1.1676, 2007-11-24 18:50:51-05:00, stenn@pogo.udel.edu
+ [CID 48] missing "else" clause
+
+ ChangeLog@1.158 +1 -0
+ [CID 48] missing "else" clause
+
+ChangeSet@1.1673.1.1, 2007-11-24 06:45:27-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P102
+ TAG: NTP_4_2_5P102
+
+ ntpd/ntpd-opts.c@1.94 +2 -2
+ NTP_4_2_5P102
+
+ ntpd/ntpd-opts.h@1.94 +3 -3
+ NTP_4_2_5P102
+
+ ntpd/ntpd-opts.texi@1.93 +1 -1
+ NTP_4_2_5P102
+
+ ntpd/ntpd.1@1.93 +2 -2
+ NTP_4_2_5P102
+
+ ntpdc/ntpdc-opts.c@1.90 +2 -2
+ NTP_4_2_5P102
+
+ ntpdc/ntpdc-opts.h@1.90 +3 -3
+ NTP_4_2_5P102
+
+ ntpdc/ntpdc-opts.texi@1.89 +1 -1
+ NTP_4_2_5P102
+
+ ntpdc/ntpdc.1@1.89 +2 -2
+ NTP_4_2_5P102
+
+ ntpq/ntpq-opts.c@1.90 +2 -2
+ NTP_4_2_5P102
+
+ ntpq/ntpq-opts.h@1.90 +3 -3
+ NTP_4_2_5P102
+
+ ntpq/ntpq-opts.texi@1.89 +1 -1
+ NTP_4_2_5P102
+
+ ntpq/ntpq.1@1.89 +2 -2
+ NTP_4_2_5P102
+
+ packageinfo.sh@1.105 +1 -1
+ NTP_4_2_5P102
+
+ sntp/sntp-opts.c@1.90 +2 -2
+ NTP_4_2_5P102
+
+ sntp/sntp-opts.h@1.90 +3 -3
+ NTP_4_2_5P102
+
+ sntp/sntp-opts.texi@1.89 +1 -1
+ NTP_4_2_5P102
+
+ sntp/sntp.1@1.89 +2 -2
+ NTP_4_2_5P102
+
+ util/ntp-keygen-opts.c@1.91 +2 -2
+ NTP_4_2_5P102
+
+ util/ntp-keygen-opts.h@1.91 +3 -3
+ NTP_4_2_5P102
+
+ util/ntp-keygen-opts.texi@1.90 +1 -1
+ NTP_4_2_5P102
+
+ util/ntp-keygen.1@1.90 +2 -2
+ NTP_4_2_5P102
+
+ChangeSet@1.1674, 2007-11-23 20:01:46+00:00, kamboj@pogo.udel.edu
+ ntp_config.c:
+ Fixed a minor bug reported by coverity
+
+ ntpd/ntp_config.c@1.173 +6 -3
+ Fixed a minor bug reported by coverity
+
+ChangeSet@1.1673, 2007-11-23 14:59:15-05:00, stenn@whimsy.udel.edu
+ ChangeLog:
+ [Bug 833] ntpq "config" keyword is 2ble-quote-mark-unfriendly.
+ Rename the 'config' keyword to ':config'.
+
+ ChangeLog@1.157 +2 -0
+ [Bug 833] ntpq "config" keyword is 2ble-quote-mark-unfriendly.
+ Rename the 'config' keyword to ':config'.
+
+ ntpq/ntpq-subs.c@1.29 +2 -2
+
+ ntpq/ntpq.c@1.73 +27 -11
+
+ChangeSet@1.1672, 2007-11-23 06:49:02-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P101
+ TAG: NTP_4_2_5P101
+
+ ntpd/ntpd-opts.c@1.93 +2 -2
+ NTP_4_2_5P101
+
+ ntpd/ntpd-opts.h@1.93 +3 -3
+ NTP_4_2_5P101
+
+ ntpd/ntpd-opts.texi@1.92 +3 -3
+ NTP_4_2_5P101
+
+ ntpd/ntpd.1@1.92 +2 -2
+ NTP_4_2_5P101
+
+ ntpdc/ntpdc-opts.c@1.89 +2 -2
+ NTP_4_2_5P101
+
+ ntpdc/ntpdc-opts.h@1.89 +3 -3
+ NTP_4_2_5P101
+
+ ntpdc/ntpdc-opts.texi@1.88 +2 -2
+ NTP_4_2_5P101
+
+ ntpdc/ntpdc.1@1.88 +2 -2
+ NTP_4_2_5P101
+
+ ntpq/ntpq-opts.c@1.89 +2 -2
+ NTP_4_2_5P101
+
+ ntpq/ntpq-opts.h@1.89 +3 -3
+ NTP_4_2_5P101
+
+ ntpq/ntpq-opts.texi@1.88 +2 -2
+ NTP_4_2_5P101
+
+ ntpq/ntpq.1@1.88 +2 -2
+ NTP_4_2_5P101
+
+ packageinfo.sh@1.104 +1 -1
+ NTP_4_2_5P101
+
+ sntp/sntp-opts.c@1.89 +2 -2
+ NTP_4_2_5P101
+
+ sntp/sntp-opts.h@1.89 +3 -3
+ NTP_4_2_5P101
+
+ sntp/sntp-opts.texi@1.88 +1 -1
+ NTP_4_2_5P101
+
+ sntp/sntp.1@1.88 +2 -2
+ NTP_4_2_5P101
+
+ util/ntp-keygen-opts.c@1.90 +2 -2
+ NTP_4_2_5P101
+
+ util/ntp-keygen-opts.h@1.90 +3 -3
+ NTP_4_2_5P101
+
+ util/ntp-keygen-opts.texi@1.89 +2 -2
+ NTP_4_2_5P101
+
+ util/ntp-keygen.1@1.89 +2 -2
+ NTP_4_2_5P101
+
+ChangeSet@1.1671, 2007-11-23 04:34:06-05:00, stenn@whimsy.udel.edu
+ Dave Mills shifted some orphan processing
+
+ ChangeLog@1.156 +1 -0
+ Dave Mills shifted some orphan processing
+
+ include/ntpd.h@1.113 +3 -0
+ Dave Mills shifted some orphan processing
+
+ ntpd/ntp_proto.c@1.267 +2 -17
+ Dave Mills shifted some orphan processing
+
+ ntpd/ntp_timer.c@1.44 +18 -0
+ Dave Mills shifted some orphan processing
+
+ChangeSet@1.1670, 2007-11-22 21:30:50-05:00, stenn@whimsy.udel.edu
+ Fix typos in the [Bug 963] patch
+
+ ChangeLog@1.155 +1 -0
+ Fix typos in the [Bug 963] patch
+
+ libntp/systime.c@1.46 +1 -1
+ Fix typos in the [Bug 963] patch
+
+ ntpd/ntp_io.c@1.268 +1 -1
+ Fix typos in the [Bug 963] patch
+
+ChangeSet@1.1669, 2007-11-22 16:37:57-05:00, stenn@whimsy.udel.edu
+ bootstrap: squawk if genver fails. Use -f with cp in case Dave does a chown
+
+ ChangeLog@1.154 +1 -0
+ bootstrap: squawk if genver fails. Use -f with cp in case Dave does a chown
+
+ bootstrap@1.21 +2 -2
+ bootstrap: squawk if genver fails. Use -f with cp in case Dave does a chown
+
+ChangeSet@1.1668, 2007-11-22 06:46:46-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P100
+ TAG: NTP_4_2_5P100
+
+ ntpd/ntpd-opts.c@1.92 +2 -2
+ NTP_4_2_5P100
+
+ ntpd/ntpd-opts.h@1.92 +3 -3
+ NTP_4_2_5P100
+
+ ntpd/ntpd-opts.texi@1.91 +1 -1
+ NTP_4_2_5P100
+
+ ntpd/ntpd.1@1.91 +2 -2
+ NTP_4_2_5P100
+
+ ntpdc/ntpdc-opts.c@1.88 +2 -2
+ NTP_4_2_5P100
+
+ ntpdc/ntpdc-opts.h@1.88 +3 -3
+ NTP_4_2_5P100
+
+ ntpdc/ntpdc-opts.texi@1.87 +1 -1
+ NTP_4_2_5P100
+
+ ntpdc/ntpdc.1@1.87 +2 -2
+ NTP_4_2_5P100
+
+ ntpq/ntpq-opts.c@1.88 +2 -2
+ NTP_4_2_5P100
+
+ ntpq/ntpq-opts.h@1.88 +3 -3
+ NTP_4_2_5P100
+
+ ntpq/ntpq-opts.texi@1.87 +1 -1
+ NTP_4_2_5P100
+
+ ntpq/ntpq.1@1.87 +2 -2
+ NTP_4_2_5P100
+
+ packageinfo.sh@1.103 +1 -1
+ NTP_4_2_5P100
+
+ sntp/sntp-opts.c@1.88 +2 -2
+ NTP_4_2_5P100
+
+ sntp/sntp-opts.h@1.88 +3 -3
+ NTP_4_2_5P100
+
+ sntp/sntp-opts.texi@1.87 +1 -1
+ NTP_4_2_5P100
+
+ sntp/sntp.1@1.87 +2 -2
+ NTP_4_2_5P100
+
+ util/ntp-keygen-opts.c@1.89 +2 -2
+ NTP_4_2_5P100
+
+ util/ntp-keygen-opts.h@1.89 +3 -3
+ NTP_4_2_5P100
+
+ util/ntp-keygen-opts.texi@1.88 +1 -1
+ NTP_4_2_5P100
+
+ util/ntp-keygen.1@1.88 +2 -2
+ NTP_4_2_5P100
+
+ChangeSet@1.1667, 2007-11-22 04:19:55-05:00, stenn@whimsy.udel.edu
+ Remove obsolete simulator command-line options
+
+ ChangeLog@1.153 +1 -0
+ Remove obsolete simulator command-line options
+
+ ntpd/ntpd-opts.c@1.91 +50 -329
+ Remove obsolete simulator command-line options
+
+ ntpd/ntpd-opts.h@1.91 +31 -112
+ Remove obsolete simulator command-line options
+
+ ntpd/ntpd-opts.texi@1.90 +1 -136
+ Remove obsolete simulator command-line options
+
+ ntpd/ntpd.1@1.90 +2 -47
+ Remove obsolete simulator command-line options
+
+ ntpd/ntpdbase-opts.def@1.15 +0 -90
+ Remove obsolete simulator command-line options
+
+ChangeSet@1.1666, 2007-11-22 03:59:23-05:00, stenn@whimsy.udel.edu
+ [CID 36] zero sin_zero
+
+ ChangeLog@1.152 +1 -0
+ [CID 36] zero sin_zero
+
+ ntpd/ntp_request.c@1.71 +1 -0
+ [CID 36] zero sin_zero
+
+ChangeSet@1.1665, 2007-11-22 02:34:27-05:00, stenn@whimsy.udel.edu
+ [Bug 963] get_systime() is too noisy
+
+ ChangeLog@1.151 +1 -0
+ [Bug 963] get_systime() is too noisy
+
+ libntp/systime.c@1.45 +26 -12
+ [Bug 963] get_systime() is too noisy
+
+ ntpd/ntp_io.c@1.267 +2 -1
+ [Bug 963] get_systime() is too noisy
+
+ChangeSet@1.1662.1.3, 2007-11-21 06:49:11-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P99
+ TAG: NTP_4_2_5P99
+
+ ntpd/ntpd-opts.c@1.90 +2 -2
+ NTP_4_2_5P99
+
+ ntpd/ntpd-opts.h@1.90 +3 -3
+ NTP_4_2_5P99
+
+ ntpd/ntpd-opts.texi@1.89 +2 -2
+ NTP_4_2_5P99
+
+ ntpd/ntpd.1@1.89 +2 -2
+ NTP_4_2_5P99
+
+ ntpdc/ntpdc-opts.c@1.87 +2 -2
+ NTP_4_2_5P99
+
+ ntpdc/ntpdc-opts.h@1.87 +3 -3
+ NTP_4_2_5P99
+
+ ntpdc/ntpdc-opts.texi@1.86 +2 -2
+ NTP_4_2_5P99
+
+ ntpdc/ntpdc.1@1.86 +2 -2
+ NTP_4_2_5P99
+
+ ntpq/ntpq-opts.c@1.87 +2 -2
+ NTP_4_2_5P99
+
+ ntpq/ntpq-opts.h@1.87 +3 -3
+ NTP_4_2_5P99
+
+ ntpq/ntpq-opts.texi@1.86 +2 -2
+ NTP_4_2_5P99
+
+ ntpq/ntpq.1@1.86 +2 -2
+ NTP_4_2_5P99
+
+ packageinfo.sh@1.102 +1 -1
+ NTP_4_2_5P99
+
+ sntp/sntp-opts.c@1.87 +2 -2
+ NTP_4_2_5P99
+
+ sntp/sntp-opts.h@1.87 +3 -3
+ NTP_4_2_5P99
+
+ sntp/sntp-opts.texi@1.86 +1 -1
+ NTP_4_2_5P99
+
+ sntp/sntp.1@1.86 +2 -2
+ NTP_4_2_5P99
+
+ util/ntp-keygen-opts.c@1.88 +2 -2
+ NTP_4_2_5P99
+
+ util/ntp-keygen-opts.h@1.88 +3 -3
+ NTP_4_2_5P99
+
+ util/ntp-keygen-opts.texi@1.87 +2 -2
+ NTP_4_2_5P99
+
+ util/ntp-keygen.1@1.87 +2 -2
+ NTP_4_2_5P99
+
+ChangeSet@1.1662.1.2, 2007-11-21 01:26:56-05:00, stenn@deacon.udel.edu
+ [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux
+
+ ChangeLog@1.148.1.2 +1 -0
+ [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux
+
+ configure.ac@1.411 +16 -16
+ [Bug 964] Change *-*-linux* to *-*-*linux* to allow for uclinux
+
+ChangeSet@1.1662.1.1, 2007-11-21 01:12:13-05:00, stenn@deacon.udel.edu
+ ntp_timer.c:
+ ntp_timer.c: watch the non-burst packet rate
+ ntp_monitor.c:
+ ntp_monitor.c: RES_LIMITED cleanup from Dave Mills
+ ntp_config.c:
+ config: average and minimum are ^2 values
+ ntp_peer.c:
+ ntp_peer.c: disallow peer_unconfig()
+ ntpdc_ops.c:
+ Dave Mills: unknownversion is really "declined", not "bad version"
+ ntp_restrict.c:
+ ntp_restrict.c: RES_LIMITED cleanup from Dave Mills
+ ChangeLog:
+ Changes from Dave Mills
+ ntp_crypto.c:
+ ntp_crypto.c: volley -> retry. Cleanup TAI leap message.
+ ntp_request.c:
+ Cleanup from Dave Mills
+ ntp_loopfilter.c:
+ ntp_loopfilter.c: poll interval cleanup from Dave Mills
+ ntp_proto.c:
+ ntp_proto.c: RES_LIMITED, rate bucktes, counters, overall cleanup from Dave Mills
+ ntpd.h, ntp.h:
+ general and packet retry cleanup from Dave Mills
+ ntp_util.c:
+ cleanup
+
+ ChangeLog@1.148.1.1 +13 -0
+ Changes from Dave Mills
+
+ include/ntp.h@1.141 +15 -14
+ general and packet retry cleanup from Dave Mills
+
+ include/ntpd.h@1.112 +9 -9
+ general and packet retry cleanup from Dave Mills
+
+ ntpd/ntp_config.c@1.170.1.1 +2 -2
+ config: average and minimum are ^2 values
+
+ ntpd/ntp_crypto.c@1.120 +9 -6
+ ntp_crypto.c: volley -> retry. Cleanup TAI leap message.
+
+ ntpd/ntp_loopfilter.c@1.140 +18 -7
+ ntp_loopfilter.c: poll interval cleanup from Dave Mills
+
+ ntpd/ntp_monitor.c@1.20 +66 -31
+ ntp_monitor.c: RES_LIMITED cleanup from Dave Mills
+
+ ntpd/ntp_peer.c@1.109 +20 -48
+ ntp_peer.c: disallow peer_unconfig()
+
+ ntpd/ntp_proto.c@1.266 +317 -251
+ ntp_proto.c: RES_LIMITED, rate bucktes, counters, overall cleanup from Dave Mills
+
+ ntpd/ntp_request.c@1.70 +9 -7
+ Cleanup from Dave Mills
+
+ ntpd/ntp_restrict.c@1.26 +33 -60
+ ntp_restrict.c: RES_LIMITED cleanup from Dave Mills
+
+ ntpd/ntp_timer.c@1.43 +13 -2
+ ntp_timer.c: watch the non-burst packet rate
+
+ ntpd/ntp_util.c@1.61 +5 -5
+ cleanup
+
+ ntpdc/ntpdc_ops.c@1.53 +1 -1
+ Dave Mills: unknownversion is really "declined", not "bad version"
+
+ChangeSet@1.1663, 2007-11-20 21:36:27-05:00, neal@pogo.udel.edu
+ ChangeLog:
+ [Bug 960] spurious crypto command
+ ntp_config.c:
+ [Bug 960] spurious crypto command
+
+ ChangeLog@1.149 +1 -0
+ [Bug 960] spurious crypto command message
+
+ ntpd/ntp_config.c@1.171 +3 -1
+ [Bug 960] spurious crypto command
+
+ChangeSet@1.1662, 2007-11-14 06:45:25-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P98
+ TAG: NTP_4_2_5P98
+
+ ntpd/ntpd-opts.c@1.89 +2 -2
+ NTP_4_2_5P98
+
+ ntpd/ntpd-opts.h@1.89 +3 -3
+ NTP_4_2_5P98
+
+ ntpd/ntpd-opts.texi@1.88 +2 -2
+ NTP_4_2_5P98
+
+ ntpd/ntpd.1@1.88 +2 -2
+ NTP_4_2_5P98
+
+ ntpdc/ntpdc-opts.c@1.86 +2 -2
+ NTP_4_2_5P98
+
+ ntpdc/ntpdc-opts.h@1.86 +3 -3
+ NTP_4_2_5P98
+
+ ntpdc/ntpdc-opts.texi@1.85 +2 -2
+ NTP_4_2_5P98
+
+ ntpdc/ntpdc.1@1.85 +2 -2
+ NTP_4_2_5P98
+
+ ntpq/ntpq-opts.c@1.86 +2 -2
+ NTP_4_2_5P98
+
+ ntpq/ntpq-opts.h@1.86 +3 -3
+ NTP_4_2_5P98
+
+ ntpq/ntpq-opts.texi@1.85 +2 -2
+ NTP_4_2_5P98
+
+ ntpq/ntpq.1@1.85 +2 -2
+ NTP_4_2_5P98
+
+ packageinfo.sh@1.101 +1 -1
+ NTP_4_2_5P98
+
+ sntp/sntp-opts.c@1.86 +2 -2
+ NTP_4_2_5P98
+
+ sntp/sntp-opts.h@1.86 +3 -3
+ NTP_4_2_5P98
+
+ sntp/sntp-opts.texi@1.85 +1 -1
+ NTP_4_2_5P98
+
+ sntp/sntp.1@1.85 +2 -2
+ NTP_4_2_5P98
+
+ util/ntp-keygen-opts.c@1.87 +2 -2
+ NTP_4_2_5P98
+
+ util/ntp-keygen-opts.h@1.87 +3 -3
+ NTP_4_2_5P98
+
+ util/ntp-keygen-opts.texi@1.86 +2 -2
+ NTP_4_2_5P98
+
+ util/ntp-keygen.1@1.86 +2 -2
+ NTP_4_2_5P98
+
+ChangeSet@1.1661, 2007-11-13 16:57:44-05:00, stenn@whimsy.udel.edu
+ [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice
+
+ ChangeLog@1.148 +1 -0
+ [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice
+
+ ntpd/refclock_tpro.c@1.10 +0 -1
+ [Bug 961] refclock_tpro.c:tpro_poll() calls refclock_receive() twice
+
+ChangeSet@1.1660, 2007-11-12 06:46:23-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P97
+ TAG: NTP_4_2_5P97
+
+ ntpd/ntpd-opts.c@1.88 +2 -2
+ NTP_4_2_5P97
+
+ ntpd/ntpd-opts.h@1.88 +3 -3
+ NTP_4_2_5P97
+
+ ntpd/ntpd-opts.texi@1.87 +2 -2
+ NTP_4_2_5P97
+
+ ntpd/ntpd.1@1.87 +2 -2
+ NTP_4_2_5P97
+
+ ntpdc/ntpdc-opts.c@1.85 +2 -2
+ NTP_4_2_5P97
+
+ ntpdc/ntpdc-opts.h@1.85 +3 -3
+ NTP_4_2_5P97
+
+ ntpdc/ntpdc-opts.texi@1.84 +2 -2
+ NTP_4_2_5P97
+
+ ntpdc/ntpdc.1@1.84 +2 -2
+ NTP_4_2_5P97
+
+ ntpq/ntpq-opts.c@1.85 +2 -2
+ NTP_4_2_5P97
+
+ ntpq/ntpq-opts.h@1.85 +3 -3
+ NTP_4_2_5P97
+
+ ntpq/ntpq-opts.texi@1.84 +2 -2
+ NTP_4_2_5P97
+
+ ntpq/ntpq.1@1.84 +2 -2
+ NTP_4_2_5P97
+
+ packageinfo.sh@1.100 +1 -1
+ NTP_4_2_5P97
+
+ sntp/sntp-opts.c@1.85 +2 -2
+ NTP_4_2_5P97
+
+ sntp/sntp-opts.h@1.85 +3 -3
+ NTP_4_2_5P97
+
+ sntp/sntp-opts.texi@1.84 +1 -1
+ NTP_4_2_5P97
+
+ sntp/sntp.1@1.84 +2 -2
+ NTP_4_2_5P97
+
+ util/ntp-keygen-opts.c@1.86 +2 -2
+ NTP_4_2_5P97
+
+ util/ntp-keygen-opts.h@1.86 +3 -3
+ NTP_4_2_5P97
+
+ util/ntp-keygen-opts.texi@1.85 +2 -2
+ NTP_4_2_5P97
+
+ util/ntp-keygen.1@1.85 +2 -2
+ NTP_4_2_5P97
+
+ChangeSet@1.1657.1.2, 2007-11-09 06:48:04-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P96
+ TAG: NTP_4_2_5P96
+
+ ntpd/ntpd-opts.c@1.87 +2 -2
+ NTP_4_2_5P96
+
+ ntpd/ntpd-opts.h@1.87 +3 -3
+ NTP_4_2_5P96
+
+ ntpd/ntpd-opts.texi@1.86 +5 -5
+ NTP_4_2_5P96
+
+ ntpd/ntpd.1@1.86 +2 -2
+ NTP_4_2_5P96
+
+ ntpdc/ntpdc-opts.c@1.84 +2 -2
+ NTP_4_2_5P96
+
+ ntpdc/ntpdc-opts.h@1.84 +3 -3
+ NTP_4_2_5P96
+
+ ntpdc/ntpdc-opts.texi@1.83 +3 -3
+ NTP_4_2_5P96
+
+ ntpdc/ntpdc.1@1.83 +2 -2
+ NTP_4_2_5P96
+
+ ntpq/ntpq-opts.c@1.84 +2 -2
+ NTP_4_2_5P96
+
+ ntpq/ntpq-opts.h@1.84 +3 -3
+ NTP_4_2_5P96
+
+ ntpq/ntpq-opts.texi@1.83 +3 -3
+ NTP_4_2_5P96
+
+ ntpq/ntpq.1@1.83 +2 -2
+ NTP_4_2_5P96
+
+ packageinfo.sh@1.99 +1 -1
+ NTP_4_2_5P96
+
+ sntp/sntp-opts.c@1.84 +2 -2
+ NTP_4_2_5P96
+
+ sntp/sntp-opts.h@1.84 +3 -3
+ NTP_4_2_5P96
+
+ sntp/sntp-opts.texi@1.83 +1 -1
+ NTP_4_2_5P96
+
+ sntp/sntp.1@1.83 +2 -2
+ NTP_4_2_5P96
+
+ util/ntp-keygen-opts.c@1.85 +2 -2
+ NTP_4_2_5P96
+
+ util/ntp-keygen-opts.h@1.85 +3 -3
+ NTP_4_2_5P96
+
+ util/ntp-keygen-opts.texi@1.84 +3 -3
+ NTP_4_2_5P96
+
+ util/ntp-keygen.1@1.84 +2 -2
+ NTP_4_2_5P96
+
+ChangeSet@1.1657.1.1, 2007-11-09 02:10:13-05:00, stenn@whimsy.udel.edu
+ Work around a VPATH difference in FreeBSD's 'make' command
+
+ ChangeLog@1.145.1.1 +1 -0
+ Work around a VPATH difference in FreeBSD's 'make' command
+
+ configure.ac@1.410 +1 -0
+ Work around a VPATH difference in FreeBSD's 'make' command
+
+ m4/ntp_vpathhack.m4@1.1 +23 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/m4/ntp_vpathhack.m4
+
+ m4/ntp_vpathhack.m4@1.0 +0 -0
+
+ ntpd/Makefile.am@1.64 +11 -1
+ Work around a VPATH difference in FreeBSD's 'make' command
+
+ChangeSet@1.1658, 2007-11-08 12:08:38-05:00, burnicki@pogo.udel.edu
+ [Bug 713] Windows only: Let command line parameters from the Windows SCM GUI
+ override the standard parameters from the ImagePath registry key.
+ * Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions.
+
+ ChangeLog@1.146 +3 -0
+ Updated for bug #957.
+
+ ports/winnt/include/config.h@1.53 +1 -0
+ Added HAVE_INT32_T to the Windows config.h to avoid duplicate definitions.
+
+ ports/winnt/ntpd/ntservice.c@1.11 +11 -2
+ [Bug 957] Let command line parameters from the Windows SCM GUI
+ override the standard parameters from the ImagePath registry key.
+
+ChangeSet@1.1657, 2007-11-06 06:46:44-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P95
+ TAG: NTP_4_2_5P95
+
+ ntpd/ntpd-opts.c@1.86 +2 -2
+ NTP_4_2_5P95
+
+ ntpd/ntpd-opts.h@1.86 +3 -3
+ NTP_4_2_5P95
+
+ ntpd/ntpd-opts.texi@1.85 +1 -1
+ NTP_4_2_5P95
+
+ ntpd/ntpd.1@1.85 +2 -2
+ NTP_4_2_5P95
+
+ ntpdc/ntpdc-opts.c@1.83 +2 -2
+ NTP_4_2_5P95
+
+ ntpdc/ntpdc-opts.h@1.83 +3 -3
+ NTP_4_2_5P95
+
+ ntpdc/ntpdc-opts.texi@1.82 +2 -2
+ NTP_4_2_5P95
+
+ ntpdc/ntpdc.1@1.82 +2 -2
+ NTP_4_2_5P95
+
+ ntpq/ntpq-opts.c@1.83 +2 -2
+ NTP_4_2_5P95
+
+ ntpq/ntpq-opts.h@1.83 +3 -3
+ NTP_4_2_5P95
+
+ ntpq/ntpq-opts.texi@1.82 +2 -2
+ NTP_4_2_5P95
+
+ ntpq/ntpq.1@1.82 +2 -2
+ NTP_4_2_5P95
+
+ packageinfo.sh@1.98 +1 -1
+ NTP_4_2_5P95
+
+ sntp/sntp-opts.c@1.83 +2 -2
+ NTP_4_2_5P95
+
+ sntp/sntp-opts.h@1.83 +3 -3
+ NTP_4_2_5P95
+
+ sntp/sntp-opts.texi@1.82 +1 -1
+ NTP_4_2_5P95
+
+ sntp/sntp.1@1.82 +2 -2
+ NTP_4_2_5P95
+
+ util/ntp-keygen-opts.c@1.84 +2 -2
+ NTP_4_2_5P95
+
+ util/ntp-keygen-opts.h@1.84 +3 -3
+ NTP_4_2_5P95
+
+ util/ntp-keygen-opts.texi@1.83 +2 -2
+ NTP_4_2_5P95
+
+ util/ntp-keygen.1@1.83 +2 -2
+ NTP_4_2_5P95
+
+ChangeSet@1.1656, 2007-11-06 01:50:44-05:00, stenn@whimsy.udel.edu
+ Update bugreport URL
+
+ ChangeLog@1.145 +1 -0
+ Update bugreport URL
+
+ README@1.23 +1 -1
+ Update bugreport URL
+
+ README.bk@1.19 +1 -1
+ Update bugreport URL
+
+ README.patches@1.4 +1 -1
+ Update bugreport URL
+
+ WHERE-TO-START@1.7 +1 -1
+ Update bugreport URL
+
+ include/copyright.def@1.7 +1 -1
+ Update bugreport URL
+
+ ntpd/ntpd-opts.c@1.85 +2 -2
+ Update bugreport URL
+
+ ntpd/ntpd-opts.h@1.85 +1 -1
+ Update bugreport URL
+
+ ntpd/ntpd-opts.texi@1.84 +1 -1
+ Update bugreport URL
+
+ ntpd/ntpd.1@1.84 +2 -2
+ Update bugreport URL
+
+ ntpdc/ntpdc-opts.c@1.82 +2 -2
+ Update bugreport URL
+
+ ntpdc/ntpdc-opts.h@1.82 +1 -1
+ Update bugreport URL
+
+ ntpdc/ntpdc-opts.texi@1.81 +2 -2
+ Update bugreport URL
+
+ ntpdc/ntpdc.1@1.81 +3 -3
+ Update bugreport URL
+
+ ntpq/ntpq-opts.c@1.82 +2 -2
+ Update bugreport URL
+
+ ntpq/ntpq-opts.h@1.82 +1 -1
+ Update bugreport URL
+
+ ntpq/ntpq-opts.texi@1.81 +2 -2
+ Update bugreport URL
+
+ ntpq/ntpq.1@1.81 +3 -3
+ Update bugreport URL
+
+ sntp/sntp-opts.c@1.82 +2 -2
+ Update bugreport URL
+
+ sntp/sntp-opts.def@1.11 +1 -1
+ Update bugreport URL
+
+ sntp/sntp-opts.h@1.82 +1 -1
+ Update bugreport URL
+
+ sntp/sntp-opts.texi@1.81 +1 -1
+ Update bugreport URL
+
+ sntp/sntp.1@1.81 +3 -3
+ Update bugreport URL
+
+ util/ntp-keygen-opts.c@1.83 +2 -2
+ Update bugreport URL
+
+ util/ntp-keygen-opts.h@1.83 +1 -1
+ Update bugreport URL
+
+ util/ntp-keygen-opts.texi@1.82 +2 -2
+ Update bugreport URL
+
+ util/ntp-keygen.1@1.82 +3 -3
+ Update bugreport URL
+
+ChangeSet@1.1655, 2007-11-06 00:45:47-05:00, stenn@whimsy.udel.edu
+ Update -I documentation
+
+ ChangeLog@1.144 +1 -0
+ Update -I documentation
+
+ ntpd/ntpd-opts.c@1.84 +330 -51
+ Update -I documentation
+
+ ntpd/ntpd-opts.h@1.84 +112 -31
+ Update -I documentation
+
+ ntpd/ntpd-opts.texi@1.83 +137 -2
+ Update -I documentation
+
+ ntpd/ntpd.1@1.83 +48 -3
+ Update -I documentation
+
+ ntpd/ntpdbase-opts.def@1.14 +10 -19
+ Update -I documentation
+
+ChangeSet@1.1654, 2007-11-05 21:27:36-05:00, stenn@whimsy.udel.edu
+ [Bug 713] Fix bug reporting information
+
+ ChangeLog@1.143 +1 -0
+ [Bug 713] Fix bug reporting information
+
+ html/index.html@1.35 +2 -2
+ [Bug 713] Fix bug reporting information
+
+ html/msyslog.html@1.6 +3 -3
+ [Bug 713] Fix bug reporting information
+
+ html/release.html@1.33 +3 -3
+ [Bug 713] Fix bug reporting information
+
+ChangeSet@1.1649.1.2, 2007-11-05 06:45:45-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P94
+ TAG: NTP_4_2_5P94
+
+ ntpd/ntpd-opts.c@1.83 +2 -2
+ NTP_4_2_5P94
+
+ ntpd/ntpd-opts.h@1.83 +3 -3
+ NTP_4_2_5P94
+
+ ntpd/ntpd-opts.texi@1.82 +2 -2
+ NTP_4_2_5P94
+
+ ntpd/ntpd.1@1.82 +2 -2
+ NTP_4_2_5P94
+
+ ntpdc/ntpdc-opts.c@1.81 +2 -2
+ NTP_4_2_5P94
+
+ ntpdc/ntpdc-opts.h@1.81 +3 -3
+ NTP_4_2_5P94
+
+ ntpdc/ntpdc-opts.texi@1.80 +2 -2
+ NTP_4_2_5P94
+
+ ntpdc/ntpdc.1@1.80 +2 -2
+ NTP_4_2_5P94
+
+ ntpq/ntpq-opts.c@1.81 +2 -2
+ NTP_4_2_5P94
+
+ ntpq/ntpq-opts.h@1.81 +3 -3
+ NTP_4_2_5P94
+
+ ntpq/ntpq-opts.texi@1.80 +2 -2
+ NTP_4_2_5P94
+
+ ntpq/ntpq.1@1.80 +2 -2
+ NTP_4_2_5P94
+
+ packageinfo.sh@1.97 +1 -1
+ NTP_4_2_5P94
+
+ sntp/sntp-opts.c@1.81 +2 -2
+ NTP_4_2_5P94
+
+ sntp/sntp-opts.h@1.81 +3 -3
+ NTP_4_2_5P94
+
+ sntp/sntp-opts.texi@1.80 +1 -1
+ NTP_4_2_5P94
+
+ sntp/sntp.1@1.80 +2 -2
+ NTP_4_2_5P94
+
+ util/ntp-keygen-opts.c@1.82 +2 -2
+ NTP_4_2_5P94
+
+ util/ntp-keygen-opts.h@1.82 +3 -3
+ NTP_4_2_5P94
+
+ util/ntp-keygen-opts.texi@1.81 +2 -2
+ NTP_4_2_5P94
+
+ util/ntp-keygen.1@1.81 +2 -2
+ NTP_4_2_5P94
+
+ChangeSet@1.1649.1.1, 2007-11-05 03:12:05-05:00, stenn@whimsy.udel.edu
+ ntp_config.c:
+ reindent
+ ntp-keygen.c:
+ Coverity fixes [CID 33,47]
+ ntp_util.c, ntp_crypto.c, ntp_timer.c:
+ [Bug 861] Leap second cleanups from Dave Mills
+ systime.c:
+ Fuzz cleanup from Dave Mills.
+ ntp.h:
+ Volley cleanup from Dave Mills.
+ ntp_io.c:
+ Fuzz cleanup from Dave Mills
+ ntp_proto.c:
+ [Bug 861] Leap second cleanups from Dave Mills.
+ Volley cleanup from Dave Mills.
+ ntpd.h:
+ Leap second file cleanups from Dave Mills
+
+ ChangeLog@1.140.1.1 +4 -0
+
+ include/ntp.h@1.140 +0 -1
+ Volley cleanup from Dave Mills.
+
+ include/ntpd.h@1.111 +0 -1
+ Leap second file cleanups from Dave Mills
+
+ libntp/systime.c@1.44 +2 -4
+ Fuzz cleanup from Dave Mills.
+
+ ntpd/ntp_config.c@1.170 +6 -6
+ reindent
+
+ ntpd/ntp_crypto.c@1.119 +7 -4
+ [Bug 861] Leap second cleanups from Dave Mills
+
+ ntpd/ntp_io.c@1.266 +2 -8
+ Fuzz cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.265 +64 -115
+ [Bug 861] Leap second cleanups from Dave Mills.
+ Volley cleanup from Dave Mills.
+
+ ntpd/ntp_timer.c@1.42 +17 -7
+ [Bug 861] Leap second cleanups from Dave Mills
+
+ ntpd/ntp_util.c@1.60 +3 -3
+ [Bug 861] Leap second cleanups from Dave Mills
+
+ util/ntp-keygen.c@1.47 +9 -10
+ Coverity fixes [CID 33,47]
+
+ChangeSet@1.1436.1.87, 2007-11-01 03:52:00-04:00, clemens@pogo.udel.edu
+ * Negative-sawtooth not applied correctly for oncore 12 channel
+ receiver. Fixed.
+ * Startup code for original LinuxPPS removed. LinuxPPS now
+ conforms to the PPSAPI.
+
+ ChangeLog@1.1.1.35 +4 -0
+ * Negative-sawtooth not applied correctly for oncore 12 channel
+ receiver. Fixed.
+ * Startup code for original LinuxPPS removed. LinuxPPS now
+ conforms to the PPSAPI.
+
+ChangeSet@1.1652, 2007-11-01 03:49:06-04:00, clemens@pogo.udel.edu
+ * A bug in the application of the negative-sawtoot for 12 channel receivers.
+ * The removal of unneeded startup code used for the original LinuxPPS, it now
+ conforms to the PPSAPI and does not need special code.
+
+ ChangeLog@1.141 +3 -0
+ * A bug in the application of the negative-sawtoot for 12 channel receivers.
+ * The removal of unneeded startup code used for the original LinuxPPS, it now
+ conforms to the PPSAPI and does not need special code.
+
+ChangeSet@1.1436.1.86, 2007-11-01 03:29:24-04:00, clemens@pogo.udel.edu
+ The original version of LinuxPPS did not comply with the PPSAPI and required
+ some changes to the startup code in refclock_oncore.c . The current version
+ complies, and these changes can be removed.
+
+ ntpd/refclock_oncore.c@1.60.1.2 +1 -56
+ The original version of LinuxPPS did not comply with the PPSAPI and required
+ some changes to the startup code in refclock_oncore.c . The current version
+ complies, and these changes can be removed.
+
+ChangeSet@1.1651, 2007-11-01 03:24:16-04:00, clemens@pogo.udel.edu
+ The original version of LinuxPPS did not comply with the PPSAPI and required
+ some changes to the startup code in refclock_oncore.c . The current version
+ complies, and these changes can be removed.
+
+ ntpd/refclock_oncore.c@1.63 +1 -56
+ The original version of LinuxPPS did not comply with the PPSAPI and required
+ some changes to the startup code in refclock_oncore.c . The current version
+ complies, and these changes can be removed.
+
+ChangeSet@1.1436.1.85, 2007-11-01 02:16:36-04:00, clemens@pogo.udel.edu
+ The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal
+ which is on the zero crossing of its internal clock, from its true value. the
+ refclock_oncore.c driver applies this difference to correct the time of the
+ provided timestamp. This value was being applied correctly for the 6 and 8 channel
+ receivers, but not for the 12 channel. This has been corrected.
+
+ ntpd/refclock_oncore.c@1.60.1.1 +2 -2
+ The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal
+ which is on the zero crossing of its internal clock, from its true value. the
+ refclock_oncore.c driver applies this difference to correct the time of the
+ provided timestamp. This value was being applied correctly for the 6 and 8 channel
+ receivers, but not for the 12 channel. This has been corrected.
+
+ChangeSet@1.1650, 2007-11-01 02:13:19-04:00, clemens@pogo.udel.edu
+ ntpd/refclock_oncore.c
+ The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal
+ which is on the zero crossing of its internal clock, from its true value. the
+ refclock_oncore.c driver applies this difference to correct the time of the
+ provided timestamp. This value was being applied correctly for the 6 and 8 channel
+ receivers, but not for the 12 channel. This has been corrected.
+
+ ntpd/refclock_oncore.c@1.62 +2 -2
+ The oncore hardware provides a 'negative saw-tooth' the offset of the PPS signal
+ which is on the zero crossing of its internal clock, from its true value. the
+ refclock_oncore.c driver applies this difference to correct the time of the
+ provided timestamp. This value was being applied correctly for the 6 and 8 channel
+ receivers, but not for the 12 channel. This has been corrected.
+
+ChangeSet@1.1649, 2007-10-31 06:46:05-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P93
+ TAG: NTP_4_2_5P93
+
+ ntpd/ntpd-opts.c@1.82 +2 -2
+ NTP_4_2_5P93
+
+ ntpd/ntpd-opts.h@1.82 +3 -3
+ NTP_4_2_5P93
+
+ ntpd/ntpd-opts.texi@1.81 +1 -1
+ NTP_4_2_5P93
+
+ ntpd/ntpd.1@1.81 +2 -2
+ NTP_4_2_5P93
+
+ ntpdc/ntpdc-opts.c@1.80 +2 -2
+ NTP_4_2_5P93
+
+ ntpdc/ntpdc-opts.h@1.80 +3 -3
+ NTP_4_2_5P93
+
+ ntpdc/ntpdc-opts.texi@1.79 +1 -1
+ NTP_4_2_5P93
+
+ ntpdc/ntpdc.1@1.79 +2 -2
+ NTP_4_2_5P93
+
+ ntpq/ntpq-opts.c@1.80 +2 -2
+ NTP_4_2_5P93
+
+ ntpq/ntpq-opts.h@1.80 +3 -3
+ NTP_4_2_5P93
+
+ ntpq/ntpq-opts.texi@1.79 +1 -1
+ NTP_4_2_5P93
+
+ ntpq/ntpq.1@1.79 +2 -2
+ NTP_4_2_5P93
+
+ packageinfo.sh@1.96 +1 -1
+ NTP_4_2_5P93
+
+ sntp/sntp-opts.c@1.80 +2 -2
+ NTP_4_2_5P93
+
+ sntp/sntp-opts.h@1.80 +3 -3
+ NTP_4_2_5P93
+
+ sntp/sntp-opts.texi@1.79 +1 -1
+ NTP_4_2_5P93
+
+ sntp/sntp.1@1.79 +2 -2
+ NTP_4_2_5P93
+
+ util/ntp-keygen-opts.c@1.81 +2 -2
+ NTP_4_2_5P93
+
+ util/ntp-keygen-opts.h@1.81 +3 -3
+ NTP_4_2_5P93
+
+ util/ntp-keygen-opts.texi@1.80 +1 -1
+ NTP_4_2_5P93
+
+ util/ntp-keygen.1@1.80 +2 -2
+ NTP_4_2_5P93
+
+ChangeSet@1.1648, 2007-10-31 01:26:20-05:00, stenn@whimsy.udel.edu
+ Document the reasoning behind the c_d directory variable
+
+ flock-build@1.41 +2 -0
+ Document the reasoning behind the c_d directory variable
+
+ChangeSet@1.1647, 2007-10-30 06:46:30-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P92
+ TAG: NTP_4_2_5P92
+
+ ntpd/ntpd-opts.c@1.81 +2 -2
+ NTP_4_2_5P92
+
+ ntpd/ntpd-opts.h@1.81 +3 -3
+ NTP_4_2_5P92
+
+ ntpd/ntpd-opts.texi@1.80 +3 -3
+ NTP_4_2_5P92
+
+ ntpd/ntpd.1@1.80 +2 -2
+ NTP_4_2_5P92
+
+ ntpdc/ntpdc-opts.c@1.79 +2 -2
+ NTP_4_2_5P92
+
+ ntpdc/ntpdc-opts.h@1.79 +3 -3
+ NTP_4_2_5P92
+
+ ntpdc/ntpdc-opts.texi@1.78 +3 -3
+ NTP_4_2_5P92
+
+ ntpdc/ntpdc.1@1.78 +2 -2
+ NTP_4_2_5P92
+
+ ntpq/ntpq-opts.c@1.79 +2 -2
+ NTP_4_2_5P92
+
+ ntpq/ntpq-opts.h@1.79 +3 -3
+ NTP_4_2_5P92
+
+ ntpq/ntpq-opts.texi@1.78 +3 -3
+ NTP_4_2_5P92
+
+ ntpq/ntpq.1@1.78 +2 -2
+ NTP_4_2_5P92
+
+ packageinfo.sh@1.95 +1 -1
+ NTP_4_2_5P92
+
+ sntp/sntp-opts.c@1.79 +2 -2
+ NTP_4_2_5P92
+
+ sntp/sntp-opts.h@1.79 +3 -3
+ NTP_4_2_5P92
+
+ sntp/sntp-opts.texi@1.78 +1 -1
+ NTP_4_2_5P92
+
+ sntp/sntp.1@1.78 +2 -2
+ NTP_4_2_5P92
+
+ util/ntp-keygen-opts.c@1.80 +2 -2
+ NTP_4_2_5P92
+
+ util/ntp-keygen-opts.h@1.80 +3 -3
+ NTP_4_2_5P92
+
+ util/ntp-keygen-opts.texi@1.79 +3 -3
+ NTP_4_2_5P92
+
+ util/ntp-keygen.1@1.79 +2 -2
+ NTP_4_2_5P92
+
+ChangeSet@1.1646, 2007-10-30 02:27:06-05:00, stenn@whimsy.udel.edu
+ ntpsim.c: add missing protypes and fix [CID 34], a nit
+
+ ChangeLog@1.140 +1 -0
+ ntpsim.c: add missing protypes and fix [CID 34], a nit
+
+ ntpd/ntpsim.c@1.19 +7 -0
+ ntpsim.c: add missing protypes and fix [CID 34], a nit
+
+ChangeSet@1.1645, 2007-10-30 01:31:05-05:00, stenn@whimsy.udel.edu
+ ntp_scanner.c:
+ reindent
+
+ ntpd/ntp_scanner.c@1.12 +377 -360
+ reindent
+
+ChangeSet@1.1644, 2007-10-30 01:09:30-05:00, stenn@whimsy.udel.edu
+ ntp_parser.h, ntp_parser.c, ChangeLog:
+ Upgraded bison at UDel
+ br-flock, ChangeLog, flock-build:
+ Update br-flock and flock-build machine lists
+
+ ChangeLog@1.139 +1 -0
+ Upgraded bison at UDel
+
+ ChangeLog@1.138 +1 -0
+ Update br-flock and flock-build machine lists
+
+ br-flock@1.12 +1 -1
+ Update br-flock and flock-build machine lists
+
+ flock-build@1.40 +6 -5
+ Update br-flock and flock-build machine lists
+
+ ntpd/ntp_parser.c@1.24 +1072 -684
+ Upgraded bison at UDel
+
+ ntpd/ntp_parser.h@1.10 +29 -20
+ Upgraded bison at UDel
+
+ChangeSet@1.1643, 2007-10-29 17:17:35-04:00, neal@pogo.udel.edu
+ ntp_scanner.c:
+ [Bug 828] use is_ip_address from ntp_io.c in scanner
+
+ ntpd/ntp_scanner.c@1.11 +5 -43
+ [Bug 828] use is_ip_address from ntp_io.c in scanner
+
+ChangeSet@1.1642, 2007-10-29 10:28:31-04:00, neal@pogo.udel.edu
+ ntp_scanner.c:
+ [Bug 828] correct IPv6 address parsing
+
+ ntpd/ntp_scanner.c@1.10 +2 -42
+ [Bug 828] correct IPv6 address parsing
+
+ChangeSet@1.1641, 2007-10-28 20:40:12-04:00, neal@pogo.udel.edu
+ copyright.html:
+ add self to copyright notice
+
+ html/copyright.html@1.37 +1 -0
+ add self to copyright notice
+
+ChangeSet@1.1638.1.1, 2007-10-27 12:27:18-04:00, neal@pogo.udel.edu
+ ntp_io.c:
+ [Bug 752] QoS: add parser/config support.
+ Many files:
+ [Bug 752] QoS: add parser/config support.
+
+ ChangeLog@1.137 +1 -0
+ [Bug 752] QoS: add parser/config support.
+
+ include/ntp_config.h@1.46 +24 -0
+ [Bug 752] QoS: add parser/config support.
+
+ ntpd/ntp_config.c@1.169 +67 -1
+ [Bug 752] QoS: add parser/config support.
+
+ ntpd/ntp_io.c@1.265 +5 -5
+ [Bug 752] QoS: add parser/config support.
+ ,
+
+ ntpd/ntp_parser.c@1.23 +2031 -1577
+ [Bug 752] QoS: add parser/config support.
+
+ ntpd/ntp_parser.h@1.9 +341 -152
+ [Bug 752] QoS: add parser/config support.
+
+ ntpd/ntp_parser.y@1.19 +3 -0
+ [Bug 752] QoS: add parser/config support.
+
+ChangeSet@1.1639, 2007-10-27 07:44:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P91
+ TAG: NTP_4_2_5P91
+
+ ntpd/ntpd-opts.c@1.80 +2 -2
+ NTP_4_2_5P91
+
+ ntpd/ntpd-opts.h@1.80 +3 -3
+ NTP_4_2_5P91
+
+ ntpd/ntpd-opts.texi@1.79 +1 -1
+ NTP_4_2_5P91
+
+ ntpd/ntpd.1@1.79 +2 -2
+ NTP_4_2_5P91
+
+ ntpdc/ntpdc-opts.c@1.78 +2 -2
+ NTP_4_2_5P91
+
+ ntpdc/ntpdc-opts.h@1.78 +3 -3
+ NTP_4_2_5P91
+
+ ntpdc/ntpdc-opts.texi@1.77 +1 -1
+ NTP_4_2_5P91
+
+ ntpdc/ntpdc.1@1.77 +2 -2
+ NTP_4_2_5P91
+
+ ntpq/ntpq-opts.c@1.78 +2 -2
+ NTP_4_2_5P91
+
+ ntpq/ntpq-opts.h@1.78 +3 -3
+ NTP_4_2_5P91
+
+ ntpq/ntpq-opts.texi@1.77 +1 -1
+ NTP_4_2_5P91
+
+ ntpq/ntpq.1@1.77 +2 -2
+ NTP_4_2_5P91
+
+ packageinfo.sh@1.94 +1 -1
+ NTP_4_2_5P91
+
+ sntp/sntp-opts.c@1.78 +2 -2
+ NTP_4_2_5P91
+
+ sntp/sntp-opts.h@1.78 +3 -3
+ NTP_4_2_5P91
+
+ sntp/sntp-opts.texi@1.77 +1 -1
+ NTP_4_2_5P91
+
+ sntp/sntp.1@1.77 +2 -2
+ NTP_4_2_5P91
+
+ util/ntp-keygen-opts.c@1.79 +2 -2
+ NTP_4_2_5P91
+
+ util/ntp-keygen-opts.h@1.79 +3 -3
+ NTP_4_2_5P91
+
+ util/ntp-keygen-opts.texi@1.78 +1 -1
+ NTP_4_2_5P91
+
+ util/ntp-keygen.1@1.78 +2 -2
+ NTP_4_2_5P91
+
+ChangeSet@1.1638, 2007-10-26 17:40:27-04:00, stenn@whimsy.udel.edu
+ Fix the #include order in tickadj.c for picky machines
+
+ ChangeLog@1.136 +1 -0
+ Fix the #include order in tickadj.c for picky machines
+
+ util/tickadj.c@1.8 +1 -1
+ Fix the #include order in tickadj.c for picky machines
+
+ChangeSet@1.1637, 2007-10-26 07:43:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P90
+ TAG: NTP_4_2_5P90
+
+ ntpd/ntpd-opts.c@1.79 +2 -2
+ NTP_4_2_5P90
+
+ ntpd/ntpd-opts.h@1.79 +3 -3
+ NTP_4_2_5P90
+
+ ntpd/ntpd-opts.texi@1.78 +1 -1
+ NTP_4_2_5P90
+
+ ntpd/ntpd.1@1.78 +2 -2
+ NTP_4_2_5P90
+
+ ntpdc/ntpdc-opts.c@1.77 +2 -2
+ NTP_4_2_5P90
+
+ ntpdc/ntpdc-opts.h@1.77 +3 -3
+ NTP_4_2_5P90
+
+ ntpdc/ntpdc-opts.texi@1.76 +1 -1
+ NTP_4_2_5P90
+
+ ntpdc/ntpdc.1@1.76 +2 -2
+ NTP_4_2_5P90
+
+ ntpq/ntpq-opts.c@1.77 +2 -2
+ NTP_4_2_5P90
+
+ ntpq/ntpq-opts.h@1.77 +3 -3
+ NTP_4_2_5P90
+
+ ntpq/ntpq-opts.texi@1.76 +1 -1
+ NTP_4_2_5P90
+
+ ntpq/ntpq.1@1.76 +2 -2
+ NTP_4_2_5P90
+
+ packageinfo.sh@1.93 +1 -1
+ NTP_4_2_5P90
+
+ sntp/sntp-opts.c@1.77 +2 -2
+ NTP_4_2_5P90
+
+ sntp/sntp-opts.h@1.77 +3 -3
+ NTP_4_2_5P90
+
+ sntp/sntp-opts.texi@1.76 +1 -1
+ NTP_4_2_5P90
+
+ sntp/sntp.1@1.76 +2 -2
+ NTP_4_2_5P90
+
+ util/ntp-keygen-opts.c@1.78 +2 -2
+ NTP_4_2_5P90
+
+ util/ntp-keygen-opts.h@1.78 +3 -3
+ NTP_4_2_5P90
+
+ util/ntp-keygen-opts.texi@1.77 +1 -1
+ NTP_4_2_5P90
+
+ util/ntp-keygen.1@1.77 +2 -2
+ NTP_4_2_5P90
+
+ChangeSet@1.1636, 2007-10-26 00:30:22-04:00, stenn@whimsy.udel.edu
+ [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h
+
+ ChangeLog@1.135 +1 -0
+ [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h
+
+ include/ntp_io.h@1.9 +3 -0
+ [Bug 752] QoS: On some systems, netinet/ip.h needs netinet/ip_systm.h
+
+ChangeSet@1.1635, 2007-10-25 07:48:29-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P89
+ TAG: NTP_4_2_5P89
+
+ ntpd/ntpd-opts.c@1.78 +2 -2
+ NTP_4_2_5P89
+
+ ntpd/ntpd-opts.h@1.78 +3 -3
+ NTP_4_2_5P89
+
+ ntpd/ntpd-opts.texi@1.77 +1 -1
+ NTP_4_2_5P89
+
+ ntpd/ntpd.1@1.77 +2 -2
+ NTP_4_2_5P89
+
+ ntpdc/ntpdc-opts.c@1.76 +2 -2
+ NTP_4_2_5P89
+
+ ntpdc/ntpdc-opts.h@1.76 +3 -3
+ NTP_4_2_5P89
+
+ ntpdc/ntpdc-opts.texi@1.75 +1 -1
+ NTP_4_2_5P89
+
+ ntpdc/ntpdc.1@1.75 +2 -2
+ NTP_4_2_5P89
+
+ ntpq/ntpq-opts.c@1.76 +2 -2
+ NTP_4_2_5P89
+
+ ntpq/ntpq-opts.h@1.76 +3 -3
+ NTP_4_2_5P89
+
+ ntpq/ntpq-opts.texi@1.75 +1 -1
+ NTP_4_2_5P89
+
+ ntpq/ntpq.1@1.75 +2 -2
+ NTP_4_2_5P89
+
+ packageinfo.sh@1.92 +1 -1
+ NTP_4_2_5P89
+
+ sntp/sntp-opts.c@1.76 +2 -2
+ NTP_4_2_5P89
+
+ sntp/sntp-opts.h@1.76 +3 -3
+ NTP_4_2_5P89
+
+ sntp/sntp-opts.texi@1.75 +1 -1
+ NTP_4_2_5P89
+
+ sntp/sntp.1@1.75 +2 -2
+ NTP_4_2_5P89
+
+ util/ntp-keygen-opts.c@1.77 +2 -2
+ NTP_4_2_5P89
+
+ util/ntp-keygen-opts.h@1.77 +3 -3
+ NTP_4_2_5P89
+
+ util/ntp-keygen-opts.texi@1.76 +1 -1
+ NTP_4_2_5P89
+
+ util/ntp-keygen.1@1.76 +2 -2
+ NTP_4_2_5P89
+
+ChangeSet@1.1634, 2007-10-25 01:14:55-04:00, stenn@whimsy.udel.edu
+ [Bug 752] Update the QoS tagging (code only - configuration to follow)
+
+ ChangeLog@1.134 +1 -0
+ [Bug 752] Update the QoS tagging (code only - configuration to follow)
+
+ configure.ac@1.409 +18 -0
+ [Bug 752] Update the QoS tagging (code only - configuration to follow)
+
+ include/ntp_io.h@1.8 +6 -0
+ [Bug 752] Update the QoS tagging (code only - configuration to follow)
+
+ ntpd/ntp_io.c@1.264 +18 -14
+ [Bug 752] Update the QoS tagging (code only - configuration to follow)
+
+ChangeSet@1.1633, 2007-10-24 22:43:04-04:00, stenn@whimsy.udel.edu
+ ntp_proto.c:
+ Orphan mode and other protocol cleanup from Dave Mills
+ manyopt.html, assoc.html:
+ Documentation cleanup from Dave Mills
+ ChangeLog:
+ Documentation cleanup from Dave Mills
+ Orphan mode and other protocol cleanup from Dave Mills
+
+ ChangeLog@1.133 +2 -0
+ Documentation cleanup from Dave Mills
+ Orphan mode and other protocol cleanup from Dave Mills
+
+ html/assoc.html@1.24 +37 -38
+ Documentation cleanup from Dave Mills
+
+ html/manyopt.html@1.15 +23 -7
+ Documentation cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.264 +43 -68
+ Orphan mode and other protocol cleanup from Dave Mills
+
+ChangeSet@1.1632, 2007-10-23 07:44:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P88
+ TAG: NTP_4_2_5P88
+
+ ntpd/ntpd-opts.c@1.77 +2 -2
+ NTP_4_2_5P88
+
+ ntpd/ntpd-opts.h@1.77 +4 -4
+ NTP_4_2_5P88
+
+ ntpd/ntpd-opts.texi@1.76 +1 -1
+ NTP_4_2_5P88
+
+ ntpd/ntpd.1@1.76 +3 -3
+ NTP_4_2_5P88
+
+ ntpdc/ntpdc-opts.c@1.75 +2 -2
+ NTP_4_2_5P88
+
+ ntpdc/ntpdc-opts.h@1.75 +4 -4
+ NTP_4_2_5P88
+
+ ntpdc/ntpdc-opts.texi@1.74 +1 -1
+ NTP_4_2_5P88
+
+ ntpdc/ntpdc.1@1.74 +3 -3
+ NTP_4_2_5P88
+
+ ntpq/ntpq-opts.c@1.75 +2 -2
+ NTP_4_2_5P88
+
+ ntpq/ntpq-opts.h@1.75 +4 -4
+ NTP_4_2_5P88
+
+ ntpq/ntpq-opts.texi@1.74 +1 -1
+ NTP_4_2_5P88
+
+ ntpq/ntpq.1@1.74 +3 -3
+ NTP_4_2_5P88
+
+ packageinfo.sh@1.91 +1 -1
+ NTP_4_2_5P88
+
+ sntp/sntp-opts.c@1.75 +2 -2
+ NTP_4_2_5P88
+
+ sntp/sntp-opts.h@1.75 +3 -3
+ NTP_4_2_5P88
+
+ sntp/sntp-opts.texi@1.74 +1 -1
+ NTP_4_2_5P88
+
+ sntp/sntp.1@1.74 +2 -2
+ NTP_4_2_5P88
+
+ util/ntp-keygen-opts.c@1.76 +2 -2
+ NTP_4_2_5P88
+
+ util/ntp-keygen-opts.h@1.76 +4 -4
+ NTP_4_2_5P88
+
+ util/ntp-keygen-opts.texi@1.75 +1 -1
+ NTP_4_2_5P88
+
+ util/ntp-keygen.1@1.75 +3 -3
+ NTP_4_2_5P88
+
+ChangeSet@1.1631, 2007-10-22 21:39:01-04:00, stenn@whimsy.udel.edu
+ [Bug 940] ntp-keygen uses -v. Disallow it as a shortcut for --version
+
+ ChangeLog@1.132 +1 -0
+ [Bug 940] ntp-keygen uses -v. Disallow it as a shortcut for --version
+
+ include/copyright.def@1.6 +2 -0
+ [Bug 940] ntp-keygen uses -v. Disallow it as a shortcut for --version
+
+ChangeSet@1.1630, 2007-10-21 07:47:45-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P87
+ TAG: NTP_4_2_5P87
+
+ ntpd/ntpd-opts.c@1.76 +2 -2
+ NTP_4_2_5P87
+
+ ntpd/ntpd-opts.h@1.76 +3 -3
+ NTP_4_2_5P87
+
+ ntpd/ntpd-opts.texi@1.75 +2 -2
+ NTP_4_2_5P87
+
+ ntpd/ntpd.1@1.75 +2 -2
+ NTP_4_2_5P87
+
+ ntpdc/ntpdc-opts.c@1.74 +2 -2
+ NTP_4_2_5P87
+
+ ntpdc/ntpdc-opts.h@1.74 +3 -3
+ NTP_4_2_5P87
+
+ ntpdc/ntpdc-opts.texi@1.73 +2 -2
+ NTP_4_2_5P87
+
+ ntpdc/ntpdc.1@1.73 +2 -2
+ NTP_4_2_5P87
+
+ ntpq/ntpq-opts.c@1.74 +2 -2
+ NTP_4_2_5P87
+
+ ntpq/ntpq-opts.h@1.74 +3 -3
+ NTP_4_2_5P87
+
+ ntpq/ntpq-opts.texi@1.73 +2 -2
+ NTP_4_2_5P87
+
+ ntpq/ntpq.1@1.73 +2 -2
+ NTP_4_2_5P87
+
+ packageinfo.sh@1.90 +1 -1
+ NTP_4_2_5P87
+
+ sntp/sntp-opts.c@1.74 +2 -2
+ NTP_4_2_5P87
+
+ sntp/sntp-opts.h@1.74 +3 -3
+ NTP_4_2_5P87
+
+ sntp/sntp-opts.texi@1.73 +1 -1
+ NTP_4_2_5P87
+
+ sntp/sntp.1@1.73 +2 -2
+ NTP_4_2_5P87
+
+ util/ntp-keygen-opts.c@1.75 +2 -2
+ NTP_4_2_5P87
+
+ util/ntp-keygen-opts.h@1.75 +3 -3
+ NTP_4_2_5P87
+
+ util/ntp-keygen-opts.texi@1.74 +2 -2
+ NTP_4_2_5P87
+
+ util/ntp-keygen.1@1.74 +2 -2
+ NTP_4_2_5P87
+
+ChangeSet@1.1629, 2007-10-20 18:30:10-04:00, stenn@whimsy.udel.edu
+ more cleanup to ntp_lineeditlibs.m4
+
+ ChangeLog@1.131 +1 -0
+ more cleanup to ntp_lineeditlibs.m4
+
+ m4/ntp_lineeditlibs.m4@1.3 +46 -39
+ more cleanup to ntp_lineeditlibs.m4
+
+ChangeSet@1.1628, 2007-10-20 07:44:48-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P86
+ TAG: NTP_4_2_5P86
+
+ ntpd/ntpd-opts.c@1.75 +2 -2
+ NTP_4_2_5P86
+
+ ntpd/ntpd-opts.h@1.75 +3 -3
+ NTP_4_2_5P86
+
+ ntpd/ntpd-opts.texi@1.74 +1 -1
+ NTP_4_2_5P86
+
+ ntpd/ntpd.1@1.74 +2 -2
+ NTP_4_2_5P86
+
+ ntpdc/ntpdc-opts.c@1.73 +2 -2
+ NTP_4_2_5P86
+
+ ntpdc/ntpdc-opts.h@1.73 +3 -3
+ NTP_4_2_5P86
+
+ ntpdc/ntpdc-opts.texi@1.72 +1 -1
+ NTP_4_2_5P86
+
+ ntpdc/ntpdc.1@1.72 +2 -2
+ NTP_4_2_5P86
+
+ ntpq/ntpq-opts.c@1.73 +2 -2
+ NTP_4_2_5P86
+
+ ntpq/ntpq-opts.h@1.73 +3 -3
+ NTP_4_2_5P86
+
+ ntpq/ntpq-opts.texi@1.72 +1 -1
+ NTP_4_2_5P86
+
+ ntpq/ntpq.1@1.72 +2 -2
+ NTP_4_2_5P86
+
+ packageinfo.sh@1.89 +1 -1
+ NTP_4_2_5P86
+
+ sntp/sntp-opts.c@1.73 +2 -2
+ NTP_4_2_5P86
+
+ sntp/sntp-opts.h@1.73 +3 -3
+ NTP_4_2_5P86
+
+ sntp/sntp-opts.texi@1.72 +1 -1
+ NTP_4_2_5P86
+
+ sntp/sntp.1@1.72 +2 -2
+ NTP_4_2_5P86
+
+ util/ntp-keygen-opts.c@1.74 +2 -2
+ NTP_4_2_5P86
+
+ util/ntp-keygen-opts.h@1.74 +3 -3
+ NTP_4_2_5P86
+
+ util/ntp-keygen-opts.texi@1.73 +1 -1
+ NTP_4_2_5P86
+
+ util/ntp-keygen.1@1.73 +2 -2
+ NTP_4_2_5P86
+
+ChangeSet@1.1627, 2007-10-20 01:32:29-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.130 +1 -0
+ Documentation updates from Dave Mills
+
+ html/assoc.html@1.23 +39 -30
+ Documentation updates from Dave Mills
+
+ html/confopt.html@1.38 +35 -35
+ Documentation updates from Dave Mills
+
+ html/manyopt.html@1.14 +6 -38
+ Documentation updates from Dave Mills
+
+ html/miscopt.html@1.37 +22 -1
+ Documentation updates from Dave Mills
+
+ html/scripts/links7.txt@1.4 +1 -0
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1626, 2007-10-19 07:44:27-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P85
+ TAG: NTP_4_2_5P85
+
+ ntpd/ntpd-opts.c@1.74 +2 -2
+ NTP_4_2_5P85
+
+ ntpd/ntpd-opts.h@1.74 +3 -3
+ NTP_4_2_5P85
+
+ ntpd/ntpd-opts.texi@1.73 +1 -1
+ NTP_4_2_5P85
+
+ ntpd/ntpd.1@1.73 +2 -2
+ NTP_4_2_5P85
+
+ ntpdc/ntpdc-opts.c@1.72 +2 -2
+ NTP_4_2_5P85
+
+ ntpdc/ntpdc-opts.h@1.72 +3 -3
+ NTP_4_2_5P85
+
+ ntpdc/ntpdc-opts.texi@1.71 +1 -1
+ NTP_4_2_5P85
+
+ ntpdc/ntpdc.1@1.71 +2 -2
+ NTP_4_2_5P85
+
+ ntpq/ntpq-opts.c@1.72 +2 -2
+ NTP_4_2_5P85
+
+ ntpq/ntpq-opts.h@1.72 +3 -3
+ NTP_4_2_5P85
+
+ ntpq/ntpq-opts.texi@1.71 +1 -1
+ NTP_4_2_5P85
+
+ ntpq/ntpq.1@1.71 +2 -2
+ NTP_4_2_5P85
+
+ packageinfo.sh@1.88 +1 -1
+ NTP_4_2_5P85
+
+ sntp/sntp-opts.c@1.72 +2 -2
+ NTP_4_2_5P85
+
+ sntp/sntp-opts.h@1.72 +3 -3
+ NTP_4_2_5P85
+
+ sntp/sntp-opts.texi@1.71 +1 -1
+ NTP_4_2_5P85
+
+ sntp/sntp.1@1.71 +2 -2
+ NTP_4_2_5P85
+
+ util/ntp-keygen-opts.c@1.73 +2 -2
+ NTP_4_2_5P85
+
+ util/ntp-keygen-opts.h@1.73 +3 -3
+ NTP_4_2_5P85
+
+ util/ntp-keygen-opts.texi@1.72 +1 -1
+ NTP_4_2_5P85
+
+ util/ntp-keygen.1@1.72 +2 -2
+ NTP_4_2_5P85
+
+ChangeSet@1.1625, 2007-10-19 06:57:12+00:00, stenn@ntp1.isc.org
+ -ledit cleanup for ntpdc and ntpq.
+
+ ChangeLog@1.129 +1 -0
+ -ledit cleanup for ntpdc and ntpq.
+
+ ntpdc/ntpdc.c@1.58 +3 -3
+ -ledit cleanup for ntpdc and ntpq.
+
+ ntpq/ntpq.c@1.72 +3 -3
+ -ledit cleanup for ntpdc and ntpq.
+
+ChangeSet@1.1624, 2007-10-18 07:49:09-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P84
+ TAG: NTP_4_2_5P84
+
+ ntpd/ntpd-opts.c@1.73 +2 -2
+ NTP_4_2_5P84
+
+ ntpd/ntpd-opts.h@1.73 +3 -3
+ NTP_4_2_5P84
+
+ ntpd/ntpd-opts.texi@1.72 +1 -1
+ NTP_4_2_5P84
+
+ ntpd/ntpd.1@1.72 +2 -2
+ NTP_4_2_5P84
+
+ ntpdc/ntpdc-opts.c@1.71 +2 -2
+ NTP_4_2_5P84
+
+ ntpdc/ntpdc-opts.h@1.71 +3 -3
+ NTP_4_2_5P84
+
+ ntpdc/ntpdc-opts.texi@1.70 +1 -1
+ NTP_4_2_5P84
+
+ ntpdc/ntpdc.1@1.70 +2 -2
+ NTP_4_2_5P84
+
+ ntpq/ntpq-opts.c@1.71 +2 -2
+ NTP_4_2_5P84
+
+ ntpq/ntpq-opts.h@1.71 +3 -3
+ NTP_4_2_5P84
+
+ ntpq/ntpq-opts.texi@1.70 +1 -1
+ NTP_4_2_5P84
+
+ ntpq/ntpq.1@1.70 +2 -2
+ NTP_4_2_5P84
+
+ packageinfo.sh@1.87 +1 -1
+ NTP_4_2_5P84
+
+ sntp/sntp-opts.c@1.71 +2 -2
+ NTP_4_2_5P84
+
+ sntp/sntp-opts.h@1.71 +3 -3
+ NTP_4_2_5P84
+
+ sntp/sntp-opts.texi@1.70 +1 -1
+ NTP_4_2_5P84
+
+ sntp/sntp.1@1.70 +2 -2
+ NTP_4_2_5P84
+
+ util/ntp-keygen-opts.c@1.72 +2 -2
+ NTP_4_2_5P84
+
+ util/ntp-keygen-opts.h@1.72 +3 -3
+ NTP_4_2_5P84
+
+ util/ntp-keygen-opts.texi@1.71 +1 -1
+ NTP_4_2_5P84
+
+ util/ntp-keygen.1@1.71 +2 -2
+ NTP_4_2_5P84
+
+ChangeSet@1.1623, 2007-10-18 01:57:55-04:00, stenn@whimsy.udel.edu
+ README.hackers:
+ cleanup
+
+ README.hackers@1.11 +0 -13
+ cleanup
+
+ChangeSet@1.1622, 2007-10-18 01:52:51-04:00, stenn@whimsy.udel.edu
+ refclock_acts.c, ntp_peer.c, ChangeLog, ntp_proto.c, ntp_config.c:
+ Association and other cleanup from Dave Mills
+ ntp.h:
+ NTP_UNREACH changes from Dave Mills.
+
+ ChangeLog@1.128 +2 -0
+ Association and other cleanup from Dave Mills
+
+ include/ntp.h@1.139 +2 -2
+ NTP_UNREACH changes from Dave Mills.
+
+ ntpd/ntp_config.c@1.168 +20 -24
+ Association and other cleanup from Dave Mills
+
+ ntpd/ntp_peer.c@1.108 +45 -65
+ Association and other cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.263 +11 -34
+ Association and other cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.32 +2 -0
+ Association and other cleanup from Dave Mills
+
+ChangeSet@1.1621, 2007-10-17 20:21:31-04:00, stenn@whimsy.udel.edu
+ Fix the readline history test
+
+ ChangeLog@1.127 +1 -0
+ Fix the readline history test
+
+ m4/ntp_lineeditlibs.m4@1.2 +4 -1
+ Fix the readline history test
+
+ChangeSet@1.1620, 2007-10-15 07:49:05-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P83
+ TAG: NTP_4_2_5P83
+
+ ntpd/ntpd-opts.c@1.72 +2 -2
+ NTP_4_2_5P83
+
+ ntpd/ntpd-opts.h@1.72 +3 -3
+ NTP_4_2_5P83
+
+ ntpd/ntpd-opts.texi@1.71 +1 -1
+ NTP_4_2_5P83
+
+ ntpd/ntpd.1@1.71 +2 -2
+ NTP_4_2_5P83
+
+ ntpdc/ntpdc-opts.c@1.70 +2 -2
+ NTP_4_2_5P83
+
+ ntpdc/ntpdc-opts.h@1.70 +3 -3
+ NTP_4_2_5P83
+
+ ntpdc/ntpdc-opts.texi@1.69 +1 -1
+ NTP_4_2_5P83
+
+ ntpdc/ntpdc.1@1.69 +2 -2
+ NTP_4_2_5P83
+
+ ntpq/ntpq-opts.c@1.70 +2 -2
+ NTP_4_2_5P83
+
+ ntpq/ntpq-opts.h@1.70 +3 -3
+ NTP_4_2_5P83
+
+ ntpq/ntpq-opts.texi@1.69 +1 -1
+ NTP_4_2_5P83
+
+ ntpq/ntpq.1@1.69 +2 -2
+ NTP_4_2_5P83
+
+ packageinfo.sh@1.86 +1 -1
+ NTP_4_2_5P83
+
+ sntp/sntp-opts.c@1.70 +2 -2
+ NTP_4_2_5P83
+
+ sntp/sntp-opts.h@1.70 +3 -3
+ NTP_4_2_5P83
+
+ sntp/sntp-opts.texi@1.69 +1 -1
+ NTP_4_2_5P83
+
+ sntp/sntp.1@1.69 +2 -2
+ NTP_4_2_5P83
+
+ util/ntp-keygen-opts.c@1.71 +2 -2
+ NTP_4_2_5P83
+
+ util/ntp-keygen-opts.h@1.71 +3 -3
+ NTP_4_2_5P83
+
+ util/ntp-keygen-opts.texi@1.70 +1 -1
+ NTP_4_2_5P83
+
+ util/ntp-keygen.1@1.70 +2 -2
+ NTP_4_2_5P83
+
+ChangeSet@1.1619, 2007-10-15 04:52:10-04:00, stenn@whimsy.udel.edu
+ ChangeLog:
+ [Bug 931] Require -lreadline to be asked for explicitly.
+ [Bug 764] When looking for -lreadline support, also try using -lncurses.
+ Use new line edit library autoconf macro.
+ configure.ac:
+ Use the NTP_LINEEDITLIBS macro now.
+ Makefile.am, ntpdc.c, ntpq.c:
+ Use new line editing library detection code
+ ntp_lineeditlibs.m4:
+ BitKeeper file /deacon/backroom/ntp-dev-hms/m4/ntp_lineeditlibs.m4
+
+ ChangeLog@1.126 +2 -0
+ [Bug 931] Require -lreadline to be asked for explicitly.
+ [Bug 764] When looking for -lreadline support, also try using -lncurses.
+ Use new line edit library autoconf macro.
+
+ configure.ac@1.408 +2 -26
+ Use the NTP_LINEEDITLIBS macro now.
+
+ m4/ntp_lineeditlibs.m4@1.1 +86 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/m4/ntp_lineeditlibs.m4
+
+ m4/ntp_lineeditlibs.m4@1.0 +0 -0
+
+ ntpdc/Makefile.am@1.37 +1 -1
+ Use new line editing library detection code
+
+ ntpdc/ntpdc.c@1.57 +6 -2
+ Use new line editing library detection code
+
+ ntpq/Makefile.am@1.29 +1 -1
+ Use new line editing library detection code
+
+ ntpq/ntpq.c@1.71 +6 -2
+ Use new line editing library detection code
+
+ChangeSet@1.1618, 2007-10-14 07:44:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P82
+ TAG: NTP_4_2_5P82
+
+ ntpd/ntpd-opts.c@1.71 +2 -2
+ NTP_4_2_5P82
+
+ ntpd/ntpd-opts.h@1.71 +3 -3
+ NTP_4_2_5P82
+
+ ntpd/ntpd-opts.texi@1.70 +1 -1
+ NTP_4_2_5P82
+
+ ntpd/ntpd.1@1.70 +2 -2
+ NTP_4_2_5P82
+
+ ntpdc/ntpdc-opts.c@1.69 +2 -2
+ NTP_4_2_5P82
+
+ ntpdc/ntpdc-opts.h@1.69 +3 -3
+ NTP_4_2_5P82
+
+ ntpdc/ntpdc-opts.texi@1.68 +1 -1
+ NTP_4_2_5P82
+
+ ntpdc/ntpdc.1@1.68 +2 -2
+ NTP_4_2_5P82
+
+ ntpq/ntpq-opts.c@1.69 +2 -2
+ NTP_4_2_5P82
+
+ ntpq/ntpq-opts.h@1.69 +3 -3
+ NTP_4_2_5P82
+
+ ntpq/ntpq-opts.texi@1.68 +1 -1
+ NTP_4_2_5P82
+
+ ntpq/ntpq.1@1.68 +2 -2
+ NTP_4_2_5P82
+
+ packageinfo.sh@1.85 +1 -1
+ NTP_4_2_5P82
+
+ sntp/sntp-opts.c@1.69 +2 -2
+ NTP_4_2_5P82
+
+ sntp/sntp-opts.h@1.69 +3 -3
+ NTP_4_2_5P82
+
+ sntp/sntp-opts.texi@1.68 +1 -1
+ NTP_4_2_5P82
+
+ sntp/sntp.1@1.68 +2 -2
+ NTP_4_2_5P82
+
+ util/ntp-keygen-opts.c@1.70 +2 -2
+ NTP_4_2_5P82
+
+ util/ntp-keygen-opts.h@1.70 +3 -3
+ NTP_4_2_5P82
+
+ util/ntp-keygen-opts.texi@1.69 +1 -1
+ NTP_4_2_5P82
+
+ util/ntp-keygen.1@1.69 +2 -2
+ NTP_4_2_5P82
+
+ChangeSet@1.1617, 2007-10-14 03:35:11-04:00, stenn@pogo.udel.edu
+ Reformat entries
+
+ ChangeLog@1.125 +5 -5
+ Reformat entries
+
+ChangeSet@1.1616, 2007-10-13 21:47:27-04:00, mayer@pogo.udel.edu
+ Bug #909 Fix int32_t errors for ntohl()
+
+ ntpdc/ntpdc_ops.c@1.52 +107 -107
+ Bug #909 Fix int32_t errors for ntohl()
+
+ ports/winnt/include/config.h@1.52 +1 -0
+ Bug #909 Fix int32_t errors for ntohl()
+
+ChangeSet@1.1615, 2007-10-08 15:47:23-04:00, mayer@pogo.udel.edu
+ Bug #909 Fix int32_t errors for ntohl()
+
+ ChangeLog@1.124 +1 -0
+ Bug #909 Fix int32_t errors for ntohl()
+
+ChangeSet@1.1614, 2007-10-08 15:45:47-04:00, mayer@pogo.udel.edu
+ Bug #909 Fix int32_t errors for ntohl()
+
+ ntpdc/ntpdc_ops.c@1.51 +107 -107
+ Bug #909 Fix int32_t errors for ntohl()
+
+ChangeSet@1.1613, 2007-10-07 20:47:32-04:00, mayer@pogo.udel.edu
+ Bug #376/214 enhancements
+
+ ChangeLog@1.123 +1 -0
+
+ChangeSet@1.1612, 2007-10-07 12:27:06-04:00, mayer@pogo.udel.edu
+ Bug #376/214 Enhancements to support multiple if names and IP addresses
+
+ include/ntp_io.h@1.7 +6 -0
+ Bug #376/214 Enhancements to support multiple if names and IP addresses
+
+ ntpd/ntp_io.c@1.263 +151 -2
+ Bug #376/214 Enhancements to support multiple if names and IP addresses
+
+ ntpd/ntpd.c@1.90 +7 -6
+ Bug #376/214 Enhancements to support multiple if names and IP addresses
+
+ChangeSet@1.1611, 2007-10-05 09:54:42-04:00, mayer@pogo.udel.edu
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/include/config.h@1.51 +3 -1
+ Bug #788 Update macros to support VS 2005
+
+ChangeSet@1.1610, 2007-10-05 09:20:49-04:00, mayer@pogo.udel.edu
+ New bug fixes
+
+ ChangeLog@1.122 +3 -0
+ New bug fixes
+
+ChangeSet@1.1609, 2007-10-05 09:17:12-04:00, mayer@pogo.udel.edu
+ Bug #929 int32_t is undefined on Windows. Casting wrong
+
+ ntpdc/ntpdc_ops.c@1.50 +4 -4
+ Bug #929 int32_t is undefined on Windows. Casting wrong
+
+ChangeSet@1.1608, 2007-10-05 08:57:08-04:00, mayer@pogo.udel.edu
+ Bug #928 readlink missing braces
+
+ util/ntp-keygen.c@1.46 +2 -2
+ Bug #928 readlink missing braces
+
+ChangeSet@1.1607, 2007-10-05 08:46:39-04:00, mayer@pogo.udel.edu
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/instsrv/Instsrv.dsp@1.7 +2 -2
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/libntp/libntp.dsp@1.31 +2 -2
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.12 +4 -4
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/ntpd/ntpd.dsp@1.31 +2 -2
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/ntpdate/ntpdate.dsp@1.16 +2 -2
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.19 +2 -2
+ Bug #788 Update macros to support VS 2005
+
+ ports/winnt/ntpq/ntpq.dsp@1.20 +2 -2
+ Bug #788 Update macros to support VS 2005
+
+ChangeSet@1.1606, 2007-10-04 07:45:47-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P81
+ TAG: NTP_4_2_5P81
+
+ ntpd/ntpd-opts.c@1.70 +2 -2
+ NTP_4_2_5P81
+
+ ntpd/ntpd-opts.h@1.70 +3 -3
+ NTP_4_2_5P81
+
+ ntpd/ntpd-opts.texi@1.69 +3 -5
+ NTP_4_2_5P81
+
+ ntpd/ntpd.1@1.69 +2 -2
+ NTP_4_2_5P81
+
+ ntpdc/ntpdc-opts.c@1.68 +2 -2
+ NTP_4_2_5P81
+
+ ntpdc/ntpdc-opts.h@1.68 +3 -3
+ NTP_4_2_5P81
+
+ ntpdc/ntpdc-opts.texi@1.67 +2 -2
+ NTP_4_2_5P81
+
+ ntpdc/ntpdc.1@1.67 +2 -2
+ NTP_4_2_5P81
+
+ ntpq/ntpq-opts.c@1.68 +2 -2
+ NTP_4_2_5P81
+
+ ntpq/ntpq-opts.h@1.68 +3 -3
+ NTP_4_2_5P81
+
+ ntpq/ntpq-opts.texi@1.67 +2 -2
+ NTP_4_2_5P81
+
+ ntpq/ntpq.1@1.67 +2 -2
+ NTP_4_2_5P81
+
+ packageinfo.sh@1.84 +1 -1
+ NTP_4_2_5P81
+
+ sntp/sntp-opts.c@1.68 +2 -2
+ NTP_4_2_5P81
+
+ sntp/sntp-opts.h@1.68 +3 -3
+ NTP_4_2_5P81
+
+ sntp/sntp-opts.texi@1.67 +1 -1
+ NTP_4_2_5P81
+
+ sntp/sntp.1@1.67 +2 -2
+ NTP_4_2_5P81
+
+ util/ntp-keygen-opts.c@1.69 +2 -2
+ NTP_4_2_5P81
+
+ util/ntp-keygen-opts.h@1.69 +3 -3
+ NTP_4_2_5P81
+
+ util/ntp-keygen-opts.texi@1.68 +2 -2
+ NTP_4_2_5P81
+
+ util/ntp-keygen.1@1.68 +2 -2
+ NTP_4_2_5P81
+
+ChangeSet@1.1605, 2007-10-04 03:02:00-04:00, stenn@whimsy.udel.edu
+ documentation update from Dave Mills
+
+ html/authopt.html@1.45 +2 -2
+ documentation update from Dave Mills
+
+ChangeSet@1.1599.1.1, 2007-10-03 21:38:31-04:00, stenn@whimsy.udel.edu
+ Many files:
+ Lose obsolete crypto subcommands
+ sco.html, authopt.html:
+ documentation cleanup
+ ChangeLog, ntp_control.c:
+ WWV is an HF source, not an LF source
+
+ ChangeLog@1.116.1.2 +1 -0
+ Lose obsolete crypto subcommands
+
+ ChangeLog@1.116.1.1 +1 -0
+ WWV is an HF source, not an LF source
+
+ html/authopt.html@1.44 +2 -3
+ documentation cleanup
+
+ html/build/hints/sco.html@1.8 +1 -0
+ documentation cleanup
+
+ ntpd/ntp_config.c@1.167 +0 -5
+ Lose obsolete crypto subcommands
+
+ ntpd/ntp_control.c@1.102 +1 -1
+ WWV is an HF source, not an LF source
+
+ ntpd/ntp_crypto.c@1.118 +0 -25
+ Lose obsolete crypto subcommands
+
+ ntpd/ntp_parser.c@1.22 +826 -848
+ Lose obsolete crypto subcommands
+
+ ntpd/ntp_parser.h@1.8 +132 -136
+ Lose obsolete crypto subcommands
+
+ ntpd/ntp_parser.y@1.18 +9 -14
+ Lose obsolete crypto subcommands
+
+ChangeSet@1.1603, 2007-09-30 16:40:51+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ ntpd/ntp_timer.c: add missing sys_tai parameter for debug printf
+ ntp_timer.c:
+ add missing sys_tai parameter for debug printf
+
+ ChangeLog@1.120 +1 -0
+ ntpd/ntp_timer.c: add missing sys_tai parameter for debug printf
+
+ ntpd/ntp_timer.c@1.41 +1 -1
+ add missing sys_tai parameter for debug printf
+
+ChangeSet@1.1602, 2007-09-30 16:09:50+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ [Bug 917] config parse leaves files open
+ ntp_scanner.c:
+ Bug 917: config parse leaves files open
+
+ ChangeLog@1.119 +1 -0
+ [Bug 917] config parse leaves files open
+
+ ntpd/ntp_scanner.c@1.9 +3 -2
+ Bug 917: config parse leaves files open
+
+ChangeSet@1.1601, 2007-09-30 16:05:00+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ Bug 912: detect conflicting enable/disable configuration on interfaces sharing an IP address
+ ChangeLog:
+ [Bug 912] detect conflicting enable/disable configuration on interfaces sharing an IP address
+
+ ChangeLog@1.118 +1 -0
+ [Bug 912] detect conflicting enable/disable configuration on interfaces sharing an IP address
+
+ ntpd/ntp_io.c@1.262 +39 -2
+ Bug 912: detect conflicting enable/disable configuration on interfaces sharing an IP address
+
+ChangeSet@1.1600, 2007-09-30 15:57:52+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ [Bug 771] compare scopeid if available for IPv6 addresses
+ ntp.h:
+ Bug 771: compare scopeid if available for IPv6 addresses
+
+ ChangeLog@1.117 +1 -0
+ [Bug 771] compare scopeid if available for IPv6 addresses
+
+ include/ntp.h@1.138 +7 -1
+ Bug 771: compare scopeid if available for IPv6 addresses
+
+ChangeSet@1.1599, 2007-09-23 07:45:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P80
+ TAG: NTP_4_2_5P80
+
+ ntpd/ntpd-opts.c@1.69 +2 -2
+ NTP_4_2_5P80
+
+ ntpd/ntpd-opts.h@1.69 +3 -3
+ NTP_4_2_5P80
+
+ ntpd/ntpd-opts.texi@1.68 +1 -1
+ NTP_4_2_5P80
+
+ ntpd/ntpd.1@1.68 +2 -2
+ NTP_4_2_5P80
+
+ ntpdc/ntpdc-opts.c@1.67 +2 -2
+ NTP_4_2_5P80
+
+ ntpdc/ntpdc-opts.h@1.67 +3 -3
+ NTP_4_2_5P80
+
+ ntpdc/ntpdc-opts.texi@1.66 +1 -1
+ NTP_4_2_5P80
+
+ ntpdc/ntpdc.1@1.66 +2 -2
+ NTP_4_2_5P80
+
+ ntpq/ntpq-opts.c@1.67 +2 -2
+ NTP_4_2_5P80
+
+ ntpq/ntpq-opts.h@1.67 +3 -3
+ NTP_4_2_5P80
+
+ ntpq/ntpq-opts.texi@1.66 +1 -1
+ NTP_4_2_5P80
+
+ ntpq/ntpq.1@1.66 +2 -2
+ NTP_4_2_5P80
+
+ packageinfo.sh@1.83 +1 -1
+ NTP_4_2_5P80
+
+ sntp/sntp-opts.c@1.67 +2 -2
+ NTP_4_2_5P80
+
+ sntp/sntp-opts.h@1.67 +3 -3
+ NTP_4_2_5P80
+
+ sntp/sntp-opts.texi@1.66 +1 -1
+ NTP_4_2_5P80
+
+ sntp/sntp.1@1.66 +2 -2
+ NTP_4_2_5P80
+
+ util/ntp-keygen-opts.c@1.68 +2 -2
+ NTP_4_2_5P80
+
+ util/ntp-keygen-opts.h@1.68 +3 -3
+ NTP_4_2_5P80
+
+ util/ntp-keygen-opts.texi@1.67 +1 -1
+ NTP_4_2_5P80
+
+ util/ntp-keygen.1@1.67 +2 -2
+ NTP_4_2_5P80
+
+ChangeSet@1.1598, 2007-09-23 03:16:18-04:00, stenn@whimsy.udel.edu
+ [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT
+
+ ChangeLog@1.116 +1 -1
+ [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT
+
+ ntpd/ntpd-opts.c@1.68 +40 -31
+ [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT
+
+ ntpd/ntpd-opts.h@1.68 +16 -14
+ [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT
+
+ ntpd/ntpd-opts.texi@1.67 +19 -12
+ [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT
+
+ ntpd/ntpd.1@1.67 +10 -10
+ [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT
+
+ ntpd/ntpdbase-opts.def@1.13 +26 -25
+ [Bug 899] Only show -i/--jaildir -u/--user options if we HAVE_DROPROOT
+
+ChangeSet@1.1597, 2007-09-23 02:06:55-04:00, stenn@whimsy.udel.edu
+ [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT
+
+ ChangeLog@1.115 +1 -0
+ [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT
+
+ ntpd/ntpd-opts.c@1.67 +10 -1
+ [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT
+
+ ntpd/ntpd-opts.h@1.67 +3 -1
+ [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT
+
+ ntpd/ntpd-opts.texi@1.66 +8 -1
+ [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT
+
+ ntpd/ntpd.1@1.66 +2 -2
+ [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT
+
+ ntpd/ntpdbase-opts.def@1.12 +1 -0
+ [Bug 899] Only show -i/--jaildir option if we HAVE_DROPROOT
+
+ChangeSet@1.1596, 2007-09-20 07:43:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P79
+ TAG: NTP_4_2_5P79
+
+ ntpd/ntpd-opts.c@1.66 +2 -2
+ NTP_4_2_5P79
+
+ ntpd/ntpd-opts.h@1.66 +3 -3
+ NTP_4_2_5P79
+
+ ntpd/ntpd-opts.texi@1.65 +2 -2
+ NTP_4_2_5P79
+
+ ntpd/ntpd.1@1.65 +2 -2
+ NTP_4_2_5P79
+
+ ntpdc/ntpdc-opts.c@1.66 +2 -2
+ NTP_4_2_5P79
+
+ ntpdc/ntpdc-opts.h@1.66 +3 -3
+ NTP_4_2_5P79
+
+ ntpdc/ntpdc-opts.texi@1.65 +2 -2
+ NTP_4_2_5P79
+
+ ntpdc/ntpdc.1@1.65 +2 -2
+ NTP_4_2_5P79
+
+ ntpq/ntpq-opts.c@1.66 +2 -2
+ NTP_4_2_5P79
+
+ ntpq/ntpq-opts.h@1.66 +3 -3
+ NTP_4_2_5P79
+
+ ntpq/ntpq-opts.texi@1.65 +2 -2
+ NTP_4_2_5P79
+
+ ntpq/ntpq.1@1.65 +2 -2
+ NTP_4_2_5P79
+
+ packageinfo.sh@1.82 +1 -1
+ NTP_4_2_5P79
+
+ sntp/sntp-opts.c@1.66 +2 -2
+ NTP_4_2_5P79
+
+ sntp/sntp-opts.h@1.66 +3 -3
+ NTP_4_2_5P79
+
+ sntp/sntp-opts.texi@1.65 +1 -1
+ NTP_4_2_5P79
+
+ sntp/sntp.1@1.65 +2 -2
+ NTP_4_2_5P79
+
+ util/ntp-keygen-opts.c@1.67 +2 -2
+ NTP_4_2_5P79
+
+ util/ntp-keygen-opts.h@1.67 +3 -3
+ NTP_4_2_5P79
+
+ util/ntp-keygen-opts.texi@1.66 +2 -2
+ NTP_4_2_5P79
+
+ util/ntp-keygen.1@1.66 +2 -2
+ NTP_4_2_5P79
+
+ChangeSet@1.1595, 2007-09-19 14:40:52-04:00, stenn@whimsy.udel.edu
+ [Bug 916] 'cryptosw' is undefined if built without OpenSSL
+
+ ntpd/ntp_config.c@1.166 +0 -2
+ [Bug 916] 'cryptosw' is undefined if built without OpenSSL
+
+ChangeSet@1.1594, 2007-09-19 07:45:04-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P78
+ TAG: NTP_4_2_5P78
+
+ ntpd/ntpd-opts.c@1.65 +2 -2
+ NTP_4_2_5P78
+
+ ntpd/ntpd-opts.h@1.65 +3 -3
+ NTP_4_2_5P78
+
+ ntpd/ntpd-opts.texi@1.64 +2 -2
+ NTP_4_2_5P78
+
+ ntpd/ntpd.1@1.64 +2 -2
+ NTP_4_2_5P78
+
+ ntpdc/ntpdc-opts.c@1.65 +2 -2
+ NTP_4_2_5P78
+
+ ntpdc/ntpdc-opts.h@1.65 +3 -3
+ NTP_4_2_5P78
+
+ ntpdc/ntpdc-opts.texi@1.64 +2 -2
+ NTP_4_2_5P78
+
+ ntpdc/ntpdc.1@1.64 +2 -2
+ NTP_4_2_5P78
+
+ ntpq/ntpq-opts.c@1.65 +2 -2
+ NTP_4_2_5P78
+
+ ntpq/ntpq-opts.h@1.65 +3 -3
+ NTP_4_2_5P78
+
+ ntpq/ntpq-opts.texi@1.64 +2 -2
+ NTP_4_2_5P78
+
+ ntpq/ntpq.1@1.64 +2 -2
+ NTP_4_2_5P78
+
+ packageinfo.sh@1.81 +1 -1
+ NTP_4_2_5P78
+
+ sntp/sntp-opts.c@1.65 +2 -2
+ NTP_4_2_5P78
+
+ sntp/sntp-opts.h@1.65 +3 -3
+ NTP_4_2_5P78
+
+ sntp/sntp-opts.texi@1.64 +1 -1
+ NTP_4_2_5P78
+
+ sntp/sntp.1@1.64 +2 -2
+ NTP_4_2_5P78
+
+ util/ntp-keygen-opts.c@1.66 +2 -2
+ NTP_4_2_5P78
+
+ util/ntp-keygen-opts.h@1.66 +3 -3
+ NTP_4_2_5P78
+
+ util/ntp-keygen-opts.texi@1.65 +3 -3
+ NTP_4_2_5P78
+
+ util/ntp-keygen.1@1.65 +2 -2
+ NTP_4_2_5P78
+
+ChangeSet@1.1593, 2007-09-19 06:46:54-04:00, stenn@whimsy.udel.edu
+ [Bug 916] 'cryptosw' is undefined if built without OpenSSL
+
+ ChangeLog@1.114 +1 -0
+ [Bug 916] 'cryptosw' is undefined if built without OpenSSL
+
+ChangeSet@1.1592, 2007-09-19 04:16:11-04:00, stenn@whimsy.udel.edu
+ Documentation updates
+
+ html/authopt.html@1.43 +45 -59
+ Documentation updates
+
+ html/keygen.html@1.10 +41 -44
+ Documentation updates
+
+ChangeSet@1.1591, 2007-09-19 04:05:50-04:00, stenn@whimsy.udel.edu
+ [Bug 890] the crypto command seems to be required now\n[Bug 891] 'restrict' config file keyword does not work (partial fix)
+
+ ChangeLog@1.113 +1 -0
+ [Bug 890] the crypto command seems to be required now\n[Bug 891] 'restrict' config file keyword does not work (partial fix)
+
+ ChangeLog@1.112 +3 -0
+ [Bug 890] the crypto command seems to be required now
+
+ ntpd/ntp_config.c@1.165 +9 -1
+ [Bug 890] the crypto command seems to be required now\n[Bug 891] 'restrict' config file keyword does not work (partial fix)
+
+ ntpd/ntp_crypto.c@1.117 +13 -17
+ [Bug 915] ntpd cores during processing of x509 certificates\nRemove lint.
+
+ ntpd/ntp_parser.c@1.21 +238 -236
+ [Bug 890] the crypto command seems to be required now
+
+ ntpd/ntp_parser.y@1.17 +2 -0
+ [Bug 890] the crypto command seems to be required now
+
+ ntpd/ntp_restrict.c@1.25 +6 -1
+ restrict processing debug information
+
+ChangeSet@1.1590, 2007-09-16 07:44:22-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P77
+ TAG: NTP_4_2_5P77
+
+ ntpd/ntpd-opts.c@1.64 +2 -2
+ NTP_4_2_5P77
+
+ ntpd/ntpd-opts.h@1.64 +3 -3
+ NTP_4_2_5P77
+
+ ntpd/ntpd-opts.texi@1.63 +1 -1
+ NTP_4_2_5P77
+
+ ntpd/ntpd.1@1.63 +2 -2
+ NTP_4_2_5P77
+
+ ntpdc/ntpdc-opts.c@1.64 +2 -2
+ NTP_4_2_5P77
+
+ ntpdc/ntpdc-opts.h@1.64 +3 -3
+ NTP_4_2_5P77
+
+ ntpdc/ntpdc-opts.texi@1.63 +1 -1
+ NTP_4_2_5P77
+
+ ntpdc/ntpdc.1@1.63 +2 -2
+ NTP_4_2_5P77
+
+ ntpq/ntpq-opts.c@1.64 +2 -2
+ NTP_4_2_5P77
+
+ ntpq/ntpq-opts.h@1.64 +3 -3
+ NTP_4_2_5P77
+
+ ntpq/ntpq-opts.texi@1.63 +1 -1
+ NTP_4_2_5P77
+
+ ntpq/ntpq.1@1.63 +2 -2
+ NTP_4_2_5P77
+
+ packageinfo.sh@1.80 +1 -1
+ NTP_4_2_5P77
+
+ sntp/sntp-opts.c@1.64 +2 -2
+ NTP_4_2_5P77
+
+ sntp/sntp-opts.h@1.64 +3 -3
+ NTP_4_2_5P77
+
+ sntp/sntp-opts.texi@1.63 +1 -1
+ NTP_4_2_5P77
+
+ sntp/sntp.1@1.63 +2 -2
+ NTP_4_2_5P77
+
+ util/ntp-keygen-opts.c@1.65 +2 -2
+ NTP_4_2_5P77
+
+ util/ntp-keygen-opts.h@1.65 +3 -3
+ NTP_4_2_5P77
+
+ util/ntp-keygen-opts.texi@1.64 +1 -1
+ NTP_4_2_5P77
+
+ util/ntp-keygen.1@1.64 +2 -2
+ NTP_4_2_5P77
+
+ChangeSet@1.1589, 2007-09-15 16:40:14-04:00, stenn@whimsy.udel.edu
+ Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file
+
+ ChangeLog@1.111 +2 -0
+ Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file
+
+ ntpd/ntp_control.c@1.101 +2 -2
+ Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file
+
+ ntpd/ntp_crypto.c@1.116 +102 -70
+ Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file
+
+ util/ntp-keygen.c@1.45 +143 -202
+ Crypto cleanup from Dave Mills.\n[Bug 897] Check RAND_status() - we may not need a .rnd file
+
+ChangeSet@1.1588, 2007-09-13 07:44:43-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P76
+ TAG: NTP_4_2_5P76
+
+ ntpd/ntpd-opts.c@1.63 +2 -2
+ NTP_4_2_5P76
+
+ ntpd/ntpd-opts.h@1.63 +3 -3
+ NTP_4_2_5P76
+
+ ntpd/ntpd-opts.texi@1.62 +1 -1
+ NTP_4_2_5P76
+
+ ntpd/ntpd.1@1.62 +2 -2
+ NTP_4_2_5P76
+
+ ntpdc/ntpdc-opts.c@1.63 +2 -2
+ NTP_4_2_5P76
+
+ ntpdc/ntpdc-opts.h@1.63 +3 -3
+ NTP_4_2_5P76
+
+ ntpdc/ntpdc-opts.texi@1.62 +1 -1
+ NTP_4_2_5P76
+
+ ntpdc/ntpdc.1@1.62 +2 -2
+ NTP_4_2_5P76
+
+ ntpq/ntpq-opts.c@1.63 +2 -2
+ NTP_4_2_5P76
+
+ ntpq/ntpq-opts.h@1.63 +3 -3
+ NTP_4_2_5P76
+
+ ntpq/ntpq-opts.texi@1.62 +1 -1
+ NTP_4_2_5P76
+
+ ntpq/ntpq.1@1.62 +2 -2
+ NTP_4_2_5P76
+
+ packageinfo.sh@1.79 +1 -1
+ NTP_4_2_5P76
+
+ sntp/sntp-opts.c@1.63 +2 -2
+ NTP_4_2_5P76
+
+ sntp/sntp-opts.h@1.63 +3 -3
+ NTP_4_2_5P76
+
+ sntp/sntp-opts.texi@1.62 +1 -1
+ NTP_4_2_5P76
+
+ sntp/sntp.1@1.62 +2 -2
+ NTP_4_2_5P76
+
+ util/ntp-keygen-opts.c@1.64 +2 -2
+ NTP_4_2_5P76
+
+ util/ntp-keygen-opts.h@1.64 +3 -3
+ NTP_4_2_5P76
+
+ util/ntp-keygen-opts.texi@1.63 +1 -1
+ NTP_4_2_5P76
+
+ util/ntp-keygen.1@1.63 +2 -2
+ NTP_4_2_5P76
+
+ChangeSet@1.1587, 2007-09-12 17:22:55-04:00, stenn@whimsy.udel.edu
+ [Bug 911] Fix error message in cmd_args.c
+
+ ChangeLog@1.110 +1 -0
+ [Bug 911] Fix error message in cmd_args.c
+
+ ntpd/cmd_args.c@1.52 +0 -1
+ [Bug 911] Fix error message in cmd_args.c
+
+ChangeSet@1.1586, 2007-09-11 07:47:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P75
+ TAG: NTP_4_2_5P75
+
+ ntpd/ntpd-opts.c@1.62 +2 -2
+ NTP_4_2_5P75
+
+ ntpd/ntpd-opts.h@1.62 +3 -3
+ NTP_4_2_5P75
+
+ ntpd/ntpd-opts.texi@1.61 +1 -1
+ NTP_4_2_5P75
+
+ ntpd/ntpd.1@1.61 +2 -2
+ NTP_4_2_5P75
+
+ ntpdc/ntpdc-opts.c@1.62 +2 -2
+ NTP_4_2_5P75
+
+ ntpdc/ntpdc-opts.h@1.62 +3 -3
+ NTP_4_2_5P75
+
+ ntpdc/ntpdc-opts.texi@1.61 +1 -1
+ NTP_4_2_5P75
+
+ ntpdc/ntpdc.1@1.61 +2 -2
+ NTP_4_2_5P75
+
+ ntpq/ntpq-opts.c@1.62 +2 -2
+ NTP_4_2_5P75
+
+ ntpq/ntpq-opts.h@1.62 +3 -3
+ NTP_4_2_5P75
+
+ ntpq/ntpq-opts.texi@1.61 +1 -1
+ NTP_4_2_5P75
+
+ ntpq/ntpq.1@1.61 +2 -2
+ NTP_4_2_5P75
+
+ packageinfo.sh@1.78 +1 -1
+ NTP_4_2_5P75
+
+ sntp/sntp-opts.c@1.62 +2 -2
+ NTP_4_2_5P75
+
+ sntp/sntp-opts.h@1.62 +3 -3
+ NTP_4_2_5P75
+
+ sntp/sntp-opts.texi@1.61 +1 -1
+ NTP_4_2_5P75
+
+ sntp/sntp.1@1.61 +2 -2
+ NTP_4_2_5P75
+
+ util/ntp-keygen-opts.c@1.63 +2 -2
+ NTP_4_2_5P75
+
+ util/ntp-keygen-opts.h@1.63 +3 -3
+ NTP_4_2_5P75
+
+ util/ntp-keygen-opts.texi@1.62 +1 -1
+ NTP_4_2_5P75
+
+ util/ntp-keygen.1@1.62 +2 -2
+ NTP_4_2_5P75
+
+ChangeSet@1.1585, 2007-09-11 04:14:55-04:00, murray@pogo.udel.edu
+ [Bug 895] Log assertion failures via syslog(), not stderr
+
+ ChangeLog@1.109 +1 -0
+ [Bug 895] Log assertion failures via syslog(), not stderr
+
+ChangeSet@1.1436.1.84, 2007-09-10 20:40:19-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P4
+ TAG: NTP_4_2_4P4
+
+ ntpd/ntpd-opts.c@1.50.13.1 +2 -2
+ NTP_4_2_4P4
+
+ ntpd/ntpd-opts.h@1.50.13.1 +3 -3
+ NTP_4_2_4P4
+
+ ntpd/ntpd-opts.texi@1.49.13.1 +1 -1
+ NTP_4_2_4P4
+
+ ntpd/ntpd.1@1.48.13.1 +2 -2
+ NTP_4_2_4P4
+
+ ntpd/ntpdsim-opts.c@1.50.13.1 +2 -2
+ NTP_4_2_4P4
+
+ ntpd/ntpdsim-opts.h@1.50.13.1 +3 -3
+ NTP_4_2_4P4
+
+ ntpd/ntpdsim-opts.texi@1.48.13.1 +1 -1
+ NTP_4_2_4P4
+
+ ntpd/ntpdsim.1@1.48.13.1 +2 -2
+ NTP_4_2_4P4
+
+ ntpdc/ntpdc-opts.c@1.50.13.1 +2 -2
+ NTP_4_2_4P4
+
+ ntpdc/ntpdc-opts.h@1.50.13.1 +3 -3
+ NTP_4_2_4P4
+
+ ntpdc/ntpdc-opts.texi@1.48.13.1 +1 -1
+ NTP_4_2_4P4
+
+ ntpdc/ntpdc.1@1.48.13.1 +2 -2
+ NTP_4_2_4P4
+
+ ntpq/ntpq-opts.c@1.52.13.1 +2 -2
+ NTP_4_2_4P4
+
+ ntpq/ntpq-opts.h@1.52.13.1 +3 -3
+ NTP_4_2_4P4
+
+ ntpq/ntpq-opts.texi@1.49.13.1 +1 -1
+ NTP_4_2_4P4
+
+ ntpq/ntpq.1@1.48.13.1 +2 -2
+ NTP_4_2_4P4
+
+ packageinfo.sh@1.65.19.2 +2 -2
+ NTP_4_2_4P4
+
+ sntp/sntp-opts.c@1.49.13.1 +2 -2
+ NTP_4_2_4P4
+
+ sntp/sntp-opts.h@1.49.13.1 +3 -3
+ NTP_4_2_4P4
+
+ sntp/sntp-opts.texi@1.46.13.1 +1 -1
+ NTP_4_2_4P4
+
+ sntp/sntp.1@1.49.13.1 +2 -2
+ NTP_4_2_4P4
+
+ util/ntp-keygen-opts.c@1.49.13.1 +2 -2
+ NTP_4_2_4P4
+
+ util/ntp-keygen-opts.h@1.49.13.1 +3 -3
+ NTP_4_2_4P4
+
+ util/ntp-keygen-opts.texi@1.47.13.1 +1 -1
+ NTP_4_2_4P4
+
+ util/ntp-keygen.1@1.47.13.1 +2 -2
+ NTP_4_2_4P4
+
+ChangeSet@1.1436.1.83, 2007-09-10 16:56:09-04:00, stenn@whimsy.udel.edu
+ Release 4.2.4p4
+
+ ChangeLog@1.1.1.34 +3 -0
+ Release 4.2.4p4
+
+ NEWS@1.86.1.12 +11 -0
+ Release 4.2.4p4
+
+ packageinfo.sh@1.65.19.1 +1 -1
+ Release 4.2.4p4
+
+ChangeSet@1.1582.1.7, 2007-09-10 07:56:32-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P74
+ TAG: NTP_4_2_5P74
+
+ ntpd/ntpd-opts.c@1.61 +2 -2
+ NTP_4_2_5P74
+
+ ntpd/ntpd-opts.h@1.61 +3 -3
+ NTP_4_2_5P74
+
+ ntpd/ntpd-opts.texi@1.60 +1 -1
+ NTP_4_2_5P74
+
+ ntpd/ntpd.1@1.60 +2 -2
+ NTP_4_2_5P74
+
+ ntpdc/ntpdc-opts.c@1.61 +2 -2
+ NTP_4_2_5P74
+
+ ntpdc/ntpdc-opts.h@1.61 +3 -3
+ NTP_4_2_5P74
+
+ ntpdc/ntpdc-opts.texi@1.60 +1 -1
+ NTP_4_2_5P74
+
+ ntpdc/ntpdc.1@1.60 +2 -2
+ NTP_4_2_5P74
+
+ ntpq/ntpq-opts.c@1.61 +2 -2
+ NTP_4_2_5P74
+
+ ntpq/ntpq-opts.h@1.61 +3 -3
+ NTP_4_2_5P74
+
+ ntpq/ntpq-opts.texi@1.60 +1 -1
+ NTP_4_2_5P74
+
+ ntpq/ntpq.1@1.60 +2 -2
+ NTP_4_2_5P74
+
+ packageinfo.sh@1.77 +1 -1
+ NTP_4_2_5P74
+
+ sntp/sntp-opts.c@1.61 +2 -2
+ NTP_4_2_5P74
+
+ sntp/sntp-opts.h@1.61 +3 -3
+ NTP_4_2_5P74
+
+ sntp/sntp-opts.texi@1.60 +1 -1
+ NTP_4_2_5P74
+
+ sntp/sntp.1@1.60 +2 -2
+ NTP_4_2_5P74
+
+ util/ntp-keygen-opts.c@1.62 +2 -2
+ NTP_4_2_5P74
+
+ util/ntp-keygen-opts.h@1.62 +3 -3
+ NTP_4_2_5P74
+
+ util/ntp-keygen-opts.texi@1.61 +1 -1
+ NTP_4_2_5P74
+
+ util/ntp-keygen.1@1.61 +2 -2
+ NTP_4_2_5P74
+
+ChangeSet@1.1582.1.6, 2007-09-10 02:32:58-04:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ ChangeLog@1.107 +1 -0
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.42 +56 -54
+ Documentation updates from Dave Mills
+
+ html/keygen.html@1.9 +49 -59
+ Documentation updates from Dave Mills
+
+ChangeSet@1.1436.1.82, 2007-09-10 01:57:20-04:00, stenn@whimsy.udel.edu
+ [Bug 902] Fix problems with the -6 flag
+
+ ChangeLog@1.1.1.33 +1 -0
+ [Bug 902] Fix problems with the -6 flag
+
+ libopts/save.c@1.2 +11 -2
+ [Bug 902] Fix problems with the -6 flag
+
+ sntp/libopts/save.c@1.2 +11 -2
+ [Bug 902] Fix problems with the -6 flag
+
+ChangeSet@1.1582.1.4, 2007-09-09 07:10:45-04:00, stenn@whimsy.udel.edu
+ crypto fixes from Dave Mills
+
+ ChangeLog@1.105 +2 -0
+ crypto fixes from Dave Mills
+
+ include/ntp.h@1.137 +3 -3
+ crypto fixes from Dave Mills
+
+ include/ntp_control.h@1.32 +4 -6
+ crypto fixes from Dave Mills
+
+ include/ntpd.h@1.110 +1 -0
+ crypto fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.100 +12 -21
+ crypto fixes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.115 +472 -540
+ crypto fixes from Dave Mills
+
+ ntpd/ntp_peer.c@1.107 +3 -0
+ crypto fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.262 +3 -6
+ crypto fixes from Dave Mills
+
+ChangeSet@1.1582.1.3, 2007-09-09 06:48:21-04:00, stenn@whimsy.udel.edu
+ Avoid double peer stats logging
+
+ ChangeLog@1.104 +1 -0
+ Avoid double peer stats logging
+
+ ntpd/ntp_refclock.c@1.78 +0 -3
+ Avoid double peer stats logging
+
+ChangeSet@1.1582.1.2, 2007-09-09 05:30:21-04:00, stenn@whimsy.udel.edu
+ ntp-keygen cleanup from Dave Mills
+
+ ChangeLog@1.103 +1 -0
+ ntp-keygen cleanup from Dave Mills
+
+ util/ntp-keygen.c@1.44 +187 -146
+ ntp-keygen cleanup from Dave Mills
+
+ChangeSet@1.1582.1.1, 2007-09-09 05:19:17-04:00, stenn@whimsy.udel.edu
+ libopts needs to be built after ElectricFence
+
+ ChangeLog@1.102 +1 -0
+ libopts needs to be built after ElectricFence
+
+ Makefile.am@1.76 +4 -3
+ libopts needs to be built after ElectricFence
+
+ChangeSet@1.1583, 2007-09-06 16:56:06-04:00, murray@pogo.udel.edu
+ Fix for bug 895
+
+ ntpd/ntpd.c@1.89 +91 -0
+ Fix for bug 895
+
+ChangeSet@1.1582, 2007-08-29 07:48:23-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P73
+ TAG: NTP_4_2_5P73
+
+ ntpd/ntpd-opts.c@1.60 +2 -2
+ NTP_4_2_5P73
+
+ ntpd/ntpd-opts.h@1.60 +3 -3
+ NTP_4_2_5P73
+
+ ntpd/ntpd-opts.texi@1.59 +1 -1
+ NTP_4_2_5P73
+
+ ntpd/ntpd.1@1.59 +2 -2
+ NTP_4_2_5P73
+
+ ntpdc/ntpdc-opts.c@1.60 +2 -2
+ NTP_4_2_5P73
+
+ ntpdc/ntpdc-opts.h@1.60 +3 -3
+ NTP_4_2_5P73
+
+ ntpdc/ntpdc-opts.texi@1.59 +1 -1
+ NTP_4_2_5P73
+
+ ntpdc/ntpdc.1@1.59 +2 -2
+ NTP_4_2_5P73
+
+ ntpq/ntpq-opts.c@1.60 +2 -2
+ NTP_4_2_5P73
+
+ ntpq/ntpq-opts.h@1.60 +3 -3
+ NTP_4_2_5P73
+
+ ntpq/ntpq-opts.texi@1.59 +1 -1
+ NTP_4_2_5P73
+
+ ntpq/ntpq.1@1.59 +2 -2
+ NTP_4_2_5P73
+
+ packageinfo.sh@1.76 +1 -1
+ NTP_4_2_5P73
+
+ sntp/sntp-opts.c@1.60 +2 -2
+ NTP_4_2_5P73
+
+ sntp/sntp-opts.h@1.60 +3 -3
+ NTP_4_2_5P73
+
+ sntp/sntp-opts.texi@1.59 +1 -1
+ NTP_4_2_5P73
+
+ sntp/sntp.1@1.59 +2 -2
+ NTP_4_2_5P73
+
+ util/ntp-keygen-opts.c@1.61 +2 -2
+ NTP_4_2_5P73
+
+ util/ntp-keygen-opts.h@1.61 +3 -3
+ NTP_4_2_5P73
+
+ util/ntp-keygen-opts.texi@1.60 +1 -1
+ NTP_4_2_5P73
+
+ util/ntp-keygen.1@1.60 +2 -2
+ NTP_4_2_5P73
+
+ChangeSet@1.1436.1.81, 2007-08-28 15:34:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P4_RC2
+ TAG: NTP_4_2_4P4_RC2
+
+ ntpd/ntpd-opts.c@1.50.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpd/ntpd-opts.h@1.50.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpd/ntpd-opts.texi@1.49.12.1 +2 -2
+ NTP_4_2_4P4_RC2
+
+ ntpd/ntpd.1@1.48.12.1 +3 -3
+ NTP_4_2_4P4_RC2
+
+ ntpd/ntpdsim-opts.c@1.50.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpd/ntpdsim-opts.h@1.50.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpd/ntpdsim-opts.texi@1.48.12.1 +1 -1
+ NTP_4_2_4P4_RC2
+
+ ntpd/ntpdsim.1@1.48.12.1 +3 -3
+ NTP_4_2_4P4_RC2
+
+ ntpdc/ntpdc-opts.c@1.50.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpdc/ntpdc-opts.h@1.50.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpdc/ntpdc-opts.texi@1.48.12.1 +2 -2
+ NTP_4_2_4P4_RC2
+
+ ntpdc/ntpdc.1@1.48.12.1 +3 -3
+ NTP_4_2_4P4_RC2
+
+ ntpq/ntpq-opts.c@1.52.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpq/ntpq-opts.h@1.52.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ ntpq/ntpq-opts.texi@1.49.12.1 +2 -2
+ NTP_4_2_4P4_RC2
+
+ ntpq/ntpq.1@1.48.12.1 +3 -3
+ NTP_4_2_4P4_RC2
+
+ packageinfo.sh@1.65.18.1 +1 -1
+ NTP_4_2_4P4_RC2
+
+ sntp/sntp-opts.c@1.49.12.1 +2 -2
+ NTP_4_2_4P4_RC2
+
+ sntp/sntp-opts.h@1.49.12.1 +3 -3
+ NTP_4_2_4P4_RC2
+
+ sntp/sntp-opts.texi@1.46.12.1 +1 -1
+ NTP_4_2_4P4_RC2
+
+ sntp/sntp.1@1.49.12.1 +2 -2
+ NTP_4_2_4P4_RC2
+
+ util/ntp-keygen-opts.c@1.49.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ util/ntp-keygen-opts.h@1.49.12.1 +4 -4
+ NTP_4_2_4P4_RC2
+
+ util/ntp-keygen-opts.texi@1.47.12.1 +2 -2
+ NTP_4_2_4P4_RC2
+
+ util/ntp-keygen.1@1.47.12.1 +3 -3
+ NTP_4_2_4P4_RC2
+
+ChangeSet@1.1580, 2007-08-28 07:52:12-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P72
+ TAG: NTP_4_2_5P72
+
+ ntpd/ntpd-opts.c@1.59 +4 -4
+ NTP_4_2_5P72
+
+ ntpd/ntpd-opts.h@1.59 +4 -4
+ NTP_4_2_5P72
+
+ ntpd/ntpd-opts.texi@1.58 +2 -2
+ NTP_4_2_5P72
+
+ ntpd/ntpd.1@1.58 +3 -3
+ NTP_4_2_5P72
+
+ ntpdc/ntpdc-opts.c@1.59 +4 -4
+ NTP_4_2_5P72
+
+ ntpdc/ntpdc-opts.h@1.59 +4 -4
+ NTP_4_2_5P72
+
+ ntpdc/ntpdc-opts.texi@1.58 +2 -2
+ NTP_4_2_5P72
+
+ ntpdc/ntpdc.1@1.58 +3 -3
+ NTP_4_2_5P72
+
+ ntpq/ntpq-opts.c@1.59 +4 -4
+ NTP_4_2_5P72
+
+ ntpq/ntpq-opts.h@1.59 +4 -4
+ NTP_4_2_5P72
+
+ ntpq/ntpq-opts.texi@1.58 +2 -2
+ NTP_4_2_5P72
+
+ ntpq/ntpq.1@1.58 +3 -3
+ NTP_4_2_5P72
+
+ packageinfo.sh@1.75 +1 -1
+ NTP_4_2_5P72
+
+ sntp/sntp-opts.c@1.59 +2 -2
+ NTP_4_2_5P72
+
+ sntp/sntp-opts.h@1.59 +3 -3
+ NTP_4_2_5P72
+
+ sntp/sntp-opts.texi@1.58 +1 -1
+ NTP_4_2_5P72
+
+ sntp/sntp.1@1.58 +2 -2
+ NTP_4_2_5P72
+
+ util/ntp-keygen-opts.c@1.60 +6 -5
+ NTP_4_2_5P72
+
+ util/ntp-keygen-opts.h@1.60 +4 -4
+ NTP_4_2_5P72
+
+ util/ntp-keygen-opts.texi@1.59 +2 -2
+ NTP_4_2_5P72
+
+ util/ntp-keygen.1@1.59 +4 -4
+ NTP_4_2_5P72
+
+ChangeSet@1.1579, 2007-08-28 00:00:03-04:00, stenn@whimsy.udel.edu
+ [Bug 894] Initialize keysdir before calling crypto_setup()
+
+ ChangeLog@1.101 +1 -0
+ [Bug 894] Initialize keysdir before calling crypto_setup()
+
+ChangeSet@1.1576.1.2, 2007-08-27 23:42:20-04:00, stenn@whimsy.udel.edu
+ ntp-keygen-opts.def:
+ ntp-keygen -i takes an arg
+ ntpq.c:
+ Calysto cleanup for ntpq.
+ Many files:
+ Cleanup from Dave Mills
+ ChangeLog:
+ Cleanup from Dave Mills.
+ Coverity fix for ntpq.
+ ntp-keygen -i takes an arg.
+
+ ChangeLog@1.100 +3 -0
+ Cleanup from Dave Mills.
+ Coverity fix for ntpq.
+ ntp-keygen -i takes an arg.
+
+ include/ntp.h@1.136 +3 -5
+ Cleanup from Dave Mills
+
+ include/ntp_crypto.h@1.42 +20 -14
+ Cleanup from Dave Mills
+
+ include/ntpd.h@1.109 +2 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_control.c@1.99 +23 -28
+ Cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.114 +337 -345
+ Cleanup from Dave Mills
+
+ ntpd/ntp_parser.c@1.20 +578 -586
+ Cleanup from Dave Mills
+
+ ntpd/ntp_parser.y@1.16 +0 -2
+ Cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.261 +30 -43
+ Cleanup from Dave Mills
+
+ ntpq/ntpq.c@1.70 +2 -0
+ Calysto cleanup for ntpq.
+
+ util/ntp-keygen-opts.def@1.9 +2 -0
+ ntp-keygen -i takes an arg
+
+ util/ntp-keygen.c@1.43 +188 -200
+ Cleanup from Dave Mills
+
+ChangeSet@1.1436.1.80, 2007-08-27 22:38:57-04:00, stenn@whimsy.udel.edu
+ Updated include/copyright.def (owner and year)
+
+ ChangeLog@1.1.1.32 +1 -0
+ Updated include/copyright.def (owner and year)
+
+ include/copyright.def@1.5 +2 -2
+ Updated include/copyright.def (owner and year)
+
+ChangeSet@1.1577, 2007-08-25 13:22:24+00:00, kardel@pogo.udel.edu
+ ntp_config.c:
+ Bug 894: initialize keysdir BEFORE crypto_setup() is called - so it has a fair
+ chance to find the keys.
+
+ ntpd/ntp_config.c@1.164 +5 -4
+ Bug 894: initialize keysdir BEFORE crypto_setup() is called - so it has a fair
+ chance to find the keys.
+
+ChangeSet@1.1576, 2007-08-19 07:45:24-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P71
+ TAG: NTP_4_2_5P71
+
+ ntpd/ntpd-opts.c@1.58 +2 -2
+ NTP_4_2_5P71
+
+ ntpd/ntpd-opts.h@1.58 +3 -3
+ NTP_4_2_5P71
+
+ ntpd/ntpd-opts.texi@1.57 +1 -1
+ NTP_4_2_5P71
+
+ ntpd/ntpd.1@1.57 +2 -2
+ NTP_4_2_5P71
+
+ ntpdc/ntpdc-opts.c@1.58 +2 -2
+ NTP_4_2_5P71
+
+ ntpdc/ntpdc-opts.h@1.58 +3 -3
+ NTP_4_2_5P71
+
+ ntpdc/ntpdc-opts.texi@1.57 +1 -1
+ NTP_4_2_5P71
+
+ ntpdc/ntpdc.1@1.57 +2 -2
+ NTP_4_2_5P71
+
+ ntpq/ntpq-opts.c@1.58 +2 -2
+ NTP_4_2_5P71
+
+ ntpq/ntpq-opts.h@1.58 +3 -3
+ NTP_4_2_5P71
+
+ ntpq/ntpq-opts.texi@1.57 +1 -1
+ NTP_4_2_5P71
+
+ ntpq/ntpq.1@1.57 +2 -2
+ NTP_4_2_5P71
+
+ packageinfo.sh@1.74 +1 -1
+ NTP_4_2_5P71
+
+ sntp/sntp-opts.c@1.58 +2 -2
+ NTP_4_2_5P71
+
+ sntp/sntp-opts.h@1.58 +3 -3
+ NTP_4_2_5P71
+
+ sntp/sntp-opts.texi@1.57 +1 -1
+ NTP_4_2_5P71
+
+ sntp/sntp.1@1.57 +2 -2
+ NTP_4_2_5P71
+
+ util/ntp-keygen-opts.c@1.59 +2 -2
+ NTP_4_2_5P71
+
+ util/ntp-keygen-opts.h@1.59 +3 -3
+ NTP_4_2_5P71
+
+ util/ntp-keygen-opts.texi@1.58 +1 -1
+ NTP_4_2_5P71
+
+ util/ntp-keygen.1@1.58 +2 -2
+ NTP_4_2_5P71
+
+ChangeSet@1.1436.1.79, 2007-08-19 05:26:13-04:00, dunlop@pogo.udel.edu
+ ntpdc_ops.c, ChangeLog:
+ [BUG 881] Corrected display of pll offset on 64bit systems.
+ [BUG 886] Corrected sign extension of il->compliance on 64 bit systems
+ [BUG 878] Avoid ntpdc use of refid value as unterminated string.
+
+ ChangeLog@1.1.1.31 +1 -0
+ [Bug 878] Avoid ntpdc use of refid value as unterminated string.
+
+ ChangeLog@1.1.1.30 +1 -0
+ [Bug 881] Corrected display of pll offset on 64bit systems.
+
+ ChangeLog@1.1.1.29 +1 -0
+ [BUG 886] Corrected sign extension of il->compliance on 64 bit systems
+
+ ntpdc/ntpdc_ops.c@1.46.1.3 +1 -3
+ [Bug 878] Avoid ntpdc use of refid value as unterminated string.
+
+ ntpdc/ntpdc_ops.c@1.46.1.2 +1 -1
+ [Bug 881] Corrected display of pll offset on 64bit systems.
+
+ ntpdc/ntpdc_ops.c@1.46.1.1 +2 -2
+ [BUG 886] Corrected sign extension of il->compliance on 64 bit systems
+
+ChangeSet@1.1575, 2007-08-19 08:35:04+00:00, stenn@ntp1.isc.org
+ [Bug 887] Fix error in ntp_types.h (for sizeof int != 4)
+
+ ChangeLog@1.98 +1 -0
+ [Bug 887] Fix error in ntp_types.h (for sizeof int != 4)
+
+ dot.emacs@1.8 +4 -3
+ updates
+
+ include/ntp_types.h@1.10 +2 -2
+ [Bug 887] Fix error in ntp_types.h (for sizeof int != 4)
+
+ChangeSet@1.1574, 2007-08-18 19:14:33-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P70
+ TAG: NTP_4_2_5P70
+
+ ntpd/ntpd-opts.c@1.57 +2 -2
+ NTP_4_2_5P70
+
+ ntpd/ntpd-opts.h@1.57 +3 -3
+ NTP_4_2_5P70
+
+ ntpd/ntpd-opts.texi@1.56 +1 -1
+ NTP_4_2_5P70
+
+ ntpd/ntpd.1@1.56 +2 -2
+ NTP_4_2_5P70
+
+ ntpdc/ntpdc-opts.c@1.57 +2 -2
+ NTP_4_2_5P70
+
+ ntpdc/ntpdc-opts.h@1.57 +3 -3
+ NTP_4_2_5P70
+
+ ntpdc/ntpdc-opts.texi@1.56 +1 -1
+ NTP_4_2_5P70
+
+ ntpdc/ntpdc.1@1.56 +2 -2
+ NTP_4_2_5P70
+
+ ntpq/ntpq-opts.c@1.57 +2 -2
+ NTP_4_2_5P70
+
+ ntpq/ntpq-opts.h@1.57 +3 -3
+ NTP_4_2_5P70
+
+ ntpq/ntpq-opts.texi@1.56 +1 -1
+ NTP_4_2_5P70
+
+ ntpq/ntpq.1@1.56 +2 -2
+ NTP_4_2_5P70
+
+ packageinfo.sh@1.73 +1 -1
+ NTP_4_2_5P70
+
+ sntp/sntp-opts.c@1.57 +2 -2
+ NTP_4_2_5P70
+
+ sntp/sntp-opts.h@1.57 +3 -3
+ NTP_4_2_5P70
+
+ sntp/sntp-opts.texi@1.56 +1 -1
+ NTP_4_2_5P70
+
+ sntp/sntp.1@1.56 +2 -2
+ NTP_4_2_5P70
+
+ util/ntp-keygen-opts.c@1.58 +2 -2
+ NTP_4_2_5P70
+
+ util/ntp-keygen-opts.h@1.58 +3 -3
+ NTP_4_2_5P70
+
+ util/ntp-keygen-opts.texi@1.57 +1 -1
+ NTP_4_2_5P70
+
+ util/ntp-keygen.1@1.57 +2 -2
+ NTP_4_2_5P70
+
+ChangeSet@1.1436.1.78, 2007-08-18 17:11:19-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P4_RC1
+ TAG: NTP_4_2_4P4_RC1
+
+ ntpd/ntpd-opts.c@1.50.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpd/ntpd-opts.h@1.50.11.1 +3 -3
+ NTP_4_2_4P4_RC1
+
+ ntpd/ntpd-opts.texi@1.49.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpd/ntpd.1@1.48.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.11.1 +3 -3
+ NTP_4_2_4P4_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.11.1 +1 -1
+ NTP_4_2_4P4_RC1
+
+ ntpd/ntpdsim.1@1.48.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.11.1 +3 -3
+ NTP_4_2_4P4_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpdc/ntpdc.1@1.48.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpq/ntpq-opts.c@1.52.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpq/ntpq-opts.h@1.52.11.1 +3 -3
+ NTP_4_2_4P4_RC1
+
+ ntpq/ntpq-opts.texi@1.49.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ ntpq/ntpq.1@1.48.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ packageinfo.sh@1.65.17.2 +2 -2
+ NTP_4_2_4P4_RC1
+
+ sntp/sntp-opts.c@1.49.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ sntp/sntp-opts.h@1.49.11.1 +3 -3
+ NTP_4_2_4P4_RC1
+
+ sntp/sntp-opts.texi@1.46.11.1 +1 -1
+ NTP_4_2_4P4_RC1
+
+ sntp/sntp.1@1.49.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ util/ntp-keygen-opts.c@1.49.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ util/ntp-keygen-opts.h@1.49.11.1 +3 -3
+ NTP_4_2_4P4_RC1
+
+ util/ntp-keygen-opts.texi@1.47.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ util/ntp-keygen.1@1.47.11.1 +2 -2
+ NTP_4_2_4P4_RC1
+
+ChangeSet@1.1436.1.77, 2007-08-18 16:16:22-04:00, stenn@whimsy.udel.edu
+ 4.2.4p4-RC
+
+ packageinfo.sh@1.65.17.1 +1 -1
+ 4.2.4p4-RC
+
+ChangeSet@1.1436.1.76, 2007-08-18 12:59:45+00:00, kardel@pogo.udel.edu
+ ntp_restrict.c:
+ Bug 885: clarify to allow tools to pick up
+ invariants easier.
+ Use NULL instead of 0 with pointers.
+ ChangeLog:
+ document ntp_restrict.c change
+
+ ChangeLog@1.1.1.28 +1 -0
+ document ntp_restrict.c change
+
+ ntpd/ntp_restrict.c@1.22.1.1 +21 -21
+ Bug 885: clarify to allow tools to pick up
+ invariants easier.
+ Use NULL instead of 0 with pointers.
+
+ChangeSet@1.1436.1.75, 2007-08-18 12:53:35+00:00, kardel@pogo.udel.edu
+ recvbuff.c:
+ Bug 889: avoid malloc() interrupted by SIGIO risk
+ ChangeLog:
+ document Bug 889
+
+ ChangeLog@1.1.1.27 +1 -0
+ document Bug 889
+
+ libntp/recvbuff.c@1.26 +28 -21
+ Bug 889: avoid malloc() interrupted by SIGIO risk
+
+ChangeSet@1.1572, 2007-08-18 07:46:58-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P69
+ TAG: NTP_4_2_5P69
+
+ ntpd/ntpd-opts.c@1.56 +2 -2
+ NTP_4_2_5P69
+
+ ntpd/ntpd-opts.h@1.56 +3 -3
+ NTP_4_2_5P69
+
+ ntpd/ntpd-opts.texi@1.55 +1 -1
+ NTP_4_2_5P69
+
+ ntpd/ntpd.1@1.55 +2 -2
+ NTP_4_2_5P69
+
+ ntpdc/ntpdc-opts.c@1.56 +2 -2
+ NTP_4_2_5P69
+
+ ntpdc/ntpdc-opts.h@1.56 +3 -3
+ NTP_4_2_5P69
+
+ ntpdc/ntpdc-opts.texi@1.55 +1 -1
+ NTP_4_2_5P69
+
+ ntpdc/ntpdc.1@1.55 +2 -2
+ NTP_4_2_5P69
+
+ ntpq/ntpq-opts.c@1.56 +2 -2
+ NTP_4_2_5P69
+
+ ntpq/ntpq-opts.h@1.56 +3 -3
+ NTP_4_2_5P69
+
+ ntpq/ntpq-opts.texi@1.55 +1 -1
+ NTP_4_2_5P69
+
+ ntpq/ntpq.1@1.55 +2 -2
+ NTP_4_2_5P69
+
+ packageinfo.sh@1.72 +1 -1
+ NTP_4_2_5P69
+
+ sntp/sntp-opts.c@1.56 +2 -2
+ NTP_4_2_5P69
+
+ sntp/sntp-opts.h@1.56 +3 -3
+ NTP_4_2_5P69
+
+ sntp/sntp-opts.texi@1.55 +1 -1
+ NTP_4_2_5P69
+
+ sntp/sntp.1@1.55 +2 -2
+ NTP_4_2_5P69
+
+ util/ntp-keygen-opts.c@1.57 +2 -2
+ NTP_4_2_5P69
+
+ util/ntp-keygen-opts.h@1.57 +3 -3
+ NTP_4_2_5P69
+
+ util/ntp-keygen-opts.texi@1.56 +1 -1
+ NTP_4_2_5P69
+
+ util/ntp-keygen.1@1.56 +2 -2
+ NTP_4_2_5P69
+
+ChangeSet@1.1436.1.74, 2007-08-18 09:51:41+00:00, kardel@pogo.udel.edu
+ cmd_args.c:
+ Bug 885: fix comparison
+
+ ntpd/cmd_args.c@1.45.3.2 +1 -1
+ Bug 885: fix comparison
+
+ChangeSet@1.1570, 2007-08-18 04:07:51-04:00, stenn@pogo.udel.edu
+ merge cleanup
+
+ ChangeLog@1.95.1.2 +13 -0
+ merge cleanup
+
+ChangeSet@1.1564.2.2, 2007-08-17 07:46:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P68
+ TAG: NTP_4_2_5P68
+
+ ntpd/ntpd-opts.c@1.55 +2 -2
+ NTP_4_2_5P68
+
+ ntpd/ntpd-opts.h@1.55 +3 -3
+ NTP_4_2_5P68
+
+ ntpd/ntpd-opts.texi@1.54 +2 -2
+ NTP_4_2_5P68
+
+ ntpd/ntpd.1@1.54 +2 -2
+ NTP_4_2_5P68
+
+ ntpdc/ntpdc-opts.c@1.55 +2 -2
+ NTP_4_2_5P68
+
+ ntpdc/ntpdc-opts.h@1.55 +3 -3
+ NTP_4_2_5P68
+
+ ntpdc/ntpdc-opts.texi@1.54 +2 -2
+ NTP_4_2_5P68
+
+ ntpdc/ntpdc.1@1.54 +2 -2
+ NTP_4_2_5P68
+
+ ntpq/ntpq-opts.c@1.55 +2 -2
+ NTP_4_2_5P68
+
+ ntpq/ntpq-opts.h@1.55 +3 -3
+ NTP_4_2_5P68
+
+ ntpq/ntpq-opts.texi@1.54 +2 -2
+ NTP_4_2_5P68
+
+ ntpq/ntpq.1@1.54 +2 -2
+ NTP_4_2_5P68
+
+ packageinfo.sh@1.71 +1 -1
+ NTP_4_2_5P68
+
+ sntp/sntp-opts.c@1.55 +2 -2
+ NTP_4_2_5P68
+
+ sntp/sntp-opts.h@1.55 +3 -3
+ NTP_4_2_5P68
+
+ sntp/sntp-opts.texi@1.54 +1 -1
+ NTP_4_2_5P68
+
+ sntp/sntp.1@1.54 +2 -2
+ NTP_4_2_5P68
+
+ util/ntp-keygen-opts.c@1.56 +2 -2
+ NTP_4_2_5P68
+
+ util/ntp-keygen-opts.h@1.56 +3 -3
+ NTP_4_2_5P68
+
+ util/ntp-keygen-opts.texi@1.55 +2 -2
+ NTP_4_2_5P68
+
+ util/ntp-keygen.1@1.55 +2 -2
+ NTP_4_2_5P68
+
+ChangeSet@1.1436.6.1, 2007-08-17 05:28:07-04:00, stenn@pogo.udel.edu
+ Use autoconf-2.59 and automake-1.9 for building 4.2.4
+
+ bootstrap@1.18.1.1 +18 -2
+ Use autoconf-2.59 and automake-1.9 for building 4.2.4
+
+ChangeSet@1.1564.2.1, 2007-08-17 01:38:48-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ html/assoc.html@1.22 +22 -13
+ Cleanup from Dave Mills
+
+ html/index.html@1.34 +6 -6
+ Cleanup from Dave Mills
+
+ html/release.html@1.32 +7 -9
+ Cleanup from Dave Mills
+
+ include/ntp.h@1.135 +11 -10
+ Cleanup from Dave Mills
+
+ include/ntp_crypto.h@1.41 +21 -17
+ Cleanup from Dave Mills
+
+ include/ntp_refclock.h@1.22 +1 -1
+ Cleanup from Dave Mills
+
+ include/ntp_request.h@1.33 +2 -2
+ Cleanup from Dave Mills
+
+ include/ntpd.h@1.108 +12 -12
+ Cleanup from Dave Mills
+
+ libntp/statestr.c@1.12 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_config.c@1.161.1.1 +6 -9
+ Cleanup from Dave Mills
+
+ ntpd/ntp_control.c@1.98 +8 -5
+ Cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.113 +175 -101
+ Cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.139 +85 -77
+ Cleanup from Dave Mills
+
+ ntpd/ntp_parser.c@1.19 +239 -261
+ Cleanup from Dave Mills
+
+ ntpd/ntp_parser.y@1.15 +1 -23
+ Cleanup from Dave Mills
+
+ ntpd/ntp_peer.c@1.106 +4 -14
+ Cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.260 +390 -490
+ Cleanup from Dave Mills
+
+ ntpd/ntp_refclock.c@1.77 +4 -6
+ Cleanup from Dave Mills
+
+ ntpd/ntp_request.c@1.69 +4 -4
+ Cleanup from Dave Mills
+
+ ntpd/ntp_restrict.c@1.23 +2 -2
+ Cleanup from Dave Mills
+
+ ntpd/ntp_timer.c@1.40 +7 -20
+ Cleanup from Dave Mills
+
+ ntpd/ntp_util.c@1.59 +1 -3
+ Cleanup from Dave Mills
+
+ ntpd/ntpd.c@1.88 +6 -21
+ Cleanup from Dave Mills
+
+ ntpd/ntpsim.c@1.18 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.31 +1 -3
+ Cleanup from Dave Mills
+
+ ntpdate/ntpdate.c@1.63 +2 -2
+ Cleanup from Dave Mills
+
+ ntpdate/ntpdate.h@1.9 +1 -1
+ Cleanup from Dave Mills
+
+ ntpq/ntpq.c@1.69 +4 -4
+ Cleanup from Dave Mills
+
+ChangeSet@1.1564.1.4, 2007-08-14 23:01:09-04:00, mayer@pogo.udel.edu
+ Bug 880 fixes
+
+ ChangeLog@1.96 +1 -0
+ Bug 880 fixes
+
+ChangeSet@1.1564.1.3, 2007-08-14 22:55:12-04:00, mayer@pogo.udel.edu
+ Bug 880 bug fixes for Windows build
+
+ ntpd/ntp_data_structures.c@1.6 +1 -0
+ Bug 880 Include missing. Needed for emalloc prototype
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.24 +1 -1
+ Bug 880 Use leap_sec instead of leap_next
+
+ChangeSet@1.1436.1.72, 2007-08-11 17:32:22+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ document refclock_parse.c fix
+
+ ChangeLog@1.1.1.26 +1 -0
+ document refclock_parse.c fix
+
+ChangeSet@1.1436.1.71, 2007-08-11 17:30:42+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ document Bug 885
+ ntp_io.c:
+ Bug 885: use emalloc() to get a message at the end of the memory
+ cmd_args.c:
+ Bug 885: unsigned types cannot be less than 0
+ default_ai_family is a short
+ ntp_config.c:
+ Bug 885: lose trailing , from enum list
+
+ ChangeLog@1.1.1.25 +4 -0
+ document Bug 885
+
+ ntpd/cmd_args.c@1.45.3.1 +2 -2
+ Bug 885: unsigned types cannot be less than 0
+ default_ai_family is a short
+
+ ntpd/ntp_config.c@1.141.1.1 +1 -1
+ Bug 885: lose trailing , from enum list
+
+ ntpd/ntp_io.c@1.244.2.9 +1 -1
+ Bug 885: use emalloc() to get a message at the end of the memory
+
+ChangeSet@1.1436.1.70, 2007-08-11 17:19:45+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ remove io binding before io_closeclock() closes the file descriptor
+
+ ntpd/refclock_parse.c@1.47.1.1 +25 -10
+ remove io binding before io_closeclock() closes the file descriptor
+
+ChangeSet@1.1436.1.69, 2007-08-09 20:30:55+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ [Bug 882] allow loopback interfaces to share addresses with other interfaces.
+ [Bug 884] don't access recv buffers after having them passed to the free list.
+
+ ChangeLog@1.1.1.24 +3 -0
+ [Bug 882] allow loopback interfaces to share addresses with other interfaces.
+ [Bug 884] don't access recv buffers after having them passed to the free list.
+
+ChangeSet@1.1436.1.68, 2007-08-09 19:05:17+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ Bug 884: no access to recv buffers after they are returned to free pool
+
+ ntpd/ntp_io.c@1.244.2.8 +9 -7
+ Bug 884: no access to recv buffers after they are returned to free pool
+
+ChangeSet@1.1564.1.2, 2007-08-09 07:43:48-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P67
+ TAG: NTP_4_2_5P67
+
+ ntpd/ntpd-opts.c@1.54 +2 -2
+ NTP_4_2_5P67
+
+ ntpd/ntpd-opts.h@1.54 +3 -3
+ NTP_4_2_5P67
+
+ ntpd/ntpd-opts.texi@1.53 +2 -2
+ NTP_4_2_5P67
+
+ ntpd/ntpd.1@1.53 +2 -2
+ NTP_4_2_5P67
+
+ ntpdc/ntpdc-opts.c@1.54 +2 -2
+ NTP_4_2_5P67
+
+ ntpdc/ntpdc-opts.h@1.54 +3 -3
+ NTP_4_2_5P67
+
+ ntpdc/ntpdc-opts.texi@1.53 +2 -2
+ NTP_4_2_5P67
+
+ ntpdc/ntpdc.1@1.53 +2 -2
+ NTP_4_2_5P67
+
+ ntpq/ntpq-opts.c@1.54 +2 -2
+ NTP_4_2_5P67
+
+ ntpq/ntpq-opts.h@1.54 +3 -3
+ NTP_4_2_5P67
+
+ ntpq/ntpq-opts.texi@1.53 +2 -2
+ NTP_4_2_5P67
+
+ ntpq/ntpq.1@1.53 +2 -2
+ NTP_4_2_5P67
+
+ packageinfo.sh@1.70 +1 -1
+ NTP_4_2_5P67
+
+ sntp/sntp-opts.c@1.54 +2 -2
+ NTP_4_2_5P67
+
+ sntp/sntp-opts.h@1.54 +3 -3
+ NTP_4_2_5P67
+
+ sntp/sntp-opts.texi@1.53 +1 -1
+ NTP_4_2_5P67
+
+ sntp/sntp.1@1.53 +2 -2
+ NTP_4_2_5P67
+
+ util/ntp-keygen-opts.c@1.55 +2 -2
+ NTP_4_2_5P67
+
+ util/ntp-keygen-opts.h@1.55 +3 -3
+ NTP_4_2_5P67
+
+ util/ntp-keygen-opts.texi@1.54 +2 -2
+ NTP_4_2_5P67
+
+ util/ntp-keygen.1@1.54 +2 -2
+ NTP_4_2_5P67
+
+ChangeSet@1.1564.1.1, 2007-08-08 20:33:49-04:00, stenn@whimsy.udel.edu
+ Improve Calysto support
+
+ ChangeLog@1.95 +1 -0
+ Improve Calysto support
+
+ include/ntp_assert.h@1.2 +12 -0
+ Improve Calysto support
+
+ChangeSet@1.1436.1.67, 2007-08-07 18:14:16+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ Bug 882: loopback interfaces may share IP addresses with other interfaces
+ thus allow addresses also found on loopback interfaces to be used
+ as local address.
+
+ ntpd/ntp_io.c@1.244.2.7 +1 -1
+ Bug 882: loopback interfaces may share IP addresses with other interfaces
+ thus allow addresses also found on loopback interfaces to be used
+ as local address.
+
+ChangeSet@1.1564, 2007-08-07 07:44:49-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P66
+ TAG: NTP_4_2_5P66
+
+ ntpd/ntpd-opts.c@1.53 +2 -2
+ NTP_4_2_5P66
+
+ ntpd/ntpd-opts.h@1.53 +3 -3
+ NTP_4_2_5P66
+
+ ntpd/ntpd-opts.texi@1.52 +1 -1
+ NTP_4_2_5P66
+
+ ntpd/ntpd.1@1.52 +2 -2
+ NTP_4_2_5P66
+
+ ntpdc/ntpdc-opts.c@1.53 +2 -2
+ NTP_4_2_5P66
+
+ ntpdc/ntpdc-opts.h@1.53 +3 -3
+ NTP_4_2_5P66
+
+ ntpdc/ntpdc-opts.texi@1.52 +1 -1
+ NTP_4_2_5P66
+
+ ntpdc/ntpdc.1@1.52 +2 -2
+ NTP_4_2_5P66
+
+ ntpq/ntpq-opts.c@1.53 +2 -2
+ NTP_4_2_5P66
+
+ ntpq/ntpq-opts.h@1.53 +3 -3
+ NTP_4_2_5P66
+
+ ntpq/ntpq-opts.texi@1.52 +1 -1
+ NTP_4_2_5P66
+
+ ntpq/ntpq.1@1.52 +2 -2
+ NTP_4_2_5P66
+
+ packageinfo.sh@1.69 +1 -1
+ NTP_4_2_5P66
+
+ sntp/sntp-opts.c@1.53 +2 -2
+ NTP_4_2_5P66
+
+ sntp/sntp-opts.h@1.53 +3 -3
+ NTP_4_2_5P66
+
+ sntp/sntp-opts.texi@1.52 +1 -1
+ NTP_4_2_5P66
+
+ sntp/sntp.1@1.52 +2 -2
+ NTP_4_2_5P66
+
+ util/ntp-keygen-opts.c@1.54 +2 -2
+ NTP_4_2_5P66
+
+ util/ntp-keygen-opts.h@1.54 +3 -3
+ NTP_4_2_5P66
+
+ util/ntp-keygen-opts.texi@1.53 +1 -1
+ NTP_4_2_5P66
+
+ util/ntp-keygen.1@1.53 +2 -2
+ NTP_4_2_5P66
+
+ChangeSet@1.1563, 2007-08-07 03:10:48-04:00, stenn@whimsy.udel.edu
+ The "revoke" parameter is a crypto command
+
+ ChangeLog@1.94 +1 -0
+ The "revoke" parameter is a crypto command
+
+ ntpd/ntp_parser.c@1.18 +183 -193
+ The "revoke" parameter is a crypto command
+
+ ntpd/ntp_parser.y@1.14 +11 -11
+ The "revoke" parameter is a crypto command
+
+ChangeSet@1.1562, 2007-08-07 01:21:53-04:00, stenn@whimsy.udel.edu
+ The driftfile wander threshold is a real number
+
+ ChangeLog@1.93 +1 -0
+ The driftfile wander threshold is a real number
+
+ ntpd/ntp_parser.c@1.17 +151 -141
+ The driftfile wander threshold is a real number
+
+ChangeSet@1.1561, 2007-08-05 07:44:12-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P65
+ TAG: NTP_4_2_5P65
+
+ ntpd/ntpd-opts.c@1.52 +2 -2
+ NTP_4_2_5P65
+
+ ntpd/ntpd-opts.h@1.52 +3 -3
+ NTP_4_2_5P65
+
+ ntpd/ntpd-opts.texi@1.51 +1 -1
+ NTP_4_2_5P65
+
+ ntpd/ntpd.1@1.51 +2 -2
+ NTP_4_2_5P65
+
+ ntpdc/ntpdc-opts.c@1.52 +2 -2
+ NTP_4_2_5P65
+
+ ntpdc/ntpdc-opts.h@1.52 +3 -3
+ NTP_4_2_5P65
+
+ ntpdc/ntpdc-opts.texi@1.51 +1 -1
+ NTP_4_2_5P65
+
+ ntpdc/ntpdc.1@1.51 +2 -2
+ NTP_4_2_5P65
+
+ ntpq/ntpq-opts.c@1.52 +2 -2
+ NTP_4_2_5P65
+
+ ntpq/ntpq-opts.h@1.52 +3 -3
+ NTP_4_2_5P65
+
+ ntpq/ntpq-opts.texi@1.51 +1 -1
+ NTP_4_2_5P65
+
+ ntpq/ntpq.1@1.51 +2 -2
+ NTP_4_2_5P65
+
+ packageinfo.sh@1.68 +1 -1
+ NTP_4_2_5P65
+
+ sntp/sntp-opts.c@1.52 +2 -2
+ NTP_4_2_5P65
+
+ sntp/sntp-opts.h@1.52 +3 -3
+ NTP_4_2_5P65
+
+ sntp/sntp-opts.texi@1.51 +1 -1
+ NTP_4_2_5P65
+
+ sntp/sntp.1@1.51 +2 -2
+ NTP_4_2_5P65
+
+ util/ntp-keygen-opts.c@1.53 +2 -2
+ NTP_4_2_5P65
+
+ util/ntp-keygen-opts.h@1.53 +3 -3
+ NTP_4_2_5P65
+
+ util/ntp-keygen-opts.texi@1.52 +1 -1
+ NTP_4_2_5P65
+
+ util/ntp-keygen.1@1.52 +2 -2
+ NTP_4_2_5P65
+
+ChangeSet@1.1560, 2007-08-04 16:51:04-04:00, stenn@whimsy.udel.edu
+ [Bug 850] Fix the wander threshold parameter on the driftfile command
+
+ ChangeLog@1.92 +1 -0
+ [Bug 850] Fix the wander threshold parameter on the driftfile command
+
+ ntpd/ntp_parser.c@1.16 +142 -152
+ [Bug 850] Fix the wander threshold parameter on the driftfile command
+
+ ntpd/ntp_parser.y@1.13 +1 -1
+ [Bug 850] Fix the wander threshold parameter on the driftfile command
+
+ChangeSet@1.1559, 2007-07-30 07:45:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P64
+ TAG: NTP_4_2_5P64
+
+ ntpd/ntpd-opts.c@1.51 +2 -2
+ NTP_4_2_5P64
+
+ ntpd/ntpd-opts.h@1.51 +3 -3
+ NTP_4_2_5P64
+
+ ntpd/ntpd-opts.texi@1.50 +2 -2
+ NTP_4_2_5P64
+
+ ntpd/ntpd.1@1.50 +2 -2
+ NTP_4_2_5P64
+
+ ntpdc/ntpdc-opts.c@1.51 +2 -2
+ NTP_4_2_5P64
+
+ ntpdc/ntpdc-opts.h@1.51 +3 -3
+ NTP_4_2_5P64
+
+ ntpdc/ntpdc-opts.texi@1.50 +2 -2
+ NTP_4_2_5P64
+
+ ntpdc/ntpdc.1@1.50 +2 -2
+ NTP_4_2_5P64
+
+ ntpq/ntpq-opts.c@1.51 +2 -2
+ NTP_4_2_5P64
+
+ ntpq/ntpq-opts.h@1.51 +3 -3
+ NTP_4_2_5P64
+
+ ntpq/ntpq-opts.texi@1.50 +2 -2
+ NTP_4_2_5P64
+
+ ntpq/ntpq.1@1.50 +2 -2
+ NTP_4_2_5P64
+
+ packageinfo.sh@1.67 +1 -1
+ NTP_4_2_5P64
+
+ sntp/sntp-opts.c@1.51 +2 -2
+ NTP_4_2_5P64
+
+ sntp/sntp-opts.h@1.51 +3 -3
+ NTP_4_2_5P64
+
+ sntp/sntp-opts.texi@1.50 +1 -1
+ NTP_4_2_5P64
+
+ sntp/sntp.1@1.50 +2 -2
+ NTP_4_2_5P64
+
+ util/ntp-keygen-opts.c@1.52 +2 -2
+ NTP_4_2_5P64
+
+ util/ntp-keygen-opts.h@1.52 +3 -3
+ NTP_4_2_5P64
+
+ util/ntp-keygen-opts.texi@1.51 +2 -2
+ NTP_4_2_5P64
+
+ util/ntp-keygen.1@1.51 +2 -2
+ NTP_4_2_5P64
+
+ChangeSet@1.1558, 2007-07-29 15:44:57-04:00, stenn@whimsy.udel.edu
+ ntp_peer.c, ChangeLog:
+ Set peer->srcadr before (not after) calling set_peerdstadr()
+ ntp_util.c, ChangeLog:
+ Leap file related cleanup from Dave Mills
+ ntp_io.c, ChangeLog:
+ Dead code cleanup - Coverity View 19
+
+ ChangeLog@1.91 +1 -0
+ Dead code cleanup - Coverity View 19
+
+ ChangeLog@1.90 +1 -0
+ Leap file related cleanup from Dave Mills
+
+ ChangeLog@1.89 +1 -0
+ Set peer->srcadr before (not after) calling set_peerdstadr()
+
+ ntpd/ntp_io.c@1.259 +0 -13
+ Dead code cleanup - Coverity View 19
+
+ ntpd/ntp_peer.c@1.105 +11 -15
+ Set peer->srcadr before (not after) calling set_peerdstadr()
+
+ ntpd/ntp_util.c@1.58 +21 -37
+ Leap file related cleanup from Dave Mills
+
+ChangeSet@1.1557, 2007-07-29 07:44:44-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P63
+ TAG: NTP_4_2_5P63
+
+ ntpd/ntpd-opts.c@1.50 +2 -2
+ NTP_4_2_5P63
+
+ ntpd/ntpd-opts.h@1.50 +3 -3
+ NTP_4_2_5P63
+
+ ntpd/ntpd-opts.texi@1.49 +2 -2
+ NTP_4_2_5P63
+
+ ntpd/ntpd.1@1.49 +2 -2
+ NTP_4_2_5P63
+
+ ntpdc/ntpdc-opts.c@1.50 +2 -2
+ NTP_4_2_5P63
+
+ ntpdc/ntpdc-opts.h@1.50 +3 -3
+ NTP_4_2_5P63
+
+ ntpdc/ntpdc-opts.texi@1.49 +2 -2
+ NTP_4_2_5P63
+
+ ntpdc/ntpdc.1@1.49 +2 -2
+ NTP_4_2_5P63
+
+ ntpq/ntpq-opts.c@1.50 +2 -2
+ NTP_4_2_5P63
+
+ ntpq/ntpq-opts.h@1.50 +3 -3
+ NTP_4_2_5P63
+
+ ntpq/ntpq-opts.texi@1.49 +2 -2
+ NTP_4_2_5P63
+
+ ntpq/ntpq.1@1.49 +2 -2
+ NTP_4_2_5P63
+
+ packageinfo.sh@1.66 +1 -1
+ NTP_4_2_5P63
+
+ sntp/sntp-opts.c@1.50 +2 -2
+ NTP_4_2_5P63
+
+ sntp/sntp-opts.h@1.50 +3 -3
+ NTP_4_2_5P63
+
+ sntp/sntp-opts.texi@1.49 +1 -1
+ NTP_4_2_5P63
+
+ sntp/sntp.1@1.49 +2 -2
+ NTP_4_2_5P63
+
+ util/ntp-keygen-opts.c@1.51 +2 -2
+ NTP_4_2_5P63
+
+ util/ntp-keygen-opts.h@1.51 +3 -3
+ NTP_4_2_5P63
+
+ util/ntp-keygen-opts.texi@1.50 +2 -2
+ NTP_4_2_5P63
+
+ util/ntp-keygen.1@1.50 +2 -2
+ NTP_4_2_5P63
+
+ChangeSet@1.1556, 2007-07-29 02:30:13-04:00, stenn@whimsy.udel.edu
+ Initialize offset in leap_file() - Coverity View 17
+
+ ChangeLog@1.88 +1 -0
+ Initialize offset in leap_file() - Coverity View 17
+
+ ntpd/ntp_util.c@1.57 +2 -1
+ Initialize offset in leap_file() - Coverity View 17
+
+ChangeSet@1.1555, 2007-07-28 07:44:54-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P62
+ TAG: NTP_4_2_5P62
+
+ ntpd/ntpd-opts.c@1.49 +2 -2
+ NTP_4_2_5P62
+
+ ntpd/ntpd-opts.h@1.49 +3 -3
+ NTP_4_2_5P62
+
+ ntpd/ntpd-opts.texi@1.48 +1 -1
+ NTP_4_2_5P62
+
+ ntpd/ntpd.1@1.48 +2 -2
+ NTP_4_2_5P62
+
+ ntpdc/ntpdc-opts.c@1.49 +2 -2
+ NTP_4_2_5P62
+
+ ntpdc/ntpdc-opts.h@1.49 +3 -3
+ NTP_4_2_5P62
+
+ ntpdc/ntpdc-opts.texi@1.48 +1 -1
+ NTP_4_2_5P62
+
+ ntpdc/ntpdc.1@1.48 +2 -2
+ NTP_4_2_5P62
+
+ ntpq/ntpq-opts.c@1.49 +2 -2
+ NTP_4_2_5P62
+
+ ntpq/ntpq-opts.h@1.49 +3 -3
+ NTP_4_2_5P62
+
+ ntpq/ntpq-opts.texi@1.48 +1 -1
+ NTP_4_2_5P62
+
+ ntpq/ntpq.1@1.48 +2 -2
+ NTP_4_2_5P62
+
+ packageinfo.sh@1.65 +1 -1
+ NTP_4_2_5P62
+
+ sntp/sntp-opts.c@1.49 +2 -2
+ NTP_4_2_5P62
+
+ sntp/sntp-opts.h@1.49 +3 -3
+ NTP_4_2_5P62
+
+ sntp/sntp-opts.texi@1.48 +1 -1
+ NTP_4_2_5P62
+
+ sntp/sntp.1@1.48 +2 -2
+ NTP_4_2_5P62
+
+ util/ntp-keygen-opts.c@1.50 +2 -2
+ NTP_4_2_5P62
+
+ util/ntp-keygen-opts.h@1.50 +3 -3
+ NTP_4_2_5P62
+
+ util/ntp-keygen-opts.texi@1.49 +1 -1
+ NTP_4_2_5P62
+
+ util/ntp-keygen.1@1.49 +2 -2
+ NTP_4_2_5P62
+
+ChangeSet@1.1554, 2007-07-28 02:22:13-04:00, stenn@whimsy.udel.edu
+ (ChangeLog entries for previous changeset)
+
+ ChangeLog@1.87 +3 -0
+
+ChangeSet@1.1553, 2007-07-27 23:47:45-04:00, stenn@whimsy.udel.edu
+ systime.c:
+ fuzz cleanup
+ ntp_loopfilter.c, ntp_proto.c:
+ Show more digits during some debug printfs. Use the correct packet stratum in KISS codes.
+
+ libntp/systime.c@1.43 +2 -2
+ fuzz cleanup
+
+ ntpd/ntp_loopfilter.c@1.138 +1 -1
+ Show more digits during some debug printfs. Use the correct packet stratum in KISS codes.
+
+ ntpd/ntp_proto.c@1.259 +2 -2
+ Show more digits during some debug printfs. Use the correct packet stratum in KISS codes.
+
+ChangeSet@1.1552, 2007-07-25 07:44:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P61
+ TAG: NTP_4_2_5P61
+
+ ntpd/ntpd-opts.c@1.48 +2 -2
+ NTP_4_2_5P61
+
+ ntpd/ntpd-opts.h@1.48 +3 -3
+ NTP_4_2_5P61
+
+ ntpd/ntpd-opts.texi@1.47 +2 -2
+ NTP_4_2_5P61
+
+ ntpd/ntpd.1@1.47 +2 -2
+ NTP_4_2_5P61
+
+ ntpdc/ntpdc-opts.c@1.48 +2 -2
+ NTP_4_2_5P61
+
+ ntpdc/ntpdc-opts.h@1.48 +3 -3
+ NTP_4_2_5P61
+
+ ntpdc/ntpdc-opts.texi@1.47 +2 -2
+ NTP_4_2_5P61
+
+ ntpdc/ntpdc.1@1.47 +2 -2
+ NTP_4_2_5P61
+
+ ntpq/ntpq-opts.c@1.48 +2 -2
+ NTP_4_2_5P61
+
+ ntpq/ntpq-opts.h@1.48 +3 -3
+ NTP_4_2_5P61
+
+ ntpq/ntpq-opts.texi@1.47 +2 -2
+ NTP_4_2_5P61
+
+ ntpq/ntpq.1@1.47 +2 -2
+ NTP_4_2_5P61
+
+ packageinfo.sh@1.64 +1 -1
+ NTP_4_2_5P61
+
+ sntp/sntp-opts.c@1.48 +2 -2
+ NTP_4_2_5P61
+
+ sntp/sntp-opts.h@1.48 +3 -3
+ NTP_4_2_5P61
+
+ sntp/sntp-opts.texi@1.47 +1 -1
+ NTP_4_2_5P61
+
+ sntp/sntp.1@1.47 +2 -2
+ NTP_4_2_5P61
+
+ util/ntp-keygen-opts.c@1.49 +2 -2
+ NTP_4_2_5P61
+
+ util/ntp-keygen-opts.h@1.49 +3 -3
+ NTP_4_2_5P61
+
+ util/ntp-keygen-opts.texi@1.48 +2 -2
+ NTP_4_2_5P61
+
+ util/ntp-keygen.1@1.48 +2 -2
+ NTP_4_2_5P61
+
+ChangeSet@1.1551, 2007-07-24 15:01:03-04:00, stenn@whimsy.udel.edu
+ internal driftfile write control: drift_file_sw
+
+ ChangeLog@1.86 +1 -0
+ internal driftfile write control: drift_file_sw
+
+ include/ntpd.h@1.107 +1 -0
+ internal driftfile write control: drift_file_sw
+
+ ntpd/ntp_config.c@1.161 +3 -1
+ internal driftfile write control: drift_file_sw
+
+ ntpd/ntp_loopfilter.c@1.137 +2 -1
+ internal driftfile write control: drift_file_sw
+
+ ntpd/ntp_util.c@1.56 +5 -3
+ internal driftfile write control: drift_file_sw
+
+ChangeSet@1.1550, 2007-07-24 07:44:32-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P60
+ TAG: NTP_4_2_5P60
+
+ ntpd/ntpd-opts.c@1.47 +2 -2
+ NTP_4_2_5P60
+
+ ntpd/ntpd-opts.h@1.47 +3 -3
+ NTP_4_2_5P60
+
+ ntpd/ntpd-opts.texi@1.46 +1 -1
+ NTP_4_2_5P60
+
+ ntpd/ntpd.1@1.46 +2 -2
+ NTP_4_2_5P60
+
+ ntpdc/ntpdc-opts.c@1.47 +2 -2
+ NTP_4_2_5P60
+
+ ntpdc/ntpdc-opts.h@1.47 +3 -3
+ NTP_4_2_5P60
+
+ ntpdc/ntpdc-opts.texi@1.46 +1 -1
+ NTP_4_2_5P60
+
+ ntpdc/ntpdc.1@1.46 +2 -2
+ NTP_4_2_5P60
+
+ ntpq/ntpq-opts.c@1.47 +2 -2
+ NTP_4_2_5P60
+
+ ntpq/ntpq-opts.h@1.47 +3 -3
+ NTP_4_2_5P60
+
+ ntpq/ntpq-opts.texi@1.46 +1 -1
+ NTP_4_2_5P60
+
+ ntpq/ntpq.1@1.46 +2 -2
+ NTP_4_2_5P60
+
+ packageinfo.sh@1.63 +1 -1
+ NTP_4_2_5P60
+
+ sntp/sntp-opts.c@1.47 +2 -2
+ NTP_4_2_5P60
+
+ sntp/sntp-opts.h@1.47 +3 -3
+ NTP_4_2_5P60
+
+ sntp/sntp-opts.texi@1.46 +1 -1
+ NTP_4_2_5P60
+
+ sntp/sntp.1@1.46 +2 -2
+ NTP_4_2_5P60
+
+ util/ntp-keygen-opts.c@1.48 +2 -2
+ NTP_4_2_5P60
+
+ util/ntp-keygen-opts.h@1.48 +3 -3
+ NTP_4_2_5P60
+
+ util/ntp-keygen-opts.texi@1.47 +1 -1
+ NTP_4_2_5P60
+
+ util/ntp-keygen.1@1.47 +2 -2
+ NTP_4_2_5P60
+
+ChangeSet@1.1549, 2007-07-24 01:52:29-04:00, stenn@whimsy.udel.edu
+ Implement the wander_threshold option for the driftfile config keyword
+
+ ChangeLog@1.85 +1 -0
+ Implement the wander_threshold option for the driftfile config keyword
+
+ ntpd/ntp_config.c@1.160 +3 -5
+ Implement the wander_threshold option for the driftfile config keyword
+
+ ntpd/ntp_parser.c@1.15 +321 -319
+ Implement the wander_threshold option for the driftfile config keyword
+
+ ntpd/ntp_parser.h@1.7 +1 -1
+ Implement the wander_threshold option for the driftfile config keyword
+
+ ntpd/ntp_parser.y@1.12 +207 -206
+ Implement the wander_threshold option for the driftfile config keyword
+
+ChangeSet@1.1548, 2007-07-24 01:32:19-04:00, stenn@whimsy.udel.edu
+ c++ // comments are not allowed.
+
+ ChangeLog@1.84 +1 -0
+ c++ // comments are not allowed.
+
+ ntpd/ntp_control.c@1.97 +449 -445
+ c++ // comments are not allowed.
+
+ChangeSet@1.1547, 2007-07-23 07:45:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P59
+ TAG: NTP_4_2_5P59
+
+ ntpd/ntpd-opts.c@1.46 +2 -2
+ NTP_4_2_5P59
+
+ ntpd/ntpd-opts.h@1.46 +3 -3
+ NTP_4_2_5P59
+
+ ntpd/ntpd-opts.texi@1.45 +2 -2
+ NTP_4_2_5P59
+
+ ntpd/ntpd.1@1.45 +2 -2
+ NTP_4_2_5P59
+
+ ntpdc/ntpdc-opts.c@1.46 +2 -2
+ NTP_4_2_5P59
+
+ ntpdc/ntpdc-opts.h@1.46 +3 -3
+ NTP_4_2_5P59
+
+ ntpdc/ntpdc-opts.texi@1.45 +2 -2
+ NTP_4_2_5P59
+
+ ntpdc/ntpdc.1@1.45 +2 -2
+ NTP_4_2_5P59
+
+ ntpq/ntpq-opts.c@1.46 +2 -2
+ NTP_4_2_5P59
+
+ ntpq/ntpq-opts.h@1.46 +3 -3
+ NTP_4_2_5P59
+
+ ntpq/ntpq-opts.texi@1.45 +2 -2
+ NTP_4_2_5P59
+
+ ntpq/ntpq.1@1.45 +2 -2
+ NTP_4_2_5P59
+
+ packageinfo.sh@1.62 +1 -1
+ NTP_4_2_5P59
+
+ sntp/sntp-opts.c@1.46 +2 -2
+ NTP_4_2_5P59
+
+ sntp/sntp-opts.h@1.46 +3 -3
+ NTP_4_2_5P59
+
+ sntp/sntp-opts.texi@1.45 +1 -1
+ NTP_4_2_5P59
+
+ sntp/sntp.1@1.45 +2 -2
+ NTP_4_2_5P59
+
+ util/ntp-keygen-opts.c@1.47 +2 -2
+ NTP_4_2_5P59
+
+ util/ntp-keygen-opts.h@1.47 +3 -3
+ NTP_4_2_5P59
+
+ util/ntp-keygen-opts.texi@1.46 +2 -2
+ NTP_4_2_5P59
+
+ util/ntp-keygen.1@1.46 +2 -2
+ NTP_4_2_5P59
+
+ChangeSet@1.1541.1.1, 2007-07-23 01:34:01-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ChangeLog@1.81.1.1 +2 -0
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ html/confopt.html@1.37 +2 -0
+ Documentation fixes from Dave Mills
+
+ html/drivers/driver6.html@1.25 +4 -5
+ Documentation fixes from Dave Mills
+
+ html/index.html@1.33 +2 -2
+ Documentation fixes from Dave Mills
+
+ html/miscopt.html@1.36 +3 -13
+ Documentation fixes from Dave Mills
+
+ html/ntpd.html@1.40 +28 -20
+ Documentation fixes from Dave Mills
+
+ html/ntpdc.html@1.28 +3 -2
+ Documentation fixes from Dave Mills
+
+ html/scripts/links7.txt@1.3 +4 -1
+ Documentation fixes from Dave Mills
+
+ include/ntp.h@1.134 +12 -1
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup
+
+ include/ntp_control.h@1.31 +21 -19
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup
+
+ include/ntp_crypto.h@1.40 +3 -3
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup
+
+ include/ntpd.h@1.106 +10 -8
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup
+
+ ntpd/ntp_config.c@1.159 +8 -7
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/ntp_control.c@1.96 +66 -50
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/ntp_crypto.c@1.112 +153 -259
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/ntp_loopfilter.c@1.136 +6 -9
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/ntp_peer.c@1.104 +70 -71
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/ntp_proto.c@1.258 +222 -176
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/ntp_timer.c@1.39 +51 -40
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/ntp_util.c@1.55 +36 -15
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ ntpd/refclock_acts.c@1.30 +1 -1
+ Changes from Dave Mills: in/out-bound data rates, leapsecond cleanup, driftfile write cleanup, packet buffer length checks
+
+ChangeSet@1.1545, 2007-07-18 15:09:31-04:00, mayer@pogo.udel.edu
+ Undo bug #629 fixes as they cause more problems than were being solved
+
+ ChangeLog@1.82 +1 -0
+ Undo bug #629 fixes as they cause more problems than were being solved
+
+ChangeSet@1.1544, 2007-07-18 15:03:37-04:00, mayer@pogo.udel.edu
+ Undo bug #629 fixes as they cause more problems than were being solved
+
+ ntpd/ntp_io.c@1.258 +1 -8
+ Undo bug #629 fixes as they cause more problems than were eing solved
+
+ChangeSet@1.1543, 2007-07-18 13:57:51-04:00, mayer@pogo.udel.edu
+ Undo bug #629 fixes as they cause more problems than were being solved
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.32 +2 -4
+ Undo bug #629 fixes as they cause more problems than were being solved
+
+ChangeSet@1.1529.2.12, 2007-07-18 13:53:24-04:00, mayer@pogo.udel.edu
+ Undo bug #629 fixes as they cause more problems than were eing solved
+
+ ntpd/ntp_io.c@1.257 +1 -8
+ Undo bug #629 fixes as they cause more problems than were being solved
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.31 +0 -15
+ Undo bug #629 fixes as they cause more problems than were being solved
+
+ChangeSet@1.1541, 2007-06-30 07:46:53-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P58
+ TAG: NTP_4_2_5P58
+
+ ntpd/ntpd-opts.c@1.45 +2 -2
+ NTP_4_2_5P58
+
+ ntpd/ntpd-opts.h@1.45 +3 -3
+ NTP_4_2_5P58
+
+ ntpd/ntpd-opts.texi@1.44 +1 -1
+ NTP_4_2_5P58
+
+ ntpd/ntpd.1@1.44 +2 -2
+ NTP_4_2_5P58
+
+ ntpdc/ntpdc-opts.c@1.45 +2 -2
+ NTP_4_2_5P58
+
+ ntpdc/ntpdc-opts.h@1.45 +3 -3
+ NTP_4_2_5P58
+
+ ntpdc/ntpdc-opts.texi@1.44 +1 -1
+ NTP_4_2_5P58
+
+ ntpdc/ntpdc.1@1.44 +2 -2
+ NTP_4_2_5P58
+
+ ntpq/ntpq-opts.c@1.45 +2 -2
+ NTP_4_2_5P58
+
+ ntpq/ntpq-opts.h@1.45 +3 -3
+ NTP_4_2_5P58
+
+ ntpq/ntpq-opts.texi@1.44 +1 -1
+ NTP_4_2_5P58
+
+ ntpq/ntpq.1@1.44 +2 -2
+ NTP_4_2_5P58
+
+ packageinfo.sh@1.61 +1 -1
+ NTP_4_2_5P58
+
+ sntp/sntp-opts.c@1.45 +2 -2
+ NTP_4_2_5P58
+
+ sntp/sntp-opts.h@1.45 +3 -3
+ NTP_4_2_5P58
+
+ sntp/sntp-opts.texi@1.44 +1 -1
+ NTP_4_2_5P58
+
+ sntp/sntp.1@1.44 +2 -2
+ NTP_4_2_5P58
+
+ util/ntp-keygen-opts.c@1.46 +2 -2
+ NTP_4_2_5P58
+
+ util/ntp-keygen-opts.h@1.46 +3 -3
+ NTP_4_2_5P58
+
+ util/ntp-keygen-opts.texi@1.45 +1 -1
+ NTP_4_2_5P58
+
+ util/ntp-keygen.1@1.45 +2 -2
+ NTP_4_2_5P58
+
+ChangeSet@1.1540, 2007-06-29 21:15:27+00:00, stenn@ntp1.isc.org
+ format cleanup
+
+ ChangeLog@1.81 +37 -39
+ format cleanup
+
+ChangeSet@1.1539, 2007-06-29 16:23:16-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ NEWS@1.100 +1 -0
+ cleanup
+
+ChangeSet@1.1436.1.66, 2007-06-29 15:46:00-04:00, stenn@deacon.udel.edu
+ NTP_4_2_4P3
+ TAG: NTP_4_2_4P3
+
+ ntpd/ntpd-opts.c@1.50.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpd/ntpd-opts.h@1.50.10.1 +3 -3
+ NTP_4_2_4P3
+
+ ntpd/ntpd-opts.texi@1.49.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpd/ntpd.1@1.48.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpd/ntpdsim-opts.c@1.50.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpd/ntpdsim-opts.h@1.50.10.1 +3 -3
+ NTP_4_2_4P3
+
+ ntpd/ntpdsim-opts.texi@1.48.10.1 +1 -1
+ NTP_4_2_4P3
+
+ ntpd/ntpdsim.1@1.48.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpdc/ntpdc-opts.c@1.50.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpdc/ntpdc-opts.h@1.50.10.1 +3 -3
+ NTP_4_2_4P3
+
+ ntpdc/ntpdc-opts.texi@1.48.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpdc/ntpdc.1@1.48.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpq/ntpq-opts.c@1.52.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpq/ntpq-opts.h@1.52.10.1 +3 -3
+ NTP_4_2_4P3
+
+ ntpq/ntpq-opts.texi@1.49.10.1 +2 -2
+ NTP_4_2_4P3
+
+ ntpq/ntpq.1@1.48.10.1 +2 -2
+ NTP_4_2_4P3
+
+ packageinfo.sh@1.65.16.2 +2 -2
+ NTP_4_2_4P3
+
+ sntp/sntp-opts.c@1.49.10.1 +2 -2
+ NTP_4_2_4P3
+
+ sntp/sntp-opts.h@1.49.10.1 +3 -3
+ NTP_4_2_4P3
+
+ sntp/sntp-opts.texi@1.46.10.1 +1 -1
+ NTP_4_2_4P3
+
+ sntp/sntp.1@1.49.10.1 +2 -2
+ NTP_4_2_4P3
+
+ util/ntp-keygen-opts.c@1.49.10.1 +2 -2
+ NTP_4_2_4P3
+
+ util/ntp-keygen-opts.h@1.49.10.1 +3 -3
+ NTP_4_2_4P3
+
+ util/ntp-keygen-opts.texi@1.47.10.1 +2 -2
+ NTP_4_2_4P3
+
+ util/ntp-keygen.1@1.47.10.1 +2 -2
+ NTP_4_2_4P3
+
+ChangeSet@1.1436.1.65, 2007-06-29 15:31:21-04:00, stenn@deacon.udel.edu
+ Release 4.2.4p3
+
+ ChangeLog@1.1.1.23 +1 -1
+ Release 4.2.4p3
+
+ NEWS@1.86.1.11 +1 -1
+ Release 4.2.4p3
+
+ packageinfo.sh@1.65.16.1 +1 -1
+ Release 4.2.4p3
+
+ChangeSet@1.1436.1.64, 2007-06-29 19:03:39+00:00, stenn@ntp1.isc.org
+ Cosmetic reformatting
+
+ ChangeLog@1.1.1.22 +70 -16
+ Cosmetic reformatting
+
+ NEWS@1.86.1.10 +4 -0
+ Cosmetic reformatting
+
+ChangeSet@1.1537, 2007-06-28 07:47:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P57
+ TAG: NTP_4_2_5P57
+
+ ntpd/ntpd-opts.c@1.44 +2 -2
+ NTP_4_2_5P57
+
+ ntpd/ntpd-opts.h@1.44 +3 -3
+ NTP_4_2_5P57
+
+ ntpd/ntpd-opts.texi@1.43 +1 -1
+ NTP_4_2_5P57
+
+ ntpd/ntpd.1@1.43 +2 -2
+ NTP_4_2_5P57
+
+ ntpdc/ntpdc-opts.c@1.44 +2 -2
+ NTP_4_2_5P57
+
+ ntpdc/ntpdc-opts.h@1.44 +3 -3
+ NTP_4_2_5P57
+
+ ntpdc/ntpdc-opts.texi@1.43 +1 -1
+ NTP_4_2_5P57
+
+ ntpdc/ntpdc.1@1.43 +2 -2
+ NTP_4_2_5P57
+
+ ntpq/ntpq-opts.c@1.44 +2 -2
+ NTP_4_2_5P57
+
+ ntpq/ntpq-opts.h@1.44 +3 -3
+ NTP_4_2_5P57
+
+ ntpq/ntpq-opts.texi@1.43 +1 -1
+ NTP_4_2_5P57
+
+ ntpq/ntpq.1@1.43 +2 -2
+ NTP_4_2_5P57
+
+ packageinfo.sh@1.60 +1 -1
+ NTP_4_2_5P57
+
+ sntp/sntp-opts.c@1.44 +2 -2
+ NTP_4_2_5P57
+
+ sntp/sntp-opts.h@1.44 +3 -3
+ NTP_4_2_5P57
+
+ sntp/sntp-opts.texi@1.43 +1 -1
+ NTP_4_2_5P57
+
+ sntp/sntp.1@1.43 +2 -2
+ NTP_4_2_5P57
+
+ util/ntp-keygen-opts.c@1.45 +2 -2
+ NTP_4_2_5P57
+
+ util/ntp-keygen-opts.h@1.45 +3 -3
+ NTP_4_2_5P57
+
+ util/ntp-keygen-opts.texi@1.44 +1 -1
+ NTP_4_2_5P57
+
+ util/ntp-keygen.1@1.44 +2 -2
+ NTP_4_2_5P57
+
+ChangeSet@1.1535, 2007-06-28 04:11:15-04:00, stenn@whimsy.udel.edu
+ More assertion checks and malloc()->emalloc(), courtesy of Calysto
+
+ ChangeLog@1.78 +1 -0
+ More assertion checks and malloc()->emalloc(), courtesy of Calysto
+
+ ntpd/ntp_crypto.c@1.111 +6 -1
+ More assertion checks and malloc()->emalloc(), courtesy of Calysto
+
+ ntpd/ntp_data_structures.c@1.5 +2 -2
+ More assertion checks and malloc()->emalloc(), courtesy of Calysto
+
+ChangeSet@1.1534, 2007-06-28 04:05:43-04:00, stenn@whimsy.udel.edu
+ typo
+
+ ChangeLog@1.77 +1 -1
+ typo
+
+ChangeSet@1.1533, 2007-06-27 09:48:59-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P56
+ TAG: NTP_4_2_5P56
+
+ ntpd/ntpd-opts.c@1.43 +2 -2
+ NTP_4_2_5P56
+
+ ntpd/ntpd-opts.h@1.43 +3 -3
+ NTP_4_2_5P56
+
+ ntpd/ntpd-opts.texi@1.42 +1 -1
+ NTP_4_2_5P56
+
+ ntpd/ntpd.1@1.42 +2 -2
+ NTP_4_2_5P56
+
+ ntpdc/ntpdc-opts.c@1.43 +2 -2
+ NTP_4_2_5P56
+
+ ntpdc/ntpdc-opts.h@1.43 +3 -3
+ NTP_4_2_5P56
+
+ ntpdc/ntpdc-opts.texi@1.42 +1 -1
+ NTP_4_2_5P56
+
+ ntpdc/ntpdc.1@1.42 +2 -2
+ NTP_4_2_5P56
+
+ ntpq/ntpq-opts.c@1.43 +2 -2
+ NTP_4_2_5P56
+
+ ntpq/ntpq-opts.h@1.43 +3 -3
+ NTP_4_2_5P56
+
+ ntpq/ntpq-opts.texi@1.42 +1 -1
+ NTP_4_2_5P56
+
+ ntpq/ntpq.1@1.42 +2 -2
+ NTP_4_2_5P56
+
+ packageinfo.sh@1.59 +1 -1
+ NTP_4_2_5P56
+
+ sntp/sntp-opts.c@1.43 +2 -2
+ NTP_4_2_5P56
+
+ sntp/sntp-opts.h@1.43 +3 -3
+ NTP_4_2_5P56
+
+ sntp/sntp-opts.texi@1.42 +1 -1
+ NTP_4_2_5P56
+
+ sntp/sntp.1@1.42 +2 -2
+ NTP_4_2_5P56
+
+ util/ntp-keygen-opts.c@1.44 +2 -2
+ NTP_4_2_5P56
+
+ util/ntp-keygen-opts.h@1.44 +3 -3
+ NTP_4_2_5P56
+
+ util/ntp-keygen-opts.texi@1.43 +1 -1
+ NTP_4_2_5P56
+
+ util/ntp-keygen.1@1.43 +2 -2
+ NTP_4_2_5P56
+
+ChangeSet@1.1436.1.63, 2007-06-27 07:46:44-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P3_RC1
+ TAG: NTP_4_2_4P3_RC1
+
+ ntpd/ntpd-opts.c@1.50.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpd/ntpd-opts.h@1.50.9.1 +3 -3
+ NTP_4_2_4P3_RC1
+
+ ntpd/ntpd-opts.texi@1.49.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpd/ntpd.1@1.48.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.9.1 +3 -3
+ NTP_4_2_4P3_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.9.1 +1 -1
+ NTP_4_2_4P3_RC1
+
+ ntpd/ntpdsim.1@1.48.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.9.1 +3 -3
+ NTP_4_2_4P3_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpdc/ntpdc.1@1.48.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpq/ntpq-opts.c@1.52.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpq/ntpq-opts.h@1.52.9.1 +3 -3
+ NTP_4_2_4P3_RC1
+
+ ntpq/ntpq-opts.texi@1.49.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ ntpq/ntpq.1@1.48.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ packageinfo.sh@1.65.15.2 +2 -2
+ NTP_4_2_4P3_RC1
+
+ sntp/sntp-opts.c@1.49.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ sntp/sntp-opts.h@1.49.9.1 +3 -3
+ NTP_4_2_4P3_RC1
+
+ sntp/sntp-opts.texi@1.46.9.1 +1 -1
+ NTP_4_2_4P3_RC1
+
+ sntp/sntp.1@1.49.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ util/ntp-keygen-opts.c@1.49.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ util/ntp-keygen-opts.h@1.49.9.1 +3 -3
+ NTP_4_2_4P3_RC1
+
+ util/ntp-keygen-opts.texi@1.47.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ util/ntp-keygen.1@1.47.9.1 +2 -2
+ NTP_4_2_4P3_RC1
+
+ChangeSet@1.1529.3.4, 2007-06-27 02:21:23-04:00, stenn@whimsy.udel.edu
+ [Bug 604] ntpd regularly dies on linux/alpha
+
+ ChangeLog@1.73.3.3 +1 -0
+ [Bug 604] ntpd regularly dies on linux/alpha
+
+ ntpd/ntp_proto.c@1.255.1.2 +2 -0
+ [Bug 604] ntpd regularly dies on linux/alpha
+
+ChangeSet@1.1529.3.3, 2007-06-27 02:15:24-04:00, stenn@whimsy.udel.edu
+ More leapsecond table file fixes from Dave Mills
+
+ ChangeLog@1.73.3.2 +1 -1
+ More leapsecond table file fixes from Dave Mills
+
+ include/ntpd.h@1.105 +1 -0
+ More leapsecond table file fixes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.110 +18 -6
+ More leapsecond table file fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.255.1.1 +41 -37
+ More leapsecond table file fixes from Dave Mills
+
+ ntpd/ntp_util.c@1.54 +16 -6
+ More leapsecond table file fixes from Dave Mills
+
+ChangeSet@1.1529.3.2, 2007-06-27 02:06:19-04:00, stenn@whimsy.udel.edu
+ Notes for release
+
+ NEWS@1.95.1.1 +2 -0
+ Notes for release
+
+ChangeSet@1.1436.1.62, 2007-06-27 01:42:30-04:00, stenn@whimsy.udel.edu
+ First RC for 4.2.4p3
+
+ ChangeLog@1.1.1.21 +2 -1
+ First RC for 4.2.4p3
+
+ NEWS@1.86.1.9 +8 -0
+ First RC for 4.2.4p3
+
+ packageinfo.sh@1.65.15.1 +1 -1
+ First RC for 4.2.4p3
+
+ChangeSet@1.1529.3.1, 2007-06-26 22:43:22-04:00, stenn@whimsy.udel.edu
+ [Bug 858] recent leapfile changes broke non-OpenSSL builds.
+
+ ChangeLog@1.73.3.1 +4 -2
+ [Bug 858] recent leapfile changes broke non-OpenSSL builds.
+
+ ntpd/ntp_control.c@1.95 +2 -1
+ [Bug 858] recent leapfile changes broke non-OpenSSL builds.
+
+ChangeSet@1.1529.2.8, 2007-06-23 09:19:06-04:00, mayer@pogo.udel.edu
+ Added Bug #863
+
+ ChangeLog@1.73.2.2 +2 -0
+ Added Bug #863
+
+ChangeSet@1.1523.1.2, 2007-06-23 08:50:46-04:00, mayer@pogo.udel.edu
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ ports/winnt/include/ntp_iocompletionport.h@1.12.1.1 +3 -0
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.29 +15 -1
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ ports/winnt/ntpd/ntservice.c@1.8.1.1 +9 -5
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ChangeSet@1.1436.1.61, 2007-06-23 08:47:07-04:00, mayer@pogo.udel.edu
+ Added Bug #863
+
+ ChangeLog@1.1.1.20 +2 -0
+ Added Bug #863
+
+ChangeSet@1.1436.5.1, 2007-06-23 08:42:58-04:00, mayer@pogo.udel.edu
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ ports/winnt/include/ntp_iocompletionport.h@1.13 +3 -0
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.2 +15 -1
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ ports/winnt/ntpd/ntservice.c@1.9 +9 -5
+ Bug #863 Unable to stop ntpd because the handle index changed
+
+ChangeSet@1.1529.2.6, 2007-06-23 07:42:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P55
+ TAG: NTP_4_2_5P55
+
+ ntpd/ntpd-opts.c@1.42 +2 -2
+ NTP_4_2_5P55
+
+ ntpd/ntpd-opts.h@1.42 +3 -3
+ NTP_4_2_5P55
+
+ ntpd/ntpd-opts.texi@1.41 +1 -1
+ NTP_4_2_5P55
+
+ ntpd/ntpd.1@1.41 +2 -2
+ NTP_4_2_5P55
+
+ ntpdc/ntpdc-opts.c@1.42 +2 -2
+ NTP_4_2_5P55
+
+ ntpdc/ntpdc-opts.h@1.42 +3 -3
+ NTP_4_2_5P55
+
+ ntpdc/ntpdc-opts.texi@1.41 +1 -1
+ NTP_4_2_5P55
+
+ ntpdc/ntpdc.1@1.41 +2 -2
+ NTP_4_2_5P55
+
+ ntpq/ntpq-opts.c@1.42 +2 -2
+ NTP_4_2_5P55
+
+ ntpq/ntpq-opts.h@1.42 +3 -3
+ NTP_4_2_5P55
+
+ ntpq/ntpq-opts.texi@1.41 +1 -1
+ NTP_4_2_5P55
+
+ ntpq/ntpq.1@1.41 +2 -2
+ NTP_4_2_5P55
+
+ packageinfo.sh@1.58 +1 -1
+ NTP_4_2_5P55
+
+ sntp/sntp-opts.c@1.42 +2 -2
+ NTP_4_2_5P55
+
+ sntp/sntp-opts.h@1.42 +3 -3
+ NTP_4_2_5P55
+
+ sntp/sntp-opts.texi@1.41 +1 -1
+ NTP_4_2_5P55
+
+ sntp/sntp.1@1.41 +2 -2
+ NTP_4_2_5P55
+
+ util/ntp-keygen-opts.c@1.43 +2 -2
+ NTP_4_2_5P55
+
+ util/ntp-keygen-opts.h@1.43 +3 -3
+ NTP_4_2_5P55
+
+ util/ntp-keygen-opts.texi@1.42 +1 -1
+ NTP_4_2_5P55
+
+ util/ntp-keygen.1@1.42 +2 -2
+ NTP_4_2_5P55
+
+ChangeSet@1.1529.2.5, 2007-06-23 01:03:58-04:00, stenn@whimsy.udel.edu
+ Add more assertions (Calypso)
+
+ util/ntp-keygen.c@1.42 +57 -1
+ Add more assertions (Calypso)
+
+ChangeSet@1.1529.2.4, 2007-06-23 00:38:42-04:00, stenn@whimsy.udel.edu
+ Add more assertions (Calypso)
+
+ util/ntp-keygen.c@1.41 +11 -8
+ Add more assertions (Calypso)
+
+ChangeSet@1.1529.2.3, 2007-06-23 00:30:39-04:00, stenn@whimsy.udel.edu
+ Add more assertions (Calypso)
+
+ libntp/caljulian.c@1.7 +3 -0
+ Add more assertions (Calypso)
+
+ChangeSet@1.1529.2.2, 2007-06-23 00:18:26-04:00, stenn@whimsy.udel.edu
+ Add more assertions (Calypso)
+
+ ntpd/ntp_crypto.c@1.109 +4 -1
+ Add more assertions (Calypso)
+
+ChangeSet@1.1529.2.1, 2007-06-22 23:51:03-04:00, stenn@whimsy.udel.edu
+ Use emalloc() instead of malloc() in refclock_datum.c (Calypso).
+
+ ChangeLog@1.73.2.1 +1 -0
+ Use emalloc() instead of malloc() in refclock_datum.c (Calypso).
+
+ ntpd/refclock_datum.c@1.11 +2 -2
+ Use emalloc() instead of malloc() in refclock_datum.c (Calypso).
+
+ChangeSet@1.1529.1.5, 2007-06-22 12:52:24-04:00, utterback@pogo.udel.edu
+ [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
+
+ ChangeLog@1.73.1.3 +1 -0
+ [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
+
+ configure.ac@1.407 +7 -1
+ [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
+
+ ntpd/Makefile.am@1.63 +2 -2
+ [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
+
+ ntpd/ntp_proto.c@1.256 +19 -0
+ [Bug 864] Place ntpd service in maintenance mode if using SMF on Solaris
+
+ChangeSet@1.1529.1.4, 2007-06-22 07:43:48-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P54
+ TAG: NTP_4_2_5P54
+
+ ntpd/ntpd-opts.c@1.41 +2 -2
+ NTP_4_2_5P54
+
+ ntpd/ntpd-opts.h@1.41 +3 -3
+ NTP_4_2_5P54
+
+ ntpd/ntpd-opts.texi@1.40 +2 -2
+ NTP_4_2_5P54
+
+ ntpd/ntpd.1@1.40 +2 -2
+ NTP_4_2_5P54
+
+ ntpdc/ntpdc-opts.c@1.41 +2 -2
+ NTP_4_2_5P54
+
+ ntpdc/ntpdc-opts.h@1.41 +3 -3
+ NTP_4_2_5P54
+
+ ntpdc/ntpdc-opts.texi@1.40 +2 -2
+ NTP_4_2_5P54
+
+ ntpdc/ntpdc.1@1.40 +2 -2
+ NTP_4_2_5P54
+
+ ntpq/ntpq-opts.c@1.41 +2 -2
+ NTP_4_2_5P54
+
+ ntpq/ntpq-opts.h@1.41 +3 -3
+ NTP_4_2_5P54
+
+ ntpq/ntpq-opts.texi@1.40 +2 -2
+ NTP_4_2_5P54
+
+ ntpq/ntpq.1@1.40 +2 -2
+ NTP_4_2_5P54
+
+ packageinfo.sh@1.57 +1 -1
+ NTP_4_2_5P54
+
+ sntp/sntp-opts.c@1.41 +2 -2
+ NTP_4_2_5P54
+
+ sntp/sntp-opts.h@1.41 +3 -3
+ NTP_4_2_5P54
+
+ sntp/sntp-opts.texi@1.40 +1 -1
+ NTP_4_2_5P54
+
+ sntp/sntp.1@1.40 +2 -2
+ NTP_4_2_5P54
+
+ util/ntp-keygen-opts.c@1.42 +2 -2
+ NTP_4_2_5P54
+
+ util/ntp-keygen-opts.h@1.42 +3 -3
+ NTP_4_2_5P54
+
+ util/ntp-keygen-opts.texi@1.41 +2 -2
+ NTP_4_2_5P54
+
+ util/ntp-keygen.1@1.41 +2 -2
+ NTP_4_2_5P54
+
+ChangeSet@1.1529.1.3, 2007-06-22 02:11:30-04:00, stenn@deacon.udel.edu
+ Leapsecond file support
+
+ ChangeLog@1.73.1.2 +2 -2
+ Leapsecond file support
+
+ include/ntp.h@1.133 +1 -0
+ Leapsecond file support
+
+ ntpd/ntp_config.c@1.156.1.2 +6 -1
+ Leapsecond file support
+
+ ntpd/ntp_config.c@1.156.1.1 +1 -0
+ More leapsecond fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.94 +3 -4
+ More leapsecond fixes from Dave Mills
+
+ ntpd/ntp_parser.c@1.14 +684 -675
+ More leapsecond fixes from Dave Mills
+
+ ntpd/ntp_parser.h@1.6 +92 -91
+ More leapsecond fixes from Dave Mills
+
+ ntpd/ntp_parser.y@1.11 +3 -0
+ More leapsecond fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.255 +65 -68
+ More leapsecond fixes from Dave Mills
+
+ ntpd/ntp_timer.c@1.38 +20 -7
+ More leapsecond fixes from Dave Mills
+
+ ntpd/ntp_util.c@1.53 +11 -1
+ Leapsecond file support
+
+ ntpd/ntp_util.c@1.52 +44 -43
+ More leapsecond fixes from Dave Mills
+
+ChangeSet@1.1529.1.2, 2007-06-22 01:17:17-04:00, stenn@deacon.udel.edu
+ Start using 'design by contract' assertions
+
+ ntpd/ntp_io.c@1.254.1.1 +3 -0
+ Start using 'design by contract' assertions
+
+ChangeSet@1.1529.1.1, 2007-06-22 01:01:28-04:00, stenn@deacon.udel.edu
+ Start using 'design by contract' assertions
+
+ ChangeLog@1.73.1.1 +1 -0
+ Start using 'design by contract' assertions
+
+ include/Makefile.am@1.28 +1 -0
+ Start using 'design by contract' assertions
+
+ include/ntp_assert.h@1.1 +15 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/ntp_assert.h
+
+ include/ntp_assert.h@1.0 +0 -0
+
+ libntp/atolfp.c@1.3 +3 -0
+ Start using 'design by contract' assertions
+
+ libntp/prettydate.c@1.6 +2 -0
+ Start using 'design by contract' assertions
+
+ChangeSet@1.1530, 2007-06-21 09:10:39-04:00, neal@pogo.udel.edu
+ ChangeLog, ntp_config.c:
+ [Bug 862] includefile nesting; preserve phonelist on reconfig.
+ ntp_scanner.h:
+ [Bug 862] includefile nesting.
+
+ ChangeLog@1.74 +1 -0
+ [Bug 862] includefile nesting; preserve phonelist on reconfig.
+
+ ntpd/ntp_config.c@1.157 +3 -2
+ [Bug 862] includefile nesting; preserve phonelist on reconfig.
+
+ ntpd/ntp_scanner.h@1.3 +1 -1
+ [Bug 862] includefile nesting.
+
+ChangeSet@1.1529, 2007-06-20 09:18:36-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P53
+ TAG: NTP_4_2_5P53
+
+ ntpd/ntpd-opts.c@1.40 +2 -2
+ NTP_4_2_5P53
+
+ ntpd/ntpd-opts.h@1.40 +3 -3
+ NTP_4_2_5P53
+
+ ntpd/ntpd-opts.texi@1.39 +2 -2
+ NTP_4_2_5P53
+
+ ntpd/ntpd.1@1.39 +2 -2
+ NTP_4_2_5P53
+
+ ntpdc/ntpdc-opts.c@1.40 +2 -2
+ NTP_4_2_5P53
+
+ ntpdc/ntpdc-opts.h@1.40 +3 -3
+ NTP_4_2_5P53
+
+ ntpdc/ntpdc-opts.texi@1.39 +2 -2
+ NTP_4_2_5P53
+
+ ntpdc/ntpdc.1@1.39 +2 -2
+ NTP_4_2_5P53
+
+ ntpq/ntpq-opts.c@1.40 +2 -2
+ NTP_4_2_5P53
+
+ ntpq/ntpq-opts.h@1.40 +3 -3
+ NTP_4_2_5P53
+
+ ntpq/ntpq-opts.texi@1.39 +2 -2
+ NTP_4_2_5P53
+
+ ntpq/ntpq.1@1.39 +2 -2
+ NTP_4_2_5P53
+
+ packageinfo.sh@1.56 +1 -1
+ NTP_4_2_5P53
+
+ sntp/sntp-opts.c@1.40 +2 -2
+ NTP_4_2_5P53
+
+ sntp/sntp-opts.h@1.40 +3 -3
+ NTP_4_2_5P53
+
+ sntp/sntp-opts.texi@1.39 +1 -1
+ NTP_4_2_5P53
+
+ sntp/sntp.1@1.39 +2 -2
+ NTP_4_2_5P53
+
+ util/ntp-keygen-opts.c@1.41 +2 -2
+ NTP_4_2_5P53
+
+ util/ntp-keygen-opts.h@1.41 +3 -3
+ NTP_4_2_5P53
+
+ util/ntp-keygen-opts.texi@1.40 +2 -2
+ NTP_4_2_5P53
+
+ util/ntp-keygen.1@1.40 +2 -2
+ NTP_4_2_5P53
+
+ChangeSet@1.1436.1.59, 2007-06-20 07:45:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P2
+ TAG: NTP_4_2_4P2
+
+ ntpd/ntpd-opts.c@1.50.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpd/ntpd-opts.h@1.50.8.1 +3 -3
+ NTP_4_2_4P2
+
+ ntpd/ntpd-opts.texi@1.49.8.1 +4 -4
+ NTP_4_2_4P2
+
+ ntpd/ntpd.1@1.48.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpd/ntpdsim-opts.c@1.50.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpd/ntpdsim-opts.h@1.50.8.1 +3 -3
+ NTP_4_2_4P2
+
+ ntpd/ntpdsim-opts.texi@1.48.8.1 +1 -1
+ NTP_4_2_4P2
+
+ ntpd/ntpdsim.1@1.48.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpdc/ntpdc-opts.c@1.50.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpdc/ntpdc-opts.h@1.50.8.1 +3 -3
+ NTP_4_2_4P2
+
+ ntpdc/ntpdc-opts.texi@1.48.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpdc/ntpdc.1@1.48.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpq/ntpq-opts.c@1.52.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpq/ntpq-opts.h@1.52.8.1 +3 -3
+ NTP_4_2_4P2
+
+ ntpq/ntpq-opts.texi@1.49.8.1 +2 -2
+ NTP_4_2_4P2
+
+ ntpq/ntpq.1@1.48.8.1 +2 -2
+ NTP_4_2_4P2
+
+ packageinfo.sh@1.65.14.2 +2 -2
+ NTP_4_2_4P2
+
+ sntp/sntp-opts.c@1.49.8.1 +2 -2
+ NTP_4_2_4P2
+
+ sntp/sntp-opts.h@1.49.8.1 +3 -3
+ NTP_4_2_4P2
+
+ sntp/sntp-opts.texi@1.46.8.1 +1 -1
+ NTP_4_2_4P2
+
+ sntp/sntp.1@1.49.8.1 +2 -2
+ NTP_4_2_4P2
+
+ util/ntp-keygen-opts.c@1.49.8.1 +2 -2
+ NTP_4_2_4P2
+
+ util/ntp-keygen-opts.h@1.49.8.1 +3 -3
+ NTP_4_2_4P2
+
+ util/ntp-keygen-opts.texi@1.47.8.1 +2 -2
+ NTP_4_2_4P2
+
+ util/ntp-keygen.1@1.47.8.1 +2 -2
+ NTP_4_2_4P2
+
+ChangeSet@1.1436.1.58, 2007-06-20 04:07:34-04:00, stenn@deacon.udel.edu
+ 4.2.4p2
+
+ ChangeLog@1.1.1.19 +1 -0
+ 4.2.4p2
+
+ NEWS@1.86.1.8 +8 -13
+ 4.2.4p2
+
+ packageinfo.sh@1.65.14.1 +1 -1
+ 4.2.4p2
+
+ChangeSet@1.1527, 2007-06-20 01:51:36-04:00, stenn@pogo.udel.edu
+ merge cleanup
+
+ ntpd/ntp_util.c@1.51 +1 -1
+ merge cleanup
+
+ChangeSet@1.1523.2.2, 2007-06-19 18:55:53-04:00, stenn@whimsy.udel.edu
+ leap second cleanup from Dave Mills
+
+ ChangeLog@1.71.1.1 +1 -0
+ leap second cleanup from Dave Mills
+
+ChangeSet@1.1523.2.1, 2007-06-19 18:50:51-04:00, stenn@whimsy.udel.edu
+ leap second cleanup from Dave Mills
+
+ include/ntpd.h@1.104 +0 -1
+ leap second cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.135 +13 -25
+ leap second cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.254 +44 -19
+ leap second cleanup from Dave Mills
+
+ ntpd/ntp_timer.c@1.37 +12 -8
+ leap second cleanup from Dave Mills
+
+ ntpd/ntp_util.c@1.47.1.2 +51 -40
+ leap second cleanup from Dave Mills
+
+ChangeSet@1.1519.1.1, 2007-06-19 08:37:26-04:00, mayer@pogo.udel.edu
+ Bug 629 Check for broadcast mode was in wrong place
+
+ ntpd/ntp_io.c@1.253.1.1 +35 -11
+ Bug 629 Check for broadcast mode was in wrong place
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.28 +8 -2
+ Bug 629 Additional debug info
+
+ChangeSet@1.1525, 2007-06-19 03:13:46-04:00, stenn@pogo.udel.edu
+ regenerated ntp_parser.c
+
+ ntpd/ntp_parser.c@1.13 +504 -493
+ regenerated file
+
+ChangeSet@1.1523, 2007-06-17 07:44:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P52
+ TAG: NTP_4_2_5P52
+
+ ntpd/ntpd-opts.c@1.39 +2 -2
+ NTP_4_2_5P52
+
+ ntpd/ntpd-opts.h@1.39 +3 -3
+ NTP_4_2_5P52
+
+ ntpd/ntpd-opts.texi@1.38 +1 -1
+ NTP_4_2_5P52
+
+ ntpd/ntpd.1@1.38 +2 -2
+ NTP_4_2_5P52
+
+ ntpdc/ntpdc-opts.c@1.39 +2 -2
+ NTP_4_2_5P52
+
+ ntpdc/ntpdc-opts.h@1.39 +3 -3
+ NTP_4_2_5P52
+
+ ntpdc/ntpdc-opts.texi@1.38 +1 -1
+ NTP_4_2_5P52
+
+ ntpdc/ntpdc.1@1.38 +2 -2
+ NTP_4_2_5P52
+
+ ntpq/ntpq-opts.c@1.39 +2 -2
+ NTP_4_2_5P52
+
+ ntpq/ntpq-opts.h@1.39 +3 -3
+ NTP_4_2_5P52
+
+ ntpq/ntpq-opts.texi@1.38 +1 -1
+ NTP_4_2_5P52
+
+ ntpq/ntpq.1@1.38 +2 -2
+ NTP_4_2_5P52
+
+ packageinfo.sh@1.55 +1 -1
+ NTP_4_2_5P52
+
+ sntp/sntp-opts.c@1.39 +2 -2
+ NTP_4_2_5P52
+
+ sntp/sntp-opts.h@1.39 +3 -3
+ NTP_4_2_5P52
+
+ sntp/sntp-opts.texi@1.38 +1 -1
+ NTP_4_2_5P52
+
+ sntp/sntp.1@1.38 +2 -2
+ NTP_4_2_5P52
+
+ util/ntp-keygen-opts.c@1.40 +2 -2
+ NTP_4_2_5P52
+
+ util/ntp-keygen-opts.h@1.40 +3 -3
+ NTP_4_2_5P52
+
+ util/ntp-keygen-opts.texi@1.39 +1 -1
+ NTP_4_2_5P52
+
+ util/ntp-keygen.1@1.39 +2 -2
+ NTP_4_2_5P52
+
+ChangeSet@1.1522, 2007-06-17 01:24:40-04:00, stenn@whimsy.udel.edu
+ Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES
+
+ ChangeLog@1.71 +1 -0
+ Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES
+
+ ntpd/Makefile.am@1.62 +2 -1
+ Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES
+
+ ntpd/ntp_parser.c@1.10.1.1 +1511 -1964
+ Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES
+
+ ntpd/ntp_parser.h@1.3.1.1 +155 -345
+ Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES
+
+ ntpd/ntp_parser.y@1.8.1.1 +2 -0
+ Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES
+
+ChangeSet@1.1521, 2007-06-16 07:44:30-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P51
+ TAG: NTP_4_2_5P51
+
+ ntpd/ntpd-opts.c@1.38 +2 -2
+ NTP_4_2_5P51
+
+ ntpd/ntpd-opts.h@1.38 +3 -3
+ NTP_4_2_5P51
+
+ ntpd/ntpd-opts.texi@1.37 +1 -1
+ NTP_4_2_5P51
+
+ ntpd/ntpd.1@1.37 +2 -2
+ NTP_4_2_5P51
+
+ ntpdc/ntpdc-opts.c@1.38 +2 -2
+ NTP_4_2_5P51
+
+ ntpdc/ntpdc-opts.h@1.38 +3 -3
+ NTP_4_2_5P51
+
+ ntpdc/ntpdc-opts.texi@1.37 +1 -1
+ NTP_4_2_5P51
+
+ ntpdc/ntpdc.1@1.37 +2 -2
+ NTP_4_2_5P51
+
+ ntpq/ntpq-opts.c@1.38 +2 -2
+ NTP_4_2_5P51
+
+ ntpq/ntpq-opts.h@1.38 +3 -3
+ NTP_4_2_5P51
+
+ ntpq/ntpq-opts.texi@1.37 +1 -1
+ NTP_4_2_5P51
+
+ ntpq/ntpq.1@1.37 +2 -2
+ NTP_4_2_5P51
+
+ packageinfo.sh@1.54 +1 -1
+ NTP_4_2_5P51
+
+ sntp/sntp-opts.c@1.38 +2 -2
+ NTP_4_2_5P51
+
+ sntp/sntp-opts.h@1.38 +3 -3
+ NTP_4_2_5P51
+
+ sntp/sntp-opts.texi@1.37 +1 -1
+ NTP_4_2_5P51
+
+ sntp/sntp.1@1.37 +2 -2
+ NTP_4_2_5P51
+
+ util/ntp-keygen-opts.c@1.39 +2 -2
+ NTP_4_2_5P51
+
+ util/ntp-keygen-opts.h@1.39 +3 -3
+ NTP_4_2_5P51
+
+ util/ntp-keygen-opts.texi@1.38 +1 -1
+ NTP_4_2_5P51
+
+ util/ntp-keygen.1@1.38 +2 -2
+ NTP_4_2_5P51
+
+ChangeSet@1.1520, 2007-06-15 19:36:46-04:00, stenn@deacon.udel.edu
+ typo
+
+ ntpd/ntp_io.c@1.254 +1 -1
+ typo
+
+ChangeSet@1.1518, 2007-06-15 07:48:47-04:00, mayer@pogo.udel.edu
+ Remove unused variable
+
+ ntpd/ntp_io.c@1.253 +0 -1
+ Remove unused variable
+
+ChangeSet@1.1512.1.15, 2007-06-15 07:42:58-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P50
+ TAG: NTP_4_2_5P50
+
+ ntpd/ntpd-opts.c@1.37 +2 -2
+ NTP_4_2_5P50
+
+ ntpd/ntpd-opts.h@1.37 +3 -3
+ NTP_4_2_5P50
+
+ ntpd/ntpd-opts.texi@1.36 +4 -4
+ NTP_4_2_5P50
+
+ ntpd/ntpd.1@1.36 +2 -2
+ NTP_4_2_5P50
+
+ ntpdc/ntpdc-opts.c@1.37 +2 -2
+ NTP_4_2_5P50
+
+ ntpdc/ntpdc-opts.h@1.37 +3 -3
+ NTP_4_2_5P50
+
+ ntpdc/ntpdc-opts.texi@1.36 +2 -2
+ NTP_4_2_5P50
+
+ ntpdc/ntpdc.1@1.36 +2 -2
+ NTP_4_2_5P50
+
+ ntpq/ntpq-opts.c@1.37 +2 -2
+ NTP_4_2_5P50
+
+ ntpq/ntpq-opts.h@1.37 +3 -3
+ NTP_4_2_5P50
+
+ ntpq/ntpq-opts.texi@1.36 +2 -2
+ NTP_4_2_5P50
+
+ ntpq/ntpq.1@1.36 +2 -2
+ NTP_4_2_5P50
+
+ packageinfo.sh@1.53 +1 -1
+ NTP_4_2_5P50
+
+ sntp/sntp-opts.c@1.37 +2 -2
+ NTP_4_2_5P50
+
+ sntp/sntp-opts.h@1.37 +3 -3
+ NTP_4_2_5P50
+
+ sntp/sntp-opts.texi@1.36 +1 -1
+ NTP_4_2_5P50
+
+ sntp/sntp.1@1.36 +2 -2
+ NTP_4_2_5P50
+
+ util/ntp-keygen-opts.c@1.38 +2 -2
+ NTP_4_2_5P50
+
+ util/ntp-keygen-opts.h@1.38 +3 -3
+ NTP_4_2_5P50
+
+ util/ntp-keygen-opts.texi@1.37 +2 -2
+ NTP_4_2_5P50
+
+ util/ntp-keygen.1@1.37 +2 -2
+ NTP_4_2_5P50
+
+ChangeSet@1.1517, 2007-06-14 23:22:06-04:00, mayer@pogo.udel.edu
+ Bug #629 changes to ensure broadcast works including on wildcard addresses
+
+ ChangeLog@1.70 +1 -0
+ Bug #629 changes to ensure broadcast works including on wildcard addresses
+
+ChangeSet@1.1515, 2007-06-14 23:06:42-04:00, mayer@pogo.udel.edu
+ Bug #629 changes to ensure broadcast works including on wildcard addresses
+
+ ntpd/ntp_io.c@1.252 +22 -17
+ Bug #629 changes to ensure broadcast works including on wildcard addresses
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.27 +12 -3
+ Bug #629 changes to ensure broadcast works including on wildcard addresses
+
+ChangeSet@1.1512.1.14, 2007-06-14 18:42:17-04:00, stenn@whimsy.udel.edu
+ [Bug 853] get_node() must return a pointer to maximally-aligned memory
+
+ ChangeLog@1.69 +1 -0
+ [Bug 853] get_node() must return a pointer to maximally-aligned memory
+
+ include/ntp_data_structures.h@1.2 +5 -1
+ [Bug 853] get_node() must return a pointer to maximally-aligned memory
+
+ ntpd/ntp_data_structures.c@1.4 +7 -7
+ [Bug 853] get_node() must return a pointer to maximally-aligned memory
+
+ChangeSet@1.1512.1.13, 2007-06-14 07:43:15-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P49
+ TAG: NTP_4_2_5P49
+
+ ntpd/ntpd-opts.c@1.36 +2 -2
+ NTP_4_2_5P49
+
+ ntpd/ntpd-opts.h@1.36 +3 -3
+ NTP_4_2_5P49
+
+ ntpd/ntpd-opts.texi@1.35 +1 -1
+ NTP_4_2_5P49
+
+ ntpd/ntpd.1@1.35 +2 -2
+ NTP_4_2_5P49
+
+ ntpdc/ntpdc-opts.c@1.36 +2 -2
+ NTP_4_2_5P49
+
+ ntpdc/ntpdc-opts.h@1.36 +3 -3
+ NTP_4_2_5P49
+
+ ntpdc/ntpdc-opts.texi@1.35 +1 -1
+ NTP_4_2_5P49
+
+ ntpdc/ntpdc.1@1.35 +2 -2
+ NTP_4_2_5P49
+
+ ntpq/ntpq-opts.c@1.36 +2 -2
+ NTP_4_2_5P49
+
+ ntpq/ntpq-opts.h@1.36 +3 -3
+ NTP_4_2_5P49
+
+ ntpq/ntpq-opts.texi@1.35 +1 -1
+ NTP_4_2_5P49
+
+ ntpq/ntpq.1@1.35 +2 -2
+ NTP_4_2_5P49
+
+ packageinfo.sh@1.52 +1 -1
+ NTP_4_2_5P49
+
+ sntp/sntp-opts.c@1.36 +2 -2
+ NTP_4_2_5P49
+
+ sntp/sntp-opts.h@1.36 +3 -3
+ NTP_4_2_5P49
+
+ sntp/sntp-opts.texi@1.35 +1 -1
+ NTP_4_2_5P49
+
+ sntp/sntp.1@1.35 +2 -2
+ NTP_4_2_5P49
+
+ util/ntp-keygen-opts.c@1.37 +2 -2
+ NTP_4_2_5P49
+
+ util/ntp-keygen-opts.h@1.37 +3 -3
+ NTP_4_2_5P49
+
+ util/ntp-keygen-opts.texi@1.36 +1 -1
+ NTP_4_2_5P49
+
+ util/ntp-keygen.1@1.36 +2 -2
+ NTP_4_2_5P49
+
+ChangeSet@1.1512.1.12, 2007-06-14 01:40:14-04:00, stenn@whimsy.udel.edu
+ Leap file fixes from Dave Mills
+
+ ChangeLog@1.68 +1 -0
+ Leap file fixes from Dave Mills
+
+ include/ntpd.h@1.103 +3 -1
+ Leap file fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.253 +35 -12
+ Leap file fixes from Dave Mills
+
+ ntpd/ntp_timer.c@1.36 +9 -2
+ Leap file fixes from Dave Mills
+
+ ntpd/ntp_util.c@1.47.1.1 +52 -2
+ Leap file fixes from Dave Mills
+
+ChangeSet@1.1512.3.1, 2007-06-12 18:03:45-04:00, neal@pogo.udel.edu
+ Many files:
+ allow null driftfile.
+
+ ChangeLog@1.66.1.1 +1 -0
+ allow null driftfile.
+
+ ntpd/ntp_config.c@1.156 +10 -2
+ allow null driftfile.
+
+ ntpd/ntp_parser.c@1.11 +507 -509
+ allow null driftfile.
+
+ ntpd/ntp_parser.h@1.4 +1 -1
+ allow null driftfile.
+
+ ntpd/ntp_parser.y@1.9 +16 -9
+ allow null driftfile.
+
+ ntpd/ntp_scanner.c@1.8 +10 -6
+ allow null driftfile.
+
+ ntpd/ntp_util.c@1.48 +1 -1
+ allow null driftfile.
+
+ChangeSet@1.1512.1.11, 2007-06-12 08:00:26-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P48
+ TAG: NTP_4_2_5P48
+
+ ntpd/ntpd-opts.c@1.35 +2 -2
+ NTP_4_2_5P48
+
+ ntpd/ntpd-opts.h@1.35 +3 -3
+ NTP_4_2_5P48
+
+ ntpd/ntpd-opts.texi@1.34 +1 -1
+ NTP_4_2_5P48
+
+ ntpd/ntpd.1@1.34 +2 -2
+ NTP_4_2_5P48
+
+ ntpdc/ntpdc-opts.c@1.35 +2 -2
+ NTP_4_2_5P48
+
+ ntpdc/ntpdc-opts.h@1.35 +3 -3
+ NTP_4_2_5P48
+
+ ntpdc/ntpdc-opts.texi@1.34 +1 -1
+ NTP_4_2_5P48
+
+ ntpdc/ntpdc.1@1.34 +2 -2
+ NTP_4_2_5P48
+
+ ntpq/ntpq-opts.c@1.35 +2 -2
+ NTP_4_2_5P48
+
+ ntpq/ntpq-opts.h@1.35 +3 -3
+ NTP_4_2_5P48
+
+ ntpq/ntpq-opts.texi@1.34 +1 -1
+ NTP_4_2_5P48
+
+ ntpq/ntpq.1@1.34 +2 -2
+ NTP_4_2_5P48
+
+ packageinfo.sh@1.51 +1 -1
+ NTP_4_2_5P48
+
+ sntp/sntp-opts.c@1.35 +2 -2
+ NTP_4_2_5P48
+
+ sntp/sntp-opts.h@1.35 +3 -3
+ NTP_4_2_5P48
+
+ sntp/sntp-opts.texi@1.34 +1 -1
+ NTP_4_2_5P48
+
+ sntp/sntp.1@1.34 +2 -2
+ NTP_4_2_5P48
+
+ util/ntp-keygen-opts.c@1.36 +2 -2
+ NTP_4_2_5P48
+
+ util/ntp-keygen-opts.h@1.36 +3 -3
+ NTP_4_2_5P48
+
+ util/ntp-keygen-opts.texi@1.35 +1 -1
+ NTP_4_2_5P48
+
+ util/ntp-keygen.1@1.35 +2 -2
+ NTP_4_2_5P48
+
+ChangeSet@1.1512.1.10, 2007-06-11 20:40:23-04:00, stenn@deacon.udel.edu
+ [Bug 858] Recent leapfile changes broke without OPENSSL
+
+ ChangeLog@1.67 +1 -0
+ [Bug 858] Recent leapfile changes broke without OPENSSL
+
+ include/ntp_crypto.h@1.39 +1 -2
+ [Bug 858] Recent leapfile changes broke without OPENSSL
+
+ include/ntpd.h@1.102 +4 -2
+ [Bug 858] Recent leapfile changes broke without OPENSSL
+
+ChangeSet@1.1512.1.9, 2007-06-10 10:00:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P47
+ TAG: NTP_4_2_5P47
+
+ ntpd/ntpd-opts.c@1.34 +2 -2
+ NTP_4_2_5P47
+
+ ntpd/ntpd-opts.h@1.34 +3 -3
+ NTP_4_2_5P47
+
+ ntpd/ntpd-opts.texi@1.33 +1 -1
+ NTP_4_2_5P47
+
+ ntpd/ntpd.1@1.33 +2 -2
+ NTP_4_2_5P47
+
+ ntpdc/ntpdc-opts.c@1.34 +2 -2
+ NTP_4_2_5P47
+
+ ntpdc/ntpdc-opts.h@1.34 +3 -3
+ NTP_4_2_5P47
+
+ ntpdc/ntpdc-opts.texi@1.33 +1 -1
+ NTP_4_2_5P47
+
+ ntpdc/ntpdc.1@1.33 +2 -2
+ NTP_4_2_5P47
+
+ ntpq/ntpq-opts.c@1.34 +2 -2
+ NTP_4_2_5P47
+
+ ntpq/ntpq-opts.h@1.34 +3 -3
+ NTP_4_2_5P47
+
+ ntpq/ntpq-opts.texi@1.33 +1 -1
+ NTP_4_2_5P47
+
+ ntpq/ntpq.1@1.33 +2 -2
+ NTP_4_2_5P47
+
+ packageinfo.sh@1.50 +1 -1
+ NTP_4_2_5P47
+
+ sntp/sntp-opts.c@1.34 +2 -2
+ NTP_4_2_5P47
+
+ sntp/sntp-opts.h@1.34 +3 -3
+ NTP_4_2_5P47
+
+ sntp/sntp-opts.texi@1.33 +1 -1
+ NTP_4_2_5P47
+
+ sntp/sntp.1@1.33 +2 -2
+ NTP_4_2_5P47
+
+ util/ntp-keygen-opts.c@1.35 +2 -2
+ NTP_4_2_5P47
+
+ util/ntp-keygen-opts.h@1.35 +3 -3
+ NTP_4_2_5P47
+
+ util/ntp-keygen-opts.texi@1.34 +1 -1
+ NTP_4_2_5P47
+
+ util/ntp-keygen.1@1.34 +2 -2
+ NTP_4_2_5P47
+
+ChangeSet@1.1436.1.57, 2007-06-10 07:58:59-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P2_RC6
+ TAG: NTP_4_2_4P2_RC6
+
+ ntpd/ntpd-opts.c@1.50.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ ntpd/ntpd-opts.h@1.50.7.1 +3 -3
+ NTP_4_2_4P2_RC6
+
+ ntpd/ntpd-opts.texi@1.49.7.1 +1 -1
+ NTP_4_2_4P2_RC6
+
+ ntpd/ntpd.1@1.48.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ ntpd/ntpdsim-opts.c@1.50.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ ntpd/ntpdsim-opts.h@1.50.7.1 +3 -3
+ NTP_4_2_4P2_RC6
+
+ ntpd/ntpdsim-opts.texi@1.48.7.1 +1 -1
+ NTP_4_2_4P2_RC6
+
+ ntpd/ntpdsim.1@1.48.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ ntpdc/ntpdc-opts.c@1.50.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ ntpdc/ntpdc-opts.h@1.50.7.1 +3 -3
+ NTP_4_2_4P2_RC6
+
+ ntpdc/ntpdc-opts.texi@1.48.7.1 +1 -1
+ NTP_4_2_4P2_RC6
+
+ ntpdc/ntpdc.1@1.48.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ ntpq/ntpq-opts.c@1.52.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ ntpq/ntpq-opts.h@1.52.7.1 +3 -3
+ NTP_4_2_4P2_RC6
+
+ ntpq/ntpq-opts.texi@1.49.7.1 +1 -1
+ NTP_4_2_4P2_RC6
+
+ ntpq/ntpq.1@1.48.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ packageinfo.sh@1.65.13.1 +1 -1
+ NTP_4_2_4P2_RC6
+
+ sntp/sntp-opts.c@1.49.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ sntp/sntp-opts.h@1.49.7.1 +3 -3
+ NTP_4_2_4P2_RC6
+
+ sntp/sntp-opts.texi@1.46.7.1 +1 -1
+ NTP_4_2_4P2_RC6
+
+ sntp/sntp.1@1.49.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ util/ntp-keygen-opts.c@1.49.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ util/ntp-keygen-opts.h@1.49.7.1 +3 -3
+ NTP_4_2_4P2_RC6
+
+ util/ntp-keygen-opts.texi@1.47.7.1 +1 -1
+ NTP_4_2_4P2_RC6
+
+ util/ntp-keygen.1@1.47.7.1 +2 -2
+ NTP_4_2_4P2_RC6
+
+ChangeSet@1.1512.1.8, 2007-06-10 03:26:26-04:00, stenn@deacon.udel.edu
+ ntp_dir_sep.m4, config.h:
+ Use a char for DIR_SEP, not a string
+ ntp_util.c, ntp_loopfilter.c, ntpd.h, ntp.h, ntp_timer.c, ChangeLog:
+ leap file improvements from Dave Mills.
+
+ ChangeLog@1.66 +1 -0
+ leap file improvements from Dave Mills.
+
+ include/ntp.h@1.132 +1 -0
+ leap file improvements from Dave Mills.
+
+ include/ntpd.h@1.101 +2 -1
+ leap file improvements from Dave Mills.
+
+ m4/ntp_dir_sep.m4@1.2 +3 -3
+ Use a char for DIR_SEP, not a string
+
+ ntpd/ntp_loopfilter.c@1.134 +13 -37
+ leap file improvements from Dave Mills.
+
+ ntpd/ntp_timer.c@1.35 +6 -0
+ leap file improvements from Dave Mills.
+
+ ntpd/ntp_util.c@1.47 +138 -45
+ leap file improvements from Dave Mills.
+
+ ports/winnt/include/config.h@1.50 +1 -1
+ Use a char for DIR_SEP, not a string
+
+ChangeSet@1.1512.2.1, 2007-06-07 15:57:08-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P46
+ TAG: NTP_4_2_5P46
+
+ ntpd/ntpd-opts.c@1.33 +2 -2
+ NTP_4_2_5P46
+
+ ntpd/ntpd-opts.h@1.33 +3 -3
+ NTP_4_2_5P46
+
+ ntpd/ntpd-opts.texi@1.32 +1 -1
+ NTP_4_2_5P46
+
+ ntpd/ntpd.1@1.32 +2 -2
+ NTP_4_2_5P46
+
+ ntpdc/ntpdc-opts.c@1.33 +2 -2
+ NTP_4_2_5P46
+
+ ntpdc/ntpdc-opts.h@1.33 +3 -3
+ NTP_4_2_5P46
+
+ ntpdc/ntpdc-opts.texi@1.32 +1 -1
+ NTP_4_2_5P46
+
+ ntpdc/ntpdc.1@1.32 +2 -2
+ NTP_4_2_5P46
+
+ ntpq/ntpq-opts.c@1.33 +2 -2
+ NTP_4_2_5P46
+
+ ntpq/ntpq-opts.h@1.33 +3 -3
+ NTP_4_2_5P46
+
+ ntpq/ntpq-opts.texi@1.32 +1 -1
+ NTP_4_2_5P46
+
+ ntpq/ntpq.1@1.32 +2 -2
+ NTP_4_2_5P46
+
+ packageinfo.sh@1.49 +1 -1
+ NTP_4_2_5P46
+
+ sntp/sntp-opts.c@1.33 +2 -2
+ NTP_4_2_5P46
+
+ sntp/sntp-opts.h@1.33 +3 -3
+ NTP_4_2_5P46
+
+ sntp/sntp-opts.texi@1.32 +1 -1
+ NTP_4_2_5P46
+
+ sntp/sntp.1@1.32 +2 -2
+ NTP_4_2_5P46
+
+ util/ntp-keygen-opts.c@1.34 +2 -2
+ NTP_4_2_5P46
+
+ util/ntp-keygen-opts.h@1.34 +3 -3
+ NTP_4_2_5P46
+
+ util/ntp-keygen-opts.texi@1.33 +1 -1
+ NTP_4_2_5P46
+
+ util/ntp-keygen.1@1.33 +2 -2
+ NTP_4_2_5P46
+
+ChangeSet@1.1512.1.5, 2007-06-07 10:48:26-04:00, neal@pogo.udel.edu
+ ntp_parser.y, ntp_parser.h, ntp_parser.c, ChangeLog, ntp_config.c:
+ [Bug 850] driftfile parsing changes.
+
+ ChangeLog@1.64 +1 -0
+ [Bug 850] driftfile parsing changes.
+
+ ntpd/ntp_config.c@1.155 +3 -0
+ [Bug 850] driftfile parsing changes.
+
+ ntpd/ntp_parser.c@1.10 +2040 -1569
+ [Bug 850] driftfile parsing changes.
+
+ ntpd/ntp_parser.h@1.3 +345 -154
+ [Bug 850] driftfile parsing changes.
+
+ ntpd/ntp_parser.y@1.8 +9 -2
+ [Bug 850] driftfile parsing changes.
+
+ChangeSet@1.1436.1.56, 2007-06-07 09:28:16-04:00, mayer@pogo.udel.edu
+ Bug #854 Broadcast address was not correctly set for interface addresses
+
+ ChangeLog@1.1.1.18 +1 -0
+ Bug #854 Broadcast address was not correctly set for interface addresses
+
+ChangeSet@1.1436.1.55, 2007-06-07 09:25:17-04:00, mayer@pogo.udel.edu
+ Bug #854 Broadcast address was not correctly set for interface addresses
+
+ ports/winnt/libisc/interfaceiter.c@1.7 +35 -13
+ Bug #854 Broadcast address was not correctly set for interface addresses
+
+ChangeSet@1.1512.1.4, 2007-06-07 06:40:49-04:00, stenn@deacon.udel.edu
+ driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance
+
+ ChangeLog@1.63 +2 -0
+ driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance
+
+ ntpd/ntp_util.c@1.46 +8 -15
+ driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance
+
+ ntpd/ntpd.c@1.87 +1 -1
+ driftfile maintenance changes from Dave Mills. Use clock_phi instead of stats_write_tolerance
+
+ChangeSet@1.1512.1.3, 2007-06-07 01:49:17-04:00, stenn@deacon.udel.edu
+ IRIG refclock improvements from Dave Mills
+
+ ntpd/refclock_irig.c@1.31 +55 -65
+ IRIG refclock improvements from Dave Mills
+
+ChangeSet@1.1512.1.2, 2007-06-05 07:45:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P45
+ TAG: NTP_4_2_5P45
+
+ ntpd/ntpd-opts.c@1.32 +2 -2
+ NTP_4_2_5P45
+
+ ntpd/ntpd-opts.h@1.32 +3 -3
+ NTP_4_2_5P45
+
+ ntpd/ntpd-opts.texi@1.31 +1 -1
+ NTP_4_2_5P45
+
+ ntpd/ntpd.1@1.31 +2 -2
+ NTP_4_2_5P45
+
+ ntpdc/ntpdc-opts.c@1.32 +2 -2
+ NTP_4_2_5P45
+
+ ntpdc/ntpdc-opts.h@1.32 +3 -3
+ NTP_4_2_5P45
+
+ ntpdc/ntpdc-opts.texi@1.31 +1 -1
+ NTP_4_2_5P45
+
+ ntpdc/ntpdc.1@1.31 +2 -2
+ NTP_4_2_5P45
+
+ ntpq/ntpq-opts.c@1.32 +2 -2
+ NTP_4_2_5P45
+
+ ntpq/ntpq-opts.h@1.32 +3 -3
+ NTP_4_2_5P45
+
+ ntpq/ntpq-opts.texi@1.31 +1 -1
+ NTP_4_2_5P45
+
+ ntpq/ntpq.1@1.31 +2 -2
+ NTP_4_2_5P45
+
+ packageinfo.sh@1.48 +1 -1
+ NTP_4_2_5P45
+
+ sntp/sntp-opts.c@1.32 +2 -2
+ NTP_4_2_5P45
+
+ sntp/sntp-opts.h@1.32 +3 -3
+ NTP_4_2_5P45
+
+ sntp/sntp-opts.texi@1.31 +1 -1
+ NTP_4_2_5P45
+
+ sntp/sntp.1@1.31 +2 -2
+ NTP_4_2_5P45
+
+ util/ntp-keygen-opts.c@1.33 +2 -2
+ NTP_4_2_5P45
+
+ util/ntp-keygen-opts.h@1.33 +3 -3
+ NTP_4_2_5P45
+
+ util/ntp-keygen-opts.texi@1.32 +1 -1
+ NTP_4_2_5P45
+
+ util/ntp-keygen.1@1.32 +2 -2
+ NTP_4_2_5P45
+
+ChangeSet@1.1512.1.1, 2007-06-05 02:28:01-04:00, stenn@whimsy.udel.edu
+ indentation cleanup
+
+ ntpd/ntp_config.c@1.154 +1676 -1559
+ indentation cleanup
+
+ChangeSet@1.1495.1.1, 2007-06-02 18:30:39-04:00, mayer@pogo.udel.edu
+ Bug #629 Allow certain broadcast packets to be received on the wildcard socket
+
+ include/ntp_io.h@1.6 +3 -0
+ Bug #629 Allow certain broadcast packets to be received on the wildcard socket
+
+ include/ntp_request.h@1.32 +7 -0
+ Bug #629 Allow certain broadcast packets to be received on the wildcard socket
+
+ ntpd/ntp_io.c@1.249.1.1 +27 -2
+ Bug #629 Allow certain broadcast packets to be received on the wildcard socket
+
+ ntpd/ntp_request.c@1.68 +9 -0
+ Bug #629 Allow certain broadcast packets to be received on the wildcard socket
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.26 +20 -2
+ Bug #629 Allow certain broadcast packets to be received on the wildcard socket
+
+ChangeSet@1.1512, 2007-06-02 07:44:39-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P44
+ TAG: NTP_4_2_5P44
+
+ ntpd/ntpd-opts.c@1.31 +2 -2
+ NTP_4_2_5P44
+
+ ntpd/ntpd-opts.h@1.31 +3 -3
+ NTP_4_2_5P44
+
+ ntpd/ntpd-opts.texi@1.30 +1 -1
+ NTP_4_2_5P44
+
+ ntpd/ntpd.1@1.30 +2 -2
+ NTP_4_2_5P44
+
+ ntpdc/ntpdc-opts.c@1.31 +2 -2
+ NTP_4_2_5P44
+
+ ntpdc/ntpdc-opts.h@1.31 +3 -3
+ NTP_4_2_5P44
+
+ ntpdc/ntpdc-opts.texi@1.30 +1 -1
+ NTP_4_2_5P44
+
+ ntpdc/ntpdc.1@1.30 +2 -2
+ NTP_4_2_5P44
+
+ ntpq/ntpq-opts.c@1.31 +2 -2
+ NTP_4_2_5P44
+
+ ntpq/ntpq-opts.h@1.31 +3 -3
+ NTP_4_2_5P44
+
+ ntpq/ntpq-opts.texi@1.30 +1 -1
+ NTP_4_2_5P44
+
+ ntpq/ntpq.1@1.30 +2 -2
+ NTP_4_2_5P44
+
+ packageinfo.sh@1.47 +1 -1
+ NTP_4_2_5P44
+
+ sntp/sntp-opts.c@1.31 +2 -2
+ NTP_4_2_5P44
+
+ sntp/sntp-opts.h@1.31 +3 -3
+ NTP_4_2_5P44
+
+ sntp/sntp-opts.texi@1.30 +1 -1
+ NTP_4_2_5P44
+
+ sntp/sntp.1@1.30 +2 -2
+ NTP_4_2_5P44
+
+ util/ntp-keygen-opts.c@1.32 +2 -2
+ NTP_4_2_5P44
+
+ util/ntp-keygen-opts.h@1.32 +3 -3
+ NTP_4_2_5P44
+
+ util/ntp-keygen-opts.texi@1.31 +1 -1
+ NTP_4_2_5P44
+
+ util/ntp-keygen.1@1.31 +2 -2
+ NTP_4_2_5P44
+
+ChangeSet@1.1511, 2007-06-02 00:27:35-04:00, stenn@whimsy.udel.edu
+ Updated from the recent change to ntp_parser.y
+
+ ntpd/ntp_parser.c@1.9 +196 -182
+ Updated from the recent change to ntp_parser.y
+
+ChangeSet@1.1510, 2007-06-01 18:30:18-04:00, neal@pogo.udel.edu
+ ntp_scanner.c, ChangeLog:
+ [Bug 828] refid not being parsed correctly.
+
+ ChangeLog@1.62 +1 -0
+ [Bug 828] refid not being parsed correctly.
+
+ ntpd/ntp_scanner.c@1.7 +8 -6
+ [Bug 828] refid not being parsed correctly.
+
+ChangeSet@1.1506.1.2, 2007-06-01 08:13:55-04:00, neal@pogo.udel.edu
+ commit to correct bk merge problems.
+
+ ChangeLog@1.59.1.2 +1 -0
+
+ChangeSet@1.1506.1.1, 2007-06-01 07:52:58-04:00, neal@pogo.udel.edu
+ ntp_parser.y, ntp_scanner.c, ChangeLog:
+ [Bug 846] Correct includefile parsing.
+
+ ChangeLog@1.59.1.1 +1 -0
+ [Bug 846] Correct includefile parsing.
+
+ ntpd/ntp_parser.y@1.7 +2 -2
+ [Bug 846] Correct includefile parsing.
+
+ ntpd/ntp_scanner.c@1.6 +7 -2
+ [Bug 846] Correct includefile parsing.
+
+ChangeSet@1.1508, 2007-06-01 07:44:04-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P43
+ TAG: NTP_4_2_5P43
+
+ ntpd/ntpd-opts.c@1.30 +2 -2
+ NTP_4_2_5P43
+
+ ntpd/ntpd-opts.h@1.30 +3 -3
+ NTP_4_2_5P43
+
+ ntpd/ntpd-opts.texi@1.29 +1 -1
+ NTP_4_2_5P43
+
+ ntpd/ntpd.1@1.29 +2 -2
+ NTP_4_2_5P43
+
+ ntpdc/ntpdc-opts.c@1.30 +2 -2
+ NTP_4_2_5P43
+
+ ntpdc/ntpdc-opts.h@1.30 +3 -3
+ NTP_4_2_5P43
+
+ ntpdc/ntpdc-opts.texi@1.29 +1 -1
+ NTP_4_2_5P43
+
+ ntpdc/ntpdc.1@1.29 +2 -2
+ NTP_4_2_5P43
+
+ ntpq/ntpq-opts.c@1.30 +2 -2
+ NTP_4_2_5P43
+
+ ntpq/ntpq-opts.h@1.30 +3 -3
+ NTP_4_2_5P43
+
+ ntpq/ntpq-opts.texi@1.29 +1 -1
+ NTP_4_2_5P43
+
+ ntpq/ntpq.1@1.29 +2 -2
+ NTP_4_2_5P43
+
+ packageinfo.sh@1.46 +1 -1
+ NTP_4_2_5P43
+
+ sntp/sntp-opts.c@1.30 +2 -2
+ NTP_4_2_5P43
+
+ sntp/sntp-opts.h@1.30 +3 -3
+ NTP_4_2_5P43
+
+ sntp/sntp-opts.texi@1.29 +1 -1
+ NTP_4_2_5P43
+
+ sntp/sntp.1@1.29 +2 -2
+ NTP_4_2_5P43
+
+ util/ntp-keygen-opts.c@1.31 +2 -2
+ NTP_4_2_5P43
+
+ util/ntp-keygen-opts.h@1.31 +3 -3
+ NTP_4_2_5P43
+
+ util/ntp-keygen-opts.texi@1.30 +1 -1
+ NTP_4_2_5P43
+
+ util/ntp-keygen.1@1.30 +2 -2
+ NTP_4_2_5P43
+
+ChangeSet@1.1507, 2007-06-01 02:17:28-04:00, stenn@whimsy.udel.edu
+ [Bug 827] New parsing code does not handle "fudge" correctly
+
+ ChangeLog@1.60 +1 -0
+ [Bug 827] New parsing code does not handle "fudge" correctly
+
+ChangeSet@1.1506, 2007-05-31 07:47:43-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P42
+ TAG: NTP_4_2_5P42
+
+ ntpd/ntpd-opts.c@1.29 +4 -5
+ NTP_4_2_5P42
+
+ ntpd/ntpd-opts.h@1.29 +5 -6
+ NTP_4_2_5P42
+
+ ntpd/ntpd-opts.texi@1.28 +2 -3
+ NTP_4_2_5P42
+
+ ntpd/ntpd.1@1.28 +3 -3
+ NTP_4_2_5P42
+
+ ntpdc/ntpdc-opts.c@1.29 +4 -5
+ NTP_4_2_5P42
+
+ ntpdc/ntpdc-opts.h@1.29 +5 -6
+ NTP_4_2_5P42
+
+ ntpdc/ntpdc-opts.texi@1.28 +2 -3
+ NTP_4_2_5P42
+
+ ntpdc/ntpdc.1@1.28 +3 -3
+ NTP_4_2_5P42
+
+ ntpq/ntpq-opts.c@1.29 +4 -5
+ NTP_4_2_5P42
+
+ ntpq/ntpq-opts.h@1.29 +5 -6
+ NTP_4_2_5P42
+
+ ntpq/ntpq-opts.texi@1.28 +2 -3
+ NTP_4_2_5P42
+
+ ntpq/ntpq.1@1.28 +3 -3
+ NTP_4_2_5P42
+
+ packageinfo.sh@1.45 +1 -1
+ NTP_4_2_5P42
+
+ sntp/sntp-opts.c@1.29 +4 -5
+ NTP_4_2_5P42
+
+ sntp/sntp-opts.h@1.29 +5 -6
+ NTP_4_2_5P42
+
+ sntp/sntp-opts.texi@1.28 +2 -3
+ NTP_4_2_5P42
+
+ sntp/sntp.1@1.28 +3 -3
+ NTP_4_2_5P42
+
+ util/ntp-keygen-opts.c@1.30 +4 -5
+ NTP_4_2_5P42
+
+ util/ntp-keygen-opts.h@1.30 +5 -6
+ NTP_4_2_5P42
+
+ util/ntp-keygen-opts.texi@1.29 +2 -3
+ NTP_4_2_5P42
+
+ util/ntp-keygen.1@1.29 +3 -3
+ NTP_4_2_5P42
+
+ChangeSet@1.1505, 2007-05-31 01:32:15-04:00, stenn@whimsy.udel.edu
+ Enable debugging capability in the config parser.
+
+ ChangeLog@1.59 +1 -0
+ Enable debugging capability in the config parser.
+
+ ntpd/Makefile.am@1.61 +1 -1
+ Enable debugging capability in the config parser.
+
+ ntpd/ntp_parser.c@1.8 +1 -1
+ Enable debugging capability in the config parser.
+
+ChangeSet@1.1504, 2007-05-30 22:54:36-04:00, stenn@whimsy.udel.edu
+ [Bug 839] Crypto password not read from ntp.conf
+
+ ChangeLog@1.58 +1 -0
+ [Bug 839] Crypto password not read from ntp.conf
+
+ ntpd/ntp_parser.c@1.7 +198 -194
+ [Bug 839] Crypto password not read from ntp.conf
+
+ ntpd/ntp_parser.y@1.6 +5 -1
+ [Bug 839] Crypto password not read from ntp.conf
+
+ChangeSet@1.1503, 2007-05-30 22:44:11-04:00, stenn@whimsy.udel.edu
+ Have autogen produce writable output files
+
+ ChangeLog@1.57 +1 -0
+ Have autogen produce writable output files
+
+ ntpd/Makefile.am@1.60 +1 -1
+ Have autogen produce writable output files
+
+ ntpdc/Makefile.am@1.36 +1 -1
+ Have autogen produce writable output files
+
+ ntpq/Makefile.am@1.28 +1 -1
+ Have autogen produce writable output files
+
+ sntp/Makefile.am@1.22 +2 -2
+ Have autogen produce writable output files
+
+ util/Makefile.am@1.37 +1 -1
+ Have autogen produce writable output files
+
+ChangeSet@1.1501, 2007-05-30 07:45:27-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P41
+ TAG: NTP_4_2_5P41
+
+ ntpd/ntpd-opts.c@1.28 +2 -2
+ NTP_4_2_5P41
+
+ ntpd/ntpd-opts.h@1.28 +3 -3
+ NTP_4_2_5P41
+
+ ntpd/ntpd-opts.texi@1.27 +1 -1
+ NTP_4_2_5P41
+
+ ntpd/ntpd.1@1.27 +2 -2
+ NTP_4_2_5P41
+
+ ntpdc/ntpdc-opts.c@1.28 +2 -2
+ NTP_4_2_5P41
+
+ ntpdc/ntpdc-opts.h@1.28 +3 -3
+ NTP_4_2_5P41
+
+ ntpdc/ntpdc-opts.texi@1.27 +1 -1
+ NTP_4_2_5P41
+
+ ntpdc/ntpdc.1@1.27 +2 -2
+ NTP_4_2_5P41
+
+ ntpq/ntpq-opts.c@1.28 +2 -2
+ NTP_4_2_5P41
+
+ ntpq/ntpq-opts.h@1.28 +3 -3
+ NTP_4_2_5P41
+
+ ntpq/ntpq-opts.texi@1.27 +1 -1
+ NTP_4_2_5P41
+
+ ntpq/ntpq.1@1.27 +2 -2
+ NTP_4_2_5P41
+
+ packageinfo.sh@1.44 +1 -1
+ NTP_4_2_5P41
+
+ sntp/sntp-opts.c@1.28 +2 -2
+ NTP_4_2_5P41
+
+ sntp/sntp-opts.h@1.28 +3 -3
+ NTP_4_2_5P41
+
+ sntp/sntp-opts.texi@1.27 +1 -1
+ NTP_4_2_5P41
+
+ sntp/sntp.1@1.27 +2 -2
+ NTP_4_2_5P41
+
+ util/ntp-keygen-opts.c@1.29 +2 -2
+ NTP_4_2_5P41
+
+ util/ntp-keygen-opts.h@1.29 +3 -3
+ NTP_4_2_5P41
+
+ util/ntp-keygen-opts.texi@1.28 +1 -1
+ NTP_4_2_5P41
+
+ util/ntp-keygen.1@1.28 +2 -2
+ NTP_4_2_5P41
+
+ChangeSet@1.1500, 2007-05-29 23:39:45-04:00, stenn@pogo.udel.edu
+ ChangeLog:
+ [Bug 825] Correct logconfig -/+ keyword processing.
+ [Bug 828] Correct parsing of " delimited strings.
+
+ ChangeLog@1.56 +2 -0
+ [Bug 825] Correct logconfig -/+ keyword processing.
+ [Bug 828] Correct parsing of " delimited strings.
+
+ChangeSet@1.1499, 2007-05-29 15:46:00-04:00, neal@pogo.udel.edu
+ ntp_config.c:
+ [Bug 825] Correct logconfig -/+ keyword processing.
+ ntp_scanner.c:
+ [Bug 828] Correct parsing of " delimited strings.
+
+ ntpd/ntp_config.c@1.153 +1 -1
+ [Bug 825] Correct logconfig -/+ keyword processing.
+
+ ntpd/ntp_scanner.c@1.5 +14 -2
+ [Bug 828] Correct parsing of " delimited strings.
+
+ChangeSet@1.1498, 2007-05-29 09:39:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P40
+ TAG: NTP_4_2_5P40
+
+ ntpd/ntpd-opts.c@1.27 +2 -2
+ NTP_4_2_5P40
+
+ ntpd/ntpd-opts.h@1.27 +3 -3
+ NTP_4_2_5P40
+
+ ntpd/ntpd-opts.texi@1.26 +1 -1
+ NTP_4_2_5P40
+
+ ntpd/ntpd.1@1.26 +2 -2
+ NTP_4_2_5P40
+
+ ntpdc/ntpdc-opts.c@1.27 +2 -2
+ NTP_4_2_5P40
+
+ ntpdc/ntpdc-opts.h@1.27 +3 -3
+ NTP_4_2_5P40
+
+ ntpdc/ntpdc-opts.texi@1.26 +1 -1
+ NTP_4_2_5P40
+
+ ntpdc/ntpdc.1@1.26 +2 -2
+ NTP_4_2_5P40
+
+ ntpq/ntpq-opts.c@1.27 +2 -2
+ NTP_4_2_5P40
+
+ ntpq/ntpq-opts.h@1.27 +3 -3
+ NTP_4_2_5P40
+
+ ntpq/ntpq-opts.texi@1.26 +1 -1
+ NTP_4_2_5P40
+
+ ntpq/ntpq.1@1.26 +2 -2
+ NTP_4_2_5P40
+
+ packageinfo.sh@1.43 +1 -1
+ NTP_4_2_5P40
+
+ sntp/sntp-opts.c@1.27 +2 -2
+ NTP_4_2_5P40
+
+ sntp/sntp-opts.h@1.27 +3 -3
+ NTP_4_2_5P40
+
+ sntp/sntp-opts.texi@1.26 +1 -1
+ NTP_4_2_5P40
+
+ sntp/sntp.1@1.26 +2 -2
+ NTP_4_2_5P40
+
+ util/ntp-keygen-opts.c@1.28 +2 -2
+ NTP_4_2_5P40
+
+ util/ntp-keygen-opts.h@1.28 +3 -3
+ NTP_4_2_5P40
+
+ util/ntp-keygen-opts.texi@1.27 +1 -1
+ NTP_4_2_5P40
+
+ util/ntp-keygen.1@1.27 +2 -2
+ NTP_4_2_5P40
+
+ChangeSet@1.1436.1.54, 2007-05-29 07:43:58-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P2_RC5
+ TAG: NTP_4_2_4P2_RC5
+
+ ntpd/ntpd-opts.c@1.50.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ ntpd/ntpd-opts.h@1.50.6.1 +3 -3
+ NTP_4_2_4P2_RC5
+
+ ntpd/ntpd-opts.texi@1.49.6.1 +1 -1
+ NTP_4_2_4P2_RC5
+
+ ntpd/ntpd.1@1.48.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ ntpd/ntpdsim-opts.c@1.50.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ ntpd/ntpdsim-opts.h@1.50.6.1 +3 -3
+ NTP_4_2_4P2_RC5
+
+ ntpd/ntpdsim-opts.texi@1.48.6.1 +1 -1
+ NTP_4_2_4P2_RC5
+
+ ntpd/ntpdsim.1@1.48.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ ntpdc/ntpdc-opts.c@1.50.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ ntpdc/ntpdc-opts.h@1.50.6.1 +3 -3
+ NTP_4_2_4P2_RC5
+
+ ntpdc/ntpdc-opts.texi@1.48.6.1 +1 -1
+ NTP_4_2_4P2_RC5
+
+ ntpdc/ntpdc.1@1.48.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ ntpq/ntpq-opts.c@1.52.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ ntpq/ntpq-opts.h@1.52.6.1 +3 -3
+ NTP_4_2_4P2_RC5
+
+ ntpq/ntpq-opts.texi@1.49.6.1 +1 -1
+ NTP_4_2_4P2_RC5
+
+ ntpq/ntpq.1@1.48.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ packageinfo.sh@1.65.12.1 +1 -1
+ NTP_4_2_4P2_RC5
+
+ sntp/sntp-opts.c@1.49.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ sntp/sntp-opts.h@1.49.6.1 +3 -3
+ NTP_4_2_4P2_RC5
+
+ sntp/sntp-opts.texi@1.46.6.1 +1 -1
+ NTP_4_2_4P2_RC5
+
+ sntp/sntp.1@1.49.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ util/ntp-keygen-opts.c@1.49.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ util/ntp-keygen-opts.h@1.49.6.1 +3 -3
+ NTP_4_2_4P2_RC5
+
+ util/ntp-keygen-opts.texi@1.47.6.1 +1 -1
+ NTP_4_2_4P2_RC5
+
+ util/ntp-keygen.1@1.47.6.1 +2 -2
+ NTP_4_2_4P2_RC5
+
+ChangeSet@1.1436.1.53, 2007-05-29 01:32:29-04:00, stenn@whimsy.udel.edu
+ typo cleanup
+
+ ChangeLog@1.1.1.17 +1 -1
+ typo cleanup
+
+ NEWS@1.86.1.7 +1 -2
+ typo cleanup
+
+ChangeSet@1.1496, 2007-05-29 01:07:40-04:00, stenn@whimsy.udel.edu
+ Cleanup FILE * usage after fclose() in ntp_filegen.c
+
+ ChangeLog@1.54 +5 -3
+ Cleanup FILE * usage after fclose() in ntp_filegen.c
+
+ ntpd/ntp_filegen.c@1.13 +27 -19
+ Cleanup FILE * usage after fclose() in ntp_filegen.c
+
+ChangeSet@1.1495, 2007-05-28 07:47:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P39
+ TAG: NTP_4_2_5P39
+
+ ntpd/ntpd-opts.c@1.26 +2 -2
+ NTP_4_2_5P39
+
+ ntpd/ntpd-opts.h@1.26 +3 -3
+ NTP_4_2_5P39
+
+ ntpd/ntpd-opts.texi@1.25 +1 -1
+ NTP_4_2_5P39
+
+ ntpd/ntpd.1@1.25 +2 -2
+ NTP_4_2_5P39
+
+ ntpdc/ntpdc-opts.c@1.26 +2 -2
+ NTP_4_2_5P39
+
+ ntpdc/ntpdc-opts.h@1.26 +3 -3
+ NTP_4_2_5P39
+
+ ntpdc/ntpdc-opts.texi@1.25 +1 -1
+ NTP_4_2_5P39
+
+ ntpdc/ntpdc.1@1.25 +2 -2
+ NTP_4_2_5P39
+
+ ntpq/ntpq-opts.c@1.26 +2 -2
+ NTP_4_2_5P39
+
+ ntpq/ntpq-opts.h@1.26 +3 -3
+ NTP_4_2_5P39
+
+ ntpq/ntpq-opts.texi@1.25 +1 -1
+ NTP_4_2_5P39
+
+ ntpq/ntpq.1@1.25 +2 -2
+ NTP_4_2_5P39
+
+ packageinfo.sh@1.42 +1 -1
+ NTP_4_2_5P39
+
+ sntp/sntp-opts.c@1.26 +2 -2
+ NTP_4_2_5P39
+
+ sntp/sntp-opts.h@1.26 +3 -3
+ NTP_4_2_5P39
+
+ sntp/sntp-opts.texi@1.25 +1 -1
+ NTP_4_2_5P39
+
+ sntp/sntp.1@1.25 +2 -2
+ NTP_4_2_5P39
+
+ util/ntp-keygen-opts.c@1.27 +2 -2
+ NTP_4_2_5P39
+
+ util/ntp-keygen-opts.h@1.27 +3 -3
+ NTP_4_2_5P39
+
+ util/ntp-keygen-opts.texi@1.26 +1 -1
+ NTP_4_2_5P39
+
+ util/ntp-keygen.1@1.26 +2 -2
+ NTP_4_2_5P39
+
+ChangeSet@1.1436.1.52, 2007-05-28 10:00:27+00:00, kardel@pogo.udel.edu
+ NEWS, ntp_io.c, ChangeLog:
+ Bug 829: reduce syslog noise, while there fix Enabled/Disable logging
+ to reflect the actual configuration
+
+ ChangeLog@1.1.1.16 +2 -0
+ Bug 829: reduce syslog noise, while there fix Enabled/Disable logging
+ to reflect the actual configuration
+
+ NEWS@1.86.1.6 +3 -0
+ Bug 829: reduce syslog noise, while there fix Enabled/Disable logging
+ to reflect the actual configuration
+
+ ntpd/ntp_io.c@1.244.2.6 +58 -44
+ Bug 829: reduce syslog noise, while there fix Enabled/Disable logging
+ to reflect the actual configuration
+
+ChangeSet@1.1493, 2007-05-27 20:13:47-04:00, mayer@pogo.udel.edu
+ Bug #843 Windows Completion port code was incorrectly merged from -stable
+
+ ChangeLog@1.53 +1 -0
+ Bug #843 Windows Completion port code was incorrectly merged from -stable
+
+ChangeSet@1.1492, 2007-05-27 20:11:03-04:00, mayer@pogo.udel.edu
+ Bug #843 Windows Completion port code was incorrectly merged from -stable
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.25 +0 -15
+ Bug #843 Windows Completion port code was incorrectly merged from -stable
+
+ChangeSet@1.1491, 2007-05-27 09:46:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P38
+ TAG: NTP_4_2_5P38
+
+ ntpd/ntpd-opts.c@1.25 +2 -2
+ NTP_4_2_5P38
+
+ ntpd/ntpd-opts.h@1.25 +3 -3
+ NTP_4_2_5P38
+
+ ntpd/ntpd-opts.texi@1.24 +1 -1
+ NTP_4_2_5P38
+
+ ntpd/ntpd.1@1.24 +2 -2
+ NTP_4_2_5P38
+
+ ntpdc/ntpdc-opts.c@1.25 +2 -2
+ NTP_4_2_5P38
+
+ ntpdc/ntpdc-opts.h@1.25 +3 -3
+ NTP_4_2_5P38
+
+ ntpdc/ntpdc-opts.texi@1.24 +1 -1
+ NTP_4_2_5P38
+
+ ntpdc/ntpdc.1@1.24 +2 -2
+ NTP_4_2_5P38
+
+ ntpq/ntpq-opts.c@1.25 +2 -2
+ NTP_4_2_5P38
+
+ ntpq/ntpq-opts.h@1.25 +3 -3
+ NTP_4_2_5P38
+
+ ntpq/ntpq-opts.texi@1.24 +1 -1
+ NTP_4_2_5P38
+
+ ntpq/ntpq.1@1.24 +2 -2
+ NTP_4_2_5P38
+
+ packageinfo.sh@1.41 +1 -1
+ NTP_4_2_5P38
+
+ sntp/sntp-opts.c@1.25 +2 -2
+ NTP_4_2_5P38
+
+ sntp/sntp-opts.h@1.25 +3 -3
+ NTP_4_2_5P38
+
+ sntp/sntp-opts.texi@1.24 +1 -1
+ NTP_4_2_5P38
+
+ sntp/sntp.1@1.24 +2 -2
+ NTP_4_2_5P38
+
+ util/ntp-keygen-opts.c@1.26 +2 -2
+ NTP_4_2_5P38
+
+ util/ntp-keygen-opts.h@1.26 +3 -3
+ NTP_4_2_5P38
+
+ util/ntp-keygen-opts.texi@1.25 +1 -1
+ NTP_4_2_5P38
+
+ util/ntp-keygen.1@1.25 +2 -2
+ NTP_4_2_5P38
+
+ChangeSet@1.1436.1.51, 2007-05-27 07:45:05-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P2_RC4
+ TAG: NTP_4_2_4P2_RC4
+
+ ntpd/ntpd-opts.c@1.50.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ ntpd/ntpd-opts.h@1.50.5.1 +3 -3
+ NTP_4_2_4P2_RC4
+
+ ntpd/ntpd-opts.texi@1.49.5.1 +1 -1
+ NTP_4_2_4P2_RC4
+
+ ntpd/ntpd.1@1.48.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ ntpd/ntpdsim-opts.c@1.50.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ ntpd/ntpdsim-opts.h@1.50.5.1 +3 -3
+ NTP_4_2_4P2_RC4
+
+ ntpd/ntpdsim-opts.texi@1.48.5.1 +1 -1
+ NTP_4_2_4P2_RC4
+
+ ntpd/ntpdsim.1@1.48.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ ntpdc/ntpdc-opts.c@1.50.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ ntpdc/ntpdc-opts.h@1.50.5.1 +3 -3
+ NTP_4_2_4P2_RC4
+
+ ntpdc/ntpdc-opts.texi@1.48.5.1 +1 -1
+ NTP_4_2_4P2_RC4
+
+ ntpdc/ntpdc.1@1.48.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ ntpq/ntpq-opts.c@1.52.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ ntpq/ntpq-opts.h@1.52.5.1 +3 -3
+ NTP_4_2_4P2_RC4
+
+ ntpq/ntpq-opts.texi@1.49.5.1 +1 -1
+ NTP_4_2_4P2_RC4
+
+ ntpq/ntpq.1@1.48.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ packageinfo.sh@1.65.11.1 +1 -1
+ NTP_4_2_4P2_RC4
+
+ sntp/sntp-opts.c@1.49.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ sntp/sntp-opts.h@1.49.5.1 +3 -3
+ NTP_4_2_4P2_RC4
+
+ sntp/sntp-opts.texi@1.46.5.1 +1 -1
+ NTP_4_2_4P2_RC4
+
+ sntp/sntp.1@1.49.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ util/ntp-keygen-opts.c@1.49.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ util/ntp-keygen-opts.h@1.49.5.1 +3 -3
+ NTP_4_2_4P2_RC4
+
+ util/ntp-keygen-opts.texi@1.47.5.1 +1 -1
+ NTP_4_2_4P2_RC4
+
+ util/ntp-keygen.1@1.47.5.1 +2 -2
+ NTP_4_2_4P2_RC4
+
+ChangeSet@1.1436.1.50, 2007-05-27 00:52:52-04:00, stenn@whimsy.udel.edu
+ update NEWS file with new fixes
+
+ NEWS@1.86.1.5 +6 -0
+ update NEWS file with new fixes
+
+ChangeSet@1.1436.1.49, 2007-05-27 00:31:51-04:00, stenn@deacon.udel.edu
+ Cleanup
+
+ ChangeLog@1.1.1.15 +2 -2
+ Cleanup
+
+ChangeSet@1.1485.2.2, 2007-05-26 15:10:28+00:00, kardel@pogo.udel.edu
+ Many files:
+ Bug 841: make deferred binding to local interface the default
+
+ ChangeLog@1.47.2.2 +2 -0
+ Bug 841: make deferred binding to local interface the default
+
+ html/confopt.html@1.36 +0 -2
+ Bug 841: make deferred binding to local interface the default
+
+ html/ntpdc.html@1.27 +2 -3
+ Bug 841: make deferred binding to local interface the default
+
+ include/ntp.h@1.131 +0 -1
+ Bug 841: make deferred binding to local interface the default
+
+ include/ntp_request.h@1.31 +0 -1
+ Bug 841: make deferred binding to local interface the default
+
+ ntpd/ntp_intres.c@1.51 +1 -3
+ Bug 841: make deferred binding to local interface the default
+
+ ntpd/ntp_peer.c@1.101.1.1 +1 -20
+ Bug 841: make deferred binding to local interface the default
+
+ ntpd/ntp_request.c@1.67 +1 -3
+ Bug 841: make deferred binding to local interface the default
+
+ ntpdc/ntpdc_ops.c@1.48 +2 -4
+ Bug 841: make deferred binding to local interface the default
+
+ChangeSet@1.1485.2.1, 2007-05-26 13:29:05+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ Bug 840: do fudge configuration AFTER peers (thus refclocks) have been configured
+ ntp_config.c:
+ Bug 840: do fudge configuration AFTER peers (thus refclocks) have been configured
+
+ ChangeLog@1.47.2.1 +1 -0
+ Bug 840: do fudge configuration AFTER peers (thus refclocks) have been configured
+
+ ntpd/ntp_config.c@1.152 +1 -1
+ Bug 840: do fudge commands AFTER configuring peers (and thus refclocks)
+
+ChangeSet@1.1487.1.1, 2007-05-26 08:05:51-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P37
+ TAG: NTP_4_2_5P37
+
+ ntpd/ntpd-opts.c@1.24 +2 -2
+ NTP_4_2_5P37
+
+ ntpd/ntpd-opts.h@1.24 +3 -3
+ NTP_4_2_5P37
+
+ ntpd/ntpd-opts.texi@1.23 +1 -1
+ NTP_4_2_5P37
+
+ ntpd/ntpd.1@1.23 +2 -2
+ NTP_4_2_5P37
+
+ ntpdc/ntpdc-opts.c@1.24 +2 -2
+ NTP_4_2_5P37
+
+ ntpdc/ntpdc-opts.h@1.24 +3 -3
+ NTP_4_2_5P37
+
+ ntpdc/ntpdc-opts.texi@1.23 +1 -1
+ NTP_4_2_5P37
+
+ ntpdc/ntpdc.1@1.23 +2 -2
+ NTP_4_2_5P37
+
+ ntpq/ntpq-opts.c@1.24 +2 -2
+ NTP_4_2_5P37
+
+ ntpq/ntpq-opts.h@1.24 +3 -3
+ NTP_4_2_5P37
+
+ ntpq/ntpq-opts.texi@1.23 +1 -1
+ NTP_4_2_5P37
+
+ ntpq/ntpq.1@1.23 +2 -2
+ NTP_4_2_5P37
+
+ packageinfo.sh@1.40 +1 -1
+ NTP_4_2_5P37
+
+ sntp/sntp-opts.c@1.24 +2 -2
+ NTP_4_2_5P37
+
+ sntp/sntp-opts.h@1.24 +3 -3
+ NTP_4_2_5P37
+
+ sntp/sntp-opts.texi@1.23 +1 -1
+ NTP_4_2_5P37
+
+ sntp/sntp.1@1.23 +2 -2
+ NTP_4_2_5P37
+
+ util/ntp-keygen-opts.c@1.25 +2 -2
+ NTP_4_2_5P37
+
+ util/ntp-keygen-opts.h@1.25 +3 -3
+ NTP_4_2_5P37
+
+ util/ntp-keygen-opts.texi@1.24 +1 -1
+ NTP_4_2_5P37
+
+ util/ntp-keygen.1@1.24 +2 -2
+ NTP_4_2_5P37
+
+ChangeSet@1.1436.1.48, 2007-05-26 08:00:03+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ [Bug 795] Moved declaration of variable to top of function.
+ ChangeLog:
+ [Bug 795] Moved declaration of variable to top of function.
+
+ ChangeLog@1.1.1.14 +1 -0
+ Bug 795
+
+ ntpd/ntp_io.c@1.244.2.5 +4 -1
+ [Bug 795] Moved declaration of variable to top of function.
+
+ChangeSet@1.1436.3.9, 2007-05-25 07:44:43-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P2_RC3
+ TAG: NTP_4_2_4P2_RC3
+
+ ntpd/ntpd-opts.c@1.50.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ ntpd/ntpd-opts.h@1.50.4.1 +3 -3
+ NTP_4_2_4P2_RC3
+
+ ntpd/ntpd-opts.texi@1.49.4.1 +1 -1
+ NTP_4_2_4P2_RC3
+
+ ntpd/ntpd.1@1.48.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ ntpd/ntpdsim-opts.c@1.50.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ ntpd/ntpdsim-opts.h@1.50.4.1 +3 -3
+ NTP_4_2_4P2_RC3
+
+ ntpd/ntpdsim-opts.texi@1.48.4.1 +1 -1
+ NTP_4_2_4P2_RC3
+
+ ntpd/ntpdsim.1@1.48.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ ntpdc/ntpdc-opts.c@1.50.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ ntpdc/ntpdc-opts.h@1.50.4.1 +3 -3
+ NTP_4_2_4P2_RC3
+
+ ntpdc/ntpdc-opts.texi@1.48.4.1 +1 -1
+ NTP_4_2_4P2_RC3
+
+ ntpdc/ntpdc.1@1.48.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ ntpq/ntpq-opts.c@1.52.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ ntpq/ntpq-opts.h@1.52.4.1 +3 -3
+ NTP_4_2_4P2_RC3
+
+ ntpq/ntpq-opts.texi@1.49.4.1 +1 -1
+ NTP_4_2_4P2_RC3
+
+ ntpq/ntpq.1@1.48.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ packageinfo.sh@1.65.10.1 +1 -1
+ NTP_4_2_4P2_RC3
+
+ sntp/sntp-opts.c@1.49.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ sntp/sntp-opts.h@1.49.4.1 +3 -3
+ NTP_4_2_4P2_RC3
+
+ sntp/sntp-opts.texi@1.46.4.1 +1 -1
+ NTP_4_2_4P2_RC3
+
+ sntp/sntp.1@1.49.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ util/ntp-keygen-opts.c@1.49.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ util/ntp-keygen-opts.h@1.49.4.1 +3 -3
+ NTP_4_2_4P2_RC3
+
+ util/ntp-keygen-opts.texi@1.47.4.1 +1 -1
+ NTP_4_2_4P2_RC3
+
+ util/ntp-keygen.1@1.47.4.1 +2 -2
+ NTP_4_2_4P2_RC3
+
+ChangeSet@1.1436.3.8, 2007-05-25 02:18:59-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ NEWS@1.86.1.4 +1 -0
+ cleanup
+
+ChangeSet@1.1436.4.1, 2007-05-25 02:06:52-04:00, stenn@whimsy.udel.edu
+ Upgraded autogen and libopts
+
+ ChangeLog@1.1.3.1 +1 -0
+ Upgraded autogen and libopts
+
+ NEWS@1.86.1.3 +1 -0
+ Upgraded autogen and libopts
+
+ChangeSet@1.1436.3.6, 2007-05-25 01:07:59-04:00, stenn@pogo.udel.edu
+ cleanup ChangeLog
+
+ ChangeLog@1.1.2.3 +1 -1
+ cleanup ChangeLog
+
+ChangeSet@1.1436.3.5, 2007-05-24 08:10:30-04:00, mayer@pogo.udel.edu
+ Bug #527 Don't write from source address length to wrong location
+
+ ChangeLog@1.1.2.2 +1 -0
+ Bug #527 Don't write from source address length to wrong location
+
+ChangeSet@1.1436.3.4, 2007-05-24 08:08:34-04:00, mayer@pogo.udel.edu
+ Bug #527 Don't write from source address length to wrong location
+
+ include/recvbuff.h@1.11.1.1 +2 -0
+ Bug #527 Don't write from source address length to wrong location
+
+ libntp/recvbuff.c@1.25 +27 -13
+ Bug #527 Don't write from source address length to wrong location
+
+ ports/winnt/libntp/transmitbuff.c@1.7 +10 -10
+ Bug #527 Don't write from source address length to wrong location
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21.1.1 +76 -62
+ Bug #527 Don't write from source address length to wrong location
+
+ChangeSet@1.1485.1.2, 2007-05-24 07:44:46-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P36
+ TAG: NTP_4_2_5P36
+
+ ntpd/ntpd-opts.c@1.23 +2 -2
+ NTP_4_2_5P36
+
+ ntpd/ntpd-opts.h@1.23 +3 -3
+ NTP_4_2_5P36
+
+ ntpd/ntpd-opts.texi@1.22 +1 -1
+ NTP_4_2_5P36
+
+ ntpd/ntpd.1@1.22 +2 -2
+ NTP_4_2_5P36
+
+ ntpdc/ntpdc-opts.c@1.23 +2 -2
+ NTP_4_2_5P36
+
+ ntpdc/ntpdc-opts.h@1.23 +3 -3
+ NTP_4_2_5P36
+
+ ntpdc/ntpdc-opts.texi@1.22 +1 -1
+ NTP_4_2_5P36
+
+ ntpdc/ntpdc.1@1.22 +2 -2
+ NTP_4_2_5P36
+
+ ntpq/ntpq-opts.c@1.23 +2 -2
+ NTP_4_2_5P36
+
+ ntpq/ntpq-opts.h@1.23 +3 -3
+ NTP_4_2_5P36
+
+ ntpq/ntpq-opts.texi@1.22 +1 -1
+ NTP_4_2_5P36
+
+ ntpq/ntpq.1@1.22 +2 -2
+ NTP_4_2_5P36
+
+ packageinfo.sh@1.39 +1 -1
+ NTP_4_2_5P36
+
+ sntp/sntp-opts.c@1.23 +2 -2
+ NTP_4_2_5P36
+
+ sntp/sntp-opts.h@1.23 +3 -3
+ NTP_4_2_5P36
+
+ sntp/sntp-opts.texi@1.22 +1 -1
+ NTP_4_2_5P36
+
+ sntp/sntp.1@1.22 +2 -2
+ NTP_4_2_5P36
+
+ util/ntp-keygen-opts.c@1.24 +2 -2
+ NTP_4_2_5P36
+
+ util/ntp-keygen-opts.h@1.24 +3 -3
+ NTP_4_2_5P36
+
+ util/ntp-keygen-opts.texi@1.23 +1 -1
+ NTP_4_2_5P36
+
+ util/ntp-keygen.1@1.23 +2 -2
+ NTP_4_2_5P36
+
+ChangeSet@1.1485.1.1, 2007-05-24 01:38:12-04:00, stenn@whimsy.udel.edu
+ [Bug 832] Add libisc/log.c headers to the distribution.
+
+ ChangeLog@1.47.1.1 +1 -0
+ [Bug 832] Add libisc/log.c headers to the distribution.
+
+ include/isc/Makefile.am@1.6 +6 -0
+ [Bug 832] Add libisc/log.c headers to the distribution.
+
+ChangeSet@1.1486, 2007-05-22 15:19:42+00:00, burnicki@pogo.udel.edu
+ [Bug 824] Added the new parser modules to the Windows project file.
+
+ ChangeLog@1.48 +1 -0
+ Added the new parser modules to the Windows project file.
+
+ ports/winnt/ntpd/ntpd.dsp@1.30 +12 -0
+ Added the new parser modules to the Windows project file.
+
+ChangeSet@1.1485, 2007-05-21 07:44:27-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P35
+ TAG: NTP_4_2_5P35
+
+ ntpd/ntpd-opts.c@1.22 +2 -2
+ NTP_4_2_5P35
+
+ ntpd/ntpd-opts.h@1.22 +3 -3
+ NTP_4_2_5P35
+
+ ntpd/ntpd-opts.texi@1.21 +1 -1
+ NTP_4_2_5P35
+
+ ntpd/ntpd.1@1.21 +2 -2
+ NTP_4_2_5P35
+
+ ntpdc/ntpdc-opts.c@1.22 +2 -2
+ NTP_4_2_5P35
+
+ ntpdc/ntpdc-opts.h@1.22 +3 -3
+ NTP_4_2_5P35
+
+ ntpdc/ntpdc-opts.texi@1.21 +1 -1
+ NTP_4_2_5P35
+
+ ntpdc/ntpdc.1@1.21 +2 -2
+ NTP_4_2_5P35
+
+ ntpq/ntpq-opts.c@1.22 +2 -2
+ NTP_4_2_5P35
+
+ ntpq/ntpq-opts.h@1.22 +3 -3
+ NTP_4_2_5P35
+
+ ntpq/ntpq-opts.texi@1.21 +1 -1
+ NTP_4_2_5P35
+
+ ntpq/ntpq.1@1.21 +2 -2
+ NTP_4_2_5P35
+
+ packageinfo.sh@1.38 +1 -1
+ NTP_4_2_5P35
+
+ sntp/sntp-opts.c@1.22 +2 -2
+ NTP_4_2_5P35
+
+ sntp/sntp-opts.h@1.22 +3 -3
+ NTP_4_2_5P35
+
+ sntp/sntp-opts.texi@1.21 +1 -1
+ NTP_4_2_5P35
+
+ sntp/sntp.1@1.21 +2 -2
+ NTP_4_2_5P35
+
+ util/ntp-keygen-opts.c@1.23 +2 -2
+ NTP_4_2_5P35
+
+ util/ntp-keygen-opts.h@1.23 +3 -3
+ NTP_4_2_5P35
+
+ util/ntp-keygen-opts.texi@1.22 +1 -1
+ NTP_4_2_5P35
+
+ util/ntp-keygen.1@1.22 +2 -2
+ NTP_4_2_5P35
+
+ChangeSet@1.1484, 2007-05-21 00:29:26-04:00, stenn@whimsy.udel.edu
+ [Bug 808] Only write the drift file if we are in state 4
+
+ ChangeLog@1.47 +1 -0
+ [Bug 808] Only write the drift file if we are in state 4
+
+ ntpd/ntp_util.c@1.45 +27 -24
+ [Bug 808] Only write the drift file if we are in state 4
+
+ChangeSet@1.1483, 2007-05-20 21:52:55-04:00, stenn@whimsy.udel.edu
+ Initial import of libisc/log.c and friends
+
+ libntp/Makefile.am@1.39 +1 -0
+ Initial import of libisc/log.c and friends
+
+ChangeSet@1.1482, 2007-05-20 16:32:43-04:00, stenn@whimsy.udel.edu
+ Initial import of libisc/log.c and friends
+
+ ChangeLog@1.46 +1 -0
+ Initial import of libisc/log.c and friends
+
+ include/isc/dir.h@1.1 +94 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/isc/dir.h
+
+ include/isc/dir.h@1.0 +0 -0
+
+ include/isc/file.h@1.1 +256 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/isc/file.h
+
+ include/isc/file.h@1.0 +0 -0
+
+ include/isc/log.h@1.1 +913 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/isc/log.h
+
+ include/isc/log.h@1.0 +0 -0
+
+ include/isc/stat.h@1.1 +52 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/isc/stat.h
+
+ include/isc/stat.h@1.0 +0 -0
+
+ include/isc/stdio.h@1.1 +77 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/isc/stdio.h
+
+ include/isc/stdio.h@1.0 +0 -0
+
+ include/isc/time.h@1.1 +304 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/isc/time.h
+
+ include/isc/time.h@1.0 +0 -0
+
+ libisc/log.c@1.1 +1762 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libisc/log.c
+
+ libisc/log.c@1.0 +0 -0
+
+ChangeSet@1.1436.3.3, 2007-05-19 07:53:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P2_RC2
+ TAG: NTP_4_2_4P2_RC2
+
+ ntpd/ntpd-opts.c@1.50.3.2 +4 -4
+ NTP_4_2_4P2_RC2
+
+ ntpd/ntpd-opts.h@1.50.3.2 +3 -3
+ NTP_4_2_4P2_RC2
+
+ ntpd/ntpd-opts.texi@1.49.3.2 +1 -1
+ NTP_4_2_4P2_RC2
+
+ ntpd/ntpd.1@1.48.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ ntpd/ntpdsim-opts.c@1.50.3.2 +4 -4
+ NTP_4_2_4P2_RC2
+
+ ntpd/ntpdsim-opts.h@1.50.3.2 +3 -3
+ NTP_4_2_4P2_RC2
+
+ ntpd/ntpdsim-opts.texi@1.48.3.2 +1 -1
+ NTP_4_2_4P2_RC2
+
+ ntpd/ntpdsim.1@1.48.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ ntpdc/ntpdc-opts.c@1.50.3.2 +4 -4
+ NTP_4_2_4P2_RC2
+
+ ntpdc/ntpdc-opts.h@1.50.3.2 +3 -3
+ NTP_4_2_4P2_RC2
+
+ ntpdc/ntpdc-opts.texi@1.48.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ ntpdc/ntpdc.1@1.48.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ ntpq/ntpq-opts.c@1.52.3.2 +4 -4
+ NTP_4_2_4P2_RC2
+
+ ntpq/ntpq-opts.h@1.52.3.2 +3 -3
+ NTP_4_2_4P2_RC2
+
+ ntpq/ntpq-opts.texi@1.49.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ ntpq/ntpq.1@1.48.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ packageinfo.sh@1.65.9.3 +1 -1
+ NTP_4_2_4P2_RC2
+
+ sntp/sntp-opts.c@1.49.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ sntp/sntp-opts.h@1.49.3.2 +3 -3
+ NTP_4_2_4P2_RC2
+
+ sntp/sntp-opts.texi@1.46.3.2 +1 -1
+ NTP_4_2_4P2_RC2
+
+ sntp/sntp.1@1.49.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ util/ntp-keygen-opts.c@1.49.3.2 +4 -4
+ NTP_4_2_4P2_RC2
+
+ util/ntp-keygen-opts.h@1.49.3.2 +3 -3
+ NTP_4_2_4P2_RC2
+
+ util/ntp-keygen-opts.texi@1.47.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ util/ntp-keygen.1@1.47.3.2 +2 -2
+ NTP_4_2_4P2_RC2
+
+ChangeSet@1.1436.3.2, 2007-05-19 02:33:04-04:00, stenn@whimsy.udel.edu
+ We need another RC release to be sure the new autogen/libopts works.
+
+ BitKeeper/deleted/.del-COPYING.lgpl~492b62c9d62ba57a@1.1.1.1 +0 -0
+ Delete: sntp/libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.lgpl~adfa2ac04d64c0f7@1.1.1.1 +0 -0
+ Delete: libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd~7e1baaedfa33c877@1.1.1.1 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYING.mbsd~e8244dcf5895b58f@1.1.1.1 +0 -0
+ Delete: sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc~3fd54e9b117bfdad@1.1.1.1 +0 -0
+ Delete: sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-MakeDefs.inc~511eb438badc27b@1.1.1.1 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~65692661e68a4392@1.1.1.1 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~fdf1a715e04b5f2c@1.1.1.1 +0 -0
+ Delete: sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README~7ed47aff36cc39c@1.1.1.1 +0 -0
+ Delete: sntp/libopts/README
+
+ BitKeeper/deleted/.del-README~cec57621589d1ea6@1.1.1.1 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-autoopts.c~7b48d6dc5ca9c3b@1.1.1.1 +0 -0
+ Delete: sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.c~917f3eb3a2030087@1.1.1.1 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~4184ad33bbb8222@1.1.1.1 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-autoopts.h~d0834f397c8a330d@1.1.1.1 +0 -0
+ Delete: sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~50ae286fc516eee2@1.1.1.1 +0 -0
+ Delete: sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-boolean.c~afd23e01a43b9536@1.1.1.1 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h~2bcdd381f6a570a1@1.1.1.1 +0 -0
+ Delete: sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-compat.h~e5d9fc11f0b928f2@1.1.1.1 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c~53384c73e434a615@1.1.1.1 +0 -0
+ Delete: libopts/configfile.c
+
+ BitKeeper/deleted/.del-configfile.c~ee0b7d49d26b4f74@1.1.1.1 +0 -0
+ Delete: sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-cook.c~760181d2119b672@1.1.1.1 +0 -0
+ Delete: sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-cook.c~84c1af00a5581292@1.1.1.1 +0 -0
+ Delete: libopts/cook.c
+
+ BitKeeper/deleted/.del-enumeration.c~551805256cb9068c@1.1.1.1 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-enumeration.c~969462e75e3913a3@1.1.1.1 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~643ce1e5a16a4f94@1.1.1.1 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-environment.c~965d8c0fdf1150f5@1.1.1.1 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c~20529138c60103c3@1.1.1.1 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.c~bd74153097ec640f@1.1.1.1 +0 -0
+ Delete: sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~7f41539b135f914a@1.1.1.1 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-genshell.h~b2793e1ea2981ff5@1.1.1.1 +0 -0
+ Delete: sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c~9353e1c3a0c56ad@1.1.1.1 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.c~bfc74bb368a309be@1.1.1.1 +0 -0
+ Delete: sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~9851dd84df41023b@1.1.1.1 +0 -0
+ Delete: libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~9fa7e371d1cc0426@1.1.1.1 +0 -0
+ Delete: sntp/libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~1828e1c4576e5aea@1.1.1.1 +0 -0
+ Delete: libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~480d5c4f1634a9fa@1.1.1.1 +0 -0
+ Delete: sntp/libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-load.c~688d4934eb14272@1.1.1.1 +0 -0
+ Delete: sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-load.c~b6aa568c6e3eaca1@1.1.1.1 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c~8c63bc5a263da752@1.1.1.1 +0 -0
+ Delete: sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-makeshell.c~a9cd96c3bfbc0835@1.1.1.1 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c~1670193227f54043@1.1.1.1 +0 -0
+ Delete: sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-nested.c~a8521c8fcff292b6@1.1.1.1 +0 -0
+ Delete: libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c~eb3fbec29633e61@1.1.1.1 +0 -0
+ Delete: sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-numeric.c~ec644fa246942cbc@1.1.1.1 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~3cb6af32ad01957@1.1.1.1 +0 -0
+ Delete: sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-options.h~f700d69ce23e3e23@1.1.1.1 +0 -0
+ Delete: libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c~953a96dbc9932@1.1.1.1 +0 -0
+ Delete: sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pathfind.c~c132dab083075929@1.1.1.1 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~5c1f8f132e9a1546@1.1.1.1 +0 -0
+ Delete: sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-pgusage.c~cec1309617012832@1.1.1.1 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h~697b4937ff37ca3f@1.1.1.1 +0 -0
+ Delete: sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-proto.h~e2a13f546fbc0d4f@1.1.1.1 +0 -0
+ Delete: libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c~6845ea506fad6426@1.1.1.1 +0 -0
+ Delete: sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-putshell.c~6e39e6836261f3f7@1.1.1.1 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c~c14d8b96be44c6a8@1.1.1.1 +0 -0
+ Delete: sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-restore.c~e2a155efceab6f0d@1.1.1.1 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~17e5ac125a404fb0@1.1.1.1 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-save.c~e7e7366cd24e1a8f@1.1.1.1 +0 -0
+ Delete: sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c~4b42e45647e9ccef@1.1.1.1 +0 -0
+ Delete: libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-snprintf.c~988df6799c67781f@1.1.1.1 +0 -0
+ Delete: sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sort.c~586535d7d26d958@1.1.1.1 +0 -0
+ Delete: sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-sort.c~bb92da923b5dcb7@1.1.1.1 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~202d33ccdfd74ec@1.1.1.1 +0 -0
+ Delete: sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-stack.c~b60d0ab82970f41f@1.1.1.1 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-strchr.c~4a7e412c18f53557@1.1.1.1 +0 -0
+ Delete: sntp/libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strchr.c~7f4589858587fcc4@1.1.1.1 +0 -0
+ Delete: libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strdup.c~75e27662f28944b1@1.1.1.1 +0 -0
+ Delete: sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-strdup.c~b295027011406c46@1.1.1.1 +0 -0
+ Delete: libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~999e9cfa251ea4b3@1.1.1.1 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~dc5534ffb1c6f28@1.1.1.1 +0 -0
+ Delete: sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c~52f2f1dbe57a9743@1.1.1.1 +0 -0
+ Delete: libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-text_mmap.c~e5096667484e499a@1.1.1.1 +0 -0
+ Delete: sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-tokenize.c~315c26f9b162f234@1.1.1.1 +0 -0
+ Delete: sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.c~6a814216fa293c3c@1.1.1.1 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h~3737a7c76813e8c3@1.1.1.1 +0 -0
+ Delete: libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage-txt.h~b71acc916d68c58c@1.1.1.1 +0 -0
+ Delete: sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~f21924faa210bfa9@1.1.1.1 +0 -0
+ Delete: sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-usage.c~fe9a0f55b3cc55e4@1.1.1.1 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c~b69eccbdea7f51d9@1.1.1.1 +0 -0
+ Delete: sntp/libopts/version.c
+
+ BitKeeper/deleted/.del-version.c~de7f014d3e2ac91e@1.1.1.1 +0 -0
+ Delete: libopts/version.c
+
+ BitKeeper/deleted/.del-windows-config.h~11a9a57b2895598f@1.1.1.1 +0 -0
+ Delete: sntp/libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-windows-config.h~a6ead462c3d18ff0@1.1.1.1 +0 -0
+ Delete: libopts/compat/windows-config.h
+
+ clockstuff/clktest-opts.c@1.9.1.1 +38 -270
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ clockstuff/clktest-opts.def@1.5.1.1 +4 -0
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ clockstuff/clktest-opts.h@1.9.1.1 +22 -57
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ include/autogen-version.def@1.4 +1 -1
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.lgpl
+
+ libopts/COPYING.lgpl@1.0 +0 -0
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/COPYING.mbsd
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+
+ libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/MakeDefs.inc
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+
+ libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/Makefile.am
+
+ libopts/Makefile.am@1.0 +0 -0
+
+ libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/README
+
+ libopts/README@1.0 +0 -0
+
+ libopts/autoopts.c@1.1 +1120 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.c
+
+ libopts/autoopts.c@1.0 +0 -0
+
+ libopts/autoopts.h@1.1 +387 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts.h
+
+ libopts/autoopts.h@1.0 +0 -0
+
+ libopts/autoopts/options.h@1.1 +977 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/options.h
+
+ libopts/autoopts/options.h@1.0 +0 -0
+
+ libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/autoopts/usage-txt.h
+
+ libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/boolean.c
+
+ libopts/boolean.c@1.0 +0 -0
+
+ libopts/compat/compat.h@1.1 +319 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/compat.h
+
+ libopts/compat/compat.h@1.0 +0 -0
+
+ libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/pathfind.c
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+
+ libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/snprintf.c
+
+ libopts/compat/snprintf.c@1.0 +0 -0
+
+ libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strchr.c
+
+ libopts/compat/strchr.c@1.0 +0 -0
+
+ libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/strdup.c
+
+ libopts/compat/strdup.c@1.0 +0 -0
+
+ libopts/compat/windows-config.h@1.1 +130 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/compat/windows-config.h
+
+ libopts/compat/windows-config.h@1.0 +0 -0
+
+ libopts/configfile.c@1.1 +1290 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/configfile.c
+
+ libopts/configfile.c@1.0 +0 -0
+
+ libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/cook.c
+
+ libopts/cook.c@1.0 +0 -0
+
+ libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/enumeration.c
+
+ libopts/enumeration.c@1.0 +0 -0
+
+ libopts/environment.c@1.1 +279 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/environment.c
+
+ libopts/environment.c@1.0 +0 -0
+
+ libopts/genshell.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.c
+
+ libopts/genshell.c@1.0 +0 -0
+
+ libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/genshell.h
+
+ libopts/genshell.h@1.0 +0 -0
+
+ libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/libopts.c
+
+ libopts/libopts.c@1.0 +0 -0
+
+ libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/load.c
+
+ libopts/load.c@1.0 +0 -0
+
+ libopts/m4/libopts.m4@1.1 +509 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/libopts.m4
+
+ libopts/m4/libopts.m4@1.0 +0 -0
+
+ libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/m4/liboptschk.m4
+
+ libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/makeshell.c
+
+ libopts/makeshell.c@1.0 +0 -0
+
+ libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/nested.c
+
+ libopts/nested.c@1.0 +0 -0
+
+ libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/numeric.c
+
+ libopts/numeric.c@1.0 +0 -0
+
+ libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/pgusage.c
+
+ libopts/pgusage.c@1.0 +0 -0
+
+ libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/proto.h
+
+ libopts/proto.h@1.0 +0 -0
+
+ libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/putshell.c
+
+ libopts/putshell.c@1.0 +0 -0
+
+ libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/restore.c
+
+ libopts/restore.c@1.0 +0 -0
+
+ libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/save.c
+
+ libopts/save.c@1.0 +0 -0
+
+ libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/sort.c
+
+ libopts/sort.c@1.0 +0 -0
+
+ libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/stack.c
+
+ libopts/stack.c@1.0 +0 -0
+
+ libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/streqvcmp.c
+
+ libopts/streqvcmp.c@1.0 +0 -0
+
+ libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/text_mmap.c
+
+ libopts/text_mmap.c@1.0 +0 -0
+
+ libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/tokenize.c
+
+ libopts/tokenize.c@1.0 +0 -0
+
+ libopts/usage.c@1.1 +740 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/usage.c
+
+ libopts/usage.c@1.0 +0 -0
+
+ libopts/version.c@1.1 +178 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/libopts/version.c
+
+ libopts/version.c@1.0 +0 -0
+
+ ntpd/ntpd-opts.c@1.50.3.1 +20 -11
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpd/ntpd-opts.h@1.50.3.1 +4 -4
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpd/ntpd-opts.texi@1.49.3.1 +2 -8
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpd/ntpd.1@1.48.3.1 +2 -2
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpd/ntpdsim-opts.c@1.50.3.1 +23 -14
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpd/ntpdsim-opts.h@1.50.3.1 +6 -6
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpd/ntpdsim-opts.texi@1.48.3.1 +1 -1
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpd/ntpdsim.1@1.48.3.1 +2 -2
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpdc/ntpdc-opts.c@1.50.3.1 +23 -14
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpdc/ntpdc-opts.h@1.50.3.1 +6 -6
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpdc/ntpdc-opts.texi@1.48.3.1 +3 -3
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpdc/ntpdc.1@1.48.3.1 +2 -2
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpq/ntpq-opts.c@1.52.3.1 +23 -14
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpq/ntpq-opts.h@1.52.3.1 +6 -6
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpq/ntpq-opts.texi@1.49.3.1 +3 -3
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ ntpq/ntpq.1@1.48.3.1 +2 -2
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ packageinfo.sh@1.65.9.2 +1 -1
+ We need another RC release to be sure the new autogen/libopts works.
+
+ sntp/libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/COPYING.lgpl
+
+ sntp/libopts/COPYING.lgpl@1.0 +0 -0
+
+ sntp/libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/COPYING.mbsd@1.0 +0 -0
+
+ sntp/libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/MakeDefs.inc@1.0 +0 -0
+
+ sntp/libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/Makefile.am
+
+ sntp/libopts/Makefile.am@1.0 +0 -0
+
+ sntp/libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/README
+
+ sntp/libopts/README@1.0 +0 -0
+
+ sntp/libopts/autoopts.c@1.1 +1120 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.c@1.0 +0 -0
+
+ sntp/libopts/autoopts.h@1.1 +387 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/options.h@1.1 +977 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/options.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ sntp/libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/boolean.c
+
+ sntp/libopts/boolean.c@1.0 +0 -0
+
+ sntp/libopts/compat/compat.h@1.1 +319 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/compat.h@1.0 +0 -0
+
+ sntp/libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/compat/pathfind.c@1.0 +0 -0
+
+ sntp/libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/snprintf.c@1.0 +0 -0
+
+ sntp/libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/strchr.c
+
+ sntp/libopts/compat/strchr.c@1.0 +0 -0
+
+ sntp/libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/strdup.c
+
+ sntp/libopts/compat/strdup.c@1.0 +0 -0
+
+ sntp/libopts/compat/windows-config.h@1.1 +130 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/compat/windows-config.h
+
+ sntp/libopts/compat/windows-config.h@1.0 +0 -0
+
+ sntp/libopts/configfile.c@1.1 +1290 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/configfile.c
+
+ sntp/libopts/configfile.c@1.0 +0 -0
+
+ sntp/libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/cook.c
+
+ sntp/libopts/cook.c@1.0 +0 -0
+
+ sntp/libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/enumeration.c
+
+ sntp/libopts/enumeration.c@1.0 +0 -0
+
+ sntp/libopts/environment.c@1.1 +279 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/environment.c
+
+ sntp/libopts/environment.c@1.0 +0 -0
+
+ sntp/libopts/genshell.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.c@1.0 +0 -0
+
+ sntp/libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/genshell.h
+
+ sntp/libopts/genshell.h@1.0 +0 -0
+
+ sntp/libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/libopts.c
+
+ sntp/libopts/libopts.c@1.0 +0 -0
+
+ sntp/libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/load.c
+
+ sntp/libopts/load.c@1.0 +0 -0
+
+ sntp/libopts/m4/libopts.m4@1.1 +509 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/m4/libopts.m4
+
+ sntp/libopts/m4/libopts.m4@1.0 +0 -0
+
+ sntp/libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/m4/liboptschk.m4
+
+ sntp/libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ sntp/libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/makeshell.c
+
+ sntp/libopts/makeshell.c@1.0 +0 -0
+
+ sntp/libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/nested.c
+
+ sntp/libopts/nested.c@1.0 +0 -0
+
+ sntp/libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/numeric.c
+
+ sntp/libopts/numeric.c@1.0 +0 -0
+
+ sntp/libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/pgusage.c
+
+ sntp/libopts/pgusage.c@1.0 +0 -0
+
+ sntp/libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/proto.h
+
+ sntp/libopts/proto.h@1.0 +0 -0
+
+ sntp/libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/putshell.c
+
+ sntp/libopts/putshell.c@1.0 +0 -0
+
+ sntp/libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/restore.c
+
+ sntp/libopts/restore.c@1.0 +0 -0
+
+ sntp/libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/save.c
+
+ sntp/libopts/save.c@1.0 +0 -0
+
+ sntp/libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/sort.c
+
+ sntp/libopts/sort.c@1.0 +0 -0
+
+ sntp/libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/stack.c
+
+ sntp/libopts/stack.c@1.0 +0 -0
+
+ sntp/libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/streqvcmp.c
+
+ sntp/libopts/streqvcmp.c@1.0 +0 -0
+
+ sntp/libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/text_mmap.c
+
+ sntp/libopts/text_mmap.c@1.0 +0 -0
+
+ sntp/libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/tokenize.c
+
+ sntp/libopts/tokenize.c@1.0 +0 -0
+
+ sntp/libopts/usage.c@1.1 +740 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/usage.c
+
+ sntp/libopts/usage.c@1.0 +0 -0
+
+ sntp/libopts/version.c@1.1 +178 -0
+ BitKeeper file /deacon/backroom/ntp-stable-hms/sntp/libopts/version.c
+
+ sntp/libopts/version.c@1.0 +0 -0
+
+ sntp/sntp-opts.c@1.49.3.1 +21 -12
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ sntp/sntp-opts.h@1.49.3.1 +6 -6
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ sntp/sntp-opts.texi@1.46.3.1 +1 -1
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ sntp/sntp.1@1.49.3.1 +2 -2
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ util/ntp-keygen-opts.c@1.49.3.1 +23 -14
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ util/ntp-keygen-opts.h@1.49.3.1 +6 -6
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ util/ntp-keygen-opts.texi@1.47.3.1 +3 -3
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ util/ntp-keygen.1@1.47.3.1 +2 -2
+ We need to use the upgraded autogen/libopts in -stable too.
+
+ChangeSet@1.1436.3.1, 2007-05-18 02:20:56-04:00, stenn@whimsy.udel.edu
+ Release 4.2.4p2
+
+ ChangeLog@1.1.2.1 +4 -2
+ Release 4.2.4p2
+
+ NEWS@1.86.1.2 +6 -0
+ Release 4.2.4p2
+
+ packageinfo.sh@1.65.9.1 +1 -1
+ Release 4.2.4p2
+
+ChangeSet@1.1481, 2007-05-16 07:44:03-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P34
+ TAG: NTP_4_2_5P34
+
+ ntpd/ntpd-opts.c@1.21 +2 -2
+ NTP_4_2_5P34
+
+ ntpd/ntpd-opts.h@1.21 +5 -5
+ NTP_4_2_5P34
+
+ ntpd/ntpd-opts.texi@1.20 +5 -5
+ NTP_4_2_5P34
+
+ ntpd/ntpd.1@1.20 +4 -4
+ NTP_4_2_5P34
+
+ ntpdc/ntpdc-opts.c@1.21 +2 -2
+ NTP_4_2_5P34
+
+ ntpdc/ntpdc-opts.h@1.21 +3 -3
+ NTP_4_2_5P34
+
+ ntpdc/ntpdc-opts.texi@1.20 +1 -1
+ NTP_4_2_5P34
+
+ ntpdc/ntpdc.1@1.20 +2 -2
+ NTP_4_2_5P34
+
+ ntpq/ntpq-opts.c@1.21 +2 -2
+ NTP_4_2_5P34
+
+ ntpq/ntpq-opts.h@1.21 +3 -3
+ NTP_4_2_5P34
+
+ ntpq/ntpq-opts.texi@1.20 +1 -1
+ NTP_4_2_5P34
+
+ ntpq/ntpq.1@1.20 +2 -2
+ NTP_4_2_5P34
+
+ packageinfo.sh@1.37 +1 -1
+ NTP_4_2_5P34
+
+ sntp/sntp-opts.c@1.21 +2 -2
+ NTP_4_2_5P34
+
+ sntp/sntp-opts.h@1.21 +3 -3
+ NTP_4_2_5P34
+
+ sntp/sntp-opts.texi@1.20 +1 -1
+ NTP_4_2_5P34
+
+ sntp/sntp.1@1.20 +2 -2
+ NTP_4_2_5P34
+
+ util/ntp-keygen-opts.c@1.22 +2 -2
+ NTP_4_2_5P34
+
+ util/ntp-keygen-opts.h@1.22 +3 -3
+ NTP_4_2_5P34
+
+ util/ntp-keygen-opts.texi@1.21 +1 -1
+ NTP_4_2_5P34
+
+ util/ntp-keygen.1@1.21 +2 -2
+ NTP_4_2_5P34
+
+ChangeSet@1.1480, 2007-05-16 03:56:15-04:00, stenn@whimsy.udel.edu
+ [Bug 826] Fix redefinition of PI
+
+ ChangeLog@1.45 +1 -0
+ [Bug 826] Fix redefinition of PI
+
+ChangeSet@1.1479, 2007-05-16 03:47:57-04:00, stenn@whimsy.udel.edu
+ [Bug 825] ntp_scanner.c needs to #include <config.h>
+
+ ChangeLog@1.44 +1 -0
+ [Bug 825] ntp_scanner.c needs to #include <config.h>
+
+ ntpd/ntp_scanner.c@1.4 +4 -0
+ [Bug 825] ntp_scanner.c needs to #include <config.h>
+
+ChangeSet@1.1478, 2007-05-16 03:39:02-04:00, stenn@whimsy.udel.edu
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ ChangeLog@1.43 +1 -0
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ include/ntp_config.h@1.45 +1 -5
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ include/ntpsim.h@1.9 +3 -4
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ ntpd/ntp_config.c@1.151 +11 -0
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ ntpd/ntp_data_structures.c@1.3 +1 -1
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ ntpd/ntp_parser.c@1.6 +2 -2
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ ntpd/ntp_parser.y@1.5 +1 -1
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ ntpd/ntpsim.c@1.17 +5 -2
+ [Bug 824] New parser code has some build problems with the SIM code.
+
+ChangeSet@1.1477, 2007-05-16 00:49:12-04:00, stenn@whimsy.udel.edu
+ [Bug 817] Use longnames for setting ntp variables on the command-line
+
+ ChangeLog@1.42 +3 -0
+ [Bug 817] Use longnames for setting ntp variables on the command-line
+
+ NEWS@1.91 +5 -0
+ [Bug 817] Use longnames for setting ntp variables on the command-line
+
+ ntpd/ntpdbase-opts.def@1.11 +2 -2
+ [Bug 817] Use longnames for setting ntp variables on the command-line
+
+ChangeSet@1.1476, 2007-05-16 00:26:17-04:00, stenn@whimsy.udel.edu
+ [Bug 822] set progname once, early.
+
+ ChangeLog@1.41 +1 -0
+ [Bug 822] set progname once, early.
+
+ ntpd/ntp_config.c@1.150 +0 -1
+ [Bug 822] set progname once, early.
+
+ChangeSet@1.1475, 2007-05-15 07:43:16-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P33
+ TAG: NTP_4_2_5P33
+
+ ntpd/ntpd-opts.c@1.20 +2 -2
+ NTP_4_2_5P33
+
+ ntpd/ntpd-opts.h@1.20 +3 -3
+ NTP_4_2_5P33
+
+ ntpd/ntpd-opts.texi@1.19 +1 -1
+ NTP_4_2_5P33
+
+ ntpd/ntpd.1@1.19 +2 -2
+ NTP_4_2_5P33
+
+ ntpdc/ntpdc-opts.c@1.20 +2 -2
+ NTP_4_2_5P33
+
+ ntpdc/ntpdc-opts.h@1.20 +3 -3
+ NTP_4_2_5P33
+
+ ntpdc/ntpdc-opts.texi@1.19 +1 -1
+ NTP_4_2_5P33
+
+ ntpdc/ntpdc.1@1.19 +2 -2
+ NTP_4_2_5P33
+
+ ntpq/ntpq-opts.c@1.20 +2 -2
+ NTP_4_2_5P33
+
+ ntpq/ntpq-opts.h@1.20 +3 -3
+ NTP_4_2_5P33
+
+ ntpq/ntpq-opts.texi@1.19 +1 -1
+ NTP_4_2_5P33
+
+ ntpq/ntpq.1@1.19 +2 -2
+ NTP_4_2_5P33
+
+ packageinfo.sh@1.36 +1 -1
+ NTP_4_2_5P33
+
+ sntp/sntp-opts.c@1.20 +2 -2
+ NTP_4_2_5P33
+
+ sntp/sntp-opts.h@1.20 +3 -3
+ NTP_4_2_5P33
+
+ sntp/sntp-opts.texi@1.19 +1 -1
+ NTP_4_2_5P33
+
+ sntp/sntp.1@1.19 +2 -2
+ NTP_4_2_5P33
+
+ util/ntp-keygen-opts.c@1.21 +2 -2
+ NTP_4_2_5P33
+
+ util/ntp-keygen-opts.h@1.21 +3 -3
+ NTP_4_2_5P33
+
+ util/ntp-keygen-opts.texi@1.20 +1 -1
+ NTP_4_2_5P33
+
+ util/ntp-keygen.1@1.20 +2 -2
+ NTP_4_2_5P33
+
+ChangeSet@1.1474, 2007-05-15 06:42:51-04:00, stenn@pogo.udel.edu
+ Correct ChangeLog entry format
+
+ ChangeLog@1.40 +1 -1
+ Correct ChangeLog entry format
+
+ChangeSet@1.1473, 2007-05-14 16:58:33-04:00, mayer@pogo.udel.edu
+ Bug 819 remove erroneous #if 0 in Windows code
+
+ ChangeLog@1.39 +1 -0
+ Bug 819 remove erroneous #if 0 in Windows code
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.23 +0 -2
+ Bug 819 remove erroneous #if 0
+
+ChangeSet@1.1472, 2007-05-13 07:43:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P32
+ TAG: NTP_4_2_5P32
+
+ ntpd/ntpd-opts.c@1.19 +2 -2
+ NTP_4_2_5P32
+
+ ntpd/ntpd-opts.h@1.19 +3 -3
+ NTP_4_2_5P32
+
+ ntpd/ntpd-opts.texi@1.18 +1 -1
+ NTP_4_2_5P32
+
+ ntpd/ntpd.1@1.18 +2 -2
+ NTP_4_2_5P32
+
+ ntpdc/ntpdc-opts.c@1.19 +2 -2
+ NTP_4_2_5P32
+
+ ntpdc/ntpdc-opts.h@1.19 +3 -3
+ NTP_4_2_5P32
+
+ ntpdc/ntpdc-opts.texi@1.18 +1 -1
+ NTP_4_2_5P32
+
+ ntpdc/ntpdc.1@1.18 +2 -2
+ NTP_4_2_5P32
+
+ ntpq/ntpq-opts.c@1.19 +2 -2
+ NTP_4_2_5P32
+
+ ntpq/ntpq-opts.h@1.19 +3 -3
+ NTP_4_2_5P32
+
+ ntpq/ntpq-opts.texi@1.18 +1 -1
+ NTP_4_2_5P32
+
+ ntpq/ntpq.1@1.18 +2 -2
+ NTP_4_2_5P32
+
+ packageinfo.sh@1.35 +1 -1
+ NTP_4_2_5P32
+
+ sntp/sntp-opts.c@1.19 +2 -2
+ NTP_4_2_5P32
+
+ sntp/sntp-opts.h@1.19 +3 -3
+ NTP_4_2_5P32
+
+ sntp/sntp-opts.texi@1.18 +1 -1
+ NTP_4_2_5P32
+
+ sntp/sntp.1@1.18 +2 -2
+ NTP_4_2_5P32
+
+ util/ntp-keygen-opts.c@1.20 +2 -2
+ NTP_4_2_5P32
+
+ util/ntp-keygen-opts.h@1.20 +3 -3
+ NTP_4_2_5P32
+
+ util/ntp-keygen-opts.texi@1.19 +1 -1
+ NTP_4_2_5P32
+
+ util/ntp-keygen.1@1.19 +2 -2
+ NTP_4_2_5P32
+
+ChangeSet@1.1471, 2007-05-13 03:42:41-04:00, stenn@whimsy.udel.edu
+ The new config code missed an #ifdef for building without refclocks
+
+ ChangeLog@1.38 +1 -0
+ The new config code missed an #ifdef for building without refclocks
+
+ ntpd/ntp_config.c@1.149 +4 -0
+ The new config code missed an #ifdef for building without refclocks
+
+ChangeSet@1.1470, 2007-05-13 00:04:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P31
+ TAG: NTP_4_2_5P31
+
+ ntpd/ntpd-opts.c@1.18 +2 -2
+ NTP_4_2_5P31
+
+ ntpd/ntpd-opts.h@1.18 +3 -3
+ NTP_4_2_5P31
+
+ ntpd/ntpd-opts.texi@1.17 +1 -1
+ NTP_4_2_5P31
+
+ ntpd/ntpd.1@1.17 +2 -2
+ NTP_4_2_5P31
+
+ ntpdc/ntpdc-opts.c@1.18 +2 -2
+ NTP_4_2_5P31
+
+ ntpdc/ntpdc-opts.h@1.18 +3 -3
+ NTP_4_2_5P31
+
+ ntpdc/ntpdc-opts.texi@1.17 +1 -1
+ NTP_4_2_5P31
+
+ ntpdc/ntpdc.1@1.17 +2 -2
+ NTP_4_2_5P31
+
+ ntpq/ntpq-opts.c@1.18 +2 -2
+ NTP_4_2_5P31
+
+ ntpq/ntpq-opts.h@1.18 +3 -3
+ NTP_4_2_5P31
+
+ ntpq/ntpq-opts.texi@1.17 +1 -1
+ NTP_4_2_5P31
+
+ ntpq/ntpq.1@1.17 +2 -2
+ NTP_4_2_5P31
+
+ packageinfo.sh@1.34 +1 -1
+ NTP_4_2_5P31
+
+ sntp/sntp-opts.c@1.18 +2 -2
+ NTP_4_2_5P31
+
+ sntp/sntp-opts.h@1.18 +3 -3
+ NTP_4_2_5P31
+
+ sntp/sntp-opts.texi@1.17 +1 -1
+ NTP_4_2_5P31
+
+ sntp/sntp.1@1.17 +2 -2
+ NTP_4_2_5P31
+
+ util/ntp-keygen-opts.c@1.19 +2 -2
+ NTP_4_2_5P31
+
+ util/ntp-keygen-opts.h@1.19 +3 -3
+ NTP_4_2_5P31
+
+ util/ntp-keygen-opts.texi@1.18 +1 -1
+ NTP_4_2_5P31
+
+ util/ntp-keygen.1@1.18 +2 -2
+ NTP_4_2_5P31
+
+ChangeSet@1.1469, 2007-05-12 23:13:08-04:00, stenn@whimsy.udel.edu
+ Distribute some files needed by the new config parsing code
+
+ ChangeLog@1.37 +1 -0
+ Distribute some files needed by the new config parsing code
+
+ include/Makefile.am@1.27 +1 -0
+ Distribute some files needed by the new config parsing code
+
+ ntpd/Makefile.am@1.59 +2 -1
+ Distribute some files needed by the new config parsing code
+
+ChangeSet@1.1468, 2007-05-12 20:05:36-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P30
+ TAG: NTP_4_2_5P30
+
+ ntpd/ntpd-opts.c@1.17 +19 -10
+ NTP_4_2_5P30
+
+ ntpd/ntpd-opts.h@1.17 +6 -6
+ NTP_4_2_5P30
+
+ ntpd/ntpd-opts.texi@1.16 +2 -2
+ NTP_4_2_5P30
+
+ ntpd/ntpd.1@1.16 +2 -2
+ NTP_4_2_5P30
+
+ ntpdc/ntpdc-opts.c@1.17 +22 -13
+ NTP_4_2_5P30
+
+ ntpdc/ntpdc-opts.h@1.17 +8 -8
+ NTP_4_2_5P30
+
+ ntpdc/ntpdc-opts.texi@1.16 +2 -2
+ NTP_4_2_5P30
+
+ ntpdc/ntpdc.1@1.16 +2 -2
+ NTP_4_2_5P30
+
+ ntpq/ntpq-opts.c@1.17 +22 -13
+ NTP_4_2_5P30
+
+ ntpq/ntpq-opts.h@1.17 +8 -8
+ NTP_4_2_5P30
+
+ ntpq/ntpq-opts.texi@1.16 +2 -2
+ NTP_4_2_5P30
+
+ ntpq/ntpq.1@1.16 +2 -2
+ NTP_4_2_5P30
+
+ packageinfo.sh@1.33 +1 -1
+ NTP_4_2_5P30
+
+ sntp/sntp-opts.c@1.17 +22 -13
+ NTP_4_2_5P30
+
+ sntp/sntp-opts.h@1.17 +8 -8
+ NTP_4_2_5P30
+
+ sntp/sntp-opts.texi@1.16 +1 -1
+ NTP_4_2_5P30
+
+ sntp/sntp.1@1.16 +2 -2
+ NTP_4_2_5P30
+
+ util/ntp-keygen-opts.c@1.18 +22 -13
+ NTP_4_2_5P30
+
+ util/ntp-keygen-opts.h@1.18 +8 -8
+ NTP_4_2_5P30
+
+ util/ntp-keygen-opts.texi@1.17 +2 -2
+ NTP_4_2_5P30
+
+ util/ntp-keygen.1@1.17 +2 -2
+ NTP_4_2_5P30
+
+ChangeSet@1.1467, 2007-05-12 18:51:18-04:00, stenn@whimsy.udel.edu
+ ntpdsim does not need a separate.def file anymore
+
+ .point-changed-filelist@1.2 +0 -4
+ ntpdsim does not need a separate.def file anymore
+
+ChangeSet@1.1464.1.3, 2007-05-12 15:20:21-04:00, stenn@whimsy.udel.edu
+ update ChangeLog
+
+ ChangeLog@1.34.1.1 +2 -0
+ update
+
+ChangeSet@1.1464.1.2, 2007-05-12 15:11:16-04:00, stenn@whimsy.udel.edu
+ ntpdsim still needs to be linked with libntpsim.a
+
+ ntpd/Makefile.am@1.58 +1 -1
+ ntpdsim still needs to be linked with libntpsim.a
+
+ChangeSet@1.1464.1.1, 2007-05-12 15:03:30-04:00, stenn@whimsy.udel.edu
+ The commandline args for clktest are different for CLKLDISC and STREAM
+
+ BitKeeper/deleted/.del-COPYING.lgpl~10cb8d69d91c1d1a@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.lgpl~28a379c1d0a7d65b@1.2 +0 -0
+ Delete: libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd~533e88f3b3fcf954@1.2 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYING.mbsd~b64c211489c98f8f@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc~1864382369b1f319@1.2 +0 -0
+ Delete: sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-MakeDefs.inc~834c15d5a9c89a66@1.2 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~1b934e5bbc1a52da@1.2 +0 -0
+ Delete: sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~6ccd1a00699fb256@1.2 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README~92b3aeada81a2d71@1.2 +0 -0
+ Delete: sntp/libopts/README
+
+ BitKeeper/deleted/.del-README~b514dee5178a5580@1.2 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-autoopts.c~a46d961b536d64bf@1.2 +0 -0
+ Delete: sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.c~bf6955d92ba49ae1@1.2 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~23dbdb3099b1cca4@1.2 +0 -0
+ Delete: sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-autoopts.h~747513602f92fac1@1.2 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~94ccecb255a48b6e@1.2 +0 -0
+ Delete: sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-boolean.c~f7c50fbef5ac98e0@1.2 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h~304782365980b0a6@1.2 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-compat.h~395225886f65b320@1.2 +0 -0
+ Delete: sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c~9bf9a8e83a3bd417@1.2 +0 -0
+ Delete: sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-configfile.c~c3073ecc386accae@1.2 +0 -0
+ Delete: libopts/configfile.c
+
+ BitKeeper/deleted/.del-cook.c~aaac2f8aa56207ea@1.2 +0 -0
+ Delete: sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-cook.c~ab79f9ba24a65414@1.2 +0 -0
+ Delete: libopts/cook.c
+
+ BitKeeper/deleted/.del-enumeration.c~712ed026511a4fad@1.2 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-enumeration.c~8a49e92b5bc59603@1.2 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~8c989df39464c6e6@1.2 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-environment.c~d00f13b319acf94@1.2 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c~8eefb6dfb144e83@1.2 +0 -0
+ Delete: sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.c~d7f99fb1e982ee07@1.2 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~51e39da43a911455@1.2 +0 -0
+ Delete: sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-genshell.h~d288760f8010eb26@1.2 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c~58110c12582b3028@1.2 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.c~752b4eb28ce283b5@1.2 +0 -0
+ Delete: sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~3768711f3ababaf6@1.2 +0 -0
+ Delete: libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~3ff78500945f8450@1.2 +0 -0
+ Delete: sntp/libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~7fc066e5c8ec737b@1.2 +0 -0
+ Delete: sntp/libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~874c63212488adfb@1.2 +0 -0
+ Delete: libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-load.c~5266a52b9cc7c4c@1.2 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-load.c~a2d76f9cb0ad15c2@1.2 +0 -0
+ Delete: sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c~29fe57c8fbbb00e3@1.2 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-makeshell.c~fc83cd9174e79990@1.2 +0 -0
+ Delete: sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c~28f13939b51c52fd@1.2 +0 -0
+ Delete: sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-nested.c~b140b093a1d64d9@1.2 +0 -0
+ Delete: libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c~65425d5a1d1c4bfe@1.2 +0 -0
+ Delete: sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-numeric.c~999e8ac5e2da8761@1.2 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~5da7e2edf4e59b5a@1.2 +0 -0
+ Delete: libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-options.h~b9d54ea51e67a003@1.2 +0 -0
+ Delete: sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c~3b1936ad642daffc@1.2 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pathfind.c~a2ca5c6362091a22@1.2 +0 -0
+ Delete: sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~b5c6b4ec94715759@1.2 +0 -0
+ Delete: sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-pgusage.c~d5c1858d8398fae@1.2 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h~154b3828fc24cf61@1.2 +0 -0
+ Delete: libopts/proto.h
+
+ BitKeeper/deleted/.del-proto.h~a1f40edb75ffe53a@1.2 +0 -0
+ Delete: sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c~a5873e4bd316e7ed@1.2 +0 -0
+ Delete: sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-putshell.c~e6ab712597a00d22@1.2 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c~5d8d9d9524a773de@1.2 +0 -0
+ Delete: sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-restore.c~88a5fde95bcff4ab@1.2 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~be7b0aaf121ec52c@1.2 +0 -0
+ Delete: sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-save.c~c6c15efe6c1d79fd@1.2 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c~755eb3e8b8fdc776@1.2 +0 -0
+ Delete: sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-snprintf.c~bd80dbf654a1386@1.2 +0 -0
+ Delete: libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sort.c~3107cfeb6d4410e0@1.2 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-sort.c~fd8c39deb0ab5d4f@1.2 +0 -0
+ Delete: sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~311ef6ab451f1f6@1.2 +0 -0
+ Delete: sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-stack.c~63cca8b0f353d8f2@1.2 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-strchr.c~9747020ee65f676@1.2 +0 -0
+ Delete: libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strchr.c~ee7c33848acad72@1.2 +0 -0
+ Delete: sntp/libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strdup.c~b372303835eae985@1.2 +0 -0
+ Delete: sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-strdup.c~f0c4c4c41ddd1a3@1.2 +0 -0
+ Delete: libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~73dcf75bcf91f8b9@1.2 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~a7f96578aba73fa7@1.2 +0 -0
+ Delete: sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c~54ffd8e6a894fd3a@1.2 +0 -0
+ Delete: libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-text_mmap.c~a418cd03686e4369@1.2 +0 -0
+ Delete: sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-tokenize.c~383b75d922a43542@1.2 +0 -0
+ Delete: sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.c~a0a274ef5a23941b@1.2 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h~2e88ec29a506e890@1.2 +0 -0
+ Delete: libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage-txt.h~d982bb81a1b02298@1.2 +0 -0
+ Delete: sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~1108ba561360111a@1.2 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-usage.c~f5dfbb0ffd6bfc47@1.2 +0 -0
+ Delete: sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c~2149af8e100594bb@1.2 +0 -0
+ Delete: sntp/libopts/version.c
+
+ BitKeeper/deleted/.del-version.c~d6d1f6f786b289e3@1.2 +0 -0
+ Delete: libopts/version.c
+
+ BitKeeper/deleted/.del-windows-config.h~49e33bce6ec73aa9@1.2 +0 -0
+ Delete: libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-windows-config.h~70a3d851a9350311@1.2 +0 -0
+ Delete: sntp/libopts/compat/windows-config.h
+
+ clockstuff/clktest-opts.def@1.6 +4 -0
+ The commandline args for clktest are different for CLKLDISC and STREAM
+
+ libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.lgpl
+
+ libopts/COPYING.lgpl@1.0 +0 -0
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.mbsd
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+
+ libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/MakeDefs.inc
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+
+ libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/Makefile.am
+
+ libopts/Makefile.am@1.0 +0 -0
+
+ libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/README
+
+ libopts/README@1.0 +0 -0
+
+ libopts/autoopts.c@1.1 +1120 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.c
+
+ libopts/autoopts.c@1.0 +0 -0
+
+ libopts/autoopts.h@1.1 +387 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.h
+
+ libopts/autoopts.h@1.0 +0 -0
+
+ libopts/autoopts/options.h@1.1 +977 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/options.h
+
+ libopts/autoopts/options.h@1.0 +0 -0
+
+ libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/usage-txt.h
+
+ libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/boolean.c
+
+ libopts/boolean.c@1.0 +0 -0
+
+ libopts/compat/compat.h@1.1 +319 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/compat.h
+
+ libopts/compat/compat.h@1.0 +0 -0
+
+ libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/pathfind.c
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+
+ libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/snprintf.c
+
+ libopts/compat/snprintf.c@1.0 +0 -0
+
+ libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c
+
+ libopts/compat/strchr.c@1.0 +0 -0
+
+ libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strdup.c
+
+ libopts/compat/strdup.c@1.0 +0 -0
+
+ libopts/compat/windows-config.h@1.1 +130 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h
+
+ libopts/compat/windows-config.h@1.0 +0 -0
+
+ libopts/configfile.c@1.1 +1290 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/configfile.c
+
+ libopts/configfile.c@1.0 +0 -0
+
+ libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/cook.c
+
+ libopts/cook.c@1.0 +0 -0
+
+ libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/enumeration.c
+
+ libopts/enumeration.c@1.0 +0 -0
+
+ libopts/environment.c@1.1 +279 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/environment.c
+
+ libopts/environment.c@1.0 +0 -0
+
+ libopts/genshell.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.c
+
+ libopts/genshell.c@1.0 +0 -0
+
+ libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.h
+
+ libopts/genshell.h@1.0 +0 -0
+
+ libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/libopts.c
+
+ libopts/libopts.c@1.0 +0 -0
+
+ libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/load.c
+
+ libopts/load.c@1.0 +0 -0
+
+ libopts/m4/libopts.m4@1.1 +509 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libopts.m4
+
+ libopts/m4/libopts.m4@1.0 +0 -0
+
+ libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/liboptschk.m4
+
+ libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/makeshell.c
+
+ libopts/makeshell.c@1.0 +0 -0
+
+ libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/nested.c
+
+ libopts/nested.c@1.0 +0 -0
+
+ libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/numeric.c
+
+ libopts/numeric.c@1.0 +0 -0
+
+ libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/pgusage.c
+
+ libopts/pgusage.c@1.0 +0 -0
+
+ libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/proto.h
+
+ libopts/proto.h@1.0 +0 -0
+
+ libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/putshell.c
+
+ libopts/putshell.c@1.0 +0 -0
+
+ libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/restore.c
+
+ libopts/restore.c@1.0 +0 -0
+
+ libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/save.c
+
+ libopts/save.c@1.0 +0 -0
+
+ libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/sort.c
+
+ libopts/sort.c@1.0 +0 -0
+
+ libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/stack.c
+
+ libopts/stack.c@1.0 +0 -0
+
+ libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/streqvcmp.c
+
+ libopts/streqvcmp.c@1.0 +0 -0
+
+ libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/text_mmap.c
+
+ libopts/text_mmap.c@1.0 +0 -0
+
+ libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/tokenize.c
+
+ libopts/tokenize.c@1.0 +0 -0
+
+ libopts/usage.c@1.1 +740 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/usage.c
+
+ libopts/usage.c@1.0 +0 -0
+
+ libopts/version.c@1.1 +178 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/version.c
+
+ libopts/version.c@1.0 +0 -0
+
+ sntp/libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.lgpl
+
+ sntp/libopts/COPYING.lgpl@1.0 +0 -0
+
+ sntp/libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/COPYING.mbsd@1.0 +0 -0
+
+ sntp/libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/MakeDefs.inc@1.0 +0 -0
+
+ sntp/libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/Makefile.am
+
+ sntp/libopts/Makefile.am@1.0 +0 -0
+
+ sntp/libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/README
+
+ sntp/libopts/README@1.0 +0 -0
+
+ sntp/libopts/autoopts.c@1.1 +1120 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.c@1.0 +0 -0
+
+ sntp/libopts/autoopts.h@1.1 +387 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/options.h@1.1 +977 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/options.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ sntp/libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/boolean.c
+
+ sntp/libopts/boolean.c@1.0 +0 -0
+
+ sntp/libopts/compat/compat.h@1.1 +319 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/compat.h@1.0 +0 -0
+
+ sntp/libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/compat/pathfind.c@1.0 +0 -0
+
+ sntp/libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/snprintf.c@1.0 +0 -0
+
+ sntp/libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c
+
+ sntp/libopts/compat/strchr.c@1.0 +0 -0
+
+ sntp/libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strdup.c
+
+ sntp/libopts/compat/strdup.c@1.0 +0 -0
+
+ sntp/libopts/compat/windows-config.h@1.1 +130 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h
+
+ sntp/libopts/compat/windows-config.h@1.0 +0 -0
+
+ sntp/libopts/configfile.c@1.1 +1290 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/configfile.c
+
+ sntp/libopts/configfile.c@1.0 +0 -0
+
+ sntp/libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/cook.c
+
+ sntp/libopts/cook.c@1.0 +0 -0
+
+ sntp/libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/enumeration.c
+
+ sntp/libopts/enumeration.c@1.0 +0 -0
+
+ sntp/libopts/environment.c@1.1 +279 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/environment.c
+
+ sntp/libopts/environment.c@1.0 +0 -0
+
+ sntp/libopts/genshell.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.c@1.0 +0 -0
+
+ sntp/libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.h
+
+ sntp/libopts/genshell.h@1.0 +0 -0
+
+ sntp/libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/libopts.c
+
+ sntp/libopts/libopts.c@1.0 +0 -0
+
+ sntp/libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/load.c
+
+ sntp/libopts/load.c@1.0 +0 -0
+
+ sntp/libopts/m4/libopts.m4@1.1 +509 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libopts.m4
+
+ sntp/libopts/m4/libopts.m4@1.0 +0 -0
+
+ sntp/libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/liboptschk.m4
+
+ sntp/libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ sntp/libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/makeshell.c
+
+ sntp/libopts/makeshell.c@1.0 +0 -0
+
+ sntp/libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/nested.c
+
+ sntp/libopts/nested.c@1.0 +0 -0
+
+ sntp/libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/numeric.c
+
+ sntp/libopts/numeric.c@1.0 +0 -0
+
+ sntp/libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/pgusage.c
+
+ sntp/libopts/pgusage.c@1.0 +0 -0
+
+ sntp/libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/proto.h
+
+ sntp/libopts/proto.h@1.0 +0 -0
+
+ sntp/libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/putshell.c
+
+ sntp/libopts/putshell.c@1.0 +0 -0
+
+ sntp/libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/restore.c
+
+ sntp/libopts/restore.c@1.0 +0 -0
+
+ sntp/libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/save.c
+
+ sntp/libopts/save.c@1.0 +0 -0
+
+ sntp/libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/sort.c
+
+ sntp/libopts/sort.c@1.0 +0 -0
+
+ sntp/libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/stack.c
+
+ sntp/libopts/stack.c@1.0 +0 -0
+
+ sntp/libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/streqvcmp.c
+
+ sntp/libopts/streqvcmp.c@1.0 +0 -0
+
+ sntp/libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/text_mmap.c
+
+ sntp/libopts/text_mmap.c@1.0 +0 -0
+
+ sntp/libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/tokenize.c
+
+ sntp/libopts/tokenize.c@1.0 +0 -0
+
+ sntp/libopts/usage.c@1.1 +740 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/usage.c
+
+ sntp/libopts/usage.c@1.0 +0 -0
+
+ sntp/libopts/version.c@1.1 +178 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/version.c
+
+ sntp/libopts/version.c@1.0 +0 -0
+
+ChangeSet@1.1465, 2007-05-12 12:29:54-04:00, mayer@pogo.udel.edu
+ Bug 819 - Timeout for WaitForMultipleObjects was set to 500ms instead of INFINITE
+
+ ChangeLog@1.35 +1 -0
+ Bug 819 - Timeout for WaitForMultipleObjects was set to 500ms instead of INFINITE
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.22 +1 -2
+ Bug 819 - Timeout for WaitForMultipleObjects was set to 500ms instead of INFINITE
+
+ChangeSet@1.1464, 2007-05-10 18:45:48-04:00, stenn@whimsy.udel.edu
+ Audio documentation updates from Dave Mills
+
+ ChangeLog@1.34 +1 -0
+ Audio documentation updates from Dave Mills
+
+ html/audio.html@1.19 +5 -6
+ Audio documentation updates from Dave Mills
+
+ html/drivers/driver36.html@1.32 +6 -6
+ Audio documentation updates from Dave Mills
+
+ html/drivers/driver6.html@1.24 +3 -3
+ Audio documentation updates from Dave Mills
+
+ html/drivers/driver7.html@1.26 +4 -5
+ Audio documentation updates from Dave Mills
+
+ChangeSet@1.1463, 2007-05-09 23:39:05-04:00, stenn@whimsy.udel.edu
+ refenerate ntp_parser.c
+
+ ntpd/ntp_parser.c@1.5 +260 -236
+ regenerate .y->.c file
+
+ChangeSet@1.1462, 2007-05-09 20:42:07-04:00, stenn@pogo.udel.edu
+ Build even if no OPENSSL
+
+ ntpd/ntp_config.c@1.148 +12 -2
+ Build even if no OPENSSL
+
+ ntpd/ntp_parser.y@1.4 +23 -0
+ Build even if no OPENSSL
+
+ChangeSet@1.1440.1.99, 2007-05-09 16:23:14-04:00, stenn@whimsy.udel.edu
+ More fuzz bit cleanup from Dave Mills
+
+ ChangeLog@1.31.1.2 +2 -1
+ More fuzz bit cleanup from Dave Mills
+
+ libntp/systime.c@1.38.1.2 +18 -16
+ More fuzz bit cleanup from Dave Mills
+
+ChangeSet@1.1440.1.98, 2007-05-09 07:42:10-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P29
+ TAG: NTP_4_2_5P29
+
+ ntpd/ntpd-opts.c@1.16 +2 -2
+ NTP_4_2_5P29
+
+ ntpd/ntpd-opts.h@1.16 +3 -3
+ NTP_4_2_5P29
+
+ ntpd/ntpd-opts.texi@1.15 +2 -2
+ NTP_4_2_5P29
+
+ ntpd/ntpd.1@1.15 +2 -2
+ NTP_4_2_5P29
+
+ ntpd/ntpdsim-opts.c@1.16 +2 -2
+ NTP_4_2_5P29
+
+ ntpd/ntpdsim-opts.h@1.16 +3 -3
+ NTP_4_2_5P29
+
+ ntpd/ntpdsim-opts.texi@1.15 +1 -1
+ NTP_4_2_5P29
+
+ ntpd/ntpdsim.1@1.15 +2 -2
+ NTP_4_2_5P29
+
+ ntpdc/ntpdc-opts.c@1.16 +2 -2
+ NTP_4_2_5P29
+
+ ntpdc/ntpdc-opts.h@1.16 +3 -3
+ NTP_4_2_5P29
+
+ ntpdc/ntpdc-opts.texi@1.15 +2 -2
+ NTP_4_2_5P29
+
+ ntpdc/ntpdc.1@1.15 +2 -2
+ NTP_4_2_5P29
+
+ ntpq/ntpq-opts.c@1.16 +2 -2
+ NTP_4_2_5P29
+
+ ntpq/ntpq-opts.h@1.16 +3 -3
+ NTP_4_2_5P29
+
+ ntpq/ntpq-opts.texi@1.15 +2 -2
+ NTP_4_2_5P29
+
+ ntpq/ntpq.1@1.15 +2 -2
+ NTP_4_2_5P29
+
+ packageinfo.sh@1.32 +1 -1
+ NTP_4_2_5P29
+
+ sntp/sntp-opts.c@1.16 +2 -2
+ NTP_4_2_5P29
+
+ sntp/sntp-opts.h@1.16 +3 -3
+ NTP_4_2_5P29
+
+ sntp/sntp-opts.texi@1.15 +1 -1
+ NTP_4_2_5P29
+
+ sntp/sntp.1@1.15 +2 -2
+ NTP_4_2_5P29
+
+ util/ntp-keygen-opts.c@1.17 +2 -2
+ NTP_4_2_5P29
+
+ util/ntp-keygen-opts.h@1.17 +3 -3
+ NTP_4_2_5P29
+
+ util/ntp-keygen-opts.texi@1.16 +2 -2
+ NTP_4_2_5P29
+
+ util/ntp-keygen.1@1.16 +2 -2
+ NTP_4_2_5P29
+
+ChangeSet@1.1440.1.97, 2007-05-09 05:19:46-04:00, stenn@whimsy.udel.edu
+ Added the ChangeLog entry from the previous commit
+
+ ChangeLog@1.31.1.1 +1 -0
+ Added the ChangeLog entry from the previous commit
+
+ChangeSet@1.1459, 2007-05-08 20:32:56-04:00, stenn@pogo.udel.edu
+ Protect some "debug" references
+
+ ntpd/ntp_control.c@1.93 +3 -0
+ Protect some "debug" references
+
+ ntpd/ntp_scanner.c@1.3 +4 -2
+ Protect some "debug" references
+
+ChangeSet@1.1440.1.96, 2007-05-07 07:42:57-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P28
+ TAG: NTP_4_2_5P28
+
+ ntpd/ntpd-opts.c@1.15 +2 -2
+ NTP_4_2_5P28
+
+ ntpd/ntpd-opts.h@1.15 +3 -3
+ NTP_4_2_5P28
+
+ ntpd/ntpd-opts.texi@1.14 +1 -1
+ NTP_4_2_5P28
+
+ ntpd/ntpd.1@1.14 +2 -2
+ NTP_4_2_5P28
+
+ ntpd/ntpdsim-opts.c@1.15 +2 -2
+ NTP_4_2_5P28
+
+ ntpd/ntpdsim-opts.h@1.15 +3 -3
+ NTP_4_2_5P28
+
+ ntpd/ntpdsim-opts.texi@1.14 +1 -1
+ NTP_4_2_5P28
+
+ ntpd/ntpdsim.1@1.14 +2 -2
+ NTP_4_2_5P28
+
+ ntpdc/ntpdc-opts.c@1.15 +2 -2
+ NTP_4_2_5P28
+
+ ntpdc/ntpdc-opts.h@1.15 +3 -3
+ NTP_4_2_5P28
+
+ ntpdc/ntpdc-opts.texi@1.14 +1 -1
+ NTP_4_2_5P28
+
+ ntpdc/ntpdc.1@1.14 +2 -2
+ NTP_4_2_5P28
+
+ ntpq/ntpq-opts.c@1.15 +2 -2
+ NTP_4_2_5P28
+
+ ntpq/ntpq-opts.h@1.15 +3 -3
+ NTP_4_2_5P28
+
+ ntpq/ntpq-opts.texi@1.14 +1 -1
+ NTP_4_2_5P28
+
+ ntpq/ntpq.1@1.14 +2 -2
+ NTP_4_2_5P28
+
+ packageinfo.sh@1.31 +1 -1
+ NTP_4_2_5P28
+
+ sntp/sntp-opts.c@1.15 +2 -2
+ NTP_4_2_5P28
+
+ sntp/sntp-opts.h@1.15 +3 -3
+ NTP_4_2_5P28
+
+ sntp/sntp-opts.texi@1.14 +1 -1
+ NTP_4_2_5P28
+
+ sntp/sntp.1@1.14 +2 -2
+ NTP_4_2_5P28
+
+ util/ntp-keygen-opts.c@1.16 +2 -2
+ NTP_4_2_5P28
+
+ util/ntp-keygen-opts.h@1.16 +3 -3
+ NTP_4_2_5P28
+
+ util/ntp-keygen-opts.texi@1.15 +1 -1
+ NTP_4_2_5P28
+
+ util/ntp-keygen.1@1.15 +2 -2
+ NTP_4_2_5P28
+
+ChangeSet@1.1440.1.95, 2007-05-07 06:43:34-04:00, stenn@whimsy.udel.edu
+ replay cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.252 +15 -18
+ replay cleanup from Dave Mills
+
+ChangeSet@1.1440.1.94, 2007-05-07 06:35:26-04:00, stenn@whimsy.udel.edu
+ Cleanup random fuzz bits. (Dave Mills)
+
+ libntp/systime.c@1.38.1.1 +7 -15
+ Cleanup random fuzz bits. (Dave Mills)
+
+ChangeSet@1.1458, 2007-05-05 22:28:37-04:00, stenn@pogo.udel.edu
+ New config file parsing code
+
+ ChangeLog@1.32 +1 -0
+ New config file parsing code
+
+ChangeSet@1.1457, 2007-05-05 14:29:11-04:00, stenn@pogo.udel.edu
+ bootstrap yacc/bison files
+
+ bootstrap@1.19 +4 -0
+ bootstrap yacc/bison files
+
+ChangeSet@1.1455, 2007-05-05 14:15:36-04:00, stenn@pogo.udel.edu
+ OPENSSL and DEBUG cleanup
+
+ ntpd/ntp_config.c@1.147 +6 -0
+ OPENSSL and DEBUG cleanup
+
+ChangeSet@1.1436.1.46, 2007-04-28 10:19:57+00:00, kardel@pogo.udel.edu
+ ntp_peer.c:
+ Bug 789 (backported from ntp-dev):
+ Fix multicast client crypto authentication and make sure arriving
+ multicast packets do not disturb the autokey dance.
+ ChangeLog:
+ Bug 789 (backported from ntp-dev):
+ Fix multicast client crypto authentication and make sure arriving
+ multicast packets do not disturb the autokey dance.
+
+ ChangeLog@1.1.1.12 +4 -1
+ Bug 789:
+ Fix multicast client crypto authentication and make sure arriving
+ multicast packets do not disturb the autokey dance.
+
+ ntpd/ntp_peer.c@1.97.1.2 +21 -12
+ Bug 789 (backported from ntp-dev):
+ fix multicast client mode by re-setting
+ crypto information only when the local address
+ changes and not for BCLNTs.
+ Addtitionally don't update the local address while
+ a BCLNT is doing the autokey dance.
+
+ChangeSet@1.1436.1.45, 2007-04-28 10:03:26+00:00, kardel@pogo.udel.edu
+ ntp_io.c, ChangeLog:
+ bug 785 (backport from ntp-dev):
+ improve handling of multicast interfaces
+ (multicast routers still need to run a multicast routing software/daemon)
+ ntp_peer.c:
+ bug 785 (backport from ntp-dev):
+ clarify debug messages
+
+ ChangeLog@1.1.1.11 +1 -0
+ bug 785 (backport from ntp-dev):
+ improve handling of multicast interfaces
+ (multicast routers still need to run a multicast routing software/daemon)
+
+ ntpd/ntp_io.c@1.244.2.4 +84 -62
+ bug 785 (backport from ntp-dev):
+ improve handling of multicast interfaces
+ (multicast routers still need to run a multicast routing software/daemon)
+
+ ntpd/ntp_peer.c@1.97.1.1 +2 -2
+ bug 785 (backport from ntp-dev):
+ clarify debug messages
+
+ChangeSet@1.1440.1.93, 2007-04-25 07:46:23-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P27
+ TAG: NTP_4_2_5P27
+
+ ntpd/ntpd-opts.c@1.14 +2 -2
+ NTP_4_2_5P27
+
+ ntpd/ntpd-opts.h@1.14 +3 -3
+ NTP_4_2_5P27
+
+ ntpd/ntpd-opts.texi@1.13 +2 -8
+ NTP_4_2_5P27
+
+ ntpd/ntpd.1@1.13 +2 -2
+ NTP_4_2_5P27
+
+ ntpd/ntpdsim-opts.c@1.14 +2 -2
+ NTP_4_2_5P27
+
+ ntpd/ntpdsim-opts.h@1.14 +3 -3
+ NTP_4_2_5P27
+
+ ntpd/ntpdsim-opts.texi@1.13 +1 -1
+ NTP_4_2_5P27
+
+ ntpd/ntpdsim.1@1.13 +2 -2
+ NTP_4_2_5P27
+
+ ntpdc/ntpdc-opts.c@1.14 +2 -2
+ NTP_4_2_5P27
+
+ ntpdc/ntpdc-opts.h@1.14 +3 -3
+ NTP_4_2_5P27
+
+ ntpdc/ntpdc-opts.texi@1.13 +2 -2
+ NTP_4_2_5P27
+
+ ntpdc/ntpdc.1@1.13 +2 -2
+ NTP_4_2_5P27
+
+ ntpq/ntpq-opts.c@1.14 +2 -2
+ NTP_4_2_5P27
+
+ ntpq/ntpq-opts.h@1.14 +3 -3
+ NTP_4_2_5P27
+
+ ntpq/ntpq-opts.texi@1.13 +2 -2
+ NTP_4_2_5P27
+
+ ntpq/ntpq.1@1.13 +2 -2
+ NTP_4_2_5P27
+
+ packageinfo.sh@1.30 +1 -1
+ NTP_4_2_5P27
+
+ sntp/sntp-opts.c@1.14 +2 -2
+ NTP_4_2_5P27
+
+ sntp/sntp-opts.h@1.14 +3 -3
+ NTP_4_2_5P27
+
+ sntp/sntp-opts.texi@1.13 +1 -1
+ NTP_4_2_5P27
+
+ sntp/sntp.1@1.13 +2 -2
+ NTP_4_2_5P27
+
+ util/ntp-keygen-opts.c@1.15 +2 -2
+ NTP_4_2_5P27
+
+ util/ntp-keygen-opts.h@1.15 +3 -3
+ NTP_4_2_5P27
+
+ util/ntp-keygen-opts.texi@1.14 +2 -2
+ NTP_4_2_5P27
+
+ util/ntp-keygen.1@1.14 +2 -2
+ NTP_4_2_5P27
+
+ChangeSet@1.1440.1.92, 2007-04-25 03:39:23-04:00, stenn@whimsy.udel.edu
+ The m4/ subdirectory is magically handled.
+
+ Makefile.am@1.75 +0 -1
+ The m4/ subdirectory is magically handled.
+
+ChangeSet@1.1440.1.91, 2007-04-25 02:45:35-04:00, stenn@whimsy.udel.edu
+ [Bug 542] Tolerate missing directory separator at EO statsdir
+
+ ChangeLog@1.31 +1 -0
+ [Bug 542] Tolerate missing directory separator at EO statsdir
+
+ Makefile.am@1.74 +1 -0
+ [Bug 542] Tolerate missing directory separator at EO statsdir
+
+ configure.ac@1.404.1.1 +1 -0
+ [Bug 542] Tolerate missing directory separator at EO statsdir
+
+ m4/ntp_dir_sep.m4@1.1 +18 -0
+ BitKeeper file /deacon/backroom/ntp-dev/m4/ntp_dir_sep.m4
+
+ m4/ntp_dir_sep.m4@1.0 +0 -0
+
+ ntpd/ntp_util.c@1.44 +20 -1
+ [Bug 542] Tolerate missing directory separator at EO statsdir
+
+ ports/winnt/include/config.h@1.49 +10 -7
+ [Bug 542] Tolerate missing directory separator at EO statsdir
+
+ChangeSet@1.1454, 2007-04-23 16:33:49+00:00, kamboj@pogo.udel.edu
+ Includes changes to allow the seperate compilation of ntp_data_structures.c ntp_scanner.c and ntp_parser.y
+ Also includes other minor bugfixes.
+
+ BitKeeper/etc/ignore@1.60, stenn@pogo.udel.edu +1 -0
+ added ylwrap
+
+ configure.ac@1.405 +1 -0
+ Minor Changes
+
+ include/ntp_config.h@1.44 +25 -9
+ Moved some declarations from ntp_scanner.h to this file and vice versa.
+
+ include/ntpsim.h@1.8 +0 -1
+ Removed a comment
+
+ libntp/systime.c@1.40 +2 -1
+ No changes
+
+ ntpd/Makefile.am@1.57 +5 -2
+ Updated SOURCES to include ntp_data_structures.c ntp_scanner.c and ntp_parser.y files
+
+ ntpd/cmd_args.c@1.49 +1 -1
+ Minor bugfix
+
+ ntpd/ntp_config.c@1.146 +8 -58
+ Removed the direcrt inclusion of source files.
+ Including headers instead.
+
+ ntpd/ntp_data_structures.c@1.2 +5 -2
+ Updated to include a header file for the data structures.
+
+ ntpd/ntp_parser.c@1.4 +683 -650
+ New file generated from ntp_parser.y
+
+ ntpd/ntp_parser.c@1.3, stenn@pogo.udel.edu +0 -0
+ Rename: ntpd/ntp_config.tab.c -> ntpd/ntp_parser.c
+
+ ntpd/ntp_parser.h@1.2 +4 -3
+ New file generated from ntp_parser.y
+
+ ntpd/ntp_parser.h@1.1, stenn@pogo.udel.edu +174 -0
+ BitKeeper file /pogo/users/kamboj/new-config-bk-repo/ntpd/ntp_parser.h
+
+ ntpd/ntp_parser.h@1.0, stenn@pogo.udel.edu +0 -0
+
+ ntpd/ntp_parser.y@1.3 +38 -1
+ Added required headers to the code
+
+ ntpd/ntp_parser.y@1.2, stenn@pogo.udel.edu +0 -0
+ Rename: ntpd/ntp_config.y -> ntpd/ntp_parser.y
+
+ ntpd/ntp_scanner.c@1.2 +25 -36
+ Minor changes:
+ Updated function definitions to conform to ANSI C
+ Moved some data from ntp_scanner.h to this file
+
+ ntpd/ntp_scanner.h@1.2 +14 -36
+ Moved some declarations to ntp_config.h
+
+ ntpd/ntp_scanner.h@1.1, stenn@pogo.udel.edu +97 -0
+ BitKeeper file /pogo/users/kamboj/new-config-bk-repo/ntpd/ntp_scanner.h
+
+ ntpd/ntp_scanner.h@1.0, stenn@pogo.udel.edu +0 -0
+
+ ntpd/ntpsim.c@1.16 +6 -35
+ Removed some old redundant comments
+
+ChangeSet@1.1440.1.90, 2007-04-22 07:42:54-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P26
+ TAG: NTP_4_2_5P26
+
+ ntpd/ntpd-opts.c@1.13 +2 -2
+ NTP_4_2_5P26
+
+ ntpd/ntpd-opts.h@1.13 +3 -3
+ NTP_4_2_5P26
+
+ ntpd/ntpd-opts.texi@1.12 +1 -1
+ NTP_4_2_5P26
+
+ ntpd/ntpd.1@1.12 +2 -2
+ NTP_4_2_5P26
+
+ ntpd/ntpdsim-opts.c@1.13 +2 -2
+ NTP_4_2_5P26
+
+ ntpd/ntpdsim-opts.h@1.13 +3 -3
+ NTP_4_2_5P26
+
+ ntpd/ntpdsim-opts.texi@1.12 +1 -1
+ NTP_4_2_5P26
+
+ ntpd/ntpdsim.1@1.12 +2 -2
+ NTP_4_2_5P26
+
+ ntpdc/ntpdc-opts.c@1.13 +2 -2
+ NTP_4_2_5P26
+
+ ntpdc/ntpdc-opts.h@1.13 +3 -3
+ NTP_4_2_5P26
+
+ ntpdc/ntpdc-opts.texi@1.12 +1 -1
+ NTP_4_2_5P26
+
+ ntpdc/ntpdc.1@1.12 +2 -2
+ NTP_4_2_5P26
+
+ ntpq/ntpq-opts.c@1.13 +2 -2
+ NTP_4_2_5P26
+
+ ntpq/ntpq-opts.h@1.13 +3 -3
+ NTP_4_2_5P26
+
+ ntpq/ntpq-opts.texi@1.12 +1 -1
+ NTP_4_2_5P26
+
+ ntpq/ntpq.1@1.12 +2 -2
+ NTP_4_2_5P26
+
+ packageinfo.sh@1.29 +1 -1
+ NTP_4_2_5P26
+
+ sntp/sntp-opts.c@1.13 +2 -2
+ NTP_4_2_5P26
+
+ sntp/sntp-opts.h@1.13 +3 -3
+ NTP_4_2_5P26
+
+ sntp/sntp-opts.texi@1.12 +1 -1
+ NTP_4_2_5P26
+
+ sntp/sntp.1@1.12 +2 -2
+ NTP_4_2_5P26
+
+ util/ntp-keygen-opts.c@1.14 +2 -2
+ NTP_4_2_5P26
+
+ util/ntp-keygen-opts.h@1.14 +3 -3
+ NTP_4_2_5P26
+
+ util/ntp-keygen-opts.texi@1.13 +1 -1
+ NTP_4_2_5P26
+
+ util/ntp-keygen.1@1.13 +2 -2
+ NTP_4_2_5P26
+
+ChangeSet@1.1440.1.89, 2007-04-21 13:13:03-04:00, stenn@whimsy.udel.edu
+ [Bug 812] ntpd should drop supplementary groups
+
+ ChangeLog@1.30 +1 -0
+ [Bug 812] ntpd should drop supplementary groups
+
+ChangeSet@1.1440.1.88, 2007-04-21 07:43:00-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P25
+ TAG: NTP_4_2_5P25
+
+ ntpd/ntpd-opts.c@1.12 +2 -2
+ NTP_4_2_5P25
+
+ ntpd/ntpd-opts.h@1.12 +3 -3
+ NTP_4_2_5P25
+
+ ntpd/ntpd-opts.texi@1.11 +1 -1
+ NTP_4_2_5P25
+
+ ntpd/ntpd.1@1.11 +2 -2
+ NTP_4_2_5P25
+
+ ntpd/ntpdsim-opts.c@1.12 +2 -2
+ NTP_4_2_5P25
+
+ ntpd/ntpdsim-opts.h@1.12 +3 -3
+ NTP_4_2_5P25
+
+ ntpd/ntpdsim-opts.texi@1.11 +1 -1
+ NTP_4_2_5P25
+
+ ntpd/ntpdsim.1@1.11 +2 -2
+ NTP_4_2_5P25
+
+ ntpdc/ntpdc-opts.c@1.12 +2 -2
+ NTP_4_2_5P25
+
+ ntpdc/ntpdc-opts.h@1.12 +3 -3
+ NTP_4_2_5P25
+
+ ntpdc/ntpdc-opts.texi@1.11 +1 -1
+ NTP_4_2_5P25
+
+ ntpdc/ntpdc.1@1.11 +2 -2
+ NTP_4_2_5P25
+
+ ntpq/ntpq-opts.c@1.12 +2 -2
+ NTP_4_2_5P25
+
+ ntpq/ntpq-opts.h@1.12 +3 -3
+ NTP_4_2_5P25
+
+ ntpq/ntpq-opts.texi@1.11 +1 -1
+ NTP_4_2_5P25
+
+ ntpq/ntpq.1@1.11 +2 -2
+ NTP_4_2_5P25
+
+ packageinfo.sh@1.28 +1 -1
+ NTP_4_2_5P25
+
+ sntp/sntp-opts.c@1.12 +2 -2
+ NTP_4_2_5P25
+
+ sntp/sntp-opts.h@1.12 +3 -3
+ NTP_4_2_5P25
+
+ sntp/sntp-opts.texi@1.11 +1 -1
+ NTP_4_2_5P25
+
+ sntp/sntp.1@1.11 +2 -2
+ NTP_4_2_5P25
+
+ util/ntp-keygen-opts.c@1.13 +2 -2
+ NTP_4_2_5P25
+
+ util/ntp-keygen-opts.h@1.13 +3 -3
+ NTP_4_2_5P25
+
+ util/ntp-keygen-opts.texi@1.12 +1 -1
+ NTP_4_2_5P25
+
+ util/ntp-keygen.1@1.12 +2 -2
+ NTP_4_2_5P25
+
+ChangeSet@1.1440.1.87, 2007-04-21 01:14:37-04:00, stenn@whimsy.udel.edu
+ [Bug 812] ntpd should drop supplementary groups
+
+ ntpd/ntpd.c@1.83.1.3 +24 -2
+ [Bug 812] ntpd should drop supplementary groups
+
+ChangeSet@1.1453, 2007-04-20 16:18:30+00:00, kamboj@pogo.udel.edu
+ Minor Bugfixes
+
+ include/ntp_config.h@1.43 +1 -1
+ A minor bugfix to make a prototype ANSI C compliant
+
+ ntpd/ntp_config.c@1.145 +5 -3
+ Minor bugfixes
+
+ ntpd/ntp_config.tab.c@1.2 +1193 -984
+ Added minor bugfixes to ntp_config.y
+
+ChangeSet@1.1440.1.86, 2007-04-20 07:42:36-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P24
+ TAG: NTP_4_2_5P24
+
+ ntpd/ntpd-opts.c@1.11 +2 -2
+ NTP_4_2_5P24
+
+ ntpd/ntpd-opts.h@1.11 +3 -3
+ NTP_4_2_5P24
+
+ ntpd/ntpd-opts.texi@1.10 +1 -1
+ NTP_4_2_5P24
+
+ ntpd/ntpd.1@1.10 +2 -2
+ NTP_4_2_5P24
+
+ ntpd/ntpdsim-opts.c@1.11 +2 -2
+ NTP_4_2_5P24
+
+ ntpd/ntpdsim-opts.h@1.11 +3 -3
+ NTP_4_2_5P24
+
+ ntpd/ntpdsim-opts.texi@1.10 +1 -1
+ NTP_4_2_5P24
+
+ ntpd/ntpdsim.1@1.10 +2 -2
+ NTP_4_2_5P24
+
+ ntpdc/ntpdc-opts.c@1.11 +2 -2
+ NTP_4_2_5P24
+
+ ntpdc/ntpdc-opts.h@1.11 +3 -3
+ NTP_4_2_5P24
+
+ ntpdc/ntpdc-opts.texi@1.10 +1 -1
+ NTP_4_2_5P24
+
+ ntpdc/ntpdc.1@1.10 +2 -2
+ NTP_4_2_5P24
+
+ ntpq/ntpq-opts.c@1.11 +2 -2
+ NTP_4_2_5P24
+
+ ntpq/ntpq-opts.h@1.11 +3 -3
+ NTP_4_2_5P24
+
+ ntpq/ntpq-opts.texi@1.10 +1 -1
+ NTP_4_2_5P24
+
+ ntpq/ntpq.1@1.10 +2 -2
+ NTP_4_2_5P24
+
+ packageinfo.sh@1.27 +1 -1
+ NTP_4_2_5P24
+
+ sntp/sntp-opts.c@1.11 +2 -2
+ NTP_4_2_5P24
+
+ sntp/sntp-opts.h@1.11 +3 -3
+ NTP_4_2_5P24
+
+ sntp/sntp-opts.texi@1.10 +1 -1
+ NTP_4_2_5P24
+
+ sntp/sntp.1@1.10 +2 -2
+ NTP_4_2_5P24
+
+ util/ntp-keygen-opts.c@1.12 +2 -2
+ NTP_4_2_5P24
+
+ util/ntp-keygen-opts.h@1.12 +3 -3
+ NTP_4_2_5P24
+
+ util/ntp-keygen-opts.texi@1.11 +1 -1
+ NTP_4_2_5P24
+
+ util/ntp-keygen.1@1.11 +2 -2
+ NTP_4_2_5P24
+
+ChangeSet@1.1440.1.85, 2007-04-20 01:04:24-04:00, stenn@whimsy.udel.edu
+ [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6
+
+ ChangeLog@1.29 +1 -0
+ [Bug 815] Fix warning compiling 4.2.5p22 under Windows with VC6
+
+ChangeSet@1.1440.1.84, 2007-04-20 00:56:48-04:00, stenn@whimsy.udel.edu
+ Fix permissions of sntp/sntp-opts.menu
+
+ sntp/sntp-opts.menu@1.3 +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.1440.1.83, 2007-04-18 12:53:10+00:00, burnicki@pogo.udel.edu
+ [Bug #815] Define HAVE_UINTPTR_T under Windows to avoid duplicate definition elsewhere.
+
+ ports/winnt/include/config.h@1.48 +2 -0
+ [Bug #815] Define HAVE_UINTPTR_T under Windows to avoid duplicate definition elsewhere.
+
+ChangeSet@1.1440.1.82, 2007-04-18 08:18:53-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P23
+ TAG: NTP_4_2_5P23
+
+ ntpd/ntpd-opts.c@1.10 +7 -50
+ NTP_4_2_5P23
+
+ ntpd/ntpd-opts.h@1.10 +5 -13
+ NTP_4_2_5P23
+
+ ntpd/ntpd-opts.texi@1.9 +1 -1
+ NTP_4_2_5P23
+
+ ntpd/ntpd.1@1.9 +3 -19
+ NTP_4_2_5P23
+
+ ntpd/ntpdsim-opts.c@1.10 +2 -2
+ NTP_4_2_5P23
+
+ ntpd/ntpdsim-opts.h@1.10 +3 -3
+ NTP_4_2_5P23
+
+ ntpd/ntpdsim-opts.texi@1.9 +1 -1
+ NTP_4_2_5P23
+
+ ntpd/ntpdsim.1@1.9 +2 -2
+ NTP_4_2_5P23
+
+ ntpdc/ntpdc-opts.c@1.10 +2 -2
+ NTP_4_2_5P23
+
+ ntpdc/ntpdc-opts.h@1.10 +3 -3
+ NTP_4_2_5P23
+
+ ntpdc/ntpdc-opts.texi@1.9 +1 -1
+ NTP_4_2_5P23
+
+ ntpdc/ntpdc.1@1.9 +2 -2
+ NTP_4_2_5P23
+
+ ntpq/ntpq-opts.c@1.10 +2 -2
+ NTP_4_2_5P23
+
+ ntpq/ntpq-opts.h@1.10 +3 -3
+ NTP_4_2_5P23
+
+ ntpq/ntpq-opts.texi@1.9 +1 -1
+ NTP_4_2_5P23
+
+ ntpq/ntpq.1@1.9 +2 -2
+ NTP_4_2_5P23
+
+ packageinfo.sh@1.26 +1 -1
+ NTP_4_2_5P23
+
+ sntp/sntp-opts.c@1.10 +2 -2
+ NTP_4_2_5P23
+
+ sntp/sntp-opts.h@1.10 +3 -3
+ NTP_4_2_5P23
+
+ sntp/sntp-opts.texi@1.9 +1 -1
+ NTP_4_2_5P23
+
+ sntp/sntp.1@1.9 +2 -2
+ NTP_4_2_5P23
+
+ util/ntp-keygen-opts.c@1.11 +2 -2
+ NTP_4_2_5P23
+
+ util/ntp-keygen-opts.h@1.11 +3 -3
+ NTP_4_2_5P23
+
+ util/ntp-keygen-opts.texi@1.10 +1 -1
+ NTP_4_2_5P23
+
+ util/ntp-keygen.1@1.10 +2 -2
+ NTP_4_2_5P23
+
+ChangeSet@1.1440.5.1, 2007-04-18 06:05:04-04:00, stenn@deacon.udel.edu
+ [Bug 740] Fix kernel/daemon startup drift anomaly
+
+ ChangeLog@1.26.1.1 +1 -0
+ [Bug 740] Fix kernel/daemon startup drift anomaly
+
+ conf/beauregard.conf@1.3 +1 -1
+ fix a typo in a comment line
+
+ ntpd/cmd_args.c@1.45.2.1 +3 -2
+ [Bug 740] Fix kernel/daemon startup drift anomaly
+
+ ntpd/ntp_loopfilter.c@1.133 +4 -4
+ [Bug 740] Fix kernel/daemon startup drift anomaly
+
+ ntpd/ntp_proto.c@1.251 +0 -8
+ [Bug 740] Fix kernel/daemon startup drift anomaly
+
+ChangeSet@1.1436.1.44, 2007-04-14 19:05:07-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P2_RC1
+ TAG: NTP_4_2_4P2_RC1
+
+ ntpd/ntpd-opts.c@1.50.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ ntpd/ntpd-opts.h@1.50.2.3 +3 -3
+ NTP_4_2_4P2_RC1
+
+ ntpd/ntpd-opts.texi@1.49.2.3 +1 -1
+ NTP_4_2_4P2_RC1
+
+ ntpd/ntpd.1@1.48.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.2.3 +3 -3
+ NTP_4_2_4P2_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.2.3 +1 -1
+ NTP_4_2_4P2_RC1
+
+ ntpd/ntpdsim.1@1.48.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.2.3 +3 -3
+ NTP_4_2_4P2_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.2.3 +1 -1
+ NTP_4_2_4P2_RC1
+
+ ntpdc/ntpdc.1@1.48.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ ntpq/ntpq-opts.c@1.52.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ ntpq/ntpq-opts.h@1.52.2.3 +3 -3
+ NTP_4_2_4P2_RC1
+
+ ntpq/ntpq-opts.texi@1.49.2.3 +1 -1
+ NTP_4_2_4P2_RC1
+
+ ntpq/ntpq.1@1.48.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ packageinfo.sh@1.65.8.4 +2 -2
+ NTP_4_2_4P2_RC1
+
+ sntp/sntp-opts.c@1.49.2.2 +2 -2
+ NTP_4_2_4P2_RC1
+
+ sntp/sntp-opts.h@1.49.2.2 +3 -3
+ NTP_4_2_4P2_RC1
+
+ sntp/sntp-opts.texi@1.46.2.2 +1 -1
+ NTP_4_2_4P2_RC1
+
+ sntp/sntp.1@1.49.2.2 +2 -2
+ NTP_4_2_4P2_RC1
+
+ util/ntp-keygen-opts.c@1.49.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ util/ntp-keygen-opts.h@1.49.2.3 +3 -3
+ NTP_4_2_4P2_RC1
+
+ util/ntp-keygen-opts.texi@1.47.2.3 +1 -1
+ NTP_4_2_4P2_RC1
+
+ util/ntp-keygen.1@1.47.2.3 +2 -2
+ NTP_4_2_4P2_RC1
+
+ChangeSet@1.1436.1.43, 2007-04-14 18:16:04-04:00, stenn@deacon.udel.edu
+ Distribute include/homerc.def
+
+ include/Makefile.am@1.24.1.1 +1 -1
+ Distribute include/homerc.def
+
+ packageinfo.sh@1.65.8.3 +1 -1
+ restart the RC
+
+ChangeSet@1.1436.1.42, 2007-04-14 07:53:43-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P1_RC1
+ TAG: NTP_4_2_4P1_RC1
+
+ ntpd/ntpd-opts.c@1.50.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpd/ntpd-opts.h@1.50.2.2 +3 -3
+ NTP_4_2_4P1_RC1
+
+ ntpd/ntpd-opts.texi@1.49.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpd/ntpd.1@1.48.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.2.2 +3 -3
+ NTP_4_2_4P1_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.2.2 +1 -1
+ NTP_4_2_4P1_RC1
+
+ ntpd/ntpdsim.1@1.48.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.2.2 +3 -3
+ NTP_4_2_4P1_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpdc/ntpdc.1@1.48.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpq/ntpq-opts.c@1.52.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpq/ntpq-opts.h@1.52.2.2 +3 -3
+ NTP_4_2_4P1_RC1
+
+ ntpq/ntpq-opts.texi@1.49.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ ntpq/ntpq.1@1.48.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ packageinfo.sh@1.65.8.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ sntp/sntp-opts.c@1.49.2.1 +8 -7
+ NTP_4_2_4P1_RC1
+
+ sntp/sntp-opts.h@1.49.2.1 +8 -14
+ NTP_4_2_4P1_RC1
+
+ sntp/sntp-opts.texi@1.46.2.1 +1 -1
+ NTP_4_2_4P1_RC1
+
+ sntp/sntp.1@1.49.2.1 +2 -2
+ NTP_4_2_4P1_RC1
+
+ util/ntp-keygen-opts.c@1.49.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ util/ntp-keygen-opts.h@1.49.2.2 +3 -3
+ NTP_4_2_4P1_RC1
+
+ util/ntp-keygen-opts.texi@1.47.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ util/ntp-keygen.1@1.47.2.2 +2 -2
+ NTP_4_2_4P1_RC1
+
+ChangeSet@1.1436.1.41, 2007-04-14 05:13:18-04:00, stenn@whimsy.udel.edu
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ChangeLog@1.1.1.10 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ChangeSet@1.1436.1.40, 2007-04-14 04:47:21-04:00, stenn@whimsy.udel.edu
+ start an RC cycle
+
+ packageinfo.sh@1.65.8.1 +2 -2
+ start an RC cycle
+
+ChangeSet@1.1436.1.39, 2007-04-14 02:38:03-04:00, stenn@whimsy.udel.edu
+ [Bug 811] ntpd should not read a .ntprc file
+
+ clockstuff/Makefile.am@1.5.1.1 +1 -1
+ [Bug 811] ntpd should not read a .ntprc file
+
+ clockstuff/clktest-opts.def@1.5 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ include/copyright.def@1.4 +0 -7
+ [Bug 811] ntpd should not read a .ntprc file
+
+ include/homerc.def@1.1 +9 -0
+ BitKeeper file /deacon/backroom/ntp-stable/include/homerc.def
+
+ include/homerc.def@1.0 +0 -0
+
+ ntpd/Makefile.am@1.52.2.1 +3 -3
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpd-opts.c@1.50.2.1 +12 -54
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpd-opts.h@1.50.2.1 +8 -22
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpd-opts.texi@1.49.2.1 +3 -3
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpd.1@1.48.2.1 +3 -19
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpdsim-opts.c@1.50.2.1 +7 -6
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpdsim-opts.def@1.6 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpdsim-opts.h@1.50.2.1 +6 -12
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpdsim-opts.texi@1.48.2.1 +1 -1
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpd/ntpdsim.1@1.48.2.1 +2 -2
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpdc/Makefile.am@1.33.1.1 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpdc/ntpdc-opts.c@1.50.2.1 +7 -6
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpdc/ntpdc-opts.def@1.13 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpdc/ntpdc-opts.h@1.50.2.1 +6 -12
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpdc/ntpdc-opts.texi@1.48.2.1 +3 -3
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpdc/ntpdc.1@1.48.2.1 +2 -2
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpq/Makefile.am@1.25.1.1 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpq/ntpq-opts.c@1.52.2.1 +7 -6
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpq/ntpq-opts.def@1.12 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpq/ntpq-opts.h@1.52.2.1 +6 -12
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpq/ntpq-opts.texi@1.49.2.1 +3 -3
+ [Bug 811] ntpd should not read a .ntprc file
+
+ ntpq/ntpq.1@1.48.2.1 +2 -2
+ [Bug 811] ntpd should not read a .ntprc file
+
+ util/Makefile.am@1.34.1.1 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ util/ntp-keygen-opts.c@1.49.2.1 +7 -6
+ [Bug 811] ntpd should not read a .ntprc file
+
+ util/ntp-keygen-opts.def@1.6.1.1 +1 -0
+ [Bug 811] ntpd should not read a .ntprc file
+
+ util/ntp-keygen-opts.h@1.49.2.1 +6 -12
+ [Bug 811] ntpd should not read a .ntprc file
+
+ util/ntp-keygen-opts.texi@1.47.2.1 +3 -3
+ [Bug 811] ntpd should not read a .ntprc file
+
+ util/ntp-keygen.1@1.47.2.1 +2 -2
+ [Bug 811] ntpd should not read a .ntprc file
+
+ChangeSet@1.1436.1.38, 2007-04-14 01:11:33-04:00, stenn@whimsy.udel.edu
+ autogen/libopts upgrade
+
+ BitKeeper/deleted/.del-COPYING.lgpl@1.2.1.1 +0 -0
+ Delete: libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.lgpl~54a90ba0899593cb@1.1.1.1 +0 -0
+ Delete: sntp/libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd@1.1.1.1 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYING.mbsd~9b1945bb2136c70b@1.1.1.1 +0 -0
+ Delete: sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc@1.1.1.1 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-MakeDefs.inc~2b8fdfc9df6d652d@1.1.1.1 +0 -0
+ Delete: sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am@1.6.1.1 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~fa9bd87b6045015c@1.4.1.1 +0 -0
+ Delete: sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README@1.1.1.1 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-README~1ae087758ee867d4@1.1.1.1 +0 -0
+ Delete: sntp/libopts/README
+
+ BitKeeper/deleted/.del-autoopts.c@1.10.1.1 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.c~5b417341bc85d7a8@1.7.1.1 +0 -0
+ Delete: sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h@1.9.1.1 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-autoopts.h~8cdce21b181a1a01@1.7.1.1 +0 -0
+ Delete: sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c@1.8.1.1 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-boolean.c~a5d10c8997e6a2e2@1.5.1.1 +0 -0
+ Delete: sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h@1.12.1.1 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-compat.h~9682d0ac273ae32@1.8.1.1 +0 -0
+ Delete: sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c@1.10.1.1 +0 -0
+ Delete: libopts/configfile.c
+
+ BitKeeper/deleted/.del-configfile.c~8194f784686fa804@1.7.1.1 +0 -0
+ Delete: sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-cook.c@1.9.1.1 +0 -0
+ Delete: libopts/cook.c
+
+ BitKeeper/deleted/.del-cook.c~e48d079a438432dc@1.6.1.1 +0 -0
+ Delete: sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-enumeration.c@1.9.1.1 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-enumeration.c~5f4e6af2706370ae@1.6.1.1 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c@1.8.1.1 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-environment.c~2bae2966695067c2@1.5.1.1 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c@1.9.1.1 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.c~1fd152b2b52bdab@1.6.1.1 +0 -0
+ Delete: sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h@1.9.1.1 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-genshell.h~375f0fa5b925f454@1.6.1.1 +0 -0
+ Delete: sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c@1.3.1.1 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.c~58b8fbed850e6d5e@1.3.1.1 +0 -0
+ Delete: sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4@1.14.1.1 +0 -0
+ Delete: libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~9e0f33f57d3a0a9@1.11.1.1 +0 -0
+ Delete: sntp/libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4@1.3.1.1 +0 -0
+ Delete: libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~bbeebebe76865058@1.3.1.1 +0 -0
+ Delete: sntp/libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-libtool.m4@1.1.1.1 +0 -0
+ Delete: libopts/m4/libtool.m4
+
+ BitKeeper/deleted/.del-libtool.m4~db8acbd0fb34597f@1.1.1.1 +0 -0
+ Delete: sntp/libopts/m4/libtool.m4
+
+ BitKeeper/deleted/.del-load.c@1.10.1.1 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-load.c~59960aa12bb95bf7@1.7.1.1 +0 -0
+ Delete: sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c@1.11.1.1 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-makeshell.c~4fcd12fc31c0a4a4@1.8.1.1 +0 -0
+ Delete: sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c@1.9.1.1 +0 -0
+ Delete: libopts/nested.c
+
+ BitKeeper/deleted/.del-nested.c~85346d5d12098689@1.6.1.1 +0 -0
+ Delete: sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c@1.9.1.1 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-numeric.c~cdb7deb5cf6f27c2@1.6.1.1 +0 -0
+ Delete: sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h@1.10.1.1 +0 -0
+ Delete: libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-options.h~6eb465cb95a56bee@1.7.1.1 +0 -0
+ Delete: sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c@1.9.1.1 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pathfind.c~a0863179d884d4a4@1.6.1.1 +0 -0
+ Delete: sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c@1.9.1.1 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-pgusage.c~d981c42eb301cfdd@1.5.1.1 +0 -0
+ Delete: sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h@1.11.1.1 +0 -0
+ Delete: libopts/proto.h
+
+ BitKeeper/deleted/.del-proto.h~fa076f6dd9d0667e@1.8.1.1 +0 -0
+ Delete: sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c@1.10.1.1 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-putshell.c~24959f5e1ba688e6@1.7.1.1 +0 -0
+ Delete: sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c@1.9.1.1 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-restore.c~eada4acbf21cd8bf@1.5.1.1 +0 -0
+ Delete: sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c@1.10.1.1 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-save.c~a29f5bd429a568bb@1.7.1.1 +0 -0
+ Delete: sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c@1.4.1.1 +0 -0
+ Delete: libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-snprintf.c~66578c716014cd3d@1.3.1.1 +0 -0
+ Delete: sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sort.c@1.8.1.1 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-sort.c~bec5a7fb6a01a5dc@1.4.1.1 +0 -0
+ Delete: sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c@1.10.1.1 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-stack.c~e817b57b18b315c1@1.7.1.1 +0 -0
+ Delete: sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-strchr.c@1.3.1.1 +0 -0
+ Delete: libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strchr.c~80e88afbe7e2209a@1.3.1.1 +0 -0
+ Delete: sntp/libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strdup.c@1.3.1.1 +0 -0
+ Delete: libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-strdup.c~1f262be5e55c3c4a@1.2.1.1 +0 -0
+ Delete: sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c@1.9.1.1 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~66420c6082b06827@1.6.1.1 +0 -0
+ Delete: sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c@1.8.1.1 +0 -0
+ Delete: libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-text_mmap.c~f1915a52b87816ba@1.5.1.1 +0 -0
+ Delete: sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-tokenize.c@1.5.1.1 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.c~ae2f23dbb2bee589@1.4.1.1 +0 -0
+ Delete: sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h@1.9.1.1 +0 -0
+ Delete: libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage-txt.h~6ce4dce87430d1b@1.6.1.1 +0 -0
+ Delete: sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c@1.9.1.1 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-usage.c~c868ef1e661a6eb1@1.7.1.1 +0 -0
+ Delete: sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c@1.9.1.1 +0 -0
+ Delete: libopts/version.c
+
+ BitKeeper/deleted/.del-version.c~a426e6b58b20d06@1.6.1.1 +0 -0
+ Delete: sntp/libopts/version.c
+
+ BitKeeper/deleted/.del-windows-config.h@1.5.1.1 +0 -0
+ Delete: libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-windows-config.h~36f7ad2ccf764ad2@1.3.1.1 +0 -0
+ Delete: sntp/libopts/compat/windows-config.h
+
+ libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/COPYING.lgpl
+
+ libopts/COPYING.lgpl@1.0 +0 -0
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/COPYING.mbsd
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+
+ libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/MakeDefs.inc
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+
+ libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/Makefile.am
+
+ libopts/Makefile.am@1.0 +0 -0
+
+ libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/README
+
+ libopts/README@1.0 +0 -0
+
+ libopts/autoopts.c@1.1 +1101 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts.c
+
+ libopts/autoopts.c@1.0 +0 -0
+
+ libopts/autoopts.h@1.1 +377 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts.h
+
+ libopts/autoopts.h@1.0 +0 -0
+
+ libopts/autoopts/options.h@1.1 +964 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts/options.h
+
+ libopts/autoopts/options.h@1.0 +0 -0
+
+ libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/autoopts/usage-txt.h
+
+ libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/boolean.c
+
+ libopts/boolean.c@1.0 +0 -0
+
+ libopts/compat/compat.h@1.1 +314 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/compat.h
+
+ libopts/compat/compat.h@1.0 +0 -0
+
+ libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/pathfind.c
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+
+ libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/snprintf.c
+
+ libopts/compat/snprintf.c@1.0 +0 -0
+
+ libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/strchr.c
+
+ libopts/compat/strchr.c@1.0 +0 -0
+
+ libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/strdup.c
+
+ libopts/compat/strdup.c@1.0 +0 -0
+
+ libopts/compat/windows-config.h@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/compat/windows-config.h
+
+ libopts/compat/windows-config.h@1.0 +0 -0
+
+ libopts/configfile.c@1.1 +1288 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/configfile.c
+
+ libopts/configfile.c@1.0 +0 -0
+
+ libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/cook.c
+
+ libopts/cook.c@1.0 +0 -0
+
+ libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/enumeration.c
+
+ libopts/enumeration.c@1.0 +0 -0
+
+ libopts/environment.c@1.1 +260 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/environment.c
+
+ libopts/environment.c@1.0 +0 -0
+
+ libopts/genshell.c@1.1 +345 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/genshell.c
+
+ libopts/genshell.c@1.0 +0 -0
+
+ libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/genshell.h
+
+ libopts/genshell.h@1.0 +0 -0
+
+ libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/libopts.c
+
+ libopts/libopts.c@1.0 +0 -0
+
+ libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/load.c
+
+ libopts/load.c@1.0 +0 -0
+
+ libopts/m4/libopts.m4@1.1 +489 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/m4/libopts.m4
+
+ libopts/m4/libopts.m4@1.0 +0 -0
+
+ libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/m4/liboptschk.m4
+
+ libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/makeshell.c
+
+ libopts/makeshell.c@1.0 +0 -0
+
+ libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/nested.c
+
+ libopts/nested.c@1.0 +0 -0
+
+ libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/numeric.c
+
+ libopts/numeric.c@1.0 +0 -0
+
+ libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/pgusage.c
+
+ libopts/pgusage.c@1.0 +0 -0
+
+ libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/proto.h
+
+ libopts/proto.h@1.0 +0 -0
+
+ libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/putshell.c
+
+ libopts/putshell.c@1.0 +0 -0
+
+ libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/restore.c
+
+ libopts/restore.c@1.0 +0 -0
+
+ libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/save.c
+
+ libopts/save.c@1.0 +0 -0
+
+ libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/sort.c
+
+ libopts/sort.c@1.0 +0 -0
+
+ libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/stack.c
+
+ libopts/stack.c@1.0 +0 -0
+
+ libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/streqvcmp.c
+
+ libopts/streqvcmp.c@1.0 +0 -0
+
+ libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/text_mmap.c
+
+ libopts/text_mmap.c@1.0 +0 -0
+
+ libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/tokenize.c
+
+ libopts/tokenize.c@1.0 +0 -0
+
+ libopts/usage.c@1.1 +731 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/usage.c
+
+ libopts/usage.c@1.0 +0 -0
+
+ libopts/version.c@1.1 +176 -0
+ BitKeeper file /deacon/backroom/ntp-stable/libopts/version.c
+
+ libopts/version.c@1.0 +0 -0
+
+ sntp/libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/COPYING.lgpl
+
+ sntp/libopts/COPYING.lgpl@1.0 +0 -0
+
+ sntp/libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/COPYING.mbsd@1.0 +0 -0
+
+ sntp/libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/MakeDefs.inc@1.0 +0 -0
+
+ sntp/libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/Makefile.am
+
+ sntp/libopts/Makefile.am@1.0 +0 -0
+
+ sntp/libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/README
+
+ sntp/libopts/README@1.0 +0 -0
+
+ sntp/libopts/autoopts.c@1.1 +1101 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.c@1.0 +0 -0
+
+ sntp/libopts/autoopts.h@1.1 +377 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/options.h@1.1 +964 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/options.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ sntp/libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/boolean.c
+
+ sntp/libopts/boolean.c@1.0 +0 -0
+
+ sntp/libopts/compat/compat.h@1.1 +314 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/compat.h@1.0 +0 -0
+
+ sntp/libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/compat/pathfind.c@1.0 +0 -0
+
+ sntp/libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/snprintf.c@1.0 +0 -0
+
+ sntp/libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/strchr.c
+
+ sntp/libopts/compat/strchr.c@1.0 +0 -0
+
+ sntp/libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/strdup.c
+
+ sntp/libopts/compat/strdup.c@1.0 +0 -0
+
+ sntp/libopts/compat/windows-config.h@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/compat/windows-config.h
+
+ sntp/libopts/compat/windows-config.h@1.0 +0 -0
+
+ sntp/libopts/configfile.c@1.1 +1288 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/configfile.c
+
+ sntp/libopts/configfile.c@1.0 +0 -0
+
+ sntp/libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/cook.c
+
+ sntp/libopts/cook.c@1.0 +0 -0
+
+ sntp/libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/enumeration.c
+
+ sntp/libopts/enumeration.c@1.0 +0 -0
+
+ sntp/libopts/environment.c@1.1 +260 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/environment.c
+
+ sntp/libopts/environment.c@1.0 +0 -0
+
+ sntp/libopts/genshell.c@1.1 +345 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.c@1.0 +0 -0
+
+ sntp/libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/genshell.h
+
+ sntp/libopts/genshell.h@1.0 +0 -0
+
+ sntp/libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/libopts.c
+
+ sntp/libopts/libopts.c@1.0 +0 -0
+
+ sntp/libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/load.c
+
+ sntp/libopts/load.c@1.0 +0 -0
+
+ sntp/libopts/m4/libopts.m4@1.1 +489 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/m4/libopts.m4
+
+ sntp/libopts/m4/libopts.m4@1.0 +0 -0
+
+ sntp/libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/m4/liboptschk.m4
+
+ sntp/libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ sntp/libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/makeshell.c
+
+ sntp/libopts/makeshell.c@1.0 +0 -0
+
+ sntp/libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/nested.c
+
+ sntp/libopts/nested.c@1.0 +0 -0
+
+ sntp/libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/numeric.c
+
+ sntp/libopts/numeric.c@1.0 +0 -0
+
+ sntp/libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/pgusage.c
+
+ sntp/libopts/pgusage.c@1.0 +0 -0
+
+ sntp/libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/proto.h
+
+ sntp/libopts/proto.h@1.0 +0 -0
+
+ sntp/libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/putshell.c
+
+ sntp/libopts/putshell.c@1.0 +0 -0
+
+ sntp/libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/restore.c
+
+ sntp/libopts/restore.c@1.0 +0 -0
+
+ sntp/libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/save.c
+
+ sntp/libopts/save.c@1.0 +0 -0
+
+ sntp/libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/sort.c
+
+ sntp/libopts/sort.c@1.0 +0 -0
+
+ sntp/libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/stack.c
+
+ sntp/libopts/stack.c@1.0 +0 -0
+
+ sntp/libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/streqvcmp.c
+
+ sntp/libopts/streqvcmp.c@1.0 +0 -0
+
+ sntp/libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/text_mmap.c
+
+ sntp/libopts/text_mmap.c@1.0 +0 -0
+
+ sntp/libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/tokenize.c
+
+ sntp/libopts/tokenize.c@1.0 +0 -0
+
+ sntp/libopts/usage.c@1.1 +731 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/usage.c
+
+ sntp/libopts/usage.c@1.0 +0 -0
+
+ sntp/libopts/version.c@1.1 +176 -0
+ BitKeeper file /deacon/backroom/ntp-stable/sntp/libopts/version.c
+
+ sntp/libopts/version.c@1.0 +0 -0
+
+ChangeSet@1.1440.1.79, 2007-04-13 07:42:22-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P22
+ TAG: NTP_4_2_5P22
+
+ ntpd/ntpd-opts.c@1.9 +2 -2
+ NTP_4_2_5P22
+
+ ntpd/ntpd-opts.h@1.9 +3 -3
+ NTP_4_2_5P22
+
+ ntpd/ntpd-opts.texi@1.8 +1 -1
+ NTP_4_2_5P22
+
+ ntpd/ntpd.1@1.8 +2 -2
+ NTP_4_2_5P22
+
+ ntpd/ntpdsim-opts.c@1.9 +2 -2
+ NTP_4_2_5P22
+
+ ntpd/ntpdsim-opts.h@1.9 +3 -3
+ NTP_4_2_5P22
+
+ ntpd/ntpdsim-opts.texi@1.8 +1 -1
+ NTP_4_2_5P22
+
+ ntpd/ntpdsim.1@1.8 +2 -2
+ NTP_4_2_5P22
+
+ ntpdc/ntpdc-opts.c@1.9 +2 -2
+ NTP_4_2_5P22
+
+ ntpdc/ntpdc-opts.h@1.9 +3 -3
+ NTP_4_2_5P22
+
+ ntpdc/ntpdc-opts.texi@1.8 +1 -1
+ NTP_4_2_5P22
+
+ ntpdc/ntpdc.1@1.8 +2 -2
+ NTP_4_2_5P22
+
+ ntpq/ntpq-opts.c@1.9 +2 -2
+ NTP_4_2_5P22
+
+ ntpq/ntpq-opts.h@1.9 +3 -3
+ NTP_4_2_5P22
+
+ ntpq/ntpq-opts.texi@1.8 +1 -1
+ NTP_4_2_5P22
+
+ ntpq/ntpq.1@1.8 +2 -2
+ NTP_4_2_5P22
+
+ packageinfo.sh@1.25 +1 -1
+ NTP_4_2_5P22
+
+ sntp/sntp-opts.c@1.9 +2 -2
+ NTP_4_2_5P22
+
+ sntp/sntp-opts.h@1.9 +3 -3
+ NTP_4_2_5P22
+
+ sntp/sntp-opts.texi@1.8 +1 -1
+ NTP_4_2_5P22
+
+ sntp/sntp.1@1.8 +2 -2
+ NTP_4_2_5P22
+
+ util/ntp-keygen-opts.c@1.10 +2 -2
+ NTP_4_2_5P22
+
+ util/ntp-keygen-opts.h@1.10 +3 -3
+ NTP_4_2_5P22
+
+ util/ntp-keygen-opts.texi@1.9 +2 -2
+ NTP_4_2_5P22
+
+ util/ntp-keygen.1@1.9 +2 -2
+ NTP_4_2_5P22
+
+ChangeSet@1.1440.1.78, 2007-04-13 03:57:20-04:00, stenn@whimsy.udel.edu
+ refclock_wwv.c fixes from Dave Mills
+
+ ChangeLog@1.26 +1 -0
+ refclock_wwv.c fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.71 +9 -7
+ refclock_wwv.c fixes from Dave Mills
+
+ChangeSet@1.1440.1.77, 2007-04-13 02:10:55-04:00, stenn@whimsy.udel.edu
+ [Bug 810] Fix ntp-keygen documentation
+
+ ChangeLog@1.25 +1 -0
+ [Bug 810] Fix ntp-keygen documentation
+
+ util/ntp-keygen-opts.c@1.9 +1 -1
+ [Bug 810] Fix ntp-keygen documentation
+
+ util/ntp-keygen-opts.def@1.7 +37 -20
+ [Bug 810] Fix ntp-keygen documentation
+
+ util/ntp-keygen-opts.h@1.9 +1 -1
+ [Bug 810] Fix ntp-keygen documentation
+
+ util/ntp-keygen-opts.texi@1.8 +39 -19
+ [Bug 810] Fix ntp-keygen documentation
+
+ util/ntp-keygen.1@1.8 +39 -19
+ [Bug 810] Fix ntp-keygen documentation
+
+ChangeSet@1.1440.1.76, 2007-04-12 08:20:16-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P21
+ TAG: NTP_4_2_5P21
+
+ ntpd/ntpd-opts.c@1.8 +4 -4
+ NTP_4_2_5P21
+
+ ntpd/ntpd-opts.h@1.8 +3 -3
+ NTP_4_2_5P21
+
+ ntpd/ntpd-opts.texi@1.7 +2 -2
+ NTP_4_2_5P21
+
+ ntpd/ntpd.1@1.7 +2 -2
+ NTP_4_2_5P21
+
+ ntpd/ntpdsim-opts.c@1.8 +4 -4
+ NTP_4_2_5P21
+
+ ntpd/ntpdsim-opts.h@1.8 +3 -3
+ NTP_4_2_5P21
+
+ ntpd/ntpdsim-opts.texi@1.7 +1 -1
+ NTP_4_2_5P21
+
+ ntpd/ntpdsim.1@1.7 +2 -2
+ NTP_4_2_5P21
+
+ ntpdc/ntpdc-opts.c@1.8 +4 -4
+ NTP_4_2_5P21
+
+ ntpdc/ntpdc-opts.h@1.8 +3 -3
+ NTP_4_2_5P21
+
+ ntpdc/ntpdc-opts.texi@1.7 +2 -2
+ NTP_4_2_5P21
+
+ ntpdc/ntpdc.1@1.7 +2 -2
+ NTP_4_2_5P21
+
+ ntpq/ntpq-opts.c@1.8 +4 -4
+ NTP_4_2_5P21
+
+ ntpq/ntpq-opts.h@1.8 +3 -3
+ NTP_4_2_5P21
+
+ ntpq/ntpq-opts.texi@1.7 +2 -2
+ NTP_4_2_5P21
+
+ ntpq/ntpq.1@1.7 +2 -2
+ NTP_4_2_5P21
+
+ packageinfo.sh@1.24 +1 -1
+ NTP_4_2_5P21
+
+ sntp/sntp-opts.c@1.8 +2 -2
+ NTP_4_2_5P21
+
+ sntp/sntp-opts.h@1.8 +3 -3
+ NTP_4_2_5P21
+
+ sntp/sntp-opts.texi@1.7 +1 -1
+ NTP_4_2_5P21
+
+ sntp/sntp.1@1.7 +2 -2
+ NTP_4_2_5P21
+
+ util/ntp-keygen-opts.c@1.8 +4 -4
+ NTP_4_2_5P21
+
+ util/ntp-keygen-opts.h@1.8 +3 -3
+ NTP_4_2_5P21
+
+ util/ntp-keygen-opts.texi@1.7 +2 -2
+ NTP_4_2_5P21
+
+ util/ntp-keygen.1@1.7 +2 -2
+ NTP_4_2_5P21
+
+ChangeSet@1.1436.1.37, 2007-04-12 06:32:19-04:00, stenn@whimsy.udel.edu
+ Added ntp2 mirror
+
+ BitKeeper/triggers/2mirrors@1.4 +1 -0
+ Added ntp2 mirror
+
+ChangeSet@1.1440.1.74, 2007-04-12 05:47:01-04:00, stenn@whimsy.udel.edu
+ autogen upgrade
+
+ BitKeeper/deleted/.del-COPYING.lgpl@1.3 +0 -0
+ Delete: libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.lgpl~54a90ba0899593cb@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd@1.2 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYING.mbsd~9b1945bb2136c70b@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc@1.2 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-MakeDefs.inc~2b8fdfc9df6d652d@1.2 +0 -0
+ Delete: sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am@1.7 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~fa9bd87b6045015c@1.5 +0 -0
+ Delete: sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README@1.2 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-README~1ae087758ee867d4@1.2 +0 -0
+ Delete: sntp/libopts/README
+
+ BitKeeper/deleted/.del-autoopts.c@1.11 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.c~5b417341bc85d7a8@1.8 +0 -0
+ Delete: sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h@1.10 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-autoopts.h~8cdce21b181a1a01@1.8 +0 -0
+ Delete: sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c@1.9 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-boolean.c~a5d10c8997e6a2e2@1.6 +0 -0
+ Delete: sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h@1.13 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-compat.h~9682d0ac273ae32@1.9 +0 -0
+ Delete: sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c@1.11 +0 -0
+ Delete: libopts/configfile.c
+
+ BitKeeper/deleted/.del-configfile.c~8194f784686fa804@1.8 +0 -0
+ Delete: sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-cook.c@1.10 +0 -0
+ Delete: libopts/cook.c
+
+ BitKeeper/deleted/.del-cook.c~e48d079a438432dc@1.7 +0 -0
+ Delete: sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-enumeration.c@1.10 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-enumeration.c~5f4e6af2706370ae@1.7 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c@1.9 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-environment.c~2bae2966695067c2@1.6 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c@1.10 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.c~1fd152b2b52bdab@1.7 +0 -0
+ Delete: sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h@1.10 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-genshell.h~375f0fa5b925f454@1.7 +0 -0
+ Delete: sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c@1.4 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.c~58b8fbed850e6d5e@1.4 +0 -0
+ Delete: sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4@1.15 +0 -0
+ Delete: libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~9e0f33f57d3a0a9@1.12 +0 -0
+ Delete: sntp/libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4@1.4 +0 -0
+ Delete: libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-liboptschk.m4~bbeebebe76865058@1.4 +0 -0
+ Delete: sntp/libopts/m4/liboptschk.m4
+
+ BitKeeper/deleted/.del-libtool.m4@1.2 +0 -0
+ Delete: libopts/m4/libtool.m4
+
+ BitKeeper/deleted/.del-libtool.m4~db8acbd0fb34597f@1.2 +0 -0
+ Delete: sntp/libopts/m4/libtool.m4
+
+ BitKeeper/deleted/.del-load.c@1.11 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-load.c~59960aa12bb95bf7@1.8 +0 -0
+ Delete: sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c@1.12 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-makeshell.c~4fcd12fc31c0a4a4@1.9 +0 -0
+ Delete: sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c@1.10 +0 -0
+ Delete: libopts/nested.c
+
+ BitKeeper/deleted/.del-nested.c~85346d5d12098689@1.7 +0 -0
+ Delete: sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c@1.10 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-numeric.c~cdb7deb5cf6f27c2@1.7 +0 -0
+ Delete: sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h@1.11 +0 -0
+ Delete: libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-options.h~6eb465cb95a56bee@1.8 +0 -0
+ Delete: sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c@1.10 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pathfind.c~a0863179d884d4a4@1.7 +0 -0
+ Delete: sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c@1.10 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-pgusage.c~d981c42eb301cfdd@1.6 +0 -0
+ Delete: sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h@1.12 +0 -0
+ Delete: libopts/proto.h
+
+ BitKeeper/deleted/.del-proto.h~fa076f6dd9d0667e@1.9 +0 -0
+ Delete: sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c@1.11 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-putshell.c~24959f5e1ba688e6@1.8 +0 -0
+ Delete: sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c@1.10 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-restore.c~eada4acbf21cd8bf@1.6 +0 -0
+ Delete: sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c@1.11 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-save.c~a29f5bd429a568bb@1.8 +0 -0
+ Delete: sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c@1.5 +0 -0
+ Delete: libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-snprintf.c~66578c716014cd3d@1.4 +0 -0
+ Delete: sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sort.c@1.9 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-sort.c~bec5a7fb6a01a5dc@1.5 +0 -0
+ Delete: sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c@1.11 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-stack.c~e817b57b18b315c1@1.8 +0 -0
+ Delete: sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-strchr.c@1.4 +0 -0
+ Delete: libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strchr.c~80e88afbe7e2209a@1.4 +0 -0
+ Delete: sntp/libopts/compat/strchr.c
+
+ BitKeeper/deleted/.del-strdup.c@1.4 +0 -0
+ Delete: libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-strdup.c~1f262be5e55c3c4a@1.3 +0 -0
+ Delete: sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c@1.10 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~66420c6082b06827@1.7 +0 -0
+ Delete: sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c@1.9 +0 -0
+ Delete: libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-text_mmap.c~f1915a52b87816ba@1.6 +0 -0
+ Delete: sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-tokenize.c@1.6 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.c~ae2f23dbb2bee589@1.5 +0 -0
+ Delete: sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h@1.10 +0 -0
+ Delete: libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage-txt.h~6ce4dce87430d1b@1.7 +0 -0
+ Delete: sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c@1.10 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-usage.c~c868ef1e661a6eb1@1.8 +0 -0
+ Delete: sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c@1.10 +0 -0
+ Delete: libopts/version.c
+
+ BitKeeper/deleted/.del-version.c~a426e6b58b20d06@1.7 +0 -0
+ Delete: sntp/libopts/version.c
+
+ BitKeeper/deleted/.del-windows-config.h@1.6 +0 -0
+ Delete: libopts/compat/windows-config.h
+
+ BitKeeper/deleted/.del-windows-config.h~36f7ad2ccf764ad2@1.4 +0 -0
+ Delete: sntp/libopts/compat/windows-config.h
+
+ clockstuff/clktest-opts.c@1.10 +8 -7
+ autogen upgrade
+
+ clockstuff/clktest-opts.h@1.10 +8 -14
+ autogen upgrade
+
+ libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.lgpl
+
+ libopts/COPYING.lgpl@1.0 +0 -0
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/COPYING.mbsd
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+
+ libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/MakeDefs.inc
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+
+ libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/Makefile.am
+
+ libopts/Makefile.am@1.0 +0 -0
+
+ libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/README
+
+ libopts/README@1.0 +0 -0
+
+ libopts/autoopts.c@1.1 +1101 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.c
+
+ libopts/autoopts.c@1.0 +0 -0
+
+ libopts/autoopts.h@1.1 +377 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts.h
+
+ libopts/autoopts.h@1.0 +0 -0
+
+ libopts/autoopts/options.h@1.1 +964 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/options.h
+
+ libopts/autoopts/options.h@1.0 +0 -0
+
+ libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/autoopts/usage-txt.h
+
+ libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/boolean.c
+
+ libopts/boolean.c@1.0 +0 -0
+
+ libopts/compat/compat.h@1.1 +314 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/compat.h
+
+ libopts/compat/compat.h@1.0 +0 -0
+
+ libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/pathfind.c
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+
+ libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/snprintf.c
+
+ libopts/compat/snprintf.c@1.0 +0 -0
+
+ libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c
+
+ libopts/compat/strchr.c@1.0 +0 -0
+
+ libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strdup.c
+
+ libopts/compat/strdup.c@1.0 +0 -0
+
+ libopts/compat/windows-config.h@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h
+
+ libopts/compat/windows-config.h@1.0 +0 -0
+
+ libopts/configfile.c@1.1 +1288 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/configfile.c
+
+ libopts/configfile.c@1.0 +0 -0
+
+ libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/cook.c
+
+ libopts/cook.c@1.0 +0 -0
+
+ libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/enumeration.c
+
+ libopts/enumeration.c@1.0 +0 -0
+
+ libopts/environment.c@1.1 +260 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/environment.c
+
+ libopts/environment.c@1.0 +0 -0
+
+ libopts/genshell.c@1.1 +345 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.c
+
+ libopts/genshell.c@1.0 +0 -0
+
+ libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/genshell.h
+
+ libopts/genshell.h@1.0 +0 -0
+
+ libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/libopts.c
+
+ libopts/libopts.c@1.0 +0 -0
+
+ libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/load.c
+
+ libopts/load.c@1.0 +0 -0
+
+ libopts/m4/libopts.m4@1.1 +489 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libopts.m4
+
+ libopts/m4/libopts.m4@1.0 +0 -0
+
+ libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/liboptschk.m4
+
+ libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/makeshell.c
+
+ libopts/makeshell.c@1.0 +0 -0
+
+ libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/nested.c
+
+ libopts/nested.c@1.0 +0 -0
+
+ libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/numeric.c
+
+ libopts/numeric.c@1.0 +0 -0
+
+ libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/pgusage.c
+
+ libopts/pgusage.c@1.0 +0 -0
+
+ libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/proto.h
+
+ libopts/proto.h@1.0 +0 -0
+
+ libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/putshell.c
+
+ libopts/putshell.c@1.0 +0 -0
+
+ libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/restore.c
+
+ libopts/restore.c@1.0 +0 -0
+
+ libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/save.c
+
+ libopts/save.c@1.0 +0 -0
+
+ libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/sort.c
+
+ libopts/sort.c@1.0 +0 -0
+
+ libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/stack.c
+
+ libopts/stack.c@1.0 +0 -0
+
+ libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/streqvcmp.c
+
+ libopts/streqvcmp.c@1.0 +0 -0
+
+ libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/text_mmap.c
+
+ libopts/text_mmap.c@1.0 +0 -0
+
+ libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/tokenize.c
+
+ libopts/tokenize.c@1.0 +0 -0
+
+ libopts/usage.c@1.1 +731 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/usage.c
+
+ libopts/usage.c@1.0 +0 -0
+
+ libopts/version.c@1.1 +176 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/version.c
+
+ libopts/version.c@1.0 +0 -0
+
+ ntpd/ntpd-opts.c@1.7 +9 -8
+ autogen upgrade
+
+ ntpd/ntpd-opts.h@1.7 +6 -12
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.c@1.7 +9 -8
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.h@1.7 +6 -12
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.c@1.7 +9 -8
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.h@1.7 +6 -12
+ autogen upgrade
+
+ ntpq/ntpq-opts.c@1.7 +9 -8
+ autogen upgrade
+
+ ntpq/ntpq-opts.h@1.7 +6 -12
+ autogen upgrade
+
+ sntp/libopts/COPYING.lgpl@1.1 +502 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.lgpl
+
+ sntp/libopts/COPYING.lgpl@1.0 +0 -0
+
+ sntp/libopts/COPYING.mbsd@1.1 +26 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/COPYING.mbsd@1.0 +0 -0
+
+ sntp/libopts/MakeDefs.inc@1.1 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/MakeDefs.inc@1.0 +0 -0
+
+ sntp/libopts/Makefile.am@1.1 +24 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/Makefile.am
+
+ sntp/libopts/Makefile.am@1.0 +0 -0
+
+ sntp/libopts/README@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/README
+
+ sntp/libopts/README@1.0 +0 -0
+
+ sntp/libopts/autoopts.c@1.1 +1101 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.c@1.0 +0 -0
+
+ sntp/libopts/autoopts.h@1.1 +377 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/options.h@1.1 +964 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/options.h@1.0 +0 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.1 +355 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+
+ sntp/libopts/boolean.c@1.1 +106 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/boolean.c
+
+ sntp/libopts/boolean.c@1.0 +0 -0
+
+ sntp/libopts/compat/compat.h@1.1 +314 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/compat.h@1.0 +0 -0
+
+ sntp/libopts/compat/pathfind.c@1.1 +339 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/compat/pathfind.c@1.0 +0 -0
+
+ sntp/libopts/compat/snprintf.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/snprintf.c@1.0 +0 -0
+
+ sntp/libopts/compat/strchr.c@1.1 +60 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c
+
+ sntp/libopts/compat/strchr.c@1.0 +0 -0
+
+ sntp/libopts/compat/strdup.c@1.1 +19 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strdup.c
+
+ sntp/libopts/compat/strdup.c@1.0 +0 -0
+
+ sntp/libopts/compat/windows-config.h@1.1 +129 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h
+
+ sntp/libopts/compat/windows-config.h@1.0 +0 -0
+
+ sntp/libopts/configfile.c@1.1 +1288 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/configfile.c
+
+ sntp/libopts/configfile.c@1.0 +0 -0
+
+ sntp/libopts/cook.c@1.1 +354 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/cook.c
+
+ sntp/libopts/cook.c@1.0 +0 -0
+
+ sntp/libopts/enumeration.c@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/enumeration.c
+
+ sntp/libopts/enumeration.c@1.0 +0 -0
+
+ sntp/libopts/environment.c@1.1 +260 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/environment.c
+
+ sntp/libopts/environment.c@1.0 +0 -0
+
+ sntp/libopts/genshell.c@1.1 +345 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.c@1.0 +0 -0
+
+ sntp/libopts/genshell.h@1.1 +149 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/genshell.h
+
+ sntp/libopts/genshell.h@1.0 +0 -0
+
+ sntp/libopts/libopts.c@1.1 +30 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/libopts.c
+
+ sntp/libopts/libopts.c@1.0 +0 -0
+
+ sntp/libopts/load.c@1.1 +563 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/load.c
+
+ sntp/libopts/load.c@1.0 +0 -0
+
+ sntp/libopts/m4/libopts.m4@1.1 +489 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libopts.m4
+
+ sntp/libopts/m4/libopts.m4@1.0 +0 -0
+
+ sntp/libopts/m4/liboptschk.m4@1.1 +42 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/liboptschk.m4
+
+ sntp/libopts/m4/liboptschk.m4@1.0 +0 -0
+
+ sntp/libopts/makeshell.c@1.1 +1122 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/makeshell.c
+
+ sntp/libopts/makeshell.c@1.0 +0 -0
+
+ sntp/libopts/nested.c@1.1 +733 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/nested.c
+
+ sntp/libopts/nested.c@1.0 +0 -0
+
+ sntp/libopts/numeric.c@1.1 +93 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/numeric.c
+
+ sntp/libopts/numeric.c@1.0 +0 -0
+
+ sntp/libopts/pgusage.c@1.1 +157 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/pgusage.c
+
+ sntp/libopts/pgusage.c@1.0 +0 -0
+
+ sntp/libopts/proto.h@1.1 +91 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/proto.h
+
+ sntp/libopts/proto.h@1.0 +0 -0
+
+ sntp/libopts/putshell.c@1.1 +335 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/putshell.c
+
+ sntp/libopts/putshell.c@1.0 +0 -0
+
+ sntp/libopts/restore.c@1.1 +250 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/restore.c
+
+ sntp/libopts/restore.c@1.0 +0 -0
+
+ sntp/libopts/save.c@1.1 +512 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/save.c
+
+ sntp/libopts/save.c@1.0 +0 -0
+
+ sntp/libopts/sort.c@1.1 +359 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/sort.c
+
+ sntp/libopts/sort.c@1.0 +0 -0
+
+ sntp/libopts/stack.c@1.1 +269 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/stack.c
+
+ sntp/libopts/stack.c@1.0 +0 -0
+
+ sntp/libopts/streqvcmp.c@1.1 +289 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/streqvcmp.c
+
+ sntp/libopts/streqvcmp.c@1.0 +0 -0
+
+ sntp/libopts/text_mmap.c@1.1 +363 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/text_mmap.c
+
+ sntp/libopts/text_mmap.c@1.0 +0 -0
+
+ sntp/libopts/tokenize.c@1.1 +321 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/tokenize.c
+
+ sntp/libopts/tokenize.c@1.0 +0 -0
+
+ sntp/libopts/usage.c@1.1 +731 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/usage.c
+
+ sntp/libopts/usage.c@1.0 +0 -0
+
+ sntp/libopts/version.c@1.1 +176 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/version.c
+
+ sntp/libopts/version.c@1.0 +0 -0
+
+ sntp/sntp-opts.c@1.7 +7 -6
+ autogen upgrade
+
+ sntp/sntp-opts.h@1.7 +6 -12
+ autogen upgrade
+
+ util/ntp-keygen-opts.c@1.7 +9 -8
+ autogen upgrade
+
+ util/ntp-keygen-opts.h@1.7 +6 -12
+ autogen upgrade
+
+ChangeSet@1.1440.1.73, 2007-03-26 06:42:22-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P20
+ TAG: NTP_4_2_5P20
+
+ ntpd/ntpd-opts.c@1.6 +2 -2
+ NTP_4_2_5P20
+
+ ntpd/ntpd-opts.h@1.6 +3 -3
+ NTP_4_2_5P20
+
+ ntpd/ntpd-opts.texi@1.6 +1 -1
+ NTP_4_2_5P20
+
+ ntpd/ntpd.1@1.6 +2 -2
+ NTP_4_2_5P20
+
+ ntpd/ntpdsim-opts.c@1.6 +2 -2
+ NTP_4_2_5P20
+
+ ntpd/ntpdsim-opts.h@1.6 +3 -3
+ NTP_4_2_5P20
+
+ ntpd/ntpdsim-opts.texi@1.6 +1 -1
+ NTP_4_2_5P20
+
+ ntpd/ntpdsim.1@1.6 +2 -2
+ NTP_4_2_5P20
+
+ ntpdc/ntpdc-opts.c@1.6 +2 -2
+ NTP_4_2_5P20
+
+ ntpdc/ntpdc-opts.h@1.6 +3 -3
+ NTP_4_2_5P20
+
+ ntpdc/ntpdc-opts.texi@1.6 +1 -1
+ NTP_4_2_5P20
+
+ ntpdc/ntpdc.1@1.6 +2 -2
+ NTP_4_2_5P20
+
+ ntpq/ntpq-opts.c@1.6 +2 -2
+ NTP_4_2_5P20
+
+ ntpq/ntpq-opts.h@1.6 +3 -3
+ NTP_4_2_5P20
+
+ ntpq/ntpq-opts.texi@1.6 +1 -1
+ NTP_4_2_5P20
+
+ ntpq/ntpq.1@1.6 +2 -2
+ NTP_4_2_5P20
+
+ packageinfo.sh@1.23 +1 -1
+ NTP_4_2_5P20
+
+ sntp/sntp-opts.c@1.6 +2 -2
+ NTP_4_2_5P20
+
+ sntp/sntp-opts.h@1.6 +3 -3
+ NTP_4_2_5P20
+
+ sntp/sntp-opts.texi@1.6 +1 -1
+ NTP_4_2_5P20
+
+ sntp/sntp.1@1.6 +2 -2
+ NTP_4_2_5P20
+
+ util/ntp-keygen-opts.c@1.6 +2 -2
+ NTP_4_2_5P20
+
+ util/ntp-keygen-opts.h@1.6 +3 -3
+ NTP_4_2_5P20
+
+ util/ntp-keygen-opts.texi@1.6 +1 -1
+ NTP_4_2_5P20
+
+ util/ntp-keygen.1@1.6 +2 -2
+ NTP_4_2_5P20
+
+ChangeSet@1.1440.4.6, 2007-03-25 21:27:11+00:00, kardel@pogo.udel.edu
+ ChangeLog:
+ document fix for [Bug 789]
+
+ ChangeLog@1.22.1.1 +2 -1
+ document fix for [Bug 789]
+
+ChangeSet@1.1440.1.71, 2007-03-25 16:56:03-04:00, stenn@pogo.udel.edu
+ [Bug 787] Bug fixes for 64-bit time_t on Windows
+
+ ChangeLog@1.23 +1 -0
+ [Bug 787] Bug fixes for 64-bit time_t on Windows
+
+ChangeSet@1.1440.4.5, 2007-03-25 20:07:31+00:00, kardel@pogo.udel.edu
+ ntp_peer.c:
+ [Bug 789] avoid broadcast/multicast client associations
+ getting confused when multicast packets arrive
+ during the autokey/delay dance
+
+ ntpd/ntp_peer.c@1.101 +15 -3
+ [Bug 789] avoid peers getting confused when multicast packets arrive
+ during the autokey/delay dance
+
+ChangeSet@1.1440.4.4, 2007-03-20 06:42:12-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P19
+ TAG: NTP_4_2_5P19
+
+ ntpd/ntpd-opts.c@1.5 +2 -2
+ NTP_4_2_5P19
+
+ ntpd/ntpd-opts.h@1.5 +3 -3
+ NTP_4_2_5P19
+
+ ntpd/ntpd-opts.texi@1.5 +1 -1
+ NTP_4_2_5P19
+
+ ntpd/ntpd.1@1.5 +2 -2
+ NTP_4_2_5P19
+
+ ntpd/ntpdsim-opts.c@1.5 +2 -2
+ NTP_4_2_5P19
+
+ ntpd/ntpdsim-opts.h@1.5 +3 -3
+ NTP_4_2_5P19
+
+ ntpd/ntpdsim-opts.texi@1.5 +1 -1
+ NTP_4_2_5P19
+
+ ntpd/ntpdsim.1@1.5 +2 -2
+ NTP_4_2_5P19
+
+ ntpdc/ntpdc-opts.c@1.5 +2 -2
+ NTP_4_2_5P19
+
+ ntpdc/ntpdc-opts.h@1.5 +3 -3
+ NTP_4_2_5P19
+
+ ntpdc/ntpdc-opts.texi@1.5 +1 -1
+ NTP_4_2_5P19
+
+ ntpdc/ntpdc.1@1.5 +2 -2
+ NTP_4_2_5P19
+
+ ntpq/ntpq-opts.c@1.5 +2 -2
+ NTP_4_2_5P19
+
+ ntpq/ntpq-opts.h@1.5 +3 -3
+ NTP_4_2_5P19
+
+ ntpq/ntpq-opts.texi@1.5 +1 -1
+ NTP_4_2_5P19
+
+ ntpq/ntpq.1@1.5 +2 -2
+ NTP_4_2_5P19
+
+ packageinfo.sh@1.22 +1 -1
+ NTP_4_2_5P19
+
+ sntp/sntp-opts.c@1.5 +2 -2
+ NTP_4_2_5P19
+
+ sntp/sntp-opts.h@1.5 +3 -3
+ NTP_4_2_5P19
+
+ sntp/sntp-opts.texi@1.5 +1 -1
+ NTP_4_2_5P19
+
+ sntp/sntp.1@1.5 +2 -2
+ NTP_4_2_5P19
+
+ util/ntp-keygen-opts.c@1.5 +2 -2
+ NTP_4_2_5P19
+
+ util/ntp-keygen-opts.h@1.5 +3 -3
+ NTP_4_2_5P19
+
+ util/ntp-keygen-opts.texi@1.5 +1 -1
+ NTP_4_2_5P19
+
+ util/ntp-keygen.1@1.5 +2 -2
+ NTP_4_2_5P19
+
+ChangeSet@1.1440.4.3, 2007-03-20 02:19:52-05:00, stenn@whimsy.udel.edu
+ Clean up some \\n's on error messages
+
+ ntpd/ntpd.c@1.83.1.2 +2 -2
+ Clean up some \\n's on error messages
+
+ChangeSet@1.1440.4.2, 2007-03-20 01:00:23-05:00, stenn@whimsy.udel.edu
+ [Bug 796] Clean up duplicate #defines in ntp_control.c
+
+ ChangeLog@1.22 +1 -0
+ [Bug 796] Clean up duplicate #defines in ntp_control.c
+
+ ntpd/ntp_control.c@1.89.1.1 +4 -9
+ [Bug 796] Clean up duplicate #defines in ntp_control.c
+
+ChangeSet@1.1440.4.1, 2007-03-18 06:47:40-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P18
+ TAG: NTP_4_2_5P18
+
+ ntpd/ntpd-opts.c@1.4 +2 -2
+ NTP_4_2_5P18
+
+ ntpd/ntpd-opts.h@1.4 +3 -3
+ NTP_4_2_5P18
+
+ ntpd/ntpd-opts.texi@1.4 +1 -1
+ NTP_4_2_5P18
+
+ ntpd/ntpd.1@1.4 +2 -2
+ NTP_4_2_5P18
+
+ ntpd/ntpdsim-opts.c@1.4 +2 -2
+ NTP_4_2_5P18
+
+ ntpd/ntpdsim-opts.h@1.4 +3 -3
+ NTP_4_2_5P18
+
+ ntpd/ntpdsim-opts.texi@1.4 +1 -1
+ NTP_4_2_5P18
+
+ ntpd/ntpdsim.1@1.4 +2 -2
+ NTP_4_2_5P18
+
+ ntpdc/ntpdc-opts.c@1.4 +2 -2
+ NTP_4_2_5P18
+
+ ntpdc/ntpdc-opts.h@1.4 +3 -3
+ NTP_4_2_5P18
+
+ ntpdc/ntpdc-opts.texi@1.4 +1 -1
+ NTP_4_2_5P18
+
+ ntpdc/ntpdc.1@1.4 +2 -2
+ NTP_4_2_5P18
+
+ ntpq/ntpq-opts.c@1.4 +2 -2
+ NTP_4_2_5P18
+
+ ntpq/ntpq-opts.h@1.4 +3 -3
+ NTP_4_2_5P18
+
+ ntpq/ntpq-opts.texi@1.4 +1 -1
+ NTP_4_2_5P18
+
+ ntpq/ntpq.1@1.4 +2 -2
+ NTP_4_2_5P18
+
+ packageinfo.sh@1.21 +1 -1
+ NTP_4_2_5P18
+
+ sntp/sntp-opts.c@1.4 +2 -2
+ NTP_4_2_5P18
+
+ sntp/sntp-opts.h@1.4 +3 -3
+ NTP_4_2_5P18
+
+ sntp/sntp-opts.texi@1.4 +1 -1
+ NTP_4_2_5P18
+
+ sntp/sntp.1@1.4 +2 -2
+ NTP_4_2_5P18
+
+ util/ntp-keygen-opts.c@1.4 +2 -2
+ NTP_4_2_5P18
+
+ util/ntp-keygen-opts.h@1.4 +3 -3
+ NTP_4_2_5P18
+
+ util/ntp-keygen-opts.texi@1.4 +1 -1
+ NTP_4_2_5P18
+
+ util/ntp-keygen.1@1.4 +2 -2
+ NTP_4_2_5P18
+
+ChangeSet@1.1410.1.1, 2007-03-18 02:35:16-04:00, mayer@pogo.udel.edu
+ Bug #787 Bug fixes for 64-bit time_t on Windows
+
+ ports/winnt/include/config.h@1.47 +25 -7
+ Bug #787 Bug fixes for 64-bit time_t on Windows
+
+ ports/winnt/include/ntp_timer.h@1.3.1.1 +2 -2
+ Bug #787 Bug fixes for 64-bit time_t on Windows
+
+ ports/winnt/libntp/SetSystemTime.c@1.4 +2 -2
+ Bug #787 Bug fixes for 64-bit time_t on Windows
+
+ChangeSet@1.1440.1.67, 2007-03-17 19:35:08-05:00, stenn@whimsy.udel.edu
+ [Bug 569] Use the correct precision for the Leitch CSD-5300
+
+ ChangeLog@1.21 +1 -0
+ [Bug 569] Use the correct precision for the Leitch CSD-5300
+
+ ntpd/refclock_leitch.c@1.10 +2 -1
+ [Bug 569] Use the correct precision for the Leitch CSD-5300
+
+ChangeSet@1.1440.1.66, 2007-03-17 15:19:52-05:00, stenn@whimsy.udel.edu
+ [Bug 798] ntpq [p typo crashes ntpdc
+
+ ChangeLog@1.20 +1 -1
+ [Bug 798] ntpq [p typo crashes ntpdc
+
+ ntpdc/ntpdc.c@1.56 +8 -4
+ [Bug 798] ntpq [p typo crashes ntpdc
+
+ChangeSet@1.1440.1.65, 2007-03-17 06:43:30-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P17
+ TAG: NTP_4_2_5P17
+
+ ntpd/ntpd-opts.c@1.3 +2 -2
+ NTP_4_2_5P17
+
+ ntpd/ntpd-opts.h@1.3 +3 -3
+ NTP_4_2_5P17
+
+ ntpd/ntpd-opts.texi@1.3 +1 -1
+ NTP_4_2_5P17
+
+ ntpd/ntpd.1@1.3 +2 -2
+ NTP_4_2_5P17
+
+ ntpd/ntpdsim-opts.c@1.3 +2 -2
+ NTP_4_2_5P17
+
+ ntpd/ntpdsim-opts.h@1.3 +3 -3
+ NTP_4_2_5P17
+
+ ntpd/ntpdsim-opts.texi@1.3 +1 -1
+ NTP_4_2_5P17
+
+ ntpd/ntpdsim.1@1.3 +2 -2
+ NTP_4_2_5P17
+
+ ntpdc/ntpdc-opts.c@1.3 +2 -2
+ NTP_4_2_5P17
+
+ ntpdc/ntpdc-opts.h@1.3 +3 -3
+ NTP_4_2_5P17
+
+ ntpdc/ntpdc-opts.texi@1.3 +1 -1
+ NTP_4_2_5P17
+
+ ntpdc/ntpdc.1@1.3 +2 -2
+ NTP_4_2_5P17
+
+ ntpq/ntpq-opts.c@1.3 +2 -2
+ NTP_4_2_5P17
+
+ ntpq/ntpq-opts.h@1.3 +3 -3
+ NTP_4_2_5P17
+
+ ntpq/ntpq-opts.texi@1.3 +1 -1
+ NTP_4_2_5P17
+
+ ntpq/ntpq.1@1.3 +2 -2
+ NTP_4_2_5P17
+
+ packageinfo.sh@1.20 +1 -1
+ NTP_4_2_5P17
+
+ sntp/sntp-opts.c@1.3 +2 -2
+ NTP_4_2_5P17
+
+ sntp/sntp-opts.h@1.3 +3 -3
+ NTP_4_2_5P17
+
+ sntp/sntp-opts.texi@1.3 +1 -1
+ NTP_4_2_5P17
+
+ sntp/sntp.1@1.3 +2 -2
+ NTP_4_2_5P17
+
+ util/ntp-keygen-opts.c@1.3 +2 -2
+ NTP_4_2_5P17
+
+ util/ntp-keygen-opts.h@1.3 +3 -3
+ NTP_4_2_5P17
+
+ util/ntp-keygen-opts.texi@1.3 +1 -1
+ NTP_4_2_5P17
+
+ util/ntp-keygen.1@1.3 +2 -2
+ NTP_4_2_5P17
+
+ChangeSet@1.1440.1.64, 2007-03-17 06:54:45-04:00, stenn@pogo.udel.edu
+ [Bug 795] Moved declaration of variable to top of function
+
+ ChangeLog@1.19 +1 -0
+ [Bug 795] Moved declaration of variable to top of function
+
+ChangeSet@1.1440.3.1, 2007-03-17 04:53:50-05:00, stenn@whimsy.udel.edu
+ [Bug 798] ntpq [p typo crashes ntpq
+
+ ChangeLog@1.18 +1 -0
+ [Bug 798] ntpq [p typo crashes ntpq
+
+ ntpq/ntpq.c@1.66.1.1 +8 -4
+ [Bug 798] ntpq [p typo crashes ntpq
+
+ChangeSet@1.1440.1.62, 2007-03-12 09:06:55+00:00, burnicki@pogo.udel.edu
+ [Bug 795] Moved declaration of variable to top of function to avoid build error.
+
+ ntpd/ntp_io.c@1.245.1.4 +4 -1
+ Moved declaration of variable to top of function to avoid build error.
+
+ChangeSet@1.1436.1.36, 2007-03-07 06:46:09-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P0
+ TAG: NTP_4_2_4P0
+
+ ntpd/ntpd-opts.c@1.50.1.6 +2 -2
+ NTP_4_2_4P0
+
+ ntpd/ntpd-opts.h@1.50.1.6 +3 -3
+ NTP_4_2_4P0
+
+ ntpd/ntpd-opts.texi@1.49.1.6 +1 -1
+ NTP_4_2_4P0
+
+ ntpd/ntpd.1@1.48.1.6 +2 -2
+ NTP_4_2_4P0
+
+ ntpd/ntpdsim-opts.c@1.50.1.6 +2 -2
+ NTP_4_2_4P0
+
+ ntpd/ntpdsim-opts.h@1.50.1.6 +3 -3
+ NTP_4_2_4P0
+
+ ntpd/ntpdsim-opts.texi@1.48.1.6 +1 -1
+ NTP_4_2_4P0
+
+ ntpd/ntpdsim.1@1.48.1.6 +2 -2
+ NTP_4_2_4P0
+
+ ntpdc/ntpdc-opts.c@1.50.1.6 +2 -2
+ NTP_4_2_4P0
+
+ ntpdc/ntpdc-opts.h@1.50.1.6 +3 -3
+ NTP_4_2_4P0
+
+ ntpdc/ntpdc-opts.texi@1.48.1.6 +1 -1
+ NTP_4_2_4P0
+
+ ntpdc/ntpdc.1@1.48.1.6 +2 -2
+ NTP_4_2_4P0
+
+ ntpq/ntpq-opts.c@1.52.1.6 +2 -2
+ NTP_4_2_4P0
+
+ ntpq/ntpq-opts.h@1.52.1.6 +3 -3
+ NTP_4_2_4P0
+
+ ntpq/ntpq-opts.texi@1.49.1.6 +1 -1
+ NTP_4_2_4P0
+
+ ntpq/ntpq.1@1.48.1.6 +2 -2
+ NTP_4_2_4P0
+
+ packageinfo.sh@1.65.7.2 +2 -2
+ NTP_4_2_4P0
+
+ sntp/sntp-opts.c@1.49.1.6 +2 -2
+ NTP_4_2_4P0
+
+ sntp/sntp-opts.h@1.49.1.6 +3 -3
+ NTP_4_2_4P0
+
+ sntp/sntp-opts.texi@1.46.1.6 +1 -1
+ NTP_4_2_4P0
+
+ sntp/sntp.1@1.49.1.6 +2 -2
+ NTP_4_2_4P0
+
+ util/ntp-keygen-opts.c@1.49.1.6 +2 -2
+ NTP_4_2_4P0
+
+ util/ntp-keygen-opts.h@1.49.1.6 +3 -3
+ NTP_4_2_4P0
+
+ util/ntp-keygen-opts.texi@1.47.1.6 +1 -1
+ NTP_4_2_4P0
+
+ util/ntp-keygen.1@1.47.1.6 +2 -2
+ NTP_4_2_4P0
+
+ChangeSet@1.1436.1.35, 2007-03-07 00:53:31-05:00, stenn@whimsy.udel.edu
+ time to release
+
+ packageinfo.sh@1.65.7.1 +3 -1
+ time to release
+
+ChangeSet@1.1440.1.61, 2007-03-04 07:33:47-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P16
+ TAG: NTP_4_2_5P16
+
+ ntpd/ntpd-opts.c@1.2 +2 -2
+ NTP_4_2_5P16
+
+ ntpd/ntpd-opts.h@1.2 +3 -3
+ NTP_4_2_5P16
+
+ ntpd/ntpd-opts.texi@1.2 +1 -1
+ NTP_4_2_5P16
+
+ ntpd/ntpd.1@1.2 +2 -2
+ NTP_4_2_5P16
+
+ ntpd/ntpdsim-opts.c@1.2 +2 -2
+ NTP_4_2_5P16
+
+ ntpd/ntpdsim-opts.h@1.2 +3 -3
+ NTP_4_2_5P16
+
+ ntpd/ntpdsim-opts.texi@1.2 +1 -1
+ NTP_4_2_5P16
+
+ ntpd/ntpdsim.1@1.2 +2 -2
+ NTP_4_2_5P16
+
+ ntpdc/ntpdc-opts.c@1.2 +2 -2
+ NTP_4_2_5P16
+
+ ntpdc/ntpdc-opts.h@1.2 +3 -3
+ NTP_4_2_5P16
+
+ ntpdc/ntpdc-opts.texi@1.2 +1 -1
+ NTP_4_2_5P16
+
+ ntpdc/ntpdc.1@1.2 +2 -2
+ NTP_4_2_5P16
+
+ ntpq/ntpq-opts.c@1.2 +2 -2
+ NTP_4_2_5P16
+
+ ntpq/ntpq-opts.h@1.2 +3 -3
+ NTP_4_2_5P16
+
+ ntpq/ntpq-opts.texi@1.2 +1 -1
+ NTP_4_2_5P16
+
+ ntpq/ntpq.1@1.2 +2 -2
+ NTP_4_2_5P16
+
+ packageinfo.sh@1.19 +1 -1
+ NTP_4_2_5P16
+
+ sntp/sntp-opts.c@1.2 +2 -2
+ NTP_4_2_5P16
+
+ sntp/sntp-opts.h@1.2 +3 -3
+ NTP_4_2_5P16
+
+ sntp/sntp-opts.texi@1.2 +1 -1
+ NTP_4_2_5P16
+
+ sntp/sntp.1@1.2 +2 -2
+ NTP_4_2_5P16
+
+ util/ntp-keygen-opts.c@1.2 +2 -2
+ NTP_4_2_5P16
+
+ util/ntp-keygen-opts.h@1.2 +3 -3
+ NTP_4_2_5P16
+
+ util/ntp-keygen-opts.texi@1.2 +1 -1
+ NTP_4_2_5P16
+
+ util/ntp-keygen.1@1.2 +2 -2
+ NTP_4_2_5P16
+
+ChangeSet@1.1440.1.60, 2007-03-03 22:41:27-05:00, stenn@whimsy.udel.edu
+ .point-changed-filelist items are distinct between -stable and -dev.
+
+ BitKeeper/deleted/.del-ntp-keygen-opts.c@1.71 +0 -0
+ Delete: util/ntp-keygen-opts.c
+
+ BitKeeper/deleted/.del-ntp-keygen-opts.h@1.71 +0 -0
+ Delete: util/ntp-keygen-opts.h
+
+ BitKeeper/deleted/.del-ntp-keygen-opts.texi@1.69 +0 -0
+ Delete: util/ntp-keygen-opts.texi
+
+ BitKeeper/deleted/.del-ntp-keygen.1@1.69 +0 -0
+ Delete: util/ntp-keygen.1
+
+ BitKeeper/deleted/.del-ntpd-opts.c@1.72 +0 -0
+ Delete: ntpd/ntpd-opts.c
+
+ BitKeeper/deleted/.del-ntpd-opts.h@1.72 +0 -0
+ Delete: ntpd/ntpd-opts.h
+
+ BitKeeper/deleted/.del-ntpd-opts.texi@1.71 +0 -0
+ Delete: ntpd/ntpd-opts.texi
+
+ BitKeeper/deleted/.del-ntpd.1@1.70 +0 -0
+ Delete: ntpd/ntpd.1
+
+ BitKeeper/deleted/.del-ntpdc-opts.c@1.72 +0 -0
+ Delete: ntpdc/ntpdc-opts.c
+
+ BitKeeper/deleted/.del-ntpdc-opts.h@1.72 +0 -0
+ Delete: ntpdc/ntpdc-opts.h
+
+ BitKeeper/deleted/.del-ntpdc-opts.texi@1.70 +0 -0
+ Delete: ntpdc/ntpdc-opts.texi
+
+ BitKeeper/deleted/.del-ntpdc.1@1.70 +0 -0
+ Delete: ntpdc/ntpdc.1
+
+ BitKeeper/deleted/.del-ntpdsim-opts.c@1.72 +0 -0
+ Delete: ntpd/ntpdsim-opts.c
+
+ BitKeeper/deleted/.del-ntpdsim-opts.h@1.72 +0 -0
+ Delete: ntpd/ntpdsim-opts.h
+
+ BitKeeper/deleted/.del-ntpdsim-opts.texi@1.70 +0 -0
+ Delete: ntpd/ntpdsim-opts.texi
+
+ BitKeeper/deleted/.del-ntpdsim.1@1.70 +0 -0
+ Delete: ntpd/ntpdsim.1
+
+ BitKeeper/deleted/.del-ntpq-opts.c@1.74 +0 -0
+ Delete: ntpq/ntpq-opts.c
+
+ BitKeeper/deleted/.del-ntpq-opts.h@1.74 +0 -0
+ Delete: ntpq/ntpq-opts.h
+
+ BitKeeper/deleted/.del-ntpq-opts.texi@1.71 +0 -0
+ Delete: ntpq/ntpq-opts.texi
+
+ BitKeeper/deleted/.del-ntpq.1@1.70 +0 -0
+ Delete: ntpq/ntpq.1
+
+ BitKeeper/deleted/.del-sntp-opts.c@1.71 +0 -0
+ Delete: sntp/sntp-opts.c
+
+ BitKeeper/deleted/.del-sntp-opts.h@1.71 +0 -0
+ Delete: sntp/sntp-opts.h
+
+ BitKeeper/deleted/.del-sntp-opts.texi@1.68 +0 -0
+ Delete: sntp/sntp-opts.texi
+
+ BitKeeper/deleted/.del-sntp.1@1.71 +0 -0
+ Delete: sntp/sntp.1
+
+ ntpd/ntpd-opts.c@1.1 +1055 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd-opts.c
+
+ ntpd/ntpd-opts.c@1.0 +0 -0
+
+ ntpd/ntpd-opts.h@1.1 +366 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd-opts.h
+
+ ntpd/ntpd-opts.h@1.0 +0 -0
+
+ ntpd/ntpd-opts.texi@1.1 +498 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd-opts.texi
+
+ ntpd/ntpd-opts.texi@1.0 +0 -0
+
+ ntpd/ntpd.1@1.1 +312 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpd.1
+
+ ntpd/ntpd.1@1.0 +0 -0
+
+ ntpd/ntpdsim-opts.c@1.1 +1253 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim-opts.c
+
+ ntpd/ntpdsim-opts.c@1.0 +0 -0
+
+ ntpd/ntpdsim-opts.h@1.1 +429 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim-opts.h
+
+ ntpd/ntpdsim-opts.h@1.0 +0 -0
+
+ ntpd/ntpdsim-opts.texi@1.1 +510 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim-opts.texi
+
+ ntpd/ntpdsim-opts.texi@1.0 +0 -0
+
+ ntpd/ntpdsim.1@1.1 +357 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ntpdsim.1
+
+ ntpd/ntpdsim.1@1.0 +0 -0
+
+ ntpdc/ntpdc-opts.c@1.1 +658 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc-opts.c
+
+ ntpdc/ntpdc-opts.c@1.0 +0 -0
+
+ ntpdc/ntpdc-opts.h@1.1 +229 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc-opts.h
+
+ ntpdc/ntpdc-opts.h@1.0 +0 -0
+
+ ntpdc/ntpdc-opts.texi@1.1 +276 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc-opts.texi
+
+ ntpdc/ntpdc-opts.texi@1.0 +0 -0
+
+ ntpdc/ntpdc.1@1.1 +158 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpdc/ntpdc.1
+
+ ntpdc/ntpdc.1@1.0 +0 -0
+
+ ntpq/ntpq-opts.c@1.1 +598 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq-opts.c
+
+ ntpq/ntpq-opts.c@1.0 +0 -0
+
+ ntpq/ntpq-opts.h@1.1 +215 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq-opts.h
+
+ ntpq/ntpq-opts.h@1.0 +0 -0
+
+ ntpq/ntpq-opts.texi@1.1 +216 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq-opts.texi
+
+ ntpq/ntpq-opts.texi@1.0 +0 -0
+
+ ntpq/ntpq.1@1.1 +385 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpq/ntpq.1
+
+ ntpq/ntpq.1@1.0 +0 -0
+
+ sntp/sntp-opts.c@1.1 +682 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp-opts.c
+
+ sntp/sntp-opts.c@1.0 +0 -0
+
+ sntp/sntp-opts.h@1.1 +290 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp-opts.h
+
+ sntp/sntp-opts.h@1.0 +0 -0
+
+ sntp/sntp-opts.texi@1.1 +174 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp-opts.texi
+
+ sntp/sntp-opts.texi@1.0 +0 -0
+
+ sntp/sntp.1@1.1 +400 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/sntp.1
+
+ sntp/sntp.1@1.0 +0 -0
+
+ util/ntp-keygen-opts.c@1.1 +1035 -0
+ BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen-opts.c
+
+ util/ntp-keygen-opts.c@1.0 +0 -0
+
+ util/ntp-keygen-opts.h@1.1 +325 -0
+ BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen-opts.h
+
+ util/ntp-keygen-opts.h@1.0 +0 -0
+
+ util/ntp-keygen-opts.texi@1.1 +366 -0
+ BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen-opts.texi
+
+ util/ntp-keygen-opts.texi@1.0 +0 -0
+
+ util/ntp-keygen.1@1.1 +176 -0
+ BitKeeper file /deacon/backroom/ntp-dev/util/ntp-keygen.1
+
+ util/ntp-keygen.1@1.0 +0 -0
+
+ChangeSet@1.1436.1.34, 2007-03-03 19:21:29-05:00, stenn@whimsy.udel.edu
+ [Bug 793] Update Hans Lambermont's email address in ntpsweep
+
+ ChangeLog@1.1.1.9 +1 -0
+ [Bug 793] Update Hans Lambermont's email address in ntpsweep
+
+ scripts/ntpsweep.in@1.3 +1 -2
+ [Bug 793] Update Hans Lambermont's email address in ntpsweep
+
+ChangeSet@1.1440.1.58, 2007-03-03 06:43:50-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P15
+ TAG: NTP_4_2_5P15
+
+ ntpd/ntpd-opts.c@1.70 +2 -2
+ NTP_4_2_5P15
+
+ ntpd/ntpd-opts.h@1.70 +3 -3
+ NTP_4_2_5P15
+
+ ntpd/ntpd-opts.texi@1.69 +1 -1
+ NTP_4_2_5P15
+
+ ntpd/ntpd.1@1.68 +2 -2
+ NTP_4_2_5P15
+
+ ntpd/ntpdsim-opts.c@1.70 +2 -2
+ NTP_4_2_5P15
+
+ ntpd/ntpdsim-opts.h@1.70 +3 -3
+ NTP_4_2_5P15
+
+ ntpd/ntpdsim-opts.texi@1.68 +1 -1
+ NTP_4_2_5P15
+
+ ntpd/ntpdsim.1@1.68 +2 -2
+ NTP_4_2_5P15
+
+ ntpdc/ntpdc-opts.c@1.70 +2 -2
+ NTP_4_2_5P15
+
+ ntpdc/ntpdc-opts.h@1.70 +3 -3
+ NTP_4_2_5P15
+
+ ntpdc/ntpdc-opts.texi@1.68 +1 -1
+ NTP_4_2_5P15
+
+ ntpdc/ntpdc.1@1.68 +2 -2
+ NTP_4_2_5P15
+
+ ntpq/ntpq-opts.c@1.72 +2 -2
+ NTP_4_2_5P15
+
+ ntpq/ntpq-opts.h@1.72 +3 -3
+ NTP_4_2_5P15
+
+ ntpq/ntpq-opts.texi@1.69 +1 -1
+ NTP_4_2_5P15
+
+ ntpq/ntpq.1@1.68 +2 -2
+ NTP_4_2_5P15
+
+ packageinfo.sh@1.18 +1 -1
+ NTP_4_2_5P15
+
+ sntp/sntp-opts.c@1.69 +2 -2
+ NTP_4_2_5P15
+
+ sntp/sntp-opts.h@1.69 +3 -3
+ NTP_4_2_5P15
+
+ sntp/sntp-opts.texi@1.66 +1 -1
+ NTP_4_2_5P15
+
+ sntp/sntp.1@1.69 +2 -2
+ NTP_4_2_5P15
+
+ util/ntp-keygen-opts.c@1.69 +2 -2
+ NTP_4_2_5P15
+
+ util/ntp-keygen-opts.h@1.69 +3 -3
+ NTP_4_2_5P15
+
+ util/ntp-keygen-opts.texi@1.67 +1 -1
+ NTP_4_2_5P15
+
+ util/ntp-keygen.1@1.67 +2 -2
+ NTP_4_2_5P15
+
+ChangeSet@1.1440.1.57, 2007-03-03 01:16:11-05:00, stenn@whimsy.udel.edu
+ [Bug 786] Fix refclock_bancomm.c on Solaris
+
+ ChangeLog@1.16 +1 -0
+ [Bug 786] Fix refclock_bancomm.c on Solaris
+
+ChangeSet@1.1440.1.56, 2007-03-01 10:16:30-05:00, neal@pogo.udel.edu
+ refclock_bancomm.c:
+ [BUG 786] - add Solaris 10 support
+
+ ntpd/refclock_bancomm.c@1.10 +97 -17
+ [BUG 786] - add Solaris 10 support
+
+ChangeSet@1.1440.1.55, 2007-02-26 06:42:31-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P14
+ TAG: NTP_4_2_5P14
+
+ ntpd/ntpd-opts.c@1.69 +2 -2
+ NTP_4_2_5P14
+
+ ntpd/ntpd-opts.h@1.69 +3 -3
+ NTP_4_2_5P14
+
+ ntpd/ntpd-opts.texi@1.68 +1 -1
+ NTP_4_2_5P14
+
+ ntpd/ntpd.1@1.67 +2 -2
+ NTP_4_2_5P14
+
+ ntpd/ntpdsim-opts.c@1.69 +2 -2
+ NTP_4_2_5P14
+
+ ntpd/ntpdsim-opts.h@1.69 +3 -3
+ NTP_4_2_5P14
+
+ ntpd/ntpdsim-opts.texi@1.67 +1 -1
+ NTP_4_2_5P14
+
+ ntpd/ntpdsim.1@1.67 +2 -2
+ NTP_4_2_5P14
+
+ ntpdc/ntpdc-opts.c@1.69 +2 -2
+ NTP_4_2_5P14
+
+ ntpdc/ntpdc-opts.h@1.69 +3 -3
+ NTP_4_2_5P14
+
+ ntpdc/ntpdc-opts.texi@1.67 +1 -1
+ NTP_4_2_5P14
+
+ ntpdc/ntpdc.1@1.67 +2 -2
+ NTP_4_2_5P14
+
+ ntpq/ntpq-opts.c@1.71 +2 -2
+ NTP_4_2_5P14
+
+ ntpq/ntpq-opts.h@1.71 +3 -3
+ NTP_4_2_5P14
+
+ ntpq/ntpq-opts.texi@1.68 +1 -1
+ NTP_4_2_5P14
+
+ ntpq/ntpq.1@1.67 +2 -2
+ NTP_4_2_5P14
+
+ packageinfo.sh@1.17 +1 -1
+ NTP_4_2_5P14
+
+ sntp/sntp-opts.c@1.68 +2 -2
+ NTP_4_2_5P14
+
+ sntp/sntp-opts.h@1.68 +3 -3
+ NTP_4_2_5P14
+
+ sntp/sntp-opts.texi@1.65 +1 -1
+ NTP_4_2_5P14
+
+ sntp/sntp.1@1.68 +2 -2
+ NTP_4_2_5P14
+
+ util/ntp-keygen-opts.c@1.68 +2 -2
+ NTP_4_2_5P14
+
+ util/ntp-keygen-opts.h@1.68 +3 -3
+ NTP_4_2_5P14
+
+ util/ntp-keygen-opts.texi@1.66 +1 -1
+ NTP_4_2_5P14
+
+ util/ntp-keygen.1@1.66 +2 -2
+ NTP_4_2_5P14
+
+ChangeSet@1.1440.1.54, 2007-02-25 18:42:26-05:00, stenn@whimsy.udel.edu
+ [Bug 789] Fix multicast client crypto authentication
+
+ ChangeLog@1.15 +1 -0
+ [Bug 789] Fix multicast client crypto authentication
+
+ChangeSet@1.1440.1.53, 2007-02-25 17:21:59+00:00, kardel@pogo.udel.edu
+ ntp_peer.c:
+ Bug 789:
+ insure that crypto information is only cleared when the local address
+ changes. fixes multicast client mode
+
+ ntpd/ntp_peer.c@1.100 +10 -13
+ Bug 789:
+ insure that crypto information is only cleared when the local address
+ changes. fixes multicast client mode
+
+ChangeSet@1.1440.1.52, 2007-02-25 06:42:44-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P13
+ TAG: NTP_4_2_5P13
+
+ ntpd/ntpd-opts.c@1.68 +2 -2
+ NTP_4_2_5P13
+
+ ntpd/ntpd-opts.h@1.68 +3 -3
+ NTP_4_2_5P13
+
+ ntpd/ntpd-opts.texi@1.67 +1 -1
+ NTP_4_2_5P13
+
+ ntpd/ntpd.1@1.66 +2 -2
+ NTP_4_2_5P13
+
+ ntpd/ntpdsim-opts.c@1.68 +2 -2
+ NTP_4_2_5P13
+
+ ntpd/ntpdsim-opts.h@1.68 +3 -3
+ NTP_4_2_5P13
+
+ ntpd/ntpdsim-opts.texi@1.66 +1 -1
+ NTP_4_2_5P13
+
+ ntpd/ntpdsim.1@1.66 +2 -2
+ NTP_4_2_5P13
+
+ ntpdc/ntpdc-opts.c@1.68 +2 -2
+ NTP_4_2_5P13
+
+ ntpdc/ntpdc-opts.h@1.68 +3 -3
+ NTP_4_2_5P13
+
+ ntpdc/ntpdc-opts.texi@1.66 +1 -1
+ NTP_4_2_5P13
+
+ ntpdc/ntpdc.1@1.66 +2 -2
+ NTP_4_2_5P13
+
+ ntpq/ntpq-opts.c@1.70 +2 -2
+ NTP_4_2_5P13
+
+ ntpq/ntpq-opts.h@1.70 +3 -3
+ NTP_4_2_5P13
+
+ ntpq/ntpq-opts.texi@1.67 +1 -1
+ NTP_4_2_5P13
+
+ ntpq/ntpq.1@1.66 +2 -2
+ NTP_4_2_5P13
+
+ packageinfo.sh@1.16 +1 -1
+ NTP_4_2_5P13
+
+ sntp/sntp-opts.c@1.67 +2 -2
+ NTP_4_2_5P13
+
+ sntp/sntp-opts.h@1.67 +3 -3
+ NTP_4_2_5P13
+
+ sntp/sntp-opts.texi@1.64 +1 -1
+ NTP_4_2_5P13
+
+ sntp/sntp.1@1.67 +2 -2
+ NTP_4_2_5P13
+
+ util/ntp-keygen-opts.c@1.67 +2 -2
+ NTP_4_2_5P13
+
+ util/ntp-keygen-opts.h@1.67 +3 -3
+ NTP_4_2_5P13
+
+ util/ntp-keygen-opts.texi@1.65 +1 -1
+ NTP_4_2_5P13
+
+ util/ntp-keygen.1@1.65 +2 -2
+ NTP_4_2_5P13
+
+ChangeSet@1.1440.1.51, 2007-02-25 00:21:52+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ bug 785:
+ improve handling of multicast interfaces
+ (multicast routers still need to run a multicast routing software/daemon)
+ ntp_peer.c:
+ clarify debug messages
+
+ ntpd/ntp_io.c@1.245.1.3 +84 -62
+ bug 785:
+ improve handling of multicast interfaces
+ (multicast routers still need to run a multicast routing software/daemon)
+
+ ntpd/ntp_peer.c@1.99 +2 -2
+ clarify debug messages
+
+ChangeSet@1.1440.1.50, 2007-02-24 08:33:25-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P12
+ TAG: NTP_4_2_5P12
+
+ ntpd/ntpd-opts.c@1.67 +2 -2
+ NTP_4_2_5P12
+
+ ntpd/ntpd-opts.h@1.67 +3 -3
+ NTP_4_2_5P12
+
+ ntpd/ntpd-opts.texi@1.66 +1 -1
+ NTP_4_2_5P12
+
+ ntpd/ntpd.1@1.65 +2 -2
+ NTP_4_2_5P12
+
+ ntpd/ntpdsim-opts.c@1.67 +2 -2
+ NTP_4_2_5P12
+
+ ntpd/ntpdsim-opts.h@1.67 +3 -3
+ NTP_4_2_5P12
+
+ ntpd/ntpdsim-opts.texi@1.65 +1 -1
+ NTP_4_2_5P12
+
+ ntpd/ntpdsim.1@1.65 +2 -2
+ NTP_4_2_5P12
+
+ ntpdc/ntpdc-opts.c@1.67 +2 -2
+ NTP_4_2_5P12
+
+ ntpdc/ntpdc-opts.h@1.67 +3 -3
+ NTP_4_2_5P12
+
+ ntpdc/ntpdc-opts.texi@1.65 +1 -1
+ NTP_4_2_5P12
+
+ ntpdc/ntpdc.1@1.65 +2 -2
+ NTP_4_2_5P12
+
+ ntpq/ntpq-opts.c@1.69 +2 -2
+ NTP_4_2_5P12
+
+ ntpq/ntpq-opts.h@1.69 +3 -3
+ NTP_4_2_5P12
+
+ ntpq/ntpq-opts.texi@1.66 +1 -1
+ NTP_4_2_5P12
+
+ ntpq/ntpq.1@1.65 +2 -2
+ NTP_4_2_5P12
+
+ packageinfo.sh@1.15 +1 -1
+ NTP_4_2_5P12
+
+ sntp/sntp-opts.c@1.66 +2 -2
+ NTP_4_2_5P12
+
+ sntp/sntp-opts.h@1.66 +3 -3
+ NTP_4_2_5P12
+
+ sntp/sntp-opts.texi@1.63 +1 -1
+ NTP_4_2_5P12
+
+ sntp/sntp.1@1.66 +2 -2
+ NTP_4_2_5P12
+
+ util/ntp-keygen-opts.c@1.66 +2 -2
+ NTP_4_2_5P12
+
+ util/ntp-keygen-opts.h@1.66 +3 -3
+ NTP_4_2_5P12
+
+ util/ntp-keygen-opts.texi@1.64 +1 -1
+ NTP_4_2_5P12
+
+ util/ntp-keygen.1@1.64 +2 -2
+ NTP_4_2_5P12
+
+ChangeSet@1.1436.1.33, 2007-02-24 06:42:26-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P0_RC5
+ TAG: NTP_4_2_4P0_RC5
+
+ ntpd/ntpd-opts.c@1.50.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ ntpd/ntpd-opts.h@1.50.1.5 +3 -3
+ NTP_4_2_4P0_RC5
+
+ ntpd/ntpd-opts.texi@1.49.1.5 +1 -1
+ NTP_4_2_4P0_RC5
+
+ ntpd/ntpd.1@1.48.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ ntpd/ntpdsim-opts.c@1.50.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ ntpd/ntpdsim-opts.h@1.50.1.5 +3 -3
+ NTP_4_2_4P0_RC5
+
+ ntpd/ntpdsim-opts.texi@1.48.1.5 +1 -1
+ NTP_4_2_4P0_RC5
+
+ ntpd/ntpdsim.1@1.48.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ ntpdc/ntpdc-opts.c@1.50.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ ntpdc/ntpdc-opts.h@1.50.1.5 +3 -3
+ NTP_4_2_4P0_RC5
+
+ ntpdc/ntpdc-opts.texi@1.48.1.5 +1 -1
+ NTP_4_2_4P0_RC5
+
+ ntpdc/ntpdc.1@1.48.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ ntpq/ntpq-opts.c@1.52.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ ntpq/ntpq-opts.h@1.52.1.5 +3 -3
+ NTP_4_2_4P0_RC5
+
+ ntpq/ntpq-opts.texi@1.49.1.5 +1 -1
+ NTP_4_2_4P0_RC5
+
+ ntpq/ntpq.1@1.48.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ packageinfo.sh@1.65.6.1 +1 -1
+ NTP_4_2_4P0_RC5
+
+ sntp/sntp-opts.c@1.49.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ sntp/sntp-opts.h@1.49.1.5 +3 -3
+ NTP_4_2_4P0_RC5
+
+ sntp/sntp-opts.texi@1.46.1.5 +1 -1
+ NTP_4_2_4P0_RC5
+
+ sntp/sntp.1@1.49.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ util/ntp-keygen-opts.c@1.49.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ util/ntp-keygen-opts.h@1.49.1.5 +3 -3
+ NTP_4_2_4P0_RC5
+
+ util/ntp-keygen-opts.texi@1.47.1.5 +1 -1
+ NTP_4_2_4P0_RC5
+
+ util/ntp-keygen.1@1.47.1.5 +2 -2
+ NTP_4_2_4P0_RC5
+
+ChangeSet@1.1440.1.49, 2007-02-24 05:24:04-05:00, stenn@whimsy.udel.edu
+ Updates to ntp_loopfilter.c from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.132 +2 -3
+ Updates to ntp_loopfilter.c from Dave Mills
+
+ChangeSet@1.1436.1.32, 2007-02-24 05:07:16-05:00, stenn@whimsy.udel.edu
+ [Bug 628] Fallback to ntp discipline not working for large offsets
+
+ ntpd/ntp_loopfilter.c@1.127.1.1 +9 -24
+ [Bug 628] Fallback to ntp discipline not working for large offsets
+
+ChangeSet@1.1440.1.47, 2007-02-23 06:42:48-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P11
+ TAG: NTP_4_2_5P11
+
+ ntpd/ntpd-opts.c@1.66 +2 -2
+ NTP_4_2_5P11
+
+ ntpd/ntpd-opts.h@1.66 +3 -3
+ NTP_4_2_5P11
+
+ ntpd/ntpd-opts.texi@1.65 +1 -1
+ NTP_4_2_5P11
+
+ ntpd/ntpd.1@1.64 +2 -2
+ NTP_4_2_5P11
+
+ ntpd/ntpdsim-opts.c@1.66 +2 -2
+ NTP_4_2_5P11
+
+ ntpd/ntpdsim-opts.h@1.66 +3 -3
+ NTP_4_2_5P11
+
+ ntpd/ntpdsim-opts.texi@1.64 +1 -1
+ NTP_4_2_5P11
+
+ ntpd/ntpdsim.1@1.64 +2 -2
+ NTP_4_2_5P11
+
+ ntpdc/ntpdc-opts.c@1.66 +2 -2
+ NTP_4_2_5P11
+
+ ntpdc/ntpdc-opts.h@1.66 +3 -3
+ NTP_4_2_5P11
+
+ ntpdc/ntpdc-opts.texi@1.64 +1 -1
+ NTP_4_2_5P11
+
+ ntpdc/ntpdc.1@1.64 +2 -2
+ NTP_4_2_5P11
+
+ ntpq/ntpq-opts.c@1.68 +2 -2
+ NTP_4_2_5P11
+
+ ntpq/ntpq-opts.h@1.68 +3 -3
+ NTP_4_2_5P11
+
+ ntpq/ntpq-opts.texi@1.65 +1 -1
+ NTP_4_2_5P11
+
+ ntpq/ntpq.1@1.64 +2 -2
+ NTP_4_2_5P11
+
+ packageinfo.sh@1.14 +1 -1
+ NTP_4_2_5P11
+
+ sntp/sntp-opts.c@1.65 +2 -2
+ NTP_4_2_5P11
+
+ sntp/sntp-opts.h@1.65 +3 -3
+ NTP_4_2_5P11
+
+ sntp/sntp-opts.texi@1.62 +1 -1
+ NTP_4_2_5P11
+
+ sntp/sntp.1@1.65 +2 -2
+ NTP_4_2_5P11
+
+ util/ntp-keygen-opts.c@1.65 +2 -2
+ NTP_4_2_5P11
+
+ util/ntp-keygen-opts.h@1.65 +3 -3
+ NTP_4_2_5P11
+
+ util/ntp-keygen-opts.texi@1.63 +1 -1
+ NTP_4_2_5P11
+
+ util/ntp-keygen.1@1.63 +2 -2
+ NTP_4_2_5P11
+
+ChangeSet@1.1440.1.46, 2007-02-23 03:16:58-05:00, stenn@whimsy.udel.edu
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ libparse/Makefile.am@1.11 +1 -1
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ChangeSet@1.1440.1.45, 2007-02-23 02:47:57-05:00, stenn@whimsy.udel.edu
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ ChangeLog@1.14 +1 -0
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ libparse/Makefile.am@1.10 +1 -1
+ [Bug 774] parsesolaris.c does not compile under the new Solaris
+
+ChangeSet@1.1440.1.44, 2007-02-22 06:46:29-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P10
+ TAG: NTP_4_2_5P10
+
+ ntpd/ntpd-opts.c@1.65 +2 -2
+ NTP_4_2_5P10
+
+ ntpd/ntpd-opts.h@1.65 +3 -3
+ NTP_4_2_5P10
+
+ ntpd/ntpd-opts.texi@1.64 +1 -1
+ NTP_4_2_5P10
+
+ ntpd/ntpd.1@1.63 +2 -2
+ NTP_4_2_5P10
+
+ ntpd/ntpdsim-opts.c@1.65 +2 -2
+ NTP_4_2_5P10
+
+ ntpd/ntpdsim-opts.h@1.65 +3 -3
+ NTP_4_2_5P10
+
+ ntpd/ntpdsim-opts.texi@1.63 +1 -1
+ NTP_4_2_5P10
+
+ ntpd/ntpdsim.1@1.63 +2 -2
+ NTP_4_2_5P10
+
+ ntpdc/ntpdc-opts.c@1.65 +2 -2
+ NTP_4_2_5P10
+
+ ntpdc/ntpdc-opts.h@1.65 +3 -3
+ NTP_4_2_5P10
+
+ ntpdc/ntpdc-opts.texi@1.63 +1 -1
+ NTP_4_2_5P10
+
+ ntpdc/ntpdc.1@1.63 +2 -2
+ NTP_4_2_5P10
+
+ ntpq/ntpq-opts.c@1.67 +2 -2
+ NTP_4_2_5P10
+
+ ntpq/ntpq-opts.h@1.67 +3 -3
+ NTP_4_2_5P10
+
+ ntpq/ntpq-opts.texi@1.64 +1 -1
+ NTP_4_2_5P10
+
+ ntpq/ntpq.1@1.63 +2 -2
+ NTP_4_2_5P10
+
+ packageinfo.sh@1.13 +1 -1
+ NTP_4_2_5P10
+
+ sntp/sntp-opts.c@1.64 +2 -2
+ NTP_4_2_5P10
+
+ sntp/sntp-opts.h@1.64 +3 -3
+ NTP_4_2_5P10
+
+ sntp/sntp-opts.texi@1.61 +1 -1
+ NTP_4_2_5P10
+
+ sntp/sntp.1@1.64 +2 -2
+ NTP_4_2_5P10
+
+ util/ntp-keygen-opts.c@1.64 +2 -2
+ NTP_4_2_5P10
+
+ util/ntp-keygen-opts.h@1.64 +3 -3
+ NTP_4_2_5P10
+
+ util/ntp-keygen-opts.texi@1.62 +1 -1
+ NTP_4_2_5P10
+
+ util/ntp-keygen.1@1.62 +2 -2
+ NTP_4_2_5P10
+
+ChangeSet@1.1436.1.31, 2007-02-21 15:16:15-05:00, stenn@whimsy.udel.edu
+ [Bug 776] Remove the obsolete r: from the getopt string in ntpdate
+
+ ntpdate/ntpdate.c@1.59.1.2 +1 -1
+ [Bug 776] Remove the obsolete r: from the getopt string in ntpdate
+
+ChangeSet@1.1440.1.42, 2007-02-19 08:43:35-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P9
+ TAG: NTP_4_2_5P9
+
+ ntpd/ntpd-opts.c@1.63 +2 -2
+ NTP_4_2_5P9
+
+ ntpd/ntpd-opts.h@1.63 +3 -3
+ NTP_4_2_5P9
+
+ ntpd/ntpd-opts.texi@1.62 +2 -2
+ NTP_4_2_5P9
+
+ ntpd/ntpd.1@1.61 +2 -2
+ NTP_4_2_5P9
+
+ ntpd/ntpdsim-opts.c@1.63 +2 -2
+ NTP_4_2_5P9
+
+ ntpd/ntpdsim-opts.h@1.63 +3 -3
+ NTP_4_2_5P9
+
+ ntpd/ntpdsim-opts.texi@1.61 +1 -1
+ NTP_4_2_5P9
+
+ ntpd/ntpdsim.1@1.61 +2 -2
+ NTP_4_2_5P9
+
+ ntpdc/ntpdc-opts.c@1.63 +2 -2
+ NTP_4_2_5P9
+
+ ntpdc/ntpdc-opts.h@1.63 +3 -3
+ NTP_4_2_5P9
+
+ ntpdc/ntpdc-opts.texi@1.61 +2 -2
+ NTP_4_2_5P9
+
+ ntpdc/ntpdc.1@1.61 +2 -2
+ NTP_4_2_5P9
+
+ ntpq/ntpq-opts.c@1.65 +2 -2
+ NTP_4_2_5P9
+
+ ntpq/ntpq-opts.h@1.65 +3 -3
+ NTP_4_2_5P9
+
+ ntpq/ntpq-opts.texi@1.62 +2 -2
+ NTP_4_2_5P9
+
+ ntpq/ntpq.1@1.61 +2 -2
+ NTP_4_2_5P9
+
+ packageinfo.sh@1.12 +1 -1
+ NTP_4_2_5P9
+
+ sntp/sntp-opts.c@1.62 +2 -2
+ NTP_4_2_5P9
+
+ sntp/sntp-opts.h@1.62 +3 -3
+ NTP_4_2_5P9
+
+ sntp/sntp-opts.texi@1.59 +1 -1
+ NTP_4_2_5P9
+
+ sntp/sntp.1@1.62 +2 -2
+ NTP_4_2_5P9
+
+ util/ntp-keygen-opts.c@1.62 +2 -2
+ NTP_4_2_5P9
+
+ util/ntp-keygen-opts.h@1.62 +3 -3
+ NTP_4_2_5P9
+
+ util/ntp-keygen-opts.texi@1.60 +2 -2
+ NTP_4_2_5P9
+
+ util/ntp-keygen.1@1.60 +2 -2
+ NTP_4_2_5P9
+
+ChangeSet@1.1436.1.30, 2007-02-19 06:46:30-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4P0_RC4
+ TAG: NTP_4_2_4P0_RC4
+
+ ntpd/ntpd-opts.c@1.50.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpd/ntpd-opts.h@1.50.1.4 +3 -3
+ NTP_4_2_4P0_RC4
+
+ ntpd/ntpd-opts.texi@1.49.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpd/ntpd.1@1.48.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpd/ntpdsim-opts.c@1.50.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpd/ntpdsim-opts.h@1.50.1.4 +3 -3
+ NTP_4_2_4P0_RC4
+
+ ntpd/ntpdsim-opts.texi@1.48.1.4 +1 -1
+ NTP_4_2_4P0_RC4
+
+ ntpd/ntpdsim.1@1.48.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpdc/ntpdc-opts.c@1.50.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpdc/ntpdc-opts.h@1.50.1.4 +3 -3
+ NTP_4_2_4P0_RC4
+
+ ntpdc/ntpdc-opts.texi@1.48.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpdc/ntpdc.1@1.48.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpq/ntpq-opts.c@1.52.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpq/ntpq-opts.h@1.52.1.4 +3 -3
+ NTP_4_2_4P0_RC4
+
+ ntpq/ntpq-opts.texi@1.49.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ ntpq/ntpq.1@1.48.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ packageinfo.sh@1.65.5.1 +3 -3
+ NTP_4_2_4P0_RC4
+
+ sntp/sntp-opts.c@1.49.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ sntp/sntp-opts.h@1.49.1.4 +3 -3
+ NTP_4_2_4P0_RC4
+
+ sntp/sntp-opts.texi@1.46.1.4 +1 -1
+ NTP_4_2_4P0_RC4
+
+ sntp/sntp.1@1.49.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ util/ntp-keygen-opts.c@1.49.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ util/ntp-keygen-opts.h@1.49.1.4 +3 -3
+ NTP_4_2_4P0_RC4
+
+ util/ntp-keygen-opts.texi@1.47.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ util/ntp-keygen.1@1.47.1.4 +2 -2
+ NTP_4_2_4P0_RC4
+
+ChangeSet@1.1440.1.41, 2007-02-19 05:26:33-05:00, stenn@whimsy.udel.edu
+ [Bug 782] Remove P() macros from Windows files
+
+ ChangeLog@1.13 +1 -0
+ [Bug 782] Remove P() macros from Windows files
+
+ ports/winnt/include/ntp_timer.h@1.4 +3 -5
+ [Bug 782] Remove P() macros from Windows files
+
+ ports/winnt/include/transmitbuff.h@1.6 +3 -3
+ [Bug 782] Remove P() macros from Windows files
+
+ ports/winnt/include/win32_io.h@1.8 +2 -2
+ [Bug 782] Remove P() macros from Windows files
+
+ChangeSet@1.1436.1.29, 2007-02-19 00:19:22-05:00, stenn@whimsy.udel.edu
+ Ready to go...
+
+ packageinfo.sh@1.65.4.2 +2 -2
+ Ready to go...
+
+ChangeSet@1.1436.1.28, 2007-02-19 00:14:29-05:00, stenn@whimsy.udel.edu
+ [Bug 776] Remove unimplemented "rate" flag from ntpdate
+
+ ChangeLog@1.1.1.8 +1 -0
+ [Bug 776] Remove unimplemented "rate" flag from ntpdate
+
+ ntpdate/Makefile.am@1.14.1.1 +1 -1
+ [Bug 776] Remove unimplemented "rate" flag from ntpdate
+
+ ntpdate/ntpdate.c@1.59.1.1 +1 -21
+ [Bug 776] Remove unimplemented "rate" flag from ntpdate
+
+ChangeSet@1.1440.1.39, 2007-02-17 06:42:34-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P8
+ TAG: NTP_4_2_5P8
+
+ ntpd/ntpd-opts.c@1.61 +2 -2
+ NTP_4_2_5P8
+
+ ntpd/ntpd-opts.h@1.61 +3 -3
+ NTP_4_2_5P8
+
+ ntpd/ntpd-opts.texi@1.60 +1 -1
+ NTP_4_2_5P8
+
+ ntpd/ntpd.1@1.59 +2 -2
+ NTP_4_2_5P8
+
+ ntpd/ntpdsim-opts.c@1.61 +2 -2
+ NTP_4_2_5P8
+
+ ntpd/ntpdsim-opts.h@1.61 +3 -3
+ NTP_4_2_5P8
+
+ ntpd/ntpdsim-opts.texi@1.59 +1 -1
+ NTP_4_2_5P8
+
+ ntpd/ntpdsim.1@1.59 +2 -2
+ NTP_4_2_5P8
+
+ ntpdc/ntpdc-opts.c@1.61 +2 -2
+ NTP_4_2_5P8
+
+ ntpdc/ntpdc-opts.h@1.61 +3 -3
+ NTP_4_2_5P8
+
+ ntpdc/ntpdc-opts.texi@1.59 +1 -1
+ NTP_4_2_5P8
+
+ ntpdc/ntpdc.1@1.59 +2 -2
+ NTP_4_2_5P8
+
+ ntpq/ntpq-opts.c@1.63 +2 -2
+ NTP_4_2_5P8
+
+ ntpq/ntpq-opts.h@1.63 +3 -3
+ NTP_4_2_5P8
+
+ ntpq/ntpq-opts.texi@1.60 +1 -1
+ NTP_4_2_5P8
+
+ ntpq/ntpq.1@1.59 +2 -2
+ NTP_4_2_5P8
+
+ packageinfo.sh@1.11 +1 -1
+ NTP_4_2_5P8
+
+ sntp/sntp-opts.c@1.60 +2 -2
+ NTP_4_2_5P8
+
+ sntp/sntp-opts.h@1.60 +3 -3
+ NTP_4_2_5P8
+
+ sntp/sntp-opts.texi@1.57 +1 -1
+ NTP_4_2_5P8
+
+ sntp/sntp.1@1.60 +2 -2
+ NTP_4_2_5P8
+
+ util/ntp-keygen-opts.c@1.60 +2 -2
+ NTP_4_2_5P8
+
+ util/ntp-keygen-opts.h@1.60 +3 -3
+ NTP_4_2_5P8
+
+ util/ntp-keygen-opts.texi@1.58 +1 -1
+ NTP_4_2_5P8
+
+ util/ntp-keygen.1@1.58 +2 -2
+ NTP_4_2_5P8
+
+ChangeSet@1.1440.1.38, 2007-02-17 04:40:04-05:00, stenn@whimsy.udel.edu
+ ntpd.h:
+ Lose the fabs() and sqrt() declarations because
+ they are in math.h and "lose" on some HP-UX machines.
+
+ include/ntpd.h@1.100 +0 -3
+ Lose the fabs() and sqrt() declarations because
+ they are in math.h and "lose" on some HP-UX machines.
+
+ChangeSet@1.1440.1.37, 2007-02-16 06:42:39-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P7
+ TAG: NTP_4_2_5P7
+
+ ntpd/ntpd-opts.c@1.60 +2 -2
+ NTP_4_2_5P7
+
+ ntpd/ntpd-opts.h@1.60 +3 -3
+ NTP_4_2_5P7
+
+ ntpd/ntpd-opts.texi@1.59 +1 -1
+ NTP_4_2_5P7
+
+ ntpd/ntpd.1@1.58 +2 -2
+ NTP_4_2_5P7
+
+ ntpd/ntpdsim-opts.c@1.60 +2 -2
+ NTP_4_2_5P7
+
+ ntpd/ntpdsim-opts.h@1.60 +3 -3
+ NTP_4_2_5P7
+
+ ntpd/ntpdsim-opts.texi@1.58 +1 -1
+ NTP_4_2_5P7
+
+ ntpd/ntpdsim.1@1.58 +2 -2
+ NTP_4_2_5P7
+
+ ntpdc/ntpdc-opts.c@1.60 +2 -2
+ NTP_4_2_5P7
+
+ ntpdc/ntpdc-opts.h@1.60 +3 -3
+ NTP_4_2_5P7
+
+ ntpdc/ntpdc-opts.texi@1.58 +1 -1
+ NTP_4_2_5P7
+
+ ntpdc/ntpdc.1@1.58 +2 -2
+ NTP_4_2_5P7
+
+ ntpq/ntpq-opts.c@1.62 +2 -2
+ NTP_4_2_5P7
+
+ ntpq/ntpq-opts.h@1.62 +3 -3
+ NTP_4_2_5P7
+
+ ntpq/ntpq-opts.texi@1.59 +1 -1
+ NTP_4_2_5P7
+
+ ntpq/ntpq.1@1.58 +2 -2
+ NTP_4_2_5P7
+
+ packageinfo.sh@1.10 +1 -1
+ NTP_4_2_5P7
+
+ sntp/sntp-opts.c@1.59 +2 -2
+ NTP_4_2_5P7
+
+ sntp/sntp-opts.h@1.59 +3 -3
+ NTP_4_2_5P7
+
+ sntp/sntp-opts.texi@1.56 +1 -1
+ NTP_4_2_5P7
+
+ sntp/sntp.1@1.59 +2 -2
+ NTP_4_2_5P7
+
+ util/ntp-keygen-opts.c@1.59 +2 -2
+ NTP_4_2_5P7
+
+ util/ntp-keygen-opts.h@1.59 +3 -3
+ NTP_4_2_5P7
+
+ util/ntp-keygen-opts.texi@1.57 +1 -1
+ NTP_4_2_5P7
+
+ util/ntp-keygen.1@1.57 +2 -2
+ NTP_4_2_5P7
+
+ChangeSet@1.1440.1.36, 2007-02-16 03:30:53-05:00, stenn@whimsy.udel.edu
+ [Bug 778] ntpd fails to lock with drift=+500 when started with drift=-500
+
+ ChangeLog@1.11 +2 -1
+ [Bug 778] ntpd fails to lock with drift=+500 when started with drift=-500
+
+ChangeSet@1.1440.1.35, 2007-02-16 03:24:28-05:00, stenn@whimsy.udel.edu
+ ntp_loopfilter.c:
+ Avoid setting the kernel freq if kernel mode is not disabled in the
+ config file and either the step threshold has been set to 0 or -x
+ has been given. (This is Harlan's interpretation of Dave's comment
+ #14 to bug 778: <https://ntp.isc.org/bugs/show_bug.cgi?id=778#c14>)
+ refclock_irig.c:
+ Change the max PLL time constant to 10 (Dave Mills)
+
+ ntpd/ntp_loopfilter.c@1.130 +5 -4
+ Avoid setting the kernel freq if kernel mode is not disabled in the
+ config file and either the step threshold has been set to 0 or -x
+ has been given. (This is Harlan's interpretation of Dave's comment
+ #14 to bug 778: <https://ntp.isc.org/bugs/show_bug.cgi?id=778#c14>)
+
+ ntpd/refclock_irig.c@1.30 +1 -1
+ Change the max PLL time constant to 10 (Dave Mills)
+
+ChangeSet@1.1440.1.34, 2007-02-05 08:45:44-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P6
+ TAG: NTP_4_2_5P6
+
+ ntpd/ntpd-opts.c@1.59 +2 -2
+ NTP_4_2_5P6
+
+ ntpd/ntpd-opts.h@1.59 +3 -3
+ NTP_4_2_5P6
+
+ ntpd/ntpd-opts.texi@1.58 +1 -1
+ NTP_4_2_5P6
+
+ ntpd/ntpd.1@1.57 +2 -2
+ NTP_4_2_5P6
+
+ ntpd/ntpdsim-opts.c@1.59 +2 -2
+ NTP_4_2_5P6
+
+ ntpd/ntpdsim-opts.h@1.59 +3 -3
+ NTP_4_2_5P6
+
+ ntpd/ntpdsim-opts.texi@1.57 +1 -1
+ NTP_4_2_5P6
+
+ ntpd/ntpdsim.1@1.57 +2 -2
+ NTP_4_2_5P6
+
+ ntpdc/ntpdc-opts.c@1.59 +2 -2
+ NTP_4_2_5P6
+
+ ntpdc/ntpdc-opts.h@1.59 +3 -3
+ NTP_4_2_5P6
+
+ ntpdc/ntpdc-opts.texi@1.57 +1 -1
+ NTP_4_2_5P6
+
+ ntpdc/ntpdc.1@1.57 +2 -2
+ NTP_4_2_5P6
+
+ ntpq/ntpq-opts.c@1.61 +2 -2
+ NTP_4_2_5P6
+
+ ntpq/ntpq-opts.h@1.61 +3 -3
+ NTP_4_2_5P6
+
+ ntpq/ntpq-opts.texi@1.58 +1 -1
+ NTP_4_2_5P6
+
+ ntpq/ntpq.1@1.57 +2 -2
+ NTP_4_2_5P6
+
+ packageinfo.sh@1.9 +1 -1
+ NTP_4_2_5P6
+
+ sntp/sntp-opts.c@1.58 +2 -2
+ NTP_4_2_5P6
+
+ sntp/sntp-opts.h@1.58 +3 -3
+ NTP_4_2_5P6
+
+ sntp/sntp-opts.texi@1.55 +1 -1
+ NTP_4_2_5P6
+
+ sntp/sntp.1@1.58 +2 -2
+ NTP_4_2_5P6
+
+ util/ntp-keygen-opts.c@1.58 +2 -2
+ NTP_4_2_5P6
+
+ util/ntp-keygen-opts.h@1.58 +3 -3
+ NTP_4_2_5P6
+
+ util/ntp-keygen-opts.texi@1.56 +1 -1
+ NTP_4_2_5P6
+
+ util/ntp-keygen.1@1.56 +2 -2
+ NTP_4_2_5P6
+
+ChangeSet@1.1436.1.27, 2007-02-05 06:47:44-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4_RC3
+ TAG: NTP_4_2_4_RC3
+
+ ntpd/ntpd-opts.c@1.50.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ ntpd/ntpd-opts.h@1.50.1.3 +3 -3
+ NTP_4_2_4_RC3
+
+ ntpd/ntpd-opts.texi@1.49.1.3 +1 -1
+ NTP_4_2_4_RC3
+
+ ntpd/ntpd.1@1.48.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ ntpd/ntpdsim-opts.c@1.50.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ ntpd/ntpdsim-opts.h@1.50.1.3 +3 -3
+ NTP_4_2_4_RC3
+
+ ntpd/ntpdsim-opts.texi@1.48.1.3 +1 -1
+ NTP_4_2_4_RC3
+
+ ntpd/ntpdsim.1@1.48.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ ntpdc/ntpdc-opts.c@1.50.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ ntpdc/ntpdc-opts.h@1.50.1.3 +3 -3
+ NTP_4_2_4_RC3
+
+ ntpdc/ntpdc-opts.texi@1.48.1.3 +1 -1
+ NTP_4_2_4_RC3
+
+ ntpdc/ntpdc.1@1.48.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ ntpq/ntpq-opts.c@1.52.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ ntpq/ntpq-opts.h@1.52.1.3 +3 -3
+ NTP_4_2_4_RC3
+
+ ntpq/ntpq-opts.texi@1.49.1.3 +1 -1
+ NTP_4_2_4_RC3
+
+ ntpq/ntpq.1@1.48.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ packageinfo.sh@1.65.4.1 +1 -1
+ NTP_4_2_4_RC3
+
+ sntp/sntp-opts.c@1.49.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ sntp/sntp-opts.h@1.49.1.3 +3 -3
+ NTP_4_2_4_RC3
+
+ sntp/sntp-opts.texi@1.46.1.3 +1 -1
+ NTP_4_2_4_RC3
+
+ sntp/sntp.1@1.49.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ util/ntp-keygen-opts.c@1.49.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ util/ntp-keygen-opts.h@1.49.1.3 +3 -3
+ NTP_4_2_4_RC3
+
+ util/ntp-keygen-opts.texi@1.47.1.3 +1 -1
+ NTP_4_2_4_RC3
+
+ util/ntp-keygen.1@1.47.1.3 +2 -2
+ NTP_4_2_4_RC3
+
+ChangeSet@1.1440.1.33, 2007-02-05 02:16:55-05:00, stenn@whimsy.udel.edu
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ ChangeLog@1.10 +1 -1
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ html/drivers/driver36.html@1.31 +36 -30
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ html/drivers/driver6.html@1.23 +12 -24
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ html/drivers/driver7.html@1.25 +11 -29
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ ntpd/refclock_chu.c@1.44 +39 -31
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ ntpd/refclock_irig.c@1.29 +195 -128
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.70 +50 -39
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.18 +0 -2
+ More CHU, IRIG, WWV, and WWVB fixes from Dave Mills
+
+ChangeSet@1.1436.1.26, 2007-02-04 23:08:28-05:00, stenn@whimsy.udel.edu
+ Danny forgot to pull before editing - replace the change he undid.
+
+ ntpq/ntpq-subs.c@1.25.2.2 +3 -2
+ Danny forgot to pull before editing - replace the change he undid.
+
+ChangeSet@1.1436.1.25, 2007-02-04 22:53:32-05:00, stenn@whimsy.udel.edu
+ [Bug 586] Avoid lookups if AI_NUMERICHOST is set.
+
+ ChangeLog@1.1.1.7 +1 -0
+ [Bug 586] Avoid lookups if AI_NUMERICHOST is set.
+
+ChangeSet@1.1436.1.24, 2007-02-04 21:51:15-05:00, mayer@pogo.udel.edu
+ Bug #586 Don't do lookups if AI_NUMERICHOST is set
+
+ libntp/ntp_rfc2553.c@1.36.1.1 +6 -0
+ Bug #586 Don't do lookups if AI_NUMERICHOST is set
+
+ChangeSet@1.1436.1.23, 2007-02-04 21:44:13-05:00, mayer@pogo.udel.edu
+ Bug #586 Check for <4 characters for the refid first
+
+ ntpq/ntpq-subs.c@1.25.2.1 +9 -10
+ Bug #586 Check for <4 characters for the refid first
+
+ChangeSet@1.1436.1.22, 2007-02-04 17:56:17+00:00, kardel@pogo.udel.edu
+ ntpd.c:
+ comment clarification about capabilities used
+
+ ntpd/ntpd.c@1.82.2.2 +4 -7
+ comment clarification about capabilities used
+
+ChangeSet@1.1436.2.1, 2007-02-04 17:47:20+00:00, kardel@pogo.udel.edu
+ ntpd.c:
+ Bug 765:
+ use Linux capability mechanism to allow dynamic interface tracking to continue in
+ unprivileged mode.
+
+ ntpd/ntpd.c@1.82.2.1 +11 -1
+ Bug 765:
+ use Linux capability mechanism to allow dynamic interface tracking to continue in
+ unprivileged mode.
+
+ChangeSet@1.1440.1.29, 2007-01-31 06:42:22-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P5
+ TAG: NTP_4_2_5P5
+
+ ntpd/ntpd-opts.c@1.57 +2 -2
+ NTP_4_2_5P5
+
+ ntpd/ntpd-opts.h@1.57 +3 -3
+ NTP_4_2_5P5
+
+ ntpd/ntpd-opts.texi@1.56 +1 -1
+ NTP_4_2_5P5
+
+ ntpd/ntpd.1@1.55 +2 -2
+ NTP_4_2_5P5
+
+ ntpd/ntpdsim-opts.c@1.57 +2 -2
+ NTP_4_2_5P5
+
+ ntpd/ntpdsim-opts.h@1.57 +3 -3
+ NTP_4_2_5P5
+
+ ntpd/ntpdsim-opts.texi@1.55 +1 -1
+ NTP_4_2_5P5
+
+ ntpd/ntpdsim.1@1.55 +2 -2
+ NTP_4_2_5P5
+
+ ntpdc/ntpdc-opts.c@1.57 +2 -2
+ NTP_4_2_5P5
+
+ ntpdc/ntpdc-opts.h@1.57 +3 -3
+ NTP_4_2_5P5
+
+ ntpdc/ntpdc-opts.texi@1.55 +1 -1
+ NTP_4_2_5P5
+
+ ntpdc/ntpdc.1@1.55 +2 -2
+ NTP_4_2_5P5
+
+ ntpq/ntpq-opts.c@1.59 +2 -2
+ NTP_4_2_5P5
+
+ ntpq/ntpq-opts.h@1.59 +3 -3
+ NTP_4_2_5P5
+
+ ntpq/ntpq-opts.texi@1.56 +1 -1
+ NTP_4_2_5P5
+
+ ntpq/ntpq.1@1.55 +2 -2
+ NTP_4_2_5P5
+
+ packageinfo.sh@1.8 +1 -1
+ NTP_4_2_5P5
+
+ sntp/sntp-opts.c@1.56 +2 -2
+ NTP_4_2_5P5
+
+ sntp/sntp-opts.h@1.56 +3 -3
+ NTP_4_2_5P5
+
+ sntp/sntp-opts.texi@1.53 +1 -1
+ NTP_4_2_5P5
+
+ sntp/sntp.1@1.56 +2 -2
+ NTP_4_2_5P5
+
+ util/ntp-keygen-opts.c@1.56 +2 -2
+ NTP_4_2_5P5
+
+ util/ntp-keygen-opts.h@1.56 +3 -3
+ NTP_4_2_5P5
+
+ util/ntp-keygen-opts.texi@1.54 +1 -1
+ NTP_4_2_5P5
+
+ util/ntp-keygen.1@1.54 +2 -2
+ NTP_4_2_5P5
+
+ChangeSet@1.1440.1.28, 2007-01-30 19:44:35-05:00, stenn@whimsy.udel.edu
+ re-indent/cleanup refclock_palisade.c
+
+ ntpd/refclock_palisade.c@1.21 +347 -449
+ re-indent refclock_palisade.c
+
+ChangeSet@1.1440.1.27, 2007-01-30 08:41:43-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P4
+ TAG: NTP_4_2_5P4
+
+ ntpd/ntpd-opts.c@1.56 +2 -2
+ NTP_4_2_5P4
+
+ ntpd/ntpd-opts.h@1.56 +3 -3
+ NTP_4_2_5P4
+
+ ntpd/ntpd-opts.texi@1.55 +1 -1
+ NTP_4_2_5P4
+
+ ntpd/ntpd.1@1.54 +2 -2
+ NTP_4_2_5P4
+
+ ntpd/ntpdsim-opts.c@1.56 +2 -2
+ NTP_4_2_5P4
+
+ ntpd/ntpdsim-opts.h@1.56 +3 -3
+ NTP_4_2_5P4
+
+ ntpd/ntpdsim-opts.texi@1.54 +1 -1
+ NTP_4_2_5P4
+
+ ntpd/ntpdsim.1@1.54 +2 -2
+ NTP_4_2_5P4
+
+ ntpdc/ntpdc-opts.c@1.56 +2 -2
+ NTP_4_2_5P4
+
+ ntpdc/ntpdc-opts.h@1.56 +3 -3
+ NTP_4_2_5P4
+
+ ntpdc/ntpdc-opts.texi@1.54 +1 -1
+ NTP_4_2_5P4
+
+ ntpdc/ntpdc.1@1.54 +2 -2
+ NTP_4_2_5P4
+
+ ntpq/ntpq-opts.c@1.58 +2 -2
+ NTP_4_2_5P4
+
+ ntpq/ntpq-opts.h@1.58 +3 -3
+ NTP_4_2_5P4
+
+ ntpq/ntpq-opts.texi@1.55 +1 -1
+ NTP_4_2_5P4
+
+ ntpq/ntpq.1@1.54 +2 -2
+ NTP_4_2_5P4
+
+ packageinfo.sh@1.7 +1 -1
+ NTP_4_2_5P4
+
+ sntp/sntp-opts.c@1.55 +2 -2
+ NTP_4_2_5P4
+
+ sntp/sntp-opts.h@1.55 +3 -3
+ NTP_4_2_5P4
+
+ sntp/sntp-opts.texi@1.52 +1 -1
+ NTP_4_2_5P4
+
+ sntp/sntp.1@1.55 +2 -2
+ NTP_4_2_5P4
+
+ util/ntp-keygen-opts.c@1.55 +2 -2
+ NTP_4_2_5P4
+
+ util/ntp-keygen-opts.h@1.55 +3 -3
+ NTP_4_2_5P4
+
+ util/ntp-keygen-opts.texi@1.53 +1 -1
+ NTP_4_2_5P4
+
+ util/ntp-keygen.1@1.53 +2 -2
+ NTP_4_2_5P4
+
+ChangeSet@1.1436.1.20, 2007-01-30 06:44:11-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4_RC2
+ TAG: NTP_4_2_4_RC2
+
+ ntpd/ntpd-opts.c@1.50.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ ntpd/ntpd-opts.h@1.50.1.2 +3 -3
+ NTP_4_2_4_RC2
+
+ ntpd/ntpd-opts.texi@1.49.1.2 +1 -1
+ NTP_4_2_4_RC2
+
+ ntpd/ntpd.1@1.48.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ ntpd/ntpdsim-opts.c@1.50.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ ntpd/ntpdsim-opts.h@1.50.1.2 +3 -3
+ NTP_4_2_4_RC2
+
+ ntpd/ntpdsim-opts.texi@1.48.1.2 +1 -1
+ NTP_4_2_4_RC2
+
+ ntpd/ntpdsim.1@1.48.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ ntpdc/ntpdc-opts.c@1.50.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ ntpdc/ntpdc-opts.h@1.50.1.2 +3 -3
+ NTP_4_2_4_RC2
+
+ ntpdc/ntpdc-opts.texi@1.48.1.2 +1 -1
+ NTP_4_2_4_RC2
+
+ ntpdc/ntpdc.1@1.48.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ ntpq/ntpq-opts.c@1.52.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ ntpq/ntpq-opts.h@1.52.1.2 +3 -3
+ NTP_4_2_4_RC2
+
+ ntpq/ntpq-opts.texi@1.49.1.2 +1 -1
+ NTP_4_2_4_RC2
+
+ ntpq/ntpq.1@1.48.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ packageinfo.sh@1.65.3.1 +1 -1
+ NTP_4_2_4_RC2
+
+ sntp/sntp-opts.c@1.49.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ sntp/sntp-opts.h@1.49.1.2 +3 -3
+ NTP_4_2_4_RC2
+
+ sntp/sntp-opts.texi@1.46.1.2 +1 -1
+ NTP_4_2_4_RC2
+
+ sntp/sntp.1@1.49.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ util/ntp-keygen-opts.c@1.49.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ util/ntp-keygen-opts.h@1.49.1.2 +3 -3
+ NTP_4_2_4_RC2
+
+ util/ntp-keygen-opts.texi@1.47.1.2 +1 -1
+ NTP_4_2_4_RC2
+
+ util/ntp-keygen.1@1.47.1.2 +2 -2
+ NTP_4_2_4_RC2
+
+ChangeSet@1.1440.1.26, 2007-01-30 01:09:52-05:00, stenn@whimsy.udel.edu
+ Lose K&R prototype macro
+
+ libntp/ntp_rfc2553.c@1.37 +2 -2
+ Lose K&R prototype macro
+
+ChangeSet@1.1436.1.19, 2007-01-29 21:20:08-05:00, stenn@whimsy.udel.edu
+ [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert).
+
+ ChangeLog@1.1.1.6 +1 -0
+ [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert).
+
+ util/ntp-keygen.c@1.37.1.1 +3 -3
+ [Bug 770] Fix numeric parameters to ntp-keygen (Alain Guibert).
+
+ChangeSet@1.1436.1.18, 2007-01-29 17:43:41-05:00, stenn@whimsy.udel.edu
+ More ChangeLog -> CommitLog fixes
+
+ scripts/genCommitLog@1.4 +2 -2
+ More ChangeLog -> CommitLog fixes
+
+ChangeSet@1.1436.1.17, 2007-01-29 16:52:38-05:00, stenn@whimsy.udel.edu
+ More ChangeLog -> CommitLog fixes
+
+ Makefile.am@1.70.1.2 +5 -5
+ More ChangeLog -> CommitLog fixes
+
+ scripts/Makefile.am@1.15 +1 -1
+ More ChangeLog -> CommitLog fixes
+
+ scripts/genCommitLog@1.3 +0 -0
+ Rename: scripts/genChangeLog -> scripts/genCommitLog
+
+ChangeSet@1.1436.1.16, 2007-01-28 23:24:05-05:00, stenn@whimsy.udel.edu
+ Entries for bugs 765 and 768
+
+ ChangeLog@1.1.1.5 +2 -0
+ Entries for bugs 765 and 768
+
+ChangeSet@1.1436.1.15, 2007-01-27 08:54:51+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ fix misleading error message when calling io_setbclient() and
+ broadcast sockets are already open and not new sockets need to
+ be opened.
+ Bug 768: fix binding for broadcast client mode (Ulrich Weber)
+
+ ntpd/ntp_io.c@1.244.2.3 +6 -3
+ fix misleading error message when calling io_setbclient() and
+ broadcast sockets are already open and not new sockets need to
+ be opened.
+
+ ntpd/ntp_io.c@1.244.2.2 +2 -2
+ Bug 768: fix binding for broadcast client mode (Ulrich Weber)
+
+ChangeSet@1.1440.1.22, 2007-01-25 19:55:47-05:00, stenn@whimsy.udel.edu
+ CHU, IRIG, and WWV improvements from Dave Mills
+
+ libntp/audio.c@1.26 +6 -3
+ CHU, IRIG, and WWV improvements from Dave Mills
+
+ ntpd/refclock_chu.c@1.43 +25 -22
+ CHU, IRIG, and WWV improvements from Dave Mills
+
+ ntpd/refclock_irig.c@1.28 +113 -117
+ CHU, IRIG, and WWV improvements from Dave Mills
+
+ ntpd/refclock_wwv.c@1.69 +26 -28
+ CHU, IRIG, and WWV improvements from Dave Mills
+
+ChangeSet@1.1440.1.21, 2007-01-25 18:30:28-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P3
+ TAG: NTP_4_2_5P3
+
+ ntpd/ntpd-opts.c@1.55 +2 -2
+ NTP_4_2_5P3
+
+ ntpd/ntpd-opts.h@1.55 +3 -3
+ NTP_4_2_5P3
+
+ ntpd/ntpd-opts.texi@1.54 +2 -2
+ NTP_4_2_5P3
+
+ ntpd/ntpd.1@1.53 +2 -2
+ NTP_4_2_5P3
+
+ ntpd/ntpdsim-opts.c@1.55 +2 -2
+ NTP_4_2_5P3
+
+ ntpd/ntpdsim-opts.h@1.55 +3 -3
+ NTP_4_2_5P3
+
+ ntpd/ntpdsim-opts.texi@1.53 +1 -1
+ NTP_4_2_5P3
+
+ ntpd/ntpdsim.1@1.53 +2 -2
+ NTP_4_2_5P3
+
+ ntpdc/ntpdc-opts.c@1.55 +2 -2
+ NTP_4_2_5P3
+
+ ntpdc/ntpdc-opts.h@1.55 +3 -3
+ NTP_4_2_5P3
+
+ ntpdc/ntpdc-opts.texi@1.53 +2 -2
+ NTP_4_2_5P3
+
+ ntpdc/ntpdc.1@1.53 +2 -2
+ NTP_4_2_5P3
+
+ ntpq/ntpq-opts.c@1.57 +2 -2
+ NTP_4_2_5P3
+
+ ntpq/ntpq-opts.h@1.57 +3 -3
+ NTP_4_2_5P3
+
+ ntpq/ntpq-opts.texi@1.54 +2 -2
+ NTP_4_2_5P3
+
+ ntpq/ntpq.1@1.53 +2 -2
+ NTP_4_2_5P3
+
+ packageinfo.sh@1.6 +1 -1
+ NTP_4_2_5P3
+
+ sntp/sntp-opts.c@1.54 +2 -2
+ NTP_4_2_5P3
+
+ sntp/sntp-opts.h@1.54 +3 -3
+ NTP_4_2_5P3
+
+ sntp/sntp-opts.texi@1.51 +1 -1
+ NTP_4_2_5P3
+
+ sntp/sntp.1@1.54 +2 -2
+ NTP_4_2_5P3
+
+ util/ntp-keygen-opts.c@1.54 +2 -2
+ NTP_4_2_5P3
+
+ util/ntp-keygen-opts.h@1.54 +3 -3
+ NTP_4_2_5P3
+
+ util/ntp-keygen-opts.texi@1.52 +2 -2
+ NTP_4_2_5P3
+
+ util/ntp-keygen.1@1.52 +2 -2
+ NTP_4_2_5P3
+
+ChangeSet@1.1440.1.20, 2007-01-23 06:44:39-05:00, stenn@whimsy.udel.edu
+ [Bug 592] Trimble Thunderbolt GPS support.
+
+ ChangeLog@1.6 +1 -0
+ [Bug 592] Trimble Thunderbolt GPS support.
+
+ChangeSet@1.1436.1.14, 2007-01-23 04:47:08-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4_RC1
+ TAG: NTP_4_2_4_RC1
+
+ ntpd/ntpd-opts.c@1.50.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpd/ntpd-opts.h@1.50.1.1 +3 -3
+ NTP_4_2_4_RC1
+
+ ntpd/ntpd-opts.texi@1.49.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpd/ntpd.1@1.48.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpd/ntpdsim-opts.c@1.50.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpd/ntpdsim-opts.h@1.50.1.1 +3 -3
+ NTP_4_2_4_RC1
+
+ ntpd/ntpdsim-opts.texi@1.48.1.1 +1 -1
+ NTP_4_2_4_RC1
+
+ ntpd/ntpdsim.1@1.48.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpdc/ntpdc-opts.c@1.50.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpdc/ntpdc-opts.h@1.50.1.1 +3 -3
+ NTP_4_2_4_RC1
+
+ ntpdc/ntpdc-opts.texi@1.48.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpdc/ntpdc.1@1.48.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpq/ntpq-opts.c@1.52.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpq/ntpq-opts.h@1.52.1.1 +3 -3
+ NTP_4_2_4_RC1
+
+ ntpq/ntpq-opts.texi@1.49.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ ntpq/ntpq.1@1.48.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ packageinfo.sh@1.65.2.1 +3 -3
+ NTP_4_2_4_RC1
+
+ sntp/sntp-opts.c@1.49.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ sntp/sntp-opts.h@1.49.1.1 +3 -3
+ NTP_4_2_4_RC1
+
+ sntp/sntp-opts.texi@1.46.1.1 +1 -1
+ NTP_4_2_4_RC1
+
+ sntp/sntp.1@1.49.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ util/ntp-keygen-opts.c@1.49.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ util/ntp-keygen-opts.h@1.49.1.1 +3 -3
+ NTP_4_2_4_RC1
+
+ util/ntp-keygen-opts.texi@1.47.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ util/ntp-keygen.1@1.47.1.1 +2 -2
+ NTP_4_2_4_RC1
+
+ChangeSet@1.1440.1.18, 2007-01-22 01:53:23-05:00, fernandoph@pogo.udel.edu
+ thunderbolt.jpg:
+ BitKeeper file /pogo/users/fernandoph/ntp-dev-592/html/pic/thunderbolt.jpg
+
+ html/pic/thunderbolt.jpg@1.1 +862 -0
+ BitKeeper file /pogo/users/fernandoph/ntp-dev-592/html/pic/thunderbolt.jpg
+
+ html/pic/thunderbolt.jpg@1.0 +0 -0
+
+ChangeSet@1.1440.1.17, 2007-01-22 01:28:51-05:00, fernandoph@pogo.udel.edu
+ refclock_palisade.c, driver29.html, refclock_palisade.h:
+ [BUG 592] Added support for Thunderbolt Receiver (mode 2).
+
+ html/drivers/driver29.html@1.15 +319 -5
+ [BUG 592] Added support for Thunderbolt Receiver (mode 2).
+
+ ntpd/refclock_palisade.c@1.20 +325 -9
+ [BUG 592] Added support for Thunderbolt Receiver (mode 2).
+
+ ntpd/refclock_palisade.h@1.10 +29 -0
+ [BUG 592] Added support for Thunderbolt Receiver (mode 2).
+
+ChangeSet@1.1436.1.13, 2007-01-21 12:44:07-05:00, stenn@whimsy.udel.edu
+ Danny fixed bug 360 in 4.2.2
+
+ ChangeLog@1.1.1.4 +1 -0
+ Danny fixed bug 360 in 4.2.2
+
+ChangeSet@1.1436.1.12, 2007-01-21 12:40:23-05:00, stenn@whimsy.udel.edu
+ Danny fixed bug 239 in 4.2.2
+
+ ChangeLog@1.1.1.3 +2 -0
+ Danny fixed bug 239 in 4.2.2
+
+ChangeSet@1.1436.1.11, 2007-01-21 12:33:46-05:00, stenn@pogo.udel.edu
+ Added bug 760 description to the ChangeLog
+
+ ChangeLog@1.1.1.2 +1 -0
+ Added bug 760 description to the ChangeLog
+
+ChangeSet@1.1436.1.10, 2007-01-21 12:28:04-05:00, stenn@pogo.udel.edu
+ Update the ChangeLog
+
+ ChangeLog@1.1.1.1 +3 -0
+ Update the ChangeLog
+
+ChangeSet@1.1440.1.15, 2007-01-21 02:51:30-05:00, stenn@whimsy.udel.edu
+ CHU, IRIG, and WWV refclock improvements from Dave Mills.
+
+ ChangeLog@1.4 +1 -0
+ CHU, IRIG, and WWV refclock improvements from Dave Mills.
+
+ html/drivers/driver36.html@1.30 +35 -46
+ CHU, IRIG, and WWV refclock improvements from Dave Mills.
+
+ html/drivers/driver6.html@1.22 +18 -18
+ CHU, IRIG, and WWV refclock improvements from Dave Mills.
+
+ html/drivers/driver7.html@1.24 +78 -141
+ CHU, IRIG, and WWV refclock improvements from Dave Mills.
+
+ ntpd/refclock_chu.c@1.42 +168 -225
+ CHU, IRIG, and WWV refclock improvements from Dave Mills.
+
+ ntpd/refclock_irig.c@1.27 +90 -146
+ CHU, IRIG, and WWV refclock improvements from Dave Mills.
+
+ChangeSet@1.1436.1.9, 2007-01-21 07:49:58+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ pick the right type for the recv*() length argument (use GETSOCKNAME_SOCKLEN_TYPE config.h define)
+
+ ntpd/ntp_io.c@1.244.2.1 +1 -1
+ pick the right type for the recv*() length argument (use GETSOCKNAME_SOCKLEN_TYPE config.h define)
+
+ChangeSet@1.1436.1.8, 2007-01-20 14:38:38+00:00, kardel@pogo.udel.edu
+ confopt.html:
+ move description for "dynamic" keyword into the right section
+
+ html/confopt.html@1.35 +4 -3
+ move description for "dynamic" keyword into the right section
+
+ChangeSet@1.1440.1.14, 2007-01-16 03:45:54-05:00, stenn@pogo.udel.edu
+ AC_PROG_CC_C_O -> AM_PROG_CC_C_O for automake upgrade
+
+ configure.ac@1.404 +1 -1
+ AC_PROG_CC_C_O -> AM_PROG_CC_C_O for automake upgrade
+
+ChangeSet@1.1447.1.1, 2007-01-16 02:20:41-05:00, skamboj@ferrari.local
+ ntp_control.c:
+ Added configure prototype
+ ntp_control.h:
+ Added opcode for configure.
+ rsa_md5.h:
+ Removed double bracket
+
+ include/ntp_control.h@1.30 +1 -0
+ Added opcode for configure.
+
+ include/rsa_md5.h@1.5.1.1 +3 -3
+ Removed double bracket
+
+ ntpd/ntp_control.c@1.88.1.2 +1 -0
+ Added configure prototype
+
+ChangeSet@1.1442.1.1, 2007-01-16 00:27:25-05:00, skamboj@ferrari.local
+ This changeset should now contain the remainder of the changes needed to incorporate the change in the configuration and simulator code.
+
+ include/ntp_config.h@1.42 +138 -164
+ Updated ntp_config.c to use a phrase structure grammar
+
+ include/ntpsim.h@1.5.1.1 +112 -61
+ Replaced the simulator code to allow the use of multiple servers
+
+ libntp/systime.c@1.39 +3 -177
+ Removed the code needed by the simulator and added it to ntpsim.c, where IMHO, it rightfully belonged.
+
+ ntpd/cmd_args.c@1.45.1.1 +5 -28
+ Removed command line arguments from the simulator code
+
+ ntpd/ntp_config.c@1.142.1.1 +1821 -1835
+ Updated ntp_config.c to use a phrase structure grammar
+
+ ntpd/ntp_control.c@1.87.1.1 +54 -0
+ Added a configure option to allow remote configuration of NTP through the use of ntpq
+
+ ntpd/ntp_io.c@1.244.1.1 +1 -1
+ Changed the line of code that sent a packet to the simulator.
+
+ ntpd/ntpsim.c@1.13.1.1 +573 -322
+ Replaced the simulator code to allow the use of multiple servers
+
+ ntpq/ntpq-subs.c@1.25.1.1 +90 -0
+ Added a configure option to allow remote configuration of NTP through the use of ntpq
+
+ ntpq/ntpq.c@1.65.1.1 +20 -3
+ Modified tokenize to allow the use of a quoted string. Needed by the new configure command.
+
+ChangeSet@1.1436.1.7, 2007-01-14 08:46:00+00:00, kardel@pogo.udel.edu
+ parse.h:
+ Bug 753: make union timestamp anonymous (Philip Prindeville)
+ now there are OSes that claim that name in netinet/ip.h...
+
+ include/parse.h@1.7.1.1 +8 -4
+ Bug 753: make union timestamp anonymous (Philip Prindeville)
+ now there are OSes that claim that name in netinet/ip.h...
+
+ChangeSet@1.1436.1.6, 2007-01-13 11:36:29+00:00, kardel@pogo.udel.edu
+ ntp_intres.c:
+ support dynamic keyword
+
+ ntpd/ntp_intres.c@1.48.1.1 +3 -1
+ support dynamic keyword
+
+ChangeSet@1.1440.1.13, 2007-01-08 06:01:47-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P2
+ TAG: NTP_4_2_5P2
+
+ ntpd/ntpd-opts.c@1.53 +2 -2
+ NTP_4_2_5P2
+
+ ntpd/ntpd-opts.h@1.53 +3 -3
+ NTP_4_2_5P2
+
+ ntpd/ntpd-opts.texi@1.52 +1 -1
+ NTP_4_2_5P2
+
+ ntpd/ntpd.1@1.51 +2 -2
+ NTP_4_2_5P2
+
+ ntpd/ntpdsim-opts.c@1.53 +2 -2
+ NTP_4_2_5P2
+
+ ntpd/ntpdsim-opts.h@1.53 +3 -3
+ NTP_4_2_5P2
+
+ ntpd/ntpdsim-opts.texi@1.51 +1 -1
+ NTP_4_2_5P2
+
+ ntpd/ntpdsim.1@1.51 +2 -2
+ NTP_4_2_5P2
+
+ ntpdc/ntpdc-opts.c@1.53 +2 -2
+ NTP_4_2_5P2
+
+ ntpdc/ntpdc-opts.h@1.53 +3 -3
+ NTP_4_2_5P2
+
+ ntpdc/ntpdc-opts.texi@1.51 +1 -1
+ NTP_4_2_5P2
+
+ ntpdc/ntpdc.1@1.51 +2 -2
+ NTP_4_2_5P2
+
+ ntpq/ntpq-opts.c@1.55 +2 -2
+ NTP_4_2_5P2
+
+ ntpq/ntpq-opts.h@1.55 +3 -3
+ NTP_4_2_5P2
+
+ ntpq/ntpq-opts.texi@1.52 +1 -1
+ NTP_4_2_5P2
+
+ ntpq/ntpq.1@1.51 +2 -2
+ NTP_4_2_5P2
+
+ packageinfo.sh@1.5 +1 -1
+ NTP_4_2_5P2
+
+ sntp/sntp-opts.c@1.52 +2 -2
+ NTP_4_2_5P2
+
+ sntp/sntp-opts.h@1.52 +3 -3
+ NTP_4_2_5P2
+
+ sntp/sntp-opts.texi@1.49 +1 -1
+ NTP_4_2_5P2
+
+ sntp/sntp.1@1.52 +2 -2
+ NTP_4_2_5P2
+
+ util/ntp-keygen-opts.c@1.52 +2 -2
+ NTP_4_2_5P2
+
+ util/ntp-keygen-opts.h@1.52 +3 -3
+ NTP_4_2_5P2
+
+ util/ntp-keygen-opts.texi@1.50 +1 -1
+ NTP_4_2_5P2
+
+ util/ntp-keygen.1@1.50 +2 -2
+ NTP_4_2_5P2
+
+ChangeSet@1.1436.1.5, 2007-01-06 18:24:18-05:00, stenn@whimsy.udel.edu
+ Updated copyright year
+
+ html/copyright.html@1.36 +2 -2
+ Updated copyright year
+
+ChangeSet@1.1440.1.11, 2007-01-06 16:09:45-05:00, stenn@whimsy.udel.edu
+ Documentation updates
+
+ html/audio.html@1.18 +32 -24
+ Documentation updates
+
+ html/drivers/driver36.html@1.29 +20 -14
+ Documentation updates
+
+ html/drivers/driver6.html@1.21 +6 -9
+ Documentation updates
+
+ html/drivers/driver7.html@1.23 +19 -31
+ Documentation updates
+
+ html/pic/description.jpg@1.1 +761 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/description.jpg
+
+ html/pic/description.jpg@1.0 +0 -0
+
+ html/pic/freq1211.gif@1.1 +255 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/freq1211.gif
+
+ html/pic/freq1211.gif@1.0 +0 -0
+
+ html/pic/offset1211.gif@1.1 +568 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/offset1211.gif
+
+ html/pic/offset1211.gif@1.0 +0 -0
+
+ html/pic/pzf509.jpg@1.1 +291 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/pic/pzf509.jpg
+
+ html/pic/pzf509.jpg@1.0 +0 -0
+
+ChangeSet@1.1440.1.10, 2007-01-06 05:35:24-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P1
+ TAG: NTP_4_2_5P1
+
+ ntpd/ntpd-opts.c@1.52 +2 -2
+ NTP_4_2_5P1
+
+ ntpd/ntpd-opts.h@1.52 +3 -3
+ NTP_4_2_5P1
+
+ ntpd/ntpd-opts.texi@1.51 +1 -1
+ NTP_4_2_5P1
+
+ ntpd/ntpd.1@1.50 +2 -2
+ NTP_4_2_5P1
+
+ ntpd/ntpdsim-opts.c@1.52 +2 -2
+ NTP_4_2_5P1
+
+ ntpd/ntpdsim-opts.h@1.52 +3 -3
+ NTP_4_2_5P1
+
+ ntpd/ntpdsim-opts.texi@1.50 +1 -1
+ NTP_4_2_5P1
+
+ ntpd/ntpdsim.1@1.50 +2 -2
+ NTP_4_2_5P1
+
+ ntpdc/ntpdc-opts.c@1.52 +2 -2
+ NTP_4_2_5P1
+
+ ntpdc/ntpdc-opts.h@1.52 +3 -3
+ NTP_4_2_5P1
+
+ ntpdc/ntpdc-opts.texi@1.50 +1 -1
+ NTP_4_2_5P1
+
+ ntpdc/ntpdc.1@1.50 +2 -2
+ NTP_4_2_5P1
+
+ ntpq/ntpq-opts.c@1.54 +2 -2
+ NTP_4_2_5P1
+
+ ntpq/ntpq-opts.h@1.54 +3 -3
+ NTP_4_2_5P1
+
+ ntpq/ntpq-opts.texi@1.51 +1 -1
+ NTP_4_2_5P1
+
+ ntpq/ntpq.1@1.50 +2 -2
+ NTP_4_2_5P1
+
+ packageinfo.sh@1.4 +1 -1
+ NTP_4_2_5P1
+
+ sntp/sntp-opts.c@1.51 +2 -2
+ NTP_4_2_5P1
+
+ sntp/sntp-opts.h@1.51 +3 -3
+ NTP_4_2_5P1
+
+ sntp/sntp-opts.texi@1.48 +1 -1
+ NTP_4_2_5P1
+
+ sntp/sntp.1@1.51 +2 -2
+ NTP_4_2_5P1
+
+ util/ntp-keygen-opts.c@1.51 +2 -2
+ NTP_4_2_5P1
+
+ util/ntp-keygen-opts.h@1.51 +3 -3
+ NTP_4_2_5P1
+
+ util/ntp-keygen-opts.texi@1.49 +1 -1
+ NTP_4_2_5P1
+
+ util/ntp-keygen.1@1.49 +2 -2
+ NTP_4_2_5P1
+
+ChangeSet@1.1440.1.9, 2007-01-06 04:40:47-05:00, stenn@whimsy.udel.edu
+ refclock_chu.c changes from Dave Mills
+
+ ntpd/refclock_chu.c@1.41 +224 -142
+ refclock_chu.c changes from Dave Mills
+
+ChangeSet@1.1440.1.8, 2007-01-06 04:05:36-05:00, stenn@whimsy.udel.edu
+ [Bug 757] Lose ULONG_CONST()
+
+ BitKeeper/deleted/.del-hs_ulong_const.m4@1.3 +0 -0
+ Delete: m4/hs_ulong_const.m4
+
+ ChangeLog@1.3 +1 -0
+ [Bug 757] Lose ULONG_CONST()
+
+ configure.ac@1.403 +0 -2
+ [Bug 757] Lose ULONG_CONST()
+
+ libparse/gpstolfp.c@1.9 +1 -1
+ [Bug 757] Lose ULONG_CONST()
+
+ ntpd/ntp_control.c@1.89 +2 -2
+ [Bug 757] Lose ULONG_CONST()
+
+ util/ntp-keygen.c@1.39 +1 -1
+ [Bug 757] Lose ULONG_CONST()
+
+ChangeSet@1.1440.1.7, 2007-01-06 03:25:15-05:00, stenn@whimsy.udel.edu
+ [Bug 756] Require function prototypes
+
+ configure.ac@1.402 +2 -32
+ [Bug 756] Require function prototypes
+
+ include/ntp_rfc2553.h@1.29 +6 -6
+ [Bug 756] Require function prototypes
+
+ include/ntp_select.h@1.3 +2 -2
+ [Bug 756] Require function prototypes
+
+ include/ntp_syscall.h@1.7 +1 -1
+ [Bug 756] Require function prototypes
+
+ include/rsa_md5.h@1.6 +3 -4
+ [Bug 756] Require function prototypes
+
+ libntp/audio.c@1.25 +2 -2
+ [Bug 756] Require function prototypes
+
+ libntp/md5c.c@1.8 +5 -7
+ [Bug 756] Require function prototypes
+
+ libntp/syssignal.c@1.9 +1 -1
+ [Bug 756] Require function prototypes
+
+ libparse/clk_wharton.c@1.7 +1 -1
+ [Bug 756] Require function prototypes
+
+ libparse/parsestreams.c@1.7 +23 -23
+ [Bug 756] Require function prototypes
+
+ ntpd/refclock_ripencc.c@1.7 +21 -21
+ [Bug 756] Require function prototypes
+
+ ntpd/refclock_tpro.c@1.9 +3 -3
+ [Bug 756] Require function prototypes
+
+ ntpd/refclock_tt560.c@1.2 +3 -3
+ [Bug 756] Require function prototypes
+
+ sntp/configure.ac@1.16 +1 -1
+ [Bug 756] Require function prototypes
+
+ util/hist.c@1.7 +1 -1
+ [Bug 756] Require function prototypes
+
+ util/jitter.h@1.3 +16 -16
+ [Bug 756] Require function prototypes
+
+ util/tickadj.c@1.7 +4 -4
+ [Bug 756] Require function prototypes
+
+ChangeSet@1.1440.1.6, 2007-01-05 00:41:52-05:00, stenn@whimsy.udel.edu
+ Add in ntp-dev updates to the new ChangeLog
+
+ ChangeLog@1.2 +3 -0
+ Add in ntp-dev updates to the new ChangeLog
+
+ChangeSet@1.1436.1.4, 2007-01-05 00:27:33-05:00, stenn@whimsy.udel.edu
+ ChangeLog->CommitLog, NEWS->ChangeLog, Release Info->NEWS
+
+ ChangeLog@1.1 +260 -0
+ BitKeeper file /deacon/backroom/ntp-stable/ChangeLog
+
+ ChangeLog@1.0 +0 -0
+
+ CommitLog-4.1.0@1.592 +0 -0
+ Rename: ChangeLog-4.1.0 -> CommitLog-4.1.0
+
+ Makefile.am@1.70.1.1 +2 -1
+ ChangeLog->CommitLog, NEWS->ChangeLog, Release Info->NEWS
+
+ NEWS@1.86.1.1 +14 -256
+ ChangeLog->CommitLog, NEWS->ChangeLog, Release Info->NEWS
+
+ChangeSet@1.1436.1.3, 2007-01-04 23:41:02-05:00, stenn@whimsy.udel.edu
+ ChangeLog->CommitLog in the ignore file
+
+ BitKeeper/etc/ignore@1.59 +1 -2
+ ChangeLog->CommitLog in the ignore file
+
+ChangeSet@1.1436.1.2, 2007-01-04 19:31:07-05:00, stenn@whimsy.udel.edu
+ hostname updates for flock-build
+
+ flock-build@1.39 +15 -19
+ hostname updates for flock-build
+
+ChangeSet@1.1445, 2007-01-04 01:22:19-05:00, stenn@pogo.udel.edu
+ What about ntpdsim.1?
+
+ ntpd/Makefile.am@1.55 +2 -0
+ What about ntpdsim.1?
+
+ChangeSet@1.1443, 2007-01-03 19:12:30-05:00, stenn@pogo.udel.edu
+ ntpdsim no longer needs special command-line options
+
+ NEWS@1.87.1.1 +2 -0
+ ntpdsim no longer needs special command-line options
+
+ ntpd/Makefile.am@1.52.1.1 +3 -19
+ ntpdsim no longer needs special command-line options
+
+ ntpd/cmd_args.c@1.46 +2 -9
+ ntpdsim no longer needs special command-line options
+
+ ntpd/ntpd.c@1.82.1.1 +2 -7
+ ntpdsim no longer needs special command-line options
+
+ ntpd/ntpsim.c@1.14 +3 -3
+ ntpdsim no longer needs special command-line options
+
+ChangeSet@1.1440.1.1, 2007-01-03 16:46:18-05:00, stenn@whimsy.udel.edu
+ CHU and IRIG changes from Dave Mills
+
+ ntpd/refclock_chu.c@1.38.1.1 +163 -230
+ CHU and IRIG changes from Dave Mills
+
+ ntpd/refclock_irig.c@1.24.1.1 +7 -6
+ CHU and IRIG changes from Dave Mills
+
+ChangeSet@1.1439.1.1, 2007-01-03 16:41:43-05:00, stenn@pogo.udel.edu
+ [Bug 756] Require ANSI C (function prototypes)
+
+ Makefile.am@1.71 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ NEWS@1.88 +1 -0
+ [Bug 756] Require ANSI C (function prototypes)
+
+ adjtimed/Makefile.am@1.4 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ arlib/Makefile.am@1.3 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ clockstuff/Makefile.am@1.6 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ configure.ac@1.401 +4 -2
+ [Bug 756] Require ANSI C. For Solaris, lose -D_XOPEN_SOURCE=500 as that conflicts with recent ANSI/POSIX stuff
+
+ include/Makefile.am@1.25 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/audio.h@1.7 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/binio.h@1.5 +8 -8
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/global.h@1.4 +0 -19
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/icom.h@1.5 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ieee754io.h@1.5 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/iosignal.h@1.3 +6 -6
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/isc/Makefile.am@1.5 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/l_stdlib.h@1.16 +67 -332
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/mbg_gps166.h@1.9 +24 -24
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp.h@1.130 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_calendar.h@1.3 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_cmdargs.h@1.5 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_filegen.h@1.4 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_fp.h@1.13 +17 -17
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_machine.h@1.24 +11 -23
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_random.h@1.2 +6 -6
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_refclock.h@1.21 +28 -28
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_stdlib.h@1.25 +64 -70
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_string.h@1.3 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_types.h@1.9 +0 -11
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntp_unixtime.h@1.5 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntpd.h@1.99 +120 -120
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/ntpsim.h@1.6 +16 -16
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/parse.h@1.8 +32 -32
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/recvbuff.h@1.12 +13 -13
+ [Bug 756] Require ANSI C (function prototypes)
+
+ include/trimble.h@1.5 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ kernel/Makefile.am@1.3 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ kernel/sys/Makefile.am@1.4 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libntp/Makefile.am@1.38 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libntp/authreadkeys.c@1.7 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libntp/icom.c@1.11 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libntp/iosignal.c@1.14 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libntp/msyslog.c@1.20 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libntp/ntp_random.c@1.6 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libntp/statestr.c@1.11 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/Makefile.am@1.9 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_computime.c@1.9 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_dcf7000.c@1.9 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_hopf6021.c@1.9 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_meinberg.c@1.10 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_rawdcf.c@1.15 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_rcc8000.c@1.9 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_schmid.c@1.9 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_trimtaip.c@1.9 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_trimtsip.c@1.9 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/clk_varitext.c@1.8 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/data_mbg.c@1.9 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/ieee754io.c@1.9 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/parse.c@1.12 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ libparse/parsesolaris.c@1.7 +13 -13
+ [Bug 756] Require ANSI C (function prototypes)
+
+ m4/hs_ulong_const.m4@1.2 +1 -9
+ [Bug 756] Require ANSI C (function prototypes)
+
+ m4/os_cflags.m4@1.3 +8 -5
+ Upgraded to the latest version from am-utils
+
+ ntpd/Makefile.am@1.53 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_config.c@1.143 +15 -15
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_control.c@1.88 +31 -31
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_crypto.c@1.108 +25 -25
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_filegen.c@1.12 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_intres.c@1.49 +12 -12
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_io.c@1.245 +35 -35
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_loopfilter.c@1.129 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_monitor.c@1.19 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_peer.c@1.98 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_proto.c@1.250 +8 -8
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_refclock.c@1.76 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_request.c@1.66 +50 -50
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntp_timer.c@1.34 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/ntpd.c@1.83 +9 -9
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_acts.c@1.29 +9 -9
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_arbiter.c@1.14 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_arc.c@1.19 +7 -7
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_as2201.c@1.10 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_atom.c@1.55 +7 -7
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_chronolog.c@1.7 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_chu.c@1.39 +17 -17
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_datum.c@1.10 +8 -8
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_dumbclock.c@1.9 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_fg.c@1.11 +5 -5
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_heath.c@1.14 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_hopfser.c@1.10 +5 -5
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_hpgps.c@1.8 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_irig.c@1.25 +8 -8
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_jjy.c@1.14 +10 -10
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_jupiter.c@1.21 +19 -19
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_leitch.c@1.9 +11 -11
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_local.c@1.16 +2 -2
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_mx4200.c@1.23 +16 -16
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_neoclock4x.c@1.16 +12 -12
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_nmea.c@1.26 +10 -10
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_oncore.c@1.61 +48 -48
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_palisade.c@1.19 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_palisade.h@1.9 +11 -11
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_parse.c@1.48 +67 -67
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_pcf.c@1.8 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_pst.c@1.9 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_true.c@1.10 +7 -7
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_ulink.c@1.14 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_wwv.c@1.68 +21 -21
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_wwvb.c@1.17 +5 -5
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpd/refclock_zyfer.c@1.5 +4 -4
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpdate/Makefile.am@1.15 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpdate/ntpdate.c@1.60 +19 -19
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpdate/ntpdate.h@1.8 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpdc/Makefile.am@1.34 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpdc/ntpdc.c@1.55 +30 -30
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpdc/ntpdc.h@1.8 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpdc/ntpdc_ops.c@1.47 +53 -53
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpq/Makefile.am@1.26 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpq/ntpq-subs.c@1.26 +41 -41
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpq/ntpq.c@1.66 +46 -46
+ [Bug 756] Require ANSI C (function prototypes)
+
+ ntpq/ntpq.h@1.6 +13 -13
+ [Bug 756] Require ANSI C (function prototypes)
+
+ parseutil/Makefile.am@1.7 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ parseutil/dcfd.c@1.20 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ util/Makefile.am@1.35 +1 -1
+ [Bug 756] Require ANSI C (function prototypes)
+
+ util/jitter.h@1.2 +0 -11
+ [Bug 756] Require ANSI C (function prototypes)
+
+ util/ntp-keygen.c@1.38 +14 -14
+ [Bug 756] Require ANSI C (function prototypes)
+
+ util/ntptime.c@1.20 +3 -3
+ [Bug 756] Require ANSI C (function prototypes)
+
+ChangeSet@1.1442, 2007-01-02 23:16:36-05:00, skamboj@ferrari.local
+ ntp_config.y:
+ New BitKeeper file ``ntpd/ntp_config.y''
+
+ ntpd/ntp_config.y@1.1 +917 -0
+ New BitKeeper file ``ntpd/ntp_config.y''
+
+ ntpd/ntp_config.y@1.0 +0 -0
+
+ChangeSet@1.1441, 2007-01-02 23:14:13-05:00, skamboj@ferrari.local
+ Added code for:
+ 1. A phrase-structure grammar based NTP configuration file parser
+ 2. A multi-server NTP simulator
+
+ include/ntp_data_structures.h@1.1 +47 -0
+ New BitKeeper file ``include/ntp_data_structures.h''
+
+ include/ntp_data_structures.h@1.0 +0 -0
+
+ ntpd/ntp_config.tab.c@1.1 +2351 -0
+ New BitKeeper file ``ntpd/ntp_config.tab.c''
+
+ ntpd/ntp_config.tab.c@1.0 +0 -0
+
+ ntpd/ntp_data_structures.c@1.1 +170 -0
+ New BitKeeper file ``ntpd/ntp_data_structures.c''
+
+ ntpd/ntp_data_structures.c@1.0 +0 -0
+
+ ntpd/ntp_scanner.c@1.1 +638 -0
+ New BitKeeper file ``ntpd/ntp_scanner.c''
+
+ ntpd/ntp_scanner.c@1.0 +0 -0
+
+ChangeSet@1.1440, 2006-12-29 06:43:02-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5P0
+ TAG: NTP_4_2_5P0
+
+ ntpd/ntpd-opts.c@1.49.1.2 +2 -2
+ NTP_4_2_5P0
+
+ ntpd/ntpd-opts.h@1.49.1.2 +3 -3
+ NTP_4_2_5P0
+
+ ntpd/ntpd-opts.texi@1.48.1.2 +1 -1
+ NTP_4_2_5P0
+
+ ntpd/ntpd.1@1.47.1.2 +2 -2
+ NTP_4_2_5P0
+
+ ntpd/ntpdsim-opts.c@1.49.1.2 +2 -2
+ NTP_4_2_5P0
+
+ ntpd/ntpdsim-opts.h@1.49.1.2 +3 -3
+ NTP_4_2_5P0
+
+ ntpd/ntpdsim-opts.texi@1.47.1.2 +1 -1
+ NTP_4_2_5P0
+
+ ntpd/ntpdsim.1@1.47.1.2 +2 -2
+ NTP_4_2_5P0
+
+ ntpdc/ntpdc-opts.c@1.49.1.2 +2 -2
+ NTP_4_2_5P0
+
+ ntpdc/ntpdc-opts.h@1.49.1.2 +3 -3
+ NTP_4_2_5P0
+
+ ntpdc/ntpdc-opts.texi@1.47.1.2 +1 -1
+ NTP_4_2_5P0
+
+ ntpdc/ntpdc.1@1.47.1.2 +2 -2
+ NTP_4_2_5P0
+
+ ntpq/ntpq-opts.c@1.51.1.2 +2 -2
+ NTP_4_2_5P0
+
+ ntpq/ntpq-opts.h@1.51.1.2 +3 -3
+ NTP_4_2_5P0
+
+ ntpq/ntpq-opts.texi@1.48.1.2 +1 -1
+ NTP_4_2_5P0
+
+ ntpq/ntpq.1@1.47.1.2 +2 -2
+ NTP_4_2_5P0
+
+ packageinfo.sh@1.3 +1 -1
+ NTP_4_2_5P0
+
+ sntp/sntp-opts.c@1.48.1.2 +2 -2
+ NTP_4_2_5P0
+
+ sntp/sntp-opts.h@1.48.1.2 +3 -3
+ NTP_4_2_5P0
+
+ sntp/sntp-opts.texi@1.45.1.2 +1 -1
+ NTP_4_2_5P0
+
+ sntp/sntp.1@1.48.1.2 +2 -2
+ NTP_4_2_5P0
+
+ util/ntp-keygen-opts.c@1.48.1.2 +2 -2
+ NTP_4_2_5P0
+
+ util/ntp-keygen-opts.h@1.48.1.2 +3 -3
+ NTP_4_2_5P0
+
+ util/ntp-keygen-opts.texi@1.46.1.2 +1 -1
+ NTP_4_2_5P0
+
+ util/ntp-keygen.1@1.46.1.2 +2 -2
+ NTP_4_2_5P0
+
+ChangeSet@1.1439, 2006-12-28 22:56:08-05:00, stenn@whimsy.udel.edu
+ codec (audio) and ICOM changes from Dave Mills
+
+ NEWS@1.87 +2 -0
+ codec (audio) and ICOM changes from Dave Mills
+
+ include/ntp.h@1.129 +1 -0
+ codec (audio) changes from Dave Mills
+
+ include/ntp_config.h@1.41 +1 -0
+ codec (audio) changes from Dave Mills
+
+ include/ntpd.h@1.98 +1 -0
+ codec (audio) changes from Dave Mills
+
+ libntp/audio.c@1.24 +2 -1
+ codec (audio) and ICOM changes from Dave Mills
+
+ libntp/icom.c@1.10 +33 -218
+ codec (audio) and ICOM changes from Dave Mills
+
+ ntpd/ntp_config.c@1.142 +4 -0
+ codec (audio) and ICOM changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.128 +5 -10
+ codec (audio) and ICOM changes from Dave Mills
+
+ ntpd/refclock_irig.c@1.24 +1 -1
+ codec (audio) and ICOM changes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.67 +45 -54
+ codec (audio) and ICOM changes from Dave Mills
+
+ChangeSet@1.1438, 2006-12-28 21:29:25-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_5
+ TAG: NTP_4_2_5
+
+ ntpd/ntpd-opts.c@1.49.1.1 +2 -2
+ NTP_4_2_5
+
+ ntpd/ntpd-opts.h@1.49.1.1 +3 -3
+ NTP_4_2_5
+
+ ntpd/ntpd-opts.texi@1.48.1.1 +1 -1
+ NTP_4_2_5
+
+ ntpd/ntpd.1@1.47.1.1 +2 -2
+ NTP_4_2_5
+
+ ntpd/ntpdsim-opts.c@1.49.1.1 +2 -2
+ NTP_4_2_5
+
+ ntpd/ntpdsim-opts.h@1.49.1.1 +3 -3
+ NTP_4_2_5
+
+ ntpd/ntpdsim-opts.texi@1.47.1.1 +1 -1
+ NTP_4_2_5
+
+ ntpd/ntpdsim.1@1.47.1.1 +2 -2
+ NTP_4_2_5
+
+ ntpdc/ntpdc-opts.c@1.49.1.1 +2 -2
+ NTP_4_2_5
+
+ ntpdc/ntpdc-opts.h@1.49.1.1 +3 -3
+ NTP_4_2_5
+
+ ntpdc/ntpdc-opts.texi@1.47.1.1 +1 -1
+ NTP_4_2_5
+
+ ntpdc/ntpdc.1@1.47.1.1 +2 -2
+ NTP_4_2_5
+
+ ntpq/ntpq-opts.c@1.51.1.1 +2 -2
+ NTP_4_2_5
+
+ ntpq/ntpq-opts.h@1.51.1.1 +3 -3
+ NTP_4_2_5
+
+ ntpq/ntpq-opts.texi@1.48.1.1 +1 -1
+ NTP_4_2_5
+
+ ntpq/ntpq.1@1.47.1.1 +2 -2
+ NTP_4_2_5
+
+ packageinfo.sh@1.2 +1 -1
+ NTP_4_2_5
+
+ sntp/sntp-opts.c@1.48.1.1 +2 -2
+ NTP_4_2_5
+
+ sntp/sntp-opts.h@1.48.1.1 +3 -3
+ NTP_4_2_5
+
+ sntp/sntp-opts.texi@1.45.1.1 +1 -1
+ NTP_4_2_5
+
+ sntp/sntp.1@1.48.1.1 +2 -2
+ NTP_4_2_5
+
+ util/ntp-keygen-opts.c@1.48.1.1 +2 -2
+ NTP_4_2_5
+
+ util/ntp-keygen-opts.h@1.48.1.1 +3 -3
+ NTP_4_2_5
+
+ util/ntp-keygen-opts.texi@1.46.1.1 +1 -1
+ NTP_4_2_5
+
+ util/ntp-keygen.1@1.46.1.1 +2 -2
+ NTP_4_2_5
+
+ChangeSet@1.1436.1.1, 2006-12-28 19:21:25-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_4
+ TAG: NTP_4_2_4
+
+ ntpd/ntpd-opts.c@1.50 +2 -2
+ NTP_4_2_4
+
+ ntpd/ntpd-opts.h@1.50 +3 -3
+ NTP_4_2_4
+
+ ntpd/ntpd-opts.texi@1.49 +2 -2
+ NTP_4_2_4
+
+ ntpd/ntpd.1@1.48 +2 -2
+ NTP_4_2_4
+
+ ntpd/ntpdsim-opts.c@1.50 +2 -2
+ NTP_4_2_4
+
+ ntpd/ntpdsim-opts.h@1.50 +3 -3
+ NTP_4_2_4
+
+ ntpd/ntpdsim-opts.texi@1.48 +1 -1
+ NTP_4_2_4
+
+ ntpd/ntpdsim.1@1.48 +2 -2
+ NTP_4_2_4
+
+ ntpdc/ntpdc-opts.c@1.50 +2 -2
+ NTP_4_2_4
+
+ ntpdc/ntpdc-opts.h@1.50 +3 -3
+ NTP_4_2_4
+
+ ntpdc/ntpdc-opts.texi@1.48 +2 -2
+ NTP_4_2_4
+
+ ntpdc/ntpdc.1@1.48 +2 -2
+ NTP_4_2_4
+
+ ntpq/ntpq-opts.c@1.52 +2 -2
+ NTP_4_2_4
+
+ ntpq/ntpq-opts.h@1.52 +3 -3
+ NTP_4_2_4
+
+ ntpq/ntpq-opts.texi@1.49 +2 -2
+ NTP_4_2_4
+
+ ntpq/ntpq.1@1.48 +2 -2
+ NTP_4_2_4
+
+ packageinfo.sh@1.65.1.1 +2 -2
+ NTP_4_2_4
+
+ sntp/sntp-opts.c@1.49 +2 -2
+ NTP_4_2_4
+
+ sntp/sntp-opts.h@1.49 +3 -3
+ NTP_4_2_4
+
+ sntp/sntp-opts.texi@1.46 +1 -1
+ NTP_4_2_4
+
+ sntp/sntp.1@1.49 +2 -2
+ NTP_4_2_4
+
+ util/ntp-keygen-opts.c@1.49 +2 -2
+ NTP_4_2_4
+
+ util/ntp-keygen-opts.h@1.49 +3 -3
+ NTP_4_2_4
+
+ util/ntp-keygen-opts.texi@1.47 +2 -2
+ NTP_4_2_4
+
+ util/ntp-keygen.1@1.47 +2 -2
+ NTP_4_2_4
+
+ChangeSet@1.1435.1.1, 2006-12-28 03:20:53-05:00, stenn@whimsy.udel.edu
+ ntp-4.2.5
+
+ BitKeeper/deleted/.del-packageinfo.sh~9547f70d1df81d4@1.64.1.1 +0 -0
+ Delete: packageinfo.sh
+
+ packageinfo.sh@1.1 +28 -0
+ BitKeeper file /deacon/backroom/ntp-dev/packageinfo.sh
+
+ packageinfo.sh@1.0 +0 -0
+
+ChangeSet@1.1436, 2006-12-28 03:09:12-05:00, stenn@whimsy.udel.edu
+ typo
+
+ packageinfo.sh@1.65 +1 -1
+ typo
+
+ChangeSet@1.1435, 2006-12-27 21:17:55-05:00, stenn@whimsy.udel.edu
+ updated backroom machine list
+
+ br-flock@1.11 +1 -1
+ updated backroom machine list
+
+ChangeSet@1.1434, 2006-12-27 20:50:07-05:00, stenn@whimsy.udel.edu
+ ntp-4.2.4
+
+ NEWS@1.86 +3 -2
+ ntp-4.2.4
+
+ packageinfo.sh@1.64 +7 -5
+ ntp-4.2.4
+
+ChangeSet@1.1433, 2006-12-27 02:21:39-05:00, stenn@whimsy.udel.edu
+ monopt.html fixes from Dave Mills.
+
+ NEWS@1.85 +1 -0
+ monopt.html fixes from Dave Mills.
+
+ html/monopt.html@1.23 +2 -2
+ monopt.html fixes from Dave Mills.
+
+ChangeSet@1.1432, 2006-12-27 01:57:20-05:00, stenn@whimsy.udel.edu
+ [Bug 452] Do not report kernel PLL/FLL flips.
+
+ NEWS@1.84 +1 -0
+ [Bug 452] Do not report kernel PLL/FLL flips.
+
+ ntpd/ntp_loopfilter.c@1.127 +5 -7
+ [Bug 452] Do not report kernel PLL/FLL flips.
+
+ChangeSet@1.1431, 2006-12-27 01:45:38-05:00, stenn@whimsy.udel.edu
+ [Bug 746] Expert mouseCLOCK USB v2.0 support added.
+
+ NEWS@1.83 +1 -0
+ [Bug 746] Expert mouseCLOCK USB v2.0 support added.
+
+ChangeSet@1.1429, 2006-12-27 01:37:16-05:00, stenn@whimsy.udel.edu
+ driver8.html updates from Martin Burnicki
+
+ NEWS@1.82 +2 -1
+ driver8.html updates from Martin Burnicki
+
+ChangeSet@1.1426.2.1, 2006-12-27 01:22:30-05:00, stenn@whimsy.udel.edu
+ [Bug 747] Drop <NOBR> tags from ntpdc.html
+
+ NEWS@1.81 +1 -0
+ [Bug 747] Drop <NOBR> tags from ntpdc.html
+
+ html/ntpdc.html@1.26 +3 -3
+ [Bug 747] Drop <NOBR> tags from ntpdc.html
+
+ChangeSet@1.1426.1.1, 2006-12-22 20:35:42+00:00, kardel@pogo.udel.edu
+ driver8.html, refclock_parse.c:
+ Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19
+
+ html/drivers/driver8.html@1.22.1.1 +5 -1
+ Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19
+
+ ntpd/refclock_parse.c@1.47 +34 -3
+ Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19
+
+ChangeSet@1.1427, 2006-12-06 12:18:15+00:00, burnicki@pogo.udel.edu
+ Updated Meinberg PZF509 to PZF511.
+ Provided higher quality pictures with background color according to the web page.
+ Removed borders around images.
+
+ html/drivers/driver8.html@1.23 +5 -5
+ Removed borders around images.
+ Updated Meinberg PZF509 to PZF511.
+
+ html/pic/c51.jpg@1.2 +366 -228
+ Provided higher quality picture with background color according to the web page.
+
+ html/pic/gps167.jpg@1.2 +347 -270
+ Provided higher quality picture with background color according to the web page.
+
+ html/pic/pzf511.jpg@1.3 +453 -290
+ Provided higher quality picture with background color according to the web page.
+
+ html/pic/pzf511.jpg@1.2 +0 -0
+ Rename: html/pic/pzf509.jpg -> html/pic/pzf511.jpg
+
+ChangeSet@1.1426, 2006-11-25 06:41:49-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P70_RC
+ TAG: NTP_4_2_3P70_RC
+
+ ntpd/ntpd-opts.c@1.49 +2 -2
+ NTP_4_2_3P70_RC
+
+ ntpd/ntpd-opts.h@1.49 +3 -3
+ NTP_4_2_3P70_RC
+
+ ntpd/ntpd-opts.texi@1.48 +1 -1
+ NTP_4_2_3P70_RC
+
+ ntpd/ntpd.1@1.47 +2 -2
+ NTP_4_2_3P70_RC
+
+ ntpd/ntpdsim-opts.c@1.49 +2 -2
+ NTP_4_2_3P70_RC
+
+ ntpd/ntpdsim-opts.h@1.49 +3 -3
+ NTP_4_2_3P70_RC
+
+ ntpd/ntpdsim-opts.texi@1.47 +1 -1
+ NTP_4_2_3P70_RC
+
+ ntpd/ntpdsim.1@1.47 +2 -2
+ NTP_4_2_3P70_RC
+
+ ntpdc/ntpdc-opts.c@1.49 +2 -2
+ NTP_4_2_3P70_RC
+
+ ntpdc/ntpdc-opts.h@1.49 +3 -3
+ NTP_4_2_3P70_RC
+
+ ntpdc/ntpdc-opts.texi@1.47 +1 -1
+ NTP_4_2_3P70_RC
+
+ ntpdc/ntpdc.1@1.47 +2 -2
+ NTP_4_2_3P70_RC
+
+ ntpq/ntpq-opts.c@1.51 +2 -2
+ NTP_4_2_3P70_RC
+
+ ntpq/ntpq-opts.h@1.51 +3 -3
+ NTP_4_2_3P70_RC
+
+ ntpq/ntpq-opts.texi@1.48 +1 -1
+ NTP_4_2_3P70_RC
+
+ ntpq/ntpq.1@1.47 +2 -2
+ NTP_4_2_3P70_RC
+
+ packageinfo.sh@1.63 +1 -1
+ NTP_4_2_3P70_RC
+
+ sntp/sntp-opts.c@1.48 +2 -2
+ NTP_4_2_3P70_RC
+
+ sntp/sntp-opts.h@1.48 +3 -3
+ NTP_4_2_3P70_RC
+
+ sntp/sntp-opts.texi@1.45 +1 -1
+ NTP_4_2_3P70_RC
+
+ sntp/sntp.1@1.48 +2 -2
+ NTP_4_2_3P70_RC
+
+ util/ntp-keygen-opts.c@1.48 +2 -2
+ NTP_4_2_3P70_RC
+
+ util/ntp-keygen-opts.h@1.48 +3 -3
+ NTP_4_2_3P70_RC
+
+ util/ntp-keygen-opts.texi@1.46 +1 -1
+ NTP_4_2_3P70_RC
+
+ util/ntp-keygen.1@1.46 +2 -2
+ NTP_4_2_3P70_RC
+
+ChangeSet@1.1425, 2006-11-25 02:31:59-05:00, stenn@whimsy.udel.edu
+ sntp now uses the returned precision to control decimal places
+
+ NEWS@1.80 +1 -0
+ sntp now uses the returned precision to control decimal places
+
+ sntp/main.c@1.8 +29 -16
+ sntp now uses the returned precision to control decimal places
+
+ChangeSet@1.1424, 2006-11-24 06:42:33-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P69_RC
+ TAG: NTP_4_2_3P69_RC
+
+ ntpd/ntpd-opts.c@1.48 +2 -2
+ NTP_4_2_3P69_RC
+
+ ntpd/ntpd-opts.h@1.48 +3 -3
+ NTP_4_2_3P69_RC
+
+ ntpd/ntpd-opts.texi@1.47 +1 -1
+ NTP_4_2_3P69_RC
+
+ ntpd/ntpd.1@1.46 +2 -2
+ NTP_4_2_3P69_RC
+
+ ntpd/ntpdsim-opts.c@1.48 +2 -2
+ NTP_4_2_3P69_RC
+
+ ntpd/ntpdsim-opts.h@1.48 +3 -3
+ NTP_4_2_3P69_RC
+
+ ntpd/ntpdsim-opts.texi@1.46 +1 -1
+ NTP_4_2_3P69_RC
+
+ ntpd/ntpdsim.1@1.46 +2 -2
+ NTP_4_2_3P69_RC
+
+ ntpdc/ntpdc-opts.c@1.48 +2 -2
+ NTP_4_2_3P69_RC
+
+ ntpdc/ntpdc-opts.h@1.48 +3 -3
+ NTP_4_2_3P69_RC
+
+ ntpdc/ntpdc-opts.texi@1.46 +1 -1
+ NTP_4_2_3P69_RC
+
+ ntpdc/ntpdc.1@1.46 +2 -2
+ NTP_4_2_3P69_RC
+
+ ntpq/ntpq-opts.c@1.50 +2 -2
+ NTP_4_2_3P69_RC
+
+ ntpq/ntpq-opts.h@1.50 +3 -3
+ NTP_4_2_3P69_RC
+
+ ntpq/ntpq-opts.texi@1.47 +1 -1
+ NTP_4_2_3P69_RC
+
+ ntpq/ntpq.1@1.46 +2 -2
+ NTP_4_2_3P69_RC
+
+ packageinfo.sh@1.62 +1 -1
+ NTP_4_2_3P69_RC
+
+ sntp/sntp-opts.c@1.47 +34 -13
+ NTP_4_2_3P69_RC
+
+ sntp/sntp-opts.h@1.47 +21 -14
+ NTP_4_2_3P69_RC
+
+ sntp/sntp-opts.texi@1.44 +9 -1
+ NTP_4_2_3P69_RC
+
+ sntp/sntp.1@1.47 +8 -64
+ NTP_4_2_3P69_RC
+
+ util/ntp-keygen-opts.c@1.47 +2 -2
+ NTP_4_2_3P69_RC
+
+ util/ntp-keygen-opts.h@1.47 +3 -3
+ NTP_4_2_3P69_RC
+
+ util/ntp-keygen-opts.texi@1.45 +1 -1
+ NTP_4_2_3P69_RC
+
+ util/ntp-keygen.1@1.45 +2 -2
+ NTP_4_2_3P69_RC
+
+ChangeSet@1.1423, 2006-11-23 21:09:08-05:00, stenn@whimsy.udel.edu
+ sntp -u will use an unprivileged port for its queries
+
+ NEWS@1.79 +1 -0
+ sntp -u will use an unprivileged port for its queries
+
+ sntp/main.c@1.7 +13 -2
+ sntp -u will use an unprivileged port for its queries
+
+ sntp/sntp-opts.def@1.10 +10 -62
+ sntp -u will use an unprivileged port for its queries
+
+ sntp/socket.c@1.8 +4 -2
+ sntp -u will use an unprivileged port for its queries
+
+ChangeSet@1.1422, 2006-11-22 06:42:29-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P68_RC
+ TAG: NTP_4_2_3P68_RC
+
+ ntpd/ntpd-opts.c@1.47 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpd/ntpd-opts.h@1.47 +3 -3
+ NTP_4_2_3P68_RC
+
+ ntpd/ntpd-opts.texi@1.46 +3 -3
+ NTP_4_2_3P68_RC
+
+ ntpd/ntpd.1@1.45 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpd/ntpdsim-opts.c@1.47 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpd/ntpdsim-opts.h@1.47 +3 -3
+ NTP_4_2_3P68_RC
+
+ ntpd/ntpdsim-opts.texi@1.45 +1 -1
+ NTP_4_2_3P68_RC
+
+ ntpd/ntpdsim.1@1.45 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpdc/ntpdc-opts.c@1.47 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpdc/ntpdc-opts.h@1.47 +3 -3
+ NTP_4_2_3P68_RC
+
+ ntpdc/ntpdc-opts.texi@1.45 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpdc/ntpdc.1@1.45 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpq/ntpq-opts.c@1.49 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpq/ntpq-opts.h@1.49 +3 -3
+ NTP_4_2_3P68_RC
+
+ ntpq/ntpq-opts.texi@1.46 +2 -2
+ NTP_4_2_3P68_RC
+
+ ntpq/ntpq.1@1.45 +2 -2
+ NTP_4_2_3P68_RC
+
+ packageinfo.sh@1.61 +1 -1
+ NTP_4_2_3P68_RC
+
+ sntp/sntp-opts.c@1.46 +2 -2
+ NTP_4_2_3P68_RC
+
+ sntp/sntp-opts.h@1.46 +3 -3
+ NTP_4_2_3P68_RC
+
+ sntp/sntp-opts.texi@1.43 +1 -1
+ NTP_4_2_3P68_RC
+
+ sntp/sntp.1@1.46 +2 -2
+ NTP_4_2_3P68_RC
+
+ util/ntp-keygen-opts.c@1.46 +2 -2
+ NTP_4_2_3P68_RC
+
+ util/ntp-keygen-opts.h@1.46 +3 -3
+ NTP_4_2_3P68_RC
+
+ util/ntp-keygen-opts.texi@1.44 +2 -2
+ NTP_4_2_3P68_RC
+
+ util/ntp-keygen.1@1.44 +2 -2
+ NTP_4_2_3P68_RC
+
+ChangeSet@1.1421, 2006-11-22 02:15:14-05:00, stenn@whimsy.udel.edu
+ [Bug 741] 'burst' doesn't work with peers
+
+ NEWS@1.78 +1 -0
+ [Bug 741] 'burst' doesn't work with !unfit peers
+
+ ntpd/ntp_proto.c@1.249 +1 -1
+ [Bug 741] 'burst' doesn't work with !unfit peers
+
+ChangeSet@1.1420, 2006-11-21 23:53:23-05:00, stenn@whimsy.udel.edu
+ [Bug 735] Fix a make/gmake VPATH issue on Solaris
+
+ Makefile.am@1.70 +1 -1
+ [Bug 735] Fix a make/gmake VPATH issue on Solaris
+
+ NEWS@1.77 +1 -0
+ [Bug 735] Fix a make/gmake VPATH issue on Solaris
+
+ChangeSet@1.1419, 2006-11-21 06:42:26-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P67_RC
+ TAG: NTP_4_2_3P67_RC
+
+ ntpd/ntpd-opts.c@1.46 +3 -4
+ NTP_4_2_3P67_RC
+
+ ntpd/ntpd-opts.h@1.46 +3 -3
+ NTP_4_2_3P67_RC
+
+ ntpd/ntpd-opts.texi@1.45 +1 -1
+ NTP_4_2_3P67_RC
+
+ ntpd/ntpd.1@1.44 +3 -3
+ NTP_4_2_3P67_RC
+
+ ntpd/ntpdsim-opts.c@1.46 +3 -4
+ NTP_4_2_3P67_RC
+
+ ntpd/ntpdsim-opts.h@1.46 +3 -3
+ NTP_4_2_3P67_RC
+
+ ntpd/ntpdsim-opts.texi@1.44 +1 -1
+ NTP_4_2_3P67_RC
+
+ ntpd/ntpdsim.1@1.44 +3 -3
+ NTP_4_2_3P67_RC
+
+ ntpdc/ntpdc-opts.c@1.46 +2 -2
+ NTP_4_2_3P67_RC
+
+ ntpdc/ntpdc-opts.h@1.46 +3 -3
+ NTP_4_2_3P67_RC
+
+ ntpdc/ntpdc-opts.texi@1.44 +1 -1
+ NTP_4_2_3P67_RC
+
+ ntpdc/ntpdc.1@1.44 +2 -2
+ NTP_4_2_3P67_RC
+
+ ntpq/ntpq-opts.c@1.48 +2 -2
+ NTP_4_2_3P67_RC
+
+ ntpq/ntpq-opts.h@1.48 +3 -3
+ NTP_4_2_3P67_RC
+
+ ntpq/ntpq-opts.texi@1.45 +1 -1
+ NTP_4_2_3P67_RC
+
+ ntpq/ntpq.1@1.44 +2 -2
+ NTP_4_2_3P67_RC
+
+ packageinfo.sh@1.60 +1 -1
+ NTP_4_2_3P67_RC
+
+ sntp/sntp-opts.c@1.45 +2 -2
+ NTP_4_2_3P67_RC
+
+ sntp/sntp-opts.h@1.45 +3 -3
+ NTP_4_2_3P67_RC
+
+ sntp/sntp-opts.texi@1.42 +1 -1
+ NTP_4_2_3P67_RC
+
+ sntp/sntp.1@1.45 +2 -2
+ NTP_4_2_3P67_RC
+
+ util/ntp-keygen-opts.c@1.45 +2 -2
+ NTP_4_2_3P67_RC
+
+ util/ntp-keygen-opts.h@1.45 +3 -3
+ NTP_4_2_3P67_RC
+
+ util/ntp-keygen-opts.texi@1.43 +1 -1
+ NTP_4_2_3P67_RC
+
+ util/ntp-keygen.1@1.43 +2 -2
+ NTP_4_2_3P67_RC
+
+ChangeSet@1.1418, 2006-11-21 09:35:31+00:00, burnicki@pogo.udel.edu
+ Fixed an uppercase typo.
+
+ html/drivers/driver8.html@1.22 +1 -1
+ Fixed an uppercase typo.
+
+ChangeSet@1.1417, 2006-11-21 02:43:36-05:00, stenn@whimsy.udel.edu
+ [Bug 717] Make sure sntp/*version.def is up-to-date
+
+ bootstrap@1.18 +5 -0
+ [Bug 717] Make sure sntp/*version.def is up-to-date
+
+ChangeSet@1.1416, 2006-11-20 23:05:54-05:00, stenn@whimsy.udel.edu
+ [Bug 739] ntpd -x should not take an argument
+
+ NEWS@1.76 +1 -0
+ [Bug 739] ntpd -x should not take an argument
+
+ ntpd/ntpdbase-opts.def@1.10 +0 -1
+ [Bug 739] ntpd -x should not take an argument
+
+ChangeSet@1.1415, 2006-11-19 06:45:35-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P66_RC
+ TAG: NTP_4_2_3P66_RC
+
+ ntpd/ntpd-opts.c@1.45 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpd/ntpd-opts.h@1.45 +3 -3
+ NTP_4_2_3P66_RC
+
+ ntpd/ntpd-opts.texi@1.44 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpd/ntpd.1@1.43 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpd/ntpdsim-opts.c@1.45 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpd/ntpdsim-opts.h@1.45 +3 -3
+ NTP_4_2_3P66_RC
+
+ ntpd/ntpdsim-opts.texi@1.43 +1 -1
+ NTP_4_2_3P66_RC
+
+ ntpd/ntpdsim.1@1.43 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpdc/ntpdc-opts.c@1.45 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpdc/ntpdc-opts.h@1.45 +3 -3
+ NTP_4_2_3P66_RC
+
+ ntpdc/ntpdc-opts.texi@1.43 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpdc/ntpdc.1@1.43 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpq/ntpq-opts.c@1.47 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpq/ntpq-opts.h@1.47 +3 -3
+ NTP_4_2_3P66_RC
+
+ ntpq/ntpq-opts.texi@1.44 +2 -2
+ NTP_4_2_3P66_RC
+
+ ntpq/ntpq.1@1.43 +2 -2
+ NTP_4_2_3P66_RC
+
+ packageinfo.sh@1.59 +1 -1
+ NTP_4_2_3P66_RC
+
+ sntp/sntp-opts.c@1.44 +2 -2
+ NTP_4_2_3P66_RC
+
+ sntp/sntp-opts.h@1.44 +3 -3
+ NTP_4_2_3P66_RC
+
+ sntp/sntp-opts.texi@1.41 +1 -1
+ NTP_4_2_3P66_RC
+
+ sntp/sntp.1@1.44 +2 -2
+ NTP_4_2_3P66_RC
+
+ util/ntp-keygen-opts.c@1.44 +2 -2
+ NTP_4_2_3P66_RC
+
+ util/ntp-keygen-opts.h@1.44 +3 -3
+ NTP_4_2_3P66_RC
+
+ util/ntp-keygen-opts.texi@1.42 +2 -2
+ NTP_4_2_3P66_RC
+
+ util/ntp-keygen.1@1.42 +2 -2
+ NTP_4_2_3P66_RC
+
+ChangeSet@1.1412.1.1, 2006-11-18 21:12:41-08:00, harlan@minnie.everett.org
+ * [Bug 737] Some systems need help providing struct iovec.
+
+ NEWS@1.75 +1 -0
+ * [Bug 737] Some systems need help providing struct iovec.
+
+ configure.ac@1.400 +44 -0
+ * [Bug 737] Some systems need help providing struct iovec.
+
+ ntpd/ntp_io.c@1.244 +3 -0
+ * [Bug 737] Some systems need help providing struct iovec.
+
+ChangeSet@1.1413, 2006-11-17 08:59:50+00:00, burnicki@pogo.udel.edu
+ [Bug #728] More changes by Paul and Martin.
+
+ html/drivers/driver8.html@1.21 +93 -44
+ More changes by Paul and Martin.
+
+ChangeSet@1.1412, 2006-11-10 06:41:45-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P65_RC
+ TAG: NTP_4_2_3P65_RC
+
+ ntpd/ntpd-opts.c@1.44 +2 -2
+ NTP_4_2_3P65_RC
+
+ ntpd/ntpd-opts.h@1.44 +3 -3
+ NTP_4_2_3P65_RC
+
+ ntpd/ntpd-opts.texi@1.43 +1 -1
+ NTP_4_2_3P65_RC
+
+ ntpd/ntpd.1@1.42 +2 -2
+ NTP_4_2_3P65_RC
+
+ ntpd/ntpdsim-opts.c@1.44 +2 -2
+ NTP_4_2_3P65_RC
+
+ ntpd/ntpdsim-opts.h@1.44 +3 -3
+ NTP_4_2_3P65_RC
+
+ ntpd/ntpdsim-opts.texi@1.42 +1 -1
+ NTP_4_2_3P65_RC
+
+ ntpd/ntpdsim.1@1.42 +2 -2
+ NTP_4_2_3P65_RC
+
+ ntpdc/ntpdc-opts.c@1.44 +2 -2
+ NTP_4_2_3P65_RC
+
+ ntpdc/ntpdc-opts.h@1.44 +3 -3
+ NTP_4_2_3P65_RC
+
+ ntpdc/ntpdc-opts.texi@1.42 +1 -1
+ NTP_4_2_3P65_RC
+
+ ntpdc/ntpdc.1@1.42 +2 -2
+ NTP_4_2_3P65_RC
+
+ ntpq/ntpq-opts.c@1.46 +2 -2
+ NTP_4_2_3P65_RC
+
+ ntpq/ntpq-opts.h@1.46 +3 -3
+ NTP_4_2_3P65_RC
+
+ ntpq/ntpq-opts.texi@1.43 +1 -1
+ NTP_4_2_3P65_RC
+
+ ntpq/ntpq.1@1.42 +2 -2
+ NTP_4_2_3P65_RC
+
+ packageinfo.sh@1.58 +1 -1
+ NTP_4_2_3P65_RC
+
+ sntp/sntp-opts.c@1.43 +2 -2
+ NTP_4_2_3P65_RC
+
+ sntp/sntp-opts.h@1.43 +3 -3
+ NTP_4_2_3P65_RC
+
+ sntp/sntp-opts.texi@1.40 +1 -1
+ NTP_4_2_3P65_RC
+
+ sntp/sntp.1@1.43 +2 -2
+ NTP_4_2_3P65_RC
+
+ util/ntp-keygen-opts.c@1.43 +2 -2
+ NTP_4_2_3P65_RC
+
+ util/ntp-keygen-opts.h@1.43 +3 -3
+ NTP_4_2_3P65_RC
+
+ util/ntp-keygen-opts.texi@1.41 +1 -1
+ NTP_4_2_3P65_RC
+
+ util/ntp-keygen.1@1.41 +2 -2
+ NTP_4_2_3P65_RC
+
+ChangeSet@1.1411, 2006-11-10 00:24:06-05:00, stenn@whimsy.udel.edu
+ [Bug 717] Fix libopts compile problem for some windows versions
+
+ NEWS@1.74 +1 -1
+ [Bug 717] Fix libopts compile problem for some windows versions
+
+ChangeSet@1.1398.1.1, 2006-11-09 22:57:09-05:00, mayer@pogo.udel.edu
+ Bug #717 Add uintptr_t typedef for VS 6.0
+
+ ports/winnt/include/config.h@1.46 +7 -0
+ Bug #717 Add uintptr_t typedef for VS 6.0
+
+ChangeSet@1.1409, 2006-11-09 06:42:28-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P64_RC
+ TAG: NTP_4_2_3P64_RC
+
+ ntpd/ntpd-opts.c@1.43 +2 -2
+ NTP_4_2_3P64_RC
+
+ ntpd/ntpd-opts.h@1.43 +3 -3
+ NTP_4_2_3P64_RC
+
+ ntpd/ntpd-opts.texi@1.42 +1 -1
+ NTP_4_2_3P64_RC
+
+ ntpd/ntpd.1@1.41 +2 -2
+ NTP_4_2_3P64_RC
+
+ ntpd/ntpdsim-opts.c@1.43 +2 -2
+ NTP_4_2_3P64_RC
+
+ ntpd/ntpdsim-opts.h@1.43 +3 -3
+ NTP_4_2_3P64_RC
+
+ ntpd/ntpdsim-opts.texi@1.41 +1 -1
+ NTP_4_2_3P64_RC
+
+ ntpd/ntpdsim.1@1.41 +2 -2
+ NTP_4_2_3P64_RC
+
+ ntpdc/ntpdc-opts.c@1.43 +2 -2
+ NTP_4_2_3P64_RC
+
+ ntpdc/ntpdc-opts.h@1.43 +3 -3
+ NTP_4_2_3P64_RC
+
+ ntpdc/ntpdc-opts.texi@1.41 +1 -1
+ NTP_4_2_3P64_RC
+
+ ntpdc/ntpdc.1@1.41 +2 -2
+ NTP_4_2_3P64_RC
+
+ ntpq/ntpq-opts.c@1.45 +2 -2
+ NTP_4_2_3P64_RC
+
+ ntpq/ntpq-opts.h@1.45 +3 -3
+ NTP_4_2_3P64_RC
+
+ ntpq/ntpq-opts.texi@1.42 +1 -1
+ NTP_4_2_3P64_RC
+
+ ntpq/ntpq.1@1.41 +2 -2
+ NTP_4_2_3P64_RC
+
+ packageinfo.sh@1.57 +1 -1
+ NTP_4_2_3P64_RC
+
+ sntp/sntp-opts.c@1.42 +2 -2
+ NTP_4_2_3P64_RC
+
+ sntp/sntp-opts.h@1.42 +3 -3
+ NTP_4_2_3P64_RC
+
+ sntp/sntp-opts.texi@1.39 +1 -1
+ NTP_4_2_3P64_RC
+
+ sntp/sntp.1@1.42 +2 -2
+ NTP_4_2_3P64_RC
+
+ util/ntp-keygen-opts.c@1.42 +2 -2
+ NTP_4_2_3P64_RC
+
+ util/ntp-keygen-opts.h@1.42 +3 -3
+ NTP_4_2_3P64_RC
+
+ util/ntp-keygen-opts.texi@1.40 +1 -1
+ NTP_4_2_3P64_RC
+
+ util/ntp-keygen.1@1.40 +2 -2
+ NTP_4_2_3P64_RC
+
+ChangeSet@1.1408, 2006-11-09 04:29:07-05:00, stenn@whimsy.udel.edu
+ [Bug 728] parse documentation fixes
+
+ NEWS@1.73 +1 -0
+ [Bug 728] parse documentation fixes
+
+ChangeSet@1.1407, 2006-11-08 18:11:25+00:00, burnicki@pogo.udel.edu
+ [Bug #728] Typo fixes submitted by Paul Croome plus additional updates and fixes for driver8.html and parsedata.html.
+
+ html/drivers/driver8.html@1.20 +127 -136
+ Typo fixes submitted by Paul Croome.
+ Updated docs and links.
+
+ html/parsedata.html@1.12 +92 -80
+ Updated docs and fixed some errors.
+
+ChangeSet@1.1406, 2006-11-06 06:47:05-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P63_RC
+ TAG: NTP_4_2_3P63_RC
+
+ ntpd/ntpd-opts.c@1.42 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpd/ntpd-opts.h@1.42 +3 -3
+ NTP_4_2_3P63_RC
+
+ ntpd/ntpd-opts.texi@1.41 +2 -4
+ NTP_4_2_3P63_RC
+
+ ntpd/ntpd.1@1.40 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpd/ntpdsim-opts.c@1.42 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpd/ntpdsim-opts.h@1.42 +3 -3
+ NTP_4_2_3P63_RC
+
+ ntpd/ntpdsim-opts.texi@1.40 +2 -73
+ NTP_4_2_3P63_RC
+
+ ntpd/ntpdsim.1@1.40 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpdc/ntpdc-opts.c@1.42 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpdc/ntpdc-opts.h@1.42 +3 -3
+ NTP_4_2_3P63_RC
+
+ ntpdc/ntpdc-opts.texi@1.40 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpdc/ntpdc.1@1.40 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpq/ntpq-opts.c@1.44 +2 -2
+ NTP_4_2_3P63_RC
+
+ ntpq/ntpq-opts.h@1.44 +3 -3
+ NTP_4_2_3P63_RC
+
+ ntpq/ntpq-opts.texi@1.41 +4 -244
+ NTP_4_2_3P63_RC
+
+ ntpq/ntpq.1@1.40 +2 -2
+ NTP_4_2_3P63_RC
+
+ packageinfo.sh@1.56 +1 -1
+ NTP_4_2_3P63_RC
+
+ sntp/sntp-opts.c@1.41 +2 -2
+ NTP_4_2_3P63_RC
+
+ sntp/sntp-opts.h@1.41 +3 -3
+ NTP_4_2_3P63_RC
+
+ sntp/sntp-opts.texi@1.38 +1 -1
+ NTP_4_2_3P63_RC
+
+ sntp/sntp.1@1.41 +2 -2
+ NTP_4_2_3P63_RC
+
+ util/ntp-keygen-opts.c@1.41 +2 -2
+ NTP_4_2_3P63_RC
+
+ util/ntp-keygen-opts.h@1.41 +3 -3
+ NTP_4_2_3P63_RC
+
+ util/ntp-keygen-opts.texi@1.39 +2 -2
+ NTP_4_2_3P63_RC
+
+ util/ntp-keygen.1@1.39 +2 -2
+ NTP_4_2_3P63_RC
+
+ChangeSet@1.1405, 2006-11-06 03:11:36-05:00, stenn@whimsy.udel.edu
+ [Bug 734] setsockopt(..., IP_MULTICAST_IF, ...) fails on 64-bit platforms.
+
+ NEWS@1.72 +1 -0
+ [Bug 734] setsockopt(..., IP_MULTICAST_IF, ...) fails on 64-bit platforms.
+
+ChangeSet@1.1404, 2006-11-06 03:06:37-05:00, stenn@whimsy.udel.edu
+ Build our libopts by default (static, and without installing it
+
+ configure.ac@1.399 +17 -0
+ Build our libopts by default (static, and without installing it
+
+ sntp/configure.ac@1.15 +18 -0
+ Build our libopts by default (static, and without installing it
+
+ChangeSet@1.1400.1.1, 2006-11-06 02:51:53-05:00, stenn@whimsy.udel.edu
+ [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu
+
+ NEWS@1.71 +1 -0
+ [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu
+
+ ntpd/refclock_jjy.c@1.13 +5 -0
+ [Bug 732] C-DEX JST2000 patch from Hideo Kuramatsu
+
+ChangeSet@1.1402, 2006-11-05 08:28:53+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ pass correct address length for setsockopt(..., IP_MULTICAST_IF, ...)
+ (sizeof(struct sockaddr_in*) != sizeof(struct in_addr) on 64-bit platforms)
+
+ ntpd/ntp_io.c@1.243 +1 -1
+ pass correct address length for setsockopt(..., IP_MULTICAST_IF, ...)
+ (sizeof(struct sockaddr_in*) != sizeof(struct in_addr) on 64 bite platforms)
+
+ChangeSet@1.1400, 2006-11-01 06:45:21-05:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P62_RC
+ TAG: NTP_4_2_3P62_RC
+
+ ntpd/ntpd-opts.c@1.41 +2 -2
+ NTP_4_2_3P62_RC
+
+ ntpd/ntpd-opts.h@1.41 +3 -3
+ NTP_4_2_3P62_RC
+
+ ntpd/ntpd-opts.texi@1.40 +1 -1
+ NTP_4_2_3P62_RC
+
+ ntpd/ntpd.1@1.39 +2 -2
+ NTP_4_2_3P62_RC
+
+ ntpd/ntpdsim-opts.c@1.41 +2 -2
+ NTP_4_2_3P62_RC
+
+ ntpd/ntpdsim-opts.h@1.41 +3 -3
+ NTP_4_2_3P62_RC
+
+ ntpd/ntpdsim-opts.texi@1.39 +1 -1
+ NTP_4_2_3P62_RC
+
+ ntpd/ntpdsim.1@1.39 +2 -2
+ NTP_4_2_3P62_RC
+
+ ntpdc/ntpdc-opts.c@1.41 +2 -2
+ NTP_4_2_3P62_RC
+
+ ntpdc/ntpdc-opts.h@1.41 +3 -3
+ NTP_4_2_3P62_RC
+
+ ntpdc/ntpdc-opts.texi@1.39 +1 -1
+ NTP_4_2_3P62_RC
+
+ ntpdc/ntpdc.1@1.39 +2 -2
+ NTP_4_2_3P62_RC
+
+ ntpq/ntpq-opts.c@1.43 +2 -2
+ NTP_4_2_3P62_RC
+
+ ntpq/ntpq-opts.h@1.43 +3 -3
+ NTP_4_2_3P62_RC
+
+ ntpq/ntpq-opts.texi@1.40 +1 -1
+ NTP_4_2_3P62_RC
+
+ ntpq/ntpq.1@1.39 +2 -2
+ NTP_4_2_3P62_RC
+
+ packageinfo.sh@1.55 +1 -1
+ NTP_4_2_3P62_RC
+
+ sntp/sntp-opts.c@1.40 +2 -2
+ NTP_4_2_3P62_RC
+
+ sntp/sntp-opts.h@1.40 +3 -3
+ NTP_4_2_3P62_RC
+
+ sntp/sntp-opts.texi@1.37 +1 -1
+ NTP_4_2_3P62_RC
+
+ sntp/sntp.1@1.40 +2 -2
+ NTP_4_2_3P62_RC
+
+ util/ntp-keygen-opts.c@1.40 +2 -2
+ NTP_4_2_3P62_RC
+
+ util/ntp-keygen-opts.h@1.40 +3 -3
+ NTP_4_2_3P62_RC
+
+ util/ntp-keygen-opts.texi@1.38 +1 -1
+ NTP_4_2_3P62_RC
+
+ util/ntp-keygen.1@1.38 +2 -2
+ NTP_4_2_3P62_RC
+
+ChangeSet@1.1399, 2006-10-31 23:58:45-05:00, stenn@whimsy.udel.edu
+ [Bug 721] check for __ss_family and __ss_len separately
+
+ NEWS@1.70 +1 -0
+ [Bug 721] check for __ss_family and __ss_len separately
+
+ configure.ac@1.398 +41 -2
+ [Bug 721] check for __ss_family and __ss_len separately
+
+ChangeSet@1.1379.13.1, 2006-10-30 07:24:38-05:00, mayer@pogo.udel.edu
+ Bug #695 Fix to turn off Option warnings for VS 2005
+
+ ports/winnt/include/config.h@1.45 +1 -0
+ Bug #695 Fix to turn off Option warnings for VS 2005
+
+ChangeSet@1.1397, 2006-10-23 07:48:24-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P61_RC
+ TAG: NTP_4_2_3P61_RC
+
+ ntpd/ntpd-opts.c@1.40 +2 -2
+ NTP_4_2_3P61_RC
+
+ ntpd/ntpd-opts.h@1.40 +3 -3
+ NTP_4_2_3P61_RC
+
+ ntpd/ntpd-opts.texi@1.39 +1 -1
+ NTP_4_2_3P61_RC
+
+ ntpd/ntpd.1@1.38 +2 -2
+ NTP_4_2_3P61_RC
+
+ ntpd/ntpdsim-opts.c@1.40 +2 -2
+ NTP_4_2_3P61_RC
+
+ ntpd/ntpdsim-opts.h@1.40 +3 -3
+ NTP_4_2_3P61_RC
+
+ ntpd/ntpdsim-opts.texi@1.38 +1 -1
+ NTP_4_2_3P61_RC
+
+ ntpd/ntpdsim.1@1.38 +2 -2
+ NTP_4_2_3P61_RC
+
+ ntpdc/ntpdc-opts.c@1.40 +2 -2
+ NTP_4_2_3P61_RC
+
+ ntpdc/ntpdc-opts.h@1.40 +3 -3
+ NTP_4_2_3P61_RC
+
+ ntpdc/ntpdc-opts.texi@1.38 +1 -1
+ NTP_4_2_3P61_RC
+
+ ntpdc/ntpdc.1@1.38 +2 -2
+ NTP_4_2_3P61_RC
+
+ ntpq/ntpq-opts.c@1.42 +2 -2
+ NTP_4_2_3P61_RC
+
+ ntpq/ntpq-opts.h@1.42 +3 -3
+ NTP_4_2_3P61_RC
+
+ ntpq/ntpq-opts.texi@1.39 +1 -1
+ NTP_4_2_3P61_RC
+
+ ntpq/ntpq.1@1.38 +2 -2
+ NTP_4_2_3P61_RC
+
+ packageinfo.sh@1.54 +1 -1
+ NTP_4_2_3P61_RC
+
+ sntp/sntp-opts.c@1.39 +2 -2
+ NTP_4_2_3P61_RC
+
+ sntp/sntp-opts.h@1.39 +3 -3
+ NTP_4_2_3P61_RC
+
+ sntp/sntp-opts.texi@1.36 +1 -1
+ NTP_4_2_3P61_RC
+
+ sntp/sntp.1@1.39 +2 -2
+ NTP_4_2_3P61_RC
+
+ util/ntp-keygen-opts.c@1.39 +2 -2
+ NTP_4_2_3P61_RC
+
+ util/ntp-keygen-opts.h@1.39 +3 -3
+ NTP_4_2_3P61_RC
+
+ util/ntp-keygen-opts.texi@1.37 +1 -1
+ NTP_4_2_3P61_RC
+
+ util/ntp-keygen.1@1.37 +2 -2
+ NTP_4_2_3P61_RC
+
+ChangeSet@1.1395, 2006-10-23 00:38:50-04:00, stenn@pogo.udel.edu
+ [Bug 666] ntpq opeers displays jitter rather than dispersion
+
+ NEWS@1.69 +1 -0
+ [Bug 666] ntpq opeers displays jitter rather than dispersion
+
+ ntpq/ntpq-subs.c@1.25 +3 -2
+ [Bug 666] ntpq opeers displays jitter rather than dispersion
+
+ChangeSet@1.1379.12.3, 2006-10-20 07:45:30-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P60_RC
+ TAG: NTP_4_2_3P60_RC
+
+ ntpd/ntpd-opts.c@1.39 +2 -2
+ NTP_4_2_3P60_RC
+
+ ntpd/ntpd-opts.h@1.39 +3 -3
+ NTP_4_2_3P60_RC
+
+ ntpd/ntpd-opts.texi@1.38 +1 -1
+ NTP_4_2_3P60_RC
+
+ ntpd/ntpd.1@1.37 +2 -2
+ NTP_4_2_3P60_RC
+
+ ntpd/ntpdsim-opts.c@1.39 +2 -2
+ NTP_4_2_3P60_RC
+
+ ntpd/ntpdsim-opts.h@1.39 +3 -3
+ NTP_4_2_3P60_RC
+
+ ntpd/ntpdsim-opts.texi@1.37 +1 -1
+ NTP_4_2_3P60_RC
+
+ ntpd/ntpdsim.1@1.37 +2 -2
+ NTP_4_2_3P60_RC
+
+ ntpdc/ntpdc-opts.c@1.39 +2 -2
+ NTP_4_2_3P60_RC
+
+ ntpdc/ntpdc-opts.h@1.39 +3 -3
+ NTP_4_2_3P60_RC
+
+ ntpdc/ntpdc-opts.texi@1.37 +1 -1
+ NTP_4_2_3P60_RC
+
+ ntpdc/ntpdc.1@1.37 +2 -2
+ NTP_4_2_3P60_RC
+
+ ntpq/ntpq-opts.c@1.41 +2 -2
+ NTP_4_2_3P60_RC
+
+ ntpq/ntpq-opts.h@1.41 +3 -3
+ NTP_4_2_3P60_RC
+
+ ntpq/ntpq-opts.texi@1.38 +1 -1
+ NTP_4_2_3P60_RC
+
+ ntpq/ntpq.1@1.37 +2 -2
+ NTP_4_2_3P60_RC
+
+ packageinfo.sh@1.53 +1 -1
+ NTP_4_2_3P60_RC
+
+ sntp/sntp-opts.c@1.38 +2 -2
+ NTP_4_2_3P60_RC
+
+ sntp/sntp-opts.h@1.38 +3 -3
+ NTP_4_2_3P60_RC
+
+ sntp/sntp-opts.texi@1.35 +1 -1
+ NTP_4_2_3P60_RC
+
+ sntp/sntp.1@1.38 +2 -2
+ NTP_4_2_3P60_RC
+
+ util/ntp-keygen-opts.c@1.38 +2 -2
+ NTP_4_2_3P60_RC
+
+ util/ntp-keygen-opts.h@1.38 +3 -3
+ NTP_4_2_3P60_RC
+
+ util/ntp-keygen-opts.texi@1.36 +1 -1
+ NTP_4_2_3P60_RC
+
+ util/ntp-keygen.1@1.36 +2 -2
+ NTP_4_2_3P60_RC
+
+ChangeSet@1.1379.12.2, 2006-10-20 00:49:41-04:00, stenn@whimsy.udel.edu
+ 4.2.4 Release Candidate
+
+ packageinfo.sh@1.52 +2 -2
+ 4.2.4 Release Candidate
+
+ChangeSet@1.1379.12.1, 2006-10-20 00:44:54-04:00, stenn@whimsy.udel.edu
+ refclock_wwv.c fix from Dave Mills
+
+ ntpd/refclock_wwv.c@1.66 +3 -0
+ refclock_wwv.c fix from Dave Mills
+
+ChangeSet@1.1379.1.53, 2006-10-15 14:25:15+00:00, kardel@pogo.udel.edu
+ dcfd.c:
+ cope with cases where sa_sigaction and sa_handler are in a union
+
+ parseutil/dcfd.c@1.19 +1 -1
+ cope with cases where sa_sigaction and sa_handler are in a union
+
+ChangeSet@1.1379.1.52, 2006-10-15 07:42:15-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P59
+ TAG: NTP_4_2_3P59
+
+ ntpd/ntpd-opts.c@1.38 +2 -2
+ NTP_4_2_3P59
+
+ ntpd/ntpd-opts.h@1.38 +3 -3
+ NTP_4_2_3P59
+
+ ntpd/ntpd-opts.texi@1.37 +1 -1
+ NTP_4_2_3P59
+
+ ntpd/ntpd.1@1.36 +2 -2
+ NTP_4_2_3P59
+
+ ntpd/ntpdsim-opts.c@1.38 +2 -2
+ NTP_4_2_3P59
+
+ ntpd/ntpdsim-opts.h@1.38 +3 -3
+ NTP_4_2_3P59
+
+ ntpd/ntpdsim-opts.texi@1.36 +1 -1
+ NTP_4_2_3P59
+
+ ntpd/ntpdsim.1@1.36 +2 -2
+ NTP_4_2_3P59
+
+ ntpdc/ntpdc-opts.c@1.38 +2 -2
+ NTP_4_2_3P59
+
+ ntpdc/ntpdc-opts.h@1.38 +3 -3
+ NTP_4_2_3P59
+
+ ntpdc/ntpdc-opts.texi@1.36 +1 -1
+ NTP_4_2_3P59
+
+ ntpdc/ntpdc.1@1.36 +2 -2
+ NTP_4_2_3P59
+
+ ntpq/ntpq-opts.c@1.40 +2 -2
+ NTP_4_2_3P59
+
+ ntpq/ntpq-opts.h@1.40 +3 -3
+ NTP_4_2_3P59
+
+ ntpq/ntpq-opts.texi@1.37 +1 -1
+ NTP_4_2_3P59
+
+ ntpq/ntpq.1@1.36 +2 -2
+ NTP_4_2_3P59
+
+ packageinfo.sh@1.51 +1 -1
+ NTP_4_2_3P59
+
+ sntp/sntp-opts.c@1.37 +2 -2
+ NTP_4_2_3P59
+
+ sntp/sntp-opts.h@1.37 +3 -3
+ NTP_4_2_3P59
+
+ sntp/sntp-opts.texi@1.34 +1 -1
+ NTP_4_2_3P59
+
+ sntp/sntp.1@1.37 +2 -2
+ NTP_4_2_3P59
+
+ util/ntp-keygen-opts.c@1.37 +2 -2
+ NTP_4_2_3P59
+
+ util/ntp-keygen-opts.h@1.37 +3 -3
+ NTP_4_2_3P59
+
+ util/ntp-keygen-opts.texi@1.35 +1 -1
+ NTP_4_2_3P59
+
+ util/ntp-keygen.1@1.35 +2 -2
+ NTP_4_2_3P59
+
+ChangeSet@1.1251.94.61, 2006-10-15 03:47:49-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P4
+ TAG: NTP_4_2_2P4
+
+ packageinfo.sh@1.27.20.2 +2 -2
+ NTP_4_2_2P4
+
+ChangeSet@1.1251.94.60, 2006-10-15 03:14:15-04:00, stenn@whimsy.udel.edu
+ Release 4.2.2p4
+
+ packageinfo.sh@1.27.20.1 +1 -1
+ Release 4.2.2p4
+
+ChangeSet@1.1379.1.51, 2006-10-15 06:03:07+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ Bug 715:
+ Fix from Peter Pramberger
+ do not send link scoped multicasts with a glocbal source address
+ (if present on that interface)
+
+ ntpd/ntp_io.c@1.234.1.16 +9 -2
+ Bug 715:
+ Fix from Peter Pramberger
+ do not send link scoped multicasts with a glocbal source address
+ (if present on that interface)
+
+ChangeSet@1.1379.1.50, 2006-10-14 07:41:41-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P58
+ TAG: NTP_4_2_3P58
+
+ ntpd/ntpd-opts.c@1.37 +2 -2
+ NTP_4_2_3P58
+
+ ntpd/ntpd-opts.h@1.37 +3 -3
+ NTP_4_2_3P58
+
+ ntpd/ntpd-opts.texi@1.36 +1 -1
+ NTP_4_2_3P58
+
+ ntpd/ntpd.1@1.35 +2 -2
+ NTP_4_2_3P58
+
+ ntpd/ntpdsim-opts.c@1.37 +2 -2
+ NTP_4_2_3P58
+
+ ntpd/ntpdsim-opts.h@1.37 +3 -3
+ NTP_4_2_3P58
+
+ ntpd/ntpdsim-opts.texi@1.35 +1 -1
+ NTP_4_2_3P58
+
+ ntpd/ntpdsim.1@1.35 +2 -2
+ NTP_4_2_3P58
+
+ ntpdc/ntpdc-opts.c@1.37 +2 -2
+ NTP_4_2_3P58
+
+ ntpdc/ntpdc-opts.h@1.37 +3 -3
+ NTP_4_2_3P58
+
+ ntpdc/ntpdc-opts.texi@1.35 +1 -1
+ NTP_4_2_3P58
+
+ ntpdc/ntpdc.1@1.35 +2 -2
+ NTP_4_2_3P58
+
+ ntpq/ntpq-opts.c@1.39 +2 -2
+ NTP_4_2_3P58
+
+ ntpq/ntpq-opts.h@1.39 +3 -3
+ NTP_4_2_3P58
+
+ ntpq/ntpq-opts.texi@1.36 +1 -1
+ NTP_4_2_3P58
+
+ ntpq/ntpq.1@1.35 +2 -2
+ NTP_4_2_3P58
+
+ packageinfo.sh@1.50 +1 -1
+ NTP_4_2_3P58
+
+ sntp/sntp-opts.c@1.36 +2 -2
+ NTP_4_2_3P58
+
+ sntp/sntp-opts.h@1.36 +3 -3
+ NTP_4_2_3P58
+
+ sntp/sntp-opts.texi@1.33 +1 -1
+ NTP_4_2_3P58
+
+ sntp/sntp.1@1.36 +2 -2
+ NTP_4_2_3P58
+
+ util/ntp-keygen-opts.c@1.36 +2 -2
+ NTP_4_2_3P58
+
+ util/ntp-keygen-opts.h@1.36 +3 -3
+ NTP_4_2_3P58
+
+ util/ntp-keygen-opts.texi@1.34 +1 -1
+ NTP_4_2_3P58
+
+ util/ntp-keygen.1@1.34 +2 -2
+ NTP_4_2_3P58
+
+ChangeSet@1.1379.1.49, 2006-10-14 08:51:43+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ Bug #715 (& dupe 723):
+ findlocalinterface() in update_interface can be replaced by
+ a simple address to interface lookup. This avoids tripping
+ over the Linux strategy to return the localhost address
+ when attempting to send to an IPv6 address of a local interface.
+ Additionally:
+ synchronize debug output with reality
+ avoid adding duplicate address entries to the address list
+ declare more functions static to reduce name space pollution
+
+ ntpd/ntp_io.c@1.234.1.15 +107 -81
+ Bug #715 (& dupe 723):
+ findlocalinterface() in update_interface can be replaced by
+ a simple address to interface lookup. This avoids tripping
+ over the Linux strategy to return the localhost address
+ when attempting to send to an IPv6 address of a local interface.
+ Additionally:
+ synchronize debug output with reality
+ avoid adding duplicate address entries to the address list
+ declare more functions static to reduce name space pollution
+
+ChangeSet@1.1379.1.48, 2006-10-13 07:48:30-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P57
+ TAG: NTP_4_2_3P57
+
+ ntpd/ntpd-opts.c@1.36 +4 -4
+ NTP_4_2_3P57
+
+ ntpd/ntpd-opts.h@1.36 +3 -3
+ NTP_4_2_3P57
+
+ ntpd/ntpd-opts.texi@1.35 +3 -3
+ NTP_4_2_3P57
+
+ ntpd/ntpd.1@1.34 +2 -2
+ NTP_4_2_3P57
+
+ ntpd/ntpdsim-opts.c@1.36 +4 -4
+ NTP_4_2_3P57
+
+ ntpd/ntpdsim-opts.h@1.36 +3 -3
+ NTP_4_2_3P57
+
+ ntpd/ntpdsim-opts.texi@1.34 +3 -3
+ NTP_4_2_3P57
+
+ ntpd/ntpdsim.1@1.34 +2 -2
+ NTP_4_2_3P57
+
+ ntpdc/ntpdc-opts.c@1.36 +4 -4
+ NTP_4_2_3P57
+
+ ntpdc/ntpdc-opts.h@1.36 +3 -3
+ NTP_4_2_3P57
+
+ ntpdc/ntpdc-opts.texi@1.34 +2 -2
+ NTP_4_2_3P57
+
+ ntpdc/ntpdc.1@1.34 +2 -2
+ NTP_4_2_3P57
+
+ ntpq/ntpq-opts.c@1.38 +4 -4
+ NTP_4_2_3P57
+
+ ntpq/ntpq-opts.h@1.38 +3 -3
+ NTP_4_2_3P57
+
+ ntpq/ntpq-opts.texi@1.35 +3 -3
+ NTP_4_2_3P57
+
+ ntpq/ntpq.1@1.34 +2 -2
+ NTP_4_2_3P57
+
+ packageinfo.sh@1.49 +1 -1
+ NTP_4_2_3P57
+
+ sntp/sntp-opts.c@1.35 +2 -2
+ NTP_4_2_3P57
+
+ sntp/sntp-opts.h@1.35 +3 -3
+ NTP_4_2_3P57
+
+ sntp/sntp-opts.texi@1.32 +1 -1
+ NTP_4_2_3P57
+
+ sntp/sntp.1@1.35 +2 -2
+ NTP_4_2_3P57
+
+ util/ntp-keygen-opts.c@1.35 +4 -4
+ NTP_4_2_3P57
+
+ util/ntp-keygen-opts.h@1.35 +3 -3
+ NTP_4_2_3P57
+
+ util/ntp-keygen-opts.texi@1.33 +2 -2
+ NTP_4_2_3P57
+
+ util/ntp-keygen.1@1.33 +2 -2
+ NTP_4_2_3P57
+
+ChangeSet@1.1379.1.47, 2006-10-12 23:32:07-04:00, stenn@whimsy.udel.edu
+ Autogen-5.8.7 upgrade
+
+ clockstuff/clktest-opts.c@1.9 +1 -1
+ Autogen-5.8.7 upgrade
+
+ clockstuff/clktest-opts.h@1.9 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpd-opts.c@1.35 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpd-opts.h@1.35 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpd-opts.texi@1.34 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpd.1@1.33 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpdsim-opts.c@1.35 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpdsim-opts.h@1.35 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpdsim-opts.texi@1.33 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpdsim.1@1.33 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpdc/ntpdc-opts.c@1.35 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpdc/ntpdc-opts.h@1.35 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpdc/ntpdc-opts.texi@1.33 +2 -2
+ Autogen-5.8.7 upgrade
+
+ ntpdc/ntpdc.1@1.33 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpq/ntpq-opts.c@1.37 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpq/ntpq-opts.h@1.37 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpq/ntpq-opts.texi@1.34 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpq/ntpq.1@1.33 +1 -1
+ Autogen-5.8.7 upgrade
+
+ sntp/sntp-opts.c@1.34 +1 -1
+ Autogen-5.8.7 upgrade
+
+ sntp/sntp-opts.h@1.34 +1 -1
+ Autogen-5.8.7 upgrade
+
+ util/ntp-keygen-opts.c@1.34 +1 -1
+ Autogen-5.8.7 upgrade
+
+ util/ntp-keygen-opts.h@1.34 +1 -1
+ Autogen-5.8.7 upgrade
+
+ util/ntp-keygen-opts.texi@1.32 +2 -2
+ Autogen-5.8.7 upgrade
+
+ util/ntp-keygen.1@1.32 +1 -1
+ Autogen-5.8.7 upgrade
+
+ChangeSet@1.1379.1.46, 2006-10-12 23:29:11-04:00, stenn@whimsy.udel.edu
+ Require autogen-5.8.7
+
+ include/autogen-version.def@1.3 +1 -1
+ Require autogen-5.8.7
+
+ChangeSet@1.1379.1.45, 2006-10-12 22:46:49-04:00, stenn@whimsy.udel.edu
+ Autogen-5.8.7 upgrade
+
+ clockstuff/clktest-opts.c@1.8 +2 -2
+ Autogen-5.8.7 upgrade
+
+ clockstuff/clktest-opts.h@1.8 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpd-opts.c@1.34 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpd-opts.h@1.34 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpdsim-opts.c@1.34 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpd/ntpdsim-opts.h@1.34 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpdc/ntpdc-opts.c@1.34 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpdc/ntpdc-opts.h@1.34 +1 -1
+ Autogen-5.8.7 upgrade
+
+ ntpq/ntpq-opts.c@1.36 +3 -3
+ Autogen-5.8.7 upgrade
+
+ ntpq/ntpq-opts.h@1.36 +1 -1
+ Autogen-5.8.7 upgrade
+
+ sntp/sntp-opts.c@1.33 +1 -1
+ Autogen-5.8.7 upgrade
+
+ sntp/sntp-opts.h@1.33 +1 -1
+ Autogen-5.8.7 upgrade
+
+ util/ntp-keygen-opts.c@1.33 +3 -3
+ Autogen-5.8.7 upgrade
+
+ util/ntp-keygen-opts.h@1.33 +1 -1
+ Autogen-5.8.7 upgrade
+
+ChangeSet@1.1379.1.44, 2006-10-12 22:42:48-04:00, stenn@whimsy.udel.edu
+ autogen-5.8.7 upgrade
+
+ libopts/autoopts.c@1.10 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/autoopts.h@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/autoopts/options.h@1.10 +2 -2
+ autogen-5.8.7 upgrade
+
+ libopts/autoopts/usage-txt.h@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/boolean.c@1.8 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/compat/compat.h@1.12 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/compat/pathfind.c@1.9 +2 -3
+ autogen-5.8.7 upgrade
+
+ libopts/compat/windows-config.h@1.5 +8 -2
+ autogen-5.8.7 upgrade
+
+ libopts/configfile.c@1.10 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/cook.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/enumeration.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/environment.c@1.8 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/genshell.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/genshell.h@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/load.c@1.10 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/m4/libopts.m4@1.14 +2 -2
+ autogen-5.8.7 upgrade
+
+ libopts/m4/liboptschk.m4@1.3 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/makeshell.c@1.11 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/nested.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/numeric.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/pgusage.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/proto.h@1.11 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/putshell.c@1.10 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/restore.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/save.c@1.10 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/sort.c@1.8 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/stack.c@1.10 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/streqvcmp.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/text_mmap.c@1.8 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/usage.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ libopts/version.c@1.9 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/autoopts.c@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/autoopts.h@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/autoopts/options.h@1.7 +2 -2
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/autoopts/usage-txt.h@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/boolean.c@1.5 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/compat/compat.h@1.8 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/compat/pathfind.c@1.6 +2 -3
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/compat/windows-config.h@1.3 +8 -2
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/configfile.c@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/cook.c@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/enumeration.c@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/environment.c@1.5 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/genshell.c@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/genshell.h@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/load.c@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/m4/libopts.m4@1.11 +2 -2
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/m4/liboptschk.m4@1.3 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/makeshell.c@1.8 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/nested.c@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/numeric.c@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/pgusage.c@1.5 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/proto.h@1.8 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/putshell.c@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/restore.c@1.5 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/save.c@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/sort.c@1.4 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/stack.c@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/streqvcmp.c@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/text_mmap.c@1.5 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/usage.c@1.7 +1 -1
+ autogen-5.8.7 upgrade
+
+ sntp/libopts/version.c@1.6 +1 -1
+ autogen-5.8.7 upgrade
+
+ChangeSet@1.1379.1.43, 2006-10-12 19:22:09-04:00, stenn@whimsy.udel.edu
+ Improve the getsockname() arg determination
+
+ configure.ac@1.388.1.13 +10 -6
+ Improve the getsockname() arg determination
+
+ChangeSet@1.1379.1.42, 2006-10-12 07:40:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P56
+ TAG: NTP_4_2_3P56
+
+ ntpd/ntpd-opts.c@1.33 +2 -2
+ NTP_4_2_3P56
+
+ ntpd/ntpd-opts.h@1.33 +3 -3
+ NTP_4_2_3P56
+
+ ntpd/ntpd-opts.texi@1.33 +1 -1
+ NTP_4_2_3P56
+
+ ntpd/ntpd.1@1.32 +2 -2
+ NTP_4_2_3P56
+
+ ntpd/ntpdsim-opts.c@1.33 +2 -2
+ NTP_4_2_3P56
+
+ ntpd/ntpdsim-opts.h@1.33 +3 -3
+ NTP_4_2_3P56
+
+ ntpd/ntpdsim-opts.texi@1.32 +1 -1
+ NTP_4_2_3P56
+
+ ntpd/ntpdsim.1@1.32 +2 -2
+ NTP_4_2_3P56
+
+ ntpdc/ntpdc-opts.c@1.33 +2 -2
+ NTP_4_2_3P56
+
+ ntpdc/ntpdc-opts.h@1.33 +3 -3
+ NTP_4_2_3P56
+
+ ntpdc/ntpdc-opts.texi@1.32 +1 -1
+ NTP_4_2_3P56
+
+ ntpdc/ntpdc.1@1.32 +2 -2
+ NTP_4_2_3P56
+
+ ntpq/ntpq-opts.c@1.35 +2 -2
+ NTP_4_2_3P56
+
+ ntpq/ntpq-opts.h@1.35 +3 -3
+ NTP_4_2_3P56
+
+ ntpq/ntpq-opts.texi@1.33 +1 -1
+ NTP_4_2_3P56
+
+ ntpq/ntpq.1@1.32 +2 -2
+ NTP_4_2_3P56
+
+ packageinfo.sh@1.48 +1 -1
+ NTP_4_2_3P56
+
+ sntp/sntp-opts.c@1.32 +2 -2
+ NTP_4_2_3P56
+
+ sntp/sntp-opts.h@1.32 +3 -3
+ NTP_4_2_3P56
+
+ sntp/sntp-opts.texi@1.31 +1 -1
+ NTP_4_2_3P56
+
+ sntp/sntp.1@1.34 +2 -2
+ NTP_4_2_3P56
+
+ util/ntp-keygen-opts.c@1.32 +2 -2
+ NTP_4_2_3P56
+
+ util/ntp-keygen-opts.h@1.32 +3 -3
+ NTP_4_2_3P56
+
+ util/ntp-keygen-opts.texi@1.31 +1 -1
+ NTP_4_2_3P56
+
+ util/ntp-keygen.1@1.31 +2 -2
+ NTP_4_2_3P56
+
+ChangeSet@1.1379.1.41, 2006-10-12 02:30:52-04:00, stenn@whimsy.udel.edu
+ Update NEWS file
+
+ NEWS@1.68 +36 -0
+ Update NEWS file
+
+ChangeSet@1.1379.11.2, 2006-10-11 22:40:46-04:00, mayer@pogo.udel.edu
+ Bug #690. Purify memory reference error
+
+ ports/winnt/libntp/dnslookup.c@1.4.1.4 +4 -3
+ Bug #690. Purify memory reference error
+
+ChangeSet@1.1379.11.1, 2006-10-11 22:39:16-04:00, mayer@pogo.udel.edu
+ Bug #718. Update to config.h to deal with socklen_t
+
+ ports/winnt/include/config.h@1.44 +13 -0
+ Bug #718. Update to config.h to deal with socklen_t
+
+ChangeSet@1.1379.1.39, 2006-10-11 07:44:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P55
+ TAG: NTP_4_2_3P55
+
+ ntpd/ntpd-opts.c@1.32 +2 -2
+ NTP_4_2_3P55
+
+ ntpd/ntpd-opts.h@1.32 +3 -3
+ NTP_4_2_3P55
+
+ ntpd/ntpd-opts.texi@1.32 +1 -1
+ NTP_4_2_3P55
+
+ ntpd/ntpd.1@1.31 +2 -2
+ NTP_4_2_3P55
+
+ ntpd/ntpdsim-opts.c@1.32 +2 -2
+ NTP_4_2_3P55
+
+ ntpd/ntpdsim-opts.h@1.32 +3 -3
+ NTP_4_2_3P55
+
+ ntpd/ntpdsim-opts.texi@1.31 +1 -1
+ NTP_4_2_3P55
+
+ ntpd/ntpdsim.1@1.31 +2 -2
+ NTP_4_2_3P55
+
+ ntpdc/ntpdc-opts.c@1.32 +2 -2
+ NTP_4_2_3P55
+
+ ntpdc/ntpdc-opts.h@1.32 +3 -3
+ NTP_4_2_3P55
+
+ ntpdc/ntpdc-opts.texi@1.31 +1 -1
+ NTP_4_2_3P55
+
+ ntpdc/ntpdc.1@1.31 +2 -2
+ NTP_4_2_3P55
+
+ ntpq/ntpq-opts.c@1.34 +2 -2
+ NTP_4_2_3P55
+
+ ntpq/ntpq-opts.h@1.34 +3 -3
+ NTP_4_2_3P55
+
+ ntpq/ntpq-opts.texi@1.32 +1 -1
+ NTP_4_2_3P55
+
+ ntpq/ntpq.1@1.31 +2 -2
+ NTP_4_2_3P55
+
+ packageinfo.sh@1.47 +1 -1
+ NTP_4_2_3P55
+
+ sntp/sntp-opts.c@1.31 +2 -2
+ NTP_4_2_3P55
+
+ sntp/sntp-opts.h@1.31 +3 -3
+ NTP_4_2_3P55
+
+ sntp/sntp-opts.texi@1.30 +1 -1
+ NTP_4_2_3P55
+
+ sntp/sntp.1@1.33 +2 -2
+ NTP_4_2_3P55
+
+ util/ntp-keygen-opts.c@1.31 +2 -2
+ NTP_4_2_3P55
+
+ util/ntp-keygen-opts.h@1.31 +3 -3
+ NTP_4_2_3P55
+
+ util/ntp-keygen-opts.texi@1.30 +1 -1
+ NTP_4_2_3P55
+
+ util/ntp-keygen.1@1.30 +2 -2
+ NTP_4_2_3P55
+
+ChangeSet@1.1379.1.37, 2006-10-10 19:52:42-04:00, stenn@whimsy.udel.edu
+ [Bug 718] Determine/use the correct type of saddrlen for getsockname()
+
+ configure.ac@1.388.1.12 +23 -1
+ [Bug 718] Determine/use the correct type of saddrlen for getsockname()
+
+ libisc/net.c@1.8 +2 -2
+ [Bug 718] Determine/use the correct type of saddrlen for getsockname()
+
+ ntpd/ntp_io.c@1.234.1.14 +1 -1
+ [Bug 718] Determine/use the correct type of saddrlen for getsockname()
+
+ChangeSet@1.1379.10.1, 2006-10-10 16:15:47+00:00, burnicki@pogo.udel.edu
+ [Bug 708] nt_clockstuff.c has unintentionally been messed up with the previous changeset. This is the correct version.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.23 +574 -249
+ Oops, this file has unintentionally been messed up with the previous changeset. This is the correct version.
+
+ChangeSet@1.1379.1.36, 2006-10-10 07:46:00-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P54
+ TAG: NTP_4_2_3P54
+
+ ntpd/ntpd-opts.c@1.31 +2 -2
+ NTP_4_2_3P54
+
+ ntpd/ntpd-opts.h@1.31 +3 -3
+ NTP_4_2_3P54
+
+ ntpd/ntpd-opts.texi@1.31 +1 -1
+ NTP_4_2_3P54
+
+ ntpd/ntpd.1@1.30 +2 -2
+ NTP_4_2_3P54
+
+ ntpd/ntpdsim-opts.c@1.31 +2 -2
+ NTP_4_2_3P54
+
+ ntpd/ntpdsim-opts.h@1.31 +3 -3
+ NTP_4_2_3P54
+
+ ntpd/ntpdsim-opts.texi@1.30 +1 -1
+ NTP_4_2_3P54
+
+ ntpd/ntpdsim.1@1.30 +2 -2
+ NTP_4_2_3P54
+
+ ntpdc/ntpdc-opts.c@1.31 +2 -2
+ NTP_4_2_3P54
+
+ ntpdc/ntpdc-opts.h@1.31 +3 -3
+ NTP_4_2_3P54
+
+ ntpdc/ntpdc-opts.texi@1.30 +1 -1
+ NTP_4_2_3P54
+
+ ntpdc/ntpdc.1@1.30 +2 -2
+ NTP_4_2_3P54
+
+ ntpq/ntpq-opts.c@1.33 +2 -2
+ NTP_4_2_3P54
+
+ ntpq/ntpq-opts.h@1.33 +3 -3
+ NTP_4_2_3P54
+
+ ntpq/ntpq-opts.texi@1.31 +1 -1
+ NTP_4_2_3P54
+
+ ntpq/ntpq.1@1.30 +2 -2
+ NTP_4_2_3P54
+
+ packageinfo.sh@1.46 +1 -1
+ NTP_4_2_3P54
+
+ sntp/sntp-opts.c@1.30 +2 -2
+ NTP_4_2_3P54
+
+ sntp/sntp-opts.h@1.30 +3 -3
+ NTP_4_2_3P54
+
+ sntp/sntp-opts.texi@1.29 +1 -1
+ NTP_4_2_3P54
+
+ sntp/sntp.1@1.32 +2 -2
+ NTP_4_2_3P54
+
+ util/ntp-keygen-opts.c@1.30 +2 -2
+ NTP_4_2_3P54
+
+ util/ntp-keygen-opts.h@1.30 +3 -3
+ NTP_4_2_3P54
+
+ util/ntp-keygen-opts.texi@1.29 +1 -1
+ NTP_4_2_3P54
+
+ util/ntp-keygen.1@1.29 +2 -2
+ NTP_4_2_3P54
+
+ChangeSet@1.1379.1.35, 2006-10-10 02:39:26-04:00, stenn@whimsy.udel.edu
+ [Bug 718] Use the recommended type for the saddrlen arg to getsockname()
+
+ NEWS@1.67 +1 -0
+ [Bug 718] Use the recommended type for the saddrlen arg to getsockname()
+
+ ntpd/ntp_io.c@1.234.1.13 +1 -1
+ [Bug 718] Use the recommended type for the saddrlen arg to getsockname()
+
+ChangeSet@1.1379.1.34, 2006-10-10 02:27:12-04:00, stenn@whimsy.udel.edu
+ Use NO_OPTION_NAME_WARNINGS if cc does not support #warning
+
+ configure.ac@1.388.1.11 +11 -0
+ Use NO_OPTION_NAME_WARNINGS if cc does not support #warning
+
+ sntp/configure.ac@1.14 +11 -0
+ Use NO_OPTION_NAME_WARNINGS if cc does not support #warning
+
+ChangeSet@1.1379.1.33, 2006-10-09 07:41:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P53
+ TAG: NTP_4_2_3P53
+
+ ntpd/ntpd-opts.c@1.30 +2 -2
+ NTP_4_2_3P53
+
+ ntpd/ntpd-opts.h@1.30 +3 -3
+ NTP_4_2_3P53
+
+ ntpd/ntpd-opts.texi@1.30 +1 -1
+ NTP_4_2_3P53
+
+ ntpd/ntpd.1@1.29 +2 -2
+ NTP_4_2_3P53
+
+ ntpd/ntpdsim-opts.c@1.30 +2 -2
+ NTP_4_2_3P53
+
+ ntpd/ntpdsim-opts.h@1.30 +3 -3
+ NTP_4_2_3P53
+
+ ntpd/ntpdsim-opts.texi@1.29 +1 -1
+ NTP_4_2_3P53
+
+ ntpd/ntpdsim.1@1.29 +2 -2
+ NTP_4_2_3P53
+
+ ntpdc/ntpdc-opts.c@1.30 +2 -2
+ NTP_4_2_3P53
+
+ ntpdc/ntpdc-opts.h@1.30 +3 -3
+ NTP_4_2_3P53
+
+ ntpdc/ntpdc-opts.texi@1.29 +1 -1
+ NTP_4_2_3P53
+
+ ntpdc/ntpdc.1@1.29 +2 -2
+ NTP_4_2_3P53
+
+ ntpq/ntpq-opts.c@1.32 +2 -2
+ NTP_4_2_3P53
+
+ ntpq/ntpq-opts.h@1.32 +3 -3
+ NTP_4_2_3P53
+
+ ntpq/ntpq-opts.texi@1.30 +1 -1
+ NTP_4_2_3P53
+
+ ntpq/ntpq.1@1.29 +2 -2
+ NTP_4_2_3P53
+
+ packageinfo.sh@1.45 +1 -1
+ NTP_4_2_3P53
+
+ sntp/sntp-opts.c@1.29 +2 -2
+ NTP_4_2_3P53
+
+ sntp/sntp-opts.h@1.29 +3 -3
+ NTP_4_2_3P53
+
+ sntp/sntp-opts.texi@1.28 +1 -1
+ NTP_4_2_3P53
+
+ sntp/sntp.1@1.31 +2 -2
+ NTP_4_2_3P53
+
+ util/ntp-keygen-opts.c@1.29 +2 -2
+ NTP_4_2_3P53
+
+ util/ntp-keygen-opts.h@1.29 +3 -3
+ NTP_4_2_3P53
+
+ util/ntp-keygen-opts.texi@1.28 +1 -1
+ NTP_4_2_3P53
+
+ util/ntp-keygen.1@1.28 +2 -2
+ NTP_4_2_3P53
+
+ChangeSet@1.1379.1.32, 2006-10-09 06:35:20-04:00, stenn@whimsy.udel.edu
+ [Bug 715] Fix multicast issues under Linux
+
+ NEWS@1.66 +1 -0
+ [Bug 715] Fix multicast issues under Linux
+
+ libisc/ifiter_ioctl.c@1.25 +45 -7
+ [Bug 715] Fix multicast issues under Linux
+
+ChangeSet@1.1379.1.31, 2006-10-08 19:39:10-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P52
+ TAG: NTP_4_2_3P52
+
+ ntpd/ntpd-opts.c@1.29 +4 -4
+ NTP_4_2_3P52
+
+ ntpd/ntpd-opts.h@1.29 +3 -3
+ NTP_4_2_3P52
+
+ ntpd/ntpd-opts.texi@1.29 +3 -3
+ NTP_4_2_3P52
+
+ ntpd/ntpd.1@1.28 +2 -2
+ NTP_4_2_3P52
+
+ ntpd/ntpdsim-opts.c@1.29 +4 -4
+ NTP_4_2_3P52
+
+ ntpd/ntpdsim-opts.h@1.29 +3 -3
+ NTP_4_2_3P52
+
+ ntpd/ntpdsim-opts.texi@1.28 +3 -3
+ NTP_4_2_3P52
+
+ ntpd/ntpdsim.1@1.28 +2 -2
+ NTP_4_2_3P52
+
+ ntpdc/ntpdc-opts.c@1.29 +4 -4
+ NTP_4_2_3P52
+
+ ntpdc/ntpdc-opts.h@1.29 +3 -3
+ NTP_4_2_3P52
+
+ ntpdc/ntpdc-opts.texi@1.28 +2 -2
+ NTP_4_2_3P52
+
+ ntpdc/ntpdc.1@1.28 +2 -2
+ NTP_4_2_3P52
+
+ ntpq/ntpq-opts.c@1.31 +4 -4
+ NTP_4_2_3P52
+
+ ntpq/ntpq-opts.h@1.31 +3 -3
+ NTP_4_2_3P52
+
+ ntpq/ntpq-opts.texi@1.29 +3 -3
+ NTP_4_2_3P52
+
+ ntpq/ntpq.1@1.28 +2 -2
+ NTP_4_2_3P52
+
+ packageinfo.sh@1.44 +1 -1
+ NTP_4_2_3P52
+
+ sntp/sntp-opts.c@1.28 +2 -2
+ NTP_4_2_3P52
+
+ sntp/sntp-opts.h@1.28 +3 -3
+ NTP_4_2_3P52
+
+ sntp/sntp-opts.texi@1.27 +1 -1
+ NTP_4_2_3P52
+
+ sntp/sntp.1@1.30 +2 -2
+ NTP_4_2_3P52
+
+ util/ntp-keygen-opts.c@1.28 +4 -4
+ NTP_4_2_3P52
+
+ util/ntp-keygen-opts.h@1.28 +3 -3
+ NTP_4_2_3P52
+
+ util/ntp-keygen-opts.texi@1.27 +2 -2
+ NTP_4_2_3P52
+
+ util/ntp-keygen.1@1.27 +2 -2
+ NTP_4_2_3P52
+
+ChangeSet@1.1379.1.30, 2006-10-08 04:32:17-04:00, stenn@whimsy.udel.edu
+ libopts-27.5.3
+
+ clockstuff/clktest-opts.c@1.7 +9 -7
+ libopts-27.5.3
+
+ clockstuff/clktest-opts.h@1.7 +6 -4
+ libopts-27.5.3
+
+ libopts/Makefile.am@1.6 +1 -1
+ libopts-27.5.3
+
+ libopts/autoopts.c@1.9 +8 -6
+ libopts-27.5.3
+
+ libopts/autoopts/options.h@1.9 +131 -64
+ libopts-27.5.3
+
+ libopts/autoopts/usage-txt.h@1.8 +1 -1
+ libopts-27.5.3
+
+ libopts/configfile.c@1.9 +1 -1
+ libopts-27.5.3
+
+ libopts/cook.c@1.8 +1 -1
+ libopts-27.5.3
+
+ libopts/enumeration.c@1.8 +4 -4
+ libopts-27.5.3
+
+ libopts/genshell.c@1.8 +3 -1
+ libopts-27.5.3
+
+ libopts/genshell.h@1.8 +5 -3
+ libopts-27.5.3
+
+ libopts/load.c@1.9 +1 -1
+ libopts-27.5.3
+
+ libopts/m4/libopts.m4@1.13 +1 -1
+ libopts-27.5.3
+
+ libopts/makeshell.c@1.10 +13 -4
+ libopts-27.5.3
+
+ libopts/nested.c@1.8 +1 -1
+ libopts-27.5.3
+
+ libopts/numeric.c@1.8 +4 -4
+ libopts-27.5.3
+
+ libopts/proto.h@1.10 +1 -1
+ libopts-27.5.3
+
+ libopts/putshell.c@1.9 +8 -8
+ libopts-27.5.3
+
+ libopts/restore.c@1.8 +2 -2
+ libopts-27.5.3
+
+ libopts/save.c@1.9 +7 -8
+ libopts-27.5.3
+
+ libopts/stack.c@1.9 +3 -3
+ libopts-27.5.3
+
+ ntpd/ntpd-opts.c@1.28 +3 -1
+ libopts-27.5.3
+
+ ntpd/ntpd-opts.h@1.28 +6 -4
+ libopts-27.5.3
+
+ ntpd/ntpdsim-opts.c@1.28 +3 -1
+ libopts-27.5.3
+
+ ntpd/ntpdsim-opts.h@1.28 +6 -4
+ libopts-27.5.3
+
+ ntpdc/ntpdc-opts.c@1.28 +3 -1
+ libopts-27.5.3
+
+ ntpdc/ntpdc-opts.h@1.28 +6 -4
+ libopts-27.5.3
+
+ ntpq/ntpq-opts.c@1.30 +3 -1
+ libopts-27.5.3
+
+ ntpq/ntpq-opts.h@1.30 +6 -4
+ libopts-27.5.3
+
+ ntpq/ntpq-opts.texi@1.28 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/Makefile.am@1.4 +10 -6
+ libopts-27.5.3
+
+ sntp/libopts/autoopts.c@1.6 +8 -6
+ libopts-27.5.3
+
+ sntp/libopts/autoopts/options.h@1.6 +131 -64
+ libopts-27.5.3
+
+ sntp/libopts/autoopts/usage-txt.h@1.5 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/configfile.c@1.6 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/cook.c@1.5 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/enumeration.c@1.5 +4 -4
+ libopts-27.5.3
+
+ sntp/libopts/genshell.c@1.5 +3 -1
+ libopts-27.5.3
+
+ sntp/libopts/genshell.h@1.5 +5 -3
+ libopts-27.5.3
+
+ sntp/libopts/load.c@1.6 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/m4/libopts.m4@1.10 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/makeshell.c@1.7 +13 -4
+ libopts-27.5.3
+
+ sntp/libopts/nested.c@1.5 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/numeric.c@1.5 +4 -4
+ libopts-27.5.3
+
+ sntp/libopts/proto.h@1.7 +1 -1
+ libopts-27.5.3
+
+ sntp/libopts/putshell.c@1.6 +8 -8
+ libopts-27.5.3
+
+ sntp/libopts/restore.c@1.4 +2 -2
+ libopts-27.5.3
+
+ sntp/libopts/save.c@1.6 +7 -8
+ libopts-27.5.3
+
+ sntp/libopts/stack.c@1.6 +3 -3
+ libopts-27.5.3
+
+ sntp/sntp-opts.c@1.27 +3 -1
+ libopts-27.5.3
+
+ sntp/sntp-opts.h@1.27 +6 -4
+ libopts-27.5.3
+
+ util/ntp-keygen-opts.c@1.27 +5 -3
+ libopts-27.5.3
+
+ util/ntp-keygen-opts.h@1.27 +6 -4
+ libopts-27.5.3
+
+ChangeSet@1.1379.9.1, 2006-10-07 19:42:28+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ allow asyncio_readers to remove themselves when being run
+
+ ntpd/ntp_io.c@1.234.1.12 +5 -3
+ allow asyncio_readers to remove themselves when being run
+
+ChangeSet@1.1379.1.28, 2006-10-05 10:20:42+00:00, burnicki@pogo.udel.edu
+ [Bug 708] Set the affinity to a specific CPU for the clock interpolation thread only, not for the whole process.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.22 +250 -575
+ Set the affinity to a specific CPU for the clock interpolation thread only, not for the whole process.
+
+ ports/winnt/ntpd/win32_io.c@1.12 +0 -22
+ Set the affinity to a specific CPU for the clock interpolation thread only, not for the whole process.
+
+ChangeSet@1.1379.1.27, 2006-09-26 23:45:08-04:00, stenn@whimsy.udel.edu
+ update NEWS
+
+ NEWS@1.65 +2 -0
+ update
+
+ChangeSet@1.1379.8.3, 2006-09-26 22:17:09-04:00, mayer@pogo.udel.edu
+ Unchanged
+
+ ntpd/refclock_wwv.c@1.63.1.1 +4 -7
+ Unchanged
+
+ChangeSet@1.1379.8.2, 2006-09-26 18:14:39-04:00, mayer@pogo.udel.edu
+ Bug #670: Fix for Transfer Aborted messages on Windows on reconfiguring interfaces
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.21 +98 -38
+ Bug #670: Fix for Transfer Aborted messages on Windows on reconfiguring interfaces
+
+ChangeSet@1.1379.8.1, 2006-09-26 18:11:11-04:00, mayer@pogo.udel.edu
+ Bug #690: Fix for buffer address issue
+
+ ports/winnt/libntp/dnslookup.c@1.4.1.3 +1 -1
+ Bug #690: Fix for buffer address issue
+
+ChangeSet@1.1379.1.25, 2006-09-26 16:16:30-04:00, stenn@whimsy.udel.edu
+ autogen update
+
+ clockstuff/clktest-opts.c@1.6 +2 -2
+ autogen update
+
+ clockstuff/clktest-opts.h@1.6 +3 -3
+ autogen update
+
+ ntpd/ntpd-opts.c@1.27 +3 -3
+ autogen update
+
+ ntpd/ntpd-opts.h@1.27 +1 -1
+ autogen update
+
+ ntpd/ntpd-opts.texi@1.28 +3 -3
+ autogen update
+
+ ntpd/ntpd.1@1.27 +1 -1
+ autogen update
+
+ ntpd/ntpdsim-opts.c@1.27 +3 -3
+ autogen update
+
+ ntpd/ntpdsim-opts.h@1.27 +1 -1
+ autogen update
+
+ ntpd/ntpdsim-opts.texi@1.27 +3 -3
+ autogen update
+
+ ntpd/ntpdsim.1@1.27 +1 -1
+ autogen update
+
+ ntpdc/ntpdc-opts.c@1.27 +3 -3
+ autogen update
+
+ ntpdc/ntpdc-opts.h@1.27 +1 -1
+ autogen update
+
+ ntpdc/ntpdc-opts.texi@1.27 +2 -2
+ autogen update
+
+ ntpdc/ntpdc.1@1.27 +1 -1
+ autogen update
+
+ ntpq/ntpq-opts.c@1.29 +3 -3
+ autogen update
+
+ ntpq/ntpq-opts.h@1.29 +1 -1
+ autogen update
+
+ ntpq/ntpq-opts.texi@1.27 +3 -3
+ autogen update
+
+ ntpq/ntpq.1@1.27 +1 -1
+ autogen update
+
+ sntp/sntp-opts.c@1.26 +1 -1
+ autogen update
+
+ sntp/sntp-opts.h@1.26 +1 -1
+ autogen update
+
+ sntp/sntp-opts.texi@1.26 +1 -1
+ autogen update
+
+ sntp/sntp.1@1.29 +1 -1
+ autogen update
+
+ util/ntp-keygen-opts.c@1.26 +3 -3
+ autogen update
+
+ util/ntp-keygen-opts.h@1.26 +1 -1
+ autogen update
+
+ util/ntp-keygen-opts.texi@1.26 +2 -2
+ autogen update
+
+ util/ntp-keygen.1@1.26 +1 -1
+ autogen update
+
+ChangeSet@1.1379.1.24, 2006-09-25 07:49:15-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P51
+ TAG: NTP_4_2_3P51
+
+ ntpd/ntpd-opts.c@1.26 +4 -4
+ NTP_4_2_3P51
+
+ ntpd/ntpd-opts.h@1.26 +3 -3
+ NTP_4_2_3P51
+
+ ntpd/ntpd-opts.texi@1.27 +3 -3
+ NTP_4_2_3P51
+
+ ntpd/ntpd.1@1.26 +2 -2
+ NTP_4_2_3P51
+
+ ntpd/ntpdsim-opts.c@1.26 +4 -4
+ NTP_4_2_3P51
+
+ ntpd/ntpdsim-opts.h@1.26 +3 -3
+ NTP_4_2_3P51
+
+ ntpd/ntpdsim-opts.texi@1.26 +3 -3
+ NTP_4_2_3P51
+
+ ntpd/ntpdsim.1@1.26 +2 -2
+ NTP_4_2_3P51
+
+ ntpdc/ntpdc-opts.c@1.26 +4 -4
+ NTP_4_2_3P51
+
+ ntpdc/ntpdc-opts.h@1.26 +3 -3
+ NTP_4_2_3P51
+
+ ntpdc/ntpdc-opts.texi@1.26 +2 -2
+ NTP_4_2_3P51
+
+ ntpdc/ntpdc.1@1.26 +2 -2
+ NTP_4_2_3P51
+
+ ntpq/ntpq-opts.c@1.28 +4 -4
+ NTP_4_2_3P51
+
+ ntpq/ntpq-opts.h@1.28 +3 -3
+ NTP_4_2_3P51
+
+ ntpq/ntpq-opts.texi@1.26 +3 -3
+ NTP_4_2_3P51
+
+ ntpq/ntpq.1@1.26 +2 -2
+ NTP_4_2_3P51
+
+ packageinfo.sh@1.43 +1 -1
+ NTP_4_2_3P51
+
+ sntp/sntp-opts.c@1.25 +2 -2
+ NTP_4_2_3P51
+
+ sntp/sntp-opts.h@1.25 +3 -3
+ NTP_4_2_3P51
+
+ sntp/sntp-opts.texi@1.25 +1 -1
+ NTP_4_2_3P51
+
+ sntp/sntp.1@1.28 +2 -2
+ NTP_4_2_3P51
+
+ util/ntp-keygen-opts.c@1.25 +4 -4
+ NTP_4_2_3P51
+
+ util/ntp-keygen-opts.h@1.25 +3 -3
+ NTP_4_2_3P51
+
+ util/ntp-keygen-opts.texi@1.25 +2 -2
+ NTP_4_2_3P51
+
+ util/ntp-keygen.1@1.25 +2 -2
+ NTP_4_2_3P51
+
+ChangeSet@1.1379.1.23, 2006-09-25 01:53:46-04:00, stenn@whimsy.udel.edu
+ autogen upgrade
+
+ NEWS@1.64 +6 -5
+ updates
+
+ clockstuff/clktest-opts.c@1.5 +6 -3
+ autogen upgrade
+
+ clockstuff/clktest-opts.h@1.5 +3 -3
+ autogen upgrade
+
+ libopts/autoopts.c@1.8 +1 -2
+ autogen upgrade
+
+ libopts/autoopts.h@1.8 +1 -2
+ autogen upgrade
+
+ libopts/autoopts/options.h@1.8 +2 -2
+ autogen upgrade
+
+ libopts/autoopts/usage-txt.h@1.7 +2 -2
+ autogen upgrade
+
+ libopts/boolean.c@1.7 +1 -2
+ autogen upgrade
+
+ libopts/compat/compat.h@1.11 +1 -2
+ autogen upgrade
+
+ libopts/compat/pathfind.c@1.8 +3 -3
+ autogen upgrade
+
+ libopts/compat/strchr.c@1.3 +0 -1
+ autogen upgrade
+
+ libopts/compat/windows-config.h@1.4 +6 -0
+ autogen upgrade
+
+ libopts/configfile.c@1.8 +34 -35
+ autogen upgrade
+
+ libopts/cook.c@1.7 +5 -6
+ autogen upgrade
+
+ libopts/enumeration.c@1.7 +1 -2
+ autogen upgrade
+
+ libopts/environment.c@1.7 +1 -2
+ autogen upgrade
+
+ libopts/genshell.c@1.7 +1 -1
+ autogen upgrade
+
+ libopts/genshell.h@1.7 +1 -1
+ autogen upgrade
+
+ libopts/load.c@1.8 +10 -11
+ autogen upgrade
+
+ libopts/m4/libopts.m4@1.12 +4 -1
+ autogen upgrade
+
+ libopts/m4/liboptschk.m4@1.2 +4 -1
+ autogen upgrade
+
+ libopts/makeshell.c@1.9 +1 -2
+ autogen upgrade
+
+ libopts/nested.c@1.7 +18 -19
+ autogen upgrade
+
+ libopts/numeric.c@1.7 +1 -2
+ autogen upgrade
+
+ libopts/pgusage.c@1.8 +1 -2
+ autogen upgrade
+
+ libopts/proto.h@1.9 +1 -1
+ autogen upgrade
+
+ libopts/putshell.c@1.8 +3 -4
+ autogen upgrade
+
+ libopts/restore.c@1.7 +1 -2
+ autogen upgrade
+
+ libopts/save.c@1.8 +1 -2
+ autogen upgrade
+
+ libopts/sort.c@1.7 +1 -2
+ autogen upgrade
+
+ libopts/stack.c@1.8 +1 -2
+ autogen upgrade
+
+ libopts/streqvcmp.c@1.8 +1 -2
+ autogen upgrade
+
+ libopts/text_mmap.c@1.7 +1 -2
+ autogen upgrade
+
+ libopts/tokenize.c@1.5 +0 -1
+ autogen upgrade
+
+ libopts/usage.c@1.8 +1 -2
+ autogen upgrade
+
+ libopts/version.c@1.8 +1 -2
+ autogen upgrade
+
+ ntpd/ntpd-opts.c@1.25 +3 -2
+ autogen upgrade
+
+ ntpd/ntpd-opts.h@1.25 +1 -1
+ autogen upgrade
+
+ ntpd/ntpd-opts.texi@1.26 +3 -3
+ autogen upgrade
+
+ ntpd/ntpd.1@1.25 +2 -2
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.c@1.25 +3 -2
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.h@1.25 +1 -1
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.texi@1.25 +3 -3
+ autogen upgrade
+
+ ntpd/ntpdsim.1@1.25 +2 -2
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.c@1.25 +3 -2
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.h@1.25 +1 -1
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.texi@1.25 +2 -2
+ autogen upgrade
+
+ ntpdc/ntpdc.1@1.25 +2 -2
+ autogen upgrade
+
+ ntpq/ntpq-opts.c@1.27 +3 -2
+ autogen upgrade
+
+ ntpq/ntpq-opts.h@1.27 +1 -1
+ autogen upgrade
+
+ ntpq/ntpq-opts.texi@1.25 +3 -3
+ autogen upgrade
+
+ ntpq/ntpq.1@1.25 +2 -2
+ autogen upgrade
+
+ sntp/libopts/autoopts.c@1.5 +1 -2
+ autogen upgrade
+
+ sntp/libopts/autoopts.h@1.6 +1 -2
+ autogen upgrade
+
+ sntp/libopts/autoopts/options.h@1.5 +2 -2
+ autogen upgrade
+
+ sntp/libopts/autoopts/usage-txt.h@1.4 +2 -2
+ autogen upgrade
+
+ sntp/libopts/boolean.c@1.4 +1 -2
+ autogen upgrade
+
+ sntp/libopts/compat/compat.h@1.7 +1 -2
+ autogen upgrade
+
+ sntp/libopts/compat/pathfind.c@1.5 +3 -3
+ autogen upgrade
+
+ sntp/libopts/compat/strchr.c@1.3 +0 -1
+ autogen upgrade
+
+ sntp/libopts/compat/windows-config.h@1.2 +16 -10
+ autogen upgrade
+
+ sntp/libopts/configfile.c@1.5 +34 -35
+ autogen upgrade
+
+ sntp/libopts/cook.c@1.4 +5 -6
+ autogen upgrade
+
+ sntp/libopts/enumeration.c@1.4 +1 -2
+ autogen upgrade
+
+ sntp/libopts/environment.c@1.4 +1 -2
+ autogen upgrade
+
+ sntp/libopts/genshell.c@1.4 +1 -1
+ autogen upgrade
+
+ sntp/libopts/genshell.h@1.4 +1 -1
+ autogen upgrade
+
+ sntp/libopts/load.c@1.5 +10 -11
+ autogen upgrade
+
+ sntp/libopts/m4/libopts.m4@1.9 +4 -1
+ autogen upgrade
+
+ sntp/libopts/m4/liboptschk.m4@1.2 +4 -1
+ autogen upgrade
+
+ sntp/libopts/makeshell.c@1.6 +1 -2
+ autogen upgrade
+
+ sntp/libopts/nested.c@1.4 +18 -19
+ autogen upgrade
+
+ sntp/libopts/numeric.c@1.4 +1 -2
+ autogen upgrade
+
+ sntp/libopts/pgusage.c@1.4 +1 -2
+ autogen upgrade
+
+ sntp/libopts/proto.h@1.6 +1 -1
+ autogen upgrade
+
+ sntp/libopts/putshell.c@1.5 +3 -4
+ autogen upgrade
+
+ sntp/libopts/restore.c@1.3 +1 -2
+ autogen upgrade
+
+ sntp/libopts/save.c@1.5 +1 -2
+ autogen upgrade
+
+ sntp/libopts/sort.c@1.3 +1 -2
+ autogen upgrade
+
+ sntp/libopts/stack.c@1.5 +1 -2
+ autogen upgrade
+
+ sntp/libopts/streqvcmp.c@1.5 +1 -2
+ autogen upgrade
+
+ sntp/libopts/text_mmap.c@1.4 +1 -2
+ autogen upgrade
+
+ sntp/libopts/tokenize.c@1.4 +0 -1
+ autogen upgrade
+
+ sntp/libopts/usage.c@1.6 +1 -2
+ autogen upgrade
+
+ sntp/libopts/version.c@1.5 +1 -2
+ autogen upgrade
+
+ sntp/sntp-opts.c@1.24 +1 -1
+ autogen upgrade
+
+ sntp/sntp-opts.h@1.24 +1 -1
+ autogen upgrade
+
+ sntp/sntp-opts.texi@1.24 +1 -1
+ autogen upgrade
+
+ sntp/sntp.1@1.27 +2 -2
+ autogen upgrade
+
+ util/ntp-keygen-opts.c@1.24 +3 -2
+ autogen upgrade
+
+ util/ntp-keygen-opts.h@1.24 +1 -1
+ autogen upgrade
+
+ util/ntp-keygen-opts.texi@1.24 +2 -2
+ autogen upgrade
+
+ util/ntp-keygen.1@1.24 +2 -2
+ autogen upgrade
+
+ChangeSet@1.1379.1.22, 2006-09-24 05:30:52-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P50
+ TAG: NTP_4_2_3P50
+
+ ntpd/ntpd-opts.c@1.24 +56 -55
+ NTP_4_2_3P50
+
+ ntpd/ntpd-opts.h@1.24 +9 -9
+ NTP_4_2_3P50
+
+ ntpd/ntpd-opts.texi@1.25 +1 -1
+ NTP_4_2_3P50
+
+ ntpd/ntpd.1@1.24 +2 -2
+ NTP_4_2_3P50
+
+ ntpd/ntpdsim-opts.c@1.24 +74 -73
+ NTP_4_2_3P50
+
+ ntpd/ntpdsim-opts.h@1.24 +9 -9
+ NTP_4_2_3P50
+
+ ntpd/ntpdsim-opts.texi@1.24 +1 -1
+ NTP_4_2_3P50
+
+ ntpd/ntpdsim.1@1.24 +2 -2
+ NTP_4_2_3P50
+
+ ntpdc/ntpdc-opts.c@1.24 +22 -21
+ NTP_4_2_3P50
+
+ ntpdc/ntpdc-opts.h@1.24 +7 -7
+ NTP_4_2_3P50
+
+ ntpdc/ntpdc-opts.texi@1.24 +1 -1
+ NTP_4_2_3P50
+
+ ntpdc/ntpdc.1@1.24 +2 -2
+ NTP_4_2_3P50
+
+ ntpq/ntpq-opts.c@1.26 +3 -3
+ NTP_4_2_3P50
+
+ ntpq/ntpq-opts.h@1.26 +3 -3
+ NTP_4_2_3P50
+
+ ntpq/ntpq-opts.texi@1.24 +3 -3
+ NTP_4_2_3P50
+
+ ntpq/ntpq.1@1.24 +2 -2
+ NTP_4_2_3P50
+
+ packageinfo.sh@1.42 +1 -1
+ NTP_4_2_3P50
+
+ sntp/sntp-opts.c@1.23 +17 -16
+ NTP_4_2_3P50
+
+ sntp/sntp-opts.h@1.23 +7 -7
+ NTP_4_2_3P50
+
+ sntp/sntp-opts.texi@1.23 +1 -1
+ NTP_4_2_3P50
+
+ sntp/sntp.1@1.26 +2 -2
+ NTP_4_2_3P50
+
+ util/ntp-keygen-opts.c@1.23 +43 -43
+ NTP_4_2_3P50
+
+ util/ntp-keygen-opts.h@1.23 +10 -10
+ NTP_4_2_3P50
+
+ util/ntp-keygen-opts.texi@1.23 +1 -1
+ NTP_4_2_3P50
+
+ util/ntp-keygen.1@1.23 +2 -2
+ NTP_4_2_3P50
+
+ChangeSet@1.1379.1.21, 2006-09-24 03:03:52-04:00, stenn@whimsy.udel.edu
+ autogen upgrade
+
+ clockstuff/clktest-opts.c@1.4 +1 -1
+ autogen upgrade
+
+ clockstuff/clktest-opts.c@1.3 +39 -39
+ new autogen
+
+ clockstuff/clktest-opts.h@1.4 +1 -1
+ autogen upgrade
+
+ clockstuff/clktest-opts.h@1.3 +10 -10
+ new autogen
+
+ libopts/autoopts.c@1.7 +7 -7
+ autogen upgrade
+
+ libopts/autoopts.h@1.7 +3 -3
+ autogen upgrade
+
+ libopts/autoopts/options.h@1.7 +51 -42
+ autogen upgrade
+
+ libopts/autoopts/usage-txt.h@1.6 +2 -2
+ autogen upgrade
+
+ libopts/boolean.c@1.6 +6 -6
+ autogen upgrade
+
+ libopts/compat/compat.h@1.10 +1 -1
+ autogen upgrade
+
+ libopts/compat/pathfind.c@1.7 +16 -16
+ autogen upgrade
+
+ libopts/compat/snprintf.c@1.4 +2 -2
+ autogen upgrade
+
+ libopts/compat/strchr.c@1.2 +5 -5
+ autogen upgrade
+
+ libopts/compat/strdup.c@1.3 +1 -1
+ autogen upgrade
+
+ libopts/configfile.c@1.7 +23 -23
+ autogen upgrade
+
+ libopts/cook.c@1.6 +3 -3
+ autogen upgrade
+
+ libopts/enumeration.c@1.6 +23 -23
+ autogen upgrade
+
+ libopts/environment.c@1.6 +2 -2
+ autogen upgrade
+
+ libopts/genshell.c@1.6 +8 -8
+ autogen upgrade
+
+ libopts/genshell.h@1.6 +4 -4
+ autogen upgrade
+
+ libopts/load.c@1.7 +4 -4
+ autogen upgrade
+
+ libopts/m4/libopts.m4@1.11 +3 -3
+ autogen upgrade
+
+ libopts/makeshell.c@1.8 +13 -12
+ autogen upgrade
+
+ libopts/nested.c@1.6 +38 -38
+ autogen upgrade
+
+ libopts/numeric.c@1.6 +7 -7
+ autogen upgrade
+
+ libopts/pgusage.c@1.7 +1 -1
+ autogen upgrade
+
+ libopts/proto.h@1.8 +2 -2
+ autogen upgrade
+
+ libopts/putshell.c@1.7 +12 -12
+ autogen upgrade
+
+ libopts/restore.c@1.6 +1 -1
+ autogen upgrade
+
+ libopts/save.c@1.7 +14 -12
+ autogen upgrade
+
+ libopts/sort.c@1.6 +1 -1
+ autogen upgrade
+
+ libopts/stack.c@1.7 +6 -6
+ autogen upgrade
+
+ libopts/streqvcmp.c@1.7 +9 -9
+ autogen upgrade
+
+ libopts/text_mmap.c@1.6 +3 -3
+ autogen upgrade
+
+ libopts/tokenize.c@1.4 +8 -8
+ autogen upgrade
+
+ libopts/usage.c@1.7 +2 -2
+ autogen upgrade
+
+ libopts/version.c@1.7 +9 -9
+ autogen upgrade
+
+ ntpq/ntpq-opts.c@1.25 +1 -1
+ autogen upgrade
+
+ ntpq/ntpq-opts.c@1.24 +17 -17
+ new autogen
+
+ ntpq/ntpq-opts.h@1.25 +1 -1
+ autogen upgrade
+
+ ntpq/ntpq-opts.h@1.24 +5 -5
+ new autogen
+
+ sntp/libopts/autoopts.c@1.4 +51 -7
+ autogen upgrade
+
+ sntp/libopts/autoopts.h@1.5 +10 -9
+ autogen upgrade
+
+ sntp/libopts/autoopts/options.h@1.4 +60 -51
+ autogen upgrade
+
+ sntp/libopts/autoopts/usage-txt.h@1.3 +2 -2
+ autogen upgrade
+
+ sntp/libopts/boolean.c@1.3 +5 -5
+ autogen upgrade
+
+ sntp/libopts/compat/compat.h@1.6 +7 -7
+ autogen upgrade
+
+ sntp/libopts/compat/pathfind.c@1.4 +19 -19
+ autogen upgrade
+
+ sntp/libopts/compat/snprintf.c@1.3 +4 -4
+ autogen upgrade
+
+ sntp/libopts/compat/strchr.c@1.2 +5 -5
+ autogen upgrade
+
+ sntp/libopts/compat/strdup.c@1.2 +3 -3
+ autogen upgrade
+
+ sntp/libopts/configfile.c@1.4 +37 -35
+ autogen upgrade
+
+ sntp/libopts/cook.c@1.3 +3 -3
+ autogen upgrade
+
+ sntp/libopts/enumeration.c@1.3 +23 -23
+ autogen upgrade
+
+ sntp/libopts/environment.c@1.3 +2 -2
+ autogen upgrade
+
+ sntp/libopts/genshell.c@1.3 +11 -10
+ autogen upgrade
+
+ sntp/libopts/genshell.h@1.3 +8 -8
+ autogen upgrade
+
+ sntp/libopts/load.c@1.4 +4 -4
+ autogen upgrade
+
+ sntp/libopts/m4/libopts.m4@1.8 +8 -3
+ autogen upgrade
+
+ sntp/libopts/makeshell.c@1.5 +13 -12
+ autogen upgrade
+
+ sntp/libopts/nested.c@1.3 +40 -40
+ autogen upgrade
+
+ sntp/libopts/numeric.c@1.3 +6 -6
+ autogen upgrade
+
+ sntp/libopts/proto.h@1.5 +14 -2
+ autogen upgrade
+
+ sntp/libopts/putshell.c@1.4 +11 -11
+ autogen upgrade
+
+ sntp/libopts/save.c@1.4 +14 -12
+ autogen upgrade
+
+ sntp/libopts/stack.c@1.4 +5 -5
+ autogen upgrade
+
+ sntp/libopts/streqvcmp.c@1.4 +9 -9
+ autogen upgrade
+
+ sntp/libopts/text_mmap.c@1.3 +12 -16
+ autogen upgrade
+
+ sntp/libopts/tokenize.c@1.3 +16 -16
+ autogen upgrade
+
+ sntp/libopts/usage.c@1.5 +2 -2
+ autogen upgrade
+
+ sntp/libopts/version.c@1.4 +9 -9
+ autogen upgrade
+
+ChangeSet@1.1379.1.20, 2006-09-23 17:23:36+00:00, kardel@pogo.udel.edu
+ ntpd.h, ntpd.c, ntp_timer.c, ntp_io.c, cmd_args.c:
+ disable dynamic update when giving up the root privilege
+
+ include/ntpd.h@1.97 +3 -0
+ disable dynamic update when giving up the root privilege
+
+ ntpd/cmd_args.c@1.45 +0 -1
+ disable dynamic update when giving up the root privilege
+
+ ntpd/ntp_io.c@1.234.1.11 +22 -5
+ disable dynamic update when giving up the root privilege
+
+ ntpd/ntp_timer.c@1.33 +1 -1
+ disable dynamic update when giving up the root privilege
+
+ ntpd/ntpd.c@1.82 +12 -0
+ disable dynamic update when giving up the root privilege
+
+ChangeSet@1.1379.7.2, 2006-09-22 20:27:38-04:00, stenn@whimsy.udel.edu
+ [Bug 714] ntpq -p should conflict with -i, not -c.
+
+ NEWS@1.63 +1 -0
+ update
+
+ ntpq/ntpq-opts.c@1.23 +5 -4
+ [Bug 714] ntpq -p should conflict with -i, not -c.
+
+ ntpq/ntpq-opts.def@1.11 +1 -1
+ [Bug 714] ntpq -p should conflict with -i, not -c.
+
+ ntpq/ntpq-opts.h@1.23 +1 -1
+ [Bug 714] ntpq -p should conflict with -i, not -c.
+
+ ntpq/ntpq-opts.texi@1.23 +4 -4
+ [Bug 714] ntpq -p should conflict with -i, not -c.
+
+ ntpq/ntpq.1@1.23 +3 -3
+ [Bug 714] ntpq -p should conflict with -i, not -c.
+
+ChangeSet@1.1379.7.1, 2006-09-22 19:38:01-04:00, stenn@whimsy.udel.edu
+ Upgrade to libopts-27.4.3
+
+ libopts/Makefile.am@1.5 +10 -6
+ Upgrade to libopts-27.4.3
+
+ libopts/autoopts.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/autoopts.h@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/autoopts/options.h@1.6 +5 -5
+ Upgrade to libopts-27.4.3
+
+ libopts/autoopts/usage-txt.h@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/boolean.c@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/compat/compat.h@1.9 +5 -5
+ Upgrade to libopts-27.4.3
+
+ libopts/compat/pathfind.c@1.6 +2 -2
+ Upgrade to libopts-27.4.3
+
+ libopts/compat/snprintf.c@1.3 +2 -2
+ Upgrade to libopts-27.4.3
+
+ libopts/compat/strdup.c@1.2 +2 -2
+ Upgrade to libopts-27.4.3
+
+ libopts/compat/windows-config.h@1.3 +6 -6
+ Upgrade to libopts-27.4.3
+
+ libopts/configfile.c@1.6 +12 -13
+ Upgrade to libopts-27.4.3
+
+ libopts/cook.c@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/enumeration.c@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/environment.c@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/genshell.c@1.5 +4 -3
+ Upgrade to libopts-27.4.3
+
+ libopts/genshell.h@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/load.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/m4/libopts.m4@1.10 +6 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/makeshell.c@1.7 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/nested.c@1.5 +3 -3
+ Upgrade to libopts-27.4.3
+
+ libopts/numeric.c@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/pgusage.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/proto.h@1.7 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/putshell.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/restore.c@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/save.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/sort.c@1.5 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/stack.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/streqvcmp.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/text_mmap.c@1.5 +3 -2
+ Upgrade to libopts-27.4.3
+
+ libopts/tokenize.c@1.3 +14 -14
+ Upgrade to libopts-27.4.3
+
+ libopts/usage.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ libopts/version.c@1.6 +1 -1
+ Upgrade to libopts-27.4.3
+
+ChangeSet@1.1379.1.18, 2006-09-22 22:58:27+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ add autoconfig enabled code to temporarily
+ set SO_REUSEADDR on wildcard sockets when
+ binding interface addresses. So OSes need
+ this
+ configure.ac:
+ add configtest for REUSEADDR enable on wildcard sockets
+ to allow binding to interface addresses
+
+ configure.ac@1.388.1.10 +13 -0
+ add configtest for REUSEADDR enable on wildcard sockets
+ to allow binding to interface addresses
+
+ ntpd/ntp_io.c@1.234.1.10 +96 -48
+ add autoconfig enabled code to temporarily
+ set SO_REUSEADDR on wildcard sockets when
+ binding interface addresses. So OSes need
+ this
+
+ChangeSet@1.1379.1.17, 2006-09-22 17:12:19-04:00, stenn@whimsy.udel.edu
+ Dave fixed a bug in the pll/kernel control code, from a report by Joe Harvell
+
+ ntpd/ntp_loopfilter.c@1.126 +2 -1
+ Dave fixed a bug in the pll/kernel control code, from a report by Joe Harvell
+
+ChangeSet@1.1379.1.16, 2006-09-21 07:42:50-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P49
+ TAG: NTP_4_2_3P49
+
+ ntpd/ntpd-opts.c@1.23 +2 -2
+ NTP_4_2_3P49
+
+ ntpd/ntpd-opts.h@1.23 +3 -3
+ NTP_4_2_3P49
+
+ ntpd/ntpd-opts.texi@1.24 +1 -1
+ NTP_4_2_3P49
+
+ ntpd/ntpd.1@1.23 +2 -2
+ NTP_4_2_3P49
+
+ ntpd/ntpdsim-opts.c@1.23 +2 -2
+ NTP_4_2_3P49
+
+ ntpd/ntpdsim-opts.h@1.23 +3 -3
+ NTP_4_2_3P49
+
+ ntpd/ntpdsim-opts.texi@1.23 +1 -1
+ NTP_4_2_3P49
+
+ ntpd/ntpdsim.1@1.23 +2 -2
+ NTP_4_2_3P49
+
+ ntpdc/ntpdc-opts.c@1.23 +2 -2
+ NTP_4_2_3P49
+
+ ntpdc/ntpdc-opts.h@1.23 +3 -3
+ NTP_4_2_3P49
+
+ ntpdc/ntpdc-opts.texi@1.23 +1 -1
+ NTP_4_2_3P49
+
+ ntpdc/ntpdc.1@1.23 +2 -2
+ NTP_4_2_3P49
+
+ ntpq/ntpq-opts.c@1.22 +2 -2
+ NTP_4_2_3P49
+
+ ntpq/ntpq-opts.h@1.22 +3 -3
+ NTP_4_2_3P49
+
+ ntpq/ntpq-opts.texi@1.22 +1 -1
+ NTP_4_2_3P49
+
+ ntpq/ntpq.1@1.22 +2 -2
+ NTP_4_2_3P49
+
+ packageinfo.sh@1.41 +1 -1
+ NTP_4_2_3P49
+
+ sntp/sntp-opts.c@1.22 +2 -2
+ NTP_4_2_3P49
+
+ sntp/sntp-opts.h@1.22 +3 -3
+ NTP_4_2_3P49
+
+ sntp/sntp-opts.texi@1.22 +1 -1
+ NTP_4_2_3P49
+
+ sntp/sntp.1@1.25 +2 -2
+ NTP_4_2_3P49
+
+ util/ntp-keygen-opts.c@1.22 +2 -2
+ NTP_4_2_3P49
+
+ util/ntp-keygen-opts.h@1.22 +3 -3
+ NTP_4_2_3P49
+
+ util/ntp-keygen-opts.texi@1.22 +1 -1
+ NTP_4_2_3P49
+
+ util/ntp-keygen.1@1.22 +2 -2
+ NTP_4_2_3P49
+
+ChangeSet@1.1379.1.15, 2006-09-20 19:41:43-04:00, stenn@whimsy.udel.edu
+ refclock_wwv.c improvements from Dave Mills
+
+ NEWS@1.62 +1 -0
+ refclock_wwv.c improvements from Dave Mills
+
+ ntpd/refclock_wwv.c@1.64 +50 -40
+ refclock_wwv.c improvements from Dave Mills
+
+ChangeSet@1.1379.1.14, 2006-09-20 19:31:10-04:00, stenn@whimsy.udel.edu
+ [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked.
+
+ NEWS@1.61 +1 -0
+ [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked.
+
+ ntpd/refclock_heath.c@1.13 +39 -10
+ [Bug 689] Deprecate HEATH GC-1001 II; the driver never worked.
+
+ChangeSet@1.1379.1.13, 2006-09-19 07:43:25-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P48
+ TAG: NTP_4_2_3P48
+
+ ntpd/ntpd-opts.c@1.22 +2 -2
+ NTP_4_2_3P48
+
+ ntpd/ntpd-opts.h@1.22 +3 -3
+ NTP_4_2_3P48
+
+ ntpd/ntpd-opts.texi@1.23 +1 -1
+ NTP_4_2_3P48
+
+ ntpd/ntpd.1@1.22 +2 -2
+ NTP_4_2_3P48
+
+ ntpd/ntpdsim-opts.c@1.22 +2 -2
+ NTP_4_2_3P48
+
+ ntpd/ntpdsim-opts.h@1.22 +3 -3
+ NTP_4_2_3P48
+
+ ntpd/ntpdsim-opts.texi@1.22 +1 -1
+ NTP_4_2_3P48
+
+ ntpd/ntpdsim.1@1.22 +2 -2
+ NTP_4_2_3P48
+
+ ntpdc/ntpdc-opts.c@1.22 +2 -2
+ NTP_4_2_3P48
+
+ ntpdc/ntpdc-opts.h@1.22 +3 -3
+ NTP_4_2_3P48
+
+ ntpdc/ntpdc-opts.texi@1.22 +1 -1
+ NTP_4_2_3P48
+
+ ntpdc/ntpdc.1@1.22 +2 -2
+ NTP_4_2_3P48
+
+ ntpq/ntpq-opts.c@1.21 +2 -2
+ NTP_4_2_3P48
+
+ ntpq/ntpq-opts.h@1.21 +3 -3
+ NTP_4_2_3P48
+
+ ntpq/ntpq-opts.texi@1.21 +1 -1
+ NTP_4_2_3P48
+
+ ntpq/ntpq.1@1.21 +2 -2
+ NTP_4_2_3P48
+
+ packageinfo.sh@1.40 +1 -1
+ NTP_4_2_3P48
+
+ sntp/sntp-opts.c@1.21 +2 -2
+ NTP_4_2_3P48
+
+ sntp/sntp-opts.h@1.21 +3 -3
+ NTP_4_2_3P48
+
+ sntp/sntp-opts.texi@1.21 +1 -1
+ NTP_4_2_3P48
+
+ sntp/sntp.1@1.24 +2 -2
+ NTP_4_2_3P48
+
+ util/ntp-keygen-opts.c@1.21 +2 -2
+ NTP_4_2_3P48
+
+ util/ntp-keygen-opts.h@1.21 +3 -3
+ NTP_4_2_3P48
+
+ util/ntp-keygen-opts.texi@1.21 +1 -1
+ NTP_4_2_3P48
+
+ util/ntp-keygen.1@1.21 +2 -2
+ NTP_4_2_3P48
+
+ChangeSet@1.1251.94.59, 2006-09-18 23:55:40-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P4_RC4
+ TAG: NTP_4_2_2P4_RC4
+
+ packageinfo.sh@1.27.19.2 +1 -1
+ NTP_4_2_2P4_RC4
+
+ChangeSet@1.1251.94.58, 2006-09-18 18:06:02-04:00, stenn@whimsy.udel.edu
+ [Bug 710] Backport Danny's latest patch
+
+ libntp/ntp_rfc2553.c@1.27.1.6 +10 -3
+ [Bug 710] Backport Danny's latest patch
+
+ChangeSet@1.1379.1.11, 2006-09-18 16:23:45-04:00, mayer@pogo.udel.edu
+ Bug #710 Fix new off-by-one error
+
+ libntp/ntp_rfc2553.c@1.35 +1 -1
+ Bug #710 Fix new off-by-one error
+
+ChangeSet@1.1379.1.10, 2006-09-18 16:17:26-04:00, mayer@pogo.udel.edu
+ Bug #655 Added refid for broadcast mode
+
+ ntpd/ntp_io.c@1.234.1.9 +1 -0
+ Bug #655 Added refid for broadcast mode
+
+ChangeSet@1.1379.1.9, 2006-09-18 08:46:18-04:00, mayer@pogo.udel.edu
+ Bug #710 fix the length being copied in getnameinfo
+
+ libntp/ntp_rfc2553.c@1.34 +10 -3
+ Bug #710 fix the length being copied in getnameinfo
+
+ChangeSet@1.1379.2.35, 2006-09-16 18:54:38-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P47
+ TAG: NTP_4_2_3P47
+
+ ntpd/ntpd-opts.c@1.21 +2 -2
+ NTP_4_2_3P47
+
+ ntpd/ntpd-opts.h@1.21 +3 -3
+ NTP_4_2_3P47
+
+ ntpd/ntpd-opts.texi@1.22 +1 -1
+ NTP_4_2_3P47
+
+ ntpd/ntpd.1@1.21 +2 -2
+ NTP_4_2_3P47
+
+ ntpd/ntpdsim-opts.c@1.21 +2 -2
+ NTP_4_2_3P47
+
+ ntpd/ntpdsim-opts.h@1.21 +3 -3
+ NTP_4_2_3P47
+
+ ntpd/ntpdsim-opts.texi@1.21 +1 -1
+ NTP_4_2_3P47
+
+ ntpd/ntpdsim.1@1.21 +2 -2
+ NTP_4_2_3P47
+
+ ntpdc/ntpdc-opts.c@1.21 +2 -2
+ NTP_4_2_3P47
+
+ ntpdc/ntpdc-opts.h@1.21 +3 -3
+ NTP_4_2_3P47
+
+ ntpdc/ntpdc-opts.texi@1.21 +1 -1
+ NTP_4_2_3P47
+
+ ntpdc/ntpdc.1@1.21 +2 -2
+ NTP_4_2_3P47
+
+ ntpq/ntpq-opts.c@1.20 +2 -2
+ NTP_4_2_3P47
+
+ ntpq/ntpq-opts.h@1.20 +3 -3
+ NTP_4_2_3P47
+
+ ntpq/ntpq-opts.texi@1.20 +1 -1
+ NTP_4_2_3P47
+
+ ntpq/ntpq.1@1.20 +2 -2
+ NTP_4_2_3P47
+
+ packageinfo.sh@1.39 +1 -1
+ NTP_4_2_3P47
+
+ sntp/sntp-opts.c@1.20 +2 -2
+ NTP_4_2_3P47
+
+ sntp/sntp-opts.h@1.20 +3 -3
+ NTP_4_2_3P47
+
+ sntp/sntp-opts.texi@1.20 +1 -1
+ NTP_4_2_3P47
+
+ sntp/sntp.1@1.23 +2 -2
+ NTP_4_2_3P47
+
+ util/ntp-keygen-opts.c@1.20 +2 -2
+ NTP_4_2_3P47
+
+ util/ntp-keygen-opts.h@1.20 +3 -3
+ NTP_4_2_3P47
+
+ util/ntp-keygen-opts.texi@1.20 +1 -1
+ NTP_4_2_3P47
+
+ util/ntp-keygen.1@1.20 +2 -2
+ NTP_4_2_3P47
+
+ChangeSet@1.1251.94.57, 2006-09-16 17:32:32-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P4_RC3
+ TAG: NTP_4_2_2P4_RC3
+
+ packageinfo.sh@1.27.19.1 +1 -1
+ NTP_4_2_2P4_RC3
+
+ChangeSet@1.1251.94.56, 2006-09-16 16:52:07-04:00, stenn@whimsy.udel.edu
+ updated NEWS
+
+ NEWS@1.50.1.6 +4 -0
+ updated
+
+ChangeSet@1.1251.94.55, 2006-09-16 15:00:36-04:00, stenn@whimsy.udel.edu
+ [Bug 710] compat getnameinfo() has off-by-one error
+
+ libntp/ntp_rfc2553.c@1.27.1.5 +1 -1
+ [Bug 710] compat getnameinfo() has off-by-one error
+
+ChangeSet@1.1379.2.33, 2006-09-13 07:43:13-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P46
+ TAG: NTP_4_2_3P46
+
+ ntpd/ntpd-opts.c@1.20 +2 -2
+ NTP_4_2_3P46
+
+ ntpd/ntpd-opts.h@1.20 +3 -3
+ NTP_4_2_3P46
+
+ ntpd/ntpd-opts.texi@1.21 +1 -1
+ NTP_4_2_3P46
+
+ ntpd/ntpd.1@1.20 +2 -2
+ NTP_4_2_3P46
+
+ ntpd/ntpdsim-opts.c@1.20 +2 -2
+ NTP_4_2_3P46
+
+ ntpd/ntpdsim-opts.h@1.20 +3 -3
+ NTP_4_2_3P46
+
+ ntpd/ntpdsim-opts.texi@1.20 +1 -1
+ NTP_4_2_3P46
+
+ ntpd/ntpdsim.1@1.20 +2 -2
+ NTP_4_2_3P46
+
+ ntpdc/ntpdc-opts.c@1.20 +2 -2
+ NTP_4_2_3P46
+
+ ntpdc/ntpdc-opts.h@1.20 +3 -3
+ NTP_4_2_3P46
+
+ ntpdc/ntpdc-opts.texi@1.20 +1 -1
+ NTP_4_2_3P46
+
+ ntpdc/ntpdc.1@1.20 +2 -2
+ NTP_4_2_3P46
+
+ ntpq/ntpq-opts.c@1.19 +2 -2
+ NTP_4_2_3P46
+
+ ntpq/ntpq-opts.h@1.19 +3 -3
+ NTP_4_2_3P46
+
+ ntpq/ntpq-opts.texi@1.19 +1 -1
+ NTP_4_2_3P46
+
+ ntpq/ntpq.1@1.19 +2 -2
+ NTP_4_2_3P46
+
+ packageinfo.sh@1.38 +1 -1
+ NTP_4_2_3P46
+
+ sntp/sntp-opts.c@1.19 +2 -2
+ NTP_4_2_3P46
+
+ sntp/sntp-opts.h@1.19 +3 -3
+ NTP_4_2_3P46
+
+ sntp/sntp-opts.texi@1.19 +1 -1
+ NTP_4_2_3P46
+
+ sntp/sntp.1@1.22 +2 -2
+ NTP_4_2_3P46
+
+ util/ntp-keygen-opts.c@1.19 +2 -2
+ NTP_4_2_3P46
+
+ util/ntp-keygen-opts.h@1.19 +3 -3
+ NTP_4_2_3P46
+
+ util/ntp-keygen-opts.texi@1.19 +1 -1
+ NTP_4_2_3P46
+
+ util/ntp-keygen.1@1.19 +2 -2
+ NTP_4_2_3P46
+
+ChangeSet@1.1379.2.32, 2006-09-13 04:49:48-04:00, stenn@whimsy.udel.edu
+ WWV documentation fixes from Dave Mills.
+
+ html/drivers/driver36.html@1.28 +53 -100
+ WWV documentation fixes from Dave Mills.
+
+ html/drivers/driver44.html@1.13 +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.1379.2.31, 2006-09-13 04:44:52-04:00, stenn@whimsy.udel.edu
+ [Bug 704] Fix documentation typo
+
+ html/authopt.html@1.41 +2 -2
+ [Bug 704] Fix documentation typo
+
+ChangeSet@1.1379.2.30, 2006-09-12 21:35:52-04:00, stenn@whimsy.udel.edu
+ [Bug 706] Only 1 instance of ntpd should be running
+
+ ntpd/ntp_io.c@1.234.1.8 +17 -5
+ [Bug 706] Only 1 instance of ntpd should be running
+
+ChangeSet@1.1379.2.29, 2006-09-12 07:42:34-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P45
+ TAG: NTP_4_2_3P45
+
+ ntpd/ntpd-opts.c@1.19 +2 -2
+ NTP_4_2_3P45
+
+ ntpd/ntpd-opts.h@1.19 +3 -3
+ NTP_4_2_3P45
+
+ ntpd/ntpd-opts.texi@1.20 +1 -1
+ NTP_4_2_3P45
+
+ ntpd/ntpd.1@1.19 +2 -2
+ NTP_4_2_3P45
+
+ ntpd/ntpdsim-opts.c@1.19 +2 -2
+ NTP_4_2_3P45
+
+ ntpd/ntpdsim-opts.h@1.19 +3 -3
+ NTP_4_2_3P45
+
+ ntpd/ntpdsim-opts.texi@1.19 +1 -1
+ NTP_4_2_3P45
+
+ ntpd/ntpdsim.1@1.19 +2 -2
+ NTP_4_2_3P45
+
+ ntpdc/ntpdc-opts.c@1.19 +2 -2
+ NTP_4_2_3P45
+
+ ntpdc/ntpdc-opts.h@1.19 +3 -3
+ NTP_4_2_3P45
+
+ ntpdc/ntpdc-opts.texi@1.19 +1 -1
+ NTP_4_2_3P45
+
+ ntpdc/ntpdc.1@1.19 +2 -2
+ NTP_4_2_3P45
+
+ ntpq/ntpq-opts.c@1.18 +2 -2
+ NTP_4_2_3P45
+
+ ntpq/ntpq-opts.h@1.18 +3 -3
+ NTP_4_2_3P45
+
+ ntpq/ntpq-opts.texi@1.18 +1 -1
+ NTP_4_2_3P45
+
+ ntpq/ntpq.1@1.18 +2 -2
+ NTP_4_2_3P45
+
+ packageinfo.sh@1.37 +1 -1
+ NTP_4_2_3P45
+
+ sntp/sntp-opts.c@1.18 +2 -2
+ NTP_4_2_3P45
+
+ sntp/sntp-opts.h@1.18 +3 -3
+ NTP_4_2_3P45
+
+ sntp/sntp-opts.texi@1.18 +1 -1
+ NTP_4_2_3P45
+
+ sntp/sntp.1@1.21 +2 -2
+ NTP_4_2_3P45
+
+ util/ntp-keygen-opts.c@1.18 +2 -2
+ NTP_4_2_3P45
+
+ util/ntp-keygen-opts.h@1.18 +3 -3
+ NTP_4_2_3P45
+
+ util/ntp-keygen-opts.texi@1.18 +1 -1
+ NTP_4_2_3P45
+
+ util/ntp-keygen.1@1.18 +2 -2
+ NTP_4_2_3P45
+
+ChangeSet@1.1379.6.1, 2006-09-12 08:25:26+00:00, kardel@pogo.udel.edu
+ ntp_peer.c:
+ CID 7: avoid calling broadcast/multicast setup with NULL interface
+
+ ntpd/ntp_peer.c@1.97 +13 -11
+ CID 7: avoid calling broadcast/multicast setup with NULL interface
+
+ChangeSet@1.1379.2.27, 2006-09-12 04:03:30-04:00, stenn@whimsy.udel.edu
+ WWV refclock fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.63 +7 -4
+ WWV refclock fixes from Dave Mills
+
+ChangeSet@1.1379.2.26, 2006-09-12 06:35:18+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ unify output of "Listening in interface..." message
+ add listing of wildcard interface bindings
+
+ ntpd/ntp_io.c@1.234.1.7 +25 -13
+ unify output of "Listening in interface..." message
+ add listing of wildcard interface bindings
+
+ChangeSet@1.1379.2.25, 2006-09-11 07:47:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P44
+ TAG: NTP_4_2_3P44
+
+ ntpd/ntpd-opts.c@1.18 +2 -2
+ NTP_4_2_3P44
+
+ ntpd/ntpd-opts.h@1.18 +3 -3
+ NTP_4_2_3P44
+
+ ntpd/ntpd-opts.texi@1.19 +1 -1
+ NTP_4_2_3P44
+
+ ntpd/ntpd.1@1.18 +2 -2
+ NTP_4_2_3P44
+
+ ntpd/ntpdsim-opts.c@1.18 +2 -2
+ NTP_4_2_3P44
+
+ ntpd/ntpdsim-opts.h@1.18 +3 -3
+ NTP_4_2_3P44
+
+ ntpd/ntpdsim-opts.texi@1.18 +1 -1
+ NTP_4_2_3P44
+
+ ntpd/ntpdsim.1@1.18 +2 -2
+ NTP_4_2_3P44
+
+ ntpdc/ntpdc-opts.c@1.18 +2 -2
+ NTP_4_2_3P44
+
+ ntpdc/ntpdc-opts.h@1.18 +3 -3
+ NTP_4_2_3P44
+
+ ntpdc/ntpdc-opts.texi@1.18 +1 -1
+ NTP_4_2_3P44
+
+ ntpdc/ntpdc.1@1.18 +2 -2
+ NTP_4_2_3P44
+
+ ntpq/ntpq-opts.c@1.17 +2 -2
+ NTP_4_2_3P44
+
+ ntpq/ntpq-opts.h@1.17 +3 -3
+ NTP_4_2_3P44
+
+ ntpq/ntpq-opts.texi@1.17 +1 -1
+ NTP_4_2_3P44
+
+ ntpq/ntpq.1@1.17 +2 -2
+ NTP_4_2_3P44
+
+ packageinfo.sh@1.36 +1 -1
+ NTP_4_2_3P44
+
+ sntp/sntp-opts.c@1.17 +2 -2
+ NTP_4_2_3P44
+
+ sntp/sntp-opts.h@1.17 +3 -3
+ NTP_4_2_3P44
+
+ sntp/sntp-opts.texi@1.17 +1 -1
+ NTP_4_2_3P44
+
+ sntp/sntp.1@1.20 +2 -2
+ NTP_4_2_3P44
+
+ util/ntp-keygen-opts.c@1.17 +2 -2
+ NTP_4_2_3P44
+
+ util/ntp-keygen-opts.h@1.17 +3 -3
+ NTP_4_2_3P44
+
+ util/ntp-keygen-opts.texi@1.17 +1 -1
+ NTP_4_2_3P44
+
+ util/ntp-keygen.1@1.17 +2 -2
+ NTP_4_2_3P44
+
+ChangeSet@1.1379.2.24, 2006-09-10 20:47:32-04:00, stenn@whimsy.udel.edu
+ libopts-27.4.3 updates
+
+ libopts/autoopts.c@1.5 +46 -2
+ libopts-27.4.3 updates
+
+ libopts/autoopts.h@1.5 +8 -7
+ libopts-27.4.3 updates
+
+ libopts/autoopts/options.h@1.5 +3 -3
+ libopts-27.4.3 updates
+
+ libopts/autoopts/usage-txt.h@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/boolean.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/compat/compat.h@1.8 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/compat/pathfind.c@1.5 +2 -2
+ libopts-27.4.3 updates
+
+ libopts/configfile.c@1.5 +5 -2
+ libopts-27.4.3 updates
+
+ libopts/cook.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/enumeration.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/environment.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/genshell.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/genshell.h@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/load.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/m4/libopts.m4@1.9 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/makeshell.c@1.6 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/nested.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/numeric.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/pgusage.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/proto.h@1.6 +13 -1
+ libopts-27.4.3 updates
+
+ libopts/putshell.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/restore.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/save.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/sort.c@1.4 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/stack.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/streqvcmp.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/text_mmap.c@1.4 +3 -8
+ libopts-27.4.3 updates
+
+ libopts/usage.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ libopts/version.c@1.5 +1 -1
+ libopts-27.4.3 updates
+
+ChangeSet@1.1379.2.23, 2006-09-10 18:03:04-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P43
+ TAG: NTP_4_2_3P43
+
+ ntpd/ntpd-opts.c@1.17 +2 -2
+ NTP_4_2_3P43
+
+ ntpd/ntpd-opts.h@1.17 +3 -3
+ NTP_4_2_3P43
+
+ ntpd/ntpd-opts.texi@1.18 +1 -1
+ NTP_4_2_3P43
+
+ ntpd/ntpd.1@1.17 +2 -2
+ NTP_4_2_3P43
+
+ ntpd/ntpdsim-opts.c@1.17 +2 -2
+ NTP_4_2_3P43
+
+ ntpd/ntpdsim-opts.h@1.17 +3 -3
+ NTP_4_2_3P43
+
+ ntpd/ntpdsim-opts.texi@1.17 +1 -1
+ NTP_4_2_3P43
+
+ ntpd/ntpdsim.1@1.17 +2 -2
+ NTP_4_2_3P43
+
+ ntpdc/ntpdc-opts.c@1.17 +2 -2
+ NTP_4_2_3P43
+
+ ntpdc/ntpdc-opts.h@1.17 +3 -3
+ NTP_4_2_3P43
+
+ ntpdc/ntpdc-opts.texi@1.17 +1 -1
+ NTP_4_2_3P43
+
+ ntpdc/ntpdc.1@1.17 +2 -2
+ NTP_4_2_3P43
+
+ ntpq/ntpq-opts.c@1.16 +2 -2
+ NTP_4_2_3P43
+
+ ntpq/ntpq-opts.h@1.16 +3 -3
+ NTP_4_2_3P43
+
+ ntpq/ntpq-opts.texi@1.16 +1 -1
+ NTP_4_2_3P43
+
+ ntpq/ntpq.1@1.16 +2 -2
+ NTP_4_2_3P43
+
+ packageinfo.sh@1.35 +1 -1
+ NTP_4_2_3P43
+
+ sntp/sntp-opts.c@1.16 +2 -2
+ NTP_4_2_3P43
+
+ sntp/sntp-opts.h@1.16 +3 -3
+ NTP_4_2_3P43
+
+ sntp/sntp-opts.texi@1.16 +1 -1
+ NTP_4_2_3P43
+
+ sntp/sntp.1@1.19 +2 -2
+ NTP_4_2_3P43
+
+ util/ntp-keygen-opts.c@1.16 +2 -2
+ NTP_4_2_3P43
+
+ util/ntp-keygen-opts.h@1.16 +3 -3
+ NTP_4_2_3P43
+
+ util/ntp-keygen-opts.texi@1.16 +1 -1
+ NTP_4_2_3P43
+
+ util/ntp-keygen.1@1.16 +2 -2
+ NTP_4_2_3P43
+
+ChangeSet@1.1379.2.22, 2006-09-10 15:58:36-04:00, stenn@whimsy.udel.edu
+ [CID 3] Not a typo. Rename variables so Harlan can read the code easier
+
+ libntp/recvbuff.c@1.24 +5 -4
+ [CID 3] Not a typo. Rename variables so Harlan can read the code easier
+
+ChangeSet@1.1379.2.21, 2006-09-10 07:48:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P42
+ TAG: NTP_4_2_3P42
+
+ ntpd/ntpd-opts.c@1.16 +2 -2
+ NTP_4_2_3P42
+
+ ntpd/ntpd-opts.h@1.16 +142 -171
+ NTP_4_2_3P42
+
+ ntpd/ntpd-opts.texi@1.17 +1 -1
+ NTP_4_2_3P42
+
+ ntpd/ntpd.1@1.16 +2 -2
+ NTP_4_2_3P42
+
+ ntpd/ntpdsim-opts.c@1.16 +2 -2
+ NTP_4_2_3P42
+
+ ntpd/ntpdsim-opts.h@1.16 +178 -216
+ NTP_4_2_3P42
+
+ ntpd/ntpdsim-opts.texi@1.16 +1 -1
+ NTP_4_2_3P42
+
+ ntpd/ntpdsim.1@1.16 +2 -2
+ NTP_4_2_3P42
+
+ ntpdc/ntpdc-opts.c@1.16 +2 -2
+ NTP_4_2_3P42
+
+ ntpdc/ntpdc-opts.h@1.16 +65 -75
+ NTP_4_2_3P42
+
+ ntpdc/ntpdc-opts.texi@1.16 +1 -1
+ NTP_4_2_3P42
+
+ ntpdc/ntpdc.1@1.16 +2 -2
+ NTP_4_2_3P42
+
+ ntpq/ntpq-opts.c@1.15 +2 -2
+ NTP_4_2_3P42
+
+ ntpq/ntpq-opts.h@1.15 +55 -63
+ NTP_4_2_3P42
+
+ ntpq/ntpq-opts.texi@1.15 +1 -1
+ NTP_4_2_3P42
+
+ ntpq/ntpq.1@1.15 +2 -2
+ NTP_4_2_3P42
+
+ packageinfo.sh@1.34 +1 -1
+ NTP_4_2_3P42
+
+ sntp/sntp-opts.c@1.15 +2 -2
+ NTP_4_2_3P42
+
+ sntp/sntp-opts.h@1.15 +50 -57
+ NTP_4_2_3P42
+
+ sntp/sntp-opts.texi@1.15 +1 -1
+ NTP_4_2_3P42
+
+ sntp/sntp.1@1.18 +2 -2
+ NTP_4_2_3P42
+
+ util/ntp-keygen-opts.c@1.15 +2 -2
+ NTP_4_2_3P42
+
+ util/ntp-keygen-opts.h@1.15 +102 -121
+ NTP_4_2_3P42
+
+ util/ntp-keygen-opts.texi@1.15 +1 -1
+ NTP_4_2_3P42
+
+ util/ntp-keygen.1@1.15 +2 -2
+ NTP_4_2_3P42
+
+ChangeSet@1.1379.2.20, 2006-09-09 20:11:07-04:00, stenn@whimsy.udel.edu
+ Fix a typo.
+
+ libntp/recvbuff.c@1.23 +1 -1
+ Fix a typo.
+
+ChangeSet@1.1379.2.19, 2006-09-09 18:29:08-04:00, stenn@whimsy.udel.edu
+ autogen upgrade
+
+ clockstuff/clktest-opts.c@1.2 +53 -36
+ autogen upgrade
+
+ clockstuff/clktest-opts.h@1.2 +72 -14
+ autogen upgrade
+
+ChangeSet@1.1379.2.18, 2006-09-09 18:21:20-04:00, stenn@whimsy.udel.edu
+ libopts-27.4.3
+
+ libopts/COPYING.lgpl@1.2 +1 -1
+ libopts-27.4.3
+
+ libopts/Makefile.am@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/autoopts.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/autoopts/options.h@1.4 +5 -5
+ libopts-27.4.3
+
+ libopts/autoopts/usage-txt.h@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/boolean.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/compat/compat.h@1.7 +3 -3
+ libopts-27.4.3
+
+ libopts/compat/pathfind.c@1.4 +5 -5
+ libopts-27.4.3
+
+ libopts/compat/windows-config.h@1.2 +4 -4
+ libopts-27.4.3
+
+ libopts/configfile.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/cook.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/enumeration.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/environment.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/genshell.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/genshell.h@1.3 +6 -6
+ libopts-27.4.3
+
+ libopts/load.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/m4/libopts.m4@1.8 +1 -1
+ libopts-27.4.3
+
+ libopts/makeshell.c@1.5 +1 -1
+ libopts-27.4.3
+
+ libopts/nested.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/numeric.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/pgusage.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/proto.h@1.5 +1 -1
+ libopts-27.4.3
+
+ libopts/putshell.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/restore.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/save.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/sort.c@1.3 +1 -1
+ libopts-27.4.3
+
+ libopts/stack.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/streqvcmp.c@1.4 +1 -1
+ libopts-27.4.3
+
+ libopts/text_mmap.c@1.3 +7 -7
+ libopts-27.4.3
+
+ libopts/version.c@1.4 +1 -1
+ libopts-27.4.3
+
+ChangeSet@1.1379.5.1, 2006-09-09 05:19:19-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P41
+ TAG: NTP_4_2_3P41
+
+ ntpd/ntpd-opts.c@1.15 +2 -2
+ NTP_4_2_3P41
+
+ ntpd/ntpd-opts.h@1.15 +3 -3
+ NTP_4_2_3P41
+
+ ntpd/ntpd-opts.texi@1.16 +1 -1
+ NTP_4_2_3P41
+
+ ntpd/ntpd.1@1.15 +2 -2
+ NTP_4_2_3P41
+
+ ntpd/ntpdsim-opts.c@1.15 +2 -2
+ NTP_4_2_3P41
+
+ ntpd/ntpdsim-opts.h@1.15 +3 -3
+ NTP_4_2_3P41
+
+ ntpd/ntpdsim-opts.texi@1.15 +1 -1
+ NTP_4_2_3P41
+
+ ntpd/ntpdsim.1@1.15 +2 -2
+ NTP_4_2_3P41
+
+ ntpdc/ntpdc-opts.c@1.15 +2 -2
+ NTP_4_2_3P41
+
+ ntpdc/ntpdc-opts.h@1.15 +3 -3
+ NTP_4_2_3P41
+
+ ntpdc/ntpdc-opts.texi@1.15 +1 -1
+ NTP_4_2_3P41
+
+ ntpdc/ntpdc.1@1.15 +2 -2
+ NTP_4_2_3P41
+
+ ntpq/ntpq-opts.c@1.14 +2 -2
+ NTP_4_2_3P41
+
+ ntpq/ntpq-opts.h@1.14 +3 -3
+ NTP_4_2_3P41
+
+ ntpq/ntpq-opts.texi@1.14 +1 -1
+ NTP_4_2_3P41
+
+ ntpq/ntpq.1@1.14 +2 -2
+ NTP_4_2_3P41
+
+ packageinfo.sh@1.33 +1 -1
+ NTP_4_2_3P41
+
+ sntp/sntp-opts.c@1.14 +2 -2
+ NTP_4_2_3P41
+
+ sntp/sntp-opts.h@1.14 +3 -3
+ NTP_4_2_3P41
+
+ sntp/sntp-opts.texi@1.14 +1 -1
+ NTP_4_2_3P41
+
+ sntp/sntp.1@1.17 +2 -2
+ NTP_4_2_3P41
+
+ util/ntp-keygen-opts.c@1.14 +2 -2
+ NTP_4_2_3P41
+
+ util/ntp-keygen-opts.h@1.14 +3 -3
+ NTP_4_2_3P41
+
+ util/ntp-keygen-opts.texi@1.14 +1 -1
+ NTP_4_2_3P41
+
+ util/ntp-keygen.1@1.14 +2 -2
+ NTP_4_2_3P41
+
+ChangeSet@1.1379.2.16, 2006-09-09 07:16:37+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ remove unnecessary test
+
+ ntpd/ntp_io.c@1.234.1.6 +1 -1
+ remove unnecessary test
+
+ChangeSet@1.1379.2.15, 2006-09-08 21:33:04-04:00, stenn@whimsy.udel.edu
+ [CID 6] Fix a possible null dereference
+
+ ntpd/ntp_io.c@1.234.1.5 +3 -3
+ [CID 6] Fix a possible null dereference
+
+ChangeSet@1.1379.2.14, 2006-09-08 19:23:32-04:00, stenn@whimsy.udel.edu
+ [Bug 691] ntp_monitor()/restrictions() interaction fixes
+
+ include/ntpd.h@1.96 +2 -2
+ [Bug 691] ntp_monitor()/restrictions() interaction fixes
+
+ ntpd/ntp_monitor.c@1.18 +7 -4
+ [Bug 691] ntp_monitor()/restrictions() interaction fixes
+
+ ntpd/ntp_proto.c@1.248 +3 -2
+ [Bug 691] ntp_monitor()/restrictions() interaction fixes
+
+ ntpd/ntp_restrict.c@1.22 +3 -2
+ [Bug 691] ntp_monitor()/restrictions() interaction fixes
+
+ChangeSet@1.1379.4.1, 2006-09-08 17:20:34-04:00, stenn@whimsy.udel.edu
+ autogen dependency cleanup
+
+ ntpdc/Makefile.am@1.33 +4 -4
+ autogen dependency cleanup
+
+ChangeSet@1.1379.2.12, 2006-09-08 20:42:56+00:00, kardel@pogo.udel.edu
+ configure.ac:
+ add config fragment to conditionally re-bind sockets
+ for OSes that fail to flush cached routes when more
+ specific route are discovered.
+ ntp_io.c:
+ re-bind sockets on OSes that fail to
+ flush cached routes when more specific
+ routes are discovered.
+
+ configure.ac@1.388.1.9 +13 -0
+ add config fragment to conditionally re-bind sockets
+ for OSes that fail to flush cached routes when more
+ specific route are discovered.
+
+ ntpd/ntp_io.c@1.234.1.4 +10 -3
+ re-bind sockets on OSes that fail to
+ flush cached routes when more specific
+ routes are discovered.
+
+ChangeSet@1.1379.2.11, 2006-09-07 21:45:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P39
+ TAG: NTP_4_2_3P39
+
+ ntpd/ntpd-opts.c@1.14 +2 -2
+ NTP_4_2_3P39
+
+ ntpd/ntpd-opts.h@1.14 +185 -4
+ NTP_4_2_3P39
+
+ ntpd/ntpd-opts.texi@1.15 +1 -1
+ NTP_4_2_3P39
+
+ ntpd/ntpd.1@1.14 +2 -2
+ NTP_4_2_3P39
+
+ ntpd/ntpdsim-opts.c@1.14 +2 -2
+ NTP_4_2_3P39
+
+ ntpd/ntpdsim-opts.h@1.14 +239 -4
+ NTP_4_2_3P39
+
+ ntpd/ntpdsim-opts.texi@1.14 +1 -1
+ NTP_4_2_3P39
+
+ ntpd/ntpdsim.1@1.14 +2 -2
+ NTP_4_2_3P39
+
+ ntpdc/ntpdc-opts.c@1.14 +2 -2
+ NTP_4_2_3P39
+
+ ntpdc/ntpdc-opts.h@1.14 +71 -4
+ NTP_4_2_3P39
+
+ ntpdc/ntpdc-opts.texi@1.14 +1 -1
+ NTP_4_2_3P39
+
+ ntpdc/ntpdc.1@1.14 +2 -2
+ NTP_4_2_3P39
+
+ ntpq/ntpq-opts.c@1.13 +2 -2
+ NTP_4_2_3P39
+
+ ntpq/ntpq-opts.h@1.13 +59 -4
+ NTP_4_2_3P39
+
+ ntpq/ntpq-opts.texi@1.13 +1 -1
+ NTP_4_2_3P39
+
+ ntpq/ntpq.1@1.13 +2 -2
+ NTP_4_2_3P39
+
+ packageinfo.sh@1.32 +1 -1
+ NTP_4_2_3P39
+
+ sntp/sntp-opts.c@1.13 +3 -3
+ NTP_4_2_3P39
+
+ sntp/sntp-opts.h@1.13 +53 -4
+ NTP_4_2_3P39
+
+ sntp/sntp-opts.texi@1.13 +1 -1
+ NTP_4_2_3P39
+
+ sntp/sntp.1@1.16 +2 -2
+ NTP_4_2_3P39
+
+ util/ntp-keygen-opts.c@1.13 +2 -2
+ NTP_4_2_3P39
+
+ util/ntp-keygen-opts.h@1.13 +125 -4
+ NTP_4_2_3P39
+
+ util/ntp-keygen-opts.texi@1.13 +1 -1
+ NTP_4_2_3P39
+
+ util/ntp-keygen.1@1.13 +2 -2
+ NTP_4_2_3P39
+
+ChangeSet@1.1379.2.10, 2006-09-07 19:12:01-04:00, stenn@whimsy.udel.edu
+ autogen dependency cleanup
+
+ ntpd/Makefile.am@1.52 +8 -8
+ autogen dependency cleanup
+
+ ntpq/Makefile.am@1.25 +4 -4
+ autogen dependency cleanup
+
+ util/Makefile.am@1.34 +4 -4
+ autogen dependency cleanup
+
+ChangeSet@1.1379.2.9, 2006-09-07 19:07:52-04:00, stenn@whimsy.udel.edu
+ More WWV cleanup/fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.62 +6 -11
+ More WWV cleanup/fixes from Dave Mills
+
+ChangeSet@1.1379.2.8, 2006-09-07 03:22:04-04:00, stenn@whimsy.udel.edu
+ sntp/autogen-version.def should be ignored by bk
+
+ BitKeeper/etc/ignore@1.58 +1 -0
+ added sntp/autogen-version.def
+
+ChangeSet@1.1379.2.7, 2006-09-07 02:06:36-04:00, stenn@whimsy.udel.edu
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ clockstuff/clktest-opts.def@1.4 +1 -0
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ include/Makefile.am@1.24 +1 -1
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ include/autogen-version.def@1.2 +1 -0
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ ntpd/Makefile.am@1.51 +3 -2
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ ntpdc/Makefile.am@1.32 +3 -2
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ ntpdc/ntpdc-opts.def@1.12 +1 -0
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ ntpq/Makefile.am@1.24 +3 -2
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ ntpq/ntpq-opts.def@1.10 +1 -0
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ sntp/Makefile.am@1.21 +12 -2
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ sntp/sntp-opts.def@1.9 +2 -0
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ util/Makefile.am@1.33 +3 -2
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ util/ntp-keygen-opts.def@1.6 +1 -0
+ [Bug 695] autogen uprgrade: warn/protect macro collisions
+
+ChangeSet@1.1379.2.6, 2006-09-07 01:58:07-04:00, stenn@whimsy.udel.edu
+ WWV refclock changes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.61 +245 -294
+ WWV refclock changes from Dave Mills
+
+ChangeSet@1.1379.2.5, 2006-09-07 00:48:56-05:00, stenn@poog.il.thewrittenword.com
+ [Bug 693] fix configure when there is __adtimex and no ntp_*time
+
+ configure.ac@1.388.1.8 +7 -10
+ [Bug 693] fix configure when there is __adtimex and no ntp_*time
+
+ChangeSet@1.1379.2.4, 2006-08-31 02:06:16-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P38
+ TAG: NTP_4_2_3P38
+
+ ntpd/ntpd-opts.c@1.13 +2 -2
+ NTP_4_2_3P38
+
+ ntpd/ntpd-opts.h@1.13 +3 -3
+ NTP_4_2_3P38
+
+ ntpd/ntpd-opts.texi@1.14 +1 -1
+ NTP_4_2_3P38
+
+ ntpd/ntpd.1@1.13 +2 -2
+ NTP_4_2_3P38
+
+ ntpd/ntpdsim-opts.c@1.13 +2 -2
+ NTP_4_2_3P38
+
+ ntpd/ntpdsim-opts.h@1.13 +3 -3
+ NTP_4_2_3P38
+
+ ntpd/ntpdsim-opts.texi@1.13 +1 -1
+ NTP_4_2_3P38
+
+ ntpd/ntpdsim.1@1.13 +2 -2
+ NTP_4_2_3P38
+
+ ntpdc/ntpdc-opts.c@1.13 +2 -2
+ NTP_4_2_3P38
+
+ ntpdc/ntpdc-opts.h@1.13 +3 -3
+ NTP_4_2_3P38
+
+ ntpdc/ntpdc-opts.texi@1.13 +1 -1
+ NTP_4_2_3P38
+
+ ntpdc/ntpdc.1@1.13 +2 -2
+ NTP_4_2_3P38
+
+ ntpq/ntpq-opts.c@1.12 +2 -2
+ NTP_4_2_3P38
+
+ ntpq/ntpq-opts.h@1.12 +3 -3
+ NTP_4_2_3P38
+
+ ntpq/ntpq-opts.texi@1.12 +1 -1
+ NTP_4_2_3P38
+
+ ntpq/ntpq.1@1.12 +2 -2
+ NTP_4_2_3P38
+
+ packageinfo.sh@1.31 +1 -1
+ NTP_4_2_3P38
+
+ sntp/sntp-opts.c@1.12 +2 -2
+ NTP_4_2_3P38
+
+ sntp/sntp-opts.h@1.12 +3 -3
+ NTP_4_2_3P38
+
+ sntp/sntp-opts.texi@1.12 +1 -1
+ NTP_4_2_3P38
+
+ sntp/sntp.1@1.15 +2 -2
+ NTP_4_2_3P38
+
+ util/ntp-keygen-opts.c@1.12 +2 -2
+ NTP_4_2_3P38
+
+ util/ntp-keygen-opts.h@1.12 +3 -3
+ NTP_4_2_3P38
+
+ util/ntp-keygen-opts.texi@1.12 +1 -1
+ NTP_4_2_3P38
+
+ util/ntp-keygen.1@1.12 +2 -2
+ NTP_4_2_3P38
+
+ChangeSet@1.1379.2.3, 2006-08-30 06:28:59-04:00, stenn@whimsy.udel.edu
+ [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks
+
+ NEWS@1.59 +2 -0
+ [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks
+
+ configure.ac@1.388.1.7 +20 -18
+ [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks
+
+ ntpd/Makefile.am@1.50 +6 -3
+ [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks
+
+ ntpd/ntp_control.c@1.87 +3 -3
+ [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks
+
+ ntpd/refclock_conf.c@1.26 +4 -4
+ [Bug 340, 342] Deprecate broken TRAK and MSF EES refclocks
+
+ChangeSet@1.1379.3.1, 2006-08-29 23:45:21-04:00, stenn@whimsy.udel.edu
+ Fix dependency order problem
+
+ sntp/Makefile.am@1.20 +2 -1
+ Fix dependency order problem
+
+ChangeSet@1.1379.2.1, 2006-08-29 16:05:33-04:00, neal@pogo.udel.edu
+ refclock_bancomm.c:
+ [BUG 421] add support for bc637PCI
+
+ ntpd/refclock_bancomm.c@1.9 +138 -104
+ [BUG 421] add support for bc637PCI
+
+ChangeSet@1.1353.9.51, 2006-08-29 07:55:52-04:00, mayer@pogo.udel.edu
+ Bug #656: Multicast address argument copied incorrectly
+
+ ntpdate/ntpdate.c@1.59 +1 -1
+ Bug #656: Multicast address argument copied wrongly
+
+ChangeSet@1.1379.1.5, 2006-08-29 06:47:20-04:00, stenn@whimsy.udel.edu
+ loopfilter changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.125 +12 -15
+ loopfilter changes from Dave Mills
+
+ChangeSet@1.1379.1.4, 2006-08-29 08:16:22+00:00, stenn@ntp1.isc.org
+ [Bug 603] Cleanup the configure patch for the libelf fix
+
+ configure.ac@1.388.1.6 +12 -9
+ [Bug 603] Cleanup the configure patch for the libelf fix
+
+ChangeSet@1.1379.1.3, 2006-08-28 21:48:10-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P37
+ TAG: NTP_4_2_3P37
+
+ ntpd/ntpd-opts.c@1.12 +2 -2
+ NTP_4_2_3P37
+
+ ntpd/ntpd-opts.h@1.12 +3 -3
+ NTP_4_2_3P37
+
+ ntpd/ntpd-opts.texi@1.13 +1 -1
+ NTP_4_2_3P37
+
+ ntpd/ntpd.1@1.12 +2 -2
+ NTP_4_2_3P37
+
+ ntpd/ntpdsim-opts.c@1.12 +2 -2
+ NTP_4_2_3P37
+
+ ntpd/ntpdsim-opts.h@1.12 +3 -3
+ NTP_4_2_3P37
+
+ ntpd/ntpdsim-opts.texi@1.12 +1 -1
+ NTP_4_2_3P37
+
+ ntpd/ntpdsim.1@1.12 +2 -2
+ NTP_4_2_3P37
+
+ ntpdc/ntpdc-opts.c@1.12 +2 -2
+ NTP_4_2_3P37
+
+ ntpdc/ntpdc-opts.h@1.12 +3 -3
+ NTP_4_2_3P37
+
+ ntpdc/ntpdc-opts.texi@1.12 +1 -1
+ NTP_4_2_3P37
+
+ ntpdc/ntpdc.1@1.12 +2 -2
+ NTP_4_2_3P37
+
+ ntpq/ntpq-opts.c@1.11 +2 -2
+ NTP_4_2_3P37
+
+ ntpq/ntpq-opts.h@1.11 +3 -3
+ NTP_4_2_3P37
+
+ ntpq/ntpq-opts.texi@1.11 +1 -1
+ NTP_4_2_3P37
+
+ ntpq/ntpq.1@1.11 +2 -2
+ NTP_4_2_3P37
+
+ packageinfo.sh@1.30 +1 -1
+ NTP_4_2_3P37
+
+ sntp/sntp-opts.c@1.11 +2 -2
+ NTP_4_2_3P37
+
+ sntp/sntp-opts.h@1.11 +3 -3
+ NTP_4_2_3P37
+
+ sntp/sntp-opts.texi@1.11 +1 -1
+ NTP_4_2_3P37
+
+ sntp/sntp.1@1.14 +2 -2
+ NTP_4_2_3P37
+
+ util/ntp-keygen-opts.c@1.11 +2 -2
+ NTP_4_2_3P37
+
+ util/ntp-keygen-opts.h@1.11 +3 -3
+ NTP_4_2_3P37
+
+ util/ntp-keygen-opts.texi@1.11 +1 -1
+ NTP_4_2_3P37
+
+ util/ntp-keygen.1@1.11 +2 -2
+ NTP_4_2_3P37
+
+ChangeSet@1.1379.1.2, 2006-08-28 05:03:05-04:00, stenn@whimsy.udel.edu
+ [Bug 603] Only link with libelf if we need it.
+
+ configure.ac@1.388.1.5 +22 -19
+ [Bug 603] Only link with libelf if we need it.
+
+ChangeSet@1.1379.1.1, 2006-08-27 23:47:09-04:00, stenn@whimsy.udel.edu
+ [Bug 692] sys_limitrejected is no longer incremented
+
+ ntpd/ntp_proto.c@1.247 +1 -0
+ [Bug 692] sys_limitrejected is no longer incremented
+
+ChangeSet@1.1379, 2006-08-27 20:49:57-04:00, stenn@whimsy.udel.edu
+ [Bug 688] Fix documentation typos
+
+ html/clockopt.html@1.19 +2 -2
+ [Bug 688] Fix documentation typos
+
+ html/notes.html@1.18 +10 -10
+ [Bug 688] Fix documentation typos
+
+ html/ntpd.html@1.39 +1 -1
+ [Bug 688] Fix documentation typos
+
+ html/ntpdate.html@1.18 +3 -1
+ [Bug 688] Fix documentation typos
+
+ html/ntpdc.html@1.25 +2 -2
+ [Bug 688] Fix documentation typos
+
+ChangeSet@1.1378, 2006-08-27 23:44:15+00:00, stenn@ntp1.isc.org
+ [Bug 153] Avoid DNS lookups of known netmasks or refclocks
+
+ ntpd/ntp_config.c@1.141 +30 -4
+ [Bug 153] Avoid DNS lookups of known netmasks or refclocks
+
+ChangeSet@1.1353.21.3, 2006-08-26 15:10:29-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P36
+ TAG: NTP_4_2_3P36
+
+ ntpd/ntpd-opts.c@1.11 +2 -2
+ NTP_4_2_3P36
+
+ ntpd/ntpd-opts.h@1.11 +3 -3
+ NTP_4_2_3P36
+
+ ntpd/ntpd-opts.texi@1.12 +1 -1
+ NTP_4_2_3P36
+
+ ntpd/ntpd.1@1.11 +2 -2
+ NTP_4_2_3P36
+
+ ntpd/ntpdsim-opts.c@1.11 +2 -2
+ NTP_4_2_3P36
+
+ ntpd/ntpdsim-opts.h@1.11 +3 -3
+ NTP_4_2_3P36
+
+ ntpd/ntpdsim-opts.texi@1.11 +1 -1
+ NTP_4_2_3P36
+
+ ntpd/ntpdsim.1@1.11 +2 -2
+ NTP_4_2_3P36
+
+ ntpdc/ntpdc-opts.c@1.11 +2 -2
+ NTP_4_2_3P36
+
+ ntpdc/ntpdc-opts.h@1.11 +3 -3
+ NTP_4_2_3P36
+
+ ntpdc/ntpdc-opts.texi@1.11 +1 -1
+ NTP_4_2_3P36
+
+ ntpdc/ntpdc.1@1.11 +2 -2
+ NTP_4_2_3P36
+
+ ntpq/ntpq-opts.c@1.10 +2 -2
+ NTP_4_2_3P36
+
+ ntpq/ntpq-opts.h@1.10 +3 -3
+ NTP_4_2_3P36
+
+ ntpq/ntpq-opts.texi@1.10 +1 -1
+ NTP_4_2_3P36
+
+ ntpq/ntpq.1@1.10 +2 -2
+ NTP_4_2_3P36
+
+ packageinfo.sh@1.29 +1 -1
+ NTP_4_2_3P36
+
+ sntp/sntp-opts.c@1.10 +2 -2
+ NTP_4_2_3P36
+
+ sntp/sntp-opts.h@1.10 +3 -3
+ NTP_4_2_3P36
+
+ sntp/sntp-opts.texi@1.10 +1 -1
+ NTP_4_2_3P36
+
+ sntp/sntp.1@1.13 +2 -2
+ NTP_4_2_3P36
+
+ util/ntp-keygen-opts.c@1.10 +2 -2
+ NTP_4_2_3P36
+
+ util/ntp-keygen-opts.h@1.10 +3 -3
+ NTP_4_2_3P36
+
+ util/ntp-keygen-opts.texi@1.10 +1 -1
+ NTP_4_2_3P36
+
+ util/ntp-keygen.1@1.10 +2 -2
+ NTP_4_2_3P36
+
+ChangeSet@1.1251.94.54, 2006-08-26 05:34:06-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P4_RC2
+ TAG: NTP_4_2_2P4_RC2
+
+ packageinfo.sh@1.27.18.1 +1 -1
+ NTP_4_2_2P4_RC2
+
+ChangeSet@1.1353.22.1, 2006-08-26 05:05:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P35
+ TAG: NTP_4_2_3P35
+
+ ntpd/ntpd-opts.c@1.10 +2 -2
+ NTP_4_2_3P35
+
+ ntpd/ntpd-opts.h@1.10 +3 -3
+ NTP_4_2_3P35
+
+ ntpd/ntpd-opts.texi@1.11 +1 -1
+ NTP_4_2_3P35
+
+ ntpd/ntpd.1@1.10 +2 -2
+ NTP_4_2_3P35
+
+ ntpd/ntpdsim-opts.c@1.10 +2 -2
+ NTP_4_2_3P35
+
+ ntpd/ntpdsim-opts.h@1.10 +3 -3
+ NTP_4_2_3P35
+
+ ntpd/ntpdsim-opts.texi@1.10 +1 -1
+ NTP_4_2_3P35
+
+ ntpd/ntpdsim.1@1.10 +2 -2
+ NTP_4_2_3P35
+
+ ntpdc/ntpdc-opts.c@1.10 +2 -2
+ NTP_4_2_3P35
+
+ ntpdc/ntpdc-opts.h@1.10 +3 -3
+ NTP_4_2_3P35
+
+ ntpdc/ntpdc-opts.texi@1.10 +1 -1
+ NTP_4_2_3P35
+
+ ntpdc/ntpdc.1@1.10 +2 -2
+ NTP_4_2_3P35
+
+ ntpq/ntpq-opts.c@1.9 +2 -2
+ NTP_4_2_3P35
+
+ ntpq/ntpq-opts.h@1.9 +3 -3
+ NTP_4_2_3P35
+
+ ntpq/ntpq-opts.texi@1.9 +1 -1
+ NTP_4_2_3P35
+
+ ntpq/ntpq.1@1.9 +2 -2
+ NTP_4_2_3P35
+
+ packageinfo.sh@1.28 +1 -1
+ NTP_4_2_3P35
+
+ sntp/sntp-opts.c@1.9 +2 -2
+ NTP_4_2_3P35
+
+ sntp/sntp-opts.h@1.9 +3 -3
+ NTP_4_2_3P35
+
+ sntp/sntp-opts.texi@1.9 +1 -1
+ NTP_4_2_3P35
+
+ sntp/sntp.1@1.12 +2 -2
+ NTP_4_2_3P35
+
+ util/ntp-keygen-opts.c@1.9 +2 -2
+ NTP_4_2_3P35
+
+ util/ntp-keygen-opts.h@1.9 +3 -3
+ NTP_4_2_3P35
+
+ util/ntp-keygen-opts.texi@1.9 +1 -1
+ NTP_4_2_3P35
+
+ util/ntp-keygen.1@1.9 +2 -2
+ NTP_4_2_3P35
+
+ChangeSet@1.1251.94.53, 2006-08-25 15:55:51-04:00, stenn@whimsy.udel.edu
+ update README.patches
+
+ README.patches@1.3 +11 -1
+ update
+
+ChangeSet@1.1251.94.52, 2006-08-25 09:00:40-04:00, mayer@pogo.udel.edu
+ Bug #690: Fix length returned. Prevents buffer overflow
+
+ ports/winnt/libntp/dnslookup.c@1.3.1.1 +1 -1
+ Bug #690: Fix length returned. Prevents buffer overflow
+
+ChangeSet@1.1353.20.1, 2006-08-25 08:57:39-04:00, mayer@pogo.udel.edu
+ Bug #690: Cleanup fix. Erroneous #define
+
+ libntp/ntp_rfc2553.c@1.32 +0 -1
+ Bug #690: Cleanup fix. Erroneous #define
+
+ChangeSet@1.1353.9.48, 2006-08-25 02:26:29-04:00, stenn@whimsy.udel.edu
+ Dependency cleanup
+
+ sntp/Makefile.am@1.19 +6 -6
+ Dependency cleanup
+
+ChangeSet@1.1353.9.47, 2006-08-25 02:24:00-04:00, stenn@whimsy.udel.edu
+ ntp_optind needs a declaration, not a definition
+
+ ntpdc/ntpdc.c@1.54 +1 -1
+ ntp_optind needs a declaration, not a definition
+
+ChangeSet@1.1251.94.51, 2006-08-24 19:50:32-04:00, stenn@whimsy.udel.edu
+ br-flock: mort lives
+
+ br-flock@1.10 +1 -1
+ br-flock: mort lives
+
+ChangeSet@1.1353.9.45, 2006-08-24 17:12:32-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills: Rename MAXSIG to MAXAMP to avoid a collision, tweak the code
+
+ ntpd/refclock_chu.c@1.38 +6 -6
+ Rename MAXSIG to MAXAMP to avoid a collision
+
+ ntpd/refclock_irig.c@1.23 +6 -6
+ Rename MAXSIG to MAXAMP to avoid a collision
+
+ ntpd/refclock_wwv.c@1.60 +124 -119
+ Rename MAXSIG to MAXAMP to avoid a collision, tweak the code
+
+ChangeSet@1.1353.9.44, 2006-08-24 16:04:18-04:00, stenn@whimsy.udel.edu
+ [Bug 638] remove STREAMS_TLI comment from legacy info
+
+ include/ntp_machine.h@1.23 +0 -2
+ [Bug 638] remove STREAMS_TLI comment from legacy info
+
+ChangeSet@1.1353.19.1, 2006-08-24 09:10:50-04:00, mayer@pogo.udel.edu
+ Bug #690:Proper fix for length issue
+
+ libntp/ntp_rfc2553.c@1.31 +2 -1
+ Bug #690:Proper fix for length issue
+
+ ports/winnt/libntp/dnslookup.c@1.4 +1 -1
+ Bug #690:Proper fix for length issue
+
+ChangeSet@1.1353.9.42, 2006-08-20 20:18:08-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P34
+ TAG: NTP_4_2_3P34
+
+ ntpd/ntpd-opts.c@1.9 +19 -19
+ NTP_4_2_3P34
+
+ ntpd/ntpd-opts.h@1.9 +5 -5
+ NTP_4_2_3P34
+
+ ntpd/ntpd-opts.texi@1.10 +7 -7
+ NTP_4_2_3P34
+
+ ntpd/ntpd.1@1.9 +5 -5
+ NTP_4_2_3P34
+
+ ntpd/ntpdsim-opts.c@1.9 +19 -19
+ NTP_4_2_3P34
+
+ ntpd/ntpdsim-opts.h@1.9 +5 -5
+ NTP_4_2_3P34
+
+ ntpd/ntpdsim-opts.texi@1.9 +7 -7
+ NTP_4_2_3P34
+
+ ntpd/ntpdsim.1@1.9 +5 -5
+ NTP_4_2_3P34
+
+ ntpdc/ntpdc-opts.c@1.9 +2 -2
+ NTP_4_2_3P34
+
+ ntpdc/ntpdc-opts.h@1.9 +3 -3
+ NTP_4_2_3P34
+
+ ntpdc/ntpdc-opts.texi@1.9 +1 -1
+ NTP_4_2_3P34
+
+ ntpdc/ntpdc.1@1.9 +2 -2
+ NTP_4_2_3P34
+
+ ntpq/ntpq-opts.c@1.8 +2 -2
+ NTP_4_2_3P34
+
+ ntpq/ntpq-opts.h@1.8 +3 -3
+ NTP_4_2_3P34
+
+ ntpq/ntpq-opts.texi@1.8 +1 -1
+ NTP_4_2_3P34
+
+ ntpq/ntpq.1@1.8 +2 -2
+ NTP_4_2_3P34
+
+ packageinfo.sh@1.27 +1 -1
+ NTP_4_2_3P34
+
+ sntp/sntp-opts.c@1.8 +2 -2
+ NTP_4_2_3P34
+
+ sntp/sntp-opts.h@1.8 +3 -3
+ NTP_4_2_3P34
+
+ sntp/sntp-opts.texi@1.8 +1 -1
+ NTP_4_2_3P34
+
+ sntp/sntp.1@1.11 +2 -2
+ NTP_4_2_3P34
+
+ util/ntp-keygen-opts.c@1.8 +2 -2
+ NTP_4_2_3P34
+
+ util/ntp-keygen-opts.h@1.8 +3 -3
+ NTP_4_2_3P34
+
+ util/ntp-keygen-opts.texi@1.8 +1 -1
+ NTP_4_2_3P34
+
+ util/ntp-keygen.1@1.8 +2 -2
+ NTP_4_2_3P34
+
+ChangeSet@1.1353.9.41, 2006-08-19 23:55:26-04:00, mayer@pogo.udel.edu
+ Bug #690: don't copy to many bytes when copying the address info
+
+ libntp/ntp_rfc2553.c@1.30 +1 -1
+ Bug #690: don't copy to many bytes when copying the address info
+
+ChangeSet@1.1353.9.39, 2006-08-19 23:34:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P33
+ TAG: NTP_4_2_3P33
+
+ ntpd/ntpd-opts.c@1.8 +2 -2
+ NTP_4_2_3P33
+
+ ntpd/ntpd-opts.h@1.8 +3 -3
+ NTP_4_2_3P33
+
+ ntpd/ntpd-opts.texi@1.9 +3 -3
+ NTP_4_2_3P33
+
+ ntpd/ntpd.1@1.8 +2 -2
+ NTP_4_2_3P33
+
+ ntpd/ntpdsim-opts.c@1.8 +2 -2
+ NTP_4_2_3P33
+
+ ntpd/ntpdsim-opts.h@1.8 +3 -3
+ NTP_4_2_3P33
+
+ ntpd/ntpdsim-opts.texi@1.8 +3 -3
+ NTP_4_2_3P33
+
+ ntpd/ntpdsim.1@1.8 +2 -2
+ NTP_4_2_3P33
+
+ ntpdc/ntpdc-opts.c@1.8 +2 -2
+ NTP_4_2_3P33
+
+ ntpdc/ntpdc-opts.h@1.8 +3 -3
+ NTP_4_2_3P33
+
+ ntpdc/ntpdc-opts.texi@1.8 +2 -2
+ NTP_4_2_3P33
+
+ ntpdc/ntpdc.1@1.8 +2 -2
+ NTP_4_2_3P33
+
+ ntpq/ntpq-opts.c@1.7 +2 -2
+ NTP_4_2_3P33
+
+ ntpq/ntpq-opts.h@1.7 +3 -3
+ NTP_4_2_3P33
+
+ ntpq/ntpq-opts.texi@1.7 +3 -3
+ NTP_4_2_3P33
+
+ ntpq/ntpq.1@1.7 +2 -2
+ NTP_4_2_3P33
+
+ packageinfo.sh@1.26 +1 -1
+ NTP_4_2_3P33
+
+ sntp/sntp-opts.c@1.7 +2 -2
+ NTP_4_2_3P33
+
+ sntp/sntp-opts.h@1.7 +3 -3
+ NTP_4_2_3P33
+
+ sntp/sntp-opts.texi@1.7 +1 -1
+ NTP_4_2_3P33
+
+ sntp/sntp.1@1.10 +2 -2
+ NTP_4_2_3P33
+
+ util/ntp-keygen-opts.c@1.7 +2 -2
+ NTP_4_2_3P33
+
+ util/ntp-keygen-opts.h@1.7 +3 -3
+ NTP_4_2_3P33
+
+ util/ntp-keygen-opts.texi@1.7 +2 -2
+ NTP_4_2_3P33
+
+ util/ntp-keygen.1@1.7 +2 -2
+ NTP_4_2_3P33
+
+ChangeSet@1.1353.18.1, 2006-08-18 07:58:19-04:00, mayer@pogo.udel.edu
+ Bug #685: Changes for MM timer and code cleanup
+
+ include/ntpd.h@1.95 +0 -3
+ Bug #685: Changes for MM timer and code cleanup
+
+ ntpd/cmd_args.c@1.42.1.1 +0 -8
+ Bug #685: Changes for MM timer and code cleanup
+
+ ntpd/ntp_timer.c@1.32 +1 -1
+ Bug #685: Changes for MM timer and code cleanup
+
+ ntpd/ntpd.c@1.81 +15 -7
+ Bug #685: Changes for MM timer and code cleanup
+
+ ntpd/ntpdbase-opts.def@1.7.1.1 +4 -3
+ Bug #685: Changes for MM timer and code cleanup
+
+ ports/winnt/include/clockstuff.h@1.7 +11 -0
+ Bug #685: Changes for MM timer and code cleanup
+
+ ports/winnt/include/config.h@1.43 +7 -1
+ Bug #685: Changes for MM timer and code cleanup
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.21 +4 -4
+ Bug #685: Changes for MM timer and code cleanup
+
+ ports/winnt/ntpd/ntpd.dsp@1.29 +102 -2
+ Bug #685: Changes for MM timer and code cleanup
+
+ChangeSet@1.1353.9.38, 2006-08-18 06:37:36-04:00, stenn@whimsy.udel.edu
+ Remove "commented out" items from the bk ignore file
+
+ BitKeeper/etc/ignore@1.57 +0 -13
+ Remove "commented out" items from the bk ignore file
+
+ChangeSet@1.1353.9.37, 2006-08-18 03:33:56-04:00, stenn@whimsy.udel.edu
+ libopts upgrade
+
+ libopts/autoopts.h@1.4 +12 -4
+ libopts upgrade
+
+ libopts/m4/libopts.m4@1.7 +4 -4
+ libopts upgrade
+
+ libopts/usage.c@1.4 +3 -3
+ libopts upgrade
+
+ sntp/libopts/autoopts.h@1.4 +12 -4
+ libopts upgrade
+
+ sntp/libopts/m4/libopts.m4@1.7 +4 -4
+ libopts upgrade
+
+ sntp/libopts/usage.c@1.4 +3 -3
+ libopts upgrade
+
+ChangeSet@1.1353.9.36, 2006-08-17 01:29:37-04:00, stenn@whimsy.udel.edu
+ [Bug 685] cleanup
+
+ ntpd/ntpd-opts.c@1.7 +58 -28
+ [Bug 685] use updated autogen-erated files
+
+ ntpd/ntpd-opts.h@1.7 +24 -20
+ [Bug 685] use updated autogen-erated files
+
+ ntpd/ntpd-opts.texi@1.8 +16 -1
+ [Bug 685] use updated autogen-erated files
+
+ ntpd/ntpd.1@1.7 +7 -2
+ [Bug 685] use updated autogen-erated files
+
+ ntpd/ntpdsim-opts.c@1.7 +70 -40
+ [Bug 685] use updated autogen-erated files
+
+ ntpd/ntpdsim-opts.h@1.7 +30 -26
+ [Bug 685] use updated autogen-erated files
+
+ ntpd/ntpdsim-opts.texi@1.7 +16 -1
+ [Bug 685] use updated autogen-erated files
+
+ ntpd/ntpdsim.1@1.7 +7 -2
+ [Bug 685] use updated autogen-erated files
+
+ChangeSet@1.1353.9.35, 2006-08-17 01:27:04-04:00, stenn@whimsy.udel.edu
+ [Bug 685] cleanup
+
+ ntpd/cmd_args.c@1.43 +1 -1
+ [Bug 685] Fix a typo - WINNT -> SYS_WINNT
+
+ ntpd/ntpdbase-opts.def@1.8 +1 -0
+ [Bug 685] -M should only accepted if SYS_WINNT is #defined
+
+ChangeSet@1.1353.17.1, 2006-08-17 00:52:10-04:00, stenn@whimsy.udel.edu
+ run autogen after point release
+
+ ntpd/ntpd-opts.c@1.6 +2 -2
+ run autogen after point release
+
+ ntpd/ntpd-opts.h@1.6 +3 -3
+ run autogen after point release
+
+ ntpd/ntpd-opts.texi@1.7 +1 -1
+ run autogen after point release
+
+ ntpd/ntpd.1@1.6 +2 -2
+ run autogen after point release
+
+ ntpd/ntpdsim-opts.c@1.6 +2 -2
+ run autogen after point release
+
+ ntpd/ntpdsim-opts.h@1.6 +3 -3
+ run autogen after point release
+
+ ntpd/ntpdsim-opts.texi@1.6 +1 -1
+ run autogen after point release
+
+ ntpd/ntpdsim.1@1.6 +2 -2
+ run autogen after point release
+
+ ntpdc/ntpdc-opts.c@1.7 +2 -2
+ run autogen after point release
+
+ ntpdc/ntpdc-opts.h@1.7 +3 -3
+ run autogen after point release
+
+ ntpdc/ntpdc-opts.texi@1.7 +1 -1
+ run autogen after point release
+
+ ntpdc/ntpdc.1@1.7 +2 -2
+ run autogen after point release
+
+ ntpq/ntpq-opts.c@1.6 +2 -2
+ run autogen after point release
+
+ ntpq/ntpq-opts.h@1.6 +3 -3
+ run autogen after point release
+
+ ntpq/ntpq-opts.texi@1.6 +1 -1
+ run autogen after point release
+
+ ntpq/ntpq.1@1.6 +2 -2
+ run autogen after point release
+
+ sntp/sntp-opts.c@1.6 +2 -2
+ run autogen after point release
+
+ sntp/sntp-opts.h@1.6 +3 -3
+ run autogen after point release
+
+ sntp/sntp-opts.texi@1.6 +1 -1
+ run autogen after point release
+
+ sntp/sntp.1@1.9 +2 -2
+ run autogen after point release
+
+ util/ntp-keygen-opts.c@1.6 +2 -2
+ run autogen after point release
+
+ util/ntp-keygen-opts.h@1.6 +3 -3
+ run autogen after point release
+
+ util/ntp-keygen-opts.texi@1.6 +1 -1
+ run autogen after point release
+
+ util/ntp-keygen.1@1.6 +2 -2
+ run autogen after point release
+
+ChangeSet@1.1353.16.2, 2006-08-15 13:14:03-04:00, mayer@pogo.udel.edu
+ Bug #685 and #686: MM timer enhancements and leapsecond fixes
+
+ ntpd/cmd_args.c@1.42 +8 -0
+ Bug #685: MM timer enhancement for Windows
+
+ ntpd/ntpdbase-opts.def@1.5.1.1 +9 -0
+ Bug #685: MM timer enhancement for Windows
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.20 +199 -38
+ Bug #685 and #686: MM timer fixes and leapsecond fixes
+
+ ports/winnt/ntpd/ntservice.c@1.6.1.1 +13 -12
+ Bug #685 and #686: MM timer fixes and leapsecond fixes
+
+ChangeSet@1.1353.16.1, 2006-08-15 13:04:10-04:00, mayer@pogo.udel.edu
+ Bug #523: exit() was being overridden
+
+ include/ntpd.h@1.94 +0 -2
+ Bug #523: exit() was being overridden
+
+ChangeSet@1.1353.9.32, 2006-08-15 08:10:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P31
+ TAG: NTP_4_2_3P31
+
+ packageinfo.sh@1.25 +1 -1
+ NTP_4_2_3P31
+
+ChangeSet@1.1251.94.50, 2006-08-15 07:02:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P4_RC1
+ TAG: NTP_4_2_2P4_RC1
+
+ packageinfo.sh@1.27.17.1 +3 -3
+ NTP_4_2_2P4_RC1
+
+ChangeSet@1.1251.94.49, 2006-08-15 06:09:54-04:00, stenn@whimsy.udel.edu
+ Save the list of files that change if the point-level is updated
+
+ .point-changed-filelist@1.1 +1 -0
+ BitKeeper file /deacon/backroom/ntp-stable/.point-changed-filelist
+
+ .point-changed-filelist@1.0 +0 -0
+
+ChangeSet@1.1353.9.30, 2006-08-15 06:08:03-04:00, stenn@whimsy.udel.edu
+ Save the list of files that change if the point-level is updated
+
+ .point-changed-filelist@1.1 +25 -0
+ BitKeeper file /deacon/backroom/ntp-dev/.point-changed-filelist
+
+ .point-changed-filelist@1.0 +0 -0
+
+ChangeSet@1.1353.9.29, 2006-08-15 05:53:43-04:00, stenn@whimsy.udel.edu
+ [Bug 684] debug command-line options should not be shown if #undef DEBUG
+
+ include/debug-opt.def@1.4 +2 -0
+ [Bug 684] debug command-line options should not be shown if #undef DEBUG
+
+ ntpd/ntpd-opts.c@1.5 +29 -4
+ regenerate autogen-erated files
+
+ ntpd/ntpd-opts.h@1.5 +7 -3
+ regenerate autogen-erated files
+
+ ntpd/ntpd-opts.texi@1.6 +5 -1
+ regenerate autogen-erated files
+
+ ntpd/ntpd.1@1.5 +2 -2
+ regenerate autogen-erated files
+
+ ntpd/ntpdbase-opts.def@1.6 +1 -0
+ Make sure we are using the right version of autogen
+
+ ntpd/ntpdsim-opts.c@1.5 +29 -4
+ regenerate autogen-erated files
+
+ ntpd/ntpdsim-opts.h@1.5 +7 -3
+ regenerate autogen-erated files
+
+ ntpd/ntpdsim-opts.texi@1.5 +5 -1
+ regenerate autogen-erated files
+
+ ntpd/ntpdsim.1@1.5 +2 -2
+ regenerate autogen-erated files
+
+ ntpdc/ntpdc-opts.c@1.6 +29 -4
+ regenerate autogen-erated files
+
+ ntpdc/ntpdc-opts.h@1.6 +7 -3
+ regenerate autogen-erated files
+
+ ntpdc/ntpdc-opts.texi@1.6 +5 -1
+ regenerate autogen-erated files
+
+ ntpdc/ntpdc.1@1.6 +2 -2
+ regenerate autogen-erated files
+
+ ntpq/ntpq-opts.c@1.5 +29 -4
+ regenerate autogen-erated files
+
+ ntpq/ntpq-opts.h@1.5 +7 -3
+ regenerate autogen-erated files
+
+ ntpq/ntpq-opts.texi@1.5 +5 -1
+ regenerate autogen-erated files
+
+ ntpq/ntpq.1@1.5 +2 -2
+ regenerate autogen-erated files
+
+ sntp/sntp-opts.c@1.5 +2 -2
+ regenerate autogen-erated files
+
+ sntp/sntp-opts.h@1.5 +3 -3
+ regenerate autogen-erated files
+
+ sntp/sntp-opts.texi@1.5 +1 -1
+ regenerate autogen-erated files
+
+ sntp/sntp.1@1.8 +2 -2
+ regenerate autogen-erated files
+
+ util/ntp-keygen-opts.c@1.5 +29 -4
+ regenerate autogen-erated files
+
+ util/ntp-keygen-opts.h@1.5 +7 -3
+ regenerate autogen-erated files
+
+ util/ntp-keygen-opts.texi@1.5 +5 -1
+ regenerate autogen-erated files
+
+ util/ntp-keygen.1@1.5 +2 -2
+ regenerate autogen-erated files
+
+ChangeSet@1.1353.9.28, 2006-08-15 05:40:34-04:00, stenn@whimsy.udel.edu
+ test -r seems more portable than test -e
+
+ sntp/Makefile.am@1.18 +1 -1
+ test -r seems more portable than test -e
+
+ChangeSet@1.1353.9.27, 2006-08-15 05:08:00-04:00, stenn@whimsy.udel.edu
+ Make sure we use the right version of autogen
+
+ include/autogen-version.def@1.1 +1 -0
+ BitKeeper file /deacon/backroom/ntp-dev/include/autogen-version.def
+
+ include/autogen-version.def@1.0 +0 -0
+
+ChangeSet@1.1353.9.26, 2006-08-11 07:04:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P30
+ TAG: NTP_4_2_3P30
+
+ packageinfo.sh@1.24 +1 -1
+ NTP_4_2_3P30
+
+ChangeSet@1.1353.15.9, 2006-08-10 21:41:32-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P29
+
+ ntpd/ntpd-opts.c@1.4 +2 -2
+ NTP_4_2_3P29
+
+ ntpd/ntpd-opts.h@1.4 +3 -3
+ NTP_4_2_3P29
+
+ ntpd/ntpd-opts.texi@1.5 +1 -1
+ NTP_4_2_3P29
+
+ ntpd/ntpd.1@1.4 +2 -2
+ NTP_4_2_3P29
+
+ ntpd/ntpdsim-opts.c@1.4 +2 -2
+ NTP_4_2_3P29
+
+ ntpd/ntpdsim-opts.h@1.4 +3 -3
+ NTP_4_2_3P29
+
+ ntpd/ntpdsim-opts.texi@1.4 +1 -1
+ NTP_4_2_3P29
+
+ ntpd/ntpdsim.1@1.4 +2 -2
+ NTP_4_2_3P29
+
+ ntpdc/ntpdc-opts.c@1.5 +2 -2
+ NTP_4_2_3P29
+
+ ntpdc/ntpdc-opts.h@1.5 +3 -3
+ NTP_4_2_3P29
+
+ ntpdc/ntpdc-opts.texi@1.5 +1 -1
+ NTP_4_2_3P29
+
+ ntpdc/ntpdc.1@1.5 +2 -2
+ NTP_4_2_3P29
+
+ ntpq/ntpq-opts.c@1.4 +2 -2
+ NTP_4_2_3P29
+
+ ntpq/ntpq-opts.h@1.4 +3 -3
+ NTP_4_2_3P29
+
+ ntpq/ntpq-opts.texi@1.4 +1 -1
+ NTP_4_2_3P29
+
+ ntpq/ntpq.1@1.4 +2 -2
+ NTP_4_2_3P29
+
+ sntp/sntp-opts.c@1.4 +140 -4
+ NTP_4_2_3P29
+
+ sntp/sntp-opts.h@1.4 +83 -4
+ NTP_4_2_3P29
+
+ sntp/sntp-opts.texi@1.4 +1 -1
+ NTP_4_2_3P29
+
+ sntp/sntp.1@1.7 +82 -3
+ NTP_4_2_3P29
+
+ util/ntp-keygen-opts.c@1.4 +2 -2
+ NTP_4_2_3P29
+
+ util/ntp-keygen-opts.h@1.4 +3 -3
+ NTP_4_2_3P29
+
+ util/ntp-keygen-opts.texi@1.4 +1 -1
+ NTP_4_2_3P29
+
+ util/ntp-keygen.1@1.4 +2 -2
+ NTP_4_2_3P29
+
+ChangeSet@1.1251.94.48, 2006-08-10 20:37:44-04:00, stenn@whimsy.udel.edu
+ Choose csets-{in,out} based on daemon/client
+
+ BitKeeper/triggers/send@1.11.1.1 +3 -1
+ Choose csets-{in,out} based on daemon/client
+
+ChangeSet@1.1353.15.8, 2006-08-10 20:34:50-04:00, stenn@whimsy.udel.edu
+ Choose csets-{in,out} based on daemon/client
+
+ BitKeeper/triggers/send@1.12 +3 -1
+ Choose csets-{in,out} based on daemon/client
+
+ChangeSet@1.1353.15.7, 2006-08-10 20:29:08-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ sntp/Makefile.am@1.17 +2 -1
+ use a run-ag that is for the sntp subdir
+
+ sntp/sntp-opts.def@1.8 +1 -1
+ Fix a typo in sntp-opts.def
+
+ChangeSet@1.1353.15.6, 2006-08-10 20:06:04-04:00, stenn@whimsy.udel.edu
+ fix permissions on sntp-opts.menu
+
+ sntp/sntp-opts.menu@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ChangeSet@1.1353.15.5, 2006-08-10 17:45:44-04:00, stenn@whimsy.udel.edu
+ Maintain sntp/version.def more quietly
+
+ sntp/Makefile.am@1.16 +2 -1
+ Maintain sntp/version.def more quietly
+
+ChangeSet@1.1353.15.4, 2006-08-10 17:24:38-04:00, stenn@whimsy.udel.edu
+ Use the new name of the sntp/COPYRIGHT file
+
+ sntp/sntp-opts.def@1.7 +1 -1
+ Use the new name of the sntp/COPYRIGHT file
+
+ChangeSet@1.1353.15.3, 2006-08-10 16:53:20-04:00, stenn@whimsy.udel.edu
+ [Bug 683] fix version number string mismatches
+
+ ntpd/Makefile.am@1.49 +9 -6
+ [Bug 683] fix version number string mismatches
+
+ ntpdc/Makefile.am@1.31 +6 -3
+ [Bug 683] fix version number string mismatches
+
+ ntpq/Makefile.am@1.23 +6 -3
+ [Bug 683] fix version number string mismatches
+
+ sntp/Makefile.am@1.15 +15 -4
+ [Bug 683] fix version number string mismatches
+
+ sntp/sntp-opts.def@1.6 +2 -5
+ [Bug 683] fix version number string mismatches
+
+ util/Makefile.am@1.32 +6 -3
+ [Bug 683] fix version number string mismatches
+
+ChangeSet@1.1353.15.2, 2006-08-10 16:45:30-04:00, stenn@whimsy.udel.edu
+ Rename sntp/Copyright to sntp/COPYRIGHT
+
+ sntp/COPYRIGHT@1.2 +0 -0
+ Rename: sntp/Copyright -> sntp/COPYRIGHT
+
+ChangeSet@1.1353.15.1, 2006-08-10 07:03:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P29
+ TAG: NTP_4_2_3P29
+
+ packageinfo.sh@1.23 +1 -1
+ NTP_4_2_3P29
+
+ChangeSet@1.1353.14.1, 2006-08-10 09:40:07+00:00, burnicki@pogo.udel.edu
+ Changes by Heiko <heiko.gerstung@meinberg.de>:
+ Fixed point/rcpoint handling which resulted in wrong version strings.
+
+ ports/winnt/scripts/mkver.bat@1.9 +32 -4
+ Changes by Heiko <heiko.gerstung@meinberg.de>:
+ Fixed point/rcpoint handling which resulted in wrong version strings.
+
+ChangeSet@1.1353.9.23, 2006-08-10 08:40:06+00:00, burnicki@pogo.udel.edu
+ Exclude debug features if building without debug.
+ Removed obsolete prototype for ntpd_usage().
+
+ include/ntp_cmdargs.h@1.4 +0 -1
+ Removed ntpd_usage() prototype which is obsolete.
+
+ ports/winnt/ntpd/ntservice.c@1.7 +2 -0
+ Exclude debug features if building without debug.
+
+ChangeSet@1.1353.13.3, 2006-08-10 01:02:20-04:00, stenn@whimsy.udel.edu
+ [Bug 659] Get the latest windows patches for libopts
+
+ libopts/compat/compat.h@1.6 +2 -2
+ [Bug 659] Get the latest windows patches for libopts
+
+ChangeSet@1.1353.13.2, 2006-08-10 00:57:53-04:00, stenn@whimsy.udel.edu
+ [Bug 659] Get the latest windows patches for libopts
+
+ libopts/m4/libopts.m4@1.6 +2 -1
+ [Bug 659] Get the latest windows patches for liboptslibopts/compat/compat.h
+
+ sntp/libopts/compat/compat.h@1.5 +1 -1
+ [Bug 659] Get the latest windows patches for liboptslibopts/compat/compat.h
+
+ sntp/libopts/m4/libopts.m4@1.6 +2 -1
+ [Bug 659] Get the latest windows patches for liboptslibopts/compat/compat.h
+
+ChangeSet@1.1353.13.1, 2006-08-10 00:53:59-04:00, stenn@whimsy.udel.edu
+ Replace the #ifdef DEBUG that got undone by Danny's recent patch
+
+ ntpd/ntp_io.c@1.234.1.3 +5 -1
+ Replace the #ifdef DEBUG that got undone by Danny's recent patch
+
+ChangeSet@1.1353.12.1, 2006-08-09 21:57:02-04:00, mayer@pogo.udel.edu
+ Bug #659: to allow --help through and not start services
+
+ ports/winnt/ntpd/ntservice.c@1.6 +2 -2
+ Bug #659: to allow --help through and not start services
+
+ChangeSet@1.1353.9.19, 2006-08-09 18:28:43-04:00, stenn@whimsy.udel.edu
+ [Bug 682] add --disable-debugging to the test build mix
+
+ build@1.23 +6 -0
+ [Bug 682] add --disable-debugging to the test build mix
+
+ flock-build@1.37 +1 -0
+ [Bug 682] add --disable-debugging to the test build mix
+
+ChangeSet@1.1251.94.47, 2006-08-09 18:24:30-04:00, stenn@whimsy.udel.edu
+ [Bug 682] add --disable-debugging to the test build mix
+
+ build@1.21.1.1 +6 -0
+ [Bug 682] add --disable-debugging to the test build mix
+
+ flock-build@1.35.1.1 +1 -0
+ [Bug 682] add --disable-debugging to the test build mix
+
+ChangeSet@1.1353.9.18, 2006-08-09 07:02:54-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P28
+ TAG: NTP_4_2_3P28
+
+ packageinfo.sh@1.22 +1 -1
+ NTP_4_2_3P28
+
+ChangeSet@1.1353.9.17, 2006-08-08 22:38:19-04:00, mayer@pogo.udel.edu
+ bug #671: setsockopt needs macro for Windows
+
+ ntpd/ntp_io.c@1.234.1.2 +11 -6
+ bug #671: setsockopt needs macro for Windows
+
+ ports/winnt/include/config.h@1.42 +1 -0
+ bug #671: setsockopt needs macro for Windows
+
+ChangeSet@1.1353.11.1, 2006-08-08 11:32:15-04:00, mayer@pogo.udel.edu
+ Bug #659: New include file for windows for handling file stat
+
+ ports/winnt/include/isc/stat.h@1.1 +66 -0
+ BitKeeper file /pogo/users/mayer/ntp-dev/ports/winnt/include/isc/stat.h
+
+ ports/winnt/include/isc/stat.h@1.0 +0 -0
+
+ChangeSet@1.1353.9.15, 2006-08-08 07:03:46-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P27
+ TAG: NTP_4_2_3P27
+
+ packageinfo.sh@1.21 +1 -1
+ NTP_4_2_3P27
+
+ChangeSet@1.1353.9.14, 2006-08-08 04:12:04-04:00, stenn@whimsy.udel.edu
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ ntpd/ntp_intres.c@1.48 +4 -0
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ ntpd/ntp_io.c@1.234.1.1 +5 -1
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ ntpd/refclock_jupiter.c@1.20 +2 -0
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ ntpd/refclock_leitch.c@1.8 +11 -5
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ ntpd/refclock_msfees.c@1.12 +28 -27
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ ntpd/refclock_mx4200.c@1.22 +2 -0
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ ntpd/refclock_oncore.c@1.60 +34 -10
+ [Bug 675]: Make sure we build even when we --disable-debugging
+
+ChangeSet@1.1353.9.13, 2006-08-07 18:41:58-04:00, stenn@whimsy.udel.edu
+ Fix #include <sys/mman.h> breakage
+
+ libopts/compat/compat.h@1.5 +3 -1
+ Fix sys/mman.h breakage
+
+ sntp/libopts/compat/compat.h@1.4 +3 -1
+ Fix sys/mman.h breakage
+
+ChangeSet@1.1353.9.12, 2006-08-07 09:32:49-04:00, mayer@pogo.udel.edu
+ Bug #659 mman.h not always available
+
+ libopts/compat/compat.h@1.4 +2 -2
+ Bug #659 mman.h not always available
+
+ChangeSet@1.1353.9.11, 2006-08-07 08:51:39-04:00, mayer@pogo.udel.edu
+ bug #659: Changes to support libopts on Windows
+
+ ports/winnt/include/config.h@1.41 +36 -1
+ bug #659: Changes to support libopts on Windows
+
+ ports/winnt/libntp/libntp.dsp@1.30 +6 -2
+ bug #659: Changes to support libopts on Windows
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.11 +8 -4
+ bug #659: Changes to support libopts on Windows
+
+ ports/winnt/ntpd/ntpd.dsp@1.28 +6 -2
+ bug #659: Changes to support libopts on Windows
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.18 +6 -2
+ bug #659: Changes to support libopts on Windows
+
+ ports/winnt/ntpq/ntpq.dsp@1.19 +8 -4
+ bug #659: Changes to support libopts on Windows
+
+ChangeSet@1.1353.9.10, 2006-08-06 07:03:05-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P26
+ TAG: NTP_4_2_3P26
+
+ packageinfo.sh@1.20 +1 -1
+ NTP_4_2_3P26
+
+ChangeSet@1.1353.9.9, 2006-08-05 21:31:02-04:00, stenn@whimsy.udel.edu
+ NEWS: Support separate PPS devices for PARSE refclocks
+
+ NEWS@1.58 +1 -0
+ NEWS: Support separate PPS devices for PARSE refclocks
+
+ChangeSet@1.1251.94.46, 2006-08-05 15:44:40-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P3
+ TAG: NTP_4_2_2P3
+
+ packageinfo.sh@1.27.16.1 +2 -2
+ NTP_4_2_2P3
+
+ChangeSet@1.1353.10.1, 2006-08-05 07:05:02-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P25
+ TAG: NTP_4_2_3P25
+
+ packageinfo.sh@1.19 +1 -1
+ NTP_4_2_3P25
+
+ChangeSet@1.1353.9.7, 2006-08-05 09:01:42+00:00, kardel@pogo.udel.edu
+ driver8.html:
+ document additional Meinberg clock mode
+ document optionally separate PPS device (/dev/refclockpps-{0..3})
+ refclock_parse.c:
+ support optionally separate PPS devices via /dev/refclockpps-{0..3}
+
+ html/drivers/driver8.html@1.19 +12 -9
+ document additional Meinberg clock mode
+ document optionally separate PPS device (/dev/refclockpps-{0..3})
+
+ ntpd/refclock_parse.c@1.46 +57 -29
+ support optionally separate PPS devices via /dev/refclockpps-{0..3}
+
+ChangeSet@1.1353.9.6, 2006-08-05 02:10:36-04:00, stenn@whimsy.udel.edu
+ Fixes from Dave.
+
+ ntpd/ntp_loopfilter.c@1.124 +22 -22
+ Dave sez:
+
+ At cold start (no frequency file) the daemon sets the clock at the
+ first update, then waits 15 minutes, measures and corrects the
+ frequency (usually within 1 PPM) and assumes normal operation. This
+ saves many hours to converge the frequency within 1 PPM, especially
+ if the intrinsic frequency error is large, like 200 PPM.
+
+ Until the frequency is corrected, the machine can have serious
+ offset and frequency errors that would drive dependent clients nuts.
+ Up to now, the leap bits and stratum were not initialized until the
+ frequency was corrected. However, the clock was set and local clients
+ were free to believe or not believe the clock. After review, the
+ external behavior is only mildly worse than without the initial
+ training period, so the leap bits and stratum are now set at the
+ first update. The billboards should now be consistent with the
+ Principle of Least Astonishment.
+
+ ntpd/ntp_proto.c@1.246 +19 -15
+ Dave sez:
+
+ At cold start (no frequency file) the daemon sets the clock at the
+ first update, then waits 15 minutes, measures and corrects the
+ frequency (usually within 1 PPM) and assumes normal operation. This
+ saves many hours to converge the frequency within 1 PPM, especially
+ if the intrinsic frequency error is large, like 200 PPM.
+
+ Until the frequency is corrected, the machine can have serious
+ offset and frequency errors that would drive dependent clients nuts.
+ Up to now, the leap bits and stratum were not initialized until the
+ frequency was corrected. However, the clock was set and local clients
+ were free to believe or not believe the clock. After review, the
+ external behavior is only mildly worse than without the initial
+ training period, so the leap bits and stratum are now set at the
+ first update. The billboards should now be consistent with the
+ Principle of Least Astonishment.
+
+ChangeSet@1.1353.9.5, 2006-08-05 01:27:50-04:00, stenn@whimsy.udel.edu
+ Added uint_t check to libopts.m4
+
+ libopts/m4/libopts.m4@1.5 +1 -1
+ Added uint_t check to libopts.m4
+
+ sntp/libopts/m4/libopts.m4@1.5 +1 -1
+ Added uint_t check to libopts.m4
+
+ChangeSet@1.1251.94.45, 2006-08-05 00:52:33-04:00, stenn@whimsy.udel.edu
+ Use the new format for the "send" emails
+
+ BitKeeper/triggers/send@1.11 +1 -4
+ Use the new format for the "send" emails
+
+ChangeSet@1.1353.9.3, 2006-08-05 00:38:57-04:00, stenn@whimsy.udel.edu
+ copy new packageinfo from -stable
+
+ packageinfo.sh@1.18 +4 -3
+ copy new packageinfo from -stable
+
+ChangeSet@1.1251.94.44, 2006-08-04 21:46:01-04:00, stenn@whimsy.udel.edu
+ ready for release
+
+ packageinfo.sh@1.27.15.2 +6 -6
+ ready for release
+
+ scripts/genChangeLog@1.2 +0 -0
+ Change mode to -rwxrwxr-x
+
+ChangeSet@1.1251.94.43, 2006-08-04 16:00:28-04:00, stenn@whimsy.udel.edu
+ Clean up the ChangeLog generation
+
+ Makefile.am@1.48.1.7 +3 -5
+ Clean up the ChangeLog generation
+
+ scripts/Makefile.am@1.14 +3 -2
+ Clean up the ChangeLog generation
+
+ scripts/genChangeLog@1.1 +7 -0
+ BitKeeper file /deacon/backroom/ntp-stable/scripts/genChangeLog
+
+ scripts/genChangeLog@1.0 +0 -0
+
+ChangeSet@1.1353.9.1, 2006-08-03 07:03:51-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P24
+ TAG: NTP_4_2_3P24
+
+ packageinfo.sh@1.17 +1 -1
+ NTP_4_2_3P24
+
+ChangeSet@1.1353.1.96, 2006-08-02 20:21:23-04:00, stenn@whimsy.udel.edu
+ autogen upgrade
+
+ ntpd/ntpd-opts.c@1.3 +37 -15
+ autogen upgrade
+
+ ntpd/ntpd-opts.c@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpd/ntpd-opts.h@1.3 +21 -10
+ autogen upgrade
+
+ ntpd/ntpd-opts.h@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpd/ntpd-opts.texi@1.4 +1 -1
+ autogen upgrade
+
+ ntpd/ntpd-opts.texi@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpd/ntpd.1@1.3 +33 -33
+ autogen upgrade
+
+ ntpd/ntpd.1@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpd/ntpdsim-opts.c@1.3 +37 -15
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.c@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpd/ntpdsim-opts.h@1.3 +21 -10
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.h@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpd/ntpdsim-opts.texi@1.3 +4 -4
+ autogen upgrade
+
+ ntpd/ntpdsim-opts.texi@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpd/ntpdsim.1@1.3 +42 -42
+ autogen upgrade
+
+ ntpd/ntpdsim.1@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpdc/ntpdc-opts.c@1.4 +2 -4
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.c@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpdc/ntpdc-opts.h@1.4 +5 -4
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.h@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpdc/ntpdc-opts.texi@1.4 +3 -3
+ autogen upgrade
+
+ ntpdc/ntpdc-opts.texi@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpdc/ntpdc.1@1.4 +2 -2
+ autogen upgrade
+
+ ntpdc/ntpdc.1@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpq/ntpq-opts.c@1.3 +38 -250
+ autogen upgrade
+
+ ntpq/ntpq-opts.c@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpq/ntpq-opts.h@1.3 +21 -10
+ autogen upgrade
+
+ ntpq/ntpq-opts.h@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpq/ntpq-opts.texi@1.3 +5 -244
+ autogen upgrade
+
+ ntpq/ntpq-opts.texi@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ ntpq/ntpq.1@1.3 +16 -16
+ autogen upgrade
+
+ ntpq/ntpq.1@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ sntp/sntp-opts.c@1.3 +40 -260
+ autogen upgrade
+
+ sntp/sntp-opts.c@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ sntp/sntp-opts.h@1.3 +21 -10
+ autogen upgrade
+
+ sntp/sntp-opts.h@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ sntp/sntp-opts.texi@1.3 +4 -248
+ autogen upgrade
+
+ sntp/sntp-opts.texi@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ sntp/sntp.1@1.6 +129 -64
+ autogen upgrade
+
+ sntp/sntp.1@1.5 +0 -0
+ Change mode to -rw-r--r--
+
+ util/ntp-keygen-opts.c@1.3 +54 -36
+ autogen upgrade
+
+ util/ntp-keygen-opts.c@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ util/ntp-keygen-opts.h@1.3 +21 -10
+ autogen upgrade
+
+ util/ntp-keygen-opts.h@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ util/ntp-keygen-opts.texi@1.3 +3 -3
+ autogen upgrade
+
+ util/ntp-keygen-opts.texi@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ util/ntp-keygen.1@1.3 +23 -23
+ autogen upgrade
+
+ util/ntp-keygen.1@1.2 +0 -0
+ Change mode to -rw-r--r--
+
+ChangeSet@1.1353.1.95, 2006-08-01 18:03:38+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ Bug 678:
+ make size of control message buffer configurable if
+ needbe. use lower default of 1536 bytes as qnx couldn't
+ cope with 5120 bytes and we are not really expecting
+ long control messages.
+ qnx limit is around 1900 bytes - qnx analysed by
+ Michael Tatarinov - thanks
+
+ ntpd/ntp_io.c@1.234 +4 -1
+ Bug 678:
+ make size of control message buffer configurable if
+ needbe. use lower default of 1536 bytes as qnx couldn't
+ cope with 5120 bytes and we are not really expecting
+ long control messages.
+ qnx limit is around 1900 bytes - qnx analysed by
+ Michael Tatarinov - thanks
+
+ChangeSet@1.1353.1.94, 2006-08-01 06:41:31+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ Bug 676:
+ Correct name buffer size calculation. Found
+ by Michael Tatarinov - thanks!
+
+ ntpd/ntp_io.c@1.233 +1 -1
+ Bug 676:
+ Correct name buffer size calculation. Found
+ by Michael Tatarinov - thanks!
+
+ChangeSet@1.1353.1.93, 2006-07-29 07:02:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P23
+ TAG: NTP_4_2_3P23
+
+ packageinfo.sh@1.16 +1 -1
+ NTP_4_2_3P23
+
+ChangeSet@1.1353.1.92, 2006-07-28 22:30:05-04:00, stenn@whimsy.udel.edu
+ [Bug 659] Move large "detail" description to "prog-man-descrip"
+
+ ntpq/ntpq-opts.def@1.9 +12 -1
+ [Bug 659] Move large "detail" description to "prog-man-descrip"
+
+ sntp/sntp-opts.def@1.5 +15 -4
+ [Bug 659] Move large "detail" description to "prog-man-descrip"
+
+ChangeSet@1.1353.1.91, 2006-07-28 07:42:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P22
+ TAG: NTP_4_2_3P22
+
+ packageinfo.sh@1.15 +1 -1
+ NTP_4_2_3P22
+
+ChangeSet@1.1251.94.42, 2006-07-28 07:02:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P3
+ TAG: NTP_4_2_2P3
+
+ packageinfo.sh@1.27.15.1 +1 -1
+ NTP_4_2_2P3
+
+ChangeSet@1.1251.94.41, 2006-07-28 01:28:32-04:00, stenn@whimsy.udel.edu
+ Ready for release
+
+ packageinfo.sh@1.27.14.2 +1 -1
+ Ready for release
+
+ChangeSet@1.1251.94.40, 2006-07-28 01:20:54-04:00, stenn@whimsy.udel.edu
+ Ready for release
+
+ NEWS@1.50.1.5 +30 -27
+ Ready for release
+
+ packageinfo.sh@1.27.14.1 +3 -3
+ Ready for release
+
+ChangeSet@1.1353.1.89, 2006-07-28 00:57:01-04:00, stenn@whimsy.udel.edu
+ libopts-27.4.2
+
+ libopts/compat/snprintf.c@1.2 +28 -4
+ libopts-27.4.2
+
+ libopts/m4/libopts.m4@1.4 +1 -1
+ libopts-27.4.2
+
+ libopts/makeshell.c@1.4 +9 -9
+ libopts-27.4.2
+
+ libopts/proto.h@1.4 +1 -1
+ libopts-27.4.2
+
+ libopts/streqvcmp.c@1.3 +3 -5
+ libopts-27.4.2
+
+ libopts/version.c@1.3 +4 -8
+ libopts-27.4.2
+
+ sntp/libopts/compat/snprintf.c@1.2 +28 -4
+ libopts-27.4.2
+
+ sntp/libopts/m4/libopts.m4@1.4 +1 -1
+ libopts-27.4.2
+
+ sntp/libopts/makeshell.c@1.4 +9 -9
+ libopts-27.4.2
+
+ sntp/libopts/proto.h@1.4 +1 -1
+ libopts-27.4.2
+
+ sntp/libopts/streqvcmp.c@1.3 +3 -5
+ libopts-27.4.2
+
+ sntp/libopts/version.c@1.3 +4 -8
+ libopts-27.4.2
+
+ChangeSet@1.1251.94.39, 2006-07-27 22:13:37-04:00, stenn@whimsy.udel.edu
+ NEWS: updated
+
+ NEWS@1.50.1.4 +21 -2
+ NEWS: updated
+
+ChangeSet@1.1251.94.38, 2006-07-27 22:07:57-04:00, stenn@whimsy.udel.edu
+ Makefile.am: add a rule to generate the ChangeLog
+
+ Makefile.am@1.48.1.6 +9 -1
+ Makefile.am: add a rule to generate the ChangeLog
+
+ChangeSet@1.1353.1.87, 2006-07-26 08:19:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P21
+ TAG: NTP_4_2_3P21
+
+ packageinfo.sh@1.14 +1 -1
+ NTP_4_2_3P21
+
+ChangeSet@1.1251.94.37, 2006-07-26 07:02:51-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P3_RC2
+ TAG: NTP_4_2_2P3_RC2
+
+ packageinfo.sh@1.27.13.1 +1 -1
+ NTP_4_2_2P3_RC2
+
+ChangeSet@1.1353.1.86, 2006-07-26 06:34:06-04:00, stenn@whimsy.udel.edu
+ [Bug 660] Solaris wants _XOPEN_SOURCE, __EXTENSIONS__, and -lxnet -lsocket
+
+ configure.ac@1.388.1.4 +10 -3
+ [Bug 660] Solaris wants _XOPEN_SOURCE, __EXTENSIONS__, and -lxnet -lsocket
+
+ChangeSet@1.1353.1.85, 2006-07-26 04:16:13-04:00, stenn@whimsy.udel.edu
+ [Bug 638] STREAMS_TLI is no longer needed
+
+ configure.ac@1.388.1.3 +0 -20
+ [Bug 638] STREAMS_TLI is no longer needed
+
+ChangeSet@1.1251.94.36, 2006-07-26 03:53:28-04:00, stenn@whimsy.udel.edu
+ [Bug 601] ntpq's decodeint uses an extra level of indiraction
+
+ ntpq/ntpq.c@1.55.1.7 +2 -2
+ [Bug 601] ntpq's decodeint uses an extra level of indiraction
+
+ChangeSet@1.1251.94.35, 2006-07-26 02:56:32-04:00, stenn@whimsy.udel.edu
+ Don't do anything in a RESYNC repo
+
+ BitKeeper/triggers/send@1.10 +6 -0
+ Don't do anything in a RESYNC repo
+
+ChangeSet@1.1251.94.34, 2006-07-26 02:34:51-04:00, stenn@whimsy.udel.edu
+ Test the -m option in the send trigger
+
+ BitKeeper/triggers/send@1.9 +4 -1
+ Test the -m option in the send trigger
+
+ChangeSet@1.1353.1.81, 2006-07-26 01:04:24-04:00, stenn@whimsy.udel.edu
+ [Bug 479] -P needs to set priority_done=0
+
+ ntpd/ntpd.c@1.80 +1 -0
+ [Bug 479] -P needs to set priority_done=0
+
+ChangeSet@1.1353.1.80, 2006-07-26 00:55:28-04:00, stenn@whimsy.udel.edu
+ AutoOpts cleanup - common .def entries are already in copyright.def
+
+ ntpd/ntpd-opts.def@1.5 +0 -3
+ common .def entries are already in copyright.def
+
+ ntpd/ntpd-opts.texi@1.2 +4 -4
+ Updated
+
+ ntpd/ntpdsim-opts.def@1.5 +0 -3
+ common .def entries are already in copyright.def
+
+ ntpq/ntpq-opts.def@1.8 +0 -3
+ common .def entries are already in copyright.def
+
+ util/ntp-keygen-opts.def@1.5 +0 -3
+ common .def entries are already in copyright.def
+
+ChangeSet@1.1353.1.79, 2006-07-23 07:03:50-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P20
+ TAG: NTP_4_2_3P20
+
+ packageinfo.sh@1.13 +1 -1
+ NTP_4_2_3P20
+
+ChangeSet@1.1353.1.78, 2006-07-22 23:35:43-04:00, stenn@whimsy.udel.edu
+ windows-config.h:
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h
+ Many files:
+ Upgrade to libopts-27.4.2
+
+ libopts/Makefile.am@1.3 +14 -14
+ Upgrade to libopts-27.4.2
+
+ libopts/autoopts.c@1.3 +7 -9
+ Upgrade to libopts-27.4.2
+
+ libopts/autoopts.h@1.3 +7 -8
+ Upgrade to libopts-27.4.2
+
+ libopts/autoopts/options.h@1.3 +64 -62
+ Upgrade to libopts-27.4.2
+
+ libopts/autoopts/usage-txt.h@1.2 +271 -395
+ Upgrade to libopts-27.4.2
+
+ libopts/compat/compat.h@1.3 +25 -9
+ Upgrade to libopts-27.4.2
+
+ libopts/compat/pathfind.c@1.3 +12 -3
+ Upgrade to libopts-27.4.2
+
+ libopts/compat/windows-config.h@1.1 +118 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/windows-config.h
+
+ libopts/compat/windows-config.h@1.0 +0 -0
+
+ libopts/configfile.c@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ libopts/genshell.c@1.2 +50 -10
+ Upgrade to libopts-27.4.2
+
+ libopts/genshell.h@1.2 +21 -10
+ Upgrade to libopts-27.4.2
+
+ libopts/libopts.c@1.3 +0 -1
+ Upgrade to libopts-27.4.2
+
+ libopts/load.c@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ libopts/m4/libopts.m4@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ libopts/makeshell.c@1.3 +11 -2
+ Upgrade to libopts-27.4.2
+
+ libopts/pgusage.c@1.3 +7 -3
+ Upgrade to libopts-27.4.2
+
+ libopts/proto.h@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ libopts/putshell.c@1.3 +3 -3
+ Upgrade to libopts-27.4.2
+
+ libopts/save.c@1.3 +3 -3
+ Upgrade to libopts-27.4.2
+
+ libopts/stack.c@1.3 +5 -3
+ Upgrade to libopts-27.4.2
+
+ libopts/usage.c@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/Makefile.am@1.3 +14 -14
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/autoopts.c@1.3 +7 -9
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/autoopts.h@1.3 +7 -8
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/autoopts/options.h@1.3 +64 -62
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/autoopts/usage-txt.h@1.2 +271 -395
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/compat/compat.h@1.3 +25 -9
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/compat/pathfind.c@1.3 +12 -3
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/compat/windows-config.h@1.1 +118 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/windows-config.h
+
+ sntp/libopts/compat/windows-config.h@1.0 +0 -0
+
+ sntp/libopts/configfile.c@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/genshell.c@1.2 +50 -10
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/genshell.h@1.2 +21 -10
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/libopts.c@1.3 +0 -1
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/load.c@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/m4/libopts.m4@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/makeshell.c@1.3 +11 -2
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/pgusage.c@1.3 +7 -3
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/proto.h@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/putshell.c@1.3 +3 -3
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/save.c@1.3 +3 -3
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/stack.c@1.3 +5 -3
+ Upgrade to libopts-27.4.2
+
+ sntp/libopts/usage.c@1.3 +1 -1
+ Upgrade to libopts-27.4.2
+
+ChangeSet@1.1353.1.77, 2006-07-22 10:12:26+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ move debug level for most interface based activity up to 3 and 4
+ 3 major steps and decisions, 4 for tracing like events.
+ remove some #ifdef cruft from sendpkt() - remove SILENT exits that
+ don't make sense.
+ ntp_peer.c:
+ move debug level for some interface based activity up to 3 and 4
+ 3 major steps and decisions, 4 for tracing like events.
+
+ ntpd/ntp_io.c@1.232 +98 -105
+ move debug level for most interface based activity up to 3 and 4
+ 3 major steps and decisions, 4 for tracing like events.
+ remove some #ifdef cruft from sendpkt() - remove SILENT exits that
+ don't make sense.
+
+ ntpd/ntp_peer.c@1.96 +4 -4
+ move debug level for some interface based activity up to 3 and 4
+ 3 major steps and decisions, 4 for tracing like events.
+
+ChangeSet@1.1353.1.76, 2006-07-22 10:04:56+00:00, kardel@pogo.udel.edu
+ ntp_request.h:
+ bug 672:
+ rearrange struct info_if_stats to be compacter and
+ pad to a 64 bit size boundary for coexistance with
+ 32 and 64 bit platforms
+ layout.std:
+ bug 672:
+ document changed struct info_if_stats layout
+
+ include/ntp_request.h@1.30 +3 -2
+ bug 672:
+ rearrange struct info_if_stats to be compacter and
+ pad to a 64 bit size boundary for coexistance with
+ 32 and 64 bit platforms
+
+ ntpdc/layout.std@1.7 +16 -15
+ bug 672:
+ document changed struct info_if_stats layout
+
+ChangeSet@1.1353.1.75, 2006-07-21 08:10:58-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P19
+ TAG: NTP_4_2_3P19
+
+ packageinfo.sh@1.12 +1 -1
+ NTP_4_2_3P19
+
+ChangeSet@1.1251.94.33, 2006-07-21 07:02:38-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P3_RC1
+ TAG: NTP_4_2_2P3_RC1
+
+ packageinfo.sh@1.27.12.1 +1 -1
+ NTP_4_2_2P3_RC1
+
+ChangeSet@1.1251.94.32, 2006-07-20 17:22:04-04:00, stenn@whimsy.udel.edu
+ Don't bother trying to mirror a RESYNC repo
+
+ BitKeeper/triggers/2mirrors@1.3 +6 -0
+ Don't bother trying to mirror a RESYNC repo
+
+ChangeSet@1.1251.94.31, 2006-07-20 15:50:44-04:00, stenn@whimsy.udel.edu
+ [Bug 671] Windows wants TYPEOF_IP_MULTICAST_SPOOL=BOOL
+
+ configure.ac@1.359.5.3 +4 -1
+ [Bug 671] Windows wants TYPEOF_IP_MULTICAST_SPOOL=BOOL
+
+ChangeSet@1.1353.1.72, 2006-07-20 13:49:44-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P18
+ TAG: NTP_4_2_3P18
+
+ packageinfo.sh@1.11 +1 -1
+ NTP_4_2_3P18
+
+ChangeSet@1.1251.94.30, 2006-07-20 07:20:34-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P3_RC0
+ TAG: NTP_4_2_2P3_RC0
+
+ packageinfo.sh@1.27.11.1 +1 -1
+ NTP_4_2_2P3_RC0
+
+ChangeSet@1.1251.94.29, 2006-07-19 22:22:49-04:00, stenn@deacon.udel.edu
+ Send the diffs before the patch in the send trigger.
+
+ BitKeeper/triggers/send@1.8 +4 -2
+ Send the diffs before the patch in the send trigger.
+
+ChangeSet@1.1251.94.28, 2006-07-19 22:19:11-04:00, stenn@deacon.udel.edu
+ update the path to the winnt.html file
+
+ INSTALL@1.8 +1 -1
+ update the path to the winnt.html file
+
+ChangeSet@1.1251.94.27, 2006-07-19 21:55:54-04:00, stenn@deacon.udel.edu
+ Ignore autom4te.cache directories
+
+ BitKeeper/etc/ignore@1.35.1.4 +2 -1
+ Ignore autom4te.cache directories
+
+ChangeSet@1.1353.1.69, 2006-07-19 21:00:05-04:00, stenn@deacon.udel.edu
+ Run the licfix script quietly
+
+ BitKeeper/triggers/pre-resolve.licfix@1.3 +1 -1
+ Run the licfix script quietly
+
+ChangeSet@1.1251.94.26, 2006-07-19 05:24:23-04:00, stenn@pogo.udel.edu
+ [Bug 657] netbsd fix for IP_MULTICAST_LOOP test
+
+ configure.ac@1.359.5.2 +1 -1
+ [Bug 657] netbsd fix for IP_MULTICAST_LOOP test
+
+ChangeSet@1.1251.94.25, 2006-07-19 03:10:22-04:00, stenn@pogo.udel.edu
+ [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP
+
+ configure.ac@1.359.5.1 +15 -1
+ [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP
+
+ ntpd/ntp_io.c@1.187.1.19 +1 -1
+ [Bug 657] Different OSes need different sized args for IP_MULTICAST_LOOP
+
+ChangeSet@1.1353.1.67, 2006-07-15 09:35:45+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ cleanup debug messages
+ add RTM_REDIRECT, RTM_CHANGE as additional interface list scan
+ routing message triggers
+ ntpd.h:
+ select_peerinterface() is comletely private to ntp_peer.c
+ ntp_peer.c:
+ - clear peer crypto when disconnecting from a bound interface
+ - re-arrange initialization for more usable debug output
+ - only bind to non wildcard interfaces even if the OS
+ would offer to send via such an interface
+
+ include/ntpd.h@1.93 +0 -1
+ select_peerinterface() is comletely private to ntp_peer.c
+
+ ntpd/ntp_io.c@1.230 +9 -3
+ cleanup debug messages
+ add RTM_REDIRECT, RTM_CHANGE as additional interface list scan
+ routing message triggers
+
+ ntpd/ntp_peer.c@1.95 +43 -31
+ - clear crypto when leaving a bound interface
+ - re-arrange initialization for more usable debug output
+ - only bind to non wildcard interfaces even if the OS
+ would offer to send via such an interface
+
+ChangeSet@1.1353.1.66, 2006-07-10 18:08:35+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ fix prototype argument type to match implementation
+
+ ntpd/ntp_io.c@1.229 +1 -1
+ fix prototype argument type to match implementation
+
+ChangeSet@1.1353.1.65, 2006-07-10 07:42:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P17
+ TAG: NTP_4_2_3P17
+
+ packageinfo.sh@1.10 +1 -1
+ NTP_4_2_3P17
+
+ChangeSet@1.1251.97.31, 2006-07-10 07:02:26-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P3_RC
+ TAG: NTP_4_2_2P3_RC
+
+ packageinfo.sh@1.27.9.1 +2 -2
+ NTP_4_2_2P3_RC
+
+ChangeSet@1.1251.97.30, 2006-07-10 03:27:15-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ NEWS@1.50.1.3 +1 -1
+ cleanup
+
+ChangeSet@1.1251.97.29, 2006-07-10 03:14:23-04:00, stenn@whimsy.udel.edu
+ Start an RC cycle with the new changes
+
+ packageinfo.sh@1.27.8.1 +2 -2
+ Start an RC cycle with the new changes
+
+ChangeSet@1.1251.97.28, 2006-07-10 03:07:33-04:00, stenn@whimsy.udel.edu
+ Use a decent Subject: line for the new send trigger
+
+ BitKeeper/triggers/send@1.7 +2 -1
+ Use a decent Subject: line for the new send trigger
+
+ChangeSet@1.1251.97.27, 2006-07-10 01:54:26-04:00, stenn@whimsy.udel.edu
+ Also use the new "bk changes" command for the "send" emails
+
+ BitKeeper/triggers/send@1.6 +15 -0
+ Also use the new "bk changes" command for the "send" emails
+
+ChangeSet@1.1251.97.26, 2006-07-10 01:40:48-04:00, stenn@whimsy.udel.edu
+ update
+
+ README@1.22 +3 -3
+ update
+
+ChangeSet@1.1251.97.25, 2006-07-10 01:32:25-04:00, stenn@whimsy.udel.edu
+ update
+
+ WHERE-TO-START@1.6 +5 -5
+ update
+
+ChangeSet@1.1251.97.24, 2006-07-10 01:20:12-04:00, stenn@whimsy.udel.edu
+ Note that sntp now builds under AIX 5
+
+ NEWS@1.50.1.2 +1 -0
+ Note that sntp now builds under AIX 5
+
+ChangeSet@1.1251.97.23, 2006-07-10 00:21:34-04:00, stenn@whimsy.udel.edu
+ Have sntp build config.h, and cleanup some quoting
+
+ sntp/configure.ac@1.8.1.1 +3 -2
+ Have sntp build config.h, and cleanup some quoting
+
+ChangeSet@1.1353.1.62, 2006-07-09 07:25:54-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P16
+ TAG: NTP_4_2_3P16
+
+ packageinfo.sh@1.9 +1 -1
+ NTP_4_2_3P16
+
+ChangeSet@1.1251.97.22, 2006-07-09 07:02:21-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P2
+ TAG: NTP_4_2_2P2
+
+ packageinfo.sh@1.27.7.1 +1 -1
+ NTP_4_2_2P2
+
+ChangeSet@1.1353.1.60, 2006-07-09 00:41:37-04:00, stenn@whimsy.udel.edu
+ socket.c needs stuff from config.h
+
+ sntp/socket.c@1.6 +2 -0
+ socket.c needs stuff from config.h
+
+ChangeSet@1.1251.97.21, 2006-07-09 00:39:26-04:00, stenn@whimsy.udel.edu
+ socket.c needs stuff from config.h
+
+ sntp/socket.c@1.5.1.1 +2 -0
+ socket.c needs stuff from config.h
+
+ChangeSet@1.1353.6.1, 2006-07-08 07:26:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P15
+ TAG: NTP_4_2_3P15
+
+ packageinfo.sh@1.8 +1 -1
+ NTP_4_2_3P15
+
+ChangeSet@1.1251.97.20, 2006-07-08 07:02:36-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P1
+ TAG: NTP_4_2_2P1
+
+ packageinfo.sh@1.27.6.1 +1 -1
+ NTP_4_2_2P1
+
+ChangeSet@1.1353.1.56, 2006-07-08 06:36:29-04:00, stenn@whimsy.udel.edu
+ [Bug 667] Fix ntpdc's option processing
+
+ ntpdc/ntpdc-opts.c@1.2 +38 -13
+ [Bug 667] Fix ntpdc's option processing
+
+ ntpdc/ntpdc-opts.h@1.2 +20 -10
+ [Bug 667] Fix ntpdc's option processing
+
+ ntpdc/ntpdc-opts.texi@1.2 +3 -3
+ [Bug 667] Fix ntpdc's option processing
+
+ ntpdc/ntpdc.1@1.2 +17 -16
+ [Bug 667] Fix ntpdc's option processing
+
+ChangeSet@1.1251.97.19, 2006-07-08 06:19:53-04:00, stenn@whimsy.udel.edu
+ Time for the point release
+
+ packageinfo.sh@1.27.5.2 +3 -3
+ Time for the point release
+
+ChangeSet@1.1251.97.18, 2006-07-08 06:16:07-04:00, stenn@whimsy.udel.edu
+ cleanup the bk ignore file
+
+ BitKeeper/etc/ignore@1.35.1.3 +34 -34
+ cleanup the bk ignore file
+
+ChangeSet@1.1353.1.55, 2006-07-08 06:06:02-04:00, stenn@whimsy.udel.edu
+ [Bug 667] Fix ntpdc's option processing
+
+ ntpdc/ntpdc-opts.def@1.11 +1 -0
+ [Bug 667] Fix ntpdc's option processing
+
+ ntpdc/ntpdc.c@1.53 +15 -0
+ [Bug 667] Fix ntpdc's option processing
+
+ChangeSet@1.1353.5.1, 2006-07-08 08:22:35+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ simplify move_fd()
+ refactor socket level udp paket time stamping by creating fetch_timestamp() for the
+ interfaces we will implement
+ implement the standard interface using the CMSG_* macros
+ only enable socket time stamping when CMSG_* macros are defined
+ cleanup minor signedness issues with pointer target types for length arguments
+
+ ntpd/ntp_io.c@1.228 +93 -75
+ simplify move_fd()
+ refactor socket level udp paket time stamping by creating fetch_timestamp() for the
+ interfaces we will implement
+ implement the standard interface using the CMSG_* macros
+ only enable socket time stamping when CMSG_* macros are defined
+ cleanup minor signedness issues with pointer target types for length arguments
+
+ChangeSet@1.1353.1.54, 2006-07-08 03:04:02-04:00, stenn@whimsy.udel.edu
+ Fix the hppa2.0-hp-hpux10.20 -H case
+
+ configure.ac@1.388 +4 -3
+ Fix the hppa2.0-hp-hpux10.20 -H case
+
+ sntp/configure.ac@1.12 +4 -3
+ Fix the hppa2.0-hp-hpux10.20 -H case
+
+ChangeSet@1.1353.1.53, 2006-07-07 18:34:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P14
+ TAG: NTP_4_2_3P14
+
+ packageinfo.sh@1.7 +1 -1
+ NTP_4_2_3P14
+
+ChangeSet@1.1353.1.52, 2006-07-07 15:20:47-04:00, stenn@whimsy.udel.edu
+ Add the -H stuff for cc under HP-UX to sntp's configure.ac
+
+ sntp/configure.ac@1.11 +7 -0
+ Add the -H stuff for cc under HP-UX to sntp's configure.ac
+
+ChangeSet@1.1353.1.51, 2006-07-07 06:57:09-04:00, stenn@whimsy.udel.edu
+ we want ltmain.sh now
+
+ BitKeeper/etc/ignore@1.53 +1 -1
+ we want ltmain.sh now
+
+ChangeSet@1.1353.1.50, 2006-07-07 05:53:15-04:00, stenn@whimsy.udel.edu
+ Make sure .def files are readable, distribute libtool.m4 and ltmain.sh to solve bootstrap problem
+
+ libopts/m4/libtool.m4@1.1 +6397 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/m4/libtool.m4
+
+ libopts/m4/libtool.m4@1.0 +0 -0
+
+ ltmain.sh@1.1 +6863 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ltmain.sh
+
+ ltmain.sh@1.0 +0 -0
+
+ ntpd/ntpd-opts.def@1.4 +0 -0
+ Change mode to -rw-rw-r--
+
+ ntpd/ntpdbase-opts.def@1.5 +0 -0
+ Change mode to -rw-rw-r--
+
+ ntpd/ntpdsim-opts.def@1.4 +0 -0
+ Change mode to -rw-rw-r--
+
+ ntpdc/ntpdc-opts.def@1.10 +0 -0
+ Change mode to -rw-rw-r--
+
+ ntpq/ntpq-opts.def@1.7 +0 -0
+ Change mode to -rw-rw-r--
+
+ sntp/libopts/m4/libtool.m4@1.1 +6397 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/m4/libtool.m4
+
+ sntp/libopts/m4/libtool.m4@1.0 +0 -0
+
+ sntp/ltmain.sh@1.1 +6863 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/ltmain.sh
+
+ sntp/ltmain.sh@1.0 +0 -0
+
+ sntp/sntp-opts.def@1.4 +0 -0
+ Change mode to -rw-rw-r--
+
+ util/ntp-keygen-opts.def@1.4 +0 -0
+ Change mode to -rw-rw-r--
+
+ChangeSet@1.1353.1.49, 2006-07-03 21:51:08-04:00, stenn@deacon.udel.edu
+ Make prototype agree with decl
+
+ libopts/autoopts/options.h@1.2 +1 -1
+ Make prototype agree with decl
+
+ sntp/libopts/autoopts/options.h@1.2 +1 -1
+ Make prototype agree with decl
+
+ChangeSet@1.1353.1.48, 2006-07-03 19:05:18-04:00, stenn@deacon.udel.edu
+ Upgrade to libopts-27.3.2
+
+ libopts/Makefile.am@1.2 +10 -10
+ Upgrade to libopts-27.3.2
+
+ libopts/autoopts.c@1.2 +9 -5
+ Upgrade to libopts-27.3.2
+
+ libopts/autoopts.h@1.2 +15 -7
+ Upgrade to libopts-27.3.2
+
+ libopts/boolean.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ libopts/compat/compat.h@1.2 +5 -2
+ Upgrade to libopts-27.3.2
+
+ libopts/compat/pathfind.c@1.2 +2 -2
+ Upgrade to libopts-27.3.2
+
+ libopts/compat/strchr.c@1.1 +61 -0
+
+ libopts/compat/strchr.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/libopts/compat/strchr.c
+
+ libopts/configfile.c@1.2 +6 -6
+ Upgrade to libopts-27.3.2
+
+ libopts/cook.c@1.2 +6 -6
+ Upgrade to libopts-27.3.2
+
+ libopts/enumeration.c@1.2 +8 -8
+ Upgrade to libopts-27.3.2
+
+ libopts/environment.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ libopts/libopts.c@1.2 +1 -0
+ Upgrade to libopts-27.3.2
+
+ libopts/load.c@1.2 +7 -7
+ Upgrade to libopts-27.3.2
+
+ libopts/m4/libopts.m4@1.2 +6 -13
+ Upgrade to libopts-27.3.2
+
+ libopts/makeshell.c@1.2 +10 -10
+ Upgrade to libopts-27.3.2
+
+ libopts/nested.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ libopts/numeric.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ libopts/pgusage.c@1.2 +3 -3
+ Upgrade to libopts-27.3.2
+
+ libopts/proto.h@1.2 +2 -2
+ Upgrade to libopts-27.3.2
+
+ libopts/putshell.c@1.2 +8 -8
+ Upgrade to libopts-27.3.2
+
+ libopts/restore.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ libopts/save.c@1.2 +7 -7
+ Upgrade to libopts-27.3.2
+
+ libopts/sort.c@1.2 +4 -4
+ Upgrade to libopts-27.3.2
+
+ libopts/stack.c@1.2 +41 -2
+ Upgrade to libopts-27.3.2
+
+ libopts/streqvcmp.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ libopts/text_mmap.c@1.2 +3 -3
+ Upgrade to libopts-27.3.2
+
+ libopts/tokenize.c@1.2 +3 -3
+ Upgrade to libopts-27.3.2
+
+ libopts/usage.c@1.2 +11 -11
+ Upgrade to libopts-27.3.2
+
+ libopts/version.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/Makefile.am@1.2 +10 -10
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/autoopts.c@1.2 +9 -5
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/autoopts.h@1.2 +15 -7
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/boolean.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/compat/compat.h@1.2 +5 -2
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/compat/pathfind.c@1.2 +2 -2
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/compat/strchr.c@1.1 +61 -0
+
+ sntp/libopts/compat/strchr.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/libopts/compat/strchr.c
+
+ sntp/libopts/configfile.c@1.2 +6 -6
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/cook.c@1.2 +6 -6
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/enumeration.c@1.2 +8 -8
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/environment.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/libopts.c@1.2 +1 -0
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/load.c@1.2 +7 -7
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/m4/libopts.m4@1.2 +6 -13
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/makeshell.c@1.2 +10 -10
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/nested.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/numeric.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/pgusage.c@1.2 +3 -3
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/proto.h@1.2 +2 -2
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/putshell.c@1.2 +8 -8
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/restore.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/save.c@1.2 +7 -7
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/sort.c@1.2 +4 -4
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/stack.c@1.2 +41 -2
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/streqvcmp.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/text_mmap.c@1.2 +3 -3
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/tokenize.c@1.2 +3 -3
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/usage.c@1.2 +11 -11
+ Upgrade to libopts-27.3.2
+
+ sntp/libopts/version.c@1.2 +1 -1
+ Upgrade to libopts-27.3.2
+
+ChangeSet@1.1353.1.47, 2006-07-03 00:18:29-04:00, stenn@deacon.udel.edu
+ typo
+
+ bootstrap@1.15, stenn@whimsy.udel.edu +1 -1
+ typo
+
+ChangeSet@1.1353.1.46, 2006-07-03 00:13:59-04:00, stenn@deacon.udel.edu
+ touch the files generated by autogen to keep them from needing to be rebuilt.
+
+ bootstrap@1.14 +38 -14
+ touch the files generated by autogen to keep them from needing to be rebuilt.
+
+ ntpd/ntp_proto.c@1.245 +2 -2
+ Dave reformatted a line
+
+ChangeSet@1.1353.1.45, 2006-06-30 01:03:52-04:00, stenn@deacon.udel.edu
+ Check in libopts and autgen-generated files
+
+ BitKeeper/etc/ignore@1.52 +12 -12
+ Check in libopts and autgen-generated files
+
+ bootstrap@1.13 +19 -18
+ Check in libopts and autgen-generated files
+
+ clockstuff/clktest-opts.c@1.1 +825 -0
+
+ clockstuff/clktest-opts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/clockstuff/clktest-opts.c
+
+ clockstuff/clktest-opts.h@1.1 +192 -0
+
+ clockstuff/clktest-opts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/clockstuff/clktest-opts.h
+
+ libopts/COPYING.lgpl@1.1 +502 -0
+
+ libopts/COPYING.lgpl@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/COPYING.lgpl
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/COPYING.mbsd
+
+ libopts/MakeDefs.inc@1.1 +0 -0
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/MakeDefs.inc
+
+ libopts/Makefile.am@1.1 +20 -0
+
+ libopts/Makefile.am@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/Makefile.am
+
+ libopts/README@1.1 +93 -0
+
+ libopts/README@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/README
+
+ libopts/autoopts.c@1.1 +1043 -0
+
+ libopts/autoopts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts.c
+
+ libopts/autoopts.h@1.1 +321 -0
+
+ libopts/autoopts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts.h
+
+ libopts/autoopts/options.h@1.1 +908 -0
+
+ libopts/autoopts/options.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts/options.h
+
+ libopts/autoopts/usage-txt.h@1.1 +479 -0
+
+ libopts/autoopts/usage-txt.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/autoopts/usage-txt.h
+
+ libopts/boolean.c@1.1 +102 -0
+
+ libopts/boolean.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/boolean.c
+
+ libopts/compat/compat.h@1.1 +292 -0
+
+ libopts/compat/compat.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/compat.h
+
+ libopts/compat/pathfind.c@1.1 +330 -0
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/pathfind.c
+
+ libopts/compat/snprintf.c@1.1 +36 -0
+
+ libopts/compat/snprintf.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/snprintf.c
+
+ libopts/compat/strdup.c@1.1 +19 -0
+
+ libopts/compat/strdup.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/compat/strdup.c
+
+ libopts/configfile.c@1.1 +1277 -0
+
+ libopts/configfile.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/configfile.c
+
+ libopts/cook.c@1.1 +355 -0
+
+ libopts/cook.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/cook.c
+
+ libopts/enumeration.c@1.1 +485 -0
+
+ libopts/enumeration.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/enumeration.c
+
+ libopts/environment.c@1.1 +261 -0
+
+ libopts/environment.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/environment.c
+
+ libopts/genshell.c@1.1 +301 -0
+
+ libopts/genshell.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/genshell.c
+
+ libopts/genshell.h@1.1 +142 -0
+
+ libopts/genshell.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/genshell.h
+
+ libopts/libopts.c@1.1 +30 -0
+
+ libopts/libopts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/libopts.c
+
+ libopts/load.c@1.1 +520 -0
+
+ libopts/load.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/load.c
+
+ libopts/m4/libopts.m4@1.1 +487 -0
+
+ libopts/m4/libopts.m4@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/m4/libopts.m4
+
+ libopts/m4/liboptschk.m4@1.1 +39 -0
+
+ libopts/m4/liboptschk.m4@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/m4/liboptschk.m4
+
+ libopts/makeshell.c@1.1 +1100 -0
+
+ libopts/makeshell.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/makeshell.c
+
+ libopts/nested.c@1.1 +705 -0
+
+ libopts/nested.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/nested.c
+
+ libopts/numeric.c@1.1 +89 -0
+
+ libopts/numeric.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/numeric.c
+
+ libopts/pgusage.c@1.1 +154 -0
+
+ libopts/pgusage.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/pgusage.c
+
+ libopts/proto.h@1.1 +88 -0
+
+ libopts/proto.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/proto.h
+
+ libopts/putshell.c@1.1 +333 -0
+
+ libopts/putshell.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/putshell.c
+
+ libopts/restore.c@1.1 +207 -0
+
+ libopts/restore.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/restore.c
+
+ libopts/save.c@1.1 +499 -0
+
+ libopts/save.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/save.c
+
+ libopts/sort.c@1.1 +369 -0
+
+ libopts/sort.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/sort.c
+
+ libopts/stack.c@1.1 +224 -0
+
+ libopts/stack.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/stack.c
+
+ libopts/streqvcmp.c@1.1 +292 -0
+
+ libopts/streqvcmp.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/streqvcmp.c
+
+ libopts/text_mmap.c@1.1 +367 -0
+
+ libopts/text_mmap.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/text_mmap.c
+
+ libopts/tokenize.c@1.1 +322 -0
+
+ libopts/tokenize.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/tokenize.c
+
+ libopts/usage.c@1.1 +732 -0
+
+ libopts/usage.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/usage.c
+
+ libopts/version.c@1.1 +181 -0
+
+ libopts/version.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/libopts/version.c
+
+ ntpd/ntpd-opts.c@1.1 +975 -0
+
+ ntpd/ntpd-opts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.c
+
+ ntpd/ntpd-opts.h@1.1 +193 -0
+
+ ntpd/ntpd-opts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.h
+
+ ntpd/ntpd-opts.menu@1.1 +1 -0
+
+ ntpd/ntpd-opts.menu@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.menu
+
+ ntpd/ntpd-opts.texi@1.1 +481 -0
+
+ ntpd/ntpd-opts.texi@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd-opts.texi
+
+ ntpd/ntpd.1@1.1 +307 -0
+
+ ntpd/ntpd.1@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpd.1
+
+ ntpd/ntpdsim-opts.c@1.1 +1173 -0
+
+ ntpd/ntpdsim-opts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.c
+
+ ntpd/ntpdsim-opts.h@1.1 +211 -0
+
+ ntpd/ntpdsim-opts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.h
+
+ ntpd/ntpdsim-opts.menu@1.1 +1 -0
+
+ ntpd/ntpdsim-opts.menu@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.menu
+
+ ntpd/ntpdsim-opts.texi@1.1 +562 -0
+
+ ntpd/ntpdsim-opts.texi@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim-opts.texi
+
+ ntpd/ntpdsim.1@1.1 +352 -0
+
+ ntpd/ntpdsim.1@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpd/ntpdsim.1
+
+ ntpdc/ntpdc-opts.c@1.1 +606 -0
+
+ ntpdc/ntpdc-opts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.c
+
+ ntpdc/ntpdc-opts.h@1.1 +155 -0
+
+ ntpdc/ntpdc-opts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.h
+
+ ntpdc/ntpdc-opts.menu@1.1 +1 -0
+
+ ntpdc/ntpdc-opts.menu@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.menu
+
+ ntpdc/ntpdc-opts.texi@1.1 +272 -0
+
+ ntpdc/ntpdc-opts.texi@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc-opts.texi
+
+ ntpdc/ntpdc.1@1.1 +157 -0
+
+ ntpdc/ntpdc.1@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpdc/ntpdc.1
+
+ ntpq/ntpq-opts.c@1.1 +781 -0
+
+ ntpq/ntpq-opts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.c
+
+ ntpq/ntpq-opts.h@1.1 +151 -0
+
+ ntpq/ntpq-opts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.h
+
+ ntpq/ntpq-opts.menu@1.1 +1 -0
+
+ ntpq/ntpq-opts.menu@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.menu
+
+ ntpq/ntpq-opts.texi@1.1 +691 -0
+
+ ntpq/ntpq-opts.texi@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq-opts.texi
+
+ ntpq/ntpq.1@1.1 +385 -0
+
+ ntpq/ntpq.1@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/ntpq/ntpq.1
+
+ sntp/libopts/COPYING.lgpl@1.1 +502 -0
+
+ sntp/libopts/COPYING.lgpl@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/COPYING.lgpl
+
+ sntp/libopts/COPYING.mbsd@1.1 +26 -0
+
+ sntp/libopts/COPYING.mbsd@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/MakeDefs.inc@1.1 +0 -0
+
+ sntp/libopts/MakeDefs.inc@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/Makefile.am@1.1 +20 -0
+
+ sntp/libopts/Makefile.am@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/Makefile.am
+
+ sntp/libopts/README@1.1 +93 -0
+
+ sntp/libopts/README@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/README
+
+ sntp/libopts/autoopts.c@1.1 +1043 -0
+
+ sntp/libopts/autoopts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.h@1.1 +321 -0
+
+ sntp/libopts/autoopts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts/options.h@1.1 +908 -0
+
+ sntp/libopts/autoopts/options.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.1 +479 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/boolean.c@1.1 +102 -0
+
+ sntp/libopts/boolean.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/boolean.c
+
+ sntp/libopts/compat/compat.h@1.1 +292 -0
+
+ sntp/libopts/compat/compat.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/pathfind.c@1.1 +330 -0
+
+ sntp/libopts/compat/pathfind.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/compat/snprintf.c@1.1 +36 -0
+
+ sntp/libopts/compat/snprintf.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/strdup.c@1.1 +19 -0
+
+ sntp/libopts/compat/strdup.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/compat/strdup.c
+
+ sntp/libopts/configfile.c@1.1 +1277 -0
+
+ sntp/libopts/configfile.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/configfile.c
+
+ sntp/libopts/cook.c@1.1 +355 -0
+
+ sntp/libopts/cook.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/cook.c
+
+ sntp/libopts/enumeration.c@1.1 +485 -0
+
+ sntp/libopts/enumeration.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/enumeration.c
+
+ sntp/libopts/environment.c@1.1 +261 -0
+
+ sntp/libopts/environment.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/environment.c
+
+ sntp/libopts/genshell.c@1.1 +301 -0
+
+ sntp/libopts/genshell.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.h@1.1 +142 -0
+
+ sntp/libopts/genshell.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/genshell.h
+
+ sntp/libopts/libopts.c@1.1 +30 -0
+
+ sntp/libopts/libopts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/libopts.c
+
+ sntp/libopts/load.c@1.1 +520 -0
+
+ sntp/libopts/load.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/load.c
+
+ sntp/libopts/m4/libopts.m4@1.1 +487 -0
+
+ sntp/libopts/m4/libopts.m4@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/m4/libopts.m4
+
+ sntp/libopts/m4/liboptschk.m4@1.1 +39 -0
+
+ sntp/libopts/m4/liboptschk.m4@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/m4/liboptschk.m4
+
+ sntp/libopts/makeshell.c@1.1 +1100 -0
+
+ sntp/libopts/makeshell.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/makeshell.c
+
+ sntp/libopts/nested.c@1.1 +705 -0
+
+ sntp/libopts/nested.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/nested.c
+
+ sntp/libopts/numeric.c@1.1 +89 -0
+
+ sntp/libopts/numeric.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/numeric.c
+
+ sntp/libopts/pgusage.c@1.1 +154 -0
+
+ sntp/libopts/pgusage.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/pgusage.c
+
+ sntp/libopts/proto.h@1.1 +88 -0
+
+ sntp/libopts/proto.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/proto.h
+
+ sntp/libopts/putshell.c@1.1 +333 -0
+
+ sntp/libopts/putshell.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/putshell.c
+
+ sntp/libopts/restore.c@1.1 +207 -0
+
+ sntp/libopts/restore.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/restore.c
+
+ sntp/libopts/save.c@1.1 +499 -0
+
+ sntp/libopts/save.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/save.c
+
+ sntp/libopts/sort.c@1.1 +369 -0
+
+ sntp/libopts/sort.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/sort.c
+
+ sntp/libopts/stack.c@1.1 +224 -0
+
+ sntp/libopts/stack.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/stack.c
+
+ sntp/libopts/streqvcmp.c@1.1 +292 -0
+
+ sntp/libopts/streqvcmp.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/streqvcmp.c
+
+ sntp/libopts/text_mmap.c@1.1 +367 -0
+
+ sntp/libopts/text_mmap.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/text_mmap.c
+
+ sntp/libopts/tokenize.c@1.1 +322 -0
+
+ sntp/libopts/tokenize.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/tokenize.c
+
+ sntp/libopts/usage.c@1.1 +732 -0
+
+ sntp/libopts/usage.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/usage.c
+
+ sntp/libopts/version.c@1.1 +181 -0
+
+ sntp/libopts/version.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/libopts/version.c
+
+ sntp/sntp-opts.c@1.1 +742 -0
+
+ sntp/sntp-opts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.c
+
+ sntp/sntp-opts.h@1.1 +149 -0
+
+ sntp/sntp-opts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.h
+
+ sntp/sntp-opts.menu@1.1 +1 -0
+
+ sntp/sntp-opts.menu@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.menu
+
+ sntp/sntp-opts.texi@1.1 +410 -0
+
+ sntp/sntp-opts.texi@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/sntp/sntp-opts.texi
+
+ util/ntp-keygen-opts.c@1.1 +989 -0
+
+ util/ntp-keygen-opts.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.c
+
+ util/ntp-keygen-opts.h@1.1 +206 -0
+
+ util/ntp-keygen-opts.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.h
+
+ util/ntp-keygen-opts.menu@1.1 +1 -0
+
+ util/ntp-keygen-opts.menu@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.menu
+
+ util/ntp-keygen-opts.texi@1.1 +362 -0
+
+ util/ntp-keygen-opts.texi@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen-opts.texi
+
+ util/ntp-keygen.1@1.1 +176 -0
+
+ util/ntp-keygen.1@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/util/ntp-keygen.1
+
+ChangeSet@1.1353.1.44, 2006-06-28 07:26:01-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P13
+ TAG: NTP_4_2_3P13
+
+ packageinfo.sh@1.6 +1 -1
+ NTP_4_2_3P13
+
+ChangeSet@1.1251.97.17, 2006-06-28 07:03:07-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC8
+ TAG: NTP_4_2_2P0_RC8
+
+ packageinfo.sh@1.27.5.1 +1 -1
+ NTP_4_2_2P0_RC8
+
+ChangeSet@1.1251.97.16, 2006-06-27 21:20:21+00:00, burnicki@pogo.udel.edu
+ [BUG 661]
+ Use environment variable to specify the base path to openssl.
+ Updated hints/winnt.html accordingly.
+
+ html/build/hints/winnt.html@1.16 +42 -20
+ Added a hint to the build instructions to set up the OPENSSL environment variable.
+ Added the Meinberg link to download the GUI installer.
+ Wrapped some lines.
+
+ ports/winnt/libntp/libntp.dsp@1.29 +2 -2
+ Use environment variable to specify the base path to openssl.
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.10 +4 -4
+ Use environment variable to specify the base path to openssl.
+
+ ports/winnt/ntpd/ntpd.dsp@1.27 +4 -4
+ Use environment variable to specify the base path to openssl.
+
+ ports/winnt/ntpdate/ntpdate.dsp@1.15 +2 -2
+ Use environment variable to specify the base path to openssl.
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.17 +2 -2
+ Use environment variable to specify the base path to openssl.
+
+ ports/winnt/ntpq/ntpq.dsp@1.18 +2 -2
+ Use environment variable to specify the base path to openssl.
+
+ ports/winnt/ntptrace/ntptrace.dsp@1.10 +2 -2
+ Use environment variable to specify the base path to openssl.
+
+ChangeSet@1.1353.1.42, 2006-06-27 07:48:03-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P12
+ TAG: NTP_4_2_3P12
+
+ packageinfo.sh@1.5 +1 -1
+ NTP_4_2_3P12
+
+ChangeSet@1.1251.97.15, 2006-06-27 07:02:41-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC7
+ TAG: NTP_4_2_2P0_RC7
+
+ packageinfo.sh@1.27.4.1 +1 -1
+ NTP_4_2_2P0_RC7
+
+ChangeSet@1.1251.97.14, 2006-06-27 04:19:41-04:00, stenn@whimsy.udel.edu
+ Resolve the ambiguity in the copyright file
+
+ NEWS@1.50.1.1 +2 -0
+ Resolve the ambiguity in the copyright file
+
+ html/copyright.html@1.33.1.1 +4 -4
+ Resolve the ambiguity in the copyright file
+
+ChangeSet@1.1353.1.40, 2006-06-26 07:50:16-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P11
+ TAG: NTP_4_2_3P11
+
+ packageinfo.sh@1.4 +1 -1
+ NTP_4_2_3P11
+
+ChangeSet@1.1251.97.13, 2006-06-26 07:03:11-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC6
+ TAG: NTP_4_2_2P0_RC6
+
+ packageinfo.sh@1.27.3.1 +1 -1
+ NTP_4_2_2P0_RC6
+
+ChangeSet@1.1251.97.12, 2006-06-26 03:23:59-04:00, stenn@whimsy.udel.edu
+ Documentation updated from Dave Mills
+
+ html/ntpdsim.html@1.5 +3 -3
+ Documentation updated from Dave Mills
+
+ html/scripts/links7.txt@1.2 +1 -0
+ Documentation updated from Dave Mills
+
+ html/scripts/links9.txt@1.3 +1 -0
+ Documentation updated from Dave Mills
+
+ChangeSet@1.1251.97.11, 2006-06-26 03:06:50-04:00, stenn@whimsy.udel.edu
+ New documentation files from Dave Mills
+
+ html/groups.html@1.1 +47 -0
+
+ html/groups.html@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable/html/groups.html
+
+ html/ntp_conf.html@1.1 +173 -0
+
+ html/ntp_conf.html@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable/html/ntp_conf.html
+
+ html/ntpdsim_new.html@1.1 +102 -0
+
+ html/ntpdsim_new.html@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable/html/ntpdsim_new.html
+
+ChangeSet@1.1251.97.10, 2006-06-26 02:52:54-04:00, stenn@whimsy.udel.edu
+ Fix the ntp-keygen URL (Dave Mills) in authopt.html
+
+ html/authopt.html@1.40 +2 -2
+ Fix the ntp-keygen URL (Dave Mills) in authopt.html
+
+ChangeSet@1.1353.1.36, 2006-06-26 01:10:19-04:00, stenn@whimsy.udel.edu
+ setsockopt() notes
+
+ ntpd/ntp_io.c@1.227 +3 -2
+ setsockopt() notes
+
+ChangeSet@1.1353.1.35, 2006-06-26 00:51:09-04:00, stenn@whimsy.udel.edu
+ [Bug 658] hppa2.0-hp-hpux10.20 cc needs a bigger -H for cpp
+
+ configure.ac@1.387 +8 -0
+ [Bug 658] hppa2.0-hp-hpux10.20 cc needs a bigger -H for cpp
+
+ChangeSet@1.1353.1.34, 2006-06-25 19:52:52-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ sntp/Makefile.am@1.14 +2 -3
+ cleanup
+
+ChangeSet@1.1251.97.9, 2006-06-25 19:10:06-04:00, stenn@whimsy.udel.edu
+ [Bug 657]: IP_MULTICAST_LOOP uses a u_char value/size
+
+ ntpd/ntp_io.c@1.187.1.18 +5 -5
+ [Bug 657]: IP_MULTICAST_LOOP uses a u_char value/size
+
+ChangeSet@1.1251.97.8, 2006-06-25 17:00:47-04:00, stenn@whimsy.udel.edu
+ distcheck fixes
+
+ BitKeeper/etc/ignore@1.35.1.2 +1 -0
+ added sntp/bincheck.mf
+
+ Makefile.am@1.48.1.5 +1 -0
+ cleanup; distcheck now works from sntp
+
+ bootstrap@1.4.3.1 +2 -0
+ cleanup; distcheck now works from sntp
+
+ sntp/Makefile.am@1.6.1.1 +5 -23
+ cleanup; distcheck now works from sntp
+
+ChangeSet@1.1353.1.31, 2006-06-25 07:51:20-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P10
+ TAG: NTP_4_2_3P10
+
+ packageinfo.sh@1.3 +1 -1
+ NTP_4_2_3P10
+
+ChangeSet@1.1251.97.7, 2006-06-25 07:03:22-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC5
+ TAG: NTP_4_2_2P0_RC5
+
+ packageinfo.sh@1.27.2.1 +1 -1
+ NTP_4_2_2P0_RC5
+
+ChangeSet@1.1353.1.30, 2006-06-25 04:50:29-04:00, stenn@whimsy.udel.edu
+ Bail on an autogen error
+
+ bootstrap@1.11 +2 -1
+ Bail on an autogen error
+
+ChangeSet@1.1353.1.28, 2006-06-24 18:12:20-04:00, stenn@deacon.udel.edu
+ fix quoting
+
+ BitKeeper/triggers/pre-resolve.licfix@1.2 +1 -1
+ fix quoting
+
+ChangeSet@1.1251.98.4, 2006-06-24 18:45:02+00:00, kardel@pogo.udel.edu
+ ntpq_ops.c:
+ fix a type punned pointer issue reported by gcc 4
+
+ ntpq/ntpq_ops.c@1.20.3.1 +6 -6
+ fix a type punned pointer issue reported by gcc 4
+
+ChangeSet@1.1251.98.3, 2006-06-24 18:31:47+00:00, kardel@pogo.udel.edu
+ refclock_shm.c:
+ fix gcc 4 uninitialized warning
+
+ ntpd/refclock_shm.c@1.17 +4 -0
+ fix gcc 4 uninitialized warning
+
+ChangeSet@1.1251.98.2, 2006-06-24 18:24:35+00:00, kardel@pogo.udel.edu
+ data_mbg.c, refclock_parse.c, mbg_gps166.h, clk_rawdcf.c:
+ fix gcc 4 signedness complaints
+
+ include/mbg_gps166.h@1.5.1.2 +7 -4
+ fix gcc 4 signedness complaints
+
+ libparse/clk_rawdcf.c@1.14 +10 -4
+ fix gcc 4 signedness complaints
+
+ libparse/data_mbg.c@1.5.1.2 +17 -14
+ fix gcc 4 signedness complaints
+
+ ntpd/refclock_parse.c@1.35.1.14 +14 -7
+ fix gcc 4 signedness complaints
+
+ChangeSet@1.1251.98.1, 2006-06-24 17:39:54+00:00, kardel@pogo.udel.edu
+ refclock_acts.c:
+ NetBSD Coverity CID 3797: bad return code check for open(2) fixed
+ (!fd replaced with fd < 0)
+ ntp_util.c:
+ NetBSD Coverity CID 3804: avoid file pointer leak
+ refclock_parse.c:
+ NetBSD Coverity CID 3796: possible NULL deref
+ ntpq.c:
+ NetBSD Coverity CID 3799: overrun static array (off by one) fixed
+
+ ntpd/ntp_util.c@1.36.2.2 +1 -0
+ NetBSD Coverity CID 3804: avoid file pointer leak
+
+ ntpd/refclock_acts.c@1.25.1.2 +1 -1
+ NetBSD Coverity CID 3797: bad return code check for open(2) fixed
+ (!fd replaced with fd < 0)
+
+ ntpd/refclock_parse.c@1.35.1.13 +5 -1
+ NetBSD Coverity CID 3796: possible NULL deref
+
+ ntpq/ntpq.c@1.55.1.6 +1 -1
+ NetBSD Coverity CID 3799: overrun static array (off by one) fixed
+
+ChangeSet@1.1353.1.26, 2006-06-24 16:50:45+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ implement fix for bug 614
+ socket fds will be moved out of the
+ stdio reserved area if at all possible
+
+ ntpd/ntp_io.c@1.224 +106 -27
+ implement fix for bug 614
+ socket fds will be moved out of the
+ stdio reserved area if at all possible
+
+ChangeSet@1.1251.97.5, 2006-06-24 16:46:25+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ implement fix for bug 614
+ socket fds will be moved out of the stdio reserved
+ space if at all possible
+
+ ntpd/ntp_io.c@1.187.1.17 +107 -27
+ implement fix for bug 614
+ socket fds will be moved out of the stdio reserved
+ space if at all possible
+
+ChangeSet@1.1353.1.25, 2006-06-23 07:48:33-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P9
+ TAG: NTP_4_2_3P9
+
+ packageinfo.sh@1.2 +1 -1
+ NTP_4_2_3P9
+
+ChangeSet@1.1251.97.4, 2006-06-23 07:02:47-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC4
+ TAG: NTP_4_2_2P0_RC4
+
+ packageinfo.sh@1.27.1.9 +1 -1
+ NTP_4_2_2P0_RC4
+
+ChangeSet@1.1251.97.3, 2006-06-22 17:07:33-04:00, stenn@whimsy.udel.edu
+ Remove the license: key from etc/config to make the bk4 upgrade easier.
+
+ BitKeeper/etc/config@1.7.1.1 +2 -1
+ Remove the license: key from etc/config to make the bk4 upgrade easier.
+
+ChangeSet@1.1353.1.23, 2006-06-22 16:17:02-04:00, stenn@whimsy.udel.edu
+ break the link between -stable and -dev copies of packageinfo.sh
+
+ BitKeeper/deleted/.del-packageinfo.sh~7f44215e99c0cd03@1.47 +0 -0
+ Delete: packageinfo.sh
+
+ packageinfo.sh@1.1 +26 -0
+
+ packageinfo.sh@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-632/packageinfo.sh
+
+ChangeSet@1.1251.97.2, 2006-06-22 19:28:28+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ bug 632: update kernel PPS offsets when PPS offset is re-configured
+
+ ntpd/refclock_parse.c@1.35.1.12 +10 -4
+ bug 632: update kernel PPS offsets when PPS offset is re-configured
+
+ChangeSet@1.1353.1.22, 2006-06-22 07:03:29-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P8
+ TAG: NTP_4_2_3P8
+
+ packageinfo.sh@1.46 +1 -1
+ NTP_4_2_3P8
+
+ChangeSet@1.1353.1.21, 2006-06-22 00:29:56-04:00, stenn@whimsy.udel.edu
+ cmd_args.c cleanup
+
+ ntpd/cmd_args.c@1.41 +3 -153
+ cleanup
+
+ChangeSet@1.1353.1.20, 2006-06-21 07:03:02-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P7
+ TAG: NTP_4_2_3P7
+
+ packageinfo.sh@1.45 +1 -1
+ NTP_4_2_3P7
+
+ChangeSet@1.1353.1.19, 2006-06-21 06:17:57-04:00, stenn@whimsy.udel.edu
+ OSF4 does not have RTM_{NEW,DEL}ADDR
+
+ ntpd/ntp_io.c@1.223 +4 -0
+ OSF4 does not have RTM_{NEW,DEL}ADDR
+
+ChangeSet@1.1353.1.18, 2006-06-21 03:52:10-04:00, stenn@whimsy.udel.edu
+ Use a pointer to feed the options to optionUsage() to avoid a struct copy
+
+ ntpd/cmd_args.c@1.40 +4 -4
+ Use a pointer to feed the options to optionUsage() to avoid a struct copy
+
+ChangeSet@1.1353.1.17, 2006-06-20 17:42:13-04:00, stenn@whimsy.udel.edu
+ Protect COMMAND since we use it as an autogen keyword
+
+ ntpdc/ntpdc.c@1.52 +9 -4
+ Protect COMMAND since we use it as an autogen keyword
+
+ ntpq/ntpq.c@1.63 +10 -5
+ Protect COMMAND since we use it as an autogen keyword
+
+ChangeSet@1.1353.1.16, 2006-06-20 07:03:15-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P6
+ TAG: NTP_4_2_3P6
+
+ packageinfo.sh@1.44 +1 -1
+ NTP_4_2_3P6
+
+ChangeSet@1.1353.1.14, 2006-06-20 03:15:38-04:00, stenn@whimsy.udel.edu
+ Fix the configure.ac check for rt_msghdr
+
+ configure.ac@1.386 +2 -3
+ Fix the configure.ac check for rt_msghdr
+
+ChangeSet@1.1353.1.13, 2006-06-19 07:24:31-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P5
+ TAG: NTP_4_2_3P5
+
+ packageinfo.sh@1.42 +1 -1
+ NTP_4_2_3P5
+
+ChangeSet@1.1251.97.1, 2006-06-19 07:02:56-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC3
+ TAG: NTP_4_2_2P0_RC3
+
+ packageinfo.sh@1.27.1.8 +1 -1
+ NTP_4_2_2P0_RC3
+
+ChangeSet@1.1353.1.12, 2006-06-19 04:16:30-04:00, stenn@whimsy.udel.edu
+ Update the NEWS file for the dynamic interface scan fix
+
+ NEWS@1.52 +1 -0
+ Update the NEWS file for the dynamic interface scan fix
+
+ChangeSet@1.1251.96.1, 2006-06-19 02:31:54-04:00, stenn@pogo.udel.edu
+ Avoid hardcoded path to bash for the bootstrap script
+
+ bootstrap@1.4.2.1 +1 -1
+ Avoid hardcoded path to bash for the bootstrap script
+
+ChangeSet@1.1353.3.8, 2006-06-18 20:14:55-04:00, stenn@deacon.udel.edu
+ Bash might not be in /bin/bash (for bootstrap)
+
+ bootstrap@1.9 +9 -6
+ Bash might not be in /bin/bash (for bootstrap)
+
+ChangeSet@1.1353.3.7, 2006-06-18 20:12:51-04:00, stenn@deacon.udel.edu
+ ignore:
+ added libopts/*
+
+ BitKeeper/etc/ignore@1.50 +1 -0
+ added libopts/*
+
+ChangeSet@1.1251.94.19, 2006-06-18 20:09:27-04:00, stenn@deacon.udel.edu
+ bash (for the bootstrap script) might not be /bin/bash
+
+ bootstrap@1.4.1.1 +1 -1
+ bash (for the bootstrap script) might not be /bin/bash
+
+ChangeSet@1.1353.1.9, 2006-06-18 22:18:50+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ import fix for bug 637
+
+ ntpd/ntp_io.c@1.221 +22 -9
+ import fix for bug 637
+
+ChangeSet@1.1353.3.6, 2006-06-18 07:24:11-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P4
+ TAG: NTP_4_2_3P4
+
+ packageinfo.sh@1.40 +1 -1
+ NTP_4_2_3P4
+
+ChangeSet@1.1251.94.18, 2006-06-18 07:03:14-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC2
+ TAG: NTP_4_2_2P0_RC2
+
+ packageinfo.sh@1.27.1.7 +1 -1
+ NTP_4_2_2P0_RC2
+
+ChangeSet@1.1353.3.5, 2006-06-18 02:18:46-04:00, stenn@whimsy.udel.edu
+ The fix for bug 637 needs work for ntp-dev
+
+ ntpd/ntp_io.c@1.218.1.1 +2 -0
+ The fix for bug 637 needs work for ntp-dev
+
+ChangeSet@1.1353.3.4, 2006-06-18 02:14:55-04:00, stenn@whimsy.udel.edu
+ ntp-dev uses repotype=dev
+
+ packageinfo.sh@1.39 +2 -2
+ ntp-dev uses repotype=dev
+
+ChangeSet@1.1251.94.17, 2006-06-18 02:05:42-04:00, stenn@whimsy.udel.edu
+ Make the license check triggers work with bk3 and bk4
+
+ BitKeeper/triggers/post-incoming.license-warn@1.6 +9 -3
+ Make the license check triggers work with bk3 and bk4
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.5.1.2 +10 -4
+ Make the license check triggers work with bk3 and bk4
+
+ChangeSet@1.1251.94.15, 2006-06-17 22:47:38-04:00, stenn@whimsy.udel.edu
+ debug
+
+ BitKeeper/triggers/post-incoming.license-warn@1.5 +1 -0
+ debug
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.5.1.1 +1 -0
+ debug
+
+ChangeSet@1.1353.3.1, 2006-06-17 22:32:24-04:00, stenn@whimsy.udel.edu
+ typo
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.3.1.1 +0 -1
+ typo
+
+ChangeSet@1.1251.94.14, 2006-06-17 22:05:18-04:00, stenn@whimsy.udel.edu
+ typo
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.5 +0 -1
+ typo
+
+ChangeSet@1.1353.1.7, 2006-06-18 00:01:22+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ skip interfaces that cannot be bound to
+
+ ntpd/ntp_io.c@1.219 +1 -0
+ skip interfaces that cannot be bound to
+
+ChangeSet@1.1251.94.13, 2006-06-17 19:57:47-04:00, stenn@whimsy.udel.edu
+ More bk-4 license check trigger cleanup
+
+ BitKeeper/triggers/post-incoming.license-warn@1.4 +2 -0
+ More bk-4 license check trigger cleanup
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.4 +2 -0
+ More bk-4 license check trigger cleanup
+
+ChangeSet@1.1251.95.1, 2006-06-17 23:09:55+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ move decision into seperate function and insure compilability on
+ non IPv6 platforms
+
+ ntpd/ntp_io.c@1.187.1.16 +24 -8
+ move decision into seperate function and insure compilability on
+ non IPv6 platforms
+
+ChangeSet@1.1251.94.12, 2006-06-17 18:42:11-04:00, stenn@whimsy.udel.edu
+ More bk-4 license check trigger cleanup
+
+ BitKeeper/triggers/post-incoming.license-warn@1.3 +11 -4
+ More bk-4 license check trigger cleanup
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.3 +12 -4
+ More bk-4 license check trigger cleanup
+
+ChangeSet@1.1251.94.11, 2006-06-17 13:53:20-04:00, stenn@whimsy.udel.edu
+ [Bug 637] Ignore UP in*addr_any interfaces
+
+ ntpd/ntp_io.c@1.187.1.15 +15 -0
+ [Bug 637] Ignore UP in*addr_any interfaces
+
+ChangeSet@1.1251.94.10, 2006-06-17 13:47:07-04:00, stenn@whimsy.udel.edu
+ Deal with -stable rcpoint
+
+ packageinfo.sh@1.27.1.6 +1 -0
+ Deal with -stable rcpoint
+
+ scripts/VersionName@1.4 +10 -0
+ Deal with -stable rcpoint
+
+ChangeSet@1.1251.94.9, 2006-06-17 12:37:23-04:00, stenn@whimsy.udel.edu
+ bk-3 uses sccscat, bk-4 uses annotate
+
+ BitKeeper/triggers/post-incoming.license-warn@1.2 +10 -1
+ bk-3 uses sccscat, bk-4 uses annotate
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.2 +9 -1
+ bk-3 uses sccscat, bk-4 uses annotate
+
+ChangeSet@1.1353.1.4, 2006-06-17 07:21:46-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P3
+ TAG: NTP_4_2_3P3
+
+ packageinfo.sh@1.37 +1 -1
+ NTP_4_2_3P3
+
+ChangeSet@1.1251.94.8, 2006-06-17 07:02:53-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC
+ TAG: NTP_4_2_2P0_RC
+
+ packageinfo.sh@1.27.1.5 +1 -1
+ NTP_4_2_2P0_RC
+
+ChangeSet@1.1353.1.2, 2006-06-16 18:33:41-04:00, stenn@pogo.udel.edu
+ Makefile.am:
+ "make distcheck" is now happy with the libopts/ stuff
+ configure.ac, Makefile.am:
+ [Bug 635] get libopts/ properly distributed
+ [Bug 635] Properly distribute libopts/ .
+ Makefile.am:
+ Distribute copyright.def and debug-opt.def
+ debug-opt.def:
+ Change mode to -rw-rw-rw-
+
+ Makefile.am@1.66 +61 -57
+ "make distcheck" is now happy with the libopts/ stuff
+
+ Makefile.am@1.65 +1 -1
+ [Bug 635] get libopts/ properly distributed
+
+ Makefile.am@1.64 +6 -3
+ [Bug 635] Properly distribute libopts/ .
+
+ configure.ac@1.385 +1 -2
+ [Bug 635] get libopts/ properly distributed
+
+ configure.ac@1.384 +1 -0
+ [Bug 635] Properly distribute libopts/ .
+
+ include/Makefile.am@1.23 +1 -1
+ Distribute copyright.def and debug-opt.def
+
+ include/debug-opt.def@1.3 +0 -0
+ Change mode to -rw-rw-rw-
+
+ChangeSet@1.1251.94.7, 2006-06-16 18:02:54-04:00, stenn@whimsy.udel.edu
+ [Bug 633] Avoid writing files in srcdir
+
+ scripts/genver@1.4 +8 -8
+ [Bug 633] Avoid writing files in srcdir
+
+ChangeSet@1.1351.1.1, 2006-06-16 02:54:50-04:00, stenn@pogo.udel.edu
+ Use separate copies of libopts for ntp and sntp
+
+ bootstrap@1.6.1.1 +7 -0
+ Use separate copies of libopts for ntp and sntp
+
+ChangeSet@1.1353, 2006-06-15 07:12:32-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P2
+ TAG: NTP_4_2_3P2
+
+ packageinfo.sh@1.35 +1 -1
+ NTP_4_2_3P2
+
+ChangeSet@1.1352, 2006-06-15 04:46:11-04:00, stenn@whimsy.udel.edu
+ Try harder to get sntp/libopts/Makefile.in to get the correct srcdir path
+
+ bootstrap@1.7 +4 -0
+ Try harder to get sntp/libopts/Makefile.in to get the correct srcdir path
+
+ChangeSet@1.1347.2.3, 2006-06-13 07:27:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P1
+ TAG: NTP_4_2_3P1
+
+ packageinfo.sh@1.34 +1 -1
+ NTP_4_2_3P1
+
+ChangeSet@1.1251.94.6, 2006-06-13 07:02:41-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC
+ TAG: NTP_4_2_2P0_RC
+
+ packageinfo.sh@1.27.1.4 +1 -1
+ NTP_4_2_2P0_RC
+
+ChangeSet@1.1251.94.5, 2006-06-13 04:43:41-04:00, stenn@whimsy.udel.edu
+ Distribute the bootstrap script
+
+ Makefile.am@1.48.1.4 +1 -0
+ Distribute the bootstrap script
+
+ChangeSet@1.1347.2.1, 2006-06-12 07:47:44-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3P0
+ TAG: NTP_4_2_3P0
+
+ packageinfo.sh@1.32 +1 -1
+ NTP_4_2_3P0
+
+ChangeSet@1.1251.94.4, 2006-06-12 07:03:05-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2P0_RC
+ TAG: NTP_4_2_2P0_RC
+
+ packageinfo.sh@1.27.1.3 +2 -2
+ NTP_4_2_2P0_RC
+
+ChangeSet@1.1347.1.10, 2006-06-12 01:42:27-04:00, stenn@whimsy.udel.edu
+ Explain how to disable the trigger stuff
+
+ BitKeeper/triggers/trigger.README@1.4 +6 -0
+ Explain how to disable the trigger stuff
+
+ChangeSet@1.1347.1.9, 2006-06-12 01:37:08-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ packageinfo.sh@1.31 +2 -2
+ cleanup
+
+ChangeSet@1.1251.94.3, 2006-06-11 18:38:11-04:00, stenn@whimsy.udel.edu
+ Install license check triggers.
+
+ BitKeeper/triggers/post-incoming.license-warn@1.1 +14 -0
+
+ BitKeeper/triggers/post-incoming.license-warn@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable/BitKeeper/triggers/post-incoming.license-warn
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.1 +21 -0
+
+ BitKeeper/triggers/pre-resolve.license-chk@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-stable/BitKeeper/triggers/pre-resolve.license-chk
+
+ChangeSet@1.1251.94.2, 2006-06-11 17:49:08-04:00, stenn@whimsy.udel.edu
+ Add some internal distribution checks
+
+ packageinfo.sh@1.27.1.2 +3 -3
+ Add some internal distribution checks
+
+ChangeSet@1.1347.1.7, 2006-06-11 01:34:07+00:00, rick@pogo.udel.edu
+ pre-resolve.fixlic:
+ Block bad repos from being pulled into this repo,
+ or if this repo is bad, stops it from being used.
+
+ Please do a 'bk fix -c' and edit pre-resolve.fixlic
+ to either rename it or make it better.
+ Then bk new them and bk commit.
+ Thanks. -- Rick Smith
+
+ BitKeeper/triggers/pre-resolve.licfix@1.1 +32 -0
+
+ BitKeeper/triggers/pre-resolve.licfix@1.0 +0 -0
+ BitKeeper file /pogo/users/lm/ntp-fixed.license/BitKeeper/triggers/pre-resolve.licfix
+
+ChangeSet@1.1347.1.6, 2006-06-10 01:37:28-04:00, stenn@whimsy.udel.edu
+ bootstrap:
+ there was a libopts dependency name problem with the old autoreconf sequence - change it to something slower that works.
+ flock-build:
+ lose --with-sntp as it is no longer needed
+
+ bootstrap@1.6 +2 -2
+ there was a libopts dependency name problem with the old autoreconf sequence - change it to something slower that works.
+
+ flock-build@1.36 +1 -1
+ lose --with-sntp as it is no longer needed
+
+ChangeSet@1.1347.1.5, 2006-06-09 19:30:12-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_3
+ TAG: NTP_4_2_3
+
+ packageinfo.sh@1.29 +1 -1
+ NTP_4_2_3
+
+ChangeSet@1.1251.94.1, 2006-06-06 16:19:55-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_2
+ TAG: NTP_4_2_2
+
+ packageinfo.sh@1.27.1.1 +1 -1
+ NTP_4_2_2
+
+ChangeSet@1.1347.1.4, 2006-06-06 05:05:56-04:00, stenn@whimsy.udel.edu
+ [Bug 500] sntp is now part of the team
+
+ Makefile.am@1.62 +1 -1
+ [Bug 500] sntp is now part of the team
+
+ configure.ac@1.381.1.1 +1 -20
+ [Bug 500] sntp is now part of the team
+
+ChangeSet@1.1350, 2006-06-06 08:47:18+00:00, kardel@pogo.udel.edu
+ ntpdbase-opts.def:
+ add U option for update interval for
+ interface scan
+ cmd_args.c:
+ adjust argument processing to a number
+
+ ntpd/cmd_args.c@1.39 +5 -5
+ adjust argument processing to a number
+
+ ntpd/ntpdbase-opts.def@1.2.1.1 +13 -0
+ add U option for update interval for
+ interface scan
+
+ChangeSet@1.1347.1.3, 2006-06-06 04:44:33-04:00, stenn@deacon.udel.edu
+ Mention autogen in NEWS
+
+ NEWS@1.51 +2 -0
+ Mention autogen in NEWS
+
+ChangeSet@1.1347.1.2, 2006-06-06 04:21:52-04:00, stenn@deacon.udel.edu
+ Copyright cleanup
+
+ clockstuff/Makefile.am@1.5 +2 -0
+ Copyright cleanup
+
+ clockstuff/clktest-opts.def@1.3 +0 -22
+ Copyright cleanup
+
+ include/copyright.def@1.3 +3 -2
+ Copyright cleanup
+
+ ntpd/Makefile.am@1.48 +6 -6
+ Copyright cleanup
+
+ ntpd/ntpd-opts.def@1.3 +1 -28
+ Copyright cleanup
+
+ ntpd/ntpdbase-opts.def@1.3 +0 -13
+ Copyright cleanup
+
+ ntpd/ntpdsim-opts.def@1.3 +1 -28
+ Copyright cleanup
+
+ ntpdc/Makefile.am@1.30 +3 -3
+ Copyright cleanup
+
+ ntpdc/ntpdc-opts.def@1.9 +0 -22
+ Copyright cleanup
+
+ ntpq/Makefile.am@1.22 +3 -3
+ Copyright cleanup
+
+ ntpq/ntpq-opts.def@1.6 +1 -42
+ Copyright cleanup
+
+ sntp/sntp-opts.def@1.3 +3 -24
+ Copyright cleanup
+
+ util/Makefile.am@1.31 +3 -3
+ Copyright cleanup
+
+ util/ntp-keygen-opts.def@1.3 +3 -32
+ Copyright cleanup
+
+ChangeSet@1.1347.1.1, 2006-06-06 03:06:10-04:00, stenn@whimsy.udel.edu
+ re-enable auto-gen
+
+ bootstrap@1.5 +14 -14
+ Re-enable autogen now that we need it.
+
+ ntpd/ntpd.c@1.77.1.1 +0 -2
+ lose some old debug output
+
+ChangeSet@1.1251.80.72, 2006-06-05 21:31:04-04:00, stenn@whimsy.udel.edu
+ ntp-4.2.3
+
+ packageinfo.sh@1.28 +1 -1
+ ntp-4.2.3
+
+ChangeSet@1.1251.80.71, 2006-06-05 19:53:12-04:00, stenn@whimsy.udel.edu
+ ntp-4.2.2
+
+ NEWS@1.50 +6 -1
+ Release ntp-4.2.2
+
+ packageinfo.sh@1.27 +4 -4
+ Release ntp-4.2.2
+
+ scripts/VersionName@1.3 +1 -0
+ clean up a corner case
+
+ChangeSet@1.1251.80.70, 2006-05-29 07:02:40-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P257_RC
+ TAG: NTP_4_2_1P257_RC
+
+ packageinfo.sh@1.26 +1 -1
+ NTP_4_2_1P257_RC
+
+ChangeSet@1.1251.72.45, 2006-05-27 11:04:43+00:00, kardel@pogo.udel.edu
+ monopt.html:
+ document conditional nature of process timing debugging
+ ntpd.c:
+ make process timing debug conditional
+ cleanup conditional compilation
+ ntp_util.c, ntp_io.c:
+ make process timing debug conditional
+ ntpd.h:
+ cleanup conditional compile cruft in ntpd.c by defining a macro
+ configure.ac:
+ make process timing debug code conditional (default off)
+
+ configure.ac@1.359.1.30 +9 -0
+ make process timing debug code conditional (default off)
+
+ html/monopt.html@1.22 +1 -1
+ document conditional nature of process timing debugging
+
+ include/ntpd.h@1.82.1.16 +5 -0
+ cleanup conditional compile cruft in ntpd.c by defining a macro
+
+ ntpd/ntp_io.c@1.217 +9 -7
+ make process timing debug conditional
+
+ ntpd/ntp_util.c@1.41 +3 -3
+ make process timing debug conditional
+
+ ntpd/ntpd.c@1.61.1.26 +11 -21
+ make process timing debug conditional
+ cleanup conditional compilation
+
+ChangeSet@1.1251.80.68, 2006-05-27 07:02:40-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P256_RC
+ TAG: NTP_4_2_1P256_RC
+
+ packageinfo.sh@1.25 +1 -1
+ NTP_4_2_1P256_RC
+
+ChangeSet@1.1251.93.1, 2006-05-26 17:08:21+00:00, kardel@pogo.udel.edu
+ ntpdc.h:
+ bug 621
+ change arg_v to struct, add type field
+ ntpdc.c:
+ bug 621
+ change arg_v to struct, add type field, initialize string member
+ always as the 'new' parsing code seems to make that previously
+ unfounded assumption.
+
+ ntpdc/ntpdc.c@1.40.2.6 +9 -2
+ bug 621
+ change arg_v to struct, add type field, initialize string member
+ always as the 'new' parsing code seems to make that previously
+ unfounded assumption.
+
+ ntpdc/ntpdc.h@1.7 +4 -2
+ bug 621
+ change arg_v to struct, add type field
+
+ChangeSet@1.1251.80.67, 2006-05-26 14:40:03+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ bug 619
+ delay io_addclock() even further as suggested by Ronan Flood
+
+ ntpd/refclock_parse.c@1.35.1.11 +25 -19
+ bug 619
+ delay io_addclock() even further as suggested by Ronan Flood
+
+ChangeSet@1.1251.80.66, 2006-05-26 07:02:46-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P255_RC
+ TAG: NTP_4_2_1P255_RC
+
+ packageinfo.sh@1.24 +1 -1
+ NTP_4_2_1P255_RC
+
+ChangeSet@1.1251.92.3, 2006-05-25 18:25:23+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ bug #619
+ terminate parse io engine after de-registering
+ from refclock io engine
+
+ ntpd/refclock_parse.c@1.35.3.3 +12 -7
+ bug #619
+ terminate parse io engine after de-registering
+ from refclock io engine
+
+ChangeSet@1.1251.92.2, 2006-05-25 18:08:49+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ add missing BLOCKIO()/UNBLOCKIO() calls in refclock io
+ handling found during analysis for bug #619
+ refclock_parse.c:
+ bug #619
+ complete refclock io structure initialization *before* inserting it into the
+ refclock input machine (avoids null pointer deref)
+
+ ntpd/ntp_io.c@1.187.1.14 +4 -0
+ add missing BLOCKIO()/UNBLOCKIO() calls in refclock io
+ handling found during analysis for bug #619
+
+ ntpd/refclock_parse.c@1.35.3.2 +19 -12
+ bug #619
+ complete refclock io structure initialization *before* inserting it into the
+ refclock input machine (avoids null pointer deref)
+
+ChangeSet@1.1251.92.1, 2006-05-25 07:02:50-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P254_RC
+ TAG: NTP_4_2_1P254_RC
+
+ packageinfo.sh@1.23 +1 -1
+ NTP_4_2_1P254_RC
+
+ChangeSet@1.1251.72.42, 2006-05-25 07:55:42+00:00, kardel@pogo.udel.edu
+ monopt.html:
+ document timingstats (only available when daemon is compiled with DEBUG)
+ ntpd.h, ntpd.c, ntp_util.c:
+ support collection of timing data
+ ntp_io.c:
+ implement SO_TIMESTAMP for systems that have it
+ support collection of timing data
+ fix io signal blocking in refclock io handling functions
+ ntp_crypto.c:
+ return OK when interface is not bound
+
+ html/monopt.html@1.21 +5 -1
+ document timingstats (only available when daemon is compiled with DEBUG)
+
+ include/ntpd.h@1.82.1.15 +6 -0
+ support collection of timing data
+
+ ntpd/ntp_crypto.c@1.107 +1 -1
+ return OK when interface is not bound
+
+ ntpd/ntp_io.c@1.215 +119 -12
+ implement SO_TIMESTAMP for systems that have it
+ support collection of timing data
+ fix io signal blocking in refclock io handling functions
+
+ ntpd/ntp_util.c@1.40 +39 -0
+ support collection of timing data
+
+ ntpd/ntpd.c@1.61.1.25 +43 -17
+ support collection of timing data
+
+ChangeSet@1.1251.80.62, 2006-05-24 22:01:55-04:00, mayer@pogo.udel.edu
+ Bug #504 Allow forced DNS retry even on failure only if macro FORCE_DNSRETRY is defined
+
+ ntpd/ntp_intres.c@1.47 +13 -0
+ Bug #504 Allow forced DNS retry even on failure only if macro FORCE_DNSRETRY is defined
+
+ChangeSet@1.1251.80.61, 2006-05-21 14:57:46-04:00, mayer@pogo.udel.edu
+ Bug #614 Remove errno manipulation from move_fd()
+
+ ntpd/ntp_io.c@1.187.1.13 +1 -3
+ Bug #614 Remove errno manipulation from move_fd()
+
+ChangeSet@1.1251.91.1, 2006-05-21 12:10:13-04:00, mayer@pogo.udel.edu
+ Bug #614 Changed dup_fd to move_fd and remove for Windows
+
+ ntpd/ntp_io.c@1.187.1.12 +5 -5
+ Bug #614 Changed dup_fd to move_fd and remove for Windows
+
+ChangeSet@1.1251.80.59, 2006-05-21 07:03:00-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P253_RC
+ TAG: NTP_4_2_1P253_RC
+
+ packageinfo.sh@1.22 +1 -1
+ NTP_4_2_1P253_RC
+
+ChangeSet@1.1251.80.57, 2006-05-20 19:15:50-04:00, mayer@pogo.udel.edu
+ Fix Bug #612: Erroneous FAR macro
+
+ libntp/ntp_rfc2553.c@1.27.1.4 +2 -5
+ Fix Bug #612: Erroneous FAR macro
+
+ ports/winnt/libntp/dnslookup.c@1.3 +3 -3
+ Fix Bug #612: Erroneous FAR macro
+
+ChangeSet@1.1251.90.5, 2006-05-20 18:16:07-04:00, stenn@whimsy.udel.edu
+ Update the UDel host lists and handle the PWD better
+
+ br-flock@1.9 +1 -1
+ Update the UDel host lists and handle the PWD better
+
+ flock-build@1.35 +2 -3
+ Update the UDel host lists and handle the PWD better
+
+ChangeSet@1.1251.80.56, 2006-05-20 17:01:51-04:00, mayer@pogo.udel.edu
+ Bug fixes for #611, 612, 614 and 530
+
+ libntp/ntp_rfc2553.c@1.27.1.3 +4 -2
+ Bug #612 Added include for netent structure
+
+ ntpd/ntp_intres.c@1.46 +1 -1
+ Bug #611 Check for various EAI_* macros
+
+ ntpd/ntp_io.c@1.187.1.11 +6 -4
+ Bug #530 and #614 fixes to add comments
+
+ChangeSet@1.1251.80.55, 2006-05-16 07:58:39-04:00, mayer@pogo.udel.edu
+ Bug #614 Add FOPEN_MAX as a parameter for dup_fd() usage. Also this is the fix for Bug #530
+
+ ntpd/ntp_io.c@1.187.1.10 +5 -2
+ Bug #614 Add FOPEN_MAX as a parameter for dup_fd() usage. Also this is the fix for Bug #530
+
+ChangeSet@1.1251.80.54, 2006-05-15 19:45:34-04:00, mayer@pogo.udel.edu
+ Bug #611. Refix to add additional condition for Win32
+
+ ntpd/ntp_intres.c@1.45 +2 -0
+ Bug #611. Refix to add additional condition for Win32
+
+ChangeSet@1.1251.80.53, 2006-05-15 19:30:22-04:00, mayer@pogo.udel.edu
+ Bug #614 Fix duplicate descriptor code and properly handle error conditions
+
+ ntpd/ntp_io.c@1.187.1.9 +6 -1
+ Bug #614 Fix duplicate descriptor code and properly handle error conditions
+
+ChangeSet@1.1251.90.4, 2006-05-13 07:02:51-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P252_RC
+ TAG: NTP_4_2_1P252_RC
+
+ packageinfo.sh@1.21 +1 -1
+ NTP_4_2_1P252_RC
+
+ChangeSet@1.1251.90.3, 2006-05-12 14:57:38-04:00, stenn@whimsy.udel.edu
+ [Bug 611] Fix based on Danny's comment
+
+ ntpd/ntp_intres.c@1.44 +2 -0
+ [Bug 611] Fix based on Danny's comment
+
+ChangeSet@1.1251.90.2, 2006-05-12 16:29:02+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ Bug 613: fix spelling
+
+ ntpd/refclock_parse.c@1.35.3.1 +2 -2
+ Bug 613: fix spelling
+
+ChangeSet@1.1251.90.1, 2006-05-11 13:45:28-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P251_RC
+ TAG: NTP_4_2_1P251_RC
+
+ packageinfo.sh@1.20 +1 -1
+ NTP_4_2_1P251_RC
+
+ChangeSet@1.1251.89.1, 2006-05-11 15:07:05+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ fix spelling
+
+ ntpd/refclock_parse.c@1.35.1.8 +2 -2
+ fix spelling
+
+ChangeSet@1.1251.80.51, 2006-05-10 23:55:45-04:00, mayer@pogo.udel.edu
+ Bug #611 Fix for EAI_* codes and netent definitions
+
+ libntp/ntp_rfc2553.c@1.27.1.2 +3 -0
+ Bug #612 Fix for EAI_* codes and netent definitions - add netdb.h include
+
+ChangeSet@1.1251.80.50, 2006-05-10 15:05:24-04:00, stenn@whimsy.udel.edu
+ allow the AUTORECONF envariable to supply the name of autoreconf
+
+ bootstrap@1.4 +4 -2
+ allow the AUTORECONF envariable to supply the name of autoreconf
+
+ChangeSet@1.1251.80.49, 2006-05-09 06:44:15-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P250_RC
+ TAG: NTP_4_2_1P250_RC
+
+ packageinfo.sh@1.19 +1 -1
+ NTP_4_2_1P250_RC
+
+ChangeSet@1.1251.80.48, 2006-05-09 09:56:16+00:00, kardel@pogo.udel.edu
+ ntpd.c:
+ keep block/unblock calls balanced
+
+ ntpd/ntpd.c@1.61.1.24 +4 -4
+ keep block/unblock calls balanced
+
+ChangeSet@1.1251.88.1, 2006-05-09 09:30:28+00:00, kardel@pogo.udel.edu
+ ntpd.c:
+ refill of current buffer missing
+
+ ntpd/ntpd.c@1.61.1.23 +1 -0
+ refill of current buffer missing
+
+ChangeSet@1.1251.87.1, 2006-05-09 03:22:02-04:00, stenn@whimsy.udel.edu
+ prepare for RCs for -stable point releases
+
+ packageinfo.sh@1.18 +6 -0
+ prepare for RCs for -stable point releases
+
+ChangeSet@1.1251.80.45, 2006-05-09 07:12:14+00:00, kardel@pogo.udel.edu
+ ntpd.c:
+ move freerecvbuf() into block io section
+ test receiver instead of just the rbuf pointer
+
+ ntpd/ntpd.c@1.61.1.22 +2 -2
+ move freerecvbuf() into block io section
+ test receiver instead of just the rbuf pointer
+
+ChangeSet@1.1251.80.44, 2006-05-08 18:21:44-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P249_RC
+ TAG: NTP_4_2_1P249_RC
+
+ packageinfo.sh@1.17 +1 -1
+ NTP_4_2_1P249_RC
+
+ChangeSet@1.1251.80.43, 2006-05-08 10:52:36+00:00, burnicki@pogo.udel.edu
+ Retrieve version info from packageinfo.sh also under Windows.
+
+ BitKeeper/etc/logging_ok@1.57.3.3 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ ports/winnt/scripts/mkver.bat@1.8 +45 -18
+ Retrieve version info from packageinfo.sh.
+
+ChangeSet@1.1251.80.42, 2006-05-08 05:34:00-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P248_RC
+ TAG: NTP_4_2_1P248_RC
+
+ packageinfo.sh@1.16 +1 -1
+ NTP_4_2_1P248_RC
+
+ChangeSet@1.1251.80.41, 2006-05-08 04:59:17-04:00, stenn@whimsy.udel.edu
+ handle the initial case where no version files exist
+
+ scripts/genver@1.3 +8 -8
+ handle the initial case where no version files exist
+
+ChangeSet@1.1251.80.40, 2006-05-05 16:40:34-04:00, mayer@pogo.udel.edu
+ Bug #596/527 updates to remove [UN]BLOCKIO() and keep initialization for Windows
+
+ libntp/recvbuff.c@1.22 +0 -10
+ Bug #596/527 updates to remove [UN]BLOCKIO() and keep initialization for Windows
+
+ChangeSet@1.1251.80.39, 2006-05-05 08:48:59-04:00, mayer@pogo.udel.edu
+ Bug #504 Collection of changes to retry DNS in case unable to get definitive answer
+
+ libntp/ntp_rfc2553.c@1.27.1.1 +43 -5
+ Bug #504 Move lookup call to dnslookup() function
+
+ ntpd/ntp_intres.c@1.43 +22 -8
+ Bug Retry DNS lookups if DNS unable to give a definitive answer or is unreachable
+
+ ports/winnt/libntp/dnslookup.c@1.2 +0 -1
+ Bug #504 Windows only special lookup to fix return error codes
+
+ ports/winnt/libntp/dnslookup.c@1.1 +197 -0
+
+ ports/winnt/libntp/dnslookup.c@1.0 +0 -0
+ BitKeeper file /pogo/users/mayer/ntp-dev/ports/winnt/libntp/dnslookup.c
+
+ ports/winnt/libntp/libntp.dsp@1.28 +4 -0
+ Bug #504 add Windows only dnslookup to dsp file
+
+ChangeSet@1.1251.85.14, 2006-05-05 00:52:13-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P247_RC
+ TAG: NTP_4_2_1P247_RC
+
+ packageinfo.sh@1.15 +1 -1
+ NTP_4_2_1P247_RC
+
+ChangeSet@1.1251.85.13, 2006-05-05 00:47:24-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P246_RC
+ TAG: NTP_4_2_1P246_RC
+
+ packageinfo.sh@1.14 +1 -1
+ NTP_4_2_1P246_RC
+
+ChangeSet@1.1251.85.12, 2006-05-05 00:42:27-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P245_RC
+ TAG: NTP_4_2_1P245_RC
+
+ packageinfo.sh@1.13 +1 -1
+ NTP_4_2_1P245_RC
+
+ChangeSet@1.1251.85.11, 2006-05-05 00:37:38-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P244_RC
+ TAG: NTP_4_2_1P244_RC
+
+ packageinfo.sh@1.12 +1 -1
+ NTP_4_2_1P244_RC
+
+ChangeSet@1.1251.85.10, 2006-05-04 22:28:16-04:00, stenn@whimsy.udel.edu
+ Clean up/fix the force code
+
+ scripts/genver@1.2 +20 -12
+ Clean up/fix the force code
+
+ChangeSet@1.1251.85.9, 2006-05-04 19:50:54-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P243_RC
+ TAG: NTP_4_2_1P243_RC
+
+ packageinfo.sh@1.11 +1 -1
+ NTP_4_2_1P243_RC
+
+ChangeSet@1.1251.85.8, 2006-05-04 07:03:18-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P242_RC
+ TAG: NTP_4_2_1P242_RC
+
+ packageinfo.sh@1.10 +1 -1
+ NTP_4_2_1P242_RC
+
+ChangeSet@1.1251.85.7, 2006-05-04 05:54:17-04:00, stenn@deacon.udel.edu
+ Re-enable signaled I/O
+
+ configure.ac@1.359.1.29 +2 -6
+ Re-enable signaled I/O
+
+ChangeSet@1.1251.86.1, 2006-05-04 05:38:51-04:00, stenn@deacon.udel.edu
+ clean up the version generation stuff.
+
+ Makefile.am@1.48.1.3 +12 -2
+ Deal with packageinfo.sh, version.m4, and include/version.def
+
+ bootstrap@1.3 +2 -6
+ Use the new scripts/genver to generate the version files
+
+ include/Makefile.am@1.19.1.2 +1 -1
+ distribute inclue/version.def
+
+ scripts/Makefile.am@1.13 +2 -2
+ Distribute VersionName and genver.
+
+ scripts/genver@1.1 +59 -0
+
+ scripts/genver@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/scripts/genver
+
+ChangeSet@1.1251.85.5, 2006-05-02 09:13:40+00:00, kardel@pogo.udel.edu
+ ntp_crypto.c:
+ handle NULL return from d2i_X509() - NetBSD Run 21 Coverity CID 2979
+
+ ntpd/ntp_crypto.c@1.98.1.13 +1 -1
+ handle NULL return from d2i_X509() - NetBSD Run 21 Coverity CID 2979
+
+ChangeSet@1.1251.85.4, 2006-05-01 18:27:54+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ If an input buffer parses into more than one message do insert the
+ parsed message in a new input buffer instead of processing it
+ directly. This avoids deed complicated processing in signal
+ handling.
+ ntpd.c:
+ re-instate vital io blocking protocol to insure
+ that receive buffer queue is only manipulated when
+ io is blocked
+ recvbuff.c:
+ cleanup get_full_recvbuffer() to decide only the full queue head
+ and simplify code (remove multiple tests)
+
+ libntp/recvbuff.c@1.19.1.1 +4 -11
+ cleanup get_full_recvbuffer() to decide only the full queue head
+ and simplify code (remove multiple tests)
+
+ ntpd/ntpd.c@1.61.5.1 +25 -12
+ re-instate vital io blocking protocol to insure
+ that receive buffer queue is only manipulated when
+ io is blocked
+
+ ntpd/refclock_parse.c@1.35.1.7 +33 -18
+ If an input buffer parses into more than one message do insert the
+ parsed message in a new input buffer instead of processing it
+ directly. This avoids deed complicated processing in signal
+ handling.
+
+ChangeSet@1.1251.85.3, 2006-04-21 00:09:43-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P241_RC
+ TAG: NTP_4_2_1P241_RC
+
+ packageinfo.sh@1.9 +1 -1
+ NTP_4_2_1P241_RC
+
+ChangeSet@1.1251.85.2, 2006-04-20 23:59:56-04:00, stenn@whimsy.udel.edu
+ [Bug 527] Losed signalled IO.
+
+ configure.ac@1.359.1.28 +7 -2
+ [Bug 527] Losed signalled IO.
+
+ChangeSet@1.1251.85.1, 2006-04-18 05:58:13-04:00, stenn@whimsy.udel.edu
+ there are 240 ntp-dev patch releases so far
+
+ packageinfo.sh@1.8 +1 -1
+ there are 240 ntp-dev patch releases so far
+
+ChangeSet@1.1251.80.37, 2006-04-15 18:33:29-04:00, mayer@pogo.udel.edu
+ Fix Bug #596 and #572 to deal with polling restrictions
+
+ libntp/recvbuff.c@1.20 +20 -18
+ Fix Bug #596 and #572 to deal with polling restrictions
+
+ChangeSet@1.1251.80.36, 2006-04-15 18:32:57-04:00, mayer@pogo.udel.edu
+ Fix Bug #596 and #572 to deal with polling restrictions
+
+ ntpd/ntpd.c@1.61.1.20 +3 -1
+ Fix Bug #596 and #572 to deal with polling restrictions
+
+ChangeSet@1.1251.80.35, 2006-04-13 04:14:26-04:00, stenn@whimsy.udel.edu
+ Use ./packageinfo.sh as . may not be in the PATH. Reported by Frank Kardel.
+
+ bootstrap@1.2 +1 -1
+ Use ./packageinfo.sh as . may not be in the PATH. Reported by Frank Kardel.
+
+ scripts/VersionName@1.2 +2 -1
+ Use ./packageinfo.sh as . may not be in the PATH. Reported by Frank Kardel.
+
+ChangeSet@1.1251.80.34, 2006-04-12 06:43:08-04:00, stenn@whimsy.udel.edu
+ fix a typo
+
+ README.versions@1.4 +1 -1
+ fix a typo
+
+ChangeSet@1.1251.80.33, 2006-04-12 05:57:14-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P12_RC
+ TAG: NTP_4_2_1P12_RC
+
+ packageinfo.sh@1.7 +1 -1
+ NTP_4_2_1P12_RC
+
+ChangeSet@1.1251.80.32, 2006-04-12 05:27:53-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P11_RC
+ TAG: NTP_4_2_1P11_RC
+
+ packageinfo.sh@1.6 +1 -1
+ NTP_4_2_1P11_RC
+
+ChangeSet@1.1251.80.31, 2006-04-12 05:22:34-04:00, stenn@whimsy.udel.edu
+ Update the NEWS file
+
+ NEWS@1.49 +2 -1
+ Update the NEWS file
+
+ChangeSet@1.1251.80.30, 2006-04-12 05:14:52-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ packageinfo.sh@1.5 +1 -1
+ cleanup
+
+ChangeSet@1.1251.80.29, 2006-04-12 04:51:30-04:00, stenn@whimsy.udel.edu
+ NTP_4_2_1P10_RC
+ TAG: NTP_4_2_1P10_RC
+
+ packageinfo.sh@1.4 +1 -1
+ NTP_4_2_1P10_RC
+
+ChangeSet@1.1251.80.28, 2006-04-12 04:44:14-04:00, stenn@whimsy.udel.edu
+ use a reasonable value for "point".
+
+ packageinfo.sh@1.3 +1 -1
+ use a reasonable value for "point".
+
+ChangeSet@1.1251.80.27, 2006-04-12 04:39:22-04:00, stenn@whimsy.udel.edu
+ update
+
+ packageinfo.sh@1.2 +3 -3
+ update
+
+ChangeSet@1.1342, 2006-04-11 18:05:00-07:00, bkorb@bach.veritas.com
+ AutoOpt the clktest program.
+ Move copyright, version and config file stuff into a common file.
+
+ BitKeeper/etc/config@1.8 +4 -0
+ New license
+
+ clockstuff/clktest-opts.def@1.2 +228 -0
+ clktest option definition file.
+
+ clockstuff/clktest-opts.def@1.1 +0 -0
+
+ clockstuff/clktest-opts.def@1.0 +0 -0
+ BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/clockstuff/clktest-opts.def
+
+ clockstuff/clktest.c@1.3 +31 -148
+ Move includes to option definition file so the option code can use them, too.
+ Move option processing to option definition file. Use AutoOpts to parse.
+
+ include/copyright.def@1.2 +24 -0
+ version, copyright and rc file stuff for all commands.
+
+ include/copyright.def@1.1 +0 -0
+
+ include/copyright.def@1.0 +0 -0
+ BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/include/copyright.def
+
+ ntpdc/ntpdc-opts.def@1.8 +1 -24
+ Move common copyright and ini file stuff to a common "copyright.def" file.
+
+ChangeSet@1.1251.84.1, 2006-04-11 04:49:33-04:00, stenn@whimsy.udel.edu
+ release prep
+
+ bootstrap@1.1 +59 -0
+
+ bootstrap@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/bootstrap
+
+ packageinfo.sh@1.1 +19 -0
+
+ packageinfo.sh@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/packageinfo.sh
+
+ChangeSet@1.1251.80.25, 2006-04-09 05:25:08-04:00, stenn@whimsy.udel.edu
+ README* updates
+
+ README@1.21 +1 -1
+ README* updates
+
+ README.bk@1.18 +3 -51
+ README* updates
+
+ README.versions@1.3 +10 -18
+ README* updates
+
+ChangeSet@1.1251.80.24, 2006-04-09 05:00:52-04:00, stenn@whimsy.udel.edu
+ New release numbering style support
+
+ BitKeeper/deleted/.del-version.m4~4ef47e5fd0c38ddb@1.3.2.1 +0 -0
+ Delete: version.m4
+
+ BitKeeper/etc/ignore@1.35.1.1 +2 -0
+ added include/version.def version.m4
+
+ bootstrap@1.2 +13 -11
+ cleanup
+
+ bootstrap@1.1 +57 -0
+
+ bootstrap@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/bootstrap
+
+ packageinfo.sh@1.1 +17 -0
+
+ packageinfo.sh@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/packageinfo.sh
+
+ scripts/VersionName@1.1 +29 -0
+
+ scripts/VersionName@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/scripts/VersionName
+
+ChangeSet@1.1341, 2006-04-09 00:16:18-04:00, stenn@pogo.udel.edu
+ update
+
+ packageinfo.sh@1.4 +4 -1
+ update
+
+ChangeSet@1.1340, 2006-04-08 22:13:54-04:00, stenn@pogo.udel.edu
+ update
+
+ packageinfo.sh@1.3 +11 -1
+ update
+
+ChangeSet@1.1339, 2006-04-08 22:11:27-04:00, stenn@pogo.udel.edu
+ update
+
+ bootstrap@1.9 +1 -1
+ update
+
+ChangeSet@1.1338, 2006-04-08 00:50:08-04:00, stenn@pogo.udel.edu
+ Test new release numbering and snapshot method
+
+ BitKeeper/etc/ignore@1.48 +2 -0
+ added version.m4 include/version.def
+
+ packageinfo.sh@1.2 +4 -1
+ Test new release numbering and snapshot method
+
+ChangeSet@1.1251.80.23, 2006-04-04 03:16:32-04:00, stenn@deacon.udel.edu
+ [Bug 588] logfile documentation problems
+
+ html/miscopt.html@1.35 +5 -5
+ [Bug 588] logfile documentation problems
+
+ChangeSet@1.1251.80.22, 2006-04-01 05:14:27-05:00, stenn@deacon.udel.edu
+ Ignore control characters
+
+ ntpd/refclock_acts.c@1.25.1.1 +1 -1
+ Ignore control characters
+
+ChangeSet@1.1251.80.21, 2006-03-30 01:43:28-05:00, stenn@deacon.udel.edu
+ [Bug 584] quiet a coverity buffer overrun
+
+ ntpd/refclock_chu.c@1.37 +1 -1
+ [Bug 584] quiet a coverity buffer overrun
+
+ChangeSet@1.1336, 2006-03-26 06:02:05-05:00, stenn@pogo.udel.edu
+ debug-opts.def cleanup
+ Allow optional hostnames on the command line for ntpq and ntpdc.
+
+ BitKeeper/etc/ignore@1.47 +1 -1
+ Fix the ignore for sntp/libopts/
+
+ BitKeeper/etc/ignore@1.46 +1 -0
+ added sntp/libopts
+
+ ntpd/Makefile.am@1.47 +7 -7
+ debug-opt.def cleanup
+
+ ntpdc/Makefile.am@1.29 +4 -4
+ debug-opts.def cleanup
+
+ ntpdc/ntpdc-opts.def@1.7 +1 -0
+ Allow hostnames on the command-line.
+
+ ntpq/Makefile.am@1.21 +4 -4
+ debug-opts.def cleanup
+
+ ntpq/ntpq-opts.def@1.5 +3 -25
+ Allow hostnames on the command-line.
+
+ util/Makefile.am@1.30 +4 -4
+ debug-opts.def cleanup
+
+ChangeSet@1.1251.80.20, 2006-03-24 00:27:03-05:00, stenn@deacon.udel.edu
+ [Bug 571] fix a typo that prevents ntpdate from working
+
+ ntpdate/ntpdate.c@1.58 +1 -1
+ [Bug 571] fix a typo that prevents ntpdate from working
+
+ChangeSet@1.1251.80.18, 2006-03-21 10:43:26+00:00, kardel@pogo.udel.edu
+ ntp_restrict.c:
+ null deref: fix another case of incomplete list handling (Coverity NetBSD Scan 8: CID 986)
+
+ ntpd/ntp_restrict.c@1.17.1.4 +12 -3
+ null deref: fix another case of incomplete list handling (Coverity NetBSD Scan 8: CID 986)
+
+ChangeSet@1.1251.83.1, 2006-03-21 05:41:41-05:00, stenn@deacon.udel.edu
+ [Bug 584] Fix potential buffer overrun
+
+ ntpd/refclock_chu.c@1.36 +2 -2
+ [Bug 584] Fix potential buffer overrun
+
+ChangeSet@1.1251.82.1, 2006-03-20 05:56:32+00:00, kardel@pogo.udel.edu
+ refclock_oncore.c, ntp_restrict.c:
+ standardize pointer checks
+
+ ntpd/ntp_restrict.c@1.17.2.1 +3 -3
+ standardize pointer checks
+
+ ntpd/refclock_oncore.c@1.59 +2 -2
+ standardize pointer checks
+
+ChangeSet@1.1251.80.16, 2006-03-19 22:14:48-05:00, mayer@pogo.udel.edu
+ Additional fixes for Coverity items
+
+ ntpd/ntp_restrict.c@1.17.1.2 +2 -2
+ Additional fixes for Coverity items
+
+ ntpdc/ntpdc.c@1.40.2.5 +4 -1
+ Additional fixes for Coverity items
+
+ChangeSet@1.1251.80.15, 2006-03-19 07:23:01+00:00, kardel@pogo.udel.edu
+ refclock_datum.c:
+ error handling: check success of open(2) - bail out early (Coverity CID 1282 NetBSD Scan 5)
+
+ ntpd/refclock_datum.c@1.9 +13 -5
+ error handling: check success of open(2) - bail out early (Coverity CID 1282 NetBSD Scan 5)
+
+ChangeSet@1.1251.80.14, 2006-03-19 07:04:21+00:00, kardel@pogo.udel.edu
+ ntp_restrict.c:
+ null deref: complete linked list handling beginng condition (Coverity CID 986 NetBSD Scan 5)
+
+ ntpd/ntp_restrict.c@1.17.1.1 +12 -3
+ null deref: complete linked list handling beginng condition (Coverity CID 986 NetBSD Scan 5)
+
+ChangeSet@1.1251.80.13, 2006-03-18 15:25:00+00:00, kardel@pogo.udel.edu
+ ntpdc.c:
+ mem leak: unreachable code prevented freeing of allocated memory
+ (Coverity CID 612 NetBSD Scan 5)
+
+ ntpdc/ntpdc.c@1.40.2.4 +1 -2
+ mem leak: unreachable code prevented freeing of allocated memory
+ (Coverity CID 612 NetBSD Scan 5)
+
+ChangeSet@1.1251.80.12, 2006-03-18 14:33:59+00:00, kardel@pogo.udel.edu
+ refclock_oncore.c:
+ null deref: avoid 0 deref (Coverity CID 987 NetBSD Scan 5)
+
+ ntpd/refclock_oncore.c@1.58 +1 -1
+ null deref: avoid 0 deref (Coverity CID 987 NetBSD Scan 5)
+
+ChangeSet@1.1251.80.11, 2006-03-18 14:20:27+00:00, kardel@pogo.udel.edu
+ refclock_arc.c:
+ buffer bounds: buffer full condition wrong for bounds check (Coverity CID 1508 NetBSD Scan 5)
+
+ ntpd/refclock_arc.c@1.18 +1 -1
+ buffer bounds: buffer full condition wrong for bounds check (Coverity CID 1508 NetBSD Scan 5)
+
+ChangeSet@1.1251.80.10, 2006-03-18 14:09:32+00:00, kardel@pogo.udel.edu
+ refclock_leitch.c:
+ buffer bounds: correct > - >= error for bounds check (Coverity CID 1511 NetBSD Scan 5)
+
+ ntpd/refclock_leitch.c@1.7 +1 -1
+ buffer bounds: correct > - >= error for bounds check (Coverity CID 1511 NetBSD Scan 5)
+
+ChangeSet@1.1251.80.9, 2006-03-18 14:08:59+00:00, kardel@pogo.udel.edu
+ refclock_oncore.c:
+ mem leakage: free old malloced buffer on errors (Coverity CID 2056 NetBSD Scan 5)
+
+ ntpd/refclock_oncore.c@1.57 +6 -0
+ mem leakage: free old malloced buffer on errors (Coverity CID 2056 NetBSD Scan 5)
+
+ChangeSet@1.1251.80.8, 2006-03-18 09:24:46+00:00, kardel@pogo.udel.edu
+ ntp_crypto.c:
+ resource leak (fd/mem): fclose() streams on error (Coverity NetBSD scan CID 2055)
+
+ ntpd/ntp_crypto.c@1.98.1.12 +6 -0
+ resource leak (fd/mem): fclose() streams on error (Coverity NetBSD scan CID 2055)
+
+ChangeSet@1.1251.80.7, 2006-03-18 08:53:22+00:00, kardel@pogo.udel.edu
+ ntp_crypto.c:
+ close stream when error occur (Coverity NetBSD Scan CID 2054)
+
+ ntpd/ntp_crypto.c@1.98.1.11 +3 -0
+ close stream when error occur (Coverity NetBSD Scan CID 2054)
+
+ChangeSet@1.1251.80.6, 2006-03-18 08:01:26+00:00, kardel@pogo.udel.edu
+ ntptime.c:
+ resolve potential but not occurring 1-pointer deref (Coverity NetBSD scan, CID 808)
+
+ util/ntptime.c@1.19 +1 -1
+ resolve potential but not occurring 1-pointer deref (Coverity NetBSD scan, CID 808)
+
+ChangeSet@1.1251.80.5, 2006-03-18 07:55:03+00:00, kardel@pogo.udel.edu
+ ntptime.c:
+ resolve bounds issue (Coverity CID 1466, NetBSD scan)
+
+ util/ntptime.c@1.18 +1 -1
+ resolve bounds issue (Coverity CID 1466, NetBSD scan)
+
+ChangeSet@1.1251.80.4, 2006-03-18 01:11:42+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ coverity fixes found in NetBSD coverity scan
+
+ ntpd/refclock_parse.c@1.35.1.6 +14 -7
+ coverity fixes found in NetBSD coverity scan
+
+ChangeSet@1.1251.81.1, 2006-03-17 04:22:39-05:00, stenn@deacon.udel.edu
+ Set c_iflag=0 for RAW mode
+
+ ntpd/ntp_refclock.c@1.75 +2 -0
+ Set c_iflag=0 for RAW mode
+
+ChangeSet@1.1251.80.2, 2006-03-16 17:55:20-05:00, mayer@pogo.udel.edu
+ [Bug 479] Fix Memory Leak
+
+ ntpd/ntp_io.c@1.187.1.8 +14 -12
+ Fix Bug #479 Memory Leak
+
+ChangeSet@1.1251.80.1, 2006-03-15 02:29:27-05:00, stenn@deacon.udel.edu
+ [Bug 472] configurable driftfile write frequency
+
+ html/miscopt.html@1.34 +15 -3
+ [Bug 472] configurable driftfile write frequency
+
+ include/ntpd.h@1.82.4.5 +3 -1
+ [Bug 472] configurable driftfile write frequency
+
+ ntpd/ntp_config.c@1.129.6.1 +10 -0
+ [Bug 472] configurable driftfile write frequency
+
+ ntpd/ntp_timer.c@1.28.1.1 +7 -6
+ [Bug 472] configurable driftfile write frequency
+
+ ntpd/ntp_util.c@1.36.2.1 +10 -1
+ [Bug 472] configurable driftfile write frequency
+
+ ntpd/ntpd.c@1.61.1.19 +1 -0
+ [Bug 472] configurable driftfile write frequency
+
+ChangeSet@1.1251.72.34, 2006-03-15 06:37:26+00:00, kardel@pogo.udel.edu
+ ntp_peer.c:
+ speling fix
+ copyright.html:
+ obfuscate eMail address
+ document dynamic interface handling
+
+ html/copyright.html@1.34 +2 -2
+ obfuscate eMail address
+ document dynamic interface handling
+
+ ntpd/ntp_peer.c@1.94 +1 -1
+ speling fix
+
+ChangeSet@1.1251.72.33, 2006-03-14 23:09:12+00:00, kardel@pogo.udel.edu
+ ntp_proto.c:
+ peer.{first,last} gone
+
+ ntpd/ntp_proto.c@1.244 +0 -3
+ peer.{first,last} gone
+
+ChangeSet@1.1333, 2006-03-14 00:51:12-05:00, stenn@pogo.udel.edu
+ cleanup
+
+ Makefile.am@1.60 +1 -1
+ cleanup
+
+ChangeSet@1.1251.79.2, 2006-03-05 16:34:07-05:00, stenn@deacon.udel.edu
+ [Bug 553] QNX does not want adjtime.h
+
+ ntpdate/ntpdate.c@1.57 +0 -4
+ [Bug 553] QNX does not want adjtime.h
+
+ChangeSet@1.1251.79.1, 2006-03-05 16:26:53-05:00, stenn@deacon.udel.edu
+ [Bug 576] Use __adjtimex if we have it and not ntp_adjtime
+
+ include/ntp_machine.h@1.22 +4 -0
+ [Bug 576] Use __adjtimex if we have it and not ntp_adjtime
+
+ChangeSet@1.1251.72.30, 2006-03-02 15:03:35-05:00, clemens@pogo.udel.edu
+ Clean up on exit.
+
+ ntpd/refclock_oncore.c@1.56 +6 -1
+ Clean up on exit.
+
+ChangeSet@1.1251.72.29, 2006-03-01 04:20:05-05:00, stenn@deacon.udel.edu
+ AUTOMAKE_OPTIONS: We require automake 1.8 or later.
+
+ Makefile.am@1.48.1.2 +1 -1
+ AUTOMAKE_OPTIONS: We require automake 1.8 or later.
+
+ChangeSet@1.1251.72.28, 2006-02-28 23:43:36-05:00, stenn@deacon.udel.edu
+ RC1 for 4.2.1
+ TAG: ntp-dev
+ TAG: NTP_4_2_0B_RC1
+
+ version.m4@1.3.1.1 +1 -1
+ RC1 for 4.2.1
+
+ChangeSet@1.1251.78.1, 2006-02-28 09:38:25-05:00, hilbrecht@pogo.udel.edu
+ refclock_neoclock4x.c:
+ update driver to version 1.15
+ fix bug #499 and #574
+
+ BitKeeper/etc/logging_ok@1.57.5.1 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ ntpd/refclock_neoclock4x.c@1.13.1.1 +16 -30
+ update driver to version 1.15
+ fix bug #499 and #574
+
+ChangeSet@1.1251.77.3, 2006-02-25 19:18:31-05:00, clemens@pogo.udel.edu
+ The following 5 changes were made.
+ (1) Fixes for warnings from the curreng gcc compiler.
+ (2) Fix for a possible segfault if restarting with a damaged shmem file.
+ (3) Change all possible fprintf's to record_clock_stats, to get all
+ output in the same place.
+ (4) [Bug 541] Apply a patch by Russell J. Yount <rjy@cmu.edu> for new (and
+ possibly old) M12+T: UTC not correct immediately after a new Almanac
+ read.
+ (5) Apply patch for new PPS implementation by Rodolfo Giometti
+ <giometti@linux.it>. The code can now useither the old
+ Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> implementation, or
+ the new one, depending on the timepps.h seen.
+
+ BitKeeper/etc/logging_ok@1.57.4.1 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ ntpd/refclock_oncore.c@1.55 +214 -99
+ The following 5 changes were made.
+ (1) Fixes for warnings from the curreng gcc compiler.
+ (2) Fix for a possible segfault if restarting with a damaged shmem file.
+ (3) Change all possible fprintf's to record_clock_stats, to get all
+ output in the same place.
+ (4) [Bug 541] Apply a patch by Russell J. Yount <rjy@cmu.edu> for new (and
+ possibly old) M12+T: UTC not correct immediately after a new Almanac
+ read.
+ (5) Apply patch for new PPS implementation by Rodolfo Giometti
+ <giometti@linux.it>. The code can now useither the old
+ Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> implementation, or
+ the new one, depending on the timepps.h seen.
+
+ChangeSet@1.1178.5.9, 2006-02-24 04:24:12-05:00, stenn@deacon.udel.edu
+ mort is gone, replaced by macabre
+
+ br-flock@1.4.1.2 +1 -1
+ mort is gone, replaced by macabre
+
+ChangeSet@1.1251.77.1, 2006-02-24 04:20:07-05:00, stenn@deacon.udel.edu
+ Let there be fuzz. Make sure sys_precision is visible and present.
+
+ libntp/systime.c@1.38 +9 -7
+ Let there be fuzz. Make sure sys_precision is visible and present.
+
+ ntpdate/ntpdate.c@1.56 +5 -0
+ Let there be fuzz. Make sure sys_precision is visible and present.
+
+ ntpdc/ntpdc.c@1.40.3.1 +5 -0
+ Let there be fuzz. Make sure sys_precision is visible and present.
+
+ ntpq/ntpq.c@1.55.1.5 +5 -0
+ Let there be fuzz. Make sure sys_precision is visible and present.
+
+ChangeSet@1.1251.72.25, 2006-02-24 02:10:29+00:00, rayvt@pogo.udel.edu
+ ntcdc options update
+
+ ntpd/ntp_request.c@1.58.1.2 +18 -3
+ ntcdc options update
+
+ ntpdc/ntpdc.h@1.6 +2 -1
+ ntcdc options update
+
+ ntpdc/ntpdc_ops.c@1.38.1.2 +132 -87
+ ntcdc options update
+
+ChangeSet@1.1251.72.24, 2006-02-24 02:08:52+00:00, rayvt@pogo.udel.edu
+ ntpdc options update
+
+ BitKeeper/etc/logging_ok@1.57.3.1 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ html/ntpdc.html@1.20.1.3 +42 -11
+ ntcdc options update
+
+ include/ntp.h@1.120.1.7 +1 -0
+ ntcdc options update
+
+ include/ntp_request.h@1.23.1.1 +1 -0
+ ntcdc options update
+
+ ntpd/ntp_loopfilter.c@1.123 +18 -0
+ ntcdc options update
+
+ ntpd/ntp_peer.c@1.84.1.2 +6 -1
+ ntcdc options update
+
+ ntpdc/ntpdc.c@1.40.2.2 +8 -4
+ ntcdc options update
+
+ChangeSet@1.1251.72.23, 2006-02-22 20:01:03-05:00, stenn@deacon.udel.edu
+ Fix a typo.
+
+ libntp/systime.c@1.37 +1 -1
+ Fix a typo.
+
+ChangeSet@1.1251.72.22, 2006-02-22 19:58:12-05:00, stenn@deacon.udel.edu
+ Copyright updates from Dave Mills
+
+ html/copyright.html@1.33 +2 -2
+ Updates from Dave Mills
+
+ChangeSet@1.1251.72.21, 2006-02-17 23:50:33-05:00, stenn@deacon.udel.edu
+ Only fuzz the time after we know sys_precision (gettimeofday only)
+
+ libntp/systime.c@1.36 +10 -2
+ Only fuzz the time after we know sys_precision (gettimeofday only)
+
+ChangeSet@1.1251.72.20, 2006-02-15 23:21:06-05:00, mayer@pogo.udel.edu
+ Fix next references for recvbuf
+
+ ntpd/ntpsim.c@1.11.1.1 +4 -10
+ Fix next references for recvbuf
+
+ChangeSet@1.1251.72.18, 2006-01-31 21:40:26-05:00, stenn@deacon.udel.edu
+ Added the new RFC4330 spec (SNTP)
+
+ sntp/RFC4330.TXT@1.1 +1515 -0
+
+ sntp/RFC4330.TXT@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/RFC4330.TXT
+
+ChangeSet@1.1178.5.8, 2006-01-26 22:18:41-05:00, stenn@deacon.udel.edu
+ Make --enable-simulator part of the flock build
+
+ br-flock@1.4.1.1 +1 -1
+ Make --enable-simulator part of the flock build
+
+ flock-build@1.30.2.1 +7 -7
+ Make --enable-simulator part of the flock build
+
+ChangeSet@1.1251.72.16, 2006-01-26 06:07:05+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ output errno on PPS setup failure
+
+ ntpd/refclock_parse.c@1.35.1.5 +1 -1
+ output errno on PPS setup failure
+
+ChangeSet@1.1251.72.15, 2006-01-23 01:55:53-05:00, stenn@deacon.udel.edu
+ configure.ac:
+ Cleanup from Ralf Wildenhues
+ authopt.html:
+ typo
+
+ configure.ac@1.359.1.27 +4 -0
+ Cleanup from Ralf Wildenhues
+
+ html/authopt.html@1.39 +2 -2
+ typo
+
+ChangeSet@1.1328, 2006-01-23 01:20:16-05:00, stenn@pogo.udel.edu
+ Cleanup from Ralf Wildenhues
+
+ include/ntp_stdlib.h@1.24 +1 -1
+ const cleanup from Ralf Wildenhues
+
+ include/ntpd.h@1.90 +2 -2
+ const cleanup from Ralf Wildenhues
+
+ libntp/ntp_rfc2553.c@1.28 +1 -1
+ lint cleanup from Ralf Wildenhues
+
+ ntpd/cmd_args.c@1.37 +15 -15
+ const and lint cleanup from Ralf Wildenhues
+
+ ntpd/ntp_control.c@1.79.1.8 +5 -1
+ const and lint cleanup from Ralf Wildenhues
+
+ ntpd/ntp_util.c@1.36.1.3 +3 -3
+ const and lint cleanup from Ralf Wildenhues
+
+ ntpd/ntpd.c@1.74 +8 -8
+ const and lint cleanup from Ralf Wildenhues
+
+ ntpd/refclock_acts.c@1.26 +1 -1
+ const and lint cleanup from Ralf Wildenhues
+
+ ntpd/refclock_neoclock4x.c@1.14 +1 -1
+ const and lint cleanup from Ralf Wildenhues
+
+ ntpdc/ntpdc.c@1.46 +2 -2
+ const cleanup from Ralf Wildenhues
+
+ ntpq/ntpq.c@1.61 +2 -2
+ const cleanup from Ralf Wildenhues
+
+ util/ntp-keygen.c@1.37 +1 -1
+ lint cleanup from Ralf Wildenhues
+
+ChangeSet@1.1251.72.13, 2006-01-23 00:47:20-05:00, stenn@deacon.udel.edu
+ Fix from Dave Mills: etemp gets min(), not max()
+
+ ntpd/ntp_loopfilter.c@1.122 +1 -1
+ Fix from Dave Mills: etemp gets min(), not max()
+
+ChangeSet@1.1251.72.12, 2006-01-23 00:09:50-05:00, stenn@pogo.udel.edu
+ Recover eaten patches
+
+ ntpd/ntpd.c@1.61.1.18 +21 -0
+ Recover eaten patches
+
+ChangeSet@1.1251.74.11, 2006-01-22 15:58:25+00:00, kardel@pogo.udel.edu
+ clk_rawdcf.c:
+ update version information
+
+ libparse/clk_rawdcf.c@1.13 +6 -3
+ update version information
+
+ChangeSet@1.1251.74.10, 2006-01-22 15:49:38+00:00, kardel@pogo.udel.edu
+ clk_rawdcf.c:
+ generate reasonable time code output on invalid input
+
+ libparse/clk_rawdcf.c@1.12 +2 -2
+ generate reasonable time code output on invalid input
+
+ChangeSet@1.1251.74.9, 2006-01-14 17:42:21-05:00, stenn@deacon.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.59 +7 -4
+ Fixes from Dave Mills
+
+ChangeSet@1.1325, 2006-01-12 18:52:24-05:00, stenn@pogo.udel.edu
+ get libopts.m4 from libopts/m4
+
+ Makefile.am@1.58 +1 -1
+ get libopts.m4 from libopts/m4
+
+ sntp/Makefile.am@1.12 +1 -1
+ get libopts.m4 from libopts/m4
+
+ChangeSet@1.1324, 2006-01-12 18:23:36-05:00, stenn@pogo.udel.edu
+ .del-libopts.m4~ebff9cfbfbe104c8:
+ Delete: sntp/m4/libopts.m4
+ bootstrap:
+ Leave libopts.m4 in sntp/
+ Makefile.am:
+ Get libopts.m4 from the sntp/m4 subdir
+
+ BitKeeper/deleted/.del-libopts.m4~ebff9cfbfbe104c8@1.7 +97 -88
+ Delete: sntp/m4/libopts.m4
+
+ Makefile.am@1.57 +1 -1
+ Get libopts.m4 from the sntp/m4 subdir
+
+ bootstrap@1.8 +0 -1
+ Leave libopts.m4 in sntp/
+
+ChangeSet@1.1323, 2006-01-12 06:00:55-05:00, stenn@pogo.udel.edu
+ libopts.m4 is in m4/ now
+
+ bootstrap@1.7 +1 -1
+ libopts.m4 is in m4/ now
+
+ChangeSet@1.1319.1.1, 2006-01-12 04:36:58-05:00, stenn@pogo.udel.edu
+ bootstrap wiggles
+
+ bootstrap@1.4.1.1 +3 -1
+ autoreconf in sntp first, and avoid -f
+
+ChangeSet@1.1251.74.8, 2006-01-10 00:43:36-05:00, stenn@deacon.udel.edu
+ doc changes from Dave Mills
+
+ html/authopt.html@1.38 +4 -4
+ doc changes from Dave Mills
+
+ html/copyright.html@1.32 +1 -1
+ doc changes from Dave Mills
+
+ html/miscopt.html@1.33 +2 -3
+ doc changes from Dave Mills
+
+ChangeSet@1.1251.74.7, 2006-01-10 00:34:58-05:00, stenn@deacon.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.121 +72 -48
+ Fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.16 +0 -1
+ Fixes from Dave Mills
+
+ChangeSet@1.1251.76.3, 2006-01-09 17:55:37-05:00, mayer@pogo.udel.edu
+ Set multicast interface to ignore packets from self
+
+ ntpd/ntp_io.c@1.187.1.7 +24 -0
+ Set multicast interface to ignore packets from self
+
+ChangeSet@1.1251.76.1, 2006-01-06 16:49:43-05:00, mayer@pogo.udel.edu
+ Fix to have completion ports behave properly
+
+ ports/winnt/include/ntp_iocompletionport.h@1.12 +0 -19
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.20 +150 -115
+
+ChangeSet@1.1320, 2005-12-30 16:09:52-08:00, bkorb@bach.veritas.com
+ Warning patrol, mostly. Also ensure that $(top_srcdir)/version is built
+ in those subdirectories that need it.
+
+ bootstrap@1.5 +1 -1
+ Correct the directory where the libopts.m4 file is found
+
+ include/debug-opt.def@1.2 +8 -0
+ The -D option requires "atoi(3C)". Ensure it is declared. Don't know if
+ ``#ifdef __windows'' is the right guard. Someone needs to correct it....
+
+ ntpd/Makefile.am@1.46 +3 -0
+ The various subdirectories seem to need a rule for making ../version.
+ Provide it by invoking ``$(MAKE) version'' in that directory.
+
+ ntpd/cmd_args.c@1.36 +1 -0
+ Declare global variable
+
+ ntpd/ntpd.c@1.72 +11 -11
+ Correct "const char" usage.
+ Also, disambiguate local "ntp_optarg" from a global
+
+ ntpdate/Makefile.am@1.14 +3 -0
+ The various subdirectories seem to need a rule for making ../version.
+ Provide it by invoking ``$(MAKE) version'' in that directory.
+
+ ntpdc/Makefile.am@1.28 +3 -0
+ The various subdirectories seem to need a rule for making ../version.
+ Provide it by invoking ``$(MAKE) version'' in that directory.
+
+ ntpq/Makefile.am@1.20 +3 -0
+ The various subdirectories seem to need a rule for making ../version.
+ Provide it by invoking ``$(MAKE) version'' in that directory.
+
+ChangeSet@1.1251.74.6, 2005-12-30 14:50:03-05:00, stenn@pogo.udel.edu
+ [Bug 545] Provide needed headers to test for sys/timepps.h
+
+ configure.ac@1.359.1.26 +16 -2
+ [Bug 545] Provide needed headers to test for sys/timepps.h
+
+ChangeSet@1.1319, 2005-12-30 14:07:38-05:00, stenn@pogo.udel.edu
+ verbose bootstrap, lose m4/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~9f04cbceeedbd0cf@1.10 +97 -88
+ Delete: m4/libopts.m4
+
+ bootstrap@1.4 +3 -2
+ be verbose
+
+ChangeSet@1.1318, 2005-12-29 01:38:14-05:00, stenn@pogo.udel.edu
+ wiggles
+
+ BitKeeper/deleted/.del-version.m4~4ef47e5fd0c38ddb@1.4 +0 -0
+ Delete: version.m4
+
+ Makefile.am@1.56 +16 -1
+ wiggles
+
+ bootstrap@1.3 +2 -20
+ wiggles
+
+ packageinfo.sh@1.1 +1 -0
+
+ packageinfo.sh@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/packageinfo.sh
+
+ChangeSet@1.1251.74.5, 2005-12-27 19:50:58-05:00, stenn@deacon.udel.edu
+ [Bug 543] Leap second warning in ONCORE driver, from Luis Batanero Guerrero
+
+ ntpd/refclock_oncore.c@1.54 +12 -12
+ [Bug 543] Leap second warning in ONCORE driver, from Luis Batanero Guerrero
+
+ChangeSet@1.1251.74.4, 2005-12-25 00:24:24-05:00, stenn@pogo.udel.edu
+ [Bug 536] more filegen cleanup
+
+ include/ntp_filegen.h@1.3 +1 -1
+ [Bug 536] more filegen cleanup
+
+ ntpd/ntp_filegen.c@1.11 +24 -1
+ [Bug 536] more filegen cleanup
+
+ ntpd/ntp_util.c@1.36.1.2 +6 -30
+ [Bug 536] more filegen cleanup
+
+ChangeSet@1.1316, 2005-12-23 13:56:31-08:00, bkorb@bach.veritas.com
+ Extract the debug options into a separate file included by all the
+ option files. Place the file in the "include" directory. Modify
+ the makefiles so autogen adds that directory to its search list.
+
+ BitKeeper/deleted/.del-COPYING.lgpl~a697cd34fe132e8a@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd~bfae58672feaeb37@1.2 +0 -0
+ Delete: sntp/libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc~5e2e772dad68df1a@1.3 +0 -0
+ Delete: sntp/libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~6d6a227df4a598ae@1.3 +0 -0
+ Delete: sntp/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README~e3d36052eb50258b@1.3 +0 -0
+ Delete: sntp/libopts/README
+
+ BitKeeper/deleted/.del-autoopts.c~85fbb1bcfe1504ac@1.4 +0 -0
+ Delete: sntp/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~4c10cd8f919f6342@1.5 +0 -0
+ Delete: sntp/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~2a088bf49e080afe@1.3 +0 -0
+ Delete: sntp/libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h~1cf561c3e113254d@1.7 +0 -0
+ Delete: sntp/libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-configfile.c~bd820799c8dfa50e@1.2 +0 -0
+ Delete: sntp/libopts/configfile.c
+
+ BitKeeper/deleted/.del-cook.c~3fdbc751394ee14d@1.3 +0 -0
+ Delete: sntp/libopts/cook.c
+
+ BitKeeper/deleted/.del-enumeration.c~e0416dead0d88f06@1.3 +0 -0
+ Delete: sntp/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~abe99889ca57817e@1.3 +0 -0
+ Delete: sntp/libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c~9d621c66b4bd754@1.5 +0 -0
+ Delete: sntp/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~f5d1af5bffb3ba@1.5 +0 -0
+ Delete: sntp/libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c~f2125365b6c69db9@1.4 +0 -0
+ Delete: sntp/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~11b56b285499781a@1.5 +0 -0
+ Delete: sntp/libopts/libopts.m4
+
+ BitKeeper/deleted/.del-load.c~c55b985b7f4e79cc@1.3 +0 -0
+ Delete: sntp/libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c~4e0d2f7e41c164dc@1.3 +0 -0
+ Delete: sntp/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-nested.c~2ab62bdc3ff6240d@1.3 +0 -0
+ Delete: sntp/libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c~6f61173230495e21@1.3 +0 -0
+ Delete: sntp/libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~4ef9db18f2de6a59@1.4 +0 -0
+ Delete: sntp/libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c~4d249636f5082615@1.2 +0 -0
+ Delete: sntp/libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~7d50638aa3ccd579@1.3 +0 -0
+ Delete: sntp/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h~93d0676a173a4b6e@1.5 +0 -0
+ Delete: sntp/libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c~8fdade676545e0ad@1.3 +0 -0
+ Delete: sntp/libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c~2d36a183c65e46b2@1.3 +0 -0
+ Delete: sntp/libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~1e35dba6263bdb0@1.3 +0 -0
+ Delete: sntp/libopts/save.c
+
+ BitKeeper/deleted/.del-snprintf.c~34bb5dbb6f424fa4@1.2 +0 -0
+ Delete: sntp/libopts/compat/snprintf.c
+
+ BitKeeper/deleted/.del-sort.c~f2dbbab8aecd13de@1.3 +0 -0
+ Delete: sntp/libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~66471a39d92bf493@1.3 +0 -0
+ Delete: sntp/libopts/stack.c
+
+ BitKeeper/deleted/.del-strdup.c~1ff3ed47354b9cab@1.2 +0 -0
+ Delete: sntp/libopts/compat/strdup.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~7d82b266e654e41f@1.3 +0 -0
+ Delete: sntp/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c~75102303341e937b@1.4 +0 -0
+ Delete: sntp/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-tokenize.c~f26cbe6a73d13566@1.2 +0 -0
+ Delete: sntp/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h~e22bfd18a5765c49@1.5 +0 -0
+ Delete: sntp/libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~ce3b6af7dd1009cc@1.3 +0 -0
+ Delete: sntp/libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c~bf32cf48f59dabf1@1.3 +0 -0
+ Delete: sntp/libopts/version.c
+
+ BitKeeper/etc/logging_ok@1.57.2.1 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ Makefile.am@1.55 +1 -16
+ Move some commands out into the bootstrap script
+
+ bootstrap@1.2 +12 -0
+ Add in the commands that were part of Makefile.am
+
+ bootstrap@1.1 +61 -0
+
+ bootstrap@1.0 +0 -0
+ BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/bootstrap
+
+ include/debug-opt.def@1.1 +24 -0
+
+ include/debug-opt.def@1.0 +0 -0
+ BitKeeper file /home/bkorb/tools/ntp/ntp-dev-ag/include/debug-opt.def
+
+ ntpd/Makefile.am@1.45 +7 -8
+ Option def files must include from the ntp/include directory.
+
+ ntpd/ntpdbase-opts.def@1.2 +1 -24
+ Move debug options to common file.
+
+ ntpdc/Makefile.am@1.27 +4 -5
+ Option def files must include from the ntp/include directory.
+
+ ntpdc/ntpdc-opts.def@1.6 +1 -24
+ Move debug options to a common file.
+
+ ntpq/Makefile.am@1.19 +4 -5
+ Option def files must include from the ntp/include directory.
+
+ sntp/Makefile.am@1.11 +4 -4
+ Option def files must include from the ntp/include directory.
+
+ util/Makefile.am@1.29 +4 -4
+ When building option source, be sure to look in the include file for
+ the debug option file.
+
+ util/ntp-keygen-opts.def@1.2 +3 -27
+ Move debug options to a common file.
+
+ util/ntp-keygen.c@1.36 +8 -39
+ Remove some confusing #ifdef's and replace "iffsw" with "HAVE_OPT(ID_KEY)".
+
+ChangeSet@1.1251.71.10, 2005-12-20 23:14:56-05:00, stenn@pogo.udel.edu
+ bail early from get_full_recv_buffer() if there is nothing to do.
+
+ libntp/recvbuff.c@1.18 +3 -0
+ bail early from get_full_recv_buffer() if there is nothing to do.
+
+ChangeSet@1.1251.72.5, 2005-12-20 22:09:09-05:00, mayer@pogo.udel.edu
+ Fix recvbuff code with missing refetch when needing more buffers
+
+ libntp/recvbuff.c@1.13.1.2 +10 -5
+ Fix recvbuff code with missing refetch when needing more buffers
+
+ChangeSet@1.1178.5.7, 2005-12-20 22:05:18-05:00, stenn@deacon.udel.edu
+ Send email to ntp.isc.org now
+
+ BitKeeper/triggers/changelog@1.3 +1 -1
+ Send email to ntp.isc.org now
+
+ BitKeeper/triggers/commitlogs@1.5 +2 -1
+ Send email to ntp.isc.org now
+
+ BitKeeper/triggers/delta-changelog@1.7 +2 -2
+ Send email to ntp.isc.org now
+
+ BitKeeper/triggers/notify@1.3 +2 -1
+ Send email to ntp.isc.org now
+
+ BitKeeper/triggers/paranoid@1.3 +1 -1
+ Send email to ntp.isc.org now
+
+ BitKeeper/triggers/send@1.5 +1 -1
+ Send email to ntp.isc.org now
+
+ChangeSet@1.1251.74.2, 2005-12-20 21:46:45-05:00, stenn@pogo.udel.edu
+ [Bug 536] Clean up the filegen initialization
+
+ ntpd/ntp_filegen.c@1.10 +2 -1
+ reformat comment
+
+ ntpd/ntp_util.c@1.36.1.1 +36 -71
+ [Bug 536] Clean up the filegen initialization
+
+ChangeSet@1.1251.74.1, 2005-12-20 18:30:52-05:00, stenn@pogo.udel.edu
+ Tolerate leap second notifications in sntp
+
+ sntp/main.c@1.6 +4 -3
+ Tolerate leap second notifications in sntp
+
+ChangeSet@1.1251.73.4, 2005-12-20 09:26:06-05:00, mayer@pogo.udel.edu
+ Update the way packets are processed
+
+ ntpd/ntpd.c@1.61.4.1 +8 -5
+ Update the way packets are processed
+
+ChangeSet@1.1251.73.3, 2005-12-20 09:25:05-05:00, mayer@pogo.udel.edu
+ Bug #527 - Fix buffer problems when under load
+
+ ports/winnt/include/ntp_iocompletionport.h@1.11 +1 -6
+ Bug #527 - Fix buffer problems when under load
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.19 +150 -83
+ Bug #527 - Fix buffer problems when under load
+
+ChangeSet@1.1251.72.3, 2005-12-19 18:12:59-05:00, stenn@deacon.udel.edu
+ leap change notification cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.120 +0 -8
+ leap change notification cleanup from Dave Mills
+
+ChangeSet@1.1315, 2005-12-16 03:37:46-05:00, stenn@pogo.udel.edu
+ Use AutoOpts
+
+ util/ntp-keygen.c@1.35 +46 -172
+ Use AutoOpts
+
+ChangeSet@1.1314, 2005-12-15 06:34:59-05:00, stenn@pogo.udel.edu
+ AutoGen stuff
+
+ m4/libopts.m4@1.9 +15 -17
+ AutoGen stuff
+
+ ntpd/Makefile.am@1.44 +10 -10
+ AutoGen stuff
+
+ ntpdc/Makefile.am@1.26 +5 -5
+ AutoGen stuff
+
+ ntpq/Makefile.am@1.18 +4 -4
+ AutoGen stuff
+
+ sntp/Makefile.am@1.10 +4 -4
+ AutoGen stuff
+
+ sntp/libopts/compat/compat.h@1.6 +1 -1
+ AutoGen stuff
+
+ sntp/libopts/compat/snprintf.c@1.1 +36 -0
+
+ sntp/libopts/compat/snprintf.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/snprintf.c
+
+ sntp/libopts/compat/strdup.c@1.1 +19 -0
+
+ sntp/libopts/compat/strdup.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/strdup.c
+
+ sntp/m4/libopts.m4@1.6 +15 -17
+ AutoGen stuff
+
+ChangeSet@1.1312, 2005-12-15 06:27:57-05:00, stenn@pogo.udel.edu
+ ntp-keygen conversion from Bruce Korb
+
+ BitKeeper/etc/ignore@1.45 +1 -0
+ added util/ntp-keygen.1
+
+ util/Makefile.am@1.26.1.1 +21 -4
+ ntp-keygen conversion from Bruce Korb
+
+ util/ntp-keygen-opts.def@1.1 +263 -0
+
+ util/ntp-keygen-opts.def@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/util/ntp-keygen-opts.def
+
+ChangeSet@1.1251.71.9, 2005-12-13 05:22:27-05:00, stenn@pogo.udel.edu
+ more full_recvbuf cleanup
+
+ libntp/recvbuff.c@1.17 +2 -0
+ more full_recvbuf cleanup
+
+ ntpd/ntpd.c@1.61.1.16 +2 -3
+ more full_recvbuf cleanup
+
+ChangeSet@1.1251.71.8, 2005-12-13 04:01:10-05:00, stenn@pogo.udel.edu
+ Only call get_full_recv_buffer() if we have something
+
+ ntpd/ntpd.c@1.61.1.15 +12 -8
+ Only call get_full_recv_buffer() if we have something
+
+ChangeSet@1.1251.73.2, 2005-12-12 23:35:01-05:00, mayer@pogo.udel.edu
+ Fixes for buffer loss and DOS attacks
+
+ ports/winnt/include/ntp_iocompletionport.h@1.10 +1 -1
+ Fixes for buffer loss and DOS attacks
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.18 +5 -1
+ Fixes for buffer loss and DOS attacks
+
+ChangeSet@1.1251.73.1, 2005-12-12 23:32:47-05:00, mayer@pogo.udel.edu
+ Make recvbuf unlimited and add check for full buffers
+
+ include/recvbuff.h@1.11 +6 -0
+ Make recvbuf unlimited and add check for full buffers
+
+ libntp/recvbuff.c@1.13.1.1 +24 -15
+ Make recvbuf unlimited and add check for full buffers
+
+ChangeSet@1.1251.72.2, 2005-12-11 18:54:45-05:00, stenn@deacon.udel.edu
+ [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle)
+
+ html/ntpdc.html@1.20.1.2 +27 -5
+ [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle)
+
+ ntpd/ntp_request.c@1.58.1.1 +23 -5
+ [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle)
+
+ ntpdc/ntpdc.c@1.40.2.1 +15 -0
+ [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle)
+
+ ntpdc/ntpdc.h@1.5 +2 -2
+ [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle)
+
+ ntpdc/ntpdc_ops.c@1.38.1.1 +4 -2
+ [Bug 531]: ntpdc limitations on addserver & addpeer (Ray Van Tassle)
+
+ChangeSet@1.1251.71.6, 2005-12-11 17:16:25-05:00, stenn@maccarony.ntp.org
+ diagnostic cleanup
+
+ libntp/recvbuff.c@1.15 +2 -3
+ diagnostic cleanup
+
+ChangeSet@1.1251.71.5, 2005-12-11 17:04:21-05:00, stenn@maccarony.ntp.org
+ recvbuf typo fix and diagnostics
+
+ BitKeeper/etc/logging_ok@1.55.1.2 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ libntp/recvbuff.c@1.14 +10 -2
+ full_recvbuf diagnostics
+
+ ntpd/ntpd.c@1.61.1.14 +1 -1
+ Danny's typo fix for checking tot_full_recvbufs
+
+ChangeSet@1.1251.71.4, 2005-12-10 23:49:14-05:00, mayer@pogo.udel.edu
+ revbuf rewrite
+
+ libntp/recvbuff.c@1.13 +26 -11
+ revbuf rewrite
+
+ ntpd/ntp_io.c@1.187.1.6 +48 -8
+ revbuf rewrite
+
+ChangeSet@1.1251.72.1, 2005-12-07 23:23:03-05:00, stenn@deacon.udel.edu
+ cleanup from Dave Mills
+
+ ntpd/refclock_irig.c@1.22 +3 -4
+ cleanup from Dave Mills
+
+ ntpd/refclock_wwv.c@1.58 +11 -0
+ cleanup from Dave Mills
+
+ChangeSet@1.1251.1.178, 2005-12-05 18:36:24-05:00, stenn@pogo.udel.edu
+ tg cleanup
+
+ util/tg.c@1.3 +1 -0
+ tg cleanup
+
+ChangeSet@1.1251.67.29, 2005-12-05 17:37:57-05:00, stenn@deacon.udel.edu
+ Added 'tg'
+
+ util/Makefile.am@1.27 +1 -1
+ Added 'tg'
+
+ util/tg.c@1.2 +5 -4
+ cleanup
+
+ util/tg.c@1.1 +650 -0
+
+ util/tg.c@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/util/tg.c
+
+ChangeSet@1.1251.67.28, 2005-12-05 04:55:50-05:00, stenn@deacon.udel.edu
+ leap second stuff from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.119 +11 -11
+ leap second stuff from Dave Mills
+
+ ntpd/refclock_wwv.c@1.57 +8 -6
+ leap second stuff from Dave Mills
+
+ChangeSet@1.1251.67.27, 2005-11-28 20:54:35-05:00, stenn@deacon.udel.edu
+ WWV doc updates from Dave Mills
+
+ html/drivers/driver36.html@1.27 +14 -22
+ WWV doc updates from Dave Mills
+
+ChangeSet@1.1251.71.3, 2005-11-27 18:35:43-05:00, mayer@pogo.udel.edu
+ Name the timer event
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.19 +2 -2
+ Name the timer event
+
+ChangeSet@1.1251.71.2, 2005-11-27 18:33:06-05:00, mayer@pogo.udel.edu
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ include/recvbuff.h@1.10 +6 -4
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ libntp/recvbuff.c@1.12 +48 -137
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ ntpd/ntpd.c@1.61.1.13 +8 -35
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ ntpd/refclock_parse.c@1.35.1.4 +0 -1
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ ntpdate/ntpdate.c@1.55 +8 -8
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ ntpdate/ntptimeset.c@1.13 +7 -13
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ ports/winnt/include/transmitbuff.h@1.5 +7 -4
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ ports/winnt/libntp/transmitbuff.c@1.6 +56 -129
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.17 +45 -21
+ Upgrade recvbuf and transmitbuf to use ISC_LIST_* lists
+
+ChangeSet@1.1251.70.1, 2005-11-27 18:23:40-05:00, mayer@pogo.udel.edu
+ Removed setting next variable in recvbuff
+
+ ntpd/refclock_parse.c@1.35.2.1 +185 -222
+ Removed setting next variable in recvbuff
+
+ChangeSet@1.1251.67.26, 2005-11-27 17:38:02-05:00, stenn@deacon.udel.edu
+ WWV updates from Dave Mills
+
+ ntpd/refclock_wwv.c@1.56 +329 -479
+ WWV updates from Dave Mills
+
+ChangeSet@1.1251.67.25, 2005-11-15 04:55:14-05:00, stenn@deacon.udel.edu
+ more tm_mon fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.118 +3 -2
+ more tm_mon fixes from Dave Mills
+
+ChangeSet@1.1251.69.1, 2005-11-09 22:13:13+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ utilize full PPS timestamp resolution from PPS API
+
+ ntpd/refclock_parse.c@1.35.1.2 +23 -13
+ utilize full PPS timestamp resolution from PPS API
+
+ChangeSet@1.1251.67.22, 2005-11-09 00:32:54-05:00, stenn@deacon.udel.edu
+ Documentation fixes from Dave Mills
+
+ html/authopt.html@1.37 +10 -10
+ Documentation fixes from Dave Mills
+
+ html/keygen.html@1.8 +5 -5
+ Documentation fixes from Dave Mills
+
+ChangeSet@1.1251.68.1, 2005-11-08 09:15:35-05:00, mayer@pogo.udel.edu
+ bug 495 - fix for multicasting and reuseaddr got lost
+
+ ntpd/ntp_io.c@1.187.1.5 +6 -2
+ bug 495 - fix for multicasting and reuseaddr got lost
+
+ChangeSet@1.1251.67.21, 2005-11-07 22:11:10-05:00, stenn@deacon.udel.edu
+ [Bug 481] do not check $build paths for openssl if cross-compiling. Other $build/$host cleanup, too.
+
+ configure.ac@1.359.1.25 +35 -20
+ [Bug 481] do not check $build paths for openssl if cross-compiling. Other $build/$host cleanup, too.
+
+ChangeSet@1.1251.67.20, 2005-11-07 03:15:55-05:00, stenn@deacon.udel.edu
+ Fixes from Dave Mills
+
+ html/authopt.html@1.36 +3 -4
+ Fixes from Dave Mills
+
+ ntpd/ntp_config.c@1.129.4.2 +4 -4
+ Fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.79.1.7 +2 -7
+ Fixes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.10 +12 -23
+ Fixes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.74 +2 -9
+ Fixes from Dave Mills
+
+ ntpd/refclock_atom.c@1.54 +0 -5
+ Fixes from Dave Mills
+
+ ntpd/refclock_fg.c@1.10 +0 -3
+ Fixes from Dave Mills
+
+ ntpd/refclock_local.c@1.15 +1 -1
+ Fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.55 +36 -20
+ Fixes from Dave Mills
+
+ util/ntp-keygen.c@1.34 +2 -2
+ Fixes from Dave Mills
+
+ChangeSet@1.1251.67.19, 2005-11-06 17:15:15-05:00, mayer@pogo.udel.edu
+ Fixes from Heiko and Martin for ntpdate on Windows
+
+ ntpdate/ntpdate.c@1.54 +47 -6
+ Fixes from Heiko and Martin for ntpdate on Windows
+
+ChangeSet@1.1251.67.17, 2005-11-02 06:54:06-05:00, stenn@deacon.udel.edu
+ Updates from Dave Mills
+
+ html/authopt.html@1.35 +5 -5
+ Updates from Dave Mills
+
+ChangeSet@1.1251.64.4, 2005-11-01 23:40:29-05:00, mayer@pogo.udel.edu
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ include/isc/ipv6.h@1.7 +2 -2
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ include/isc/net.h@1.8 +2 -2
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ include/ntp_machine.h@1.21 +1 -0
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ include/ntp_rfc2553.h@1.28 +21 -16
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ libisc/net.c@1.7 +0 -1
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ libisc/sockaddr.c@1.5 +2 -2
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ libntp/ntp_rfc2553.c@1.27 +7 -1
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ ntpdate/ntpdate.c@1.53 +41 -18
+ Bug fixes to support IPv6 changes for non-IPv6 capable systems
+
+ChangeSet@1.1251.67.16, 2005-10-31 05:26:54-05:00, stenn@deacon.udel.edu
+ fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.117 +10 -5
+ MOD_NANO fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.54 +1 -1
+ Bump MAXFREQ from 125 to 187 PPM, from Dave Mills
+
+ChangeSet@1.1251.67.15, 2005-10-28 19:05:28-04:00, stenn@deacon.udel.edu
+ Weed-whack NANO stuff from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.116 +29 -22
+ Weed-whack NANO stuff from Dave Mills
+
+ChangeSet@1.1251.67.14, 2005-10-27 22:12:21-04:00, stenn@deacon.udel.edu
+ [Bug 521] calleapwhen.c is obsolete
+
+ BitKeeper/deleted/.del-calleapwhen.c~3e480692@1.3 +0 -0
+ Delete: libntp/calleapwhen.c
+
+ include/ntp_stdlib.h@1.23 +0 -1
+ [Bug 521] calleapwhen.c is obsolete
+
+ libntp/Makefile.am@1.37 +1 -1
+ [Bug 521] calleapwhen.c is obsolete
+
+ ports/winnt/libntp/libntp.dsp@1.27 +0 -4
+ [Bug 521] calleapwhen.c is obsolete
+
+ChangeSet@1.1251.67.13, 2005-10-27 21:59:11-04:00, stenn@deacon.udel.edu
+ More updates from Dave Mills
+
+ include/ntp.h@1.120.1.6 +0 -4
+ More updates from Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.9 +64 -23
+ More updates from Dave Mills
+
+ChangeSet@1.1251.67.12, 2005-10-27 21:38:04-04:00, stenn@deacon.udel.edu
+ [Bug 516] unprotected crypto_update() call fix from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.14 +5 -7
+ [Bug 516] unprotected crypto_update() call fix from Dave Mills
+
+ChangeSet@1.1251.67.11, 2005-10-25 20:15:47-04:00, stenn@deacon.udel.edu
+ [Bug 519] Allow dynamic SSL libraries
+
+ configure.ac@1.359.1.24 +3 -2
+ [Bug 519] Allow dynamic SSL libraries: also check /usr/sfw/{lib,include}
+
+ ntpd/ntpd.c@1.61.1.12 +9 -0
+ [Bug 519] Allow dynamic SSL libraries: check SSLeay() for version info
+
+ChangeSet@1.1251.67.10, 2005-10-24 04:35:24-04:00, stenn@deacon.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.79.1.6 +2 -2
+ More 0-11 -> 1-12 month stuff
+
+ ntpd/ntp_crypto.c@1.98.1.8 +0 -5
+ Lose the coredumping cinfo-> tests
+
+ChangeSet@1.1251.67.9, 2005-10-23 16:43:06-04:00, stenn@deacon.udel.edu
+ Crypto cleanup from Dave Mills
+
+ include/ntp.h@1.120.1.5 +1 -1
+ member reorder from Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.7 +143 -157
+ Crypto cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.13 +0 -1
+ Crypto cleanup from Dave Mills
+
+ChangeSet@1.1251.64.3, 2005-10-22 23:43:31-04:00, mayer@pogo.udel.edu
+ Bug #411 fix from Marc
+
+ ntpd/ntp_intres.c@1.40.1.2 +1 -1
+ Bug #411 fix from Marc
+
+ChangeSet@1.1251.67.8, 2005-10-22 00:26:41-04:00, stenn@deacon.udel.edu
+ Crypto cleanup/changes from Dave Mills
+
+ include/ntp_crypto.h@1.38 +0 -1
+ Lose CRYPTO_FLAG_INVLD. From Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.6 +72 -58
+ Crypto cleanup/changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.12 +15 -7
+ Crypto cleanup/changes from Dave Mills
+
+ChangeSet@1.1251.67.7, 2005-10-21 23:39:36-04:00, stenn@deacon.udel.edu
+ [Bug 515] ntp_set_tod() displays stale errno
+
+ libntp/machines.c@1.18 +2 -0
+ [Bug 515] ntp_set_tod() displays stale errno
+
+ChangeSet@1.1251.67.6, 2005-10-21 23:23:52-04:00, stenn@deacon.udel.edu
+ [Bug 512] Reintroduce -m to ntptrace. From Frederic Planchon
+
+ scripts/ntptrace.in@1.5 +8 -2
+ [Bug 512] Reintroduce -m to ntptrace. From Frederic Planchon
+
+ChangeSet@1.1251.67.5, 2005-10-20 20:22:12-04:00, stenn@deacon.udel.edu
+ Fixes from Dave Mills
+
+ include/ntp.h@1.120.1.4 +4 -2
+ cleanup from Dave Mills
+
+ include/ntp_crypto.h@1.37 +3 -1
+ cleanup from Dave Mills
+
+ include/ntpd.h@1.82.4.4 +1 -1
+ cleanup from Dave Mills
+
+ libntp/statestr.c@1.10 +2 -1
+ Dave Mills added "server certificate expired".
+
+ ntpd/ntp_crypto.c@1.98.1.5 +71 -7
+ host and server certificate changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.115 +13 -5
+ leap second fix plus 0-11 -> 1-12 month fix from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.11 +3 -3
+ test reorder from Dave Mills
+
+ChangeSet@1.1251.64.2, 2005-10-16 18:43:40-04:00, mayer@pogo.udel.edu
+ Fixes from bug #411 Marc de la Gueronniere
+
+ ntpd/ntp_intres.c@1.40.1.1 +44 -34
+ Fixes from bug #411 Marc de la Gueronniere
+
+ChangeSet@1.1251.67.4, 2005-10-16 03:18:13-04:00, stenn@deacon.udel.edu
+ Fix (unused) reversed tests
+
+ ntpd/ntp_intres.c@1.41 +2 -2
+ Fix (unused) reversed tests
+
+ChangeSet@1.1251.67.3, 2005-10-16 02:30:43-04:00, stenn@deacon.udel.edu
+ fix quoting in ISC_PLATFORM_NEEDIN6ADDRANY test
+
+ configure.ac@1.359.1.23 +1 -1
+ fix quoting in ISC_PLATFORM_NEEDIN6ADDRANY test
+
+ChangeSet@1.1251.67.2, 2005-10-15 23:35:54-04:00, stenn@deacon.udel.edu
+ leap and orphan fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.10 +86 -36
+ leap and orphan fixes from Dave Mills
+
+ChangeSet@1.1251.67.1, 2005-10-15 20:39:31-04:00, stenn@deacon.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.79.1.5 +4 -4
+ hostkey->update and ctl_putfs() fixes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.4 +2 -3
+ Cleanup
+
+ ntpd/ntp_loopfilter.c@1.114 +31 -11
+ leap second and pll_control/kern_enable fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.9 +90 -41
+ Comment, crypto_update(), orphan, and leap second fixes from Dave Mills
+
+ChangeSet@1.1251.59.9, 2005-10-14 16:08:06-04:00, stenn@deacon.udel.edu
+ Updates from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.113 +13 -8
+ S_SPIK and kern_enable fixes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.73 +2 -2
+ cleanup from Dave Mills
+
+ ntpd/refclock_arbiter.c@1.13 +4 -5
+ cleanup from Dave Mills
+
+ChangeSet@1.1251.59.8, 2005-10-14 15:52:35-04:00, stenn@deacon.udel.edu
+ finish Frank's [] conversion to a block of code
+
+ configure.ac@1.359.1.22 +1 -1
+ finish Frank's [] conversion to a block of code
+
+ChangeSet@1.1251.61.10, 2005-10-13 00:33:46-04:00, stenn@deacon.udel.edu
+ documentation updates from Dave Mills
+
+ html/confopt.html@1.31.1.3 +25 -35
+ documentation updates from Dave Mills
+
+ html/gadget.html@1.1 +33 -0
+
+ html/gadget.html@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/gadget.html
+
+ html/manyopt.html@1.13 +33 -26
+ documentation updates from Dave Mills
+
+ html/release.html@1.31 +20 -9
+ documentation updates from Dave Mills
+
+ html/scripts/links11.txt@1.2 +2 -0
+ documentation updates from Dave Mills
+
+ChangeSet@1.1251.61.9, 2005-10-09 23:38:00-04:00, stenn@deacon.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.112 +1 -1
+ calleapwhen() change from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.8 +11 -3
+ crypto fixes from Dave Mills
+
+ChangeSet@1.1251.59.6, 2005-10-08 10:04:12+00:00, kardel@pogo.udel.edu
+ dolfptoa.c:
+ safeguard against sign extensions and other mishaps on 64 bit platforms
+
+ libntp/dolfptoa.c@1.6 +11 -0
+ safeguard against sign extensions and other mishaps on 64 bit platforms
+
+ChangeSet@1.1251.66.2, 2005-10-08 02:28:24-04:00, stenn@deacon.udel.edu
+ documentation fixes from Dave Mills
+
+ html/authopt.html@1.34 +24 -14
+ documentation fixes from Dave Mills
+
+ html/confopt.html@1.31.1.2 +2 -2
+ documentation fixes from Dave Mills
+
+ html/keygen.html@1.7 +1 -1
+ documentation fixes from Dave Mills
+
+ html/manyopt.html@1.12 +4 -3
+ documentation fixes from Dave Mills
+
+ html/miscopt.html@1.32 +22 -5
+ documentation fixes from Dave Mills
+
+ html/msyslog.html@1.5 +49 -54
+ documentation fixes from Dave Mills
+
+ChangeSet@1.1251.59.4, 2005-10-08 06:06:03+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ avoid unexpected buffer overflows due to sprintf("%f") on strange floats:
+ replace almost all str* and *printf functions by their buffer bounded
+ counterparts
+ data_mbg.c, mbg_gps166.h:
+ bounded buffer implementation
+ dcfd.c:
+ make dcfd.c compile on NetBSD 3.99.9 again (configure/sigvec compatibility fix)
+
+ include/mbg_gps166.h@1.5.1.1 +10 -4
+ bounded buffer implementation
+
+ libparse/data_mbg.c@1.5.1.1 +61 -49
+ bounded buffer implementation
+
+ ntpd/refclock_parse.c@1.35.1.1 +221 -185
+ avoid unexpected buffer overflows due to sprintf("%f") on strange floats:
+ replace almost all str* and *printf functions be their buffer bounded
+ counterparts
+
+ parseutil/dcfd.c@1.18 +25 -18
+ make dcfd.c compile on NetBSD 3.99.9 again (configure/sigvec compatibility fix)
+
+ChangeSet@1.1251.66.1, 2005-10-08 00:29:29-04:00, stenn@deacon.udel.edu
+ orphan fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.7 +11 -4
+ orphan fixes from Dave Mills
+
+ChangeSet@1.1251.65.1, 2005-10-05 01:38:06-07:00, murray@glypnod.example.com
+ Add support for the HP Z3801 GPS clock. Needs 19200 buad, 7 bits, odd parity.
+
+ BitKeeper/etc/logging_ok@1.54.2.1 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ html/drivers/driver26.html@1.10 +12 -9
+ Add description of HP Z3801A
+
+ include/ntp_refclock.h@1.20 +2 -1
+ Add LDISC_7O1 flag for 7 bit, odd parity
+
+ ntpd/ntp_refclock.c@1.72 +4 -0
+ Add support for LDISC_7O1 flag - 7 bit, odd parity.
+
+ ntpd/refclock_hpgps.c@1.7 +18 -3
+ Add support for HP Z3810A - 19200, 7bits, odd parity
+
+ChangeSet@1.1251.61.6, 2005-10-05 03:02:11-04:00, stenn@deacon.udel.edu
+ orphan fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.6 +18 -16
+ orphan fixes from Dave Mills
+
+ChangeSet@1.1251.64.1, 2005-10-04 12:22:54-04:00, mayer@pogo.udel.edu
+ Fix extra y at beginning of file
+
+ ntpd/ntp_proto.c@1.232.2.1 +1 -1
+ Fix extra y at beginning of file
+
+ChangeSet@1.1251.61.5, 2005-10-04 02:52:27-04:00, stenn@deacon.udel.edu
+ fixes from Dave Mills
+
+ include/ntp.h@1.120.1.3 +3 -1
+ fixes from Dave Mills
+
+ include/ntpd.h@1.82.4.3 +0 -1
+ fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.79.1.4 +1 -1
+ fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.5 +49 -29
+ fixes from Dave Mills
+
+ ntpd/refclock_local.c@1.14 +2 -8
+ fixes from Dave Mills
+
+ChangeSet@1.1251.63.1, 2005-10-02 04:12:05-04:00, stenn@deacon.udel.edu
+ NEWS update; orphan/revoke/expire stuff from Dave Mills
+
+ NEWS@1.48 +2 -0
+ updated
+
+ include/ntp.h@1.120.1.2 +3 -2
+ orphan and revoke stuff from Dave Mills
+
+ include/ntp_config.h@1.37.1.2 +1 -0
+ orphan and revoke stuff from Dave Mills
+
+ include/ntp_control.h@1.29 +2 -1
+ orphan and revoke stuff from Dave Mills
+
+ ntpd/ntp_config.c@1.129.4.1 +5 -0
+ fixes, and orphan and expire stuff from Dave Mills
+
+ ntpd/ntp_control.c@1.79.1.3 +50 -20
+ fixes, and orphan and expire stuff from Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.3 +114 -94
+ fixes, and orphan and expire stuff from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.111 +1 -1
+ fixes, and orphan and expire stuff from Dave Mills
+
+ ntpd/ntp_peer.c@1.84.1.1 +0 -1
+ fixes, and orphan and expire stuff from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.4 +200 -124
+ fixes, and orphan and expire stuff from Dave Mills
+
+ChangeSet@1.1251.61.3, 2005-10-01 01:02:12-04:00, mayer@pogo.udel.edu
+ Fixes for handling IPv6 issues and getaddrinfo()
+
+ include/isc/net.h@1.7 +2 -2
+ Fixes for handling IPv6 issues and getaddrinfo)_
+
+ libisc/net.c@1.6 +1 -0
+ Fixes for handling IPv6 issues and getaddrinfo)_
+
+ libntp/ntp_rfc2553.c@1.26 +124 -21
+ Fixes for handling IPv6 issues and getaddrinfo)_
+
+ ports/winnt/include/isc/net.h@1.6 +1 -1
+ Fixes for handling IPv6 issues and getaddrinfo)_
+
+ ports/winnt/libisc/net.c@1.7 +1 -1
+ Fixes for handling IPv6 issues and getaddrinfo)_
+
+ChangeSet@1.1251.61.2, 2005-09-26 02:19:59-04:00, stenn@deacon.udel.edu
+ sntp is now built by default.
+
+ configure.ac@1.359.4.1 +2 -2
+ sntp is now built by default.
+
+ flock-build@1.33 +6 -7
+ sntp is now built by default.
+
+ChangeSet@1.1251.60.4, 2005-09-25 12:21:08+00:00, kardel@pogo.udel.edu
+ ntpdc_ops.c:
+ output broadcast address information when broadcast flag is set
+ ntp_peer.c:
+ re-bind broad and multi cast on re-fresh
+ ntp_io.c:
+ re-bind interfaces on re-scans
+
+ ntpd/ntp_io.c@1.211 +90 -43
+ re-bind interfaces on re-scans
+
+ ntpd/ntp_peer.c@1.91 +18 -1
+ re-bind broad and multi cast on re-fresh
+
+ ntpdc/ntpdc_ops.c@1.45 +10 -9
+ output broadcast address information when broadcast flag is set
+
+ChangeSet@1.1251.60.3, 2005-09-25 12:10:35+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ avoid unexpected buffer overflows due to sprintf("%f") on strange floats:
+ replace almost all str* and *printf functions be their buffer bounded
+ counterparts
+ limit re-set rate of trimble clocks
+ data_mbg.c:
+ support fully bounded buffers
+ clk_meinberg.c:
+ cleanup buffer bounds
+ mbg_gps166.h
+ support fully bounded buffers
+
+ include/mbg_gps166.h@1.6 +7 -4
+
+ libparse/clk_meinberg.c@1.9 +7 -4
+ cleanup buffer bounds
+
+ libparse/data_mbg.c@1.6 +58 -49
+ support fully bounded buffers
+
+ ntpd/refclock_parse.c@1.36 +204 -185
+ avoid unexpected buffer overflows due to sprintf("%f") on strange floats:
+ replace almost all str* and *printf functions be their buffer bounded
+ counterparts
+ limit re-set rate of trimble clocks
+
+ChangeSet@1.1251.61.1, 2005-09-25 04:17:34-04:00, stenn@deacon.udel.edu
+ Add missing ISC_PLATFORM_HAVESCOPEID checks.
+
+ ntpd/ntp_io.c@1.187.1.4 +12 -1
+ Add missing ISC_PLATFORM_HAVESCOPEID checks.
+
+ChangeSet@1.1251.58.1, 2005-09-25 05:54:32+00:00, stenn@ntp1.isc.org
+ [Bug 467] Reorder #include order to avoid linux collision
+
+ BitKeeper/etc/logging_ok@1.54.1.1 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ ntpd/ntp_config.c@1.129.3.4 +8 -2
+ [Bug 467] Reorder #include order to avoid linux collision
+
+ChangeSet@1.1251.1.153, 2005-09-24 23:18:13-04:00, stenn@deacon.udel.edu
+ [Bug 498] Patches from Miroslaw Pabich
+
+ include/adjtime.h@1.4 +0 -6
+ [Bug 498] Patches from Miroslaw Pabich
+
+ libntp/iosignal.c@1.13 +6 -6
+ [Bug 498] Patches from Miroslaw Pabich
+
+ ntpd/refclock_hopfser.c@1.9 +5 -3
+ [Bug 498] Patches from Miroslaw Pabich
+
+ ntpd/refclock_neoclock4x.c@1.13 +5 -3
+ [Bug 498] Patches from Miroslaw Pabich
+
+ ntpd/refclock_palisade.h@1.8 +2 -0
+ [Bug 498] Patches from Miroslaw Pabich
+
+ ntpdate/ntpdate.c@1.52 +0 -4
+ [Bug 498] Patches from Miroslaw Pabich
+
+ChangeSet@1.1251.53.6, 2005-09-24 17:39:29-04:00, mayer@pogo.udel.edu
+ Revamped the code in getaddrinfo
+
+ libntp/ntp_rfc2553.c@1.25 +31 -37
+ Revamped the code in getaddrinfo
+
+ChangeSet@1.1251.56.1, 2005-09-23 19:27:51-04:00, mayer@pogo.udel.edu
+ Refix for memory leak. Some checks were incorrect
+
+ libntp/ntp_rfc2553.c@1.24 +19 -15
+ Refix for memory leak. Some checks were incorrect
+
+ChangeSet@1.1251.53.4, 2005-09-22 22:07:15-04:00, stenn@deacon.udel.edu
+ [Bug 496]: Updated adjtime for QNX from Miroslaw Pabich
+
+ libntp/adjtime.c@1.7 +80 -17
+ [Bug 496]: Updated adjtime for QNX from Miroslaw Pabich
+
+ChangeSet@1.1251.55.1, 2005-09-21 23:23:47-04:00, gunturu@pogo.udel.edu
+ timing.c:
+ unable settimeofday and adjtime as temporary fix until we port utmp.
+
+ BitKeeper/etc/logging_ok@1.55 +1 -0
+ Logging to repologs@ntp.isc.org accepted
+
+ sntp/timing.c@1.3 +4 -4
+ unable settimeofday and adjtime as temporary fix until we port utmp.
+
+ChangeSet@1.1305, 2005-09-21 00:31:27-04:00, stenn@pogo.udel.edu
+ autoopts cleanup
+
+ ntpd/ntpd.c@1.70 +2 -0
+ autoopts cleanup
+
+ChangeSet@1.1304, 2005-09-21 00:30:39-04:00, stenn@pogo.udel.edu
+ libopts update
+
+ sntp/libopts/compat/compat.h@1.5 +5 -4
+ libopts update
+
+ChangeSet@1.1303, 2005-09-21 00:28:47-04:00, stenn@pogo.udel.edu
+ libopts upgrade
+
+ sntp/libopts/autoopts.c@1.3 +9 -1
+ libopts upgrade
+
+ sntp/libopts/autoopts.h@1.4 +1 -8
+ libopts upgrade
+
+ sntp/libopts/autoopts/options.h@1.3 +30 -5
+ libopts upgrade
+
+ sntp/libopts/autoopts/usage-txt.h@1.4 +1 -1
+ libopts upgrade
+
+ sntp/libopts/compat/compat.h@1.4 +1 -1
+ libopts upgrade
+
+ sntp/libopts/genshell.c@1.4 +1 -1
+ libopts upgrade
+
+ sntp/libopts/genshell.h@1.4 +2 -2
+ libopts upgrade
+
+ sntp/libopts/libopts.c@1.3 +0 -1
+ libopts upgrade
+
+ sntp/libopts/libopts.m4@1.4 +15 -17
+ libopts upgrade
+
+ sntp/libopts/proto.h@1.4 +1 -1
+ libopts upgrade
+
+ChangeSet@1.1251.53.3, 2005-09-20 23:35:55-04:00, mayer@pogo.udel.edu
+ bug #486 and Fix memory leak and add heiko's change for hints
+
+ libntp/ntp_rfc2553.c@1.23 +15 -5
+ bug #486 and Fix memory leak and add heiko's change for hints
+
+ChangeSet@1.1251.54.1, 2005-09-19 18:05:35-04:00, mayer@pogo.udel.edu
+ Frank Kardel's fixes for the flags and broadcast address
+
+ libisc/ifiter_getifaddrs.c@1.5 +2 -2
+ Frank Kardel's fixes for the flags and broadcast address
+
+ libisc/ifiter_sysctl.c@1.12 +1 -1
+ Frank Kardel's fixes for the flags and broadcast address
+
+ChangeSet@1.1251.52.2, 2005-09-17 10:11:26+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ cleanup merge fallout
+
+ ntpd/ntp_io.c@1.209 +6 -5
+ cleanup merge fallout
+
+ChangeSet@1.1301, 2005-09-17 00:45:06-04:00, stenn@pogo.udel.edu
+ libopts upgrade
+
+ m4/libopts.m4@1.8 +36 -1
+ libopts upgrade
+
+ sntp/Makefile.am@1.9 +1 -1
+ libopts upgrade
+
+ sntp/libopts/Makefile.am@1.2 +1 -1
+ libopts upgrade
+
+ sntp/libopts/autoopts.h@1.3 +1 -21
+ libopts upgrade
+
+ sntp/libopts/autoopts/usage-txt.h@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ sntp/libopts/autoopts/usage-txt.h@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/compat/compat.h@1.3 +5 -4
+ libopts upgrade
+
+ sntp/libopts/genshell.c@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ sntp/libopts/genshell.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/genshell.h@1.3 +0 -0
+ Change mode to -rw-r--r--
+
+ sntp/libopts/genshell.h@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/libopts.c@1.2 +1 -0
+ libopts upgrade
+
+ sntp/libopts/libopts.m4@1.3 +36 -1
+ libopts upgrade
+
+ sntp/libopts/proto.h@1.3 +1 -10
+ libopts upgrade
+
+ sntp/libopts/text_mmap.c@1.3 +74 -33
+ libopts upgrade
+
+ sntp/m4/libopts.m4@1.5 +36 -1
+ libopts upgrade
+
+ sntp/m4/libopts.m4@1.4 +0 -0
+ Rename: sntp/libopts.m4 -> sntp/m4/libopts.m4
+
+ sntp/sntp-opts.def@1.2 +2 -0
+ libopts upgrade
+
+ChangeSet@1.1251.51.6, 2005-09-17 00:34:07-04:00, stenn@deacon.udel.edu
+ more leap stuff from Dave Mills
+
+ include/ntpd.h@1.82.4.2 +1 -0
+ more leap stuff from Dave Mills
+
+ ntpd/ntp_control.c@1.79.1.2 +1 -1
+ more leap stuff from Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.2 +2 -5
+ more leap stuff from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.110 +11 -13
+ more leap stuff from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.3 +4 -2
+ more leap stuff from Dave Mills
+
+ChangeSet@1.1251.51.5, 2005-09-16 22:47:54-04:00, mayer@pogo.udel.edu
+ Fix wildcards to return valid socket interface structure addresses - for Heiko's fix bug #450
+
+ ntpd/ntp_io.c@1.187.1.3 +10 -18
+ Fix wildcards to return valid socket interface structure addresses - for Heiko's fix bug #450
+
+ChangeSet@1.1251.51.4, 2005-09-15 02:37:45-04:00, stenn@whimsy.udel.edu
+ strip quotes from filenames in the config file. From Heiko Gerstung
+
+ ntpd/ntp_config.c@1.129.3.3 +18 -0
+ strip quotes from filenames in the config file. From Heiko Gerstung
+
+ChangeSet@1.1251.51.3, 2005-09-15 02:26:33-04:00, stenn@whimsy.udel.edu
+ Documentation changes from Dave Mills
+
+ html/accopt.html@1.24 +66 -61
+ Documentation changes from Dave Mills
+
+ html/assoc.html@1.21 +52 -51
+ Documentation changes from Dave Mills
+
+ html/audio.html@1.17 +48 -47
+ Documentation changes from Dave Mills
+
+ html/authopt.html@1.33 +139 -137
+ Documentation changes from Dave Mills
+
+ html/clockopt.html@1.18 +61 -60
+ Documentation changes from Dave Mills
+
+ html/confopt.html@1.31.1.1 +18 -15
+ Documentation changes from Dave Mills
+
+ html/copyright.html@1.31 +72 -71
+ Documentation changes from Dave Mills
+
+ html/debug.html@1.23 +119 -118
+ Documentation changes from Dave Mills
+
+ html/drivers/driver1.html@1.15 +59 -58
+ Documentation changes from Dave Mills
+
+ html/drivers/driver18.html@1.15 +56 -55
+ Documentation changes from Dave Mills
+
+ html/drivers/driver20.html@1.14 +59 -65
+ Documentation changes from Dave Mills
+
+ html/drivers/driver22.html@1.17 +47 -46
+ Documentation changes from Dave Mills
+
+ html/drivers/driver27.html@1.14 +198 -200
+ Documentation changes from Dave Mills
+
+ html/drivers/driver29.html@1.14 +769 -790
+ Documentation changes from Dave Mills
+
+ html/drivers/driver3.html@1.11 +47 -47
+ Documentation changes from Dave Mills
+
+ html/drivers/driver30.html@1.19 +77 -78
+ Documentation changes from Dave Mills
+
+ html/drivers/driver31.html@1.2 +52 -50
+ Documentation changes from Dave Mills
+
+ html/drivers/driver32.html@1.12 +23 -23
+ Documentation changes from Dave Mills
+
+ html/drivers/driver33.html@1.12 +23 -23
+ Documentation changes from Dave Mills
+
+ html/drivers/driver34.html@1.11 +44 -50
+ Documentation changes from Dave Mills
+
+ html/drivers/driver35.html@1.14 +41 -40
+ Documentation changes from Dave Mills
+
+ html/drivers/driver36.html@1.26 +162 -151
+ Documentation changes from Dave Mills
+
+ html/drivers/driver37.html@1.12 +44 -43
+ Documentation changes from Dave Mills
+
+ html/drivers/driver38.html@1.13 +124 -131
+ Documentation changes from Dave Mills
+
+ html/drivers/driver39.html@1.13 +106 -109
+ Documentation changes from Dave Mills
+
+ html/drivers/driver4.html@1.12 +59 -58
+ Documentation changes from Dave Mills
+
+ html/drivers/driver40.html@1.13 +129 -138
+ Documentation changes from Dave Mills
+
+ html/drivers/driver42.html@1.12 +23 -22
+ Documentation changes from Dave Mills
+
+ html/drivers/driver43.html@1.10 +35 -34
+ Documentation changes from Dave Mills
+
+ html/drivers/driver44.html@1.12 +81 -82
+ Documentation changes from Dave Mills
+
+ html/drivers/driver6.html@1.20 +73 -72
+ Documentation changes from Dave Mills
+
+ html/drivers/driver7.html@1.22 +207 -206
+ Documentation changes from Dave Mills
+
+ html/drivers/driver8.html@1.18 +230 -419
+ Documentation changes from Dave Mills
+
+ html/drivers/oncore-shmem.html@1.12 +58 -55
+ Documentation changes from Dave Mills
+
+ html/drivers/tf582_4.html@1.2 +57 -58
+ Documentation changes from Dave Mills
+
+ html/extern.html@1.14 +26 -25
+ Documentation changes from Dave Mills
+
+ html/howto.html@1.18 +89 -88
+ Documentation changes from Dave Mills
+
+ html/index.html@1.32 +1 -1
+ Documentation changes from Dave Mills
+
+ html/kern.html@1.14 +27 -26
+ Documentation changes from Dave Mills
+
+ html/keygen.html@1.6 +109 -105
+ Documentation changes from Dave Mills
+
+ html/ldisc.html@1.12 +35 -34
+ Documentation changes from Dave Mills
+
+ html/manyopt.html@1.11 +51 -50
+ Documentation changes from Dave Mills
+
+ html/measure.html@1.11 +16 -15
+ Documentation changes from Dave Mills
+
+ html/miscopt.html@1.31 +87 -83
+ Documentation changes from Dave Mills
+
+ html/monopt.html@1.20 +122 -117
+ Documentation changes from Dave Mills
+
+ html/msyslog.html@1.4 +120 -118
+ Documentation changes from Dave Mills
+
+ html/mx4200data.html@1.11 +1069 -1068
+ Documentation changes from Dave Mills
+
+ html/notes.html@1.17 +150 -149
+ Documentation changes from Dave Mills
+
+ html/ntpd.html@1.36.1.1 +167 -169
+ Documentation changes from Dave Mills
+
+ html/ntpdate.html@1.17 +63 -62
+ Documentation changes from Dave Mills
+
+ html/ntpdc.html@1.20.1.1 +153 -152
+ Documentation changes from Dave Mills
+
+ html/ntpdsim.html@1.4 +58 -57
+ Documentation changes from Dave Mills
+
+ html/ntpq.html@1.27 +1 -1
+ Documentation changes from Dave Mills
+
+ html/ntptime.html@1.15 +41 -40
+ Documentation changes from Dave Mills
+
+ html/ntptrace.html@1.13 +37 -36
+ Documentation changes from Dave Mills
+
+ html/parsedata.html@1.11 +77 -76
+ Documentation changes from Dave Mills
+
+ html/parsenew.html@1.10 +50 -47
+ Documentation changes from Dave Mills
+
+ html/pps.html@1.18 +34 -33
+ Documentation changes from Dave Mills
+
+ html/prefer.html@1.15 +65 -64
+ Documentation changes from Dave Mills
+
+ html/rdebug.html@1.15 +26 -25
+ Documentation changes from Dave Mills
+
+ html/refclock.html@1.32 +89 -89
+ Documentation changes from Dave Mills
+
+ html/release.html@1.30 +52 -50
+ Documentation changes from Dave Mills
+
+ html/sntp.html@1.4 +50 -49
+ Documentation changes from Dave Mills
+
+ html/tickadj.html@1.14 +36 -35
+ Documentation changes from Dave Mills
+
+ChangeSet@1.1251.51.2, 2005-09-15 01:59:15-04:00, stenn@whimsy.udel.edu
+ "ident" changes from Dave Mills
+
+ include/ntp_config.h@1.37.1.1 +5 -4
+ "ident" changes from Dave Mills
+
+ include/ntp_control.h@1.28 +2 -1
+ "ident" changes from Dave Mills
+
+ include/ntp_crypto.h@1.36 +6 -4
+ "ident" changes from Dave Mills
+
+ include/ntpd.h@1.82.4.1 +8 -0
+ "ident" changes from Dave Mills
+
+ ntpd/ntp_config.c@1.129.3.2 +6 -0
+ "ident" changes from Dave Mills
+
+ ntpd/ntp_control.c@1.79.1.1 +21 -4
+ "ident" changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.98.1.1 +57 -63
+ "ident" changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.109 +41 -8
+ "ident" changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.2 +4 -8
+ "ident" changes from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.16 +1 -1
+ "ident" changes from Dave Mills
+
+ChangeSet@1.1298, 2005-09-11 22:43:01-04:00, stenn@pogo.udel.edu
+ libopts updates
+
+ build@1.22 +6 -0
+ libopts updates
+
+ m4/libopts.m4@1.7 +79 -55
+ libopts updates
+
+ ntpd/Makefile.am@1.43 +1 -1
+ libopts updates
+
+ ntpd/ntpd-opts.def@1.2 +1 -0
+ libopts updates
+
+ ntpd/ntpdsim-opts.def@1.2 +1 -0
+ libopts updates
+
+ ntpdc/ntpdc-opts.def@1.5 +1 -0
+ libopts updates
+
+ ntpq/ntpq-opts.def@1.4 +1 -0
+ libopts updates
+
+ sntp/configure.ac@1.10 +3 -2
+ libopts updates
+
+ sntp/libopts.m4@1.3 +79 -55
+ libopts updates
+
+ sntp/libopts/MakeDefs.inc@1.2 +0 -5
+ libopts updates
+
+ sntp/libopts/README@1.2 +9 -7
+ libopts updates
+
+ sntp/libopts/autoopts.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/autoopts.h@1.2 +3 -5
+ libopts updates
+
+ sntp/libopts/autoopts/options.h@1.2 +4 -4
+ libopts updates
+
+ sntp/libopts/boolean.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/compat/compat.h@1.2 +51 -10
+ libopts updates
+
+ sntp/libopts/cook.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/enumeration.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/environment.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/libopts.m4@1.2 +83 -56
+ libopts updates
+
+ sntp/libopts/load.c@1.2 +14 -10
+ libopts updates
+
+ sntp/libopts/makeshell.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/nested.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/numeric.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/pgusage.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/proto.h@1.2 +1 -28
+ libopts updates
+
+ sntp/libopts/putshell.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/restore.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/save.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/sort.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/stack.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/streqvcmp.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/text_mmap.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/usage.c@1.2 +1 -1
+ libopts updates
+
+ sntp/libopts/version.c@1.2 +1 -1
+ libopts updates
+
+ChangeSet@1.1251.50.1, 2005-09-06 22:16:23-04:00, mayer@pogo.udel.edu
+ Revamped the input_handler code to separate the reading of packets from the selection process and logic
+
+ ntpd/ntp_io.c@1.187.2.1 +250 -283
+ Revamped the input_handler code to separate the reading of packets from the selection process and logic
+
+ChangeSet@1.1251.38.40, 2005-09-06 19:34:59+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ remove address family agnostic port assignment
+ ntp_proto.c:
+ minor debug code cleanup
+ ntp_peer.c:
+ only call peer_crypto_clear() when disconnecting the interface
+
+ ntpd/ntp_io.c@1.207 +0 -1
+ remove address family agnostic port assignment
+
+ ntpd/ntp_peer.c@1.90 +15 -6
+ only call peer_crypto_clear() when disconnecting the interface
+
+ ntpd/ntp_proto.c@1.238 +6 -5
+ minor debug code cleanup
+
+ChangeSet@1.1251.1.142, 2005-09-04 15:32:05-05:00, stenn@poog.il.thewrittenword.com
+ scopeid and WANT_IPV6 cleanup
+
+ ntpd/ntp_io.c@1.187.1.1 +18 -6
+ scopeid and WANT_IPV6 cleanup
+
+ChangeSet@1.1251.49.1, 2005-09-04 06:44:18+00:00, kardel@pogo.udel.edu
+ configure.ac:
+ with NetBSD 3.99.8 the CTTY requirement has been lifted
+
+ configure.ac@1.359.3.1 +3 -3
+ with NetBSD 3.99.8 the CTTY requirement has been lifted
+
+ChangeSet@1.1251.47.6, 2005-09-01 21:52:27-04:00, stenn@pogo.udel.edu
+ net/route.h fixups
+
+ configure.ac@1.359.1.19 +5 -1
+ net/route.h fixups
+
+ChangeSet@1.1251.47.5, 2005-09-01 05:11:00-04:00, stenn@pogo.udel.edu
+ look for net/route.h and struct rt_msghdr
+
+ configure.ac@1.359.1.18 +16 -0
+ look for net/route.h and struct rt_msghdr
+
+ChangeSet@1.1251.38.37, 2005-09-01 08:01:32+00:00, kardel@pogo.udel.edu
+ ntp_proto.c:
+ avoid double free by cleaning up peer_crypto_clear() as
+ the clear_to_zero trick didn't work any more here and
+ also covered up some memory leaks.
+ ntp_crypto.c:
+ mark possible memleak - MUST be verified
+
+ ntpd/ntp_crypto.c@1.100 +3 -0
+ mark possible memleak - MUST be verified
+
+ ntpd/ntp_proto.c@1.237 +35 -7
+ avoid double free by cleaning up peer_crypto_clear() as
+ the clear_to_zero trick didn't work any more here and
+ also covered up some memory leaks.
+
+ChangeSet@1.1178.6.1, 2005-08-31 18:35:44-04:00, stenn@pogo.udel.edu
+ lose snavely
+
+ flock-build@1.30.1.1 +2 -2
+ lose snavely
+
+ChangeSet@1.1251.38.36, 2005-08-31 08:05:42+00:00, kardel@pogo.udel.edu
+ ntpdc_ops.c, layout.std, ntp_request.c, ntp_io.c, ntp_request.h, ntp.h:
+ output interface life time in log and via ntpdc
+
+ include/ntp.h@1.125 +1 -0
+ output interface life time in log and via ntpdc
+
+ include/ntp_request.h@1.28 +1 -0
+ output interface life time in log and via ntpdc
+
+ ntpd/ntp_io.c@1.206 +7 -2
+ output interface life time in log and via ntpdc
+
+ ntpd/ntp_request.c@1.64 +1 -0
+ output interface life time in log and via ntpdc
+
+ ntpdc/layout.std@1.6 +8 -7
+ output interface life time in log and via ntpdc
+
+ ntpdc/ntpdc_ops.c@1.44 +6 -5
+ output interface life time in log and via ntpdc
+
+ChangeSet@1.1251.38.35, 2005-08-29 20:50:15+00:00, kardel@pogo.udel.edu
+ ntp_peer.c:
+ just disconnect from interface when no interface can be found
+ ntp_io.c:
+ rename HAS_BSD_ROUTING_SOCKET to HAS_ROUTING_SOCKET
+
+ ntpd/ntp_io.c@1.205 +9 -9
+ rename HAS_BSD_ROUTING_SOCKET to HAS_ROUTING_SOCKET
+
+ ntpd/ntp_peer.c@1.89 +1 -15
+ just disconnect from interface when no interface can be found
+
+ChangeSet@1.1251.38.34, 2005-08-29 11:36:25+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ fix compile conditional for asyncio_readers
+ make RTM_IFINFO also optional
+ make RTM_IFANNOUNCE optional to compile on platforms that that have that message (Solaris)
+
+ ntpd/ntp_io.c@1.204 +5 -5
+ fix compile conditional for asyncio_readers
+
+ ntpd/ntp_io.c@1.203 +2 -0
+ make RTM_IFINFO also optional
+
+ ntpd/ntp_io.c@1.202 +2 -0
+ make RTM_IFANNOUNCE optional to compile on platforms that that have that message (Solaris)
+
+ChangeSet@1.1251.38.33, 2005-08-29 10:23:15+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ cleanup compilation for HAS_BSD_ROUTING_SOCKET in undefined case
+ move on variable into corresponding conditional block
+
+ ntpd/ntp_io.c@1.201 +18 -9
+ cleanup compilation for HAS_BSD_ROUTING_SOCKET in undefined case
+ move on variable into corresponding conditional block
+
+ChangeSet@1.1251.38.31, 2005-08-28 15:49:21-04:00, mayer@pogo.udel.edu
+ Remove O/S Specific macro and add conditions for SUPPORT_ASYNCIO_READER that replaced it
+
+ ntpd/ntp_io.c@1.197.1.1 +6 -3
+ Remove O/S Specific macro and add conditions for SUPPORT_ASYNCIO_READER that replaced it
+
+ChangeSet@1.1295, 2005-08-28 04:51:03-04:00, stenn@pogo.udel.edu
+ libopts cleanup
+
+ Makefile.am@1.54 +0 -2
+ libopts cleanup
+
+ configure.ac@1.374 +1 -1
+ libopts cleanup
+
+ m4/libopts.m4@1.6 +8 -5
+ libopts cleanup
+
+ sntp/Makefile.am@1.8 +0 -1
+ libopts cleanup
+
+ sntp/libopts.m4@1.2 +8 -5
+ libopts cleanup
+
+ChangeSet@1.1251.48.3, 2005-08-28 08:37:28+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ more enum cleanup
+
+ ntpd/ntp_io.c@1.199 +1 -1
+ more enum cleanup
+
+ChangeSet@1.1251.48.2, 2005-08-28 07:37:24+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ add FreeBSD for routing socket notification
+
+ ntpd/ntp_io.c@1.198 +3 -1
+ add FreeBSD for routing socket notification
+
+ChangeSet@1.1251.48.1, 2005-08-28 06:43:17+00:00, kardel@pogo.udel.edu
+ ntpd.h:
+ typoe
+
+ include/ntpd.h@1.82.1.9 +1 -1
+ typoe
+
+ChangeSet@1.1251.38.30, 2005-08-27 22:03:00-04:00, mayer@pogo.udel.edu
+ Fixed mispelled function
+
+ include/ntpd.h@1.82.3.1 +1 -1
+ Fixed mispelled function
+
+ChangeSet@1.1251.38.29, 2005-08-27 23:08:36+00:00, kardel@pogo.udel.edu
+ add async io readers (non-refclock, non-socket input)
+ re-factor (simplify) descriptor handling
+ add routing socket listening for quick interface updates
+
+ include/ntpd.h@1.82.1.8 +2 -0
+
+ ntpd/ntp_io.c@1.197 +354 -249
+
+ ntpd/ntp_timer.c@1.30 +7 -1
+
+ChangeSet@1.1251.47.2, 2005-08-26 17:47:52-04:00, mayer@pogo.udel.edu
+ add ntp_random.h to include list
+
+ libntp/systime.c@1.35 +1 -0
+ add ntp_random.h to include list
+
+ChangeSet@1.1251.47.1, 2005-08-26 17:12:27-04:00, mayer@pogo.udel.edu
+ Additional changes to support ntp_random
+
+ include/Makefile.am@1.19.1.1 +1 -0
+ Additional changes to support ntp_random
+
+ util/ntp-keygen.c@1.33 +1 -0
+ Additional changes to support ntp_random
+
+ChangeSet@1.1251.38.26, 2005-08-26 09:17:19-04:00, mayer@pogo.udel.edu
+ Added ntp_debug.h
+
+ include/Makefile.am@1.20 +2 -0
+ Added ntp_debug.h
+
+ChangeSet@1.1293, 2005-08-26 04:40:05-04:00, stenn@pogo.udel.edu
+ autogen stuff
+
+ BitKeeper/etc/ignore@1.44 +40 -48
+ Update the ignore list
+
+ BitKeeper/etc/ignore@1.43 +3 -0
+ added ntpd/ntpd.1 ntpd/ntpdsim.1 sntp/sntp.1
+
+ BitKeeper/etc/ignore@1.42 +1 -0
+ added *-opts.texi
+
+ BitKeeper/etc/ignore@1.41 +1 -0
+ added *-opts.menu
+
+ BitKeeper/etc/ignore@1.40 +1 -0
+ added *-opts.h
+
+ BitKeeper/etc/ignore@1.39 +1 -0
+ added *-opts.c
+
+ Makefile.am@1.53 +3 -3
+ new libopts stuff
+
+ configure.ac@1.373 +0 -1
+ new libopts stuff
+
+ m4/libopts.m4@1.5 +1 -1
+ changes for 1 copy of libopts
+
+ m4/libopts.m4@1.4 +147 -94
+ new libopts stuff
+
+ ntpd/ntpd-opts.def@1.1 +42 -0
+
+ ntpd/ntpd-opts.def@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpd/ntpd-opts.def
+
+ ntpd/ntpdbase-opts.def@1.1 +472 -0
+
+ ntpd/ntpdbase-opts.def@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpd/ntpdbase-opts.def
+
+ ntpd/ntpdsim-opts.def@1.1 +43 -0
+
+ ntpd/ntpdsim-opts.def@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpd/ntpdsim-opts.def
+
+ sntp/libopts.m4@1.1 +418 -0
+
+ sntp/libopts.m4@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts.m4
+
+ sntp/sntp-opts.def@1.1 +388 -0
+
+ sntp/sntp-opts.def@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/sntp-opts.def
+
+ChangeSet@1.1292, 2005-08-26 04:17:32-04:00, stenn@pogo.udel.edu
+ New sntp/libopts/
+
+ sntp/libopts/COPYING.lgpl@1.1 +502 -0
+
+ sntp/libopts/COPYING.lgpl@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/COPYING.lgpl
+
+ sntp/libopts/COPYING.mbsd@1.1 +26 -0
+
+ sntp/libopts/COPYING.mbsd@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/COPYING.mbsd
+
+ sntp/libopts/MakeDefs.inc@1.1 +5 -0
+
+ sntp/libopts/MakeDefs.inc@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/MakeDefs.inc
+
+ sntp/libopts/Makefile.am@1.1 +19 -0
+
+ sntp/libopts/Makefile.am@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/Makefile.am
+
+ sntp/libopts/README@1.1 +89 -0
+
+ sntp/libopts/README@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/README
+
+ sntp/libopts/autoopts.c@1.1 +1033 -0
+
+ sntp/libopts/autoopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts.c
+
+ sntp/libopts/autoopts.h@1.1 +350 -0
+
+ sntp/libopts/autoopts.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts.h
+
+ sntp/libopts/autoopts/options.h@1.1 +864 -0
+
+ sntp/libopts/autoopts/options.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts/options.h
+
+ sntp/libopts/autoopts/usage-txt.h@1.1 +479 -0
+
+ sntp/libopts/autoopts/usage-txt.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/autoopts/usage-txt.h
+
+ sntp/libopts/boolean.c@1.1 +102 -0
+
+ sntp/libopts/boolean.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/boolean.c
+
+ sntp/libopts/compat/compat.h@1.1 +249 -0
+
+ sntp/libopts/compat/compat.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/compat.h
+
+ sntp/libopts/compat/pathfind.c@1.1 +330 -0
+
+ sntp/libopts/compat/pathfind.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/compat/pathfind.c
+
+ sntp/libopts/configfile.c@1.1 +1277 -0
+
+ sntp/libopts/configfile.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/configfile.c
+
+ sntp/libopts/cook.c@1.1 +355 -0
+
+ sntp/libopts/cook.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/cook.c
+
+ sntp/libopts/enumeration.c@1.1 +449 -0
+
+ sntp/libopts/enumeration.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/enumeration.c
+
+ sntp/libopts/environment.c@1.1 +261 -0
+
+ sntp/libopts/environment.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/environment.c
+
+ sntp/libopts/genshell.c@1.1 +300 -0
+
+ sntp/libopts/genshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/genshell.c
+
+ sntp/libopts/genshell.h@1.1 +143 -0
+
+ sntp/libopts/genshell.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/genshell.h
+
+ sntp/libopts/libopts.c@1.1 +29 -0
+
+ sntp/libopts/libopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/libopts.c
+
+ sntp/libopts/libopts.m4@1.1 +418 -0
+
+ sntp/libopts/libopts.m4@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/libopts.m4
+
+ sntp/libopts/load.c@1.1 +516 -0
+
+ sntp/libopts/load.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/load.c
+
+ sntp/libopts/makeshell.c@1.1 +1100 -0
+
+ sntp/libopts/makeshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/makeshell.c
+
+ sntp/libopts/nested.c@1.1 +705 -0
+
+ sntp/libopts/nested.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/nested.c
+
+ sntp/libopts/numeric.c@1.1 +89 -0
+
+ sntp/libopts/numeric.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/numeric.c
+
+ sntp/libopts/pgusage.c@1.1 +154 -0
+
+ sntp/libopts/pgusage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/pgusage.c
+
+ sntp/libopts/proto.h@1.1 +124 -0
+
+ sntp/libopts/proto.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/proto.h
+
+ sntp/libopts/putshell.c@1.1 +333 -0
+
+ sntp/libopts/putshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/putshell.c
+
+ sntp/libopts/restore.c@1.1 +207 -0
+
+ sntp/libopts/restore.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/restore.c
+
+ sntp/libopts/save.c@1.1 +499 -0
+
+ sntp/libopts/save.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/save.c
+
+ sntp/libopts/sort.c@1.1 +369 -0
+
+ sntp/libopts/sort.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/sort.c
+
+ sntp/libopts/stack.c@1.1 +224 -0
+
+ sntp/libopts/stack.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/stack.c
+
+ sntp/libopts/streqvcmp.c@1.1 +292 -0
+
+ sntp/libopts/streqvcmp.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/streqvcmp.c
+
+ sntp/libopts/text_mmap.c@1.1 +312 -0
+
+ sntp/libopts/text_mmap.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/text_mmap.c
+
+ sntp/libopts/tokenize.c@1.1 +322 -0
+
+ sntp/libopts/tokenize.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/tokenize.c
+
+ sntp/libopts/usage.c@1.1 +651 -0
+
+ sntp/libopts/usage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/usage.c
+
+ sntp/libopts/version.c@1.1 +177 -0
+
+ sntp/libopts/version.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/sntp/libopts/version.c
+
+ChangeSet@1.1291, 2005-08-26 04:14:47-04:00, stenn@pogo.udel.edu
+ Remove old libopts/
+
+ BitKeeper/deleted/.del-AUTHORS~919220bd6931acb6@1.2 +0 -0
+ Delete: libopts/AUTHORS
+
+ BitKeeper/deleted/.del-COPYING.lgpl~853519b5bad8e831@1.2 +0 -0
+ Delete: libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd~aff4e32ff033d919@1.2 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-COPYING~8c2b7b26f1103860@1.2 +0 -0
+ Delete: libopts/COPYING
+
+ BitKeeper/deleted/.del-ChangeLog~c979333e966b22d9@1.2 +0 -0
+ Delete: libopts/ChangeLog
+
+ BitKeeper/deleted/.del-INSTALL~ca12b1677cba0915@1.3 +0 -0
+ Delete: libopts/INSTALL
+
+ BitKeeper/deleted/.del-MakeDefs.inc~c24ab9f3f0dafc84@1.2 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~11c11bf4e04c9fef@1.2 +0 -0
+ Delete: libopts/libopts/Makefile.am
+
+ BitKeeper/deleted/.del-Makefile.am~b09ab3b23945dc7d@1.2 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-NEWS~e38f345aacec5424@1.2 +0 -0
+ Delete: libopts/NEWS
+
+ BitKeeper/deleted/.del-README~3d9dfae6a0b32f8f@1.2 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-aclocal.m4~a95cc6b1d68ce121@1.2 +0 -0
+ Delete: libopts/aclocal.m4
+
+ BitKeeper/deleted/.del-autoopts.c~4dc696de338cb6ff@1.2 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.c~7c82dc5b2088549a@1.2 +0 -0
+ Delete: libopts/libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~173454953926d863@1.2 +0 -0
+ Delete: libopts/libopts/autoopts.h
+
+ BitKeeper/deleted/.del-autoopts.h~fd482d3a2757e6af@1.2 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~2652efe8d27b68e9@1.2 +0 -0
+ Delete: libopts/libopts/boolean.c
+
+ BitKeeper/deleted/.del-boolean.c~9803ac347fdb027d@1.2 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-bootstrap~9952937cb65f4e1f@1.2 +0 -0
+ Delete: libopts/bootstrap
+
+ BitKeeper/deleted/.del-compat.h~cd9fa19720e0fe1c@1.2 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-compile~f47b1af5aede22b6@1.3 +0 -0
+ Delete: libopts/m4/compile
+
+ BitKeeper/deleted/.del-config-h.in~8d2fefd4275dba47@1.2 +0 -0
+ Delete: libopts/config-h.in
+
+ BitKeeper/deleted/.del-config-h.in~~fc94cec5e99b4813@1.2 +0 -0
+ Delete: libopts/config-h.in~
+
+ BitKeeper/deleted/.del-config.guess~8473c3316e92525f@1.3 +0 -0
+ Delete: libopts/m4/config.guess
+
+ BitKeeper/deleted/.del-config.sub~bf4f78cdfb8642b@1.3 +0 -0
+ Delete: libopts/m4/config.sub
+
+ BitKeeper/deleted/.del-configfile.c~87486f85c5694535@1.2 +0 -0
+ Delete: libopts/libopts/configfile.c
+
+ BitKeeper/deleted/.del-configfile.c~922a8f1381d4425f@1.2 +0 -0
+ Delete: libopts/configfile.c
+
+ BitKeeper/deleted/.del-configure.ac~1f0f0eec3e2cb683@1.2 +0 -0
+ Delete: libopts/configure.ac
+
+ BitKeeper/deleted/.del-configure~76f3b0b55a913ee5@1.2 +0 -0
+ Delete: libopts/configure
+
+ BitKeeper/deleted/.del-cook.c~288d493179287c2@1.2 +0 -0
+ Delete: libopts/cook.c
+
+ BitKeeper/deleted/.del-cook.c~513ed79970fc81b@1.2 +0 -0
+ Delete: libopts/libopts/cook.c
+
+ BitKeeper/deleted/.del-depcomp~40528c8625c2eb1f@1.3 +0 -0
+ Delete: libopts/m4/depcomp
+
+ BitKeeper/deleted/.del-enumeration.c~680ef3a6fda2472@1.2 +0 -0
+ Delete: libopts/libopts/enumeration.c
+
+ BitKeeper/deleted/.del-enumeration.c~741b004a8edc0491@1.2 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~886b51f1289ec004@1.2 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-environment.c~cbea5891d018489b@1.2 +0 -0
+ Delete: libopts/libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c~4665114445e930eb@1.2 +0 -0
+ Delete: libopts/libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.c~d3404cb6e62977d2@1.2 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~4cbba4ca99e1ce0d@1.2 +0 -0
+ Delete: libopts/libopts/genshell.h
+
+ BitKeeper/deleted/.del-genshell.h~9fcd6a369b750dc@1.2 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-install-sh~5350b467a9780ac5@1.3 +0 -0
+ Delete: libopts/m4/install-sh
+
+ BitKeeper/deleted/.del-libopts.c~322a932038fac5bb@1.2 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.c~a3b1fda2ee8709ec@1.2 +0 -0
+ Delete: libopts/libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~71eb82c61ddaa00e@1.2 +0 -0
+ Delete: libopts/libopts.m4
+
+ BitKeeper/deleted/.del-libopts.m4~dba275de2f39a7f7@1.2 +0 -0
+ Delete: libopts/m4/libopts.m4
+
+ BitKeeper/deleted/.del-load.c~7f48d00d8b58104a@1.2 +0 -0
+ Delete: libopts/libopts/load.c
+
+ BitKeeper/deleted/.del-load.c~b61a8aee9ce882d5@1.2 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-ltmain.sh~1c7887b5d1c077fc@1.3 +0 -0
+ Delete: libopts/m4/ltmain.sh
+
+ BitKeeper/deleted/.del-makeshell.c~a1d60647811b3095@1.2 +0 -0
+ Delete: libopts/libopts/makeshell.c
+
+ BitKeeper/deleted/.del-makeshell.c~f8b9cf5964d39db3@1.2 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-missing~f915814376b31ab6@1.3 +0 -0
+ Delete: libopts/m4/missing
+
+ BitKeeper/deleted/.del-nested.c~86ef6834b872d57@1.2 +0 -0
+ Delete: libopts/libopts/nested.c
+
+ BitKeeper/deleted/.del-nested.c~96ea01864b196d05@1.2 +0 -0
+ Delete: libopts/nested.c
+
+ BitKeeper/deleted/.del-numeric.c~e2c152233ded2202@1.2 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-numeric.c~f02f2a6d69035d0c@1.2 +0 -0
+ Delete: libopts/libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~7de16fb1feb01fb9@1.2 +0 -0
+ Delete: libopts/autoopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c~4df984bf91869e5@1.2 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~c9ca334462225a7a@1.2 +0 -0
+ Delete: libopts/libopts/pgusage.c
+
+ BitKeeper/deleted/.del-pgusage.c~ca33905e5c7aa1df@1.2 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-proto.h~452f423c89ac200e@1.2 +0 -0
+ Delete: libopts/libopts/proto.h
+
+ BitKeeper/deleted/.del-proto.h~e8c7a2af94986c41@1.2 +0 -0
+ Delete: libopts/proto.h
+
+ BitKeeper/deleted/.del-putshell.c~229e9255825c2699@1.2 +0 -0
+ Delete: libopts/libopts/putshell.c
+
+ BitKeeper/deleted/.del-putshell.c~3f90a9637c1cb3f8@1.2 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c~786e9e008c497959@1.2 +0 -0
+ Delete: libopts/libopts/restore.c
+
+ BitKeeper/deleted/.del-restore.c~c5d1d1e9dde10cf6@1.2 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~16cdb7b3a7320c91@1.2 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-save.c~9ac698c63285dcdf@1.2 +0 -0
+ Delete: libopts/libopts/save.c
+
+ BitKeeper/deleted/.del-sort.c~437339de5156edc@1.2 +0 -0
+ Delete: libopts/libopts/sort.c
+
+ BitKeeper/deleted/.del-sort.c~b07de2fbf0002b9e@1.2 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~23d824507da8a741@1.2 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-stack.c~c65d211fa8d2c6d9@1.2 +0 -0
+ Delete: libopts/libopts/stack.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~2b01ea402455a9d5@1.2 +0 -0
+ Delete: libopts/libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-streqvcmp.c~ecb35a72608d3d8c@1.2 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-text_mmap.c~7e8b2fb878ad6465@1.2 +0 -0
+ Delete: libopts/libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-text_mmap.c~8276cd532e35d7d@1.2 +0 -0
+ Delete: libopts/text_mmap.c
+
+ BitKeeper/deleted/.del-tokenize.c~994b2aafabe0643a@1.2 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.c~e1d05f5d9da9f103@1.2 +0 -0
+ Delete: libopts/libopts/tokenize.c
+
+ BitKeeper/deleted/.del-usage-txt.h~3f152e2762854446@1.2 +0 -0
+ Delete: libopts/autoopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~35ccdb8f15358479@1.2 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-usage.c~7218cbdb39fe114@1.2 +0 -0
+ Delete: libopts/libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c~51a770ed71ec2abe@1.2 +0 -0
+ Delete: libopts/libopts/version.c
+
+ BitKeeper/deleted/.del-version.c~f7d51067e17b5364@1.2 +0 -0
+ Delete: libopts/version.c
+
+ChangeSet@1.1251.45.17, 2005-08-25 21:01:42+00:00, kardel@pogo.udel.edu
+ ntpdc_ops.c, ntp_request.c, ntp_peer.c, ntpd.h, ntp_request.h:
+ remove reset pollinterval feature
+
+ include/ntp_request.h@1.27 +0 -1
+ remove reset pollinterval feature
+
+ include/ntpd.h@1.82.2.6 +0 -1
+ remove reset pollinterval feature
+
+ ntpd/ntp_peer.c@1.82.1.6 +0 -41
+ remove reset pollinterval feature
+
+ ntpd/ntp_request.c@1.63 +0 -107
+ remove reset pollinterval feature
+
+ ntpdc/ntpdc_ops.c@1.43 +0 -60
+ remove reset pollinterval feature
+
+ChangeSet@1.1251.45.16, 2005-08-24 21:42:33+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ fix interface number log output
+
+ ntpd/ntp_io.c@1.196 +6 -5
+ fix interface number log output
+
+ChangeSet@1.1251.45.15, 2005-08-24 13:30:29+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ keep others out while rebuilding the environment
+
+ ntpd/ntp_io.c@1.195 +2 -2
+ keep others out while rebuilding the environment
+
+ChangeSet@1.1251.45.14, 2005-08-24 13:09:54+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ paren missing
+
+ ntpd/ntp_io.c@1.194 +1 -0
+ paren missing
+
+ChangeSet@1.1251.45.13, 2005-08-24 09:28:44+00:00, kardel@pogo.udel.edu
+ layout.std:
+ ifnum introduced
+ ntpdc_ops.c:
+ list ifnum and ifindex
+ layout.std:
+ ifnum added
+ ntp_request.c, ntp_peer.c:
+ re-name interface_t to struct interface - _t collides with POSIX system namespaces
+ ntp_io.c:
+ change interface_t to struct interface ad _t typedef pollute POSIX system name space
+ use ifnum for interface numbers (ifindex seems often to be 0 on NetBSD)
+ re-arrange intialization
+ move setting of loopback interface variable out of conversion function to just before inserting the
+ interface structure into the lists
+ make ifindex be the original
+ ntpd.h:
+ change interface_t to struct interface as _t typdef pollute POSIX system name space
+ ntp_request.h:
+ add ifnum as interface instance generation number
+ ntp.h:
+ change interface_t to struct interface as _t typedef pollute POSIX system namespace
+ add ifnum as interface instance generation number
+
+ include/ntp.h@1.118.1.6 +2 -3
+ change interface_t to struct interface as _t typedef pollute POSIX system namespace
+ add ifnum as interface instance generation number
+
+ include/ntp_request.h@1.26 +2 -1
+ add ifnum as interface instance generation number
+
+ include/ntpd.h@1.82.2.5 +7 -7
+ change interface_t to struct interface as _t typdef pollute POSIX system name space
+
+ ntpd/ntp_io.c@1.193 +172 -179
+ change interface_t to struct interface ad _t typedef pollute POSIX system name space
+ use ifnum for interface numbers (ifindex seems often to be 0 on NetBSD)
+ re-arrange intialization
+ move setting of loopback interface variable out of conversion function to just before inserting the
+ interface structure into the lists
+ make ifindex be the original
+
+ ntpd/ntp_peer.c@1.82.1.5 +1 -1
+ re-name interface_t to struct interface - _t collides with POSIX system namespaces
+
+ ntpd/ntp_request.c@1.62 +2 -1
+ re-name interface_t to struct interface - _t collides with POSIX system namespaces
+
+ ntpdc/layout.std@1.5 +1 -0
+ ifnum introduced
+
+ ntpdc/layout.std@1.4 +4 -4
+ ifnum added
+
+ ntpdc/ntpdc_ops.c@1.42 +6 -5
+ list ifnum and ifindex
+
+ChangeSet@1.1251.45.12, 2005-08-24 06:24:42+00:00, kardel@pogo.udel.edu
+ ntpdc_ops.c, ntp_request.c:
+ support dynamic modifier
+ support pollreset request
+ ntpdc.c:
+ allow first argument to be optional
+ ntp_peer.c, ntp_config.c, ntp_config.h, ntp.h:
+ support dynamic modifier
+ ntpd.h:
+ support resetting of poll interval on interface changes and manually
+ ntp_request.h:
+ support dynamic modifier
+ add pollreset mode 7 request
+ ntpdc.html, confopt.html:
+ document "dynamic" modifier keyword for peer/server configuration
+
+ html/confopt.html@1.32 +4 -2
+ document "dynamic" modifier keyword for peer/server configuration
+
+ html/ntpdc.html@1.22 +4 -4
+ document "dynamic" modifier keyword for peer/server configuration
+
+ include/ntp.h@1.118.1.5 +1 -0
+ support dynamic modifier
+
+ include/ntp_config.h@1.38 +1 -0
+ support dynamic modifier
+
+ include/ntp_request.h@1.25 +2 -0
+ support dynamic modifier
+ add pollreset mode 7 request
+
+ include/ntpd.h@1.82.2.4 +2 -0
+ support resetting of poll interval on interface changes and manually
+
+ ntpd/ntp_config.c@1.129.2.4 +6 -0
+ support dynamic modifier
+
+ ntpd/ntp_peer.c@1.82.1.4 +96 -53
+ support dynamic modifier
+
+ ntpd/ntp_request.c@1.61 +116 -5
+ support dynamic modifier
+ support pollreset request
+
+ ntpdc/ntpdc.c@1.40.1.3 +1 -1
+ allow first argument to be optional
+
+ ntpdc/ntpdc_ops.c@1.41 +62 -1
+ support dynamic modifier
+ support pollreset request
+
+ChangeSet@1.1251.45.11, 2005-08-23 06:45:17+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ cleanup debug output handling
+
+ ntpd/ntp_io.c@1.192 +10 -5
+ cleanup debug output handling
+
+ChangeSet@1.1251.45.10, 2005-08-23 06:26:45+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ fixed crash in debug error message
+
+ ntpd/ntp_io.c@1.191 +10 -5
+ fixed crash in debug error message
+
+ChangeSet@1.1251.46.1, 2005-08-22 19:45:14-04:00, stenn@whimsy.udel.edu
+ beacon stuff from Dave Mills
+
+ include/ntp.h@1.118.2.1 +2 -1
+ beacon stuff from Dave Mills
+
+ include/ntp_config.h@1.37 +1 -0
+ beacon stuff from Dave Mills
+
+ ntpd/ntp_config.c@1.129.2.3 +9 -0
+ beacon stuff from Dave Mills
+
+ ntpd/ntp_proto.c@1.232.1.1 +26 -9
+ beacon stuff from Dave Mills
+
+ChangeSet@1.1251.45.8, 2005-08-22 22:43:21+00:00, kardel@pogo.udel.edu
+ ntp_request.c:
+ return clean 0.0.0.0 addresses while a peer has no interface
+ ntp_control.c:
+ return clean 0.0.0.0 addresses while a peer has no interface
+ ntpd.h:
+ cleanup declarations
+
+ include/ntpd.h@1.82.2.3 +1 -1
+ cleanup declarations
+
+ ntpd/ntp_control.c@1.81 +3 -0
+ return clean 0.0.0.0 addresses while a peer has no interface
+
+ ntpd/ntp_request.c@1.60 +2 -2
+ return clean 0.0.0.0 addresses while a peer has no interface
+
+ChangeSet@1.1251.45.7, 2005-08-22 21:57:08+00:00, kardel@pogo.udel.edu
+ ntp_proto.c:
+ don't attempt to transmit on peers that currently have not interface
+
+ ntpd/ntp_proto.c@1.235 +3 -0
+ don't attempt to transmit on peers that currently have not interface
+
+ChangeSet@1.1251.45.6, 2005-08-22 16:19:29+00:00, kardel@pogo.udel.edu
+ ntpdc_ops.c:
+ cleanup output format
+ add enable/disable output
+ ntp_proto.c:
+ as we are re-binding all interfaces on interface list changes a refresh on
+ transmit is not needed
+ ntp_peer.c:
+ re-bind all interfaces when the interface list changes
+ unbind interface when refclock configuration fails
+ correct setting of a new interface for a peer
+ ntp_io.c:
+ re-bind all interfaces when the interface list changes
+
+ ntpd/ntp_io.c@1.190 +12 -6
+ re-bind all interfaces when the interface list changes
+
+ ntpd/ntp_peer.c@1.82.1.3 +42 -21
+ re-bind all interfaces when the interface list changes
+ unbind interface when refclock configuration fails
+ correct setting of a new interface for a peer
+
+ ntpd/ntp_proto.c@1.234 +0 -14
+ as we are re-binding all interfaces on interface list changes a refresh on
+ transmit is not needed
+
+ ntpdc/ntpdc_ops.c@1.40 +4 -3
+ cleanup output format
+ add enable/disable output
+
+ChangeSet@1.1251.45.5, 2005-08-22 12:05:51+00:00, kardel@pogo.udel.edu
+ ntp_io.c:
+ fix list initialization for interface->peer
+ correct initizalization of loopback_interface global
+
+ ntpd/ntp_io.c@1.189 +8 -0
+ fix list initialization for interface->peer
+ correct initizalization of loopback_interface global
+
+ChangeSet@1.1251.45.4, 2005-08-21 19:22:34+00:00, kardel@pogo.udel.edu
+ ntpdc_ops.c:
+ add ifstats and ifreload commands
+ layout.std:
+ update with data structure used with ntpdc's ifstats and ifreload commands
+ ntp_debug.h:
+ new file
+ ntpd.h:
+ add support for dynamic interface updates
+ ntp_request.h:
+ define data structure needed for ntpdc's ifstats and ifreload command
+ ntp.h:
+ integrate dynamic interface update support
+ ntp_util.c:
+ prepare for exit logging - not active yet
+ ntp_timer.c:
+ add timeout routine to periodically update ntpd's interface list
+ ntp_restrict.c:
+ support forcefully removing an interface entry (dynamic interface update support)
+ ntp_request.c:
+ add ifstats and ifreload backend implementation
+ ntp_proto.c:
+ cope with peeers that have no interface
+ ntp_peer.c:
+ rework peer management to cope with dynamic interface list updates
+ ntp_monitor.c:
+ remove monitor information when an interface is removed
+ ntp_io.c:
+ rework to support dynamic interface updating
+ array inter_list[] is gone
+ reduce #ifdef DEBUG section with DPRINTF macro
+ ntp_crypto.c, ntp_control.c:
+ cope with peers having no current interface
+ cmd_args.c:
+ add "-U interface_update_interval" option
+ ntpdc.html:
+ document ifstats and ifreload commands
+ ntpd.html:
+ document dynamic interface update interval option (-U <value>)
+
+ html/ntpd.html@1.37 +3 -1
+ document dynamic interface update interval option (-U <value>)
+
+ html/ntpdc.html@1.21 +4 -0
+ document ifstats and ifreload commands
+
+ include/ntp.h@1.118.1.3 +19 -10
+ integrate dynamic interface update support
+
+ include/ntp_debug.h@1.1 +26 -0
+
+ include/ntp_debug.h@1.0 +0 -0
+ BitKeeper file /pogo/users/kardel/ntp-dev/include/ntp_debug.h
+
+ include/ntp_request.h@1.24 +38 -0
+ define data structure needed for ntpdc's ifstats and ifreload command
+
+ include/ntpd.h@1.82.2.2 +21 -7
+ add support for dynamic interface updates
+
+ ntpd/cmd_args.c@1.34.1.1 +21 -2
+ add "-U interface_update_interval" option
+
+ ntpd/ntp_control.c@1.80 +4 -2
+ cope with peers having no current interface
+
+ ntpd/ntp_crypto.c@1.97.1.1 +6 -0
+ cope with peers having no current interface
+
+ ntpd/ntp_io.c@1.188 +885 -557
+ rework to support dynamic interface updating
+ array inter_list[] is gone
+ reduce #ifdef DEBUG section with DPRINTF macro
+
+ ntpd/ntp_monitor.c@1.15.1.1 +18 -0
+ remove monitor information when an interface is removed
+
+ ntpd/ntp_peer.c@1.82.1.2 +159 -40
+ rework peer management to cope with dynamic interface list updates
+
+ ntpd/ntp_proto.c@1.233 +117 -92
+ cope with peeers that have no interface
+
+ ntpd/ntp_request.c@1.59 +145 -32
+ add ifstats and ifreload backend implementation
+
+ ntpd/ntp_restrict.c@1.18 +4 -2
+ support forcefully removing an interface entry (dynamic interface update support)
+
+ ntpd/ntp_timer.c@1.29 +16 -0
+ add timeout routine to periodically update ntpd's interface list
+
+ ntpd/ntp_util.c@1.37 +15 -3
+ prepare for exit logging - not active yet
+
+ ntpdc/layout.std@1.3 +19 -0
+ update with data structure used with ntpdc's ifstats and ifreload commands
+
+ ntpdc/ntpdc_ops.c@1.39 +125 -0
+ add ifstats and ifreload commands
+
+ChangeSet@1.1251.45.3, 2005-08-16 20:49:01-04:00, stenn@whimsy.udel.edu
+ preempt stuff from Dave Mills
+
+ include/ntp.h@1.118.1.2 +1 -2
+ preempt stuff from Dave Mills
+
+ ntpd/ntp_proto.c@1.232 +34 -45
+ preempt stuff from Dave Mills
+
+ChangeSet@1.1251.45.2, 2005-08-16 05:34:28-04:00, stenn@whimsy.udel.edu
+ [Bug 478] use "end" keyword to stop config file processing
+
+ include/ntp_config.h@1.36 +2 -1
+ [Bug 478] use "end" keyword to stop config file processing
+
+ ntpd/ntp_config.c@1.129.2.2 +9 -0
+ [Bug 478] use "end" keyword to stop config file processing
+
+ChangeSet@1.1251.45.1, 2005-08-16 02:49:46-04:00, stenn@whimsy.udel.edu
+ preempt stuff from Dave Mills
+
+ include/ntp.h@1.118.1.1 +6 -5
+ preempt stuff from Dave Mills
+
+ include/ntp_config.h@1.35 +1 -1
+ preempt stuff from Dave Mills
+
+ include/ntpd.h@1.82.2.1 +0 -1
+ preempt stuff from Dave Mills
+
+ ntpd/ntp_config.c@1.129.2.1 +3 -3
+ preempt stuff from Dave Mills
+
+ ntpd/ntp_peer.c@1.82.1.1 +5 -32
+ preempt stuff from Dave Mills
+
+ ntpd/ntp_proto.c@1.231 +69 -70
+ preempt stuff from Dave Mills
+
+ChangeSet@1.1251.44.1, 2005-08-15 19:41:00-04:00, mayer@pogo.udel.edu
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ include/ntp.h@1.119 +1 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ include/ntp_random.h@1.1 +14 -0
+
+ include/ntp_random.h@1.0 +0 -0
+ BitKeeper file /pogo/users/mayer/ntp-dev/include/ntp_random.h
+
+ include/ntpd.h@1.82.1.2 +0 -7
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ libntp/Makefile.am@1.36 +1 -1
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ libntp/ntp_random.c@1.5 +5 -2
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ libntp/ntp_random.c@1.4 +0 -0
+ Rename: libntp/random.c -> libntp/ntp_random.c
+
+ ntpd/ntp_config.c@1.129.1.2 +1 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ntpd/ntp_crypto.c@1.98 +1 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ntpd/ntp_monitor.c@1.16 +1 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ntpd/ntp_peer.c@1.83 +1 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ntpd/ntpd.c@1.61.3.1 +1 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ports/winnt/include/config.h@1.40 +1 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ports/winnt/libntp/libntp.dsp@1.26 +8 -20
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.9 +4 -0
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ ports/winnt/ntpd/ntpd.dsp@1.26 +5 -1
+ Fixes to support ntp_random on Windows and miscellaneous fixes for all platforms to get everything in the right place
+
+ChangeSet@1.1178.5.6, 2005-08-15 04:01:26-04:00, stenn@whimsy.udel.edu
+ [Bug 477] Linux needs larger RLIM_MEMLOCK, from Cristoph Gysin
+
+ ntpd/ntpd.c@1.54.1.1 +12 -0
+ [Bug 477] Linux needs larger RLIM_MEMLOCK, from Cristoph Gysin
+
+ChangeSet@1.1288, 2005-08-15 01:27:24-04:00, stenn@pogo.udel.edu
+ Merge pogo.udel.edu:/pogo/users/stenn/ntp-dev-ag
+ into pogo.udel.edu:/pogo/users/stenn/ntp-dev-ag+
+ [no longer a merge: surgery done]
+
+ChangeSet@1.1287, 2005-08-13 22:08:44-04:00, stenn@pogo.udel.edu
+ add to gone file
+
+ BitKeeper/etc/gone@1.7 +1 -0
+
+ChangeSet@1.1251.38.16, 2005-08-12 04:45:21-04:00, stenn@whimsy.udel.edu
+ preempt stuff from Dave Mills
+
+ include/ntpd.h@1.82.1.1 +2 -2
+ preempt stuff from Dave Mills
+
+ ntpd/ntp_peer.c@1.82 +10 -6
+ preempt stuff from Dave Mills
+
+ ntpd/ntp_proto.c@1.230 +18 -17
+ preempt stuff from Dave Mills
+
+ChangeSet@1.1251.38.15, 2005-08-12 04:39:52-04:00, stenn@whimsy.udel.edu
+ typo
+
+ ntpdate/Makefile.am@1.13 +1 -1
+ typo
+
+ChangeSet@1.1251.38.14, 2005-08-10 10:13:26+00:00, kardel@pogo.udel.edu
+ dcfd.c:
+ output revision information
+
+ parseutil/dcfd.c@1.17 +8 -3
+ output revision information
+
+ChangeSet@1.1251.38.12, 2005-08-10 06:50:23+00:00, kardel@pogo.udel.edu
+ dcfd.c:
+ cleanup warnings
+ fix setting of baud rate
+
+ parseutil/dcfd.c@1.16 +14 -4
+ cleanup warnings
+ fix setting of baud rate
+
+ChangeSet@1.1251.42.9, 2005-08-09 17:02:19-04:00, stenn@whimsy.udel.edu
+ cleanup, added "preempt" and "maxclock". From Dave Mills.
+
+ include/ntp.h@1.118 +19 -16
+ cleanup, added "preempt". From Dave Mills.
+
+ include/ntp_config.h@1.34 +9 -7
+ cleanup, added "preempt". From Dave Mills.
+
+ ntpd/ntp_config.c@1.129.1.1 +11 -0
+ cleanup, added "preempt" and "maxclock". From Dave Mills.
+
+ ntpd/ntp_peer.c@1.81 +6 -8
+ cleanup, added "preempt" and "maxclock". From Dave Mills.
+
+ ntpd/ntp_proto.c@1.229 +102 -130
+ cleanup, added "preempt" and "maxclock". From Dave Mills.
+
+ChangeSet@1.1285, 2005-08-08 02:53:55-04:00, stenn@pogo.udel.edu
+ autogen update and more conversion
+
+ include/ntpd.h@1.78.2.1 +0 -1
+ autogen update and more conversion
+
+ libopts/INSTALL@1.2 +8 -3
+ autogen update and more conversion
+
+ libopts/m4/compile@1.2 +4 -4
+ autogen update and more conversion
+
+ libopts/m4/config.guess@1.2 +234 -270
+ autogen update and more conversion
+
+ libopts/m4/config.sub@1.2 +13 -17
+ autogen update and more conversion
+
+ libopts/m4/depcomp@1.2 +30 -23
+ autogen update and more conversion
+
+ libopts/m4/install-sh@1.2 +3 -3
+ autogen update and more conversion
+
+ libopts/m4/ltmain.sh@1.2 +124 -222
+ autogen update and more conversion
+
+ libopts/m4/missing@1.2 +10 -6
+ autogen update and more conversion
+
+ ntpd/Makefile.am@1.42 +37 -6
+ autogen update and more conversion
+
+ ntpd/cmd_args.c@1.35 +169 -216
+ autogen update and more conversion
+
+ ntpd/ntp_config.c@1.128.1.1 +1 -3
+ autogen update and more conversion
+
+ ntpd/ntpd.c@1.66 +129 -31
+ autogen update and more conversion
+
+ ntpd/ntpsim.c@1.9.1.1 +9 -0
+ autogen update and more conversion
+
+ ntpdc/ntpdc-opts.def@1.4 +3 -3
+ autogen update and more conversion
+
+ ntpq/ntpq-opts.def@1.3 +25 -21
+ autogen update and more conversion
+
+ sntp/Makefile.am@1.7 +28 -0
+ autogen update and more conversion
+
+ sntp/configure.ac@1.9 +13 -6
+ autogen update and more conversion
+
+ChangeSet@1.1251.42.8, 2005-08-07 18:12:45-04:00, mayer@pogo.udel.edu
+ Fix check for errors when recvfrom() is used
+
+ ntpd/ntp_io.c@1.187 +4 -5
+ Fix check for errors when recvfrom() is used
+
+ChangeSet@1.1251.38.11, 2005-08-07 15:10:14+00:00, kardel@pogo.udel.edu
+ testdcf.c:
+ cleanup warnings
+ document revision on startup
+ fix setting of baud rate
+ refclock_parse.c, parse.c:
+ cleanup size handling wrt/ to buffer boundaries
+ clk_rawdcf.c:
+ clean log output
+ cleanup size handling wrt/ to buffer boundaries
+
+ libparse/clk_rawdcf.c@1.11 +44 -36
+ clean log output
+ cleanup size handling wrt/ to buffer boundaries
+
+ libparse/parse.c@1.11 +8 -5
+ cleanup size handling wrt/ to buffer boundaries
+
+ ntpd/refclock_parse.c@1.35 +7 -4
+ cleanup size handling wrt/ to buffer boundaries
+
+ parseutil/testdcf.c@1.7 +24 -7
+ cleanup warnings
+ document revision on startup
+ fix setting of baud rate
+
+ChangeSet@1.1251.42.7, 2005-08-05 19:29:48-04:00, mayer@pogo.udel.edu
+ Fix for systems that do not support MCAST
+
+ ntpd/ntp_io.c@1.186 +2 -34
+ Fix for systems that do not support MCAST
+
+ChangeSet@1.1251.42.6, 2005-08-02 23:04:57-04:00, stenn@whimsy.udel.edu
+ Lose UDP_WILDCARD_DELIVERY
+
+ TODO@1.8 +0 -2
+ Lose UDP_WILDCARD_DELIVERY
+
+ configure.ac@1.359.1.17 +0 -60
+ Lose UDP_WILDCARD_DELIVERY
+
+ include/ntp_machine.h@1.20 +0 -5
+ Lose UDP_WILDCARD_DELIVERY
+
+ ports/winnt/include/config.h@1.39 +0 -1
+ Lose UDP_WILDCARD_DELIVERY
+
+ChangeSet@1.1251.42.5, 2005-08-02 21:48:09-04:00, stenn@whimsy.udel.edu
+ Another RANDOM -> ntp_random()
+
+ libntp/systime.c@1.34 +2 -1
+ Another RANDOM -> ntp_random()
+
+ChangeSet@1.1251.42.4, 2005-08-02 20:19:27-04:00, stenn@whimsy.udel.edu
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ BitKeeper/deleted/.del-ranny.c~3e480692@1.4 +0 -0
+ Delete: libntp/ranny.c
+
+ configure.ac@1.359.1.16 +1 -11
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ include/l_stdlib.h@1.15 +0 -13
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ include/ntp.h@1.117 +1 -9
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ include/ntp_machine.h@1.19 +0 -2
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ include/ntpd.h@1.82 +3 -0
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ libntp/Makefile.am@1.35 +2 -2
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ libntp/random.c@1.3 +9 -9
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ ntpd/ntp_config.c@1.129 +1 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ ntpd/ntp_crypto.c@1.97 +1 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ ntpd/ntp_monitor.c@1.15 +2 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ ntpd/ntp_peer.c@1.80 +1 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ ntpd/ntp_proto.c@1.228 +1 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ ntpd/ntpd.c@1.61.1.9 +1 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ ntpd/ntpsim.c@1.11 +1 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ util/Makefile.am@1.26 +1 -1
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ util/ntp-keygen.c@1.32 +2 -2
+ libntp/random.c now always provides ntp_[s]random(). Use them instead of RANDOM and SRANDOM.
+
+ChangeSet@1.1251.43.3, 2005-08-02 03:45:25-04:00, stenn@whimsy.udel.edu
+ Make it easy to distinguish -stable and -dev snapshots
+
+ version.m4@1.3 +1 -1
+ Make it easy to distinguish -stable and -dev snapshots
+
+ChangeSet@1.1251.43.2, 2005-08-02 03:25:30-04:00, stenn@whimsy.udel.edu
+ Lose libntp/ranny.c
+
+ include/ntp_stdlib.h@1.22 +0 -1
+ Lose libntp/ranny.c
+
+ libntp/Makefile.am@1.34 +1 -1
+ Lose libntp/ranny.c
+
+ libntp/systime.c@1.33 +3 -1
+ Lose libntp/ranny.c
+
+ ntpd/ntp_peer.c@1.76.1.2 +1 -3
+ Lose libntp/ranny.c
+
+ ntpd/ntpd.c@1.61.1.8 +0 -1
+ Lose libntp/ranny.c
+
+ ntpd/ntpsim.c@1.10 +0 -1
+ Lose libntp/ranny.c
+
+ChangeSet@1.1251.43.1, 2005-08-01 19:40:14-04:00, stenn@whimsy.udel.edu
+ Dave Mills: change findpeer(), other cleanup
+
+ include/ntpd.h@1.79.1.1 +1 -1
+ Dave Mills: change findpeer()
+
+ ntpd/ntp_peer.c@1.76.1.1 +0 -4
+ Dave Mills: change findpeer()
+
+ ntpd/ntp_proto.c@1.227 +4 -4
+ Dave Mills: change findpeer(), other cleanup
+
+ChangeSet@1.1251.41.2, 2005-08-01 12:36:38-04:00, mayer@pogo.udel.edu
+ Missing break in switch selection
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.16 +1 -48
+ Missing break in switch selection
+
+ChangeSet@1.1251.41.1, 2005-08-01 12:34:24-04:00, mayer@pogo.udel.edu
+ Enable IPv6 multicast interface
+
+ include/ntpd.h@1.78.1.1 +1 -0
+ Enable IPv6 multicast interface
+
+ ntpd/ntp_io.c@1.185 +61 -2
+ Enable IPv6 multicast interface
+
+ ntpd/ntp_peer.c@1.77 +14 -3
+ Enable IPv6 multicast interface
+
+ChangeSet@1.1251.40.1, 2005-07-27 21:25:59+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ fix a long (> 11 years) misconfiguration wrt/ Meinberg cflag factory
+ default setup. CSTOPB was missing for the 7E2 default data format of
+ the DCF77 clocks.
+
+ ntpd/refclock_parse.c@1.34 +9 -4
+ fix a long (> 11 years) misconfiguration wrt/ Meinberg cflag factory
+ default setup. CSTOPB was missing for the 7E2 default data format of
+ the DCF77 clocks.
+
+ChangeSet@1.1251.38.7, 2005-07-25 12:46:00-04:00, mayer@pogo.udel.edu
+ Always provide the addr_ismulticast function
+
+ ntpd/ntp_io.c@1.184 +1 -1
+ Always provide the addr_ismulticast function
+
+ChangeSet@1.1251.38.6, 2005-07-24 16:41:43-04:00, mayer@pogo.udel.edu
+ Fix isaddr_multicast to not be dependent on whether or not MCAST is supported
+
+ ntpd/ntp_io.c@1.183 +5 -5
+ Fix isaddr_multicast to not be dependent on whether or not MCAST is supported
+
+ChangeSet@1.1251.38.5, 2005-07-24 15:50:24-04:00, mayer@pogo.udel.edu
+ Revamp of I/O Completion ports for Windows
+
+ include/recvbuff.h@1.9 +0 -2
+ Revamp of I/O Completion ports for Windows
+
+ libntp/recvbuff.c@1.11 +22 -17
+ Revamp of I/O Completion ports for Windows
+
+ ports/winnt/include/ntp_iocompletionport.h@1.9 +16 -3
+ Revamp of I/O Completion ports for Windows
+
+ ports/winnt/include/transmitbuff.h@1.4 +4 -14
+ Revamp of I/O Completion ports for Windows
+
+ ports/winnt/libntp/transmitbuff.c@1.5 +113 -43
+ Revamp of I/O Completion ports for Windows
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.18 +1 -1
+ Revamp of I/O Completion ports for Windows
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.15 +182 -61
+ Revamp of I/O Completion ports for Windows
+
+ChangeSet@1.1251.39.4, 2005-07-22 20:32:47-04:00, stenn@pogo.udel.edu
+ Remove binio.c,gpstolfp.c,ieee754io.c,mfp_mul.c from libntp.a
+
+ libntp/Makefile.am@1.33 +4 -4
+ Remove binio.c,gpstolfp.c,ieee754io.c,mfp_mul.c from libntp.a
+
+ChangeSet@1.1251.39.3, 2005-07-21 19:43:37+00:00, kardel@pogo.udel.edu
+ Makefile.am:
+ support is gone - overaged files
+ .del-sun4.sun4m~3e480692:
+ Delete: scripts/support/conf/sun4.sun4m
+ .del-sun4.sun4m.faui45m~3e480692:
+ Delete: scripts/support/conf/sun4.sun4m.faui45m
+ .del-sun4.sun4m.faui42~3e480692:
+ Delete: scripts/support/conf/sun4.sun4m.faui42
+ .del-sun4.sun4c~3e480692:
+ Delete: scripts/support/conf/sun4.sun4c
+ .del-sun4.sun4c.Lucifer~3e480692:
+ Delete: scripts/support/conf/sun4.sun4c.Lucifer
+ .del-sun4.sun4.faui45~3e480692:
+ Delete: scripts/support/conf/sun4.sun4.faui45
+ .del-sun4.sun4.faui10~3e480692:
+ Delete: scripts/support/conf/sun4.sun4.faui10
+ .del-sun4.sun4.faui01~3e480692:
+ Delete: scripts/support/conf/sun4.sun4.faui01
+ .del-sun3.sun3~3e480692:
+ Delete: scripts/support/conf/sun3.sun3
+ .del-hp800.hp800~3e480692:
+ Delete: scripts/support/conf/hp800.hp800
+ .del-hp700.hp700~3e480692:
+ Delete: scripts/support/conf/hp700.hp700
+ .del-hp700.hp700.faui47~3e480692:
+ Delete: scripts/support/conf/hp700.hp700.faui47
+ .del-hp300.hp300~3e480692:
+ Delete: scripts/support/conf/hp300.hp300
+ refclock_parse.c:
+ fix bug 455: tripping over NULL pointer on cleanup
+ fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2
+ fix compiler warnings for some platforms wrt/ printf formatstrings and
+ varying structure element sizes
+ reorder assignment in binding to avoid tripping over NULL pointers
+ change contents of version string to include the RCS/CVS Id
+ mfp_mul.c:
+ correct carry propagation implementation
+ Makefile.am:
+ move binio.c, ieee754io.c into libparse
+ .del-setup~3e480692:
+ Delete: scripts/support/etc/setup
+ .del-rc~3e480692:
+ Delete: scripts/support/etc/rc
+ .del-install~3e480692:
+ Delete: scripts/support/etc/install
+ .del-crontab~3e480692:
+ Delete: scripts/support/etc/crontab
+ .del-cron~3e480692:
+ Delete: scripts/support/etc/cron
+ .del-tickconf~3e480692:
+ Delete: scripts/support/conf/tickconf
+ .del-ntp.conf~3e480692:
+ Delete: scripts/support/conf/ntp.conf
+ .del-mvstats~3e480692:
+ Delete: scripts/support/bin/mvstats
+ .del-monl~3e480692:
+ Delete: scripts/support/bin/monl
+ .del-README~3e480692:
+ Delete: scripts/support/README
+ ieee754io.c:
+ Rename: libntp/ieee754io.c -> libparse/ieee754io.c
+ binio.c:
+ Rename: libntp/binio.c -> libparse/binio.c
+ gpstolfp.c:
+ Rename: libntp/gpstolfp.c -> libparse/gpstolfp.c
+ mfp_mul.c:
+ Rename: libntp/mfp_mul.c -> libparse/mfp_mul.c
+
+ BitKeeper/deleted/.del-README~3e480692@1.3 +0 -73
+ Delete: scripts/support/README
+
+ BitKeeper/deleted/.del-crontab~3e480692@1.3 +0 -8
+ Delete: scripts/support/etc/crontab
+
+ BitKeeper/deleted/.del-cron~3e480692@1.3 +0 -18
+ Delete: scripts/support/etc/cron
+
+ BitKeeper/deleted/.del-hp300.hp300~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/hp300.hp300
+
+ BitKeeper/deleted/.del-hp700.hp700.faui47~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/hp700.hp700.faui47
+
+ BitKeeper/deleted/.del-hp700.hp700~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/hp700.hp700
+
+ BitKeeper/deleted/.del-hp800.hp800~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/hp800.hp800
+
+ BitKeeper/deleted/.del-install~3e480692@1.3 +0 -67
+ Delete: scripts/support/etc/install
+
+ BitKeeper/deleted/.del-monl~3e480692@1.3 +0 -213
+ Delete: scripts/support/bin/monl
+
+ BitKeeper/deleted/.del-mvstats~3e480692@1.3 +0 -23
+ Delete: scripts/support/bin/mvstats
+
+ BitKeeper/deleted/.del-ntp.conf~3e480692@1.3 +0 -3
+ Delete: scripts/support/conf/ntp.conf
+
+ BitKeeper/deleted/.del-rc~3e480692@1.3 +0 -198
+ Delete: scripts/support/etc/rc
+
+ BitKeeper/deleted/.del-setup~3e480692@1.3 +0 -72
+ Delete: scripts/support/etc/setup
+
+ BitKeeper/deleted/.del-sun3.sun3~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun3.sun3
+
+ BitKeeper/deleted/.del-sun4.sun4.faui01~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4.faui01
+
+ BitKeeper/deleted/.del-sun4.sun4.faui10~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4.faui10
+
+ BitKeeper/deleted/.del-sun4.sun4.faui45~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4.faui45
+
+ BitKeeper/deleted/.del-sun4.sun4c.Lucifer~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4c.Lucifer
+
+ BitKeeper/deleted/.del-sun4.sun4c~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4c
+
+ BitKeeper/deleted/.del-sun4.sun4m.faui42~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4m.faui42
+
+ BitKeeper/deleted/.del-sun4.sun4m.faui45m~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4m.faui45m
+
+ BitKeeper/deleted/.del-sun4.sun4m~3e480692@1.3 +0 -0
+ Delete: scripts/support/conf/sun4.sun4m
+
+ BitKeeper/deleted/.del-tickconf~3e480692@1.3 +0 -19
+ Delete: scripts/support/conf/tickconf
+
+ libparse/Makefile.am@1.8 +23 -2
+ move binio.c, ieee754io.c into libparse
+
+ libparse/binio.c@1.6 +0 -0
+ Rename: libntp/binio.c -> libparse/binio.c
+
+ libparse/gpstolfp.c@1.8 +0 -0
+ Rename: libntp/gpstolfp.c -> libparse/gpstolfp.c
+
+ libparse/ieee754io.c@1.8 +0 -0
+ Rename: libntp/ieee754io.c -> libparse/ieee754io.c
+
+ libparse/mfp_mul.c@1.7 +42 -11
+ correct carry propagation implementation
+
+ libparse/mfp_mul.c@1.6 +0 -0
+ Rename: libntp/mfp_mul.c -> libparse/mfp_mul.c
+
+ ntpd/refclock_parse.c@1.33 +41 -33
+ fix bug 455: tripping over NULL pointer on cleanup
+ fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2
+ fix compiler warnings for some platforms wrt/ printf formatstrings and
+ varying structure element sizes
+ reorder assignment in binding to avoid tripping over NULL pointers
+ change contents of version string to include the RCS/CVS Id
+
+ scripts/Makefile.am@1.12 +1 -1
+ support is gone - overaged files
+
+ChangeSet@1.1178.5.5, 2005-07-19 21:21:45-04:00, stenn@whimsy.udel.edu
+ FreeBSD porting issues
+
+ Makefile.am@1.46.1.1 +5 -5
+ FreeBSD porting issues
+
+ ntpdc/ntpdc.c@1.33.2.1 +5 -1
+ FreeBSD porting issues
+
+ ntpq/ntpq.c@1.48.2.1 +5 -1
+ FreeBSD porting issues
+
+ChangeSet@1.1178.5.4, 2005-07-19 21:20:36-04:00, stenn@whimsy.udel.edu
+ [Bug 466] Fix compilation under gcc4
+
+ include/ntp_control.h@1.25.1.1 +1 -0
+ [Bug 466] Fix compilation under gcc4
+
+ include/ntp_refclock.h@1.15.1.1 +1 -0
+ [Bug 466] Fix compilation under gcc4
+
+ include/ntp_stdlib.h@1.21 +0 -4
+ [Bug 466] Fix compilation under gcc4
+
+ include/ntpd.h@1.66.1.1 +0 -2
+ [Bug 466] Fix compilation under gcc4
+
+ChangeSet@1.1178.5.3, 2005-07-19 20:13:43-04:00, stenn@whimsy.udel.edu
+ [Bug 464] building ntp with debugging disabled fails
+
+ ntpd/ntp_proto.c@1.179.1.1 +1 -1
+ [Bug 464] building ntp with debugging disabled fails
+
+ChangeSet@1.1251.38.4, 2005-07-16 17:30:55-04:00, mayer@pogo.udel.edu
+ Add debug code to print the broadcast interface used
+
+ ntpd/ntp_peer.c@1.76 +5 -0
+ Add debug code to print the broadcast interface used
+
+ChangeSet@1.1251.38.3, 2005-07-16 17:29:55-04:00, mayer@pogo.udel.edu
+ Fix read loop to skip out if nothing to do and not complain about it
+
+ ntpd/ntp_io.c@1.182 +143 -146
+ Fix read loop to skip out if nothing to do and not complain about it
+
+ChangeSet@1.1283, 2005-07-04 04:15:16-04:00, stenn@pogo.udel.edu
+ New libopts
+
+ Makefile.am@1.51 +2 -2
+ Cleanup
+
+ configure.ac@1.371 +2 -0
+ Cleanup
+
+ libopts/AUTHORS@1.1 +2 -0
+
+ libopts/AUTHORS@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/AUTHORS
+
+ libopts/COPYING@1.1 +502 -0
+
+ libopts/COPYING@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING
+
+ libopts/COPYING.lgpl@1.1 +502 -0
+
+ libopts/COPYING.lgpl@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.lgpl
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.mbsd
+
+ libopts/ChangeLog@1.1 +4 -0
+
+ libopts/ChangeLog@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/ChangeLog
+
+ libopts/INSTALL@1.1 +231 -0
+
+ libopts/INSTALL@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/INSTALL
+
+ libopts/MakeDefs.inc@1.1 +5 -0
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/MakeDefs.inc
+
+ libopts/Makefile.am@1.1 +4 -0
+
+ libopts/Makefile.am@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/Makefile.am
+
+ libopts/NEWS@1.1 +6 -0
+
+ libopts/NEWS@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/NEWS
+
+ libopts/README@1.1 +2 -0
+
+ libopts/README@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/README
+
+ libopts/aclocal.m4@1.1 +6827 -0
+
+ libopts/aclocal.m4@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/aclocal.m4
+
+ libopts/autoopts.c@1.1 +1033 -0
+
+ libopts/autoopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.c
+
+ libopts/autoopts.h@1.1 +337 -0
+
+ libopts/autoopts.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.h
+
+ libopts/autoopts/options.h@1.1 +864 -0
+
+ libopts/autoopts/options.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts/options.h
+
+ libopts/autoopts/usage-txt.h@1.1 +479 -0
+
+ libopts/autoopts/usage-txt.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts/usage-txt.h
+
+ libopts/boolean.c@1.1 +102 -0
+
+ libopts/boolean.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/boolean.c
+
+ libopts/bootstrap@1.1 +34 -0
+
+ libopts/bootstrap@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/bootstrap
+
+ libopts/compat/compat.h@1.1 +249 -0
+
+ libopts/compat/compat.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/compat.h
+
+ libopts/compat/pathfind.c@1.1 +332 -0
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/pathfind.c
+
+ libopts/config-h.in@1.1 +140 -0
+
+ libopts/config-h.in@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/config-h.in
+
+ libopts/config-h.in~@1.1 +236 -0
+
+ libopts/config-h.in~@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/config-h.in~
+
+ libopts/configfile.c@1.1 +1282 -0
+
+ libopts/configfile.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/configfile.c
+
+ libopts/configure@1.1 +23905 -0
+
+ libopts/configure@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/configure
+
+ libopts/configure.ac@1.1 +54 -0
+
+ libopts/configure.ac@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/configure.ac
+
+ libopts/cook.c@1.1 +355 -0
+
+ libopts/cook.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/cook.c
+
+ libopts/enumeration.c@1.1 +449 -0
+
+ libopts/enumeration.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/enumeration.c
+
+ libopts/environment.c@1.1 +261 -0
+
+ libopts/environment.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/environment.c
+
+ libopts/genshell.c@1.1 +300 -0
+
+ libopts/genshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.c
+
+ libopts/genshell.h@1.1 +143 -0
+
+ libopts/genshell.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.h
+
+ libopts/libopts.c@1.1 +29 -0
+
+ libopts/libopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.c
+
+ libopts/libopts.m4@1.1 +387 -0
+
+ libopts/libopts.m4@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.m4
+
+ libopts/libopts/Makefile.am@1.1 +12 -0
+
+ libopts/libopts/Makefile.am@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/Makefile.am
+
+ libopts/libopts/autoopts.c@1.1 +1033 -0
+
+ libopts/libopts/autoopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/autoopts.c
+
+ libopts/libopts/autoopts.h@1.1 +337 -0
+
+ libopts/libopts/autoopts.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/autoopts.h
+
+ libopts/libopts/boolean.c@1.1 +102 -0
+
+ libopts/libopts/boolean.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/boolean.c
+
+ libopts/libopts/configfile.c@1.1 +1282 -0
+
+ libopts/libopts/configfile.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/configfile.c
+
+ libopts/libopts/cook.c@1.1 +355 -0
+
+ libopts/libopts/cook.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/cook.c
+
+ libopts/libopts/enumeration.c@1.1 +449 -0
+
+ libopts/libopts/enumeration.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/enumeration.c
+
+ libopts/libopts/environment.c@1.1 +261 -0
+
+ libopts/libopts/environment.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/environment.c
+
+ libopts/libopts/genshell.c@1.1 +300 -0
+
+ libopts/libopts/genshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/genshell.c
+
+ libopts/libopts/genshell.h@1.1 +143 -0
+
+ libopts/libopts/genshell.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/genshell.h
+
+ libopts/libopts/libopts.c@1.1 +29 -0
+
+ libopts/libopts/libopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/libopts.c
+
+ libopts/libopts/load.c@1.1 +470 -0
+
+ libopts/libopts/load.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/load.c
+
+ libopts/libopts/makeshell.c@1.1 +1100 -0
+
+ libopts/libopts/makeshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/makeshell.c
+
+ libopts/libopts/nested.c@1.1 +707 -0
+
+ libopts/libopts/nested.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/nested.c
+
+ libopts/libopts/numeric.c@1.1 +89 -0
+
+ libopts/libopts/numeric.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/numeric.c
+
+ libopts/libopts/pgusage.c@1.1 +154 -0
+
+ libopts/libopts/pgusage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/pgusage.c
+
+ libopts/libopts/proto.h@1.1 +124 -0
+
+ libopts/libopts/proto.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/proto.h
+
+ libopts/libopts/putshell.c@1.1 +333 -0
+
+ libopts/libopts/putshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/putshell.c
+
+ libopts/libopts/restore.c@1.1 +207 -0
+
+ libopts/libopts/restore.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/restore.c
+
+ libopts/libopts/save.c@1.1 +499 -0
+
+ libopts/libopts/save.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/save.c
+
+ libopts/libopts/sort.c@1.1 +369 -0
+
+ libopts/libopts/sort.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/sort.c
+
+ libopts/libopts/stack.c@1.1 +224 -0
+
+ libopts/libopts/stack.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/stack.c
+
+ libopts/libopts/streqvcmp.c@1.1 +292 -0
+
+ libopts/libopts/streqvcmp.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/streqvcmp.c
+
+ libopts/libopts/text_mmap.c@1.1 +312 -0
+
+ libopts/libopts/text_mmap.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/text_mmap.c
+
+ libopts/libopts/tokenize.c@1.1 +322 -0
+
+ libopts/libopts/tokenize.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/tokenize.c
+
+ libopts/libopts/usage.c@1.1 +651 -0
+
+ libopts/libopts/usage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/usage.c
+
+ libopts/libopts/version.c@1.1 +177 -0
+
+ libopts/libopts/version.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts/version.c
+
+ libopts/load.c@1.1 +470 -0
+
+ libopts/load.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/load.c
+
+ libopts/m4/compile@1.1 +142 -0
+
+ libopts/m4/compile@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/compile
+
+ libopts/m4/config.guess@1.1 +1495 -0
+
+ libopts/m4/config.guess@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/config.guess
+
+ libopts/m4/config.sub@1.1 +1570 -0
+
+ libopts/m4/config.sub@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/config.sub
+
+ libopts/m4/depcomp@1.1 +522 -0
+
+ libopts/m4/depcomp@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/depcomp
+
+ libopts/m4/install-sh@1.1 +323 -0
+
+ libopts/m4/install-sh@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/install-sh
+
+ libopts/m4/libopts.m4@1.1 +331 -0
+
+ libopts/m4/libopts.m4@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/libopts.m4
+
+ libopts/m4/ltmain.sh@1.1 +6500 -0
+
+ libopts/m4/ltmain.sh@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/ltmain.sh
+
+ libopts/m4/missing@1.1 +353 -0
+
+ libopts/m4/missing@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/m4/missing
+
+ libopts/makeshell.c@1.1 +1100 -0
+
+ libopts/makeshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/makeshell.c
+
+ libopts/nested.c@1.1 +707 -0
+
+ libopts/nested.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/nested.c
+
+ libopts/numeric.c@1.1 +89 -0
+
+ libopts/numeric.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/numeric.c
+
+ libopts/pgusage.c@1.1 +154 -0
+
+ libopts/pgusage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/pgusage.c
+
+ libopts/proto.h@1.1 +124 -0
+
+ libopts/proto.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/proto.h
+
+ libopts/putshell.c@1.1 +333 -0
+
+ libopts/putshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/putshell.c
+
+ libopts/restore.c@1.1 +207 -0
+
+ libopts/restore.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/restore.c
+
+ libopts/save.c@1.1 +499 -0
+
+ libopts/save.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/save.c
+
+ libopts/sort.c@1.1 +369 -0
+
+ libopts/sort.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/sort.c
+
+ libopts/stack.c@1.1 +224 -0
+
+ libopts/stack.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/stack.c
+
+ libopts/streqvcmp.c@1.1 +292 -0
+
+ libopts/streqvcmp.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/streqvcmp.c
+
+ libopts/text_mmap.c@1.1 +312 -0
+
+ libopts/text_mmap.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/text_mmap.c
+
+ libopts/tokenize.c@1.1 +322 -0
+
+ libopts/tokenize.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/tokenize.c
+
+ libopts/usage.c@1.1 +651 -0
+
+ libopts/usage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/usage.c
+
+ libopts/version.c@1.1 +177 -0
+
+ libopts/version.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/version.c
+
+ ntpdc/ntpdc-opts.def@1.3 +22 -7
+ Cleanup
+
+ ntpq/ntpq-opts.def@1.2 +242 -5
+ Cleanup
+
+ChangeSet@1.1282, 2005-07-04 02:40:36-04:00, stenn@pogo.udel.edu
+ Remove old libopts/
+
+ BitKeeper/deleted/.del-COPYING.lgpl~446c1c486f21fd2e@1.2 +0 -0
+ Delete: libopts/COPYING.lgpl
+
+ BitKeeper/deleted/.del-COPYING.mbsd~7a99797cacd53056@1.2 +0 -0
+ Delete: libopts/COPYING.mbsd
+
+ BitKeeper/deleted/.del-MakeDefs.inc~159b003e2ec363b5@1.2 +0 -0
+ Delete: libopts/MakeDefs.inc
+
+ BitKeeper/deleted/.del-Makefile.am~fbc0c90887a6abe1@1.3 +0 -0
+ Delete: libopts/Makefile.am
+
+ BitKeeper/deleted/.del-README~863ded79da7cd04e@1.2 +0 -0
+ Delete: libopts/README
+
+ BitKeeper/deleted/.del-autoopts.c~8d508a4c6d6337a8@1.3 +0 -0
+ Delete: libopts/autoopts.c
+
+ BitKeeper/deleted/.del-autoopts.h~24ccfda237b1a4e4@1.3 +0 -0
+ Delete: libopts/autoopts.h
+
+ BitKeeper/deleted/.del-boolean.c~76d65cce6791b639@1.3 +0 -0
+ Delete: libopts/boolean.c
+
+ BitKeeper/deleted/.del-compat.h~b5311be51765bbc8@1.3 +0 -0
+ Delete: libopts/compat/compat.h
+
+ BitKeeper/deleted/.del-enumeration.c~406a20f27bb1e70b@1.3 +0 -0
+ Delete: libopts/enumeration.c
+
+ BitKeeper/deleted/.del-environment.c~cb6a850da6dc34bd@1.3 +0 -0
+ Delete: libopts/environment.c
+
+ BitKeeper/deleted/.del-genshell.c~f2627aa3ed9ec273@1.3 +0 -0
+ Delete: libopts/genshell.c
+
+ BitKeeper/deleted/.del-genshell.h~e70a6981bf25d8d7@1.3 +0 -0
+ Delete: libopts/genshell.h
+
+ BitKeeper/deleted/.del-libopts.c~48986232bbeb4a0@1.2 +0 -0
+ Delete: libopts/libopts.c
+
+ BitKeeper/deleted/.del-libopts.m4~b877c4d87dcb4b42@1.3 +0 -0
+ Delete: libopts/libopts.m4
+
+ BitKeeper/deleted/.del-load.c~ac03722a64c7070c@1.3 +0 -0
+ Delete: libopts/load.c
+
+ BitKeeper/deleted/.del-makeshell.c~83bda01ad08e7d2@1.3 +0 -0
+ Delete: libopts/makeshell.c
+
+ BitKeeper/deleted/.del-numeric.c~fb3a05758eeebb76@1.3 +0 -0
+ Delete: libopts/numeric.c
+
+ BitKeeper/deleted/.del-options.h~21d498cf4fa940d7@1.3 +0 -0
+ Delete: libopts/options.h
+
+ BitKeeper/deleted/.del-pathfind.c~f2717c337308e580@1.3 +0 -0
+ Delete: libopts/compat/pathfind.c
+
+ BitKeeper/deleted/.del-pgusage.c~a02c107578a438f@1.3 +0 -0
+ Delete: libopts/pgusage.c
+
+ BitKeeper/deleted/.del-putshell.c~cc1d047a2bea9716@1.3 +0 -0
+ Delete: libopts/putshell.c
+
+ BitKeeper/deleted/.del-restore.c~9b4b04133eb12966@1.3 +0 -0
+ Delete: libopts/restore.c
+
+ BitKeeper/deleted/.del-save.c~d8aaf91115194b06@1.3 +0 -0
+ Delete: libopts/save.c
+
+ BitKeeper/deleted/.del-sort.c~a3a8ea89587b8a4@1.3 +0 -0
+ Delete: libopts/sort.c
+
+ BitKeeper/deleted/.del-stack.c~b43aa38ab8b08c0d@1.3 +0 -0
+ Delete: libopts/stack.c
+
+ BitKeeper/deleted/.del-streqv.h~961ec0971a342cd6@1.3 +0 -0
+ Delete: libopts/streqv.h
+
+ BitKeeper/deleted/.del-streqvcmp.c~7ef8826c4cd9bd3f@1.3 +0 -0
+ Delete: libopts/streqvcmp.c
+
+ BitKeeper/deleted/.del-tokenize.c~7729f53ebb45f578@1.2 +0 -0
+ Delete: libopts/tokenize.c
+
+ BitKeeper/deleted/.del-tokenize.h~cabedf7f2026e66@1.2 +0 -0
+ Delete: libopts/tokenize.h
+
+ BitKeeper/deleted/.del-usage-txt.h~53df7a61187840e9@1.3 +0 -0
+ Delete: libopts/usage-txt.h
+
+ BitKeeper/deleted/.del-usage.c~d5db6221d54a6f45@1.3 +0 -0
+ Delete: libopts/usage.c
+
+ BitKeeper/deleted/.del-version.c~39f34e94894b40d2@1.3 +0 -0
+ Delete: libopts/version.c
+
+ChangeSet@1.1251.38.2, 2005-07-03 08:30:38-04:00, mayer@pogo.udel.edu
+ Additional IPv6 multicasting fixes and fix for size of default_ai_family
+
+ ntpd/ntp_config.c@1.128 +3 -7
+ Fix the size of default_ai_family which should have been short
+
+ ntpd/ntp_io.c@1.181 +32 -10
+ Additional fixes for IPv6 multicasting
+
+ChangeSet@1.1178.5.2, 2005-07-03 01:54:05-04:00, stenn@whimsy.udel.edu
+ Change from openlogging to a list at ntp.isc.org
+
+ BitKeeper/etc/config@1.7 +2 -1
+ Change from openlogging to a list at ntp.isc.org
+
+ChangeSet@1.1251.36.5, 2005-07-01 10:42:55+02:00, claas@nixfix.(none)
+ refclock_neoclock4x.c:
+ solve AIX problems
+
+ ntpd/refclock_neoclock4x.c@1.12 +65 -6
+ solve AIX problems
+
+ChangeSet@1.1251.36.4, 2005-06-29 04:31:59-04:00, stenn@whimsy.udel.edu
+ VxWorks cleanup
+
+ ntpq/ntpq.c@1.55.1.3 +4 -3
+ VxWorks cleanup
+
+ChangeSet@1.1251.37.1, 2005-06-28 20:30:44-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.225 +4 -2
+ Cleanup from Dave Mills
+
+ChangeSet@1.1251.36.1, 2005-06-28 04:28:30-04:00, stenn@whimsy.udel.edu
+ Only look for sys/sched.h if sched.h is not found
+
+ configure.ac@1.359.1.15 +5 -1
+ Only look for sys/sched.h if sched.h is not found
+
+ChangeSet@1.1251.35.1, 2005-06-27 03:23:38-04:00, stenn@whimsy.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.108 +2 -3
+ Fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.224 +1 -1
+ Fixes from Dave Mills
+
+ChangeSet@1.1251.1.129, 2005-06-26 12:34:11-04:00, mayer@pogo.udel.edu
+ Added MULTICAST_NONEWSOCKET to configuration, Windows doesn't allow separate socket for multicast
+
+ ports/winnt/include/config.h@1.38 +5 -3
+ Added MULTICAST_NONEWSOCKET to configuration, Windows doesn't allow separate socket for multicast
+
+ChangeSet@1.1251.1.127, 2005-06-25 22:13:01-04:00, mayer@pogo.udel.edu
+ Fixes for IPv6 multicast at least for FreeBSD
+
+ ntpd/ntp_io.c@1.180 +162 -34
+ Fixes for IPv6 multicast at least for FreeBSD
+
+ChangeSet@1.1251.33.8, 2005-06-25 21:28:14+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ fix acceptance of clocks unsync clocks right at start
+ change status reporting to use fixed refclock_report()
+ clarify trust logic
+ collect samples only if samples are ok (sync or trusted flywheel)
+ propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
+ en- and dis-able HARDPPS in correlation to receiver sync state
+ sort out log output sequence
+ ntp_refclock.c:
+ complete event to statistic mapping
+ make refclock_report to follow RFC1305 rules for clock.status
+ and event reporting
+ parsestreams.h:
+ update copyright
+ parse_conf.h, parse.h, mbg_gps166.h:
+ add missing log keywords
+ driver8.html:
+ anonymize version number in sample output
+
+ html/drivers/driver8.html@1.17 +1 -1
+ anonymize version number in sample output
+
+ include/mbg_gps166.h@1.5 +7 -2
+ add missing log keywords
+
+ include/parse.h@1.7 +6 -3
+ add missing log keywords
+
+ include/parse_conf.h@1.5 +12 -3
+ add missing log keywords
+
+ kernel/sys/parsestreams.h@1.7 +33 -9
+ update copyright
+
+ ntpd/ntp_refclock.c@1.71 +36 -8
+ complete event to statistic mapping
+ make refclock_report to follow RFC1305 rules for clock.status
+ and event reporting
+
+ ntpd/refclock_parse.c@1.32 +152 -103
+ fix acceptance of clocks unsync clocks right at start
+ change status reporting to use fixed refclock_report()
+ clarify trust logic
+ collect samples only if samples are ok (sync or trusted flywheel)
+ propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
+ en- and dis-able HARDPPS in correlation to receiver sync state
+ sort out log output sequence
+
+ChangeSet@1.1251.33.7, 2005-06-23 21:24:16-04:00, stenn@whimsy.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.70 +8 -2
+ Fixes from Dave Mills
+
+ChangeSet@1.1251.33.6, 2005-06-23 21:20:53-04:00, stenn@whimsy.udel.edu
+ Bump NBUF to 80k. From Dave Mills
+
+ util/jitter.c@1.8 +1 -1
+ Bump NBUF to 80k. From Dave Mills
+
+ChangeSet@1.1251.33.5, 2005-06-14 00:56:12-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.69 +0 -1
+ Changes from Dave Mills
+
+ChangeSet@1.1251.33.4, 2005-06-11 02:35:12-04:00, stenn@whimsy.udel.edu
+ [Bug 448] want_getifaddrs typo fix (from Enrique Perez-Terron)
+
+ configure.ac@1.359.1.14 +1 -1
+ [Bug 448] want_getifaddrs typo fix (from Enrique Perez-Terron)
+
+ChangeSet@1.1251.34.1, 2005-06-09 21:42:42-04:00, stenn@whimsy.udel.edu
+ [Bug 447] typo in ntpq.html
+
+ html/ntpq.html@1.26 +2 -2
+ [Bug 447] typo in ntpq.html
+
+ChangeSet@1.1251.33.2, 2005-05-30 13:17:56+02:00, martin@pc-martin4.
+ Added SIZEOF_TIME_T for Windows.
+
+ BitKeeper/etc/logging_ok@1.54 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ports/winnt/include/config.h@1.37 +1 -0
+ Added SIZEOF_TIME_T for Windows.
+
+ChangeSet@1.1251.33.1, 2005-05-30 01:02:52-04:00, stenn@whimsy.udel.edu
+ [Bug 434] Fix from Dave Mills
+
+ ntpd/ntp_refclock.c@1.68 +0 -3
+ [Bug 434] Fix from Dave Mills
+
+ChangeSet@1.1251.26.19, 2005-05-28 06:27:19-04:00, stenn@pogo.udel.edu
+ Cleanup building of parse clocks
+
+ configure.ac@1.359.1.12 +3 -2
+ Cleanup building of parse clocks
+
+ChangeSet@1.1251.26.18, 2005-05-28 10:13:03+00:00, kardel@pogo.udel.edu
+ ntp_refclock.c:
+ We know that peer_leap can be LEAPNOTINSYNC from startup (peer_clear when
+ FLAG_REFCLOCK is not set yet) or when copied from pp->leap.
+ Thus interrogating peer->leap only gives a a false refclock_report from
+ initialization. False in that respect that new knowledge is available
+ (pp->leap) and will be the current information from then on.
+ See Bug 434
+
+ ntpd/ntp_refclock.c@1.67 +1 -2
+ We know that peer_leap can be LEAPNOTINSYNC from startup (peer_clear when
+ FLAG_REFCLOCK is not set yet) or when copied from pp->leap.
+ Thus interrogating peer->leap only gives a a false reclock_report from
+ initialization. False in that respect that new knowledge is available
+ (pp->leap) and will be the current information from then on.
+
+ChangeSet@1.1251.32.1, 2005-05-28 04:45:19-04:00, stenn@whimsy.udel.edu
+ sys_clocktime defn/decl cleanup
+
+ include/ntpd.h@1.78 +1 -0
+ sys_clocktime defn/decl cleanup
+
+ ntpd/ntp_proto.c@1.223 +0 -1
+ sys_clocktime defn/decl cleanup
+
+ChangeSet@1.1251.29.14, 2005-05-28 04:36:31-04:00, stenn@pogo.udel.edu
+ [Bug 443] Remove duplicate LDISC_ #defines (from Brian Utterback)
+
+ include/ntp_tty.h@1.3 +0 -13
+ [Bug 443] Remove duplicate LDISC_ #defines (from Brian Utterback)
+
+ChangeSet@1.1251.29.13, 2005-05-28 04:22:37-04:00, stenn@pogo.udel.edu
+ [Bug 442] some constants should be UL
+
+ ntpd/ntp_control.c@1.79 +3 -2
+ [Bug 442] some constants should be UL
+
+ChangeSet@1.1251.29.12, 2005-05-28 04:10:30-04:00, stenn@pogo.udel.edu
+ [Bug 441] Treat *-*-solaris2* the same WRT AM_C_PROTOTYPES
+
+ configure.ac@1.359.2.2 +6 -2
+ [Bug 441] Treat *-*-solaris2* the same WRT AM_C_PROTOTYPES
+
+ChangeSet@1.1251.29.11, 2005-05-27 05:39:09-04:00, stenn@whimsy.udel.edu
+ [Bug 437] Trailing comma in enumeration (fix from Brian Utterback)
+
+ ntpd/ntp_config.c@1.126 +1 -1
+ [Bug 437] Trailing comma in enumeration (fix from Brian Utterback)
+
+ChangeSet@1.1251.31.3, 2005-05-26 20:51:10-04:00, stenn@pogo.udel.edu
+ [Bug 432] More in6addr_any cleanup
+
+ libisc/ifiter_ioctl.c@1.22.1.2 +2 -0
+ [Bug 432] More in6addr_any cleanup
+
+ChangeSet@1.1251.26.15, 2005-05-26 22:05:19+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ cleanup status reporting
+ ntp_refclock.c:
+ initialize currentstatus to CEVNT_FAULT to avoid misleading
+ clk_fault report at first successful reception from
+ a refclock driver
+
+ ntpd/ntp_refclock.c@1.66 +3 -1
+ initialize currentstatus to CEVNT_FAULT to avoid misleading
+ clk_fault report at first successful reception from
+ a refclock driver
+
+ ntpd/refclock_parse.c@1.31 +17 -14
+ cleanup status reporting
+
+ChangeSet@1.1251.26.14, 2005-05-26 19:36:08+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ implement fast refclock startup
+
+ ntpd/refclock_parse.c@1.30 +9 -5
+ implement fast refclock startup
+
+ChangeSet@1.1251.31.2, 2005-05-26 06:28:54-04:00, stenn@pogo.udel.edu
+ [Bug 432] More in6addr_any cleanup
+
+ libisc/ifiter_ioctl.c@1.22.1.1 +1 -0
+ [Bug 432] More in6addr_any cleanup
+
+ChangeSet@1.1251.29.9, 2005-05-26 06:27:24-04:00, stenn@pogo.udel.edu
+ [Bug 432] More in6addr_any cleanup
+
+ libisc/ifiter_ioctl.c@1.23 +1 -0
+ [Bug 432] More in6addr_any cleanup
+
+ChangeSet@1.1251.31.1, 2005-05-26 06:23:51-04:00, stenn@pogo.udel.edu
+ [Bug 432] More in6addr_any cleanup
+
+ libisc/ifiter_ioctl.c@1.22 +1 -0
+ [Bug 432] More in6addr_any cleanup
+
+ChangeSet@1.1251.29.7, 2005-05-26 05:20:13-04:00, stenn@pogo.udel.edu
+ [Bug 432] More in6addr_any cleanup
+
+ libisc/netaddr.c@1.4 +2 -0
+ [Bug 432] More in6addr_any cleanup
+
+ libisc/sockaddr.c@1.4 +2 -0
+ [Bug 432] More in6addr_any cleanup
+
+ChangeSet@1.1251.29.6, 2005-05-25 05:43:34-04:00, stenn@pogo.udel.edu
+ [Bug 432] in6addr_any cleanup
+
+ libisc/sockaddr.c@1.3 +2 -0
+ [Bug 432] in6addr_any cleanup
+
+ChangeSet@1.1251.29.4, 2005-05-25 05:01:29-04:00, stenn@whimsy.udel.edu
+ [Bug 433] Avoid epoch overflow on 32 bit systems
+
+ libntp/prettydate.c@1.5 +9 -0
+ [Bug 433] Avoid epoch overflow on 32 bit systems
+
+ChangeSet@1.1251.29.3, 2005-05-25 04:57:45-04:00, stenn@whimsy.udel.edu
+ Try adding mort back in to the br-flock
+
+ br-flock@1.6 +1 -1
+ Try adding mort back in to the br-flock
+
+ChangeSet@1.1251.29.2, 2005-05-24 04:37:05-04:00, stenn@whimsy.udel.edu
+ [Bug 433] get SIZEOF_TIME_T
+
+ configure.ac@1.359.2.1 +1 -0
+ [Bug 433] get SIZEOF_TIME_T
+
+ChangeSet@1.1251.28.2, 2005-05-24 03:36:59-04:00, stenn@pogo.udel.edu
+ [Bug 432] clean up in6addrany usage
+
+ libisc/netaddr.c@1.3 +2 -0
+ [Bug 432] clean up in6addrany usage
+
+ libntp/ntp_rfc2553.c@1.22 +0 -12
+ [Bug 432] clean up in6addrany usage
+
+ ntpd/ntp_intres.c@1.40 +2 -0
+ [Bug 432] clean up in6addrany usage
+
+ChangeSet@1.1251.28.1, 2005-05-24 03:11:09-04:00, stenn@pogo.udel.edu
+ Added barnstable to the flock list
+
+ flock-build@1.31 +1 -1
+ Added barnstable to the flock list
+
+ChangeSet@1.1251.27.2, 2005-05-24 01:06:58-04:00, stenn@whimsy.udel.edu
+ [Bug 431] More fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.222 +4 -3
+ [Bug 431] More fixes from Dave Mills
+
+ChangeSet@1.1251.27.1, 2005-05-22 04:21:05-04:00, stenn@whimsy.udel.edu
+ [Bug 431]: FLAG_AUTHENABLE/FLAG_AUTHENTIC fixes from Dave Mills
+
+ ntpd/ntp_config.c@1.125 +0 -1
+ FLAG_AUTHENABLE/FLAG_AUTHENTIC fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.221 +2 -0
+ FLAG_AUTHENABLE/FLAG_AUTHENTIC fixes from Dave Mills
+
+ChangeSet@1.1251.26.12, 2005-05-21 10:53:09+00:00, kardel@pogo.udel.edu
+ refclock_parse.c:
+ add simple timstamp reading Meinberg clock (type 18)
+ for the sake of cooperation in a multi client environment
+ adjust to new pps setup
+ Many files:
+ copyright maintenance
+ driver8.html:
+ document new clock type (Meinberg only time reading)
+ copyright.html:
+ update eMail address
+ configure.ac:
+ NetBSD supports parse fully
+ ChangeLog-4.1.0:
+ obfuscate email addresses
+
+ BitKeeper/etc/logging_ok@1.53 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ChangeLog-4.1.0@1.591 +14 -14
+ obfuscate email addresses
+
+ configure.ac@1.359.1.10 +4 -4
+ NetBSD supports parse fully
+
+ html/copyright.html@1.30 +1 -1
+ update eMail address
+
+ html/drivers/driver8.html@1.16 +414 -302
+ document new clock type (Meinberg only time reading)
+
+ include/ascii.h@1.4 +6 -3
+ copyright maintenance
+
+ include/binio.h@1.4 +6 -3
+ copyright maintenance
+
+ include/ieee754io.h@1.4 +6 -3
+ copyright maintenance
+
+ include/mbg_gps166.h@1.4 +3 -3
+ copyright maintenance
+
+ include/parse.h@1.6 +4 -4
+ copyright maintenance
+
+ include/parse_conf.h@1.4 +4 -4
+ copyright maintenance
+
+ include/trimble.h@1.4 +6 -3
+ copyright maintenance
+
+ kernel/sys/parsestreams.h@1.6 +1 -1
+ copyright maintenance
+
+ libntp/binio.c@1.5 +3 -3
+ copyright maintenance
+
+ libntp/gpstolfp.c@1.7 +6 -3
+ copyright maintenance
+
+ libntp/ieee754io.c@1.7 +6 -3
+ copyright maintenance
+
+ libntp/mfp_mul.c@1.5 +6 -3
+ copyright maintenance
+
+ libparse/clk_computime.c@1.8 +6 -3
+ copyright maintenance
+
+ libparse/clk_dcf7000.c@1.8 +6 -3
+ copyright maintenance
+
+ libparse/clk_hopf6021.c@1.8 +2 -2
+ copyright maintenance
+
+ libparse/clk_meinberg.c@1.8 +6 -3
+ copyright maintenance
+
+ libparse/clk_rawdcf.c@1.10 +6 -3
+ copyright maintenance
+
+ libparse/clk_rcc8000.c@1.8 +2 -2
+ copyright maintenance
+
+ libparse/clk_schmid.c@1.8 +6 -3
+ copyright maintenance
+
+ libparse/clk_trimtaip.c@1.8 +6 -3
+ copyright maintenance
+
+ libparse/clk_trimtsip.c@1.8 +6 -3
+ copyright maintenance
+
+ libparse/clk_varitext.c@1.7 +6 -3
+ copyright maintenance
+
+ libparse/clk_wharton.c@1.6 +2 -2
+ copyright maintenance
+
+ libparse/data_mbg.c@1.5 +6 -3
+ copyright maintenance
+
+ libparse/info_trimble.c@1.4 +6 -4
+ copyright maintenance
+
+ libparse/parse.c@1.10 +7 -4
+ copyright maintenance
+
+ libparse/parse_conf.c@1.9 +6 -3
+ copyright maintenance
+
+ libparse/parsesolaris.c@1.6 +8 -5
+ copyright maintenance
+
+ libparse/parsestreams.c@1.6 +9 -6
+ copyright maintenance
+
+ libparse/trim_info.c@1.4 +6 -3
+ copyright maintenance
+
+ ntpd/refclock_parse.c@1.29 +71 -23
+ add simple timstamp reading Meinberg clock (type 18)
+ for the sake of cooperation in a multi client environment
+ adjust to new pps setup
+
+ parseutil/dcfd.c@1.15 +6 -3
+ copyright maintenance
+
+ parseutil/testdcf.c@1.6 +7 -4
+ copyright maintenance
+
+ scripts/monitoring/ntploopwatch@1.4 +1 -1
+ copyright maintenance
+
+ChangeSet@1.1251.26.11, 2005-05-18 05:36:08-04:00, stenn@whimsy.udel.edu
+ [Bug 408] fix based on proposed patch from cipo
+
+ ntpq/ntpq.c@1.55.1.2 +10 -4
+ [Bug 408] fix based on proposed patch from cipo
+
+ ntpq/ntpq.h@1.5 +1 -1
+ [Bug 408] fix based on proposed patch from cipo
+
+ ntpq/ntpq_ops.c@1.20.2.1 +1 -1
+ [Bug 408] fix based on proposed patch from cipo
+
+ChangeSet@1.1251.26.10, 2005-05-17 01:17:18-04:00, stenn@whimsy.udel.edu
+ Stuff from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.107 +4 -4
+ Fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.220 +26 -3
+ Stratum checks from Dave Mills
+
+ ntpd/refclock_arbiter.c@1.12 +6 -4
+ Dave Mills: Call refclock_receive() once a second for the first few seconds
+
+ ntpd/refclock_atom.c@1.53 +8 -0
+ Dave Mills: flag4 in atom driver records offset to clockstats
+
+ ntpd/refclock_pst.c@1.8 +2 -1
+ Dave Mills: Call refclock_receive() once a second for the first few seconds
+
+ ntpd/refclock_wwvb.c@1.15 +2 -0
+ Dave Mills: Call refclock_receive() once a second for the first few seconds
+
+ChangeSet@1.1251.26.9, 2005-05-06 00:23:53-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ BitKeeper/deleted/.del-driver23.html~3aed0663@1.13 +0 -0
+ Delete: html/drivers/driver23.html
+
+ BitKeeper/deleted/.del-driver24.html~3e480692@1.10 +0 -0
+ Delete: html/drivers/driver24.html
+
+ BitKeeper/deleted/.del-footer.txt~29fb3ec8f08446d2@1.2 +0 -0
+ Delete: html/drivers/footer.txt
+
+ html/index.html@1.31 +94 -94
+ Changes from Dave Mills
+
+ChangeSet@1.1251.26.8, 2005-05-05 23:55:29-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntp_refclock.h@1.18 +6 -5
+ Changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.106 +2 -1
+ Changes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.65 +1 -1
+ Changes from Dave Mills
+
+ ntpd/refclock_acts.c@1.25 +30 -18
+ Changes from Dave Mills
+
+ ntpd/refclock_heath.c@1.12 +4 -3
+ Changes from Dave Mills
+
+ChangeSet@1.1251.26.7, 2005-04-27 05:53:39-04:00, stenn@whimsy.udel.edu
+ [Bug 401] ntpdc: only ask for keyid once, from Jason Fountain
+
+ ntpdc/ntpdc.c@1.40.1.1 +10 -6
+ [Bug 401] ntpdc: only ask for keyid once, from Jason Fountain
+
+ChangeSet@1.1251.26.6, 2005-04-27 04:09:54-04:00, stenn@whimsy.udel.edu
+ [Bug 409] Add DNS-SD/Rendezvous to ntpd, from Andre Masella
+
+ configure.ac@1.359.1.9 +11 -1
+ [Bug 409] Add DNS-SD/Rendezvous to ntpd, from Andre Masella
+
+ ntpd/ntpd.c@1.61.2.1 +16 -0
+ [Bug 409] Add DNS-SD/Rendezvous to ntpd, from Andre Masella
+
+ChangeSet@1.1251.1.126, 2005-04-23 16:24:51-04:00, mayer@pogo.udel.edu
+ Added support for -4 and -6 command line options
+
+ ntpd/cmd_args.c@1.34 +9 -2
+ Added support for -4 and -6 command line options
+
+ ntpd/ntp_config.c@1.123.1.1 +6 -21
+ Added support for -4 and -6 command line options
+
+ChangeSet@1.1251.26.5, 2005-04-21 00:27:25-04:00, stenn@whimsy.udel.edu
+ Documentation changes from Dave Mills
+
+ html/drivers/driver18.html@1.14 +10 -11
+ Documentation changes from Dave Mills
+
+ html/drivers/driver36.html@1.25 +4 -88
+ Documentation changes from Dave Mills
+
+ html/drivers/driver6.html@1.19 +6 -2
+ Documentation changes from Dave Mills
+
+ChangeSet@1.1251.26.4, 2005-04-21 00:23:40-04:00, stenn@whimsy.udel.edu
+ Documentation changes from Dave Mills
+
+ html/audio.html@1.16 +95 -3
+ Documentation changes from Dave Mills
+
+ html/confopt.html@1.31 +1 -1
+ Documentation changes from Dave Mills
+
+ html/ntpd.html@1.36 +4 -4
+ Documentation changes from Dave Mills
+
+ html/ntpq.html@1.25 +258 -255
+ Documentation changes from Dave Mills
+
+ChangeSet@1.1251.26.3, 2005-04-21 00:08:47-04:00, stenn@whimsy.udel.edu
+ anti-clockhop changes from Dave Mills
+
+ include/ntp.h@1.116 +6 -6
+ anti-clockhop changes from Dave Mills
+
+ include/ntp_config.h@1.33 +1 -0
+ anti-clockhop changes from Dave Mills
+
+ ntpd/ntp_config.c@1.124 +5 -0
+ anti-clockhop changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.219 +17 -7
+ anti-clockhop changes from Dave Mills
+
+ChangeSet@1.1251.1.124, 2005-04-20 23:55:08-04:00, mayer@pogo.udel.edu
+ Remove log.* from make files
+
+ BitKeeper/deleted/.del-log.c~3e480692@1.7 +0 -0
+ Delete: libntp/log.c
+
+ BitKeeper/deleted/.del-log.h~3e480692@1.5 +0 -0
+ Delete: libntp/log.h
+
+ libntp/Makefile.am@1.32 +2 -2
+ Remove log.* from make files
+
+ChangeSet@1.1251.1.123, 2005-04-20 23:25:01-04:00, mayer@pogo.udel.edu
+ Changes for multicasting
+
+ libntp/log.c@1.6 +0 -0
+ Rename: BitKeeper/deleted/.del-log.c~3e480692 -> libntp/log.c
+
+ BitKeeper/deleted/.del-log.c~3e480692@1.5 +0 -0
+ Delete: libntp/log.c
+
+ libntp/log.h@1.4 +0 -0
+ Rename: BitKeeper/deleted/.del-log.h~3e480692 -> libntp/log.h
+
+ BitKeeper/deleted/.del-log.h~3e480692@1.3 +0 -0
+ Delete: libntp/log.h
+
+ ntpd/ntp_io.c@1.179 +35 -11
+ Changes for multicasting
+
+ChangeSet@1.1251.26.2, 2005-04-18 22:29:49-04:00, stenn@whimsy.udel.edu
+ anti-clockhop changes from Dave Mills
+
+ include/ntp.h@1.115 +1 -3
+ anti-clockhop changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.218 +21 -25
+ anti-clockhop changes from Dave Mills
+
+ChangeSet@1.1251.26.1, 2005-04-18 01:01:32-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntp.h@1.114 +2 -2
+ Changes from Dave Mills
+
+ include/ntp_control.h@1.26 +9 -10
+ Changes from Dave Mills
+
+ ntpd/ntp_control.c@1.78 +10 -15
+ Changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.75 +0 -2
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.217 +37 -43
+ Changes from Dave Mills
+
+ChangeSet@1.1251.18.2, 2005-04-16 23:26:04-04:00, mayer@tecotoo.
+ Martin Burnicki's cleanup of command line options and setting the registry for NTP
+
+ BitKeeper/deleted/.del-log.c~87fe33f8@1.3 +0 -0
+ Delete: ports/winnt/libntp/log.c
+
+ BitKeeper/deleted/.del-log.h~29080509@1.5 +0 -0
+ Delete: ports/winnt/libntp/log.h
+
+ include/ntp_cmdargs.h@1.3 +1 -0
+ Martin Burnicki's changes to fix ntpd usage message
+
+ libntp/msyslog.c@1.19 +0 -1
+ Martin Burnicki's changes to remove unnecessary log.h include
+
+ ntpd/cmd_args.c@1.33 +38 -42
+ Martin Burnicki's changes to fix ntpd usage message
+
+ ntpd/ntpd.c@1.61.1.6 +0 -1
+ Martin Burnicki's changes to remove unnecessary log.h include
+
+ ports/winnt/instsrv/Instsrv.dsp@1.6 +1 -1
+ Miscellaneous cleanup
+
+ ports/winnt/libntp/libntp.dsp@1.25 +0 -8
+ Remove references to log.c and log.h
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.17 +0 -2
+ Martin Burnicki's changes to remove unnecessary registry call
+
+ ports/winnt/ntpd/ntservice.c@1.5 +11 -5
+ Martin Burnicki's changes to fix ntpd usage message
+
+ChangeSet@1.1251.1.121, 2005-04-12 17:43:36-04:00, stenn@whimsy.udel.edu
+ Documentation changes from Dave Mills (including [Bug 412])
+
+ html/accopt.html@1.23 +3 -5
+ Documentation changes from Dave Mills
+
+ html/confopt.html@1.30 +2 -2
+ [Bug 412] multicastclient requires an address (Dave Mills)
+
+ html/ntpq.html@1.24 +2 -3
+ Documentation changes from Dave Mills
+
+ html/refclock.html@1.31 +8 -10
+ Documentation changes from Dave Mills
+
+ChangeSet@1.1251.1.120, 2005-04-12 00:52:34-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.105 +3 -4
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.216 +1 -1
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.119, 2005-04-07 20:36:24-04:00, stenn@whimsy.udel.edu
+ [Bug 405] and other fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.104 +0 -1
+ Fixes from Dave Mills
+
+ ntpd/ntp_peer.c@1.74 +1 -1
+ [Bug 405] Fix from Dave Mills
+
+ ntpd/ntp_proto.c@1.215 +37 -44
+ Fixes from Dave Mills
+
+ChangeSet@1.1251.1.118, 2005-04-06 23:54:32-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.214 +1 -2
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.117, 2005-04-06 01:09:48-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.73 +2 -3
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.213 +25 -24
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.116, 2005-04-04 18:15:45-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntp.h@1.113 +4 -7
+ Changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.103 +4 -1
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.212 +1 -0
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.115, 2005-04-04 00:22:10-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.211 +3 -3
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.114, 2005-04-03 20:41:23-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntp.h@1.112 +1 -0
+ Changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.72 +4 -3
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.210 +98 -93
+ Changes from Dave Mills
+
+ChangeSet@1.1251.25.1, 2005-04-02 19:05:57-05:00, mayer@pogo.udel.edu
+ Use any for the IPv4 join interface for mcast
+
+ ntpd/ntp_io.c@1.178 +1 -1
+ Use any for the IPv4 join interface for mcast
+
+ChangeSet@1.1251.24.1, 2005-04-02 18:47:52-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntp.h@1.111 +6 -7
+ Changes from Dave Mills
+
+ include/ntp_crypto.h@1.35 +3 -2
+ Changes from Dave Mills
+
+ include/ntpd.h@1.77 +1 -1
+ Changes from Dave Mills
+
+ libntp/statestr.c@1.9 +4 -3
+ Changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.96 +47 -38
+ Changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.71 +2 -2
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.209 +49 -81
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.111, 2005-04-02 18:36:32-05:00, mayer@pogo.udel.edu
+ If unable to create a separate socket for multicast, find a local interface and use that instead of the wildcard sockets
+
+ ntpd/ntp_io.c@1.177 +46 -25
+ If unable to create a separate socket for multicast, find a local interface and use that instead of the wildcard sockets
+
+ChangeSet@1.1251.1.110, 2005-04-02 03:28:33-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.208 +48 -44
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.109, 2005-03-31 23:03:22-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntpd.h@1.76 +1 -1
+ Changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.70 +7 -5
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.207 +140 -135
+ Changes from Dave Mills
+
+ChangeSet@1.1251.23.1, 2005-03-31 21:57:56-05:00, mayer@pogo.udel.edu
+ Change ignore packet message to only print if debug > 3
+
+ ntpd/ntp_io.c@1.176 +1 -1
+ Change ignore packet message to only print if debug > 3
+
+ChangeSet@1.1251.1.107, 2005-03-31 11:15:14+02:00, root@sonne.
+ Remove quotes from tokens to handle paths with spaces correctly.
+
+ ntpd/ntp_config.c@1.123 +21 -0
+ Remove quotes from tokens to handle paths with spaces correctly.
+
+ChangeSet@1.1251.1.106, 2005-03-31 11:11:43+02:00, root@sonne.
+ Fixed braces in conditional for OPENSSL.
+
+ BitKeeper/etc/logging_ok@1.52 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ntpd/ntp_proto.c@1.206 +2 -1
+ Fixed braces in conditional for OPENSSL.
+
+ChangeSet@1.1251.22.2, 2005-03-30 23:41:14-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntp.h@1.108.1.1 +18 -8
+ Changes from Dave Mills
+
+ ntpd/ntp_peer.c@1.69 +9 -8
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.203.1.2 +205 -205
+ Changes from Dave Mills
+
+ChangeSet@1.1251.1.104, 2005-03-30 23:07:59-05:00, mayer@pogo.udel.edu
+ Bug #396 Windows-only fix to ignore incoming packets if flag on socket is set
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.14 +1 -1
+ Bug #396 Windows-only fix to ignore incoming packets if flag on socket is set
+
+ChangeSet@1.1251.22.1, 2005-03-27 18:39:02-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.203.1.1 +6 -6
+ Changes from Dave Mills
+
+ChangeSet@1.1251.21.3, 2005-03-27 16:29:59-05:00, mayer@pogo.udel.edu
+ Change in configuration setup prevented multicast packets from being accepted
+
+ ntpd/ntp_proto.c@1.201.1.1 +17 -16
+ Change in configuration setup prevented multicast packets from being accepted
+
+ChangeSet@1.1251.21.2, 2005-03-27 16:28:44-05:00, mayer@pogo.udel.edu
+ Bug #396: Don't accept broadcast packets if they are not enabled. wildcard socket was accepting them. Bind all sockets but drop any packet arriving on socket not specifically enabled
+
+ ntpd/ntp_io.c@1.175 +81 -50
+ Bug #396: Don't accept broadcast packets if they are not enabled. wildcard socket was accepting them. Bind all sockets but drop any packet arriving on socket not specifically enabled
+
+ChangeSet@1.1251.21.1, 2005-03-27 16:25:17-05:00, mayer@pogo.udel.edu
+ Added ignore_packets to interface for sockets which will drop all requests
+
+ include/ntp.h@1.109 +3 -0
+ Added ignore_packets to interface for sockets which will drop all requests
+
+ChangeSet@1.1251.1.102, 2005-03-24 00:54:17-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.102 +1 -2
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.203 +6 -11
+ Changes from Dave Mills
+
+ChangeSet@1.1251.20.1, 2005-03-18 00:43:24-05:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills
+
+ ntpd/ntp_proto.c@1.202 +15 -15
+ Updates from Dave Mills
+
+ChangeSet@1.1251.1.100, 2005-03-17 15:35:36-05:00, mayer@pogo.udel.edu
+ Bug #396 - Disable wildcards for now to prevent this happening
+
+ ntpd/ntp_io.c@1.174 +8 -1
+ Bug #396 - Disable wildcards for now to prevent this happening
+
+ChangeSet@1.1251.1.99, 2005-03-15 23:31:42-05:00, stenn@whimsy.udel.edu
+ ntp_proto.c fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.201 +111 -116
+ ntp_proto.c fixes from Dave Mills
+
+ChangeSet@1.1251.1.98, 2005-03-15 22:52:55-05:00, stenn@whimsy.udel.edu
+ Only check OpenSSL Major/Minor/Fix/Status, not Patch
+
+ util/ntp-keygen.c@1.31 +5 -1
+ Only check OpenSSL Major/Minor/Fix/Status, not Patch
+
+ChangeSet@1.1251.19.1, 2005-03-14 19:11:49-05:00, stenn@whimsy.udel.edu
+ Comment fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.200 +7 -2
+ Comment fixes from Dave Mills
+
+ChangeSet@1.1251.1.96, 2005-03-14 18:30:20-05:00, mayer@pogo.udel.edu
+ Wrong Macro used should have been PROTO_MULTICAST_ADD instead of PROTO_BROADCLIENT
+
+ ntpd/ntp_config.c@1.122 +1 -1
+ Wrong Macro used should have been PROTO_MULTICAST_ADD instead of PROTO_BROADCLIENT
+
+ChangeSet@1.1251.1.95, 2005-03-13 17:02:41-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills (flash TEST bits changed!)
+
+ include/ntp.h@1.108 +35 -24
+ Changes from Dave Mills (flashh TEST bits changed!)
+
+ include/ntpd.h@1.75 +1 -0
+ Changes from Dave Mills (flashh TEST bits changed!)
+
+ ntpd/ntp_control.c@1.77 +3 -1
+ Changes from Dave Mills (flash TEST bits changed!)
+
+ ntpd/ntp_crypto.c@1.95 +11 -11
+ Changes from Dave Mills (flash TEST bits changed!)
+
+ ntpd/ntp_peer.c@1.68 +6 -18
+ Changes from Dave Mills (flash TEST bits changed!)
+
+ ntpd/ntp_proto.c@1.199 +233 -293
+ Changes from Dave Mills (flash TEST bits changed!)
+
+ ntpq/ntpq.c@1.55.1.1 +14 -12
+ Changes from Dave Mills (flash TEST bits changed!)
+
+ChangeSet@1.1251.18.1, 2005-03-09 22:23:03-05:00, mayer@tecotoo.
+ Update for UTC information version string - from Heiko Gerstung
+
+ ports/winnt/scripts/mkver.bat@1.7 +99 -23
+ Update for UTC information version string - from Heiko Gerstung
+
+ChangeSet@1.1251.1.93, 2005-03-09 01:04:51-05:00, stenn@whimsy.udel.edu
+ Lose arbiter debug line. From Dave Mills.
+
+ ntpd/refclock_arbiter.c@1.11 +0 -2
+ Lose debug line. From Dave Mills.
+
+ChangeSet@1.1251.1.90, 2005-03-08 22:14:49-05:00, mayer@tecotoo.
+ Fix to correctly create version string - from Heiko Gerstung
+
+ ports/winnt/scripts/mkver.bat@1.6 +265 -50
+ Fix to correctly create version string - from Heiko Gerstung
+
+ChangeSet@1.1251.17.1, 2005-03-07 23:18:40-05:00, mayer@pogo.udel.edu
+ Check for max value of skips before adding
+
+ ntpd/ntp_io.c@1.169.1.6 +7 -4
+ Check for max value of skips before adding
+
+ChangeSet@1.1271, 2005-03-05 02:03:58-05:00, stenn@pogo.udel.edu
+ cleanup
+
+ configure.ac@1.366 +0 -33
+
+ChangeSet@1.1251.15.11, 2005-03-05 01:40:18-05:00, stenn@whimsy.udel.edu
+ [Bug 390] Do not run check-layout if cross-compiling
+
+ configure.ac@1.359.1.8 +46 -33
+ [Bug 390] Do not run check-layout if cross-compiling
+
+ ntpdc/Makefile.am@1.23.1.1 +1 -6
+ [Bug 390] Do not run check-layout if cross-compiling
+
+ChangeSet@1.1251.1.88, 2005-03-02 20:52:53-05:00, mayer@tecotoo.
+ Test code
+
+ ntpd/ntp_io.c@1.171 +1 -1
+ Test code
+
+ChangeSet@1.1178.5.1, 2005-03-02 16:18:07-05:00, stenn@whimsy.udel.edu
+ [Bug 389] Fix from Remi Demis-Courmont, via Loic Minier (http://bugs.debian.org/293793
+
+ ntpdate/ntpdate.c@1.47.1.1 +46 -16
+ [Bug 389] Fix from Remi Demis-Courmont, via Loic Minier (http://bugs.debian.org/293793
+
+ChangeSet@1.1251.15.9, 2005-03-02 15:50:06-05:00, stenn@whimsy.udel.edu
+ Clock filter bugfix from Dave Mills
+
+ ntpd/ntp_proto.c@1.198 +3 -3
+ Clock filter bugfix from Dave Mills
+
+ChangeSet@1.1251.15.8, 2005-03-02 14:53:27-05:00, mayer@pogo.udel.edu
+ Bug #392 fix group number
+
+ ntpd/ntpd.c@1.61.1.5 +1 -1
+ Bug #392 fix group number
+
+ChangeSet@1.1251.16.1, 2005-03-02 14:37:49-05:00, mayer@pogo.udel.edu
+ Fix to ignore 0 or less readlengths after the first one
+
+ ntpd/ntp_io.c@1.169.1.5 +50 -6
+ Fix to ignore 0 or less readlengths after the first one
+
+ChangeSet@1.1251.15.6, 2005-03-01 22:32:42-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntpd.h@1.74 +1 -0
+ Changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.94 +2 -1
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.197 +3 -1
+ Changes from Dave Mills
+
+ ntpd/ntp_util.c@1.36 +7 -5
+ Changes from Dave Mills
+
+ ntpd/ntpd.c@1.61.1.4 +2 -1
+ Changes from Dave Mills
+
+ ntpd/ntpsim.c@1.9 +1 -0
+ Changes from Dave Mills
+
+ChangeSet@1.1251.15.5, 2005-02-28 20:17:40-05:00, mayer@pogo.udel.edu
+ Fixed input_handler loops
+
+ ntpd/ntp_io.c@1.169.1.4 +29 -38
+ Fixed input_handler loops
+
+ChangeSet@1.1251.15.3, 2005-02-28 13:23:19-05:00, mayer@pogo.udel.edu
+ fixes in input_handler - additional changes required
+
+ ntpd/ntp_io.c@1.169.1.2 +16 -3
+ fixes in input_handler - additional changes required
+
+ChangeSet@1.1251.15.2, 2005-02-28 13:21:47-05:00, mayer@pogo.udel.edu
+ Bug #392 - using wrong group id for account
+
+ ntpd/ntpd.c@1.61.1.3 +1 -1
+ Bug #392 - using wrong group id for account
+
+ChangeSet@1.1251.13.3, 2005-02-28 12:52:33-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills
+
+ include/ntp.h@1.107 +1 -1
+ Changes from Dave Mills
+
+ ntpd/ntp_config.c@1.121 +1 -1
+ Changes from Dave Mills
+
+ ntpd/ntp_io.c@1.167.1.1 +1 -8
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.196 +18 -34
+ Changes from Dave Mills
+
+ ntpd/refclock_acts.c@1.21.1.3 +218 -207
+ Changes from Dave Mills
+
+ChangeSet@1.1251.15.1, 2005-02-22 18:10:26-05:00, mayer@pogo.udel.edu
+ Fix loop limits
+
+ ntpd/ntp_io.c@1.169.1.1 +3 -3
+ Fix loop limits
+
+ChangeSet@1.1251.14.1, 2005-02-21 00:34:25-05:00, mayer@tecotoo.
+ ntp_io.c:
+ Make MAXZEROREADS 1
+
+ ntpd/ntp_io.c@1.168.1.1 +4 -4
+ Make MAXZEROREADS 1
+
+ChangeSet@1.1251.1.86, 2005-02-21 00:26:12-05:00, mayer@pogo.udel.edu
+ Additional changes to input_handler() to correctly break in refclock read loop
+
+ ntpd/ntp_io.c@1.169 +8 -7
+ Additional changes to input_handler() to correctly break in refclock read loop
+
+ChangeSet@1.1251.13.2, 2005-02-18 23:00:34-05:00, stenn@whimsy.udel.edu
+ changes from Dave Mills
+
+ libntp/clocktypes.c@1.17 +8 -8
+ changes from Dave Mills
+
+ ntpd/ntp_control.c@1.76 +6 -6
+ changes from Dave Mills
+
+ ntpd/refclock_acts.c@1.21.1.2 +14 -32
+ changes from Dave Mills
+
+ ntpd/refclock_conf.c@1.25 +4 -4
+ changes from Dave Mills
+
+ChangeSet@1.1251.13.1, 2005-02-16 00:37:44-05:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills
+
+ include/ntp.h@1.106 +6 -3
+ Updates from Dave Mills
+
+ include/ntp_config.h@1.32 +3 -1
+ Updates from Dave Mills
+
+ ntpd/ntp_config.c@1.120 +9 -0
+ Updates from Dave Mills
+
+ ntpd/ntp_proto.c@1.195 +64 -59
+ Updates from Dave Mills
+
+ ntpd/ntp_refclock.c@1.64 +2 -6
+ Updates from Dave Mills
+
+ ntpd/refclock_acts.c@1.21.1.1 +1 -1
+ Updates from Dave Mills
+
+ ntpd/refclock_arbiter.c@1.10 +35 -26
+ Updates from Dave Mills
+
+ ntpd/refclock_atom.c@1.52 +12 -23
+ Updates from Dave Mills
+
+ChangeSet@1.1251.1.84, 2005-02-15 22:56:40-05:00, mayer@tecotoo.
+ Make MAXZEROREADS 1 so that the first zero-length read causes code to break and go to next socket
+
+ ntpd/ntp_io.c@1.168 +1 -1
+ Make MAXZEROREADS 1 so that the first zero-length read causes code to break and go to next socket
+
+ChangeSet@1.1251.12.1, 2005-02-15 19:40:54-05:00, mayer@tecotoo.
+ Refix SMAX to 256 and fix &C0/1 comment - per Greg Dowd's messages
+
+ ntpd/refclock_acts.c@1.22 +2 -2
+ Refix SMAX to 256 and fix &C0/1 comment - per Greg Dowd's messages
+
+ChangeSet@1.1251.1.82, 2005-02-15 19:31:10-05:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills
+
+ html/confopt.html@1.29 +3 -2
+ Updates from Dave Mills
+
+ html/manyopt.html@1.10 +22 -17
+ Updates from Dave Mills
+
+ html/miscopt.html@1.30 +5 -8
+ Updates from Dave Mills
+
+ChangeSet@1.1251.1.81, 2005-02-15 18:09:42-05:00, mayer@pogo.udel.edu
+ Added while look to read the clock until error or number of consecutive 0 len reads exceeds MAXZEROREADS
+
+ ntpd/ntp_io.c@1.167 +76 -52
+ Added while look to read the clock until error or number of consecutive 0 len reads exceeds MAXZEROREADS
+
+ChangeSet@1.1251.1.80, 2005-02-15 00:18:50-05:00, mayer@tecotoo.
+ Martin Burnicki's fixes to allow Windows to pass command line arguments to a system service
+
+ ntpd/ntpd.c@1.61.1.2 +3 -1
+ Martin Burnicki's fixes to allow Windows to pass command line arguments to a system service
+
+ ports/winnt/ntpd/ntservice.c@1.4 +21 -64
+ Martin Burnicki's fixes to allow Windows to pass command line arguments to a system service
+
+ChangeSet@1.1251.1.79, 2005-02-14 01:15:09-05:00, mayer@tecotoo.
+ Bug #214: Return ISC_FALSE on not equal
+
+ ntpd/ntp_io.c@1.166 +2 -0
+ Bug #214: Return ISC_FALSE on not equal
+
+ChangeSet@1.1251.1.78, 2005-02-14 00:38:25-05:00, mayer@tecotoo.
+ Bug #214: Use strcasecmp and not stricmp
+
+ ntpd/ntp_io.c@1.165 +1 -1
+ Bug #214: Use strcasecmp and not stricmp
+
+ ports/winnt/include/config.h@1.36 +1 -0
+ Bug #214: Use strcasecmp and not stricmp
+
+ChangeSet@1.1251.1.77, 2005-02-14 00:26:43-05:00, mayer@tecotoo.
+ Bug #214: Allow option on command line to specify specific interface only to be used
+
+ ntpd/cmd_args.c@1.32 +6 -1
+ Bug #214: Allow option on command line to specify specific interface only to be used
+
+ ntpd/ntp_io.c@1.164 +22 -4
+ Bug #214: Allow option on command line to specify specific interface only to be used
+
+ChangeSet@1.1251.1.76, 2005-02-14 00:24:26-05:00, mayer@tecotoo.
+ add stricmp to mapped functions for win32
+
+ ports/winnt/include/config.h@1.35 +1 -0
+ add stricmp to mapped functions
+
+ChangeSet@1.1251.1.75, 2005-02-13 00:53:55-05:00, mayer@tecotoo.
+ Clean up code and reorganize input_handler()
+
+ ntpd/ntp_io.c@1.163 +224 -251
+ Clean up code and reorganize input_handler()
+
+ChangeSet@1.1251.1.74, 2005-02-12 13:29:10-05:00, mayer@pogo.udel.edu
+ Change from &C1 to &C0 for the modem setup
+
+ ntpd/refclock_acts.c@1.21 +2 -2
+ Change from &C1 to &C0 for the modem setup
+
+ChangeSet@1.1251.1.73, 2005-02-12 13:27:15-05:00, mayer@pogo.udel.edu
+ Remove double loop and continue reading sockets rather than skipping out
+
+ ntpd/ntp_io.c@1.162 +6 -4
+ Remove double loop and continue reading sockets rather than skipping out
+
+ChangeSet@1.1251.1.72, 2005-02-10 23:28:14-05:00, mayer@tecotoo.
+ Group ID was being obtained incorrectly. See message from Martin Pitt - Debian development
+
+ ntpd/ntpd.c@1.61.1.1 +1 -1
+ Group ID was being obtained incorrectly. See message from Martin Pitt - Debian development
+
+ChangeSet@1.1251.1.71, 2005-02-10 23:26:16-05:00, mayer@tecotoo.
+ Fix input_handler code to not select again until other I/O read and free buffer if nothing read. (see Bug #341 and messages from cipo)
+
+ ntpd/ntp_io.c@1.161 +6 -6
+ Fix input_handler code to not select again until other I/O read and free buffer if nothing read. (see Bug #341 and messages from cipo)
+
+ChangeSet@1.1251.1.70, 2005-02-09 00:59:19-05:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ ntpd/ntp_config.c@1.119 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.194 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.20 +1 -1
+ Cleanup from Dave Mills
+
+ChangeSet@1.1268, 2005-02-06 01:41:55-05:00, stenn@pogo.udel.edu
+ ntpdc lint
+
+ ntpdc/ntpdc.c@1.42 +0 -8
+ lint
+
+ChangeSet@1.1267, 2005-02-06 01:31:47-05:00, stenn@pogo.udel.edu
+ start hacking the ntpdc docs...
+
+ ntpdc/ntpdc-opts.def@1.2 +2 -5
+ start hacking the ntpdc docs...
+
+ChangeSet@1.1266, 2005-02-06 01:22:40-05:00, stenn@pogo.udel.edu
+ Convert ntpdc to autogen; some cleanup in ntpq
+
+ BitKeeper/etc/ignore@1.38 +5 -0
+ added ntpdc-opts.c ntpdc-opts.h ntpdc-opts.menu ntpdc-opts.texi ntpdc.1
+
+ ntpdc/Makefile.am@1.24 +20 -4
+ Convert ntpdc to autogen; some cleanup in ntpq
+
+ ntpdc/ntpdc-opts.def@1.1 +178 -0
+
+ ntpdc/ntpdc-opts.def@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpdc/ntpdc-opts.def
+
+ ntpdc/ntpdc.c@1.41 +54 -0
+ Convert ntpdc to autogen; some cleanup in ntpq
+
+ ntpq/Makefile.am@1.17 +1 -1
+ Convert ntpdc to autogen; some cleanup in ntpq
+
+ChangeSet@1.1251.1.69, 2005-02-05 22:47:46-05:00, stenn@whimsy.udel.edu
+ [Bug 388] Update URLs
+
+ html/drivers/driver43.html@1.9 +1 -1
+ [Bug 388] Update URLs
+
+ChangeSet@1.1251.1.68, 2005-02-05 22:44:47-05:00, stenn@whimsy.udel.edu
+ Poll updates from Dave Mills.
+
+ ntpd/ntp_proto.c@1.193 +11 -8
+ Poll updates from Dave Mills.
+
+ChangeSet@1.1251.1.67, 2005-02-03 01:18:23-05:00, stenn@whimsy.udel.edu
+ ntp_config.h, ntp.h, ntp_proto.c, ntp_config.c:
+ Fixes from Dave Mills. In particular, Dave writes:
+
+ After discovering the situation reported on the newsgroup where
+ misconfigured NTP had the Netgear disease, I put it through some
+ wickedly broken configuration tests and found and fixed a few minor
+ things in ntp-dev (not anything like the PPS oscillator).
+
+ 1. If a notrust error and iburst are configured, the client did not back
+ off the poll interval. It now does that under all circumstances where
+ the reply is absent or corrupt.
+
+ 2. An unresponsive server with iburst got hammered with eight messages
+ every poll interval until the unreach counter reaches 12, then backs off
+ sending only a single packet per burst. I changed that to send a burst
+ only the first time after initial start or loss of reach.
+
+ 3. By popular demand I put in "tos maxdist N", where N is the selection
+ threshold, normally 1. Set N to 16 and the clock will be set upon first
+ receiving a response from any server. Y'know, like SNTP.
+
+ include/ntp.h@1.105 +2 -1
+ Fixes from Dave Mills
+
+ include/ntp_config.h@1.31 +1 -0
+ Fixes from Dave Mills
+
+ ntpd/ntp_config.c@1.118 +5 -0
+ Fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.192 +85 -67
+ Fixes from Dave Mills
+
+ChangeSet@1.1251.1.66, 2005-01-23 18:54:35-05:00, mayer@tecotoo.
+ Need reference to address for scope
+
+ ntpd/ntp_io.c@1.160 +2 -2
+ Need reference to address for scope
+
+ChangeSet@1.1251.1.65, 2005-01-23 14:37:56-05:00, mayer@tecotoo.
+ Wasn't setting scopeid for IPv6 addresses
+
+ ntpd/ntp_io.c@1.159 +7 -9
+ Wasn't setting scopeid for IPv6 addresses
+
+ChangeSet@1.1251.1.64, 2005-01-18 00:48:54-05:00, mayer@tecotoo.
+ Fix missing parenthesis and remove duplicate CONFIG_CDELAY
+
+ include/ntp_config.h@1.30 +1 -2
+ Remove duplicate CONFIG_CDELAY
+
+ ports/winnt/include/isc/ipv6.h@1.6 +1 -1
+ Missing parenthesis in Macro
+
+ChangeSet@1.1251.11.1, 2005-01-16 19:29:57-05:00, mayer@tecotoo.
+ Added debug code findinterface to see if the connect() fails
+
+ ntpd/ntp_io.c@1.158 +6 -0
+
+ChangeSet@1.1251.1.62, 2005-01-11 16:15:03-05:00, mayer@pogo.udel.edu
+ Added isc/region.h
+
+ include/isc/Makefile.am@1.4 +1 -0
+ Added isc/region.h
+
+ChangeSet@1.1251.1.61, 2005-01-11 16:02:59-05:00, mayer@pogo.udel.edu
+ Added isc/buffer.h and isc/netscope.h
+
+ include/isc/Makefile.am@1.3 +2 -0
+ Added isc/buffer.h and isc/netscope.h
+
+ChangeSet@1.1261, 2005-01-10 04:19:21-05:00, stenn@pogo.udel.edu
+ fixes
+
+ configure.ac@1.364 +7 -0
+ disable shared libraries on OSF4.0
+
+ m4/libopts.m4@1.3 +2 -5
+ fix from bkorb
+
+ChangeSet@1.1260, 2005-01-09 06:23:02-05:00, stenn@pogo.udel.edu
+ autogen-5.6.5
+
+ libopts/Makefile.am@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/autoopts.c@1.2 +36 -20
+ autogen-5.6.5
+
+ libopts/autoopts.h@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/boolean.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/compat/compat.h@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/compat/pathfind.c@1.2 +2 -2
+ autogen-5.6.5
+
+ libopts/enumeration.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/environment.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/genshell.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/genshell.h@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/libopts.m4@1.2 +2 -29
+ autogen-5.6.5
+
+ libopts/load.c@1.2 +2 -2
+ autogen-5.6.5
+
+ libopts/makeshell.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/numeric.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/options.h@1.2 +3 -3
+ autogen-5.6.5
+
+ libopts/pgusage.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/putshell.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/restore.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/save.c@1.2 +4 -3
+ autogen-5.6.5
+
+ libopts/sort.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/stack.c@1.2 +1 -7
+ autogen-5.6.5
+
+ libopts/streqv.h@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/streqvcmp.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/usage-txt.h@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/usage.c@1.2 +1 -1
+ autogen-5.6.5
+
+ libopts/version.c@1.2 +1 -1
+ autogen-5.6.5
+
+ m4/libopts.m4@1.2 +2 -29
+ autogen-5.6.5
+
+ChangeSet@1.1251.7.31, 2005-01-09 02:05:42-05:00, stenn@whimsy.udel.edu
+ Happy New Year
+
+ html/copyright.html@1.29 +2 -2
+ Happy New Year
+
+ChangeSet@1.1251.8.12, 2005-01-08 02:23:27-05:00, stenn@whimsy.udel.edu
+ Show more stability data.
+
+ ntpd/ntp_util.c@1.35 +1 -1
+ Show more stability data.
+
+ChangeSet@1.1251.8.11, 2005-01-08 01:13:32-05:00, stenn@whimsy.udel.edu
+ fencepost error
+
+ libntp/systime.c@1.32 +1 -1
+ fencepost error
+
+ChangeSet@1.1259, 2005-01-05 16:47:10-05:00, stenn@pogo.udel.edu
+ cleanup
+
+ configure.ac@1.363 +44 -33
+ Reorder AC_ARG_WITH to avoid an apparent quoting/redirect problem
+
+ ntpq/Makefile.am@1.16 +1 -1
+ Library reorder
+
+ChangeSet@1.1251.8.10, 2005-01-05 01:16:04-05:00, stenn@whimsy.udel.edu
+ Don't log 'refclockio structure not found'. From Dave Mills
+
+ ntpd/ntp_io.c@1.148.1.1 +0 -7
+ Don't log 'refclockio structure not found'. From Dave Mills
+
+ChangeSet@1.1251.1.58, 2005-01-05 00:12:51-05:00, mayer@tecotoo.
+ Rename index to idx
+
+ ntpd/ntp_io.c@1.156 +4 -4
+ Rename index to idx
+
+ChangeSet@1.1251.1.57, 2005-01-04 21:38:58-05:00, mayer@tecotoo.
+ Remove unnecessary includes
+
+ ntpd/ntp_io.c@1.155 +7 -17
+ Remove unnecessary includes
+
+ChangeSet@1.1251.1.56, 2005-01-02 21:13:48-05:00, mayer@tecotoo.
+ Remove unnecessary include ntp_if.h
+
+ ntpd/ntp_io.c@1.154 +0 -1
+ Remove unnecessary include ntp_if.h
+
+ChangeSet@1.1251.1.55, 2005-01-02 18:28:21-05:00, mayer@tecotoo.
+ remove include net/if.h. Some O/S's don't prevent double inclusions. It is already included in isc/net.h
+
+ libisc/interfaceiter.c@1.15 +0 -1
+ remove include net/if.h. Some O/S's don't prevent double inclusions. It is already included in isc/net.h
+
+ChangeSet@1.1251.1.54, 2005-01-01 22:14:34-05:00, mayer@tecotoo.
+ Remove reference to interface index. Remove isc_log_write references
+
+ libisc/ifiter_getifaddrs.c@1.4 +0 -1
+ Remove reference to interface index. Remove isc_log_write references
+
+ libisc/ifiter_ioctl.c@1.21 +4 -20
+ Remove reference to interface index. Remove isc_log_write references
+
+ libisc/ifiter_sysctl.c@1.11 +0 -1
+ Remove reference to interface index. Remove isc_log_write references
+
+ChangeSet@1.1251.1.53, 2005-01-01 18:10:09-05:00, mayer@tecotoo.
+ Updated msg macros
+
+ include/isc/msgs.h@1.3 +12 -10
+ Updated msg macros
+
+ChangeSet@1.1251.8.9, 2005-01-01 06:17:25-05:00, stenn@pogo.udel.edu
+ Library reorder
+
+ ntpd/Makefile.am@1.41 +1 -2
+ Library reorder
+
+ChangeSet@1.1251.10.2, 2005-01-01 00:49:42-05:00, mayer@pogo.udel.edu
+ Use macros in buffer routines
+
+ include/isc/buffer.h@1.2 +1 -1
+ Use macros in buffer routines
+
+ChangeSet@1.1251.10.1, 2005-01-01 00:48:50-05:00, mayer@pogo.udel.edu
+ First upgrade of interfaceiter routines
+
+ libisc/ifiter_getifaddrs.c@1.1.1.1 +15 -1
+ First upgrade of interfaceiter routines
+
+ libisc/ifiter_ioctl.c@1.18.1.1 +393 -157
+ First upgrade of interfaceiter routines
+
+ libisc/ifiter_sysctl.c@1.8.1.1 +24 -16
+ First upgrade of interfaceiter routines
+
+ libisc/interfaceiter.c@1.12.1.1 +79 -73
+ First upgrade of interfaceiter routines
+
+ChangeSet@1.1251.9.1, 2004-12-30 22:52:08-05:00, mayer@tecotoo.
+ First upgrade of interfaceiter routines
+
+ libisc/ifiter_getifaddrs.c@1.2 +15 -1
+ First upgrade of interfaceiter routines
+
+ libisc/ifiter_ioctl.c@1.19 +393 -157
+ First upgrade of interfaceiter routines
+
+ libisc/ifiter_sysctl.c@1.9 +24 -16
+ First upgrade of interfaceiter routines
+
+ libisc/interfaceiter.c@1.13 +79 -73
+ First upgrade of interfaceiter routines
+
+ChangeSet@1.1256, 2004-12-30 20:06:10-05:00, stenn@pogo.udel.edu
+ Cleanup
+
+ Makefile.am@1.50 +3 -3
+ Fix typos
+
+ ntpq/Makefile.am@1.15 +1 -1
+ Missed AM_CPPFLAGS in the merge
+
+ChangeSet@1.1255, 2004-12-30 19:47:48-05:00, stenn@pogo.udel.edu
+ cleanup
+
+ BitKeeper/deleted/.del-Makefile.in~783ae447256d94af@1.2 +0 -0
+ Delete: libopts/Makefile.in
+
+ BitKeeper/etc/ignore@1.37 +1 -0
+ added ntpq/ntpq.1
+
+ BitKeeper/etc/ignore@1.36 +5 -0
+ added ltmain.sh ntpq/ntpq-opts.c ntpq/ntpq-opts.h ntpq/ntpq-opts.menu ntpq/ntpq-opts.texi
+
+ configure.ac@1.362 +0 -1
+ Lint removal
+
+ ntpq/Makefile.am@1.14 +0 -1
+ Cleanup
+
+ChangeSet@1.1253, 2004-12-30 17:53:32-05:00, stenn@pogo.udel.edu
+ AutoOpts conversion - starting with ntpq
+
+ Makefile.am@1.49 +8 -1
+ AutoOpts conversion
+
+ libopts/COPYING.lgpl@1.1 +504 -0
+
+ libopts/COPYING.lgpl@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.lgpl
+
+ libopts/COPYING.mbsd@1.1 +26 -0
+
+ libopts/COPYING.mbsd@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/COPYING.mbsd
+
+ libopts/MakeDefs.inc@1.1 +5 -0
+
+ libopts/MakeDefs.inc@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/MakeDefs.inc
+
+ libopts/Makefile.am@1.1 +11 -0
+
+ libopts/Makefile.am@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/Makefile.am
+
+ libopts/Makefile.in@1.1 +496 -0
+
+ libopts/Makefile.in@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/Makefile.in
+
+ libopts/README@1.1 +89 -0
+
+ libopts/README@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/README
+
+ libopts/autoopts.c@1.1 +1136 -0
+
+ libopts/autoopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.c
+
+ libopts/autoopts.h@1.1 +322 -0
+
+ libopts/autoopts.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/autoopts.h
+
+ libopts/boolean.c@1.1 +104 -0
+
+ libopts/boolean.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/boolean.c
+
+ libopts/compat/compat.h@1.1 +265 -0
+
+ libopts/compat/compat.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/compat.h
+
+ libopts/compat/pathfind.c@1.1 +278 -0
+
+ libopts/compat/pathfind.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/compat/pathfind.c
+
+ libopts/enumeration.c@1.1 +448 -0
+
+ libopts/enumeration.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/enumeration.c
+
+ libopts/environment.c@1.1 +264 -0
+
+ libopts/environment.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/environment.c
+
+ libopts/genshell.c@1.1 +295 -0
+
+ libopts/genshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.c
+
+ libopts/genshell.h@1.1 +122 -0
+
+ libopts/genshell.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/genshell.h
+
+ libopts/libopts.c@1.1 +25 -0
+
+ libopts/libopts.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.c
+
+ libopts/libopts.m4@1.1 +395 -0
+
+ libopts/libopts.m4@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/libopts.m4
+
+ libopts/load.c@1.1 +553 -0
+
+ libopts/load.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/load.c
+
+ libopts/makeshell.c@1.1 +1096 -0
+
+ libopts/makeshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/makeshell.c
+
+ libopts/numeric.c@1.1 +96 -0
+
+ libopts/numeric.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/numeric.c
+
+ libopts/options.h@1.1 +436 -0
+
+ libopts/options.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/options.h
+
+ libopts/pgusage.c@1.1 +156 -0
+
+ libopts/pgusage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/pgusage.c
+
+ libopts/putshell.c@1.1 +326 -0
+
+ libopts/putshell.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/putshell.c
+
+ libopts/restore.c@1.1 +173 -0
+
+ libopts/restore.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/restore.c
+
+ libopts/save.c@1.1 +478 -0
+
+ libopts/save.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/save.c
+
+ libopts/sort.c@1.1 +357 -0
+
+ libopts/sort.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/sort.c
+
+ libopts/stack.c@1.1 +238 -0
+
+ libopts/stack.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/stack.c
+
+ libopts/streqv.h@1.1 +115 -0
+
+ libopts/streqv.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/streqv.h
+
+ libopts/streqvcmp.c@1.1 +196 -0
+
+ libopts/streqvcmp.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/streqvcmp.c
+
+ libopts/tokenize.c@1.1 +313 -0
+
+ libopts/tokenize.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/tokenize.c
+
+ libopts/tokenize.h@1.1 +40 -0
+
+ libopts/tokenize.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/tokenize.h
+
+ libopts/usage-txt.h@1.1 +503 -0
+
+ libopts/usage-txt.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/usage-txt.h
+
+ libopts/usage.c@1.1 +646 -0
+
+ libopts/usage.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/usage.c
+
+ libopts/version.c@1.1 +176 -0
+
+ libopts/version.c@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/libopts/version.c
+
+ m4/libopts.m4@1.1 +395 -0
+
+ m4/libopts.m4@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/m4/libopts.m4
+
+ ntpq/Makefile.am@1.11.1.1 +18 -4
+ AutoOpts conversion
+
+ ntpq/ntpq-opts.def@1.1 +156 -0
+
+ ntpq/ntpq-opts.def@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev-ag/ntpq/ntpq-opts.def
+
+ ntpq/ntpq.c@1.49.1.1 +48 -8
+ AutoOpts conversion
+
+ChangeSet@1.1251.8.8, 2004-12-28 00:46:27-05:00, stenn@whimsy.udel.edu
+ cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.19 +3 -1
+ file descriptor close cleanup from Dave Mills
+
+ ntpd/refclock_atom.c@1.51 +2 -2
+ corner case cleanup from Dave Mills
+
+ ntpd/refclock_wwv.c@1.53 +9 -25
+ wwv cleanup from Dave Mills
+
+ChangeSet@1.1251.8.7, 2004-12-27 06:15:13-05:00, stenn@whimsy.udel.edu
+ Added ISC_PLATFORM_{NEEDPORTT,FIXIN6ISADDR} for Danny
+
+ configure.ac@1.359.1.7 +36 -2
+ Added ISC_PLATFORM_{NEEDPORTT,FIXIN6ISADDR} for Danny
+
+ChangeSet@1.1251.1.49, 2004-12-24 18:25:12-05:00, mayer@tecotoo.
+ IPv6 changes
+
+ libisc/netaddr.c@1.2 +2 -0
+ IPv6 changes
+
+ libisc/sockaddr.c@1.2 +2 -0
+ IPv6 changes
+
+ChangeSet@1.1251.1.48, 2004-12-24 18:21:09-05:00, mayer@tecotoo.
+ IPv6 changes
+
+ libisc/interfaceiter.c@1.12 +2 -0
+ IPv6 changes
+
+ChangeSet@1.1251.1.47, 2004-12-24 18:16:16-05:00, mayer@tecotoo.
+ IPv6 changes again
+
+ include/isc/ipv6.h@1.6 +2 -2
+ IPv6 changes again
+
+ChangeSet@1.1251.1.46, 2004-12-24 18:10:50-05:00, mayer@tecotoo.
+ IPv6 changes
+
+ include/isc/ipv6.h@1.5 +12 -12
+ IPv6 changes
+
+ChangeSet@1.1251.1.45, 2004-12-23 22:59:14-05:00, mayer@tecotoo.
+ Alternate method of getting interface addresses
+
+ libisc/ifiter_getifaddrs.c@1.1 +178 -0
+ Alternate method of getting interface addresses
+
+ libisc/ifiter_getifaddrs.c@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/libisc/ifiter_getifaddrs.c
+
+ChangeSet@1.1251.1.44, 2004-12-23 22:41:22-05:00, mayer@tecotoo.
+ Added new files to build and moved some macros
+
+ include/ntp_machine.h@1.18 +0 -2
+ Moved function defines for Win32 from ntp_machine.h to winnt/config.h
+
+ libntp/Makefile.am@1.31 +2 -1
+ Added new files to build
+
+ ports/winnt/include/config.h@1.34 +8 -2
+ Moved function defines for Win32 from ntp_machine.h to winnt/config.h
+
+ ports/winnt/libntp/libntp.dsp@1.24 +20 -0
+ Added new files to build
+
+ChangeSet@1.1251.1.43, 2004-12-23 15:24:48-05:00, mayer@pogo.udel.edu
+ Miscellaneous compiler errors from port of BIND 9 code
+
+ include/isc/net.h@1.6 +2 -3
+ missing #endifs
+
+ libisc/net.c@1.5 +4 -16
+ Don't use the catalog like BIND 9
+
+ChangeSet@1.1251.1.41, 2004-12-23 00:16:06-05:00, mayer@tecotoo.
+ ports from BIND 9.3.0 and reintegrated into ntp libisc xode
+
+ include/isc/buffer.h@1.1 +800 -0
+ isc_buffer header file
+
+ include/isc/buffer.h@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/include/isc/buffer.h
+
+ include/isc/net.h@1.5 +56 -10
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ include/isc/netaddr.h@1.4 +22 -12
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ include/isc/netscope.h@1.1 +40 -0
+ isc_netscope header file
+
+ include/isc/netscope.h@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/include/isc/netscope.h
+
+ include/isc/region.h@1.1 +95 -0
+ isc_region header file
+
+ include/isc/region.h@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/include/isc/region.h
+
+ include/isc/result.h@1.3 +14 -11
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ include/isc/sockaddr.h@1.3 +6 -0
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ libisc/net.c@1.4 +210 -10
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ libisc/netaddr.c@1.1 +357 -0
+ isc_netaddr functions
+
+ libisc/netaddr.c@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/libisc/netaddr.c
+
+ libisc/netscope.c@1.1 +74 -0
+
+ libisc/netscope.c@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/libisc/netscope.c
+
+ libisc/sockaddr.c@1.1 +474 -0
+ isc_sockaddr functions
+
+ libisc/sockaddr.c@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/libisc/sockaddr.c
+
+ ports/winnt/include/isc/ipv6.h@1.5 +16 -12
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ ports/winnt/include/isc/net.h@1.5 +60 -12
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ ports/winnt/libisc/net.c@1.6 +206 -10
+ ports from BIND 9.3.0 and reintegrated into ntp libisc code
+
+ChangeSet@1.1251.8.6, 2004-12-22 00:35:41-05:00, stenn@whimsy.udel.edu
+ unused variable cleanup
+
+ ntpd/cmd_args.c@1.31 +0 -1
+ unused variable cleanup
+
+ChangeSet@1.1251.8.5, 2004-12-20 21:34:16-05:00, stenn@whimsy.udel.edu
+ wwv cleanup from Dave Mills
+
+ ntpd/refclock_wwv.c@1.52 +6 -5
+ wwv cleanup from Dave Mills
+
+ChangeSet@1.1251.8.4, 2004-12-20 21:01:08-05:00, stenn@whimsy.udel.edu
+ If "prefer" is set, only huffpuff to the preferred peer. From Dave Mills.
+
+ ntpd/ntp_loopfilter.c@1.101 +5 -1
+ If "prefer" is set, only huffpuff to the preferred peer. From Dave Mills.
+
+ChangeSet@1.1251.8.3, 2004-12-20 20:54:34-05:00, stenn@whimsy.udel.edu
+ Lose -m from ntpd.html
+
+ html/ntpd.html@1.35 +6 -6
+ Lose -m from ntpd.html
+
+ChangeSet@1.1251.8.2, 2004-12-20 20:41:57-05:00, stenn@whimsy.udel.edu
+ [Bug 374] Always declare atom_shutdown().
+
+ ntpd/refclock_atom.c@1.50 +1 -1
+ [Bug 374] Always declare atom_shutdown().
+
+ChangeSet@1.1251.8.1, 2004-12-20 20:36:18-05:00, stenn@whimsy.udel.edu
+ [Bug 378]: Added macros for Danny
+
+ configure.ac@1.359.1.6 +84 -1
+ [Bug 378]: Added macros for Danny
+
+ChangeSet@1.1251.7.26, 2004-12-18 04:55:09+00:00, abe@pogo.udel.edu
+
+
+ BitKeeper/etc/logging_ok@1.51 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ html/drivers/driver40.html@1.12 +46 -4
+
+ ntpd/refclock_jjy.c@1.12 +275 -21
+
+ChangeSet@1.1251.7.25, 2004-12-17 04:49:29-05:00, stenn@whimsy.udel.edu
+ atom cleanup from Dave Mills
+
+ ntpd/refclock_atom.c@1.49 +52 -18
+ atom cleanup from Dave Mills
+
+ChangeSet@1.1251.7.24, 2004-12-17 04:28:23-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ ntpdc/ntpdc.c@1.40 +2 -2
+ cleanup
+
+ ntpq/ntpq.c@1.55 +2 -4
+ cleanup
+
+ChangeSet@1.1178.4.1, 2004-12-17 03:49:20-05:00, stenn@whimsy.udel.edu
+ [Bug 373] ntpq and ntpdv help menu improvement, from Charles Maier
+
+ ntpdc/ntpdc.c@1.33.1.1 +33 -37
+ [Bug 373] ntpq and ntpdv help menu improvement
+
+ ntpq/ntpq.c@1.48.1.1 +33 -33
+ [Bug 373] ntpq and ntpdv help menu improvement
+
+ChangeSet@1.1251.7.22, 2004-12-17 03:28:27-05:00, stenn@whimsy.udel.edu
+ [Bug 368] Use config.h for jitter.c
+
+ util/jitter.c@1.7 +4 -0
+ [Bug 368] Use config.h
+
+ChangeSet@1.1251.7.21, 2004-12-17 00:15:55-05:00, stenn@whimsy.udel.edu
+ Lose -m
+
+ ntpd/cmd_args.c@1.30 +3 -11
+ Lose -m
+
+ChangeSet@1.1251.7.20, 2004-12-16 00:38:18-05:00, stenn@whimsy.udel.edu
+ [Bug 367]: Bump CONNECT to 20, fix typo accessing sys_phone[].
+
+ ntpd/refclock_acts.c@1.18 +2 -2
+ [Bug 367]: Bump CONNECT to 20, fix typo accessing sys_phone[].
+
+ChangeSet@1.1251.7.19, 2004-12-14 00:09:04-05:00, stenn@whimsy.udel.edu
+ netdb.h isnow handled by ntp_rcf2553.h
+
+ libntp/ntp_rfc2553.c@1.21 +0 -1
+ netdb.h isnow handled by ntp_rcf2553.h
+
+ChangeSet@1.1251.7.18, 2004-12-13 13:53:13-05:00, stenn@whimsy.udel.edu
+ refclock_atom fixes.
+
+ ntpd/refclock_atom.c@1.48 +28 -25
+ Call atom_shutdown at shutdown time (Dave Mills).
+ Isolate HAVE_PPSAPI-specific code in atom_shutdown (Dave Mills).
+
+ [Bug 366] Fix uninitialized pointer (Dave Mills, Martin Burnicki).
+
+ChangeSet@1.1251.7.17, 2004-12-13 02:11:09-05:00, stenn@whimsy.udel.edu
+ more wwv cleanup from Dave Mills.
+
+ ntpd/refclock_wwv.c@1.51 +11 -17
+ more wwv cleanup from Dave Mills.
+
+ChangeSet@1.1251.7.16, 2004-12-11 22:42:45-05:00, stenn@whimsy.udel.edu
+ New pps features from Dave Mills.
+
+ html/drivers/driver22.html@1.16 +10 -7
+ documentation updates
+
+ ntpd/refclock_atom.c@1.47 +42 -35
+ flag2 controls the on-time edge (assert/clear).
+
+ flag3 enables or disables kernel PPS support.
+
+ ppsapi-timepps header cleanup.
+
+ChangeSet@1.1251.7.15, 2004-12-11 22:28:49-05:00, stenn@whimsy.udel.edu
+ ppsapi header cleanup
+
+ ntpd/refclock_jupiter.c@1.19 +3 -1
+ ppsapi header cleanup
+
+ ntpd/refclock_mx4200.c@1.21 +3 -7
+ ppsapi header cleanup
+
+ ntpd/refclock_nmea.c@1.25 +1 -7
+ ppsapi header cleanup
+
+ ntpd/refclock_oncore.c@1.53 +3 -1
+ ppsapi header cleanup
+
+ ntpd/refclock_parse.c@1.28 +3 -1
+ ppsapi header cleanup
+
+ ntpd/refclock_ripencc.c@1.6 +3 -1
+ ppsapi header cleanup
+
+ChangeSet@1.1251.7.14, 2004-12-11 22:22:10-05:00, stenn@whimsy.udel.edu
+ Lose the "pps" stuff from ntp.conf. From Dave Mills.
+
+ include/ntp_config.h@1.29 +1 -8
+ Lose the PPS config stuff.
+
+ ntpd/ntp_config.c@1.117 +0 -1
+ Lose the "pps" configuration stuff.
+
+ChangeSet@1.1251.7.13, 2004-12-10 23:33:03-05:00, stenn@whimsy.udel.edu
+ More WWV cleanup from Dave Mills.
+
+ ntpd/refclock_wwv.c@1.50 +2 -2
+ More wwv cleanup from Dave Mills.
+
+ChangeSet@1.1251.7.12, 2004-12-10 18:03:43-05:00, stenn@whimsy.udel.edu
+ refclock_wwv.c fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.49 +85 -129
+ refclock_wwv.c fixes from Dave Mills
+
+ChangeSet@1.1251.7.11, 2004-12-10 18:00:32-05:00, stenn@whimsy.udel.edu
+ FIXPOLL fix from Dave Mills
+
+ ntpd/ntp_proto.c@1.191 +4 -3
+ FIXPOLL fix from Dave Mills
+
+ChangeSet@1.1251.7.10, 2004-12-09 14:36:18-05:00, stenn@whimsy.udel.edu
+ cleanup
+
+ configure.ac@1.359.1.5 +2 -2
+ cleanup
+
+ChangeSet@1.1251.7.9, 2004-12-08 22:09:06-05:00, stenn@whimsy.udel.edu
+ [Bug 368] net/if.h needs sys/socket.h
+
+ configure.ac@1.359.1.4 +2 -0
+ [Bug 368] net/if.h needs sys/socket.h
+
+ChangeSet@1.1251.7.8, 2004-12-08 21:49:05-05:00, stenn@whimsy.udel.edu
+ [Bug 368]: Distribute jitter.h, provide missing stdlib.h, fix LDADD
+
+ util/Makefile.am@1.25 +3 -0
+ [Bug 368]: Distribute jitter.h, provide missing stdlib.h, fix LDADD
+
+ util/jitter.c@1.6 +5 -4
+ [Bug 368]: Distribute jitter.h, provide missing stdlib.h, fix LDADD
+
+ChangeSet@1.1251.1.39, 2004-12-07 20:31:52-05:00, mayer@tecotoo.
+ Renable wildcard for testing
+
+ ntpd/ntp_io.c@1.153 +2 -1
+ Renable wildcard for testing
+
+ChangeSet@1.1251.1.38, 2004-12-07 19:44:54-05:00, mayer@tecotoo.
+ Add debugging detail for adding mcast group membership- error fix
+
+ ntpd/ntp_io.c@1.152 +0 -1
+ Add debugging detail for adding mcast group membership- error fix
+
+ChangeSet@1.1251.1.37, 2004-12-07 19:40:34-05:00, mayer@tecotoo.
+ Add debugging detail for adding mcast group membership
+
+ ntpd/ntp_io.c@1.151 +11 -6
+ Add debugging detail for adding mcast group membership
+
+ChangeSet@1.1251.7.7, 2004-12-06 14:07:32-05:00, stenn@whimsy.udel.edu
+ [Bug 366] Distribute the ppsapi_timepps.h header
+
+ ntpd/Makefile.am@1.40 +1 -0
+ [Bug 366] Distribute the ppsapi_timepps.h header
+
+ChangeSet@1.1251.7.6, 2004-12-06 03:51:05-05:00, stenn@whimsy.udel.edu
+ timepps.h header cleanup
+
+ configure.ac@1.359.1.3 +1 -0
+ timepps.h header cleanup
+
+ChangeSet@1.1251.7.5, 2004-12-06 03:41:48-05:00, stenn@whimsy.udel.edu
+ timepps.h header cleanup
+
+ configure.ac@1.359.1.2 +12 -6
+ timepps.h header cleanup
+
+ ntpd/ppsapi_timepps.h@1.1 +26 -0
+
+ ntpd/ppsapi_timepps.h@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/ntpd/ppsapi_timepps.h
+
+ ntpd/refclock_jupiter.c@1.18 +1 -9
+ timepps.h header cleanup
+
+ ntpd/refclock_oncore.c@1.52 +1 -30
+ timepps.h header cleanup
+
+ ntpd/refclock_parse.c@1.27 +1 -30
+ timepps.h header cleanup
+
+ ntpd/refclock_ripencc.c@1.5 +1 -7
+ timepps.h header cleanup
+
+ChangeSet@1.1251.7.4, 2004-12-05 23:38:24-05:00, stenn@whimsy.udel.edu
+ WWV improvements from Dave Mills.
+
+ html/drivers/driver36.html@1.24 +80 -67
+ WWV improvements from Dave Mills.
+
+ ntpd/refclock_wwv.c@1.48 +155 -103
+ WWV improvements from Dave Mills.
+
+ChangeSet@1.1251.7.3, 2004-12-05 23:33:36-05:00, stenn@whimsy.udel.edu
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ html/drivers/driver18.html@1.13 +2 -2
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ChangeSet@1.1251.7.2, 2004-12-05 21:12:40-05:00, stenn@whimsy.udel.edu
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ html/miscopt.html@1.29 +3 -2
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ChangeSet@1.1251.7.1, 2004-12-05 21:06:26-05:00, stenn@whimsy.udel.edu
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ include/ntpd.h@1.73 +1 -1
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ ntpd/ntp_config.c@1.116 +7 -7
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ ntpd/refclock_acts.c@1.17 +11 -9
+ [Bug 357] Fixed and additional improvements from Dave Mills
+
+ChangeSet@1.1251.1.36, 2004-12-03 22:36:37-05:00, mayer@tecotoo.
+ Undefine UDP_WILDCARD_DELIVERY for testing
+
+ ntpd/ntp_io.c@1.150 +5 -5
+ Undefine UDP_WILDCARD_DELIVERY for testing
+
+ChangeSet@1.1251.1.35, 2004-12-03 22:29:34-05:00, mayer@tecotoo.
+ Undefine UDP_WILDCARD_DELIVERY for testing
+
+ ntpd/ntp_io.c@1.149 +5 -0
+ Undefine UDP_WILDCARD_DELIVERY for testing
+
+ChangeSet@1.1251.1.34, 2004-12-02 20:58:35-05:00, mayer@tecotoo.
+ Add info on cast_flags in newpeer
+
+ ntpd/ntp_peer.c@1.67 +5 -0
+ Add info on cast_flags in newpeer
+
+ChangeSet@1.1251.1.33, 2004-11-30 05:20:17-05:00, stenn@pogo.udel.edu
+ netdb.h cleanup
+
+ include/ntp_fp.h@1.12 +1 -0
+ netdb.h cleanup
+
+ include/ntp_rfc2553.h@1.27 +2 -0
+ netdb.h cleanup
+
+ libntp/decodenetnum.c@1.6 +0 -1
+ netdb.h cleanup
+
+ libntp/numtohost.c@1.3 +0 -1
+ netdb.h cleanup
+
+ libntp/socktoa.c@1.8 +0 -1
+ netdb.h cleanup
+
+ libntp/socktohost.c@1.5 +0 -1
+ netdb.h cleanup
+
+ ntpd/ntp_config.c@1.115 +0 -2
+ netdb.h cleanup
+
+ ntpd/ntp_intres.c@1.39 +0 -2
+ netdb.h cleanup
+
+ ntpd/ntp_resolver.c@1.18 +0 -1
+ netdb.h cleanup
+
+ ntpd/refclock_nmea.c@1.24 +0 -2
+ netdb.h cleanup
+
+ ntpdate/ntpdate.c@1.50 +0 -1
+ netdb.h cleanup
+
+ ntpdate/ntptimeset.c@1.12 +0 -1
+ netdb.h cleanup
+
+ ntpdc/ntpdc.c@1.38 +0 -1
+ netdb.h cleanup
+
+ ntpdc/ntpdc_ops.c@1.38 +0 -1
+ netdb.h cleanup
+
+ ntpq/ntpq.c@1.53 +0 -1
+ netdb.h cleanup
+
+ ntpq/ntpq_ops.c@1.20.1.2 +0 -1
+ netdb.h cleanup
+
+ChangeSet@1.1251.6.1, 2004-11-29 22:45:56-05:00, stenn@pogo.udel.edu
+ findinterface() and findbcastinterf() should ignore wildcard sockets. From Danny Mayer.
+
+ ntpd/ntp_io.c@1.148 +2 -2
+ findinterface() and findbcastinterf() should ignore wildcard sockets. From Danny Mayer.
+
+ChangeSet@1.1251.5.1, 2004-11-29 22:27:18-05:00, mayer@tecotoo.
+ Fix winioctl warning messages
+
+ ports/winnt/ntpd/hopf_PCI_io.c@1.6 +5 -4
+ Fix winioctl warning messages
+
+ChangeSet@1.1251.1.30, 2004-11-29 01:09:27-05:00, stenn@whimsy.udel.edu
+ FIXPOLL changes and cleanup from Dave Mills
+
+ include/ntp.h@1.104 +1 -0
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/ntp_peer.c@1.66 +1 -2
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.190 +2 -6
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/ntp_refclock.c@1.63 +1 -1
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.16 +1 -0
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/refclock_arbiter.c@1.9 +48 -33
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/refclock_atom.c@1.46 +36 -58
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/refclock_wwv.c@1.47 +145 -139
+ FIXPOLL changes and cleanup from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.14 +50 -28
+ FIXPOLL changes and cleanup from Dave Mills
+
+ChangeSet@1.1251.1.29, 2004-11-29 00:45:58-05:00, stenn@whimsy.udel.edu
+ [Bug 363] ntpdate: use -1 to represent an invalid fd (from Rainer Weikusat)
+
+ ntpdate/ntpdate.c@1.49 +2 -2
+ [Bug 363] ntpdate: use -1 to represent an invalid fd (from Rainer Weikusat)
+
+ChangeSet@1.1251.1.28, 2004-11-28 03:35:01-05:00, stenn@whimsy.udel.edu
+ [Bug 363] ntpdate: use -1 to represent an invalid fd
+
+ ntpdate/ntpdate.c@1.48 +2 -2
+ [Bug 363] ntpdate: use -1 to represent an invalid fd
+
+ChangeSet@1.1251.1.27, 2004-11-21 21:33:09-05:00, stenn@whimsy.udel.edu
+ [Bug 349] Patches from Takao Abe
+
+ html/drivers/driver40.html@1.11 +6 -4
+ [Bug 349] Patches from Takao Abe
+
+ ntpd/refclock_jjy.c@1.11 +57 -15
+ [Bug 349] Patches from Takao Abe
+
+ChangeSet@1.1251.1.26, 2004-11-21 05:31:43-05:00, stenn@pogo.udel.edu
+ lint
+
+ ntpd/refclock_parse.c@1.26 +2 -2
+ lint
+
+ChangeSet@1.1251.1.25, 2004-11-21 05:23:35-05:00, stenn@whimsy.udel.edu
+ Stuff from Dave Mills
+
+ libntp/icom.c@1.9 +1 -0
+ cleanup
+
+ ntpd/refclock_wwv.c@1.46 +159 -148
+ Fixes from Dave Mills
+
+ ntpd/refclock_wwv.c@1.45 +90 -93
+ lint
+
+ChangeSet@1.1251.1.24, 2004-11-21 04:26:47-05:00, stenn@whimsy.udel.edu
+ [Bug 359] Fix qsort first-arg casting
+
+ ntpd/ntp_refclock.c@1.62 +7 -2
+ [Bug 359] Fix qsort first-arg casting
+
+ ntpd/refclock_msfees.c@1.11 +7 -1
+ [Bug 359] Fix qsort first-arg casting
+
+ util/hist.c@1.6 +7 -1
+ [Bug 359] Fix qsort first-arg casting
+
+ChangeSet@1.1251.1.23, 2004-11-21 03:55:29-05:00, stenn@whimsy.udel.edu
+ Lint.
+
+ ntpd/refclock_mx4200.c@1.20 +3 -3
+ lint
+
+ChangeSet@1.1251.1.22, 2004-11-19 21:44:19-05:00, stenn@www.ntp.org
+ qsort cast cleanup
+
+ ntpdc/ntpdc.c@1.37 +4 -6
+ qsort cast cleanup
+
+ ntpq/ntpq.c@1.52 +4 -6
+ qsort cast cleanup
+
+ChangeSet@1.1251.1.21, 2004-11-19 04:21:49-05:00, stenn@whimsy.udel.edu
+ refclock_parse.c needs ntp_string.h now.
+
+ ntpd/refclock_parse.c@1.25 +1 -0
+ refclock_parse.c needs ntp_string.h now.
+
+ChangeSet@1.1251.4.1, 2004-11-19 03:04:35-05:00, stenn@whimsy.udel.edu
+ [Bug 341] Patches from Frank Kardel
+
+ html/build/hints/parse@1.4 +1 -1
+ [Bug 341] Patches from Frank Kardel
+
+ html/drivers/driver8.html@1.15 +306 -133
+ [Bug 341] Patches from Frank Kardel
+
+ html/parsenew.html@1.9 +1 -1
+ [Bug 341] Patches from Frank Kardel
+
+ include/ascii.h@1.3 +34 -2
+ [Bug 341] Patches from Frank Kardel
+
+ include/binio.h@1.3 +34 -2
+ [Bug 341] Patches from Frank Kardel
+
+ include/ieee754io.h@1.3 +34 -2
+ [Bug 341] Patches from Frank Kardel
+
+ include/mbg_gps166.h@1.3 +33 -3
+ [Bug 341] Patches from Frank Kardel
+
+ include/parse.h@1.5 +34 -11
+ [Bug 341] Patches from Frank Kardel
+
+ include/parse_conf.h@1.3 +29 -9
+ [Bug 341] Patches from Frank Kardel
+
+ include/trimble.h@1.3 +34 -2
+ [Bug 341] Patches from Frank Kardel
+
+ kernel/chuinit.c@1.3 +0 -2
+ [Bug 341] Patches from Frank Kardel
+
+ kernel/clkinit.c@1.3 +0 -2
+ [Bug 341] Patches from Frank Kardel
+
+ kernel/sys/parsestreams.h@1.5 +1 -1
+ [Bug 341] Patches from Frank Kardel
+
+ libntp/binio.c@1.4 +29 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libntp/buftvtots.c@1.4 +12 -83
+ [Bug 341] Patches from Frank Kardel
+
+ libntp/gpstolfp.c@1.6 +34 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libntp/ieee754io.c@1.6 +34 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libntp/mfp_mul.c@1.4 +34 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libntp/mktime.c@1.8 +0 -1
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/README@1.3 +2 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_computime.c@1.7 +32 -9
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_dcf7000.c@1.7 +31 -8
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_hopf6021.c@1.7 +5 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_meinberg.c@1.7 +31 -8
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_rawdcf.c@1.9 +31 -8
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_rcc8000.c@1.7 +5 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_schmid.c@1.7 +32 -8
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_trimtaip.c@1.7 +33 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_trimtsip.c@1.7 +35 -3
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_varitext.c@1.6 +40 -8
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/clk_wharton.c@1.5 +2 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/data_mbg.c@1.4 +32 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/info_trimble.c@1.3 +0 -2
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/parse.c@1.9 +35 -9
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/parse_conf.c@1.8 +31 -8
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/parsesolaris.c@1.5 +36 -12
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/parsestreams.c@1.5 +37 -11
+ [Bug 341] Patches from Frank Kardel
+
+ libparse/trim_info.c@1.3 +33 -2
+ [Bug 341] Patches from Frank Kardel
+
+ ntpd/ntp_config.c@1.114 +1 -1
+ [Bug 341] Patches from Frank Kardel
+
+ ntpd/ntp_refclock.c@1.61 +1 -1
+ [Bug 341] Patches from Frank Kardel
+
+ ntpd/refclock_atom.c@1.45 +1 -1
+ [Bug 341] Patches from Frank Kardel
+
+ ntpd/refclock_parse.c@1.24 +513 -121
+ [Bug 341] Patches from Frank Kardel
+
+ parseutil/dcfd.c@1.14 +37 -11
+ [Bug 341] Patches from Frank Kardel
+
+ parseutil/testdcf.c@1.5 +38 -11
+ [Bug 341] Patches from Frank Kardel
+
+ scripts/monitoring/lr.pl@1.4 +12 -12
+ [Bug 341] Patches from Frank Kardel
+
+ scripts/monitoring/ntploopwatch@1.3 +31 -31
+ [Bug 341] Patches from Frank Kardel
+
+ChangeSet@1.1251.1.19, 2004-11-18 23:20:44-05:00, mayer@tecotoo.
+ Miscellaneous Win32 fixes
+
+ ntpdc/ntpdc.c@1.36 +4 -1
+ Win32 uses a slightly different prototype for qsort
+
+ ntpq/ntpq.c@1.51 +4 -1
+ Win32 uses a slightly different prototype for qsort
+
+ ports/winnt/include/config.h@1.33 +12 -18
+ Code cleanup - eliminate duplicate entries
+
+ ports/winnt/ntpd/ntservice.c@1.3 +3 -3
+ Use main instead of ntpmain for entry
+
+ChangeSet@1.1251.3.3, 2004-11-16 22:16:52-05:00, mayer@tecotoo.
+ Recommit fix
+
+ ntpd/cmd_args.c@1.28 +1 -1
+ Recommit fix
+
+ ntpd/cmd_args.c@1.27 +0 -1
+ Remove obsolete windows specific code
+
+ChangeSet@1.1251.3.2, 2004-11-16 00:13:54-05:00, mayer@tecotoo.
+ cmd_args.c, cmd_Args.c:
+ Remove obsolete windows specific code
+
+ ntpd/cmd_args.c@1.26 +0 -0
+ Remove obsolete windows specific code
+
+ ntpd/cmd_Args.c@1.25 +0 -0
+ Remove obsolete windows specific code
+
+ ntpd/cmd_args.c@1.24 +0 -7
+ Remove obsolete windows specific code
+
+ChangeSet@1.1251.1.17, 2004-11-15 23:32:18-05:00, mayer@pogo.udel.edu
+ John Hays burst mode fix for multicast
+
+ ntpd/ntp_proto.c@1.187.1.1 +2 -0
+ John Hays burst mode fix for multicast
+
+ChangeSet@1.1251.3.1, 2004-11-15 23:24:51-05:00, mayer@tecotoo.
+ John Hays burst mode fix for multicast
+
+ ntpd/ntp_proto.c@1.188 +2 -0
+ John Hays burst mode fix for multicast
+
+ChangeSet@1.1251.1.16, 2004-11-15 23:14:53-05:00, mayer@pogo.udel.edu
+ Force the update. Refuses on Windows. Remove NoWinService code
+
+ ntpd/cmd_args.c@1.23.1.1 +0 -8
+ Force the update. Refuses on Windows. Remove NoWinService code
+
+ChangeSet@1.1251.1.15, 2004-11-15 20:45:45-05:00, mayer@tecotoo.
+ findbcastinter should be using INT_BCASTOPEN flag
+
+ ntpd/ntp_io.c@1.147 +2 -2
+ findbcastinter should be using INT_BCASTOPEN flag
+
+ChangeSet@1.1251.1.14, 2004-11-14 22:42:23-05:00, mayer@tecotoo.
+ Added debugging code to track multicast issues
+
+ ntpd/ntp_io.c@1.146 +15 -1
+ Added debugging code to track multicast issues
+
+ ntpd/ntp_peer.c@1.65 +6 -0
+ Added debugging code to track multicast issues
+
+ChangeSet@1.1251.1.13, 2004-11-12 20:39:57-05:00, mayer@tecotoo.
+ Add debugging information
+
+ ntpd/ntp_proto.c@1.187 +3 -0
+ Add debugging information
+
+ChangeSet@1.1251.1.12, 2004-11-12 20:39:10-05:00, mayer@tecotoo.
+ Only enable broadcast for servers
+
+ ntpd/ntp_peer.c@1.64 +1 -1
+ Only enable broadcast for servers
+
+ChangeSet@1.1251.1.11, 2004-11-12 20:34:52-05:00, mayer@tecotoo.
+ Need both windows.h and winsock2.h for VC 6.0
+
+ ports/winnt/include/config.h@1.32 +1 -1
+ Need both windows.h and winsock2.h for VC 6.0
+
+ChangeSet@1.1251.2.2, 2004-11-09 22:05:28-05:00, mayer@tecotoo.
+ Move code to windows specific files
+
+ ntpd/ntpd.c@1.59.1.1 +3 -56
+ Remove Windows code from ntpd.c into nt_clockstuff.c
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.16 +15 -0
+ Remove Windows code from ntpd.c into nt_clockstuff.c
+
+ ports/winnt/ntpd/ntpd.dsp@1.25 +0 -5
+ Remove ntp_iopackets.c from compile list. Not ready
+
+ChangeSet@1.1251.1.9, 2004-11-09 04:38:42-05:00, stenn@whimsy.udel.edu
+ re-enable the first call to getstartup()
+
+ ntpd/ntpd.c@1.60 +1 -1
+ re-enable the first call to getstartup()
+
+ChangeSet@1.1250.1.4, 2004-11-08 23:08:38-05:00, mayer@tecotoo.
+ Fixes forInclude paths and extraneous windows code
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.8 +1 -1
+ Fix include paths
+
+ ports/winnt/ntpdate/ntpdate.dsp@1.14 +2 -2
+ Fix include paths
+
+ ports/winnt/ntpq/ntpq.dsp@1.17 +1 -1
+ Fix include paths
+
+ChangeSet@1.1251.1.7, 2004-11-08 01:02:59-05:00, stenn@pogo.udel.edu
+ [sntp] Lint removal
+
+ sntp/internet.c@1.4 +10 -22
+ Lint removal
+
+ sntp/internet.h@1.3 +2 -2
+ Lint removal
+
+ sntp/socket.c@1.5 +4 -8
+ Lint removal
+
+ChangeSet@1.1251.1.5, 2004-11-07 17:14:12-05:00, stenn@whimsy.udel.edu
+ [Bug 344] Handle some corner cases better
+
+ bincheck.mf@1.2 +3 -2
+ [Bug 344] Handle some corner cases better
+
+ChangeSet@1.1251.1.4, 2004-11-07 04:13:44-05:00, stenn@whimsy.udel.edu
+ AM_CPPFLAGS needed for nl.c
+
+ ntpdc/Makefile.am@1.23 +2 -2
+ AM_CPPFLAGS needed for nl.c
+
+ChangeSet@1.1251.1.3, 2004-11-07 03:01:26-05:00, stenn@pogo.udel.edu
+ [Bug 344] Allow daemons to be installed in sbin
+
+ adjtimed/Makefile.am@1.3 +10 -8
+ [Bug 344] Allow daemons to be installed in sbin
+
+ bincheck.mf@1.1 +14 -0
+
+ bincheck.mf@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev/bincheck.mf
+
+ configure.ac@1.359.1.1 +21 -2
+ [Bug 344] Allow daemons to be installed in sbin
+
+ ntpd/Makefile.am@1.39 +17 -9
+ [Bug 344] Allow daemons to be installed in sbin
+
+ ntpdate/Makefile.am@1.12 +15 -12
+ [Bug 344] Allow daemons to be installed in sbin
+
+ ntpdc/Makefile.am@1.22 +6 -3
+ [Bug 344] Allow daemons to be installed in sbin
+
+ ntpq/Makefile.am@1.12 +10 -10
+ [Bug 344] Allow daemons to be installed in sbin
+
+ sntp/Makefile.am@1.6 +4 -1
+ [Bug 344] Allow daemons to be installed in sbin
+
+ sntp/configure.ac@1.8 +18 -0
+ [Bug 344] Allow daemons to be installed in sbin
+
+ChangeSet@1.1249.1.11, 2004-11-06 21:43:44-05:00, mayer@tecotoo.
+ Miscellaneous
+
+ include/recvbuff.h@1.8 +1 -0
+ Add flags about the received packet
+
+ ports/winnt/libntp/syslog.c@1.3 +2 -1
+ modifed variable definition
+
+ChangeSet@1.1249.1.10, 2004-11-06 21:36:41-05:00, mayer@tecotoo.
+ Updates to move windows-specific code into the windows-specific files
+
+ ntpd/ntp_config.c@1.113 +1 -1
+ Remove obsolete windows specific code
+
+ ntpd/ntpd.c@1.57.1.1 +16 -155
+ Remove Windows specific code. Put in other files
+
+ ports/winnt/include/clockstuff.h@1.6 +1 -0
+ Move Console setup and service setup to nt_clockstuff.c
+
+ ports/winnt/include/ntp_iocompletionport.h@1.8 +2 -0
+ Move completion events from ntpd.c to ntp_iocompletionport.c
+
+ ports/winnt/include/ntservice.h@1.2 +1 -0
+ Move Console setup to ntservice
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.15 +35 -15
+ Move Console setup and service setup to nt_clockstuff.c
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.13 +46 -0
+ Move completion events from ntpd.c to ntp_iocompletionport.c
+
+ ports/winnt/ntpd/ntservice.c@1.2 +70 -17
+ Move Console setup to ntservice
+
+ChangeSet@1.1250.1.2, 2004-11-06 04:13:33-05:00, stenn@whimsy.udel.edu
+ lint
+
+ ntpd/ntpd.c@1.58 +0 -1
+ lint
+
+ChangeSet@1.1249.1.9, 2004-11-04 00:03:35-05:00, mayer@tecotoo.
+ Prefix constants with NTP_ to avoid collisions with VS.NET
+
+ ntpdc/ntpdc.c@1.35 +9 -8
+ Prefix constants with NTP_ to avoid collisions with VS.NET
+
+ ntpdc/ntpdc.h@1.4 +7 -7
+ Prefix constants with NTP_ to avoid collisions with VS.NET
+
+ ntpdc/ntpdc_ops.c@1.37 +21 -21
+ Prefix constants with NTP_ to avoid collisions with VS.NET
+
+ ntpq/ntpq.c@1.50 +18 -17
+ Prefix constants with NTP_ to avoid collisions with VS.NET
+
+ ntpq/ntpq.h@1.4 +10 -7
+ Prefix constants with NTP_ to avoid collisions with VS.NET
+
+ ntpq/ntpq_ops.c@1.20.1.1 +17 -17
+ Prefix constants with NTP_ to avoid collisions with VS.NET
+
+ChangeSet@1.1202.1.47, 2004-11-03 02:43:58-05:00, stenn@pogo.udel.edu
+ autogen
+
+ configure.ac@1.351.1.10 +2 -0
+ autogen
+
+ ntpq/ntpq-subs.c@1.21 +0 -0
+ Rename: ntpq/ntpq_ops.c -> ntpq/ntpq-subs.c
+
+ChangeSet@1.1251, 2004-11-03 01:51:42-05:00, stenn@pogo.udel.edu
+ Disable mlockall() under linux for now - resolver problems.
+
+ configure.ac@1.359 +3 -0
+ Disable mlockall() under linux for now - resolver problems.
+
+ChangeSet@1.1249.1.8, 2004-11-02 23:25:17-05:00, mayer@tecotoo.
+ Moved NT Services to it's own file
+
+ ntpd/ntpd.c@1.57 +56 -151
+ Moved NT Services to it's own file
+
+ChangeSet@1.1249.1.7, 2004-11-02 23:23:49-05:00, mayer@tecotoo.
+ Changes to support VS.NET
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.7 +4 -4
+ Changes to support VS.NET
+
+ChangeSet@1.1249.1.6, 2004-11-02 23:22:53-05:00, mayer@tecotoo.
+ Changes to support VS.NET
+
+ ports/winnt/include/isc/ipv6.h@1.4 +15 -3
+ Changes to support VS.NET
+
+ ports/winnt/include/isc/net.h@1.4 +4 -2
+ Changes to support VS.NET
+
+ ports/winnt/libisc/net.c@1.5 +2 -0
+ Changes to support VS.NET
+
+ChangeSet@1.1249.1.5, 2004-11-02 23:15:30-05:00, mayer@tecotoo.
+ Changes to support VS.NET
+
+ ports/winnt/include/config.h@1.31 +44 -6
+ Changes to support VS.NET
+
+ChangeSet@1.1249.1.4, 2004-11-02 23:14:21-05:00, mayer@tecotoo.
+ NT Services for NTP
+
+ ports/winnt/include/ntservice.h@1.1 +34 -0
+ NT Services for NTP
+
+ ports/winnt/include/ntservice.h@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/ports/winnt/include/ntservice.h
+
+ ports/winnt/ntpd/ntservice.c@1.1 +241 -0
+ NT Services for NTP
+
+ ports/winnt/ntpd/ntservice.c@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/ports/winnt/ntpd/ntservice.c
+
+ChangeSet@1.1249.1.3, 2004-11-02 23:07:27-05:00, mayer@tecotoo.
+ Redefine various error functions for win32
+
+ ports/winnt/libisc/isc_strerror.c@1.4 +8 -8
+ Redefine various error functions for win32
+
+ChangeSet@1.1249.1.2, 2004-11-02 23:05:22-05:00, mayer@tecotoo.
+ Remove unnecessary time variable references
+
+ libntp/mktime.c@1.7 +3 -5
+ Remove unnecessary time variable references
+
+ libntp/ranny.c@1.3 +0 -2
+ Remove unnecessary time variable references
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.14 +25 -27
+ Remove unnecessary time variable references
+
+ChangeSet@1.1249.1.1, 2004-11-02 23:02:31-05:00, mayer@tecotoo.
+ Updates to support changes required for VS.NET
+
+ ports/winnt/libntp/libntp.dsp@1.23 +4 -7
+ Updates to support changes required for VS.NET
+
+ ports/winnt/ntpd/ntpd.dsp@1.24 +40 -4
+ Updates to support changes required for VS.NET
+
+ ports/winnt/ntpdate/ntpdate.dsp@1.13 +2 -2
+ Updates to support changes required for VS.NET
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.16 +2 -2
+ Updates to support changes required for VS.NET
+
+ ports/winnt/ntpq/ntpq.dsp@1.16 +2 -2
+ Updates to support changes required for VS.NET
+
+ChangeSet@1.1249, 2004-11-01 23:46:20-05:00, mayer@tecotoo.
+ Mulitcast IPv6 check
+
+ ntpd/ntp_io.c@1.145 +2 -3
+ Mulitcast IPv6 check
+
+ChangeSet@1.1247, 2004-11-01 23:03:40-05:00, mayer@tecotoo.
+ IPv6 fixes and Added dump of interface function
+
+ include/ntpd.h@1.71 +1 -0
+ Added dump of interface function
+
+ ntpd/ntp_config.c@1.109.1.1 +41 -20
+ Fix for IPv6
+
+ ntpd/ntp_intres.c@1.35.1.1 +22 -2
+ Fix for IPv6
+
+ChangeSet@1.1246, 2004-11-01 22:55:10-05:00, mayer@tecotoo.
+ Fix multicast to open it's own socket. Fall back on wildcard if it fails
+
+ ntpd/ntp_io.c@1.143 +287 -494
+ Fix multicast to open it's own socket. Fall back on wildcard if it fails
+
+ChangeSet@1.1202.5.10, 2004-10-31 16:23:23-05:00, stenn@whimsy.udel.edu
+ PTB responses are 78 bytes long, not 40.
+
+ ntpd/refclock_acts.c@1.15 +1 -1
+ PTB responses are 78 bytes long, not 40.
+
+ChangeSet@1.1202.5.8, 2004-10-29 22:56:12-04:00, mayer@pogo.udel.edu
+ Should have used ISC_R_SUCCESS and not ISC_TRUE for return from isc_net_probeipv6(). Don't allow IPv6 addreses when no IPv6 available
+
+ ntpd/ntp_config.c@1.111 +36 -22
+ Should have used ISC_R_SUCCESS and not ISC_TRUE for return from isc_net_probeipv6(). Don't allow IPv6 addreses when no IPv6 available
+
+ ntpd/ntp_intres.c@1.37 +4 -4
+ Should have used ISC_R_SUCCESS and not ISC_TRUE for return from isc_net_probeipv6()
+
+ChangeSet@1.1202.7.1, 2004-10-29 05:52:47-04:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills
+
+ html/build/hints.html@1.15 +1 -1
+ Updates from Dave Mills
+
+ html/build/hints/solaris-dosynctodr.html@1.5 +11 -11
+ Updates from Dave Mills
+
+ html/drivers/driver18.html@1.12 +44 -49
+ Updates from Dave Mills
+
+ html/drivers/driver29.html@1.13 +1 -1
+ Updates from Dave Mills
+
+ html/drivers/driver38.html@1.12 +3 -3
+ Updates from Dave Mills
+
+ html/drivers/driver39.html@1.12 +3 -3
+ Updates from Dave Mills
+
+ html/drivers/driver44.html@1.11 +3 -6
+ Updates from Dave Mills
+
+ html/drivers/driver5.html@1.12 +1 -1
+ Updates from Dave Mills
+
+ html/drivers/driver8.html@1.14 +1 -1
+ Updates from Dave Mills
+
+ html/ntpd.html@1.34 +5 -8
+ Updates from Dave Mills
+
+ChangeSet@1.1202.6.1, 2004-10-28 20:49:19-04:00, mayer@pogo.udel.edu
+ Ensure that DNS lookups on IPv6-absent systems only look up IPv4 addresses
+
+ ntpd/ntp_config.c@1.110 +7 -0
+ Ensure that DNS lookups on IPv6-absent systems only look up IPv4 addresses
+
+ ntpd/ntp_intres.c@1.36 +21 -1
+ Ensure that DNS lookups on IPv6-absent systems only look up IPv4 addresses
+
+ChangeSet@1.1202.5.6, 2004-10-27 19:52:51-04:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills
+
+ html/copyright.html@1.28 +2 -2
+ Updates from Dave Mills
+
+ html/drivers/footer.txt@1.1 +7 -0
+
+ html/drivers/footer.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/drivers/footer.txt
+
+ html/drivers/tf582_4.html@1.1 +72 -0
+
+ html/drivers/tf582_4.html@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/drivers/tf582_4.html
+
+ html/keygen.html@1.5 +1 -1
+ Updates from Dave Mills
+
+ html/ntpd.html@1.33 +1 -1
+ Updates from Dave Mills
+
+ html/refclock.html@1.30 +8 -6
+ Updates from Dave Mills
+
+ChangeSet@1.1202.5.5, 2004-10-26 20:25:31-04:00, stenn@whimsy.udel.edu
+ Remove mort from the backroom auto-build list
+
+ br-flock@1.5 +1 -1
+ Remove mort from the backroom auto-build list
+
+ChangeSet@1.1202.4.5, 2004-10-24 22:46:38-04:00, mayer@pogo.udel.edu
+ Add interface_dump functionality
+
+ include/ntpd.h@1.69.1.1 +1 -0
+ Add interface_dump functionality
+
+ChangeSet@1.1202.4.4, 2004-10-24 22:45:54-04:00, mayer@pogo.udel.edu
+ Add interface_dump functionality
+
+ ntpd/ntp_io.c@1.119.1.5 +58 -0
+ Add interface_dump functionality
+
+ChangeSet@1.1202.4.3, 2004-10-24 22:44:25-04:00, mayer@pogo.udel.edu
+ Remove interface_dump
+
+ ntpd/ntp_control.c@1.70.1.4 +0 -1
+ Remove interface_dump
+
+ChangeSet@1.1202.4.2, 2004-10-24 22:42:51-04:00, mayer@pogo.udel.edu
+ Don't allow null interfaces
+
+ ntpd/ntp_peer.c@1.60.1.1 +8 -0
+ Don't allow null interfaces
+
+ChangeSet@1.1245, 2004-10-24 22:37:46-04:00, mayer@tecotoo.
+ Don't allow null interfaces
+
+ ntpd/ntp_peer.c@1.62 +8 -0
+ Don't allow null interfaces
+
+ChangeSet@1.1202.5.3, 2004-10-23 03:25:29-04:00, stenn@whimsy.udel.edu
+ sntp can be installed in sbin
+
+ sntp/Makefile.am@1.5 +1 -1
+ sntp can be installed in sbin
+
+ChangeSet@1.1202.5.2, 2004-10-23 03:09:05-04:00, stenn@whimsy.udel.edu
+ Lose broadcast and server modes from sntp.
+
+ sntp/README@1.2 +28 -27
+ Lose broadcast and server modes.
+
+ sntp/draft-mills-sntp-v4-00.txt@1.1 +1514 -0
+
+ sntp/draft-mills-sntp-v4-00.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/draft-mills-sntp-v4-00.txt
+
+ sntp/header.h@1.6 +1 -3
+ Lose broadcast and server modes.
+
+ sntp/main.c@1.5 +19 -115
+ Lose broadcast and server modes.
+
+ sntp/sntp.1@1.4 +0 -23
+ Lose broadcast and server modes.
+
+ sntp/socket.c@1.4 +6 -22
+ Lose broadcast and server modes.
+
+ChangeSet@1.1202.5.1, 2004-10-23 00:09:11-04:00, stenn@whimsy.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_util.c@1.34 +1 -1
+ loopstats output cleanup
+
+ ntpd/refclock_atom.c@1.44 +1 -0
+ Specify PPS_API_VERS_1
+
+ChangeSet@1.1202.1.42, 2004-10-19 21:26:34-04:00, stenn@pogo.udel.edu
+ select() EINTR and mlockall() under linux problem avoidance.
+
+ configure.ac@1.351.1.9 +3 -0
+ Stop using mlockall() under linux
+
+ ntpd/ntpd.c@1.55.1.1 +1 -1
+ Only show the select() EINTR reports at debug >5
+
+ChangeSet@1.1202.1.41, 2004-10-18 00:37:02-04:00, stenn@whimsy.udel.edu
+ lint fixes for refclock_mx4200.c
+
+ ntpd/refclock_mx4200.c@1.19 +3 -3
+ lint
+
+ChangeSet@1.1202.1.40, 2004-10-16 07:30:33-04:00, stenn@www.ntp.org
+ Rename html2man.pl to html2man.in so we can use PATH_PERL.
+
+ configure.ac@1.351.1.8 +1 -0
+ Rename html2man.pl to html2man.in so we can use PATH_PERL.
+
+ scripts/Makefile.am@1.11 +2 -2
+ Rename html2man.pl to html2man.in so we can use PATH_PERL.
+
+ scripts/html2man.in@1.5 +4 -6
+ Rename html2man.pl to html2man.in so we can use PATH_PERL.
+
+ scripts/html2man.in@1.4 +0 -0
+ Rename: scripts/html2man.pl -> scripts/html2man.in
+
+ChangeSet@1.1202.1.39, 2004-10-16 06:19:50-04:00, stenn@www.ntp.org
+ [Bug 348] genkeys -> keygen, and .htm -> .html
+
+ scripts/html2man.pl@1.3 +2 -2
+ [Bug 348] genkeys -> keygen, and .htm -> .html
+
+ChangeSet@1.1202.3.1, 2004-10-14 00:35:10-04:00, mayer@pogo.udel.edu
+ Fix to broadcast. broadcast address socket was not being opened
+
+ ntpd/ntp_io.c@1.119.1.4 +27 -9
+ Fix to broadcast. broadcast address socket was not being opened
+
+ChangeSet@1.1202.1.37, 2004-10-12 21:08:44-04:00, stenn@whimsy.udel.edu
+ Fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.100 +9 -15
+ Dave Mills: kernel cleanup
+
+ ntpd/ntp_proto.c@1.181.1.5 +1 -1
+ Dave Mills: If MCAST, turn off BURST as well.
+
+ChangeSet@1.1244, 2004-10-10 19:46:59-04:00, mayer@tecotoo.
+ Fix for refclock_open for Windows due to signature change (Again)
+
+ ports/winnt/include/win32_io.h@1.7 +1 -2
+ Fix for refclock_open for Windows due to signature change (Again)
+
+ChangeSet@1.1243, 2004-10-10 19:46:22-04:00, mayer@tecotoo.
+ Add support for enable_broadcast() call for servers (Again)
+
+ ntpd/ntp_io.c@1.142 +2 -1
+ Add support for enable_broadcast() call for servers (Again)
+
+ChangeSet@1.1241, 2004-10-10 19:10:18-04:00, mayer@tecotoo.
+ Fix for refclock_open for Windows due to signature change
+
+ ports/winnt/include/win32_io.h@1.4.1.1 +1 -1
+ Fix for refclock_open for Windows due to signature change
+
+ ports/winnt/ntpd/win32_io.c@1.9.1.1 +2 -2
+ Fix for refclock_open for Windows due to signature change
+
+ChangeSet@1.1240, 2004-10-10 19:08:19-04:00, mayer@tecotoo.
+ Add support for enable_broadcast() call for servers
+
+ include/ntpd.h@1.68.1.1 +4 -4
+ Add support for enable_broadcast() call for servers
+
+ ntpd/ntp_io.c@1.139.1.1 +21 -3
+ Add support for enable_broadcast() call for servers
+
+ ntpd/ntp_peer.c@1.59.1.1 +8 -0
+ Add support for enable_broadcast() call for servers
+
+ChangeSet@1.1202.1.36, 2004-10-08 22:24:44-04:00, stenn@whimsy.udel.edu
+ Changes/cleanup from Dave Mills
+
+ ntpd/ntp_control.c@1.70.1.3 +1 -1
+ Changes/cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.99 +9 -12
+ Changes/cleanup from Dave Mills
+
+ ntpd/ntp_util.c@1.33 +2 -2
+ Changes/cleanup from Dave Mills
+
+ChangeSet@1.1202.1.35, 2004-10-08 19:43:05-04:00, stenn@whimsy.udel.edu
+ Dave Mills: No autokey over the wildcard interface
+
+ ntpd/ntp_proto.c@1.181.1.4 +17 -15
+ Dave Mills: No autokey over the wildcard interface
+
+ChangeSet@1.1202.1.34, 2004-10-07 22:49:19-04:00, mayer@pogo.udel.edu
+ Win32 fix for refclock_open() signature change
+
+ ports/winnt/include/win32_io.h@1.5 +1 -1
+ Win32 fix for refclock_open() signature change
+
+ ports/winnt/ntpd/win32_io.c@1.7.1.2 +2 -2
+ Win32 fix for refclock_open() signature change
+
+ChangeSet@1.1202.1.33, 2004-10-07 22:43:33-04:00, mayer@pogo.udel.edu
+ Modification to have broadcast servers enable the socket for broadcast (missing argument)
+
+ ntpd/ntp_io.c@1.119.1.3 +1 -1
+ Modification to have broadcast servers enable the socket for broadcast (missing argument)
+
+ChangeSet@1.1202.1.32, 2004-10-07 22:40:57-04:00, mayer@pogo.udel.edu
+ Modification to have broadcast servers enable the socket for broadcast
+
+ include/ntpd.h@1.69 +4 -4
+ Modification to have broadcast servers enable the socket for broadcast
+
+ ntpd/ntp_io.c@1.119.1.2 +18 -0
+ Modification to have broadcast servers enable the socket for broadcast
+
+ ntpd/ntp_peer.c@1.60 +8 -0
+ Modification to have broadcast servers enable the socket for broadcast
+
+ChangeSet@1.1202.1.31, 2004-10-06 22:21:10-04:00, stenn@whimsy.udel.edu
+ Remove PTB and USNO lint
+
+ README.refclocks@1.3 +2 -2
+ Remove PTB and USNO lint
+
+ configure.ac@1.351.1.7 +0 -40
+ Remove PTB and USNO lint
+
+ChangeSet@1.1202.1.30, 2004-10-05 18:27:54-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ ntpd/ntp_control.c@1.70.1.2 +2 -2
+ Cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.98 +4 -4
+ Cleanup from Dave Mills
+
+ ntpd/ntp_request.c@1.58 +1 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_util.c@1.32 +2 -2
+ Cleanup from Dave Mills
+
+ChangeSet@1.1202.1.29, 2004-10-02 03:56:39-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ include/ntp_refclock.h@1.17 +6 -4
+ Cleanup from Dave Mills
+
+ include/ntpd.h@1.68 +0 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_config.c@1.109 +4 -1
+ Cleanup from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.97 +37 -31
+ Cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.181.1.3 +2 -5
+ Cleanup from Dave Mills
+
+ ntpd/ntp_refclock.c@1.60 +205 -180
+ Cleanup from Dave Mills
+
+ ntpd/ntp_request.c@1.57 +2 -2
+ Cleanup from Dave Mills
+
+ ntpd/refclock_acts.c@1.14 +134 -72
+ Cleanup from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.13 +4 -11
+ Cleanup from Dave Mills
+
+ChangeSet@1.1202.1.28, 2004-09-22 23:23:06-04:00, mayer@pogo.udel.edu
+ Fix the precompiled header issue
+
+ ports/winnt/libntp/libntp.dsp@1.18.1.1 +13 -1
+ Fix the precompiled header issue
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.4.1.1 +2 -2
+ Fix the precompiled header issue
+
+ ports/winnt/ntpd/ntpd.dsp@1.21.1.1 +6 -2
+ Fix the precompiled header issue
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.13.1.1 +2 -2
+ Fix the precompiled header issue
+
+ ports/winnt/ntpq/ntpq.dsp@1.13.1.1 +2 -2
+ Fix the precompiled header issue
+
+ChangeSet@1.1202.1.27, 2004-09-22 23:21:56-04:00, mayer@pogo.udel.edu
+ Add support for VS.NET (aka V7) and finally fix the RPC Async header issues
+
+ ports/winnt/include/config.h@1.26.1.1 +9 -6
+ Add support for VS.NET (aka V7) and finally fix the RPC Async header issues
+
+ChangeSet@1.1202.1.26, 2004-09-22 23:20:39-04:00, mayer@pogo.udel.edu
+ total_buffs() and full_buffs() were returning the wrong value
+
+ libntp/recvbuff.c@1.8.1.1 +2 -2
+ total_buffs() and full_buffs() were returning the wrong value
+
+ChangeSet@1.1238, 2004-09-22 23:19:14-04:00, mayer@tecotoo.
+ total_buffs() and full_buffs() were returning the wrong value
+
+ libntp/recvbuff.c@1.9 +2 -2
+ total_buffs() and full_buffs() were returning the wrong value
+
+ChangeSet@1.1237, 2004-09-22 23:09:51-04:00, mayer@tecotoo.
+ Add support for VS.NET (aka V7) and finally fix the RPC Async header issues
+
+ ports/winnt/include/config.h@1.29 +7 -6
+ Add support for VS.NET (aka V7) and finally fix the RPC Async header issues
+
+ChangeSet@1.1236, 2004-09-22 00:40:32-04:00, mayer@tecotoo.
+ Fix the precompiled header issue
+
+ ports/winnt/libntp/libntp.dsp@1.21 +1 -1
+ Fix the precompiled header issue
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.5 +2 -2
+ Fix the precompiled header issue
+
+ ports/winnt/ntpd/ntpd.dsp@1.22 +6 -2
+ Fix the precompiled header issue
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.14 +2 -2
+ Fix the precompiled header issue
+
+ ports/winnt/ntpq/ntpq.dsp@1.14 +2 -2
+ Fix the precompiled header issue
+
+ChangeSet@1.1202.1.25, 2004-09-16 22:45:42-04:00, stenn@whimsy.udel.edu
+ look for recvmsg()
+
+ configure.ac@1.351.1.6 +1 -1
+ look for recvmsg()
+
+ChangeSet@1.1202.1.24, 2004-09-13 22:31:34-04:00, stenn@whimsy.udel.edu
+ Remove #undef UDP_WILDCARD_DELIVERY per Danny Mayer
+
+ ntpd/ntp_io.c@1.119.1.1 +0 -1
+ Remove #undef UDP_WILDCARD_DELIVERY per Danny Mayer
+
+ChangeSet@1.1202.1.23, 2004-09-13 04:09:52-04:00, stenn@whimsy.udel.edu
+ Dave Mills: flag3 chooses 1200 or 9600 baud.
+
+ ntpd/refclock_acts.c@1.13 +9 -4
+ Dave Mills: flag3 chooses 1200 or 9600 baud.
+
+ChangeSet@1.1202.1.22, 2004-09-12 16:53:03-04:00, stenn@whimsy.udel.edu
+ more modem cleanup stuff
+
+ BitKeeper/deleted/.del-refclock_ptbacts.c~3e480692@1.3 +0 -0
+ Delete: ntpd/refclock_ptbacts.c
+
+ BitKeeper/deleted/.del-refclock_usno.c~3aed0663@1.9 +0 -0
+ Delete: ntpd/refclock_usno.c
+
+ ntpd/Makefile.am@1.38 +2 -2
+ Remove the old ptbs and usno drivers
+
+ ntpd/refclock_acts.c@1.12 +23 -34
+ cleanup and fixes from Dave Mills
+
+ ports/winnt/ntpd/ntpd.dsp@1.21 +0 -10
+ Remove the old ptbs and usno drivers
+
+ChangeSet@1.1202.2.3, 2004-09-12 01:00:57-04:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills. Combine/simplify the modem driver to
+ handle ACTS, NIST, PTB, and USNO.
+
+ include/ntp.h@1.101.1.2 +5 -11
+ Combine the modem refclocks into a single driver.
+
+ Update the poll randomization stuff.
+
+ include/ntp_refclock.h@1.16 +2 -1
+ Added refclock_timer().
+
+ include/ntpd.h@1.67 +1 -0
+ added refclock_timeout().
+
+ libntp/clocktypes.c@1.16 +6 -6
+ Use the new refclock_acts for NIST, PTB, USNO
+
+ ntpd/ntp_config.c@1.108 +2 -1
+ phone numbers now need a \r appended.
+
+ ntpd/ntp_proto.c@1.181.2.1 +92 -99
+ Cleanup and fixes.
+
+ ntpd/ntp_refclock.c@1.59 +18 -0
+ Added refclock_timer().
+
+ ntpd/ntp_timer.c@1.28 +9 -0
+ Call refclock_timer().
+
+ ntpd/refclock_acts.c@1.11 +586 -705
+ Handle NIST/USNO/PTB/NPL over a modem.
+
+ ntpd/refclock_conf.c@1.24 +3 -15
+ PTB and USNO now use the common ACTS code.
+
+ChangeSet@1.1202.2.2, 2004-09-07 06:41:51-04:00, stenn@whimsy.udel.edu
+ Use SNDCTL_DSP_SETFRAGMENT if available. From Tim Shoppa.
+
+ libntp/audio.c@1.23 +9 -0
+ Use SNDCTL_DSP_SETFRAGMENT if available. From Tim Shoppa.
+
+ChangeSet@1.1202.2.1, 2004-09-03 22:34:20-04:00, stenn@whimsy.udel.edu
+ Comment improvement from Dave Mills
+
+ include/ntp.h@1.101.1.1 +1 -1
+ Comment improvement from Dave Mills
+
+ChangeSet@1.1202.1.20, 2004-09-03 22:04:08-04:00, mayer@pogo.udel.edu
+ INT_MULTICAST now INT_MCASTOPEN
+
+ ntpd/ntp_monitor.c@1.12.1.1 +1 -1
+ INT_MULTICAST now INT_MCASTOPEN
+
+ ntpd/ntp_proto.c@1.181.1.1 +2 -2
+ INT_MULTICAST now INT_MCASTOPEN
+
+ChangeSet@1.1233, 2004-09-03 21:56:58-04:00, mayer@tecotoo.
+ INT_MULTICAST now INT_MCASTOPEN
+
+ ntpd/ntp_monitor.c@1.13 +1 -1
+ INT_MULTICAST now INT_MCASTOPEN
+
+ ntpd/ntp_proto.c@1.182 +2 -2
+ INT_MULTICAST now INT_MCASTOPEN
+
+ChangeSet@1.1202.1.19, 2004-09-02 21:41:05-04:00, stenn@whimsy.udel.edu
+ Dave Mills: RSTR kiss+iburst retried too often
+
+ ntpd/ntp_proto.c@1.181 +24 -33
+ Dave Mills: RSTR kiss+iburst retried too often
+
+ChangeSet@1.1202.1.18, 2004-08-30 04:27:54-04:00, stenn@www.ntp.org
+ [Bug 153] Initial pass at framework to fix bug
+
+ ntpd/ntp_config.c@1.107 +19 -9
+ [Bug 153] Initial pass at framework to fix bug
+
+ChangeSet@1.1202.1.17, 2004-08-25 21:27:18-04:00, stenn@www.ntp.org
+ avoid overwriting self
+
+ util/ntp-keygen.c@1.30 +5 -1
+ avoid overwriting self
+
+ChangeSet@1.1202.1.16, 2004-08-25 01:16:52-04:00, stenn@whimsy.udel.edu
+ added sntp.1 and did a little cleanup
+
+ sntp/Makefile.am@1.4 +5 -1
+ added sntp.1 and did a little cleanup
+
+ sntp/header.h@1.5 +2 -2
+ added sntp.1 and did a little cleanup
+
+ sntp/main.c@1.4 +8 -8
+ added sntp.1 and did a little cleanup
+
+ sntp/sntp.1@1.3 +25 -15
+ added sntp.1 and did a little cleanup
+
+ sntp/sntp.1@1.2 +0 -0
+ Rename: sntp/msntp.1 -> sntp/sntp.1
+
+ sntp/msntp.1@1.1 +325 -0
+
+ sntp/msntp.1@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/sntp/msntp.1
+
+ChangeSet@1.1202.1.15, 2004-08-23 22:08:55-04:00, stenn@www.ntp.org
+ make propdelay compile/link
+
+ clockstuff/Makefile.am@1.4 +1 -1
+ make propdelay compile/link
+
+ clockstuff/propdelay.c@1.4 +6 -6
+ make propdelay compile/link
+
+ChangeSet@1.1202.1.14, 2004-08-19 23:22:20-04:00, stenn@whimsy.udel.edu
+ [Bug 300] Properly report V3 reslist bits
+
+ ntpdc/ntpdc_ops.c@1.34.1.1 +25 -7
+ [Bug 300] Properly report V3 reslist bits
+
+ChangeSet@1.1202.1.13, 2004-08-19 23:15:44-04:00, stenn@whimsy.udel.edu
+ typo fix
+
+ ntpd/ntp_loopfilter.c@1.96 +1 -1
+ typo fix
+
+ChangeSet@1.1229, 2004-08-19 18:34:48-04:00, mayer@pogo.udel.edu
+ Change debug level of interrupted select to 5
+
+ ntpd/ntpd.c@1.56 +3 -3
+ Change debug level of interrupted select to 5
+
+ChangeSet@1.1228, 2004-08-19 18:33:09-04:00, mayer@pogo.udel.edu
+ Fixed IPv6 multicast to use correct scope for interface
+
+ ntpd/ntp_io.c@1.138 +24 -12
+ Fixed IPv6 multicast to use correct scope for interface
+
+ChangeSet@1.1227, 2004-08-16 19:31:28-04:00, mayer@pogo.udel.edu
+ Miscellaneous fixes for sitelocal and linklocal IPv6 addresses
+
+ ntpd/ntp_io.c@1.137 +23 -6
+ Miscellaneous fixes for sitelocal and linklocal IPv6 addresses
+
+ChangeSet@1.1226, 2004-08-15 23:32:21-04:00, mayer@tecotoo.
+ Typo, should have checked for INT_MULTICAST instead of INT_BROADCAST
+
+ ntpd/ntp_io.c@1.136 +1 -1
+ Typo should have checked for INT_MULTICAST instead of INT_BROADCAST
+
+ChangeSet@1.1225, 2004-08-15 23:16:22-04:00, mayer@tecotoo.
+ In IPv6 when looking for a multicast address check if the remote address is multicast
+
+ ntpd/ntp_io.c@1.135 +21 -2
+ In IPv6 when looking for a multicast address check if the remote address is multicast
+
+ChangeSet@1.1224, 2004-08-15 21:45:50-04:00, mayer@tecotoo.
+ Added more detailed debug print statements
+
+ ntpd/ntp_io.c@1.134 +18 -18
+ Added more detailed debug print statements
+
+ChangeSet@1.1223, 2004-08-15 12:14:57-04:00, mayer@tecotoo.
+ rewrote adding multicast client and added find_interface_index
+
+ ntpd/ntp_io.c@1.133 +44 -54
+ rewrote adding multicast client and added find_interface_index
+
+ChangeSet@1.1222, 2004-08-15 01:34:53-04:00, mayer@tecotoo.
+ Use Id of the interface when printing join multicast group failures
+
+ ntpd/ntp_io.c@1.132 +3 -3
+ Use Id of the interface when printing join multicast group failures
+
+ChangeSet@1.1221, 2004-08-15 01:20:41-04:00, mayer@tecotoo.
+ Added debug print statements
+
+ ntpd/ntp_io.c@1.131 +12 -6
+ Added debug print statements
+
+ChangeSet@1.1220, 2004-08-14 23:33:00-04:00, mayer@tecotoo.
+ Redid findinterface and findbcastinter to properly find appropriate interface and use the family member from the interface struct
+
+ include/ntp.h@1.102 +14 -13
+ Added family to interface struct
+
+ ntpd/ntp_io.c@1.130 +86 -97
+ Redid findinterface and findbcastinter to properly find appropriate interface and use the family member from the interface struct
+
+ChangeSet@1.1202.1.12, 2004-08-13 05:48:21-04:00, stenn@pogo.udel.edu
+ [Bug 301] ntp-keygen has no usage statement
+
+ util/ntp-keygen.c@1.29 +44 -4
+ [Bug 301] ntp-keygen has no usage statement
+
+ChangeSet@1.1218, 2004-08-12 16:54:31-04:00, mayer@pogo.udel.edu
+ findbcastinter needs to find a proper broadcast interface
+
+ ntpd/ntp_io.c@1.129 +236 -5
+ findbcastinter needs to find a proper broadcast interface
+
+ChangeSet@1.1202.1.11, 2004-08-12 05:12:15-04:00, stenn@whimsy.udel.edu
+ Use AC_HELP_STRING in configure.ac
+
+ configure.ac@1.351.1.5 +35 -20
+ Use AC_HELP_STRING in configure.ac
+
+ChangeSet@1.1217, 2004-08-11 23:06:43-04:00, mayer@tecotoo.
+ Added files for inet_*ton functions
+
+ ports/winnt/libntp/libntp.dsp@1.20 +4 -0
+ Added files for inet_*ton functions
+
+ChangeSet@1.1202.1.10, 2004-08-11 22:28:30-04:00, stenn@whimsy.udel.edu
+ FreeBSD lint
+
+ Makefile.am@1.48 +5 -5
+ FreeBSD lint
+
+ ntpdc/ntpdc.c@1.34 +5 -1
+ FreeBSD lint
+
+ ntpq/ntpq.c@1.49 +5 -1
+ FreeBSD lint
+
+ChangeSet@1.1216, 2004-08-11 18:04:11-04:00, mayer@pogo.udel.edu
+ interfaces are not TCP-specific
+
+ ports/winnt/libisc/interfaceiter.c@1.4.1.1 +1 -1
+ interfaces are not TCP-specific
+
+ChangeSet@1.1202.1.9, 2004-08-11 18:00:52-04:00, mayer@pogo.udel.edu
+ interfaces are not TCP-specific
+
+ ports/winnt/libisc/interfaceiter.c@1.5 +1 -1
+ interfaces are not TCP-specific
+
+ChangeSet@1.1202.1.8, 2004-08-10 19:36:31-04:00, mayer@pogo.udel.edu
+ Fix to emit error strings when getting errors from system
+
+ ports/winnt/ntpd/win32_io.c@1.7.1.1 +8 -8
+ Fix to emit error strings when getting errors from system
+
+ChangeSet@1.1214, 2004-08-10 19:25:24-04:00, mayer@pogo.udel.edu
+ Fix to emit error strings when getting errors from system
+
+ ports/winnt/ntpd/win32_io.c@1.8 +8 -8
+ Fix to emit error strings when getting errors from system
+
+ChangeSet@1.1202.1.7, 2004-08-10 01:24:58-04:00, stenn@www.ntp.org
+ [Bug 208] Use -R in LDFLAGS when needed. (some other cleanup, too)
+
+ configure.ac@1.351.1.4 +34 -12
+ [Bug 208] Use -R in LDFLAGS when needed. (some other cleanup, too)
+
+ChangeSet@1.1202.1.6, 2004-08-09 05:39:43-05:00, stenn@poog.il.thewrittenword.com
+ OSF needs sys/time.h to test for sys/timex.h
+
+ configure.ac@1.351.1.3 +7 -1
+ OSF needs sys/time.h to test for sys/timex.h
+
+ChangeSet@1.1202.1.5, 2004-08-09 05:38:32-05:00, stenn@poog.il.thewrittenword.com
+ OSF cflags cleanup
+
+ BitKeeper/etc/logging_ok@1.50 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ m4/os_cflags.m4@1.2 +23 -22
+ OSF cflags cleanup
+
+ChangeSet@1.1202.1.4, 2004-08-07 07:22:03-04:00, stenn@whimsy.udel.edu
+ [Bug 166] Clean up Irix compile/link flags for 32/64 bits
+
+ BitKeeper/deleted/.del-acinclude.m4~457f12ef@1.13 +0 -0
+ Delete: acinclude.m4
+
+ Makefile.am@1.47 +5 -2
+ [Bug 166] Clean up Irix compile/link flags for 32/64 bits
+
+ configure.ac@1.351.1.2 +1 -19
+ [Bug 166] Clean up Irix compile/link flags for 32/64 bits
+
+ configure.ac@1.351.1.1 +0 -0
+ Rename: configure.in -> configure.ac
+
+ m4/define_dir.m4@1.1 +26 -0
+
+ m4/define_dir.m4@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/m4/define_dir.m4
+
+ m4/hs_ulong_const.m4@1.1 +11 -0
+
+ m4/hs_ulong_const.m4@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/m4/hs_ulong_const.m4
+
+ m4/os_cflags.m4@1.1 +86 -0
+
+ m4/os_cflags.m4@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev-hms/m4/os_cflags.m4
+
+ChangeSet@1.1202.1.3, 2004-08-06 03:42:21-04:00, stenn@www.ntp.org
+ [Bug 321] Fix some alpha alignment issues and avoid a possibile DOS
+
+ BitKeeper/etc/logging_ok@1.49 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ntpd/ntp_control.c@1.70.1.1 +7 -4
+ [Bug 321] Fix some alpha alignment issues and avoid a possibile DOS
+
+ChangeSet@1.1202.1.2, 2004-08-05 23:40:16-04:00, stenn@whimsy.udel.edu
+ No more autokey/rsa for mkver, just openssl now.
+
+ scripts/mkver.in@1.11 +5 -8
+ No more autokey/rsa for mkver, just openssl now.
+
+ChangeSet@1.1202.1.1, 2004-08-05 23:33:23-04:00, stenn@whimsy.udel.edu
+ [Bug 326] handle MAXTOKEN overflow better.
+
+ ntpd/ntp_config.c@1.106 +27 -10
+ [Bug 326] handle MAXTOKEN overflow better.
+
+ChangeSet@1.1212, 2004-08-05 00:14:18-04:00, mayer@tecotoo.
+ Look for PPP for interface to the outside
+
+ ntpd/ntp_io.c@1.128 +18 -0
+ Look for PPP for interface to the outside
+
+ChangeSet@1.1211, 2004-08-04 18:41:17-04:00, mayer@pogo.udel.edu
+ Fix cast in ntohl
+
+ ntpdc/ntpdc_ops.c@1.35 +23 -23
+ Fix cast in ntohl
+
+ChangeSet@1.1210, 2004-08-04 18:10:22-04:00, mayer@pogo.udel.edu
+ Fixes for scope ID
+
+ libisc/interfaceiter.c@1.11 +6 -1
+ Fixes for scope ID
+
+ ntpd/ntp_io.c@1.127 +3 -2
+ Fixes for scope ID
+
+ChangeSet@1.1209, 2004-08-04 02:28:09-04:00, mayer@tecotoo.
+ Fix setting of only interface code
+
+ ntpd/ntp_io.c@1.126 +2 -2
+ Fix setting of only interface code
+
+ChangeSet@1.1208, 2004-08-03 18:39:54-04:00, mayer@pogo.udel.edu
+ Linklocal and sitelocal IPv6 changes
+
+ include/ntp_rfc2553.h@1.26 +14 -0
+ Add link-local and site-local IPv6 macros
+
+ ntpd/ntp_io.c@1.125 +18 -0
+ Add check for link-local and site-local for IPv6 addresses when looking for interfaces
+
+ChangeSet@1.1207, 2004-08-02 22:36:39-04:00, mayer@tecotoo.
+ findbcastinter should look for INT_BROADCAST flag
+
+ ntpd/ntp_io.c@1.124 +1 -1
+ findbcastinter should look for INT_BROADCAST flag
+
+ChangeSet@1.1206, 2004-08-02 22:19:13-04:00, mayer@tecotoo.
+ findinterface cleanup and IPv4/IPv6 fixes
+
+ configure.in@1.352 +2 -0
+ Add check for inet_pton and inet_aton
+
+ libntp/ntp_rfc2553.c@1.20 +8 -2
+ fix port assignment
+
+ ntpd/ntp_io.c@1.123 +1 -2
+ Ongoing findinterface cleanup
+
+ChangeSet@1.1205, 2004-08-02 20:44:31-04:00, mayer@pogo.udel.edu
+ Changes for proper IPv4 and IPv6 support
+
+ libisc/inet_aton.c@1.2 +0 -3
+ Remove temporary changes to support Winnt
+
+ libntp/Makefile.am@1.30 +3 -1
+ Added inet_pton and inet_aton to libisc
+
+ libntp/ntp_rfc2553.c@1.19 +2 -2
+ Reorder the includes to prevent warnings
+
+ libntp/ntp_rfc2553.c@1.18 +20 -15
+ Change to use inet_pton and cleanly support at least IPv6 addresses
+
+ ntpd/ntp_io.c@1.122 +2 -15
+ changes to find the right local interface for outgoing packets
+
+ ports/winnt/include/config.h@1.28 +1 -0
+ Added isascii, required for inet_aton
+
+ChangeSet@1.1204, 2004-08-02 00:35:56-04:00, mayer@tecotoo.
+ Updates to support finding interfaces and address lookups
+
+ libisc/inet_aton.c@1.1 +198 -0
+
+ libisc/inet_aton.c@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/libisc/inet_aton.c
+
+ libisc/inet_pton.c@1.1 +211 -0
+
+ libisc/inet_pton.c@1.0 +0 -0
+ BitKeeper file H:/ntpbk/ntp-dev/libisc/inet_pton.c
+
+ libntp/ntp_rfc2553.c@1.17 +15 -74
+ fix the code to properly handle addresses.
+
+ ntpd/ntp_control.c@1.71 +0 -1
+ no change
+
+ ntpd/ntp_io.c@1.121 +82 -3
+ changes to properly find outgoing interfaces
+
+ ports/winnt/include/config.h@1.27 +1 -0
+ Need inet_pton
+
+ ports/winnt/libntp/libntp.dsp@1.19 +8 -0
+ Add inet_pton and inet_aton
+
+ChangeSet@1.1203, 2004-07-28 23:44:06-04:00, mayer@tecotoo.
+ clean up finding addresses and interfaces
+
+ ntpd/ntp_io.c@1.120 +37 -50
+ clean up finding addresses and interfaces
+
+ChangeSet@1.1202, 2004-07-27 19:24:53-04:00, mayer@pogo.udel.edu
+ Changes for conditional support of broadcast and multicast on some platforms
+
+ ntpd/ntp_io.c@1.119 +3 -2
+ Changes for conditional support of broadcast and multicast on some platforms
+
+ChangeSet@1.1201, 2004-07-26 23:12:26-04:00, mayer@tecotoo.
+ Code cleanup and simplification
+
+ ntpd/ntp_io.c@1.118 +104 -101
+ Code cleanup and simplification
+
+ChangeSet@1.1200, 2004-07-26 10:18:16-04:00, mayer@pogo.udel.edu
+ Not all O/S's support broadcast. Conditionally build the socket_broadcast_* code
+
+ ntpd/ntp_io.c@1.117 +6 -4
+ Not all O/S's support broadcast. Conditionally build the socket_broadcast_* code
+
+ChangeSet@1.1199, 2004-07-25 23:28:14-04:00, mayer@tecotoo.
+ Not all platforms support Multicast
+
+ ntpd/ntp_io.c@1.116 +6 -0
+ Not all platforms support Multicast
+
+ChangeSet@1.1198, 2004-07-25 23:07:04-04:00, mayer@tecotoo.
+ Minor bugs in IPv6 codes. Remove unused variables
+
+ ntpd/ntp_io.c@1.115 +3 -6
+ Minor bugs in IPv6 codes. Remove unused variables
+
+ChangeSet@1.1197, 2004-07-25 22:44:57-04:00, mayer@tecotoo.
+ Rewrite multicast and broadcast routines to remove wildcard requirements, improve flexibility and general code improvements
+
+ ntpd/ntp_io.c@1.114 +328 -245
+ Rewrite multicast and broadcast routines to remove wildcard requirements, improve flexibility and general code improvements
+
+ChangeSet@1.1192.1.2, 2004-07-22 00:20:36-04:00, mayer@tecotoo.
+ If we can't figure out the address type assume it's IPv4
+
+ libntp/socktoa.c@1.7 +3 -0
+ If we can't figure out the address type assume it's IPv4
+
+ChangeSet@1.1189.1.2, 2004-07-22 00:11:05-04:00, mayer@tecotoo.
+ For Multicast make sure socket can handle multicast
+
+ ntpd/ntp_io.c@1.113 +16 -10
+ For Multicast make sure socket can handle multicast
+
+ChangeSet@1.1195, 2004-07-20 02:42:59-04:00, stenn@whimsy.udel.edu
+ [Bug 307] Typo fix from Volkmar Grote
+
+ html/monopt.html@1.19 +2 -2
+ [Bug 307] Typo fix from Volkmar Grote
+
+ChangeSet@1.1194, 2004-07-20 02:26:12-04:00, stenn@whimsy.udel.edu
+ [Bug 233] Apply rest of patch from Matthias Drochner
+
+ ntpd/refclock_shm.c@1.16 +4 -1
+ [Bug 233] Apply rest of patch from Matthias Drochner
+
+ ntpdc/ntpdc_ops.c@1.34 +5 -5
+ [Bug 233] Apply rest of patch from Matthias Drochner
+
+ChangeSet@1.1193, 2004-07-16 01:20:38-04:00, stenn@whimsy.udel.edu
+ [Bug 315] Provide prereq headers for configure.in
+
+ configure.in@1.351 +28 -2
+ [Bug 315] Provide prereq headers for configure.in
+
+ChangeSet@1.1189.1.1, 2004-07-12 21:57:57-04:00, mayer@tecotoo.
+ IPv6 addresses caused the resultant refid to get it's values swapped on some machines
+
+ libntp/a_md5encrypt.c@1.18 +1 -1
+ IPv6 addresses caused the resultant refid to get it's values swapped on some machines
+
+ChangeSet@1.1191, 2004-07-12 19:36:51-04:00, stenn@whimsy.udel.edu
+ Use UTC for the date in the version string for mkver.in
+
+ scripts/mkver.in@1.10 +1 -1
+ Use UTC for the date in the version string
+
+ChangeSet@1.1178.1.13, 2004-07-07 00:52:39-04:00, stenn@whimsy.udel.edu
+ Fix from Dave Mills
+
+ libntp/systime.c@1.31 +2 -7
+ Fix from Dave Mills
+
+ChangeSet@1.1189, 2004-07-05 23:36:39-04:00, mayer@tecotoo.
+ Multicast modifications and extraneous macro definition removal
+
+ include/ntp.h@1.101 +2 -1
+ Flags change to differentiate between mulitcast capable and multicast in use
+
+ ntpd/ntp_io.c@1.112 +8 -6
+ Add multicast capable flags when available.
+ Change multicast flag to show socket is being used for multicast
+
+ ntpd/ntpd.c@1.55 +2 -4
+ Remove unnecessary macro condition
+
+ChangeSet@1.1188, 2004-07-03 18:30:24-04:00, mayer@tecotoo.
+ include updates for winnt
+
+ ports/winnt/libntp/libntp.dsp@1.18 +4 -0
+ Added ntp_rfc2553.h to list of includes
+
+ ports/winnt/ntpd/ntpd.dsp@1.20 +0 -4
+ map_vme.c not used.
+
+ChangeSet@1.1187, 2004-07-03 17:54:02-04:00, mayer@tecotoo.
+ Removed unreachable code
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.12 +0 -1
+ Removed unreachable code
+
+ChangeSet@1.1186, 2004-07-03 17:52:50-04:00, mayer@tecotoo.
+ #endif was in wrong place
+
+ ntpd/ntp_proto.c@1.180 +1 -1
+ #endif was in wrong place
+
+ChangeSet@1.1183, 2004-07-03 16:56:20-04:00, mayer@tecotoo.
+ handle empty sockets and unknown address family
+
+ libntp/socktoa.c@1.6 +8 -2
+ handle empty sockets and unknown address family
+
+ChangeSet@1.1178.1.12, 2004-05-06 01:39:49-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ html/drivers/driver36.html@1.23 +0 -2
+ Cleanup from Dave Mills
+
+ html/drivers/driver6.html@1.18 +0 -2
+ Cleanup from Dave Mills
+
+ html/drivers/driver7.html@1.21 +0 -2
+ Cleanup from Dave Mills
+
+ html/drivers/scripts/footer.txt@1.1 +7 -0
+
+ html/drivers/scripts/footer.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/drivers/scripts/footer.txt
+
+ html/drivers/scripts/style.css@1.1 +64 -0
+
+ html/drivers/scripts/style.css@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/drivers/scripts/style.css
+
+ChangeSet@1.1178.1.11, 2004-05-04 03:43:00-04:00, stenn@whimsy.udel.edu
+ [Bug 305] More lint
+
+ ntpd/ntp_refclock.c@1.58 +1 -1
+ [Bug 305] More lint
+
+ChangeSet@1.1178.3.1, 2004-05-04 01:01:59-04:00, stenn@whimsy.udel.edu
+ Cleanup/fixes from Dave Mills.
+
+ include/ntpd.h@1.66 +1 -0
+ Cleanup/fixes from Dave Mills.
+
+ ntpd/ntp_filegen.c@1.9 +5 -0
+ Cleanup/fixes from Dave Mills.
+
+ ntpd/ntp_loopfilter.c@1.95 +5 -3
+ Cleanup/fixes from Dave Mills.
+
+ChangeSet@1.1181, 2004-04-25 10:35:51-04:00, mayer@tecotoo.
+ Bug fix
+
+ ports/winnt/include/config.h@1.24.1.1 +1 -1
+
+ChangeSet@1.1178.1.8, 2004-04-23 19:23:39-04:00, mayer@pogo.udel.edu
+ Modification to correct for type errors
+
+ include/ntp_rfc2553.h@1.25 +16 -16
+ Move u_int*_t types to ntp_* to avoid conflicts
+
+ include/ntp_types.h@1.8 +3 -5
+ Move u_int*_t types to ntp_* to avoid conflicts
+
+ ntpd/ntp_io.c@1.110 +4 -0
+ Modified to add hex value of network address to output for Multicast errors
+
+ChangeSet@1.1178.2.3, 2004-04-19 20:20:20-04:00, stenn@whimsy.udel.edu
+ manycast poll bugfix from Dave Mills.
+
+ ntpd/ntp_proto.c@1.178 +1 -1
+ manycast poll bugfix from Dave Mills.
+
+ChangeSet@1.1178.2.2, 2004-04-17 17:33:32-04:00, stenn@pogo.udel.edu
+ Always see if we need in6addr_any
+
+ configure.in@1.350 +6 -5
+ Always see if we need in6addr_any
+
+ChangeSet@1.1178.2.1, 2004-04-17 17:32:38-04:00, stenn@pogo.udel.edu
+ Added cowbird to the flock-build
+
+ flock-build@1.30 +1 -1
+ Added cowbird to the flock-build
+
+ChangeSet@1.1178.1.5, 2004-04-16 20:42:21-04:00, mayer@pogo.udel.edu
+ Fix for AIX to initialize in6addr_any
+
+ libntp/ntp_rfc2553.c@1.16 +4 -1
+ Fix for AIX to initialize in6addr_any
+
+ ports/winnt/include/config.h@1.25 +2 -0
+ Fix for AIX to initialize in6addr_any
+
+ChangeSet@1.1152.34.1, 2004-04-11 18:53:56+01:00, mbrett@rgs16.fordson.demon.co.uk
+ Many files:
+ Changes for type-paranoid MIPSpro compiler.
+
+ ntpd/ntp_config.c@1.100.1.1 +1 -1
+ Changes for type-paranoid MIPSpro compiler.
+
+ ntpd/ntp_intres.c@1.32.1.1 +1 -1
+ Changes for type-paranoid MIPSpro compiler.
+
+ ntpd/ntp_io.c@1.105.2.1 +4 -4
+ Changes for type-paranoid MIPSpro compiler.
+
+ ntpd/ntp_proto.c@1.172.1.1 +3 -3
+ Changes for type-paranoid MIPSpro compiler.
+
+ ntpdc/ntpdc_ops.c@1.29.1.1 +17 -17
+ Changes for type-paranoid MIPSpro compiler.
+
+ ntpq/ntpq.c@1.45.1.1 +2 -2
+ Changes for type-paranoid MIPSpro compiler.
+
+ ntpq/ntpq_ops.c@1.20 +1 -1
+ Changes for type-paranoid MIPSpro compiler.
+
+ChangeSet@1.1178.1.4, 2004-04-07 20:45:38-04:00, stenn@whimsy.udel.edu
+ refclock_oncore.c cleanup from Reg Clemens
+
+ ntpd/refclock_oncore.c@1.51 +0 -11
+ refclock_oncore.c cleanup from Reg Clemens
+
+ChangeSet@1.1177.1.5, 2004-04-07 20:38:47-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ include/ntp.h@1.100 +2 -0
+ Cleanup from Dave Mills
+
+ include/ntp_control.h@1.25 +7 -6
+ Cleanup from Dave Mills
+
+ include/ntp_crypto.h@1.34 +2 -3
+ Cleanup from Dave Mills
+
+ ntpd/ntp_control.c@1.70 +20 -10
+ Cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.93 +21 -18
+ Cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.177 +9 -5
+ Cleanup from Dave Mills
+
+ ntpd/refclock_chu.c@1.35 +1 -1
+ Cleanup from Dave Mills
+
+ ntpq/ntpq.c@1.47 +1 -1
+ Cleanup from Dave Mills
+
+ChangeSet@1.1178.1.1, 2004-04-07 16:48:52-04:00, mayer@pogo.udel.edu
+ Fix for Windows select timeout
+
+ ntpdate/ntpdate.c@1.47 +17 -0
+ Fix for Windows select timeout
+
+ChangeSet@1.1177.1.4, 2004-04-07 15:48:32-04:00, stenn@whimsy.udel.edu
+ [Bug 275] Expose needed glue in ntp-keygen
+
+ util/ntp-keygen.c@1.28 +2 -2
+ [Bug 275] Expose needed glue in ntp-keygen
+
+ChangeSet@1.1177.1.3, 2004-04-06 00:56:17-04:00, stenn@whimsy.udel.edu
+ cleanup
+
+ include/timepps-Solaris.h@1.4 +0 -1
+ cleanup
+
+ChangeSet@1.1177.2.1, 2004-04-06 00:36:24-04:00, stenn@whimsy.udel.edu
+ Cleanup from Reg Clemens
+
+ include/timepps-Solaris.h@1.3 +5 -0
+ Cleanup from Reg Clemens
+
+ include/timepps-SunOS.h@1.3 +1 -4
+ Cleanup from Reg Clemens
+
+ChangeSet@1.1177.1.1, 2004-04-05 14:11:34-04:00, stenn@whimsy.udel.edu
+ [Bug 299] Distribute timepps-*.h
+
+ include/Makefile.am@1.19 +3 -0
+ [Bug 299] Distribute timepps-*.h
+
+ChangeSet@1.1177, 2004-04-04 23:00:44-04:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills
+
+ include/ntp_crypto.h@1.33 +1 -0
+ Cleanup from Dave Mills
+
+ ntpd/ntp_crypto.c@1.92 +65 -42
+ Cleanup from Dave Mills
+
+ChangeSet@1.1176, 2004-04-04 22:44:03-04:00, stenn@whimsy.udel.edu
+ [Bug 241] Dave agrees the patch is correct.
+
+ ntpd/ntp_config.c@1.102.1.2 +0 -5
+ [Bug 241] Dave agrees the patch is correct.
+
+ChangeSet@1.1175, 2004-04-03 21:18:24-05:00, stenn@whimsy.udel.edu
+ [Bug 275] Build ntp-keygen even if no OPENSSL.
+
+ configure.in@1.349 +0 -3
+ [Bug 275] Build ntp-keygen even if no OPENSSL.
+
+ util/Makefile.am@1.24 +2 -2
+ [Bug 275] Build ntp-keygen even if no OPENSSL.
+
+ util/ntp-keygen.c@1.27 +49 -5
+ [Bug 275] Build ntp-keygen even if no OPENSSL.
+
+ChangeSet@1.1174, 2004-04-03 02:48:23-05:00, stenn@whimsy.udel.edu
+ [Bug 241] Fix from Matthias Drochner
+
+ ntpd/ntp_config.c@1.102.1.1 +2 -1
+ [Bug 241] Fix from Matthias Drochner
+
+ChangeSet@1.1152.33.2, 2004-04-03 02:17:22-05:00, stenn@whimsy.udel.edu
+ [Bug 277] Ultralink 325 support from Frank Migge
+
+ ntpd/refclock_ulink.c@1.13 +161 -69
+ [Bug 277] Ultralink 325 support from Frank Migge
+
+ChangeSet@1.1152.33.1, 2004-04-03 01:56:25-05:00, stenn@whimsy.udel.edu
+ [Bug 217] Typo in ntptrace
+
+ scripts/ntptrace.in@1.4 +1 -1
+ [Bug 217] Typo in ntptrace
+
+ChangeSet@1.1152.1.98, 2004-04-02 16:07:14-05:00, mayer@pogo.udel.edu
+ remove pps_device[] array that crept back in
+
+ ntpd/ntp_config.c@1.103 +0 -1
+ remove pps_device[] array that crept back in
+
+ChangeSet@1.1152.1.97, 2004-04-02 15:20:54-05:00, stenn@whimsy.udel.edu
+ [Bug 298] Fix typos in configure.in
+
+ configure.in@1.348 +2 -2
+ [Bug 298] Fix typos in configure.in
+
+ChangeSet@1.1152.32.5, 2004-04-01 15:23:22-05:00, mayer@pogo.udel.edu
+ ntpdc_ops.c:
+ undo all of the changes to the header include order as some systems in the flock had trouble with the reordering
+ ntpdc_ops.c, ntp_intres.c:
+ Undo some of the reordering of includes
+ Many files:
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+ ntp_fp.h:
+ change inclusion order of netinet/in.h and ntp_rfc2553.h
+
+ include/ntp_fp.h@1.11 +1 -1
+ change inclusion order of netinet/in.h and ntp_rfc2553.h
+
+ ntpd/ntp_config.c@1.102 +3 -2
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+
+ ntpd/ntp_intres.c@1.34 +9 -8
+ Undo some of the reordering of includes
+
+ ntpd/ntp_intres.c@1.33 +7 -7
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+
+ ntpd/ntp_resolver.c@1.17 +7 -7
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+
+ ntpd/refclock_nmea.c@1.23 +5 -5
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+
+ ntpdc/ntpdc.c@1.33 +5 -5
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+
+ ntpdc/ntpdc_ops.c@1.32 +6 -7
+ undo all of the changes to the header include order as some systems in the flock had trouble with the reordering
+
+ ntpdc/ntpdc_ops.c@1.31 +5 -4
+ Undo some of the reordering of includes
+
+ ntpdc/ntpdc_ops.c@1.30 +8 -8
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+
+ ntpq/ntpq.c@1.46 +7 -6
+ reorder includes to make sure that the AI_* macros don't get defined before the system has a chance to define them
+
+ChangeSet@1.1152.1.95, 2004-03-29 21:57:51-05:00, stenn@whimsy.udel.edu
+ New irig notes from Dave Mills
+
+ ntpd/refclock_irig.c@1.21 +14 -14
+ New notes from Dave Mills
+
+ChangeSet@1.1152.32.4, 2004-03-26 20:10:51-05:00, mayer@pogo.udel.edu
+ remove reference to include netdb.h. porkypine doesn't protect itself against multiple includes
+
+ include/ntp_rfc2553.h@1.24 +0 -1
+ remove reference to include netdb.h. porkypine doesn't protect itself against multiple includes
+
+ChangeSet@1.1152.32.3, 2004-03-26 19:39:33-05:00, mayer@pogo.udel.edu
+ Remove some includes as porkypine complained
+
+ include/ntp_rfc2553.h@1.23 +1 -13
+ Remove some includes as porkypine complained
+
+ChangeSet@1.1152.32.2, 2004-03-26 17:53:26-05:00, mayer@pogo.udel.edu
+ Fix the macros in ntp_rfc2553.h by including network headers and make ntp_io.c conditionally allow IPv6 multicast only if the macros are defined
+
+ include/ntp_rfc2553.h@1.22 +13 -0
+ add includes to ntp_rfc2553.h to ensure that macros are defined in case they don't need to be defined
+
+ ntpd/ntp_io.c@1.109 +2 -2
+ Make IPV6 multicast conditional on the inclusion of the IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP
+
+ChangeSet@1.1152.32.1, 2004-03-26 09:46:49-05:00, mayer@pogo.udel.edu
+ #endif for DEBUG was one line too far down, causing problems with release builds
+
+ ntpd/ntp_proto.c@1.176 +1 -1
+ #endif for DEBUG was one line too far down, causing problems with release builds
+
+ChangeSet@1.1152.31.6, 2004-03-25 21:20:54-05:00, stenn@whimsy.udel.edu
+ Fixed from Dave Mills.
+
+ ntpd/ntp_loopfilter.c@1.94 +3 -3
+ Fixed from Dave Mills.
+
+ChangeSet@1.1152.31.5, 2004-03-25 21:17:21-05:00, stenn@whimsy.udel.edu
+ jitter.c fixes from Dave Mills.
+
+ util/jitter.c@1.5 +67 -5
+ fixes from Dave Mills.
+
+ChangeSet@1.1152.31.4, 2004-03-25 21:13:54-05:00, stenn@whimsy.udel.edu
+ Documentation cleanup/resync with Dave.
+
+ html/build/build.html@1.20 +12 -12
+ Documentation cleanup/resync with Dave.
+
+ html/build/config.html@1.18 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/build/hints.html@1.14 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/build/hints/solaris.html@1.8 +1 -1
+ Documentation cleanup/resync with Dave.
+
+ html/build/hints/vxworks.html@1.7 +5 -5
+ Documentation cleanup/resync with Dave.
+
+ html/build/hints/winnt.html@1.15 +4 -4
+ Documentation cleanup/resync with Dave.
+
+ html/build/patches.html@1.17 +3 -3
+ Documentation cleanup/resync with Dave.
+
+ html/build/porting.html@1.13 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/build/quick.html@1.16 +6 -6
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver1.html@1.14 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver10.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver11.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver12.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver16.html@1.10 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver18.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver19.html@1.10 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver2.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver20.html@1.13 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver22.html@1.15 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver23.html@1.12 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver24.html@1.9 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver26.html@1.9 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver27.html@1.13 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver28.html@1.10 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver29.html@1.12 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver3.html@1.10 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver30.html@1.18 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver32.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver33.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver34.html@1.10 +80 -45
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver35.html@1.13 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver36.html@1.22 +3 -3
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver37.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver38.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver39.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver4.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver40.html@1.10 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver42.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver43.html@1.8 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver44.html@1.10 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver5.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver6.html@1.17 +3 -3
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver7.html@1.20 +3 -3
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver8.html@1.13 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/driver9.html@1.13 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ html/drivers/oncore-shmem.html@1.11 +2 -2
+ Documentation cleanup/resync with Dave.
+
+ChangeSet@1.1152.1.90, 2004-03-25 20:04:11-05:00, mayer@pogo.udel.edu
+ Added conditional macro for scope_id
+
+ libisc/interfaceiter.c@1.10 +5 -1
+ Added conditional macro for scope_id
+
+ ntpd/ntp_io.c@1.108 +4 -0
+ Added conditional macro for scope_id
+
+ChangeSet@1.1152.31.3, 2004-03-24 23:31:23-05:00, stenn@whimsy.udel.edu
+ Resync html/ with the master copy from Dave.
+
+ html/authopt.html@1.32 +5 -5
+ Resync html/ with the master copy from Dave.
+
+ html/build/build.html@1.19 +0 -0
+ Rename: html/build.html -> html/build/build.html
+
+ html/build/config.html@1.17 +0 -0
+ Rename: html/config.html -> html/build/config.html
+
+ html/build/hints.html@1.13 +0 -0
+ Rename: html/hints.html -> html/build/hints.html
+
+ html/build/hints/a-ux@1.3 +0 -0
+ mvdir
+
+ html/build/hints/aix@1.3 +0 -0
+ mvdir
+
+ html/build/hints/bsdi@1.3 +0 -0
+ mvdir
+
+ html/build/hints/changes@1.3 +0 -0
+ mvdir
+
+ html/build/hints/decosf1@1.3 +0 -0
+ mvdir
+
+ html/build/hints/decosf2@1.3 +0 -0
+ mvdir
+
+ html/build/hints/freebsd@1.3 +0 -0
+ mvdir
+
+ html/build/hints/hpux@1.3 +0 -0
+ mvdir
+
+ html/build/hints/linux@1.3 +0 -0
+ mvdir
+
+ html/build/hints/mpeix@1.3 +0 -0
+ mvdir
+
+ html/build/hints/netbsd@1.2 +0 -0
+ mvdir
+
+ html/build/hints/notes-xntp-v3@1.3 +0 -0
+ mvdir
+
+ html/build/hints/parse@1.3 +0 -0
+ mvdir
+
+ html/build/hints/refclocks@1.3 +0 -0
+ mvdir
+
+ html/build/hints/rs6000@1.3 +0 -0
+ mvdir
+
+ html/build/hints/sco.html@1.7 +0 -0
+ mvdir
+
+ html/build/hints/sgi@1.3 +0 -0
+ mvdir
+
+ html/build/hints/solaris-dosynctodr.html@1.4 +0 -0
+ mvdir
+
+ html/build/hints/solaris.html@1.7 +0 -0
+ mvdir
+
+ html/build/hints/solaris.xtra.4023118@1.3 +0 -0
+ mvdir
+
+ html/build/hints/solaris.xtra.4095849@1.3 +0 -0
+ mvdir
+
+ html/build/hints/solaris.xtra.S99ntpd@1.4 +0 -0
+ mvdir
+
+ html/build/hints/solaris.xtra.patchfreq@1.3 +0 -0
+ mvdir
+
+ html/build/hints/sun4@1.3 +0 -0
+ mvdir
+
+ html/build/hints/svr4-dell@1.3 +0 -0
+ mvdir
+
+ html/build/hints/svr4_package@1.3 +0 -0
+ mvdir
+
+ html/build/hints/todo@1.3 +0 -0
+ mvdir
+
+ html/build/hints/vxworks.html@1.6 +0 -0
+ mvdir
+
+ html/build/hints/winnt.html@1.14 +0 -0
+ mvdir
+
+ html/build/patches.html@1.16 +0 -0
+ Rename: html/patches.html -> html/build/patches.html
+
+ html/build/porting.html@1.12 +0 -0
+ Rename: html/porting.html -> html/build/porting.html
+
+ html/build/quick.html@1.15 +0 -0
+ Rename: html/quick.html -> html/build/quick.html
+
+ html/build/scripts/footer.txt@1.1 +7 -0
+
+ html/build/scripts/footer.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/footer.txt
+
+ html/build/scripts/links10.txt@1.1 +5 -0
+
+ html/build/scripts/links10.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links10.txt
+
+ html/build/scripts/links11.txt@1.1 +5 -0
+
+ html/build/scripts/links11.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links11.txt
+
+ html/build/scripts/links12.txt@1.1 +5 -0
+
+ html/build/scripts/links12.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links12.txt
+
+ html/build/scripts/links7.txt@1.1 +5 -0
+
+ html/build/scripts/links7.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links7.txt
+
+ html/build/scripts/links8.txt@1.1 +6 -0
+
+ html/build/scripts/links8.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links8.txt
+
+ html/build/scripts/links9.txt@1.1 +7 -0
+
+ html/build/scripts/links9.txt@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/links9.txt
+
+ html/build/scripts/style.css@1.1 +64 -0
+
+ html/build/scripts/style.css@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/build/scripts/style.css
+
+ html/drivers/driver31.html@1.1 +56 -0
+
+ html/drivers/driver31.html@1.0 +0 -0
+ BitKeeper file /deacon/backroom/ntp-dev/html/drivers/driver31.html
+
+ html/howto.html@1.17 +2 -2
+ Resync html/ with the master copy from Dave.
+
+ html/index.html@1.30 +9 -9
+ Resync html/ with the master copy from Dave.
+
+ html/notes.html@1.16 +2 -2
+ Resync html/ with the master copy from Dave.
+
+ html/release.html@1.29 +1 -1
+ Resync html/ with the master copy from Dave.
+
+ChangeSet@1.1152.31.2, 2004-03-24 22:04:57-05:00, stenn@whimsy.udel.edu
+ PPS cleanup from Dave Mills.
+
+ include/ntpd.h@1.65 +1 -2
+ PPS cleanup from Dave Mills.
+
+ ntpd/ntp_config.c@1.101 +0 -1
+ PPS cleanup from Dave Mills.
+
+ ntpd/ntp_loopfilter.c@1.93 +8 -1
+ PPS cleanup from Dave Mills.
+
+ ntpd/ntp_refclock.c@1.57 +7 -15
+ PPS cleanup from Dave Mills.
+
+ ntpd/refclock_atom.c@1.43 +11 -13
+ PPS cleanup from Dave Mills.
+
+ChangeSet@1.1152.31.1, 2004-03-24 21:55:36-05:00, stenn@whimsy.udel.edu
+ Have configure look for struct sockaddr_in6.sin6_scope_id
+
+ configure.in@1.347 +9 -0
+ Have configure look for struct sockaddr_in6.sin6_scope_id
+
+ChangeSet@1.1152.29.3, 2004-03-24 17:27:43-05:00, mayer@pogo.udel.edu
+ Change u_int64_t to ntp_int64_t to avoid O/S problems
+
+ include/ntp_rfc2553.h@1.21 +2 -2
+ Change u_int64_t to ntp_int64_t to avoid O/S problems
+
+ include/ntp_types.h@1.7 +1 -3
+ Change u_int64_t to ntp_int64_t to avoid O/S problems
+
+ChangeSet@1.1152.1.88, 2004-03-24 00:57:20-05:00, stenn@pogo.udel.edu
+ No parse clocks if we disable all clocks
+
+ flock-build@1.29 +2 -1
+ No parse clocks if we disable all clocks
+
+ChangeSet@1.1152.1.87, 2004-03-23 00:26:24-05:00, stenn@whimsy.udel.edu
+ Do --disable-all-clocks in flock-build, too.
+
+ build@1.21 +6 -0
+ Do --disable-all-clocks in flock-build, too.
+
+ flock-build@1.28 +3 -1
+ Do --disable-all-clocks in flock-build, too.
+
+ChangeSet@1.1152.1.86, 2004-03-23 00:07:02-05:00, stenn@whimsy.udel.edu
+ no refclock fixes from Dave Mills
+
+ ntpd/ntp_control.c@1.69 +2 -0
+ no refclock fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.175 +4 -1
+ no refclock fixes from Dave Mills
+
+ChangeSet@1.1152.1.85, 2004-03-22 23:59:43-05:00, stenn@whimsy.udel.edu
+ From Dave Mills: remove legacy local_refclock/prefer wrinkle.
+
+ ntpd/ntp_loopfilter.c@1.92 +0 -13
+ From Dave Mills: remove legacy local_refclock/prefer wrinkle.
+
+ChangeSet@1.1152.1.84, 2004-03-20 01:20:11-05:00, stenn@whimsy.udel.edu
+ [Bug 293] - out of bounds array write: Nathan Hintz
+
+ util/ntp-keygen.c@1.26 +1 -1
+ [Bug 293] - out of bounds array write: Nathan Hintz
+
+ChangeSet@1.1152.29.2, 2004-03-19 19:11:17-05:00, mayer@pogo.udel.edu
+ Move AI_NUMERICHOST outside of the ISC_PLATFORM_HAVEIPV6 macro to conditionally include it if it's not defined
+
+ include/ntp_rfc2553.h@1.20 +14 -14
+ Move AI_NUMERICHOST outside of the ISC_PLATFORM_HAVEIPV6 macro to conditionally include it if it's not defined
+
+ChangeSet@1.1152.1.82, 2004-03-19 01:48:58-05:00, stenn@deacon.udel.edu
+ Oncore: Remove obsolete checks
+
+ BitKeeper/etc/logging_ok@1.48 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ntpd/refclock_oncore.c@1.50 +0 -4
+ Remove obsolete checks
+
+ChangeSet@1.1152.1.81, 2004-03-18 23:54:58-05:00, stenn@whimsy.udel.edu
+ Use "inline" instead of "__inline" so configure can DTRT.
+
+ include/timepps-SCO.h@1.2 +7 -7
+ Use "inline" instead of "__inline" so configure can DTRT.
+
+ include/timepps-Solaris.h@1.2 +7 -7
+ Use "inline" instead of "__inline" so configure can DTRT.
+
+ include/timepps-SunOS.h@1.2 +7 -7
+ Use "inline" instead of "__inline" so configure can DTRT.
+
+ChangeSet@1.1152.1.80, 2004-03-18 23:38:17-05:00, stenn@whimsy.udel.edu
+ Documentation updates from Dave Mills
+
+ html/authopt.html@1.31 +3 -3
+ Updates from Dave Mills
+
+ html/howto.html@1.16 +1 -1
+ Updates from Dave Mills
+
+ html/index.html@1.29 +3 -3
+ Updates from Dave Mills
+
+ html/monopt.html@1.18 +2 -2
+ Updates from Dave Mills
+
+ html/refclock.html@1.29 +2 -2
+ Updates from Dave Mills
+
+ChangeSet@1.1152.1.79, 2004-03-18 23:24:57-05:00, stenn@whimsy.udel.edu
+ Cleanup and fixed from Dave Mills
+
+ include/ntp.h@1.99 +2 -2
+ Cleanup and fixed from Dave Mills
+
+ include/ntpd.h@1.64 +2 -1
+ Cleanup and fixed from Dave Mills
+
+ libntp/systime.c@1.30 +7 -4
+ Cleanup and fixed from Dave Mills
+
+ ntpd/ntp_control.c@1.68 +3 -4
+ Cleanup and fixed from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.91 +26 -43
+ Cleanup and fixed from Dave Mills
+
+ ntpd/ntp_proto.c@1.174 +128 -126
+ Cleanup and fixed from Dave Mills
+
+ ntpd/ntp_refclock.c@1.56 +72 -36
+ Cleanup and fixed from Dave Mills
+
+ ntpd/ntp_request.c@1.56 +0 -18
+ Cleanup and fixed from Dave Mills
+
+ ntpd/refclock_arbiter.c@1.8 +20 -20
+ Cleanup and fixed from Dave Mills
+
+ ntpd/refclock_wwvb.c@1.12 +4 -3
+ Cleanup and fixed from Dave Mills
+
+ChangeSet@1.1152.1.78, 2004-03-18 23:15:06-05:00, stenn@whimsy.udel.edu
+ Driver36 cleanup from Dave Mills
+
+ html/drivers/driver36.html@1.21 +4 -3
+ Cleanup from Dave Mills
+
+ html/scripts/links8.txt@1.2 +3 -3
+ Cleanup from Dave Mills
+
+ChangeSet@1.1152.1.77, 2004-03-17 17:11:42-05:00, stenn@pogo.udel.edu
+ Pedantic compiler lint
+
+ sntp/header.h@1.4 +2 -2
+ Pedantic compiler lint
+
+ChangeSet@1.1152.1.76, 2004-03-17 17:10:30-05:00, stenn@pogo.udel.edu
+ oncore fixes from Reg Clemens
+
+ include/timepps-SCO.h@1.1 +503 -0
+
+ include/timepps-SCO.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev/include/timepps-SCO.h
+
+ include/timepps-Solaris.h@1.1 +497 -0
+
+ include/timepps-Solaris.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev/include/timepps-Solaris.h
+
+ include/timepps-SunOS.h@1.1 +507 -0
+
+ include/timepps-SunOS.h@1.0 +0 -0
+ BitKeeper file /pogo/users/stenn/ntp-dev/include/timepps-SunOS.h
+
+ ntpd/refclock_oncore.c@1.49 +85 -132
+ Patches/cleanup from Reg Clemens.
+ Header realignment from Harlan.
+
+ChangeSet@1.1152.29.1, 2004-03-15 21:04:56-05:00, mayer@tecotoo.
+ Update to ensure the I/O Completion Ports code checks the various error states and sets the return status correctly
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.11 +20 -6
+ Update to ensure the I/O Completion Ports code checks the various error states and sets the return status correctly
+
+ChangeSet@1.1152.1.72, 2004-03-14 22:04:31-05:00, mayer@tecotoo.
+ LIB_GETBUF only has space for 20 entries and does not zero out the contents. Change the limit to 200 and zero out the contents before returning it
+
+ libntp/lib_strbuf.h@1.3 +2 -1
+ LIB_GETBUF only has space for 20 entries and does not zero out the contents. Change the limit to 200 and zero out the contents before returning it
+
+ChangeSet@1.1152.1.71, 2004-03-13 22:06:42-05:00, mayer@tecotoo.
+ ntp_types.h needs to include sys/types.h
+
+ include/ntp_rfc2553.h@1.19 +0 -1
+ ntp_types.h needs to include sys/types.h
+
+ include/ntp_types.h@1.6 +1 -0
+ ntp_types.h needs to include sys/types.h
+
+ChangeSet@1.1152.28.1, 2004-03-12 22:17:41-05:00, stenn@whimsy.udel.edu
+ [Bug 283] fix (md5.h header check)
+
+ configure.in@1.346 +5 -1
+ [Bug 283] fix (md5.h header check)
+
+ChangeSet@1.1152.1.70, 2004-03-11 23:47:33-05:00, mayer@tecotoo.
+ move some conditionals back inside ISC_PLATFORM_HAVEIPV6 to reduce warnings if already defined elsewhere
+
+ include/ntp_rfc2553.h@1.18 +2 -2
+ move some conditionals back inside ISC_PLATFORM_HAVEIPV6 to reduce warnings if already defined elsewhere
+
+ChangeSet@1.1152.1.69, 2004-03-11 22:55:24-05:00, mayer@tecotoo.
+ move integer type definitions from ntp_rfc2553.h into ntp_types.h where they belong
+
+ include/ntp_rfc2553.h@1.17 +0 -10
+ move integer type definitions from ntp_rfc2553.h into ntp_types.h where they belong
+
+ include/ntp_types.h@1.5 +10 -0
+ move integer type definitions from ntp_rfc2553.h into ntp_types.h where they belong
+
+ChangeSet@1.1152.1.68, 2004-03-10 17:51:29-05:00, mayer@pogo.udel.edu
+ Move some macros outside of ISC_PLATFORM_HAVEIPV6 conditional macro and check for inclusion
+
+ include/ntp_rfc2553.h@1.16 +16 -8
+ Move some macros outside of ISC_PLATFORM_HAVEIPV6 conditional macro and check for inclusion
+
+ChangeSet@1.1152.1.67, 2004-03-09 22:24:49-05:00, mayer@tecotoo.
+ Fix order of variable declarations to ensure required types are declared first for the following structures
+
+ include/ntp_rfc2553.h@1.15 +15 -15
+ Fix order of variable declarations to ensure required types are declared first for the following structures
+
+ChangeSet@1.1172, 2004-03-05 12:45:00-08:00, gnu@ring.wraith.sf.ca.us
+ add Ross Alexander's fixes for /etc/ntp.audioX
+
+ libntp/audio.c@1.22 +15 -9
+ add Ross Alexander's fixes for /etc/ntp.audioX
+
+ChangeSet@1.1152.1.64, 2004-03-03 00:57:05-05:00, stenn@whimsy.udel.edu
+ More cleanup/fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.90 +139 -141
+ More cleanup/fixes from Dave Mills
+
+ ntpd/ntp_proto.c@1.173 +27 -11
+ More cleanup/fixes from Dave Mills
+
+ChangeSet@1.1152.1.63, 2004-03-03 00:49:55-05:00, stenn@whimsy.udel.edu
+ Fix the sockaddr_storage check
+
+ configure.in@1.345 +1 -2
+ Fix the sockaddr_storage check
+
+ChangeSet@1.1152.1.62, 2004-03-02 22:21:11-05:00, stenn@whimsy.udel.edu
+ Re-enable support for Reliant & SCO
+
+ libntp/systime.c@1.29 +5 -1
+ Re-enable support for Reliant & SCO
+
+ChangeSet@1.1152.1.61, 2004-02-18 19:56:01-05:00, stenn@whimsy.udel.edu
+ More cleanup from Dave Mills
+
+ include/ntpd.h@1.63 +1 -1
+ More cleanup from Dave Mills
+
+ ntpd/ntp_proto.c@1.172 +40 -37
+ More cleanup from Dave Mills
+
+ ntpd/ntp_refclock.c@1.55 +1 -1
+ More cleanup from Dave Mills
+
+ChangeSet@1.1152.1.60, 2004-02-18 00:56:22-05:00, stenn@whimsy.udel.edu
+ Revert the change that required Recent auto*, to fix bug 230.
+
+ I will still roll tarballs with these recent releases so folks who
+ get tarballs won't see that bug. Only folks otherwise affected by
+ bug 230 will need the latest auto*.
+
+ Makefile.am@1.46 +1 -1
+ Revert the change that required Recent auto*, to fix bug 230.
+
+ I will still roll tarballs with these recent releases so folks who
+ get tarballs won't see that bug. Only folks otherwise affected by
+ bug 230 will need the latest auto*.
+
+ configure.in@1.344 +1 -1
+ Revert the change that required Recent auto*, to fix bug 230.
+
+ I will still roll tarballs with these recent releases so folks who
+ get tarballs won't see that bug. Only folks otherwise affected by
+ bug 230 will need the latest auto*.
+
+ChangeSet@1.1152.26.1, 2004-02-17 01:43:41-05:00, stenn@whimsy.udel.edu
+ Cleanup from Dave Mills.
+
+ include/ntp.h@1.98 +0 -1
+ Cleanup from Dave Mills.
+
+ include/ntpd.h@1.62 +1 -1
+ Cleanup from Dave Mills.
+
+ ntpd/ntp_crypto.c@1.91 +9 -9
+ Cleanup from Dave Mills.
+
+ ntpd/ntp_loopfilter.c@1.89 +0 -4
+ Cleanup from Dave Mills.
+
+ ntpd/ntp_peer.c@1.59 +1 -2
+ Cleanup from Dave Mills.
+
+ ntpd/ntp_proto.c@1.171 +98 -84
+ Cleanup from Dave Mills.
+
+ ntpd/ntp_refclock.c@1.54 +1 -1
+ Cleanup from Dave Mills.
+
+ ntpd/refclock_arbiter.c@1.7 +2 -1
+ Cleanup from Dave Mills.
+
+ChangeSet@1.1152.25.6, 2004-02-16 22:35:20-05:00, stenn@whimsy.udel.edu
+ Let the ONCORE refclock build without PPS. From Reg Clemens.
+
+ html/drivers/driver30.html@1.17 +2 -2
+ Let the ONCORE refclock build without PPS. From Reg Clemens.
+
+ ntpd/refclock_conf.c@1.23 +1 -1
+ Let the ONCORE refclock build without PPS. From Reg Clemens.
+
+ ntpd/refclock_oncore.c@1.48 +89 -53
+ Let the ONCORE refclock build without PPS. From Reg Clemens.
+
+ChangeSet@1.1152.25.5, 2004-02-14 22:05:42-05:00, stenn@whimsy.udel.edu
+ Disable check_y2k for now (34 year bug?)
+
+ configure.in@1.343 +2 -1
+ Disable check_y2k for now (34 year bug?)
+
+ChangeSet@1.1152.25.4, 2004-02-13 23:54:07-05:00, stenn@whimsy.udel.edu
+ Dave's recent patch assumed we had OPENSSL. Handle the other case.
+
+ ntpd/ntp_proto.c@1.170 +2 -0
+ Dave's recent patch assumed we had OPENSSL. Handle the other case.
+
+ChangeSet@1.1152.25.3, 2004-02-12 04:27:25-05:00, stenn@whimsy.udel.edu
+ Changes from Dave Mills:
+
+ 1. Servers presented with key IDs they don't have (a common mistake)
+ return a crypt-NAK. This also happens when the server rolls new private
+ values daily without telling the clients. To protect against bad guys
+ tossing an old duplicate over the wall, the client doesn't believe this
+ unless the timestamps pass the loopback check. If the server was
+ previously reachable, the client simply restarts the association without
+ missing a beat. If not, and to protect against a restart loop or later
+ server restart, the client disregards the NAK and continues (while
+ disabling burst mode). If really invalid, the association timeout will
+ eventually expire following which a persistent association is marked
+ permanently disabled or an ephemeral association is demobilized.
+
+ 2. One of the most common mistakes is to goof up the identity
+ credentials. If the client received these credentials via mail, the
+ script in the message installs the file and link automatically. If done
+ by hand and done wrong, either the server or client will find the error
+ and disable the association. As in all such cases, a server or client
+ ephemeral association is demobilized and the resources recovered.
+
+ 3. Symmetric modes have always been tricky, much more so with Autokey,
+ and even more so with misconfigured identity keys. It gets even wilder
+ when either peer is restarted in the middle of negotiations. All the
+ evil scenarios I can thing of seem to come out on the other side,
+ although there are a few that have to wait the association timeout to
+ properly close down and recover resources.
+
+ 4. The association is permanently disabled upon kiss-o'-death or
+ unrecoverable crypto error. So, I re-enabled log reporting for these
+ smooches. At least the offender is notified.
+
+ 5. When a really tenacious clogger shows up and lights the call-gap, the
+ server puts it in the restrict list. He stays there until the server is
+ restarted. Not only does this discourage the terriot, but evidence is
+ collected for possible further action.
+
+ What more do we have to do to turn this stuff into a real Secure
+ Timestamping Service? I think the security model, protocols, abuse
+ hardening and time performance are consistent with a bulletproof service
+ assuming, that is, PGP mail is used to get the keys and the server
+ certificates are properly signed.
+
+ include/ntp.h@1.97 +7 -5
+ Changes from Dave Mills
+
+ ntpd/ntp_crypto.c@1.90 +16 -17
+ Changes from Dave Mills
+
+ ntpd/ntp_proto.c@1.169 +200 -199
+ Changes from Dave Mills
+
+ ntpd/ntp_refclock.c@1.53 +1 -2
+ Changes from Dave Mills
+
+ChangeSet@1.1152.14.12, 2004-02-11 20:02:55-05:00, stenn@whimsy.udel.edu
+ Prepare for move from whimsy to deacon.
+
+ BitKeeper/triggers/2mirrors@1.2 +1 -0
+ Prepare for move from whimsy to deacon.
+
+ BitKeeper/triggers/changelog@1.2 +1 -0
+ Prepare for move from whimsy to deacon.
+
+ BitKeeper/triggers/commitlogs@1.4 +1 -0
+ Prepare for move from whimsy to deacon.
+
+ BitKeeper/triggers/delta-changelog@1.6 +2 -1
+ Prepare for move from whimsy to deacon.
+
+ BitKeeper/triggers/notify@1.2 +2 -1
+ Prepare for move from whimsy to deacon.
+
+ BitKeeper/triggers/paranoid@1.2 +4 -1
+ Prepare for move from whimsy to deacon.
+
+ BitKeeper/triggers/send@1.4 +1 -0
+ Prepare for move from whimsy to deacon.
+
+ChangeSet@1.1152.14.11, 2004-02-10 20:05:16-05:00, stenn@whimsy.udel.edu
+ Cleanup
+
+ README.bk@1.17 +3 -11
+ Cleanup
+
+ChangeSet@1.1152.22.10, 2004-02-10 16:42:03-05:00, mayer@pogo.udel.edu
+ Move NT specific add to completion ports inside of the open_socket code
+
+ ntpd/ntp_io.c@1.105.1.1 +18 -20
+ Move NT specific add to completion ports inside of the open_socket code
+
+ChangeSet@1.1152.24.3, 2004-02-07 17:53:39+00:00, mbrett@rgs16.fordson.demon.co.uk
+ humandate.c, caljulian.c, ntp_fp.h:
+ Syntax changes to allow K&R compilers
+
+ BitKeeper/etc/logging_ok@1.42.1.2 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ include/ntp_fp.h@1.7.1.1 +2 -0
+ Syntax changes to allow K&R compilers
+
+ libntp/caljulian.c@1.6 +2 -3
+ Syntax changes to allow K&R compilers
+
+ libntp/humandate.c@1.6 +0 -2
+ Syntax changes to allow K&R compilers
+
+ChangeSet@1.1152.22.8, 2004-02-05 19:46:43-05:00, mayer@pogo.udel.edu
+ Fix for sockaddr_storage includes
+
+ include/ntp_rfc2553.h@1.12.1.1 +45 -31
+ Fix for sockaddr_storage includes
+
+ChangeSet@1.1152.24.2, 2004-01-26 21:43:00-05:00, stenn@whimsy.udel.edu
+ struct sockaddr_storage progress
+
+ configure.in@1.342 +0 -2
+ struct sockaddr_storage progress
+
+ include/ntp_rfc2553.h@1.13 +0 -2
+ struct sockaddr_storage progress
+
+ChangeSet@1.1152.24.1, 2004-01-25 22:14:09-05:00, stenn@whimsy.udel.edu
+ Don't use IPv6 on AIX4.
+
+ configure.in@1.341 +10 -5
+ Don't use IPv6 on AIX4.
+
+ChangeSet@1.1152.22.6, 2004-01-22 20:59:27-05:00, stenn@whimsy.udel.edu
+ Postpone the stuct sockaddr_storage test for now.
+
+ configure.in@1.340 +2 -0
+ Postpone the stuct sockaddr_storage test for now.
+
+ChangeSet@1.1152.22.5, 2004-01-22 17:49:57-05:00, stenn@whimsy.udel.edu
+ Use doubles instead of NTP timestamps to work around the 34 year problem. From Dave Mills.
+
+ ntpd/ntp_proto.c@1.168 +32 -21
+ Use doubles instead of NTP timestamps to work around the 34 year problem. From Dave Mills.
+
+ChangeSet@1.1152.22.4, 2004-01-22 17:45:13-05:00, stenn@whimsy.udel.edu
+ jitter utility fixes from Dave Mills.
+
+ util/jitter.c@1.4 +15 -16
+ Fixes from Dave Mills.
+
+ util/jitter.h@1.1 +412 -0
+
+ util/jitter.h@1.0 +0 -0
+ BitKeeper file /backroom/ntp-dev/util/jitter.h
+
+ChangeSet@1.1152.23.2, 2004-01-22 17:35:01-05:00, mayer@pogo.udel.edu
+ L_RSHIFTU was mapped to M_RSHIFT instead of M_RSHIFTU
+
+ include/ntp_fp.h@1.8 +1 -1
+ L_RSHIFTU was mapped to M_RSHIFT instead of M_RSHIFTU
+
+ChangeSet@1.1152.22.3, 2004-01-22 04:07:41+01:00, blk@frobozz.local
+ nl.pl.in:
+ Better accounting for possible whitespace at the end of C routines (Bug 210).
+
+ BitKeeper/etc/logging_ok@1.42.1.1 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ntpdc/nl.pl.in@1.8 +1 -1
+ Better accounting for possible whitespace at the end of C routines (Bug 210).
+
+ChangeSet@1.1152.23.1, 2004-01-21 19:35:11-05:00, mayer@pogo.udel.edu
+ eliminate no error select reporting
+
+ ntpdate/ntpdate.c@1.46 +4 -7
+ eliminate no error select reporting
+
+ChangeSet@1.1152.22.2, 2004-01-10 21:10:11-05:00, stenn@whimsy.udel.edu
+ initial attempt at more rfc2553 cleanup
+
+ configure.in@1.339 +87 -1
+ initial attempt at more rfc2553 cleanup
+
+ include/ntp_rfc2553.h@1.12 +2 -0
+ initial attempt at more rfc2553 cleanup
+
+ChangeSet@1.1152.14.10, 2004-01-10 02:27:07-05:00, stenn@pogo.udel.edu
+ Fixes from Reg Clemens:
+
+ Cleanup.
+ [Bug 233]
+ [Bug 246]
+ [Bug 260]
+
+ html/drivers/driver30.html@1.16 +8 -8
+ Fixes from Reg Clemens:
+
+ I have changed the documentation page for the ONCORE so it no longer
+ references Flag2/Flag3.
+
+ ntpd/refclock_oncore.c@1.47 +104 -137
+ Fixes from Reg Clemens:
+
+ some (minor) changes:
+ (a) some changes to messages printed.
+ (b) can now find config file in /etc/ntp/ as well as /etc/
+
+ Bug 233: New LP64 Patches
+ patch imported from original author
+
+ Bug 246: 3 issues with the ONCORE driver
+ (1) You can reset the ONCORE driver back to defaults by *reading*
+ the variables from across the net.
+
+ This bug was introduced when I (foolishly) 'fixed' the code so it
+ would understand the FLAG variables that corresponded to its own
+ input variables from the ntp.ONCORE.x file. Since I do NOT understand
+ all the implications of ntp_control, I will remove this 'fix'.
+ The variables can now only be set in ntp.ONCORE. They can NOT be
+ changed dynamically. The documentation will be changed back. Perhaps
+ at some time in the future I will dig through the ntp code to
+ understand ntp_control.
+
+ (2) Fudge acted upon AFTER ntp.ONCORE.
+
+ Fixed by (1) the FUDGE flag/time variables are ignored, use the
+ ntp.ONCORE file.
+
+ (3) In the driver, ONCORE_start and a few other procedures do not
+ produce any output in the clockstats file.
+
+ The originator of the bug is running FreeBSD 5.1.
+ I have looked at the output from MY copy of FreeBSD 5.1, and several
+ Linux versions (7.3 -> 9), and Fedora and do NOT see any missing
+ messages. The messages start with an "ONCORE DRIVER -- CONFIGURING"
+ message written when the driver is first entered, and contain all the
+ messages I would expect after that.
+
+ I have no idea why he is not seeing the messages.
+
+ No action.
+
+ Bug 260, Patches for item (1) in the above.
+
+ The patch purports to fix the problem in Bug 246.
+
+ As noted I don't understand the details of what is going on behind the
+ curtain, so I would rather remove the offending code, than try to fix it.
+
+ There is also an increase buffer size so that longer messages can be
+ sent to the clockstats file. Ill leave that for the user to do on his
+ own if he wants to change the messages, but with slightly more effort
+ he could do the same using SHMEM.
+
+ He found an error in determining the ONCORE M12/M12+T. (thanks)
+ Rather than his #ifdef, I have corrected the code.
+
+
+ChangeSet@1.1152.19.3, 2004-01-08 18:21:43-05:00, mayer@pogo.udel.edu
+ Make call to get_scopeid conditional
+
+ libisc/ifiter_ioctl.c@1.18 +2 -1
+ Make call to get_scopeid conditional
+
+ChangeSet@1.1152.19.2, 2004-01-08 16:07:57-05:00, mayer@pogo.udel.edu
+ Make fetch of broadcast address conditional on existence of macro
+
+ libisc/ifiter_ioctl.c@1.17 +2 -1
+ Make fetch of broadcast address conditional on existence of macro
+
+ChangeSet@1.1152.1.56, 2004-01-08 17:55:23+00:00, mbrett@rgs16.fordson.demon.co.uk
+ Makefile.am:
+ Remove $(NULL). It has no effect.
+
+ util/Makefile.am@1.23 +1 -2
+ Remove $(NULL). It has no effect.
+
+ChangeSet@1.1152.1.55, 2004-01-08 13:36:54+00:00, mbrett@rgs16.fordson.demon.co.uk
+ refclock_arc.c:
+ gcc lint for isdigit()
+
+ BitKeeper/etc/logging_ok@1.43 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ntpd/refclock_arc.c@1.17 +1 -1
+ gcc lint for isdigit()
+
+ChangeSet@1.1152.19.1, 2004-01-06 20:55:01-05:00, mayer@pogo.udel.edu
+ Broadcast addresses were not being set for systems with IPv6 capability
+
+ libisc/ifiter_ioctl.c@1.16 +21 -0
+ Broadcast addresses were not being set for systems with IPv6 capability
+
+ChangeSet@1.1152.18.1, 2004-01-06 21:19:51+01:00, a115350@y3111429.nh.ad.hydro.com
+ Fix for NTP Epoch rollover
+
+ BitKeeper/etc/logging_ok@1.42 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ libntp/caljulian.c@1.5 +32 -0
+ Fix for NTP epoch rollover: Uses time_t and
+ localtime/gmtime for conversion
+
+ libntp/humandate.c@1.5 +5 -4
+ Fix for NTP epoch rollover: Uses time_t and
+ localtime/gmtime for conversion
+
+ libntp/prettydate.c@1.4 +64 -9
+ Use common helper function
+
+ChangeSet@1.1152.1.51, 2004-01-02 16:01:53-05:00, stenn@whimsy.udel.edu
+ manycast fix from Dave Mills.
+
+ ntpd/ntp_proto.c@1.167 +1 -1
+ manycast fix from Dave Mills.
+
+ChangeSet@1.1152.15.6, 2003-12-31 18:04:38-05:00, mayer@tecotoo.myibg.com
+ Test Changes
+
+ ntpd/ntp_io.c@1.101.1.4 +8 -4
+ Test Changes
+
+ChangeSet@1.1152.17.1, 2003-12-31 13:44:43-05:00, mayer@pogo.udel.edu
+ Fix Broadcast support for those systems that support IPv6
+
+ libisc/ifiter_ioctl.c@1.15 +3 -4
+ Fix Broadcast support for IPv6 capable queries to ioctl
+
+ ntpd/ntp_io.c@1.105 +11 -10
+ Fix io_setbclient to properly use MACROS and add proper error information
+
+ChangeSet@1.1152.1.50, 2003-12-26 19:00:43-05:00, stenn@whimsy.udel.edu
+ Dave Mills: Update EOV offset comment.
+
+ ntpd/ntp_control.c@1.65.1.1 +1 -1
+ Dave Mills: Update EOV offset comment.
+
+ChangeSet@1.1152.15.5, 2003-12-25 18:46:06-05:00, mayer@tecotoo.myibg.com
+ EOV value was not updated when error was added
+
+ ntpd/ntp_control.c@1.66 +1 -1
+ EOV value was not updated when error was added
+
+ChangeSet@1.1152.14.9, 2003-12-24 00:41:50-05:00, stenn@whimsy.udel.edu
+ Cleanups, fix [Bug 320]
+
+ Makefile.am@1.45 +1 -1
+ [Bug 230] Require automake-1.8.
+
+ acinclude.m4@1.12 +2 -2
+ Quote auto* stuff properly.
+
+ configure.in@1.336.1.1 +5 -4
+ Require autoconf-2.58. Use version.m4. Cleanup.
+
+ version.m4@1.2 +1 -1
+ 4.2.0a
+
+ version.m4@1.1 +1 -0
+
+ version.m4@1.0 +0 -0
+ BitKeeper file /backroom/ntp-stable/version.m4
+
+ChangeSet@1.1152.14.8, 2003-12-20 20:28:35-05:00, stenn@whimsy.udel.edu
+ [Bug 259] Marc Brett: lint
+
+ ntpd/refclock_arc.c@1.16 +2 -2
+ [Bug 259] Marc Brett: lint
+
+ ntpd/refclock_neoclock4x.c@1.11 +3 -3
+ [Bug 259] Marc Brett: lint
+
+ChangeSet@1.1152.14.7, 2003-12-20 20:18:51-05:00, stenn@whimsy.udel.edu
+ [Bug 258] sntp cleanup
+
+ sntp/internet.c@1.3 +0 -2
+ [Bug 258] Matthias Drochner: sntp lint cleanup (plus IPv6 patch from HMS)
+
+ sntp/main.c@1.3 +18 -1
+ [Bug 258] Matthias Drochner: sntp lint cleanup (plus IPv6 patch from HMS)
+
+ sntp/socket.c@1.3 +7 -1
+ [Bug 258] Matthias Drochner: sntp lint cleanup (plus IPv6 patch from HMS)
+
+ sntp/timing.c@1.2 +2 -0
+ [Bug 258] Marc Brett: more sntp lint cleanup.
+
+ChangeSet@1.1152.14.6, 2003-12-20 18:44:12-05:00, stenn@whimsy.udel.edu
+ [Bug 262] Petter Reinholdtsen: Fix gcc3/Mac OS X output regexp for ntpdc/nl.pl
+
+ ntpdc/nl.pl.in@1.7 +2 -2
+ [Bug 262] Petter Reinholdtsen: Fix gcc3/Mac OS X output regexp for ntpdc/nl.pl
+
+ChangeSet@1.1152.14.5, 2003-12-20 01:03:29-05:00, stenn@whimsy.udel.edu
+ [Bug 263] (NetBSD PR bin/23707)
+
+ ntpdate/ntpdate.c@1.45 +82 -78
+ Use #ifdef DEBUG where appropriate.
+
+ ntpdate/ntpdate.c@1.44 +69 -68
+ [Bug 263] Mattias Karlsson: ntpdate -s is not silent. From NetBSD PR bin/23707
+
+ChangeSet@1.1152.16.1, 2003-12-19 15:44:14-05:00, stenn@whimsy.udel.edu
+ [Bug 251] Timo Felbinger: Drop root under Linux
+
+ configure.in@1.337 +20 -2
+ [Bug 251] Timo Felbinger: Drop root under Linux
+
+ html/ntpd.html@1.32 +5 -1
+ [Bug 251] Timo Felbinger: Drop root under Linux
+
+ include/ntpd.h@1.61 +2 -1
+ [Bug 251] Timo Felbinger: Drop root under Linux
+
+ ntpd/cmd_args.c@1.23 +18 -10
+ [Bug 251] Timo Felbinger: Drop root under Linux
+
+ ntpd/ntpd.c@1.54 +106 -59
+ [Bug 251] Timo Felbinger: Drop root under Linux
+
+ChangeSet@1.1152.1.43, 2003-12-18 02:50:14-05:00, stenn@whimsy.udel.edu
+ [Bug 256] Fix misleading diagnostic message.
+
+ ntpd/ntp_config.c@1.100 +2 -2
+ [Bug 256] Fix misleading diagnostic message.
+
+ChangeSet@1.1152.1.42, 2003-12-18 00:36:05-05:00, stenn@whimsy.udel.edu
+ [Bug 158] Alter header inclusion to avoid linux header braindamage.
+
+ libntp/iosignal.c@1.12 +19 -6
+ [Bug 158] Alter header inclusion to avoid linux header braindamage.
+
+ChangeSet@1.1152.1.41, 2003-12-17 23:35:26-05:00, stenn@whimsy.udel.edu
+ Updates from Dave Mills.
+
+ html/confopt.html@1.28 +5 -6
+ Updates from Dave Mills.
+
+ html/ntpdc.html@1.20 +2 -2
+ Updates from Dave Mills.
+
+ChangeSet@1.1152.1.40, 2003-12-17 23:24:17-05:00, stenn@whimsy.udel.edu
+ Dave Mills: novolley subcommand to the broadcast command.
+
+ ntpd/ntp_config.c@1.99 +8 -4
+ Dave Mills: novolley subcommand to the broadcast command.
+
+ ntpd/ntp_proto.c@1.166 +15 -18
+ Dave Mills: novolley subcommand to the broadcast command.
+
+ChangeSet@1.1152.1.39, 2003-12-16 16:22:11-05:00, stenn@whimsy.udel.edu
+ Typo fix from Marc Brett
+
+ ntpd/ntp_io.c@1.104 +1 -1
+ Typo fix from Marc Brett
+
+ChangeSet@1.1152.15.4, 2003-12-14 21:45:10-05:00, mayer@tecotoo.myibg.com
+ Unix didn't recognize BOOL in create_wildcard, use isc_boolean_t instead
+
+ ntpd/ntp_io.c@1.101.1.3 +4 -3
+ Unix didn't recognize BOOL in create_wildcar, use isc_boolean_t instead
+
+ChangeSet@1.1152.15.3, 2003-12-14 11:50:12-05:00, mayer@tecotoo.myibg.com
+ Print no interfaces message if debug is on
+
+ ntpd/ntp_io.c@1.101.1.2 +7 -3
+ Print no interfaces message if debug is on
+
+ChangeSet@1.1152.15.2, 2003-12-13 22:02:59-05:00, mayer@tecotoo.myibg.com
+ Clean up the open_socket code
+
+ ntpd/ntp_io.c@1.101.1.1 +13 -8
+ Clean up the open_socket code
+
+ChangeSet@1.1152.15.1, 2003-12-13 21:38:39-05:00, mayer@tecotoo.myibg.com
+ define lifr_index if platform uses if_laddrreq
+
+ libisc/ifiter_ioctl.c@1.14 +1 -0
+ define lifr_index if platform uses if_laddrreq
+
+ChangeSet@1.1152.1.37, 2003-12-10 01:52:46-05:00, stenn@whimsy.udel.edu
+ *ix doesn't do BOOL.
+
+ ntpd/ntp_io.c@1.102 +1 -1
+ *ix doesn't do BOOL.
+
+ChangeSet@1.1152.1.36, 2003-12-09 09:59:50-05:00, mayer@tecotoo.myibg.com
+ IPV6_V6ONLY not dependent on IPTOS_LOWDELAY, etc
+
+ ntpd/ntp_io.c@1.101 +1 -2
+ IPV6_V6ONLY not dependent on IPTOS_LOWDELAY, etc
+
+ChangeSet@1.1152.1.35, 2003-12-08 17:49:41-05:00, mayer@tecotoo.myibg.com
+ Fix to only conditionally create a wildcard socket for IPv4 if IPV6_V6ONLY defined and no IPv4 stack
+
+ ntpd/ntp_io.c@1.100 +25 -18
+ Fix to only conditionally create a wildcard socket for IPv4 if IPV6_V6ONLY defined
+
+ChangeSet@1.1152.1.34, 2003-12-07 19:09:45-05:00, mayer@tecotoo.myibg.com
+ Fix to only get scope and zero address if Link-local Multicast address. Add scope information for interfaces
+
+ libisc/interfaceiter.c@1.9 +7 -4
+ Fix to only get scope and zero address if Link-local Multicast address
+
+ ntpd/ntp_io.c@1.99 +3 -2
+ Print scope information so we see it for interfaces we are handling
+
+ChangeSet@1.1152.1.33, 2003-12-03 23:33:46-05:00, mayer@tecotoo.myibg.com
+ For KAME we need to fix the zeroing out of a couple of bytes. Fix to do it properly
+
+ libisc/interfaceiter.c@1.8 +9 -2
+ For KAME we need to fix the zeroing out of a couple of bytes. Fix to do it properly
+
+ChangeSet@1.1152.1.32, 2003-12-03 22:24:47-05:00, mayer@tecotoo.myibg.com
+ For KAME we need to fix the zeroing out of a couple of bytes. The wrong variable name got used
+
+ libisc/interfaceiter.c@1.7 +2 -2
+ For KAME we need to fix the zeroing out of a couple of bytes. The wrong variable got used
+
+ChangeSet@1.1152.12.7, 2003-12-02 23:46:54-05:00, mayer@tecotoo.myibg.com
+ if_index should have been ifindex
+
+ libisc/ifiter_sysctl.c@1.8 +1 -1
+ if_index should have been ifindex
+
+ChangeSet@1.1152.1.29, 2003-12-01 04:09:21-05:00, stenn@whimsy.udel.edu
+ Improvements from Dave Mills.
+
+ include/ntp_control.h@1.24 +15 -14
+ Improvements from Dave Mills.
+
+ include/ntpd.h@1.60 +3 -3
+ Improvements from Dave Mills.
+
+ ntpd/ntp_control.c@1.65 +20 -14
+ Improvements from Dave Mills.
+
+ ntpd/ntp_loopfilter.c@1.88 +24 -30
+ Improvements from Dave Mills.
+
+ ntpd/ntp_proto.c@1.165 +6 -6
+ Improvements from Dave Mills.
+
+ ntpd/ntp_refclock.c@1.52 +2 -3
+ Improvements from Dave Mills.
+
+ChangeSet@1.1152.12.6, 2003-11-30 22:23:45-05:00, mayer@tecotoo.myibg.com
+ For KAME we need to zero out a couple of bytes in the address
+
+ libisc/interfaceiter.c@1.6 +2 -0
+ For KAME we need to zero out a couple of bytes in the address
+
+ChangeSet@1.1152.12.5, 2003-11-29 21:24:54-05:00, mayer@tecotoo.myibg.com
+ Fixes for older platforms not returning the interface index and not supporting IPv6
+
+ libisc/ifiter_ioctl.c@1.13 +9 -0
+ Fix complaints about not finding ifr_index on older platforms
+
+ libisc/interfaceiter.c@1.5 +2 -0
+ Fix warning on machines not supporting IPv6 to ignore the get_scopeid() function
+
+ChangeSet@1.1152.12.4, 2003-11-29 20:52:42-05:00, mayer@tecotoo.myibg.com
+ Use scope id when address is link-local for IPv6 multicast IPV6_JOIN_GROUP
+
+ ntpd/ntp_io.c@1.98 +9 -2
+ Use scope id when address is link-local for IPv6 multicast IPV6_JOIN_GROUP
+
+ChangeSet@1.1152.14.4, 2003-11-29 20:22:38-05:00, stenn@whimsy.udel.edu
+ [Bug 255] Lint cleanup
+
+ ntpd/ntp_loopfilter.c@1.87 +5 -1
+ [Bug 255] Lint cleanup
+
+ChangeSet@1.1152.14.3, 2003-11-29 19:18:51-05:00, stenn@whimsy.udel.edu
+ [Bug 255] Lint cleanup
+
+ ntpd/refclock_hopfpci.c@1.10 +0 -8
+ [Bug 255] Lint clenaup in hopfpci.c
+
+ ntpd/refclock_neoclock4x.c@1.10 +0 -2
+ [Bug 255] Lint cleanup in neoclock4x
+
+ ntpdc/ntpdc.c@1.32 +2 -2
+ [Bug 255] Lint cleanup in ntpdc.c
+
+ ntpq/ntpq.c@1.45 +2 -3
+ [Bug 255] Lint cleanup in ntpq.c
+
+ChangeSet@1.1152.14.2, 2003-11-29 18:53:20-05:00, stenn@whimsy.udel.edu
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ include/ntp.h@1.95 +3 -3
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ include/ntp_request.h@1.23 +1 -1
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ ntpd/ntp_control.c@1.64 +2 -2
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ ntpd/ntp_peer.c@1.58 +17 -17
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ ntpd/ntp_proto.c@1.162.1.1 +2 -2
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ ntpd/ntp_request.c@1.55 +4 -4
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ ntpd/ntp_timer.c@1.27 +1 -1
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ ntpdc/ntpdc_ops.c@1.29 +2 -2
+ [Bug 255] Lint cleanup (avoid HASH_* name collision)
+
+ChangeSet@1.1152.14.1, 2003-11-29 18:07:18-05:00, stenn@whimsy.udel.edu
+ [Bug 254] Frederick Bruckman: Avoid the OSS emulation layer on NetBSD.
+
+ configure.in@1.336 +5 -1
+ [Bug 254] Frederick Bruckman: Avoid the OSS emulation layer on NetBSD.
+
+ChangeSet@1.1152.1.25, 2003-11-29 03:43:39-05:00, stenn@whimsy.udel.edu
+ [Bug 241] Dave Mills: Do not respond to multicast if not a manycast server.
+
+ ntpd/ntp_proto.c@1.163 +9 -3
+ [Bug 241] Dave Mills: Do not respond to multicast if not a manycast server.
+
+ChangeSet@1.1152.1.24, 2003-11-29 03:28:17-05:00, stenn@whimsy.udel.edu
+ [Bug 200] Apparently, variance data is stored squared, so we want to SQRT() it when we report it.
+
+ ntpd/ntp_request.c@1.54 +1 -1
+ [Bug 200] Apparently, variance data is stored squared, so we want to SQRT() it when we report it.
+
+ChangeSet@1.1152.1.23, 2003-11-29 03:17:47-05:00, stenn@whimsy.udel.edu
+ [Bug 252] Matthias Drochner: uninitialized memory in ntp-keygen can lead to crashes.
+
+ util/ntp-keygen.c@1.25 +8 -7
+ [Bug 252] Matthias Drochner: uninitialized memory in ntp-keygen can lead to crashes.
+
+ChangeSet@1.1152.1.22, 2003-11-29 03:03:13-05:00, stenn@pogo.udel.edu
+ Use our portable way of getting socklen
+
+ ntpd/refclock_nmea.c@1.22 +1 -2
+ Use our portable way of getting socklen
+
+ChangeSet@1.1152.12.3, 2003-11-27 22:34:47-05:00, mayer@tecotoo.myibg.com
+ Added support for scopeid and interface index in support of IPV6 multicasting.
+
+ include/isc/interfaceiter.h@1.3 +2 -0
+ Added interface index and scope id to interface structure
+
+ include/ntp.h@1.92.1.2 +2 -0
+ Added interface index and scope id to interface structure
+
+ libisc/ifiter_ioctl.c@1.12 +4 -0
+ Added interface index and scope id to interface structure
+
+ libisc/ifiter_sysctl.c@1.7 +3 -0
+ Added interface index and scope id to interface structure
+
+ libisc/interfaceiter.c@1.4 +31 -0
+ Added get_scopeid function to fetch the scope and take care of KAME issues.
+
+ ntpd/ntp_io.c@1.97 +6 -1
+ Copy the interface index and scope id into the interface structure. Use the scope d
+ to specify the scope and te interface index to join the group.
+
+ ports/winnt/libisc/interfaceiter.c@1.4 +5 -0
+ Added interface index and scope id to interface. Zero for now.
+
+ChangeSet@1.1152.1.21, 2003-11-26 19:52:29-05:00, stenn@whimsy.udel.edu
+ Document nmead support
+
+ html/drivers/driver20.html@1.12 +1 -0
+ Document nmead support
+
+ChangeSet@1.1152.13.5, 2003-11-26 19:21:41-05:00, stenn@whimsy.udel.edu
+ [Bug 202] From Jon Miner: nmead support
+
+ ntpd/refclock_nmea.c@1.21 +50 -2
+ [Bug 202] From Jon Miner: nmead support
+
+ChangeSet@1.1152.13.4, 2003-11-26 19:06:31-05:00, stenn@whimsy.udel.edu
+ [Bug 248] From Nigel Roles: Fix use of tcsetattr() and parsing.
+
+ ntpd/refclock_arc.c@1.15 +45 -5
+ [Bug 248] From Nigel Roles: Fix use of tcsetattr() and parsing.
+
+ChangeSet@1.1152.13.2, 2003-11-25 04:26:12-05:00, stenn@whimsy.udel.edu
+ [Bug 250] msec->nsec conversion bug to refclock_palisade.c (From Neil Burn)
+
+ ntpd/refclock_palisade.c@1.16.1.1 +1 -1
+ [Bug 250] msec->nsec conversion bug to refclock_palisade.c (From Neil Burn)
+
+ChangeSet@1.1152.13.1, 2003-11-25 04:17:29-05:00, stenn@whimsy.udel.edu
+ [Bug 243] error handling bug in ntpdc (from Matthias Drochner)
+
+ ntpdc/ntpdc_ops.c@1.28 +18 -18
+ [Bug 243] error handling bug in ntpdc (from Matthias Drochner)
+
+ChangeSet@1.1152.12.2, 2003-11-24 09:24:33-05:00, mayer@tecotoo.myibg.com
+ Time is in nsecs and not usecs. Multiplier was incorrect
+
+ ntpd/refclock_palisade.c@1.17 +1 -1
+ Time is in nsecs and not usecs. Multiplier was incorrect
+
+ChangeSet@1.1152.12.1, 2003-11-24 09:18:06-05:00, mayer@tecotoo.myibg.com
+ Fix structure name to use the generic name
+
+ include/ntp.h@1.92.1.1 +1 -1
+ Fix structure name to use the generic name
+
+ChangeSet@1.1152.11.2, 2003-11-20 04:41:32-05:00, stenn@whimsy.udel.edu
+ [Bug 238] check for vsnprintf
+
+ configure.in@1.335 +1 -1
+ [Bug 238] check for vsnprintf
+
+ChangeSet@1.1152.9.13, 2003-11-20 03:58:27-05:00, stenn@whimsy.udel.edu
+ [Bug 220] (Frederick Bruckman) The linux resolver needs more stack space.
+
+ ntpd/ntpd.c@1.53 +1 -1
+ [Bug 220] (Frederick Bruckman) The linux resolver needs more stack space.
+
+ChangeSet@1.1152.9.12, 2003-11-20 03:44:29-05:00, stenn@whimsy.udel.edu
+ [Bug 217] ntptrace should show sync distance, not rootdelay.
+
+ scripts/ntptrace.in@1.3 +6 -3
+ [Bug 217] ntptrace should show sync distance, not rootdelay.
+
+ChangeSet@1.1152.9.11, 2003-11-20 03:28:03-05:00, stenn@whimsy.udel.edu
+ [Bug 215] Stop looking when we hit a refclock.
+
+ scripts/ntptrace.in@1.2 +1 -0
+ [Bug 215] Stop looking when we hit a refclock.
+
+ChangeSet@1.1152.9.10, 2003-11-19 21:12:51-05:00, stenn@whimsy.udel.edu
+ Sledgehammer bug 230
+
+ util/Makefile.am@1.22 +4 -1
+ Sledgehammer bug 230
+
+ChangeSet@1.1152.9.9, 2003-11-19 10:07:45+00:00, harlanst@time.usno.navy.mil
+ gpsvme updates from USNO
+
+ BitKeeper/deleted/.del-map_vme.c~3aed0663@1.5 +0 -133
+ Delete: ntpd/map_vme.c
+
+ BitKeeper/etc/logging_ok@1.41 +1 -0
+ Logging to logging@openlogging.org accepted
+
+ ntpd/Makefile.am@1.37 +1 -1
+ map_vme.c is no more...
+
+ ntpd/refclock_gpsvme.c@1.7 +244 -612
+ updated version from the USNO folks
+
+ChangeSet@1.1152.9.8, 2003-11-18 22:58:33-05:00, stenn@whimsy.udel.edu
+ autoconf cleanup
+
+ configure.in@1.334 +2 -2
+ autoconf cleanup
+
+ sntp/configure.ac@1.7 +1 -1
+ autoconf cleanup
+
+ChangeSet@1.1152.10.2, 2003-11-11 02:55:22-05:00, stenn@whimsy.udel.edu
+ [Bug 177] Fixes from Dave Mills.
+
+ libntp/systime.c@1.28 +6 -1
+ [Bug 177] Fixes from Dave Mills
+
+ ntpd/ntp_loopfilter.c@1.86 +20 -26
+ [Bug 177] Fixes from Dave Mills: state machine improvements.
+
+ ntpd/ntp_proto.c@1.162 +15 -7
+ [Bug 177] Fixes from Dave Mills: freq mgt and poll interval fixes.
+
+ChangeSet@1.1152.10.1, 2003-11-10 23:53:42-05:00, stenn@whimsy.udel.edu
+ Stuff from Dave Mills
+
+ NEWS@1.47 +1 -0
+ Separate -dev news from -stable news.
+
+ include/ntp.h@1.93 +5 -5
+ Cleanup from Dave Mills
+
+ChangeSet@1.1152.9.6, 2003-11-08 20:32:39-05:00, mayer@tecotoo.myibg.com
+ Ensure config.h is included in ntp_rfx2553.h before testing macros
+
+ include/ntp_rfc2553.h@1.11 +6 -0
+ Ensure config.h is included before testing macros
+
+ChangeSet@1.1152.9.5, 2003-11-08 16:49:43-05:00, mayer@tecotoo.myibg.com
+ Fixes to properly support platforms that do not have IPv6 support.
+
+ include/isc/ipv6.h@1.4 +4 -2
+ Make IPv6 Macro definitions only if not previously defined.
+
+ include/ntp_rfc2553.h@1.10 +2 -4
+ Change to only use the definitions if IPv6 not defined on the platform. This uses the
+ Macros defined during the config process which defines the Macro
+ ISC_PLATFORM_HAVEIPV6 if the platform properly supports IPv6
+
+ libntp/ntp_rfc2553.c@1.15 +2 -2
+ Use ISC_PLATFORM_HAVEIPV6 instead of HAVE_IPV6 which was previously
+ defined in the ntp_rfc2553.h file based on the erroneously assumption about a
+ macro.
+
+ ports/winnt/include/isc/ipv6.h@1.3 +4 -2
+ Make IPv6 Macro definitions only if not previously defined.
+
+ ports/winnt/include/isc/platform.h@1.3 +5 -0
+ The ISC_PLATFORM_HAVEIPV6 macro should not have been defined here.
+ This was a vestige of the work being done to scan for IPv6 interfaces on
+ Windows platforms.
+
+ChangeSet@1.1152.9.4, 2003-11-07 21:27:53-05:00, mayer@pogo.udel.edu
+ Change HAVE_IPV6 macro to ISC_PLATFORM_HAVEIPV6 since BIND 9 does a better job of figuring out what's needed for IPv6
+
+ ntpd/ntp_io.c@1.96 +26 -26
+ Change HAVE_IPV6 macro to ISC_PLATFORM_HAVEIPV6 since BIND 9 does a better job of figuring out what's needed for IPv6
+
+ChangeSet@1.1152.9.3, 2003-11-02 23:18:29-05:00, mayer@tecotoo.myibg.com
+ Fix setsockopt arguments to conform to standard declarations for various arguments
+
+ ntpd/ntp_io.c@1.95 +4 -2
+ Fix setsockopt arguments to conform to standard declarations for various arguments
+
+ChangeSet@1.1152.9.2, 2003-10-31 23:23:43-05:00, mayer@tecotoo.myibg.com
+ Fix for number of bytes and error message fixes (see Bugs #226 and 227)
+
+ ntpd/ntp_intres.c@1.32 +13 -3
+ Need to use GetOverlapped result to get the number of bytes.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.10 +9 -3
+ Error message fixes.
+
+ChangeSet@1.1152.9.1, 2003-10-26 10:20:36-05:00, mayer@tecotoo.myibg.com
+ Update to OpenSSL 0.9.7c
+
+ BitKeeper/etc/ignore@1.35 +7 -0
+ Added {ntpd/ntp_io.c.$$$} {ports/winnt/libntp/libntp.dsp.$$$} {ports/winnt/ntp-keygen/ntpkeygen.dsp.$$$} {ports/winnt/ntpd/ntpd.dsp.$$$} {ports/winnt/ntpdate/ntpdate.dsp.$$$} {ports/winnt/ntpdc/ntpdc.dsp.$$$} {ports/winnt/ntpq/ntpq.dsp.$$$} to the ignore list
+
+ ports/winnt/libntp/libntp.dsp@1.17 +2 -2
+ Update to OpenSSL 0.9.7c
+
+ ports/winnt/ntp-keygen/ntpkeygen.dsp@1.4 +4 -4
+ Update to OpenSSL 0.9.7c
+
+ ports/winnt/ntpd/ntpd.dsp@1.19 +4 -4
+ Update to OpenSSL 0.9.7c
+
+ ports/winnt/ntpdate/ntpdate.dsp@1.12 +2 -2
+ Update to OpenSSL 0.9.7c
+
+ ports/winnt/ntpdc/ntpdc.dsp@1.13 +2 -2
+ Update to OpenSSL 0.9.7c
+
+ ports/winnt/ntpq/ntpq.dsp@1.13 +2 -2
+ Update to OpenSSL 0.9.7c
+
+ChangeSet@1.1152.8.1, 2003-10-22 11:13:33-04:00, blu@corwin.
+ ntpq_ops.c, ntpq.c:
+ Change formatting for multiple servers and add assID for multiple association output.
+
+ ntpq/ntpq.c@1.44 +2 -0
+ Change formatting for multiple servers and add assID for multiple association output.
+
+ ntpq/ntpq_ops.c@1.19 +38 -4
+ Change formatting for multiple servers and add assID for multiple association output.
+
+ChangeSet@1.1152.1.13, 2003-10-22 13:16:39+02:00, peda@sectra.se
+ Fixes the bug for big endian machines, instead of killing the warning.
+
+ ntpd/refclock_jupiter.c@1.17 +5 -5
+ Fixes the bug for big endian machines, instead of killing the warning.
+
+ChangeSet@1.1152.1.12, 2003-10-22 13:12:10+02:00, peda@sectra.se
+ Clean up PPS handling in jupiter driver.
+ Easier to modify source to get hardpps.
+
+ ntpd/refclock_jupiter.c@1.16 +13 -12
+ Clean up PPS handling.
+ Easier to modify source to get hardpps.
+
+ChangeSet@1.1152.1.11, 2003-10-22 13:08:28+02:00, peda@sectra.se
+ Remove annying newline from syslog in the jupiter refclock.
+
+ ntpd/refclock_jupiter.c@1.15 +1 -1
+ Remove annying newline from syslog.
+
+ChangeSet@1.1152.1.10, 2003-10-20 15:10:02-04:00, stenn@whimsy.udel.edu
+ Added IPv6 to NEWS file.
+
+ NEWS@1.46 +1 -0
+ Added IPv6
+
+ChangeSet@1.1140.1.4, 2003-08-13 10:00:10-07:00, gnu@ring.wraith.sf.ca.us
+ dot-in-path fix
+
+ ntpdc/Makefile.am@1.16.1.1 +1 -1
+ no-dot-in-path fix for ntpdc-layout
+
+ChangeSet@1.1140.1.1, 2003-08-10 00:13:06-07:00, gnu@ring.wraith.sf.ca.us
+ Merge bk://ntp.bkbits.net/ntp-dev
+ into ring.wraith.sf.ca.us:/home/gnu/src/ntp/ntp-dev
+
+ BitKeeper/etc/gone@1.6 +1 -0
+
+ BitKeeper/etc/gone@1.5 +1 -0
+
diff --git a/CommitLog-4.1.0 b/CommitLog-4.1.0
new file mode 100644
index 0000000..c0ce2d8
--- /dev/null
+++ b/CommitLog-4.1.0
@@ -0,0 +1,6152 @@
+2001-08-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.1.0
+
+2001-07-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c (oncore_start): Set pps_enable=1, just
+ like the atom driver does.
+ From: reg@dwf.com
+
+ * ntpd/refclock_nmea.c (nmea_ppsapi): Set pps_enable=1, just like
+ the atom driver does.
+ From: Scott Allendorf <sca@newton.physics.uiowa.edu>
+
+ * ntpd/ntp_config.c (getconfig): CONF_CLOCK_PANIC was using the
+ wrong config flag.
+ From: <justin_forrester@hp.com>
+
+2001-07-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99m-rc3
+
+2001-07-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntp_update: COPYRIGHT needs a touch.
+ From: Mike Stump <mrs@kithrup.com>
+
+2001-07-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/config.htm: Major cleanup.
+ From: Martin Janzen <janzen@pixelmetrix.com>
+
+ * configure.in (rt library check): Don't look for -lrt under
+ Linux. Under glibc-2.1.2 and -2.2.2 (at least), the POSIX-
+ compatibility real-time library does strange things with threads
+ as other processes and we're getting lots of complaints about it.
+ Reported by: Juha Sarlin <juha@c3l.com>
+
+2001-06-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver35.htm: Update email address.
+
+2001-06-25 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c (oncore_msg_BaEaHa): Fix wrong offset for
+ rsm.bad_almanac
+ From: Reynir Siik <reynir@royal.net>
+
+2001-06-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99m-rc2
+
+2001-06-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c:
+ * include/ntp_config.h: includefile config keyword support
+ From: Dean Gibson <timekeeper@tcp-udp.net>
+
+2001-06-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99m-rc1b
+
+ * ntpd/refclock_true.c (true_debug): Bump some buffer sizes to
+ reduce/eliminate chance of buffer overflow. Use snprintf()
+ instead of sprintf(). Do a better job of opening the debug file.
+ * ntpd/ntp_control.c (ctl_getitem): Count overflow packets as bad
+ and return a BADFMT.
+ * ntpd/ntp_config.c (save_resolve): call fdopen() with the correct
+ mode.
+ From: Bela Lubkin <belal@sco.com>
+
+2001-06-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp.h (RES_ALLFLAGS): Add RES_DEMOBILIZE.
+ From: Dean Gibson <timekeeper@tcp-udp.net>
+
+ * configure.in: 4.0.99m-rc1a
+
+2001-06-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_refclock.c (refclock_open): Add O_NOCTTY to the open()
+ flags when opening a serial port.
+ Reported by: joseph lang <tcnojl1@earthlink.net>
+
+2001-05-31 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/notes.htm: Typo fix.
+ From: John Stone <johns@ks.uiuc.edu>
+
+ * configure.in: 4.0.99m-rc1
+
+ * html/monopt.htm: Typo fix.
+ * html/confopt.htm: Cruft removal.
+ From: John Stone <johns@ks.uiuc.edu>
+
+2001-05-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * README.cvs: More updates and cleanup.
+
+ * ntpd/ntp_loopfilter.c (loop_config):
+ Check against STA_NANO instead of (NTP_API > 3) to catch kernels
+ that were rolled while the spec was evolving.
+ From: John.Hay@icomtek.csir.co.za
+
+ * README.cvs: Note that we want to check out NTP into a clean
+ subdir.
+ Reported by jrd@cc.usu.edu (Joe Doupnik)
+
+2001-05-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k40
+
+ * include/ntp_refclock.h: Median Filter (SAMPLE - macro) - change
+ to use most recent MAXSTAGE entries when the filter overflows (ie
+ driver poking say once per second with poll > MAXSTAGE) rather
+ than blocking after MAXSTAGE entries (turf oldest rather than turf
+ most recent).
+ From: John Woolner <vk1et@tpg.com.au>
+
+ * ntpd/refclock_true.c:
+ a. Don't cream pp->a_lastcode when we get a <cr><lf> pair
+ b. Fix up pp->leap handling to work correctly
+ c. clear CEVNT_BADTIME etc warnings when we get good clock
+ CEVNT_NOMINAL.
+ From: John Woolner <vk1et@tpg.com.au>
+
+ * kernel/sys/pcl720.h:
+ Add support for the XL clock to refclock_true.c
+ From: Paul A Vixie <vixie@mfnx.net>
+
+ * ntpd/ntp_loopfilter.c (local_clock): One more attempt at
+ "improving" the panic message.
+
+2001-05-26 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_func_ctty_for_f_setown): BSDI3 needs a ctty
+ for F_SETOWN, too.
+ From: Paul A Vixie <vixie@mfnx.net>
+
+2001-05-24 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/ntpd.htm: Typo.
+ From: John Stone <johns@ks.uiuc.edu>
+
+2001-05-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k39
+
+ * ntpd/ntp_loopfilter.c (local_clock): huffpuff cleanup/improvements.
+ (huffpuff): Cleanup/improvements.
+ (loop_config): huffpuff initialization cleanup/improvements.
+ From: Dave Mills, Terje, Mark, and John?
+
+2001-05-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/release.htm:
+ * html/ntpd.htm:
+ * html/miscopt.htm:
+ From: Dave Mills: Updates.
+
+2001-05-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k38
+
+ * ntpd/ntp_proto.c (clock_filter): Huff-n-Puff and Popcorn
+ improvements.
+ * ntpd/ntp_loopfilter.c (local_clock): Debug cleanup
+ From: Dave Mills.
+
+ * include/ntp_syscall.h (ntp_gettime): Updated patch from Ulrich.
+ My original attempt was not backwards compatible.
+
+2001-05-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_syscall.h (ntp_gettime): Fill in the tai member.
+ From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * configure.in: 4.0.99k37
+
+ * ntpd/ntp_proto.c (clock_filter): Lose "off", xtemp and ytemp,
+ and some obsoleted calculations. Set the peer->offset and
+ peer->delay from the filter stages.
+
+ * ntpd/ntp_loopfilter.c: Comment/document improvements.
+ (local_clock): correct the offset by one-half the difference
+ between the sample delay and minimum delay. Lose "mu" from the
+ debug message.
+ From: Dave Mills.
+
+2001-05-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k36
+
+ * ntpd/ntp_loopfilter.c: Huff-n-puff cleanup
+ From: Dave Mills.
+
+2001-05-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k35
+
+ * ntpd/refclock_atom.c (atom_ppsapi): set pps_enable=1 if
+ enb_hardpps.
+ * ntpd/ntp_timer.c: huffpuff support.
+ (init_timer): huffpuff support.
+ (timer): huffpuff support.
+ * ntpd/ntp_proto.c (init_proto): Initialize pps_enable to 0, not 1.
+ * ntpd/ntp_loopfilter.c (CLOCK_HUFFPUFF): Added.
+ Add huff-n-puff filter variables.
+ (local_clock): Lose "pps sync enabled" log noise.
+ (huffpuff): Added.
+ (loop_config): LOOP_MINPOLL and LOOP_ALLAN were missing the
+ trailing break; add LOOP_HUFFPUFF.
+ * ntpd/ntp_config.c: tinker huffpuff added.
+ (getconfig): CONF_CLOCK_HUFFPUFF support.
+ * include/ntpd.h: huffpuff() declaration.
+ * include/ntp_config.h (CONF_CLOCK_HUFFPUFF): Added.
+ * include/ntp.h (HUFFPUFF): Added.
+ (LOOP_HUFFPUFF): Added.
+ From: Dave Mills.
+
+2001-05-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver20.htm: Reality check.
+ * ntpd/refclock_nmea.c: Comment cleanup
+ From: John Woolner <vk1et@tpg.com.au>
+
+ * html/release.htm: Cleanup (at least).
+ * html/refclock.htm: Cleanup (at least).
+ * html/kern.htm: Cleanup (at least).
+ * html/index.htm: Cleanup (at least).
+ * html/extern.htm: Cleanup (at least).
+ * html/driver1.htm: Cleanup (at least).
+ * html/debug.htm: Cleanp (at least).
+ * html/accopt.htm: KoD documentation update.
+ From: Dave Mills.
+
+ * configure.in: 4.0.99k34
+
+ * ntpd/ntp_util.c (record_loop_stats): values are now passed in.
+ * ntpd/ntp_loopfilter.c (local_clock): pass the values to
+ record_loop_stats().
+ * include/ntpd.h: Pass the parameters in to record_loop_stats().
+ With the discipline loop opened (disable ntp) the local clock
+ updates were not being sent to loopstats. That now is.
+ From: Dave Mills.
+
+2001-05-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k33
+
+ * ntpd/ntp_proto.c (receive): Validate the source port. Lose
+ NTPv1 support.
+ * ntpd/ntp_loopfilter.c (local_clock): Sanity check sys_poll
+ earlier instead of later.
+ From: Dave Mills.
+
+ * ntpd/refclock_oncore.c (oncore_msg_any): We don't always have
+ GETTIMEOFDAY().
+
+2001-05-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_shm.c (shm_poll): Apply JAN_1970 correction after
+ calling TVTOTS(), just like everybody else does.
+ From: David Malone <dwmalone@maths.tcd.ie>
+
+ * ntpd/refclock_ulink.c: fixed 33x quality flag, added more
+ debugging stuff, updated 33x time code explanation.
+ From: s.l.smith (via j.c.lang).
+
+2001-05-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k32
+
+ * ntpd/ntp_loopfilter.c: rstclock now takes a 3rd argument, the
+ last offset.
+ (init_loopfilter): Use it.
+ (local_clock): Use it. Clean up the code.
+ (loop_config): Use it.
+ (rstclock): Implement it. Clean up the code.
+ From Dave Mills.
+
+2001-05-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k31
+
+ * ntpdc/ntpdc_ops.c (sysstats): That's 'bad packet format'
+ (instead of '... length'), and 'packets rejected' (instead of
+ 'limitation rejects'.
+ * ntpd/ntp_proto.c (receive): PUBKEY fixes. Move KoD stuff to
+ process_packet().
+ (process_packet): Move KoD stuff here...
+ (peer_clear): Unspec the stratum, too.
+ (clock_filter): Don't update peer->epoch here. Fix the filter
+ test when checking the epoch.
+ (fast_xmit): Send back STRATUM_UNSPEC on a KoD packet.
+ (init_proto): Initialize sys_jitter.
+
+ * ntpd/ntp_loopfilter.c: rstclock() takes 2 parameters now.
+ (init_loopfilter): Use it...
+ (local_clock): Ditto, and change the "mu" calculation. Improve
+ the jitter test in S_SYNC. Use peer->epoch (not current_time) to
+ update the last_time. Update debug info.
+ (rstclock): 2nd arg - the epoch to use. Use it.
+ (loop_config): update call to rstclock.
+ From: Dave Mills.
+
+2001-05-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ports/winnt/ntpd/ntpd.dsp: Add cmd_args.c
+ From: Wink Saville <wink@saville.com>
+
+2001-04-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpq/ntpq.c (tstflags): 11 now.
+ From: John Cochran <jdc@fiawol.org>
+
+ * ntpd/ntp_proto.c (receive): KoD updates. Improve the comments.
+ Lose the AM_PROCPKT restrictions test.
+ (peer_xmit): Check/report on no encryption key in packet.
+ (fast_xmit): Use peer_xmit's new packet length check code.
+ From Dave Mills.
+
+2001-04-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k30
+
+2001-04-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpdc/ntpdc_ops.c: Added "kod", lost "demobilize".
+ * ntpd/ntp_config.c: Added "kod" keyword. Lose "demobilize" keyword.
+ * html/release.htm: Updated.
+ * html/accopt.htm: Updated.
+ From: Dave Mills.
+
+ * ntpq/ntpq.c: Reorder and add some TEST flag bits.
+ * ntpd/ntp_proto.c (transmit): Also bail if access denied.
+ (receive): Lose RES_DEMOBILIZE and (some?) RES_DONTSERVE and
+ RES_LIMITIED stuff. Update Kiss-Of-Death (KoD) docs.
+ Call fast_xmit with new 3rd parameter (restrict_mask).
+ Before checking for an authentic packet, check the restrict_mask
+ for RES_{DONTSERVE,LIMITED,NOPEER}.
+ Check restrictions in AM_PROCPKT case.
+ (peer_clear): Don't lose the stratum if the peer->flags don't
+ indicate FLAG_REFCLOCK.
+ (fast_xmit): Take restrict mask as a new argument, and handle
+ KoD. Reorder some code.
+ From: Dave Mills.
+
+2001-04-26 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpdc/ntpdc_ops.c: restrict/unrestrict support for version and
+ demobilize. Implement demobilze.
+ * ntpd/ntp_proto.c (receive): Improve version testing, including
+ RES_DEMOBILIZE support.
+ (fast_xmit): Patches to kiss-of-death packet.
+ * ntpd/ntp_loopfilter.c (local_clock): S_SYNC case now also checks
+ abs(clock_offset) against CLOCK_PGATE*sys_jitter.
+ * ntpd/ntp_config.c: CONF_RES_DEMOBILIZE/demobilize support.
+ * include/ntp_config.h (CONF_RES_DEMOBILIZE): Added.
+ * include/ntp.h (RES_DEMOBILIZE): Added.
+ From Dave Mills.
+
+2001-04-25 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/accopt.htm: Document the "version" parameter
+ From Dave Mills.
+
+ * ntpd/ntp_proto.c (fast_xmit): Implement DENY mode.
+ From Dave Mills.
+
+ * ntpd/ntp_config.c: Add the "allan" tinker variable.
+ From: Juha Sarlin <juha@c3l.tyreso.se>
+
+ * ntpd/refclock_hopfpci.c (hopfpci_start): Lose the "correct_any"
+ stuff - it's both obsolete and wrong.
+
+ * ntpd/ntp_proto.c (receive): Keep track of packet versions.
+ Implement RES_LIMITED.
+ * include/ntp_config.h (CONF_RES_LIMITED):
+ * include/ntp.h (RES_LIMITED): Leave the bits in the original
+ order.
+ From Dave Mills.
+
+ * util/timetrim.c:
+ * util/Makefile.am:
+ * ntpdc/ntpdc_ops.c:
+ * ntpd/refclock_nmea.c:
+ * libntp/snprintf.c:
+ * configure.in:
+ * configure:
+ * config.h.in:
+ * aclocal.m4:
+ * acconfig.h:
+ Lint cleanup from: Marc Brett <mbrett@rgs0.london.waii.com>
+
+ * ntpd/ntp_config.c: Add "version" support.
+ (getconfig): version support.
+ * include/ntp_config.h (CONF_RES_VERSION): Added.
+ * include/ntp.h (RES_VERSION): Added.
+ From: Dave Mills.
+
+ * include/ntp_machine.h (ifreq): WinNT cleanup
+
+2001-04-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k29
+
+ * html/miscopt.htm: Document the "allan" tinker variable.
+ * ntpd/ntp_proto.c (clock_filter): Update comments. Lose etemp;
+ we now use allan_xpt for this.
+ * ntpd/ntp_loopfilter.c: Added allan_xpt as a tinker variable.
+ Reorganize variables and improve comments.
+ (local_clock): Improve comments, use (new) allan_xpt instead of
+ CLOCK_ALLAN. Fix test in S_SYNC state. Update debug info.
+ (rstclock): No longer force allan_xpt to CVLOCK_ALLAN in S_FREQ,
+ S_SYNC, or default case.
+ (loop_config): Document dangerous tinker variables, and add
+ LOOP_ALLAN to the list.
+ * include/ntp_config.h (CONF_CLOCK_ALLAN): Added.
+ * include/ntp.h (LOOP_ALLAN): Added.
+ Allan intercept fixes from Dave Mills.
+
+ * scripts/mkver.in: Use the C locale so the dates come out in a
+ consistent format.
+ From: ASANO Naoyuki <n_asano@imjp.co.jp>
+
+ * build: Run "config.status" before the "make" because it probably
+ saves time and trouble. Probably...
+
+ * flock-build: Try building sequentially.
+
+2001-04-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_make_tickadj): Fix it right...
+
+ * util/ntp-genkeys.c: extern config_netinfo, too.
+
+ * util/hist.c:
+ * ntptrace/ntptrace.c:
+ * ntpq/ntpq.c:
+ * ntpdc/ntpdc.c:
+ * ntpdate/ntptimeset.c:
+ * ntpdate/ntpdate.c:
+ * ntpd/refclock_parse.c:
+ * ntpd/refclock_msfees.c:
+ * ntpd/refclock_jupiter.c:
+ * ntpd/ntp_refclock.c:
+ * ntpd/ntp_io.c:
+ * libparse/clk_wharton.c:
+ * libparse/clk_varitext.c:
+ * libparse/clk_trimtaip.c:
+ * libparse/clk_schmid.c:
+ * libparse/clk_rcc8000.c:
+ * libparse/clk_rawdcf.c:
+ * libparse/clk_meinberg.c:
+ * libparse/clk_hopf6021.c:
+ * libparse/clk_dcf7000.c:
+ * libparse/clk_computime.c:
+ Lint. From: Simon Burge <simonb@wasabisystems.com>
+
+2001-04-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_nmea.c (nmea_receive): Fixes.
+ From: John Woolner <vk1et@tpg.com.au>
+
+ * util/ntp-genkeys.c: Declare check_netinfo, don't define it.
+ From: Jack Bryans <jbryans@csulb.edu>
+
+ * configure.in (RSASRCS): rsaref2 needs digit.h (I thought I fixed
+ this already).
+
+ * configure.in (CFLAGS): Disable -Wconversion, enable
+ -Wmissing-prototypes, and allow for -Werror.
+ From: Simon Burge <simonb@wasabisystems.com>
+
+ * util/ntp-genkeys.c (main): Reset the standard mask so the
+ symlinks are created with the standard mask.
+
+ * configure.in: 4.0.99k28
+
+ * ntpd/ntpd.c (ntpdmain): Use mode_t for umask value.
+
+ * util/ntp-genkeys.c: Create files with the right umask.
+
+ * util/ntp-genkeys.c: config_file should be declared, not defined.
+ * ntpd/refclock_mx4200.c (mx4200_pps): debug cleanup.
+ * ntpd/refclock_hopfser.c: If we're not using it, provide the _bs.
+ * ntpd/refclock_heath.c (heath_receive): Add missing "break"
+ statements.
+ * ntpd/ntp_proto.c: Lose extra definition of mode_ntpdate.
+ * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Put RSASRCS
+ on the same line as rsaref.h to improve portability.
+ * libntp/msyslog.c: Lint cleanup.
+ From: Marc.Brett@westerngeco.com
+
+ * util/ntp-genkeys.c:
+ * ntpdate/ntpdate.c:
+ * ntpd/ntp_config.c: Netinfo header reorder.
+ From: Jack Bryans <jbryans@csulb.edu>
+
+ * configure.in: timespec can be found by looking in goofy places
+ under SunOS.
+
+2001-04-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_nmea.c: PPSAPI cleanup, default to RMC sentences,
+ handle milliseconds, multiple sentences, other good stuff.
+ From: John Woolner <vk1et@tpg.com.au>, Marc.Brett@westerngeco.com,
+ John.Hay@icomtek.csir.co.za
+
+ * ntpd/ntp_proto.c (receive): In the AM_NEWBCL case, return in all
+ cases at the end.
+ * ntpd/ntp_peer.c (newpeer): Check cast_flags against MDF_BCLNT,
+ not against MDF_BCAST.
+ * ntpd/ntp_loopfilter.c (local_clock): Lose debug info.
+ * ntpd/ntp_crypto.c (crypto_recv): Bugfix.
+ From: Dave Mills.
+
+ * configure.in: 4.0.99k27
+
+ * ntpd/ntp_loopfilter.c (local_clock): Check clock_panic > 0.
+ Check clock_max > 0.
+ * html/ntpd.htm: Cleanup.
+ * html/miscopt.htm: Cleanup.
+ * html/confopt.htm: Cleanup minpoll documentation.
+ From: Dave Mills.
+
+2001-04-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/cmd_args.c (getstartup): check_netinfo needs an extern
+ declaration.
+ Reported by: Jack Bryans <jbryans@csulb.edu>
+
+ * configure.in (ac_cv_make_timetrim): Added.
+ * util/Makefile.am (bin_PROGRAMS): MAKE_TIMETRIM
+ Requested by: Jack Bryans <jbryans@csulb.edu>
+
+ * configure.in: 4.0.99k26
+
+ * util/ntp-genkeys.c:
+ * ntpd/refclock_oncore.c:
+ * ntpd/ntp_peer.c:
+ * libntp/msyslog.c:
+ * libntp/audio.c:
+ Lint cleanup.
+ From: Simon Burge <simonb@wasabisystems.com>
+
+ * ntpd/ntp_loopfilter.c (local_clock): debug message improvements
+ from Dave Mills.
+
+ * libntp/emalloc.c (emalloc): Tell people we are exiting if we log
+ an out-of-memory condition.
+
+ * util/ntp-genkeys.c (main): Don't allow '#' in a generated MD5
+ key. Reported by: Dave Tyson <Dave.Tyson@liverpool.ac.uk>
+
+2001-04-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (clock_update): minpoll cleanup.
+ (clock_select): minpoll cleanup.
+ (clock_filter): Bugfixes from Mark Martinec <Mark.Martinec@ijs.si>
+ * ntpd/ntp_loopfilter.c (rstclock): minpoll cleanup. Debug cleanup.
+ * ntpd/ntp_config.c (getconfig): Initialize/bounds check minpoll
+ using NTP_MINDPOLL insted of sys_minpoll.
+ From: Dave Mills.
+
+2001-04-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/msyslog.c:
+ * ElectricFence/page.c (stringErrorReport): Follow Rainer's lead
+ and use strerror().
+
+ * ntpd/refclock_shm.c (shm_start): Always use strerror.
+ * libntp/msyslog.c (msyslog): Use strerror if present.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.
+
+ * ntpd/ntp_config.c (getconfig): Read stratum fudge value into
+ long variable.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * libparse/parsesolaris.c (rdchar): Cast ~0 to unsigned long.
+ * libntp/buftvtots.c (buftvtots): Allow for 8-byte tv_sec, tv_usec
+ in struct timeval.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+2001-04-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c (getconfig): move "tinker" so it's generally
+ available.
+
+2001-04-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Look for getclock().
+
+ * ntpd/ntp_config.c (getconfig): Squawk if provided minpoll or
+ maxpoll values are out of range.
+
+ * ntpd/ntp_proto.c (poll_update): Some operations can only be done
+ if we're compiling with some REFCLOCKs.
+ From Dave Mills.
+
+ * configure.in (RSASRCS): Added.
+ * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Use RSASRCS.
+
+ * configure.in: Limit the DECL_HSTRERROR_0 to aix4.3.*. RSN, we
+ could also limit it to xlc...
+
+ * configure.in: 4.0.99k25
+
+ * html/leap.htm: Added.
+ * html/index.htm: Update.
+ * html/driver7.htm: Update.
+ * html/driver6.htm: Update.
+ * html/driver36.htm: Update.
+ * html/audio.htm: Update.
+ * html/y2k.htm: Removed.
+ From Dave Mills.
+
+2001-04-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * acconfig.h: Lose extra declarations of PACKAGE and VERSION.
+
+ * acconfig.h:
+ * configure.in:
+ * include/l_stdlib.h: DECL_HSTRERROR_0 needed for xlc under AIX 4.3.2.
+ Reported by: Harald Barth <haba@pdc.kth.se>
+
+ * ntpd/ntp_proto.c (proto_config): cal_enable (PROTO_CAL) is
+ invalid if no refclocks are present.
+ From: Frodo Looijaard <frodol@dds.nl>
+
+ * README.cvs: On some systems, the -C option fails.
+
+ * ntpd/refclock_nmea.c:
+ * ntpd/ntp_refclock.c:
+ * html/driver20.htm:
+ PPSAPI patches for NMEA driver.
+ From: John.Hay@icomtek.csir.co.za
+
+ * README.rsa: Describe RSAEuro support, provide alternate rsa.c
+ patch.
+ * configure.in: Check for rsaeuro1, RSAOBJS, RSADIR respectively.
+ * html/build.htm: Hint at rsaeuro1 directory.
+ * include/global.h (BYTE): Define.
+ * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Removed rsaref2
+ specific sources.
+ (librsaref_a_LIBADD): Add appropriate objects.
+ (librsaref_a_DEPENDENCIES): Work around automake limitation.
+ (stamp-rsaref): Use RSADIR.
+ * scripts/README: Document ntp-close.
+ * scripts/Makefile.am (EXTRA_DIST): Distribute it.
+ * Makefile.am (DISTCLEANFILES): Remove .warning.
+ * librsaref/Makefile.am (DISTCLEANFILES): Remove copied/touched
+ librsaref sources, stamp-rsaref.
+ * ntpdate/Makefile.am (DISTCLEANFILES): Remove version.c.
+ * ntpq/Makefile.am (DISTCLEANFILES): Likewise.
+ * parseutil/Makefile.am (DISTCLEANFILES): Remove $(EXTRA_PROGRAMS).
+ Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpd/ntp_control.c: Header cleanup
+
+2001-04-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Properly align --help output.
+ Explain ElectricFence.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpd/ntp_loopfilter.c (local_clock): Lose debugging statements.
+ * ntpd/ntp_proto.c (clock_filter): Rewrite.
+ From: Dave Mills
+
+ * ntpd/ntp_control.c (ctl_getitem): msyslog() possible buffer
+ overflow exploit.
+
+ * configure.in: 4.0.99k24
+
+ * html/pic/radio2.jpg:
+ * html/release.htm:
+ * html/refclock.htm:
+ * html/pps.htm:
+ * html/ntpd.htm:
+ * html/miscopt.htm:
+ * html/driver22.htm:
+ * html/confopt.htm:
+ Updated documentation from Dave Mills.
+
+ * util/ntp-genkeys.c: sys_minpoll.
+ * ntpd/refclock_atom.c: Comment additions.
+ * ntpd/ntp_proto.c: mode_ntpdate and peer_ntpdate added.
+ (transmit): We want 3, not 2, consecutive polls. hpoll logic
+ cleanup. mode_ntpdate changes.
+ (receive): When setting up a newpeer, use our sys_minpoll, not the
+ peer->ppoll.
+ (clock_update): sys_minpoll changes. Reorder some case 1 code.
+ Don't exit in case 2.
+ (poll_update): hpoll cleanup.
+ (peer_clear): u_rand. Use u_rand to randomize the initial poll.
+ * ntpd/ntp_peer.c (newpeer): Bump peer_ntpdate if we're in
+ mode_ntpdate.
+ * ntpd/ntp_loopfilter.c: Initialize sys_poll and sys_minpoll to
+ NTP_MINDPOLL.
+ (local_clock): Clean up some debug/info messages.
+ (rstclock): Use sys_minpoll.
+ (loop_config): KERNEL_PLL sanity checks. LOOP_MINPOLL support.
+ * ntpd/ntp_crypto.c (crypto_recv): Turn off FLAG_AUTOKEY when we
+ turn off TEST10.
+ * ntpd/ntp_control.c (ctl_getitem): Buffer overflow check. Clean
+ up some loop logic.
+ * ntpd/ntp_config.c: Added "tinker" and "minpoll". Use
+ sys_minpoll now, instead of old manifest constant.
+ (save_resolve): Print keyid using decimal, not hex. From Lars-Owe
+ Ivarsson <larsowe@paradisaea.its.uu.se>
+ * include/ntpd.h: Added peer_ntpdate and sys_minpoll.
+ * include/ntp_config.h (CONF_CLOCK_MINPOLL): Added.
+ * include/ntp.h: keyid cleanup. LOOP_* cleanup.
+ From Dave Mills.
+
+2001-04-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (clock_filter): Swell stuff.
+ From: Mark Martinec <Mark.Martinec@ijs.si>
+
+ * ports/winnt/ntpd/ntpd.dsp:
+ * ports/winnt/ntpd/hopf_PCI_io.c:
+ * ports/winnt/include/hopf_PCI_io.h:
+ * ports/winnt/include/config.h:
+ * ntpd/refclock_hopfser.c:
+ * ntpd/refclock_hopfpci.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/ntp_control.c:
+ * ntpd/Makefile.am:
+ * libntp/clocktypes.c:
+ * include/ntp.h:
+ * include/hopf6039.h:
+ * include/Makefile.in:
+ * include/Makefile.am:
+ * html/pic/fg6039.jpg:
+ * html/refclock.htm:
+ * html/driver39.htm:
+ * html/driver38.htm:
+ * html/copyright.htm:
+ Updated Oncore dudes.
+
+ * configure.in:
+ HOPF drivers and documentation.
+ From: Bernd Altmeier <altmeier@atlsoft.de> (with some light
+ hacking from Harlan to clean up indentation and lose the // comments)
+
+ * ntpd/refclock_oncore.c:
+ * ntpd/refclock_conf.c: Make it go.
+ From: Reg Clemens <reg@dwf.com>
+
+ * configure.in (openssl): Publish and default to RSAREF; hide
+ openssl, and only use it if explicitly requested (at least until
+ we work with it).
+
+2001-04-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/y2k.htm:
+ * html/tickadj.htm:
+ * html/release.htm:
+ * html/refclock.htm:
+ * html/quick.htm:
+ * html/pps.htm:
+ * html/ntptrace.htm:
+ * html/ntptime.htm:
+ * html/ntpq.htm:
+ * html/ntpdc.htm:
+ * html/ntpdate.htm:
+ * html/ntpd.htm:
+ * html/miscopt.htm:
+ * html/index.htm:
+ * html/genkeys.htm:
+ * html/exec.htm:
+ * html/driver7.htm:
+ * html/driver22.htm:
+ * html/copyright.htm:
+ * html/confopt.htm:
+ * html/build.htm:
+ * html/authopt.htm:
+ * html/assoc.htm:
+ Updates from Dave Mills.
+
+2001-04-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (OPENSSL): Just use -lcrypto.
+ Reported by Dave Mills.
+
+2001-03-31 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k20
+
+ * ntpd/refclock_heath.c: Add support for GC-1000 II.
+ From Dave Mills.
+
+ * ntpd/ntp_proto.c (transmit): Check peer->unreach.
+ (peer_clear): peer->outdate is a f(BURST_INTERVAL1), not
+ NTP_MINPOLL.
+ * ntpd/ntp_loopfilter.c (local_clock): mode_ntpdate stuff.
+ * ntpd/ntp_crypto.c: OpenSSL/RSAREF support.
+ * ntpd/cmd_args.c: Use -q, not -z, for mode_ntpdate.
+ (getstartup): nofork on mode_ntpdate. Usage update.
+ * include/ntp_crypto.h: OpenSSL/RSAREF support.
+ From: Dave Mills.
+
+ * configure.in (rsaref): Buglet.
+
+2001-03-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (clock_update): mode_ntpdate support.
+ * ntpd/ntp_loopfilter.c (local_clock): mode_ntpdate support.
+ * ntpd/cmd_args.c: Added -z (mode_ntpdate).
+ * include/ntpd.h: mode_ntpdate added.
+ * include/ntp_crypto.h: RSAREF/OPENSSL cleanup.
+ From: Dave Mills.
+
+2001-03-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * config.h.in:
+ * aclocal.m4:
+ * configure.in: Prepare for OpenSSL support
+
+2001-03-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * README.rsa: Note that RSAEURO will not work.
+ Reported by: pieter.delacourt@banksys.be
+
+2001-03-25 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_if.h:
+ * include/ntp_machine.h:
+ * include/ntp_unixtime.h:
+ * libntp/humandate.c:
+ * libntp/iosignal.c:
+ * libntp/mktime.c:
+ * libntp/prettydate.c:
+ * libntp/systime.c:
+ * libntp/tvtoa.c:
+ * libntp/uglydate.c:
+ * libntp/utvtoa.c:
+ * libparse/clk_computime.c:
+ * libparse/clk_dcf7000.c:
+ * libparse/clk_hopf6021.c:
+ * libparse/clk_meinberg.c:
+ * libparse/clk_rawdcf.c:
+ * libparse/clk_rcc8000.c:
+ * libparse/clk_schmid.c:
+ * libparse/clk_trimtaip.c:
+ * libparse/clk_trimtsip.c:
+ * libparse/clk_varitext.c:
+ * libparse/parse.c:
+ * libparse/parse_conf.c:
+ * ntpd/check_y2k.c:
+ * ntpd/ntp_config.c:
+ * ntpd/ntp_control.c:
+ * ntpd/ntp_intres.c:
+ * ntpd/ntp_io.c:
+ * ntpd/ntp_loopfilter.c:
+ * ntpd/ntp_monitor.c:
+ * ntpd/ntp_proto.c:
+ * ntpd/ntp_refclock.c:
+ * ntpd/ntp_request.c:
+ * ntpd/ntp_resolver.c:
+ * ntpd/ntp_timer.c:
+ * ntpd/ntp_util.c:
+ * ntpd/ntpd.c:
+ * ntpd/refclock_acts.c:
+ * ntpd/refclock_arbiter.c:
+ * ntpd/refclock_arc.c:
+ * ntpd/refclock_as2201.c:
+ * ntpd/refclock_atom.c:
+ * ntpd/refclock_bancomm.c:
+ * ntpd/refclock_chronolog.c:
+ * ntpd/refclock_chu.c:
+ * ntpd/refclock_datum.c:
+ * ntpd/refclock_dumbclock.c:
+ * ntpd/refclock_fg.c:
+ * ntpd/refclock_gpsvme.c:
+ * ntpd/refclock_heath.c:
+ * ntpd/refclock_hpgps.c:
+ * ntpd/refclock_irig.c:
+ * ntpd/refclock_jupiter.c:
+ * ntpd/refclock_leitch.c:
+ * ntpd/refclock_local.c:
+ * ntpd/refclock_msfees.c:
+ * ntpd/refclock_mx4200.c:
+ * ntpd/refclock_nmea.c:
+ * ntpd/refclock_oncore.c:
+ * ntpd/refclock_pcf.c:
+ * ntpd/refclock_pst.c:
+ * ntpd/refclock_shm.c:
+ * ntpd/refclock_tpro.c:
+ * ntpd/refclock_trak.c:
+ * ntpd/refclock_true.c:
+ * ntpd/refclock_ulink.c:
+ * ntpd/refclock_usno.c:
+ * ntpd/refclock_wwv.c:
+ * ntpd/refclock_wwvb.c:
+ * ntpdate/ntpdate.c:
+ * ntpdate/ntptime_config.c:
+ * ntpdate/ntptimeset.c:
+ * ntpdc/ntpdc.c:
+ * ntpdc/ntpdc_ops.c:
+ * ntpq/ntpq.c:
+ * ntpq/ntpq_ops.c:
+ * ntptrace/ntptrace.c:
+ * parseutil/testdcf.c:
+ * util/hist.c:
+ * util/ntp-genkeys.c:
+ * util/ntptime.c:
+ * util/precision.c:
+ * util/tickadj.c:
+ time.h and sys/time.h cleanup.
+
+2001-03-24 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: '99k19
+
+ * ntpd/refclock_atom.c (atom_ppsapi): PPS API RFC alignment patches.
+ From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * util/ntptime.c: MNT options
+ From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * ntpd/ntp_refclock.c (refclock_newpeer): Lose "extra" free().
+ From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * configure.in: 4.0.99k18 and auto* upgrade
+
+2001-03-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpdc/ntpdc_ops.c (printpeer): No more "valid".
+ * ntpd/ntp_request.c (peer_info): No more "valid".
+ * ntpd/ntp_refclock.c (refclock_transmit): valid/hpoll cleanup.
+ * ntpd/ntp_proto.c (transmit): valid/hpoll and peer->ttl cleanup.
+ peer->valid/oreach cleanup.
+ (receive): Call newpeer() with the pkt->ppoll, not
+ NTP_MINDPOLL (in several places).
+ In AM_NEWPASS, if we have a NULL peer, return.
+ (poll_update): Added xpoll definition, fixed oldpoll definition.
+ Algorithmic improvements.
+ * ntpd/ntp_peer.c (newpeer): Better minpoll/maxpoll
+ initialization.
+ (resetmanycast): That's a poll_update() on an MDF_ACAST, not a
+ poll_clear().
+ * ntpd/ntp_crypto.c: include <fcntl.h>.
+ (crypto_recv): Leave the crypto_flags alone when wiggling the
+ peer-> stuff.
+ (crypto_cert): Make room for daddy. Do a real open() on the cert
+ file. Read the cert. Initial hack and slash. Better debug info.
+ * ntpd/ntp_control.c: CP_VALID now does "unreach".
+ (ctl_putpeer): Ditto.
+ * include/ntp_request.h: info_peer gets a placeholder for "valid".
+ * include/ntp_crypto.h (CRYPTO_FLAG_CERT): Comment update.
+ * include/ntp.h: Lose "valid" from struct peer.
+ From: Dave Mills.
+
+2001-03-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (transmit): hpoll calc logic cleanup.
+ (receive): New cert stuff.
+ (poll_update): Improvements.
+ (peer_clear): New cert stuff.
+ (peer_xmit): New cert stuff.
+ * ntpd/ntp_crypto.c: New cert stuff, documentation cleanup. Lose
+ extraneous poll_uopdate()s.
+ * ntpd/ntp_control.c: Deal with new cert stuff.
+ * ntpd/ntp_config.c (getconfig): Handle CONF_CRYPTO_CERT.
+ * include/ntp_crypto.h (CRYPTO_FLAG_CERT): Added.
+ (CRYPTO_CERT): Added.
+ (CRYPTO_CONF_CERT): Added.
+ Add declaration for struct value certif.
+ * include/ntp_control.h (CS_CERTIF): Added.
+ (CP_CERTIF): Added.
+ * include/ntp_config.h (CONF_CRYPTO_CERT): Added.
+ * include/ntp.h (TEST10,TEST11): New meaning. Add certif to
+ struct peer.
+ (FLAG_PROVEN): Added.
+ (MAX_EXT_LEN): Removed.
+ exten grew from 672/4 to 5000/4 for PUBKEY.
+ From: Dave Mills.
+
+2001-03-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (transmit): Documentation cleanup.
+ (receive): Watch for NULL peer->pubkey.ptr (TEST11).
+ (poll_update): peer->nextdate, not ->outdate. More cleanup around
+ the disabled PUBKEY chunk.
+ * ntpd/ntp_crypto.c (make_keylist): ltemp might be smaller than
+ sys_automax - check peer->kpoll, too. Other ltemp cleanup.
+ (crypto_recv): fstamp is a PUBKEY-only variable.
+ * include/ntp.h (NTP_AUTOMAX): 13, not 12.
+ From: Dave Mills.
+
+2001-03-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (transmit): hpoll cleanup. Call clock_select()
+ after calling poll_update, not before.
+ (receive): Call poll_update after crypto_recv if FLAG_SKEY.
+ (process_packet): Set peer->ppoll Later.
+ (poll_update): peer->hpoll sanity checking. Set peer->outdate,
+ not ->nextate, when burst > 0. MDF_ACAST cleanup.
+ (clock_select): Fix hpoll typo in call to poll_update().
+ * ntpd/ntp_crypto.c (crypto_xmit): tstamp's value is a function of
+ PUBKEY.
+ * include/ntp.h (clear_to_zero): #define value is a function of
+ AUTOKEY.
+ From: Dave Mills.
+
+2001-02-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (transmit): Documentation/code update.
+ (poll_update): Sanity check peer->hpoll. Improve debug info.
+ (peer_clear): Improve debug info. Turn off FLAG_ASSOC in addition
+ to FLAG_AUTOKEY.
+ (clock_select): peer->status is CTL_PST_SEL_DISTSYSPEER, and don't
+ call poll_update(). Make each entry in the peer_list a
+ CTL_PST_SEL_SELCAND sooner, too. Rework similar logic later on.
+ Change debug level on some info.
+ (peer_xmit): Check peer->flags using FLAG_ASSOC, not
+ CRYPTO_FLAG_AUTO in a couple places. Don't call poll_update() if
+ sendlen > LEN_PKT_NOMAC.
+ * ntpd/ntp_loopfilter.c (local_clock): Improve debug info.
+ Sanity-check sys_poll sooner.
+ * ntpd/ntp_crypto.c: New artwork.
+ (COOKIE_LEN,AUTOKEY_LEN,VALUE_LEN): New.
+ (make_keylist): More debug info. Use FLAG_ASSOC, not
+ CRYPTO_FLAG_ASSOC.
+ (crypto_recv): More debug info. Clean up/improve sanity checks on
+ CRYPTO_ASSOC and CRYPTO_RESP packets, and in other places.
+ (crypto_xmit): Clean up/improve sanity checks on CRYPTO_ASSOC and
+ CRYPTO_RESP packets. Use FLAG_ASSOC, not CRYPTO_FLAG_ASSOC. More
+ debug info.
+ * include/ntp.h (NTP_CANLOCK): Lose it.
+ (clear_to_zero): is now "assoc".
+ (FLAG_ASSOC): Added.
+ From: Dave Mills
+
+2001-02-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpdate/ntpdate.h (NTP_MAXAGE): Added.
+ * ntpd/ntp_refclock.c (refclock_receive): Cleanup.
+ * ntpd/ntp_proto.c (transmit): Don't reset peer->ppoll in one case.
+ Update peer->hpoll based on CTL_PST_SEL_CORRECT, not FLAG_SYSPEER.
+ Don't update peer->ppoll based on MDF_[BM]CAST.
+ (peer_clear): ppoll is initialized to maxpoll.
+ (clock_select): call poll_update(peer->hpoll) earlier.
+ (peer_xmit): Call poll_update later.
+ * ntpd/ntp_peer.c (peer_config): Rework initial values of [hkp]poll.
+ * ntpd/ntp_loopfilter.c (CLOCK_PHI): Added. Deal with other
+ (allow_*) stuff. Treat Windows/NT the same as others regarding
+ panic steps. Deal with tinker stuff.
+ * ntpd/ntp_config.c: Tinker stuff.
+ * ntpd/cmd_args.c (getCmdOpts): -g now wiggles "allow_panic"
+ (renamed from "correct_any"). -x now wiggles "allow_step"
+ (renamed from "allow_step_backward").
+ * include/ntpd.h: Add tinker variables. Rename/rework variables
+ associated with "permission to step" and "permission to make a
+ panic correction"
+ * include/ntp_config.h (CONFIG_TINKER): Added.
+ (CONF_CLOCK_MAX): Tinker keyword
+ (CONF_CLOCK_PANIC): Tinker keyword
+ (CONF_CLOCK_PHI): Tinker keyword
+ (CONF_CLOCK_MINSTEP): Tinker keyword
+ * include/ntp.h (NTP_MINCLOCK): Tinker and other cleanup.
+ From: Dave Mills
+
+2001-02-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (transmit): Don't peer_clear() and reset
+ minpoll unconditionally; make sure the peer is configured.
+ (poll_update): When updating peer->ppoll, check on BCAST and
+ MCAST, not ACAST
+ (peer_clear): PUBKEY cleanup. Zero out the peer structure
+ earlier. Initialization cleanup/fixes.
+ (peer_xmit): CRYPTO_FLAG_AUTO is in peer->flags now.
+ (key_expire): Debug output.
+ * ntpd/ntp_peer.c (unpeer): PUBKEY cleanup.
+ (newpeer): peer variable setup cleanup.
+ * ntpd/ntp_crypto.c (make_keylist): Keep CRYPTO_FLAG_AUTO in
+ peer->flags, not crypto_flags.
+ (crypto_xmit): Ditto.
+ (crypto_recv): Fix up RV_TSP logic (several places).
+ * include/ntp.h (clear_to_zero): Moved...
+ From: Dave Mills.
+
+2001-02-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (peer_xmit): Crypto-related fixes
+ From Dave Mills.
+
+ * ntpd/ntp_crypto.c (crypto_recv): Allocate space for the trailing
+ NUL on the keystr.
+
+2001-01-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k17
+
+ * ntpd/refclock_local.c (STRATUM): 3 -> 5
+ * ntpd/ntp_proto.c: sys_maxd -> sys_selerr, sys_epsil ->
+ sys_syserr. various cleanups and improvements.
+ From: Dave Mills.
+
+2001-01-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k16
+
+ * config.h.in: Regenerated - became empty somehow.
+ Reported by John.Hay@icomtek.csir.co.za
+
+ * ntpd/ntp_proto.c (clock_select): Fix sdisp calculation.
+ From Dave Mills.
+
+ * util/ntp-genkeys.c:
+ * ntpd/refclock_chu.c:
+ * ntpd/refclock_atom.c:
+ * ntpd/ntpd.c:
+ * ntpd/ntp_loopfilter.c:
+ * ntpd/ntp_io.c:
+ * ntpd/cmd_args.c:
+ * libntp/audio.c:
+ * include/l_stdlib.h:
+ * html/copyright.htm:
+ Lint fixes (Thanks bunches!)
+ From: Marc.Brett@westerngeco.com
+
+2001-01-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k15
+
+ * ntpd/ntp_proto.c (clock_select): Track error[] items sooner.
+ Typo grabbing the dtemp value and in the sdisp calculation.
+ From Dave Mills.
+
+2001-01-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k14
+
+ * ntpd/ntp_proto.c: Change description of sys_rootdelay and
+ sys_rootdispersion.
+ (process_packet): Fix p_del test (bad distance).
+ (process_packet): Fix bad synch distance test.
+ (process_packet): Fix call to clock_filter (p_disp)
+ (clock_update): Fix sys_rootdelay calculation.
+ (clock_filter): Initialize jit to f(sys_precision)
+ (clock_filter): Update jit using distance[i] instead of
+ SQUARE(). peer->jitter uses dtemp instead of SQUARE().
+ (clock_filter): Updated CLOCK_SGATE checks. When printing debug
+ info, show jitter along with popcorn spike.
+ (clock_select): New sdisp calc.
+ (root_distance): New return value calc.
+ (peer_xmit): xpkt.rootdispersion value change.
+ * include/ntp.h (CLOCK_SGATE): Popcorn spike gate (Whoa, Molly!)
+ From Dave Mills.
+
+2001-01-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * config.sub (Repository): Updated.
+ * config.guess (Repository): Updated.
+
+ * ntpd/ntp_loopfilter.c (local_clock): Just use sys_jitter in the
+ calculation for rootdispersion.
+ From Dave Mills.
+
+2001-01-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (transmit): Fix documentation. Set
+ peer->outdate and call poll_update in a new place. Sanity checks
+ in the MODE_BROADCAST case.
+ (clock_select): Track the old peer. Use the old peer in
+ subsequent checks, where appropriate. Clean up unpeer() logic.
+ From Dave Mills.
+
+2001-01-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_chu.c: Start using HAVE_AUDIO.
+ * ntpd/ntp_proto.c (clock_select): If about to discard an
+ ephemeral association, do it only if not the system peer.
+ From Dave Mills.
+
+ * html/pic/wingdorothy.gif:
+ * html/pic/bustardfly.gif:
+ * html/pic/boom3a.gif:
+ * html/pic/tonea.gif:
+ * html/pic/stack1a.jpg:
+ * html/pic/pogoa.gif:
+ * html/pic/pogo8.gif:
+ * html/pic/pogo6.gif:
+ * html/pic/pogo5.gif:
+ * html/pic/pogo4.gif:
+ * html/pic/pogo3.gif:
+ * html/pic/pogo1.gif:
+ * html/pic/oz2.gif:
+ * html/pic/flatheads.gif:
+ * html/pic/boom4.gif:
+ * html/pic/boom3.gif:
+ * html/pic/appletree.gif:
+ * html/pic/alice51.gif:
+ * html/pic/alice44.gif:
+ * html/pic/alice35.gif:
+ * html/pic/alice31.gif:
+ * html/pic/alice15b.gif:
+ * html/pic/alice13.gif:
+ * html/pic/alice11.gif:
+ * html/release.htm:
+ * html/rdebug.htm:
+ * html/prefer.htm:
+ * html/porting.htm:
+ * html/ntptrace.htm:
+ * html/ntpq.htm:
+ * html/ntpdate.htm:
+ * html/monopt.htm:
+ * html/kernpps.htm:
+ * html/index.htm:
+ * html/hints.htm:
+ * html/gadget.htm:
+ * html/driver7.htm:
+ * html/copyright.htm:
+ * html/config.htm:
+ * html/build.htm:
+ * html/authopt.htm:
+ * html/assoc.htm:
+ * html/accopt.htm:
+ Cleanup from Dave Mills.
+
+2000-12-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k13
+
+ * ntpd/refclock_wwv.c (wwv_start): Call audio_init with DEVICE_AUDIO.
+ * ntpd/refclock_irig.c (irig_start): Call audio_init with DEVICE_AUDIO.
+ * ntpd/refclock_chu.c: Documentation cleanup.
+ (DEVICE_AUDIO): Added.
+ (fd_audio): Added.
+ (chu_start): Separate audio from serial device.
+ (chu_receive): Rewrite - get data from serial or audio device as
+ appropriate.
+ (chu_audio_receive): Renamed (from chu_receive) to allow both
+ audio and serial capability.
+ (chu_serial_receive): Ditto.
+ (chu_decode): Do the Right Thing based on audio/serial data.
+ * ntpd/ntp_refclock.c (refclock_open): Check for failure using <0
+ instead of ==-1.
+ * libntp/audio.c: Header cleanup, and remove
+ HAVE_STRUCT_AUDIO_INFO_* related fields.
+ (audio_init): Func arg is device to attempt to open.
+ * include/audio.h (audio_init): Now takes a char * argument.
+ From Dave Mills.
+
+ * configure.in (ntp_refclock): HAVE_AUDIO added. Remove
+ HAVE_STRUCT_AUDIO_INFO_* stuff; Dave rewrote the audio stuff.
+
+2000-12-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k12
+
+2000-12-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/release.htm:
+ * html/patches.htm:
+ * html/measure.htm:
+ * html/confopt.htm:
+ * html/clockopt.htm:
+ * html/biblio.htm:
+ * html/authopt.htm:
+ * html/assoc.htm:
+ Updates from Dave Mills.
+
+ * include/ntp_crypto.h: Make sure crypto_flags is visible.
+ From Dave Mills.
+
+2000-12-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (process_packet): pleap/pstratum.
+ (peer_xmit): Use CRYPTO_FLAG_AUTO.
+ * ntpd/ntp_crypto.c (make_keylist): Use CRYPTO_FLAG_AUTO. Only
+ sign host name and timestamps if the clock is synched.
+ * include/ntp_crypto.h (CRYPTO_FLAG_AUTO): Added.
+ From: Dave Mills
+
+2000-12-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (transmit): Call clock_select in a few new
+ places. BURST/IBURST cleanup. Don't turn off FLAG_BURST at the
+ EOburst.
+ (receive): Set peer->unreach = 0 before we call process_packet().
+ (process_packet): ditto, before calling poll_update(). Lose some
+ debugging, MODE_BCLIENT/CLIENT cleanup.
+ (poll_update): Bump nextupdate on FLAG_REFCLOCK, not _REFCLOCK or
+ _IBURST.
+ (peer_clear): Don't set IBURST on MDF_BCLNT.
+ From: Dave Mills.
+
+ * ntpdate/ntpdate.c (alarming): Appease ansi2knr.
+
+2000-12-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_control.c (ctl_putpeer): CP_TTL and CP_TTLMAX
+ MDF_ACAST and MDF_MCAST cleanup.
+
+ * ntpd/refclock_wwv.c (wwv_start): ttlmax/ttl cleanup.
+ * ntpd/refclock_usno.c (usno_timeout): ttlmax/ttl cleanup.
+ * ntpd/refclock_parse.c (CLK_REALTYPE): ttlmax/ttl cleanup.
+ * ntpd/refclock_chu.c (chu_start): ttlmax/ttl cleanup.
+ * ntpd/refclock_acts.c (acts_timeout): ttlmax/ttl cleanup.
+ * ntpd/ntp_refclock.c (refclock_newpeer): Don't do the
+ any_interface -> loopback_interface trick.
+ * ntpd/ntp_proto.c (transmit): Broadcast/manycast cleanup.
+ * ntpd/ntp_peer.c: Cleanup.
+ * ntpd/ntp_io.c: Cleanup.
+ * ntpd/ntp_crypto.c (crypto_recv): AUTOKEY based on BCLNT, not MCAST2.
+ * include/ntpd.h: Declare findbcastinter().
+ * include/ntp.h: struct peer's ttlmax is now max ttl/refclock
+ mode. ttl is now ttl for manycast mode.
+ (FLAG_MCAST): Reworked several FLAG_ bits.
+ From Dave Mills.
+
+2000-12-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpq/ntpq.c: CP_TTLMAX support.
+ * ntpd/ntp_proto.c (transmit): MDF_ACAST ttl fixes.
+ * ntpd/ntp_peer.c (resetmanycast): Reset ttl if MDF_ACAST.
+ (peer_config): Save max ttl in ttlmax.
+ * ntpd/ntp_control.c: ttlmax support.
+ * include/ntp_control.h (CP_TTLMAX): Added.
+ * include/ntp.h: Added ttlmax to struct peer.
+ Dave Mills.
+
+2000-12-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (receive): That any_interface is now an
+ rbufp->dstadr.
+ Various other doc and code cleanup.
+ * ntpd/ntp_peer.c (findmanycastpeer): Fixes
+ From Dave Mills
+
+2000-12-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_request.c (do_conf): call peer_config with
+ any_interface, not 0.
+ * ntpd/ntp_proto.c (transmit): Manycast cleanup
+ * ntpd/ntp_peer.c (findmanycastpeer): manycast cleanup
+ * ntpd/ntp_io.c (sendpkt): Only check ttl if we have a ttl
+ (findinterface): Cleanup
+ * ntpd/ntp_control.c: cleanup
+ * include/ntpd.h: Added resetmanycast.
+ * include/ntp_control.h (CP_TTL): disp -> ttl
+ * ntpq/ntpq.c: disp -> ttl
+ From Dave Mills
+
+2000-11-26 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k11
+
+ * ntpd/ntp_proto.c (transmit):
+ * ntpd/ntp_peer.c:
+ * ntpd/ntp_io.c:
+ * ntpd/ntp_control.c (ctl_putpeer):
+ * ntpd/ntp_config.c (getconfig):
+ * include/ntpd.h: mcast/ucast interface cleanup.
+ From: Dave Mills
+
+ * include/ntp_request.h: Put data[] as MAXFILENAME+16. This will
+ fix the conf_peer requests again, but re-break compatibility with
+ old versions of the daemon. Sigh.
+
+ * util/ntp-genkeys.c (cleanlinks): Don't do it if nosymlinks.
+
+2000-11-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_parse.c (rawdcf_init_1): make Linux happier with
+ some modem control stuff.
+ From: Wolfram Pienkoss <wp@bszh.de> (via Frank Kardel)
+
+ * ntpd/refclock_pcf.c (pcf_poll): isdst fix
+ From: Andreas Voegele <andreas.voegele@gmx.de>
+
+2000-10-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k10
+
+ * ntpd/refclock_wwvb.c (wwvb_start): Cosmetic reorder.
+ * ntpd/refclock_atom.c (RANGEGATE): Cleanup. Add ASTAGE.
+ Add ppsparams to struct ppsunit.
+ (atom_start): Init peer->burst to ASTAGE.
+ (atom_shutdown): Multi-handle
+ (atom_pps): Multi-handle
+ (atom_pps): RANGEGATE cleanup
+ (atom_poll): Poll count cleanup. Error check cleanup. Burst cleanup.
+ * ntpd/ntp_refclock.c (refclock_transmit): Lose the pre-burst
+ check poll_update().
+ (refclock_sample): Fix the jitter calc.
+ (refclock_receive): Pass the jitter to the clock_filter().
+
+ * ntpd/ntp_proto.c (clock_update): If we lose sync, reset the poll
+ to NTP_MINDPOLL.
+ (poll_update): Poll wiggles. Make sure peer->nextdate is timely.
+ (clock_select): If we lose sync, reset the poll to NTP_MINDPOLL.
+ * ntpd/ntp_loopfilter.c (local_clock): Show the asocid in debug
+ output. popcorn debug message changes. Clamp the poll interval
+ if the system peer has changed. PPS wiggle changes.
+ From Dave Mills.
+
+2000-10-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_pcf.c (pcf_start):
+ * html/driver35.htm:
+ The radio clock transmits 69 bits with a period of 2.5
+ milliseconds per bit. Thus the driver now sets the default
+ calibration offset to 0.1725 (69 * 2.5 = 172.5).
+ Its now possible to disable the check of the radio clock's
+ synchronisation status bit. Several users requested this option.
+ From: Andreas Voegele <andreas.voegele@gmx.de>
+
+ * html/refclock.htm:
+ * html/rdebug.htm:
+ * html/prefer.htm:
+ * html/pps.htm:
+ * html/ntpdc.htm:
+ * html/miscopt.htm:
+ * html/ldisc.htm:
+ * html/kern.htm:
+ * html/index.htm:
+ * html/exec.htm:
+ * html/driver22.htm:
+ * html/clockopt.htm:
+ Updates from Dave Mills
+
+ * ntpd/ntp_intres.c (request): Sanity check the size of the response
+
+2000-10-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpq/ntpq_ops.c (dopeers): Dave didn't like the patch to show
+ the units on the times...
+ * ntpdc/ntpdc_ops.c (doset): SYS_FLAG_PPS cleanup
+ * ntpd/refclock_wwv.c (wwv_newchan): Update the peer refid if
+ we're talking to a stratum 0 source
+ * ntpd/refclock_trak.c: Needs PPS
+ * ntpd/refclock_oncore.c: Disable for now
+ * ntpd/refclock_mx4200.c: Needs PPSAPI, not PPS
+ Header cleanup. PPS interface cleanup.
+ Process sentences with a switch
+ Cleanup and sanity checks
+ * ntpd/refclock_datum.c: header cleanup, light body cleanup
+ * ntpd/refclock_conf.c: CLOCK_TRAK needs PPS
+ MX4200 needs PPSAPI, not PPS
+ Disable ONCORE for now
+ * ntpd/refclock_bancomm.c: Surgery
+ * ntpd/refclock_atom.c: Cleanup
+ (atom_control): added
+ (atom_ppsapi): added
+ * ntpd/ntp_request.c (setclr_flags): SYS_FLAG_PPS cleanup
+ * ntpd/ntp_refclock.c: stropts.h back in in TTYCLK and
+ HAVE_SYS_CLKDEFS_H
+ Get ntp_syscall if KERNEL_PLL
+ Define cal_enable
+ (refclock_receive): Cleanup
+ (refclock_control): sanity check procptr
+ * ntpd/ntp_proto.c (init_proto): pps_enable
+ (proto_config): Turn on/off PPS discipline
+ * ntpd/ntp_loopfilter.c: pps_enable
+ (local_clock): record_loop_stats() if !ntp_enable
+ (local_clock): Turn off PPS if it's not enabled
+ Other cleanup/fixes
+ * ntpd/ntp_config.c: pps and calibrate keywords. Initialize
+ pps_assert to 0, not 1 (swap assert/clear?)
+ * include/ntpd.h: We have pll_status if KERNEL_PLL
+ Added pps_enable and cal_enable
+ * include/ntp_request.h (SYS_FLAG_PPS): Renamed from
+ SYS_FLAG_AUTHENTICATE
+ * include/ntp.h (PROTO_PPS): Added
+ (PROTO_CAL): Added
+ From: Dave Mills
+
+2000-09-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_refclock.h (stropts.h, sys/clkdefs.h): Harmful and
+ useless file include's turned off.
+ * libntp/iosignal.c (netinet/in.h, sys/sockio.h): Duplicate file
+ include's turned off.
+ * ntpd/ntp_refclock.c (ntp_tty.h): File included.
+ (refclock_open, refclock_ioctl): Use `TTY' from ntp_tty.h.
+ * ntpd/refclock_atom.c: Grab a few headers regardless; if we don't
+ CLOCK_ATOM we provide a stub pps_sample() routine so the WHARTON
+ can be compiled/used.
+ * ntpq/ntpq_ops.c (dopeers, doopeers): Print the units for
+ each column header.
+ Tue Sep 12 16:25:51 2000 Philippe De Muyter <phdm@macqel.be>
+
+ * ntpd/refclock_atom.c (atom_start): Lose "temp", because we now
+ initially either CAPTUREASSERT or CAPTURECLEAR.
+ (atom_pps): pps_info_t is our friend. Update comments to reflect
+ reality. DTRT with pps_info. Do some overflow checks.
+ From: Dave Mills.
+
+2000-09-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Much improved Solaris patch-level check for the
+ FLL bug test.
+ From: Marc.Brett@westgeo.com
+
+2000-09-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/Makefile.am (noinst_HEADERS): Added ntp_tty.h
+ Reported by Dave Mills
+
+2000-09-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntptrace/ntptrace.c:
+ * ntpdate/ntptimeset.c (receive):
+ * ntpdate/ntpdate.c (receive):
+ STRATUM cleanup
+ * ntpd/refclock_atom.c (atom_poll): Autostratum. Lose the leap.
+ * ntpd/ntp_proto.c: sys_prefer
+ (process_packet): stratum cleanup
+ (clock_select): Autostratum the ATOM
+ * ntpd/ntp_loopfilter.c: pps_update/pps_stratum wiggle.
+ * include/ntpd.h: Lose pps_update, gain sys_prefer
+ * include/ntp.h: STRATUM variable cleanup
+ From Dave Mills
+
+2000-09-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c (oncore_get_timestamp): Print debug
+ messages being aware of HAVE_STRUCT_TIMESPEC.
+
+ * ntpd/refclock_atom.c: Have pps_params tag along in the ppsunit
+ structure, where it really belongs.
+ (atom_pps): Use PPS_CAPTURE{ASSERT,CLEAR}
+ From: Dave Mills.
+
+2000-09-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_var_atom_ok): Cleanup ATOM/PPSAPI stuff...
+
+ * scripts/ntp-close: Find "close" ntp servers.
+ From: Neal McBurnett <neal@bcn.boulder.co.us>
+
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_oncore.c: Re-enabled oncore driver for HAVE_PPSAPI
+ case only.
+
+2000-09-12 Philippe De Muyter <phdm@macqel.be>
+
+ * ntpd/refclock_parse.c (we400a_pollinfo): Useless variable removed.
+ [WHARTON slot]: Set NO_POLL, NO_INIT and NO_DATA; fix `fixed format'
+ and `offset' fields.
+
+ * include/ntp_tty.h: New file
+ * libntp/icom.c: Use it.
+
+ * ntp_update (UPDATE_OPTIONS): Use -d, too. Fix Pass 1 comment.
+
+2000-09-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c: shmem_fname added. oncore_init_shmem()
+ updated.
+ (oncore_start): Comment cleanup
+ (oncore_read_config): Move call to oncore_shmem_init()
+ (oncore_init_shmem): Prototype change
+ (oncore_init_shmem): Don't exit on errors
+ (oncore_msg_any): timespec/timeval cleanup
+ (oncore_msg_Cj_id): shmem_fname changes
+ (oncore_msg_BaEaHa): saw_At bugfix
+ (oncore_get_timestamp): Added current_mode/current_params. Commented.
+ Added time_pps_getcap() calls.
+ From: Reg Clemens <reg@dwf.com>
+
+ * ntpd/ntp_io.c (input_handler): Better recvfrom() error message
+ From: Dean Gibson <timekeeper@tcp-udp.net>
+
+ * ntpdc/ntpdc.c (passwd): Get them working again.
+ From: Benjamin Greenwald <beng@lcs.mit.edu>
+
+2000-09-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_atom.c:
+ (atom_start):
+ * ntpd/ntp_refclock.c: Comment cleanup. PPS/PPSAPI cleanup
+ (refclock_open): PPS/PPSAPI cleanup
+ From: Dave Mills
+
+ * ntpd/refclock_oncore.c:
+ * ntpd/refclock_mx4200.c:
+ HAVE_TIMESPEC -> HAVE_STRUCT_TIMESPEC
+
+ * configure.in: ATOM requires struct timespec, not PPSAPI. Clean
+ up dependencies accordingly.
+
+2000-09-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_var_atom_ok): Improve ATOM configure message
+ PARSE requires ATOM.
+
+ * ntpd/ntpd.c (set_process_priority): Clean up debug messages.
+
+2000-09-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: ac_cv_atom_ok, depends on HAVE_PPSAPI.
+ I notice the PARSE clocks require ATOM. Could be interesting...
+
+2000-09-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Makefile.in (distdir): Seems to be a bug in an automake library
+ somewhere...
+
+2000-09-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_loopfilter.c (loop_config): V3 API needs MOD_BITS when
+ initializing ntv.modes. Initialize ntv.{maxerror,esterror,status}
+ earlier. Clean up KERNEL_PLL code.
+
+2000-09-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpq/ntpq.c: report offset as "offset", not "phase". Lose
+ compliance.
+ * ntpd/refclock_local.c (local_poll): variance -> jitter
+ * ntpd/refclock_chu.c (chu_major): Lose variance.
+ * ntpd/ntp_util.c (hourly_stats): sys_error -> sys_jitter
+ (record_loop_stats): ditto
+ * ntpd/ntp_request.c (peer_info): variance -> jitter
+ * ntpd/ntp_refclock.c (refclock_sample): variance -> jitter
+ (refclock_receive): variance -> jitter
+ * ntpd/ntp_proto.c (process_packet): variance -> jitter
+ (clock_filter): variance -> jitter
+ (clock_select): variance -> jitter
+ (root_distance): variance -> jitter
+ * ntpd/ntp_peer.c (newpeer): variance -> jitter
+ * ntpd/ntp_loopfilter.c: Cleanup pll_nano selection bogon.
+ Centralize the kernel API data.
+ (local_clock): Lose sys_error.
+ (loop_config): Code cleanup.
+ * ntpd/ntp_control.c: Call offset "offset" and not "phase". Lose
+ CS_COMPLIANCE. Deal with variance/jitter rename.
+ * include/ntp_refclock.h: Rename variance to jitter in struct
+ refclockproc.
+ * include/ntp_control.h (CS_COMPLIANCE): Lose it.
+ * include/ntp.h: Rename variance to jitter in struct peer.
+ From: Dave Mills
+
+2000-09-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_atom.c: Use the new ppsunit. Cleanup and improve
+ documentation.
+ * ntpd/ntp_refclock.c (refclock_sample): Don't accumulate
+ variance.
+ From Dave Mills
+
+2000-08-31 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver22.htm: Update the docs.
+ * ntpd/refclock_atom.c (atom_start): Open the device if it hasn't
+ been opened already.
+ (pps_sample): Make it more visible.
+ From Dave Mills.
+
+ * configure.in: 4.0.99k8
+
+ Revert to the older automake.
+
+ * configure.in: The PPSAPI headers use "inline", so require a STDC
+ compiler.
+
+ * ntpd/refclock_atom.c (atom_shutdown): Typo
+ From Dave Mills
+
+ * configure.in: Convert to autoconf-2.49
+
+ * ntpd/refclock_atom.c: Header cleanup Comment cleanup. Lose the
+ TTYCLK stuff. Convert to PPSAPI.
+ * ntpd/ntp_refclock.c (refclock_newpeer): Move refclock_unpeer().
+ From: Dave Mills
+
+2000-08-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure: Fix the autoconf problem...
+
+2000-08-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 99k7
+
+ * util/ntptime.c (main): Report TAI stuff
+ * ntpq/ntpq.c: CS_COMPLIANCE/CS_JITTER cleanup
+ * ntpd/ntp_loopfilter.c (local_clock): sys_error/sys_jitter cleanup.
+ kernel PPL cleanup.
+ * ntpd/ntp_crypto.c: Check NTP_API if we're doing KERNEL_PLL so we
+ can get the TAI stuff.
+ * ntpd/ntp_control.c: CS_COMPLIANCE now reports "error" instead of
+ "jitter". CS_JITTER now reports jitter.
+ * include/ntpd.h: Added sys_jitter
+ * include/ntp_control.h (CS_JITTER): Added
+ From: Dave Mills
+
+ * ntpd/cmd_args.c (getCmdOpts): Crack -N at pre-scan, as we do the
+ priority wiggle before the final scan.
+ From: Tom Smith <smith@cag.lkg.dec.com>
+ We might do better to move the priority wiggle to after the final
+ scan. Especially if we want to permit command-line options to
+ have decent control over the priority. When we rewrite the config
+ file stuff we might go to a multi-scan to solve some of these
+ problems.
+
+2000-08-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: '99k6, and manually fix configure.
+
+ * include/ntp_request.h (NTP_MAXHOSTNAME): 144 -> 32
+
+2000-08-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (main): Don't call fclose if stream is NULL.
+
+2000-08-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver35.htm:
+ * ntpd/refclock_pcf.c: Updates and improvements
+ From: Andreas Voegele <andreas.voegele@gmx.de>
+
+ * configure.in (ac_cv_struct_ntptimeval): Lose the TAI check - we
+ don't need it since we can check NTP_API. Re-hack the generated
+ configure script.
+
+ * configure: Manual hack to the ntptimeval.time.tv_nsec stuff
+ because we're running an old autoconf.
+
+2000-08-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntptime.c: Use: HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC, it's
+ the standard name.
+
+ * configure.in: Look for struct ntptimeval.tai in sys/timex.h
+ Cleanup struct tptimeval member tests.
+
+ * util/ntp-genkeys.c: New command-line arguments
+
+2000-08-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (main): More small steps...
+
+2000-08-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_crypto.c (crypto_rsa): Now that we're using
+ NTP_KEYSDIR, make sure there is a '/ between the dir and the file.
+
+ * util/ntp-genkeys.c (main): More small steps...
+
+2000-08-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (main): Another small step...
+
+ * configure.in: 99k5
+
+ * include/ntp_request.h: Make data[] member of req_pkt 32 again.
+ Bump the version number...
+
+ * ntpd/ntp_loopfilter.c (local_clock): Change 0. to 0 in a couple
+ of places.
+ From Dave Mills
+
+2000-08-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (main): Minimal progress...
+
+2000-08-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/check_y2k.c: Make debug definition match ntpd.h's declaration
+
+ * ntpd/Makefile.am (check-local): Use test in favor of [
+
+2000-08-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (NTP_KEYSDIR): Typo
+
+2000-08-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ElectricFence/Makefile.am (check-local): use test instead of [
+
+ * configure.in: AC_REPLACE_FUNCS(strdup)
+ * libntp/strdup.c (strdup): Added.
+ * libntp/Makefile.am (EXTRA_libntp_a_SOURCES): Added strdup.c
+
+ * util/Makefile.am (ntp_genkeys_DEPENDENCIES): Use $U on .o files
+ (ntp_genkeys_LDADD): ditto.
+
+ * ntpd/ntp_crypto.c: Use NTP_KEYSDIR
+
+ * util/ntp-genkeys.c (snifflink): Ignore ENOENT, too.
+
+ * ntpd/ntp_proto.c (peer_xmit): Crypto cleanup
+ * ntpd/ntp_crypto.c: Cleanup
+ * ntpd/ntp_control.c: Join the club
+ * ntpd/ntp_config.c: Call crypto_config() instead; we got rid of
+ crypto_flags.
+ * include/ntp_crypto.h (CRYPTO_FLAG_ENAB): New crypto flags, rework
+ * include/ntp_control.h (CS_FLAGS): Wiggle in.
+ * include/ntp.h: Added crypto peer status to struct peer
+ From Dave Mills
+
+2000-08-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c: Initialize path_keysdir to NTP_KEYSDIR.
+
+ * configure.in (NTP_KEYSDIR): Added
+ * acinclude.m4: Added AC_DEFINE_DIR macro
+
+ * util/ntp-genkeys.c (main): Sanity checks on the file paths.
+
+2000-08-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (crypto_config): Only #ifdef PUBKEY
+ (PATH_MAX): Try harder...
+
+2000-08-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (main): Use snifflink()
+ (snifflink): Implement...
+
+ * configure.in: Check for readlink()
+
+2000-07-31 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (main): Use strdup on the tokens returned
+ from ntp_config...
+ (crypto_config): Fix a typo...
+ (crypto_config): Even more...
+ (usage): Flesh it out.
+
+ * include/ntp_config.h:
+ * ntpd/ntp_config.c: Move a whack of #defines to ntp_config.h so
+ ntp-genkeys.c can see them, too.
+
+ * util/ntp-genkeys.c: Add stubs to work with ../ntpd/ntp_config.o,
+ start hooking things up.
+ (main): debugging
+ (crypto_config): better implementation
+
+
+ * ntpd/ntp_config.c (getconfig):
+ * ntpd/ntpd.c: Initialize "debug" here, not in ntp_config.c
+
+ * util/Makefile.am (ntp_genkeys_LDADD): Added ../ntpd/ntp_config.o
+ * util/Makefile.am (ntp_genkeys_DEPENDENCIES): Added.
+
+2000-07-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99k4
+ * util/ntp-genkeys.c: Start hacking for new functionality.
+ * include/Makefile.am (noinst_HEADERS): Added ntp_cmdargs.h and
+ ntp_config.h .
+ * ntpd/ntp_config.c: Grab ntp_cmdargs.h. Make some new globals
+ (ugh), move ntpd-specific variables and code to cmd_args.c .
+ * ntpd/cmd_args.c: Move command argument processing functions from
+ ntp_config.c to this file.
+ * ntpd/Makefile.am (ntpd_SOURCES): Added cmd_args.c
+ * include/ntpd.h: Move getstartup() to ntp_cmdargs.h
+ * include/ntp_cmdargs.h: New file
+ Begin the hacking fest to make it easier for ntp-genkeys to use
+ ntpd's config processing code. I really hope this is the lesser
+ of the evils...
+
+2000-07-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp-genkeys.c (usage): Added.
+
+ * ntpd/ntp_crypto.c: Cleanup
+ * ntpd/ntp_proto.c (transmit): Add some parens.
+ (peer_xmit): Add ntohl when grabbing sndauto.seq for broadcast.
+ * ntpd/ntp_peer.c (findpeer): Cleanup
+ * ntpd/ntp_loopfilter.c (local_clock): Typo
+ From Dave Mills
+
+ * include/ntp_config.h: Created
+
+ * util/ntp-genkeys.c: Always build, but realize we may not have
+ RSAREF. Compile parts appropriately.
+
+ * util/Makefile.am (bin_PROGRAMS): Always make ntp-genkeys
+ (ntp-genkeys_LDADD): Use $LIBRSAREF instead of the "real path"
+ * configure.in: Lose MAKE_NTP_GENKEYS
+
+ * configure.in:
+ * util/ntp-genkeys.c:
+ * util/Makefile.am:
+ Renamed ntp_genkeys to ntp-genkeys.
+
+2000-07-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpdate/ntpdate.c (ntpdatemain): Cleanup error message.
+
+ * ntpdate/ntpdate.c (ntpdatemain): Add missing authtrust() call
+ From: Jason Heiss <jheiss@cruzeiro.ugcs.caltech.edu>
+
+ * ntpd/refclock_ulink.c (ulink_receive):
+ * ntpd/ntp_crypto.c:
+ * libntp/authparity.c:
+ Lint/noise cleanup
+ From: Marc Brett <mbrett@rgs0.london.waii.com>
+
+ * ntpd/ntp_proto.c: Specifically track manycastserver and
+ survivors
+ From: Dave Mills
+
+2000-07-26 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * ntpd/ntpd.c: remove WINNT priority adjustment to the ports/winnt area
+ where it does not clutter up the main distribution.
+
+2000-07-24 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (receive): dstadr_sin needs higher visibility
+ From: Dave Mills
+
+ * flock-build: Added baldwin
+
+ * ntpd/ntp_request.c:
+ * ntpd/ntp_proto.c:
+ * ntpd/ntp_peer.c:
+ * ntpd/ntp_io.c:
+ * ntpd/ntp_intres.c:
+ * ntpd/ntp_crypto.c (make_keylist):
+ * ntpd/ntp_control.c:
+ * ntpd/ntp_config.c (CONF_MOD_IBURST, save_resolve):
+ * include/ntpd.h (findpeerbyassoc, newpeer, peer_config, *_interface):
+ * include/ntp_request.h (CONF_FLAG_IBURST):
+ * include/ntp_crypto.h (crypto_xmit, make_keylist):
+ * include/ntp.h (FLAG_IBURST):
+ * html/release.htm:
+ * html/confopt.htm:
+ * html/assoc.htm:
+ Add iburst option, fix broadcast/multicast and some types.
+ From: Dave Mills
+
+2000-07-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/Makefile.am (bin_SCRIPTS): Install ntp-wait
+
+ * configure.in: 4.0.99k
+
+2000-07-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (peer_xmit): PUBKEY cleanup
+
+2000-07-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99j5
+
+ * html/ntpd.htm (HREF): Document other missing command-line options
+
+ * html/ntpd.htm (HREF): Document
+ * html/confopt.htm (href): Undocument
+ * ntpd/ntp_config.c (getconfig): -N high for high-priority.
+ Lose the ntp.conf way of setting priority.
+
+ * ntpd/ntp_crypto.c: PUBKEY/AUTOKEY cleanup
+ From Dave Mills
+
+2000-07-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/confopt.htm (href): Document it.
+ * ntpd/ntp_config.c (getconfig): CONFIG_PRIORITY support
+ * ntpd/ntpd.c (set_process_priority): Use it.
+
+ * ntpd/ntp_crypto.c: Crypto key stuff
+ * ntpd/ntp_proto.c: pubkey -> pubkey.ptr
+ * ntpd/ntp_control.c (ctl_putpeer): fstamp -> pubkey.fstamp
+ * ntpd/ntp_peer.c:
+ * include/ntpd.h:
+ * include/ntp_types.h:
+ * include/ntp_request.h:
+ * include/ntp_crypto.h:
+ * include/ntp_control.h:
+ * include/ntp.h: Type cleanup
+ From: Dave Mills
+
+2000-07-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ElectricFence/Makefile.am (check-local): Don't run the tests if
+ we didn't build the programs...
+ (check-local): Same, but watch the return codes...
+
+ * ElectricFence/page.c: #include config.h if it's there.
+ Properly handle the sys_errlist declaration.
+
+ * html/ntpq.htm:
+ * html/index.htm:
+ * html/debug.htm:
+ * html/authopt.htm:
+ Reality check.
+ From Dave Mills
+
+2000-07-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Makefile.am (SUBDIRS): Added ElectricFence
+ * configure.in (AC_CONFIG_FILES): Added ElectricFence support
+ * ElectricFence: Imporpted.
+
+2000-07-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/ntp_genkeys.c (main): Cleanup
+ * ntpd/refclock_wwv.c (wwv_qrz): sqrt -> SQRT
+ * ntpd/refclock_chu.c (chu_rf): sqrt -> SQRT
+ * ntpd/ntpd.c (set_process_priority): Disable high-priority for now.
+ PUBKEY cleanup.
+ * ntpd/ntp_timer.c: sys_revoketime cleanup.
+ * ntpd/ntp_proto.c (receive): PUBKEY cleanup. Comment and code
+ cleanup.
+ (process_packet): Comment and code (PUBKEY) cleanup.
+ (peer_xmit): Comment and code cleanup.
+ (fast_xmit): Comment and code cleanup.
+ * ntpd/ntp_peer.c (expire_all): revoketime cleanup. PUBKEY cleanup.
+ * ntpd/ntp_crypto.c: Comment reorg. DH parameters are now
+ file-static instead of local to subroutines.
+ (make_keylist): peer->pcookie.key cleanup/fix
+ (crypto_recv): Subroutine documentation cleanup, other cleanup
+ (crypto_xmit): Cleanup/document.
+ (crypto_setup): Cleanup/document.
+ (crypto_agree): Cleanup/document.
+ (crypto_rsa): now static
+ (crypto_dh): now static. Comment cleanup. Code cleanup.
+ (crypto_tai): now static. Code and comment cleanup.
+ (crypto_config): Deal with CRYPTO_CONF_LEAP.
+ * ntpd/ntp_control.c (CS_DHPARAMS): Rename corresponding token to
+ "params". Remove CS_TAI from def_sys_var[].
+ (ctl_putsys): CS_HOST, CS_DHPARAMSm CS_REVTIME, and CS_LEAPTIME
+ bugfix. CS_TAI cleanup.
+ * ntpd/ntp_config.c (CONF_CRYPTO_LEAP): Added
+ (getconfig): Added CONF_CRYPTO_LEAP support.
+ * include/ntp_syslog.h: Lose GIZMO stuff.
+ * include/ntp_crypto.h (CRYPTO_CONF_LEAP): Added
+ * include/ntp.h: struct autokey, cookie,value, and pkt changes for
+ signature field. Update the inline docs on pkt's exten field.
+ From: Dave Mills
+
+
+2000-07-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_util.c (stats_config): If we read a bogus old_drift,
+ use 0 instead of failing.
+
+2000-07-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * README.cvs: Cleanup.
+
+ * ntpd/refclock_datum.c (datum_pts_poll): index -> unit_index
+ * ntpd/ntp_resolver.c (findhostaddr): const cleanup
+ * libntp/recvbuff.c:
+ * libntp/msyslog.c:
+ * libntp/emalloc.c:
+ * libntp/authreadkeys.c:
+ Fix header order.
+ From: Simon Burge <simonb@netbsd.org>
+
+ * ntpd/ntp_util.c (stats_config): Use HAVE_FINITE and HAVE_ISFINITE
+ * configure.in (ac_cv_struct_ntptimeval_timespec): isfinite()
+ checks for HP-UX11.
+ From: Albert Chin-A-Young <china@thewrittenword.com>
+
+2000-07-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * flock-build (LIST): Lose malarky, update some machine/OS descriptions
+
+ * configure.in: 4.0.99j4
+
+ * ntpq/ntpq.c: Lose PUBKEY stuff - older ntpq's will complain when
+ they see the info in a packet.
+ * ntpd/ntp_proto.c (peer_xmit): TAI changes.
+ * ntpd/ntp_crypto.c: Fix host/network byteorder stuff. Follow
+ global->struct changes. TAI changes. Bugfixes.
+ * ntpd/ntp_control.c: Follow field reorder/rename.
+ * include/ntp_crypto.h: Move crypto stuff from separate globals
+ into structs.
+ * include/ntp_control.h (CS_HOST): Reorder/rename some fields
+ From: Dave Mills
+
+2000-06-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_peer.c (unpeer): Moved keystr cleanup inside ifdef PUBKEY
+
+ * configure.in: 4.0.99j3
+
+ * html/release.htm:
+ * html/ntpq.htm:
+ * html/authopt.htm:
+ Updates from Dave Mills
+
+ * ntpd/ntp_request.c (dns_a): Don't call crypto_public for now...
+ * ntpd/ntp_proto.c (receive): Follow the TEST wiggles
+ (peer_xmit): TAI support
+ * ntpd/ntp_crypto.c: TAI support
+ * ntpd/ntp_control.c: CS_VERSION and CS_TAI support
+ * include/ntp_crypto.h (CRYPTO_FLAG_TAI): Added.
+ * include/ntp_control.h (CS_VERSION): Added.
+ * include/ntp.h (TEST4,TEST5,TEST8,TEST9): Wiggle.
+ From: Dave Mills
+
+ * ntpd/Makefile.am (ntpd_SOURCES): Lose refclock_ulink331.c
+ because the new refclock_ulink.c handles it.
+
+2000-06-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c (getconfig): Sanity check the right variable
+ From: Dave Mills.
+
+2000-06-25 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99j2
+
+ * ntpd/ntp_proto.c:
+ * ntpd/ntp_peer.c:
+ * ntpd/ntp_crypto.c:
+ * include/ntp_crypto.h:
+ * include/ntp.h:
+ AUTOKEY/PUBKEY/DH/crypto changes
+ From: Dave Mills
+
+2000-06-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver34.htm:
+ * ntpd/refclock_ulink.c:
+ * ntpd/refclock_ulink331.c: (removed)
+ Updated for 320/330 series refclocks
+ From: joseph lang <tcnojl1@earthlink.net>
+
+ * ntpd/refclock_oncore.c: Patches/improvements
+ * html/driver30.htm: New release
+ From: Reg Clemens <reg@orion.dwf.com>
+
+2000-06-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99j1
+
+ * ntpdc/ntpdc.c (getcmds):
+ * configure.in:
+ Readline support.
+ From: Aaron Sherman <ajs@narn.ajs.com>
+
+ * ntpd/refclock_ulink331.c: Added.
+ Sent in by Doug Grosso <dgrosso@mint.net>
+ * ntpd/Makefile.am (ntpd_SOURCES): Added refclock_ulink331.c
+
+ * libntp/snprintf.c: Added stdio.h
+ From: Marc Brett <mbrett@rgs0.london.waii.com>
+
+ * include/ntp.h: struct autokey's siglen is u_int32. So is the
+ siglen in struct cookie. So is siglen and value length in struct
+ value. Add fstamp to struct peer. Resize the exten AUTOKEY field
+ in struct pkt.
+ * include/ntp_crypto.h: crypto_enable -> crypto_flags and a
+ variety of other cleanups.
+ * ntpd/ntp_config.c: crypto_enable -> crypto_flags, and some
+ key/fudge cleanup.
+ * ntpd/ntp_control.c: Much cleanup.
+ * ntpd/ntp_crypto.c: Many changes that Harlan is too tired to
+ properly document.
+ * ntpd/ntp_peer.c: crypto_enable -> crypto_flags
+ (peer_config): Hold off on crypto_public() until some resolver
+ issue is fixed.
+ * ntpd/ntp_proto.c (receive): Disable the reverse DNS lookup for now.
+ (process_packet): Don't record_raw_stats() for now.
+ crypto_enable was renamed to crypto_flags.
+ (peer_xmit): In MODE_ACTIVE or MODE_PASSIVE, only call
+ crypto_xmit() if the peer->cmmd is not CRYPTO_AUTO. Reset
+ peer->cmmd to 0 when we're thru.
+ Don't reset peer->cmmd to 0 until the end of MODE_CLIENT.
+ * ntpd/ntpd.c: Lose the call to crypto_init(). Instead, call
+ crypto_setup() later on if we have crypto_flags.
+ * util/ntp_genkeys.c: Lose GENLEN; use PRIMELEN/2 .
+ From Dave Mills.
+
+ * ntpd/ntp_crypto.c (crypto_rsa):
+ (crypto_dh):
+ Do some debug logging if readlink() fails with something other
+ than EINVAL (file isn't a symlink).
+
+2000-06-04 James R. Van Zandt <jrv@vanzandt.mv.com>
+
+ * html/miscopt.htm (trap): punctuation
+
+ * html/ntpd.htm (-g): typo
+
+ * html/miscopt.htm (logconfig): List the "clock" event class.
+ "allprefix" should be two words.
+
+2000-05-31 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_timer.c: Protect <unistd.h>
+
+2000-05-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/Makefile.am: Document what we expect from -lm
+
+2000-05-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99j
+
+2000-05-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/ntptime.htm: More fixes
+ From: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
+
+2000-05-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * build (KEYSUF):
+ * flock-build:
+ * configure.in: Lose the "md5" options from the --with-crypto
+ check; Dave hates it.
+
+ * ntpd/ntp_util.c (stats_config):
+ * ntpd/ntp_loopfilter.c (loop_config):
+ * libntp/systime.c (adj_systime):
+ * include/ntp_proto.h (NTP_MAXFREQ):
+ Renamed MAX_FREQ to NTP_MAXFREQ
+
+ * ntpd/ntpd.c (ntpdmain):
+ * ntpd/ntp_proto.c (receive):
+ (poll_update):
+ * ntpd/ntp_intres.c (addentry):
+ * ntpd/ntp_config.c (getconfig):
+ Lint cleanup
+ From: Marc Brett <mbrett@rgs0.london.waii.com>
+
+ * include/ntp_stdlib.h:
+ * libntp/systime.c (adj_systime):
+ * ntpd/ntp_loopfilter.c (loop_config):
+ * ntpd/ntp_util.c (stats_config):
+ * ports/winnt/ntpd/nt_clockstuff.c (adj_systime):
+ MAXFREQ -> MAX_FREQ
+ * include/ntp_proto.h: Define MAX_FREQ
+
+2000-05-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_stdlib.h:
+ * libntp/systime.c (adj_systime):
+ * ntpd/ntp_loopfilter.c (loop_config):
+ * ntpd/ntp_util.c (stats_config):
+ * ports/winnt/ntpd/nt_clockstuff.c (adj_systime):
+ sys_maxfreq -> MAXFREQ
+ Per Dave Mills.
+
+2000-05-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * acinclude.m4: Typo...
+
+2000-05-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/gpstolfp.c (GPSORIGIN): Try new ULONG_CONST macro
+
+ * ntpdate/ntptimeset.c:
+ * ntpdate/ntpdate.h:
+ * ntpd/refclock_oncore.c (oncore_msg_En):
+ * ntpd/ntp_util.c (stats_config):
+ * ntpd/ntp_request.c:
+ * ntpd/ntp_intres.c (findhostaddr):
+ * ntpd/ntp_config.c (getconfig):
+ * libntp/systime.c (adj_systime):
+ * libntp/lib_strbuf.c:
+ * libntp/authparity.c:
+ * libntp/audio.c:
+ Header/lint cleanup
+ From/reported by: Simon Burge <simonb@netbsd.org>
+
+ * ntpd/ntp_resolver.c (findhostaddr): Compiler noise cleanup
+
+ * ntpd/ntp_intres.c: Compiler noise cleanup
+
+ * html/ntptime.htm: Document reality check
+ From: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
+
+2000-05-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_intres.c (ntp_intres): Quiet some debug messages
+ Reported by: Brian Bergstrand <brianb@mac.com>
+
+2000-05-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/mkver.in (ConfStr): Use -r if we're using RSAREF,
+ otherwise use -a if we're using autokey, otherwise use no extra
+ suffix.
+
+2000-05-11 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * ports/winnt/include/config.h: New defines to support AUTOKEY
+ * ports/winnt/include/unistd.h: Added another dummy placeholder.h
+ * ports/winnt/ntpd/ntpd.dsp: Added ntp_crypt.c to makefile
+ * ports/winnt/ntpd/ntpd.c: service_main needs a local hostname[]
+ * html/hints/winnt.htm: Add remark about 4.0.99i not compiling.
+ These changes got WINNT running again. No idea if the keys stuff
+ works however.
+
+2000-05-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i9
+
+ * ntpd/ntp_crypto.c: tstamp and autokey cleanup
+ From: Dave Mills
+
+ * ntpd/ntp_proto.c (clock_update): Only call expire_all() if
+ AUTOKEY
+ From many folks, including Reg Clemens <reg@dwf.com>
+
+2000-05-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i8
+
+ * flock-build: Use new --with-crypto choices
+ * build (KEYSUF): Deal with new --with-crypto
+ * configure.in: --with-crypto={md5,autokey,rsaref};
+ lose --enable-autokey
+
+2000-05-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * build (KEYSUF): Catch --disable-autokey first.
+
+2000-05-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * flock-build: If we don't use autokey, don't use rsaref either.
+
+ * configure.in: 4.0.99i7
+
+ * build (KEYSUF):
+ * flock-build:
+ It's --disable-autokey now
+
+ * configure.in: MD5 is not optional (but AUTOKEY is)
+ * include/ntp_stdlib.h:
+ * libntp/a_md5encrypt.c:
+ * libntp/authkeys.c:
+ (authhavekey):
+ (MD5auth_setkey):
+ (auth_delkeys):
+ (authencrypt):
+ (authdecrypt):
+ * libntp/authreadkeys.c:
+ (authreadkeys):
+ * ntpd/ntp_proto.c (init_proto):
+ * libntp/authusekey.c:
+ MD5 is required.
+
+2000-05-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i6
+
+ * ntpd/ntp_proto.c (transmit): Fix up the UNREACH code.
+ (receive): Lose some debug code.
+ (clock_update): expire_all() if LEAP_NOTINSYNC
+ crypto_xmit() a CRYPTO_AUTO if !FLAG_AUTOKEY instead of recauto.tstamp
+ crypto_xmit() a CRYPTO_PRIV (not CRYPTO_AUTO) based on pcookie.tstamp
+ crypto_xmit() a CRYPTO_AUTO (not CRYPTO_PRIV) based on FLAG_MCAST2
+ and !FLAG_AUTOKEY
+ * ntpd/ntp_crypto.c (crypto_recv): Clean up debug output.
+ Don't AUTOKEY if FLAG_MCAST2
+ From: Dave Mills
+
+ * flock-build: Also make obe withouyt md5 (no AUTOKEY)
+ * build (BDIR): Handle -noautokey build directory suffix
+ * configure.in: Prepare for AUTOKEY in mkver.in
+ * scripts/mkver.in (ConfStr): Indicate in the version string if
+ we're not using AUTOKEY.
+
+2000-05-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/ntp-wait.in: Fun things with backspaces
+
+ * configure.in: 4.0.99i5
+
+ * ntptrace/ntptrace.c: Protect sys/ioctl.h; grab config.h
+
+ * ntpd/ntp_proto.c (transmit): AUTOKEY and tstamp fixes.
+ (clock_update): Check oleap against LEAP_NOTINSYNC
+ (peer_clear): Free pubkey when we're done
+ Check peer's keynumber against the seq in MODE_BROADCAST.
+ Reorder tstamp changes.
+ * ntpd/ntp_crypto.c (crypto_recv): Check the packet if we get a
+ CRYPTO_RESP and reorder the update of tstamp.
+ (crypto_recv): Don't expire the peer until we're thru with it.
+ * include/ntp.h: AUTOKEY and pkeyid changes
+ From Dave Mills
+
+ * ntpdate/ntpdate.c: Protect sys/ioctl.h
+
+2000-05-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i4
+
+ * include/ntp.h:
+ * include/ntp_crypto.h:
+ * include/ntpd.h:
+ * ntpd/ntp_crypto.c:
+ * ntpd/ntp_proto.c:
+ * ntpd/ntpd.c:
+ * util/ntp_genkeys.c:
+ Dave Mills closed some potential vulnerabilities in the key protocol.
+
+2000-04-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i3
+
+ * ntpd/ntp_proto.c: Just check tstamp, forget about sndauto.seq
+ * ntpd/ntp_crypto.c (crypto_recv): Lose inappropriate ntohl()
+ conversion on tstamp.
+ AUTOKEY if tstamp>0, not !=
+ Stash tstamp before we check pcookie.key (several places)
+ * ntpd/ntp_control.c (ctl_putpeer): In CP_INITSEQ, check
+ recauto.key, not keylist.
+ From: Dave Mills
+
+2000-04-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i2
+
+ * ntpq/ntpq.c: PUBKEY stuff
+ * ntpd/ntp_proto.c (clock_select): nreach, and better survivor pick.
+ * ntpd/ntp_peer.c (newpeer): Better nextdate choice.
+ * ntpd/ntp_control.c (ctl_putsys): Buglet in CS_HOSTNAM code.
+ From Dave Mills.
+
+2000-04-24 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * build (IAM): Show hostname if we trip a buildkey check.
+
+2000-04-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * build: deal with optional 1st argument (SIG), which must match
+ the contents of .buildkey
+
+ * flock-build: Generalize, implement SIG and .buildkey, and drive
+ list from LIST, which the user can override.
+
+2000-04-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i1
+ Dave updated some docs, implemented the kpoll variable, and
+ wiggled a host/network byte order thing in the crypto key code.
+
+2000-04-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwvb.c (wwvb_receive): Grab any character (instead
+ of just a space) before the DSTchar.
+ From: Dave Mills
+
+2000-04-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99i
+
+ Dave made some documentation updates.
+
+2000-04-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * flock-build: Add malarky. By default, --enable-parse-clocks.
+ Start 2 builds, one with and the other without rsaref.
+
+ * configure.in: 4.0.99h6
+ Dave improved the crypto stuff some more.
+
+2000-04-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_acts.c (acts_receive): Do a better job with year
+ conversions and leap-year checks. The PTB stuff caught this.
+ Reported by: Daniel.Aeby@eam.admin.ch
+
+2000-04-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_atom.c (atom_pps): Bugfix
+ From: Philippe Charnier <charnier@xp11.frmug.org>
+
+2000-03-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libparse/clk_wharton.c (cvt_wharton_400a): Do not return
+ CVT_NONE when receiving the early warning bit set.
+ From: Philippe De Muyter <phdm@macqel.be>
+
+ * configure.in: 4.0.99h5
+ Dave made more changes to the auth key stuff.
+
+2000-03-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99h4
+ Dave made a bunch of changes/fixes to the auth key stuff.
+
+2000-03-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_resolver.c: Typos.
+
+2000-03-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99h3
+
+ * ntpd/ntp_intres.c: Use LOG_INFO instead of LOG_DEBUG.
+ * ntpd/ntp_resolver.c: Ditto.
+
+2000-03-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/Makefile.am (ntp_genkeys_LDADD): Might need snprintf (-lntp)
+
+ * librsaref/Makefile.am (stamp-rsaref): nodist_HEADERS are not
+ supoprted yet. Hack around it.
+
+ * ntpd/ntp_resolver.c (findhostaddr): hstrerror isn't always available.
+
+ * configure.in: Look for hstrerror.
+
+ * util/ntp_genkeys.c (main): Use snprintf, not sprintf.
+
+ * ntpd/ntp_crypto.c: Use gethostname, not uname
+ * util/ntp_genkeys.c: Ditto
+ From: Dave Mills
+
+2000-03-19 Harlan Stenn <harlan@pfcs.com>
+
+ * ntpd/ntp_proto.c (receive): Rename ntp_res_send() to
+ ntp_res_name() and adjust the number of arguments.
+ * ntpd/ntp_resolver.c (ntp_res_name): Ditto
+ * include/ntpd.h: Ditto
+
+ * ntpd/ntp_resolver.c: Add de_done to the dns_entry structure.
+
+2000-03-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99h2
+
+ * libparse/Makefile.am (info_trimble.c): Use $(srcdir)/foo.sed
+ instead of foo.sed .
+
+ * librsaref/Makefile.am (stamp-rsaref): Copy each file to the build
+ directory, not to the source directory. This sucks; it wastes
+ space (but it's more portable).
+
+ * configure.in (ac_busted_vpath_in_make): Add FreeBSD. I bet all
+ systems that use pmake will need this.
+ (ac_busted_vpath_in_make): Remove FreeBSD - I found a workaround.
+
+ * Makefile.am: General cleanup
+
+ * configure.in: 4.0.99h1
+
+ * ntpd/ntp_resolver.c: Lose unneeded header.
+
+2000-03-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/snprintf.c: #include <config.h>
+
+ * libntp/Makefile.am (EXTRA_libntp_a_SOURCES): Use it correctly...
+
+2000-03-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/Makefile.am (EXTRA_DIST): Added snprintf.c
+
+ * configure.in: Look for (and provide if it's missing) snprintf()
+
+ * ntpd/ntp_request.c (dns_a): Call crypto_public with the resolved
+ name and the peer pointer.
+ (dns_a): crypto_public() is only available if PUBKEY is #defined.
+
+ * ntpd/ntp_crypto.c (crypto_public): sprintf is Evil. Use snprintf.
+ (crypto_setup): Ditto
+ (crypto_read): Ditto
+
+ * ntpd/ntp_resolver.c (ntp_res_send): Lose some debugging noise.
+
+ * ntpd/ntp_config.c (getconfig): Lose testing code.
+
+ * ntpd/ntp_request.c (dns_a): Fix buglet in hostname length check.
+
+2000-03-16 Harlan Stenn <harlan@pfcs.com>
+
+ * ntpd/ntp_request.c (dns_a): Start cracking the returned information.
+
+2000-03-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_resolver.c (ntp_res): Authenticate the keyid.
+
+ * ntpd/ntp_crypto.c (crypto_line): Fix definition
+ (crypto_read): Ditto.
+
+ * ntpd/ntp_config.c (getconfig): Move req_keyid generation here.
+
+ * librsaref/Makefile.am (BUILT_SOURCES): Cleanup more nodist_ stuff.
+
+2000-03-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * build (RSASUF): If we have rsaref2/ and are building
+ --without-rsaref, note it as a build-directory suffix.
+
+ * configure.in: 4.0.99h
+ Crypto merge
+
+ * librsaref/Makefile.am (nodist_librsaref_a_SOURCES): Added nodist_
+
+2000-02-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Lose the changequote calls and fix the quoting.
+ Reported by: Akim Demaille <akim@epita.fr>
+
+ * ntpd/ntp_request.c: Log various error conditions.
+
+2000-02-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99g
+
+ * ntpd/ntpd.c: Only log EINTR if debug > 2.
+
+2000-02-25 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/mkver.in (ConfStr): Use `-r' when configured with crypto.
+
+ * ntpd/refclock_wwvb.c (wwvb_receive): Undo the previous chagne.
+
+2000-02-24 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwvb.c (wwvb_receive): LENWWVB0 can return 6 or 7
+ fields.
+ From: Michael Sinatra <msinatra@uclink4.berkeley.edu>
+ with a cleanup from Ulrich.
+
+ * scripts/mkver.in (ConfStr): Make RSAREF appear as part of the
+ version.
+
+2000-02-21 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * ports/winnt/include/config.h: Enable MD5 and RANDOM by default
+ * ports/winnt/libntp/SetSystemTime.c: Fix warning and const declaration
+ From: Carl Byington <carl@five-ten-sg.com>
+
+2000-02-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Makefile.am (SUBDIRS): Make librsaref right after includes so we
+ can copy any needed header files over.
+
+ * libntp/Makefile.am (INCLUDES): Also look in librsaref for des.h
+ * ntpd/Makefile.am (INCLUDES): Ditto
+ * util/Makefile.am (INCLUDES): Ditto
+
+ * librsaref/Makefile.am (librsaref_a_SOURCES): Use the des.h from
+ the rsaref2 distribution.
+
+ * include/Makefile.am (noinst_HEADERS): No, we don't want des.h
+
+2000-02-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/Makefile.am (noinst_HEADERS): Add des.h
+
+2000-02-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c (do_resolve_internal): Try Real Hard to
+ generate a full random key.
+ From: Carl Byington <carl@five-ten-sg.com>
+
+ * include/ntp.h: Now we know we have either mrand48() or random().
+ * configure.in: If we have mrand48, use it. Otherwise, use (and
+ provide if necessary) random().
+ * libntp/Makefile.am (EXTRA_DIST): random.c
+ * libntp/random.c: Added.
+
+2000-02-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * librsaref/Makefile.am (stamp-rsaref): Typo
+
+ * configure.in (ac_cv_func_ctty_for_f_setown): Yes for OpenBSD
+ (ac_cv_var_ntp_syscalls): Fix quoting of description
+ From: Jonathan Rozes <jrozes@vinton.com>
+
+ * librsaref/Makefile.am: Fix stamp-rsaref dependency order.
+
+ * configure.in: 4.0.99f
+
+2000-02-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_mx4200.c: Remove the DOP-weighted position
+ averaging code and revert to a simple mean average. The weighted
+ average consistently produced a *worse* result. Go figure.
+ * html/mx4200data.htm: Cleanup, reflect current reality.
+ * html/driver9.htm: Cleanup, reflect current reality.
+ * html/copyright.htm: Cleanup, and credit where credit is due.
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_oncore.c: Cleanup/fixes
+ * html/driver30.htm: Cleanup
+ * html/Oncore-SHMEM.htm: Cleanup
+ From: Reg Clemens <reg@dwf.com>
+
+2000-02-16 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * winnt/scripts/mkver.bat: Frederick Czajka [w2k@austin.rr.com]
+ winnt/ntpq/ntpq.dsp: modified mkver.bat to eliminate the
+ winnt/ntpd/ntpd.dsp: need to have Perl installed and the
+ winnt/ntpdc/ntpdc.dsp: PERL environment variable to be set.
+ winnt/ntpdate/ntpdate.dsp:
+ winnt/ntptrace/ntptrace.dsp: Thanks, Frederick!
+
+ * ntpd/refclock_nmea.c: Correctly interpret the quality indicator.
+
+2000-02-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_nmea.c: Correctly interpret the quality indicator.
+ Deal with the time supplied in centiseconds. GPGCA/GPGGA cleanup.
+ From: Andrew Hood <ajhood@fl.net.au>
+
+ * libparse/Makefile.am (K_CFLAGS): Use instead. Add NEED_NTP_BOPS.
+
+2000-02-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/ntp-wait.in: Intensify, including some suggestions from
+ Ulrich.
+
+ * configure.in: 4.0.99e
+
+ * scripts/ntp-wait.in: Lose cruft, sleep after each try.
+
+ * scripts/ntp-restart: It's ntpd now. Also, call ntp-wait.
+
+ * configure.in (AC_CONFIG_*): New scripts that use PATH_PERL
+
+ * scripts/Makefile.am (noinst_SCRIPTS): Added ntp-wait
+ (noinst_SCRIPTS): Added all of the scripts that now use PATH_PERL
+
+ * configure.in: Get the path to perl
+ (AC_CONFIG_*): Added scripts/ntp-wait
+
+ * ntptrace/ntptrace.c (DoTrace): If the server's srcadr is 0.0.0.0
+ then we haven't synced yet. Note and punt.
+ Reported by: Bdale Garbee <bdale@gag.com>,http://bugs.debian.org/56551
+
+2000-02-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ports/winnt/include/config.h: Typo (CLOCK_PALISADE comment)
+ From: Carl Byington <carl@five-ten-sg.com>
+
+ * configure.in: Disable kernel_fll_bug for Generic_105181-17 under
+ Solaris-2.6
+ From: Juergen Georgi <georgi@belwue.de>
+
+2000-02-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99d
+
+ * html/Oncore-SHMEM.htm: New document
+ * html/driver30.htm: Cleanup and improvements
+ From: Reg Clemens <reg@dwf.com>
+
+2000-01-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c: Patches/improvements
+ From: Reg Clemens <reg@dwf.com>
+
+2000-01-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99c
+
+2000-01-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Autoconf update...
+
+ * ntpdate/ntpdate.c (ntpdatemain): Typo
+ From: Jack Bryans <jbryans@csulb.edu>
+
+ * Makefile.am (EXTRA_DIST): Add flock-build. Probably UDel specific...
+
+2000-01-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/check_y2k.c (main): Reformat for ansi2knr
+
+ * configure.in (AC_OUTPUT): Revert to obsolete form until automake
+ catches up.
+
+2000-01-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Use AC_CHECK_TYPES((s_char)) instead of
+ AC_CHECK_TYPE.
+ (ac_cv_var_kernel_fll_bug): Generic_106541-08 is apparently OK, too.
+
+ * scripts/Makefile.am (EXTRA_DIST): Need to explicitly distribute
+ mkver.in and ntpver.in now, apparently.
+ * configure.in: Search for the various audio_info members so the
+ printing in audio_show is less of a circus. This required an
+ autoconf upgrade. Major sigh.
+
+ * libntp/audio.c (audio_show): Clean up (more) properly.
+
+2000-01-21 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * Add pointer to html/hints/winnt.htm to INSTALL file
+ * Fix NT makefiles to accomodate at least one weird
+ version of Visual C that can't handle the LFs without
+ the DOS CR also.
+
+2000-01-20 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * Update Copyright in Palisade driver to 2000
+ * Fix Palisade MIN & MAX POLL to optimal values
+
+2000-01-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver7.htm: Patches from Dave Mills
+ * html/driver36.htm: Patches from Dave Mills
+
+ * html/copyright.htm: Added Kamal Mostafa
+
+2000-01-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99b
+
+2000-01-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_chu.c: NCHAN is used with generic ICOM.
+
+ * ntpd/refclock_wwv.c: Use new audio stuff
+ * ntpd/refclock_irig.c: Use new audio stuff
+ * ntpd/refclock_chu.c: Use new audio stuff
+ * ntpd/ntp_proto.c: Clean up
+ * ntpd/ntp_loopfilter.c (local_clock): Clean up error message
+ * include/icom.h: Number of arguments changed
+ * libntp/Makefile.am (libntp_a_SOURCES): Added audio.c
+ * libntp/audio.c: New file
+ * include/Makefile.am (noinst_HEADERS): audio.h added
+ * include/audio.h: New file
+ From: Dave Mills <mills@udel.edu>
+
+ * scripts/freq_adj: Added. FreeBSD frequency adjustment script.
+
+ * configure.in: Do a better job on my oncore_ok check for SCO.
+
+2000-01-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99a
+
+ * scripts/ntpsweep: New version
+ * html/copyright.htm: Added Hans Lambermont
+ From: Hans Lambermont <Hans.Lambermont@nl.origin-it.com>
+
+2000-01-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c (oncore_start): Only dance with the
+ pps_device if it's there.
+ From: reg@dwf.com
+
+ * configure.in: ONCORE is OK if ac_cv_hdr_def_tiocdcdtimestamp=yes
+
+ * build: Just overwrite the log file each time; sometimes NFS goes
+ a little goofy.
+
+ * ntpd/refclock_fg.c: Syntax/punctuation cleanup
+
+2000-01-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/ntpsweep: New version
+ From: Hans Lambermont <Hans.Lambermont@nl.origin-it.com>
+
+ * ntpd/refclock_fg.c: New version
+ * html/driver37.htm: New version
+ From: Dmitry Smirnov <das@online.nsk.su>
+
+2000-01-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * README.des: Cleanup
+
+2000-01-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99
+
+ * html/driver36.htm: Cleanup
+ * html/monopt.htm: Ditto
+ From: Dave Mills <mills@udel.edu>
+
+ * ntpd/ntp_intres.c (ntp_intres): Put "NTP_INTRES running" at a
+ higher debug level
+
+2000-01-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: More improvements
+ From: Dave Mills <mills@udel.edu>
+
+2000-01-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Bugfixes/improvements
+ From: Dave Mills <mills@udel.edu>
+
+ * configure.in: Get the quoting right on the sys_errlist check.
+ From documentation by: Akim Demaille <akim@epita.fr>
+
+2000-01-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: <netinet/ip.h> cannot be detected...
+ * ntpd/ntp_io.h: ...but every OS has it
+ * ntpd/refclock_oncore.c: Lint removal
+ * ntpq/ntpq_ops.c: Lint removal
+ * ntpq/refclock_chu.c: chu_major() is not an audio routine (?), lint
+ * libntp/icom.c: AIX doesn't have <sys/termios.h>
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_chu.c: NetBSD needs sys/ioctl.h
+ (chu_debug): NetBSD-specific debug output.
+ From: Frederick Bruckman <fb@enteract.com>
+
+2000-01-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98m
+ I skipped `l' - it looks like a `1'.
+
+ * html/driver7.htm: Doc update
+ * html/driver36.htm: Ditto
+ * html/audio.htm: Ditto
+
+ * ntpd/refclock_wwv.c: Dvae snuck another fix/change in on me.
+
+ * configure.in: 4.0.98k
+
+ * ntpd/refclock_chu.c (chu_start): Call icom_init with the speed
+ * ntpd/refclock_wwv.c (wwv_start): Ditto, plus other improvements.
+ * libntp/icom.c (icom_init): Add speed parameter
+ * include/icom.h: Update declaration
+ From: Dave Mills <mills@udel.edu>
+
+ * include/Makefile.am (noinst_HEADERS): Added icom.h
+ From: Frederick Bruckman <fb@enteract.com>
+
+2000-01-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98j
+
+ * ntpd/refclock_wwv.c (timecode): Make definition == declaration
+ (wwv_newchan): Ditto
+ (wwv_corr4): Dave fixed the declaration.
+
+ * flock-build: Add rackety to the flock - it runs SunOS 4.1.3/cc
+
+ * ntpd/refclock_wwv.c: Undo that declaration cleanup for now...
+
+ * ntpd/ntp_io.c (open_socket): TOS support
+ From: Marc.Brett@westgeo.com
+
+2000-01-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Declaration cleanup
+ * ntpd/refclock_fg.c (fg_receive): Not all sprintf's are created
+ equal...
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_wwv.c: Dave Cleaned and Improved things.
+ * ntpd/ntp_loopfilter.c (local_clock): Dave fixed something.
+
+ * ntpd/refclock_wwv.c: Rename max to p_max or s_max as appropriate
+ to avoid native SunOS compiler collision.
+ (wwv_epoch): Make declaration == definition
+ (wwv_rsec): Ditto
+ (wwv_newchan): Ditto
+ (wwv_qsy): Ditto
+ (timecode): Ditto
+
+ * ntpd/refclock_oncore.c (oncore_init_shmem): Use a cast to widen
+ mmap's NIL offset.
+
+ * ntpd/refclock_chu.c (chu_rf): Make declaration == definition.
+ Rename min/max to es_min/es_max to avoid native SunOS compiler
+ collision.
+ (chu_uart): Make declaration == definition.
+
+ * libntp/icom.c (sndpkt): Make declaration and definition equivalent.
+ (doublefreq): Ditto.
+
+ * ntpd/refclock_oncore.c (MAP_FAILED): Some systems do not #define
+ this.
+
+ * ntpd/refclock_wwv.c:
+ * ntpd/refclock_chu.c:
+ * libntp/icom.c:
+ * libntp/Makefile.am:
+ * include/icom.h:
+ * html/driver7.htm:
+ * html/driver36.htm:
+ Support for ICOM. The WWV/H driver, by the way, is getting truly
+ awesome. The CHU autotune function works okay as it is. I'd like
+ to find somebody else to test the audio drivers just to make sure
+ I haven't done something stupid. There is a new define ICOM
+ intended for the driver autotune function; however, I crafted the
+ thing in much the same way as the refclock_atom.c thing - it tries
+ to open /dev/icom and, if that fails, goes quietly to sleep.
+ From: Dave Mills <mills@udel.edu>
+
+2000-01-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c (oncore_read_config): Patches and cleanup
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+ more isascii() stuff from HMS.
+
+ * ntpd/refclock_fg.c (fg_receive): Cast.
+ From: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntpd/map_vme.c (map_vme): tx.access_result indicates failure on
+ < 0, not <= 0. A fix that apparently did not get brought over
+ from the ntp3 base.
+ From: Michael Barone <michael.barone@lmco.com>
+
+ * configure.in: Move the ONCORE_SHMEM_STATUS check and definition
+ here.
+
+ * ntpd/refclock_oncore.c (oncore_init_shmem): Some systems do not
+ have MAP_HASSEMAPHORE.
+
+ * ntpd/refclock_oncore.c: Drive ONCORE_SHMEM_STATUS based on
+ HAVE_SYS_MMAN_H . If this needs finer checks, do it in
+ configure.in .
+ (oncore_read_config): Add the isascii() checks; older versions of
+ Unix don't guarantee correct behavior of is*() without it.
+
+ * ntpd/refclock_oncore.c: Add proof-of-concept support for
+ delivering receiver data stream to other processes through
+ a memory-mapped file.
+ From: Poul-Henning Kamp <phk@FreeBSD.org>
+
+2000-01-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_refclock_chu): Provide the CHU driver by
+ default, and by default prefer the AUDIO version. We used to
+ limit this to SunOS or Solaris; now we drive by the availability
+ of the audioio header file.
+ Select the IRIG and WWV audio drivers the same way.
+
+ * flock-build: build ignores the -l flag; lose it.
+ (BUILD_ARGS): added.
+ * build: Remove unused -l stuff (LOG variable).
+
+ * ntpd/ntp_refclock.c: HAVE_PPSAPI header cleanup
+ From: Reg Clemens <reg@dwf.com>
+
+2000-01-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (CLOCK_WWV): Require <sys/audioio.h> or <sun/audioio.h>
+
+1999-12-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98i
+
+ * ntpd/refclock_gpsvme.c: Fixes
+ From: Michael Barone <michael.barone@lmco.com>
+ Patch severely hacked by HMS to "make it conform". I hope I
+ didn't break anything.
+
+ * scripts/ntpsweep: Nifty utility
+ From: Hans.Lambermont@nl.origin-it.com
+
+ * ntpd/refclock_fg.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/ntp_control.c:
+ * ntpd/Makefile.am:
+ * libntp/clocktypes.c:
+ * include/ntp.h:
+ * html/refclock.htm:
+ * html/driver37.htm:
+ * configure.in:
+ * acconfig.h:
+ Forum Graphic GPS clock support
+ From: Dmitry Smirnov <das@online.nsk.su>
+
+ * configure.in: Default to compile the IRIG, CHU and WWV/H
+ drivers and compile the CHU driver for audio, not modem.
+ Requested by Dave Mills.
+
+ * html/audio.htm:
+ * html/driver36.htm:
+ * html/qth.htm:
+ Dave wrote these to go along with the changes I checked in yesterday.
+
+1999-12-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_chu.c:
+ * ntpd/ntp_refclock.c:
+ * ntpd/ntp_loopfilter.c:
+ * html/refclock.htm:
+ * html/pps.htm:
+ * html/index.htm:
+ * html/driver7.htm:
+ * html/driver6.htm:
+ * html/copyright.htm:
+
+ I indulged an old agenda to polish up some programs originally
+ written for a DSP evaluation board. The result is a really hot
+ audio driver for the NIST WWV/WWVH time/frequency station plus a
+ makeover for the CHU audio driver. Currently, they and their IRIG
+ audio driver buddy use the SunOS/Solaris audio interface, which is
+ clean and simple. I hook the line in jack to a shortwave radio and
+ these drivers (driver 7 for CHU and driver 36 for WWV) and the
+ drivers do the rest. The WWV/H driver is really hot - I am
+ currently watching the ionosphere move from the doppler that shows
+ up on the tick modulation tracked by the program. During midday
+ when the F2 layer settles down, the program closes in on a few
+ tens of microseconds of spare jitter and wander. This watch on
+ whichever 15/20 MHz signal sounds the best. At night on 5/10 MHz
+ and even 2.5 HMz where the multipath, interference and noise are
+ much worse, the driver bangs around somewhat more.
+
+ The CHU driver makeover discovered a few broken bones after all
+ these years, but its majority decoder is back in business. For
+ various reasons to icky to reveal here, its 103-modem demodulator
+ is not quite as good as the chip, but it comes close and hey,
+ 2025/2125 FSK is just not a good idea for HF radio. This driver is
+ not nearly as sophisitcated as the WWV/H driver, but here a few
+ hundred miles south of Ottawa, it does a passably good job.
+
+ I tell you this in the hopes of getting somebody interested in
+ porting the audio interface to other machines, in particular
+ Linux, FreeBSD and anything else with a sound card. When the
+ ionosphere stays cool, the WWV/H driver is as good as anything
+ else around here and with much less jitter than a serial port. The
+ only downside is all the audio drivers chew up a modest fraction
+ of cycles for the DSP routines - a few percent on the newer
+ silicon, up to half the cycles on an old Sparc IPC. Whattheheck,
+ these old machines aren't doing anything else around here except
+ serving time, and even when sucking cycles for DSP they still mind
+ the PPS microseconds.
+
+ The audio driver documentation had a makeover, too.
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98h
+
+1999-12-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/syssignal.c: Small cleanup to Marc's patch.
+
+ * ntpd/ntp_refclock.c:
+ * ntpd/refclock_atom.c: Header cleanup
+ * html/driver30.htm: Cleanup and improvements.
+ From: Reg Clemens <reg@dwf.com>
+
+ * ntpd/ntp_refclock.c:
+ * ntpd/refclock_jupiter.c:
+ * ntpd/refclock_msfees.c:
+ * ntpd/refclock_mx4200.c:
+ Portability (Solaris) patches
+ * ntpd/refclock_mx4200.c:
+ Self-survey improvements, cleanup for, PPS re-activation
+ * libntp/syssignal.c:
+ Fix for "interrupted system call" (EINTR) failure of the PPS
+ ioctl(TIOCGPPSEV) call in Solaris. Not sure why it was
+ interrupted, but this works around the failure. Not sure if
+ the (now silent) interrupt affects the timing accuracy.
+ THERE IS A CHANCE THIS PART OF THE PATCH MAY ADVERSELY
+ AFFECT OTHER SYSTEMS!
+ * scripts/ntp-status: Added.
+ From: Marc.Brett@westgeo.com
+
+ * ntpdate/ntpdate.c: Deal with multiple addresses.
+ From: Jeffrey C Honig <jch@bsdi.com>
+
+ * ntpd/refclock_conf.c: Replaced macro SHM with CLOCK_SHM.
+ * ntpd/refclock_shm.c (shm_poll): Take clock time in UTC.
+ pp->day starts at 1, t->tm_yday starts at 0.
+ From: Jakob Stoklund Olesen <stoklund@taxidriver.dk>
+
+1999-12-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * NEWS: Updated ONCORE instructions
+ From: Kamal A Mostafa <kamal@whence.com>
+
+1999-12-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98g
+
+ * ntpd/refclock_oncore.c: Cleanup and fixes
+ From: Reg Clemens <reg@dwf.com> and Kamal A Mostafa <kamal@whence.com>
+
+1999-12-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Cleanup/checkin of the current state of affairs.
+ From: Dave Mills <mills@udel.edu>
+
+ * ntpd/refclock_oncore.c: #elif conversion. I can only hope I did
+ it right.
+
+ * ntpd/refclock_oncore.c: Various patches
+ From: Reg Clemens <reg@dwf.com> and Kamal A Mostafa <kamal@whence.com>
+
+1999-12-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (default_get_precision): Use the right arg type
+ to pass "sizeof freq" to sysctlbyname().
+ From: Ollivier Robert <roberto@eurocontrol.fr>
+
+ * ntpd/refclock_wwv.c: Cleanup and fixes.
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Cleanup and fixes
+ * ntpd/refclock_conf.c: WWV declaration cleanup.
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libparse/clk_rawdcf.c (cvt_rawdcf): Buglet.
+ From: Frank Kardel <kardel <AT> acm.org>
+
+1999-12-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/Makefile.am (ntpd_SOURCES): Added refclock_wwv.c
+
+ * ntpd/refclock_wwvb.c:
+ * ntpd/refclock_wwv.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_chu.c:
+ * libntp/clocktypes.c:
+ * include/ntp.h: Dave cleaned some things up
+ Dave cleaned some things up (WWVB -> SPECTRACOM, CHU -> CHU_AUDIO,
+ WWV_AUDIO)
+
+ * acconfig.h: REFCLOCK_WWVB -> REFCLOCK_SPECTRACOM, added REFCLOCK_WWV
+ * configure.in: Deal with it.
+
+1999-12-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_refclock.c (refclock_open): More PPS cleanup
+ From: Dave Mills <mills@udel.edu>
+
+ * ntpq/ntpq.c:
+ * ntpq/ntpq_ops.c:
+ Make `ntpq -pn' independent of DNS, ad advertised.
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * ntpd/refclock_mx4200.c (mx4200_start): make missing 3rd
+ parameter a 0.
+
+1999-12-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_refclock.c (refclock_open): "flags" processing cleanup
+ (refclock_open): PPS device initialization cleanup
+ * include/ntp_refclock.h (LDISC_CHU):
+ (LDISC_PPS): Clean up comments
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-03 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * libntp/mexit.c: Moved WINNT port specific file to ports/winnt/libntp
+ * ports/winnt/libntp/libntp.dsp: Fix WinNT makefile for new source loc.
+
+1999-12-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/Makefile.am (libntp_a_SOURCES): Lose mexit.c - Sven will
+ move it to the winnt port area.
+
+1999-12-03 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * libntp/systime.c: Removed adjtime hack for WINNT
+ * ports/winnt/ntpd/nt_clockstuff.c: Winnt double precision adjtime
+ * ports/winnt/inlcude/clockstuff.h: Remove no longer needed externs
+
+1999-12-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libparse/Makefile.in: Manually hacked to remove the
+ libparse_kernel.a.[co] cruft
+
+ * libparse/Makefile.am (k*.o): Generate these form the Makefile,
+ not from separate .c files
+
+ * html/tickadj.htm:
+ * html/notes.htm:
+ * html/hints/solaris.html:
+ Point to the new dosynctodr report.
+
+ * html/hints/solaris.xtra.S99ntpd:
+ Update. Should be rewritten to take advantage of the new -g
+ switch and perhaps a loop to wait until ntpd hits a reasonable
+ "state".
+
+ * html/hints/solaris-dosynctodr.html: New information
+ From: "John W. Sopko Jr." <sopko@cs.unc.edu>
+
+1999-12-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/authkeys.c (auth_moremem): Clear memory allocated for sk.
+ From: Hugo Mildenberger <hugo.mildenberger@topmail.de>
+
+1999-12-01 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * libntp/recvbuff.c: Unused functions cleanup
+ * ntpd/ntpd.c: ProcessorAffinity, IO cleanup
+ * ports/winnt/instsrv/instsrv.c: Service name changed to NTP
+
+ NT port shouldn;t hop between CPUs. Set affinity to first processor.
+ Service name was NetworkTimeProtocol. Too long. Now NTP.
+
+1999-12-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/plot_summary.pl: Improved option parsing. Fixed one
+ minor Perl compatibility error.
+ * scripts/summary.pl: Official revision for NTPv4: Parse new
+ statistic file formats correctly, provide error checking for bad
+ input files, and guard against negative arguments to sqrt()
+ because of numeric effects. Use one pattern to select valid
+ statistic files. Add selectable output directory
+ (``--output-directory'') and improved option parsing. Directory
+ with statistic files (now settable also with
+ ``--input-directory'') defaults to ``/var/log/ntp''.
+ From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * html/driver8.htm:
+ * libparse/clk_computime.c:
+ * libparse/clk_dcf7000.c:
+ * libparse/clk_hopf6021.c:
+ * libparse/clk_meinberg.c:
+ * libparse/clk_rawdcf.c:
+ * libparse/clk_rcc8000.c:
+ * libparse/clk_schmid.c:
+ * libparse/clk_trimtaip.c:
+ * libparse/clk_trimtsip.c:
+ * libparse/data_mbg.c:
+ * libparse/kclk_computime.c:
+ * libparse/kclk_dcf7000.c:
+ * libparse/kclk_hopf6021.c:
+ * libparse/kclk_meinberg.c:
+ * libparse/kclk_rawdcf.c:
+ * libparse/kclk_rcc8000.c:
+ * libparse/kclk_schmid.c:
+ * libparse/kclk_trimtaip.c:
+ * libparse/kclk_trimtsip.c:
+ * libparse/kparse.c:
+ * libparse/kparse_conf.c:
+ * libparse/parse.c:
+ * libparse/parse_conf.c:
+ * libparse/parsesolaris.c:
+ * libparse/parsestreams.c:
+ * ntpd/refclock_parse.c:
+ Mods and updates
+ From: Frank Kardel <kardel <AT> acm.org>
+
+ * acconfig.h: PCF refclock
+ * configure.in:
+ * html/driver35.htm:
+ * html/refclock.htm:
+ * include/ntp.h:
+ * libntp/clocktypes.c:
+ * ntpd/Makefile.am:
+ * ntpd/ntp_control.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_pcf.c:
+ From: Andreas Voegele <andreas.voegele@gmx.de>
+
+ * acconfig.h: DECL_STIME_1
+
+ * configure.in (iCFLAGS): Use -std1 for alpha*-dec-osf* if we are
+ using "cc".
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+1999-11-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/l_stdlib.h: DECL_SYSTIME_1 --- a long *
+ * configure.in: Use it for DEC OSF[45]
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntpd/refclock_parse.c: Add missing declarations
+ * ntptrace/ntptrace.c: Ditto
+ * ntpd/ntp_proto.c: Ditto
+ * ntpd/refclock_palisade.c: Ditto
+ From: Jonathan Stone <jonathan@dsg.stanford.edu>
+
+1999-11-18 Sven Dietrich <sven_dietrich@trimble.com>
+ * Win NT port updates
+ * ntpd.dsp: makefile only builds supported refclocks
+ * config.h: cleanup, undefine unsupported clock_atom
+ * win32_io, clock_NMEA: foundation for future refclock support
+ * recvbuff, transmitbuff, IOcompletionport: streamline packet handler
+ * html/hints/winnt.htm: Added up-to-date html docs for WINNT
+
+1999-11-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/copyright.htm: Credit Jack for his work.
+
+ * html/pic/*: Save a *ton* of space on the pictures.
+ From: Jack Sasportas <jack@innovativeinternet.com>
+
+1999-11-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in : changequote for osf[45] test.
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntp_update: Ignore stuff in any A.* directory.
+
+1999-11-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Clean up header checks for sys/syssgi.h and
+ sys/select.h . Originally, we did not check for sys/select.h
+ under some versions of SCO (see xntp3-5). Somewhere in ntp4 we
+ dropped the SCO check and added the check for sys/syssgi.h,
+ exclusive of checking for sys/select.h. Marc Brett can't think of
+ a reason why we should not be checking for sys/select.h, so let's
+ look for it now.
+
+1999-11-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpdate/ntpdate.c: Add the ability for ntpdate to query a
+ multicast address. We use the response to the multicast address
+ to learn new servers which we then add to the peer list and query.
+ In changing this I made the list of peers a linked list.
+
+ To be complete I should detect a broadcast address and make it
+ behave the same way. But that requires a scan of the interface
+ list which is more complicated that I want to deal with...
+
+ Fix a bug, allowing ntpdate to compile if SLEWALWAYS and STEP_SLEW
+ are both defined.
+
+ From: Jeffrey C Honig <jch@bsdi.com>
+
+ * ntpd/ntp_refclock.c: sys/sio.h and SCO5_CLOCK cleanup
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * ntpd/ntp_loopfilter.c: Let -g do a "correct any" for the first
+ time adjustment.
+ From: Dave Mills <mills@udel.edu>
+
+ * configure.in: sys/sio.h needs to be checked independently.
+ Reported by: Kamal A Mostafa <kamal@whence.com>
+
+1999-11-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98f
+
+ * configure.in: DECL_PLOCK_0 and DECL_STIME_0 are for dec-osf5*, too
+ * ntpd/ntpd.c: DEC OSF cleanup (editorial comments by HMS)
+ From: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntpd/ntp_refclock.c: MAXUNIT bugfix
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/ntp_refclock.c:
+ * ntpd/ntpd.c:
+ * ntpd/refclock_arc.c:
+ * ntpd/refclock_as2201.c:
+ * ntpd/refclock_atom.c:
+ * ntpdc/ntpdc.c:
+ * ntpq/ntpq.c:
+ Code cleanup.
+ From: Marc.Brett@westgeo.com
+
+ * include/ntp_stdlib.h:
+ * libntp/systime.c:
+ * ntpd/ntp_proto.c:
+ Replaced the 'sco5_oldclock' variable with 'systime_10ms_ticks'.
+ Cleared libntp/systime.c and include/ntp_stdlib.h of references
+ to SCO5_CLOCK and RELIANTUNIX_CLOCK (moved to ntpd/ntp_proto.c).
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * configure.in: alpha-dec-osf4* -> alpha*-dec-osf4*|alpha*-dec-osf5*
+ From: Tom Smith <smith@cag.lkg.dec.com>
+
+ * configure.in: Look for <sys/sio.h>. If TIOCDCDTIMESTAMP is
+ there, we have TTYCLK.
+ * acconfig.h: Lose old AIOCTIMESTAMP stuff
+ Reported by: Kamal A Mostafa <kamal@whence.com>
+
+1999-11-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntpd.c (set_process_priority): Clean up nice() and setpriority()
+
+1999-11-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Makefile.am (EXTRA_DIST): Added README.cvs
+ Reported by: Kamal A Mostafa <kamal@whence.com>
+
+1999-11-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98e
+
+1999-11-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Lose AIOCTIMESTAMP tests
+
+ * ntpd/ntpd.c: lose select() EINTR debug warning
+ * ntpd/ntp_refclock.c: AIOCTIMESTAMP -> TIOCDCDTIMESTAMP. Watch
+ CLK_SETSTR.
+ * ntpd/refclock_atom.c: fdpps is only there for PPS or PPSAPI.
+ AIOCTIMESTAMP is gone now.
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * configure.in (HAVE_MLOCKALL): Deal with dec-osf5 realities
+ * ntpd/refclock_ulink.c (ulink_poll): Fix cast.
+ * libntp/machines.c (ntp_set_tod): Use a long* for the argument to
+ stime().
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntpd/ntpd.c (set_process_priority): Use whatever we have until
+ something works.
+
+ * ntpd/ntp_loopfilter.c: Keep clock_frequency changes in a temp
+ variable so we can record it to loopstats (near as HMS can tell).
+ From: Dave Mills <mills@udel.edu>
+
+1999-11-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * acconfig.h: RELIANTUNIX_CLOCK
+ * configure.in (ac_cv_var_tickadj): RELIANTUNIX_CLOCK
+ * libntp/systime.c (adj_systime): Reliant patches
+ From: Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
+
+1999-11-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_parse.c (parse_start): ASYNC_PPS_CD_NEG cleanup
+ * configure.in (ac_cv_make_ntptime): OK on Linux
+ From: <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * configure.in: NetBSD has PPSAPI now
+ F_SETOWN is needed for NetBSD
+ From: Jonathan Stone <jonathan@dsg.stanford.edu>
+
+1999-11-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98d
+
+ * ntpd/refclock_parse.c: Cleanup/fixes
+ From: John Hay <jhay@mikom.csir.co.za>
+
+ * ntpd/refclock_parse.c: Lose #include "ntp_select.h"
+ * ntpd/ntpd.c: Lose #include "ntp_select.h"
+ * ntpd/ntp_io.c: Lose #include "ntp_select.h"
+ * ntpd/ntp_intres.c: Lose #include "ntp_select.h"
+ * libntp/iosignal.c: Lose #include "ntp_select.h"
+ * include/ntpd.h: #include "ntp_select.h" for declaration of activefds
+ Reported by: Christian Krackowizer <kra1@technodat.co.at>
+
+1999-11-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98c
+
+ * libntp/syssignal.c: Don't warn about SA_RESTART
+ * libntp/recvbuff.c: Fix free buffer count
+ From: Jeffrey C Honig <jch@bsdi.com>
+
+ * html/pps.htm:
+ * html/howto.htm:
+ * html/confopt.htm:
+ * html/clockopt.htm:
+ * html/uthopt.htm:
+ Updates.
+ From: Dave Mills <mills@udel.edu>
+
+ * ntpd/refclock_wwvb.c: burst fixes
+ * ntpd/refclock_ulink.c: burst fixes
+ * ntpd/refclock_tpro.c: burst and NSTAGE fixes
+ * ntpd/refclock_pst.c: burst fixes
+ * ntpd/refclock_irig.c: SAMPLE -> SAMPLES
+ * ntpd/refclock_heath.c: burst fixes
+ * ntpd/refclock_dumbclock.c: burst fixes
+ * ntpd/refclock_chronolog.c: burst fixes
+ * ntpd/refclock_bancomm.c: burst fixes
+ * ntpd/refclock_atom.c: burst fixes
+ * ntpd/refclock_as2201.c: burst fixes
+ * ntpd/ntp_refclock.c: PPSAPI, code, and comment cleanup/fixes
+ * ntpd/ntp_proto.c: Broadcast/restrict cleanup
+ * ntpd/ntp_loopfilter.c: Cleanup and fixes
+ * libntp/gpstolfp.c: Lose the UL qualifiers - old compilers hate them
+ From: Dave Mills <mills@udel.edu>
+
+1999-10-31 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: TIOCSPPS cleanup
+
+1999-10-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98b
+
+ * ntpd/refclock_atom.c: AIOCTIMESTAMP patch
+ * ntpd/ntpd.c: SCO clock patch
+ * ntpd/ntp_request.c: noselect patch
+ * ntpd/ntp_refclock.c: AIOCTIMESTAMP patch
+ * ntpd/ntp_proto.c: noselect patch
+ * ntpd/ntp_intres.c: noselect patch
+ * ntpd/ntp_config.c: noselect patch
+ * include/ntp_request.h: noselect patch
+ * include/ntp.h: noselect patch
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * configure.in:
+ * acconfig.h: TTYCLK_AIOCTIMESTAMP
+ Stuff for Kamal
+
+ * ntpd/refclock_atom.c (atom_pps): make "result" initialization
+ uglier, but more bulletproof.
+
+ * configure.in (sys/timepps.h): Fixed.
+ From: John Hay <jhay@mikom.csir.co.za>
+
+1999-10-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c: Rename instance.state to instance.o_state
+
+ * refclock_oncore.c:
+ * refclock_mx4200.c:
+ * refclock_chu.c:
+ * refclock_atom.c:
+ * ntp_refclock.c:
+ * ntp_peer.c:
+ * ntp_loopfilter.c:
+ * include/ntp_refclock.h:
+ Various cleanup and fixes
+ From: Dave Mills <mills@udel.edu>
+
+1999-10-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c (CONFIG_FILE): NT changes
+ From: Sven Dietrich <Sven_Dietrich@trimble.com>
+
+1999-10-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: sys/timepps.h verification changes
+
+ * ntpd/refclock_atom.c (atom_poll): PPS cleanup
+ From: Dave Mills <mills@udel.edu>
+ (atom_pps): Portability patch
+ From: John Hay <jhay@mikom.csir.co.za>
+
+
+ * libntp/msyslog.c:
+ * libntp/gpstolfp.c:
+ Lint cleanup
+ From: Jonathan Stone <jonathan@dsg.stanford.edu>
+
+ * parseutil/dcfd.c: abs() -> l_abs(), time.h (AIX 4.3.2 patches)
+ From: Dana Kaempen <decay@flash.net>
+
+ * ntpd/refclock_oncore.c:
+ * ntpd/refclock_atom.c:
+ * ntpd/ntp_refclock.c:
+ PPS cleanup
+ From: John.Hay@mikom.csir.co.za
+
+ * util/ntptime.c:
+ * ntpdate/ntptimeset.c:
+ * ntpdate/ntpdate.c:
+ * ntpd/refclock_trak.c:
+ * ntpd/refclock_oncore.c:
+ * ntpd/refclock_mx4200.c:
+ * ntpd/refclock_msfees.c:
+ * ntpd/refclock_atom.c:
+ * ntpd/ntp_control.c:
+ * ntpd/ntp_config.c:
+ * configure.in:
+ * configure:
+ PPS, Solaris 7, cleanup patches
+ From: Marc.Brett@westgeo.com
+
+ * ports/winnt/ntptrace/ntptrace.dsp:
+ * ports/winnt/ntpq/ntpq.dsp:
+ * ports/winnt/ntpdc/ntpdc.dsp:
+ * ports/winnt/ntpdate/ntpdate.dsp:
+ * ports/winnt/ntpd/refclock_trimbledc.c:
+ * ports/winnt/ntpd/ntpd.dsp:
+ * ports/winnt/ntpd/ntp_iocompletionport.c:
+ * ports/winnt/ntpd/nt_clockstuff.c:
+ * ports/winnt/libntp/util_clockstuff.c:
+ * ports/winnt/libntp/libntp.dsp:
+ * ports/winnt/libntp/SetSystemTime.c:
+ * ports/winnt/instsrv/instsrv.c:
+ * ports/winnt/include/sys/ioctl.h:
+ * ports/winnt/include/termios.h:
+ * ports/winnt/include/config.h:
+ * ports/winnt/include/clockstuff.h:
+ * ports/winnt/ntp.dsw:
+ * ntpd/refclock_shm.c:
+ * ntpd/refclock_palisade.c:
+ * ntpd/ntpd.c:
+ * ntpd/ntp_timer.c:
+ * ntpd/ntp_refclock.c:
+ * libntp/systime.c:
+ * libntp/machines.c:
+ NT patches
+ From: Sven Dietrich <Sven_Dietrich@trimble.com>
+
+1999-10-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwvb.c:
+ * ntpd/refclock_usno.c:
+ * ntpd/refclock_ulink.c:
+ * ntpd/refclock_tpro.c:
+ * ntpd/refclock_pst.c:
+ * ntpd/refclock_parse.c:
+ * ntpd/refclock_palisade.c:
+ * ntpd/refclock_oncore.c:
+ * ntpd/refclock_mx4200.c:
+ * ntpd/refclock_msfees.c:
+ * ntpd/refclock_jupiter.c:
+ * ntpd/refclock_irig.c:
+ * ntpd/refclock_heath.c:
+ * ntpd/refclock_chu.c:
+ * ntpd/refclock_atom.c:
+ * ntpd/refclock_as2201.c:
+ * ntpd/refclock_arc.c:
+ * ntpd/refclock_arbiter.c:
+ * ntpd/refclock_acts.c:
+ * ntpd/ntp_refclock.c:
+ * include/ntp_refclock.h:
+ Bunches of fixes.
+ From: Dave Mills <mills@udel.edu>
+
+1999-10-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver16.htm: New version
+ * ntpd/refclock_bancomm.c: New version
+ From: "Cliff, Gary" <gary.cliff@cdott.com>
+ "Ramasivan, Ganesh" <ganesh.ramasivan@cdott.com>
+
+ * ntpd/refclock_ulink.c (ulink_receive): Cleanup
+ (ulink_poll): Cleanup
+ * ntpd/refclock_atom.c (atom_pps): SunOS timespec/timeval cleanup
+ From: Marc.Brett@westgeo.com
+
+ * INSTALL: Point NT folks at ports/winnt
+ Reported by: Stephen Gildea <gildea@intouchsys.com>
+
+ * include/ntp_stdlib.h: Noise abatement
+ * include/ntpd.h: Noise abatement
+ Reported by: "W. David Higgins" <wdh@grouper.ccur.com>
+
+ * configure.in: DECL_STDIO_0 with gcc under solaris.
+
+ * include/l_stdlib.h: DECL_TOUPPER_0
+ DECL_STRERROR_0
+
+ * configure.in: Fix a bunch of implicit declarations for SunOS
+
+ * html/release.htm: cleanup - we still provide MD5.
+ Reported by: Winslowe Lacesso <lacesso@cs.ubc.ca>
+
+1999-10-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c:
+ * ntpd/refclock_atom.c:
+ * ntpd/ntp_refclock.c:
+ PPS API code updated to the current spec
+ From: Dave Mills
+
+ * configure.in (ac_cv_make_tickadj): Don't make tickadj starting
+ with solaris2.5
+ Requested by: Dave Mills
+
+1999-10-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: We might need -lsocket for the -lnsl check.
+
+1999-09-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_ulink.c: Typos in C++ comment
+ Reported by: Thomas.Tornblom@Sun.SE
+
+ * configure.in: 4.0.98a
+
+ * ntpd/ntp_config.c (getconfig): Fix typo.
+ From: "David E. Myers" <dem@skyline.rtp.nc.us>
+ From: David Godfrey <dave@delta.demon.co.uk>
+ From: Geoffrey Sisson <geoff@nominet.org.uk>
+
+1999-09-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98
+
+ NetInfo support:
+
+ * config.guess
+ * config.sub
+ Add Mac OS (versions 10 and up).
+
+ * acconfig.h
+ * config.h.in
+ * configure.in
+ Check for NetInfo API; add HAVE_NETINFO macro and friends.
+
+ * include/ntp.h
+ * ntpd/ntp_config.c
+ * ntpdate/ntpdate.c
+ Add support for reading configuration from NetInfo.
+
+ * ntpd/ntp_config.c
+ Get rid of unnecessary eol variable in tokenizer.
+
+ * html/notes.htm
+ * html/ntpd.htm
+ * html/ntpdate.htm
+ Document NetInfo functionality.
+
+ * util/tickadj.c
+ Use HAVE_KVM_OPEN conditional around kvm.h include.
+
+ From: Wilfredo Sanchez <wsanchez@apple.com>
+
+1999-09-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * acconfig.h:
+ * config.h.in:
+ * configure.in:
+ * html/driver34.htm:
+ * html/refclock.htm:
+ * include/ntp.h:
+ * libntp/clocktypes.c:
+ * ntpd/Makefile.am:
+ * ntpd/ntp_control.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_ulink.c:
+ Ultralink driver
+ From: Dave Strout <dstrout@linuxfoundary.com>
+
+1999-09-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: ReliantUNIX patches
+ From: Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
+
+ * ntpd/refclock_atom.c: PPS cleanup
+ * ntpd/ntp_refclock.c (refclock_ioctl): PPS cleanup
+ From: Dave Mills <mills@udel.edu>
+
+ * ntptrace/ntptrace.c (ReceiveBuf): addserver() can return NIL.
+ Reported by: "Alan J. Wylie" <alanw@cyrano.com>
+
+ * libntp/ieee754io.c:
+ * ntpd/ntp_proto.c:
+ * ntpd/ntp_refclock.c:
+ Lint cleanup.
+ From: Marc.Brett@westgeo.com
+
+1999-09-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_refclock.c (refclock_ioctl): Declaration cleanup.
+
+ * ntpd/ntp_proto.c (init_proto): msyslog kern_enable at LOG_DEBUG.
+
+ * ntpd/refclock_atom.c: Add missing declaration.
+
+1999-09-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_make_ntptime): Just look for struct
+ ntptimeval, not timespec or nsec (Solaris 2.7 should get ntptime
+ and it uses msec).
+ (ac_cv_var_oncore_ok): Reorder so it's a "normal" clock
+
+ * configure.in: Solaris Kernel FLL bug fixed in 106541-07
+
+1999-09-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.97f
+
+ * ntptrace/ntptrace.c:
+ * ntpdate/ntptimeset.c:
+ * ntpdate/ntptime_config.c:
+ * ntpdate/ntpdate.c:
+ * util/ntptime.c:
+ * parseutil/dcfd.c:
+ * libparse/parsestreams.c:
+ * libparse/parse_conf.c:
+ * libparse/parse.c:
+ * libparse/clk_varitext.c:
+ * libparse/clk_trimtsip.c:
+ * libparse/clk_trimtaip.c:
+ * libparse/clk_schmid.c:
+ * libparse/clk_rcc8000.c:
+ * libparse/clk_rawdcf.c:
+ * libparse/clk_meinberg.c:
+ * libparse/clk_hopf6021.c:
+ * libparse/clk_dcf7000.c:
+ * libparse/clk_computime.c:
+ * libntp/msyslog.c:
+ * libntp/iosignal.c:
+ * libntp/syssignal.c:
+ * adjtimed/adjtimed.c:
+ * ntpd/refclock_shm.c:
+ * ntpd/refclock_parse.c:
+ * ntpd/refclock_palisade.c:
+ * ntpd/refclock_mx4200.c:
+ * ntpd/refclock_jupiter.c:
+ * ntpd/refclock_datum.c:
+ * ntpd/ntpd.c:
+ * ntpd/ntp_util.c:
+ * ntpd/ntp_timer.c:
+ * ntpd/ntp_request.c:
+ * ntpd/ntp_refclock.c:
+ * ntpd/ntp_monitor.c:
+ * ntpd/ntp_loopfilter.c:
+ * ntpd/ntp_io.c:
+ * ntpd/ntp_intres.c:
+ * ntpd/ntp_filegen.c:
+ * include/l_stdlib.h:
+ <errno.h> and errno declaration cleanup.
+
+ * ntpd/map_vme.c: cleanup some spacing.
+
+1999-09-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.97e
+
+ * configure.in (ac_cv_struct_sigaction_has_sa_sigaction):
+ * acconfig.h: Ditto
+ * parseutil/dcfd.c (main): Use it.
+ From: HOSAKA Eiichi <HOSAKA.Eiichi@dd.anritsu.co.jp>
+
+1999-08-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.97d
+
+ * include/ntp_stdlib.h: Clean up previous NeXT patch.
+ From: Jack Bryans <jbryans@csulb.edu>
+
+ * ntpd/refclock_parse.c: Permit RTS to power a DCF77.
+ From: Carsten Paeth <calle@calle.in-berlin.de>
+
+ * ntpd/refclock_oncore.c (oncore_start): This makes the Oncore run
+ on systems without hardpps().
+ From: Poul-Henning Kamp <phk@freebsd.org>
+
+1999-08-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.97c
+
+ * configure.in (ac_cv_make_ntptime): Typo.
+ From: Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>
+
+1999-08-26 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.97b
+
+ * libntp/iosignal.c:
+ * ntpd/ntp_peer.c:
+ * ntpd/refclock_nmea.c:
+ * ntpdate/ntptime_config.c:
+ * ntpdate/ntptimeset.c:
+ AIX, Irix, and SunOS lint cleanup
+ From: Marc.Brett@westgeo.com
+
+1999-08-24 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in 4.0.97a
+
+ * configure.in (AC_OUTPUT): added scripts/Makefile
+ * Makefile.am (SUBDIRS): Added scripts
+ * scripts/Makefile.am: Added
+
+1999-08-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_nmea.c: Patches for:
+ Trimble OEM Ace-II receiver. Low cost PCB with single
+ voltage input, external active antenna and two serial
+ ports with either NMEA and ITAPs output. Programmable
+ to be tuned for 'time' accuracy in fixed station config.
+ From: Nick Hibma <nick.hibma@jrc.it>
+
+1999-08-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c: Added listen_to_virtual_ips support (-L flag)
+ * ntpd/ntp_io.c: Ditto
+
+1999-08-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_intres.c (request): Lint cleanup
+ * ntpd/ntp_control.c (ctl_putclock): Ditto
+ * libntp/recvbuff.c (getrecvbufs): Ditto
+ (get_free_recv_buffer): Ditto
+ * libntp/systime.c (adj_systime): Ditto
+
+1999-08-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.97
+
+ * libntp/systime.c:
+ * ntpd/ntp_loopfilter.c:
+ * ntpd/ntpd.c:
+ * ports/winnt/libntp/nt_clockstuff.c:
+ From: Sven Dietrich <Sven_Dietrich@trimble.com>
+
+ * README.cvs: Updated.
+
+ * configure.in:
+ * include/ntp_machine.h:
+ * libntp/mexit.c:
+ * ntpd/ntp_config.c:
+ * ntpd/ntp_peer.c:
+ * ntpd/ntp_restrict.c:
+ * ntpd/refclock_arc.c:
+ * ntpdate/ntpdate.c:
+ Irix, SunOS, AIX, lint patches
+ From: Marc.Brett@westgeo.com
+
+ * util/ansi2knr.c: New release (fix for bug reported by Marc Brett)
+ From: "L. Peter Deutsch" <ghost@aladdin.com>
+
+ * include/ntp_stdlib.h: NeXT portability patch
+ From: Jack Bryans <jbryans@csulb.edu>
+
+ * configure.in:
+ * dot.emacs: (cleanup)
+ * ntpdate/Makefile.am:
+ * ntpdate/ntpdate.h:
+ * ntpdate/ntptime_config.c:
+ * ntpdate/ntptimeset.c:
+ ntptimeset patches.
+ From: Jeffrey Hutzelman <jhutz@cmu.edu>
+
+ * ntpd/refclock_parse.c (local_input): ts.l_ui -> ts.fp.l_ui
+
+1999-08-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.96p1
+
+ * ntpd/ntpd.c (sys/resource.h): Include this file only #if
+ HAVE_SYS_RESOURCE_H.
+ (set_process_priority): Use TIOCNOTTY only if it is #define'd.
+ * ntpd/refclock_parse.c (STREAM): STREAM does not imply HAVE_TERMIOS.
+ (termios.h, termio.h, fcntl.h): Do not include those files here;
+ they are already included by ntp_refclock.h or ntp_io.h.
+ * ntpd/refclock_leitch.c (sgtty.h, termios.h, termio.h): Do not
+ include those files here; they are already included by ntp_refclock.h.
+ * ntpdate/ntpdate.c (sys/resource.h) : Include that file only #if
+ HAVE_RESOURCE_H.
+ From: Philippe De Muyter <phdm@macqel.be>
+
+ * ntptrace/ntptrace.c (input_handler): Make it a "normal" function
+ definition.
+ Reported by: GIANNI_CATANIA@hp-italy-om6.om.hp.com
+
+ * configure.in: pc-cygwin32 -> pc-cygwin* because of a change in
+ B20.
+ From: Stephen Gildea <gildea@intouchsys.com>
+
+1999-08-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.96
+
+ * parseutil/dcfd.c (main): Replace SA_ONSTACK and SV_ONSTACK with
+ HAVE_SIGACTION and HAVE_SIGVEC, respectively. HP-UX provides both
+ of the former but only one of the latter...
+
+1999-08-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Better tests for -lnsl and -lsocket
+ From: Albert Chin-A-Young <china@thewrittenword.com>
+
+ Works for me - handle openlog() and -lgen the same way.
+
+ * Makefile.am (EXTRA_DIST): Add in the y2k notes
+
+ * parseutil/dcfd.c: Renamed drift_comp to accum_drift
+
+ * configure.in: Added MAKE_CHECK_Y2K support; check_y2k needs libparse.
+ * ntpd/Makefile.am (check_PROGRAMS): Use MAKE_CHECK_Y2K
+ * ntpd/Makefile.am (check-local): Added.
+ * parseutil/Makefile.am (check-local): Added.
+
+ * include/ntp.h: Y2KFixes
+ * libparse/parse.c: Ditto
+ * ntpd/Makefile.am (check_PROGRAMS): Ditto
+ * ntpd/refclock_acts.c: Ditto
+ * ntpd/refclock_arc.c (arc_receive): Ditto
+ * ntpd/refclock_heath.c: Ditto
+ * ntpd/refclock_hpgps.c: Ditto
+ * parseutil/Makefile.am (check-local): Ditto
+ * parseutil/dcfd.c (check_y2k): Ditto
+ * NOTES.y2kfixes: Ditto
+ * readme.y2kfixes: Ditto
+ * results.y2kfixes: Ditto
+ * ntpd/check_y2k.c: Ditto
+ From: y2k@y2k.labs.att.com
+
+1999-08-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Look for sys/ppstime.h.
+
+1999-07-31 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_io.c (create_sockets): Typo.
+ From: Doug Wells <dmw@contek.com>
+
+1999-07-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_struct_ntptimeval): Explicitly look for
+ struct ntptimeval.
+ (ac_cv_var_kernel_pll): Require struct ntptimeval.
+ Linux. Grrr.
+ Reported by: Ronald Kuetemeier <ronaldk@smginc.com>
+
+1999-07-27 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.95
+
+ * ports/winnt: New release
+ From: Sven Dietrich <Sven_Dietrich@trimble.com>
+
+1999-07-26 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/machines.c (ntp_set_tod): Bugfix
+ From: Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
+
+1999-07-25 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.94b
+
+ * acconfig.h:
+ * configure.in:
+ * libparse/Makefile.am:
+ * libparse/parse_conf.c:
+ * libparse/clk_varitext.c:
+ * libparse/kclk_varitext.c:
+ * ntpd/refclock_parse.c: VARITEXT parse clock
+ * ntpdate/ntpdate.c: bugfix
+ From: Tony McConnell <tonym@datel-technology.co.uk>
+
+1999-07-24 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_syscall.h (ntp_gettime): Make it static
+ * configure.in: Added AC_C_INLINE
+ Reported by: "Charles C. Fu" <ccwf@klab.caltech.edu>
+
+1999-07-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntpd.h:
+ * libntp/machines.c:
+ * libntp/systime.c:
+ * ntpd/ntp_config.c:
+ * ntpd/ntp_filegen.c:
+ * ntpd/ntp_io.c:
+ * ntpd/ntp_proto.c:
+ * ntpd/ntp_timer.c:
+ * ntpdate/ntpdate.c: Windows NT port cleanup
+ From: Sven Dietrich <Sven_Dietrich@trimble.com>
+
+1999-07-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/authkeys.c:
+ * libntp/ieee754io.c:
+ * libntp/iosignal.c:
+ * libntp/machines.c:
+ * libntp/mexit.c:
+ * libntp/recvbuff.c:
+ * ntpd/ntp_filegen.c:
+ * ntpd/ntp_loopfilter.c:
+ * ntpd/ntp_request.c:
+ * ntpd/ntp_timer.c:
+ * ntpd/ntpd.c: Compile/lint cleanup
+ From: Allen Smith <easmith@beatrice.rutgers.edu>
+
+1999-07-21 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.94a
+
+ * configure.in (ac_cv_make_ntptime): Add tv_nsec check.
+
+ * include/Makefile.am (noinst_HEADERS): Forgot ntp_syscall.h
+ From: John.Hay@mikom.csir.co.za
+
+ * configure.in: 4.0.94
+
+ * Makefile.am (SUBDIRS): librsaref
+ (dist-hook): Lose CVS subdirs in the distribution tarball
+
+ * include/Makefile.am (noinst_HEADERS): Added iosignal.h, recvbuff.h
+
+ * Makefile.am (dist-hook): Don't call dos2unix anymore
+
+1999-07-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * acconfig.h:
+ * util/ntptime.c: FreeBSD nano patches
+ From: Per Hedeland <per@erix.ericsson.se> and
+ Allen Smith <easmith@beatrice.rutgers.edu>
+
+ * include/ntp.h:
+ include/ntp_fp.h:
+ include/ntp_io.h:
+ include/ntp_machine.h:
+ include/ntp_refclock.h:
+ include/ntp_stdlib.h:
+ include/ntpd.h:
+ libntp/Makefile.am:
+ libntp/emalloc.c:
+ libntp/machines.c:
+ libntp/mexit.c:
+ libntp/msyslog.c:
+ libntp/statestr.c:
+ libntp/syssignal.c:
+ libntp/systime.c:
+ libparse/parse.c:
+ libparse/parse_conf.c:
+ ntpd/ntp_control.c:
+ ntpd/ntp_intres.c:
+ ntpd/ntp_io.c:
+ ntpd/ntp_proto.c:
+ ntpd/ntp_refclock.c:
+ ntpd/ntp_request.c:
+ ntpd/ntp_timer.c:
+ ntpd/ntp_util.c:
+ ntpd/ntpd.c:
+ ntpd/refclock_nmea.c:
+ ntpd/refclock_palisade.c:
+ ntpd/refclock_palisade.h:
+ ntpd/refclock_shm.c:
+ ntpdate/ntpdate.c:
+ ntptrace/ntptrace.c: Cleanup
+ * libntp/recvbuff.c:
+ libntp/iosignal.c:
+ include/iosignal.h:
+ include/recvbuff.h: Added
+ From: Sven_Dietrich@Trimble.COM
+
+ * README: Add README.cvs
+
+ * configure.in (ac_cv_var_struct_ntptime_val_timespec): Typo.
+ From: John Hay <jhay@mikom.csir.co.za>
+
+1999-07-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Makefile.am (EXTRA_DIST): Lose ntpmak; "build" does a better job.
+
+ * ntpq/Makefile.am (version.o): Use mkver
+ * ntptrace/Makefile.am (version.o): Ditto
+ * ntpdate/Makefile.am (version.o): Ditto
+ * ntpd/Makefile.am (version.o): Ditto
+ * ntpdc/Makefile.am (version.o): Ditto
+
+ * configure.in (AC_OUTPUT): scripts/mkver
+
+ * scripts/mkver.in: Created. Note RSAREF in the version string
+
+1999-07-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * README.des: Updated.
+
+ * ntpq/Makefile.am (LDADD): Add LIBRSAREF
+
+ * ntpdc/Makefile.am (LDADD): Add LIBRSAREF
+
+ * ntpdate/Makefile.am (LDADD): Add LIBRSAREF
+
+ * ntpd/Makefile.am (LDADD): Add LIBRSAREF
+
+ * configure.in (AC_OUTPUT): Added librsaref/Makefile
+ Added tests for making/using librsaref.a
+ Lose old DES stuff; AC_DEFINE(DES) if we find the rsaref stuff.
+
+1999-07-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_trak.c (trak_receive): disambiguate expression.
+ At least now it is unambiguous. It may even still be correct.
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntp_update (UPDATE_OPTIONS): Typo.
+
+1999-07-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntp_update: Check out copyright.htm before COPYRIGHT
+
+ * ntpd/ntp_config.c: Support for PPS assert/clear/hardpps
+ * ntpd/ntp_refclock.c (refclock_ioctl): Ditto
+ (refclock_gtlin): Ditto
+ * html/clockopt.htm: Document.
+ From: John Hay <jhay@mikom.csir.co.za>
+
+ * html/monopt.htm: We have four types of files now
+ * ntpd/refclock_oncore.c: If debug is on, tell when
+ we are waiting for a valid almanac
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+
+ * include/ntp_machine.h (HAVE_TERMIOS): STREAMS does not imply
+ HAVE_TERMIOS !!!
+ * include/parse.h (timercmp): Macro defined if needed.
+ * ntpd/ntp_config.c (SIGCHLD): Macro defined as SIGCLD if needed.
+ (sys/wait.h): File included only if HAVE_SYS_WAIT_H.
+ * configure.in (sys/wait.h): File added to AC_CHECK_HEADERS list.
+ From: Philippe De Muyter <phdm@macqel.be>
+
+1999-06-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_irig.c (irig_debug): NetBSD patches
+ From: Frederick Bruckman <fb@enteract.com>
+
+ * util/ntptime.c (main): ntx.freq bugfix (-f option)
+ From: Frederick Bruckman <fb@enteract.com>
+
+1999-06-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Fix typo with DECL_H_ERRNO test
+
+ * ntpd/ntp_loopfilter.c: Lose syscall decl, it's handled in
+ l_stdlib.h now.
+ * ntpd/ntp_request.c: Ditto
+ * util/ntptime.c: Ditto
+
+Mon May 31 18:49:49 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpd/ntp_proto.c (proto_config): Don't set sys_bclient on
+ PROTO_MULTICAST_ADD, only caller can decide; remove wrong set on
+ PROTO_MULTICAST_DEL.
+
+Mon May 31 18:49:49 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpd/refclock_parse.c (stream_receive): Cast size_t to int to
+ match format.
+ (local_receive): Likewise.
+ (trimbletaip_event): Likewise.
+ (stream_receive): Cast struct timeval members to long to match
+ format.
+ (local_receive): Likewise.
+
+ * ntpd/ntp_util.c (stats_config): Cast size_t to int to match
+ format.
+
+ * libparse/clk_rawdcf.c (cvt_rawdcf): Cast ptr difference to int
+ to match format.
+ * ntpd/refclock_parse.c (gps16x_poll): Likewise.
+
+ * ntpd/ntp_filegen.c (filegen_open): Use long format, cast arg to
+ match.
+
+ * ntpd/refclock_parse.c (list_err): Use long format to match arg.
+ (parse_statistics): Likewise.
+ (gps16x_message): Likewise.
+ (cvt_ts): Use long format, cast args to match.
+ (parse_start): Add missing arg.
+ (gps16x_message): Swap args to match format.
+
+ * ntpd/ntpd.c (ntpdmain): Cast uid to long, adapt format.
+
+ * ntpd/ntp_intres.c (readconf): Use long format to match arg.
+ * ntpd/ntp_io.c (getrecvbufs): Likewise.
+ * ntpd/ntp_proto.c (default_get_precision): Likewise.
+
+ * ntpd/ntp_loopfilter.c (local_clock): Cast clock_panic to int to
+ match format.
+
+ * ntpd/ntp_io.c (io_multicast_add): Print s_addr member, not
+ struct in_addr, to match format.
+
+ * include/ntp_stdlib.h: Declare msyslog() as printf-like for gcc
+ format checking.
+
+Fri May 28 16:39:35 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpdc/ntpdc_ops.c (iostats): Align timereset line.
+
+ * ntpq/ntpq_ops.c (doopeers): Properly align header.
+
+ * ntpdc/ntpdc_ops.c (debug): Removed declaration, already in
+ ntp_stdlib.h.
+ * ntpq/ntpq_ops.c: Likewise.
+
+ * ntpdate/ntpdate.c (debug): Declare volatile to match
+ ntp_stdlib.h.
+ * ntpdc/ntpdc.c, ntpq/ntpq.c, ntptrace/ntptrace.c, util/tickadj.c,
+ util/ntptime.c: Likewise.
+
+ * include/parse.h (debug): Don't declare to avoid clash with
+ ntp_stdlib.h.
+
+ * include/Makefile.am (noinst_HEADERS): Add new ntp_syscall.h.
+
+ * configure.in: Also check for -lrt for POSIX.1c functions.
+
+Wed May 26 21:03:30 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Removed -Wwrite-strings from CFLAGS.
+
+ * ntpdc/ntpdc.c (help): Remove superfluous cast.
+ * ntpq/ntpq.c (help): Likewise.
+
+Tue May 25 18:00:49 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpq/ntpq_ops.c (struct varlist): name cannot be const char *
+ since it may be malloc'ed.
+
+ * ntpdc/ntpdc.c (sendrequest): Declare pass as const char *, don't
+ lose const in cast.
+ * ntpq/ntpq.c (sendrequest): Likewise.
+
+ * ntpd/ntp_control.c (ctl_getitem): Remove superfluous cast.
+ * include/ntpd.h (struct ctl_var): text cannot be const char *
+ since it's malloc'ed.
+
+1999-06-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/l_stdlib.h: Don't include <netinet/in.h>, add forward
+ declaration of struct in_addr instead.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ Patch:
+
+ * include/l_stdlib.h: Fixed syscall() declaration.
+ * configure.in: Updated test to match.
+
+ * configure.in: Check if we need to declare errno and h_errno.
+ Check for <resolv.h> which may provide a h_errno declaration and
+ <arpa/nameserv.h> which the latter needs.
+ * acconfig.h: Provide the necessary templates.
+
+ * include/ntp_syscall.h: New file, hides various implementations
+ of ntp_adjtime() and ntp_gettime() syscalls.
+ * ntpd/ntp_loopfilter.c: Use it.
+ * ntpd/ntp_request.c: Likewise.
+ * ntpd/refclock_local.c: Likewise.
+ * util/ntptime.c: Likewise.
+
+ * include/l_stdlib.h: Include <netinet/in.h>, declare inet_ntoa if
+ necessary.
+ Moved syscall() declaration here.
+
+ * kernel/sys/parsestreams.h: Include <sys/termios.h> for it's
+ definition of struct ppsclockev.
+ Include <sys/ppsclock.h> unconditionally for definition of
+ CIOGETEV via TIOCGPPSEV.
+ * kernel/sys/ppsclock.h: Protect struct ppsclockev from
+ redefinition.
+
+ * include/ntp_refclock.h: Protect it from multiple inclusion.
+ * include/ntp_fp.h: Likewise.
+ * include/ntp.h: Likewise.
+
+ * include/ntpd.h: Include ntp_refclock.h for MAXDIAL declaration.
+ * libntp/authkeys.c: Include ntpd.h for current_time declaration.
+
+ * include/ntpd.h (getauthkeys, auth_agekeys, rereadkeys): Moved
+ prototypes to ntp_stdlib.h
+
+ * include/ntp_stdlib.h: Declare variables exported by libntp.
+ * include/ntpd.h: Likewise for ntpd.
+
+ * libntp/authkeys.c (key_hash, authnokey, authfreekeys,
+ cache_flags): Made static.
+ * libntp/systime.c (tvu_maxslew, tsf_maxslew, sys_clock_offset,
+ sys_residual): Likewise.
+ * ntpd/ntp_intres.c (confentries): Likewise.
+ * ntpd/ntp_loopfilter.c (clock_offset, clock_panic): Likewise.
+ (pll_nano): Likewise. Removed duplicate definition.
+ * ntpd/ntp_peer.c (peer_free, current_association_ID,
+ assocpeer_calls, init_peer_starttime): Likewise.
+ * ntpd/ntp_proto.c (sys_offset, sys_authdly): Likewise.
+ * ntpd/ntp_request.c (numrequests, numresppkts, errorcounter):
+ Likewise.
+ * ntpd/ntp_restrict.c (res_calls, res_found, res_not_found,
+ res_timereset, res_limited_refcnt): Likewise.
+ * ntpd/ntpd.c (was_alarmed, worker_thread): Likewise.
+
+ * ntpq/ntpq_ops.c: Moved declaration of external variable from
+ ntpq.c to file scope.
+
+ * adjtimed/adjtimed.c: Moved declarations of external variables to
+ ntpd.h and ntp_stdlib.h.
+ * clockstuff/propdelay.c: Likewise.
+ * libntp/a_md5encrypt.c, libntp/authencrypt.c, libntp/authkeys.c,
+ libntp/mfp_mul.c, libntp/msyslog.c, libntp/systime.c: Likewise.
+ * ntpd/ntp_config.c, ntpd/ntp_control.c, ntpd/ntp_filegen.c,
+ ntpd/ntp_intres.c, ntpd/ntp_io.c, ntpd/ntp_loopfilter.c,
+ ntpd/ntp_monitor.c, ntpd/ntp_peer.c, ntpd/ntp_proto.c,
+ ntpd/ntp_refclock.c, ntpd/ntp_request.c, ntpd/ntp_restrict.c,
+ ntpd/ntp_timer.c, ntpd/ntp_util.c, ntpd/ntpd.c,
+ ntpd/refclock_acts.c, ntpd/refclock_arbiter.c, ntpd/refclock_arc.c,
+ ntpd/refclock_as2201.c, ntpd/refclock_atom.c,
+ ntpd/refclock_bancomm.c, ntpd/refclock_chronolog.c,
+ ntpd/refclock_chu.c, ntpd/refclock_datum.c,
+ ntpd/refclock_dumbclock.c, ntpd/refclock_gpsvme.c,
+ ntpd/refclock_heath.c, ntpd/refclock_hpgps.c, ntpd/refclock_irig.c,
+ ntpd/refclock_jupiter.c, ntpd/refclock_leitch.c,
+ ntpd/refclock_local.c, ntpd/refclock_msfees.c,
+ ntpd/refclock_mx4200.c, ntpd/refclock_nmea.c,
+ ntpd/refclock_oncore.c, ntpd/refclock_palisade.h,
+ ntpd/refclock_parse.c, ntpd/refclock_pst.c, ntpd/refclock_shm.c,
+ ntpd/refclock_tpro.c, ntpd/refclock_trak.c, ntpd/refclock_true.c,
+ ntpd/refclock_usno.c, ntpd/refclock_wwvb.c: Likewise.
+ * ntpdate/ntpdate.c: Likewise.
+ * ntpdc/ntpdc.c, ntpdc/ntpdc_ops.c: Likewise.
+ * ntpq/ntpq.c: Likewise.
+ * ntptrace/ntptrace.c: Likewise.
+ * util/ntptime.c, til/tickadj.c: Likewise.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * include/ntp_machine.h: Removed superfluous yy/mm/dd comments.
+ * include/ntpd.h: Likewise.
+ * libntp/authencrypt.c: Likewise.
+ * libntp/a_md5encrypt.c: Likewise.
+ * libntp/caljulian.c: Likewise.
+ * libntp/ymd2yd.c: Likewise.
+ * libntp/syssignal.c: Likewise.
+ * libntp/ymd2yd.c: Likewise.
+ * ntpd/ntp_control.c: Likewise.
+ * ntpd/ntp_io.c: Likewise.
+ * ntpd/ntp_timer.c: Likewise.
+ * ntpdate/ntpdate.c: Likewise.
+ * ntpq/ntpq_ops.c: Likewise.
+ * ntpd/ntp_peer.c (findpeer): Wrap debug output in DEBUG/debug.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * dot.emacs: Removed wrong indentation of substatements.
+ Wrap in c-style.
+ From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpd/refclock_palisade.c: Patches from Marc Brett
+ * ntpd/refclock_palisade.h: Ditto.
+ * util/hist.c: Ditto.
+
+Tue Jun 1 00:40:04 1999 Harlan Stenn <stenn@pogo.udel.edu>
+
+ * build: mips-dec-ultrix4.4 hates "set -e"
+
+ * flock-build: Created
+
+ * build: added -l option
+
+Mon May 31 20:28:40 1999 Harlan Stenn <stenn@pogo.udel.edu>
+
+ * README: Removed auto{make,conf}.patch files
+
+Tue May 25 01:20:53 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Makefile.am ($(srcdir)/COPYRIGHT): Added
+ (EXTRA_DIST): Remove auto*.patches
+
+Thu May 20 01:03:00 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Makefile.am (dist-hook): Call dos2unix on the .htm files
+
+ * ntpd/refclock_palisade.h: Clean up declarations.
+
+ * configure.in (ac_cv_struct_ntptimeval_timespec): Added.
+ (ac_cv_make_ntptime): Only if ntptimeval does not use timespec.
+
+ * util/tickadj.c: Linux Patches
+ From: Reg Clemens <reg@dwf.com>
+
+Wed May 19 01:18:24 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.93a
+
+ * ntpd/refclock_palisade.h: Restore some lost patches
+ From: Kamal A Mostafa <kamal@whence.com>
+
+Sun May 16 13:18:32 1999 Philippe De Muyter <phdm@macqel.be>
+
+ * libparse/clk_wharton.c (cvt_wharton_400a, inp_wharton_400a): Expect
+ serial output format number 1, not 5.
+ (clock_wharton_400a) : Likewise.
+ * ntpd/refclock_parse.c (parse_clockinfo): For Wharton 400a clock,
+ do not poll, but expect a message every second.
+ * html/parsedata.htm : Entry added for Wharton 400a clock.
+ * html/driver8.htm : Entry fixed for Wharton 400a clock.
+
+Sun May 16 02:59:46 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.93
+
+Sat May 15 18:53:47 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ntp_refclock): ONCORE requires PPSAPI, CIOGETEV,
+ or TIOCGPPSEV.
+ Reported by: Reg Clemens <reg@dwf.com>
+
+Fri May 14 23:58:35 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92h2
+
+ * configure.in (ac_cv_make_ntptime): Not under Linux. Yes, it
+ works for some people. We're tired of the complaints from the
+ others.
+
+Fri May 14 18:58:59 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * libntp/authreadkeys.c (authreadkeys): Reject autokey keys.
+ Include ntp.h for NTP_MAXKEY definition, ntp_fp.h for types used
+ in ntp.h.
+
+Wed May 12 23:02:22 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * libntp/authkeys.c (auth_delkeys): Don't remove autokey keys,
+ leave info on KEY_TRUSTED flag alone.
+ Include ntp.h for NTP_MAXKEY definition.
+
+Thu May 13 02:19:02 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92h1
+
+ * configure.in: patch for ReliantUNIX
+ From: Andrej Borsenkow <borsenkow.msk@sni.de>
+
+ * ntpd/refclock_oncore.c: Patches
+ From: Reg Clemens <reg@dwf.com>
+
+Thu Apr 29 14:01:04 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * html/*.htm: Remove unnecessary &nbsp;. Cleanup <pre></pre>
+ sections.
+
+ * configure.in: Properly align configure --help output.
+ * html/config.htm: Include this version, removing Netscape &nbsp;
+ cruft.
+
+Wed Apr 28 15:08:55 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * kernel/sys/parsestreams.h: Only include <sys/ppsclock.h> if
+ struct ppsclockev is missing from system headers.
+
+ * util/tickadj.c (getoffsets): Define kernels[] only if used.
+ (openfile): Rename fd to avoid shadowing global fd.
+ (writevar): Likewise.
+ (readvar): Likewise.
+
+ * parseutil/dcfd.c (read_drift): drift_file is const char *.
+ (update_drift): Likewise.
+ (adjust_clock): Likewise.
+ (main): Likewise.
+
+ * ntpd/refclock_parse.c (gps16x_poll): Adapt format to match
+ parse->localstate type.
+
+ * ntpd/ntp_refclock.c (refclock_gtlin): Only define gotit label
+ if used.
+
+ * include/l_stdlib.h (openlog, syslog): char * args are const.
+
+ * configure.in (*-*-osf4*): Enable declaration of stime().
+
+ * ntpd/refclock_oncore.c (oncore_msg_any): Cast args to long to
+ match prototype.
+ (oncore_msg_En): Likewise.
+
+ * include/ntp_refclock.h (struct refclockstat): Declare p_lastcode
+ as const char *.
+
+ * ntpq/ntpq_ops.c (struct varlist): Define name as const.
+
+ * ntpdc/ntpdc.c (tokenize): Define cp as const char *, remove
+ wrong cast instead.
+
+ * ntpd/ntp_util.c (record_clock_stats): Make text arg const.
+ * include/ntpd.h (record_clock_stats): Adapt declaration.
+ * ntpd/refclock_oncore.c (oncore_start): Removed superfluous casts.
+ (oncore_msg_Cf): Likewise.
+ (oncore_msg_Fa): Likewise.
+ (oncore_msg_Cj): Likewise.
+ (oncore_msg_Ea): Likewise.
+ (oncore_msg_Bj): Likewise.
+
+ * configure.in (*-*-solaris2.4): Enable declarations of
+ gettimeofday(), settimeofday(); they are `protected' by
+ __cplusplus in <sys/time.h>.
+
+Tue Apr 27 21:14:47 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * scripts/summary.pl: Use . as default statsdir.
+ (do_loop): Accept new loopstats format with additional sys_error
+ and clock_stability fields.
+ (do_peer): Accept new peerstats format with additional skew field.
+
+Mon Apr 26 01:50:38 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Upgraded automake (1.4a) and autoconf (2.14.1)
+
+ * configure.in (ac_refclock_irig): We no longer need stropts.h.
+ * ntpd/refclock_irig.c: Ditto
+
+Mon Apr 26 17:33:33 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (*-*-irix6*): Don't pass MIPSpro cc-only flag -n32
+ to gcc.
+
+Thu Apr 22 15:06:40 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ntpd/ntp_config.c (getconfig): IN_CLASSD() expects address in
+ host byte order, but struct sockaddr_in.s_addr is in network byte
+ order.
+ * ntpd/ntp_io.c (io_multicast_del): Likewise.
+
+Sat Apr 24 01:00:53 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92h
+
+ * ntptrace/ntptrace.c: -m maxhost patch
+ From: "R. Gary Cutbill" <rgary@chrysalis.com>
+
+ * util/ntptime.c: Patches.
+ From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * html/accopt.htm, html/assoc.htm, html/authopt.htm,
+ html/biblio.htm, html/build.htm, html/clockopt.htm,
+ html/confopt.htm, html/copyright.htm, html/debug.htm,
+ html/exec.htm, html/extern.htm, html/hints.htm, html/index.htm,
+ html/kern.htm, html/miscopt.htm, html/monopt.htm, html/notes.htm,
+ html/ntpd.htm, html/ntpdate.htm, html/ntpdc.htm, html/ntpq.htm,
+ html/ntptime.htm, html/ntptrace.htm, html/patches.htm,
+ html/porting.htm, html/pps.htm, html/rdebug.htm,
+ html/refclock.htm, html/release.htm, html/tickadj.htm,
+ html/hints/solaris.html: Fixed many typos and problems.
+ * acconfig.h (DECL_CFSETISPEED_0, DECL_MRAND48_0, DECL_NLIST_0,
+ DECL_SRAND48_0, DECL_STIME_0): New templates.
+ * include/l_stdlib.h: Include termios.h to get definition of
+ speed_t.
+ (cfsetispeed, cfsetospeed, mrand48, nlist, srand48, stime): New
+ declarations.
+ (openlog): Declare 2- or 3-argument form.
+ * configure.in: Enable declarations of functions missing from
+ Ultrix V4.3 system headers.
+ * ntpd/refclock_oncore.c: Include <sys/types.h>, Ultrix V4.3
+ <sys/stat.h> needs it for dev_t.
+ From: Rainer Orth <ro@techfak.uni-bielefeld.de>
+
+ * ntpdc/ntpdc_ops.c: Reality checks.
+
+ * configure.in: netbsd has stubs for the timer_* stuff and doesn't
+ support PPSAPI. IRIG requires <stropts.h> .
+ From: Frederick Bruckman <fb@enteract.com>
+
+ * ntpdc/ntpdc_ops.c: (kerninfo) Report in seconds regardless of
+ kernel precision. Report kernel flags as text.
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+
+Sun Apr 18 14:26:51 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92g
+
+ * ntpd/ntp_refclock.c (refclock_ioctl): We don't want
+ PPS_HARDPPSONASSERT by default.
+ * ntpd/refclock_oncore.c: Prefer timepps.h over sys/timepps.h
+ From: Poul-Henning Kamp <phk@freebsd.org>
+
+Tue Apr 13 17:32:35 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92f
+
+ * ntpd/ntp_refclock.c (refclock_open): VMIN should be 1, not 0
+ From: Reg Clemens <reg@dwf.com>
+
+Sun Apr 11 18:26:44 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_mx4200.c: Patches/improvements
+ * ntpd/ntpd.c (set_process_priority): Lint
+ From: Marc.Brett@westgeo.com
+
+ * util/ntptime.c: Lint, bit definition cleanup
+ From: Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>
+
+Wed Apr 7 03:02:23 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c: Use timepps.h or sys/timepps.h
+ * configure.in: Look for either timepps.h or sys/timepps.h
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+
+ * ntpd/ntp_io.c (create_sockets): Don't warn about ENXIO.
+ (Several places)
+ From: Andrej Borsenkow <borsenkow.msk@sni.de>
+
+ * libntp/mfp_mul.c (mfp_mul): Lint.
+ Marc.Brett@westgeo.com
+
+Sun Apr 4 03:23:53 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92e
+ Dave redesigned the clock state machine.
+
+1999-02-28 Frank Kardel <kardel <AT> acm.org>
+
+ * parseutil/dcfd.c: added DCF77 module powersetup
+
+ * ntpd/refclock_parse.c (parse_control): using gmprettydate instead of prettydate()
+ (mk_utcinfo): new function for formatting GPS derived UTC information
+ (gps16x_message): changed to use mk_utcinfo()
+ (trimbletsip_message): changed to use mk_utcinfo()
+ ignoring position information in unsynchronized mode
+ (parse_start): augument linux support for optional ASYNC_LOW_LATENCY
+
+ * ntpd/ntp_control.c (ctl_putclock): cleanup of end of buffer handling
+
+ * libparse/parse.c (timepacket): removed unnecessary code
+
+ * libparse/clk_trimtsip.c (struct trimble): new member t_utcknown
+ (cvt_trimtsip): fixed status monitoring, bad receiver states are
+ now recognized
+
+ * libntp/prettydate.c (gmprettydate): new function for format date
+ and time with respect to UTC
+
+ * libntp/gpstolfp.c (GPSWRAP): update GPS rollover to 990 weeks
+
+ * include/trimble.h (CMD_RUTCPARAM): control variable name unification
+
+ * include/ntp_fp.h: added prototype for gmprettydate()
+
+Sat Feb 27 00:03:16 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/systime.c: definition
+ * ntpd/ntp_proto.c: sco5_oldclock declaration
+ * configure.in: SCO5_CLOCK for *-*-sco3.2v5*
+ * util/tickadj.c (main): SCO5_OLDCLOCK -> SCO5_CLOCK
+ From: Kees Hendrikse <kees@echelon.nl>
+
+ * ntpd/ntp_config.c (getconfig): Indentation cleanup
+ Deal with 'P' case better
+ * ntpd/ntpd.c: Declare set_process_priority()
+ * ntpd/refclock_dumbclock.c: Lint cleanup
+ From: Marc.Brett@westgeo.com
+
+Wed Feb 24 10:22:51 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92d
+
+ * configure.in: Dave says we can't enable PARSE clocks by default.
+ Also, Solaris 2.7 still has its kernel bug - disable kernel FLL
+ there.
+ Reported by: Dave Mills <dlm@udel.edu>
+
+Tue Feb 23 23:37:44 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libparse/Makefile.am (parsesolaris.o): Devious hack to deal
+ with bug in sys/systm.h .
+ Suggested by: Chaim Frenkel <chaimf@pobox.com>
+
+Tue Feb 23 20:46:31 1999 Frank Kardel <kardel <AT> acm.org>
+
+ * ntpd/refclock_parse.c: fixed #endifs
+ (stream_receive): fixed formats
+
+Mon Feb 22 00:35:06 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92c
+
+ * ntpd/refclock_chronolog.c: Lint
+ * ntpd/refclock_dumbclock.c: Ditto
+ * ntpd/refclock_oncore.c: Ditto
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_oncore.c (oncore_msg_any): Call GETTIMEOFDAY, not
+ gettimeofday().
+ From: david.higgins@mail.ccur.com
+
+ * configure.in (MCAST): Not in i386-sequent-sysv4
+ Reported by: Joseph Geter <joe.geter@somills.com>
+
+ * util/ntptime.c: Linux cleanup.
+ From: Reg Clemens <reg@dwf.com>
+
+ * configure.in: Rename SCO5_OLDCLOCK to SCO5_CLOCK
+ * acconfig.h: Ditto
+
+ * ntpd/ntp_proto.c: SCO5_CLOCK stuff
+ (init_proto): Use the SCO5_CLOCK stuff
+ * libntp/systime.c: SCO5_CLOCK stuff
+ (get_systime): Use the SCO5_CLOCK stuff
+ (adj_systime): Use the SCO5_CLOCK stuff
+ From: Kees Hendrikse <kees@echelon.nl>
+
+ * ntpd/ntp_config.c: Added -P option and associated baggage.
+ (getstartup): Update help text
+ (getconfig): Process -P option
+ (getconfig): Update help text
+ * ntpd/ntpd.c (set_process_priority): Created.
+ (service_main): remove process priority stuff - we want to do at
+ after we start up the resolver, so call set_process_priority()
+ after getconfig().
+ From: Kamal A Mostafa <kamal@whence.com>
+
+1999-02-21 Frank Kardel <kardel <AT> acm.org>
+
+ * ntpd/ntp_util.c (hourly_stats): removed unused variable
+
+ * libntp/ieee754io.c: renamed index to fieldindex to avoid index() name clash
+
+ * ntpd/refclock_parse.c (parse_start): add initialization for Linux PPSkit
+
+Sun Feb 21 17:53:33 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_io.c (create_sockets): Skip interfaces that are really
+ just aliases.
+ From: "Erik R. Leo" <erikl@sover.net>
+
+ * configure.in: 4.0.92b
+
+ * ntpd/ntpd.c (service_main): Check for an error return from
+ sched_get_priority_max().
+
+Wed Feb 17 03:48:47 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92a
+
+ * configure.in: configure.in requires autoconf 2.13 or later.
+ Reported by Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>
+
+Wed Feb 17 00:12:11 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * acconfig.h: TERMIOS_NEEDS__SVID3
+ * configure.in: Ditto
+ * ntpd/refclock_palisade.h: Ditto
+ * include/ntp_refclock.h: Ditto
+ * ntpd/ntpd.c (service_main): We want sched_get_priority_max().
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * ntpd/ntp_refclock.c (refclock_open): Zero the entire c_cc[] array.
+ From: Reg Clemens <reg@dwf.com>
+
+Tue Feb 16 23:37:49 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Updated ansi2knr
+ Reported by: Marc Brett
+
+Mon Feb 15 02:55:28 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.92
+
+ * ntpd/ntp_refclock.c: Added refclock_chronolog and
+ refclock_dumbclock.
+ From: Robert McMillin <rlm@syseca-us.com>
+
+Sun Feb 14 15:57:53 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * dropped SCO3 support #defines.
+ * changed SCO5_TICKADJ #define to SCO5_OLDCLOCK
+ * Added code in libntp/systime.c to accumulate changes until a whole
+ tick can be added or dropped. Adjusted gettimeofday() output
+ to include the contents of the accumulator.
+ * cleaned up util/tickadj.c; tickadj -As now does the right thing.
+ From: Kees Hendrikse <kees@echelon.nl>
+
+ * ntpq/ntpq.c: Rename delay() to auth_delay()
+ Reported by: Andrej Borsenkow <borsenkow.msk@sni.de>
+
+ * ntpd/refclock_palisade.h: Cleanup.
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/ntp_refclock.c (refclock_ioctl): Typo.
+ From: Reg Clemens <reg@dwf.com>
+
+ * ntpd/ntp_io.c (create_sockets): Only bind a given network once.
+ From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
+
+Sat Jan 30 11:48:37 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.91f
+
+Thu Jan 28 22:58:40 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_parse.c (CLK_REALTYPE): We really want ttl, not hmode.
+ * ntpd/ntp_config.c (getconfig): "mode" really should update the
+ ttl member, not the hmode member.
+
+ * ntpd/refclock_local.c: More offset cleanup from Dave.
+
+Thu Jan 28 00:15:20 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.91e
+
+ * ntpd/refclock_local.c: Bugfix.
+ From: Dave Mills
+
+ * ntpd/refclock_palisade.c: Lint/IRIX portability cleanup
+ * ntpd/refclock_palisade.h: Re-enable the declaration of float()
+ * ntpd/ntp_io.c (create_sockets): Initialize size to 0
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_parse.c (CLK_REALTYPE): Use hmode, not ttl.
+ * configure.in (ac_cv_var_no_parenb_ignpar): Not under Linux.
+ Reported by: Thomas Quinot <thomas@Cuivre.FR.EU.ORG>
+
+ * ntpdc/ntpdc.c (my_delay): Renamed, from delay.
+ Reported by: Andrej Borsenkow <borsenkow.msk@sni.de>
+
+Tue Jan 26 00:56:10 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.91d
+
+ * ntpq/ntpq.c: Y2K patches
+ From: Marc.Brett@westgeo.com
+
+ * html/driver29.htm: New version
+ * ntpd/refclock_palisade.c: Ditto
+ * ntpd/refclock_palisade.h: Ditto
+ From: Sven_Dietrich@Trimble.COM
+
+ * upgrade ansi2knr.c
+
+ * Some stuff that Dave did.
+
+ * configure.in: 4.0.91c
+
+ * ntpd/refclock_oncore.c: Prototype cleanup. Enum cleanup.
+ * ntpd/ntp_proto.c (clock_select): Fix memory leak.
+ * configure.in (ac_cv_struct_ppsclockev): Might need sys/time.h to
+ check for struct clockppsev. Return pce->serial, not 0;
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_oncore.c (oncore_msg_En): Clean up.
+ From: John.Hay@mikom.csir.co.za
+
+Mon Jan 25 11:50:29 1999 Philippe De Muyter <phdm@macqel.be>
+
+ * libparse/parse_conf.c (clockformats): Entry added for
+ clock_wharton_400a.
+ * libparse/clk_wharton.c: New file.
+ * libparse/Makefile.am (libparse_a_SOURCES): clk_wharton.c added;
+ (libparse_kernel_a_SOURCES): kclk_wharton.c added.
+ (kclk_wharton.o): New dependency rule.
+ * ntpd/refclock_parse.c (parse_clockinfo): Entry added for the
+ WHARTON clock (mode 15).
+ * acconfig.h (CLOCK_WHARTON_400A): New configuration macro.
+ * configure.in (CLOCK_WHARTON_400A): Macro defined like other
+ CLOCK_xxx macros.
+
+Sun Jan 24 13:51:30 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c (do_resolve_internal): Missing #ifdef DEBUG
+ From: Sven Dietrich <Sven_Dietrich@Trimble.COM>
+
+ * Makefile.am (SUBDIRS): Lose authstuff
+ * configure.in: Ditto
+
+Sat Jan 23 15:28:03 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.91b
+
+Sat Jan 23 15:02:25 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c: use HAVE_STRUCT_PPSCLOCKEV
+ * acconfig.h: HAVE_STRUCT_PPSCLOCKEV
+ * configure.in (ac_cv_struct_ppsclockev): Added test
+
+Thu Jan 21 15:35:25 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.91a
+
+ * ntpd/refclock_nmea.c (nmea_receive): Call refclock_process()
+ every second (or each time a nmea string is received).
+ From: John Hay <jhay@mikom.csir.co.za>
+
+ * ntpd/ntp_refclock.c (refclock_ioctl): Use TIOCPPS if we have it.
+ (refclock_ioctl): Use LDISC_CLKPPS, not LDISC_PPS when deciding
+ how to set str.
+ * ntpd/ntp_loopfilter.c: Lose unused ntp_gettime() stuff.
+ * ntpd/ntp_request.c: Ditto.
+ * ntpd/refclock_local.c: Ditto.
+ * ntpd/refclock_shm.c (shm_poll): Fix the refclock_process() call.
+ * ntpd/refclock_oncore.c: patches and cleanup
+ * configure.in: ioctl/PPS checks, ONCORE cleanup
+ * acconfig.h: ONCORE cleanup
+ From: Reg Clemens <reg@dwf.com>
+
+ * configure.in (CFLAGS): cc on Sequent wants -Wc,+abi-socket.
+ We also need to figure out why -lsocket isn't being detected;
+ -lsocket is needed.
+ From: Dana Kaempen <decay@flash.net>
+
+ * include/ntp_stdlib.h: AIX portability patches, header cleanup.
+ * ntptrace/ntptrace.c: Ditto.
+ * ntpdate/ntpdate.c: Ditto.
+ * ntpd/refclock_true.c: Ditto.
+ * ntpd/refclock_mx4200.c: Ditto.
+ * ntpd/refclock_jupiter.c: Ditto.
+ * libntp/msyslog.c: Ditto.
+ From: Marc.Brett@waii.com
+
+Sun Jan 10 15:15:07 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.91
+
+Sat Jan 9 00:11:34 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_stdlib.h: msyslog() is declared differently if we're
+ not __STDC__.
+
+ * include/ntp_types.h: It's HAVE_PROTOTYPES, not USE_PROTOTYPES.
+ * include/ntp_machine.h: Ditto.
+
+Fri Jan 8 20:47:10 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Upgrade to autoconf-2.13
+ Do the prototypes check much earlier, as it might alter CFLAGS and
+ things which will affect other tests.
+
+ * ntpd/ntp_request.c (do_conf): The problem was with a template
+ for "version" on an IRIX C compiler...
+ From: Marc.Brett@waii.com
+
+ * libntp/authkeys.c: #include config.h first.
+ Reported by: brian.bumpass@funb.com
+
+Thu Jan 7 00:24:35 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * util/tickadj.c (main): return() instead of exit().
+ * ntpd/ntp_request.c (do_conf): Disambiguate ||.
+ * ntpd/ntp_proto.c (clock_select): Initialize variables.
+ From: Marc.Brett@waii.com
+
+ * scripts/ntpver.in: Use PATH_SH
+
+ * configure.in (PATH_SH): Added.
+
+Tue Jan 5 19:02:51 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90h
+
+ * html/driver30.htm: Updated.
+ * html/refclock.htm: Refer to driver30
+ * ntpd/refclock_oncore.c: Vastly improve and make less FreeBSD centric,
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk> and
+ Reg.Clemens <reg@dwf.com>
+
+ * include/ntp.h: Portability/lint patches
+ * libntp/binio.c: Ditto.
+ * libntp/caljulian.c: Ditto.
+ * libntp/caltontp.c: Ditto.
+ * libntp/ieee754io.c: Ditto.
+ * libntp/md5c.c: Ditto.
+ * libntp/mfp_mul.c: Ditto.
+ * libntp/msyslog.c: Ditto.
+ * libntp/statestr.c: Ditto.
+ * libntp/systime.c: Ditto.
+ * libparse/clk_trimtsip.c: Ditto.
+ * libparse/data_mbg.c: Ditto.
+ * libparse/parse.c: Ditto.
+ * ntpd/ntp_control.c: Ditto.
+ * ntpd/ntp_filegen.c: Ditto.
+ * ntpd/ntp_intres.c: Ditto.
+ * ntpd/ntp_io.c: Ditto.
+ * ntpd/ntp_peer.c: Ditto.
+ * ntpd/ntp_proto.c: Ditto.
+ * ntpd/ntp_util.c: Ditto.
+ * ntpd/ntpd.c: Ditto.
+ * ntpd/refclock_arc.c: Ditto.
+ * ntpd/refclock_chu.c: Ditto.
+ * ntpd/refclock_datum.c: Ditto.
+ * ntpd/refclock_leitch.c: Ditto.
+ * ntpd/refclock_parse.c: Ditto.
+ * ntpd/refclock_usno.c: Ditto.
+ * ntpq/ntpq.c: Ditto.
+ * util/tickadj.c: Ditto.
+ From: Marc.Brett@waii.com
+
+Mon Jan 4 00:56:55 1999 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90g
+
+ * ntpd/ntp_config.c (getconfig): MODE was setting ttl, not hmode.
+ Reported by: Carsten Emde <ce@ceag.ch>
+
+Fri Dec 4 01:01:14 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90f
+
+ * ntpd/refclock_mx4200.c: New version
+ From: Marc.Brett@waii.com
+
+1998-12-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_config.c (do_resolve_internal): If fork fails, say why.
+ Reported by: Jeff_Dennison@admin.tc.faa.gov
+
+ * ntpd/ntpd.c (ntpdmain): fork() can return a -1. Someday we'll
+ report this condition...
+
+1998-12-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90e
+
+ * ntpd/refclock_palisade.c: Reformat code so ansi2knr will work
+ * ntpd/refclock_palisade.h: Ditto
+ From: Marc.Brett@waii.com
+
+Sun Nov 29 21:00:53 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90d
+
+ * configure.in (CFLAGS): Use "-O2 -g3 -n32" by default for Irix6.2
+ and later.
+ Reported by: Jack Bryans <jbryans@csulb.edu>
+
+1998-11-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90c
+
+ * ntpd/refclock_oncore.c (oncore_msg_En): Convert to nano
+ From: John Hay <jhay@mikom.csir.co.za>
+
+ * include/ntp_request.h (RM_VN_MODE): Add version parameter, so
+ xntpdc will work across v3 and v4.
+ * ntpd/ntp_request.c: Track requested version
+ (req_ack): Use requested version in RM_VN_MODE
+ (more_pkt): Ditto
+ (flush_pkt): Ditto
+ (process_private): Get requested version
+ * ntpd/ntp_intres.c (request): Use default version
+ * ntpdc/ntpdc.c (sendrequest): Ditto
+ From: John Hay <jhay@mikom.csir.co.za>
+
+Fri Nov 27 14:27:21 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_palisade.c: Lint cleanup
+ * ntpd/refclock_palisade.h: Ditto.
+ From: Marc Brett <mbrett@rgs0.london.waii.com>
+
+Mon Nov 23 04:45:03 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90b
+
+ * New code and cleanup for the NT stuff
+ From: Carl Byington <carl@five-ten-sg.com>
+
+Sat Nov 21 21:21:45 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90a
+
+ * libntp/systime.c (step_systime): net_set_tod calls clock_settime.
+ * libntp/machines.c (ntp_set_tod): Take a 2nd arg for NT.
+ * include/ntp_machine.h: ntp_set_tod() has 2 args always.
+ * ports/winnt/bldrel.bat: Typo.
+ From: Carl Byington <carl@five-ten-sg.com>
+
+ * ntpd/ntp_intres.c (findhostaddr): h_errno is a #define under AIX.
+ * configure.in: clock_settime is a stub in AIX4.
+ From: Perry Ross <pross@platinum.com>
+
+ * libntp/Makefile.am (EXTRA_DIST): Lose libntp.mak
+ * ntpd/Makefile.am (EXTRA_DIST): Ditto.
+ * ntpdate/Makefile.am (EXTRA_DIST): Ditto.
+ * ntpdc/Makefile.am (EXTRA_DIST): Ditto.
+ * ntpq/Makefile.am (EXTRA_DIST): Ditto.
+ From: Greg Schueman <schueman@ix.netcom.com>
+
+Sat Nov 21 12:33:16 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.90
+
+ Nano changes from Dave Mills.
+
+Thu Nov 19 04:23:46 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp_machine.h: STREAM also needs HAVE_SYS_STREAM_H
+ Reported by: Ronald Cole <ronald@forte-intl.com>
+
+Mon Nov 16 19:17:34 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73e14
+
+ * util/ntptime.c (main): Protect STA_NANO
+
+ * ntpd/refclock_oncore.c: General overhaul and simplifications.
+ The new manual clarifies a lot of fine points, and the driver has
+ been suitably simplified. Uses Site Survey if possible, otherwise
+ does it by hand. Should also work with non-UT models, as long as
+ they talk the Motorola Binary Protocol. The driver Doesn't (need
+ to) know where the author lives anymore.
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+
+ * ntpd/refclock_palisade.h: New version.
+ * ntpd/refclock_palisade.c: New version.
+ From: Sven Dietrich <Sven_Dietrich@Trimble.COM>
+
+Sat Oct 24 01:19:21 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73e13
+
+ * ntpdc/ntpdc_ops.c (clkbug): Patches
+ * ntpd/ntp_refclock.c (refclock_buginfo): Patches
+ From: Marc.Brett@waii.com
+
+Sat Oct 10 20:13:14 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73e12
+
+ * ntpd/ntp_util.c (hourly_stats): Added prio_set stuff.
+
+ * ntpd/ntpd.c (ntpdmain): HAVE_SETPGRP_0 typo.
+ * parseutil/dcfd.c (detach): Ditto.
+ * ntpd/ntp_control.c (ctl_putpeer): Sometimes, peer->dstadr is
+ NIL.
+ From: Perry Ross <pross@platinum.com>
+
+ * ntpd/ntpd.c:
+ Some systems use sys/sched.h, not sched.h (Irix)
+ * configure.in (CFLAGS): nextstep needs -posix.
+ Reported by: Jack Bryans <jbryans@csulb.edu>
+
+Sat Oct 3 02:32:46 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73e11
+
+ * configure.in (ac_refclock_palisade): Needs termios.
+
+ * libntp/mktime.c: Some systems need sys/types.h
+
+ * configure.in: Added AC_TYPE_SIZE_T and AC_CHECK_TYPE(time_t, long)
+ The time_t stuff should only be needed on Older machines, so the
+ fact that I'm using a long shouldn't be a problem (hollow laugh).
+
+ * include/l_stdlib.h: Sometimes we need to #include <sys/types.h>
+
+ * libntp/Makefile.am (../include/des.h): Typo.
+
+Fri Oct 2 20:52:47 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_intres.c (request): Accept responses back thru V2.
+
+Thu Oct 1 00:11:16 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73e9
+
+ * ntpd/ntpd.c (catch_danger): Added.
+ (ntpdmain): AIX SIGDANGER stuff
+ From: Lars-Owe Ivarsson <larsowe@paradisaea.its.uu.se>
+
+ * configure.in:
+ * include/ntp_machine.h:
+ * include/ntp_string.h:
+ * libntp/machines.c:
+ * libparse/clk_hopf6021.c:
+ * libparse/clk_trimtsip.c:
+ * ntpd/refclock_leitch.c:
+ * ntpd/refclock_palisade.c:
+ * ntpd/refclock_parse.c:
+ Here are some patches to suppress warnings from various compilers
+ (IRIX 5.3, MipsPro C 7.1 on IRIX 6.4, AIX 4.1) and loaders (IRIX
+ 5.3, IRIX 6.4). Shouldn't affect functionality at all.
+ From: Marc Brett <mbrett@rgs0.london.waii.com>
+ (I got similar patches for AIX from Lars-Owe Ivarsson
+ <larsowe@paradisaea.its.uu.se>)
+
+Thu Sep 24 21:33:50 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: '73e8
+
+ * configure.in: AIX4 stubs the POSIX timer_ stuff,
+ sched_setscheduler, and mlockall.
+ Reported by: Lars-Owe Ivarsson <larsowe@paradisaea.its.uu.se>
+
+ * configure.in: OpenBSD stubs the POSIX timer_ stuff.
+ Reported by: sidney august cammeresi iv <cammeres@uiuc.edu>
+ (and several other folks whose names I can't find at the moment)
+
+Mon Sep 21 15:35:23 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: '73e7
+
+ * ntpd/refclock_parse.c: Missing declaration
+ From: Marc Brett <mbrett@rgs0.london.waii.com>
+
+ * include/README: Remove old MCAST descriptions
+
+ * include/Makefile.am (noinst_HEADERS): Lose sun-in.h .
+
+Mon Sep 21 14:50:12 1998 Harlan Stenn <stenn@grundoon.udel.edu>
+
+ * ntpdate/ntpdate.c (timer): Properly format the definition.
+
+Sun Sep 20 23:02:50 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: '73e6
+
+ * include/Makefile.am (noinst_HEADERS): Renamed in.h to sun-in.h
+
+Fri Sep 18 01:05:55 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: '73e5
+
+ * ntpd/refclock_palisade.c: SCO patch
+ From: Kamal A Mostafa <kamalm@sco.com>
+
+ * libparse/clk_trimtsip.c (cvt_trimtsip): Fix rollover bug.
+ From: "Michael J. Tubby B.Sc. G8TIC" <Mike.Tubby@thorcom.co.uk>
+
+ * libntp/authencrypt.c:
+ * libntp/systime.c:
+ * ntpd/refclock_acts.c:
+ * ntpd/refclock_arbiter.c:
+ * ntpd/refclock_arc.c:
+ * ntpd/refclock_as2201.c:
+ * ntpd/refclock_atom.c:
+ * ntpd/refclock_chu.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_datum.c:
+ * ntpd/refclock_heath.c:
+ * ntpd/refclock_hpgps.c:
+ * ntpd/refclock_irig.c:
+ * ntpd/refclock_leitch.c:
+ * ntpd/refclock_nmea.c:
+ * ntpd/refclock_palisade.c:
+ * ntpd/refclock_parse.c:
+ * ntpd/refclock_pst.c:
+ * ntpd/refclock_trak.c:
+ * ntpd/refclock_true.c:
+ * ntpd/refclock_usno.c:
+ * ntpd/refclock_wwvb.c:
+ Typos, cleanup, and bugfixes
+ From: Marc Brett <mbrett@rgs0.london.waii.com>
+
+ * ntpd/ntp_timer.c (timer): Typo.
+ * include/ntp_refclock.h: in refclockstat, clockdesc should be const.
+ * ntpd/ntp_io.c (create_sockets): Typo.
+ * ntpd/ntp_control.c (free_varlist): Use the appropriate cast when
+ calling free().
+ (set_var): Use char *td for non-const char data.
+ (ctl_getitem): Use char * for non-const data.
+ (Many of these reported by Marc Brett)
+
+Sun Sep 13 19:19:09 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntpd.c: Added nofork declaration.
+ (ntpdmain): Initialize it...
+ * ntpd/ntp_config.c: added nofork.
+ Updated ntp_options.
+ (getstartup): Updated "usage" string. Deal with -n flag.
+ (getconfig): Ditto.
+ From: Jeffrey Hutzelman <jhutz@cs.cmu.edu>
+
+ * ntpd/ntp_io.c (open_socket): Use ntoa() to print out the address
+ when bind() fails. (in 2 places)
+ Reported by: "Markus W. Fehr" <mfehr@ch.ibm.com>
+ Only soft-fail if an interface is unavailable.
+ (create_sockets): Don't SO_REUSEADDR if the interface is unavailable.
+ From: "Markus W. Fehr" <mfehr@ch.ibm.com>
+
+ * configure.in: If we --disable-all-clocks, then don't enable
+ parse clocks by default.
+ Reported by: Marion Hakanson <hakanson@cse.ogi.edu>
+
+Sat Aug 22 23:58:14 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * ntpd/refclock_parse.c (local_input): fixed IO handling for non-STREAM IO
+
+Sun Aug 16 20:13:32 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * libntp/ieee754io.c: debug information only compile for LIBDEBUG case
+
+ * ntpd/refclock_parse.c (gps16x_message): reduced UTC parameter information (dropped A0,A1)
+ made uval a local variable (killed one of the last globals)
+ (sendetx): added logging of messages when in debug mode
+ (trimble_check): added periodic checks to facilitate re-initialization
+ (trimbletsip_init): made use of EOL character if in non-kernel operation
+ (trimbletsip_message): extended message interpretation
+ (getdbl): fixed data conversion
+
+ * libparse/parse_conf.c (clockformats): Trimble TSIP driver now also
+ available for kernel operation
+
+ * libparse/info_trimble.c: re-generated
+
+ * libparse/clk_trimtsip.c (cvt_trimtsip): initial kernel capable version (no more floats)
+ (clock_trimtsip =): new format name
+
+ * libparse/clk_trimtaip.c (clock_trimtaip =): changed format name
+
+ * include/trimble.h (CMD_RSTATTRACK): renamed mode 6 variable name
+
+ * scripts/monitoring/ntploopwatch: moved emacs mode selector
+
+Mon Aug 10 15:32:48 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_acts.c: Patch cleanup
+ * ntpd/ntp_refclock.c: Patch cleanup
+ * ntpd/ntp_timer.c: Patch cleanup
+ From: qli@huey.udel.edu
+
+Wed Jul 29 15:23:21 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/machines.c: IRIX needs time.h
+ Reported by: Judith E Bush <jbush@fi.edu>
+
+ * ntpd/ntpd.c (service_main): Better AIX PROCLOCK fix.
+ From: Matt Ladendorf <matt.ladendorf@anheuser-busch.com> and
+ Grover Davidson <Grover.Davidson@anheuser-busch.com>
+
+Wed Jul 29 01:36:48 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntpd.h (MAXINTERFACES): Moved here...
+ * ntpd/ntp_io.c: From here...
+ (create_sockets): Only deal with MAXINTERFACES.
+ (create_sockets): Only deal with specified interfaces.
+
+ * ntpd/ntp_config.c (CONFIG_LISTEN): Added
+ Added ifnum and listenaddrs[]
+ (getconfig): Added defn for "addr"
+ (getconfig): Initialize ifnum.
+
+ * ntpd/ntpd.c (service_main): call init_io after getconfig
+ From: Vebjorn Ljosa <ljosa@initio.no>
+
+Wed Jul 29 00:42:28 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_palisade.c: Use NEED_HPUX9_TIOCM_STUFF
+
+ * acconfig.h (NEED_HPUX9_TIOCM_STUFF): Added.
+
+ * configure.in (REFCLOCK_PALISADE): Needs termio*.h
+ (NEED_HPUX9_TIOCM_STUFF): Added.
+
+ * ntpd/ntp_io.c (create_sockets): Use strchr instead of strstr.
+
+ * libntp/mktime.c: #include <sys/types.h>
+
+ * libntp/ieee754io.c: #include <sys/types.h>
+
+Wed Jul 29 00:24:22 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_acts.c (ACTS_MAXPOLL): 14 -> 18.
+ Import current_nextdate
+ (acts_receive): Update peer->nextdate with current_nextdate
+ (acts_poll): Call acts_timeout() (debugging)
+
+ * ntpd/ntp_refclock.c: Export current_nextdate.
+ (refclock_transmit): Check peer->valid >= NTP_SHIFT - 2, not >.
+ (refclock_transmit): hpoll wiggles, update current_nextdate
+
+ * ntpd/ntp_timer.c: #include "ntp_refclock.h"
+ (MODE_MANUAL): Added.
+ (timer): MODE_MANUAL stuff
+
+ From: qli@huey.udel.edu
+
+Tue Jul 28 23:23:15 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Check for inet_ntoa in -lbind .
+
+ * ntpd/ntpd.c: #undef PROCLOCK for AIX.
+
+Mon Jul 20 01:06:24 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (AC_TYPE_SIZE_T): Added.
+
+Sat Jul 11 09:38:30 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73e
+
+ * ports/winnt/: Replaced with new code (no SHM or PALISADE)
+ From: Greg Schueman <schueman@ix.netcom.com>
+
+Fri Jul 10 12:12:59 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73d
+
+ * include/ntp_machine.h (HAVE_SRANDOM): VxWorks patches
+ (HAVE_RANDOM): Ditto.
+ (CALL): Ditto.
+ From: Casey Crellin <ccrellin@mweb.com>
+
+ * ntpd/refclock_parse.c (local_input): Typo.
+ Reported by: Tony Li <tony1@home.net>
+
+Wed Jul 8 01:49:01 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73c
+
+ * PARSE patches from Frank Kardel
+
+ * libntp/machines.c (ntp_set_tod): Get it right.
+
+Sun Jul 5 22:15:34 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73a
+
+ * kernel/sys/timex.h (MOD_CANSCALE): Add rest of patch to handle
+ scaling.
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+
+Wed Jun 10 21:16:01 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.73
+
+ * ntpd/ntp_loopfilter.c (local_clock): MOD_CANSCALE patches, and
+ be careful with the integration if we're nearly perfect.
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+
+ * util/tickadj.c (main): Typo fix...
+ From: Marion Hakanson <hakanson@cse.ogi.edu>
+
+ * ntpd/ntp_io.c (create_sockets): Attempt to ignore alias
+ interfaces.
+ From: Kenneth Maupin <maupin@easystreet.com>
+
+ * ntpd/ntp_refclock.c: PPS fixes
+ * ntpd/refclock_msfees.c (msfees_start): Portability fixes and
+ PPS/STREAM enhancements
+ From: John Hay <jhay@mikom.csir.co.za>
+
+ * ntpd/ntp_refclock.c (refclock_gtlin): Patch...
+ From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
+
+Sun Jun 28 18:43:30 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * libntp/buftvtots.c (buftvtots): using WORD_BIGENDIAN instead of XNTP_BIG_ENDIAN
+
+ * libparse/clk_trimtsip.c (getflt): fixed ENDIAN issue
+ (getdbl): fixed ENDIAN issue
+ (getint): use get_msb_short()
+ (cvt_trimtsip): use gpstolfp() for conversion
+
+ * libntp/Makefile.am (libntp_a_SOURCES): added gpstolfp.c source
+
+ * libntp/binio.c: added {get,put}_msb_{short,long}() functions
+
+ * include/ntp_fp.h: added gpstolfp() prototype
+
+ * include/binio.h: added binio MSB prototypes
+
+Sat Jun 13 13:48:17 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * parseutil/testdcf.c: signed/unsigned
+ SYSV clock name clash fixed
+
+ * parseutil/dcfd.c: signed/unsigned
+ SYSV clock name clash fixed
+ year wrapping at 1998
+ ctype macros take ints as args
+
+ * ntptrace/ntptrace.c (decodeipaddr): ctype macros take ints as args
+
+ * ntpq/ntpq_ops.c (doprintpeers): signed/unsigned
+
+ * ntpq/ntpq.c: ctype macros take ints as args
+ signed/unsigned
+
+ * ntpdc/ntpdc.c: signed/unsigned
+
+ * ntpd/refclock_usno.c: signed/unsigned
+
+ * ntpd/refclock_true.c (true_send): signed/unsigned, name clashes
+
+ * ntpd/refclock_parse.c: signed/unsigned, name clashes
+
+ * ntpd/refclock_nmea.c (nmea_receive): ctype macros take ints as args
+
+ * ntpd/refclock_heath.c (heath_receive): prototypes (signed/unsigned issues)
+
+ * ntpd/refclock_arc.c: prototypes (signed/unsigned issues)
+
+ * ntpd/refclock_acts.c: prototypes (signed/unsigned issues)
+
+ * ntpd/ntpd.c: prototypes (signed/unsigned issues)
+
+ * ntpd/ntp_util.c (getauthkeys): prototypes (signed/unsigned issues)
+ fix SYSV clock name clash
+
+ * ntpd/ntp_request.c: prototypes (signed/unsigned issues)
+ fix SYSV clock name clash
+
+ * ntpd/ntp_io.c (input_handler): variable naming, signed/unsigned
+
+ * ntpd/ntp_intres.c (readconf): signed/unsigned issues
+
+ * ntpd/ntp_control.c: prototypes (signed/unsigned issues)
+ fix SYSV clock name clash
+
+ * ntpd/ntp_config.c: fix SYSV clock name clash
+ ctype macros take ints as args
+
+ * libparse/parsestreams.c: dirt (debug) removed
+
+ * libparse/parsesolaris.c: more prototypes
+ fix name clashes
+ allow for ansi2knr
+
+ * libparse/parse.c: bcopy/memcpy cleanup
+ fix SYSV clock name clash
+
+ * libparse/clk_trimtsip.c (cvt_trimtsip): fix SYSV clock name clash
+
+ * libparse/clk_trimtaip.c (cvt_trimtaip): fix SYSV clock name clash
+
+ * libparse/clk_schmid.c (cvt_schmid): fix SYSV clock name clash
+
+ * libparse/clk_rcc8000.c (cvt_rcc8000): fix SYSV clock name clash
+
+ * libparse/clk_rawdcf.c (cvt_rawdcf): fix SYSV clock name clash
+
+ * libparse/clk_hopf6021.c (cvt_hopf6021): fix SYSV clock name clash
+
+ * libparse/clk_dcf7000.c (cvt_dcf7000): fix SYSV clock name clash
+
+ * libparse/clk_computime.c: fix SYSV clock name clash
+
+ * libntp/octtoint.c (octtoint): ctype macros take ints as args
+
+ * libntp/mstolfp.c (mstolfp): ctype macros take ints as args
+
+ * libntp/hextolfp.c (hextolfp): ctype macros take ints as args
+
+ * libntp/hextoint.c (hextoint): ctype macros take ints as args
+
+ * libntp/decodenetnum.c (decodenetnum): ctype macros take ints as args
+
+ * libntp/atouint.c (atouint): ctype macros take ints as args
+
+ * libntp/atolfp.c (atolfp): ctype macros take ints as args
+
+ * libntp/atoint.c (atoint): ctype macros take ints as args
+
+ * kernel/sys/parsestreams.h: STREAM macro gone in favor of HAVE_SYS_STREAM_H
+
+ * include/parse.h: STREAM macro gone in favor of HAVE_SYS_STREAM_H
+
+Fri Jun 12 11:08:53 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * ntpd/ntp_timer.c: prototype fixes (ansi2knr/knr compiler)
+
+ * ntpd/ntp_proto.c (make_keylist): type cast for e(!!!)malloc()
+
+ * libparse/Makefile.am: adjust for ansi2knr
+
+ * libntp/ieee754io.c: ansi2knr compatibility
+
+ * include/ntp_refclock.h: added pps_sample() extern declaration
+ added refclock_process_offset() extern declaration
+
+ * include/ntp.h: fixed function * prototypes
+
+ * ntpd/refclock_parse.c (bind): added input routine
+ (local_input): added input routine
+
+ * ntpd/ntp_io.c (input_handler): direct input processing for
+ refclocks to save input recv buffers
+
+ * include/ntp_refclock.h: added int io_input(struct recvbuf *)
+ pointer to allow direct processing of read refclock data in
+ order to save many bug recv buffers on single character input
+ (problem with "fast" machines)
+
+ * parse_conf.c: conditional compile macros fixed
+
+ * parse.c: conditional compile macros fixed
+ printf prototype
+
+ * clk_trimtaip.c: conditional compile macros fixed
+ printf prototype
+
+ * clk_schmid.c: conditional compile macros fixed
+ printf prototype
+
+ * clk_rcc8000.c: conditional compile macros fixed
+ printf prototype
+
+ * clk_hopf6021.c: conditional compile macros fixed
+ printf prototype
+
+ * clk_dcf7000.c: conditional compile macros fixed
+ printf prototype
+
+ * clk_computime.c: conditional compile macros fixed
+ printf prototype
+
+Sat Jun 6 07:41:54 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * ntpd/refclock_palisade.c: fixed termio.h / termios.h inclusion
+
+ * include/ntp_refclock.h: made refclockproc/clockdesc const
+
+ * ntpd/ntp_control.c (ctl_putpeer): avoided ambigous 'else' (gcc)
+
+ * ntpd/refclock_parse.c (parse_start): added BURST mode initialisation
+
+ * scripts/stats/summary.sh (CLOCK): allow for Y2K log files
+
+ * libparse/clk_rawdcf.c: simplified condidional compile expression
+
+Wed May 27 08:10:43 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * include/Makefile.am (noinst_HEADERS): added new header files
+ mbg_gps166.h binio.h ascii.h ieee754io.h
+
+ * ntpdc/ntpdc.c (sendrequest): fixed info_auth_keyid setting it
+ got accidentally trashed every other round
+
+Mon May 25 22:55:07 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * configure.in: PARSE clocks are enabled by default whenever
+ possible (termio.h or termios.h present)
+ removed RAWDCF_SETDTR feature
+
+ * acconfig.h: removed RAWDCF_SETDTR option (now implicit by
+ compilation and run time configuration)
+
+ * ntpd/refclock_parse.c (rawdcf_init): offer a RAWDCF clock (type 14)
+ that attempts to set the DTR modem line for receiver power
+
+ * libparse/clk_meinberg.c (cvt_meinberg): support current standard
+ Meinberg data formats
+
+Sun May 24 09:43:19 1998 Frank Kardel <kardel <AT> acm.org>
+
+ * libparse/clk_rawdcf.c (pps_rawdcf): trigger pps on zero going
+ edge - that is simpler wiring (Rx->DCD).
+
+ * parseutil/testdcf.c (wday): const keyword
+
+ * parseutil/dcfd.c (cvt_rawdcf): sign issues and calling interfaces
+
+ * ntpq/ntpq.c (MAXVARLEN): adjusted internal buffer length for
+ variable values
+
+ * ntpd/refclock_parse.c: adjust to new io handling (fixed formats
+ only)
+ (mkreadable): don't include >"< in readable ASCII output (-> ntpq
+ parsing)
+ output debug messages to stdout instead of msyslog()
+ fixed version information string
+
+ * ntpd/refclock_atom.c (pps_sample): new auxiliary pps interface
+
+ * libparse/parsestreams.c (parserput): get event status consistent
+ with direct calls
+ (zs_xsisr): simulate CARRIER status to avoid unnecessary M_xHANGUP
+ events
+
+ * libparse/parsesolaris.c (parserput): get event status consistent
+ with direct calls
+ (zs_xsisr): simulate CARRIER status to avoid unnecessary M_xHANGUP
+ events
+
+ * libparse/parse.c: removed old input cruft
+ (parse_restart): new generic input help function
+ (parse_addchar): ditto
+ (parse_end): ditto
+ (pps_one): new generic pps help function
+ (pps_zero): ditto
+
+ * libparse/clk_trimtsip.c (clock_trimtsip =): new input handling
+
+ * libparse/clk_trimtaip.c (clock_trimtaip =): new input handling
+ (inp_trimtaip): new input handler
+
+ * libparse/clk_schmid.c (clock_schmid =): new input handling
+ (inp_schmid): new input handler
+
+ * libparse/clk_rcc8000.c (clock_rcc8000 =): new input handling
+ (inp_rcc8000): new input handler
+
+ * libparse/clk_rawdcf.c (clock_rawdcf =): new input handling
+ (snt_rawdcf): adjusted to new input handling
+ (inp_rawdcf): new input handler
+
+ * libparse/clk_meinberg.c (clock_meinberg): new input handling
+ (gps_input): new input handler
+ (mbg_input): new input handler
+
+ * libparse/clk_hopf6021.c (clock_hopf6021 =): new input handling
+ (inp_hopf6021): new input handler
+
+ * libparse/clk_dcf7000.c (clock_dcf7000 =): new input handling
+ (inp_dcf7000): new input handler
+
+ * libparse/clk_computime.c (clock_computime =): new input handling
+ (inp_computime): new input handler
+
+ * libparse/Makefile.am: link kernel module with libntp.a
+
+ * include/parse.h (struct parse): removed old data structure cruft
+ (new input model) new PARSE_INP* macros for input handling
+ removed old SYNC_* macros from old input model
+ (struct clockformat): removed old parse functions in favor of the
+ new input model
+ updated prototypes
+
+ * include/ntp_refclock.h: prototype for refclock_atom pps_sample()
+ interface
+
+ * acconfig.h: added PPS_SAMPLE define
+ * configure.in (LIBPARSE): added PPS_SAMPLE configuration
+ <refclock_atom aux interface>
+
+ * libntp/systime.c (adj_systime): debug output (> level 6) for
+ adjtime results
+
+ * libntp/mfp_mul.c (mfp_mul): controlled debug output
+
+ * libntp/ieee754io.c (get_byte): controlled debug output
+ (fetch_ieee754): ditto
+ (put_ieee754): ditto
+
+Tue May 5 20:09:51 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: document DES is not usually present.
+
+Wed Apr 29 22:00:22 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.72h
+
+ * authstuff/Makefile.am (check-local-rsn): check-local doesn't
+ work with RSAREF...
+ Reported by: "Auteria Wally Winzer Jr." <wally.winzer@champusa.com>
+
+ * libntp/machines.c: the settime() choices were ordered badly.
+ Reported by: Michael Joosten <joost@c-lab.de>
+
+Sat Apr 25 00:35:53 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_var_no_parenb_ignpar): Undo the kernel PLL
+ block I just installed - Dave wants to control this via
+ KERNEL_FLL_BUG.
+
+Fri Apr 24 20:35:57 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/Makefile.am (libntp_a_DEPENDENCIES): Set per libntp_a_LIBADD
+
+ * configure.in: Do a better job of blocking kernel PLL under
+ solaris2.6.
+
+Fri Apr 24 00:41:12 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.72f
+ (ac_cv_struct_nlist_n_un): Don't look for ntp_adjtime or
+ ntp_gettime under solaris2.6.
+
+ * ntpd/ntp_proto.c (process_packet): Give verbose error messages
+
+ * include/global.h (PROTOTYPES): Drive via HAVE_PROTOTYPES.
+
+Wed Apr 22 16:55:55 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_var_use_des): Added. 4.0.72e.
+ * libntp/Makefile.am (libntp_a_LIBADD): Added DESOBJS
+
+Tue Apr 21 02:08:06 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_arc.c (arc_receive): Typo...
+ From: Sam Steingold <sds@usa.net>
+
+Fri Apr 10 03:05:35 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_refclock_chu): AUDIO_CHU support. Disabled by
+ default, and currently only supported on SunOS and Solaris.
+ * acconfig.h: AUDIO_CHU
+
+Wed Apr 8 19:53:53 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/Makefile.am (EXTRA_DIST): Added mktime.c
+
+ * configure.in: AC_REPLACE_FUNCS(mktime).
+ (--enable-dst-minutes=60): Added, for (missing) mktime().
+
+ * ntpd/refclock_heath.c (heath_receive): Use mktime() instead of
+ the old hack.
+
+Tue Apr 7 21:15:14 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (LIBOBJS): Hack it before AC_OUTPUT to deal with
+ ANSI2KNR-filtering rules.
+ From: Jim Meyering <meyering@ascend.com>
+
+Mon Apr 6 01:40:45 1998 Harlan Stenn <stenn@grundoon.udel.edu>
+
+ * libntp/strerror.c: ANSIfy strerror's definition.
+
+Thu Mar 12 20:24:45 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/statestr.c: Only #include <config.h> if HAVE_CONFIG_H is
+ #define'd.
+ From: Sven Dietrich <Sven_Dietrich@Trimble.COM>
+
+Wed Mar 11 00:27:32 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Cygwin needs to check for the advapi32 library.
+ NT doesn't support a root user, so don't bother with getuid().
+ Also, don't bother with umask().
+
+ * ntpd/ntp_io.c: cygwin32 patches
+ * ntpd/ntp_proto.c: Ditto.
+ * ntpd/ntpd.c: Ditto.
+ * ntpd/ntp_timer.c: Ditto.
+ * ntpdate/ntpdate.c: Ditto.
+ * libntp/machines.c: Ditto.
+ * libntp/systime.c: Ditto.
+ * include/ntp_machine.h: Ditto.
+ * include/ntp_unixtime.h: Ditto.
+ From: Sven Dietrich <Sven_Dietrich@Trimble.COM>
+
+Tue Mar 10 22:26:14 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_make_tickadj): Added.
+ Now that tickadj is the only(?) utility that cares about tick and
+ tickadj, we don't need to have NOKMEM and no PRESET_* be fatal.
+
+Sat Mar 7 02:57:17 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_loopfilter.c (local_clock): Patch STA_FLL check
+ From: Poul-Henning Kamp <phk@freebsd.org>
+
+ * various: Renamed ACTS to CLOCK_ACTS, ARBITER to CLOCK_ARBITER,
+ ARCRON_MSF to CLOCK_ARCRON_MSF, AS2201 to CLOCK_AS2201, BANC to
+ CLOCK_BANC, DATUM to CLOCK_DATUM, GPSVME to CLOCK_GPSVME, HEATH to
+ CLOCK_HEATH, HPGPS to CLOCK_HPGPS, IRIG to CLOCK_IRIG, JUPITER to
+ CLOCK_JUPITER, LEITCH to CLOCK_LEITCH, MSFEES to CLOCK_MSFEES,
+ MX4200 to CLOCK_MX4200, NMEA to CLOCK_NMEA, PALISADE to
+ CLOCK_PALISADE, PARSE to CLOCK_PARSE, PPS720 to CLOCK_PPS720, PST
+ to CLOCK_PST, PTBACTS to CLOCK_PTBACTS, SHM_CLOCK to CLOCK_SHM,
+ ONCORE to CLOCK_ONCORE, TPRO to CLOCK_TPRO, TRAK to CLOCK_TRAK,
+ TRUETIME to CLOCK_TRUETIME, USNO to CLOCK_USNO, WWVB to CLOCK_WWVB
+
+ * Makefile.am (ETAGS_ARGS): Added acconfig.h
+
+ * various: Renamed LOCAL_CLOCK to CLOCK_LOCAL.
+
+ * configure.in: First cut at *-pc-cygwin32 support
+ Requested by: Sven Dietrich <Sven_Dietrich@Trimble.COM>
+
+ * configure.in: gdt-surveying code is gone. Sigh.
+ Reported by: Poul-Henning Kamp <phk@critter.freebsd.dk>
+
+Wed Mar 4 21:41:06 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * many places: Renamed ATOM to CLOCK_ATOM
+
+Tue Mar 3 03:18:13 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_timer.c (timer): Only call refclock_transmit if
+ REFCLOCK is #define'd.
+ Reported by a bunch of folks.
+
+Mon Mar 2 03:46:07 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ntp_refclock): Use CLOCK_CHU, which no longer
+ needs any special headers.
+ * ntpd/refclock_chu.c: Call it CLOCK_CHU
+ (chu_receive): Define it correctly.
+
+ * include/winnt/sys/time.h (gettimeofday): Prototypes are OK.
+ (settimeofday): Prototypes are OK.
+ From: JJEVNISEK@qgraph.com
+
+ * ntpq/ntpq_ops.c: varlist name and value aren't const.
+ * ntpdc/ntpdc_ops.c (fudge): The flags are u_val, not val.
+ * ntpdc/ntpdc.c: const cleanup, exit cleanup.
+ * ntpd/refclock_wwvb.c (wwvb_receive): Move the definition of tz
+ somewhere more normal.
+ * ntpd/ntp_request.c (do_trustkey): kp gets u_long data, not
+ u_int32 (but Harlan thinks this patch may be wrong).
+ * ntpd/ntp_refclock.c (refclock_process): clocktime needs
+ offset.l_ui, not offset.l_i .
+ * ntpd/ntp_control.c (set_var): t isn't const.
+ * libntp/a_md5encrypt.c (session_key): Cast 2nd arg to MD5auth_setkey.
+ * include/ntpd.h: ctl_var's text field isn't const.
+ * include/ntp_refclock.h: clockdesc isn't const.
+ From: Marc Brett <Marc.Brett@waii.com>
+
+ * ntpd/ntp_loopfilter.c (local_clock): Limit ntv.constant to
+ MAXTC, and log error returns from ntp_adjtime.
+ From: Juha Sarlin <juha@c3l.tyreso.se>
+
+Mon Mar 2 03:05:23 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_cv_var_kernel_fll_bug): KERNEL_FLL_BUG
+ * acconfig.h: KERNEL_FLL_BUG: added.
+ * ntpd/ntp_loopfilter.c (local_clock): Only avoid STA_FLL if
+ KERNEL_FLL_BUG is #define'd (Solaris2.6)
+
+Sat Feb 21 00:45:10 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * automake-1.2d.patches: Added ansi2knr.o rules.
+
+ * ntpd/refclock_tpro.c: P() stuff
+
+Fri Feb 20 20:10:20 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Improve the ${CC} -pipe test (cygwin-32's gcc -pipe
+ silently does nothing).
+ Reported by: Sven Dietrich <Sven_Dietrich@Trimble.COM>
+
+Wed Feb 18 00:51:08 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+* configure.in: 4.0.72 released.
+
+* configure.in:AC_REPLACE_FUNCS(strerror), check for poll.h, and deal
+ with the --enable-JUPITER stuff.
+* libntp/Makefile.am (libntp_a_LIBADD): Added (for strerror support).
+* libntp/clocktypes.c: Added REFCLK_GPS_JUPITER.
+* ntpdate/ntpdate.c: poll() support
+* ntpd/Makefile.am: Add refclock_jupiter.c
+* ntpd/refclock_conf.c: Added refclock_jupiter
+* ntpd/refclock_mx4200.c (mx4200_pps): Bugfixes.
+* include/ntp.h (REFCLK_GPS_JUPITER): Added, and bumped REFCLK_MAX.
+ From: Craig Leres <leres@ee.lbl.gov>
+
+Mon Feb 16 21:02:42 1998 Harlan Stenn <stenn@grundoon.udel.edu>
+
+ * ntpd/ntp_proto.c: P()
+
+Mon Feb 16 12:43:11 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+* include/ntp_types.h: Added P() prototyping hack back in.
+* include/parse.h: Ditto.
+* include/ntpd.h: Ditto.
+* include/ntp_unixtime.h: Ditto.
+* include/ntp_stdlib.h: Ditto.
+* include/ntp_select.h: Ditto.
+* include/ntp_refclock.h: Ditto.
+* include/ntp_fp.h: Ditto.
+* include/md5.h: Ditto.
+* include/ntp_filegen.h: Ditto.
+* include/ntp_calendar.h: Ditto.
+* include/l_stdlib.h: Ditto.
+
+ * configure.in (ACTS): Sometimes, TIOCMBIS is in sys/ioctl.h
+ Reported by Kenneth Jaldehag <kenneth.jaldehag@sp.se>
+ * configure.in (HEATH): Ditto.
+ * configure.in (PTBACTS): Ditto.
+ * configure.in (USNO): Ditto.
+
+Sat Feb 14 00:02:14 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_irig.c (irig_rf): Rename sincos[] to sin_cos[].
+
+Fri Feb 13 22:22:08 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/ntp.h (RANDPOLL): Use random or mrand48.
+ * ntpd/ntp_config.c (do_resolve_internal): Ditto.
+ * ntpd/ntp_peer.c (unpeer): Ditto.
+ * ntpd/ntp_proto.c (make_keylist): Ditto.
+
+ * ntpd/ntpd.c (xntpdmain): Use srandom or srand48.
+
+ * configure.in: Look for {s,}random() and [ms]rand48().
+
+Wed Feb 11 22:50:24 1998 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_restrict.c (hack_restrict): Renamed restrict()
+ * include/ntpd.h: Ditto
+ * ntpd/ntp_request.c (do_restrict): Ditto
+ * ntpd/ntp_config.c (getconfig):
+ * ntpd/ntp_io.c (create_sockets): Ditto.
+
+1998-01-23 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_irig.c: Allow either <sun/audioio.h> or
+ <sys/audioio.h> . From Dave Mills.
+
+ * configure.in: Under SunOS, it's sun/audioio.h .
+
+1998-01-22 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/driver6.html: Updated header file info
+ * html/irig.html: Ditto.
+ * configure.in: sys/bsd_audioirig.h replaced with sys/audioio.h
+ for new irig driver that Dave installed.
+
+1998-01-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * Many places: Lose the P(()) prototype stuff
+
+ * util/tickadj.c (writevar): Make offset an off_t
+ (readvar): Ditto
+ (getoffsets): Make offsets off_t
+
+ * adjtimed/adjtimed.c (GetClockRate): Fix lseek arg 2.
+ (SetClockRate): Ditto
+
+ * Many things in many places from many people.
+
+ * configure.in: Added AC_TYPE_OFF_T
+
+1997-11-26 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_palisade.c: ANSIfied.
+
+Wed Sep 3 23:51:44 1997 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (AM_C_PROTOTYPES): Added.
+
+ * Makefile.am (AUTOMAKE_OPTIONS): Added ansi2knr.
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..0d95578
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,178 @@
+Basic Installation
+==================
+
+ These are generic *nix installation instructions.
+
+ For Windows/NT, please see ports/winnt and html/build/hints/winnt.html.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes a while. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..2908f96
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,158 @@
+ACLOCAL_AMFLAGS = -I sntp/m4 -I sntp/libevent/m4 -I sntp/libopts/m4
+
+NULL =
+
+SUBDIRS = \
+ scripts \
+ include \
+ libntp \
+ libparse \
+ ntpd \
+ ntpdate \
+ ntpdc \
+ ntpq \
+ ntpsnmpd \
+ parseutil \
+ adjtimed \
+ clockstuff \
+ kernel \
+ util \
+ sntp \
+ tests \
+ $(NULL)
+
+DISTCHECK_CONFIGURE_FLAGS = -C --with-sntp
+
+EXTRA_DIST = \
+ $(srcdir)/COPYRIGHT \
+ ChangeLog \
+ CommitLog \
+ CommitLog-4.1.0 \
+ NEWS \
+ NOTES.y2kfixes \
+ README.bk \
+ README.hackers \
+ README.patches \
+ README.refclocks \
+ README.versions \
+ TODO \
+ WHERE-TO-START \
+ bootstrap \
+ build \
+ config.h.in \
+ dot.emacs \
+ flock-build \
+ packageinfo.sh \
+ readme.y2kfixes \
+ results.y2kfixes \
+ \
+ conf \
+ html \
+ lib/isc \
+ libjsmn \
+ ports \
+ \
+ deps-ver \
+ \
+ $(NULL)
+
+CLEANFILES =
+DISTCLEANFILES = .gcc-warning
+
+# HMS: Keep .gcc-warning first, as that way it gets printed first.
+BUILT_SOURCES = \
+ .gcc-warning \
+ libtool \
+ html/.datecheck \
+ sntp/built-sources-only \
+ $(srcdir)/COPYRIGHT \
+ $(srcdir)/.checkChangeLog \
+ $(NULL)
+
+.gcc-warning:
+ @echo "Compiling with GCC now generates lots of new warnings."
+ @echo " "
+ @echo "Don't be concerned. They're just warnings."
+ @echo " "
+ @echo "Don't send bug reports about the warnings, either."
+ @echo " "
+ @echo "Feel free to send patches that fix these warnings, though."
+ @echo " "
+ @sleep 1
+ @touch $@
+
+html/.datecheck: FRC.html
+ cd $(srcdir)/html && \
+ ../scripts/build/checkHtmlFileDates
+
+libtool: $(LIBTOOL_DEPS)
+ ./config.status --recheck
+
+sntp/built-sources-only: FRC.sntp
+ @cd sntp && $(MAKE) $(AM_MAKEFLAGS) built-sources-only
+
+$(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html
+ { echo "This file is automatically generated from html/copyright.html" ; \
+ lynx -dump $(srcdir)/html/copyright.html ;} > COPYRIGHT.new \
+ && mv -f COPYRIGHT.new $(srcdir)/COPYRIGHT
+
+COPYRIGHT-please: $(srcdir)/COPYRIGHT
+ @: do-nothing action to prevent default \
+ This target is needed by sntp/Makefile.am on decrepit \
+ FreeBSD 6.x make which fails with "make COPYRIGHT" \
+ configured in $(srcdir) but "make ./COPYRIGHT" succeeds. \
+ Rather than determine our $(srcdir) from sntp/Makefile.am \
+ COPYRIGHT-please serves as a fixed target.
+
+$(srcdir)/.checkChangeLog: $(srcdir)/ChangeLog $(srcdir)/scripts/build/checkChangeLog
+ cd $(srcdir) && \
+ ./scripts/build/checkChangeLog
+
+dist-hook:
+ @find $(distdir) -type d -name SCCS -print | xargs rm -rf
+
+install-data-local:
+ ( cd $(srcdir) && find html -name SCCS -prune -o -type d \
+ -exec $(INSTALL) -d $(DESTDIR)$(htmldir)/{} ";" )
+ ( cd $(srcdir) && find html -name SCCS -prune -o -type f \
+ -exec $(INSTALL_DATA) {} $(DESTDIR)$(htmldir)/{} ";" )
+
+uninstall-local:
+ rm -rf $(DESTDIR)$(htmldir)/html
+
+CommitLog: FRC.CommitLog
+ cd $(srcdir) \
+ && $(PATH_TEST) -e CommitLog \
+ -a SCCS/s.ChangeSet -ot CommitLog \
+ || scripts/build/genCommitLog
+
+# HMS: The following seems to be a work-in-progress...
+
+CVO=`$(srcdir)/sntp/libevent/build-aux/config.guess`
+
+.buildcvo:
+ echo "$(CVO)" > .buildcvo
+
+.checkcvo: .buildcvo FRC.checkcvo
+ @if [ "`cat .buildcvo`" != "$(CVO)" ];then \
+ echo "This directory was configured for `cat .buildcvo`"; \
+ echo "but this machine is a $(CVO)"; \
+ exit 1; \
+ fi
+
+BHOST=`(hostname || uname -n)`
+
+.buildhost:
+ echo "$(BHOST)" > .buildhost
+
+.checkhost: .buildhost FRC.checkhost
+ @if [ "`cat .buildhost`" != "$(BHOST)" ];then \
+ echo "Built on `cat .buildhost` but this is $(BHOST)"; \
+ echo " "; \
+ fi
+
+FRC.CommitLog FRC.checkcvo FRC.checkhost FRC.distwarn FRC.html FRC.sntp:
+ @: do-nothing action prevents any default
+
+# HMS: what was I trying to do with this?
+#dot.emacs: FRC.distwarn
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..3ab13a2
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,1063 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/configure ChangeLog INSTALL NEWS TODO install-sh \
+ sntp/libevent/build-aux/compile \
+ sntp/libevent/build-aux/config.guess \
+ sntp/libevent/build-aux/config.sub \
+ sntp/libevent/build-aux/depcomp \
+ sntp/libevent/build-aux/install-sh \
+ sntp/libevent/build-aux/ltmain.sh \
+ sntp/libevent/build-aux/missing sntp/libevent/build-aux/ylwrap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/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)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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@
+ACLOCAL_AMFLAGS = -I sntp/m4 -I sntp/libevent/m4 -I sntp/libopts/m4
+NULL =
+SUBDIRS = \
+ scripts \
+ include \
+ libntp \
+ libparse \
+ ntpd \
+ ntpdate \
+ ntpdc \
+ ntpq \
+ ntpsnmpd \
+ parseutil \
+ adjtimed \
+ clockstuff \
+ kernel \
+ util \
+ sntp \
+ tests \
+ $(NULL)
+
+DISTCHECK_CONFIGURE_FLAGS = -C --with-sntp
+EXTRA_DIST = \
+ $(srcdir)/COPYRIGHT \
+ ChangeLog \
+ CommitLog \
+ CommitLog-4.1.0 \
+ NEWS \
+ NOTES.y2kfixes \
+ README.bk \
+ README.hackers \
+ README.patches \
+ README.refclocks \
+ README.versions \
+ TODO \
+ WHERE-TO-START \
+ bootstrap \
+ build \
+ config.h.in \
+ dot.emacs \
+ flock-build \
+ packageinfo.sh \
+ readme.y2kfixes \
+ results.y2kfixes \
+ \
+ conf \
+ html \
+ lib/isc \
+ libjsmn \
+ ports \
+ \
+ deps-ver \
+ \
+ $(NULL)
+
+CLEANFILES =
+DISTCLEANFILES = .gcc-warning
+
+# HMS: Keep .gcc-warning first, as that way it gets printed first.
+BUILT_SOURCES = \
+ .gcc-warning \
+ libtool \
+ html/.datecheck \
+ sntp/built-sources-only \
+ $(srcdir)/COPYRIGHT \
+ $(srcdir)/.checkChangeLog \
+ $(NULL)
+
+
+# HMS: The following seems to be a work-in-progress...
+CVO = `$(srcdir)/sntp/libevent/build-aux/config.guess`
+BHOST = `(hostname || uname -n)`
+all: $(BUILT_SOURCES) config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @$(am__cd) '$(distuninstallcheck_dir)' \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-data-local
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-local
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+ ctags-recursive install install-am install-strip \
+ tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+ dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+ dist-zip distcheck distclean distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-local install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-local
+
+
+.gcc-warning:
+ @echo "Compiling with GCC now generates lots of new warnings."
+ @echo " "
+ @echo "Don't be concerned. They're just warnings."
+ @echo " "
+ @echo "Don't send bug reports about the warnings, either."
+ @echo " "
+ @echo "Feel free to send patches that fix these warnings, though."
+ @echo " "
+ @sleep 1
+ @touch $@
+
+html/.datecheck: FRC.html
+ cd $(srcdir)/html && \
+ ../scripts/build/checkHtmlFileDates
+
+libtool: $(LIBTOOL_DEPS)
+ ./config.status --recheck
+
+sntp/built-sources-only: FRC.sntp
+ @cd sntp && $(MAKE) $(AM_MAKEFLAGS) built-sources-only
+
+$(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html
+ { echo "This file is automatically generated from html/copyright.html" ; \
+ lynx -dump $(srcdir)/html/copyright.html ;} > COPYRIGHT.new \
+ && mv -f COPYRIGHT.new $(srcdir)/COPYRIGHT
+
+COPYRIGHT-please: $(srcdir)/COPYRIGHT
+ @: do-nothing action to prevent default \
+ This target is needed by sntp/Makefile.am on decrepit \
+ FreeBSD 6.x make which fails with "make COPYRIGHT" \
+ configured in $(srcdir) but "make ./COPYRIGHT" succeeds. \
+ Rather than determine our $(srcdir) from sntp/Makefile.am \
+ COPYRIGHT-please serves as a fixed target.
+
+$(srcdir)/.checkChangeLog: $(srcdir)/ChangeLog $(srcdir)/scripts/build/checkChangeLog
+ cd $(srcdir) && \
+ ./scripts/build/checkChangeLog
+
+dist-hook:
+ @find $(distdir) -type d -name SCCS -print | xargs rm -rf
+
+install-data-local:
+ ( cd $(srcdir) && find html -name SCCS -prune -o -type d \
+ -exec $(INSTALL) -d $(DESTDIR)$(htmldir)/{} ";" )
+ ( cd $(srcdir) && find html -name SCCS -prune -o -type f \
+ -exec $(INSTALL_DATA) {} $(DESTDIR)$(htmldir)/{} ";" )
+
+uninstall-local:
+ rm -rf $(DESTDIR)$(htmldir)/html
+
+CommitLog: FRC.CommitLog
+ cd $(srcdir) \
+ && $(PATH_TEST) -e CommitLog \
+ -a SCCS/s.ChangeSet -ot CommitLog \
+ || scripts/build/genCommitLog
+
+.buildcvo:
+ echo "$(CVO)" > .buildcvo
+
+.checkcvo: .buildcvo FRC.checkcvo
+ @if [ "`cat .buildcvo`" != "$(CVO)" ];then \
+ echo "This directory was configured for `cat .buildcvo`"; \
+ echo "but this machine is a $(CVO)"; \
+ exit 1; \
+ fi
+
+.buildhost:
+ echo "$(BHOST)" > .buildhost
+
+.checkhost: .buildhost FRC.checkhost
+ @if [ "`cat .buildhost`" != "$(BHOST)" ];then \
+ echo "Built on `cat .buildhost` but this is $(BHOST)"; \
+ echo " "; \
+ fi
+
+FRC.CommitLog FRC.checkcvo FRC.checkhost FRC.distwarn FRC.html FRC.sntp:
+ @: do-nothing action prevents any default
+
+# HMS: what was I trying to do with this?
+#dot.emacs: FRC.distwarn
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..bbd260e
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,451 @@
+---
+NTP 4.2.8-
+
+Important Changes
+
+* Internal NTP Era counters
+
+The internal counters that track which "era" (range of years) we are in
+rolls over every 136 years'. The current "era" started at the stroke of
+midnight on 1 Jan 1900, and ends just before the stroke of midnight on
+1 Jan 2036.
+In the past, we have used the "midpoint" of the range to decide which
+era we were in. Given the longevity of some products, it became clear
+that it would be more functional to "look back" less, and "look forward"
+more. We now compile a timestamp into the ntpd executable and when we
+get a timestamp we us the "built-on" to tell us what era we are in.
+This check "looks back" 10 years, and "looks forward" 126 years.
+
+So if you have a system that ...
+
+* ntpdc responses disabled by default
+
+Dave Hart writes:
+
+For a long time, ntpq and its mostly text-based mode 6 (control)
+protocol have been preferred over ntpdc and its mode 7 (private
+request) protocol for runtime queries and configuration. There has
+been a goal of deprecating ntpdc, previously held back by numerous
+capabilities exposed by ntpdc with no ntpq equivalent. I have been
+adding commands to ntpq to cover these cases, and I believe I've
+covered them all, though I've not compared command-by-command
+recently.
+
+As I've said previously, the binary mode 7 protocol involves a lot of
+hand-rolled structure layout and byte-swapping code in both ntpd and
+ntpdc which is hard to get right. As ntpd grows and changes, the
+changes are difficult to expose via ntpdc while maintaining forward
+and backward compatibility between ntpdc and ntpd. In contrast,
+ntpq's text-based, label=value approach involves more code reuse and
+allows compatible changes without extra work in most cases.
+
+Mode 7 has always been defined as vendor/implementation-specific while
+mode 6 is described in RFC 1305 and intended to be open to interop
+with other implementations. There is an early draft of an updated
+mode 6 description that likely will join the other NTPv4 RFCs
+eventually. (http://tools.ietf.org/html/draft-odonoghue-ntpv4-control-01)
+
+For these reasons, ntpd 4.2.7p230 by default disables processing of
+ntpdc queries, reducing ntpd's attack surface and functionally
+deprecating ntpdc. If you are in the habit of using ntpdc for certain
+operations, please try the ntpq equivalent. If there's no equivalent,
+please open a bug report at http://bugs.ntp.org./
+
+---
+NTP 4.2.6p5 (Harlan Stenn <stenn@ntp.org>, 2011/12/24)
+
+Focus: Bug fixes
+
+Severity: Medium
+
+This is a recommended upgrade.
+
+This release updates sys_rootdisp and sys_jitter calculations to match the
+RFC specification, fixes a potential IPv6 address matching error for the
+"nic" and "interface" configuration directives, suppresses the creation of
+extraneous ephemeral associations for certain broadcastclient and
+multicastclient configurations, cleans up some ntpq display issues, and
+includes improvements to orphan mode, minor bugs fixes and code clean-ups.
+
+New features / changes in this release:
+
+ntpd
+
+ * Updated "nic" and "interface" IPv6 address handling to prevent
+ mismatches with localhost [::1] and wildcard [::] which resulted from
+ using the address/prefix format (e.g. fe80::/64)
+ * Fix orphan mode stratum incorrectly counting to infinity
+ * Orphan parent selection metric updated to includes missing ntohl()
+ * Non-printable stratum 16 refid no longer sent to ntp
+ * Duplicate ephemeral associations suppressed for broadcastclient and
+ multicastclient without broadcastdelay
+ * Exclude undetermined sys_refid from use in loopback TEST12
+ * Exclude MODE_SERVER responses from KoD rate limiting
+ * Include root delay in clock_update() sys_rootdisp calculations
+ * get_systime() updated to exclude sys_residual offset (which only
+ affected bits "below" sys_tick, the precision threshold)
+ * sys.peer jitter weighting corrected in sys_jitter calculation
+
+ntpq
+
+ * -n option extended to include the billboard "server" column
+ * IPv6 addresses in the local column truncated to prevent overruns
+
+---
+NTP 4.2.6p4 (Harlan Stenn <stenn@ntp.org>, 2011/09/22)
+
+Focus: Bug fixes and portability improvements
+
+Severity: Medium
+
+This is a recommended upgrade.
+
+This release includes build infrastructure updates, code
+clean-ups, minor bug fixes, fixes for a number of minor
+ref-clock issues, and documentation revisions.
+
+Portability improvements affect AIX, HP-UX, Linux, OS X and 64-bit time_t.
+
+New features / changes in this release:
+
+Build system
+
+* Fix checking for struct rtattr
+* Update config.guess and config.sub for AIX
+* Upgrade required version of autogen and libopts for building
+ from our source code repository
+
+ntpd
+
+* Back-ported several fixes for Coverity warnings from ntp-dev
+* Fix a rare boundary condition in UNLINK_EXPR_SLIST()
+* Allow "logconfig =allall" configuration directive
+* Bind tentative IPv6 addresses on Linux
+* Correct WWVB/Spectracom driver to timestamp CR instead of LF
+* Improved tally bit handling to prevent incorrect ntpq peer status reports
+* Exclude the Undisciplined Local Clock and ACTS drivers from the initial
+ candidate list unless they are designated a "prefer peer"
+* Prevent the consideration of Undisciplined Local Clock or ACTS drivers for
+ selection during the 'tos orphanwait' period
+* Prefer an Orphan Mode Parent over the Undisciplined Local Clock or ACTS
+ drivers
+* Improved support of the Parse Refclock trusttime flag in Meinberg mode
+* Back-port utility routines from ntp-dev: mprintf(), emalloc_zero()
+* Added the NTPD_TICKADJ_PPM environment variable for specifying baseline
+ clock slew on Microsoft Windows
+* Code cleanup in libntpq
+
+ntpdc
+
+* Fix timerstats reporting
+
+ntpdate
+
+* Reduce time required to set clock
+* Allow a timeout greater than 2 seconds
+
+sntp
+
+* Backward incompatible command-line option change:
+ -l/--filelog changed -l/--logfile (to be consistent with ntpd)
+
+Documentation
+
+* Update html2man. Fix some tags in the .html files
+* Distribute ntp-wait.html
+
+---
+NTP 4.2.6p3 (Harlan Stenn <stenn@ntp.org>, 2011/01/03)
+
+Focus: Bug fixes and portability improvements
+
+Severity: Medium
+
+This is a recommended upgrade.
+
+This release includes build infrastructure updates, code
+clean-ups, minor bug fixes, fixes for a number of minor
+ref-clock issues, and documentation revisions.
+
+Portability improvements in this release affect AIX, Atari FreeMiNT,
+FreeBSD4, Linux and Microsoft Windows.
+
+New features / changes in this release:
+
+Build system
+* Use lsb_release to get information about Linux distributions.
+* 'test' is in /usr/bin (instead of /bin) on some systems.
+* Basic sanity checks for the ChangeLog file.
+* Source certain build files with ./filename for systems without . in PATH.
+* IRIX portability fix.
+* Use a single copy of the "libopts" code.
+* autogen/libopts upgrade.
+* configure.ac m4 quoting cleanup.
+
+ntpd
+* Do not bind to IN6_IFF_ANYCAST addresses.
+* Log the reason for exiting under Windows.
+* Multicast fixes for Windows.
+* Interpolation fixes for Windows.
+* IPv4 and IPv6 Multicast fixes.
+* Manycast solicitation fixes and general repairs.
+* JJY refclock cleanup.
+* NMEA refclock improvements.
+* Oncore debug message cleanup.
+* Palisade refclock now builds under Linux.
+* Give RAWDCF more baud rates.
+* Support Truetime Satellite clocks under Windows.
+* Support Arbiter 1093C Satellite clocks under Windows.
+* Make sure that the "filegen" configuration command defaults to "enable".
+* Range-check the status codes (plus other cleanup) in the RIPE-NCC driver.
+* Prohibit 'includefile' directive in remote configuration command.
+* Fix 'nic' interface bindings.
+* Fix the way we link with openssl if openssl is installed in the base
+ system.
+
+ntp-keygen
+* Fix -V coredump.
+* OpenSSL version display cleanup.
+
+ntpdc
+* Many counters should be treated as unsigned.
+
+ntpdate
+* Do not ignore replies with equal receive and transmit timestamps.
+
+ntpq
+* libntpq warning cleanup.
+
+ntpsnmpd
+* Correct SNMP type for "precision" and "resolution".
+* Update the MIB from the draft version to RFC-5907.
+
+sntp
+* Display timezone offset when showing time for sntp in the local
+ timezone.
+* Pay proper attention to RATE KoD packets.
+* Fix a miscalculation of the offset.
+* Properly parse empty lines in the key file.
+* Logging cleanup.
+* Use tv_usec correctly in set_time().
+* Documentation cleanup.
+
+---
+NTP 4.2.6p2 (Harlan Stenn <stenn@ntp.org>, 2010/07/08)
+
+Focus: Bug fixes and portability improvements
+
+Severity: Medium
+
+This is a recommended upgrade.
+
+This release includes build infrastructure updates, code
+clean-ups, minor bug fixes, fixes for a number of minor
+ref-clock issues, improved KOD handling, OpenSSL related
+updates and documentation revisions.
+
+Portability improvements in this release affect Irix, Linux,
+Mac OS, Microsoft Windows, OpenBSD and QNX6
+
+New features / changes in this release:
+
+ntpd
+* Range syntax for the trustedkey configuration directive
+* Unified IPv4 and IPv6 restrict lists
+
+ntpdate
+* Rate limiting and KOD handling
+
+ntpsnmpd
+* default connection to net-snmpd via a unix-domain socket
+* command-line 'socket name' option
+
+ntpq / ntpdc
+* support for the "passwd ..." syntax
+* key-type specific password prompts
+
+sntp
+* MD5 authentication of an ntpd
+* Broadcast and crypto
+* OpenSSL support
+
+---
+NTP 4.2.6p1 (Harlan Stenn <stenn@ntp.org>, 2010/04/09)
+
+Focus: Bug fixes, portability fixes, and documentation improvements
+
+Severity: Medium
+
+This is a recommended upgrade.
+
+---
+NTP 4.2.6 (Harlan Stenn <stenn@ntp.org>, 2009/12/08)
+
+Focus: enhancements and bug fixes.
+
+---
+NTP 4.2.4p8 (Harlan Stenn <stenn@ntp.org>, 2009/12/08)
+
+Focus: Security Fixes
+
+Severity: HIGH
+
+This release fixes the following high-severity vulnerability:
+
+* [Sec 1331] DoS with mode 7 packets - CVE-2009-3563.
+
+ See http://support.ntp.org/security for more information.
+
+ NTP mode 7 (MODE_PRIVATE) is used by the ntpdc query and control utility.
+ In contrast, ntpq uses NTP mode 6 (MODE_CONTROL), while routine NTP time
+ transfers use modes 1 through 5. Upon receipt of an incorrect mode 7
+ request or a mode 7 error response from an address which is not listed
+ in a "restrict ... noquery" or "restrict ... ignore" statement, ntpd will
+ reply with a mode 7 error response (and log a message). In this case:
+
+ * If an attacker spoofs the source address of ntpd host A in a
+ mode 7 response packet sent to ntpd host B, both A and B will
+ continuously send each other error responses, for as long as
+ those packets get through.
+
+ * If an attacker spoofs an address of ntpd host A in a mode 7
+ response packet sent to ntpd host A, A will respond to itself
+ endlessly, consuming CPU and logging excessively.
+
+ Credit for finding this vulnerability goes to Robin Park and Dmitri
+ Vinokurov of Alcatel-Lucent.
+
+THIS IS A STRONGLY RECOMMENDED UPGRADE.
+
+---
+ntpd now syncs to refclocks right away.
+
+Backward-Incompatible changes:
+
+ntpd no longer accepts '-v name' or '-V name' to define internal variables.
+Use '--var name' or '--dvar name' instead. (Bug 817)
+
+---
+NTP 4.2.4p7 (Harlan Stenn <stenn@ntp.org>, 2009/05/04)
+
+Focus: Security and Bug Fixes
+
+Severity: HIGH
+
+This release fixes the following high-severity vulnerability:
+
+* [Sec 1151] Remote exploit if autokey is enabled. CVE-2009-1252
+
+ See http://support.ntp.org/security for more information.
+
+ If autokey is enabled (if ntp.conf contains a "crypto pw whatever"
+ line) then a carefully crafted packet sent to the machine will cause
+ a buffer overflow and possible execution of injected code, running
+ with the privileges of the ntpd process (often root).
+
+ Credit for finding this vulnerability goes to Chris Ries of CMU.
+
+This release fixes the following low-severity vulnerabilities:
+
+* [Sec 1144] limited (two byte) buffer overflow in ntpq. CVE-2009-0159
+ Credit for finding this vulnerability goes to Geoff Keating of Apple.
+
+* [Sec 1149] use SO_EXCLUSIVEADDRUSE on Windows
+ Credit for finding this issue goes to Dave Hart.
+
+This release fixes a number of bugs and adds some improvements:
+
+* Improved logging
+* Fix many compiler warnings
+* Many fixes and improvements for Windows
+* Adds support for AIX 6.1
+* Resolves some issues under MacOS X and Solaris
+
+THIS IS A STRONGLY RECOMMENDED UPGRADE.
+
+---
+NTP 4.2.4p6 (Harlan Stenn <stenn@ntp.org>, 2009/01/07)
+
+Focus: Security Fix
+
+Severity: Low
+
+This release fixes oCERT.org's CVE-2009-0021, a vulnerability affecting
+the OpenSSL library relating to the incorrect checking of the return
+value of EVP_VerifyFinal function.
+
+Credit for finding this issue goes to the Google Security Team for
+finding the original issue with OpenSSL, and to ocert.org for finding
+the problem in NTP and telling us about it.
+
+This is a recommended upgrade.
+---
+NTP 4.2.4p5 (Harlan Stenn <stenn@ntp.org>, 2008/08/17)
+
+Focus: Minor Bugfixes
+
+This release fixes a number of Windows-specific ntpd bugs and
+platform-independent ntpdate bugs. A logging bugfix has been applied
+to the ONCORE driver.
+
+The "dynamic" keyword and is now obsolete and deferred binding to local
+interfaces is the new default. The minimum time restriction for the
+interface update interval has been dropped.
+
+A number of minor build system and documentation fixes are included.
+
+This is a recommended upgrade for Windows.
+
+---
+NTP 4.2.4p4 (Harlan Stenn <stenn@ntp.org>, 2007/09/10)
+
+Focus: Minor Bugfixes
+
+This release updates certain copyright information, fixes several display
+bugs in ntpdc, avoids SIGIO interrupting malloc(), cleans up file descriptor
+shutdown in the parse refclock driver, removes some lint from the code,
+stops accessing certain buffers immediately after they were freed, fixes
+a problem with non-command-line specification of -6, and allows the loopback
+interface to share addresses with other interfaces.
+
+---
+NTP 4.2.4p3 (Harlan Stenn <stenn@ntp.org>, 2007/06/29)
+
+Focus: Minor Bugfixes
+
+This release fixes a bug in Windows that made it difficult to
+terminate ntpd under windows.
+This is a recommended upgrade for Windows.
+
+---
+NTP 4.2.4p2 (Harlan Stenn <stenn@ntp.org>, 2007/06/19)
+
+Focus: Minor Bugfixes
+
+This release fixes a multicast mode authentication problem,
+an error in NTP packet handling on Windows that could lead to
+ntpd crashing, and several other minor bugs. Handling of
+multicast interfaces and logging configuration were improved.
+The required versions of autogen and libopts were incremented.
+This is a recommended upgrade for Windows and multicast users.
+
+---
+NTP 4.2.4 (Harlan Stenn <stenn@ntp.org>, 2006/12/31)
+
+Focus: enhancements and bug fixes.
+
+Dynamic interface rescanning was added to simplify the use of ntpd in
+conjunction with DHCP. GNU AutoGen is used for its command-line options
+processing. Separate PPS devices are supported for PARSE refclocks, MD5
+signatures are now provided for the release files. Drivers have been
+added for some new ref-clocks and have been removed for some older
+ref-clocks. This release also includes other improvements, documentation
+and bug fixes.
+
+K&R C is no longer supported as of NTP-4.2.4. We are now aiming for ANSI
+C support.
+
+---
+NTP 4.2.0 (Harlan Stenn <stenn@ntp.org>, 2003/10/15)
+
+Focus: enhancements and bug fixes.
diff --git a/NOTES.y2kfixes b/NOTES.y2kfixes
new file mode 100644
index 0000000..cf181c1
--- /dev/null
+++ b/NOTES.y2kfixes
@@ -0,0 +1,107 @@
+Name of the Application: xntp
+
+Version Number: 4.0.91
+
+Download Size: 4541953 bytes
+
+Downloaded from: http://www.eecis.udel.edu/~ntp/
+
+Operating Systems Supported: many
+
+Operating Systems Tested: unix
+
+Testing
+
+Dates tested (CPU clock set)
+
+ 1999-12-31
+ 2000-01-01
+ 2000-02-29
+
+ Critical fragments of code tested with other dates by special
+ algorithms.
+
+Hardware Platform: Sun Sparc
+
+OS: Solaris 2.6
+
+Compiler: gcc
+
+Version: 2.8.1
+
+Repairs: 9
+
+No. of files Repaired: 13
+
+
+Compilation of Patches Required: yes
+
+Results Description:
+
+1) Tested suspicious code.
+
+2) Repaired problem code and added documentation to ntp.h.
+
+3) Verified ntpd works on critical Y2K dates.
+
+
+Comments:
+
+1) Errors were found in improper use of tm_year within struct tm,
+ calculations that did not support year 2000 as a leap year
+ (it truly is, despite any unchanged comments remaining in
+ the NTP source), and some incorrect date calculations, while
+ not traditional Y2K errors, would break in the year 2000.
+
+2) include/ntpd.h
+ Added some definitions and documentation about the right way
+ of doing things. Definitions used by most, if not all, of
+ the Y2K repairs.
+
+Cautions:
+
+1) Some of the Y2K repairs were to reference clock drivers that
+ we did not have the local hardware to test. While I believe
+ the changes are sound, they really need to be tested.
+ This includes:
+
+ refclock_arc.c
+ refclock_heath.c
+ refclock_hpgps.c
+
+ Also, parseutil/dcfd.c is another hardware dependent module that
+ was repaired without live testing.
+
+Non-Y2K Problems Observed:
+
+1) Inconsistent casts of variables containing time values may
+ make expansion to 64 bit integer values in a portable manner
+ difficult.
+
+2) libntp/caltontp.c:
+ Has logic I believe will fail starting in year 2100 or so.
+ Left unchanged/untested as it works well beyond basic NTP 2036
+ limit checked by check_y2k.c.
+ If NTP is implemented on 64-bit machines, this should be fixed
+
+3) ntpd/refclock_acts.c:
+ ACTS time format has changed somewhat since the code was written.
+ In particular the '*' '#' character switch no longer occurs...
+ only '*' is typed.
+
+ NOTE: Author (falsely) stated Y2K is NOT a leap year when it
+ really is.
+
+ TRUTH: ACTS will go beyond Y2K: it uses FourDigitYear % 100 values
+ for year so year 2000 will revert to "00".
+
+
+4) ntpd/refclock_oncore.c
+ Some very strange logic in manipulating year values:
+ 1122 instance->pp->year = buf[6]*256+buf[7];
+ Multiply by 256????
+
+ Response from PHK:
+ The entire protocol is binary, the year is a 16 bit quantity
+ which according to the manual can have the range 1998-2018.
+
diff --git a/README b/README
new file mode 100644
index 0000000..dde61e2
--- /dev/null
+++ b/README
@@ -0,0 +1,148 @@
+
+Submit patches, bug reports, and enhancement requests via
+
+ http://bugs.ntp.org
+
+ The ntp Distribution Base Directory
+
+This directory and its subdirectories contain the Network Time Protocol
+Version 4 (NTP) distribution for Unix and Windows/NT systems. This release
+may still work on VxWorks, too.
+
+The contents of the base directory are given in this file. The contents of
+subdirectories are given in the README files in each subdirectory.
+
+A complete explanation of the configure, compile and install process, as
+well as setting up an NTP subnet, is in the HTML pages in the ./html/
+directory. For more information on NTP and how to get a working setup,
+read WHERE-TO-START.
+
+For Windows/NT, visit html/build/hints/winnt.html .
+
+The base directory ./ contains the autoconfiguration files, source
+directories and related stuff:
+
+COPYRIGHT Excerpt from the HTML file ./html/copyright.html. This file
+ specifies copyright conditions, together with a list of
+ major authors and electric addresses.
+
+INSTALL Generic installation instructions for autoconf-based programs.
+ Unless you really know what you are doing, you should read the
+ directions in the HTML pages, starting with ./html/index.html.
+
+NEWS What's new in this release.
+
+README This file.
+
+README.bk Instructions for folks who use the BitKeeper-repository
+ version of NTP.
+
+README.hackers Notes to folks who want to hack on the code.
+
+TODO List of items the NTP developers are working on.
+
+WHERE-TO-START Hints on what to read in order to get a working
+ configuration.
+
+Makefile.am Automake file configuration file. Edit only if you have the
+ GNU automake and autoconf utilities installed.
+
+Makefile.in Autoconf make file template for Unix.
+
+adjtimed Directory containing the sources for the adjtime daemon
+ for HP/UX systems prior to HP-UX 10.0.
+
+authstuff Directory containing sources for miscellaneous programs
+ to test, calibrate and certify the cryptographic
+ mechanisms for DES and MD5 based authentication. These
+ programs do not include the cryptographic routines
+ themselves, so are free of U.S. export restrictions.
+
+build A script to build the distribution in A.`config.guess`
+ subdirectory (more or less).
+
+clockstuff Directory containing sources for miscellaneous programs
+ to test certain auxiliary programs used with some kernel
+ configurations, together with a program to calculate
+ propagation delays for use with radio clocks and
+ national time dissemination services such as WWV/WWVH,
+ WWVB and CHU.
+
+conf Directory containing a motley collection of
+ configuration files for various systems. For example only.
+
+config.guess Script used to identify the machine architecture and
+ operating system.
+
+config.h.in Configuration file generated automatically from
+ configure.in. Do not edit.
+
+configure Script used to configure the distribution. See the HTML pages
+ (./html/index.html) for a complete description of the options
+ available.
+
+configure.in Master configuration template. Edit only if you have the
+ GNU automake and autoconf utilities installed.
+
+dot.emacs C-mode indentation rules for code "Just the way Dave likes it".
+
+flock_build (UDel only) Build the distribution on a number of
+ different platforms.
+
+html Directory containing a complete set of documentation on
+ building and configuring a NTP server or client. The
+ documentation is in the form of HTML files suitable for
+ browsing and contains links to additional documentation
+ at various web sites. If a browser is unavailable, an
+ ordinary text editor can be used.
+
+include Directory containing include header files used by most
+ programs in the distribution.
+
+install-sh Script to install a program, script or data file.
+
+kernel Directory containing sources for kernel programs such as
+ line disciplines and STREAMS modules used with the CHU
+ decoder and precision PPS signals.
+
+libntp Directory containing library source code used by most
+ programs in the distribution.
+
+ntpdate Directory containing sources for a program to set the
+ local machine time from one or more remote machines
+ running NTP. Operates like rdate, but much more accurate.
+
+ntpq Directory containing sources for a utility program to
+ query local and remote NTP peers for state variables and
+ related timekeeping information. This program conforms
+ to Appendix A of the NTP Version 3 Specification RFC 1305.
+
+ntptrace Directory containing sources for a utility program that
+ can be used to reveal the chain of NTP peers from a
+ designated peer to the primary server at the root of the
+ timekeeping subnet.
+
+parse Directory containing files belonging to the generic
+ parse reference clock driver. For reasonably simple
+ clocks it is possible to get away with about 3-4Kb of
+ code. additionally the SunOS 4.x/Solaris 5.3 streams
+ module for parse squats here.
+
+patches Directory containing patches already applied to this
+ distribution. These are included for record and to help
+ in possible porting problems.
+
+scripts Directory containing scripts to build the configuration
+ files in this directory and then the makefiles used in
+ various dependent directories. the subdirectories
+ monitoring and support hold various perl and shell
+ scripts for visualizing synchronization and daemon startup.
+
+stamp.h.in Configuration file generated automatically from configure.in.
+ Do not edit.
+
+util Directory containing sources for various utility and
+ testing programs.
+
+David L. Mills (mills@udel.edu)
+21 June 1998
diff --git a/README.bk b/README.bk
new file mode 100644
index 0000000..8d8b296
--- /dev/null
+++ b/README.bk
@@ -0,0 +1,7 @@
+In order to use the BitKeeper repository version of NTP you should visit
+
+ http://support.ntp.org/Main/SoftwareDevelopment
+
+for important information.
+
+If you want to submit patches, please see the README.hackers file.
diff --git a/README.hackers b/README.hackers
new file mode 100644
index 0000000..dce4482
--- /dev/null
+++ b/README.hackers
@@ -0,0 +1,15 @@
+Notes to hackers.
+
+See README.patches for information about submitting patches.
+
+---
+
+Dave likes this code indented formatted in a consistent way.
+The file "dot.emacs" has the emacs C-mode indentation style that Dave likes.
+
+---
+
+We'd like to see *all* system function declarations live in include/l_stdlib.h
+and NEVER appear in the .c files.
+
+---
diff --git a/README.patches b/README.patches
new file mode 100644
index 0000000..f4cf755
--- /dev/null
+++ b/README.patches
@@ -0,0 +1,49 @@
+See README.hackers for notes on coding styles.
+
+The master copy of this information can be found at:
+
+ http://support.ntp.org/Dev/MaintainerIssues#How_to_work_on_a_bug_using_BitKe
+
+If you are going to patch both ntp-stable and ntp-dev
+please do it this way:
+
+ > cd ntp-stable
+ > (make and test your changes to ntp-stable first)
+ > (commit your changes to ntp-stable)
+ > cd ../ntp-dev
+ > bk pull ../ntp-stable (get your changes from ntp-stable)
+ > (resolve any problems and test your changes)
+ > (commit your changes to ntp-dev)
+
+With the current release of bitkeeper it is *much* easier to move changes
+from ntp-stable to ntp-dev than it is to move changes from ntp-dev to
+ntp-stable.
+
+If you make your changes in the above order and then submit them,
+it will be trivial to apply your patches.
+
+Otherwise, it will be much more difficult to apply your patches.
+
+You are pretty much done now if your repos are on pogo.udel.edu.
+
+If these patches are for a bugzilla issue, mark the issue as Resolved/READY
+with a comment of "Please pick up the patches in pogo:/wherever"
+
+---
+
+Please read (and follow) the previous section if you want to submit
+patches for both ntp-stable and ntp-dev.
+
+If you cannot easily get your patches to pogo, you may submit patches
+via the 'bk send' command:
+
+ > cd REPO
+ > bk citool (or bk ci ... ; bk commit ... )
+ > bk pull # make sure your repo is up-to-date
+ > bk send -d -ubk://www.ntp.org/home/bk/REPO - > file-containing-the-patch
+ > bk receive -vv -a < file-containing-the-patch
+ # Sanity check.
+
+ # Open a bugzilla item at <http://bugzilla.ntp.org>
+
+ # After the bug is opened, visit the bug and attach file-containing-the-patch
diff --git a/README.refclocks b/README.refclocks
new file mode 100644
index 0000000..99a2815
--- /dev/null
+++ b/README.refclocks
@@ -0,0 +1,50 @@
+This is a list of the #define REFCLK_* stuff.
+
+If you want to add a new refclock let us know and we'll assign you a number.
+
+Should this list also include the name of the party responsible for the
+refclock?
+
+LOCALCLOCK 1 /* external (e.g., lockclock) */
+GPS_TRAK 2 /* TRAK 8810 GPS Receiver */
+WWV_PST 3 /* PST/Traconex 1020 WWV/H */
+SPECTRACOM 4 /* Spectracom (generic) Receivers */
+TRUETIME 5 /* TrueTime (generic) Receivers */
+IRIG_AUDIO 6 /* IRIG-B/W audio decoder */
+CHU_AUDIO 7 /* CHU audio demodulator/decoder */
+PARSE 8 /* generic driver (usually DCF77,GPS,MSF) */
+GPS_MX4200 9 /* Magnavox MX4200 GPS */
+GPS_AS2201 10 /* Austron 2201A GPS */
+GPS_ARBITER 11 /* Arbiter 1088A/B/ GPS */
+IRIG_TPRO 12 /* KSI/Odetics TPRO-S IRIG */
+ATOM_LEITCH 13 /* Leitch CSD 5300 Master Clock */
+MSF_EES 14 /* EES M201 MSF Receiver */
+GPSTM_TRUE 15 /* OLD TrueTime GPS/TM-TMD Receiver */
+IRIG_BANCOMM 16 /* Bancomm GPS/IRIG Interface */
+GPS_DATUM 17 /* Datum Programmable Time System */
+NIST_ACTS 18 /* NIST Auto Computer Time Service */
+WWV_HEATH 19 /* Heath GC1000 WWV/WWVH Receiver */
+GPS_NMEA 20 /* NMEA based GPS clock */
+GPS_VME 21 /* TrueTime GPS-VME Interface */
+ATOM_PPS 22 /* 1-PPS Clock Discipline */
+PTB_ACTS NIST_ACTS
+USNO NIST_ACTS
+GPS_HP 26 /* HP 58503A Time/Frequency Receiver */
+ARCRON_MSF 27 /* ARCRON MSF radio clock. */
+SHM 28 /* clock attached thru shared memory */
+PALISADE 29 /* Trimble Navigation Palisade GPS */
+ONCORE 30 /* Motorola UT Oncore GPS */
+GPS_JUPITER 31 /* Rockwell Jupiter GPS receiver */
+CHRONOLOG 32 /* Chrono-log K WWVB receiver */
+DUMBCLOCK 33 /* Dumb localtime clock */
+ULINK 34 /* Ultralink M320 WWVB receiver */
+PCF 35 /* Conrad parallel port radio clock */
+WWV_AUDIO 36 /* WWV/H audio demodulator/decoder */
+FG 37 /* Forum Graphic GPS */
+HOPF_SERIAL 38 /* hopf DCF77/GPS serial line receiver */
+HOPF_PCI 39 /* hopf DCF77/GPS PCI receiver */
+JJY 40 /* JJY receiver */
+TT560 41 /* TrueTime 560 IRIG-B decoder */
+ZYFER 42 /* Zyfer GPStarplus receiver */
+RIPENCC 43 /* RIPE NCC Trimble driver */
+??????? 44 Claas Hilbrecht (20020711)
diff --git a/README.versions b/README.versions
new file mode 100644
index 0000000..018d59d
--- /dev/null
+++ b/README.versions
@@ -0,0 +1,27 @@
+
+NTP uses A.B.C - style release numbers.
+
+At the moment:
+
+ A is 4, for ntp V4.
+ B is the major release number.
+ C is the minor release number. Even numbers are 'stable' releases and
+ odd numbers are "development" releases.
+
+Following the release number may be the letter 'p' followed by a number.
+This indicates a point (or patch) release.
+
+Release candidates have -RC in the release number.
+
+Here are some recent versions numbers as an example:
+
+ 4.2.2 A production release (from the ntp-stable repository)
+ 4.2.2p2 A production release (from the ntp-stable repository)
+ 4.2.3p12 A development release
+ 4.2.3p15-rc1 A release candidate for 4.2.4
+
+Note that after the ntp-dev repo produces a production release it will
+be copied into the ntp-stable and the cycle will repeat.
+
+Feel free to suggest improvements...
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e72ee7b
--- /dev/null
+++ b/TODO
@@ -0,0 +1,122 @@
+
+ *** IF YOU CAN HELP FIX ANY OF THESE THINGS, PLEASE DO! ***
+
+010402: Look harder at -lm and -lelf - they are needed less and less...
+
+970711: Look Real Hard at changing the key stuff from u_long to u_int32.
+
+970711: Make sure it's safe to convert proto_config's 2nd argument from
+ u_long to u_int32. Watch "set" in ntp_request.c:setclr_flags().
+
+970318: in hourly_stats(?), squawk if the magnitude of the drift is,
+ say, >400.
+
+970301: Implement the utmp/wtmp timestamping on time steps.
+
+970210: Find a way to dump the current configuration to either syslog or
+ a file.
+
+Problems that need to be fixed:
+
+- Get rid of the old SYS_* macros:
+ (It's worth noting that any code that would have been "enabled" by any
+ of these macros has not been used since 5.83, and there have been very
+ few complaints...)
+
+ SYS_44BSD:
+ authstuff/md5driver.c
+
+ SYS_BSDI:
+ authstuff/md5driver.c
+
+ SYS_DECOSF1:
+ util/ntptime.c
+
+ SYS_DOMAINOS:
+ parseutil/dcfd.c
+ xntpd/ntpd.c
+
+ SYS_HPUX:
+ kernel/sys/ppsclock.h
+ ntpdate/ntpdate.c
+ ntptrace/ntptrace.c
+
+ SYS_PTX:
+ libntp/machines.c
+
+ SYS_SOLARIS:
+ libparse/parse.c
+ libparse/clk_trimtsip.c
+ xntpd/ntp_io.c
+ xntpd/ntp_refclock.c
+ xntpd/ntpd.c
+
+ SYS_SUNOS4:
+ libparse/parse.c
+ libparse/clk_trimsip.c
+
+ SYS_WINNT:
+ include/ntp.h
+ include/ntp_fp.h
+ include/ntp_if.h
+ include/ntp_machine.h
+ include/ntp_select.h
+ include/ntp_syslog.h
+ include/ntp_unixtime.h
+ include/ntpd.h
+ libntp/libntp.mak
+ libntp/machines.c
+ libntp/mexit.c
+ libntp/msyslog.c
+ libntp/systime.c
+ ntpdate/ntpdate.c
+ ntpdate/ntpdate.mak
+ ntpq/ntpq.c
+ ntpq/ntpq.mak
+ ntpq/ntpq_ops.c
+ ntptrace/ntptrace.c
+ ntptrace/ntptrace.mak
+ xntpd/ntp_config.c
+ xntpd/ntp_filegen.c
+ xntpd/ntp_intres.c
+ xntpd/ntp_io.c
+ xntpd/ntp_loopfilter.c
+ xntpd/ntp_peer.c
+ xntpd/ntp_proto.c
+ xntpd/ntp_refclock.c
+ xntpd/ntp_timer.c
+ xntpd/ntp_unixclock.c
+ xntpd/ntp_util.c
+ xntpd/ntpd.c
+ xntpd/xntpd.mak
+ xntpdc/ntpdc.c
+ xntpdc/xntpdc.mak
+
+- config.guess might need help to identify:
+
+ Fujitsu's UXP --enable-adjtime-is-accurate
+ --enable-step-slew
+
+ Unixware --enable-adjtime-is-accurate
+ --enable-tick=10000
+ --enable-tickadj=80
+ --enable-udp-wildcard
+ --disable-step-slew
+
+ DomainOS --enable-adjtime-is-accurate
+ --disable-kmem
+ --enable-tick=1000000
+
+ OpenVMS --enable-slew-always
+ --enable-hourly-todr-sync
+
+ Is adjtime accurate on ALL sysv4* machines?
+ Can we identify DomainOS with *-apollo-* ?
+ Do we catch all Unixware machines with *-univel-sysv* ?
+
+- Combine enable-step-slew and enable-ntpdate-step
+
+- Make sure enable-hourly-todr-sync is always disabled
+ What about NextStep and OpenVMS, where hourly TODR sync used to be enabled?
+
+- Check dcfd.c for variables that need to be volatile.
diff --git a/WHERE-TO-START b/WHERE-TO-START
new file mode 100644
index 0000000..74d376e
--- /dev/null
+++ b/WHERE-TO-START
@@ -0,0 +1,42 @@
+The Network Time Protocol (NTP) Version 4 Distribution
+
+This is a distribution of the Network Time Protocol (NTP) Version 4
+sources and documentation. NTP can be used by Unix, DEC VMS and
+Microsoft Windows NT platforms to synchronize the computer clock to
+external sources of time, such as other NTP time servers or a local
+radio clock. The daemon included in this distribution can operate as a
+server, a client, or a relay from a set of servers to a dependent client
+population on a local net. This distribution includes the daemon itself,
+plus utility programs and supporting documentation.
+
+You are welcome to the lot, with due consideration of the copyright
+information in the COPYRIGHT file. You are also invited to contribute
+bugfixes and drivers for new and exotic radios, telephones and sundials.
+This distribution is normally available by anonymous ftp as the
+compressed tar archive ntp-<version>.tar.gz in the pub/ntp directory on
+huey.udel.edu and <version> is the version number. The current stable
+and development version numbers can be found at <http://www.ntp.org>.
+
+A considerable amount of documentation, including build instructions,
+configuration advice, program usage and miscellaneous information is
+included in the ./html directory of this distribution. The intended
+access method is using a web browser such as netscape; however, the
+pages have been formatted so that viewing with an ordinary text editor
+is practical. Start the browser on the ./html/index.html page, which
+contains additional instructions and hotlinks to the remaining pages.
+Some hotlinks for the larger documents, such as related technical
+memoranda, reports and papers, lead to other web sites where this
+information is stashed. We apologize for the inconvenience this may
+cause for users without Internet and World Wide Web access.
+
+If you are an old hand and just want to build the distribution, you
+might find the INSTALL file a useful shortcut. A descriptive list of all
+files in the base directory of this distribution is in the README file.
+A list of "significant" changes for the release is in the NEWS file.
+
+If you're interested in helping us test pre-release versions of ntpd,
+please visit http://support.ntp.org/downloads and look for RC and/or
+Development tarballs.
+
+David L. Mills (mills@udel.edu)
+21 June 1998
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..4ae90ff
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1165 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# serial 9 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# If autoconf reports a warning
+# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+# but always AC_REQUIREd,
+# 2) to ensure that for each occurrence of
+# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+# or
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+# the corresponding gnulib module description has 'extensions' among
+# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+# invocation occurs in gl_EARLY, not in gl_INIT.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+ if test "$MINIX" = yes; then
+ AC_DEFINE([_POSIX_SOURCE], [1],
+ [Define to 1 if you need to in order for `stat' and other
+ things to work.])
+ AC_DEFINE([_POSIX_1_SOURCE], [2],
+ [Define to 2 if the system does not provide POSIX.1 features
+ except with this defined.])
+ AC_DEFINE([_MINIX], [1],
+ [Define to 1 if on MINIX.])
+ fi
+
+ dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+ dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+ dnl provided.
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_XOPEN_SOURCE], [500],
+ [Define to 500 only on HP-UX.])
+ ;;
+ esac
+
+ AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+])# AC_USE_SYSTEM_EXTENSIONS
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
+[
+ dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
+ dnl gnulib does not need it. But if it gets required by third-party macros
+ dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
+ dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
+ dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+ [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[ --enable-silent-rules less verbose build output (undo: `make V=1')
+ --disable-silent-rules verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([sntp/libopts/m4/libopts.m4])
+m4_include([sntp/libopts/m4/stdnoreturn.m4])
+m4_include([sntp/libevent/m4/openldap-thread-check.m4])
+m4_include([sntp/libevent/m4/openldap.m4])
+m4_include([sntp/m4/define_dir.m4])
+m4_include([sntp/m4/hms_search_lib.m4])
+m4_include([sntp/m4/libtool.m4])
+m4_include([sntp/m4/ltoptions.m4])
+m4_include([sntp/m4/ltsugar.m4])
+m4_include([sntp/m4/ltversion.m4])
+m4_include([sntp/m4/lt~obsolete.m4])
+m4_include([sntp/m4/ntp_cacheversion.m4])
+m4_include([sntp/m4/ntp_compiler.m4])
+m4_include([sntp/m4/ntp_crosscompile.m4])
+m4_include([sntp/m4/ntp_debug.m4])
+m4_include([sntp/m4/ntp_dir_sep.m4])
+m4_include([sntp/m4/ntp_facilitynames.m4])
+m4_include([sntp/m4/ntp_googletest.m4])
+m4_include([sntp/m4/ntp_ipv6.m4])
+m4_include([sntp/m4/ntp_lib_m.m4])
+m4_include([sntp/m4/ntp_libevent.m4])
+m4_include([sntp/m4/ntp_libntp.m4])
+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_prog_cc.m4])
+m4_include([sntp/m4/ntp_rlimit.m4])
+m4_include([sntp/m4/ntp_sntp.m4])
+m4_include([sntp/m4/ntp_ver_suffix.m4])
+m4_include([sntp/m4/ntp_vpathhack.m4])
+m4_include([sntp/m4/os_cflags.m4])
+m4_include([sntp/m4/snprintf.m4])
diff --git a/adjtimed/Makefile.am b/adjtimed/Makefile.am
new file mode 100644
index 0000000..b603fed
--- /dev/null
+++ b/adjtimed/Makefile.am
@@ -0,0 +1,21 @@
+## adjtimed Makefile.am
+
+bin_PROGRAMS = $(ADJTIMED_DB)
+libexec_PROGRAMS = $(ADJTIMED_DL)
+sbin_PROGRAMS = $(ADJTIMED_DS)
+
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_PROGRAMS = adjtimed
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/adjtimed/Makefile.in b/adjtimed/Makefile.in
new file mode 100644
index 0000000..67394eb
--- /dev/null
+++ b/adjtimed/Makefile.in
@@ -0,0 +1,890 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS =
+libexec_PROGRAMS =
+sbin_PROGRAMS =
+EXTRA_PROGRAMS = adjtimed$(EXEEXT)
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/bincheck.mf $(top_srcdir)/depsver.mf \
+ $(top_srcdir)/includes.mf $(top_srcdir)/sntp/check-libntp.mf
+subdir = adjtimed
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+adjtimed_SOURCES = adjtimed.c
+adjtimed_OBJECTS = adjtimed.$(OBJEXT)
+adjtimed_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+adjtimed_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = adjtimed.c
+DIST_SOURCES = adjtimed.c
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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@
+BUILT_SOURCES = check-libntp .deps-ver
+CLEANFILES = check-libntp .deps-ver
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(CPPFLAGS_NTP)
+LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(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 adjtimed/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign adjtimed/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+adjtimed$(EXEEXT): $(adjtimed_OBJECTS) $(adjtimed_DEPENDENCIES)
+ @rm -f adjtimed$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(adjtimed_OBJECTS) $(adjtimed_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimed.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-libexecPROGRAMS \
+ uninstall-sbinPROGRAMS
+
+.MAKE: all check install install-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-sbinPROGRAMS ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-hook \
+ install-html install-html-am install-info install-info-am \
+ install-libexecPROGRAMS install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-sbinPROGRAMS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-libexecPROGRAMS uninstall-sbinPROGRAMS
+
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/adjtimed/README b/adjtimed/README
new file mode 100644
index 0000000..d4bd593
--- /dev/null
+++ b/adjtimed/README
@@ -0,0 +1,22 @@
+------------------------------------------------------------------------------
+The adjtimed daemon emulates the BSD adjtime(2) system call. The
+adjtime() routine communicates with this daemon via SYSV messages.
+
+The emulation uses an undocumented kernel variable (as of 6.0/2.0
+and later releases) and as such it cannot be guaranteed to work in
+future HP-UX releases. Perhaps HP-UX will have a real adjtime(2)
+system call in the future.
+
+Author: Tai Jin (tai@sde.hp.com)
+------------------------------------------------------------------------------
+
+IMPORTANT NOTE: This stuff must be compiled with no optimization !!
+
+NOTE: This code is known to work as of 8.0 on s300's, s700's and s800's.
+ PLEASE do not modify it unless you have access to kernel sources
+ and fully understand the implications of any changes you are making.
+ One person already has trashed adjtimed by making it do "the right
+ thing". This is not an exact replacement for BSD adjtime(2), don't
+ try to make it into one.
+
+ -- Ken
diff --git a/adjtimed/adjtimed.c b/adjtimed/adjtimed.c
new file mode 100644
index 0000000..f38e66d
--- /dev/null
+++ b/adjtimed/adjtimed.c
@@ -0,0 +1,491 @@
+/*************************************************************************/
+/* (c) Copyright Tai Jin, 1988. All Rights Reserved. */
+/* Hewlett-Packard Laboratories. */
+/* */
+/* Permission is hereby granted for unlimited modification, use, and */
+/* distribution. This software is made available with no warranty of */
+/* any kind, express or implied. This copyright notice must remain */
+/* intact in all versions of this software. */
+/* */
+/* The author would appreciate it if any bug fixes and enhancements were */
+/* to be sent back to him for incorporation into future versions of this */
+/* software. Please send changes to tai@iag.hp.com or ken@sdd.hp.com. */
+/*************************************************************************/
+
+#ifndef lint
+static char RCSid[] = "adjtimed.c,v 3.1 1993/07/06 01:04:45 jbj Exp";
+#endif
+
+/*
+ * Adjust time daemon.
+ * This daemon adjusts the rate of the system clock a la BSD's adjtime().
+ * The adjtime() routine uses SYSV messages to communicate with this daemon.
+ *
+ * Caveat: This emulation uses an undocumented kernel variable. As such, it
+ * cannot be guaranteed to work in future HP-UX releases. Fortunately,
+ * it will no longer be needed in HPUX 10.01 and later.
+ */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/lock.h>
+#include <time.h>
+#include <signal.h>
+#include <nlist.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+
+#include "adjtime.h"
+
+double atof (const char *);
+
+int InitClockRate (void);
+int AdjustClockRate (register struct timeval *delta, register struct timeval *olddelta);
+long GetClockRate (void);
+int SetClockRate (long);
+void ResetClockRate (void);
+void Cleanup (void);
+void Exit (int);
+
+#define MILLION 1000000L
+
+/* emacs cc-mode goes nuts if we split the next line... */
+#define tvtod(tv) ((double)tv.tv_sec + ((double)tv.tv_usec / (double)MILLION))
+
+char *progname = NULL;
+int verbose = 0;
+int sysdebug = 0;
+static int mqid;
+static double oldrate = 0.0;
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ struct timeval remains;
+ struct sigvec vec;
+ MsgBuf msg;
+ char ch;
+ int nofork = 0;
+ int fd;
+
+ progname = argv[0];
+
+#ifdef LOG_LOCAL6
+ openlog("adjtimed", LOG_PID, LOG_LOCAL6);
+#else
+ openlog("adjtimed", LOG_PID);
+#endif
+
+ while ((ch = ntp_getopt(argc, argv, "hkrvdfp:")) != EOF) {
+ switch (ch) {
+ case 'k':
+ case 'r':
+ if ((mqid = msgget(KEY, 0)) != -1) {
+ if (msgctl(mqid, IPC_RMID, (struct msqid_ds *)0) == -1) {
+ msyslog(LOG_ERR, "remove old message queue: %m");
+ perror("adjtimed: remove old message queue");
+ exit(1);
+ }
+ }
+
+ if (ch == 'k')
+ exit(0);
+
+ break;
+
+ case 'v':
+ ++verbose, nofork = 1;
+ break;
+
+ case 'd':
+ ++sysdebug;
+ break;
+
+ case 'f':
+ nofork = 1;
+ break;
+
+ case 'p':
+ fputs("adjtimed: -p option ignored\n", stderr);
+ break;
+
+ default:
+ puts("usage: adjtimed -hkrvdf");
+ puts("-h\thelp");
+ puts("-k\tkill existing adjtimed, if any");
+ puts("-r\trestart (kills existing adjtimed, if any)");
+ puts("-v\tdebug output (repeat for more output)");
+ puts("-d\tsyslog output (repeat for more output)");
+ puts("-f\tno fork");
+ msyslog(LOG_ERR, "usage error");
+ exit(1);
+ } /* switch */
+ } /* while */
+
+ if (!nofork) {
+ switch (fork()) {
+ case 0:
+ close(fileno(stdin));
+ close(fileno(stdout));
+ close(fileno(stderr));
+
+#ifdef TIOCNOTTY
+ if ((fd = open("/dev/tty")) != -1) {
+ ioctl(fd, TIOCNOTTY, 0);
+ close(fd);
+ }
+#else
+ setpgrp();
+#endif
+ break;
+
+ case -1:
+ msyslog(LOG_ERR, "fork: %m");
+ perror("adjtimed: fork");
+ exit(1);
+
+ default:
+ exit(0);
+ } /* switch */
+ } /* if */
+
+ if (nofork) {
+ setvbuf(stdout, NULL, _IONBF, BUFSIZ);
+ setvbuf(stderr, NULL, _IONBF, BUFSIZ);
+ }
+
+ msyslog(LOG_INFO, "started");
+ if (verbose) printf("adjtimed: started\n");
+
+ if (InitClockRate() == -1)
+ Exit(2);
+
+ (void)signal(SIGHUP, SIG_IGN);
+ (void)signal(SIGINT, SIG_IGN);
+ (void)signal(SIGQUIT, SIG_IGN);
+ (void)signal(SIGTERM, Cleanup);
+
+ vec.sv_handler = ResetClockRate;
+ vec.sv_flags = 0;
+ vec.sv_mask = ~0;
+ sigvector(SIGALRM, &vec, (struct sigvec *)0);
+
+ if (msgget(KEY, IPC_CREAT|IPC_EXCL) == -1) {
+ if (errno == EEXIST) {
+ msyslog(LOG_ERR, "message queue already exists, use -r to remove it");
+ fputs("adjtimed: message queue already exists, use -r to remove it\n",
+ stderr);
+ Exit(1);
+ }
+
+ msyslog(LOG_ERR, "create message queue: %m");
+ perror("adjtimed: create message queue");
+ Exit(1);
+ }
+
+ if ((mqid = msgget(KEY, 0)) == -1) {
+ msyslog(LOG_ERR, "get message queue id: %m");
+ perror("adjtimed: get message queue id");
+ Exit(1);
+ }
+
+ /* Lock process in memory to improve response time */
+ if (plock(PROCLOCK)) {
+ msyslog(LOG_ERR, "plock: %m");
+ perror("adjtimed: plock");
+ Cleanup();
+ }
+
+ /* Also raise process priority.
+ * If we do not get run when we want, this leads to bad timekeeping
+ * and "Previous time adjustment didn't complete" gripes from xntpd.
+ */
+ if (nice(-10) == -1) {
+ msyslog(LOG_ERR, "nice: %m");
+ perror("adjtimed: nice");
+ Cleanup();
+ }
+
+ for (;;) {
+ if (msgrcv(mqid, &msg.msgp, MSGSIZE, CLIENT, 0) == -1) {
+ if (errno == EINTR) continue;
+ msyslog(LOG_ERR, "read message: %m");
+ perror("adjtimed: read message");
+ Cleanup();
+ }
+
+ switch (msg.msgb.code) {
+ case DELTA1:
+ case DELTA2:
+ AdjustClockRate(&msg.msgb.tv, &remains);
+
+ if (msg.msgb.code == DELTA2) {
+ msg.msgb.tv = remains;
+ msg.msgb.mtype = SERVER;
+
+ while (msgsnd(mqid, &msg.msgp, MSGSIZE, 0) == -1) {
+ if (errno == EINTR) continue;
+ msyslog(LOG_ERR, "send message: %m");
+ perror("adjtimed: send message");
+ Cleanup();
+ }
+ }
+
+ if (remains.tv_sec + remains.tv_usec != 0L) {
+ if (verbose) {
+ printf("adjtimed: previous correction remaining %.6fs\n",
+ tvtod(remains));
+ }
+ if (sysdebug) {
+ msyslog(LOG_INFO, "previous correction remaining %.6fs",
+ tvtod(remains));
+ }
+ }
+ break;
+
+ default:
+ fprintf(stderr, "adjtimed: unknown message code %d\n", msg.msgb.code);
+ msyslog(LOG_ERR, "unknown message code %d", msg.msgb.code);
+ } /* switch */
+ } /* loop */
+} /* main */
+
+/*
+ * Default clock rate (old_tick).
+ */
+#define DEFAULT_RATE (MILLION / HZ)
+#define UNKNOWN_RATE 0L
+#define TICK_ADJ 5 /* standard adjustment rate, microsec/tick */
+
+static long default_rate = DEFAULT_RATE;
+static long tick_rate = HZ; /* ticks per sec */
+static long slew_rate = TICK_ADJ * HZ; /* in microsec/sec */
+
+int
+AdjustClockRate(
+ register struct timeval *delta,
+ register struct timeval *olddelta
+ )
+{
+ register long rate, dt, leftover;
+ struct itimerval period, remains;
+
+ dt = (delta->tv_sec * MILLION) + delta->tv_usec;
+
+ if (verbose)
+ printf("adjtimed: new correction %.6fs\n", (double)dt / (double)MILLION);
+ if (sysdebug)
+ msyslog(LOG_INFO, "new correction %.6fs", (double)dt / (double)MILLION);
+ if (verbose > 2) printf("adjtimed: leftover %ldus\n", leftover);
+ if (sysdebug > 2) msyslog(LOG_INFO, "leftover %ldus", leftover);
+ rate = dt;
+
+ /*
+ * Apply a slew rate of slew_rate over a period of dt/slew_rate seconds.
+ */
+ if (dt > 0) {
+ rate = slew_rate;
+ } else {
+ rate = -slew_rate;
+ dt = -dt;
+ }
+ period.it_value.tv_sec = dt / slew_rate;
+ period.it_value.tv_usec = (dt % slew_rate) * (MILLION / slew_rate);
+ /*
+ * Note: we assume the kernel will convert the specified period into ticks
+ * using the modified clock rate rather than an assumed nominal clock rate,
+ * and therefore will generate the timer interrupt after the specified
+ * number of true seconds, not skewed seconds.
+ */
+
+ if (verbose > 1)
+ printf("adjtimed: will be complete in %lds %ldus\n",
+ period.it_value.tv_sec, period.it_value.tv_usec);
+ if (sysdebug > 1)
+ msyslog(LOG_INFO, "will be complete in %lds %ldus",
+ period.it_value.tv_sec, period.it_value.tv_usec);
+ /*
+ * adjust the clock rate
+ */
+ if (dt) {
+ if (SetClockRate((rate / tick_rate) + default_rate) == -1) {
+ msyslog(LOG_ERR, "set clock rate: %m");
+ perror("adjtimed: set clock rate");
+ }
+ }
+ /*
+ * start the timer
+ * (do this after changing the rate because the period has been rounded down)
+ */
+ period.it_interval.tv_sec = period.it_interval.tv_usec = 0L;
+ setitimer(ITIMER_REAL, &period, &remains);
+ /*
+ * return old delta
+ */
+ if (olddelta) {
+ dt = ((remains.it_value.tv_sec * MILLION) + remains.it_value.tv_usec) *
+ oldrate;
+ olddelta->tv_sec = dt / MILLION;
+ olddelta->tv_usec = dt - (olddelta->tv_sec * MILLION);
+ }
+
+ oldrate = (double)rate / (double)MILLION;
+ return(0);
+} /* AdjustClockRate */
+
+static struct nlist nl[] = {
+#ifdef __hp9000s800
+#ifdef PRE7_0
+ { "tick" },
+#else
+ { "old_tick" },
+#endif
+#else
+ { "_old_tick" },
+#endif
+ { "" }
+};
+
+static int kmem;
+
+/*
+ * The return value is the clock rate in old_tick units or -1 if error.
+ */
+long
+GetClockRate(void)
+{
+ long rate, mask;
+
+ if (lseek(kmem, (off_t)nl[0].n_value, 0) == -1L)
+ return (-1L);
+
+ mask = sigblock(sigmask(SIGALRM));
+
+ if (read(kmem, (caddr_t)&rate, sizeof(rate)) != sizeof(rate))
+ rate = UNKNOWN_RATE;
+
+ sigsetmask(mask);
+ return (rate);
+} /* GetClockRate */
+
+/*
+ * The argument is the new rate in old_tick units.
+ */
+int
+SetClockRate(
+ long rate
+ )
+{
+ long mask;
+
+ if (lseek(kmem, (off_t)nl[0].n_value, 0) == -1L)
+ return (-1);
+
+ mask = sigblock(sigmask(SIGALRM));
+
+ if (write(kmem, (caddr_t)&rate, sizeof(rate)) != sizeof(rate)) {
+ sigsetmask(mask);
+ return (-1);
+ }
+
+ sigsetmask(mask);
+
+ if (rate != default_rate) {
+ if (verbose > 3) {
+ printf("adjtimed: clock rate (%lu) %ldus/s\n", rate,
+ (rate - default_rate) * tick_rate);
+ }
+ if (sysdebug > 3) {
+ msyslog(LOG_INFO, "clock rate (%lu) %ldus/s", rate,
+ (rate - default_rate) * tick_rate);
+ }
+ }
+
+ return (0);
+} /* SetClockRate */
+
+int
+InitClockRate(void)
+{
+ if ((kmem = open("/dev/kmem", O_RDWR)) == -1) {
+ msyslog(LOG_ERR, "open(/dev/kmem): %m");
+ perror("adjtimed: open(/dev/kmem)");
+ return (-1);
+ }
+
+ nlist("/hp-ux", nl);
+
+ if (nl[0].n_type == 0) {
+ fputs("adjtimed: /hp-ux has no symbol table\n", stderr);
+ msyslog(LOG_ERR, "/hp-ux has no symbol table");
+ return (-1);
+ }
+ /*
+ * Set the default to the system's original value
+ */
+ default_rate = GetClockRate();
+ if (default_rate == UNKNOWN_RATE) default_rate = DEFAULT_RATE;
+ tick_rate = (MILLION / default_rate);
+ slew_rate = TICK_ADJ * tick_rate;
+ fprintf(stderr,"default_rate=%ld, tick_rate=%ld, slew_rate=%ld\n",default_rate,tick_rate,slew_rate);
+
+ return (0);
+} /* InitClockRate */
+
+/*
+ * Reset the clock rate to the default value.
+ */
+void
+ResetClockRate(void)
+{
+ struct itimerval it;
+
+ it.it_value.tv_sec = it.it_value.tv_usec = 0L;
+ setitimer(ITIMER_REAL, &it, (struct itimerval *)0);
+
+ if (verbose > 2) puts("adjtimed: resetting the clock");
+ if (sysdebug > 2) msyslog(LOG_INFO, "resetting the clock");
+
+ if (GetClockRate() != default_rate) {
+ if (SetClockRate(default_rate) == -1) {
+ msyslog(LOG_ERR, "set clock rate: %m");
+ perror("adjtimed: set clock rate");
+ }
+ }
+
+ oldrate = 0.0;
+} /* ResetClockRate */
+
+void
+Cleanup(void)
+{
+ ResetClockRate();
+
+ if (msgctl(mqid, IPC_RMID, (struct msqid_ds *)0) == -1) {
+ if (errno != EINVAL) {
+ msyslog(LOG_ERR, "remove message queue: %m");
+ perror("adjtimed: remove message queue");
+ }
+ }
+
+ Exit(2);
+} /* Cleanup */
+
+void
+Exit(status)
+ int status;
+{
+ msyslog(LOG_ERR, "terminated");
+ closelog();
+ if (kmem != -1) close(kmem);
+ exit(status);
+} /* Exit */
diff --git a/bincheck.mf b/bincheck.mf
new file mode 100644
index 0000000..67f461f
--- /dev/null
+++ b/bincheck.mf
@@ -0,0 +1,17 @@
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
diff --git a/bootstrap b/bootstrap
new file mode 100755
index 0000000..2368af3
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,171 @@
+#! /bin/sh
+
+# This "bootstrap" script performs various pre-autoreconf actions
+# that are required after pulling fresh sources from the repository.
+#
+# --force is supported and will be passed to autoreconf
+#
+# NOTE: THE NTP VERSION NUMBER COMES FROM packageinfo.sh
+#
+# all other instances of it anywhere in the source base have propagated
+# from this one source.
+#
+# To use the raw sources from the repository, you must have the following
+# tools available to you:
+#
+# 1. Autoconf and Automake.
+#
+# 2. lynx. This is used to extract the COPYRIGHT file extracted from
+# the html documentation.
+#
+# *** The following are no longer needed for simple builds from the repo
+# 3. AutoGen. The repository does *not* contain the files generated from
+# the option definition files and it does not contain the libopts
+# tear-off/redistributable library.
+#
+# Note: AutoGen needs GNU Guile.
+#
+# 4. gunzip. The tear-off library is a gzipped tarball.
+
+set -e
+
+(cd sntp && ../scripts/build/genver) || {
+ echo scripts/build/genver failed ; exit 1; }
+
+# autoreconf says:
+# The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
+# AUTOPOINT, LIBTOOLIZE, M4 are honored.
+
+AUTORECONF=${AUTORECONF:-autoreconf}
+
+# case `hostname` in
+# pogo.udel.edu)
+# if fgrep -q 4.2.4 sntp/m4/version.m4; then
+# AUTOCONF=autoconf-2.59
+# AUTOHEADER=autoheader-2.59
+# AUTOMAKE=automake-1.9
+# ACLOCAL=aclocal-1.9
+# export AUTOCONF AUTOHEADER AUTOMAKE ACLOCAL
+# fi
+# ;;
+# esac
+
+# 20060629: HMS: Let's try checking in libopts and the autogen-generated files
+## The copy for ntp...
+#rm -rf libopts*
+#gunzip -c $(autoopts-config --libsrc) | (
+# tar -xvf -
+# mv libopts-*.*.* libopts )
+
+## The copy for sntp...
+#rm -rf sntp/libopts*
+#gunzip -c $(autoopts-config --libsrc) | (
+# cd sntp
+# tar -xvf -
+# mv libopts-*.*.* libopts )
+
+def_files=`find [B-Za-z]* -type f -name '*.def' -print | fgrep -v /SCCS/`
+prog_opt_files=`grep -l '^prog.name' $def_files`
+
+## AutoGen stuff
+
+#incdir=${PWD}/include
+
+#for f in ${prog_opt_files}
+#do
+# ( cd $(dirname ${f})
+# echo "Running autogen on $f..."
+# autogen -L${incdir} $(basename ${f})
+# ) || exit 1
+#done
+
+## Non-AutoGen stuff
+
+# touch the stuff generated by the opt files
+
+l=
+lh=
+li=
+for f in ${prog_opt_files}
+do
+ f=`echo $f | sed -e 's/-opts.def//' -e 's/.def//'`
+ dfi=`dirname $f`
+ dfi=`echo $dfi | sed -e 's:$:/invoke-*:'`
+ for i in `ls -1 $f* $dfi`
+ do
+ case "$i" in
+ *invoke-*)
+ li="$li $i"
+ ;;
+ *.c|*.h|*.[1-9]*man|*.[1-9]*mdoc|*.man.in|*.mdoc.in|*-opts|*.texi|*.menu)
+ l="$l $i"
+ ;;
+ *.html)
+ lh="$lh $i"
+ ;;
+ esac
+ done
+done
+case "$l" in
+ '') ;;
+ *) touch $l
+ echo "Touching <$l>"
+ sleep 1
+ ;;
+esac
+case "$li" in
+ '') ;;
+ *) touch $li
+ echo "Touching <$li>"
+ sleep 1
+ ;;
+esac
+case "$lh" in
+ '') ;;
+ *) touch $lh
+ echo "Touching <$lh>"
+ ;;
+esac
+
+## EOAutoGen stuff
+
+# Yacc/bison files ntp_parser.[ch] so we don't require the tool if
+# ntp_parser.y hasn't been updated. At the same time, keyword-gen-utd
+# and ntp_keyword.h which are derived from ntp_parser.h and
+# keyword-gen.c.
+
+touch ntpd/ntp_parser.[ch] ntpd/keyword-gen-utd ntpd/ntp_keyword.h
+
+cp bincheck.mf sntp/
+cp depsver.mf sntp/
+
+${AUTORECONF} -i -v "$@"
+
+# Because some systems do not support 'test a -nt b'
+case `ls -1tr config.h.in aclocal.m4 | tail -1` in
+ aclocal.m4) touch config.h.in ;;
+esac
+case `ls -1tr sntp/config.h.in sntp/aclocal.m4 | tail -1` in
+ sntp/aclocal.m4) touch sntp/config.h.in ;;
+esac
+case `ls -1tr sntp/libevent/config.h.in sntp/libevent/aclocal.m4 | tail -1` in
+ sntp/libevent/aclocal.m4) touch sntp/libevent/config.h.in ;;
+esac
+
+# DH: 20110118: Due to our workaround for the AM_COND_IF bug that was
+# triggering the buggy recursive autoreconf, we can once again use a
+# single autoreconf invocation. See
+# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7860
+# DH: 20101120: We are back to a single copy of libopts, and
+# once again it seems we need to run autoreconf in sntp after
+# the top-level run to get a correct sntp/libopts/Makefile.in.
+# To reduce redundancy, the top-level autoreconf uses --no-recursive.
+#
+# HMS: 20060618: Now that we use separate copies of libopts
+# we should only need the previous line.
+#
+## HMS: 20060615: the next line seems to be needed to make sure
+## we get the correct srcdir path in sntp/libopts/Makefile.in
+#rm -rf sntp/autom4te.cache
+#
+# (cd sntp && ${AUTORECONF} -i -v "$@")
diff --git a/build b/build
new file mode 100755
index 0000000..75f20a2
--- /dev/null
+++ b/build
@@ -0,0 +1,200 @@
+#! /bin/sh
+
+LOGF=make.log
+IAM=`hostname || uname -n`
+MYNAME=`IFS=. ; set $IAM ; echo $1`
+SIG=
+
+case "$1" in
+ 0.*)
+ SIG=$1
+ shift
+ CONFIG_ARGS="$@"
+ KEY=`sed -e q < .buildkey-$MYNAME`
+ case "$SIG" in
+ $KEY) ;;
+ *)
+ echo "Wrong directory for build on host $IAM"
+ echo "This is <`pwd`>"
+ echo "SIG is <$SIG>"
+ echo "KEY is <$KEY>"
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ CONFIG_ARGS="$@"
+ ;;
+esac
+
+#set -e
+#set -x
+
+if [ ! -r sntp/libevent/build-aux/config.guess ] ; then
+ echo "Error: bootstrap required." 1>&2 && exit 1
+fi
+
+# sntp/scripts/cvo.sh invokes config.guess, and we want it to use the copy
+# in the build-aux directory if there's not another config.guess earlier
+# on the path, so we invoke it using env to append to the PATH.
+
+CVO=`env PATH="$PATH:./sntp/libevent/build-aux" sntp/scripts/cvo.sh @cvo@`
+case "$CVO" in
+ *-*-*-*) echo "sntp/scripts/cvo.sh returned <$CVO>, which makes no sense to me."
+ exit 1
+ ;;
+ *-*-*) ;;
+ *) echo "sntp/scripts/cvo.sh returned <$CVO>, which makes no sense to me."
+ exit 1
+ ;;
+esac
+
+case "$NTP_BDIR" in
+ '')
+ case "$IAM" in
+ *.ntp.org)
+ NTP_BDIR=host
+ ;;
+ *.udel.edu)
+ NTP_BDIR=host
+ # HMS: --enable-local-libopts is the default now...
+ #CONFIG_ARGS="$CONFIG_ARGS --enable-local-libopts"
+ case "$CVO" in
+ *-*-ultrix*)
+ CONFIG_ARGS="$CONFIG_ARGS --with-libregex=/usr/local"
+ ;;
+ esac
+ ;;
+ *)
+ NTP_BDIR=cvo
+ ;;
+ esac
+ ;;
+esac
+
+case "$NTP_BDIR" in
+ host)
+ BASEDIR=A.$MYNAME
+ ;;
+ cvo)
+ BASEDIR=A.$CVO
+ ;;
+ *)
+ echo "build: NTP_BDIR must be either 'cvo' or 'host'!" 1>&2
+ exit 1
+ ;;
+esac
+
+KEYSUF=""
+
+case "$CONFIG_ARGS" in
+ *--with-crypto=autokey*)
+ KEYSUF="-autokey"
+ ;;
+ *--without-crypto*)
+ KEYSUF="-noopenssl"
+ ;;
+esac
+
+case "$CONFIG_ARGS" in
+ *--disable-all-clocks*)
+ KEYSUF="$KEYSUF-no-refclocks"
+ ;;
+esac
+
+case "$CONFIG_ARGS" in
+ *--disable-debugging*)
+ KEYSUF="$KEYSUF-nodebug"
+ ;;
+esac
+
+case "$CC" in
+ '')
+ CCSUF=""
+ ;;
+ *)
+ CCSUF="-`echo $CC | sed -e 's: :_:g' -e's:/:+:g'`"
+ ;;
+esac
+
+BDIR="$BASEDIR$KEYSUF$CCSUF"
+
+[ -d "$BDIR" ] || mkdir $BDIR
+[ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo
+[ -f "$BDIR/.buildhost" ] || echo $IAM > $BDIR/.buildhost
+
+
+cd $BDIR
+
+#
+# Make sure we have a nice that works.
+# To disable use of nice, setenv NO_NICE_BUILD=1
+#
+NICEB=
+[ "$NO_NICE_BUILD" != "1" ] && nice true && NICEB=nice
+[ -z "$NICEB" ] && {
+ NICEB="./.nicebuild-$MYNAME-$SIG"
+ cat > $NICEB <<-HEREDOC
+ #! /bin/sh
+ shift
+ \$*
+HEREDOC
+ chmod +x $NICEB
+}
+
+#
+# Find a test which supports -nt, unlike Solaris /bin/sh builtin.
+#
+TEST="${TEST-}"
+if [ -z "$TEST" ] ; then
+ for try in test /bin/test /usr/bin/test ; do
+ case `$try config.status -nt ../configure 2>&1` in
+ '')
+ TEST="$try"
+ # echo "Using $TEST"
+ break
+ ;;
+ esac
+ done
+ if [ -z "$TEST" ] ; then
+ echo "build: need help finding test binary" 1>&2
+ exit 1
+ fi
+fi
+
+CONFIGURE="../configure --cache-file=../config.cache-$IAM$CCSUF $CONFIG_ARGS"
+
+( # This sequence of commands is logged to make.log.
+ # If config.status is newer than ../configure, and the same
+ # is true for sntp, we do not need to re-run configure.
+ # For libevent, the twist is we may not be configuring the
+ # tearoff, so only act if its config.status exists.
+ # Solaris /bin/sh doesn't grok -nt.
+
+ ( "$TEST" config.status -nt ../configure &&
+ "$TEST" sntp/config.status -nt ../sntp/configure &&
+ ( "$TEST" '!' -f sntp/libevent/config.status ||
+ "$TEST" sntp/libevent/config.status -nt ../sntp/libevent/configure ) ) ||
+ "$NICEB" -7 $CONFIGURE
+ "$TEST" Makefile -nt config.status ||
+ "$NICEB" -5 ./config.status
+ "$TEST" sntp/Makefile -nt sntp/config.status ||
+ ( cd sntp && "$NICEB" -5 ./config.status )
+ "$TEST" '!' -f sntp/libevent/Makefile ||
+ "$TEST" sntp/libevent/Makefile -nt sntp/libevent/config.status ||
+ ( cd sntp/libevent && "$NICEB" -5 ./config.status )
+ "$NICEB" -14 ${MAKE-make} && "$NICEB" -11 ${MAKE-make} check
+) > $LOGF 2>&1
+
+EXITCODE=$?
+
+# clean up if we made a dummy nice script
+case "$NICEB" in
+ nice)
+ ;;
+ *)
+ rm "$NICEB"
+ ;;
+esac
+
+exit $EXITCODE
diff --git a/check-libopts.mf b/check-libopts.mf
new file mode 100644
index 0000000..9f9b9e0
--- /dev/null
+++ b/check-libopts.mf
@@ -0,0 +1,14 @@
+## check-libopts.mf - automake fragment
+##
+## If we are not using the tearoff libopts, we won't be
+## building its libopts.la, so the submake is allowed
+## to fail.
+
+BUILT_SOURCES += check-libopts
+CLEANFILES += check-libopts
+
+check-libopts: ../sntp/libopts/libopts.la
+ @echo stamp > $@
+
+../sntp/libopts/libopts.la:
+ -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
diff --git a/clockstuff/Makefile.am b/clockstuff/Makefile.am
new file mode 100644
index 0000000..d909fbf
--- /dev/null
+++ b/clockstuff/Makefile.am
@@ -0,0 +1,17 @@
+noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@
+EXTRA_PROGRAMS = propdelay chutest
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+propdelay_LDADD = $(LDADD)
+
+BUILT_SOURCES =
+CLEANFILES =
+
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/clockstuff/Makefile.in b/clockstuff/Makefile.in
new file mode 100644
index 0000000..179c98d
--- /dev/null
+++ b/clockstuff/Makefile.in
@@ -0,0 +1,749 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = propdelay$(EXEEXT) chutest$(EXEEXT)
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/check-libntp.mf
+subdir = clockstuff
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+chutest_SOURCES = chutest.c
+chutest_OBJECTS = chutest.$(OBJEXT)
+chutest_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+chutest_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+propdelay_SOURCES = propdelay.c
+propdelay_OBJECTS = propdelay.$(OBJEXT)
+am__DEPENDENCIES_2 = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+propdelay_DEPENDENCIES = $(am__DEPENDENCIES_2)
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = chutest.c propdelay.c
+DIST_SOURCES = chutest.c propdelay.c
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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@
+noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(CPPFLAGS_NTP)
+LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+propdelay_LDADD = $(LDADD)
+BUILT_SOURCES = check-libntp .deps-ver
+CLEANFILES = check-libntp .deps-ver
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/sntp/check-libntp.mf $(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 clockstuff/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign clockstuff/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+chutest$(EXEEXT): $(chutest_OBJECTS) $(chutest_DEPENDENCIES)
+ @rm -f chutest$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(chutest_OBJECTS) $(chutest_LDADD) $(LIBS)
+propdelay$(EXEEXT): $(propdelay_OBJECTS) $(propdelay_DEPENDENCIES)
+ @rm -f propdelay$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(propdelay_OBJECTS) $(propdelay_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chutest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propdelay.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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/clockstuff/README b/clockstuff/README
new file mode 100644
index 0000000..14089a9
--- /dev/null
+++ b/clockstuff/README
@@ -0,0 +1,21 @@
+README file for directory ./clockstuff of the NTP Version 4 distribution
+
+This directory contains the sources for utility programs designed to
+support radio clocks. chutest.c is desgined to test the depredated
+chu_clk line discipline or STREAMS module and can also test a CHU
+modem in raw mode.
+
+You can make things in here by typing one or more of:
+
+ make propdelay (or `make')
+ make chutest
+
+Propdelay computes high frequency propagation delays, given the
+longitude and latitude of the transmitter and receiver. Use
+this for WWV/H and CHU. Don't use it for WWVB (the computation
+is easier for that).
+
+Chutest can be used to input and process data from a CHU modem
+attached to a serial port. It will use the CHU line discipline
+(if installed), or raw mode otherwise. This was used to test
+out the initial reduction algorithms, and may not be up to date.
diff --git a/clockstuff/chutest.c b/clockstuff/chutest.c
new file mode 100644
index 0000000..488a0d1
--- /dev/null
+++ b/clockstuff/chutest.c
@@ -0,0 +1,821 @@
+/* chutest.c,v 3.1 1993/07/06 01:05:21 jbj Exp
+ * chutest - test the CHU clock
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <stdio.h>
+#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_STROPTS_H
+# include <stropts.h>
+#else
+# ifdef HAVE_SYS_STROPTS_H
+# include <sys/stropts.h>
+# endif
+#endif
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/file.h>
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#else
+# ifdef HAVE_SGTTY_H
+# include <sgtty.h>
+# endif
+#endif
+
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#ifdef CHULDISC
+# ifdef HAVE_SYS_CHUDEFS_H
+# include <sys/chudefs.h>
+# endif
+#endif
+
+
+#ifndef CHULDISC
+#define NCHUCHARS (10)
+
+struct chucode {
+ u_char codechars[NCHUCHARS]; /* code characters */
+ u_char ncodechars; /* number of code characters */
+ u_char chustatus; /* not used currently */
+ struct timeval codetimes[NCHUCHARS]; /* arrival times */
+};
+#endif
+
+#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
+
+char *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 */
+int doprocess = 0; /* set to 1 when we do processing analogous to driver */
+#ifdef CHULDISC
+int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */
+#endif
+#ifdef STREAM
+int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */
+#endif
+
+struct timeval lasttv;
+struct chucode chudata;
+
+void error(char *fmt, char *s1, char *s2);
+void init_chu(void);
+int openterm(char *dev);
+int process_raw(int s);
+int process_ldisc(int s);
+void raw_filter(unsigned int c, struct timeval *tv);
+void chufilter(struct chucode *chuc, l_fp *rtime);
+
+
+/*
+ * main - parse arguments and handle options
+ */
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ int c;
+ int errflg = 0;
+ extern int ntp_optind;
+
+ progname = argv[0];
+ while ((c = ntp_getopt(argc, argv, "cdfpt")) != EOF)
+ switch (c) {
+ case 'c':
+#ifdef STREAM
+ usechuldisc = 1;
+ break;
+#endif
+#ifdef CHULDISC
+ usechuldisc = 1;
+ break;
+#endif
+#ifndef STREAM
+#ifndef CHULDISC
+ (void) fprintf(stderr,
+ "%s: CHU line discipline not available on this machine\n",
+ progname);
+ exit(2);
+#endif
+#endif
+ case 'd':
+ ++debug;
+ break;
+ case 'f':
+ dofilter = 1;
+ break;
+ case 'p':
+ doprocess = 1;
+ case 't':
+ showtimes = 1;
+ break;
+ default:
+ errflg++;
+ break;
+ }
+ if (errflg || ntp_optind+1 != argc) {
+#ifdef STREAM
+ (void) fprintf(stderr, "usage: %s [-dft] tty_device\n",
+ progname);
+#endif
+#ifdef CHULDISC
+ (void) fprintf(stderr, "usage: %s [-dft] tty_device\n",
+ progname);
+#endif
+#ifndef STREAM
+#ifndef CHULDISC
+ (void) fprintf(stderr, "usage: %s [-cdft] tty_device\n",
+ progname);
+#endif
+#endif
+ exit(2);
+ }
+
+ (void) gettimeofday(&lasttv, (struct timezone *)0);
+ c = openterm(argv[ntp_optind]);
+ init_chu();
+#ifdef STREAM
+ if (usechuldisc)
+ process_ldisc(c);
+ else
+#endif
+#ifdef CHULDISC
+ if (usechuldisc)
+ process_ldisc(c);
+ else
+#endif
+ process_raw(c);
+ /*NOTREACHED*/
+}
+
+
+/*
+ * openterm - open a port to the CHU clock
+ */
+int
+openterm(
+ char *dev
+ )
+{
+ int s;
+ struct sgttyb ttyb;
+
+ if (debug)
+ (void) fprintf(stderr, "Doing open...");
+ if ((s = open(dev, O_RDONLY, 0777)) < 0)
+ error("open(%s)", dev, "");
+ if (debug)
+ (void) fprintf(stderr, "open okay\n");
+
+ if (debug)
+ (void) fprintf(stderr, "Setting exclusive use...");
+ if (ioctl(s, TIOCEXCL, (char *)0) < 0)
+ error("ioctl(TIOCEXCL)", "", "");
+ if (debug)
+ (void) fprintf(stderr, "done\n");
+
+ ttyb.sg_ispeed = ttyb.sg_ospeed = B300;
+ ttyb.sg_erase = ttyb.sg_kill = 0;
+ ttyb.sg_flags = EVENP|ODDP|RAW;
+ if (debug)
+ (void) fprintf(stderr, "Setting baud rate et al...");
+ if (ioctl(s, TIOCSETP, (char *)&ttyb) < 0)
+ error("ioctl(TIOCSETP, raw)", "", "");
+ if (debug)
+ (void) fprintf(stderr, "done\n");
+
+#ifdef CHULDISC
+ if (usechuldisc) {
+ int ldisc;
+
+ if (debug)
+ (void) fprintf(stderr, "Switching to CHU ldisc...");
+ ldisc = CHULDISC;
+ if (ioctl(s, TIOCSETD, (char *)&ldisc) < 0)
+ error("ioctl(TIOCSETD, CHULDISC)", "", "");
+ if (debug)
+ (void) fprintf(stderr, "okay\n");
+ }
+#endif
+#ifdef STREAM
+ if (usechuldisc) {
+
+ if (debug)
+ (void) fprintf(stderr, "Poping off streams...");
+ while (ioctl(s, I_POP, 0) >=0) ;
+ if (debug)
+ (void) fprintf(stderr, "okay\n");
+ if (debug)
+ (void) fprintf(stderr, "Pushing CHU stream...");
+ if (ioctl(s, I_PUSH, "chu") < 0)
+ error("ioctl(I_PUSH, \"chu\")", "", "");
+ if (debug)
+ (void) fprintf(stderr, "okay\n");
+ }
+#endif
+ return s;
+}
+
+
+/*
+ * process_raw - process characters in raw mode
+ */
+int
+process_raw(
+ int s
+ )
+{
+ u_char c;
+ int n;
+ struct timeval tv;
+ struct timeval difftv;
+
+ while ((n = read(s, &c, sizeof(char))) > 0) {
+ (void) gettimeofday(&tv, (struct timezone *)0);
+ if (dofilter)
+ raw_filter((unsigned int)c, &tv);
+ else {
+ difftv.tv_sec = tv.tv_sec - lasttv.tv_sec;
+ difftv.tv_usec = tv.tv_usec - lasttv.tv_usec;
+ if (difftv.tv_usec < 0) {
+ difftv.tv_sec--;
+ difftv.tv_usec += 1000000;
+ }
+ (void) printf("%02x\t%lu.%06lu\t%lu.%06lu\n",
+ c, tv.tv_sec, tv.tv_usec, difftv.tv_sec,
+ difftv.tv_usec);
+ lasttv = tv;
+ }
+ }
+
+ if (n == 0) {
+ (void) fprintf(stderr, "%s: zero returned on read\n", progname);
+ exit(1);
+ } else
+ error("read()", "", "");
+}
+
+
+/*
+ * raw_filter - run the line discipline filter over raw data
+ */
+void
+raw_filter(
+ unsigned int c,
+ struct timeval *tv
+ )
+{
+ static struct timeval diffs[10];
+ struct timeval diff;
+ l_fp ts;
+
+ if ((c & 0xf) > 9 || ((c>>4)&0xf) > 9) {
+ if (debug)
+ (void) fprintf(stderr,
+ "character %02x failed BCD test\n", c);
+ chudata.ncodechars = 0;
+ return;
+ }
+
+ if (chudata.ncodechars > 0) {
+ diff.tv_sec = tv->tv_sec
+ - chudata.codetimes[chudata.ncodechars].tv_sec;
+ diff.tv_usec = tv->tv_usec
+ - chudata.codetimes[chudata.ncodechars].tv_usec;
+ if (diff.tv_usec < 0) {
+ diff.tv_sec--;
+ diff.tv_usec += 1000000;
+ } /*
+ if (diff.tv_sec != 0 || diff.tv_usec > 900000) {
+ if (debug)
+ (void) fprintf(stderr,
+ "character %02x failed time test\n");
+ chudata.ncodechars = 0;
+ return;
+ } */
+ }
+
+ chudata.codechars[chudata.ncodechars] = c;
+ chudata.codetimes[chudata.ncodechars] = *tv;
+ if (chudata.ncodechars > 0)
+ diffs[chudata.ncodechars] = diff;
+ if (++chudata.ncodechars == 10) {
+ if (doprocess) {
+ TVTOTS(&chudata.codetimes[NCHUCHARS-1], &ts);
+ ts.l_ui += JAN_1970;
+ chufilter(&chudata, &chudata.codetimes[NCHUCHARS-1]);
+ } else {
+ register int i;
+
+ for (i = 0; i < chudata.ncodechars; i++) {
+ (void) printf("%x%x\t%lu.%06lu\t%lu.%06lu\n",
+ chudata.codechars[i] & 0xf,
+ (chudata.codechars[i] >>4 ) & 0xf,
+ chudata.codetimes[i].tv_sec,
+ chudata.codetimes[i].tv_usec,
+ diffs[i].tv_sec, diffs[i].tv_usec);
+ }
+ }
+ chudata.ncodechars = 0;
+ }
+}
+
+
+/* #ifdef CHULDISC*/
+/*
+ * process_ldisc - process line discipline
+ */
+int
+process_ldisc(
+ int s
+ )
+{
+ struct chucode chu;
+ int n;
+ register int i;
+ struct timeval diff;
+ l_fp ts;
+ void chufilter();
+
+ while ((n = read(s, (char *)&chu, sizeof chu)) > 0) {
+ if (n != sizeof chu) {
+ (void) fprintf(stderr, "Expected %d, got %d\n",
+ sizeof chu, n);
+ continue;
+ }
+
+ if (doprocess) {
+ TVTOTS(&chu.codetimes[NCHUCHARS-1], &ts);
+ ts.l_ui += JAN_1970;
+ chufilter(&chu, &ts);
+ } else {
+ for (i = 0; i < NCHUCHARS; i++) {
+ if (i == 0)
+ diff.tv_sec = diff.tv_usec = 0;
+ else {
+ diff.tv_sec = chu.codetimes[i].tv_sec
+ - chu.codetimes[i-1].tv_sec;
+ diff.tv_usec = chu.codetimes[i].tv_usec
+ - chu.codetimes[i-1].tv_usec;
+ if (diff.tv_usec < 0) {
+ diff.tv_sec--;
+ diff.tv_usec += 1000000;
+ }
+ }
+ (void) printf("%x%x\t%lu.%06lu\t%lu.%06lu\n",
+ chu.codechars[i] & 0xf, (chu.codechars[i]>>4)&0xf,
+ chu.codetimes[i].tv_sec, chu.codetimes[i].tv_usec,
+ diff.tv_sec, diff.tv_usec);
+ }
+ }
+ }
+ if (n == 0) {
+ (void) fprintf(stderr, "%s: zero returned on read\n", progname);
+ exit(1);
+ } else
+ error("read()", "", "");
+}
+/*#endif*/
+
+
+/*
+ * error - print an error message
+ */
+void
+error(
+ char *fmt,
+ char *s1,
+ char *s2
+ )
+{
+ (void) fprintf(stderr, "%s: ", progname);
+ (void) fprintf(stderr, fmt, s1, s2);
+ (void) fprintf(stderr, ": ");
+ perror("");
+ exit(1);
+}
+
+/*
+ * Definitions
+ */
+#define MAXUNITS 4 /* maximum number of CHU units permitted */
+#define CHUDEV "/dev/chu%d" /* device we open. %d is unit number */
+#define NCHUCODES 9 /* expect 9 CHU codes per minute */
+
+/*
+ * When CHU is operating optimally we want the primary clock distance
+ * to come out at 300 ms. Thus, peer.distance in the CHU peer structure
+ * is set to 290 ms and we compute delays which are at least 10 ms long.
+ * The following are 290 ms and 10 ms expressed in u_fp format
+ */
+#define CHUDISTANCE 0x00004a3d
+#define CHUBASEDELAY 0x0000028f
+
+/*
+ * To compute a quality for the estimate (a pseudo delay) we add a
+ * fixed 10 ms for each missing code in the minute and add to this
+ * the sum of the differences between the remaining offsets and the
+ * estimated sample offset.
+ */
+#define CHUDELAYPENALTY 0x0000028f
+
+/*
+ * Other constant stuff
+ */
+#define CHUPRECISION (-9) /* what the heck */
+#define CHUREFID "CHU\0"
+
+/*
+ * Default fudge factors
+ */
+#define DEFPROPDELAY 0x00624dd3 /* 0.0015 seconds, 1.5 ms */
+#define DEFFILTFUDGE 0x000d1b71 /* 0.0002 seconds, 200 us */
+
+/*
+ * Hacks to avoid excercising the multiplier. I have no pride.
+ */
+#define MULBY10(x) (((x)<<3) + ((x)<<1))
+#define MULBY60(x) (((x)<<6) - ((x)<<2)) /* watch overflow */
+#define MULBY24(x) (((x)<<4) + ((x)<<3))
+
+/*
+ * Constants for use when multiplying by 0.1. ZEROPTONE is 0.1
+ * as an l_fp fraction, NZPOBITS is the number of significant bits
+ * in ZEROPTONE.
+ */
+#define ZEROPTONE 0x1999999a
+#define NZPOBITS 29
+
+/*
+ * The CHU table. This gives the expected time of arrival of each
+ * character after the on-time second and is computed as follows:
+ * The CHU time code is sent at 300 bps. Your average UART will
+ * synchronize at the edge of the start bit and will consider the
+ * character complete at the center of the first stop bit, i.e.
+ * 0.031667 ms later. Thus the expected time of each interrupt
+ * is the start bit time plus 0.031667 seconds. These times are
+ * in chutable[]. To this we add such things as propagation delay
+ * and delay fudge factor.
+ */
+#define CHARDELAY 0x081b4e80
+
+static u_long chutable[NCHUCHARS] = {
+ 0x2147ae14 + CHARDELAY, /* 0.130 (exactly) */
+ 0x2ac08312 + CHARDELAY, /* 0.167 (exactly) */
+ 0x34395810 + CHARDELAY, /* 0.204 (exactly) */
+ 0x3db22d0e + CHARDELAY, /* 0.241 (exactly) */
+ 0x472b020c + CHARDELAY, /* 0.278 (exactly) */
+ 0x50a3d70a + CHARDELAY, /* 0.315 (exactly) */
+ 0x5a1cac08 + CHARDELAY, /* 0.352 (exactly) */
+ 0x63958106 + CHARDELAY, /* 0.389 (exactly) */
+ 0x6d0e5604 + CHARDELAY, /* 0.426 (exactly) */
+ 0x76872b02 + CHARDELAY, /* 0.463 (exactly) */
+};
+
+/*
+ * Keep the fudge factors separately so they can be set even
+ * when no clock is configured.
+ */
+static l_fp propagation_delay;
+static l_fp fudgefactor;
+static l_fp offset_fudge;
+
+/*
+ * We keep track of the start of the year, watching for changes.
+ * We also keep track of whether the year is a leap year or not.
+ * All because stupid CHU doesn't include the year in the time code.
+ */
+static u_long yearstart;
+
+/*
+ * Imported from the timer module
+ */
+extern u_long current_time;
+extern struct event timerqueue[];
+
+/*
+ * init_chu - initialize internal chu driver data
+ */
+void
+init_chu(void)
+{
+
+ /*
+ * Initialize fudge factors to default.
+ */
+ propagation_delay.l_ui = 0;
+ propagation_delay.l_uf = DEFPROPDELAY;
+ fudgefactor.l_ui = 0;
+ fudgefactor.l_uf = DEFFILTFUDGE;
+ offset_fudge = propagation_delay;
+ L_ADD(&offset_fudge, &fudgefactor);
+
+ yearstart = 0;
+}
+
+
+void
+chufilter(
+ struct chucode *chuc,
+ l_fp *rtime
+ )
+{
+ register int i;
+ register u_long date_ui;
+ register u_long tmp;
+ register u_char *code;
+ int isneg;
+ int imin;
+ int imax;
+ u_long reftime;
+ l_fp off[NCHUCHARS];
+ l_fp ts;
+ int day, hour, minute, second;
+ static u_char lastcode[NCHUCHARS];
+
+ /*
+ * We'll skip the checks made in the kernel, but assume they've
+ * been done. This means that all characters are BCD and
+ * the intercharacter spacing isn't unreasonable.
+ */
+
+ /*
+ * print the code
+ */
+ for (i = 0; i < NCHUCHARS; i++)
+ printf("%c%c", (chuc->codechars[i] & 0xf) + '0',
+ ((chuc->codechars[i]>>4) & 0xf) + '0');
+ printf("\n");
+
+ /*
+ * Format check. Make sure the two halves match.
+ */
+ for (i = 0; i < NCHUCHARS/2; i++)
+ if (chuc->codechars[i] != chuc->codechars[i+(NCHUCHARS/2)]) {
+ (void) printf("Bad format, halves don't match\n");
+ return;
+ }
+
+ /*
+ * Break out the code into the BCD nibbles. Only need to fiddle
+ * with the first half since both are identical. Note the first
+ * BCD character is the low order nibble, the second the high order.
+ */
+ code = lastcode;
+ for (i = 0; i < NCHUCHARS/2; i++) {
+ *code++ = chuc->codechars[i] & 0xf;
+ *code++ = (chuc->codechars[i] >> 4) & 0xf;
+ }
+
+ /*
+ * If the first nibble isn't a 6, we're up the creek
+ */
+ code = lastcode;
+ if (*code++ != 6) {
+ (void) printf("Bad format, no 6 at start\n");
+ return;
+ }
+
+ /*
+ * Collect the day, the hour, the minute and the second.
+ */
+ day = *code++;
+ day = MULBY10(day) + *code++;
+ day = MULBY10(day) + *code++;
+ hour = *code++;
+ hour = MULBY10(hour) + *code++;
+ minute = *code++;
+ minute = MULBY10(minute) + *code++;
+ second = *code++;
+ second = MULBY10(second) + *code++;
+
+ /*
+ * Sanity check the day and time. Note that this
+ * only occurs on the 31st through the 39th second
+ * of the minute.
+ */
+ if (day < 1 || day > 366
+ || hour > 23 || minute > 59
+ || second < 31 || second > 39) {
+ (void) printf("Failed date sanity check: %d %d %d %d\n",
+ day, hour, minute, second);
+ return;
+ }
+
+ /*
+ * Compute seconds into the year.
+ */
+ tmp = (u_long)(MULBY24((day-1)) + hour); /* hours */
+ tmp = MULBY60(tmp) + (u_long)minute; /* minutes */
+ tmp = MULBY60(tmp) + (u_long)second; /* seconds */
+
+ /*
+ * Now the fun begins. We demand that the received time code
+ * be within CLOCK_WAYTOOBIG of the receive timestamp, but
+ * there is uncertainty about the year the timestamp is in.
+ * Use the current year start for the first check, this should
+ * work most of the time.
+ */
+ date_ui = tmp + yearstart;
+#define CLOCK_WAYTOOBIG 1000 /* revived from ancient sources */
+ if (date_ui < (rtime->l_ui + CLOCK_WAYTOOBIG)
+ && date_ui > (rtime->l_ui - CLOCK_WAYTOOBIG))
+ goto codeokay; /* looks good */
+
+ /*
+ * Trouble. Next check is to see if the year rolled over and, if
+ * so, try again with the new year's start.
+ */
+ date_ui = calyearstart(rtime->l_ui, NULL);
+ if (date_ui != yearstart) {
+ yearstart = date_ui;
+ date_ui += tmp;
+ (void) printf("time %u, code %u, difference %d\n",
+ date_ui, rtime->l_ui, (long)date_ui-(long)rtime->l_ui);
+ if (date_ui < (rtime->l_ui + CLOCK_WAYTOOBIG)
+ && date_ui > (rtime->l_ui - CLOCK_WAYTOOBIG))
+ goto codeokay; /* okay this time */
+ }
+
+ ts.l_uf = 0;
+ ts.l_ui = yearstart;
+ printf("yearstart %s\n", prettydate(&ts));
+ printf("received %s\n", prettydate(rtime));
+ ts.l_ui = date_ui;
+ printf("date_ui %s\n", prettydate(&ts));
+
+ /*
+ * Here we know the year start matches the current system
+ * time. One remaining possibility is that the time code
+ * is in the year previous to that of the system time. This
+ * is only worth checking if the receive timestamp is less
+ * than CLOCK_WAYTOOBIG seconds into the new year.
+ */
+ if ((rtime->l_ui - yearstart) < CLOCK_WAYTOOBIG) {
+ date_ui = tmp;
+ date_ui += calyearstart(yearstart - CLOCK_WAYTOOBIG,
+ NULL);
+ if ((rtime->l_ui - date_ui) < CLOCK_WAYTOOBIG)
+ goto codeokay;
+ }
+
+ /*
+ * One last possibility is that the time stamp is in the year
+ * following the year the system is in. Try this one before
+ * giving up.
+ */
+ date_ui = tmp;
+ date_ui += calyearstart(yearstart + (400 * SECSPERDAY),
+ NULL);
+ if ((date_ui - rtime->l_ui) >= CLOCK_WAYTOOBIG) {
+ printf("Date hopelessly off\n");
+ return; /* hopeless, let it sync to other peers */
+ }
+
+ codeokay:
+ reftime = date_ui;
+ /*
+ * We've now got the integral seconds part of the time code (we hope).
+ * The fractional part comes from the table. We next compute
+ * the offsets for each character.
+ */
+ for (i = 0; i < NCHUCHARS; i++) {
+ register u_long tmp2;
+
+ off[i].l_ui = date_ui;
+ off[i].l_uf = chutable[i];
+ tmp = chuc->codetimes[i].tv_sec + JAN_1970;
+ TVUTOTSF(chuc->codetimes[i].tv_usec, tmp2);
+ M_SUB(off[i].l_ui, off[i].l_uf, tmp, tmp2);
+ }
+
+ /*
+ * Here is a *big* problem. What one would normally
+ * do here on a machine with lots of clock bits (say
+ * a Vax or the gizmo board) is pick the most positive
+ * offset and the estimate, since this is the one that
+ * is most likely suffered the smallest interrupt delay.
+ * The trouble is that the low order clock bit on an IBM
+ * RT, which is the machine I had in mind when doing this,
+ * ticks at just under the millisecond mark. This isn't
+ * precise enough. What we can do to improve this is to
+ * average all 10 samples and rely on the second level
+ * filtering to pick the least delayed estimate. Trouble
+ * is, this means we have to divide a 64 bit fixed point
+ * number by 10, a procedure which really sucks. Oh, well.
+ * First compute the sum.
+ */
+ date_ui = 0;
+ tmp = 0;
+ for (i = 0; i < NCHUCHARS; i++)
+ M_ADD(date_ui, tmp, off[i].l_ui, off[i].l_uf);
+ if (M_ISNEG(date_ui, tmp))
+ isneg = 1;
+ else
+ isneg = 0;
+
+ /*
+ * Here is a multiply-by-0.1 optimization that should apply
+ * just about everywhere. If the magnitude of the sum
+ * is less than 9 we don't have to worry about overflow
+ * out of a 64 bit product, even after rounding.
+ */
+ if (date_ui < 9 || date_ui > 0xfffffff7) {
+ register u_long prod_ui;
+ register u_long prod_uf;
+
+ prod_ui = prod_uf = 0;
+ /*
+ * This code knows the low order bit in 0.1 is zero
+ */
+ for (i = 1; i < NZPOBITS; i++) {
+ M_LSHIFT(date_ui, tmp);
+ if (ZEROPTONE & (1<<i))
+ M_ADD(prod_ui, prod_uf, date_ui, tmp);
+ }
+
+ /*
+ * Done, round it correctly. Prod_ui contains the
+ * fraction.
+ */
+ if (prod_uf & 0x80000000)
+ prod_ui++;
+ if (isneg)
+ date_ui = 0xffffffff;
+ else
+ date_ui = 0;
+ tmp = prod_ui;
+ /*
+ * date_ui is integral part, tmp is fraction.
+ */
+ } else {
+ register u_long prod_ovr;
+ register u_long prod_ui;
+ register u_long prod_uf;
+ register u_long highbits;
+
+ prod_ovr = prod_ui = prod_uf = 0;
+ if (isneg)
+ highbits = 0xffffffff; /* sign extend */
+ else
+ highbits = 0;
+ /*
+ * This code knows the low order bit in 0.1 is zero
+ */
+ for (i = 1; i < NZPOBITS; i++) {
+ M_LSHIFT3(highbits, date_ui, tmp);
+ if (ZEROPTONE & (1<<i))
+ M_ADD3(prod_ovr, prod_uf, prod_ui,
+ highbits, date_ui, tmp);
+ }
+
+ if (prod_uf & 0x80000000)
+ M_ADDUF(prod_ovr, prod_ui, (u_long)1);
+ date_ui = prod_ovr;
+ tmp = prod_ui;
+ }
+
+ /*
+ * At this point we have the mean offset, with the integral
+ * part in date_ui and the fractional part in tmp. Store
+ * it in the structure.
+ */
+ /*
+ * Add in fudge factor.
+ */
+ M_ADD(date_ui, tmp, offset_fudge.l_ui, offset_fudge.l_uf);
+
+ /*
+ * Find the minimun and maximum offset
+ */
+ imin = imax = 0;
+ for (i = 1; i < NCHUCHARS; i++) {
+ if (L_ISGEQ(&off[i], &off[imax])) {
+ imax = i;
+ } else if (L_ISGEQ(&off[imin], &off[i])) {
+ imin = i;
+ }
+ }
+
+ L_ADD(&off[imin], &offset_fudge);
+ if (imin != imax)
+ L_ADD(&off[imax], &offset_fudge);
+ (void) printf("mean %s, min %s, max %s\n",
+ mfptoa(date_ui, tmp, 8), lfptoa(&off[imin], 8),
+ lfptoa(&off[imax], 8));
+}
diff --git a/clockstuff/propdelay.c b/clockstuff/propdelay.c
new file mode 100644
index 0000000..52c2032
--- /dev/null
+++ b/clockstuff/propdelay.c
@@ -0,0 +1,548 @@
+/* propdelay.c,v 3.1 1993/07/06 01:05:24 jbj Exp
+ * propdelay - compute propagation delays
+ *
+ * cc -o propdelay propdelay.c -lm
+ *
+ * "Time and Frequency Users' Manual", NBS Technical Note 695 (1977).
+ */
+
+/*
+ * This can be used to get a rough idea of the HF propagation delay
+ * between two points (usually between you and the radio station).
+ * The usage is
+ *
+ * propdelay latitudeA longitudeA latitudeB longitudeB
+ *
+ * where points A and B are the locations in question. You obviously
+ * need to know the latitude and longitude of each of the places.
+ * The program expects the latitude to be preceded by an 'n' or 's'
+ * and the longitude to be preceded by an 'e' or 'w'. It understands
+ * either decimal degrees or degrees:minutes:seconds. Thus to compute
+ * the delay between the WWVH (21:59:26N, 159:46:00W) and WWV (40:40:49N,
+ * 105:02:27W) you could use:
+ *
+ * propdelay n21:59:26 w159:46 n40:40:49 w105:02:27
+ *
+ * By default it prints out a summer (F2 average virtual height 350 km) and
+ * winter (F2 average virtual height 250 km) number. The results will be
+ * quite approximate but are about as good as you can do with HF time anyway.
+ * You might pick a number between the values to use, or use the summer
+ * value in the summer and switch to the winter value when the static
+ * above 10 MHz starts to drop off in the fall. You can also use the
+ * -h switch if you want to specify your own virtual height.
+ *
+ * You can also do a
+ *
+ * propdelay -W n45:17:47 w75:45:22
+ *
+ * to find the propagation delays to WWV and WWVH (from CHU in this
+ * case), a
+ *
+ * propdelay -C n40:40:49 w105:02:27
+ *
+ * to find the delays to CHU, and a
+ *
+ * propdelay -G n52:03:17 w98:34:18
+ *
+ * to find delays to GOES via each of the three satellites.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <stdio.h>
+#include <string.h>
+
+#include "ntp_stdlib.h"
+
+extern double sin (double);
+extern double cos (double);
+extern double acos (double);
+extern double tan (double);
+extern double atan (double);
+extern double sqrt (double);
+
+#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
+
+/*
+ * Program constants
+ */
+#define EARTHRADIUS (6370.0) /* raduis of earth (km) */
+#define LIGHTSPEED (299800.0) /* speed of light, km/s */
+#define PI (3.1415926536)
+#define RADPERDEG (PI/180.0) /* radians per degree */
+#define MILE (1.609344) /* km in a mile */
+
+#define SUMMERHEIGHT (350.0) /* summer height in km */
+#define WINTERHEIGHT (250.0) /* winter height in km */
+
+#define SATHEIGHT (6.6110 * 6378.0) /* geosync satellite height in km
+ from centre of earth */
+
+#define WWVLAT "n40:40:49"
+#define WWVLONG "w105:02:27"
+
+#define WWVHLAT "n21:59:26"
+#define WWVHLONG "w159:46:00"
+
+#define CHULAT "n45:17:47"
+#define CHULONG "w75:45:22"
+
+#define GOES_UP_LAT "n37:52:00"
+#define GOES_UP_LONG "w75:27:00"
+#define GOES_EAST_LONG "w75:00:00"
+#define GOES_STBY_LONG "w105:00:00"
+#define GOES_WEST_LONG "w135:00:00"
+#define GOES_SAT_LAT "n00:00:00"
+
+char *wwvlat = WWVLAT;
+char *wwvlong = WWVLONG;
+
+char *wwvhlat = WWVHLAT;
+char *wwvhlong = WWVHLONG;
+
+char *chulat = CHULAT;
+char *chulong = CHULONG;
+
+char *goes_up_lat = GOES_UP_LAT;
+char *goes_up_long = GOES_UP_LONG;
+char *goes_east_long = GOES_EAST_LONG;
+char *goes_stby_long = GOES_STBY_LONG;
+char *goes_west_long = GOES_WEST_LONG;
+char *goes_sat_lat = GOES_SAT_LAT;
+
+int hflag = 0;
+int Wflag = 0;
+int Cflag = 0;
+int Gflag = 0;
+int height;
+
+char *progname;
+
+static void doit (double, double, double, double, double, char *);
+static double latlong (char *, int);
+static double greatcircle (double, double, double, double);
+static double waveangle (double, double, int);
+static double propdelay (double, double, int);
+static int finddelay (double, double, double, double, double, double *);
+static void satdoit (double, double, double, double, double, double, char *);
+static void satfinddelay (double, double, double, double, double *);
+static double satpropdelay (double);
+
+/*
+ * main - parse arguments and handle options
+ */
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ int c;
+ int errflg = 0;
+ double lat1, long1;
+ double lat2, long2;
+ double lat3, long3;
+
+ init_lib();
+
+ progname = argv[0];
+ while ((c = ntp_getopt(argc, argv, "dh:CWG")) != EOF)
+ switch (c) {
+ case 'd':
+ ++debug;
+ break;
+ case 'h':
+ hflag++;
+ height = atof(ntp_optarg);
+ if (height <= 0.0) {
+ (void) fprintf(stderr, "height %s unlikely\n",
+ ntp_optarg);
+ errflg++;
+ }
+ break;
+ case 'C':
+ Cflag++;
+ break;
+ case 'W':
+ Wflag++;
+ break;
+ case 'G':
+ Gflag++;
+ break;
+ default:
+ errflg++;
+ break;
+ }
+ if (errflg || (!(Cflag || Wflag || Gflag) && ntp_optind+4 != argc) ||
+ ((Cflag || Wflag || Gflag) && ntp_optind+2 != argc)) {
+ (void) fprintf(stderr,
+ "usage: %s [-d] [-h height] lat1 long1 lat2 long2\n",
+ progname);
+ (void) fprintf(stderr," - or -\n");
+ (void) fprintf(stderr,
+ "usage: %s -CWG [-d] lat long\n",
+ progname);
+ exit(2);
+ }
+
+
+ if (!(Cflag || Wflag || Gflag)) {
+ lat1 = latlong(argv[ntp_optind], 1);
+ long1 = latlong(argv[ntp_optind + 1], 0);
+ lat2 = latlong(argv[ntp_optind + 2], 1);
+ long2 = latlong(argv[ntp_optind + 3], 0);
+ if (hflag) {
+ doit(lat1, long1, lat2, long2, height, "");
+ } else {
+ doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
+ "summer propagation, ");
+ doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
+ "winter propagation, ");
+ }
+ } else if (Wflag) {
+ /*
+ * Compute delay from WWV
+ */
+ lat1 = latlong(argv[ntp_optind], 1);
+ long1 = latlong(argv[ntp_optind + 1], 0);
+ lat2 = latlong(wwvlat, 1);
+ long2 = latlong(wwvlong, 0);
+ if (hflag) {
+ doit(lat1, long1, lat2, long2, height, "WWV ");
+ } else {
+ doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
+ "WWV summer propagation, ");
+ doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
+ "WWV winter propagation, ");
+ }
+
+ /*
+ * Compute delay from WWVH
+ */
+ lat2 = latlong(wwvhlat, 1);
+ long2 = latlong(wwvhlong, 0);
+ if (hflag) {
+ doit(lat1, long1, lat2, long2, height, "WWVH ");
+ } else {
+ doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
+ "WWVH summer propagation, ");
+ doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
+ "WWVH winter propagation, ");
+ }
+ } else if (Cflag) {
+ lat1 = latlong(argv[ntp_optind], 1);
+ long1 = latlong(argv[ntp_optind + 1], 0);
+ lat2 = latlong(chulat, 1);
+ long2 = latlong(chulong, 0);
+ if (hflag) {
+ doit(lat1, long1, lat2, long2, height, "CHU ");
+ } else {
+ doit(lat1, long1, lat2, long2, (double)SUMMERHEIGHT,
+ "CHU summer propagation, ");
+ doit(lat1, long1, lat2, long2, (double)WINTERHEIGHT,
+ "CHU winter propagation, ");
+ }
+ } else if (Gflag) {
+ lat1 = latlong(goes_up_lat, 1);
+ long1 = latlong(goes_up_long, 0);
+ lat3 = latlong(argv[ntp_optind], 1);
+ long3 = latlong(argv[ntp_optind + 1], 0);
+
+ lat2 = latlong(goes_sat_lat, 1);
+
+ long2 = latlong(goes_west_long, 0);
+ satdoit(lat1, long1, lat2, long2, lat3, long3,
+ "GOES Delay via WEST");
+
+ long2 = latlong(goes_stby_long, 0);
+ satdoit(lat1, long1, lat2, long2, lat3, long3,
+ "GOES Delay via STBY");
+
+ long2 = latlong(goes_east_long, 0);
+ satdoit(lat1, long1, lat2, long2, lat3, long3,
+ "GOES Delay via EAST");
+
+ }
+ exit(0);
+}
+
+
+/*
+ * doit - compute a delay and print it
+ */
+static void
+doit(
+ double lat1,
+ double long1,
+ double lat2,
+ double long2,
+ double h,
+ char *str
+ )
+{
+ int hops;
+ double delay;
+
+ hops = finddelay(lat1, long1, lat2, long2, h, &delay);
+ printf("%sheight %g km, hops %d, delay %g seconds\n",
+ str, h, hops, delay);
+}
+
+
+/*
+ * latlong - decode a latitude/longitude value
+ */
+static double
+latlong(
+ char *str,
+ int islat
+ )
+{
+ register char *cp;
+ register char *bp;
+ double arg;
+ double divby;
+ int isneg;
+ char buf[32];
+ char *colon;
+
+ if (islat) {
+ /*
+ * Must be north or south
+ */
+ if (*str == 'N' || *str == 'n')
+ isneg = 0;
+ else if (*str == 'S' || *str == 's')
+ isneg = 1;
+ else
+ isneg = -1;
+ } else {
+ /*
+ * East is positive, west is negative
+ */
+ if (*str == 'E' || *str == 'e')
+ isneg = 0;
+ else if (*str == 'W' || *str == 'w')
+ isneg = 1;
+ else
+ isneg = -1;
+ }
+
+ if (isneg >= 0)
+ str++;
+
+ colon = strchr(str, ':');
+ if (colon != NULL) {
+ /*
+ * in hhh:mm:ss form
+ */
+ cp = str;
+ bp = buf;
+ while (cp < colon)
+ *bp++ = *cp++;
+ *bp = '\0';
+ cp++;
+ arg = atof(buf);
+ divby = 60.0;
+ colon = strchr(cp, ':');
+ if (colon != NULL) {
+ bp = buf;
+ while (cp < colon)
+ *bp++ = *cp++;
+ *bp = '\0';
+ cp++;
+ arg += atof(buf) / divby;
+ divby = 3600.0;
+ }
+ if (*cp != '\0')
+ arg += atof(cp) / divby;
+ } else {
+ arg = atof(str);
+ }
+
+ if (isneg == 1)
+ arg = -arg;
+
+ if (debug > 2)
+ (void) printf("latitude/longitude %s = %g\n", str, arg);
+
+ return arg;
+}
+
+
+/*
+ * greatcircle - compute the great circle distance in kilometers
+ */
+static double
+greatcircle(
+ double lat1,
+ double long1,
+ double lat2,
+ double long2
+ )
+{
+ double dg;
+ double l1r, l2r;
+
+ l1r = lat1 * RADPERDEG;
+ l2r = lat2 * RADPERDEG;
+ dg = EARTHRADIUS * acos(
+ (cos(l1r) * cos(l2r) * cos((long2-long1)*RADPERDEG))
+ + (sin(l1r) * sin(l2r)));
+ if (debug >= 2)
+ printf(
+ "greatcircle lat1 %g long1 %g lat2 %g long2 %g dist %g\n",
+ lat1, long1, lat2, long2, dg);
+ return dg;
+}
+
+
+/*
+ * waveangle - compute the wave angle for the given distance, virtual
+ * height and number of hops.
+ */
+static double
+waveangle(
+ double dg,
+ double h,
+ int n
+ )
+{
+ double theta;
+ double delta;
+
+ theta = dg / (EARTHRADIUS * (double)(2 * n));
+ delta = atan((h / (EARTHRADIUS * sin(theta))) + tan(theta/2)) - theta;
+ if (debug >= 2)
+ printf("waveangle dist %g height %g hops %d angle %g\n",
+ dg, h, n, delta / RADPERDEG);
+ return delta;
+}
+
+
+/*
+ * propdelay - compute the propagation delay
+ */
+static double
+propdelay(
+ double dg,
+ double h,
+ int n
+ )
+{
+ double phi;
+ double theta;
+ double td;
+
+ theta = dg / (EARTHRADIUS * (double)(2 * n));
+ phi = (PI/2.0) - atan((h / (EARTHRADIUS * sin(theta))) + tan(theta/2));
+ td = dg / (LIGHTSPEED * sin(phi));
+ if (debug >= 2)
+ printf("propdelay dist %g height %g hops %d time %g\n",
+ dg, h, n, td);
+ return td;
+}
+
+
+/*
+ * finddelay - find the propagation delay
+ */
+static int
+finddelay(
+ double lat1,
+ double long1,
+ double lat2,
+ double long2,
+ double h,
+ double *delay
+ )
+{
+ double dg; /* great circle distance */
+ double delta; /* wave angle */
+ int n; /* number of hops */
+
+ dg = greatcircle(lat1, long1, lat2, long2);
+ if (debug)
+ printf("great circle distance %g km %g miles\n", dg, dg/MILE);
+
+ n = 1;
+ while ((delta = waveangle(dg, h, n)) < 0.0) {
+ if (debug)
+ printf("tried %d hop%s, no good\n", n, n>1?"s":"");
+ n++;
+ }
+ if (debug)
+ printf("%d hop%s okay, wave angle is %g\n", n, n>1?"s":"",
+ delta / RADPERDEG);
+
+ *delay = propdelay(dg, h, n);
+ return n;
+}
+
+/*
+ * satdoit - compute a delay and print it
+ */
+static void
+satdoit(
+ double lat1,
+ double long1,
+ double lat2,
+ double long2,
+ double lat3,
+ double long3,
+ char *str
+ )
+{
+ double up_delay,down_delay;
+
+ satfinddelay(lat1, long1, lat2, long2, &up_delay);
+ satfinddelay(lat3, long3, lat2, long2, &down_delay);
+
+ printf("%s, delay %g seconds\n", str, up_delay + down_delay);
+}
+
+/*
+ * satfinddelay - calculate the one-way delay time between a ground station
+ * and a satellite
+ */
+static void
+satfinddelay(
+ double lat1,
+ double long1,
+ double lat2,
+ double long2,
+ double *delay
+ )
+{
+ double dg; /* great circle distance */
+
+ dg = greatcircle(lat1, long1, lat2, long2);
+
+ *delay = satpropdelay(dg);
+}
+
+/*
+ * satpropdelay - calculate the one-way delay time between a ground station
+ * and a satellite
+ */
+static double
+satpropdelay(
+ double dg
+ )
+{
+ double k1, k2, dist;
+ double theta;
+ double td;
+
+ theta = dg / (EARTHRADIUS);
+ k1 = EARTHRADIUS * sin(theta);
+ k2 = SATHEIGHT - (EARTHRADIUS * cos(theta));
+ if (debug >= 2)
+ printf("Theta %g k1 %g k2 %g\n", theta, k1, k2);
+ dist = sqrt(k1*k1 + k2*k2);
+ td = dist / LIGHTSPEED;
+ if (debug >= 2)
+ printf("propdelay dist %g height %g time %g\n", dg, dist, td);
+ return td;
+}
diff --git a/conf/README b/conf/README
new file mode 100644
index 0000000..327f716
--- /dev/null
+++ b/conf/README
@@ -0,0 +1,13 @@
+README file for directory ./conf of the NTP Version 4 distribution
+
+This directory contains example run-time configuration files for the
+NTP Version 4 daemon ntpd. These files illustrate some of the more
+obtuse configurations you may run into. They are not likely to do
+anything good if run on machines other than their native spot, so don't
+just blindly copy something and put it up. Additional information can
+be found in the ./doc directory of the base directory.
+
+Included also are example public key and symmetric key files produced
+by the ntp-genkeys program with names prefixed by ntpkey. These are
+ordinarily kept in /usr/local/etc and used by the Autokey scheme. See
+the authopt.htm pnd genkeys.htm ages for further information.
diff --git a/conf/baldwin.conf b/conf/baldwin.conf
new file mode 100644
index 0000000..1238ba1
--- /dev/null
+++ b/conf/baldwin.conf
@@ -0,0 +1,10 @@
+#
+# NTP manycast configuration file (ntp.conf) for DCnet hosts
+#
+# Note that the .rnd random seed file must pe in the root
+# directory and the public and private keys in /usr/local/etc.
+#
+manycastclient 239.1.1.1 autokey maxpoll 12
+manycastserver 239.1.1.1
+crypto randfile /.rnd # enable public key
+driftfile /etc/ntp.drift # path for drift file
diff --git a/conf/beauregard.conf b/conf/beauregard.conf
new file mode 100644
index 0000000..ea80c02
--- /dev/null
+++ b/conf/beauregard.conf
@@ -0,0 +1,23 @@
+#
+# NTP configuration file (ntp.conf)
+# beauregard.udel.edu
+#
+server 127.127.18.1 # NIST ACTS modem driver
+fudge 127.127.18.1 time1 .0035
+phone atdt913034944774 atdt913034944785 atdt913034944774
+#phone atdt913034944812 atdt913034948497 atdt913034948022
+#
+# Miscellaneous stuff
+#
+driftfile /etc/ntp.drift # path for drift file
+statsdir /beauregard/ntpstats/ # directory for statistics files
+filegen peerstats file peerstats type day enable
+filegen loopstats file loopstats type day enable
+filegen clockstats file clockstats type day enable
+#
+# Authentication stuff
+#
+keys /usr/local/etc/ntp.keys # path for keys file
+trustedkey 3 4 5 6 14 15 # define trusted keys
+requestkey 15 # key (7) for accessing server variables
+controlkey 15 # key (6) for accessing server variables
diff --git a/conf/grundoon.conf b/conf/grundoon.conf
new file mode 100644
index 0000000..eb18b3f
--- /dev/null
+++ b/conf/grundoon.conf
@@ -0,0 +1,36 @@
+#
+# NTP configuration file (ntp.conf)
+# grundoon.udel.edu
+#
+server 127.127.11.1 prefer # Arbiter 1088 GPS receiver
+fudge 127.127.11.1 time1 .00487 flag1 1 flag4 1
+server 127.127.22.1 minpoll 4 # PPS quick poll
+fudge 127.127.22.1 # default use PLL/FLL loop
+
+broadcast 128.4.2.255 key 5 # brpadcast on LAN shared key
+broadcast 239.1.1.2 autokey # multicast on WAN autokey
+
+manycastclient 239.1.1.1 autokey maxpoll 12 ttl 7
+manycastserver 239.1.1.1
+#
+# Access control stuff
+#
+restrict default noserve # default deny
+restrict 127.0.0.1 # allow local host
+restrict 128.4.0.0 mask 255.255.0.0 # allow DCnet clients
+restrict 128.175.0.0 mask 255.255.0.0 # allow UDel clients
+restrict 140.173.0.0 mask 255.255.0.0 # allow DARTnet/CAIRN clients
+#
+# Authentication stuff
+#
+crypto # enable public key
+keys /usr/local/etc/ntp.keys # path for keys file
+trustedkey 3 4 5 14 # define trusted keys
+requestkey 14 # key (7) for accessing server variables
+controlkey 14 # key (6) for accessing server variables
+#
+# Miscellaneous stuff
+#
+driftfile /etc/ntp.drift # path for drift file
+statsdir /var/spool/ntpstats/ # directory for statistics files
+filegen loopstats file loopstats type day enable
diff --git a/conf/malarky.conf b/conf/malarky.conf
new file mode 100644
index 0000000..1475e1e
--- /dev/null
+++ b/conf/malarky.conf
@@ -0,0 +1,24 @@
+#
+# NTP configuration file (ntp.conf)
+#
+# This is for a broadcast/multicast client. Except for the statistics
+# stuff, this can be done with only a commmand line of the form
+#
+# /usr/local/bin/ntpd -a -k /usr/local/bin/ntp.keys -m -t 3
+#
+multicastclient # listen on default 224.0.1.1
+#
+# Miscellaneous stuff
+#
+driftfile /etc/ntp.drift # path for drift file
+statsdir /malarky/ntpstats/ # directory for statistics files
+filegen peerstats file peerstats type day enable
+filegen loopstats file loopstats type day enable
+filegen clockstats file clockstats type day enable
+#
+# Authentication stuff
+#
+keys /usr/local/etc/ntp.keys # path for key file
+trustedkey 3 4 5 6 14 # define trusted keys
+requestkey 14 # key (7) for accessing server variables
+controlkey 14 # key (6) for accessing server variables
diff --git a/conf/pogo.conf b/conf/pogo.conf
new file mode 100644
index 0000000..0dbc58a
--- /dev/null
+++ b/conf/pogo.conf
@@ -0,0 +1,44 @@
+#
+# NTP configuration file (ntp.conf)
+# SunOS pogo.udel.edu 5.8 Generic sun4u sparc SUNW,Ultra-1
+#
+server 127.127.6.1 prefer # IRIG from GPS1
+fudge 127.127.6.1 refid GPS1 time1 -.002777 flag2 1
+server 127.127.4.1 # spectracom GPS receiver
+# delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035
+fudge 127.127.4.1 refid GPS2 time1 .000221
+server 127.127.22.0 # PPS from GPS2
+fudge 127.127.22.0 flag3 1 # kernel PPS
+#
+# Backups
+#
+server 128.4.1.2 # mizbeaver
+server 128.175.60.175 version 3 # ntp1.nss
+#
+# Services
+#
+manycastclient 239.1.1.1 autokey maxpoll 12 ttl 7
+manycastserver 239.1.1.1
+#
+# Access control stuff
+#
+restrict default noserve # default deny
+restrict 127.0.0.1 # allow local host
+restrict 128.4.0.0 mask 255.255.0.0 # allow DCnet clients
+restrict 128.175.0.0 mask 255.255.0.0 # allow UDel clients
+restrict 140.173.0.0 mask 255.255.0.0 # allow DARTnet/CAIRN clients
+#
+# Authentication stuff
+#
+crypto # enable public key
+keys /usr/local/etc/ntp.keys # path for keys file
+trustedkey 3 4 5 14 # define trusted keys
+requestkey 14 # key (7) for accessing server variables
+controlkey 14 # key (6) for accessing server variables
+#
+# Miscellaneous stuff
+#
+driftfile /etc/ntp.drift # path for drift file
+statsdir /var/spool/ntpstats/ # directory for statistics files
+filegen loopstats file loopstats type day enable
+filegen cryptostats file cryptostats type day enable
diff --git a/conf/rackety.conf b/conf/rackety.conf
new file mode 100644
index 0000000..684e4b7
--- /dev/null
+++ b/conf/rackety.conf
@@ -0,0 +1,56 @@
+#
+# NTP configuration file (ntp.conf)
+# SunOS rackety.u 4.1.3 243 sun4c
+#
+# This is for a dedicated primary server connected to four reference
+# clocks and providing service via multicast, broadcast, manycast and
+# the usual suspects. It blocks previous versions and limits clients
+# per network to two and returnd a kiss-of-death packet if the
+# sender is blocked. Note that the precise fudge factors were
+# determined using the calibrate feature and that the kernel PPS
+# discipline is selected.
+#
+server 127.127.4.0 prefer # Spectracom GPS receiver #1
+fudge 127.127.4.0 refid GPS1 time1 -.000097 flag1 1
+server 127.127.4.1 # Spectracom GPS receiver #2
+fudge 127.127.4.1 refid GPS2 time1 -.000097 flag1 1
+server 127.127.4.2 # Spectracom WWVB receiver #1
+# delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035
+fudge 127.127.4.2 refid WVB1 time1 .0021 flag4 1 flag1 1
+server 127.127.4.3 # Spectracom WWVB receiver #2
+# delays: prop 0.0088 ant .0002 rcvr .0173 = 26.3 ms; os .0035
+fudge 127.127.4.3 refid WVB2 time1 .0021 flag4 1 flag1 1
+server 127.127.22.1 # PPS
+fudge 127.127.22.1 flag3 1 # kernel PPS
+#
+# Services
+#
+broadcast 224.0.1.1 autokey # multicast
+broadcast 128.4.1.255 autokey # local subnet broadcast
+manycastclient 239.1.1.1 autokey maxpoll 12 ttl 7 # manycast
+manycastserver 239.1.1.1 # manycast
+#
+# Access controls
+#
+restrict default limited version kod # default limit clients per net
+restrict 127.0.0.1 # allow local host
+restrict 128.4.0.0 mask 255.255.0.0 # allow DCnet clients
+restrict 128.175.0.0 mask 255.255.0.0 # allow UDELnet clients
+restrict 140.173.0.0 mask 255.255.0.0 # allow DARTnet/CAIRN clients
+#
+# Authentication stuff
+#
+crypto # enable public key
+keys /usr/local/etc/ntp.keys # symmetric keys file
+trustedkey 3 4 5 14 # define trusted keys
+requestkey 14 # key (7) for accessing server variables
+controlkey 14 # key (6) for accessing server variables
+#
+# Miscellaneous stuff
+#
+driftfile /etc/ntp.drift # frequency offset
+statsdir /rackety/ntpstats/ # directory for statistics files
+filegen peerstats file peerstats type day enable
+filegen loopstats file loopstats type day enable
+filegen clockstats file clockstats type day enable
+
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..ad7408c
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,1734 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Is adjtime() accurate? */
+#undef ADJTIME_IS_ACCURATE
+
+/* Support NTP Autokey protocol? */
+#undef AUTOKEY
+
+/* why not HAVE_P_S? */
+#undef CALL_PTHREAD_SETCONCURRENCY
+
+/* ACTS modem service */
+#undef CLOCK_ACTS
+
+/* Arbiter 1088A/B GPS receiver */
+#undef CLOCK_ARBITER
+
+/* ARCRON support? */
+#undef CLOCK_ARCRON_MSF
+
+/* Austron 2200A/2201A GPS receiver? */
+#undef CLOCK_AS2201
+
+/* PPS interface? */
+#undef CLOCK_ATOM
+
+/* Datum/Bancomm bc635/VME interface? */
+#undef CLOCK_BANC
+
+/* Chronolog K-series WWVB receiver? */
+#undef CLOCK_CHRONOLOG
+
+/* CHU modem/decoder */
+#undef CLOCK_CHU
+
+/* Diems Computime Radio Clock? */
+#undef CLOCK_COMPUTIME
+
+/* Datum Programmable Time System? */
+#undef CLOCK_DATUM
+
+/* ELV/DCF7000 clock? */
+#undef CLOCK_DCF7000
+
+/* Dumb generic hh:mm:ss local clock? */
+#undef CLOCK_DUMBCLOCK
+
+/* Forum Graphic GPS datating station driver? */
+#undef CLOCK_FG
+
+/* GPSD JSON receiver */
+#undef CLOCK_GPSDJSON
+
+/* TrueTime GPS receiver/VME interface? */
+#undef CLOCK_GPSVME
+
+/* Heath GC-1000 WWV/WWVH receiver? */
+#undef CLOCK_HEATH
+
+/* HOPF 6021 clock? */
+#undef CLOCK_HOPF6021
+
+/* HOPF PCI clock device? */
+#undef CLOCK_HOPF_PCI
+
+/* HOPF serial clock device? */
+#undef CLOCK_HOPF_SERIAL
+
+/* HP 58503A GPS receiver? */
+#undef CLOCK_HPGPS
+
+/* IRIG audio decoder? */
+#undef CLOCK_IRIG
+
+/* JJY receiver? */
+#undef CLOCK_JJY
+
+/* Rockwell Jupiter GPS clock? */
+#undef CLOCK_JUPITER
+
+/* Leitch CSD 5300 Master Clock System Driver? */
+#undef CLOCK_LEITCH
+
+/* local clock reference? */
+#undef CLOCK_LOCAL
+
+/* Meinberg clocks */
+#undef CLOCK_MEINBERG
+
+/* Magnavox MX4200 GPS receiver */
+#undef CLOCK_MX4200
+
+/* NeoClock4X */
+#undef CLOCK_NEOCLOCK4X
+
+/* NMEA GPS receiver */
+#undef CLOCK_NMEA
+
+/* Motorola UT Oncore GPS */
+#undef CLOCK_ONCORE
+
+/* Palisade clock */
+#undef CLOCK_PALISADE
+
+/* PARSE driver interface */
+#undef CLOCK_PARSE
+
+/* Conrad parallel port radio clock */
+#undef CLOCK_PCF
+
+/* PCL 720 clock support */
+#undef CLOCK_PPS720
+
+/* PST/Traconex 1020 WWV/WWVH receiver */
+#undef CLOCK_PST
+
+/* DCF77 raw time code */
+#undef CLOCK_RAWDCF
+
+/* RCC 8000 clock */
+#undef CLOCK_RCC8000
+
+/* RIPE NCC Trimble clock */
+#undef CLOCK_RIPENCC
+
+/* Schmid DCF77 clock */
+#undef CLOCK_SCHMID
+
+/* SEL240X protocol */
+#undef CLOCK_SEL240X
+
+/* clock thru shared memory */
+#undef CLOCK_SHM
+
+/* Spectracom 8170/Netclock/2 WWVB receiver */
+#undef CLOCK_SPECTRACOM
+
+/* KSI/Odetics TPRO/S GPS receiver/IRIG interface */
+#undef CLOCK_TPRO
+
+/* Trimble GPS receiver/TAIP protocol */
+#undef CLOCK_TRIMTAIP
+
+/* Trimble GPS receiver/TSIP protocol */
+#undef CLOCK_TRIMTSIP
+
+/* Kinemetrics/TrueTime receivers */
+#undef CLOCK_TRUETIME
+
+/* Spectracom TSYNC timing board */
+#undef CLOCK_TSYNCPCI
+
+/* TrueTime 560 IRIG-B decoder? */
+#undef CLOCK_TT560
+
+/* Ultralink M320 WWVB receiver? */
+#undef CLOCK_ULINK
+
+/* VARITEXT clock */
+#undef CLOCK_VARITEXT
+
+/* WHARTON 400A Series clock */
+#undef CLOCK_WHARTON_400A
+
+/* WWV audio driver */
+#undef CLOCK_WWV
+
+/* Zyfer GPStarplus */
+#undef CLOCK_ZYFER
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Enable debugging code? */
+#undef DEBUG
+
+/* Enable processing time debugging? */
+#undef DEBUG_TIMING
+
+/* Declaration style */
+#undef DECL_ADJTIME_0
+
+/* Declaration style */
+#undef DECL_BCOPY_0
+
+/* Declaration style */
+#undef DECL_BZERO_0
+
+/* Declaration style */
+#undef DECL_CFSETISPEED_0
+
+/* Declare errno? */
+#undef DECL_ERRNO
+
+/* Declaration style */
+#undef DECL_HSTRERROR_0
+
+/* Declare h_errno? */
+#undef DECL_H_ERRNO
+
+/* Declaration style */
+#undef DECL_INET_NTOA_0
+
+/* Declaration style */
+#undef DECL_IOCTL_0
+
+/* Declaration style */
+#undef DECL_IPC_0
+
+/* Declaration style */
+#undef DECL_MEMMOVE_0
+
+/* Declaration style */
+#undef DECL_MKSTEMP_0
+
+/* Declaration style */
+#undef DECL_MKTEMP_0
+
+/* Declaration style */
+#undef DECL_NLIST_0
+
+/* Declaration style */
+#undef DECL_PLOCK_0
+
+/* Declaration style */
+#undef DECL_RENAME_0
+
+/* Declaration style */
+#undef DECL_SELECT_0
+
+/* Declaration style */
+#undef DECL_SETITIMER_0
+
+/* Declaration style */
+#undef DECL_SETPRIORITY_0
+
+/* Declaration style */
+#undef DECL_SETPRIORITY_1
+
+/* Declaration style */
+#undef DECL_SIGVEC_0
+
+/* Declaration style */
+#undef DECL_STDIO_0
+
+/* Declaration style */
+#undef DECL_STIME_0
+
+/* Declaration style */
+#undef DECL_STIME_1
+
+/* Declaration style */
+#undef DECL_STRERROR_0
+
+/* Declaration style */
+#undef DECL_STRTOL_0
+
+/* Declare syscall()? */
+#undef DECL_SYSCALL
+
+/* Declaration style */
+#undef DECL_SYSLOG_0
+
+/* Declaration style */
+#undef DECL_TIMEOFDAY_0
+
+/* Declaration style */
+#undef DECL_TIME_0
+
+/* Declaration style */
+#undef DECL_TOLOWER_0
+
+/* Declaration style */
+#undef DECL_TOUPPER_0
+
+/* What is the fallback value for HZ? */
+#undef DEFAULT_HZ
+
+/* Default number of megabytes for RLIMIT_MEMLOCK */
+#undef DFLT_RLIMIT_MEMLOCK
+
+/* Default number of 4k pages for RLIMIT_STACK */
+#undef DFLT_RLIMIT_STACK
+
+/* Directory separator character, usually / or \\ */
+#undef DIR_SEP
+
+/* use old autokey session key behavior? */
+#undef DISABLE_BUG1243_FIX
+
+/* synch TODR hourly? */
+#undef DOSYNCTODR
+
+/* The number of minutes in a DST adjustment */
+#undef DSTMINUTES
+
+/* number of args to el_init() */
+#undef EL_INIT_ARGS
+
+/* nls support in libopts */
+#undef ENABLE_NLS
+
+/* force ntpdate to step the clock if !defined(STEP_SLEW) ? */
+#undef FORCE_NTPDATE_STEP
+
+/* What is getsockname()'s socklen type? */
+#undef GETSOCKNAME_SOCKLEN_TYPE
+
+/* Do we have a routing socket (rt_msghdr or rtattr)? */
+#undef HAS_ROUTING_SOCKET
+
+/* via __adjtimex */
+#undef HAVE_ADJTIMEX
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#undef HAVE_ARPA_NAMESER_H
+
+/* Do we have audio support? */
+#undef HAVE_AUDIO
+
+/* Define to 1 if you have the <bstring.h> header file. */
+#undef HAVE_BSTRING_H
+
+/* Define to 1 if you have the `canonicalize_file_name' function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
+/* Define to 1 if you have the `chmod' function. */
+#undef HAVE_CHMOD
+
+/* Do we have the CIOGETEV ioctl (SunOS, Linux)? */
+#undef HAVE_CIOGETEV
+
+/* Define to 1 if you have the `clock_getres' function. */
+#undef HAVE_CLOCK_GETRES
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `clock_settime' function. */
+#undef HAVE_CLOCK_SETTIME
+
+/* Define to 1 if you have the <cthreads.h> header file. */
+#undef HAVE_CTHREADS_H
+
+/* Define to 1 if you have the `daemon' function. */
+#undef HAVE_DAEMON
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRERROR_R
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Use Rendezvous/DNS-SD registration */
+#undef HAVE_DNSREGISTRATION
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Can we drop root privileges? */
+#undef HAVE_DROPROOT
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the `fchmod' function. */
+#undef HAVE_FCHMOD
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `finite' function. */
+#undef HAVE_FINITE
+
+/* Define to 1 if you have the `fnmatch' function. */
+#undef HAVE_FNMATCH
+
+/* Define to 1 if you have the <fnmatch.h> header file. */
+#undef HAVE_FNMATCH_H
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define to 1 if you have the `fstat' function. */
+#undef HAVE_FSTAT
+
+/* Define to 1 if you have the `getbootfile' function. */
+#undef HAVE_GETBOOTFILE
+
+/* Define to 1 if you have the `getclock' function. */
+#undef HAVE_GETCLOCK
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAVE_GETIFADDRS
+
+/* Define to 1 if you have the `getpassphrase' function. */
+#undef HAVE_GETPASSPHRASE
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* if you have GNU Pth */
+#undef HAVE_GNU_PTH
+
+/* Define to 1 if you have the <histedit.h> header file. */
+#undef HAVE_HISTEDIT_H
+
+/* Define to 1 if you have the <history.h> header file. */
+#undef HAVE_HISTORY_H
+
+/* Obvious */
+#undef HAVE_HZ_IN_STRUCT_CLOCKINFO
+
+/* Define to 1 if you have the <ieeefp.h> header file. */
+#undef HAVE_IEEEFP_H
+
+/* have iflist_sysctl? */
+#undef HAVE_IFLIST_SYSCTL
+
+/* Define to 1 if you have the `if_nametoindex' function. */
+#undef HAVE_IF_NAMETOINDEX
+
+/* inline keyword or macro available */
+#undef HAVE_INLINE
+
+/* Define to 1 if the system has the type `int16_t'. */
+#undef HAVE_INT16_T
+
+/* Define to 1 if the system has the type `int32'. */
+#undef HAVE_INT32
+
+/* int32 type in DNS headers, not others. */
+#undef HAVE_INT32_ONLY_WITH_DNS
+
+/* Define to 1 if the system has the type `int32_t'. */
+#undef HAVE_INT32_T
+
+/* Define to 1 if the system has the type `int8_t'. */
+#undef HAVE_INT8_T
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#undef HAVE_INTMAX_T
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `isfinite' function. */
+#undef HAVE_ISFINITE
+
+/* Define to 1 if you have the <kvm.h> header file. */
+#undef HAVE_KVM_H
+
+/* Define to 1 if you have the `kvm_open' function. */
+#undef HAVE_KVM_OPEN
+
+/* Define to 1 if you have the `gen' library (-lgen). */
+#undef HAVE_LIBGEN
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
+/* Define to 1 if you have the `intl' library (-lintl). */
+#undef HAVE_LIBINTL
+
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define to 1 if you have the <libscf.h> header file. */
+#undef HAVE_LIBSCF_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* using Linux pthread? */
+#undef HAVE_LINUXTHREADS
+
+/* Do we have Linux capabilities? */
+#undef HAVE_LINUX_CAPABILITIES
+
+/* Define to 1 if you have the <linux/if_addr.h> header file. */
+#undef HAVE_LINUX_IF_ADDR_H
+
+/* if you have LinuxThreads */
+#undef HAVE_LINUX_THREADS
+
+/* Define to 1 if you have the `localeconv' function. */
+#undef HAVE_LOCALECONV
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the system has the type `long double'. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define to 1 if the system has the type `long long int'. */
+#undef HAVE_LONG_LONG_INT
+
+/* if you have SunOS LWP package */
+#undef HAVE_LWP
+
+/* Define to 1 if you have the <lwp/lwp.h> header file. */
+#undef HAVE_LWP_LWP_H
+
+/* Define to 1 if you have the <machine/inline.h> header file. */
+#undef HAVE_MACHINE_INLINE_H
+
+/* Define to 1 if you have the <machine/soundcard.h> header file. */
+#undef HAVE_MACHINE_SOUNDCARD_H
+
+/* define if you have Mach Cthreads */
+#undef HAVE_MACH_CTHREADS
+
+/* Define to 1 if you have the <mach/cthreads.h> header file. */
+#undef HAVE_MACH_CTHREADS_H
+
+/* Define to 1 if you have the <math.h> header file. */
+#undef HAVE_MATH_H
+
+/* Define to 1 if you have the `MD5Init' function. */
+#undef HAVE_MD5INIT
+
+/* Define to 1 if you have the <md5.h> header file. */
+#undef HAVE_MD5_H
+
+/* Define to 1 if you have the `memlk' function. */
+#undef HAVE_MEMLK
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the `mktime' function. */
+#undef HAVE_MKTIME
+
+/* Define to 1 if you have the `mlockall' function. */
+#undef HAVE_MLOCKALL
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/in_system.h> header file. */
+#undef HAVE_NETINET_IN_SYSTEM_H
+
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+#undef HAVE_NETINET_IN_SYSTM_H
+
+/* Define to 1 if you have the <netinet/in_var.h> header file. */
+#undef HAVE_NETINET_IN_VAR_H
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#undef HAVE_NETINET_IP_H
+
+/* NetInfo support? */
+#undef HAVE_NETINFO
+
+/* Define to 1 if you have the <netinfo/ni.h> header file. */
+#undef HAVE_NETINFO_NI_H
+
+/* Define to 1 if you have the <net/if6.h> header file. */
+#undef HAVE_NET_IF6_H
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
+/* Define to 1 if you have the <net/if_var.h> header file. */
+#undef HAVE_NET_IF_VAR_H
+
+/* Define to 1 if you have the <net/route.h> header file. */
+#undef HAVE_NET_ROUTE_H
+
+/* Define to 1 if you have the `nice' function. */
+#undef HAVE_NICE
+
+/* Define to 1 if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
+/* via __adjtimex */
+#undef HAVE_NTP_ADJTIME
+
+/* via __ntp_gettime */
+#undef HAVE_NTP_GETTIME
+
+/* Do we want support for Samba's signing daemon? */
+#undef HAVE_NTP_SIGND
+
+/* if you have NT Event Log */
+#undef HAVE_NT_EVENT_LOG
+
+/* if you have NT Service Manager */
+#undef HAVE_NT_SERVICE_MANAGER
+
+/* if you have NT Threads */
+#undef HAVE_NT_THREADS
+
+/* Define to 1 if the system has the type `pid_t'. */
+#undef HAVE_PID_T
+
+/* Define to 1 if you have the `plock' function. */
+#undef HAVE_PLOCK
+
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
+/* Do we have the PPS API per the Draft RFC? */
+#undef HAVE_PPSAPI
+
+/* Define to 1 if you have the <priv.h> header file. */
+#undef HAVE_PRIV_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* define to pthreads API spec revision */
+#undef HAVE_PTHREADS
+
+/* Define to 1 if you have the `pthread_attr_getstacksize' function. */
+#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
+
+/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
+#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
+
+/* define if you have pthread_detach function */
+#undef HAVE_PTHREAD_DETACH
+
+/* Define to 1 if you have the `pthread_getconcurrency' function. */
+#undef HAVE_PTHREAD_GETCONCURRENCY
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the `pthread_kill' function. */
+#undef HAVE_PTHREAD_KILL
+
+/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */
+#undef HAVE_PTHREAD_KILL_OTHER_THREADS_NP
+
+/* define if you have pthread_rwlock_destroy function */
+#undef HAVE_PTHREAD_RWLOCK_DESTROY
+
+/* Define to 1 if you have the `pthread_setconcurrency' function. */
+#undef HAVE_PTHREAD_SETCONCURRENCY
+
+/* Define to 1 if you have the `pthread_yield' function. */
+#undef HAVE_PTHREAD_YIELD
+
+/* Define to 1 if you have the <pth.h> header file. */
+#undef HAVE_PTH_H
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#undef HAVE_PTRDIFF_T
+
+/* Define to 1 if you have the `pututline' function. */
+#undef HAVE_PUTUTLINE
+
+/* Define to 1 if you have the `pututxline' function. */
+#undef HAVE_PUTUTXLINE
+
+/* Define to 1 if you have the <readline.h> header file. */
+#undef HAVE_READLINE_H
+
+/* Define if your readline library has \`add_history' */
+#undef HAVE_READLINE_HISTORY
+
+/* Define to 1 if you have the <readline/history.h> header file. */
+#undef HAVE_READLINE_HISTORY_H
+
+/* Define to 1 if you have the <readline/readline.h> header file. */
+#undef HAVE_READLINE_READLINE_H
+
+/* Define to 1 if you have the `readlink' function. */
+#undef HAVE_READLINK
+
+/* Define to 1 if you have the `recvmsg' function. */
+#undef HAVE_RECVMSG
+
+/* Define to 1 if you have the <resolv.h> header file. */
+#undef HAVE_RESOLV_H
+
+/* Define to 1 if you have the `res_init' function. */
+#undef HAVE_RES_INIT
+
+/* Do we have Linux routing socket? */
+#undef HAVE_RTNETLINK
+
+/* Define to 1 if you have the `rtprio' function. */
+#undef HAVE_RTPRIO
+
+/* Define to 1 if you have the <runetype.h> header file. */
+#undef HAVE_RUNETYPE_H
+
+/* Obvious */
+#undef HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION
+
+/* Define to 1 if you have the <sched.h> header file. */
+#undef HAVE_SCHED_H
+
+/* Define to 1 if you have the `sched_setscheduler' function. */
+#undef HAVE_SCHED_SETSCHEDULER
+
+/* Define to 1 if you have the `sched_yield' function. */
+#undef HAVE_SCHED_YIELD
+
+/* Define to 1 if you have the <semaphore.h> header file. */
+#undef HAVE_SEMAPHORE_H
+
+/* Define to 1 if you have the `sem_timedwait' function. */
+#undef HAVE_SEM_TIMEDWAIT
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#undef HAVE_SETJMP_H
+
+/* Define to 1 if you have the `setlinebuf' function. */
+#undef HAVE_SETLINEBUF
+
+/* Define to 1 if you have the `setpgid' function. */
+#undef HAVE_SETPGID
+
+/* define if setpgrp takes 0 arguments */
+#undef HAVE_SETPGRP_0
+
+/* Define to 1 if you have the `setpriority' function. */
+#undef HAVE_SETPRIORITY
+
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
+/* Define to 1 if you have the `setsid' function. */
+#undef HAVE_SETSID
+
+/* Define to 1 if you have the `settimeofday' function. */
+#undef HAVE_SETTIMEOFDAY
+
+/* Define to 1 if you have the `setvbuf' function. */
+#undef HAVE_SETVBUF
+
+/* Define to 1 if you have the <sgtty.h> header file. */
+#undef HAVE_SGTTY_H
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Can we use SIGIO for tcp and udp IO? */
+#undef HAVE_SIGNALED_IO
+
+/* Define to 1 if you have the `sigset' function. */
+#undef HAVE_SIGSET
+
+/* Define to 1 if you have the `sigvec' function. */
+#undef HAVE_SIGVEC
+
+/* sigwait() available? */
+#undef HAVE_SIGWAIT
+
+/* Define to 1 if the system has the type `size_t'. */
+#undef HAVE_SIZE_T
+
+/* Define if C99-compliant `snprintf' is available. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Are Solaris privileges available? */
+#undef HAVE_SOLARIS_PRIVS
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `stime' function. */
+#undef HAVE_STIME
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the <stropts.h> header file. */
+#undef HAVE_STROPTS_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strsignal' function. */
+#undef HAVE_STRSIGNAL
+
+/* Define to 1 if `decimal_point' is a member of `struct lconv'. */
+#undef HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Define to 1 if `thousands_sep' is a member of `struct lconv'. */
+#undef HAVE_STRUCT_LCONV_THOUSANDS_SEP
+
+/* Do we have struct ntptimeval? */
+#undef HAVE_STRUCT_NTPTIMEVAL
+
+/* Define to 1 if `time.tv_nsec' is a member of `struct ntptimeval'. */
+#undef HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC
+
+/* Does a system header define struct ppsclockev? */
+#undef HAVE_STRUCT_PPSCLOCKEV
+
+/* Do we have struct snd_size? */
+#undef HAVE_STRUCT_SND_SIZE
+
+/* Does a system header define struct sockaddr_storage? */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* struct timespec declared? */
+#undef HAVE_STRUCT_TIMESPEC
+
+/* Define to 1 if you have the <sun/audioio.h> header file. */
+#undef HAVE_SUN_AUDIOIO_H
+
+/* Define to 1 if you have the <synch.h> header file. */
+#undef HAVE_SYNCH_H
+
+/* Define to 1 if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
+/* Define to 1 if you have the <sysexits.h> header file. */
+#undef HAVE_SYSEXITS_H
+
+/* */
+#undef HAVE_SYSLOG_FACILITYNAMES
+
+/* Define to 1 if you have the <sys/audioio.h> header file. */
+#undef HAVE_SYS_AUDIOIO_H
+
+/* Define to 1 if you have the <sys/capability.h> header file. */
+#undef HAVE_SYS_CAPABILITY_H
+
+/* Define to 1 if you have the <sys/clockctl.h> header file. */
+#undef HAVE_SYS_CLOCKCTL_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define to 1 if you have the <sys/i8253.h> header file. */
+#undef HAVE_SYS_I8253_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/ipc.h> header file. */
+#undef HAVE_SYS_IPC_H
+
+/* Define to 1 if you have the <sys/limits.h> header file. */
+#undef HAVE_SYS_LIMITS_H
+
+/* Define to 1 if you have the <sys/lock.h> header file. */
+#undef HAVE_SYS_LOCK_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/modem.h> header file. */
+#undef HAVE_SYS_MODEM_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/pcl720.h> header file. */
+#undef HAVE_SYS_PCL720_H
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/ppsclock.h> header file. */
+#undef HAVE_SYS_PPSCLOCK_H
+
+/* Define to 1 if you have the <sys/ppstime.h> header file. */
+#undef HAVE_SYS_PPSTIME_H
+
+/* Define to 1 if you have the <sys/prctl.h> header file. */
+#undef HAVE_SYS_PRCTL_H
+
+/* Define to 1 if you have the <sys/procset.h> header file. */
+#undef HAVE_SYS_PROCSET_H
+
+/* Define to 1 if you have the <sys/proc.h> header file. */
+#undef HAVE_SYS_PROC_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/sched.h> header file. */
+#undef HAVE_SYS_SCHED_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/shm.h> header file. */
+#undef HAVE_SYS_SHM_H
+
+/* Define to 1 if you have the <sys/signal.h> header file. */
+#undef HAVE_SYS_SIGNAL_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
+#undef HAVE_SYS_SOUNDCARD_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/stream.h> header file. */
+#undef HAVE_SYS_STREAM_H
+
+/* Define to 1 if you have the <sys/stropts.h> header file. */
+#undef HAVE_SYS_STROPTS_H
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define to 1 if you have the <sys/syssgi.h> header file. */
+#undef HAVE_SYS_SYSSGI_H
+
+/* Define to 1 if you have the <sys/systune.h> header file. */
+#undef HAVE_SYS_SYSTUNE_H
+
+/* Define to 1 if you have the <sys/termios.h> header file. */
+#undef HAVE_SYS_TERMIOS_H
+
+/* Define to 1 if you have the <sys/timepps.h> header file. */
+#undef HAVE_SYS_TIMEPPS_H
+
+/* Define to 1 if you have the <sys/timers.h> header file. */
+#undef HAVE_SYS_TIMERS_H
+
+/* Define to 1 if you have the <sys/timex.h> header file. */
+#undef HAVE_SYS_TIMEX_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/tpro.h> header file. */
+#undef HAVE_SYS_TPRO_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Use sys/uio.h for struct iovec help */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/var.h> header file. */
+#undef HAVE_SYS_VAR_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if the system has the type `s_char'. */
+#undef HAVE_S_CHAR
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if you have the <termio.h> header file. */
+#undef HAVE_TERMIO_H
+
+/* if you have Solaris LWP (thr) package */
+#undef HAVE_THR
+
+/* Define to 1 if you have the <thread.h> header file. */
+#undef HAVE_THREAD_H
+
+/* Define to 1 if you have the `thr_getconcurrency' function. */
+#undef HAVE_THR_GETCONCURRENCY
+
+/* Define to 1 if you have the `thr_setconcurrency' function. */
+#undef HAVE_THR_SETCONCURRENCY
+
+/* Define to 1 if you have the `thr_yield' function. */
+#undef HAVE_THR_YIELD
+
+/* Obvious */
+#undef HAVE_TICKADJ_IN_STRUCT_CLOCKINFO
+
+/* Define to 1 if you have the `timegm' function. */
+#undef HAVE_TIMEGM
+
+/* Define to 1 if you have the <timepps.h> header file. */
+#undef HAVE_TIMEPPS_H
+
+/* Define to 1 if you have the `timer_create' function. */
+#undef HAVE_TIMER_CREATE
+
+/* Define to 1 if you have the <timex.h> header file. */
+#undef HAVE_TIMEX_H
+
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Do we have the TIOCGPPSEV ioctl (Solaris)? */
+#undef HAVE_TIOCGPPSEV
+
+/* Do we have the TIOCSPPS ioctl (Solaris)? */
+#undef HAVE_TIOCSPPS
+
+/* Do we have the TIO serial stuff? */
+#undef HAVE_TIO_SERIAL_STUFF
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#undef HAVE_UINT16_T
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#undef HAVE_UINT32_T
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#undef HAVE_UINT8_T
+
+/* Define to 1 if the system has the type `uintmax_t'. */
+#undef HAVE_UINTMAX_T
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
+/* Define to 1 if the system has the type `uint_t'. */
+#undef HAVE_UINT_T
+
+/* Define to 1 if you have the `umask' function. */
+#undef HAVE_UMASK
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* deviant sigwait? */
+#undef HAVE_UNIXWARE_SIGWAIT
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
+
+/* Define to 1 if you have the `updwtmp' function. */
+#undef HAVE_UPDWTMP
+
+/* Define to 1 if you have the `updwtmpx' function. */
+#undef HAVE_UPDWTMPX
+
+/* Define to 1 if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
+
+/* Define to 1 if you have the <utmpx.h> header file. */
+#undef HAVE_UTMPX_H
+
+/* Define to 1 if you have the <utmp.h> header file. */
+#undef HAVE_UTMP_H
+
+/* Define to 1 if the system has the type `u_int32'. */
+#undef HAVE_U_INT32
+
+/* u_int32 type in DNS headers, not others. */
+#undef HAVE_U_INT32_ONLY_WITH_DNS
+
+/* Define to 1 if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
+
+/* Define to 1 if you have the <varargs.h> header file. */
+#undef HAVE_VARARGS_H
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define if C99-compliant `vsnprintf' is available. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if the system has the type `wchar_t'. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if the system has the type `wint_t'. */
+#undef HAVE_WINT_T
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* define if select implicitly yields */
+#undef HAVE_YIELDING_SELECT
+
+/* Define to 1 if you have the `_exit' function. */
+#undef HAVE__EXIT
+
+/* Define to 1 if you have the </sys/sync/queue.h> header file. */
+#undef HAVE__SYS_SYNC_QUEUE_H
+
+/* Define to 1 if you have the </sys/sync/sema.h> header file. */
+#undef HAVE__SYS_SYNC_SEMA_H
+
+/* Define to 1 if you have the `__adjtimex' function. */
+#undef HAVE___ADJTIMEX
+
+/* defined if C compiler supports __attribute__((...)) */
+#undef HAVE___ATTRIBUTE__
+
+
+ /* define away __attribute__() if unsupported */
+ #ifndef HAVE___ATTRIBUTE__
+ # define __attribute__(x) /* empty */
+ #endif
+ #define ISC_PLATFORM_NORETURN_PRE
+ #define ISC_PLATFORM_NORETURN_POST __attribute__((__noreturn__))
+
+
+
+/* Define to 1 if you have the `__ntp_gettime' function. */
+#undef HAVE___NTP_GETTIME
+
+/* Define to 1 if you have the `__res_init' function. */
+#undef HAVE___RES_INIT
+
+/* Does struct sockaddr_storage have __ss_family? */
+#undef HAVE___SS_FAMILY_IN_SS
+
+
+ /* Handle sockaddr_storage.__ss_family */
+ #ifdef HAVE___SS_FAMILY_IN_SS
+ # define ss_family __ss_family
+ #endif /* HAVE___SS_FAMILY_IN_SS */
+
+
+
+/* Define to provide `rpl_snprintf' function. */
+#undef HW_WANT_RPL_SNPRINTF
+
+/* Define to provide `rpl_vsnprintf' function. */
+#undef HW_WANT_RPL_VSNPRINTF
+
+/* Retry queries on _any_ DNS error? */
+#undef IGNORE_DNS_ERRORS
+
+/* Should we use the IRIG sawtooth filter? */
+#undef IRIG_SUCKS
+
+/* Enclose PTHREAD_ONCE_INIT in extra braces? */
+#undef ISC_PLATFORM_BRACEPTHREADONCEINIT
+
+/* Do we need to fix in6isaddr? */
+#undef ISC_PLATFORM_FIXIN6ISADDR
+
+/* ISC: do we have if_nametoindex()? */
+#undef ISC_PLATFORM_HAVEIFNAMETOINDEX
+
+/* have struct if_laddrconf? */
+#undef ISC_PLATFORM_HAVEIF_LADDRCONF
+
+/* have struct if_laddrreq? */
+#undef ISC_PLATFORM_HAVEIF_LADDRREQ
+
+/* have struct in6_pktinfo? */
+#undef ISC_PLATFORM_HAVEIN6PKTINFO
+
+/* have IPv6? */
+#undef ISC_PLATFORM_HAVEIPV6
+
+/* struct sockaddr has sa_len? */
+#undef ISC_PLATFORM_HAVESALEN
+
+/* sin6_scope_id? */
+#undef ISC_PLATFORM_HAVESCOPEID
+
+/* missing in6addr_any? */
+#undef ISC_PLATFORM_NEEDIN6ADDRANY
+
+/* Do we need netinet6/in6.h? */
+#undef ISC_PLATFORM_NEEDNETINET6IN6H
+
+/* ISC: provide inet_ntop() */
+#undef ISC_PLATFORM_NEEDNTOP
+
+/* Declare in_port_t? */
+#undef ISC_PLATFORM_NEEDPORTT
+
+/* ISC: provide inet_pton() */
+#undef ISC_PLATFORM_NEEDPTON
+
+/* enable libisc thread support? */
+#undef ISC_PLATFORM_USETHREADS
+
+/* Does the kernel have an FLL bug? */
+#undef KERNEL_FLL_BUG
+
+/* Does the kernel support precision time discipline? */
+#undef KERNEL_PLL
+
+/* Define to use libseccomp system call filtering. */
+#undef KERN_SECCOMP
+
+/* What is (probably) the name of DOSYNCTODR in the kernel? */
+#undef K_DOSYNCTODR_NAME
+
+/* What is (probably) the name of NOPRINTF in the kernel? */
+#undef K_NOPRINTF_NAME
+
+/* What is the name of TICKADJ in the kernel? */
+#undef K_TICKADJ_NAME
+
+/* What is the name of TICK in the kernel? */
+#undef K_TICK_NAME
+
+/* define to 1 if library is thread safe */
+#undef LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
+
+/* Define to any value to include libseccomp sandboxing. */
+#undef LIBSECCOMP
+
+/* Should we align with the NIST lockclock scheme? */
+#undef LOCKCLOCK
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Does the target support multicast IP? */
+#undef MCAST
+
+/* Should we recommend a minimum value for tickadj? */
+#undef MIN_REC_TICKADJ
+
+/* Do we need HPUX adjtime() library support? */
+#undef NEED_HPUX_ADJTIME
+
+/* Do we want the HPUX FindConfig()? */
+#undef NEED_HPUX_FINDCONFIG
+
+/* We need to provide netsnmp_daemonize() */
+#undef NEED_NETSNMP_DAEMONIZE
+
+/* pthread_init() required? */
+#undef NEED_PTHREAD_INIT
+
+/* use PTHREAD_SCOPE_SYSTEM? */
+#undef NEED_PTHREAD_SCOPE_SYSTEM
+
+/* Do we need the qnx adjtime call? */
+#undef NEED_QNX_ADJTIME
+
+/* Do we need extra room for SO_RCVBUF? (HPUX < 8) */
+#undef NEED_RCVBUF_SLOP
+
+/* Do we need an s_char typedef? */
+#undef NEED_S_CHAR_TYPEDEF
+
+/* Might nlist() values require an extra level of indirection (AIX)? */
+#undef NLIST_EXTRA_INDIRECTION
+
+/* does struct nlist use a name union? */
+#undef NLIST_NAME_UNION
+
+/* nlist stuff */
+#undef NLIST_STRUCT
+
+/* Should we NOT read /dev/kmem? */
+#undef NOKMEM
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Should we avoid #warning on option name collisions? */
+#undef NO_OPTION_NAME_WARNINGS
+
+/* Is there a problem using PARENB and IGNPAR? */
+#undef NO_PARENB_IGNPAR
+
+/* define if you have (or want) no threads */
+#undef NO_THREADS
+
+/* Default location of crypto key info */
+#undef NTP_KEYSDIR
+
+/* Path to sign daemon rendezvous socket */
+#undef NTP_SIGND_PATH
+
+/* Do we have ntp_{adj,get}time in libc? */
+#undef NTP_SYSCALLS_LIBC
+
+/* Do we have ntp_{adj,get}time in the kernel? */
+#undef NTP_SYSCALLS_STD
+
+/* Do we have support for SHMEM_STATUS? */
+#undef ONCORE_SHMEM_STATUS
+
+/* Use OpenSSL? */
+#undef OPENSSL
+
+/* Should we open the broadcast socket? */
+#undef OPEN_BCAST_SOCKET
+
+/* need to recreate sockets on changed routing? */
+#undef OS_MISSES_SPECIFIC_ROUTE_UPDATES
+
+/* wildcard socket needs REUSEADDR to bind interface addresses */
+#undef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
+
+/* Do we need to override the system's idea of HZ? */
+#undef OVERRIDE_HZ
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* data dir */
+#undef PERLLIBDIR
+
+/* define to a working POSIX compliant shell */
+#undef POSIX_SHELL
+
+/* PARSE kernel PLL PPS support */
+#undef PPS_SYNC
+
+/* Preset a value for 'tick'? */
+#undef PRESET_TICK
+
+/* Preset a value for 'tickadj'? */
+#undef PRESET_TICKADJ
+
+/* Should we not IGNPAR (Linux)? */
+#undef RAWDCF_NO_IGNPAR
+
+/* enable thread safety */
+#undef REENTRANT
+
+/* Basic refclock support? */
+#undef REFCLOCK
+
+/* Do we want the ReliantUNIX clock hacks? */
+#undef RELIANTUNIX_CLOCK
+
+/* define if sched_yield yields the entire process */
+#undef REPLACE_BROKEN_YIELD
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* saveconfig mechanism */
+#undef SAVECONFIG
+
+/* Do we want the SCO clock hacks? */
+#undef SCO5_CLOCK
+
+/* The size of `char*', as computed by sizeof. */
+#undef SIZEOF_CHARP
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `pthread_t', as computed by sizeof. */
+#undef SIZEOF_PTHREAD_T
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `signed char', as computed by sizeof. */
+#undef SIZEOF_SIGNED_CHAR
+
+/* The size of `time_t', as computed by sizeof. */
+#undef SIZEOF_TIME_T
+
+/* Does SIOCGIFCONF return size in the buffer? */
+#undef SIZE_RETURNED_IN_BUFFER
+
+/* Slew always? */
+#undef SLEWALWAYS
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Step, then slew the clock? */
+#undef STEP_SLEW
+
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
+/* canonical system (cpu-vendor-os) of where we should run */
+#undef STR_SYSTEM
+
+/* Does Xettimeofday take 1 arg? */
+#undef SYSV_TIMEOFDAY
+
+/* Do we need to #define _SVID3 when we #include <termios.h>? */
+#undef TERMIOS_NEEDS__SVID3
+
+/* enable thread safety */
+#undef THREADSAFE
+
+/* enable thread safety */
+#undef THREAD_SAFE
+
+/* Is K_TICKADJ_NAME in nanoseconds? */
+#undef TICKADJ_NANO
+
+/* Is K_TICK_NAME in nanoseconds? */
+#undef TICK_NANO
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Provide a typedef for uintptr_t? */
+#ifndef HAVE_UINTPTR_T
+typedef unsigned int uintptr_t;
+#define HAVE_UINTPTR_T 1
+#endif
+
+/* What type to use for setsockopt */
+#undef TYPEOF_IP_MULTICAST_LOOP
+
+/* Do we set process groups with -pid? */
+#undef UDP_BACKWARDS_SETOWN
+
+/* Must we have a CTTY for fsetown? */
+#undef USE_FSETOWNCTTY
+
+/* Can we use SIGPOLL for tty IO? */
+#undef USE_TTY_SIGPOLL
+
+/* Can we use SIGPOLL for UDP? */
+#undef USE_UDP_SIGPOLL
+
+/* Version number of package */
+#undef VERSION
+
+/* vsnprintf expands "%m" to strerror(errno) */
+#undef VSNPRINTF_PERCENT_M
+
+/* configure --enable-ipv6 */
+#undef WANT_IPV6
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* routine worker child proc uses to exit. */
+#undef WORKER_CHILD_EXIT
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* enable thread safety */
+#undef _REENTRANT
+
+/* enable thread safety */
+#undef _SGI_MP_SOURCE
+
+/* enable thread safety */
+#undef _THREADSAFE
+
+/* enable thread safety */
+#undef _THREAD_SAFE
+
+/* Define to 500 only on HP-UX. */
+#undef _XOPEN_SOURCE
+
+/* Are we _special_? */
+#undef __APPLE_USE_RFC_3542
+
+/* Define to 1 if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* deviant */
+#undef adjtimex
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
+#undef intmax_t
+
+/* deviant */
+#undef ntp_adjtime
+
+/* deviant */
+#undef ntp_gettime
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+
+ #if !defined(_KERNEL) && !defined(PARSESTREAM)
+ /*
+ * stdio.h must be included after _GNU_SOURCE is defined
+ * but before #define snprintf rpl_snprintf
+ */
+ # include <stdio.h>
+ #endif
+
+
+/* Define to rpl_snprintf if the replacement function should be used. */
+#undef snprintf
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
+#undef uintmax_t
+
+/* Define to the type of an unsigned integer type wide enough to hold a
+ pointer, if such a type exists, and if the system does not define it. */
+#undef uintptr_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
+
+/* Define to rpl_vsnprintf if the replacement function should be used. */
+#undef vsnprintf
+
+
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+
+
+
+ #if !defined(_KERNEL) && !defined(PARSESTREAM)
+ # if defined(HW_WANT_RPL_VSNPRINTF)
+ # if defined(__cplusplus)
+ extern "C" {
+ # endif
+ # include <stdarg.h>
+ int rpl_vsnprintf(char *, size_t, const char *, va_list);
+ # if defined(__cplusplus)
+ }
+ # endif
+ # endif
+ # if defined(HW_WANT_RPL_SNPRINTF)
+ # if defined(__cplusplus)
+ extern "C" {
+ # endif
+ int rpl_snprintf(char *, size_t, const char *, ...);
+ # if defined(__cplusplus)
+ }
+ # endif
+ # endif
+ #endif /* !defined(_KERNEL) && !defined(PARSESTREAM) */
+
diff --git a/configure b/configure
new file mode 100755
index 0000000..041a51e
--- /dev/null
+++ b/configure
@@ -0,0 +1,39034 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for ntp4 4.2.7p482.
+#
+# Report bugs to <http://bugs.ntp.org./>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: http://bugs.ntp.org./ about your system, including any
+$0: error possibly output before this message. Then install
+$0: a modern shell, or manually run the script under such a
+$0: shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='ntp4'
+PACKAGE_TARNAME='ntp4'
+PACKAGE_VERSION='4.2.7p482'
+PACKAGE_STRING='ntp4 4.2.7p482'
+PACKAGE_BUGREPORT='http://bugs.ntp.org./'
+PACKAGE_URL='http://www.ntp.org./'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+enable_option_checking=no
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+subdirs
+PERLLIBDIR
+NTP_KEYSDIR
+GTEST_AVAILABLE_FALSE
+GTEST_AVAILABLE_TRUE
+GTEST_CPPFLAGS
+GTEST_CXXFLAGS
+GTEST_LIBS
+GTEST_LDFLAGS
+GTEST_CONFIG
+SAVECONFIG_ENABLED_FALSE
+SAVECONFIG_ENABLED_TRUE
+LSCF
+MAKE_NTPSNMPD
+SNMP_CFLAGS
+SNMP_CPPFLAGS
+SNMP_LIBS
+BUILD_SNTP_FALSE
+BUILD_SNTP_TRUE
+SNTP
+MAKE_NTPDSIM
+MAKE_LIBNTPSIM
+MAKE_TIMETRIM
+MAKE_TICKADJ
+MAKE_NTPTIME
+MAKE_ADJTIMED
+CHUTEST
+PROPDELAY
+MAKE_PARSEKMODULE
+DCFD
+TESTDCF
+MAKE_CHECK_LAYOUT
+VER_SUFFIX
+PKG_CONFIG
+MAKE_CHECK_Y2K
+MAKE_LIBPARSE_KERNEL
+MAKE_LIBPARSE
+LIBPARSE
+HAVE_RLIMIT_STACK
+HAVE_RLIMIT_MEMLOCK
+LDADD_NLIST
+PATH_NET_SNMP_CONFIG
+CONFIG_SHELL
+PATH_TEST
+PATH_PERL
+LIBOBJS
+PTHREADS_FALSE
+PTHREADS_TRUE
+LIBISC_PTHREADS_NOTHREADS
+PTHREAD_LIBS
+HAVE_INLINE
+ALLOCA
+LIBM
+EDITLINE_LIBS
+LDADD_LIBNTP
+NTP_CROSSCOMPILE_FALSE
+NTP_CROSSCOMPILE_TRUE
+LIBOPTS_DIR
+LIBOPTS_CFLAGS
+LIBOPTS_LDADD
+NEED_LIBOPTS_FALSE
+NEED_LIBOPTS_TRUE
+INSTALL_LIBOPTS_FALSE
+INSTALL_LIBOPTS_TRUE
+POSIX_SHELL
+GL_GENERATE_STDNORETURN_H_FALSE
+GL_GENERATE_STDNORETURN_H_TRUE
+STDNORETURN_H
+LIBTOOL_DEPS
+CXXCPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+TIMETRIM_NI
+TIMETRIM_MS
+TIMETRIM_DS
+TIMETRIM_DL
+TIMETRIM_DB
+TICKADJ_NI
+TICKADJ_MS
+TICKADJ_DS
+TICKADJ_DL
+TICKADJ_DB
+SNTP_NI
+SNTP_MS
+SNTP_DS
+SNTP_DL
+SNTP_DB
+NTP_WAIT_NI
+NTP_WAIT_MS
+NTP_WAIT_DS
+NTP_WAIT_DL
+NTP_WAIT_DB
+NTP_KEYGEN_NI
+NTP_KEYGEN_MS
+NTP_KEYGEN_DS
+NTP_KEYGEN_DL
+NTP_KEYGEN_DB
+NTPTRACE_NI
+NTPTRACE_MS
+NTPTRACE_DS
+NTPTRACE_DL
+NTPTRACE_DB
+NTPTIME_NI
+NTPTIME_MS
+NTPTIME_DS
+NTPTIME_DL
+NTPTIME_DB
+INSTALL_NTPSWEEP_FALSE
+INSTALL_NTPSWEEP_TRUE
+NTPSWEEP_NI
+NTPSWEEP_MS
+NTPSWEEP_DS
+NTPSWEEP_DL
+NTPSWEEP_DB
+NTPSNMPD_NI
+NTPSNMPD_MS
+NTPSNMPD_DS
+NTPSNMPD_DL
+NTPSNMPD_DB
+NTPQ_NI
+NTPQ_MS
+NTPQ_DS
+NTPQ_DL
+NTPQ_DB
+NTPD_NI
+NTPD_MS
+NTPD_DS
+NTPD_DL
+NTPD_DB
+NTPDSIM_NI
+NTPDSIM_MS
+NTPDSIM_DS
+NTPDSIM_DL
+NTPDSIM_DB
+NTPDC_NI
+NTPDC_MS
+NTPDC_DS
+NTPDC_DL
+NTPDC_DB
+NTPDATE_NI
+NTPDATE_MS
+NTPDATE_DS
+NTPDATE_DL
+NTPDATE_DB
+MANTAGFMT
+CALC_TICKADJ_NI
+CALC_TICKADJ_MS
+CALC_TICKADJ_DS
+CALC_TICKADJ_DL
+CALC_TICKADJ_DB
+WANT_CALC_TICKADJ_MS_FALSE
+WANT_CALC_TICKADJ_MS_TRUE
+VPATH_HACK_FALSE
+VPATH_HACK_TRUE
+YFLAGS
+YACC
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+LDFLAGS_NTP
+LDADD_NTP
+CPPFLAGS_NTP
+CFLAGS_NTP
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files='calc_tickadj_opts
+ntp_wait_opts
+ntpsweep_opts
+ntptrace_opts
+summary_opts
+plot_summary_opts'
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_dependency_tracking
+with_locfile
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+enable_nls
+enable_local_libopts
+enable_libopts_install
+with_autoopts_config
+enable_local_libevent
+with_lineeditlibs
+enable_debugging
+enable_thread_support
+with_threads
+with_yielding_select
+enable_c99_snprintf
+enable_clockctl
+enable_linuxcaps
+enable_solarisprivs
+with_arlib
+with_net_snmp_config
+enable_libseccomp
+with_stack_limit
+with_memlock
+enable_debug_timing
+enable_dst_minutes
+enable_ignore_dns_errors
+enable_BANCOMM
+enable_GPSVME
+enable_all_clocks
+enable_ACTS
+enable_ARBITER
+enable_ARCRON_MSF
+enable_AS2201
+enable_ATOM
+enable_CHRONOLOG
+enable_CHU
+enable_AUDIO_CHU
+enable_DATUM
+enable_DUMBCLOCK
+enable_FG
+enable_HEATH
+enable_HOPFSERIAL
+enable_HOPFPCI
+enable_HPGPS
+enable_IRIG
+enable_JJY
+enable_JUPITER
+enable_LEITCH
+enable_LOCAL_CLOCK
+enable_MX4200
+enable_NEOCLOCK4X
+enable_NMEA
+enable_GPSD
+enable_ONCORE
+enable_PALISADE
+enable_PCF
+enable_PST
+enable_RIPENCC
+enable_SHM
+enable_SPECTRACOM
+enable_TPRO
+enable_TRUETIME
+enable_TT560
+enable_ULINK
+enable_TSYNCPCI
+enable_WWV
+enable_ZYFER
+enable_parse_clocks
+enable_COMPUTIME
+enable_DCF7000
+enable_HOPF6021
+enable_MEINBERG
+enable_RAWDCF
+enable_RCC8000
+enable_SCHMID
+enable_TRIMTAIP
+enable_TRIMTSIP
+enable_WHARTON
+enable_VARITEXT
+enable_SEL240X
+with_crypto
+with_openssl_libdir
+with_openssl_incdir
+with_rpath
+enable_autokey
+enable_kmem
+enable_accurate_adjtime
+enable_tick
+enable_tickadj
+enable_simulator
+with_sntp
+with_ntpsnmpd
+enable_slew_always
+enable_step_slew
+enable_ntpdate_step
+enable_hourly_todr_sync
+enable_kernel_fll_bug
+enable_bug1243_fix
+enable_irig_sawtooth
+enable_nist
+enable_ntp_signd
+enable_ipv6
+with_kame
+enable_getifaddrs
+enable_saveconfig
+with_gtest
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+YACC
+YFLAGS
+CXXCPP'
+ac_subdirs_all='sntp'
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures ntp4 4.2.7p482 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/ntp4]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of ntp4 4.2.7p482:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features and Packages:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --enable-silent-rules less verbose build output (undo: `make V=1')
+ --disable-silent-rules verbose build output (undo: `make V=0')
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --with-locfile=XXX os-specific or "legacy"
+ --enable-shared[=PKGS] build shared libraries [default=no]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-nls disable nls support in libopts
+ --enable-local-libopts Use the supplied libopts tearoff code
+ --enable-libopts-install
+ Install libopts with client installation
+ --with-autoopts-config specify the config-info script
+ --enable-local-libevent Force using the supplied libevent tearoff code
+ --with-lineeditlibs edit,editline (readline may be specified if desired)
+ defaults: + yes, - no, s system-specific
+ --enable-debugging + include ntpd debugging code
+ --enable-thread-support s use threads (+ if available)
+ --with-threads with threads [auto]
+ --with-yielding-select with yielding select [auto]
+ --enable-c99-snprintf s force replacement
+ --enable-clockctl s Use /dev/clockctl for non-root clock control
+ --enable-linuxcaps + Use Linux capabilities for non-root clock control
+ --enable-solarisprivs + Use Solaris privileges for non-root clock control
+ --with-arlib - deprecated, arlib not distributed
+ --with-net-snmp-config + =net-snmp-config
+ --enable-libseccomp EXPERIMENTAL: enable support for libseccomp
+ sandboxing (default is no)
+ --with-stack-limit ? =50 (200 for openbsd) 4k pages
+ --with-memlock ? =32 (megabytes)
+ --enable-debug-timing - include processing time debugging code (costs
+ performance)
+ --enable-dst-minutes =60 minutes per DST adjustment
+ --enable-ignore-dns-errors
+ - retry DNS queries on any error
+ --enable-BANCOMM - Datum/Bancomm bc635/VME interface
+ --enable-GPSVME - TrueTime GPS receiver/VME interface
+ --enable-all-clocks + include all suitable non-PARSE clocks:
+ --enable-ACTS s ACTS modem service
+ --enable-ARBITER + Arbiter 1088A/B GPS receiver
+ --enable-ARCRON-MSF + Arcron MSF receiver
+ --enable-AS2201 + Austron 2200A/2201A GPS receiver
+ --enable-ATOM s ATOM PPS interface
+ --enable-CHRONOLOG + Chrono-log K-series WWVB receiver
+ --enable-CHU + CHU modem/decoder
+ --enable-AUDIO-CHU s CHU audio/decoder
+ --enable-DATUM s Datum Programmable Time System
+ --enable-DUMBCLOCK + Dumb generic hh:mm:ss local clock
+ --enable-FG + Forum Graphic GPS
+ --enable-HEATH s Heath GC-1000 WWV/WWVH receiver
+ --enable-HOPFSERIAL + hopf serial clock device
+ --enable-HOPFPCI + hopf 6039 PCI board
+ --enable-HPGPS + HP 58503A GPS receiver
+ --enable-IRIG s IRIG audio decoder
+ --enable-JJY + JJY receiver
+ --enable-JUPITER s Rockwell Jupiter GPS receiver
+ --enable-LEITCH + Leitch CSD 5300 Master Clock System Driver
+ --enable-LOCAL-CLOCK + local clock reference
+ --enable-MX4200 s Magnavox MX4200 GPS receiver
+ --enable-NEOCLOCK4X + NeoClock4X DCF77 / TDF receiver
+ --enable-NMEA + NMEA GPS receiver
+ --enable-GPSD + GPSD JSON receiver
+ --enable-ONCORE s Motorola VP/UT Oncore GPS receiver
+ --enable-PALISADE s Palisade clock
+ --enable-PCF + Conrad parallel port radio clock
+ --enable-PST + PST/Traconex 1020 WWV/WWVH receiver
+ --enable-RIPENCC - RIPENCC specific Trimble driver
+ --enable-SHM s SHM clock attached thru shared memory
+ --enable-SPECTRACOM + Spectracom 8170/Netclock/2 WWVB receiver
+ --enable-TPRO s KSI/Odetics TPRO/S GPS receiver/IRIG interface
+ --enable-TRUETIME s Kinemetrics/TrueTime receivers
+ --enable-TT560 - TrueTime 560 IRIG-B decoder
+ --enable-ULINK + Ultralink WWVB receiver
+ --enable-TSYNCPCI s Spectracom TSYNC timing board
+ --enable-WWV s WWV Audio receiver
+ --enable-ZYFER + Zyfer GPStarplus receiver
+ --enable-parse-clocks - include all suitable PARSE clocks:
+ --enable-COMPUTIME s Diem Computime Radio Clock
+ --enable-DCF7000 s ELV/DCF7000 clock
+ --enable-HOPF6021 s HOPF 6021 clock
+ --enable-MEINBERG s Meinberg clocks
+ --enable-RAWDCF s DCF77 raw time code
+ --enable-RCC8000 s RCC 8000 clock
+ --enable-SCHMID s Schmid DCF77 clock
+ --enable-TRIMTAIP s Trimble GPS receiver/TAIP protocol
+ --enable-TRIMTSIP s Trimble GPS receiver/TSIP protocol
+ --enable-WHARTON s WHARTON 400A Series clock
+ --enable-VARITEXT s VARITEXT clock
+ --enable-SEL240X s SEL240X clock
+ --with-crypto + =openssl,libcrypto
+
+ --with-openssl-libdir + =/something/reasonable
+
+ --with-openssl-incdir + =/something/reasonable
+
+ --without-rpath s Disable auto-added -R linker paths
+
+ --enable-autokey + support NTP Autokey protocol
+ --enable-kmem s read /dev/kmem for tick and/or tickadj
+ --enable-accurate-adjtime
+ s the adjtime() call is accurate
+ --enable-tick=VALUE s force a value for 'tick'
+ --enable-tickadj=VALUE s force a value for 'tickadj'
+ --enable-simulator - build/install the NTPD simulator?
+ --without-sntp - disable building sntp and sntp/tests
+ --with-ntpsnmpd s Build ntpsnmpd MIB agent?
+ --enable-slew-always s always slew the time
+ --enable-step-slew s step and slew the time
+ --enable-ntpdate-step s if ntpdate should step the time
+ --enable-hourly-todr-sync
+ s if we should sync TODR hourly
+ --enable-kernel-fll-bug s if we should avoid a kernel FLL bug
+ --enable-bug1243-fix + use unmodified autokey session keys
+ --enable-irig-sawtooth s if we should enable the IRIG sawtooth filter
+ --enable-nist - if we should enable the NIST lockclock scheme
+ --enable-ntp-signd - Provide support for Samba's signing daemon,
+ =/var/run/ntp_signd
+ --enable-ipv6 s use IPv6?
+
+ --with-kame - =/usr/local/v6
+ --enable-getifaddrs + Enable the use of getifaddrs() [[yes|no]].
+ --enable-saveconfig + saveconfig mechanism
+ --with-gtest Use the gtest framework (Default: if it's available)
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ YACC The `Yet Another Compiler Compiler' implementation to use.
+ Defaults to the first program found out of: `bison -y', `byacc',
+ `yacc'.
+ YFLAGS The list of arguments that will be passed by default to $YACC.
+ This script will default YFLAGS to the empty string to avoid a
+ default value of `-d' given by some make applications.
+ CXXCPP C++ preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <http://bugs.ntp.org./>.
+ntp4 home page: <http://www.ntp.org./>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+ntp4 configure 4.2.7p482
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------------ ##
+## Report this to http://bugs.ntp.org./ ##
+## ------------------------------------ ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by ntp4 $as_me 4.2.7p482, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+as_fn_append ac_header_list " stdarg.h"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_aux_dir=
+for ac_dir in sntp/libevent/build-aux "$srcdir"/sntp/libevent/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in sntp/libevent/build-aux \"$srcdir\"/sntp/libevent/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+
+
+
+# Bump ntp_configure_cache_version for each change to configure.ac or
+# .m4 files which invalidates cached values from previous configure
+# runs.
+#
+# If the change affects cache variables used only by the main NTP
+# configure.ac, then only its version number should be bumped, while
+# the subdir configure.ac version numbers should be unchanged. The
+# same is true for a test/variable that is used only by one subdir
+# being changed incompatibly; only that subdir's cache version needs
+# bumping.
+#
+# If a change affects variables shared by all NTP configure scripts,
+# please bump the version numbers of each. If you are not sure, the
+# safe choice is to bump all on any cache-invalidating change.
+#
+# In order to avoid the risk of version stamp collision between -stable
+# and -dev branches, do not simply increment the version, instead use
+# the date YYYYMMDD optionally with -HHMM if there is more than one
+# bump in a day.
+
+ntp_configure_cache_version=20120806
+
+# When the cache version of config.cache and configure do not
+# match, NTP_CACHEVERSION will flush the cache.
+
+
+
+ ntp_cache_flush=1
+
+ case "$ntp_cv_main_cache_version" in
+ $ntp_configure_cache_version)
+ # same version, good
+ ntp_cache_flush=0
+ ;;
+ '')
+ # No cache, predates ntp_cv_main_cache_version, or is empty.
+ case "$cache_file" in
+ /dev/null)
+ ntp_cache_flush=0
+ ;;
+ *)
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
+ # Do not clear the cache immediately after it is created
+ # empty as it is noisy. Differentiate a newly-created
+ # config.cache from one predating the cache version
+ # mechanism by looking for the first cached variable set
+ # by Autoconf
+ case "$ac_cv_path_install" in
+ '')
+ # empty config.cache file
+ ntp_cache_flush=0
+ esac
+ ;;
+ *)
+ # Parent configure just created cache from empty,
+ # flushing would be counterproductive.
+ ntp_cache_flush=0;
+ ;;
+ esac
+ esac
+ ;;
+ *)
+ # configure cache version mismatches config.cache version
+ ;;
+ esac
+
+ case "$ntp_cache_flush" in
+ 1)
+ c_version="${ntp_cv_main_cache_version:-(no version found)}"
+
+ # Do we flush all variables or exclude others' version stamps?
+
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
+ # Clear all *_cv_* variables including our child subdirs'
+ # ntp_cv_*_cache_version variables. This prevents subdir
+ # configure scripts from noticing a version mismatch just
+ # after the top configure in the invocation cleared and
+ # recreated the cache.
+
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/_cv_/p'
+ `
+ ;;
+ *)
+ # This is not the top configure this particular invocation.
+ # Clear all *_cv_* variables sparing the version stamps
+ # of other configure scripts, so we don't trigger
+ # useless repeated clearings.
+
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/ntp_cv_.*_cache_version/d' \
+ -e '/_cv_/p'
+ `
+ esac
+
+ for c_varname in $c_varname_list
+ do
+ { eval $c_varname=; unset $c_varname; }
+ done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file saved by another version, ignored." >&5
+$as_echo "$as_me: $cache_file saved by another version, ignored." >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: configure script cache version: $ntp_configure_cache_version" >&5
+$as_echo "$as_me: configure script cache version: $ntp_configure_cache_version" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file version: $c_version" >&5
+$as_echo "$as_me: $cache_file version: $c_version" >&6;}
+ { c_varname=; unset c_varname;}
+ { c_varname_list=; unset c_varname_list;}
+ { c_version=; unset c_version;}
+ esac
+
+ { ntp_cache_flush=; unset ntp_cache_flush;}
+
+ # save configure version in config.cache for next time
+ ntp_cv_main_cache_version="$ntp_configure_cache_version"
+
+ # let any subdir configure.ac NTP_CACHEVERSION invocations
+ # know they are not the top level.
+ NTP_CACHEVERSION_PARENT='main' ; export NTP_CACHEVERSION_PARENT
+
+
+am__api_version='1.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='ntp4'
+ VERSION='4.2.7p482'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define STR_SYSTEM "$host"
+_ACEOF
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+ntp_atom_ok=${ntp_atom_ok=no}
+ntp_oncore_ok=${ntp_oncore_ok=no}
+ntp_parse_ok=${ntp_parse_ok=no}
+ntp_ripe_ncc_ok=${ntp_parse_ok=no}
+ntp_jupiter_ok=${ntp_jupiter_ok=no}
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+ MINIX=yes
+else
+ MINIX=
+fi
+
+
+ if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+ fi
+
+ case "$host_os" in
+ hpux*)
+
+$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+ ;;
+ esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+if test "x$CC" != xcc; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+ rm -f conftest2.*
+ if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+# Ralf Wildenhues: With per-target flags we need CC_C_O
+# AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if ${ac_cv_prog_gcc_traditional+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+
+
+
+CFLAGS_NTP=
+CPPFLAGS_NTP=
+LDADD_NTP=
+LDFLAGS_NTP=
+
+
+
+
+
+case "$ac_cv_prog_cc_c89" in
+ no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP
+ version 4.2.5 and higher." >&5
+$as_echo "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP
+ version 4.2.5 and higher." >&2;}
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5
+$as_echo_n "checking if $CC can handle #warning... " >&6; }
+if ${ntp_cv_cpp_warning+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#warning foo
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_cpp_warning=yes
+else
+ ntp_cv_cpp_warning=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5
+$as_echo "$ntp_cv_cpp_warning" >&6; }
+case "$ntp_cv_cpp_warning" in
+ no)
+
+$as_echo "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports __attribute__((...))" >&5
+$as_echo_n "checking if $CC supports __attribute__((...))... " >&6; }
+if ${ntp_cv_cc_attribute+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+void foo(void) __attribute__((__noreturn__));
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_cc_attribute=yes
+else
+ ntp_cv_cc_attribute=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cc_attribute" >&5
+$as_echo "$ntp_cv_cc_attribute" >&6; }
+case "$ntp_cv_cc_attribute" in
+ yes)
+
+$as_echo "#define HAVE___ATTRIBUTE__ /**/" >>confdefs.h
+
+esac
+
+
+case "$GCC" in
+ yes)
+ SAVED_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wstrict-overflow"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5
+$as_echo_n "checking if $CC can handle -Wstrict-overflow... " >&6; }
+if ${ntp_cv_gcc_Wstrict_overflow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_gcc_Wstrict_overflow=yes
+else
+ ntp_cv_gcc_Wstrict_overflow=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5
+$as_echo "$ntp_cv_gcc_Wstrict_overflow" >&6; }
+ #
+ # $ntp_cv_gcc_Wstrict_overflow is tested later to add the
+ # flag to CFLAGS.
+ #
+ CFLAGS="$SAVED_CFLAGS -Winit-self"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5
+$as_echo_n "checking if $CC can handle -Winit-self... " >&6; }
+if ${ntp_cv_gcc_Winit_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_gcc_Winit_self=yes
+else
+ ntp_cv_gcc_Winit_self=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5
+$as_echo "$ntp_cv_gcc_Winit_self" >&6; }
+ CFLAGS="$SAVED_CFLAGS"
+ { SAVED_CFLAGS=; unset SAVED_CFLAGS;}
+ #
+ # $ntp_cv_gcc_Winit_self is tested later to add the
+ # flag to CFLAGS_NTP.
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports omitting unused code and data" >&5
+$as_echo_n "checking if linker supports omitting unused code and data... " >&6; }
+if ${ntp_cv_gc_sections_runs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ origCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,--gc-sections"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <stdio.h>
+
+int
+main ()
+{
+
+ FILE * fpC;
+ char buf[32];
+ size_t cch;
+ int read_success_once;
+
+ fpC = fopen("conftest.c", "r");
+ if (NULL == fpC)
+ exit(1);
+ do {
+ cch = fread(buf, sizeof(buf), 1, fpC);
+ read_success_once |= (0 != cch);
+ } while (0 != cch);
+ if (!read_success_once)
+ exit(2);
+ if (!feof(fpC))
+ exit(3);
+ if (0 != fclose(fpC))
+ exit(4);
+
+ exit(EXIT_SUCCESS);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then
+ ntp_cv_gc_sections_runs=no
+ else
+ ntp_cv_gc_sections_runs=no
+ ./conftest >/dev/null 2>&1 && ntp_cv_gc_sections_runs=yes
+ fi
+
+else
+ ntp_cv_gc_sections_runs=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$origCFLAGS"
+ { origCFLAGS=; unset origCFLAGS;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gc_sections_runs" >&5
+$as_echo "$ntp_cv_gc_sections_runs" >&6; }
+ case "$ntp_cv_gc_sections_runs" in
+ yes)
+ LDADD_LIBNTP="-Wl,--gc-sections"
+ CFLAGS_NTP="$CFLAGS_NTP -ffunction-sections -fdata-sections"
+ ;;
+ no)
+ LDADD_LIBNTP=
+ ;;
+ esac
+ CFLAGS_NTP="$CFLAGS_NTP -Wall"
+ CFLAGS_NTP="$CFLAGS_NTP -Wcast-align"
+ CFLAGS_NTP="$CFLAGS_NTP -Wcast-qual"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wconversion"
+ # CFLAGS_NTP="$CFLAGS_NTP -Werror"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wextra"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wfloat-equal"
+ CFLAGS_NTP="$CFLAGS_NTP -Wmissing-prototypes"
+ CFLAGS_NTP="$CFLAGS_NTP -Wpointer-arith"
+ CFLAGS_NTP="$CFLAGS_NTP -Wshadow"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wtraditional"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wwrite-strings"
+ case "$ntp_cv_gcc_Winit_self" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Winit-self"
+ esac
+ case "$ntp_cv_gcc_Wstrict_overflow" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-overflow"
+ esac
+ # -W[no-]strict-prototypes might be added by NTP_OPENSSL
+esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional compiler flags" >&5
+$as_echo_n "checking additional compiler flags... " >&6; }
+ # allow ntp_os_flags to be preset to skip this stuff
+ case "${ntp_os_cflags+set}" in
+ set)
+ ;;
+ *)
+ ntp_os_cflags=
+ case "$host_os" in
+ aix[1-3]*)
+ ;;
+ aix4.[0-2]*)
+ # turn on additional headers
+ ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
+ ;;
+ aix5.3*)
+ # avoid circular dependencies in yp headers, and more
+ ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
+ ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT"
+ ;;
+ aix*)
+ # XXX Only verified thru AIX6.
+ # aix7 seems to need a different XOPEN_SOURCE_EXTENDED thing.
+ # avoid circular dependencies in yp headers
+ # _XOPEN_SOURCE=500 = X/Open 5: POSIX 1995
+ # _XOPEN_SOURCE=600 = X/Open 6: POSIX 2004
+ # _XOPEN_SOURCE=700 = X/Open 7: POSIX 2008
+ ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_SOURCE=600"
+ ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS"
+ ;;
+ amigaos)
+ ntp_os_cflags="-DSYS_AMIGA"
+ ;;
+ darwin*|macosx*|rhapsody*)
+ ntp_os_cflags="-D_P1003_1B_VISIBLE"
+ ;;
+ hpux10.*) # at least for hppa2.0-hp-hpux10.20
+ case "$GCC" in
+ yes)
+ ;;
+ *)
+ # use Ansi compiler on HPUX, and some -Wp magic
+ ntp_os_cflags="-Ae -Wp,-H18816"
+ ;;
+ esac
+ ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
+ ;;
+ hpux*)
+ case "$GCC" in
+ yes)
+ ;;
+ *)
+ # use Ansi compiler on HPUX
+ ntp_os_cflags="-Ae"
+ esac
+ ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
+ ;;
+ irix6*)
+ case "$CC" in
+ cc)
+ # do not use 64-bit compiler
+ ntp_os_cflags="-n32 -mips3 -Wl,-woff,84"
+ esac
+ ;;
+ nextstep3)
+ ntp_os_cflags="-posix"
+ ;;
+ solaris1*|solaris2.[0-5]|solaris2.5.*)
+ ;;
+ sunos[34]*|sunos5.[0-5]|sunos5.5.*)
+ ;;
+ solaris2*|sunos5*)
+ # turn on 64-bit file offset interface
+ ntp_os_cflags="-D_LARGEFILE64_SOURCE"
+ ;;
+ vxworks*)
+ case "$build" in
+ $host)
+ ;;
+ *)
+ # Quick and dirty sanity check
+ case "$VX_KERNEL" in
+ '')
+ as_fn_error $? "See html/build/hints/vxworks.html" "$LINENO" 5
+ esac
+ ntp_os_cflags="-DSYS_VXWORKS"
+ esac
+ ;;
+ esac
+ esac
+ case "$ntp_os_flags" in
+ '')
+ ntp_os_cflags_msg="none needed"
+ ;;
+ *)
+ ntp_os_cflags_msg="$ntp_os_cflags"
+ esac
+ CFLAGS_NTP="$CFLAGS_NTP $ntp_os_cflags"
+ { $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 whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
+$as_echo_n "checking for working volatile... " >&6; }
+if ${ac_cv_c_volatile+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+volatile int x;
+int * volatile y = (int *) 0;
+return !x && !y;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_volatile=yes
+else
+ ac_cv_c_volatile=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
+$as_echo "$ac_cv_c_volatile" >&6; }
+if test $ac_cv_c_volatile = no; then
+
+$as_echo "#define volatile /**/" >>confdefs.h
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+else
+ CXXFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+for ac_prog in 'bison -y' byacc
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_YACC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$YACC"; then
+ ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_YACC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5
+$as_echo "$YACC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+if test "x$CC" != xcc; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+ rm -f conftest2.*
+ if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if we need ylwrap VPATH hack" >&5
+$as_echo_n "checking to see if we need ylwrap VPATH hack... " >&6; }
+ntp_vpath_hack="no"
+case "$srcdir::${force_ntp_vpath_hack-no}" in
+ .::*)
+ ;; # VPATH_HACK path is for VPATH builds only.
+ *::yes)
+ ntp_vpath_hack="yes"
+ ;;
+ *::*)
+ case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in
+ '')
+ ntp_vpath_hack="yes"
+ esac
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_vpath_hack" >&5
+$as_echo "$ntp_vpath_hack" >&6; }
+ if test x$ntp_vpath_hack = xyes; then
+ VPATH_HACK_TRUE=
+ VPATH_HACK_FALSE='#'
+else
+ VPATH_HACK_TRUE='#'
+ VPATH_HACK_FALSE=
+fi
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install dir and man conventions" >&5
+$as_echo_n "checking for install dir and man conventions... " >&6; }
+
+
+# Check whether --with-locfile was given.
+if test "${with_locfile+set}" = set; then :
+ withval=$with_locfile;
+else
+ with_locfile=no
+
+fi
+
+
+( \
+ SENTINEL_DIR="$PWD" && \
+ cd $srcdir/sntp && \
+ case "$with_locfile" in \
+ yes|no|'') \
+ scripts/genLocInfo -d "$SENTINEL_DIR" \
+ ;; \
+ *) \
+ scripts/genLocInfo -d "$SENTINEL_DIR" -f "$with_locfile" \
+ ;; \
+ esac \
+) > genLocInfo.i 2> genLocInfo.err
+. ./genLocInfo.i
+
+case "$GENLOCINFO" in
+ OK)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: in file $GENLOCINFOFILE" >&5
+$as_echo "in file $GENLOCINFOFILE" >&6; }
+ rm genLocInfo.err genLocInfo.i
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed." >&5
+$as_echo "failed." >&6; }
+ as_fn_error $? "Problem with genLocInfo!" "$LINENO" 5
+ ;;
+esac
+
+ if test "$CALC_TICKADJ_MS" ; then
+ WANT_CALC_TICKADJ_MS_TRUE=
+ WANT_CALC_TICKADJ_MS_FALSE='#'
+else
+ WANT_CALC_TICKADJ_MS_TRUE='#'
+ WANT_CALC_TICKADJ_MS_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test -z "$NTPSWEEP_NI" ; then
+ INSTALL_NTPSWEEP_TRUE=
+ INSTALL_NTPSWEEP_FALSE='#'
+else
+ INSTALL_NTPSWEEP_TRUE='#'
+ INSTALL_NTPSWEEP_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# So far, the only shared library we might use is libopts.
+# It's a small library - we might as well use a static version of it.
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=no
+fi
+
+
+
+
+
+
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4'
+macro_revision='1.3293'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ lt_prog_compiler_pic='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+ _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+ # save warnings/boilerplate of simple test code
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ compiler_CXX=$CC
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+ else
+ lt_prog_compiler_no_builtin_flag_CXX=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ ld_shlibs_CXX=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ file_list_spec_CXX='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec_CXX='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ fi
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX=' '
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=yes
+ file_list_spec_CXX='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+ enable_shared_with_static_runtimes_CXX=yes
+ # Don't use ranlib
+ old_postinstall_cmds_CXX='chmod 644 $oldlib'
+ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec_CXX=''
+ fi
+ link_all_deplibs_CXX=yes
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+
+ else
+ ld_shlibs_CXX=no
+ fi
+
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs_CXX=yes
+ ;;
+
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ inherit_rpath_CXX=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+ prelink_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ old_archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_CXX=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ ld_shlibs_CXX=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ hardcode_direct_absolute_CXX=yes
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ ;;
+ esac
+
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+ '"$old_archive_cmds_CXX"
+ reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+ '"$reload_cmds_CXX"
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+ test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+ GCC_CXX="$GXX"
+ LD_CXX="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ ;;
+ esac
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc_CXX=no
+ else
+ lt_cv_archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+ archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+ test -n "$runpath_var_CXX" ||
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+ test "$inherit_rpath_CXX" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+# NTP has (so far) been relying on leading-edge autogen, which
+# means we need the appropriate corresponding libopts as well.
+# Therefore, by default:
+# - use the version of libopts we ship with
+# - do not install it
+# - build a static copy (AC_DISABLE_SHARED - done earlier)
+case "${enable_local_libopts+set}" in
+ set) ;;
+ *) enable_local_libopts=yes ;;
+esac
+case "${enable_libopts_install+set}" in
+ set) ;;
+ *) enable_libopts_install=no ;;
+esac
+enable_nls=no
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+
+
+ ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_ac_Header=yes"
+else
+ eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+
+ # =================
+ # AC_CHECK_HEADERS
+ # =================
+ for ac_header in \
+ sys/mman.h sys/param.h sys/poll.h sys/procset.h \
+ sys/select.h sys/socket.h sys/stropts.h sys/time.h \
+ sys/un.h sys/wait.h dlfcn.h errno.h \
+ fcntl.h libgen.h libintl.h memory.h \
+ netinet/in.h setjmp.h stdbool.h sysexits.h \
+ unistd.h utime.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ for ac_header in stdarg.h varargs.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_arg_hdr=true;break
+else
+ lo_have_arg_hdr=false
+fi
+
+done
+
+
+ for ac_header in string.h strings.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_str_hdr=true;break
+else
+ lo_have_str_hdr=false
+fi
+
+done
+
+
+ for ac_header in limits.h sys/limits.h values.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_lim_hdr=true;break
+else
+ lo_have_lim_hdr=false
+fi
+
+done
+
+
+ for ac_header in inttypes.h stdint.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_typ_hdr=true;break
+else
+ lo_have_typ_hdr=false
+fi
+
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdnoreturn.h" >&5
+$as_echo_n "checking for working stdnoreturn.h... " >&6; }
+if ${gl_cv_header_working_stdnoreturn_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #include <stdnoreturn.h>
+ /* Do not check for 'noreturn' after the return type.
+ C11 allows it, but it's rarely done that way
+ and circa-2012 bleeding-edge GCC rejects it when given
+ -Werror=old-style-declaration. */
+ noreturn void foo1 (void) { exit (0); }
+ _Noreturn void foo2 (void) { exit (0); }
+ int testit (int argc, char **argv) {
+ if (argc & 1)
+ return 0;
+ (argv[0][0] ? foo1 : foo2) ();
+ }
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_working_stdnoreturn_h=yes
+else
+ gl_cv_header_working_stdnoreturn_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdnoreturn_h" >&5
+$as_echo "$gl_cv_header_working_stdnoreturn_h" >&6; }
+
+ if test $gl_cv_header_working_stdnoreturn_h = yes; then
+ STDNORETURN_H=''
+ else
+ STDNORETURN_H='stdnoreturn.h'
+ fi
+
+
+ if test -n "$STDNORETURN_H"; then
+ GL_GENERATE_STDNORETURN_H_TRUE=
+ GL_GENERATE_STDNORETURN_H_FALSE='#'
+else
+ GL_GENERATE_STDNORETURN_H_TRUE='#'
+ GL_GENERATE_STDNORETURN_H_FALSE=
+fi
+
+
+
+ # ----------------------------------------------------------------------
+ # check for various programs used during the build.
+ # On OS/X, "wchar.h" needs "runetype.h" to work properly.
+ # ----------------------------------------------------------------------
+ for ac_header in runetype.h wchar.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+ $ac_includes_default
+ #if HAVE_RUNETYPE_H
+ # include <runetype.h>
+ #endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ # Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then :
+ enableval=$enable_nls;
+fi
+
+ if test "x$enable_nls" != "xno" && \
+ test "X${ac_cv_header_libintl_h}" = Xyes; then :
+
+
+$as_echo "#define ENABLE_NLS 1" >>confdefs.h
+
+fi
+
+ # --------------------------------------------
+ # Verify certain entries from AC_CHECK_HEADERS
+ # --------------------------------------------
+ ${lo_have_arg_hdr} || \
+ as_fn_error $? "you must have stdarg.h or varargs.h on your system" "$LINENO" 5
+
+ ${lo_have_str_hdr} || \
+ as_fn_error $? "you must have string.h or strings.h on your system" "$LINENO" 5
+
+ ${lo_have_lim_hdr} || \
+ as_fn_error $? "you must have one of limits.h, sys/limits.h or values.h" "$LINENO" 5
+
+ ${lo_have_typ_hdr} || \
+ as_fn_error $? "you must have inttypes.h or stdint.h on your system" "$LINENO" 5
+
+ for f in sys_types sys_param sys_stat string errno stdlib memory setjmp
+ do eval as_ac_var=\${ac_cv_header_${f}_h}
+ test "X${as_ac_var}" = Xyes || {
+ as_fn_error $? "you must have ${f}.h on your system" "$LINENO" 5
+ }
+ done
+ test "X${ac_cv_header_inttypes_h-no}" = Xyes || \
+ echo '#include <stdint.h>' > inttypes.h
+
+ # ----------------------------------------------------------------------
+ # Checks for typedefs
+ # ----------------------------------------------------------------------
+ ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default"
+if test "x$ac_cv_type_wchar_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WCHAR_T 1
+_ACEOF
+
+
+fi
+
+ ac_fn_c_check_type "$LINENO" "wint_t" "ac_cv_type_wint_t" "
+ $ac_includes_default
+ #if HAVE_RUNETYPE_H
+ # include <runetype.h>
+ #endif
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+"
+if test "x$ac_cv_type_wint_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WINT_T 1
+_ACEOF
+
+
+fi
+
+ ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default"
+if test "x$ac_cv_type_int8_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT8_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint8_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT8_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default"
+if test "x$ac_cv_type_int16_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT16_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint16_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT16_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default"
+if test "x$ac_cv_type_int32_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT32_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint32_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT32_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_intptr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTPTR_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PID_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SIZE_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char*" >&5
+$as_echo_n "checking size of char*... " >&6; }
+if ${ac_cv_sizeof_charp+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char*))" "ac_cv_sizeof_charp" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_charp" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (char*)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_charp=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_charp" >&5
+$as_echo "$ac_cv_sizeof_charp" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHARP $ac_cv_sizeof_charp
+_ACEOF
+
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+
+ # ------------
+ # AC_CHECK_LIB
+ # ------------
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5
+$as_echo_n "checking for pathfind in -lgen... " >&6; }
+if ${ac_cv_lib_gen_pathfind+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgen $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pathfind ();
+int
+main ()
+{
+return pathfind ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_gen_pathfind=yes
+else
+ ac_cv_lib_gen_pathfind=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_pathfind" >&5
+$as_echo "$ac_cv_lib_gen_pathfind" >&6; }
+if test "x$ac_cv_lib_gen_pathfind" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEN 1
+_ACEOF
+
+ LIBS="-lgen $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5
+$as_echo_n "checking for gettext in -lintl... " >&6; }
+if ${ac_cv_lib_intl_gettext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl $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 gettext ();
+int
+main ()
+{
+return gettext ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_intl_gettext=yes
+else
+ ac_cv_lib_intl_gettext=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_intl_gettext" >&5
+$as_echo "$ac_cv_lib_intl_gettext" >&6; }
+if test "x$ac_cv_lib_intl_gettext" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBINTL 1
+_ACEOF
+
+ LIBS="-lintl $LIBS"
+
+fi
+
+ for ac_func in vprintf
+do :
+ ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
+if test "x$ac_cv_func_vprintf" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VPRINTF 1
+_ACEOF
+
+ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
+if test "x$ac_cv_func__doprnt" = xyes; then :
+
+$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+
+fi
+
+fi
+done
+
+
+ for ac_header in vfork.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
+if test "x$ac_cv_header_vfork_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VFORK_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in fork vfork
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test "x$ac_cv_func_fork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
+$as_echo_n "checking for working fork... " >&6; }
+if ${ac_cv_func_fork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_fork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* By Ruediger Kuhlmann. */
+ return fork () < 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_fork_works=yes
+else
+ ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
+$as_echo "$ac_cv_func_fork_works" >&6; }
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
+$as_echo_n "checking for working vfork... " >&6; }
+if ${ac_cv_func_vfork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_vfork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Thanks to Paul Eggert for this test. */
+$ac_includes_default
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+
+int
+main ()
+{
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test (0);
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ return (
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_vfork_works=yes
+else
+ ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
+$as_echo "$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=$ac_cv_func_vfork
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+$as_echo "#define vfork fork" >>confdefs.h
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+ for ac_func in mmap canonicalize_file_name snprintf strdup strchr \
+ strrchr strsignal fchmod fstat chmod
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+ while :
+ do
+ POSIX_SHELL=`which bash`
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=`which dash`
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=/usr/xpg4/bin/sh
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=`/bin/sh -c '
+ exec 2>/dev/null
+ if ! true ; then exit 1 ; fi
+ echo /bin/sh'`
+ test -x "$POSIX_SHELL" && break
+ as_fn_error $? "cannot locate a working POSIX shell" "$LINENO" 5
+ done
+
+cat >>confdefs.h <<_ACEOF
+#define POSIX_SHELL "${POSIX_SHELL}"
+_ACEOF
+
+
+
+
+
+ LIBOPTS_BUILD_BLOCKED=true
+
+
+ NEED_LIBOPTS_DIR=''
+
+ # Check whether --enable-local-libopts was given.
+if test "${enable_local_libopts+set}" = set; then :
+ enableval=$enable_local_libopts;
+ if test x$enableval = xyes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5
+$as_echo "$as_me: Using supplied libopts tearoff" >&6;}
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts'
+ NEED_LIBOPTS_DIR=true
+ LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la'
+ fi
+fi
+
+
+ # Check whether --enable-libopts-install was given.
+if test "${enable_libopts_install+set}" = set; then :
+ enableval=$enable_libopts_install;
+fi
+
+ if test "X${enable_libopts_install}" = Xyes; then
+ INSTALL_LIBOPTS_TRUE=
+ INSTALL_LIBOPTS_FALSE='#'
+else
+ INSTALL_LIBOPTS_TRUE='#'
+ INSTALL_LIBOPTS_FALSE=
+fi
+
+
+ if test -z "${NEED_LIBOPTS_DIR}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5
+$as_echo_n "checking whether autoopts-config can be found... " >&6; }
+
+# Check whether --with-autoopts-config was given.
+if test "${with_autoopts_config+set}" = set; then :
+ withval=$with_autoopts_config; lo_cv_with_autoopts_config=${with_autoopts_config}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5
+$as_echo_n "checking whether autoopts-config is specified... " >&6; }
+if ${lo_cv_with_autoopts_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if autoopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=autoopts-config
+ elif libopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=libopts-config
+ else lo_cv_with_autoopts_config=no ; fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5
+$as_echo "$lo_cv_with_autoopts_config" >&6; }
+
+fi
+ # end of AC_ARG_WITH
+
+ if ${lo_cv_test_autoopts+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test -z "${lo_cv_with_autoopts_config}" \
+ -o X"${lo_cv_with_autoopts_config}" = Xno
+ then
+ if autoopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=autoopts-config
+ elif libopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=libopts-config
+ else lo_cv_with_autoopts_config=false ; fi
+ fi
+ lo_cv_test_autoopts=`
+ ${lo_cv_with_autoopts_config} --libs` 2> /dev/null
+ if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
+ then lo_cv_test_autoopts=no ; fi
+
+fi
+ # end of CACHE_VAL
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5
+$as_echo "${lo_cv_test_autoopts}" >&6; }
+
+ if test "X${lo_cv_test_autoopts}" != Xno
+ then
+ LIBOPTS_LDADD="${lo_cv_test_autoopts}"
+ LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`"
+ else
+ LIBOPTS_LDADD='$(top_builddir)/sntp/libopts/libopts.la'
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/sntp/libopts'
+ NEED_LIBOPTS_DIR=true
+ fi
+ fi # end of if test -z "${NEED_LIBOPTS_DIR}"
+ if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then
+ NEED_LIBOPTS_DIR=''
+ fi
+ if test -n "${NEED_LIBOPTS_DIR}"; then
+ NEED_LIBOPTS_TRUE=
+ NEED_LIBOPTS_FALSE='#'
+else
+ NEED_LIBOPTS_TRUE='#'
+ NEED_LIBOPTS_FALSE=
+fi
+
+
+
+ LIBOPTS_DIR=sntp/libopts
+
+
+# end of AC_DEFUN of LIBOPTS_CHECK_COMMON
+
+ # end of AC_DEFUN of LIBOPTS_CHECK_NOBUILD
+
+
+
+
+# Check whether --enable-local-libevent was given.
+if test "${enable_local_libevent+set}" = set; then :
+ enableval=$enable_local_libevent; ntp_use_local_libevent=$enableval
+else
+ ntp_use_local_libevent=${ntp_use_local_libevent-detect}
+
+fi
+
+
+
+
+
+
+# Expose a cross-compilation indicator to makefiles
+ if test $build != $host; then
+ NTP_CROSSCOMPILE_TRUE=
+ NTP_CROSSCOMPILE_FALSE='#'
+else
+ NTP_CROSSCOMPILE_TRUE='#'
+ NTP_CROSSCOMPILE_FALSE=
+fi
+
+
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+ # Check whether --enable-c99-snprintf was given.
+if test "${enable_c99_snprintf+set}" = set; then :
+ enableval=$enable_c99_snprintf; force_c99_snprintf=$enableval
+else
+ force_c99_snprintf=no
+
+fi
+
+ case "$force_c99_snprintf" in
+ yes)
+ hw_force_rpl_snprintf=yes
+ hw_force_rpl_vsnprintf=yes
+ esac
+
+
+
+
+
+
+ for ac_header in $ac_header_list
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+ ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
+if test "x$ac_cv_func_vsnprintf" = xyes; then :
+ hw_cv_func_vsnprintf=yes
+else
+ hw_cv_func_vsnprintf=no
+fi
+
+ if test "$hw_cv_func_vsnprintf" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf is C99 compliant" >&5
+$as_echo_n "checking whether vsnprintf is C99 compliant... " >&6; }
+if ${hw_cv_func_vsnprintf_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ hw_cv_func_vsnprintf_c99=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_STDARG_H
+ #include <stdarg.h>
+ #endif
+ #include <stdio.h>
+ static int testprintf(char *buf, size_t size, const char *format, ...)
+ {
+ int result;
+ va_list ap;
+ va_start(ap, format);
+ result = vsnprintf(buf, size, format, ap);
+ va_end(ap);
+ return result;
+ }
+int
+main ()
+{
+char buf[43];
+ if (testprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+ testprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+ buf[0] != 'T' || buf[3] != '\0')
+ return 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ hw_cv_func_vsnprintf_c99=yes
+else
+ hw_cv_func_vsnprintf_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_vsnprintf_c99" >&5
+$as_echo "$hw_cv_func_vsnprintf_c99" >&6; }
+else
+ hw_cv_func_vsnprintf_c99=no
+fi
+
+$as_echo "#define HAVE_VSNPRINTF 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement vsnprintf will be used" >&5
+$as_echo_n "checking if C99-snprintf replacement vsnprintf will be used... " >&6; }
+ if test "${hw_force_rpl_vsnprintf=no}" = yes -o "$hw_cv_func_vsnprintf_c99" = no; then :
+ hw_use_rpl_vsnprintf=yes
+else
+ hw_use_rpl_vsnprintf=no
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_vsnprintf" >&5
+$as_echo "$hw_use_rpl_vsnprintf" >&6; }
+ if test "$hw_use_rpl_vsnprintf" = yes; then :
+
+$as_echo "#define HW_WANT_RPL_VSNPRINTF 1" >>confdefs.h
+
+ if test ${hw_nodef_vsnprintf=no} = no; then :
+
+$as_echo "#define vsnprintf rpl_vsnprintf" >>confdefs.h
+
+fi
+ for ac_header in inttypes.h locale.h stddef.h stdint.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
+"
+if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct lconv" "thousands_sep" "ac_cv_member_struct_lconv_thousands_sep" "#include <locale.h>
+"
+if test "x$ac_cv_member_struct_lconv_thousands_sep" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LCONV_THOUSANDS_SEP 1
+_ACEOF
+
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
+$as_echo_n "checking for long double... " >&6; }
+if ${ac_cv_type_long_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$GCC" = yes; then
+ ac_cv_type_long_double=yes
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* The Stardent Vistra knows sizeof (long double), but does
+ not support it. */
+ long double foo = 0.0L;
+int
+main ()
+{
+static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
+ sizeof (double) <= sizeof (long double))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_long_double=yes
+else
+ ac_cv_type_long_double=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5
+$as_echo "$ac_cv_type_long_double" >&6; }
+ if test $ac_cv_type_long_double = yes; then
+
+$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if ${ac_cv_type_long_long_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if test "$cross_compiling" = yes; then :
+ ac_cv_type_long_long_int=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ #ifndef LLONG_MAX
+ # define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ # define LLONG_MAX (HALF - 1 + HALF)
+ #endif
+int
+main ()
+{
+long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_type_long_long_int=yes
+else
+ ac_cv_type_long_long_int=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+else
+ ac_cv_type_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
+$as_echo "$ac_cv_type_long_long_int" >&6; }
+ if test $ac_cv_type_long_long_int = yes; then
+
+$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if ${ac_cv_type_unsigned_long_long_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_type_unsigned_long_long_int=yes
+else
+ ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default"
+if test "x$ac_cv_type_intmax_t" = xyes; then :
+
+$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
+
+else
+ test $ac_cv_type_long_long_int = yes \
+ && ac_type='long long int' \
+ || ac_type='long int'
+
+cat >>confdefs.h <<_ACEOF
+#define intmax_t $ac_type
+_ACEOF
+
+fi
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintmax_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h
+
+else
+ test $ac_cv_type_unsigned_long_long_int = yes \
+ && ac_type='unsigned long long int' \
+ || ac_type='unsigned long int'
+
+cat >>confdefs.h <<_ACEOF
+#define uintmax_t $ac_type
+_ACEOF
+
+fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
+else
+ for ac_type in 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
+fi
+
+
+ ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+ for ac_func in localeconv
+do :
+ ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv"
+if test "x$ac_cv_func_localeconv" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LOCALECONV 1
+_ACEOF
+
+fi
+done
+
+
+ if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+
+
+
+ case " $LIBOBJS " in
+ *" snprintf.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
+ ;;
+esac
+
+ _hw_cv_func_xprintf_replace_done=yes
+fi
+
+fi
+
+
+ ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
+if test "x$ac_cv_func_snprintf" = xyes; then :
+ hw_cv_func_snprintf=yes
+else
+ hw_cv_func_snprintf=no
+fi
+
+ if test "$hw_cv_func_snprintf" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf is C99 compliant" >&5
+$as_echo_n "checking whether snprintf is C99 compliant... " >&6; }
+if ${hw_cv_func_snprintf_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ hw_cv_func_snprintf_c99=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+char buf[43];
+ if (snprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+ snprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+ buf[0] != 'T' || buf[3] != '\0')
+ return 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ hw_cv_func_snprintf_c99=yes
+else
+ hw_cv_func_snprintf_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_snprintf_c99" >&5
+$as_echo "$hw_cv_func_snprintf_c99" >&6; }
+else
+ hw_cv_func_snprintf_c99=no
+fi
+
+$as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement snprintf will be used" >&5
+$as_echo_n "checking if C99-snprintf replacement snprintf will be used... " >&6; }
+ if test "${hw_force_rpl_snprintf=no}" = yes -o "$hw_cv_func_snprintf_c99" = no; then :
+ hw_use_rpl_snprintf=yes
+else
+ hw_use_rpl_snprintf=no
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_snprintf" >&5
+$as_echo "$hw_use_rpl_snprintf" >&6; }
+ if test "$hw_use_rpl_snprintf" = yes; then :
+
+$as_echo "#define HW_WANT_RPL_SNPRINTF 1" >>confdefs.h
+
+ if test ${hw_nodef_snprintf=no} = no; then :
+
+$as_echo "#define snprintf rpl_snprintf" >>confdefs.h
+
+fi
+
+ if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+
+
+
+ case " $LIBOBJS " in
+ *" snprintf.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
+ ;;
+esac
+
+ _hw_cv_func_xprintf_replace_done=yes
+fi
+
+fi
+
+
+
+
+
+# HMS: Save $LIBS and empty it.
+# any LIBS we add here should go in to LDADD_LIBNTP
+
+__LIBS=$LIBS
+LIBS=
+
+
+
+# [Bug 2332] because we need to know if we are using GNU ld...
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5
+$as_echo_n "checking for directory path separator... " >&6; }
+if ${ntp_cv_dir_sep+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$ntp_cv_dir_sep" in
+ '')
+ case "$host_os" in
+ *djgpp | *mingw32* | *emx*)
+ ntp_cv_dir_sep="'\\'"
+ ;;
+ *)
+ ntp_cv_dir_sep="'/'"
+ ;;
+ esac
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5
+$as_echo "$ntp_cv_dir_sep" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DIR_SEP $ntp_cv_dir_sep
+_ACEOF
+
+
+
+ NTP_ORIG_LIBS="$LIBS"
+
+# Check whether --with-lineeditlibs was given.
+if test "${with_lineeditlibs+set}" = set; then :
+ withval=$with_lineeditlibs; use_lineeditlibs="$withval"
+else
+ use_lineeditlibs="edit,editline"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking line editing libraries" >&5
+$as_echo_n "checking line editing libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_lineeditlibs" >&5
+$as_echo "$use_lineeditlibs" >&6; }
+ case "$use_lineeditlibs" in
+ no)
+ ntp_lib_lineedit=no
+ ;;
+ *)
+ for lineedit_lib in `echo $use_lineeditlibs | sed -e 's/,/ /'`; do
+ for term_lib in "" termcap curses ncurses; do
+ case "$term_lib" in
+ '')
+ TRY_LIB="-l$lineedit_lib"
+ ;;
+ *)
+ TRY_LIB="-l$lineedit_lib -l$term_lib"
+ ;;
+ esac
+ LIBS="$NTP_ORIG_LIBS $TRY_LIB"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline() with $TRY_LIB" >&5
+$as_echo_n "checking for readline() with $TRY_LIB... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char readline ();
+int
+main ()
+{
+return readline ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_lib_lineedit="$TRY_LIB"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ case "$ntp_lib_lineedit" in
+ '')
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ *)
+ # Use readline()
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ break
+ esac
+ case "$term_lib" in
+ '')
+ # do not try el_gets without a terminal library
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_gets() with $TRY_LIB" >&5
+$as_echo_n "checking for el_gets() with $TRY_LIB... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char el_gets ();
+int
+main ()
+{
+return el_gets ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_lib_lineedit="$TRY_LIB"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ case "$ntp_lib_lineedit" in
+ '')
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ *) # Use el_gets()
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ break
+ ;;
+ esac # $ntp_lib_lineedit
+ esac # $term_lib
+ done
+ case "$ntp_lib_lineedit" in
+ '')
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ LIBS="$NTP_ORIG_LIBS"
+ ;;
+ esac # $use_lineeditlibs
+
+ case "$ntp_lib_lineedit" in
+ '')
+ ntp_lib_lineedit="no"
+ ;;
+ no)
+ ;;
+ *)
+ EDITLINE_LIBS="$ntp_lib_lineedit"
+
+ ;;
+ esac # $ntp_lib_lineedit
+
+ case "$ntp_lib_lineedit" in
+ no)
+ ;;
+ *)
+ for ac_header in readline.h readline/readline.h histedit.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in history.h readline/history.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ case "$ac_cv_header_histedit_h" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to el_init()" >&5
+$as_echo_n "checking number of arguments to el_init()... " >&6; }
+if ${ntp_cv_el_init_args+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <histedit.h>
+
+int
+main ()
+{
+
+ el_init("conftest", stdin, stdout, stderr);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_el_init_args=4
+else
+ ntp_cv_el_init_args=3
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_el_init_args" >&5
+$as_echo "$ntp_cv_el_init_args" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define EL_INIT_ARGS $ntp_cv_el_init_args
+_ACEOF
+
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5
+$as_echo_n "checking whether readline supports history... " >&6; }
+
+ ntp_lib_lineedit_history="no"
+ ORIG_LIBS="$LIBS"
+ LIBS="$ORIG_LIBS $ntp_lib_lineedit"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char add_history ();
+int
+main ()
+{
+return add_history ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_lib_lineedit_history="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ORIG_LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_lib_lineedit_history" >&5
+$as_echo "$ntp_lib_lineedit_history" >&6; }
+
+ case "$ntp_lib_lineedit_history" in
+ yes)
+
+$as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h
+
+ esac
+ esac # $ntp_lib_lineedit
+ { NTP_ORIG_LIBS=; unset NTP_ORIG_LIBS;}
+ { ORIG_LIBS=; unset ORIG_LIBS;}
+ { TRY_LIB=; unset TRY_LIB;}
+ { use_lineeditlibs=; unset use_lineeditlibs;}
+
+
+LIBM=
+case "$host" in
+ *-*-darwin*)
+ ;;
+ *)
+ _libs=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5
+$as_echo_n "checking for library containing cos... " >&6; }
+if ${ac_cv_search_cos+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_cos=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_cos+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_cos+:} false; then :
+
+else
+ ac_cv_search_cos=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5
+$as_echo "$ac_cv_search_cos" >&6; }
+ac_res=$ac_cv_search_cos
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ LIBM="-lm"
+fi
+
+ LIBS=$_libs
+ ;;
+esac
+
+{ _libs=; unset _libs;}
+
+
+for ac_header in vfork.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
+if test "x$ac_cv_header_vfork_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VFORK_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in fork vfork
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test "x$ac_cv_func_fork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
+$as_echo_n "checking for working fork... " >&6; }
+if ${ac_cv_func_fork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_fork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* By Ruediger Kuhlmann. */
+ return fork () < 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_fork_works=yes
+else
+ ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
+$as_echo "$ac_cv_func_fork_works" >&6; }
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
+$as_echo_n "checking for working vfork... " >&6; }
+if ${ac_cv_func_vfork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_vfork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Thanks to Paul Eggert for this test. */
+$ac_includes_default
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+
+int
+main ()
+{
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test (0);
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ return (
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_vfork_works=yes
+else
+ ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
+$as_echo "$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=$ac_cv_func_vfork
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+$as_echo "#define vfork fork" >>confdefs.h
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${ac_cv_working_alloca_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_working_alloca_h=yes
+else
+ ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if ${ac_cv_func_alloca_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca (size_t);
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_alloca_works=yes
+else
+ ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if ${ac_cv_os_cray+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "webecray" >/dev/null 2>&1; then :
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+ break
+fi
+
+ done
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if ${ac_cv_c_stack_direction+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_c_stack_direction=0
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+ return find_stack_direction () < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_stack_direction=1
+else
+ ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
+
+for ac_func in strerror_r
+do :
+ ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
+if test "x$ac_cv_func_strerror_r" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR_R 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+$as_echo_n "checking whether strerror_r returns char *... " >&6; }
+if ${ac_cv_func_strerror_r_char_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+ # function. BeOS and DEC UNIX 4.0 fall in this category, but the
+ # former has a strerror_r that returns char*, while the latter
+ # has a strerror_r that returns `int'.
+ # This test should segfault on the DEC system.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ extern char *strerror_r ();
+int
+main ()
+{
+char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ return ! isalpha (x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
+$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+
+fi
+
+
+ac_busted_vpath_in_make=no
+case "$build" in
+ *-*-irix6.1*) # 64 bit only
+ # busted vpath?
+ ;;
+ *-*-irix6*) # 6.2 (and later?)
+ ac_busted_vpath_in_make=yes
+ ;;
+ *-*-solaris2.5.1)
+ ac_busted_vpath_in_make=yes
+ ;;
+ *-*-unicosmp*)
+ ac_busted_vpath_in_make=yes
+ ;;
+esac
+
+case "$ac_busted_vpath_in_make$srcdir" in
+ yes.|no*)
+ ;;
+ *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in
+ '')
+ as_fn_error $? "building outside of the main directory requires GNU make" "$LINENO" 5
+ esac
+ ;;
+esac
+
+case "$host" in
+ *-*-aix4*)
+ # Bug 2516:
+ # Was *-*-aix[[4-9]]*
+ # XXX only verified thru AIX6. But...
+ # Ken Link says this is fine for AIX 5.3 and 7.1, and sees no reason
+ # that this support would be in 5.3, removed in 6, and added back.
+ #
+ # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
+ # (returning ENOSYS). I didn't check 4.2. If, in the future,
+ # IBM pulls its thumbs out long enough to implement clock_settime,
+ # this conditional will need to change. Maybe use AC_TRY_RUN
+ # instead to try to set the time to itself and check errno.
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_clock_gettime" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_clock_gettime $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+ for ac_func in clock_getres clock_gettime clock_settime
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+
+for ac_func in getclock stime timegm strlcpy strlcat
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+#
+for ac_header in errno.h sys/socket.h sys/types.h time.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in net/if.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+
+"
+if test "x$ac_cv_header_net_if_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_IF_H 1
+_ACEOF
+
+fi
+
+done
+
+case "$host" in
+ *-hp-hpux*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if net/if.h requires mpinfou predeclaration" >&5
+$as_echo_n "checking if net/if.h requires mpinfou predeclaration... " >&6; }
+if ${ntp_cv_predecl_mpinfou+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ np_cv_predecl_mpinfou=no
+ case "$ac_cv_header_net_if_h" in
+ no)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+ } mpinfou_t;
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #include <net/if.h>
+
+int
+main ()
+{
+
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ ntp_cv_predecl_mpinfou=yes
+ ac_cv_header_net_if_h=yes
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_predecl_mpinfou" >&5
+$as_echo "$ntp_cv_predecl_mpinfou" >&6; }
+ case "$ntp_cv_predecl_mpinfou" in
+ yes)
+ cat >>confdefs.h <<_ACEOF
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+_ACEOF
+
+ esac
+esac
+
+case "$host" in
+ *-linux*)
+ for ac_header in linux/if_addr.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "linux/if_addr.h" "ac_cv_header_linux_if_addr_h" "
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+
+"
+if test "x$ac_cv_header_linux_if_addr_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_IF_ADDR_H 1
+_ACEOF
+
+fi
+
+done
+
+esac
+
+for ac_header in arpa/nameser.h sys/param.h sys/time.h sys/timers.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
+for ac_header in sys/sysctl.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "
+ #if defined HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+
+"
+if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SYSCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in netinet/in_system.h netinet/in_systm.h netinet/in.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in resolv.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+
+"
+if test "x$ac_cv_header_resolv_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RESOLV_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in net/if_var.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" "
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_NET_IF_H
+ # include <net/if.h>
+ #endif
+
+"
+if test "x$ac_cv_header_net_if_var_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_IF_VAR_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in netinet/ip.h netinet/in_var.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NET_IF_H
+ # include <net/if.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_NET_IF_VAR_H
+ # include <net/if_var.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_SYSTM_H
+ # include <netinet/in_systm.h>
+ #endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# HMS: Do we need to check for -lsocket before or after these tests?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5
+$as_echo_n "checking for library containing inet_pton... " >&6; }
+if ${ac_cv_search_inet_pton+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_pton ();
+int
+main ()
+{
+return inet_pton ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_pton=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_pton+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_pton+:} false; then :
+
+else
+ ac_cv_search_inet_pton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5
+$as_echo "$ac_cv_search_inet_pton" >&6; }
+ac_res=$ac_cv_search_inet_pton
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_inet_pton" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_inet_pton $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
+$as_echo_n "checking for library containing inet_ntop... " >&6; }
+if ${ac_cv_search_inet_ntop+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntop ();
+int
+main ()
+{
+return inet_ntop ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_ntop=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_ntop+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_ntop+:} false; then :
+
+else
+ ac_cv_search_inet_ntop=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
+$as_echo "$ac_cv_search_inet_ntop" >&6; }
+ac_res=$ac_cv_search_inet_ntop
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_inet_ntop" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_inet_ntop $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+
+# [Bug 1628] On Solaris, we need -lxnet -lsocket. Generalize this to
+# avoid keying on the OS name: If we find socket functions in
+# libsocket, next try for them in libxnet without libsocket, if found,
+# list both. If we simply tested libxnet first, we would find the
+# functions there and never add libsocket. See also [Bug 660]
+# http://bugs.ntp.org/show_bug.cgi?id=660#c9
+saved_LIBS=$LIBS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
+$as_echo_n "checking for library containing setsockopt... " >&6; }
+if ${ac_cv_search_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char setsockopt ();
+int
+main ()
+{
+return setsockopt ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_setsockopt=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_setsockopt+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_setsockopt+:} false; then :
+
+else
+ ac_cv_search_setsockopt=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5
+$as_echo "$ac_cv_search_setsockopt" >&6; }
+ac_res=$ac_cv_search_setsockopt
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_setsockopt" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_setsockopt $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+case "$ac_cv_search_setsockopt" in
+ -lsocket)
+ LIBS="$saved_LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getsockopt" >&5
+$as_echo_n "checking for library containing getsockopt... " >&6; }
+if ${ac_cv_search_getsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getsockopt ();
+int
+main ()
+{
+return getsockopt ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' xnet; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getsockopt=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getsockopt+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getsockopt+:} false; then :
+
+else
+ ac_cv_search_getsockopt=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getsockopt" >&5
+$as_echo "$ac_cv_search_getsockopt" >&6; }
+ac_res=$ac_cv_search_getsockopt
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_getsockopt" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_getsockopt $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+ # XXX Possible trouble here - reading the comments above and looking at the
+ # code below I wonder if we'll add -lxnet when we don't need it.
+ # Also, do we need to add -lxnet to LDADD_LIBNTP, or perhaps see if it's
+ # there when it is not needed?
+ case "$ac_cv_search_getsockopt" in
+ -lxnet)
+ LIBS="-lxnet -lsocket $saved_LIBS"
+ ;;
+ *) LIBS="-lsocket $saved_LIBS"
+ ;;
+ esac
+ ;;
+esac
+{ saved_LIBS=; unset saved_LIBS;}
+
+# Bug 2427 - look for recvmsg here.
+for ac_func in recvmsg
+do :
+ ac_fn_c_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg"
+if test "x$ac_cv_func_recvmsg" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RECVMSG 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
+case "$ac_cv_c_inline" in
+ '')
+ ;;
+ *)
+
+$as_echo "#define HAVE_INLINE 1" >>confdefs.h
+
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if ${ac_cv_sizeof_time_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_time_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (time_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_time_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5
+$as_echo_n "checking whether char is unsigned... " >&6; }
+if ${ac_cv_c_char_unsigned+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((char) -1) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_char_unsigned=no
+else
+ ac_cv_c_char_unsigned=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5
+$as_echo "$ac_cv_c_char_unsigned" >&6; }
+if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
+ $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h
+
+fi
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5
+$as_echo_n "checking size of signed char... " >&6; }
+if ${ac_cv_sizeof_signed_char+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_signed_char" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (signed char)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_signed_char=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5
+$as_echo "$ac_cv_sizeof_signed_char" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
+_ACEOF
+
+
+ac_fn_c_check_type "$LINENO" "s_char" "ac_cv_type_s_char" "$ac_includes_default"
+if test "x$ac_cv_type_s_char" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_S_CHAR 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
+if test "x$ac_cv_type_long_long" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LONG_LONG 1
+_ACEOF
+
+
+fi
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+case "$ac_cv_type_long_long" in
+ no)
+ ;;
+ *)
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+ ;;
+esac
+
+case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
+ *yes)
+ # We have a typedef for s_char. Might as well believe it...
+ ;;
+ no0no)
+ # We have signed chars, can't say 'signed char', no s_char typedef.
+
+$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h
+
+ ;;
+ no1no)
+ # We have signed chars, can say 'signed char', no s_char typedef.
+
+$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h
+
+ ;;
+ yes0no)
+ # We have unsigned chars, can't say 'signed char', no s_char typedef.
+ as_fn_error $? "No way to specify a signed character!" "$LINENO" 5
+ ;;
+ yes1no)
+ # We have unsigned chars, can say 'signed char', no s_char typedef.
+
+$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h
+
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
+$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+if ${ac_cv_type_uid_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1; then :
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
+$as_echo "$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
+
+$as_echo "#define uid_t int" >>confdefs.h
+
+
+$as_echo "#define gid_t int" >>confdefs.h
+
+fi
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including debugging code" >&5
+$as_echo_n "checking if we're including debugging code... " >&6; }
+# Check whether --enable-debugging was given.
+if test "${enable_debugging+set}" = set; then :
+ enableval=$enable_debugging; ntp_ok=$enableval
+else
+ ntp_ok=yes
+
+fi
+
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define DEBUG 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+
+
+# check if we can compile with pthreads
+for ac_header in semaphore.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default"
+if test "x$ac_cv_header_semaphore_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SEMAPHORE_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in socketpair
+do :
+ ac_fn_c_check_func "$LINENO" "socketpair" "ac_cv_func_socketpair"
+if test "x$ac_cv_func_socketpair" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKETPAIR 1
+_ACEOF
+
+fi
+done
+
+# Check whether --enable-thread-support was given.
+if test "${enable_thread_support+set}" = set; then :
+ enableval=$enable_thread_support;
+else
+ enable_thread_support=yes
+
+fi
+
+have_pthreads=no
+case "$enable_thread_support" in
+ yes)
+ ol_found_pthreads=no
+
+
+
+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
+
+# OpenLDAP --with-threads
+
+# Check whether --with-threads was given.
+if test "${with_threads+set}" = set; then :
+ withval=$with_threads;
+ ol_arg=invalid
+ for ol_val in auto nt posix mach pth lwp yes no manual ; do
+ if test "$withval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ as_fn_error $? "bad value $withval for --with-threads" "$LINENO" 5
+ fi
+ ol_with_threads="$ol_arg"
+
+else
+ ol_with_threads="auto"
+fi
+# end --with-threads
+
+
+case "$ol_with_threads$host" in
+ auto*-*-solaris2.[0-6])
+ ol_with_threads=no
+ ;;
+esac
+
+
+ol_aix_threads=no
+case "$host" in
+*-*-aix*) if test -z "$CC" ; then
+ case "$ol_with_threads" in
+ auto | yes | posix) ol_aix_threads=yes ;;
+ esac
+ fi
+;;
+esac
+
+if test $ol_aix_threads = yes ; then
+ if test -z "${CC}" ; then
+ for ac_prog in cc_r xlc_r cc
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+done
+
+
+ if test "$CC" = cc ; then
+ if test $ol_with_threads != auto ; then
+ as_fn_error $? "--with-threads requires cc_r (or other suitable compiler) on AIX" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5
+$as_echo "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;}
+ fi
+ ol_with_threads=no
+ fi
+ fi
+
+ case ${CC} in cc_r | xlc_r)
+ ol_with_threads=posix
+ ol_cv_pthread_create=yes
+ ;;
+ esac
+fi
+
+ol_link_threads=no
+# OpenLDAP --with-yielding_select
+
+# Check whether --with-yielding_select was given.
+if test "${with_yielding_select+set}" = set; then :
+ withval=$with_yielding_select;
+ ol_arg=invalid
+ for ol_val in auto yes no manual ; do
+ if test "$withval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ as_fn_error $? "bad value $withval for --with-yielding_select" "$LINENO" 5
+ fi
+ ol_with_yielding_select="$ol_arg"
+
+else
+ ol_with_yielding_select="auto"
+fi
+# end --with-yielding_select
+
+
+case $ol_with_threads in auto | yes | nt)
+
+
+ ac_fn_c_check_func "$LINENO" "_beginthread" "ac_cv_func__beginthread"
+if test "x$ac_cv_func__beginthread" = xyes; then :
+
+fi
+
+
+ if test $ac_cv_func__beginthread = yes ; then
+
+$as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h
+
+ ol_cv_nt_threads=yes
+ fi
+
+
+ if test "$ol_cv_nt_threads" = yes ; then
+ ol_link_threads=nt
+ ol_with_threads=found
+ ol_with_yielding_select=yes
+
+
+$as_echo "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h
+
+ fi
+
+ if test $ol_with_threads = nt ; then
+ as_fn_error $? "could not locate NT Threads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | posix)
+
+ for ac_header in pthread.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_pthread_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5
+$as_echo_n "checking POSIX thread version... " >&6; }
+if ${ol_cv_pthread_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+
+int
+main ()
+{
+
+ int i = PTHREAD_CREATE_JOINABLE;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_detach" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=10
+else
+ ol_cv_pthread_version=8
+fi
+rm -f conftest*
+
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+# ifdef PTHREAD_CREATE_UNDETACHED
+ draft7
+# endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "draft7" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=7
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_attr_init" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+#ifdef PTHREAD_MUTEX_INITIALIZER
+ draft5
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "draft5" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=5
+else
+ ol_cv_pthread_version=4
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5
+$as_echo "$ol_cv_pthread_version" >&6; }
+
+
+ if test $ol_cv_pthread_version != 0 ; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREADS $ol_cv_pthread_version
+_ACEOF
+
+ else
+ as_fn_error $? "unknown pthread version" "$LINENO" 5
+ fi
+
+ # consider threads found
+ ol_with_threads=found
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
+$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
+if ${ol_cv_header_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
+ ol_cv_header_linux_threads=yes
+else
+ ol_cv_header_linux_threads=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
+$as_echo "$ol_cv_header_linux_threads" >&6; }
+ if test $ol_cv_header_linux_threads = yes; then
+
+$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5
+$as_echo_n "checking for GNU Pth pthread.h... " >&6; }
+if ${ol_cv_header_gnu_pth_pthread_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+ __gnu_pth__;
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "__gnu_pth__" >/dev/null 2>&1; then :
+ ol_cv_header_gnu_pth_pthread_h=yes
+else
+ ol_cv_header_gnu_pth_pthread_h=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5
+$as_echo "$ol_cv_header_gnu_pth_pthread_h" >&6; }
+
+
+ if test $ol_cv_header_gnu_pth_pthread_h = no ; then
+ for ac_header in sched.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
+if test "x$ac_cv_header_sched_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SCHED_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5
+$as_echo_n "checking for pthread_create in default libraries... " >&6; }
+if ${ol_cv_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_create=yes
+else
+ ol_cv_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_create=yes
+else
+ ol_cv_pthread_create=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5
+$as_echo "$ol_cv_pthread_create" >&6; }
+
+ if test $ol_cv_pthread_create != no ; then
+ ol_link_threads=posix
+ ol_link_pthreads=""
+ fi
+
+ # Pthread try link: -kthread (ol_cv_pthread_kthread)
+if test "$ol_link_threads" = no ; then
+ # try -kthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5
+$as_echo_n "checking for pthread link with -kthread... " >&6; }
+if ${ol_cv_pthread_kthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-kthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_kthread=yes
+else
+ ol_cv_pthread_kthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_kthread=yes
+else
+ ol_cv_pthread_kthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5
+$as_echo "$ol_cv_pthread_kthread" >&6; }
+
+ if test $ol_cv_pthread_kthread = yes ; then
+ ol_link_pthreads="-kthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthread (ol_cv_pthread_pthread)
+if test "$ol_link_threads" = no ; then
+ # try -pthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5
+$as_echo_n "checking for pthread link with -pthread... " >&6; }
+if ${ol_cv_pthread_pthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_pthread=yes
+else
+ ol_cv_pthread_pthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_pthread=yes
+else
+ ol_cv_pthread_pthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5
+$as_echo "$ol_cv_pthread_pthread" >&6; }
+
+ if test $ol_cv_pthread_pthread = yes ; then
+ ol_link_pthreads="-pthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
+if test "$ol_link_threads" = no ; then
+ # try -pthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5
+$as_echo_n "checking for pthread link with -pthreads... " >&6; }
+if ${ol_cv_pthread_pthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_pthreads=yes
+else
+ ol_cv_pthread_pthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_pthreads=yes
+else
+ ol_cv_pthread_pthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5
+$as_echo "$ol_cv_pthread_pthreads" >&6; }
+
+ if test $ol_cv_pthread_pthreads = yes ; then
+ ol_link_pthreads="-pthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
+if test "$ol_link_threads" = no ; then
+ # try -mthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5
+$as_echo_n "checking for pthread link with -mthreads... " >&6; }
+if ${ol_cv_pthread_mthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-mthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_mthreads=yes
+else
+ ol_cv_pthread_mthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_mthreads=yes
+else
+ ol_cv_pthread_mthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5
+$as_echo "$ol_cv_pthread_mthreads" >&6; }
+
+ if test $ol_cv_pthread_mthreads = yes ; then
+ ol_link_pthreads="-mthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -thread (ol_cv_pthread_thread)
+if test "$ol_link_threads" = no ; then
+ # try -thread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5
+$as_echo_n "checking for pthread link with -thread... " >&6; }
+if ${ol_cv_pthread_thread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-thread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_thread=yes
+else
+ ol_cv_pthread_thread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_thread=yes
+else
+ ol_cv_pthread_thread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5
+$as_echo "$ol_cv_pthread_thread" >&6; }
+
+ if test $ol_cv_pthread_thread = yes ; then
+ ol_link_pthreads="-thread"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -lmach -lexc -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+$as_echo_n "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; }
+if ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5
+$as_echo "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -lmach -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthread -lmach -lexc... " >&6; }
+if ${ol_cv_pthread_lpthread_lmach_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthread_lmach_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -Wl,-woff,85
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+$as_echo_n "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; }
+if ${ol_cv_pthread_lib_lpthread_woff+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -Wl,-woff,85 $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lib_lpthread_woff=yes
+else
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lib_lpthread_woff=yes
+else
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5
+$as_echo "$ol_cv_pthread_lib_lpthread_woff" >&6; }
+
+ if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
+ ol_link_pthreads="-lpthread -Wl,-woff,85"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5
+$as_echo_n "checking for pthread link with -lpthread... " >&6; }
+if ${ol_cv_pthread_lpthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread=yes
+else
+ ol_cv_pthread_lpthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread=yes
+else
+ ol_cv_pthread_lpthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5
+$as_echo "$ol_cv_pthread_lpthread" >&6; }
+
+ if test $ol_cv_pthread_lpthread = yes ; then
+ ol_link_pthreads="-lpthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5
+$as_echo_n "checking for pthread link with -lc_r... " >&6; }
+if ${ol_cv_pthread_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lc_r=yes
+else
+ ol_cv_pthread_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lc_r=yes
+else
+ ol_cv_pthread_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5
+$as_echo "$ol_cv_pthread_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lc_r = yes ; then
+ ol_link_pthreads="-lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -threads (ol_cv_pthread_threads)
+if test "$ol_link_threads" = no ; then
+ # try -threads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5
+$as_echo_n "checking for pthread link with -threads... " >&6; }
+if ${ol_cv_pthread_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-threads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_threads=yes
+else
+ ol_cv_pthread_threads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_threads=yes
+else
+ ol_cv_pthread_threads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5
+$as_echo "$ol_cv_pthread_threads" >&6; }
+
+ if test $ol_cv_pthread_threads = yes ; then
+ ol_link_pthreads="-threads"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lmach -lexc -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; }
+if ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
+ ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lmach -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc... " >&6; }
+if ${ol_cv_pthread_lpthreads_lmach_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lmach -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
+ ol_link_pthreads="-lpthreads -lmach -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lexc... " >&6; }
+if ${ol_cv_pthread_lpthreads_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lexc = yes ; then
+ ol_link_pthreads="-lpthreads -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5
+$as_echo_n "checking for pthread link with -lpthreads... " >&6; }
+if ${ol_cv_pthread_lib_lpthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lib_lpthreads=yes
+else
+ ol_cv_pthread_lib_lpthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lib_lpthreads=yes
+else
+ ol_cv_pthread_lib_lpthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5
+$as_echo "$ol_cv_pthread_lib_lpthreads" >&6; }
+
+ if test $ol_cv_pthread_lib_lpthreads = yes ; then
+ ol_link_pthreads="-lpthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ if test $ol_link_threads != no ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
+
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+
+ for ac_func in sched_yield pthread_yield thr_yield
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test $ac_cv_func_thr_yield = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_sched_yield=yes
+else
+ ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+ LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+
+$as_echo "#define HAVE_SCHED_YIELD 1" >>confdefs.h
+
+ ac_cv_func_sched_yield=yes
+else
+ ac_cv_func_sched_yield=no
+fi
+
+ fi
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test "$ac_cv_func_thr_yield" = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5
+$as_echo "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;}
+ fi
+
+ for ac_func in pthread_kill
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill"
+if test "x$ac_cv_func_pthread_kill" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_KILL 1
+_ACEOF
+
+fi
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with <pthread.h>" >&5
+$as_echo_n "checking for pthread_rwlock_destroy with <pthread.h>... " >&6; }
+if ${ol_cv_func_pthread_rwlock_destroy+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+pthread_rwlock_t rwlock;
+
+int
+main ()
+{
+pthread_rwlock_destroy(&rwlock);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_func_pthread_rwlock_destroy=yes
+else
+ ol_cv_func_pthread_rwlock_destroy=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5
+$as_echo "$ol_cv_func_pthread_rwlock_destroy" >&6; }
+ if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
+
+$as_echo "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with <pthread.h>" >&5
+$as_echo_n "checking for pthread_detach with <pthread.h>... " >&6; }
+if ${ol_cv_func_pthread_detach+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+int
+main ()
+{
+pthread_detach(NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_func_pthread_detach=yes
+else
+ ol_cv_func_pthread_detach=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5
+$as_echo "$ol_cv_func_pthread_detach" >&6; }
+
+ if test $ol_cv_func_pthread_detach = no ; then
+ as_fn_error $? "could not locate pthread_detach()" "$LINENO" 5
+ fi
+
+
+$as_echo "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h
+
+
+ for ac_func in \
+ pthread_setconcurrency \
+ pthread_getconcurrency \
+ thr_setconcurrency \
+ thr_getconcurrency \
+
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+ for ac_func in pthread_kill_other_threads_np
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np"
+if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5
+$as_echo_n "checking for LinuxThreads implementation... " >&6; }
+if ${ol_cv_sys_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5
+$as_echo "$ol_cv_sys_linux_threads" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5
+$as_echo_n "checking for LinuxThreads consistency... " >&6; }
+if ${ol_cv_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ol_cv_header_linux_threads = yes &&
+ test $ol_cv_sys_linux_threads = yes; then
+ ol_cv_linux_threads=yes
+ elif test $ol_cv_header_linux_threads = no &&
+ test $ol_cv_sys_linux_threads = no; then
+ ol_cv_linux_threads=no
+ else
+ ol_cv_linux_threads=error
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5
+$as_echo "$ol_cv_linux_threads" >&6; }
+
+
+ if test $ol_cv_linux_threads = error; then
+ as_fn_error $? "LinuxThreads header/library mismatch" "$LINENO" 5;
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5
+$as_echo_n "checking if pthread_create() works... " >&6; }
+if ${ol_cv_pthread_create_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ ol_cv_pthread_create_works=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_create_works=yes
+else
+ ol_cv_pthread_create_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5
+$as_echo "$ol_cv_pthread_create_works" >&6; }
+
+ if test $ol_cv_pthread_create_works = no ; then
+ as_fn_error $? "pthread_create is not usable, check environment settings" "$LINENO" 5
+ fi
+
+ ol_replace_broken_yield=no
+
+ if test $ol_replace_broken_yield = yes ; then
+
+$as_echo "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h
+
+ fi
+
+ if test x$ol_with_yielding_select = xauto ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5
+$as_echo_n "checking if select yields when using pthreads... " >&6; }
+if ${ol_cv_pthread_select_yields+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ ol_cv_pthread_select_yields=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*) 0
+#endif
+
+static int fildes[2];
+
+static void *task(p)
+ void *p;
+{
+ int i;
+ struct timeval tv;
+
+ fd_set rfds;
+
+ tv.tv_sec=10;
+ tv.tv_usec=0;
+
+ FD_ZERO(&rfds);
+ FD_SET(fildes[0], &rfds);
+
+ /* we're not interested in any fds */
+ i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+ if(i < 0) {
+ perror("select");
+ exit(10);
+ }
+
+ exit(0); /* if we exit here, the select blocked the whole process */
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+
+ /* create a pipe to select */
+ if(pipe(&fildes[0])) {
+ perror("select");
+ exit(1);
+ }
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+ (void) pthread_setconcurrency(2);
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
+ /* Set Solaris LWP concurrency to 2 */
+ thr_setconcurrency(2);
+#endif
+#endif
+
+#if HAVE_PTHREADS < 6
+ pthread_create(&t, pthread_attr_default, task, NULL);
+#else
+ pthread_create(&t, NULL, task, NULL);
+#endif
+
+ /* make sure task runs first */
+#ifdef HAVE_THR_YIELD
+ thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+ sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+ pthread_yield();
+#endif
+
+ exit(2);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_select_yields=no
+else
+ ol_cv_pthread_select_yields=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5
+$as_echo "$ol_cv_pthread_select_yields" >&6; }
+
+ if test $ol_cv_pthread_select_yields = cross ; then
+ as_fn_error $? "crossing compiling: use --with-yielding-select=yes|no|manual" "$LINENO" 5
+ fi
+
+ if test $ol_cv_pthread_select_yields = yes ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ else
+ as_fn_error $? "could not locate usable POSIX Threads" "$LINENO" 5
+ fi
+ fi
+
+ if test $ol_with_threads = posix ; then
+ as_fn_error $? "could not locate POSIX Threads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | mach)
+
+ for ac_header in mach/cthreads.h cthreads.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_mach_cthreads_h = yes ; then
+ ol_with_threads=found
+
+ ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
+if test "x$ac_cv_func_cthread_fork" = xyes; then :
+ ol_link_threads=yes
+fi
+
+
+ if test $ol_link_threads = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5
+$as_echo_n "checking for cthread_fork with -all_load... " >&6; }
+if ${ol_cv_cthread_all_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ save_LIBS="$LIBS"
+ LIBS="-all_load $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <mach/cthreads.h>
+int
+main ()
+{
+
+ cthread_fork((void *)0, (void *)0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_cthread_all_load=yes
+else
+ ol_cv_cthread_all_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5
+$as_echo "$ol_cv_cthread_all_load" >&6; }
+
+ if test $ol_cv_cthread_all_load = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+ ol_link_threads=mach
+ ol_with_threads=found
+ fi
+ fi
+
+ elif test $ac_cv_header_cthreads_h = yes ; then
+
+ ol_with_threads=found
+
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lthreads"
+ ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
+if test "x$ac_cv_func_cthread_fork" = xyes; then :
+ ol_link_threads=yes
+fi
+
+ LIBS="$save_LIBS"
+
+ if test $ol_link_threads = yes ; then
+ LTHREAD_LIBS="-lthreads"
+ ol_link_threads=mach
+ ol_with_threads=found
+ else
+ as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
+ fi
+
+ elif test $ol_with_threads = mach ; then
+ as_fn_error $? "could not locate Mach CThreads" "$LINENO" 5
+ fi
+
+ if test $ol_link_threads = mach ; then
+
+$as_echo "#define HAVE_MACH_CTHREADS 1" >>confdefs.h
+
+ elif test $ol_with_threads = found ; then
+ as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | pth)
+
+ for ac_header in pth.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default"
+if test "x$ac_cv_header_pth_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTH_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_pth_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5
+$as_echo_n "checking for pth_version in -lpth... " >&6; }
+if ${ac_cv_lib_pth_pth_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpth $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pth_version ();
+int
+main ()
+{
+return pth_version ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pth_pth_version=yes
+else
+ ac_cv_lib_pth_pth_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5
+$as_echo "$ac_cv_lib_pth_pth_version" >&6; }
+if test "x$ac_cv_lib_pth_pth_version" = xyes; then :
+ have_pth=yes
+else
+ have_pth=no
+fi
+
+
+ if test $have_pth = yes ; then
+
+$as_echo "#define HAVE_GNU_PTH 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
+ ol_link_threads=pth
+ ol_with_threads=found
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | lwp)
+
+ for ac_header in thread.h synch.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_thread_h = yes &&
+ test $ac_cv_header_synch_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5
+$as_echo_n "checking for thr_create in -lthread... " >&6; }
+if ${ac_cv_lib_thread_thr_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char thr_create ();
+int
+main ()
+{
+return thr_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_thread_thr_create=yes
+else
+ ac_cv_lib_thread_thr_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5
+$as_echo "$ac_cv_lib_thread_thr_create" >&6; }
+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
+ have_thr=yes
+else
+ have_thr=no
+fi
+
+
+ if test $have_thr = yes ; then
+
+$as_echo "#define HAVE_THR 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
+ ol_link_threads=thr
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+
+ for ac_func in \
+ thr_setconcurrency \
+ thr_getconcurrency \
+
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ fi
+ fi
+
+ for ac_header in lwp/lwp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
+if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LWP_LWP_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_lwp_lwp_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5
+$as_echo_n "checking for lwp_create in -llwp... " >&6; }
+if ${ac_cv_lib_lwp_lwp_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llwp $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lwp_create ();
+int
+main ()
+{
+return lwp_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_lwp_lwp_create=yes
+else
+ ac_cv_lib_lwp_lwp_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5
+$as_echo "$ac_cv_lib_lwp_lwp_create" >&6; }
+if test "x$ac_cv_lib_lwp_lwp_create" = xyes; then :
+ have_lwp=yes
+else
+ have_lwp=no
+fi
+
+
+ if test $have_lwp = yes ; then
+
+$as_echo "#define HAVE_LWP 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+ ol_link_threads=lwp
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=no
+ fi
+ fi
+ fi
+ ;;
+esac
+
+if test $ol_with_yielding_select = yes ; then
+
+$as_echo "#define HAVE_YIELDING_SELECT 1" >>confdefs.h
+
+fi
+
+if test $ol_with_threads = manual ; then
+ ol_link_threads=yes
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5
+$as_echo "$as_me: WARNING: thread defines and link options must be set manually" >&2;}
+
+ for ac_header in pthread.h sched.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_func in sched_yield pthread_yield
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
+$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
+if ${ol_cv_header_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
+ ol_cv_header_linux_threads=yes
+else
+ ol_cv_header_linux_threads=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
+$as_echo "$ol_cv_header_linux_threads" >&6; }
+ if test $ol_cv_header_linux_threads = yes; then
+
+$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
+
+ fi
+
+
+ for ac_header in mach/cthreads.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default"
+if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MACH_CTHREADS_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in lwp/lwp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
+if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LWP_LWP_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in thread.h synch.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+if test $ol_link_threads != no && test $ol_link_threads != nt ; then
+
+$as_echo "#define REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define THREAD_SAFE 1" >>confdefs.h
+
+
+$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
+
+
+$as_echo "#define THREADSAFE 1" >>confdefs.h
+
+
+$as_echo "#define _THREADSAFE 1" >>confdefs.h
+
+
+$as_echo "#define _SGI_MP_SOURCE 1" >>confdefs.h
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5
+$as_echo_n "checking for thread specific errno... " >&6; }
+if ${ol_cv_errno_thread_specific+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+int
+main ()
+{
+errno = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_errno_thread_specific=yes
+else
+ ol_cv_errno_thread_specific=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5
+$as_echo "$ol_cv_errno_thread_specific" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5
+$as_echo_n "checking for thread specific h_errno... " >&6; }
+if ${ol_cv_h_errno_thread_specific+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netdb.h>
+int
+main ()
+{
+h_errno = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_h_errno_thread_specific=yes
+else
+ ol_cv_h_errno_thread_specific=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5
+$as_echo "$ol_cv_h_errno_thread_specific" >&6; }
+
+ if test $ol_cv_errno_thread_specific != yes ||
+ test $ol_cv_h_errno_thread_specific != yes ; then
+ LIBS="$LTHREAD_LIBS $LIBS"
+ LTHREAD_LIBS=""
+ fi
+
+fi
+
+if test $ol_link_threads = no ; then
+ if test $ol_with_threads = yes ; then
+ as_fn_error $? "no suitable thread support" "$LINENO" 5
+ fi
+
+ if test $ol_with_threads = auto ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5
+$as_echo "$as_me: WARNING: no suitable thread support, disabling threads" >&2;}
+ ol_with_threads=no
+ fi
+
+
+$as_echo "#define NO_THREADS 1" >>confdefs.h
+
+ LTHREAD_LIBS=""
+ BUILD_THREAD=no
+else
+ BUILD_THREAD=yes
+fi
+
+if test $ol_link_threads != no ; then
+
+$as_echo "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h
+
+fi
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+case "$ol_with_threads" in
+ no)
+ ol_pthread_ok=no
+
+ ;;
+ *)
+ ol_found_pthreads=yes
+ ;;
+esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ case "$ol_found_pthreads" in
+ yes)
+ saved_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+ for ac_func in sem_timedwait
+do :
+ ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait"
+if test "x$ac_cv_func_sem_timedwait" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SEM_TIMEDWAIT 1
+_ACEOF
+
+fi
+done
+
+ LIBS="$saved_LIBS"
+ { saved_LIBS=; unset saved_LIBS;}
+ CFLAGS="$saved_CFLAGS"
+ { saved_CFLAGS=; unset saved_CFLAGS;}
+ case "$ac_cv_func_sem_timedwait" 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)
+ { $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
+
+case "$have_pthreads" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP $PTHREAD_CFLAGS"
+ saved_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5
+$as_echo_n "checking size of pthread_t... " >&6; }
+if ${ac_cv_sizeof_pthread_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" "
+ $ac_includes_default
+ #include <pthread.h>
+
+
+"; then :
+
+else
+ if test "$ac_cv_type_pthread_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (pthread_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pthread_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5
+$as_echo "$ac_cv_sizeof_pthread_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t
+_ACEOF
+
+
+ LIBISC_PTHREADS_NOTHREADS=pthreads
+
+$as_echo "#define ISC_PLATFORM_USETHREADS 1" >>confdefs.h
+
+ #
+ # We'd like to use sigwait() too
+ #
+ ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait"
+if test "x$ac_cv_func_sigwait" = xyes; then :
+ have_sigwait=yes
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc" >&5
+$as_echo_n "checking for sigwait in -lc... " >&6; }
+if ${ac_cv_lib_c_sigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $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 sigwait ();
+int
+main ()
+{
+return sigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_sigwait=yes
+else
+ ac_cv_lib_c_sigwait=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_c_sigwait" >&5
+$as_echo "$ac_cv_lib_c_sigwait" >&6; }
+if test "x$ac_cv_lib_c_sigwait" = xyes; then :
+ have_sigwait=yes
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lpthread" >&5
+$as_echo_n "checking for sigwait in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_sigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $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 sigwait ();
+int
+main ()
+{
+return sigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_sigwait=yes
+else
+ ac_cv_lib_pthread_sigwait=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_pthread_sigwait" >&5
+$as_echo "$ac_cv_lib_pthread_sigwait" >&6; }
+if test "x$ac_cv_lib_pthread_sigwait" = xyes; then :
+ have_sigwait=yes
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Psigwait in -lpthread" >&5
+$as_echo_n "checking for _Psigwait in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread__Psigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $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 _Psigwait ();
+int
+main ()
+{
+return _Psigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread__Psigwait=yes
+else
+ ac_cv_lib_pthread__Psigwait=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_pthread__Psigwait" >&5
+$as_echo "$ac_cv_lib_pthread__Psigwait" >&6; }
+if test "x$ac_cv_lib_pthread__Psigwait" = xyes; then :
+ have_sigwait=yes
+else
+ have_sigwait=no
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ case "$host:$have_sigwait" in
+ *-freebsd*:no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc_r" >&5
+$as_echo_n "checking for sigwait in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_sigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $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 sigwait ();
+int
+main ()
+{
+return sigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_sigwait=yes
+else
+ ac_cv_lib_c_r_sigwait=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_c_r_sigwait" >&5
+$as_echo "$ac_cv_lib_c_r_sigwait" >&6; }
+if test "x$ac_cv_lib_c_r_sigwait" = xyes; then :
+ have_sigwait=yes
+
+fi
+
+ esac
+ case "$have_sigwait" in
+ yes)
+ ac_cv_func_sigwait=yes
+
+$as_echo "#define HAVE_SIGWAIT 1" >>confdefs.h
+
+ esac
+
+ for ac_func in pthread_attr_getstacksize
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_attr_getstacksize" "ac_cv_func_pthread_attr_getstacksize"
+if test "x$ac_cv_func_pthread_attr_getstacksize" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
+_ACEOF
+
+fi
+done
+
+ for ac_func in pthread_attr_setstacksize sysconf
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ case "$host" in
+ *-freebsd5.[012]|*-freebsd5.[012].*)
+ ;;
+ *-freebsd5.[3456789]|*-freebsd5.[3456789].*|*-freebsd6.*)
+
+$as_echo "#define NEED_PTHREAD_SCOPE_SYSTEM 1" >>confdefs.h
+
+ ;;
+ *-bsdi3.*|*-bsdi4.0*)
+
+$as_echo "#define NEED_PTHREAD_INIT 1" >>confdefs.h
+
+ ;;
+ *-linux*)
+
+$as_echo "#define HAVE_LINUXTHREADS 1" >>confdefs.h
+
+ ;;
+ *-solaris*)
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ for ac_func in pthread_setconcurrency
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_setconcurrency" "ac_cv_func_pthread_setconcurrency"
+if test "x$ac_cv_func_pthread_setconcurrency" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_SETCONCURRENCY 1
+_ACEOF
+
+fi
+done
+
+ case "$ac_cv_func_pthread_setconcurrency" in
+ yes)
+
+$as_echo "#define CALL_PTHREAD_SETCONCURRENCY 1" >>confdefs.h
+
+ esac
+ ;;
+ *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+
+$as_echo "#define HAVE_UNIXWARE_SIGWAIT 1" >>confdefs.h
+
+ ;;
+ esac
+ hack_shutup_pthreadonceinit=no
+ case "$host" in
+ *-aix5.[123].*)
+ hack_shutup_pthreadonceinit=yes
+ ;;
+ *-solaris2.[89])
+ hack_shutup_pthreadonceinit=yes
+ ;;
+ *-solaris2.1[0-9])
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if extra braces are needed for PTHREAD_ONCE_INIT" >&5
+$as_echo_n "checking if extra braces are needed for PTHREAD_ONCE_INIT... " >&6; }
+if ${ntp_cv_braces_around_pthread_once_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+
+int
+main ()
+{
+
+ static pthread_once_t once_test =
+ PTHREAD_ONCE_INIT;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_braces_around_pthread_once_init=no
+else
+ ntp_cv_braces_around_pthread_once_init=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_braces_around_pthread_once_init" >&5
+$as_echo "$ntp_cv_braces_around_pthread_once_init" >&6; }
+ case "$ntp_cv_braces_around_pthread_once_init" in
+ yes)
+ hack_shutup_pthreadonceinit=yes
+ esac
+ ;;
+ esac
+ case "$hack_shutup_pthreadonceinit" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1" >>confdefs.h
+
+ esac
+ LIBS="$saved_LIBS"
+ { saved_LIBS=; unset saved_LIBS;}
+ CFLAGS="$saved_CFLAGS"
+ { saved_CFLAGS=; unset saved_CFLAGS;}
+ ;;
+ *)
+ LIBISC_PTHREADS_NOTHREADS=nothreads
+ ;;
+esac
+
+ if test "$have_pthreads" != "no"; then
+ PTHREADS_TRUE=
+ PTHREADS_FALSE='#'
+else
+ PTHREADS_TRUE='#'
+ PTHREADS_FALSE=
+fi
+
+
+
+
+
+
+
+case "$hw_use_rpl_vsnprintf:$hw_cv_func_vsnprintf" in
+ no:yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if vsnprintf expands \"%m\" to strerror(errno)" >&5
+$as_echo_n "checking if vsnprintf expands \"%m\" to strerror(errno)... " >&6; }
+if ${ntp_cv_vsnprintf_percent_m+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ntp_cv_vsnprintf_percent_m=no
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdarg.h>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ int call_vsnprintf(
+ char * dst,
+ size_t sz,
+ const char *fmt,
+ ...
+ );
+
+ int call_vsnprintf(
+ char * dst,
+ size_t sz,
+ const char *fmt,
+ ...
+ )
+ {
+ va_list ap;
+ int rc;
+
+ va_start(ap, fmt);
+ rc = vsnprintf(dst, sz, fmt, ap);
+ va_end(ap);
+
+ return rc;
+ }
+
+int
+main ()
+{
+
+ char sbuf[512];
+ char pbuf[512];
+ int slen;
+
+ strcpy(sbuf, strerror(ENOENT));
+ errno = ENOENT;
+ slen = call_vsnprintf(pbuf, sizeof(pbuf), "%m",
+ "wrong");
+ return strcmp(sbuf, pbuf);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ntp_cv_vsnprintf_percent_m=yes
+else
+ ntp_cv_vsnprintf_percent_m=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_vsnprintf_percent_m" >&5
+$as_echo "$ntp_cv_vsnprintf_percent_m" >&6; }
+ case "$ntp_cv_vsnprintf_percent_m" in
+ yes)
+
+$as_echo "#define VSNPRINTF_PERCENT_M 1" >>confdefs.h
+
+ esac
+esac
+
+for ac_header in sys/clockctl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/clockctl.h" "ac_cv_header_sys_clockctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_clockctl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_CLOCKCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# Check whether --enable-clockctl was given.
+if test "${enable_clockctl+set}" = set; then :
+ enableval=$enable_clockctl; ntp_use_dev_clockctl=$enableval
+else
+ ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use /dev/clockctl" >&5
+$as_echo_n "checking if we should use /dev/clockctl... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_dev_clockctl" >&5
+$as_echo "$ntp_use_dev_clockctl" >&6; }
+
+
+for ac_header in sys/capability.h sys/prctl.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have linux capabilities (libcap)" >&5
+$as_echo_n "checking if we have linux capabilities (libcap)... " >&6; }
+
+case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
+ yesyes)
+ case "$host" in
+ mips-sgi-irix*)
+ ntp_have_linuxcaps=no
+ ;;
+ *) ntp_have_linuxcaps=yes
+ ;;
+ esac
+ ;;
+ *)
+ ntp_have_linuxcaps=no
+ ;;
+esac
+
+# Check whether --enable-linuxcaps was given.
+if test "${enable_linuxcaps+set}" = set; then :
+ enableval=$enable_linuxcaps; ntp_have_linuxcaps=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_linuxcaps" >&5
+$as_echo "$ntp_have_linuxcaps" >&6; }
+
+case "$ntp_have_linuxcaps" in
+ yes)
+
+$as_echo "#define HAVE_LINUX_CAPABILITIES 1" >>confdefs.h
+
+ LIBS="$LIBS -lcap"
+ ;;
+esac
+
+
+for ac_header in priv.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "priv.h" "ac_cv_header_priv_h" "$ac_includes_default"
+if test "x$ac_cv_header_priv_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PRIV_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have solaris privileges" >&5
+$as_echo_n "checking if we have solaris privileges... " >&6; }
+
+case "$ac_cv_header_priv_h" in
+ yes)
+ case "$host" in
+ *-solaris*)
+ ac_fn_c_check_func "$LINENO" "setppriv" "ac_cv_func_setppriv"
+if test "x$ac_cv_func_setppriv" = xyes; then :
+ ntp_have_solarisprivs=yes
+else
+ ntp_have_solarisprivs=no
+
+fi
+
+ ;;
+ esac
+esac
+
+# Check whether --enable-solarisprivs was given.
+if test "${enable_solarisprivs+set}" = set; then :
+ enableval=$enable_solarisprivs; ntp_have_solarisprivs=$enableval
+
+fi
+
+
+
+case "$ntp_have_solarisprivs" in
+ yes)
+
+$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_solarisprivs" >&5
+$as_echo "$ntp_have_solarisprivs" >&6; }
+
+case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs" in
+ *yes*)
+
+$as_echo "#define HAVE_DROPROOT 1" >>confdefs.h
+
+esac
+
+case "$host" in
+ *-*-darwin*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_init" >&5
+$as_echo_n "checking for library containing res_9_init... " >&6; }
+if ${ac_cv_search_res_9_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char res_9_init ();
+int
+main ()
+{
+return res_9_init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_res_9_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_res_9_init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_res_9_init+:} false; then :
+
+else
+ ac_cv_search_res_9_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_init" >&5
+$as_echo "$ac_cv_search_res_9_init" >&6; }
+ac_res=$ac_cv_search_res_9_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5
+$as_echo_n "checking for library containing res_init... " >&6; }
+if ${ac_cv_search_res_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char res_init ();
+int
+main ()
+{
+return res_init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_res_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_res_init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_res_init+:} false; then :
+
+else
+ ac_cv_search_res_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5
+$as_echo "$ac_cv_search_res_init" >&6; }
+ac_res=$ac_cv_search_res_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ ;;
+esac
+for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h> /* inet_ functions / structs */
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+# include <arpa/nameser.h> /* DNS HEADER struct */
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+#HMS: Why do we do this check so "early"?
+for ac_func in res_init
+do :
+ ac_fn_c_check_func "$LINENO" "res_init" "ac_cv_func_res_init"
+if test "x$ac_cv_func_res_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RES_INIT 1
+_ACEOF
+
+else
+ for ac_func in __res_init
+do :
+ ac_fn_c_check_func "$LINENO" "__res_init" "ac_cv_func___res_init"
+if test "x$ac_cv_func___res_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE___RES_INIT 1
+_ACEOF
+
+fi
+done
+
+fi
+done
+
+
+# We also need -lsocket, but we have tested for that already.
+ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
+if test "x$ac_cv_func_inet_ntop" = xyes; then :
+
+else
+
+$as_echo "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
+if test "x$ac_cv_func_inet_pton" = xyes; then :
+
+else
+
+$as_echo "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "int32" "ac_cv_type_int32" "$ac_includes_default"
+if test "x$ac_cv_type_int32" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT32 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "u_int32" "ac_cv_type_u_int32" "$ac_includes_default"
+if test "x$ac_cv_type_u_int32" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U_INT32 1
+_ACEOF
+
+
+fi
+
+
+
+
+case "$ac_cv_type_int32::$ac_cv_header_resolv_h" in
+ no::yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int32 with DNS headers included" >&5
+$as_echo_n "checking for int32 with DNS headers included... " >&6; }
+if ${ntp_cv_type_int32_with_dns+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #include <resolv.h>
+
+int
+main ()
+{
+
+ size_t cb = sizeof(int32);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_type_int32_with_dns=yes
+else
+ ntp_cv_type_int32_with_dns=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_int32_with_dns" >&5
+$as_echo "$ntp_cv_type_int32_with_dns" >&6; }
+ case "$ntp_cv_type_int32_with_dns" in
+ yes)
+
+$as_echo "#define HAVE_INT32_ONLY_WITH_DNS 1" >>confdefs.h
+
+ esac
+esac
+
+case "$ac_cv_type_u_int32::$ac_cv_header_resolv_h" in
+ no::yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int32 with DNS headers included" >&5
+$as_echo_n "checking for u_int32 with DNS headers included... " >&6; }
+if ${ntp_cv_type_u_int32_with_dns+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #include <resolv.h>
+
+int
+main ()
+{
+
+ size_t cb = sizeof(u_int32);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_type_u_int32_with_dns=yes
+else
+ ntp_cv_type_u_int32_with_dns=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int32_with_dns" >&5
+$as_echo "$ntp_cv_type_u_int32_with_dns" >&6; }
+ case "$ntp_cv_type_u_int32_with_dns" in
+ yes)
+
+$as_echo "#define HAVE_U_INT32_ONLY_WITH_DNS 1" >>confdefs.h
+
+ esac
+esac
+
+for ac_header in sys/timepps.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/timepps.h" "ac_cv_header_sys_timepps_h" "
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+
+
+"
+if test "x$ac_cv_header_sys_timepps_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TIMEPPS_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec" >&5
+$as_echo_n "checking for struct timespec... " >&6; }
+if ${ntp_cv_struct_timespec+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+ /* Under SunOS, timespec is in sys/timepps.h,
+ which needs errno.h and FRAC */
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+ #ifdef HAVE_SYS_TIMEPPS_H
+ # define FRAC 4294967296
+ # include <sys/timepps.h>
+ #endif
+
+int
+main ()
+{
+
+ struct timespec n;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_timespec=yes
+else
+ ntp_cv_struct_timespec=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_timespec" >&5
+$as_echo "$ntp_cv_struct_timespec" >&6; }
+case "$ntp_cv_struct_timespec" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ntptimeval" >&5
+$as_echo_n "checking for struct ntptimeval... " >&6; }
+if ${ntp_cv_struct_ntptimeval+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+ #include <sys/timex.h>
+
+int
+main ()
+{
+
+ struct ntptimeval n;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_ntptimeval=yes
+else
+ ntp_cv_struct_ntptimeval=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ntptimeval" >&5
+$as_echo "$ntp_cv_struct_ntptimeval" >&6; }
+case "$ntp_cv_struct_ntptimeval" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_NTPTIMEVAL 1" >>confdefs.h
+
+esac
+
+for ac_header in md5.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "md5.h" "ac_cv_header_md5_h" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+
+
+"
+if test "x$ac_cv_header_md5_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MD5_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MD5Init" >&5
+$as_echo_n "checking for library containing MD5Init... " >&6; }
+if ${ac_cv_search_MD5Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char MD5Init ();
+int
+main ()
+{
+return MD5Init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' md5 md; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_MD5Init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_MD5Init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_MD5Init+:} false; then :
+
+else
+ ac_cv_search_MD5Init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_MD5Init" >&5
+$as_echo "$ac_cv_search_MD5Init" >&6; }
+ac_res=$ac_cv_search_MD5Init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+for ac_func in MD5Init sysconf getdtablesize sigaction sigset sigvec
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5
+$as_echo_n "checking for SIGIO... " >&6; }
+if ${ntp_cv_hdr_def_sigio+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <signal.h>
+
+ #ifndef SIGIO
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_cv_hdr_def_sigio=yes
+else
+ ntp_cv_hdr_def_sigio=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigio" >&5
+$as_echo "$ntp_cv_hdr_def_sigio" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use SIGIO" >&5
+$as_echo_n "checking if we want to use SIGIO... " >&6; }
+ans=no
+case "$ntp_cv_hdr_def_sigio" in
+ yes)
+ ans=yes
+ case "$host" in
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ ans=no
+ ;;
+ *-convex-*)
+ ans=no
+ ;;
+ *-dec-*)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-univel-sysv*)
+ ans=no
+ ;;
+ *-*-irix6*)
+ ans=no
+ ;;
+ *-*-freebsd*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ m68k-*-mint*)
+ ans=no
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+
+$as_echo "#define HAVE_SIGNALED_IO 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGPOLL" >&5
+$as_echo_n "checking for SIGPOLL... " >&6; }
+if ${ntp_cv_hdr_def_sigpoll+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <signal.h>
+
+ #ifndef SIGPOLL
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_cv_hdr_def_sigpoll=yes
+else
+ ntp_cv_hdr_def_sigpoll=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigpoll" >&5
+$as_echo "$ntp_cv_hdr_def_sigpoll" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for UDP I/O" >&5
+$as_echo_n "checking if we can use SIGPOLL for UDP I/O... " >&6; }
+ans=no
+case "$ntp_cv_hdr_def_sigpoll" in
+ yes)
+ case "$host" in
+ mips-sgi-irix*)
+ ans=no
+ ;;
+ vax-dec-bsd)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-*-aix[4-9]*)
+ # XXX Only verified thru AIX6
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-osf*)
+ ans=no
+ ;;
+ *-*-qnx*)
+ ans=no
+ ;;
+ *-*-sunos*)
+ ans=no
+ ;;
+ *-*-solaris*)
+ ans=no
+ ;;
+ *-*-ultrix*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ *) ans=yes
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+
+$as_echo "#define USE_UDP_SIGPOLL 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for TTY I/O" >&5
+$as_echo_n "checking if we can use SIGPOLL for TTY I/O... " >&6; }
+ans=no
+case "$ntp_cv_hdr_def_sigpoll" in
+ yes)
+ case "$host" in
+ mips-sgi-irix*)
+ ans=no
+ ;;
+ vax-dec-bsd)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-*-aix[4-9]*)
+ # XXX Only verified thru AIX6
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-osf*)
+ ans=no
+ ;;
+ *-*-sunos*)
+ ans=no
+ ;;
+ *-*-ultrix*)
+ ans=no
+ ;;
+ *-*-qnx*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ *) ans=yes
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+
+$as_echo "#define USE_TTY_SIGPOLL 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to gettimeofday()" >&5
+$as_echo_n "checking number of arguments to gettimeofday()... " >&6; }
+if ${ntp_cv_func_Xettimeofday_nargs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+
+int
+main ()
+{
+
+ gettimeofday(0, 0);
+ settimeofday(0, 0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_func_Xettimeofday_nargs=2
+else
+ ntp_cv_func_Xettimeofday_nargs=1
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_Xettimeofday_nargs" >&5
+$as_echo "$ntp_cv_func_Xettimeofday_nargs" >&6; }
+case "$ntp_cv_func_Xettimeofday_nargs" in
+ 1)
+
+$as_echo "#define SYSV_TIMEOFDAY 1" >>confdefs.h
+
+esac
+
+for ac_func in settimeofday
+do :
+ ac_fn_c_check_func "$LINENO" "settimeofday" "ac_cv_func_settimeofday"
+if test "x$ac_cv_func_settimeofday" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SETTIMEOFDAY 1
+_ACEOF
+
+else
+
+ case "$host" in
+ *-*-mpeix*) ac_cv_func_settimeofday=yes
+ esac
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we'll use clock_settime or settimeofday or stime" >&5
+$as_echo_n "checking if we'll use clock_settime or settimeofday or stime... " >&6; }
+ntp_warning='GRONK'
+ans=none
+case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
+ yes*)
+ ntp_warning=''
+ ans='clock_settime()'
+ ;;
+ noyes*)
+ ntp_warning='But clock_settime() would be better (if we had it)'
+ ans='settimeofday()'
+ ;;
+ nonoyes)
+ ntp_warning='Which is the worst of the three'
+ ans='stime()'
+ ;;
+ *)
+ case "$build" in
+ $host)
+ ntp_warning='Which leaves us with nothing to use!'
+ esac
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+case "$ntp_warning" in
+ '')
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** $ntp_warning ***" >&5
+$as_echo "$as_me: WARNING: *** $ntp_warning ***" >&2;}
+ ;;
+esac
+
+
+LDADD_LIBNTP="$LDADD_LIBNTP $LIBS"
+LIBS=$__LIBS
+{ __LIBS=; unset __LIBS;}
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deprecated --with-arlib" >&5
+$as_echo_n "checking for deprecated --with-arlib... " >&6; }
+
+# Check whether --with-arlib was given.
+if test "${with_arlib+set}" = set; then :
+ withval=$with_arlib; ans=$withval
+else
+ ans=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&5
+$as_echo "$as_me: WARNING: Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized." >&2;}
+ ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ ac_cv_prog_AWK=; unset ac_cv_prog_AWK;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
+$as_echo_n "checking for library containing strerror... " >&6; }
+if ${ac_cv_search_strerror+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char strerror ();
+int
+main ()
+{
+return strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' cposix; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_strerror=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_strerror+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_strerror+:} false; then :
+
+else
+ ac_cv_search_strerror=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
+$as_echo "$ac_cv_search_strerror" >&6; }
+ac_res=$ac_cv_search_strerror
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_PERL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_PERL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_PERL="$PATH_PERL" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PATH_PERL="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_PERL=$ac_cv_path_PATH_PERL
+if test -n "$PATH_PERL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_PERL" >&5
+$as_echo "$PATH_PERL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+{ ac_cv_path_PATH_PERL=; unset ac_cv_path_PATH_PERL;}
+# Extract the first word of "test", so it can be a program name with args.
+set dummy test; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TEST+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TEST in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TEST="$PATH_TEST" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PATH_TEST="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TEST=$ac_cv_path_PATH_TEST
+if test -n "$PATH_TEST"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TEST" >&5
+$as_echo "$PATH_TEST" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+{ ac_cv_path_PATH_TEST=; unset ac_cv_path_PATH_TEST;}
+test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
+
+
+# Check whether --with-net-snmp-config was given.
+if test "${with_net_snmp_config+set}" = set; then :
+ withval=$with_net_snmp_config; ans=$withval
+else
+ ans=yes
+
+fi
+
+case "$ans" in
+ no)
+ ;;
+ yes)
+ ans=net-snmp-config
+ ;;
+ /*)
+ ;;
+ */*)
+ as_fn_error $? "--with-net-snmp-config takes either a name or an absolute path" "$LINENO" 5
+ ;;
+ *)
+ ;;
+esac
+PROG_NET_SNMP_CONFIG=$ans
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for net-snmp-config path" >&5
+$as_echo_n "checking for net-snmp-config path... " >&6; }
+case "$PROG_NET_SNMP_CONFIG" in
+ no) ;;
+ /*)
+ PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
+ ;;
+ *)
+ # Extract the first word of "$PROG_NET_SNMP_CONFIG", so it can be a program name with args.
+set dummy $PROG_NET_SNMP_CONFIG; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_NET_SNMP_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_NET_SNMP_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_NET_SNMP_CONFIG="$PATH_NET_SNMP_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PATH_NET_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_NET_SNMP_CONFIG=$ac_cv_path_PATH_NET_SNMP_CONFIG
+if test -n "$PATH_NET_SNMP_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5
+$as_echo "$PATH_NET_SNMP_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ { ac_cv_path_PATH_NET_SNMP_CONFIG=; unset ac_cv_path_PATH_NET_SNMP_CONFIG;}
+;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_NET_SNMP_CONFIG" >&5
+$as_echo "$PATH_NET_SNMP_CONFIG" >&6; }
+
+case "$host" in
+ *-*-vxworks*)
+ ac_link="$ac_link $VX_KERNEL"
+ ;;
+esac
+
+# HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5
+$as_echo_n "checking for library containing openlog... " >&6; }
+if ${ac_cv_search_openlog+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char openlog ();
+int
+main ()
+{
+return openlog ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' gen syslog; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_openlog=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_openlog+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_openlog+:} false; then :
+
+else
+ ac_cv_search_openlog=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5
+$as_echo "$ac_cv_search_openlog" >&6; }
+ac_res=$ac_cv_search_openlog
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+# XXX library list will be in ac_cv_search_openlog
+
+# LIBSECCOMP is off by default -- needs testing with all the features
+# Please send bug reports to loganaden@gmail.com
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use libseccomp sandboxing (EXPERIMENTAL)" >&5
+$as_echo_n "checking if we want to use libseccomp sandboxing (EXPERIMENTAL)... " >&6; }
+# Check whether --enable-libseccomp was given.
+if test "${enable_libseccomp+set}" = set; then :
+ enableval=$enable_libseccomp; ntp_ok=$enableval
+else
+ ntp_ok=no
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing seccomp_init" >&5
+$as_echo_n "checking for library containing seccomp_init... " >&6; }
+if ${ac_cv_search_seccomp_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char seccomp_init ();
+int
+main ()
+{
+return seccomp_init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' seccomp; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_seccomp_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_seccomp_init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_seccomp_init+:} false; then :
+
+else
+ ac_cv_search_seccomp_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_seccomp_init" >&5
+$as_echo "$ac_cv_search_seccomp_init" >&6; }
+ac_res=$ac_cv_search_seccomp_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define LIBSECCOMP 1" >>confdefs.h
+
+
+fi
+
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <sys/prctl.h>
+ #include <linux/seccomp.h>
+
+ int main(void)
+ {
+ int ret;
+ ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
+ if (ret < 0) {
+ switch (errno) {
+ case ENOSYS:
+ return 1;
+ case EINVAL:
+ return 1;
+ default:
+ return 1;
+ }
+ }
+ ret =
+ prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
+ if (ret < 0) {
+ switch (errno) {
+ case EINVAL:
+ return 1;
+ case EFAULT:
+ return 0;
+ default:
+ return 1;
+ }
+ }
+return 1;
+}
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+$as_echo "#define KERN_SECCOMP 1" >>confdefs.h
+
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for facilitynames in syslog.h" >&5
+$as_echo_n "checking for facilitynames in syslog.h... " >&6; }
+if ${ac_cv_HAVE_SYSLOG_FACILITYNAMES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define SYSLOG_NAMES
+#include <stdlib.h>
+#include <syslog.h>
+
+int
+main ()
+{
+ void *fnames; fnames = facilitynames;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes
+else
+ ac_cv_HAVE_SYSLOG_FACILITYNAMES=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&5
+$as_echo "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&6; }
+case "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" in
+ yes)
+
+$as_echo "#define HAVE_SYSLOG_FACILITYNAMES 1" >>confdefs.h
+
+ ;;
+ no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No facilitynames in <syslog.h>" >&5
+$as_echo "$as_me: WARNING: No facilitynames in <syslog.h>" >&2;}
+ ;;
+ cross)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: facilitynames in <syslog.h> - cross-compiling" >&5
+$as_echo "$as_me: WARNING: facilitynames in <syslog.h> - cross-compiling" >&2;}
+ ;;
+esac
+
+
+
+case "$host" in
+ *-*-*linux*) ;;
+ *-*-osf4*) ;;
+ *-*-osf5*) ;;
+ *)
+ # HMS: Make sure we check for -lrt for clock_* before this...
+ case "$ac_cv_search_clock_gettime" in
+ '') as_fn_error $? "Internal Error: Haven't looked for clock_gettime() yet!" "$LINENO" 5 ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_setscheduler" >&5
+$as_echo_n "checking for library containing sched_setscheduler... " >&6; }
+if ${ac_cv_search_sched_setscheduler+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_setscheduler ();
+int
+main ()
+{
+return sched_setscheduler ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_sched_setscheduler=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_sched_setscheduler+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_sched_setscheduler+:} false; then :
+
+else
+ ac_cv_search_sched_setscheduler=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_setscheduler" >&5
+$as_echo "$ac_cv_search_sched_setscheduler" >&6; }
+ac_res=$ac_cv_search_sched_setscheduler
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ ;;
+esac
+
+for ac_header in bstring.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "bstring.h" "ac_cv_header_bstring_h" "$ac_includes_default"
+if test "x$ac_cv_header_bstring_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_BSTRING_H 1
+_ACEOF
+
+fi
+
+done
+
+ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
+if test "x$ac_cv_header_dns_sd_h" = xyes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing DNSServiceRegister" >&5
+$as_echo_n "checking for library containing DNSServiceRegister... " >&6; }
+if ${ac_cv_search_DNSServiceRegister+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char DNSServiceRegister ();
+int
+main ()
+{
+return DNSServiceRegister ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dns_sd; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_DNSServiceRegister=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_DNSServiceRegister+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_DNSServiceRegister+:} false; then :
+
+else
+ ac_cv_search_DNSServiceRegister=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_DNSServiceRegister" >&5
+$as_echo "$ac_cv_search_DNSServiceRegister" >&6; }
+ac_res=$ac_cv_search_DNSServiceRegister
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_DNSREGISTRATION 1" >>confdefs.h
+
+
+fi
+
+
+fi
+
+
+for ac_header in fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in memory.h netdb.h poll.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sgtty.h stdlib.h string.h termio.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in termios.h timepps.h timex.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+case "$host" in
+ *-*-aix*)
+ for ac_header in utmpx.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default"
+if test "x$ac_cv_header_utmpx_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UTMPX_H 1
+_ACEOF
+
+fi
+
+done
+
+ case "$ac_cv_header_utmpx_h" in
+ yes)
+ ;;
+ *)
+ for ac_header in utmp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "utmp.h" "ac_cv_header_utmp_h" "$ac_includes_default"
+if test "x$ac_cv_header_utmp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UTMP_H 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+ esac
+ ;;
+ *)
+ for ac_header in utmp.h utmpx.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+esac
+
+#
+# On Suns only (so far) getpass() truncates the typed password to 8
+# characters, but getpassphrase() allows up to 257. Most systems'
+# getpass() does not truncate, at least not so as to affect ntpq and
+# ntpdc password prompts.
+#
+# So check for getpassphrase(), but only on Sun operating systems.
+#
+case "$host" in
+ *-*-sunos*|*-*-solaris*)
+ for ac_func in getpassphrase
+do :
+ ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase"
+if test "x$ac_cv_func_getpassphrase" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPASSPHRASE 1
+_ACEOF
+
+fi
+done
+
+esac
+
+
+for ac_header in net/if6.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "net/if6.h" "ac_cv_header_net_if6_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_if6_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_IF6_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in net/route.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "net/route.h" "ac_cv_header_net_route_h" "
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+
+"
+if test "x$ac_cv_header_net_route_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_ROUTE_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in netinfo/ni.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "netinfo/ni.h" "ac_cv_header_netinfo_ni_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinfo_ni_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETINFO_NI_H 1
+_ACEOF
+
+fi
+
+done
+
+case "$ac_cv_header_netinfo_ni_h" in
+ yes)
+
+$as_echo "#define HAVE_NETINFO 1" >>confdefs.h
+
+esac
+for ac_header in sun/audioio.h sys/audioio.h sys/file.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+case "$host" in
+ *-*-sunos4*)
+ ;;
+ *)
+ for ac_header in sys/ioctl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_ioctl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_IOCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+esac
+for ac_header in sys/ipc.h sys/lock.h sys/mman.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+# HMS: Check sys/proc.h and sys/resource.h after some others
+for ac_header in sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+case "$ac_cv_header_sched_h" in
+ yes)
+ ;;
+ *)
+ for ac_header in sys/sched.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/sched.h" "ac_cv_header_sys_sched_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sched_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SCHED_H 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+esac
+# HMS: Check sys/shm.h after some others
+for ac_header in sys/select.h sys/signal.h sys/sockio.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+# HMS: Checked sys/socket.h earlier
+case "$host" in
+ *-*-netbsd*)
+ ;;
+ *)
+ for ac_header in machine/soundcard.h sys/soundcard.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+esac
+for ac_header in sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/systune.h sys/termios.h sys/tpro.h sys/wait.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+case "$host" in
+*-convex-*)
+ for ac_header in /sys/sync/queue.h /sys/sync/sema.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+*-*-bsdi*)
+ for ac_header in machine/inline.h sys/pcl720.h sys/i8253.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+esac
+
+case "$host" in
+ *-*-solaris2.6)
+ # Broken...
+ ;;
+ *)
+ for ac_func in ntp_adjtime ntp_gettime
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+
+case "$host" in
+ *-*-*linux*)
+ case "$ac_cv_func_ntp_gettime" in
+ yes)
+ ;;
+ *)
+ for ac_func in __ntp_gettime
+do :
+ ac_fn_c_check_func "$LINENO" "__ntp_gettime" "ac_cv_func___ntp_gettime"
+if test "x$ac_cv_func___ntp_gettime" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE___NTP_GETTIME 1
+_ACEOF
+
+fi
+done
+
+ case "$ac_cv_func___ntp_gettime" in
+ yes)
+
+$as_echo "#define ntp_gettime __ntp_gettime" >>confdefs.h
+
+
+$as_echo "#define HAVE_NTP_GETTIME 1" >>confdefs.h
+
+ esac
+ ;;
+ esac
+ for ac_func in adjtimex
+do :
+ ac_fn_c_check_func "$LINENO" "adjtimex" "ac_cv_func_adjtimex"
+if test "x$ac_cv_func_adjtimex" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ADJTIMEX 1
+_ACEOF
+
+fi
+done
+
+ case "$ac_cv_func_adjtimex" in
+ yes)
+
+$as_echo "#define ntp_adjtime adjtimex" >>confdefs.h
+
+
+$as_echo "#define HAVE_NTP_ADJTIME 1" >>confdefs.h
+
+ have_adjtimex=1
+ ;;
+ *)
+ for ac_func in __adjtimex
+do :
+ ac_fn_c_check_func "$LINENO" "__adjtimex" "ac_cv_func___adjtimex"
+if test "x$ac_cv_func___adjtimex" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE___ADJTIMEX 1
+_ACEOF
+
+fi
+done
+
+ case "$ac_cv_func___adjtimex" in
+ yes)
+
+$as_echo "#define ntp_adjtime __adjtimex" >>confdefs.h
+
+
+$as_echo "#define HAVE_NTP_ADJTIME 1" >>confdefs.h
+
+
+$as_echo "#define adjtimex __adjtimex" >>confdefs.h
+
+
+$as_echo "#define HAVE_ADJTIMEX 1" >>confdefs.h
+
+ have_adjtimex=1
+ esac
+ ;;
+ esac
+esac
+case "$have_adjtimex" in
+ '')
+ # nlist stuff is only needed for tickadj.
+ saved_LIBS="$LIBS"
+ LIBS=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nlist" >&5
+$as_echo_n "checking for library containing nlist... " >&6; }
+if ${ac_cv_search_nlist+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nlist ();
+int
+main ()
+{
+return nlist ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' elf ld mld; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_nlist=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_nlist+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_nlist+:} false; then :
+
+else
+ ac_cv_search_nlist=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nlist" >&5
+$as_echo "$ac_cv_search_nlist" >&6; }
+ac_res=$ac_cv_search_nlist
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kvm_open" >&5
+$as_echo_n "checking for library containing kvm_open... " >&6; }
+if ${ac_cv_search_kvm_open+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_open ();
+int
+main ()
+{
+return kvm_open ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' kvm; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_kvm_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_kvm_open+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_kvm_open+:} false; then :
+
+else
+ ac_cv_search_kvm_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kvm_open" >&5
+$as_echo "$ac_cv_search_kvm_open" >&6; }
+ac_res=$ac_cv_search_kvm_open
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+ # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
+ for ac_header in nlist.h sys/var.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ case "$ac_cv_header_nlist_h" in
+ yes)
+
+$as_echo "#define NLIST_STRUCT 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for n_un in struct nlist" >&5
+$as_echo_n "checking for n_un in struct nlist... " >&6; }
+if ${ntp_cv_struct_nlist_n_un+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <nlist.h>
+
+int
+main ()
+{
+
+ struct nlist n;
+ n.n_un.n_name = 0;
+
+
+ ;
+ return 0;
+}
+ ntp_cv_struct_nlist_n_un=yes
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_nlist_n_un=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_nlist_n_un" >&5
+$as_echo "$ntp_cv_struct_nlist_n_un" >&6; }
+ case "$ntp_cv_struct_nlist_n_un" in
+ yes)
+
+$as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h
+
+ esac
+ esac
+
+ LDADD_NLIST="$LIBS"
+ LIBS="$saved_LIBS"
+ { saved_LIBS=; unset saved_LIBS;}
+esac
+
+for ac_header in sys/proc.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/proc.h" "ac_cv_header_sys_proc_h" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+
+"
+if test "x$ac_cv_header_sys_proc_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_PROC_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/resource.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+
+"
+if test "x$ac_cv_header_sys_resource_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_RESOURCE_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/shm.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_IPC_H
+ # include <sys/ipc.h>
+ #endif
+
+"
+if test "x$ac_cv_header_sys_shm_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SHM_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/timex.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/timex.h" "ac_cv_header_sys_timex_h" "
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+
+"
+if test "x$ac_cv_header_sys_timex_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TIMEX_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if ${ac_cv_type_signal+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_signal=int
+else
+ ac_cv_type_signal=void
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a fallback value for HZ" >&5
+$as_echo_n "checking for a fallback value for HZ... " >&6; }
+if ${ntp_cv_default_hz+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ntp_cv_default_hz=100
+ case "$host" in
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ ntp_cv_default_hz=1024
+ ;;
+ mips-dec-ultrix4*)
+ ntp_cv_default_hz=256
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_default_hz" >&5
+$as_echo "$ntp_cv_default_hz" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_HZ $ntp_cv_default_hz
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to override the system's value for HZ" >&5
+$as_echo_n "checking if we need to override the system's value for HZ... " >&6; }
+if ${ntp_cv_override_hz+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ntp_cv_override_hz=no
+ case "$host" in
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ ntp_cv_override_hz=yes
+ ;;
+ mips-dec-ultrix4*)
+ ntp_cv_override_hz=yes
+ ;;
+ *-*-freebsd*)
+ ntp_cv_override_hz=yes
+ ;;
+ *-*-sunos4*)
+ ntp_cv_override_hz=yes
+ ;;
+ *-*-kfreebsd*)
+ ntp_cv_override_hz=yes
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_override_hz" >&5
+$as_echo "$ntp_cv_override_hz" >&6; }
+case "$ntp_cv_override_hz" in
+ yes)
+
+$as_echo "#define OVERRIDE_HZ 1" >>confdefs.h
+
+esac
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rt_msghdr" >&5
+$as_echo_n "checking for struct rt_msghdr... " >&6; }
+if ${ntp_cv_struct_rt_msghdr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+ #include <net/route.h>
+
+int
+main ()
+{
+
+ struct rt_msghdr p;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_rt_msghdr=yes
+else
+ ntp_cv_struct_rt_msghdr=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_rt_msghdr" >&5
+$as_echo "$ntp_cv_struct_rt_msghdr" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct rtattr" >&5
+$as_echo_n "checking for struct rtattr... " >&6; }
+if ${ntp_cv_rtattr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stddef.h>
+ #include <sys/socket.h>
+ #include <linux/rtnetlink.h>
+
+int
+main ()
+{
+
+ struct rtattr p;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_rtattr=yes
+else
+ ntp_cv_rtattr=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rtattr" >&5
+$as_echo "$ntp_cv_rtattr" >&6; }
+
+case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
+ *yes*)
+
+$as_echo "#define HAS_ROUTING_SOCKET 1" >>confdefs.h
+
+ case "$ntp_cv_rtattr" in
+ yes)
+
+$as_echo "#define HAVE_RTNETLINK 1" >>confdefs.h
+
+ esac
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sigaction for sa_sigaction" >&5
+$as_echo_n "checking struct sigaction for sa_sigaction... " >&6; }
+if ${ntp_cv_struct_sigaction_has_sa_sigaction+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <signal.h>
+
+int
+main ()
+{
+
+ struct sigaction act;
+ act.sa_sigaction = 0;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_sigaction_has_sa_sigaction=yes
+else
+ ntp_cv_struct_sigaction_has_sa_sigaction=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_sigaction_has_sa_sigaction" >&5
+$as_echo "$ntp_cv_struct_sigaction_has_sa_sigaction" >&6; }
+case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
+ yes)
+
+$as_echo "#define HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ppsclockev" >&5
+$as_echo_n "checking for struct ppsclockev... " >&6; }
+if ${ntp_cv_struct_ppsclockev+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TERMIOS_H
+ # include <sys/termios.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_SYS_PPSCLOCK_H
+ # include <sys/ppsclock.h>
+ #endif
+
+int
+main ()
+{
+
+ extern struct ppsclockev *pce;
+ return pce->serial;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_ppsclockev=yes
+else
+ ntp_cv_struct_ppsclockev=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ppsclockev" >&5
+$as_echo "$ntp_cv_struct_ppsclockev" >&6; }
+case "$ntp_cv_struct_ppsclockev" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_PPSCLOCKEV 1" >>confdefs.h
+
+esac
+
+case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
+ *yes*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct snd_size" >&5
+$as_echo_n "checking for struct snd_size... " >&6; }
+if ${ntp_cv_struct_snd_size+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_MACHINE_SOUNDCARD_H
+ # include <machine/soundcard.h>
+ #endif
+ #ifdef HAVE_SYS_SOUNDCARD_H
+ # include <sys/soundcard.h>
+ #endif
+
+int
+main ()
+{
+
+ extern struct snd_size *ss;
+ return ss->rec_size;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_snd_size=yes
+else
+ ntp_cv_struct_snd_size=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_snd_size" >&5
+$as_echo "$ntp_cv_struct_snd_size" >&6; }
+ case "$ntp_cv_struct_snd_size" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_SND_SIZE 1" >>confdefs.h
+
+ esac
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for hz" >&5
+$as_echo_n "checking struct clockinfo for hz... " >&6; }
+if ${ntp_cv_struct_clockinfo_has_hz+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+
+int
+main ()
+{
+
+ extern struct clockinfo *pc;
+ return pc->hz;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_clockinfo_has_hz=yes
+else
+ ntp_cv_struct_clockinfo_has_hz=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5
+$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; }
+case "$ntp_cv_struct_clockinfo_has_hz" in
+ yes)
+
+$as_echo "#define HAVE_HZ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct clockinfo for tickadj" >&5
+$as_echo_n "checking struct clockinfo for tickadj... " >&6; }
+if ${ntp_cv_struct_clockinfo_has_hz+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+
+int
+main ()
+{
+
+ extern struct clockinfo *pc;
+ return pc->tickadj;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_clockinfo_has_hz=yes
+else
+ ntp_cv_struct_clockinfo_has_hz=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_clockinfo_has_hz" >&5
+$as_echo "$ntp_cv_struct_clockinfo_has_hz" >&6; }
+case "$ntp_cv_struct_clockinfo_has_hz" in
+ yes)
+
+$as_echo "#define HAVE_TICKADJ_IN_STRUCT_CLOCKINFO 1" >>confdefs.h
+
+esac
+
+case "$ntp_cv_struct_ntptimeval" in
+ yes)
+ ac_fn_c_check_member "$LINENO" "struct ntptimeval" "time.tv_nsec" "ac_cv_member_struct_ntptimeval_time_tv_nsec" "
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #else
+ # ifdef HAVE_TIME_H
+ # include <time.h>
+ # endif
+ #endif
+ #ifdef HAVE_SYS_TIMEX_H
+ # include <sys/timex.h>
+ #else
+ # ifdef HAVE_TIMEX_H
+ # include <timex.h>
+ # endif
+ #endif
+
+
+"
+if test "x$ac_cv_member_struct_ntptimeval_time_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC 1
+_ACEOF
+
+
+fi
+
+esac
+
+####
+
+saved_LIBS="$LIBS"
+LIBS="$LIBS $LDADD_LIBNTP"
+for ac_func in daemon
+do :
+ ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon"
+if test "x$ac_cv_func_daemon" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DAEMON 1
+_ACEOF
+
+fi
+done
+
+# XXX if we keep everything in LIBS and also keep separate lists, this simplifies.
+LIBS="$saved_LIBS"
+{ saved_LIBS=; unset saved_LIBS;}
+
+for ac_func in finite
+do :
+ ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite"
+if test "x$ac_cv_func_finite" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_FINITE 1
+_ACEOF
+
+else
+ for ac_func in isfinite
+do :
+ ac_fn_c_check_func "$LINENO" "isfinite" "ac_cv_func_isfinite"
+if test "x$ac_cv_func_isfinite" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ISFINITE 1
+_ACEOF
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isfinite with <math.h>" >&5
+$as_echo_n "checking for isfinite with <math.h>... " >&6; }
+ _libs=$LIBS
+ # XXX
+ LIBS="$LIBS -lm"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <math.h>
+
+int
+main ()
+{
+
+ float f = 0.0;
+ isfinite(f);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ans=yes
+else
+ ans=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$_libs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+ case "$ans" in
+ yes)
+ $as_echo "#define HAVE_ISFINITE 1" >>confdefs.h
+
+ esac
+
+
+fi
+done
+
+
+fi
+done
+
+
+for ac_func in fnmatch getbootfile getuid getrusage nanosleep strsignal
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# kvm_open() is only used by tickadj. Also see above.
+case "$ac_cv_header_kvm_h" in
+ yes)
+ for ac_func in kvm_open
+do :
+ ac_fn_c_check_func "$LINENO" "kvm_open" "ac_cv_func_kvm_open"
+if test "x$ac_cv_func_kvm_open" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_KVM_OPEN 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+
+case "$host" in
+ *-*-sco3.2v5.0.*)
+ # Just stubs. Sigh.
+ ;;
+ *) for ac_func in mkstemp
+do :
+ ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp"
+if test "x$ac_cv_func_mkstemp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MKSTEMP 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+for ac_func in mktime
+do :
+ ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime"
+if test "x$ac_cv_func_mktime" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MKTIME 1
+_ACEOF
+
+fi
+done
+
+case "$host" in
+ *-*-aix[4-9]*)
+ # XXX only verified thru AIX6.
+ # Just a stub. Sigh.
+ ;;
+ *-*-irix[45]*)
+ # Just a stub in "old" Irix. Sigh.
+ ;;
+# In the belief that the fix for bug 1223 fixes mlockall() under linux...
+# *-*-*linux*)
+# # there, but more trouble than it is worth for now (resolver problems)
+# ;;
+ *-*-qnx*)
+ # Apparently there but not working in QNX. Sigh?
+ ;;
+ *-*-sco3.2v5.0.*)
+ # Just a stub. Sigh.
+ ;;
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ # mlockall is there, as a #define calling memlk via <sys/mman.h>
+ # Not easy to test for - cheat.
+ for ac_func in memlk
+do :
+ ac_fn_c_check_func "$LINENO" "memlk" "ac_cv_func_memlk"
+if test "x$ac_cv_func_memlk" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMLK 1
+_ACEOF
+ ac_cv_func_mlockall=yes
+fi
+done
+
+ for ac_func in mlockall
+do :
+ ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall"
+if test "x$ac_cv_func_mlockall" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MLOCKALL 1
+_ACEOF
+
+fi
+done
+
+ ;;
+ *) for ac_func in mlockall
+do :
+ ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall"
+if test "x$ac_cv_func_mlockall" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MLOCKALL 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+for ac_func in nice plock pututline pututxline readlink rtprio
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+case "$host" in
+ *-*-aix[4-9]*)
+ # XXX only verified thru AIX6.
+ # Just a stub in AIX 4. Sigh.
+ ;;
+ *-*-solaris2.5*)
+ # Just stubs in solaris2.5. Sigh.
+ ;;
+ *) for ac_func in sched_setscheduler
+do :
+ ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler"
+if test "x$ac_cv_func_sched_setscheduler" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SCHED_SETSCHEDULER 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+for ac_func in setlinebuf setpgid setpriority setsid setvbuf
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in strdup strerror setrlimit strchr
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+case "$host" in
+ *-*-aix[4-9]*)
+ # XXX only verified thru AIX6.
+ # Just stubs. Sigh.
+ ;;
+ *-*-netbsd1*)
+ # Just stubs. Sigh.
+ ;;
+ *-*-netbsdelf1*)
+ # Just stubs. Sigh.
+ ;;
+ *-*-openbsd*)
+ # Just stubs. Sigh.
+ ;;
+ *)
+ for ac_func in timer_create
+do :
+ ac_fn_c_check_func "$LINENO" "timer_create" "ac_cv_func_timer_create"
+if test "x$ac_cv_func_timer_create" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TIMER_CREATE 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_MEMLOCK" >&5
+$as_echo_n "checking for RLIMIT_MEMLOCK... " >&6; }
+if ${ntp_cv_rlimit_memlock+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_SYS_RESOURCE_H
+ # include <sys/resource.h>
+ #endif
+
+int
+main ()
+{
+
+ getrlimit(RLIMIT_MEMLOCK, 0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_rlimit_memlock=yes
+else
+ ntp_cv_rlimit_memlock=no
+
+fi
+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 "$ntp_cv_rlimit_memlock" in
+ yes)
+
+ HAVE_RLIMIT_MEMLOCK=" memlock 32"
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_STACK" >&5
+$as_echo_n "checking for RLIMIT_STACK... " >&6; }
+if ${ntp_cv_rlimit_stack+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_SYS_RESOURCE_H
+ # include <sys/resource.h>
+ #endif
+
+int
+main ()
+{
+
+ getrlimit(RLIMIT_STACK, 0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_rlimit_stack=yes
+else
+ ntp_cv_rlimit_stack=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_stack" >&5
+$as_echo "$ntp_cv_rlimit_stack" >&6; }
+case "$ntp_cv_rlimit_stack" in
+ yes)
+
+ 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; }
+
+# Check whether --with-stack-limit was given.
+if test "${with_stack_limit+set}" = set; then :
+ withval=$with_stack_limit; ans=$withval
+else
+ ans=yes
+
+fi
+
+case "$ans" in
+ yes | no)
+ case "$host" in
+ *-*-openbsd*)
+ ans=200
+ ;;
+ *) ans=50
+ ;;
+ esac
+ ;;
+ [1-9][0-9]*)
+ ;;
+ *) as_fn_error $? "\"--with-stack-limit requires an integer argument.\"" "$LINENO" 5
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DFLT_RLIMIT_STACK $ans
+_ACEOF
+
+
+# HMS: only if we have RLIMIT_MEMLOCK
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default number of megabytes to MEMLOCK" >&5
+$as_echo_n "checking for the default number of megabytes to MEMLOCK... " >&6; }
+
+# Check whether --with-memlock was given.
+if test "${with_memlock+set}" = set; then :
+ withval=$with_memlock; ans=$withval
+else
+ ans=yes
+
+fi
+
+case "$ans" in
+ yes | no)
+ ans=32
+ ;;
+ [1-9][0-9]*) ;;
+ *) as_fn_error $? "\"--with-memlock requires an integer argument.\"" "$LINENO" 5
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DFLT_RLIMIT_MEMLOCK $ans
+_ACEOF
+
+
+
+# some OSes prefer _exit() in forked children to exit()
+for ac_func in _exit
+do :
+ ac_fn_c_check_func "$LINENO" "_exit" "ac_cv_func__exit"
+if test "x$ac_cv_func__exit" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__EXIT 1
+_ACEOF
+
+fi
+done
+
+ntp_worker_child_exit=exit
+case "$ac_cv_func__exit::$host_os" in
+ yes::netbsd*)
+ ntp_worker_child_exit=_exit
+ ;;
+ yes::openbsd*)
+ ntp_worker_child_exit=_exit
+ ;;
+esac
+
+cat >>confdefs.h <<_ACEOF
+#define WORKER_CHILD_EXIT $ntp_worker_child_exit
+_ACEOF
+
+
+for ac_func in umask uname updwtmp updwtmpx
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+###
+
+# http://bugs.ntp.org/737
+case "$ac_cv_func_recvmsg" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need extra help to define struct iovec" >&5
+$as_echo_n "checking if we need extra help to define struct iovec... " >&6; }
+if ${ntp_cv_struct_iovec_help+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ compiled=no
+ for ntp_cv_struct_iovec_help in '0' '1'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #if $ntp_cv_struct_iovec_help
+ # include <sys/uio.h>
+ #endif
+
+int
+main ()
+{
+
+ void foo(void) {
+ ssize_t x;
+ int s = 0;
+ struct iovec iov;
+ struct msghdr mh;
+ int flags = 0;
+
+ mh.msg_iov = &iov;
+ x = recvmsg(s, &mh, flags);
+ }
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ compiled=yes ; break 1
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ case "$compiled" in
+ no)
+ ntp_cv_struct_iovec_help=0
+ esac
+ { compiled=; unset compiled;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_iovec_help" >&5
+$as_echo "$ntp_cv_struct_iovec_help" >&6; }
+ case "$ntp_cv_struct_iovec_help" in
+ 1)
+
+$as_echo "#define HAVE_SYS_UIO_H 1" >>confdefs.h
+
+ esac
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments taken by setpgrp()" >&5
+$as_echo_n "checking number of arguments taken by setpgrp()... " >&6; }
+if ${ntp_cv_func_setpgrp_nargs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+
+int
+main ()
+{
+
+ setpgrp(0, 0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_func_setpgrp_nargs=2
+else
+ ntp_cv_func_setpgrp_nargs=0
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_setpgrp_nargs" >&5
+$as_echo "$ntp_cv_func_setpgrp_nargs" >&6; }
+case "$ntp_cv_func_setpgrp_nargs" in
+ 0)
+
+$as_echo "#define HAVE_SETPGRP_0 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to declare 'errno'" >&5
+$as_echo_n "checking if we need to declare 'errno'... " >&6; }
+if ${ntp_cv_decl_errno+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+
+int
+main ()
+{
+
+ errno = 0;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_decl_errno=no
+else
+ ntp_cv_decl_errno=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_errno" >&5
+$as_echo "$ntp_cv_decl_errno" >&6; }
+case "$ntp_cv_decl_errno" in
+ yes)
+
+$as_echo "#define DECL_ERRNO 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we may declare 'h_errno'" >&5
+$as_echo_n "checking if we may declare 'h_errno'... " >&6; }
+if ${ntp_cv_decl_h_errno+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #ifdef HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+ #ifdef HAVE_RESOLV_H
+ # include <resolv.h>
+ #endif
+
+int
+main ()
+{
+
+ extern int h_errno;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_decl_h_errno=yes
+else
+ ntp_cv_decl_h_errno=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_h_errno" >&5
+$as_echo "$ntp_cv_decl_h_errno" >&6; }
+case "$ntp_cv_decl_h_errno" in
+ yes)
+
+$as_echo "#define DECL_H_ERRNO 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if declaring 'syscall()' is ok" >&5
+$as_echo_n "checking if declaring 'syscall()' is ok... " >&6; }
+if ${ntp_cv_decl_syscall+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+
+int
+main ()
+{
+
+ extern int syscall (int, ...);
+
+
+ ;
+ return 0;
+}
+ ntp_cv_decl_syscall=yes
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_decl_syscall=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_decl_syscall" >&5
+$as_echo "$ntp_cv_decl_syscall" >&6; }
+case "$ntp_cv_decl_syscall" in
+ yes)
+
+$as_echo "#define DECL_SYSCALL 1" >>confdefs.h
+
+esac
+
+case "$host" in
+ *-*-aix4.3.*)
+
+$as_echo "#define DECL_HSTRERROR_0 1" >>confdefs.h
+ # Needed for XLC under AIX 4.3.2
+ ;;
+ *-*-mpeix*)
+
+$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_INET_NTOA_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SELECT_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h
+
+ ;;
+ *-*-osf[45]*)
+
+$as_echo "#define DECL_PLOCK_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_STIME_1 1" >>confdefs.h
+
+ ;;
+ *-*-qnx*)
+
+$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h
+
+ ;;
+ *-*-riscos4*)
+
+$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_BZERO_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_IPC_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_MEMMOVE_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_RENAME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SELECT_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_STDIO_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_STRTOL_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TIME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TOLOWER_0 1" >>confdefs.h
+
+ ;;
+ *-*-solaris2*)
+
+$as_echo "#define DECL_MKSTEMP_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETPRIORITY_1 1" >>confdefs.h
+
+ case "$host" in
+ *-*-solaris2.4)
+
+$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h
+
+ ;;
+ esac
+ ;;
+ *-*-sunos4*)
+
+$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_BCOPY_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_BZERO_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_IPC_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_MEMMOVE_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_MKSTEMP_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_RENAME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SELECT_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SIGVEC_0 1" >>confdefs.h
+
+ case "`basename $ac_cv_prog_CC`" in
+ acc*) ;;
+ *)
+$as_echo "#define DECL_STDIO_0 1" >>confdefs.h
+
+ ;;
+ esac
+
+$as_echo "#define DECL_STRTOL_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TIME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TOLOWER_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TOUPPER_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_STRERROR_0 1" >>confdefs.h
+
+ ;;
+ *-*-ultrix4*)
+
+$as_echo "#define DECL_ADJTIME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_BZERO_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_CFSETISPEED_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_IOCTL_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_IPC_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_MKTEMP_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_NLIST_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_PLOCK_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SELECT_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETITIMER_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SETPRIORITY_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_STIME_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_SYSLOG_0 1" >>confdefs.h
+
+
+$as_echo "#define DECL_TIMEOFDAY_0 1" >>confdefs.h
+
+ ;;
+esac
+
+case "$host" in
+ *-*-sco3.2*)
+
+$as_echo "#define TERMIOS_NEEDS__SVID3 1" >>confdefs.h
+
+ ;;
+esac
+
+case "$host" in
+ *-*-hpux[567]*)
+
+$as_echo "#define NEED_RCVBUF_SLOP 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will open the broadcast socket" >&5
+$as_echo_n "checking if we will open the broadcast socket... " >&6; }
+if ${ntp_cv_var_open_bcast_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=yes
+ case "$host" in
+ *-*-domainos)
+ ans=no
+ esac
+ ntp_cv_var_open_bcast_socket=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_open_bcast_socket" >&5
+$as_echo "$ntp_cv_var_open_bcast_socket" >&6; }
+case "$ntp_cv_var_open_bcast_socket" in
+ yes)
+
+$as_echo "#define OPEN_BCAST_SOCKET 1" >>confdefs.h
+
+esac
+
+case "$host" in
+ *-*-hpux*)
+
+$as_echo "#define NEED_HPUX_FINDCONFIG 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if process groups are set with -pid" >&5
+$as_echo_n "checking if process groups are set with -pid... " >&6; }
+if ${ntp_cv_arg_setpgrp_negpid+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-*-hpux[567]*)
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=yes
+ ;;
+ *-*-*linux*)
+ ans=yes
+ ;;
+ *-*-sunos3*)
+ ans=yes
+ ;;
+ *-*-ultrix2*)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ntp_cv_arg_setpgrp_negpid=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_arg_setpgrp_negpid" >&5
+$as_echo "$ntp_cv_arg_setpgrp_negpid" >&6; }
+case "$ntp_cv_arg_setpgrp_negpid" in
+ yes)
+
+$as_echo "#define UDP_BACKWARDS_SETOWN 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need a ctty for F_SETOWN" >&5
+$as_echo_n "checking if we need a ctty for F_SETOWN... " >&6; }
+if ${ntp_cv_func_ctty_for_f_setown+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-*-bsdi[23]*)
+ ans=yes
+ ;;
+ *-*-freebsd*)
+ ans=yes
+ ;;
+ # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
+ # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
+ # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
+ # in $host may be followed by "aout", "ecoff", or "elf".
+ *-*-netbsd*[a-z]3.[0-8]*|*-*-netbsd*[a-z][0-2].*|*-*-netbsd*[a-z]3.99.[0-7])
+ ans=yes
+ ;;
+ *-*-netbsd3.[0-8]*|*-*-netbsd[0-2].*|*-*-netbsd3.99.[0-7])
+ ans=yes
+ ;;
+ *-*-openbsd*)
+ ans=yes
+ ;;
+ *-*-osf*)
+ ans=yes
+ ;;
+ *-*-darwin*)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ntp_cv_func_ctty_for_f_setown=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_ctty_for_f_setown" >&5
+$as_echo "$ntp_cv_func_ctty_for_f_setown" >&6; }
+case "$ntp_cv_func_ctty_for_f_setown" in
+ yes)
+
+$as_echo "#define USE_FSETOWNCTTY 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the OS clears cached routes when more specifics become available" >&5
+$as_echo_n "checking if the OS clears cached routes when more specifics become available... " >&6; }
+if ${ntp_cv_os_routeupdates+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-*-netbsd*)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ntp_cv_os_routeupdates=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_routeupdates" >&5
+$as_echo "$ntp_cv_os_routeupdates" >&6; }
+case "$ntp_cv_os_routeupdates" in
+ yes)
+
+$as_echo "#define OS_MISSES_SPECIFIC_ROUTE_UPDATES 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the wildcard socket needs REUSEADDR to bind other addresses" >&5
+$as_echo_n "checking if the wildcard socket needs REUSEADDR to bind other addresses... " >&6; }
+if ${ntp_cv_os_wildcardreuse+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-*-*linux*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+ esac
+ ntp_cv_os_wildcardreuse=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_os_wildcardreuse" >&5
+$as_echo "$ntp_cv_os_wildcardreuse" >&6; }
+case "$ntp_cv_os_wildcardreuse" in
+ yes)
+
+$as_echo "#define OS_NEEDS_REUSEADDR_FOR_IFADDRBIND 1" >>confdefs.h
+
+esac
+
+case "$host" in
+ *-*-aix*)
+
+$as_echo "#define NLIST_EXTRA_INDIRECTION 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a minimum recommended value of tickadj" >&5
+$as_echo_n "checking for a minimum recommended value of tickadj... " >&6; }
+if ${ntp_cv_var_min_rec_tickadj+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=no
+ case "$host" in
+ *-*-aix*)
+ ans=40
+ ;;
+ esac
+ ntp_cv_var_min_rec_tickadj=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_min_rec_tickadj" >&5
+$as_echo "$ntp_cv_var_min_rec_tickadj" >&6; }
+case "$ntp_cv_var_min_rec_tickadj" in
+ ''|no)
+ ;;
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define MIN_REC_TICKADJ $ntp_cv_var_min_rec_tickadj
+_ACEOF
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the TTY code permits PARENB and IGNPAR" >&5
+$as_echo_n "checking if the TTY code permits PARENB and IGNPAR... " >&6; }
+if ${ntp_cv_no_parenb_ignpar+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=no
+ case "$host" in
+ i?86-*-*linux*)
+ ans=yes
+ ;;
+ mips-sgi-irix*)
+ ans=yes
+ ;;
+ i?86-*-freebsd[123].*)
+ ;;
+ i?86-*-freebsd*)
+ ans=yes
+ ;;
+ *-*-unicosmp*)
+ ans=yes
+ ;;
+ esac
+ ntp_cv_no_parenb_ignpar=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_no_parenb_ignpar" >&5
+$as_echo "$ntp_cv_no_parenb_ignpar" >&6; }
+case "$ntp_cv_no_parenb_ignpar" in
+ yes)
+
+$as_echo "#define NO_PARENB_IGNPAR 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including processing time debugging code" >&5
+$as_echo_n "checking if we're including processing time debugging code... " >&6; }
+# Check whether --enable-debug-timing was given.
+if test "${enable_debug_timing+set}" = set; then :
+ enableval=$enable_debug_timing; ntp_ok=$enableval
+else
+ ntp_ok=no
+
+fi
+
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define DEBUG_TIMING 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a the number of minutes in a DST adjustment" >&5
+$as_echo_n "checking for a the number of minutes in a DST adjustment... " >&6; }
+# Check whether --enable-dst-minutes was given.
+if test "${enable_dst_minutes+set}" = set; then :
+ enableval=$enable_dst_minutes; ans=$enableval
+else
+ ans=60
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DSTMINUTES $ans
+_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpd will retry permanent DNS failures" >&5
+$as_echo_n "checking if ntpd will retry permanent DNS failures... " >&6; }
+# Check whether --enable-ignore-dns-errors was given.
+if test "${enable_ignore_dns_errors+set}" = set; then :
+ enableval=$enable_ignore_dns_errors; ans=$enableval
+else
+ ans=no
+
+fi
+
+case "$ans" in
+ yes)
+
+$as_echo "#define IGNORE_DNS_ERRORS 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking availability of ntp_{adj,get}time()" >&5
+$as_echo_n "checking availability of ntp_{adj,get}time()... " >&6; }
+if ${ntp_cv_var_ntp_syscalls+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ntp_cv_var_ntp_syscalls=no
+ case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
+ yesyes*)
+ ntp_cv_var_ntp_syscalls=libc
+ ;;
+ *yes)
+ ntp_cv_var_ntp_syscalls=inline
+ ;;
+ *)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/syscall.h>
+ #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_cv_var_ntp_syscalls=kernel
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_ntp_syscalls" >&5
+$as_echo "$ntp_cv_var_ntp_syscalls" >&6; }
+case "$ntp_cv_var_ntp_syscalls" in
+ libc)
+
+$as_echo "#define NTP_SYSCALLS_LIBC 1" >>confdefs.h
+
+ ;;
+ kernel)
+
+$as_echo "#define NTP_SYSCALLS_STD 1" >>confdefs.h
+
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sys/timex.h has STA_FLL" >&5
+$as_echo_n "checking if sys/timex.h has STA_FLL... " >&6; }
+if ${ntp_cv_var_sta_fll+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/timex.h>
+ #ifndef STA_FLL
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_cv_var_sta_fll=yes
+else
+ ntp_cv_var_sta_fll=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_sta_fll" >&5
+$as_echo "$ntp_cv_var_sta_fll" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have kernel PLL support" >&5
+$as_echo_n "checking if we have kernel PLL support... " >&6; }
+if ${ntp_cv_var_kernel_pll+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
+ *no*)
+ ntp_cv_var_kernel_pll=no
+ ;;
+ *) ntp_cv_var_kernel_pll=yes
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_var_kernel_pll" >&5
+$as_echo "$ntp_cv_var_kernel_pll" >&6; }
+case "$ntp_cv_var_kernel_pll" in
+ yes)
+
+$as_echo "#define KERNEL_PLL 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if SIOCGIFCONF returns buffer size in the buffer" >&5
+$as_echo_n "checking if SIOCGIFCONF returns buffer size in the buffer... " >&6; }
+if ${ntp_cv_size_returned_in_buffer+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=no
+ case "$host" in
+ *-fujitsu-uxp*)
+ ans=yes
+ ;;
+ *-ncr-sysv4*)
+ ans=yes
+ ;;
+ *-univel-sysv*)
+ ans=yes
+ ;;
+ esac
+ ntp_cv_size_returned_in_buffer=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_size_returned_in_buffer" >&5
+$as_echo "$ntp_cv_size_returned_in_buffer" >&6; }
+case "$ntp_cv_size_returned_in_buffer" in
+ yes)
+
+$as_echo "#define SIZE_RETURNED_IN_BUFFER 1" >>confdefs.h
+
+esac
+
+# Check for ioctls TIOCGPPSEV
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCGPPSEV" >&5
+$as_echo_n "checking for TTY PPS ioctl TIOCGPPSEV... " >&6; }
+case "$ac_cv_header_termios_h" in
+ yes)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <termios.h>
+ #ifndef TIOCGPPSEV
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_ok=yes
+else
+ ntp_ok=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define HAVE_TIOCGPPSEV 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+# Check for ioctls TIOCSPPS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl TIOCSPPS" >&5
+$as_echo_n "checking for TTY PPS ioctl TIOCSPPS... " >&6; }
+case "$ac_cv_header_termios_h" in
+ yes)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <termios.h>
+ #ifndef TIOCSPPS
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_ok=yes
+else
+ ntp_ok=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define HAVE_TIOCSPPS 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+# Check for ioctls CIOGETEV
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTY PPS ioctl CIOGETEV" >&5
+$as_echo_n "checking for TTY PPS ioctl CIOGETEV... " >&6; }
+case "$ac_cv_header_sys_ppsclock_h" in
+ yes)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/ppsclock.h>
+ #ifndef CIOGETEV
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_ok=yes
+else
+ ntp_ok=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define HAVE_CIOGETEV 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+# ATOM/PPSAPI stuff.
+
+ntp_atom_ok=yes
+
+# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
+
+# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
+# The PPSAPI needs struct timespec.
+# The PPSAPI also needs a timepps header.
+
+case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
+ inlineyes)
+ case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
+ *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
+
+$as_echo "#define HAVE_PPSAPI 1" >>confdefs.h
+
+ ntp_jupiter_ok=yes
+ ntp_oncore_ok=yes
+ ntp_parse_ok=yes
+ ntp_ripe_ncc_ok=yes
+ ;;
+ esac
+ ;;
+esac
+
+# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
+ac_fn_c_check_header_mongrel "$LINENO" "linux/serial.h" "ac_cv_header_linux_serial_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_serial_h" = xyes; then :
+
+fi
+
+
+case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
+ yesyes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG" >&5
+$as_echo_n "checking ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+ typedef int u_int;
+ #include <sys/ppsclock.h>
+ #include <linux/serial.h>
+
+ #ifndef TIOCGSERIAL
+ # error
+ #endif
+ #ifndef TIOCSSERIAL
+ # error
+ #endif
+ #ifndef ASYNC_PPS_CD_POS
+ # error
+ #endif
+ #ifndef ASYNC_PPS_CD_NEG
+ # error
+ #endif
+ #ifndef CIOGETEV
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_ok=yes
+else
+ ntp_ok=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define HAVE_TIO_SERIAL_STUFF 1" >>confdefs.h
+
+esac
+
+# Check for SHMEM_STATUS support
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SHMEM_STATUS support" >&5
+$as_echo_n "checking SHMEM_STATUS support... " >&6; }
+case "$ac_cv_header_sys_mman_h" in
+ yes)
+ ntp_ok=yes
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define ONCORE_SHMEM_STATUS 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+ntp_refclock=no
+
+# HPUX only, and by explicit request
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Datum/Bancomm bc635/VME interface" >&5
+$as_echo_n "checking Datum/Bancomm bc635/VME interface... " >&6; }
+# Check whether --enable-BANCOMM was given.
+if test "${enable_BANCOMM+set}" = set; then :
+ enableval=$enable_BANCOMM; ntp_ok=$enableval
+else
+ ntp_ok=no
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_BANC 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$host" in
+ yes*-*-hpux*) ;;
+ yes*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;;
+esac
+
+#HPUX only, and only by explicit request
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking TrueTime GPS receiver/VME interface" >&5
+$as_echo_n "checking TrueTime GPS receiver/VME interface... " >&6; }
+# Check whether --enable-GPSVME was given.
+if test "${enable_GPSVME+set}" = set; then :
+ enableval=$enable_GPSVME; ntp_ok=$enableval
+else
+ ntp_ok=no
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_GPSVME 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$host" in
+ yes*-*-hpux*) ;;
+ yes*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;} ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCL720 clock support" >&5
+$as_echo_n "checking for PCL720 clock support... " >&6; }
+case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
+ yesyesyes)
+
+$as_echo "#define CLOCK_PPS720 1" >>confdefs.h
+
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable non-PARSE clocks" >&5
+$as_echo_n "checking for default inclusion of all suitable non-PARSE clocks... " >&6; }
+# Check whether --enable-all-clocks was given.
+if test "${enable_all_clocks+set}" = set; then :
+ enableval=$enable_all_clocks; ntp_eac=$enableval
+else
+ ntp_eac=yes
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_eac" >&5
+$as_echo "$ntp_eac" >&6; }
+
+# HMS: Should we also require ntp_parse_ok?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for PARSE clocks" >&5
+$as_echo_n "checking if we have support for PARSE clocks... " >&6; }
+case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
+ yes*yes*)
+ ntp_canparse=yes
+ ;;
+ *) ntp_canparse=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canparse" >&5
+$as_echo "$ntp_canparse" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for audio clocks" >&5
+$as_echo_n "checking if we have support for audio clocks... " >&6; }
+case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
+ *yes*)
+ ntp_canaudio=yes
+
+$as_echo "#define HAVE_AUDIO /**/" >>confdefs.h
+
+ ;;
+ *) ntp_canaudio=no ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canaudio" >&5
+$as_echo "$ntp_canaudio" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have support for the SHM refclock interface" >&5
+$as_echo_n "checking if we have support for the SHM refclock interface... " >&6; }
+case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
+ yesyes)
+ ntp_canshm=yes
+ ;;
+ *) ntp_canshm=no ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_canshm" >&5
+$as_echo "$ntp_canshm" >&6; }
+
+# Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for termios modem control" >&5
+$as_echo_n "checking for termios modem control... " >&6; }
+if ${ntp_cv_modem_control+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ #ifdef HAVE_TERMIOS_H
+ # include <termios.h>
+ #endif
+ #ifdef HAVE_SYS_IOCTL_H
+ # include <sys/ioctl.h>
+ #endif
+
+int
+main ()
+{
+
+ int dtr = TIOCM_DTR;
+
+ ioctl(1, TIOCMBIS, (char *)&dtr);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_modem_control=yes
+else
+ ntp_cv_modem_control=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_modem_control" >&5
+$as_echo "$ntp_cv_modem_control" >&6; }
+case "$ntp_eac::$ntp_cv_modem_control" in
+ yes::yes)
+ ntp_enable_all_modem_control_clocks=yes
+ ;;
+ *)
+ ntp_enable_all_modem_control_clocks=no
+ ;;
+esac
+
+# Requires modem control
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ACTS modem service" >&5
+$as_echo_n "checking ACTS modem service... " >&6; }
+# Check whether --enable-ACTS was given.
+if test "${enable_ACTS+set}" = set; then :
+ enableval=$enable_ACTS; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_enable_all_modem_control_clocks
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_ACTS 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Arbiter 1088A/B GPS receiver" >&5
+$as_echo_n "checking Arbiter 1088A/B GPS receiver... " >&6; }
+# Check whether --enable-ARBITER was given.
+if test "${enable_ARBITER+set}" = set; then :
+ enableval=$enable_ARBITER; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_ARBITER 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Arcron MSF receiver" >&5
+$as_echo_n "checking Arcron MSF receiver... " >&6; }
+# Check whether --enable-ARCRON_MSF was given.
+if test "${enable_ARCRON_MSF+set}" = set; then :
+ enableval=$enable_ARCRON_MSF; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_ARCRON_MSF 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Austron 2200A/2201A GPS receiver" >&5
+$as_echo_n "checking Austron 2200A/2201A GPS receiver... " >&6; }
+# Check whether --enable-AS2201 was given.
+if test "${enable_AS2201+set}" = set; then :
+ enableval=$enable_AS2201; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_AS2201 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ATOM PPS interface" >&5
+$as_echo_n "checking ATOM PPS interface... " >&6; }
+# Check whether --enable-ATOM was given.
+if test "${enable_ATOM+set}" = set; then :
+ enableval=$enable_ATOM; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_atom_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_ATOM 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Chrono-log K-series WWVB receiver" >&5
+$as_echo_n "checking Chrono-log K-series WWVB receiver... " >&6; }
+# Check whether --enable-CHRONOLOG was given.
+if test "${enable_CHRONOLOG+set}" = set; then :
+ enableval=$enable_CHRONOLOG; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_CHRONOLOG 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CHU modem/decoder" >&5
+$as_echo_n "checking CHU modem/decoder... " >&6; }
+# Check whether --enable-CHU was given.
+if test "${enable_CHU+set}" = set; then :
+ enableval=$enable_CHU; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_CHU 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+ntp_refclock_chu=$ntp_ok
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CHU audio/decoder" >&5
+$as_echo_n "checking CHU audio/decoder... " >&6; }
+# Check whether --enable-AUDIO-CHU was given.
+if test "${enable_AUDIO_CHU+set}" = set; then :
+ enableval=$enable_AUDIO_CHU; ntp_ok=$enableval
+else
+
+ case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+# We used to check for sunos/solaris target...
+case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
+ yes*no*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is...no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is...no ***" >&2;}
+esac
+
+# Not under HP-UX
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Datum Programmable Time System" >&5
+$as_echo_n "checking Datum Programmable Time System... " >&6; }
+# Check whether --enable-DATUM was given.
+if test "${enable_DATUM+set}" = set; then :
+ enableval=$enable_DATUM; ntp_ok=$enableval
+else
+
+ case "$ac_cv_header_termios_h" in
+ yes)
+ ntp_ok=$ntp_eac
+ ;;
+ *) ntp_ok=no
+ ;;
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_DATUM 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Dumb generic hh:mm:ss local clock" >&5
+$as_echo_n "checking Dumb generic hh:mm:ss local clock... " >&6; }
+# Check whether --enable-DUMBCLOCK was given.
+if test "${enable_DUMBCLOCK+set}" = set; then :
+ enableval=$enable_DUMBCLOCK; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_DUMBCLOCK 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Forum Graphic GPS" >&5
+$as_echo_n "checking Forum Graphic GPS... " >&6; }
+# Check whether --enable-FG was given.
+if test "${enable_FG+set}" = set; then :
+ enableval=$enable_FG; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_FG 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+# Requires modem control
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Heath GC-1000 WWV/WWVH receiver" >&5
+$as_echo_n "checking Heath GC-1000 WWV/WWVH receiver... " >&6; }
+# Check whether --enable-HEATH was given.
+if test "${enable_HEATH+set}" = set; then :
+ enableval=$enable_HEATH; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_enable_all_modem_control_clocks
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_HEATH 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hopf serial clock device" >&5
+$as_echo_n "checking for hopf serial clock device... " >&6; }
+# Check whether --enable-HOPFSERIAL was given.
+if test "${enable_HOPFSERIAL+set}" = set; then :
+ enableval=$enable_HOPFSERIAL; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_HOPF_SERIAL 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hopf PCI clock 6039" >&5
+$as_echo_n "checking for hopf PCI clock 6039... " >&6; }
+# Check whether --enable-HOPFPCI was given.
+if test "${enable_HOPFPCI+set}" = set; then :
+ enableval=$enable_HOPFPCI; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_HOPF_PCI 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking HP 58503A GPS receiver" >&5
+$as_echo_n "checking HP 58503A GPS receiver... " >&6; }
+# Check whether --enable-HPGPS was given.
+if test "${enable_HPGPS+set}" = set; then :
+ enableval=$enable_HPGPS; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_HPGPS 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking IRIG audio decoder" >&5
+$as_echo_n "checking IRIG audio decoder... " >&6; }
+# Check whether --enable-IRIG was given.
+if test "${enable_IRIG+set}" = set; then :
+ enableval=$enable_IRIG; ntp_ok=$enableval
+else
+
+ case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_IRIG 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canaudio" in
+ yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JJY receiver" >&5
+$as_echo_n "checking for JJY receiver... " >&6; }
+# Check whether --enable-JJY was given.
+if test "${enable_JJY+set}" = set; then :
+ enableval=$enable_JJY; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_JJY 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Rockwell Jupiter GPS receiver" >&5
+$as_echo_n "checking Rockwell Jupiter GPS receiver... " >&6; }
+# Check whether --enable-JUPITER was given.
+if test "${enable_JUPITER+set}" = set; then :
+ enableval=$enable_JUPITER; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+fi
+
+case "$ntp_jupiter_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_JUPITER 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Leitch CSD 5300 Master Clock System Driver" >&5
+$as_echo_n "checking Leitch CSD 5300 Master Clock System Driver... " >&6; }
+# Check whether --enable-LEITCH was given.
+if test "${enable_LEITCH+set}" = set; then :
+ enableval=$enable_LEITCH; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_LEITCH 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking local clock reference" >&5
+$as_echo_n "checking local clock reference... " >&6; }
+# Check whether --enable-LOCAL-CLOCK was given.
+if test "${enable_LOCAL_CLOCK+set}" = set; then :
+ enableval=$enable_LOCAL_CLOCK; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_LOCAL 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+
+# Not Ultrix
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Magnavox MX4200 GPS receiver" >&5
+$as_echo_n "checking Magnavox MX4200 GPS receiver... " >&6; }
+# Check whether --enable-MX4200 was given.
+if test "${enable_MX4200+set}" = set; then :
+ enableval=$enable_MX4200; ntp_ok=$enableval
+else
+
+ case "$ac_cv_var_ppsclock" in
+ yes)
+ ntp_ok=$ntp_eac
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_MX4200 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$host" in
+ yes*-*-ultrix*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NeoClock4X receiver" >&5
+$as_echo_n "checking for NeoClock4X receiver... " >&6; }
+# Check whether --enable-NEOCLOCK4X was given.
+if test "${enable_NEOCLOCK4X+set}" = set; then :
+ enableval=$enable_NEOCLOCK4X; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_NEOCLOCK4X 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking NMEA GPS receiver" >&5
+$as_echo_n "checking NMEA GPS receiver... " >&6; }
+# Check whether --enable-NMEA was given.
+if test "${enable_NMEA+set}" = set; then :
+ enableval=$enable_NMEA; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_NMEA 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPSD JSON receiver" >&5
+$as_echo_n "checking for GPSD JSON receiver... " >&6; }
+# Check whether --enable-GPSD was given.
+if test "${enable_GPSD+set}" = set; then :
+ enableval=$enable_GPSD; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_GPSDJSON 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ONCORE Motorola VP/UT Oncore GPS" >&5
+$as_echo_n "checking for ONCORE Motorola VP/UT Oncore GPS... " >&6; }
+# Check whether --enable-ONCORE was given.
+if test "${enable_ONCORE+set}" = set; then :
+ enableval=$enable_ONCORE; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_oncore_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_ONCORE 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+# Requires modem control
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Palisade clock" >&5
+$as_echo_n "checking for Palisade clock... " >&6; }
+# Check whether --enable-PALISADE was given.
+if test "${enable_PALISADE+set}" = set; then :
+ enableval=$enable_PALISADE; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_enable_all_modem_control_clocks
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_PALISADE 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Conrad parallel port radio clock" >&5
+$as_echo_n "checking Conrad parallel port radio clock... " >&6; }
+# Check whether --enable-PCF was given.
+if test "${enable_PCF+set}" = set; then :
+ enableval=$enable_PCF; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_PCF 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PST/Traconex 1020 WWV/WWVH receiver" >&5
+$as_echo_n "checking PST/Traconex 1020 WWV/WWVH receiver... " >&6; }
+# Check whether --enable-PST was given.
+if test "${enable_PST+set}" = set; then :
+ enableval=$enable_PST; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_PST 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RIPENCC specific Trimble driver" >&5
+$as_echo_n "checking RIPENCC specific Trimble driver... " >&6; }
+# Check whether --enable-RIPENCC was given.
+if test "${enable_RIPENCC+set}" = set; then :
+ enableval=$enable_RIPENCC; ntp_ok=$enableval
+else
+ ntp_ok=no
+
+fi
+
+# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
+case "$ntp_ripe_ncc_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_RIPENCC /**/" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+# Danny Meyer says SHM compiles (with a few warnings) under Win32.
+# For *IX, we need sys/ipc.h and sys/shm.h.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHM clock attached thru shared memory" >&5
+$as_echo_n "checking for SHM clock attached thru shared memory... " >&6; }
+# Check whether --enable-SHM was given.
+if test "${enable_SHM+set}" = set; then :
+ enableval=$enable_SHM; ntp_ok=$enableval
+else
+
+ case "$ntp_eac$ntp_canshm" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_SHM 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Spectracom 8170/Netclock/2 WWVB receiver" >&5
+$as_echo_n "checking Spectracom 8170/Netclock/2 WWVB receiver... " >&6; }
+# Check whether --enable-SPECTRACOM was given.
+if test "${enable_SPECTRACOM+set}" = set; then :
+ enableval=$enable_SPECTRACOM; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_SPECTRACOM 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking KSI/Odetics TPRO/S GPS receiver/IRIG interface" >&5
+$as_echo_n "checking KSI/Odetics TPRO/S GPS receiver/IRIG interface... " >&6; }
+# Check whether --enable-TPRO was given.
+if test "${enable_TPRO+set}" = set; then :
+ enableval=$enable_TPRO; ntp_ok=$enableval
+else
+
+ case "$ac_cv_header_sys_tpro_h" in
+ yes)
+ ntp_ok=$ntp_eac
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_TPRO 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ac_cv_header_sys_tpro" in
+ yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
+esac
+
+# Not on a vax-dec-bsd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Kinemetrics/TrueTime receivers" >&5
+$as_echo_n "checking Kinemetrics/TrueTime receivers... " >&6; }
+# Check whether --enable-TRUETIME was given.
+if test "${enable_TRUETIME+set}" = set; then :
+ enableval=$enable_TRUETIME; ntp_ok=$enableval
+else
+
+ case "$host" in
+ vax-dec-bsd)
+ ntp_ok=no
+ ;;
+ *)
+ ntp_ok=$ntp_eac
+ ;;
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_TRUETIME 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$host" in
+ yesvax-dec-bsd) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking TrueTime 560 IRIG-B decoder" >&5
+$as_echo_n "checking TrueTime 560 IRIG-B decoder... " >&6; }
+# Check whether --enable-TT560 was given.
+if test "${enable_TT560+set}" = set; then :
+ enableval=$enable_TT560; ntp_ok=$enableval
+else
+ ntp_ok=no
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_TT560 /**/" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ultralink M320 WWVB receiver" >&5
+$as_echo_n "checking Ultralink M320 WWVB receiver... " >&6; }
+# Check whether --enable-ULINK was given.
+if test "${enable_ULINK+set}" = set; then :
+ enableval=$enable_ULINK; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_ULINK 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Spectracom TSYNC PCI timing board" >&5
+$as_echo_n "checking Spectracom TSYNC PCI timing board... " >&6; }
+# Check whether --enable-TSYNCPCI was given.
+if test "${enable_TSYNCPCI+set}" = set; then :
+ enableval=$enable_TSYNCPCI; ntp_ok=$enableval
+else
+
+ case "$host" in
+ *-*-*linux*)
+ ntp_ok=$ntp_eac
+ ;;
+ *)
+ ntp_ok=no
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_TSYNCPCI 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking WWV receiver" >&5
+$as_echo_n "checking WWV receiver... " >&6; }
+# Check whether --enable-WWV was given.
+if test "${enable_WWV+set}" = set; then :
+ enableval=$enable_WWV; ntp_ok=$enableval
+else
+
+ case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_WWV 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canaudio" in
+ yesno) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** But the expected answer is... no ***" >&5
+$as_echo "$as_me: WARNING: *** But the expected answer is... no ***" >&2;}
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Zyfer receiver" >&5
+$as_echo_n "checking for Zyfer receiver... " >&6; }
+# Check whether --enable-ZYFER was given.
+if test "${enable_ZYFER+set}" = set; then :
+ enableval=$enable_ZYFER; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_ZYFER 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default inclusion of all suitable PARSE clocks" >&5
+$as_echo_n "checking for default inclusion of all suitable PARSE clocks... " >&6; }
+# Check whether --enable-parse-clocks was given.
+if test "${enable_parse_clocks+set}" = set; then :
+ enableval=$enable_parse_clocks; ntp_eapc=$enableval
+else
+
+ case "$ntp_eac" in
+ yes) ntp_eapc=$ntp_canparse ;;
+ *) ntp_eapc=no ;;
+ esac
+ # Delete the next line one of these days
+ ntp_eapc=no
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_eapc" >&5
+$as_echo "$ntp_eapc" >&6; }
+
+case "$ntp_eac$ntp_eapc$ntp_canparse" in
+ noyes*)
+ as_fn_error $? "\"--enable-parse-clocks\" requires \"--enable-all-clocks\"." "$LINENO" 5
+ ;;
+ yesyesno)
+ as_fn_error $? "You said \"--enable-parse-clocks\" but PARSE isn't supported on this platform!" "$LINENO" 5
+ ;;
+esac
+
+ntp_libparse=no
+ntp_parseutil=no
+ntp_rawdcf=no
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Diem Computime Radio Clock" >&5
+$as_echo_n "checking Diem Computime Radio Clock... " >&6; }
+# Check whether --enable-COMPUTIME was given.
+if test "${enable_COMPUTIME+set}" = set; then :
+ enableval=$enable_COMPUTIME; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_COMPUTIME 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ELV/DCF7000 clock" >&5
+$as_echo_n "checking ELV/DCF7000 clock... " >&6; }
+# Check whether --enable-DCF7000 was given.
+if test "${enable_DCF7000+set}" = set; then :
+ enableval=$enable_DCF7000; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_DCF7000 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking HOPF 6021 clock" >&5
+$as_echo_n "checking HOPF 6021 clock... " >&6; }
+# Check whether --enable-HOPF6021 was given.
+if test "${enable_HOPF6021+set}" = set; then :
+ enableval=$enable_HOPF6021; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_HOPF6021 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Meinberg clocks" >&5
+$as_echo_n "checking Meinberg clocks... " >&6; }
+# Check whether --enable-MEINBERG was given.
+if test "${enable_MEINBERG+set}" = set; then :
+ enableval=$enable_MEINBERG; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_MEINBERG 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking DCF77 raw time code" >&5
+$as_echo_n "checking DCF77 raw time code... " >&6; }
+# Check whether --enable-RAWDCF was given.
+if test "${enable_RAWDCF+set}" = set; then :
+ enableval=$enable_RAWDCF; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_parseutil=yes
+ ntp_refclock=yes
+ ntp_rawdcf=yes
+
+$as_echo "#define CLOCK_RAWDCF 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+case "$ntp_rawdcf" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we must enable parity for RAWDCF" >&5
+$as_echo_n "checking if we must enable parity for RAWDCF... " >&6; }
+if ${ntp_cv_rawdcf_parity+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=no
+ case "$host" in
+ *-*-*linux*)
+ ans=yes
+ ;;
+ esac
+ ntp_cv_rawdcf_parity=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rawdcf_parity" >&5
+$as_echo "$ntp_cv_rawdcf_parity" >&6; }
+ case "$ntp_cv_rawdcf_parity" in
+ yes)
+
+$as_echo "#define RAWDCF_NO_IGNPAR 1" >>confdefs.h
+ ;;
+ esac
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RCC 8000 clock" >&5
+$as_echo_n "checking RCC 8000 clock... " >&6; }
+# Check whether --enable-RCC8000 was given.
+if test "${enable_RCC8000+set}" = set; then :
+ enableval=$enable_RCC8000; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_RCC8000 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Schmid DCF77 clock" >&5
+$as_echo_n "checking Schmid DCF77 clock... " >&6; }
+# Check whether --enable-SCHMID was given.
+if test "${enable_SCHMID+set}" = set; then :
+ enableval=$enable_SCHMID; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_SCHMID 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TAIP protocol" >&5
+$as_echo_n "checking Trimble GPS receiver/TAIP protocol... " >&6; }
+# Check whether --enable-TRIMTAIP was given.
+if test "${enable_TRIMTAIP+set}" = set; then :
+ enableval=$enable_TRIMTAIP; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_TRIMTAIP 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Trimble GPS receiver/TSIP protocol" >&5
+$as_echo_n "checking Trimble GPS receiver/TSIP protocol... " >&6; }
+# Check whether --enable-TRIMTSIP was given.
+if test "${enable_TRIMTSIP+set}" = set; then :
+ enableval=$enable_TRIMTSIP; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_TRIMTSIP 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking WHARTON 400A Series clock" >&5
+$as_echo_n "checking WHARTON 400A Series clock... " >&6; }
+# Check whether --enable-WHARTON was given.
+if test "${enable_WHARTON+set}" = set; then :
+ enableval=$enable_WHARTON; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_WHARTON_400A 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking VARITEXT clock" >&5
+$as_echo_n "checking VARITEXT clock... " >&6; }
+# Check whether --enable-VARITEXT was given.
+if test "${enable_VARITEXT+set}" = set; then :
+ enableval=$enable_VARITEXT; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+
+fi
+
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_VARITEXT 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SEL240X clock" >&5
+$as_echo_n "checking SEL240X clock... " >&6; }
+# Check whether --enable-SEL240X was given.
+if test "${enable_SEL240X+set}" = set; then :
+ enableval=$enable_SEL240X; ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eapc
+fi
+
+if test "$ntp_ok" = "yes"; then
+ ntp_libparse=yes
+ ntp_refclock=yes
+
+$as_echo "#define CLOCK_SEL240X 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ as_fn_error $? "That's a parse clock and this system doesn't support it!" "$LINENO" 5
+ ;;
+esac
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to make and use the parse libraries" >&5
+$as_echo_n "checking if we need to make and use the parse libraries... " >&6; }
+ans=no
+case "$ntp_libparse" in
+ yes)
+ ans=yes
+
+$as_echo "#define CLOCK_PARSE 1" >>confdefs.h
+
+ LIBPARSE=../libparse/libparse.a
+ MAKE_LIBPARSE=libparse.a
+ # HMS: check_y2k trips the 34 year problem now...
+ false && MAKE_CHECK_Y2K=check_y2k
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+
+
+ntp_pkgconfig_min_version='0.15.0'
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+{ ac_cv_path_PKG_CONFIG=; unset ac_cv_path_PKG_CONFIG;}
+{ ac_cv_path_ac_pt_PKG_CONFIG=; unset ac_cv_path_ac_pt_PKG_CONFIG;}
+
+case "$PKG_CONFIG" in
+ /*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5
+$as_echo_n "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+ ;;
+esac
+
+
+
+
+
+VER_SUFFIX=
+
+
+
+
+# Check whether --with-crypto was given.
+if test "${with_crypto+set}" = set; then :
+ withval=$with_crypto;
+fi
+
+
+# Check whether --with-openssl-libdir was given.
+if test "${with_openssl_libdir+set}" = set; then :
+ withval=$with_openssl_libdir;
+fi
+
+
+# Check whether --with-openssl-incdir was given.
+if test "${with_openssl_incdir+set}" = set; then :
+ withval=$with_openssl_incdir;
+fi
+
+
+# Check whether --with-rpath was given.
+if test "${with_rpath+set}" = set; then :
+ withval=$with_rpath;
+fi
+
+ntp_openssl=no
+ntp_openssl_from_pkg_config=no
+with_crypto=${with_crypto:-openssl,libcrypto}
+case "$with_crypto" in
+ yes)
+ with_crypto=openssl,libcrypto
+esac
+case "$with_crypto:${PKG_CONFIG:+notempty}:${with_openssl_libdir-notgiven}:${with_openssl_incdir-notgiven}" in
+ no:*) ;;
+ *:notempty:notgiven:notgiven)
+ for pkg in `echo $with_crypto | sed -e 's/,/ /'`; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config for $pkg" >&5
+$as_echo_n "checking pkg-config for $pkg... " >&6; }
+ if $PKG_CONFIG --exists $pkg ; then
+ CPPFLAGS_NTP="$CPPFLAGS_NTP `$PKG_CONFIG --cflags-only-I $pkg`"
+ CFLAGS_NTP="$CFLAGS_NTP `$PKG_CONFIG --cflags-only-other $pkg`"
+ LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-L $pkg`"
+ LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-l $pkg`"
+ LDFLAGS_NTP="$LDFLAGS_NTP `$PKG_CONFIG --libs-only-other $pkg`"
+ VER_SUFFIX=o
+ ntp_openssl=yes
+ ntp_openssl_from_pkg_config=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ break
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ done
+esac
+case "$with_crypto:$ntp_openssl" in
+ no:*) ;;
+ *:no)
+ need_dash_r=
+ need_dash_Wlrpath=
+ case "${with_rpath-notgiven}" in
+ yes)
+ # Lame - what to do if we need -Wl... but not -R?
+ need_dash_r=1
+ ;;
+ notgiven)
+ case "$host" in
+ *-*-linux*)
+ # This may really only be true for gcc
+ need_dash_Wlrpath=1
+ ;;
+ *-*-netbsd*)
+ need_dash_r=1
+ ;;
+ *-*-solaris*)
+ need_dash_r=1
+ ;;
+ esac
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5
+$as_echo_n "checking for openssl library directory... " >&6; }
+ with_openssl_libdir=${with_openssl_libdir-notgiven}
+ case "$with_openssl_libdir" in
+ notgiven)
+ case "$build" in
+ $host)
+ with_openssl_libdir=default
+ ;;
+ *)
+ with_openssl_libdir=no
+ ;;
+ esac
+ esac
+ case "$with_openssl_libdir" in
+ default)
+ # Look in:
+ with_openssl_libdir="/usr/lib /usr/lib/openssl /usr/sfw/lib"
+ with_openssl_libdir="$with_openssl_libdir /usr/local/lib"
+ with_openssl_libdir="$with_openssl_libdir /usr/local/ssl/lib /lib"
+ esac
+ case "$with_openssl_libdir" in
+ no)
+ ;;
+ *) # Look for libcrypto.a and libssl.a:
+ for i in $with_openssl_libdir no
+ do
+ case "$host" in
+ *-*-darwin*)
+ test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
+ ;;
+ *)
+ test -f $i/libcrypto.so -a -f $i/libssl.so && break
+ test -f $i/libcrypto.a -a -f $i/libssl.a && break
+ ;;
+ esac
+ done
+ openssl_libdir=$i
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_libdir" >&5
+$as_echo "$openssl_libdir" >&6; }
+ case "$openssl_libdir" in
+ no)
+ openssl_libdir=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&5
+$as_echo "$as_me: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&2;}
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5
+$as_echo_n "checking for openssl include directory... " >&6; }
+ with_openssl_incdir=${with_openssl_incdir-notgiven}
+ case "$with_openssl_incdir" in
+ notgiven)
+ # Look in:
+ with_openssl_incdir="/usr/include /usr/sfw/include"
+ with_openssl_incdir="$with_openssl_incdir /usr/local/include"
+ with_openssl_incdir="$with_openssl_incdir /usr/local/ssl/include"
+ esac
+ case "$with_openssl_incdir" in
+ no)
+ ;;
+ *) # look for openssl/evp.h:
+ for i in $with_openssl_incdir no
+ do
+ test -f $i/openssl/evp.h && break
+ done
+ openssl_incdir=$i
+ ;;
+ esac
+ { i=; unset i;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_incdir" >&5
+$as_echo "$openssl_incdir" >&6; }
+ case "$openssl_incdir" in
+ no)
+ openssl_incdir=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&5
+$as_echo "$as_me: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&2;}
+ esac
+ if test -z "$openssl_libdir" -o -z "$openssl_incdir"
+ then
+ ntp_openssl=no
+ else
+ ntp_openssl=yes
+ VER_SUFFIX=o
+ fi
+ case "$ntp_openssl" in
+ yes)
+ # We have OpenSSL inc/lib dirs - use them.
+ case "$openssl_incdir" in
+ /usr/include)
+ ;;
+ *)
+ CPPFLAGS_NTP="$CPPFLAGS_NTP -I$openssl_incdir"
+ ;;
+ esac
+ case "$openssl_libdir" in
+ /usr/lib)
+ ;;
+ *)
+ LDADD_NTP="$LDADD_NTP -L$openssl_libdir"
+ case "$need_dash_r" in
+ 1)
+ LDFLAGS_NTP="$LDFLAGS_NTP -R$openssl_libdir"
+ esac
+ case "$need_dash_Wlrpath" in
+ 1)
+ LDFLAGS_NTP="$LDFLAGS_NTP -Wl,-rpath,$openssl_libdir"
+ esac
+ ;;
+ esac
+ LDADD_NTP="$LDADD_NTP -lcrypto"
+ esac
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5
+$as_echo_n "checking if we will use crypto... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_openssl" >&5
+$as_echo "$ntp_openssl" >&6; }
+
+case "$ntp_openssl" in
+ yes)
+
+$as_echo "#define OPENSSL /**/" >>confdefs.h
+
+ case "$VER_SUFFIX" in
+ *o*) ;;
+ *) as_fn_error $? "OPENSSL set but no 'o' in VER_SUFFIX!" "$LINENO" 5 ;;
+ esac
+ ;;
+esac
+
+NTPO_SAVED_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $CPPFLAGS_NTP"
+NTPO_SAVED_LIBS="$LIBS"
+
+#
+# check for linking with -lcrypto failure, and try -lcrypto -lz.
+# Helps m68k-atari-mint
+#
+case "$ntp_openssl:$ntp_openssl_from_pkg_config" in
+ yes:no)
+ LIBS="$NTPO_SAVED_LIBS $LDADD_NTP"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto alone works" >&5
+$as_echo_n "checking if linking with -lcrypto alone works... " >&6; }
+if ${ntp_cv_bare_lcrypto+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+
+int
+main ()
+{
+
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_cv_bare_lcrypto=yes
+else
+ ntp_cv_bare_lcrypto=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_bare_lcrypto" >&5
+$as_echo "$ntp_cv_bare_lcrypto" >&6; }
+ case "$ntp_cv_bare_lcrypto" in
+ no)
+ LIBS="$NTPO_SAVED_LIBS $LDADD_NTP -lz"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto -lz works" >&5
+$as_echo_n "checking if linking with -lcrypto -lz works... " >&6; }
+if ${ntp_cv_lcrypto_lz+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+
+int
+main ()
+{
+
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_cv_lcrypto_lz=yes
+else
+ ntp_cv_lcrypto_lz=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_lcrypto_lz" >&5
+$as_echo "$ntp_cv_lcrypto_lz" >&6; }
+ case "$ntp_cv_lcrypto_lz" in
+ yes)
+ LDADD_NTP="$LDADD_NTP -lz"
+ esac
+ esac
+esac
+
+#
+# Older OpenSSL headers have a number of callback prototypes inside
+# other function prototypes which trigger copious warnings with gcc's
+# -Wstrict-prototypes, which is included in -Wall.
+#
+# An example:
+#
+# int i2d_RSA_NET(const RSA *a, unsigned char **pp,
+# int (*cb)(), int sgckey);
+# ^^^^^^^^^^^
+#
+#
+#
+openssl_triggers_warnings=unknown
+NTPO_SAVED_CFLAGS="$CFLAGS"
+
+case "$ntp_openssl:$GCC" in
+ yes:yes)
+ CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+
+ /* see if -Werror breaks gcc */
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_handles_Werror=yes
+else
+ gcc_handles_Werror=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ case "$gcc_handles_Werror" in
+ no)
+ # if this gcc doesn't do -Werror go ahead and use
+ # -Wstrict-prototypes.
+ openssl_triggers_warnings=yes
+ ;;
+ yes)
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include "openssl/asn1_mac.h"
+ #include "openssl/bn.h"
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+ #include "openssl/pem.h"
+ #include "openssl/rand.h"
+ #include "openssl/x509v3.h"
+
+int
+main ()
+{
+
+ /* empty body */
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ openssl_triggers_warnings=no
+else
+ openssl_triggers_warnings=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ esac
+ case "$openssl_triggers_warnings" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Wno-strict-prototypes"
+ ;;
+ *)
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes"
+ esac
+ ;;
+ no:yes)
+ # gcc without OpenSSL
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes"
+esac
+
+CFLAGS="$NTPO_SAVED_CFLAGS"
+CPPFLAGS="$NTPO_SAVED_CPPFLAGS"
+LIBS="$NTPO_SAVED_LIBS"
+{ NTPO_SAVED_CFLAGS=; unset NTPO_SAVED_CFLAGS;}
+{ NTPO_SAVED_CPPFLAGS=; unset NTPO_SAVED_CPPFLAGS;}
+{ NTPO_SAVED_LIBS=; unset NTPO_SAVED_LIBS;}
+{ openssl_triggers_warnings=; unset openssl_triggers_warnings;}
+{ ntp_openssl_from_pkg_config=; unset ntp_openssl_from_pkg_config;}
+
+
+# if we are using OpenSSL (--with-crypto), by default Autokey is enabled
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to include NTP Autokey protocol support" >&5
+$as_echo_n "checking if we want to include NTP Autokey protocol support... " >&6; }
+# Check whether --enable-autokey was given.
+if test "${enable_autokey+set}" = set; then :
+ enableval=$enable_autokey; ntp_autokey=$enableval
+else
+ ntp_autokey=$ntp_openssl
+
+fi
+
+case "$ntp_autokey" in
+ no)
+ ;;
+ *)
+ case "$ntp_openssl" in
+ no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&5
+$as_echo "$as_me: WARNING: Disabling Autokey, --enable-autokey requires --with-crypto." >&2;}
+ ntp_autokey=no
+ ;;
+ *)
+
+$as_echo "#define AUTOKEY 1" >>confdefs.h
+
+ ntp_autokey=yes
+ ;;
+ esac
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_autokey" >&5
+$as_echo "$ntp_autokey" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to run check-layout" >&5
+$as_echo_n "checking if we want to run check-layout... " >&6; }
+case "$cross_compiling$PATH_PERL" in
+ no/*)
+ MAKE_CHECK_LAYOUT=check-layout
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make dcf parse utilities" >&5
+$as_echo_n "checking if we can make dcf parse utilities... " >&6; }
+ans=no
+case "$ntp_parseutil" in
+ yes)
+ case "$host" in
+ *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
+ ans="dcfd testdcf"
+ DCFD=dcfd
+ TESTDCF=testdcf
+ esac
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can build kernel streams modules for parse" >&5
+$as_echo_n "checking if we can build kernel streams modules for parse... " >&6; }
+ans=no
+case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
+ yesyes)
+ case "$host" in
+ sparc-*-sunos4*)
+ case "$ntp_cv_var_kernel_pll" in
+ yes)
+
+$as_echo "#define PPS_SYNC 1" >>confdefs.h
+
+ ;;
+ esac
+ ans=parsestreams
+ MAKE_PARSEKMODULE=parsestreams.loadable_module.o
+ ;;
+ sparc-*-solaris2*)
+ ans=parsesolaris
+ MAKE_PARSEKMODULE=parse
+ for ac_header in strings.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
+if test "x$ac_cv_header_strings_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRINGS_H 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+ esac
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need basic refclock support" >&5
+$as_echo_n "checking if we need basic refclock support... " >&6; }
+case "$ntp_refclock" in
+ yes)
+
+$as_echo "#define REFCLOCK 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_refclock" >&5
+$as_echo "$ntp_refclock" >&6; }
+
+PROPDELAY=propdelay
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want HP-UX adjtimed support" >&5
+$as_echo_n "checking if we want HP-UX adjtimed support... " >&6; }
+case "$host" in
+ *-*-hpux[56789]*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+case "$ans" in
+ yes)
+ MAKE_ADJTIMED=adjtimed
+
+$as_echo "#define NEED_HPUX_ADJTIME 1" >>confdefs.h
+
+ ;;
+ *) ADJTIMED_DB=
+ ADJTIMED_DL=
+ ADJTIMED_DS=
+ ADJTIMED_MS=
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want QNX adjtime support" >&5
+$as_echo_n "checking if we want QNX adjtime support... " >&6; }
+case "$host" in
+ *-*-qnx*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+case "$ans" in
+ yes)
+
+$as_echo "#define NEED_QNX_ADJTIME 1" >>confdefs.h
+
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can read kmem" >&5
+$as_echo_n "checking if we can read kmem... " >&6; }
+
+# the default is to enable it if the system has the capability
+
+case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
+ *yes*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+case "$host" in
+ *-*-domainos) # Won't be found...
+ ans=no
+ ;;
+ *-*-hpux*)
+ #ans=no
+ ;;
+ *-*-irix[456]*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-winnt3.5)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+esac
+
+# --enable-kmem / --disable-kmem controls if present
+# Check whether --enable-kmem was given.
+if test "${enable_kmem+set}" = set; then :
+ enableval=$enable_kmem; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+ can_kmem=yes
+ ;;
+ *)
+ can_kmem=no
+
+$as_echo "#define NOKMEM 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if adjtime is accurate" >&5
+$as_echo_n "checking if adjtime is accurate... " >&6; }
+
+# target-dependent defaults
+
+case "$host" in
+ i386-sequent-ptx*)
+ ans=no
+ ;;
+ i386-unknown-osf1*)
+ ans=yes
+ ;;
+ mips-sgi-irix[456]*)
+ ans=yes
+ ;;
+ *-fujitsu-uxp*)
+ ans=yes
+ ;;
+ *-ibm-aix[4-9]*)
+ # XXX only verified thru AIX6.
+ ans=yes
+ ;;
+ *-*-*linux*)
+ ans=yes
+ ;;
+ *-*-solaris2.[01])
+ ans=no
+ ;;
+ *-*-solaris2*)
+ ans=yes
+ ;;
+ *-*-unicosmp*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+# --enable-accurate-adjtime / --disable-accurate-adjtime
+# override the default
+# Check whether --enable-accurate-adjtime was given.
+if test "${enable_accurate_adjtime+set}" = set; then :
+ enableval=$enable_accurate_adjtime; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+
+$as_echo "#define ADJTIME_IS_ACCURATE 1" >>confdefs.h
+
+ adjtime_is_accurate=yes
+ ;;
+ *)
+ adjtime_is_accurate=no
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name of 'tick' in the kernel" >&5
+$as_echo_n "checking the name of 'tick' in the kernel... " >&6; }
+if ${ntp_cv_nlist_tick+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=_tick
+ case "$host" in
+ m68*-hp-hpux*) # HP9000/300?
+ ans=_old_tick
+ ;;
+ *-apple-aux[23]*)
+ ans=tick
+ ;;
+ *-hp-hpux*)
+ ans=old_tick
+ ;;
+ *-ibm-aix[3-9]*)
+ # XXX only verified thru AIX6.
+ ans=no
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=tick
+ ;;
+ *-*-sco3.2v[45]*)
+ ans=no
+ ;;
+ *-*-solaris2*)
+ ans=nsec_per_tick
+ ;;
+ *-*-sysv4*)
+ ans=tick
+ ;;
+ esac
+ ntp_cv_nlist_tick=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tick" >&5
+$as_echo "$ntp_cv_nlist_tick" >&6; }
+case "$ntp_cv_nlist_tick" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define K_TICK_NAME "$ntp_cv_nlist_tick"
+_ACEOF
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the units of 'tick'" >&5
+$as_echo_n "checking for the units of 'tick'... " >&6; }
+if ${ntp_cv_tick_nano+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=usec
+ case "$host" in
+ *-*-solaris2*)
+ ans=nsec
+ ;;
+ esac
+ ntp_cv_tick_nano=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tick_nano" >&5
+$as_echo "$ntp_cv_tick_nano" >&6; }
+case "$ntp_cv_tick_nano" in
+ nsec)
+
+$as_echo "#define TICK_NANO 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name of 'tickadj' in the kernel" >&5
+$as_echo_n "checking the name of 'tickadj' in the kernel... " >&6; }
+if ${ntp_cv_nlist_tickadj+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=_tickadj
+ case "$host" in
+ m68*-hp-hpux*) # HP9000/300?
+ ans=_tickadj
+ ;;
+ *-apple-aux[23]*)
+ ans=tickadj
+ ;;
+ *-hp-hpux10*)
+ ans=no
+ ;;
+ *-hp-hpux9*)
+ ans=no
+ ;;
+ *-hp-hpux*)
+ ans=tickadj
+ ;;
+ *-*-aix*)
+ ans=tickadj
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=tickadj
+ ;;
+ *-*-sco3.2v4*)
+ ans=no
+ ;;
+ *-*-sco3.2v5.0*)
+ ans=clock_drift
+ ;;
+ *-*-solaris2*)
+ ans=no # hrestime_adj
+ ;;
+ *-*-sysv4*)
+ ans=tickadj
+ ;;
+ esac
+ ntp_cv_nlist_tickadj=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_tickadj" >&5
+$as_echo "$ntp_cv_nlist_tickadj" >&6; }
+case "$ntp_cv_nlist_tickadj" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define K_TICKADJ_NAME "$ntp_cv_nlist_tickadj"
+_ACEOF
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the units of 'tickadj'" >&5
+$as_echo_n "checking for the units of 'tickadj'... " >&6; }
+if ${ntp_cv_tickadj_nano+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ans=usec
+ case "$host" in
+ *-*-solaris2*)
+ ans=nsec
+ ;;
+ esac
+ ntp_cv_tickadj_nano=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_tickadj_nano" >&5
+$as_echo "$ntp_cv_tickadj_nano" >&6; }
+case "$ntp_cv_tickadj_nano" in
+ nsec)
+
+$as_echo "#define TICKADJ_NANO 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'dosynctodr' in the kernel" >&5
+$as_echo_n "checking half-heartedly for 'dosynctodr' in the kernel... " >&6; }
+if ${ntp_cv_nlist_dosynctodr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-apple-aux[23]*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=dosynctodr
+ ;;
+ *-*-aix*)
+ ans=dosynctodr
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-nextstep*)
+ ans=_dosynctodr
+ ;;
+ *-*-ptx*)
+ ans=doresettodr
+ ;;
+ *-*-sco3.2v4*)
+ ans=no
+ ;;
+ *-*-sco3.2v5*)
+ ans=track_rtc
+ ;;
+ *-*-solaris2*)
+ ans=dosynctodr
+ ;;
+ *-*-sysv4*)
+ ans=doresettodr
+ ;;
+ *)
+ ans=_dosynctodr
+ ;;
+ esac
+ ntp_cv_nlist_dosynctodr=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_dosynctodr" >&5
+$as_echo "$ntp_cv_nlist_dosynctodr" >&6; }
+case "$ntp_cv_nlist_dosynctodr" in
+ no)
+ ;;
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define K_DOSYNCTODR_NAME "$ntp_cv_nlist_dosynctodr"
+_ACEOF
+
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking half-heartedly for 'noprintf' in the kernel" >&5
+$as_echo_n "checking half-heartedly for 'noprintf' in the kernel... " >&6; }
+if ${ntp_cv_nlist_noprintf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-apple-aux[23]*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=noprintf
+ ;;
+ *-*-aix*)
+ ans=noprintf
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=noprintf
+ ;;
+ *-*-nextstep*)
+ ans=_noprintf
+ ;;
+ *-*-solaris2*)
+ ans=noprintf
+ ;;
+ *-*-sysv4*)
+ ans=noprintf
+ ;;
+ *)
+ ans=_noprintf
+ ;;
+ esac
+ ntp_cv_nlist_noprintf=$ans
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_nlist_noprintf" >&5
+$as_echo "$ntp_cv_nlist_noprintf" >&6; }
+case "$ntp_cv_nlist_noprintf" in
+ no)
+ ;;
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define K_NOPRINTF_NAME "$ntp_cv_nlist_noprintf"
+_ACEOF
+
+ ;;
+esac
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tick'" >&5
+$as_echo_n "checking for a default value for 'tick'... " >&6; }
+
+# target-dependent default for tick
+
+case "$host" in
+ *-*-pc-cygwin*)
+ as_fn_error $? "tick needs work for cygwin" "$LINENO" 5
+ ;;
+ *-univel-sysv*)
+ ans=10000
+ ;;
+ *-*-irix*)
+ ans=10000
+ ;;
+ *-*-*linux*)
+ ans=txc.tick
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-winnt3.5)
+ ans='(every / 10)'
+ ;;
+ *-*-unicosmp*)
+ ans=10000
+ ;;
+ *)
+ ans='1000000L/hz'
+ ;;
+esac
+
+# Check whether --enable-tick was given.
+if test "${enable_tick+set}" = set; then :
+ enableval=$enable_tick; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define PRESET_TICK $ans
+_ACEOF
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a default value for 'tickadj'" >&5
+$as_echo_n "checking for a default value for 'tickadj'... " >&6; }
+
+# target-specific default
+ans='500/hz'
+case "$host" in
+ *-fujitsu-uxp*)
+ case "$adjtime_is_accurate" in
+ yes)
+ ans='tick/16'
+ esac
+ ;;
+ *-univel-sysv*)
+ ans=80
+ ;;
+ *-*-aix*)
+ case "$can_kmem" in
+ no)
+ ans=1000
+ ;;
+ esac
+ ;;
+ *-*-domainos) # Skippy: won't be found...
+ case "$can_kmem" in
+ no)
+ ans=668
+ ;;
+ esac
+ ;;
+ *-*-hpux*)
+ case "$adjtime_is_accurate" in
+ yes)
+ ans='tick/16'
+ ;;
+ esac
+ ;;
+ *-*-irix*)
+ ans=150
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-sco3.2v5.0*)
+ ans=10000L/hz
+ ;;
+ *-*-winnt3.5)
+ ans=50
+ ;;
+ *-*-unicosmp*)
+ ans=150
+ ;;
+esac
+
+# Check whether --enable-tickadj was given.
+if test "${enable_tickadj+set}" = set; then :
+ enableval=$enable_tickadj; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+default_tickadj=$ans
+
+case "$default_tickadj" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+
+cat >>confdefs.h <<_ACEOF
+#define PRESET_TICKADJ $default_tickadj
+_ACEOF
+ ;;
+esac
+
+# Newer versions of ReliantUNIX round adjtime() values down to
+# 1/100s (system tick). Sigh ...
+# Unfortunately, there is no easy way to know if particular release
+# has this "feature" or any obvious way to test for it.
+case "$host" in
+ mips-sni-sysv4*)
+
+$as_echo "#define RELIANTUNIX_CLOCK 1" >>confdefs.h
+
+esac
+
+case "$host" in
+ *-*-sco3.2v5*)
+
+$as_echo "#define SCO5_CLOCK 1" >>confdefs.h
+
+esac
+
+ntp_cv_make_tickadj=yes
+case "$can_kmem$ac_cv_var_tick$default_tickadj" in
+ nonono) # Don't read KMEM, no presets. Bogus.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj." >&5
+$as_echo "$as_me: WARNING: Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj." >&2;}
+ ntp_cv_make_tickadj=no
+ ;;
+ nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICK. No tickadj." >&5
+$as_echo "$as_me: WARNING: Can't read kmem but no PRESET_TICK. No tickadj." >&2;}
+ ntp_cv_make_tickadj=no
+ ;;
+ no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't read kmem but no PRESET_TICKADJ. No tickadj." >&5
+$as_echo "$as_me: WARNING: Can't read kmem but no PRESET_TICKADJ. No tickadj." >&2;}
+ ntp_cv_make_tickadj=no
+ ;;
+ no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
+ ;;
+ yesnono) # Read KMEM, no presets. Cool.
+ ;;
+ yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK. Please report this." >&5
+$as_echo "$as_me: WARNING: PRESET_TICKADJ is defined but not PRESET_TICK. Please report this." >&2;}
+ ;;
+ yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
+ ;;
+ yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
+ ;;
+ *) # Generally bogus.
+ as_fn_error $? "This shouldn't happen." "$LINENO" 5
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the ntptime utility" >&5
+$as_echo_n "checking if we want and can make the ntptime utility... " >&6; }
+if ${ac_cv_make_ntptime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host" in
+ *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
+ yesyes)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ;;
+esac
+ac_cv_make_ntptime=$ans
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_make_ntptime" >&5
+$as_echo "$ac_cv_make_ntptime" >&6; }
+case "$ac_cv_make_ntptime" in
+ yes)
+ MAKE_NTPTIME=ntptime
+ ;;
+ *)
+ NTPTIME_DB=
+ NTPTIME_DL=
+ NTPTIME_DS=
+ NTPTIME_MS=
+ ;;
+esac
+
+
+case "$host" in
+ mips-sni-sysv4*)
+ # tickadj is pretty useless on newer versions of ReliantUNIX
+ # Do not bother
+ ntp_cv_make_tickadj=no
+ ;;
+ *-*-irix*)
+ ntp_cv_make_tickadj=no
+ ;;
+ *-*-solaris2*)
+ # DLM says tickadj is a no-no starting with solaris2.5
+ case "$host" in
+ *-*-solaris2.1[0-9]*)
+ ntp_cv_make_tickadj=no
+ ;;
+ *-*-solaris2.[0-4]*) ;;
+ *) ntp_cv_make_tickadj=no ;;
+ esac
+ ;;
+ *-*-unicosmp*)
+ ntp_cv_make_tickadj=no
+ ;;
+esac
+
+#
+# Despite all the above, we always make tickadj. Setting
+# ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
+# report that the configuration variable was cached. It may
+# be better to simply remove the hunk above, I did not want
+# to remove it if there is hope it will be used again.
+#
+{ ntp_cv_make_tickadj=; unset ntp_cv_make_tickadj;}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the tickadj utility" >&5
+$as_echo_n "checking if we want and can make the tickadj utility... " >&6; }
+if ${ntp_cv_make_tickadj+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ntp_cv_make_tickadj=yes
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_tickadj" >&5
+$as_echo "$ntp_cv_make_tickadj" >&6; }
+case "$ntp_cv_make_tickadj" in
+ yes)
+ MAKE_TICKADJ=tickadj
+ ;;
+ *)
+ CALC_TICKADJ_DB=
+ CALC_TICKADJ_DL=
+ CALC_TICKADJ_DS=
+ CALC_TICKADJ_MS=
+ TICKADJ_DB=
+ TICKADJ_DL=
+ TICKADJ_DS=
+ TICKADJ_MS=
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want and can make the timetrim utility" >&5
+$as_echo_n "checking if we want and can make the timetrim utility... " >&6; }
+if ${ntp_cv_make_timetrim+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-*-irix*)
+ ntp_cv_make_timetrim=yes
+ ;;
+ *-*-unicosmp*)
+ ntp_cv_make_timetrim=yes
+ ;;
+ *)
+ ntp_cv_make_timetrim=no
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_make_timetrim" >&5
+$as_echo "$ntp_cv_make_timetrim" >&6; }
+case "$ntp_cv_make_timetrim" in
+ yes)
+ MAKE_TIMETRIM=timetrim
+ ;;
+ *) TIMETRIM_DB=
+ TIMETRIM_DL=
+ TIMETRIM_DS=
+ TIMETRIM_MS=
+ ;;
+esac
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to build the NTPD simulator" >&5
+$as_echo_n "checking if we want to build the NTPD simulator... " >&6; }
+# Check whether --enable-simulator was given.
+if test "${enable_simulator+set}" = set; then :
+ enableval=$enable_simulator; ans=$enableval
+else
+ ans=no
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+case "$ans" in
+ yes)
+ MAKE_NTPDSIM=ntpdsim
+ MAKE_LIBNTPSIM=libntpsim.a
+ ;;
+ *)
+ NTPDSIM_DB=
+ NTPDSIM_DL=
+ NTPDSIM_DS=
+ NTPDSIM_MS=
+ ;;
+esac
+
+case "$build" in
+ $host)
+ ;;
+ *) case "$host" in
+ *-*-vxworks*)
+ LDFLAGS="$LDFLAGS -r"
+ ;;
+ esac
+ ;;
+esac
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sntp will be built" >&5
+$as_echo_n "checking if sntp will be built... " >&6; }
+
+# Check whether --with-sntp was given.
+if test "${with_sntp+set}" = set; then :
+ withval=$with_sntp;
+else
+ with_sntp="${withsntp=yes}"
+
+fi
+
+case "$with_sntp" in
+ no)
+ SNTP=
+ ;;
+ *)
+ SNTP=sntp
+ ;;
+esac
+
+ if test -n "$SNTP"; then
+ BUILD_SNTP_TRUE=
+ BUILD_SNTP_FALSE='#'
+else
+ BUILD_SNTP_TRUE='#'
+ BUILD_SNTP_FALSE=
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sntp" >&5
+$as_echo "$with_sntp" >&6; }
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to build ntpsnmpd" >&5
+$as_echo_n "checking if we want to build ntpsnmpd... " >&6; }
+
+# Check whether --with-ntpsnmpd was given.
+if test "${with_ntpsnmpd+set}" = set; then :
+ withval=$with_ntpsnmpd; ans=$withval
+else
+
+ case "$PATH_NET_SNMP_CONFIG" in
+ /*) ans=yes ;;
+ *) ans=no ;;
+ esac
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+case "$ans" in
+ yes)
+ case "$PATH_NET_SNMP_CONFIG" in
+ /*)
+ SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
+
+ # HMS: we really want to separate CPPFLAGS and CFLAGS
+ foo=`$PATH_NET_SNMP_CONFIG --cflags`
+ SNMP_CPPFLAGS=
+ SNMP_CFLAGS=
+ for i in $foo; do
+ case "$i" in
+ -D*|-U*|-I*)
+ SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
+ ;;
+ *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
+ ;;
+ esac
+ done
+
+
+
+ save_CFLAGS=$CFLAGS
+ save_CPPFLAGS=$CPPFLAGS
+ save_LIBS=$LIBS
+ CFLAGS=$SNMP_CFLAGS
+ CPPFLAGS=$SNMP_CPPFLAGS
+
+ ac_fn_c_check_header_mongrel "$LINENO" "net-snmp/net-snmp-config.h" "ac_cv_header_net_snmp_net_snmp_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = xyes; then :
+ MAKE_NTPSNMPD=ntpsnmpd
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: net-snmp-config present but net-snmp headers are not available!" >&5
+$as_echo "$as_me: WARNING: net-snmp-config present but net-snmp headers are not available!" >&2;}
+
+fi
+
+
+
+ # Do this last, as we're messing up LIBS.
+ # check -lnetsnmp for netsnmp_daemonize
+ LIBS=`$PATH_NET_SNMP_CONFIG --libs`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for netsnmp_daemonize in -lnetsnmp" >&5
+$as_echo_n "checking for netsnmp_daemonize in -lnetsnmp... " >&6; }
+if ${ac_cv_lib_netsnmp_netsnmp_daemonize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnetsnmp $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char netsnmp_daemonize ();
+int
+main ()
+{
+return netsnmp_daemonize ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_netsnmp_netsnmp_daemonize=yes
+else
+ ac_cv_lib_netsnmp_netsnmp_daemonize=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_netsnmp_daemonize" >&5
+$as_echo "$ac_cv_lib_netsnmp_netsnmp_daemonize" >&6; }
+if test "x$ac_cv_lib_netsnmp_netsnmp_daemonize" = xyes; then :
+ ans=yes
+else
+ ans=no
+
+fi
+
+ case "$ans" in
+ no)
+
+$as_echo "#define NEED_NETSNMP_DAEMONIZE 1" >>confdefs.h
+
+ esac
+
+ CFLAGS=$save_CFLAGS
+ { save_CFLAGS=; unset save_CFLAGS;}
+ CPPFLAGS=$save_CPPFLAGS
+ { save_CPPFLAGS=; unset save_CPPFLAGS;}
+ LIBS=$save_LIBS
+ { save_LIBS=; unset save_LIBS;}
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&5
+$as_echo "$as_me: WARNING: Cannot build ntpsnmpd - net-snmp-config cannot be found" >&2;}
+ ;;
+ esac
+ ;;
+esac
+
+
+case "$MAKE_NTPSNMPD" in
+ '')
+ NTPSNMPD_DB=
+ NTPSNMPD_DL=
+ NTPSNMPD_DS=
+ NTPSNMPD_MS=
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should always slew the time" >&5
+$as_echo_n "checking if we should always slew the time... " >&6; }
+
+# target-specific defaults
+
+case "$host" in
+ *-apple-aux[23]*)
+ ans=yes
+ ;;
+ *-*-bsdi[012]*)
+ ans=no
+ ;;
+ *-*-bsdi*)
+ ans=yes
+ ;;
+ *-*-openvms*) # HMS: won't be found
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+# --enable-slew-always / --disable-slew-always overrides default
+
+# Check whether --enable-slew-always was given.
+if test "${enable_slew_always+set}" = set; then :
+ enableval=$enable_slew_always; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+
+$as_echo "#define SLEWALWAYS 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should step and slew the time" >&5
+$as_echo_n "checking if we should step and slew the time... " >&6; }
+
+case "$host" in
+ *-sni-sysv*)
+ ans=yes
+ ;;
+ *-univel-sysv*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=yes
+ ;;
+ *-*-solaris2.1[0-9]*)
+ ans=no
+ ;;
+ *-*-solaris2.[012]*)
+ ans=yes
+ ;;
+ *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+# Check whether --enable-step-slew was given.
+if test "${enable_step_slew+set}" = set; then :
+ enableval=$enable_step_slew; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+
+$as_echo "#define STEP_SLEW 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ntpdate should step the time" >&5
+$as_echo_n "checking if ntpdate should step the time... " >&6; }
+
+case "$host" in
+ *-apple-aux[23]*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+# Check whether --enable-ntpdate-step was given.
+if test "${enable_ntpdate_step+set}" = set; then :
+ enableval=$enable_ntpdate_step; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+
+$as_echo "#define FORCE_NTPDATE_STEP 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should sync TODR clock every hour" >&5
+$as_echo_n "checking if we should sync TODR clock every hour... " >&6; }
+
+case "$host" in
+ *-*-nextstep*)
+ ans=yes
+ ;;
+ *-*-openvms*) # HMS: won't be found
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+
+# Check whether --enable-hourly-todr-sync was given.
+if test "${enable_hourly_todr_sync+set}" = set; then :
+ enableval=$enable_hourly_todr_sync; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ac_cv_var_sync_todr" in
+ yes)
+
+$as_echo "#define DOSYNCTODR 1" >>confdefs.h
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should avoid kernel FLL bug" >&5
+$as_echo_n "checking if we should avoid kernel FLL bug... " >&6; }
+
+case "$host" in
+ *-*-solaris2.6)
+ unamev=`uname -v`
+ case "$unamev" in
+ Generic_105181-*)
+ old_IFS="$IFS"
+ IFS="-"
+ set $unamev
+ IFS="$old_IFS"
+ if test "$2" -ge 17
+ then
+ # Generic_105181-17 and higher
+ ans=no
+ else
+ ans=yes
+ fi
+ ;;
+ *)
+ ans=yes
+ ;;
+ esac
+ ;;
+ *-*-solaris2.7)
+ unamev=`uname -v`
+ case "$unamev" in
+ Generic_106541-*)
+ old_IFS="$IFS"
+ IFS="-"
+ set $unamev
+ IFS="$old_IFS"
+ if test "$2" -ge 07
+ then
+ # Generic_106541-07 and higher
+ ans=no
+ else
+ ans=yes
+ fi
+ ;;
+ *)
+ ans=yes
+ ;;
+ esac
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+
+# Check whether --enable-kernel-fll-bug was given.
+if test "${enable_kernel_fll_bug+set}" = set; then :
+ enableval=$enable_kernel_fll_bug; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+
+$as_echo "#define KERNEL_FLL_BUG 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want new session key behavior" >&5
+$as_echo_n "checking if we want new session key behavior... " >&6; }
+# Check whether --enable-bug1243-fix was given.
+if test "${enable_bug1243_fix+set}" = set; then :
+ enableval=$enable_bug1243_fix; ans=$enableval
+else
+ ans=yes
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+case "$ans" in
+ no)
+
+$as_echo "#define DISABLE_BUG1243_FIX 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use the IRIG sawtooth filter" >&5
+$as_echo_n "checking if we should use the IRIG sawtooth filter... " >&6; }
+
+case "$host" in
+ *-*-solaris2.[89])
+ ans=yes
+ ;;
+ *-*-solaris2.1[0-9]*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+# Check whether --enable-irig-sawtooth was given.
+if test "${enable_irig_sawtooth+set}" = set; then :
+ enableval=$enable_irig_sawtooth; ans=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+
+$as_echo "#define IRIG_SUCKS 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable NIST lockclock scheme" >&5
+$as_echo_n "checking if we should enable NIST lockclock scheme... " >&6; }
+
+# Check whether --enable-nist was given.
+if test "${enable_nist+set}" = set; then :
+ enableval=$enable_nist; ans=$enableval
+else
+ ans=no
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ yes)
+
+$as_echo "#define LOCKCLOCK 1" >>confdefs.h
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want support for Samba's signing daemon" >&5
+$as_echo_n "checking if we want support for Samba's signing daemon... " >&6; }
+
+# Check whether --enable-ntp-signd was given.
+if test "${enable_ntp_signd+set}" = set; then :
+ enableval=$enable_ntp_signd; ans=$enableval
+else
+ ans=no
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+case "$ans" in
+ no)
+ ntp_signd_path=
+ ;;
+ yes)
+ ntp_signd_path=/var/run/ntp_signd
+ ;;
+ *)
+ ntp_signd_path="$ans"
+esac
+
+case "$ntp_signd_path" in
+ '')
+ ;;
+ *)
+
+$as_echo "#define HAVE_NTP_SIGND 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define NTP_SIGND_PATH "$ntp_signd_path"
+_ACEOF
+
+ ;;
+esac
+
+for ac_header in libscf.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libscf.h" "ac_cv_header_libscf_h" "$ac_includes_default"
+if test "x$ac_cv_header_libscf_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSCF_H 1
+_ACEOF
+
+fi
+
+done
+
+LSCF=
+case "$ac_cv_header_libscf_h" in
+ yes)
+ LSCF='-lscf'
+esac
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
+$as_echo_n "checking for struct sockaddr_storage... " >&6; }
+if ${ntp_cv_sockaddr_storage+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+
+int
+main ()
+{
+
+ struct sockaddr_storage n;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_sockaddr_storage=yes
+else
+ ntp_cv_sockaddr_storage=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5
+$as_echo "$ntp_cv_sockaddr_storage" >&6; }
+case "$ntp_cv_sockaddr_storage" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5
+$as_echo_n "checking for sockaddr_storage.__ss_family... " >&6; }
+if ${ntp_cv_have___ss_family+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+
+int
+main ()
+{
+
+ struct sockaddr_storage s;
+ s.__ss_family = 1;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_have___ss_family=yes
+else
+ ntp_cv_have___ss_family=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5
+$as_echo "$ntp_cv_have___ss_family" >&6; }
+ case "$ntp_cv_have___ss_family" in
+ yes)
+
+$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h
+
+ esac
+
+esac
+
+
+#
+# Look for in_port_t.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5
+$as_echo_n "checking for in_port_t... " >&6; }
+if ${isc_cv_have_in_port_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <netinet/in.h>
+
+int
+main ()
+{
+
+ in_port_t port = 25;
+ return (0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_have_in_port_t=yes
+else
+ isc_cv_have_in_port_t=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5
+$as_echo "$isc_cv_have_in_port_t" >&6; }
+case "$isc_cv_have_in_port_t" in
+ no)
+
+$as_echo "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5
+$as_echo_n "checking type of socklen arg for getsockname()... " >&6; }
+if ${ntp_cv_getsockname_socklen_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ getsockname_socklen_type_found=no
+ for getsockname_arg2 in 'struct sockaddr *' 'void *'; do
+ for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+
+int
+main ()
+{
+
+ extern
+ getsockname(int, $getsockname_arg2,
+ $ntp_cv_getsockname_socklen_type *);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ getsockname_socklen_type_found=yes ; break 2
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ done
+ case "$getsockname_socklen_type_found" in
+ no)
+ ntp_cv_getsockname_socklen_type='socklen_t'
+ esac
+ { getsockname_arg2=; unset getsockname_arg2;}
+ { getsockname_socklen_type_found=; unset getsockname_socklen_type_found;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5
+$as_echo "$ntp_cv_getsockname_socklen_type" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr for sa_len" >&5
+$as_echo_n "checking struct sockaddr for sa_len... " >&6; }
+if ${isc_cv_platform_havesalen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+int
+main ()
+{
+
+ extern struct sockaddr *ps;
+ return ps->sa_len;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_platform_havesalen=yes
+else
+ isc_cv_platform_havesalen=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_platform_havesalen" >&5
+$as_echo "$isc_cv_platform_havesalen" >&6; }
+case "$isc_cv_platform_havesalen" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVESALEN 1" >>confdefs.h
+
+esac
+
+# Check whether --enable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then :
+ enableval=$enable_ipv6;
+fi
+
+
+case "$enable_ipv6" in
+ yes|''|autodetect)
+ case "$host" in
+ powerpc-ibm-aix4*)
+ ;;
+ *)
+
+$as_echo "#define WANT_IPV6 1" >>confdefs.h
+
+ ;;
+ esac
+ ;;
+ no)
+ ;;
+esac
+
+
+case "$host" in
+ *-*-darwin*)
+
+$as_echo "#define __APPLE_USE_RFC_3542 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 structures" >&5
+$as_echo_n "checking for IPv6 structures... " >&6; }
+if ${isc_cv_found_ipv6+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+
+int
+main ()
+{
+
+ struct sockaddr_in6 sin6;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_found_ipv6=yes
+else
+ isc_cv_found_ipv6=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_found_ipv6" >&5
+$as_echo "$isc_cv_found_ipv6" >&6; }
+
+#
+# See whether IPv6 support is provided via a Kame add-on.
+# This is done before other IPv6 linking tests so LIBS is properly set.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kame IPv6 support" >&5
+$as_echo_n "checking for Kame IPv6 support... " >&6; }
+
+# Check whether --with-kame was given.
+if test "${with_kame+set}" = set; then :
+ withval=$with_kame; use_kame="$withval"
+else
+ use_kame="no"
+
+fi
+
+case "$use_kame" in
+ no)
+ ;;
+ yes)
+ kame_path=/usr/local/v6
+ ;;
+ *)
+ kame_path="$use_kame"
+ ;;
+esac
+case "$use_kame" in
+ no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ *)
+ if test -f $kame_path/lib/libinet6.a; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kame_path/lib/libinet6.a" >&5
+$as_echo "$kame_path/lib/libinet6.a" >&6; }
+ LIBS="-L$kame_path/lib -linet6 $LIBS"
+ else
+ as_fn_error $? "$kame_path/lib/libinet6.a not found.
+
+Please choose the proper path with the following command:
+
+ configure --with-kame=PATH
+" "$LINENO" 5
+ fi
+ ;;
+esac
+
+#
+# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
+# Including it on Kame-using platforms is very bad, though, because
+# Kame uses #error against direct inclusion. So include it on only
+# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
+# This is done before the in6_pktinfo check because that's what
+# netinet6/in6.h is needed for.
+#
+case "$host" in
+ *-bsdi4.[01]*)
+
+$as_echo "#define ISC_PLATFORM_NEEDNETINET6IN6H 1" >>confdefs.h
+
+ isc_netinet6in6_hack="#include <netinet6/in6.h>"
+ ;;
+ *)
+ isc_netinet6in6_hack=""
+ ;;
+esac
+
+#
+# This is similar to the netinet6/in6.h issue.
+#
+case "$host" in
+ *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+
+$as_echo "#define ISC_PLATFORM_FIXIN6ISADDR 1" >>confdefs.h
+
+ isc_netinetin6_hack="#include <netinet/in6.h>"
+ ;;
+ *)
+ isc_netinetin6_hack=""
+ ;;
+esac
+
+
+case "$isc_cv_found_ipv6" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIPV6 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5
+$as_echo_n "checking for in6_pktinfo... " >&6; }
+if ${isc_cv_have_in6_pktinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+
+int
+main ()
+{
+
+ struct in6_pktinfo xyzzy;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_have_in6_pktinfo=yes
+else
+ isc_cv_have_in6_pktinfo=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in6_pktinfo" >&5
+$as_echo "$isc_cv_have_in6_pktinfo" >&6; }
+ case "$isc_cv_have_in6_pktinfo" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIN6PKTINFO 1" >>confdefs.h
+
+ esac
+
+
+ # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_in6.sin6_scope_id" >&5
+$as_echo_n "checking for sockaddr_in6.sin6_scope_id... " >&6; }
+if ${isc_cv_have_sin6_scope_id+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+
+int
+main ()
+{
+
+ struct sockaddr_in6 xyzzy;
+ xyzzy.sin6_scope_id = 0;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_have_sin6_scope_id=yes
+else
+ isc_cv_have_sin6_scope_id=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_sin6_scope_id" >&5
+$as_echo "$isc_cv_have_sin6_scope_id" >&6; }
+
+ case "$isc_cv_have_sin6_scope_id" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVESCOPEID 1" >>confdefs.h
+
+ esac
+esac
+
+
+# We need this check run even without isc_cv_found_ipv6=yes
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5
+$as_echo_n "checking for in6addr_any... " >&6; }
+if ${isc_cv_in6addr_any_links+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ SAVED_LIBS="$LIBS"
+ LIBS="$LDADD_LIBNTP $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+
+int
+main ()
+{
+
+ printf("%x", in6addr_any.s6_addr[15]);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ isc_cv_in6addr_any_links=yes
+else
+ isc_cv_in6addr_any_links=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$SAVED_LIBS"
+ { SAVED_LIBS=; unset SAVED_LIBS;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_in6addr_any_links" >&5
+$as_echo "$isc_cv_in6addr_any_links" >&6; }
+
+case "$isc_cv_in6addr_any_links" in
+ no)
+
+$as_echo "#define ISC_PLATFORM_NEEDIN6ADDRANY 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrconf" >&5
+$as_echo_n "checking for struct if_laddrconf... " >&6; }
+if ${isc_cv_struct_if_laddrconf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <net/if6.h>
+
+int
+main ()
+{
+
+ struct if_laddrconf a;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_struct_if_laddrconf=yes
+else
+ isc_cv_struct_if_laddrconf=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrconf" >&5
+$as_echo "$isc_cv_struct_if_laddrconf" >&6; }
+
+case "$isc_cv_struct_if_laddrconf" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRCONF 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrreq" >&5
+$as_echo_n "checking for struct if_laddrreq... " >&6; }
+if ${isc_cv_struct_if_laddrreq+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <net/if6.h>
+
+int
+main ()
+{
+
+ struct if_laddrreq a;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_struct_if_laddrreq=yes
+else
+ isc_cv_struct_if_laddrreq=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrreq" >&5
+$as_echo "$isc_cv_struct_if_laddrreq" >&6; }
+
+case "$isc_cv_struct_if_laddrreq" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRREQ 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5
+$as_echo_n "checking for multicast IP support... " >&6; }
+if ${ntp_cv_multicast+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ntp_cv_multicast=no
+ case "$host" in
+ i386-sequent-sysv4)
+ ;;
+ *)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+
+int
+main ()
+{
+
+ struct ip_mreq ipmr;
+ ipmr.imr_interface.s_addr = 0;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_multicast=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5
+$as_echo "$ntp_cv_multicast" >&6; }
+case "$ntp_cv_multicast" in
+ yes)
+
+$as_echo "#define MCAST 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5
+$as_echo_n "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; }
+if ${ntp_cv_typeof_ip_multicast_loop+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-*-netbsd*|*-*-*linux*)
+ ntp_cv_typeof_ip_multicast_loop=u_int
+ ;;
+ *)
+ ntp_cv_typeof_ip_multicast_loop=u_char
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5
+$as_echo "$ntp_cv_typeof_ip_multicast_loop" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop
+_ACEOF
+
+esac
+
+# Check whether --enable-getifaddrs was given.
+if test "${enable_getifaddrs+set}" = set; then :
+ enableval=$enable_getifaddrs; want_getifaddrs="$enableval"
+else
+ want_getifaddrs="yes"
+
+fi
+
+
+case $want_getifaddrs in
+ glibc)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-getifaddrs=glibc is no longer required" >&5
+$as_echo "$as_me: WARNING: --enable-getifaddrs=glibc is no longer required" >&2;}
+esac
+case $want_getifaddrs in
+ no)
+ ;;
+ *)
+ SAVED_LIBS="$LIBS"
+ LIBS="$LDADD_LIBNTP $LIBS"
+ for ac_func in getifaddrs
+do :
+ ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs"
+if test "x$ac_cv_func_getifaddrs" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETIFADDRS 1
+_ACEOF
+
+fi
+done
+
+ LIBS="$SAVED_LIBS"
+ { SAVED_LIBS=; unset SAVED_LIBS;}
+ ;;
+esac
+
+#
+# Check for if_nametoindex() for IPv6 scoped addresses support
+#
+case "$host" in
+ *-hp-hpux*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5
+$as_echo_n "checking for library containing if_nametoindex... " >&6; }
+if ${ac_cv_search_if_nametoindex+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char if_nametoindex ();
+int
+main ()
+{
+return if_nametoindex ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' ipv6; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_if_nametoindex=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_if_nametoindex+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_if_nametoindex+:} false; then :
+
+else
+ ac_cv_search_if_nametoindex=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_if_nametoindex" >&5
+$as_echo "$ac_cv_search_if_nametoindex" >&6; }
+ac_res=$ac_cv_search_if_nametoindex
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+esac
+SAVED_LIBS="$LIBS"
+LIBS="$LDADD_LIBNTP $LIBS"
+for ac_func in if_nametoindex
+do :
+ ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
+if test "x$ac_cv_func_if_nametoindex" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_IF_NAMETOINDEX 1
+_ACEOF
+
+fi
+done
+
+LIBS="$SAVED_LIBS"
+{ SAVED_LIBS=; unset SAVED_LIBS;}
+case "$ac_cv_func_if_nametoindex" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" >>confdefs.h
+
+esac
+
+
+
+
+#
+# Look for a sysctl call to get the list of network interfaces.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for interface list sysctl" >&5
+$as_echo_n "checking for interface list sysctl... " >&6; }
+if ${ntp_cv_iflist_sysctl+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+ #include <sys/socket.h>
+ #ifndef NET_RT_IFLIST
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_cv_iflist_sysctl=yes
+else
+ ntp_cv_iflist_sysctl=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_iflist_sysctl" >&5
+$as_echo "$ntp_cv_iflist_sysctl" >&6; }
+case "$ntp_cv_iflist_sysctl" in
+ yes)
+
+$as_echo "#define HAVE_IFLIST_SYSCTL 1" >>confdefs.h
+
+esac
+
+###
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want the saveconfig mechanism" >&5
+$as_echo_n "checking if we want the saveconfig mechanism... " >&6; }
+# Check whether --enable-saveconfig was given.
+if test "${enable_saveconfig+set}" = set; then :
+ enableval=$enable_saveconfig; ntp_ok=$enableval
+else
+ ntp_ok=yes
+
+fi
+
+ntp_saveconfig_enabled=0
+case "$ntp_ok" in
+ yes)
+ ntp_saveconfig_enabled=1
+
+$as_echo "#define SAVECONFIG 1" >>confdefs.h
+
+ ;;
+esac
+ if test x$ntp_saveconfig_enabled = x1; then
+ SAVECONFIG_ENABLED_TRUE=
+ SAVECONFIG_ENABLED_FALSE='#'
+else
+ SAVECONFIG_ENABLED_TRUE='#'
+ SAVECONFIG_ENABLED_FALSE=
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+
+gta=false
+
+# Check whether --with-gtest was given.
+if test "${with_gtest+set}" = set; then :
+ withval=$with_gtest; try_gtest=$withval
+else
+ try_gtest=yes
+
+fi
+
+case "$try_gtest" in
+ yes)
+ # Extract the first word of "gtest-config", so it can be a program name with args.
+set dummy gtest-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GTEST_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GTEST_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GTEST_CONFIG="$GTEST_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_GTEST_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GTEST_CONFIG=$ac_cv_path_GTEST_CONFIG
+if test -n "$GTEST_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTEST_CONFIG" >&5
+$as_echo "$GTEST_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ { ac_cv_path_GTEST_CONFIG=; unset ac_cv_path_GTEST_CONFIG;}
+ case x${GTEST_CONFIG} in
+ x) ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking gtest version" >&5
+$as_echo_n "checking gtest version... " >&6; }
+ gtest_version_test=`$GTEST_CONFIG --min-version=1.5 || echo toolow`
+ case "$gtest_version_test" in
+ toolow*)
+ ;;
+ *)
+ GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags`
+ GTEST_LIBS=`$GTEST_CONFIG --libs`
+ GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags`
+ GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags`
+
+
+
+
+ gta=true
+ ;;
+ esac
+ gtest_version=`$GTEST_CONFIG --version`
+ case "$gta" in
+ true)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) ok" >&5
+$as_echo "($gtest_version) ok" >&6; }
+ ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) not ok" >&5
+$as_echo "($gtest_version) not ok" >&6; }
+ ;;
+ esac
+ { gtest_version_test=; unset gtest_version_test;}
+ { gtest_version=; unset gtest_version;}
+ esac
+esac
+ if $gta; then
+ GTEST_AVAILABLE_TRUE=
+ GTEST_AVAILABLE_FALSE='#'
+else
+ GTEST_AVAILABLE_TRUE='#'
+ GTEST_AVAILABLE_FALSE=
+fi
+
+
+
+
+###
+
+
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+ eval ac_define_dir="\"$sysconfdir\""
+ eval ac_define_dir="\"$ac_define_dir\""
+ NTP_KEYSDIR="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define NTP_KEYSDIR "$ac_define_dir"
+_ACEOF
+
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+ac_config_files="$ac_config_files Makefile"
+
+ac_config_files="$ac_config_files adjtimed/Makefile"
+
+ac_config_files="$ac_config_files clockstuff/Makefile"
+
+ac_config_files="$ac_config_files include/Makefile"
+
+ac_config_files="$ac_config_files include/isc/Makefile"
+
+ac_config_files="$ac_config_files kernel/Makefile"
+
+ac_config_files="$ac_config_files kernel/sys/Makefile"
+
+ac_config_files="$ac_config_files libntp/Makefile"
+
+ac_config_files="$ac_config_files libparse/Makefile"
+
+ac_config_files="$ac_config_files ntpd/Makefile"
+
+ac_config_files="$ac_config_files ntpd/complete.conf"
+
+ac_config_files="$ac_config_files ntpdate/Makefile"
+
+ac_config_files="$ac_config_files ntpdc/Makefile"
+
+ac_config_files="$ac_config_files ntpdc/nl.pl"
+
+ac_config_files="$ac_config_files ntpq/Makefile"
+
+ac_config_files="$ac_config_files ntpsnmpd/Makefile"
+
+ac_config_files="$ac_config_files parseutil/Makefile"
+
+ac_config_files="$ac_config_files scripts/Makefile"
+
+ac_config_files="$ac_config_files scripts/lib/Makefile"
+
+ac_config_files="$ac_config_files scripts/calc_tickadj/calc_tickadj"
+
+ac_config_files="$ac_config_files scripts/calc_tickadj/Makefile"
+
+ac_config_files="$ac_config_files scripts/build/mkver"
+
+ac_config_files="$ac_config_files scripts/ntp-wait/ntp-wait"
+
+ac_config_files="$ac_config_files scripts/ntp-wait/Makefile"
+
+ac_config_files="$ac_config_files scripts/ntpsweep/ntpsweep"
+
+ac_config_files="$ac_config_files scripts/ntpsweep/Makefile"
+
+ac_config_files="$ac_config_files scripts/ntptrace/ntptrace"
+
+ac_config_files="$ac_config_files scripts/ntptrace/Makefile"
+
+ac_config_files="$ac_config_files scripts/ntpver"
+
+ac_config_files="$ac_config_files scripts/plot_summary"
+
+ac_config_files="$ac_config_files scripts/summary"
+
+ac_config_files="$ac_config_files scripts/build/Makefile"
+
+ac_config_files="$ac_config_files tests/Makefile"
+
+ac_config_files="$ac_config_files tests/libntp/Makefile"
+
+ac_config_files="$ac_config_files tests/ntpd/Makefile"
+
+ac_config_files="$ac_config_files util/Makefile"
+
+
+perllibdir="${datadir}/ntp/lib"
+
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+ eval ac_define_dir="\"$perllibdir\""
+ eval ac_define_dir="\"$ac_define_dir\""
+ PERLLIBDIR="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define PERLLIBDIR "$ac_define_dir"
+_ACEOF
+
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
+
+ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
+
+ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
+
+ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
+
+summary_opts="$srcdir/scripts/summary-opts"
+
+plot_summary_opts="$srcdir/scripts/plot_summary-opts"
+
+
+
+
+subdirs="$subdirs sntp"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${VPATH_HACK_TRUE}" && test -z "${VPATH_HACK_FALSE}"; then
+ as_fn_error $? "conditional \"VPATH_HACK\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WANT_CALC_TICKADJ_MS_TRUE}" && test -z "${WANT_CALC_TICKADJ_MS_FALSE}"; then
+ as_fn_error $? "conditional \"WANT_CALC_TICKADJ_MS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INSTALL_NTPSWEEP_TRUE}" && test -z "${INSTALL_NTPSWEEP_FALSE}"; then
+ as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDNORETURN_H_TRUE}" && test -z "${GL_GENERATE_STDNORETURN_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDNORETURN_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INSTALL_LIBOPTS_TRUE}" && test -z "${INSTALL_LIBOPTS_FALSE}"; then
+ as_fn_error $? "conditional \"INSTALL_LIBOPTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEED_LIBOPTS_TRUE}" && test -z "${NEED_LIBOPTS_FALSE}"; then
+ as_fn_error $? "conditional \"NEED_LIBOPTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NTP_CROSSCOMPILE_TRUE}" && test -z "${NTP_CROSSCOMPILE_FALSE}"; then
+ as_fn_error $? "conditional \"NTP_CROSSCOMPILE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${PTHREADS_TRUE}" && test -z "${PTHREADS_FALSE}"; then
+ as_fn_error $? "conditional \"PTHREADS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_SNTP_TRUE}" && test -z "${BUILD_SNTP_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_SNTP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${SAVECONFIG_ENABLED_TRUE}" && test -z "${SAVECONFIG_ENABLED_FALSE}"; then
+ as_fn_error $? "conditional \"SAVECONFIG_ENABLED\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+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
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ntp4 $as_me 4.2.7p482, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <http://bugs.ntp.org./>.
+ntp4 home page: <http://www.ntp.org./>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+ntp4 config.status 4.2.7p482
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_ld_CXX \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "adjtimed/Makefile") CONFIG_FILES="$CONFIG_FILES adjtimed/Makefile" ;;
+ "clockstuff/Makefile") CONFIG_FILES="$CONFIG_FILES clockstuff/Makefile" ;;
+ "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "include/isc/Makefile") CONFIG_FILES="$CONFIG_FILES include/isc/Makefile" ;;
+ "kernel/Makefile") CONFIG_FILES="$CONFIG_FILES kernel/Makefile" ;;
+ "kernel/sys/Makefile") CONFIG_FILES="$CONFIG_FILES kernel/sys/Makefile" ;;
+ "libntp/Makefile") CONFIG_FILES="$CONFIG_FILES libntp/Makefile" ;;
+ "libparse/Makefile") CONFIG_FILES="$CONFIG_FILES libparse/Makefile" ;;
+ "ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpd/Makefile" ;;
+ "ntpd/complete.conf") CONFIG_FILES="$CONFIG_FILES ntpd/complete.conf" ;;
+ "ntpdate/Makefile") CONFIG_FILES="$CONFIG_FILES ntpdate/Makefile" ;;
+ "ntpdc/Makefile") CONFIG_FILES="$CONFIG_FILES ntpdc/Makefile" ;;
+ "ntpdc/nl.pl") CONFIG_FILES="$CONFIG_FILES ntpdc/nl.pl" ;;
+ "ntpq/Makefile") CONFIG_FILES="$CONFIG_FILES ntpq/Makefile" ;;
+ "ntpsnmpd/Makefile") CONFIG_FILES="$CONFIG_FILES ntpsnmpd/Makefile" ;;
+ "parseutil/Makefile") CONFIG_FILES="$CONFIG_FILES parseutil/Makefile" ;;
+ "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
+ "scripts/lib/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/lib/Makefile" ;;
+ "scripts/calc_tickadj/calc_tickadj") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/calc_tickadj" ;;
+ "scripts/calc_tickadj/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/calc_tickadj/Makefile" ;;
+ "scripts/build/mkver") CONFIG_FILES="$CONFIG_FILES scripts/build/mkver" ;;
+ "scripts/ntp-wait/ntp-wait") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/ntp-wait" ;;
+ "scripts/ntp-wait/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntp-wait/Makefile" ;;
+ "scripts/ntpsweep/ntpsweep") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/ntpsweep" ;;
+ "scripts/ntpsweep/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntpsweep/Makefile" ;;
+ "scripts/ntptrace/ntptrace") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/ntptrace" ;;
+ "scripts/ntptrace/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/ntptrace/Makefile" ;;
+ "scripts/ntpver") CONFIG_FILES="$CONFIG_FILES scripts/ntpver" ;;
+ "scripts/plot_summary") CONFIG_FILES="$CONFIG_FILES scripts/plot_summary" ;;
+ "scripts/summary") CONFIG_FILES="$CONFIG_FILES scripts/summary" ;;
+ "scripts/build/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/build/Makefile" ;;
+ "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+ "tests/libntp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libntp/Makefile" ;;
+ "tests/ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntpd/Makefile" ;;
+ "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+ ac_cs_awk_getline=:
+ ac_cs_awk_pipe_init=
+ ac_cs_awk_read_file='
+ while ((getline aline < (F[key])) > 0)
+ print(aline)
+ close(F[key])'
+ ac_cs_awk_pipe_fini=
+else
+ ac_cs_awk_getline=false
+ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+ ac_cs_awk_read_file='
+ print "|#_!!_#|"
+ print "cat " F[key] " &&"
+ '$ac_cs_awk_pipe_init
+ # The final `:' finishes the AND list.
+ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+# Create commands to substitute file output variables.
+{
+ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
+ echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
+ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
+ echo "_ACAWK" &&
+ echo "_ACEOF"
+} >conf$$files.sh &&
+. ./conf$$files.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+rm -f conf$$files.sh
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+ \$ac_cs_awk_pipe_init
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+ if (nfields == 3 && !substed) {
+ key = field[2]
+ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
+ \$ac_cs_awk_read_file
+ next
+ }
+ }
+ print line
+}
+\$ac_cs_awk_pipe_fini
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+ $AWK -f "$ac_tmp/subs.awk"
+else
+ $AWK -f "$ac_tmp/subs.awk" | $SHELL
+fi \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
+ "ntpd/complete.conf":F) sed -e '/^rlimit$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf ;;
+ "ntpdc/nl.pl":F) chmod +x ntpdc/nl.pl ;;
+ "scripts/calc_tickadj/calc_tickadj":F) chmod +x scripts/calc_tickadj/calc_tickadj ;;
+ "scripts/build/mkver":F) chmod +x scripts/build/mkver ;;
+ "scripts/ntp-wait/ntp-wait":F) chmod +x scripts/ntp-wait/ntp-wait ;;
+ "scripts/ntpsweep/ntpsweep":F) chmod +x scripts/ntpsweep/ntpsweep ;;
+ "scripts/ntptrace/ntptrace":F) chmod +x scripts/ntptrace/ntptrace ;;
+ "scripts/ntpver":F) chmod +x scripts/ntpver ;;
+ "scripts/plot_summary":F) chmod +x scripts/plot_summary ;;
+ "scripts/summary":F) chmod +x scripts/summary ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+
+#
+# CONFIG_SUBDIRS section.
+#
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+ # so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ eval "set x $ac_configure_args"
+ shift
+ for ac_arg
+ do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case $ac_arg in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+ | --c=*)
+ ;;
+ --config-cache | -C)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ ;;
+ --disable-option-checking)
+ ;;
+ *)
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+ esac
+ done
+
+ # Always prepend --prefix to ensure using the same prefix
+ # in subdir configurations.
+ ac_arg="--prefix=$prefix"
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+ # Pass --silent
+ if test "$silent" = yes; then
+ ac_sub_configure_args="--silent $ac_sub_configure_args"
+ fi
+
+ # Always prepend --disable-option-checking to silence warnings, since
+ # different subdirs can have different --enable and --with options.
+ ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+ ac_popdir=`pwd`
+ for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ test -d "$srcdir/$ac_dir" || continue
+
+ ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+ $as_echo "$ac_msg" >&6
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ cd "$ac_dir"
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ ac_sub_configure=$ac_srcdir/configure.gnu
+ elif test -f "$ac_srcdir/configure"; then
+ ac_sub_configure=$ac_srcdir/configure
+ elif test -f "$ac_srcdir/configure.in"; then
+ # This should be Cygnus configure.
+ ac_sub_configure=$ac_aux_dir/configure
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+ # Make the cache file name correct relative to the subdirectory.
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+ *) # Relative name.
+ ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+ # The eval makes quoting arguments work.
+ eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+ as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+ fi
+
+ cd "$ac_popdir"
+ done
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..1044d8c
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,4363 @@
+dnl NTP top-level configure.ac -*- Autoconf -*-
+dnl
+m4_include([sntp/m4/version.m4])
+AC_PREREQ([2.61])
+AC_INIT(
+ [ntp4],
+ [VERSION_NUMBER],
+ [http://bugs.ntp.org./],
+ [],
+ [http://www.ntp.org./]dnl
+)
+AC_CONFIG_MACRO_DIR([sntp/m4])
+AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
+
+AC_PRESERVE_HELP_ORDER
+
+# Bump ntp_configure_cache_version for each change to configure.ac or
+# .m4 files which invalidates cached values from previous configure
+# runs.
+#
+# If the change affects cache variables used only by the main NTP
+# configure.ac, then only its version number should be bumped, while
+# the subdir configure.ac version numbers should be unchanged. The
+# same is true for a test/variable that is used only by one subdir
+# being changed incompatibly; only that subdir's cache version needs
+# bumping.
+#
+# If a change affects variables shared by all NTP configure scripts,
+# please bump the version numbers of each. If you are not sure, the
+# safe choice is to bump all on any cache-invalidating change.
+#
+# In order to avoid the risk of version stamp collision between -stable
+# and -dev branches, do not simply increment the version, instead use
+# the date YYYYMMDD optionally with -HHMM if there is more than one
+# bump in a day.
+
+ntp_configure_cache_version=20120806
+
+# When the cache version of config.cache and configure do not
+# match, NTP_CACHEVERSION will flush the cache.
+
+NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
+
+AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
+
+dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
+m4_ifdef(
+ [AM_SILENT_RULES],
+ [AM_SILENT_RULES([yes])]
+)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+dnl the 'build' machine is where we run configure and compile
+dnl the 'host' machine is where the resulting stuff runs.
+AC_DEFINE_UNQUOTED([STR_SYSTEM], ["$host"],
+ [canonical system (cpu-vendor-os) of where we should run])
+AC_CONFIG_HEADERS([config.h])
+dnl AC_ARG_PROGRAM
+
+ntp_atom_ok=${ntp_atom_ok=no}
+ntp_oncore_ok=${ntp_oncore_ok=no}
+ntp_parse_ok=${ntp_parse_ok=no}
+ntp_ripe_ncc_ok=${ntp_parse_ok=no}
+ntp_jupiter_ok=${ntp_jupiter_ok=no}
+
+NTP_PROG_CC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_PROG_YACC
+AC_PROG_CC_C_O
+
+NTP_VPATH_HACK dnl used only by ntpd/Makefile.am
+
+NTP_LOCINFO([sntp]) dnl takes over from NTP_BINDIR, in NTP_LIBNTP
+
+dnl AM_PROG_AR req. automake 1.12
+m4_ifdef(
+ [AM_PROG_AR],
+ [AM_PROG_AR]
+)
+
+# So far, the only shared library we might use is libopts.
+# It's a small library - we might as well use a static version of it.
+AC_DISABLE_SHARED
+AC_PROG_LIBTOOL
+AC_SUBST([LIBTOOL_DEPS])
+
+# NTP has (so far) been relying on leading-edge autogen, which
+# means we need the appropriate corresponding libopts as well.
+# Therefore, by default:
+# - use the version of libopts we ship with
+# - do not install it
+# - build a static copy (AC_DISABLE_SHARED - done earlier)
+case "${enable_local_libopts+set}" in
+ set) ;;
+ *) enable_local_libopts=yes ;;
+esac
+case "${enable_libopts_install+set}" in
+ set) ;;
+ *) enable_libopts_install=no ;;
+esac
+enable_nls=no
+LIBOPTS_CHECK_NOBUILD([sntp/libopts])
+
+NTP_ENABLE_LOCAL_LIBEVENT
+
+NTP_LIBNTP
+
+AC_MSG_CHECKING([for deprecated --with-arlib])
+AC_ARG_WITH([arlib],
+ AS_HELP_STRING([--with-arlib], [- deprecated, arlib not distributed]),
+ [ans=$withval], [ans=no])
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_MSG_WARN([Please do not use --with-arlib, arlib is no longer included. In the future, --with-arlib will not be recognized.])
+ ;;
+esac
+
+dnl we need to check for cross compile tools for vxWorks here
+AC_PROG_AWK
+AS_UNSET([ac_cv_prog_AWK])
+AC_SUBST([AWK]) dnl scripts/ntpver.in
+AC_PROG_MAKE_SET
+
+AC_SUBST([CFLAGS])
+AC_SUBST([LDFLAGS])
+
+AC_PROG_LN_S
+AC_ISC_POSIX
+
+
+AC_PATH_PROG([PATH_PERL], [perl])
+dnl Saving cached hardcoded paths rather than searching $PATH during a
+dnl cached configure run is an optimization not worth the the cost of
+dnl preventing newly-installed tools from being found. Short-circuit
+dnl the caching after the tests so preset overrides still work.
+AS_UNSET([ac_cv_path_PATH_PERL])
+AC_PATH_PROG([PATH_TEST], [test])
+AS_UNSET([ac_cv_path_PATH_TEST])
+test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
+AC_SUBST([CONFIG_SHELL]) dnl for scripts #!/path/to/sh
+
+AC_ARG_WITH(
+ [net-snmp-config],
+ [AS_HELP_STRING(
+ [--with-net-snmp-config],
+ [+ =net-snmp-config]
+ )],
+ [ans=$withval],
+ [ans=yes]
+)
+case "$ans" in
+ no)
+ ;;
+ yes)
+ ans=net-snmp-config
+ ;;
+ /*)
+ ;;
+ */*)
+ AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path])
+ ;;
+ *)
+ ;;
+esac
+PROG_NET_SNMP_CONFIG=$ans
+AC_MSG_CHECKING([for net-snmp-config path])
+case "$PROG_NET_SNMP_CONFIG" in
+ no) ;;
+ /*)
+ PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG
+ ;;
+ *)
+ AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG])
+ AS_UNSET([ac_cv_path_PATH_NET_SNMP_CONFIG])
+;;
+esac
+AC_MSG_RESULT([$PATH_NET_SNMP_CONFIG])
+
+case "$host" in
+ *-*-vxworks*)
+ ac_link="$ac_link $VX_KERNEL"
+ ;;
+esac
+
+# HMS: a check for -lnsl used to be here - now being done in NTP_LIBNTP
+AC_SEARCH_LIBS([openlog], [gen syslog])
+# XXX library list will be in ac_cv_search_openlog
+
+# LIBSECCOMP is off by default -- needs testing with all the features
+# Please send bug reports to loganaden@gmail.com
+AC_MSG_CHECKING([if we want to use libseccomp sandboxing (EXPERIMENTAL)])
+AC_ARG_ENABLE(
+ [libseccomp],
+ [AS_HELP_STRING(
+ [--enable-libseccomp],
+ [EXPERIMENTAL: enable support for libseccomp sandboxing (default is no) ]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=no]
+)
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok" in
+ yes)
+ AC_SEARCH_LIBS(
+ [seccomp_init],
+ [seccomp],
+ [AC_DEFINE([LIBSECCOMP], [1],
+ [Define to any value to include libseccomp sandboxing.])]
+ )
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <sys/prctl.h>
+ #include <linux/seccomp.h>
+
+ int main(void)
+ {
+ int ret;
+ ret = prctl(PR_GET_SECCOMP, 0, 0, 0, 0);
+ if (ret < 0) {
+ switch (errno) {
+ case ENOSYS:
+ return 1;
+ case EINVAL:
+ return 1;
+ default:
+ return 1;
+ }
+ }
+ ret =
+ prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
+ if (ret < 0) {
+ switch (errno) {
+ case EINVAL:
+ return 1;
+ case EFAULT:
+ return 0;
+ default:
+ return 1;
+ }
+ }
+return 1;
+}
+]
+, AC_DEFINE([KERN_SECCOMP], 1,
+[Define to use libseccomp system call filtering.])
+, []
+)
+ ;;
+esac
+
+NTP_FACILITYNAMES
+
+dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
+dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
+dnl so only use one of them. Linux (glibc-2.1.2 and -2.2.2, at least)
+dnl does Strange Things with extra processes using the Posix-compatibility
+dnl real-time library, so we don't want to use it.
+dnl
+dnl 081118 Harlan got tired of looking for a way to get the sched*()
+dnl functions to link OK with either cc or gcc.
+
+case "$host" in
+ *-*-*linux*) ;;
+ *-*-osf4*) ;;
+ *-*-osf5*) ;;
+ *)
+ # HMS: Make sure we check for -lrt for clock_* before this...
+ case "$ac_cv_search_clock_gettime" in
+ '') AC_MSG_ERROR([Internal Error: Haven't looked for clock_gettime() yet!]) ;;
+ esac
+ AC_SEARCH_LIBS([sched_setscheduler], [rt posix4])
+ ;;
+esac
+
+AC_CHECK_HEADERS([bstring.h])
+AC_CHECK_HEADER(
+ [dns_sd.h],
+ [AC_SEARCH_LIBS(
+ [DNSServiceRegister],
+ [dns_sd],
+ [AC_DEFINE([HAVE_DNSREGISTRATION], [1],
+ [Use Rendezvous/DNS-SD registration])]
+ )]
+)
+AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
+
+AC_CHECK_HEADERS([memory.h netdb.h poll.h])
+AC_CHECK_HEADERS([sgtty.h stdlib.h string.h termio.h])
+AC_CHECK_HEADERS([termios.h timepps.h timex.h unistd.h])
+
+case "$host" in
+ *-*-aix*)
+ AC_CHECK_HEADERS([utmpx.h])
+ case "$ac_cv_header_utmpx_h" in
+ yes)
+ ;;
+ *)
+ AC_CHECK_HEADERS([utmp.h])
+ ;;
+ esac
+ ;;
+ *)
+ AC_CHECK_HEADERS([utmp.h utmpx.h])
+ ;;
+esac
+
+#
+# On Suns only (so far) getpass() truncates the typed password to 8
+# characters, but getpassphrase() allows up to 257. Most systems'
+# getpass() does not truncate, at least not so as to affect ntpq and
+# ntpdc password prompts.
+#
+# So check for getpassphrase(), but only on Sun operating systems.
+#
+case "$host" in
+ *-*-sunos*|*-*-solaris*)
+ AC_CHECK_FUNCS([getpassphrase])
+esac
+
+
+AC_CHECK_HEADERS([net/if6.h])
+AC_CHECK_HEADERS([net/route.h], [], [], [
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+])
+
+AC_CHECK_HEADERS([netinfo/ni.h])
+case "$ac_cv_header_netinfo_ni_h" in
+ yes)
+ AC_DEFINE([HAVE_NETINFO], [1], [NetInfo support?])
+esac
+AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h sys/file.h])
+case "$host" in
+ *-*-sunos4*)
+ ;;
+ *)
+ AC_CHECK_HEADERS([sys/ioctl.h])
+ ;;
+esac
+AC_CHECK_HEADERS([sys/ipc.h sys/lock.h sys/mman.h])
+# HMS: Check sys/proc.h and sys/resource.h after some others
+AC_CHECK_HEADERS([sys/modem.h sys/ppsclock.h sys/ppstime.h sched.h])
+case "$ac_cv_header_sched_h" in
+ yes)
+ ;;
+ *)
+ AC_CHECK_HEADERS([sys/sched.h])
+ ;;
+esac
+# HMS: Check sys/shm.h after some others
+AC_CHECK_HEADERS([sys/select.h sys/signal.h sys/sockio.h])
+# HMS: Checked sys/socket.h earlier
+case "$host" in
+ *-*-netbsd*)
+ ;;
+ *)
+ AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h])
+ ;;
+esac
+AC_CHECK_HEADERS([sys/stat.h sys/stream.h stropts.h sys/stropts.h sys/syssgi.h])
+AC_CHECK_HEADERS([sys/systune.h sys/termios.h sys/tpro.h sys/wait.h])
+case "$host" in
+*-convex-*)
+ AC_CHECK_HEADERS([/sys/sync/queue.h /sys/sync/sema.h])
+ ;;
+*-*-bsdi*)
+ AC_CHECK_HEADERS([machine/inline.h sys/pcl720.h sys/i8253.h])
+ ;;
+esac
+
+case "$host" in
+ *-*-solaris2.6)
+ # Broken...
+ ;;
+ *)
+ AC_CHECK_FUNCS([ntp_adjtime ntp_gettime])
+ ;;
+esac
+
+case "$host" in
+ *-*-*linux*)
+ case "$ac_cv_func_ntp_gettime" in
+ yes)
+ ;;
+ *)
+ AC_CHECK_FUNCS([__ntp_gettime])
+ case "$ac_cv_func___ntp_gettime" in
+ yes)
+ AC_DEFINE([ntp_gettime], [__ntp_gettime], [deviant])
+ AC_DEFINE([HAVE_NTP_GETTIME], [1], [via __ntp_gettime])
+ esac
+ ;;
+ esac
+ AC_CHECK_FUNCS([adjtimex])
+ case "$ac_cv_func_adjtimex" in
+ yes)
+ AC_DEFINE([ntp_adjtime], [adjtimex], [deviant])
+ AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via adjtimex])
+ have_adjtimex=1
+ ;;
+ *)
+ AC_CHECK_FUNCS([__adjtimex])
+ case "$ac_cv_func___adjtimex" in
+ yes)
+ AC_DEFINE([ntp_adjtime], [__adjtimex], [deviant])
+ AC_DEFINE([HAVE_NTP_ADJTIME], [1], [via __adjtimex])
+ AC_DEFINE([adjtimex], [__adjtimex], [deviant])
+ AC_DEFINE([HAVE_ADJTIMEX], [1], [via __adjtimex])
+ have_adjtimex=1
+ esac
+ ;;
+ esac
+esac
+case "$have_adjtimex" in
+ '')
+ # nlist stuff is only needed for tickadj.
+ saved_LIBS="$LIBS"
+ LIBS=
+ AC_SEARCH_LIBS([nlist], [elf ld mld])
+ # XXX ac_cv_search_nlist will be 'none required', 'no', or '-l...'
+ AC_SEARCH_LIBS([kvm_open], [kvm]) dnl We already know about -lelf here...
+ # XXX ac_cv_search_kvm_open will be 'none required', 'no', or '-l...'
+ AC_CHECK_HEADERS([nlist.h sys/var.h])
+ case "$ac_cv_header_nlist_h" in
+ yes)
+ AC_DEFINE([NLIST_STRUCT], [1], [nlist stuff])
+ AC_CACHE_CHECK(
+ [for n_un in struct nlist],
+ [ntp_cv_struct_nlist_n_un],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <nlist.h>
+ ]],
+ [[
+ struct nlist n;
+ n.n_un.n_name = 0;
+ ]]
+ )]
+ [ntp_cv_struct_nlist_n_un=yes],
+ [ntp_cv_struct_nlist_n_un=no]
+ )]
+ )
+ case "$ntp_cv_struct_nlist_n_un" in
+ yes)
+ AC_DEFINE([NLIST_NAME_UNION], [1],
+ [does struct nlist use a name union?])
+ esac
+ esac
+ AC_SUBST([LDADD_NLIST])
+ LDADD_NLIST="$LIBS"
+ LIBS="$saved_LIBS"
+ AS_UNSET([saved_LIBS])
+esac
+
+AC_CHECK_HEADERS([sys/proc.h], [], [], [
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+])
+
+AC_CHECK_HEADERS([sys/resource.h], [], [], [
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+])
+
+AC_CHECK_HEADERS([sys/shm.h], [], [], [
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_IPC_H
+ # include <sys/ipc.h>
+ #endif
+])
+
+AC_CHECK_HEADERS([sys/timex.h], [], [], [
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+])
+
+AC_TYPE_SIGNAL
+AC_TYPE_OFF_T
+AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c
+
+AC_CACHE_CHECK(
+ [for a fallback value for HZ],
+ [ntp_cv_default_hz],
+ [
+ ntp_cv_default_hz=100
+ case "$host" in
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ ntp_cv_default_hz=1024
+ ;;
+ mips-dec-ultrix4*)
+ ntp_cv_default_hz=256
+ ;;
+ esac
+ ]
+)
+AC_DEFINE_UNQUOTED([DEFAULT_HZ], [$ntp_cv_default_hz],
+ [What is the fallback value for HZ?])
+
+AC_CACHE_CHECK(
+ [if we need to override the system's value for HZ],
+ [ntp_cv_override_hz],
+ [
+ ntp_cv_override_hz=no
+ case "$host" in
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ ntp_cv_override_hz=yes
+ ;;
+ mips-dec-ultrix4*)
+ ntp_cv_override_hz=yes
+ ;;
+ *-*-freebsd*)
+ ntp_cv_override_hz=yes
+ ;;
+ *-*-sunos4*)
+ ntp_cv_override_hz=yes
+ ;;
+ *-*-kfreebsd*)
+ ntp_cv_override_hz=yes
+ ;;
+ esac
+ ]
+)
+case "$ntp_cv_override_hz" in
+ yes)
+ AC_DEFINE([OVERRIDE_HZ], [1],
+ [Do we need to override the system's idea of HZ?])
+esac
+
+dnl AC_CACHE_CHECK(ut_host in struct utmp, ac_cv_func_ut_host_in_utmp,
+dnl [AC_TRY_LINK([#include <sys/types.h>
+dnl #include <utmp.h>], [struct utmp ut; ut.ut_host;],
+dnl ac_cv_func_ut_host_in_utmp=yes, ac_cv_func_ut_host_in_utmp=no)])
+dnl if test $su_cv_func_ut_host_in_utmp = yes; then
+dnl AC_DEFINE(HAVE_UT_HOST)
+dnl fi
+
+dnl AC_MSG_CHECKING(if we can get the system boot time)
+dnl AC_CACHE_VAL(su_cv_have_boot_time,
+dnl [AC_EGREP_CPP(yes,
+dnl [#ifdef HAVE_UTMPX_H
+dnl #include <utmpx.h>
+dnl #else
+dnl #include <utmp.h>
+dnl #endif
+dnl #ifdef BOOT_TIME
+dnl yes
+dnl #endif
+dnl ], su_cv_have_boot_time=yes, su_cv_have_boot_time=no)])
+dnl AC_MSG_RESULT($su_cv_have_boot_time)
+
+AC_CACHE_CHECK(
+ [for struct rt_msghdr],
+ [ntp_cv_struct_rt_msghdr],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+ #include <net/route.h>
+ ]],
+ [[
+ struct rt_msghdr p;
+ ]]
+ )],
+ [ntp_cv_struct_rt_msghdr=yes],
+ [ntp_cv_struct_rt_msghdr=no]
+ )]
+)
+
+AC_CACHE_CHECK(
+ [for struct rtattr],
+ [ntp_cv_rtattr],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stddef.h>
+ #include <sys/socket.h>
+ #include <linux/rtnetlink.h>
+ ]],
+ [[
+ struct rtattr p;
+ ]]
+ )],
+ [ntp_cv_rtattr=yes],
+ [ntp_cv_rtattr=no]
+ )]
+)
+
+case "$ntp_cv_struct_rt_msghdr$ntp_cv_rtattr" in
+ *yes*)
+ AC_DEFINE([HAS_ROUTING_SOCKET], [1],
+ [Do we have a routing socket (rt_msghdr or rtattr)?])
+ case "$ntp_cv_rtattr" in
+ yes)
+ AC_DEFINE([HAVE_RTNETLINK], [1],
+ [Do we have Linux routing socket?])
+ esac
+esac
+
+AC_CACHE_CHECK(
+ [struct sigaction for sa_sigaction],
+ [ntp_cv_struct_sigaction_has_sa_sigaction],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <signal.h>
+ ]],
+ [[
+ struct sigaction act;
+ act.sa_sigaction = 0;
+ ]]
+ )],
+ [ntp_cv_struct_sigaction_has_sa_sigaction=yes],
+ [ntp_cv_struct_sigaction_has_sa_sigaction=no]
+ )]
+)
+case "$ntp_cv_struct_sigaction_has_sa_sigaction" in
+ yes)
+ AC_DEFINE([HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION], [1], [Obvious])
+esac
+
+AC_CACHE_CHECK(
+ [for struct ppsclockev],
+ [ntp_cv_struct_ppsclockev],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TERMIOS_H
+ # include <sys/termios.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_SYS_PPSCLOCK_H
+ # include <sys/ppsclock.h>
+ #endif
+ ]],
+ [[
+ extern struct ppsclockev *pce;
+ return pce->serial;
+ ]]
+ )],
+ [ntp_cv_struct_ppsclockev=yes],
+ [ntp_cv_struct_ppsclockev=no]
+ )]
+)
+case "$ntp_cv_struct_ppsclockev" in
+ yes)
+ AC_DEFINE([HAVE_STRUCT_PPSCLOCKEV], [1],
+ [Does a system header define struct ppsclockev?])
+esac
+
+case "$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
+ *yes*)
+ AC_CACHE_CHECK(
+ [for struct snd_size],
+ [ntp_cv_struct_snd_size],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_MACHINE_SOUNDCARD_H
+ # include <machine/soundcard.h>
+ #endif
+ #ifdef HAVE_SYS_SOUNDCARD_H
+ # include <sys/soundcard.h>
+ #endif
+ ]],
+ [[
+ extern struct snd_size *ss;
+ return ss->rec_size;
+ ]]
+ )],
+ [ntp_cv_struct_snd_size=yes],
+ [ntp_cv_struct_snd_size=no]
+ )]
+ )
+ case "$ntp_cv_struct_snd_size" in
+ yes)
+ AC_DEFINE([HAVE_STRUCT_SND_SIZE], [1],
+ [Do we have struct snd_size?])
+ esac
+esac
+
+AC_CACHE_CHECK(
+ [struct clockinfo for hz],
+ [ntp_cv_struct_clockinfo_has_hz],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/time.h>
+ ]],
+ [[
+ extern struct clockinfo *pc;
+ return pc->hz;
+ ]]
+ )],
+ [ntp_cv_struct_clockinfo_has_hz=yes],
+ [ntp_cv_struct_clockinfo_has_hz=no]
+ )]
+)
+case "$ntp_cv_struct_clockinfo_has_hz" in
+ yes)
+ AC_DEFINE([HAVE_HZ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
+esac
+
+AC_CACHE_CHECK(
+ [struct clockinfo for tickadj],
+ [ntp_cv_struct_clockinfo_has_hz],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/time.h>
+ ]],
+ [[
+ extern struct clockinfo *pc;
+ return pc->tickadj;
+ ]]
+ )],
+ [ntp_cv_struct_clockinfo_has_hz=yes],
+ [ntp_cv_struct_clockinfo_has_hz=no]
+ )]
+)
+case "$ntp_cv_struct_clockinfo_has_hz" in
+ yes)
+ AC_DEFINE([HAVE_TICKADJ_IN_STRUCT_CLOCKINFO], [1], [Obvious])
+esac
+
+case "$ntp_cv_struct_ntptimeval" in
+ yes)
+ AC_CHECK_MEMBERS(
+ [struct ntptimeval.time.tv_nsec],
+ [],
+ [],
+ [
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #else
+ # ifdef HAVE_TIME_H
+ # include <time.h>
+ # endif
+ #endif
+ #ifdef HAVE_SYS_TIMEX_H
+ # include <sys/timex.h>
+ #else
+ # ifdef HAVE_TIMEX_H
+ # include <timex.h>
+ # endif
+ #endif
+ ]
+ )
+esac
+
+####
+
+saved_LIBS="$LIBS"
+LIBS="$LIBS $LDADD_LIBNTP"
+AC_CHECK_FUNCS([daemon])
+# XXX if we keep everything in LIBS and also keep separate lists, this simplifies.
+LIBS="$saved_LIBS"
+AS_UNSET([saved_LIBS])
+
+AC_CHECK_FUNCS(
+ [finite],
+ [],
+ [AC_CHECK_FUNCS(
+ [isfinite],
+ [],
+ [
+ AC_MSG_CHECKING([for isfinite with <math.h>])
+ _libs=$LIBS
+ # XXX
+ LIBS="$LIBS -lm"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <math.h>
+ ]],
+ [[
+ float f = 0.0;
+ isfinite(f);
+ ]]
+ )],
+ [ans=yes],
+ [ans=no]
+ )
+ LIBS=$_libs
+ AC_MSG_RESULT([$ans])
+ case "$ans" in
+ yes)
+ AC_DEFINE([HAVE_ISFINITE], [1])
+ esac
+ ]
+ )]
+)
+
+AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal])
+
+# kvm_open() is only used by tickadj. Also see above.
+case "$ac_cv_header_kvm_h" in
+ yes)
+ AC_CHECK_FUNCS([kvm_open])
+ ;;
+esac
+
+case "$host" in
+ *-*-sco3.2v5.0.*)
+ # Just stubs. Sigh.
+ ;;
+ *) AC_CHECK_FUNCS([mkstemp])
+ ;;
+esac
+AC_CHECK_FUNCS([mktime])
+case "$host" in
+ *-*-aix[[4-9]]*)
+ # XXX only verified thru AIX6.
+ # Just a stub. Sigh.
+ ;;
+ *-*-irix[[45]]*)
+ # Just a stub in "old" Irix. Sigh.
+ ;;
+# In the belief that the fix for bug 1223 fixes mlockall() under linux...
+# *-*-*linux*)
+# # there, but more trouble than it is worth for now (resolver problems)
+# ;;
+ *-*-qnx*)
+ # Apparently there but not working in QNX. Sigh?
+ ;;
+ *-*-sco3.2v5.0.*)
+ # Just a stub. Sigh.
+ ;;
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ # mlockall is there, as a #define calling memlk via <sys/mman.h>
+ # Not easy to test for - cheat.
+ AC_CHECK_FUNCS([memlk], [ac_cv_func_mlockall=yes])
+ AC_CHECK_FUNCS([mlockall])
+ ;;
+ *) AC_CHECK_FUNCS([mlockall])
+ ;;
+esac
+AC_CHECK_FUNCS([nice plock pututline pututxline readlink rtprio])
+case "$host" in
+ *-*-aix[[4-9]]*)
+ # XXX only verified thru AIX6.
+ # Just a stub in AIX 4. Sigh.
+ ;;
+ *-*-solaris2.5*)
+ # Just stubs in solaris2.5. Sigh.
+ ;;
+ *) AC_CHECK_FUNCS([sched_setscheduler])
+ ;;
+esac
+AC_CHECK_FUNCS([setlinebuf setpgid setpriority setsid setvbuf])
+AC_CHECK_FUNCS([strdup strerror setrlimit strchr])
+case "$host" in
+ *-*-aix[[4-9]]*)
+ # XXX only verified thru AIX6.
+ # Just stubs. Sigh.
+ ;;
+ *-*-netbsd1*)
+ # Just stubs. Sigh.
+ ;;
+ *-*-netbsdelf1*)
+ # Just stubs. Sigh.
+ ;;
+ *-*-openbsd*)
+ # Just stubs. Sigh.
+ ;;
+ *)
+ AC_CHECK_FUNCS([timer_create])
+ ;;
+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
+case "$ac_cv_func__exit::$host_os" in
+ yes::netbsd*)
+ ntp_worker_child_exit=_exit
+ ;;
+ yes::openbsd*)
+ ntp_worker_child_exit=_exit
+ ;;
+esac
+AC_DEFINE_UNQUOTED([WORKER_CHILD_EXIT], [$ntp_worker_child_exit],
+ [routine worker child proc uses to exit.])
+
+AC_CHECK_FUNCS([umask uname updwtmp updwtmpx])
+
+###
+
+# http://bugs.ntp.org/737
+case "$ac_cv_func_recvmsg" in
+ yes)
+ AC_CACHE_CHECK(
+ [if we need extra help to define struct iovec],
+ [ntp_cv_struct_iovec_help],
+ [
+ compiled=no
+ for ntp_cv_struct_iovec_help in '0' '1'; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #if $ntp_cv_struct_iovec_help
+ # include <sys/uio.h>
+ #endif
+ ]],
+ [[
+ void foo(void) {
+ ssize_t x;
+ int s = 0;
+ struct iovec iov;
+ struct msghdr mh;
+ int flags = 0;
+
+ mh.msg_iov = &iov;
+ x = recvmsg(s, &mh, flags);
+ }
+ ]]
+ )],
+ [compiled=yes ; break 1],
+ []
+ )
+ done
+ case "$compiled" in
+ no)
+ ntp_cv_struct_iovec_help=0
+ esac
+ AS_UNSET([compiled])
+ ]
+ )
+ case "$ntp_cv_struct_iovec_help" in
+ 1)
+ AC_DEFINE([HAVE_SYS_UIO_H], [1],
+ [Use sys/uio.h for struct iovec help])
+ esac
+esac
+
+AC_CACHE_CHECK(
+ [number of arguments taken by setpgrp()],
+ [ntp_cv_func_setpgrp_nargs],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ ]],
+ [[
+ setpgrp(0, 0);
+ ]]
+ )],
+ [ntp_cv_func_setpgrp_nargs=2],
+ [ntp_cv_func_setpgrp_nargs=0]
+ )]
+)
+case "$ntp_cv_func_setpgrp_nargs" in
+ 0)
+ AC_DEFINE([HAVE_SETPGRP_0], [1],
+ [define if setpgrp takes 0 arguments])
+esac
+
+AC_CACHE_CHECK(
+ [if we need to declare 'errno'],
+ [ntp_cv_decl_errno],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+ ]],
+ [[
+ errno = 0;
+ ]]
+ )],
+ [ntp_cv_decl_errno=no],
+ [ntp_cv_decl_errno=yes]
+ )]
+)
+case "$ntp_cv_decl_errno" in
+ yes)
+ AC_DEFINE([DECL_ERRNO], [1], [Declare errno?])
+esac
+
+dnl (prr) aix 4.3 defines h_errno as (*(int *)h_errno_which()) for
+dnl MT purposes. This makes the line "extern int h_errno" choke
+dnl the compiler. Hopefully adding !defined(h_errno) fixes this
+dnl without breaking any other platforms.
+dnl
+AC_CACHE_CHECK(
+ [if we may declare 'h_errno'],
+ [ntp_cv_decl_h_errno],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #ifdef HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+ #ifdef HAVE_RESOLV_H
+ # include <resolv.h>
+ #endif
+ ]],
+ [[
+ extern int h_errno;
+ ]]
+ )],
+ [ntp_cv_decl_h_errno=yes],
+ [ntp_cv_decl_h_errno=no]
+ )]
+)
+case "$ntp_cv_decl_h_errno" in
+ yes)
+ AC_DEFINE([DECL_H_ERRNO], [1], [Declare h_errno?])
+esac
+
+AC_CACHE_CHECK(
+ [if declaring 'syscall()' is ok],
+ [ntp_cv_decl_syscall],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ ]],
+ [[
+ extern int syscall (int, ...);
+ ]]
+ )]
+ [ntp_cv_decl_syscall=yes],
+ [ntp_cv_decl_syscall=no]
+ )]
+)
+case "$ntp_cv_decl_syscall" in
+ yes)
+ AC_DEFINE([DECL_SYSCALL], [1], [Declare syscall()?])
+esac
+
+case "$host" in
+ *-*-aix4.3.*)
+ AC_DEFINE([DECL_HSTRERROR_0], [1], [Declaration style]) # Needed for XLC under AIX 4.3.2
+ ;;
+ *-*-mpeix*)
+ AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_INET_NTOA_0], [1], [Declaration style])
+ AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
+ ;;
+ *-*-osf[[45]]*)
+ AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
+ AC_DEFINE([DECL_STIME_1], [1], [Declaration style])
+ ;;
+ *-*-qnx*)
+ AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
+ ;;
+ *-*-riscos4*)
+ AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
+ AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
+ AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
+ AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
+ AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
+ AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
+ AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
+ AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
+ ;;
+ *-*-solaris2*)
+ AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETPRIORITY_1], [1], [Declaration style])
+ case "$host" in
+ *-*-solaris2.4)
+ AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
+ ;;
+ esac
+ ;;
+ *-*-sunos4*)
+ AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_BCOPY_0], [1], [Declaration style])
+ AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
+ AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
+ AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
+ AC_DEFINE([DECL_MEMMOVE_0], [1], [Declaration style])
+ AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
+ AC_DEFINE([DECL_MKSTEMP_0], [1], [Declaration style])
+ AC_DEFINE([DECL_RENAME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SIGVEC_0], [1], [Declaration style])
+ case "`basename $ac_cv_prog_CC`" in
+ acc*) ;;
+ *) AC_DEFINE([DECL_STDIO_0], [1], [Declaration style])
+ ;;
+ esac
+ AC_DEFINE([DECL_STRTOL_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TIME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TOLOWER_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TOUPPER_0], [1], [Declaration style])
+ AC_DEFINE([DECL_STRERROR_0], [1], [Declaration style])
+ ;;
+ *-*-ultrix4*)
+ AC_DEFINE([DECL_ADJTIME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_BZERO_0], [1], [Declaration style])
+ AC_DEFINE([DECL_CFSETISPEED_0], [1], [Declaration style])
+ AC_DEFINE([DECL_IOCTL_0], [1], [Declaration style])
+ AC_DEFINE([DECL_IPC_0], [1], [Declaration style])
+ AC_DEFINE([DECL_MKTEMP_0], [1], [Declaration style])
+ AC_DEFINE([DECL_NLIST_0], [1], [Declaration style])
+ AC_DEFINE([DECL_PLOCK_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SELECT_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETITIMER_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SETPRIORITY_0], [1], [Declaration style])
+ AC_DEFINE([DECL_STIME_0], [1], [Declaration style])
+ AC_DEFINE([DECL_SYSLOG_0], [1], [Declaration style])
+ AC_DEFINE([DECL_TIMEOFDAY_0], [1], [Declaration style])
+ ;;
+esac
+
+case "$host" in
+ *-*-sco3.2*)
+ AC_DEFINE([TERMIOS_NEEDS__SVID3], [1],
+ [Do we need to #define _SVID3 when we #include <termios.h>?])
+ ;;
+esac
+
+case "$host" in
+ *-*-hpux[[567]]*)
+ AC_DEFINE([NEED_RCVBUF_SLOP], [1],
+ [Do we need extra room for SO_RCVBUF? (HPUX < 8)])
+esac
+
+dnl Using AC_CACHE_CHECK to honor preset ntp_cv_var_open_bcast_socket
+AC_CACHE_CHECK(
+ [if we will open the broadcast socket],
+ [ntp_cv_var_open_bcast_socket],
+ [
+ ans=yes
+ case "$host" in
+ *-*-domainos)
+ ans=no
+ esac
+ ntp_cv_var_open_bcast_socket=$ans
+ ]
+)
+case "$ntp_cv_var_open_bcast_socket" in
+ yes)
+ AC_DEFINE([OPEN_BCAST_SOCKET], [1],
+ [Should we open the broadcast socket?])
+esac
+
+case "$host" in
+ *-*-hpux*)
+ AC_DEFINE([NEED_HPUX_FINDCONFIG], [1],
+ [Do we want the HPUX FindConfig()?])
+esac
+
+dnl using AC_CACHE_CHECK to honor preset $ntp_cv_arg_setpgrp_negpid
+AC_CACHE_CHECK(
+ [if process groups are set with -pid],
+ [ntp_cv_arg_setpgrp_negpid],
+ [
+ case "$host" in
+ *-*-hpux[[567]]*)
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=yes
+ ;;
+ *-*-*linux*)
+ ans=yes
+ ;;
+ *-*-sunos3*)
+ ans=yes
+ ;;
+ *-*-ultrix2*)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ntp_cv_arg_setpgrp_negpid=$ans
+ ]
+)
+case "$ntp_cv_arg_setpgrp_negpid" in
+ yes)
+ AC_DEFINE([UDP_BACKWARDS_SETOWN], [1],
+ [Do we set process groups with -pid?])
+esac
+
+AC_CACHE_CHECK(
+ [if we need a ctty for F_SETOWN],
+ [ntp_cv_func_ctty_for_f_setown],
+ [
+ case "$host" in
+ *-*-bsdi[[23]]*)
+ ans=yes
+ ;;
+ *-*-freebsd*)
+ ans=yes
+ ;;
+ # NetBSD versions prior to 3.99.8 require a CTTY for F_SETOWN,
+ # while later versions will fail a ioctl(TIOCSCTTY, 0) call in
+ # some cases and so should not have USE_FSETOWNCTTY. "netbsd"
+ # in $host may be followed by "aout", "ecoff", or "elf".
+ *-*-netbsd*[[a-z]]3.[[0-8]]*|*-*-netbsd*[[a-z]][[0-2]].*|*-*-netbsd*[[a-z]]3.99.[[0-7]])
+ ans=yes
+ ;;
+ *-*-netbsd3.[[0-8]]*|*-*-netbsd[[0-2]].*|*-*-netbsd3.99.[[0-7]])
+ ans=yes
+ ;;
+ *-*-openbsd*)
+ ans=yes
+ ;;
+ *-*-osf*)
+ ans=yes
+ ;;
+ *-*-darwin*)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ntp_cv_func_ctty_for_f_setown=$ans
+ ]
+)
+case "$ntp_cv_func_ctty_for_f_setown" in
+ yes)
+ AC_DEFINE([USE_FSETOWNCTTY], [1], [Must we have a CTTY for fsetown?])
+esac
+
+AC_CACHE_CHECK(
+ [if the OS clears cached routes when more specifics become available],
+ [ntp_cv_os_routeupdates],
+ [
+ case "$host" in
+ *-*-netbsd*)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ntp_cv_os_routeupdates=$ans
+ ]
+)
+case "$ntp_cv_os_routeupdates" in
+ yes)
+ AC_DEFINE([OS_MISSES_SPECIFIC_ROUTE_UPDATES], [1],
+ [need to recreate sockets on changed routing?])
+esac
+
+AC_CACHE_CHECK(
+ [if the wildcard socket needs REUSEADDR to bind other addresses],
+ [ntp_cv_os_wildcardreuse],
+ [
+ case "$host" in
+ *-*-*linux*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+ esac
+ ntp_cv_os_wildcardreuse=$ans
+ ]
+)
+case "$ntp_cv_os_wildcardreuse" in
+ yes)
+ AC_DEFINE([OS_NEEDS_REUSEADDR_FOR_IFADDRBIND], [1],
+ [wildcard socket needs REUSEADDR to bind interface addresses])
+esac
+
+case "$host" in
+ *-*-aix*)
+ AC_DEFINE([NLIST_EXTRA_INDIRECTION], [1],
+ [Might nlist() values require an extra level of indirection (AIX)?])
+esac
+
+AC_CACHE_CHECK(
+ [for a minimum recommended value of tickadj],
+ [ntp_cv_var_min_rec_tickadj],
+ [
+ ans=no
+ case "$host" in
+ *-*-aix*)
+ ans=40
+ ;;
+ esac
+ ntp_cv_var_min_rec_tickadj=$ans
+ ]
+)
+case "$ntp_cv_var_min_rec_tickadj" in
+ ''|no)
+ ;;
+ *)
+ AC_DEFINE_UNQUOTED([MIN_REC_TICKADJ], [$ntp_cv_var_min_rec_tickadj],
+ [Should we recommend a minimum value for tickadj?])
+esac
+
+AC_CACHE_CHECK(
+ [if the TTY code permits PARENB and IGNPAR],
+ [ntp_cv_no_parenb_ignpar],
+ [
+ ans=no
+ case "$host" in
+ i?86-*-*linux*)
+ ans=yes
+ ;;
+ mips-sgi-irix*)
+ ans=yes
+ ;;
+ i?86-*-freebsd[[123]].*)
+ ;;
+ i?86-*-freebsd*)
+ ans=yes
+ ;;
+ *-*-unicosmp*)
+ ans=yes
+ ;;
+ esac
+ ntp_cv_no_parenb_ignpar=$ans
+ ]
+)
+case "$ntp_cv_no_parenb_ignpar" in
+ yes)
+ AC_DEFINE([NO_PARENB_IGNPAR], [1],
+ [Is there a problem using PARENB and IGNPAR?])
+esac
+
+AC_MSG_CHECKING([if we're including processing time debugging code])
+AC_ARG_ENABLE(
+ [debug-timing],
+ [AS_HELP_STRING(
+ [--enable-debug-timing],
+ [- include processing time debugging code (costs performance)]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=no]
+)
+case "$ntp_ok" in
+ yes)
+ AC_DEFINE([DEBUG_TIMING], [1], [Enable processing time debugging?])
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([for a the number of minutes in a DST adjustment])
+AC_ARG_ENABLE(
+ [dst-minutes],
+ [AS_HELP_STRING(
+ [--enable-dst-minutes],
+ [=60 minutes per DST adjustment]) dnl @<:@ is [, @:>@ is ]
+ ],
+ [ans=$enableval],
+ [ans=60]
+)
+AC_DEFINE_UNQUOTED([DSTMINUTES], [$ans],
+ [The number of minutes in a DST adjustment])
+AC_MSG_RESULT([$ans])
+
+AC_MSG_CHECKING([if ntpd will retry permanent DNS failures])
+AC_ARG_ENABLE(
+ [ignore-dns-errors],
+ [AS_HELP_STRING(
+ [--enable-ignore-dns-errors],
+ [- retry DNS queries on any error]
+ )],
+ [ans=$enableval],
+ [ans=no]
+)
+case "$ans" in
+ yes)
+ AC_DEFINE([IGNORE_DNS_ERRORS], [1],
+ [Retry queries on _any_ DNS error?])
+esac
+AC_MSG_RESULT([$ans])
+
+AC_CACHE_CHECK(
+ [availability of ntp_{adj,get}time()],
+ [ntp_cv_var_ntp_syscalls],
+ [
+ ntp_cv_var_ntp_syscalls=no
+ case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
+ yesyes*)
+ ntp_cv_var_ntp_syscalls=libc
+ ;;
+ *yes)
+ ntp_cv_var_ntp_syscalls=inline
+ ;;
+ *)
+ AC_PREPROC_IFELSE(
+ [
+ #include <sys/syscall.h>
+ #if !defined(SYS_ntp_gettime) || !defined(SYS_ntp_adjtime)
+ # error
+ #endif
+ ],
+ [ntp_cv_var_ntp_syscalls=kernel]
+ )
+ ;;
+ esac
+ ]
+)
+case "$ntp_cv_var_ntp_syscalls" in
+ libc)
+ AC_DEFINE([NTP_SYSCALLS_LIBC], [1],
+ [Do we have ntp_{adj,get}time in libc?])
+ ;;
+ kernel)
+ AC_DEFINE([NTP_SYSCALLS_STD], [1],
+ [Do we have ntp_{adj,get}time in the kernel?])
+ ;;
+esac
+
+AC_CACHE_CHECK(
+ [if sys/timex.h has STA_FLL],
+ [ntp_cv_var_sta_fll],
+ [AC_PREPROC_IFELSE(
+ [
+ #include <sys/timex.h>
+ #ifndef STA_FLL
+ # error
+ #endif
+ ],
+ [ntp_cv_var_sta_fll=yes],
+ [ntp_cv_var_sta_fll=no]
+ )]
+)
+
+AC_CACHE_CHECK(
+ [if we have kernel PLL support],
+ [ntp_cv_var_kernel_pll],
+ [dnl ntp_cv_var_ntp_syscalls is {no,libc,kernel}
+ case "$ac_cv_header_sys_timex_h$ntp_cv_struct_ntptimeval$ntp_cv_var_sta_fll$ntp_cv_var_ntp_syscalls" in
+ *no*)
+ ntp_cv_var_kernel_pll=no
+ ;;
+ *) ntp_cv_var_kernel_pll=yes
+ ;;
+ esac
+ ]
+)
+case "$ntp_cv_var_kernel_pll" in
+ yes)
+ AC_DEFINE([KERNEL_PLL], [1],
+ [Does the kernel support precision time discipline?])
+esac
+
+AC_CACHE_CHECK(
+ [if SIOCGIFCONF returns buffer size in the buffer],
+ [ntp_cv_size_returned_in_buffer],
+ [
+ ans=no
+ case "$host" in
+ *-fujitsu-uxp*)
+ ans=yes
+ ;;
+ *-ncr-sysv4*)
+ ans=yes
+ ;;
+ *-univel-sysv*)
+ ans=yes
+ ;;
+ esac
+ ntp_cv_size_returned_in_buffer=$ans
+ ]
+)
+case "$ntp_cv_size_returned_in_buffer" in
+ yes)
+ AC_DEFINE([SIZE_RETURNED_IN_BUFFER], [1],
+ [Does SIOCGIFCONF return size in the buffer?])
+esac
+
+# Check for ioctls TIOCGPPSEV
+AC_MSG_CHECKING([for TTY PPS ioctl TIOCGPPSEV])
+case "$ac_cv_header_termios_h" in
+ yes)
+ AC_PREPROC_IFELSE(
+ [
+ #include <termios.h>
+ #ifndef TIOCGPPSEV
+ # error
+ #endif
+ ],
+ [ntp_ok=yes],
+ [ntp_ok=no]
+ )
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+ AC_DEFINE([HAVE_TIOCGPPSEV], [1],
+ [Do we have the TIOCGPPSEV ioctl (Solaris)?])
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+# Check for ioctls TIOCSPPS
+AC_MSG_CHECKING([for TTY PPS ioctl TIOCSPPS])
+case "$ac_cv_header_termios_h" in
+ yes)
+ AC_PREPROC_IFELSE(
+ [
+ #include <termios.h>
+ #ifndef TIOCSPPS
+ # error
+ #endif
+ ],
+ [ntp_ok=yes],
+ [ntp_ok=no]
+ )
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+ AC_DEFINE([HAVE_TIOCSPPS], [1],
+ [Do we have the TIOCSPPS ioctl (Solaris)?])
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+# Check for ioctls CIOGETEV
+AC_MSG_CHECKING([for TTY PPS ioctl CIOGETEV])
+case "$ac_cv_header_sys_ppsclock_h" in
+ yes)
+ AC_PREPROC_IFELSE(
+ [
+ #include <sys/ppsclock.h>
+ #ifndef CIOGETEV
+ # error
+ #endif
+ ],
+ [ntp_ok=yes],
+ [ntp_ok=no]
+ )
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+ AC_DEFINE([HAVE_CIOGETEV], [1],
+ [Do we have the CIOGETEV ioctl (SunOS, Linux)?])
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+# ATOM/PPSAPI stuff.
+
+ntp_atom_ok=yes
+
+# Check for header timepps.h, if found then we have PPS API (Draft RFC) stuff.
+
+# The PPSAPI headers need "inline" ($ac_cv_c_inline='inline')
+# The PPSAPI needs struct timespec.
+# The PPSAPI also needs a timepps header.
+
+case "$ac_cv_c_inline$ntp_cv_struct_timespec" in
+ inlineyes)
+ case "$ac_cv_header_timepps_h$ac_cv_header_sys_timepps_h$host_os" in
+ *yes* | *sunos* | *solaris* | *sco* | *netbsd* )
+ AC_DEFINE(HAVE_PPSAPI, 1, [Do we have the PPS API per the Draft RFC?])
+ ntp_jupiter_ok=yes
+ ntp_oncore_ok=yes
+ ntp_parse_ok=yes
+ ntp_ripe_ncc_ok=yes
+ ;;
+ esac
+ ;;
+esac
+
+# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
+AC_CHECK_HEADER([linux/serial.h])
+case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
+ yesyes)
+ AC_MSG_CHECKING([ioctl TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG])
+ AC_PREPROC_IFELSE(
+ [
+ #include <sys/time.h>
+ typedef int u_int;
+ #include <sys/ppsclock.h>
+ #include <linux/serial.h>
+
+ #ifndef TIOCGSERIAL
+ # error
+ #endif
+ #ifndef TIOCSSERIAL
+ # error
+ #endif
+ #ifndef ASYNC_PPS_CD_POS
+ # error
+ #endif
+ #ifndef ASYNC_PPS_CD_NEG
+ # error
+ #endif
+ #ifndef CIOGETEV
+ # error
+ #endif
+ ],
+ [ntp_ok=yes],
+ [ntp_ok=no]
+ )
+ AC_MSG_RESULT([$ntp_ok])
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+ AC_DEFINE([HAVE_TIO_SERIAL_STUFF], 1,
+ [Do we have the TIO serial stuff?])
+esac
+
+# Check for SHMEM_STATUS support
+AC_MSG_CHECKING([SHMEM_STATUS support])
+case "$ac_cv_header_sys_mman_h" in
+ yes)
+ ntp_ok=yes
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+esac
+case "$ntp_ok" in
+ yes)
+ AC_DEFINE([ONCORE_SHMEM_STATUS], [1],
+ [Do we have support for SHMEM_STATUS?])
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+ntp_refclock=no
+
+# HPUX only, and by explicit request
+AC_MSG_CHECKING([Datum/Bancomm bc635/VME interface])
+AC_ARG_ENABLE(
+ [BANCOMM],
+ [AS_HELP_STRING(
+ [--enable-BANCOMM],
+ [- Datum/Bancomm bc635/VME interface]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=no]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_BANC], [1], [Datum/Bancomm bc635/VME interface?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$host" in
+ yes*-*-hpux*) ;;
+ yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
+esac
+
+#HPUX only, and only by explicit request
+AC_MSG_CHECKING([TrueTime GPS receiver/VME interface])
+AC_ARG_ENABLE(
+ [GPSVME],
+ [AS_HELP_STRING(
+ [--enable-GPSVME],
+ [- TrueTime GPS receiver/VME interface]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=no]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_GPSVME], 1, [TrueTime GPS receiver/VME interface?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$host" in
+ yes*-*-hpux*) ;;
+ yes*) AC_MSG_WARN([*** But the expected answer is... no ***]) ;;
+esac
+
+AC_MSG_CHECKING([for PCL720 clock support])
+case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
+ yesyesyes)
+ AC_DEFINE([CLOCK_PPS720], 1, [PCL 720 clock support])
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+
+AC_MSG_CHECKING([for default inclusion of all suitable non-PARSE clocks])
+AC_ARG_ENABLE(
+ [all-clocks],
+ [AS_HELP_STRING(
+ [--enable-all-clocks],
+ [+ include all suitable non-PARSE clocks:]
+ )],
+ [ntp_eac=$enableval],
+ [ntp_eac=yes]
+)
+AC_MSG_RESULT([$ntp_eac])
+
+# HMS: Should we also require ntp_parse_ok?
+AC_MSG_CHECKING([if we have support for PARSE clocks])
+case "$ntp_atom_ok$ac_cv_header_termio_h$ac_cv_header_termios_h" in
+ yes*yes*)
+ ntp_canparse=yes
+ ;;
+ *) ntp_canparse=no
+ ;;
+esac
+AC_MSG_RESULT([$ntp_canparse])
+
+AC_MSG_CHECKING([if we have support for audio clocks])
+case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h$ac_cv_header_machine_soundcard_h$ac_cv_header_sys_soundcard_h" in
+ *yes*)
+ ntp_canaudio=yes
+ AC_DEFINE([HAVE_AUDIO], [], [Do we have audio support?])
+ ;;
+ *) ntp_canaudio=no ;;
+esac
+AC_MSG_RESULT([$ntp_canaudio])
+
+AC_MSG_CHECKING([if we have support for the SHM refclock interface])
+case "$ac_cv_header_sys_ipc_h$ac_cv_header_sys_shm_h" in
+ yesyes)
+ ntp_canshm=yes
+ ;;
+ *) ntp_canshm=no ;;
+esac
+AC_MSG_RESULT([$ntp_canshm])
+
+# Test for termios TIOCMBIS modem control (ACTS, Heath, Palisade)
+AC_CACHE_CHECK(
+ [for termios modem control],
+ [ntp_cv_modem_control],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ #ifdef HAVE_TERMIOS_H
+ # include <termios.h>
+ #endif
+ #ifdef HAVE_SYS_IOCTL_H
+ # include <sys/ioctl.h>
+ #endif
+ ]],
+ [[
+ int dtr = TIOCM_DTR;
+
+ ioctl(1, TIOCMBIS, (char *)&dtr);
+ ]]
+ )],
+ [ntp_cv_modem_control=yes],
+ [ntp_cv_modem_control=no]
+ )]
+)
+case "$ntp_eac::$ntp_cv_modem_control" in
+ yes::yes)
+ ntp_enable_all_modem_control_clocks=yes
+ ;;
+ *)
+ ntp_enable_all_modem_control_clocks=no
+ ;;
+esac
+
+# Requires modem control
+AC_MSG_CHECKING([ACTS modem service])
+AC_ARG_ENABLE(
+ [ACTS],
+ [AS_HELP_STRING(
+ [--enable-ACTS],
+ [s ACTS modem service]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_enable_all_modem_control_clocks]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_ACTS], [1], [ACTS modem service])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Arbiter 1088A/B GPS receiver])
+AC_ARG_ENABLE(
+ [ARBITER],
+ [AS_HELP_STRING(
+ [--enable-ARBITER],
+ [+ Arbiter 1088A/B GPS receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_ARBITER], [1], [Arbiter 1088A/B GPS receiver])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Arcron MSF receiver])
+AC_ARG_ENABLE(
+ [ARCRON_MSF],
+ [AS_HELP_STRING(
+ [--enable-ARCRON-MSF],
+ [+ Arcron MSF receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_ARCRON_MSF], [1], [ARCRON support?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Austron 2200A/2201A GPS receiver])
+AC_ARG_ENABLE(
+ [AS2201],
+ [AS_HELP_STRING(
+ [--enable-AS2201],
+ [+ Austron 2200A/2201A GPS receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_AS2201], [1], [Austron 2200A/2201A GPS receiver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([ATOM PPS interface])
+AC_ARG_ENABLE(
+ [ATOM],
+ [AS_HELP_STRING(
+ [--enable-ATOM],
+ [s ATOM PPS interface]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_atom_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_ATOM], [1], [PPS interface?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Chrono-log K-series WWVB receiver])
+AC_ARG_ENABLE(
+ [CHRONOLOG],
+ [AS_HELP_STRING(
+ [--enable-CHRONOLOG],
+ [+ Chrono-log K-series WWVB receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_CHRONOLOG], [1], [Chronolog K-series WWVB receiver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([CHU modem/decoder])
+AC_ARG_ENABLE(
+ [CHU],
+ [AS_HELP_STRING(
+ [--enable-CHU],
+ [+ CHU modem/decoder]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_CHU], [1], [CHU modem/decoder])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+ntp_refclock_chu=$ntp_ok
+
+AC_MSG_CHECKING([CHU audio/decoder])
+AC_ARG_ENABLE(
+ [AUDIO-CHU],
+ [AS_HELP_STRING(
+ [--enable-AUDIO-CHU],
+ [s CHU audio/decoder]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$ntp_eac$ntp_refclock_chu$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+ ]
+)
+AC_MSG_RESULT([$ntp_ok])
+# We used to check for sunos/solaris target...
+case "$ntp_ok$ntp_refclock_chu$ntp_canaudio" in
+ yes*no*) AC_MSG_WARN([*** But the expected answer is...no ***])
+esac
+
+# Not under HP-UX
+AC_MSG_CHECKING([Datum Programmable Time System])
+AC_ARG_ENABLE(
+ [DATUM],
+ [AS_HELP_STRING(
+ [--enable-DATUM],
+ [s Datum Programmable Time System]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$ac_cv_header_termios_h" in
+ yes)
+ ntp_ok=$ntp_eac
+ ;;
+ *) ntp_ok=no
+ ;;
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_DATUM], [1], [Datum Programmable Time System?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Dumb generic hh:mm:ss local clock])
+AC_ARG_ENABLE(
+ [DUMBCLOCK],
+ [AS_HELP_STRING(
+ [--enable-DUMBCLOCK],
+ [+ Dumb generic hh:mm:ss local clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_DUMBCLOCK], [1], [Dumb generic hh:mm:ss local clock?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Forum Graphic GPS])
+AC_ARG_ENABLE(
+ [FG],
+ [AS_HELP_STRING(
+ [--enable-FG],
+ [+ Forum Graphic GPS]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_FG], [1], [Forum Graphic GPS datating station driver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+# Requires modem control
+AC_MSG_CHECKING([Heath GC-1000 WWV/WWVH receiver])
+AC_ARG_ENABLE(
+ [HEATH],
+ [AS_HELP_STRING(
+ [--enable-HEATH],
+ [s Heath GC-1000 WWV/WWVH receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_enable_all_modem_control_clocks]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_HEATH], [1], [Heath GC-1000 WWV/WWVH receiver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([for hopf serial clock device])
+AC_ARG_ENABLE(
+ [HOPFSERIAL],
+ [AS_HELP_STRING(
+ [--enable-HOPFSERIAL],
+ [+ hopf serial clock device]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_HOPF_SERIAL], [1], [HOPF serial clock device?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([for hopf PCI clock 6039])
+AC_ARG_ENABLE(
+ [HOPFPCI],
+ [AS_HELP_STRING(
+ [--enable-HOPFPCI],
+ [+ hopf 6039 PCI board]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_HOPF_PCI], [1], [HOPF PCI clock device?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([HP 58503A GPS receiver])
+AC_ARG_ENABLE(
+ [HPGPS],
+ [AS_HELP_STRING(
+ [--enable-HPGPS],
+ [+ HP 58503A GPS receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_HPGPS], 1, [HP 58503A GPS receiver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([IRIG audio decoder])
+AC_ARG_ENABLE(
+ [IRIG],
+ [AS_HELP_STRING(
+ [--enable-IRIG],
+ [s IRIG audio decoder]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_IRIG], [1], [IRIG audio decoder?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canaudio" in
+ yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
+esac
+
+AC_MSG_CHECKING([for JJY receiver])
+AC_ARG_ENABLE(
+ [JJY],
+ [AS_HELP_STRING(
+ [--enable-JJY],
+ [+ JJY receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_JJY], [1], [JJY receiver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Rockwell Jupiter GPS receiver])
+AC_ARG_ENABLE(
+ [JUPITER],
+ [AS_HELP_STRING(
+ [--enable-JUPITER],
+ [s Rockwell Jupiter GPS receiver]
+ )],
+ [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+case "$ntp_jupiter_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_JUPITER], [1], [Rockwell Jupiter GPS clock?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Leitch CSD 5300 Master Clock System Driver])
+AC_ARG_ENABLE(
+ [LEITCH],
+ [AS_HELP_STRING(
+ [--enable-LEITCH],
+ [+ Leitch CSD 5300 Master Clock System Driver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_LEITCH], [1],
+ [Leitch CSD 5300 Master Clock System Driver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([local clock reference])
+AC_ARG_ENABLE(
+ [LOCAL-CLOCK],
+ [AS_HELP_STRING(
+ [--enable-LOCAL-CLOCK],
+ [+ local clock reference]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_LOCAL], [1], [local clock reference?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+dnl Bug 340: longstanding unfixed bugs
+dnl AC_MSG_CHECKING([EES M201 MSF receiver])
+dnl AC_ARG_ENABLE([MSFEES],
+dnl [AS_HELP_STRING([--enable-MSFEES], [+ EES M201 MSF receiver])],
+dnl [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+dnl if test "$ntp_ok" = "yes"; then
+dnl ntp_refclock=yes
+dnl AC_DEFINE([CLOCK_MSFEES], [1], [EES M201 MSF receiver])
+dnl fi
+dnl AC_MSG_RESULT([$ntp_ok])
+
+# Not Ultrix
+AC_MSG_CHECKING([Magnavox MX4200 GPS receiver])
+AC_ARG_ENABLE(
+ [MX4200],
+ [AS_HELP_STRING(
+ [--enable-MX4200 ],
+ [s Magnavox MX4200 GPS receiver]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$ac_cv_var_ppsclock" in
+ yes)
+ ntp_ok=$ntp_eac
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_MX4200], [1], [Magnavox MX4200 GPS receiver])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$host" in
+ yes*-*-ultrix*) AC_MSG_WARN([*** But the expected answer is... no ***])
+esac
+
+AC_MSG_CHECKING([for NeoClock4X receiver])
+AC_ARG_ENABLE(
+ [NEOCLOCK4X],
+ [AS_HELP_STRING(
+ [--enable-NEOCLOCK4X],
+ [+ NeoClock4X DCF77 / TDF receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_NEOCLOCK4X], [1], [NeoClock4X])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([NMEA GPS receiver])
+AC_ARG_ENABLE(
+ [NMEA],
+ [AS_HELP_STRING(
+ [--enable-NMEA],
+ [+ NMEA GPS receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_NMEA], [1], [NMEA GPS receiver])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([for GPSD JSON receiver])
+AC_ARG_ENABLE(
+ [GPSD],
+ [AS_HELP_STRING(
+ [--enable-GPSD],
+ [+ GPSD JSON receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_GPSDJSON], [1], [GPSD JSON receiver])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([for ONCORE Motorola VP/UT Oncore GPS])
+AC_ARG_ENABLE(
+ [ONCORE],
+ [AS_HELP_STRING(
+ [--enable-ONCORE],
+ [s Motorola VP/UT Oncore GPS receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_oncore_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_ONCORE], 1, [Motorola UT Oncore GPS])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+# Requires modem control
+AC_MSG_CHECKING([for Palisade clock])
+AC_ARG_ENABLE(
+ [PALISADE],
+ [AS_HELP_STRING(
+ [--enable-PALISADE],
+ [s Palisade clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_enable_all_modem_control_clocks]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_PALISADE], [1], [Palisade clock])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Conrad parallel port radio clock])
+AC_ARG_ENABLE(
+ [PCF],
+ [AS_HELP_STRING(
+ [--enable-PCF ],
+ [+ Conrad parallel port radio clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_PCF], [1], [Conrad parallel port radio clock])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([PST/Traconex 1020 WWV/WWVH receiver])
+AC_ARG_ENABLE(
+ [PST],
+ [AS_HELP_STRING(
+ [--enable-PST],
+ [+ PST/Traconex 1020 WWV/WWVH receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_PST], [1], [PST/Traconex 1020 WWV/WWVH receiver])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([RIPENCC specific Trimble driver])
+AC_ARG_ENABLE(
+ [RIPENCC],
+ [AS_HELP_STRING(
+ [--enable-RIPENCC],
+ [- RIPENCC specific Trimble driver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=no]
+)
+# 020629: HMS: s/$ntp_eac -> -/no because of ptr += sprintf(ptr, ...) usage
+case "$ntp_ripe_ncc_ok" in
+ no) ntp_ok=no ;;
+esac
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_RIPENCC], [],[RIPE NCC Trimble clock])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+# Danny Meyer says SHM compiles (with a few warnings) under Win32.
+# For *IX, we need sys/ipc.h and sys/shm.h.
+AC_MSG_CHECKING([for SHM clock attached thru shared memory])
+AC_ARG_ENABLE(
+ [SHM],
+ [AS_HELP_STRING(
+ [--enable-SHM],
+ [s SHM clock attached thru shared memory]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$ntp_eac$ntp_canshm" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_SHM], [1], [clock thru shared memory])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Spectracom 8170/Netclock/2 WWVB receiver])
+AC_ARG_ENABLE(
+ [SPECTRACOM],
+ [AS_HELP_STRING(
+ [--enable-SPECTRACOM],
+ [+ Spectracom 8170/Netclock/2 WWVB receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_SPECTRACOM], [1],
+ [Spectracom 8170/Netclock/2 WWVB receiver])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([KSI/Odetics TPRO/S GPS receiver/IRIG interface])
+AC_ARG_ENABLE(
+ [TPRO],
+ [AS_HELP_STRING(
+ [--enable-TPRO],
+ [s KSI/Odetics TPRO/S GPS receiver/IRIG interface]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$ac_cv_header_sys_tpro_h" in
+ yes)
+ ntp_ok=$ntp_eac
+ ;;
+ *)
+ ntp_ok=no
+ ;;
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_TPRO], [1],
+ [KSI/Odetics TPRO/S GPS receiver/IRIG interface])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ac_cv_header_sys_tpro" in
+ yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
+esac
+
+# Not on a vax-dec-bsd
+AC_MSG_CHECKING([Kinemetrics/TrueTime receivers])
+AC_ARG_ENABLE(
+ [TRUETIME],
+ [AS_HELP_STRING(
+ [--enable-TRUETIME],
+ [s Kinemetrics/TrueTime receivers]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$host" in
+ vax-dec-bsd)
+ ntp_ok=no
+ ;;
+ *)
+ ntp_ok=$ntp_eac
+ ;;
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_TRUETIME], [1], [Kinemetrics/TrueTime receivers])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$host" in
+ yesvax-dec-bsd) AC_MSG_WARN([*** But the expected answer is... no ***])
+esac
+
+AC_MSG_CHECKING([TrueTime 560 IRIG-B decoder])
+AC_ARG_ENABLE(
+ [TT560],
+ [AS_HELP_STRING(
+ [--enable-TT560],
+ [- TrueTime 560 IRIG-B decoder]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=no]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_TT560], [], [TrueTime 560 IRIG-B decoder?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Ultralink M320 WWVB receiver])
+AC_ARG_ENABLE(
+ [ULINK],
+ [AS_HELP_STRING(
+ [--enable-ULINK],
+ [+ Ultralink WWVB receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_ULINK], [1], [Ultralink M320 WWVB receiver?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([Spectracom TSYNC PCI timing board])
+AC_ARG_ENABLE(
+ [TSYNCPCI],
+ [AS_HELP_STRING(
+ [--enable-TSYNCPCI],
+ [s Spectracom TSYNC timing board]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$host" in
+ *-*-*linux*)
+ ntp_ok=$ntp_eac
+ ;;
+ *)
+ ntp_ok=no
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_TSYNCPCI], [1], [Spectracom TSYNC timing board])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([WWV receiver])
+AC_ARG_ENABLE(
+ [WWV],
+ [AS_HELP_STRING(
+ [--enable-WWV],
+ [s WWV Audio receiver]
+ )],
+ [ntp_ok=$enableval],
+ [
+ case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
+ ]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_WWV], [1], [WWV audio driver])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canaudio" in
+ yesno) AC_MSG_WARN([*** But the expected answer is... no ***])
+esac
+
+AC_MSG_CHECKING([for Zyfer receiver])
+AC_ARG_ENABLE(
+ [ZYFER],
+ [AS_HELP_STRING(
+ [--enable-ZYFER],
+ [+ Zyfer GPStarplus receiver]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eac]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_ZYFER], [1], [Zyfer GPStarplus])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+AC_MSG_CHECKING([for default inclusion of all suitable PARSE clocks])
+AC_ARG_ENABLE(
+ [parse-clocks],
+ [AS_HELP_STRING(
+ [--enable-parse-clocks],
+ [- include all suitable PARSE clocks:]
+ )],
+ [ntp_eapc=$enableval],
+ [
+ case "$ntp_eac" in
+ yes) ntp_eapc=$ntp_canparse ;;
+ *) ntp_eapc=no ;;
+ esac
+ # Delete the next line one of these days
+ ntp_eapc=no
+ ]
+)
+AC_MSG_RESULT($ntp_eapc)
+
+case "$ntp_eac$ntp_eapc$ntp_canparse" in
+ noyes*)
+ AC_MSG_ERROR(["--enable-parse-clocks" requires "--enable-all-clocks".])
+ ;;
+ yesyesno)
+ AC_MSG_ERROR([You said "--enable-parse-clocks" but PARSE isn't supported on this platform!])
+ ;;
+esac
+
+ntp_libparse=no
+ntp_parseutil=no
+ntp_rawdcf=no
+
+AC_MSG_CHECKING([Diem Computime Radio Clock])
+AC_ARG_ENABLE(
+ [COMPUTIME],
+ [AS_HELP_STRING(
+ [--enable-COMPUTIME],
+ [s Diem Computime Radio Clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_COMPUTIME], [1], [Diems Computime Radio Clock?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([ELV/DCF7000 clock])
+AC_ARG_ENABLE(
+ [DCF7000],
+ [AS_HELP_STRING(
+ [--enable-DCF7000],
+ [s ELV/DCF7000 clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_DCF7000], [1], [ELV/DCF7000 clock?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([HOPF 6021 clock])
+AC_ARG_ENABLE(
+ [HOPF6021],
+ [AS_HELP_STRING(
+ [--enable-HOPF6021],
+ [s HOPF 6021 clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_HOPF6021], [1], [HOPF 6021 clock?])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([Meinberg clocks])
+AC_ARG_ENABLE(
+ [MEINBERG],
+ [AS_HELP_STRING(
+ [--enable-MEINBERG],
+ [s Meinberg clocks]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_MEINBERG], [1], [Meinberg clocks])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([DCF77 raw time code])
+AC_ARG_ENABLE(
+ [RAWDCF],
+ [AS_HELP_STRING(
+ [--enable-RAWDCF],
+ [s DCF77 raw time code]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_parseutil=yes
+ ntp_refclock=yes
+ ntp_rawdcf=yes
+ AC_DEFINE([CLOCK_RAWDCF], [1], [DCF77 raw time code])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+case "$ntp_rawdcf" in
+ yes)
+ AC_CACHE_CHECK([if we must enable parity for RAWDCF],
+ [ntp_cv_rawdcf_parity],
+ [
+ ans=no
+ case "$host" in
+ *-*-*linux*)
+ ans=yes
+ ;;
+ esac
+ ntp_cv_rawdcf_parity=$ans
+ ]
+ )
+ case "$ntp_cv_rawdcf_parity" in
+ yes)
+ AC_DEFINE([RAWDCF_NO_IGNPAR], [1],
+ [Should we not IGNPAR (Linux)?]) ;;
+ esac
+esac
+
+AC_MSG_CHECKING([RCC 8000 clock])
+AC_ARG_ENABLE(
+ [RCC8000],
+ [AS_HELP_STRING(
+ [--enable-RCC8000],
+ [s RCC 8000 clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_RCC8000], [1], [RCC 8000 clock])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([Schmid DCF77 clock])
+AC_ARG_ENABLE(
+ [SCHMID],
+ [AS_HELP_STRING(
+ [--enable-SCHMID ],
+ [s Schmid DCF77 clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_SCHMID], [1], [Schmid DCF77 clock])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([Trimble GPS receiver/TAIP protocol])
+AC_ARG_ENABLE(
+ [TRIMTAIP],
+ [AS_HELP_STRING(
+ [--enable-TRIMTAIP],
+ [s Trimble GPS receiver/TAIP protocol]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_TRIMTAIP], [1],
+ [Trimble GPS receiver/TAIP protocol])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([Trimble GPS receiver/TSIP protocol])
+AC_ARG_ENABLE(
+ [TRIMTSIP],
+ [AS_HELP_STRING(
+ [--enable-TRIMTSIP],
+ [s Trimble GPS receiver/TSIP protocol]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_TRIMTSIP], [1],
+ [Trimble GPS receiver/TSIP protocol])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([WHARTON 400A Series clock])
+AC_ARG_ENABLE(
+ [WHARTON],
+ [AS_HELP_STRING(
+ [--enable-WHARTON],
+ [s WHARTON 400A Series clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_WHARTON_400A], [1], [WHARTON 400A Series clock])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING([VARITEXT clock])
+AC_ARG_ENABLE(
+ [VARITEXT],
+ [AS_HELP_STRING(
+ [--enable-VARITEXT],
+ [s VARITEXT clock]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=$ntp_eapc]
+)
+case "$ntp_ok" in
+ yes)
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE([CLOCK_VARITEXT], [1], [VARITEXT clock])
+ ;;
+esac
+AC_MSG_RESULT([$ntp_ok])
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR([That's a parse clock and this system doesn't support it!])
+esac
+
+AC_MSG_CHECKING(SEL240X clock)
+AC_ARG_ENABLE(SEL240X,
+ AC_HELP_STRING([--enable-SEL240X], [s SEL240X clock]),
+ [ntp_ok=$enableval], [ntp_ok=$ntp_eapc])
+if test "$ntp_ok" = "yes"; then
+ ntp_libparse=yes
+ ntp_refclock=yes
+ AC_DEFINE(CLOCK_SEL240X, 1, [SEL240X protocol])
+fi
+AC_MSG_RESULT($ntp_ok)
+case "$ntp_ok$ntp_canparse" in
+ yesno)
+ AC_MSG_ERROR(That's a parse clock and this system doesn't support it!)
+ ;;
+esac
+
+AC_SUBST([LIBPARSE])
+AC_SUBST([MAKE_LIBPARSE])
+AC_SUBST([MAKE_LIBPARSE_KERNEL])
+AC_SUBST([MAKE_CHECK_Y2K])
+
+AC_MSG_CHECKING([if we need to make and use the parse libraries])
+ans=no
+case "$ntp_libparse" in
+ yes)
+ ans=yes
+ AC_DEFINE([CLOCK_PARSE], [1], [PARSE driver interface])
+ LIBPARSE=../libparse/libparse.a
+ MAKE_LIBPARSE=libparse.a
+ # HMS: check_y2k trips the 34 year problem now...
+ false && MAKE_CHECK_Y2K=check_y2k
+esac
+AC_MSG_RESULT([$ans])
+
+NTP_OPENSSL
+
+# if we are using OpenSSL (--with-crypto), by default Autokey is enabled
+AC_MSG_CHECKING([if we want to include NTP Autokey protocol support])
+AC_ARG_ENABLE(
+ [autokey],
+ AS_HELP_STRING(
+ [--enable-autokey],
+ [+ support NTP Autokey protocol]
+ ),
+ [ntp_autokey=$enableval],
+ [ntp_autokey=$ntp_openssl]
+)
+case "$ntp_autokey" in
+ no)
+ ;;
+ *)
+ case "$ntp_openssl" in
+ no)
+ AC_MSG_WARN([Disabling Autokey, --enable-autokey requires --with-crypto.])
+ ntp_autokey=no
+ ;;
+ *)
+ AC_DEFINE([AUTOKEY], [1], [Support NTP Autokey protocol?])
+ ntp_autokey=yes
+ ;;
+ esac
+ ;;
+esac
+AC_MSG_RESULT([$ntp_autokey])
+
+AC_SUBST([MAKE_CHECK_LAYOUT])
+AC_MSG_CHECKING([if we want to run check-layout])
+case "$cross_compiling$PATH_PERL" in
+ no/*)
+ MAKE_CHECK_LAYOUT=check-layout
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+
+AC_SUBST([TESTDCF])
+AC_SUBST([DCFD])
+AC_MSG_CHECKING([if we can make dcf parse utilities])
+ans=no
+case "$ntp_parseutil" in
+ yes)
+ case "$host" in
+ *-*-sunos4*|*-*-solaris2*|*-*-*linux*|*-*-netbsd*)
+ ans="dcfd testdcf"
+ DCFD=dcfd
+ TESTDCF=testdcf
+ esac
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+
+AC_SUBST([MAKE_PARSEKMODULE])
+AC_MSG_CHECKING([if we can build kernel streams modules for parse])
+ans=no
+case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
+ yesyes)
+ case "$host" in
+ sparc-*-sunos4*)
+ case "$ntp_cv_var_kernel_pll" in
+ yes)
+ AC_DEFINE([PPS_SYNC], [1], [PARSE kernel PLL PPS support])
+ ;;
+ esac
+ ans=parsestreams
+ MAKE_PARSEKMODULE=parsestreams.loadable_module.o
+ ;;
+ sparc-*-solaris2*)
+ ans=parsesolaris
+ MAKE_PARSEKMODULE=parse
+ AC_CHECK_HEADERS([strings.h])
+ ;;
+ esac
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+
+AC_MSG_CHECKING([if we need basic refclock support])
+case "$ntp_refclock" in
+ yes)
+ AC_DEFINE([REFCLOCK], [1], [Basic refclock support?])
+ ;;
+esac
+AC_MSG_RESULT($ntp_refclock)
+
+dnl Things that can be made in clockstuff
+AC_SUBST([PROPDELAY], [propdelay])
+AC_SUBST([CHUTEST]) dnl needs work to compile
+
+AC_SUBST([MAKE_ADJTIMED])
+AC_MSG_CHECKING([if we want HP-UX adjtimed support])
+case "$host" in
+ *-*-hpux[[56789]]*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+case "$ans" in
+ yes)
+ MAKE_ADJTIMED=adjtimed
+ AC_DEFINE([NEED_HPUX_ADJTIME], [1],
+ [Do we need HPUX adjtime() library support?])
+ ;;
+ *) ADJTIMED_DB=
+ ADJTIMED_DL=
+ ADJTIMED_DS=
+ ADJTIMED_MS=
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+
+AC_MSG_CHECKING([if we want QNX adjtime support])
+case "$host" in
+ *-*-qnx*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+case "$ans" in
+ yes)
+ AC_DEFINE([NEED_QNX_ADJTIME], [1],
+ [Do we need the qnx adjtime call?])
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+
+AC_MSG_CHECKING([if we can read kmem])
+
+# the default is to enable it if the system has the capability
+
+case "$ac_cv_func_nlist$ac_cv_func_K_open$ac_cv_func_kvm_open" in
+ *yes*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+case "$host" in
+ *-*-domainos) # Won't be found...
+ ans=no
+ ;;
+ *-*-hpux*)
+ #ans=no
+ ;;
+ *-*-irix[[456]]*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-winnt3.5)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+esac
+
+# --enable-kmem / --disable-kmem controls if present
+AC_ARG_ENABLE(
+ [kmem],
+ [AS_HELP_STRING(
+ [--enable-kmem],
+ [s read /dev/kmem for tick and/or tickadj]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ can_kmem=yes
+ ;;
+ *)
+ can_kmem=no
+ AC_DEFINE([NOKMEM], [1], [Should we NOT read /dev/kmem?])
+esac
+
+
+AC_MSG_CHECKING([if adjtime is accurate])
+
+# target-dependent defaults
+
+case "$host" in
+ i386-sequent-ptx*)
+ ans=no
+ ;;
+ i386-unknown-osf1*)
+ ans=yes
+ ;;
+ mips-sgi-irix[[456]]*)
+ ans=yes
+ ;;
+ *-fujitsu-uxp*)
+ ans=yes
+ ;;
+ *-ibm-aix[[4-9]]*)
+ # XXX only verified thru AIX6.
+ ans=yes
+ ;;
+ *-*-*linux*)
+ ans=yes
+ ;;
+ *-*-solaris2.[[01]])
+ ans=no
+ ;;
+ *-*-solaris2*)
+ ans=yes
+ ;;
+ *-*-unicosmp*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+# --enable-accurate-adjtime / --disable-accurate-adjtime
+# override the default
+AC_ARG_ENABLE(
+ [accurate-adjtime],
+ [AS_HELP_STRING(
+ [--enable-accurate-adjtime],
+ [s the adjtime() call is accurate]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_DEFINE([ADJTIME_IS_ACCURATE], [1], [Is adjtime() accurate?])
+ adjtime_is_accurate=yes
+ ;;
+ *)
+ adjtime_is_accurate=no
+ ;;
+esac
+
+AC_CACHE_CHECK(
+ [the name of 'tick' in the kernel],
+ [ntp_cv_nlist_tick],
+ [
+ ans=_tick
+ case "$host" in
+ m68*-hp-hpux*) # HP9000/300?
+ ans=_old_tick
+ ;;
+ *-apple-aux[[23]]*)
+ ans=tick
+ ;;
+ *-hp-hpux*)
+ ans=old_tick
+ ;;
+ *-ibm-aix[[3-9]]*)
+ # XXX only verified thru AIX6.
+ ans=no
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=tick
+ ;;
+ *-*-sco3.2v[[45]]*)
+ ans=no
+ ;;
+ *-*-solaris2*)
+ ans=nsec_per_tick
+ ;;
+ *-*-sysv4*)
+ ans=tick
+ ;;
+ esac
+ ntp_cv_nlist_tick=$ans
+ ]
+)
+case "$ntp_cv_nlist_tick" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+ AC_DEFINE_UNQUOTED([K_TICK_NAME], ["$ntp_cv_nlist_tick"],
+ [What is the name of TICK in the kernel?])
+esac
+
+AC_CACHE_CHECK(
+ [for the units of 'tick'],
+ [ntp_cv_tick_nano],
+ [
+ ans=usec
+ case "$host" in
+ *-*-solaris2*)
+ ans=nsec
+ ;;
+ esac
+ ntp_cv_tick_nano=$ans
+ ]
+)
+case "$ntp_cv_tick_nano" in
+ nsec)
+ AC_DEFINE([TICK_NANO], [1], [Is K_TICK_NAME in nanoseconds?])
+esac
+
+AC_CACHE_CHECK(
+ [the name of 'tickadj' in the kernel],
+ [ntp_cv_nlist_tickadj],
+ [
+ ans=_tickadj
+ case "$host" in
+ m68*-hp-hpux*) # HP9000/300?
+ ans=_tickadj
+ ;;
+ *-apple-aux[[23]]*)
+ ans=tickadj
+ ;;
+ *-hp-hpux10*)
+ ans=no
+ ;;
+ *-hp-hpux9*)
+ ans=no
+ ;;
+ *-hp-hpux*)
+ ans=tickadj
+ ;;
+ *-*-aix*)
+ ans=tickadj
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=tickadj
+ ;;
+ *-*-sco3.2v4*)
+ ans=no
+ ;;
+ *-*-sco3.2v5.0*)
+ ans=clock_drift
+ ;;
+ *-*-solaris2*)
+ ans=no # hrestime_adj
+ ;;
+ *-*-sysv4*)
+ ans=tickadj
+ ;;
+ esac
+ ntp_cv_nlist_tickadj=$ans
+ ]
+)
+case "$ntp_cv_nlist_tickadj" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+ AC_DEFINE_UNQUOTED([K_TICKADJ_NAME], ["$ntp_cv_nlist_tickadj"],
+ [What is the name of TICKADJ in the kernel?])
+esac
+
+AC_CACHE_CHECK(
+ [for the units of 'tickadj'],
+ [ntp_cv_tickadj_nano],
+ [
+ ans=usec
+ case "$host" in
+ *-*-solaris2*)
+ ans=nsec
+ ;;
+ esac
+ ntp_cv_tickadj_nano=$ans
+ ]
+)
+case "$ntp_cv_tickadj_nano" in
+ nsec)
+ AC_DEFINE([TICKADJ_NANO], [1], [Is K_TICKADJ_NAME in nanoseconds?])
+esac
+
+AC_CACHE_CHECK(
+ [half-heartedly for 'dosynctodr' in the kernel],
+ [ntp_cv_nlist_dosynctodr],
+ [
+ case "$host" in
+ *-apple-aux[[23]]*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=dosynctodr
+ ;;
+ *-*-aix*)
+ ans=dosynctodr
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-nextstep*)
+ ans=_dosynctodr
+ ;;
+ *-*-ptx*)
+ ans=doresettodr
+ ;;
+ *-*-sco3.2v4*)
+ ans=no
+ ;;
+ *-*-sco3.2v5*)
+ ans=track_rtc
+ ;;
+ *-*-solaris2*)
+ ans=dosynctodr
+ ;;
+ *-*-sysv4*)
+ ans=doresettodr
+ ;;
+ *)
+ ans=_dosynctodr
+ ;;
+ esac
+ ntp_cv_nlist_dosynctodr=$ans
+ ]
+)
+case "$ntp_cv_nlist_dosynctodr" in
+ no)
+ ;;
+ *)
+ AC_DEFINE_UNQUOTED([K_DOSYNCTODR_NAME], ["$ntp_cv_nlist_dosynctodr"],
+ [What is (probably) the name of DOSYNCTODR in the kernel?])
+ ;;
+esac
+
+AC_CACHE_CHECK(
+ [half-heartedly for 'noprintf' in the kernel],
+ [ntp_cv_nlist_noprintf],
+ [
+ case "$host" in
+ *-apple-aux[[23]]*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=noprintf
+ ;;
+ *-*-aix*)
+ ans=noprintf
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=noprintf
+ ;;
+ *-*-nextstep*)
+ ans=_noprintf
+ ;;
+ *-*-solaris2*)
+ ans=noprintf
+ ;;
+ *-*-sysv4*)
+ ans=noprintf
+ ;;
+ *)
+ ans=_noprintf
+ ;;
+ esac
+ ntp_cv_nlist_noprintf=$ans
+ ]
+)
+case "$ntp_cv_nlist_noprintf" in
+ no)
+ ;;
+ *)
+ AC_DEFINE_UNQUOTED([K_NOPRINTF_NAME], ["$ntp_cv_nlist_noprintf"],
+ [What is (probably) the name of NOPRINTF in the kernel?])
+ ;;
+esac
+
+dnl The tick/tickadj sections were written by Skippy, who never learned
+dnl that it's impolite (horridly gross) to show your guts in public.
+
+dnl tick tickadj
+dnl 10000 80 Unixware
+dnl 1000000L/hz tick/16 (Solaris,UXPV,HPUX) && ADJTIME_IS_ACCURATE
+dnl 10000 150 sgi IRIX
+dnl 1000000L/hz 1000 RS6000 && NOKMEM
+dnl 1000000L/hz 668 DOMAINOS && NOKMEM
+dnl 1000000L/hz 500/HZ other && NOKMEM
+dnl txc.tick 1 Linux
+dnl (every / 10) 50 WinNT - tickadj is roughly 500/hz
+dnl 1000000L/hz (nlist) (Solaris && !ADJTIME_IS_ACCURATE),
+dnl (RS6000 && !NOKMEM), SINIX MIPS
+
+dnl But we'll only use these "values" if we can't find anything else.
+
+AC_MSG_CHECKING([for a default value for 'tick'])
+
+# target-dependent default for tick
+
+case "$host" in
+ *-*-pc-cygwin*)
+ AC_MSG_ERROR([tick needs work for cygwin])
+ ;;
+ *-univel-sysv*)
+ ans=10000
+ ;;
+ *-*-irix*)
+ ans=10000
+ ;;
+ *-*-*linux*)
+ ans=txc.tick
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-winnt3.5)
+ ans='(every / 10)'
+ ;;
+ *-*-unicosmp*)
+ ans=10000
+ ;;
+ *)
+ ans='1000000L/hz'
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [tick],
+ [AS_HELP_STRING(
+ [--enable-tick=VALUE],
+ [s force a value for 'tick']
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+ AC_DEFINE_UNQUOTED([PRESET_TICK], [$ans],
+ [Preset a value for 'tick'?])
+esac
+
+AC_MSG_CHECKING([for a default value for 'tickadj'])
+
+# target-specific default
+ans='500/hz'
+case "$host" in
+ *-fujitsu-uxp*)
+ case "$adjtime_is_accurate" in
+ yes)
+ ans='tick/16'
+ esac
+ ;;
+ *-univel-sysv*)
+ ans=80
+ ;;
+ *-*-aix*)
+ case "$can_kmem" in
+ no)
+ ans=1000
+ ;;
+ esac
+ ;;
+ *-*-domainos) # Skippy: won't be found...
+ case "$can_kmem" in
+ no)
+ ans=668
+ ;;
+ esac
+ ;;
+ *-*-hpux*)
+ case "$adjtime_is_accurate" in
+ yes)
+ ans='tick/16'
+ ;;
+ esac
+ ;;
+ *-*-irix*)
+ ans=150
+ ;;
+ *-*-mpeix*)
+ ans=no
+ ;;
+ *-*-sco3.2v5.0*)
+ ans=10000L/hz
+ ;;
+ *-*-winnt3.5)
+ ans=50
+ ;;
+ *-*-unicosmp*)
+ ans=150
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [tickadj],
+ [AS_HELP_STRING(
+ [--enable-tickadj=VALUE],
+ [s force a value for 'tickadj']
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+default_tickadj=$ans
+
+case "$default_tickadj" in
+ ''|no)
+ ;; # HMS: I think we can only get 'no' here...
+ *)
+ AC_DEFINE_UNQUOTED([PRESET_TICKADJ], [$default_tickadj],
+ [Preset a value for 'tickadj'?]) ;;
+esac
+
+# Newer versions of ReliantUNIX round adjtime() values down to
+# 1/100s (system tick). Sigh ...
+# Unfortunately, there is no easy way to know if particular release
+# has this "feature" or any obvious way to test for it.
+case "$host" in
+ mips-sni-sysv4*)
+ AC_DEFINE([RELIANTUNIX_CLOCK], [1],
+ [Do we want the ReliantUNIX clock hacks?])
+esac
+
+case "$host" in
+ *-*-sco3.2v5*)
+ AC_DEFINE([SCO5_CLOCK], [1], [Do we want the SCO clock hacks?])
+esac
+
+ntp_cv_make_tickadj=yes
+case "$can_kmem$ac_cv_var_tick$default_tickadj" in
+ nonono) # Don't read KMEM, no presets. Bogus.
+ AC_MSG_WARN([Can't read kmem, no PRESET_TICK or PRESET_TICKADJ. No tickadj.])
+ ntp_cv_make_tickadj=no
+ ;;
+ nono*) # Don't read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
+ AC_MSG_WARN([Can't read kmem but no PRESET_TICK. No tickadj.])
+ ntp_cv_make_tickadj=no
+ ;;
+ no*no) # Don't read KMEM, PRESET_TICK but no PRESET_TICKADJ. Bogus.
+ AC_MSG_WARN([Can't read kmem but no PRESET_TICKADJ. No tickadj.])
+ ntp_cv_make_tickadj=no
+ ;;
+ no*) # Don't read KMEM, PRESET_TICK and PRESET_TICKADJ. Cool.
+ ;;
+ yesnono) # Read KMEM, no presets. Cool.
+ ;;
+ yesno*) # Read KMEM, no PRESET_TICK but PRESET_TICKADJ. Bogus.
+ AC_MSG_WARN([PRESET_TICKADJ is defined but not PRESET_TICK. Please report this.])
+ ;;
+ yes*no) # Read KMEM, PRESET_TICK but no PRESET_TICKADJ. Cool.
+ ;;
+ yes*) # READ KMEM, PRESET_TICK and PRESET_TICKADJ.
+ ;;
+ *) # Generally bogus.
+ AC_MSG_ERROR([This shouldn't happen.])
+ ;;
+esac
+
+AC_SUBST(MAKE_NTPTIME)
+AC_CACHE_CHECK([if we want and can make the ntptime utility], ac_cv_make_ntptime,
+[case "$host" in
+ *) case "$ntp_cv_struct_ntptimeval$ntp_cv_var_kernel_pll" in
+ yesyes)
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+ esac
+ ;;
+esac
+ac_cv_make_ntptime=$ans])
+case "$ac_cv_make_ntptime" in
+ yes)
+ MAKE_NTPTIME=ntptime
+ ;;
+ *)
+ NTPTIME_DB=
+ NTPTIME_DL=
+ NTPTIME_DS=
+ NTPTIME_MS=
+ ;;
+esac
+
+AC_SUBST([MAKE_TICKADJ])
+case "$host" in
+ mips-sni-sysv4*)
+ # tickadj is pretty useless on newer versions of ReliantUNIX
+ # Do not bother
+ ntp_cv_make_tickadj=no
+ ;;
+ *-*-irix*)
+ ntp_cv_make_tickadj=no
+ ;;
+ *-*-solaris2*)
+ # DLM says tickadj is a no-no starting with solaris2.5
+ case "$host" in
+ *-*-solaris2.1[[0-9]]*)
+ ntp_cv_make_tickadj=no
+ ;;
+ *-*-solaris2.[[0-4]]*) ;;
+ *) ntp_cv_make_tickadj=no ;;
+ esac
+ ;;
+ *-*-unicosmp*)
+ ntp_cv_make_tickadj=no
+ ;;
+esac
+
+#
+# Despite all the above, we always make tickadj. Setting
+# ntp_cv_make_tickadj before AC_CACHE_CHECK will cause a false
+# report that the configuration variable was cached. It may
+# be better to simply remove the hunk above, I did not want
+# to remove it if there is hope it will be used again.
+#
+AS_UNSET([ntp_cv_make_tickadj])
+
+AC_CACHE_CHECK(
+ [if we want and can make the tickadj utility],
+ [ntp_cv_make_tickadj],
+ [ntp_cv_make_tickadj=yes]
+)
+case "$ntp_cv_make_tickadj" in
+ yes)
+ MAKE_TICKADJ=tickadj
+ ;;
+ *)
+ CALC_TICKADJ_DB=
+ CALC_TICKADJ_DL=
+ CALC_TICKADJ_DS=
+ CALC_TICKADJ_MS=
+ TICKADJ_DB=
+ TICKADJ_DL=
+ TICKADJ_DS=
+ TICKADJ_MS=
+ ;;
+esac
+
+AC_SUBST([MAKE_TIMETRIM])
+AC_CACHE_CHECK(
+ [if we want and can make the timetrim utility],
+ [ntp_cv_make_timetrim],
+ [
+ case "$host" in
+ *-*-irix*)
+ ntp_cv_make_timetrim=yes
+ ;;
+ *-*-unicosmp*)
+ ntp_cv_make_timetrim=yes
+ ;;
+ *)
+ ntp_cv_make_timetrim=no
+ ;;
+ esac
+ ]
+)
+case "$ntp_cv_make_timetrim" in
+ yes)
+ MAKE_TIMETRIM=timetrim
+ ;;
+ *) TIMETRIM_DB=
+ TIMETRIM_DL=
+ TIMETRIM_DS=
+ TIMETRIM_MS=
+ ;;
+esac
+
+AC_SUBST([MAKE_LIBNTPSIM])
+AC_SUBST([MAKE_NTPDSIM])
+
+AC_MSG_CHECKING([if we want to build the NTPD simulator])
+AC_ARG_ENABLE(
+ [simulator],
+ [AS_HELP_STRING(
+ [--enable-simulator],
+ [- build/install the NTPD simulator?]
+ )],
+ [ans=$enableval],
+ [ans=no]
+)
+AC_MSG_RESULT([$ans])
+case "$ans" in
+ yes)
+ MAKE_NTPDSIM=ntpdsim
+ MAKE_LIBNTPSIM=libntpsim.a
+ ;;
+ *)
+ NTPDSIM_DB=
+ NTPDSIM_DL=
+ NTPDSIM_DS=
+ NTPDSIM_MS=
+ ;;
+esac
+
+case "$build" in
+ $host)
+ ;;
+ *) case "$host" in
+ *-*-vxworks*)
+ LDFLAGS="$LDFLAGS -r"
+ ;;
+ esac
+ ;;
+esac
+
+NTP_WITHSNTP
+
+AC_MSG_CHECKING([if we want to build ntpsnmpd])
+AC_ARG_WITH(
+ [ntpsnmpd],
+ [AS_HELP_STRING(
+ [--with-ntpsnmpd],
+ [s Build ntpsnmpd MIB agent?]
+ )],
+ [ans=$withval],
+ [
+ case "$PATH_NET_SNMP_CONFIG" in
+ /*) ans=yes ;;
+ *) ans=no ;;
+ esac
+ ]
+)
+AC_MSG_RESULT([$ans])
+case "$ans" in
+ yes)
+ case "$PATH_NET_SNMP_CONFIG" in
+ /*)
+ SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs`
+ AC_SUBST([SNMP_LIBS])
+ # HMS: we really want to separate CPPFLAGS and CFLAGS
+ foo=`$PATH_NET_SNMP_CONFIG --cflags`
+ SNMP_CPPFLAGS=
+ SNMP_CFLAGS=
+ for i in $foo; do
+ case "$i" in
+ -D*|-U*|-I*)
+ SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i"
+ ;;
+ *) SNMP_CFLAGS="$SNMP_CFLAGS $i"
+ ;;
+ esac
+ done
+ AC_SUBST([SNMP_CPPFLAGS])
+ AC_SUBST([SNMP_CFLAGS])
+
+ save_CFLAGS=$CFLAGS
+ save_CPPFLAGS=$CPPFLAGS
+ save_LIBS=$LIBS
+ CFLAGS=$SNMP_CFLAGS
+ CPPFLAGS=$SNMP_CPPFLAGS
+
+ AC_CHECK_HEADER(
+ [net-snmp/net-snmp-config.h],
+ [MAKE_NTPSNMPD=ntpsnmpd],
+ [AC_MSG_WARN([net-snmp-config present but net-snmp headers are not available!])]
+ )
+
+ # Do this last, as we're messing up LIBS.
+ # check -lnetsnmp for netsnmp_daemonize
+ LIBS=`$PATH_NET_SNMP_CONFIG --libs`
+ AC_CHECK_LIB(
+ [netsnmp],
+ [netsnmp_daemonize],
+ [ans=yes],
+ [ans=no]
+ )
+ case "$ans" in
+ no)
+ AC_DEFINE([NEED_NETSNMP_DAEMONIZE], [1],
+ [We need to provide netsnmp_daemonize()])
+ esac
+
+ CFLAGS=$save_CFLAGS
+ AS_UNSET([save_CFLAGS])
+ CPPFLAGS=$save_CPPFLAGS
+ AS_UNSET([save_CPPFLAGS])
+ LIBS=$save_LIBS
+ AS_UNSET([save_LIBS])
+ ;;
+ *)
+ AC_MSG_WARN([Cannot build ntpsnmpd - net-snmp-config cannot be found])
+ ;;
+ esac
+ ;;
+esac
+AC_SUBST([MAKE_NTPSNMPD])
+
+case "$MAKE_NTPSNMPD" in
+ '')
+ NTPSNMPD_DB=
+ NTPSNMPD_DL=
+ NTPSNMPD_DS=
+ NTPSNMPD_MS=
+ ;;
+esac
+
+AC_MSG_CHECKING([if we should always slew the time])
+
+# target-specific defaults
+
+case "$host" in
+ *-apple-aux[[23]]*)
+ ans=yes
+ ;;
+ *-*-bsdi[[012]]*)
+ ans=no
+ ;;
+ *-*-bsdi*)
+ ans=yes
+ ;;
+ *-*-openvms*) # HMS: won't be found
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+# --enable-slew-always / --disable-slew-always overrides default
+
+AC_ARG_ENABLE(
+ [slew-always],
+ [AS_HELP_STRING(
+ [--enable-slew-always],
+ [s always slew the time]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_DEFINE([SLEWALWAYS], [1], [Slew always?])
+esac
+
+AC_MSG_CHECKING([if we should step and slew the time])
+
+case "$host" in
+ *-sni-sysv*)
+ ans=yes
+ ;;
+ *-univel-sysv*)
+ ans=no
+ ;;
+ *-*-ptx*)
+ ans=yes
+ ;;
+ *-*-solaris2.1[[0-9]]*)
+ ans=no
+ ;;
+ *-*-solaris2.[[012]]*)
+ ans=yes
+ ;;
+ *-*-sysv4*) # HMS: Does this catch Fujitsu UXP?
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [step-slew],
+ [AS_HELP_STRING(
+ [--enable-step-slew],
+ [s step and slew the time]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_DEFINE([STEP_SLEW], [1], [Step, then slew the clock?])
+esac
+
+AC_MSG_CHECKING([if ntpdate should step the time])
+
+case "$host" in
+ *-apple-aux[[23]]*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [ntpdate-step],
+ [AS_HELP_STRING(
+ [--enable-ntpdate-step],
+ [s if ntpdate should step the time]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_DEFINE([FORCE_NTPDATE_STEP], [1],
+ [force ntpdate to step the clock if !defined(STEP_SLEW) ?])
+esac
+
+
+AC_MSG_CHECKING([if we should sync TODR clock every hour])
+
+case "$host" in
+ *-*-nextstep*)
+ ans=yes
+ ;;
+ *-*-openvms*) # HMS: won't be found
+ ans=yes
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [hourly-todr-sync],
+ [AS_HELP_STRING(
+ [--enable-hourly-todr-sync],
+ [s if we should sync TODR hourly]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ac_cv_var_sync_todr" in
+ yes)
+ AC_DEFINE([DOSYNCTODR], [1], [synch TODR hourly?]) ;;
+esac
+
+
+AC_MSG_CHECKING([if we should avoid kernel FLL bug])
+
+case "$host" in
+ *-*-solaris2.6)
+ unamev=`uname -v`
+ case "$unamev" in
+ Generic_105181-*)
+ old_IFS="$IFS"
+ IFS="-"
+ set $unamev
+ IFS="$old_IFS"
+ if test "$2" -ge 17
+ then
+ # Generic_105181-17 and higher
+ ans=no
+ else
+ ans=yes
+ fi
+ ;;
+ *)
+ ans=yes
+ ;;
+ esac
+ ;;
+ *-*-solaris2.7)
+ unamev=`uname -v`
+ case "$unamev" in
+ Generic_106541-*)
+ old_IFS="$IFS"
+ IFS="-"
+ set $unamev
+ IFS="$old_IFS"
+ if test "$2" -ge 07
+ then
+ # Generic_106541-07 and higher
+ ans=no
+ else
+ ans=yes
+ fi
+ ;;
+ *)
+ ans=yes
+ ;;
+ esac
+ ;;
+ *)
+ ans=no
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [kernel-fll-bug],
+ [AS_HELP_STRING(
+ [--enable-kernel-fll-bug],
+ [s if we should avoid a kernel FLL bug]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_DEFINE([KERNEL_FLL_BUG], [1], [Does the kernel have an FLL bug?])
+esac
+
+
+AC_MSG_CHECKING([if we want new session key behavior])
+AC_ARG_ENABLE(
+ [bug1243-fix],
+ [AS_HELP_STRING(
+ [--enable-bug1243-fix],
+ [+ use unmodified autokey session keys]
+ )],
+ [ans=$enableval],
+ [ans=yes]
+)
+AC_MSG_RESULT([$ans])
+case "$ans" in
+ no)
+ AC_DEFINE([DISABLE_BUG1243_FIX], [1],
+ [use old autokey session key behavior?])
+esac
+
+
+AC_MSG_CHECKING([if we should use the IRIG sawtooth filter])
+
+case "$host" in
+ *-*-solaris2.[[89]])
+ ans=yes
+ ;;
+ *-*-solaris2.1[[0-9]]*)
+ ans=yes
+ ;;
+ *) ans=no
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [irig-sawtooth],
+ [AS_HELP_STRING(
+ [--enable-irig-sawtooth],
+ [s if we should enable the IRIG sawtooth filter]
+ )],
+ [ans=$enableval]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_DEFINE([IRIG_SUCKS], [1],
+ [Should we use the IRIG sawtooth filter?])
+esac
+
+AC_MSG_CHECKING([if we should enable NIST lockclock scheme])
+
+AC_ARG_ENABLE(
+ [nist],
+ [AS_HELP_STRING(
+ [--enable-nist],
+ [- if we should enable the NIST lockclock scheme]
+ )],
+ [ans=$enableval],
+ [ans=no]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ yes)
+ AC_DEFINE([LOCKCLOCK], [1],
+ [Should we align with the NIST lockclock scheme?]) ;;
+esac
+
+AC_MSG_CHECKING([if we want support for Samba's signing daemon])
+
+AC_ARG_ENABLE(
+ [ntp-signd],
+ [AS_HELP_STRING(
+ [--enable-ntp-signd],
+ [- Provide support for Samba's signing daemon, =/var/run/ntp_signd]
+ )],
+ [ans=$enableval],
+ [ans=no]
+)
+
+AC_MSG_RESULT([$ans])
+
+case "$ans" in
+ no)
+ ntp_signd_path=
+ ;;
+ yes)
+ ntp_signd_path=/var/run/ntp_signd
+ ;;
+ *)
+ ntp_signd_path="$ans"
+esac
+
+case "$ntp_signd_path" in
+ '')
+ ;;
+ *)
+ AC_DEFINE([HAVE_NTP_SIGND], [1],
+ [Do we want support for Samba's signing daemon?])
+ AC_DEFINE_UNQUOTED([NTP_SIGND_PATH], ["$ntp_signd_path"],
+ [Path to sign daemon rendezvous socket])
+ ;;
+esac
+
+AC_CHECK_HEADERS([libscf.h])
+LSCF=
+case "$ac_cv_header_libscf_h" in
+ yes)
+ LSCF='-lscf'
+esac
+AC_SUBST([LSCF])
+
+NTP_IPV6
+
+
+#
+# Look for a sysctl call to get the list of network interfaces.
+#
+AC_CACHE_CHECK(
+ [for interface list sysctl],
+ [ntp_cv_iflist_sysctl],
+ [AC_PREPROC_IFELSE(
+ [
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+ #include <sys/socket.h>
+ #ifndef NET_RT_IFLIST
+ # error
+ #endif
+ ],
+ [ntp_cv_iflist_sysctl=yes],
+ [ntp_cv_iflist_sysctl=no]
+ )]
+)
+case "$ntp_cv_iflist_sysctl" in
+ yes)
+ AC_DEFINE([HAVE_IFLIST_SYSCTL], [1], [have iflist_sysctl?])
+esac
+
+###
+
+AC_MSG_CHECKING([if we want the saveconfig mechanism])
+AC_ARG_ENABLE(
+ [saveconfig],
+ [AS_HELP_STRING(
+ [--enable-saveconfig],
+ [+ saveconfig mechanism]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=yes]
+)
+ntp_saveconfig_enabled=0
+case "$ntp_ok" in
+ yes)
+ ntp_saveconfig_enabled=1
+ AC_DEFINE([SAVECONFIG], [1], [saveconfig mechanism])
+ ;;
+esac
+AM_CONDITIONAL([SAVECONFIG_ENABLED], [test x$ntp_saveconfig_enabled = x1])
+AC_MSG_RESULT([$ntp_ok])
+
+dnl gtest is needed for our tests subdirs. It would be nice if we could
+dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX
+dnl can't be conditionalized.
+NTP_GOOGLETEST
+
+###
+
+AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
+ [Default location of crypto key info])
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([adjtimed/Makefile])
+AC_CONFIG_FILES([clockstuff/Makefile])
+AC_CONFIG_FILES([include/Makefile])
+AC_CONFIG_FILES([include/isc/Makefile])
+AC_CONFIG_FILES([kernel/Makefile])
+AC_CONFIG_FILES([kernel/sys/Makefile])
+AC_CONFIG_FILES([libntp/Makefile])
+AC_CONFIG_FILES([libparse/Makefile])
+AC_CONFIG_FILES([ntpd/Makefile])
+AC_CONFIG_FILES([ntpd/complete.conf], [sed -e '/^rlimit$/d' < ntpd/complete.conf > ntpd/complete.conf.new && mv ntpd/complete.conf.new ntpd/complete.conf])
+AC_CONFIG_FILES([ntpdate/Makefile])
+AC_CONFIG_FILES([ntpdc/Makefile])
+AC_CONFIG_FILES([ntpdc/nl.pl], [chmod +x ntpdc/nl.pl])
+AC_CONFIG_FILES([ntpq/Makefile])
+AC_CONFIG_FILES([ntpsnmpd/Makefile])
+AC_CONFIG_FILES([parseutil/Makefile])
+AC_CONFIG_FILES([scripts/Makefile])
+AC_CONFIG_FILES([scripts/lib/Makefile])
+AC_CONFIG_FILES([scripts/calc_tickadj/calc_tickadj], [chmod +x scripts/calc_tickadj/calc_tickadj])
+AC_CONFIG_FILES([scripts/calc_tickadj/Makefile])
+AC_CONFIG_FILES([scripts/build/mkver], [chmod +x scripts/build/mkver])
+AC_CONFIG_FILES([scripts/ntp-wait/ntp-wait], [chmod +x scripts/ntp-wait/ntp-wait])
+AC_CONFIG_FILES([scripts/ntp-wait/Makefile])
+AC_CONFIG_FILES([scripts/ntpsweep/ntpsweep], [chmod +x scripts/ntpsweep/ntpsweep])
+AC_CONFIG_FILES([scripts/ntpsweep/Makefile])
+AC_CONFIG_FILES([scripts/ntptrace/ntptrace], [chmod +x scripts/ntptrace/ntptrace])
+AC_CONFIG_FILES([scripts/ntptrace/Makefile])
+AC_CONFIG_FILES([scripts/ntpver], [chmod +x scripts/ntpver])
+AC_CONFIG_FILES([scripts/plot_summary], [chmod +x scripts/plot_summary])
+AC_CONFIG_FILES([scripts/summary], [chmod +x scripts/summary])
+AC_CONFIG_FILES([scripts/build/Makefile])
+AC_CONFIG_FILES([tests/Makefile])
+AC_CONFIG_FILES([tests/libntp/Makefile])
+AC_CONFIG_FILES([tests/ntpd/Makefile])
+AC_CONFIG_FILES([util/Makefile])
+
+perllibdir="${datadir}/ntp/lib"
+AC_DEFINE_DIR([PERLLIBDIR], [perllibdir], [data dir])
+
+calc_tickadj_opts="$srcdir/scripts/calc_tickadj/calc_tickadj-opts"
+AC_SUBST_FILE([calc_tickadj_opts])
+ntp_wait_opts="$srcdir/scripts/ntp-wait/ntp-wait-opts"
+AC_SUBST_FILE([ntp_wait_opts])
+ntpsweep_opts="$srcdir/scripts/ntpsweep/ntpsweep-opts"
+AC_SUBST_FILE([ntpsweep_opts])
+ntptrace_opts="$srcdir/scripts/ntptrace/ntptrace-opts"
+AC_SUBST_FILE([ntptrace_opts])
+summary_opts="$srcdir/scripts/summary-opts"
+AC_SUBST_FILE([summary_opts])
+plot_summary_opts="$srcdir/scripts/plot_summary-opts"
+AC_SUBST_FILE([plot_summary_opts])
+
+AC_CONFIG_SUBDIRS([sntp])
+
+AC_OUTPUT
diff --git a/deps-ver b/deps-ver
new file mode 100644
index 0000000..16d66a8
--- /dev/null
+++ b/deps-ver
@@ -0,0 +1 @@
+Fri Dec 30 11:24:57 UTC 2011
diff --git a/depsver.mf b/depsver.mf
new file mode 100644
index 0000000..695f730
--- /dev/null
+++ b/depsver.mf
@@ -0,0 +1,60 @@
+$(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 $@
+
+BUILT_SOURCES += .deps-ver
+CLEANFILES += .deps-ver
+
+#
+# depsver.mf included in Makefile.am for directories with .deps
+#
+# When building in the same directory with sources that change over
+# time, such as when tracking using bk, the .deps files can become
+# stale with respect to moved, deleted, or superceded headers. Most
+# commonly, this would exhibit as make reporting a failure to make a
+# header file which is no longer in the location given. To address
+# this issue, we use a deps-ver file which is updated with each change
+# that breaks old .deps files. A copy of deps-ver is made into
+# $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present
+# with different contents than deps-ver, we make clean to ensure all
+# .o files built before the incompatible change are rebuilt along with
+# their updated .deps files, then remove $(DEPDIR) and recreate it as
+# empty stubs.
+#
+# It is normal when configured with --disable-dependency-tracking for
+# the DEPDIR to not have been created. For this reason, we use the
+# intermediate target .deps-ver, which invokes make recursively if
+# DEPDIR exists.
+#
+# If you modify depsver.mf, please make the changes to the master
+# copy, the one in sntp is copied by the bootstrap script from it.
+#
+# This comment block follows rather than leads the related code so that
+# it stays with it in the generated Makefile.in and Makefile.
+#
diff --git a/dot.emacs b/dot.emacs
new file mode 100644
index 0000000..941ecbe
--- /dev/null
+++ b/dot.emacs
@@ -0,0 +1,19 @@
+;; This is how Dave Mills likes to see the NTP code formatted.
+
+(defconst ntp-c-style
+ '((c-basic-offset . 8)
+ (fill-column . 72)
+ (c-offsets-alist . ((arglist-intro . +)
+ (case-label . *)
+ (statement-case-intro . *)
+ (statement-cont . *)
+ (substatement-open . 0))))
+ "David L. Mills; NTP code indentation style")
+
+(defun ntp-c-mode-common-hook ()
+ ;; add ntp c style
+ (c-add-style "ntp" ntp-c-style nil))
+
+(add-hook 'c-mode-common-hook 'ntp-c-mode-common-hook)
+
+;; 1997112600
diff --git a/flock-build b/flock-build
new file mode 100755
index 0000000..b537ac3
--- /dev/null
+++ b/flock-build
@@ -0,0 +1,133 @@
+#! /bin/sh
+
+IAM=`hostname || uname -n`
+MYNAME=`IFS=. ; set $IAM ; echo $1`
+
+case "$1" in
+ '--one'|'-1')
+ shift
+ FB_FIRSTONLY=1
+ LIST=$MYNAME
+ ;;
+ *)
+ FB_FIRSTONLY=0
+esac
+
+BUILD_ARGS="$@"
+PARSE="--enable-parse-clocks"
+#PARSE=
+STD="--enable-simulator"
+
+case "$SIMUL::$FB_FIRSTONLY" in
+ ::*)
+ PARALLEL_BUILDS=1
+ ;;
+ *::0)
+ PARALLEL_BUILDS=$SIMUL
+ ;;
+ *)
+ PARALLEL_BUILDS=1
+esac
+
+case "$PARALLEL_BUILDS" in
+ 1) ;;
+ *) echo Launching $PARALLEL_BUILDS parallel builds on each machine
+esac
+
+# Backroom:
+# barnstable freebsd-6.1
+# beauregard freebsd-6.0
+# X churchy alpha-dec-osf5.1
+# deacon sparc-sun-solaris2.10
+# grundoon freebsd-6.2
+# howland freebsd-6.1
+# o macabre freebsd-6.1-STABLE
+# o mort freebsd-6.1
+# whimsy sparc-sun-solaris2.10
+
+# Campus:
+# * baldwin sparc-sun-solaris2.10
+# * bridgeport sparc-sun-solaris2.10
+# * malarky sparc-sun-solaris2.10
+# * pogo sparc-sun-solaris2.10
+# * rackety freebsd-6.1
+
+if [ ! -r sntp/libevent/build-aux/config.guess ] ; then
+ echo "Error: bootstrap required." 1>&2 && exit 1
+fi
+
+# HMS: we need $PWD because solaris produces /deacon/backroom when
+# we are in /backroom and in general there is no /deacon/backroom.
+c_d=${PWD:-`pwd`}
+
+SIG=`perl -e 'print rand'`
+
+case "$LIST" in
+ '') LIST="pogo" ;;
+esac
+
+for i in $LIST
+do
+ SKIPTHIS=0
+ [ -f .buildkey-$i ] && SKIPTHIS=1
+ case "$SKIPTHIS" in
+ 1)
+ echo flock-build running on $i? check LIST, skipping
+ ;;
+ 0)
+ echo $i
+ echo $SIG > .buildkey-$i
+ case "1" in
+ 0)
+ ssh $i "cd $c_d ; ./build $SIG $PARSE $STD $BUILD_ARGS" &
+ ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS" &
+ ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --without-crypto --enable-c99-snprintf $BUILD_ARGS" &
+ ssh $i "cd $c_d ; ./build $SIG $STD --disable-all-clocks --disable-autokey --without-sntp --disable-thread-support $BUILD_ARGS" &
+ ;;
+ 1)
+ cat > .flockbuild-$i-$SIG <<-ENDQUOT
+ #!/bin/sh
+
+ # script uses job control and expects to be invoked
+ # in a ssh session started with the -tt option,
+ # which forces a pseudo-tty to be used.
+
+ cd $c_d
+ COUNT=0
+
+ ./build $SIG $PARSE $STD $BUILD_ARGS &
+
+ COUNT=\`expr \$COUNT + 1\`
+ echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4
+ [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
+
+ case $FB_FIRSTONLY in
+ '0')
+ ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS &
+
+ COUNT=\`expr \$COUNT + 1\`
+ echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4
+ [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
+
+ ./build $SIG $PARSE $STD --without-crypto --enable-c99-snprintf $BUILD_ARGS &
+
+ COUNT=\`expr \$COUNT + 1\`
+ echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4
+ [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
+
+ ./build $SIG $STD --disable-all-clocks --disable-autokey --without-sntp --disable-thread-support $BUILD_ARGS &
+
+ COUNT=\`expr \$COUNT + 1\`
+ echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4
+ wait
+ esac
+ echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done.
+ rm .buildkey-$i
+ENDQUOT
+ chmod +x .flockbuild-$i-$SIG
+ ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \
+ rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null &
+ esac
+ esac
+done
+echo `date -u '+%H:%M:%S'` flock-build launched
diff --git a/html/access.html b/html/access.html
new file mode 100644
index 0000000..3489f8f
--- /dev/null
+++ b/html/access.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Access Control Support</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+<style type="text/css">
+<!--
+<style1 {
+color: #FF0000;
+ font-weight: bold;
+}
+-->
+</style>
+</head>
+<body>
+<h3>Access Control Support</h3>
+<p><img src="pic/pogo6.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a></p>
+<p>The skunk watches for intruders and sprays.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:53<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/accopt.txt"></script>
+<hr>
+<h4>Access Control Support</h4>
+<p>The <tt>ntpd</tt> daemon implements a general purpose access control list (ACL) containing address/match entries sorted first by increasing address values and then by increasing mask values. A match occurs when the bitwise AND of the mask and the packet source address is equal to the bitwise AND of the mask and address in the list. The list is searched in order with the last match found defining the restriction flags associated with the entry.</p>
+<p>The ACL is specified as a list of <tt>restrict</tt> commands in the following format:</p>
+<p><tt>restrict <i>address</i> [mask <i>mask</i>] [<i>flag</i>][...]</tt></p>
+<p>The <tt><i>address</i></tt> argument expressed in dotted-quad form is the address of a host or network. Alternatively, the <tt><i>address</i></tt> argument can be a valid host DNS name. The <tt><i>mask</i></tt> argument expressed in IPv4 or IPv6 numeric address form defaults to all mask bits on, meaning that the <tt><i>address</i></tt> is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and address :: mask :: for IPv6) is always the first entry in the list. <tt>restrict default</tt>, with no mask option, modifies both IPv4 and IPv6 default entries. <tt>restrict source</tt> configures a template restriction automatically added at runtime for each association, whether configured, ephemeral, or preemptable, and removed when the association is demobilized.</p>
+<p>Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags. are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server.</p>
+<p>An example may clarify how it works. Our campus has two class-B networks, 128.4 for the ECE and CIS departments and 128.175 for the rest of campus. Let's assume (not true!) that subnet 128.4.1 homes critical services like class rosters and spread sheets. A suitable ACL might look like this:</p>
+<pre>
+restrict default nopeer # deny new associations
+restrict 128.175.0.0 mask 255.255.0.0 # allow campus access
+restrict 128.4.0.0 mask 255.255.0.0 none # allow ECE and CIS access
+restrict 128.4.1.0 mask 255.255.255.0 notrust # require authentication on subnet 1
+restrict time.nist.gov # allow access
+</pre>
+<p>While this facility may be useful for keeping unwanted, broken or malicious clients from congesting innocent servers, it should not be considered an alternative to the NTP authentication facilities. Source address based restrictions are easily circumvented by a determined cracker.</p>
+<p>Default restriction list entries with the flags <tt>ignore, ntpport</tt>, for each of the local host's interface addresses are inserted into the table at startup to prevent the server from attempting to synchronize to its own time. A default entry is also always present, though if it is otherwise unconfigured; no flags are associated with the default entry (i.e., everything besides your own NTP server is unrestricted).</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
+</html>
diff --git a/html/accopt.html b/html/accopt.html
new file mode 100644
index 0000000..6caff48
--- /dev/null
+++ b/html/accopt.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Access Control Commands and Options</title>
+<!-- Changed by: Harlan &, 13-Nov-2014 -->
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+<style type="text/css">
+<!--
+<style1 {
+color: #FF0000;
+ font-weight: bold;
+}
+-->
+</style>
+</head>
+<body>
+<h3>Access Control Commands and Options</h3>
+<img src="pic/pogo6.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>The skunk watches for intruders and sprays.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->13-Nov-2014 03:00<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/accopt.txt"></script>
+<hr>
+<h4>Commands and Options</h4>
+<p>Unless noted otherwise, further information about these ccommands is on the <a href="accopt.html">Access Control Support</a> page.</p>
+<dl>
+ <dt id="discard"><tt>discard [ average <i>avg</i> ][ minimum <i>min</i> ] [ monitor <i>prob</i> ]</tt></dt>
+ <dd>Set the parameters of the rate control facility which protects the server from client abuse. If the <tt>limited</tt> flag is present in the ACL, packets that violate these limits are discarded. If, in addition, the <tt>kod</tt> flag is present, a kiss-o'-death packet is returned. See the <a href="rate.html">Rate Management</a> page for further information. The options are:
+ <dl>
+ <dt><tt>average <i>avg</i></tt></dt>
+ <dd>Specify the minimum average interpacket spacing (minimum average headway
+ time) in log<sub>2</sub> s with default 3.</dd>
+ <dt><tt>minimum <i>min</i></tt></dt>
+ <dd>Specify the minimum interpacket spacing (guard time) in seconds with default 2.</dd>
+ <dt><tt>monitor</tt></dt>
+ <dd>Specify the probability of being recorded for packets that overflow the MRU list size limit set by <tt>mru maxmem</tt> or <tt>mru maxdepth</tt>. This is a performance optimization for servers with aggregate arrivals of 1000 packets per second or more.</dd>
+ </dl>
+ </dd>
+ <dt id="restrict"><tt>restrict default [<i>flag</i>][...]<br>
+ restrict source [<i>flag</i>][...]<br>
+ restrict <i>address</i> [mask <i>mask</i>] [<i>flag</i>][...]</tt></dt>
+ <dd>The <tt><i>address</i></tt> argument expressed in dotted-quad form is the address of a host or network. Alternatively, the <tt><i>address</i></tt> argument can be a valid host DNS name. The <tt><i>mask</i></tt> argument expressed in IPv4 or IPv6 numeric address form defaults to all mask bits on, meaning that the <tt><i>address</i></tt> is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and address :: mask :: for IPv6) is always the first entry in the list. <tt>restrict default</tt>, with no mask option, modifies both IPv4 and IPv6 default entries. <tt>restrict source</tt> configures a template restriction automatically added at runtime for each association, whether configured, ephemeral, or preemptible, and removed when the association is demobilized.</dd>
+ <dd>Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags. are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified:</dd>
+ <dd>
+ <dl>
+ <dt><tt>flake</tt></dt>
+ <dd>Discard received NTP packets with probability 0.1; that is, on average drop one packet in ten. This is for testing and amusement. The name comes from Bob Braden's <i>flakeway</i>, which once did a similar thing for early Internet testing.</dd>
+ <dt><tt>ignore</tt></dt>
+ <dd>Deny packets of all kinds, including <tt>ntpq</tt> and <tt>ntpdc</tt> queries.</dd>
+ <dt><tt>kod</tt></dt>
+ <dd>Send a kiss-o'-death (KoD) packet if the <tt>limited</tt> flag is present and a packet violates the rate limits established by the <tt>discard</tt> command. KoD packets are themselves rate limited for each source address separately. If the <tt>kod</tt> flag is used in a restriction which does not have the <tt>limited</tt> flag, no KoD responses will result.</dd>
+ <dt id="limited"><tt>limited</tt></dt>
+ <dd>Deny time service if the packet violates the rate limits established by the <tt>discard</tt> command. This does not apply to <tt>ntpq</tt> and <tt>ntpdc</tt> queries.</dd>
+ <dt><tt>lowpriotrap</tt></dt>
+ <dd>Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps.</dd>
+ <dt><tt>mssntp</tt></dt>
+ <dd>Enable Microsoft Windows MS-SNTP authentication using Active Directory services. <span class="style1"><b>Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.</b></span></dd>
+ <dt><tt>nomodify</tt></dt>
+ <dd>Deny <tt>ntpq</tt> and <tt>ntpdc</tt> queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted.</dd>
+ <dt><tt>noquery</tt></dt>
+ <dd>Deny <tt>ntpq</tt> and <tt>ntpdc</tt> queries. Time service is not affected.</dd>
+ <dt><tt>nopeer</tt></dt>
+ <dd>Deny packets that might mobilize an association unless authenticated. This includes broadcast, symmetric-active and manycast server packets when a configured association does not exist. It also includes <tt>pool</tt> associations, so if you want to use servers from a <tt>pool</tt> directive and also want to use <tt>nopeer</tt> by default, you'll want a <tt>"restrict source ..."</tt> line as well that does <i>not</i> include the <tt>nopeer</tt> directive. Note that this flag does not apply to packets that do not attempt to mobilize an association. </dd>
+ <dt><tt>noserve</tt></dt>
+ <dd>Deny all packets except <tt>ntpq</tt> and <tt>ntpdc</tt> queries.</dd>
+ <dt><tt>notrap</tt></dt>
+ <dd>Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the <tt>ntpdc</tt> control message protocol which is intended for use by remote event logging programs.</dd>
+ <dt><tt>notrust</tt></dt>
+ <dd>Deny packets that are not cryptographically authenticated. Note carefully how this flag interacts with the <tt>auth</tt> option of the <tt>enable</tt> and <tt>disable</tt> commands. If <tt>auth</tt> is enabled, which is the default, authentication is required for all packets that might mobilize an association. If <tt>auth</tt> is disabled, but the <tt>notrust</tt> flag is not present, an association can be mobilized whether or not authenticated. If <tt>auth</tt> is disabled, but the <tt>notrust</tt> flag is present, authentication is required only for the specified address/mask range. </dd>
+ <dt><tt>ntpport</tt></dt>
+ <dd>This is actually a match algorithm modifier, rather than a restriction
+ flag. Its presence causes the restriction entry to be matched only if the
+ source port in the packet is the standard NTP UDP port (123). A restrict line
+ containing <tt>ntpport</tt> is considered more specific than one with the
+ same address and mask, but lacking <tt>ntpport</tt>.</dd>
+ <dt><tt>version</tt></dt>
+ <dd>Deny packets that do not match the current NTP version.</dd>
+ </dl>
+ </dd>
+ <dd>Default restriction list entries with the flags <tt>ignore, ntpport</tt>, for each of the local host's interface addresses are inserted into the table at startup to prevent the server from attempting to synchronize to its own time. A default entry is also always present, though if it is otherwise unconfigured; no flags are associated with the default entry (i.e., everything besides your own NTP server is unrestricted).</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/assoc.html b/html/assoc.html
new file mode 100644
index 0000000..8dc0b1b
--- /dev/null
+++ b/html/assoc.html
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Association Management</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Association Management</h3>
+<img src="pic/alice51.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
+<p>Make sure who your friends are.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/config.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#modes">Association Modes</a></li>
+ <li class="inline"><a href="#client">Client/Server Mode</a></li>
+ <li class="inline"><a href="#symact">Symmetric Active/Passive Mode</a></li>
+ <li class="inline"><a href="#broad">Broadcast/Multicast Modes</a></li>
+ <li class="inline"><a href="#many">Manycast Mode</a></li>
+ <li class="inline"><a href="#poll">Poll Interval Management</a></li>
+ <li class="inline"><a href="#burst">Burst Options</a></li>
+</ul>
+<hr>
+<h4 id="modes">Association Modes</h4>
+<p>This page describes the various modes of operation provided in NTPv4. There are three types of associations in NTP: <em>persistent</em>, <em>preemptable</em> and <em>ephemeral</em>. Persistent associations are mobilized by a configuration command and never demobilized. Preemptable associations, which are new to NTPv4, are mobilized by a configuration command which includes the <tt>preempt</tt> option or upon arrival of an automatic server discovery packet. They are are demobilized by timeout or when preempted by a &quot;better&quot; server, as described on the <a href="discover.html">Automatic Server Discovery Schemes</a> page. Ephemeral associations are mobilized upon arrival of broadcast or multicast server packets and demobilized by timeout.</p>
+<p>Ordinarily, successful mobilization of ephemeral associations requires the server to be cryptographically authenticated to the client. This can be done using either symmetric key or Autokey public key cryptography, as described on the <a href="authentic.html">Authentication Support</a> page.</p>
+<p>There are three principal modes of operation in NTP: client/server, symmetric active/passive and broadcast/multicast. There are three automatic server discovery schemes in NTP: broadcast/multicast, manycast and pool described on the <a href="discover.html">Automatic Server Discovery Schemes</a> page. In addition, the <a href="#burst">burst options</a> and <a href="orphan.html">orphan mode</a> can be used in appropriate cases.</p>
+<p>Following is a summary of the operations in each mode. Note that reference to option applies to the commands described on the <a href="confopt.html">Server Commands and Options</a> page. See that page for applicability and defaults.</p>
+<h4 id="client">Client/Server Mode</h4>
+<p>Client/server mode is the most common configuration in the Internet today. It operates in the classic remote-procedure-call (RPC) paradigm with stateless servers and stateful clients. In this mode a host sends a client (mode 3) request to the specified server and expects a server (mode 4) reply at some future time. In some contexts this would be described as a &quot;pull&quot; operation, in that the host pulls the time and related values from the server.</p>
+<p>A host is configured in client mode using the <tt>server</tt> (sic) command and specifying the server DNS&nbsp;name or IPv4 or IPv6 address; the server requires no prior configuration. The <tt>iburst</tt> option described later on this page is recommended for clients, as this speeds up initial synchronization from several minutes to several seconds. The <tt>burst</tt> option described later on this page can be useful to reduce jitter on very noisy dial-up or ISDN network links.</p>
+<p>Ordinarily, the program automatically manages the poll interval between the default minimum and maximum values. The <tt>minpoll</tt> and <tt>maxpoll</tt> options can be used to bracket the range. Unless noted otherwise, these options should not be used with reference clock drivers.</p>
+<h4 id="symact">Symmetric Active/Passive Mode</h4>
+<p>Symmetric active/passive mode is intended for configurations where a clique
+ of low-stratum peers operate as mutual backups for each other. Each peer operates
+ with one or more primary reference sources, such as a reference clock, or a set
+ of secondary (stratum, 2) servers known to be reliable and authentic. Should
+ one of the peers lose all reference sources or simply cease operation, the
+ other peers will automatically reconfigure so that time and related values
+ can flow from the surviving peers to all hosts in the subnet. In some contexts
+ this would be described as a &quot;push-pull&quot; operation, in that the
+ peer either pulls or pushes the time and related values depending on the particular
+ configuration.</p>
+<p>A symmetric active peer sends a symmetric active (mode 1) message to a designated peer. If a matching configured symmetric active association is found, the designated peer returns a symmetric active message. If no matching association is found, the designated peer mobilizes a ephemeral symmetric passive association and returns a symmetric passive (mode 2) message. Since an intruder can impersonate a symmetric active peer and cause a spurious symmetric passive association to be mobilized, symmetric passive mode should always be cryptographically validated.</p>
+<p>A peer is configured in symmetric active mode using the <tt>peer</tt> command and specifying the other peer DNS name or IPv4 or IPv6 address. The <tt>burst</tt> and <tt>iburst</tt> options should not be used in symmetric modes, as this can upset the intended symmetry of the protocol and result in spurious duplicate or dropped messages.</p>
+<p>As symmetric modes are most often used as root servers for moderate to large subnets where rapid response is required, it is generally best to set the minimum and maximum poll intervals of each root server to the same value using the <tt>minpoll</tt> and <tt>maxpoll</tt> options.</p>
+<h4 id="broad">Broadcast/Multicast Modes</h4>
+<p>NTP broadcast and multicast modes are intended for configurations involving one or a few servers and a possibly very large client population. Broadcast mode can be used with Ethernet, FDDI and WiFi spans interconnected by hubs or switches. Ordinarily, broadcast packets do not extend beyond a level-3 router. Where service is intended beyond a level-3 router, multicast mode can be used. Additional information is on the <a href="discover.html">Automatic NTP Configuration Options</a> page.</p>
+<p>A server is configured to send broadcast or multicast messages using the <tt>broadcast</tt> command and specifying the subnet address for broadcast or the multicast group address for multicast. A broadcast client is enabled using the <a href="confopt.html#broadcastclient"><tt>broadcastclient</tt></a> command, while a multicast client is enabled using the <a href="confopt.html#multicastclient"><tt>multicastclient</tt></a> command and specifying the multicast group address. Multiple commands of either type can be used. However, the association is not mobilized until the first broadcast or multicast message is actually received.</p>
+<h4 id="many">Manycast and Pool Modes</h4>
+<p>Manycast and pool modes are automatic discovery and configuration paradigms new to NTPv4. They are intended as a means for a client to troll the nearby network neighborhood to find cooperating willing servers, validate them using cryptographic means and evaluate their time values with respect to other servers that might be lurking in the vicinity. The intended result is that each client mobilizes ephemeral client associations with some number of the &quot;best&quot; of the nearby servers, yet automatically reconfigures to sustain this number of servers should one or another fail. Additional information is on the <a href="discover.html">Automatic Server Discovery Schemes</a> page.</p>
+<h4 id="poll">Poll Interval Management</h4>
+<p>NTP uses an intricate heuristic algorithm to automatically control the poll interval for maximum accuracy consistent with minimum network overhead. The algorithm measures the incidental offset and jitter to determine the best poll interval. When <tt>ntpd</tt> starts, the interval is the default minimum 64 s. Under normal conditions when the clock discipline has stabilized, the interval increases in steps to the default maximum 1024 s. In addition, should a server become unreachable after some time, the interval increases in steps to the maximum in order to reduce network overhead. Additional information about the algorithm is on the <a href="poll.html">Poll Program</a> page.</p>
+<p>The default poll interval range is suitable for most conditions, but can be changed using options on the <a href="confopt.html">Server Commands and Options</a> and <a href="miscopt.html">Miscellaneous Options</a> pages. However, when using maximum intervals much larger than the default, the residual clock frequency error must be small enough for the discipline loop to capture and correct. The capture range is 500 PPM with a 64-s interval decreasing by a factor of two for each interval doubling. At a 36-hr interval, for example, the capture range is only 0.24 PPM.</p>
+<p>In the NTPv4 specification and reference implementation, the poll interval is expressed in log<sub>2</sub> units, properly called the <em>poll exponent.</em> It is constrained by the lower limit <tt>minpoll</tt> and upper limit <tt>maxpoll</tt> options of the <a href="confopt.html"><tt>server</tt></a> command. The limits default to 6 (64 s) and 10 (1024 s), respectively, which are appropriate for the vast majority of cases.</p>
+<p>As a rule of thumb, the expected errors increase by a factor of two as the poll interval increases by a factor of four. The poll interval algorithm slowly increases the poll interval when jitter dominates the error budget, but quickly reduces the interval when wander dominates it. More information about this algorithm is on the <a href="warp.html">How NTP Works</a> page.</p>
+<p>There is normally no need to change the poll limits, as the poll interval is managed automatically as a function of prevailing jitter and wander. The most common exceptions are the following.</p>
+<ul>
+ <li>With fast, lightly loaded LANs and modern processors, the nominal Allan intercept is about 500 s. In these cases the expected errors can be further reduced using a poll exponent of 4 (16 s). In the case of the pulse-per-second (PPS) driver, this is the recommended value.</li>
+ <li>With symmetric modes the most stable behavior results when both peers are configured in symmetric active mode with matching poll intervals of 6 (64 s).</li>
+ <li>The poll interval should not be modified for reference clocks, with the single exception the ACTS telephone modem driver. In this case the recommended minimum and maximum intervals are 12 (1.1 hr) and 17 (36 hr), respectively.</li>
+</ul>
+<h4 id="burst">Burst Options</h4>
+<p>Occasionally it is necessary to send packets temporarily at intervals less than the poll interval. For instance, with the <tt>burst</tt> and <tt>iburst</tt> options of the <a href="confopt.html"><tt>server</tt></a> command, the poll program sends a burst of several packets at 2-s intervals. In either case the poll program avoids sending needless packets if the server is not responding. The client begins a burst with a single packet. When the first packet is received from the server, the client continues with the remaining packets in the burst. If the first packet is not received within 64 s, it will be sent again for two additional retries before beginning backoff. The result is to minimize network load if the server is not responding. Additional details are on the <a href="poll.html">Poll Program</a> page.</p>
+<p>There are two burst options where a single poll event triggers a burst. They should be used only with the <tt>server</tt> and <tt>pool</tt> commands, but not with reference clock drivers nor symmetric mode peers. In both modes, received server packets update the clock filter, which selects the best (most accurate) time values. When the last packet in the burst is sent, the next received packet updates the system variables and adjusts the system clock as if only a single packet exchange had occurred.</p>
+<p>The <tt>iburst</tt> option is useful where the system clock must be set quickly or when the network attachment requires an initial calling or training sequence, as in PPP or ISDN services. In general, this option is recommended for <tt>server</tt> and <tt>pool</tt> commands. A burst is sent only when the server is unreachable; in particular, when first starting up. Ordinarily, the clock is set within a few seconds after the first received packet. See the <a href="clock.html">Clock State Machine</a> page for further details about the startup behavior.</p>
+<p>The <tt>burst</tt> option is useful in cases of severe network
+ jitter or when the network attachment requires an initial calling or training
+ sequence. This option is recommended when the minimum poll exponent is larger than 10 (1024 s). A burst is sent only when the server is reachable. The number of packets in the burst is determined by the poll interval
+ so that the average interval between packets (headway) is no less than the minimum poll interval for the association.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/audio.html b/html/audio.html
new file mode 100644
index 0000000..908cac8
--- /dev/null
+++ b/html/audio.html
@@ -0,0 +1,180 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Reference Clock Audio Drivers</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Reference Clock Audio Drivers</h3>
+<img src="pic/radio2.jpg" alt="jpg" align="left">ICOM R-72 shortwave receiver and Sure audio mixer
+<p>Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:55<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/refclock.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/audio.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#sound">Sound Card Drivers</a></li>
+ <li class="inline"><a href="#short">Shortwave Radio Drivers</a></li>
+ <li class="inline"><a href="#setup">Setup and Debugging Aids</a></li>
+</ul>
+<hr>
+<h4 id="sound">Sound Card Drivers</h4>
+<p>There are some applications in which the computer time can be disciplined to an audio signal, rather than a serial timecode and communications port or special purpose bus peripheral. This is useful in such cases where the audio signal is sent over a telephone circuit, for example, or received directly from a shortwave receiver. In such cases the audio signal can be connected via an ordinary sound card or baseboard audio codec. The suite of NTP reference clock drivers currently includes three drivers suitable for these applications. They include a driver for the Inter Range Instrumentation Group (IRIG) signals produced by many radio clocks and timing devices, another for the Canadian time/frequency radio station CHU and a third for the NIST time/frequency radio stations WWV and WWVH. The radio drivers are designed to work with ordinary inexpensive shortwave radios and may be one of the least expensive ways to build a good primary time server.</p>
+<p>All three drivers make ample use of sophisticated digital signal processing
+ algorithms designed to efficiently extract timing signals from noise and interference.
+ The radio station drivers in particular implement optimum linear demodulation
+ and decoding techniques, including maximum-likelihood and soft-decision methods.
+ The documentation page for each driver contains an in-depth discussion on
+ the algorithms and performance expectations. In some cases the algorithms
+ are further analyzed, modeled and evaluated in a technical report.</p>
+<p>Currently, the audio drivers work with with Sun operating systems and audio codecs, including SunOS 4.1.3 and Solaris from 2.6 and probably all others in between. They also work with FreeBSD from 4.1 with compatible sound card. In fact, the interface is quite generic and support for other systems, in particular the various Unix generics, should not be difficult. Volunteers are solicited.</p>
+<p>The audio drivers include a number of common features designed to groom input signals, suppress spikes and normalize signal levels. An automatic gain control (AGC) feature provides protection against overdriven or underdriven input signals. It is designed to maintain adequate demodulator signal amplitude while avoiding occasional noise spikes. In order to assure reliable operation, the signal level must be in the range where the audio gain control is effective. In general, this means the input signal level must be such as to cause the AGC to set the gain somewhere in the middle of the range from 0 to 255, as indicated in the timecode displayed by the <tt>ntpq</tt> program.</p>
+<p>The IRIG&nbsp;and WWV drivers operate by disciplining a logical clock based on the codec sample clock to the audio signal as received. This is done by stuffing or slipping samples as required to maintain exact frequency to the order of 0.1 PPM. In order for the driver to reliably lock on the audio signal, the sample clock frequency tolerance must be less than 250 PPM (.025 percent) for the IRIG driver and half that for the WWV driver. The largest error observed so far is about 60 PPM, but it is possible some sound cards or codecs may exceed that value. In any case, the configuration file command <tt>tinker codec</tt> command can be used to change the systematic offset in units of 125 PPM.</p>
+<p>The drivers include provisions to select the input port and to monitor the input signal. The <tt>fudge flag 2</tt> command selects the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port. The <tt>fudge flag 3</tt> command enables the input signal monitor using the previously selected output port and output gain. Both of these flags can be set in the configuration file or remotely using the <tt>ntpdc</tt> utility program.</p>
+<h4 id="short">Shortwave Radio Drivers</h4>
+<p>The WWV/H and CHU audio drivers require an external shortwave radio with the radio output - speaker or headphone jack - connected to either the microphone or line-in port on the computer. There is some degree of art in setting up the radio and antenna and getting the setup to work. While the drivers are highly sophisticated and efficient in extracting timing signals from noise and interference, it always helps to have as clear a signal as possible.</p>
+<p>The most important factor affecting the radio signal is the antenna. It need not be long - even 15 feet is enough if it is located outside of a metal frame building, preferably on the roof, and away from metallic objects. An ordinary CB whip mounted on a PVC pipe and wooden X-frame on the roof should work well with most portable radios, as they are optimized for small antennas.</p>
+<p>The radio need not be located near the computer; in fact, it generally works better if the radio is outside the near field of computers and other electromagnetic noisemakers. It can be in the elevator penthouse connected by house wiring, which can also be used to power the radio. A couple of center-tapped audio transformers will minimize noise pickup and provide phantom power to the radio with return via the building ground.</p>
+<p>The WWV/H and CHU transmitters operate on several frequencies simultaneously, so that in most parts of North America at least one frequency supports propagation to the receiver location at any given hour. While both drivers support the ICOM CI-V radio interface and can tune the radio automatically, computer-tunable radios are expensive and probably not cost effective compared to a GPS receiver. So, the radio frequency must usually be fixed and chosen by compromise.</p>
+<p>Shortwave (3-30 MHz) radio propagation phenomena are well known to shortwave enthusiasts. The phenomena generally obey the following rules:</p>
+<ul>
+ <li>The optimum frequency is higher in daytime than nighttime, stays high longer on summer days and low longer on winter nights.</li>
+ <li>Transitions between daytime and nighttime conditions generally occur somewhat
+ after sunrise and sunset at the midpoint of the path from transmitter to
+ receiver.</li>
+ <li>Ambient noise (static) on the lower frequencies follows the thunderstorm season, so is higher on summer afternoons and evenings.</li>
+ <li>The lower frequency bands are best for shorter distances, while the higher bands are best for longer distances.</li>
+ <li>The optimum frequencies are higher at the peak of the 11-year sunspot cycle and lower at the trough. The current sunspot cycle began at the minimum in late 2006 and should reach its peak in 2012.</li>
+</ul>
+<p>The best way to choose a frequency is to listen at various times over the day and determine the highest (daytime) and lowest (nighttime) frequencies that work well. Choose the frequency that works for the most number of hours in the day, usually the highest frequency. For instance, on the east coast the best compromise CHU frequency is 7335 kHz and the best WWV frequency is 15 MHz.</p>
+<h4>Autotune Modes</h4>
+<p>The shortwave drivers include support for an optional autotune function compatible with ICOM&nbsp;receivers and transceivers. The <tt>mode</tt> keyword of the <tt>server</tt> configuration command specifies the ICOM ID select code in decimal. A missing or zero argument disables the CI-V interface. Since all ICOM select codes are less than 128, the high order bit of the code is used by the driver to specify the baud rate. If this bit is not set, the rate is 9600 bps for the newer radios; if set, the rate is 1200 bps for the older radios. Following are the ID select codes for the known radios.</p>
+<table width="100%" cols="6">
+ <tr>
+ <td>Radio</td>
+ <td>Hex</td>
+ <td>Decimal</td>
+ <td>Radio</td>
+ <td>Hex</td>
+ <td>Decimal</td>
+ </tr>
+ <tr>
+ <td>706</td>
+ <td>0x4e</td>
+ <td>78</td>
+ <td>775</td>
+ <td>0x46</td>
+ <td>70</td>
+ </tr>
+ <tr>
+ <td>706MKIIG</td>
+ <td>0x58</td>
+ <td>88</td>
+ <td>781</td>
+ <td>0x26</td>
+ <td>38</td>
+ </tr>
+ <tr>
+ <td>725</td>
+ <td>0x28</td>
+ <td>40</td>
+ <td>970</td>
+ <td>0x2e</td>
+ <td>46</td>
+ </tr>
+ <tr>
+ <td>726</td>
+ <td>0x30</td>
+ <td>48</td>
+ <td>7000</td>
+ <td>0x70</td>
+ <td>113</td>
+ </tr>
+ <tr>
+ <td>735</td>
+ <td>0x04</td>
+ <td>4</td>
+ <td>R71</td>
+ <td>0x1A</td>
+ <td>26</td>
+ </tr>
+ <tr>
+ <td>746</td>
+ <td>0x66</td>
+ <td>102</td>
+ <td>R72</td>
+ <td>0x32</td>
+ <td>50</td>
+ </tr>
+ <tr>
+ <td>751</td>
+ <td>0x1c</td>
+ <td>28</td>
+ <td>R75</td>
+ <td>0x5a</td>
+ <td>90</td>
+ </tr>
+ <tr>
+ <td>756PROII</td>
+ <td>0x64</td>
+ <td>100</td>
+ <td>R7000</td>
+ <td>0x08</td>
+ <td>8</td>
+ </tr>
+ <tr>
+ <td>761</td>
+ <td>0x1e</td>
+ <td>30</td>
+ <td>R7100</td>
+ <td>0x34</td>
+ <td>52</td>
+ </tr>
+ <tr>
+ <td>765</td>
+ <td>0x2c</td>
+ <td>44</td>
+ <td>R8500</td>
+ <td>0x4a</td>
+ <td>74</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>R9000</td>
+ <td>0x2a</td>
+ <td>42</td>
+ </tr>
+</table>
+<h4 id="setup">Setup and Debugging Aids</h4>
+<p>The audio drivers include extensive setup and debugging support to help hook up the audio signals and monitor the driver operations. The documentation page for each driver describes the various messages that can be produced either in real time or written to the <tt>clockstats</tt> file for later analysis. Of particular help in verifying signal connections and compatibility is a provision to monitor the signal via headphones or speaker.</p>
+<p>Connecting radios and IRIG devices to the computer and verifying correct
+ configuration is somewhat of a black art. The signals have to be connected
+ to the correct ports and the signal level maintained within tolerances. Some
+ radios have recorder outputs which produce a microphone-level signal not affected
+ by the volume control. These signals can be connected to the microphone port
+ on the computer. If the radio does not have a recorder output, connect the
+ headphone or speaker output to the line-in port and adjust the volume control
+ so the driver indicates comfortably above the minimum specified and the AGC
+ level somewhere in the middle of the range 0-255. IRIG signals are usually
+ much larger than radio outputs, usually in the range to several volts and
+ may even overload the line-in port. In such cases the signal is designed to
+ drive a cable terminated with a 50-ohm resistor, which results in a level
+ the line-in port can handle..</p>
+<p>It is very easy to underdriven or overdrive the audio codec, in which case
+ the drivers will not synchronize to the signal. The drivers use <tt>fudge
+ flag2</tt> to enable audio monitoring of the input signal. This is useful
+ during setup to confirm the signal is actually reaching the audio
+ codec and generally free of noise and interference. Note that the monitor
+ volume must be set before the driver is started.</p>
+<p>The drivers write a synthesized timecode to the <tt>clockstats</tt> file each time the clock is set or verified and at other times if verbose monitoring is enabled. The format includes several fixed-length fields defining the UTC time to the millisecond, together with additional variable-length fields specific to each driver. The data include the intervals since the clock was last set or verified, the audio gain and various state variables and counters specific to each driver.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/authentic.html b/html/authentic.html
new file mode 100644
index 0000000..ecfb466
--- /dev/null
+++ b/html/authentic.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Authentication Support</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+<style type="text/css">
+<!--
+<style1 {
+color: #FF0000;
+ font-weight: bold;
+}
+.style1 {color: #FF0000}
+-->
+</style>
+</head>
+<body>
+<h3>Authentication Support</h3>
+<img src="pic/alice44.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>Our resident cryptographer; now you see him, now you don't.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->1-Dec-2012 04:44<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/authopt.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#auth">Introduction</a></li>
+ <li class="inline"><a href="#symm">Symmetric Key Cryptography</a></li>
+ <li class="inline"><a href="#windows">Microsoft Windows Authentication</a></li>
+ <li class="inline"><a href="#pub">Public Key Cryptography</a></li>
+</ul>
+<hr>
+<h4 id="auth">Introduction</h4>
+<p>This page describes the various cryptographic authentication provisions in NTPv4. Authentication support allows the NTP client to verify that servers are in fact known and trusted and not intruders intending accidentally or intentionally to masquerade as a legitimate server. A detailed discussion of the NTP multi-layer security model and vulnerability analysis is in the white paper <a href="http://www.eecis.udel.edu/~mills/security.html">NTP Security Analysis</a>.</p>
+<p> The NTPv3 specification (RFC-1305) defined an authentication scheme properly described as <em>symmetric key cryptography</em>. It used the Data Encryption Standard (DES) algorithm operating in cipher-block chaining (CBC) mode. Subsequently, this algorithm was replaced by the RSA Message Digest 5 (MD5) algorithm commonly called keyed-MD5. Either algorithm computes a message digest or one-way hash which can be used to verify the client has the same message digest as the server. The MD5 message digest algorithm is included in the distribution, so without further cryptographic support, the distribution can be freely exported.</p>
+<p>If the OpenSSL cryptographic library is installed prior to building the distribution, all message digest algorithms included in the library may be used, including SHA and SHA1. However, if conformance to FIPS 140-2 is required, only a limited subset of these algorithms can be used. This library is available from <a href="http://www.openssl.org">http://www.openssl.org</a> and can be installed using the procedures outlined in the <a href="build.html">Building and Installing the Distribution</a> page. Once installed, the configure and build process automatically detects the library and links the library routines
+required.</p>
+<p>In addition to the symmetric key algorithms, this distribution includes support for the Autokey public key algorithms and protocol specified in RFC-5906 &quot;Network Time Protocol Version 4: Autokey Specification&quot;. This support is available only if the OpenSSL library has been installed and the <tt>--enable-autokey</tt> option is used when the distribution is built.</p>
+<p> Public key cryptography is generally considered more secure than symmetric key cryptography, since the security is based on private and public values which are generated by each participant and where the private value is never revealed. Autokey uses X.509 public certificates, which can be produced by commercial services, the OpenSSL application program, or the <a href="keygen.html"><tt>ntp-keygen</tt></a> utility program in the NTP software distribution.</p>
+<p>Note that according to US law, NTP binaries including OpenSSL library components, including the OpenSSL library itself, cannot be exported outside the US without license from the US Department of Commerce. Builders outside the US are advised to obtain the OpenSSL library directly from OpenSSL, which is outside the US, and build outside the US.</p>
+<p>Authentication is configured separately for each association using the <tt>key</tt> or <tt>autokey</tt> option of the <tt>server</tt> configuration command, as described in the <a href="confopt.html">Server Options</a> page. The <a href="keygen.html">ntp-keygen</a> page describes the files required for the various authentication schemes. Further details are in the briefings, papers and reports at the NTP project page linked from <a href="http://www.ntp.org">www.ntp.org</a>.</p>
+<p>By default, the client sends non-authenticated packets and the server responds with non-authenticated packets. If the client sends authenticated packets, the server responds with authenticated packets if correct, or a crypto-NAK packet if not.. In the case of unsolicited packets which might consume significant resources, such as broadcast or symmetric mode packets, , authentication is required, unless overridden by a <tt>disable auth</tt> command. In the current climate of targeted broadcast or &quot;letterbomb&quot; attacks, defeating this requirement would be decidedly dangerous. In any case, the <tt>notrust </tt>flag, described on the <a href="authopt.html">Access Control Options</a> page, can be used to disable access to all but correctly authenticated clients..</p>
+<h4 id="symm">Symmetric Key Cryptography</h4>
+<p>The original NTPv3 specification (RFC-1305), as well as the current NTPv4 specification (RFC-5905), allows any one of possibly 65,534 message digest keys (excluding zero), each distinguished by a 32-bit key ID, to authenticate an association. The servers and clients involved must agree on the key ID, key type and key to authenticate NTP packets.</p>
+<p>The message digest is a cryptographic hash computed by an algorithm such as MD5 or SHA. When authentication is specified, a message authentication code (MAC) is appended to the NTP packet header. The MAC consists of a 32-bit key identifier (key ID) followed by a 128- or 160-bit message digest. The algorithm computes the digest as the hash of a 128- or 160- bit message digest key concatenated with the NTP packet header fields with the exception of the MAC. On transmit, the message digest is computed and inserted in the MAC. On receive, the message digest is computed and compared with the MAC. The packet is accepted only if the two MACs are identical. If a discrepancy is found by the client, the client ignores the packet, but raises an alarm. If this happens at the server, the server returns a special message called a <em>crypto-NAK</em>. Since the crypto-NAK is protected by the loopback test, an intruder cannot disrupt the protocol by sending a bogus crypto-NAK.</p>
+<p>Keys and related information are specified in a keys file, which must be distributed and stored using secure means beyond the scope of the NTP protocol itself. Besides the keys used for ordinary NTP associations, additional keys can be used as passwords for the <tt><a href="ntpq.html">ntpq</a></tt> and <tt><a href="ntpdc.html">ntpdc</a></tt> utility programs. Ordinarily, the <tt>ntp.keys</tt> file is generated by the <tt><a href="keygen.html">ntp-keygen</a></tt> program, but it can be constructed and edited using an ordinary text editor.</p>
+<p> Each line of the keys file consists of three fields: a key ID in the range 1 to 65,534, inclusive, a key type, and a message digest key consisting of a printable ASCII string less than 40 characters, or a 40-character hex digit string. If the OpenSSL library is installed, the key type can be any message digest algorithm supported by the library. If the OpenSSL library is not installed, the only permitted key type is MD5.</p>
+<div align="center">
+ <p><img src="pic/sx5.gif" alt="gif"></p>
+ <p>Figure 1. Typical Symmetric Key File</p>
+</div>
+<p>Figure 1 shows a typical keys file used by the reference implementation when the OpenSSL library is installed. In this figure, for key IDs in he range 1-10, the key is interpreted as a printable ASCII string. For key IDs in the range 11-20, the key is a 40-character hex digit string. The key is truncated or zero-filled internally to either 128 or 160 bits, depending on the key type. The line can be edited later or new lines can be added to change any field. The key can be change to a password, such as <tt>2late4Me</tt> for key ID 10. Note that two or more keys files can be combined in any order as long as the key IDs are distinct.</p>
+<p>When <tt>ntpd</tt> is started, it reads the keys file specified by the <tt>keys</tt> command and installs the keys in the key cache. However, individual keys must be activated with the <tt>trustedkey</tt> configuration command before use. This allows, for instance, the installation of possibly several batches of keys and then activating a key remotely using <tt>ntpq</tt> or <tt>ntpdc</tt>. The <tt>requestkey</tt> command selects the key ID used as the password for the <tt>ntpdc</tt> utility, while the <tt>controlkey</tt> command selects the key ID used as the password for the <tt>ntpq</tt> utility.</p>
+<h4 id="windows">Microsoft Windows Authentication</h4>
+<p>In addition to the above means, <tt>ntpd</tt> now supports Microsoft Windows MS-SNTP authentication using Active Directory services. This support was contributed by the Samba Team and is still in development. It is enabled using the <tt>mssntp</tt> flag of the <tt>restrict</tt> command described on the <a href="accopt.html#restrict">Access Control Options</a> page. <span class="style1">Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.</span></p>
+<h4 id="pub">Public Key Cryptography</h4>
+<p>See the <a href="autokey.html">Autokey Public-Key Authentication</a> page.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/authopt.html b/html/authopt.html
new file mode 100644
index 0000000..9504deb
--- /dev/null
+++ b/html/authopt.html
@@ -0,0 +1,95 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Authentication Commands and Options</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+<style type="text/css">
+.style1 {
+ color: #FF0000;
+ font-weight: bold;
+}
+</style>
+</head>
+<body>
+<h3>Authentication Commands and Options</h3>
+<img src="pic/alice44.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>Our resident cryptographer; now you see him, now you don't.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->15-Oct-2011 01:00<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/authopt.txt"></script>
+<hr>
+<h4>Commands and Options</h4>
+<p>Unless noted otherwise, further information about these commands is on the <a href="authentic.html">Authentication Support</a> page.</p>
+<dl>
+ <dt id=automax><tt>automax [<i>logsec</i>]</tt></dt>
+ <dd>Specifies the interval between regenerations of the session key list used with the Autokey protocol, as a power of 2 in seconds. Note that the size of the key list for each association depends on this interval and the current poll interval. The default interval is 12 (about 1.1 hr). For poll intervals above the specified interval, a session key list with a single entry will be regenerated for every message sent. See the <a href="autokey.html">Autokey Public Key Authentication</a> page for further information.</dd>
+ <dt id="controlkey"><tt>controlkey <i>keyid</i></tt></dt>
+ <dd>Specifies the key ID for the <a
+ href="ntpq.html"><tt>ntpq</tt></a> utility, which uses the
+ standard protocol defined in RFC-1305. The <tt><i>keyid</i></tt> argument is the key ID for a <a href="#trustedkey">trusted
+ key</a>, where the value can be in the range 1 to 65534,
+ inclusive.</dd>
+ <dt id="crypto"><tt>crypto [digest</tt> <em><tt>digest</tt></em><tt>]</tt> <tt>[host <i>name</i>] [ident <i>name</i>] [pw <i>password</i>] [randfile <i>file</i>]</tt></dt>
+ <dd>This command activates the Autokey public key cryptography
+ and loads the required host keys and certificate. If one or more files
+ are unspecified, the default names are used. Unless
+ the complete path and name of the file are specified, the location of a file
+ is relative to the keys directory specified in the <tt>keysdir</tt> configuration
+ command with default <tt>/usr/local/etc</tt>. See the <a href="autokey.html">Autokey Public Key Authentication</a> page for further information. Following are the options.</dd>
+ <dd>
+ <dl>
+ <dt><tt>digest</tt> <em><tt>digest</tt></em></dt>
+ <dd>&nbsp;</dd>
+ <dd>Specify the message digest algorithm, with default MD5. If the OpenSSL library
+ is installed, <tt><i>digest</i></tt> can be be any message digest algorithm supported
+ by the library. The current selections are: <tt>MD2</tt>, <tt>MD4</tt>, <tt>MD5,</tt> <tt>MDC2</tt>, <tt>RIPEMD160</tt>, <tt>SHA</tt> and <tt>SHA1</tt>. All
+ participants in an Autokey subnet must use the same algorithm. The Autokey message digest algorithm is separate and distinct from the symmetric
+ key message digest algorithm. Note: If compliance with FIPS 140-2 is required,
+ the algorithm must be ether <tt>SHA</tt> or <tt>SHA1</tt>.</dd>
+ <dt><tt>host <i>name</i></tt></dt>
+ <dd>Specify the cryptographic media names for the host, sign and certificate files. If this option is not specified, the default name is the string returned by the Unix <tt>gethostname()</tt> routine.</dd>
+ <dd><span class="style1">Note: In the latest Autokey version, this option has no effect other than to change the cryptographic media file names.</span></dd>
+ <dt><tt>ident <i>group</i></tt></dt>
+ <dd>Specify the cryptographic media names for the identity scheme files. If this option is not specified, the default name is the string returned by the Unix <tt>gethostname()</tt> routine.</dd>
+ <dd><span class="style1">Note: In the latest Autokey version, this option has no effect other than to change the cryptographic media file names.</span></dd>
+ <dt><tt>pw <i>password</i></tt></dt>
+ <dd>Specifies the password to decrypt files previously encrypted by the <tt>ntp-keygen</tt> program with the <tt>-p</tt> option. If this option is not specified, the default password is the string returned by the Unix <tt>gethostname()</tt> routine. </dd>
+ <dt><tt>randfile <i>file</i></tt></dt>
+ <dd>Specifies the location of the random seed file used by the OpenSSL library. The defaults are described on the <a href="keygen.html"><tt>ntp-keygen</tt> page</a>.</dd>
+ </dl>
+ </dd>
+ <dt id="ident"><tt>ident <i>group</i></tt></dt>
+ <dd>Specifies the group name for ephemeral associations mobilized by broadcast and symmetric passive modes. See the <a href="autokey.html">Autokey Public-Key Authentication</a> page for further information.</dd>
+ <dt id="keys"><tt>keys <i>path</i></tt></dt>
+ <dd>Specifies the complete directory path for the key file containing the key IDs, key types and keys used by <tt>ntpd</tt>, <tt>ntpq</tt> and <tt>ntpdc</tt> when operating with symmetric key cryptography. The format of the keyfile is described on the <a href="keygen.html"><tt>ntp-keygen</tt> page</a>. This is the same operation as the <tt>-k</tt> command line option. Note that the directory path for Autokey cryptographic media is specified by the <tt>keysdir</tt> command.</dd>
+ <dt id="keysdir"><tt>keysdir <i>path</i></tt></dt>
+ <dd>Specifies the complete directory path for the Autokey cryptographic keys, parameters and certificates. The default is <tt>/usr/local/etc/</tt>. Note that the path for the symmetric keys file is specified by the <tt>keys</tt> command.</dd>
+ <dt id="requestkey"><tt>requestkey <i>keyid</i></tt></dt>
+ <dd>Specifies the key ID for the <a href="ntpdc.html"><tt>ntpdc</tt></a> utility program, which
+ uses a proprietary protocol specific to this implementation of <tt>ntpd</tt>. The <tt><i>keyid</i></tt> argument is a key ID
+ for a <a href="#trustedkey">trusted key</a>, in the range 1 to
+ 65534, inclusive.</dd>
+ <dt id="revoke"><tt>revoke [<i>logsec</i>]</tt></dt>
+ <dd>Specifies the interval between re-randomization of certain cryptographic values used by the Autokey scheme, as a power of 2 in seconds, with default 17 (36 hr). See the <a href="autokey.html">Autokey Public-Key Authentication</a> page for further information.</dd>
+ <dt id="trustedkey"><tt>trustedkey [<i>keyid</i> | (<i>lowid</i> ... <i>highid</i>)] [...]</tt></dt>
+ <dd>Specifies the key ID(s) which are trusted for the purposes of
+ authenticating peers with symmetric key cryptography. Key IDs
+ used to authenticate <tt>ntpq</tt> and <tt>ntpdc</tt> operations
+ must be listed here and additionally be enabled with <a href="#controlkey">controlkey</a> and/or <a href="#requestkey">requestkey</a>. The authentication
+ procedure for time transfer requires that both the local and
+ remote NTP servers employ the same key ID and secret for this
+ purpose, although different keys IDs may be used with different
+ servers. Ranges of trusted key IDs may be specified: <tt>trustedkey (1 ... 19) 1000 (100 ... 199)</tt> enables the
+ lowest 120 key IDs which start with the digit 1. The spaces
+ surrounding the ellipsis are required when specifying a range.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/autokey.html b/html/autokey.html
new file mode 100644
index 0000000..ba220e6
--- /dev/null
+++ b/html/autokey.html
@@ -0,0 +1,215 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Autokey Public-Key Authentication</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+<style type="text/css">
+<!--
+.style1 {
+ color: #FF0000
+}
+-->
+</style>
+</head>
+<body>
+<h3>Autokey Public-Key Authentication</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->3-Oct-2011 21:51<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">Introduction</a></li>
+ <li class="inline"><a href="#subnet">Autokey Subnets</a></li>
+ <li class="inline"><a href="#names">Subnet Group Names's</a></li>
+ <li class="inline"><a href="#secure">Secure Groups</a></li>
+ <li class="inline"><a href="#cfg">Configuration - Authentication Schemes</a></li>
+ <li class="inline"><a href="#scfg">Configuration - Identity Schemes</a></li>
+ <li class="inline"><a href="#ident">Identity Schemes and Cryptotypes</a></li>
+ <li class="inline"><a href="#files">Files</a></li>
+</ul>
+<hr>
+<h4 id="intro">Introduction</h4>
+<p>This distribution includes support for the Autokey public key algorithms and protocol specified in RFC-5906 &quot;Network Time Protocol Version 4: Autokey Specification&quot;. This support is available only if the OpenSSL library has been installed and the <tt>--enable-autokey</tt> option is specified when the distribution is built.</p>
+<p> Public key cryptography is generally considered more secure than symmetric key cryptography. Symmetric key cryptography is based on a shared secret key which must be distributed by secure means to all participants. Public key cryptography is based on a private secret key known only to the originator and a public key known to all participants. A recipient can verify the originator has the correct private key using the public key and any of several digital signature algorithms.</p>
+<p>The Autokey Version 2 protocol described on the <a href="http://www.eecis.udel.edu/%7emills/proto.html">Autokey Protocol</a> page verifies packet integrity using message digest algorithms, such as MD5 or SHA, and verifies the source using digital signature schemes, such as RSA or DSA. As used in Autokey, message digests are exceptionally difficult to cryptanalyze, as the keys are used only once.</p>
+<p> Optional identity schemes described on the <a href="http://www.eecis.udel.edu/~mills/ident.html">Autokey Identity Schemes</a> page are based on cryptographic challenge/response exchanges. Optional identity schemes provide strong security against masquerade and most forms of clogging attacks. These schemes are exceptionally difficult to cryptanalyze, as the challenge/response exchange data are used only once. They are described along with an executive summary, current status, briefing slides and reading list on the <a href="http://www.eecis.udel.edu/~mills/autokey.html">Autonomous Authentication</a> page.</p>
+<p>Autokey authenticates individual packets using cookies bound to the IP source and destination addresses. The cookies must have the same IP addresses at both the server and client. For this reason operation with network address translation schemes is not possible. This reflects the intended robust security model where government and corporate NTP servers and clients are operated outside firewall perimeters.</p>
+<p>Autokey is designed to authenticate servers to clients, not the other way around as in SSH. An Autokey server can support an authentication scheme such as the Trusted Certificate (TC) scheme described in RFC 5906, while a client is free to choose between the various options. It is important to understand that these provisions are optional and that selection of which option is at the discretion of the client. If the client does not require authentication, it is free to ignore it, even if some other client of the same server elects to participate in either symmetric key or public key cryptography.</p>
+<p> Autokey uses industry standard X.509 public certificates, which can be produced by commercial services, utility programs in the OpenSSL software library, and the <a href="keygen.html"><tt>ntp-keygen</tt></a> utility program in the NTP software distribution. A certificate includes the subject name of the client, the issuer name of the server, the public key of the client and the time period over which the the public and private keys are valid. All Autokey hosts have a self-signed certificate with the Autokey name as both the subject and issuer. During the protocol, additional certificates are produced with the Autokey host name as subject and the host that signs the certificate as issuer.</p>
+<p>There are two timeouts associated with the Autokey scheme. The <em>key list timeout</em> is set by the <tt>automax</tt> command, which specifies the interval between generating new key lists by the client or server. The default timeout of about 1.1 hr is appropriate for the majority of configurations and ordinarily should not be changed. The <em>revoke timeout</em> is set by the <tt>revoke</tt> command, which specifies the interval between generating new server private values. It is intended to reduce the vulnerability to cryptanalysis; however, new values require the server to encrypt each client cookie separately. The default timeout of about 36 hr is appropriate for most servers, but might be too short for national time servers.</p>
+<h4 id="subnet">Autokey Subnets</h4>
+<p> An Autokey subnet consists of a collection of hosts configured as an acyclic, directed tree with roots one or more trusted hosts (THs) operating at the lowest stratum of the subnet. Note that the requirement that the NTP subnet be acyclic means that, if two hosts are configured with each other in symmetric modes, each must be a TH. The THs are synchronized directly or indirectly to national time services via trusted means, such as radio, satellite or telephone modem, or one or more trusted agents (TAs) of a parent subnet. NTP subnets can be nested, with the THs of a child subnet configured for one or more TAs of a parent subnet. The TAs can serve one or more child subnets, each with its own security policy and set of THs.</p>
+<p>A certificate trail is a sequence of certificates, each signed by a host one step closer to the THs and terminating at the self-signed certificate of a TH. The requirement that the subnet be acyclic means certificate trails can never loop. NTP servers operate as certificate authorities (CAs) to sign certificates provided by their clients. The CAs include the TAs of the parent subnet and those subnet servers with dependent clients.</p>
+<p> In order for the signature to succeed, the client certificate valid period must begin within the valid period of the server certificate. If the server period begins later than the client period, the client certificate has expired; if the client period begins later than the server period, the server certificate has expired.</p>
+<p>The Autokey protocol runs for each association separately, During the protocol, the client recursively obtains the certificates on the trail to a TH, saving each in a cache ordered from most recent to oldest. If an expired certificate is found, it is invalidated and marked for later replacement. As the client certificate itself is not involved in the certificate trail, it can only be declared valid or expired when the server signs it. </p>
+<p>The certificates derived from each association are combined in the cache with duplicates suppressed. If it happens that two different associations contribute certificates to the cache, a certificate on the trail from one association could expire before any on another trail. In this case the remaining trails will survive until the expired certificate is replaced. Once saved in the cache, a certificate remains valid until it expires or is replaced by a new one.</p>
+<p> It is important to note that the certificate trail is validated only at startup when an association is mobilized. Once validated in this way, the server remains valid until it is demobilized, even if certificates on the trail to the THs expire. While the certificate trail authenticates each host on the trail to the THs, it does not validate the time values themselves. Ultimately, this is determined by the NTP on-wire protocol.</p>
+<p>Example</p>
+<div align="center"><img src="pic/flt8.gif" alt="gif">
+ <p>Figure 1. Example Configuration</p>
+</div>
+<p>Figure 1 shows an example configuration with three NTP subnets, Alice, Helen and Carol. Alice and Helen are parent groups for Carol with TA C belonging to Alice and TA S belonging to Helen. Hosts A and B are THs of Alice, host R is the TH of Helen and host X is the TH of Carol. Assume that all associations are client/server, child subnet TH X has two mobilized associations, one to Alice TA host C and the other to Carol TA host S. While not shown in the figure, Alice hosts A and B could configure symmetric mode associations between them for redundancy and backup.</p>
+<p>Note that host D certificate trail is D&rarr;C&rarr;A or D&rarr;C&rarr;B, depending on the particular order the trails are built. Host Y certificate trail is only Y&rarr;X, since X is a TH. Host X has two certificate trails X&rarr;C&rarr;A or X&rarr;C&rarr;B, and X&rarr;S&rarr;R.</p>
+<h4 id="names">Subnet Group Names</h4>
+<p>In some configurations where more than one subnet shares an Ethernet or when multiple subnets exist in a manycast or pool configuration, it is useful to isolate one subnet from another. In Autokey this can be done using group names. An Autokey host name is specified by the <tt>-s</tt><tt><em> host</em>@<em>group</em></tt> option of the <tt>ntp-keygen</tt> program, where <em><tt>host</tt></em> is the host name and <em><tt>group</tt></em> is the group name. If <em><tt>host</tt></em> is omitted, the name defaults to the string returned by the Unix <tt>gethostname()</tt> routine, ordinarily the DNS name of the host. Thus, for host <tt>beauregard.udel.edu</tt> the option <tt>-s @red</tt> specifies the Autokey host name <tt>beauegard.udel.edu@red</tt>.</p>
+<p>A subnet host with a given group name will discard ASSOC packets from all subnets with a different group name. This effectively disables the Autokey protocol without additional packet overhead. For instance, one or more manycast or pool servers will not respond to ASSOC packets from subnets with difference group names. Groups sharing an Ethernet will be filtered in the same way.</p>
+<p>However, as shown in Figure 1, there are configurations where a TH of one group needs to listen to a TA of a different group. This is accomplished using the <tt>ident <em>group</em></tt> option of the <tt>crypto</tt> command and/or the <tt>ident <em>group</em></tt> option of the <tt>server</tt> command. The former case applies to all hosts sharing a common broadcast, manycast or symmetric passive modes, while the latter case applies to each individual client/server or symmetric active mode association. In either case the host listens to the specified group name in addition to the group name specified in the <tt>-s</tt> option of the <tt>ntp-keygen</tt> program.</p>
+<h4 id="secure">Secure Groups</h4>
+<p>NTP security groups are an extension of the NTP subnets described in the previous section. They include in addition to certificate trails one or another identity schemes described on the <a href="http://www.eecis.udel.edu/~mills/ident.html">Autokey Identity Schemes</a> page. NTP secure groups are used to define cryptographic compartments and security
+ hierarchies. The identity scheme insures that the server is authentic and not victim of masquerade by an intruder acting as a middleman.</p>
+<p> An NTP secure group is an NTP subnet configured as an acyclic tree rooted on the THs. The THs are at the lowest stratum of the secure group. They run an identity exchange with the TAs of parent subnets All group hosts construct an unbroken certificate trail from each host, possibly via intermediate hosts, and ending at a TH of that group. The TH verifies authenticity with the TA of the parent subnet using an identity exchange.</p>
+<div align="center"><img src="pic/flt9.gif" alt="gif">
+ <p>Figure 2. Identify Scheme</p>
+</div>
+<p>The identity exchange is run between a TA acting as a server and a TH acting as a client. As shown in Figure 2, the identity exchange involves a challenge-response protocol where a client generates a nonce and sends it to the server. The server performs a mathematical operation involving a second nonce and the secret group key, and sends the result along with a hash to the client. The client performs a another mathematical operation and verifies the result with the hash.</p>
+<p> Since each exchange involves two nonces, even after repeated observations of many exchanges, an intruder cannot learn the secret group key. It is this quality that allows the secret group key to persist long after the longest period of certificate validity. In the Schnorr (Identify Friend or Foe - IFF) scheme, the secret group key is not divulged to the clients, so they cannot conspire to prove identity to other hosts.</p>
+<p>As described on the <a href="http://www.eecis.udel.edu/~mills/ident.html">Autokey Identity Schemes</a> page, there are five identity schemes, three of which - IFF, GQ and MV - require identity files specific to each scheme. There are two types of files for each scheme, an encrypted server keys file and a nonencrypted client keys file, also called the parameters file, which usually contains a subset of the keys file.</p>
+<p> Figure 2 shows how keys and parameters are distributed to servers and clients. A TA constructs the encrypted keys file and the nonencrypted parameters file. Hosts with no dependent clients can retrieve client parameter files from an
+ archive or web page. The <tt>ntp-keygen</tt> program can export parameter files using the <tt>-e</tt> option. By convention, the file name is the name of the secure group and must match the <tt>ident</tt> option of the <tt>crypto</tt> command or the <tt>ident</tt> option of the <tt>server</tt> command.</p>
+<p> When more than one TH Is involved in the secure group, it is convenient for the TAs and THs to use the same encrypted key files. To do this, one of the parent TAs includes the <tt>-i <em>group</em></tt> option on the <tt>ntp-keygen</tt> command line, where <em><tt>group</tt></em> is the name of the child secure group. The <tt>ntp-keygen</tt> program can export server keys files using the <tt>-q</tt> option and a chosen remote password. The files are installed on the TAs and then renamed using the name given as the first line in the file, but without the filestamp. The secure group name must match the <tt>ident</tt> option for all TAs.</p>
+<dl>
+ <dd><span class="style1">In the latest Autokey version, the host name and group name are independent of each other and the <tt>host</tt> option of the <tt>crypto</tt> command is deprecated. When compatibility with older versions is required, specify the same name for both the <tt>-s</tt> and <tt>-i</tt> options.</span></dd>
+</dl>
+<p>In special circumstances the Autokey message digest algorithm can be changed using the <tt>digest</tt> option of the <tt>crypto</tt> command. The digest algorithm is separate and distinct from the symmetric
+ key message digest algorithm. If compliance with FIPS 140-2 is required,
+ the algorithm must be ether <tt>SHA</tt> or <tt>SHA1</tt>. The Autokey message digest algorithm must be the same for all participants in the NTP subnet.</p>
+<p>Example</p>
+<p>Returning to the example of Figure 1, Alice, Helen and Carol run run the Trusted Certificate (TC) scheme, internally, as the environment is secure and without threat from external attack, in particular a middleman masquerade. However, TH X of Carol is vulnerable to masquerade on the links between X and C and between X and S. Therefore, both parent subnet TAs C and S run an identity exchange with child subnet TH X. Both have the same encrypted keys file and X the common parameters file.</p>
+<h4 id="cfg">Configuration - Authentication Schemes</h4>
+<p>Autokey has an intimidating number of options, most of which are not necessary in typical scenarios. However, the Trusted Certificate (TC) scheme is recommended for national NTP time services, such as those operated by NIST and USNO. Configuration for TC is very simple.</p>
+<p> Referring to Figure 1, for each TH, A, B, R and X, as root:</p>
+<p><tt># cd /usr/local/etc<br>
+ # ntp-keygen -T</tt></p>
+<p>and for the other hosts the same commands without the <tt>-T</tt> option. This generates an RSA private/public host key file and a self-signed certificate file for the RSA digital signature algorithm with the MD5 message digest algorithm. For the THs a trusted certificate is generated; for the others a nontreusted certificate is generated. Include in the <tt>ntp.conf</tt> configuration file for all hosts other than the primary servers, A, B and R, something like</p>
+<p><tt> # server <em>host</em> autokey<br>
+ # crypto<br>
+ # driftfile /etc/ntp.drift</tt></p>
+<p>where <em><tt>host</tt></em> is the selected server name as shown in the figure. Servers A, B and R are configured for local reference clocks or trusted remoter servers as required.</p>
+<p>In the above configuration examples, the default host name is the string returned by the Unix <tt>gethostname()</tt> routine, ordinarily the DNS name of the host. This name is used as the subject and issuer names on the certificate, as well as the default password for the encrypted keys file. The host name can be changed using the <tt>-s</tt> option of the <tt>ntp-keygen</tt> program. The default password can be changed using the <tt>-p</tt> option of the <tt>ntp-keygen</tt> program and the <tt>pw</tt> option of the <tt>crypto</tt> configuration command.</p>
+<p>Group names can be added to this configuration by including the <tt>-s <em>host</em>@<em>group</em></tt> option with the <tt>ntp-keygen</tt> program. For the purpose of illustration, the <tt><em>host</em></tt> string is empty, signifying the default host name. For example, @<tt>yellow</tt> can be used for the Alice group, @<tt>orange</tt> for the Helen group and @<tt>blue</tt> for the Carol group. In addition, for TH X the <tt>ident yellow</tt> option should be added to the <tt>server</tt> command for the Alice group and the <tt>ident orange</tt> option should be added to the <tt>server</tt> command for the Helen group.</p>
+<h4 id="scfg">Configuration - Identity Schemes</h4>
+<p> The example in this section uses the IFF identity scheme, but others, including GQ and MV, can be used as well. It's best to start with a functioning TC configuration and add commands as necessary. We start with the subnets of Figure 1 configured as in the previous section. Recall that the parent subnet TA for Alice is C and for Helen is S. Each of the TAs generates an encrypted server keys file and nonencrypted client parameters file for the IFF identity scheme using the <tt>-I</tt> option of the <tt>ntp-keygen</tt> program. Note the TAs are not necessarily trusted hosts, so may not need the <tt>-T</tt> option.</p>
+<p>The nonencrypted client parameters can be exported using the command</p>
+<p><tt>ntp-keygen -e &gt;<i>file</i></tt>,</p>
+<p>where the <tt>-e</tt> option redirects the client parameters to <em><tt>file</tt></em> via the standard output stream for a mail application or stored locally for later distribution to one or more THs. In a similar fashion the encrypted keys file can be exported using the command</p>
+<p><tt>ntp-keygen -q <em>passw2</em> &gt;<i>file</i></tt>,</p>
+<p>where <em><tt>passwd2</tt></em> is the read password for another TA. We won't need this file here.</p>
+<p> While the file names used for the exported files are arbitrary, it is common practice to use the name given as the first line in the file with the filestamp suppressed. Thus, the nonencryted parameters file from each TA is copied to X with this name.</p>
+<p>To complete the configuration, the TH includes the client parameters file name in the <tt>ident</tt> option of the the <tt>server</tt> command for the TA association</p>
+<p><tt>server 1.2.3.4 ident <em>group</em>,</tt></p>
+<p> where <em><tt>group</tt></em> is the file name given above. </p>
+<h4 id="ident">Identity Schemes and Cryptotypes</h4>
+<p>A specific combination of authentication and identity schemes is called a <em>cryptotype</em>, which applies to clients and servers separately. A group can be configured using more than one cryptotype combination, although not all combinations are interoperable. Note however that some cryptotype combinations may successfully intemperate with each other, but may not represent good security practice. The server and client cryptotypes are defined by the the following codes.</p>
+<dl>
+ <dt>NONE</dt>
+ <dd>A client or server is type NONE if authentication is not available or not configured. Packets exchanged between client and server have no MAC.</dd>
+ <dt>AUTH</dt>
+ <dd>A client or server is type AUTH&nbsp;if the <tt>key</tt> option is specified with the <tt>server</tt> configuration command and the client and server keys are compatible. Packets exchanged between clients and servers have a MAC.</dd>
+ <dt>PC</dt>
+ <dd>A client or server is type PC if the <tt>autokey</tt> option is specified with the <tt>server</tt> configuration command and compatible host key and private certificate files are present. Packets exchanged between clients and servers have a MAC.</dd>
+ <dt>TC</dt>
+ <dd>A client or server is type TC if the <tt>autokey</tt> option is specified with the <tt>server</tt> configuration command and compatible host key and public certificate files are present. Packets exchanged between clients and servers have a MAC.</dd>
+ <dt>IDENT</dt>
+ <dd>A client or server is type IDENT if the <tt>autokey</tt> option is specified with the <tt>server</tt> configuration command and compatible host key, public certificate and identity scheme files are present. Packets exchanged between clients and servers have a MAC.</dd>
+</dl>
+<p>The compatible cryptotypes for clients and servers are listed in the following table.</p>
+<table width="100%" border="1" cellpadding="4">
+ <tr>
+ <td rowspan="2" align="center">Client</td>
+ <td colspan="5" align="center">Server</td>
+ </tr>
+ <tr>
+ <td align="center">NONE</td>
+ <td align="center">AUTH</td>
+ <td align="center">PC</td>
+ <td align="center">TC</td>
+ <td align="center">IDENT</td>
+ </tr>
+ <tr>
+ <td align="center">NONE</td>
+ <td align="center">yes</td>
+ <td align="center">yes*</td>
+ <td align="center">yes*</td>
+ <td align="center">yes*</td>
+ <td align="center">yes*</td>
+ </tr>
+ <tr>
+ <td align="center">AUTH</td>
+ <td align="center">no</td>
+ <td align="center">yes</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ </tr>
+ <tr>
+ <td align="center">PC</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ <td align="center">yes</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ </tr>
+ <tr>
+ <td align="center">TC</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ <td align="center">yes</td>
+ <td align="center">yes</td>
+ </tr>
+ <tr>
+ <td align="center">IDENT</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ <td align="center">no</td>
+ <td align="center">yes</td>
+ </tr>
+</table>
+<p>* These combinations are not valid if the restriction list includes the <tt>notrust</tt> option.</p>
+<h4 id="err">Error Codes</h4>
+<p>Errors can occur due to mismatched configurations, unexpected protocol restarts, expired certificates and unfriendly people. In most cases the protocol state machine recovers automatically by retransmission, timeout and restart, where necessary. Some errors are due to mismatched keys, digest schemes or identity schemes and must be corrected by installing the correct media and/or correcting the configuration file. One of the most common errors is expired certificates, which must be regenerated and signed at least once per year using the <a href="keygen.html"><tt>ntp-keygen</tt> - generate public and private keys</a> program.</p>
+<p>The following error codes are reported via the NTP control and monitoring protocol trap mechanism and to the <tt>cryptostats</tt> monitoring file if configured.</p>
+<dl>
+ <dt>101 bad field format or length</dt>
+ <dd>The packet has invalid version, length or format.</dd>
+ <dt>102 bad timestamp</dt>
+ <dd>The packet timestamp is the same or older than the most recent received. This could be due to a replay or a server clock time step.</dd>
+ <dt>103 bad filestamp</dt>
+ <dd>The packet filestamp is the same or older than the most recent received. This could be due to a replay or a key file generation error.</dd>
+ <dt>104 bad or missing public key</dt>
+ <dd>The public key is missing, has incorrect format or is an unsupported type.</dd>
+ <dt>105 unsupported digest type</dt>
+ <dd>The server requires an unsupported digest/signature scheme.</dd>
+ <dt>106 unsupported identity type</dt>
+ <dd>The client or server has requested an identity scheme the other does not support.</dd>
+ <dt>107 bad signature length</dt>
+ <dd>The signature length does not match the current public key.</dd>
+ <dt>108 signature not verified</dt>
+ <dd>The message fails the signature check. It could be bogus or signed by a different private key.</dd>
+ <dt>109 certificate not verified</dt>
+ <dd>The certificate is invalid or signed with the wrong key.</dd>
+ <dt>110 host certificate expired</dt>
+ <dd>The old server certificate has expired.</dd>
+ <dt>111 bad or missing cookie</dt>
+ <dd>The cookie is missing, corrupted or bogus.</dd>
+ <dt>112 bad or missing leapseconds table</dt>
+ <dd>The leapseconds table is missing, corrupted or bogus.</dd>
+ <dt>113 bad or missing certificate</dt>
+ <dd>The certificate is missing, corrupted or bogus.</dd>
+ <dt>114 bad or missing group key</dt>
+ <dd>The identity key is missing, corrupt or bogus.</dd>
+ <dt>115 protocol error</dt>
+ <dd>The protocol state machine has wedged due to unexpected restart.</dd>
+</dl>
+<h4 id="files">Files</h4>
+<p>See the <a href="keygen.html"><tt>ntp-keygen</tt></a> page. Note that provisions to load leap second values from the NIST files have been removed. These provisions are now available whether or not the OpenSSL library is available. However, the functions that can download these values from servers remains available.</p>
+<hr>
+<p>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</p>
+</body>
+</html>
diff --git a/html/bugs.html b/html/bugs.html
new file mode 100644
index 0000000..7be6a4c
--- /dev/null
+++ b/html/bugs.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>NTP Bug Reporting Procedures</title>
+<!-- Changed by: Harlan &, 23-Aug-2014 -->
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>NTP Bug Reporting Procedures</h3>
+<img src="pic/hornraba.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>The rabbit toots to make sure you read this.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->23-Aug-2014 05:32<!-- #EndDate -->
+UTC</p>
+.<br clear="left">
+<hr>
+<h4> Security Bug Reporting Procedures</h4>
+<p>If you find or suspect a security related program bug in this distribution, please send a report to <a href="mailto:security@ntp.org">security@ntp.org</a>. Please do not contact developers directly.</p>
+<h4>Non-Security Bug Reporting Procedures</h4>
+<p>If you find or suspect a non-security related program or documentation bug in this distribution, please send a report to the NTP Public Service Project Bug Tracking System (Bugzilla) at <a href="http://bugs.ntp.org/">http://bugs.ntp.org/</a>. Bugs reported this way are immediately forwarded to the developers. Please do not contact the developers directly.</p>
+<p>If you wish to send a report via electronic mail, please remember that your report will be held until one of our volunteers enters it in Bugzilla. The email address for these reports is <a href="mailto:bugs@ntp.org">bugs@ntp.org</a>. You will need to register at <a href="http://bugs.ntp.org/">http://bugs.ntp.org/</a> to participate directly in any e-mail discussion regarding your report. If you don't register and we have questions for you we won't be able to make progress on fixing your problem. Please directly register on and use our Bugzilla instance to report issues.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/build.html b/html/build.html
new file mode 100644
index 0000000..9683b29
--- /dev/null
+++ b/html/build.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=windows-1252">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Building and Installing the Distribution</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Building and Installing the Distribution</h3>
+<img src="pic/beaver.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>For putting out compiler fires.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Mar-2014 05:39<!-- #EndDate -->
+</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/install.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#build">Building and Installing the Distribution</a></li>
+ <li class="inline"><a href="#unix">Building and Installing for Unix</a></li>
+ <li class="inline"><a href="#win">Building and Installing for Windows</a></li>
+ <li class="inline"><a href="#conf">Configuration</a></li>
+ <li class="inline"><a href="#prob">If You Have Problems</a></li>
+ <li class="inline"><a href="#make">Additional <tt>make</tt> Commands</a></li>
+</ul>
+<hr>
+<h4 id="build">Building and Installing the Distribution</h4>
+<p>It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types <tt>./configure</tt>, <tt>make</tt> and <tt>install</tt> in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> pages.</p>
+<p>If available, the OpenSSL library from <a href="http://www.openssl.org">http://www.openssl.org</a> is used to support public key cryptography. The library must be built and installed prior to building NTP. The procedures for doing that are included in the OpenSSL documentation. The library is found during the normal NTP configure phase and the interface routines compiled automatically. Only the <tt>libcrypto.a</tt> library file and <tt>openssl</tt> header files are needed. If the library is not available or disabled, this step is not required.</p>
+<p>The <a href="config.html">Build Options</a> page describes a number of options that determine whether debug support is included, whether and which reference clock drivers are included and the locations of the executables and library files, if not the default. By default debugging options and all reference clock drivers are included.</p>
+<h4 id="unix">Building and Installing for Unix</h4>
+<p>This distribution uses common compilers and tools that come with most Unix distributions. Not all of these tools exist in the standard distribution of modern Unix versions (compilers are likely to be an add-on product). If this is the case, consider using the GNU tools and <tt>gcc</tt> compiler included as freeware in some systems. For a successful build, all of these tools should be accessible via the current path.</p>
+<p>The first thing to do is uncompress the distribution and extract the source tree. In the distribution base directory use the <tt>./configure </tt>command to perform an automatic configuration procedure. This command inspects the hardware and software environment and configures the build process accordingly. Use the <tt>make</tt> command to compile and link the distribution and the <tt>install</tt> command to install the executables by default in <tt>/usr/local/bin</tt>.</p>
+<p>If your site supports multiple architectures and uses NFS to share files, you can use a single source tree to build executables for multiple architectures. While running on a particular architecture, change to the base directory and create a subdirectory using a command like <tt>mkdir A.machine, </tt>which will create an architecture-specific directory, then change to this directory and mumble <tt>../configure</tt>. The remaining steps are the same whether building in the base directory or in the subdirectory.</p>
+<h4 id="win">Building and Installing for Windows</h4>
+<p>NTP supports Windows 2000 and later. See the <a href="hints/winnt.html">NTP 4.x for Windows NT</a> page for directions to compile the sources and install the executables. A precompiled executable is available.</p>
+<h4 id="conf">Configuration</h4>
+<p>You are now ready to configure the daemon. You will need to create a NTP configuration file by default in <tt>/etc/ntp.conf.</tt> Newbies should see the <a href="quick.html">Quick Start</a> page for orientation. Seasoned veterans can start with the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page and move on to the specific configuration option pages from there.</p>
+<h4 id="prob">If You Have Problems</h4>
+<p>If you have problems with your hardware and software environment (e.g. operating system-specific issues), browse the <a href="hints.html">Hints and Kinks</a> pages. For other problems a tutorial on debugging technique is in the <a href="debug.html">NTP Debugging Technique</a> page. A list of important system log messages is on the <a href="msyslog.html"><tt>ntpd</tt> System Log Messages</a> page.</p>
+<p>The first line of general assistance is the NTP web site <a href="http://www.ntp.org">www.ntp.org</a> and the helpful documents resident there. Requests for assistance of a general nature and of interest to other timekeepers should be sent to the NTP newsgroup comp.protocols.time.ntp.</p>
+<p>Users are invited to report bugs and offer suggestions via the <a href="bugs.html">NTP Bug Reporting Procedures</a> page.</p>
+<h4 id="make">Additional <tt>make</tt> commands</h4>
+<dl>
+ <dt><tt>make clean</tt></dt>
+ <dd>Cleans out object files, programs and temporary files.</dd>
+ <dt><tt>make distclean</tt></dt>
+ <dd>Does the work of <tt>clean</tt>, but cleans out all directories in preparation for a new distribution release.</dd>
+ <dt><tt>make dist</tt></dt>
+ <dd>Does the work of <tt>make distclean</tt>, but constructs compressed tar files for distribution. You must have GNU automake to perform this function.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/clock.html b/html/clock.html
new file mode 100644
index 0000000..32f3ed8
--- /dev/null
+++ b/html/clock.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Clock State Machine</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Clock State Machine</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->4-Aug-2011 23:40<!-- #EndDate -->
+ UTC</p>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">General Overview</a></li>
+ <li class="inline"><a href="#panic">Panic Threshold</a></li>
+ <li class="inline"><a href="#step">Step and Stepout Thresholds</a></li>
+ <li class="inline"><a href="#hold">Hold Timer</a></li>
+ <li class="inline"><a href="#inter">Operating Intervals</a></li>
+ <li class="inline"><a href="#state">State Transition Function</a></li>
+</ul>
+<hr>
+<h4 id="intro">General Overview</h4>
+<p>In the NTPv4 specification and reference implementation a state machine is used to manage the system clock under exceptional conditions, as when the daemon is first started or when encountering severe network congestion. This page describes the design and operation of the state machine in detail.</p>
+<p> The state machine is activated upon receipt of an update by the clock discipline algorithm. its primary purpose is to determines whether the clock is slewed or stepped and how the initial time and frequency are determined using three thresholds: <em>panic</em>, <em>step</em> and <em>stepout</em>, and one timer: <em>hold</em>.</p>
+<h4 id="panic">Panic Threshold</h4>
+<p>Most computers today incorporate a time-of-year (TOY) chip to maintain the time when the power is off. When the computer is restarted, the chip is used to initialize the operating system time. In case there is no TOY chip or the TOY&nbsp;time is different from NTP time by more than the panic threshold, the daemon <tt></tt> assumes something must be terribly wrong, so exits with a message to the system operator to set the time manually. With the <tt>-g</tt> option on the command line, the daemon sets the clock to NTP time at the first update, but exits if the offset exceeds the panic threshold at subsequent updates. The panic threshold default is 1000 s, but it can be changed with the <tt>panic</tt> option of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command.</p>
+<h4 id="step"> Step and Stepout Thresholds</h4>
+<p>Under ordinary conditions, the clock discipline gradually slews the clock to the correct time, so that the time is effectively continuous and never stepped forward or backward. If, due to extreme network congestion, an offset spike exceeds the step threshold, by default 128 ms, the spike is discarded. However, if offset spikes greater than the step threshold persist for an interval more than the stepout threshold, by default 300 s, the system clock is stepped to the correct time.</p>
+<p> In practice, the need for a step has been extremely rare and almost always the result of a hardware failure or operator error. The step threshold and stepout threshold can be changed using the <tt>step</tt> and <tt>stepout</tt> options of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command, respectively. If the step threshold is set to zero, the step function is entirely disabled and the clock is always slewed. The daemon sets the step threshold to 600 s using the <tt>-x</tt> option on the command line. If the <tt>-g</tt> option is used or the step threshold is set greater than 0.5 s, the precision time kernel support is disabled.</p>
+<p>Historically, the most important application of the step function was when a leap second was inserted in the Coordinated Universal Time (UTC) timescale and the kernel precision time support was not available. This also happened with older reference clocks that indicated an impending leap second, but the radio itself did not respond until it resynchronized some minutes later. Further details are on the <a href="leap.html">Leap Second Processing</a> page.</p>
+<p>In some applications the clock can never be set backward, even it accidentally set forward a week by some evil means. The issues should be carefully considered before using these options. The slew rate is fixed at 500 parts-per-million (PPM) by the Unix kernel. As a result, the clock can take 33 minutes to amortize each second the clock is outside the acceptable range. During this interval the clock will not be consistent with any other network clock and the system cannot be used for distributed applications that require correctly synchronized network time.</p>
+<h4 id="hold">Hold Timer</h4>
+<p>When the daemon is started after a considerable downtime, it could be the TOY chip clock has drifted significantly from NTP time. This can cause a transient at system startup. In the past, this has produced a phase transient and resulted in a frequency surge that could take some time, even hours, to subside. When the highest accuracy is required, some means is necessary to manage the startup process so that the the clock is quickly set correctly and the frequency is undisturbed. The hold timer is used to suppress frequency adjustments during the training and startup intervals described below. At the beginning of the interval the hold timer is set to the stepout threshold and decrements at one second intervals until reaching zero. However, the hold timer is forced to zero if the residual clock offset is less than 0.5 ms. When nonzero, the discipline algorithm uses a small time constant (equivalent to a poll exponent of 2), but does not adjust the frequency. Assuming that the frequency has been set to within 1 PPM, either from the frequency file or by the training interval described later, the clock is set to within 0.5 ms in less than 300 s.</p>
+<h4 id="inter">Operating Intervals</h4>
+<p>The state machine operates in one of four nonoverlapping intervals.</p>
+<dl>
+ <dt>Training interval</dt>
+ <dd>This interval is used at startup when the frequency file is nor present at startup. It begins when the first update is received by the discipline algorithm and ends when an update is received following the stepout threshold. The clock phase is steered to the offset presented at the beginning of the interval, but without affecting the frequency. During the interval further updates are ignored. At the end of the interval the frequency is calculated as the phase change during the interval divided by the length of the interval. This generally results in a frequency error less than 0.5 PPM. Note that, if the intrinsic oscillator frequency error is large, the offset will in general have significant error. This is corrected during the subsequent startup interval.</dd>
+ <dt>Startup interval</dt>
+ <dd> This interval is used at startup to amortize the residual offset while not affecting the frequency. If the frequency file is present, it begins when the first update is received by the discipline. If not, it begins after the training interval. It ends when the hold timer decrements to zero or when the residual offset falls below 0.5 ms.</dd>
+ <dt>Step interval</dt>
+ <dd>This interval is used as a spike blanker during periods when the offsets exceed the step threshold. The interval continues as long as offsets are received that are greater than the step threshold, but ends when either an offset is received less than the step threshold or until the time since the last valid update exceeds the stepout threshold.</dd>
+ <dt>Sync Interval</dt>
+ <dd> This interval is implicit; that is, it is used when none of the above intervals are used.</dd>
+</dl>
+<h4 id="state">State Transition Function</h4>
+<p>The state machine consists of five states. An event is created when an update is received by the discipline algorithm. Depending on the state and the the offset magnitude, the machine performs some actions and transitions to the same or another state. Following is a short description of the states.</p>
+<dl>
+ <dt>FSET - The frequency file is present</dt>
+ <dd> Load the frequency file, initialize the hold timer and continue in SYNC state.</dd>
+ <dt>NSET - The frequency file is not present</dt>
+ <dd>Initialize the hold timer and continue in FREQ state.</dd>
+ <dt>FREQ - Frequency training state</dt>
+ <dd>Disable the clock discipline until the time since the last update exceeds the stepout threshold. When this happens, calculate the frequency, initialize the hold counter and transition to SYNC state.</dd>
+ <dt>SPIK - Spike state</dt>
+ <dd>A update greater than the step threshold has occurred. Ignore the update and continue in this state as long as updates greater than the step threshold occur. If a valid update is received, continue in SYNC state. When the time since the last valid update was received exceeds the stepout threshold, step the system clock and continue in SYNC state. </dd>
+ <dt>SYNC - Ordinary clock discipline state</dt>
+ <dd>Discipline the system clock time and frequency using the hybrid phase/frequency feedback loop. However, do not discipline the frequency if the hold timer is nonzero.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/clockopt.html b/html/clockopt.html
new file mode 100644
index 0000000..0fe4c24
--- /dev/null
+++ b/html/clockopt.html
@@ -0,0 +1,59 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Reference Clock Commands and Options</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Reference Clock Commands and Options</h3>
+<img src="pic/stack1a.jpg" alt="gif" align="left">Master Time Facility at the <a href="http://www.eecis.udel.edu/%7emills/lab.html">UDel Internet Research Laboratory</a>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:55<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/refclock.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/audio.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/clockopt.txt"></script>
+<hr>
+<h4 id="addrs">Reference Clock Adddresses</h4>
+<p>Unless noted otherwise, further information about these ccommands is on the <a href="refclock.html">Reference Clock Support</a> page.</p><p>Reference clocks are identified by a syntactically correct but invalid IP address, in order to distinguish them from ordinary NTP peers. These addresses are of the form 127.127.<em>t</em>.<em>u</em>, where <em>t</em> is an integer denoting the clock type and <em>u</em> indicates the unit number in the range 0-3. While it may seem overkill, it is in fact sometimes useful to configure multiple reference clocks of the same type, in which case the unit numbers must be unique.</p>
+<h4 id="cmd"> Commands and Options</h4>
+<dl>
+ <dt id="server"><tt>server 127.127.<i>t.u</i> [prefer] [mode <i>int</i>] [minpoll <i>int</i>] [maxpoll <i>int</i>]</tt></dt>
+ <dd>This command can be used to configure reference clocks in special ways. The options are interpreted as follows:
+ <dl>
+ <dt><tt>prefer</tt></dt>
+ <dd>Marks the reference clock as preferred. All other things being equal, this host will be chosen for synchronization among a set of correctly operating hosts. See the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page for further information.</dd>
+ <dt><tt>mode <i>int</i></tt></dt>
+ <dd>Specifies a mode number which is interpreted in a device-specific fashion. For instance, it selects a dialing protocol in the ACTS driver and a device subtype in the <tt>parse</tt> drivers.</dd>
+ <dt><tt>minpoll <i>int</i></tt><br>
+ <tt>maxpoll <i>int</i></tt></dt>
+ <dd>These options specify the minimum and maximum polling interval for reference clock messages in log<sub>2</sub> seconds. For most directly connected reference clocks, both <tt>minpoll</tt> and <tt>maxpoll</tt> default to 6 (64 s). For modem reference clocks, <tt>minpoll</tt> is ordinarily set to 10 (about 17 m) and <tt>maxpoll</tt> to 15 (about 9 h). The allowable range is 4 (16 s) to 17 (36 h) inclusive.</dd>
+ </dl>
+ </dd>
+ <dt id="fudge"><tt>fudge 127.127.<i>t.u</i> [time1 <i>sec</i>] [time2 <i>sec</i>]
+ [stratum <i>int</i>] [refid <i>string</i>] [flag1 0|1]
+ [flag2 0|1] [flag3 0|1] [flag4 0|1]</tt></dt>
+ <dd>This command can be used to configure reference clocks in special ways. It must immediately follow the <tt>server</tt> command which configures the driver. Note that the same capability is possible at run time using the <tt><a href="ntpdc.html">ntpdc</a></tt> program. The options are interpreted as follows:
+ <dl>
+ <dt><tt>time1 <i>sec</i></tt></dt>
+ <dd>Specifies a constant to be added to the time offset produced by the driver, a fixed-point decimal number in seconds. This is used as a calibration constant to adjust the nominal time offset of a particular clock to agree with an external standard, such as a precision PPS signal. It also provides a way to correct a systematic error or bias due to serial port or operating system latencies, different cable lengths or receiver internal delay. The specified offset is in addition to the propagation delay provided by other means, such as internal DIPswitches. Where a calibration for an individual system and driver is available, an approximate correction is noted in the driver documentation pages.</dd>
+ <dd>Note: in order to facilitate calibration when more than one radio clock or PPS signal is supported, a special calibration feature is available. It takes the form of an argument to the <tt>enable</tt> command described in the <a href="miscopt.html">Miscellaneous Options</a> page and operates as described in the <a href="refclock.html">Reference Clock Support</a> page.</dd>
+ <dt><tt>time2 <i>secs</i></tt></dt>
+ <dd>Specifies a fixed-point decimal number in seconds, which is interpreted in a driver-dependent way. See the descriptions of specific drivers in the <a href="refclock.html">Reference Clock Support</a> page.</dd>
+ <dt><tt>stratum <i>int</i></tt></dt>
+ <dd>Specifies the stratum number assigned to the driver in the range 0 to 15, inclusive. This number overrides the default stratum number ordinarily assigned by the driver itself, usually zero.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies an ASCII string of from one to four characters which defines the reference identifier used by the driver. This string overrides the default identifier ordinarily assigned by the driver itself.</dd>
+ <dt><tt>flag1 flag2 flag3 flag4</tt></dt>
+ <dd>These four flags are used for customizing the clock driver. The interpretation of these values, and whether they are used at all, is a function of the particular driver. However, by convention <tt>flag4</tt> is used to enable recording monitoring data to the <tt>clockstats</tt> file configured with the <tt>filegen</tt> command. Additional information on the <tt>filegen</tt> command is on the <a href="monopt.html">Monitoring Options</a> page.</dd>
+ </dl>
+ </dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/cluster.html b/html/cluster.html
new file mode 100644
index 0000000..3132a46
--- /dev/null
+++ b/html/cluster.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Clock Cluster Algorithm</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<em></em>
+<h3>Clock Cluster Algorithm</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->15-Nov-2012 06:02<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>The clock cluster algorithm processes the truechimers produced by the clock select algorithm to produce a list of <em>survivors</em>. These survivors are used by the mitigation algorithms to discipline the system clock. The cluster algorithm operates in a series of rounds, where at each round the truechimer furthest from the offset centroid is pruned from the population. The rounds are continued until a specified termination condition is met. This page discusses the algorithm in detail.</p>
+<p>First, the truechimer associations are saved on an unordered list with each candidate entry identified with index <em>i</em> (<em>i </em>= 1, ..., <em>n)</em>, where <em>n</em> is the number of candidates. Let &theta;(<em>i</em>), be the offset and &lambda;(<em>i</em>) be the root distance of the <em>i</em>th entry. Recall that the root distance is equal to the root dispersion plus half the root delay. For the <em>i</em>th candidate on the list, a statistic called the <em>select jitter</em> relative to the <em>i</em>th candidate is calculated as follows. Let</p>
+<div align="center">
+ <p><em>d<sub>i</sub></em>(<em>j</em>) = |&theta;(<em>j</em>) &minus; &theta;(<em>i</em>)| &lambda;(<em>i</em>),</p>
+</div>
+<p> where &theta;(<em>i)</em> is the peer offset of the <em>i</em>th entry and &theta;(<em>j</em>) is the peer offset of the <em>j</em>th entry, both produced by the clock filter algorithm. The metric used by the cluster algorithm is the select jitter &phi;<sub>S</sub>(<em>i</em>) computed as the root mean square (RMS) of the <em>d<sub>i</sub></em>(<em>j</em>) as <em>j</em> ranges from 1 to <em>n</em>. <em> </em>For the purpose of notation in the example to follow, let &phi;<sub>R</sub>(<em>i</em>) be the peer jitter computed by the clock filter algorithm for the <em>i</em>th candidate.</p>
+<p>The object at each round is to prune the entry with the largest metric until the termination condition is met. Note that the select jitter must be recomputed at each round, but the peer jitter does not change. At each round the remaining entries on the list represent the survivors of that round. If the candidate to be pruned is preemptable and the number of candidates is greater than the <em>maxclock threshold</em>, the association is demobilized. This is useful in the schemes described on the <a href="discover.html">Automatic Server Discovery Schemes</a> page. The maxclock threshold default is 10, but it can be changed using the <tt>maxclock</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command. Further pruning is subject to the following termination conditions, but no associations will be automatically demobilized.</p>
+<p>The termination condition has two parts. First, if the number of survivors is not greater than the<em> </em><em>minclock threshold</em> set by the <tt>minclock</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command, the pruning process terminates. The<tt> minclock</tt> default is 3, but can be changed to fit special conditions, as described on the <a href="prefer.html">Mitigation Rules and the prefer Keyword</a> page.</p>
+<div align="center"><img src="pic/flt7.gif" alt="gif">
+ <p>Figure 1. Cluster Algorithm</p>
+</div>
+<p>The second termination condition is more intricate. Figure 1 shows a round where a candidate of (a) is pruned to yield the candidates of (b). Let &phi;<sub><em>max</em></sub> be the maximum select jitter and &phi;<sub><em>min</em></sub> be the minimum peer jitter over all candidates on the list. In (a), candidate 1 has the highest select jitter, so &phi;<sub><em>max</em></sub> = &phi;<sub>S</sub>(1). Candidate 4 has the lowest peer jitter, so &phi;<sub><em>min</em></sub> = &phi;<sub>R</sub>(4). Since &phi;<sub><em>max</em></sub> &gt; &phi;<sub><em>min</em></sub>, select jitter dominates peer jitter,the algorithm prunes candidate 1.&#13; In (b), &phi;<sub><em>max</em></sub> = &phi;<sub>S</sub>(3) and &phi;<sub><em>min </em></sub>=&phi;<sub>R</sub>(4). Since &phi;<sub><em>max</em></sub> &lt; &phi;<sub><em>min</em></sub>, pruning additional candidates does not reduce select jitter, the algorithm terminates with candidates 2, 3 and 4 as survivors.</p>
+<p>The survivor list is passed on to the the mitigation algorithms, which combine the survivors, select a system peer, and compute the system statistics passed on to dependent clients. Note the use of root distance &lambda; as a weight factor at each round in the clock cluster algorithm. This is to favor the survivors with the lowest root distance and thus the smallest maximum error.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/comdex.html b/html/comdex.html
new file mode 100644
index 0000000..0d632f1
--- /dev/null
+++ b/html/comdex.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Command Index</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Command Index</h3>
+<img src="pic/alice38.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carrol</a>
+<p>The Mad Hatter says &quot;Bring it on&quot;.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/accopt.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/authopt.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/confopt.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/monopt.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/clockopt.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/miscopt.txt"></script>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+<!-- <hr> -->
+<!-- <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> -->
+</body>
+</html>
diff --git a/html/config.html b/html/config.html
new file mode 100644
index 0000000..ae68c89
--- /dev/null
+++ b/html/config.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=windows-1252">
+ <meta name="generator" content="HTML Tidy, see www.w3.org">
+ <title>Build Options</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Build Options</h3>
+ <img src="pic/pogo3a.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+ <p>Gnu autoconfigure tools are in the backpack.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 04:59<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+ <hr>
+ <p>Most modern software distributions include an autoconfigure utility which
+ customizes the build and install configuration according to the specific
+ hardware, operating system and file system conventions. For NTP this
+ utility is called <tt>configure</tt>, which is run before building and installing
+ the program components. For most installations no additional actions
+ are required other than running <tt>configure</tt> with no options.
+ However, it is possible to customize the build and install configuration
+ through the use of <tt>configure</tt> options.</p>
+ <p>The available options, together with
+ a concise description, can be displayed by running <tt>configure</tt> with
+ the <tt>--help</tt> option. Various options can be used to reduce the memory
+ footprint, adjust the scheduling priority, enable or disable debugging
+ support or reference clock driver support. The options can be used
+ to specify where to install the program components or where to find
+ various libraries if they are not in the default place.</p>
+<hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/confopt.html b/html/confopt.html
new file mode 100644
index 0000000..8c8ae37
--- /dev/null
+++ b/html/confopt.html
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Server Commands and Options</title>
+<!-- Changed by: Harlan &, 31-Jan-2014 -->
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Server Commands and Options</h3>
+<img src="pic/boom3a.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>,
+Walt Kelly</a>
+<p>The chicken is getting configuration advice.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:01<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/confopt.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#address">Server and Peer Addresses</a></li>
+ <li class="inline"><a href="#command">Server Commands</a></li>
+ <li class="inline"><a href="#option">Server Command Options</a></li>
+</ul>
+<hr>
+<h4 id="address">Server and Peer Addresses</h4>
+<p>Following is a description of the server configuration commands in NTPv4. There are two classes of commands, configuration commands that configure an association with a remote server, peer or reference clock, and auxiliary commands that specify environment variables that control various related operations. </p>
+<p>The various modes described on the <a href="assoc.html">Association Management</a> page are determined by the command keyword and the DNS name or IP address. Addresses are classed by type as (s) a remote server or peer (IPv4 class A, B and C or IPv6), (b) the IPv4 broadcast address of a local interface, (m) a multicast address (IPv4 class D or IPv6), or (r) a reference clock address (127.127.x.x). For type m addresses the IANA has assigned the multicast group address IPv4 224.0.1.1 and IPv6 ff05::101 (site local) exclusively to NTP, but other nonconflicting addresses can be used. </p>
+<p>If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected,
+ support for the IPv6 address family is generated in addition to the default IPv4 address family. IPv6 addresses can be identified by the presence of colons &quot;:&quot; in the address field. IPv6 addresses can be used almost everywhere where IPv4 addresses can be used, with the exception of reference clock addresses, which are always IPv4. Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p>
+<h4 id="command">Server Commands</h4>
+<p>Unless noted otherwise, further information about these commands is on the <a href="assoc.html">Association Management</a> page.</p><dl>
+ <dt id="server"><tt>server <i>address</i> [options ...]</tt><br>
+ <tt>peer <i>address</i> [options ...]</tt><br>
+ <tt>broadcast <i>address</i> [options ...]</tt><br>
+ <tt>manycastclient <i>address</i> [options ...]</tt><br>
+ <tt>pool <i>address</i> [options ...]</tt><br>
+ <tt>unpeer [<i>address</i> | <i>associd</i>]</tt></dt>
+ <dd>These commands specify the remote server name or address to be used and the mode in which to operate. The <i>address</i> can be either a DNS name or a IPv4 or IPv6 address in standard notation. In general, multiple commands of each type can be used for different server and peer addresses or multicast groups.
+ <dl>
+ <dt><tt>server</tt></dt>
+ <dd>For type s and r addresses (only), this command mobilizes a persistent client mode association with the specified remote server or local reference clock. If the <tt>preempt</tt> flag is specified, a preemptable client mode association is mobilized instead.</dd>
+ <dt id="peer"><tt>peer</tt></dt>
+ <dd>For type s addresses (only), this command mobilizes a persistent symmetric-active mode association with the specified remote peer.</dd>
+ <dt id="broadcast"><tt>broadcast</tt></dt>
+ <dd>For type b and m addressees (only), this command mobilizes a broadcast or multicast server mode association. Note that type b messages go only to the interface specified, but type m messages go to all interfaces.</dd>
+ <dt id="manycastclient"><tt>manycastclient</tt></dt>
+ <dd>For type m addresses (only), this command mobilizes a preemptable manycast client mode association for the multicast group address specified. In this mode the address must match the address specified on the <tt>manycastserver</tt> command of one or more designated manycast servers. Additional information about this command is on the <a href="discover.html#mcst">Automatic Server Discovery</a> page.</dd>
+ <dt id="pool"><tt>pool</tt></dt>
+ <dd>For type s addresses (only) this command mobilizes a preemptable pool client mode association for the DNS name specified. The DNS name must resolve to one or more IPv4 or IPv6 addresses. Additional information about this command is on the <a href="discover.html#pool">Automatic Server Discovery</a> page. The <a href="http://www.pool.ntp.org/">www.pool.ntp.org</a> page describes a compatible pool of public NTP servers.</dd>
+ <dt id="unpeer"><tt>unpeer</tt></dt>
+ <dd>This command removes a previously configured association. An address or association ID can be used to identify the association. Either an IP address or DNS name can be used. This command is most useful when supplied via <tt><a href="ntpq.html">ntpq</a></tt> runtime configuration commands <tt>:config</tt> and <tt>config-from-file</tt>.</dd>
+ </dl></dd>
+</dl>
+<h4 id="option">Server Command Options</h4>
+<dl>
+ <dt><tt>autokey</tt></dt>
+ <dd>Send and receive packets authenticated by the Autokey scheme described
+ on the <a href="autokey.html">Autokey Public Key Authentication</a> page. This option is mutually exclusive with the <tt>key</tt> option.</dd>
+ <dt id="burst"><tt>burst</tt></dt>
+ <dd>When the server is reachable, send a burst of packets instead of the usual one. This option is valid only with the <tt>server</tt> command and type s addresses. It is a recommended option when the <tt>maxpoll</tt> option is greater than 10 (1024 s). Additional information about this option is on the <a href="poll.html">Poll Program</a> page.</dd>
+ <dt><tt>iburst</tt></dt>
+ <dd>When the server is unreachable, send a burst of packets instead of the usual one. This option is valid only with the <tt>server</tt> command and type <tt>s</tt> addresses. It is a recommended option with this command. Additional information about this option is on the <a href="poll.html">Poll Program</a> page.</dd>
+ <dt><tt>ident</tt> <em><tt>group</tt></em></dt>
+ <dd>Specify the group name for the association. See the <a href="autokey.html">Autokey Public-Key Authentication</a> page for further information.</dd>
+ <dt><tt>key</tt> <i><tt>key</tt></i></dt>
+ <dd>Send and receive packets authenticated by the symmetric key scheme described in the <a href="authentic.html">Authentication Support</a> page. The <i><tt>key</tt></i> specifies the key identifier with values from 1 to 65534, inclusive. This option is mutually exclusive with the <tt>autokey</tt> option.</dd> <dt><tt>minpoll <i>minpoll<br>
+ </i></tt><tt>maxpoll <i>maxpoll</i></tt></dt>
+ <dd>These options specify the minimum and maximum poll intervals for NTP messages, in seconds as a power of two. The maximum poll interval defaults to 10 (1024 s), but can be increased by the <tt>maxpoll</tt> option to an upper limit of 17 (36 hr). The minimum poll interval defaults to 6 (64 s), but can be decreased by the <tt>minpoll</tt> option to a lower limit of 3 (8 s). Additional information about this option is on the <a href="poll.html">Poll Program</a> page.</dd>
+ <dt><tt>mode <i>option</i></tt></dt>
+ <dd>Pass the <tt><i>option</i></tt> to a reference clock driver, where <tt><i>option</i></tt> is an integer in the range from 0 to 255, inclusive. This option is valid only with type r addresses.</dd>
+ <dt><tt>noselect</tt></dt>
+ <dd>Marks the server or peer to be ignored by the selection algorithm as unreachable, but visible to the monitoring program. This option is valid only with the <tt>server</tt> and <tt>peer</tt> commands.</dd>
+ <dt><tt>preempt</tt></dt>
+ <dd>Specifies the association as preemptable rather than the default persistent. This option is ignored with the <tt>broadcast</tt> command and is most useful with the <tt>manycastclient</tt> and <tt>pool</tt> commands.</dd>
+ <dt><tt>prefer</tt></dt>
+ <dd>Mark the server as preferred. All other things being equal, this host will be chosen for synchronization among a set of correctly operating hosts. See the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page for further information. This option is valid only with the <tt>server</tt> and <tt>peer</tt> commands.</dd>
+ <dt><tt>true</tt></dt>
+ <dd>Mark the association to assume truechimer status; that is, always survive the selection and clustering algorithms. This option can be used with any association, but is most useful for reference clocks with large jitter on the serial port and precision pulse-per-second (PPS) signals. Caution: this option defeats the algorithms designed to cast out falsetickers and can allow these sources to set the system clock. This option is valid only with the <tt>server</tt> and <tt>peer</tt> commands.</dd>
+ <dt><tt>ttl <i>ttl</i></tt></dt>
+ <dd>This option specifies the time-to-live <i><tt>ttl</tt></i> for the <tt>broadcast</tt> command and the maximum <i><tt>ttl</tt></i> for the expanding ring search used by the <tt>manycastclient</tt> command. Selection of the proper value, which defaults to 127, is something of a black art and should be coordinated with the network administrator. This option is invalid with type r addresses.</dd>
+ <dt><tt>version <i>version</i></tt></dt>
+ <dd>Specifies the version number to be used for
+outgoing NTP packets. Versions 1-4 are the choices, with version 4 the default.</dd>
+ <dt><tt>xleave</tt></dt>
+ <dd>Operate in interleaved mode (symmetric and broadcast modes only). Further information is on the <a href="xleave.html">NTP Interleaved Modes</a> page.</dd>
+</dl>
+<h4 id="aux">Auxiliary Commands</h4>
+<dl>
+ <dt id="broadcastclient"><tt>broadcastclient</tt></dt>
+ <dd>Enable reception of broadcast server messages to any local interface (type b address). Ordinarily, upon receiving a broadcast message for the first time, the broadcast client measures the nominal server propagation delay using a brief client/server exchange, after which it continues in listen-only mode. If a nonzero value is specified in the <tt>broadcastdelay</tt> command, the value becomes the delay and the volley is not executed. Note: the <tt>novolley</tt> option has been deprecated for future enhancements. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page. Note that the volley is required with public key authentication in order to run the Autokey protocol..</dd>
+ <dt id="manycastserver"><tt>manycastserver <i>address</i> [...]</tt></dt>
+ <dd>Enable reception of manycast client messages (type m) to the multicasts group address(es) (type m) specified. At least one address is required. Note that, in order to avoid accidental or malicious disruption, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page.</dd>
+ <dt id="multicastclient"><tt>multicastclient <i>address</i> [...]</tt></dt>
+ <dd>Enable reception of multicast server messages to the multicast group address(es) (type m) specified. Upon receiving a message for the first time, the multicast client measures the nominal server propagation delay using a brief client/server exchange with the server, then enters the broadcast client mode, in which it synchronizes to succeeding multicast messages. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/copyright.html b/html/copyright.html
new file mode 100644
index 0000000..08272d4
--- /dev/null
+++ b/html/copyright.html
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Copyright Notice</title>
+<!-- Changed by: Harlan Stenn, 10-Mar-2014 -->
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Copyright Notice</h3>
+<img src="pic/sheepb.jpg" alt="jpg" align="left"> "Clone me," says Dolly sheepishly.
+<p>Last update:
+ <!-- #BeginDate format:En2m -->9-Aug-2014 07:56<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+</p>
+<hr>
+<p>The following copyright notice applies to all files collectively called the Network Time Protocol Version 4 Distribution. Unless specifically declared otherwise in an individual file, this notice applies as if the text was explicitly included in the file.</p>
+<pre>
+***********************************************************************
+* *
+* Copyright (c) University of Delaware 1992-2014 *
+* *
+* Permission to use, copy, modify, and distribute this software and *
+* its documentation for any purpose with or without fee is hereby *
+* granted, provided that the above copyright notice appears in all *
+* copies and that both the copyright notice and this permission *
+* notice appear in supporting documentation, and that the name *
+* University of Delaware not be used in advertising or publicity *
+* pertaining to distribution of the software without specific, *
+* written prior permission. The University of Delaware makes no *
+* representations about the suitability this software for any *
+* purpose. It is provided &quot;as is&quot; without express or implied *
+* warranty. *
+* *
+***********************************************************************
+</pre>
+<p>The following individuals contributed in part to the Network Time Protocol Distribution Version 4 and are acknowledged as authors of this work.</p>
+<ol>
+ <li><a href="mailto:%20takao_abe@xurb.jp">Takao Abe &lt;takao_abe@xurb.jp&gt;</a> Clock driver for JJY receivers</li>
+ <li><a href="mailto:%20mark_andrews@isc.org">Mark Andrews &lt;mark_andrews@isc.org&gt;</a> Leitch atomic clock controller</li>
+ <li><a href="mailto:%20altmeier@atlsoft.de">Bernd Altmeier &lt;altmeier@atlsoft.de&gt;</a> hopf Elektronik serial line and PCI-bus devices</li>
+ <li><a href="mailto:%20vbais@mailman1.intel.co">Viraj Bais &lt;vbais@mailman1.intel.com&gt;</a> and <a href="mailto:%20kirkwood@striderfm.intel.com">Clayton Kirkwood &lt;kirkwood@striderfm.intel.com&gt;</a> port to WindowsNT 3.5</li>
+ <li><a href="mailto:%20michael.barone@lmco.com">Michael Barone &lt;michael,barone@lmco.com&gt;</a> GPSVME fixes</li>
+ <li><a href="mailto:%20karl@owl.HQ.ileaf.com">Karl Berry &lt;karl@owl.HQ.ileaf.com&gt;</a> syslog to file option</li>
+ <li><a href="mailto:%20greg.brackley@bigfoot.com">Greg Brackley &lt;greg.brackley@bigfoot.com&gt;</a> Major rework of WINNT port. Clean up recvbuf and iosignal code into separate modules.</li>
+ <li><a href="mailto:%20Marc.Brett@westgeo.com">Marc Brett &lt;Marc.Brett@westgeo.com&gt;</a> Magnavox GPS clock driver</li>
+ <li><a href="mailto:%20Piete.Brooks@cl.cam.ac.uk">Piete Brooks &lt;Piete.Brooks@cl.cam.ac.uk&gt;</a> MSF clock driver, Trimble PARSE support</li>
+ <li><a href="mailto:%20nelson@bolyard.me">Nelson B Bolyard &lt;nelson@bolyard.me&gt;</a> update and complete broadcast and crypto features in sntp</li>
+ <li><a href="mailto:%20Jean-Francois.Boudreault@viagenie.qc.ca">Jean-Francois Boudreault &lt;Jean-Francois.Boudreault@viagenie.qc.ca&gt;</a> IPv6 support</li>
+ <li><a href="mailto:%20reg@dwf.com">Reg Clemens &lt;reg@dwf.com&gt;</a> Oncore driver (Current maintainer)</li>
+ <li><a href="mailto:%20clift@ml.csiro.au">Steve Clift &lt;clift@ml.csiro.au&gt;</a> OMEGA clock driver</li>
+ <li><a href="mailto:%20casey@csc.co.za">Casey Crellin &lt;casey@csc.co.za&gt;</a> vxWorks (Tornado) port and help with target configuration</li>
+ <li><a href="mailto:%20Sven_Dietrich@trimble.COM">Sven Dietrich &lt;sven_dietrich@trimble.com&gt;</a> Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port.</li>
+ <li><a href="mailto:%20dundas@salt.jpl.nasa.gov">John A. Dundas III &lt;dundas@salt.jpl.nasa.gov&gt;</a> Apple A/UX port</li>
+ <li><a href="mailto:%20duwe@immd4.informatik.uni-erlangen.de">Torsten Duwe &lt;duwe@immd4.informatik.uni-erlangen.de&gt;</a> Linux port</li>
+ <li><a href="mailto:%20dennis@mrbill.canet.ca">Dennis Ferguson &lt;dennis@mrbill.canet.ca&gt;</a> foundation code for NTP Version 2 as specified in RFC-1119</li>
+ <li><a href="mailto:%20jhay@icomtek.csir.co.za">John Hay &lt;jhay@icomtek.csir.co.za&gt;</a> IPv6 support and testing</li>
+ <li><a href="mailto:%20davehart@davehart.com">Dave Hart &lt;davehart@davehart.com&gt;</a> General maintenance, Windows port interpolation rewrite</li>
+ <li><a href="mailto:%20neoclock4x@linum.com">Claas Hilbrecht &lt;neoclock4x@linum.com&gt;</a> NeoClock4X clock driver</li>
+ <li><a href="mailto:%20glenn@herald.usask.ca">Glenn Hollinger &lt;glenn@herald.usask.ca&gt;</a> GOES clock driver</li>
+ <li><a href="mailto:%20iglesias@uci.edu">Mike Iglesias &lt;iglesias@uci.edu&gt;</a> DEC Alpha port</li>
+ <li><a href="mailto:%20jagubox.gsfc.nasa.gov">Jim Jagielski &lt;jim@jagubox.gsfc.nasa.gov&gt;</a> A/UX port</li>
+ <li><a href="mailto:%20jbj@chatham.usdesign.com">Jeff Johnson &lt;jbj@chatham.usdesign.com&gt;</a> massive prototyping overhaul</li>
+ <li><a href="mailto:%20Hans.Lambermont@nl.origin-it.com">Hans Lambermont &lt;Hans.Lambermont@nl.origin-it.com&gt;</a> or <a href="mailto:H.Lambermont@chello.nl">&lt;H.Lambermont@chello.nl&gt;</a> ntpsweep</li>
+ <li><a href="mailto:%20phk@FreeBSD.ORG">Poul-Henning Kamp &lt;phk@FreeBSD.ORG&gt;</a> Oncore driver (Original author)</li>
+ <li><a href="http://www4.informatik.uni-erlangen.de/%7ekardel">Frank Kardel</a> <a href="mailto:%20kardel%20%28at%29%20ntp%20%28dot%29%20org">&lt;kardel (at) ntp (dot) org&gt;</a> PARSE &lt;GENERIC&gt; (driver 14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup, dynamic interface handling</li>
+ <li><a href="mailto:kuehn@ntp.org">Johannes Maximilian Kuehn &lt;kuehn@ntp.org&gt;</a> Rewrote <tt>sntp</tt> to comply with NTPv4 specification, <tt>ntpq saveconfig</tt></li>
+ <li><a href="mailto:%20jones@hermes.chpc.utexas.edu">William L. Jones &lt;jones@hermes.chpc.utexas.edu&gt;</a> RS/6000 AIX modifications, HPUX modifications</li>
+ <li><a href="mailto:%20dkatz@cisco.com">Dave Katz &lt;dkatz@cisco.com&gt;</a> RS/6000 AIX port</li>
+ <li><a href="mailto:%20leres@ee.lbl.gov">Craig Leres &lt;leres@ee.lbl.gov&gt;</a> 4.4BSD port, ppsclock, Magnavox GPS clock driver</li>
+ <li><a href="mailto:%20lindholm@ucs.ubc.ca">George Lindholm &lt;lindholm@ucs.ubc.ca&gt;</a> SunOS 5.1 port</li>
+ <li><a href="mailto:%20louie@ni.umd.edu">Louis A. Mamakos &lt;louie@ni.umd.edu&gt;</a> MD5-based authentication</li>
+ <li><a href="mailto:%20thorinn@diku.dk">Lars H. Mathiesen &lt;thorinn@diku.dk&gt;</a> adaptation of foundation code for Version 3 as specified in RFC-1305</li>
+ <li><a href="mailto:%20mayer@ntp.org">Danny Mayer &lt;mayer@ntp.org&gt;</a>Network I/O, Windows Port, Code Maintenance</li>
+ <li><a href="mailto:%20mills@udel.edu">David L. Mills &lt;mills@udel.edu&gt;</a> Version 4 foundation, precision kernel; clock drivers: 1, 3, 4, 6, 7, 11, 13, 18, 19, 22, 36</li>
+ <li><a href="mailto:%20moeller@gwdgv1.dnet.gwdg.de">Wolfgang Moeller &lt;moeller@gwdgv1.dnet.gwdg.de&gt;</a> VMS port</li>
+ <li><a href="mailto:%20mogul@pa.dec.com">Jeffrey Mogul &lt;mogul@pa.dec.com&gt;</a> ntptrace utility</li>
+ <li><a href="mailto:%20tmoore@fievel.daytonoh.ncr.com">Tom Moore &lt;tmoore@fievel.daytonoh.ncr.com&gt;</a> i386 svr4 port</li>
+ <li><a href="mailto:%20kamal@whence.com">Kamal A Mostafa &lt;kamal@whence.com&gt;</a> SCO OpenServer port</li>
+ <li><a href="mailto:%20derek@toybox.demon.co.uk">Derek Mulcahy &lt;derek@toybox.demon.co.uk&gt;</a> and <a href="mailto:%20d@hd.org">Damon Hart-Davis &lt;d@hd.org&gt;</a> ARCRON MSF clock driver</li>
+ <li><a href="mailto:%20neal@ntp.org">Rob Neal &lt;neal@ntp.org&gt;</a> Bancomm refclock and config/parse code maintenance</li>
+ <li><a href="mailto:%20Rainer.Pruy@informatik.uni-erlangen.de">Rainer Pruy &lt;Rainer.Pruy@informatik.uni-erlangen.de&gt;</a> monitoring/trap scripts, statistics file handling</li>
+ <li><a href="mailto:%20dirce@zk3.dec.com">Dirce Richards &lt;dirce@zk3.dec.com&gt;</a> Digital UNIX V4.0 port</li>
+ <li><a href="mailto:%20wsanchez@apple.com">Wilfredo S&aacute;nchez &lt;wsanchez@apple.com&gt;</a> added support for NetInfo</li>
+ <li><a href="mailto:%20mrapple@quack.kfu.com">Nick Sayer &lt;mrapple@quack.kfu.com&gt;</a> SunOS streams modules</li>
+ <li><a href="mailto:%20jack@innovativeinternet.com">Jack Sasportas &lt;jack@innovativeinternet.com&gt;</a> Saved a Lot of space on the stuff in the html/pic/ subdirectory</li>
+ <li><a href="mailto:%20schnitz@unipress.com">Ray Schnitzler &lt;schnitz@unipress.com&gt;</a> Unixware1 port</li>
+ <li><a href="mailto:%20shields@tembel.org">Michael Shields &lt;shields@tembel.org&gt;</a> USNO clock driver</li>
+ <li><a href="mailto:%20pebbles.jpl.nasa.gov">Jeff Steinman &lt;jss@pebbles.jpl.nasa.gov&gt;</a> Datum PTS clock driver</li>
+ <li><a href="mailto:%20harlan@pfcs.com">Harlan Stenn &lt;harlan@pfcs.com&gt;</a> GNU automake/autoconfigure makeover, various other bits (see the ChangeLog)</li>
+ <li><a href="mailto:%20ken@sdd.hp.com">Kenneth Stone &lt;ken@sdd.hp.com&gt;</a> HP-UX port</li>
+ <li><a href="mailto:%20ajit@ee.udel.edu">Ajit Thyagarajan &lt;ajit@ee.udel.edu&gt;</a>IP multicast/anycast support</li>
+ <li><a href="mailto:%20tsuruoka@nc.fukuoka-u.ac.jp">Tomoaki TSURUOKA &lt;tsuruoka@nc.fukuoka-u.ac.jp&gt;</a>TRAK clock driver</li>
+ <li><a href="mailto:%20brian.utterback@oracle.com">Brian Utterback &lt;brian.utterback@oracle.com&gt;</a> General codebase, Solaris issues</li>
+ <li><a href="mailto:%20loganaden@gmail.com">Loganaden Velvindron &lt;loganaden@gmail.com&gt;</a> Sandboxing (libseccomp) support</li>
+ <li><a href="mailto:%20vixie@vix.com">Paul A Vixie &lt;vixie@vix.com&gt;</a> TrueTime GPS driver, generic TrueTime clock driver</li>
+ <li><a href="mailto:%20Ulrich.Windl@rz.uni-regensburg.de">Ulrich Windl &lt;Ulrich.Windl@rz.uni-regensburg.de&gt;</a> corrected and validated HTML documents according to the HTML DTD</li>
+</ol>
+<hr>
+</body>
+</html>
diff --git a/html/debug.html b/html/debug.html
new file mode 100644
index 0000000..1a4981a
--- /dev/null
+++ b/html/debug.html
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>NTP Debugging Techniques</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>NTP Debugging Techniques</h3>
+<img src="pic/pogo.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>We make house calls and bring our own bugs.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->16-Jul-2014 08:38<!-- #EndDate -->
+ UTC</p>
+ <br clear="left">
+ <h4>More Help</h4>
+<script type="text/javascript" language="javascript" src="scripts/install.txt"></script>
+<hr>
+<h4>Initial Startup</h4>
+<p>This page discusses <tt>ntpd</tt> program monitoring and debugging techniques using the <a href="ntpq.html"><tt>ntpq</tt> - standard NTP query program</a>, either on the local server or from a remote machine. In special circumstances the <a href="ntpdc.html"><tt>ntpdc</tt> - special NTP query program</a>, can be useful, but its use is not covered here. The <tt>ntpq</tt> program implements the management functions specified in the NTP specification <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305c.ps">RFC-1305, Appendix A</a>. It is used to read and write the variables defined in the NTP Version 4 specification now navigating the standards process. In addition, the program can be used to send remote configuration commands to the server.</p>
+<p>The <tt>ntpd</tt> daemon can operate in two modes, depending on the presence of the <tt>-d</tt> command-line option. Without the option the daemon detaches from the controlling terminal and proceeds autonomously. With one or more <tt>-d</tt> options the daemon does not detach and generates special trace output useful for debugging. In general, interpretation of this output requires reference to the sources. However, a single <tt>-d</tt> does produce only mildly cryptic output and can be very useful in finding problems with configuration and network troubles.</p>
+<p>Some problems are immediately apparent when the daemon first starts running. The most common of these are the lack of a UDP port for NTP (123) in the Unix <tt>/etc/services</tt> file (or equivalent in some systems). <b>Note that NTP does not use TCP in any form. Also note that NTP requires port 123 for both source and destination ports.</b> These facts should be pointed out to firewall administrators.</p>
+<p>Other problems are apparent in the system log, which ordinarily shows the startup banner, some cryptic initialization data and the computed precision value. Event messages at startup and during regular operation are sent to the optional <tt>protostats</tt> monitor file, as described on the <a href="decode.html">Event Messages and Status Words</a> page. These and other error messages are sent to the system log, as described on the <a href="msyslog.html"><tt>ntpd</tt> System Log Messages</a> page. In real emergencies the daemon will sent a terminal error message to the system log and then cease operation.</p>
+<p>The next most common problem is incorrect DNS names. Check that each DNS name used in the configuration file exists and that the address responds to the Unix <tt>ping</tt> command. The Unix <tt>traceroute</tt> or Windows <tt>tracert</tt> utility can be used to verify a partial or complete path exists. Most problems reported to the NTP newsgroup are not NTP problems, but problems with the network or firewall configuration.</p>
+<h4>Verifying Correct Operation</h4>
+<p>Unless using the <tt>iburst</tt> option, the client normally takes a few
+ minutes to synchronize to a server. If the client time at startup happens
+ to be more than 1000 s distant from NTP time, the daemon exits with a message
+ to the system log directing the operator to manually set the time within 1000
+ s and restart. If the time is less than 1000 s but more than 128 s distant,
+ a step correction occurs and the daemon restarts automatically.</p>
+<p>When started for the first time and a frequency file is not present, the
+ daemon enters a special mode in order to calibrate the frequency. This takes
+ 900 s during which the time is not disciplined. When calibration is complete,
+ the daemon creates the frequency file and enters normal mode to amortize whatever
+ residual offset remains.</p>
+<p>The <tt>ntpq</tt> commands <tt>pe</tt>, <tt>as</tt> and <tt>rv</tt> are
+ normally sufficient to verify correct operation and assess nominal performance.
+ The <a href="ntpq.html#pe"><tt>pe</tt></a> command displays a list showing
+ the DNS name or IP address for each association along with selected status
+ and statistics variables. The first character in each line is the tally code,
+ which shows which associations are candidates to set the system clock and
+ of these which one is the system peer. The encoding is shown in the <tt>select</tt> field of the <a href="decode.html#peer">peer status word</a>.</p>
+<p>The <a href="ntpq.html#as"><tt>as</tt></a> command displays a list of associations and association identifiers. Note the <tt>condition</tt> column, which reflects the tally code. The <a href="ntpq.html#pe"><tt>rv</tt></a> command displays the <a href="ntpq.html#system">system variables</a> billboard, including the <a href="decode.html#sys">system status word</a>. The <a href="ntpq.html#rv"><tt>rv <i>assocID</i></tt></a> command, where <tt><i>assocID</i></tt> is the association ID, displays the <a href="ntpq.html#peer">peer variables</a> billboard, including the <a href="decode.html#peer">peer status word</a>. Note that, except for explicit calendar dates, times are in milliseconds and frequencies are in parts-per-million (PPM).</p>
+<p>A detailed explanation of the system, peer and clock variables in the billboards is beyond the scope of this page; however, a comprehensive explanation for each one is in the NTPv4 protocol specification. The following observations will be useful in debugging and monitoring.</p>
+<ol>
+ <li>The server has successfully synchronized to its sources if the <tt>leap</tt> peer
+ variable has value other than 3 (11b) The client has successfully synchronized
+ to the server when the <tt>leap</tt> system variable has value other than
+ 3.</li>
+ <li>The <tt>reach</tt> peer variable is an 8-bit shift register displayed in octal format. When a valid packet is received, the rightmost bit is lit. When a packet is sent, the register is shifted left one bit with 0 replacing the rightmost bit. If the <tt>reach</tt> value is nonzero, the server is reachable; otherwise, it is unreachable. Note that, even if all servers become unreachable, the system continues to show valid time to dependent applications.</li>
+ <li>A useful indicator of miscellaneous problems is the <tt>flash</tt> peer variable, which shows the result of 13 sanity tests. It contains the <a href="decode.html#flash">flash status word</a> bits, commonly called flashers, which displays the current errors for the association. These bits should all be zero for a valid server.</li>
+ <li>The three peer variables <tt>filtdelay</tt>, <tt>filtoffset</tt> and <tt>filtdisp</tt> show the delay, offset and jitter statistics for each of the last eight measurement rounds. These statistics and their trends are valuable performance indicators for the server, client and the network. For instance, large fluctuations in delay and jitter suggest network congestion. Missing clock filter stages suggest packet losses in the network.</li>
+ <li>The synchronization distance, defined as one-half the delay plus the dispersion, represents the maximum error statistic. The jitter represents the expected error statistic. The maximum error and expected error calculated from the peer variables represents the quality metric for the server. The maximum error and expected error calculated from the system variables represents the quality metric for the client. If the root synchronization distance for any server exceeds 1.5 s, called the select threshold, the server is considered invalid.</li>
+</ol>
+<h4>Large Frequency Errors</h4>
+<p>The frequency tolerance of computer clock oscillators varies widely, sometimes above 500 PPM. While the daemon can handle frequency errors up to 500 PPM, or 43 seconds per day, values much above 100 PPM reduce the headroom, especially at the lowest poll intervals. To determine the particular oscillator frequency, start <tt>ntpd</tt> using the <tt>noselect</tt> option with the <tt>server</tt> configuration command.</p>
+<p>Record the time of day and offset displayed by the <tt>ntpq</tt> <a href="ntpq.html#pe"><tt>pe</tt></a> command. Wait for an hour or so and record the time of day and offset. Calculate the frequency as the offset difference divided by the time difference. If the frequency is much above 100 PPM, the <a href="tickadj.html">tickadj</a> program might be useful to adjust the kernel clock frequency below that value. For systems that do not support this program, this might be one using a command in the system startup file.</p>
+<h4>Access Controls</h4>
+<p>Provisions are included in <tt>ntpd</tt> for access controls which deflect unwanted traffic from selected hosts or networks. The controls described on the <a href="accopt.html">Access Control Options</a> include detailed packet filter operations based on source address and address mask. Normally, filtered packets are dropped without notice other than to increment tally counters. However, the server can be configured to send a &quot;kiss-o'-death&quot; (KoD) packet to the client either when explicitly configured or when cryptographic authentication fails for some reason. The client association is permanently disabled, the access denied bit (TEST4) is set in the flash variable and a message is sent to the system log.</p>
+<p>The access control provisions include a limit on the packet rate from a
+ host or network. If an incoming packet exceeds the limit, it is dropped and
+ a KoD sent to the source. If this occurs after the client association has
+ synchronized, the association is not disabled, but a message is sent to the
+ system log. See the <a href="accopt.html">Access Control Options</a> page
+ for further information.</p>
+<h4>Large Delay Variations</h4>
+<p>In some reported scenarios an access line may show low to moderate network delays during some period of the day and moderate to high delays during other periods. Often the delay on one direction of transmission dominates, which can result in large time offset errors, sometimes in the range up to a few seconds. It is not usually convenient to run <tt>ntpd</tt> throughout the day in such scenarios, since this could result in several time steps, especially if the condition persists for greater than the stepout threshold.</p>
+<p>Specific provisions have been built into <tt>ntpd</tt> to cope with these problems. The scheme is called &quot;huff-'n-puff and is described on the <a href="miscopt.html">Miscellaneous Options</a> page. An alternative approach in such scenarios is first to calibrate the local clock frequency error by running <tt>ntpd</tt> in continuous mode during the quiet interval and let it write the frequency to the <tt>ntp.drift</tt> file. Then, run <tt>ntpd -q</tt> from a cron job each day at some time in the quiet interval. In systems with the nanokernel or microkernel performance enhancements, including Solaris, Tru64, Linux and FreeBSD, the kernel continuously disciplines the frequency so that the residual correction produced by <tt>ntpd</tt> is usually less than a few milliseconds.</p>
+<h4>Cryptographic Authentication</h4>
+<p>Reliable source authentication requires the use of symmetric key or public key cryptography, as described on the <a href="authopt.html">Authentication Options</a> page. In symmetric key cryptography servers and clients share session keys contained in a secret key file In public key cryptography, which requires the OpenSSL software library, the server has a private key, never shared, and a public key with unrestricted distribution. The cryptographic media required are produced by the <a href="keygen.html"><tt>ntp-keygen</tt></a> program.</p>
+<p>Problems with symmetric key authentication are usually due to mismatched keys or improper use of the <tt>trustedkey</tt> command. A simple way to check for problems is to use the trace facility, which is enabled using the <tt>ntpd -d</tt> command line. As each packet is received a trace line is displayed which shows the authentication status in the <tt>auth</tt> field. A status of 1 indicates the packet was successful authenticated; otherwise it has failed.</p>
+<p>A common misconception is the implication of the <tt>auth</tt> bit in the <tt>enable</tt> and <tt>disable</tt> commands. <b>This bit does not affect authentication in any way other than to enable or disable mobilization of a new persistent association in broadcast/multicast client, manycast client or symmetric passive modes.</b> If enabled, which is the default, these associations require authentication; if not, an association is mobilized even if not authenticated. Users are cautioned that running with authentication disabled is very dangerous, since an intruder can easily strike up an association and inject false time values.</p>
+<p>Public key cryptography is supported in NTPv4 using the Autokey protocol, which is described in briefings on the NTP Project page linked from www.ntp.org. Development of this protocol is mature and the <tt>ntpd</tt> implementation is basically complete. Autokey version 2, which is the latest and current version, includes provisions to hike certificate trails, operate as certificate authorities and verify identity using challenge/response identification schemes. Further details of the protocol are on the <a href="authopt.html">Authentication Options</a> page. Common problems with configuration and key generation are mismatched key files, broken links and missing or broken random seed file.</p>
+<p>As in the symmetric key cryptography case, the trace facility is a good way to verify correct operation. A statistics file <tt>cryptostats</tt> records protocol transactions and error messages. The daemon requires a random seed file, public/private key file and a valid certificate file; otherwise it exits immediately with a message to the system log. As each file is loaded a trace message appears with its filestamp. There are a number of checks to insure that only consistent data are used and that the certificate is valid. When the protocol is in operation a number of checks are done to verify the server has the expected credentials and its filestamps and timestamps are consistent. Errors found are reported using NTP control and monitoring protocol traps with extended trap codes shown in the Authentication Options page.</p>
+<p>To assist debugging every NTP extension field is displayed in the trace along with the Autokey operation code. Every extension field carrying a verified signature is identified and displayed along with filestamp and timestamp where meaningful. In all except broadcast/multicast client mode, correct operation of the protocol is confirmed by the absence of extension fields and an <tt>auth</tt> value of one. It is normal in broadcast/multicast client mode that the broadcast server use one extension field to show the host name, status word and association ID.</p>
+<h4>Debugging Checklist</h4>
+<p>If the <tt>ntpq</tt> or <tt>ntpdc</tt> programs do not show that messages are being received by the daemon or that received messages do not result in correct synchronization, verify the following:</p>
+<ol>
+ <li>Verify the <tt>/etc/services</tt> file host machine is configured to accept UDP packets on the NTP port 123. NTP is specifically designed to use UDP and does not respond to TCP.</li>
+ <li>Check the system log for <tt>ntpd</tt> messages about configuration errors, name-lookup failures or initialization problems. Common system log messages are summarized on the <a href="msyslog.html"><tt>ntpd</tt> System Log Messages</a> page. Check to be sure that only one copy of <tt>ntpd</tt> is running.</li>
+ <li>Verify using <tt>ping</tt> or other utility that packets actually do make the round trip between the client and server. Verify using <tt>nslookup</tt> or other utility that the DNS server names do exist and resolve to valid Internet addresses.</li>
+ <li>Check that the remote NTP server is up and running. The usual evidence that it is not is a <tt>Connection refused</tt> message.</li>
+ <li>Using the <tt>ntpdc</tt> program, verify that the packets received and packets sent counters are incrementing. If the sent counter does not increment and the configuration file includes configured servers, something may be wrong in the host network or interface configuration. If this counter does increment, but the received counter does not increment, something may be wrong in the network or the server NTP daemon may not be running or the server itself may be down or not responding.</li>
+ <li>If both the sent and received counters do increment, but the <tt>reach</tt> values in the <tt>pe</tt> billboard with <tt>ntpq</tt> continues to show zero, received packets are probably being discarded for some reason. If this is the case, the cause should be evident from the <tt>flash</tt> variable as discussed above and on the <tt>ntpq</tt> page. It could be that the server has disabled access for the client address, in which case the <tt>refid</tt> field in the <tt>ntpq pe</tt> billboard will show a kiss code. See earlier on this page for a list of kiss codes and their meaning.</li>
+ <li>If the <tt>reach</tt> values in the <tt>pe</tt> billboard show the servers are alive and responding, note the tattletale symbols at the left margin, which indicate the status of each server resulting from the various grooming and mitigation algorithms. The interpretation of these symbols is discussed on the <tt>ntpq</tt> page. After a few minutes of operation, one or another of the reachable server candidates should show a * tattletale symbol. If this doesn't happen, the intersection algorithm, which classifies the servers as truechimers or falsetickers, may be unable to find a majority of truechimers among the server population.</li>
+ <li>If all else fails, see the FAQ and/or the discussion and briefings at the NTP Project page.</li>
+</ol>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/decode.html b/html/decode.html
new file mode 100644
index 0000000..51603ad
--- /dev/null
+++ b/html/decode.html
@@ -0,0 +1,692 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Event Messages and Status Words</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Event Messages and Status Words</h3>
+<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 -->
+ UTC</p>
+</p>
+<br clear="left">
+<h4>Related Links</h4>
+<p>
+ <script type="text/javascript" language="javascript" src="scripts/install.txt"></script>
+</p>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">Introduction</a></li>
+ <li class="inline"><a href="#sys">System Status Word</a></li>
+ <li class="inline"><a href="#peer">Peer Status Word</a></li>
+ <li class="inline"><a href="#clock">Clock Status Word</a></li>
+ <li class="inline"><a href="#flash">Flash Status Word</a></li>
+ <li class="inline"><a href="#kiss">Kiss Codes</a></li>
+ <li class="inline"><a href="#crypto">Crypto Messages</a></li>
+</ul>
+<hr>
+<h4 id="intro">Introduction</h4>
+<p>This page lists the status words, event messages and error codes used for <tt>ntpd</tt> reporting and monitoring. Status words are used to display the current status of the running program. There is one system status word and a peer status word for each association. There is a clock status word for each association that supports a reference clock. There is a flash code for each association which shows errors found in the last packet received (pkt) and during protocol processing (peer). These are commonly viewed using the <tt>ntpq</tt> program.</p>
+<p>Significant changes in program state are reported as events. There is one
+ set of system events and a set of peer events for each association. In addition,
+ there is a set of clock events for each association that supports a reference
+ clock. Events are normally reported to the <tt>protostats</tt> monitoring file
+ and optionally to the system log. In addition, if the trap facility is configured,
+ events can be reported to a remote program that can page an administrator.</p>
+<p>This page also includes a description of the error messages produced by the Autokey protocol. These messages are normally sent to the <tt>cryptostats</tt> monitoring file.</p>
+<p>In the following tables the Event Field is the status or event code assigned and the Message Field a short string used for display and event reporting. The Description field contains a longer explanation of the status or event. Some messages include additional information useful for error diagnosis and performance assessment.</p>
+<h4 id="sys">System Status Word</h4>
+<p>The system status word consists of four fields LI (0-1), Source (2-7), Count (8-11) and Event (12-15). It is reported in the first line of the <tt>rv</tt> display produced by the <tt>ntpq</tt> program.</p>
+<table width="50%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td><div align="center">Leap</div></td>
+ <td><div align="center">Source</div></td>
+ <td><div align="center">Count</div></td>
+ <td><div align="center">Event</div></td>
+ </tr>
+</table>
+<p>The Leap Field displays the system leap indicator bits coded as follows:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>0</tt></td>
+ <td><tt>leap_none</tt></td>
+ <td>normal synchronized state</td>
+ </tr>
+ <tr>
+ <td><tt>1</tt></td>
+ <td><tt>leap_add_sec</tt></td>
+ <td>insert second after 23:59:59 of the current day</td>
+ </tr>
+ <tr>
+ <td><tt>2</tt></td>
+ <td><tt>leap_del_sec</tt></td>
+ <td>delete second 23:59:59 of the current day</td>
+ </tr>
+ <tr>
+ <td><tt>3</tt></td>
+ <td><tt>leap_alarm</tt></td>
+ <td>never synchronized</td>
+ </tr>
+</table>
+<p>The Source Field displays the current synchronization source coded as follows:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>0</tt></td>
+ <td><tt>sync_unspec</tt></td>
+ <td>not yet synchronized</td>
+ </tr>
+ <tr>
+ <td><tt>1</tt></td>
+ <td><tt>sync_pps</tt></td>
+ <td>pulse-per-second signal (Cs, Ru, GPS, etc.)</td>
+ </tr>
+ <tr>
+ <td><tt>2</tt></td>
+ <td><tt>sync_lf_radio</tt></td>
+ <td>VLF/LF radio (WWVB, DCF77, etc.)</td>
+ </tr>
+ <tr>
+ <td><tt>3</tt></td>
+ <td><tt>sync_hf_radio</tt></td>
+ <td>MF/HF radio (WWV, etc.)</td>
+ </tr>
+ <tr>
+ <td><tt>4</tt></td>
+ <td><tt>sync_uhf_radio</tt></td>
+ <td>VHF/UHF radio/satellite (GPS, Galileo, etc.)</td>
+ </tr>
+ <tr>
+ <td><tt>5</tt></td>
+ <td><tt>sync_local</tt></td>
+ <td>local timecode (IRIG, LOCAL driver, etc.)</td>
+ </tr>
+ <tr>
+ <td><tt>6</tt></td>
+ <td><tt>sync_ntp</tt></td>
+ <td>NTP</td>
+ </tr>
+ <tr>
+ <td><tt>7</tt></td>
+ <td><tt>sync_other</tt></td>
+ <td>other (IEEE 1588, openntp, crony, etc.)</td>
+ </tr>
+ <tr>
+ <td><tt>8</tt></td>
+ <td><tt>sync_wristwatch</tt></td>
+ <td>eyeball and wristwatch</td>
+ </tr>
+ <tr>
+ <td><tt>9</tt></td>
+ <td><tt>sync_telephone</tt></td>
+ <td>telephone modem (ACTS, PTB, etc.)</td>
+ </tr>
+</table>
+<p>The Count Field displays the number of events since the last time the code changed. Upon reaching 15, subsequent events with the same code are ignored.</p>
+<p>The Event Field displays the most recent event message coded as follows:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>00</tt></td>
+ <td><tt>unspecified</tt></td>
+ <td>unspecified</td>
+ </tr>
+ <tr>
+ <td><tt>01</tt></td>
+ <td><tt>freq_not_set</tt></td>
+ <td>frequency file not available</td>
+ </tr>
+ <tr>
+ <td><tt>02</tt></td>
+ <td><tt>freq_set</tt></td>
+ <td>frequency set from frequency file</td>
+ </tr>
+ <tr>
+ <td><tt>03</tt></td>
+ <td><tt>spike_detect</tt></td>
+ <td>spike detected</td>
+ </tr>
+ <tr>
+ <td><tt>04</tt></td>
+ <td><tt>freq_mode</tt></td>
+ <td>initial frequency training mode</td>
+ </tr>
+ <tr>
+ <td><tt>05</tt></td>
+ <td><tt>clock_sync</tt></td>
+ <td>clock synchronized</td>
+ </tr>
+ <tr>
+ <td><tt>06</tt></td>
+ <td><tt>restart</tt></td>
+ <td>program restart</td>
+ </tr>
+ <tr>
+ <td><tt>07</tt></td>
+ <td><tt>panic_stop</tt></td>
+ <td>clock error more than 600 s</td>
+ </tr>
+ <tr>
+ <td><tt>08</tt></td>
+ <td><tt>no_system_peer</tt></td>
+ <td>no system peer</td>
+ </tr>
+ <tr>
+ <td><tt>09</tt></td>
+ <td><tt>leap_armed</tt></td>
+ <td>leap second armed from file or Autokey</td>
+ </tr>
+ <tr>
+ <td><tt>0a</tt></td>
+ <td><tt>leap_disarmed</tt></td>
+ <td>leap second disarmed</td>
+ </tr>
+ <tr>
+ <td><tt>0b</tt></td>
+ <td><tt>leap_event</tt></td>
+ <td>leap event</td>
+ </tr>
+ <tr>
+ <td><tt>0c</tt></td>
+ <td><tt>clock_step</tt></td>
+ <td>clock stepped</td>
+ </tr>
+ <tr>
+ <td><tt>0d</tt></td>
+ <td><tt>kern</tt></td>
+ <td>kernel information message</td>
+ </tr>
+ <tr>
+ <td><tt>0e</tt></td>
+ <td><tt>TAI...</tt></td>
+ <td>leapsecond values update from file</td>
+ </tr>
+ <tr>
+ <td><tt>0f</tt></td>
+ <td><tt>stale leapsecond values</tt></td>
+ <td>new NIST leapseconds file needed</td>
+ </tr>
+</table>
+<h4 id="peer">Peer Status Word</h4>
+<p>The peer status word consists of four fields: Status (0-4), Select (5-7), Count (8-11) and Code (12-15). It is reported in the first line of the <tt>rv <i>associd</i></tt> display produced by the <tt>ntpq</tt> program.</p>
+<table width="50%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td><div align="center">Status</div></td>
+ <td><div align="center">Select</div></td>
+ <td><div align="center">Count</div></td>
+ <td><div align="center">Code</div></td>
+ </tr>
+</table>
+<p>The Status Field displays the peer status code bits in hexadecimal; each bit is an independent flag. (Note this field is 5 bits wide, and combines with the the 3-bit-wide Select Field to create the first full byte of the peer status word.) The meaning of each bit in the Status Field is listed in the following table:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>08</tt></td>
+ <td><tt>bcst</tt></td>
+ <td>broadcast association</td>
+ </tr>
+ <tr>
+ <td><tt>10</tt></td>
+ <td><tt>reach</tt></td>
+ <td>host reachable</td>
+ </tr>
+ <tr>
+ <td><tt>20</tt></td>
+ <td><tt>auth</tt></td>
+ <td>authentication ok</td>
+ </tr>
+ <tr>
+ <td><tt>40</tt></td>
+ <td><tt>authenb</tt></td>
+ <td>authentication enabled</td>
+ </tr>
+ <tr>
+ <td><tt>80</tt></td>
+ <td><tt>config</tt></td>
+ <td>persistent association</td>
+ </tr>
+</table>
+<p>The Select Field displays the current selection status. (The T Field in the following table gives the corresponding tally codes used in the <tt>ntpq peers</tt> display.) The values are coded as follows:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>T</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>0</tt></td>
+ <td><tt>sel_reject</tt></td>
+ <td>&nbsp;</td>
+ <td>discarded as not valid (TEST10-TEST13)</td>
+ </tr>
+ <tr>
+ <td><tt>1</tt></td>
+ <td><tt>sel_falsetick</tt></td>
+ <td><tt>x</tt></td>
+ <td>discarded by intersection algorithm</td>
+ </tr>
+ <tr>
+ <td><tt>2</tt></td>
+ <td><tt>sel_excess</tt></td>
+ <td><tt>.</tt></td>
+ <td>discarded by table overflow (not used)</td>
+ </tr>
+ <tr>
+ <td><tt>3</tt></td>
+ <td><tt>sel_outlyer</tt></td>
+ <td><tt>-</tt></td>
+ <td>discarded by the cluster algorithm</td>
+ </tr>
+ <tr>
+ <td><tt>4</tt></td>
+ <td><tt>sel_candidate</tt></td>
+ <td><tt>+</tt></td>
+ <td>included by the combine algorithm</td>
+ </tr>
+ <tr>
+ <td><tt>5</tt></td>
+ <td><tt>sel_backup</tt></td>
+ <td><tt>#</tt></td>
+ <td>backup (more than <tt>tos maxclock</tt> sources)</td>
+ </tr>
+ <tr>
+ <td><tt>6</tt></td>
+ <td><tt>sel_sys.peer</tt></td>
+ <td><tt>*</tt></td>
+ <td>system peer</td>
+ </tr>
+ <tr>
+ <td><tt>7</tt></td>
+ <td><tt>sel_pps.peer</tt></td>
+ <td><tt>o</tt></td>
+ <td>PPS peer (when the prefer peer is valid)</td>
+ </tr>
+</table>
+<p>The Count Field displays the number of events since the last time the code changed. Upon reaching 15, subsequent events with the same code are ignored. </p>
+<p>The Event Field displays the most recent event message coded as follows:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>01</tt></td>
+ <td><tt>mobilize</tt></td>
+ <td>association mobilized</td>
+ </tr>
+ <tr>
+ <td><tt>02</tt></td>
+ <td><tt>demobilize</tt></td>
+ <td>association demobilized</td>
+ </tr>
+ <tr>
+ <td><tt>03</tt></td>
+ <td><tt>unreachable</tt></td>
+ <td>server unreachable</td>
+ </tr>
+ <tr>
+ <td><tt>04</tt></td>
+ <td><tt>reachable</tt></td>
+ <td>server reachable</td>
+ </tr>
+ <tr>
+ <td><tt>05</tt></td>
+ <td><tt>restart</tt></td>
+ <td>association restart</td>
+ </tr>
+ <tr>
+ <td><tt>06</tt></td>
+ <td><tt>no_reply</tt></td>
+ <td>no server found (<tt>ntpdate</tt> mode)</td>
+ </tr>
+ <tr>
+ <td><tt>07</tt></td>
+ <td><tt>rate_exceeded</tt></td>
+ <td>rate exceeded (kiss code <tt>RATE</tt>)</td>
+ </tr>
+ <tr>
+ <td><tt>08</tt></td>
+ <td><tt>access_denied</tt></td>
+ <td>access denied (kiss code <tt>DENY</tt>)</td>
+ </tr>
+ <tr>
+ <td><tt>09</tt></td>
+ <td><tt>leap_armed</tt></td>
+ <td>leap armed from server LI code</td>
+ </tr>
+ <tr>
+ <td><tt>0a</tt></td>
+ <td><tt>sys_peer</tt></td>
+ <td>become system peer</td>
+ </tr>
+ <tr>
+ <td><tt>0b</tt></td>
+ <td><tt>clock_event</tt></td>
+ <td>see clock status word</td>
+ </tr>
+ <tr>
+ <td><tt>0c</tt></td>
+ <td><tt>bad_auth</tt></td>
+ <td>authentication failure</td>
+ </tr>
+ <tr>
+ <td><tt>0d</tt></td>
+ <td><tt>popcorn</tt></td>
+ <td>popcorn spike suppressor</td>
+ </tr>
+ <tr>
+ <td><tt>0e</tt></td>
+ <td><tt>interleave_mode</tt></td>
+ <td>entering interleave mode</td>
+ </tr>
+ <tr>
+ <td><tt>0f</tt></td>
+ <td><tt>interleave_error</tt></td>
+ <td>interleave error (recovered)</td>
+ </tr>
+</table>
+<h4 id="clock">Clock Status Word</h4>
+<p>The clock status word consists of four fields: Unused (0-7), Count (8-11) and Code (12-15). It is reported in the first line of the <tt>clockvar <i>associd</i></tt> display produced by the <tt>ntpq</tt> program.</p>
+<table width="50%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td><div align="center">Unused</div></td>
+ <td><div align="center">Count</div></td>
+ <td><div align="center">Code</div></td>
+ </tr>
+</table>
+<p>The Count Field displays the number of events since the last <tt>lockvar</tt> command, while the Event Field displays the most recent event message coded as follows:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>00</tt></td>
+ <td><tt>clk_unspe</tt></td>
+ <td>nominal</td>
+ </tr>
+ <tr>
+ <td><tt>01</tt></td>
+ <td><tt>clk_noreply</tt></td>
+ <td>no reply to poll</td>
+ </tr>
+ <tr>
+ <td><tt>02</tt></td>
+ <td><tt>clk_badformat</tt></td>
+ <td>bad timecode format</td>
+ </tr>
+ <tr>
+ <td><tt>03</tt></td>
+ <td><tt>clk_fault</tt></td>
+ <td>hardware or software fault</td>
+ </tr>
+ <tr>
+ <td><tt>04</tt></td>
+ <td><tt>clk_bad_signal</tt></td>
+ <td>signal loss</td>
+ </tr>
+ <tr>
+ <td><tt>05</tt></td>
+ <td><tt>clk_bad_date</tt></td>
+ <td>bad date format</td>
+ </tr>
+ <tr>
+ <td><tt>06</tt></td>
+ <td><tt>clk_bad_time</tt></td>
+ <td>bad time format</td>
+ </tr>
+</table>
+<p>When the clock driver sets the code to a new value, a <tt>clock_alarm</tt> (11) peer event is reported.</p>
+<h4 id="flash">Flash Status Word</h4>
+<p>The flash status word is displayed by the <tt>ntpq</tt> program <tt>rv</tt> command. It consists of a number of bits coded in hexadecimal as follows:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td width="10%">Code</td>
+ <td width="15%">Tag</td>
+ <td width="20%">Message</td>
+ <td width="55%">Description</td>
+ </tr>
+ <tr>
+ <td><tt>0001</tt></td>
+ <td>TEST1</td>
+ <td><tt>pkt_dup</tt></td>
+ <td>duplicate packet</td>
+ </tr>
+ <tr>
+ <td><tt>0002</tt></td>
+ <td>TEST2</td>
+ <td><tt>pkt_bogus</tt></td>
+ <td>bogus packet</td>
+ </tr>
+ <tr>
+ <td><tt>0004</tt></td>
+ <td>TEST3</td>
+ <td><tt>pkt_unsync</tt></td>
+ <td>server not synchronized</td>
+ </tr>
+ <tr>
+ <td><tt>0008</tt></td>
+ <td>TEST4</td>
+ <td><tt>pkt_denied</tt></td>
+ <td>access denied</td>
+ </tr>
+ <tr>
+ <td><tt>0010</tt></td>
+ <td>TEST5</td>
+ <td><tt>pkt_auth</tt></td>
+ <td> authentication failure</td>
+ </tr>
+ <tr>
+ <td><tt>0020</tt></td>
+ <td>TEST6</td>
+ <td><tt>pkt_stratum</tt></td>
+ <td>invalid leap or stratum</td>
+ </tr>
+ <tr>
+ <td><tt>0040</tt></td>
+ <td>TEST7</td>
+ <td><tt>pkt_header</tt></td>
+ <td> header distance exceeded</td>
+ </tr>
+ <tr>
+ <td><tt>0080</tt></td>
+ <td>TEST8</td>
+ <td><tt>pkt_autokey</tt></td>
+ <td>Autokey sequence error</td>
+ </tr>
+ <tr>
+ <td><tt>0100</tt></td>
+ <td>TEST9</td>
+ <td><tt>pkt_crypto</tt></td>
+ <td>Autokey protocol error</td>
+ </tr>
+ <tr>
+ <td><tt>0200</tt></td>
+ <td>TEST10</td>
+ <td><tt>peer_stratum</tt></td>
+ <td> invalid header or stratum</td>
+ </tr>
+ <tr>
+ <td><tt>0400</tt></td>
+ <td>TEST11</td>
+ <td><tt>peer_dist</tt></td>
+ <td> distance threshold exceeded</td>
+ </tr>
+ <tr>
+ <td><tt>0800</tt></td>
+ <td>TEST12</td>
+ <td><tt>peer_loop</tt></td>
+ <td> synchronization loop</td>
+ </tr>
+ <tr>
+ <td><tt>1000</tt></td>
+ <td>TEST13</td>
+ <td><tt>peer_unreach</tt></td>
+ <td> unreachable or nonselect</td>
+ </tr>
+</table>
+<h4 id="kiss">Kiss Codes</h4>
+<p>Kiss codes are used in kiss-o'-death (KoD) packets, billboard displays and log messages. They consist of a string of four zero-padded ASCII charactes. In practice they are informal and tend to change with time and implementation. Some of these codes can appear in the reference identifier field in <tt>ntpq</tt> billboards. Following is the current list:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>ACST</tt></td>
+ <td>manycast server</td>
+ </tr>
+ <tr>
+ <td><tt>AUTH</tt></td>
+ <td>authentication error</td>
+ </tr>
+ <tr>
+ <td><tt>AUTO</tt></td>
+ <td>Autokey sequence error</td>
+ </tr>
+ <tr>
+ <td><tt>BCST</tt></td>
+ <td>broadcast server</td>
+ </tr>
+ <tr>
+ <td><tt>CRYPT</tt></td>
+ <td>Autokey protocol error</td>
+ </tr>
+ <tr>
+ <td><tt>DENY</tt></td>
+ <td>access denied by server</td>
+ </tr>
+ <tr>
+ <td><tt>INIT</tt></td>
+ <td>association initialized</td>
+ </tr>
+ <tr>
+ <td><tt>MCST</tt></td>
+ <td>multicast server</td>
+ </tr>
+ <tr>
+ <td><tt>RATE</tt></td>
+ <td>rate exceeded</td>
+ </tr>
+ <tr>
+ <td><tt>TIME</tt></td>
+ <td>association timeout</td>
+ </tr>
+ <tr>
+ <td><tt>STEP</tt></td>
+ <td>step time change</td>
+ </tr>
+</table>
+<h4 id="crypto">Crypto Messages</h4>
+<p>These messages are sent to the <tt>cryptostats</tt> file when an error is detected in the Autokey protocol.</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Code</td>
+ <td>Message</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>01</tt></td>
+ <td><tt>bad_format</tt></td>
+ <td>bad extension field format or length</td>
+ </tr>
+ <tr>
+ <td><tt>02</tt></td>
+ <td><tt>bad_timestamp</tt></td>
+ <td>bad timestamp</td>
+ </tr>
+ <tr>
+ <td><tt>03</tt></td>
+ <td><tt>bad_filestamp</tt></td>
+ <td>bad filestamp</td>
+ </tr>
+ <tr>
+ <td><tt>04</tt></td>
+ <td><tt>bad_public_key</tt></td>
+ <td>bad or missing public key</td>
+ </tr>
+ <tr>
+ <td><tt>05</tt></td>
+ <td><tt>bad_digest</tt></td>
+ <td>unsupported digest type</td>
+ </tr>
+ <tr>
+ <td><tt>06</tt></td>
+ <td><tt>bad_identity</tt></td>
+ <td>unsupported identity type</td>
+ </tr>
+ <tr>
+ <td><tt>07</tt></td>
+ <td><tt>bad_siglength</tt></td>
+ <td>bad signature length</td>
+ </tr>
+ <tr>
+ <td><tt>08</tt></td>
+ <td><tt>bad signature</tt></td>
+ <td>extension field signature not verified</td>
+ </tr>
+ <tr>
+ <td><tt>09</tt></td>
+ <td><tt>cert_not_verified</tt></td>
+ <td>certificate signature not verified</td>
+ </tr>
+ <tr>
+ <td><tt>0a</tt></td>
+ <td><tt>cert_expired</tt></td>
+ <td>host certificate expired</td>
+ </tr>
+ <tr>
+ <td><tt>0b</tt></td>
+ <td><tt>bad_cookie</tt></td>
+ <td>bad or missing cookie</td>
+ </tr>
+ <tr>
+ <td><tt>0c</tt></td>
+ <td><tt>bad_leapseconds</tt></td>
+ <td>bad or missing leapseconds values</td>
+ </tr>
+ <tr>
+ <td><tt>0d</tt></td>
+ <td><tt>cert_missing</tt></td>
+ <td>bad or missing certificate</td>
+ </tr>
+ <tr>
+ <td><tt>0e</tt></td>
+ <td><tt>bad_group_key</tt></td>
+ <td>bad or missing group key</td>
+ </tr>
+ <tr>
+ <td><tt>0f</tt></td>
+ <td><tt>proto_error</tt></td>
+ <td>protocol error</td>
+ </tr>
+</table>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/discipline.html b/html/discipline.html
new file mode 100644
index 0000000..53b60cc
--- /dev/null
+++ b/html/discipline.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Clock Discipline Algorithm</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Clock Discipline Algorithm</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:03<!-- #EndDate -->
+ UTC</p>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">General Overview</a></li>
+ <li class="inline"><a href="#pll">Phase-Lock Loop Operations</a></li>
+ <li class="inline"><a href="#loop">Loop Dynamics</a></li>
+ <li class="inline"><a href="#house">Clock Initialization and Management</a></li>
+</ul>
+<hr>
+<h4 id="intro">General Overview</h4>
+<p>At the heart of the NTP specification and reference implementation is the clock discipline algorithm, which is best described as an adaptive parameter, hybrid phase/frequency-lock feedback loop. It is an intricately crafted algorithm that automatically adapts for optimum performance while minimizing network overhead. Operation is in two modes, phase-lock loop (PLL), which is used at poll intervals below the Allan intercept, by default 2048 s, and frequency-lock loop (FLL), which is used above that.</p>
+<div align="center"> <img src="pic/discipline.gif" alt="gif">
+ <p>Figure 1. Clock Discipline Algorithm</p>
+</div>
+<h4 id="pll">Clock Discipline Operations</h4>
+<p>A block diagram of the clock discipline is shown in Figure 1. The timestamp of a reference clock or remote server is compared with the timestamp of the system clock, represented as a variable frequency oscillator (VFO), to produce a raw offset sample <em>V<sub>d</sub></em>. Offset samples are processed by the clock filter to produce a filtered update <em>V<sub>s</sub></em>. The loop filter implements a type-2 proportional-integrator controller (PIC). The PIC can minimize errors in both time and frequency using predictors <em>x</em> and <em>y</em>, respectively. The clock adjust process samples these predictors once each second for the daemon discipline or once each tick interrupt for the kernel discipline to produce the system clock update <em>V<sub>c</sub></em>.</p>
+<p>In PLL mode the frequency predictor is an integral of the offset over past updates, while the phase predictor is the offset amortized over time in order to avoid setting the clock backward. In FLL mode the phase predictor is not used, while the frequency predictor is similar to the NIST <em>lockclock</em> algorithm. In this algorithm, the frequency predictor is computed as a fraction of the current offset divided by the time since the last update in order to minimize the offset at the next update.</p>
+<p>The discipline response in PLL mode is determined by the <em>time constant</em>, which results in a &quot;stiffness&quot; depending on the jitter of the available sources and the wander of the system clock oscillator. The scaled time constant is also used as the poll interval described on the <a href="poll.html">Poll Program</a> page. However, in NTP symmetric mode, each peer manages its own poll interval and the two might not be the same. In such cases either peer uses the minimum of its own poll interval and that of the other peer, which is included in the NTP packet header.</p>
+<h4 id="loop">Loop Dynamics</h4>
+<p> It is necessary to verify that the clock discipline algorithm is stable and satisfies the Nyquist criterion, which requires that the sampling rate be at least twice the bandwidth. In this case the bandwidth can be approximated by the reciprocal of the time constant. In the NTP specification and reference implementation, time constants and poll intervals are expressed as exponents of 2. By construction, the time constant exponent is five times the poll interval exponent. Thus, the default poll exponent of 6 corresponds to a poll interval of 64 s and a time constant of 2048 s. A change in the poll interval changes the time constant by a corresponding amount.. The Nyquist criterion requires the sample interval to be not more than half the time constant or 1024 s. The clock filter guarantees at least one sample in eight poll intervals, so the sample interval is not more than 512 s. This would be described as oversampling by a factor of two. Finally, the PLL parameters have been chosen for a damping factor of 2, which results in a much faster risetime than with critical damping, but results in modest overshoot of 6 percent.</p>
+<p> It is important to understand how the dynamics of the PLL are affected by the time constant and poll interval. At the default poll interval of 64 s and a step offset change of 100 ms, the time response crosses zero in about 50 min and overshoots about 6 ms, as per design. Ordinarily, a step correction would causes a temporary frequency surge of about 5 PPM, which along with the overshoot slowly dissipates over a few hours.</p>
+<p>However, the clock state machine used with the discipline algorithm avoids this transient at startup. It does this using a previously saved frequency file, if present, or by measuring the oscillator frequency, if not. It then quickly amortizes the residual offset at startup without affecting the oscillator frequency. In this way the offset error is less than 0.5 ms within 5 min, if the file is present, and within 10 min if not. See the <a href="clock.html">Clock State Machine</a> page for further details.</p>
+<p>Since the PLL is linear, the response with different offset step amplitudes and poll intervals has the same characteristic shape, but scaled differently in amplitude and time. The response scales exactly with step amplitude, so that the response to a 10-ms step has the same shape as at 64 s, but with amplitude compressed by one-tenth. The response scales exactly with poll interval, so that response at a poll interval of 8 s has the same shape as at 64 s, but with time compressed by one-eighth.</p>
+<p>The optimum time constant, and thus the poll interval, depends on the network time jitter and the oscillator frequency wander. Errors due to jitter decrease as the time constant increases, while errors due to wander decrease as the time constant decreases. For typical Internet paths, the two error characteristics intersect at a point called the <em>Allan intercept</em>, which represents the optimum time constant. With a compromise Allan intercept of 2048 s, the optimum poll interval is about 64 s, which corresponds to a compromise poll exponent of 6. For fast LANs with modern computers, the Allan intercept is somewhat lower at around 512 s, so a compromise poll exponent of 4 (16 s) is appropriate. An intricate, heuristic algorithm is used to manage the actual poll interval within a specified range. Details are on the <a href="poll.html">Poll Program</a> page.</p>
+<p>In the NTPv4 specification and reference implementation a state machine is used to manage the system clock under exceptional conditions, as when the daemon is first started or when encountering severe network congestion. In extreme cases not likely to be encountered in normal operation, the system time can be stepped forward or backward more than 128 ms. Further details are on the <a href="clock.html">Clock State Machine</a> page.</p>
+<h4 id="house">Clock Initialization and Management</h4>
+<p>If left running continuously, an NTP client on a fast LAN in a home or office environment can maintain synchronization nominally within one millisecond. When the ambient temperature variations are less than a degree Celsius, the clock oscillator frequency is disciplined to within one part per million (PPM), even when the clock oscillator native frequency offset is 100 PPM or more.</p>
+<p> For laptops and portable devices when the power is turned off, the battery backup clock offset error can increase as much as one second per day. When power is restored after several hours or days, the clock offset and oscillator frequency errors must be resolved by the clock discipline algorithm, but this can take several hours without specific provisions.</p>
+<p> The provisions described in this section insure that, in all but pathological situations, the startup transient is suppressed to within nominal levels in no more than five minutes after a warm start or ten minutes after a cold start. Following is a summary of these provisions. A detailed discussion of these provisions is on the <a href="clock.html">Clock State Machine</a> page.</p>
+<p> The reference implementation measures the clock oscillator frequency and updates a frequency file at intervals of one hour or more, depending on the measured frequency wander. This design is intended to minimize write cycles in NVRAM that might be used in a laptop or portable device. In a warm start, the frequency is initialized from this file, which avoids a possibly lengthy convergence time. In a cold start when no frequency file is available, the reference implementation first measures the oscillator frequency over a five-min interval. This generally results in a residual frequency error less than 1 PPM. The measurement interval can be changed using the <tt>stepout</tt> option of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command.</p>
+<p>In order to reduce the clock offset error at restart, the reference implementation mext disables oscillator frequency discipline and enables clock offset discipline with a small time constant. This is designed to quickly reduce the clock offset error without causing a frequency surge. This configuration is continued for an interval of five-min, after which the clock offset error is usually no more than a millisecond. The measurement interval can be changed using the <tt>stepout</tt> option of the <a href="miscopt.html#tinker"><tt>tinker</tt></a> command.</p>
+<p>Another concern at restart is the time necessary for the select and cluster algorithms to refine and validate the initial clock offset estimate. Normally, this takes several updates before setting the system clock. As the default minimum poll interval in most configurations is about one minute, it can take several minutes before setting the system clock. The <tt>iburst</tt> option of the <a href="confopt.html#burst"><tt>server</tt></a> command changes the behavior at restart and is recommended for client/server configurations. When this option is enabled, the client sends a volley of six requests at intervals of two seconds. This usually insures a reliable estimate is available in about ten seconds before setting the clock. Once this initial volley is complete, the procedures described above are executed.</p>
+<p>As a result of the above considerations, when a backup source, such as the local clock driver, ACTS modem driver or orphan mode is included in the system configuration, it may happen that one or more of them are selectable before one or more of the regular sources are selectable. When backup sources are included in the configuration, the reference implementation waits an interval of several minutes without regular sources before switching to backup sources. This is generally enough to avoid startup transients due to premature switching to backup sources. The interval can be changed using the <tt>orphanwait</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/discover.html b/html/discover.html
new file mode 100644
index 0000000..b35359c
--- /dev/null
+++ b/html/discover.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Automatic Server Discoveryschemes</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Automatic Server Discovery Schemes</h3>
+<img src="pic/alice51.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>Make sure who your friends are.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:04<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/config.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#assoc">Association Management</a></li>
+ <li class="inline"><a href="#bcst">Broadcast/Multicast Scheme</a></li>
+ <li class="inline"><a href="#mcst">Manycast Scheme</a></li>
+ <li class="inline"><a href="#pool">Server Pool Scheme</a></li>
+</ul>
+<hr>
+<h4 id="modes">Introduction</h4>
+<p>This page describes the automatic server discovery schemes provided in NTPv4. There are three automatic server discovery schemes: broadcast/multicast, many cast, and server pool, which are described on this page. The broadcast/multicast and many cast schemes utilize the ubiquitous broadcast or one-to-many paradigm native to IPv4 and IPv6. The server pool scheme uses DNS to resolve addresses of multiple volunteer servers scattered throughout the world.</p>
+<p> All three schemes work in much the same way and might be described as <i>grab-n'-prune.</i> Through one means or another they grab a number of associations either directly or indirectly from the configuration file, order them from best to worst according to the NTP mitigation algorithms, and prune the surplus associations.</p>
+<h4 id="assoc">Association Management</h4>
+<p>All schemes use an iterated process to discover new preemptable client associations as long as the total number of client associations is less than the <tt>maxclock</tt> option of the <tt>tos</tt> command. The <tt>maxclock</tt> default is 10, but it should be changed in typical configuration to some lower number, usually two greater than the <tt>minclock</tt> option of the same command. </p>
+<p>All schemes use a stratum filter to select just those servers with stratum considered useful. This can avoid large numbers of clients ganging up on a small number of low-stratum servers and avoid servers below or above specified stratum levels. By default, servers of all strata are acceptable; however, the <tt>tos</tt> command can be used to restrict the acceptable range from the <tt>floor</tt> option, inclusive, to the <tt>ceiling</tt> option, exclusive. Potential servers operating at the same stratum as the client will be avoided, unless the <tt>cohort</tt> option is present. Additional filters can be supplied using the methods described on the <a href="authentic.html">Authentication Support</a> page.</p>
+<p>The pruning process uses a set of unreach counters, one for each association created by the configuration or discovery processes. At each poll interval, the counter is increased by one. If an acceptable packet arrives for a persistent (configured) or ephemeral (broadcast/multicast) association, the counter is set to zero. If an acceptable packet arrives for a preemptable (manycast, pool) association and survives the selection and clustering algorithms, the counter is set to zero. If the the counter reaches an arbitrary threshold of 10, the association becomes a candidate for pruning.</p>
+<p>The pruning algorithm is very simple. If an ephemeral or preemptable association becomes a candidate for pruning, it is immediately demobilized. If a persistent association becomes a candidate for pruning, it is not demobilized, but its poll interval is set at the maximum. The pruning algorithm design avoids needless discovery/prune cycles for associations that wander in and out of the survivor list, but otherwise have similar characteristics. </p>
+<p>Following is a summary of each scheme. Note that reference to option applies to the commands described on the <a href="confopt.html">Configuration Options</a> page. See that page for applicability and defaults.</p>
+<h4 id="bcst">Broadcast/Multicast Scheme</h4>
+<p>A broadcast server generates messages continuously at intervals by default 64 s and time-to-live by default 127. These defaults can be overridden by the <tt>minpoll</tt> and <tt>ttl</tt> options, respectively. Not all kernels support the <tt>ttl</tt> option. A broadcast client responds to the first message received by waiting a randomized interval to avoid implosion at the server. It then polls the server in client/server mode using the <tt>iburst</tt> option in order to quickly authenticate the server, calibrate the propagation delay and set the client clock. This normally results in a volley of six client/server exchanges at 2-s intervals during which both the synchronization and cryptographic protocols run concurrently.</p>
+<p>Following the volley, the server continues in listen-only mode and sends no further messages. If for some reason the broadcast server does not respond to these messages, the client will cease transmission and continue in listen-only mode with a default propagation delay. The volley can be avoided by using the <tt>broadcastdelay</tt> command with nonzero argument.</p>
+<p>A server is configured in broadcast mode using the <tt>broadcast</tt> command and specifying the broadcast address of a local interface. If two or more local interfaces are installed with different broadcast addresses, a <tt>broadcast</tt> command is needed for each address. This provides a way to limit exposure in a firewall, for example. A broadcast client is configured using the <tt>broadcastclient</tt> command. </p>
+<p>NTP multicast mode can be used to extend the scope using IPv4 multicast or IPv6 broadcast with defined span. The IANA has assigned IPv4 multicast address 224.0.1.1 and IPv6 address FF05::101 (site local) to NTP, but these addresses should be used only where the multicast span can be reliably constrained to protect neighbor networks. In general, administratively scoped IPv4 group addresses should be used, as described in RFC-2365, or GLOP group addresses, as described in RFC-2770.</p>
+<p>A multicast server is configured using the <tt>broadcast</tt> command, but specifying a multicast address instead of a broadcast address. A multicast client is configured using the <tt>multicastclient</tt> command specifying a list of one or more multicast addresses. Note that there is a subtle distinction between the IPv4 and IPv6 address families. The IPv4 broadcast or mulitcast mode is determined by the IPv4 class. For IPv6 the same distinction can be made using the link-local prefix FF02 for each interface and site-local prefix FF05 for all interfaces.</p>
+<p>It is possible and frequently useful to configure a host as both broadcast client and broadcast server. A number of hosts configured this way and sharing a common broadcast address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.</p>
+<p>Since an intruder can impersonate a broadcast server and inject false time values, broadcast mode should always be cryptographically authenticated. By default, a broadcast association will not be mobilized unless cryptographically authenticated. If necessary, the <tt>auth</tt> option of the <tt>disable</tt> command will disable this feature. The feature can be selectively enabled using the <tt>notrust</tt> option of the <tt>restrict</tt> command.</p>
+<p>With symmetric key cryptography each broadcast server can use the same or different keys. In one scenario on a broadcast LAN,&nbsp;a set of broadcast clients and servers share the same key along with another set that share a different key. Only the clients with matching key will respond to a server broadcast. Further information is on the <a href="authentic.html">Authentication Support</a> page.</p>
+<p>Public key cryptography can be used with some restrictions. If multiple servers belonging to different secure groups share the same broadcast LAN, the clients on that LAN&nbsp;must have the client keys for all of them. This scenario is illustrated in the example on the <a href="autokey.html">Autokey Public Key Authentication</a> page.</p>
+<h4 id="mcst">Manycast Scheme</h4>
+<p>Manycast is an automatic server discovery and configuration paradigm new to NTPv4. It is intended as a means for a client to troll the nearby network neighborhood to find cooperating servers, validate them using cryptographic means and evaluate their time values with respect to other servers that might be lurking in the vicinity. It uses the grab-n'-drop paradigm with the additional feature that active means are used to grab additional servers should the number of associations fall below the <tt>maxclock</tt> option of the <tt>tos</tt> command.</p>
+<p>The manycast paradigm is not the anycast paradigm described in RFC-1546, which is designed to find a single server from a clique of servers providing the same service. The manycast paradigm is designed to find a plurality of redundant servers satisfying defined optimality criteria.</p>
+<p>A manycast client is configured using the <tt>manycastclient</tt> configuration command, which is similar to the <tt>server</tt> configuration command. It sends ordinary client mode messages, but with a broadcast address rather than a unicast address and sends only if less than <tt>maxclock</tt> associations remain and then only at the minimum feasible rate and minimum feasible time-to-live (TTL) hops. The polling strategy is designed to reduce as much as possible the volume of broadcast messages and the effects of implosion due to near-simultaneous arrival of manycast server messages. There can be as many manycast client associations as different addresses, each one serving as a template for future unicast client/server associations.</p>
+<p>A manycast server is configured using the <tt>manycastserver</tt> command, which listens on the specified broadcast address for manycast client messages. If a manycast server is in scope of the current TTL and is itself synchronized to a valid source and operating at a stratum level equal to or lower than the manycast client, it replies with an ordinary unicast server message.</p>
+<p>The manycast client receiving this message mobilizes a preemptable client association according to the matching manycast client template. This requires the server to be cryptographically authenticated and the server stratum to be less than or equal to the client stratum. </p>
+<p>It is possible and frequently useful to configure a host as both manycast client and manycast server. A number of hosts configured this way and sharing a common multicast group address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.</p>
+<p>The use of cryptograpic authentication is always a good idea in any server discovery scheme. Both symmetric key and public key cryptography can be used in the same scenarios as described above for the broadast/multicast scheme.</p>
+<h4 id="pool">Server Pool Scheme</h4>
+<p>The idea of targeting servers on a random basis to distribute and balance the load is not a new one; however, the NTP pool scheme puts this on steroids. At present, several thousand operators around the globe have volunteered their servers for public access. In general, NTP&nbsp;is a lightweight service and servers used for other purposes don't mind an additional small load. The trick is to randomize over the population and minimize the load on any one server while retaining the advantages of multiple servers using the NTP&nbsp;mitigation algorithms.</p>
+<p>To support this service, custom DNS software is used by pool.ntp.org and its subdomains
+ to discover a random selection of participating servers in response to a DNS query.
+ The client receiving this list mobilizes some or all of them, similar to the
+ manycast discovery scheme, and prunes the excess. Unlike <tt>manycastclient</tt>,
+ cryptographic authentication is not required. The pool scheme solicits a single
+ server at a time, compared to <tt>manycastclient</tt> which solicits all servers
+ within a multicast TTL range simultaneously. Otherwise, the pool server discovery
+ scheme operates as manycast does.</p>
+<p>The pool scheme is configured using one or more <tt>pool</tt> commands with DNS names
+ indicating the pool from which to draw. The <tt>pool</tt> command can be used more
+ than once; duplicate servers are detected and discarded. In principle, it is
+ possible to use a configuration file containing a single line <tt>pool
+ pool.ntp.org</tt>. The <a href="http://www.pool.ntp.org/en/use.html">NTP Pool
+ Project</a> offers instructions on using the pool with the <tt>server</tt> command, which is suboptimal but works with older versions of <tt>ntpd</tt> predating the <tt>pool</tt> command. With recent ntpd, consider replacing the
+ multiple <tt>server</tt> commands in their example with a single <tt>pool</tt> command.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver1.html b/html/drivers/driver1.html
new file mode 100644
index 0000000..4518b72
--- /dev/null
+++ b/html/drivers/driver1.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Undisciplined Local Clock</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Undisciplined Local Clock</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+Last update:
+ <!-- #BeginDate format:En2m -->9-May-2014 08:34<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.1.<i>u</i><br>
+ Reference ID: <tt>LOCL</tt><br>
+ Driver ID: <tt>LOCAL</tt></p>
+<h4>Description</h4>
+<p>Note: <strong>We recommend against using this driver.</strong> A much more flexible replacement is described on the <a href="../orphan.html">Orphan Mode</a> page.</p>
+<p>This driver was intended for use in an isolated network where no external source of synchronization such as a radio clock or modem is available. It allows a designated time server to act as a primary server to provide synchronization to other clients on the network. Pick a machine that has a good clock oscillator and configure it with this driver. Set the clock using the best means available, like eyeball-and-wristwatch. Then, point all the other machines at this one or use broadcast mode to distribute time.</p>
+<p>Another application for this driver is if a particular server clock is to be used as the clock of last resort when all other normal synchronization sources have gone away. This is especially useful if that server has an ovenized oscillator. For this you would usually, but not necessarily, configure this driver at a stratum greater than any other likely sources of time, such as the default 5 for this driver, to prevent this driver taking over when legitimate sources elsewhere in the network are available. To further protect the Internet infrastructure from accidental or malicious exposure to this driver, the driver is disabled if another source is available and operating.</p>
+<h4>Monitor Data</h4>
+<p>No <tt>filegen clockstats</tt> monitor data are produced by this driver.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Specifies the frequency offset calibration factor, in parts per million, with default 0.0.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 5.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>LOCL</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+</dl>
+<h4>Additional Information</h4>
+<p><a href="../refclock.html">Reference Clock Drivers</a></p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver10.html b/html/drivers/driver10.html
new file mode 100644
index 0000000..1dd56c1
--- /dev/null
+++ b/html/drivers/driver10.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+<title>Austron 2200A/2201A GPS Receivers</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Austron 2200A/2201A GPS Receivers</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+ Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:56<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.10.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: <tt>GPS_AS2201</tt><br>
+ Serial Port: <tt>/dev/gps<i>u</i></tt>; 9600 baud, 8-bits, no parity<br>
+ Features: <tt>tty_clk</tt></p>
+<h4>Description</h4>
+<p>This driver supports the Austron 2200A/2201A GPS/LORAN Synchronized Clock and Timing Receiver connected via a serial port. It supports several special features of the clock, including the Input Buffer Module, Output Buffer Module, IRIG-B Interface Module and LORAN Assist Module. It requires the RS232 Buffered Serial Interface module for communication with the driver.</p>
+<p>For use with a single computer, the receiver can be connected directly to the receiver. For use with multiple computers, one of them is connected directly to the receiver and generates the polling messages. The other computers just listen to the receiver output directly or through a buffer amplifier. For computers that just listen, <tt>fudge flag2</tt> must be set and the <tt>ppsclock </tt>streams module configured on each of them.</p>
+<p>This receiver is capable of a comprehensive and large volume of statistics and operational data. The specific data collection commands and attributes are embedded in the driver source code; however, the collection process can be enabled or disabled using the flag4 flag. If set, collection is enabled; if not, which is the default, it is disabled. A comprehensive suite of data reduction and summary scripts is in the ./scripts/stats directory</p>
+of the ntp3 distribution.
+<h4>Monitor Data</h4>
+<p>When enabled by the <tt>flag4</tt> fudge flag, every received timecode is written as-is to the <tt>clockstats</tt> file.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Set for computers that listen-only.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
+</dl>
+<h4>Additional Information</h4>
+<p><a href="../refclock.html">Reference Clock Drivers</a></p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver11.html b/html/drivers/driver11.html
new file mode 100644
index 0000000..f3c9a81
--- /dev/null
+++ b/html/drivers/driver11.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+<title>Arbiter 1088A/B GPS Receiver</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Arbiter 1088A/B GPS Receiver</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+ Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:56<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.11.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: <tt>GPS_ARBITER</tt><br>
+ Serial Port: <tt>/dev/gps<i>u</i></tt>; 9600 baud, 8-bits, no parity<br>
+ Features: <tt>tty_clk</tt></p>
+<h4>Description</h4>
+<p>This driver supports the Arbiter 1088A/B Satellite Controlled Clock. The claimed accuracy of this clock is 100 ns relative to the PPS output when receiving four or more satellites.</p>
+<p>The receiver should be configured before starting the NTP daemon, in order to establish reliable position and operating conditions. It does not initiate surveying or hold mode. For use with NTP, the daylight savings time feature should be disables (<tt>D0</tt> command) and the broadcast mode set to operate in UTC (<tt>BU</tt> command).</p>
+<p>The timecode format supported by this driver is selected by the poll sequence <tt>B5</tt>, which initiates a line in the following format to be repeated once per second until turned off by the <tt>B0</tt> command.</p>
+<p>Format <tt>B5</tt> (24 ASCII printing characters):</p>
+<pre>&lt;cr&gt;&lt;lf&gt;i yy ddd hh:mm:ss.000bbb
+
+on-time = &lt;cr&gt;
+i = synchronization flag (' ' = locked, '?' = unlocked)
+yy = year of century
+ddd = day of year
+hh:mm:ss = hours, minutes, seconds
+.000 = fraction of second (not used)
+bbb = tailing spaces for fill</pre>
+<p>The alarm condition is indicated by a '?' at i, which indicates the receiver is not synchronized. In normal operation, a line consisting of the timecode followed by the time quality character (TQ) followed by the receiver status string (SR) is written to the clockstats file.</p>
+<p>The time quality character is encoded in IEEE P1344 standard:</p>
+<p>Format <tt>TQ</tt> (IEEE P1344 estimated worst-case time quality)</p>
+<pre>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock locked, maximum accuracy
+F&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock failure, time not reliable
+4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 1 us
+5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 10 us
+6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 100 us
+7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 1 ms
+8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 10 ms
+9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 100 ms
+A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 1 s
+B&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock unlocked, accuracy &lt; 10 s</pre>
+<p>The status string is encoded as follows:</p>
+<p>Format <tt>SR</tt> (25 ASCII printing characters)</p>
+<pre>V=vv S=ss T=t P=pdop E=ee
+
+vv = satellites visible
+ss = relative signal strength
+t = satellites tracked
+pdop = position dilution of precision (meters)
+ee = hardware errors</pre>
+<p>A three-stage median filter is used to reduce jitter and provide a dispersion measure. The driver makes no attempt to correct for the intrinsic jitter of the radio itself.</p>
+<h4>Monitor Data</h4>
+<p>When enabled by the <tt>flag4</tt> fudge flag, an additional line containing the latitude, longitude, elevation and optional deviation data is written to the <tt>clockstats</tt> file. The deviation data operates with an external pulse-per-second (PPS) input, such as a cesium oscillator or another radio clock. The PPS input should be connected to the B event channel and the radio initialized for deviation data on that channel. The deviation data consists of the mean offset and standard deviation of the external PPS signal relative the GPS signal, both in microseconds over the last 16 seconds.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
+</dl>
+<h4>Additional Information</h4>
+<p><a href="../refclock.html">Reference Clock Drivers</a></p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver12.html b/html/drivers/driver12.html
new file mode 100644
index 0000000..3b6fc15
--- /dev/null
+++ b/html/drivers/driver12.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+<title>KSI/Odetics TPRO/S IRIG Interface</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>KSI/Odetics TPRO/S IRIG Interface</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+ Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:56<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.12.<i>u</i><br>
+ Reference ID: <tt>IRIG</tt><br>
+ Driver ID: <tt>IRIG_TPRO</tt><br>
+ TPRO Device: <tt>/dev/tpro<i>u</i></tt><br>
+ Requires: KSI/Odetics device driver, <tt>/usr/include/sys/tpro.h</tt> header file</p>
+<h4>Description</h4>
+<p>This driver supports the KSI/Odetics TPRO and TPRO-SAT IRIG-B Decoder, which is a module connected directly to the SBus of a Sun workstation. The module works with the IRIG-B signal generated by several radio clocks, including those made by Arbiter, Austron, Odetics, Spectracom and TrueTime, among others, although it is generally an add- on option. In the case of the TPRO-SAT, the module is an integral part of a GPS receiver, which serves as the primary timing source.</p>
+<p>Using the TPRO interface as a NTP reference clock provides precision time only to ntpd and its clients. With suitable kernel modifications, it is possible to use the TPRO as the CPU system clock, avoiding errors introduced by the CPU clock oscillator wander. See the <a href="../kern.html">A Kernel Model for Precision Timekeeping </a>page for further details.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>IRIG</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+</dl>
+<h4>Additional Information</h4>
+<p><a href="../refclock.html">Reference Clock Drivers</a></p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver16.html b/html/drivers/driver16.html
new file mode 100644
index 0000000..74a3bd6
--- /dev/null
+++ b/html/drivers/driver16.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (Win95; U) [Netscape]">
+ <meta name="Author" content="Ganesh Ramasivan">
+ <title>Bancomm bc635VME Time and Frequency Processor</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>bc635VME/bc350VXI Time and Frequency Processor</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.16.<i>u</i><br>
+ Reference ID: BTFP<br>
+ Driver ID: GPS_BANCOMM<br>
+ Bancomm Device <tt>/dev/btfp0</tt><br>
+ Requires: Bancomm bc635 TFP device module driver for SunOS 4.x/SunOS 5.x</p>
+ <h4>Description</h4>
+ <p>This is the clock driver for the Bancomm bc635VME Time and Frequency Processor. It requires the BANCOMM bc635VME bc350VXI Time and Frequency Processor Module Driver for SunOS 4.x/SunOS 5.x UNIX Systems.</p>
+ <p>Most of this code is originally from refclock_bancomm.c with thanks. It has been modified and tested on an UltraSparc IIi-cEngine running Solaris 2.6. A port for HPUX is not available henceforth.</p>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver18.html b/html/drivers/driver18.html
new file mode 100644
index 0000000..02fb5d2
--- /dev/null
+++ b/html/drivers/driver18.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+<title>NIST/USNO/PTB Modem Time Services</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>NIST/USNO/PTB Modem Time Services</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+ Last update:
+ <!-- #BeginDate format:En2m -->1-Dec-2012 10:44<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.18.<i>u</i><br>
+ Reference ID: <tt>NIST | USNO | PTB | WWVB</tt><br>
+ Driver ID: <tt>ACTS_MODEM</tt><br>
+ Serial Port: <tt>/dev/acts<i>u</i></tt>; 9600 baud, 8-bits, no parity<br>
+ Features: <tt>tty_clk</tt><br>
+ Requires: <tt>/usr/include/sys/termios.h</tt> header file with modem control and a dial-out (cua)&nbsp;device.</p>
+<h4>Description</h4>
+<p>This driver supports the US (NIST and USNO) and European (PTB (Germany), NPL (UK), etc.) modem time services, as well as Spectracom GPS&nbsp;and WWVB receivers connected via a modem. The driver periodically dials a number from a telephone list, receives the timecode data and calculates the local clock correction. It is designed primarily for backup when neither a radio clock nor connectivity to Internet time servers are available. It can also be configured to operate full period.</p>
+<p>For best results the indicated time must be corrected for the modem and telephone circuit propagation delays, which can reach 200 ms or more. For the NIST service, corrections are determined automatically by measuring the roundtrip delay of echoed characters. With this service the absolute accuracy is typically a millisecond or two. Corrections for the other services must be determined by other means. With these services variations from call to call and between messages during a call are typically a few milliseconds, occasionally higher.</p>
+<p>This driver requires a 9600-bps modem with a Hayes-compatible command set and control over the modem data terminal ready (DTR) control line. The actual line speed ranges from 1200 bps with USNO&nbsp;to 14,400 bps with NIST. The modem setup string is hard-coded in the driver and may require changes for nonstandard modems or special circumstances.</p>
+<p>There are three modes of operation selected by the <tt>mode</tt> keyword in the <tt>server</tt> configuration command. In manual mode (2) the calling program is initiated by setting fudge <tt>flag1</tt>. This can be done manually using <tt>ntpq</tt>, or by a cron job. In auto mode (0) <tt>flag1</tt> is set at each poll event. In backup mode (1) <tt>flag1</tt> is set at each poll event, but only if no other synchronization sources are available.</p>
+<p>When <tt>flag1</tt> is set, the calling program dials the first number in the list specified by the <tt>phone</tt> command. If the call fails for any reason, the program dials the second number and so on. The phone number is specified by the Hayes ATDT prefix followed by the number itself, including the prefix and long-distance digits and delay code, if necessary. The <tt>flag1</tt> is reset and the calling program terminated if (a) valid clock update has been determined, (b) no more numbers remain in the list, (c) a device fault or timeout occurs or (d) fudge <tt>flag1</tt> is reset manually using <tt>ntpq</tt>.</p>
+<p>The driver automatically recognizes the message format of each modem time service. It selects the parsing algorithm depending on the message length. There is some hazard should the message be corrupted. However, the data format is checked carefully and only if all checks succeed is the message accepted. Corrupted lines are discarded without complaint. Once the service is known, the reference identifier for the driver is set to NIST, USNO, PTB or WWVB as appropriate.</p>
+<p>The Spectracom radio can be connected via a modem if the radio is configured to send time codes continuously at 1-s intervals. In principle, fudge <tt>flag2</tt> enables port locking, allowing the modem to be shared when not in use by this driver. At least on Solaris with the current NTP I/O routines, this results in lots of ugly error messages.</p>
+<p>The <tt>minpoll</tt> and <tt>maxpoll</tt> keywords of the server configuration command can be used to limit the intervals between calls. The recommended settings are 12 (1.1 hours) for <tt>minpoll</tt> and 17 (36 hours) for <tt>maxpoll</tt>. Ordinarily, the poll interval will start at <tt>minpoll</tt> and ramp up to <tt>maxpoll</tt> in a day or two.</p>
+<h4>US Phone Numbers and Formats</h4>
+<p>Note: Phone numbers include the entire Hayes modem command, including the <tt>ATDT</tt> and other control codes as may be necessary. For most cases only the <tt>ATDT</tt> may be necessary.</p>
+<p><a href="http://www.boulder.nist.gov/timefreq">National Institute of Science and Technology (NIST)</a></p>
+<p>Phone: (303) 494-4774 (Boulder, CO); (808) 335-4721 (Hawaii)</p>
+<p><a href="http://www.boulder.nist.gov/timefreq/service/acts.htm">Data Format</a></p>
+<p><tt>National Institute of Standards and Technology<br>
+ Telephone Time Service, Generator 3B<br>
+ Enter question mark &quot;?&quot; for HELP<br>
+ MJD YR MO DA H M S ST S UT1 msADV &lt;OTM&gt;<br>
+ 47999 90-04-18 21:39:15 50 0 +.1 045.0 UTC(NIST) *<br>
+ 47999 90-04-18 21:39:16 50 0 +.1 045.0 UTC(NIST) #<br>
+ ...</tt></p>
+<p><tt>MJD</tt>, <tt>YR</tt>, <tt>ST</tt>, <tt>UT1</tt> and <tt>UTC(NIST)</tt> are not used by this driver. The <tt>&lt;OTM&gt;</tt> on-time character &quot;<tt>*</tt>&quot; changes to &quot;<tt>#</tt>&quot;&nbsp;when the delay correction is valid.</p>
+<p><a href="http://tycho.usno.navy.mil">US Naval Observatory (USNO)</a></p>
+<p>Phone: (202) 762-1594 (Washington, DC); (719) 567-6742 (Boulder, CO)</p>
+<p><a href="http://tycho.usno.navy.mil/modem_time.html">Data Format</a> (two lines, repeating at one-second intervals)</p>
+<p><tt>jjjjj nnn hhmmss UTC</tt></p>
+<p>* on-time character for previous timecode message<br>
+ jjjjj modified Julian day number (not used)<br>
+ nnn day of year<br>
+ hhmmss second of day</p>
+<p><a href="tf582_4.html">European Phone Numbers and Formats</a></p>
+<p><a href="http://www.spectracomcorp.com">Spectracom GPS and WWVB Receivers</a></p>
+<p>If a modem is connected to a Spectracom receiver, this driver will call it and retrieve the time in one of two formats, 0 and 2. Ordinarily, the receiver requires a <tt>T</tt> in order to return the timecode. As this driver does not send data via the modem, it must either be configured in continuous mode or be polled by another local driver.</p>
+<h4>Monitor Data</h4>
+<p>The received timecode is written as-is to the <tt>clockstats</tt> file along with the Hayes connection and hang-up commands and result codes.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Set by the driver to (one of) <tt>NIST</tt>, <tt>USNO</tt>, <tt>PTB</tt> or <tt>WWVB</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Initiate a call if 1. Automatically reset by program.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Enables port locking if 1, disables if 0 (default).</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+</dl>
+<h4>Additional Information</h4>
+<p><a href="../refclock.html">Reference Clock Drivers</a>&nbsp;</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver19.html b/html/drivers/driver19.html
new file mode 100644
index 0000000..2c8278f
--- /dev/null
+++ b/html/drivers/driver19.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+<title>Heath WWV/WWVH Receiver</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Heath WWV/WWVH Receiver</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+ Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:56<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.19.<i>u</i><br>
+ Reference ID: <tt>WWV</tt><br>
+ Driver ID: <tt>WWV_HEATH</tt><br>
+ Serial Port: <tt>/dev/heath<i>u</i></tt>; 1200 baud, 8-bits, no parity<br>
+ Features: <tt>tty_clk</tt><br>
+ Requires: <tt>/usr/include/sys/termios.h</tt> header file with modem control</p>
+<h4>Description</h4>
+<p>This driver supports the Heath GC-1000 Most Accurate Clock, with RS232C Output Accessory. This is a WWV/WWVH receiver somewhat less robust than other supported receivers. It's claimed accuracy is 100 ms when actually synchronized to the broadcast signal, but this doesn't happen even most of the time, due to propagation conditions, ambient noise sources, etc. When not synchronized, the accuracy is at the whim of the internal clock oscillator, which can wander into the sunset without warning. Since the indicated precision is 100 ms, expect a host synchronized only to this thing to wander to and fro, occasionally being rudely stepped when the offset exceeds the default CLOCK_MAX of 128 ms.</p>
+<p>The internal DIPswitches should be set to operate at 1200 baud in MANUAL mode and the current year. The external DIPswitches should be set to GMT and 24-hour format. It is very important that the year be set correctly in the DIPswitches; otherwise, the day of year will be incorrect after 28 April of a normal or leap year.</p>
+<p>In MANUAL mode the clock responds to a rising edge of the request to send (RTS) modem control line by sending the timecode. Therefore, it is necessary that the operating system implement the <tt>TIOCMBIC</tt> and <tt>TIOCMBIS</tt> ioctl system calls and <tt>TIOCM_RTS</tt> control bit. Present restrictions require the use of a POSIX-compatible programming interface, although other interfaces may work as well.</p>
+<p>The clock message consists of 23 ASCII printing characters in the following format:</p>
+<pre>hh:mm:ss.f&nbsp;&nbsp;&nbsp;&nbsp; dd/mm/yr&lt;cr&gt;
+
+hh:mm:ss.f = hours, minutes, seconds
+f = deciseconds ('?' when out of spec)
+dd/mm/yr = day, month, year</pre>
+<p>The alarm condition is indicated by '?', rather than a digit, at A. Note that 0?:??:??.? is displayed before synchronization is first established and hh:mm:ss.? once synchronization is established and then lost again for about a day.</p>
+<p>A fudge time1 value of .07 s appears to center the clock offset residuals.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>WWV</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Not used by this driver</dd>
+</dl>
+Additional Information
+<p><a href="../refclock.html">Reference Clock Drivers</a>&nbsp;</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver20.html b/html/drivers/driver20.html
new file mode 100644
index 0000000..6391e86
--- /dev/null
+++ b/html/drivers/driver20.html
@@ -0,0 +1,432 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Generic NMEA GPS Receiver</title>
+ <!-- Changed by: Harlan &, 31-Mar-2014 -->
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ <style type="text/css">
+ table.dlstable { font-size:85%; }
+ td.ttf{ font-family:Courier; font-weight:bold; }
+ </style></head>
+
+
+
+ <body>
+ <h3>Generic NMEA GPS Receiver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Mar-2014 03:55<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+
+ <p>
+ Address: 127.127.20.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: <tt>GPS_NMEA</tt><br>
+ Serial Port: <tt>/dev/gps<i>u</i></tt>; 4800 - 115200 bps, 8-bits, no parity<br>
+ Serial Port: <tt>/dev/gpspps<i>u</i></tt>; for just the PPS signal (this
+ is tried first for PPS, before <tt>/dev/gps<i>u</i></tt>)<br>
+ Serial Port: <tt>/dev/gps<i>u</i></tt>; symlink to server:port (for nmead)<br>
+ Features: <tt>tty_clk</tt>
+ </p>
+
+ <h4>Description</h4>
+
+ <p>
+ This driver supports GPS receivers with
+ the <tt>$GPRMC</tt>, <tt>$GPGLL</tt>, <tt>$GPGGA</tt>, <tt>$GPZDA</tt>
+ and <tt>$GPZDG</tt> NMEA sentences by default.&nbsp; Note that Accord's
+ custom NMEA sentence <tt>$GPZDG</tt> reports using the GPS timescale,
+ while the rest of the sentences report UTC.&nbsp; The difference between
+ the two is a whole number of seconds which increases with each leap
+ second insertion in UTC.&nbsp; To avoid problems mixing UTC and GPS
+ timescales, the driver disables processing of UTC sentences
+ once <tt>$GPZDG</tt> is received.
+ </p>
+ <p>
+ The driver expects the receiver to be set up to transmit at least one
+ supported sentence every second.
+ </p>
+ <p>
+ The accuracy depends on the receiver used. Inexpensive GPS models are
+ available with a claimed PPS signal accuracy of
+ 1 &mu;s or better relative to the broadcast
+ signal. However, in most cases the actual accuracy is limited by the
+ precision of the timecode and the latencies of the serial interface and
+ operating system.
+ </p>
+ <p>
+ If the Operating System supports PPSAPI
+ (<a href="http://www.ietf.org/rfc/rfc2783.txt">RFC 2783</a>), fudge flag1
+ 1 enables its use.
+ </p>
+ <p>
+ The various GPS sentences that this driver recognises look like this:<br>
+ (others quietly ignored)
+ </p>
+
+ <p><table class="dlstable" border="1">
+ <caption>Accepted NMEA sentences</caption>
+ <tbody><tr>
+ <th>Sentence</th>
+ <th>Vendor</th>
+ </tr><tr>
+ <td class="ttf">$GPRMC,UTC,POS_STAT,LAT,LAT_REF,LON,LON_REF,SPD,HDG,DATE,MAG_VAR,MAG_REF*CS&lt;cr&gt;&lt;lf&gt;</td>
+ </tr><tr>
+ <td class="ttf">$GPGLL,LAT,LAT_REF,LON,LON_REF,UTC,POS_STAT*CS&lt;cr&gt;&lt;lf&gt;</td>
+ </tr><tr>
+ <td class="ttf">$GPGGA,UTC,LAT,LAT_REF,LON,LON_REF,FIX_MODE,SAT_USED,HDOP,ALT,ALT_UNIT,GEO,G_UNIT,D_AGE,D_REF*CS&lt;cr&gt;&lt;lf&gt;</td>
+ </tr><tr>
+ <td class="ttf">$GPZDA,UTC,DD,MM,YYYY,TH,TM,*CS&lt;cr&gt;&lt;lf&gt;</td>
+ </tr><tr>
+ <td class="ttf">$GPZDG,GPSTIME,DD,MM,YYYY,AA.BB,V*CS&lt;cr&gt;&lt;lf&gt;</td>
+ <td>Accord</td>
+ </tr>
+ </tbody></table></p>
+
+ <p><table class="dlstable" border="1">
+ <caption>NMEA data items</caption>
+ <tbody><tr>
+ <th>Symbol</th>
+ <th>Meaning and Format</th>
+ </tr>
+
+ <tr>
+ <td class="ttf">UTC</td>
+ <td>Time of day on UTC timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.fff])</td>
+ </tr><tr>
+ <td class="ttf">POS_STAT</td>
+ <td>Position status. (A = Data valid, V = Data invalid)</td>
+ </tr><tr>
+ <td class="ttf">LAT</td>
+ <td>Latitude (llll.ll)</td>
+ </tr><tr>
+ <td class="ttf">LAT_REF</td>
+ <td>Latitude direction. (N = North, S = South)</td>
+ </tr><tr>
+ <td class="ttf">LON</td>
+ <td>Longitude (yyyyy.yy)</td>
+ </tr><tr>
+ <td class="ttf">LON_REF</td>
+ <td>Longitude direction (E = East, W = West)</td>
+ </tr><tr>
+ <td class="ttf">SPD</td>
+ <td>Speed over ground. (knots) (x.x)</td>
+ </tr><tr>
+ <td class="ttf">HDG</td>
+ <td>Heading/track made good (degrees True) (x.x)</td>
+ </tr><tr>
+ <td class="ttf">DATE</td>
+ <td>Date (ddmmyy)</td>
+ </tr><tr>
+ <td class="ttf">MAG_VAR</td>
+ <td>Magnetic variation (degrees) (x.x)</td>
+ </tr><tr>
+ <td class="ttf">MAG_REF</td>
+ <td>Magnetic variation (E = East, W = West)</td>
+ </tr><tr>
+ <td class="ttf">FIX_MODE</td>
+ <td>Position Fix Mode (0 = Invalid, &gt;0 = Valid)</td>
+ </tr><tr>
+ <td class="ttf">SAT_USED</td>
+ <td>Number of Satellites used in solution</td>
+ </tr><tr>
+ <td class="ttf">HDOP</td>
+ <td>Horizontal Dilution of Precision</td>
+ </tr><tr>
+ <td class="ttf">ALT</td>
+ <td>Antenna Altitude</td>
+ </tr><tr>
+ <td class="ttf">ALT_UNIT</td>
+ <td>Altitude Units (Metres/Feet)</td>
+ </tr><tr>
+ <td class="ttf">GEO</td>
+ <td>Geoid/Elipsoid separation</td>
+ </tr><tr>
+ <td class="ttf">G_UNIT</td>
+ <td>Geoid units (M/F)</td>
+ </tr><tr>
+ <td class="ttf">D_AGE</td>
+ <td>Age of last DGPS Fix</td>
+ </tr><tr>
+ <td class="ttf">D_REF</td>
+ <td>Reference ID of DGPS station</td>
+ </tr><tr>
+ <td class="ttf">GPSTIME</td>
+ <td>Time of day on GPS timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.f])</td>
+ </tr><tr>
+ <td class="ttf">DD</td>
+ <td>Day of the month (1-31)</td>
+ </tr><tr>
+ <td class="ttf">MM</td>
+ <td>Month of the year (1-12)</td>
+ </tr><tr>
+ <td class="ttf">YYYY</td>
+ <td>Year</td>
+ </tr><tr>
+ <td class="ttf">AA.BB</td>
+ <td>Denotes the signal strength (should be &lt; 05.00)</td>
+ </tr><tr>
+ <td class="ttf">V</td>
+ <td>GPS sync status<br>
+ &nbsp;&nbsp;&nbsp;'0' =&gt; INVALID time,<br>
+ &nbsp;&nbsp;&nbsp;'1' =&gt; accuracy of +/- 20ms,<br>
+ &nbsp;&nbsp;&nbsp;'2' =&gt; accuracy of +/- 100ns</td>
+ </tr><tr>
+ <td class="ttf">CS</td>
+ <td> Checksum</td>
+ </tr><tr>
+ <td class="ttf">&lt;cr&gt;&lt;lf&gt;</td>
+ <td>Sentence terminator.</td>
+ </tr>
+ </tbody></table></p>
+
+
+ <h4>The 'mode' byte</h4>
+
+ <p>
+ Specific GPS sentences and bitrates may be selected by setting bits of
+ the 'mode' in the server configuration line:<br> &nbsp;&nbsp;<tt>server
+ 127.127.20.x mode X</tt>
+ </p>
+
+ <table border="1">
+ <caption>mode byte bits and bit groups</caption>
+ <tbody><tr>
+ <th align="center">Bit</th>
+ <th align="center">Decimal</th>
+ <th align="center">Hex</th>
+ <th align="left">Meaning</th>
+ </tr>
+
+ <tr>
+ <td align="center">0</td>
+ <td align="center">1</td>
+ <td align="center">1</td>
+ <td>process <tt>$GPMRC</tt></td>
+ </tr><tr>
+ <td align="center">1</td>
+ <td align="center">2</td>
+ <td align="center">2</td>
+ <td>process <tt>$GPGGA</tt></td>
+ </tr><tr>
+ <td align="center">2</td>
+ <td align="center">4</td>
+ <td align="center">4</td>
+ <td>process <tt>$GPGLL</tt></td>
+ </tr><tr>
+ <td align="center">3</td>
+ <td align="center">8</td>
+ <td align="center">8</td>
+ <td>process <tt>$GPZDA</tt> or <tt>$GPZDG</tt></td>
+ </tr><tr>
+ <td rowspan="6" align="center">4-6</td>
+ <td align="center">0</td>
+ <td align="center">0</td>
+ <td>linespeed 4800 bps</td>
+ </tr><tr>
+ <td align="center">16</td>
+ <td align="center">0x10</td>
+ <td>linespeed 9600 bps</td>
+ </tr><tr>
+ <td align="center">32</td>
+ <td align="center">0x20</td>
+ <td>linespeed 19200 bps</td>
+ </tr><tr>
+ <td align="center">48</td>
+ <td align="center">0x30</td>
+ <td>linespeed 38400 bps</td>
+ </tr><tr>
+ <td align="center">64</td>
+ <td align="center">0x40</td>
+ <td>linespeed 57600 bps</td>
+ </tr><tr>
+ <td align="center">80</td>
+ <td align="center">0x50</td>
+ <td>linespeed 115200 bps</td>
+ </tr><tr>
+ <td align="center">7</td>
+ <td align="center">128</td>
+ <td align="center">0x80</td>
+ <td>Write the sub-second fraction of the receive time stamp to the
+ clockstat file for all recognised NMEA sentences. This can be used to
+ get a useful value for fudge time2.<br><strong>Caveat:</strong> This
+ will fill your clockstat file rather fast. Use it only temporarily to
+ get the numbers for the NMEA sentence of your choice.</td>
+ </tr>
+ </tr><tr>
+ <td align="center">8</td>
+ <td align="center">256</td>
+ <td align="center">0x100</td>
+ <td>process <tt>$PGRMF</tt></td>
+ </tr><tr>
+ <td align="center">9-15</td>
+ <td align="center"></td>
+ <td align="center">0xFE00</td>
+ <td>reserved - leave 0</td>
+ </tr><tr>
+ <td align="center">16</td>
+ <td align="center">65536</td>
+ <td align="center">0x10000</td>
+ <td>Append extra statistics to the clockstats line.
+ Details below.</td>
+ </tr>
+ </tbody></table>
+
+
+ <p>
+ The default (mode 0) is to process all supported sentences at a linespeed
+ of 4800 bps, which results in the first one received and recognised in
+ each cycle being used.&nbsp; If only specific sentences should be
+ recognised, then the mode byte must be chosen to enable only the selected
+ ones.&nbsp; Multiple sentences may be selected by adding their mode bit
+ values, but of those enabled still only the first received sentence in a
+ cycle will be used.&nbsp; Using more than one sentence per cycle is
+ impossible, because
+ </p><ul>
+ <li>there is only <a href="#fudgetime2">fudge time2</a> available to
+ compensate for transmission delays but every sentence would need a
+ different one and
+ </li><li>using more than one sentence per cycle overstuffs the internal data
+ filters.
+ </li></ul>
+ The driver uses 4800 bits per second by default, but faster bitrates can
+ be selected using bits 4 to 6 of the mode field.
+ <p></p>
+
+ <p>
+ <strong>Caveat:</strong> Using higher line speeds does not necessarily
+ increase the precision of the timing device.&nbsp; Higher line speeds are
+ not necessarily helpful for the NMEA driver, either.&nbsp; They can be
+ used to accomodate for an amount of data that does not fit into a
+ 1-second cycle at 4800 bps, but high-speed high-volume NMEA data is likely
+ to cause trouble with the serial line driver since NMEA supports no
+ protocol handshake.&nbsp; Any device that is exclusively used for time
+ synchronisation purposes should be configured to transmit the relevant
+ data only, e.g. one <tt>$GPRMC</tt> or <tt>$GPZDA</tt> per second, at a
+ linespeed of 4800 bps or 9600 bps.
+ </p>
+
+ <h4>Monitor Data</h4>
+
+ <p>The last GPS sentence that is accepted or rejected is written to the
+ clockstats file and available with <code>ntpq -c clockvar</code>.
+ (Logging the rejected sentences lets you see/debug why they were rejected.)
+ Filtered sentences are not logged.</p>
+
+ <p>
+ If the 0x10000 mode bit is on and clockstats is enabled, several extra
+ counters will be appended to the NMEA sentence that gets logged.
+ For example:
+<pre>
+56299 76876.691 127.127.20.20 $GPGGA,212116.000,3726.0785,N,12212.2605,W,1,05,2.0,17.0,M,-25.7,M,,0000*5C 228 64 0 0 64 0
+</pre>
+ </p>
+
+ <table border="1">
+ <caption>Clockstats</caption>
+ <tbody><tr>
+ <th align="center">Column</th>
+ <th align="center">Sample</th>
+ <th align="left">Meaning</th>
+ </tr>
+
+ <tr>
+ <td align="center">1</td>
+ <td align="center">56299</td>
+ <td>MJD</td>
+ </tr><tr>
+ <td align="center">2</td>
+ <td align="center">76876.691</td>
+ <td>Time of day in seconds</td>
+ </tr><tr>
+ <td align="center">3</td>
+ <td align="center">127.127.20.20</td>
+ <td>IP Address from server config line</td>
+ </tr><tr>
+ <td align="center">4</td>
+ <td align="center">$GPGGA,...0*5C</td>
+ <td>NMEA Sentence</td>
+ </tr><tr>
+ <td align="center">5</td>
+ <td align="center">228</td>
+ <td>Number of sentences received</td>
+ </tr><tr>
+ <td align="center">6</td>
+ <td align="center">64</td>
+ <td>Number of sentences accepted and used for timekeeping</td>
+ </tr><tr>
+ <td align="center">7</td>
+ <td align="center">0</td>
+ <td>Number of sentences rejected because they were marked invalid (poor signal)</td>
+ </tr><tr>
+ <td align="center">8</td>
+ <td align="center">0</td>
+ <td>Number of sentences rejected because of bad checksum or invalid date/time</td>
+ </tr><tr>
+ <td align="center">9</td>
+ <td align="center">64</td>
+ <td>Number of sentences filtered by mode bits or same second</td>
+ </tr><tr>
+ <td align="center">10</td>
+ <td align="center">0</td>
+ <td>Number of PPS pulses used, overrides NMEA sentences</td>
+ </tr>
+ </tbody></table>
+
+ Sentences like $GPGSV that don't contain the time will get
+ counted in the total but otherwise ignored.
+
+ <p>
+ <a href="https://support.ntp.org/bin/view/Support/ConfiguringNMEARefclocks">Configuring
+ NMEA Refclocks</a> might give further useful hints for specific hardware
+ devices that exhibit strange or curious behaviour.
+ </p>
+
+ <p>
+ To make a specific setting, select the corresponding decimal values from
+ the mode byte table, add them all together and enter the resulting
+ decimal value into the clock configuration line.
+ </p>
+
+ <h4>Setting up the Garmin GPS-25XL</h4>
+
+ Switch off all output with by sending it the following string.
+ <pre>"$PGRMO,,2&lt;cr&gt;&lt;lf&gt;"</pre>
+ <p>Now switch only $GPRMC on by sending it the following string.</p>
+ <pre>"$PGRMO,GPRMC,1&lt;cr&gt;&lt;lf&gt;"</pre>
+
+ <p>On some systems the PPS signal isn't switched on by default. It can be
+ switched on by sending the following string.</p>
+ <pre>"$PGRMC,,,,,,,,,,,,2&lt;cr&gt;&lt;lf&gt;"</pre>
+
+ <h4>Fudge Factors</h4>
+
+ <dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the PPS time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><a name="fudgetime2"><tt>time2 <i>time</i></tt></a></dt>
+ <dd>Specifies the serial end of line time offset calibration factor, in seconds and fraction, with default
+ 0.0.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with
+ default <tt>GPS</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Disable PPS signal processing if 0 (default); enable PPS signal processing if 1.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>If PPS signal processing is enabled, capture the pulse on the rising edge if 0 (default); capture on the
+ falling edge if 1.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>If PPS signal processing is enabled, use the <tt>ntpd</tt> clock discipline if 0 (default); use the kernel
+ discipline if 1.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Obscures location in timecode: 0 for disable (default), 1 for enable.</dd>
+ </dl>
+
+ <p>Additional Information</p>
+ <p><tt>flag1</tt>, <tt>flag2</tt>, and <tt>flag3</tt> are ignored under Windows.</p>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body></html>
diff --git a/html/drivers/driver22.html b/html/drivers/driver22.html
new file mode 100644
index 0000000..6e01a38
--- /dev/null
+++ b/html/drivers/driver22.html
@@ -0,0 +1,98 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>PPS Clock Discipline</title>
+<!-- Changed by: Harlan &, 31-Mar-2014 -->
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>PPS Clock Discipline</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+ Last change:
+ <!-- #BeginDate format:En2m -->31-Mar-2014 07:46<!-- #EndDate -->
+ UTC</p>
+ <hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.22.<i>u</i><br>
+ Reference ID: <tt>PPS</tt><br>
+ Driver ID: <tt>PPS</tt><br>
+ Serial or Parallel Port: <tt>/dev/pps<i>u</i></tt><br>
+ Requires: PPSAPI signal interface for PPS signal processing.</p>
+<p>Note: This driver supersedes an older one of the same name. The older driver operated with several somewhat archaic signal interface devices, required intricate configuration and was poorly documented. This driver requires the Pulse per Second API (PPSAPI)<sup>1</sup>. Note also that the <tt>pps</tt> configuration command has been obsoleted by this driver.</p>
+<h4>Description</h4>
+<p>This driver furnishes an interface for the pulse-per-second (PPS) signal produced by a cesium clock, radio clock or related devices. It can be used to augment the serial timecode generated by a GPS receiver, for example. It can be used to remove accumulated jitter and re-time a secondary server when synchronized to a primary server over a congested, wide-area network and before redistributing the time to local clients. The driver includes extensive signal sanity checks and grooming algorithms. A range gate and frequency discriminator reject noise and signals with incorrect frequency. A multiple-stage median filter rejects jitter due to hardware interrupt and operating system latencies. A trimmed-mean algorithm determines the best time samples. With typical workstations and processing loads, the incidental jitter can be reduced to a few microseconds.</p>
+<p>While this driver can discipline the time and frequency relative to the PPS source, it cannot number the seconds. For this purpose an auxiliary source is required, ordinarily a radio clock operated as a primary reference (stratum 1) source; however, another NTP time server can be used as well. For this purpose, the auxiliary source should be specified as the prefer peer, as described in the <a href="../prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page.</p>
+<p>The driver requires the PPSAPI interface<sup>1</sup>, which is a proposed IETF standard. The interface consists of the <tt>timepps.h</tt> header file and associated kernel support. Support for this interface is included in current versions of Solaris, FreeBSD and Linux and proprietary versions of Tru64 (Alpha) and SunOS. See the <a href="../pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page for further information.</p>
+<p>The PPS source can be connected via a serial or parallel port, depending on the hardware and operating system. A serial port can be dedicated to the PPS source or shared with another device; however, if dedicated the data leads should not be connected, as noise or unexpected signals can cause <tt>ntpd</tt> to exit.</p>
+<p>A radio clock is usually connected via a serial port and the PPS source
+ connected via a level converter to the data carrier detect (DCD)
+ pin (DB-9 pin 1, DB-25 pin 8) of the same connector. In some systems
+ where a parallel port and driver are available, the PPS signal can
+ be connected directly to the ACK pin (DB25 pin 10) of the connector.
+ Whether the PPS signal is connected via a dedicated port or shared with another
+ device, the driver opens the device <tt>/dev/pps%d</tt>,
+ where <tt>%d</tt> is the unit number. As with other drivers, links can be
+ used to redirect the logical name to the actual physical device.</p>
+<p>The driver normally operates like any other driver and uses the same mitigation
+ algorithms and PLL/FLL clock discipline incorporated in the daemon.
+ If kernel PLL/FLL support is available, the kernel PLL/FLL clock
+ discipline can be used instead. The default behavior is not to use
+ the kernel PPS clock discipline, even if present. This driver incorporates
+ a good deal of signal processing to reduce jitter using the median
+ filter algorithm in the driver. As the result, performance
+ with <tt>minpoll</tt> configured at 4 (16s) is generally
+ better than the kernel PPS discipline. However, fudge flag 3 can
+ be used to enable the kernel PPS discipline if necessary.</p>
+<p>This driver
+ is enabled only under one of two conditions (a) a prefer peer other than
+ this driver is among the survivors of the mitigation algorithms or (b)
+ there are no survivors and the <tt>minsane</tt> option
+ of the <tt>tos</tt> command is 0. The prefer peer designates another source
+ that can reliably number the seconds when available . However, if no
+ sources are available, the system clock continues to be disciplined by
+ the PPS driver on an indefinite basis.</p>
+<p>A scenario where the latter behavior can be most useful is a planetary orbiter
+ fleet, for instance in the vicinity of Mars, where contact between orbiters
+ and Earth only one or two times per Sol (Mars day). These orbiters have a
+ precise timing reference based on an Ultra Stable Oscillator (USO) with accuracy
+ in the order of a Cesium oscillator. A PPS signal is derived from the USO
+ and can be disciplined from Earth on rare occasion or from another orbiter
+ via NTP. In the above scenario the PPS signal disciplines the spacecraft clock
+ between NTP updates.</p>
+<p>In a similar scenario a PPS signal can be used to discipline the clock between
+ updates produced by the modem driver. This would provide precise synchronization
+ without needing the Internet at all.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>PPS</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Specifies PPS capture on the rising (assert) pulse edge if 0 (default) or falling
+ (clear) pulse edge if 1. Not used under Windows - if the special <tt>serialpps.sys</tt> serial port driver is installed then the leading edge will <i>always</i> be used.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Controls the kernel PPS discipline: 0 for disable (default), 1 for enable. Not used under Windows - if the special <tt>serialpps.sys<\tt> serial port driver is used then kernel PPS will be available and used.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Record a timestamp once for each second if 1. Useful for constructing
+ Allan deviation plots.</dd>
+ .
+</dl>
+<h4>Additional Information</h4>
+<p><a href="../refclock.html">Reference Clock Drivers</a></p>
+<p>Reference</p>
+<ol>
+ <li>Mogul, J., D. Mills, J. Brittenson, J. Stone and U. Windl. Pulse-per-second API for Unix-like operating systems, version 1. Request for Comments RFC-2783, Internet Engineering Task Force, March 2000, 31 pp.</li>
+</ol>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver26.html b/html/drivers/driver26.html
new file mode 100644
index 0000000..dc84cc1
--- /dev/null
+++ b/html/drivers/driver26.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+ <title>Hewlett Packard 58503A GPS Receiver and HP Z3801A</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Hewlett Packard 58503A GPS Receiver and HP Z3801A</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->5-Oct-2005 04:37<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.26.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: <tt>GPS_HP</tt><br>
+ Serial Port: <tt>/dev/hpgps<i>u</i></tt>; 9600 baud, 8-bits, no parity, 19200 baud 7-bits, odd parity for the HP Z3801A</p>
+ <h4>Description</h4>
+ <p>This driver supports the HP 58503A Time and Frequency Reference Receiver and HP Z3801A GPS Receiver. They use HP SmartClock (TM) to implement an Enhanced GPS receiver. The receiver accuracy when locked to GPS in normal operation is better than 1 usec. The accuracy when operating in holdover is typically better than 10 us per day. It receiver should be operated with factory default settings. Initial driver operation: expects the receiver to be already locked to GPS, configured and able to output timecode format 2 messages.</p>
+ <p>The driver uses the poll sequence <tt>:PTIME:TCODE?</tt> to get a response from the receiver. The receiver responds with a timecode string of ASCII printing characters, followed by a &lt;cr&gt;&lt;lf&gt;, followed by a prompt string issued by the receiver, in the following format:</p>
+ <pre>T#yyyymmddhhmmssMFLRVcc&lt;cr&gt;&lt;lf&gt;scpi &gt;</pre>
+ The driver processes the response at the &lt;cr&gt; and &lt;lf&gt;, so what the driver sees is the prompt from the previous poll, followed by this timecode. The prompt from the current poll is (usually) left unread until the next poll. So (except on the very first poll) the driver sees this:
+ <pre>scpi &gt;T#yyyymmddhhmmssMFLRVcc&lt;cr&gt;&lt;lf&gt;</pre>
+ <p>The T is the on-time character, at 980 msec. before the next 1PPS edge. The # is the timecode format type. We look for format 2. Without any of the CLK or PPS stuff, then, the receiver buffer timestamp at the &lt;cr&gt; is 24 characters later, which is about 25 msec. at 9600 bps, so the first approximation for fudge time1 is nominally -0.955 seconds. This number probably needs adjusting for each machine / OS type, so far: -0.955000 on an HP 9000 Model 712/80 HP-UX 9.05 -0.953175 on an HP 9000 Model 370 HP-UX 9.10</p>
+This driver will probably work with the 58503B and 59551A if they are setup appropriately.<P>
+To use an HP Z3801A, specify <tt>mode 1</tt> on the server config line to setup the right line paramters.<P>
+The timekeeping portion of HP's business has been sold to <a href="http://www.symmetricom.com/">Symmetricom</a>.<P>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not used by this driver.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+ </dl>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver27.html b/html/drivers/driver27.html
new file mode 100644
index 0000000..91534ad
--- /dev/null
+++ b/html/drivers/driver27.html
@@ -0,0 +1,248 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+ <title>Arcron MSF Receiver</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Arcron MSF Receiver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.27.<i>u</i><br>
+ Reference ID: <tt>MSFa</tt> / <tt>MSF</tt> / <tt>DCF</tt> / <tt>WWVB</tt><br>
+ Driver ID: <tt>MSF_ARCRON</tt><br>
+ Serial Port: <tt>/dev/arc<i>u</i></tt>; 300 baud, 8-bits, 2-stop, no parity<br>
+ Features: <tt>tty_clk</tt></p>
+ <h4>Description</h4>
+ <p>This driver supports the Arcron MSF, DCF and WWVB receivers. The clock reports its ID as &quot;<tt>MSFa</tt>'', &quot;<tt>MSF</tt>'', &quot;<tt>DCF</tt>'' or &quot;<tt>WWVB</tt>'' to indicate the time source.</p>
+ <p>This documentation describes v1.3 (2003/2/21) of the source and has been tested against ntpd 4.1.0 on linux x86. Changes from v1.1 and v1.2 include patches to work with the new ntp-4 code, clock support for DCF and WWVB configurable via mode flag, an option to ignore resync request (for those of us at the fringes of the WWVB signal, for instance), averaging of the signal quality poll and several bug fixes, code cleanup and standardizations. In all other respects, the driver works as per v1.1 if a mode is not specified.</p>
+ <p>To use the alternate modes, the mode flag must be specified. If the mode flag is 0, or unspecified, the original MSF version is assumed. This should assure backwards compatibility and should not break existing setups.</p>
+ <p>The previous documentation described version V1.1 (1997/06/23) of the source and had been tested (amongst others) against ntpd3-5.90 on Solaris-1 (SunOS 4.1.3_U1 on an SS1 serving as a router and firewall) and against ntpd3-5.90 on Solaris-2.5 (on a SS1+ and TurboSPARC 170MHz). That code will claimed increased stability, reduced jitter and more efficiency (fewer context switches) with the <tt>tty_clk</tt> discipline/STREAMS module installed, but this has not been tested. For a to-do list see the comments at the start of the code.</p>
+ <p>This code has been significantly slimmed down since the V1.0 version, roughly halving the memory footprint of its code and data.</p>
+ <p>This driver is designed to allow the unit to run from batteries as designed, for something approaching the 2.5 years expected in the usual stand-alone mode, but no battery-life measurements have been taken.</p>
+ <p>Much of this code is originally from the other refclock driver files with thanks. The code was originally made to work with the clock by <a href="mailto:derek@toybox.demon.co.uk">Derek Mulcahy</a>, with modifications by <a href="mailto:d@hd.org">Damon Hart-Davis</a>. Thanks also to <a href="mailto:lyndond@sentinet.co.uk">Lyndon David</a> for some of the specifications of the clock. <a href="mailto:palfille@partners.org">Paul Alfille</a> added support for the WWVB clock. <a href="mailto:cprice@cs-home.com">Christopher Price</a> added enhanced support for the MSF, DCF and WWVB clocks.</p>
+ <p>There is support for a Tcl/Tk monitor written by Derek Mulcahy that examines the output stats; see the <a href="http://www2.exnet.com/NTP/ARC/ARC.html">ARC Rugby MSF Receiver</a> page for more details and the code. Information on the WWVB version is available from <a href="http://www.arctime.com">Atomic Time</a> as their <a href="http://www.atomictime.com/Product17.html">Atomic Time PC</a>.</p>
+ <p>Look at the notes at the start of the code for further information; some of the more important details follow.</p>
+ <p>The driver interrogates the clock at each poll (ie every 64s by default) for a timestamp. The clock responds at the start of the next second (with the start bit of the first byte being on-time). In the default or original MSF mode, the time is in `local' format, including the daylight savings adjustment when it is in effect. The driver code converts the time back to UTC. In modes 1-3 the driver can be configured for UTC or local time depending on the setting of flag1.</p>
+ <p>The clock claims to be accurate to within about 20ms of the broadcast time, and given the low data transmission speed from clock to host, and the fact that the clock is not in continuous sync with MSF, it seems sensible to set the `precision' of this clock to -5 or -4, -4 being used in this code, which builds in a reported dispersion of over 63ms (ie says ``This clock is not very good.''). You can improve the reported precision to -4 (and thus reduce the base dispersion to about 31ms) by setting the fudge <tt>flag3</tt> to <tt>1</tt>.</p>
+ <p>Even a busy and slow IP link can yield lower dispersions than this from polls of primary time servers on the Internet, which reinforces the idea that this clock should be used as a backup in case of problems with such an IP link, or in the unfortunate event of failure of more accurate sources such as GPS.</p>
+ <p>By default this clock reports itself to be at stratum 2 rather than the usual stratum 0 for a refclock, because it is not really suited to be used as other than a backup source. The stratum reported can be changed with the <tt>stratum</tt> directive to be whatever you like. After careful monitoring of your clock, and appropriate choice of the <tt>time1</tt> fudge factor to remove systematic errors in the clock's reported time, you might fudge the clock to stratum 1 to allow a stratum-2 secondary server to sync to it.</p>
+ <p>In default mode, the driver code arranges to resync the clock to MSF at intervals of a little less than an hour (deliberately avoiding the same time each hour to avoid any systematic problems with the signal or host). Whilst resyncing, the driver supplements the normal polls for time from the clock with polls for the reception signal quality reported by the clock. If the signal quality is too low (0--2 out of a range of 0--5), we chose not to trust the clock until the next resync (which we bring forward by about half an hour). If we don't catch the resync, and so don't know the signal quality, we do trust the clock (because this would generally be when the signal is very good and a resync happens quickly), but we still bring the next resync forward and reduce the reported precision (and thus increase reported dispersion).</p>
+ <p>If we force resyncs to MSF too often we will needlessly exhaust the batteries the unit runs from. During clock resync this driver tries to take enough time samples to avoid <tt>ntpd</tt> losing sync in case this clock is the current peer. By default the clock would only resync to MSF about once per day, which would almost certainly not be acceptable for NTP purposes.</p>
+ <p>The driver does not force an immediate resync of the clock to MSF when it starts up to avoid excessive battery drain in case <tt>ntpd</tt> is going to be repeatedly restarted for any reason, and also to allow enough samples of the clock to be taken for <tt>ntpd</tt> to sync immediately to this clock (and not remain unsynchronised or to sync briefly to another configured peer, only to hop back in a few poll times, causing unnecessary disturbance). This behaviour should not cause problems because the driver will not accept the timestamps from the clock if the status flag delivered with the time code indicates that the last resync attempt was unsuccessful, so the initial timestamps will be close to reality, even if with up to a day's clock drift in the worst case (the clock by default resyncs to MSF once per day).</p>
+ <p>When alternate modes 1-3 are selected, the driver can be configured to ignore the resync requests by setting <tt>flag2</tt> to 1. This allows clocks at the fringe of the signal to resync at night when signals are stronger.</p>
+ <p>The clock has a peculiar RS232 arrangement where the transmit lines are powered from the receive lines, presumably to minimise battery drain. This arrangement has two consequences:</p>
+ <ul>
+ <li>Your RS232 interface must drive both +ve and -ve
+ <li>You must (in theory) wait for an echo and a further 10ms between characters
+ </ul>
+ <p>This driver, running on standard Sun and x86 hardware, seems to work fine; note the use of the <tt>send_slow()</tt> routine to queue up command characters to be sent once every two seconds.</p>
+ <p>Three commands are sent to the clock by this driver. Each command consists of a single letter (of which only the bottom four bits are significant), followed by a CR (ASCII 13). Each character sent to the clock should be followed by a delay to allow the unit to echo the character, and then by a further 10ms. Following the echo of the command string, there may be a response (ie in the case of the <tt>g</tt> and <tt>o</tt> commands below), which in the case of the <tt>o</tt> command may be delayed by up to 1 second so as the start bit of the first byte of the response can arrive on time. The commands and their responses are:</p>
+ <dl>
+ <dt><tt>g</tt> CR
+ <dd>Request for signal quality. Answer only valid during (late part of) resync to MSF signal. The response consists of two characters as follows:
+ <dl compact>
+ <dt>bit 7
+ <dd>parity
+ <dt>bit 6
+ <dd>always 0
+ <dt>bit 5
+ <dd>always 1
+ <dt>bit 4
+ <dd>always 1
+ <dt>bit 3
+ <dd>always 0
+ <dt>bit 2
+ <dd>always 0
+ <dt>bit 1
+ <dd>always 1
+ <dt>bit 0
+ <dd>= 0 if no reception attempt at the moment, = 1 if reception attempt (ie resync) in progress
+ </dl>
+ <dl compact>
+ <dt>bit 7
+ <dd>parity
+ <dt>bit 6
+ <dd>always 0
+ <dt>bit 5
+ <dd>always 1
+ <dt>bit 4
+ <dd>always 1
+ <dt>bit 3
+ <dd>always 0
+ <dt>bit 2--0
+ <dd>reception signal quality in the range 0--5 (very poor to very good); if in the range 0--2 no successful reception is to be expected. The reported value drops to zero when not resyncing, ie when first returned byte is not `3'.
+ </dl>
+ <dt><tt>h</tt> CR
+ <dd>Request to resync to signal. Can take up from about 30s to 360s. Drains batteries so should not be used excessively. After this the clock time and date should be correct and the phase within 20ms of time as transmitted from the source signal (remember to allow for propagation time). By default the clock resyncs once per day in the late evening/early morning (presumably to catch transitions to/from daylight saving time quickly). This driver code, by default, resyncs at least once per hour to minimise clock wander.
+ <dt><tt>o</tt> CR
+ <dd>Request timestamp. Start bit of first byte of response is on-time, so may be delayed up to 1 second. Note that the driver will convert time to GMT, if required. The response data is as follows:
+ <ol>
+ <li>hours tens (hours range from 00 to 23)
+ <li>hours units
+ <li>minutes tens (minutes range from 00 to 59)
+ <li>minutes units
+ <li>seconds tens (seconds presumed to range from 00 to 60 to allow for leap second)
+ <li>seconds units
+ <li>day of week 1 (Monday) to 7 (Sunday)
+ <li>day of month tens (day ranges from 01 to 31)
+ <li>day of month units
+ <li>month tens (months range from 01 to 12)
+ <li>month units
+ <li>year tens (years range from 00 to 99)
+ <li>year units
+ <li>BST/UTC status (Ignored in WWVB version)
+ <dl compact>
+ <dt>bit 7
+ <dd>parity
+ <dt>bit 6
+ <dd>always 0
+ <dt>bit 5
+ <dd>always 1
+ <dt>bit 4
+ <dd>always 1
+ <dt>bit 3
+ <dd>(MSF) always 0<br>
+ (WWVB) Leap year indicator bit<br>
+ 0 = non-leap year<br>
+ 1 = leap year
+ <dt>bit 2
+ <dd>= (MSF) 1 if UTC is in effect (reverse of bit 1)<br>
+ (WWVB) Leap second warning bit
+ <dt>bit 1
+ <dd>= (MSF)1 if BST is in effect (reverse of bit 2)<br>
+ = (WWVB) 0 if ST is in effect, 1 if DST is in effect, 1 if transition from ST with bit 0 is set to 0
+ <dt>bit 0
+ <dd>= (MSF)1 if BST/UTC change pending<br>
+ = (WWVB) 0 if ST is in effect, 1 if DST is in effect, 0 if transition from DST with bit 1 is set to 0
+ </dl>
+ <li>clock status
+ <dl compact>
+ <dt>bit 7
+ <dd>parity
+ <dt>bit 6
+ <dd>always 0
+ <dt>bit 5
+ <dd>always 1
+ <dt>bit 4
+ <dd>always 1
+ <dt>bit 3
+ <dd>= 1 if low battery is detected
+ <dt>bit 2
+ <dd>= 1 if last resync failed (though officially undefined for the MSF clock, officially defined for WWVB)
+ <dt>bit 1
+ <dd>= 1 if at least one reception attempt was successful<br>
+ (MSF) since 0230<br>
+ (DCF) since 0300<br>
+ (WWVB) resets if not successful between 0300-0400
+ <dt>bit 0
+ <dd>= 1 if the clock has valid time---reset to zero when clock is reset (eg at power-up), and set to 1 after first successful resync attempt.
+ </dl>
+ </ol>
+ <p>The driver only accepts time from the clock if the bottom three bits of the status byte are <tt>011</tt> or <tt>flag2</tt> is set to 1 to ignore resync requests. For the MSF clock, if the UK parliament decides to move us to +0100/+0200 time as opposed to the current +0000/+0100 time, it is not clear what effect that will have on the time broadcast by MSF, and therefore on this driver's usefulness.</p>
+ </dl>
+ <p>A typical <tt>ntp.conf</tt> configuration file for this driver might be:</p>
+ <pre># hostname(n) means we expect (n) to be the stratum at which hostname runs.
+
+#------------------------------------------------------------------------------
+# SYNCHRONISATION PARTNERS
+# ========================
+
+# Default configuration (Original MSF mode)s...
+server 127.127.27.0 mode 333 # ARCRON MSF radio clock
+# Fudge stratum and other features as required.
+# ADJUST time1 VALUE FOR YOUR HOST, CLOCK AND LOCATION!
+fudge 127.127.27.0 stratum 1 time1 0.016 flag3 1
+# WWVB users should change that line to:
+server 127.127.27.0 mode 3 # ARCRON WWVB radio clock
+fudge 127.127.27.0 stratum 1 time1 0.030 flag1 1 flag3 1
+
+peer 11.22.33.9 # tick(1--2).
+peer 11.22.33.4 # tock(3), boot/NFS server.
+
+# This shouldn't get swept away unless left untouched for a long time.
+driftfile /var/tmp/ntp.drift
+
+#------------------------------------------------------------------------------
+# RESTRICTIONS
+# ============
+
+# By default, don't trust and don't allow modifications.&nbsp; Ignore in fact.
+restrict default ignore notrust nomodify
+
+# Allow others in our subnet to check us out...
+restrict 11.22.33.0 mask 255.255.255.0 nomodify notrust
+
+# Trust our peers for time.&nbsp; Don't trust others in case they are insane.
+restrict 127.127.27.0 nomodify
+restrict 11.22.33.4 nomodify
+restrict 11.22.33.9 nomodify
+
+# Allow anything from the local host.
+restrict 127.0.0.1</pre>
+ There are a few <tt>#define</tt>s in the code that you might wish to play with:
+ <dl>
+ <dt><tt>ARCRON_KEEN</tt>
+ <dd>With this defined, the code is relatively trusting of the clock, and assumes that you will have the clock as one of a few time sources, so will bend over backwards to use the time from the clock when available and avoid <tt>ntpd</tt> dropping sync from the clock where possible. You may wish to undefine this, especially if you have better sources of time or your reception is ropey. However, there are many checks built in even with this flag defined.
+ <dt><tt>ARCRON_MULTIPLE_SAMPLES</tt>
+ <dd>When is defined, we regard each character in the returned timecode as at a known delay from the start of the second, and use the smallest (most negative) offset implied by any such character, ie with the smallest kernel-induced display, and use that. This helps to reduce jitter and spikes.
+ <dt><tt>ARCRON_LEAPSECOND_KEEN</tt>
+ <dd>When is defined, we try to do a resync to MSF as soon as possible in the first hour of the morning of the first day of the first and seventh months, ie just after a leap-second insertion or deletion would happen if it is going to. This should help compensate for the fact that this clock does not continuously sample MSF, which compounds the fact that MSF itself gives no warning of an impending leap-second event. This code did not seem functional at the leap-second insertion of 30th June 1997 so is by default disabled.
+ <dt><tt>PRECISION</tt>
+ <dd>Currently set to <tt>-4</tt>, but you may wish to set it to <tt>-5</tt> if you are more conservative, or to <tt>-6</tt> if you have particularly good experience with the clock and you live on the edge. Note that the <tt>flag3</tt> fudge value will improve the reported dispersion one notch if clock signal quality is known good. So maybe just leave this alone.
+ </dl>
+ <h4>Monitor Data</h4>
+ <p>Each timecode is written to the <tt>clockstats</tt> file with a signal quality value appended (`0'--`5' as reported by the clock, or `6' for unknown).</p>
+ <p>Each resync and result (plus gaining or losing MSF sync) is logged to the system log at level <tt>LOG_NOTICE</tt>; note that each resync drains the unit's batteries, so the syslog entry seems justified.</p>
+ <p>Syslog entries are of the form:</p>
+ <pre>May 10 10:15:24 oolong ntpd[615]: ARCRON: unit 0: sending resync command
+May 10 10:17:32 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock
+May 10 11:13:01 oolong ntpd[615]: ARCRON: unit 0: sending resync command
+May 10 11:14:06 oolong ntpd[615]: ARCRON: sync finished, signal quality -1: UNKNOWN, will use clock anyway
+May 10 11:41:49 oolong ntpd[615]: ARCRON: unit 0: sending resync command
+May 10 11:43:57 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock
+May 10 12:39:26 oolong ntpd[615]: ARCRON: unit 0: sending resync command
+May 10 12:41:34 oolong ntpd[615]: ARCRON: sync finished, signal quality 3: OK, will use clock</pre>
+ <h4>Fudge Factors</h4>
+ <p></p>
+ <dl>
+ <dt><tt>mode 0 | 1 | 2 | 3</tt>
+ <dd>Specifies the clock hardware model. This parameter is optional, it defaults to the original mode of operation.
+ <dd>Supported modes of operation:
+ <dd>0 - Default, Original MSF
+ <dd>1 - Updated MSF
+ <dd>2 - New DCF77
+ <dd>3 - New WWVB
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. On a Sun SparcStation 1 running SunOS 4.1.3_U1, with the receiver in London, a value of 0.020 (20ms) seems to be appropriate.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not currently used by this driver.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 2. It is suggested that the clock be not be fudged higher than stratum 1 so that it is used a backup time source rather than a primary when more accurate sources are available.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>MSFa</tt>. When used in modes 1-3, the driver will report either <tt>MSF</tt>, <tt>DCF</tt>, or <tt>WWVB</tt> respectively.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>(Modes 1-3) If set to 0 (the default), the clock is set to UTC time. If set to 1, the clock is set to localtime.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>(Modes 1-3) If set to 0 (the default), the clock will be forced to resync approximately every hour. If set to 1, the clock will resync per normal operations (approximately midnight).
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>If set to 1, better precision is reported (and thus lower dispersion) while clock's received signal quality is known to be good.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+ </dl>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a><br>
+ <a href="http://www2.exnet.com/NTP/ARC/ARC.html">ARC Rugby MSF Receiver</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver28.html b/html/drivers/driver28.html
new file mode 100644
index 0000000..8c7fd80
--- /dev/null
+++ b/html/drivers/driver28.html
@@ -0,0 +1,147 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+ <title>Shared Memory Driver</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Shared Memory Driver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->8-Aug-2014 19:17<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.28.<i>u</i><br>
+ Reference ID: <tt>SHM</tt><br>
+ Driver ID: <tt>SHM</tt></p>
+
+ <h4>Description</h4>
+ <p>This driver receives its reference clock info from a shared memory-segment. The shared memory-segment is created with owner-only access for unit 0 and 1, and world access for unit 2 and 3</p>
+
+ <h4>Structure of shared memory-segment</h4>
+ <pre>struct shmTime {
+ int mode; /* 0 - if valid is set:
+ * use values,
+ * clear valid
+ * 1 - if valid is set:
+ * if count before and after read of data is equal:
+ * use values
+ * clear valid
+ */
+ volatile int count;
+ time_t clockTimeStampSec;
+ int clockTimeStampUSec;
+ time_t receiveTimeStampSec;
+ int receiveTimeStampUSec;
+ int leap;
+ int precision;
+ int nsamples;
+ volatile int valid;
+ unsigned clockTimeStampNSec; /* Unsigned ns timestamps */
+ unsigned receiveTimeStampNSec; /* Unsigned ns timestamps */
+ int dummy[8];
+};</pre>
+
+ <h4>Operation mode=0</h4>
+ <p>Each second, the value of <code>valid</code> of the shared memory-segment is checked:</p>
+ <p>If set, the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed to ntp, and <code>valid</code> is cleared and <code>count</code> is bumped.</p>
+ <p>If not set, <code>count</code> is bumped.</p>
+ <h4>Operation mode=1</h4>
+ <p>Each second, <code>valid</code> in the shared memory-segment is checked:</p>
+ <p>If set, the <code>count</code> field of the record is remembered, and the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are read. Then, the remembered <code>count</code> is compared to current value of <code>count</code> now in the record. If both are equal, the values read from the record are passed to ntp. If they differ, another process has modified the record while it was read out (was not able to produce this case), and failure is reported to ntp. The <code>valid</code> flag is cleared and <code>count</code> is bumped.</p>
+ <p>If not set, <code>count</code> is bumped</p>
+
+<h4>Mode-independent postprocessing</h4>
+After the time stamps have been successfully plucked from the SHM
+segment, some sanity checks take place:
+<ul>
+ <li>The receive time stamp of the SHM data must be in the last 5
+ seconds before the time the data is processed. This helps in weeding
+ out stale data.
+ <li>If the absolute difference between remote and local clock
+ exceeds the limit (either <i>time2</i> or the default of 4hrs), then
+ the sample is discarded. This check is disabled when <i>flag1</i> is
+ set to 1.
+</ul>
+
+<h4>gpsd</h4>
+
+<a href="http://gpsd.berlios.de/"><i>gpsd</i></a>
+knows how to talk to many GPS devices.
+It can work with <i>ntpd</i> through the SHM driver.
+<P>
+The <i>gpsd</i> man page suggests setting minpoll and maxpoll to 4.
+That was an attempt to reduce jitter.
+The SHM driver was fixed (ntp-4.2.5p138) to collect data each second rather than
+once per polling interval so that suggestion is no longer reasonable.
+<P>
+ <b>Note:</b> The GPSD client driver (type 46) uses the <i>gpsd</i>
+ client protocol to connect and talk to <i>gpsd</i>, but using the
+ SHM driver is the ancient way to have <i>gpsd</i> talk to <i>ntpd</i>.
+
+<h4>Clockstats</h4>
+If flag4 is set when the driver is polled, a clockstats record is written.
+The first 3 fields are the normal date, time, and IP address common to all clockstats records.
+<P>
+The 4th field is the number of second ticks since the last poll.
+The 5th field is the number of good data samples found. The last 64 will be used by ntpd.
+The 6th field is the number of sample that didn't have valid data ready.
+The 7th field is the number of bad samples.
+The 8th field is the number of times the the mode 1 info was update while nptd was trying to grab a sample.
+<P>
+
+Here is a sample showing the GPS reception fading out:
+<pre>
+54364 84927.157 127.127.28.0 66 65 1 0 0
+54364 84990.161 127.127.28.0 63 63 0 0 0
+54364 85053.160 127.127.28.0 63 63 0 0 0
+54364 85116.159 127.127.28.0 63 62 1 0 0
+54364 85180.158 127.127.28.0 64 63 1 0 0
+54364 85246.161 127.127.28.0 66 66 0 0 0
+54364 85312.157 127.127.28.0 66 50 16 0 0
+54364 85375.160 127.127.28.0 63 41 22 0 0
+54364 85439.155 127.127.28.0 64 64 0 0 0
+54364 85505.158 127.127.28.0 66 36 30 0 0
+54364 85569.157 127.127.28.0 64 0 64 0 0
+54364 85635.157 127.127.28.0 66 0 66 0 0
+54364 85700.160 127.127.28.0 65 0 65 0 0
+</pre>
+
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Maximum allowed difference between remote and local
+ clock, in seconds. Values <1.0 or >86400.0 are ignored, and the
+ default value of 4hrs (14400s) is used instead. See also flag 1.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>SHM</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd><i>Skip</i> the difference limit check if set. Useful
+ for systems where the RTC backup cannot keep the time over
+ long periods without power and the SHM clock must be able
+ to force long-distance initial jumps. <i>Check</i> the
+ difference limit if cleared (default).
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>If flag4 is set, clockstats records will be written when the driver is polled.
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ </dl>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
+
diff --git a/html/drivers/driver29.html b/html/drivers/driver29.html
new file mode 100644
index 0000000..4939d80
--- /dev/null
+++ b/html/drivers/driver29.html
@@ -0,0 +1,1093 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <title>Trimble Palisade and Thunderbolt Receivers</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
+ <h1><font size="+2">Trimble Palisade and Thunderbolt Receivers</font>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ </h1>
+ <table>
+ <tr>
+ <td>
+ <h2><img src="../pic/driver29.gif" alt="gif" nosave height="100" width="420"></h2>
+ </td>
+ <td>
+ <h2><img src="../pic/thunderbolt.jpg" alt="jpg" nosave height="270" width="420"></h2>
+ </td>
+ </tr>
+ </table>
+ <h2><font size="+1">Synopsis</font></h2>
+ <table>
+ <tr>
+ <td>
+ <div align="right">
+ <tt>Address:&nbsp;</tt></div>
+ </td>
+ <td><b>127.127.29.<i>u</i></b></td>
+ </tr>
+ <tr>
+ <td>
+ <div align="right">
+ <tt>Reference ID:</tt></div>
+ </td>
+ <td><a name="REFID"></a><b>GPS</b></td>
+ </tr>
+ <tr>
+ <td>
+ <div align="right">
+ <tt>Driver ID:</tt></div>
+ </td>
+ <td><b>GPS_PALISADE</b></td>
+ </tr>
+ <tr>
+ <td>
+ <div align="right">
+ <tt>Serial Port:</tt></div>
+ </td>
+ <td><b>/dev/palisade<i>u</i></b></td>
+ </tr>
+ <tr>
+ <td>
+ <div align="right">
+ <tt><font size="+1">Serial I/O:</font></tt></div>
+ </td>
+ <td><b>9600 baud, 8-bits, 1-stop, odd parity</b></td>
+ </tr>
+ <tr>
+ <td>
+ <div align="right">
+ <tt><font size="+1">Serial I/O (Thunderbolt):</font></tt></div>
+ </td>
+ <td><b>9600 baud, 8-bits, 1-stop, no parity</b></td>
+ </tr>
+ </table>
+ <h2><font size="+1">Description</font></h2>
+ The <b>refclock_palisade</b> driver supports <a href="http://www.trimble.com/products/ntp">Trimble Navigation's Palisade Smart Antenna GPS receiver</a>.<br>
+ Additional software and information about the Palisade GPS is available from: <a href="http://www.trimble.com/oem/ntp">http://www.trimble.com/oem/ntp</a>.<br>
+ Latest NTP driver source, executables and documentation is maintained at: <a href="ftp://ftp.trimble.com/pub/ntp">ftp://ftp.trimble.com/pub/ntp</a>
+ <p>This documentation describes version 7.12 of the GPS Firmware and version 2.46 (July 15, 1999) and later, of the driver source.<br>&nbsp;</p>
+ <p>This documentation describes version 1 of the Thunderbolt Receiver Firmware, no tests have been made on further firmwares, please read "Notes on the Thunderbolt Receiver's Firmware" at the end of this documentation for more information.</p>
+ <h2><font size="+1">Operating System Compatibility</font></h2>
+ The Palisade driver has been tested on the following software and hardware platforms:<br>&nbsp;
+ <center>
+ <table>
+ <tr>
+ <td valign="CENTER" width="23%">Platform</td>
+ <td valign="CENTER">Operating System</td>
+ <td>NTP Sources</td>
+ <td>Accuracy</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="23%">i386 (PC)&nbsp;</td>
+ <td valign="CENTER">Linux</td>
+ <td>NTP Distribution</td>
+ <td>10 us</td>
+ </tr>
+ <tr>
+ <td>i386 (PC)&nbsp;</td>
+ <td>Windows NT</td>
+ <td><a href="ftp://ftp.trimble.com/pub/ntp">ftp://ftp.trimble.com/pub/ntp</a></td>
+ <td>1 ms</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="23%">SUN</td>
+ <td valign="CENTER">Solaris 2.x</td>
+ <td>NTP Distribution</td>
+ <td>50 us</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="23%">Hewlett-Packard</td>
+ <td valign="CENTER">HPUX 9, 10, 11</td>
+ <td><a href="http://us-support.external.hp.com">http://us-support.external.hp.com</a></td>
+ <td>50 us</td>
+ </tr>
+ <tr>
+ <td>Various</td>
+ <td>Free BSD</td>
+ <td>NTP Distribution</td>
+ <td>20 us</td>
+ </tr>
+ </table>
+ </center><P>
+ <b>Attention</b>: Thunderbolt Receiver has not being tested on the previous software and hardware plataforms.
+ <h2><font size="+1">GPS Receiver</font></h2>
+ The Palisade GPS receiver is an 8-channel smart antenna, housing the GPS receiver, antenna and interface in a single unit, and is designed for rooftop deployment in static timing applications.
+ <p>Palisade generates a PPS synchronized to UTC within +/- 100 ns.&nbsp; The Palisade's external event input with 40 nanosecond resolution is utilized by the Palisade NTP driver for asynchronous precision time transfer.</p>
+ <p>No user initialization of the receiver is required. This driver is compatible with the following versions of Palisade:<br>&nbsp;</p>
+ <center>
+ <table>
+ <tr>
+ <td valign="CENTER">
+ <center>
+ Version</center>
+ </td>
+ <td valign="TOP">
+ <center>
+ Event Input</center>
+ </td>
+ <td valign="CENTER">
+ <center>
+ Trimble Part Number</center>
+ </td>
+ </tr>
+ <tr>
+ <td valign="CENTER">
+ <center>
+ 7.02</center>
+ </td>
+ <td valign="TOP">
+ <center>
+ No</center>
+ </td>
+ <td valign="CENTER">
+ <center>
+ 26664-00</center>
+ </td>
+ </tr>
+ <tr>
+ <td align="CENTER" valign="CENTER">
+ <center>
+ 7.02E</center>
+ </td>
+ <td valign="TOP">
+ <center>
+ Yes</center>
+ </td>
+ <td valign="CENTER">
+ <center>
+ 26664-10</center>
+ </td>
+ </tr>
+ <tr>
+ <td valign="CENTER">
+ <center>
+ 7.12</center>
+ </td>
+ <td valign="TOP">
+ <center>
+ Yes</center>
+ </td>
+ <td valign="CENTER">
+ <center>
+ 38158-00</center>
+ </td>
+ </tr>
+ </table>
+ </center>
+ <dl>
+ <dl>
+ Note: When using Palisade 26664-00, you must set fudge flag2 to 1 in <b>ntp.conf</b>. See <a href="#Configuration">configuration</a>.
+ </dl>
+ <dl>
+ <h3><font size="+1">GPS&nbsp;<a name="Installation"></a>Installation</font></h3>
+ A location with unobstructed view of the horizon is recommended. Palisade is designed to be securely mounted atop standard 3/4 inch threaded pipe.
+ <p>The 12 conductor (dia. 10 mm)&nbsp; power and I/O cable must be routed from the rooftop site to the NTP server and properly strain relieved.</p>
+ <h3><font size="+1">GPS&nbsp;<a name="Connection"></a>Connection</font></h3>
+ The Palisade is equipped with dual (A &amp; B) RS-422 serial interfaces and a differential TTL PPS output. An RS-232 / RS-422 Interface Module is supplied with the Palisade NTP Synchronization Kit. Palisade <a href="#PortA">port A</a> must be connected to the NTP host server. Maximum antenna cable length is 500 meters. See the <a href="#Pinouts">pinouts</a> table for detailed connection Information.
+ <p>Palisade's <a href="#PortB">port B</a> provides a TSIP (Trimble Standard Interface Protocol) interface for diagnostics, configuration, and monitoring. Port B and the PPS output are not currently used by the Palisade NTP reference clock driver.<br>&nbsp;</p>
+ </dl>
+ </dl>
+ <h2><font size="+1">O/S Serial Port Configuration</font></h2>
+ The driver attempts to open the device <b><tt><a href="#REFID">/dev/palisade<i>u</i></a></tt></b> where <b><i>u</i></b> is the NTP refclock unit number as defined by the LSB of the refclock address.&nbsp; Valid refclock unit numbers are 0 - 3.
+ <p>The user is expected to provide a symbolic link to an available serial port device.&nbsp; This is typically performed by a command such as:</p>
+ <blockquote>
+ <tt>ln -s /dev/ttyS0 /dev/palisade0</tt></blockquote>
+ Windows NT does not support symbolic links to device files. COM<b>x</b>: is used by the driver, based on the refclock unit number, where unit 1 corresponds to COM<b>1</b>: and unit 3 corresponds to COM3:<br>&nbsp;
+ <h2><a name="Configuration"></a><font size="+1">NTP Configuration</font></h2>
+ Palisade NTP configuration file <b><tt>&quot;ntp.conf&quot;</tt></b> with event polling:<br>
+ <tt>#------------------------------------------------------------------------------</tt><br>
+ <tt># The Primary reference</tt><br>
+ <tt>server 127.127.29.0 # Trimble Palisade GPS Refclock Unit #0</tt><br>
+ <tt>peer terrapin.csc.ncsu.edu # internet server</tt><br>
+ <tt># Drift file for expedient re-synchronization after downtime or reboot.</tt><br>
+ <tt>driftfile /etc/ntp.drift</tt><br>
+ <tt>#------------------------------------------------------------------------------</tt>
+ <p>Configuration without event polling:<br>
+ <tt>#------------------------------------------------------------------------------</tt><br>
+ <tt># The Primary reference</tt><br>
+ <tt>server 127.127.29.0 # Trimble Palisade GPS (Stratum 1).</tt><br>
+ <tt># Set packet delay</tt><br>
+ <tt><a href="#time1">fudge 127.127.29.0 time1 0.020</a></tt><br>
+ <tt># and set flag2 to turn off event polling.</tt><br>
+ <tt><a href="#flag2">fudge 127.127.29.0 flag2 1</a></tt><br>
+ <tt>#------------------------------------------------------------------------------</tt><br>&nbsp;</p>
+
+ <h4>Thunderbolt NTP Configuration file</h4>
+ <tt>#------------------------------------------------------------------------------</tt>
+ <p>Configuration without event polling:<br>
+ <tt>#------------------------------------------------------------------------------</tt><br>
+ <tt># The Primary reference</tt><br>
+ <tt>server 127.127.29.0 mode 2 # Trimble Thunderbolt GPS (Stratum 1).</tt><br>
+ <tt># Set packet delay</tt><br>
+ <tt><a href="#time1">fudge 127.127.29.0 time1 0.020</a></tt><br>
+ <tt># and set flag2 to turn off event polling.</tt><br>
+ <tt><a href="#flag2">fudge 127.127.29.0 flag2 1</a></tt><br>
+ <tt>#------------------------------------------------------------------------------</tt><br>&nbsp;</p>
+ Currently the Thunderbolt mode doesn't support event polling, the reasons are explained on the "Notes on the Thunderbolt Receiver's Firmware" section at the end of this documentation.
+ <h2><a name="TimeTransfer"></a><font size="+1">Time Transfer and Polling</font></h2>
+ Time transfer to the NTP host is performed via the Palisade's comprehensive time packet output. The time packets are output once per second, and whenever an event timestamp is requested.
+ <p>The driver requests an event time stamp at the end of each polling interval, by pulsing the RTS (request to send) line on the serial port. The Palisade GPS responds with a time stamped event packet.</p>
+ <p>Time stamps are reported by the Palisade with respect to UTC time. The GPS receiver must download UTC offset information from GPS satellites. After an initial UTC download, the receiver will always start with correct UTC offset information.<br>&nbsp;</p>
+ <h2><font size="+1">Run NTP in Debugging Mode</font></h2>
+ The following procedure is recommended for installing and testing a Palisade NTP driver:
+ <ol>
+ <li>Perform initial checkout procedures. Place the GPS receiver outdoors; with clear view of the sky. Allow the receiver to obtain an UTC almanac.
+ <li>Verify presence of timing packets by observing the 1 Hz (PPS) led on the interface module. It should flash once per second.
+ <li>Connect Palisade's port A to the NTP host.
+ <li>Configure NTP and the serial I/O port on the host system.
+ <li>Initially use <tt><a href="#flag2">fudge flag2</a></tt> in <b><a href="#Configuration">ntp.conf</a>,</b> to disable event polling (see configuration).
+ <li>Run NTP in debug mode (-d -d), to observe Palisade_receive events.
+ <li>The driver reports the <a href="#TrackingStatus">tracking status of the receiver</a>. Make sure it is tracking several satellites.
+ <li>Remove fudge flag2 and restart <b>ntpd</b> in debug mode to observe palisade_receive events.
+ <li>If event polling fails, verify the <a href="#Pinouts">connections</a> and that the host hardware supports RTS control.
+ </ol>
+ <h2><font size="+1">Event Logging</font></h2>
+ System and Event log entries are generated by NTP to report significant system events. Administrators should monitor the system log to observe NTP error messages. Log entries generated by the Palisade NTP reference clock driver will be of the form:
+ <blockquote>
+ <pre>Nov 14 16:16:21 terrapin ntpd[1127]: Palisade #0: <i>message</i></pre>
+ </blockquote>
+ <h2><font size="+1">Fudge Factors</font></h2>
+ <dl>
+ <dt><a name="time1"></a><tt><font size="+1"><a href="#Configuration">time1 <i>time</i></a></font></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. If event capture is not used, time1 should be set to 20 milliseconds to correct serial line and operating system delays incurred in capturing time stamps from the synchronous packets.
+ <dt><tt><font size="+1">stratum <i>number</i></font></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt><font size="+1"><a href="#REFID">refid <i>string</i></a></font></tt>
+ <dd>Specifies the driver reference identifier, <b>GPS</b>.
+ <dt><a name="flag2"></a><tt><font size="+1"><a href="#Configuration">flag2 0 | 1</a></font></tt>
+ <dd>When set to 1, driver does not use hardware event capture. The synchronous packet output by the receiver at the beginning of each second is time stamped by the driver. If triggering the event pulse fails, the driver falls back to this mode automatically.
+ </dl>
+ <h2><font size="+1">Mode Parameter</font></h2>
+ <dl>
+ <dt><tt><font size="+1">mode <i>number</i></font></tt>
+ <dd>The mode parameter to the server command specifies the specific hardware this driver is for. The default is 0 for a normal Trimble Palisade. The other options are <b>1</b> for an <b>Endrun Praecis</b> in Trimble emulation mode, and <b>2</b> for the <b>Trimble Thunderbolt</b> GPS Disciplined Clock Receiver.
+ </dl>
+ <h2><font size="+1">DEFINEs</font></h2>
+ The following constants are defined in the driver source code. These defines may be modified to improve performance or adapt to new operating systems.<br>&nbsp;
+ <center>
+ <table border>
+ <tr>
+ <td><b>Label</b></td>
+ <td>Definition</td>
+ <td>Default Value</td>
+ </tr>
+ <tr>
+ <td>DEVICE</td>
+ <td>The serial port device to be used by the driver</td>
+ <td>/dev/palisade<b><i>u</i></b></td>
+ </tr>
+ <tr>
+ <td>PRECISION</td>
+ <td>Accuracy of time transfer</td>
+ <td>1 microsecond</td>
+ </tr>
+ <tr>
+ <td>CURRENT_UTC</td>
+ <td>Valid GPS - UTC offset</td>
+ <td>13</td>
+ </tr>
+ <tr>
+ <td>SPEED232</td>
+ <td>Host RS-232 baud rate</td>
+ <td>B9600</td>
+ </tr>
+ <tr>
+ <td>TRMB_MINPOLL&nbsp;</td>
+ <td>Minimum polling interval</td>
+ <td>5 (32 seconds)</td>
+ </tr>
+ <tr>
+ <td>TRMB_MAXPOLL</td>
+ <td>Maximum interval between polls</td>
+ <td>7 (128 seconds)</td>
+ </tr>
+ </table>
+ </center>
+ <h2><a name="DataFormat"></a><font size="+1">Data Format</font></h2>
+ Palisade port A can output two synchronous time packets. The NTP driver can use either packet for synchronization. Packets are formatted as follows:
+ <h3><b><font size="+0">Packet 8F-AD (Primary NTP Packet)</font></b></h3>
+ <center>
+ <table>
+ <tr>
+ <td>Byte</td>
+ <td>Item</td>
+ <td>Type</td>
+ <td>Meaning</td>
+ </tr>
+ <tr>
+ <td>0</td>
+ <td>Sub-Packet ID</td>
+ <td>BYTE</td>
+ <td>Subcode 0xAD</td>
+ </tr>
+ <tr>
+ <td>1 - 2</td>
+ <td>Event Count</td>
+ <td>INTEGER</td>
+ <td>External event count recorded (0 = PPS)</td>
+ </tr>
+ <tr>
+ <td>3 - 10</td>
+ <td>Fractional Second</td>
+ <td>DOUBLE</td>
+ <td>Time elapsed in current second (s)</td>
+ </tr>
+ <tr>
+ <td>11</td>
+ <td>Hour</td>
+ <td>BYTE</td>
+ <td>Hour (0 - 23)</td>
+ </tr>
+ <tr>
+ <td>12</td>
+ <td>Minute</td>
+ <td>BYTE</td>
+ <td>Minute (0 - 59)</td>
+ </tr>
+ <tr>
+ <td>13</td>
+ <td>Second</td>
+ <td>BYTE</td>
+ <td>Second (0 - 59; 60 = leap)</td>
+ </tr>
+ <tr>
+ <td>14</td>
+ <td>Day</td>
+ <td>BYTE</td>
+ <td>Date (1 - 31)</td>
+ </tr>
+ <tr>
+ <td>15</td>
+ <td>Month</td>
+ <td>BYTE</td>
+ <td>Month (1 - 12)</td>
+ </tr>
+ <tr>
+ <td>16 - 17</td>
+ <td>Year</td>
+ <td>INTEGER</td>
+ <td>Year (4 digit)</td>
+ </tr>
+ <tr>
+ <td>18</td>
+ <td>Receiver Status</td>
+ <td>BYTE</td>
+ <td>Tracking Status</td>
+ </tr>
+ <tr>
+ <td>19</td>
+ <td>UTC Flags</td>
+ <td>BYTE</td>
+ <td>Leap Second Flags</td>
+ </tr>
+ <tr>
+ <td>20</td>
+ <td>Reserved</td>
+ <td>BYTE</td>
+ <td>Contains 0xFF</td>
+ </tr>
+ <tr>
+ <td>21</td>
+ <td>Reserved</td>
+ <td>BYTE</td>
+ <td>Contains 0xFF</td>
+ </tr>
+ </table>
+ </center>
+
+ <blockquote>
+ <h4>Leap Second Flag Definition:</h4>Bit 0:&nbsp; (1) UTC Time is available<br>
+ Bits 1 - 3: Undefined<br>Bit 4:&nbsp; (1) Leap Scheduled: Leap second pending asserted by GPS control segment.<br>Bit 5:&nbsp; (1) Leap Pending: set 24 hours before, until beginning of leap second.<br>Bit 6:&nbsp; (1) GPS Leap Warning: 6 hours before until 6 hours after leap event<br>Bit 7:&nbsp; (1) Leap In Progress. Only set during the leap second.
+ <h4><a name="TrackingStatus"></a>Tracking Status Flag Definitions:</h4>
+ </blockquote>
+ <center>
+ <table width="712" border="0" cellspacing="0">
+ <tr>
+ <td valign="CENTER" width="5%">Code</td>
+ <td valign="CENTER" width="59%">Meaning</td>
+ <td>Accuracy</td>
+ <td>Receiver Mode</td>
+ </tr>
+ <tr>
+ <td>0</td>
+ <td>Receiver is Navigating</td>
+ <td>+/- 1 us</td>
+ <td>Self Survey</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">1</td>
+ <td valign="CENTER" width="59%">Static 1 Sat. Timing Mode&nbsp;</td>
+ <td>+/- 1 us</td>
+ <td>1-D Timing</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">2</td>
+ <td valign="CENTER" width="59%">Approximate Time</td>
+ <td>20 - 50 ms</td>
+ <td>Acquisition</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">3</td>
+ <td valign="CENTER" width="59%">Startup</td>
+ <td>N/A</td>
+ <td>Initialization</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">4</td>
+ <td valign="CENTER" width="59%">Startup</td>
+ <td>N/A</td>
+ <td>Initialization</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">5</td>
+ <td valign="CENTER" width="59%">Dilution of Position too High&nbsp;</td>
+ <td>5 ppm</td>
+ <td>Self Survey</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">6</td>
+ <td valign="CENTER" width="59%">Static 1 Sat. Timing: Sat. not usable</td>
+ <td>5 ppm</td>
+ <td>1-D Timing</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">7</td>
+ <td valign="CENTER" width="59%">No Satellites Usable</td>
+ <td>N/A</td>
+ <td>Self Survey</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">8</td>
+ <td valign="CENTER" width="59%">Only 1 Satellite Usable</td>
+ <td>20 - 50 ms</td>
+ <td>Self Survey</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">9</td>
+ <td valign="CENTER" width="59%">Only 2 Satellite Usable</td>
+ <td>20 - 50 ms</td>
+ <td>Self Survey</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">10</td>
+ <td valign="CENTER" width="59%">Only 3 Satellites Usable</td>
+ <td>20 - 50 ms</td>
+ <td>Self Survey</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">11</td>
+ <td valign="CENTER" width="59%">Invalid Solution</td>
+ <td>N/A</td>
+ <td>Error</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">12</td>
+ <td valign="CENTER" width="59%">Differential Corrections&nbsp;</td>
+ <td>N/A</td>
+ <td>N/A</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="5%">13</td>
+ <td valign="CENTER" width="59%">Overdetermined Fixes</td>
+ <td>+/- 100 ns</td>
+ <td>Timing Steady State</td>
+ </tr>
+ </table>
+ </center>
+ <h3><b><font size="+0">Packet 8F-0B (Comprehensive Timing Packet)</font></b></h3>
+ <center>
+ <table border="0" cellspacing="0">
+ <tr>
+ <td valign="CENTER" width="9%">Byte</td>
+ <td valign="CENTER" width="27%">Item</td>
+ <td valign="CENTER" width="16%">Type</td>
+ <td valign="CENTER" width="48%">Meaning</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">0</td>
+ <td valign="CENTER" width="27%">Sub-Packet ID</td>
+ <td valign="CENTER" width="16%">BYTE</td>
+ <td valign="CENTER" width="48%">Subcode 0x0B</td>
+ </tr>
+ <tr>
+ <td valign="TOP" width="9%">1 - 2</td>
+ <td valign="TOP" width="27%">Event Count</td>
+ <td valign="TOP" width="16%">INTEGER</td>
+ <td valign="TOP" width="48%">External event count recorded (0 = PPS)</td>
+ </tr>
+ <tr>
+ <td valign="TOP" width="9%">3 - 10</td>
+ <td valign="TOP" width="27%">UTC / GPS TOW</td>
+ <td valign="TOP" width="16%">DOUBLE</td>
+ <td valign="TOP" width="48%">UTC / GPS time of week (seconds)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">11</td>
+ <td valign="CENTER" width="27%">Date</td>
+ <td valign="CENTER" width="16%">BYTE</td>
+ <td valign="CENTER" width="48%">Day of Month</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">12</td>
+ <td valign="CENTER" width="27%">Month</td>
+ <td valign="CENTER" width="16%">BYTE</td>
+ <td valign="CENTER" width="48%">Month of Event</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">13 - 14</td>
+ <td valign="CENTER" width="27%">Year</td>
+ <td valign="CENTER" width="16%">INT</td>
+ <td valign="CENTER" width="48%">Year of event</td>
+ </tr>
+ <tr>
+ <td valign="TOP" width="9%">15</td>
+ <td valign="TOP" width="27%">Receiver Mode</td>
+ <td valign="TOP" width="16%">BYTE</td>
+ <td valign="TOP" width="48%">Receiver operating dimensions:&nbsp;<br>0: Horizontal (2D)&nbsp;<br>1: Full Position (3D)&nbsp;<br>2: Single Satellite (0D)&nbsp;<br>3: Automatic (2D / 3D)&nbsp;<br>4: DGPS reference&nbsp;<br>5: Clock hold (2D)&nbsp;<br>
+ 6: Over determined Clock</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">15 - 17</td>
+ <td valign="CENTER" width="27%">UTC Offset</td>
+ <td valign="CENTER" width="16%">INTEGER</td>
+ <td valign="CENTER" width="48%">UTC Offset value (seconds)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">18 - 25</td>
+ <td valign="CENTER" width="27%">Oscillator Bias</td>
+ <td valign="CENTER" width="16%">DOUBLE</td>
+ <td valign="CENTER" width="48%">Oscillator BIAS (meters)</td>
+ </tr>
+ <tr>
+ <td valign="TOP" width="9%">26 - 33</td>
+ <td valign="TOP" width="27%">Oscillator Drift Rate</td>
+ <td valign="TOP" width="16%">DOUBLE</td>
+ <td valign="TOP" width="48%">Oscillator Drift (meters / second)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">34 - 37</td>
+ <td valign="CENTER" width="27%">Bias Uncertainty</td>
+ <td valign="CENTER" width="16%">SINGLE</td>
+ <td valign="CENTER" width="48%">Oscillator bias uncertainty (meters)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">38 - 41</td>
+ <td valign="CENTER" width="27%">Drift Uncertainty</td>
+ <td valign="CENTER" width="16%">SINGLE</td>
+ <td valign="CENTER" width="48%">Oscillator bias rate uncertainty (m / sec)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">42 - 49</td>
+ <td valign="CENTER" width="27%">Latitude</td>
+ <td valign="CENTER" width="16%">DOUBLE</td>
+ <td valign="CENTER" width="48%">Latitude in radians</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">50 - 57</td>
+ <td valign="CENTER" width="27%">Longitude</td>
+ <td valign="CENTER" width="16%">DOUBLE</td>
+ <td valign="CENTER" width="48%">Longitude in radians</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">58 - 65</td>
+ <td valign="CENTER" width="27%">Altitude</td>
+ <td valign="CENTER" width="16%">DOUBLE</td>
+ <td valign="CENTER" width="48%">Altitude above mean sea level, in meters</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="9%">66 - 73</td>
+ <td valign="CENTER" width="27%">Satellite ID</td>
+ <td valign="CENTER" width="16%">BYTE</td>
+ <td valign="CENTER" width="48%">SV Id No. of tracked satellites</td>
+ </tr>
+ </table>
+ </center>
+ <h3>Thunderbolt Timing packets Data Format</h3>
+ Thunderbolt can output 2 synchronous packets.
+ <h4><b>Primary Timing Packet - 0x8FAB</h4>
+ <center>
+ <table>
+ <tr>
+ <td><b>Byte</b></td>
+ <td><b>Bit</b></td>
+ <td><b>Item</b></td>
+ <td><b>Type</b></td>
+ <td><b>Value</b></td>
+ <td><b>Description</b></td>
+ </tr>
+ <tr>
+ <td>0</td>
+ <td></td>
+ <td>Subcode</td>
+ <td>UINT8</td>
+ <td></td>
+ <td>0xAB</td>
+ </tr>
+ <tr>
+ <td>1-4</td>
+ <td></td>
+ <td>Time of Week</td>
+ <td>UINT32</td>
+ <td></td>
+ <td>GPS seconds of week</td>
+ </tr>
+ <tr>
+ <td>5-6</td>
+ <td></td>
+ <td>Week Number</td>
+ <td>UINT16</td>
+ <td></td>
+ <td>GPS Week Number</td>
+ </tr>
+ <tr>
+ <td>7-8</td>
+ <td></td>
+ <td>UTC Offset</td>
+ <td>SINT16</td>
+ <td></td>
+ <td>UTC Offset (seconds)</td>
+ </tr>
+ <tr>
+ <td valign="top">9</td>
+ <td><table><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</tr><tr><td>4</tr></table></td>
+ <td valign="top">Timing Flag</td>
+ <td valign="top">Bit field</td>
+ <td valign="top"><table><tr><td>0 or 1</td></tr><tr><td>0 or 1</td></tr><tr><td>0 or 1</td></tr><tr><td>0 or 1</tr><tr><td>0 or 1</tr></table></td></td>
+ <td valign="top"><table><tr><td>GPS Time or UTC Time</td></tr><tr><td>GPS PPS or UTC PPS</td></tr><tr><td>time is set or time is not set</td></tr><tr><td>have UTC info or no UTC info</td></tr><tr><td>Time from GPS or time from user</td></tr></table></td>
+ </tr>
+ <tr>
+ <td>10</td>
+ <td></td>
+ <td>Seconds</td>
+ <td>UINT8</td>
+ <td>0-59</td>
+ <td>(60 for UTC leap second event)</td>
+ </tr>
+ <tr>
+ <td>11</td>
+ <td></td>
+ <td>Minutes</td>
+ <td>UINT8</td>
+ <td>0-59</td>
+ <td>Minutes of Hour</td>
+ </tr>
+ <tr>
+ <td>12</td>
+ <td></td>
+ <td>Hours</td>
+ <td>UINT8</td>
+ <td>0-23</td>
+ <td>Hour of Day</td>
+ </tr>
+ <tr>
+ <td>13</td>
+ <td></td>
+ <td>Day of Month</td>
+ <td>UINT8</td>
+ <td>1-31</td>
+ <td>Day of Month</td>
+ </tr>
+ <tr>
+ <td>14</td>
+ <td></td>
+ <td>Month</td>
+ <td>UINT8</td>
+ <td>1-12</td>
+ <td>Month of Year</td>
+ </tr>
+ <tr>
+ <td>15-16</td>
+ <td></td>
+ <td>Year</td>
+ <td>UINT16</td>
+ <td></td>
+ <td>Four digits of Year (e.g. 1998)</td>
+ </tr>
+ </table>
+ </center>
+ <h4><b>Supplemental Timing Packet - 0x8FAC</h4>
+ <center>
+ <table>
+ <tr>
+ <td><b>Byte</b></td>
+ <td><b>Bit</b></td>
+ <td><b>Item</b></td>
+ <td><b>Type</b></td>
+ <td><b>Value</b></td>
+ <td><b>Description</b></td>
+ </tr>
+ <tr>
+ <td>0</td>
+ <td></td>
+ <td>Subcode</td>
+ <td>UINT8</td>
+ <td></td>
+ <td>0xAC</td>
+ </tr>
+ <tr>
+ <td valign="top">1</td>
+ <td></td>
+ <td valign="top">Receiver Mode</td>
+ <td valign="top">UINT8</td>
+ <td valign="top"><table><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</td></tr><tr><td>4</td></tr><tr><td>5</td></tr><tr><td>6</td></tr></table></td>
+ <td valign="top"><table><tr><td>Automatic (2D/3D)</td></tr><tr><td>Single Satellite (Time)</td></tr><tr><td>Horizontal (2D)</td></tr><tr><td>Full Position (3D)</td></tr><tr><td>DGPS Reference</td></tr><tr><td>Clock Hold (2D)</td></tr><tr><td>Overdetermined Clock</td></tr></table></td>
+ </tr>
+ <tr>
+ <td valign="top">2</td>
+ <td></td>
+ <td valign="top">Disciplining Mode</td>
+ <td valign="top">UINT8</td>
+ <td valign="top"><table><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</td></tr><tr><td>4</td></tr><tr><td>5</td></tr><tr><td>6</td></tr></table></td>
+ <td valign="top"><table><tr>Normal<td></td></tr><tr><td>Power-Up</td></tr><tr><td>Auto Holdover</td></tr><tr><td>Manual Holdover</td></tr><tr><td>Recovery</td></tr><tr><td>Not Used</td></tr><tr><td>Disciplining disabled</td></tr></table></td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td></td>
+ <td>Self-Survey Progress</td>
+ <td>UINT 8</td>
+ <td>0-100%</td>
+ <td></td>
+ <tr>
+ <td>4-7</td>
+ <td></td>
+ <td>Holdover Duration</td>
+ <td>UINT 32</td>
+ <td></td>
+ <td>seconds</td>
+ </tr>
+ <tr>
+ <td valign="top">8-9</td>
+ <td><table><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</tr><tr><td>4</tr></table></td>
+ <td valign="top">Critical Alarms</td>
+ <td valign="top">UINT16</td>
+ <td valign="top">Bit field</td>
+ <td valign="top"><table><tr><td>ROM checksum error</td></tr><tr><td>RAM check has failed</td></tr><tr><td>Power supply failure</td></tr><tr><td>FPGA check has failed</td></tr><tr><td>Oscillator control voltage at rail</td></tr></table></td>
+ </tr>
+ <tr>
+ <td valign="top">10-11</td>
+ <td valign="top"><table><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</tr><tr><td>4</tr><tr><td>5</td></tr><tr><td>6</td></tr></table></td>
+ <td valign="top">Minor Alarms</td>
+ <td valign="top">UINT16</td>
+ <td valign="top">Bit field</td>
+ <td valign="top"><table><tr><td>Normal</td></tr><tr><td>Power-Up</td></tr><tr><td>Auto Holdover</td></tr><tr><td>Manual Holdover</tr><tr><td>Recovery</tr><tr><td>Not Used</td></tr><tr><td>Disciplining disabled</td></tr></table></td>
+ </tr>
+ <tr>
+ <td valign="top">12</td>
+ <td></td>
+ <td valign="top">GPS Decoding Status</td>
+ <td valign="top">UINT8</td>
+ <td valign="top"><table><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>3</td></tr><tr><td>8</tr><tr><td>9</tr><tr><td>0x0A</td></tr><tr><td>0x0B</td></tr><tr><td>0x0C</td></tr><tr><td>0x10</tr></table></td>
+ <td valign="top"><table><tr><td>Doing fixes</td></tr><tr><td>Don t have GPS time</td></tr><tr><td>PDOP is too high</td></tr><tr><td>No usable sats</tr><tr><td>Only 1 usable sat</tr><tr><td>Only 2 usable sats</td></tr><tr><td>Only 3 usable sats</td></tr><tr><td>The chosen sat is unusable</td></tr><tr><td>TRAIM rejected the fix</tr></table></td>
+ </tr>
+ <tr>
+ <td valign="top">13</td>
+ <td></td>
+ <td valign="top">Disciplining Activity</td>
+ <td valign="top">UINT8</td>
+ <td><table><tr><td>0</td></tr><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</tr><tr><td>4</tr><tr><td>5</td></tr><tr><td>6</td></tr><tr><td>7</td></tr><tr><td>8</tr></table></td>
+ <td><table><tr><td>Phase locking</td></tr><tr><td>Oscillator warming up</td></tr><tr><td>Frequency locking</td></tr><tr><td>Placing PPS</tr><tr><td>Initializing loop filter</tr><tr><td>Compensating OCXO</td></tr><tr><td>Inactive</td></tr><tr><td>Not used</td></tr><tr><td>Recovery mode</tr></table></td>
+ </tr>
+ <tr>
+ <td>14</td>
+ <td></td>
+ <td>Spare Status 1</td>
+ <td>UINT8</td>
+ <td>0</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>15</td>
+ <td></td>
+ <td>Spare Status 2</td>
+ <td>UINT8</td>
+ <td>0</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>16-19</td>
+ <td></td>
+ <td>PPS Offset</td>
+ <td>Single</td>
+ <td></td>
+ <td>Estimate of UTC/GPS offset (ns)</td>
+ </tr>
+ <tr>
+ <td>20-23</td>
+ <td></td>
+ <td>10 MHz Offset</td>
+ <td>Single</td>
+ <td></td>
+ <td>Estimate of UTC/GPS offset (ns)</td>
+ </tr>
+ <tr>
+ <td>24-27</td>
+ <td></td>
+ <td>DAC Value</td>
+ <td>UINT32</td>
+ <td></td>
+ <td>Offset binary (0x00 - 0xFFFFF)</td>
+ </tr>
+ <tr>
+ <td>28-31</td>
+ <td></td>
+ <td>DAC Voltage</td>
+ <td>Single</td>
+ <td></td>
+ <td>Volts</td>
+ </tr>
+ <tr>
+ <td>32-35</td>
+ <td></td>
+ <td>Temperature</td>
+ <td>Single</td>
+ <td></td>
+ <td>degrees C</td>
+ </tr>
+ <tr>
+ <td>36-43</td>
+ <td></td>
+ <td>Latitude</td>
+ <td>Double</td>
+ <td></td>
+ <td>radians</td>
+ </tr>
+ <tr>
+ <td>44-51</td>
+ <td></td>
+ <td>Longitude</td>
+ <td>Double</td>
+ <td></td>
+ <td>radians</td>
+ </tr>
+ <tr>
+ <td>52-59</td>
+ <td></td>
+ <td>Altitude</td>
+ <td>Double</td>
+ <td></td>
+ <td>Meters</td>
+ </tr>
+ <tr>
+ <td>60-67</td>
+ <td></td>
+ <td>Spare</td>
+ <td></td>
+ <td></td>
+ <td>For Future Expantion</td>
+ </tr>
+ </table>
+ </center>
+ <h2><a name="Pinouts"></a><font size="+1">Pinouts</font></h2>
+ <a href="#Connection">The following connections are required when connecting Palisade with a host:</a><br>&nbsp;<br>&nbsp;
+ <center>
+ <table>
+ <tr>
+ <td><u>Description</u></td>
+ <td><b>Host</b></td>
+ <td></td>
+ <td></td>
+ <td><b>Palisade&nbsp;</b></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><a name="PortA"></a><b>Port A</b></td>
+ <td><u>DB-9</u></td>
+ <td><u>DB-25</u></td>
+ <td></td>
+ <td><u>RS-232</u></td>
+ <td><u>RS-422</u></td>
+ <td><u>Palisade Pin</u></td>
+ </tr>
+ <tr>
+ <td>Receive Data&nbsp;</td>
+ <td>2</td>
+ <td>3</td>
+ <td>&lt;--&gt;</td>
+ <td>Green</td>
+ <td>Green / Blue</td>
+ <td>8 (T-) &amp; 10 (T+)</td>
+ </tr>
+ <tr>
+ <td>Request to Send</td>
+ <td>7</td>
+ <td>4</td>
+ <td>&lt;--&gt;</td>
+ <td>Gray</td>
+ <td>Gray / White</td>
+ <td>6 (R-) &amp; 7 (R+)</td>
+ </tr>
+ <tr>
+ <td>Signal Ground</td>
+ <td>5</td>
+ <td>7</td>
+ <td>&lt;--&gt;</td>
+ <td>Black</td>
+ <td>Black</td>
+ <td>9 (GND)</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><a name="PortB"></a><b>Port B</b></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Receive Data&nbsp;</td>
+ <td>2</td>
+ <td>3</td>
+ <td>&lt;--&gt;</td>
+ <td>Brown</td>
+ <td>Brown / Yellow</td>
+ <td>4 (T-) &amp; 5 (T+)</td>
+ </tr>
+ <tr>
+ <td>Transmit Data</td>
+ <td>3</td>
+ <td>2</td>
+ <td>&lt;--&gt;</td>
+ <td>Violet</td>
+ <td>Orange/ Violet</td>
+ <td>2 (R-) &amp; 3 (R+)</td>
+ </tr>
+ <tr>
+ <td>Signal Ground</td>
+ <td>5</td>
+ <td>7</td>
+ <td>&lt;--&gt;</td>
+ <td>Black</td>
+ <td>Black</td>
+ <td>9 (GND)</td>
+ </tr>
+ </table>
+ </center>
+ <blockquote>
+ Note: If driving the RS-422 inputs on the Palisade single ended, i.e. using the Green and Gray connections only, does not work on all serial ports. Use of the Palisade NTP Synchronization Interface Module is recommended.</blockquote>
+ <blockquote>
+ The 12 pin connector pinout definition:<br>
+ Face the round 12 pin connector at the end of the cable, with the notch turned upwards.<br>
+ Pin 1 is to the left of the notch. Pins 2 - 8 wrap around the bottom, counterclockwise to pin 9 on the right of the notch. Pin 10 is just below the notch. Pins 10 (top), 11 (bottom left) and 12 (bottom right) form a triangle in the center of the connector.</blockquote>
+ <blockquote>
+ <a name="SIM"></a>Pinouts for the Palisade NTP host adapter (Trimble PN 37070) DB-25 M connector are as follows:</blockquote>
+ <center>
+ <table width="682" border="0" cellspacing="0">
+ <tr>
+ <td valign="CENTER" width="12%">DB-25M</td>
+ <td valign="CENTER" width="31%">Conductor&nbsp;</td>
+ <td valign="CENTER" width="16%">Palisade</td>
+ <td valign="CENTER" width="41%">Description</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">1&nbsp;</td>
+ <td valign="CENTER" width="31%">Red</td>
+ <td valign="CENTER" width="16%">1</td>
+ <td valign="CENTER" width="41%">Power</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">7&nbsp;</td>
+ <td valign="CENTER" width="31%">Black</td>
+ <td valign="CENTER" width="16%">9</td>
+ <td valign="CENTER" width="41%">Ground</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">9</td>
+ <td valign="CENTER" width="31%">Black/White</td>
+ <td valign="CENTER" width="16%">12</td>
+ <td valign="CENTER" width="41%">PPS -</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">10&nbsp;</td>
+ <td valign="CENTER" width="31%">Green</td>
+ <td valign="CENTER" width="16%">8</td>
+ <td valign="CENTER" width="41%">Transmit Port A (T-)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">11&nbsp;</td>
+ <td valign="CENTER" width="31%">Brown</td>
+ <td valign="CENTER" width="16%">4</td>
+ <td valign="CENTER" width="41%">Transmit Port B (T-)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">12&nbsp;</td>
+ <td valign="CENTER" width="31%">Gray</td>
+ <td valign="CENTER" width="16%">7</td>
+ <td valign="CENTER" width="41%">Receive Port A (R+)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">13</td>
+ <td valign="CENTER" width="31%">Orange</td>
+ <td valign="CENTER" width="16%">3</td>
+ <td valign="CENTER" width="41%">Receive Port B (R+)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">21</td>
+ <td valign="CENTER" width="31%">Orange/White</td>
+ <td valign="CENTER" width="16%">11</td>
+ <td valign="CENTER" width="41%">PPS +</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">22</td>
+ <td valign="CENTER" width="31%">Blue</td>
+ <td valign="CENTER" width="16%">10</td>
+ <td valign="CENTER" width="41%">Transmit Port A (T+)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">23</td>
+ <td valign="CENTER" width="31%">Yellow</td>
+ <td valign="CENTER" width="16%">5</td>
+ <td valign="CENTER" width="41%">Transmit Port B (T+)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">24</td>
+ <td valign="CENTER" width="31%">White</td>
+ <td valign="CENTER" width="16%">6</td>
+ <td valign="CENTER" width="41%">Receive Port A (R-)</td>
+ </tr>
+ <tr>
+ <td valign="CENTER" width="12%">25</td>
+ <td valign="CENTER" width="31%">Violet</td>
+ <td valign="CENTER" width="16%">2</td>
+ <td valign="CENTER" width="41%">Receive Port B (R-)</td>
+ </tr>
+ </table>
+ </center>
+
+ <b><h3>Notes on the Thunderbolt Receiver's Firmware</h3></b>
+
+ The support for Thunderbolt Receiver in the palisade driver doesn't support (for now) event-polling, the reason is that the Thunderbolt receiver the patch is written for doesn't support time-on-request, so you just have to sit there and wait for the time to arrive with the PPS. We tried to contact Trimble because there's presumably a firmware update that support it, but we didn't have much luck.
+Here is a link explaining the situation:<p>
+<a href="https://lists.ntp.isc.org/pipermail/hackers/2006-April/002216.html">https://lists.ntp.isc.org/pipermail/hackers/2006-April/002216.html
+ <p></p>
+ <hr>
+ <p>Questions or Comments:<br>
+ <a href="mailto:sven_dietrich@trimble.com">Sven Dietrich</a><br>
+ <a href="http://www.trimble.com/">Trimble Navigation Ltd.</a></p>
+ <a href="mailto:fernandoph@iar.unlp.edu.ar">Fernando P. Hauscarriaga</a><br>
+ <p>(last updated January 15, 2007)</p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ ;
+ </body>
+
+</html>
diff --git a/html/drivers/driver3.html b/html/drivers/driver3.html
new file mode 100644
index 0000000..457e5a2
--- /dev/null
+++ b/html/drivers/driver3.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+<title>PSTI/Traconex 1020 WWV/WWVH Receiver</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>PSTI/Traconex 1020 WWV/WWVH Receiver</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:56<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.3.<i>u</i><br>
+ Reference ID: <tt>WWV</tt><br>
+ Driver ID: <tt>WWV_PST</tt><br>
+ Serial Port: <tt>/dev/wwv<i>u</i></tt>; 9600 baud, 8-bits, no parity<br>
+ Features: <tt>tty_clk</tt></p>
+<h4>Description</h4>
+<p>This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH Receivers. No specific claim of accuracy is made for these receiver, but actual experience suggests that 10 ms would be a conservative assumption.</p>
+<p>The dipswitches should be set for 9600 bps line speed, 24-hour day-of-year format and UTC time zone. Automatic correction for DST should be disabled. It is very important that the year be set correctly in the DIP-switches; otherwise, the day of year will be incorrect after 28 April of a normal or leap year. As the there are only four dipswitches to set the year and the base value of zero correspondes to 1986, years beyond 2001 recycle with the value of zero corresponding to 2002. The propagation delay DIP-switches should be set according to the distance from the transmitter for both WWV and WWVH, as described in the instructions. While the delay can be set only to within 11 ms, the fudge time1 parameter can be used for vernier corrections.</p>
+<p>Using the poll sequence <tt>QTQDQM</tt>, the response timecode is in three sections totalling 50 ASCII printing characters, as concatenated by the driver, in the following format:</p>
+<pre>
+ahh:mm:ss.fffs&lt;cr&gt; yy/dd/mm/ddd&lt;cr&gt;
+frdzycchhSSFTttttuuxx&lt;cr&gt;
+
+on-time = first &lt;cr&gt;
+hh:mm:ss.fff = hours, minutes, seconds, milliseconds
+a = AM/PM indicator (' ' for 24-hour mode)
+yy = year (from DIPswitches)
+dd/mm/ddd = day of month, month, day of year
+s = daylight-saving indicator (' ' for 24-hour mode)
+f = frequency enable (O = all frequencies enabled)
+r = baud rate (3 = 1200, 6 = 9600)
+d = features indicator (@ = month/day display enabled)
+z = time zone (0 = UTC)
+y = year (5 = 91)
+cc = WWV propagation delay (52 = 22 ms)
+hh = WWVH propagation delay (81 = 33 ms)
+SS = status (80 or 82 = operating correctly)
+F = current receive frequency (4 = 15 MHz)
+T = transmitter (C = WWV, H = WWVH)
+tttt = time since last update (0000 = minutes)
+uu = flush character (03 = ^c)
+xx = 94 (unknown)</pre>
+<p>The alarm condition is indicated by other than <tt>8</tt> at <tt>a</tt>, which occurs during initial synchronization and when received signal is lost for an extended period; unlock condition is indicated by other than <tt>0000</tt> in the <tt>tttt</tt> subfield.</p>
+<h4>Monitor Data</h4>
+<p>When enabled by the <tt>flag4</tt> fudge flag, every received timecode is written as-is to the <tt>clockstats</tt> file.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not used by this driver.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>WWV</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+</dl>
+<h4>Additional Information</h4>
+<p><a href="../refclock.html">Reference Clock Drivers</a></p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver30.html b/html/drivers/driver30.html
new file mode 100644
index 0000000..ddf9b94
--- /dev/null
+++ b/html/drivers/driver30.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.06 [en] (X11; I; FreeBSD 3.0-CURRENT i386) [Netscape]">
+ <title>Motorola Oncore GPS Receiver</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Motorola Oncore GPS receiver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.30.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: ONCORE<br>
+ Serial Port: <tt>/dev/oncore.serial.</tt><i>u</i>; &nbsp;9600 baud, 8-bits, no parity.<br>
+ PPS Port: <tt>/dev/oncore.pps.</tt><i>u</i>;&nbsp; <tt>PPS_CAPTUREASSERT</tt> required,&nbsp; <tt>PPS_OFFSETASSERT</tt> supported.<br>
+ Configuration File: <tt>ntp.oncore</tt>, or <tt>ntp.oncore.</tt><i>u</i>, or <tt>ntp.oncore</tt><i>u</i>, in <tt>/etc/ntp</tt> or <tt>/etc</tt>.</p>
+ <h4>Description</h4>
+ <p>This driver supports most models of the <a href="http://www.mot.com/AECS/PNSB/products">Motorola Oncore GPS receivers</a> (Basic, PVT6, VP, UT, UT+, GT, GT+, SL, M12, M12+T), as long as they support the <i>Motorola Binary Protocol</i>.</p>
+ <p>The interesting versions of the Oncore are the VP, the UT+, the &quot;Remote&quot; which is a prepackaged UT+, and the M12 Timing. The VP is no longer available new, and the UT, GT, and SL are at end-of-life. The Motorola evaluation kit can be recommended. It interfaces to a PC straightaway, using the serial (DCD) or parallel port for PPS input and packs the receiver in a nice and sturdy box. Less expensive interface kits are available from <a href="http://www.tapr.org">TAPR</a> and <a href="http://www.synergy-gps.com">Synergy</a>.<br>&nbsp;</p>
+ <center>
+ <table>
+ <tr>
+ <td><img src="../pic/oncore_utplusbig.gif" alt="gif" height="124" width="210"></td>
+ <td><img src="../pic/oncore_evalbig.gif" alt="gif" height="124" width="182"></td>
+ <td><img src="../pic/oncore_remoteant.jpg" alt="gif" height="188" width="178"></td>
+ </tr>
+ <tr>
+ <td>
+ <center>
+ UT+ oncore</center>
+ </td>
+ <td>
+ <center>
+ Evaluation kit</center>
+ </td>
+ <td>
+ <center>
+ Oncore Remote</center>
+ </td>
+ </tr>
+ </table>
+ </center>
+ <p>The driver requires a standard <tt>PPS</tt> interface for the pulse-per-second output from the receiver. The serial data stream alone does not provide precision time stamps (0-50msec variance, according to the manual), whereas the PPS output is precise down to 50 nsec (1 sigma) for the VP/UT models and 25 nsec for the M12 Timing. If you do not have the PPS signal available, then you should probably be using the NMEA driver rather than the Oncore driver. Most of these are available on-line</p>
+ <p>The driver will use the &quot;position hold&quot; mode with user provided coordinates, the receivers built-in site-survey, or a similar algorithm implemented in this driver to determine the antenna position.</p>
+ <h4>Monitor Data</h4>
+ The driver always puts a lot of useful information on the clockstats file, and when run with debugging can be quite chatty on stdout. When first starting to use the driver you should definitely review the information written to the clockstats file to verify that the driver is running correctly.
+ <p>In addition, on platforms supporting Shared Memory, all of the messages received from the Oncore receiver are made available in shared memory for use by other programs. See the <a href="oncore-shmem.html">Oncore-SHMEM</a> manual page for information on how to use this option. For either debugging or using the SHMEM option, an Oncore Reference Manual for the specific receiver in use will be required.</p>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not used by this driver.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+ </dl>
+ <h4>Additional Information</h4>
+ <p>The driver was initially developed on FreeBSD, and has since been tested on Linux, SunOS and Solaris.</p>
+ <p><b>Configuration</b></p>
+ <p>There is a driver specific configuration file <tt>ntp.oncore</tt> (or <tt>ntp.oncore.</tt><i>u</i> or <tt>ntp.oncore</tt><i>u</i> if you must distinguish between more than one Oncore receiver) that contains information on the startup mode, the location of the GPS receiver, an offset of the PPS signal from zero, and the cable delay. The offset shifts the PPS signal to avoid interrupt pileups `on' the second, and adjusts the timestamp accordingly. See the driver source for information on this file. The default with no file is: no delay, no offset, and a site survey is done to get the location of the gps receiver.</p>
+ <p>The following three options can be set in the driver specific configuration file only if the driver is using the PPSAPI. The edge of the PPS signal that is `on-time' can be set with the keywords [ASSERT/CLEAR] and the word HARDPPS will cause the PPS signal to control the kernel PLL.</p>
+ <p><b>Performance</b></p>
+ <p>Really good. With the VP/UT+, the generated PPS pulse is referenced to UTC(GPS)&nbsp;with better than 50 nsec (1 sigma) accuracy. The limiting factor will be the timebase of the computer and the precision with which you can timestamp the rising flank of the PPS signal. Using FreeBSD, a FPGA&nbsp;based Timecounter/PPS&nbsp;interface, and an ovenized quartz oscillator, that performance has been reproduced. For more details on this aspect: <a href="http://phk.freebsd.dk/rover.html">Sub-Microsecond timekeeping under FreeBSD</a>.</p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver31.html b/html/drivers/driver31.html
new file mode 100644
index 0000000..a329faf
--- /dev/null
+++ b/html/drivers/driver31.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.06 [en] (X11; I; FreeBSD 3.0-CURRENT i386) [Netscape]">
+ <title>Rockwell Jupiter GPS Receiver</title>
+ <link href="../scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Rockwell Jupiter GPS receiver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.31.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: JUPITER<br>
+ Serial Port: <tt>/dev/gps</tt><i>u</i>; &nbsp;9600 baud, 8-bits, no parity.</p>
+ <h4>Description</h4>
+ <p>This driver supports at least some models of the <a href="http://www.navman.com/oem/products/receivers/jupiter/">Rockwell Jupiter <tt>GPS</tt> receivers</a> (Jupiter 11, Jupiter-T), they must at least support the <i>Zodiac Binary Protocol</i>.</p>
+ <p>The driver requires a standard <tt>PPS</tt> interface for the pulse-per-second output from the receiver. The serial data stream alone does not provide precision time stamps, whereas the PPS output is precise down to 40 ns (1 sigma) for the Jupiter 11 and 25 ns (1 sigma) for Jupiter-T according to the documentation. If you do not have the PPS signal available, then you should probably not be using the Jupiter receiver as a time source. This driver requires a <tt>PPS</tt> signal and the time output from Jupiter receivers is not predictable in <tt>NMEA</tt> mode; the reported time can take one second steps.</p>
+ <h4>Monitor Data</h4>
+ <p>The driver always puts a lot of useful information on the clockstats file, and when run with debugging can be quite chatty on stdout. When first starting to use the driver you should definitely review the information written to the clockstats file to verify that the driver is running correctly.</p>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not used by this driver. Should be left at zero.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an <tt>ASCII</tt> string from one to four characters, with default <tt>GPS</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Specifies the mobility of the <tt>GPS</tt> receiver: 0 for walking (default), 1 for driving.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Specifies the <tt>PPS</tt> signal on-time edge: 0 for assert (default), 1 for clear.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+ </dl>
+ <h4>Additional Information</h4>
+ <p>The driver was resurrected from a sorry state using the Windows NT port and a Jupiter 11, and has since seen little testing on other platforms. On Windows there exist a barrier though, as there is no publicly available <tt>PPSAPI</tt> implementation, at least not to my knowledge. However, there has been one success report using Linux 2.4.20 and PPSkit 2.1.1.</p>
+ <p>The Jupiter receivers seem to have quite a few names. They are referred to at least as Rockwell receivers, Navman receivers, Zodiac receivers, Conexant receivers and SiRF Technology receivers. Rockwell seems to be the original and most commonly used name and Navman seems to be the current supplier.</p>
+ <p><b>Configuration</b></p>
+ <p>The edge of the <tt>PPS</tt> signal that is `on-time' can be set with <tt>flag2</tt>. There is currently no way to cause the <tt>PPS</tt> signal to control the kernel <tt>PLL</tt>.</p>
+ <p><b>Performance</b></p>
+ <p>The performance is largely unexplored. I have achieved submillisecond stability using a Jupiter 11, but the poor result is more than likely due to the proprietary <tt>PPSAPI</tt> implementation or Windows itself.</p>
+ <p>This driver does not handle leap seconds.</p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="../scripts/footer.txt"></script>
+ </body>
+
+</html>
+
+=
diff --git a/html/drivers/driver32.html b/html/drivers/driver32.html
new file mode 100644
index 0000000..8cb810a
--- /dev/null
+++ b/html/drivers/driver32.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <title>Chrono-log K-series WWVB receiver</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Chrono-log K-series WWVB receiver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.32.<i>u</i><br>
+ Reference ID: <tt>CHRONOLOG</tt><br>
+ Driver ID: <tt>CHRONOLOG</tt><br>
+ Serial Port: <tt>/dev/chronolog<i>u</i></tt>; 2400 bps, 8-bits, no parity<br>
+ <br>
+ Features: <tt>(none)</tt></p>
+ <h4>Description</h4>
+ <p>This driver supports the Chrono-log K-series WWVB receiver. This is a very old receiver without provisions for leap seconds, quality codes, etc. It assumes output in the local time zone, and that the C library mktime()/localtime() routines will correctly convert back and forth between local and UTC. There is a hack in the driver for permitting UTC, but it has not been tested.</p>
+ <p>Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.</p>
+ <pre>
+Timecode format: Y yy/mm/ddCLZhh:mm:ssCL
+Y - year/month/date line indicator
+yy/mm/dd -- two-digit year/month/day
+C - \r (carriage return)
+L - \n (newline)
+Z - timestamp indicator
+hh:mm:ss - local time
+</pre>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver33.html b/html/drivers/driver33.html
new file mode 100644
index 0000000..6142f53
--- /dev/null
+++ b/html/drivers/driver33.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <title>Dumb Clock</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Dumb Clock</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.33.<i>u</i><br>
+ Reference ID: <tt>DUMBCLOCK</tt><br>
+ Driver ID: <tt>DUMBCLOCK</tt><br>
+ Serial Port: <tt>/dev/dumbclock<i>u</i></tt>; 9600 bps, 8-bits, no parity<br>
+ Features: <tt>(none)</tt></p>
+ <h4>Description</h4>
+ <p>This driver supports a dumb ASCII clock that only emits localtime at a reliable interval. This has no provisions for leap seconds, quality codes, etc. It assumes output in the local time zone, and that the C library mktime()/localtime() routines will correctly convert back and forth between local and UTC.</p>
+ <p>Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.</p>
+ <pre>
+Timecode format: hh:mm:ssCL
+hh:mm:ss - local time
+C - \r (carriage return)
+L - \n (newline)
+</pre>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver34.html b/html/drivers/driver34.html
new file mode 100644
index 0000000..65ce819
--- /dev/null
+++ b/html/drivers/driver34.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>Ultralink Clock</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Ultralink Clock</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Dec-2007 19:43<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.34.<i>u</i><br>
+ Reference ID: <tt>WWVB</tt><br>
+ Driver ID: <tt>ULINK</tt><br>
+ Serial Port: <tt>/dev/wwvb<i>u</i></tt>; 9600 bps, 8-bits, no parity<br>
+ Features: <tt>(none)</tt></p>
+ <h4>Description</h4>
+ <p>This driver supports the Ultralink Model 325 (replacement for Model 320) RS-232 powered WWVB receiver. PDF specs available on <a href="http://www.ulio.com/">http://www.ulio.com/</a>. This driver also supports the Model 320, 330,331,332 decoders in both polled or continous time code mode.Leap second and quality are supported. Most of this code is originally from refclock_wwvb.c with thanks. Any mistakes are mine. Any improvements are welcome.</p>
+ <h4>Model 325 timecode format</h4>
+ <p><tt>&lt;cr&gt;&lt;lf&gt;RQ_1C00LYYYY+DDDUTCS_HH:MM:SSL+5</tt></p>
+ <p>R = Signal readability indicator, ranging from R1 to R5 Q R1 is unreadable, R5 is best reception<br>
+ _ = Space<br>
+ 1 = prev. received data bit, values: 0, 1 ,M or ? unknown
+ C = Signal reception from (C)olorado or (H)awaii 0 = Hours since last WWVB time and flag code update, values 0 00 to 99 (hopefully always 00)<br>
+ L = HEX A5 if receiver is locked to WWVB, Space if not<br>
+ YYYY = Year from 2000 to 2099<br>
+ + = '+' if current year is a leap year, else ' '<br>
+ DDD = current day in the year from 1 to 365/366<br>
+ UTC = timezone (always UTC)<br>
+ S = Daylight savings indicator, (S)TD, (D)ST, (O) transition into DST, (I) transition out of DST<br>
+ _ = Space<br>
+ HH = UTC hour 0 to 23<br>
+ : = Time delimiter, ':' if synced, Space if not<br>
+ MM = Minutes of current hour from 0 to 59<br>
+ : = Time delimiter, ':' if synced, Space if not<br>
+ SS = Seconds of current minute from 0 to 59<br>
+ mm = 10's milliseconds of the current second from 00 to 99<br>
+ L = Leap second pending at end of month, (I)nsert, (D)elete or Space<br>
+ +5 = UT1 correction, +/- .1 sec increments</p>
+ <p>Note that Model 325 reports a very similar output like Model 33X series. The driver for this clock is similar to Model 33X behavior. On a unmodified new ULM325 clock, the polling flag (flag1 =1) needs to be set.</p>
+ <h4>Model 320 timecode format</h4>
+ <p><tt>&lt;cr&gt;&lt;lf&gt;SQRYYYYDDD+HH:MM:SS.mmLT&lt;cr&gt;</tt></p>
+ <p>S = 'S' -- sync'd in last hour, '0'-'9' - hours x 10 since last update, else '?'<br>
+ Q = Number of correlating time-frames, from 0 to 5<br>
+ R = 'R' -- reception in progress,'N' -- Noisy reception, ' ' -- standby mode<br>
+ YYYY = year from 1990 to 2089<br>
+ DDD = current day from 1 to 366 + = '+' if current year is a leap year, else ' '<br>
+ HH = UTC hour 0 to 23<br>
+ MM = Minutes of current hour from 0 to 59<br>
+ SS = Seconds of current minute from 0 to 59<br>
+ mm = 10's milliseconds of the current second from 00 to 99<br>
+ L = Leap second pending at end of month -- 'I' = insert, 'D'=delete<br>
+ T = DST &lt;-&gt; STD transition indicators</p>
+ <p>Note that this driver does not do anything with the T flag. The M320 also has a 'U' command which returns UT1 correction information. It is not used in this driver.</p>
+ <h4>Model 33x timecode format</h4>
+ <p><tt>S9+D 00 YYYY+DDDUTCS HH:MM:SSl+5</tt></p>
+ <p>S = sync indicator S insync N not in sync the sync flag is WWVB decoder sync nothing to do with time being correct </p>
+ <p>9+ = signal level 0 thru 9+ If over 9 indicated as 9<br>
+ D = data bit (fun to watch but useless ;-) space<br>
+ 00 = hours since last GOOD WWVB frame sync space<br>
+ YYYY = current year + = leap year indicator<br>
+ DDD = day of year<br>
+ UTC = timezone (always UTC)<br>
+ S = daylight savings indicator space<br>
+ HH = hours : = This is the REAL in sync indicator (: = insync)<br>
+ MM = minutes : = : = in sync ? = NOT in sync<br>
+ SS = seconds<br>
+ L = leap second flag<br>
+ +5 = UT1 correction (sign + digit ))</p>
+ <p>This driver ignores UT1 correction, DST indicator,Leap year and signal level.</p>
+ <h4>Fudge factors</h4>
+ <p>flag1 polling enable (1=poll 0=no poll)</p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+</html>
diff --git a/html/drivers/driver35.html b/html/drivers/driver35.html
new file mode 100644
index 0000000..3ded63f
--- /dev/null
+++ b/html/drivers/driver35.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>Conrad parallel port radio clock</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Conrad parallel port radio clock</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.35.<i>u</i><br>
+ Reference ID: <tt>PCF</tt><br>
+ Driver ID: <tt>PCF</tt><br>
+ Parallel Port: <tt>/dev/pcfclocks/<i>u</i></tt> or <tt>/dev/pcfclock<i>u</i></tt></p>
+ <h4>Description</h4>
+ <p>This driver supports the parallel port radio clock sold by <a href="http://www.conrad-electronic.com/">Conrad Electronic</a> under order numbers 967602 and 642002. This clock is put between a parallel port and your printer. It receives the legal German time, which is either CET or CEST, from the DCF77 transmitter and uses it to set its internal quartz clock. The DCF77 transmitter is located near to Frankfurt/Main and covers a radius of more than 1500 kilometers.</p>
+ <p>The pcfclock device driver is required in order to use this reference clock driver. Currently device drivers for <a href="http://home.pages.de/%7evoegele/pcf.html">Linux</a> and <a href="http://schumann.cx/pcfclock/">FreeBSD</a> are available.</p>
+ <p>This driver uses C library functions to convert the received timecode to UTC and thus requires that the local timezone be CET or CEST. If your server is not located in Central Europe you have to set the environment variable TZ to CET before starting <tt>ntpd</tt>.</p>
+ <h4>Monitor Data</h4>
+ <p>Each timecode is written to the <tt>clockstats</tt> file in the format <tt>YYYY MM DD HH MI SS</tt>.</p>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.1725.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not used by this driver.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>PCF</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>If set to 1, the radio clock's synchronisation status bit is ignored, ie the timecode is used without a check.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+ </dl>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver36.html b/html/drivers/driver36.html
new file mode 100644
index 0000000..2b25324
--- /dev/null
+++ b/html/drivers/driver36.html
@@ -0,0 +1,150 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Radio WWV/H Audio Demodulator/Decoder</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Radio WWV/H Audio Demodulator/Decoder</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+Last updage:
+ <!-- #BeginDate format:En2m -->15-Nov-2012 06:42<!-- #EndDate -->
+UTC</p>
+<hr>
+<h4>Synopsis</h4>
+Address: 127.127.36.<i>u</i><br>
+Reference ID: <tt>WV<i>f</i></tt> or <tt>WH<i>f</i></tt><br>
+Driver ID: <tt>WWV_AUDIO</tt><br>
+Autotune Port: <tt>/dev/icom</tt>; 1200/9600 baud, 8-bits, no parity<br>
+Audio Device: <tt>/dev/audio</tt> and <tt>/dev/audioctl</tt>
+<h4>Description</h4>
+This driver synchronizes the computer time using shortwave radio transmissions from NIST time/frequency stations <a href="http://www.bldrdoc.gov/timefreq/stations/wwv.html">WWV</a> in Ft. Collins, CO, and <a href="http://www.bldrdoc.gov/timefreq/stations/wwvh.htm">WWVH</a> in Kauai, HI. Transmissions are made continuously on 2.5, 5, 10 and 15 MHz from both stations and on 20 MHz from WWV. An ordinary shortwave receiver can be tuned manually to one of these frequencies or, in the case of ICOM receivers, the receiver can be tuned automatically by the driver as propagation conditions change throughout the day and season. The radio is connected via an optional attenuator and cable to either the microphone or line-in port of a workstation or PC.
+<p>The driver requires an audio codec or sound card with sampling rate 8 kHz and &mu;-law companding to demodulate the data. This is the same standard as used by the telephone industry and is supported by most hardware and operating systems, including Solaris, FreeBSD and Linux, among others. In this implementation only one audio driver and codec can be supported on a single machine. In order to assure reliable signal capture, the codec frequency error must be less than 187 PPM (.0187 percent). If necessary, the <tt>tinker codec</tt> configuration command can be used to bracket the codec frequency to this range.</p>
+<p>In general and without calibration, the driver is accurate within 1 ms relative to the broadcast time when tracking a station. However, variations up to 0.3 ms can be expected due to diurnal variations in ionospheric layer height and ray geometry. In Newark DE, 2479 km from the transmitter, the predicted two-hop propagation delay varies from 9.3 ms in sunlight to 9.0 ms in moonlight. When not tracking the station the accuracy depends on the computer clock oscillator stability, ordinarily better than 0.5 PPM.</p>
+<p>After calibration relative to the PPS&nbsp;signal from a GPS&nbsp;receiver, the mean offset with a 2.4-GHz P4 running FreeBSD 6.1 is generally within 0.1 ms short-term with 0.4 ms jitter. The long-term mean offset varies up to 0.3 ms due to propagation path geometry variations. The processor load due to the driver is 0.4 percent on the P4.</p>
+<p>The driver performs a number of error checks to protect against overdriven or underdriven input signal levels, incorrect signal format or improper hardware configuration. The specific checks are detailed later in this page. Note that additional checks are done elsewhere in the reference clock interface routines.</p>
+<p>This driver incorporates several features in common with other audio drivers such as described in the <a href="driver7.html">Radio CHU Audio Demodulator/Decoder</a> and the <a href="driver6.html">IRIG Audio Decoder</a> pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p>
+<h4>Technical Overview</h4>
+<p>The driver processes 8-kHz &mu;-law companded codec samples using maximum-likelihood techniques which exploit the considerable degree of redundancy available in the broadcast signal. The WWV signal format is described in NIST Special Publication 432 (Revised 1990) and also available on the <a href="http://tf.nist.gov/stations/wwvtimecode.htm">WWV/H web site</a>. It consists of three elements, a 5-ms, 1000-Hz pulse, which occurs at the beginning of each second, a 800-ms, 1000-Hz pulse, which occurs at the beginning of each minute, and a pulse-width modulated 100-Hz subcarrier for the data bits, one bit per second. The WWVH format is identical, except that the 1000-Hz pulses are sent at 1200 Hz. Each minute encodes nine BCD digits for the time of century plus seven bits for the daylight savings time (DST) indicator, leap warning indicator and DUT1 correction.</p>
+<p>The demodulation and decoding algorithms used by this driver are based on a machine language program developed for the TAPR DSP93 DSP unit, which uses the TI 320C25 DSP chip. The analysis, design and performance of the program for this unit is described in: Mills, D.L. A precision radio clock for WWV transmissions. Electrical Engineering Report 97-8-1, University of Delaware, August 1997, 25 pp. Available from <a href="http://www.eecis.udel.edu/%7emills/reports.html">www.eecis.udel.edu/~mills/reports.htm</a>. For use in this driver, the original program was rebuilt in the C language and adapted to the NTP driver interface. The algorithms have been modified to improve performance, especially under weak signal conditions and to provide an automatic frequency and station selection feature.</p>
+<p>As in the original program, the clock discipline is modelled as a Markov process, with probabilistic state transitions corresponding to a conventional clock and the probabilities of received decimal digits. The result is a performance level with very high accuracy and reliability, even under conditions when the minute beep of the signal, normally its most prominent feature, can barely be detected by ear using a communications receiver.</p>
+<h4>Baseband Signal Processing</h4>
+<p>The 1000/1200-Hz pulses and 100-Hz subcarrier are first separated using a 600-Hz bandpass filter centered on 1100 Hz and a 150-Hz lowpass filter. The minute pulse is extracted using an 800-ms synchronous matched filter and pulse grooming logic which discriminates between WWV and WWVH signals and noise. The second pulse is extracted using a 5-ms FIR matched filter for each station and a single 8000-stage comb filter.</p>
+<p>The phase of the 100-Hz subcarrier relative to the second pulse is fixed at the transmitter; however, the audio stage in many radios affects the phase response at 100 Hz in unpredictable ways. The driver adjusts for each radio using two 170-ms synchronous matched filters. The I (in-phase) filter is used to demodulate the subcarrier envelope, while the Q (quadrature-phase) filter is used in a type-1 phase-lock loop (PLL) to discipline the demodulator phase.</p>
+<p>A bipolar data signal is determined from the matched filter subcarrier envelope using a pulse-width discriminator. The discriminator samples the I channel at 15 ms (<i>n</i>), 200 ms (<i>s</i><sub>0</sub>) and 500 ms (<i>s</i><sub>1</sub>), and the envelope (RMS I and Q channels) at 200 ms (<i>e</i><sub>1</sub>) and the end of the second (<i>e</i><sub>0</sub>). The bipolar data signal is expressed 2<i>s</i><sub>1</sub> - <i>s</i><sub>0</sub> - <i>n</i>, where positive values correspond to data 1 and negative values correspond to data 0. Note that, since the signals <i>s</i><sub>0</sub> and <i>s</i><sub>1</sub> include the noise <i>n</i>, the noise component cancels out. The data bit SNR is calculated as 20 log<sub>10</sub>(<i>e</i><sub>1</sub> / <i>e</i><sub>0</sub>). If the driver has not synchronized to the minute pulse, or if the data bit amplitude <i>e</i><sub>1</sub> or SNR are below thresholds, the bit is considered invalid and the bipolar signal is forced to zero.</p>
+<p>The bipolar signal is exponentially averaged in a set of 60 accumulators, one for each second, to determine the semi-static miscellaneous bits, such as DST indicator, leap second warning and DUT1 correction. In this design a data average value larger than a positive threshold is interpreted as +1 (hit) and a value smaller than a negative threshold as a -1 (miss). Values between the two thresholds, which can occur due to signal fades, are interpreted as an erasure and result in no change of indication.</p>
+<h4>Maximum-Likelihood Decoder</h4>
+<p>The BCD digit in each digit position of the timecode is represented as four data bits. The bits are correlated with the bits corresponding to each of the valid decimal digits in this position. If any of the four bits are invalid, the correlated value for all digits in this position is assumed zero. In either case, the values for all digits are exponentially averaged in a likelihood vector associated with this position. The digit associated with the maximum over all averaged values then becomes the maximum-likelihood candidate for this position and the ratio of the maximum over the next lower value represents the digit SNR.</p>
+<p>The decoding matrix contains nine row vectors, one for each digit position. Each row vector includes the maximum-likelihood digit, likelihood vector and other related data. The maximum-likelihood digit for each of the nine digit positions becomes the maximum-likelihood time of the century. A built-in transition function implements a conventional clock with decimal digits that count the minutes, hours, days and years, as corrected for leap seconds and leap years. The counting operation also rotates the likelihood vector corresponding to each digit as it advances. Thus, once the clock is set, each clock digit should correspond to the maximum-likelihood digit as transmitted.</p>
+<p>Each row of the decoding matrix also includes a compare counter and the most recently determined maximum-likelihood digit. If a digit likelihood exceeds the decision level and compares with previous digits for a number of successive minutes in any row, the maximum-likelihood digit replaces the clock digit in that row. When this condition is true for all rows and the second epoch has been reliably determined, the clock is set (or verified if it has already been set) and delivers correct time to the integral second. The fraction within the second is derived from the logical master clock, which runs at 8000 Hz and drives all system timing functions.</p>
+<h4>Master Clock Discipline</h4>
+<p>The logical master clock is derived from the audio codec clock. Its frequency is disciplined by a frequency-lock loop (FLL) which operates independently of the data recovery functions. The maximum value of the 5-ms pulse after the comb filter represents the on-time epoch of the second. At averaging intervals determined by the measured jitter, the frequency error is calculated as the difference between the epoches over the interval divided by the interval itself. The sample clock frequency is then corrected by this amount divided by a time constant of 8.</p>
+<p>When first started, the frequency averaging interval is 8 seconds, in order to compensate for intrinsic codec clock frequency offsets up to 125 PPM. Under most conditions, the averaging interval doubles in stages from the initial value to 1024 s, which results in an ultimate frequency resolution of 0.125 PPM, or about 11 ms/day.</p>
+<p>The data demodulation functions operate using the subcarrier clock, which is independent of the epoch. However, the data decoding functions are driven by the epoch. The decoder is phase-locked to the epoch in such a way that, when the clock state machine has reliably decoded the broadcast time to the second, the epoch timestamp of that second becomes a candidate to set the system clock.</p>
+<p>The comb filter can have a long memory and is vulnerable to noise and stale data, especially when coming up after a long fade. Therefore, a candidate is considered valid only if the 5-ms signal amplitude and SNR&nbsp;are above thresholds. In addition, the system clock is not set until after one complete averaging interval has passed with valid candidates.</p>
+<h4>Station Identification</h4>
+<p>It is important that the logical clock frequency is stable and accurately determined, since in many applications the shortwave radio will be tuned to a fixed frequency where WWV or WWVH signals are not available throughout the day. In addition, in some parts of the US, especially on the west coast, signals from either or both WWV and WWVH may be available at different times or even at the same time. Since the propagation times from either station are almost always different, each station must be reliably identified before attempting to set the clock.</p>
+<p>Reliable station identification requires accurate discrimination between very weak signals in noise and noise alone. The driver very aggressively soaks up every scrap of signal information, but has to be careful to avoid making pseudo-sense of noise alone. The signal quality metric depends on the minute pulse amplitude and SNR measured in second 0 of the minute, together with the data subcarrier amplitude and SNR measured in second 1. If all four values are above defined thresholds a hit is declared, otherwise a miss. In principle, the data pulse in second 58 is usable, but the AGC in most radios is not fast enough for a reliable measurement.</p>
+<p>The number of hits declared in the last 6 minutes for each station represents the high order bits of the metric, while the current minute pulse amplitude represents the low order bits. Only if the metric is above a defined threshold is the station signal considered acceptable. The metric is also used by the autotune function described below and reported in the timecode string.</p>
+<h4>Performance</h4>
+<p>It is the intent of the design that the accuracy and stability of the indicated time be limited only by the characteristics of the ionospheric propagation medium. Conventional wisdom is that manual synchronization via oscilloscope and HF medium is good only to a millisecond under the best propagation conditions. The performance of the NTP daemon disciplined by this driver is clearly better than this, even under marginal conditions.</p>
+<p>The figure below shows the measured offsets over a typical day near the bottom of the sunspot cycle ending in October, 2006. Variations up to &plusmn;0.4 ms can be expected due to changing ionospheric layer height and ray geometry over the day and night.</p>
+<div align="center"> <img src="../pic/offset1211.gif" alt="gif"></div>
+<p>The figure was constructed using a 2.4-GHz P4 running FreeBSD 6.1. For these measurements the computer clock was disciplined within a few microseconds of UTC using a PPS signal and GPS receiver and the measured offsets determined from the filegen peerstats data.</p>
+<p>The predicted propagation delay from the WWV transmitter at Boulder, CO, to the receiver at Newark, DE, varies over 9.0-9.3 ms. In addition, the receiver contributes 4.7 ms and the 600-Hz bandpass filter 0.9 ms. With these values, the mean error is less than 0.1 ms and varies &plusmn;0.3 ms over the day as the result of changing ionospheric height and ray geometry.</p>
+<h4>Program Operation</h4>
+The driver begins operation immediately upon startup. It first searches for one or both of the stations WWV and WWVH and attempts to acquire minute synch. This may take some fits and starts, as the driver expects to see several consecutive minutes with good signals and low jitter. If the autotune function is active, the driver will rotate over all five frequencies and both WWV and WWVH stations until finding a station and frequency with acceptable metric.
+<p>While this is going on the the driver acquires second synch, which can take up to several minutes, depending on signal quality. When minute synch has been acquired, the driver accumulates likelihood values for the unit (seconds) digit of the nine timecode digits, plus the seven miscellaneous bits included in the WWV/H transmission format. When a good unit digit has been found, the driver accumulated likelihood values for the remaining eight digits of the timecode. When three repetitions of all nine digits have decoded correctly, which normally takes 15 minutes with good signals, and up to 40 minutes when buried in noise, and the second synch has been acquired, the clock is set (or verified) and is selectable to discipline the system clock.</p>
+<p>Once the clock is set, it continues to provide correct timecodes as long as the signal metric is above threshold, as described in the previous section. As long as the clock is correctly set or verified, the system clock offsets are provided once each minute to the reference clock interface, where they are processed using the same algorithms as with other reference clocks and remote servers.</p>
+<p>It may happen as the hours progress around the clock that WWV and WWVH signals may appear alone, together or not at all. When the driver has mitigated which station and frequency is best, it sets the reference identifier to the string WV<i>f</i> for WWV and WH<i>f</i> for WWVH, where <i>f</i> is the frequency in megahertz. If the propagation delays have been properly set with the <tt>fudge time1</tt> (WWV) and <tt>fudge time2</tt> (WWVH) commands in the configuration file, handover from one station to the other is seamless.</p>
+<p>Operation continues as long as the signal metric from at least one station on at least one frequency is acceptable. A consequence of this design is that, once the clock is set, the time and frequency are disciplined only by the second synch pulse and the clock digits themselves are driven by the clock state machine. If for some reason the state machine drifts to the wrong second, it would never resynchronize. To protect against this most unlikely situation, if after two days with no signals, the clock is considered unset and resumes the synchronization procedure from the beginning.</p>
+<p>Once the system clock been set correctly it will continue to read correctly even during the holdover interval, but with increasing dispersion. Assuming the system clock frequency can be disciplined within 1 PPM, it can coast without signals for several days without exceeding the NTP step threshold of 128 ms. During such periods the root distance increases at 15 &mu;s per second, which makes the driver appear less likely for selection as time goes on. Eventually, when the distance due all causes exceeds 1 s, it is no longer suitable for synchronization. Ordinarily, this happens after about 18 hours with no signals. The <tt>tinker maxdist</tt> configuration command can be used to change this value.</p>
+<h4>Autotune</h4>
+<p>The driver includes provisions to automatically tune the radio in response to changing radio propagation conditions throughout the day and night. The radio interface is compatible with the ICOM CI-V standard, which is a bidirectional serial bus operating at TTL levels. The bus can be connected to a standard serial port using a level converter such as the CT-17. Further details are on the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p>
+<p>If specified, the driver will attempt to open the device <tt>/dev/icom</tt> and, if successful will activate the autotune function and tune the radio to each operating frequency in turn while attempting to acquire minute synch from either WWV or WWVH. However, the driver is liberal in what it assumes of the configuration. If the <tt>/dev/icom</tt> link is not present or the open fails or the CI-V bus is inoperative, the driver quietly gives up with no harm done.</p>
+<p>Once acquiring minute synch, the driver operates as described above to set the clock. However, during seconds 59, 0 and 1 of each minute it tunes the radio to one of the five broadcast frequencies to measure the signal metric as described above. Each of the five frequencies are probed in a five-minute rotation to build a database of current propagation conditions for all signals that can be heard at the time. At the end of each probe a mitigation procedure scans the database and retunes the radio to the best frequency and station found. For this to work well, the radio should be set for a fast AGC recovery time. This is most important while tracking a strong signal, which is normally the case, and then probing another frequency, which may have much weaker signals.</p>
+<p>The mitigation procedure selects the frequency and station with the highest valid metric, ties going first to the highest frequency and then to WWV in order. A station is considered valid only if the metric is above a specified threshold; if no station is above the metric, the rotating probes continue until a valid station is found.</p>
+<p>The behavior of the autotune function over a typical day is shown in the figure below.</p>
+<div align="center"> <img src="../pic/freq1211.gif" alt="gif"></div>
+<p>As expected, the lower frequencies prevail when the ray path is in moonlight (0100-1300 UTC) and the higher frequencies when the path is in sunlight (1300-0100 UTC). Note three periods in the figure show zero frequency when signals are below the minimum for all frequencies and stations.</p>
+<h4>Debugging Aids</h4>
+<p>The most convenient way to track the driver status is using the <tt>ntpq</tt> program and the <tt>clockvar</tt> command. This displays the last determined timecode and related status and error counters, even when the driver is not disciplining the system clock. If the debugging trace feature (<tt>-d</tt> on the <tt>ntpd</tt> command line) is enabled, the driver produces detailed status messages as it operates. If the <tt>fudge flag 4</tt> is set, these messages are written to the <tt>clockstats</tt> file. All messages produced by this driver have the prefix <tt>wwv</tt> for convenient filtering with the Unix <tt>grep</tt> command.</p>
+<p>The autotune process produces diagnostic information along with the timecode. This is very useful for evaluating the performance of the algorithms, as well as radio propagation conditions in general. The message is produced once each minute for each frequency in turn after minute synch has been acquired.</p>
+<p><tt>wwv5 status agc epoch secamp/secsnr datamp/datsnr wwv wwvh</tt></p>
+<p>where the fields after the <tt>wwv5</tt> identifier are: <tt>status</tt> contains status bits, <tt>agc</tt> audio gain, <tt>epoch </tt>second epoch, <tt>secamp/secsnr </tt>second pulse amplitude/SNR, and <tt>wwv</tt> and <tt>wwvh</tt> are two sets of fields, one each for WWV and WWVH. Each of the two fields has the format</p>
+<p><tt>ident score metric minamp/minsnr</tt></p>
+<p>where <tt>ident </tt>encodes the station (<tt>WV</tt> for WWV, <tt>WH</tt> for WWVH) and frequency (2, 5, 10, 15 or 20), <tt>score</tt> 32-bit shift register recording the hits (1) and misses (0) of the last 32 probes (hits and misses enter from the right), <tt>metric</tt> is described above, and <tt>minamp/minsnr</tt> is the minute pulse ampliture/SNR. An example is:</p>
+<pre><tt>wwv5 000d 111 5753 3967/20.1 3523/10.2 WV20 bdeff 100 8348/30.0 WH20 0000 1 22/-12.4</tt></pre>
+<p>There are several other messages that can occur; these are documented in the source listing.</p>
+<h4>Monitor Data</h4>
+When enabled by the <tt>filegen</tt> facility, every received timecode is written to the <tt>clockstats</tt> file in the following format:
+<p><tt>sq yyyy ddd hh:mm:ss l d du lset agc ident metric errs freq avg<br>
+ </tt></p>
+The fields beginning with <tt>yyyy</tt> and extending through <tt>du</tt> are decoded from the received data and are in fixed-length format. The remaining fields are in variable-length format. The fields are as follows:
+<dl>
+ <dt><tt>s</tt></dt>
+ <dd>The synch indicator is initially <tt>?</tt> before the clock is set, but turns to space when all nine digits of the timecode are correctly set and the decoder is synchronized to the station within 125 &mu;s.</dd>
+ <dt><tt>q</tt></dt>
+ <dd>The quality character is a four-bit hexadecimal code showing which alarms have been raised. Each bit is associated with a specific alarm condition according to the following:
+ <dl>
+ <dt><tt>0x8</tt></dt>
+ <dd>synch alarm. The decoder is not synchronized to the station within 125 &mu;s.</dd>
+ <dt><tt>0x4</tt></dt>
+ <dd>Digit error alarm. Less than nine decimal digits were found in the last minute.</dd>
+ <dt><tt>0x2</tt></dt>
+ <dd>Error alarm. More than 40 data bit errors were found in the last minute.</dd>
+ <dt><tt>0x1</tt></dt>
+ <dd>Compare alarm. A maximum-likelihood digit failed to agree with the current associated clock digit in the last minute.</dd>
+ </dl>
+ It is important to note that one or more of the above alarms does not necessarily indicate a clock error, but only that the decoder has detected a marginal condition.</dd>
+ <dt><tt>yyyy ddd hh:mm:ss</tt></dt>
+ <dd>The timecode format itself is self explanatory. Since the driver latches the on-time epoch directly from the second synch pulse, the seconds fraction is always zero. Although the transmitted timecode includes only the year of century, the Gregorian year is augmented by 2000.</dd>
+ <dt><tt>l</tt></dt>
+ <dd>The leap second warning is normally space, but changes to <tt>L</tt> if a leap second is to occur at the end of the month.</dd>
+ <dt><tt>d</tt></dt>
+ <dd>The DST state is <tt>S</tt> or <tt>D</tt> when standard time or daylight time is in effect, respectively. The state is <tt>I</tt> or <tt>O</tt> when daylight time is about to go into effect or out of effect, respectively.</dd>
+ <dt><tt>du</tt></dt>
+ <dd>The DUT sign and magnitude shows the current UT1 offset relative to the displayed UTC time, in deciseconds.</dd>
+ <dt><tt>lset</tt></dt>
+ <dd>Before the clock is set, the interval since last set is the number of minutes since the driver was started; after the clock is set, this is number of minutes since the decoder was last synchronized to the station within 125 &mu;s.</dd>
+ <dt><tt>agc</tt></dt>
+ <dd>The audio gain shows the current codec gain setting in the range 0 to 255. Ordinarily, the receiver audio gain control should be set for a value midway in this range.</dd>
+ <dt><tt>ident</tt></dt>
+ <dd>The station identifier shows the station, <tt>WV<i>f</i></tt> for WWV or <tt>WH<i>f</i></tt> for WWVH, and frequency <i><tt>f</tt></i> being tracked. If neither station is heard on any frequency, the reference identifier shows <tt>NONE</tt>.</dd>
+ <dt><tt>metric</tt></dt>
+ <dd>The signal metric described above from 0 (no signal) to 100 (best).</dd>
+ <dt><tt>errs</tt></dt>
+ <dd>The bit error counter is useful to determine the quality of the data signal received in the most recent minute. It is normal to drop a couple of data bits even under good signal conditions and increasing numbers as conditions worsen. While the decoder performs moderately well even with half the bits are in error in any minute, usually by that point the metric drops below threshold and the decoder switches to a different frequency.</dd>
+ <dt><tt>freq</tt></dt>
+ <dd>The frequency offset is the current estimate of the codec frequency offset to within 0.1 PPM. This may wander a bit over the day due to local temperature fluctuations and propagation conditions.</dd>
+ <dt><tt>avg</tt></dt>
+ <dd>The averaging time is the interval between frequency updates in powers of two to a maximum of 1024 s. Attainment of the maximum indicates the driver is operating at the best possible resolution in time and frequency.</dd>
+</dl>
+<p>An example timecode is:</p>
+<p><tt>0 2000 006 22:36:00 S +3 1 115 WV20 86 5 66.4 1024</tt></p>
+<p>Here the clock has been set and no alarms are raised. The year, day and time are displayed along with no leap warning, standard time and DUT +0.3 s. The clock was set on the last minute, the AGC is safely in the middle ot the range 0-255, and the receiver is tracking WWV on 20 MHz. Good receiving conditions prevail, as indicated by the metric 86 and 5 bit errors during the last minute. The current frequency is 66.4 PPM and the averaging interval is 1024 s, indicating the maximum precision available.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the propagation delay for WWV (40:40:49.0N 105:02:27.0W), in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Specifies the propagation delay for WWVH (21:59:26.0N 159:46:00.0W), in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Ordinarily, this field specifies the driver reference identifier; however, the driver sets the reference identifier automatically as described above.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Specifies the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver37.html b/html/drivers/driver37.html
new file mode 100644
index 0000000..c87a82f
--- /dev/null
+++ b/html/drivers/driver37.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>Forum Graphic GPS Dating station</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Forum Graphic GPS Dating station</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p>Address: 127.127.37.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: <tt>GPS</tt><br>
+ Parallel Port: <tt>/dev/fgclock<i>u</i></tt></p>
+ <h4>Description</h4>
+ <p>This driver supports the Forum Graphic GPS Dating station sold by <a href="http://www.emr.fr/gpsclock.html">EMR company</a>.</p>
+ <p>Unfortunately sometime FG GPS start continues reporting of the same date. The only way to fix this problem is GPS power cycling and ntpd restart after GPS power-up.</p>
+ <p>After Jan,10 2000 my FG GPS unit start send a wrong answer after 10:00am till 11:00am. It repeat hour value in result string twice. I wroite a small code to avoid such problem. Unfortunately I have no second FG GPS unit to evaluate this problem. Please let me know if your GPS has no problems after Y2K.</p>
+ <p></p>
+ <h4>Monitor Data</h4>
+ <p>Each timecode is written to the <tt>clockstats</tt> file in the format <tt>YYYY YD HH MI SS</tt>.</p>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not used by this driver.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>FG</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+ </dl>
+ <hr>
+ <address>Dmitry Smirnov (das@amt.ru)</address>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver38.html b/html/drivers/driver38.html
new file mode 100644
index 0000000..445d70d
--- /dev/null
+++ b/html/drivers/driver38.html
@@ -0,0 +1,133 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <title>hopf clock drivers by ATLSoft</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
+ <h1><font face="Arial"><i><blink><font size="5">hopf</font></blink></i><font size="+2"> </font><font size="3">Serial Line Receivers (6021 and&nbsp; kompatible)</font></font></h1>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h2><font size="+1">Synopsis</font></h2>
+ <table width="100%">
+ <tr>
+ <td>
+ <table bgcolor="#C0C0C0">
+ <tr>
+ <td height="21">
+ <div align="right">
+ <tt>Address:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td><b>127.127.38.<i>X</i></b></td>
+ </tr>
+ <tr>
+ <td height="1">
+ <div align="right">
+ <tt>Reference ID:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td height="1"><a name="REFID"></a><b>.hopf. </b>(default)<b>, GPS, DCF</b></td>
+ </tr>
+ <tr>
+ <td height="21">
+ <div align="right">
+ <tt>Driver ID:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td height="21"><b>HOPF_S</b></td>
+ </tr>
+ <tr>
+ <td height="16">
+ <div align="right">
+ <tt>Serial Port:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td height="16"><b>/dev/hopfclock<i>X</i></b></td>
+ </tr>
+ <tr>
+ <td height="23">
+ <div align="right">
+ <tt><font size="+1">Serial I/O</font>:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td height="23"><b>9600 baud, 8-bits, 1-stop, no parity</b></td>
+ </tr>
+ </table>
+ </td>
+ <td align="center"><img src="../pic/fg6021.gif" alt="gif" height="207" width="238" border="0"></td>
+ </tr>
+ </table>
+ <hr>
+ <h2><font size="+1">Description</font></h2>
+ <p>The <b>refclock_hopf_serial</b> driver supports <a href="http://www.hopf.com">hopf electronic receivers</a> with serial Interface kompatibel 6021.<br>
+ </p>
+ <p>Additional software and information about the software drivers is available from: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>.<br>
+ </p>
+ <p>Latest NTP driver source, executables and documentation is maintained at: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a></p>
+ <hr>
+ <h2><font size="+1">Operating System Compatibility</font></h2>
+ <p align="left">The hopf clock driver has been tested on the following software and hardware platforms:<br>&nbsp;</p>
+ <table bgcolor="#C0C0C0">
+ <tr>
+ <td valign="CENTER" nowrap width="23%">
+ <p align="left"><b>Platform</b></p>
+ </td>
+ <td valign="CENTER" nowrap>
+ <p align="left"><b>Operating System</b></p>
+ </td>
+ </tr>
+ <tr>
+ <td valign="CENTER" nowrap width="23%">
+ <p align="left">i386 (PC)&nbsp;</p>
+ </td>
+ <td valign="CENTER" nowrap>
+ <p align="left">Linux</p>
+ </td>
+ </tr>
+ <tr>
+ <td nowrap>
+ <p align="left">i386 (PC)&nbsp;</p>
+ </td>
+ <td nowrap>
+ <p align="left">Windows NT</p>
+ </td>
+ </tr>
+ <tr>
+ <td nowrap>
+ <p align="left">i386 (PC)&nbsp;</p>
+ </td>
+ <center>
+ <td nowrap>Windows 2000</td>
+ </center>
+ </tr>
+ </table>
+ <hr>
+ <h2><font size="+1">O/S Serial Port Configuration</font></h2>
+ The driver attempts to open the device <b><tt><a href="#REFID">/dev/hopfclock<i>X</i></a></tt></b> where <i><b>X</b></i> is the NTP refclock unit number as defined by the LSB of the refclock address.&nbsp; Valid refclock unit numbers are 0 - 3.
+ <p>The user is expected to provide a symbolic link to an available serial port device.&nbsp; This is typically performed by a command such as:</p>
+ <blockquote>
+ <tt>ln -s /dev/ttyS0 /dev/hopfclock0</tt></blockquote>Windows NT does not support symbolic links to device files.&nbsp;<br>
+ <b>COMx</b>: is used by the driver, based on the refclock unit number, where <b>unit 1</b> corresponds to <b>COM1</b>: and <b>unit 3</b> corresponds to <b>COM3</b>:<br>&nbsp;
+ <hr>
+ <h2><font size="+1">Fudge Factors</font></h2>
+ <dl>
+ <dt><b><tt><font size="+1">time1 <i>time</i></font></tt></b>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. Should be set to 20 milliseconds to correct serial line and operating system delays incurred in capturing time stamps from the synchronous packets.
+ <dt><tt><font size="+1"><a href="#REFID"><b>refid <i>string</i></b></a></font></tt>
+ <dd>Specifies the driver reference identifier, <b>GPS </b><i>or</i> <b>DCF</b>.
+ <dt><tt><font size="+1"><b>flag1 0 | 1</b></font></tt>
+ <dd>When set to 1, driver sync's even if only crystal driven.
+ </dl>
+ <hr>
+ <h2><a name="DataFormat"></a><font size="+1">Data Format</font></h2>
+ <p>as specified in clock manual under pt. <u>[ <span style="font-size:10.0pt;font-family: Arial;mso-fareast-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;; mso-ansi-language:EN-GB;mso-fareast-language:DE;mso-bidi-language:AR-SA" lang="EN-GB"><b>Data String for NTP</b> ( <b><i>Network Time Protocol </i></b>) </span>]</u></p>
+ <hr>
+ <h3>Questions or Comments:</h3>
+ <p><a href="mailto:altmeier@atlsoft.de">Bernd Altmeier</a><a href="http://www.ATLSoft.de"><br>Ing.-B&uuml;ro f&uuml;r Software www.ATLSoft.de</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver39.html b/html/drivers/driver39.html
new file mode 100644
index 0000000..9e1605f
--- /dev/null
+++ b/html/drivers/driver39.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <title>hopf clock drivers by ATLSoft</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
+ <h1><font face="Arial"><i><blink><font size="5">hopf</font></blink></i><font size="+2"> </font><font size="3">PCI-Bus Receiver (6039 GPS/DCF77)</font></font></h1>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <div align="center">
+ <center>
+ <table width="100%">
+ <tr>
+ <td width="50%">
+ <h2><font size="+1">Synopsis</font></h2>
+ <table bgcolor="#C0C0C0">
+ <tr>
+ <td height="21">
+ <div align="right">
+ <tt>Address:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td height="21"><b>127.127.39.<i>X</i></b></td>
+ </tr>
+ <tr>
+ <td height="21">
+ <div align="right">
+ <tt>Reference ID:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td height="21"><a name="REFID"></a><b>.hopf. </b>(default)<b>, GPS, DCF</b></td>
+ </tr>
+ <tr>
+ <td height="21">
+ <div align="right">
+ <tt>Driver ID:&nbsp;&nbsp;</tt></div>
+ </td>
+ <td height="21"><b>HOPF_P</b></td>
+ </tr>
+ </table>
+ </td>
+ <td align="center" valign="middle"><font face="Arial"><i><blink><font size="5"><img src="../pic/fg6039.jpg" alt="gif" height="140" width="141" border="0"></font></blink></i></font></td>
+ </tr>
+ </table>
+ </center>
+ </div>
+ <hr>
+ <h2><font size="+1">Description</font></h2>
+ The <b>refclock_hopf_pci </b>driver supports the <a href="http://www.hopf.com">hopf</a> PCI-bus interface 6039 GPS/DCF77.<br>
+ Additional software and information about the software drivers maybe available from: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>.<br>
+ Latest NTP driver source, executables and documentation is maintained at: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>
+ <hr>
+ <h2><font size="+1">Operating System Compatibility</font></h2>
+ <p align="left">The hopf clock driver has been tested on the following software and hardware platforms:<br>&nbsp;</p>
+ <table bgcolor="#C0C0C0">
+ <tr>
+ <td valign="CENTER" nowrap width="23%">
+ <p align="left"><b>Platform</b></p>
+ </td>
+ <td valign="CENTER" nowrap>
+ <p align="left"><b>Operating System</b></p>
+ </td>
+ </tr>
+ <tr>
+ <td valign="CENTER" nowrap width="23%">
+ <p align="left">i386 (PC)&nbsp;</p>
+ </td>
+ <td valign="CENTER" nowrap>
+ <p align="left">Linux</p>
+ </td>
+ </tr>
+ <tr>
+ <td nowrap>
+ <p align="left">i386 (PC)&nbsp;</p>
+ </td>
+ <td nowrap>
+ <p align="left">Windows NT</p>
+ </td>
+ </tr>
+ <tr>
+ <td nowrap>
+ <p align="left">i386 (PC)&nbsp;</p>
+ </td>
+ <center>
+ <td nowrap>Windows 2000</td>
+ </center>
+ </tr>
+ </table>
+ <hr>
+ <h2><font size="+1">O/S System Configuration</font></h2>
+ <p><b>UNIX</b></p>
+ The driver attempts to open the device <b><tt><a href="#REFID">/dev/hopf6039</a></tt></b> . The device entry will be made by the installation process of the kernel module for the PCI-bus board. The driver sources belongs to the delivery equipment of the PCI-board.
+ <p><b>Windows NT/2000</b></p>
+ <p>The driver attempts to open the device by calling the function &quot;OpenHopfDevice()&quot;. This function will be installed by the Device Driver for the PCI-bus board. The driver belongs to the delivery equipment of the PCI-board.</p>
+ <hr>
+ <h2><font size="+1">Fudge Factors</font></h2>
+ <dl>
+ <dt><tt><font size="+1"><a href="#REFID"><b>refid <i>string</i></b></a></font></tt>
+ <dd>Specifies the driver reference identifier, <b>GPS </b><i>or</i> <b>DCF</b>.
+ <dt><tt><font size="+1"><b>flag1 0 | 1</b></font></tt>
+ <dd>When set to 1, driver sync's even if only crystal driven.
+ </dl>
+ <hr>
+ <h3>Questions or Comments:</h3>
+ <p><a href="mailto:altmeier@atlsoft.de">Bernd Altmeier</a><a href="http://www.ATLSoft.de"><br>Ing.-B&uuml;ro f&uuml;r Software www.ATLSoft.de</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver4.html b/html/drivers/driver4.html
new file mode 100644
index 0000000..2139289
--- /dev/null
+++ b/html/drivers/driver4.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Spectracom WWVB/GPS Receivers</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+<style type="text/css">
+<!--
+.style1 {
+ font-family: Symbol
+}
+-->
+</style>
+</head>
+<body>
+<h3>Spectracom WWVB/GPS Receivers</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+ Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:56<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<p>Address: 127.127.4.<i>u</i><br>
+ Reference ID: <tt>WWVB</tt><br>
+ Driver ID: <tt>WWVB_SPEC</tt><br>
+ Serial Port: <tt>/dev/wwvb<i>u</i></tt>; 9600 baud, 8-bits, no parity<br>
+ Features: Optional PPS signal processing, <tt>tty_clk</tt><br>
+ Requires: Optional PPS signal processing requires the PPSAPI signal interface.</p>
+<h4>Description</h4>
+<p>This driver supports all known Spectracom radio and satellite clocks, including the Model 8170 and Netclock/2 WWVB Synchronized Clocks and the Netclock/GPS GPS Master Clock. The claimed accuracy of the WWVB clocks is 100 <span class="style1">m</span>s relative to the broadcast signal. These clocks have proven a reliable source of time, except in some parts of the country with high levels of conducted RF interference. WIth the GPS clock the claimed accuracy is 130 ns. However, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.</p>
+<p>The DIPswitches on these clocks should be set to 24-hour display, AUTO DST off, data format 0 or 2 (see below) and baud rate 9600. If this clock is used as the source for the IRIG Audio Decoder (<tt>refclock_irig.c</tt> in this distribution), set the DIPswitches for AM IRIG output and IRIG format 1 (IRIG B with signature control).</p>
+<p>There are two timecode formats used by these clocks. Format 0, which is available with all clocks, and format 2, which is available with all clocks except the original (unmodified) Model 8170.</p>
+<p>Format 0 (22 ASCII printing characters):<br>
+ &lt;cr&gt;&lt;lf&gt;i ddd hh:mm:ss TZ=zz&lt;cr&gt;&lt;lf&gt;</p>
+<p>on-time = first &lt;cr&gt;<br>
+ i = synchronization flag (' ' = in synch, '?' = out synch)<br>
+ hh:mm:ss = hours, minutes, seconds</p>
+<p>The alarm condition is indicated by other than ' ' at <tt>i</tt>, which occurs during initial synchronization and when received signal is lost for about ten hours.</p>
+<p>Format 2 (24 ASCII printing characters):<br>
+ lt;cr&gt;lf&gt;iqyy ddd hh:mm:ss.fff ld</p>
+<p>on-time = &lt;cr&gt;<br>
+ i = synchronization flag (' ' = in synch, '?' = out synch)<br>
+ q = quality indicator (' ' = locked, 'A'...'D' = unlocked)<br>
+ yy = year (as broadcast)<br>
+ ddd = day of year<br>
+ hh:mm:ss.fff = hours, minutes, seconds, milliseconds</p>
+<p>The alarm condition is indicated by other than ' ' at <tt>i</tt>, which occurs during initial synchronization and when received signal is lost for about ten hours. The unlock condition is indicated by other than ' ' at <tt>q</tt>.</p>
+<p>The <tt>q</tt> is normally ' ' when the time error is less than 1 ms and a character in the set <tt>A...D</tt> when the time error is less than 10, 100, 500 and greater than 500 ms respectively. The <tt>l</tt> is normally ' ', but is set to <tt>L</tt> early in the month of an upcoming UTC leap second and reset to ' ' on the first day of the following month. The <tt>d</tt> is set to <tt>S</tt> for standard time <tt>S</tt>, <tt>I</tt> on the day preceding a switch to daylight time, <tt>D</tt> for daylight time and <tt>O</tt> on the day preceding a switch to standard time. The start bit of the first &lt;cr&gt; is synchronized to the indicated time as returned.</p>
+<p>This driver does not need to be told which format is in use - it figures out which one from the length of the message. A three-stage median filter is used to reduce jitter and provide a dispersion measure. The driver makes no attempt to correct for the intrinsic jitter of the radio itself, which is a known problem with the older radios.</p>
+<h4>PPS Signal Processing</h4>
+<p>When PPS signal processing is enabled, and when the system clock has been set by this or another driver and the PPS signal offset is within 0.4 s of the system clock offset, the PPS signal replaces the timecode for as long as the PPS signal is active. If for some reason the PPS signal fails for one or more poll intervals, the driver reverts to the timecode. If the timecode fails for one or more poll intervals, the PPS signal is disconnected.</p>
+<h4>Monitor Data</h4>
+<p>The driver writes each timecode as received to the <tt>clockstats</tt> file. When enabled by the <tt>flag4</tt> fudge flag, a table of quality data maintained internally by the Netclock/2 is retrieved and written to the <tt>clockstats</tt> file when the first timecode message of a new day is received.</p>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the PPS time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Specifies the serial time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>WWVB</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Disable PPS signal processing if 0 (default); enable PPS signal processing if 1.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>If PPS signal processing is enabled, capture the pulse on the rising edge if 0 (default); capture on the falling edge if 1.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>If PPS signal processing is enabled, use the <tt>ntpd</tt> clock discipline if 0 (default); use the kernel discipline if 1.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver40.html b/html/drivers/driver40.html
new file mode 100644
index 0000000..6799f76
--- /dev/null
+++ b/html/drivers/driver40.html
@@ -0,0 +1,264 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html lang="en">
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <meta name="generator" content="HTML Tidy, see www.w3.org">
+ <meta http-equiv="Content-Script-Type" content="text/javascript">
+ <title>JJY Receivers</title>
+ <link rev="made" href="http://www.bea.hi-ho.ne.jp/abetakao/">
+ <link rel="start" href="http://www.eecis.udel.edu/~mills/ntp/html/refclock.html">
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>JJY Receivers</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->3-May-2011 00:20<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ Address: 127.127.40.<em>u</em><br>
+ Reference ID: <code>JJY</code><br>
+ Driver ID: <code>JJY</code><br>
+ Serial Port: <code>/dev/jjy<em>u</em></code>; See corresponding receiver
+ <h4>Description</h4>
+ <p>This driver supports the following JJY receivers sold in Japan.</p>
+ <ul>
+
+ <li>
+ <p>Tristate Ltd. JJY01, JJY02 <a href="http://www.tristate.ne.jp/">http://www.tristate.ne.jp/</a> (Japanese only)</p><br>
+ <dl>
+ <dt>NTP configuration ( ntp.conf )</dt>
+ <dd>
+ <p>server &nbsp; 127.127.40.X &nbsp; mode 1</p>
+ <dl>
+ <dt>fudge &nbsp; 127.127.40.X &nbsp; flag1 0|1</dt>
+ <dd>
+ <p>Flag1 has no effect for time synchronization. When a flag1 is set to 1, status commands are issued before DATE and STIM commands, and write a response text into a clockstats file.</p>
+ <table border="1" summary="fudge flag1">
+ <tr><td>0 (Default)</td><td>DCST and STUS commands are not issued</td></tr>
+ <tr><td>1</td><td>DCST and STUS commands are issued</td></tr>
+ </table>
+ </dd>
+ </dl>
+ <br>
+ </dd>
+ <dt>Interface</dt>
+ <dd>
+ <p>RS-232C, 9600 baud, 8-bits, no parity, 1 stop bit</p>
+ <br>
+ </dd>
+ <dt>Time code format</dt>
+ <dd><br>
+ <table summary="CommandAndReply">
+ <tr>
+ <td>Command</td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td>Reply</td>
+ </tr>
+ <tr>
+ <td><code>date{CR}{LF}</code></td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td><code>YYYY/MM/DD WWW{CR}{LF}</code></td>
+ </tr>
+ <tr>
+ <td><code>stim{CR}{LF}</code></td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td><code>HH:MM:SS{CR}{LF}</code></td>
+ </tr>
+ </table>
+ <br>
+ </dd>
+ </dl>
+ </li>
+
+ <li>
+ <p>C-DEX Co.,Ltd. JST2000 <a href="http://www.c-dex.co.jp/">http://www.c-dex.co.jp/</a> (Japanese only)</p><br>
+ <dl>
+ <dt>NTP configuration ( ntp.conf )</dt>
+ <dd>
+ <p>server &nbsp; 127.127.40.X &nbsp; mode 2</p>
+ <br>
+ </dd>
+ <dt>Interface</dt>
+ <dd>
+ <p>RS-232C, 9600 baud, 8-bits, no parity, 1 stop bit</p>
+ <br>
+ </dd>
+ <dt>Time code format</dt>
+ <dd><br>
+ <table summary="CommandAndReply">
+ <tr>
+ <td>Command</td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td>Reply</td>
+ </tr>
+ <tr>
+ <td><code>{ENQ}1J{ETX}</code></td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td><code>{STX}JYYMMDD HHMMSSS{ETX}</code></td>
+ </tr>
+ </table>
+ <br>
+ </dd>
+ </dl>
+ </li>
+
+ <li>
+ <p>Echo Keisokuki Co.,Ltd. LT-2000 <a href="http://www.clock.co.jp/">http://www.clock.co.jp/</a> (Japanese only)</p><br>
+ <dl>
+ <dt>NTP configuration ( ntp.conf )</dt>
+ <dd>
+ <p>server &nbsp; 127.127.40.X &nbsp; mode 3</p>
+ <br>
+ </dd>
+ <dt>Interface</dt>
+ <dd>
+ <p>RS-232C, 9600 baud, 8-bits, no parity, 1 stop bit</p>
+ <br>
+ </dd>
+ <dt>Time code format</dt>
+ <dd><br>
+ <table summary="CommandAndReply">
+ <tr>
+ <td>Command</td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td>Reply</td>
+ </tr>
+ <tr>
+ <td><code>C</code></td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td>( Mode 2 : Continuous )</td>
+ </tr>
+ <tr>
+ <td>( Every second before 0.5 second )</td>
+ <td></td>
+ <td><code>YYMMDDWHHMMSS{ST1}{ST2}{ST3}{ST4}{CR}</code></td>
+ </tr>
+ <tr>
+ <td><code>#</code></td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td>( Mode 1 : Request&amp;Send )</td>
+ </tr>
+ </table>
+ <br>
+ </dd>
+ </dl>
+ </li>
+
+ <li>
+ <p>CITIZEN T.I.C. CO.,LTD. JJY-200 <a href="http://www.tic-citizen.co.jp/">http://www.tic-citizen.co.jp/</a> (Japanese only)</p><br>
+ <dl>
+ <dt>NTP configuration ( ntp.conf )</dt>
+ <dd>
+ <p>server &nbsp; 127.127.40.X &nbsp; mode 4</p>
+ <br>
+ </dd>
+ <dt>Interface</dt>
+ <dd>
+ <p>RS-232C, 4800 baud, 8-bits, no parity, 1 stop bit</p>
+ <br>
+ </dd>
+ <dt>Time code format</dt>
+ <dd><br>
+ <table summary="CommandAndReply">
+ <tr>
+ <td>Command</td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td>Reply</td>
+ </tr>
+ <tr>
+ <td>( Every second )</td>
+ <td></td>
+ <td><code>'XX YY/MM/DD W HH:MM:SS{CR}</code></td>
+ </tr>
+ </table>
+ <br>
+ </dd>
+ </dl>
+ </li>
+
+ <li>
+ <p>Tristate Ltd. TS-GPSclock-01 <a href="http://www.tristate.ne.jp/">http://www.tristate.ne.jp/</a> (Japanese only)</p>
+ <p>This driver supports the Tristate TS-GPSclock-01 in command/response mode, though it is a GPS clock, not JJY radio clock. Using the menus and the onboard switches, the TS-GPSclock-01 should be set to command/response mode and JST time zone.<br>
+ Besides this driver ( Type 40 ), <a href="driver20.html">the generic NMEA GPS driver ( Type 20 )</a> supports the TS-GPSclock-01 in NMEA mode.</p>
+ <dl>
+ <dt>NTP configuration ( ntp.conf )</dt>
+ <dd>
+ <p>server &nbsp; 127.127.40.X &nbsp; mode 5</p>
+ <dl>
+ <dt>fudge &nbsp; 127.127.40.X &nbsp; flag1 0|1</dt>
+ <dd>
+ <p>Flag1 has no effect for time synchronization. When a flag1 is set to 1, status command is issued before DATE and TIME commands, and write a response text into a clockstats file.</p>
+ <table border="1" summary="fudge flag1">
+ <tr><td>0 (Default)</td><td>STUS command is not issued</td></tr>
+ <tr><td>1</td><td>STUS command is issued</td></tr>
+ </table>
+ </dd>
+ </dl>
+ <br>
+ </dd>
+ <dt>Interface</dt>
+ <dd>
+ <p>USB ( /dev/ttyACM<em>0</em> )</p>
+ <br>
+ </dd>
+ <dt>Time code format</dt>
+ <dd><br>
+ <table summary="CommandAndReply">
+ <tr>
+ <td>Command</td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td>Reply</td>
+ </tr>
+ <tr>
+ <td><code>date{CR}{LF}</code></td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td><code>YYYY/MM/DD{CR}{LF}</code></td>
+ </tr>
+ <tr>
+ <td><code>time{CR}{LF}</code></td>
+ <td>&nbsp;--&gt;&nbsp;</td>
+ <td><code>HH:MM:SS{CR}{LF}</code></td>
+ </tr>
+ </table>
+ <br>
+ </dd>
+ </dl>
+ </li>
+
+ </ul>
+ <p>JJY is the radio station which transmites the JST (Japan Standard Time) in long wave radio. The station JJY is operated by the National Institute of Information and Communications Technology. An operating announcement and some information are avaiable from <a href="http://www.nict.go.jp/">http://www.nict.go.jp/</a> (English and Japanese) and <a href="http://jjy.nict.go.jp/">http://jjy.nict.go.jp/</a> (English and Japanese)</p>
+ <p>The user is expected to provide a symbolic link to an available serial port device. This is typically performed by a command such as;</p>
+ <p><code>ln -s /dev/ttyS0 /dev/jjy0</code></p>
+ <p>Using RS232C to USB converter cable, the clock can be connected to an USB port instead of a serial port. In this case, typical symbolic link command is as follows;
+ <p><code>ln -s /dev/ttyUSB0 /dev/jjy0</code></p>
+ <p>Windows NT does not support symbolic links to device files. COM<em>X</em>: is the unit used by the driver, based on the refclock unit number, where unit 1 corresponds to COM1: and unit 3 corresponds to COM3:</p>
+ <h4>Monitor Data</h4>
+ <p>The driver writes each timecode as received to the <code>clockstats</code> file.</p>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><code>time1 <em>time</em></code>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><code>time2 <em>time</em></code>
+ <dd>Not used by this driver.
+ <dt><code>stratum <em>number</em></code>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><code>refid <em>string</em></code>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <code>JJY</code>.
+ <dt><code>flag1 0 | 1</code>
+ <dd>See corresponding receiver.
+ <dt><code>flag2 0 | 1</code>
+ <dd>Not used by this driver.
+ <dt><code>flag3 0 | 1</code>
+ <dd>Not used by this driver.
+ <dt><code>flag4 0 | 1</code>
+ <dd>Not used by this driver.
+ </dl>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver42.html b/html/drivers/driver42.html
new file mode 100644
index 0000000..86f676e
--- /dev/null
+++ b/html/drivers/driver42.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>Zyfer GPStarplus Receiver</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Zyfer GPStarplus Receiver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ Address: 127.127.42.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: <tt>Zyfer GPStarplus</tt><br>
+ Serial Port: <tt>/dev/zyfer<i>u</i></tt>; 9600 baud, 8-bits, no parity<br>
+ Features: <tt>(none)</tt>
+ <h4>Description</h4>
+ <p>This driver supports the <a href="http://www.zyfer.com/">Zyfer GPStarplus</a> receiver.</p>
+ <p>The receiver has a DB15 port on the back which has input TxD and RxD lines for configuration and control, and a separate TxD line for the once-per-second timestamp.</p>
+ <p>Additionally, there are BNC connectors on the back for things like PPS and IRIG output.</p>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver43.html b/html/drivers/driver43.html
new file mode 100644
index 0000000..6d04102
--- /dev/null
+++ b/html/drivers/driver43.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>RIPE NCC interface for Trimble Palisade</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>RIPE NCC interface for Trimble Palisade</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <img src="../pic/driver43_2.jpg" alt="Trimble Acutime 2000" align="right">
+ <h4>Synopsis</h4>
+ Address: 127.127.43.<i>u</i><br>
+ Reference ID: <tt>RIPENCC</tt><br>
+ Driver ID: <tt>RIPENCC</tt>
+ <h4>Description</h4>
+ <p>This is a special driver developed to be used in conjuction with the RIPE NCC clock card in the RIPE NCC Test Traffic Measurements project.</p>
+ <h4>Why this driver?</h4>
+ <p>The reason why we created a seperated driver for an antenna for which already a (vendor supplied) driver exist is a design decision. To be more specific, the standard Trimble interface uses a 12 pin connector. The cable sold by Trimble to connect to this wire is a very thick cable. Certainly not something you wish to run for several 100 meters through your building. And if you wanted to run it for 100 meters, you always would have to really run the cable, and didn't have the option to use existing wiring.<br>
+ </p>
+ <p>This is where we wanted more flexibility. We wanted to be able to use existing wiring in buildings. That leaded us to CAT-5(UTP) which only gives us 8 wires. Therefor we decided to redesing the use of the Trimble antenna. The Trimble supports two modes: EVENT driver and PPS mode. The default is to use the EVENT mode which needs all 12 wires. We only use the PPS timestamps for which we have enough with 8 wires. For our purposes this is more than fine.</p>
+ More information about the project can be found on the <a href="http://www.ripe.net/test-traffic" target="_new">Test Traffic Measurements</a> website. <img src="../pic/driver43_1.gif" alt="RIPE NCC clock card" align="right">
+ <h4>RIPE NCC clock card</h4>
+ <p>The card is very a simple PCI card. The only feature on the bus it uses is the power supply. It uses this power supply to power the Trimble GPS antenna.</p>
+ <p>The card basicly just is a RS422 to RS232 converter. It gets the Trimble's RS422 signal on a RJ45 connector and transforms that to RS232 on a DIN9 connector. This connector should be loopbacked on the back of the machine to the serial port. As said, the card doesn't do any PCI data transfers.</p>
+ <p>The schematics of the interface card is available here: <a href="http://www.ripe.net/projects/ttm/Host_testbox/gps_if.pdf">gps_interface_schematic.pdf</a>. You are free to create this card yourself as long as you give some credit or reference to us. Note that we don't sell these cards on a commercial basis, but for interested parties we do have some spares to share.</p>
+ <p></p>
+ <h4>Monitor Data</h4>
+ <p>In the <tt>filegen clockstats</tt> file the following (example) data is collected:</p>
+ <pre>
+52445 41931.275 127.127.40.0 U1 20.6.2002 11:38:51 13 11
+52445 41931.395 127.127.40.0 C1 20062002 113851 6 364785 110.2 450 6.7 13 5222.374737 N 0453.268013 E 48 7 11 0 1 -14 20 0 -25
+52445 41931.465 127.127.40.0 S1 07 1 1 02 59.3 291.5 39.3
+52445 41931.485 127.127.40.0 S1 11 2 1 02 59.9 138.0 60.2
+52445 41931.525 127.127.40.0 S1 01 4 1 02 48.4 185.7 28.3
+52445 41931.555 127.127.40.0 S1 14 5 2 02 32.7 41.0 15.4
+52445 41931.585 127.127.40.0 S1 20 6 1 02 59.9 256.6 78.0
+52445 41931.615 127.127.40.0 S1 25 8 2 00 0.0 86.6 20.1
+</pre>
+ <p>This is in the form of:</p>
+ <pre>
+All output lines consist of a prefix and a message, the prefix is:
+[days since epoch] [sec.ms since start of day] [peer address]
+
+And all individual messages:
+
+*Primary UTC time packet:
+U1 [date] [time] [trackstat] [utcflags]
+
+*Comprehensive time packet:
+C1 [date] [time] [mode] [bias] [biasunc] [rate] [rateunc] [utcoff] [latitude] [longtitude] [alt] [vis sat](x8)
+
+*Tracking status packet:
+S1 [prn] [channel] [aqflag] [ephstat] [snr] [azinuth] [elevation]
+</pre>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver44.html b/html/drivers/driver44.html
new file mode 100644
index 0000000..a3fac5c
--- /dev/null
+++ b/html/drivers/driver44.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <title>NeoClock4X</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ </head>
+
+ <body>
+ <h1>NeoClock4X - DCF77 / TDF serial line receiver<br>
+ </h1>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr size="2" width="100%">
+ <h2>Synopsis</h2>
+ <table width="100%">
+ <tbody>
+ <tr>
+ <td valign="top">
+ <table width="100%">
+ <tbody>
+ <tr>
+ <td valign="top">Adress<br>
+ </td>
+ <td valign="top">127.127.44.u<br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">Reference ID<br>
+ </td>
+ <td valign="top">neol<br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">Driver ID<br>
+ </td>
+ <td valign="top">NEOCLK4X<br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">Serial Port<br>
+ </td>
+ <td valign="top">/dev/neoclock4x-u<br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <br>
+ </td>
+ <td align="right" valign="top"><a href="http://www.linum.com"><img src="../pic/neoclock4x.gif" alt="NeoClock4X - DCF77 receiver" height="195" width="150"> </a><br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <hr size="2" width="100%">
+ <h2>Description</h2>
+ The refclock_neoclock4x driver supports the NeoClock4X receiver available from <a href="http://www.linum.com">Linum Software GmbH</a>. The receiver is available as a <a href="http://www.dcf77.de">DCF77</a> or TDF receiver. Both receivers have the same output string. For more information about the NeoClock4X receiver please visit <a href="http://www.linux-funkuhr.de">http://www.linux-funkuhr.de</a>. &nbsp;
+ <hr size="2" width="100%">
+ <h2>Fudge Factors</h2>
+ <dl>
+ <dt><b><a href="../clockopt.html">time1 time</a></b>
+ <dd>Specifies the time offset calibration factor with the default value off 0.16958333 seconds. This offset is used&nbsp; to correct serial line and operating system delays incurred in capturing time stamps. If you want to fudge the time1 offset <b>ALWAYS</b> add a value off 0.16958333. This is neccessary to compensate to delay that is caused by transmit the timestamp at 2400 Baud. If you want to compensate the delay that the DCF77 or TDF radio signal takes to travel to your site simply add the needed millisecond delay to the given value. Note that the time here is given in seconds.
+ <dd>Default setting is 0.16958333 seconds.<br>
+ </dl>
+ <dl>
+ <dt><b><a href="../clockopt.html">time2 time</a></b>
+ <dd>Not used by this driver.
+ </dl>
+ <dl>
+ <dt><a href="../clockopt.html"><b>flag1 0 | 1</b></a>
+ <dd>When set to 1 the driver will feed ntp with timestampe even if the radio signal is lost. In this case an internal backup clock generates the timestamps. This is ok as long as the receiver is synced once since the receiver is able to keep time for a long period.
+ <dd>Default setting is 0 = don't synchronize to CMOS clock.
+ <dt><a href="../clockopt.html"><b>flag2 0 | 1</b></a>
+ <dd>You can allow the NeoClock4X driver to use the quartz clock even if it is never synchronized to a radio clock. This is usally not a good idea if you want preceise timestamps since the CMOS clock is maybe not adjusted to a dst status change. So <b>PLEASE</b> switch this only on if you now what you're doing.
+ <dd>Default setting is 0 = don't synchronize to unsynchronized CMOS clock.
+ <dt><a href="../clockopt.html"><b>flag3 0 | 1</b></a>
+ <dd>Not used by this driver.
+ <dt><a href="../clockopt.html"><b>flag4 0 | 1</b></a>
+ <dd>It is recommended to allow extensive logging while you setup the NeoClock4X receiver. If you activate flag4 every received data is logged. You should turn off flag4 as soon as the clock works as expected to reduce logfile cluttering.
+ <dd>Default setting is 0 = don't log received data and converted utc time.
+ </dl>
+ <hr size="2" width="100%">
+ Please send any comments or question to <a href="mailto:neoclock4@linum.com">neoclock4x@linum.com</a>.
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver45.html b/html/drivers/driver45.html
new file mode 100644
index 0000000..bef883f
--- /dev/null
+++ b/html/drivers/driver45.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>Spectracom TSYNC PCI</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Spectracom TSYNC PCI</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->26-Mar-2012 05:10<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ Address: 127.127.45.<i>u</i><br>
+ Reference ID: one of <tt>GPS</tt>, <tt>IRIG</tt>, <tt>HVQ</tt>, <tt>FREQ</tt>, <tt>ACTS</tt>, <tt>PPS</tt>, <tt>PTP</tt>, <tt>ACT</tt>, <tt>USR</tt>, <tt>LOCL</tt><br>
+ Driver ID: <tt>Spectracom TSYNC PCI</tt><br>
+ Driver Port: <tt>/dev/tsyncpci<i>u</i></tt>
+ Features: <tt>(none)</tt>
+ <h4>Description</h4>
+ <p>This driver supports the <a
+ href="http://www.spectracomcorp.com/ProductsServices/TimingSynchronization/BuslevelTiming">Spectracom TSYNC PCI</a> receiver.</p>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver46.html b/html/drivers/driver46.html
new file mode 100644
index 0000000..40aded8
--- /dev/null
+++ b/html/drivers/driver46.html
@@ -0,0 +1,184 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+ <meta http-equiv="Content-Type"
+ content="text/html;charset=iso-8859-1"><title>GPSD-NG client driver</title>
+
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ <style type="text/css">
+ table.dlstable { font-size:85%; }
+ td.ttf{ font-family:Courier; font-weight:bold; }
+ </style></head>
+
+
+
+ <body>
+ <h3>GPSD NG client driver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->1-Mar-2014 03:48<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+
+ <p>
+ Address: 127.127.46.<i>u</i><br>
+ Reference ID: <tt>GPSD</tt><br>
+ Driver ID: <tt>GPSD_JSON</tt><br>
+ Serial Port: <tt>/dev/gps<i>u</i></tt> as symlink to the true
+ device (not used directly; see below)<br>
+ Features: <tt></tt>
+ </p>
+
+ <h4>Description</h4>
+
+ <p>
+ This driver is a client driver to the <i>GPSD</i> daemon, which
+ over the time became increasingly popular for UN*Xish
+ platforms. <i>GPSD</i> can manage several devices in parallel,
+ aggregate information, and acts as a data hub for client
+ applications. <i>GPSD</i> can also auto-detect and handle PPS
+ hardware signals on serial ports. Have a look
+ at <a href="http://www.catb.org/gpsd/">the
+ <i>GPSD</i> project page</a>.
+ </p>
+ <p>
+ <b>It is important to understand that this driver works best
+ using a GPS device with PPS support.</b>
+ </p>
+ <p>
+ The GPSD-NG protocol is text based, using JSON notation to
+ transfer records in form of JSON objects. The driver uses a
+ TCP/IP connection to <tt>localhost:gpsd</tt> to connect to the
+ daemon and then requests the GPS
+ device <tt>/dev/gps<i>u</i></tt> to be watched. (Different clock
+ units use different devices, and
+ <i>GPSD</i> is able to give only the relevant information to a clock
+ instance.)
+ </p>
+ <p>
+ This driver does not expect <i>GPSD</i> to be running or the
+ clock device to be present <i>a priori</i>; it will try to
+ re-establish a lost or hitherto unsuccessful connection and will
+ wait for device to come up in <i>GPSD.</i> There is an initial
+ 10 seconds delay between a connection loss or failed attempt and
+ the next reconnect attempt; this makes sure that there is no
+ thrashing on the network layer. If the connection fails again,
+ an exponential back off is used with an upper limit of
+ approximately 10 minutes.
+ </p>
+ <p>
+ The overall accuracy depends on the receiver used. The driver
+ uses the error estimations (95% probability limits) provided by
+ <i>GPSD</i> to set the clock precision dynamically according to these
+ readings.
+ </p>
+ <p>
+ The driver needs the VERSION, TPV, PPS and WATCH objects of
+ the <i>GPSD</i> protocol. (Others are quietly ignored.)
+ </p>
+
+
+ <h4>Naming a Device</h4>
+ <p>
+ The <i>GPSD</i> driver uses the same name as the NMEA driver,
+ namely <tt>/dev/gps<i>u</i></tt>. There is a simple reason for
+ that: While the NMEA driver and the <i>GPSD</i> driver can be
+ active at the same time <b>for different devices</b>,
+ they cannot access the same device at a time. Having the same
+ name helps on that. It also eases migration from using NMEA
+ directly to using <i>GPSD</i>, as no new links etc need to be
+ created.
+ </p>
+ <p>
+ <i>GPSD</i> is normally started with the device name to access;
+ it can also be instructed by hot-plug scripts to add or remove
+ devices from its device pool. Luckily, the symlinks used by the
+ NMEA driver are happily accepted and used by <i>GPSD</i>; this
+ makes it possible to use the symlink names as device
+ identification. This makes the migration from the built-in NMEA
+ driver a bit easier.
+ </p>
+ <p><b>Note:</b> <i>GPSD</i> (as of version 3.10) cannot
+ use kernel mode PPS on devices that are hot-plugged. This would
+ require to attach the PPS line discipline to the file, which is
+ not possible when running with root privileges dropped. This is
+ not likely to change in the future.
+ </p>
+
+ <h4>The 'mode' byte</h4>
+ <p>
+ A few operation modes can be selected with the mode word.
+ </p>
+ <p>
+ <table border="1" frame="box" rules="all">
+ <th colspan="3">The Mode Word</th>
+ <tr> <td>Bits</td><td>Value</td><td>Description</td>
+ </tr>
+ <tr> <td rowspan="4"align="center">0..1</td><td align="center">0</td>
+ <td>Uses TPV to get absolute time stamps for full
+ synchronization. If PPS is available , it is used to improve
+ the precision, but the clock can work without it.</td>
+ </tr>
+ <tr><td align="center">1</td>
+ <td>Require TPV <b>and</b> PPS to work.</td>
+ </tr>
+ <tr><td align="center">2</td>
+ <td>Ignore PPS data, run on TPV only. This is not a
+ recommended mode unless the serial timing is very stable
+ and GPSD provides an information element in TPV that
+ indicates the receive time of the fix data.</td>
+ </tr>
+ <tr><td align="center">3</td>
+ <td>PPS-only mode. Ignores TPV and does only the PPS phase
+ correction. This means that some other source must get NTPD
+ close to synchronisation; only after that happened and the
+ phase shift between the system clock and the PPS pulse is
+ less than 125msec the PPS lock will be engaged.</td>
+ </tr>
+ <tf colspan="3"><b>IMPORTANT: work in progress, mode
+ word ignored right now. Fixed mode '0' operation.</b></tf>
+ </table>
+ </p>
+
+ <h4>Syslog flood throttle</h4>
+ <p>This driver can create a lot of syslog messages when things go
+ wrong, and cluttering the log files is frowned upon. So we attempt
+ to log persistent or recurring errors only once per hour. On the
+ other hand, when tracking a problem the syslog flood throttle can
+ get into the way.</p>
+ <p>Therefore, fudge <i>flag3</i> can be used to <i>disable</i> the
+ flood throttle at any time; the throttle is engaged by
+ default. Running with the syslog flood throttle disabled for
+ lengthy time is not recommended unless the log files are closely
+ monitored.</p>
+
+ <h4>Fudge Factors</h4>
+
+ <dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the PPS time offset calibration factor, in seconds
+ and fraction, with default 0.0.</dd>
+ <dt><a name="fudgetime2"><tt>time2 <i>time</i></tt></a></dt>
+ <dd>Specifies the TPV time offset calibration factor, in seconds
+ and fraction, with default 0.0.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string
+ from one to four characters, with default <tt>GPSD</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt><dd><i>(not used)</i></dd>
+ <dt><tt>flag2 0 | 1</tt></dt><dd><i>(not used)</i></dd>
+ <dt><tt>flag3 0 | 1</tt></dt><dd>If set, <i>disable</i> the
+ log throttle. Useful when tracking problems in the interaction
+ between <i>GPSD</i> and <i>NTPD</i>, since now all error
+ events are logged. Persistent/recurrent errors can easily fill
+ up the log, so this should only be enabled during bug
+ hunts.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt><dd>If set, write a clock stats
+ line on every poll cycle.</dd>
+ </dl>
+
+ <p>Additional Information</p>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body></html>
diff --git a/html/drivers/driver5.html b/html/drivers/driver5.html
new file mode 100644
index 0000000..fa19764
--- /dev/null
+++ b/html/drivers/driver5.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <title>TrueTime GPS/GOES/OMEGA/WWV Receivers</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>TrueTime GPS/GOES/OMEGA/WWV Receivers</h3>
+ <hr>
+ <h4>Synopsis</h4>
+ Address: 127.127.5.<i>u</i><br>
+ Reference ID: <tt>GPS, OMEGA, GOES, WWV</tt><br>
+ Driver ID: <tt>TRUETIME</tt><br>
+ Serial Port: <tt>/dev/true<i>u</i></tt>; 9600 baud, 8-bits, no parity<br>
+ Features: <tt>tty_clk</tt>
+ <h4>Description</h4>
+ <p>This driver supports several models models of Kinemetrics/TrueTime timing receivers, including 468-DC MK III GOES Synchronized Clock, GPS- DC MK III and GPS/TM-TMD GPS Synchronized Clock, XL-DC (a 151-602-210, reported by the driver as a GPS/TM-TMD), GPS-800 TCU (an 805-957 with the RS232 Talker/Listener module), OM-DC OMEGA Synchronized Clock, the TL-3 WWV receiver, and very likely others in the same model families that use the same timecode formats.</p>
+ <p>Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.</p>
+ <p>Timcode format: <tt>ADDD:HH:MM:SSQCL</tt><br>
+A - control A (this is stripped before we see it) Q - Quality indication (see below) C - Carriage return L - Line feed</p><br>
+Quality codes indicate possible error of:
+ <dl>
+ <dt>468-DC GOES Receiver<br>
+ GPS-TM/TMD Receiver
+ <dd>? +/- 500 milliseconds # +/- 50 milliseconds<br>
+ * +/- 5 milliseconds . +/- 1 millisecond<br>
+ space less than 1 millisecond
+ <dt>OM-DC OMEGA Receiver:
+ <dd>&gt; +/- 5 seconds<br>
+ ? +/- 500 milliseconds # +/- 50 milliseconds<br>
+ * +/- 5 milliseconds . +/- 1 millisecond<br>
+ A-H less than 1 millisecond. Character indicates which station is being received as follows<br>
+ A = Norway, B = Liberia, C = Hawaii, D = North Dakota, E = La Reunion, F = Argentina, G = Australia, H = Japan<br>
+ The carriage return start bit begins on 0 seconds and extends to 1 bit time.
+ <dt>TL-3 WWV Receiver:
+ <dd>? receiver is unlocked<br>
+ <dd>space +/- 5 milliseconds<br>
+ </dl>
+ <h4>Notes on 468-DC and OMEGA receiver:</h4>
+ <p>Send the clock a <tt>R</tt> or <tt>C</tt> and once per second a timestamp will appear. Send a <tt>R</tt> to get the satellite position once (GOES only).</p>
+ <h4>Notes on the 468-DC receiver:</h4>
+ <p>Since the old east/west satellite locations are only historical, you can't set your clock propagation delay settings correctly and still use automatic mode. The manual says to use a compromise when setting the switches. This results in significant errors. The solution; use fudge time1 and time2 to incorporate corrections. If your clock is set for 50 and it should be 58 for using the west and 46 for using the east, use the line</p>
+ <p><tt>fudge 127.127.5.0 time1 +0.008 time2 -0.004</tt></p>
+ <p>This corrects the 4 milliseconds advance and 8 milliseconds retard needed. The software will ask the clock which satellite it sees.</p>
+ <p>The PCL720 from PC Labs has an Intel 8253 look-alike, as well as a bunch of TTL input and output pins, all brought out to the back panel. If you wire a PPS signal (such as the TTL PPS coming out of a GOES or other Kinemetrics/Truetime clock) to the 8253's GATE0, and then also wire the 8253's OUT0 to the PCL720's INPUT3.BIT0, then we can read CTR0 to get the number of microseconds since the last PPS upward edge, mediated by reading OUT0 to find out if the counter has wrapped around (this happens if more than 65535us (65ms) elapses between the PPS event and our being called.)</p>
+ <h4>Notes on the TL-3 receiver:</h4>
+ <p>The mini-DIN RS-232 port uses the Apple pinout.<br>
+ Send the clock ST1 to turn on continuous (1/sec) timecodes.
+You can also enable "mode C" via the front panel. ST0 turns off this mode.<br>
+QV will return the firmware revision (and is useful in identifying this clock.)<br>
+QW will return its weekly signal log, useful if you're testing antennas. You may wish to turn the loss interval down from 4h (04) to 1h (01), so the receiver declares itself unlocked sooner. When in holdover, drift can be on the order of 10 ms/hr since there is no high quality reference oscillator.</p>
+ <h4>Monitor Data</h4>
+ <p>When enabled by the <tt>flag4</tt> fudge flag, every received timecode is written as-is to the <tt>clockstats</tt> file.</p>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, to be used for the West satellite, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>. Specifies the time offset calibration factor, in seconds and fraction, to be used for the East satellite, with default 0.0.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>TRUE</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Silence the clock side of ntpd, just reading the clock without trying to write to it.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Generate a debug file /tmp/true%d.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Enable verbose <tt>clockstats</tt> recording if set.
+ </dl>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/driver6.html b/html/drivers/driver6.html
new file mode 100644
index 0000000..ebb3683
--- /dev/null
+++ b/html/drivers/driver6.html
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>IRIG Audio Decoder</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>IRIG Audio Decoder</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+Last update:
+ <!-- #BeginDate format:En2m -->17-Jul-2014 02:17<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+Address: 127.127.6.<i>u</i><br>
+Reference ID: <tt>IRIG</tt><br>
+Driver ID: <tt>IRIG_AUDIO</tt><br>
+Audio Device: <tt>/dev/audio</tt> and <tt>/dev/audioctl</tt>
+<h4>Description</h4>
+<p>This driver synchronizes the computer time using the Inter-Range Instrumentation Group (IRIG) standard time distribution signal. This signal is generated by several radio clocks, including those made by Arbiter, Austron, Bancomm, Odetics, Spectracom, Symmetricom and TrueTime, among others, although it is often an add-on option. The signal is connected via an optional attenuator and cable to either the microphone or line-in port of a workstation or PC.</p>
+<p>The driver requires an audio codec or sound card with sampling rate 8 kHz and &mu;-law companding to demodulate the data. This is the same standard as used by the telephone industry and is supported by most hardware and operating systems, including Solaris, FreeBSD and Linux, among others. In this implementation, only one audio driver and codec can be supported on a single machine. In order to assure reliable signal capture, the codec frequency error must be less than 250 PPM (.025 percent). If necessary, the <tt>tinker codec</tt> configuration command can be used to bracket the codec frequency to this range.</p>
+<p>For proper operation the IRIG signal source should be configured for analog signal levels, not digital TTL levels. In most radios the IRIG signal is driven &plusmn;10 V behind 50 Ohms. In such cases the cable should be terminated at the line-in port with a 50-Ohm resistor to avoid overloading the codec. Where feasible, the IRIG signal source should be operated with signature control so that, if the signal is lost or mutilated, the source produces an unmodulated signal, rather than possibly random digits. The driver automatically rejects the data and declares itself unsynchronized in this case. Some devices, in particular Spectracom radio/satellite clocks, provide additional year and status indication; other devices may not.</p>
+<p>In general and without calibration, the driver is accurate within 500 &mu;s relative to the IRIG time. After calibrating relative to the PPS&nbsp;signal from a GPS&nbsp;receiver, the mean offset with a 2.4-GHz P4 running FreeBSD 6.1 is less than 20 &mu;s with standard deviation 10 &mu;s. Most of this is due to residuals after filtering and averaging the raw codec samples, which have an inherent jitter of 125 &mu;s. The processor load due to the driver is 0.6 percent on the P4.</p>
+<p>However, be acutely aware that the accuracy with Solaris 2.8 and beyond has been seriously degraded to the order of several milliseconds. The Sun kernel driver has a sawtooth modulation with amplitude over 5 ms P-P and period 5.5 s. This distortion is especially prevalent with Sun Blade 1000 and possibly other systems.</p>
+<p>The driver performs a number of error checks to protect against overdriven or underdriven input signal levels, incorrect signal format or improper hardware configuration. The specific checks are detailed later in this page. Note that additional checks are done elsewhere in the reference clock interface routines.</p>
+<p>This driver incorporates several features in common with other audio drivers such as described in the <a href="driver7.html">Radio CHU Audio Demodulator/Decoder</a> and the <a href="driver36.html">Radio WWV/H Audio Demodulator/Decoder</a> pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p>
+<h4>Technical Overview</h4>
+<p>The IRIG signal format uses an amplitude-modulated carrier with pulse-width modulated data bits. For IRIG-B, the carrier frequency is 1000 Hz and bit rate 100 b/s; for IRIG-E, the carrier frequenchy is 100 Hz and bit rate 10 b/s. While IRIG-B provides the best accuracy, generally within a few tens of microseconds relative to IRIG time, it can also generate a significant processor load with older workstations. Generally, the accuracy with IRIG-E is about ten times worse than IRIG-B, but the processor load is somewhat less. Technical details about the IRIG&nbsp;formats can be found in <a href="http://handle.dtic.mil/100.2/ADA346250">IRIG Standard 200-98</a>.</p>
+<p>The driver processes 8000-Hz &mu;-law companded samples using separate signal filters for IRIG-B and IRIG-E, a comb filter, envelope detector and automatic threshold corrector. An infinite impulse response (IIR) 1000-Hz bandpass filter is used for IRIG-B and an IIR 130-Hz lowpass filter for IRIG-E. These are intended for use with noisy signals, such as might be received over a telephone line or radio circuit, or when interfering signals may be present in the audio passband. The driver determines which IRIG format is in use by sampling the amplitude of each filter output and selecting the one with maximum signal.</p>
+<p>Cycle crossings relative to the corrected slice level determine the width of each pulse and its value - zero, one or position identifier (PI). The data encode ten characters (20 BCD digits) which determine the second, minute, hour and day of the year and with some IRIG&nbsp;generators the year and synchronization condition. The comb filter exponentially averages the corresponding samples of successive baud intervals in order to reliably identify the reference carrier cycle.</p>
+<p>A type-II phase-lock loop (PLL) performs additional integration and interpolation to accurately determine the zero crossing of that cycle, which determines the reference timestamp. A pulse-width discriminator demodulates the data pulses, which are then encoded as the BCD digits of the timecode. The timecode and reference timestamp are updated once each second with IRIG-B (ten seconds with IRIG-E) and local clock offset samples saved for later processing. At poll intervals of 64 s, the saved samples are processed by a median filter and used to update the system clock.</p>
+<h4>Monitor Data</h4>
+The timecode format used for debugging and data recording includes data helpful in diagnosing problems with the IRIG signal and codec connections. The driver produces one line for each timecode in the following format:
+<p><tt>00 00 98 23 19:26:52 2782 143 0.694 10 0.3 66.5 3094572411.00027</tt></p>
+<p>If clockstats is enabled, the most recent line is written to the clockstats file every 64 s. If verbose recording is enabled (fudge flag 4) each line is written as generated.</p>
+<p>The first field containes the error flags in hex, where the hex bits are interpreted as below. This is followed by the year of century, day of year and time of day. Note that the time of day is for the previous minute, not the current time. The status indicator and year are not produced by some IRIG devices and appear as zeros. Following these fields are the carrier amplitude (0-3000), codec gain (0-255), modulation index (0-1), time constant (4-10), carrier phase error (0&plusmn;0.5) and carrier frequency error (PPM). The last field is the on-time timestamp in NTP format.</p>
+<p>The error flags are defined as follows in hex:</p>
+<dl>
+ <dt><tt>x01</tt></dt>
+ <dd>Low signal. The carrier amplitude is less than 100 units. This is usually the result of no signal or wrong input port.</dd>
+ <dt><tt>x02</tt></dt>
+ <dd>Frequency error. The codec frequency error is greater than 250 PPM. This may be due to wrong signal format or (rarely) defective codec.</dd>
+ <dt><tt>x04</tt></dt>
+ <dd>Modulation error. The IRIG modulation index is less than 0.5. This is usually the result of an overdriven codec, wrong signal format or wrong input port.</dd>
+ <dt><tt>x08</tt></dt>
+ <dd>Frame synch error. The decoder frame does not match the IRIG frame. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal. It may also be the result of an IRIG signature check which indicates a failure of the IRIG signal synchronization source.</dd>
+ <dt><tt>x10</tt></dt>
+ <dd>Data bit error. The data bit length is out of tolerance. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal.</dd>
+ <dt><tt>x20</tt></dt>
+ <dd>Seconds numbering discrepancy. The decoder second does not match the IRIG second. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal.</dd>
+ <dt><tt>x40</tt></dt>
+ <dd>Codec error (overrun). The machine is not fast enough to keep up with the codec.</dd>
+ <dt><tt>x80</tt></dt>
+ <dd>Device status error (Spectracom).</dd>
+</dl>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>IRIG</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>Specifies the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>Enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver7.html b/html/drivers/driver7.html
new file mode 100644
index 0000000..90baf61
--- /dev/null
+++ b/html/drivers/driver7.html
@@ -0,0 +1,144 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Radio CHU Audio Demodulator/Decoder</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Radio CHU Audio Demodulator/Decoder</h3>
+<p>Author: David L. Mills (mills@udel.edu)<br>
+Last update:
+ <!-- #BeginDate format:En2m -->17-Jul-2014 02:17<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+Address: 127.127.7.<i>u</i><br>
+Reference ID: <tt>CHU</tt><br>
+Driver ID: <tt>CHU</tt><br>
+Modem Port: <tt>/dev/chu<i>u</i></tt>; 300 baud, 8-bits, no parity<br>
+Autotune Port: <tt>/dev/icom</tt>; 1200/9600 baud, 8-bits, no parity<br>
+Audio Device: <tt>/dev/audio</tt> and <tt>/dev/audioctl</tt>
+<h4>Description</h4>
+<p>This driver synchronizes the computer time using shortwave radio transmissions
+ from Canadian time/frequency station <a href="http://inms-ienm.nrc-cnrc.gc.ca/time_services/shortwave_broadcasts_e.html">CHU</a> in
+ Ottawa, Ontario. CHU transmissions are made continuously on 3.330,
+ 7.850 and 14.670 MHz in upper sideband, compatible AM mode. An ordinary
+ shortwave receiver can be tuned manually to one of these frequencies or, in
+ the case of ICOM receivers, the receiver can be tuned automatically as propagation
+ conditions change throughout the day and season.</p>
+<p>The driver can be compiled to use either an audio codec or soundcard, or a Bell 103-compatible, 300-b/s modem or modem chip, as described on the <a href="../pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. If compiled for a modem, the driver uses it to receive the radio signal and demodulate the data. If compiled for the audio codec, it requires a sampling rate of 8 kHz and &mu;-law companding to demodulate the data. This is the same standard as used by the telephone industry and is supported by most hardware and operating systems, including Solaris, FreeBSD and Linux, among others. The radio is connected via an optional attenuator and cable to either the microphone or line-in port of a workstation or PC. In this implementation, only one audio driver and codec can be supported on a single machine.</p>
+<p>In general and without calibration, the driver is accurate within 1 ms relative to the broadcast time when tracking a station. However, variations up to 0.3 ms can be expected due to diurnal variations in ionospheric layer height and ray geometry. In Newark DE, 625 km from the transmitter, the predicted one-hop propagation delay varies from 2.8 ms in sunlight to 2.6 ms in moonlight. When not tracking the station the accuracy depends on the computer clock oscillator stability, ordinarily better than 0.5 PPM.</p>
+<p>After calibration relative to the PPS&nbsp;signal from a GPS&nbsp;receiver, the mean offset with a 2.4-GHz P4 running FreeBSD 6.1 is generally within 0.2 ms short-term with 0.4 ms jitter. The long-term mean offset varies up to 0.3 ms due to propagation path geometry variations. The processor load due to the driver is 0.4 percent on the P4.</p>
+<p>The driver performs a number of error checks to protect against overdriven or underdriven input signal levels, incorrect signal format or improper hardware configuration. The specific checks are detailed later in this page. Note that additional checks are done elsewhere in the reference clock interface routines.</p>
+<p>This driver incorporates several features in common with other audio drivers such as described in the <a href="driver36.html">Radio WWV/H Audio Demodulator/Decoder</a> and the <a href="driver6.html">IRIG Audio Decoder</a> pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p>
+<h4>Technical Overview</h4>
+<p>The driver processes 8-kHz &mu;-law companded codec samples using maximum-likelihood techniques which exploit the considerable degree of redundancy available in each broadcast message or burst. As described below, every character is sent twice and, in the case of format A bursts, the burst is sent eight times every minute. The single format B burst is considered correct only if every character matches its repetition in the burst. For the eight format A bursts, a majority decoder requires more than half of the 16 repetitions for each digit decode to the same value. Every character in every burst provides an independent timestamp upon arrival with a potential total of 60 timestamps for each minute.</p>
+<p>The CHU timecode format is described on the <a href="http://inms-ienm.nrc-cnrc.gc.ca/time_services/chu_e.html">CHU website</a>. A timecode is assembled when all bursts have been received in each minute. The timecode is considered valid and the clock set when at least one valid format B burst has been decoded and the majority decoder declares success. Once the driver has synchronized for the first time, it will appear reachable and selectable to discipline the system clock. It is normal on occasion to miss a minute or two due to signal fades or noise. If eight successive minutes are missed, the driver is considered unreachable and the system clock will free-wheel at the latest determined frequency offset. Since the signals are almost always available during some period of the day and the NTP clock discipline algorithms are designed to work well even with long intervals between updates, it is unlikely that the system clock will drift more than a few milliseconds during periods of signal loss.</p>
+<h4>Baseband Signal Processing</h4>
+<p>The program consists of four major parts: the DSP modem, maximum-likelihood UART, burst assembler and majority decoder. The DSP modem demodulates Bell 103 modem answer-frequency signals; that is, frequency-shift keyed (FSK) tones of 2225 Hz (mark) and 2025 Hz (space). It consists of a 500-Hz bandpass filter centered on 2125 Hz followed by a limiter/discriminator and raised-cosine lowpass filter optimized for the 300-b/s data rate. </p>
+<p>The maximum likelihood UART is implemented using a set of eight 11-stage shift registers, one for each of eight phases of the 300-b/s bit clock. At each phase a new baseband signal from the DSP modem is shifted into the corresponding register and the maximum and minimum over all 11 samples computed. This establishes a span (difference) and slice level (average) over all 11 stages. For each stage, a signal level above the slice is a mark (1) and below that is a space (0). A quality metric is calculated for each register with respect to the slice level and the a-priori signal consisting of a start bit (space), eight arbitrary information bits and two stop bits (mark).</p>
+<p>The shift registers are processed in round-robin order as the phases of each bit arrive. At the end of each bit all eight phases are searched for valid framing bits, sufficient span and best metric. The best candidate found in this way represents the maximum-likelihood character. The process then continues for all ten characters in the burst.</p>
+<p>The burst assembler processes characters either from the maximum-likelihood UART or directly from the serial port as configured. A burst begins when a character is received and is processed after a timeout interval when no characters are received. If the interval between characters is greater than two characters, but less than the timeout interval, the burst is rejected as a runt and a new burst begun. As each character is received, a timestamp is captured and saved for later processing.</p>
+<p>A valid burst consists of ten characters in two replicated five-character blocks, each block representing ten 4-bit BCD digits. The format B blocks sent in second 31 contain the year and other information in ten digits. The eight format A blocks sent in seconds 32-39 contain the timecode in ten digits, the first of which is a framing code (6). The burst assembler must deal with cases where the first character of a format A burst is lost or is noise. This is done using the framing codes to correct the discrepancy, either one character early or one character late.</p>
+<p>The burst distance is incremented by one for each bit in the first block that matches the corresponding bit in the second block and decremented by one otherwise. In a format B burst the second block is bit-inverted relative to the first, so a perfect burst of five 8-bit characters has distance -40. In a format A burst the two blocks are identical, so a perfect burst has distance +40. Format B bursts must be perfect to be acceptable; however, format A bursts, which are further processed by the majority decoder, are acceptable if the distance is at least 28.</p>
+<h4>Majority Decoder</h4>
+<p>Each minute of transmission includes eight format A bursts containing two timecodes for each second from 32 through 39. The majority decoder uses a decoding matrix of ten rows, one for each digit position in the timecode, and 16 columns, one for each 4-bit code combination that might be decoded at that position. In order to use the character timestamps, it is necessary to reliably determine the second number of each burst. In a valid burst, the last digit of the two timecodes in the burst must match and the value must be in the range 2-9 and greater than in the previous burst.</p>
+<p>As each digit of a valid burst is processed, the value at the row corresponding to the digit position in the timecode and column corresponding to the code found at that position is incremented. At the end of the minute, each row of the decoding matrix encodes the number of occurrences of each code found at the corresponding position.</p>
+<p>The maximum over all occurrences at each digit position is the distance for that position and the corresponding code is the maximum-likelihood digit. If the distance is not more than half the total number of occurrences, the decoder assumes a soft error and discards all information collected during the minute. The decoding distance is defined as the sum of the distances over the first nine digits; the tenth digit varies over the seconds and is uncounted.</p>
+<p>The result of the majority decoder is a nine-digit timecode representing the maximum-likelihood candidate for the transmitted timecode in that minute. Note that the second and fraction within the minute are always zero and that the actual reference point to calculate timestamp offsets is backdated to the first second of the minute. At this point the timecode block is reformatted and the year, days, hours and minutes extracted along with other information from the format B burst, including DST state, DUT1 correction and leap warning. The reformatting operation checks the timecode for invalid code combinations that might have been left by the majority decoder and rejects the entire timecode if found.</p>
+<p>If the timecode is valid, it is passed to the reference clock interface along with the backdated timestamps accumulated over the minute. A perfect set of eight bursts could generate as many as 80 timestamps, but the maximum the interface can handle is 60. These are processed using a median filter and trimmed-mean average, so the resulting system clock correction is usually much better than would otherwise be the case with radio noise, UART jitter and occasional burst errors.</p>
+<h4>Autotune</h4>
+<p>The driver includes provisions to automatically tune the radio in response to changing radio propagation conditions throughout the day and night. The radio interface is compatible with the ICOM CI-V standard, which is a bidirectional serial bus operating at TTL levels. The bus can be connected to a standard serial port using a level converter such as the CT-17. Further details are on the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p>
+<p>If specified, the driver will attempt to open the device <tt>/dev/icom</tt> and, if successful will tune the radio to 3.331 MHz. The 1-kHz offset is useful with a narrowband SSB&nbsp;filter where the passband includes the carrier and modem signals. However, the driver is liberal in what it assumes of the configuration. If the <tt>/dev/icom</tt> link is not present or the open fails or the CI-V bus is inoperative, the driver continues in single-frequency mode.</p>
+<p>As long as no bursts are received, the driver cycles over the three frequencies in turn, one minute for each station. When bursts are received from one or more stations, the driver operates in a five-minute cycle. During the first four minutes it tunes to the station with the highest metric. During the last minute it alternates between the other two stations in turn in order to measure the metric.</p>
+<h4>Debugging Aids</h4>
+<p>The most convenient way to track the program status is using the <tt>ntpq</tt> program and the <tt>clockvar</tt> command. This displays the last determined timecode and related status and error counters, even when the program is not discipline the system clock. If the debugging trace feature (<tt>-d</tt> on the <tt>ntpd</tt> command line) is enabled, the program produces detailed status messages as it operates. If the <tt>fudge flag 4</tt> is set, these messages are written to the <tt>clockstats</tt> file. All messages produced by this driver have the prefix <tt>chu</tt> for convenient filtering with the Unix <tt>grep</tt> command.</p>
+<p>With debugging enabled the driver produces messages in the following formats: A single message beginning with <tt>chuB</tt> is produced for each format B burst received in second 31, while eight messages beginning with <tt>chuA</tt> are produced for each format A burst received in seconds 32 through 39 of the minute. The first four fields are</p>
+<p><tt>stat sig n b</tt></p>
+<p>where <tt>stat</tt> is the status code, <tt>sig</tt> the character span, <tt>n</tt> the number of characters in the burst (9-11) and <tt>b</tt> the burst distance (0-40). Good bursts will have spans of a 800 or more and the other numbers near the top of the range specified. See the source for the interpretation of the remaining data in the burst. Note that each character of the burst is encoded as two digits in nibble-swapped order.</p>
+<p>If the CI-V interface for ICOM radios is active, a debug level greater than 1 will produce a trace of the CI-V command and response messages. Interpretation of these messages requires knowledge of the CI-V protocol, which is beyond the scope of this document.</p>
+<h4>Monitor Data</h4>
+When enabled by the <tt>filegen</tt> facility, every received timecode is written to the <tt>clockstats</tt> file in the following format:
+<pre>
+ sq yyyy ddd hh:mm:ss lw dst du lset agc rfrq bcnt dist tsmp
+
+ s sync indicator
+ q quality character
+ yyyy Gregorian year
+ ddd day of year
+ hh hour of day
+ mm minute of hour
+ ss second of minute
+ lw leap second warning
+ dst DST state
+ dut DUT sign and magnitude in deciseconds
+ lset minutes since last set
+ agc audio gain (0-255)
+ ident CHU&nbsp;identifier code
+ dist decoder distance
+ tsmp timestamps captured
+</pre>
+The fields beginning with <tt>year</tt> and extending through <tt>dut</tt> are decoded from the received data and are in fixed-length format. The <tt>agc</tt> and <tt>lset</tt> fields, as well as the following driver-dependent fields, are in variable-length format.
+<dl>
+ <dt><tt>s</tt></dt>
+ <dd>The sync indicator is initially <tt>?</tt> before the clock is set, but turns to space when the clock has been correctly set.</dd>
+ <dt><tt>q</tt></dt>
+ <dd>The quality character is a four-bit hexadecimal code showing which alarms have been raised during the most recent minute. Each bit is associated with a specific alarm condition according to the following:
+ <dl>
+ <dt><tt>8</tt></dt>
+ <dd>Timestamp alarm. Fewer than 20 timestamps have been determined.</dd>
+ <dt><tt>4</tt></dt>
+ <dd>Decoder alarm. A majority of repetitions for at least one digit of the timecode fails to agree.</dd>
+ <dt><tt>2</tt></dt>
+ <dd>Format alarm. One or more bursts contained invalid data or was improperly formatted.</dd>
+ <dt><tt>1</tt></dt>
+ <dd>Frame alarm. One or more bursts was improperly framed or contained too many repetition errors.</dd>
+ </dl>
+ The timestamp and decoder alarms are fatal; the data accumulated during the minute are not used to set the clock. The format and fram alarm are nonfatal; only the data in the burst are discarded.</dd>
+ <dt><tt>yyyy ddd hh:mm:ss</tt></dt>
+ <dd>The timecode format itself is self explanatory. Note that the Gregorian year is decoded directly from the transmitted timecode.</dd>
+ <dt><tt>lw</tt></dt>
+ <dd>The leap second warning is normally space, but changes to <tt>L</tt> if a leap second is to occur at the end of the month.</dd>
+ <dt><tt>dst</tt></dt>
+ <dd>The DST code for Canada encodes the state for all provinces. It is encoded as two hex characters.</dd>
+ <dt><tt>dut</tt></dt>
+ <dd>The DUT sign and magnitude shows the current UT1 offset relative to the displayed UTC time, in deciseconds. It is encoded as one digit preceeded by sign.</dd>
+ <dt><tt>lset</tt></dt>
+ <dd>Before the clock is set, this is the number of minutes since the program was started; after the clock is set, this is the number of minutes since the time was last verified relative to the broadcast signal.</dd>
+ <dt><tt>agc</tt></dt>
+ <dd>The audio gain shows the current codec gain setting in the range 0 to 255. Ordinarily, the receiver audio gain control should be set for a value midway in this range.</dd>
+ <dt><tt>ident</tt></dt>
+ <dd>The CHU&nbsp;identifier <tt>CHU </tt>followed by the current radio frequency
+ code, if the CI-V interface is active, or <tt>CHU</tt> if not. The radio
+ frequncy is encoded as 0 for 3.330 MHz, 1 for 7.850 MHz and 2
+ for 14.670 MHz.</dd>
+ <dt><tt>dist</tt></dt>
+ <dd>The decoding distance determined during the most recent minute bursts were received. The values range from 0 to 160, with the higher values indicating better signals. The decoding algorithms require the distance at least 50; otherwise all data in the minute are discarded.</dd>
+ <dt><tt>tsmp</tt></dt>
+ <dd>The number of timestamps determined during the most recent minute bursts were received. The values range from 0 to 60, with the higher values indicating better signals. The decoding algoriths require at least 20 timestamps in the minute; otherwise all data in the minute are discarded.</dd>
+</dl>
+<h4>Fudge Factors</h4>
+<dl>
+ <dt><tt>time1 <i>time</i></tt></dt>
+ <dd>Specifies the propagation delay for CHU (45:18N 75:45N), in seconds and fraction, with default 0.0.</dd>
+ <dt><tt>time2 <i>time</i></tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>stratum <i>number</i></tt></dt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
+ <dt><tt>refid <i>string</i></tt></dt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>CHU</tt>.</dd>
+ <dt><tt>flag1 0 | 1</tt></dt>
+ <dd>Not used by this driver.</dd>
+ <dt><tt>flag2 0 | 1</tt></dt>
+ <dd>When the audio driver is compiled, this flag selects the audio input port, where 0 is the mike port (default) and 1 is the line-in port. It does not seem useful to select the compact disc player port.</dd>
+ <dt><tt>flag3 0 | 1</tt></dt>
+ <dd>When the audio driver is compiled, this flag enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started.</dd>
+ <dt><tt>flag4 0 | 1</tt></dt>
+ <dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/drivers/driver8.html b/html/drivers/driver8.html
new file mode 100644
index 0000000..ab21f0f
--- /dev/null
+++ b/html/drivers/driver8.html
@@ -0,0 +1,278 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>Generic Reference Driver</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Generic Reference Driver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->27-Jan-2014 05:31<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ Address: 127.127.8.<em>u</em><br>
+ Reference ID: PARSE<br>
+ Driver ID: GENERIC<br>
+ Serial Port: /dev/refclock-<em>u</em>; TTY mode according to clock type<br>
+ PPS device: /dev/refclockpps-<em>u</em>; alternate PPS device (if not available via the serial port)
+ <h4>Description</h4>
+ The PARSE driver supports 20 different clock types/configurations. PARSE is actually a multi-clock driver.<br>
+ <br>
+ <p>The actual receiver status is mapped into various synchronization states generally used by receivers. The driver is configured to interpret the time codes of Meinberg DCF77 AM receivers, DCF77 FM receivers, Meinberg GPS16x/17x receivers, Trimble SV6 GPS, ELV DCF7000, Schmid, Wharton 400A and low cost receivers (see <a href="imap://mills@mail.eecis.udel.edu:993/fetch%3EUID%3E.INBOX%3E67132?part=1.3&type=text/html&filename=driver8.html#clocklist">list below</a>).</p>
+ <p>The reference clock support in NTP contains the necessary configuration tables for those receivers. In addition to supporting several different clock types and up to 4 devices, the processing of a PPS signal is also provided as a configuration option. The PPS configuration option uses the receiver-generated time stamps for feeding the PPS loopfilter control for much finer clock synchronization.</p>
+ <p>CAUTION: The PPS configuration option is different from the hardware PPS signal, which is also supported (see below), as it controls the way ntpd is synchronized to the reference clock, while the hardware PPS signal controls the way time offsets are determined.</p>
+ <p>The use of the PPS option requires receivers with an accuracy of better than 1ms.</p>
+ <h4>Timecode variables listed by ntpq (8)</h4>
+ <p>The ntpq program can read and display several clock variables. These hold the following information:</p>
+ <dl>
+ <dt>refclock_format</dt>
+ <dd>A qualification of the decoded time code format.</dd>
+ <dt>refclock_states</dt>
+ <dd>The overall running time and the accumulated times for the clock event states.</dd>
+ <dt>refclock_status</dt>
+ <dd>Lists the currently active receiver flags. Additional feature flags for the receiver are optionally listed in parentheses.</dd>
+ <dt>refclock_time</dt>
+ <dd>The local time with the offset to UTC (format HHMM).</dd>
+ <dt>timecode</dt>
+ <dd>The actual time code.</dd>
+ </dl>
+ <p>If PPS information is present, additional variables are available:</p>
+ <dl>
+ <dt>refclock_ppsskew</dt>
+ <dd>The difference between the RS-232-derived timestamp and the PPS timestamp.</dd>
+ <dt>refclock_ppstime</dt>
+ <dd>The PPS timestamp.</dd>
+ </dl>
+ <h4>Supported Devices</h4>
+ <p>Currently, twenty-four clock types are supported by the PARSE driver and up to four (devices /dev/refclock-0 - /dev/refclock-3) of these clocks may be operational at any one time.<br>
+ A note on the implementations:</p>
+ <ul>
+ <li>These implementations were mainly done without actual access to the hardware, thus not all implementations provide full support. The development was done with the help of many kind souls who had the hardware and kindly lent me their time and patience during the development and debugging cycle. Thus for continued support and quality, direct access to the receivers is a big help. Nevertheless I am not prepared to buy these reference clocks - donations to (<a href="mailto:kardel%20%3CAT%3E%20ntp.org">kardel &lt;AT&gt; ntp.org</a>) are welcome as long as they work within Europe 8-).
+ <p>Verified implementations are:</p>
+ <ul>
+ <li>RAWDCF variants
+ <p>These variants have been tested for correct decoding with my own homegrown receivers. Interfacing with specific commercial products may involve some fiddling with cables. In particular, commercial RAWDCF receivers have a seemingly unlimited number of ways to draw power from the RS-232 port and to encode the DCF77 datastream. You are mainly on your own here unless I have a sample of the receiver.</p>
+ </li>
+ <li><a href="http://www.meinberg.de">Meinberg clocks</a>
+ <p>These implementations have been verified by the Meinberg people themselves and I have access to one of these clocks.</p>
+ </li>
+ <li><a href="http://www.selinc.com">Schweitzer Engineering
+ Laboratories SEL-240x clocks</a>
+ <p>This implementation was provided and verified by SEL and <a
+ href="http://networktimefoundation.org">Network Time Foundation</a>
+ has an SEL-2407 in one of its development labs.</p>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>The pictures below have been taken from and are linked to the vendors' web pages.</p>
+ <a name="clocklist"></a>
+ <ul>
+ <li><strong>server 127.127.8.0-3 mode 0</strong>
+ <p><strong><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/timesource.htm#dcf---freq_sync">PZF5xx receiver family</a> (FM demodulation/TCXO / 50&mu;s)</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 1</strong>
+ <p><strong><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/timesource.htm#dcf---freq_sync">PZF5xx receiver family</a> (FM demodulation/OCXO / 50&mu;s)</strong><br>
+ <a href="http://www.meinberg.de/english/products/pzf-eurocard.htm"><img src="../pic/pzf511.jpg" alt="Image PZF511" align="top" border="0" height="300" width="260"></a><br>
+ <br>
+ </p>
+ </li>
+ <li><a name="mode2"></a><strong>server 127.127.8.0-3 mode 2</strong>
+ <p><strong><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/c51.htm">DCF C51 receiver and similar</a> (AM demodulation / 4ms)</strong><br>
+ <a href="http://www.meinberg.de/english/products/c51.htm"><img src="../pic/c51.jpg" alt="Image C51" align="top" border="0" height="239" width="330"></a><br>
+ </p>
+ <p>This mode expects the Meinberg standard time string format with 9600/7E2.</p>
+ <p><strong>Note:</strong> mode 2 must also be used for <a href="http://www.meinberg.de/english/products/formfactor.htm#slot_card">Meinberg PCI cards</a> under Linux, e.g. <a href="http://www.meinberg.de/english/products/gps-pcicard.htm">the GPS PCI card</a> or <a href="http://www.meinberg.de/english/products/dcf-pcicard.htm">the DCF77 PCI card</a>. Please note the <a href="http://www.meinberg.de/english/sw/#linux">Meinberg Linux driver</a> must be installed. That driver emulates a refclock device in order to allow ntpd to access those cards. For details, please refer to the README file that comes with the Meinberg driver package.<br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 3</strong>
+ <p><strong><a href="http://www.elv.de">ELV</a> DCF7000 (sloppy AM demodulation / 50ms)</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 4</strong>
+ <p><strong>Walter Schmid DCF receiver Kit (AM demodulation / 1ms)</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 5</strong>
+ <p><strong>RAW DCF77 100/200ms pulses (Conrad DCF77 receiver module / 5ms)</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 6</strong>
+ <p><strong>RAW DCF77 100/200ms pulses (TimeBrick DCF77 receiver module / 5ms)</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 7</strong>
+ <p><strong><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/timesource.htm#gps---freq_sync">GPS16x/GPS17x receivers</a> (GPS / &lt;&lt;1&mu;s)</strong><br>
+ <a href="http://www.meinberg.de/english/products/gps-eurocard.htm"><img src="../pic/gps167.jpg" alt="Image GPS167" align="top" border="0" height="300" width="280"></a><br>
+ </p>
+ <p>This mode expects either the University of Erlangen time string format or the Meinberg standard time string format at 19200/8N1.</p>
+ <p>The University of Erlangen format is preferred. Newer Meinberg GPS receivers can be configured to transmit that format; for older devices, a special firmware version may be available.</p>
+ <p>In this mode some additional GPS receiver status information is also read. However, this requires a point-to-point connection. <a href="imap://mills@mail.eecis.udel.edu:993/fetch%3EUID%3E.INBOX%3E67132?part=1.3&type=text/html&filename=driver8.html#mode18">Mode 18</a> should be used if the device is accessed by a multidrop connection.</p>
+ <p><strong>Note:</strong> mode 7 must not be used with Meinberg PCI cards; use <a href="imap://mills@mail.eecis.udel.edu:993/fetch%3EUID%3E.INBOX%3E67132?part=1.3&type=text/html&filename=driver8.html#mode2">mode 2</a> instead.<br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 8</strong>
+ <p><strong><a href="http://www.igel.de">IGEL</a> <a href="http://www.igel.de/eigelmn.html">clock</a></strong><br>
+ <a href="http://www.igel.de/eigelmn.html"><img src="../pic/igclock.gif" alt="Image IGEL clock" border="0" height="174" width="200"></a><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 9</strong>
+ <p><strong><a href="http://www.trimble.com">Trimble</a> <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om011.html">SVeeSix GPS receiver</a> TAIP protocol (GPS / &lt;&lt;1&mu;s)</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 10</strong>
+ <p><strong><a href="http://www.trimble.com">Trimble</a> <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om011.html">SVeeSix GPS receiver</a> TSIP protocol (GPS / &lt;&lt;1&mu;s) (no kernel support yet)</strong><br>
+ <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om011.html"><img src="../pic/pd_om011.gif" alt="Image SVeeSix-CM3" align="top" border="0" height="100" width="420"></a><br>
+ <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om006.html"><img src="../pic/pd_om006.gif" alt="Image Lassen-SK8" border="0" height="100" width="420"></a><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 11</strong>
+ <p><strong>Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support </strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 12</strong>
+ <p><strong><a href="http://www.hopf-time.com">HOPF</a> <a href="http://www.hopf-time.com/kart6021.html">Funkuhr 6021</a></strong><br>
+ <a href="http://www.hopf-time.com/engl/kart6021.html"><img src="../pic/fg6021.gif" alt="Image DCF77 Interface Board" align="top" border="0" height="207" width="238"></a><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 13</strong>
+ <p><strong>Diem's Computime Radio Clock</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 14</strong>
+ <p><strong>RAWDCF receiver (DTR=high/RTS=low)</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 15</strong>
+ <p><strong>WHARTON 400A Series Clocks with a 404.2 Serial Interface</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 16</strong>
+ <p><strong>RAWDCF receiver (DTR=low/RTS=high) </strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 17</strong>
+ <p><strong>VARITEXT Receiver (MSF) </strong><br>
+ <br>
+ </p>
+ </li>
+ <li><a name="mode18"></a><strong>server 127.127.8.0-3 mode 18</strong>
+ <p><strong><a href="http://www.meinberg.de">Meinberg </a><a href="http://www.meinberg.de/english/products/timesource.htm#gps---freq_sync">GPS16x/GPS17x receivers</a> (GPS / &lt;&lt;1&mu;s)</strong><br>
+ </p>
+ <p>This mode works without additional data communication (version, GPS status etc.) and thus should be used with multidrop, heterogeneous multiclient operation.</p>
+ <p><strong>Note:</strong> mode 18 must not be used with Meinberg PCI cards, use mode 2 instead.<br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 19</strong>
+ <p><strong>Gude Analog- und Digitalsystem GmbH 'Expert mouseCLOCK USB v2.0'</strong><br>
+ <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 20</strong>
+ <p><strong>RAWDCF receiver similar to mode 14, but operating @ 75 baud (DTR=high/RTS=low)</strong><br>
+ </p>
+ <p>Driving the DCF clocks at 75 baud may help to get them to work with a bunch of common USB serial converters, that do 75 but cannot do 50 baud at all, e.g. those based on Prolific PL2303. <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 21</strong>
+ <p><strong>RAWDCF receiver similar to mode 16, but operating @ 75 baud (DTR=low/RTS=high) </strong><br>
+ </p>
+ <p>See comment from mode 20 clock. <br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 22</strong>
+ <p><strong>MEINBERG, mode 2 but with POWERUP trust </strong><br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 23</strong>
+ <p><strong>MEINBERG, mode 7 but with POWERUP trust </strong><br>
+ </p>
+ </li>
+ <li><strong>server 127.127.8.0-3 mode 24</strong>
+ <p><strong><a href="http://www.selinc.com/">Schweitzer Engineering Laboratories</a></strong><br>
+ </p>
+ </li>
+ </ul>
+ <p>Actual data formats and setup requirements of the various clocks can be found in <a href="../parsedata.html">NTP PARSE clock data formats</a>.</p>
+ <h4>Operation</h4>
+ <p>The reference clock support software carefully monitors the state transitions of the receiver. All state changes and exceptional events (such as loss of time code transmission) are logged via the syslog facility. Every hour a summary of the accumulated times for the clock states is listed via syslog.</p>
+ <p>PPS support is only available when the receiver is completely synchronized. The receiver is believed to deliver correct time for an additional period of time after losing synchronization, unless a disruption in time code transmission is detected (possible power loss). The trust period is dependent on the receiver oscillator and thus is a function of clock type.</p>
+ <p>Raw DCF77 pulses can be fed via a level converter to the RXD pin of an RS-232 serial port (pin 3 of a 25-pin connector or pin 2 of a 9-pin connector). The telegrams are decoded and used for synchronization. DCF77 AM receivers can be bought for as little as $25. The accuracy is dependent on the receiver and is somewhere between 2ms (expensive) and 10ms (cheap). Synchronization ceases when reception of the DCF77 signal deteriorates, since no backup oscillator is available as usually found in other reference clock receivers. So it is important to have a good place for the DCF77 antenna. During transmitter shutdowns you are out of luck unless you have other NTP servers with alternate time sources available.</p>
+ <p>In addition to the PPS loopfilter control, a true PPS hardware signal can be utilized via the PPSAPI interface. PPS pulses are usually fed via a level converter to the DCD pin of an RS-232 serial port (pin 8 of a 25-pin connector or pin 1 of a 9-pin connector). To select PPS support, the mode parameter is the mode value as above plus 128. If 128 is not added to the mode value, PPS will be detected to be available but will not be used. </p>
+ <h4>Hardware PPS support<br>
+ </h4>
+ <p>For PPS to be used, add 128 to the mode parameter.</p>
+ <p>If the PPS signal is fed in from a device different from the device providing the serial communication (/dev/refclock-{0..3}), this device is configured as /dev/refclockpps-{0..3}. This allows the PPS information to be fed in e.g. via the parallel port (if supported by the underlying operation system) and the date/time telegrams to be handled via the serial port.</p>
+ <h4>Monitor Data</h4>
+ <p>Clock state statistics are written hourly to the syslog service. Online information can be found by examining the clock variables via the ntpq cv command.<br>
+ Some devices have quite extensive additional information (GPS16x/GPS17x, Trimble). The driver reads out much of the internal GPS data and makes it accessible via clock variables. To find out about additional variable names, query for the clock_var_list variable on a specific clock association as shown below. </p>
+ <p>First let ntpq display the table of associations:</p>
+ <pre> ntpq&gt; as ind assID status conf reach auth condition last_event cnt =========================================================== 1 19556 9154 yes yes none falsetick reachable 5 2 19557 9435 yes yes none candidat clock expt 3 3 19558 9714 yes yes none pps.peer reachable 1 </pre>
+ <p>Then switch to raw output. This may be required because of display limitations in ntpq/ntpd - so large lists need to be retrieved in several queries.</p>
+ <pre> ntpq&gt; raw Output set to raw </pre>
+ <p>Use the cv command to read the list of clock variables of a selected association:</p>
+ <pre> ntpq&gt; cv 19557 clock_var_list </pre>
+ <p>The long output of the command above looks similar to:</p>
+ <pre> assID=19557 status=0x0000, clock_var_list="type,timecode,poll,noreply,badformat,baddata,fudgetime1, fudgetime2,stratum,refid,flags,device,clock_var_list,refclock_time,refclock_status, refclock_format,refclock_states,refclock_id,refclock_iomode,refclock_driver_version, meinberg_gps_status,gps_utc_correction,gps_message,meinberg_antenna_status,gps_tot_51, gps_tot_63,gps_t0a,gps_cfg[1],gps_health[1],gps_cfg[2],gps_health[2],gps_cfg[3], gps_health[3],gps_cfg[4],gps_health[4],gps_cfg[5]" </pre>
+ <p>Then use the cv command again to list selected clock variables. The following command must be entered as a single line:</p>
+ <pre> ntpq&gt; cv 19557 refclock_status,refclock_format,refclock_states,refclock_id, refclock_iomode,refclock_driver_version,meinberg_gps_status,gps_utc_correction, gps_message,meinberg_antenna_status,gps_tot_51,gps_tot_63,gps_t0a,gps_cfg[1], gps_health[1],gps_cfg[2],gps_health[2],gps_cfg[3],gps_health[3],gps_cfg[4], gps_health[4],gps_cfg[5] </pre>
+ <p>The output of the command above is wrapped around depending on the screen width and looks similar to:</p>
+ <pre> status=0x0003, refclock_status="UTC DISPLAY; TIME CODE; PPS; POSITION; (LEAP INDICATION; PPS SIGNAL; POSITION)", refclock_format="Meinberg GPS Extended", refclock_states="*NOMINAL: 21:21:36 (99.99%); FAULT: 00:00:03 (0.00%); running time: 21:21:39", refclock_id="GPS", refclock_iomode="normal", refclock_driver_version="refclock_parse.c,v 4.77 2006/08/05 07:44:49 kardel RELEASE_20060805_A", meinberg_gps_status="[0x0000] &lt;OK&gt;", gps_utc_correction="current correction 14 sec, last correction on c7619a00.00000000 Sun, Jan 1 2006 0:00:00.000", gps_message="/PFU3SOP-4WG14EPU0V1KA", meinberg_antenna_status="RECONNECTED on 2006-07-18 08:13:20.0000000 (+0000) UTC CORR, LOCAL TIME, reconnect clockoffset +0.0000000 s, disconnect time 0000-00-00 00:00:00.0000000 (+0000) ", gps_tot_51="week 1400 + 3 days + 42300.0000000 sec", gps_tot_63="week 1400 + 3 days + 42294.0000000 sec", gps_t0a="week 1400 + 5 days + 71808.0000000 sec", gps_cfg[1]="[0x9] BLOCK II", gps_health[1]="[0x0] OK;SIGNAL OK", gps_cfg[2]="[0x0] BLOCK I", gps_health[2]="[0x3f] PARITY;MULTIPLE ERRS", gps_cfg[3]="[0x9] BLOCK II", gps_health[3]="[0x0] OK;SIGNAL OK", gps_cfg[4]="[0x9] BLOCK II", gps_health[6]="[0x0] OK;SIGNAL OK", gps_cfg[5]="[0x9] BLOCK II" </pre>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt>time1 <em>time</em> </dt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction. The default value depends on the clock type. </dd>
+ <dt>time2 <em>time</em> </dt>
+ <dd> If flag1 is 0, time2 specifies the offset of the PPS signal from the actual time (PPS fine tuning). </dd>
+ <dd> If flag1 is 1, time2 specifies the number of seconds a receiver with a premium local oscillator can be trusted after losing synchronisation. </dd>
+ <dt>stratum <em>stratum</em> </dt>
+ <dd>The stratum for this reference clock. </dd>
+ <dt>refid <em>refid</em> </dt>
+ <dd>The refid for this reference clock. </dd>
+ </dl>
+ <dl>
+ <dt>flag1 { 0 | 1 } </dt>
+ <dd>If 0, the fudge factor time2 refers to the PPS offset. </dd>
+ <dd>If 1, time2 refers to the TRUST TIME. </dd>
+ <dt>flag2 { 0 | 1 } </dt>
+ <dd>If flag2 is 1, sample PPS on CLEAR instead of on ASSERT. </dd>
+ <dt>flag3 { 0 | 1 } </dt>
+ <dd>If flag3 is 1, link kernel PPS tracking to this refclock instance. </dd>
+ <dt>flag4 { 0 | 1 } </dt>
+ <dd>Delete next leap second instead of adding it. (You'll need to wait a bit for that to happen 8-) </dd>
+ </dl>
+ Note about auxiliary Sun STREAMS modules (SunOS and Solaris):<br>
+ <dl>
+ <dt>The timecode of these receivers can be sampled via a STREAMS module in the kernel. (The STREAMS module has been designed for use with Sun systems under SunOS 4.1.x or Solaris 2.3 - 2.8. It can be linked directly into the kernel or loaded via the loadable driver mechanism.) This STREAMS module can be adapted to convert different time code formats. Nowadays the PPSAPI mechanism is usually used. </dt>
+ </dl>
+ <h4>Making your own PARSE clocks</h4>
+ <p>The parse clock mechanism deviates from the way other NTP reference clocks work. For a short description of how to build parse reference clocks, see <a href="../parsenew.html">making PARSE clocks</a>.</p>
+ <p>Additional Information</p>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+</html>
diff --git a/html/drivers/driver9.html b/html/drivers/driver9.html
new file mode 100644
index 0000000..2e52af8
--- /dev/null
+++ b/html/drivers/driver9.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]">
+ <title>Magnavox MX4200 GPS Receiver</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Magnavox MX4200 GPS Receiver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ Address: 127.127.9.<i>u</i><br>
+ Reference ID: <tt>GPS</tt><br>
+ Driver ID: <tt>GPS_MX4200</tt><br>
+ Serial Port: <tt>/dev/gps<i>u</i></tt>; 4800 baud, 8-bits, no parity<br>
+ Features: <tt>ppsclock</tt> (required)
+ <h4>Description</h4>
+ <p>This driver supports the Magnavox MX4200 Navigation Receiver adapted to precision timing applications. This driver supports all compatible receivers such as the 6-channel MX4200, MX4200D, and the 12-channel MX9212, MX9012R, MX9112.</p>
+ <p><a href="http://www.leica-gps.com/"><img src="../pic/9400n.jpg" alt="Leica MX9400N Navigator" height="143" width="180" align="left"></a> <a href="http://www.leica-gps.com/">Leica Geosystems</a> acquired the Magnavox commercial GPS technology business in February of 1994. They now market and support former Magnavox GPS products such as the MX4200 and its successors.</p>
+ <br clear="LEFT">
+ <p>Leica MX9400N Navigator.</p>
+ <h4>Operating Modes</h4>
+ <p>This driver supports two modes of operation, static and mobile, controlled by clock flag 2.</p>
+ <p>In static mode (the default) the driver assumes that the GPS antenna is in a fixed location. The receiver is initially placed in a &quot;Static, 3D Nav&quot; mode, where latitude, longitude, elevation and time are calculated for a fixed station. An average position is calculated from this data. After 24 hours, the receiver is placed into a &quot;Known Position&quot; mode, initialized with the calculated position, and then solves only for time.</p>
+ <p>In mobile mode, the driver assumes the GPS antenna is mounted on a moving platform such as a car, ship, or aircraft. The receiver is placed in &quot;Dynamic, 3D Nav&quot; mode and solves for position, altitude and time while moving. No position averaging is performed.</p>
+ <h4>Monitor Data</h4>
+ <p>The driver writes each timecode as received to the <tt>clockstats</tt> file. Documentation for the <cite>NMEA-0183</cite> proprietary sentences produced by the MX4200 can be found in <a href="mx4200data.html">MX4200 Receiver Data Format</a>.</p>
+ <h4>Fudge Factors</h4>
+ <dl>
+ <dt><tt>time1 <i>time</i></tt>
+ <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
+ <dt><tt>time2 <i>time</i></tt>
+ <dd>Not used by this driver.
+ <dt><tt>stratum <i>number</i></tt>
+ <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+ <dt><tt>refid <i>string</i></tt>
+ <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>.
+ <dt><tt>flag1 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag2 0 | 1</tt>
+ <dd>Assume GPS receiver is on a mobile platform if set.
+ <dt><tt>flag3 0 | 1</tt>
+ <dd>Not used by this driver.
+ <dt><tt>flag4 0 | 1</tt>
+ <dd>Not used by this driver.
+ </dl>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a>&nbsp;</p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/icons/home.gif b/html/drivers/icons/home.gif
new file mode 100644
index 0000000..e181298
--- /dev/null
+++ b/html/drivers/icons/home.gif
Binary files differ
diff --git a/html/drivers/icons/mail2.gif b/html/drivers/icons/mail2.gif
new file mode 100644
index 0000000..21bc1c4
--- /dev/null
+++ b/html/drivers/icons/mail2.gif
Binary files differ
diff --git a/html/drivers/mx4200data.html b/html/drivers/mx4200data.html
new file mode 100644
index 0000000..611da6a
--- /dev/null
+++ b/html/drivers/mx4200data.html
@@ -0,0 +1,1077 @@
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>MX4200 Receiver Data Format</title>
+ <link href="../scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h1>MX4200 Receiver Data Format</h1>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h2>Table of Contents</h2>
+ <ul>
+ <li><a href="#control">Control Port Sentences</a>
+ <li><a href="#input">Control Port Input Sentences</a>
+ <ul>
+ <li><a href="#input_000">$PMVXG,000</a> Initialization/Mode Control - Part A
+ <li><a href="#input_001">$PMVXG,001</a> Initialization/Mode Control - Part B
+ <li><a href="#input_007">$PMVXG,007</a> Control Port Configuration
+ <li><a href="#input_023">$PMVXG,023</a> Time Recovery Configuration
+ <li><a href="#input_gpq">$CDGPQ,YYY</a> Query From a Remote Device / Request to Output a Sentence
+ </ul>
+ <li><a href="#output">Control Port Output Sentences</a>
+ <ul>
+ <li><a href="#output_000">$PMVXG,000</a> Receiver Status
+ <li><a href="#output_021">$PMVXG,021</a> Position, Height, Velocity
+ <li><a href="#output_022">$PMVXG,022</a> DOPs
+ <li><a href="#output_030">$PMVXG,030</a> Software Configuration
+ <li><a href="#output_101">$PMVXG,101</a> Control Sentence Accept/Reject
+ <li><a href="#output_523">$PMVXG,523</a> Time Recovery Configuration
+ <li><a href="#output_830">$PMVXG,830</a> Time Recovery Results
+ </ul>
+ </ul>
+ <hr>
+ <h2><a name="control">Control Port Sentences</a></h2>
+ <p>The Control (CDU) Port is used to initialize, monitor, and control the receiver. The structure of the control port sentences is based on the <cite>NMEA-0183</cite> Standard for Interfacing Marine Electronics Navigation Devices (version 1.5). For more details, please refer to the <cite>NMEA-0183</cite> Specification available from the <a href="http://www.nmea.org/">National Marine Electronics Association</a>.</p>
+ <p>Reserved characters are used to indicate the beginning and the end of records in the data stream, and to delimit data fields within a sentence. Only printable ASCII characters (Hex 20 through 7F) may be used in a sentence. <a href="#table_2">Table 2</a> lists the reserved characters and defines their usage. <a href="#table_1">Table 1</a> illustrates the general Magnavox proprietary NMEA sentence format.</p>
+ <h4><a name="table_1">Table 1. Magnavox Proprietary NMEA Sentence Format</a></h4>
+ <code>$PMVXG,XXX,...................*CK </code>
+ <p></p>
+ <table border>
+ <tr>
+ <th>Character</th>
+ <th>Meaning</th>
+ </tr>
+ <tr>
+ <td><code>$</code></td>
+ <td>Sentence Start Character</td>
+ </tr>
+ <tr>
+ <td><code>P</code></td>
+ <td>Special ID (P = Proprietary)</td>
+ </tr>
+ <tr>
+ <td><code>MVX</code></td>
+ <td>Originator ID (MVX = Magnavox)</td>
+ </tr>
+ <tr>
+ <td><code>G</code></td>
+ <td>Interface ID (G = GPS)</td>
+ </tr>
+ <tr>
+ <td><code>XXX</code></td>
+ <td>Sentence Type</td>
+ </tr>
+ <tr>
+ <td><code>...</code></td>
+ <td>Data</td>
+ </tr>
+ <tr>
+ <td><code>*</code></td>
+ <td>Optional Checksum Field Delimiter</td>
+ </tr>
+ <tr>
+ <td><code>CK</code></td>
+ <td>Optional Checksum</td>
+ </tr>
+ </table>
+ <h4><a name="table_2">Table 2. NMEA Sentence Reserved Characters</a></h4>
+ <table border>
+ <tr>
+ <th>Character</th>
+ <th>Hex Value</th>
+ <th>Usage</th>
+ </tr>
+ <tr>
+ <td><code>$</code></td>
+ <td>24</td>
+ <td>Start of Sentence Identifier</td>
+ </tr>
+ <tr>
+ <td><code>{cr}{lf}</code></td>
+ <td>0D 0A</td>
+ <td>End of Sentence Identifier</td>
+ </tr>
+ <tr>
+ <td><code>,</code></td>
+ <td>2C</td>
+ <td>Sentence Delimiter</td>
+ </tr>
+ <tr>
+ <td><code>*</code></td>
+ <td>2A</td>
+ <td>Optional Checksum Field Delimiter</td>
+ </tr>
+ </table>
+ <p>Following the start character <code>$</code>, are five characters which constitute the block label of the sentence. For Magnavox proprietary sentences, this label is always <code>PMVXG</code>. The next field after the block label is the sentence type, consisting of three decimal digits.</p>
+ <p>The data, delimited by commas, follows the sentence type. Note that the receiver uses a free-format parsing algorithm, so you need not send the exact number of characters shown in the examples. You will need to use the commas to determine how many bytes of data need to be retrieved.</p>
+ <p>The notation <code>CK</code> shown in <a href="#table_1">Table 1</a> symbolically indicates the optional checksum in the examples. The checksum is computed by exclusive-ORing all of the bytes between the <code>$</code> and the <code>*</code> characters. The <code>$</code>, <code>*</code> and the checksum are not included in the checksum computation.</p>
+ <p>Checksums are optional for Control Port input sentences, but are highly recommended to limit the effects of communication errors. Magnavox receivers always generate checksums for Control Port output sentences.</p>
+ <p>ASCII data characters are transmitted in the following format:</p>
+ <table border>
+ <tr>
+ <td>Data Bits</td>
+ <td>8 (msb always 0)</td>
+ </tr>
+ <tr>
+ <td>Parity</td>
+ <td>None</td>
+ </tr>
+ <tr>
+ <td>Stop Bits</td>
+ <td>1</td>
+ </tr>
+ </table>
+ <p>NULL fields are fields which do not contain any data. They would appear as two commas together in the sentence format, except for the final field. Some Magnavox proprietary sentences require that the format contain NULL fields. mandatory NULL fields are identified by an '*' next to the respective field.</p>
+ <hr>
+ <h2><a name="input">Control Port Input Sentences</a></h2>
+ These are the subset of the MX4200 control port input sentences sent by the NTP driver to the GPS receiver.
+ <hr>
+ <h3><a name="input_000">$PMVXG,000</a></h3>
+ <h4>Initialization/Mode Control - Part A</h4>
+ Initializes the time, position and antenna height of the MX4200.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Default</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Day</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ <td>1-31</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Month</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ <td>1-12</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Year</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ <td>1991-9999</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>GMT Time</td>
+ <td>HHMMSS</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ <td>000000-235959</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>WGS-84 Latitude</td>
+ <td>DDMM.MMMM</td>
+ <td>Float</td>
+ <td>0.0</td>
+ <td>0 - 8959.9999</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>North/South Indicator</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>N</td>
+ <td>N,S</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>WGS-84 Longitude</td>
+ <td>DDDMM.MMMM</td>
+ <td>Float</td>
+ <td>0.0</td>
+ <td>0 - 17959.9999</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>East/West Indicator</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>E</td>
+ <td>E,W</td>
+ </tr>
+ <tr>
+ <td>9</td>
+ <td>Altitude (height above Mean Sea Level) in meters (WGS-84)</td>
+ <td>Meters</td>
+ <td>Float</td>
+ <td>0.0</td>
+ <td>+/-99999.0</td>
+ </tr>
+ <tr>
+ <td>10</td>
+ <td>Not Used</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,000,,,,,,,,,,*48</code><br>
+ <code>$PMVXG,000,,,,,5128.4651,N,00020.0715,W,58.04,*4F</code>
+ <hr>
+ <h3><a name="input_001">$PMVXG,001</a></h3>
+ <h4>Initialization/Mode Control - Part B</h4>
+ Specifies various navigation parameters: Altitude aiding, acceleration DOP limits, and satellite elevation limits.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Default</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>*1</td>
+ <td>Constrain Altitude</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1</td>
+ <td>0=3D Only<br>
+ 1=Auto<br>
+ 2=2D Only</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Not Used</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>*3</td>
+ <td>Horizontal Acceleration Factor</td>
+ <td>m/sec^2</td>
+ <td>Float</td>
+ <td>1.0</td>
+ <td>0.5-10.0</td>
+ </tr>
+ <tr>
+ <td>*4</td>
+ <td>Not Used</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>*5</td>
+ <td>VDOP Limit</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>10</td>
+ <td>1-9999</td>
+ </tr>
+ <tr>
+ <td>*6</td>
+ <td>HDOP Limit</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>10</td>
+ <td>1-9999</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Elevation Limit</td>
+ <td>Deg</td>
+ <td>Int</td>
+ <td>5</td>
+ <td>0-90</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>Time Output Mode</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>U</td>
+ <td>U=UTC<br>
+ L=Local Time</td>
+ </tr>
+ <tr>
+ <td>9</td>
+ <td>Local Time Offset</td>
+ <td>HHMM</td>
+ <td>Int</td>
+ <td>0</td>
+ <td>+/- 0-2359</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,001,3,,0.1,0.1,10,10,5,U,0*06</code>
+ <hr>
+ <h3><a name="input_007">$PMVXG,007</a></h3>
+ <h4>Control Port Output Configuration</h4>
+ This message enables or disables output of the specified sentence and defines the output rate. The user sends this message for each sentence that the receiver is to output.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Default</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Control Port Output Block Label</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Clear Current Output List</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ <td>0=No<br>
+ 1=Yes</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Add/Delete Sentence from List</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ <td>1=Append<br>
+ 2=Delete</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Not Used</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>Sentence Output Rate</td>
+ <td>Sec</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ <td>1-9999</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td># digits of Precision for CGA and GLL sentences</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>2</td>
+ <td>2-4</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Not Used</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>Not Used</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,007,022,0,1,,1,,,*4F</code>
+ <hr>
+ <h3><a name="input_023">$PMVXG,023</a></h3>
+ <h4>Time Recovery Configuration</h4>
+ This message is used to enable/disable the time recovery feature of the receiver. The time synchronization for the 1PPS output is specified in addition to a user time bias and an error tolerance for a valid pulse. This record is accepted in units configured for time recovery. If the back panel contains a 1PPS outlet, the receiver is a time recovery unit.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Default</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>*1</td>
+ <td>Time Recovery Mode</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>D</td>
+ <td>D=Dynamic<br>
+ S=Static<br>
+ K=Known Position<br>
+ N=No Time Recovery</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Time Synchronization</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>G</td>
+ <td>U=UTC<br>
+ G=GPS</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Time Mark Mode</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>A</td>
+ <td>A=Always<br>
+ V=Valid Pulses Only</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Maximum Time Error</td>
+ <td>Nsec</td>
+ <td>Int</td>
+ <td>100</td>
+ <td>50-1000</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>User Time Bias</td>
+ <td>Nsec</td>
+ <td>Int</td>
+ <td>0</td>
+ <td>+/- 99999</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>ASCII Time Message Control</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>0</td>
+ <td>0=No Output<br>
+ 1=830 to Control Port<br>
+ 2=830 to Equipment Port</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Known Pos PRN</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>0</td>
+ <td>1-32<br>
+ 0=Track All Sats</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,023,S,U,A,500,0,1,*16</code>
+ <hr>
+ <h3><a name="input_gpq">$CDGPQ,YYY</a></h3>
+ <h4>Query From a Remote Device / Request to Output a Sentence</h4>
+ Enables the controller to request a one-time transmission of a specific block label. To output messages at a periodic rate, refer to input sentence <a href="#input_007">$PMVXG,007</a>.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Default</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1:CD</td>
+ <td>ID of Remote Device</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ <td>(See <cite>NMEA-0183</cite>)</td>
+ </tr>
+ <tr>
+ <td>2:GP</td>
+ <td>GPS</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ <td>(See <cite>NMEA-0183</cite>)</td>
+ </tr>
+ <tr>
+ <td>3:Q</td>
+ <td>Query</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ <td>(See <cite>NMEA-0183</cite>)</td>
+ </tr>
+ <tr>
+ <td>4:YYY</td>
+ <td>Label of Desired Sentence</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ <td>Any Valid NMEA or Magnavox Sentence Type</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$CDGPQ,030*5E</code>
+ <hr>
+ <h2><a name="output">Control Port Output Sentences</a></h2>
+ These are the subset of the MX4200 control port output sentences recognized by the NTP driver.
+ <hr>
+ <h3><a name="output_000">$PMVXG,000</a></h3>
+ <h4>Receiver Status</h4>
+ Returns the current status of the receiver including the operating mode, number of satellites visible, and the number of satellites being tracked.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Current Receiver Status</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>ACQ=Reacquisition<br>
+ ALT=Constellation Selection<br>
+ IAC=Initial Acquisition<br>
+ IDL=Idle, No Satellites<br>
+ NAV=Navigating<br>
+ STS=Search The Sky<br>
+ TRK=Tracking</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Number of Satellites that should be Visible</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>0-12</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Number of Satellites being Tracked</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>0-12</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Time since Last Navigation</td>
+ <td>HHMM</td>
+ <td>Int</td>
+ <td>0-2359</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>Initialization Status</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>0=Waiting for Initialization<br>
+ 1=Initialization Complete</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,000,TRK,3,3,0122,1*19</code>
+ <hr>
+ <h3><a name="output_021">$PMVXG,021</a></h3>
+ <h4>Position, Height, Velocity</h4>
+ This sentence gives the receiver position, height, navigation mode and velocity north/east. <em>This sentence is intended for post analysis applications.</em>
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>UTC Measurement Time</td>
+ <td>Seconds into the week</td>
+ <td>Float</td>
+ <td>0-604800.00</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>WGS-84 Latitude</td>
+ <td>DDMM.MMMM</td>
+ <td>Float</td>
+ <td>0-89.9999</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>North/South Indicator</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>N, S</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>WGS-84 Longitude</td>
+ <td>DDDMM.MMMM</td>
+ <td>Float</td>
+ <td>0-179.9999</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>East/West Indicator</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>E, W</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>Altitude (MSL)</td>
+ <td>Meters</td>
+ <td>Float</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Geoidal Height</td>
+ <td>Meters</td>
+ <td>Float</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>Velocity East</td>
+ <td>M/Sec</td>
+ <td>Float</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>9</td>
+ <td>Velocity North</td>
+ <td>M/Sec</td>
+ <td>Float</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>10</td>
+ <td>Navigation Mode</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td><em>Navigating</em><br>
+ 1=Position From a Remote Device<br>
+ 2=2D<br>
+ 3=3D<br>
+ 4=2D differential<br>
+ 5=3D differential<br>
+ <em>Not Navigating</em><br>
+ 51=Too Few Satellites<br>
+ 52=DOPs too large<br>
+ 53=Position STD too large<br>
+ 54=Velocity STD too large<br>
+ 55=Too many iterations for velocity<br>
+ 56=Too many iterations for position<br>
+ 57=3 Sat Startup failed</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,021,142244.00,5128.4744,N,00020.0593,W,00054.4,0047.4,0000.1,-000.2,03*66</code>
+ <hr>
+ <h3><a name="output_022">$PMVXG,022</a></h3>
+ <h4>DOPs</h4>
+ This sentence reports the DOP (Dilution Of Precision) values actually used in the measurement processing corresponding to the satellites listed. The satellites are listed in receiver channel order. Fields 11-16 are output only on 12-channel receivers.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>UTC Measurement Time</td>
+ <td>Seconds into the week</td>
+ <td>Float</td>
+ <td>0-604800.00</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>East DOP (EDOP)</td>
+ <td>&nbsp;</td>
+ <td>Float</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>North DOP (NDOP)</td>
+ <td>&nbsp;</td>
+ <td>Float</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Vertical DOP (VDOP)</td>
+ <td>&nbsp;</td>
+ <td>Float</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>PRN on Channel #1</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>PRN on Channel #2</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>PRN on Channel #3</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>PRN on Channel #4</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>9</td>
+ <td>PRN on Channel #5</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>10</td>
+ <td>PRN on Channel #6</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>11</td>
+ <td>PRN on Channel #7</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>12</td>
+ <td>PRN on Channel #8</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>13</td>
+ <td>PRN on Channel #9</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>14</td>
+ <td>PRN on Channel #10</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>15</td>
+ <td>PRN on Channel #11</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ <tr>
+ <td>16</td>
+ <td>PRN on Channel #12</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-32</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,022,142243.00,00.7,00.8,01.9,27,26,10,09,13,23*77</code>
+ <hr>
+ <h3><a name="output_030">$PMVXG,030</a></h3>
+ <h4>Software Configuration</h4>
+ This sentence contains the navigation processor and baseband firmware version numbers.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Nav Processor Version Number</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Baseband Firmware Version Number</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,030,DA35,015</code>
+ <hr>
+ <h3><a name="output_101">$PMVXG,101</a></h3>
+ <h4>Control Sentence Accept/Reject</h4>
+ This sentence is returned (on the Control Port) for every <strong>$PMVXG</strong> and <strong>$XXGPQ</strong> sentence that is received.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Sentence ID</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Accept/Reject Status</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>0=Sentence Accepted<br>
+ 1=Bad Checksum<br>
+ 2=Illegal Value<br>
+ 3=Unrecognized ID<br>
+ 4=Wrong # of fields<br>
+ 5=Required Data Field Missing<br>
+ 6=Requested Sentence Unavailable</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Bad Field Index</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Requested Sentence ID (If field #1 = GPQ)</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,101,GPQ,0,,030*0D</code>
+ <hr>
+ <h3><a name="output_523">$PMVXG,523</a></h3>
+ <h4>Time Recovery Configuration</h4>
+ This sentence contains the configuration of the time recovery function of the receiver.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Time Recovery Mode</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>D=Dynamic<br>
+ S=Static<br>
+ K=Known Position<br>
+ N=No Time Recovery</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Time Synchronization</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>U=UTC Time<br>
+ G=GPS Time</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Time Mark Mode</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>A=Always Output Time Pulse<br>
+ V=Only when Valid</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Maximum Time Error for which a time mark will be considered valid</td>
+ <td>Nsec</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>User Time Bias</td>
+ <td>Nsec</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>Time Message Control</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>0=No Message<br>
+ 1=830 to Control Port<br>
+ 2=830 to Equipment Port</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Not Used</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,523,S,U,A,0500,000000,1,0*23</code>
+ <hr>
+ <h3><a name="output_830">$PMVXG,830</a></h3>
+ <h4>Time Recovery Results</h4>
+ This sentence is output approximately 1 second preceding the 1PPS output. It indicates the exact time of the next pulse, whether or not the time mark will be valid (based on operator-specified error tolerance), the time to which the pulse is synchronized, the receiver operating mode, and the time error of the <strong>last</strong> 1PPS output. The leap second flag (Field #11) is not output by older receivers.
+ <p></p>
+ <table border>
+ <tr>
+ <th>Field</th>
+ <th>Description</th>
+ <th>Units</th>
+ <th>Format</th>
+ <th>Range</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Time Mark Valid</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>T=Valid<br>
+ F=Not Valid</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Year</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1993-</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Month</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>1-12</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Day</td>
+ <td>Nsec</td>
+ <td>Int</td>
+ <td>1-31</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>Time</td>
+ <td>HH:MM:SS</td>
+ <td>Int</td>
+ <td>00:00:00-23:59:59</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>Time Synchronization</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>U=UTC<br>
+ G=GPS</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Operating Mode</td>
+ <td>&nbsp;</td>
+ <td>Char</td>
+ <td>D=Dynamic<br>
+ S=Static<br>
+ K=Known Position</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>Oscillator Offset - estimate of oscillator frequency error</td>
+ <td>PPB</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>9</td>
+ <td>Time Mark Error of last pulse</td>
+ <td>Nsec</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>10</td>
+ <td>User Time Bias</td>
+ <td>Nsec</td>
+ <td>Int</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>11</td>
+ <td>Leap Second Flag - indicates that a leap second will occur. This value is usually zero except during the week prior to a leap second occurrence, when this value will be set to +/-1. A value of +1 indicates that GPS time will be 1 second further ahead of UTC time.</td>
+ <td>&nbsp;</td>
+ <td>Int</td>
+ <td>-1,0,1</td>
+ </tr>
+ </table>
+ Example:<br>
+ <code>$PMVXG,830,T,1998,10,12,15:30:46,U,S,000298,00003,000000,01*02</code>
+ <hr>
+ <script type="text/javascript" language="javascript" src="../scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/oncore-shmem.html b/html/drivers/oncore-shmem.html
new file mode 100644
index 0000000..ec1d974
--- /dev/null
+++ b/html/drivers/oncore-shmem.html
@@ -0,0 +1,164 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>ONCORE - SHMEM</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>Motorola ONCORE - The Shared Memory Interface</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Introduction</h4>
+ <p>In NMEA mode, the Oncore GPS receiver provides the user with the same information as other GPS receivers. In BINARY mode, it can provide a lot of additional information.</p>
+ <p>In particular, you can ask for satellite positions, satellite health, signal levels, the ephemeris and the almanac, and you can set many operational parameters. In the case of the VP, you can get the pseudorange corrections necessary to act as a DGPS base station, and you can see the raw satellite data messages themselves.</p>
+ <p>When using the Oncore GPS receiver with NTP, this additional information is usually not available since the receiver is only talking to the oncore driver in NTPD. To make this information available for use in other programs, (say graphic displays of satellites positions, plots of SA, etc.), a shared memory interface (SHMEM) has been added to the refclock_oncore driver on those operating systems that support shared memory.</p>
+ <p>To make use of this information you will need an Oncore Reference Manual for the Oncore GPS receiver that you have. The Manual for the VP only exists as a paper document, the UT+/GT+/M12 manuals are available as a pdf documents at <a href="http://www.synergy-gps.com/Mot_Manuals.html">Synergy</a> .</p>
+ <p>This interface was written by Poul-Henning Kamp (phk@FreeBSD.org), and modified by Reg Clemens (reg@dwf.com). The interface is known to work in FreeBSD, Linux, and Solaris.</p>
+ <h4>Activating the Interface</h4>
+ <p>Although the Shared Memory Interface will be compiled into the Oncore driver on those systems where Shared Memory is supported, to activate this interface you must include a <b>STATUS</b> or <b>SHMEM</b> line in the <tt>/etc/ntp.oncore</tt> data file that looks like</p>
+ <pre>
+ STATUS &lt; file_name &gt;<br>
+
+ or<br>
+
+ SHMEM &lt; file_name &gt;
+</pre>
+ Thus a line like
+ <pre>
+ SHMEM /var/adm/ntpstats/ONCORE
+</pre>
+ <p>would be acceptable. This file name will be used to access the Shared Memory.</p>
+ <p>In addition, one the two keywords <b>Posn2D</b> and <b>Posn3D</b> can be added to see @@Ea records containing the 2D or 3D position of the station (see below). Thus to activate the interface, and see 3D positions, something like</p>
+ <pre>
+ SHMEM /var/adm/ntpstats/ONCORE
+ Posn3D
+</pre>
+ <p>would be required.</p>
+ <h4>Storage of Messages in Shared Memory</h4>
+ <p>With the shared memory interface, the oncore driver (refclock_oncore) allocates space for all of the messages that it is configured to receive, and then puts each message in the appropriate slot in shared memory as it arrives from the receiver. Since there is no easy way for a client program to know when the shared memory has been updated, a sequence number is associated with each message, and is incremented when a new message arrives. With the sequence number it is easy to check through the shared memory segment for messages that have changed.</p>
+ <p>The Oncore binary messages are kept in their full length, as described in the Reference manual, that is everything from the @@ prefix thru the &lt;checksum&gt;&lt;CR&gt;&lt;LF&gt;.</p>
+ <p>The data starts at location ONE of SHMEM (NOT location ZERO).</p>
+ <p>The messages are stacked in a series of variable length structures, that look like</p>
+ <pre>
+ struct message {
+ u_int length;
+ u_char sequence;
+ u_char message[length];
+ }
+</pre>
+ <p>if something like that were legal. That is, there are two bytes (caution, these may NOT be aligned with word boundaries, so the field needs to be treated as a pair of u_char), that contains the length of the next message. This is followed by a u_char sequence number, that is incremented whenever a new message of this type is received. This is followed by 'length' characters of the actual message.</p>
+ <p>The next structure starts immediately following the last char of the previous message (no alignment). Thus, each structure starts a distance of 'length+3' from the previous structure.</p>
+ <p>Following the last structure, is a u_int containing a zero length to indicate the end of the data.</p>
+ <p>The messages are recognized by reading the headers in the data itself, viz @@Ea or whatever.</p>
+ <p>There are two special cases.</p>
+ <p>(1) The almanac takes a total of 34 submessages all starting with @@Cb.<br>
+ 35 slots are allocated in shared memory. Each @@Cb message is initially placed in the first of these locations, and then later it is moved to the appropriate location for that submessage. The submessages can be distinguished by the first two characters following the @@Cb header, and new data is received only when the almanac changes.</p>
+ <p>(2) The @@Ea message contains the calculated location of the antenna, and is received once per second. However, when in timekeeping mode, the receiver is normally put in 0D mode, with the position fixed, to get better accuracy. In 0D mode no position is calculated.</p>
+ <p>When the SHMEM option is active, and if one of <b>Posn2D</b> or <b>Posn3D</b> is specified, one @@Ea record is hijacked each 15s, and the receiver is put back in 2D/3D mode so the the current location can be determined (for position determination, or for tracking SA). The timekeeping code is careful NOT to use the time associated with this (less accurate) 2D/3D tick in its timekeeping functions.</p>
+ <p>Following the initial @@Ea message are 3 additional slots for a total of four. As with the almanac, the first gets filled each time a new record becomes available, later in the code, the message is distributed to the appropriate slot. The additional slots are for messages containing 0D, 2D and 3D positions. These messages can be distinguished by different bit patterns in the last data byte of the record.</p>
+ <h4>Opening the Shared Memory File</h4>
+ <p>The shared memory segment is accessed through a file name given on a <b>SHMEM</b> card in the <tt>/etc/ntp.oncore</tt> input file. The following code could be used to open the Shared Memory Segment:</p>
+ <pre>
+ char *Buf, *file;
+ int size, fd;
+ struct stat statbuf;
+
+ file = &quot;/var/adm/ntpstats/ONCORE&quot;; /* the file name on my ACCESS card */
+ if ((fd=open(file, O_RDONLY)) &lt; 0) {
+ fprintf(stderr, &quot;Cant open %s\n&quot;, file);
+ exit(1);
+ }
+
+ if (stat(file, &amp;statbuf) &lt; 0) {
+ fprintf(stderr, &quot;Cant stat %s\n&quot;, file);
+ exit(1);
+ }
+
+ size = statbuf.st_size;
+ if ((Buf=mmap(0, size, PROT_READ, MAP_SHARED, fd, (off_t) 0)) &lt; 0) {
+ fprintf(stderr, &quot;MMAP failed\n&quot;);
+ exit(1);
+ }
+</pre>
+ <h4>Accessing the data</h4>
+ <p>The following code shows how to get to the individual records.</p>
+ <pre>
+ void oncore_msg_Ea(), oncore_msg_As(), oncore_msg_Bb();
+
+ struct Msg {
+ char c[5];
+ unsigned int seq;
+ void (*go_to)(uchar *);
+ };
+
+ struct Msg Hdr[] = { {&quot;@@Bb&quot;, 0, &amp;oncore_msg_Bb},
+ {&quot;@@Ea&quot;, 0, &amp;oncore_msg_Ea},
+ {&quot;@@As&quot;, 0, &amp;oncore_msg_As}};
+
+ void
+ read_data()
+ {
+ int i, j, k, n, iseq, jseq;
+ uchar *cp, *cp1;
+
+
+ for(cp=Buf+1; (n = 256*(*cp) + *(cp+1)) != 0; cp+=(n+3)) {
+ for (k=0; k &lt; sizeof(Hdr)/sizeof(Hdr[0]); k++) {
+ if (!strncmp(cp+3, Hdr[k].c, 4)) { /* am I interested? */
+ iseq = *(cp+2);
+ jseq = Hdr[k].seq;
+ Hdr[k].seq = iseq;
+ if (iseq &gt; jseq) { /* has it changed? */
+ /* verify checksum */
+ j = 0;
+ cp1 = cp+3; /* points to start of oncore response */
+ for (i=2; i &lt; n-3; i++)
+ j ^= cp1[i];
+ if (j == cp1[n-3]) { /* good checksum */
+ Hdr[k].go_to(cp1);
+ } else {
+ fprintf(stderr, &quot;Bad Checksum for %s\n&quot;, Hdr[k].c);
+ break;
+ }
+ }
+ }
+ }
+ if (!strncmp(cp+3, &quot;@@Ea&quot;, 4))
+ cp += 3*(n+3);
+ if (!strncmp(cp+3, &quot;@@Cb&quot;, 4))
+ cp += 34*(n+3);
+ }
+ }
+
+ oncore_msg_Bb(uchar *buf)
+ {
+ /* process Bb messages */
+ }
+
+ oncore_msg_Ea(uchar *buf)
+ {
+ /* process Ea messages */
+ }
+
+ oncore_msg_As(uchar *buf)
+ {
+ /* process As messages */
+ }
+</pre>
+ <p>The structure Hdr contains the Identifying string for each of the messages that we want to examine, and the name of a program to call when a new message of that type is arrives. The loop can be run every few seconds to check for new data.</p>
+ <h4>Examples</h4>
+ <p>There are two complete examples available. The first plots satellite positions and the station position as affected by SA, and keeps track of the mean station position, so you can run it for periods of days to get a better station position. The second shows the effective horizon by watching satellite tracks. The examples will be found in the GNU-zipped tar file <a href="ftp://ftp.udel.edu/pub/ntp/software/OncorePlot.tar.gz">ftp://ftp.udel.edu/pub/ntp/software/OncorePlot.tar.gz</a>.</p>
+ <p>Try the new interface, enjoy.</p>
+ <hr>
+ <address>Reg.Clemens (reg@dwf.com), Poul-Henning Kamp (phk@FreeBSD.org)</address>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/drivers/scripts/footer.txt b/html/drivers/scripts/footer.txt
new file mode 100644
index 0000000..d716cbf
--- /dev/null
+++ b/html/drivers/scripts/footer.txt
@@ -0,0 +1,9 @@
+document.write("\
+<table><tr>\
+<td width='33%' align='center'><img src='../icons/home.gif' align='middle'>\
+<a href='../index.html'>Home Page</a></td>\
+<td width='33%' ><img src='../icons/sitemap.png' align='middle'>\
+<a href='../sitemap.html'>Site Map</a></td>\
+<td width='33%' ><img src='../icons/mail2.gif' align='middle'>\
+<a href='http://www.ntp.org/contact'>Contacts</a></td>\
+</tr></table>")
diff --git a/html/drivers/scripts/style.css b/html/drivers/scripts/style.css
new file mode 100644
index 0000000..7b90fce
--- /dev/null
+++ b/html/drivers/scripts/style.css
@@ -0,0 +1,64 @@
+body {background: #FDF1E1;
+ color: #006600;
+ font-family: "verdana", sans-serif;
+ text-align: justify;
+ margin-left: 5px;}
+
+p, h4, hr, li {margin-top: .6em; margin-bottom: .6em}
+li.inline {text-align: left; margin-top: 0; margin-bottom: 0}
+
+ul, dl, ol, {margin-top: .6em; margin-bottom: .6em; margin-left 5em}
+
+dt {margin-top: .6em}
+dd {margin-bottom: .6em}
+
+div.header {text-align: center;
+ font-style: italic;}
+
+div.footer {text-align: center;
+ font-size: 60%;}
+
+img.cell {align: left;}
+
+td.sidebar {width: 40px; align: center; valign: top;}
+img.sidebar {align: center; margin-top: 5px;}
+h4.sidebar {align: center;}
+
+p.top {background: #FDF1E1;
+ color: #006600;
+ position: absolute;
+ margin-left: -90px;
+ text-align: center;}
+
+a:link.sidebar {background: transparent;
+ color: #990033;
+ font-weight: bold;}
+
+a:visited.sidebar {background: transparent;
+ color: #990033;
+ font-weight: bold;}
+
+a:hover.sidebar {background: #FDF1E1;
+ color: #006600;}
+
+img {margin: 5px;}
+
+div {text-align: center;}
+
+h1 {text-align: center;
+ font-size: 250%;}
+
+caption {background: #EEEEEE;
+ color: #339999;}
+
+tx {text-align: center;}
+
+th {background: #FFFFCC;
+ color: #006600;
+ text-align: center;
+ text-decoration: underline;
+ padding-top: 5px;}
+
+th.caption {background: #EEEEEE;
+ color: #006600;
+ text-align: center;}
diff --git a/html/drivers/tf582_4.html b/html/drivers/tf582_4.html
new file mode 100644
index 0000000..177976c
--- /dev/null
+++ b/html/drivers/tf582_4.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta name="GENERATOR" content="Adobe PageMill 3.0 per Windows">
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <title>PTB Modem Time Service</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>European Automated Computer Time Services</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <p>Several European countries use the following message data format:</p>
+ <p><font size="-1" face="Courier New">Data format<br>
+ 0000000000111111111122222222223333333333444444444455555555556666666666777777777 7<br>
+ 0123456789012345678901234567890123456789012345678901234567890123456789012345678 9<br>
+ 1995-01-23 20:58:51 MEZ 10402303260219950123195849740+40000500 *<br>
+ A B C D EF G H IJ K L M N O P Q R S T U V W XY Z&lt;CR&gt;&lt;LF&gt;<br>
+ A year<br>
+ B month<br>
+ C day<br>
+ D hour<br>
+ E : normally<br>
+ A for DST to ST switch first hour<br>
+ B for DST to ST switch second hour if not marked in H<br>
+ F minute<br>
+ G second<br>
+ H timezone<br>
+ I day of week<br>
+ J week of year<br>
+ K day of year<br>
+ L month for next ST/DST changes<br>
+ M day<br>
+ N hour<br>
+ O UTC year<br>
+ P UTC month<br>
+ Q UTC day<br>
+ R UTC hour<br>
+ S UTC minute<br>
+ T modified julian day (MJD)<br>
+ U DUT1<br>
+ V direction and month if leap second<br>
+ W signal delay (assumed/measured)<br>
+ X sequence number for additional text line in Y<br>
+ Y additional text<br>
+ Z on time marker (* - assumed delay / # measured delay)<br>
+ &lt;CR&gt;!&lt;LF&gt; ! is second change !<br>
+ </font></p>
+ <p>This format is an ITU-R Recommendation (ITU-R TF583.4) and is now available from the primary timing centres of the following countries: Austria, Belgium, Germany, Italy, The Netherlands, Poland, Portugal, Romania, Spain, Sweden, Switzerland, Turkey and United Kingdom. Some examples are:</p>
+ <ul>
+ <li>In Germany by Physikalisch-Technische Bundesanstalt (PTB)'s timecode service. Phone number: +49 5 31 51 20 38.
+ <p>For more detail, see <a href="http://www.ptb.de/english/org/4/43/433/disse.html">http://www.ptb.de/english/org/4/43/433/disse.htm</a></p>
+ <li>In the UK by National Physical Laboratory (NPL)'s TRUETIME service. Phone number: 0891 516 333
+ <p>For more detail, see <a href="http://www.npl.co.uk/npl/ctm/truetime.html">http://www.npl.co.uk/npl/ctm/truetime.html</a></p>
+ <li>In Italy by Istituto Elettrotecnico Nazionale &quot;Galileo Ferrais&quot; (IEN)'s CTD service. Phone number: 166 11 46 15
+ <p>For more detail, see <a href="http://www.ien.it/tf/time/Pagina42.html">http://www.ien.it/tf/time/Pagina42.html</a></p>
+ <li>In Switzerland by Swiss Federal Office of Metrology's timecode service. Phone number: 031 323 32 25
+ <p>For more detail, see <a href="http://www.metas.ch/en/labors/official-time/modem/index.html">http://www.ofmet.admin.ch/de/labors/4/Zeitvert.html </a></p>
+ <li>In Sweden by SP Swedish National Testing and Research Institute 's timecode service. Phone number: +46 33 415783.
+ <p>For more detail, see <a href="http://www.sp.se/metrology/timefreq/eng/tandf.htm">http://www.sp.se/metrology/timefreq/eng/tandf.htm</a></p>
+ </ul>
+ <dl></dl>
+ <h4>Additional Information</h4>
+ <p><a href="../refclock.html">Reference Clock Drivers</a></p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/extern.html b/html/extern.html
new file mode 100644
index 0000000..764631d
--- /dev/null
+++ b/html/extern.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>External Clock Discipline and the Local Clock Driver</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>External Clock Discipline and the Local Clock Driver</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->9-May-2014 04:46<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>The NTPv4 implementation includes provisions for an external clock, where
+ the system clock is implemented by some external hardware device.
+ One implementation might take the form of a bus peripheral with a high resolution
+ counter disciplined by a GPS receiver, for example. Another implementation
+ might involve another synchronization protocol, such as the Digital Time Synchronization
+ Service (DTSS), where the system time is disciplined to this protocol and
+ NTP clients of the server obtain synchronization indirectly via the server.
+ A third implementation might be a completely separate clock discipline algorithm
+ and synchronization protocol, such as the <tt>Lockclock</tt> algorithm used
+ with NIST Automated Computer Time Service (ACTS) modem synchronized time.</p>
+<p>When external clocks are used in conjunction with NTP service, some way needs to be provided for the external clock driver and NTP daemon <tt>ntpd</tt> to communicate and determine which discipline is in control. This is necessary in order to provide backup, for instance if the external clock or protocol were to fail and synchronization service fall back to other means, such as a local reference clock or another NTP server. In addition, when the external clock and driver are in control, some means needs to be provided for the clock driver to pass on status information and error statistics to the NTP daemon.</p>
+<p>Control and monitoring functions for the external clock and driver are implemented using the <a href="drivers/driver1.html">Local Clock (type 1) driver</a> and the <tt>ntp_adjtime()</tt> system call. This system call is implemented by special kernel provisions included in the kernel of several operating systems, including Solaris, Tru64, FreeBSD and Linux, and possibly others. When the external clock is disabled or not implemented, the system call is used to pass time and frequency information, as well as error statistics, to the kernel. Besides disciplining the system time, the same interface can be used by other applications to determine the operating parameters of the discipline.</p>
+<p>When the external clock is enabled, <tt>ntpd</tt> does not discipline the system clock, nor does it maintain the error statistics. In this case, the external clock and driver do this using mechanisms unknown to <tt>ntpd</tt>; however, in this case the kernel state variables are retrieved at 64-s intervals by the Local Clock driver and used by the clock selection and mitigation algorithms to determine the system variables presented to other NTP clients and peers. In this way, downstream clients and servers in the NTP subnet can make an intelligent choice when more than one server is available.</p>
+<p>In order to implement a reliable mitigation between ordinary NTP sources and the external clock source, a protocol is necessary between the local clock driver and the external clock driver. This is implemented using Boolean variables and certain bits in the kernel clock status word. The Boolean variables include the following:</p>
+<p><tt>ntp_enable</tt>. set/reset by the <tt>enable</tt> command. enables ntpd
+ clock discipline</p>
+<p><tt>ntp_contro</tt>l. set during initial configuration if kernel support is available</p>
+<p><tt>kern_enable</tt> Set/reset by the <tt>enable</tt> command</p>
+<p>If the <tt>kern_enable</tt> switch is set, the daemon computes the offset,
+ frequency, maximum error, estimated error, time constant and status bits,
+ then provides them to the kernel via <tt>ntp_adjtime()</tt>. If this switch
+ is not set, these values are not passed to the kernel; however, the daemon
+ retrieves their present values and uses them in place of the values computed
+ by the daemon.</p>
+<p>The <tt>pps_update</tt> bit set in the protocol routine if the prefer peer has survived and has offset less than 128 ms; otherwise set to zero.</p>
+<p>The <tt>PPS control</tt> Updated to the current time by kernel support if
+ the PPS signal is enabled and working correctly. Set to zero in the adjust
+ routine if the interval since the last update exceeds 120 s.</p>
+<p>The <tt>ntp_enable</tt> and <tt>kern_enable</tt> are set by the configuration module. Normally, both switches default on, so the daemon can control the time and the kernel discipline can be used, if available. The <tt>pps_update</tt> switch is set by the protocol module when it believes the PPS provider source is legitimate and operating within nominals. The <tt>ntp_control</tt> switch is set during configuration by interrogating the kernel. If both the <tt>kern_enable</tt> and <tt>ntp_control</tt> switches are set, the daemon disciplines the clock via the kernel and the internal daemon discipline is disabled.</p>
+<p>The external clock driver controls the system time and clock selection in the following way. Normally, the driver adjusts the kernel time using the <tt>ntp_adjtime()</tt> system call in the same way as the daemon. In the case where the kernel discipline is to be used intact, the clock offset is provided in this call and the loop operates as specified. In the case where the driver steers only the frequency, the offset is specified as zero.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/filter.html b/html/filter.html
new file mode 100644
index 0000000..5f9ed0a
--- /dev/null
+++ b/html/filter.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Clock Filter Algorithm</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Clock Filter Algorithm</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:05<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>The clock filter algorithm processes the offset and delay samples produced by the on-wire protocol for each peer process separately. It uses a sliding window of eight samples and picks out the sample with the least expected error. This page describes the algorithm design principles along with an example of typical performance.</p>
+<div align="center"><img src="pic/flt5.gif" alt="gif">
+ <p>Figure 1. Wedge Scattergram</p>
+</div>
+<p>Figure 1 shows a typical <em>wedge scattergram</em> plotting sample points of offset versus delay collected over a 24-hr period. As the delay increases, the offset variation increases, so the best samples are those at the lowest delay. There are two limb lines at slope &plusmn;0.5, representing the limits of sample variation. However, it is apparent that, if a way could be found to find the sample of lowest delay, it would have the least offset variation and would be the best candidate to synchronize the system clock.</p>
+<p>The clock filter algorithm works best when the delays are statistically identical in the reciprocal directions between the server and client. This is apparent in Figure 1, where the scattergram is symmetric about the x axis through the apex sample. In configurations where the delays are not reciprocal, or where the transmission delays on the two directions are traffic dependent, this may not be the case. A common case with DSL links is when downloading or uploading a large file. During the download or upload process, the delays may be significantly different resulting in large errrors. However, these errors can be largely eliminated using samples near the limb lines, as described on the <a href="huffpuff.html">Huff-n'-Puff Filter</a> page.</p>
+<p>In the clock filter algorithm the offset and delay samples from the on-wire protocol are inserted as the youngest stage of an eight-stage shift register, thus discarding the oldest stage. Each time an NTP packet is received from a source, a dispersion sample is initialized as the sum of the precisions of the server and client. Precision is defined by the latency to read the system clock and varies from 1000 ns to 100 ns in modern machines. The dispersion sample is inserted in the shift register along with the associated offset and delay samples. Subsequently, the dispersion sample in each stage is increased at a fixed rate of 15 &mu;s/s, representing the worst case error due to skew between the server and client clock frequencies.</p>
+<p>In each peer process the clock filter algorithm selects the stage with the smallest delay, which generally represents the most accurate data, and it and the associated offset sample become the peer variables of the same name. The peer jitter statistic is computed as the root mean square (RMS) differences between the offset samples and the offset of the selected stage.</p>
+<p> The peer dispersion statistic is determined as a weighted sum of the dispersion samples in the shift register. Initially, the dispersion of all shift register stages is set to a large number &quot;infinity&quot; equal to 16 s. The weight factor for each stage, starting from the youngest numbered <em>i</em> = 1, is 2<sup>-<em>i</em></sup>, which means the peer dispersion is approximately 16 s.</p>
+<p> As samples enter the register, the peer dispersion drops from 16 s to 8 s, 4 s, 2 s, and so forth. In practice, the synchronization distance, which is equal to one-half the delay plus the dispersion, falls below the select threshold of 1.5 s in about four updates. This gives some time for meaningful comparison between sources, if more than one are available. The dispersion continues to grow at the same rate as the sample dispersion. For additional information on statistacl principles and performance metrics, see the <a href="stats.html">Performance Metrics</a> page.</p>
+<p> As explained elsewhere, when a source becomes unreachable, the poll process inserts a dummy infinity sample in the shift register for each poll sent. After eight polls, the register returns to its original state.</p>
+<div align="center"><img src="pic/flt1.gif" alt="gif"> &nbsp; <img src="pic/flt2.gif" alt="gif">
+ <p>Figure 2. Raw (left) and Filtered (right) Offsets</p>
+</div>
+<p>Figure 2 shows the performance of the algorithm for a typical Internet path over a 24-hr period. The graph on the left shows the raw offsets produced by the on-wired protocol, while the figure on the right shows the filtered offsets produced by the clock filter algorithm. If we consider the series formed as the absolute value of the offset samples, the mean error is defined as the mean of this series. Thus, the mean error of the raw samples is 0.724 ms, while the mean error of the filtered series is 0.192 ms. Radio engineers would interpret this as a processing gain of 11.5 dB.</p>
+<p>The reader might notice the somewhat boxy characteristic of the filtered offsets. Once a sample is selected, it remains selected until a newer sample with lower delay is available. This commonly occurs when an older selected sample is discarded from the shift register. The reason for this is to preserve causality; that is, time always moves forward, never backward. The result can be the loss of up to seven samples in the shift register, or more to the point, the output sample rate can never be less than one in eight input samples. The clock discipline algorithm is specifically designed to operate at this rate.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/hints.html b/html/hints.html
new file mode 100644
index 0000000..7749ba9
--- /dev/null
+++ b/html/hints.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=windows-1252">
+<title>Hints and Kinks</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Hints and Kinks</h3>
+<img src="pic/alice35.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>Mother in law has all the answers.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:06<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<hr>
+<p>This is an index for a set of troubleshooting notes contained in individual text files in the <tt>./hints</tt> directory. They were supplied by various volunteers in the form of mail messages, patches or just plain word of mouth. Each note applies to a specific computer and operating system and gives information found useful in setting up the NTP distribution or site configuration. The notes are very informal and subject to errors; no attempt has been made to verify the accuracy of the information contained in them.</p>
+<p>Additions or corrections to this list or the information contained in the notes is solicited. The most useful submissions include the name of the computer manufacturer (and model numbers where appropriate), operating system (specific version(s) where appropriate), problem description, problem solution and submitter's name and electric address. If the submitter is willing to continue debate on the problem, please so advise. See the <a href="hints/">directory listing</a>.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/hints/a-ux b/html/hints/a-ux
new file mode 100644
index 0000000..f8c26d2
--- /dev/null
+++ b/html/hints/a-ux
@@ -0,0 +1,195 @@
+-------------
+INTRODUCTION:
+-------------
+Last revision: 06-Jul-1994
+
+Included in this distribution of XNTP V3 is a configuration file suitable
+for use under Apple's A/UX Version 3.x.x There is also one for A/UX 2.0.1
+but it has not been fully tested. To make the executables follow the steps
+outlined below.
+
+*** NOTE: You must have gcc installed to successfully compile the current
+distribution; the native cc supplied with A/UX will NOT correctly compile
+this source. See the FAQ in comp.unix.aux for places to obtain gcc from
+and how to install it.
+
+----------------------
+MAKING XNTPD FOR A/UX:
+----------------------
+
+First, you need to create the makefiles (after you've downloaded the
+source, of course):
+
+ % make clean
+ % make refconf
+
+After that, you should edit Config.local to make sure that BINDIR is
+correct for where you wish the programs to be "installed". The default
+(and what I use) is /usr/local/etc. Make sure that DEFS_LOCAL and
+CLOCKDEFS are commented out! Presently, only the LOCAL_CLOCK/REFCLOCK
+clock is used and supported.
+
+
+After this is done (you should be told that your system is A/UX 3), make
+'xntpd' (the options to 'gcc' are held in compilers/aux3.gcc):
+
+ % make
+
+I do not normally use the `make install' option and so have not verified its
+compatibility with A/UX. Rather, I pull out each of the executables and
+place them in the locally appropriate locations.
+
+---------------
+STARTING XNTPD:
+---------------
+
+At this point you need to set things up so that 'xntpd' is started upon
+boot-up. You can do this in 1 of 2 ways: either add entries in /etc/inittab
+or, more ideally, create and use an /etc/rc.local file. Since rc.local is
+what I recommend, here's how you do it:
+
+By default, A/UX doesn't have rc.local, so you'll need to add the following to
+/etc/inittab:
+
+ net6:2:wait:/etc/syslogd # set to "wait" to run a syslog daemon
++ jmj0:2:wait:/etc/rc.local 1>/dev/syscon 2>&1 # Local stuff
+ dbg2::wait:/etc/telinit v # turn off init's verbose mode
+
+Now, the look of a sample /etc/rc.local is as follows:
+
+ #!/bin/sh
+ :
+ : rc.local
+ :
+ # @(#)Copyright Apple Computer 1987 Version 1.17 of rc.sh on 91/11/08 15:56:21 (ATT 1.12)
+
+
+ # Push line discipline/set the device so it will print
+ /etc/line_sane 1
+ echo " "
+ echo "Entering rc.local..."
+
+ set `/bin/who -r`
+ if [ "$7" = 2 ]
+ then
+ /bin/echo " now setting the time..."
+ /usr/local/etc/ntpdate -s -b <host.domain>
+ sleep 5
+ #
+ # start up 'xntpd' if we want
+ #
+ if [ -f /etc/ntp.conf ]
+ then
+ /bin/echo " setting tick and tickadj..."
+ /usr/local/etc/tickadj -t 16672 -a 54
+ sleep 5
+ /bin/echo " starting xntpd..."
+ /usr/local/etc/xntpd <&- > /dev/null 2>&1
+ sleep 5
+ fi
+ #
+ fi
+
+ echo "Leaving rc.local..."
+
+There are a few things to notice about the above:
+
+ o When run, 'ntpdate' forces your clock to the time returned by the
+ host(s) specified by <host.domain> (you'll need to replace this
+ be the IP address(es) of your timehosts. This is good since it gets
+ things close to start off with. You can use more than one time
+ server.
+
+ o 'tickadj' is also called. This does two things: changes the
+ default value of 'tick' (which the the amount of time, in ms, that
+ is added to the clock every 1/60 seconds) and changes the value
+ of 'tickadj' which the the amount that is added or subtracted
+ from 'tickadj' when adjtime() is called.
+
+ Now Mac clocks are pretty bad and tend to be slow. Sooo, instead of
+ having A/UX add the default of 16666ms every 1/60th of a second, you
+ may want it to add more (or less) so that it keeps better time. The
+ above value works for me but your "best" value may be different and
+ will likely require some fooling around to find the best value. As a
+ general rule of thumb, if you see 'xntpd' make a lot of negative clock
+ adjustments, then your clock is fast and you'll need to _decrease_
+ the value of 'tick'. If your adjustments are positive, then you need
+ to increase 'tick'. To make a guess on how fast/slow your clock is,
+ use 'ntpdate' to sync your clock. Now watch 'xntpd' and see how it
+ operates. If, for example, it resets your clock by 1 second every 30
+ minutes, then your clock is (1/(30*60)) is about 0.056% off and you'll
+ need to adjust 'tick' by 16666*0.00056 or about 9 (i.e. 'tick' should
+ be ~16675 if slow or ~16657 if fast)
+
+ A/UX's default value of 'tickadj' is 1666 which is too big for
+ 'xntpd'... so it also needs to be adjusted. I like using larger
+ values then the recommended value of 9 for 'tickadj' (although not
+ anything near as big as 1666) since this allows for quick slews
+ when adjusting the clock. Even with semi-large values of 'tickadj'
+ (~200), getting 5ms (1/200 s) accuracy is easy.
+
+
+Finally, before A/UX and 'xntpd' will work happily together, you need to
+patch the kernel. This is due to the fact that A/UX attempts to keep the
+UNIX-software clock and the Mac-hardware clock in sync. Neither the h/w or
+the s/w clock are too accurate. Also, 'xntpd' will be attempting to adjust
+the software clock as well, so having A/UX muck around with it is asking
+for headaches. What you therefore need to do is tell the kernel _not_ to
+sync the s/w clock with the h/w one. This is done using 'adb'. The
+following is a shell script that will do the patch for you:
+
+ #! /bin/sh
+ adb -w /unix <<!
+ init_time_fix_timeout?4i
+ init_time_fix_timeout?w 0x4e75
+ init_time_fix_timeout?4i
+ $q
+ !
+
+This must be done _every_ time you create a new kernel (via newconfig or
+newunix) or else 'xntpd' will go crazy.
+
+--------
+HISTORY:
+--------
+
+John Dundas was the original porter of 'xntpd' and a lot of the additions
+and A/UX-ports are from him. I got involved when I wanted to run 'xntpd'
+on jagubox. It was also around this time that the base-patchlevel of
+'xntpd' changed relatively (the so-called "jones" version). Since then,
+I've been maintaining 'xntpd' for A/UX for the xntp development team
+
+The original kernel patch (which patched 'time_fix_timeout') was from
+Richard Todd. I suggest patching 'init_time_fix_timeout' which prevents
+'time_fix_timeout' from even being called.
+
+----------------
+TECHNICAL NOTES:
+----------------
+
+ o As configured (see machines/aux3), 'xntpd' will log messages via syslogd
+ using the LOC_LOCAL1 facility. I would suggest the following in
+ /etc/syslog.conf:
+
+ local1.notice /usr/adm/ntpd-syslog
+
+ o As mentioned above, the clocks on A/UX and Macs are kinda bad. Not
+ only that, but logging in and out of the MacOS mode as well as
+ extensive floppy use causes A/UX to drop and lose clock interupts
+ (these are sent every 1/60th of a second). So, if you do these
+ activities a lot, you find out that you lose about 300ms of time
+ (i.e., you become 300ms slow). 'xntpd' default way of handling this
+ is to called 'settimeofday()' and step the clock to the correct
+ time. I prefer having 'xntpd' slew the clock back into line by
+ making gradual adjustments to the clock over a coupla minutes
+ or so. It's for this reason that SLEWALWAYS is defined in
+ include/ntp_machine.h for SYS_AUX3. It's also for this reason than
+ I like larger values of 'tickadj'.
+
+Good luck! If you have problems under A/UX feel free to contact me (e-mail
+is preferred).
+--
+ Jim Jagielski | "That is no ordinary rabbit... 'tis the
+ jim@jagubox.gsfc.nasa.gov | most foul, cruel and bad-tempered
+ NASA/GSFC, Code 734.4 | rodent you ever set eyes on"
+ Greenbelt, MD 20771 | Tim the Enchanter
diff --git a/html/hints/aix b/html/hints/aix
new file mode 100644
index 0000000..e53beff
--- /dev/null
+++ b/html/hints/aix
@@ -0,0 +1,76 @@
+Problem with recent ANSI compilers
+
+On some systems, including AIX, the compiler quits on the ntp_refclock.c
+file when processing the refclock_report() routine. The problem, which
+is eithre a feature or a bug, has to do with an unwanted promotion of
+the u_char argument to an int and a failure of the compiler to recognize
+the preceding prototype. A workaround is to use ANSI syntax to delare
+the arguments. Since ANSI compilers are not universally available, this
+syntax can't be used in the stock distribution.
+
+(Message # 60: 2884 bytes, New)
+Date: Sat, 19 Aug 1995 13:20:50 -0400
+From: "R. Bernstein" <rocky@panix.com>
+Newsgroups: comp.protocols.time.ntp
+to: mills@udel.edu
+return-receipt-to: rocky@panix.com
+Subject: time and AIX 3.2.5 raw tty bug
+
+This posting isn't strictly about NTP, any program that may stop the
+clock or set the clock backwards is subject to the AIX 3.2.5 bug.
+
+On AIX 3.2.5, there is a bug in the tty driver for a raw device which
+may crash the box under certain conditions: basically a read() on a
+raw tty in effect, a character was read but not as many as specified
+by VMIN when a read timeout occurred. VTIME specifies the timeout. See
+the AIX manual page on termios.h or that include file. for Information
+on VMIN (or MIN) VTIME (or TIME).
+
+A remedy other than to not use raw tty's is to apply patch U435110.
+
+Details of the problem report follow.
+
+> ABSTRACT:
+> IX43779: TRAP IN PSX_TIMEO
+>
+> ORIGINATING DETAILS:
+> Stacktrace shows:
+> IAR: 01460214 posixdd:psx_timeo + 8bf4: ti 4,r12,0x0
+> *LR: 014601a0 posixdd:psx_timeo + 8b80
+> 00212c60: 014604f4 posixdd:psx_timer + 8ed4
+> 00212cc0: 0144b74c ttydd:tty_do_offlevel + 4284
+> 00212d20: 000216fc .i_offlevel + 8c
+> 00212d70: 00021d78 .i_softint + c8
+> 00001004: 00008714 .finish_interrupt + 80
+>
+> RESPONDER SUMMARY:
+> AIX asserted in psx_timeo(). Reason for the assert was that
+> the current time was behind psx_ctime. Since this state
+> can occur when the current time is changed after a character
+> is received but before the VTIME interbyte timer pops, we
+> should not assert on this.
+>
+> RESPONDER CONCLUSION:
+> Removed the requirement that current time > psx_ctime by
+> adding a new L_ntimersub macro that is used instead of the
+> ntimersub macro in time.h. Also added a test for (current
+> time - psx_ctime) being negative, in that case we do not
+> adjust the new timeout.
+>
+> Reported to Correct a PTF in Error: NO
+> Reported as a Highly pervasive problem: NO
+>
+> PE Apar?: NoPE
+> Hiper Apar?: NoHiper
+> Status: CLOSED PER
+> Component Name: AIX V3 FOR RS/6
+> Version: 320
+> Component ID: 575603001
+> Submitted: 94/05/03
+> Closed: 94/05/05
+> ChangeTeam: TX2527
+>
+> APAR FIXED BY: U431696 U432151 U432844 U432870 U432979
+> U433049 U433081 U433459 U433876 U433906 U434598 U434453
+> U434672 U434737 U435110
+
diff --git a/html/hints/bsdi b/html/hints/bsdi
new file mode 100644
index 0000000..3b8bc38
--- /dev/null
+++ b/html/hints/bsdi
@@ -0,0 +1,65 @@
+hints/bsdi
+
+Author: Bdale Garbee, bdale@gag.com
+Last revision: 27Oct94 (Paul Vixie)
+
+Included in this distribution of XNTP is a configuration file suitable
+for use with BSDI's BSD/OS 1.1 (formerly BSD/386 1.1). On this system,
+the "cc" command is GCC 1.4x rather than PCC or GCC 2.x. It is imperative
+that "cc" be used since it predefines the symbol __bsdi__; if you want to
+use another compiler you will need to add -D__bsdi__ to catch the various
+#ifdef's required for this system.
+
+The Kinemetrics/Truetime GPS-TM/TMD driver is known to work on this system.
+The GPS-805 and GOES should also work fine. Hell, they should all work fine
+but it's hard to test very many locally.
+
+Due to BNR2's strict interpretation of POSIX and XNTP's use of SIGIO, BSD/OS
+can only handle one refclock per daemon. We're working this out with the
+system architects.
+
+The config file is machine/bsdi, and the following steps should be all that
+are required to install and use the bits.
+
+Note that you will need GNU sed; the version supplied with BSD/OS 1.1 loops
+endlessly during "make refconf". Likewise you should get GNU make, which
+the instructions below assume that you have put in /usr/local/bin/gnumake.
+
+To build the software:
+
+ rm -f Config.local
+ gnumake refconf
+ gnumake MAKE=gnumake
+
+To install the software:
+
+ gnumake install
+
+ This will place all of the executables in /usr/local/etc. The config
+ file is expected to be /usr/local/etc/xntp.conf and the key file for
+ the optional authentication is /etc/ntp.keys.
+
+ Craft a config file and a key file, and put them in the right places.
+ There is information on how to do this elsewhere in the documentation,
+ the only thing I'll mention is that I put the drift file in
+ /var/log/ntp.drift, and the authdelay on my 486DX/50 system is
+ 0.000064. Your mileage will vary, learn to use the authspeed tools
+ if you're going to authenticate.
+
+ In the file /etc/rc.local, make sure that the invocation of ntpd is
+ commented out, and add an invocation of xntpd. Here's what I'm using:
+
+ echo -n 'starting local daemons:'
+
+ if [ -f /etc/ntp.keys -a -f /usr/local/etc/xntp.conf ]; then
+ echo -n ' xntpd'; /usr/local/etc/xntpd
+ fi
+
+ #XXX# echo -n ' ntpd'; /usr/libexec/ntpd -t
+
+At this point, you should be good to go. Try running /usr/local/etc/xntpd and
+using ntpq or xntpdc to see if things are working, then pay attention the next
+time you reboot to make sure that xntpd is being invoked, and use ntpq or
+xntpdc again to make sure all is well.
+
+Enjoy!
diff --git a/html/hints/changes b/html/hints/changes
new file mode 100644
index 0000000..177e562
--- /dev/null
+++ b/html/hints/changes
@@ -0,0 +1,13 @@
+Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (xntpd/refclock_parse.c):
+ - Added support to supply power from RS232 with CLOCK_RAWDCF.
+ Known to work with Linux 1.2.
+ - Made Linux ignore parity errors with CLOCK_RAWDCF.
+
+Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (parse/util/dcfd.c):
+ - Removed conflicting prototype for Linux (sscanf)
+ - Corrected spelling error
+ - Made Linux ignore parity errors.
+ - Added support to supply power from RS232 with CLOCK_RAWDCF.
+
+Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (parse/util/testdcf.c):
+ - Made Linux ignore parity errors.
diff --git a/html/hints/decosf1 b/html/hints/decosf1
new file mode 100644
index 0000000..bc4ce0b
--- /dev/null
+++ b/html/hints/decosf1
@@ -0,0 +1,40 @@
+Some major changes were necessary to make xntp v3 run on the DEC Alpha
+hardware running DEC OSF/1. All "long" and "u_long" declarations and
+casts in the code were changed to "LONG" and "U_LONG" and a new header
+file (include/ntp_types.h) was added. The new header file defines
+LONG as int and U_LONG as u_int for the Alpha hardware and as long
+and u_long for anything else. A couple of #ifs where changed in
+ntpq and xntpdc to get the result of a signal defined correctly. The
+Config.decosf1 file built the programs here with no problems.
+
+I don't have a radio clock here, so none of that code has been tested.
+I have run xntpd, xntpdc, xntpres, ntpq, ntpdate, and tickadj under
+DEC OSF/1 v1.2-2 (BL10).
+
+Mike Iglesias Internet: iglesias@draco.acs.uci.edu
+University of California, Irvine BITNET: iglesias@uci
+Office of Academic Computing uucp: ...!ucbvax!ucivax!iglesias
+Distributed Computing Support phone: (714) 856-6926
+
+Support for NTP Version 2 is included with the current OSF/1 release. If
+you are upgrading to NTP Version 3 with this distribution, you should not
+use the xntpd or ntpq programs that come with the OSF/1 release. The
+older programs should be replaced by the newer programs of the same name,
+either in situ or via a link to a tranquil spot like /usr/local/bin. The
+make install script in the this distribution don't work due to a silly
+install program incompatibility, so you will need to copy the programs by
+hand.
+
+Don't use the setup utility to install or configure the xntpd installation,
+as it will cheerfully clobber your painstakingly crafted ntp.conf program.
+However, assuming you put this file in /etc/ntp.conf, you can use the
+/sbin/init.d/xntpd script to start and stop the daemon.
+
+This distribution compiles with nominal mumur with the stock cc compiler
+that comes with OSF/1.
+
+Dave Mills
+Electrical Engineering Department
+Unibergisty of Delabunch
+mills@udel.edu
+
diff --git a/html/hints/decosf2 b/html/hints/decosf2
new file mode 100644
index 0000000..e4a8828
--- /dev/null
+++ b/html/hints/decosf2
@@ -0,0 +1,54 @@
+Problems with DEC OSF/1 V2.0
+
+Compilation using gcc fails with ntp_config.c. The problem is an apparent
+error in the /usr/include/sys/procset.h and /usr/include/sys/wait.h
+include files.
+
+cowbird:/usr/include/sys# diff -c wait.h.orig wait.h
+*** wait.h.orig Tue Feb 22 02:41:38 1994
+--- wait.h Thu Aug 25 14:52:57 1994
+***************
+*** 298,304 ****
+ #else
+
+ _BEGIN_CPLUSPLUS
+! extern int waitid(idtype_t, id_t, siginfo_t *, int);
+ _END_CPLUSPLUS
+ #endif /* _NO_PROTO */
+
+--- 298,304 ----
+ #else
+
+ _BEGIN_CPLUSPLUS
+! extern int waitid(idtype_t, pid_t, siginfo_t *, int);
+ _END_CPLUSPLUS
+ #endif /* _NO_PROTO */
+
+cowbird:/usr/include/sys# diff -c procset.h.orig procset.h
+*** procset.h.orig Tue Feb 22 02:41:44 1994
+--- procset.h Thu Aug 25 14:43:52 1994
+***************
+*** 86,95 ****
+ */
+
+ idtype_t p_lidtype; /* The id type for the left set. */
+! id_t p_lid; /* The id for the left set. */
+
+ idtype_t p_ridtype; /* The id type of for right set. */
+! id_t p_rid; /* The id of the right set. */
+ } procset_t;
+
+
+--- 86,95 ----
+ */
+
+ idtype_t p_lidtype; /* The id type for the left set. */
+! pid_t p_lid; /* The id for the left set. */
+
+ idtype_t p_ridtype; /* The id type of for right set. */
+! pid_t p_rid; /* The id of the right set. */
+ } procset_t;
+
+Also, if using gcc from the freeware disk, either replace syscall.h
+in the directory /usr/local/lib/gcc-lib/alpha-dec-osf1/2.3.3/include
+or replace with a link to /usr/include/sys/syscall.h.
diff --git a/html/hints/freebsd b/html/hints/freebsd
new file mode 100644
index 0000000..ef84732
--- /dev/null
+++ b/html/hints/freebsd
@@ -0,0 +1,15 @@
+If you are compiling under FreeBSD and see messages in the syslogs that
+indicate that the ntpd process is trying to use unavailable sched_
+calls, it means you are running a kernel that does not have the POSIX
+scheduling calls enabled.
+
+You have two choices:
+
+- Ignore the messages
+
+- Generate a new kernel, where the kernel configuration file contains
+ the lines:
+
+ options "P1003_1B"
+ options "_KPOSIX_PRIORITY_SCHEDULING"
+ options "_KPOSIX_VERSION=199309L"
diff --git a/html/hints/hpux b/html/hints/hpux
new file mode 100644
index 0000000..1640d05
--- /dev/null
+++ b/html/hints/hpux
@@ -0,0 +1,158 @@
+Last update: Sun Mar 13 15:05:31 PST 1994
+
+This file hopefully describes the whatever and however of how to get xntp
+running on hpux 7.0 and later s300. s400, s700, and s800.
+
+First off, all the standard disclaimers hold here ... HP doesn't have anthing
+to do with this stuff. I fool with it in my spare time because we use it and
+because I like to. We just happen to have a lot of HP machines around here :-)
+Xntpd has been in use here for several years and has a fair amount of mileage
+on various HP platforms within the company. I can't really guarantee bug fixes
+but I'd certainly like to hear about bugs and I won't hestitate to look at
+any fixes sent to me.
+
+Now lets talk OS. If you don't have 7.0 or later, pretty much hang it up now.
+This stuff has run here on pretty much everything from 8.0 upward on s300,
+s700, and s800. It is known to run on 7.0 s300/s400 but all reports are
+from the field and not my personal experience.
+
+If you are lucky enough to have a s300 or s400 with 9.03, then you no longer
+have to worry about adjtimed as HP-UX now has adjtime(2). The rest of you
+will have to wait on 10.0 which will have adjtime(2) and a supported though
+a bit older version of xntpd.
+
+Next, let me explain a bit about how this stuff works on HP-UX's that do not
+have adjtime(2). The directory adjtime contains libadjtime.a and the adjtimed
+daemon. Instead of the adjtime(2) system call, we use a library routine to
+talk to adjtimed thru message queues. Adjtimed munges into /dev/kmem and
+causes the clock to skew properly as needed. PLEASE NOTE that the adjtime
+code provided here is NOT a general replacement for adjtime(2) ... use of
+this adjtime(3)/adjtimed(8) other than with xntpd may yield very odd results.
+
+What to do to get this stuff running ?
+
+ * If you are running an OS less than 10.0 or do not have a s300/s400
+ with 9.03 or better
+ -> cd machines
+ -> vi hpux
+ -> (change -DSYS_HPUX=? to match whatever you are running [7,8,9])
+ -> cd ..
+
+ * Say "make makeconfig"
+
+ * Say "make", sit back for a few minutes.
+
+ * cd authstuff
+ * Say "./authcert < certdata" and check the output. Every line should
+ end with "OK" ... if not, we got trouble.
+ * Now try "./authspeed auth.samplekeys". What we want to
+ remember here is the "authentication delay in CPU time"
+ * cd ..
+
+ * Say "make install"
+
+ * I'd suggest reading the xntp docs about now :-) ... seriously !!
+
+ * One thing I have added to this version of xntpd is a way to select
+ config files if you are sharing /usr/local thru NFS or whatever.
+ If the file /usr/local/etc/xntp.conf happens to be a directory, the
+ files in that directory are searched until a match is found. The
+ rules for a match are:
+
+ 1. Our hostname
+ 2. default.<machine id> (as in default.375 or default.850)
+ 3. default
+
+ * Ok, make sure adjtimed is running (just start it up for now with
+ "/usr/local/etc/adjtimed"). Using -z as an option will get you
+ a usage message.
+
+ * Now start up xntpd and watch it work.
+
+ * Make sure that adjtimed gets started at boot right before xntpd.
+ We do this in /etc/netbsdsrc. They must both run as root !!
+
+Possible problems ?
+
+ * On some 320's and 835's we have had to run adjtimed with "-p 45" or
+ so to get rid of syslog messages about "last adjust did not finish".
+
+ * At 9.0, there is a problem with DIAGMON (patch available from the
+ response center) which causes it to delete the message queue that
+ adjtimed/xntpd use to communicate. (see next note for result)
+
+ * Xntpd has been known to get really ticked off when adjtime() fails
+ which is usually only while running the emulation code on HP-UX.
+ When it gets mad, it usually jumps the clock into never never land.
+ Possible reasons for this are adjtimed being killed or just never
+ started or adjtimed being completely swapped out on a really busy
+ machine (newer adjtimed try to lock themselves in memory to prevent
+ this one).
+
+Anything else ... just drop me a line at ken@sdd.hp.com
+
+Received: from louie.udel.edu by huey.udel.edu id aa14418; 15 Jun 95 9:19 EDT
+Received: from host5.colby.edu (host-05.colby.edu) by host-04.colby.edu with ESMTP (1.37.109.15/Colby 1.1)
+ id AA165442355; Thu, 15 Jun 1995 09:19:16 -0400
+Received: by host5.colby.edu (1.37.109.15/Colby 1.1)
+ id AA056252339; Thu, 15 Jun 1995 09:18:59 -0400
+Date: Thu, 15 Jun 1995 09:18:59 -0400 (EDT)
+From: "Jeff A. Earickson" <jaearick@colby.edu>
+To: Mills@huey.udel.edu
+Subject: More minor bugs in xntp3.4s
+In-Reply-To: <9506150022.aa12727@huey.udel.edu>
+Message-Id: <Pine.HPP.3.91.950615083549.4557A-100000@host5.colby.edu>
+Mime-Version: 1.0
+Content-Type: TEXT/PLAIN; charset=US-ASCII
+
+Dave,
+ After reading the hpux hints file, I realized I didn't install or
+start adjtimed. In the course of doing this, I discovered that:
+
+--> $(TOP) is not defined in adjtime/Makefile, so "make install" can't
+ find the install.sh script.
+
+--> "make install" from the main Makefile never goes into the adjtime
+ directory, so I added the following two lines into the install
+ target of the main Makefile:
+
+ @echo installing from adjtime
+ @cd adjtime && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" MAKE="$(MAKE)" install
+
+This twiddle may not be right for all systems, but it got adjtimed
+installed for me.
+
+ You might also want to add to the hpux hints file that one way to
+fire things up at boot time is to add the following lines to the localrc
+function of /etc/rc:
+
+ #---daemons for Network Time Protocol (version 3.4s)
+ #---note that adjtimed is only needed for HP-UX 9.X, not 10.0
+ #---adjtimed must be running or xntpd won't work right...
+ if [ -x /usr/local/bin/adjtimed ]; then
+ /usr/local/bin/adjtimed -r & echo -n ' adjtimed'
+ if [ -x /usr/local/bin/xntpd ]; then
+ /usr/local/bin/xntpd & echo -n ' xntpd'
+ fi
+ fi
+
+I discovered that the "-r" option of adjtimed is needed to clear out any
+trash from a previous execution of it. Otherwise adjtimed quietly dies
+and leaves xntpd in the lurch...
+
+Thanks for the help.
+
+** Jeff A. Earickson, Ph.D PHONE: 207-872-3659
+** Senior UNIX Sysadmin, Information Technology EMAIL: jaearick@colby.edu
+** Colby College, 4214 Mayflower Hill, FAX: 207-872-3555
+** Waterville ME, 04901-8842
+
+On Thu, 15 Jun 1995 Mills@huey.udel.edu wrote:
+
+> Jeff,
+>
+> Read the hpux file in the hints directory.
+>
+> Dave
+>
+
diff --git a/html/hints/linux b/html/hints/linux
new file mode 100644
index 0000000..b06a36a
--- /dev/null
+++ b/html/hints/linux
@@ -0,0 +1,5 @@
+The kernel PLL interface is broken, I know.
+Update RSN.
+
+ Torsten
+ (duwe@informatik.uni-erlangen.de)
diff --git a/html/hints/mpeix b/html/hints/mpeix
new file mode 100644
index 0000000..83c7241
--- /dev/null
+++ b/html/hints/mpeix
@@ -0,0 +1,50 @@
+HP e3000 MPE/iX NTP Hints - May 29, 2001
+----------------------------------------
+
+NTP was first ported to MPE several years ago, but those diffs were never
+submitted back to the official NTP distribution. For more information about
+that deprecated port, please see http://www.bixby.org/mark/xntpix.html.
+
+NTP was re-ported to MPE in May 2001. What follows are hints learned from
+working with NTP 4.0.99k23. For additional information about NTP on MPE,
+please see http://jazz.external.hp.com/src/hp_freeware/ntp/.
+
+MPE lacks the clock-related APIs expected by NTP, so adjtime(), gettimeofday(),
+and settimeofday() all had to be implemented from scratch by calling
+privileged, undocumented internal OS functions.
+
+Unfortunately the implementation of adjtime() has exposed a sub-second accuracy
+bug when slewing the system time. This bug is documented in SR 5003462838, and
+exists on all current versions of MPE. It has not been fixed at the time of
+this writing. The adjtime() code may possibly need to be altered if/when this
+bug is fixed.
+
+This bug has a side-effect whereby the ntpd daemon will screw up the hardware
+PDC clock time by many minutes if used for continuous clock adjustments or in
+the one-time -q mode. But note that you can safely run ntpd in order to become
+a time server if you include "disable ntp" in the ntp.conf configuration file.
+
+The one-time clock adjustment functionality of ntpdate and ntp_timeset is not
+affected by this bug side-effect. You can safely use these commands to alter
+your system time with reasonable accuracy.
+
+The only reference clock that has been tested on MPE is the local clock. So
+building NTP with --disable-all-clocks --enable-LOCAL_CLOCK is strongly
+recommended.
+
+NTP makes use of Privileged Mode (PM) capability in order to bind to the NTP
+network port (123) and to access the low-level clock functions.
+
+NTP was ported using the gcc compiler. Attempting to use the HP C/iX compiler
+is not recommended and has not been tested.
+
+Please note that NTP is not an HP product and is NOT supported by HP. The best
+place for asking MPE-specific questions about NTP is the HP3000-L mailing list
+at http://raven.utc.edu/Archives/hp3000-l.html or the associated Usenet
+newsgroup of comp.sys.hp.mpe.
+
+The original author of this port is:
+
+Mark Bixby
+HP CSY MPE Internet & Interoperability Engineer
+mark_bixby@hp.com
diff --git a/html/hints/notes-xntp-v3 b/html/hints/notes-xntp-v3
new file mode 100644
index 0000000..ba027f2
--- /dev/null
+++ b/html/hints/notes-xntp-v3
@@ -0,0 +1,119 @@
+Notes for NTP Version 3
+
+This version operates in much the same manner as Version 2 with the
+following changes and additions:
+
+1. The protocol machinery operates in conformance with the RFC1305 NTP
+ Version 3 specification. The most visible characteristic of this
+ version is that the poll intervals for all polls, even selected
+ ones, is significantly increased. This is especially desirable when
+ serving a large client population. This implementation supports
+ previous versions as non-configured peers; for version-2 configured
+ peers a "version 2" keyword should be included on the "peer" line.
+
+2. The configuration file has a new keyword: statfile <file>, where
+ <file> is the name of a statistics file." When present, each clock
+ update generates an entry of the form:
+
+ <day> <sec>.<frac> <addr> <status> <offset> <delay> <disp>
+
+ where <day> is the modified Julian day, <sec>.<frac> is the time of
+ day, <addr> is the peer address and <status> is the peer status.
+ The <offset>, <delay> and <disp> are the measured offset, delay and
+ dispersion, respectively, of the peer clock relative to the local
+ clock. About once per day the current file is closed and a new one
+ created with names <file>.<gen>, where <gen> starts at one and
+ increments for each new generation.
+
+3. A number of additional platforms are supported. See ./Config file
+ for details.
+
+4. A driver for the TrueTime 468DC GOES Synchronized Clock is
+ included. This driver (refclock_goes.c) should also work for other
+ TrueTime radio clocks, since all use the same format.
+
+5. A replacement driver for the Spectracom 8170 WWVB Synchronized
+ Clock is included. This driver (refclock_wwvb.c) (a) does not
+ require a 1-pulse-per-second signal, (b) supports both format 0
+ (original 8170) and format 2 (Netclock/2 and upgraded 8170), (c)
+ can be connected to more than one computer and (d) automatically
+ compensates for all serial baud rates.
+
+6. A driver for the German time/frequency station DCF77 is included.
+ This requires a special STREAMS module.
+
+7. In Version 2 special line-discipline modules were required for the
+ CHU and WWVB drivers. This code continues to work in Version 3,
+ although it is no longer needed for the WWVB driver. However, this
+ code does not work under STREAMS, as used in SunOS 4.1.1.
+ Equivalent STREAMS modules are supplied with Version 3.
+
+8. Support for an external 1-pulse-per-second (pps) signal is
+ provided. The signal is connected to a serial port (see
+ xntpd/ntp_loopfilter.c for details). When present the leading edge
+ of the pulse establishes the on-time epoch within an interval
+ established by the selected radio clock or other NTP time server.
+ Use of the pps is indicated when the tattletale displayed by ntpq
+ changes from "*" to "o".
+
+9. The clock-selection and poll-update procedures have been modified
+ slightly in order to achieve better performance on high speed LANs
+ with compromise in performance on typical WANs.
+
+10. In order to comply with U.S. Commerce Department regulations, the DES
+ encryption routine lib/authdes.c cannot be exported. For exportable
+ versions of this distribution a DES-encrypted version of this routine
+ lib/authdes.c.des is included along with an unencrypted version
+ lib/authdes.c.export, which allows normal operation, but without the
+ NTP authentication feature. Further information is available in the
+ lib/authdes.c.export file.
+
+11. As an alternative to the DES-based authentication mechanism, an
+ implementation of the RSA Message Digest 5 algorithm is provided.
+ (see applicable copyright information in the library files).
+
+12. A driver for the Magnavox MX4200 GPS clock.
+
+13. A STREAMS module which captures carrier-detect data-lead transitions to
+ connect a precision source of 1-pps, yet avoid the ugly overhead in the
+ usual STREAMS processing. See the ppsclock subdirectory.
+
+14. Support for the Apple A/UX operating system and enhanced support for the
+ Hewlet-Packard HP/UX operating system. See the various README and Config
+ files for further information.
+
+See the COPYRIGHT file for authors and copyright information. Note that some
+modules in this distribution contain copyright information that supersedes
+the copyright information in that file.
+
+If I missed something or neglected to give due credit, please advise.
+
+David L. Mills
+University of Delaware
+31 May 1992, amended 23 July 1992, 25 October 1992
+
+Bugs and notes
+
+A bug in the original tty_clk_STREAMS.c module has been fixed.
+
+The poll-interval randomization feature of poll_update (in
+xntpd/ntp_proto.c) has been extended to apply when the poll interval is
+increased, as well as reduced. This spreads the update messages in time
+and helps avoid unpleasant bursts of messages.
+
+In the clock_select algorithm the peers selected for combining are
+limited to those survivors at the lowest stratum, not the entire list.
+This helps avoid whiplash when large numbers of peers are at the same
+stratum.
+
+The number formerly displayed by ntpq as "compliance" is now the time
+constant of integration.
+
+The DNS resolver xntpd/ntp_intres.c is now integrated into xntpd, making
+configuration of multiple hosts easier.
+
+System and peer event are now written to the system log at priority
+LOG_INFO.
+
+The leap-second code was fixed to avoid broadcasting leap warnings on
+all except the last day of June and December.
diff --git a/html/hints/parse b/html/hints/parse
new file mode 100644
index 0000000..d252351
--- /dev/null
+++ b/html/hints/parse
@@ -0,0 +1,105 @@
+Compilation:
+ Usual thing: rm -f Config.local ; make for vanilla
+ make refconf for reference clock (e. g. DCF77)
+
+Directory contents:
+
+ hints/PARSE - this file
+
+ xntpd/refclock_parse.c
+ - reference clock support for DCF77/GPS in xntp
+ parse/parse.c
+ - Reference clock data parser framework
+ parse/parse_conf.c
+ - parser configuration (clock types)
+ parse/clk_meinberg.c
+ - Meinberg clock formats (DCF U/A 31, PZF 535, GPS166)
+ parse/clk_schmid.c
+ - Schmid receiver (DCF77)
+ parse/clk_rawdcf.c
+ - 100/200ms pulses via 50 Baud line (DCF77)
+ parse/clk_dcf7000.c
+ - ELV DCF7000 (DCF77)
+ parse/clk_trimble.c
+ - Trimble SV6 GPS receiver
+
+ If you want to add new clock types please check
+ with kardel@informatik.uni-erlangen.de. These files
+ implement the conversion of RS232 data streams into
+ timing information used by refclock_parse.c which is
+ mostly generic except for NTP configuration constants.
+
+ parse/Makefile.kernel
+ - *SIMPLE* makefile to build a loadable STREAMS
+ module for SunOS 4.x / SunOS 5.x systems
+
+ parse/parsestreams.c
+ - SUN Streams module (loadable) for radio clocks
+ This streams module is designed for SunOS 4.1.X.
+
+ parse/parsesolaris.c
+ - SUN Streams module (loadable) for radio clocks.
+ This streams module is designed for SunOS 5.x
+ Beware this is still new - so it might crash
+ your machine (we have seen it working, though).
+
+ parse/parsetest.c
+ - simple test program for STREAMS module. Its so simple,
+ that it doesn't even set TTY-modes, thus they got to
+ be correct on startup - works for Meinberg receivers
+
+ parse/testdcf.c
+ - test program for raw DCF77 (100/200ms pulses)
+ receivers
+
+ include/parse.h - interface to "parse" module and more
+ include/parse_conf.h
+ - interface to "parse" configuration
+
+ include/sys/parsestreams.h
+ - STREAMS specific definitions
+
+ scripts/support
+ - scripts (perl & sh) for statistics and rc startup
+ the startup scripts are used in Erlangen for
+ starting the daemon on a variety of Suns and HPs
+ and for Reference Clock startup on Suns
+ These scripts may or may not be helpful to you.
+
+Supported clocks:
+ Meinberg DCF U/A 31
+ Meinberg PZF535/TCXO (Software revision PZFUERL 4.6)
+ Meinberg PZF535/OCXO (Software revision PZFUERL 4.6)
+ Meinberg GPS166 (Software version for Uni-Erlangen)
+ ELV DCF7000 (not recommended - casual/emergency use only)
+ Conrad DCF77 receiver (email: time@informatik.uni-erlangen.de)
+ + level converter
+ TimeBrick (email: time@informatik.uni-erlangen.de)
+ Schmid Receiver Kit
+ Trimble SV6 GPS receiver
+
+Addresses:
+ Meinberg Funkuhren
+ Auf der Landwehr 22
+ 31812 Bad Pyrmont
+ Germany
+ Tel.: 05281/20 18
+ FAX: 05281/60 81 80
+
+ ELV Kundenservice
+ Postfach 1000
+ 26787 Leer
+ Germany
+ Tel.: 0491/60 08 88
+
+ Walter Schmidt
+ Eichwisrain 14
+ 8634 Hombrechtikon
+ Switzerland
+
+If you have problems mail to:
+
+ time@informatik.uni-erlangen.de
+
+We'll help (conditions permitting)
+
diff --git a/html/hints/refclocks b/html/hints/refclocks
new file mode 100644
index 0000000..17e7643
--- /dev/null
+++ b/html/hints/refclocks
@@ -0,0 +1,35 @@
+This is a short overview for the reference clocks currently supported
+by xntp V3. (Ultimate wisdom can be obtained from xntpd/refclock_*.c
+this file was derived from that information - unfortunately some comments
+in the files tend to get stale - so use with caution)
+
+Refclock address Type
+127.127.0.x no clock (fails to configure)
+127.127.1.x local clock - use local clock as reference
+127.127.2.x no clock (fails to configure)
+127.127.3.x PSTI 1010/1020 WWV Clock
+127.127.4.x SPECTRACOM WWVB receiver 8170 and Netclock/2
+127.127.5.x Kinimetric Truetime 468-DC GOES receiver
+127.127.6.x IRIG audio decode (Sun & modified BSD audio driver)
+127.127.7.x CHU Timecode (via normal receiver & Bell 103 modem)
+127.127.8.x PARSE (generic driver for a bunch of DCF/GPS clocks
+ can be extended for other clocks too)
+ 8.0-3 Meinberg PZF535/TCXO
+ 8.4-7 Meinberg PZF535/OCXO
+ 8.8-11 Meinberg DCF U/A 31
+ 8.12-15 ELV DCF7000
+ 8.16-19 Walter Schmid DCF receiver (Kit)
+ 8.20-23 Conrad DCF77 receiver module + level converter (Kit)
+ 8.24-27 TimeBrick (limited availability ask
+ time@informatik.uni-erlangen.de)
+ 8.28-31 Meinberg GPS166
+ 8.32-35 Trimble SV6 GPS receiver
+127.127.9.x MX4200 GPS receiver
+127.127.10.x Austron 2201A GPS Timing Receiver
+127.127.11.x Kinemetrics Truetime OM-DC OMEGA Receiver
+127.127.12.x KSI/Odetecs TPRO-S IRIG-B / TPRO-SAT GPS
+127.127.13.x Leitch: CSD 5300 Master Clock System Driver
+127.127.14.x MSFEES
+127/127.15.x TrueTime GPS/TM-TMD
+127.127.16.x Bancomm GPS/IRIG Ticktock
+127.127.17.x Datum Programmable Time System
diff --git a/html/hints/rs6000 b/html/hints/rs6000
new file mode 100644
index 0000000..8561ac2
--- /dev/null
+++ b/html/hints/rs6000
@@ -0,0 +1,56 @@
+15.7.1993
+xntp3 compiles now again on AIX. I have disabled prototyping and added
+the switch -D_NO_PROTO which disables prototyping in the system include
+files.
+
+Matthias Ernst maer@nmr.lpc.ethz.ch
+--------------------------------------------------------------------------------
+Xntp version 3 now support the cc compiler for AIX.
+The Config.aix will now use cc by default. You can still compile xntp
+with the bsd compiler by changing "COMP= cc" to "COMP= bsdcc" and
+and removing the "-DSTUPID_SIGNAL" option from the "DEFS" option.
+
+xntp and tickadj was also modified so that the value of tickadj is read
+form the kernel and can be set by tickadj. For now I would not set
+tickadj below 40 us.
+
+Bill Jones
+jones@chpc.utexas.edu
+-------------------------------------------------------------------------------
+
+This is a modified version of xntp version 3 for the RS6000. It works for
+AIX 3.2 and these are the same changes as have been applied tothe version 2
+implementation of xntp. It works fine for us but I have not tested all of
+the features, especially the local clock support for the RS6000 is not tested
+at all.
+
+Matthias Ernst, ETH-Zuerich, Switzerland - maer@nmr.lpc.ethz.ch
+
+--------------------------------------------------------------------------------
+
+Here the original README.rs6000 for the version 2 implementation:
+
+A hacked version of xntp for the IBM RS/6000 under AIX 3.1 can be found
+in xntp.rs6000.tar.Z. [ if still available at all - Frank Kardel 93/12/3 ]
+
+This will not work on older versions of AIX due to a kernel bug; to find
+out whether you have the kernel bug, compile and run testrs6000.c (see
+comments in the code for instructions).
+
+xntp and testrs6000 require "bsdcc" to compile. This is simply another
+entry point into the xlc compiler with various options set for BSD
+compatibility. If your system does not have bsdcc, do the following:
+
+link /bin/bsdcc to /bin/xlc
+
+put the following into /etc/xlc.cfg:
+
+* BSD compatibility
+bsdcc: use = DEFLT
+ crt = /lib/crt0.o
+ mcrt = /lib/mcrt0.o
+ gcrt = /lib/gcrt0.o
+ libraries = -lbsd, -lc
+ proflibs = -L/lib/profiled,-L/usr/lib/profiled
+ options = -H512,-T512, -qlanglvl=extended, -qnoro, -D_BSD, -D_NONSTD_TYPES, -D_NO_PROTO, -tp,-B/lib/
+
diff --git a/html/hints/sco.html b/html/hints/sco.html
new file mode 100644
index 0000000..d5d1933
--- /dev/null
+++ b/html/hints/sco.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <meta name="generator" content="HTML Tidy, see www.w3.org">
+ <title>SCO Unix hints</title>
+ <link href="../scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>SCO Unix hints</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <h4>Older SCO Unix versions</h4>
+ <p>NTP 4.0.x does not run on SCO Unix prior to version 3.2.5.0.0. If you need NTP on an older SCO Unix system and don't mind to modify your kernel, use 3.5.91 which has patches for SCO Unix 3.2.4.x. Apply the kernel modifications as described in <a href="http://www.echelon.nl/en/ntp/sco3-recipe.html">XNTP on SCO 3.2.4.2</a>.</p>
+ <h4>Compiling NTP</h4>
+ <p>Delete the old SCO supplied NTP programs using the &quot;custom&quot; utility. Run the NTP configure program with CFLAGS=&quot;-b elf -K <i>processor-type</i>&quot; for best results.</p>
+ <h4>Running NTP</h4>
+ <p>Run &quot;tickadj -As&quot; after every reboot to set the variables &quot;clock_drift&quot; and &quot;track_rtc&quot; to the right values.</p>
+ <p>Run &quot;ntpd&quot; with a high negative nice-value, i.e. &quot;nice --19 ntpd&quot; for best results.</p>
+ <h4>More information</h4>
+ <p>More information on the way SCO Unix and NTP interact can be found in <a href="http://www.echelon.nl/en/ntp/ntp-on-sco.html">NTP on SCO Unix</a>, which includes links to precompiled versions of NTP.</p>
+ <p>Kees Hendrikse, January 1999</p>
+ </body>
+
+</html>
diff --git a/html/hints/sgi b/html/hints/sgi
new file mode 100644
index 0000000..5e4f7de
--- /dev/null
+++ b/html/hints/sgi
@@ -0,0 +1,74 @@
+adjtime, tick and tickadj:
+--------------------------
+
+The SGI value for HZ is 100 under Irix 4, with the system clock running
+in nominal mode (ftimer off), so the value for tick is 10000 usec.
+Tickadj is a bit more tricky because of the behaviour of adjtime(),
+which seems to try to perform the correction over 100-200 seconds, with
+a rate limit of 0.04 secs/sec for large corrections. Corrections of
+less than 0.017 seconds generally complete in less than a second,
+however.
+
+Some measured rates are as follows:
+
+ Delta Rate (sec/sec)
+
+ > 1 0.04
+ 0.75 0.04
+ 0.6 0.004
+ 0.5 0.004
+ 0.4 0.0026
+ 0.3 0.0026
+ 0.2 0.0013
+ 0.1 0.0015
+ 0.05 0.0015
+ 0.02 0.0003
+ 0.01 0.015
+Strange. Anyway, since adjtime will complete adjustments of less than
+17msec in less than a second, whether the fast clock is on or off, I
+have used a value of 150usec/tick for the tickadj value.
+
+Fast clock:
+-----------
+
+I get smoother timekeeping if I turn on the fast clock, thereby making
+the clock tick at 1kHz rather than 100Hz. With the fast clock off, I
+see a sawtooth clock offset with an amplitude of 5msec. With it on,
+the amplitude drops to 0.5msec (surprise!). This may be a consequence
+of having a local reference clock which spits out the time at exactly
+one-second intervals - I am probably seeing sampling aliasing between
+that and the machine clock. This may all be irrelevant for machines
+without a local reference clock. Fiddling with the fast clock doesn't
+seem to compromise the above choices for tick and tickadj.
+
+I use the "ftimer" program to switch the fast clock on when the system
+goes into multiuser mode, but you can set the "fastclock" flag in
+/usr/sysgen/master.d/kernel to have it on by default. See ftimer(1).
+
+timetrim:
+---------
+
+Irix has a kernel variable called timetrim which adjusts the system
+time increment, effectively trimming the clock frequency. Xntpd could
+use this rather than adjtime() to do it's frequency trimming, but I
+haven't the time to explore this. There is a utility program,
+"timetrim", in the util directory which allows manipulation of the
+timetrim value in both SGI and xntpd native units. You can fiddle with
+default timetrim value in /usr/sysgen/master.d/kernel, but I think
+that's ugly. I just use xntpd to figure out the right value for
+timetrim for a particular CPU and then set it using "timetrim" when
+going to multiuser mode.
+
+Serial I/O latency:
+-------------------
+
+If you use a local clock on an RS-232 line, look into the kernel
+configuration stuff with regard to improving the input latency (check
+out /usr/sysgen/master.d/[sduart|cdsio]). I have a Kinemetrics OM-DC
+hooked onto /dev/ttyd2 (the second CPU board RS-232 port) on an SGI
+Crimson, and setting the duart_rsrv_duration flag to 0 improves things
+a bit.
+
+
+12 Jan 93
+Steve Clift, CSIRO Marine Labs, Hobart, Australia (clift@ml.csiro.au)
diff --git a/html/hints/solaris-dosynctodr.html b/html/hints/solaris-dosynctodr.html
new file mode 100644
index 0000000..89a12b2
--- /dev/null
+++ b/html/hints/solaris-dosynctodr.html
@@ -0,0 +1,321 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+
+
+<!-- Sun Template V4.0 9/9/98 -->
+<HTML>
+<HEAD>
+<TITLE>Symptoms and Resolutions Article 19195</title><link href="scripts/style.css" type="text/css" rel="stylesheet">
+
+<META NAME="GENERATOR" CONTENT="Sun Microsystems, Inc.">
+<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=iso-8859-1">
+
+<!-- INSERT YOUR META TAGS HERE -->
+
+<META NAME="PUBLISHED_DATE" CONTENT="">
+<META NAME="KEYWORDS" CONTENT="">
+<META NAME="DESCRIPTION" CONTENT="">
+
+<!-- END META TAGS -->
+
+<LINK REL="Stylesheet" TYPE="text/css" HREF="/style.css" TITLE="Style">
+
+</HEAD>
+<!--stopindex-->
+<BODY BGCOLOR="#FFFFFF" LINK="#666699" ALINK="#FFFFFF">
+
+
+<TABLE WIDTH="623" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+ <TR>
+ <TD COLSPAN="2" VALIGN="TOP" WIDTH="623">
+ <IMG BORDER="0" SRC="/images/homebuy.gif" WIDTH="149" HEIGHT="32" ALT="Home * Buy * My Sun(sm)" USEMAP="#lefttop"><IMG BORDER="0" SRC="/images/globalnavbar.gif" WIDTH="474" HEIGHT="32" ALT="sun.com Global Sections" USEMAP="#topnav"></TD>
+ </TR>
+ <TR>
+ <TD COLSPAN="2" VALIGN="TOP" WIDTH="623">
+
+ <!-- TITLEBAR IMAGE: INSERT CUSTOMIZED TITLEBAR IMAGE BELOW -->
+
+ <A HREF="http://www.sun.com/"><IMG BORDER="0" SRC="/images/sunlogo.gif" WIDTH="149" HEIGHT="72" ALT="Sun Microsystems"></A><IMG BORDER="0" SRC="/images/titlebar/doc.title.gif" WIDTH="474" HEIGHT="72"></TD>
+ </TR>
+ <!-- Begin Search Elements -->
+ <TR VALIGN="top">
+ <TD BGCOLOR="#666699">
+ <TABLE BORDER="0" WIDTH="157" CELLSPACING="0" CELLPADDING="0">
+ <TR>
+ <TD BGCOLOR="#666699" COLSPAN="2" WIDTH="157" VALIGN="TOP"><IMG BORDER="0" SRC="/images/search/contract/search1.gif" WIDTH="157" HEIGHT="16" ALT="Search SunSolve"></TD>
+ </TR>
+ <TR>
+ <TD VALIGN="top" ALIGN="center" WIDTH="141" BGCOLOR="#666699"><FORM ACTION="search.pl" METHOD="POST"><FONT SIZE="2"><INPUT TYPE="text" NAME="zone_32" SIZE="14"></FONT><input type=hidden name=mode value=results><BR>
+<INPUT TYPE="image" SRC="/images/search/contract/search5.gif" BORDER="0" NAME="Search"><IMG SRC="/images/cg_clear.gif" ALT="" WIDTH="2" HEIGHT="1" BORDER="0" HSPACE="29" VSPACE="0"><BR>
+
+<A HREF="search.pl?mode=advanced"><IMG BORDER="0" SRC="/images/search/contract/search3.gif" WIDTH="144" HEIGHT="16" ALT="Advanced Search"></A><BR>
+
+<A HREF="search.pl?mode=product"><IMG SRC="/images/search/contract/search4.gif" BORDER="0" ALT="Product Search" WIDTH="144" HEIGHT="19"></A><BR>
+
+<A HREF="show.pl?target=help/search_tips"><IMG SRC="/images/search/contract/search6.gif" BORDER="0" ALT="Search Tips" WIDTH="144" HEIGHT="27"></A></TD>
+ <TD ALIGN="right"><IMG SRC="/images/search/contract/search2.gif" ALT="" WIDTH="13" HEIGHT="117" BORDER="0"></TD>
+ </TR>
+ <!-- End Search Elements -->
+ <!-- Begin User Personalization (Must limit to 10 Characters)-->
+ <TR>
+ <TD COLSPAN="2"><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="157"><TR><TD COLSPAN="3" ALIGN="right"><IMG SRC="/images/home_con/welcom_1.gif" ALT="" WIDTH="156" HEIGHT="4" BORDER="0"></TD></TR>
+ <TR><TD BGCOLOR="#333366"><IMG SRC="/images/home_con/welcom_2.gif" ALT="" WIDTH="17" HEIGHT="19" BORDER="0"></TD><TD BGCOLOR="#333366" VALIGN="middle"><NOBR><FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" COLOR="#99CC33" SIZE="-2">sopko</FONT></NOBR></TD><TD BGCOLOR="#333366" ALIGN="right"><A HREF="edit-user-form.pl?viewmode=contractuser"><IMG SRC="/images/home_con/welcom_3.gif" ALT="Edit" WIDTH="45" HEIGHT="19" BORDER="0"></A></TD></TR>
+ </TABLE>
+ </TD>
+ </TR>
+ <!-- End User Personalization -->
+
+ <TR>
+ <TD COLSPAN="2" ALIGN="right" VALIGN="top" WIDTH="157" BGCOLOR="#666699"><IMG BORDER="0" SRC="/images/ssolvecontents.gif" WIDTH="157" HEIGHT="37" ALT="Contents Of SunSolve"><BR>
+
+
+
+
+
+ <!-- PILLS: CHANGE THE PILL FOR CURRENT SECTION TO THE HIGHLIGHTED PILL -->
+ <!-- Beginning of Nav area -->
+<A HREF="show.pl?target=patches/patch-access" onmouseover="window.status='All Public Patches'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p1.gif" WIDTH="157" HEIGHT="19" ALT="All Public Patches"></A><BR>
+<A HREF="suncourier.pl" onmouseover="window.status='Submit a Service Order'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p5.gif" WIDTH="157" HEIGHT="19" ALT="Submit a Service Order"></A><BR>
+<A HREF="show.pl?target=resources/tools" onmouseover="window.status='Diagnostic Tools'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p4.gif" WIDTH="157" HEIGHT="19" ALT="Diagnostic Tools"></A><BR>
+<A HREF="show.pl?target=help/collections" onmouseover="window.status='Support Docs.'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/cp2.gif" WIDTH="157" HEIGHT="19" ALT="Support Docs."></A><BR>
+<A HREF="show.pl?target=resources/y2k" onmouseover="window.status='Y2K Central'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p3.gif" WIDTH="157" HEIGHT="19" ALT="Y2K Central"></A><BR>
+<A HREF="show.pl?target=security/sec" onmouseover="window.status='Security Information'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p2.gif" WIDTH="157" HEIGHT="19" ALT="Security Information"></A><BR>
+<br><table cellpadding="0" cellspacing="0" border="0" width="157">
+<tr><td width="8">&nbsp;</td><td width="149">
+<table cellpadding="0" cellspacing="0" border="0">
+<BR><tr><td><BR><img src="/images/line.gif" alt="------" width="140" height="11" border="0"><br>
+ <A HREF="mark.pl"
+ onmouseover="window.status='Marked Docs.';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Marked Docs.</FONT></A><BR>
+ <A HREF="notify.pl"
+ onmouseover="window.status='Notifications';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Notifications</FONT></A><BR>
+ <A HREF="/plain-cgi/show.pl?target=home_con"
+ onmouseover="window.status='Low Graphics';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Low Graphics</FONT></A><BR>
+ <A HREF="show.pl?target=link"
+ onmouseover="window.status='SunSolve Servers';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">SunSolve Servers</FONT></A><BR>
+ <A HREF="show.pl?target=about_sunsolve"
+ onmouseover="window.status='About SunSolve';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">About SunSolve</FONT></A><BR>
+ <A HREF="feedback.pl"
+ onmouseover="window.status='Contact Us';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Contact Us</FONT></A><BR>
+ <A HREF="show.pl?target=help/sitemap"
+ onmouseover="window.status='Site Map';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Site Map</FONT></A><BR>
+ <A HREF="show.pl?target=article/article"
+ onmouseover="window.status='Articles';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Articles</FONT></A><BR>
+ <A HREF="show.pl?target=home_con"
+ onmouseover="window.status='Home';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Home</FONT></A><BR>
+ <A HREF="show.pl?target=help/faq"
+ onmouseover="window.status='Help';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Help</FONT></A><BR>
+<br></td></tr></table></td></tr></table>
+<!-- End of Nav area -->
+
+ </FORM>
+ <br><br><!-- some spacers -->
+ </TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD VALIGN="TOP" WIDTH="466">
+
+
+ <!--startindex-->
+ <!-- ============ -->
+ <!-- MAIN CONTENT -->
+ <!-- ============ -->
+
+
+
+<table width=100% cellpadding=16 cellspacing=0 border=0>
+ <tr>
+<td width=100% valign=top>
+<CENTER><FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" SIZE="2">
+[&nbsp;<a href="retrieve.pl?type=0&doc=srdb%2F19195&display=plain">Printer Friendly Page</a>&nbsp;]
+[&nbsp;<b>Was this document useful? <a href="retrieve.pl?type=0&doc=srdb/19195&vote=yes">Yes</a> or <a href="retrieve.pl?type=0&doc=srdb/19195&vote=no">No</a></b>&nbsp;]<br>[&nbsp;<a href="notify.pl?action=add&doc=srdb%2F19195&type=synopsis">Notify if Document Changes</a>&nbsp;]
+[&nbsp;<a href="mark.pl?action=add&doc=srdb%2F19195&type=0">Mark Document for Download</a>&nbsp;]<br>[&nbsp;<a href="notify.pl">View/Edit Notifications</a>&nbsp;]
+[&nbsp;<a href="mark.pl">View/Edit Marked Documents</a>&nbsp;]<br></FONT></CENTER><br>
+ <SCRIPT Language="JavaScript">
+ <!-- Hide javascript from older browsers
+ function jump()
+ {
+ var ctl = document.docform.jumplist;
+ location.href = ctl.options[ctl.selectedIndex].value;
+ }
+ // End hiding contents -->
+ </SCRIPT>
+<a name="top">
+<form name="docform"><div align=center><font size=2> Jump to <select name="jumplist" size=1 onchange="jump();"></font><option value="#Hardware">Hardware</option>
+<option value="#Product">Product</option>
+<option value="#Product-Area">Product Area</option>
+<option value="#Synopsis">Synopsis</option>
+<option value="#Problem-Description">Problem Description</option>
+<option value="#Document-Content">Document Content</option>
+<option value="#Problem-Solution">Problem Solution</option>
+<option value="#SRDB-ID">SRDB ID</option>
+<option value="#OS">OS</option>
+</select></div></form>
+<table width=100% cellpadding=2 cellspacing=0 border=0>
+<tr bgcolor=#666699><td><font size=2 color=#ffffff><b>SRDB ID</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2 color=#ffffff><b>Synopsis</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2 color=#ffffff><b>Date</b></font></td>
+</tr>
+<tr bgcolor=#CCCCE7><td><font size=2><b>19195</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2><b>Upgraded to 2.6, using xntpd, but the system clock is drifting. Worked fine</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2><b>4 Sep 1999</b></font></td>
+</tr>
+</table><br clear>
+<table width=100% cellpadding=2 cellspacing=0 border=0><tr bgcolor=#999999>
+<td><font size=2 color=#ffffff><b><a name=Problem-Description>Problem Description</a></b></font></td>
+<td align=right><b><a href="#top"><font size=2 color=#ffffff>Top</font></a></b></td></tr></table>
+<pre>Ever since upgrading to Solaris 2.6, the system clock has been drifting and
+there are messages like 'synchronisation lost', 'Previous time adjustment
+didn''t complete' and 'time reset (step)' a lot in the /var/adm/messages
+file. The system either was previously working fine with the freeware
+xntpd or the configuration was copied from another system that was
+using the freeware version.
+-- 23-Apr-99 08:22 US/Eastern --</pre><table width=100% cellpadding=2 cellspacing=0 border=0><tr bgcolor=#999999>
+<td><font size=2 color=#ffffff><b><a name=Problem-Solution>Problem Solution</a></b></font></td>
+<td align=right><b><a href="#top"><font size=2 color=#ffffff>Top</font></a></b></td></tr></table>
+<pre>The common lore for setting up xntpd on Solaris using
+the freeware version included the warning to set the
+kernel variable <font color=red>dosynctodr</font> to 0 in the /etc/system
+file thus: set <font color=red>dosynctodr</font>=0
+
+When using NTP on Solaris 2.6 or later, the kernel
+variable MUST be left at the default value of 1. Prior
+to 2.6 this variable controlled whether or not to rein
+in the softclock using the hardware clock, with the result
+that NTP and the hardware clock would fight for control of
+the soft clock; thus before 2.6 you had to set <font color=red>dosynctodr</font>
+to 0. At 2.6, every system call that adjusts the softclock
+also sets the hard clock, thus while NTP controls the soft
+clock, the hard clock is also controlled. Setting
+<font color=red>dosynctodr</font> to 0 reverts the behavior back to the pre 2.6
+defaulkt behavior, having exactly the opposite effect
+as that intended.
+
+Do not set <font color=red>dosynctodr</font> to 0.</pre><table width=100% cellpadding=2 cellspacing=0 border=0>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Product-Area>Product Area</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>Bundled Network</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Product>Product</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>NTP</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=OS>OS</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>Solaris 2.6</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Hardware>Hardware</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>Ultra 2</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Document-Content>Document Content</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>with freeware xntpd.</font></td></tr>
+</table><br clear>
+<font size=2><a href="#top">Top</a></font><br><br>
+</td></tr></table>
+
+ <!-- =================== -->
+ <!-- END OF MAIN CONTENT -->
+ <!-- =================== -->
+ <!--stopindex-->
+
+ <!-- DON'T CHANGE INFORMATION OTHER THAN titlebar BELOW THIS LINE -->
+
+ <!-- Altered Table Structure from Template to format properly with new design -->
+ </TD>
+ </TR>
+ <TR>
+ <TD>&nbsp;</TD>
+ <TD VALIGN="top">
+ <center>
+ <IMG SRC="/images/cg_grey_line.gif" ALT="" WIDTH="466" HEIGHT="2" BORDER="0"><BR>
+ <IMG SRC="/images/cg_clear.gif" ALT="" WIDTH="1" HEIGHT="2" BORDER="0" HSPACE="0" VSPACE="4">
+ </center>
+ <CENTER>
+ <FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" SIZE="2">
+ [ <A HREF="edit-user-form.pl?viewmode=contractuser">Edit Account</A> ]
+ [ <A HREF="show.pl?target=patches/patch-access">Patches</A> ]
+ [ <A HREF="suncourier.pl">Submit a Service Order</A> ]<br>
+ [ <A HREF="show.pl?target=resources/tools">Diagnostic Tools</A> ]
+ [ <A HREF="show.pl?target=help/collections">Support Docs.</A> ]
+ [ <A HREF="show.pl?target=resources/y2k">Y2K Central</A> ]
+ [ <A HREF="show.pl?target=security/sec">Security Information</A> ] <br>
+ [ <A HREF="show.pl?target=link">SunSolve Servers </A> ]
+ [ <A HREF="show.pl?target=about_sunsolve">About SunSolve</A> ]
+ [ <A HREF="feedback.pl">Contact Us</A> ]
+ [ <A HREF="show.pl?target=help/sitemap">Site Map</A> ]
+ [ <A HREF="show.pl?target=article/article">Articles</A> ]
+ [ <A HREF="show.pl?target=home_con">Home</A> ]
+ [ <A HREF="show.pl?target=help/faq">Help</A> ]
+ </FONT>
+ </CENTER>
+
+<!-- MAPS -->
+<MAP NAME="lefttop">
+<AREA SHAPE="rect" HREF="http://www.sun.com/MySun/" ALT="My Sun" COORDS="89,0 149,32">
+<AREA SHAPE="rect" HREF="show.pl?target=home_con" ALT="Home" COORDS="0,0 42,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/sales/" ALT="Buy" COORDS="54,0 78,32">
+</MAP>
+
+
+<MAP NAME="topnav">
+<AREA SHAPE="rect" HREF="http://www.sun.com/java/" ALT="Java Technologies" COORDS="4,0,67,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/products-n-solutions/" ALT="Products and Solutions" COORDS="74,0,141,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/service/" ALT="Support, Education, and Consulting" COORDS="148,0,249,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/tech/" ALT="Technology and Research" COORDS="261,0,324,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/developers/developers.html" ALT="For Developers" COORDS="334,0,396,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/corporateoverview/" ALT="Corporate Information" COORDS="406,0,482,32">
+</MAP>
+
+<!-- INSERT titlebar HREFS BELOW -->
+<MAP NAME="titlebar">
+<!-- LINK TO SEC HOME Removed because no longer needed on this template -->
+<AREA SHAPE="rect" HREF="/visual/home/" ALT="SunSolve Online(tm)" COORDS="0,21,215,51"> <!-- LINK TO CURRENT PILL HOME -->
+</MAP>
+
+
+<!-- begin copyright notice -->
+
+<BR>
+<CENTER>
+<FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" COLOR="#999999" SIZE="2">
+<br>
+Copyright 1994-1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.
+<br>
+All rights reserved.
+<a href="http://www.sun.com/share/text/SMICopyright.html">Legal Terms</a>.
+<a href="http://www.sun.com/privacy/">Privacy Policy</a>.
+</font>
+</CENTER>
+
+<!-- end copyright notice -->
+
+ </TD>
+ </TR>
+</TABLE>
+
+</BODY>
+</HTML>
+
diff --git a/html/hints/solaris.html b/html/hints/solaris.html
new file mode 100644
index 0000000..4b83862
--- /dev/null
+++ b/html/hints/solaris.html
@@ -0,0 +1,236 @@
+<HTML>
+<HEAD>
+<TITLE>Solaris hints and kinks</title><link href="scripts/style.css" type="text/css" rel="stylesheet">
+
+</HEAD>
+<BODY>
+Information on compiling and executing ntpd under Solaris.
+<BR>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->27-Jan-2014 05:31<!-- #EndDate -->
+ UTC,
+John Hawkinson,
+<! -- This is deliberately not a mailto -- > &lt;jhawk@MIT.EDU&gt;
+</p>
+<P>
+If you're not running Solaris 2.5.1 or later, it is likely
+that you will have problems; upgrading would be a really good plan.
+<P>
+<H3>All Solaris versions</H3>
+<P>
+ We have a report that says starting with Solaris 2.6 we should leave
+ <I>dosynctodr</I> alone.
+ <A HREF="solaris-dosynctodr.html">Here is the report</A>.
+<P>
+Proper operation of ntp under Solaris may require setting the kernel
+variable <I>dosynctodr</I> to zero (meaning "do not synchronize the clock
+to the hardware time-of-day clock"). This can be done with the
+tickadj utility:
+<BLOCKQUOTE><TT>
+tickadj -s
+</TT></BLOCKQUOTE>
+If you prefer, it can also be done with the native Solaris kernel debugger:
+<BLOCKQUOTE><TT>
+echo dosynctodr/W0 | adb -k -w /dev/ksyms /dev/mem
+</BLOCKQUOTE></TT>
+<P>
+Or, it can also be set by adding a line to /etc/system:
+<BLOCKQUOTE><TT>
+set dosynctodr = 0
+</BLOCKQUOTE></TT>
+<P>
+Instead of the <I>tick</I> kernel variable, which many operating
+systems use to control microseconds added to the system time every
+clock tick (c.f. <A HREF="#frequency_tolerance">Dealing
+with Frequency Tolerance Violations</A>), Solaris has the variables
+<I>nsec_per_tick</I> and <I>usec_per_tick</I>.
+<P>
+<I>nsec_per_tick</I> and <I>usec_per_tick</I> control the number of
+nanoseconds and microseconds, respectively, added to the system clock
+each clock interrupt. Enterprising souls may set these based on
+information collected by ntpd in the <CODE>/etc/ntp.drift</CODE> file
+to correct for individual hardware variations.
+<P>
+On UltraSPARC systems, <I>nsec_per_tick</I> and <I>usec_per_tick</I>
+are ignored in favor of the <I>cpu_tick_freq</I> variable, which
+should be automatically be determined by the PROM in an accurate
+fashion.
+<P>
+In general, the same ntp binaries should not be used across multiple
+operating system releases. There is enough variation in the core operating
+system support for timekeeping that a rebuild of ntpd for the idiosyncracies
+of your specific operating system version is advisable.
+<P>
+It is recommended that ntp be started via a script like <A
+HREF="solaris.xtra.S99ntpd">this one</A>, installed in
+<CODE>/etc/init.d/ntpd</CODE> with a symbol link from
+<CODE>/etc/rc2.d/S99ntpd</CODE>.
+
+<a id="frequency_tolerance" />
+<h4>Dealing with Frequency Tolerance Violations (<tt>tickadj</tt> and
+Friends)</h4>
+ The NTP Version 3 specification RFC-1305 calls for a maximum
+ oscillator frequency tolerance of +-100 parts-per-million (PPM), which is
+representative of those components suitable for use in relatively
+inexpensive workstation platforms. For those platforms meeting this
+tolerance, NTP will automatically compensate for the frequency errors of the
+individual oscillator and no further adjustments are required, either to the
+configuration file or to various kernel variables. For the NTP Version 4
+release, this tolerance has been increased to +-500 PPM. <p>However, in the
+case of certain notorious platforms, in particular Sun 4.1.1 systems, the
+performance can be improved by adjusting the values of certain kernel
+variables; in particular, <tt>tick</tt> and <tt>tickadj</tt>. The variable
+<tt>tick</tt> is the increment in microseconds added to the system time on
+each interval- timer interrupt, while the variable <tt>tickadj</tt> is used
+by the time adjustment code as a slew rate, in microseconds per tick. When
+the time is being adjusted via a call to the system routine
+<tt>adjtime()</tt>, the kernel increases or reduces tick by <tt>tickadj</tt>
+microseconds per tick until the specified adjustment has been
+completed. Unfortunately, in most Unix implementations the tick increment
+must be either zero or plus/minus exactly <tt>tickadj</tt> microseconds,
+meaning that adjustments are truncated to be an integral multiple of
+<tt>tickadj</tt> (this latter behaviour is a misfeature, and is the only
+reason the <tt>tickadj</tt> code needs to concern itself with the internal
+implementation of <tt>tickadj</tt> at all). In addition, the stock Unix
+implementation considers it an error to request another adjustment before a
+prior one has completed.</p> <p>Thus, to make very sure it avoids problems
+related to the roundoff, the <tt>tickadj</tt> program can be used to adjust
+the values of <tt>tick</tt> and <tt>tickadj</tt>. This ensures that all
+adjustments given to <tt>adjtime()</tt> are an even multiple of
+<tt>tickadj</tt> microseconds and computes the largest adjustment that can
+be completed in the adjustment interval (using both the value of
+<tt>tick</tt> and the value of <tt>tickadj</tt>) so it can avoid exceeding
+this limit. It is important to note that not all systems will allow
+inspection or modification of kernel variables other than at system build
+time. It is also important to know that, with the current NTP tolerances, it
+is rarely necessary to make these changes, but in many cases they will
+substantially improve the general accuracy of the time service.</p>
+<p>Unfortunately, the value of <tt>tickadj</tt> set by default is almost
+always too large for <tt>ntpd</tt>. NTP operates by continuously making
+small adjustments to the clock, usually at one-second intervals. If
+<tt>tickaj</tt> is set too large, the adjustments will disappear in the
+roundoff; while, if <tt>tickadj</tt> is too small, NTP will have difficulty
+if it needs to make an occasional large adjustment. While the daemon itself
+will read the kernel's values of these variables, it will not change the
+values, even if they are unsuitable. You must do this yourself before the
+daemon is started using the <tt>tickadj</tt> program included in the
+<tt>./util</tt> directory of the distribution. Note that the latter program
+will also compute an optimal value of <tt>tickadj</tt> for NTP use based on
+the kernel's value of <tt>tick</tt>.</p> <p>The <tt>tickadj</tt> program can
+reset several other kernel variables if asked. It can change the value of
+<tt>tick</tt> if asked. This is handy to compensate for kernel bugs which
+cause the clock to run with a very large frequency error, as with SunOS
+4.1.1 systems. It can also be used to set the value of the kernel
+<tt>dosynctodr</tt> variable to zero. This variable controls whether to
+synchronize the system clock to the time-of-day clock, something you really
+don't want to be happen when <tt>ntpd</tt> is trying to keep it under
+control. In some systems, such as recent Sun Solaris kernels, the
+<tt>dosynctodr</tt > variable is the only one that can be changed by the
+<tt>tickadj</tt> program. In this and other modern kernels, it is not
+necessary to change the other variables in any case.</p>
+
+<p>We have a report that says starting with Solaris 2.6 we should leave
+<i>dosynctodr</i> alone.</p> <p>In order to maintain reasonable correctness
+bounds, as well as reasonably good accuracy with acceptable polling
+intervals, <tt>ntpd</tt> will complain if the frequency error is greater
+than 500 PPM. For machines with a value of <tt>tick</tt> in the 10-ms range,
+a change of one in the value of <tt>tick</tt> will change the frequency by
+about 100 PPM. In order to determine the value of <tt>tick</tt> for a
+particular CPU, disconnect the machine from all source s of time
+(<tt>dosynctodr</tt> = 0) and record its actual time compared to an outside
+source (eyeball-and-wristwatch will do) over a day or more. Multiply the
+time change over the day by 0.116 and add or subtract the result to tick,
+depending on whether the CPU is fast or slow. An example call to
+<tt>tickadj</tt> useful on SunOS 4.1.1 is:</p>
+ <pre>
+ <tt>tickadj</tt> -t 9999 -a 5 -s
+</pre>
+which sets tick 100 PPM fast, <tt>tickadj</tt> to 5 microseconds and turns
+off the clock/calendar chip fiddle. This line can be added to the <tt
+>rc.local</tt> configuration file to automatically set the kernel variables
+at boot time. <p>All this stuff about diddling kernel variables so the NTP
+daemon will work is really silly. If vendors would ship machines with clocks
+that kept reasonable time and would make their <tt>adjtime()</tt> system
+call apply the slew it is given exactly, independent of the value of
+<tt>tickadj</tt>, all this could go away. This is in fact the case on many
+current Unix systems.</p>
+
+<H3>Solaris 2.6</H3>
+<P>
+Solaris 2.6 adds support for kernel PLL timekeeping, but breaks this
+support in such a fashion that using it worse than not. This is <A
+HREF="solaris.xtra.4095849"> SUN Bug ID 4095849</A>, and it is not yet
+fixed as of June 1998.
+<P>
+<H3>Solaris 2.5 and 2.5.1</H3>
+<P>
+On UltraSPARC systems, calculation of <I>cpu_tick_freq</I> is broken
+such that values that are off by significant amounts may be used
+instead. This unfortunately means that ntpd may have severe problems
+keeping synchronization. This is <A HREF="solaris.xtra.4023118"> SUN Bug ID
+4023118</A>. Bryan Cantrill <! -- &lt;bmc@eng.sun.com&gt; --> of Sun
+posted <A HREF="solaris.xtra.patchfreq">patchfreq</A>, a workaround script,
+to comp.protocols.time.ntp in March of 1997.
+<P>
+<HR>
+<H2>OLD DATA</H2>
+<STRONG>I can't vouch for the accuracy the information below this
+rule. It may be significantly dated or incorrect.</STRONG>
+<P>
+<P>
+<H3>Solaris 2.2</H3>
+<P>
+Solaris 2.2 and later contain completely re-written clock code to
+provide high resolution microsecond timers. A benefit of the
+re-written clock code is that adjtime does not round off its
+adjustments, so ntp does not have to compensate for this
+rounding. Under Solaris 2.2 and later, ntp #define's
+<CODE>ADJTIME_IS_ACCURATE</CODE>, and does not look for the <I>tickadj</I>
+kernel variable.
+<P>
+<H3>Solaris 2.1</H3>
+(This originally written by William L. Jones &lt;jones@chpc.utexas.edu&gt;)
+<P>
+Solaris 2.1 contains fairly traditional clock code, with <I>tick</I>
+and <I>tickadj</I>.
+<P>
+Since settimeofday under Solaris 2.1 only sets the seconds part of timeval
+care must be used in starting xntpd. I suggest the following start
+up script:
+<BLOCKQUOTE><TT>
+tickadj -s -a 1000
+<BR>ntpdate -v server1 server2
+<BR>sleep 20
+<BR>ntpdate -v server1 server2
+<BR>sleep 20
+<BR>tickadj -a 200
+<BR>xntpd
+</TT></BLOCKQUOTE>
+
+The first tickadj turns of the time of day clock and sets the tick
+adjust value to 1 millisecond. This will insure that an adjtime value
+of at most 2 seconds will complete in 20 seconds.
+<P>
+The first ntpdate will set the time to within two seconds
+using settimeofday or it will adjust time using adjtime.
+<P>
+The first sleep insures the adjtime has completed for the first ntpdate.
+<P>
+The second ntpdate will use adjtime to set the time of day since the
+clock should be within 2 seconds of the correct time.
+<P>
+The second tickadj set the tick adjust system value to 5 microseconds.
+<P>
+The second sleeps insure that adjtime will complete before starting
+the next xntpd.
+<P>
+I tried running with a tickadj of 5 microseconds with out much success.
+200 microseconds seems to work well.
+<P>
+<HR>
+Prior versions of this file had major text contributed by:
+<MENU>
+<LI>Denny Gentry &lt;denny@eng.sun.com&gt;
+</MENU>
+<BODY>
+</HTML>
diff --git a/html/hints/solaris.xtra.4023118 b/html/hints/solaris.xtra.4023118
new file mode 100644
index 0000000..84c5d15
--- /dev/null
+++ b/html/hints/solaris.xtra.4023118
@@ -0,0 +1,36 @@
+ Bug Id: 4023118
+ Category: kernel
+ Subcategory: other
+ State: integrated
+ Synopsis: sun4u doesn't keep accurate time
+ Description:
+
+[ bmc, 12/20/96 ]
+
+The clock on a sun4u drifts unacceptably. On a typical 143 mHz Ultra,
+the clock took 1.0001350 seconds to count 1 second. While this may seem
+trivial, it adds up quickly. In this case, the TOD chip will have to
+pull the clock forward by 2 seconds every 4 hours and 7 minutes.
+This drift rate is so high, that the clock is close to being too broken
+for NTP to guarantee correctness (in order for NTP's mechanism to work,
+it must be assured that the local clock drifts no more than 20 ms in 64
+seconds; this particular 143 mHz Ultra will drift by nearly 9 ms in that
+period). This problem has been reproduced on virtually all sun4u
+classes.
+
+The fundamental problem lies in the kernel's perception of ticks per
+second. The PROM is responsible for determining this figure exactly,
+and the kernel extracts it into the variable cpu_tick_freq. On sun4u's,
+this number is disconcertingly round: 143000000, 167000000, 248000000,
+etc. Indeed, a simple experiment revealed that these numbers were
+quite far from the actual ticks per second. Typical was the 143 mHz
+Ultra which was discovered to tick around 142,980,806 (+/- 10) times
+per second.
+
+ Work around:
+
+ Integrated in releases: s297_27
+ Duplicate of:
+ Patch id:
+ See also:
+ Summary:
diff --git a/html/hints/solaris.xtra.4095849 b/html/hints/solaris.xtra.4095849
new file mode 100644
index 0000000..8d3ce80
--- /dev/null
+++ b/html/hints/solaris.xtra.4095849
@@ -0,0 +1,74 @@
+ Bug Id: 4095849
+ Category: kernel
+ Subcategory: syscall
+ State: evaluated
+ Synopsis: time_constant value >6 with PLL in use leads to integer divide
+ zero trap panic
+ Description:
+If the time_constant parameter is 7 or higher, and the phase-lock looping model
+is in use, the system will take a "integer divide zero trap" panic in
+the clock routine as soon as the time_offset becomes non-zero.
+
+time_constant defaults to 0. The only place it is set is in the ntp_adjtime
+system call, from the 'constant' element of the timex structure argument.
+
+ Work around:
+Never set the constant element of the timex structure passed to ntp_adjtime to
+a value larger than 6.
+
+satish.mynam@Eng 1998-04-30
+1. Use Sun's version of NTP software instead of PD version. This problem
+is not seen with Sun's NTP version (which is mostly eqivalent to PD NTP 3.4
+plus some Sun's local functionality futures).
+
+2. Workaround for the public domain NTP version ONLY:
+ =====================================================
+The workaround for public domain NTP version is to disable the
+KERNEL_PLL from the NTP code. This way ntp_Adjtime() system call is
+totally bypassed without sacrificing any of the functionality of the
+NTP. The only hit you might see is the way kernel precision timminig
+is done without the PLL algorithm in the kernel.
+
+ The easiest way to disable ntp_adjtime option is(without changing
+ any makefiles or other config files) to disable the KERNEL_PLL
+ value in the ./config.h file.
+
+After doing a ./configure for probing for all the necessary tools(compilers,
+os version, libraries), please comment out KERNEL_PLL macro in
+the ./config.h file. This will disable the KERNEL_PLL part of the source
+code and the newly obtained xntpd is just similar to the old one but it
+does not use ntp_adjtime() system call. This prevents it from panic'ng
+the kernel.
+
+/*#define KERNEL_PLL 1*/
+
+I complied a new xntpd binary this way and it does nothave any ntp_adjtime()
+related stuff.
+
+Default:
+=======
+/net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings
+xntpd |
+grep ntp_adjtime
+354:adj_frequency: ntp_adjtime failed: %m
+357:loop_config: ntp_adjtime() failed: %m
+435:get_kernel_info: ntp_adjtime() failed: %m
+
+With KERNEL_PLL disabled in config.h file
+-=======================
+
+/net/divya/export/home/mynam/public_domain/ntp/xntp3-5.92/xntpd>strings
+xntpd.nopll | grep ntp_adjtime
+
+ Integrated in releases:
+ Duplicate of:
+ Patch id:
+ See also: 4133517
+ Summary:
+If the time_constant parameter is 7 or higher, and the phase-lock looping model
+is in use, the system will take a "integer divide zero trap" panic in
+the clock routine as soon as the time_offset becomes non-zero.
+
+time_constant defaults to 0. The only place it is set is in the ntp_adjtime
+system call, from the 'constant' element of the timex structure argument.
+----------------------------------------------------------------------------
diff --git a/html/hints/solaris.xtra.S99ntpd b/html/hints/solaris.xtra.S99ntpd
new file mode 100644
index 0000000..d8058fd
--- /dev/null
+++ b/html/hints/solaris.xtra.S99ntpd
@@ -0,0 +1,21 @@
+#!/bin/sh
+if [ $1 = "start" ]; then
+ if [ -x /usr/local/bin/xntpd ]; then
+ echo "Starting NTP daemon, takes about 1 minute... "
+ # dosynctodr may need to be left alone as of with Solaris 2.6
+ # The following line is unnecessary if you turn off
+ # dosynctodr in /etc/system.
+ /usr/local/bin/tickadj -s
+ /usr/local/bin/ntpdate -v server1 server2
+ sleep 5
+ /usr/local/bin/xntpd
+ fi
+else
+ if [ $1 = "stop" ]; then
+ pid=`/usr/bin/ps -e | /usr/bin/grep xntpd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
+ if [ "${pid}" != "" ]; then
+ echo "Stopping Network Time Protocol daemon "
+ /usr/bin/kill ${pid}
+ fi
+ fi
+fi
diff --git a/html/hints/solaris.xtra.patchfreq b/html/hints/solaris.xtra.patchfreq
new file mode 100644
index 0000000..9600881
--- /dev/null
+++ b/html/hints/solaris.xtra.patchfreq
@@ -0,0 +1,85 @@
+#!/bin/ksh
+
+#
+# File: patchfreq
+# Author: Bryan Cantrill (bmc@eng.sun.com), Solaris Performance
+# Modified: Sat Apr 26 04:00:59 PDT 1997
+#
+# This is a little script to patch a 5.5 or 5.5.1 kernel to get around
+# the cpu_tick_freq inaccuracy. Before running this script, one must
+# know the true frequency of one's CPU; this can be derived by NTP,
+# or by observing the clock relative to the time-of-day chip over a
+# long period of time (the TOD will pull system time when it drifts
+# by more than two seconds).
+#
+# Patching a kernel can render a machine unbootable; do not run this
+# script unless you are prepared to accept that possibility. It
+# is advisable to have a backout path (e.g. net booting, an alternate
+# boot disk, an installation CD) should your machine fail to boot.
+#
+# This is not a product of Sun Microsystems, and is provided "as is",
+# without warranty of any kind expressed or implied including, but not
+# limited to, the suitability of this script for any purpose.
+#
+
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 cpu_tick_freq [ alternate_kernel ]"
+ exit 1
+fi
+
+cpu_tick_freq=$1
+kernel=/platform/sun4u/kernel/unix
+
+if [ $# -eq 2 ]; then
+ kernel=$2
+fi
+
+if [ ! -w $kernel ]; then
+ echo "$0: Cannot open $kernel for writing."
+ exit 1
+fi
+
+arch=`echo utsname+404?s | adb $kernel | cut -d: -f2`
+
+if [ ! $arch = "sun4u" ]; then
+ echo "Patch only applies to sun4u"
+ exit 1
+fi
+
+rel=`echo utsname+202?s | adb $kernel | cut -d: -f2`
+
+if [ ! $rel = "5.5" ] && [ ! $rel = "5.5.1" ]; then
+ echo "Patch only applies to 5.5 or 5.5.1..."
+ exit 1
+fi
+
+nop="1000000" # nop
+store_mask="ffffe000" # mask out low 13 bits
+store="da256000" # st %o5, [%l5 + offset]
+
+instr=`echo setcpudelay+34?X | adb $kernel | cut -d: -f 2 | nawk '{ print $1 }'`
+
+if [ $instr = $nop ]; then
+ echo "Instruction already patched..."
+else
+ let masked="(16#$store_mask & 16#$instr) - 16#$store"
+ if [ $masked -ne 0 ]; then
+ echo "Couldn't find instruction to patch; aborting."
+ exit 1
+ fi
+
+ if ! echo setcpudelay+34?W $nop | adb -w $kernel 1> /dev/null
+ then
+ echo "adb returned an unexpected error; aborting."
+ fi
+fi
+
+echo "Patching cpu_tick_freq to $cpu_tick_freq..."
+
+if ! echo cpu_tick_freq?W 0t$cpu_tick_freq | adb -w $kernel 1> /dev/null; then
+ echo "adb returned an unexpected error; aborting."
+ exit 1
+fi
+
+echo "$kernel successfully patched."
+exit 0
diff --git a/html/hints/sun4 b/html/hints/sun4
new file mode 100644
index 0000000..424fa18
--- /dev/null
+++ b/html/hints/sun4
@@ -0,0 +1,15 @@
+Notes on CPU clock oscillator tolerance with SunOS 4.1.1 and 4.1.3
+
+A bug in SunOS 4.1.1 results in the kernel time losing 1 microsecond
+per tick of the system clock. The bug was fixed (bugid 1094383) for
+SunOS 4.1.1 and corrected in SunOS 4.1.3. The easiest way to fix this
+is to replace the 4.1.1 binary clock.o with the corresponding 4.1.3
+binary. Without this change it is necessary to use the tickadj program
+included in this distribution with the -t 9999 option.
+
+The tickadj option will work in all cases except when the kernel has
+been modified to correct the CPU clock oscillator frequency using a
+1-pps signal from a precision source. The bugfix must be installed for
+this wrinkle to work properly.
+
+Dave Mills (mills@udel.edu)
diff --git a/html/hints/svr4-dell b/html/hints/svr4-dell
new file mode 100644
index 0000000..2c92f8a
--- /dev/null
+++ b/html/hints/svr4-dell
@@ -0,0 +1,8 @@
+Notes on the DELL SVR4.
+
+You should use -DSETTIMEOFDAY_BROKEN.
+
+Philip.Gladstone@mail.citicorp.com
+
+(XXX But there is no checking for SETTIMEOFDAY_BROKEN in the code)
+
diff --git a/html/hints/svr4_package b/html/hints/svr4_package
new file mode 100644
index 0000000..b9f5ca3
--- /dev/null
+++ b/html/hints/svr4_package
@@ -0,0 +1,33 @@
+Date: Wed, 12 Apr 1995 12:42:03 +0100
+Message-ID: <513.797686923@concurrent.co.uk>
+From: Andy Chittenden <asc@concurrent.co.uk>
+
+Dave
+
+Here is a uuencoded, compressed tar file. The only file I've
+changed is Makefile - I've included the full file rather than diffs.
+There are some new files as well:
+
+ xntp shell script that starts up ntp during boot up
+ (the packaging stuff creates links to it so it comes
+ up at run level 2). As with all svr4 start/stop
+ scripts, it takes one parameter which is either
+ start or stop. It assumes that ntp.conf is in
+ /etc/inet/ntp.conf (where it should be on svr4
+ machines).
+ prototype describes the file contents of the package.
+ You might like to review its contents to
+ see whether you want to include any other
+ files or remove some. NB I've made the man
+ pages go into 1m as they should on svr4.
+ preinstall runs before installation takes place. It
+ ensures that ntp is down if it is up before
+ installing a replacement package
+ postinstall starts up ntp after package installation.
+ preremove brings down ntp before removing the package.
+
+You create a package using "make package". This creates a file
+called xntp.pkg. To install this package, you use
+"pkgadd -d `pwd`/xntp.pkg xntp". This will start up ntp if
+/etc/inet/ntp.conf exists. If you don't want the package anymore, use
+"pkgrm xntp". I have tested this on Solaris 2.4.
diff --git a/html/hints/todo b/html/hints/todo
new file mode 100644
index 0000000..e0e5ffa
--- /dev/null
+++ b/html/hints/todo
@@ -0,0 +1,4 @@
+Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>:
+ Any change in a source file in the lib directory causes all files to
+ be recompiled (because the objects are removed). Add a better rule for
+ make to update the library. Maybe just remove "-rm -f $?".
diff --git a/html/hints/vxworks.html b/html/hints/vxworks.html
new file mode 100644
index 0000000..eac9312
--- /dev/null
+++ b/html/hints/vxworks.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <meta name="generator" content="HTML Tidy, see www.w3.org">
+ <title>vxWorks Port of NTP</title>
+ <link href="../scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+ <body link="#00008B" vlink="#8B0000">
+ <h4>VxWorks port of NTP</h4>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <p>Creating a port for vxWorks posed some problems. This port may help as a starting point for similar ports to real-time OS's and other embeddable kernels, particularly where <tt>main()</tt> is not allowed, and where the configure scripts need to be altered.</p>
+ <h4>Configuration issues</h4>
+ <p>I decided to do as little invasive surgery as possible on the NTP code, so I brought the vxWorks header tree in line with the standard Unix tree. The following changes were needed, as a side effect these changes will allow for easy porting of other autoconfigure enabled code.</p>
+ <p>Where I have 386 you will need to put in your target type. The vxWorks tree entry point is <tt>/usr/wind</tt>. If these are the same for your system, you should be able to cut and paste the changes.</p>
+ <p><blink>WARNING: Check you are not overwriting files, before entering the following: there should be no conflict, but check first...</blink></p>
+ <pre>
+ export CC=&quot;cc386 -nostdlib -m486 -DCPU=I80486 -I/usr/wind/target/h&quot;
+ export RANLIB=ranlib386
+ export AR=ar386
+ export VX_KERNEL=/usr/wind/target/config/ims_std_bsp/vxWorks<br>
+
+ cd /usr/wind/target/sys
+ ln -s ../signal.h
+ ln -s ../time.h
+ ln -s socket.h sockio.h
+ ln -s ../selectLib.h select.h
+ ln -s ../timers.h
+ touch file.h param.h resource.h utsname.h var.h ../netdb.h ../a.out.h ../termios.h
+ echo &quot; ******ADD #include \&quot;sys/times.h\&quot; to sys/time.h &quot;
+ </pre>
+ The configure script must be changed in the following way to get the linking tests to work, once in the correct directory issue the following commands:
+
+ <pre> sed -e 's%main.*()%vxmain()%' configure &gt; configure.vxnew
+ mv configure.vxnew configure
+ chmod 755 configure
+ </pre>
+ <p></p>The new version 4 of NTP requires some maths functions so it links in the maths library (-lm) in the <tt>./ntpd/Makefile.am</tt> file change the line <tt>ntpd_LDADD = $(LDADD) -lm</tt> by removing the &quot;-lm&quot;.</p>
+ <p>>You are now ready to compile
+ <p>The ./configure.in file needed to be altered to allow for a host-target configuration to take place.</p>
+ <ul>
+ <li>The define SYS_VXWORKS was added to the compilation flags.
+ <li>Little endianess is set if the target is of type iX86.
+ <li>The size of char, integer, long values are all set. If Wind River ever changes these values they will need to be updated.
+ <li>clock_settime() is defined to be used for setting the clock.
+ <li>The Linking flags have -r added to allow for relinking into the vxWorks kernel
+ </ul>
+ <p>Unfortunately I have had to make use of the <tt>./include/ntp_machine.h</tt> file to add in the checks that would have been checked at linking stage by <tt>autoconf</tt>, a better method should be devised.</p>
+ <ul>
+ <li>There is now a <tt>NO_MAIN_ALLOWED</tt> define that simulates command line args, this allows the use of the normal startup sysntax.
+ <li>POSIX timers have been added.
+ <li>Structures normally found in <tt>netdb.h</tt> have been added with, the corresponding code is in <tt>./libntp/machines.c</tt>. Where possible the defines for these have been kept non-vxWorks specific.
+ </ul>
+ <p>Unfortunately there are still quite a few <tt>SYS_VXWORKS</tt> type defines in the source, but I have eliminated as many as possible. You have the choice of using the <tt>usrtime.a</tt> library avaliable from the vxworks archives or forgoing <tt>adjtime()</tt> and using the <tt>clock_[get|set]time()</tt>. The <tt>./include/ntp_machine.h</tt> file clearly marks how to do this.</p>
+ <h4>Compilation issues</h4>
+ <p>You will need autoconf and automake ... available free from the gnu archives worldwide.</p>
+ <p>The variable <tt>arch</tt> is the target architecture (e.g. i486)</p>
+ <pre>
+ mkdir A.vxworks)
+ cd A.vxworks
+ ../configure --target=arch-wrs-vxworks
+ make
+ </pre>
+ <p>Options I normally use are the <tt>--disable-all-clocks --enable-LOCAL-CLOCK</tt> flags. The program should proceed to compile without problem. The daemon ntpd, ntpdate, ntptrace, ntpdc, ntpq programs and of course the libraries are all fully ported. The other utilities are not, but they should be easy to port.</p>
+ <h4>Running the software</h4>
+ <p>Load in the various files, call them in the normal vxWorks function type manner. Here are some examples. Refer to the man pages for further information.</p>
+ <pre>
+ ld &lt; ntpdate/ntpdate
+ ld &lt; ntpd/ntpd
+ ld &lt; ntptrace/ntptrace
+ ld &lt; ntpq/ntpq
+ ld &lt; ntpdc/ntpdc
+ ntpdate (&quot;-b&quot;, &quot;192.168.0.245&quot;)
+ sp(ntpd, &quot;-c&quot;, &quot;/export/home/casey/ntp/ntp.conf&quot;)
+ ntpdc(&quot;-c&quot;, &quot;monlist&quot;, &quot;192.168.0.244&quot;)
+ ntpq(&quot;-c&quot;, &quot;peers&quot;, &quot;192.168.0.244&quot;)
+ ntptrace(&quot;192.168.0.244&quot;)
+ </pre>
+ <p>Casey Crellin, casey@csc.co.za</p>
+ </body>
+
+</html>
diff --git a/html/hints/winnt.html b/html/hints/winnt.html
new file mode 100644
index 0000000..7c41b86
--- /dev/null
+++ b/html/hints/winnt.html
@@ -0,0 +1,90 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <meta name="generator" content="HTML Tidy, see www.w3.org">
+ <title>NTP on Windows NT</title>
+ <link href="../scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+ <body>
+ <h3>NTP 4.x for Windows</h3>
+
+ <h4>Introduction</h4>
+ <p>The NTP 4 distribution runs as service on Windows 2000 and later. It will NOT run on Windows 95, 98, ME, etc. Lately it has been run the most on Windows-7 and later. The binaries work on multi-processor systems. This port has not been tested on the Alpha platform. This release now uses OpenSSL for authentication. IPv6 is not implemented yet for Win32 platforms. A ready-to-run install distribution is available from Meinberg at <a href="http://www.meinberg.de/english/sw/ntp.htm">http://www.meinberg.de/english/sw/ntp.htm.</a></p>
+ <p>Users should note that the stock Windows client sends requests as mode-1 packets, which can have unintended consequences and create a security risk. The client should send requests as mode-3 (client) packets, which conform to the protocol specification. The issues and resolution are described in Microsoft KB 875424. A less desirable alternative that avoids changing registry keys is to use the <tt>--with-wintime</tt> option when building the executable.</p>
+ <h4>Authentication Keys</h4>
+ <p>With this release ntp-keygen is supported. See the <a href="../keygen.html"> ntp keygen documentation</a> for details on how to use ntp-keygen.</p>
+ <p><tt>ntpd</tt> can now use the generated keys in the same way as on Unix platforms. Please refer to the <a href="../authopt.html">Authentication Options</a> for details on how to use these.</p>
+ <p><B>NOTE:</B> ntpd and <tt>ntp-keygen</tt> both use OpenSSL which requires a random
+ character file called <tt>.rnd</tt> by default. Both of these programs will automatically generate this file if they are not found. The programs will look for an environmental variable called RANDFILE and use that for the name of the random character file if the variable exists. If it does not exist it will look for an environmental variable called HOME and use that directory to search for a file called <tt>.rnd</tt> in that directory. Finally, if neither RANDFILE nor HOME exists it will look in <tt>C:\</tt> for a .rnd file. In each case it will search for and create the file if the environmental variable exists or in the C:\ directory if it doesn't.</p>
+ <p>Note that ntpd normally runs as a service so that the only way that it will have either RANDFILE or HOME defined is if it is a System environmental variable or if the service is run under a specific account name and that account has one of those variables defined. Otherwise it will use the file <tt>c:\.rnd</tt>. This was done so that OpenSSL will work normally on Win32 systems. This obviates the need to ship the OpenSSL.exe file and explain how to generate the .rnd file. A future version may change this behavior.</p>
+ <p>Refer to <a href="#Compiling">Compiling Requirements</a> and Instructions for how to compile the program.</p>
+ <h4>Reference Clocks</h4>
+ <p>Reference clock support under Windows NT is tricky because the IO functions are so much different. Some of the clock types have been built into the ntpd executable and should work but have not been tested by the ntp project. If you have a clock that runs on Win32 and the driver is there but not implemented on Win32 you will have make the required configuration changes in config.h and then build ntpd from source and test it. The following reference clock is known to work and is supported by Windows NT: <a href="../drivers/driver1.html">Type 1</a> Undisciplined Local Clock (LOCAL)</p>
+ <h4>Functions Supported</h4>
+ <p>All NTP functions are supported with some constraints. See the <a href="#ToDo">TODO list</a> below. Note that the ntptrace executable is not supported and you should use the PERL script version instead.</p>
+ <h4>Accuracy</h4>
+ <p>Greg Brackley has implemented a fantastic interpolation scheme that improves the precision of the NTP clock using a realtime thread (is that poetic or what!) which captures a tick count from the 8253 counter after each OS tick. The count is used to interpolate the time between operating system ticks.</p>
+ <p>On a typical 200+ MHz system NTP achieves a precision of about 5 microseconds and synchronizes the clock to +/-500 microseconds using the <a href="http://www.trimble.com/products/ntp">Trimble Palisade</a> as UTC reference. This allows distributed applications to use the 10 milliseconds ticks available to them with high confidence.</p>
+ <h4>Binaries</h4>
+ <p>Recent InstallShield based executable versions of NTP for Windows NT (intel) are available from:</p>
+ <ul>
+ <li><a href="http://www.five-ten-sg.com/">http://www.five-ten-sg.com/</a>
+ </ul>
+ <h4 id="ToDo">ToDo</h4>
+ <p>These tasks are in no particular order of priority.</p>
+ <ul>
+ <li>Add IPv6 support
+ <li>See if precision can be improved by using CPU cycle counter for tick interpolation.
+ <li>Make precision time available to applications using NTP_GETTIME API
+ </ul>
+ <h4>Compiling Requirements</h4>
+ <ul>
+ <li>Windows 7 or Windows.NET Server 2003, or later.
+ <li>Windows NT 4.0 Windows 2000, Windows XP or Windows Vista <i>may</i> still work.
+ <li>Microsoft Visual C++ 2008, 2010, or 2013 EE
+ <li>Some way of uncompressing and untarring the gzipped tar file.
+ <li>OpenSSL must be built on the box before building NTP. Additional steps would
+ be required to not use OpenSSL.
+ <li>Microsoft Visual C++ redistributables</ul>
+ <a name="Compiling"><B>Compiling Instructions</B></a>
+ <ol>
+ <li>Install Micosoft Visual C++ <a href="http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF">redistributables</a>
+ <li>Install <a href="http://www.slproweb.com/products/Win32OpenSSL.html">OpenSSL full installer for Windows</a>. Add the following to your system environment variables in the control panel (adjusting paths as appropriate to point to the directory containing only an openssl subdirectory, for OPENSSL_INC, and to the directory containing openssl .lib files for OPENSSL_LIB:
+<ul><li> OPENSSL_INC=C:\OpenSSL\include
+<li> OPENSSL_LIB=C:\OpenSSL\lib</ul>
+ <li>Unpack the NTP-4.x.tar.gz using utilities such as WinZip or WinRar.
+ <li>Run Microsoft Visual C++ 2008 EE.
+ <li>Open the ports\winnt\vs2008\ntp.sln solution file
+ <li>Batch build all projects (Build menu, Batch Build..., select all, build).
+ <li>The built binaries can be found in the <tt>ports\winnt\v2008\Win32-bin\Release</tt> directory.
+ <li>If you are shipping binaries in a kit it is strongly recommended that you ship this file (winnt.html) along with the binaries.
+ </ol>
+ <h4>Configuration File</h4>
+ <p>The default NTP configuration file path is %SystemRoot%<tt>\system32\drivers\etc\. </tt>(%SystemRoot% is an environmental variable that can be determined by typing &quot;set&quot; at the &quot;Command Prompt&quot; or from the &quot;System&quot; icon in the &quot;Control Panel&quot;).</p>
+ <p>Refer to your system environment and create your<tt> ntp.conf</tt> file in the directory corresponding to your system&nbsp; installation. The older <tt>&lt;WINDIR&gt;\ntp.conf</tt> is still supported but you will get a log entry reporting that the first file wasn't found.
+ <h4>Installation Instructions</h4>
+ <p>The <tt>instsrv</tt> program in the instsrv subdirectory of the distribution can be used to install 'ntpd' as a service and start automatically at boot time. Instsrv is automatically compiled with the rest of the distribution if you followed the steps above.</p>
+ <ol>
+ <li>Start a command prompt and enter &quot;instsrv.exe &lt;pathname_for_ntpd.exe&gt;&quot;
+ <li>Clicking on the &quot;Services&quot; icon in the &quot;Control Panel&quot; will display the list of currently installed services in a dialog box. The NetworkTimeProtocol service should show up in this list. Select it in the list and hit the &quot;Start&quot; button in the dialog box. The NTP service should start.
+ <li>You can also stop and start the service by typing net start|stop NetworkTimeProtocol at the DOS prompt.
+ <li>View the event log by clicking on the &quot;Event Viewer&quot; icon in the &quot;Administrative Tools&quot; group, there should be several successful startup messages from NTP. NTP will keep running and restart automatically when the machine is rebooted.
+ </ol>
+ <p>You can change the start mode (automatic/manual) and other startup parameters corresponding to the NTP service in the &quot;Services&quot; dialog box if you wish.</p>
+ <h4>Removing NTP</h4>
+ <p>You can also use <tt>instsrv</tt> to delete the NTP service by entering: <tt>>&quot;instsrv.exe remove&quot;</tt>
+ <h4>Command Line Parameters and Registry Entries</h4>
+ <p>Unlike the Unix environment, there is no clean way to run 'ntpdate' and reset the clock before starting 'ntpd' at boot time. NTP will step the clock up to 1000 seconds by default. While there is no reason that the system clock should be that much off during bootup if <tt>ntpd</tt> was running before, you may wish to override this default and/or pass other command line directives.
+ <p>Use the registry editor to edit the value for the ntpd executable under LocalMachine\System\CurrentControlSet\Services\NTP.</p>
+ <p>Add the -g option to the ImagePath key, behind &quot;%INSTALLDIR&gt;\ntpd.exe&quot;. This will force NTP to accept large time errors (including 1.1.1980 00:00)</p>
+ <h4>Bug Reports</h4>
+ <p>Please follow the <a href="../bugs.html">NTP Bug Reporting Procedures</a> to report bugs or request enhancements.</p>
+ <p>Last update:
+ <!-- #BeginDate format:En2m -->6-Apr-2014 23:27<!-- #EndDate -->
+ </p>
+
+ </body>
+</html>
diff --git a/html/history.html b/html/history.html
new file mode 100644
index 0000000..8b1ad50
--- /dev/null
+++ b/html/history.html
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Historical Notes</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Historical Notes</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:07<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Historical Notes on NTP Upgrades</h4>
+<p>This is an interim report on recent upgrades to the NTPv4 reference implementation code base and documentation. This report documents the upgrade program, which began in June 2007 and continued until March 2008. It is very important to recognize that this historic document describes the upgrade status as of 2008. Additional upgrades have been implemented since then. As of mid 2011, the additional upgrades are documented on the <a href="release.html">NTP Version 4 Release Notes</a> page.</p>
+<p>The motivation for this project was the overhaul and refinement of the code, some of which dates back twenty years. Some four dozen sets of fingers have introduced sometimes incompatible &quot;improvements&quot; that to some degree enhance or burden the product. There has been a continuing effort over the years to maintain the briar patch and pluck the more flagrant weeds, but it now requires a more systematic and thorough examination of purpose, design and implementation. The project is not complete, but far enough along to present a status report and review of significant changes.</p>
+<p>Please note THE CHANGES DO NOT AFFECT THE PROTOCOL SPECIFICATION AND DO NOT AFFECT INTEROPERABILITY WITH PREVIOUS VERSIONS.</p>
+<h4>1. Transparent Design</h4>
+<p>During the project a number of minor inconsistencies in various algorithms were found and resolved. In most cases this did not result in any changes in behavior, just a more simplified, transparent and easier to maintain design. In a few cases behavior has been modified to correct deficiencies and to avoid hostile attacks, as described below.</p>
+<h4>2. Documentation</h4>
+<p>The documentation required a major upgrade. Many pages have been overhauled, some completely rewritten and new ones added. A site map has been added and sorted by page category. A comprehensive command index has been added and sorted by page category. The command index includes a brief gloss for each command. A page has been added to show the various status word and event decodes used for monitoring and event reporting. The decodes show the internal code, ASCII report and short function gloss.</p>
+<p>New pages have been added on association management, automatic server discovery and rate management. Much of the overburden on the program manual and configuration pages has been moved to these pages with the intent of the original pages to contain primarily a functional description for the commands and command line options. This is still an ongoing process.</p>
+<h4>3. Bulletproofing</h4>
+<p>In a continuing mission the code flow has been carefully adjusted to decrease vulnerability to configuration errors and possibly hostile attack. The order of restriction processing was adjusted to deflect access denials as early as possible and without consuming useless processor cycles. This is especially important in rate defense, as the MRU list should only be used for clients that could be legitimately served. In addition, the Autokey protocol was adjusted to avoid some potentially nasty disruption attacks.</p>
+<h4>4. Rate Management</h4>
+<p>Strict rate controls have been refined in both outbound and inbound traffic for both minimum headway (guard time) and minimum average headway. This is a major improvement over the original limitreject design of 1992 and upgrade circa 2003. Headway violations result in an optional <em>kiss-o'-death</em> (KoD) packet. To avoid a clogging vulnerability, the KoD packets are themselves rate controlled for each source address separately.</p>
+<p>The main feature of the revised design is that it is responsive to the server minimum headway and avoids guessing. This is done by setting the ppoll field in the server packet to the maximum of (a) the ppoll field in the client packet and (b) the server headway. The client sets the ppoll field in the association to the maximum of (a) the ppoll field in the server packet and (b) the minpoll field in the association. If this is a KoD and this value is greater than minpoll, minpoll is set to this value. The result is that the client continues sending, but only at headway at least as large as the server.</p>
+<p>The revised design makes possible a decrease in the minimum time constant/poll interval to 3 (8 s), which reduces the risetime to 250 s. This may be useful for rapid convergence when a client is first started, but should not be used for links with moderate to large jitter. This is done using the average option of the discard command, which sets the minimum poll interval and headway from the default 4 (16 s) to a value in the range 3 (8 s) to 6 (64 s). Larger values than 4 might be appropriate for very busy public servers.</p>
+<p>Rate management applies also to Autokey messages. This fixes a problem when iburst and autokey are both in play and when for some reason an association with iburst is repeatedly restarted. This may appear spooky to some folks that frequently restart a client for testing. The server remembers. Further information is in the current web documentation.</p>
+<h4>5. Frequency File</h4>
+<p>Initial frequency training has always been a problem, as it can take a very long time to trim the frequency estimate to nominal values. Once this happens and the frequency file is written, subsequent reboots will restore the frequency and frequency training is avoided. The problem is exacerbated using toll modem services such as ACTS which make a call at each poll interval. Until the training is complete the poll interval is held below the desired maximum as toll charges accrue.</p>
+<p>The problem was solved by changing the clock state machine so that, if no frequency file is available, an initial training interval of 300 s occurs, after which the frequency is directly calculated and the discipline then turned over to the feedback loop. The choice of 300 s is based on the assumption that time can be estimated within 1 ms and the resulting frequency estimate within nominal 1 PPM.</p>
+<p>Note that once the initial time offset is either stepped or slewed, no further time offsets are amortized during the training period. If the frequency error is large, the time offset at the end of the period can be moderately large, which then must be amortized by the feedback loop. While this may take up to an hour and result in a minor frequency tweak, the behavior is very much better than without the initial training. The remedy would require intricate and fragile code revisions.</p>
+<p>In the original design the frequency file was written at one-hour intervals. This apparently makes embedded systems folks nervous, since this can tire the flash NVRAM after several years. The interval between writes now depends on the ambient clock stability and normally maxes out at something over one day unless the frequency takes an unusual twitch. </p>
+<h4>6. Leapseconds</h4>
+<p>The leapsecond processing has been overhauled once again. The problem is to avoid fake leap warnings displayed by an errant server and to insure correct response in case of large time changes which might validate or invalidate arming for a subsequent leap. No leap information is used unless the client is synchronized to a proventic source. The values obtained from an Autokey server or peer are updated if newer than the current values. Server leap warning bits are disregarded if these values are available. If not, and if either a majority of the servers show leap warning bits or if one or more of the survivors are a reference clock with leap warning bit, the leap is armed. If armed by server leap warning bits and these provisions no longer prevail, the leap is disarmed. The NTPv4 protocol specifically does not speak to this issue.</p>
+<p>The leap armed condition is displayed in the host status word. Transitions between warnings and no warnings are reported to the protostats file, system log and traps.</p>
+<h4>7. Orphan Mode and Local Clock Driver</h4>
+<p>The orphan mode code has been overhauled to correct some minor bugs and to clarify operation under normal and recovery conditions. The requirement that all subnet hosts have orphan configuration has been removed. The only requirement is that the orphan clients on the DMZ network sharing the root server(s) be so configured The scheme now works if the root servers are configured with each other, either in symmetric or broadcast modes. Orphan mode is not considered in the NTPv4 protocol specification.</p>
+<p>The local clock driver can be very dangerous when used as a fallback when connectivity to Internet time servers is interrupted. Orphan mode was designed to reduce the need for the local clock driver, as it is active only if no server is available. The local clock driver has been modified to have the same characteristics, regardless of stratum. Only if the host running the local clock driver loses all servers, regardless of stratum, is the driver activated. Thus, it is possible, but not recommended, to run the driver at any stratum, including zero.</p>
+<h4>8. Poll Rate Control</h4>
+<p>One of the most persistent problems is when after long operation and then a failure and then subsequently recovery, a client can take a long time to refresh the clock filter and resynchronize. Once the client has backed off the poll interval after a lengthy outage, it sends polls at that interval until receiving a response. At that time it temporarily retries at the minimum poll interval to fill up the clock filter. If iburst is configured, this will happen after 10 seconds or so and the client then resumes its poll interval required by the discipline time constant. This avoids needless network traffic while the poll interval increases gradually to the maximum. Further information is in the current web documentation.</p>
+<p>The same thing happens on initial startup or when an association is restarted. The intent is to avoid a blast of <tt>iburst</tt> packets unless the server actually responds to the first one and to retry only while responding to the the rate controls.</p>
+<p>In order to speed response to initial startup when a reference clock is available, the clock is set on the first message received from the driver. This exposed an interesting bug, now fixed, with the ACTS modem driver, which began prematurely to ramp up the poll interval.</p>
+<h4>9. Autokey</h4>
+<p>The management of host and group names with respect to Autokey configuration and key generation has been removed and simplified. On host certificates, the subject and issuer fields carry the group name, while other certificates carry the host name, which can be an arbitrary string having nothing to do with the DNS name. This opens up a possible future plan to use the Autokey name rather than the IP address when constructing the session key. It also allows a client to easily switch from one group to another without regenerating the certificate. Further information is in the current web documentation and in the latest Autokey ID.</p>
+<p>Various protocol refinements have been done in the Autokey state machine. A bug was found in symmetric modes where the peer cookies were not EXORed. A bug was found in processing the certificate cache when a participant was a client of two or more server in the same group which themselves had certificate trails to different trusted hosts.</p>
+<p>The protocol machine is now restarted every several days in order to update certificates and leapseconds values when they are changed.</p>
+<h4> 10. Report, Log and Event Codes </h4>
+<p>The status, selection, source, event and log decodes have been adjusted for consistency. Some of the decodes were missing, some with errors and a few new ones added. Old versions of ntpq continue to work without change, but display a new code as space. Except for the new codes, this behavior is consistent with RFC 1305 and proposed for the NTPv4 protocol specification.</p>
+<p>The ntpq as command has been changed to fix some very old bugs. The display is now consistent with the system and peer billboards. The authentication state is correctly displayed for broadcast server associations.</p>
+<p>The event reporting has been cleaned up for more straightforward interpretation by a remote agent. All significant state transitions are reported, including clock state machine changes, mobilization, /demobilization, system and peer restart, system peer change, panic stop and so forth.</p>
+<p>A new protostats monitoring file facility has been added. It works just like the other monitor files. All events are recorded to this file as reported and optionally to the system log. Many reports that sometimes clog up the system log are more usefully directed to this file. The reports also trigger a trap packet that can be sent via an agent to page an administrator.</p>
+<p>When the current mode-6 monitoring protocol was designed circa 1988 the considered intent was that monitoring functions rely only on the NTP packet itself and the system, peer and clock status words provided in the mode-6 packet. While the strongly felt advice at that time was to avoid reformatting the plain ASCII text sent by the server, at various times folks have cheated and reformatted the text. In some places this is good, like displaying the filter shift register; in some places this is bad, like reformatting the timestamps. There is nothing much that can be done about this now without angry mobs rioting when forced to upgrade to a new ntpq. I will not rule this out in future.</p>
+<p>A more serious comment has to do with using other than the NTP packet, status words and events for monitoring purposes. Emphasis added: monitors should not parse such things as the flash codes, clock state or anything else not called out in the NTPv4 specification. The clock state machine is defined in the specification, but no specific numbers are assigned to the states.</p>
+<p>When the numbers were changed to align for reporting purposes, some scripts no longer worked. The scripts should be changed to use only the leap and select fields of the system status word. If the leap field is other than 0, the client has synchronized at least once; if the select field is other than 0, the client is currently synchronized to the source indicated in the decode.</p>
+<h4>11. Two-step and timestamp capture</h4>
+<p>A number of interesting ideas were found in the IEEE 1588 Precision Time Protocol specification. One of them was the two-step protocol in which the transmit timestamp is sent in a following message. However, the PTP design operates only in a master-slave configuration and is not directly usable in NTP. The protocol was adapted to the NTP symmetric design, which requires four state variables rather than two. It is described on <a href="http://www.eecis.udel.edu/~mills/stamp.html">Timestamp Capture Principles</a>. This might be an interesting project for future research.</p>
+<p>A detailed study of the timestamp capture opportunities for both hardware and software timestamping revealed that the most accurate and interoperable design involves the transmit timestamp at the beginning of the packet and then receive timestamp at the end. This makes it possible to accurately measure the offset and delay even if the ends of the synchronization path operate at different rates. It is described on the Timestamp Capture Principles page.</p>
+<h4>12. Windows client bug</h4>
+<p>The Windows XP and Vista clients send the NTP request in symmetric active mode rather than client mode. An unsuspecting server could mobilize a symmetric passive association, which is a serious security vulnerability. The NTPv4 servers, including those at NIST and USNO, discard symmetric active requests unless cryptographically authenticated, so Windows clients do not work. The Microsoft KB 875424 discusses the preferred workaround; however, an optional workaround is now available so that, if the request is not authenticated, the server responds with symmetric passive mode, but without mobilize an association. The workaround is enabled with the WINTIME build option.</p>
+<p>The spec assumes that either peer in symmetric modes can synchronize the other should a peer lose all sources. The workaround violates that assumption and some legitimate configuration might be badly misused. It should be used only with this understanding.</p>
+<h4>13. Autonomous configuration</h4>
+<p>The autonomous configuration (pool and manycast) code was refined to more reliably prune excess servers. If a truechimer is discarded by the clustering algorithm and the total number of survivors is greater than the maxclock option of the tos command, it is considered excess and shows a &quot;#&quot; tally code. If the association is ephemeral and survives the clustering algorithm, the watchdog counter is reset. If the watchdog timer expires and the total number of associations is greater than the maxclock option of the tos command, it is demobilized. This behavior is not considered in the NTPv4 protocol specification.</p>
+<h4>14. Code ornamentation</h4>
+<p>When auditing the code and figuring out its historic origin and evolution, additional commentary has been added so future generations can figure it out, too. </p>
+<p>David L. Mills<br>
+ 17 March 2008<br>
+</p>
+<hr>
+<p><script type="text/javascript" language="javascript" src="scripts/footer.txt"></script></p>
+</body>
+</html>
diff --git a/html/howto.html b/html/howto.html
new file mode 100644
index 0000000..e89fa78
--- /dev/null
+++ b/html/howto.html
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>How to Write a Reference Clock Driver</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>How to Write a Reference Clock Driver</h3>
+<img src="pic/pogo4.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>You need a little magic.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:08<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/misc.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#desc">Description</a></li>
+ <li class="inline"><a href="#file">Files Which Need to be Changed</a></li>
+ <li class="inline"><a href="#intf">Interface Routine Overview</a></li>
+ <li class="inline"><a href="#pps">Pulse-per-Second Interface</a></li>
+</ul>
+<hr>
+<h4 id="desc">Description</h4>
+<p>NTP reference clock support maintains the fiction that the clock is actually an ordinary server in the NTP tradition, but operating at a synthetic stratum of zero. The entire suite of algorithms filter the received data and select the best sources to correct the system clock. No packets are exchanged with a reference clock; however, the transmit, receive and packet procedures are replaced with code to simulate them.</p>
+<p>The driver assumes three timescales: standard time maintained by a distant laboratory such as USNO or NIST, reference time maintained by the external radio and the system time maintained by NTP. The radio synchronizes reference time via radio, satellite or modem. As the transmission means may not always be reliable, most radios continue to provide clock updates for some time after signal loss using an internal reference oscillator. In such cases the radio may or may not reveal the time since last synchronized or the estimated time error.</p>
+<p>All three timescales run only in Coordinated Universal Time (UTC) and are not adjusted for local timezone or standard/daylight time. The local timezone, standard/daylight indicator and year, if provided, are ignored. However, it is important to determine whether a leap second is to be inserted in the UTC timescale in the near future so NTP can insert it in the system timescale at the appropriate epoch.</p>
+<p>The interface routines in the <tt>ntp_refclock.c</tt> source file call the following driver routines via a transfer vector:</p>
+<dl>
+ <dt><tt>startup</tt></dt>
+ <dd>The association has just been mobilized. The driver may allocate a private structure and open the device(s) required.</dd>
+ <dt><tt>shutdown</tt></dt>
+ <dd>The association is about to be demobilized. The driver should close all device(s) and free private structures.</dd>
+ <dt><tt>receive</tt></dt>
+ <dd>A timecode string is ready for retrieval using the <tt>refclock_gtlin()</tt> or <tt>refclock_gtraw()</tt> routines and provide clock updates.</dd>
+ <dt><tt>poll</tt></dt>
+ <dd>Called at poll timeout, by default 64 s. Ordinarily, the driver will send a poll sequence to the radio as required.</dd>
+ <dt><tt>timer</tt></dt>
+ <dd>Called once per second. This can be used for housekeeping functions. In the case with pulse-per-second (PPS) signals, this can be used to process the signals and provide clock updates.</dd>
+</dl>
+<p>The receive routine retrieves a timecode string via serial or parallel port, PPS signal or other means. It decodes the timecode in days, hours, minutes, seconds and nanoseconds and checks for errors. It provides these data along with the on-time timestamp to the <tt>refclock_process</tt> routine, which saves the computed offset in a 60-sample circular buffer. On occasion, either by timeout, sample count or call to the poll routine, the driver calls <tt>refclock_receive</tt> to process the circular buffer samples and update the system clock.</p>
+<p>The best way to understand how the clock drivers work is to study one of the drivers already implemented, such as <tt>refclock_wwvb.c</tt>. The main interface is the <tt>refclockproc</tt> structure, which contains for most drivers the decoded timecode, on-time timestamp, reference timestamp, exception reports and statistics tallies, etc. The support routines are passed a pointer to the <tt>peer</tt> structure, which contains a pointer to the <tt>refclockproc</tt> structure, which in turn contains a pointer to the unit structure, if used. For legacy purposes, a table <tt>typeunit[type][unit]</tt> contains the peer structure pointer for each configured clock type and unit. This structure should not be used for new implementations.</p>
+<p>Radio and modem reference clocks by convention have addresses of the form <tt>127.127.<i>t</i>.<i>u</i></tt>, where <i>t</i> is the clock type and <i>u</i> in the range 0-3 is used to distinguish multiple instances of clocks of the same type. Most clocks require a serial or parallel port or special bus peripheral. The particular device is normally specified by adding a soft link <tt>/dev/device<i>u</i></tt> to the particular hardware device.</p>
+<p>By convention, reference clock drivers are named in the form <tt>refclock_<i>xxxx</i>.c</tt>, where <tt><i>xxxx</i></tt> is a unique string. Each driver is assigned a unique type number, long-form driver name, short-form driver name and device name. The existing assignments are in the <a href="refclock.html">Reference Clock Drivers</a> page and its dependencies. All drivers supported by the particular hardware and operating system are automatically detected in the autoconfigure phase and conditionally compiled.</p>
+<h4>Conventions, Fudge Factors and Flags</h4>
+<p>Most drivers support manual or automatic calibration for systematic offset bias using values encoded in the <tt>fudge</tt> configuration command. By convention, the <tt>time1</tt> value defines the calibration offset in seconds. For those drivers that support statistics collection using the <tt>filegen</tt> utility and the <tt>clockstats</tt> file, the <tt>flag4</tt> switch enables the utility.</p>
+<p>If the calibration feature has been enabled, the <tt>flag1</tt> switch is set and the PPS signal is actively disciplining the system time, the <tt>time1</tt> value is automatically adjusted to maintain a residual offset of zero. Once the its value has stabilized, the value can be inserted in the configuration file and the calibration feature disabled.</p>
+<h4 id="file">Files Which Need to be Changed</h4>
+<p>When a new reference clock driver is installed, the following files need to be edited. Note that changes are also necessary to properly integrate the driver in the configuration and makefile scripts, but these are decidedly beyond the scope of this page.</p>
+<dl>
+ <dt><tt>./include/ntp.h</tt></dt>
+ <dd>The reference clock type defines are used in many places. Each driver is assigned a unique type number. Unused numbers are clearly marked in the list. A unique <tt>REFCLK_<i>xxxx</i></tt> identification code should be recorded in the list opposite its assigned type number.</dd>
+ <dt><tt>./libntp/clocktypes.c</tt></dt>
+ <dd>The <tt>./libntp/clktype</tt> array is used by certain display functions. A unique short-form name of the driver should be entered together with its assigned identification code.</dd>
+ <dt><tt>./ntpd/ntp_control.c</tt></dt>
+ <dd>The <tt>clocktypes</tt> array is used for certain control message displays functions. It should be initialized with the reference clock class assigned to the driver, as per the NTP specification RFC-1305. See the <tt>./include/ntp_control.h</tt> header file for the assigned classes.</dd>
+ <dt><tt>./ntpd/refclock_conf.c</tt></dt>
+ <dd>This file contains a list of external structure definitions which are conditionally defined. A new set of entries should be installed similar to those already in the table. The <tt>refclock_conf</tt> array is a set of pointers to transfer vectors in the individual drivers. The external name of the transfer vector should be initialized in correspondence with the type number.</dd>
+</dl>
+<h4 id="intf">Interface Routine Overview</h4>
+<dl>
+ <dt><tt>refclock_newpeer</tt> - initialize and start a reference clock.</dt>
+ <dd>This routine allocates and initializes the interface structure which supports a reference clock in the form of an ordinary NTP peer. A driver-specific support routine completes the initialization, if used. Default peer variables which identify the clock and establish its reference ID and stratum are set here. It returns one if success and zero if the clock address is invalid or already running, insufficient resources are available or the driver declares a bum rap.</dd>
+ <dt><tt>refclock_unpeer</tt> - shut down a clock</dt>
+ <dd>This routine is used to shut down a clock and return its resources to the system.</dd>
+ <dt><tt>refclock_transmit</tt> - simulate the transmit procedure</dt>
+ <dd>This routine implements the NTP transmit procedure for a reference clock. This provides a mechanism to call the driver at the NTP poll interval, as well as provides a reachability mechanism to detect a broken radio or other madness.</dd>
+ <dt><tt>refclock_process</tt> - insert a sample in the circular buffer</dt>
+ <dd>This routine saves the offset computed from the on-time timestamp and the days, hours, minutes, seconds and nanoseconds in the circular buffer. Note that no provision is included for the year, as provided by some (but not all) radio clocks. Ordinarily, the year is implicit in the Unix file system and hardware/software clock support, so this is ordinarily not a problem.</dd>
+ <dt><tt>refclock_receive</tt> - simulate the receive and packet procedures</dt>
+ <dd>This routine simulates the NTP receive and packet procedures for a reference clock. This provides a mechanism in which the ordinary NTP filter, selection and combining algorithms can be used to suppress misbehaving radios and to mitigate between them when more than one is available for backup.</dd>
+ <dt><tt>refclock_gtraw</tt>, <tt>refclock_gtlin</tt> - read the buffer and on-time timestamp</dt>
+ <dd>These routines return the data received from the clock and the on-time timestamp. The <tt>refclock_gtraw</tt> routine returns a batch of one or more characters returned by the Unix terminal routines in raw mode. The <tt>refclock_gtlin</tt> routine removes the parity bit and control characters and returns all the characters up to and including the line terminator. Either routine returns the number of characters delivered.</dd>
+ <dt><tt>refclock_open</tt> - open a serial port for reference clock</dt>
+ <dd>This routine opens a serial port for I/O and sets default options. It returns the file descriptor if success and zero if failure.</dd>
+ <dt><tt>refclock_ioctl</tt> - set serial port control functions</dt>
+ <dd>This routine attempts to hide the internal, system-specific details of serial ports. It can handle POSIX (<tt>termios</tt>), SYSV (<tt>termio</tt>) and BSD (<tt>sgtty</tt>) interfaces with varying degrees of success. The routine returns one if success and zero if failure.</dd>
+ <dt><tt>refclock_ppsapi</tt></dt>
+ <dd>This routine initializes the Pulse-per-Second interface (see below).</dd>
+ <dt><tt>refclock_pps</tt></dt>
+ <dd>This routine is called once per second to read the latest PPS offset and save it in the circular buffer (see below).</dd>
+</dl>
+<h4 id="pps">Pulse-per-Second Interface</h4>
+<p>When the Pulse-per-Second Application Interface (RFC 2783) is present, a
+ compact PPS interface is available to all drivers. See the <a href="prefer.html">Mitigation
+ Rules and the Prefer Peer</a> page for further information. To use this interface,
+ include the <tt>timeppps.h</tt> and <tt>refclock_atom.h</tt> header files
+ and define the <tt>refclock_atom</tt> structure in the driver private storage.
+ The <tt>timepps.h</tt> file is specific to each operating system and may not
+ be available for some systems.</p>
+<p>To use the interface, call <tt>refclock_ppsapi</tt> from the startup routine
+ passing the device file descriptor and <tt>refclock_atom</tt> structure pointer.
+ Then, call <tt>refclock_pps</tt> from the timer routine passing the association
+ pointer and <tt>refclock_atom</tt> structure pointer. See the <tt>refclock_atom.c</tt> file
+ for examples and calling sequences. If the PPS signal is valid, the offset
+ sample will be save in the circular buffer and a bit set in the association
+ flags word indicating the sample is valid and the driver an be selected as
+ a PPS peer. If this bit is set when the poll routine is called, the driver
+ calls the <tt>refclock_receive</tt> routine to process the samples in the
+ circular buffer and update the system clock.</p>
+<hr>
+<div align="center"> <img src="pic/pogo1a.gif" alt="gif"> </div>
+<br>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/huffpuff.html b/html/huffpuff.html
new file mode 100644
index 0000000..2be4d4a
--- /dev/null
+++ b/html/huffpuff.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>The Huff-n'-Puff Filter</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>The Huff-n'-Puff Filter</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:09<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>In scenarios where a considerable amount of data are downloaded or uploaded using DSL or telephone modem lines, timekeeping quality can be seriously degraded. This occurs because the traffic volume, and thus the queuing delays, on the upload and download directions of transmission can be very different. In many cases the apparent time errors are so large as to exceed the step threshold and a step correction can occur during and after the data transfer.</p>
+<p>The huff-n'-puff filter is designed to correct the apparent time offset in these cases. It depends on knowledge of the propagation delay when no other traffic is present, such as during other than work hours. The filter remembers the minimum delay over the most recent interval measured usually in hours. Under conditions of large delay, the filter corrects the apparent offset using the sign of the offset and the difference between the apparent delay and minimum delay. The name of the filter reflects the negative (huff) and positive (puff) correction, which depends on the sign of the offset. The filter is activated by the <tt>tinker huffpuff</tt> command, as described in the <a href="miscopt.html">Miscellaneous Options</a> page.</p>
+<hr>
+<div align="center"><img src="pic/flt4.gif" alt="gif">
+<p>Figure 1. Huff-n'-Puff Wedge Scattergram</p>
+</div>
+<p>Figure 1 shows how the huff-n'-puff filter works. Recall from the <a href="filter.html">Clock Filter Algorithm</a> page that the wedge scattergram plots sample points (<em>x</em>, <em>y</em>) corresponding to the measured delay and offset, and that the limb lines are at slope &plusmn;0.5. Note in the figure that the samples are clustered close to the upper limb line, representing heavy traffic in the download direction. The apparent offset <i>y</i><sub>0</sub> is near zero at the minimum delay <i>x</i><sub>0</sub>, which is near 0.1s. Thus, for a point (<em>x</em>, <em>y</em>), the true offset is</p>
+<blockquote>
+ <p> &theta; = <em>y</em> <font face="symbol">-</font> (<em>x </em><font face="symbol">- </font><i>x</i><sub>0</sub>) / 2 for <em>y</em> &gt; <i>y</i><sub>0</sub> at or near the upper limb line or<br>
+ &theta; = <em>y</em> <font face="symbol">+</font> (<em>x </em><font face="symbol">- </font><i>x</i><sub>0</sub>) / 2 for <em>y</em> &lt; <i>y</i><sub>0</sub> at or near the lower limb line.</p>
+</blockquote>
+<p>In either case the associated delay is &delta; = <em>x</em>.</p>
+<p>In the interior of the wedge scattergram far from the limb lines, the corrections are less effective and can lead to significant errors if the area between the limb lines is heavily populated.</p>
+<hr>
+<p><script type="text/javascript" language="javascript" src="scripts/footer.txt"></script></p>
+</body>
+</html>
diff --git a/html/icons/home.gif b/html/icons/home.gif
new file mode 100644
index 0000000..e181298
--- /dev/null
+++ b/html/icons/home.gif
Binary files differ
diff --git a/html/icons/mail2.gif b/html/icons/mail2.gif
new file mode 100644
index 0000000..21bc1c4
--- /dev/null
+++ b/html/icons/mail2.gif
Binary files differ
diff --git a/html/icons/sitemap.png b/html/icons/sitemap.png
new file mode 100644
index 0000000..17c7c55
--- /dev/null
+++ b/html/icons/sitemap.png
Binary files differ
diff --git a/html/index.html b/html/index.html
new file mode 100644
index 0000000..d409837
--- /dev/null
+++ b/html/index.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>The Network Time Protocol (NTP) Distribution</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>The Network Time Protocol (NTP) Distribution</h3>
+<img src="pic/barnstable.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html"><i>P.T. Bridgeport Bear</i>; from <i>Pogo</i>, Walt Kelly</a>
+<p>Pleased to meet you.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Mar-2014 05:41<!-- #EndDate -->
+</p>
+<br clear="left">
+<h4>Related Links</h4>
+<ul>
+ <li>A list of all links is on the <a href="sitemap.html">Site Map</a> page.</li>
+</ul>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">Introduction</a></li>
+ <li class="inline"><a href="#hand">The Handbook</a></li>
+ <li class="inline"><a href="#build">Building and Installing NTP</a></li>
+ <li class="inline"><a href="#prob">Resolving Problems</a></li>
+ <li class="inline"><a href="#info">Further Information</a></li>
+</ul>
+<hr>
+<h4 id="intro">Introduction</h4>
+<p>Note: The NTP Version 4 software contained in this distribution is available without charge under the conditions set forth in the <a href="copyright.html">Copyright Notice</a>.</p>
+<dl>
+ <dd>It is very important that readers understand that the NTP document collection began 25 years ago and remains today a work in progress. It has evolved as new features were invented and old features retired. It has been widely copied, cached and morphed to other formats, including man pages, with varying loss of fidelity. However, these HTML pages are the ONLY authoritative and definitive reference. Readers should always use the collection that comes with the distribution they use. A copy of the online collection at <a href="http://www.ntp.org">www.ntp.org</a> is normally included in the most recent snapshot, but might not agree with an earlier snapshot or release version.</dd>
+</dl>
+<p>This distribution is an implementation of RFC-5905 &quot;Network Time Protocol Version 4: Protocol and Algorithms Specification&quot;.<br>
+ NTP is widely used to synchronize a computer to Internet time servers or other sources, such as a radio or satellite receiver or telephone modem service. It can also be used as a server for dependent clients. It provides accuracies typically less than a millisecond on LANs and up to a few milliseconds on WANs. Typical NTP configurations utilize multiple redundant servers and diverse network paths in order to achieve high accuracy and reliability.</p>
+<p>This distribution includes a simulation framework in which substantially all the runtime NTP operations and most features can be tested and evaluated. This has been very useful in exploring in vitro response to unusual circumstances or over time periods impractical in vivo. Details are on the <a href="ntpdsim.html">Network Time Protocol (NTP) Simulator</a> page.</p>
+<h4 id="hand">The Handbook</h4>
+<p>A good deal of tutorial and directive information is available on the handbook pages. These should be read in conjunction with the command and option information available on the pages listed on the sitemap page.</p>
+<dl>
+ <dt><a href="release.html">NTP Version 4 Release Notes</a></dt>
+ <dd>Lists recent changes and new features in the current distribution.</dd>
+ <dt><a href="assoc.html">Association Management</a></dt>
+ <dd>Describes how to configure servers and peers and manage the various options. Includes automatic server discovery schemes.</dd>
+ <dt><a href="discover.html">Automatic Server Discovery Schemes</a></dt>
+ <dd>Describes automatic server discovery using broadcast, multicast, manycast and server pool scheme.</dd>
+ <dt><a href="access.html">Access Control Support</a></dt>
+ <dd>Describes the access control mechanisms that can be used to limit client access to various time and management functions.</dd>
+ <dt><a href="authentic.html">Authentication Support</a></dt>
+ <dd>Describes the authentication mechanisms for symmetric-key and public-key cryptography.</dd>
+ <dt><a href="rate.html">Rate Management</a></dt>
+ <dd>Describes the principles of rate management to minimize network load and defend against DoS attacks.</dd>
+ <dt>&nbsp;</dt>
+ <dt><a href="refclock.html">Reference Clock Support</a></dt>
+ <dd>Describes the collection of radio clocks used to synchronize primary servers.</dd>
+ <dt><a href="warp.html">How NTP Works</a></dt>
+ <dd>Gives an overview of the NTP daemon architecture and how it works.</dd>
+</dl>
+<h4 id="build">Building and Installing NTP</h4>
+<p>NTP supports Unix, VMS and Windows (2000 and later) systems. The <a href="build.html">Building and Installing the Distribution</a> page details the procedures for building and installing on a typical system. This distribution includes drivers for many radio and satellite receivers and telephone modem services in the US, Canada and Europe. A list of supported drivers is on the <a href="refclock.html">Reference Clock Drivers</a> page. The default build includes the debugging options and all drivers that run on the target machine; however, options and drivers can be included or excluded using options on the <a href="config.html">Configuration Options</a> page.</p>
+<h4 id="prob">Resolving Problems</h4>
+<p>Like other things in modern Internet life, NTP problems can be devilishly intricate. This distribution includes a number of utilities designed to identify and repair problems using an integrated management protocol supported by the <a href="ntpq.html"><tt>ntpq</tt></a> utility program. </p>
+<p>The <a href="debug.html">NTP Debugging Techniques</a> and <a href="hints.html">Hints and Kinks</a> pages contain useful information for identifying problems and devising solutions. Additional information on reference clock driver construction and debugging is in the <a href="rdebug.html">Debugging Hints for Reference Clock Drivers</a> page.</p>
+<p>Users are invited to report bugs and offer suggestions via the <a href="bugs.html">NTP Bug Reporting Procedures</a> page.</p>
+<h4 id="info">Further Information</h4>
+<p>The <a href="sitemap.html">Site Map</a> page contains a list of document collections arranged by topic. The Program Manual Pages collection may be the best place to start. The <a href="comdex.html">Command Index</a> collection contains a list of all configuration file commands together with a short function description. A great wealth of additional information is available via the External Links collection, including a book and numerous background papers and briefing presentations.</p>
+<p>Background information on computer network time synchronization is on the <a href="http://www.eecis.udel.edu/%7emills/exec.html">Executive Summary - Computer Network Time Synchronization</a> page. Discussion on new features and interoperability with previous NTP versions is on the <a href="release.html">NTP Version 4 Release Notes</a> page. Background information, bibliography and briefing slides suitable for presentations are on the <a href="http://www.eecis.udel.edu/%7emills/ntp.html">Network Time Synchronization Research Project</a> page. Additional information is at the NTP web site <a href="http://www.ntp.org">www.ntp.org</a>.</p>
+<hr>
+<div align="center"> <img src="pic/pogo1a.gif" alt="gif"></div>
+<br>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/kern.html b/html/kern.html
new file mode 100644
index 0000000..b166045
--- /dev/null
+++ b/html/kern.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Kernel Model for Precision Timekeeping</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Kernel Model for Precision Timekeeping</h3>
+<p><img src="pic/alice61.gif" alt="gif" align="left"> <a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a></p>
+<p>Alice finds the kernel a house of cards.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:10<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/misc.txt"></script>
+<hr>
+<p>The technical report [2], which is a revision and update of an earlier report [3], describes an engineering model for a precision clock discipline function for a generic operating system. The model is the same hybrid phase/frequecy-lock feedback loop used by <tt>ntpd</tt>, but implemented in the kernel. The code described in [2] is included in Solaris and Digital/Compaq/HP Tru64. It provides two system calls <tt>ntp_gettime()</tt> and <tt>ntp_adjtime()</tt> and can discipline the system clock with microsecond resolution. However, newer hardware and kernels with the same system calls can discipline the clock with nanosecond resolution. The new code described in [1] is in FreeBSD, Linux and Tru64. The software and documentation, including a simulator used to verify correct behavior, but not involving licensed code, is available in the <a href="ftp://ftp.udel.edu/pub/ntp/software/nanokernel.tar.gz">nanokernel.tar.gz</a> distribution</p>
+<p>Ordinarily, the kernel clock discipline function is used with the NTP daemon, but could be used for other purposes. The <a href="ntptime.html"><tt>ntptime</tt></a> utility program can be used to control it manually.</p>
+<p>The kernel model also provides support for an external precision timing source, such as described in the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. The new system calls are used by the <a href="kernpps.html">PPSAPI interface</a> and in turn by the <a href="drivers/driver22.html">PPS Clock Discipline</a> driver (type 22) to provide synchronization limited in principle only by the accuracy and stability of the external timing source. Typical results with the PPS signal from a GPS receiver and a modern computer are in the 3 &mu;s range.</p>
+<h4>References</h4>
+<ol>
+ <li>Mills, D.L., and P.-H. Kamp. The nanokernel. <i>Proc. Precision Time and Time Interval (PTTI) Applications and Planning Meeting</i> (Reston VA, November 2000). Paper: <a href="http://www.eecis.udel.edu/%7emills/database/papers/nano/nano2.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/papers/nano/nano2.pdf">PDF</a>, Slides: <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.html">HTML</a> | <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.pdf">PDF</a> | <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.ppt">PowerPoint</a></li>
+ <li>Mills, D.L. Unix kernel modifications for precision time synchronization. Electrical Engineering Department Report 94-10-1, University of Delaware, October 1994, 24 pp. Abstract: <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kerna.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kerna.pdf">PDF</a>, Body: <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kernb.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kernb.pdf">PDF</a></li>
+ <li>Mills, D.L. A kernel model for precision timekeeping. Network Working Group Report RFC-1589, University of Delaware, March 1994. 31 pp. <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1589.txt">ASCII</a></li>
+</ol>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/kernpps.html b/html/kernpps.html
new file mode 100644
index 0000000..b7536bd
--- /dev/null
+++ b/html/kernpps.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>PPSAPI Interface for Precision Time Signals</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>PPSAPI Interface for Precision Time Signals</h3>
+<img src="pic/tonea.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>NBS Special Publication 432, 1979</i></a> (out of print)
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:10<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<p>
+ <script type="text/javascript" language="javascript" src="scripts/misc.txt"></script>
+ <br clear="left">
+</p>
+<hr>
+<h4>Introduction</h4>
+<p>RFC-2783 describes the PPSAPI application programming interface for external precision time signals, such as the pulse-per-second (PPS) signal generated by some radio clocks and cesium oscillators. The PPSAPI provides a generic capability in the ubiquitous Unix kernel which can be used for a wide variety of measurement applications, including network time synchronization and related experiments. The hardware to do this requires only a serial port and a modem control lead, such as the data carrier detect (DCD) lead, which can be driven by an external source via a level converter/pulse generator such as described on the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. In some systems a parallel port can be used for the same purpose.</p>
+<p>The PPSAPI interface defined in RFC-2783 is the only PPS interface supported in NTP Version 4. The PPSAPI is supported in stock FreeBSD and, with the addition of the <tt>PPSkit</tt> kernel module, in Linux.</p>
+<p>The special header file <tt>/usr/include/sys/timepps.h</tt> implements the PPSAPI using whatever primitives are available in each archeticture and operating system. It obsoletes previous APIs based on the <tt>tty_clock</tt> and <tt>ppsclock</tt> line disciplines and streams modules, which are no longer supported.</p>
+<p>The <a href="drivers/driver22.html">PPS Clock Discipline</a> driver (type 22) uses the PPSAPI in conjunction with a local radio clock or remote NTP&nbsp;server as a reference clock. The driver can also use the PPSAPI&nbsp;as an interface directly to the kernel PPS facility as described on the <a href="kern.html">Kernel Model for Precision Timekeeping</a> page.</p>
+<h4>PPSAPI Application Program Interface</h4>
+<p>The PPSAPI interface provides the following functions:</p>
+<dl>
+ <dt><tt>time_pps_create</tt></dt>
+ <dd>Creates a PPS interface instance and returns a handle to it.</dd>
+ <dt><tt>time_pps_destroy</tt></dt>
+ <dd>Destroys a PPS interface and returns the resources used.</dd>
+ <dt><tt>time_pps_setparams</tt></dt>
+ <dd>Sets the parameters associated with a PPS interface instance, including offsets to be automatically added to captured timestamps.</dd>
+ <dt><tt>time_pps_getparams</tt></dt>
+ <dd>Returns the parameters associated with a PPS interface instance.
+ </dd><dt><tt>time_pps_getcap</tt></dt>
+ <dd>Returns the capabilities of the current interface and kernel implementation.</dd>
+ <dt><tt>time_pps_fetch</tt></dt>
+ <dd>Returns the current timestamps associated with a PPS interface instance in either nanoseconds and nanoseconds (Unix <tt>timespec</tt>) or seconds and fraction (NTP) format.</dd>
+ <dt><tt>time_pps_kcbind</tt></dt>
+ <dd>If kernel PPS processing is supported, this binds the support to the associated PPS interface instance.</dd>
+</dl>
+<p>The entire PPS interface functionality is currently provided by inline code in the <tt>timepps.h</tt> header file. While not all implementations support the full PPSAPI specification, they do support all the functions required for the PPS driver described next. The FreeBSD, Linux and Solaris implementations can be used with the stock kernels provided with those systems; however, the Tru64 and SunOS kernels require additional functions not provided in the stock kernels. Solaris users are cautioned that these functions operate improperly in Solaris versions prior to 2.8 with patch Generic_108528-02. Header files for other systems can be found via the web at <a href="ftp://ftp.udel.edu/pub/ntp/software/nanokernel.tar.gz">nanokernel.tar.gz</a>.</p>
+<hr>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/keygen.html b/html/keygen.html
new file mode 100644
index 0000000..191b714
--- /dev/null
+++ b/html/keygen.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntp-keygen - generate public and private keys</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntp-keygen</tt> - generate public and private keys</h3>
+<p><img src="pic/alice23.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>
+<p>Alice holds the key.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:11<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#synop">Synopsis</a></li>
+ <li class="inline"><a href="#descrip">Description</a></li>
+ <li class="inline"><a href="#run">Running the program</a></li>
+ <li class="inline"><a href="#cmd">Command Line Options</a></li>
+ <li class="inline"><a href="#rand">Random Seed File</a></li>
+ <li class="inline"><a href="#fmt">Cryptographic Data Files</a></li>
+ <li class="inline"><a href="#bug">Bugs</a></li>
+</ul>
+<hr>
+<h4 id="synop">Synopsis</h4>
+<p id="intro"><tt>ntp-keygen [ -deGHIMPT ] [ -b <i>modulus</i> ] [ -c [ RSA-MD2 | RSA-MD5 | RSA-SHA
+ | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ] ]
+ [ -C <i>cipher</i> ] [-i <i>group</i> ] [ -l <em>days</em>]
+ [ -m <i>modulus</i> ] [ -p <i>passwd1</i> ] [ -q <i>passwd2</i> ]
+ [ -S [ RSA | DSA ] ] [ -s <i>host</i> ] [ -V <i>nkeys</i> ]</tt></p>
+<h4 id="descrip">Description</h4>
+<p>This program generates cryptographic data files used by the NTPv4 authentication and identity schemes. It can generate message digest keys used in symmetric key cryptography and, if the OpenSSL software library has been installed, it can generate host keys, sign keys, certificates, and identity keys and parameters used by the Autokey public key cryptography. The message digest keys file is generated in a format compatible with NTPv3. All other files are in PEM-encoded printable ASCII format so they can be embedded as MIME attachments in mail to other sites.</p>
+<p>When used to generate message digest keys, the program produces a file containing
+ ten pseudo-random printable ASCII strings suitable for the MD5 message digest algorithm included in the distribution. If the OpenSSL library is installed, it produces an additional ten hex-encoded random bit strings suitable for the SHA1 and other message digest algorithms. The message digest keys file must be distributed and stored using secure means beyond the scope of NTP itself. Besides the keys used for ordinary NTP associations, additional keys can be defined as passwords for the <tt><a href="ntpq.html">ntpq</a></tt> and <tt><a href="ntpdc.html">ntpdc</a></tt> utility programs.</p>
+<p>The remaining generated files are compatible with other OpenSSL applications and other Public Key Infrastructure (PKI) resources. Certificates generated by this program are compatible with extant industry practice, although some users might find the interpretation of X509v3 extension fields somewhat liberal. However, the identity keys are probably not compatible with anything other than Autokey.</p>
+<p>Some files used by this program are encrypted using a private password. The <tt>-p</tt> option specifies the password for local encrypted files and the <tt>-q</tt> option the password for encrypted files sent to remote sites. If no password is specified, the host name returned by the Unix <tt>gethostname()</tt> function, normally the DNS name of the host, is used.</p>
+<p>The <tt>pw</tt> option of the <tt>crypto</tt> configuration command specifies the read password for previously encrypted local files. This must match the local password used by this program. If not specified, the host name is used. Thus, if files are generated by this program without password, they can be read back by <tt>ntpd</tt> without password, but only on the same host.</p>
+<p>Normally, encrypted files for each host are generated by that host and used only by that host, although exceptions exist as noted later on this page. The symmetric keys file, normally called <tt>ntp.keys</tt>, is usually installed in <tt>/etc</tt>. Other files and links are usually installed in <tt>/usr/local/etc</tt>, which is normally in a shared filesystem in NFS-mounted networks and cannot be changed by shared clients. The location of the keys directory can be changed by the <tt>keysdir</tt> configuration command in such cases. Normally, this is in <tt>/etc</tt>.</p>
+<p>This program directs commentary and error messages to the standard error stream <tt>stderr</tt> and remote files to the standard output stream <tt>stdout</tt> where they can be piped to other applications or redirected to files. The names used for generated files and links all begin with the string <tt>ntpkey</tt> and include the file type, generating host and filestamp, as described in the <a href="#fmt">Cryptographic Data Files</a> section below</p>
+<h4 id="run">Running the Program</h4>
+<p>To test and gain experience with Autokey concepts, log in as root and change to the keys directory, usually <tt>/usr/local/etc</tt>. When run for the first time, or if all files with names beginning <tt>ntpkey</tt> have been removed, use the <tt>ntp-keygen </tt>command without arguments to generate a default RSA host key and matching RSA-MD5 certificate with expiration date one year hence. If run again without options, the program uses the existing keys and parameters and generates only a new certificate with new expiration date one year hence.</p>
+<p>Run the command on as many hosts as necessary. Designate one of them as the trusted host (TH) using <tt>ntp-keygen</tt> with the <tt>-T</tt> option and configure it to synchronize from reliable Internet servers. Then configure the other hosts to synchronize to the TH directly or indirectly. A certificate trail is created when Autokey asks the immediately ascendant host towards the TH to sign its certificate, which is then provided to the immediately descendant host on request. All group hosts should have acyclic certificate trails ending on the TH.</p>
+<p>The host key is used to encrypt the cookie when required and so must be RSA type. By default, the host key is also the sign key used to encrypt signatures. A different sign key can be assigned using the <tt>-S</tt> option and this can be either RSA or DSA type. By default, the signature message digest type is MD5, but any combination of sign key type and message digest type supported by the OpenSSL library can be specified using the <tt>-c</tt> option.</p>
+<dd>The rules say cryptographic media should be generated with proventic filestamps, which means the host should already be synchronized before this program is run. This of course creates a chicken-and-egg problem when the host is started for the first time. Accordingly, the host time should be set by some other means, such as eyeball-and-wristwatch, at least so that the certificate lifetime is within the current year. After that and when the host is synchronized to a proventic source, the certificate should be re-generated.</dd>
+<p>Additional information on trusted groups and identity schemes is on the <a href="autokey.html">Autokey Public-Key Authentication</a> page.</p>
+<h4 id="cmd">Command Line Options</h4>
+<dl>
+ <dt><tt>-b <i>modulus</i></tt></dt>
+ <dd>Set the modulus for generating identity keys to <i>modulus</i> bits. The modulus defaults to 256, but can be set from 256 (32 octets) to 2048 (256 octets). Use the larger moduli with caution, as this can consume considerable computing resources and increases the size of authenticated packets.</dd>
+ <dt><tt>-c [ RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ]</tt></dt>
+ <dd>Select certificate digital signature and message digest scheme. Note that RSA schemes must be used with an RSA sign key and DSA schemes must be used with a DSA sign key. The default without this option is <tt>RSA-MD5</tt>. If compatibility with FIPS 140-2 is required, either the <tt>DSA-SHA</tt> or <tt>DSA-SHA1</tt> scheme must be used.</dd>
+ <dt><tt>-C <i>cipher</i></tt></dt>
+ <dd>Select the OpenSSL cipher to use for password-protected keys. The <tt>openssl -h</tt> command provided with OpenSSL displays available ciphers. The default without this option is <tt>des-ede3-cbc</tt>.</dd>
+ <dt><tt>-d</tt></dt>
+ <dd>Enable debugging. This option displays the cryptographic data produced for eye-friendly billboards.</dd>
+ <dt><tt>-e</tt></dt>
+ <dd>Extract the IFF or GQ public parameters from the <tt>IFFkey</tt> or <tt>GQkey</tt> keys file previously specified. Send the unencrypted data to the standard output stream <tt>stdout</tt>.</dd>
+ <dt><tt>-G</tt></dt>
+ <dd>Generate a new encrypted GQ key file for the Guillou-Quisquater (GQ) identity scheme. This option is mutually exclusive with the <tt>-I</tt> and <tt>-V</tt> options.</dd>
+ <dt><tt>-H</tt></dt>
+ <dd>Generate a new encrypted RSA public/private host key file.</dd>
+ <dt><tt>-i <i>group</i></tt></dt>
+ <dd>Set the optional Autokey group name to <tt><i>group</i></tt>. This is used in the identity scheme parameter file names. In that role, the default is the host name if no group is provided. The group name, if specified using <tt>-i</tt> or using <tt>-s</tt> following an <tt>@</tt> character, is also used in certificate subject and issuer names in the form <tt><i>host</i>@<i>group</i></tt> and should match the group specified via <tt>crypto ident</tt> or <tt>server ident</tt> in ntpd's configuration file.</dd>
+ <dt><tt>-I</tt></dt>
+ <dd>Generate a new encrypted IFF key file for the Schnorr (IFF) identity scheme. This option is mutually exclusive with the <tt>-G</tt> and <tt>-V</tt> options.</dd>
+ <dt><tt>-l <i>days</i></tt></dt>
+ <dd>Set the lifetime for certificates to <tt><i>days</i></tt>. The default lifetime is one year (365 d).</dd>
+ <dt><tt>-m <i>modulus</i></tt></dt>
+ <dd>Set the modulus for generating files to <i>modulus</i> bits. The modulus defaults to 512, but can be set from 256 (32 octets) to 2048 (256 octets). Use the larger moduli with caution, as this can consume considerable computing resources and increases the size of authenticated packets.</dd>
+ <dt><tt>-M</tt></dt>
+ <dd>Generate a new keys file containing 10 MD5 keys and 10 SHA keys. An MD5 key is a string of 20 random printable ASCII characters, while a SHA key is a string of 40 random hex digits. The file can be edited using a text editor to change the key type or key content. This option is mutually exclusive with all other option.</dd>
+ <dt><tt>-P</tt></dt>
+ <dd>Generate a new private certificate used by the PC identity scheme. By default, the program generates public certificates. Note: the PC identity scheme is not recommended for new installations.</dd>
+ <dt><tt>-p <i>passwd</i></tt></dt>
+ <dd>Set the password for reading and writing encrypted files to <tt><i>passwd.</i></tt> These include the host, sign and identify key files. By default, the password is the string returned by the Unix <tt>gethostname()</tt> routine.</dd>
+ <dt><tt>-q <i>passwd</i></tt></dt>
+ <dd>Set the password for writing encrypted IFF, GQ and MV identity files redirected to <tt>stdout</tt> to <tt><i>passwd.</i></tt> In effect, these files are decrypted with the <tt>-p</tt> password, then encrypted with the <tt>-q</tt> password. By default, the password is the string returned by the Unix <tt>gethostname()</tt> routine.</dd>
+ <dt><tt>-S [ RSA | DSA ]</tt></dt>
+ <dd>Generate a new encrypted public/private sign key file of the specified type. By default, the sign key is
+ the host key and has the same type. If compatibly with FIPS 140-2 is required,
+ the sign key type must be <tt>DSA</tt>.</dd>
+ <dt><tt>-s <i>host</i>[@<i>group</i>]</tt></dt>
+ <dd>Specify the Autokey host name, where <tt><i>host</i></tt> is the host name and <tt><i>group</i></tt> is the optional group name. The host name, and if provided, group name are used in <tt><i>host</i>@<i>group</i></tt> form as certificate subject and issuer. Specifying <tt>-s @<i>group</i></tt> is allowed, and results in leaving the host name unchanged, as with <tt>-i <i>group</i></tt>. The group name, or if no group is provided, the host name are also used in the file names of IFF, GQ, and MV identity scheme parameter files. If <tt><i>host</i></tt> is not specified, the default host name is the string returned by the <tt>gethostname()</tt> routine.</dd>
+ <dt><tt>-T</tt></dt>
+ <dd>Generate a trusted certificate. By default, the program generates nontrusted certificates.</dd>
+ <dt><tt>-V <i>nkeys</i></tt></dt>
+ <dd>Generate <tt>nkeys</tt> encrypted server keys for the Mu-Varadharajan (MV) identity scheme. This option is mutually exclusive with the <tt>-I</tt> and <tt>-G</tt> options. Note: support for this option should be considered a work in progress.</dd>
+</dl>
+<h4 id="rand">Random Seed File</h4>
+<p>All cryptographically sound key generation schemes must have means to randomize the entropy seed used to initialize the internal pseudo-random number generator used by the OpenSSL library routines. If a site supports <tt>ssh</tt>, it is very likely that means to do this are already available. The entropy seed used by the OpenSSL library is contained in a file, usually called <tt>.rnd</tt>, which must be available when starting the <tt>ntp-keygen</tt> program or <tt>ntpd</tt> daemon.</p>
+<p>The OpenSSL library looks for the file using the path specified by the <tt>RANDFILE</tt> environment variable in the user home directory, whether root or some other user. If the <tt>RANDFILE</tt> environment variable is not present, the library looks for the <tt>.rnd</tt> file in the user home directory. Since both the <tt>ntp-keygen</tt> program and <tt>ntpd</tt> daemon must run as root, the logical place to put this file is in <tt>/.rnd</tt> or <tt>/root/.rnd</tt>. If the file is not available or cannot be written, the program exits with a message to the system log.</p>
+<h4 id="fmt">Cryptographic Data Files</h4>
+<p>File and link names are in the form <tt>ntpkey_<i>key</i>_<i>name</i>.<i>fstamp</i></tt>, where <tt><i>key</i></tt> is the key or parameter type, <tt><i>name</i></tt> is the host or group name and <tt><i>fstamp</i></tt> is the filestamp (NTP seconds) when the file was created). By convention, <em><tt>key</tt></em> names in generated file names include both upper and lower case characters, while <em><tt>key</tt></em> names in generated link names include only lower case characters. The filestamp is not used in generated link names.</p>
+<p>The <em><tt>key</tt></em> name is a string defining the cryptographic key type. Key types include public/private keys <tt>host</tt> and <tt>sign</tt>, certificate <tt>cert</tt> and several challenge/response key types. By convention, client files used for challenges have a <tt>par</tt> subtype, as in the IFF challenge <tt>IFFpar</tt>, while server files for responses have a <tt>key</tt> subtype, as in the GQ response <tt>GQkey</tt>.</p>
+<p>All files begin with two nonencrypted lines. The first line contains the file name in the format <tt>ntpkey_<i>key</i>_<i>host</i>.<i>fstamp</i></tt>. The second line contains the datestamp in conventional Unix <tt>date</tt> format. Lines beginning with <tt>#</tt> are ignored.</p>
+<p>The remainder of the file contains cryptographic data encoded first using ASN.1 rules, then encrypted using the DES-CBC algorithm with given password and finally written in PEM-encoded printable ASCII text preceded and followed by MIME content identifier lines.</p>
+<p>The format of the symmetric keys file, ordinarily named <tt>ntp.keys,</tt> is somewhat different than the other files in the interest of backward compatibility. Ordinarily, the file is generated by this program, but it can be constructed and edited using an ordinary text editor.</p>
+<div align="center">
+ <p><img src="pic/sx5.gif" alt="gif"></p>
+ <p>Figure 1. Typical Symmetric Key File</p>
+</div>
+<p>Figure 1 shows a typical symmetric keys file used by the reference implementation. Each line of the file contains three fields, first an integer between 1 and 65534, inclusive, representing the key identifier used in the <tt>server</tt> and <tt>peer</tt> configuration commands. Next is the key type for the message digest algorithm, which in the absence of the OpenSSL library must be <tt>MD5</tt> to designate the MD5 message digest algorithm. If the OpenSSL library is installed, the key type can be any message digest algorithm supported by that library. However, if compatibility with FIPS 140-2 is required, the key type must be either <tt>SHA</tt> or <tt>SHA1</tt>. The key type can be changed using an ASCII text editor.</p>
+<p> An MD5 key consists of a printable ASCII string less than or equal to 16 characters and terminated by whitespace or a # character. An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which is truncated as necessary.</p>
+<p>Note that the keys used by the <tt>ntpq</tt> and <tt>ntpdc</tt> programs are checked against passwords requested by the programs and entered by hand, so it is generally appropriate to specify these keys in human readable ASCII format.</p>
+<p>The <tt>ntp-keygen</tt> program generates a MD5 symmetric keys file <tt>ntpkey_MD5key_<i>hostname.filestamp</i></tt>. Since the file contains private shared keys, it should be visible only to root and distributed by secure means to other subnet hosts. The NTP daemon loads the file <tt>ntp.keys</tt>, so <tt>ntp-keygen</tt> installs a soft link from this name to the generated file. Subsequently, similar soft links must be installed by manual or automated means on the other subnet hosts. While this file is not used with the Autokey Version 2 protocol, it is needed to authenticate some remote configuration commands used by the <a href="ntpq.html"><tt>ntpq</tt></a> and <a href="ntpdc.html"><tt>ntpdc</tt></a> utilities.</p>
+<h4 id="bug">Bugs</h4>
+<p>It can take quite a while to generate some cryptographic values, from one to several minutes with modern architectures such as UltraSPARC and up to tens of minutes to an hour with older architectures such as SPARC IPC.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/leap.html b/html/leap.html
new file mode 100644
index 0000000..8abec14
--- /dev/null
+++ b/html/leap.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Leap Second Processing</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Leap Second Processing</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:11<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>About every eighteen months the International Earth Rotation Service (IERS) issues a bulletin announcing the insertion of a leap second in the Universal Coordinated Time (UTC) timescale. Ordinarily, this happens at the end of the last day of June or December; but, in principle, it could happen at the end of any month. While these bulletins are available on the Internet at <a href="http://www.iers.org">www.iers.org</a>, advance notice of leap seconds is also available in signals broadcast from national time and frequency stations, in GPS signals and in telephone modem services. Many, but not all, reference clocks recognize these signals and many, but not all, drivers for them can decode the signals and set the leap bits in the timecode accordingly. This means that many, but not all, primary servers can pass on these bits in the NTP packet heard to dependent secondary servers and clients. Secondary servers can pass these bits to their dependents and so on throughout the NTP subnet.</p>
+<p> A leap second is inserted following second 59 of the last minute of the day and becomes second 60 of that day. A leap second is deleted by omitting second 59 of the last minute of the day, although this has never happened and is highly unlikely to happen in future. So far as is known, there are no provisions in the Unix or Windows libraries to account for this occasion other than to affect the conversion of an NTP datestamp or timestamp to conventional civil time.</p>
+<p>When an update is received from a reference clock or downstratum server, the leap bits are inspected for all survivors of the cluster algorithm. If the number of survivors showing a leap bit is greater than half the total number of survivors, a pending leap condition exists until the end of the current month.</p>
+<p>When no means are available to determine the leap bits from a reference clock or downstratum server, a leapseconds file can be downloaded from time.nist.gov and installed using the <a href="miscopt.html#leapfile">leapfile</a> command. The file includes a list of historic leap seconds and the NTP time of insertion. It is parsed by the <tt>ntpd</tt> daemon at startup and the latest leap time saved for future reference. Each time the clock is set, the current time is compared with the last leap time. If the current time is later than the last leap time, nothing further is done. If earlier, the leap timer is initialized with the time in seconds until the leap time and counts down from there. When the leap timer is less than one month, a pending leap condition exists until the end of the current month. If the leapseconds file is present, the leap bits for reference clocks and downstratum servers are ignored.</p>
+<p>If the precision time kernel support is available and enabled, at the beginning of the day of the leap event, the leap bits are set by the Unix <tt>ntp_adjtime()</tt> system call to arm the kernel for the leap at the end of the day. The kernel automatically inserts one second exactly at the time of the leap, after which the leap bits are turned off. If the kernel support is not availed or disabled, the leap is implemented as a crude hack by setting the clock back one second using the Unix <tt>settimeofday() </tt>system call, which effectively repeats the last second. Note however that in any case setting the time backwards by one second does not actually set the system clock backwards, but effectively stalls the clock for one second. These points are expanded in the white paper <a href="http://www.eecis.udel.edu/~mills/leap.html">The NTP Timescale and Leap Seconds</a>. If the leap timer is less than one day, the leap bits are set for dependent servers and clients.</p>
+<p>As an additional feature when the NIST leap seconds file is installed, it is possible to determine the number of leap seconds inserted in UTC since UTC began on 1 January 1972. This represents the offset between International Atomic Time (TAI) and UTC. If the precision time kernel modifications are available and enabled, the TAI offset is available to application programs using the <tt>antipasti()</tt> system call. If the Autokey public-key cryptography feature is installed, the TAI offset is automatically propagated along with other cryptographic media to dependent servers and clients.</p>
+<hr>
+<p><script type="text/javascript" language="javascript" src="scripts/footer.txt"></script></p>
+</body>
+</html>
diff --git a/html/miscopt.html b/html/miscopt.html
new file mode 100644
index 0000000..62f41b6
--- /dev/null
+++ b/html/miscopt.html
@@ -0,0 +1,177 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Miscellaneous Commands and Options</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Miscellaneous Commands and Options</h3>
+<img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>We have three, now looking for more.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/miscopt.txt"></script>
+<hr>
+<h4>Commands and Options</h4>
+<dl>
+ <dt id="broadcastdelay"><tt>broadcastdelay <i>delay</i></tt></dt>
+ <dd>In broadcast and multicast modes, means are required to determine the network delay between the server and client. Ordinarily, this is done automatically by the initial calibration exchanges between the client and server. In some cases, the exchange might not be possible due to network or server access controls. The value of <em><tt>delay</tt></em> is by default zero, in which case the exchange is enabled. If <em><tt>delay</tt></em> is greater than zero, it becomes the roundtrip delay (s), as measured by the Unix <tt>ping</tt> program, and the exchange is disabled. </dd>
+ <dt>&nbsp;</dt>
+ <dt id="driftfile"><tt>driftfile <i>driftfile</i></tt></dt>
+ <dd>This command specifies the complete path and name of the file used to record the frequency of the local clock oscillator. This is the same operation as the <tt>-f</tt> command line option. This command is mutually exclusive with the <tt>freq</tt> option of the <tt>tinker</tt> command.</dd>
+ <dd> If the file exists, it is read at startup in order to set the initial frequency and then updated once per hour or more with the current frequency computed by the daemon. If the file name is specified, but the file itself does not exist, the starts with an initial frequency of zero and creates the file when writing it for the first time. If this command is not given, the daemon will always start with an initial frequency of zero.</dd>
+ <dd>The file format consists of a single line containing a single floating point number, which records the frequency offset measured in parts-per-million (PPM). The file is updated by first writing the current drift value into a temporary file and then renaming this file to replace the old version.</dd>
+ <dt id="enable"><tt>enable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</tt><br>
+ <tt>disable [auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</tt></dt>
+ <dd>Provides a way to enable or disable various system options. Flags not mentioned are unaffected. Note that most of these flags can be modified remotely using <a href="ntpq.html"><tt>ntpq</tt></a> utility program's <tt>:config</tt> and <tt>config-from-file</tt> commands.
+ <dl>
+ <dt><tt>auth</tt></dt>
+ <dd>Enables the server to synchronize with unconfigured peers only if the peer has been correctly authenticated using either public key or private key cryptography. The default for this flag is enable.</dd>
+ <dt><tt>bclient</tt></dt>
+ <dd>Enables the server to listen for a message from a broadcast or multicast server, as in the <tt>multicastclient</tt> command with default address. The default for this flag is disable.</dd>
+ <dt><tt>calibrate</tt></dt>
+ <dd>Enables the calibrate feature for reference clocks. The default for this flag is disable.</dd>
+ <dt><tt>kernel</tt></dt>
+ <dd>Enables the kernel time discipline, if available. The default for this flag is enable if support is available, otherwise disable.</dd>
+ <dt><tt>mode7</tt></dt>
+ <dd>Enables processing of NTP mode 7 implementation-specific requests which are used by the deprecated <tt>ntpdc</tt> program. The default for this flag is disable. This flag is excluded from runtime configuration using <tt>ntpq</tt>. The <tt>ntpq</tt> program provides the same capabilities as <tt>ntpdc</tt> using standard mode 6 requests.</dd>
+ <dt><tt>monitor</tt></dt>
+ <dd>Enables the monitoring facility. See the <a href="ntpq.html"><tt>ntpq</tt> program</a> and the <tt>monstats</tt> and <tt>mrulist</tt> commands, as well as the <a href="accopt.html#discard">Access Control Options</a> for details.
+ The monitoring facility is also enabled by the presence of <a href="accopt.html#limited"><tt>limited</tt></a> in any <tt>restrict</tt> commands. The default for this flag is enable.</dd>
+ <dt><tt>ntp</tt></dt>
+ <dd>Enables time and frequency discipline. In effect, this switch opens and closes the feedback loop, which is useful for testing. The default for this flag is enable.</dd>
+ <dt><tt>stats</tt></dt>
+ <dd>Enables the statistics facility. See the <a href="monopt.html">Monitoring Options</a> page for further information. The default for this flag is enabled. This flag is excluded from runtime configuration using <tt>ntpq</tt>.</dd>
+ </dl>
+ </dd>
+ <dt id="includefile"><tt>includefile <i>includefile</i></tt></dt>
+ <dd>This command allows additional configuration commands to be included from a separate file. Include files may be nested to a depth of five; upon reaching the end of any include file, command processing resumes in the previous configuration file. This option is useful for sites that run <tt>ntpd</tt> on multiple hosts, with (mostly) common options (e.g., a restriction list).</dd>
+ <dt id="interface"><tt>interface [listen | ignore | drop] [all | ipv4 | ipv6 | wildcard | <i>name</i> | <i>address</i>[/<i>prefixlen</i>]]</tt></dt>
+ <dd>This command controls which network addresses <tt>ntpd</tt> opens, and whether input is dropped without processing. The first parameter determines the action for addresses which match the second parameter. That parameter specifies a class of addresses, or a specific interface name, or an address. In the address case, <tt><i>prefixlen</i></tt> determines how many bits must match for this rule to apply. <tt>ignore</tt> prevents opening matching addresses, <tt>drop</tt> causes <tt>ntpd</tt> to open the address and drop all received packets without examination. Multiple <tt>interface</tt> commands can be used. The last rule which matches a particular address determines the action for it. <tt>interface</tt> commands are disabled if any <a href="ntpd.html#--interface"><tt>-I</tt></a>, <a href="ntpd.html#--interface"><tt>--interface</tt></a>, <a href="ntpd.html#--novirtualips"><tt>-L</tt></a>, or <a href="ntpd.html#--novirtualips"><tt>--novirtualips</tt></a> command-line options are used. If none of those options are used and no <tt>interface</tt> actions are specified in the configuration file, all available network addresses are opened. The <tt>nic</tt> command is an alias for <tt>interface</tt>.</dd>
+ <dt id="leapfile"><tt>leapfile <i>leapfile</i></tt></dt>
+ <dd>This command loads the NIST leapseconds file and initializes the leapsecond values for the next leapsecond time, expiration time and TAI offset. The file can be obtained directly from NIST national time servers using <tt>ftp</tt> as the ASCII file <tt>pub/leap-seconds</tt>.</dd>
+ <dd>The <i>leapfile</i> is scanned when <tt>ntpd</tt> processes the <tt>leapfile</tt> directive or when <tt>ntpd</tt> detects that <i>leapfile</i> has changed. <tt>ntpd</tt> checks once a day to see if the <i>leapfile</i> has changed.</dd>
+ <dd>While not strictly a security function, the Autokey protocol provides means to securely retrieve the current or updated leapsecond values from a server.</dd>
+ <dt id="logconfig"><tt>logconfig <i>configkeyword</i></tt></dt>
+ <dd>This command controls the amount and type of output written to the system <tt>syslog</tt> facility or the alternate <tt>logfile</tt> log file. All <i><tt>configkeyword</tt></i> keywords can be prefixed with <tt>=</tt>, <tt>+</tt> and <tt>-</tt>, where <tt>=</tt> sets the <tt>syslogmask</tt>, <tt>+</tt> adds and <tt>-</tt> removes messages. <tt>syslog messages</tt> can be controlled in four classes (<tt>clock</tt>, <tt>peer</tt>, <tt>sys</tt> and <tt>sync</tt>). Within these classes four types of messages can be controlled: informational messages (<tt>info</tt>), event messages (<tt>events</tt>), statistics messages (<tt>statistics</tt>) and status messages (<tt>status</tt>).</dd>
+ <dd>Configuration keywords are formed by concatenating the message class with the event class. The <tt>all</tt> prefix can be used instead of a message class. A message class may also be followed by the <tt>all</tt> keyword to enable/disable all messages of the respective message class. By default, <tt>logconfig</tt> output is set to <tt>allsync</tt>.</dd>
+ <dd>Thus, a minimal log configuration could look like this:</dd>
+ <dd><tt>logconfig=syncstatus +sysevents</tt></dd>
+ <dd>This would just list the synchronizations state of <tt>ntpd</tt> and the major system events. For a simple reference server, the following minimum message configuration could be useful:</dd>
+ <dd><tt>logconfig=syncall +clockall</tt></dd>
+ <dd>This configuration will list all clock information and synchronization information. All other events and messages about peers, system events and so on is suppressed.</dd>
+ <dt id="logfile"><tt>logfile <i>logfile</i></tt></dt>
+ <dd>This command specifies the location of an alternate log file to be used instead of the default system <tt>syslog</tt> facility. This is the same operation as the <tt>-l </tt>command line option.</dd>
+ <dt id="mru"><tt>mru [maxdepth <i>count</i> | maxmem <i>kilobytes</i> | mindepth <i>count</i> | maxage <i>seconds</i> | initalloc <i>count</i> | initmem <i>kilobytes</i> | incalloc <i>count</i> | incmem <i>kilobytes</i>]</tt></dt>
+ <dd>Controls size limits of the monitoring facility Most Recently Used <a href="ntpq.html#mrulist">(MRU) list</a> of client addresses, which is also used by the <a href="accopt.html#discard">rate control facility</a>.
+ <dl>
+ <dt><tt>maxdepth <i>count</i><br>
+ maxmem <i>kilobytes</i></tt></dt>
+ <dd>Equivalent upper limits on the size of the MRU list, in terms of entries or kilobytes. The actual limit will be up to <tt>incalloc</tt> entries or <tt>incmem</tt> kilobytes larger. As with all
+ of the <tt>mru</tt> options offered in units of entries or kilobytes, if both <tt>maxdepth</tt> and <tt>maxmem</tt> are used, the last one used controls. The default is 1024 kilobytes.</dd>
+ <dt><tt>mindepth <i>count</i></tt></dt>
+ <dd>Lower limit on the MRU list size. When the MRU list has fewer than <tt>mindepth</tt> entries, existing entries are never removed to make room for newer ones, regardless of their age.
+ The default is 600 entries.</dd>
+ <dt><tt>maxage <i>seconds</i></tt></dt>
+ <dd>Once the MRU list has <tt>mindepth</tt> entries and an additional client address is to be added to the list, if the oldest entry was updated more than <tt>maxage</tt> seconds ago, that entry
+ is removed and its storage reused. If the oldest entry was updated more recently, the MRU list
+ is grown, subject to <tt>maxdepth</tt>/<tt>maxmem</tt>. The default is 64 seconds.</dd>
+ <dt><tt>initalloc <i>count</i><br>
+ initmem <i>kilobytes</i></tt></dt>
+ <dd>Initial memory allocation at the time the monitoring facility is first enabled, in terms of entries or kilobytes. The default is 4 kilobytes.</dd>
+ <dt><tt>incalloc <i>count</i><br>
+ incmem <i>kilobytes</i></tt></dt>
+ <dd>Size of additional memory allocations when growing the MRU list, in entries or kilobytes. The default is 4 kilobytes.</dd>
+ </dl>
+ </dd>
+ <dt id="nonvolatile"><tt>nonvolatile <i>threshold</i></tt></dt>
+ <dd>Specify the <i><tt>threshold</tt></i> in PPM to write the frequency file, with default 0.1 PPM. The frequency file is inspected each hour. If the difference between the current frequency and the last value written exceeds the threshold, the file is written and the <tt><em>threshold</em></tt> becomes the new threshold value. If the threshold is not exceeded, it is reduced by half. This is intended to reduce the frequency of unnecessary file writes for embedded systems with nonvolatile memory.</dd>
+ <dt id="phone"><tt>phone <i>dial</i> ...</tt></dt>
+ <dd>This command is used in conjunction with the ACTS modem driver (type 18). The arguments consist of a maximum of 10 telephone numbers used to dial USNO, NIST or European time services. The Hayes command ATDT&nbsp;is normally prepended to the number, which can contain other modem control codes as well.</dd>
+ <dt id="reset"><tt>reset [allpeers] [auth] [ctl] [io] [mem] [sys] [timer]</tt></dt>
+ <dd>Reset one or more groups of counters maintained by ntpd and exposed by <tt>ntpq</tt> and <tt>ntpdc</tt>.</dd>
+ <dt id="saveconfigdir"><tt>saveconfigdir <i>directory_path</i></tt></dt>
+ <dd>Specify the directory in which to write configuration snapshots requested with <tt>ntpq</tt>'s <a href="ntpq.html#saveconfig">saveconfig</a> command. If <tt>saveconfigdir</tt> does not appear in the configuration file, saveconfig requests are rejected by ntpd.</dd>
+ <dt id="setvar"><tt>setvar <i>variable</i> [default]</tt></dt>
+ <dd>This command adds an additional system variable. These variables can be used to distribute additional information such as the access policy. If the variable of the form <tt><i>name</i> = <i>value</i></tt> is followed by the <tt>default</tt> keyword, the variable will be listed as part of the default system variables (<tt>ntpq rv</tt> command). These additional variables serve informational purposes only. They are not related to the protocol other that they can be listed. The known protocol variables will always override any variables defined via the <tt>setvar</tt> mechanism. There are three special variables that contain the names of all variable of the same group. The <tt>sys_var_list</tt> holds the names of all system variables. The <tt>peer_var_list</tt> holds the names of all peer variables and the <tt>clock_var_list</tt> holds the names of the reference clock variables.</dd>
+ <dt id="tinker"><tt>tinker [allan <i>allan</i> | dispersion <i>dispersion</i> | freq <i>freq</i> | huffpuff <i>huffpuff</i> | panic <i>panic</i> | step <i>step</i> | stepout <i>stepout</i>]</tt></dt>
+ <dd>This command alters certain system variables used by the clock discipline algorithm. The default values of these variables have been carefully optimized for a wide range of network speeds and reliability expectations. Very rarely is it necessary to change the default values; but, some folks can't resist twisting the knobs. Options are as follows:</dd>
+ <dd>
+ <dl>
+ <dt><tt>allan <i>allan</i></tt></dt>
+ <dd>Specifies the Allan intercept, which is a parameter of the PLL/FLL clock discipline algorithm, in seconds with default 1500 s.</dd>
+ <dt><tt>dispersion <i>dispersion</i></tt></dt>
+ <dd>Specifies the dispersion increase rate in parts-per-million (PPM) with default 15 PPM.</dd>
+ <dt><tt>freq <i>freq</i></tt></dt>
+ <dd>Specifies the frequency offset in parts-per-million (PPM). This option is mutually exclusive with the driftfile command.</dd>
+ <dt><tt>huffpuff <i>huffpuff</i></tt></dt>
+ <dd>Specifies the huff-n'-puff filter span, which determines the most recent interval the algorithm will search for a minimum delay. The lower limit is 900 s (15 min), but a more reasonable value is 7200 (2 hours).See the <a href="huffpuff.html">Huff-n'-Puff Filter</a> page for further information.</dd>
+ <dt><tt>panic <i>panic</i></tt></dt>
+ <dd>Specifies the panic threshold in seconds with default 1000 s. If set to zero, the panic sanity check is disabled and a clock offset of any value will be accepted.</dd>
+ <dt><tt>step <i>step</i></tt></dt>
+ <dd>Specifies the step threshold in seconds. The default without this command is 0.128 s. If set to zero, step adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than 0.5
+ s. Further details are on the <a href="clock.html">Clock State Machine</a> page.</dd>
+ <dt><tt>stepout <i>stepout</i></tt></dt>
+ <dd>Specifies the stepout threshold in seconds. The default without this command is 300 s. Since this option also affects the training and startup intervals, it should not be set less than the default. Further details are on the <a href="clock.html">Clock State Machine</a> page.</dd>
+ </dl>
+ </dd>
+ <dt id="rlimit"><tt>rlimit [memlock <i>Nmegabytes</i> | stacksize <i>N4kPages</i> | filenum <i>Nfiledescriptors</i>]</tt></dt>
+ <dd>This command alters certain process storage allocation limits, and is only available on some operating systems. Options are as follows:</dd>
+ <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>
+ <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>
+ <dd>Specifies the maximum number of file descriptors ntp may have open at the same time. Defaults to system default.</dd>
+ </dl>
+ </dd>
+ <dt id="tos"><tt>tos [beacon <i>beacon</i> | ceiling <i>ceiling</i> | cohort {0 | 1} | floor <i>floor</i> | maxclock <i>maxclock </i>| maxdist <i>maxdist</i> | minclock <i>minclock</i> | mindist <i>mindist </i>| minsane <i>minsane</i> | orphan <i>stratum</i> | orphanwait <em>delay</em>]</tt></dt>
+ <dd>This command alters certain system variables used by the the clock selection and clustering algorithms. The default values of these variables have been carefully optimized for a wide range of network speeds and reliability expectations. Very rarely is it necessary to change the default values; but, some folks can't resist twisting the knobs. It can be used to select the quality and quantity of peers used to synchronize the system clock and is most useful in dynamic server discovery schemes. The options are as follows:</dd>
+ <dd>
+ <dl>
+ <dt><tt>beacon <i>beacon</i></tt></dt>
+ <dd>The manycast server sends packets at intervals of 64 s if less than <tt>maxclock</tt> servers are available. Otherwise, it sends packets at the <i><tt>beacon</tt></i> interval in seconds. The default is 3600 s. See the <a href="discover.html">Automatic Server Discovery</a> page for further details.</dd>
+ <dt><tt>ceiling <i>ceiling</i></tt></dt>
+ <dd>Specify the maximum stratum (exclusive) for acceptable server packets. The default is 16. See the <a href="discover.html">Automatic Server Discovery</a> page for further details.</dd>
+ <dt><tt>cohort { 0 | 1 }</tt></dt>
+ <dd>Specify whether (1) or whether not (0) a server packet will be accepted for the same stratum as the client. The default is 0. See the <a href="discover.html">Automatic Server Discovery</a> page for further details.</dd>
+ <dt><tt>floor <i>floor</i></tt></dt>
+ <dd>Specify the minimum stratum (inclusive) for acceptable server packets. The default is 1. See the <a href="discover.html">Automatic Server Discovery</a> page for further details.</dd>
+ <dt><tt>maxclock <i>maxclock</i></tt></dt>
+ <dd>Specify the maximum number of servers retained by the server discovery schemes. The default is 10. See the <a href="discover.html">Automatic Server Discovery</a> page for further details.</dd>
+ <dt><tt>maxdist <i>maxdistance</i></tt></dt>
+ <dd>Specify the synchronization distance threshold used by the clock selection algorithm. The default is 1.5 s. This determines both the minimum number of packets to set the system clock and the maximum roundtrip delay. It can be decreased to improve reliability or increased to synchronize clocks on the Moon or planets.</dd>
+ <dt><tt>minclock <i>minclock</i></tt></dt>
+ <dd>Specify the number of servers used by the clustering algorithm as the minimum to include on the candidate list. The default is 3. This is also the number of servers to be averaged by the combining algorithm.</dd>
+ <dt><tt>mindist <i>mindistance</i></tt></dt>
+ <dd>Specify the minimum distance used by the selection and anticlockhop
+ algorithm. Larger values increase the tolerance for outliers;
+ smaller values increase the selectivity. The default is .001 s. In some
+ cases, such as reference clocks with high jitter and a PPS signal, it is
+ useful to increase the value to insure the intersection interval is
+ always nonempty.</dd>
+ <dt><tt>minsane <i>minsane</i></tt></dt>
+ <dd>Specify the number of servers used by the selection algorithm as the minimum to set the system clock. The default is 1 for legacy purposes; however, for critical applications the value should be somewhat higher but less than <tt>minclock</tt>.</dd>
+ <dt><tt>orphan <i>stratum</i></tt></dt>
+ <dd>Specify the orphan stratum with default 16. If less than 16 this is the stratum assumed by the root servers. See the <a href="orphan.html">Orphan Mode</a> page for further details.</dd>
+ <dt><tt>orphanwait <em>delay</em></tt></dt>
+ <dd>Specify the delay in seconds from the time all sources are lost until orphan parent mode is enabled with default 300 s (five minutes). During this period, the local clock driver and the modem driver are not selectable, unless marked with the <tt>prefer</tt> keyword. This allows time for one or more primary sources to become reachable and selectable before using backup sources, and avoids transient use of the backup sources at startup.</dd>
+ </dl>
+ </dd>
+ <dt id="trap"><tt>trap <i>host_address</i> [port <i>port_number</i>] [interface <i>interfSace_address</i>]</tt></dt>
+ <dd>This command configures a trap receiver at the given host address and port number for sending messages with the specified local interface address. If the port number is unspecified, a value of 18447 is used. If the interface address is not specified, the message is sent with a source address of the local interface the message is sent through. Note that on a multihomed host the interface used may vary from time to time with routing changes.</dd>
+ <dd>The trap receiver will generally log event messages and other information from the server in a log file. While such monitor programs may also request their own trap dynamically, configuring a trap receiver will ensure that no messages are lost when the server is started.</dd>
+ <dt id="ttl"><tt>ttl <i>hop</i> ...</tt></dt>
+ <dd>This command specifies a list of TTL values in increasing order. up to 8 values can be specified. In manycast mode these values are used in turn in an expanding-ring search. The default is eight multiples of 32 starting at 31.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/monopt.html b/html/monopt.html
new file mode 100644
index 0000000..acf4847
--- /dev/null
+++ b/html/monopt.html
@@ -0,0 +1,566 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Monitoring Options</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Monitoring Commands and Options</h3>
+<img src="pic/pogo8.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html"></a> from <i>Pogo</i>, Walt Kelly</a>
+<p>Pig was hired to watch the logs.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/monopt.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">Naming Conventions</a></li>
+ <li class="inline"><a href="#cmd">Monitoring Commands and Options</a></li>
+ <li class="inline"><a href="#types">File Set Types</a></li>
+</ul>
+<hr>
+<h4 id="intro">Naming Conventions</h4>
+<p>The <tt>ntpd</tt> includes a comprehensive monitoring facility which collects
+ statistical data of various types and writes the data to files associated with
+ each type at defined events or intervals. The files associated with a particular
+ type are collectively called the generation file set for that type. The files
+ in the file set are the members of that set.</p>
+<p>File sets have names specific to the type and generation epoch. The names
+ are constructed from three concatenated elements <i><tt>prefix</tt></i>, <i><tt>filename</tt></i> and <i><tt>suffix</tt></i>:</p>
+<dl>
+ <dt><i><tt>prefix</tt></i></dt>
+ <dd>The directory path specified in the <tt>statsdir</tt> command.</dd>
+ <dt><i><tt>name</tt></i></dt>
+ <dd>The name specified by the <tt>file</tt> option of the <tt>filegen</tt> command.</dd>
+ <dt><i><tt>suffix</tt></i></dt>
+ <dd>A string of elements bdginning with . (dot) followed by a number of elements
+ depending on the file set type.</dd>
+</dl>
+<p>Statistics files can be managed using scripts, examples of which are in the <tt>./scripts</tt> directory.
+ Using these or similar scripts and Unix <tt>cron</tt> jobs, the files can be
+ automatically summarized and archived for retrospective analysis.</p>
+<h4 id="cmd">Monitoring Commands and Options</h4>
+<p>Unless noted otherwise, further information about these commands is on the <a href="decode.html">Event Messages and Status Codes</a> page.</p></a> page.</p><dl>
+ <dt id="filegen"><tt>filegen <i>name</i> [file <i>filename</i>] [type <i>type</i>]
+ [link | nolink] [enable | disable]</tt></dt>
+ <dd>
+ <dl>
+ <dt><i><tt>name</tt></i></dt>
+ <dd>Specifies the file set type from the list in the next section.</dd>
+ <dt><tt>file <i>filename</i></tt></dt>
+ <dd>Specifies the filename prefix. The default is the file set type, such as "loopstats".</dd>
+ <dt><tt>type <i>typename</i></tt></dt>
+ <dd>Specifies the file set interval. The following intervals are supported
+ with default <tt>day</tt>:</dd>
+ <dd>
+ <dl>
+ <dt><tt>none</tt></dt>
+ <dd>The file set is actually a single plain file.</dd>
+ <dt><tt>pid</tt></dt>
+ <dd>One file set member is created for every incarnation of <tt>ntpd</tt>.
+ The file name suffix is the string .<tt>n</tt>, where <tt>n</tt> is the
+ process ID of the <tt>ntpd</tt> server process.</dd>
+ <dt><tt>day</tt></dt>
+ <dd>One file set member is created per day. A day is defined as the period
+ between 00:00 and 23:59 UTC. The file name suffix is the string .<tt>yyyymmdd</tt>,
+ where <tt>yyyy</tt> is the year, <tt>mm</tt> the month of the year and <tt>dd</tt> the
+ day of the month. Thus, member created on 10 December 1992 would have suffix <tt>.19921210</tt>.</dd>
+ <dt><tt>week</tt></dt>
+ <dd>One file set member is created per week. The week is defined as the
+ day of year modulo 7. The file name suffix is the string .<tt>yyyyWww</tt>,
+ where <tt>yyyy</tt> is the year, <tt>W</tt> stands for itself and <tt>ww</tt> the
+ week number starting from 0. For example, The member created on 10 January
+ 1992 would have suffix <tt>.1992W1</tt>.</dd>
+ <dt><tt>month</tt></dt>
+ <dd>One file set member is created per month. The file name suffix is the
+ string .<tt>yyyymm</tt>, where <tt>yyyy</tt> is the year and <tt>mm</tt> the
+ month of the year starting from 1. For example, The member created on 10
+ January 1992 would have suffix <tt>.199201</tt>.</dd>
+ <dt><tt>year</tt></dt>
+ <dd>One file set member is generated per year. The file name suffix is the
+ string .<tt>yyyy</tt>, where <tt>yyyy</tt> is the year. For example, The
+ member created on 1 January 1992 would have suffix <tt>.1992</tt>.</dd>
+ <dt><tt>age</tt></dt>
+ <dd>One file set member is generated every 24 hours of <tt>ntpd</tt> operation.
+ The filename suffix is the string <tt>.adddddddd</tt>, where <tt>a</tt> stands
+ for itself and <tt>dddddddd</tt> is the <tt>ntpd</tt> running time in seconds
+ at the start of the corresponding 24-hour period.</dd>
+ </dl>
+ </dd>
+ <dt><tt>link | nolink</tt></dt>
+ <dd>It is convenient to be able to access the current file set members by
+ file name, but without the suffix. This feature is enabled by <tt>link</tt> and
+ disabled by <tt>nolink</tt>. If enabled, which is the default, a hard link
+ from the current file set member to a file without suffix is created. When
+ there is already a file with this name and the number of links to this file
+ is one, it is renamed by appending a dot, the letter <tt>C</tt>, and the
+ pid of the <tt>ntpd</tt> server process. When the number of links is greater
+ than one, the file is unlinked. This allows the current file to be accessed
+ by a constant name.</dd>
+ <dt><tt>enable | disable</tt></dt>
+ <dd>Enable or disable the recording function, with default <tt>enable</tt>.
+ These options are intended for remote configuration commands.</dd>
+ </dl>
+ </dd>
+ <dt id="statistics"><tt>statistics <i>name</i>...</tt></dt>
+ <dd>Enables writing of statistics records. Currently, eight kinds of
+ statistics are supported: <i>name</i>s specify the file set type(s) from
+ the list in the next section.</dd>
+ <dt id="statsdir"><tt>statsdir <i>directory_path</i></tt></dt>
+ <dd>Specify the directory path prefix for statistics file names.</dd>
+</dl>
+<h4 id="types">File Set Types</h4>
+<dl>
+ <dt><tt>clockstats</tt></dt>
+ <dd>Record reference clock statistics. Each update received from a reference
+ clock driver appends one line to the <tt>clockstats</tt> file set:</dd>
+ <dd><tt>49213 525.624 127.127.4.1 93 226 00:08:29.606 D</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>49213</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>525.624</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>127.127.4.1</tt></td>
+ <td>IP</td>
+ <td>reference clock address</td>
+ </tr>
+ <tr>
+ <td><tt><i>message</i></tt></td>
+ <td>text</td>
+ <td>log message</td>
+ </tr>
+ </table>
+ </dd>
+ <dd>The <tt><i>message</i></tt> field includes the last timecode received in
+ decoded ASCII format, where meaningful. In some cases a good deal of additional
+ information is displayed. See information specific to each reference clock
+ for further details.</dd>
+ <dt><tt>cryptostats</tt></dt>
+ <dd>Record significant events in the Autokey protocol. This option requires
+ the OpenSSL cryptographic software library. Each event appends one line to
+ the <tt>cryptostats</tt> file set:</dd>
+ <dd><tt>49213 525.624 128.4.1.1 <i>message</i></tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>49213</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>525.624</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>128.4.1.1</tt></td>
+ <td>IP</td>
+ <td>source address (<tt>0.0.0.0</tt> for system)</td>
+ </tr>
+ <tr>
+ <td><tt><i>message</i></tt></td>
+ <td>text</td>
+ <td>log message</td>
+ </tr>
+ </table>
+ </dd>
+ <dd>The <tt><i>message</i></tt> field includes the message type and certain
+ ancillary information. See the <a href="authopt.html">Authentication Options</a> page
+ for further information.</dd>
+ <dt><tt>loopstats</tt></dt>
+ <dd>Record clock discipline loop statistics. Each system clock update appends
+ one line to the <tt>loopstats</tt> file set:</dd>
+ <dd><tt>50935 75440.031 0.000006019 13.778 0.000351733 0.013380 6</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>50935</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>75440.031</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>0.000006019</tt></td>
+ <td>s</td>
+ <td>clock offset</td>
+ </tr>
+ <tr>
+ <td><tt>13.778</tt></td>
+ <td>PPM</td>
+ <td>frequency offset</td>
+ </tr>
+ <tr>
+ <td><tt>0.000351733</tt></td>
+ <td>s</td>
+ <td>RMS jitter</td>
+ </tr>
+ <tr>
+ <td><tt>0.013380</tt></td>
+ <td>PPM</td>
+ <td>RMS&nbsp;frequency jitter (aka wander)</td>
+ </tr>
+ <tr>
+ <td><tt>6 </tt></td>
+ <td>log<sub>2</sub> s</td>
+ <td>clock discipline loop time constant</td>
+ </tr>
+ </table>
+ </dd>
+ <dt><tt>peerstats</tt></dt>
+ <dd>Record peer statistics. Each NTP packet or reference clock update received
+ appends one line to the <tt>peerstats</tt> file set:</dd>
+ <dd><tt>48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877
+ 0.000958674</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>48773</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>10847.650</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>127.127.4.1</tt></td>
+ <td>IP</td>
+ <td>source address</td>
+ </tr>
+ <tr>
+ <td><tt>9714</tt></td>
+ <td>hex</td>
+ <td>status word</td>
+ </tr>
+ <tr>
+ <td><tt>-0.001605376</tt></td>
+ <td>s</td>
+ <td>clock offset</td>
+ </tr>
+ <tr>
+ <td><tt>0.000000000 </tt></td>
+ <td>s</td>
+ <td>roundtrip delay</td>
+ </tr>
+ <tr>
+ <td><tt>0.001424877</tt></td>
+ <td>s</td>
+ <td>dispersion</td>
+ </tr>
+ <tr>
+ <td><tt>0.000958674</tt></td>
+ <td>s</td>
+ <td>RMS&nbsp;jitter</td>
+ </tr>
+ </table>
+ </dd>
+ <dd>The status field is encoded in hex format as described in Appendix B of
+ the NTP specification RFC 1305.</dd>
+ <dt><tt>protostats</tt></dt>
+ <dd>Record significant peer, system and [rptpcp; events. Each significant event
+ appends one line to the <tt>protostats</tt> file set:</dd>
+ <dd><tt>49213 525.624 128.4.1.1 963a 8a <i>message</i></tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>49213</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>525.624</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>128.4.1.1</tt></td>
+ <td>IP</td>
+ <td>source address (<tt>0.0.0.0</tt> for system)</td>
+ </tr>
+ <tr>
+ <td><tt>963a</tt></td>
+ <td>code</td>
+ <td>status word</td>
+ </tr>
+ <tr>
+ <td><tt>8a</tt></td>
+ <td>code</td>
+ <td>event message code</td>
+ </tr>
+ <tr>
+ <td><tt><i>message</i></tt></td>
+ <td>text</td>
+ <td>event message</td>
+ </tr>
+ </table>
+ </dd>
+ <dd>The event message code and <tt><i>message</i></tt> field are described on
+ the <a href="decode.html">Event Messages and Status Words</a> page.</dd>
+ <dt><tt>rawstats</tt></dt>
+ <dd>Record timestamp statistics. Each NTP packet received appends one line to
+ the <tt>rawstats</tt> file set:</dd>
+ <dd><tt>56285 54575.160 128.4.1.1 192.168.1.5 3565350574.400229473 3565350574.442385200 3565350574.442436000 3565350575.154505763 0 4 4 1 8 -21 0.000000 0.000320 .PPS.</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>56285</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>54575.160</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>128.4.1.1</tt></td>
+ <td>IP</td>
+ <td>source address</td>
+ </tr>
+ <tr>
+ <td><tt>192.168.1.5</tt></td>
+ <td>IP</td>
+ <td>destination address</td>
+ </tr>
+ <tr>
+ <td><tt>3565350574.400229473</tt></td>
+ <td>NTP&nbsp;s</td>
+ <td>origin timestamp</td>
+ </tr>
+ <tr>
+ <td><tt>3565350574.442385200</tt></td>
+ <td>NTP s</td>
+ <td>receive timestamp</td>
+ </tr>
+ <tr>
+ <td><tt>3565350574.442436000</tt></td>
+ <td>NTP s</td>
+ <td>transmit timestamp</td>
+ </tr>
+ <tr>
+ <td><tt>3565350575.154505763</tt></td>
+ <td>NTP&nbsp;s</td>
+ <td>destination timestamp</td>
+ </tr>
+ <tr>
+ <td><tt>0</tt></td>
+ <td>0: OK, 1: insert pending,<br>2: delete pending, 3: not synced</td>
+ <td>leap warning indicator</td>
+ </tr>
+ <tr>
+ <td><tt>4</tt></td>
+ <td>4 was current in 2012</td>
+ <td>NTP version</td>
+ </tr>
+ <tr>
+ <td><tt>4</tt></td>
+ <td>3: client, 4: server, 5: broadcast</td>
+ <td>mode</td>
+ </tr>
+ <tr>
+ <td><tt>1</tt></td>
+ <td>1-15, 16: not synced</td>
+ <td>stratum</td>
+ </tr>
+ <tr>
+ <td><tt>8</tt></td>
+ <td>log<sub>2</sub> seconds</td>
+ <td>poll</td>
+ </tr>
+ <tr>
+ <td><tt>-21</tt></td>
+ <td>log<sub>2</sub> seconds</td>
+ <td>precision</td>
+ </tr>
+ <tr>
+ <td><tt>0.000000</tt></td>
+ <td>seconds</td>
+ <td>total roundtrip delay to the primary reference clock</td>
+ </tr>
+ <tr>
+ <td><tt>0.000320</tt></td>
+ <td>seconds</td>
+ <td>total dispersion to the primary reference clock</td>
+ </tr>
+ <tr>
+ <td><tt>PPS.</tt></td>
+ <td>IP or text</td>
+ <td>refid, association ID</td>
+ </tr>
+ </table>
+ </dd>
+ <dt><tt>sysstats</tt></dt>
+ <dd>Record system statistics. Each hour one line is appended to the <tt>sysstats</tt> file
+ set in the following format:</dd>
+ <dd><tt>50928 2132.543 3600 81965 0 9546 56 512 540 10 4 147 1</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>50928</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>2132.543</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>3600</tt></td>
+ <td>s</td>
+ <td>time since reset</td>
+ </tr>
+ <tr>
+ <td><tt>81965</tt></td>
+ <td>#</td>
+ <td>packets received</td>
+ </tr>
+ <tr>
+ <td><tt>0</tt></td>
+ <td>#</td>
+ <td>packets for this host</td>
+ </tr>
+ <tr>
+ <td><tt>9546</tt></td>
+ <td>#</td>
+ <td>current versions</td>
+ </tr>
+ <tr>
+ <td><tt>56</tt></td>
+ <td>#</td>
+ <td>old version</td>
+ </tr>
+ <tr>
+ <td><tt>512</tt></td>
+ <td>#</td>
+ <td>access denied</td>
+ </tr>
+ <tr>
+ <td><tt>540</tt></td>
+ <td>#</td>
+ <td>bad length or format</td>
+ </tr>
+ <tr>
+ <td><tt>10</tt></td>
+ <td>#</td>
+ <td>bad authentication</td>
+ </tr>
+ <tr>
+ <td><tt>4</tt></td>
+ <td>#</td>
+ <td>declined</td>
+ </tr>
+ <tr>
+ <td><tt>147</tt></td>
+ <td>#</td>
+ <td>rate exceeded</td>
+ </tr>
+ <tr>
+ <td><tt>1</tt></td>
+ <td>#</td>
+ <td>kiss-o'-death packets sent</td>
+ </tr>
+ </table>
+ </dd>
+ <dt><tt>timingstats</tt></dt>
+ <dd>(Only available when the deamon is compiled with process time debugging
+ support (--enable-debug-timing - costs performance). Record processing time
+ statistics for various selected code paths.</dd>
+ <dd><tt>53876 36.920 10.0.3.5 1 0.000014592 input processing delay</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Item</td>
+ <td>Units</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>53876</tt></td>
+ <td>MJD</td>
+ <td>date</td>
+ </tr>
+ <tr>
+ <td><tt>36.920</tt></td>
+ <td>s</td>
+ <td>time past midnight</td>
+ </tr>
+ <tr>
+ <td><tt>10.0.3.5</tt></td>
+ <td>IP</td>
+ <td>server address</td>
+ </tr>
+ <tr>
+ <td><tt>1</tt></td>
+ <td>#</td>
+ <td>event count</td>
+ </tr>
+ <tr>
+ <td><tt>0.000014592</tt></td>
+ <td>s</td>
+ <td>total time</td>
+ </tr>
+ <tr>
+ <td><tt><i>message</i></tt></td>
+ <td>text</td>
+ <td>code path description (see source)</td>
+ </tr>
+ </table>
+ </dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/msyslog.html b/html/msyslog.html
new file mode 100644
index 0000000..affa088
--- /dev/null
+++ b/html/msyslog.html
@@ -0,0 +1,129 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntpd System Log Messages</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntpd</tt> System Log Messages</h3>
+<img src="pic/flatheads.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
+<p>The log can be shrill at times.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:12<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<p>
+ <script type="text/javascript" language="javascript" src="scripts/install.txt"></script>
+</p>
+<hr>
+<p>You have come here because you found a cryptic message in the system log. This page by no means lists all messages that might be found, since new ones come and old ones go. Generally, however, the most common ones will be found here. They are listed by program module and log severity code in bold: <tt><b>LOG_ERR</b></tt>, <b><tt>LOG_NOTICE</tt></b> and <tt><b>LOG_INFO</b></tt>.</p>
+<p>Most of the time <b><tt>LOG_ERR</tt></b> messages are fatal, but often <tt>ntpd</tt> limps onward in the hopes of discovering more errors. The <tt><b>LOG_NOTICE</b></tt> messages usually mean the time has changed or some other condition that probably should be noticed. The <tt><b>LOG_INFO</b></tt>&nbsp;messages usually say something about the system operations, but do not affect the time.</p>
+<p>In the following a '?' character stands for text in the message. The meaning should be clear from context.</p>
+<h4>Protocol Module</h4>
+<p><tt><b>LOG_ERR</b></tt></p>
+<dl>
+ <dt><tt>buffer overflow ? </tt></dt>
+ <dd>Fatal error. An input packet is too long for processing.</dd>
+</dl>
+<p><tt><b>LOG_NOTICE</b></tt></p>
+<dl>
+ <dt><tt>no reply; clock not set</tt></dt>
+ <dd>In <tt>ntpdate</tt> mode no servers have been found. The server(s) and/or network may be down. Standard debugging procedures apply.</dd>
+</dl>
+<p><tt><b>LOG_INFO</b></tt></p>
+<dl>
+ <dt><tt>proto_config: illegal item ?, value ?</tt></dt>
+ <dd>Program error. Bugs can be reported <a href="bugs.html">here</a>.</dd>
+ <dt><tt>receive:&nbsp;autokey requires two-way communication</tt></dt>
+ <dd>Configuration error on the <tt>broadcastclient</tt> command.</dd>
+ <dt><tt>receive: server <i>server</i> maaximum rate exceeded</tt></dt>
+ <dd>A kiss-o'death packet has been received. The transmit rate is automatically reduced.</dd>
+ <dt><tt>pps sync enabled</tt></dt>
+ <dd>The PPS signal has been detected and enabled.</dd>
+ <dt><tt>transmit: encryption key ? not found</tt></dt>
+ <dd>The encryption key is not defined or not trusted.</dd>
+ <dt><tt>precision = ? usec </tt></dt>
+ <dd>This reports the precision measured for this machine.</dd>
+ <dt><tt>using 10ms tick adjustments</tt></dt>
+ <dd>Gotcha for some machines with dirty rotten clock hardware.</dd>
+ <dt><tt>no servers reachable</tt></dt>
+ <dd>The system clock is running on internal batteries. The server(s) and/or network may be down.</dd>
+</dl>
+<h4>Clock Discipline Module</h4>
+<p><tt><b>LOG_ERR</b></tt></p>
+<dl>
+ <dt><tt>time correction of ? seconds exceeds sanity limit (?); set clock manually to the correct UTC time</tt>.</dt>
+ <dd>Fatal error. Better do what it says, then restart the daemon. Be advised NTP and Unix know nothing about local time zones. The clock must be set to Coordinated Universal Time (UTC). Believe it; by international agreement abbreviations are in French and descriptions are in English.</dd>
+ <dt><tt>sigaction() fails to save SIGSYS trap: ?<br>
+ </tt><tt>sigaction() fails to restore SIGSYS trap: ?</tt></dt>
+ <dt>Program error. Bugs can be reported <a href="bugs.html">here</a>.</dt>
+</dl>
+<p><tt><b>LOG_NOTICE</b></tt></p>
+<dl>
+ <dt><tt>frequency error ? exceeds tolerance 500 PPM</tt></dt>
+ <dd>The hardware clock frequency error exceeds the rate the kernel can correct. This could be a hardware or a kernel problem.</dd>
+ <dt><tt>time slew ? s</tt></dt>
+ <dd>The time error exceeds the step threshold and is being slewed to the correct time. You may have to wait a very long time.</dd>
+ <dt><tt>time reset ? s</tt></dt>
+ <dd>The time error exceeds the step threshold and has been reset to the correct time. Computer scientists don't like this, but they can set the <tt>ntpd -x</tt> option and wait forever.</dd>
+ <dt><tt>kernel time sync disabled ?</tt></dt>
+ <dd>The kernel reports an error. See the codes in the <tt>timex.h</tt> file.</dd>
+ <dt><tt>pps sync disabled</tt></dt>
+ <dd>The PPS signal has died, probably due to a dead radio, broken wire or loose connector.</dd>
+</dl>
+<p><tt><b>LOG_INFO</b></tt></p>
+<dl>
+ <dt><tt>kernel time sync status ? </tt></dt>
+ <dd>For information only. See the codes in the <tt>timex.h</tt> file.</dd>
+</dl>
+<h4>Cryptographic Module</h4>
+<p><tt><b>LOG_ERR</b></tt></p>
+<dl>
+ <dt><tt>cert_parse ?<br>
+ </tt><tt>cert_sign ?<br>
+ </tt><tt>crypto_cert ?<br>
+ </tt><tt>crypto_encrypt ?<br>
+ </tt><tt>crypto_gq ?<br>
+ </tt><tt>crypto_iff ?<br>
+ </tt><tt>crypto_key ?<br>
+ </tt><tt>crypto_mv ?<br>
+ </tt><tt>crypto_setup ?<br>
+ </tt><tt>make_keys ?</tt></dt>
+ <dd>Usually fatal errors. These messages display error codes returned from the OpenSSL library. See the OpenSSL documentation for explanation.</dd>
+ <dt><tt>crypto_setup: certificate ? is trusted, but not self signed.<br>
+ </tt><tt>crypto_setup: certificate ? not for this host<br>
+ </tt><tt>crypto_setup: certificate file ? not found or corrupt<br>
+ </tt><tt>crypto_setup: host key file ? not found or corrupt<br>
+ </tt><tt>crypto_setup: host key is not RSA key type<br>
+ </tt><tt>crypto_setup: random seed file ? not found<br>
+ </tt><tt>rypto_setup: random seed file not specified</tt></dt>
+ <dd>Fatal errors. These messages show problems during the initialization procedure.</dd>
+</dl>
+<p><tt><b>LOG_INFO</b></tt></p>
+<dl>
+ <dt><tt>cert_parse: expired ?<br>
+ </tt><tt>cert_parse: invalid issuer ?<br>
+ </tt><tt>cert_parse: invalid signature ?<br>
+ </tt><tt>cert_parse: invalid subject ?</tt></dt>
+ <dd>There is a problem with a certificate. Operation cannot proceed untill the problem is fixed. If the certificate is local, it can be regenerated using the <tt>ntp-keygen</tt> program. If it is held somewhere else, it must be fixed by the holder.</dd>
+ <dt><tt>crypto_?: defective key<br>
+ </tt><tt>crypto_?: invalid filestamp<br>
+ </tt><tt>crypto_?: missing challenge<br>
+ </tt><tt>crypto_?: scheme unavailable</tt></dt>
+ <dd>There is a problem with the identity scheme. Operation cannot proceed untill the problem is fixed. Usually errors are due to misconfiguration or an orphan association. If the latter, <tt>ntpd</tt> will usually time out and recover by itself.</dd>
+ <dt><tt>crypto_cert: wrong PEM type ?</tt></dt>
+ <dd>The certificate does not have MIME type <tt>CERTIFICATE</tt>. You are probably using the wrong type from OpenSSL or an external certificate authority.</dd>
+ <dt><tt>crypto_ident: no compatible identity scheme found</tt></dt>
+ <dd>Configuration error. The server and client identity schemes are incompatible.</dd>
+ <dt><tt>crypto_tai: kernel TAI update failed</tt></dt>
+ <dd>The kernel does not support this function. You may need a new kernel or patch.</dd>
+ <dt><tt>crypto_tai: leapseconds file ? error ?</tt></dt>
+ <dd>The leapseconds file is corrupt. Obtain the latest file from <tt>time.nist.gov</tt>.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntp-wait.html b/html/ntp-wait.html
new file mode 100644
index 0000000..dcc6a10
--- /dev/null
+++ b/html/ntp-wait.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <meta name="generator" content="HTML Tidy, see www.w3.org">
+ <title>ntp-wait - waits until ntpd is in synchronized state</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+ <body>
+ <h3><tt>ntp-wait</tt> - waits until ntpd is in synchronized state</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->12-Jul-2011 22:03<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Synopsis</h4>
+ <p><tt>ntp-wait [ -v ] [ -n <i>tries</i> ] [ -s <i>seconds</i> ]</tt></p>
+ <h4>Description</h4>
+ <p>The <tt>ntp-wait</tt> program blocks until ntpd is in synchronized state.
+ This can be useful at boot time, to delay the boot sequence
+ until after "ntpd -g" has set the time.
+ <h4>Command Line Options</h4>
+ <dl>
+ <dt><tt>-n <i>tries</i></tt>
+ <dd>Number of tries before giving up. The default is 1000.
+ <dt><tt>-s <i>seconds</i></tt>
+ <dd>Seconds to sleep between tries. The default is 6 seconds.
+ <dt><tt>-v</tt>
+ <dd>Be verbose.
+ </dl>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/ntp_conf.html b/html/ntp_conf.html
new file mode 100644
index 0000000..73d26cd
--- /dev/null
+++ b/html/ntp_conf.html
@@ -0,0 +1,174 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Configuration File Definition (Advanced)</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Configuration File Definition (Advanced)</h3>
+<img src="pic/pogo7.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>Racoon is shooting configuration bugs.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->4-Oct-2010 05:13<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#synopsis">Synopsis</a></li>
+ <li class="inline"><a href="#files">Files</a></li>
+ <li class="inline"><a href="#high-level">High-Level Description</a></li>
+ <li class="inline"><a href="#detailed">Detailed Description</a></li>
+ <li class="inline"><a href="#guidelines">Guidelines for Adding Configuration Commands </a></li>
+</ul>
+<hr>
+<h4 id="synopsis">Synopsis</h4>
+<p>The NTP configuration process is driven by a phrase-structure grammar which is used to specify the format of the configuration commands and the actions needed to build an abstract syntax tree (AST). The grammar is fed to a parser generator (Bison) which produces a parser for the configuration file.</p>
+<p>The generated parser is used to parse an NTP configuration file and check it for syntax and semantic errors. The result of the parse is an AST, which contains a representation of the various commands and options. This AST is then traversed to set up the NTP daemon to the correct configuration.</p>
+<p>This document is intended for developers who wish to modify the configuration code and/or add configuration commands and options. It contains a description of the files used in the configuration process as well as guidelines on how to construct them.</p>
+<h4 id="files">Files</h4>
+<p>A brief description of the files used by the configuration code is given below:</p>
+<table border="1">
+ <tbody>
+ <tr>
+ <th width="179">File</th>
+ <th width="537">Description</th>
+ </tr>
+ <tr>
+ <td valign="top"><b>ntp_config.y</b></td>
+ <td>This file is a Bison source file that contains the phrase-structure grammar and the actions that need to be performed to generate an AST.</td>
+ </tr>
+ <tr>
+ <td valign="top"><b>ntp_config.c</b></td>
+ <td>This file contains the major chunk of the configuration code. It contains all the functions that are called for building the AST as well as the functions that are needed for traversing the AST.</td>
+ </tr>
+ <tr>
+ <td valign="top"><b>ntp_config.h</b></td>
+ <td>This file is the header file for <b>ntp_config.c</b>. It mainly contains the structure definitions needed to build the AST. </td>
+ </tr>
+ <tr>
+ <td valign="top"><b>ntp_scanner.c</b></td>
+ <td>This file contains the code for a simple lexical analyzer. This file is directly included into the <b>ntp_config.c</b> file since this code is only used by the configuration code. The most important function in this file is <tt>yylex</tt>, which is called by the generated parser to get the next token on the input line.</td>
+ </tr>
+ <tr>
+ <td valign="top"><b>ntp_data_structures.c</b></td>
+ <td>This file contains a generic implementation of a priority queue and a simple queue. This code can be used to create a queue for any structure.</td>
+ </tr>
+ <tr>
+ <td valign="top"><b>ntp_data_structures.h</b></td>
+ <td>This header file contains the structure declarations and function prototypes needed to use the data structures defined in <b>ntp_data_structures.c</b>. This file forms the public interface of the data structures.</td>
+ </tr>
+ <tr>
+ <td valign="top"><b>ntp_config.tab.c</b></td>
+ <td>This file is generated by Bison from the <b>ntp_config.y</b> file. This file is also included directly into the configuration code.</td>
+ </tr>
+ </tbody>
+</table>
+<h4 id="high-level">High-Level Description</h4>
+<p>A high-level description of the configuration process showing where all the files fit in is given below:</p>
+<p><img src="pic/description.jpg" alt="JPEG" border="0"></p>
+<p>The scanner reads in an NTP configuration file and converts it into tokens. The Bison generated parser reads these tokens and converts them into an AST. The AST traverser consists of a set of functions that configure parts of NTP on the basis of what is on the tree. A more detailed description of these parts and the files used is given below:</p>
+<h4 id="detailed">Detailed Description</h4>
+<dl>
+ <dt><b>ntp_scanner.c</b></dt>
+ <dd>This file contains the scanner. The scanner is a small program that converts an input NTP configuration file into a set of <b>tokens</b> that correspond to <b>lexemes</b> in the input. Lexemes are strings in the input, delimited by whitespace and/or special characters. Tokens are basically unique integers that represent these lexemes. A different token is generated for each reserved word and special character in the input. There are two main functions in the public interface of this file:</dd>
+ <dt><tt>int yylex</tt>()</dt>
+ <dd>This function is called <tt>yylex</tt> for historical reasons; <tt>lex</tt> is a program that takes a set of regular expressions and generates a scanner that returns tokens corresponding to those regular expressions. The name of the generated function is called <tt>yylex</tt>. We aren't using<b> </b><tt>lex</tt><b> </b>because it requires linking against an external library and we didn't want to increase the compile-time requirements of NTP.</dd>
+ <dd>History lessons aside, this function basically checks to see if the next input character is a special character as defined in the array <tt>char special_char[]</tt>. (The function <tt>int is_special(char ch)</tt>, can be used for this.) If yes, the special character is returned as the token. If not, a set of characters is read until the next whitespace or special character is encountered. This set of characters forms the lexeme; <tt>yylex</tt> then checks whether this lexeme is an integer, a double, an IP address or a reserved word. If yes, the corresponding token is returned. If not, a token for a string is returned as the default token.</dd>
+ <dt><tt>struct state *create_keyword_scanner(struct key_tok *<i>keyword_list</i>)</tt></dt>
+ <dd>This function takes a list of (<i>keyword, token</i>) pairs and converts them into a trie that can recognize the keywords (reserved words). Every time the scanner reads a lexeme, it compares it against the list of reserved words. If it finds a match, it returns the corresponding token for that keyword.</dd>
+ <dt><b>ntp_data_structures.c</b></dt>
+ <dd>This file contains an implementation of a generic priority queue and FIFO queue. By generic, we mean that these queues can hold element of any type (integers, user-defined structs, etc.), provided that these elements are allocated on the heap using the function <tt>void</tt> *<tt>get_node(size_t size)</tt>. Note that the prototype for this function is exactly the same as that of <tt>malloc</tt> and that it can be used in the exact same way. Behind the scenes, <tt>get_node</tt> calls <tt>malloc</tt> to allocate <i>size</i> plus some extra memory needed for bookkeeping. The allocated memory can be freed using the function <tt>void free_node (void *<i>my_node</i>)</tt>. In addition to these two functions, the public interface of this file contains the following functions:</dd>
+ <dt><tt>queue *create_priority_queue(int (*get_order)(void *, void*))</tt></dt>
+ <dd>This function creates a priority queue in which the order of the elements is determined by the <tt>get_order</tt><b> </b>function that is passed as input to the priority queue. The <tt>get_order</tt><b> </b>function should return positive if the priority of the first element is less than the priority of the second element.</dd>
+ <dt><tt>queue *create_queue(void)</tt></dt>
+ <dd>This function creates a FIFO queue. It basically calls the <tt>create_priority_queue</tt> function with the <tt>get_fifo_order</tt><b> </b>function as its argument.</dd>
+ <dt><tt>void destroy_queue(queue *<i>my_queue</i>)</tt></dt>
+ <dd>This function deletes <tt><i>my_queue</i></tt><b> </b>and frees up all the memory allocated to it an its elements.</dd>
+ <dt><tt>int empty(queue *</tt><i><tt>my_queue</tt></i><tt>)</tt></dt>
+ <dd>This function checks to see if <i><tt>my_queue</tt></i> is empty. Returns <tt>true</tt> if <tt><i>my_queue</i></tt> does not have any elements, else it returns false.</dd>
+ <dt><tt>queue *enqueue(queue *<i>my_queue</i>, void *<i>my_node</i>)</tt></dt>
+ <dd>This function adds an element, <i><tt>my_node</tt></i>, to a queue, <i><tt>my_queue</tt></i>. <i><tt>my_node</tt></i> must be allocated on the heap using the <tt>get_node</tt> function instead of <tt>malloc</tt>.</dd>
+ <dt><tt>void *dequeue(queue *<i>my_queue</i>)</tt></dt>
+ <dd>This function returns the element at the front of the queue. This element will be element with the highest priority.</dd>
+ <dt><tt>int get_no_of_elements(queue *<i>my_queue</i>)</tt></dt>
+ <dd>This function returns the number of elements in <tt><i>my_queue</i></tt>.</dd>
+ <dt><tt>void append_queue(queue *<i>q</i>1, queue *<i>q</i>2)</tt></dt>
+ <dd>This function adds all the elements of <tt><i>q</i>2</tt> to <tt><i>q</i>1</tt>. The queue <tt><i>q</i>2</tt> is destroyed in the process.</dd>
+ <dt><b>ntp_config.y</b></dt>
+ <dd>This file is structured as a standard Bison file and consists of three main parts, separated by <tt>%%</tt>:</dd>
+</dl>
+<ol>
+ <li>The prologue and bison declarations: This section contains a list of the terminal symbols, the non-terminal symbols and the types of these symbols.</li>
+ <li>The rules section: This section contains a description of the actual phrase-structure rules that are used to parse the configuration commands. Each rule consists of a left-hand side (LHS), a right-hand side (RHS) and an optional action. As is standard with phrase-structure grammars, the LHS consists of a single non-terminal symbol. The RHS can contain both terminal and non-terminal symbols, while the optional action can consist of any arbitrary C code.</li>
+ <li>The epilogue: This section is left empty on purpose. It is traditionally used to code the support functions needed to build the ASTs Since, we have moved all the support functions to <b>ntp_config.c</b>, this section is left empty.</li>
+</ol>
+<h4>Prologue and Bison Declarations</h4>
+<p>All the terminal symbols (also known as tokens) have to be declared in the prologue section. Note that terminals and non-terminals may have values associated with them and these values have types. (More on this later). An unnamed union has to be declared with all the possible types at the start of the prologue section. For example, we declare the following union at the start of the <b>ntp_config.y</b> file:</p>
+<p class="style1"><tt>%union {<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;char *String;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;double Double;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;int Integer;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;void *VoidPtr;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;queue *Queue;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;struct attr_val *Attr_val;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;struct address_node *Address_node;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;struct setvar_node *Set_var;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;/* Simulation types */<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;server_info *Sim_server;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;script_info *Sim_script;<br>
+ }</tt></p>
+<p>Some tokens may not have any types. For example, tokens that correspond to reserved words do not usually have types as they simply indicate that a reserved word has been read in the input file. Such tokens have to be declared as follows:</p>
+<p><tt>%token T_Discard<br>
+ %token T_Dispersion</tt></p>
+<p>Other tokens do have types. For example, a <tt>T_Double</tt> token is returned by the scanner whenever it sees a floating-point double in the configuration file. The value associated with the token is the actual number that was read in the configuration file and its type (after conversion) is double. Hence, the token <tt>T_Double</tt> will have to be declared as follows in the prologue of <b>ntp_config.y</b> file:</p>
+<p><tt>%token &lt;Double&gt; T_Double </tt></p>
+<p>Note that the declaration given in the angled brackets is not <tt>double</tt> but <tt>Double</tt>, which is the name of the variable given in the <tt>%union {}</tt> declaration above.</p>
+<p>Finally, non-terminal symbols may also have values associated with them, which have types. This is because Bison allows non-terminal symbols to have actions associated with them. Actions may be thought of as small functions which get executed whenever the RHS of a non-terminal is detected. The return values of these functions are the values associated with the non-terminals. The types of the non-terminals are specified with a <tt>%type</tt> declaration as shown below:</p>
+<p><tt>%type &lt;Queue&gt; address_list<br>
+ %type &lt;Integer&gt; boolean</tt></p>
+<p>The <tt>%type</tt> declaration may be omitted for non-terminals that do not return any value and do not have type information associated with them.</p>
+<h4>The Rules Section </h4>
+<p>The rule section only consists of phrase-structure grammar rules. Each rule typically has the following format:</p>
+<p><tt>LHS : RHS [{ Actions }]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;;</tt></p>
+<p>where LHS consists of a single non-terminal symbol and the RHS consists of one or more terminal and non-terminal symbols. The <tt>Actions</tt> are optional and may consist of any number of arbitrary C statements. Note that Bison can only process LALR(1) grammars, which imposes additional restrictions on the kind of rules that can be specified. Examples of rules are shown below:</p>
+<p><tt>orphan_mode_command<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;: T_Tos tos_option_list<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ append_queue(my_config.orphan_cmds, $2); }<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;;</tt></p>
+<p><tt>tos_option_list<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;: tos_option_list tos_option { $$ = enqueue($1, $2); }<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;| tos_option { $$ = enqueue_in_new_queue($1); }<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;;</tt></p>
+<p>The <tt>$n</tt> notation, where <tt>n</tt> is an integer, is used to refer to the value of a terminal or non-terminal symbol. All terminals and non-terminal symbols within a particular rule are numbered (starting from 1) according to the order in which they appear within the RHS of a rule. <tt>$$</tt> is used to refer to the value of the LHS terminal symbol - it is used to return a value for the non-terminal symbol specified in the LHS of the rule.</p>
+<h4>Invoking Bison </h4>
+<p>Bison needs to be invoked in order to convert the <b>ntp_config.y</b> file into a C source file. To invoke Bison, simply enter the command:</p>
+<p><tt>bison ntp_config.y</tt></p>
+<p>at the command prompt. If no errors are detected, an <b>ntp_config.tab.c</b> file will be generated by default. This generated file can be directly included into the <b>ntp_config.c</b> file.</p>
+<p>If Bison report shift-reduce errors or reduce-reduce errors, it means that the grammar specified using the rules in not LALR(1). To debug such a grammar, invoke Bison with a <tt>-v</tt> switch, as shown below. This will generate a <b>ntp_config.output</b> file, which will contain a description of the generated state machine, together with a list of states that have shift-reduce/reduce-reduce conflicts. You can then change the rules to remove such conflicts.</p>
+<p><tt>bison -v ntp_config.y</tt></p>
+<p>For more information, refer to the <a href="http://www.gnu.org/software/bison/manual/html_mono/bison.html">Bison manual</a>.</p>
+<p><b>ntp_config.c</b></p>
+<p>This file contains the major chunk of the configuration code including all the support functions needed for building and traversing the ASTs. As such, most of the functions in this file can be divided into two groups:</p>
+<ol>
+ <li>Functions that have a <tt>create_</tt> prefix. These functions are used to build a node of the AST.</li>
+ <li>Functions that have a <tt>config_</tt> prefix. These functions are used to traverse the AST and configure NTP according to the nodes present on the tree.</li>
+</ol>
+<h4 id="guidelines">Guidelines for Adding Configuration Commands</h4>
+<p>The following steps may be used to add a new configuration command to the NTP reference implementation:</p>
+<ol>
+ <li>Write phrase-structure grammar rules for the syntax of the new command. Add these rules to the rules section of the <b>ntp_config.y</b> file. </li>
+ <li>Write the action to be performed on recognizing the rules. These actions will be used to build the AST.</li>
+ <li>If new reserved words are needed, add these to the <tt>struct key_tok keyword_list[]</tt>structure in the <b>ntp_config.c </b>file. This will allow the scanner to recognize these reserved words and generate the desired tokens on recognizing them.</li>
+ <li>Specify the types of all the terminals and non-terminal symbols in the prologue section of the <b>ntp_config.c</b> file.</li>
+ <li>Write a function with a <tt>config_</tt> prefix that will be executed for this new command. Make sure this function is called in the <tt>config_ntpd()</tt>function.</li>
+</ol>
+<hr>
+<address>
+<a href="mailto:skamboj@udel.edu">Sachin Kamboj</a>
+</address>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntpd.html b/html/ntpd.html
new file mode 100644
index 0000000..418d199
--- /dev/null
+++ b/html/ntpd.html
@@ -0,0 +1,176 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntpd - Network Time Protocol (NTP) daemon</title>
+<!-- Changed by: Harlan &, 10-Feb-2014 -->
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntpd</tt> - Network Time Protocol (NTP) Daemon</h3>
+<img src="pic/wingdorothy.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a>
+<p>You need help from the monkeys.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:14<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#synop">Synopsis</a></li>
+ <li class="inline"><a href="#descr">Description</a></li>
+ <li class="inline"><a href="#cmd">Command Line Options</a></li>
+ <li class="inline"><a href="#cfg">The Configuration File</a></li>
+ <li class="inline"><a href="#files">Files</a></li>
+</ul>
+<hr>
+<h4 id="synop">Synopsis</h4>
+<tt>ntpd [ -46aAbdDgLmnNqx ] [ -c <i>conffile</i> ] [ -f <i>driftfile</i> ] [ -i <i>jaildir</i> ] [ -I <i>InterfaceOrAddress</i> ] [ -k <i>keyfile</i> ] [ -l <i>logfile</i> ] [ -p <i>pidfile</i> ] [ -P <i>priority</i> ] [ -r <i>broadcastdelay</i> ] [ -s <i>statsdir</i> ] [ -t <i>key</i> ] [ -u <i>user</i>[:<i>group</i>] ] [ -U <i>interface_update_interval</i> ] [ -v <i>variable</i> ] [ -V <i>variable</i> ]</tt>
+<h4 id="descr">Description</h4>
+<p>The <tt>ntpd</tt> program is an operating system daemon that synchronizes the system clock to remote NTP time servers or local reference clocks. It is a complete implementation of NTP version 4 defined by RFC-5905, but also retains compatible with version 3 defined by RFC-1305 and versions 1 and 2, defined by RFC-1059 and RFC-1119, respectively. 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>
+<p>The <tt>ntpd</tt> program ordinarily requires a configuration file described on this page. It contains configuration commands described on the pages listed above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the </p>
+<p>The <tt>ntpd</tt> program normally operates continuously while adjusting the system time and frequency, but in some cases this might not be practical. With the <tt>-q</tt> option <tt>ntpd</tt> operates as in continuous mode, but exits just after setting the clock for the first time. Most applications will probably want to specify the <tt>iburst</tt> option with the <tt>server</tt> command. With this option a volley of messages is exchanged to groom the data and set the clock in about ten seconds. If nothing is heard after a few minutes, the daemon times out and exits without setting the clock.</p>
+<h4 id="cmd">Command Line Options</h4>
+<dl>
+ <dt><tt>-4</tt>
+ <dd>Force DNS resolution of host names to the IPv4 namespace.
+ <dt><tt>-6</tt>
+ <dd>Force DNS resolution of host names to the IPv6 namespace.
+ <dt><tt>-a</tt></dt>
+ <dd>Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>enable auth</tt> command and is the default.</dd>
+ <dt><tt>-A</tt></dt>
+ <dd>Do not require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>disable auth</tt> command and almost never a good idea.</dd>
+ <dt><tt>-b</tt></dt>
+ <dd>Enable the client to synchronize to broadcast servers.</dd>
+ <dt><tt>-c <i>conffile</i></tt></dt>
+ <dd>Specify the name and path of the configuration file. Without the option the default is <tt>/etc/ntp.conf</tt>.</dd>
+ <dt><tt>-d</tt></dt>
+ <dd> Disable switching into daemon mode, so <tt>ntpd</tt> stays attached to the starting terminal which will get all the debugging printout. Also, ^C will kill it. This option may occur more than once, with each occurrence indicating greater detail of display.</dd>
+ <dt><tt>-D <i>level</i></tt></dt>
+ <dd>Specify debugging level directly, with <tt>level</tt> corresponding to the numbe of <tt>-d</tt> options..</dd>
+ <dt><tt>-f <i>driftfile</i></tt></dt>
+ <dd>Specify the name and path of the frequency file. This is the same operation as the <tt>driftfile <i>driftfile</i></tt> configuration command.
+ <dt><tt>-g</tt></dt>
+ <dd>Normally, <tt>ntpd</tt> exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, <tt>ntpd</tt> will exit with a message to the system log. This option can be used with the <tt>-q</tt> and <tt>-x</tt> options. See the <tt>tinker</tt> command for other options.</dd>
+ <dt><tt>-i <i>jaildir</i></tt></dt>
+ <dd>Chroot the server to the directory <i><tt>jaildir</tt></i>. This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges. You may need to also specify a <tt>-u</tt> option.</dd>
+ <dt id="--interface"><tt>-I [<i>address</i> | <i>interface name</i>]</tt></dt>
+ <dd>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 <a href="miscopt.html#interface">interface</a> command, which is more versatile.</dd>
+ <dt><tt>-k <i>keyfile</i></tt></dt>
+ <dd>Specify the name and path of the symmetric key file. This is the same operation as the <tt>keys <i>keyfile</i></tt> command.</dd>
+ <dt><tt>-l <i>logfile</i></tt></dt>
+ <dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> command.</dd>
+ <dt id="--mdns"><tt>-m</tt></dt>
+ <dd>Once the system clock is synchronized, register with mDNS as an available server.</dd>
+ <dt id="--novirtualips"><tt>-L</tt></dt>
+ <dd>Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.</dd>
+ <dt><tt>-M</tt></dt>
+ <dd>Raise scheduler precision to its maximum (1 ms) using timeBeginPeriod. (Windows only)</dd>
+ <dt><tt>-n</tt></dt>
+ <dd>Don't fork.</dd>
+ <dt><tt>-N</tt></dt>
+ <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the highest priority.</dd>
+ <dt><tt>-p <i>pidfile</i></tt></dt>
+ <dd>Specify the name and path of the file used to record the <tt>ntpd</tt> process ID. This is the same operation as the <tt>pidfile <i>pidfile</i></tt> command.</dd>
+ <dt><tt>-P <i>priority</i></tt></dt>
+ <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the specified priority.</dd>
+ <dt><tt>-q</tt></dt>
+ <dd>Exit the <tt>ntpd</tt> just after the first time the clock is set. This behavior mimics that of the <tt>ntpdate</tt> program, which is to be retired. The <tt>-g</tt> and <tt>-x</tt> options can be used with this option. Note: The kernel time discipline is disabled with this option.</dd>
+ <dt><tt>-r <i>broadcastdelay</i></tt></dt>
+ <dd>Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.</dd>
+ <dt><tt>-s <i>statsdir</i></tt></dt>
+ <dd>Specify the directory path for files created by the statistics facility. This is the same operation as the <tt>statsdir <i>statsdir</i></tt> command.</dd>
+ <dt><tt>-t <i>key</i></tt></dt>
+ <dd>Add a key number to the trusted key list. This option can occur more than once. This is the same operation as the <tt>trustedkey <i>key</i></tt> command.</dd>
+ <dt><tt>-u <i>user[:group]</i> </tt></dt>
+ <dd>Specify a user, and optionally a group, to switch to. This option is only available if the OS supports running the server without full root privileges. Currently, this option is supported under NetBSD (configure with <tt>--enable-clockctl</tt>) and Linux (configure with --<tt>enable-linuxcaps</tt>).</dd>
+ <dt><tt>-U <i>interface update interval</i></tt></dt>
+ <dd>Number of seconds to wait between interface list scans to pick up old and delete network interface. Set to 0 to disable dynamic interface list updating. The default is to scan every 5 minutes.</dd>
+ <dt><tt>-v <i>variable</i></tt><br>
+ <tt>-V <i>variable</i></tt></dt>
+ <dd>Add a system variable listed by default.</dd>
+ <dt><tt>-x</tt></dt>
+ <dd>Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the <tt>-g</tt> and <tt>-q</tt> options. See the <tt>tinker</tt> command for other options. Note: The kernel time discipline is disabled with this option.</dd>
+ <dt><tt>--pccfreq <i>frequency</i></tt></dt>
+ <dd>Substitute processor cycle counter for QueryPerformanceCounter unconditionally
+ using the given frequency (in Hz). <tt>--pccfreq</tt> can be used on systems
+ which do not use the PCC to implement QueryPerformanceCounter
+ and have a fixed PCC frequency. The frequency specified must
+ be accurate within 0.5 percent. <tt>--usepcc</tt> is equivalent on many systems and should
+ be tried first, as it does not require determining the frequency
+ of the processor cycle counter. For x86-compatible processors, the PCC is
+ also referred to as <tt>RDTSC</tt>, which is the assembly-language instruction to retrieve
+ the current value.&nbsp; (Windows only)</dd>
+ <dt><tt>--usepcc</tt></dt>
+ <dd>Substitute processor cycle counter for QueryPerformanceCounter if they
+ appear equivalent. This option should be used only if the PCC
+ frequency is fixed. Power-saving functionality on many laptops varies the
+ PCC frequency. (Windows only)</dd>
+</dl>
+<h4 id="cfg">The Configuration File</h4>
+<p>Ordinarily, <tt>ntpd</tt> reads the <tt>ntp.conf</tt> configuration file at startup in order to determine the synchronization sources and operating modes. It is also possible to specify a working, although limited, configuration entirely on the command line, obviating the need for a configuration file. This may be particularly useful when the local host is to be configured as a broadcast client, with servers determined by listening to broadcasts at run time.</p>
+<p>Usually, the configuration file is installed as<tt>/etc/ntp.conf</tt>, but could be installed elsewhere (see the <tt>-c <i>conffile</i></tt> command line option). The file format is similar to other Unix configuration files - comments begin with a <tt>#</tt> character and extend to the end of the line; blank lines are ignored.</p>
+<p>Configuration commands consist of an initial command keyword followed by a list of option keywords separated by whitespace. Commands may not be continued over multiple lines. Options may be host names, host addresses written in numeric, dotted-quad form, integers, floating point numbers (when specifying times in seconds) and text strings. Optional arguments are delimited by <tt>[ ]</tt> in the options pages, while alternatives are separated by <tt>|</tt>. The notation <tt>[ ... ]</tt> means an optional, indefinite repetition of the last item before the <tt>[ ... ]</tt>.</p>
+<h4 id="files">Files</h4>
+<table width="100%" border="1">
+ <tr>
+ <td width="30%">File</td>
+ <td width="30%">Default</td>
+ <td width="20%">Option</td>
+ <td width="20%">Option</td>
+ </tr>
+ <tr>
+ <td width="30%">configuration file</td>
+ <td width="30%"><tt>/etc/ntp.conf</tt></td>
+ <td width="20%"><tt>-c</tt></td>
+ <td width="20%"><tt>conffile</tt></td>
+ </tr>
+ <tr>
+ <td width="30%">frequency file</td>
+ <td width="30%">none</td>
+ <td width="20%"><tt>-f</tt></td>
+ <td width="20%"><tt>driftfile</tt></td>
+ </tr>
+ <tr>
+ <td width="30%">leapseconds file</td>
+ <td width="30%">none</td>
+ <td width="20%"></td>
+ <td width="20%"><tt>leapfile</tt></td>
+ </tr>
+ <tr>
+ <td width="30%">process ID file</td>
+ <td width="30%">none</td>
+ <td width="20%"><tt>-p</tt></td>
+ <td width="20%"><tt>pidfile</tt></td>
+ </tr>
+ <tr>
+ <td width="30%">log file</td>
+ <td width="30%">system log</td>
+ <td width="20%"><tt>-l</tt></td>
+ <td width="20%"><tt>logfile</tt></td>
+ </tr>
+ <tr>
+ <td width="30%">include file</td>
+ <td width="30%">none</td>
+ <td width="20%">none</td>
+ <td width="20%"><tt>includefile</tt></td>
+ </tr>
+ <tr>
+ <td width="30%">statistics path</td>
+ <td width="30%"><tt>/var/NTP</tt></td>
+ <td width="20%"><tt>-s</tt></td>
+ <td width="20%"><tt>statsdir</tt></td>
+ </tr>
+ <tr>
+ <td width="30%">keys path</td>
+ <td width="30%"><tt>/usr/local/etc</tt></td>
+ <td width="20%">none</td>
+ <td width="20%"><tt>keysdir</tt></td>
+ </tr>
+</table>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntpdate.html b/html/ntpdate.html
new file mode 100644
index 0000000..9216b6c
--- /dev/null
+++ b/html/ntpdate.html
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntpdate - set the date and time via NTP</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntpdate</tt> - set the date and time via NTP</h3>
+<img src="pic/rabbit.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
+<p>I told you it was eyeball and wristwatch.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->9-Feb-2014 03:34<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<hr>
+<p>Disclaimer: This program has known bugs and deficiencies and nobody
+has volunteered to fix them in a long time. The good news is the
+functionality originally intended for this program is available in the <tt>ntpd</tt> and
+<tt>sntp</tt> programs. See the <a
+href="http://support.ntp.org/Dev/DeprecatingNtpdate">Deprecating
+<tt>ntpdate</tt> topic</a> in the NTP Support wiki
+for a thorough discussion and analysis of the issues.
+See the <tt>-q</tt> command line option in the <a
+href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a>
+page and/or the <a href="sntp.html"><tt>sntp</tt> - Simple Network Time
+Protocol (SNTP) Client</a> page. After a suitable period of mourning, the <tt>ntpdate</tt> program will be retired from this distribution.</p>
+<h4>Synopsis</h4>
+<tt>ntpdate [ -46bBdqsuv ] [ -a <i>key</i> ] [ -e <i>authdelay</i> ] [ -k <i>keyfile</i> ] [ -o <i>version</i> ] [ -p <i>samples</i> ] [ -t <i>timeout</i> ] <i>server</i> [ ... ]</tt>
+<h4>Description</h4>
+<p><tt>ntpdate</tt> sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the <i>server</i> arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of <tt>ntpdate</tt> depends on the number of servers, the number of polls each time it is run and the interval between runs.</p>
+<p><tt>ntpdate</tt> can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon <tt>ntpd</tt>. It is also possible to run <tt>ntpdate</tt> from a <tt>cron</tt> script. However, it is important to note that <tt>ntpdate</tt> with contrived <tt>cron</tt> scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since <tt>ntpdate</tt> does not discipline the host clock frequency as does <tt>ntpd</tt>, the accuracy using <tt>ntpdate</tt> is limited.</p>
+<p>Time adjustments are made by <tt>ntpdate</tt> in one of two ways. If <tt>ntpdate</tt> determines the clock is in error more than 0.5 second it will simply step the time by calling the system <tt>settimeofday()</tt> routine. If the error is less than 0.5 seconds, it will slew the time by calling the system <tt>adjtime()</tt> routine. The latter technique is less disruptive and more accurate when the error is small, and works quite well when <tt>ntpdate</tt> is run by <tt>cron</tt> every hour or two.</p>
+<p><tt>ntpdate</tt> will, if the <tt>-u</tt> flag was not specified, decline to set the date if an NTP server daemon (e.g., <tt>ntpd</tt>) is running on the same host. When running <tt>ntpdate</tt> on a regular basis from <tt>cron</tt> as an alternative to running a daemon, doing so once every hour or two will result in precise enough timekeeping to avoid stepping the clock.</p>
+<p>Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p>
+<p>If NetInfo support is compiled into <tt>ntpdate</tt>, then the <tt>server</tt> argument is optional if <tt>ntpdate</tt> can find a time server in the NetInfo configuration for <tt>ntpd</tt>.</p>
+<h4>Command Line Options</h4>
+<dl>
+ <dt><tt>-4</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace.</dd>
+ <dt><tt>-6</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace.</dd>
+ <dt><tt>-a <i>key</i></tt></dt>
+ <dd>Enable the authentication function and specify the key identifier to be used for authentication as the argument <i>key</i>. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function.
+ <dt><tt>-B</tt></dt>
+ <dd>Force the time to always be slewed using the adjtime() system call, even if the measured offset is greater than +-500 ms. The default is to step the time using settimeofday() if the offset is greater than +-500 ms. Note that, if the offset is much greater than +-500 ms in this case, that it can take a long time (hours) to slew the clock to the correct value. During this time. the host should not be used to synchronize clients.
+ <dt><tt>-b</tt></dt>
+ <dd>Force the time to be stepped using the settimeofday() system call, rather than slewed (default) using the adjtime() system call. This option should be used when called from a startup file at boot time.</dd>
+ <dt><tt>-d</tt></dt>
+ <dd>Enable the debugging mode, in which <tt>ntpdate</tt> will go through all the steps, but not adjust the local clock and using an unprivileged port. Information useful for general debugging will also be printed.</dd>
+ <dt><tt>-e <i>authdelay</i></tt></dt>
+ <dd>Specify the processing delay to perform an authentication function as the value <i>authdelay</i>, in seconds and fraction (see <tt>ntpd</tt> for details). This number is usually small enough to be negligible for most purposes, though specifying a value may improve timekeeping on very slow CPU's.</dd>
+ <dt><tt>-k <i>keyfile</i></tt></dt>
+ <dd>Specify the path for the authentication key file as the string <i>keyfile</i>. The default is <tt>/etc/ntp.keys</tt>. This file should be in the format described in <tt>ntpd</tt>.</dd>
+ <dt><tt>-o <i>version</i></tt></dt>
+ <dd>Specify the NTP version for outgoing packets as the integer
+ <i>version</i>, which can be 1, 2, 3 or 4. The default is 4. This allows <tt>ntpdate</tt> to be used with older NTP versions.</dd>
+ <dt><tt>-p <i>samples</i></tt></dt>
+ <dd>Specify the number of samples to be acquired from each server as the integer <i>samples</i>, with values from 1 to 8 inclusive. The default is 4.</dd>
+ <dt><i><tt>-q</tt></i></dt>
+ <dd>Query only - don't set the clock.</dd>
+ <dt><tt>-s</tt></dt>
+ <dd>Divert logging output from the standard output (default) to the system <tt>syslog</tt> facility. This is designed primarily for convenience of <tt>cron</tt> scripts.</dd>
+ <dt><tt>-t <i>timeout</i></tt></dt>
+ <dd>Specify the maximum time waiting for a server response as the value <i>timeout</i>, in seconds and fraction. The value is is rounded to a multiple of 0.2 seconds. The default is 1 second, a value suitable for polling across a LAN.</dd>
+ <dt><tt>-u</tt></dt>
+ <dd>Direct <tt>ntpdate</tt> to use an unprivileged port for outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronize with hosts beyond the firewall. Note that the <tt>-d</tt> option always uses unprivileged ports.
+ <dt><tt>-<i>v</i></tt></dt>
+ <dd>Be verbose. This option will cause <tt>ntpdate</tt>'s version identification string to be logged.</dd>
+</dl>
+<h4>Diagnostics</h4>
+<tt>ntpdate</tt>'s exit status is zero if it finds a server and updates the clock, and nonzero otherwise.
+<h4>Files</h4>
+<tt>/etc/ntp.keys</tt> - encryption keys used by <tt>ntpdate</tt>.
+<h4>Bugs</h4>
+The slew adjustment is actually 50% larger than the measured offset, since this (it is argued) will tend to keep a badly drifting clock more accurate. This is probably not a good idea and may cause a troubling hunt for some values of the kernel variables <tt>tick</tt> and <tt>tickadj</tt>.&nbsp;
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntpdc.html b/html/ntpdc.html
new file mode 100644
index 0000000..7a68dd2
--- /dev/null
+++ b/html/ntpdc.html
@@ -0,0 +1,178 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntpdc - special NTP query program</title>
+<!-- Changed by: Harlan &, 31-Jan-2014 -->
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntpdc</tt> - special NTP query program</h3>
+<img src="pic/alice31.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
+<p>This program is a big, deprecated puppy.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>More Help</h4>
+<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
+<hr>
+<h4>Synopsis</h4>
+<tt>ntpdc [ -46dilnps ] [ -c <i>command</i> ] [ <i>host</i> ] [ ... ]</tt>
+<h4>Description</h4>
+<p><tt>ntpdc</tt> is deprecated - please use <tt>ntpq</tt> now, as it uses a more sane interface and can provide all of the information that <tt>ntpdc</tt> used to provide.</p>
+<p><tt>ntpdc</tt> is used to query the <tt>ntpd</tt> daemon about its current state and to request changes in that state. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the <tt>ntpdc</tt> interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using <tt>ntpdc</tt>.</p>
+<p>If one or more request options are included on the command line when <tt>ntpdc</tt> is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, <tt>ntpdc</tt> will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. <tt>ntpdc</tt> will prompt for commands if the standard input is a terminal device.</p>
+<p><tt>ntpdc</tt> uses NTP mode 7 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. <tt>ntpdc</tt> makes no attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.</p>
+<p>The operation of <tt>ntpdc</tt> are specific to the particular implementation of the <tt>ntpd</tt> daemon and can be expected to work only with this and maybe some previous versions of the daemon. Requests from a remote <tt>ntpdc</tt> program which affect the state of the local server must be authenticated, which requires both the remote program and local server share a common key and key identifier.</p>
+<p>Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p>
+<h4>Command Line Options</h4>
+<p>Specifying a command line option other than <tt>-i</tt> or <tt>-n</tt> will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, <tt>ntpdc</tt> will attempt to read interactive format commands from the standard input.</p>
+<dl>
+ <dt><tt>-4</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace.</dd>
+ <dt><tt>-6</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace.</dd>
+ <dt><tt>-c <i>command</i></tt></dt>
+ <dd>The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple -c options may be given.</dd>
+ <dt><tt>-d</tt>
+ <dd>Turn on debugging mode.
+ <dt><tt>-i</tt></dt>
+ <dd>Force <tt>ntpdc</tt> to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input.</dd>
+ <dt><tt>-l</tt></dt>
+ <dd>Obtain a list of peers which are known to the server(s). This switch is equivalent to <tt>-c listpeers</tt>.</dd>
+ <dt><tt>-n</tt></dt>
+ <dd>Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.</dd>
+ <dt><tt>-p</tt></dt>
+ <dd>Print a list of the peers known to the server as well as a summary of their state. This is equivalent to <tt>-c peers</tt>.</dd>
+ <dt><tt>-s</tt></dt>
+ <dd>Print a list of the peers known to the server as well as a summary of their state, but in a slightly different format than the -p switch. This is equivalent to <tt>-c dmpeers</tt>.</dd>
+</dl>
+<h4>Interactive Commands</h4>
+<p>Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <tt>&lt;</tt>, followed by a file name, to the command line.</p>
+<p>A number of interactive format commands are executed entirely within the <tt>ntpdc</tt> program itself and do not result in NTP mode 7 requests being sent to a server. These are described following.</p>
+<dl>
+ <dt><tt>? [ <i>command_keyword</i> ]</tt><br>
+ <tt>help [ <i>command_keyword</i> ]</tt></dt>
+ <dd>A <tt>?</tt> by itself will print a list of all the command keywords known to this incarnation of <tt>ntpq</tt>. A <tt>?</tt> followed by a command keyword will print function and usage information about the command. This command is probably a better source of information about <tt>ntpq</tt> than this manual page.</dd>
+ <dt><tt>delay <i>milliseconds</i></tt></dt>
+ <dd>Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.</dd>
+ <dt><tt>host <i>hostname</i></tt></dt>
+ <dd>Set the host to which future queries will be sent. Hostname may be either a host name or a numeric address.</dd>
+ <dt><tt>hostnames [ yes | no ]</tt></dt>
+ <dd>If <tt>yes</tt> is specified, host names are printed in information displays. If <tt>no</tt> is specified, numeric addresses are printed instead. The default is <tt>yes</tt>, unless modified using the command line <tt>-n</tt> switch.</dd>
+ <dt><tt>keyid <i>keyid</i></tt></dt>
+ <dd>This command allows the specification of a
+ key number to be used to authenticate configuration
+ requests from ntpdc to the host(s). This must
+ correspond to a key number which the host/server has
+ been configured to use for this purpose (server
+ options: <tt>trustedkey</tt>, and <tt>requestkey</tt>). If authentication is not
+ enabled on the host(s) for ntpdc
+ commands, the command <tt>&quot;keyid 0&quot;</tt> should be given; otherwise the <i>keyid</i> of the next subsequent <tt>addpeer/addserver/broadcast </tt> command will
+ be used.</dd>
+ <dt><tt>quit</tt></dt>
+ <dd>Exit <tt>ntpdc</tt>.</dd>
+ <dt><tt>passwd</tt></dt>
+ <dd>This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for use by the NTP server for this purpose if such requests are to be successful.</dd>
+ <dt><tt>timeout <i>milliseconds</i></tt></dt>
+ <dd>Specify a timeout period for responses to server queries. The default is about 8000 milliseconds. Note that since <tt>ntpdc</tt> retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set.</dd>
+</dl>
+<h4>Control Message Commands</h4>
+<p>Query commands result in NTP mode 7 packets containing requests for information being sent to the server. These are read-only commands in that they make no modification of the server configuration state.</p>
+<dl>
+ <dt><tt>listpeers</tt></dt>
+ <dd>Obtains and prints a brief list of the peers for which the server is maintaining state. These should include all configured peer associations as well as those peers whose stratum is such that they are considered by the server to be possible future synchronization candidates.</dd>
+ <dt><tt>peers</tt></dt>
+ <dd>Obtains a list of peers for which the server is maintaining state, along with a summary of that state. Summary information includes the address of the remote peer, the local interface address (0.0.0.0 if a local address has yet to be determined), the stratum of the remote peer (a stratum of 16 indicates the remote peer is unsynchronized), the polling interval, in seconds, the reachability register, in octal, and the current estimated delay, offset and dispersion of the peer, all in seconds.</dd>
+ <dd>The character in the left margin indicates the mode this peer entry is operating in. A <tt>+</tt> denotes symmetric active, a <tt>-</tt> indicates symmetric passive, a <tt>=</tt> means the remote server is being polled in client mode, a <tt>^</tt> indicates that the server is broadcasting to this address, a <tt>~</tt> denotes that the remote peer is sending broadcasts and a <tt>*</tt> marks the peer the server is currently synchronizing to.</dd>
+ <dd>The contents of the host field may be one of four forms. It may be a host name, an IP address, a reference clock implementation name with its parameter or <tt>REFCLK(<i>implementation number</i>, <i>parameter</i>)</tt>. On <tt>hostnames no</tt> only IP-addresses will be displayed.</dd>
+ <dt><tt>dmpeers</tt></dt>
+ <dd>A slightly different peer summary list. Identical to the output of the <tt>peers</tt> command, except for the character in the leftmost column. Characters only appear beside peers which were included in the final stage of the clock selection algorithm. A <tt>.</tt> indicates that this peer was cast off in the falseticker detection, while a <tt>+</tt> indicates that the peer made it through. A <tt>*</tt> denotes the peer the server is currently synchronizing with.</dd>
+ <dt><tt>showpeer <i>peer_address</i> [...]</tt></dt>
+ <dd>Shows a detailed display of the current peer variables for one or more peers. Most of these values are described in the NTP Version 2 specification.</dd>
+ <dt><tt>pstats <i>peer_address</i> [...]</tt></dt>
+ <dd>Show per-peer statistic counters associated with the specified peer(s).</dd>
+ <dt><tt>clockstat <i>clock_peer_address</i> [...]</tt></dt>
+ <dd>Obtain and print information concerning a peer clock. The values obtained provide information on the setting of fudge factors and other clock performance information.</dd>
+ <dt><tt>kerninfo</tt></dt>
+ <dd>Obtain and print kernel phase-lock loop operating parameters. This information is available only if the kernel has been specially modified for a precision timekeeping function.</dd>
+ <dt><tt>loopinfo [ oneline | multiline ]</tt></dt>
+ <dd>Print the values of selected loop filter variables. The loop filter is the part of NTP which deals with adjusting the local system clock. The <tt>offset</tt> is the last offset given to the loop filter by the packet processing code. The <tt>frequency</tt> is the frequency error of the local clock in parts-per-million (ppm). The <tt>time_const</tt> controls the stiffness of the phase-lock loop and thus the speed at which it can adapt to oscillator drift. The <tt>watchdog timer</tt> value is the number of seconds which have elapsed since the last sample offset was given to the loop filter. The <tt>oneline</tt> and <tt>multiline</tt> options specify the format in which this information is to be printed, with <tt>multiline</tt> as the default.</dd>
+ <dt><tt>sysinfo</tt></dt>
+ <dd>Print a variety of system state variables, i.e., state related to the local server. All except the last four lines are described in the NTP Version 3 specification, RFC-1305.</dd>
+ <dd>The <tt>system flags</tt> show various system flags, some of which can be set and cleared by the <tt>enable</tt> and <tt>disable</tt> configuration commands, respectively. These are the <tt>auth</tt>, <tt>bclient</tt>, <tt>monitor</tt>, <tt>pll</tt>, <tt>pps</tt> and <tt>stats</tt> flags. See the <tt>ntpd</tt> documentation for the meaning of these flags. There are two additional flags which are read only, the <tt>kernel_pll</tt> and <tt>kernel_pps</tt>. These flags indicate the synchronization status when the precision time kernel modifications are in use. The <tt>kernel_pll</tt> indicates that the local clock is being disciplined by the kernel, while the kernel_pps indicates the kernel discipline is provided by the PPS signal.</dd>
+ <dd>Note that some directives, like <tt>enable pps</tt>, are only supported on certain versions of <tt>ntpd</tt>.</dd>
+ <dd>The <tt>stability</tt> is the residual frequency error remaining after the system frequency correction is applied and is intended for maintenance and debugging. In most architectures, this value will initially decrease from as high as 500 ppm to a nominal value in the range .01 to 0.1 ppm. If it remains high for some time after starting the daemon, something may be wrong with the local clock, or the value of the kernel variable <tt>tick</tt> may be incorrect.</dd>
+ <dd>The <tt>broadcastdelay</tt> shows the default broadcast delay, as set by the <tt>broadcastdelay</tt> configuration command.</dd>
+ <dd>The <tt>authdelay</tt> shows the default authentication delay, as set by the <tt>authdelay</tt> configuration command.</dd>
+ <dt><tt>sysstats</tt></dt>
+ <dd>Print statistics counters maintained in the protocol module.</dd>
+ <dt><tt>memstats</tt></dt>
+ <dd>Print statistics counters related to memory allocation code.</dd>
+ <dt><tt>iostats</tt></dt>
+ <dd>Print statistics counters maintained in the input-output module.</dd>
+ <dt><tt>timerstats</tt></dt>
+ <dd>Print statistics counters maintained in the timer/event queue support code.</dd>
+ <dt><tt>reslist</tt></dt>
+ <dd>Obtain and print the server's restriction list. This list is (usually) printed in sorted order and may help to understand how the restrictions are applied.</dd>
+ <dt><tt>ifstats</tt></dt>
+ <dd>List interface statistics for interfaces used by ntpd for network communication.</dd>
+ <dt><tt>ifreload</tt></dt>
+ <dd>Force rescan of current system interfaces. Outputs interface statistics for interfaces that could possibly change. Marks unchanged interfaces with <b>.</b>, added interfaces with <b>+</b> and deleted interfaces with <b>-</b>.</dd>
+ <dt><tt>monlist [ <i>version</i> ]</tt></dt>
+ <dd>Obtain and print traffic counts collected and maintained by the monitor facility. The version number should not normally need to be specified. At most, 600 entries are displayed by <tt>monlist</tt>. To display the entire MRU list, use the <tt>ntpq</tt> program's <a href="ntpq.html#mrulist"><tt>mrulist</tt></a> command.</dd>
+ <dt><tt>clkbug <i>clock_peer_address</i> [...]</tt></dt>
+ <dd>Obtain debugging information for a reference clock driver. This information is provided only by some clock drivers and is mostly undecodable without a copy of the driver source in hand.</dd>
+</dl>
+<h4>Runtime Configuration Requests</h4>
+<p>All requests which cause state changes in the server are authenticated by the server using a configured NTP key (the facility can also be disabled by the server by not configuring a key). The key number and the corresponding key must also be made known to <tt>ntpdc</tt>. This can be done using the keyid and passwd commands, the latter of which will prompt at the terminal for a password to use as the encryption key. You will also be prompted automatically for both the key number and password the first time a command which would result in an authenticated request to the server is given. Authentication not only provides verification that the requester has permission to make such changes, but also gives an extra degree of protection again transmission errors.</p>
+<p>Authenticated requests always include a timestamp in the packet data, which is included in the computation of the authentication code. This timestamp is compared by the server to its receive time stamp. If they differ by more than a small amount the request is rejected. This is done for two reasons. First, it makes simple replay attacks on the server, by someone who might be able to overhear traffic on your LAN, much more difficult. Second, it makes it more difficult to request configuration changes to your server from topologically remote hosts. While the reconfiguration facility will work well with a server on the local host, and may work adequately between time-synchronized hosts on the same LAN, it will work very poorly for more distant hosts. As such, if reasonable passwords are chosen, care is taken in the distribution and protection of keys and appropriate source address restrictions are applied, the run time reconfiguration facility should provide an adequate level of security.</p>
+<p>The following commands all make authenticated requests.</p>
+<dl>
+ <dt><tt>addpeer <i>peer_address</i> [ <i>keyid</i> ] [ <i>version</i> ] [ <tt>minpoll# | prefer | minpoll <i>N</i> | <tt>maxpoll</tt> <i>N</i> [...] ]</tt></tt></dt>
+ <dt><tt>addpeer <i>peer_address</i> [ <tt>prefer | minpoll <i>N</i> | <tt>maxpoll</tt> <i>N</i> | <tt>keyid</tt> <i>N</i> | <tt>version</tt> <i>N</i> [...] ]</tt></tt></dt>
+ <dd>Add a configured peer association at the given address and operating in symmetric
+ active mode. Note that an existing association with the same peer may be deleted when this
+ command is executed, or may simply be converted to conform to the new configuration, as appropriate. If the <tt>keyid</tt> is nonzero, all outgoing packets to the remote server will have an authentication field attached encrypted with this key. If the value is 0 (or not given) no authentication will be done. If ntpdc's key number has not yet been set (<i>e.g.,</i> by the keyid command), it will be set to this value. The <tt>version#</tt> can be 1 through 4 and defaults to 3. The remaining options are either a numeric value for <tt>minpoll</tt> or literals <tt>prefer</tt>, <tt>burst</tt>, <tt>minpoll </tt><i>N</i>, <tt>keyid </tt><i>N</i>, <tt>version </tt> <i>N</i>, or <tt>maxpoll </tt><i>N</i> (where <i>N</i> is a numeric value), and have the action as specified in the <tt>peer</tt> configuration file command of
+ ntpd. See the <a href="confopt.html">Server Options</a> page for further information. Each flag (or its absence) replaces the previous setting. The <tt>prefer</tt> keyword indicates a preferred peer (and thus will be used primarily for clock synchronisation if possible). The preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronisation so is the PPS signal. The <tt>dynamic</tt> keyword allows association configuration even when no suitable network interface is found at configuration time. The dynamic interface update mechanism may complete the configuration when new interfaces appear (e.g. WLAN/PPP interfaces) at a later time and thus render the association operable.</dd>
+ <dt><tt>addserver <i>peer_address</i> [ <i>address</i> [ <i>keyid</i> ] [ <i>version</i> ] [ minpoll | prefer | iburst | burst | minpoll <i>N</i> | maxpoll <i>N</i> [...] ] prefer | iburst | burst | minpoll <i>N</i> | maxpoll <i>N</i> | keyid <i>N</i> | version <i>N</i> [...] ]</tt></dt>
+ <dd>Identical to the addpeer command, except that the operating mode is client.</dd>
+ <dt><tt>broadcast <i>peer_address</i> [ <i>keyid</i> ] [ <i>version</i> ] [ <i>prefer</i> ]</tt></dt>
+ <dd>Identical to the addpeer command, except that the operating mode is broadcast. In this case a valid non-zero key identifier and key are required. The <tt>peer_address</tt> parameter can be the broadcast address of the local network or a multicast group address assigned to NTP. If a multicast address, a multicast-capable kernel is required.</dd>
+ <dt><tt>unconfig <i>peer_address</i> [...]</tt></dt>
+ <dd>This command causes the configured bit to be removed from the specified peer(s). In many cases this will cause the peer association to be deleted. When appropriate, however, the association may persist in an unconfigured mode if the remote peer is willing to continue on in this fashion.</dd>
+ <dt><tt>fudge <i>peer_address</i> [ <i>time1</i> ] [ <i>time2</i> ] [ <i>stratum</i> ] [ <i>refid</i> ]</tt></dt>
+ <dd>This command provides a way to set certain data for a reference clock. See the source listing for further information.</dd>
+ <dt><tt>enable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]</tt><br>
+ <tt>disable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]</tt></dt>
+ <dd>These commands operate in the same way as the <tt>enable</tt> and <tt>disable</tt> configuration file commands of <tt>ntpd</tt>. See the <a href="miscopt.html">Miscellaneous Options</a> page for further information.</dd>
+ <dt><tt>restrict <i>address mask flag</i> [ <i>flag</i> ]</tt></dt>
+ <dd>This command operates in the same way as the <tt>restrict</tt> configuration file commands of <tt>ntpd</tt>.</dd>
+ <dt><tt>unrestrict <i>address mask flag</i> [ <i>flag</i> ]</tt></dt>
+ <dd>Unrestrict the matching entry from the restrict list.</dd>
+ <dt><tt>delrestrict <i>address mask [ ntpport ]</i></tt></dt>
+ <dd>Delete the matching entry from the restrict list.</dd>
+ <dt><tt>readkeys</tt></dt>
+ <dd>Causes the current set of authentication keys to be purged and a new set to be obtained by rereading the keys file (which must have been specified in the <tt>ntpd</tt> configuration file). This allows encryption keys to be changed without restarting the server.</dd>
+ <dt><tt>trustedkey <i>keyid</i> [...]</tt></dt>
+ <dt><tt>untrustedkey <i>keyid</i> [...]</tt></dt>
+ <dd>These commands operate in the same way as the <tt>trustedkey</tt> and <tt>untrustedkey</tt> configuration file commands of <tt>ntpd</tt>.</dd>
+ <dt><tt>authinfo</tt></dt>
+ <dd>Returns information concerning the authentication module, including known keys and counts of encryptions and decryptions which have been done.</dd>
+ <dt><tt>traps</tt></dt>
+ <dd>Display the traps set in the server. See the source listing for further information.</dd>
+ <dt><tt>addtrap [ <i>address</i> [ <i>port</i> ] [ <i>interface</i> ]</tt></dt>
+ <dd>Set a trap for asynchronous messages. See the source listing for further information.</dd>
+ <dt><tt>clrtrap [ <i>address</i> [ <i>port</i> ] [ <i>interface</i>]</tt></dt>
+ <dd>Clear a trap for asynchronous messages. See the source listing for further information.</dd>
+ <dt><tt>reset</tt></dt>
+ <dd>Clear the statistics counters in various modules of the server. See the source listing for further information.</dd>
+</dl>
+<h4>Bugs</h4>
+<p><tt>ntpdc</tt> is a crude hack. Much of the information it shows is deadly boring and could only be loved by its implementer. The program was designed so that new (and temporary) features were easy to hack in, at great expense to the program's ease of use. Despite this, the program is occasionally useful.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntpdsim.html b/html/ntpdsim.html
new file mode 100644
index 0000000..3f823df
--- /dev/null
+++ b/html/ntpdsim.html
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntpdsim - Network Time Protocol (NTP) simulator</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</h3>
+<img src="pic/oz2.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a>
+<p>All in a row.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:55<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#synop">Synopsis</a></li>
+ <li class="inline"><a href="#descr">Description</a></li>
+ <li class="inline"><a href="#cmd">Command Line Oprionts</a></li>
+ <li class="inline"><a href="#files">Files</a></li>
+</ul>
+<hr>
+<h4 id="synop">Synopsis</h4>
+<tt>ntpdsim [ -B <i>bdly</i> ] [ -C <i>snse</i> ] [ -O <i>clk_time</i> ] [ -S <i>sim_time</i> ] [ -T <i>ferr</i> ] [ -W <i>fsne</i> ] [ -Y </tt><i><tt>ndly</tt></i><tt> ] [ -X </tt><i><tt>pdly</tt></i><tt> ]</tt>
+<h4 id="descr">Description</h4>
+<p>The <tt>ntpdsim</tt> program is an adaptation of the <tt>ntpd</tt> operating system daemon. The program operates as a discrete time simulator using specified systematic and random driving sources. It includes all the mitigation and discipline algorithms of the actual daemon, but with the packet I/O and system clock algorithms driven by simulation. Most functions of the real <tt>ntpd</tt> remain intact, including the monitoring, statistics recording, trace and host name resolution features. Further information on the simulator is on the <a href="http://www.eecis.udel.edu/%7emills/ntpsim.html">NTP Discrete Event Simulator</a> page.</p>
+<p>The simulator is most useful to study NTP behavior in response to time and/or frequency transients under specific conditions of network jitter and oscillator wander. For this purpose the daemon can be driven by pseudorandom jitter and wander sample sequences characteristic of real networks and oscillators. The jitter generator produces samples from a Poisson distribution, while the wander generator produces samples from a Guassian distribution.</p>
+<p>The easiest way to use this program is to create a <tt>ntpstats</tt> directory, configuration file <tt>ntp.conf</tt> and frequency file <tt>ntp.drift</tt> and test shell <tt>test.sh</tt> in the base directory. The <tt>ntp.drift</tt> file and <tt>ntpstats</tt> directory can be empty to start. The <tt>test.sh</tt> script can contain something like</p>
+<pre>rm ./ntpstats/*
+ntpdsim -O 0.1 -C .001 -T 400 -W 1 -c ./ntp.conf,
+</pre>
+<p>which starts the simulator with a time offset 100 ms, network jitter 1 ms, frequency offset 400 PPM and oscillator wander 1 PPM/s. These parameters represent typical conditions with modern workstations on a Ethernet LAN. The ntp.conf file should contain something like</p>
+<pre>disable kernel
+server pogo
+driftfile ./ntp.drift
+statsdir ./ntpstats/
+filegen loopstats type day enable
+filegen peerstats type day enable
+</pre>
+<h4 id="cmd">Command Line Options</h4>
+<dl>
+ <dt>Note: The NTP development team is moving to the use of a syntax-directed configuration file design. When complete these options will be replaced by a <a href="ntpdsim_new.html">new one</a>. Most of the <tt>ntpd</tt> command line options apply also to <tt>ntpdsim</tt>. In addition, the following command line options apply to <tt>ntpdsim.</tt></dt>
+ <dt><tt>-B <i>bdly</i></tt></dt>
+ <dd>Specify beep delay (3600) s.</dd>
+ <dt><tt>-C <i>snse</i></tt></dt>
+ <dd>Specify network jitter parameter (0) s.</dd>
+ <dt><tt>-O <i>clk_time</i></tt></dt>
+ <dd>Specify initial time offset (0) s.</dd>
+ <dt><tt>-S <i>sim_time</i></tt></dt>
+ <dd>Specify simulation duration (86400) s.</dd>
+ <dt><tt>-T <i>ferr</i></tt></dt>
+ <dd>Specify initial frequency offset (0) PPM.</dd>
+ <dt><tt>-W <i>fnse</i></tt></dt>
+ <dd>Specify oscillator wander parameter (0) PPM/s.</dd>
+ <dt><tt>-Y <i>ndly</i></tt></dt>
+ <dd>Specify network propagation delay (.001) s.</dd>
+ <dt><tt>-Z <i>pdly</i></tt></dt>
+ <dd>Specify server processing delay (.001) s.</dd>
+</dl>
+<h4 id="files">Files</h4>
+<tt>/etc/ntp.conf</tt> - the default name of the configuration file<br>
+<tt>/etc/ntp.drift</tt> - the default name of the drift file<br>
+<tt>/etc/ntp.keys</tt> - the default name of the key file
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntpdsim_new.html b/html/ntpdsim_new.html
new file mode 100644
index 0000000..54c6743
--- /dev/null
+++ b/html/ntpdsim_new.html
@@ -0,0 +1,110 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntpdsim - Network Time Protocol (NTP) Simulator</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntpdsim</tt> - Network Time Protocol (NTP) Simulator</h3>
+<img src="pic/oz2.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a>
+<p>All in a row.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li><a href="#description">Description</a></li>
+ <li><a href="#configuration">Configuration</a></li>
+ <li><a href="#sample">Sample Configuration File</a></li>
+</ul>
+<hr>
+<h4 id="description">Description</h4>
+<p>The ntpdsim program is used to simulate and study the behavior of an NTP daemon that derives its time from a number of different simulated time sources (servers). Each simulated server can be configured to have a different time offset, frequency offset, propagation delay, processing delay, network jitter and oscillator wander.</p>
+<p>The ntpdsim program runs all the same selection, mitigation, and discipline
+ algorithms as the actual ntpd daemon at the client. (It actually
+ uses the same code). However, the input/output routines and servers are simulated.
+ That is, instead of sending the client messages over the network
+ to the actual servers, the client messages are intercepted by the ntpdsim
+ program, which then generates the replies to those messages. The reply messages
+ are carefully &quot;inserted&quot; into the input queue of the client at the right time
+ according to the specified server properties (like propagation delay).</p>
+<p>Each simulated server runs according to a specified script that describes the server properties at a particular time. Each script consists of a series of consecutive acts. Each act runs for a particular duration and specifies the frequency offset, propagation delay, processing delay, network jitter and oscillator wander of the server for that duration. Once the duration of an act expires, the simulated server reconfigures itself according to the properties specified in the next act.</p>
+<h4 id="configuration">Configuration</h4>
+<p>The ntpdsim program is configured by providing a configuration file at startup. The crux of the simulator configuration is specified using a <tt>simulate</tt> command, the syntax of which is given below. Note that all time quantities are in seconds and all frequency quantities are in parts per million (PPM):</p>
+<p>&lt;<i>simulate_command</i>&gt; ::= <tt>simulate</tt> { &lt;<i>init_statement_list</i>&gt; &lt;<i>server_list</i>&gt; }<br>
+ &lt;<i>init_statement_list</i>&gt; ::= &lt;init_statement_list&gt; &lt;init_statement&gt; ; | &lt;init_statement&gt; ;<br>
+ &lt;<i>init_statement</i>&gt; ::= <tt>beep_delay</tt> = &lt;number&gt; | <tt>simulation_duration</tt> = &lt;number&gt;<br>
+ &lt;<i>server_list</i>&gt; ::= &lt;<i>server_list</i>&gt; &lt;server&gt; | &lt;server&gt;<br>
+ &lt;<i>server_list</i>&gt; ::= <tt>server</tt> = &lt;address&gt; { <tt>server_offset</tt> = &lt;number&gt; ; &lt;act_list&gt; }<br>
+ &lt;<i>act_list</i>&gt; ::= &lt;<i>act_list</i>&gt; &lt;<i>act</i>&gt; | &lt;<i>act</i>&gt;<br>
+ &lt;<i>act</i>&gt; ::= <tt>duration</tt> = &lt;number&gt; { &lt;<i>act_stmt_list</i>&gt; }<br>
+ &lt;<i>act_stmt_list</i>&gt; ::= &lt;<i>act_stmt_list</i>&gt; &lt;<i>act_stmt</i>&gt; ; | &lt;<i>act_stmt</i>&gt; ;<br>
+ &lt;<i>act_stmt</i>&gt; ::= <tt>freq_offset</tt> = &lt;number&gt; | <tt>wander</tt> = &lt;number&gt; | <tt>jitter</tt> = &lt;number&gt; | <tt>prop_delay</tt> = &lt;number&gt; | <tt>proc_delay</tt> = &lt;number&gt;</p>
+<p>In addition to the <tt>simulate</tt> command, other standard NTP configuration commands can be specified. These commands have the same meaning as in the ntpd configuration. Note that newlines are <b>not</b> significant within the <tt>simulate</tt> command even though they are used to mark the end of a normal NTP configuration command. While a newline is an "end of command" terminator for other configuration commands, in the <tt>simulate</tt> stanza <tt>;</tt> (the semicolon) is the "end of command" terminator.</p>
+<h4 id="sample">Sample Configuration File</h4>
+<p>A sample ntpdsim configuration file is given below. It specifies two simulated servers, each of which has two acts.</p>
+<pre>
+ # Client configuration
+ disable kernel
+ server pogo
+ driftfile ./ntp.drift
+ statsdir ./ntpstats/
+ filegen loopstats type day enable
+ filegen peerstats type day enable
+
+ # Simulation configuration
+ simulate {
+ simulation_duration = 86400;
+ beep_delay = 3600;
+
+ # Server 1
+ server = louie.udel.edu {
+ server_offset = 0;
+ duration = 50000 {
+ freq_offset = 400;
+ wander = 1.0;
+ jitter = 0.001;
+ prop_delay = 0.001;
+ proc_delay = 0.001;
+ }
+ duration = 6400 {
+ freq_offset = 200;
+ wander = 1.0;
+ jitter = 0.001;
+ prop_delay = 0.001;
+ proc_delay = 0.001;
+ }
+ }
+
+ # Server 2
+ server = baldwin.udel.edu {
+ server_offset = 0.02;
+ duration = 10000 {
+ freq_offset = 400;
+ wander = 1.0;
+ jitter = 0.001;
+ prop_delay = 0.5;
+ proc_delay = 0.001;
+ }
+ duration = 60000 {
+ freq_offset = 200;
+ wander = 1.0;
+ jitter = 0.05;
+ prop_delay = 0.005;
+ proc_delay = 0.001;
+ }
+ }
+ }
+ </pre>
+<hr>
+<address>
+<a href="mailto:skamboj@udel.edu">Sachin Kamboj</a>
+</address>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntpq.html b/html/ntpq.html
new file mode 100644
index 0000000..1aa8df3
--- /dev/null
+++ b/html/ntpq.html
@@ -0,0 +1,654 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntpq - standard NTP query program</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntpq</tt> - standard NTP query program</h3>
+<img src="pic/bustardfly.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>A typical NTP monitoring packet</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>More Help</h4>
+<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
+<hr>
+<h4>Synopsis</h4>
+<tt>ntpq [-46dinp] [-c <i>command</i>] [<i>host</i>] [...]</tt>
+<h4>Description</h4>
+<p>The <tt>ntpq</tt> utility program is used to monitor NTP daemon <tt>ntpd</tt> operations
+ and determine performance. It uses the standard NTP mode 6 control
+ message formats defined in Appendix B of the NTPv3 specification
+ RFC1305. The same formats are used in NTPv4, although some of the
+ variable names have changed and new ones added. The description
+ on this page is for the NTPv4 variables.</p>
+<p>The program can be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The <tt>ntpq</tt> can also obtain and print a list of peers in a common format by sending multiple queries to the server.</p>
+<p>If one or more request options is included on the command line when <tt>ntpq</tt> is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, <tt>ntpq</tt> will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. <tt>ntpq</tt> will prompt for commands if the standard input is a terminal device.</p>
+<p><tt>ntpq</tt> uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. <tt>ntpq</tt> makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.</p>
+<p>Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p>
+<p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.</p>
+<p>Command line options are described following. Specifying a command line option other than <tt>-i</tt> or <tt>-n</tt> will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, <tt>ntpq</tt> will attempt to read interactive format commands from the standard input.</p>
+<dl>
+ <dt><tt>-4</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace.</dd>
+ <dt><tt>-6</tt></dt>
+ <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace.</dd>
+ <dt><tt>-c</tt></dt>
+ <dd>The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple <tt>-c</tt> options may be given.</dd>
+ <dt><tt>-d</tt></dt>
+ <dd>Turn on debugging mode.</dd>
+ <dt><tt>-i</tt></dt>
+ <dd>Force <tt>ntpq</tt> to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input.</dd>
+ <dt><tt>-n</tt></dt>
+ <dd>Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.</dd>
+ <dt><tt>-p</tt></dt>
+ <dd>Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the <tt>peers</tt> interactive command.</dd>
+</dl>
+<h4>Internal Commands</h4>
+<p>Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <tt>&gt;</tt>, followed by a file name, to the command line. A number of interactive format commands are executed entirely within the <tt>ntpq</tt> program itself and do not result in NTP mode-6 requests being sent to a server. These are described following.</p>
+<dl>
+ <dt id="help"><tt>? [<i>command_keyword</i>]</tt><br>
+ <tt>help [<i>command_keyword</i>]</tt></dt>
+ <dd>A <tt>?</tt> by itself will print a list of all the command keywords known to <tt>ntpq</tt>. A <tt>?</tt> followed by a command keyword will print function and usage information about the command.</dd>
+ <dt id="addvars"><tt>addvars <i>name</i> [ = <i>value</i>] [...]</tt><br>
+ <tt>rmvars <i>name</i> [...]</tt><br>
+ <tt>clearvars</tt></dt>
+ <dd>The arguments to this command consist of a list of items of the form <tt><i>name</i> = <i>value</i></tt>, where the <tt>= <i>value</i></tt> is ignored, and can be omitted in read requests. <tt>ntpq</tt> maintains an internal list in which data to be included in control messages can be assembled, and sent using the <tt>readlist</tt> and <tt>writelist</tt> commands described below. The <tt>addvars</tt> command allows variables and optional values to be added to the list. If more than one variable is to be added, the list should be comma-separated and not contain white space. The <tt>rmvars</tt> command can be used to remove individual variables from the list, while the <tt>clearlist</tt> command removes all variables from the list.</dd>
+ <dt id="cooked"><tt>cooked</tt></dt>
+ <dd>Display server messages in prettyprint format.</dd>
+ <dt id="debug"><tt>debug more | less | off</tt></dt>
+ <dd>Turns internal query program debugging on and off.</dd>
+ <dt id="delay"><tt>delay <i>milliseconds</i></tt></dt>
+ <dd>Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.</dd>
+ <dt id="host"><tt>host <i>name</i></tt></dt>
+ <dd>Set the host to which future queries will be sent. The name may be either a DNS name or a numeric address.</dd>
+ <dt id="hostnames"><tt>hostnames [yes | no]</tt></dt>
+ <dd>If <tt>yes</tt> is specified, host names are printed in information displays. If <tt>no</tt> is specified, numeric addresses are printed instead. The default is <tt>yes</tt>, unless modified using the command line <tt>-n</tt> switch.</dd>
+ <dt id="keyid"><tt>keyid <i>keyid</i></tt></dt>
+ <dd>This command specifies the key number to be used to authenticate configuration requests. This must correspond to a key ID configured in <tt>ntp.conf</tt> for this purpose.</dd>
+ <dt id="keytype"><tt>keytype</tt></dt>
+ <dd>Specify the digest algorithm to use for authenticated requests, with default <tt>MD5</tt>. If the OpenSSL library is installed, digest can be be any message digest algorithm supported by the library. The current selections are: <tt>MD2</tt>, <tt>MD4</tt>, <tt>MD5</tt>, <tt>MDC2</tt>, <tt>RIPEMD160</tt>, <tt>SHA</tt> and <tt>SHA1</tt>.</dd>
+ <dt id="ntpversion"><tt>ntpversion 1 | 2 | 3 | 4</tt></dt>
+ <dd>Sets the NTP version number which <tt>ntpq</tt> claims in packets. Defaults to 2, Note that mode-6 control messages (and modes, for that matter) didn't exist in NTP version 1.</dd>
+ <dt id="passwd"><tt>passwd</tt></dt>
+ <dd>This command prompts for a password to authenticate requests. The password must correspond to the key ID configured in <tt>ntp.conf</tt> for this purpose.</dd>
+ <dt id="quit"><tt>quit</tt></dt>
+ <dd>Exit <tt>ntpq</tt>.</dd>
+ <dt id="raw"><tt>raw</tt></dt>
+ <dd>Display server messages as received and without reformatting.</dd>
+ <dt id="timeout"><tt>timeout <i>millseconds</i></tt></dt>
+ <dd>Specify a timeout period for responses to server queries. The default is about 5000 milliseconds. Note that since <tt>ntpq</tt> retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set.</dd>
+</dl>
+<h4>Control Message Commands</h4>
+<p>Association IDs are used to identify system, peer and clock variables. System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace. Most control commands send a single mode-6 message to the server and expect a single response message. The exceptions are the <tt>peers</tt> command, which sends a series of messages, and the <tt>mreadlist</tt> and <tt>mreadvar</tt> commands, which iterate over a range of associations.</p>
+<dl>
+ <dt id="as"><tt>associations</tt></dt>
+ <dd>Display a list of mobilized associations in the form</dd>
+ <dd><tt>ind assid status conf reach auth condition last_event cnt</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Variable</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>ind</tt></td>
+ <td>index on this list</td>
+ </tr>
+ <tr>
+ <td><tt>assid</tt></td>
+ <td>association ID</td>
+ </tr>
+ <tr>
+ <td><tt>status</tt></td>
+ <td><a href="decode.html#peer">peer status word</a></td>
+ </tr>
+ <tr>
+ <td><tt>conf</tt></td>
+ <td><tt>yes</tt>: persistent, <tt>no</tt>: ephemeral</td>
+ </tr>
+ <tr>
+ <td><tt>reach</tt></td>
+ <td><tt>yes</tt>: reachable, <tt>no</tt>: unreachable</td>
+ </tr>
+ <tr>
+ <td><tt>auth</tt></td>
+ <td><tt>ok</tt>, <tt>yes</tt>, <tt>bad</tt> and <tt>none</tt></td>
+ </tr>
+ <tr>
+ <td><tt>condition</tt></td>
+ <td>selection status (see the <tt>select</tt> field of the <a href="decode.html#peer">peer status word</a>)</td>
+ </tr>
+ <tr>
+ <td><tt>last_event</tt></td>
+ <td>event report (see the <tt>event</tt> field of the <a href="decode.html#peer">peer status word</a>)</td>
+ </tr>
+ <tr>
+ <td><tt>cnt</tt></td>
+ <td>event count (see the <tt>count</tt> field of the <a href="decode.html#peer">peer status word</a>)</td>
+ </tr>
+ </table>
+ </dd>
+ <dt id="cv"><tt>clockvar <i>assocID</i> [<i>name</i> [ = <i>value</i> [...]] [...]</tt><br>
+ <tt>cv <i>assocID</i> [<i>name</i> [ = <i>value</i> [...] ][...]</tt></dt>
+ <dd>Display a list of <a href="#clock">clock variables</a> for those associations supporting a reference clock.</dd>
+ <dt id=":config"><tt>:config [...]</tt></dt>
+ <dd>Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.</dd>
+ <dt id="config-from-file"><tt>config-from-file <i>filename</i></tt></dt>
+ <dd>Send the each line of <i>filename</i> to the server as run-time configuration commands in the same format as the configuration file. This command is experimental until further notice and clarification. Authentication is required.</dd>
+ <dt id="ifstats"><tt>ifstats</tt></dt>
+ <dd>Display statistics for each local network address. Authentication is required.</dd>
+ <dt id="iostats"><tt>iostats</tt></dt>
+ <dd>Display network and reference clock I/O statistics.</dd>
+ <dt id="kerninfo"><tt>kerninfo</tt></dt>
+ <dd>Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.</dd>
+ <dt id="lassoc"><tt>lassociations</tt></dt>
+ <dd>Perform the same function as the associations command, except display mobilized and unmobilized associations.</dd>
+ <dt id="monstats"><tt>monstats</tt></dt>
+ <dd>Display monitor facility statistics.</dd>
+ <dt id="mrulist"><tt>mrulist [limited | kod | mincount=<i>count</i> | laddr=<i>localaddr</i> | sort=<i>sortorder</i> | resany=<i>hexmask</i> | resall=<i>hexmask</i>]</tt></dt>
+ <dd>Obtain and print traffic counts collected and maintained by the monitor facility. With the exception of <tt>sort=<i>sortorder</i></tt>, the options filter the list returned by <tt>ntpd</tt>. The <tt>limited</tt> and <tt>kod</tt> options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response. The <tt>mincount=<i>count</i></tt> option filters entries representing less than <tt><i>count</i></tt> packets. The <tt>laddr=<i>localaddr</i></tt> option filters entries for packets received on any local address other than <tt><i>localaddr</i></tt>. <tt>resany=<i>hexmask</i></tt> and <tt>resall=<i>hexmask</i></tt> filter entries containing none or less than all, respectively, of the bits in <tt><i>hexmask</i></tt>, which must begin with <tt>0x</tt>.</dd>
+ <dd>The <tt><i>sortorder</i></tt> defaults to <tt>lstint</tt> and may be any of <tt>addr</tt>, <tt>count</tt>, <tt>avgint</tt>, <tt>lstint</tt>, or any of those preceded by a minus sign (hyphen) to reverse the sort order. The output columns are:
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Column</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>lstint</tt></td>
+ <td>Interval in s between the receipt of the most recent packet from this address and the completion of the
+ retrieval of the MRU list by <tt>ntpq</tt>.</td>
+ </tr>
+ <tr>
+ <td><tt>avgint</tt></td>
+ <td>Average interval in s between packets from this address.</td>
+ </tr>
+ <tr>
+ <td><tt>rstr</tt></td>
+ <td>Restriction flags associated with this address. Most are copied unchanged from the matching <tt>restrict</tt> command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this
+ address triggered a rate control response.</td>
+ </tr>
+ <tr>
+ <td><tt>r</tt></td>
+ <td>Rate control indicator, either a period, <tt>L</tt> or <tt>K</tt> for no rate control response,
+ rate limiting by discarding, or rate limiting with a KoD response, respectively.</td>
+ </tr>
+ <tr>
+ <td><tt>m</tt></td>
+ <td>Packet mode.</td>
+ </tr>
+ <tr>
+ <td><tt>v</tt></td>
+ <td>Packet version number.</td>
+ </tr>
+ <tr>
+ <td><tt>count</tt></td>
+ <td>Packets received from this address.</td>
+ </tr>
+ <tr>
+ <td><tt>rport</tt></td>
+ <td>Source port of last packet from this address.</td>
+ </tr>
+ <tr>
+ <td><tt>remote address</tt></td>
+ <td>DNS name, numeric address, or address followed by claimed DNS name which
+ could not be verified in parentheses.</td>
+ </tr>
+ </table>
+ </dd>
+ <dt id="mreadvar"><tt>mreadvar <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt></dt>
+ <dt id="mrv"><tt>mrv <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt></dt>
+ <dd>Perform the same function as the <tt>readvar</tt> command, except for a range of association IDs. This range is determined from the association list cached by the most recent <tt>associations</tt> command.</dd>
+ <dt id="passoc"><tt>passociations</tt></dt>
+ <dd>Perform the same function as the <tt>associations command</tt>, except that it uses previously stored data rather than making a new query.</dd>
+ <dt id="pe"><tt>peers</tt></dt>
+ <dd>Display a list of peers in the form</dd>
+ <dd><tt>[tally]remote refid st t when pool reach delay offset jitter</tt></dd>
+ <dd>
+ <table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Variable</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>[tally]</tt></td>
+ <td>single-character code indicating current value of the <tt>select</tt> field of the <a href="decode.html#peer">peer status word</a></td>
+ </tr>
+ <tr>
+ <td><tt>remote</tt></td>
+ <td>host name (or IP number) of peer</td>
+ </tr>
+ <tr>
+ <td><tt>refid</tt></td>
+ <td>association ID or <a href="decode.html#kiss">kiss code</a></td>
+ </tr>
+ <tr>
+ <td><tt>st</tt></td>
+ <td>stratum</td>
+ </tr>
+ <tr>
+ <td><tt>t</tt></td>
+ <td><tt>u</tt>: unicast or manycast client, <tt>b</tt>:
+ broadcast or multicast client, <tt>l</tt>: local (reference clock), <tt>s</tt>: symmetric (peer), <tt>A</tt>: manycast server, <tt>B</tt>:
+ broadcast server, <tt>M</tt>: multicast server</td>
+ </tr>
+ <tr>
+ <td><tt>when</tt></td>
+ <td>sec/min/hr since last received packet</td>
+ </tr>
+ <tr>
+ <td><tt>poll</tt></td>
+ <td>poll interval (log<sub>2</sub> s)</td>
+ </tr>
+ <tr>
+ <td><tt>reach</tt></td>
+ <td>reach shift register (octal)</td>
+ </tr>
+ <tr>
+ <td><tt>delay</tt></td>
+ <td>roundtrip delay</td>
+ </tr>
+ <tr>
+ <td><tt>offset</tt></td>
+ <td>offset of server relative to this host</td>
+ </tr>
+ <tr>
+ <td><tt>jitter</tt></td>
+ <td>jitter</td>
+ </tr>
+ </table>
+ </dd>
+ <dt id="rv"><tt>readvar <i>assocID</i> <i>name</i> [ = <i>value</i> ] [,...]</tt><br>
+ <tt>rv <i>assocID</i> [ <i>name</i> ] [,...]</tt></dt>
+ <dd>Display the specified variables. If <tt><i>assocID</i></tt> is zero, the
+ variables are from the <a href="#system">system variables</a> name space,
+ otherwise they are from the <a href="#peer">peer variables</a> name space.
+ The <tt><i>assocID</i></tt> is required, as the same name can occur in both spaces. If no <tt><i>name</i></tt> is
+ included, all operative variables in the name space are displayed.
+ In this case only, if the <tt><i>assocID</i></tt> is omitted, it is assumed zero. Multiple
+ names are specified with comma separators and without whitespace.
+ Note that time values are represented in milliseconds and frequency
+ values in parts-per-million (PPM). Some NTP timestamps are represented
+ in the format YYYYMMDDTTTT, where YYYY is the year, MM the month
+ of year, DD the day of month and TTTT the time of day.</dd>
+ <dt id="saveconfig"><tt>saveconfig <i>filename</i></tt></dt>
+ <dd>Write the current configuration, including any runtime modifications given with <tt>:config</tt> or <tt>config-from-file</tt>, to the ntpd host's file <i>filename</i>. This command will be rejected by the server unless <a href="miscopt.html#saveconfigdir">saveconfigdir</a> appears in the <tt>ntpd</tt> configuration file. <i>filename</i> can use strftime() format specifies to substitute the current date and time, for example, <tt>saveconfig ntp-%Y%m%d-%H%M%S.conf</tt>. The filename used is stored in system variable <tt>savedconfig</tt>. Authentication is required.</dd>
+ <dt id="writevar"><tt>writevar <i>assocID</i> <i>name</i> = <i>value</i> [,...]</tt></dt>
+ <dd>Write the specified variables. If the <tt><i>assocID</i></tt> is zero, the variables are from the <a href="#system">system variables</a> name space, otherwise they are from the <a href="#peer">peer variables</a> name space. The <tt><i>assocID</i></tt> is required, as the same name can occur in both spaces.</dd>
+ <dt id="sysinfo"><tt>sysinfo</tt></dt>
+ <dd>Display operational summary.</dd>
+ <dt id="sysstats"><tt>sysstats</tt></dt>
+ <dd>Print statistics counters maintained in the protocol module.</dd>
+</dl>
+<h4 id="status">Status Words and Kiss Codes</h4>
+<p>The current state of the operating program is shown in a set of status words maintained by the system and each association separately. These words are displayed in the <tt>rv</tt> and <tt>as</tt> commands both in hexadecimal and decoded short tip strings. The codes, tips and short explanations are on the <a href="decode.html">Event Messages and Status Words</a> page. The page also includes a list of system and peer messages, the code for the latest of which is included in the status word.</p>
+<p>Information resulting from protocol machine state transitions is displayed using an informal set of ASCII strings called <a href="decode.html#kiss">kiss codes</a>. The original purpose was for kiss-o'-death (KoD) packets sent by the server to advise the client of an unusual condition. They are now displayed, when appropriate, in the reference identifier field in various billboards.</p>
+<h4 id="system">System Variables</h4>
+<p>The following system variables appear in the <tt>rv</tt> billboard. Not all variables are displayed in some configurations.</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Variable</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>status</tt></td>
+ <td><a href="decode.html#sys">system status word</a></td>
+ </tr>
+ <tr>
+ <td><tt>version</tt></td>
+ <td>NTP software version and build time</td>
+ </tr>
+ <tr>
+ <td><tt>processor</tt></td>
+ <td>hardware platform and version</td>
+ </tr>
+ <tr>
+ <td><tt>system</tt></td>
+ <td>operating system and version</td>
+ </tr>
+ <tr>
+ <td><tt>leap</tt></td>
+ <td>leap warning indicator (0-3)</td>
+ </tr>
+ <tr>
+ <td><tt>stratum</tt></td>
+ <td>stratum (1-15)</td>
+ </tr>
+ <tr>
+ <td><tt>precision</tt></td>
+ <td>precision (log<sub>2</sub> s)</td>
+ </tr>
+ <tr>
+ <td><tt>rootdelay</tt></td>
+ <td>total roundtrip delay to the primary reference clock</td>
+ </tr>
+ <tr>
+ <td><tt>rootdisp</tt></td>
+ <td>total dispersion to the primary reference clock</td>
+ </tr>
+ <tr>
+ <td><tt>peer</tt></td>
+ <td>system peer association ID</td>
+ </tr>
+ <tr>
+ <td><tt>tc</tt></td>
+ <td>time constant and poll exponent (log<sub>2</sub> s) (3-17)</td>
+ </tr>
+ <tr>
+ <td><tt>mintc</tt></td>
+ <td>minimum time constant (log<sub>2</sub> s) (3-10)</td>
+ </tr>
+ <tr>
+ <td><tt>clock</tt></td>
+ <td>date and time of day</td>
+ </tr>
+ <tr>
+ <td><tt>refid</tt></td>
+ <td>reference ID or <a href="decode.html#kiss">kiss code</a></td>
+ </tr>
+ <tr>
+ <td><tt>reftime</tt></td>
+ <td>reference time</td>
+ </tr>
+ <tr>
+ <td><tt>offset</tt></td>
+ <td>combined offset of server relative to this host</td>
+ </tr>
+ <tr>
+ <td><tt>sys_jitter</tt></td>
+ <td>combined system jitter</td>
+ </tr>
+ <tr>
+ <td><tt>frequency</tt></td>
+ <td> frequency offset (PPM) relative to hardware clock</td>
+ </tr>
+ <tr>
+ <td><tt>clk_wander</tt></td>
+ <td>clock frequency wander (PPM)</td>
+ </tr>
+ <tr>
+ <td><tt>clk_jitter</tt></td>
+ <td>clock jitter</td>
+ </tr>
+ <tr>
+ <td><tt>tai</tt></td>
+ <td>TAI-UTC offset (s)</td>
+ </tr>
+ <tr>
+ <td><tt>leapsec</tt></td>
+ <td>NTP seconds when the next leap second is/was inserted</td>
+ </tr>
+ <tr>
+ <td><tt>expire</tt></td>
+ <td>NTP seconds when the NIST leapseconds file expires</td>
+ </tr>
+</table>
+<dl>
+ <dt>The jitter and wander statistics are exponentially-weighted RMS averages.
+ The system jitter is defined in the NTPv4 specification; the
+ clock jitter statistic is computed by the clock discipline module.</dt>
+ <dt>When the NTPv4 daemon is compiled with the OpenSSL software library, additional
+ system variables are displayed, including some or all of the following, depending
+ on the particular Autokey dance:</dt>
+</dl>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Variable</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>host</tt></td>
+ <td>Autokey host name for this host</td>
+ </tr>
+ <tr>
+ <td><tt>ident</tt></td>
+ <td>Autokey group name for this host</td>
+ </tr>
+ <tr>
+ <td><tt>flags</tt></td>
+ <td>host flags (see Autokey specification)</td>
+ </tr>
+ <tr>
+ <td><tt>digest</tt></td>
+ <td>OpenSSL message digest algorithm</td>
+ </tr>
+ <tr>
+ <td><tt>signature</tt></td>
+ <td>OpenSSL digest/signature scheme</td>
+ </tr>
+ <tr>
+ <td><tt>update</tt></td>
+ <td>NTP seconds at last signature update</td>
+ </tr>
+ <tr>
+ <td><tt>cert</tt></td>
+ <td>certificate subject, issuer and certificate flags</td>
+ </tr>
+ <tr>
+ <td><tt>until</tt></td>
+ <td>NTP seconds when the certificate expires</td>
+ </tr>
+</table>
+<h4 id="peer">Peer Variables</h4>
+<p>The following peer variables appear in the <tt>rv</tt> billboard for each association. Not all variables are displayed in some configurations.</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Variable</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>associd</tt></td>
+ <td>association ID</td>
+ </tr>
+ <tr>
+ <td><tt>status</tt></td>
+ <td><a href="decode.html#peer">peer status word</a></td>
+ </tr>
+ <tr>
+ <td><tt>srcadr<br>
+ srcport</tt></td>
+ <td>source (remote) IP address and port</td>
+ </tr>
+ <tr>
+ <td><tt>dstadr<br>
+ dstport</tt></td>
+ <td>destination (local) IP address and port</td>
+ </tr>
+ <tr>
+ <td><tt>leap</tt></td>
+ <td>leap indicator (0-3)</td>
+ </tr>
+ <tr>
+ <td><tt>stratum</tt></td>
+ <td>stratum (0-15)</td>
+ </tr>
+ <tr>
+ <td><tt>precision</tt></td>
+ <td>precision (log<sub>2</sub> s)</td>
+ </tr>
+ <tr>
+ <td><tt>rootdelay</tt></td>
+ <td>total roundtrip delay to the primary reference clock</td>
+ </tr>
+ <tr>
+ <td><tt>rootdisp</tt></td>
+ <td>total root dispersion to the primary reference clock</td>
+ </tr>
+ <tr>
+ <td><tt>refid</tt></td>
+ <td>reference ID or <a href="decode.html#kiss">kiss code</a></td>
+ </tr>
+ <tr>
+ <td><tt>reftime</tt></td>
+ <td>reference time</td>
+ </tr>
+ <tr>
+ <td><tt>reach</tt></td>
+ <td>reach register (octal)</td>
+ </tr>
+ <tr>
+ <td><tt>unreach</tt></td>
+ <td>unreach counter</td>
+ </tr>
+ <tr>
+ <td><tt>hmode</tt></td>
+ <td>host mode (1-6)</td>
+ </tr>
+ <tr>
+ <td><tt>pmode</tt></td>
+ <td>peer mode (1-5)</td>
+ </tr>
+ <tr>
+ <td><tt>hpoll</tt></td>
+ <td>host poll exponent (log<sub>2</sub> s) (3-17)</td>
+ </tr>
+ <tr>
+ <td><tt>ppoll</tt></td>
+ <td>peer poll exponent (log<sub>2</sub> s) (3-17)</td>
+ </tr>
+ <tr>
+ <td><tt>headway</tt></td>
+ <td>headway (see <a href="rate.html">Rate Management and the Kiss-o'-Death Packet)</a></td>
+ </tr>
+ <tr>
+ <td><tt>flash</tt></td>
+ <td><a href="decode.html#flash">flash status word</a></td>
+ </tr>
+ <tr>
+ <td><tt>offset</tt></td>
+ <td>filter offset</td>
+ </tr>
+ <tr>
+ <td><tt>delay</tt></td>
+ <td>filter delay</td>
+ </tr>
+ <tr>
+ <td><tt>dispersion</tt></td>
+ <td>filter dispersion</td>
+ </tr>
+ <tr>
+ <td><tt>jitter</tt></td>
+ <td>filter jitter</td>
+ </tr>
+ <tr>
+ <td><tt>ident</tt></td>
+ <td>Autokey group name for this association</td>
+ </tr>
+ <tr>
+ <td><tt>bias</tt></td>
+ <td>unicast/broadcast bias</td>
+ </tr>
+ <tr>
+ <td><tt>xleave</tt></td>
+ <td>interleave delay (see <a href="xleave.html">NTP Interleaved Modes</a>)</td>
+ </tr>
+</table>
+<p>The bias variable is calculated when the first broadcast packet is received
+ after the calibration volley. It represents the offset of the broadcast
+ subgraph relative to the unicast subgraph. The xleave variable appears
+ only the interleaved symmetric and interleaved modes. It represents
+ the internal queuing, buffering and transmission delays for the preceding
+ packet.</p>
+<p>When the NTPv4 daemon is compiled with the OpenSSL software library, additional peer variables are displayed, including the following:</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Variable</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>flags</tt></td>
+ <td>peer flags (see Autokey specification)</td>
+ </tr>
+ <tr>
+ <td><tt>host</tt></td>
+ <td>Autokey server name</td>
+ </tr>
+ <tr>
+ <td><tt>flags</tt></td>
+ <td>peer flags (see Autokey specification)</td>
+ </tr>
+ <tr>
+ <td><tt>signature</tt></td>
+ <td>OpenSSL digest/signature scheme</td>
+ </tr>
+ <tr>
+ <td><tt>initsequence</tt></td>
+ <td>initial key ID</td>
+ </tr>
+ <tr>
+ <td><tt>initkey</tt></td>
+ <td>initial key index</td>
+ </tr>
+ <tr>
+ <td><tt>timestamp</tt></td>
+ <td>Autokey signature timestamp</td>
+ </tr>
+</table>
+<h4 id="clock">Clock Variables</h4>
+<p>The following clock variables appear in the <tt>cv</tt> billboard for each association with a reference clock. Not all variables are displayed in some configurations.</p>
+<table width="100%" border="1" cellspacing="2" cellpadding="2">
+ <tr>
+ <td>Variable</td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><tt>associd</tt></td>
+ <td>association ID</td>
+ </tr>
+ <tr>
+ <td><tt>status</tt></td>
+ <td><a href="decode.html#clock">clock status word</a></td>
+ </tr>
+ <tr>
+ <td><tt>device</tt></td>
+ <td>device description</td>
+ </tr>
+ <tr>
+ <td><tt>timecode</tt></td>
+ <td>ASCII time code string (specific to device)</td>
+ </tr>
+ <tr>
+ <td><tt>poll</tt></td>
+ <td>poll messages sent</td>
+ </tr>
+ <tr>
+ <td><tt>noreply</tt></td>
+ <td>no reply</td>
+ </tr>
+ <tr>
+ <td><tt>badformat</tt></td>
+ <td>bad format</td>
+ </tr>
+ <tr>
+ <td><tt>baddata</tt></td>
+ <td>bad date or time</td>
+ </tr>
+ <tr>
+ <td><tt>fudgetime1</tt></td>
+ <td>fudge time 1</td>
+ </tr>
+ <tr>
+ <td><tt>fudgetime2</tt></td>
+ <td>fudge time 2</td>
+ </tr>
+ <tr>
+ <td><tt>stratum</tt></td>
+ <td>driver stratum</td>
+ </tr>
+ <tr>
+ <td><tt>refid</tt></td>
+ <td>driver reference ID</td>
+ </tr>
+ <tr>
+ <td><tt>flags</tt></td>
+ <td>driver flags</td>
+ </tr>
+</table>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntptime.html b/html/ntptime.html
new file mode 100644
index 0000000..8f14761
--- /dev/null
+++ b/html/ntptime.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntptime - read and set kernel time variables</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntptime</tt> - read and set kernel time variables</h3>
+<img src="pic/pogo5.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>The turtle has been swimming in the kernel.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:55<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<hr>
+<h4>Synopsis</h4>
+<tt>ntptime [ -chr ] [ -e <i>est_error</i> ] [ -f <i>frequency</i> ] [ -m <i>max_error</i> ] [ -o <i>offset</i> ] [ -s <i>status</i> ] [ -t <i>time_constant</i>]</tt>
+<h4>Description</h4>
+<p>This program is useful only with special kernels described in the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page. It reads and displays time-related kernel variables using the <tt>ntp_gettime()</tt> system call. A similar display can be obtained using the <tt>ntpdc</tt> program and <tt>kerninfo</tt> command.</p>
+<h4>Options</h4>
+<dl>
+ <dt><tt>-c</tt></dt>
+ <dd>Display the execution time of <tt>ntptime</tt> itself.</dd>
+ <dt><tt>-e <i>est_error</i></tt></dt>
+ <dd>Specify estimated error, in microseconds.</dd>
+ <dt><tt>-f <i>frequency</i></tt></dt>
+ <dd>Specify frequency offset, in parts per million.</dd>
+ <dt><tt>-h</tt></dt>
+ <dd>Display help information.</dd>
+ <dt><tt>-m <i>max_error</i></tt></dt>
+ <dd>Specify max possible errors, in microseconds.</dd>
+ <dt><tt>-o <i>offset</i></tt></dt>
+ <dd>Specify clock offset, in microseconds.</dd>
+ <dt><tt>-r</tt></dt>
+ <dd>Display Unix and NTP times in raw format.</dd>
+ <dt><tt>-s <i>status</i></tt></dt>
+ <dd>Specify clock status. Better know what you are doing.</dd>
+ <dt><tt>-t <i>time_constant</i></tt></dt>
+ <dd>Specify time constant, an integer in the range 0-10.</dd>
+</dl>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/ntptrace.html b/html/ntptrace.html
new file mode 100644
index 0000000..bd47bd9
--- /dev/null
+++ b/html/ntptrace.html
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>ntptrace - trace a chain of NTP servers back to the primary source</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>ntptrace</tt> - trace a chain of NTP servers back to the primary source</h3>
+<img src="pic/alice13.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
+<p>The rabbit knows the way back.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<hr>
+<h4>Synopsis</h4>
+<tt>ntptrace [ -n ] [ -m <i>maxhosts</i> ] [ <i>server</i> ]</tt>
+<h4>Description</h4>
+<p><tt>ntptrace</tt> is a <tt>perl</tt> script that uses the <tt>ntpq</tt> utility program to follow the chain of NTP&nbsp;servers from a given host back to the primary time source. For <tt>ntptrace</tt> to work properly, each of these servers must implement the NTP&nbsp;Control and Monitoring Protocol specified in RFC 1305 and enable NTP&nbsp;Mode 6 packets.</p>
+<p>If given no arguments, <tt>ntptrace</tt> starts with <tt>localhost</tt>. Here is an example of the output from <tt>ntptrace</tt>:</p>
+<pre>
+% ntptrace
+localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784
+usndh.edu: stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+</pre>
+<p>On each line, the fields are (left to right): the host name, the host stratum, the time offset between that host and the local host (as measured by <tt>ntptrace</tt>; this is why it is not always zero for &quot;<tt>localhost</tt>&quot;), the host synchronization distance, and (only for stratum-1 servers) the reference clock ID. All times are given in seconds. Note that the stratum is the server hop count to the primary source, while the synchronization distance is the estimated error relative to the primary source. These terms are precisely defined in RFC-1305.</p>
+<h4>Options</h4>
+<dl>
+ <dt><tt>-m <i>max_hosts</i></tt></dt>
+ <dd>Sets the upper limit of the number of hosts to check (default: unlimited).</dd>
+ <dt><tt>-n</tt></dt>
+ <dd>Turns off the printing of host names; instead, host IP addresses are given. This may be useful if a nameserver is down.</dd>
+</dl>
+<h4>Bugs</h4>
+<p>This program makes no attempt to improve accuracy by doing multiple samples.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/orphan.html b/html/orphan.html
new file mode 100644
index 0000000..3174c8e
--- /dev/null
+++ b/html/orphan.html
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Orphan Mode</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Orphan Mode</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->4-Aug-2011 23:40<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>Sometimes an NTP subnet becomes isolated from all UTC sources such as local reference clocks or Internet time servers. In such cases it may be necessary that the subnet servers and clients remain synchronized to a common timescale, not necessarily the UTC timescale. Previously, this function was provided by the local clock driver to simulate a UTC source. A server with this driver could be used to synchronize other hosts in the subnet directly or indirectly.</p>
+<p>There are many disadvantages using the local clock driver, primarily that the subnet is vulnerable to single-point failures and multiple server redundancy is not possible. Orphan mode is intended to replace the local clock driver. It provides a single simulated UTC source with multiple servers and provides seamless switching as servers fail and recover.</p>
+<p>A common configuration for private networks includes one or more core servers operating at the lowest stratum. Good practice is to configure each of these servers as backup for the others using symmetric or broadcast modes. As long as at least one core server can reach a UTC source, the entire subnet can synchronize to it.</p>
+<p>If no UTC sources are available to any core server, one of them can provide a simulated UTC source for all other hosts in the subnet. However, only one core server can simulate the UTC source and all direct dependents, called orphan children, must select the same server, called the orphan parent.</p>
+<p>Hosts sharing the same common subnet, including potential orphan parents and potential orphan children, can be enabled for orphan mode using the <tt>orphan <em>stratum</em></tt> option of the <a href="miscopt.html#tos"> <tt>tos command</tt></a>, where <tt><i>stratum</i></tt> is some stratum less than 16 and greater than any anticipated stratum that might occur with configured Internet time servers. However, sufficient headroom should remain so every subnet host dependent on the orphan children has stratum less than 16. Where no associations for other servers or reference clocks are configured, the orphan stratum can be set to 1. These are the same considerations that guide the local clock driver stratum selection.</p>
+<p>In order to avoid premature enabling orphan mode, a holdoff delay occurs when the daemon is first started and when all sources have been lost after that. The delay is intended to allow time for other sources to become reachable and selectable. Only when the delay has expired with no sources will orphan mode be enabled. By default the delay is 300 s (five minutes), but this can be changed using the <tt> orphanwait</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command.</p>
+<p>A orphan parent with no sources shows reference ID <font face="Courier New, Courier, Monaco, monospace">LOOP</font>&nbsp;if
+ operating at stratum 1 and 127.0.0.1 (IPv4 loopback address) otherwise.
+ While ordinary NTP clients use a selection metric based on delay
+ and dispersion, orphan children use a metric computed from the IP
+ address of each core server. Each orphan child chooses the orphan
+ parent as the core server with the smallest metric.</p>
+<p>For orphan mode to work well, each core server with available sources should operate at the same stratum. All core servers and orphan children should include the same <font face="Courier New, Courier, Monaco, monospace">tos</font> command in the configuration file. Each orphan child should include in the configuration file all root servers.</p>
+<div align="center"> <img src="pic/peer.gif" alt="gif">
+ <p>Figure 1. Orphan Peer Configuration</p>
+</div>
+<p>For example, consider the peer network configuration in Figure 1, where two or more campus primary or secondary (stratum 2) servers are configured with reference clocks or public Internet primary servers and with each other using symmetric modes. With this configuration a server that loses all sources continues to discipline the system clock using the other servers as backup. Only the core servers and orphan children need to be enabled for orphan mode.</p>
+<div align="center"> <img src="pic/broad.gif" alt="gif">
+ <p>Figure 2. Orphan Broadcast Configuration</p>
+</div>
+<p>For broadcast networks each core server is configured in both broadcast server and broadcast client modes as shown in Figure 2. Orphan children operate as broadcast clients of all core servers. As in peer networks, the core servers back up each other and only they and the orphan children need to be enabled for orphan mode.</p>
+<p>In normal operation subnet hosts operate below stratum 5, so the subnet is automatically configured as described in the NTP specification. If all UTC sources are lost, all core servers become orphans and the orphan children will select the same core server to become the orphan parent.</p>
+<hr>
+<p>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</p>
+</body>
+</html>
diff --git a/html/parsedata.html b/html/parsedata.html
new file mode 100644
index 0000000..4d3734b
--- /dev/null
+++ b/html/parsedata.html
@@ -0,0 +1,352 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <meta name="generator" content="HTML Tidy, see www.w3.org">
+ <title>NTP PARSE clock data formats</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>NTP PARSE clock data formats</h3>
+ <p>The parse driver currently supports several clocks with different query mechanisms. In order for you to find a sample that might be similar to a clock you might want to integrate into parse I'll sum up the major features of the clocks (this information is distributed in the parse/clk_*.c and ntpd/refclock_parse.c files).</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->21-Oct-2010 23:44<!-- #EndDate -->
+ UTC</p>
+ <hr>
+ <h4>Meinberg clocks</h4>
+ <pre>
+Meinberg: start=&lt;STX&gt;, end=&lt;ETX&gt;, sync on start
+ pattern=&quot;\2D: . . ;T: ;U: . . ; \3&quot;
+ pattern=&quot;\2 . . ; ; : : ; \3&quot;
+ pattern=&quot;\2 . . ; ; : : ; : ; ; . . &quot;
+</pre>
+ <p>Meinberg is a German manufacturer of time code receivers. Those clocks have a pretty common output format in the stock version. In order to support NTP Meinberg was so kind to produce some special versions of the firmware for the use with NTP. So, if you are going to use a Meinberg clock please ask whether there is a special Uni Erlangen version. You can reach <a href="http://www.meinberg.de/">Meinberg</a> via the Web. Information can also be ordered via eMail from <a href="mailto:%20info@meinberg.de">info@meinberg.de</a></p>
+ <p>General characteristics:<br>
+ Meinberg clocks primarily output pulse per second and a describing ASCII string. This string can be produced in two modes: either upon the reception of a question mark or every second. NTP uses the latter mechanism. DCF77 AM clocks have a limited accuracy of a few milliseconds. The DCF77 PZF5xx variants provide higher accuracy and have a pretty good relationship between RS232 time code and the PPS signal. Except for early versions of the old GPS166 receiver type, Meinberg GPS receivers have a very good timing relationship between the datagram and the pulse. The beginning of the start bit of the first character has basically the same accuracy as the PPS signal, plus a jitter of up to 1 bit time depending on the selected baud rate, i.e. 52 &mu;s @ 19200. PPS support should always be used, if possible, in order to yield the highest possible accuracy.</p>
+ <p>The preferred tty setting for Meinberg DCF77 receivers is 9600/7E2:</p>
+ <pre>
+ CFLAG (B9600|CS7|PARENB|CREAD|HUPCL)
+ IFLAG (IGNBRK|IGNPAR|ISTRIP)
+ OFLAG 0
+ LFLAG 0
+ </pre>
+ <p>The tty setting for Meinberg GPS16x/17x receivers is 19200/8N1:</p>
+ <pre>
+ CFLAG (B19200|CS8|PARENB|CREAD|HUPCL)
+ IFLAG (IGNBRK|IGNPAR|ISTRIP)
+ OFLAG 0
+ LFLAG 0
+ </pre>
+ <p>All clocks should be run at datagram once per second.<br><br></p>
+ <p>Format of the Meinberg standard time string:</p>
+<pre>
+ <b><i>&lt;STX&gt;</i>D:<i>dd.mm.yy</i>;T:<i>w</i>;U:<i>hh.mm.ss</i>;<i>uvxy</i><i>&lt;ETX&gt;</i></b>
+ pos: 0 000000001111111111222222222233 3
+ 1 234567890123456789012345678901 2
+
+ <i>&lt;STX&gt;</i> = start-of-text, ASCII code 0x02
+ <i>dd.mm.yy</i> = day of month, month, year of the century, separated by dots
+ <i>w</i> = day of week (1..7, Monday = 1)
+ <i>hh:mm:ss</i> = hour, minute, second, separated by dots
+ <i>u</i> = '#' for GPS receivers: time is <b>not</b> synchronized
+ '#' for older PZF5xx receivers: no correlation, not synchronized
+ '#' for other devices: never sync'ed since powerup
+ ' ' if nothing of the above applies
+ <i>v</i> = '*' for GPS receivers: position has <b>not</b> been verified
+ '*' for other devices: freewheeling based on internal quartz
+ ' ' if nothing of the above applies
+ <i>x</i> = 'U' if UTC time is transmitted
+ 'S' if daylight saving time is active
+ ' ' if nothing of the above applies
+ <i>y</i> = '!' during the hour preceding start or end of daylight saving time
+ 'A' during the hour preceding a leap second
+ ' ' if nothing of the above applies
+ <i>&lt;ETX&gt;</i> = end-of-text, ASCII code 0x03
+</pre>
+ <p>Format of the Uni Erlangen time string for PZF5xx receivers:</p>
+<pre>
+ <b><i>&lt;STX&gt;</i><i>dd.mm.yy</i>; <i>w</i>; <i>hh:mm:ss</i>; <i>tuvxyza</i><i>&lt;ETX&gt;</i></b>
+ pos: 0 000000001111111111222222222233 3
+ 1 234567890123456789012345678901 2
+
+ <i>&lt;STX&gt;</i> = start-of-text, ASCII code 0x02
+ <i>dd.mm.yy</i> = day of month, month, year of the century, separated by dots
+ <i>w</i> = day of week (1..7, Monday = 1)
+ <i>hh:mm:ss</i> = hour, minute, second, separated by colons
+
+ <i>t</i> = 'U' if UTC time is transmitted, else ' '
+ <i>u</i> = '#' for older PZF5xx receivers: no correlation, not synchronized
+ '#' for PZF511 and newer: never sync'ed since powerup
+ ' ' if nothing of the above applies
+ <i>v</i> = '*' if freewheeling based on internal quartz, else ' '
+ <i>x</i> = 'S' if daylight saving time is active, else ' '
+ <i>y</i> = '!' during the hour preceding start or end of daylight saving time, else ' '
+ <i>z</i> = 'A' during the hour preceding a leap second, else ' '
+ <i>a</i> = 'R' alternate antenna (reminiscent of PZF5xx), usually ' ' for GPS receivers
+ <i>&lt;ETX&gt;</i> = end-of-text, ASCII code 0x03
+</pre>
+ <p>Format of the Uni Erlangen time string for GPS16x/GPS17x receivers:</p>
+<pre>
+ <b><i>&lt;STX&gt;</i><i>dd.mm.yy</i>; <i>w</i>; <i>hh:mm:ss</i>; <i>+uu:uu</i>; <i>uvxyzab</i>; <i>ll.lllln</i> <i>lll.lllle</i> <i>hhhh</i>m<i>&lt;ETX&gt;</i></b>
+ pos: 0 0000000011111111112222222222333333333344444444445555555555666666 6
+ 1 2345678901234567890123456789012345678901234567890123456789012345 6
+
+ <i>&lt;STX&gt;</i> = start-of-text, ASCII code 0x02
+ <i>dd.mm.yy</i> = day of month, month, year of the century, separated by dots
+ <i>w</i> = day of week (1..7, Monday = 1)
+ <i>hh:mm:ss</i> = hour, minute, second, separated by colons
+ <i>+uu:uu</i> = offset to UTC in hours and minutes, preceded by + or -
+ <i>u</i> = '#' if time is <b>not</b> synchronized, else ' '
+ <i>v</i> = '*' if position has <b>not</b> been verified, else ' '
+ <i>x</i> = 'S' if daylight saving time is active, else ' '
+ <i>y</i> = '!' during the hour preceding start or end of daylight saving time, else ' '
+ <i>z</i> = 'A' during the hour preceding a leap second, else ' '
+ <i>a</i> = 'R' alternate antenna (reminiscent of PZF5xx), usually ' ' for GPS receivers
+ <i>b</i> = 'L' during a leap second, i.e. if the seconds field is 60, else ' '
+ <i>ll.lllln</i> = position latitude in degrees, 'n' can actually be 'N' or 'S', i.e. North or South
+ <i>lll.lllle</i> = position longitude in degrees, 'e' can actually be 'E' or 'W', i.e. East or West
+ <i>hhhh</i> = position altitude in meters, always followed by 'm'
+ <i>&lt;ETX&gt;</i> = end-of-text, ASCII code 0x03
+</pre>
+ <p>Examples for Uni Erlangen strings from GPS receivers:</p>
+<pre>
+ \x02 09.07.93; 5; 08:48:26; +00:00; ; 49.5736N 11.0280E 373m \x03
+ \x02 08.11.06; 3; 14:39:39; +00:00; ; 51.9828N 9.2258E 176m \x03
+</pre>
+ <p>The Uni Erlangen formats should be used preferably. Newer Meinberg GPS receivers can be configured to transmit that format, for older devices there may be a special firmware version available.</p>
+ <p>For the Meinberg parse look into clk_meinberg.c<br><br></p>
+ <hr>
+ <h4>Raw DCF77 Data via serial line</h4>
+ <p>RAWDCF: end=TIMEOUT&gt;1.5s, sync each char (any char),generate psuedo time codes, fixed format</p>
+ <p>direct DCF77 code input</p>
+ <p>In Europe it is relatively easy/cheap the receive the german time code transmitter DCF77. The simplest version to process its signal is to feed the 100/200ms pulse of the demodulated AM signal via a level converter to an RS232 port at 50Baud. parse/clk_rawdcf.c holds all necessary decoding logic for the time code which is transmitted each minute for one minute. A bit of the time code is sent once a second.</p>
+ <pre>
+ The preferred tty setting is:
+ CFLAG (B50|CS8|CREAD|CLOCAL)
+ IFLAG 0
+ OFLAG 0
+ LFLAG 0
+</pre>
+ <h4>DCF77 raw time code</h4>
+ <p>From &quot;Zur Zeit&quot;, Physikalisch-Technische Bundesanstalt (PTB), Braunschweig und Berlin, M&auml;rz 1989<br>
+ </p>
+ <p>Timecode transmission:</p>
+ <pre>
+ AM:
+
+ time marks are send every second except for the second before the
+ next minute mark
+ time marks consist of a reduction of transmitter power to 25%
+ of the nominal level
+ the falling edge is the time indication (on time)
+ time marks of a 100ms duration constitute a logical 0
+ time marks of a 200ms duration constitute a logical 1
+</pre>
+ <p>see the spec. (basically a (non-)inverted psuedo random phase shift) encoding:</p>
+ <pre>
+ FM:
+
+ Second Contents
+ 0 - 10 AM: free, FM: 0
+ 11 - 14 free
+ 15 R - alternate antenna
+ 16 A1 - expect zone change (1 hour before)
+ 17 - 18 Z1,Z2 - time zone
+ 0 0 illegal
+ 0 1 MEZ (MET)
+ 1 0 MESZ (MED, MET DST)
+ 1 1 illegal
+ 19 A2 - expect leap insertion/deletion (1 hour before)
+ 20 S - start of time code (1)
+ 21 - 24 M1 - BCD (lsb first) Minutes
+ 25 - 27 M10 - BCD (lsb first) 10 Minutes
+ 28 P1 - Minute Parity (even)
+ 29 - 32 H1 - BCD (lsb first) Hours
+ 33 - 34 H10 - BCD (lsb first) 10 Hours
+ 35 P2 - Hour Parity (even)
+ 36 - 39 D1 - BCD (lsb first) Days
+ 40 - 41 D10 - BCD (lsb first) 10 Days
+ 42 - 44 DW - BCD (lsb first) day of week (1: Monday -&gt; 7: Sunday)
+ 45 - 49 MO1 - BCD (lsb first) Month
+ 50 MO10 - 10 Months
+ 51 - 53 Y1 - BCD (lsb first) Years
+ 54 - 57 Y10 - BCD (lsb first) 10 Years
+ 58 P3 - Date Parity (even)
+ 59 - usually missing (minute indication), except for leap insertion
+</pre>
+ <hr>
+ <h4>Schmid clock</h4>
+ <p>Schmid clock: needs poll, binary input, end='\xFC', sync start</p>
+ <p>The Schmid clock is a DCF77 receiver that sends a binary time code at the reception of a flag byte. The contents if the flag byte determined the time code format. The binary time code is delimited by the byte 0xFC.</p>
+ <pre>
+ TTY setup is:
+ CFLAG (B1200|CS8|CREAD|CLOCAL)
+ IFLAG 0
+ OFLAG 0
+ LFLAG 0
+
+</pre>
+ <p>The command to Schmid's DCF77 clock is a single byte; each bit allows the user to select some part of the time string, as follows (the output for the lsb is sent first).</p>
+ <pre>
+ Bit 0: time in MEZ, 4 bytes *binary, not BCD*; hh.mm.ss.tenths
+ Bit 1: date 3 bytes *binary, not BCD: dd.mm.yy
+ Bit 2: week day, 1 byte (unused here)
+ Bit 3: time zone, 1 byte, 0=MET, 1=MEST. (unused here)
+ Bit 4: clock status, 1 byte, 0=time invalid,
+ 1=time from crystal backup,
+ 3=time from DCF77
+ Bit 5: transmitter status, 1 byte,
+ bit 0: backup antenna
+ bit 1: time zone change within 1h
+ bit 3,2: TZ 01=MEST, 10=MET
+ bit 4: leap second will be
+ added within one hour
+ bits 5-7: Zero
+ Bit 6: time in backup mode, units of 5 minutes (unused here)
+</pre>
+ <hr>
+ <h4>Trimble SV6 ASCII time code (TAIP)</h4>
+ <p>Trimble SV6: needs poll, ascii timecode, start='&gt;', end='&lt;', query='&gt;QTM&lt;', eol='&lt;'</p>
+ <p>Trimble SV6 is a GPS receiver with PPS output. It needs to be polled. It also need a special tty mode setup (EOL='&lt;').</p>
+ <pre>
+ TTY setup is:
+ CFLAG (B4800|CS8|CREAD)
+ IFLAG (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON)
+ OFLAG (OPOST|ONLCR)
+ LFLAG (ICANON|ECHOK)
+</pre>
+ <p>Special flags are:</p>
+ <pre> PARSE_F_PPSPPS - use CIOGETEV for PPS time stamping
+ PARSE_F_PPSONSECOND - the time code is not related to
+ the PPS pulse (so use the time code
+ only for the second epoch)
+
+ Timecode
+ 0000000000111111111122222222223333333 / char
+ 0123456789012345678901234567890123456 \ posn
+ &gt;RTMhhmmssdddDDMMYYYYoodnnvrrrrr;*xx&lt; Actual
+ ----33445566600112222BB7__-_____--99- Parse
+ &gt;RTM 1 ;* &lt; Check
+</pre>
+ <hr>
+ <h4>ELV DCF7000</h4>
+ <p>ELV DCF7000: end='\r', pattern=&quot; - - - - - - - \r&quot;</p>
+ <p>The ELV DCF7000 is a cheap DCF77 receiver sending each second a time code (though not very precise!) delimited by '`r'</p>
+ <pre>
+ Timecode
+ YY-MM-DD-HH-MM-SS-FF\r
+
+ FF&amp;0x1 - DST
+ FF&amp;0x2 - DST switch warning
+ FF&amp;0x4 - unsynchronised
+</pre>
+ <hr>
+ <h4>HOPF 6021 und Kompatible</h4>
+ <p>HOPF Funkuhr 6021 mit serieller Schnittstelle Created by F.Schnekenbuehl &lt;frank@comsys.dofn.de&gt; from clk_rcc8000.c Nortel DASA Network Systems GmbH, Department: ND250 A Joint venture of Daimler-Benz Aerospace and Nortel.</p>
+ <pre>
+ hopf Funkuhr 6021
+ used with 9600,8N1,
+ UTC via serial line
+ &quot;Sekundenvorlauf&quot; ON
+ ETX zum Sekundenvorlauf ON
+ dataformat 6021
+ output time and date
+ transmit with control characters
+ transmit evry second
+ </pre>
+ <p>Type 6021 Serial Output format</p>
+ <pre>
+ 000000000011111111 / char
+ 012345678901234567 \ position
+ sABHHMMSSDDMMYYnre Actual
+ C4110046231195 Parse
+ s enr Check
+
+ s = STX (0x02), e = ETX (0x03)
+ n = NL (0x0A), r = CR (0x0D)
+
+ A B - Status and weekday
+
+ A - Status
+
+ 8 4 2 1
+ x x x 0 - no announcement
+ x x x 1 - Summertime - wintertime - summertime announcement
+ x x 0 x - Wintertime
+ x x 1 x - Summertime
+ 0 0 x x - Time/Date invalid
+ 0 1 x x - Internal clock used
+ 1 0 x x - Radio clock
+ 1 1 x x - Radio clock highprecision
+
+ B - 8 4 2 1
+ 0 x x x - MESZ/MEZ
+ 1 x x x - UTC
+ x 0 0 1 - Monday
+ x 0 1 0 - Tuesday
+ x 0 1 1 - Wednesday
+ x 1 0 0 - Thursday
+ x 1 0 1 - Friday
+ x 1 1 0 - Saturday
+ x 1 1 1 - Sunday
+</pre>
+ <hr>
+ <h4>Diem Computime Clock</h4>
+ <p>The Computime receiver sends a datagram in the following format every minute</p>
+ <pre>
+ Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF
+ Pos 0123456789012345678901 2 3
+ 0000000000111111111122 2 2
+ Parse T: : : : : : : \r\n
+
+ T Startcharacter &quot;T&quot; specifies start of the timestamp
+ YY Year MM Month 1-12
+ MD Day of the month
+ WD Day of week
+ HH Hour
+ MM Minute
+ SS Second
+ CR Carriage return
+ LF Linefeed
+</pre>
+ <hr>
+ <h4>WHARTON 400A Series Clock with a 404.2 Serial interface</h4>
+ <p>The WHARTON 400A Series clock is able to send date/time serial messages in 7 output formats. We use format 1 here because it is the shortest. We set up the clock to send a datagram every second. For use with this driver, the WHARTON 400A Series clock must be set-up as follows :</p>
+ <pre>
+ Programmable Selected
+ Option No Option
+ BST or CET display 3 9 or 11
+ No external controller 7 0
+ Serial Output Format 1 9 1
+ Baud rate 9600 bps 10 96
+ Bit length 8 bits 11 8
+ Parity even 12 E
+</pre>
+ <p>WHARTON 400A Series output format 1 is as follows :</p>
+ <pre>
+ Timestamp STXssmmhhDDMMYYSETX
+ Pos 0 12345678901234
+ 0 00000000011111
+
+ STX start transmission (ASCII 0x02)
+ ETX end transmission (ASCII 0x03)
+ ss Second expressed in reversed decimal (units then tens)
+ mm Minute expressed in reversed decimal
+ hh Hour expressed in reversed decimal
+ DD Day of month expressed in reversed decimal
+ MM Month expressed in reversed decimal (January is 1)
+ YY Year (without century) expressed in reversed decimal
+ S Status byte : 0x30 +
+ bit 0 0 = MSF source 1 = DCF source
+ bit 1 0 = Winter time 1 = Summer time
+ bit 2 0 = not synchronised 1 = synchronised
+ bit 3 0 = no early warning 1 = early warning
+</pre>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+</html>
diff --git a/html/parsenew.html b/html/parsenew.html
new file mode 100644
index 0000000..244612f
--- /dev/null
+++ b/html/parsenew.html
@@ -0,0 +1,199 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <title>Making PARSE Clocks</title>
+ <link href="scripts/style.css" type="text/css" rel="stylesheet">
+ </head>
+
+ <body>
+ <h3>How to build new PARSE clocks</h3>
+ <p>Here is an attempt to sketch out what you need to do in order to add another clock to the parse driver: Currently the implementation is being cleaned up - so not all information in here is completely correct. Refer to the included code where in doubt.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->13-Oct-2010 00:33<!-- #EndDate -->
+ UTC</p>
+ <p>Prerequisites:</p>
+ <ul>
+ <li>Does the system you want the clock connect to have the include files termio.h or termios.h ? (You need that for the parse driver)
+ </ul>
+ <p>What to do:</p>
+ <p>Make a conversion module (libparse/clk_*.c)</p>
+ <ol>
+ <li>What ist the time code format ?
+ <ul>
+ <li>find year, month, day, hour, minute, second, status (synchronised or not), possibly time zone information (you need to give the offset to UTC) You will have to convert the data from a string into a struct clocktime:
+ <pre>
+ struct clocktime /* clock time broken up from time code */
+ {
+ long day;
+ long month;
+ long year;
+ long hour;
+ long minute;
+ long second;
+ long usecond;
+ long utcoffset; /* in seconds */
+ time_t utcoffset; /* true utc time instead of date/time */
+ long flags; /* current clock status */
+ };
+</pre>
+ <p>Conversion is usually simple and straight forward. For the flags following values can be OR'ed together:</p>
+ <pre>
+ PARSEB_ANNOUNCE switch time zone warning (informational only)
+ PARSEB_POWERUP no synchronisation - clock confused (must set then)
+ PARSEB_NOSYNC timecode currently not confirmed (must set then)
+ usually on reception error when there is still a
+ chance the the generated time is still ok.
+
+ PARSEB_DST DST in effect (informational only)
+ PARSEB_UTC timecode contains UTC time (informational only)
+ PARSEB_LEAPADD LEAP addition warning (prior to leap happening - must set when imminent)
+ also used for time code that do not encode the
+ direction (as this is currently the default).
+ PARSEB_LEAPDEL LEAP deletion warning (prior to leap happening - must set when imminent)
+ PARSEB_ALTERNATE backup transmitter (informational only)
+ PARSEB_POSITION geographic position available (informational only)
+ PARSEB_LEAPSECOND actual leap second (this time code is the leap
+ second - informational only)
+</pre>
+ <p>These are feature flags denoting items that are supported by the clock:</p>
+ <pre>
+ PARSEB_S_LEAP supports LEAP - might set PARSEB_LEAP
+ PARSEB_S_ANTENNA supports ANTENNA - might set PARSEB_ALTERNATE
+ PARSEB_S_PPS supports PPS time stamping
+ PARSEB_S_POSITION supports position information (GPS)
+ </pre>
+ <p>If the utctime field is non zero this value will be take as time code value. This allows for conversion routines that already have the utc time value. The utctime field gives the seconds since Jan 1st 1970, 0:00:00. The useconds field gives the respective usec value. The fields for date and time (down to second resolution) will be ignored.</p>
+ <p>Conversion is done in the cvt_* routine in parse/clk_*.c files. look in them for examples. The basic structure is:</p>
+ <pre>
+ struct clockformat &lt;yourclock&gt;_format = {
+ lots of fields for you to fill out (see below)
+ };
+
+ static cvt_&lt;yourclock&gt;()
+ ...
+ {
+ if (&lt;I do not recognize my time code&gt;) {
+ return CVT_NONE;
+ } else {
+ if (&lt;conversion into clockformat is ok&gt;) {
+ &lt;set all necessary flags&gt;;
+ return CVT_OK;
+ } else {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ }
+</pre>
+ <p>The struct clockformat is the interface to the rest of the parse driver - it holds all information necessary for finding the clock message and doing the appropriate time stamping.</p>
+ <pre>
+struct clockformat
+{
+ u_long (*input)();
+ /* input routine - your routine - cvt_&lt;yourclock&gt; */
+ u_long (*convert)();
+ /* conversion routine - your routine - cvt_&lt;yourclock&gt; */
+ /* routine for handling RS232 sync events (time stamps) - usually sync_simple */
+ u_long (*syncpps)();
+ /* PPS input routine - usually pps_one */
+ void *data;
+ /* local parameters - any parameters/data/configuration info your conversion
+ routine might need */
+ char *name;
+ /* clock format name - Name of the time code */
+ unsigned short length;
+ /* maximum length of data packet for your clock format */
+ u_long flags;
+ /* information for the parser what to look for */
+};
+</pre>
+ <p>The above should have given you some hints on how to build a clk_*.c file with the time code conversion. See the examples and pick a clock closest to yours and tweak the code to match your clock.</p>
+ <p>In order to make your clk_*.c file usable a reference to the clockformat structure must be put into parse_conf.c.</p>
+ </ul>
+ <li>TTY setup and initialisation/configuration will be done in ntpd/refclock_parse.c.
+ <ul>
+ <li>Find out the exact tty settings for your clock (baud rate, parity, stop bits, character size, ...) and note them in terms of termio*.h c_cflag macros.
+ <li>in ntpd/refclock_parse.c fill out a new the struct clockinfo element (that allocates a new &quot;IP&quot; address - see comments) (see all the other clocks for example)
+ <pre>
+ struct clockinfo
+ {
+ u_long cl_flags; /* operation flags (io modes) */
+ PARSE_F_PPSPPS use loopfilter PPS code (CIOGETEV)
+ PARSE_F_PPSONSECOND PPS pulses are on second
+ usually flags stay 0 as they are used only for special setups
+
+ void (*cl_poll)(); /* active poll routine */
+ The routine to call when the clock needs data sent to it in order to
+ get a time code from the clock (e.g. Trimble clock)
+
+ int (*cl_init)(); /* active poll init routine */
+ The routine to call for very special initializations.
+
+ void (*cl_event)(); /* special event handling (e.g. reset clock) */
+ What to do, when an event happens - used to re-initialize clocks on timeout.
+
+ void (*cl_end)(); /* active poll end routine */
+ The routine to call to undo any special initialisation (free memory/timers)
+
+ void *cl_data; /* local data area for &quot;poll&quot; mechanism */
+ local data for polling routines
+
+ u_fp cl_rootdelay; /* rootdelay */
+ NTP rootdelay estimate (usually 0)
+
+ u_long cl_basedelay; /* current offset - unsigned l_fp
+ fractional part (fraction) by
+ which the RS232 time code is
+ delayed from the actual time. */
+
+ u_long cl_ppsdelay; /* current PPS offset - unsigned l_fp fractional
+ time (fraction) by which the PPS time stamp is delayed (usually 0)
+ part */
+
+ char *cl_id; /* ID code (usually &quot;DCF&quot;) */
+ Refclock id - (max 4 chars)
+
+ char *cl_description; /* device name */
+ Name of this device.
+
+ char *cl_format; /* fixed format */
+ If the data format cann not ne detected automatically this is the name
+ as in clk_*.c clockformat.
+
+ u_char cl_type; /* clock type (ntp control) */
+ Type if clock as in clock status word (ntp control messages) - usually 0
+
+ u_long cl_maxunsync; /* time to trust oscillator after losing synch
+ */
+ seconds a clock can be trusted after losing synchronisation.
+
+ u_long cl_speed; /* terminal input &amp; output baudrate */
+ u_long cl_cflag; /* terminal io flags */
+ u_long cl_iflag; /* terminal io flags */
+ u_long cl_oflag; /* terminal io flags */
+ u_long cl_lflag; /* terminal io flags */
+ termio*.h tty modes.
+
+ u_long cl_samples; /* samples for median filter */
+ u_long cl_keep; /* samples for median filter to keep */
+ median filter parameters - smoothing and rejection of bad samples
+ } clockinfo[] = {
+ ...,&lt;other clocks&gt;,...
+ { &lt; your parameters&gt; },
+ };
+
+</pre>
+ </ul>
+ </ol>
+ <p>Well, this is very sketchy, i know. But I hope it helps a little bit. The best way is to look which clock comes closest to your and tweak that code.</p>
+ <p>Two sorts of clocks are used with parse. Clocks that automatically send their time code (once a second) do not need entries in the poll routines because they send the data all the time. The second sort are the clocks that need a command sent to them in order to reply with a time code (like the Trimble clock).</p>
+ <p>For questions: <a href="mailto:%20kardel AT acm.org">kardel@acm.org</a>.</p>
+ <p>Please include an exact description on how your clock works. (initialisation, TTY modes, strings to be sent to it, responses received from the clock).</p>
+ <hr>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+ </body>
+
+ <body></body>
+
+</html>
diff --git a/html/pic/9400n.jpg b/html/pic/9400n.jpg
new file mode 100644
index 0000000..9209b90
--- /dev/null
+++ b/html/pic/9400n.jpg
Binary files differ
diff --git a/html/pic/alice11.gif b/html/pic/alice11.gif
new file mode 100644
index 0000000..62d0c9b
--- /dev/null
+++ b/html/pic/alice11.gif
Binary files differ
diff --git a/html/pic/alice13.gif b/html/pic/alice13.gif
new file mode 100644
index 0000000..c928ff7
--- /dev/null
+++ b/html/pic/alice13.gif
Binary files differ
diff --git a/html/pic/alice15.gif b/html/pic/alice15.gif
new file mode 100644
index 0000000..e17b5fd
--- /dev/null
+++ b/html/pic/alice15.gif
Binary files differ
diff --git a/html/pic/alice23.gif b/html/pic/alice23.gif
new file mode 100644
index 0000000..bc258a0
--- /dev/null
+++ b/html/pic/alice23.gif
Binary files differ
diff --git a/html/pic/alice31.gif b/html/pic/alice31.gif
new file mode 100644
index 0000000..ea3d20c
--- /dev/null
+++ b/html/pic/alice31.gif
Binary files differ
diff --git a/html/pic/alice32.gif b/html/pic/alice32.gif
new file mode 100644
index 0000000..db7cc40
--- /dev/null
+++ b/html/pic/alice32.gif
Binary files differ
diff --git a/html/pic/alice35.gif b/html/pic/alice35.gif
new file mode 100644
index 0000000..aa0ca43
--- /dev/null
+++ b/html/pic/alice35.gif
Binary files differ
diff --git a/html/pic/alice38.gif b/html/pic/alice38.gif
new file mode 100644
index 0000000..e40adba
--- /dev/null
+++ b/html/pic/alice38.gif
Binary files differ
diff --git a/html/pic/alice44.gif b/html/pic/alice44.gif
new file mode 100644
index 0000000..953387e
--- /dev/null
+++ b/html/pic/alice44.gif
Binary files differ
diff --git a/html/pic/alice47.gif b/html/pic/alice47.gif
new file mode 100644
index 0000000..6b27160
--- /dev/null
+++ b/html/pic/alice47.gif
Binary files differ
diff --git a/html/pic/alice51.gif b/html/pic/alice51.gif
new file mode 100644
index 0000000..1e9082a
--- /dev/null
+++ b/html/pic/alice51.gif
Binary files differ
diff --git a/html/pic/alice61.gif b/html/pic/alice61.gif
new file mode 100644
index 0000000..5687c38
--- /dev/null
+++ b/html/pic/alice61.gif
Binary files differ
diff --git a/html/pic/barnstable.gif b/html/pic/barnstable.gif
new file mode 100644
index 0000000..17d9cdd
--- /dev/null
+++ b/html/pic/barnstable.gif
Binary files differ
diff --git a/html/pic/beaver.gif b/html/pic/beaver.gif
new file mode 100644
index 0000000..3d0c8eb
--- /dev/null
+++ b/html/pic/beaver.gif
Binary files differ
diff --git a/html/pic/boom3.gif b/html/pic/boom3.gif
new file mode 100644
index 0000000..1a95d40
--- /dev/null
+++ b/html/pic/boom3.gif
Binary files differ
diff --git a/html/pic/boom3a.gif b/html/pic/boom3a.gif
new file mode 100644
index 0000000..14bfe5b
--- /dev/null
+++ b/html/pic/boom3a.gif
Binary files differ
diff --git a/html/pic/boom4.gif b/html/pic/boom4.gif
new file mode 100644
index 0000000..0661ac4
--- /dev/null
+++ b/html/pic/boom4.gif
Binary files differ
diff --git a/html/pic/broad.gif b/html/pic/broad.gif
new file mode 100644
index 0000000..b372bb5
--- /dev/null
+++ b/html/pic/broad.gif
Binary files differ
diff --git a/html/pic/bustardfly.gif b/html/pic/bustardfly.gif
new file mode 100644
index 0000000..b5c6e91
--- /dev/null
+++ b/html/pic/bustardfly.gif
Binary files differ
diff --git a/html/pic/c51.jpg b/html/pic/c51.jpg
new file mode 100644
index 0000000..d90ad55
--- /dev/null
+++ b/html/pic/c51.jpg
Binary files differ
diff --git a/html/pic/description.jpg b/html/pic/description.jpg
new file mode 100644
index 0000000..2153180
--- /dev/null
+++ b/html/pic/description.jpg
Binary files differ
diff --git a/html/pic/discipline.gif b/html/pic/discipline.gif
new file mode 100644
index 0000000..3280d14
--- /dev/null
+++ b/html/pic/discipline.gif
Binary files differ
diff --git a/html/pic/dogsnake.gif b/html/pic/dogsnake.gif
new file mode 100644
index 0000000..1f9755d
--- /dev/null
+++ b/html/pic/dogsnake.gif
Binary files differ
diff --git a/html/pic/driver29.gif b/html/pic/driver29.gif
new file mode 100644
index 0000000..b0415ae
--- /dev/null
+++ b/html/pic/driver29.gif
Binary files differ
diff --git a/html/pic/driver43_1.gif b/html/pic/driver43_1.gif
new file mode 100644
index 0000000..f1ff7c7
--- /dev/null
+++ b/html/pic/driver43_1.gif
Binary files differ
diff --git a/html/pic/driver43_2.jpg b/html/pic/driver43_2.jpg
new file mode 100644
index 0000000..c53639c
--- /dev/null
+++ b/html/pic/driver43_2.jpg
Binary files differ
diff --git a/html/pic/fg6021.gif b/html/pic/fg6021.gif
new file mode 100644
index 0000000..e6e3071
--- /dev/null
+++ b/html/pic/fg6021.gif
Binary files differ
diff --git a/html/pic/fg6039.jpg b/html/pic/fg6039.jpg
new file mode 100644
index 0000000..25fc7c4
--- /dev/null
+++ b/html/pic/fg6039.jpg
Binary files differ
diff --git a/html/pic/fig_3_1.gif b/html/pic/fig_3_1.gif
new file mode 100644
index 0000000..a280a89
--- /dev/null
+++ b/html/pic/fig_3_1.gif
Binary files differ
diff --git a/html/pic/flatheads.gif b/html/pic/flatheads.gif
new file mode 100644
index 0000000..707cb8c
--- /dev/null
+++ b/html/pic/flatheads.gif
Binary files differ
diff --git a/html/pic/flt1.gif b/html/pic/flt1.gif
new file mode 100644
index 0000000..d08c5ac
--- /dev/null
+++ b/html/pic/flt1.gif
Binary files differ
diff --git a/html/pic/flt2.gif b/html/pic/flt2.gif
new file mode 100644
index 0000000..d4909cb
--- /dev/null
+++ b/html/pic/flt2.gif
Binary files differ
diff --git a/html/pic/flt3.gif b/html/pic/flt3.gif
new file mode 100644
index 0000000..1eefbe1
--- /dev/null
+++ b/html/pic/flt3.gif
Binary files differ
diff --git a/html/pic/flt4.gif b/html/pic/flt4.gif
new file mode 100644
index 0000000..3f8b671
--- /dev/null
+++ b/html/pic/flt4.gif
Binary files differ
diff --git a/html/pic/flt5.gif b/html/pic/flt5.gif
new file mode 100644
index 0000000..52714ac
--- /dev/null
+++ b/html/pic/flt5.gif
Binary files differ
diff --git a/html/pic/flt6.gif b/html/pic/flt6.gif
new file mode 100644
index 0000000..0451e86
--- /dev/null
+++ b/html/pic/flt6.gif
Binary files differ
diff --git a/html/pic/flt7.gif b/html/pic/flt7.gif
new file mode 100644
index 0000000..55f07d8
--- /dev/null
+++ b/html/pic/flt7.gif
Binary files differ
diff --git a/html/pic/flt8.gif b/html/pic/flt8.gif
new file mode 100644
index 0000000..04bd32b
--- /dev/null
+++ b/html/pic/flt8.gif
Binary files differ
diff --git a/html/pic/flt9.gif b/html/pic/flt9.gif
new file mode 100644
index 0000000..e107c48
--- /dev/null
+++ b/html/pic/flt9.gif
Binary files differ
diff --git a/html/pic/freq1211.gif b/html/pic/freq1211.gif
new file mode 100644
index 0000000..2a56416
--- /dev/null
+++ b/html/pic/freq1211.gif
Binary files differ
diff --git a/html/pic/gadget.jpg b/html/pic/gadget.jpg
new file mode 100644
index 0000000..6289911
--- /dev/null
+++ b/html/pic/gadget.jpg
Binary files differ
diff --git a/html/pic/gps167.jpg b/html/pic/gps167.jpg
new file mode 100644
index 0000000..8a87a75
--- /dev/null
+++ b/html/pic/gps167.jpg
Binary files differ
diff --git a/html/pic/group.gif b/html/pic/group.gif
new file mode 100644
index 0000000..26aff06
--- /dev/null
+++ b/html/pic/group.gif
Binary files differ
diff --git a/html/pic/hornraba.gif b/html/pic/hornraba.gif
new file mode 100644
index 0000000..3077d75
--- /dev/null
+++ b/html/pic/hornraba.gif
Binary files differ
diff --git a/html/pic/igclock.gif b/html/pic/igclock.gif
new file mode 100644
index 0000000..940f330
--- /dev/null
+++ b/html/pic/igclock.gif
Binary files differ
diff --git a/html/pic/neoclock4x.gif b/html/pic/neoclock4x.gif
new file mode 100755
index 0000000..4df95af
--- /dev/null
+++ b/html/pic/neoclock4x.gif
Binary files differ
diff --git a/html/pic/offset1211.gif b/html/pic/offset1211.gif
new file mode 100644
index 0000000..8a73287
--- /dev/null
+++ b/html/pic/offset1211.gif
Binary files differ
diff --git a/html/pic/oncore_evalbig.gif b/html/pic/oncore_evalbig.gif
new file mode 100644
index 0000000..931a7f1
--- /dev/null
+++ b/html/pic/oncore_evalbig.gif
Binary files differ
diff --git a/html/pic/oncore_remoteant.jpg b/html/pic/oncore_remoteant.jpg
new file mode 100644
index 0000000..0f1d048
--- /dev/null
+++ b/html/pic/oncore_remoteant.jpg
Binary files differ
diff --git a/html/pic/oncore_utplusbig.gif b/html/pic/oncore_utplusbig.gif
new file mode 100644
index 0000000..dec7e71
--- /dev/null
+++ b/html/pic/oncore_utplusbig.gif
Binary files differ
diff --git a/html/pic/oz2.gif b/html/pic/oz2.gif
new file mode 100644
index 0000000..d4982f0
--- /dev/null
+++ b/html/pic/oz2.gif
Binary files differ
diff --git a/html/pic/panda.gif b/html/pic/panda.gif
new file mode 100644
index 0000000..6feb743
--- /dev/null
+++ b/html/pic/panda.gif
Binary files differ
diff --git a/html/pic/pd_om006.gif b/html/pic/pd_om006.gif
new file mode 100644
index 0000000..3266285
--- /dev/null
+++ b/html/pic/pd_om006.gif
Binary files differ
diff --git a/html/pic/pd_om011.gif b/html/pic/pd_om011.gif
new file mode 100644
index 0000000..06566b9
--- /dev/null
+++ b/html/pic/pd_om011.gif
Binary files differ
diff --git a/html/pic/peer.gif b/html/pic/peer.gif
new file mode 100644
index 0000000..35bd36f
--- /dev/null
+++ b/html/pic/peer.gif
Binary files differ
diff --git a/html/pic/pogo.gif b/html/pic/pogo.gif
new file mode 100644
index 0000000..68dacbe
--- /dev/null
+++ b/html/pic/pogo.gif
Binary files differ
diff --git a/html/pic/pogo1a.gif b/html/pic/pogo1a.gif
new file mode 100644
index 0000000..433e467
--- /dev/null
+++ b/html/pic/pogo1a.gif
Binary files differ
diff --git a/html/pic/pogo3a.gif b/html/pic/pogo3a.gif
new file mode 100644
index 0000000..49f1359
--- /dev/null
+++ b/html/pic/pogo3a.gif
Binary files differ
diff --git a/html/pic/pogo4.gif b/html/pic/pogo4.gif
new file mode 100644
index 0000000..e0a3b17
--- /dev/null
+++ b/html/pic/pogo4.gif
Binary files differ
diff --git a/html/pic/pogo5.gif b/html/pic/pogo5.gif
new file mode 100644
index 0000000..87ad8e4
--- /dev/null
+++ b/html/pic/pogo5.gif
Binary files differ
diff --git a/html/pic/pogo6.gif b/html/pic/pogo6.gif
new file mode 100644
index 0000000..3f98c52
--- /dev/null
+++ b/html/pic/pogo6.gif
Binary files differ
diff --git a/html/pic/pogo7.gif b/html/pic/pogo7.gif
new file mode 100644
index 0000000..36befe7
--- /dev/null
+++ b/html/pic/pogo7.gif
Binary files differ
diff --git a/html/pic/pogo8.gif b/html/pic/pogo8.gif
new file mode 100644
index 0000000..6860efb
--- /dev/null
+++ b/html/pic/pogo8.gif
Binary files differ
diff --git a/html/pic/pzf509.jpg b/html/pic/pzf509.jpg
new file mode 100644
index 0000000..b51303b
--- /dev/null
+++ b/html/pic/pzf509.jpg
Binary files differ
diff --git a/html/pic/pzf511.jpg b/html/pic/pzf511.jpg
new file mode 100644
index 0000000..c470af2
--- /dev/null
+++ b/html/pic/pzf511.jpg
Binary files differ
diff --git a/html/pic/rabbit.gif b/html/pic/rabbit.gif
new file mode 100644
index 0000000..ab6ec5f
--- /dev/null
+++ b/html/pic/rabbit.gif
Binary files differ
diff --git a/html/pic/radio2.jpg b/html/pic/radio2.jpg
new file mode 100644
index 0000000..ceb7c76
--- /dev/null
+++ b/html/pic/radio2.jpg
Binary files differ
diff --git a/html/pic/sheepb.jpg b/html/pic/sheepb.jpg
new file mode 100644
index 0000000..1b3323e
--- /dev/null
+++ b/html/pic/sheepb.jpg
Binary files differ
diff --git a/html/pic/stack1a.jpg b/html/pic/stack1a.jpg
new file mode 100644
index 0000000..1e023cb
--- /dev/null
+++ b/html/pic/stack1a.jpg
Binary files differ
diff --git a/html/pic/stats.gif b/html/pic/stats.gif
new file mode 100644
index 0000000..b0d0aaa
--- /dev/null
+++ b/html/pic/stats.gif
Binary files differ
diff --git a/html/pic/sx5.gif b/html/pic/sx5.gif
new file mode 100644
index 0000000..504e38b
--- /dev/null
+++ b/html/pic/sx5.gif
Binary files differ
diff --git a/html/pic/thunderbolt.jpg b/html/pic/thunderbolt.jpg
new file mode 100644
index 0000000..49253ab
--- /dev/null
+++ b/html/pic/thunderbolt.jpg
Binary files differ
diff --git a/html/pic/time1.gif b/html/pic/time1.gif
new file mode 100644
index 0000000..88e7042
--- /dev/null
+++ b/html/pic/time1.gif
Binary files differ
diff --git a/html/pic/tonea.gif b/html/pic/tonea.gif
new file mode 100644
index 0000000..195a3df
--- /dev/null
+++ b/html/pic/tonea.gif
Binary files differ
diff --git a/html/pic/tribeb.gif b/html/pic/tribeb.gif
new file mode 100644
index 0000000..59e8a7c
--- /dev/null
+++ b/html/pic/tribeb.gif
Binary files differ
diff --git a/html/pic/wingdorothy.gif b/html/pic/wingdorothy.gif
new file mode 100644
index 0000000..3f2e0be
--- /dev/null
+++ b/html/pic/wingdorothy.gif
Binary files differ
diff --git a/html/poll.html b/html/poll.html
new file mode 100644
index 0000000..aeb9c32
--- /dev/null
+++ b/html/poll.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Poll Process</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Poll Process</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:17<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>The poll process sends NTP packets at intervals determined by the clock discipline algorithm. The process is designed to provide a sufficient update rate to maximize accuracy while minimizing network overhead. The process is designed to operate over a poll exponent range between 3 (8 s) and 17 (36 hr). The minimum and maximum poll exponent within this range can be set using the <tt>minpoll</tt> and <tt>maxpoll</tt> options of the <a href="confopt.html#option"><tt>server</tt></a> command, with default 6 (64 s) and 10 (1024 s), respectively.</p>
+<p> The poll interval is managed by a heuristic algorithm developed over several years of experimentation. It depends on an exponentially weighted average of clock offset differences, called <em>clock jitter</em>, and a jiggle counter, which is initially set to zero. When a clock update is received and the offset exceeds the clock jitter by a factor of 4, the jiggle counter is increased by the poll exponent; otherwise, it is decreased by twice the poll exponent. If the jiggle counter is greater than an arbitrary threshold of 30, it is reset to 0 and the the poll exponent is increased by 1. If the jiggle counter is less than -30, it is set to 0 and the poll exponent decreased by 1. In effect, the algorithm has a relatively slow reaction to good news, but a relatively fast reaction to bad news.</p>
+<p>As an option of the <a href="confopt.html#option"><tt>server</tt></a> command, instead of a single packet, the poll process can send a burst of several packets at 2-s intervals. This is designed to reduce the time to synchronize the clock at initial startup (<tt>iburst</tt>) and/or to reduce the phase noise at the longer poll intervals (<tt>burst</tt>). The <tt>iburst</tt> option is effective only when the server is unreachable, while the <tt>burst</tt> option is effective only when the server is reachable. The two options are independent of each other and both can be enabled at the same time.</p>
+<p>For the <tt>iburst</tt> option the number of packets in the burst is six, which is the number normally needed to synchronize the clock; for the <tt>burst</tt> option, the number of packets in the burst is determined by the difference between the current poll exponent and the minimum poll exponent as a power of 2. For instance, with the default minimum poll exponent of 6 (64 s), only one packet is sent for every poll, while the full number of eight packets is sent at poll exponents of 9 (512 s) or more. This insures that the average headway will never exceed the minimum headway.</p>
+<p>The burst options can result in increased load on the network if not carefully designed. Both options are affected by the provisions described on the <a href="rate.html">Rate Management and the Kiss-o'-Death Packet</a> page. In addition, when <tt>iburst</tt> or <tt>burst</tt> are enabled, the first packet of the burst is sent, but the remaining packets sent only when the reply to the fist packet is received. If no reply has been received after a timeout set by the <tt>minpoll</tt> option, the first packet is sent again. This means that, even if a server is unreachable, the network load is no more than at the minimum poll interval.</p>
+<p>To further reduce the network load when a server is unreachable, an unreach timer is incremented by 1 at each poll interval, but is set to 0 as each packet is received. If the timer exceeds the <em>unreach threshold</em> set at 10, the poll exponent is incremented by 1 and the unreach timer set to 0. This continues until the poll exponent reaches the maximum set by the <tt>maxpoll</tt> option.</p>
+<hr>
+<p>
+ <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</p>
+</body>
+</html>
diff --git a/html/pps.html b/html/pps.html
new file mode 100644
index 0000000..0b9bd5d
--- /dev/null
+++ b/html/pps.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Pulse-Per-Second (PPS) Signal Interfacing</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Pulse-Per-Second (PPS) Signal Interfacing</h3>
+<img src="pic/alice32.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>Alice is trying to find the PPS signal connector.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:17<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/misc.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">Introduction</a></li>
+ <li class="inline"><a href="#gadget">Gadget Box</a></li>
+ <li class="inline"><a href="#opsys">Operating System Support</a></li>
+ <li class="inline"><a href="#use">Using the Pulse-per-Second (PPS) Signal</a></li>
+</ul>
+<hr>
+<h4 id="intro">Introduction</h4>
+<p>Most radio clocks are connected using a serial port operating at speeds of 9600 bps. The accuracy using typical timecode formats, where the on-time epoch is indicated by a designated ASCII character such as carriage-return <tt>&lt;cr&gt;</tt>, is normally limited to 100 &mu;s. Using carefully crafted averaging techniques, the NTP&nbsp;algorithms can whittle this down to a few tens of microseconds. However, some radios produce a pulse-per-second (PPS) signal which can be used to improve the accuracy to a few microseconds. This page describes the hardware and software necessary for NTP to use the PPS signal.</p>
+<p> The PPS signal can be connected in either of two ways. On FreeBSD systems (with the PPS_SYNC and pps kernel options) it can be connected directly to the ACK pin of a parallel port. This is the preferred way, as it requires no additional hardware. Alternatively, it can be connected via the DCD pin of a serial port. However, the PPS signal levels are usually incompatible with the serial port interface signals. Note that NTP no longer supports connection via the RD pin of a serial port.</p>
+<div align="center">
+ <p><img src="pic/gadget.jpg" alt="gif"></p>
+ <p>A Gadget Box built by Chuck Hanavin</p>
+</div>
+<h4 id="gadget">Gadget Box</h4>
+<p>The gadget box shown above is assembled in a 5&quot;x3&quot;x2&quot; aluminum minibox containing the the circuitry, serial connector and optional 12-V power connector. A complete set of schematics, PCB artwork, drill templates can be obtained via the web from ftp.udel.edu as <a href="ftp://ftp.udel.edu/pub/ntp/hardware/gadget.tar.Z">gadget.tar.Z</a>.</p>
+<p> The gadget box includes two subcircuits. One of these converts a TTL positive edge into a fixed-width pulse at EIA levels and is for use with a timecode receiver or precision oscillator with a TTL PPS output. The other converts the timecode modulation broadcast by Canadian time/frequency standard station CHU into a 300-bps serial character stream at EIA levels and is for use with the <a href="drivers/driver7.html">Radio CHU Audio Demodulator/Decoder</a> driver.</p>
+<h4 id="opsys">Operating System Support</h4>
+<p>Both the serial and parallel port connection require operating system support, which is available in a few operating systems, including FreeBSD, Linux (with PPSkit patch) and Solaris. Support on an experimental basis is available for several other systems, including SunOS and HP/Compaq/Digital Tru64. The kernel interface described on the <a href="kernpps.html">PPSAPI Interface for Precision Time Signals</a> page is the only interface currently supported. Older PPS interfaces based on the <tt>ppsclock</tt> and <tt>tty_clk</tt> streams modules are no longer supported. The interface consists of the <tt>timepps.h</tt> header file which is specific to each system. It is included automatically when the distribution is built.</p>
+<h4>PPS Driver</h4>
+<p>PPS support requires is built into some drivers, in particular the WWVB and NMEA drivers, and may be added to other drivers in future. Alternatively, the PPS driver described on the <a href="drivers/driver22.html">Type 22 PPS Clock Discipline</a> page can be used. It operates in conjunction with another source that provides seconds numbering. The selected source is designate a prefer peer, as using the <tt>prefer</tt> option, as described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. The prefer peer is ordinarily the radio clock that provides the PPS signal, but in principle another radio clock or even a remote Internet server could be designated preferred Note that the <tt>pps</tt> configuration command has been obsoleted by this driver.</p>
+<h4 id="use">Using the Pulse-per-Second (PPS) Signal</h4>
+<p>The PPS signal can be used in either of two ways, one using the NTP grooming and mitigation algorithms and the other using the kernel PPS signal support described in the <a href="kern.html">Kernel Model for Precision Timekeeping</a> page. The presence of &nbsp;kernel support is automatically detected during the NTP build process and supporting code automatically compiled. In either case, the PPS&nbsp;signal must be present and within nominal jitter and wander tolerances. In addition, the prefer peer must be a truechimer; that is, survive the sanity checks and intersection algorithm. Finally, the offset of the system clock relative to the prefer peer must be within &plusmn;0.5 s. The kernel maintains a watchdog timer for the PPS signal; if the signal has not been heard or is out of tolerance for more than some interval, currently two minutes, the kernel discipline is disabled and operation continues as if it were not present. </p>
+<p> An option flag in the driver determines whether the NTP algorithms or kernel support is enabled (if available). For historical reasons, the NTP algorithms are selected by by default, since performance is generally better using older, slower systems. However, performance is generally better with kernl support using newer, faster systems.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/prefer.html b/html/prefer.html
new file mode 100644
index 0000000..0fd0b8f
--- /dev/null
+++ b/html/prefer.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Mitigation Rules and the prefer Keyword</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Mitigation Rules and the <tt>prefer</tt> Keyword</h3>
+<img src="pic/alice11.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>Listen carefully to what I say; it is very complicated.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:18<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/misc.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">1. Introduction and Overview</a></li>
+ <li class="inline"><a href="#combine">2. Combine Algorithm</a></li>
+ <li class="inline"><a href="#clockhop">3. Anti-Clockhop Algorithm</a></li>
+ <li class="inline"><a href="#peer">4. Peer Classification</a></li>
+ <li class="inline"><a href="#prefer">5. 5. The <tt>prefer</tt> Peer</a></li>
+ <li class="inline"><a href="#miti">6. Mitigation Rules</a></li>
+ <li class="inline"><a href="#mins">7. The <tt>minsane</tt> Option</a></li>
+</ul>
+<hr>
+<h4 id="intro">1. Introduction and Overview</h4>
+<p>This page summarizes the criteria for choosing from among the survivors of the clock cluster algorithm a set of contributors to the clock discipline algorithm. The criteria are very meticulous, since they have to handle many different scenarios that may be optimized for special circumstances, including some scenarios designed to support planetary and deep space missions. For additional information on statistical principles and performance metrics, see the <a href="stats.html">Performance Metrics</a> page.</p>
+<p>Recall the suite of NTP data acquisition and grooming algorithms. These algorithms proceed in five phases. Phase one discovers the available <em>sources</em> and mobilizes an association for each source found. These sources can result from explicit configuration, broadcast discovery or the pool and manycast autonomous configuration schemes. See the <a href="discover.html">Automatic Server Discovery Schemes</a> page for further information.</p>
+<p> Phase two selects the <em> candidates</em> from among the sources by excluding those sources showing one or more of the errors summarized on the <a href="select.html">Clock Select Algorithm</a> page and to determine the <em>truechimers</em> from among the candidates, leaving behind the <em>falsetickers</em>. A server or peer configured with the <tt>true</tt> option is declared a truechimer independent of this algorithm. Phase four uses the algorithm described on the <a href="cluster.html">Clock Cluster Algorithm</a> page to prune the statistical outliers from the truechimers, leaving the <em>survivor list</em><em></em> as result. </p>
+<p> Phase five uses a set of algorithms and mitigation rules to combined the survivor statistics and discipline the system clock. The mitigation rules select from among the survivors a <em>system peer</em> from which a set of system statistics can be inherited and passed along to dependent clients, if any. The mitigation algorithms and rules are the main topic of this page. The clock offset developed from these algorithms can discipline the system clock, either using the <a href="discipline.html">clock discipline algorithm</a> or using the kernel to discipline the system clock directly, as described on the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page. </p>
+<h4 id="combine">2. Combine Algorithm</h4>
+<p> The clock combine algorithm uses the survivor list to produce a weighted average of both offset and jitter. Absent other considerations discussed later, the <em>combined offset</em> is used to discipline the system clock, while the <em>combined jitter</em> is augmented with other components to produce the system jitter statistic inherited by dependent clients, if any.</p>
+<p> The clock combine algorithm uses a weight factor for each survivor equal to the reciprocal of the root distance. This is normalized so that the sum of the reciprocals is equal to unity. This design favors the survivors at the smallest root distance and thus the smallest maximum error.</p>
+<h4 id="clockhop">3. Anti-Clockhop Algorithm</h4>
+<p>The anti-clockhop algorithm is intended for cases where multiple servers are available on a fast LAN with modern computers. Typical offset differences between servers in such cases are less than 0.5 ms. However, changes between servers can result in unnecessary system jitter. The object of the anti-clockhop algorithm is to avoid changing the current system peer, unless it becomes stale or has significant offset relative to other candidates on the survivor list.</p>
+<p>For the purposes of the following description, call the last selected system peer the <em>old peer</em>, and the currently selected source the <em>candidate peer</em>. At each update, the candidate peer is selected as the first peer on the survivor list sorted by increasing root distance. The algorithm initializes the -<em>clockhop threshold</em> with the value of <tt>mindist</tt>, by default 1 ms. </p>
+<p>The anti-clockhop algorithm is called immediately after the combine algorithm. If there was no old peer or the old and candidate peers are the same, the candidate peer becomes the system peer. If the old peer and the candidate peer are different, the algorithm measures the difference between the offset of the old peer and the candidate peer. If the difference exceeds the clockhop threshold, the candidate peer becomes the system peer and the clockhop threshold is restored to its original value. If the difference is less than the clockhop threshold, the old peer continues as the system peer. However, at each subsequent update, the algorithm reduces the clockhop threshold by half. Should operation continue in this way, the candidate peer will eventually become the system peer.</p>
+<h4 id="peer">4. Peer Classification</h4>
+<p>The behavior of the various algorithms and mitigation rules involved depends on how the various synchronization sources are classified. This depends on whether the source is local or remote and if local, the type of source. The following classes are defined:</p>
+<ol>
+ <li>A selectable association configured for a remote server or peer is classified as a <i>client association</i>. All other selectable associations are classified as <i>device driver associations</i> of one kind or another. In general, one or more sources of either type will be available in each installation.</li>
+ <li>If all sources have been lost and one or more hosts on a common DMZ network have specified the orphan stratum in the <tt>orphan</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command, each of them can become an <i>orphan parent</i>. Dependent orphan children on the same DMZ network will see the orphan parents as if synchronized to a server at the orphan stratum. Note that, as described on the <a href="orphan.html">Orphan Mode</a> page, all orphan children will select the same orphan parent for synchronization.</li>
+ <li>When a device driver has been configured for pulse-per-second (PPS) signals and PPS signals are being received, it is designated the <i>PPS driver.</i> Note that the Pulse-per-Second driver (type 22) is often used as a PPS driver, but any driver can be configure as a PPS driver if the hardware facilities are available. The PPS driver provides precision clock discipline only within &plusmn;0.4 s, so it is always associated with another source or sources that provide the seconds numbering function.</li>
+ <li>When the Undisciplined Local Clock driver (type 1) is configured, it is designated the <i>local driver</i>. It can be used either as a backup source (stratum greater than zero) should all sources fail, or as the primary source (stratum zero) whether or not other sources are available if the <tt>prefer</tt> option is present. The local driver can be used when the kernel time is disciplined by some other means of synchronization, such as the NIST <tt>lock clock</tt> scheme, or another synchronization protocol such as the IEEE 1588 Precision Time Protocol (PTP) or Digital Time Synchronization Service (DTSS).</li>
+ <li>When the Automated Computer Time Service driver (type 18) is configured, it is designated the <i>modem driver</i>. It is used either as a backup source, should all other sources fail, or as the primary source if the <tt>prefer</tt> option is present.</li>
+</ol>
+<h4 id="prefer">5. The <tt>prefer</tt> Peer</h4>
+<p>The mitigation rules are designed to provide an intelligent selection of the system peer from among the selectable sources of different types. When used with the <tt>server</tt> or <tt>peer</tt> commands, the <tt>prefer</tt> option designates one or more sources as preferred over all others. While the rules do not forbid it, it is usually not useful to designate more than one source as preferred; however, if more than one source is so designated, they are used in the order specified in the configuration file. If the first one becomes un selectable, the second one is considered and so forth. This order of priority is also applicable to multiple PPS drivers, multiple modem drivers and even multiple local drivers, although that would not normally be useful.</p>
+<p>The cluster algorithm works on the set of truechimers produced by the select algorithm. At each round the algorithm casts off the survivor least likely to influence the choice of system peer. If selectable, the prefer peer is never discarded; on the contrary, its potential removal becomes a termination condition. However, the prefer peer can still be discarded by the select algorithm as a falseticker; otherwise, the prefer peer becomes the system peer.</p>
+<p>Ordinarily, the combine algorithm computes a weighted average of the survivor
+ offset and jitter to produce the final values. However, if a prefer
+ peer is among the survivors, the combine algorithm is not used. Instead,
+ the offset and jitter of the prefer peer are used exclusively as the final values. In the common case involving a radio clock and a flock of remote backup
+ servers, and with the radio clock designated a prefer peer, the
+ the radio clock disciplines the system clock as long as the radio itself
+ remains operational. However, if the radio fails or becomes a falseticker,
+ the combined backup sources continue to discipline the system clock.</p>
+<h4 id="miti">6. Mitigation Rules</h4>
+<p>As the select algorithm scans the associations for selectable candidates, the modem driver and local driver are segregated for later, but only if not designated a prefer peer. If so designated, the driver is included among the candidate population. In addition, if orphan parents are found, the parent with the lowest metric is segregated for later; the others are discarded. For this purpose the metric is defined as the four-octet IPv4 address or the first four octets of the hashed IPv6 address. The resulting candidates, including any prefer peers found, are processed by the select algorithm to produce a possibly empty set of truechimers.</p>
+<p> As previously noted, the cluster algorithm casts out outliers, leaving the survivor list for later processing. The survivor list is then sorted by increasing root distance and the first entry temporarily designated the system peer. At this point the following contributors to the system clock discipline may be available:</p>
+<ul>
+ <li>(potential) system peer, if there are survivors;</li>
+ <li>orphan parent, if present;</li>
+ <li>local driver, if present;</li>
+ <li>modem driver, if present;</li>
+ <li>prefer peer, if present;</li>
+ <li>PPS driver, if present.</li>
+</ul>
+<p>The mitigation algorithm proceeds in three steps in turn.</p>
+<ol>
+ <li>If there are no survivors, the modem driver becomes the only survivor if there is one. If not, the local driver becomes the only survivor if there is one. If not, the orphan parent becomes the only survivor if there is one. If the number of survivors at this point is less than the <tt>minsane</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command, the algorithm is terminated and the system variables remain unchanged. Note that <tt>minsane</tt> is by default 1, but can be set at any value including 0.</li>
+ <li>If the prefer peer is among the survivors, it becomes the system peer and its offset and jitter are inherited by the corresponding system variables. Otherwise, the combine algorithm computes these variables from the survivor population.</li>
+ <li>If there is a PPS driver and the system clock offset at this point is less than 0.4 s, and if there is a prefer peer among the survivors or if the PPS peer is designated as a prefer peer, the PPS driver becomes the system peer and its offset and jitter are inherited by the system variables, thus overriding any variables already computed. Note that a PPS driver is present only if PPS signals are actually being received and enabled by the associated driver.</li>
+</ol>
+<p>If none of the above is the case, the data are disregarded and the system variables remain as they are.</p>
+<h4 id="mins">7. The <tt>minsane</tt> Option</H4>
+<p> The <tt>minsane</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command, the <tt>prefer</tt> option of the <tt>server</tt> and <tt>peer</tt> commands and the <tt>flag</tt> option of the <tt>fudge</tt> command for a selected driver can be used with the mitigation rules to provide many useful configurations. The <tt>minsane</tt> option specifies the minimum number of survivors required to synchronize the system clock. The <tt>prefer</tt> option operates as described in previous sections. The <tt>flag</tt> option enables the PPS signal for the selected driver.</p>
+<p>A common scenario is a GPS driver with a serial timecode and PPS signal. The
+ PPS signal is disabled until the system clock has been set by some means, not
+ necessarily the GPS driver. If the serial timecode is within 0.4 s of the PPS
+ signal, the GPS driver is designated the PPS driver and the PPS signal disciplines
+ the system clock. If the serial timecode becomes unreliable, or if the PPS signal is
+ disconnected, the GPS driver stops updating the system clock and so eventually
+ becomes unreachable and is replaced by other sources.</p>
+<p>Whether or not the GPS driver disables the PPS signal when the timecode becomes unreliable is
+ at the discretion of the driver. Ordinarily, the PPS signal is disabled in this case; however, when the GPS receiver has a precision holdover oscillator, the driver may elect to continue PPS discipline . In this case, <tt>minsane</tt> can be set to zero so the PPS signal continues to discipline the system clock.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/quick.html b/html/quick.html
new file mode 100644
index 0000000..9b6859b
--- /dev/null
+++ b/html/quick.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=windows-1252">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Quick Start</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->1-Dec-2012 04:44<!-- #EndDate -->
+ UTC</p>
+<h3>Quick Start</h3>
+<img src="pic/panda.gif" alt="gif" align="left">FAX test image for SATNET (1979).
+<p>The baby panda was scanned at University College London and used as a FAX test image for a demonstration of the DARPA Atlantic SATNET Program and the first transatlantic Internet connection in 1978. The computing system used for that demonstration was called the <a href="http://www.eecis.udel.edu/%7emills/database/papers/fuzz.ps">Fuzzball</a>. As it happened, this was also the first Internet multimedia presentation and the first to use a predecessor of NTP in regular operation. The image was widely copied and used for testing purpose throughout much of the 1980s.</p>
+<p>Last update:
+ <!-- #BeginDate format:En1m -->1-Dec-2012 04:44<!-- #EndDate -->
+ UTC</p>
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/install.txt"></script>
+<hr>
+<p>For the rank amateur the sheer volume of the documentation collection must be intimidating. However, it doesn't take much to fly the <tt>ntpd</tt> daemon with a simple configuration where a workstation needs to synchronize to some server elsewhere in the Internet. The first thing is to build the distribution for the particular workstation and install in the usual place. The <a href="build.html">Building and Installing the Distribution</a> page describes how to do this.</p>
+<p>While it is possible that certain configurations do not need a configuration file, most do. The file, called by default <tt>/etc/ntp.conf</tt>, need only contain one command specifying a remote server, for instance</p>
+<p><tt>server foo.bar.com</tt></p>
+<p>Choosing an appropriate remote server is somewhat of a black art, but a
+ suboptimal choice is seldom a problem. The simplest and best is to use the
+ Server Pool Scheme on the <a href="discover.html">Automatic Server Discovery</a> page. There
+ are about two dozen public time servers operated by the <a href="http://tf.nist.gov/tf-cgi/servers.cgi">National
+ Institutes of Science and Technology (NIST)</a>, <a href="http://tycho.usno.navy.mil/ntp.html">US
+ Naval Observatory (USNO)</a>, <a href="http://inms-ienm.nrc-cnrc.gc.ca/time_services/network_time_protocol_e.html"> Canadian
+ Metrology Centre (CMC)</a> and many others available on the Internet. Lists
+ of public primary and secondary NTP servers maintained on the <a href="http://support.ntp.org/Servers/WebHome">Public
+ NTP Time Servers</a> page, which is updated frequently. The lists are sorted
+ by country and, in the case of the US, by state. Usually, the best
+ choice is the nearest in geographical terms, but the terms of engagement
+ specified in each list entry should be carefully respected.</p>
+<p>During operation <tt>ntpd</tt> measures and corrects for incidental clock frequency error and occasionally writes the current value to a file specified by the</p>
+<p><tt>driftfile /etc/ntp.drift</tt></p>
+<p>configuration command. If <tt>ntpd</tt> is stopped and restarted, it initializes the frequency from this file and avoids the potentially lengthy interval to relearn the correction.</p>
+<p>That's all there is to it, unless some problem in network connectivity or local operating system configuration occurs. The most common problem is some firewall between the workstation and server. System administrators should understand NTP uses UDP port 123 as both the source and destination port and that NTP does not involve any operating system interaction other than to set the system clock. While almost all modern Unix systems have included NTP and UDP port 123 defined in the services file, this should be checked if <tt>ntpd</tt> fails to come up at all.</p>
+<p>The best way to confirm NTP is working is using the <a href="ntpq.html"><tt>ntpq</tt></a> utility, although the <a href="ntpdc.html"><tt>ntpdc</tt></a> utility may be useful in extreme cases. See the documentation pages for further information. Don't forget to check for <a href="msyslog.html"> system log messages</a>. In the most extreme cases the <tt>-d</tt> option on the <tt>ntpd</tt> command line results in a blow-by-blow trace of the daemon operations. While the trace output can be cryptic, to say the least, it gives a general idea of what the program is doing and, in particular, details the arriving and departing packets and any errors found.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/rate.html b/html/rate.html
new file mode 100644
index 0000000..2b47db8
--- /dev/null
+++ b/html/rate.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Rate Management and the Kiss-o'-Death</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+<style type="text/css">
+<!--
+<style1 {
+color: #FF0000;
+ font-weight: bold;
+}
+-->
+</style>
+</head>
+<body>
+<h3>Rate Management and the Kiss-o'-Death Packet</h3>
+<img src="pic/boom4.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>Our junior managers and the administrators.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:19<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/config.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">Introduction</a></li>
+ <li class="inline"><a href="#guard">Minimum Headway Time</a></li>
+ <li class="inline"><a href="#mah">Minimum Average Headway Time</a></li>
+ <li class="inline"><a href="#kiss">The Kiss-o'-Death Packet</a></li>
+ <li class="inline"><a href="#ref">References</a></li>
+</ul>
+<hr>
+<h4 id="intro">Introduction</h4>
+<p>This page describes the various rate management provisions in NTPv4. Some national time metrology laboratories, including NIST and USNO, use the NTP reference implementation in their very busy public time servers. They operate multiple servers behind load-balancing devices to support aggregate rates up to ten thousand packets per second. The servers need to defend themselves against all manner of broken client implementations that can clog the server and network infrastructure. On the other hand, friendly clients need to avoid configurations that can result in unfriendly behavior.</p>
+<p>A review of past client abuse incidence shows the most frequent scenario is a broken client that attempts to send packets at rates of one per second or more. On one occasion due to a defective client design [1], over 750,000 clients demonstrated this abuse. There have been occasions where this abuse has persisted for days at a time. These scenarios are the most damaging, as they can threaten not only the victim server but the network infrastructure as well.</p>
+<p>There are several features in the reference implementation<tt></tt> designed to defend the servers and network against accidental or intentional flood attack. Other features are used to insure that the client <tt></tt> is a good citizen, even if configured in unfriendly ways. The ground rules are:</p>
+<ul>
+ <li>Send at the lowest rate consistent with the expected accuracy requirements.</li>
+ <li>Maintain strict guard time and minimum average headway time, even if multiple burst options and/or the Autokey protocol are operating.</li>
+ <li>When the first packet of a burst is sent to a server, do not send further packets until the first packet has been received from the server.</li>
+ <li>Upon receiving a Kiss-o'-Death packet (KoD, see below), immediately reduce the sending rate.</li>
+</ul>
+<p>Rate management involves four algorithms to manage resources: (1) poll rate control, (2) burst control, (3) average headway time and (4) guard time. The first two algorithms are described on the <a href="poll.html">Poll Program</a> page; the remaining two are described in following sections.</p>
+<h4 id="guard">Minimum Headway Time</h4>
+<p>The headway is defined for each source as the interval between the last packet sent or received and the next packet for that source. The minimum receive headway is defined as the guard time. In the reference implementation, if the receive headway is less than the guard time, the packet is discarded. The guard time defaults to 2 s, but this can be changed using the <tt>minimum</tt> option of the <a href="accopt.html#discard"><tt>discard</tt></a> command. By design, the minimum interval between <tt>burst</tt> and <tt>iburst</tt> packets sent by any client is 2 s, which does not violate this constraint. Packets sent by other implementations that violate this constraint will be dropped and a KoD packet returned, if enabled.</p>
+<h4 id="mah">Minimum Average Headway Time</h4>
+<p>There are two features in the reference implementation to manage the minimum average headway time between one packet and the next, and thus the maximum average rate for each source. The transmit throttle limits the rate for transmit packets, while the receive discard limits the rate for receive packets. These features make use of a pair of counters: a client output counter for each association and a server input counter for each distinct client IP address. For each packet received, the input counter increments by a value equal to the minimum average headway (MAH) and then decrements by one each second. For each packet transmitted, the output counter increments by the MAH and then decrements by one each second. The default MAH is 8 s, but this can be changed using the <tt>average</tt> option of the <a href="accopt.html#discard"><tt>discard</tt></a> command.</p>
+<p>If the <tt>iburst</tt> or <tt>burst</tt> options are present, the poll algorithm sends a burst of packets instead of a single packet at each poll opportunity. The NTPv4 specification requires that bursts contain no more than eight packets. Starting from an output counter value of zero, the maximum counter value, called the ceiling, can be no more than eight times the MAH. However, if the burst starts with a counter value other than zero, there is a potential to exceed the ceiling. This can result from protocol restarts and/or Autokey protocol operations. In these cases the poll algorithm throttles the output rate by computing an additional headway time so that the next packet sent will not exceed the ceiling. Designs such as this are often called leaky buckets.</p>
+<p>The reference implementation uses a special most-recently used (MRU) list of entries, one entry for each distinct client IP address found. Each entry includes the IP address, input counter and process time at the last packet arrival. As each packet arrives, the IP source address is compared to the IP address in each entry in turn. If a match is found the entry is removed and inserted first on the list. If the IP source address does not match any entry, a new entry is created and inserted first, possibly discarding the last entry if the list is full. Observers will note this is the same algorithm used for page replacement in virtual memory systems. However, in the virtual memory algorithm the entry of interest is the last, whereas here the entry of interest is the first.</p>
+<p> The input counter for the first entry on the MRU list, representing the current input packet, is decreased by the interval since the entry was last referenced, but not below zero. If the input counter is greater than the ceiling, the packet is discarded. Otherwise, the counter is increased by the MAH and the packet is processed. The result is, if the client maintains an average headway greater than the ceiling and transmits no more than eight packets in a burst, the input counter will not exceed the ceiling. Packets sent by other implementations that violate this constraint will be dropped and a KoD packet returned, if enabled.</p>
+<p>The reference implementation has a maximum MRU list size of a few hundred entries. The national time servers operated by NIST and USNO have an aggregate packet rate in the thousands of packets per second from many thousands of customers. Under these conditions, the list overflows after only a few seconds of traffic. However, analysis shows that the vast majority of the abusive traffic is due to a tiny minority of the customers, some of which send at over one packet per second. This means that the few seconds retained on the list is sufficient to identify and discard by far the majority of the abusive traffic.</p>
+<h4 id="kiss">The Kiss-of-Death Packet</h4>
+<p>Ordinarily, packets denied service are simply dropped with no further action except incrementing statistics counters. Sometimes a more proactive response is needed to cause the client to slow down. A special packet has been created for this purpose called the kiss-o'-death (KoD) packet. KoD packets have leap indicator 3, stratum 0 and the reference identifier set to a four-octet ASCII code. At present, only one code <tt>RATE</tt> is sent by the server if the <tt>limited</tt> and <tt>kod</tt> flags of the <a href="accopt.html#restrict"><tt>restrict</tt></a> command are present and either the guard time or MAH time are violated.</p>
+<p>A client receiving a KoD packet is expected to slow down; however, no explicit mechanism is specified in the protocol to do this. In the reference implementation, the server sets the poll field of the KoD packet to the greater of (a) the server MAH and (b) client packet poll field. In response to the KoD packet, the client sets the peer poll interval to the maximum of (a) the client MAH and (b) the server packet poll field. This automatically increases the headway for following client packets. </p>
+<p> In order to make sure the client notices the KoD packet, the server sets the receive and transmit timestamps to the transmit timestamp of the client packet. Thus, even if the client ignores all except the timestamps, it cannot do any useful time computations. KoD packets themselves are rate limited to no more than one packet per guard time, in order to defend against flood attacks.</p>
+<h4 id="ref">References</h4>
+<ol>
+ <li>Mills, D.L., J. Levine, R. Schmidt and D. Plonka. Coping with overload on the Network Time Protocol public servers. <i>Proc. Precision Time and Time Interval (PTTI) Applications and Planning Meeting</i> (Washington DC, December 2004), 5-16. Paper: <a href="http://www.eecis.udel.edu/~mills/database/papers/ptti/ptti04a.pdf">PDF</a>, Slides:<a href="http://www.eecis.udel.edu/~mills/database/brief/ptti/ptti04.pdf">PDF</a> | <a href="http://www.eecis.udel.edu/~mills/database/brief/ptti/ptti04.ppt">PowerPoint</a></li>
+</ol>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/rdebug.html b/html/rdebug.html
new file mode 100644
index 0000000..f14bf43
--- /dev/null
+++ b/html/rdebug.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Debugging Reference Clock Drivers</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Debugging Reference Clock Drivers</h3>
+<img src="pic/oz2.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a>
+<p>Call the girls and they'll sweep your bugs.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:19<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/refclock.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/install.txt"></script>
+<hr>
+<p>The <a href="ntpq.html"><tt>ntpq</tt></a> and <a href="ntpdc.html"><tt>ntpdc</tt></a> utility programs can be used to debug reference clocks, either on the server itself or from another machine elsewhere in the network. The server is compiled, installed and started using the configuration file described in the <a href="ntpd.html"><tt>ntpd</tt></a> page and its dependencies. If the clock appears in the <tt>ntpq</tt> utility and <tt>pe</tt> command, no errors have occurred and the daemon has started, opened the devices specified and waiting for peers and radios to come up. If not, the first thing to look for are error messages on the system log. These are usually due to improper configuration, missing links or multiple instances of the daemon.</p>
+<p>It normally takes a minute or so for evidence to appear that the clock is running and the driver is operating correctly. The first indication is a nonzero value in the <tt>reach</tt> column in the <tt>pe</tt> billboard. If nothing appears after a few minutes, the next step is to be sure the RS232 messages, if used, are getting to and from the clock. The most reliable way to do this is with an RS232 tester and to look for data flashes as the driver polls the clock and/or as data arrive from the clock. Our experience is that the overwhelming fraction of problems occurring during installation are due to problems such as miswired connectors or improperly configured device links at this stage.</p>
+<p>If RS232 messages are getting to and from the clock, the variables of interest can be inspected using the <tt>ntpq</tt> program and various commands described on the documentation page. First, use the <tt>pe</tt> and <tt>as</tt> commands to display billboards showing the peer configuration and association IDs for all peers, including the radio clock. The assigned clock address should appear in the <tt>pe</tt> billboard and the association ID for it at the same relative line position in the <tt>as</tt> billboard.</p>
+<p>Additional information is available with the <tt>rv</tt> and <tt>clockvar</tt> commands, which take as argument the association ID shown in the <tt>as</tt> billboard. The <tt>rv</tt> command with no argument shows the system variables, while the <tt>rv</tt> command with association ID argument shows the peer variables for the clock, as well as other peers of interest. The <tt>clockvar</tt> command with argument shows the peer variables specific to reference clock peers, including the clock status, device name, last received timecode (if relevant), and various event counters. In addition, a subset of the <tt>fudge</tt> parameters is included. The poll and error counters in the <tt>clockvar</tt> billboard are useful debugging aids. The <tt>poll</tt> counts the poll messages sent to the clock, while the <tt>noreply</tt>, <tt>badformat</tt> and <tt>baddate</tt> count various errors. Check the timecode to be sure it matches what the driver expects. This may require consulting the clock hardware reference manual, which is probably pretty dusty at this stage.</p>
+<p>The <tt>ntpdc</tt> utility program can be used for detailed inspection of the clock driver status. The most useful are the <tt>clockstat</tt> and <tt>clkbug</tt> commands described in the document page. While these commands permit getting quite personal with the particular driver involved, their use is seldom necessary, unless an implementation bug shows up. If all else fails, turn on the debugging trace using two <tt>-d</tt> flags in the <tt>ntpd</tt> startup command line. Most drivers will dump status at every received message in this case. While the displayed trace can be intimidating, this provides the most detailed and revealing indicator of how the driver and clock are performing and where bugs might lurk.</p>
+<p>Most drivers write a message to the <tt>clockstats</tt> file as each timecode or surrogate is received from the radio clock. By convention, this is the last ASCII timecode (or ASCII gloss of a binary-coded one) received from the radio clock. This file is managed by the <tt>filegen</tt> facility described in the <tt>ntpd</tt> page and requires specific commands in the configuration file. This forms a highly useful record to discover anomalies during regular operation of the clock. The scripts included in the <tt>./scripts/stats</tt> directory can be run from a <tt>cron</tt> job to collect and summarize these data on a daily or weekly basis. The summary files have proven inspirational to detect infrequent misbehavior due to clock implementation bugs in some radios.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/refclock.html b/html/refclock.html
new file mode 100644
index 0000000..d8969e3
--- /dev/null
+++ b/html/refclock.html
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Reference Clock Support</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Reference Clock Support</h3>
+<img src="pic/stack1a.jpg" alt="gif" align="left">Master Time Facility at the <a href="http://www.eecis.udel.edu/%7emills/lab.html">UDel Internet Research Laboratory</a>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:20<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/refclock.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/audio.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">Introduction</a></li>
+ <li class="inline"><a href="#spec">Special Considerations</a></li>
+ <li class="inline"><a href="#list">List of Reference Clock Drivers</a></li>
+</ul>
+<hr>
+<h4 id="intro">Introduction</h4>
+<p>NTP Version 4 supports almost four dozen satellite, radio and telephone modem reference clocks plus several audio devices for instrumentation signals. A general description of the reference clock support is on this page. Additional information about each reference clock driver can be found via links from this page. Additional information is on the <a href="rdebug.html">Debugging Hints for Reference Clock Drivers</a> and <a href="howto.html">How To Write a Reference Clock Driver</a> pages. Information on how to support pulse-per-second (PPS) signals produced by some devices is on the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. All reference clock drivers require that the reference clock use only Coordinated Universal Time (UTC). Timezone and standard/daylight adjustments are performed by the operating system kernel.</p>
+<p>A reference clock will generally (though not always) be a radio timecode receiver synchronized to standard time as provided by NIST and USNO in the US, NRC in Canada and their counterparts elsewhere in the world. A device driver specific to each reference clock must be compiled in the distribution; however, most common radio, satellite and telephone modem clocks are included by default and are activated by configuration commands.</p>
+<p>Reference clocks are supported in the same way as ordinary NTP clients and use the same filter, select, cluster and combine algorithms. Drivers have addresses in the form 127.127.<i>t.u</i>, where <i>t</i> is the driver type and <i>u</i> is a unit number in the range 0-3 to distinguish multiple instances of the same driver. The connection to the computer is device dependent, usually a serial port, parallel port or special bus peripheral, but some can work directly from an audio codec or sound card. The particular device is specified by adding a soft link from the name used by the driver to the particular device name.</p>
+<p>The <tt>server</tt> command is used to configure a reference clock. Only the <tt>mode>,<tt>minpoll</tt>, <tt>maxpoll</tt>, and <tt>prefer</tt> options are supported for reference clocks, as described on the <a href="clockopt.html">Reference Clock Commands</a> page. The <tt>prefer</tt> option is discussed on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. Some of these options have meaning only for selected clock drivers.</p>
+<p>The <tt>fudge</tt> command can be used to provide additional information for individual drivers and normally follows immediately after the <tt>server</tt> command. The reference clock stratum is by default 0, so that the server stratum appears to clients as 1. The <tt>stratum</tt> option can be used to set the stratum to any value in the range 0 through 15. The <tt>refid</tt> option can be used to change the reference identifier, as might in the case when the driver is disciplined by a pulse-per-second (PPS) source. The device-dependent <tt>mode</tt>, <tt>time</tt> and <tt>flag</tt> options can provide additional driver customization.</p>
+<h4 id="spec">Special Considerations</h4>
+<p>The <a href="audio.html">Audio Drivers</a> page describes three software drivers that process audio signals from an audio codec or sound card. One is for the NIST time and frequency stations WWV and WWVH, another for the Canadian time and frequency station CHU. These require an external shortwave radio and antenna. A third is for the generic IRIG signal produced by some timing devices. Currently, these are supported in FreeBSD, Solaris and SunOS and likely in other system as well.</p>
+<p>The <a href="drivers/driver1.html"> Undisciplined Local Clock</a> driver can simulate a reference clock when no external synchronization sources are available. If a server with this driver is connected directly or indirectly to the public Internet, there is some danger that it can destabilize other clients. It is not recommended that the local clock driver be used in this way, as the orphan mode described on the <a href="assoc.html">Association Management</a> page provides a generic backup capability.</p>
+<p>The local clock driver can also be used when an external synchronization source such as the IEEE 1588 Precision Time Protocol or NIST Lockclock directly synchronizes the computer time. Further information is on the <a href="extern.html">External Clock Discipline and the Local Clock Driver</a> page.</p>
+<p>Several drivers make use of the pulse-per-second (PPS)&nbsp;signal discipline, which is part of the generic driver interface, so require no specific configuration. For those drivers that do not use this interface, the <a href="drivers/driver22.html"> PPS Clock Discipline</a> driver can be can provide this function. It normally works in conjunction with the reference clock that produces the timecode signal, but can work with another driver or remote server. When PPS kernel features are present, the driver can redirect the PPS signal to the kernel.</p>
+<p>Some drivers depending on longwave or shortwave radio services need to know the radio propagation time from the transmitter to the receiver. This must be calculated for each specific receiver location and requires the geographic coordinates of both the transmitter and receiver. The transmitter coordinates for various radio services are given in the <a href="http://www.eecis.udel.edu/%7emills/ntp/qth.html">Time and Frequency Standard Station Information</a> page. Receiver coordinates can be obtained locally or from Google Earth. The actual calculations are beyond the scope of this document.</p>
+<p>Depending on interface type, port speed, etc., a reference clock can have a small residual offset relative to another. To reduce the effects of jitter when switching from one driver to the another, it is useful to calibrate the drivers to a common ensemble offset. The <tt>enable calibrate</tt> configuration command described on the <a href="miscopt.html">Miscellaneous Options</a> page activates a special feature which automatically calculates a correction factor for each driver relative to an association designated the prefer peer.</p>
+<h4 id="list"> List of Reference Clock Drivers</h4>
+<p>Following is a list showing the type and title of each driver currently implemented. The compile-time identifier for each is shown in parentheses. Click on a selected type for specific description and configuration documentation, including the clock address, reference ID, driver ID, device name and serial line speed. For those drivers without specific documentation, please contact the author listed in the <a href="copyright.html">Copyright Notice</a> page.</p>
+<ul>
+ <li class="inline"><a href="drivers/driver1.html">Type 1</a> Undisciplined Local Clock (<tt>LOCAL</tt>)</li>
+ <li class="inline">Type 2 Deprecated: was Trak 8820 GPS Receiver</li>
+ <li class="inline"><a href="drivers/driver3.html">Type 3</a> PSTI/Traconex 1020 WWV/WWVH Receiver (<tt>WWV_PST</tt>)</li>
+ <li class="inline"><a href="drivers/driver4.html">Type 4</a> Spectracom WWVB/GPS Receivers (<tt>WWVB_SPEC</tt>)</li>
+ <li class="inline"><a href="drivers/driver5.html">Type 5</a> TrueTime GPS/GOES/OMEGA Receivers (<tt>TRUETIME</tt>)</li>
+ <li class="inline"><a href="drivers/driver6.html">Type 6</a> IRIG Audio Decoder (<tt>IRIG_AUDIO</tt>)</li>
+ <li class="inline"><a href="drivers/driver7.html">Type 7</a> Radio CHU Audio Demodulator/Decoder (<tt>CHU</tt>)</li>
+ <li class="inline"><a href="drivers/driver8.html">Type 8</a> Generic Reference Driver (<tt>PARSE</tt>)</li>
+ <li class="inline"><a href="drivers/driver9.html">Type 9</a> Magnavox MX4200 GPS Receiver (<tt>GPS_MX4200</tt>)</li>
+ <li class="inline"><a href="drivers/driver10.html">Type 10</a> Austron 2200A/2201A GPS Receivers (<tt>GPS_AS2201</tt>)</li>
+ <li class="inline"><a href="drivers/driver11.html">Type 11</a> Arbiter 1088A/B GPS Receiver (<tt>GPS_ARBITER</tt>)</li>
+ <li class="inline"><a href="drivers/driver12.html">Type 12</a> KSI/Odetics TPRO/S IRIG Interface (<tt>IRIG_TPRO</tt>)</li>
+ <li class="inline">Type 13 Leitch CSD 5300 Master Clock Controller (<tt>ATOM_LEITCH</tt>)</li>
+ <li class="inline">Type 14 EES M201 MSF Receiver (<tt>MSF_EES</tt>)</li>
+ <li class="inline">Type 15 reserved</li>
+ <li class="inline"><a href="drivers/driver16.html">Type 16</a> Bancomm GPS/IRIG Receiver (<tt>GPS_BANCOMM</tt>)</li>
+ <li class="inline">Type 17 Datum Precision Time System (<tt>GPS_DATUM</tt>)</li>
+ <li class="inline"><a href="drivers/driver18.html">Type 18</a> NIST/USNO/PTB Modem Time Services (<tt>ACTS_MODEM</tt>)</li>
+ <li class="inline"><a href="drivers/driver19.html">Type 19</a> Heath WWV/WWVH Receiver (<tt>WWV_HEATH</tt>)</li>
+ <li class="inline"><a href="drivers/driver20.html">Type 20</a> Generic NMEA GPS Receiver (<tt>NMEA</tt>)</li>
+ <li class="inline">Type 21 TrueTime GPS-VME Interface (<tt>GPS_VME</tt>)</li>
+ <li class="inline"><a href="drivers/driver22.html">Type 22</a> PPS Clock Discipline (<tt>PPS</tt>)</li>
+ <li class="inline">Type 23 reserved</li>
+ <li class="inline">Type 24 reserved</li>
+ <li class="inline">Type 25 reserved</li>
+ <li class="inline"><a href="drivers/driver26.html">Type 26</a> Hewlett Packard 58503A GPS Receiver (<tt>GPS_HP</tt>)</li>
+ <li class="inline"><a href="drivers/driver27.html">Type 27</a> Arcron MSF Receiver (<tt>MSF_ARCRON</tt>)</li>
+ <li class="inline"><a href="drivers/driver28.html">Type 28</a> Shared Memory Driver (<tt>SHM</tt>)</li>
+ <li class="inline"><a href="drivers/driver29.html">Type 29</a> Trimble Navigation Palisade GPS (<tt>GPS_PALISADE</tt>)</li>
+ <li class="inline"><a href="drivers/driver30.html">Type 30</a> Motorola UT Oncore GPS <tt>GPS_ONCORE</tt>)</li>
+ <li class="inline"><a href="drivers/driver31.html">Type 31</a> Rockwell Jupiter GPS (<tt>GPS_JUPITER</tt>)</li>
+ <li class="inline"><a href="drivers/driver32.html">Type 32</a> Chrono-log K-series WWVB receiver (<tt>CHRONOLOG</tt>)</li>
+ <li class="inline"><a href="drivers/driver33.html">Type 33</a> Dumb Clock (<tt>DUMBCLOCK</tt>)</li>
+ <li class="inline"><a href="drivers/driver34.html">Type 34</a> Ultralink WWVB Receivers (<tt>ULINK</tt>)</li>
+ <li class="inline"><a href="drivers/driver35.html">Type 35</a> Conrad Parallel Port Radio Clock (<tt>PCF</tt>)</li>
+ <li class="inline"><a href="drivers/driver36.html">Type 36</a> Radio WWV/H Audio Demodulator/Decoder (<tt>WWV</tt>)</li>
+ <li class="inline"><a href="drivers/driver37.html">Type 37</a> Forum Graphic GPS Dating station (<tt>FG</tt>)</li>
+ <li class="inline"><a href="drivers/driver38.html">Type 38</a> hopf GPS/DCF77 6021/komp for Serial Line (<tt>HOPF_S</tt>)</li>
+ <li class="inline"><a href="drivers/driver39.html">Type 39</a> hopf GPS/DCF77 6039 for PCI-Bus (<tt>HOPF_P</tt>)</li>
+ <li class="inline"><a href="drivers/driver40.html">Type 40</a> JJY Receivers (<tt>JJY</tt>)</li>
+ <li class="inline">Type 41 TrueTime 560 IRIG-B Decoder</li>
+ <li class="inline"><a href="drivers/driver42.html">Type 42</a> Zyfer GPStarplus Receiver</li>
+ <li class="inline"><a href="drivers/driver43.html">Type 43</a> RIPE NCC interface for Trimble Palisade</li>
+ <li class="inline"><a href="drivers/driver44.html">Type 44</a> NeoClock4X - DCF77 / TDF serial line</li>
+ <li class="inline"><a href="drivers/driver45.html">Type 45</a> Spectracom TSYNC PCI</li>
+ <li class="inline"><a href="drivers/driver46.html">Type 46</a> GPSD NG client protocol</li>
+</ul>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/release.html b/html/release.html
new file mode 100644
index 0000000..f940603
--- /dev/null
+++ b/html/release.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>NTP Version 4 Release Notes</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>NTP Version 4 Release Notes</h3>
+<img src="pic/hornraba.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>The rabbit toots to make sure you read this.</p>
+<p>Last update:
+ <!-- #BeginDate format:En1m -->3-Oct-2011 21:51<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#new">New Features Modes</a></li>
+ <li class="inline"><a href="#change">Changes and Upgrades Since the NTPv3 Version (xntp3-5)</a></li>
+ <li class="inline"><a href="#nasty">Nasty Surprises</a></li>
+</ul>
+<hr>
+<p>NTP has been under development for almost 30 years, but the paint ain't dry even now. This release of the NTP Version 4 (NTPv4) distribution for Unix, VMS and Windows incorporates new features and refinements, but retaining backwards compatibility with older versions, including NTPv3 and NTPv2, but not NTPv1. Support for NTPv1 has been discontinued because of certain security vulnerabilities.</p>
+<h4 id="new">New Features</h4>
+<ul>
+ <li>The behavior of the daemon at startup has been considerably improved. The time to measure the frequency and correct an initial offset error when started for the first time is now no more than ten minutes. Upon restart, it takes no more than five minutes to reduce the initial offset to less than one millisecond without adversely affecting the frequency. This avoids a subsequent frequency correction which could take up to several hours.</li>
+ <li>A new feature called interleaved mode can be used in NTP
+ symmetric and broadcast modes. It is designed to improve accuracy
+ by minimizing errors due to queuing and transmission delays. It is described on the <a href="xleave.html">NTP
+ Interleaved Modes</a> page.</li>
+ <li>The huff-n'-puff filter is designed to avoid large errors with DSL circuits and highly asymmetrical traffic, as when downloading large files. Details are on the <a href="huffpuff.html">The Huff-n'-Puff Filter</a> page.</li>
+ <li>A new feature called orphan mode provides an automatic, subnet-wide synchronization feature with multiple sources. It provides reliable backup in isolated networks or in pr when Internet sources have become unavailable. See the <a href="orphan.html">Orphan Mode</a> page for further information.</li>
+ <li>This release includes comprehensive packet rate management tools to help reduce the level of spurious network traffic and protect the busiest servers from overload. There is support for the optional Kiss-o'-Death (KoD) packet intended to slow down an abusive client. See the <a href="rate.html">Rate Management and the Kiss-o'-Death Packet</a> page for further information.</li>
+ <li>There are two new burst mode features available where special conditions apply. One of these is enabled by the <tt>iburst</tt> keyword in the <tt>server</tt> configuration command. It is intended for cases where it is important to set the clock quickly when an association is first mobilized. The other is enabled by the <tt>burst</tt> keyword in the <tt>server</tt> configuration command. It is intended for cases where the network attachment requires an initial calling or training procedure. See the <a href="assoc.html">Association Management</a> page for further information.</li>
+ <li>The OpenSSL cryptographic library has replaced the library formerly available from RSA Laboratories. All cryptographic routines except a version of the MD5 message digest algorithm have been removed from the base distribution. All 128-bit and 160-bit message digests algorithms are now supported for both symmetric key and public key cryptosystems. See the <a href="authentic.html">Authentication Support</a> page for further information and the <a href="authopt.html">Authentication Options</a> page for a list of supported digest algorithms.</li>
+ <li>This release includes support for Autokey public-key cryptography for authenticating public servers to clients, as described in RFC 5906. This support requires the --enable-autokey option when building the distribution, which is the default is OpenSSL is available. The deployment of Autokey subnets is now considerably simpler than in earlier versions. A subnet naming scheme is now available to filter manycast and pool configurations. Additional information about Autokey is on the <a href="autokey.html">Autokey Public Key Authentication</a> page and links from there.</li>
+ <li>The NTP descrete even simulator has been substantially upgraded, now including scenarios with multiple servers and time-sensitive scripts. This allows the NTP&nbsp;algorithms to be tested in an embedded environment with systematic and pseudo-random network delay and oscillator wander distributions. This has been used to verify correct operation under conditions of extreme error and misconfiguration. See the <a href="ntpdsim.html"><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</a> page. A technical description and performance analysis is given in the white papers at the <a href="http://www.eecis.udel.edu/~mills/ntp.html">NTP Project Page</a>.</li>
+ <li>NTPv4 includes three new server discovery schemes, which in most applications can avoid per-host configuration altogether. Two of these are based on IP multicast technology, while the remaining one is based on crafted DNS lookups. See the <a href="discover.html">Automatic NTP Configuration Schemes</a> page for further information.</li>
+ <li>The status display and event report monitoring functions have been considerably expanded, including new statistics files and event reporting to files and the system log. See the <a href="decode.html">Event Messages and Status Words</a> page for further information.</li>
+ <li>Several new options have been added for the <tt>ntpd</tt> command line. For the inveterate knob twiddlers several of the more important performance variables can be changed to fit actual or perceived special conditions. In particular, the <tt>tinker</tt> and <tt>tos</tt> commands can be used to adjust thresholds, throw switches and change limits.</li>
+ <li>The <tt>ntpd</tt> daemon can be operated in a one-time mode similar to <tt>ntpdate</tt>, which program is headed for retirement. See the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page for the new features.</li>
+ <li>A number of white papers have been added to the library on the NTP Reseatch Project Page, including:</li>
+</ul>
+<script type="text/javascript" language="javascript" src="scripts/external.txt"></script>
+<h4 id="change">Changes and Upgrades Since the NTPv3 Version (xntp3-5) </h4>
+<p>This section summarizes general changes since the publication of RFC-1305. Specific changes made during the code upgrade of 2007-2008 are summarized in <a href="history.html">Historical Notes</a>.</p>
+<ul>
+ <li>If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected, support for the IPv6 address family is supported in addition to the default support for the IPv4 address family. In contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</li>
+ <li>Many changes have been made in the NTP algorithms to improve performance and reliability A clock state machine has been incorporated to improve behavior under transient conditions. The clock discipline algorithm has been redesigned to improve accuracy, reduce the impact of network disruptions and allow increased poll intervals to 36 hours with only moderate sacrifice in accuracy. The clock select, cluster and combine algorithms have been overhauled as the result of a thorough statistical analysis.</li>
+ <li>In all except a very few cases, all timing intervals are randomized, so that the tendency for NTPv3 to self-synchronize and bunch messages, especially with a large number of configured associations, is minimized.</li>
+ <li>Support for the precision time kernel modifications, which are now in stock FreeBSD and optional in Linux kernels, is included. With this support the system clock can be disciplined to the order of one nanosecond. The older microtime kernel modifications in Digital/Compaq/HP Tru64, Digital Ultrix and Sun Microsystems SunOS and Solaris, continue to be supported. In either case the support eliminates sawtooth error, which can be in the hundreds of microseconds. Further information is on the <a href="kern.html">Kernel Model for Precision Timekeeping</a> page.</li>
+ <li>New reference clock drivers have been added for several GPS receivers now on the market for a total of 44 drivers. The reference clock driver interface is smaller, more rational, more flexible and more accurate. Most of the drivers in NTPv3 have been converted to the NTPv4 interface and continue to operate as before. A summary of the supported drivers is on the <a href="refclock.html">Reference Clock Support</a> page. Audio drivers for the Canadian standard time and frequency station CHU, the US standard time and frequency stations WWV/H and for IRIG signals have been updated and capabilities added to allow direct connection of these signals to an audio port. See the <a href="audio.html">Reference Clock Audio Drivers</a> page for further information.</li>
+ <li>Support for pulse-per-second (PPS) signals has been extended to all drivers as an intrinsic function. Further information is on the <a href="pps.html">Pulse-Per-Second (PPS) Signal Interfacing</a> page. Typical performance with the PPS interface and a fast machine are in the low microseconds.</li>
+ <li>Several small changes have been made to make administration and maintenance more convenience. The entire distribution has been converted to gnu <tt>automake</tt>, which greatly ease the task of porting to new and different programming environments, as well as reduce the incidence of bugs due to improper handling of idiosyncratic kernel functions. Version control is provided by Bitkeeper using an online repository at www.ntp.org. Trouble ticket reporting is provided using Bugzilla. If <tt>ntpd</tt>, is configured with NetInfo support, it will attempt to read its configuration from the NetInfo service if the default <tt>ntp.conf</tt> file cannot be read and no file is specified by the <tt>-c</tt> option. When <tt>ntpd</tt> starts it looks at the value of <tt>umask</tt>, and if zero <tt>ntpd</tt> will set the <tt>umask</tt> to <tt>022</tt>.</li>
+</ul>
+<h4 id="nasty">Nasty Surprises</h4>
+<p>There are a few things different about this release that have changed since the latest NTP Version 3 release. Following are a few things to worry about:</p>
+<ul>
+ <li>Some configuration commands have been removed, others added and some changed in minor ways. See the Commands and Options collection on the <a href="sitemap.html">Site Map</a> page.</li>
+ <li>When both IPv4 and IPv6 address families are in use, the host's resolver library may not choose the intended address family if a server has an IPv4 and IPv6 address associated with the same DNS name. The solution is to use the IPv4 or IPv6 address directly in such cases or use another DNS name that resolves to the intended address family. Older versions of <tt>ntpdc</tt> will show only the IPv4 associations with the <tt>peers</tt> and some other commands. Older versions of <tt>ntpq</tt> will show 0.0.0.0 for IPv6 associations with the <tt>peers</tt> and some other commands.</li>
+ <li>There is a minor change to the reference ID field of the NTP packet header when operating with IPv6 associations. In IPv4 associations this field contains the 32-bit IPv4 address of the server, in order to detect and avoid loops. In IPv6 associations this field contains the first 32-bits of a MD5 hash formed from the IPv6 address. All programs in the distribution have been modified to work with both address families.</li>
+ <li>The <tt>tty_clk</tt> and <tt>ppsclock</tt> pulse-per-second (PPS) line discipline/streams modules are no longer supported. The PPS function is now handled by the <a href="drivers/driver22.html">PPS Clock Discipline</a> driver, which uses the new PPSAPI application program interface adopted by the IETF. Note that the <tt>pps</tt> configuration file command has been obsoleted by the driver. See the <a href="pps.html">Pulse-Per-Second (PPS) Signal Interfacing</a> page for further information.</li>
+ <li>Support for the NTPv1 symmetric mode has been discontinued, since it hasn't worked for years. Support continues for the NTPv1 client mode, which is used by some SNTP clients.</li>
+ <li>The <tt>authstuff</tt> directory, intended as a development and testing aid for porting cryptographic routines to exotic architectures, has been removed. Testing and conformance validation tools are available in the OpenSSL software distribution.</li>
+</ul>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/scripts/accopt.txt b/html/scripts/accopt.txt
new file mode 100644
index 0000000..d8f0280
--- /dev/null
+++ b/html/scripts/accopt.txt
@@ -0,0 +1,5 @@
+document.write("<p>Access Control Commands and Options</p><ul>\
+<li class='inline'><a href='accopt.html#discard'>discard - specify headway parameters</a></li>\
+<li class='inline'><a href='accopt.html#restrict'>restrict - specify access restrictions</a></li>\
+<li class='inline'><a href='comdex.html'>Command Index</a></li>\
+</ul>")
diff --git a/html/scripts/audio.txt b/html/scripts/audio.txt
new file mode 100644
index 0000000..5fb11fc
--- /dev/null
+++ b/html/scripts/audio.txt
@@ -0,0 +1,7 @@
+document.write("<p>Reference Clock Audio Drivers</p><ul>\
+<li class='inline'><a href='drivers/driver6.html'>IRIG Audio Decoder</a>\
+<li class='inline'><a href='drivers/driver7.html'>Radio CHU Audio Demodulator/Decoder</a></li>\
+<li class='inline'><a href='drivers/driver36.html'>Radio WWV/H Audio Demodulator/Decoder</a></li>\
+<li class='inline'><a href='audio.html'>Reference Clock Audio Drivers</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/authopt.txt b/html/scripts/authopt.txt
new file mode 100644
index 0000000..5064b18
--- /dev/null
+++ b/html/scripts/authopt.txt
@@ -0,0 +1,12 @@
+document.write("<p>Authentication Commands and Options</p4><ul>\
+<li class='inline'><a href='authopt.html#automax'>automax - specify Autokey regeneration interval</a></li>\
+<li class='inline'><a href='authopt.html#controlkey'>controlkey - specify control key ID</a></li>\
+<li class='inline'><a href='authopt.html#crypto'>crypto - configure Autokey parameters</a></li>\
+<li class='inline'><a href='authopt.html#ident'>ident - specify Autokey ephemeral group name</a></li>\
+<li class='inline'><a href='authopt.html#keys'>keys - specify symmetric keys filename</a></li>\
+<li class='inline'><a href='authopt.html#keysdir'>keysdir - specify Autokey key directory</a></li>\
+<li class='inline'><a href='authopt.html#requestkey'>requestkey - specify request key ID</a></li>\
+<li class='inline'><a href='authopt.html#revoke'>revoke - specify Autokey randomization interval</a></li>\
+<li class='inline'><a href='authopt.html#trustedkey'>trustedkey - specify trusted key IDs</a></li>\
+<li class='inline'><a href='comdex.html'>Command Index</a></li>\
+</ul>")
diff --git a/html/scripts/clockopt.txt b/html/scripts/clockopt.txt
new file mode 100644
index 0000000..1c76a1c
--- /dev/null
+++ b/html/scripts/clockopt.txt
@@ -0,0 +1,5 @@
+document.write("<p>Reference Clock Commands and Options</p><ul>\
+<li class='inline'><a href='clockopt.html#fudge'>fudge - specify fudge parameters</a><br>\
+<li class='inline'><a href='clockopt.html#server'>server - specify reference clock server</a><br>\
+<li class='inline'><a href='comdex.html'>Command Index</a></li>\
+</ul>")
diff --git a/html/scripts/command.txt b/html/scripts/command.txt
new file mode 100644
index 0000000..ec6169e
--- /dev/null
+++ b/html/scripts/command.txt
@@ -0,0 +1,7 @@
+document.write("\
+<table><tr>\
+<td width='50%' ><img src='icons/home.gif' align='middle' alt='gif'>\
+<a href='index.html'>Home Page</a></td>\
+<td width='50%' ><img src='icons/mail2.gif' align='middle' alt='gif'>\
+<a href='http://www.ntp.org/contact'>Contacts</a></i></td>\
+</tr></table>")
diff --git a/html/scripts/config.txt b/html/scripts/config.txt
new file mode 100644
index 0000000..84c226a
--- /dev/null
+++ b/html/scripts/config.txt
@@ -0,0 +1,5 @@
+document.write("<p>Client and Server Configuration</p><ul>\
+<li class='inline'><a href='assoc.html'>Association Management</a></li>\
+<li class='inline'><a href='discover.html'>Automatic Server Discovery Schemes</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/confopt.txt b/html/scripts/confopt.txt
new file mode 100644
index 0000000..c524f59
--- /dev/null
+++ b/html/scripts/confopt.txt
@@ -0,0 +1,12 @@
+document.write("<p>Server Commands and Options</p><ul>\
+<li class='inline'><a href='confopt.html#server'>server - configure client association</a></li>\
+<li class='inline'><a href='confopt.html#peer'>peer - configure symmetric peer association</a></li>\
+<li class='inline'><a href='confopt.html#broadcast'>broadcast - configure broadcast server association</a></li>\
+<li class='inline'><a href='confopt.html#manycastclient'>manycastclient - configure manycast client association</a></li>\
+<li class='inline'><a href='confopt.html#pool'>pool - configure pool association</a></li>\
+<li class='inline'><a href='confopt.html#unpeer'>unpeer - remove association</a></li>\
+<li class='inline'><a href='confopt.html#broadcastclient'>broadcastclient - enable broadcast client</a></li>\
+<li class='inline'><a href='confopt.html#manycastserver'>manycastserver - enable manycast server</a></li>\
+<li class='inline'><a href='confopt.html#multicastclient'>multicastclient - enable multicast client</a></li>\
+<li class='inline'><a href='comdex.html'>Command Index</a></li>\
+</ul>")
diff --git a/html/scripts/external.txt b/html/scripts/external.txt
new file mode 100644
index 0000000..5e70705
--- /dev/null
+++ b/html/scripts/external.txt
@@ -0,0 +1,19 @@
+document.write("<p>External Links</p><ul>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/book.html'>Computer Network Time Synchronization - The Network Time Protocol (book)</a></li>\
+<li class='inline'><a href='http://www.ntp.org/index.html'>NTP Public Services Project (home page)</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/ntp.html'>NTP Research Project (home page)</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/exec.html'>Executive Summary: Computer Network Time Synchronization</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/leap.html'>The NTP Timescale and Leap Seconds</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/time.html'>NTP Timestamp Calculations</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/y2k.html'>The NTP Era and Era Numbering</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/stamp.html'>Timestamp Capture Principles</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/onwire.html'>Analysis and Simulation of the NTP On-Wire Protocols</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/proximity.html'>Time Synchroization for Space Data Links</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/security.html'>NTP Security Analysis</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/ptp.html'>IEEE 1588 Precision Time Protocol (PTP)</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/autocfg.html'>Autonomous Configuration</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/autokey.html'>Autonomous Authentication</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/proto.html'>Autokey Protocol</a></li>\
+<li class='inline'><a href='http://www.eecis.udel.edu/~mills/ident.html'>Autokey Identity Schemes</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/footer.txt b/html/scripts/footer.txt
new file mode 100644
index 0000000..48830e6
--- /dev/null
+++ b/html/scripts/footer.txt
@@ -0,0 +1,9 @@
+document.write("\
+<table><tr>\
+<td width='33%' align='center'><img src='icons/home.gif' align='middle'>\
+<a href='index.html'>Home Page</a></td>\
+<td width='33%' align='center'><img src='icons/sitemap.png' align='middle'>\
+<a href='sitemap.html'>Site Map</a></td>\
+<td width='33%' align='center'><img src='icons/mail2.gif' align='middle'>\
+<a href='http://www.ntp.org/contact'>Contacts</a></td>\
+</tr></table>")
diff --git a/html/scripts/hand.txt b/html/scripts/hand.txt
new file mode 100644
index 0000000..95da082
--- /dev/null
+++ b/html/scripts/hand.txt
@@ -0,0 +1,11 @@
+document.write("<p>Handbook Pages</p><ul>\
+<li class='inline'><a href='release.html'>NTP Version 4 Release Notes</a></li>\
+<li class='inline'><a href='comdex.html'>Command Index</a></li>\
+<li class='inline'><a href='access.html'>Access Control Support</a></li>\
+<li class='inline'><a href='assoc.html'>Association Management</a></li>\
+<li class='inline'><a href='authentic.html'>Authentication Support</a></li>\
+<li class='inline'><a href='discover.html'>Automatic Server Discovery Schemes Timekeeping</a></li>\
+<li class='inline'><a href='rate.html'>Rate Management</a></li>\
+<li class='inline'><a href='refclock.html'>Reference Clock Support</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/install.txt b/html/scripts/install.txt
new file mode 100644
index 0000000..e8185f2
--- /dev/null
+++ b/html/scripts/install.txt
@@ -0,0 +1,10 @@
+document.write("<p>Build and Install</p><ul>\
+<li class='inline'><a href='build.html'>Building and Installing the Distribution</a></li>\
+<li class='inline'><a href='config.html'>Build Options</a></li>\
+<li class='inline'><a href='rdebug.html'>Debugging Reference Clock Drivers</a></li>\
+<li class='inline'><a href='quick.html'>Quick Start</a></li>\
+<li class='inline'><a href='release.html'>NTP Version 4 Release Notes</a></li>\
+<li class='inline'><a href='debug.html'>NTP Debugging Techniques</a></li>\
+<li class='inline'><a href='bugs.html'>NTP Bug Reporting Procedures</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/manual.txt b/html/scripts/manual.txt
new file mode 100644
index 0000000..bad1f93
--- /dev/null
+++ b/html/scripts/manual.txt
@@ -0,0 +1,13 @@
+document.write("<p>Program Manual Pages<p><ul>\
+<li class='inline'><a href='ntpd.html'><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a></li>\
+<li class='inline'><a href='ntpq.html'><tt>ntpq</tt> - standard NTP query program</a></li>\
+<li class='inline'><a href='ntpdc.html'><tt>ntpdc</tt> - special NTP query program</a></li>\
+<li class='inline'><a href='ntpdate.html'><tt>ntpdate</tt> - set the date and time via NTP</a></li>\
+<li class='inline'><a href='sntp.html'><tt>sntp</tt> - Simple Network Time Protocol (SNTP) client</a></li>\
+<li class='inline'><a href='ntptrace.html'><tt>ntptrace</tt> - trace a chain of NTP servers back to the primary source</a></li>\
+<li class='inline'><a href='tickadj.html'><tt>tickadj</tt> - set time-related kernel variables</a></li>\
+<li class='inline'><a href='ntptime.html'><tt>ntptime</tt> - read and set kernel time variables</a></li>\
+<li class='inline'><a href='keygen.html'><tt>ntp-keygen</tt> - generate public and private keys</a></li>\
+<li class='inline'><a href='ntpdsim_new.html'><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/misc.txt b/html/scripts/misc.txt
new file mode 100644
index 0000000..2dfb289
--- /dev/null
+++ b/html/scripts/misc.txt
@@ -0,0 +1,9 @@
+document.write("<p>Miscellaneous Pages</p><ul>\
+<li class='inline'><a href='copyright.html'>Copyright Notice</a></li>\
+<li class='inline'><a href='decode.html'>Event Messages and Status Words</a></li>\
+<li class='inline'><a href='kern.html'>Kernel Model for Precision Timekeeping</a></li>\
+<li class='inline'><a href='msyslog.html'><tt>ntpd</tt> System Log Messages</a></li>\
+<li class='inline'><a href='kernpps.html'>PPSAPI Interface for Precision Time Signals</a></li>\
+<li class='inline'><a href='pps.html'>Pulse-per-second (PPS) Signal Interfacing</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/miscopt.txt b/html/scripts/miscopt.txt
new file mode 100644
index 0000000..64987c8
--- /dev/null
+++ b/html/scripts/miscopt.txt
@@ -0,0 +1,21 @@
+document.write("<p>Miscellaneous Commands and Options</p><ul>\
+<li class='inline'><a href='miscopt.html#broadcastdelay'>broadcastdelay - specify broadcast delay</a></li>\
+<li class='inline'><a href='miscopt.html#driftfile'>driftfile - specify frequency file</a></li>\
+<li class='inline'><a href='miscopt.html#enable'>enable - enable options</a></li>\
+<li class='inline'><a href='miscopt.html#enable'>disable - disable options</a></li>\
+<li class='inline'><a href='miscopt.html#includefile'>includefile - specify include file</a></li>\
+<li class='inline'><a href='miscopt.html#interface'>interface - specify which local network addresses to use</a></li>\
+<li class='inline'><a href='miscopt.html#leapfile'>leapfile - specify leapseconds file</a></li>\
+<li class='inline'><a href='miscopt.html#logconfig'>logconfig - configure log file</a></li>\
+<li class='inline'><a href='miscopt.html#mru'>mru - control monitor MRU list limits</a></li>\
+<li class='inline'><a href='miscopt.html#phone'>phone - specify modem phone numbers</a></li>\
+<li class='inline'><a href='miscopt.html#reset'>reset - reset groups of counters</a></li>\
+<li class='inline'><a href='miscopt.html#saveconfigdir'>saveconfigdir - specify saveconfig directory</a></li>\
+<li class='inline'><a href='miscopt.html#setvar'>setvar - set system variables</a></li>\
+<li class='inline'><a href='miscopt.html#tinker'>tinker - modify sacred system parameters (dangerous)</a></li>\
+<li class='inline'><a href='miscopt.html#rlimit'>rlimit - alters certain process storage allocation limits</a></li>\
+<li class='inline'><a href='miscopt.html#tos'>tos - modify service parameters</a></li>\
+<li class='inline'><a href='miscopt.html#trap'>trap - set trap address</a></li>\
+<li class='inline'><a href='miscopt.html#ttl'>ttl - set time to live</a></li>\
+<li class='inline'><a href='comdex.html'>Command Index</a></li>\
+</ul>")
diff --git a/html/scripts/monopt.txt b/html/scripts/monopt.txt
new file mode 100644
index 0000000..b7d5a2f
--- /dev/null
+++ b/html/scripts/monopt.txt
@@ -0,0 +1,6 @@
+document.write("<p>Monitoring Commands and Options</p><ul>\
+<li class='inline'><a href='monopt.html#filegen'>filegen - specify monitor files</a></li>\
+<li class='inline'><a href='monopt.html#statistics'>statistics - enable writing of statistics records</a></li>\
+<li class='inline'><a href='monopt.html#statsdir'>statsdir - specify monitor files directory</a></li>\
+<li class='inline'><a href='comdex.html'>Command Index</a></li>\
+</ul>")
diff --git a/html/scripts/refclock.txt b/html/scripts/refclock.txt
new file mode 100644
index 0000000..b32e5fa
--- /dev/null
+++ b/html/scripts/refclock.txt
@@ -0,0 +1,7 @@
+document.write("<p>Reference Clock Support</p><ul>\
+<li class='inline'><a href='extern.html'>External Clock Discipline and the Local Clock Driver</a></li>\
+<li class='inline'><a href='howto.html'>How to Write a Reference Clock Driver</a></li>\
+<li class='inline'><a href='howto.html'>How to build new PARSE clocks</a></li>\
+<li class='inline'><a href='refclock.html'>Reference Clock Drivers</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul></ul>")
diff --git a/html/scripts/special.txt b/html/scripts/special.txt
new file mode 100644
index 0000000..b62d15e
--- /dev/null
+++ b/html/scripts/special.txt
@@ -0,0 +1,17 @@
+document.write("<p>Special Topics</p><ul>\
+<li class='inline'><a href='warp.html'>How NTP Works</a></li>\
+<li class='inline'><a href='prefer.html'>Mitigation Rules and the <tt>prefer</tt> Keyword</a></li>\
+<li class='inline'><a href='autokey.html'>Autokey Public-Key Authentication</a></li>\
+<li class='inline'><a href='orphan.html'>Orphan Mode</a></li>\
+<li class='inline'><a href='xleave.html'>NTP Interleaved Modes</a></li>\
+<li class='inline'><a href='huffpuff.html'>Huff-n'-Puff Filter</a></li>\
+<li class='inline'><a href='filter.html'>Clock Filter Algorithm</a></li>\
+<li class='inline'><a href='select.html'>Clock Select Algorithm</a></li>\
+<li class='inline'><a href='cluster.html'>Clock Cluster Algorithm</a></li>\
+<li class='inline'><a href='prefer.html'>Mitigation Rules and the <tt>prefer</tt> Keyword</a></li>\
+<li class='inline'><a href='discipline.html'>Clock Discipline Algorithm</a></li>\
+<li class='inline'><a href='poll.html'>Poll Process</a></li>\
+<li class='inline'><a href='clock.html'>Clock State Machine</a></li>\
+<li class='inline'><a href='leap.html'>Leap Second Processing</a></li>\
+<li class='inline'><a href='sitemap.html'>Site Map</a></li>\
+</ul>")
diff --git a/html/scripts/style.css b/html/scripts/style.css
new file mode 100644
index 0000000..7a0cc54
--- /dev/null
+++ b/html/scripts/style.css
@@ -0,0 +1,64 @@
+body {background: #FDF1E1;
+ color: #006600;
+ font-family: "verdana", sans-serif;
+ text-align: justify;
+ margin-left: 5px;}
+
+p, h4, hr, li {margin-top: .6em; margin-bottom: .6em}
+li.inline {text-align: left; margin-top: 0; margin-bottom: 0}
+
+ul, dl, ol, {margin-top: .6em; margin-bottom: .6em; margin-left 5em}
+
+dt {margin-top: .6em}
+dd {margin-bottom: .6em}
+
+div.header {text-align: center;
+ font-style: italic;}
+
+div.footer {text-align: center;
+ font-size: 60%;}
+
+img.cell {align: left;}
+
+td.sidebar {width: 40px; align: center; valign: top;}
+img.sidebar {align: center; margin-top: 5px;}
+h4.sidebar {align: center;}
+
+p.top {background: #FDF1E1;
+ color: #006600;
+ position: absolute;
+ margin-left: -90px;
+ text-align: center;}
+
+a:link.sidebar {background: transparent;
+ color: #990033;
+ font-weight: bold;}
+
+a:visited.sidebar {background: transparent;
+ color: #990033;
+ font-weight: bold;}
+
+a:hover.sidebar {background: #FDF1E1;
+ color: #006600;}
+
+img {margin: 5px;}
+
+div {text-align: center;}
+
+h1 {text-align: center;
+ font-size: 250%;}
+
+caption {background: #EEEEEE;
+ color: #339999;}
+
+tx {text-align: center;}
+
+th {background: #FFFFCC;
+ color: #006600;
+ text-align: center;
+ text-decoration: underline;
+ padding-top: 5px;}
+
+th.caption {background: #EEEEEE;
+ color: #006600;
+ text-align: center;}
diff --git a/html/select.html b/html/select.html
new file mode 100644
index 0000000..6cfa186
--- /dev/null
+++ b/html/select.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Clock Select Algorithm</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<em></em>
+<h3>Clock Select Algorithm</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:22<!-- #EndDate -->
+ UTC</p>
+<hr>
+<p>The clock select algorithm determines from a set of sources , which are correct (<em>truechimers</em>) and which are not (<em>falsetickers</em>) according to a set of formal correctness assertions. The principles are based on the observation that the maximum error in determining the offset of a candidate cannot exceed one-half the roundtrip delay to the primary reference clock at the time of measurement. This must be increased by the maximum error that can accumulate since then. The selection metric, called the <em>root distance,</em>, is one-half the roundtrip root delay plus the root dispersion plus minor error contributions not considered here.</p>
+<p>First, a number of sanity checks is performed to sift the selectable candidate from among the source population. The sanity checks are sumarized as follows:.</p>
+<ol>
+ <li>A <em>stratum error</em> occurs if (1) the source had never been synchronized or (2) the stratum of the source is below the <tt>floor</tt> option or not below the <tt>ceiling</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command. The default values for these options are 0 and 15, respectively. Note that 15 is a valid stratum, but a server operating at that stratum cannot synchronize clients.</li>
+ <li>A <em>distance error</em> occurs for a source if the root distance (also known ad synchronization distance) of the source is not below the distance threshold <tt>maxdist</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command. The default value for this option is 1.5 s for networks including only the Earth, but this should be increased to 2.5 s for networks including the Moon.</li>
+ <li>A <em>loop</em> <em>error</em> occurs if the source is synchronized to the client. This can occur if two peers are configured with each other in symmetric modes.</li>
+ <li>An <em>unreachable</em> <em>error</em> occurs if the source is unreachable or if the <tt>server</tt> or <tt>peer</tt> command for the source includes the <tt>noselect</tt> option.</li>
+</ol>
+Sources showing one or more of these errors are considered nonselectable; only the selectable candidates are considered in the following algorithm. Given the measured offset &theta;<sub>0</sub> and root distance &lambda;, this defines a <em>correctness interval</em> [&theta;<sub>0</sub> &minus; &lambda;, &theta;<sub>0</sub> + &lambda;] of points where the true value of &theta; lies somewhere on the interval. The given problem is to determine from a set of correctness intervals, which represent truechimers and which represent falsetickers. The principles must be given a precise definition. The <em>intersection interval</em> is the <em>smallest interval containing points from the largest number of correctness intervals.</em> An algorithm that finds the intersection interval was devised by Keith Marzullo in his doctoral dissertation. It was first implemented in the Digital Time Synchronization Service (DTSS) for the VMS operating system for the VAX.
+<p> While the NTP algorithm is based on DTSS, it remains to establish which point in the correctness interval represents the best estimate of the offset for each candidate. The best point is at the midpoint &theta;<sub>0</sub> of the correctness interval; however, the midpoint might not be within the intersection interval. A candidate with a correctness interval that contains points in the intersection interval is a truechimer and the best offset estimate is the midpoint of its correctness interval. A candidate with a correctness interval that contains no points in the intersection interval is a falseticker.</p>
+<div align="center"><img src="pic/flt3.gif" alt="gif">
+ <p>Figure 1. Intersection Interval</p>
+</div>
+<p>Figure 1 shows correctness intervals for each of four candidates A, B, C and D. We need to find the maximum number of candidates that contain points in common. The result is the interval labeled DTSS. In the figure there are three truechimers A, B and C, and one falseticker D. In DTSS any point in the intersection interval can represent the true time; however, as shown below, this may throw away valuable statistical information. In any case, the clock is considered correct if the number of truechimers found in this way are greater than half the total number of candidates.</p>
+<p>The question remains, which is the best point to represent the true time of each correctness interval? Fortunately, we already have the maximum likelihood estimate at the midpoint of each correctness interval. But, while the midpoint of candidate C is outside the intersection interval, its correctness interval contains points in common with the intersection interval, so the candidate is a truechimer and the midpoint is chosen to represent its time.</p>
+<p>The DTSS correctness assertions do not consider how best to represent the truechimer time. To support the midpoint choice, consider the selection algorithm as a method to reject correctness intervals that cannot contribute to the final outcome; that is, they are falsetickers. The remaining correctness intervals can contribute to the final outcome; that is, they are truechimers. Samples in the intersection interval are usually of very low probability and thus poor estimates for truechimer time. On the other hand, the midpoint sample produced by the clock filter algorithm is the maximum likelihood estimate and thus best represents the truechimer time.</p>
+<div align="center"><img src="pic/flt6.gif" alt="gif">
+ <p>Figure 2. Clock Select Algorithm</p>
+</div>
+<p> The algorithm operates as shown in Figure 2. Let <em>m</em> be the number of candidates and <em>f</em> the number of falsetickers, initially zero. Move a pointer from the leftmost endpoint towards the rightmost endpoint in Figure 1 and count the number of candidates, stopping when that number reaches <em>m</em> &minus; <em>f</em>; this is the left endpoint of the intersection interval. Then, do the same, but moving from the rightmost endpoint towards the leftmost endpoint; this is the right endpoint of the intersection interval. If the left endpoint is less than the right endpoint, the intersection interval has been found. Otherwise, increase <em>f</em> by 1. If <em>f</em> is less than <em>n</em> / 2, try again; otherwise, the algorithm fails and no truechimers could be found.</p>
+<p>The clock select algorithm again scans the correctness intervals. If the right endpoint of the correctness interval for a candidate is greater than the left endpoint of the intersection interval, or if the left endpoint of the correctness interval is less than the right endpoint of the intersection interval, the candidate is a truechimer; otherwise, it is a falseticker.</p>
+<p>In practice, with fast LANs and modern computers, the correctness interval can be quite small, especially when the candidates are multiple reference clocks. In such cases the intersection interval might be empty, due to insignificant differences in the reference clock offsets. To avoid this, the size of the correctness interval is padded to the value of <tt>mindist</tt>, with default 1 ms. This value can be changed using the <tt>mindist</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/sitemap.html b/html/sitemap.html
new file mode 100644
index 0000000..c4b9110
--- /dev/null
+++ b/html/sitemap.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Site Map</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Site Map</h3>
+<img src="pic/alice15.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice in Wonderland</i>, Lewis Carroll</a>
+<p>Welcome to the tea party.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->11-Sep-2010 05:55<!-- #EndDate -->
+ UTC<br clear="left">
+</p>
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/install.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/hand.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/command.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/config.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/refclock.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/audio.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/misc.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/special.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/external.txt"></script>
+<hr>
+<div align="center"> <img src="pic/tribeb.gif" alt="gif"></div>
+<br>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/sntp.html b/html/sntp.html
new file mode 100644
index 0000000..0c270cb
--- /dev/null
+++ b/html/sntp.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>sntp - Simple Network Time Protocol (SNTP) Client</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>sntp</tt> - Simple Network Time Protocol (SNTP) Client</h3>
+<img src="pic/dogsnake.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
+<p>S is for snakeoil.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->3-Oct-2011 21:51<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<hr>
+<h4>Synopsis</h4>
+<tt>sntp [{--help -?}][{-4 -6}][-a <i>keynum</i>][-b <i>bcaddress</i>][-B <i>bctimeout</i>][-c][-d][-D <i>debug-level</i>][-g <i>delay</i>][-K <i>kodfile</i>][-k <i>keyfile</i>][-l <i>logfile</i>][-M <i>steplimit</i>][-o <i>ntpver</i>][-r][-S][-s][-u <i>uctimeout</i>][--wait][--version][<i>address(es)</i>]</tt>
+<h4>Description</h4>
+<p>This program is a Simple Network Time Protocol (SNTP) client that can be used to query a Network Time Protocol (NTP) server and display the time offset of the system clock relative to the server clock. Run as root it can correct the system clock to this offset as well. It can be run as an interactive command or from a script by a <tt>cron</tt> job. The program implements the SNTP client protocol defined in RFC 5905, including the full on-wire protocol but does not provide the sanity checks, access controls, security functions and mitigation algorithms as in the full NTP version 4 specification, also defined in RFC 5905.</p>
+<p>By default, <tt>sntp</tt> writes the local date and time (i.e., not UTC) to the standard output in the format</p>
+<p><tt>2011-08-04 00:40:36.642222 (+0000) +0.006611 +/- 0.041061 psp-os1 149.20.68.26</tt></p>
+<p>where the <tt>+0.006611 +/- 0.041061</tt> indicates the time offset and error bound of the system clock relative to the server clock, in seconds.</p>
+<p>If -b <i>bcaddress</i> is not specified, the program sends a single message to each address and waits up to <i>uctimeout</i> (default 5) seconds for a unicast server response. Otherwise, it sends no message and waits up to <i>bctimeout</i> (default 68) seconds for a broadcast NTP message.</p>
+<h4>Options</h4>
+<p><tt>sntp</tt> recognizes the following options:</p>
+<dl>
+ <dt><tt>-?, --help</tt></dt>
+ <dd>displays usage information. The short form typically requires shell quoting, such as <tt>-\?</tt>, otherwise <tt>?</tt> is consumed by the shell.</dd>
+ <dt><tt>-4, --ipv4</tt></dt>
+ <dd>When resolving hostnames to IP addresses, use IPv4 addresses only.</dd>
+ <dt><tt>-6, --ipv6</tt></dt>
+ <dd>When resolving hostnames to IP addresses, use IPv6 addresses only.</dd>
+ <dt><tt>-a <i>keynum</i>, --authentication <i>keynum</i></tt></dt>
+ <dd>Enable authentication with the key ID <i>keynum</i>. <i>keynum</i> is a number specified in the keyfile along with an authentication secret (password or digest). See the <tt>-k, --keyfile</tt> option for more details.</dd>
+ <dt><tt>-b <i>bcaddress</i>, --broadcast <i>bcaddress</i></tt></dt>
+ <dd>Listen for NTP packets sent to the broadcast or multicast address <i>bcaddress</i>, which can be a DNS name or IP address. The default maximum time to listen for broadcasts/multicasts, 68 seconds, can be modified with the <tt>-B, --bctimeout</tt> option.</dd>
+ <dt><tt>-B <i>bctimeout</i>, --bctimeout <i>bctimeout</i></tt></dt>
+ <dd>Wait <i>bctimeout</i> seconds for broadcast or multicast NTP message before terminating. The default is 68 seconds, chosen because ntpd typically transmits broadcasts/multicasts every 64 seconds. Note that the short option is <tt>-B</tt>, an uppercase letter B.</dd>
+ <dt><tt>-c, --concurrent</tt></dt>
+ <dd>Concurrently query all addresses returned for hostname. Requests from an NTP client to a single server should never be sent more often than once every two seconds. By default, all addresses resolved from a single hostname are assumed to be for a single instance of ntpd, and therefore sntp will send queries to these addresses one after another, waiting two seconds between queries. This option indicates multiple addresses returned for a hostname are on different machines, so sntp can send concurrent queries. This is appropriate when using *.pool.ntp.org, for example.</dd>
+ <dt><tt>-d, --debug-level</tt></dt>
+ <dd>Increase debug verbosity level by one. May be specified multiple times. See also the <tt>-D, --set-debug-level</tt> option.</dd>
+ <dt><tt>-D <i>debug-level</i>, --set-debug-level <i>debug-level</i></tt></dt>
+ <dd>Set the debug verbosity level to <i>debug-level</i>. The default level is zero. Note that the short option is <tt>-D</tt>, an uppercase letter D. See also the <tt>-d, --debug-level</tt> option.</dd>
+ <dt><tt>-g <i>delay</i>, --gap <i>delay</i></tt></dt>
+ <dd>Specify the <i>delay</i> in milliseconds between outgoing queries, defaulting to 50. <tt>sntp</tt> sends queries to all provided hostnames/addresses in short succession, and by default terminates once the first valid response is received. With multiple time sources provided, all but one will not be used. To limit the number of queries whose responses will not be used, each query is separated from the preceding one by <i>delay</i> milliseconds, to allow time for responses to earlier queries to be received. A larger <i>delay</i> reduces the query load on the time sources, increasing the time to receive a valid response if the first source attempted is slow or unreachable.</dd>
+ <dt><tt>-K <i>kodfile</i>, --kod <i>kodfile</i></tt></dt>
+ <dd>Specifies the filename <i>kodfile</i> to be used for the persistent history of KoD (Kiss Of Death, or rate-limiting) responses received from servers. The default is <tt>/var/db/ntp-kod</tt>. Note that the short option is <tt>-K</tt>, an uppercase letter K.</dd>
+ <dt><tt>-k <i>keyfile</i>, --keyfile <i>keyfile</i></tt></dt>
+ <dd>Specifies the filename <i>keyfile</i> used with the <tt>-a</tt>/<tt>--authentication</tt> option. The format of the file is described on the <a href="keygen.html"><tt>ntp-keygen</tt> page</a>.</dd>
+ <dt><tt>-l <i>logfile</i>, --filelog <i>logfile</i></tt></dt>
+ <dd>Specifies the filename in which to append a copy of status messages, which also appear on the terminal.</dd>
+ <dt><tt>-M <i>steplimit</i>, --steplimit <i>steplimit</i></tt></dt>
+ <dd>If both <tt>-S</tt>/<tt>--step</tt> and <tt>-s</tt>/<tt>--slew</tt> options are provided, an offset of less than <i>steplimit</i> milliseconds will be corrected by slewing the clock using adjtime(), while an offset of <i>steplimit</i> or more will be corrected by setting the clock to the corrected time. Note that the short option is <tt>-M</tt>, an uppercase letter M.</dd>
+ <dt><tt>-o <i>ntpver</i>, --ntpversion <i>ntpver</i></tt></dt>
+ <dd>Specifies the NTP protocol version number <i>ntpver</i> to include in requests, default 4. This option is rarely useful.</dd>
+ <dt><tt>-r, --usereservedport</tt></dt>
+ <dd>By default, <tt>sntp</tt> uses a UDP source port number selected by the operating system. When this option is used, the reserved NTP port 123 is used, which most often requires <tt>sntp</tt> be invoked as the superuser (commonly "root"). This can help identify connectivity failures due to port-based firewalling which affect <tt>ntpd</tt>, which always uses source port 123.</dd>
+ <dt><tt>-S, --step</tt></dt>
+ <dd>By default, <tt>sntp</tt> displays the clock offset but does not attempt to correct it. This option enables offset correction by stepping, that is, directly setting the clock to the corrected time. This typically requires <tt>sntp</tt> be invoked as the superuser ("root"). Note that the short option is <tt>-S</tt>, an uppercase letter S.</dd>
+ <dt><tt>-s, --slew</tt></dt>
+ <dd>By default, <tt>sntp</tt> displays the clock offset but does not attempt to correct it. This option enables offset correction by slewing using adjtime(), which changes the rate of the clock for a period long enough to accomplish the required offset (phase) correction. This typically requires <tt>sntp</tt> be invoked as the superuser ("root").</dd>
+ <dt><tt>-u <i>uctimeout</i>, --uctimeout <i>uctimeout</i></tt></dt>
+ <dd>Specifies the maximum time <i>uctimeout</i> in seconds to wait for a unicast response before terminating.</dd>
+ <dt><tt>--wait</tt></dt>
+ <dd>When neither <tt>-S</tt>/<tt>--step</tt> nor <tt>-s</tt>/<tt>--slew</tt> options are provided, <tt>sntp</tt> will by default terminate after the first valid response is received. This option causes <tt>sntp</tt> to instead wait for all pending queries' responses.</dd>
+ <dt><tt>--version</tt></dt>
+ <dd>Display the <tt>sntp</tt> program's version number and the date and time it was compiled.</dd>
+</dl>
+<h4>Return Value</h4>
+<p>The program returns an exit status of zero for if a valid response is received and non-zero otherwise.</p>
+<h4>Author</h4>
+<p>This <tt>sntp</tt> was originally developed by Johannes Maximilian Kuehn. Harlan Stenn and Dave Hart modified it to query more than one server at a time. See the file <tt>ChangeLog</tt> in the distribution for details.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/stats.html b/html/stats.html
new file mode 100644
index 0000000..9438517
--- /dev/null
+++ b/html/stats.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>Performance Metrics</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>Performance Metrics</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:23<!-- #EndDate -->
+ UTC</p>
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/special.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/external.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">1. Introduction</a></li>
+ <li class="inline"><a href="#budget">2. Statistics Summary</a></li>
+ <li class="inline"><a href="#quality">3. Quality of Service</a></li>
+</ul>
+<hr>
+<h4 id="intro">1. Introduction</h4>
+
+<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>
+</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>
+<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>
+<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>
+</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>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>
+<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>
+</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>
+<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>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>
+</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>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/tickadj.html b/html/tickadj.html
new file mode 100644
index 0000000..3c38f84
--- /dev/null
+++ b/html/tickadj.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>tickadj - set time-related kernel variables</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3><tt>tickadj</tt> - set time-related kernel variables</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:24<!-- #EndDate -->
+ UTC</p>
+<hr>
+<h4>Synopsis</h4>
+<tt>tickadj [ -Aqs ] [ -a <i>tickadj</i> ] [ -t <i>tick</i> ]</tt>
+<h4>Description</h4>
+<p>The <tt>tickadj</tt> program reads, and optionally modifies, several timekeeping-related variables in older kernels that do not have support for precision timekeeping, including HP-UX, SunOS, Ultrix, SGI and probably others. Those machines provide means to patch the kernel <tt>/dev/kmem</tt>. Newer machines with kernel time support, including Solaris, Tru64, FreeBSD and Linux, should NOT use the program, even if it appears to work, as it will destabilize the kernel time support. Use the <a href="ntptime.html"><tt>ntptime</tt></a> program instead.</p>
+<p>The particular variables that can be changed with <tt>tickadj</tt> include <tt>tick</tt>, which is the number of microseconds added to the system time for a clock interrupt, <tt>tickadj</tt>, which sets the slew rate and resolution used by the <tt>adjtime</tt> system call, and <tt>dosynctodr</tt>, which indicates to the kernels on some machines whether they should internally adjust the system clock to keep it in line with time-of-day clock or not.</p>
+<p>By default, with no arguments, <tt>tickadj</tt> reads the variables of interest in the kernel and displays them. At the same time, it determines an &quot;optimal&quot; value for the value of the <tt>tickadj</tt> variable if the intent is to run the <tt>ntpd</tt> Network Time Protocol (NTP) daemon, and prints this as well. Since the operation of <tt>tickadj</tt> when reading the kernel mimics the operation of similar parts of the <tt>ntpd</tt> program fairly closely, this can be useful when debugging problems with <tt>ntpd</tt>.</p>
+<p>Note that <tt>tickadj</tt> should be run with some caution when being used for the first time on different types of machines. The operations which <tt>tickadj</tt> tries to perform are not guaranteed to work on all Unix machines and may in rare cases cause the kernel to crash.</p>
+<h4>Command Line Options</h4>
+<dl>
+ <dt><tt>-a <i>tickadj</i></tt></dt>
+ <dd>Set the kernel variable <tt>tickadj</tt> to the value <i><tt>tickadj specified.</tt></i></dd>
+ <dt><tt>-A</tt></dt>
+ <dd>Set the kernel variable <tt>tickadj</tt> to an internally computed &quot;optimal&quot; value.</dd>
+ <dt><tt>-t <i>tick</i></tt></dt>
+ <dd>Set the kernel variable <tt>tick</tt> to the value <i><tt>tick</tt></i> specified.</dd>
+ <dt><tt>-s</tt></dt>
+ <dd>Set the kernel variable <tt>dosynctodr</tt> to zero, which disables the hardware time-of-year clock, a prerequisite for running the <tt>ntpd</tt> daemon under SunOS 4.x.</dd>
+ <dt><tt>-q</tt></dt>
+ <dd>Normally, <tt>tickadj</tt> is quite verbose about what it is doing. The <tt>-q</tt> flag tells it to shut up about everything except errors.</dd>
+</dl>
+<h4>Files</h4>
+<tt>/vmunix<br>
+/unix<br>
+/dev/kmem<br>
+</tt>
+<h4>Bugs</h4>
+Fiddling with kernel variables at run time as a part of ordinary operations is a hideous practice which is only necessary to make up for deficiencies in the implementation of <tt>adjtime</tt> in many kernels and/or brokenness of the system clock in some vendors' kernels. It would be much better if the kernels were fixed and the <tt>tickadj</tt> program went away.
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/warp.html b/html/warp.html
new file mode 100644
index 0000000..1d42dd6
--- /dev/null
+++ b/html/warp.html
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>How NTP Works</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>How NTP Works</h3>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:24<!-- #EndDate -->
+ UTC</p>
+<h4>Related Links</h4>
+<script type="text/javascript" language="javascript" src="scripts/special.txt"></script>
+<script type="text/javascript" language="javascript" src="scripts/external.txt"></script>
+<h4>Table of Contents</h4>
+<ul>
+ <li class="inline"><a href="#intro">1. Introduction and Overview</a></li>
+ <li class="inline"><a href="#scale">2. NTP Timescale and Data Formats</a></li>
+ <li class="inline"><a href="#arch">3. Architecture and Algorithms</a></li>
+</ul>
+<hr>
+<h4 align="center">Abstract</h4>
+<blockquote>
+ <p align="left"> This page and its dependencies contain a technical description of the Network Time Protocol (NTP) architecture and operation. It is intended for administrators, operators and monitoring personnel. Additional information for nontechnical readers can be found in the white paper <a href="http://www.eecis.udel.edu/~mills/exec.html">Executive Summary: Computer Network Time Synchronization</a>. While this page and its dependencies are primarily concerned with NTP, additional information on related protocols can be found in the white papers <a href="http://www.eecis.udel.edu/~mills/ptp.html">IEEE 1588 Precision Time Protocol (PTP)</a> and <a href="http://www.eecis.udel.edu/~mills/proximity.html">Time Synchronization for Space Data Links</a>. Note that reference to a page in this document collection is to a page in the collection, while reference to a <em>white paper</em> is to a document at the <a href="http://www.eecis.udel.edu/~mills/ntp.html">Network Time Synchronization Research Project</a> web site.</p>
+</blockquote>
+<h4 id="intro">1. Introduction and Overview</h4>
+
+<p>NTP time synchronization services are widely available in the public Internet. The public NTP subnet currently includes several thousand servers in most countries and on every continent of the globe, including Antarctica, and sometimes in space and on the sea floor. These servers support, directly or indirectly, a total population estimated at over 25 million computers in the global Internet.</p>
+<p> The NTP subnet operates with a hierarchy of levels, where each level is assigned a number called the stratum. Stratum 1 (primary) servers at the lowest level are directly synchronized to national time services via satellite, radio or telephone modem. Stratum 2 (secondary) servers at the next higher level are synchronized to stratum 1 servers and so on. Normally, NTP clients and servers with a relatively small number of clients do not synchronize to public primary servers. There are several hundred public secondary servers operating at higher strata and are the preferred choice.</p>
+<p>This page presents an overview of the NTP implementation included in this software distribution. We refer to this implementation as the <em>reference implementation</em> only because it was used to test and validate the NTPv4 specification RFC-5905. It is best read in conjunction with the briefings and white papers on the <a href="http://www.eecis.udel.edu/~mills/ntp.html">Network Time Synchronization Research Project</a> page. An executive summary suitable for management and planning purposes is in the white paper <a href="http://www.eecis.udel.edu/~mills/exec.html">Executive Summary: Computer Network Time Synchronization</a>.</p>
+<h4 id="scale">2. NTP Timescale and Data Formats</h4>
+<p>NTP clients and servers synchronize to the Coordinated Universal Time (UTC) timescale used by national laboratories and disseminated by radio, satellite and telephone modem. This is a global timescale independent of geographic position. There are no provisions to correct for local time zone or daylight savings time; however, these functions can be performed by the operating system on a per-user basis.</p>
+<p> The UT1 timescale, upon which UTC is based, is determined by the rotation of the Earth about its axis. The Earth rotation is gradually slowing down relative to International Atomic Time (TAI). In order to rationalize UTC with respect to TAI, a leap second is inserted at intervals of about 18 months, as determined by the International Earth Rotation Service (IERS). Reckoning with leap seconds in the NTP timescale is described in the white paper <a href="http://www.eecis.udel.edu/~mills/leap.html">The NTP Timescale and Leap Seconds</a>.</p>
+<p>The historic insertions are documented in the <tt>leap-seconds.list</tt> file, which can be downloaded from the NIST FTP servers. This file is updated at intervals not exceeding six months. Leap second warnings are disseminated by the national laboratories in the broadcast timecode format. These warnings are propagated from the NTP primary servers via other server to the clients by the NTP on-wire protocol. The leap second is implemented by the operating system kernel, as described in the white paper <a href="http://www.eecis.udel.edu/~mills/leap.html">The NTP Timescale and Leap Seconds</a>. Implementation details are described on the <a href="leap.html">Leap Second Processing</a> page.</p>
+<div align="center">
+<img src="pic/time1.gif" alt="gif">
+<p>Figure 1. NTP Data Formats</p>
+</div>
+<p>Figure 1 shows two NTP time formats, a 64-bit <em>timestamp</em> format and a 128-bit <em>datestamp</em> format. The datestamp format is used internally, while the timestamp format is used in packet headers exchanged between clients and servers. The timestamp format spans 136 years, called an <em>era</em>. The current era began on 1 January 1900, while the next one begins in 2036. Details on these formats and conversions between them are in the white paper <a href="http://www.eecis.udel.edu/~mills/y2k.html">The NTP Era and Era Numbering</a>. However, the NTP protocol will synchronize correctly, regardless of era, as long as the system clock is set initially within 68 years of the correct time. Further discussion on this issue is in the white paper <a href="http://www.eecis.udel.edu/~mills/time.html">NTP Timestamp Calculations</a>. Ordinarily, these formats are not seen by application programs, which convert these NTP formats to native Unix or Windows formats.</p>
+<h4 id="arch">3. Architecture and Algorithms</h4>
+<div align="center">
+ <p><img src="pic/fig_3_1.gif" alt="gif"></p>
+ <p>Figure 2. NTP Daemon Processes and Algorithms</p>
+</div>
+<p>The overall organization of the NTP architecture is shown in Figure 2. It is useful in this context to consider the implementation as both a client of upstream (lower stratum) servers and as a server for downstream (higher stratum) clients. It includes a pair of peer/poll processes for each reference clock or remote server used as a synchronization source. Packets are exchanged between the client and server using the <em>on-wire protocol</em> described in the white paper <a href="http://www.eecis.udel.edu/~mills/onwire.html">Analysis and Simulation of the NTP On-Wire Protocols</a>. The protocol is resistant to lost, replayed or spoofed packets.</p>
+<p> The poll process sends NTP packets at intervals ranging from 8 s to 36 hr. The intervals are managed as described on the <a href="poll.html">Poll Process</a> page to maximize accuracy while minimizing network load. The peer process receives NTP packets and performs the packet sanity tests described on the <a href="decode.html">Event Messages and Status Words</a> page and <a href="decode.html#flash">flash status word</a>. The flash status word reports in addition the results of various access control and security checks described in the white paper <a href="http://www.eecis.udel.edu/~mills/security.html">NTP Security Analysis</a>. A sophisticated traffic monitoring facility described on the <a href="rate.html">Rate Management and the Kiss-o'-Death Packet</a> page protects against denial-of-service (DoS) attacks.</p>
+<p>Packets that fail one or more of these tests are summarily discarded. Otherwise, the peer process runs the on-wire protocol that uses four raw timestamps: the <em>origin timestamp</em> <em>T</em><sub>1</sub> upon departure of the client request, the <em>receive timestamp</em> <em>T</em><sub>2</sub> upon arrival at the server, the <em>transmit timestamp</em> <em>T</em><sub>3</sub> upon departure of the server reply, and the <em>destination timestamp</em> <em>T</em><sub>4</sub> upon arrival at the client. These timestamps, which are recorded by the <tt>rawstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command, are used to calculate the clock offset and roundtrip delay samples:</p>
+<div align="center">
+ <p>offset = [(<em>T</em><sub>2</sub> -<em> T</em><sub>1</sub>) + (<em>T</em><sub>3</sub> - <em>T</em><sub>4</sub>)] / 2,<br>
+ delay = (<em>T</em><sub>4</sub> - <em>T</em><sub>1</sub>) - (<em>T</em><sub>3</sub> - <em>T</em><sub>2</sub>).</p>
+</div>
+<p>In this description the transmit timestamps <em>T</em><sub>1</sub> and <em>T</em><sub>3</sub> are <em>softstamps</em> measured by the inline code. Softstamps are subject to various queuing and processing delays. A more accurate measurement uses <em>drivestamps</em>, as described on the <a href="xleave.html">NTP Interleaved Modes</a> page. These issues along with mathematical models are discussed in the white paper <a href="http://www.eecis.udel.edu/~mills/time.html">NTP Timestamp Calculations</a>.</p>
+<p>The offset and delay statistics for one or more peer processes are processed by a suite of mitigation algorithms. The algorithm described on the <a href="filter.html">Clock Filter Algorithm</a> page selects the offset and delay samples most likely to produce accurate results. Those servers that have passed the sanity tests are declared <em>selectable</em>. From the selectable population the statistics are used by the algorithm described on the <a href="select.html">Clock Select Algorithm</a> page to determine a number of <em>truechimers</em> according to Byzantine agreement and correctness principles. From the truechimer population the algorithm described on the <a href="cluster.html">Clock Cluster Algorithm</a> page determines a number of <em>survivors</em> on the basis of statistical clustering principles.</p>
+<p> The algorithms described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page combine the survivor offsets, designate one of them as the <em>system peer</em> and produces the final offset used by the algorithm described on the <a href="discipline.html">Clock Discipline Algorithm</a> page to adjust the system clock time and frequency. The clock offset and frequency, are recorded by the <tt>loopstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. For additional details about these algorithms, see the Architecture Briefing on the <a href="http://www.eecis.udel.edu/~mills/ntp.html">Network Time Synchronization Research Project</a> page. For additional information on statistacl principles and performance metrics, see the <a href="stats.html">Performance Metrics</a> page.</p>
+<hr>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/html/xleave.html b/html/xleave.html
new file mode 100644
index 0000000..417185c
--- /dev/null
+++ b/html/xleave.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<meta name="generator" content="HTML Tidy, see www.w3.org">
+<title>NTP Interleaved Modes</title>
+<link href="scripts/style.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+<h3>NTP Interleaved Modes </h3>
+<img src="pic/pogo4.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
+<p>You need a little magic.</p>
+<p>Last update:
+ <!-- #BeginDate format:En2m -->10-Mar-2014 05:25<!-- #EndDate -->
+ UTC</p>
+<br clear="left">
+<hr>
+<p>In the protocol described in the NTP specification and reference implementation up to now, the transmit timestamp, which is captured before the message digest is computed and the packet queued for output, is properly called as a <em>softstamp</em> The receive timestamp, which is captured after the input driver interrupt routine and before the packet is queued for input, is properly called a <em>drivestamp</em>. For enhanced accuracy it is desirable to capture the transmit timestamp as close to the wire as possible; for example, after the output driver interrupt routine.</p>
+<p> In other words, we would like to replace the transmit softstamp with a drivestamp, but the problem is the transmit drivestamp is available only after the packet has been sent. A solution for this problem is the two-step or interleaved protocol described on this page and included in the the current reference implementation. In interleaved modes the transmit drivestamp for one packet is actually carried in the immediately following packet. The trick, however, is to implement the interleaved protocol without changing the NTP packet header format, without compromising backwards compatibility and without compromising the error recovery properties.</p>
+<p> The reference implementation captures a softstamp before the message digest routine and a drivestamp after the output interrupt routine. In this design the latter timestamp can be considered most accurate, as it avoids the various queuing and transmission latencies. The difference between the two timestamps, which is called the interleaved or output delay, varies from 16 &mu;s for a dual-core Pentium running FreeBSD 6.1 to 1100 &mu;s for a Sun Blade 1500 running Solaris 10.</p>
+<p>Interleaved mode can be used only in NTP symmetric and broadcast modes.
+ It is activated by the <tt>xleave</tt> option with the <tt>peer</tt> or <tt>broadcast</tt> configuration
+commands. A broadcast server configured for interleaved mode is transparent to ordinary broadcast clients, so both ordinary and interleaved broadcast clients can use the same packets. An interleaved symmetric active peer automatically switches to ordinary symmetric mode if the other peer is not capable of operation in interleaved mode. </p>
+<p>As demonstrated in the white paper <a href="http://www.eecis.udel.edu/~mills/onwire.html">Analysis and Simulation of the NTP On-Wire Protocols</a>, the interleaved modes have the same resistance to lost packets, duplicate packets, packets crossed in flight and protocol restarts as the ordinary modes. An application of the interleaved symmetric mode in space missions is presented in the white paper <a href="http://www.eecis.udel.edu/~mills/proximity.html">Time Synchronization for Space Data Links</a>.</p>
+<hr>
+<div align="center"> <img src="pic/pogo1a.gif" alt="gif"> </div>
+<br>
+<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
+</body>
+</html>
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 0000000..5ab3e6e
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1,77 @@
+NULL =
+
+SUBDIRS = isc
+
+noinst_HEADERS = \
+ adjtime.h \
+ audio.h \
+ ascii.h \
+ audio.h \
+ binio.h \
+ declcond.h \
+ gps.h \
+ hopf6039.h \
+ icom.h \
+ ieee754io.h \
+ intreswork.h \
+ iosignal.h \
+ l_stdlib.h \
+ lib_strbuf.h \
+ libntp.h \
+ mbg_gps166.h \
+ mx4200.h \
+ ntif.h \
+ ntp.h \
+ ntp_assert.h \
+ ntp_calendar.h \
+ ntp_cmdargs.h \
+ ntp_config.h \
+ ntp_control.h \
+ ntp_crypto.h \
+ ntp_prio_q.h \
+ ntp_datum.h \
+ ntp_debug.h \
+ ntp_filegen.h \
+ ntp_fp.h \
+ ntp_if.h \
+ ntp_intres.h \
+ ntp_io.h \
+ ntp_libopts.h \
+ ntp_lineedit.h \
+ ntp_lists.h \
+ ntp_machine.h \
+ ntp_malloc.h \
+ ntp_md5.h \
+ ntp_net.h \
+ ntp_proto.h \
+ ntp_random.h \
+ ntp_refclock.h \
+ ntp_request.h \
+ ntp_rfc2553.h \
+ ntp_select.h \
+ ntp_stdlib.h \
+ ntp_string.h \
+ ntp_syscall.h \
+ ntp_syslog.h \
+ ntp_tty.h \
+ ntp_types.h \
+ ntp_unixtime.h \
+ ntp_worker.h \
+ ntp_workimpl.h \
+ ntpd.h \
+ ntpsim.h \
+ parse.h \
+ parse_conf.h \
+ recvbuff.h \
+ refclock_atom.h \
+ ssl_applink.c \
+ timepps-SCO.h \
+ timepps-Solaris.h \
+ timepps-SunOS.h \
+ timespecops.h \
+ timetoa.h \
+ timevalops.h \
+ trimble.h \
+ vint64ops.h \
+ $(NULL)
+
diff --git a/include/Makefile.in b/include/Makefile.in
new file mode 100644
index 0000000..e50f270
--- /dev/null
+++ b/include/Makefile.in
@@ -0,0 +1,808 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = include
+DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+SUBDIRS = isc
+noinst_HEADERS = \
+ adjtime.h \
+ audio.h \
+ ascii.h \
+ audio.h \
+ binio.h \
+ declcond.h \
+ gps.h \
+ hopf6039.h \
+ icom.h \
+ ieee754io.h \
+ intreswork.h \
+ iosignal.h \
+ l_stdlib.h \
+ lib_strbuf.h \
+ libntp.h \
+ mbg_gps166.h \
+ mx4200.h \
+ ntif.h \
+ ntp.h \
+ ntp_assert.h \
+ ntp_calendar.h \
+ ntp_cmdargs.h \
+ ntp_config.h \
+ ntp_control.h \
+ ntp_crypto.h \
+ ntp_prio_q.h \
+ ntp_datum.h \
+ ntp_debug.h \
+ ntp_filegen.h \
+ ntp_fp.h \
+ ntp_if.h \
+ ntp_intres.h \
+ ntp_io.h \
+ ntp_libopts.h \
+ ntp_lineedit.h \
+ ntp_lists.h \
+ ntp_machine.h \
+ ntp_malloc.h \
+ ntp_md5.h \
+ ntp_net.h \
+ ntp_proto.h \
+ ntp_random.h \
+ ntp_refclock.h \
+ ntp_request.h \
+ ntp_rfc2553.h \
+ ntp_select.h \
+ ntp_stdlib.h \
+ ntp_string.h \
+ ntp_syscall.h \
+ ntp_syslog.h \
+ ntp_tty.h \
+ ntp_types.h \
+ ntp_unixtime.h \
+ ntp_worker.h \
+ ntp_workimpl.h \
+ ntpd.h \
+ ntpsim.h \
+ parse.h \
+ parse_conf.h \
+ recvbuff.h \
+ refclock_atom.h \
+ ssl_applink.c \
+ timepps-SCO.h \
+ timepps-Solaris.h \
+ timepps-SunOS.h \
+ timespecops.h \
+ timetoa.h \
+ timevalops.h \
+ trimble.h \
+ vint64ops.h \
+ $(NULL)
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/include/README b/include/README
new file mode 100644
index 0000000..5d818dc
--- /dev/null
+++ b/include/README
@@ -0,0 +1,4 @@
+README file for directory ./include of the NTP Version 4 distribution
+
+This directory contains the include files used by most programs in this
+distribution.
diff --git a/include/adjtime.h b/include/adjtime.h
new file mode 100644
index 0000000..74d91eb
--- /dev/null
+++ b/include/adjtime.h
@@ -0,0 +1,63 @@
+/*************************************************************************/
+/* (c) Copyright Tai Jin, 1988. All Rights Reserved. */
+/* Hewlett-Packard Laboratories. */
+/* */
+/* Permission is hereby granted for unlimited modification, use, and */
+/* distribution. This software is made available with no warranty of */
+/* any kind, express or implied. This copyright notice must remain */
+/* intact in all versions of this software. */
+/* */
+/* The author would appreciate it if any bug fixes and enhancements were */
+/* to be sent back to him for incorporation into future versions of this */
+/* software. Please send changes to tai@iag.hp.com or ken@sdd.hp.com. */
+/*************************************************************************/
+
+/* "adjtime.h,v 3.1 1993/07/06 01:04:43 jbj Exp" */
+/* adjtime.h,v
+ * Revision 3.1 1993/07/06 01:04:43 jbj
+ * NTP release 3.1
+ *
+ *
+ * Revision 1.5 90/02/07 15:34:18 15:34:18 src (Source Hacker)
+ * CHANGED KEY !!!
+ *
+ * Revision 1.4 89/02/09 12:26:35 12:26:35 tai (Tai Jin (Guest))
+ * *** empty log message ***
+ *
+ * Revision 1.4 89/02/09 12:26:35 12:26:35 tai (Tai Jin)
+ * added comment
+ *
+ * Revision 1.3 88/08/30 01:08:29 01:08:29 tai (Tai Jin)
+ * fix copyright notice again
+ *
+ * Revision 1.2 88/08/30 00:51:55 00:51:55 tai (Tai Jin)
+ * fix copyright notice
+ *
+ * Revision 1.1 88/04/02 14:56:54 14:56:54 tai (Tai Jin)
+ * Initial revision
+ * */
+
+#include "ntp_types.h"
+
+#define KEY 659847L
+
+typedef union {
+ struct msgbuf msgp;
+ struct {
+ long mtype;
+ int code;
+ struct timeval tv;
+ } msgb;
+} MsgBuf;
+
+#define MSGSIZE (sizeof(int) + sizeof(struct timeval))
+/*
+ * mtype values
+ */
+#define CLIENT 1L
+#define SERVER 2L
+/*
+ * code values
+ */
+#define DELTA1 0
+#define DELTA2 1
diff --git a/include/ascii.h b/include/ascii.h
new file mode 100644
index 0000000..a789091
--- /dev/null
+++ b/include/ascii.h
@@ -0,0 +1,96 @@
+/*
+ * /src/NTP/ntp4-dev/include/ascii.h,v 4.4 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * ascii.h,v 4.4 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Jul 20 11:42:53 1997 $
+ *
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#ifndef ASCII_H
+#define ASCII_H
+
+/*
+ * just name the common ASCII control codes
+ */
+#define NUL 0
+#define SOH 1
+#define STX 2
+#define ETX 3
+#define EOT 4
+#define ENQ 5
+#define ACK 6
+#define BEL 7
+#define BS 8
+#define HT 9
+#define NL 10
+#define VT 11
+#define NP 12
+#define CR 13
+#define SO 14
+#define SI 15
+#define DLE 16
+#define DC1 17
+#define DC2 18
+#define DC3 19
+#define DC4 20
+#define NAK 21
+#define SYN 22
+#define ETB 23
+#define CAN 24
+#define EM 25
+#define SUB 26
+#define ESC 27
+#define FS 28
+#define GS 29
+#define RS 30
+#define US 31
+#define SP 32
+#define DEL 127
+
+#endif
+/*
+ * History:
+ *
+ * ascii.h,v
+ * Revision 4.4 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.3 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.1 1998/07/11 10:05:22 kardel
+ * Release 4.0.73d reconcilation
+ *
+ * Revision 4.0 1998/04/10 19:50:38 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 4.0 1998/04/10 19:50:38 kardel
+ * Start 4.0 release version numbering
+ *
+ */
diff --git a/include/audio.h b/include/audio.h
new file mode 100644
index 0000000..1b969bd
--- /dev/null
+++ b/include/audio.h
@@ -0,0 +1,14 @@
+/*
+ * Header file for audio drivers
+ */
+#include "ntp_types.h"
+
+#define MAXGAIN 255 /* max codec gain */
+#define MONGAIN 127 /* codec monitor gain */
+
+/*
+ * Function prototypes
+ */
+int audio_init (char *, int, int);
+int audio_gain (int, int, int);
+void audio_show (void);
diff --git a/include/binio.h b/include/binio.h
new file mode 100644
index 0000000..d1ee944
--- /dev/null
+++ b/include/binio.h
@@ -0,0 +1,76 @@
+/*
+ * /src/NTP/ntp4-dev/include/binio.h,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * binio.h,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Jul 20 13:03:05 1997 $
+ *
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#ifndef BINIO_H
+#define BINIO_H
+
+#include "ntp_stdlib.h"
+
+long get_lsb_short (unsigned char **);
+void put_lsb_short (unsigned char **, long);
+long get_lsb_long (unsigned char **);
+void put_lsb_long (unsigned char **, long);
+
+long get_msb_short (unsigned char **);
+void put_msb_short (unsigned char **, long);
+long get_msb_long (unsigned char **);
+void put_msb_long (unsigned char **, long);
+
+#endif
+/*
+ * History:
+ *
+ * binio.h,v
+ * Revision 4.5 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.4 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.2 1998/06/28 16:52:15 kardel
+ * added binio MSB prototypes for {get,put}_msb_{short,long}
+ *
+ * Revision 4.1 1998/06/12 15:07:40 kardel
+ * fixed prototyping
+ *
+ * Revision 4.0 1998/04/10 19:50:38 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.1 1998/04/10 19:27:32 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ *
+ * Revision 1.1 1997/10/06 20:55:37 kardel
+ * new parse structure
+ *
+ */
diff --git a/include/declcond.h b/include/declcond.h
new file mode 100644
index 0000000..751eff9
--- /dev/null
+++ b/include/declcond.h
@@ -0,0 +1,21 @@
+/*
+ * declcond.h - declarations conditionalized for ntpd
+ *
+ * The NTP reference implementation distribution includes two distinct
+ * declcond.h files, one in ntpd/ used only by ntpd, and another in
+ * include/ used by libntp and utilities. This relies on the source
+ * file's directory being ahead of include/ in the include search.
+ *
+ * The ntpd variant of declcond.h declares "debug" only #ifdef DEBUG,
+ * as the --disable-debugging version of ntpd should not reference
+ * "debug". The libntp and utilities variant always declares debug,
+ * as it is used in those codebases even without DEBUG defined.
+ */
+#ifndef DECLCOND_H
+#define DECLCOND_H
+
+/* #ifdef DEBUG */ /* uncommented in ntpd/declcond.h */
+extern int debug;
+/* #endif */ /* uncommented in ntpd/declcond.h */
+
+#endif /* DECLCOND_H */
diff --git a/include/gps.h b/include/gps.h
new file mode 100644
index 0000000..d4f2dbc
--- /dev/null
+++ b/include/gps.h
@@ -0,0 +1,53 @@
+/****************************************************************************/
+/* gps.h */
+/* TrueTime GPS-VME and VME-SG */
+/* VME controller hardware commands and parameters. */
+/* created 010694 res */
+/* History: revised for 747i 3/94 */
+/****************************************************************************/
+
+
+#define GPS_VME "/dev/vme2" /* the device file for the GPS board */
+ /* change it to whatever yours is */
+#define PRIO 120 /* set the realtime priority */
+#define NREGS 7 /* number of registers we will use */
+
+#define GFRZ1 0x0020 /* freeze cmd addr gen reg. 1 */
+#define GREG1A 0x0021 /* Gen reg. 1 Word A (units microsec to 0.001 sec) */
+#define GREG1B 0x0040 /* Gen reg. 1 Word B (units 0.01 sec to tens sec ) */
+#define GREG1C 0x0041 /* Gen reg 1 Word C (units mins and hours) */
+#define GREG1D 0x0042 /* Gen reg. 1 Word D (units days and status) */
+#define GREG1E 0x0043 /* Gen reg. 1 Word E (units Years ) */
+#define GUFRZ1 0x0022 /* unfreeze cmd addr gen reg 1 */
+
+#define MASKDAY 0x0FFF /* mask for units days */
+#define MASKHI 0xFF00
+#define MASKLO 0x00FF
+/* Use the following ASCII hex values: N(0x004e),S(0x0053),E(0x0045),
+ W(0x0057), +(0x002B), - (0x002D) */
+
+#define LAT1 0x0048 /* Lat (degrees) */
+#define LAT2 0x0049 /* Lat (min, sec) */
+#define LAT3 0x004A /* Lat (N/S, tenths sec) */
+#define LON1 0x004B /* Lon (degrees) */
+#define LON2 0x004C /* Lon (min, sec) */
+#define LON3 0x004D /* Lon (E/W, tenths sec) */
+#define ELV1 0x004E /* Elev. (sign, 10,000 and 1000 ) */
+#define ELV2 0x004F /* Elev. (100, 10s, units, and .1) */
+
+#define CFREG1 0x0050 /* config. register 1 */
+#define CFREG2 0x00A0 /* config. register 2 */
+#define PMODE 0x00A4 /* Position mode */
+#define LOCAL 0x0051 /* Local hours offset */
+#define RATE 0x0054 /* Pulse rate output select */
+#define DAC 0x0055 /* OSC Control (DAC) select */
+
+#define PUMS 0x0056 /* Gen. preset register unit millisec */
+#define PMS 0x0057 /* Gen. preset register units hundreds and tens ms */
+#define PSEC 0x0058 /* Gen. preset register units tens and unit seconds */
+#define PMIN 0x0059 /* Gen. preset register units tens and unit minutes */
+#define PHRS 0x005A /* Gen. preset register units tens and unit hours */
+#define PDYS1 0x005B /* Gen. preset register units tens and unit days */
+#define PDYS2 0x005C /* Gen. preset register units hundreds days */
+#define PYRS1 0x005D /* Gen. preset register units tens and unit years */
+#define PYRS2 0x005E /* Gen. preset reg. units thousands and hundreds yrs */
diff --git a/include/hopf6039.h b/include/hopf6039.h
new file mode 100644
index 0000000..8532099
--- /dev/null
+++ b/include/hopf6039.h
@@ -0,0 +1,144 @@
+/****************************************************************************/
+/* hopf6039.h */
+/* hopf Elektronik 6039 PCI radio clock header */
+/* (c) 1999, 2000 Bernd Altmeier <altmeier@ATLSoft.de> */
+/* Rev. 1.00 Date 25.03.2000 */
+/* History: */
+/****************************************************************************/
+
+#ifndef _hopf6039_H_
+#define _hopf6039_H_
+
+#define HOPF_MAXVERSION 8
+#define HOPF_CNTR_MEM_LEN 0x7f
+#define HOPF_DATA_MEM_LEN 0x3ff /* this is our memory size */
+
+/* macros and definition for 32 to 16 to 8 bit conversion */
+
+typedef unsigned long DWORD;
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+
+#define LOWORD(l) ((WORD)(l))
+#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
+#define LOBYTE(w) ((BYTE)(w))
+#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
+
+/* iocntl codes for driver access */
+
+#define HOPF_CLOCK_CMD_MASK 0xff000
+
+#define HOPF_CLOCK_GET_LOCAL 0x10000
+#define HOPF_CLOCK_GET_UTC 0x20000
+#define HOPF_CLOCK_GET_ANTENNA 0x30000
+#define HOPF_CLOCK_GET_DIFFERENCE 0x40000
+#define HOPF_CLOCK_GET_VERSION 0x50000
+#define HOPF_CLOCK_GET_POSITION 0x60000
+#define HOPF_CLOCK_GET_SATDATA 0x70000
+#define HOPF_CLOCK_GET_SYSTEMBYTE 0x80000
+#define HOPF_CLOCK_GET_IRIG 0x90000
+
+#define HOPF_CLOCK_SET_DIFFERENCE 0x01000
+#define HOPF_CLOCK_SET_ANTENNA 0x02000
+#define HOPF_CLOCK_SET_TIME 0x03000
+#define HOPF_CLOCK_SET_POSITION 0x04000
+#define HOPF_CLOCK_SET_SATMODE 0x05000
+#define HOPF_CLOCK_SET_SYSTEMBYTE 0x06000
+#define HOPF_CLOCK_SET_RESET 0x07000
+#define HOPF_CLOCK_SET_IRIG 0x08000
+
+/* clock command codes */
+
+#define HOPF_CLOCK_HARDRESET 0x00008000
+#define HOPF_CLOCK_SOFTRESET 0x00004000
+
+/* sat-information */
+
+typedef struct SatStat{
+ BYTE wVisible;
+ BYTE wMode;
+ BYTE wSat0;
+ BYTE wRat0;
+ BYTE wSat1;
+ BYTE wRat1;
+ BYTE wSat2;
+ BYTE wRat2;
+ BYTE wSat3;
+ BYTE wRat3;
+ BYTE wSat4;
+ BYTE wRat4;
+ BYTE wSat5;
+ BYTE wRat5;
+ BYTE wSat6;
+ BYTE wRat6;
+ BYTE wSat7;
+ BYTE wRat7;
+} SatStat;
+
+/* GPS position */
+
+typedef struct GPSPos { /* Position */
+ long wAltitude;
+ long wLongitude;
+ long wLatitude;
+} GPSPos;
+
+/* clock hardware version */
+
+typedef struct ClockVersion {
+ char cVersion[255]; /* Hardware Version like " DCF-RECEIVER, VERSION 01.01, DAT: 23.NOV.1999" */
+ char dVersion[255]; /* Driver Version */
+} ClockVersion;
+
+/* hopftime what you think */
+
+typedef struct HOPFTIME {
+ unsigned int wYear;
+ unsigned int wMonth;
+ unsigned int wDayOfWeek;
+ unsigned int wDay;
+ unsigned int wHour;
+ unsigned int wMinute;
+ unsigned int wSecond;
+ unsigned int wMilliseconds;
+ unsigned int wStatus;
+} HOPFTIME;
+
+/* DCF77 antenna alignment */
+
+typedef struct DcfAntenne {
+ BYTE bStatus;
+ BYTE bStatus1;
+ WORD wAntValue;
+} DcfAntenne;
+
+/* hopf PCI clock */
+
+typedef struct hopfCard {
+ char name[32];
+ unsigned irq;
+ unsigned long membase; /* without mmap */
+ unsigned int port;
+
+ int versionlen;
+ char versionbuf[1024];
+ char *version[HOPF_MAXVERSION];
+ char cardname[32];
+ int interrupt;
+ void *mbase; /* this will be our memory base address */
+
+} hopfCard;
+
+typedef struct cardparams {
+ unsigned int port;
+ unsigned irq;
+ int cardtype;
+ int cardnr;
+ unsigned int membase;
+} cardparams;
+
+
+#define WRITE_REGISTER 0x00
+#define READ_REGISTER 0x01
+
+#endif /* _hopf6039_H_ */
diff --git a/include/icom.h b/include/icom.h
new file mode 100644
index 0000000..66d12e5
--- /dev/null
+++ b/include/icom.h
@@ -0,0 +1,87 @@
+/*
+ * Header file for ICOM radios
+ */
+#include "ntp_types.h"
+
+/*
+ * Common definitions
+ */
+#define P_ERMSG 0x1 /* trace bus error messages */
+#define P_TRACE 0x2 /* trace CI-V messges */
+#define RETRY 3 /* max packet retries */
+#define IBAUD B1200 /* autotune port speed */
+
+/*
+ * Radio identifier codes
+ */
+#define IC1271 0x24
+#define IC1275 0x18
+#define IC271 0x20
+#define IC275 0x10
+#define IC375 0x12
+#define IC471 0x22
+#define IC475 0x14
+#define IC575 0x16
+#define IC725 0x28
+#define IC726 0x30
+#define IC735 0x04
+#define IC751 0x1c
+#define IC761 0x1e
+#define IC765 0x2c
+#define IC775 0x46
+#define IC781 0x26
+#define IC970 0x2e
+#define R7000 0x08
+#define R71 0x1a
+#define R7100 0x34
+#define R72 0x32
+#define R8500 0x4a
+#define R9000 0x2a
+
+/*
+ * CI-V frame codes
+ */
+#define PR 0xfe /* preamble */
+#define TX 0xe0 /* controller address */
+#define FI 0xfd /* end of message */
+#define ACK 0xfb /* controller normal reply */
+#define NAK 0xfa /* controller error reply */
+#define PAD 0xff /* transmit padding */
+
+/*
+ * CI-V controller commands
+ */
+#define V_FREQT 0x00 /* freq set (transceive) */
+#define V_MODET 0x01 /* set mode (transceive) */
+#define V_RBAND 0x02 /* read band edge */
+#define V_RFREQ 0x03 /* read frequency */
+#define V_RMODE 0x04 /* read mode */
+#define V_SFREQ 0x05 /* set frequency */
+#define V_SMODE 0x06 /* set mode */
+#define V_SVFO 0x07 /* select vfo */
+#define V_SMEM 0x08 /* select channel/bank */
+#define V_WRITE 0x09 /* write channel */
+#define V_VFOM 0x0a /* memory -> vfo */
+#define V_CLEAR 0x0b /* clear channel */
+#define V_ROFFS 0x0c /* read tx offset */
+#define V_SOFFS 0x0d /* write tx offset */
+#define V_SCAN 0x0e /* scan control */
+#define V_SPLIT 0x0f /* split control */
+#define V_DIAL 0x10 /* set dial tuning step */
+#define V_ATTEN 0x11 /* set attenuator */
+#define V_SANT 0x12 /* select antenna */
+#define V_ANNC 0x13 /* announce control */
+#define V_WRCTL 0x14 /* write controls */
+#define V_RDCTL 0x15 /* read controls */
+#define V_TOGL 0x16 /* set switches */
+#define V_ASCII 0x17 /* send CW message */
+#define V_POWER 0x18 /* power control */
+#define V_RDID 0x19 /* read model ID */
+#define V_SETW 0x1a /* read/write channel/bank data */
+#define V_CTRL 0x7f /* miscellaneous control */
+
+/*
+ * Function prototypes
+ */
+int icom_init (char *, int, int);
+int icom_freq (int, int, double);
diff --git a/include/ieee754io.h b/include/ieee754io.h
new file mode 100644
index 0000000..73e7f79
--- /dev/null
+++ b/include/ieee754io.h
@@ -0,0 +1,78 @@
+/*
+ * /src/NTP/ntp4-dev/include/ieee754io.h,v 4.3 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * ieee754io.h,v 4.3 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Jul 13 12:22:11 1997 $
+ *
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#ifndef IEEE754IO_H
+#define IEEE754IO_H
+
+#define IEEE_SINGLE 1
+#define IEEE_DOUBLE 2
+
+#define IEEE_MSB 1
+#define IEEE_LSB 2
+
+#define IEEE_OK 0 /* conversion ok */
+#define IEEE_BADCALL 1 /* bad call parameters */
+#define IEEE_NAN 2 /* found an NaN */
+#define IEEE_POSINFINITY 3 /* positive infinity */
+#define IEEE_NEGINFINITY 4 /* negative infinity */
+#define IEEE_POSOVERFLOW 5 /* positive overflow */
+#define IEEE_NEGOVERFLOW 6 /* negative overflow */
+
+#define IEEE_OFFSETS 8 /* number of byte positions */
+typedef unsigned char offsets_t[IEEE_OFFSETS];
+
+int fetch_ieee754 (unsigned char **bufp, int size, l_fp *lfpp, offsets_t offsets);
+int put_ieee754 (unsigned char **bufpp, int size, l_fp *lfpp, offsets_t offsets);
+
+#endif
+/*
+ * History:
+ *
+ * ieee754io.h,v
+ * Revision 4.3 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.2 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.0 1998/04/10 19:50:40 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.1 1998/04/10 19:27:33 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ *
+ * Revision 1.1 1997/10/06 20:55:37 kardel
+ * new parse structure
+ *
+ */
diff --git a/include/intreswork.h b/include/intreswork.h
new file mode 100644
index 0000000..c343ac0
--- /dev/null
+++ b/include/intreswork.h
@@ -0,0 +1,29 @@
+/*
+ * intreswork.h -- declarations private to ntp_intres.c, ntp_worker.c.
+ */
+#ifndef INTRESWORK_H
+#define INTRESWORK_H
+
+#include "ntp_worker.h"
+
+#ifdef WORKER
+
+extern int blocking_getaddrinfo(blocking_child *,
+ blocking_pipe_header *);
+extern int blocking_getnameinfo(blocking_child *,
+ blocking_pipe_header *);
+
+#ifdef TEST_BLOCKING_WORKER
+extern void gai_test_callback(int rescode, int gai_errno,
+ void *context, const char *name,
+ const char *service,
+ const struct addrinfo *hints,
+ const struct addrinfo *ai_res);
+extern void gni_test_callback(int rescode, int gni_errno,
+ sockaddr_u *psau, int flags,
+ const char *host,
+ const char *service, void *context);
+#endif /* TEST_BLOCKING_WORKER */
+#endif /* WORKER */
+
+#endif /* INTRESWORK_H */
diff --git a/include/iosignal.h b/include/iosignal.h
new file mode 100644
index 0000000..406804e
--- /dev/null
+++ b/include/iosignal.h
@@ -0,0 +1,58 @@
+#ifndef IOSIGNAL_H
+#define IOSIGNAL_H
+
+#include "ntp_refclock.h"
+
+ /*
+ * Some systems (MOST) define SIGPOLL == SIGIO, others SIGIO == SIGPOLL, and
+ * a few have separate SIGIO and SIGPOLL signals. This code checks for the
+ * SIGIO == SIGPOLL case at compile time.
+ * Do not define USE_SIGPOLL or USE_SIGIO.
+ * these are interal only to iosignal.c and ntpd/work_fork.c!
+ */
+#if defined(USE_SIGPOLL)
+# undef USE_SIGPOLL
+#endif
+#if defined(USE_SIGIO)
+# undef USE_SIGIO
+#endif
+
+/* type of input handler function - only shared between iosignal.c and ntp_io.c */
+typedef void (input_handler_t)(l_fp *);
+
+#if defined(HAVE_SIGNALED_IO)
+# if defined(USE_TTY_SIGPOLL) || defined(USE_UDP_SIGPOLL)
+# define USE_SIGPOLL
+# endif
+
+# if !defined(USE_TTY_SIGPOLL) || !defined(USE_UDP_SIGPOLL)
+# define USE_SIGIO
+# endif
+
+# if defined(USE_SIGIO) && defined(USE_SIGPOLL)
+# if SIGIO == SIGPOLL
+# define USE_SIGIO
+# undef USE_SIGPOLL
+# endif /* SIGIO == SIGPOLL */
+# endif /* USE_SIGIO && USE_SIGPOLL */
+
+#define USING_SIGIO() using_sigio
+
+extern int using_sigio;
+
+extern void block_sigio (void);
+extern void unblock_sigio (void);
+extern int init_clock_sig (struct refclockio *);
+extern void init_socket_sig (int);
+extern void set_signal (input_handler_t *);
+
+# define BLOCKIO() block_sigio()
+# define UNBLOCKIO() unblock_sigio()
+
+#else /* !HAVE_SIGNALED_IO follows */
+# define BLOCKIO() do {} while (0)
+# define UNBLOCKIO() do {} while (0)
+# define USING_SIGIO() FALSE
+#endif
+
+#endif /* IOSIGNAL_H */
diff --git a/include/isc/Makefile.am b/include/isc/Makefile.am
new file mode 100644
index 0000000..160203b
--- /dev/null
+++ b/include/isc/Makefile.am
@@ -0,0 +1,5 @@
+NULL =
+
+noinst_HEADERS = \
+ mem.h \
+ $(NULL)
diff --git a/include/isc/Makefile.in b/include/isc/Makefile.in
new file mode 100644
index 0000000..af01dcd
--- /dev/null
+++ b/include/isc/Makefile.in
@@ -0,0 +1,586 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = include/isc
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+noinst_HEADERS = \
+ mem.h \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/isc/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/isc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool ctags distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/include/isc/mem.h b/include/isc/mem.h
new file mode 100644
index 0000000..ba1bfeb
--- /dev/null
+++ b/include/isc/mem.h
@@ -0,0 +1,68 @@
+/*
+ * libntp local override of isc/mem.h to stub it out.
+ *
+ * include/isc is searched before any of the lib/isc include
+ * directories and should be used only for replacement NTP headers
+ * overriding headers of the same name under lib/isc.
+ *
+ * NOTE: this assumes the system malloc is thread-safe and does
+ * not use any normal lib/isc locking.
+ */
+
+/*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */
+
+#ifndef ISC_MEM_H
+#define ISC_MEM_H 1
+
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+#include <isc/xml.h>
+
+#include <ntp_stdlib.h>
+
+
+#define ISC_MEM_UNUSED_ARG(a) ((void)(a))
+
+#define isc_mem_allocate(c, cnt) isc_mem_get(c, cnt)
+#define isc_mem_get(c, cnt) \
+ ( ISC_MEM_UNUSED_ARG(c), emalloc(cnt) )
+
+#define isc_mem_reallocate(c, mem, cnt) \
+ ( ISC_MEM_UNUSED_ARG(c), erealloc((mem), cnt) )
+
+#define isc_mem_put(c, mem, cnt) \
+ ( ISC_MEM_UNUSED_ARG(cnt), isc_mem_free(c, (mem)) )
+
+#define isc_mem_free(c, mem) \
+ ( ISC_MEM_UNUSED_ARG(c), free(mem) )
+
+#define isc_mem_strdup(c, str) \
+ ( ISC_MEM_UNUSED_ARG(c), estrdup(str) )
+
+#define isc__mem_attach(src, ptgt) do { *(ptgt) = (src); } while (0)
+#define isc__mem_detach(c) ISC_MEM_UNUSED_ARG(c)
+#define isc__mem_printallactive(s) fprintf((s), \
+ "isc_mem_printallactive() stubbed.\n")
+
+#endif /* ISC_MEM_H */
diff --git a/include/l_stdlib.h b/include/l_stdlib.h
new file mode 100644
index 0000000..073ea46
--- /dev/null
+++ b/include/l_stdlib.h
@@ -0,0 +1,224 @@
+/*
+ * Proto types for machines that are not ANSI and POSIX compliant.
+ * This is optional
+ */
+
+#ifndef L_STDLIB_H
+#define L_STDLIB_H
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#include <stdarg.h>
+#include <sys/types.h>
+
+/* Needed for speed_t. */
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#endif
+
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
+#include "ntp_types.h"
+#include "ntp_proto.h"
+
+/* Let's try to keep this more or less alphabetized... */
+
+#ifdef DECL_ADJTIME_0
+struct timeval;
+extern int adjtime (struct timeval *, struct timeval *);
+#endif
+
+#ifdef DECL_BCOPY_0
+#ifndef bcopy
+extern void bcopy (const char *, char *, int);
+#endif
+#endif
+
+#ifdef DECL_BZERO_0
+#ifndef bzero
+extern void bzero (char *, int);
+#endif
+#endif
+
+#ifdef DECL_CFSETISPEED_0
+struct termios;
+extern int cfsetispeed (struct termios *, speed_t);
+extern int cfsetospeed (struct termios *, speed_t);
+#endif
+
+extern char * getpass (const char *);
+
+#ifdef DECL_HSTRERROR_0
+extern const char * hstrerror (int);
+#endif
+
+#ifdef DECL_INET_NTOA_0
+struct in_addr;
+extern char * inet_ntoa (struct in_addr);
+#endif
+
+#ifdef DECL_IOCTL_0
+extern int ioctl (int, u_long, char *);
+#endif
+
+#ifdef DECL_IPC_0
+struct sockaddr;
+extern int bind (int, struct sockaddr *, int);
+extern int connect (int, struct sockaddr *, int);
+extern int recv (int, char *, int, int);
+extern int recvfrom (int, char *, int, int, struct sockaddr *, int *);
+extern int send (int, char *, int, int);
+extern int sendto (int, char *, int, int, struct sockaddr *, int);
+extern int setsockopt (int, int, int, char *, int);
+extern int socket (int, int, int);
+#endif
+
+#ifdef DECL_MEMMOVE_0
+extern void * memmove (void *, const void *, size_t);
+#endif
+
+#ifdef DECL_MEMSET_0
+extern char * memset (char *, int, int);
+#endif
+
+#ifdef DECL_MKSTEMP_0
+extern int mkstemp (char *);
+#endif
+
+#ifdef DECL_MKTEMP_0
+extern char *mktemp (char *);
+#endif
+
+#ifdef DECL_NLIST_0
+struct nlist;
+extern int nlist (const char *, struct nlist *);
+#endif
+
+#ifdef DECL_PLOCK_0
+extern int plock (int);
+#endif
+
+#ifdef DECL_RENAME_0
+extern int rename (const char *, const char *);
+#endif
+
+#ifdef DECL_SELECT_0
+#ifdef NTP_SELECT_H
+extern int select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
+#endif
+#endif
+
+#ifdef DECL_SETITIMER_0
+struct itimerval;
+extern int setitimer (int , struct itimerval *, struct itimerval *);
+#endif
+
+#ifdef PRIO_PROCESS
+#ifdef DECL_SETPRIORITY_0
+extern int setpriority (int, int, int);
+#endif
+#ifdef DECL_SETPRIORITY_1
+extern int setpriority (int, id_t, int);
+#endif
+#endif
+
+#ifdef DECL_SIGVEC_0
+struct sigvec;
+extern int sigvec (int, struct sigvec *, struct sigvec *);
+#endif
+
+#ifdef DECL_STDIO_0
+#if defined(FILE) || defined(BUFSIZ)
+extern int _flsbuf (int, FILE *);
+extern int _filbuf (FILE *);
+extern int fclose (FILE *);
+extern int fflush (FILE *);
+extern int fprintf (FILE *, const char *, ...);
+extern int fscanf (FILE *, const char *, ...);
+extern int fputs (const char *, FILE *);
+extern int fputc (int, FILE *);
+extern int fread (char *, int, int, FILE *);
+extern void perror (const char *);
+extern int printf (const char *, ...);
+extern int setbuf (FILE *, char *);
+# ifdef HAVE_SETLINEBUF
+extern int setlinebuf (FILE *);
+# endif
+extern int setvbuf (FILE *, char *, int, int);
+extern int scanf (const char *, ...);
+extern int sscanf (const char *, const char *, ...);
+extern int vfprintf (FILE *, const char *, ...);
+extern int vsprintf (char *, const char *, ...);
+#endif
+#endif
+
+#ifdef DECL_STIME_0
+extern int stime (const time_t *);
+#endif
+
+#ifdef DECL_STIME_1
+extern int stime (long *);
+#endif
+
+#ifdef DECL_STRERROR_0
+extern char * strerror (int errnum);
+#endif
+
+#ifdef DECL_STRTOL_0
+extern long strtol (const char *, char **, int);
+#endif
+
+#ifdef DECL_SYSCALL
+extern int syscall (int, ...);
+#endif
+
+#ifdef DECL_SYSLOG_0
+extern void closelog (void);
+#ifndef LOG_DAEMON
+extern void openlog (const char *, int);
+#else
+extern void openlog (const char *, int, int);
+#endif
+extern int setlogmask (int);
+extern void syslog (int, const char *, ...);
+#endif
+
+#ifdef DECL_TIME_0
+extern time_t time (time_t *);
+#endif
+
+#ifdef DECL_TIMEOFDAY_0
+#ifdef SYSV_TIMEOFDAY
+extern int gettimeofday (struct timeval *);
+extern int settimeofday (struct timeval *);
+#else /* not SYSV_TIMEOFDAY */
+struct timezone;
+extern int gettimeofday (struct timeval *, struct timezone *);
+extern int settimeofday (struct timeval *, void *);
+#endif /* not SYSV_TIMEOFDAY */
+#endif
+
+#ifdef DECL_TOLOWER_0
+extern int tolower (int);
+#endif
+
+#ifdef DECL_TOUPPER_0
+extern int toupper (int);
+#endif
+
+/*
+ * Necessary variable declarations.
+ */
+#ifdef DECL_ERRNO
+extern int errno;
+#endif
+
+#if defined(DECL_H_ERRNO) && !defined(h_errno)
+extern int h_errno;
+#endif
+
+#endif /* L_STDLIB_H */
diff --git a/include/lib_strbuf.h b/include/lib_strbuf.h
new file mode 100644
index 0000000..5ee92d6
--- /dev/null
+++ b/include/lib_strbuf.h
@@ -0,0 +1,32 @@
+/*
+ * lib_strbuf.h - definitions for routines which use the common string buffers
+ */
+#ifndef LIB_STRBUF_H
+#define LIB_STRBUF_H
+
+#include <ntp_types.h>
+#include <ntp_malloc.h> /* for ZERO() */
+
+/*
+ * Sizes of things
+ */
+#define LIB_NUMBUF 16
+#define LIB_BUFLENGTH 128
+
+typedef char libbufstr[LIB_BUFLENGTH];
+extern libbufstr lib_stringbuf[LIB_NUMBUF];
+extern int lib_nextbuf;
+extern int lib_inited;
+
+
+/*
+ * Macro to get a pointer to the next buffer
+ */
+#define LIB_GETBUF(bufp) \
+ do { \
+ ZERO(lib_stringbuf[lib_nextbuf]); \
+ (bufp) = &lib_stringbuf[lib_nextbuf++][0]; \
+ lib_nextbuf %= COUNTOF(lib_stringbuf); \
+ } while (FALSE)
+
+#endif /* LIB_STRBUF_H */
diff --git a/include/libntp.h b/include/libntp.h
new file mode 100644
index 0000000..8d87c02
--- /dev/null
+++ b/include/libntp.h
@@ -0,0 +1,16 @@
+/* libntp.h */
+
+#if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX)
+#define GETDTABLESIZE() ((int)sysconf(_SC_OPEN_MAX))
+#elif defined(HAVE_GETDTABLESIZE)
+#define GETDTABLESIZE getdtablesize
+#else
+/*
+ * if we have no idea about the max fd value set up things
+ * so we will start at FOPEN_MAX
+ */
+#define GETDTABLESIZE() (FOPEN_MAX + FD_CHUNK)
+#endif
+
+extern void make_socket_nonblocking( SOCKET fd );
+extern SOCKET move_fd( SOCKET fd );
diff --git a/include/mbg_gps166.h b/include/mbg_gps166.h
new file mode 100644
index 0000000..974deba
--- /dev/null
+++ b/include/mbg_gps166.h
@@ -0,0 +1,582 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/include/mbg_gps166.h,v 4.7 2006/06/22 18:41:43 kardel RELEASE_20060622_A
+ *
+ * mbg_gps166.h,v 4.7 2006/06/22 18:41:43 kardel RELEASE_20060622_A
+ *
+ * $Created: Sun Jul 20 09:20:50 1997 $
+ *
+ * File GPSSERIO.H Copyright (c) by Meinberg Funkuhren (www.meinberg.de)
+ *
+ * Linkage to PARSE:
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#ifndef MBG_GPS166_H
+#define MBG_GPS166_H
+
+
+/***************************************************************************/
+/* */
+/* File: GPSSERIO.H 4.1 */
+/* */
+/* Project: Common C Library */
+/* */
+/* Compiler: Borland C++ */
+/* */
+/* Author: M. Burnicki, Meinberg Funkuhren */
+/* */
+/* */
+/* Description: */
+/* This file defines structures and codes to be used to access GPS166 */
+/* via its serial interface COM0. COM0 should be set to a high baud */
+/* rate, default is 19200. */
+/* */
+/* Standard GPS166 serial operation is to send a time string that is */
+/* compatible with Meinberg UA31 or PZF535 DCF77 radio remote clocks. */
+/* That string can be transmitted automatically once per second, once */
+/* per minute or on request per ASCII '?'. */
+/* */
+/* Parameter setup or parameter readout works using blocks of binary */
+/* data which have to be isolated from the standard string. A block of */
+/* data starts with a SOH code (ASCII Start Of Header, 0x01) followed */
+/* by a message header with constant length and a data portion with */
+/* variable length. The first field (cmd) of the message header holds */
+/* the command code rsp. the type of data to be transmitted. The next */
+/* field (len) gives the number of data bytes that are transmitted */
+/* after the header. This number ranges from 0 to sizeof( MSG_DATA ). */
+/* The third field (data_csum) holds a checksum of all data bytes and */
+/* the last field of the header finally holds the checksum of the. */
+/* header. */
+/* */
+/***************************************************************************/
+
+/* the control codes defined below are to be or'ed with a command/type code */
+
+#define GPS_REQACK 0x8000 /* to GPS166: request acknowledge */
+#define GPS_ACK 0x4000 /* from GPS166: acknowledge a command */
+#define GPS_NACK 0x2000 /* from GPS166: error receiving command */
+
+#define GPS_CTRL_MSK 0xF000 /* masks control code from command */
+
+
+/* The codes below specify commands/types of data to be supplied to GPS166: */
+
+/* GPS166 auto-message to host */
+/* þ host request, GPS166 response */
+/* þ þ host download to GPS166 */
+/* þ þ þ */
+enum { /* þ þ þ */
+ /* system data */
+ GPS_AUTO_ON = 0x000, /* þ þ þ X þ enable auto-messages from GPS166 */
+ GPS_AUTO_OFF, /* þ þ þ X þ disable auto-messages from GPS166 */
+ GPS_SW_REV, /* þ þ X þ þ request software revision */
+ GPS_STAT, /* þ þ X þ þ request status of buffered variables */
+ GPS_TIME, /* þ X þ þ X þ current time or capture or init board time */
+ GPS_POS_XYZ, /* þ þ X þ X þ current position in ECEF coords */
+ GPS_POS_LLA, /* þ þ X þ X þ current position in geographic coords */
+ GPS_TZDL, /* þ þ X þ X þ time zone / daylight saving */
+ GPS_PORT_PARM, /* þ þ X þ X þ parameters of the serial ports */
+ GPS_SYNTH, /* þ þ X þ X þ synthesizer's frequency and phase */
+ GPS_ANT_INFO, /* þ X þ X þ þ time diff after antenna disconnect */
+ GPS_UCAP, /* þ X þ X þ þ user capture */
+
+ /* GPS data */
+ GPS_CFGH = 0x100, /* þ þ X þ X þ SVs' configuration and health codes */
+ GPS_ALM, /* þ þ X þ X þ one SV's almanac */
+ GPS_EPH, /* þ þ X þ X þ one SV's ephemeris */
+ GPS_UTC, /* þ þ X þ X þ UTC correction parameters */
+ GPS_IONO, /* þ þ X þ X þ ionospheric correction parameters */
+ GPS_ASCII_MSG /* þ þ X þ þ the GPS ASCII message */
+};
+
+/*
+ * modelled after GPSDEFS.H Revision 1.5
+ */
+/***************************************************************************/
+/* */
+/* File: GPSDEFS.H 4.1 */
+/* */
+/* Project: Common C Library */
+/* */
+/* Compiler: Borland C++ */
+/* */
+/* Author: M. Burnicki, Meinberg Funkuhren */
+/* */
+/* */
+/* Description: */
+/* General definitions to be used with GPS166 */
+/* GPS166 Rev. 1.23 or above */
+/* */
+/* Modifications: see file GPSLIB.TXT */
+/* */
+/***************************************************************************/
+#define _GPSDEFS_H
+/* the type of various checksums */
+
+#ifndef _CSUM_DEFINED
+ typedef unsigned short CSUM;
+# define _CSUM_DEFINED
+#endif
+
+/* the message header */
+
+typedef struct {
+ unsigned short gps_cmd;
+ unsigned short gps_len;
+ unsigned short gps_data_csum;
+ unsigned short gps_hdr_csum;
+} GPS_MSG_HDR;
+
+/* a struct used to hold the software revision information */
+
+typedef struct {
+ unsigned short code; /* e.g. 0x0120 means rev. 1.20 */
+ unsigned char name[17]; /* used to identify customized versions */
+} SW_REV;
+
+/* GPS ASCII message */
+
+typedef struct {
+ CSUM csum; /* checksum of the remaining bytes */
+ short valid; /* flag data are valid */
+ char s[23]; /* 22 chars GPS ASCII message plus trailing zero */
+} ASCII_MSG;
+
+#define MIN_SVNO 1 /* min. SV number */
+#define MAX_SVNO 32 /* max. SV number */
+#define N_SVNO ( MAX_SVNO - MIN_SVNO + 1) /* number of possibly active SVs */
+
+
+typedef short SVNO; /* the number of a SV */
+typedef unsigned short HEALTH; /* a SV's health code */
+typedef unsigned short CFG; /* a SV's configuration code */
+typedef unsigned short IOD; /* Issue-Of-Data code */
+
+/* Date and time referred to the linear time scale defined by GPS. */
+/* GPS time is defined by the number of weeks since midnight from */
+/* January 5, 1980 to January 6, 1980 plus the number of seconds of */
+/* the current week plus fractions of a second. GPS time differs from */
+/* UTC because UTC is corrected with leap seconds while GPS time scale */
+/* is continuous. */
+
+typedef struct {
+ unsigned short wn; /* the week number since GPS has been installed */
+ unsigned long sec; /* the second of that week */
+ unsigned long tick; /* fractions of a second; scale: 1E-7 */
+} T_GPS;
+
+
+/* Local date and time computed from GPS time. The current number */
+/* of leap seconds have to be added to get UTC from GPS time. */
+/* Additional corrections could have been made according to the */
+/* time zone/daylight saving parameters (TZDL, see below) defined */
+/* by the user. The status field can be checked to see which corrections */
+/* have been applied. */
+
+#ifndef GPS166_TM_DEFINED
+ typedef struct {
+ short year; /* 0..9999 */
+ char month; /* 1..12 */
+ char mday; /* 1..31 */
+ short yday; /* 1..366 */
+ char wday; /* 0..6 == Sun..Sat */
+ char hour; /* 0..23 */
+ char minute; /* 0..59 */
+ char second; /* 0..59 */
+ long frac; /* fractions of a second, scale 1E-7 */
+ long offs_from_utc; /* local time's offset from UTC */
+ unsigned short status; /* flags */
+ } TM;
+
+ /* status flags used with conversion from GPS time to local time */
+
+# define TM_UTC 0x01 /* UTC correction has been made */
+# define TM_LOCAL 0x02 /* UTC has been converted to local time */
+# define TM_DL_ANN 0x04 /* state of daylight saving is going to change */
+# define TM_DL_ENB 0x08 /* daylight saving is enabled */
+# define TM_LS_ANN 0x10 /* leap second will be inserted */
+# define TM_LS_ENB 0x20 /* current second is leap second */
+
+# define GPS166_TM_DEFINED
+#endif
+
+
+/* the status flags below are defined starting with rev. 1.32 */
+
+#define TM_ANT_DISCONN 0x1000 /* antenna currently disconnected */
+#define TM_SYN_FLAG 0x2000 /* TIME_SYN output is low */
+#define TM_NO_SYNC 0x4000 /* not sync'ed after reset */
+#define TM_NO_POS 0x8000 /* position not computed after reset, */
+ /* LOCK LED off */
+
+/* a struct used to transmit information on date and time */
+
+typedef struct {
+ short channel; /* -1: the current time; 0, 1: capture 0, 1 */
+ T_GPS t; /* time in GPS format */
+ TM tm; /* that time converted to local time */
+} TTM;
+
+
+
+/* Two types of variables used to store a position. Type XYZ is */
+/* used with a position in earth centered, earth fixed (ECEF) */
+/* coordinates whereas type LLA holds such a position converted */
+/* to geographic coordinates as defined by WGS84 (World Geodetic */
+/* System from 1984). */
+
+#ifndef _XYZ_DEFINED
+ /* sequence and number of components of a cartesian position */
+ enum { XP, YP, ZP, N_XYZ };
+
+ /* a type of array holding a cartesian position */
+ typedef l_fp XYZ[N_XYZ]; /* values are in [m] */
+
+# define _XYZ_DEFINED
+#endif
+
+
+#ifndef _LLA_DEFINED
+ /* sequence and number of components of a geographic position */
+ enum { LAT, LON, ALT, N_LLA }; /* latitude, longitude, altitude */
+
+ /* a type of array holding a geographic position */
+ typedef l_fp LLA[N_LLA]; /* lon, lat in [rad], alt in [m] */
+
+# define _LLA_DEFINED
+#endif
+
+/* Synthesizer parameters. Synthesizer frequency is expressed as a */
+/* four digit decimal number (freq) to be multiplied by 0.1 Hz and an */
+/* base 10 exponent (range). If the effective frequency is less than */
+/* 10 kHz its phase is synchronized corresponding to the variable phase. */
+/* Phase may be in a range from -360° to +360° with a resolution of 0.1°, */
+/* so the resulting numbers to be stored are in a range of -3600 to +3600. */
+
+/* Example: */
+/* Assume the value of freq is 2345 (decimal) and the value of phase is 900. */
+/* If range == 0 the effective frequency is 234.5 Hz with a phase of +90°. */
+/* If range == 1 the synthesizer will generate a 2345 Hz output frequency */
+/* and so on. */
+
+/* Limitations: */
+/* If freq == 0 the synthesizer is disabled. If range == 0 the least */
+/* significant digit of freq is limited to 0, 3, 5 or 6. The resulting */
+/* frequency is shown in the examples below: */
+/* freq == 1230 --> 123.0 Hz */
+/* freq == 1233 --> 123 1/3 Hz (real 1/3 Hz, NOT 123.3 Hz) */
+/* freq == 1235 --> 123.5 Hz */
+/* freq == 1236 --> 123 2/3 Hz (real 2/3 Hz, NOT 123.6 Hz) */
+
+/* If range == MAX_RANGE the value of freq must not exceed 1200, so the */
+/* output frequency is limited to 12 MHz. */
+
+/* Phase will be ignored if the resulting frequency is greater or equal */
+/* to 10 kHz. */
+
+#define MAX_SYNTH_FREQ 1200 /* if range == MAX_SYNTH_RANGE */
+#define MIN_SYNTH_RANGE 0
+#define MAX_SYNTH_RANGE 5
+#define MAX_SYNTH_PHASE 3600
+
+typedef struct {
+ short freq; /* four digits used; scale: 0.1; e.g. 1234 -> 123.4 Hz */
+ short range; /* scale factor for freq; 0..MAX_SYNTH_RANGE */
+ short phase; /* -MAX_SYNTH_PHASE..+MAX_SYNTH_PHASE; >0 -> pulses later */
+} SYNTH;
+
+
+
+/* Time zone/daylight saving parameters. */
+
+/* the name of a time zone, 5 characters plus trailing zero */
+typedef char TZ_NAME[6];
+
+typedef struct {
+ long offs; /* offset from UTC to local time [sec] */
+ long offs_dl; /* additional offset if daylight saving enabled [sec] */
+ TM tm_on; /* date/time when daylight saving starts */
+ TM tm_off; /* date/time when daylight saving ends */
+ TZ_NAME name[2]; /* names without and with daylight saving enabled */
+} TZDL;
+
+/* The constant below is defined beginning with software rev. 1.29. */
+/* If the year in tzdl.tmon and tzdl.tm_off is or'ed with that constant, */
+/* the receiver automatically generates daylight saving year by year. */
+/* See GPSLIB.TXT for more information. */
+
+#define DL_AUTO_FLAG 0x8000
+
+/* Example: */
+/* for automatic daylight saving enable/disable in Central Europe, */
+/* the variables are to be set as shown below: */
+/* offs = 3600L one hour from UTC */
+/* offs_dl = 3600L one additional hour if daylight saving enabled */
+/* tm_on = first Sunday from March 25, 02:00:00h ( year |= DL_AUTO_FLAG ) */
+/* tm_off = first Sunday from Sept 24, 03:00:00h ( year |= DL_AUTO_FLAG ) */
+/* name[0] == "MEZ " name if daylight saving not enabled */
+/* name[1] == "MESZ " name if daylight saving is enabled */
+
+
+
+
+/* the structure below was defined in rev. 1.31. It reflects the status */
+/* of the antenna, the times of last disconnect/reconnect and the boards */
+/* clock offset after the phase of disconnection. */
+
+typedef struct {
+ short status; /* current status of antenna */
+ TM tm_disconn; /* time of antenna disconnect */
+ TM tm_reconn; /* time of antenna reconnect */
+ long delta_t; /* clock offset at reconnect time, units: TICKS_PER_SEC */
+} ANT_INFO;
+
+
+/* the status field may be set to one of the values below: */
+
+enum {
+ ANT_INVALID, /* struct not set yet because ant. has not been disconn. */
+ ANT_DISCONN, /* ant. now disconn., tm_reconn and delta_t not set */
+ ANT_RECONN /* ant. has been disconn. and reconn., all fields valid */
+};
+
+
+/* Summary of configuration and health data of all SVs. */
+
+typedef struct {
+ CSUM csum; /* checksum of the remaining bytes */
+ short valid; /* flag data are valid */
+
+ T_GPS tot_51; /* time of transmission, page 51 */
+ T_GPS tot_63; /* time of transmission, page 63 */
+ T_GPS t0a; /* complete reference time almanac */
+
+ CFG cfg[N_SVNO]; /* SV configuration from page 63 */
+ HEALTH health[N_SVNO]; /* SV health from pages 51, 63 */
+} CFGH;
+
+
+
+/* UTC correction parameters */
+
+typedef struct {
+ CSUM csum; /* checksum of the remaining bytes */
+ short valid; /* flag data are valid */
+
+ T_GPS t0t; /* Reference Time UTC Parameters [sec] */
+ l_fp A0; /* ± Clock Correction Coefficient 0 [sec] */
+ l_fp A1; /* ± Clock Correction Coefficient 1 [sec/sec] */
+
+ u_short WNlsf; /* week number of nearest leap second */
+ short DNt; /* the day number at the end of which LS is inserted */
+ char delta_tls; /* */
+ char delta_tlsf; /* */
+
+} UTC;
+
+/* a struct used to hold the settings of a serial port */
+
+#ifndef _COM_PARM_DEFINED
+ typedef long BAUD_RATE;
+
+ /* indices used to identify a parameter in the framing string */
+ enum { F_DBITS, F_PRTY, F_STBITS };
+
+ /* types of handshake */
+ enum { HS_NONE, HS_XONXOFF, HS_RTSCTS };
+
+ typedef struct {
+ BAUD_RATE baud_rate; /* e.g. 19200L */
+ char framing[4]; /* e.g. "8N1" */
+ short handshake; /* a numeric value, only HS_NONE supported yet */
+ } COM_PARM;
+
+#define _COM_PARM_DEFINED
+#endif
+
+
+
+/* the codes below define what has to comes out of the serial ports */
+
+enum { STR_ON_REQ, STR_PER_SEC,
+ STR_PER_MIN, N_STR_MODE_0, /* COM0 and COM1 */
+ STR_UCAP = N_STR_MODE_0,
+ STR_UCAP_REQ, N_STR_MODE_1 /* COM1 only */
+ };
+
+
+#define N_COM 2 /* the number of serial ports */
+
+/* the structure used to store the modes of both serial ports */
+
+typedef struct {
+ COM_PARM com[N_COM]; /* COM0 and COM1 settings */
+ u_char mode[N_COM]; /* COM0 and COM1 output mode */
+} PORT_PARM;
+
+/* Ephemeris parameters of one specific SV. Needed to compute the position */
+/* of a satellite at a given time with high precision. Valid for an */
+/* interval of 4 to 6 hours from start of transmission. */
+
+typedef struct {
+ CSUM csum; /* checksum of the remaining bytes */
+ short valid; /* flag data are valid */
+
+ HEALTH health; /* health indication of transmitting SV [---] */
+ IOD IODC; /* Issue Of Data, Clock */
+ IOD IODE2; /* Issue of Data, Ephemeris (Subframe 2) */
+ IOD IODE3; /* Issue of Data, Ephemeris (Subframe 3) */
+ T_GPS tt; /* time of transmission */
+ T_GPS t0c; /* Reference Time Clock [---] */
+ T_GPS t0e; /* Reference Time Ephemeris [---] */
+
+ l_fp sqrt_A; /* Square Root of semi-major Axis [sqrt(m)] */
+ l_fp e; /* Eccentricity [---] */
+ l_fp M0; /* ± Mean Anomaly at Ref. Time [rad] */
+ l_fp omega; /* ± Argument of Perigee [rad] */
+ l_fp OMEGA0; /* ± Longit. of Asc. Node of orbit plane [rad] */
+ l_fp OMEGADOT; /* ± Rate of Right Ascension [rad/sec] */
+ l_fp deltan; /* ± Mean Motion Diff. from computed value [rad/sec] */
+ l_fp i0; /* ± Inclination Angle [rad] */
+ l_fp idot; /* ± Rate of Inclination Angle [rad/sec] */
+ l_fp crc; /* ± Cosine Corr. Term to Orbit Radius [m] */
+ l_fp crs; /* ± Sine Corr. Term to Orbit Radius [m] */
+ l_fp cuc; /* ± Cosine Corr. Term to Arg. of Latitude [rad] */
+ l_fp cus; /* ± Sine Corr. Term to Arg. of Latitude [rad] */
+ l_fp cic; /* ± Cosine Corr. Term to Inclination Angle [rad] */
+ l_fp cis; /* ± Sine Corr. Term to Inclination Angle [rad] */
+
+ l_fp af0; /* ± Clock Correction Coefficient 0 [sec] */
+ l_fp af1; /* ± Clock Correction Coefficient 1 [sec/sec] */
+ l_fp af2; /* ± Clock Correction Coefficient 2 [sec/sec²] */
+ l_fp tgd; /* ± estimated group delay differential [sec] */
+
+ u_short URA; /* predicted User Range Accuracy */
+
+ u_char L2code; /* code on L2 channel [---] */
+ u_char L2flag; /* L2 P data flag [---] */
+
+} EPH;
+
+/* Almanac parameters of one specific SV. A reduced precision set of */
+/* parameters used to check if a satellite is in view at a given time. */
+/* Valid for an interval of more than 7 days from start of transmission. */
+
+typedef struct {
+ CSUM csum; /* checksum of the remaining bytes */
+ short valid; /* flag data are valid */
+
+ HEALTH health; /* [---] */
+ T_GPS t0a; /* Reference Time Almanac [sec] */
+
+ l_fp sqrt_A; /* Square Root of semi-major Axis [sqrt(m)] */
+ l_fp e; /* Eccentricity [---] */
+
+ l_fp M0; /* ± Mean Anomaly at Ref. Time [rad] */
+ l_fp omega; /* ± Argument of Perigee [rad] */
+ l_fp OMEGA0; /* ± Longit. of Asc. Node of orbit plane [rad] */
+ l_fp OMEGADOT; /* ± Rate of Right Ascension [rad/sec] */
+ l_fp deltai; /* ± [rad] */
+ l_fp af0; /* ± Clock Correction Coefficient 0 [sec] */
+ l_fp af1; /* ± Clock Correction Coefficient 1 [sec/sec] */
+} ALM;
+
+
+/* ionospheric correction parameters */
+
+typedef struct {
+ CSUM csum; /* checksum of the remaining bytes */
+ short valid; /* flag data are valid */
+
+ l_fp alpha_0; /* Ionosph. Corr. Coeff. Alpha 0 [sec] */
+ l_fp alpha_1; /* Ionosph. Corr. Coeff. Alpha 1 [sec/deg] */
+ l_fp alpha_2; /* Ionosph. Corr. Coeff. Alpha 2 [sec/deg^2] */
+ l_fp alpha_3; /* Ionosph. Corr. Coeff. Alpha 3 [sec/deg^3] */
+
+ l_fp beta_0; /* Ionosph. Corr. Coeff. Beta 0 [sec] */
+ l_fp beta_1; /* Ionosph. Corr. Coeff. Beta 1 [sec/deg] */
+ l_fp beta_2; /* Ionosph. Corr. Coeff. Beta 2 [sec/deg^2] */
+ l_fp beta_3; /* Ionosph. Corr. Coeff. Beta 3 [sec/deg^3] */
+
+} IONO;
+
+void mbg_tm_str (char **, TM *, int);
+void mbg_tgps_str (char **, T_GPS *, int);
+void get_mbg_header (unsigned char **, GPS_MSG_HDR *);
+void put_mbg_header (unsigned char **, GPS_MSG_HDR *);
+void get_mbg_sw_rev (unsigned char **, SW_REV *);
+void get_mbg_ascii_msg (unsigned char **, ASCII_MSG *);
+void get_mbg_svno (unsigned char **, SVNO *);
+void get_mbg_health (unsigned char **, HEALTH *);
+void get_mbg_cfg (unsigned char **, CFG *);
+void get_mbg_tgps (unsigned char **, T_GPS *);
+void get_mbg_tm (unsigned char **, TM *);
+void get_mbg_ttm (unsigned char **, TTM *);
+void get_mbg_synth (unsigned char **, SYNTH *);
+void get_mbg_tzdl (unsigned char **, TZDL *);
+void get_mbg_antinfo (unsigned char **, ANT_INFO *);
+void get_mbg_cfgh (unsigned char **, CFGH *);
+void get_mbg_utc (unsigned char **, UTC *);
+void get_mbg_lla (unsigned char **, LLA);
+void get_mbg_xyz (unsigned char **, XYZ);
+void get_mbg_portparam (unsigned char **, PORT_PARM *);
+void get_mbg_eph (unsigned char **, EPH *);
+void get_mbg_alm (unsigned char **, ALM *);
+void get_mbg_iono (unsigned char **, IONO *);
+
+unsigned long mbg_csum (unsigned char *, unsigned int);
+
+#endif
+/*
+ * History:
+ *
+ * mbg_gps166.h,v
+ * Revision 4.7 2006/06/22 18:41:43 kardel
+ * clean up signedness (gcc 4)
+ *
+ * Revision 4.6 2005/10/07 22:11:56 kardel
+ * bounded buffer implementation
+ *
+ * Revision 4.5.2.1 2005/09/25 10:23:48 kardel
+ * support bounded buffers
+ *
+ * Revision 4.5 2005/06/25 10:58:45 kardel
+ * add missing log keywords
+ *
+ * Revision 4.1 1998/06/12 15:07:30 kardel
+ * fixed prototyping
+ *
+ * Revision 4.0 1998/04/10 19:50:42 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.1 1998/04/10 19:27:34 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ *
+ * Revision 1.1 1997/10/06 20:55:38 kardel
+ * new parse structure
+ *
+ */
diff --git a/include/mx4200.h b/include/mx4200.h
new file mode 100644
index 0000000..6ea2c60
--- /dev/null
+++ b/include/mx4200.h
@@ -0,0 +1,40 @@
+
+/* records transmitted from extern CDU to MX 4200 */
+#define PMVXG_S_INITMODEA 0 /* initialization/mode part A */
+#define PMVXG_S_INITMODEB 1 /* initialization/mode part B*/
+#define PMVXG_S_SATHEALTH 2 /* satellite health control */
+#define PMVXG_S_DIFFNAV 3 /* differential navigation control */
+#define PMVXG_S_PORTCONF 7 /* control port configuration */
+#define PMVXG_S_GETSELFTEST 13 /* self test (request results) */
+#define PMVXG_S_RTCMCONF 16 /* RTCM port configuration */
+#define PMVXG_S_PASSTHRU 17 /* equipment port pass-thru config */
+#define PMVXG_S_RESTART 18 /* restart control */
+#define PMVXG_S_OSCPARAM 19 /* oscillator parameter */
+#define PMVXG_S_DOSELFTEST 20 /* self test (activate a test) */
+#define PMVXG_S_TRECOVCONF 23 /* time recovery configuration */
+#define PMVXG_S_RAWDATASEL 24 /* raw data port data selection */
+#define PMVXG_S_EQUIPCONF 26 /* equipment port configuration */
+#define PMVXG_S_RAWDATACONF 27 /* raw data port configuration */
+
+/* records transmitted from MX 4200 to external CDU */
+#define PMVXG_D_STATUS 0 /* status */
+#define PMVXG_D_POSITION 1 /* position */
+#define PMVXG_D_OPDOPS 3 /* (optimum) DOPs */
+#define PMVXG_D_MODEDATA 4 /* mode data */
+#define PMVXG_D_SATPRED 5 /* satellite predictions */
+#define PMVXG_D_SATHEALTH 6 /* satellite health status */
+#define PMVXG_D_UNRECOG 7 /* unrecognized request response */
+#define PMVXG_D_SIGSTRLOC 8 /* sig strength & location (sats 1-4) */
+#define PMVXG_D_SPEEDHEAD 11 /* speed/heading data */
+#define PMVXG_D_OSELFTEST 12 /* (old) self-test results */
+#define PMVXG_D_SIGSTRLOC2 18 /* sig strength & location (sats 5-8) */
+#define PMVXG_D_OSCPARAM 19 /* oscillator parameter */
+#define PMVXG_D_SELFTEST 20 /* self test results */
+#define PMVXG_D_PHV 21 /* position, height & velocity */
+#define PMVXG_D_DOPS 22 /* DOPs */
+#define PMVXG_D_SOFTCONF 30 /* software configuration */
+#define PMVXG_D_DIFFGPSMODE 503 /* differential gps moding */
+#define PMVXG_D_TRECOVUSEAGE 523 /* time recovery usage */
+#define PMVXG_D_RAWDATAOUT 524 /* raw data port data output */
+#define PMVXG_D_TRECOVRESULT 828 /* time recovery results */
+#define PMVXG_D_TRECOVOUT 830 /* time recovery output message */
diff --git a/include/ntif.h b/include/ntif.h
new file mode 100644
index 0000000..8377852
--- /dev/null
+++ b/include/ntif.h
@@ -0,0 +1,98 @@
+/* this is a hacked version of if.h from unix to contain the stuff we need only to build named (bind) with
+ the minimal amount of changes... by l. kahn */
+
+ /*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef _NET_IF_H
+#define _NET_IF_H
+
+
+/* #pragma ident "@(#)if.h 1.3 93/06/30 SMI"
+/* if.h 1.26 90/05/29 SMI; from UCB 7.1 6/4/86 */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Structures defining a network interface, providing a packet
+ * transport mechanism (ala level 0 of the PUP protocols).
+ *
+ * Each interface accepts output datagrams of a specified maximum
+ * length, and provides higher level routines with input datagrams
+ * received from its medium.
+ *
+ * Output occurs when the routine if_output is called, with three parameters:
+ * (*ifp->if_output)(ifp, m, dst)
+ * Here m is the mbuf chain to be sent and dst is the destination address.
+ * The output routine encapsulates the supplied datagram if necessary,
+ * and then transmits it on its medium.
+ *
+ * On input, each interface unwraps the data received by it, and either
+ * places it on the input queue of a internetwork datagram routine
+ * and posts the associated software interrupt, or passes the datagram to a raw
+ * packet input routine.
+ *
+ * Routines exist for locating interfaces by their addresses
+ * or for locating a interface on a certain network, as well as more general
+ * routing and gateway routines maintaining information used to locate
+ * interfaces. These routines live in the files if.c and route.c
+ */
+
+/*
+ * Structure defining a queue for a network interface.
+ *
+ * (Would like to call this struct ``if'', but C isn't PL/1.)
+ */
+/*
+ * Interface request structure used for socket
+ * ioctl's. All interface ioctl's must have parameter
+ * definitions which begin with ifr_name. The
+ * remainder may be interface specific.
+ */
+#ifdef FD_SETSIZE
+#undef FD_SETSIZE
+#endif
+#define FD_SETSIZE 512
+#include <winsock.h>
+typedef char *caddr_t;
+
+int get_winnt_interfaces();
+
+struct ifreq {
+#define IFNAMSIZ 16
+ char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ struct sockaddr ifru_addr;
+ char nt_mask[IFNAMSIZ]; /* new field to store mask returned from nt lookup l. kahn */
+
+#define ifr_addr ifru_addr /* address */
+#define ifr_mask nt_mask /* nt mask in character form */
+
+};
+
+/*
+ * Structure used in SIOCGIFCONF request.
+ * Used to retrieve interface configuration
+ * for machine (useful for programs which
+ * must know all networks accessible).
+ */
+struct ifconf {
+ int ifc_len; /* size of associated buffer */
+ union {
+ caddr_t ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
+#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _NET_IF_H */
+
diff --git a/include/ntp.h b/include/ntp.h
new file mode 100644
index 0000000..38343f2
--- /dev/null
+++ b/include/ntp.h
@@ -0,0 +1,895 @@
+/*
+ * ntp.h - NTP definitions for the masses
+ */
+#ifndef NTP_H
+#define NTP_H
+
+#include <stddef.h>
+#include <math.h>
+
+#include <ntp_fp.h>
+#include <ntp_types.h>
+#include <ntp_lists.h>
+#include <ntp_stdlib.h>
+#include <ntp_crypto.h>
+#include <ntp_random.h>
+#include <ntp_net.h>
+
+#include <isc/boolean.h>
+
+/*
+ * Calendar arithmetic - contributed by G. Healton
+ */
+#define YEAR_BREAK 500 /* years < this are tm_year values:
+ * Break < AnyFourDigitYear && Break >
+ * Anytm_yearYear */
+
+#define YEAR_PIVOT 98 /* 97/98: years < this are year 2000+
+ * FYI: official UNIX pivot year is
+ * 68/69 */
+
+/*
+ * Number of Days since 1 BC Gregorian to 1 January of given year
+ */
+#define julian0(year) (((year) * 365 ) + ((year) > 0 ? (((year) + 3) \
+ / 4 - ((year - 1) / 100) + ((year - 1) / \
+ 400)) : 0))
+
+/*
+ * Number of days since start of NTP time to 1 January of given year
+ */
+#define ntp0(year) (julian0(year) - julian0(1900))
+
+/*
+ * Number of days since start of UNIX time to 1 January of given year
+ */
+#define unix0(year) (julian0(year) - julian0(1970))
+
+/*
+ * LEAP YEAR test for full 4-digit years (e.g, 1999, 2010)
+ */
+#define isleap_4(y) ((y) % 4 == 0 && !((y) % 100 == 0 && !(y % \
+ 400 == 0)))
+
+/*
+ * LEAP YEAR test for tm_year (struct tm) years (e.g, 99, 110)
+ */
+#define isleap_tm(y) ((y) % 4 == 0 && !((y) % 100 == 0 && !(((y) \
+ + 1900) % 400 == 0)))
+
+/*
+ * to convert simple two-digit years to tm_year style years:
+ *
+ * if (year < YEAR_PIVOT)
+ * year += 100;
+ *
+ * to convert either two-digit OR tm_year years to four-digit years:
+ *
+ * if (year < YEAR_PIVOT)
+ * year += 100;
+ *
+ * if (year < YEAR_BREAK)
+ * year += 1900;
+ */
+
+/*
+ * How to get signed characters. On machines where signed char works,
+ * use it. On machines where signed char doesn't work, char had better
+ * be signed.
+ */
+#ifdef NEED_S_CHAR_TYPEDEF
+# if SIZEOF_SIGNED_CHAR
+typedef signed char s_char;
+# else
+typedef char s_char;
+# endif
+ /* XXX: Why is this sequent bit INSIDE this test? */
+# ifdef sequent
+# undef SO_RCVBUF
+# undef SO_SNDBUF
+# endif
+#endif
+
+/*
+ * NTP protocol parameters. See section 3.2.6 of the specification.
+ */
+#define NTP_VERSION ((u_char)4) /* current version number */
+#define NTP_OLDVERSION ((u_char)1) /* oldest credible version */
+#define NTP_PORT 123 /* included for non-unix machines */
+
+/*
+ * Poll interval parameters
+ */
+#define NTP_UNREACH 10 /* poll unreach threshold */
+#define NTP_MINPOLL 3 /* log2 min poll interval (8 s) */
+#define NTP_MINDPOLL 6 /* log2 default min poll (64 s) */
+#define NTP_MAXDPOLL 10 /* log2 default max poll (~17 m) */
+#define NTP_MAXPOLL 17 /* log2 max poll interval (~36 h) */
+#define NTP_RETRY 3 /* max packet retries */
+#define NTP_MINPKT 2 /* guard time (s) */
+
+/*
+ * Clock filter algorithm tuning parameters
+ */
+#define MAXDISPERSE 16. /* max dispersion */
+#define NTP_SHIFT 8 /* clock filter stages */
+#define NTP_FWEIGHT .5 /* clock filter weight */
+
+/*
+ * Selection algorithm tuning parameters
+ */
+#define NTP_MINCLOCK 3 /* min survivors */
+#define NTP_MAXCLOCK 10 /* max candidates */
+#define MINDISPERSE .001 /* min distance */
+#define MAXDISTANCE 1.5 /* max root distance (select threshold) */
+#define CLOCK_SGATE 3. /* popcorn spike gate */
+#define HUFFPUFF 900 /* huff-n'-puff sample interval (s) */
+#define MAXHOP 2 /* anti-clockhop threshold */
+#define MAX_TTL 8 /* max ttl mapping vector size */
+#define BEACON 7200 /* manycast beacon interval */
+#define NTP_MAXEXTEN 2048 /* max extension field size */
+#define NTP_ORPHWAIT 300 /* orphan wair (s) */
+
+/*
+ * Miscellaneous stuff
+ */
+#define NTP_MAXKEY 65535 /* max authentication key number */
+#define KEY_TYPE_MD5 NID_md5 /* MD5 digest NID */
+/*
+ * Limits of things
+ */
+#define MAXFILENAME 256 /* max length of file name */
+#define MAXHOSTNAME 512 /* max length of host/node name */
+#define NTP_MAXSTRLEN 256 /* max string length */
+
+/*
+ * Operations for jitter calculations (these use doubles).
+ *
+ * Note that we carefully separate the jitter component from the
+ * dispersion component (frequency error plus precision). The frequency
+ * error component is computed as CLOCK_PHI times the difference between
+ * the epoch of the time measurement and the reference time. The
+ * precision component is computed as the square root of the mean of the
+ * squares of a zero-mean, uniform distribution of unit maximum
+ * amplitude. Whether this makes statistical sense may be arguable.
+ */
+#define SQUARE(x) ((x) * (x))
+#define SQRT(x) (sqrt(x))
+#define DIFF(x, y) (SQUARE((x) - (y)))
+#define LOGTOD(a) ldexp(1., (int)(a)) /* log2 to double */
+#define UNIVAR(x) (SQUARE(.28867513 * LOGTOD(x))) /* std uniform distr */
+#define ULOGTOD(a) ldexp(1., (int)(a)) /* ulog2 to double */
+
+#define EVENT_TIMEOUT 0 /* one second, that is */
+
+
+/*
+ * The interface structure is used to hold the addresses and socket
+ * numbers of each of the local network addresses we are using.
+ * Because "interface" is a reserved word in C++ and has so many
+ * varied meanings, a change to "endpt" (via typedef) is under way.
+ * Eventually the struct tag will change from interface to endpt_tag.
+ * endpt is unrelated to the select algorithm's struct endpoint.
+ */
+typedef struct interface endpt;
+struct interface {
+ endpt * elink; /* endpt list link */
+ endpt * mclink; /* per-AF_* multicast list */
+ SOCKET fd; /* socket descriptor */
+ SOCKET bfd; /* for receiving broadcasts */
+ u_int32 ifnum; /* endpt instance count */
+ sockaddr_u sin; /* unicast address */
+ sockaddr_u mask; /* subnet mask */
+ sockaddr_u bcast; /* broadcast address */
+ char name[32]; /* name of interface */
+ u_short family; /* AF_INET/AF_INET6 */
+ u_short phase; /* phase in update cycle */
+ u_int32 flags; /* interface flags */
+ int last_ttl; /* last TTL specified */
+ u_int32 addr_refid; /* IPv4 addr or IPv6 hash */
+ int num_mcast; /* mcast addrs enabled */
+ u_long starttime; /* current_time at creation */
+ volatile long received; /* number of incoming packets */
+ long sent; /* number of outgoing packets */
+ long notsent; /* number of send failures */
+ u_int ifindex; /* for IPV6_MULTICAST_IF */
+ isc_boolean_t ignore_packets; /* listen-read-drop this? */
+ struct peer * peers; /* list of peers using endpt */
+ u_int peercnt; /* count of same */
+};
+
+/*
+ * Flags for interfaces
+ */
+#define INT_UP 0x001 /* Interface is up */
+#define INT_PPP 0x002 /* Point-to-point interface */
+#define INT_LOOPBACK 0x004 /* the loopback interface */
+#define INT_BROADCAST 0x008 /* can broadcast out this interface */
+#define INT_MULTICAST 0x010 /* can multicast out this interface */
+#define INT_BCASTOPEN 0x020 /* broadcast receive socket is open */
+#define INT_MCASTOPEN 0x040 /* multicasting enabled */
+#define INT_WILDCARD 0x080 /* wildcard interface - usually skipped */
+#define INT_MCASTIF 0x100 /* bound directly to MCAST address */
+#define INT_PRIVACY 0x200 /* RFC 4941 IPv6 privacy address */
+#define INT_BCASTXMIT 0x400 /* socket setup to allow broadcasts */
+
+/*
+ * Define flasher bits (tests 1 through 11 in packet procedure)
+ * These reveal the state at the last grumble from the peer and are
+ * most handy for diagnosing problems, even if not strictly a state
+ * variable in the spec. These are recorded in the peer structure.
+ *
+ * Packet errors
+ */
+#define TEST1 0X0001 /* duplicate packet */
+#define TEST2 0x0002 /* bogus packet */
+#define TEST3 0x0004 /* protocol unsynchronized */
+#define TEST4 0x0008 /* access denied */
+#define TEST5 0x0010 /* bad authentication */
+#define TEST6 0x0020 /* bad synch or stratum */
+#define TEST7 0x0040 /* bad header */
+#define TEST8 0x0080 /* bad autokey */
+#define TEST9 0x0100 /* bad crypto */
+#define PKT_TEST_MASK (TEST1 | TEST2 | TEST3 | TEST4 | TEST5 |\
+ TEST6 | TEST7 | TEST8 | TEST9)
+/*
+ * Peer errors
+ */
+#define TEST10 0x0200 /* peer bad synch or stratum */
+#define TEST11 0x0400 /* peer distance exceeded */
+#define TEST12 0x0800 /* peer synchronization loop */
+#define TEST13 0x1000 /* peer unreacable */
+#define PEER_TEST_MASK (TEST10 | TEST11 | TEST12 | TEST13)
+
+/*
+ * The peer structure. Holds state information relating to the guys
+ * we are peering with. Most of this stuff is from section 3.2 of the
+ * spec.
+ */
+struct peer {
+ struct peer *p_link; /* link pointer in free & peer lists */
+ struct peer *adr_link; /* link pointer in address hash */
+ struct peer *aid_link; /* link pointer in associd hash */
+ struct peer *ilink; /* list of peers for interface */
+ sockaddr_u srcadr; /* address of remote host */
+ char * hostname; /* if non-NULL, remote name */
+ struct addrinfo *addrs; /* hostname query result */
+ struct addrinfo *ai; /* position within addrs */
+ endpt * dstadr; /* local address */
+ associd_t associd; /* association ID */
+ u_char version; /* version number */
+ u_char hmode; /* local association mode */
+ u_char hpoll; /* local poll interval */
+ u_char minpoll; /* min poll interval */
+ u_char maxpoll; /* max poll interval */
+ u_int flags; /* association flags */
+ u_char cast_flags; /* additional flags */
+ u_char last_event; /* last peer error code */
+ u_char num_events; /* number of error events */
+ u_int32 ttl; /* ttl/refclock mode */
+ char *ident; /* group identifier name */
+
+ /*
+ * Variables used by reference clock support
+ */
+#ifdef REFCLOCK
+ struct refclockproc *procptr; /* refclock structure pointer */
+ u_char refclktype; /* reference clock type */
+ u_char refclkunit; /* reference clock unit number */
+ u_char sstclktype; /* clock type for system status word */
+#endif /* REFCLOCK */
+
+ /*
+ * Variables set by received packet
+ */
+ u_char leap; /* local leap indicator */
+ u_char pmode; /* remote association mode */
+ u_char stratum; /* remote stratum */
+ u_char ppoll; /* remote poll interval */
+ s_char precision; /* remote clock precision */
+ double rootdelay; /* roundtrip delay to primary source */
+ double rootdisp; /* dispersion to primary source */
+ u_int32 refid; /* remote reference ID */
+ l_fp reftime; /* update epoch */
+
+ /*
+ * Variables used by authenticated client
+ */
+ keyid_t keyid; /* current key ID */
+#ifdef AUTOKEY
+#define clear_to_zero opcode
+ u_int32 opcode; /* last request opcode */
+ associd_t assoc; /* peer association ID */
+ u_int32 crypto; /* peer status word */
+ EVP_PKEY *pkey; /* public key */
+ const EVP_MD *digest; /* message digest algorithm */
+ char *subject; /* certificate subject name */
+ char *issuer; /* certificate issuer name */
+ struct cert_info *xinfo; /* issuer certificate */
+ keyid_t pkeyid; /* previous key ID */
+ keyid_t hcookie; /* host cookie */
+ keyid_t pcookie; /* peer cookie */
+ const struct pkey_info *ident_pkey; /* identity key */
+ BIGNUM *iffval; /* identity challenge (IFF, GQ, MV) */
+ const BIGNUM *grpkey; /* identity challenge key (GQ) */
+ struct value cookval; /* receive cookie values */
+ struct value recval; /* receive autokey values */
+ struct exten *cmmd; /* extension pointer */
+ u_long refresh; /* next refresh epoch */
+
+ /*
+ * Variables used by authenticated server
+ */
+ keyid_t *keylist; /* session key ID list */
+ int keynumber; /* current key number */
+ struct value encrypt; /* send encrypt values */
+ struct value sndval; /* send autokey values */
+#else /* !AUTOKEY follows */
+#define clear_to_zero status
+#endif /* !AUTOKEY */
+
+ /*
+ * Ephemeral state variables
+ */
+ u_char status; /* peer status */
+ u_char new_status; /* under-construction status */
+ u_char reach; /* reachability register */
+ int flash; /* protocol error test tally bits */
+ u_long epoch; /* reference epoch */
+ int burst; /* packets remaining in burst */
+ int retry; /* retry counter */
+ int flip; /* interleave mode control */
+ int filter_nextpt; /* index into filter shift register */
+ double filter_delay[NTP_SHIFT]; /* delay shift register */
+ double filter_offset[NTP_SHIFT]; /* offset shift register */
+ double filter_disp[NTP_SHIFT]; /* dispersion shift register */
+ u_long filter_epoch[NTP_SHIFT]; /* epoch shift register */
+ u_char filter_order[NTP_SHIFT]; /* filter sort index */
+ l_fp rec; /* receive time stamp */
+ l_fp xmt; /* transmit time stamp */
+ l_fp dst; /* destination timestamp */
+ l_fp aorg; /* origin timestamp */
+ l_fp borg; /* alternate origin timestamp */
+ double offset; /* peer clock offset */
+ double delay; /* peer roundtrip delay */
+ double jitter; /* peer jitter (squares) */
+ double disp; /* peer dispersion */
+ double xleave; /* interleave delay */
+ double bias; /* programmed offset bias */
+
+ /*
+ * Variables used to correct for packet length and asymmetry.
+ */
+ double t21; /* outbound packet delay */
+ int t21_bytes; /* outbound packet length */
+ int t21_last; /* last outbound packet length */
+ double r21; /* outbound data rate */
+ double t34; /* inbound packet delay */
+ int t34_bytes; /* inbound packet length */
+ double r34; /* inbound data rate */
+
+ /*
+ * End of clear-to-zero area
+ */
+ u_long update; /* receive epoch */
+#define end_clear_to_zero update
+ int unreach; /* watchdog counter */
+ int throttle; /* rate control */
+ u_long outdate; /* send time last packet */
+ u_long nextdate; /* send time next packet */
+
+ /*
+ * Statistic counters
+ */
+ u_long timereset; /* time stat counters were reset */
+ u_long timereceived; /* last packet received time */
+ u_long timereachable; /* last reachable/unreachable time */
+
+ u_long sent; /* packets sent */
+ u_long received; /* packets received */
+ u_long processed; /* packets processed */
+ u_long badauth; /* bad authentication (TEST5) */
+ u_long bogusorg; /* bogus origin (TEST2, TEST3) */
+ u_long oldpkt; /* old duplicate (TEST1) */
+ u_long seldisptoolarge; /* bad header (TEST6, TEST7) */
+ u_long selbroken; /* KoD received */
+};
+
+/*
+ * Values for peer.leap, sys_leap
+ */
+#define LEAP_NOWARNING 0x0 /* normal, no leap second warning */
+#define LEAP_ADDSECOND 0x1 /* last minute of day has 61 seconds */
+#define LEAP_DELSECOND 0x2 /* last minute of day has 59 seconds */
+#define LEAP_NOTINSYNC 0x3 /* overload, clock is free running */
+
+/*
+ * Values for peer mode and packet mode. Only the modes through
+ * MODE_BROADCAST and MODE_BCLIENT appear in the transition
+ * function. MODE_CONTROL and MODE_PRIVATE can appear in packets,
+ * but those never survive to the transition function.
+ * is a
+/ */
+#define MODE_UNSPEC 0 /* unspecified (old version) */
+#define MODE_ACTIVE 1 /* symmetric active mode */
+#define MODE_PASSIVE 2 /* symmetric passive mode */
+#define MODE_CLIENT 3 /* client mode */
+#define MODE_SERVER 4 /* server mode */
+#define MODE_BROADCAST 5 /* broadcast mode */
+/*
+ * These can appear in packets
+ */
+#define MODE_CONTROL 6 /* control mode */
+#define MODE_PRIVATE 7 /* private mode */
+/*
+ * This is a madeup mode for broadcast client.
+ */
+#define MODE_BCLIENT 6 /* broadcast client mode */
+
+/*
+ * Values for peer.stratum, sys_stratum
+ */
+#define STRATUM_REFCLOCK ((u_char)0) /* default stratum */
+/* A stratum of 0 in the packet is mapped to 16 internally */
+#define STRATUM_PKT_UNSPEC ((u_char)0) /* unspecified in packet */
+#define STRATUM_UNSPEC ((u_char)16) /* unspecified */
+
+/*
+ * Values for peer.flags
+ */
+#define FLAG_CONFIG 0x0001 /* association was configured */
+#define FLAG_PREEMPT 0x0002 /* preemptable association */
+#define FLAG_AUTHENTIC 0x0004 /* last message was authentic */
+#define FLAG_REFCLOCK 0x0008 /* this is actually a reference clock */
+#define FLAG_BC_VOL 0x0010 /* broadcast client volleying */
+#define FLAG_PREFER 0x0020 /* prefer peer */
+#define FLAG_BURST 0x0040 /* burst mode */
+#define FLAG_PPS 0x0080 /* steered by PPS */
+#define FLAG_IBURST 0x0100 /* initial burst mode */
+#define FLAG_NOSELECT 0x0200 /* never select */
+#define FLAG_TRUE 0x0400 /* force truechimer */
+#define FLAG_SKEY 0x0800 /* autokey authentication */
+#define FLAG_XLEAVE 0x1000 /* interleaved protocol */
+#define FLAG_XB 0x2000 /* interleaved broadcast */
+#define FLAG_XBOGUS 0x4000 /* interleaved bogus packet */
+#ifdef OPENSSL
+#define FLAG_ASSOC 0x8000 /* autokey request */
+#endif /* OPENSSL */
+
+/*
+ * Definitions for the clear() routine. We use memset() to clear
+ * the parts of the peer structure which go to zero. These are
+ * used to calculate the start address and length of the area.
+ */
+#define CLEAR_TO_ZERO(p) ((char *)&((p)->clear_to_zero))
+#define END_CLEAR_TO_ZERO(p) ((char *)&((p)->end_clear_to_zero))
+#define LEN_CLEAR_TO_ZERO(p) (END_CLEAR_TO_ZERO(p) - CLEAR_TO_ZERO(p))
+#define CRYPTO_TO_ZERO(p) ((char *)&((p)->clear_to_zero))
+#define END_CRYPTO_TO_ZERO(p) ((char *)&((p)->end_clear_to_zero))
+#define LEN_CRYPTO_TO_ZERO (END_CRYPTO_TO_ZERO((struct peer *)0) \
+ - CRYPTO_TO_ZERO((struct peer *)0))
+
+/*
+ * Reference clock types. Added as necessary.
+ */
+#define REFCLK_NONE 0 /* unknown or missing */
+#define REFCLK_LOCALCLOCK 1 /* external (e.g., lockclock) */
+#define REFCLK_GPS_TRAK 2 /* TRAK 8810 GPS Receiver */
+#define REFCLK_WWV_PST 3 /* PST/Traconex 1020 WWV/H */
+#define REFCLK_SPECTRACOM 4 /* Spectracom (generic) Receivers */
+#define REFCLK_TRUETIME 5 /* TrueTime (generic) Receivers */
+#define REFCLK_IRIG_AUDIO 6 /* IRIG-B/W audio decoder */
+#define REFCLK_CHU_AUDIO 7 /* CHU audio demodulator/decoder */
+#define REFCLK_PARSE 8 /* generic driver (usually DCF77,GPS,MSF) */
+#define REFCLK_GPS_MX4200 9 /* Magnavox MX4200 GPS */
+#define REFCLK_GPS_AS2201 10 /* Austron 2201A GPS */
+#define REFCLK_GPS_ARBITER 11 /* Arbiter 1088A/B/ GPS */
+#define REFCLK_IRIG_TPRO 12 /* KSI/Odetics TPRO-S IRIG */
+#define REFCLK_ATOM_LEITCH 13 /* Leitch CSD 5300 Master Clock */
+#define REFCLK_MSF_EES 14 /* EES M201 MSF Receiver */
+#define REFCLK_GPSTM_TRUE 15 /* OLD TrueTime GPS/TM-TMD Receiver */
+#define REFCLK_IRIG_BANCOMM 16 /* Bancomm GPS/IRIG Interface */
+#define REFCLK_GPS_DATUM 17 /* Datum Programmable Time System */
+#define REFCLK_ACTS 18 /* Generic Auto Computer Time Service */
+#define REFCLK_WWV_HEATH 19 /* Heath GC1000 WWV/WWVH Receiver */
+#define REFCLK_GPS_NMEA 20 /* NMEA based GPS clock */
+#define REFCLK_GPS_VME 21 /* TrueTime GPS-VME Interface */
+#define REFCLK_ATOM_PPS 22 /* 1-PPS Clock Discipline */
+#define REFCLK_PTB_ACTS 23 /* replaced by REFCLK_ACTS */
+#define REFCLK_USNO 24 /* replaced by REFCLK_ACTS */
+#define REFCLK_GPS_HP 26 /* HP 58503A Time/Frequency Receiver */
+#define REFCLK_ARCRON_MSF 27 /* ARCRON MSF radio clock. */
+#define REFCLK_SHM 28 /* clock attached thru shared memory */
+#define REFCLK_PALISADE 29 /* Trimble Navigation Palisade GPS */
+#define REFCLK_ONCORE 30 /* Motorola UT Oncore GPS */
+#define REFCLK_GPS_JUPITER 31 /* Rockwell Jupiter GPS receiver */
+#define REFCLK_CHRONOLOG 32 /* Chrono-log K WWVB receiver */
+#define REFCLK_DUMBCLOCK 33 /* Dumb localtime clock */
+#define REFCLK_ULINK 34 /* Ultralink M320 WWVB receiver */
+#define REFCLK_PCF 35 /* Conrad parallel port radio clock */
+#define REFCLK_WWV_AUDIO 36 /* WWV/H audio demodulator/decoder */
+#define REFCLK_FG 37 /* Forum Graphic GPS */
+#define REFCLK_HOPF_SERIAL 38 /* hopf DCF77/GPS serial receiver */
+#define REFCLK_HOPF_PCI 39 /* hopf DCF77/GPS PCI receiver */
+#define REFCLK_JJY 40 /* JJY receiver */
+#define REFCLK_TT560 41 /* TrueTime 560 IRIG-B decoder */
+#define REFCLK_ZYFER 42 /* Zyfer GPStarplus receiver */
+#define REFCLK_RIPENCC 43 /* RIPE NCC Trimble driver */
+#define REFCLK_NEOCLOCK4X 44 /* NeoClock4X DCF77 or TDF receiver */
+#define REFCLK_TSYNCPCI 45 /* Spectracom TSYNC PCI timing board */
+#define REFCLK_GPSDJSON 46
+#define REFCLK_MAX 46
+
+
+/*
+ * NTP packet format. The mac field is optional. It isn't really
+ * an l_fp either, but for now declaring it that way is convenient.
+ * See Appendix A in the specification.
+ *
+ * Note that all u_fp and l_fp values arrive in network byte order
+ * and must be converted (except the mac, which isn't, really).
+ */
+struct pkt {
+ u_char li_vn_mode; /* peer leap indicator */
+ u_char stratum; /* peer stratum */
+ u_char ppoll; /* peer poll interval */
+ s_char precision; /* peer clock precision */
+ u_fp rootdelay; /* roundtrip delay to primary source */
+ u_fp rootdisp; /* dispersion to primary source*/
+ u_int32 refid; /* reference id */
+ l_fp reftime; /* last update time */
+ l_fp org; /* originate time stamp */
+ l_fp rec; /* receive time stamp */
+ l_fp xmt; /* transmit time stamp */
+
+#define LEN_PKT_NOMAC (12 * sizeof(u_int32)) /* min header length */
+#define MIN_MAC_LEN (1 * sizeof(u_int32)) /* crypto_NAK */
+#define MAX_MD5_LEN (5 * sizeof(u_int32)) /* MD5 */
+#define MAX_MAC_LEN (6 * sizeof(u_int32)) /* SHA */
+
+ /*
+ * The length of the packet less MAC must be a multiple of 64
+ * with an RSA modulus and Diffie-Hellman prime of 256 octets
+ * and maximum host name of 128 octets, the maximum autokey
+ * command is 152 octets and maximum autokey response is 460
+ * octets. A packet can contain no more than one command and one
+ * response, so the maximum total extension field length is 864
+ * octets. But, to handle humungus certificates, the bank must
+ * be broke.
+ *
+ * The different definitions of the 'exten' field are here for
+ * the benefit of applications that want to send a packet from
+ * an auto variable in the stack - not using the AUTOKEY version
+ * saves 2KB of stack space. The receive buffer should ALWAYS be
+ * big enough to hold a full extended packet if the extension
+ * fields have to be parsed or skipped.
+ */
+#ifdef AUTOKEY
+ u_int32 exten[(NTP_MAXEXTEN + MAX_MAC_LEN) / sizeof(u_int32)];
+#else /* !AUTOKEY follows */
+ u_int32 exten[(MAX_MAC_LEN) / sizeof(u_int32)];
+#endif /* !AUTOKEY */
+};
+
+/*
+ * Stuff for extracting things from li_vn_mode
+ */
+#define PKT_MODE(li_vn_mode) ((u_char)((li_vn_mode) & 0x7))
+#define PKT_VERSION(li_vn_mode) ((u_char)(((li_vn_mode) >> 3) & 0x7))
+#define PKT_LEAP(li_vn_mode) ((u_char)(((li_vn_mode) >> 6) & 0x3))
+
+/*
+ * Stuff for putting things back into li_vn_mode in packets and vn_mode
+ * in ntp_monitor.c's mon_entry.
+ */
+#define VN_MODE(v, m) ((((v) & 7) << 3) | ((m) & 0x7))
+#define PKT_LI_VN_MODE(l, v, m) ((((l) & 3) << 6) | VN_MODE((v), (m)))
+
+
+/*
+ * Dealing with stratum. 0 gets mapped to 16 incoming, and back to 0
+ * on output.
+ */
+#define PKT_TO_STRATUM(s) ((u_char)(((s) == (STRATUM_PKT_UNSPEC)) ?\
+ (STRATUM_UNSPEC) : (s)))
+
+#define STRATUM_TO_PKT(s) ((u_char)(((s) == (STRATUM_UNSPEC)) ?\
+ (STRATUM_PKT_UNSPEC) : (s)))
+
+/*
+ * Event codes. Used for reporting errors/events to the control module
+ */
+#define PEER_EVENT 0x080 /* this is a peer event */
+#define CRPT_EVENT 0x100 /* this is a crypto event */
+
+/*
+ * System event codes
+ */
+#define EVNT_UNSPEC 0 /* unspecified */
+#define EVNT_NSET 1 /* freq not set */
+#define EVNT_FSET 2 /* freq set */
+#define EVNT_SPIK 3 /* spike detect */
+#define EVNT_FREQ 4 /* freq mode */
+#define EVNT_SYNC 5 /* clock sync */
+#define EVNT_SYSRESTART 6 /* restart */
+#define EVNT_SYSFAULT 7 /* panic stop */
+#define EVNT_NOPEER 8 /* no sys peer */
+#define EVNT_ARMED 9 /* leap armed */
+#define EVNT_DISARMED 10 /* leap disarmed */
+#define EVNT_LEAP 11 /* leap event */
+#define EVNT_CLOCKRESET 12 /* clock step */
+#define EVNT_KERN 13 /* kernel event */
+#define EVNT_TAI 14 /* TAI */
+#define EVNT_LEAPVAL 15 /* stale leapsecond values */
+
+/*
+ * Peer event codes
+ */
+#define PEVNT_MOBIL (1 | PEER_EVENT) /* mobilize */
+#define PEVNT_DEMOBIL (2 | PEER_EVENT) /* demobilize */
+#define PEVNT_UNREACH (3 | PEER_EVENT) /* unreachable */
+#define PEVNT_REACH (4 | PEER_EVENT) /* reachable */
+#define PEVNT_RESTART (5 | PEER_EVENT) /* restart */
+#define PEVNT_REPLY (6 | PEER_EVENT) /* no reply */
+#define PEVNT_RATE (7 | PEER_EVENT) /* rate exceeded */
+#define PEVNT_DENY (8 | PEER_EVENT) /* access denied */
+#define PEVNT_ARMED (9 | PEER_EVENT) /* leap armed */
+#define PEVNT_NEWPEER (10 | PEER_EVENT) /* sys peer */
+#define PEVNT_CLOCK (11 | PEER_EVENT) /* clock event */
+#define PEVNT_AUTH (12 | PEER_EVENT) /* bad auth */
+#define PEVNT_POPCORN (13 | PEER_EVENT) /* popcorn */
+#define PEVNT_XLEAVE (14 | PEER_EVENT) /* interleave mode */
+#define PEVNT_XERR (15 | PEER_EVENT) /* interleave error */
+
+/*
+ * Clock event codes
+ */
+#define CEVNT_NOMINAL 0 /* unspecified */
+#define CEVNT_TIMEOUT 1 /* no reply */
+#define CEVNT_BADREPLY 2 /* bad format */
+#define CEVNT_FAULT 3 /* fault */
+#define CEVNT_PROP 4 /* bad signal */
+#define CEVNT_BADDATE 5 /* bad date */
+#define CEVNT_BADTIME 6 /* bad time */
+#define CEVNT_MAX CEVNT_BADTIME
+
+/*
+ * Very misplaced value. Default port through which we send traps.
+ */
+#define TRAPPORT 18447
+
+
+/*
+ * To speed lookups, peers are hashed by the low order bits of the
+ * remote IP address. These definitions relate to that.
+ */
+#define NTP_HASH_SIZE 128
+#define NTP_HASH_MASK (NTP_HASH_SIZE-1)
+#define NTP_HASH_ADDR(src) (sock_hash(src) & NTP_HASH_MASK)
+
+/*
+ * min, min3 and max. Makes it easier to transliterate the spec without
+ * thinking about it.
+ */
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define min3(a,b,c) min(min((a),(b)), (c))
+
+
+/*
+ * Configuration items. These are for the protocol module (proto_config())
+ */
+#define PROTO_BROADCLIENT 1
+#define PROTO_PRECISION 2 /* (not used) */
+#define PROTO_AUTHENTICATE 3
+#define PROTO_BROADDELAY 4
+#define PROTO_AUTHDELAY 5 /* (not used) */
+#define PROTO_MULTICAST_ADD 6
+#define PROTO_MULTICAST_DEL 7
+#define PROTO_NTP 8
+#define PROTO_KERNEL 9
+#define PROTO_MONITOR 10
+#define PROTO_FILEGEN 11
+#define PROTO_PPS 12
+#define PROTO_CAL 13
+#define PROTO_MINCLOCK 14
+#define PROTO_MAXCLOCK 15
+#define PROTO_MINSANE 16
+#define PROTO_FLOOR 17
+#define PROTO_CEILING 18
+#define PROTO_COHORT 19
+#define PROTO_CALLDELAY 20
+#define PROTO_MINDISP 21
+#define PROTO_MAXDIST 22
+ /* available 23 */
+#define PROTO_MAXHOP 24
+#define PROTO_BEACON 25
+#define PROTO_ORPHAN 26
+#define PROTO_ORPHWAIT 27
+#define PROTO_MODE7 28
+
+/*
+ * Configuration items for the loop filter
+ */
+#define LOOP_DRIFTINIT 1 /* iniitialize frequency */
+#define LOOP_KERN_CLEAR 2 /* set initial frequency offset */
+#define LOOP_MAX 3 /* set step offset */
+#define LOOP_PANIC 4 /* set panic offseet */
+#define LOOP_PHI 5 /* set dispersion rate */
+#define LOOP_MINSTEP 6 /* set step timeout */
+#define LOOP_MINPOLL 7 /* set min poll interval (log2 s) */
+#define LOOP_ALLAN 8 /* set minimum Allan intercept */
+#define LOOP_HUFFPUFF 9 /* set huff-n'-puff filter length */
+#define LOOP_FREQ 10 /* set initial frequency */
+#define LOOP_CODEC 11 /* set audio codec frequency */
+#define LOOP_LEAP 12 /* insert leap after second 23:59 */
+#define LOOP_TICK 13 /* sim. low precision clock */
+
+/*
+ * Configuration items for the stats printer
+ */
+#define STATS_FREQ_FILE 1 /* configure drift file */
+#define STATS_STATSDIR 2 /* directory prefix for stats files */
+#define STATS_PID_FILE 3 /* configure ntpd PID file */
+#define STATS_LEAP_FILE 4 /* configure ntpd leapseconds file */
+
+#define MJD_1900 15020 /* MJD for 1 Jan 1900 */
+
+/*
+ * Default parameters. We use these in the absence of something better.
+ */
+#define INADDR_NTP 0xe0000101 /* NTP multicast address 224.0.1.1 */
+
+/*
+ * Structure used optionally for monitoring when this is turned on.
+ */
+typedef struct mon_data mon_entry;
+struct mon_data {
+ mon_entry * hash_next; /* next structure in hash list */
+ DECL_DLIST_LINK(mon_entry, mru);/* MRU list link pointers */
+ struct interface * lcladr; /* address on which this arrived */
+ l_fp first; /* first time seen */
+ l_fp last; /* last time seen */
+ int leak; /* leaky bucket accumulator */
+ int count; /* total packet count */
+ u_short flags; /* restrict flags */
+ u_char vn_mode; /* packet mode & version */
+ u_char cast_flags; /* flags MDF_?CAST */
+ sockaddr_u rmtadr; /* address of remote host */
+};
+
+/*
+ * Values for cast_flags in mon_entry and struct peer. mon_entry uses
+ * only the first three, MDF_UCAST, MDF_MCAST, and MDF_BCAST.
+ */
+#define MDF_UCAST 0x01 /* unicast client */
+#define MDF_MCAST 0x02 /* multicast server */
+#define MDF_BCAST 0x04 /* broadcast server */
+#define MDF_POOL 0x08 /* pool client solicitor */
+#define MDF_ACAST 0x10 /* manycast client solicitor */
+#define MDF_BCLNT 0x20 /* eph. broadcast/multicast client */
+#define MDF_UCLNT 0x40 /* preemptible manycast or pool client */
+/*
+ * In the context of struct peer in ntpd, three of the cast_flags bits
+ * represent configured associations which never receive packets, and
+ * whose reach is always 0: MDF_BCAST, MDF_MCAST, and MDF_ACAST. The
+ * last can be argued as responses are received, but those responses do
+ * not affect the MDF_ACAST association's reach register, rather they
+ * (may) result in mobilizing ephemeral MDF_ACLNT associations.
+ */
+#define MDF_TXONLY_MASK (MDF_BCAST | MDF_MCAST | MDF_ACAST | MDF_POOL)
+/*
+ * manycastclient-like solicitor association cast_flags bits
+ */
+#define MDF_SOLICIT_MASK (MDF_ACAST | MDF_POOL)
+/*
+ * Values used with mon_enabled to indicate reason for enabling monitoring
+ */
+#define MON_OFF 0x00 /* no monitoring */
+#define MON_ON 0x01 /* monitoring explicitly enabled */
+#define MON_RES 0x02 /* implicit monitoring for RES_LIMITED */
+/*
+ * Structure used for restrictlist entries
+ */
+typedef struct res_addr4_tag {
+ u_int32 addr; /* IPv4 addr (host order) */
+ u_int32 mask; /* IPv4 mask (host order) */
+} res_addr4;
+
+typedef struct res_addr6_tag {
+ struct in6_addr addr; /* IPv6 addr (net order) */
+ struct in6_addr mask; /* IPv6 mask (net order) */
+} res_addr6;
+
+typedef struct restrict_u_tag restrict_u;
+struct restrict_u_tag {
+ restrict_u * link; /* link to next entry */
+ u_int32 count; /* number of packets matched */
+ u_short flags; /* accesslist flags */
+ u_short mflags; /* match flags */
+ u_long expire; /* valid until time */
+ union { /* variant starting here */
+ res_addr4 v4;
+ res_addr6 v6;
+ } u;
+};
+#define V4_SIZEOF_RESTRICT_U (offsetof(restrict_u, u) \
+ + sizeof(res_addr4))
+#define V6_SIZEOF_RESTRICT_U (offsetof(restrict_u, u) \
+ + sizeof(res_addr6))
+
+/*
+ * Access flags
+ */
+#define RES_IGNORE 0x0001 /* ignore packet */
+#define RES_DONTSERVE 0x0002 /* access denied */
+#define RES_DONTTRUST 0x0004 /* authentication required */
+#define RES_VERSION 0x0008 /* version mismatch */
+#define RES_NOPEER 0x0010 /* new association denied */
+#define RES_LIMITED 0x0020 /* packet rate exceeded */
+#define RES_FLAGS (RES_IGNORE | RES_DONTSERVE |\
+ RES_DONTTRUST | RES_VERSION |\
+ RES_NOPEER | RES_LIMITED)
+
+#define RES_NOQUERY 0x0040 /* mode 6/7 packet denied */
+#define RES_NOMODIFY 0x0080 /* mode 6/7 modify denied */
+#define RES_NOTRAP 0x0100 /* mode 6/7 set trap denied */
+#define RES_LPTRAP 0x0200 /* mode 6/7 low priority trap */
+
+#define RES_KOD 0x0400 /* send kiss of death packet */
+#define RES_MSSNTP 0x0800 /* enable MS-SNTP authentication */
+#define RES_FLAKE 0x1000 /* flakeway - drop 10% */
+#define RES_NOMRULIST 0x2000 /* mode 6 mrulist denied */
+
+#define RES_ALLFLAGS (RES_FLAGS | RES_NOQUERY | \
+ RES_NOMODIFY | RES_NOTRAP | \
+ RES_LPTRAP | RES_KOD | \
+ RES_MSSNTP | RES_FLAKE | \
+ RES_NOMRULIST)
+
+/*
+ * Match flags
+ */
+#define RESM_INTERFACE 0x1000 /* this is an interface */
+#define RESM_NTPONLY 0x2000 /* match source port 123 */
+#define RESM_SOURCE 0x4000 /* from "restrict source" */
+
+/*
+ * Restriction configuration ops
+ */
+#define RESTRICT_FLAGS 1 /* add flags to restrict entry */
+#define RESTRICT_UNFLAG 2 /* remove flags from restrict entry */
+#define RESTRICT_REMOVE 3 /* remove a restrict entry */
+#define RESTRICT_REMOVEIF 4 /* remove an interface restrict entry */
+
+/*
+ * Endpoint structure for the select algorithm
+ */
+struct endpoint {
+ double val; /* offset of endpoint */
+ int type; /* interval entry/exit */
+};
+
+/*
+ * Association matching AM[] return codes
+ */
+#define AM_ERR -1 /* error */
+#define AM_NOMATCH 0 /* no match */
+#define AM_PROCPKT 1 /* server/symmetric packet */
+#define AM_BCST 2 /* broadcast packet */
+#define AM_FXMIT 3 /* client packet */
+#define AM_MANYCAST 4 /* manycast or pool */
+#define AM_NEWPASS 5 /* new passive */
+#define AM_NEWBCL 6 /* new broadcast */
+#define AM_POSSBCL 7 /* discard broadcast */
+
+/* NetInfo configuration locations */
+#ifdef HAVE_NETINFO
+#define NETINFO_CONFIG_DIR "/config/ntp"
+#endif
+
+/* ntpq -c mrulist rows per request limit in ntpd */
+#define MRU_ROW_LIMIT 256
+/* similar datagrams per response limit for ntpd */
+#define MRU_FRAGS_LIMIT 128
+#endif /* NTP_H */
diff --git a/include/ntp_assert.h b/include/ntp_assert.h
new file mode 100644
index 0000000..2f3bbc8
--- /dev/null
+++ b/include/ntp_assert.h
@@ -0,0 +1,108 @@
+/*
+ * ntp_assert.h - design by contract stuff
+ *
+ * example:
+ *
+ * int foo(char *a) {
+ * int result;
+ * int value;
+ *
+ * REQUIRE(a != NULL);
+ * ...
+ * bar(&value);
+ * INSIST(value > 2);
+ * ...
+ *
+ * ENSURE(result != 12);
+ * return result;
+ * }
+ *
+ * open question: when would we use INVARIANT()?
+ *
+ * For cases where the overhead for non-debug builds is deemed too high,
+ * use DEBUG_REQUIRE(), DEBUG_INSIST(), DEBUG_ENSURE(), and/or
+ * DEBUG_INVARIANT().
+ */
+
+#ifndef NTP_ASSERT_H
+#define NTP_ASSERT_H
+
+# ifdef CALYSTO
+/* see: http://www.domagoj-babic.com/index.php/ResearchProjects/Calysto */
+
+extern void calysto_assume(unsigned char cnd); /* assume this always holds */
+extern void calysto_assert(unsigned char cnd); /* check whether this holds */
+#define ALWAYS_REQUIRE(x) calysto_assert(x)
+#define ALWAYS_INSIST(x) calysto_assume(x) /* DLH calysto_assert()? */
+#define ALWAYS_INVARIANT(x) calysto_assume(x)
+#define ALWAYS_ENSURE(x) calysto_assert(x)
+
+/* # elif defined(__COVERITY__) */
+/*
+ * DH: try letting coverity scan our actual assertion macros, now that
+ * isc_assertioncallback_t is marked __attribute__ __noreturn__.
+ */
+
+/*
+ * Coverity has special knowledge that assert(x) terminates the process
+ * if x is not true. Rather than teach it about our assertion macros,
+ * just use the one it knows about for Coverity Prevent scans. This
+ * means our assertion code (and ISC's) escapes Coverity analysis, but
+ * that seems to be a reasonable trade-off.
+ */
+
+/*
+#define ALWAYS_REQUIRE(x) assert(x)
+#define ALWAYS_INSIST(x) assert(x)
+#define ALWAYS_INVARIANT(x) assert(x)
+#define ALWAYS_ENSURE(x) assert(x)
+*/
+
+
+#elif defined(__FLEXELINT__)
+
+#include <assert.h>
+
+#define ALWAYS_REQUIRE(x) assert(x)
+#define ALWAYS_INSIST(x) assert(x)
+#define ALWAYS_INVARIANT(x) assert(x)
+#define ALWAYS_ENSURE(x) assert(x)
+
+# else /* neither Calysto, Coverity or FlexeLint */
+
+#include "isc/assertions.h"
+
+#define ALWAYS_REQUIRE(x) ISC_REQUIRE(x)
+#define ALWAYS_INSIST(x) ISC_INSIST(x)
+#define ALWAYS_INVARIANT(x) ISC_INVARIANT(x)
+#define ALWAYS_ENSURE(x) ISC_ENSURE(x)
+
+# endif /* neither Coverity nor Calysto */
+
+#define REQUIRE(x) ALWAYS_REQUIRE(x)
+#define INSIST(x) ALWAYS_INSIST(x)
+#define INVARIANT(x) ALWAYS_INVARIANT(x)
+#define ENSURE(x) ALWAYS_ENSURE(x)
+
+/*
+ * We initially used NTP_REQUIRE() instead of REQUIRE() etc, but that
+ * is unneccesarily verbose, as libisc use of REQUIRE() etc shows.
+ */
+#define NTP_REQUIRE(x) REQUIRE(x)
+#define NTP_INSIST(x) INSIST(x)
+#define NTP_INVARIANT(x) INVARIANT(x)
+#define NTP_ENSURE(x) ENSURE(x)
+
+# ifdef DEBUG
+#define DEBUG_REQUIRE(x) REQUIRE(x)
+#define DEBUG_INSIST(x) INSIST(x)
+#define DEBUG_INVARIANT(x) INVARIANT(x)
+#define DEBUG_ENSURE(x) ENSURE(x)
+# else
+#define DEBUG_REQUIRE(x) do {} while (FALSE)
+#define DEBUG_INSIST(x) do {} while (FALSE)
+#define DEBUG_INVARIANT(x) do {} while (FALSE)
+#define DEBUG_ENSURE(x) do {} while (FALSE)
+# endif
+
+#endif /* NTP_ASSERT_H */
diff --git a/include/ntp_calendar.h b/include/ntp_calendar.h
new file mode 100644
index 0000000..3ee1ff7
--- /dev/null
+++ b/include/ntp_calendar.h
@@ -0,0 +1,416 @@
+/*
+ * ntp_calendar.h - definitions for the calendar time-of-day routine
+ */
+#ifndef NTP_CALENDAR_H
+#define NTP_CALENDAR_H
+
+#include <time.h>
+
+#include "ntp_types.h"
+
+/* gregorian calendar date */
+struct calendar {
+ uint16_t year; /* year (A.D.) */
+ uint16_t yearday; /* day of year, 1 = January 1 */
+ uint8_t month; /* month, 1 = January */
+ uint8_t monthday; /* day of month */
+ uint8_t hour; /* hour of day, midnight = 0 */
+ uint8_t minute; /* minute of hour */
+ uint8_t second; /* second of minute */
+ uint8_t weekday; /* 0..7, 0=Sunday */
+};
+
+/* ISO week calendar date */
+struct isodate {
+ uint16_t year; /* year (A.D.) */
+ uint8_t week; /* 1..53, week in year */
+ uint8_t weekday; /* 1..7, 1=Monday */
+ uint8_t hour; /* hour of day, midnight = 0 */
+ uint8_t minute; /* minute of hour */
+ uint8_t second; /* second of minute */
+};
+
+/* general split representation */
+typedef struct {
+ int32_t hi;
+ int32_t lo;
+} ntpcal_split;
+
+typedef time_t (*systime_func_ptr)(time_t *);
+
+/*
+ * set the function for getting the system time. This is mostly used for
+ * unit testing to provide a fixed / shifted time stamp. Setting the
+ * value to NULL restores the original function, that is, 'time()',
+ * which is also the automatic default.
+ */
+extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr);
+
+/*
+ * days-of-week
+ */
+#define CAL_SUNDAY 0
+#define CAL_MONDAY 1
+#define CAL_TUESDAY 2
+#define CAL_WEDNESDAY 3
+#define CAL_THURSDAY 4
+#define CAL_FRIDAY 5
+#define CAL_SATURDAY 6
+#define CAL_SUNDAY7 7 /* also sunday */
+
+/*
+ * Days in each month. 30 days hath September...
+ */
+#define JAN 31
+#define FEB 28
+#define FEBLEAP 29
+#define MAR 31
+#define APR 30
+#define MAY 31
+#define JUN 30
+#define JUL 31
+#define AUG 31
+#define SEP 30
+#define OCT 31
+#define NOV 30
+#define DEC 31
+
+/*
+ * We deal in a 4 year cycle starting at March 1, 1900. We assume
+ * we will only want to deal with dates since then, and not to exceed
+ * the rollover day in 2036.
+ */
+#define SECSPERMIN (60) /* seconds per minute */
+#define MINSPERHR (60) /* minutes per hour */
+#define HRSPERDAY (24) /* hours per day */
+#define DAYSPERYEAR (365) /* days per year */
+
+#define SECSPERHR (SECSPERMIN * MINSPERHR)
+#define SECSPERDAY (SECSPERHR * HRSPERDAY)
+#define SECSPERYEAR (365 * SECSPERDAY) /* regular year */
+#define SECSPERLEAPYEAR (366 * SECSPERDAY) /* leap year */
+#define SECSPERAVGYEAR 31556952 /* mean year length over 400yrs */
+
+/*
+ * Gross hacks. I have illicit knowlege that there won't be overflows
+ * here, the compiler often can't tell this.
+ */
+#define TIMES60(val) ((((val)<<4) - (val))<<2) /* *(16 - 1) * 4 */
+#define TIMES24(val) (((val)<<4) + ((val)<<3)) /* *16 + *8 */
+#define TIMES7(val) (((val)<<3) - (val)) /* *8 - *1 */
+#define TIMESDPERC(val) (((val)<<10) + ((val)<<8) \
+ + ((val)<<7) + ((val)<<5) \
+ + ((val)<<4) + ((val)<<2) + (val)) /* *big* hack */
+
+
+extern const char * const months[12];
+extern const char * const daynames[7];
+
+extern void caljulian (uint32_t, struct calendar *);
+extern uint32_t caltontp (const struct calendar *);
+
+/*
+ * Convert between 'time_t' and 'vint64'
+ */
+extern vint64 time_to_vint64(const time_t *);
+extern time_t vint64_to_time(const vint64 *);
+
+/*
+ * Get the build date & time. ATTENTION: The time zone is not specified!
+ * This depends entirely on the C compilers' capabilities to properly
+ * expand the '__TIME__' and '__DATE__' macros, as required by the C
+ * standard.
+ */
+extern int
+ntpcal_get_build_date(struct calendar * /* jd */);
+
+/*
+ * Convert a timestamp in NTP scale to a time_t value in the UN*X
+ * scale with proper epoch unfolding around a given pivot or the
+ * current system time.
+ */
+extern vint64
+ntpcal_ntp_to_time(uint32_t /* ntp */, const time_t * /* pivot */);
+
+/*
+ * Convert a timestamp in NTP scale to a 64bit seconds value in the NTP
+ * scale with proper epoch unfolding around a given pivot or the current
+ * system time.
+ * Note: The pivot must be given in UN*X time scale!
+ */
+extern vint64
+ntpcal_ntp_to_ntp(uint32_t /* ntp */, const time_t * /* pivot */);
+
+/*
+ * Split a time stamp in seconds into elapsed days and elapsed seconds
+ * since midnight.
+ */
+extern ntpcal_split
+ntpcal_daysplit(const vint64 *);
+
+/*
+ * Merge a number of days and a number of seconds into seconds,
+ * expressed in 64 bits to avoid overflow.
+ */
+extern vint64
+ntpcal_dayjoin(int32_t /* days */, int32_t /* seconds */);
+
+/*
+ * Convert elapsed years in Era into elapsed days in Era.
+ */
+extern int32_t
+ntpcal_days_in_years(int32_t /* years */);
+
+/*
+ * Convert a number of elapsed month in a year into elapsed days
+ * in year.
+ *
+ * The month will be normalized, and 'res.hi' will contain the
+ * excessive years that must be considered when converting the years,
+ * while 'res.lo' will contain the days since start of the
+ * year. (Expect the resulting days to be negative, with a positive
+ * excess! But then, we need no leap year flag, either...)
+ */
+extern ntpcal_split
+ntpcal_days_in_months(int32_t /* months */);
+
+/*
+ * Convert ELAPSED years/months/days of gregorian calendar to elapsed
+ * days in Gregorian epoch. No range checks done here!
+ */
+extern int32_t
+ntpcal_edate_to_eradays(int32_t /* years */, int32_t /* months */, int32_t /* mdays */);
+
+/*
+ * Convert a time spec to seconds. No range checks done here!
+ */
+extern int32_t
+ntpcal_etime_to_seconds(int32_t /* hours */, int32_t /* minutes */, int32_t /* seconds */);
+
+/*
+ * Convert ELAPSED years/months/days of gregorian calendar to elapsed
+ * days in year.
+ *
+ * Note: This will give the true difference to the start of the given year,
+ * even if months & days are off-scale.
+ */
+extern int32_t
+ntpcal_edate_to_yeardays(int32_t /* years */, int32_t /* months */, int32_t /* mdays */);
+
+/*
+ * Convert the date part of a 'struct tm' (that is, year, month,
+ * day-of-month) into the RataDie of that day.
+ */
+extern int32_t
+ntpcal_tm_to_rd(const struct tm * /* utm */);
+
+/*
+ * Convert the date part of a 'struct calendar' (that is, year, month,
+ * day-of-month) into the RataDie of that day.
+ */
+extern int32_t
+ntpcal_date_to_rd(const struct calendar * /* jt */);
+
+/*
+ * Given the number of elapsed days in the calendar era, split this
+ * number into the number of elapsed years in 'res.quot' and the
+ * number of elapsed days of that year in 'res.rem'.
+ *
+ * if 'isleapyear' is not NULL, it will receive an integer that is 0
+ * for regular years and a non-zero value for leap years.
+ */
+extern ntpcal_split
+ntpcal_split_eradays(int32_t /* days */, int/*BOOL*/ * /* isleapyear */);
+
+/*
+ * Given a number of elapsed days in a year and a leap year indicator,
+ * split the number of elapsed days into the number of elapsed months
+ * in 'res.quot' and the number of elapsed days of that month in
+ * 'res.rem'.
+ */
+extern ntpcal_split
+ntpcal_split_yeardays(int32_t /* eyd */, int/*BOOL*/ /* isleapyear */);
+
+/*
+ * Convert a RataDie number into the date part of a 'struct
+ * calendar'. Return 0 if the year is regular year, !0 if the year is
+ * a leap year.
+ */
+extern int/*BOOL*/
+ntpcal_rd_to_date(struct calendar * /* jt */, int32_t /* rd */);
+
+/*
+ * Convert a RataDie number into the date part of a 'struct
+ * tm'. Return 0 if the year is regular year, !0 if the year is a leap
+ * year.
+ */
+extern int/*BOOL*/
+ntpcal_rd_to_tm(struct tm * /* utm */, int32_t /* rd */);
+
+/*
+ * Take a value of seconds since midnight and split it into hhmmss in
+ * a 'struct calendar'. Return excessive days.
+ */
+extern int32_t
+ntpcal_daysec_to_date(struct calendar * /* jt */, int32_t /* secs */);
+
+/*
+ * Take the time part of a 'struct calendar' and return the seconds
+ * since midnight.
+ */
+extern int32_t
+ntpcal_date_to_daysec(const struct calendar *);
+
+/*
+ * Take a value of seconds since midnight and split it into hhmmss in
+ * a 'struct tm'. Return excessive days.
+ */
+extern int32_t
+ntpcal_daysec_to_tm(struct tm * /* utm */, int32_t /* secs */);
+
+extern int32_t
+ntpcal_tm_to_daysec(const struct tm * /* utm */);
+
+/*
+ * convert a year number to rata die of year start
+ */
+extern int32_t
+ntpcal_year_to_ystart(int32_t /* year */);
+
+/*
+ * For a given RataDie, get the RataDie of the associated year start,
+ * that is, the RataDie of the last January,1st on or before that day.
+ */
+extern int32_t
+ntpcal_rd_to_ystart(int32_t /* rd */);
+
+/*
+ * convert a RataDie to the RataDie of start of the calendar month.
+ */
+extern int32_t
+ntpcal_rd_to_mstart(int32_t /* year */);
+
+
+extern int
+ntpcal_daysplit_to_date(struct calendar * /* jt */,
+ const ntpcal_split * /* ds */, int32_t /* dof */);
+
+extern int
+ntpcal_daysplit_to_tm(struct tm * /* utm */, const ntpcal_split * /* ds */,
+ int32_t /* dof */);
+
+extern int
+ntpcal_time_to_date(struct calendar * /* jd */, const vint64 * /* ts */);
+
+extern int32_t
+ntpcal_periodic_extend(int32_t /* pivot */, int32_t /* value */,
+ int32_t /* cycle */);
+
+extern int
+ntpcal_ntp64_to_date(struct calendar * /* jd */, const vint64 * /* ntp */);
+
+extern int
+ntpcal_ntp_to_date(struct calendar * /* jd */, uint32_t /* ntp */,
+ const time_t * /* pivot */);
+
+extern vint64
+ntpcal_date_to_ntp64(const struct calendar * /* jd */);
+
+extern uint32_t
+ntpcal_date_to_ntp(const struct calendar * /* jd */);
+
+extern time_t
+ntpcal_date_to_time(const struct calendar * /* jd */);
+
+/*
+ * ISO week-calendar conversions
+ */
+extern int32_t
+isocal_weeks_in_years(int32_t /* years */);
+
+extern ntpcal_split
+isocal_split_eraweeks(int32_t /* weeks */);
+
+extern int
+isocal_ntp64_to_date(struct isodate * /* id */, const vint64 * /* ntp */);
+
+extern int
+isocal_ntp_to_date(struct isodate * /* id */, uint32_t /* ntp */,
+ const time_t * /* pivot */);
+
+extern vint64
+isocal_date_to_ntp64(const struct isodate * /* id */);
+
+extern uint32_t
+isocal_date_to_ntp(const struct isodate * /* id */);
+
+
+/*
+ * day-of-week calculations
+ *
+ * Given a RataDie and a day-of-week, calculate a RDN that is reater-than,
+ * greater-or equal, closest, less-or-equal or less-than the given RDN
+ * and denotes the given day-of-week
+ */
+extern int32_t
+ntpcal_weekday_gt(int32_t /* rdn */, int32_t /* dow */);
+
+extern int32_t
+ntpcal_weekday_ge(int32_t /* rdn */, int32_t /* dow */);
+
+extern int32_t
+ntpcal_weekday_close(int32_t /* rdn */, int32_t /* dow */);
+
+extern int32_t
+ntpcal_weekday_le(int32_t /* rdn */, int32_t /* dow */);
+
+extern int32_t
+ntpcal_weekday_lt(int32_t /* rdn */, int32_t /* dow */);
+
+/*
+ * Additional support stuff for Ed Rheingold's calendrical calculations
+ */
+
+/*
+ * Start day of NTP time as days past the imaginary date 12/1/1 BC.
+ * (This is the beginning of the Christian Era, or BCE.)
+ */
+#define DAY_NTP_STARTS 693596
+
+/*
+ * Start day of the UNIX epoch. This is the Rata Die of 1970-01-01.
+ */
+#define DAY_UNIX_STARTS 719163
+
+/*
+ * Difference between UN*X and NTP epoch (25567).
+ */
+#define NTP_TO_UNIX_DAYS (DAY_UNIX_STARTS - DAY_NTP_STARTS)
+
+/*
+ * Days in a normal 4 year leap year calendar cycle (1461).
+ */
+#define GREGORIAN_NORMAL_LEAP_CYCLE_DAYS (3 * 365 + 366)
+
+/*
+ * Days in a normal 100 year leap year calendar (36524). We lose a
+ * leap day in years evenly divisible by 100 but not by 400.
+ */
+#define GREGORIAN_NORMAL_CENTURY_DAYS \
+ (25 * GREGORIAN_NORMAL_LEAP_CYCLE_DAYS - 1)
+
+/*
+ * The Gregorian calendar is based on a 400 year cycle. This is the
+ * number of days in each cycle (146097). We gain a leap day in years
+ * divisible by 400 relative to the "normal" century.
+ */
+#define GREGORIAN_CYCLE_DAYS (4 * GREGORIAN_NORMAL_CENTURY_DAYS + 1)
+
+/*
+ * Number of weeks in 400 years (20871).
+ */
+#define GREGORIAN_CYCLE_WEEKS (GREGORIAN_CYCLE_DAYS / 7)
+
+#define is_leapyear(y) (!((y) % 4) && !(!((y) % 100) && (y) % 400))
+
+#endif
diff --git a/include/ntp_cmdargs.h b/include/ntp_cmdargs.h
new file mode 100644
index 0000000..de45d8d
--- /dev/null
+++ b/include/ntp_cmdargs.h
@@ -0,0 +1 @@
+extern void getCmdOpts(int, char **);
diff --git a/include/ntp_config.h b/include/ntp_config.h
new file mode 100644
index 0000000..900688c
--- /dev/null
+++ b/include/ntp_config.h
@@ -0,0 +1,322 @@
+#ifndef NTP_CONFIG_H
+#define NTP_CONFIG_H
+
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif /* HAVE_SYS_RESOURCE_H */
+
+#include "ntp_machine.h"
+#include "ntpsim.h"
+
+
+/*
+ * Configuration file name
+ */
+#ifndef CONFIG_FILE
+# ifndef SYS_WINNT
+# define CONFIG_FILE "/etc/ntp.conf"
+# else /* SYS_WINNT */
+# define CONFIG_FILE "%windir%\\system32\\drivers\\etc\\ntp.conf"
+# define ALT_CONFIG_FILE "%windir%\\ntp.conf"
+# define NTP_KEYSDIR "%windir%\\system32\\drivers\\etc"
+# endif /* SYS_WINNT */
+#endif /* not CONFIG_FILE */
+
+
+/*
+ * We keep config trees around for possible saveconfig use. When
+ * built with configure --disable-saveconfig, and when built with
+ * debugging enabled, include the free_config_*() routines. In the
+ * DEBUG case, they are used in an atexit() cleanup routine to make
+ * postmortem leak check reports more interesting.
+ */
+#if !defined(FREE_CFG_T) && (!defined(SAVECONFIG) || defined(DEBUG))
+#define FREE_CFG_T
+#endif
+
+/* Limits */
+#define MAXLINE 1024
+
+/* Configuration sources */
+
+#define CONF_SOURCE_FILE 0
+#define CONF_SOURCE_NTPQ 1
+
+/* list of servers from command line for config_peers() */
+extern int cmdline_server_count;
+extern char ** cmdline_servers;
+
+/* set to zero if admin doesn't want memory locked */
+extern int do_memlock;
+
+typedef struct int_range_tag {
+ int first;
+ int last;
+} int_range;
+
+/* Structure for storing an attribute-value pair */
+typedef struct attr_val_tag attr_val;
+struct attr_val_tag {
+ attr_val * link;
+ int attr;
+ int type; /* T_String, T_Integer, ... */
+ union val {
+ int i;
+ u_int u;
+ int_range r;
+ double d;
+ char * s;
+ } value;
+};
+
+typedef DECL_FIFO_ANCHOR(attr_val) attr_val_fifo;
+
+/* Structure for nodes on the syntax tree */
+typedef struct address_node_tag address_node;
+struct address_node_tag {
+ address_node * link;
+ char * address;
+ u_short type; /* family, AF_UNSPEC (0), AF_INET[6] */
+};
+
+typedef DECL_FIFO_ANCHOR(address_node) address_fifo;
+
+typedef struct int_node_tag int_node;
+struct int_node_tag {
+ int_node * link;
+ int i;
+};
+
+typedef DECL_FIFO_ANCHOR(int_node) int_fifo;
+
+typedef struct string_node_tag string_node;
+struct string_node_tag {
+ string_node * link;
+ char * s;
+};
+
+typedef DECL_FIFO_ANCHOR(string_node) string_fifo;
+
+typedef struct restrict_node_tag restrict_node;
+struct restrict_node_tag {
+ restrict_node * link;
+ address_node * addr;
+ address_node * mask;
+ int_fifo * flags;
+ int line_no;
+};
+
+typedef DECL_FIFO_ANCHOR(restrict_node) restrict_fifo;
+
+typedef struct peer_node_tag peer_node;
+struct peer_node_tag {
+ peer_node * link;
+ int host_mode;
+ address_node * addr;
+ attr_val_fifo * peerflags;
+ u_char minpoll;
+ u_char maxpoll;
+ u_int32 ttl;
+ u_char peerversion;
+ keyid_t peerkey;
+ char * group;
+};
+
+typedef DECL_FIFO_ANCHOR(peer_node) peer_fifo;
+
+typedef struct unpeer_node_tag unpeer_node;
+struct unpeer_node_tag {
+ unpeer_node * link;
+ associd_t assocID;
+ address_node * addr;
+};
+
+typedef DECL_FIFO_ANCHOR(unpeer_node) unpeer_fifo;
+
+typedef struct auth_node_tag auth_node;
+struct auth_node_tag {
+ int control_key;
+ int cryptosw;
+ attr_val_fifo * crypto_cmd_list;
+ char * keys;
+ char * keysdir;
+ int request_key;
+ int revoke;
+ attr_val_fifo * trusted_key_list;
+ char * ntp_signd_socket;
+};
+
+typedef struct filegen_node_tag filegen_node;
+struct filegen_node_tag {
+ filegen_node * link;
+ int filegen_token;
+ attr_val_fifo * options;
+};
+
+typedef DECL_FIFO_ANCHOR(filegen_node) filegen_fifo;
+
+typedef struct setvar_node_tag setvar_node;
+struct setvar_node_tag {
+ setvar_node * link;
+ char * var;
+ char * val;
+ int isdefault;
+};
+
+typedef DECL_FIFO_ANCHOR(setvar_node) setvar_fifo;
+
+typedef struct nic_rule_node_tag nic_rule_node;
+struct nic_rule_node_tag {
+ nic_rule_node * link;
+ int match_class;
+ char * if_name; /* or numeric address */
+ int action;
+};
+
+typedef DECL_FIFO_ANCHOR(nic_rule_node) nic_rule_fifo;
+
+typedef struct addr_opts_node_tag addr_opts_node;
+struct addr_opts_node_tag {
+ addr_opts_node *link;
+ address_node * addr;
+ attr_val_fifo * options;
+};
+
+typedef DECL_FIFO_ANCHOR(addr_opts_node) addr_opts_fifo;
+
+typedef struct sim_node_tag sim_node;
+struct sim_node_tag {
+ sim_node * link;
+ attr_val_fifo * init_opts;
+ server_info_fifo * servers;
+};
+
+typedef DECL_FIFO_ANCHOR(sim_node) sim_fifo;
+
+/* The syntax tree */
+typedef struct config_tree_tag config_tree;
+struct config_tree_tag {
+ config_tree * link;
+
+ attr_val source;
+ time_t timestamp;
+
+ peer_fifo * peers;
+ unpeer_fifo * unpeers;
+
+ /* Other Modes */
+ int broadcastclient;
+ address_fifo * manycastserver;
+ address_fifo * multicastclient;
+
+ attr_val_fifo * orphan_cmds; /* s/b renamed tos_options */
+
+ /* Monitoring Configuration */
+ int_fifo * stats_list;
+ char * stats_dir;
+ filegen_fifo * filegen_opts;
+
+ /* Access Control Configuration */
+ attr_val_fifo * discard_opts;
+ attr_val_fifo * mru_opts;
+ restrict_fifo * restrict_opts;
+
+ addr_opts_fifo *fudge;
+ attr_val_fifo * rlimit;
+ attr_val_fifo * tinker;
+ attr_val_fifo * enable_opts;
+ attr_val_fifo * disable_opts;
+
+ auth_node auth;
+
+ attr_val_fifo * logconfig;
+ string_fifo * phone;
+ setvar_fifo * setvar;
+ int_fifo * ttl;
+ addr_opts_fifo *trap;
+ attr_val_fifo * vars;
+ nic_rule_fifo * nic_rules;
+ int_fifo * reset_counters;
+
+ sim_fifo * sim_details;
+};
+
+
+/* Structure for holding a remote configuration command */
+struct REMOTE_CONFIG_INFO {
+ char buffer[MAXLINE];
+ char err_msg[MAXLINE];
+ int pos;
+ int err_pos;
+ int no_errors;
+};
+
+
+/*
+ * context for trap_name_resolved() to call ctlsettrap() once the
+ * name->address resolution completes.
+ */
+typedef struct settrap_parms_tag {
+ sockaddr_u ifaddr;
+ int ifaddr_nonnull;
+} settrap_parms;
+
+
+/* get text from T_ tokens */
+const char * token_name(int token);
+
+/* generic fifo routines for structs linked by 1st member */
+void* append_gen_fifo(void *fifo, void *entry);
+void * concat_gen_fifos(void *first, void *second);
+#define APPEND_G_FIFO(pf, pe) \
+ ((pf) = append_gen_fifo((pf), (pe)))
+#define CONCAT_G_FIFOS(first, second) \
+ ((first) = concat_gen_fifos((first), (second)))
+#define HEAD_PFIFO(pf) \
+ (((pf) != NULL) \
+ ? HEAD_FIFO(*(pf)) \
+ : NULL)
+
+peer_node *create_peer_node(int hmode, address_node *addr,
+ attr_val_fifo *options);
+unpeer_node *create_unpeer_node(address_node *addr);
+address_node *create_address_node(char *addr, int type);
+void destroy_address_node(address_node *my_node);
+attr_val *create_attr_dval(int attr, double value);
+attr_val *create_attr_ival(int attr, int value);
+attr_val *create_attr_uval(int attr, u_int value);
+attr_val *create_attr_rangeval(int attr, int first, int last);
+attr_val *create_attr_sval(int attr, char *s);
+filegen_node *create_filegen_node(int filegen_token,
+ attr_val_fifo *options);
+string_node *create_string_node(char *str);
+restrict_node *create_restrict_node(address_node *addr,
+ address_node *mask,
+ int_fifo *flags, int line_no);
+int_node *create_int_node(int val);
+addr_opts_node *create_addr_opts_node(address_node *addr,
+ attr_val_fifo *options);
+sim_node *create_sim_node(attr_val_fifo *init_opts,
+ server_info_fifo *servers);
+setvar_node *create_setvar_node(char *var, char *val, int isdefault);
+nic_rule_node *create_nic_rule_node(int match_class, char *if_name,
+ int action);
+
+script_info *create_sim_script_info(double duration,
+ attr_val_fifo *script_queue);
+server_info *create_sim_server(address_node *addr, double server_offset,
+ script_info_fifo *script);
+
+extern struct REMOTE_CONFIG_INFO remote_config;
+void config_remotely(sockaddr_u *);
+
+#ifdef SAVECONFIG
+int dump_config_tree(config_tree *ptree, FILE *df, int comment);
+int dump_all_config_trees(FILE *df, int comment);
+#endif
+
+#if defined(HAVE_SETRLIMIT)
+void ntp_rlimit(int, rlim_t, int, char *);
+#endif
+
+#endif /* !defined(NTP_CONFIG_H) */
diff --git a/include/ntp_control.h b/include/ntp_control.h
new file mode 100644
index 0000000..be5b16d
--- /dev/null
+++ b/include/ntp_control.h
@@ -0,0 +1,192 @@
+/*
+ * ntp_control.h - definitions related to NTP mode 6 control messages
+ */
+
+#include "ntp_types.h"
+
+typedef union ctl_pkt_u_tag {
+ u_char data[480 + MAX_MAC_LEN]; /* data + auth */
+ u_int32 u32[(480 + MAX_MAC_LEN) / sizeof(u_int32)];
+} ctl_pkt_u;
+
+struct ntp_control {
+ u_char li_vn_mode; /* leap, version, mode */
+ u_char r_m_e_op; /* response, more, error, opcode */
+ u_short sequence; /* sequence number of request */
+ u_short status; /* status word for association */
+ associd_t associd; /* association ID */
+ u_short offset; /* offset of this batch of data */
+ u_short count; /* count of data in this packet */
+ ctl_pkt_u u;
+};
+
+/*
+ * Length of the control header, in octets
+ */
+#define CTL_HEADER_LEN (offsetof(struct ntp_control, u))
+#define CTL_MAX_DATA_LEN 468
+
+
+/*
+ * Limits and things
+ */
+#define CTL_MAXTRAPS 3 /* maximum number of traps we allow */
+#define CTL_TRAPTIME (60*60) /* time out traps in 1 hour */
+#define CTL_MAXAUTHSIZE 64 /* maximum size of an authen'ed req */
+
+/*
+ * Decoding for the r_m_e_op field
+ */
+#define CTL_RESPONSE 0x80
+#define CTL_ERROR 0x40
+#define CTL_MORE 0x20
+#define CTL_OP_MASK 0x1f
+
+#define CTL_ISRESPONSE(r_m_e_op) ((CTL_RESPONSE & (r_m_e_op)) != 0)
+#define CTL_ISMORE(r_m_e_op) ((CTL_MORE & (r_m_e_op)) != 0)
+#define CTL_ISERROR(r_m_e_op) ((CTL_ERROR & (r_m_e_op)) != 0)
+#define CTL_OP(r_m_e_op) (CTL_OP_MASK & (r_m_e_op))
+
+/*
+ * Opcodes
+ */
+#define CTL_OP_UNSPEC 0 /* unspeciffied */
+#define CTL_OP_READSTAT 1 /* read status */
+#define CTL_OP_READVAR 2 /* read variables */
+#define CTL_OP_WRITEVAR 3 /* write variables */
+#define CTL_OP_READCLOCK 4 /* read clock variables */
+#define CTL_OP_WRITECLOCK 5 /* write clock variables */
+#define CTL_OP_SETTRAP 6 /* set trap address */
+#define CTL_OP_ASYNCMSG 7 /* asynchronous message */
+#define CTL_OP_CONFIGURE 8 /* runtime configuration */
+#define CTL_OP_SAVECONFIG 9 /* save config to file */
+#define CTL_OP_READ_MRU 10 /* retrieve MRU (mrulist) */
+#define CTL_OP_READ_ORDLIST_A 11 /* ordered list req. auth. */
+#define CTL_OP_REQ_NONCE 12 /* request a client nonce */
+#define CTL_OP_UNSETTRAP 31 /* unset trap */
+
+/*
+ * {En,De}coding of the system status word
+ */
+#define CTL_SST_TS_UNSPEC 0 /* unspec */
+#define CTL_SST_TS_ATOM 1 /* pps */
+#define CTL_SST_TS_LF 2 /* lf radio */
+#define CTL_SST_TS_HF 3 /* hf radio */
+#define CTL_SST_TS_UHF 4 /* uhf radio */
+#define CTL_SST_TS_LOCAL 5 /* local */
+#define CTL_SST_TS_NTP 6 /* ntp */
+#define CTL_SST_TS_UDPTIME 7 /* other */
+#define CTL_SST_TS_WRSTWTCH 8 /* wristwatch */
+#define CTL_SST_TS_TELEPHONE 9 /* telephone */
+
+#define CTL_SYS_MAXEVENTS 15
+
+#define CTL_SYS_STATUS(li, source, nevnt, evnt) \
+ (((((unsigned short)(li))<< 14)&0xc000) | \
+ (((source)<<8)&0x3f00) | \
+ (((nevnt)<<4)&0x00f0) | \
+ ((evnt)&0x000f))
+
+#define CTL_SYS_LI(status) (((status)>>14) & 0x3)
+#define CTL_SYS_SOURCE(status) (((status)>>8) & 0x3f)
+#define CTL_SYS_NEVNT(status) (((status)>>4) & 0xf)
+#define CTL_SYS_EVENT(status) ((status) & 0xf)
+
+/*
+ * {En,De}coding of the peer status word
+ */
+#define CTL_PST_CONFIG 0x80
+#define CTL_PST_AUTHENABLE 0x40
+#define CTL_PST_AUTHENTIC 0x20
+#define CTL_PST_REACH 0x10
+#define CTL_PST_BCAST 0x08
+
+#define CTL_PST_SEL_REJECT 0 /* reject */
+#define CTL_PST_SEL_SANE 1 /* x falsetick */
+#define CTL_PST_SEL_CORRECT 2 /* . excess */
+#define CTL_PST_SEL_SELCAND 3 /* - outlyer */
+#define CTL_PST_SEL_SYNCCAND 4 /* + candidate */
+#define CTL_PST_SEL_EXCESS 5 /* # backup */
+#define CTL_PST_SEL_SYSPEER 6 /* * sys.peer */
+#define CTL_PST_SEL_PPS 7 /* o pps.peer */
+
+#define CTL_PEER_MAXEVENTS 15
+
+#define CTL_PEER_STATUS(status, nevnt, evnt) \
+ ((((status)<<8) & 0xff00) | \
+ (((nevnt)<<4) & 0x00f0) | \
+ ((evnt) & 0x000f))
+
+#define CTL_PEER_STATVAL(status)(((status)>>8) & 0xff)
+#define CTL_PEER_NEVNT(status) (((status)>>4) & 0xf)
+#define CTL_PEER_EVENT(status) ((status) & 0xf)
+
+/*
+ * {En,De}coding of the clock status word
+ */
+#define CTL_CLK_OKAY 0
+#define CTL_CLK_NOREPLY 1
+#define CTL_CLK_BADFORMAT 2
+#define CTL_CLK_FAULT 3
+#define CTL_CLK_PROPAGATION 4
+#define CTL_CLK_BADDATE 5
+#define CTL_CLK_BADTIME 6
+
+#define CTL_CLK_STATUS(status, event) \
+ ((((status)<<8) & 0xff00) | \
+ ((event) & 0x00ff))
+
+/*
+ * Error code responses returned when the E bit is set.
+ */
+#define CERR_UNSPEC 0
+#define CERR_PERMISSION 1
+#define CERR_BADFMT 2
+#define CERR_BADOP 3
+#define CERR_BADASSOC 4
+#define CERR_UNKNOWNVAR 5
+#define CERR_BADVALUE 6
+#define CERR_RESTRICT 7
+
+#define CERR_NORESOURCE CERR_PERMISSION /* wish there was a different code */
+
+
+/*
+ * Definition of the structure used internally to hold trap information.
+ * ntp_request.c wants to see this.
+ */
+struct ctl_trap {
+ sockaddr_u tr_addr; /* address of trap recipient */
+ struct interface *tr_localaddr; /* interface to send this through */
+ u_long tr_settime; /* time trap was set */
+ u_long tr_count; /* async messages sent to this guy */
+ u_long tr_origtime; /* time trap was originally set */
+ u_long tr_resets; /* count of resets for this trap */
+ u_short tr_sequence; /* trap sequence id */
+ u_char tr_flags; /* trap flags */
+ u_char tr_version; /* version number of trapper */
+};
+extern struct ctl_trap ctl_traps[CTL_MAXTRAPS];
+
+/*
+ * Flag bits
+ */
+#define TRAP_INUSE 0x1 /* this trap is active */
+#define TRAP_NONPRIO 0x2 /* this trap is non-priority */
+#define TRAP_CONFIGURED 0x4 /* this trap was configured */
+
+/*
+ * Types of things we may deal with
+ * shared between ntpq and library
+ */
+#define TYPE_SYS 1
+#define TYPE_PEER 2
+#define TYPE_CLOCK 3
+
+/*
+ * IFSTATS_FIELDS is the number of fields ntpd supplies for each ifstats
+ * row. Similarly RESLIST_FIELDS for reslist.
+ */
+#define IFSTATS_FIELDS 12
+#define RESLIST_FIELDS 4
+
diff --git a/include/ntp_crypto.h b/include/ntp_crypto.h
new file mode 100644
index 0000000..b801006
--- /dev/null
+++ b/include/ntp_crypto.h
@@ -0,0 +1,190 @@
+/*
+ * ntp_crypto.h - definitions for cryptographic operations
+ */
+#ifndef NTP_CRYPTO_H
+#define NTP_CRYPTO_H
+
+/*
+ * Configuration codes (also needed for parser without AUTOKEY)
+ */
+#define CRYPTO_CONF_NONE 0 /* nothing doing */
+#define CRYPTO_CONF_PRIV 1 /* host name */
+#define CRYPTO_CONF_IDENT 2 /* group name */
+#define CRYPTO_CONF_CERT 3 /* certificate file name */
+#define CRYPTO_CONF_RAND 4 /* random seed file name */
+#define CRYPTO_CONF_IFFPAR 5 /* IFF parameters file name */
+#define CRYPTO_CONF_GQPAR 6 /* GQ parameters file name */
+#define CRYPTO_CONF_MVPAR 7 /* MV parameters file name */
+#define CRYPTO_CONF_PW 8 /* private key password */
+#define CRYPTO_CONF_NID 9 /* specify digest name */
+
+#ifdef AUTOKEY
+#ifndef OPENSSL
+#error AUTOKEY should be defined only if OPENSSL is.
+invalidsyntax: AUTOKEY should be defined only if OPENSSL is.
+#endif
+
+#include "openssl/evp.h"
+#include "ntp_calendar.h" /* for fields in the cert_info structure */
+
+
+/*
+ * The following bits are set by the CRYPTO_ASSOC message from
+ * the server and are not modified by the client.
+ */
+#define CRYPTO_FLAG_ENAB 0x0001 /* crypto enable */
+#define CRYPTO_FLAG_TAI 0x0002 /* leapseconds table */
+
+#define CRYPTO_FLAG_PRIV 0x0010 /* PC identity scheme */
+#define CRYPTO_FLAG_IFF 0x0020 /* IFF identity scheme */
+#define CRYPTO_FLAG_GQ 0x0040 /* GQ identity scheme */
+#define CRYPTO_FLAG_MV 0x0080 /* MV identity scheme */
+#define CRYPTO_FLAG_MASK 0x00f0 /* identity scheme mask */
+
+/*
+ * The following bits are used by the client during the protocol
+ * exchange.
+ */
+#define CRYPTO_FLAG_CERT 0x0100 /* public key verified */
+#define CRYPTO_FLAG_VRFY 0x0200 /* identity verified */
+#define CRYPTO_FLAG_PROV 0x0400 /* signature verified */
+#define CRYPTO_FLAG_COOK 0x0800 /* cookie verifed */
+#define CRYPTO_FLAG_AUTO 0x1000 /* autokey verified */
+#define CRYPTO_FLAG_SIGN 0x2000 /* certificate signed */
+#define CRYPTO_FLAG_LEAP 0x4000 /* leapsecond values verified */
+#define CRYPTO_FLAG_ALL 0x7f00 /* all mask */
+
+/*
+ * Flags used for certificate management
+ */
+#define CERT_TRUST 0x01 /* certificate is trusted */
+#define CERT_SIGN 0x02 /* certificate is signed */
+#define CERT_VALID 0x04 /* certificate is valid */
+#define CERT_PRIV 0x08 /* certificate is private */
+#define CERT_ERROR 0x80 /* certificate has errors */
+
+/*
+ * Extension field definitions
+ */
+#define CRYPTO_MAXLEN 1024 /* max extension field length */
+#define CRYPTO_VN 2 /* current protocol version number */
+#define CRYPTO_CMD(x) (((CRYPTO_VN << 8) | (x)) << 16)
+#define CRYPTO_NULL CRYPTO_CMD(0) /* no operation */
+#define CRYPTO_ASSOC CRYPTO_CMD(1) /* association */
+#define CRYPTO_CERT CRYPTO_CMD(2) /* certificate */
+#define CRYPTO_COOK CRYPTO_CMD(3) /* cookie value */
+#define CRYPTO_AUTO CRYPTO_CMD(4) /* autokey values */
+#define CRYPTO_LEAP CRYPTO_CMD(5) /* leapsecond values */
+#define CRYPTO_SIGN CRYPTO_CMD(6) /* certificate sign */
+#define CRYPTO_IFF CRYPTO_CMD(7) /* IFF identity scheme */
+#define CRYPTO_GQ CRYPTO_CMD(8) /* GQ identity scheme */
+#define CRYPTO_MV CRYPTO_CMD(9) /* MV identity scheme */
+#define CRYPTO_RESP 0x80000000 /* response */
+#define CRYPTO_ERROR 0x40000000 /* error */
+
+/*
+ * Autokey event codes
+ */
+#define XEVNT_CMD(x) (CRPT_EVENT | (x))
+#define XEVNT_OK XEVNT_CMD(0) /* success */
+#define XEVNT_LEN XEVNT_CMD(1) /* bad field format or length */
+#define XEVNT_TSP XEVNT_CMD(2) /* bad timestamp */
+#define XEVNT_FSP XEVNT_CMD(3) /* bad filestamp */
+#define XEVNT_PUB XEVNT_CMD(4) /* bad or missing public key */
+#define XEVNT_MD XEVNT_CMD(5) /* unsupported digest type */
+#define XEVNT_KEY XEVNT_CMD(6) /* unsupported identity type */
+#define XEVNT_SGL XEVNT_CMD(7) /* bad signature length */
+#define XEVNT_SIG XEVNT_CMD(8) /* signature not verified */
+#define XEVNT_VFY XEVNT_CMD(9) /* certificate not verified */
+#define XEVNT_PER XEVNT_CMD(10) /* host certificate expired */
+#define XEVNT_CKY XEVNT_CMD(11) /* bad or missing cookie */
+#define XEVNT_DAT XEVNT_CMD(12) /* bad or missing leapseconds */
+#define XEVNT_CRT XEVNT_CMD(13) /* bad or missing certificate */
+#define XEVNT_ID XEVNT_CMD(14) /* bad or missing group key */
+#define XEVNT_ERR XEVNT_CMD(15) /* protocol error */
+
+/*
+ * Miscellaneous crypto stuff
+ */
+#define NTP_MAXSESSION 100 /* maximum session key list entries */
+#define NTP_MAXEXTEN 2048 /* maximum extension field size */
+#define NTP_AUTOMAX 12 /* default key list timeout (log2 s) */
+#define KEY_REVOKE 17 /* default key revoke timeout (log2 s) */
+#define NTP_REFRESH 19 /* default restart timeout (log2 s) */
+#define NTP_MAXKEY 65535 /* maximum symmetric key ID */
+
+/*
+ * The autokey structure holds the values used to authenticate key IDs.
+ */
+struct autokey { /* network byte order */
+ keyid_t key; /* key ID */
+ int32 seq; /* key number */
+};
+
+/*
+ * The value structure holds variable length data such as public
+ * key, agreement parameters, public valule and leapsecond table.
+ * They are in network byte order.
+ */
+struct value { /* network byte order */
+ tstamp_t tstamp; /* timestamp */
+ tstamp_t fstamp; /* filestamp */
+ u_int32 vallen; /* value length */
+ void *ptr; /* data pointer (various) */
+ u_int32 siglen; /* signature length */
+ u_char *sig; /* signature */
+};
+
+/*
+ * The packet extension field structures are used to hold values
+ * and signatures in network byte order.
+ */
+struct exten {
+ u_int32 opcode; /* opcode */
+ u_int32 associd; /* association ID */
+ u_int32 tstamp; /* timestamp */
+ u_int32 fstamp; /* filestamp */
+ u_int32 vallen; /* value length */
+ u_int32 pkt[1]; /* start of value field */
+};
+
+
+/*
+ * The certificate info/value structure
+ */
+struct cert_info {
+ struct cert_info *link; /* forward link */
+ u_int flags; /* flags that wave */
+ EVP_PKEY *pkey; /* generic key */
+ long version; /* X509 version */
+ int nid; /* signature/digest ID */
+ const EVP_MD *digest; /* message digest algorithm */
+ u_long serial; /* serial number */
+ struct calendar first; /* not valid before */
+ struct calendar last; /* not valid after */
+ char *subject; /* subject common name */
+ char *issuer; /* issuer common name */
+ BIGNUM *grpkey; /* GQ group key */
+ struct value cert; /* certificate/value */
+};
+
+/*
+ * The keys info/value structure
+ */
+struct pkey_info {
+ struct pkey_info *link; /* forward link */
+ EVP_PKEY *pkey; /* generic key */
+ char *name; /* file name */
+ tstamp_t fstamp; /* filestamp */
+};
+
+/*
+ * Cryptographic values
+ */
+extern u_int crypto_flags; /* status word */
+extern int crypto_nid; /* digest nid */
+extern struct value hostval; /* host name/value */
+extern struct cert_info *cinfo; /* host certificate information */
+extern struct value tai_leap; /* leapseconds table */
+#endif /* AUTOKEY */
+#endif /* NTP_CRYPTO_H */
diff --git a/include/ntp_datum.h b/include/ntp_datum.h
new file mode 100644
index 0000000..2aa2cb7
--- /dev/null
+++ b/include/ntp_datum.h
@@ -0,0 +1,30 @@
+struct btfp_time /* Structure for reading 5 time words */
+ /* in one ioctl(2) operation. */
+{
+ unsigned short btfp_time[5]; /* Time words 0,1,2,3, and 4. (16bit)*/
+};
+
+/***** Simple ioctl commands *****/
+
+#define RUNLOCK _IO('X',19) /* Release Capture Lockout */
+#define RCR0 _IOR('X',22,unsigned int) /* Read control register */
+#define WCR0 _IOW('X',23,unsigned int) /* Write control register */
+
+/***** Compound ioctl commands *****/
+
+/* Read all 5 time words in one call. */
+#define READTIME _IOR('X',32,struct btfp_time)
+#define VMEFD "/dev/btfp0"
+
+ struct vmedate { /* structure returned by get_vmetime.c */
+ unsigned short year;
+ unsigned short doy;
+ unsigned short hr;
+ unsigned short mn;
+ unsigned short sec;
+ unsigned long frac;
+ unsigned short status;
+ };
+
+#define PRIO 120 /* set the realtime priority */
+#define NREGS 7 /* number of registers we will use */
diff --git a/include/ntp_debug.h b/include/ntp_debug.h
new file mode 100644
index 0000000..b0e846e
--- /dev/null
+++ b/include/ntp_debug.h
@@ -0,0 +1,27 @@
+/*
+ * $Header$
+ *
+ * $Created: Sat Aug 20 14:23:01 2005 $
+ *
+ * Copyright (C) 2005 by Frank Kardel
+ */
+#ifndef NTP_DEBUG_H
+#define NTP_DEBUG_H
+
+/*
+ * macro for debugging output - cut down on #ifdef pollution.
+ *
+ * TRACE() is similar to ntpd's DPRINTF() for utilities and libntp.
+ * Uses mprintf() and so supports %m, replaced by strerror(errno).
+ *
+ * The calling convention is not attractive:
+ * TRACE(debuglevel, (fmt, ...));
+ * TRACE(2, ("this will appear on stdout if debug >= %d\n", 2));
+ */
+#define TRACE(lvl, arg) \
+ do { \
+ if (debug >= (lvl)) \
+ mprintf arg; \
+ } while (0)
+
+#endif /* NTP_DEBUG_H */
diff --git a/include/ntp_filegen.h b/include/ntp_filegen.h
new file mode 100644
index 0000000..f5ba8af
--- /dev/null
+++ b/include/ntp_filegen.h
@@ -0,0 +1,56 @@
+/*
+ * ntp_filegen.h,v 3.9 1996/12/01 16:02:45 kardel Exp
+ *
+ * definitions for NTP file generations support
+ *
+ *
+ * Copyright (C) 1992, 1996 by Rainer Pruy
+ * Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
+ *
+ * This code may be modified and used freely
+ * provided the credits remain intact.
+ */
+
+#include "ntp_types.h"
+
+/*
+ * supported file generation types
+ */
+
+#define FILEGEN_NONE 255 /* no generations - use plain file name */
+#define FILEGEN_PID 1 /* one filegen per process incarnation */
+#define FILEGEN_DAY 2 /* one filegen per day */
+#define FILEGEN_WEEK 3 /* one filegen per week */
+#define FILEGEN_MONTH 4 /* one filegen per month */
+#define FILEGEN_YEAR 5 /* one filegen per year */
+#define FILEGEN_AGE 6 /* change filegen each FG_AGE_SECS */
+
+/*
+ * supported file generation flags
+ */
+
+#define FGEN_FLAG_LINK 0x01 /* make a link to base name */
+
+#define FGEN_FLAG_ENABLED 0x80 /* set this to really create files */
+ /* without this, open is suppressed */
+
+typedef struct filegen_tag {
+ FILE * fp; /* file referring to current generation */
+ char * dir; /* currently always statsdir */
+ char * fname; /* filename prefix of generation file */
+ /* must be malloced, will be fed to free() */
+ u_long id_lo; /* lower bound of ident value */
+ u_long id_hi; /* upper bound of ident value */
+ u_char type; /* type of file generation */
+ u_char flag; /* flags modifying processing of file generation */
+} FILEGEN;
+
+extern void filegen_setup (FILEGEN *, u_int32);
+extern void filegen_config (FILEGEN *, const char *, const char *,
+ u_int, u_int);
+extern void filegen_statsdir(void);
+extern FILEGEN *filegen_get (const char *);
+extern void filegen_register (const char *, const char *, FILEGEN *);
+#ifdef DEBUG
+extern void filegen_unregister(char *);
+#endif
diff --git a/include/ntp_fp.h b/include/ntp_fp.h
new file mode 100644
index 0000000..1b97e8b
--- /dev/null
+++ b/include/ntp_fp.h
@@ -0,0 +1,420 @@
+/*
+ * ntp_fp.h - definitions for NTP fixed/floating-point arithmetic
+ */
+
+#ifndef NTP_FP_H
+#define NTP_FP_H
+
+#include "ntp_types.h"
+
+/*
+ * NTP uses two fixed point formats. The first (l_fp) is the "long"
+ * format and is 64 bits long with the decimal between bits 31 and 32.
+ * This is used for time stamps in the NTP packet header (in network
+ * byte order) and for internal computations of offsets (in local host
+ * byte order). We use the same structure for both signed and unsigned
+ * values, which is a big hack but saves rewriting all the operators
+ * twice. Just to confuse this, we also sometimes just carry the
+ * fractional part in calculations, in both signed and unsigned forms.
+ * Anyway, an l_fp looks like:
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Integral Part |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Fractional Part |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+typedef struct {
+ union {
+ u_int32 Xl_ui;
+ int32 Xl_i;
+ } Ul_i;
+ u_int32 l_uf;
+} l_fp;
+
+#define l_ui Ul_i.Xl_ui /* unsigned integral part */
+#define l_i Ul_i.Xl_i /* signed integral part */
+
+/*
+ * Fractional precision (of an l_fp) is actually the number of
+ * bits in a long.
+ */
+#define FRACTION_PREC (32)
+
+
+/*
+ * The second fixed point format is 32 bits, with the decimal between
+ * bits 15 and 16. There is a signed version (s_fp) and an unsigned
+ * version (u_fp). This is used to represent synchronizing distance
+ * and synchronizing dispersion in the NTP packet header (again, in
+ * network byte order) and internally to hold both distance and
+ * dispersion values (in local byte order). In network byte order
+ * it looks like:
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Integer Part | Fraction Part |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+typedef int32 s_fp;
+typedef u_int32 u_fp;
+
+/*
+ * A unit second in fp format. Actually 2**(half_the_bits_in_a_long)
+ */
+#define FP_SECOND (0x10000)
+
+/*
+ * Byte order conversions
+ */
+#define HTONS_FP(x) (htonl(x))
+#define NTOHS_FP(x) (ntohl(x))
+
+#define NTOHL_MFP(ni, nf, hi, hf) \
+ do { \
+ (hi) = ntohl(ni); \
+ (hf) = ntohl(nf); \
+ } while (FALSE)
+
+#define HTONL_MFP(hi, hf, ni, nf) \
+ do { \
+ (ni) = htonl(hi); \
+ (nf) = htonl(hf); \
+ } while (FALSE)
+
+#define HTONL_FP(h, n) \
+ HTONL_MFP((h)->l_ui, (h)->l_uf, (n)->l_ui, (n)->l_uf)
+
+#define NTOHL_FP(n, h) \
+ NTOHL_MFP((n)->l_ui, (n)->l_uf, (h)->l_ui, (h)->l_uf)
+
+/* Convert unsigned ts fraction to net order ts */
+#define HTONL_UF(uf, nts) \
+ do { \
+ (nts)->l_ui = 0; \
+ (nts)->l_uf = htonl(uf); \
+ } while (FALSE)
+
+/*
+ * Conversions between the two fixed point types
+ */
+#define MFPTOFP(x_i, x_f) (((x_i) >= 0x00010000) ? 0x7fffffff : \
+ (((x_i) <= -0x00010000) ? 0x80000000 : \
+ (((x_i)<<16) | (((x_f)>>16)&0xffff))))
+#define LFPTOFP(v) MFPTOFP((v)->l_i, (v)->l_uf)
+
+#define UFPTOLFP(x, v) ((v)->l_ui = (u_fp)(x)>>16, (v)->l_uf = (x)<<16)
+#define FPTOLFP(x, v) (UFPTOLFP((x), (v)), (x) < 0 ? (v)->l_ui -= 0x10000 : 0)
+
+#define MAXLFP(v) ((v)->l_ui = 0x7fffffffu, (v)->l_uf = 0xffffffffu)
+#define MINLFP(v) ((v)->l_ui = 0x80000000u, (v)->l_uf = 0u)
+
+/*
+ * Primitive operations on long fixed point values. If these are
+ * reminiscent of assembler op codes it's only because some may
+ * be replaced by inline assembler for particular machines someday.
+ * These are the (kind of inefficient) run-anywhere versions.
+ */
+#define M_NEG(v_i, v_f) /* v = -v */ \
+ do { \
+ (v_f) = ~(v_f) + 1u; \
+ (v_i) = ~(v_i) + ((v_f) == 0); \
+ } while (FALSE)
+
+#define M_NEGM(r_i, r_f, a_i, a_f) /* r = -a */ \
+ do { \
+ (r_f) = ~(a_f) + 1u; \
+ (r_i) = ~(a_i) + ((r_f) == 0); \
+ } while (FALSE)
+
+#define M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \
+ do { \
+ u_int32 add_t = (r_f); \
+ (r_f) += (a_f); \
+ (r_i) += (a_i) + ((u_int32)(r_f) < add_t); \
+ } while (FALSE)
+
+#define M_ADD3(r_o, r_i, r_f, a_o, a_i, a_f) /* r += a, three word */ \
+ do { \
+ u_int32 add_t, add_c; \
+ add_t = (r_f); \
+ (r_f) += (a_f); \
+ add_c = ((u_int32)(r_f) < add_t); \
+ (r_i) += add_c; \
+ add_c = ((u_int32)(r_i) < add_c); \
+ add_t = (r_i); \
+ (r_i) += (a_i); \
+ add_c |= ((u_int32)(r_i) < add_t); \
+ (r_o) += (a_o) + add_c; \
+ } while (FALSE)
+
+#define M_SUB(r_i, r_f, a_i, a_f) /* r -= a */ \
+ do { \
+ u_int32 sub_t = (r_f); \
+ (r_f) -= (a_f); \
+ (r_i) -= (a_i) + ((u_int32)(r_f) > sub_t); \
+ } while (FALSE)
+
+#define M_RSHIFTU(v_i, v_f) /* v >>= 1, v is unsigned */ \
+ do { \
+ (v_f) = ((u_int32)(v_f) >> 1) | ((u_int32)(v_i) << 31); \
+ (v_i) = ((u_int32)(v_i) >> 1); \
+ } while (FALSE)
+
+#define M_RSHIFT(v_i, v_f) /* v >>= 1, v is signed */ \
+ do { \
+ (v_f) = ((u_int32)(v_f) >> 1) | ((u_int32)(v_i) << 31); \
+ (v_i) = ((u_int32)(v_i) >> 1) | ((u_int32)(v_i) & 0x80000000); \
+ } while (FALSE)
+
+#define M_LSHIFT(v_i, v_f) /* v <<= 1 */ \
+ do { \
+ (v_i) = ((u_int32)(v_i) << 1) | ((u_int32)(v_f) >> 31); \
+ (v_f) = ((u_int32)(v_f) << 1); \
+ } while (FALSE)
+
+#define M_LSHIFT3(v_o, v_i, v_f) /* v <<= 1, with overflow */ \
+ do { \
+ (v_o) = ((u_int32)(v_o) << 1) | ((u_int32)(v_i) >> 31); \
+ (v_i) = ((u_int32)(v_i) << 1) | ((u_int32)(v_f) >> 31); \
+ (v_f) = ((u_int32)(v_f) << 1); \
+ } while (FALSE)
+
+#define M_ADDUF(r_i, r_f, uf) /* r += uf, uf is u_int32 fraction */ \
+ M_ADD((r_i), (r_f), 0, (uf)) /* let optimizer worry about it */
+
+#define M_SUBUF(r_i, r_f, uf) /* r -= uf, uf is u_int32 fraction */ \
+ M_SUB((r_i), (r_f), 0, (uf)) /* let optimizer worry about it */
+
+#define M_ADDF(r_i, r_f, f) /* r += f, f is a int32 fraction */ \
+ do { \
+ int32 add_f = (int32)(f); \
+ if (add_f >= 0) \
+ M_ADD((r_i), (r_f), 0, (uint32)( add_f)); \
+ else \
+ M_SUB((r_i), (r_f), 0, (uint32)(-add_f)); \
+ } while(0)
+
+#define M_ISNEG(v_i) /* v < 0 */ \
+ (((v_i) & 0x80000000) != 0)
+
+#define M_ISGT(a_i, a_f, b_i, b_f) /* a > b signed */ \
+ (((u_int32)((a_i) ^ 0x80000000) > (u_int32)((b_i) ^ 0x80000000)) || \
+ ((a_i) == (b_i) && ((u_int32)(a_f)) > ((u_int32)(b_f))))
+
+#define M_ISGTU(a_i, a_f, b_i, b_f) /* a > b unsigned */ \
+ (((u_int32)(a_i)) > ((u_int32)(b_i)) || \
+ ((a_i) == (b_i) && ((u_int32)(a_f)) > ((u_int32)(b_f))))
+
+#define M_ISHIS(a_i, a_f, b_i, b_f) /* a >= b unsigned */ \
+ (((u_int32)(a_i)) > ((u_int32)(b_i)) || \
+ ((a_i) == (b_i) && ((u_int32)(a_f)) >= ((u_int32)(b_f))))
+
+#define M_ISGEQ(a_i, a_f, b_i, b_f) /* a >= b signed */ \
+ (((u_int32)((a_i) ^ 0x80000000) > (u_int32)((b_i) ^ 0x80000000)) || \
+ ((a_i) == (b_i) && (u_int32)(a_f) >= (u_int32)(b_f)))
+
+#define M_ISEQU(a_i, a_f, b_i, b_f) /* a == b unsigned */ \
+ ((u_int32)(a_i) == (u_int32)(b_i) && (u_int32)(a_f) == (u_int32)(b_f))
+
+/*
+ * Operations on the long fp format
+ */
+#define L_ADD(r, a) M_ADD((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf)
+#define L_SUB(r, a) M_SUB((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf)
+#define L_NEG(v) M_NEG((v)->l_ui, (v)->l_uf)
+#define L_ADDUF(r, uf) M_ADDUF((r)->l_ui, (r)->l_uf, (uf))
+#define L_SUBUF(r, uf) M_SUBUF((r)->l_ui, (r)->l_uf, (uf))
+#define L_ADDF(r, f) M_ADDF((r)->l_ui, (r)->l_uf, (f))
+#define L_RSHIFT(v) M_RSHIFT((v)->l_i, (v)->l_uf)
+#define L_RSHIFTU(v) M_RSHIFTU((v)->l_ui, (v)->l_uf)
+#define L_LSHIFT(v) M_LSHIFT((v)->l_ui, (v)->l_uf)
+#define L_CLR(v) ((v)->l_ui = (v)->l_uf = 0)
+
+#define L_ISNEG(v) M_ISNEG((v)->l_ui)
+#define L_ISZERO(v) (((v)->l_ui | (v)->l_uf) == 0)
+#define L_ISGT(a, b) M_ISGT((a)->l_i, (a)->l_uf, (b)->l_i, (b)->l_uf)
+#define L_ISGTU(a, b) M_ISGTU((a)->l_ui, (a)->l_uf, (b)->l_ui, (b)->l_uf)
+#define L_ISHIS(a, b) M_ISHIS((a)->l_ui, (a)->l_uf, (b)->l_ui, (b)->l_uf)
+#define L_ISGEQ(a, b) M_ISGEQ((a)->l_ui, (a)->l_uf, (b)->l_ui, (b)->l_uf)
+#define L_ISEQU(a, b) M_ISEQU((a)->l_ui, (a)->l_uf, (b)->l_ui, (b)->l_uf)
+
+/*
+ * s_fp/double and u_fp/double conversions
+ */
+#define FRIC 65536.0 /* 2^16 as a double */
+#define DTOFP(r) ((s_fp)((r) * FRIC))
+#define DTOUFP(r) ((u_fp)((r) * FRIC))
+#define FPTOD(r) ((double)(r) / FRIC)
+
+/*
+ * l_fp/double conversions
+ */
+#define FRAC 4294967296.0 /* 2^32 as a double */
+
+/*
+ * Use 64 bit integers if available. Solaris on SPARC has a problem
+ * compiling parsesolaris.c if ntp_fp.h includes math.h, due to
+ * archaic gets() and printf() prototypes used in Solaris kernel
+ * headers. So far the problem has only been seen with gcc, but it
+ * may also affect Sun compilers, in which case the defined(__GNUC__)
+ * term should be removed.
+ */
+#if defined(HAVE_U_INT64) && \
+ !(defined(__SVR4) && defined(__sun) && \
+ defined(sparc) && defined(__GNUC__))
+
+#include <math.h> /* ldexp() */
+
+#define M_DTOLFP(d, r_ui, r_uf) /* double to l_fp */ \
+ do { \
+ double d_tmp; \
+ u_int64 q_tmp; \
+ int M_isneg; \
+ \
+ d_tmp = (d); \
+ M_isneg = (d_tmp < 0.); \
+ if (M_isneg) { \
+ d_tmp = -d_tmp; \
+ } \
+ q_tmp = (u_int64)ldexp(d_tmp, 32); \
+ if (M_isneg) { \
+ q_tmp = ~q_tmp + 1; \
+ } \
+ (r_uf) = (u_int32)q_tmp; \
+ (r_ui) = (u_int32)(q_tmp >> 32); \
+ } while (FALSE)
+
+#define M_LFPTOD(r_ui, r_uf, d) /* l_fp to double */ \
+ do { \
+ double d_tmp; \
+ u_int64 q_tmp; \
+ int M_isneg; \
+ \
+ q_tmp = ((u_int64)(r_ui) << 32) + (r_uf); \
+ M_isneg = M_ISNEG(r_ui); \
+ if (M_isneg) { \
+ q_tmp = ~q_tmp + 1; \
+ } \
+ d_tmp = ldexp((double)q_tmp, -32); \
+ if (M_isneg) { \
+ d_tmp = -d_tmp; \
+ } \
+ (d) = d_tmp; \
+ } while (FALSE)
+
+#else /* use only 32 bit unsigned values */
+
+#define M_DTOLFP(d, r_ui, r_uf) /* double to l_fp */ \
+ do { \
+ double d_tmp; \
+ if ((d_tmp = (d)) < 0) { \
+ (r_ui) = (u_int32)(-d_tmp); \
+ (r_uf) = (u_int32)(-(d_tmp + (double)(r_ui)) * FRAC); \
+ M_NEG((r_ui), (r_uf)); \
+ } else { \
+ (r_ui) = (u_int32)d_tmp; \
+ (r_uf) = (u_int32)((d_tmp - (double)(r_ui)) * FRAC); \
+ } \
+ } while (0)
+#define M_LFPTOD(r_ui, r_uf, d) /* l_fp to double */ \
+ do { \
+ u_int32 l_thi, l_tlo; \
+ l_thi = (r_ui); l_tlo = (r_uf); \
+ if (M_ISNEG(l_thi)) { \
+ M_NEG(l_thi, l_tlo); \
+ (d) = -((double)l_thi + (double)l_tlo / FRAC); \
+ } else { \
+ (d) = (double)l_thi + (double)l_tlo / FRAC; \
+ } \
+ } while (0)
+#endif
+
+#define DTOLFP(d, v) M_DTOLFP((d), (v)->l_ui, (v)->l_uf)
+#define LFPTOD(v, d) M_LFPTOD((v)->l_ui, (v)->l_uf, (d))
+
+/*
+ * Prototypes
+ */
+extern char * dofptoa (u_fp, int, short, int);
+extern char * dolfptoa (u_int32, u_int32, int, short, int);
+
+extern int atolfp (const char *, l_fp *);
+extern int buftvtots (const char *, l_fp *);
+extern char * fptoa (s_fp, short);
+extern char * fptoms (s_fp, short);
+extern int hextolfp (const char *, l_fp *);
+extern void gpstolfp (int, int, unsigned long, l_fp *);
+extern int mstolfp (const char *, l_fp *);
+extern char * prettydate (l_fp *);
+extern char * gmprettydate (l_fp *);
+extern char * uglydate (l_fp *);
+extern void mfp_mul (int32 *, u_int32 *, int32, u_int32, int32, u_int32);
+
+extern void set_sys_fuzz (double);
+extern void init_systime (void);
+extern void get_systime (l_fp *);
+extern int step_systime (double);
+extern int adj_systime (double);
+
+extern struct tm * ntp2unix_tm (u_int32 ntp, int local);
+
+#define lfptoa(fpv, ndec) mfptoa((fpv)->l_ui, (fpv)->l_uf, (ndec))
+#define lfptoms(fpv, ndec) mfptoms((fpv)->l_ui, (fpv)->l_uf, (ndec))
+
+#define stoa(addr) socktoa(addr)
+#define ntoa(addr) stoa(addr)
+#define sptoa(addr) sockporttoa(addr)
+#define stohost(addr) socktohost(addr)
+
+#define ufptoa(fpv, ndec) dofptoa((fpv), 0, (ndec), 0)
+#define ufptoms(fpv, ndec) dofptoa((fpv), 0, (ndec), 1)
+#define ulfptoa(fpv, ndec) dolfptoa((fpv)->l_ui, (fpv)->l_uf, 0, (ndec), 0)
+#define ulfptoms(fpv, ndec) dolfptoa((fpv)->l_ui, (fpv)->l_uf, 0, (ndec), 1)
+#define umfptoa(fpi, fpf, ndec) dolfptoa((fpi), (fpf), 0, (ndec), 0)
+
+/*
+ * Optional callback from libntp step_systime() to ntpd. Optional
+* because other libntp clients like ntpdate don't use it.
+ */
+typedef void (*time_stepped_callback)(void);
+extern time_stepped_callback step_callback;
+
+/*
+ * Multi-thread locking for get_systime()
+ *
+ * On most systems, get_systime() is used solely by the main ntpd
+ * thread, but on Windows it's also used by the dedicated I/O thread.
+ * The [Bug 2037] changes to get_systime() have it keep state between
+ * calls to ensure time moves in only one direction, which means its
+ * use on Windows needs to be protected against simultaneous execution
+ * to avoid falsely detecting Lamport violations by ensuring only one
+ * thread at a time is in get_systime().
+ */
+#ifdef SYS_WINNT
+extern CRITICAL_SECTION get_systime_cs;
+# define INIT_GET_SYSTIME_CRITSEC() \
+ InitializeCriticalSection(&get_systime_cs)
+# define ENTER_GET_SYSTIME_CRITSEC() \
+ EnterCriticalSection(&get_systime_cs)
+# define LEAVE_GET_SYSTIME_CRITSEC() \
+ LeaveCriticalSection(&get_systime_cs)
+# define INIT_WIN_PRECISE_TIME() \
+ init_win_precise_time()
+#else /* !SYS_WINNT follows */
+# define INIT_GET_SYSTIME_CRITSEC() \
+ do {} while (FALSE)
+# define ENTER_GET_SYSTIME_CRITSEC() \
+ do {} while (FALSE)
+# define LEAVE_GET_SYSTIME_CRITSEC() \
+ do {} while (FALSE)
+# define INIT_WIN_PRECISE_TIME() \
+ do {} while (FALSE)
+#endif
+
+#endif /* NTP_FP_H */
diff --git a/include/ntp_if.h b/include/ntp_if.h
new file mode 100644
index 0000000..3af5865
--- /dev/null
+++ b/include/ntp_if.h
@@ -0,0 +1,27 @@
+/*
+ * Sockets are not standard.
+ * So hide uglyness in include file.
+ */
+/* was: defined(SYS_CONVEXOS9) */
+#if defined(HAVE__SYS_SYNC_QUEUE_H) && defined(HAVE__SYS_SYNC_SEMA_H)
+# include "/sys/sync/queue.h"
+# include "/sys/sync/sema.h"
+#endif
+
+/* was: (defined(SYS_SOLARIS) && !defined(bsd)) || defined(SYS_SUNOS4) */
+/* was: defined(SYS_UNIXWARE1) */
+#ifdef HAVE_SYS_SOCKIO_H
+# include <sys/sockio.h>
+#endif
+
+/* was: #if defined(SYS_PTX) || defined(SYS_SINIXM) */
+#ifdef HAVE_SYS_STREAM_H
+# include <sys/stream.h>
+#endif
+#ifdef HAVE_SYS_STROPTS_H
+# include <sys/stropts.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif /* HAVE_NET_IF_H */
diff --git a/include/ntp_intres.h b/include/ntp_intres.h
new file mode 100644
index 0000000..1b6bd66
--- /dev/null
+++ b/include/ntp_intres.h
@@ -0,0 +1,45 @@
+/*
+ * ntp_intres.h - client interface to blocking-worker name resolution.
+ */
+#ifndef NTP_INTRES_H
+#define NTP_INTRES_H
+
+#include <ntp_worker.h>
+
+#ifdef WORKER
+#define INITIAL_DNS_RETRY 2 /* seconds between queries */
+
+/*
+ * you call getaddrinfo_sometime(name, service, &hints, retry, callback_func, context);
+ * later (*callback_func)(rescode, gai_errno, context, name, service, hints, ai_result) is called.
+ */
+typedef void (*gai_sometime_callback)
+ (int, int, void *, const char *, const char *,
+ const struct addrinfo *, const struct addrinfo *);
+extern int getaddrinfo_sometime(const char *, const char *,
+ const struct addrinfo *, int,
+ gai_sometime_callback, void *);
+/*
+ * In gai_sometime_callback routines, the resulting addrinfo list is
+ * only available until the callback returns. To hold on to the list
+ * of addresses after the callback returns, use copy_addrinfo_list():
+ *
+ * struct addrinfo *copy_addrinfo_list(const struct addrinfo *);
+ */
+
+
+/*
+ * you call getnameinfo_sometime(sockaddr, namelen, servlen, flags, callback_func, context);
+ * later (*callback_func)(rescode, gni_errno, sockaddr, flags, name, service, context) is called.
+ */
+typedef void (*gni_sometime_callback)
+ (int, int, sockaddr_u *, int, const char *,
+ const char *, void *);
+extern int getnameinfo_sometime(sockaddr_u *, size_t, size_t, int,
+ gni_sometime_callback, void *);
+#endif /* WORKER */
+
+/* intres_timeout_req() is provided by the client, ntpd or sntp. */
+extern void intres_timeout_req(u_int);
+
+#endif /* NTP_INTRES_H */
diff --git a/include/ntp_io.h b/include/ntp_io.h
new file mode 100644
index 0000000..2cdca71
--- /dev/null
+++ b/include/ntp_io.h
@@ -0,0 +1,97 @@
+#ifndef NTP_IO_H
+#define NTP_IO_H
+
+#include "ntp_workimpl.h"
+
+/*
+ * POSIX says use <fnct.h> to get O_* symbols and
+ * SEEK_SET symbol form <unistd.h>.
+ */
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#if !defined(SEEK_SET) && defined(L_SET)
+# define SEEK_SET L_SET
+#endif
+
+#ifdef SYS_WINNT
+# include <io.h>
+# include "win32_io.h"
+#endif
+
+#include <isc/boolean.h>
+#include <isc/netaddr.h>
+
+#if defined(HAVE_NETINET_IN_H) && defined(HAVE_NETINET_IP_H)
+# include <netinet/in.h>
+# ifdef HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+# endif
+# include <netinet/ip.h>
+#endif
+
+#include "libntp.h" /* This needs Something above for GETDTABLESIZE */
+
+/*
+ * Define FNDELAY and FASYNC using O_NONBLOCK and O_ASYNC if we need
+ * to (and can). This is here initially for QNX, but may help for
+ * others as well...
+ */
+#ifndef FNDELAY
+# ifdef O_NONBLOCK
+# define FNDELAY O_NONBLOCK
+# endif
+#endif
+
+#ifndef FASYNC
+# ifdef O_ASYNC
+# define FASYNC O_ASYNC
+# endif
+#endif
+
+
+/*
+ * NIC rule match types
+ */
+typedef enum {
+ MATCH_ALL,
+ MATCH_IPV4,
+ MATCH_IPV6,
+ MATCH_WILDCARD,
+ MATCH_IFNAME,
+ MATCH_IFADDR
+} nic_rule_match;
+
+/*
+ * NIC rule actions
+ */
+typedef enum {
+ ACTION_LISTEN,
+ ACTION_IGNORE,
+ ACTION_DROP
+} nic_rule_action;
+
+
+SOCKET move_fd(SOCKET fd);
+isc_boolean_t get_broadcastclient_flag(void);
+extern int is_ip_address(const char *, u_short, sockaddr_u *);
+extern void sau_from_netaddr(sockaddr_u *, const isc_netaddr_t *);
+extern void add_nic_rule(nic_rule_match match_type,
+ const char *if_name, int prefixlen,
+ nic_rule_action action);
+#ifndef HAVE_IO_COMPLETION_PORT
+extern void maintain_activefds(int fd, int closing);
+#else
+#define maintain_activefds(f, c) do {} while (0)
+#endif
+
+
+#endif /* NTP_IO_H */
diff --git a/include/ntp_libopts.h b/include/ntp_libopts.h
new file mode 100644
index 0000000..b03b2f6
--- /dev/null
+++ b/include/ntp_libopts.h
@@ -0,0 +1,14 @@
+/*
+ * ntp_libopts.h
+ *
+ * Common code interfacing with Autogen's libopts command-line option
+ * processing.
+ */
+#ifndef NTP_LIBOPTS_H
+# define NTP_LIBOPTS_H
+# include "autoopts/options.h"
+
+extern int ntpOptionProcess(tOptions *pOpts, int argc,
+ char ** argv);
+extern void ntpOptionPrintVersion(tOptions *, tOptDesc *);
+#endif
diff --git a/include/ntp_lineedit.h b/include/ntp_lineedit.h
new file mode 100644
index 0000000..623c6f4
--- /dev/null
+++ b/include/ntp_lineedit.h
@@ -0,0 +1,13 @@
+
+/*
+ * ntp_lineedit.h - generic interface to various line editing libs
+ */
+
+int ntp_readline_init(const char *prompt);
+void ntp_readline_uninit(void);
+
+/*
+ * strings returned by ntp_readline go home to free()
+ */
+char * ntp_readline(int *pcount);
+
diff --git a/include/ntp_lists.h b/include/ntp_lists.h
new file mode 100644
index 0000000..2b6e616
--- /dev/null
+++ b/include/ntp_lists.h
@@ -0,0 +1,443 @@
+/*
+ * ntp_lists.h - linked lists common code
+ *
+ * SLIST: singly-linked lists
+ * ==========================
+ *
+ * These macros implement a simple singly-linked list template. Both
+ * the listhead and per-entry next fields are declared as pointers to
+ * the list entry struct type. Initialization to NULL is typically
+ * implicit (for globals and statics) or handled by zeroing of the
+ * containing structure.
+ *
+ * The name of the next link field is passed as an argument to allow
+ * membership in several lists at once using multiple next link fields.
+ *
+ * When possible, placing the link field first in the entry structure
+ * allows slightly smaller code to be generated on some platforms.
+ *
+ * LINK_SLIST(listhead, pentry, nextlink)
+ * add entry at head
+ *
+ * LINK_TAIL_SLIST(listhead, pentry, nextlink, entrytype)
+ * add entry at tail. This is O(n), if this is a common
+ * operation the FIFO template may be more appropriate.
+ *
+ * LINK_SORT_SLIST(listhead, pentry, beforecur, nextlink, entrytype)
+ * add entry in sorted order. beforecur is an expression comparing
+ * pentry with the current list entry. The current entry can be
+ * referenced within beforecur as L_S_S_CUR(), which is short for
+ * LINK_SORT_SLIST_CUR(). beforecur is nonzero if pentry sorts
+ * before L_S_S_CUR().
+ *
+ * UNLINK_HEAD_SLIST(punlinked, listhead, nextlink)
+ * unlink first entry and point punlinked to it, or set punlinked
+ * to NULL if the list is empty.
+ *
+ * UNLINK_SLIST(punlinked, listhead, ptounlink, nextlink, entrytype)
+ * unlink entry pointed to by ptounlink. punlinked is set to NULL
+ * if the entry is not found on the list, otherwise it is set to
+ * ptounlink.
+ *
+ * UNLINK_EXPR_SLIST(punlinked, listhead, expr, nextlink, entrytype)
+ * unlink entry where expression expr is nonzero. expr can refer
+ * to the entry being tested using UNLINK_EXPR_SLIST_CURRENT(),
+ * alias U_E_S_CUR(). See the implementation of UNLINK_SLIST()
+ * below for an example. U_E_S_CUR() is NULL iff the list is empty.
+ * punlinked is pointed to the removed entry or NULL if none
+ * satisfy expr.
+ *
+ * FIFO: singly-linked lists plus tail pointer
+ * ===========================================
+ *
+ * This is the same as FreeBSD's sys/queue.h STAILQ -- a singly-linked
+ * list implementation with tail-pointer maintenance, so that adding
+ * at the tail for first-in, first-out access is O(1).
+ *
+ * DECL_FIFO_ANCHOR(entrytype)
+ * provides the type specification portion of the declaration for
+ * a variable to refer to a FIFO queue (similar to listhead). The
+ * anchor contains the head and indirect tail pointers. Example:
+ *
+ * #include "ntp_lists.h"
+ *
+ * typedef struct myentry_tag myentry;
+ * struct myentry_tag {
+ * myentry *next_link;
+ * ...
+ * };
+ *
+ * DECL_FIFO_ANCHOR(myentry) my_fifo;
+ *
+ * void somefunc(myentry *pentry)
+ * {
+ * LINK_FIFO(my_fifo, pentry, next_link);
+ * }
+ *
+ * If DECL_FIFO_ANCHOR is used with stack or heap storage, it
+ * should be initialized to NULL pointers using a = { NULL };
+ * initializer or memset.
+ *
+ * HEAD_FIFO(anchor)
+ * TAIL_FIFO(anchor)
+ * Pointer to first/last entry, NULL if FIFO is empty.
+ *
+ * LINK_FIFO(anchor, pentry, nextlink)
+ * add entry at tail.
+ *
+ * UNLINK_FIFO(punlinked, anchor, nextlink)
+ * unlink head entry and point punlinked to it, or set punlinked
+ * to NULL if the list is empty.
+ *
+ * CONCAT_FIFO(q1, q2, nextlink)
+ * empty fifoq q2 moving its nodes to q1 following q1's existing
+ * nodes.
+ *
+ * DLIST: doubly-linked lists
+ * ==========================
+ *
+ * Elements on DLISTs always have non-NULL forward and back links,
+ * because both link chains are circular. The beginning/end is marked
+ * by the listhead, which is the same type as elements for simplicity.
+ * An empty list's listhead has both links set to its own address.
+ *
+ *
+ */
+#ifndef NTP_LISTS_H
+#define NTP_LISTS_H
+
+#include "ntp_types.h" /* TRUE and FALSE */
+#include "ntp_assert.h"
+
+#ifdef DEBUG
+# define NTP_DEBUG_LISTS_H
+#endif
+
+/*
+ * If list debugging is not enabled, save a little time by not clearing
+ * an entry's link pointer when it is unlinked, as the stale pointer
+ * is harmless as long as it is ignored when the entry is not in a
+ * list.
+ */
+#ifndef NTP_DEBUG_LISTS_H
+#define MAYBE_Z_LISTS(p) do { } while (FALSE)
+#else
+#define MAYBE_Z_LISTS(p) (p) = NULL
+#endif
+
+#define LINK_SLIST(listhead, pentry, nextlink) \
+do { \
+ (pentry)->nextlink = (listhead); \
+ (listhead) = (pentry); \
+} while (FALSE)
+
+#define LINK_TAIL_SLIST(listhead, pentry, nextlink, entrytype) \
+do { \
+ entrytype **pptail; \
+ \
+ pptail = &(listhead); \
+ while (*pptail != NULL) \
+ pptail = &((*pptail)->nextlink); \
+ \
+ (pentry)->nextlink = NULL; \
+ *pptail = (pentry); \
+} while (FALSE)
+
+#define LINK_SORT_SLIST_CURRENT() (*ppentry)
+#define L_S_S_CUR() LINK_SORT_SLIST_CURRENT()
+
+#define LINK_SORT_SLIST(listhead, pentry, beforecur, nextlink, \
+ entrytype) \
+do { \
+ entrytype **ppentry; \
+ \
+ ppentry = &(listhead); \
+ while (TRUE) { \
+ if (NULL == *ppentry || (beforecur)) { \
+ (pentry)->nextlink = *ppentry; \
+ *ppentry = (pentry); \
+ break; \
+ } \
+ ppentry = &((*ppentry)->nextlink); \
+ if (NULL == *ppentry) { \
+ (pentry)->nextlink = NULL; \
+ *ppentry = (pentry); \
+ break; \
+ } \
+ } \
+} while (FALSE)
+
+#define UNLINK_HEAD_SLIST(punlinked, listhead, nextlink) \
+do { \
+ (punlinked) = (listhead); \
+ if (NULL != (punlinked)) { \
+ (listhead) = (punlinked)->nextlink; \
+ MAYBE_Z_LISTS((punlinked)->nextlink); \
+ } \
+} while (FALSE)
+
+#define UNLINK_EXPR_SLIST_CURRENT() (*ppentry)
+#define U_E_S_CUR() UNLINK_EXPR_SLIST_CURRENT()
+
+#define UNLINK_EXPR_SLIST(punlinked, listhead, expr, nextlink, \
+ entrytype) \
+do { \
+ entrytype **ppentry; \
+ \
+ ppentry = &(listhead); \
+ \
+ while (!(expr)) \
+ if (*ppentry != NULL && \
+ (*ppentry)->nextlink != NULL) { \
+ ppentry = &((*ppentry)->nextlink); \
+ } else { \
+ ppentry = NULL; \
+ break; \
+ } \
+ \
+ if (ppentry != NULL) { \
+ (punlinked) = *ppentry; \
+ *ppentry = (punlinked)->nextlink; \
+ MAYBE_Z_LISTS((punlinked)->nextlink); \
+ } else { \
+ (punlinked) = NULL; \
+ } \
+} while (FALSE)
+
+#define UNLINK_SLIST(punlinked, listhead, ptounlink, nextlink, \
+ entrytype) \
+ UNLINK_EXPR_SLIST(punlinked, listhead, (ptounlink) == \
+ U_E_S_CUR(), nextlink, entrytype)
+
+#define CHECK_SLIST(listhead, nextlink, entrytype) \
+do { \
+ entrytype *pentry; \
+ \
+ for (pentry = (listhead); \
+ pentry != NULL; \
+ pentry = pentry->nextlink){ \
+ NTP_INSIST(pentry != pentry->nextlink); \
+ NTP_INSIST((listhead) != pentry->nextlink); \
+ } \
+} while (FALSE)
+
+/*
+ * FIFO
+ */
+
+#define DECL_FIFO_ANCHOR(entrytype) \
+struct { \
+ entrytype * phead; /* NULL if list empty */ \
+ entrytype ** pptail; /* NULL if list empty */ \
+}
+
+#define HEAD_FIFO(anchor) ((anchor).phead)
+#define TAIL_FIFO(anchor) ((NULL == (anchor).pptail) \
+ ? NULL \
+ : *((anchor).pptail))
+
+/*
+ * For DEBUG builds only, verify both or neither of the anchor pointers
+ * are NULL with each operation.
+ */
+#if !defined(NTP_DEBUG_LISTS_H)
+#define CHECK_FIFO_CONSISTENCY(anchor) do { } while (FALSE)
+#else
+#define CHECK_FIFO_CONSISTENCY(anchor) \
+ check_gen_fifo_consistency(&(anchor))
+void check_gen_fifo_consistency(void *fifo);
+#endif
+
+/*
+ * generic FIFO element used to access any FIFO where each element
+ * begins with the link pointer
+ */
+typedef struct gen_node_tag gen_node;
+struct gen_node_tag {
+ gen_node * link;
+};
+
+/* generic FIFO */
+typedef DECL_FIFO_ANCHOR(gen_node) gen_fifo;
+
+
+#define LINK_FIFO(anchor, pentry, nextlink) \
+do { \
+ CHECK_FIFO_CONSISTENCY(anchor); \
+ \
+ (pentry)->nextlink = NULL; \
+ if (NULL != (anchor).pptail) { \
+ (*((anchor).pptail))->nextlink = (pentry); \
+ (anchor).pptail = \
+ &(*((anchor).pptail))->nextlink; \
+ } else { \
+ (anchor).phead = (pentry); \
+ (anchor).pptail = &(anchor).phead; \
+ } \
+ \
+ CHECK_FIFO_CONSISTENCY(anchor); \
+} while (FALSE)
+
+#define UNLINK_FIFO(punlinked, anchor, nextlink) \
+do { \
+ CHECK_FIFO_CONSISTENCY(anchor); \
+ \
+ (punlinked) = (anchor).phead; \
+ if (NULL != (punlinked)) { \
+ (anchor).phead = (punlinked)->nextlink; \
+ if (NULL == (anchor).phead) \
+ (anchor).pptail = NULL; \
+ else if ((anchor).pptail == \
+ &(punlinked)->nextlink) \
+ (anchor).pptail = &(anchor).phead; \
+ MAYBE_Z_LISTS((punlinked)->nextlink); \
+ CHECK_FIFO_CONSISTENCY(anchor); \
+ } \
+} while (FALSE)
+
+#define UNLINK_MID_FIFO(punlinked, anchor, tounlink, nextlink, \
+ entrytype) \
+do { \
+ entrytype **ppentry; \
+ \
+ CHECK_FIFO_CONSISTENCY(anchor); \
+ \
+ ppentry = &(anchor).phead; \
+ \
+ while ((tounlink) != *ppentry) \
+ if ((*ppentry)->nextlink != NULL) { \
+ ppentry = &((*ppentry)->nextlink); \
+ } else { \
+ ppentry = NULL; \
+ break; \
+ } \
+ \
+ if (ppentry != NULL) { \
+ (punlinked) = *ppentry; \
+ *ppentry = (punlinked)->nextlink; \
+ if (NULL == *ppentry) \
+ (anchor).pptail = NULL; \
+ else if ((anchor).pptail == \
+ &(punlinked)->nextlink) \
+ (anchor).pptail = &(anchor).phead; \
+ MAYBE_Z_LISTS((punlinked)->nextlink); \
+ CHECK_FIFO_CONSISTENCY(anchor); \
+ } else { \
+ (punlinked) = NULL; \
+ } \
+} while (FALSE)
+
+#define CONCAT_FIFO(f1, f2, nextlink) \
+do { \
+ CHECK_FIFO_CONSISTENCY(f1); \
+ CHECK_FIFO_CONSISTENCY(f2); \
+ \
+ if ((f2).pptail != NULL) { \
+ if ((f1).pptail != NULL) { \
+ (*(f1).pptail)->nextlink = (f2).phead; \
+ if ((f2).pptail == &(f2).phead) \
+ (f1).pptail = \
+ &(*(f1).pptail)->nextlink; \
+ else \
+ (f1).pptail = (f2).pptail; \
+ CHECK_FIFO_CONSISTENCY(f1); \
+ } else { \
+ (f1) = (f2); \
+ } \
+ MAYBE_Z_LISTS((f2).phead); \
+ MAYBE_Z_LISTS((f2).pptail); \
+ } \
+} while (FALSE)
+
+/*
+ * DLIST
+ */
+#define DECL_DLIST_LINK(entrytype, link) \
+struct { \
+ entrytype * b; \
+ entrytype * f; \
+} link
+
+#define INIT_DLIST(listhead, link) \
+do { \
+ (listhead).link.f = &(listhead); \
+ (listhead).link.b = &(listhead); \
+} while (FALSE)
+
+#define HEAD_DLIST(listhead, link) \
+ ( \
+ (&(listhead) != (listhead).link.f) \
+ ? (listhead).link.f \
+ : NULL \
+ )
+
+#define TAIL_DLIST(listhead, link) \
+ ( \
+ (&(listhead) != (listhead).link.b) \
+ ? (listhead).link.b \
+ : NULL \
+ )
+
+#define NEXT_DLIST(listhead, entry, link) \
+ ( \
+ (&(listhead) != (entry)->link.f) \
+ ? (entry)->link.f \
+ : NULL \
+ )
+
+#define PREV_DLIST(listhead, entry, link) \
+ ( \
+ (&(listhead) != (entry)->link.b) \
+ ? (entry)->link.b \
+ : NULL \
+ )
+
+#define LINK_DLIST(listhead, pentry, link) \
+do { \
+ (pentry)->link.f = (listhead).link.f; \
+ (pentry)->link.b = &(listhead); \
+ (listhead).link.f->link.b = (pentry); \
+ (listhead).link.f = (pentry); \
+} while (FALSE)
+
+#define LINK_TAIL_DLIST(listhead, pentry, link) \
+do { \
+ (pentry)->link.b = (listhead).link.b; \
+ (pentry)->link.f = &(listhead); \
+ (listhead).link.b->link.f = (pentry); \
+ (listhead).link.b = (pentry); \
+} while (FALSE)
+
+#define UNLINK_DLIST(ptounlink, link) \
+do { \
+ (ptounlink)->link.b->link.f = (ptounlink)->link.f; \
+ (ptounlink)->link.f->link.b = (ptounlink)->link.b; \
+ MAYBE_Z_LISTS((ptounlink)->link.b); \
+ MAYBE_Z_LISTS((ptounlink)->link.f); \
+} while (FALSE)
+
+#define ITER_DLIST_BEGIN(listhead, iter, link, entrytype) \
+{ \
+ entrytype *i_dl_nextiter; \
+ \
+ for ((iter) = (listhead).link.f; \
+ (iter) != &(listhead) \
+ && ((i_dl_nextiter = (iter)->link.f), TRUE); \
+ (iter) = i_dl_nextiter) {
+#define ITER_DLIST_END() \
+ } \
+}
+
+#define REV_ITER_DLIST_BEGIN(listhead, iter, link, entrytype) \
+{ \
+ entrytype *i_dl_nextiter; \
+ \
+ for ((iter) = (listhead).link.b; \
+ (iter) != &(listhead) \
+ && ((i_dl_nextiter = (iter)->link.b), TRUE); \
+ (iter) = i_dl_nextiter) {
+#define REV_ITER_DLIST_END() \
+ } \
+}
+
+#endif /* NTP_LISTS_H */
diff --git a/include/ntp_machine.h b/include/ntp_machine.h
new file mode 100644
index 0000000..c5e7248
--- /dev/null
+++ b/include/ntp_machine.h
@@ -0,0 +1,297 @@
+/*
+ * ntp_machine.h
+ *
+ * Collect all machine dependent idiosyncrasies in one place.
+ *
+ * The functionality formerly in this file is mostly handled by
+ * Autoconf these days.
+ */
+
+#ifndef NTP_MACHINE_H
+#define NTP_MACHINE_H
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+
+#include "ntp_proto.h"
+
+/*
+
+ HEY! CHECK THIS OUT!
+
+ The per-system SYS_* #defins ARE NO LONGER USED, with the temporary
+ exception of SYS_WINNT.
+
+ If you find a hunk of code that is bracketed by a SYS_* macro and you
+ *know* that it is still needed, please let us know. In many cases the
+ code fragment is now handled somewhere else by autoconf choices.
+
+*/
+
+/*
+
+HOW TO GET IP INTERFACE INFORMATION
+
+ Some UNIX V.4 machines implement a sockets library on top of
+ streams. For these systems, you must use send the SIOCGIFCONF down
+ the stream in an I_STR ioctl. This ususally also implies
+ USE_STREAMS_DEVICE FOR IF_CONFIG. Dell UNIX is a notable exception.
+
+WHAT DOES IOCTL(SIOCGIFCONF) RETURN IN THE BUFFER
+
+ UNIX V.4 machines implement a sockets library on top of streams.
+ When requesting the IP interface configuration with an ioctl(2) calll,
+ an array of ifreq structures are placed in the provided buffer. Some
+ implementations also place the length of the buffer information in
+ the first integer position of the buffer.
+
+ SIZE_RETURNED_IN_BUFFER - size integer is in the buffer
+
+WILL IOCTL(SIOCGIFCONF) WORK ON A SOCKET
+
+ Some UNIX V.4 machines do not appear to support ioctl() requests for the
+ IP interface configuration on a socket. They appear to require the use
+ of the streams device instead.
+
+ USE_STREAMS_DEVICE_FOR_IF_CONFIG - use the /dev/ip device for configuration
+
+MISC
+
+ DOSYNCTODR - Resync TODR clock every hour.
+ RETSIGTYPE - Define signal function type.
+ NO_SIGNED_CHAR_DECL - No "signed char" see include/ntp.h
+ LOCK_PROCESS - Have plock.
+*/
+
+int ntp_set_tod (struct timeval *tvp, void *tzp);
+
+/*casey Tue May 27 15:45:25 SAT 1997*/
+#ifdef SYS_VXWORKS
+
+/* casey's new defines */
+#define NO_MAIN_ALLOWED 1
+#define NO_NETDB 1
+#define NO_RENAME 1
+
+/* in vxWorks we use FIONBIO, but the others are defined for old systems, so
+ * all hell breaks loose if we leave them defined we define USE_FIONBIO to
+ * undefine O_NONBLOCK FNDELAY O_NDELAY where necessary.
+ */
+#define USE_FIONBIO 1
+/* end my new defines */
+
+#define TIMEOFDAY 0x0 /* system wide realtime clock */
+#define HAVE_GETCLOCK 1 /* configure does not set this ... */
+#define HAVE_NO_NICE 1 /* configure does not set this ... */
+#define HAVE_RANDOM 1 /* configure does not set this ... */
+#define HAVE_SRANDOM 1 /* configure does not set this ... */
+
+/* vxWorks specific additions to take care of its
+ * unix (non)complicance
+ */
+
+#include "vxWorks.h"
+#include "ioLib.h"
+#include "taskLib.h"
+#include "time.h"
+
+extern int sysClkRateGet ();
+
+/* usrtime.h
+ * Bob Herlien's excellent time code find it at:
+ * ftp://ftp.atd.ucar.edu/pub/vxworks/vx/usrTime.shar
+ * I would recommend this instead of clock_[g|s]ettime() plus you get
+ * adjtime() too ... casey
+ */
+/*
+extern int gettimeofday ( struct timeval *tp, struct timezone *tzp );
+extern int settimeofday (struct timeval *, struct timezone *);
+extern int adjtime ( struct timeval *delta, struct timeval *olddelta );
+ */
+
+/* in machines.c */
+extern void sleep (int seconds);
+extern void alarm (int seconds);
+/* machines.c */
+
+
+/* this is really this */
+#define getpid taskIdSelf
+#define getclock clock_gettime
+#define fcntl ioctl
+#define _getch getchar
+
+/* define this away for vxWorks */
+#define openlog(x,y)
+/* use local defines for these */
+#undef min
+#undef max
+
+#endif /* SYS_VXWORKS */
+
+#ifdef NO_NETDB
+/* These structures are needed for gethostbyname() etc... */
+/* structures used by netdb.h */
+struct hostent {
+ char *h_name; /* official name of host */
+ char **h_aliases; /* alias list */
+ int h_addrtype; /* host address type */
+ int h_length; /* length of address */
+ char **h_addr_list; /* list of addresses from name server */
+#define h_addr h_addr_list[0] /* address, for backward compatibility */
+};
+
+struct servent {
+ char *s_name; /* official service name */
+ char **s_aliases; /* alias list */
+ int s_port; /* port # */
+ char *s_proto; /* protocol to use */
+};
+extern int h_errno;
+
+#define TRY_AGAIN 2
+
+struct hostent *gethostbyname (char * netnum);
+struct hostent *gethostbyaddr (char * netnum, int size, int addr_type);
+/* type is the protocol */
+struct servent *getservbyname (char *name, char *type);
+#endif /* NO_NETDB */
+
+#ifdef NO_MAIN_ALLOWED
+/* we have no main routines so lets make a plan */
+#define CALL(callname, progname, callmain) \
+ extern int callmain (int,char**); \
+ void callname (a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
+ char *a0; \
+ char *a1; \
+ char *a2; \
+ char *a3; \
+ char *a4; \
+ char *a5; \
+ char *a6; \
+ char *a7; \
+ char *a8; \
+ char *a9; \
+ char *a10; \
+ { \
+ char *x[11]; \
+ int argc; \
+ char *argv[] = {progname,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; \
+ int i; \
+ for (i=0;i<11;i++) \
+ x[i] = NULL; \
+ x[0] = a0; \
+ x[1] = a1; \
+ x[2] = a2; \
+ x[3] = a3; \
+ x[4] = a4; \
+ x[5] = a5; \
+ x[6] = a6; \
+ x[7] = a7; \
+ x[8] = a8; \
+ x[9] = a9; \
+ x[10] = a10; \
+ argc=1; \
+ for (i=0; i<11;i++) \
+ if (x[i]) \
+ { \
+ argv[argc++] = x[i]; \
+ } \
+ callmain(argc,argv); \
+ }
+#endif /* NO_MAIN_ALLOWED */
+/*casey Tue May 27 15:45:25 SAT 1997*/
+
+/*
+ * Here's where autoconfig starts to take over
+ */
+#ifdef HAVE_SYS_STROPTS_H
+# ifdef HAVE_SYS_STREAM_H
+# define STREAM
+# endif
+#endif
+
+#ifndef RETSIGTYPE
+# if defined(NTP_POSIX_SOURCE)
+# define RETSIGTYPE void
+# else
+# define RETSIGTYPE int
+# endif
+#endif
+
+#ifdef NTP_SYSCALLS_STD
+# ifndef NTP_SYSCALL_GET
+# define NTP_SYSCALL_GET 235
+# endif
+# ifndef NTP_SYSCALL_ADJ
+# define NTP_SYSCALL_ADJ 236
+# endif
+#endif /* NTP_SYSCALLS_STD */
+
+#ifdef MPE
+# include <sys/types.h>
+# include <netinet/in.h>
+# include <stdio.h>
+# include <time.h>
+
+/* missing functions that are easily renamed */
+
+# define _getch getchar
+
+/* special functions that require MPE-specific wrappers */
+
+# define bind __ntp_mpe_bind
+# define fcntl __ntp_mpe_fcntl
+
+/* standard macros missing from MPE include files */
+
+# define IN_CLASSD(i) ((((long)(i))&0xf0000000)==0xe0000000)
+# define IN_MULTICAST IN_CLASSD
+# define ITIMER_REAL 0
+
+/* standard structures missing from MPE include files */
+
+struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+};
+
+/* various declarations to make gcc stop complaining */
+
+extern int __filbuf(FILE *);
+extern int __flsbuf(int, FILE *);
+extern int gethostname(char *, int);
+extern unsigned long inet_addr(char *);
+extern char *strdup(const char *);
+
+/* miscellaneous NTP macros */
+
+# define HAVE_NO_NICE
+#endif /* MPE */
+
+#ifdef HAVE_RTPRIO
+# define HAVE_NO_NICE
+#else
+# ifdef HAVE_SETPRIORITY
+# define HAVE_BSD_NICE
+# else
+# ifdef HAVE_NICE
+# define HAVE_ATT_NICE
+# endif
+# endif
+#endif
+
+#if !defined(HAVE_ATT_NICE) \
+ && !defined(HAVE_BSD_NICE) \
+ && !defined(HAVE_NO_NICE)
+#include "ERROR: You must define one of the HAVE_xx_NICE defines!"
+#endif
+
+#ifndef HAVE_TIMEGM
+extern time_t timegm (struct tm *);
+#endif
+
+
+#endif /* NTP_MACHINE_H */
diff --git a/include/ntp_malloc.h b/include/ntp_malloc.h
new file mode 100644
index 0000000..4cde62e
--- /dev/null
+++ b/include/ntp_malloc.h
@@ -0,0 +1,61 @@
+/*
+ * Define malloc and friends.
+ */
+#ifndef NTP_MALLOC_H
+#define NTP_MALLOC_H
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# endif
+#endif
+
+/*
+ * Deal with platform differences declaring alloca()
+ * This comes nearly verbatim from:
+ *
+ * http://www.gnu.org/software/autoconf/manual/autoconf.html#Particular-Functions
+ *
+ * The only modifications were to remove C++ support and guard against
+ * redefining alloca.
+ */
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+#elif defined _AIX
+# ifndef alloca
+# define alloca __alloca
+# endif
+#elif defined _MSC_VER
+# include <malloc.h>
+# ifndef alloca
+# define alloca _alloca
+# endif
+#else
+# include <stddef.h>
+void * alloca(size_t);
+#endif
+
+#ifdef EREALLOC_IMPL
+# define EREALLOC_CALLSITE /* preserve __FILE__ and __LINE__ */
+#else
+# define EREALLOC_IMPL(ptr, newsz, filenm, loc) \
+ realloc(ptr, (newsz))
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+# define zero_mem(p, s) bzero(p, s)
+#endif
+
+#ifndef zero_mem
+# define zero_mem(p, s) memset(p, 0, s)
+#endif
+#define ZERO(var) zero_mem(&(var), sizeof(var))
+
+#endif /* NTP_MALLOC_H */
diff --git a/include/ntp_md5.h b/include/ntp_md5.h
new file mode 100644
index 0000000..9f43378
--- /dev/null
+++ b/include/ntp_md5.h
@@ -0,0 +1,40 @@
+/*
+ * ntp_md5.h: deal with md5.h headers
+ *
+ * Use the system MD5 if available, otherwise libisc's.
+ */
+#ifndef NTP_MD5_H
+#define NTP_MD5_H
+
+#ifdef OPENSSL
+# include "openssl/evp.h"
+#else /* !OPENSSL follows */
+/*
+ * Provide OpenSSL-alike MD5 API if we're not using OpenSSL
+ */
+# if defined HAVE_MD5_H && defined HAVE_MD5INIT
+# include <md5.h>
+# else
+# include "isc/md5.h"
+ typedef isc_md5_t MD5_CTX;
+# define MD5Init(c) isc_md5_init(c)
+# define MD5Update(c, p, s) isc_md5_update(c, p, s)
+# define MD5Final(d, c) isc_md5_final((c), (d)) /* swapped */
+# endif
+
+ typedef MD5_CTX EVP_MD_CTX;
+# define EVP_get_digestbynid(t) NULL
+# define EVP_md5(v) NULL
+# define EVP_MD_CTX_init(c)
+# define EVP_MD_CTX_set_flags(c, f)
+# define EVP_DigestInit(c, dt) (MD5Init(c), 1)
+# define EVP_DigestInit_ex(c, dt, i) (MD5Init(c), 1)
+# define EVP_DigestUpdate(c, p, s) MD5Update(c, (const void *)(p), \
+ s)
+# define EVP_DigestFinal(c, d, pdl) \
+ do { \
+ MD5Final((d), (c)); \
+ *(pdl) = 16; \
+ } while (0)
+# endif /* !OPENSSL */
+#endif /* NTP_MD5_H */
diff --git a/include/ntp_net.h b/include/ntp_net.h
new file mode 100644
index 0000000..0577402
--- /dev/null
+++ b/include/ntp_net.h
@@ -0,0 +1,238 @@
+/*
+ * ntp_net.h - definitions for NTP network stuff
+ */
+
+#ifndef NTP_NET_H
+#define NTP_NET_H
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef HAVE_NETINET_IN_VAR_H
+#include <netinet/in_var.h>
+#endif
+
+#include "ntp_rfc2553.h"
+#include "ntp_malloc.h"
+
+typedef union {
+ struct sockaddr sa;
+ struct sockaddr_in sa4;
+ struct sockaddr_in6 sa6;
+} sockaddr_u;
+
+/*
+ * Utilities for manipulating sockaddr_u v4/v6 unions
+ */
+#define SOCK_ADDR4(psau) ((psau)->sa4.sin_addr)
+#define SOCK_ADDR6(psau) ((psau)->sa6.sin6_addr)
+
+#define PSOCK_ADDR4(psau) (&SOCK_ADDR4(psau))
+#define PSOCK_ADDR6(psau) (&SOCK_ADDR6(psau))
+
+#define AF(psau) ((psau)->sa.sa_family)
+
+#define IS_IPV4(psau) (AF_INET == AF(psau))
+#define IS_IPV6(psau) (AF_INET6 == AF(psau))
+
+/* sockaddr_u v4 address in network byte order */
+#define NSRCADR(psau) (SOCK_ADDR4(psau).s_addr)
+
+/* sockaddr_u v4 address in host byte order */
+#define SRCADR(psau) (ntohl(NSRCADR(psau)))
+
+/* sockaddr_u v6 address in network byte order */
+#define NSRCADR6(psau) (SOCK_ADDR6(psau).s6_addr)
+
+/* assign sockaddr_u v4 address from host byte order */
+#define SET_ADDR4(psau, addr4) (NSRCADR(psau) = htonl(addr4))
+
+/* assign sockaddr_u v4 address from network byte order */
+#define SET_ADDR4N(psau, addr4n) (NSRCADR(psau) = (addr4n));
+
+/* assign sockaddr_u v6 address from network byte order */
+#define SET_ADDR6N(psau, s6_addr) \
+ (SOCK_ADDR6(psau) = (s6_addr))
+
+/* sockaddr_u v4/v6 port in network byte order */
+#define NSRCPORT(psau) ((psau)->sa4.sin_port)
+
+/* sockaddr_u v4/v6 port in host byte order */
+#define SRCPORT(psau) (ntohs(NSRCPORT(psau)))
+
+/* assign sockaddr_u v4/v6 port from host byte order */
+#define SET_PORT(psau, port) (NSRCPORT(psau) = htons(port))
+
+/* sockaddr_u v6 scope */
+#define SCOPE_VAR(psau) ((psau)->sa6.sin6_scope_id)
+
+#ifdef ISC_PLATFORM_HAVESCOPEID
+/* v4/v6 scope (always zero for v4) */
+# define SCOPE(psau) (IS_IPV4(psau) \
+ ? 0 \
+ : SCOPE_VAR(psau))
+
+/* are two v6 sockaddr_u scopes equal? */
+# define SCOPE_EQ(psau1, psau2) \
+ (SCOPE_VAR(psau1) == SCOPE_VAR(psau2))
+
+/* assign scope if supported */
+# define SET_SCOPE(psau, s) \
+ do \
+ if (IS_IPV6(psau)) \
+ SCOPE_VAR(psau) = (s); \
+ while (0)
+#else /* ISC_PLATFORM_HAVESCOPEID not defined */
+# define SCOPE(psau) (0)
+# define SCOPE_EQ(psau1, psau2) (1)
+# define SET_SCOPE(psau, s) do { } while (0)
+#endif /* ISC_PLATFORM_HAVESCOPEID */
+
+/* v4/v6 is multicast address */
+#define IS_MCAST(psau) \
+ (IS_IPV4(psau) \
+ ? IN_CLASSD(SRCADR(psau)) \
+ : IN6_IS_ADDR_MULTICAST(PSOCK_ADDR6(psau)))
+
+/* v6 is interface ID scope universal, as with MAC-derived addresses */
+#define IS_IID_UNIV(psau) \
+ (!!(0x02 & NSRCADR6(psau)[8]))
+
+#define SIZEOF_INADDR(fam) \
+ ((AF_INET == (fam)) \
+ ? sizeof(struct in_addr) \
+ : sizeof(struct in6_addr))
+
+#define SIZEOF_SOCKADDR(fam) \
+ ((AF_INET == (fam)) \
+ ? sizeof(struct sockaddr_in) \
+ : sizeof(struct sockaddr_in6))
+
+#define SOCKLEN(psau) \
+ (IS_IPV4(psau) \
+ ? sizeof((psau)->sa4) \
+ : sizeof((psau)->sa6))
+
+#define ZERO_SOCK(psau) \
+ ZERO(*(psau))
+
+/* blast a byte value across sockaddr_u v6 address */
+#define MEMSET_ADDR6(psau, v) \
+ memset((psau)->sa6.sin6_addr.s6_addr, (v), \
+ sizeof((psau)->sa6.sin6_addr.s6_addr))
+
+#define SET_ONESMASK(psau) \
+ do { \
+ if (IS_IPV6(psau)) \
+ MEMSET_ADDR6((psau), 0xff); \
+ else \
+ NSRCADR(psau) = 0xffffffff; \
+ } while(0)
+
+/* zero sockaddr_u, fill in family and all-ones (host) mask */
+#define SET_HOSTMASK(psau, family) \
+ do { \
+ ZERO_SOCK(psau); \
+ AF(psau) = (family); \
+ SET_ONESMASK(psau); \
+ } while (0)
+
+/*
+ * compare two in6_addr returning negative, 0, or positive.
+ * ADDR6_CMP is negative if *pin6A is lower than *pin6B, zero if they
+ * are equal, positive if *pin6A is higher than *pin6B. IN6ADDR_ANY
+ * is the lowest address (128 zero bits).
+ */
+#define ADDR6_CMP(pin6A, pin6B) \
+ memcmp((pin6A)->s6_addr, (pin6B)->s6_addr, \
+ sizeof(pin6A)->s6_addr)
+
+/* compare two in6_addr for equality only */
+#if !defined(SYS_WINNT) || !defined(in_addr6)
+#define ADDR6_EQ(pin6A, pin6B) \
+ (!ADDR6_CMP(pin6A, pin6B))
+#else
+#define ADDR6_EQ(pin6A, pin6B) \
+ IN6_ADDR_EQUAL(pin6A, pin6B)
+#endif
+
+/* compare a in6_addr with socket address */
+#define S_ADDR6_EQ(psau, pin6) \
+ ADDR6_EQ(&(psau)->sa6.sin6_addr, pin6)
+
+/* are two sockaddr_u's addresses equal? (port excluded) */
+#define SOCK_EQ(psau1, psau2) \
+ ((AF(psau1) != AF(psau2)) \
+ ? 0 \
+ : IS_IPV4(psau1) \
+ ? (NSRCADR(psau1) == NSRCADR(psau2)) \
+ : (S_ADDR6_EQ((psau1), PSOCK_ADDR6(psau2)) \
+ && SCOPE_EQ((psau1), (psau2))))
+
+/* are two sockaddr_u's addresses and ports equal? */
+#define ADDR_PORT_EQ(psau1, psau2) \
+ ((NSRCPORT(psau1) != NSRCPORT(psau2) \
+ ? 0 \
+ : SOCK_EQ((psau1), (psau2))))
+
+/* is sockaddr_u address unspecified? */
+#define SOCK_UNSPEC(psau) \
+ (IS_IPV4(psau) \
+ ? !NSRCADR(psau) \
+ : IN6_IS_ADDR_UNSPECIFIED(PSOCK_ADDR6(psau)))
+
+/* just how unspecified do you mean? (scope 0/unspec too) */
+#define SOCK_UNSPEC_S(psau) \
+ (SOCK_UNSPEC(psau) && !SCOPE(psau))
+
+/* choose a default net interface (struct interface) for v4 or v6 */
+#define ANY_INTERFACE_BYFAM(family) \
+ ((AF_INET == family) \
+ ? any_interface \
+ : any6_interface)
+
+/* choose a default interface for addresses' protocol (addr family) */
+#define ANY_INTERFACE_CHOOSE(psau) \
+ ANY_INTERFACE_BYFAM(AF(psau))
+
+
+/*
+ * We tell reference clocks from real peers by giving the reference
+ * clocks an address of the form 127.127.t.u, where t is the type and
+ * u is the unit number. We define some of this here since we will need
+ * some sanity checks to make sure this address isn't interpretted as
+ * that of a normal peer.
+ */
+#define REFCLOCK_ADDR 0x7f7f0000 /* 127.127.0.0 */
+#define REFCLOCK_MASK 0xffff0000 /* 255.255.0.0 */
+
+#define ISREFCLOCKADR(srcadr) \
+ (IS_IPV4(srcadr) && \
+ (SRCADR(srcadr) & REFCLOCK_MASK) == REFCLOCK_ADDR)
+
+/*
+ * Macro for checking for invalid addresses. This is really, really
+ * gross, but is needed so no one configures a host on net 127 now that
+ * we're encouraging it the the configuration file.
+ */
+#define LOOPBACKADR 0x7f000001
+#define LOOPNETMASK 0xff000000
+
+#define ISBADADR(srcadr) \
+ (IS_IPV4(srcadr) \
+ && ((SRCADR(srcadr) & LOOPNETMASK) \
+ == (LOOPBACKADR & LOOPNETMASK)) \
+ && SRCADR(srcadr) != LOOPBACKADR)
+
+
+#endif /* NTP_NET_H */
diff --git a/include/ntp_prio_q.h b/include/ntp_prio_q.h
new file mode 100644
index 0000000..4b5ffca
--- /dev/null
+++ b/include/ntp_prio_q.h
@@ -0,0 +1,83 @@
+/* ntp_prio_q.h
+ *
+ * This file contains the structures and function prototypes for the
+ * priority queue implementation used by the discrete event simulator.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Copyright (c) 2006
+ */
+
+#ifndef NTP_PRIO_Q_H
+#define NTP_PRIO_Q_H
+
+#include <stddef.h> /* size_t */
+
+/* Structures for storing a priority queue
+ * ---------------------------------------
+ */
+
+typedef struct node {
+ union {
+ struct node *next;
+ double d;
+ } nodeu;
+} node;
+#define node_next nodeu.next
+
+typedef int (*q_order_func)(const void *, const void *);
+
+typedef struct Queue {
+ q_order_func get_order;
+ node * front;
+ int no_of_elements;
+} queue;
+
+
+/* FUNCTION PROTOTYPES
+ * -------------------
+ */
+/* Define a function to create a FIFO queue */
+#define create_queue() create_priority_queue(&get_fifo_order)
+
+void destroy_queue(queue *my_queue);
+void free_node(void *my_node);
+void *next_node(void *my_node);
+int empty(queue *my_queue);
+void *queue_head(queue *my_queue);
+queue *enqueue(queue *my_queue, void *my_node);
+void append_queue(queue *q1, queue *q2);
+void *dequeue(queue *my_queue);
+int get_no_of_elements(queue *my_queue);
+int get_fifo_order(const void *el1, const void *el2);
+
+/*
+ * Preserve original callsite __FILE__ and __LINE__ for these
+ * malloc-like funcs when using MS C runtime debug heap.
+ */
+#ifdef _CRTDBG_MAP_ALLOC
+# define create_priority_queue(order) debug_create_priority_queue(order, __FILE__, __LINE__)
+# define get_node(size) debug_get_node(size, __FILE__, __LINE__)
+#else
+# define create_priority_queue(order) debug_create_priority_queue(order)
+# define get_node(size) debug_get_node(size)
+#endif
+
+queue *debug_create_priority_queue(
+ q_order_func get_order
+#ifdef _CRTDBG_MAP_ALLOC
+ , const char * sourcefile
+ , int line_num
+#endif
+ );
+
+void *debug_get_node(
+ size_t size
+#ifdef _CRTDBG_MAP_ALLOC
+ , const char * sourcefile
+ , int line_num
+#endif
+ );
+
+#endif /* NTP_PRIO_Q_H */
diff --git a/include/ntp_proto.h b/include/ntp_proto.h
new file mode 100644
index 0000000..1d04b78
--- /dev/null
+++ b/include/ntp_proto.h
@@ -0,0 +1,6 @@
+#ifndef NTP_PROTO_H
+#define NTP_PROTO_H
+
+#define NTP_MAXFREQ 500e-6
+
+#endif /* NTP_PROTO_H */
diff --git a/include/ntp_random.h b/include/ntp_random.h
new file mode 100644
index 0000000..3f89831
--- /dev/null
+++ b/include/ntp_random.h
@@ -0,0 +1,14 @@
+
+#include <ntp_types.h>
+
+long ntp_random (void);
+void ntp_srandom (unsigned long);
+void ntp_srandomdev (void);
+char * ntp_initstate (unsigned long, /* seed for R.N.G. */
+ char *, /* pointer to state array */
+ long /* # bytes of state info */
+ );
+char * ntp_setstate (char *); /* pointer to state array */
+
+
+
diff --git a/include/ntp_refclock.h b/include/ntp_refclock.h
new file mode 100644
index 0000000..f92d14c
--- /dev/null
+++ b/include/ntp_refclock.h
@@ -0,0 +1,239 @@
+/*
+ * ntp_refclock.h - definitions for reference clock support
+ */
+
+#ifndef NTP_REFCLOCK_H
+#define NTP_REFCLOCK_H
+
+#if defined(HAVE_SYS_MODEM_H)
+#include <sys/modem.h>
+#endif
+
+#include "ntp_types.h"
+#include "ntp_tty.h"
+#include "recvbuff.h"
+
+
+#define SAMPLE(x) pp->coderecv = (pp->coderecv + 1) % MAXSTAGE; \
+ pp->filter[pp->coderecv] = (x); \
+ if (pp->coderecv == pp->codeproc) \
+ pp->codeproc = (pp->codeproc + 1) % MAXSTAGE;
+
+/*
+ * Macros to determine the clock type and unit numbers from a
+ * 127.127.t.u address
+ */
+#define REFCLOCKTYPE(srcadr) ((SRCADR(srcadr) >> 8) & 0xff)
+#define REFCLOCKUNIT(srcadr) (SRCADR(srcadr) & 0xff)
+
+/*
+ * List of reference clock names and descriptions. These must agree with
+ * lib/clocktypes.c and ntpd/refclock_conf.c.
+ */
+struct clktype {
+ int code; /* driver "major" number */
+ const char *clocktype; /* long description */
+ const char *abbrev; /* short description */
+};
+extern struct clktype clktypes[];
+
+/*
+ * Configuration flag values
+ */
+#define CLK_HAVETIME1 0x1
+#define CLK_HAVETIME2 0x2
+#define CLK_HAVEVAL1 0x4
+#define CLK_HAVEVAL2 0x8
+
+#define CLK_FLAG1 0x1
+#define CLK_FLAG2 0x2
+#define CLK_FLAG3 0x4
+#define CLK_FLAG4 0x8
+
+#define CLK_HAVEFLAG1 0x10
+#define CLK_HAVEFLAG2 0x20
+#define CLK_HAVEFLAG3 0x40
+#define CLK_HAVEFLAG4 0x80
+
+/*
+ * Constant for disabling event reporting in
+ * refclock_receive. ORed in leap
+ * parameter
+ */
+#define REFCLOCK_OWN_STATES 0x80
+
+/*
+ * Structure for returning clock status
+ */
+struct refclockstat {
+ u_char type; /* clock type */
+ u_char flags; /* clock flags */
+ u_char haveflags; /* bit array of valid flags */
+ u_short lencode; /* length of last timecode */
+ const char *p_lastcode; /* last timecode received */
+ u_int32 polls; /* transmit polls */
+ u_int32 noresponse; /* no response to poll */
+ u_int32 badformat; /* bad format timecode received */
+ u_int32 baddata; /* invalid data timecode received */
+ u_int32 timereset; /* driver resets */
+ const char *clockdesc; /* ASCII description */
+ double fudgetime1; /* configure fudge time1 */
+ double fudgetime2; /* configure fudge time2 */
+ int32 fudgeval1; /* configure fudge value1 */
+ u_int32 fudgeval2; /* configure fudge value2 */
+ u_char currentstatus; /* clock status */
+ u_char lastevent; /* last exception event */
+ u_char leap; /* leap bits */
+ struct ctl_var *kv_list; /* additional variables */
+};
+
+/*
+ * Reference clock I/O structure. Used to provide an interface between
+ * the reference clock drivers and the I/O module.
+ */
+struct refclockio {
+ struct refclockio *next; /* link to next structure */
+ void (*clock_recv) (struct recvbuf *); /* completion routine */
+ int (*io_input) (struct recvbuf *); /* input routine -
+ to avoid excessive buffer use
+ due to small bursts
+ of refclock input data */
+ struct peer *srcclock; /* refclock peer */
+ int datalen; /* length of data */
+ int fd; /* file descriptor */
+ u_long recvcount; /* count of receive completions */
+ int active; /* nonzero when in use */
+
+#ifdef HAVE_IO_COMPLETION_PORT
+ void * device_context; /* device-related data for i/o subsystem */
+#endif
+};
+
+/*
+ * Structure for returning debugging info
+ */
+#define NCLKBUGVALUES 16
+#define NCLKBUGTIMES 32
+
+struct refclockbug {
+ u_char nvalues; /* values following */
+ u_char ntimes; /* times following */
+ u_short svalues; /* values format sign array */
+ u_int32 stimes; /* times format sign array */
+ u_int32 values[NCLKBUGVALUES]; /* real values */
+ l_fp times[NCLKBUGTIMES]; /* real times */
+};
+
+#ifdef HAVE_IO_COMPLETION_PORT
+extern HANDLE WaitableIoEventHandle;
+#endif
+
+/*
+ * Structure interface between the reference clock support
+ * ntp_refclock.c and the driver utility routines
+ */
+#define MAXSTAGE 60 /* max median filter stages */
+#define NSTAGE 5 /* default median filter stages */
+#define BMAX 128 /* max timecode length */
+#define GMT 0 /* I hope nobody sees this */
+#define MAXDIAL 60 /* max length of modem dial strings */
+
+
+struct refclockproc {
+ void * unitptr; /* pointer to unit structure */
+ struct refclock * conf; /* refclock_conf[type] */
+ struct refclockio io; /* I/O handler structure */
+ u_char leap; /* leap/synchronization code */
+ u_char currentstatus; /* clock status */
+ u_char lastevent; /* last exception event */
+ u_char type; /* clock type */
+ const char *clockdesc; /* clock description */
+ u_long nextaction; /* local activity timeout */
+ void (*action)(struct peer *); /* timeout callback */
+
+ char a_lastcode[BMAX]; /* last timecode received */
+ int lencode; /* length of last timecode */
+
+ int year; /* year of eternity */
+ int day; /* day of year */
+ int hour; /* hour of day */
+ int minute; /* minute of hour */
+ int second; /* second of minute */
+ long nsec; /* nanosecond of second */
+ u_long yearstart; /* beginning of year */
+ int coderecv; /* put pointer */
+ int codeproc; /* get pointer */
+ l_fp lastref; /* reference timestamp */
+ l_fp lastrec; /* receive timestamp */
+ double offset; /* mean offset */
+ double disp; /* sample dispersion */
+ double jitter; /* jitter (mean squares) */
+ double filter[MAXSTAGE]; /* median filter */
+
+ /*
+ * Configuration data
+ */
+ double fudgetime1; /* fudge time1 */
+ double fudgetime2; /* fudge time2 */
+ u_char stratum; /* server stratum */
+ u_int32 refid; /* reference identifier */
+ u_char sloppyclockflag; /* fudge flags */
+
+ /*
+ * Status tallies
+ */
+ u_long timestarted; /* time we started this */
+ u_long polls; /* polls sent */
+ u_long noreply; /* no replies to polls */
+ u_long badformat; /* bad format reply */
+ u_long baddata; /* bad data reply */
+};
+
+/*
+ * Structure interface between the reference clock support
+ * ntp_refclock.c and particular clock drivers. This must agree with the
+ * structure defined in the driver.
+ */
+#define noentry 0 /* flag for null routine */
+#define NOFLAGS 0 /* flag for null flags */
+
+struct refclock {
+ int (*clock_start) (int, struct peer *);
+ void (*clock_shutdown) (int, struct peer *);
+ void (*clock_poll) (int, struct peer *);
+ void (*clock_control) (int, const struct refclockstat *,
+ struct refclockstat *, struct peer *);
+ void (*clock_init) (void);
+ void (*clock_buginfo) (int, struct refclockbug *, struct peer *);
+ void (*clock_timer) (int, struct peer *);
+};
+
+/*
+ * Function prototypes
+ */
+extern int io_addclock (struct refclockio *);
+extern void io_closeclock (struct refclockio *);
+
+#ifdef REFCLOCK
+extern void refclock_buginfo(sockaddr_u *,
+ struct refclockbug *);
+extern void refclock_control(sockaddr_u *,
+ const struct refclockstat *,
+ struct refclockstat *);
+extern int refclock_open (char *, u_int, u_int);
+extern int refclock_setup (int, u_int, u_int);
+extern void refclock_timer (struct peer *);
+extern void refclock_transmit(struct peer *);
+extern int refclock_process(struct refclockproc *);
+extern int refclock_process_f(struct refclockproc *, double);
+extern void refclock_process_offset(struct refclockproc *, l_fp,
+ l_fp, double);
+extern void refclock_report (struct peer *, int);
+extern int refclock_gtlin (struct recvbuf *, char *, int, l_fp *);
+extern int refclock_gtraw (struct recvbuf *, char *, int, l_fp *);
+extern int indicate_refclock_packet(struct refclockio *,
+ struct recvbuf *);
+extern void process_refclock_packet(struct recvbuf *);
+#endif /* REFCLOCK */
+
+#endif /* NTP_REFCLOCK_H */
diff --git a/include/ntp_request.h b/include/ntp_request.h
new file mode 100644
index 0000000..c750b77
--- /dev/null
+++ b/include/ntp_request.h
@@ -0,0 +1,952 @@
+/*
+ * ntp_request.h - definitions for the ntpd remote query facility
+ */
+
+#ifndef NTP_REQUEST_H
+#define NTP_REQUEST_H
+
+#include "stddef.h"
+#include "ntp_types.h"
+#include "recvbuff.h"
+
+/*
+ * A mode 7 packet is used exchanging data between an NTP server
+ * and a client for purposes other than time synchronization, e.g.
+ * monitoring, statistics gathering and configuration. A mode 7
+ * packet has the following format:
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |R|M| VN | Mode|A| Sequence | Implementation| Req Code |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Err | Number of data items | MBZ | Size of data item |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | |
+ * | Data (Minimum 0 octets, maximum 500 octets) |
+ * | |
+ * [...]
+ * | |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Encryption Keyid (when A bit set) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | |
+ * | Message Authentication Code (when A bit set) |
+ * | |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ * where the fields are (note that the client sends requests, the server
+ * responses):
+ *
+ * Response Bit: This packet is a response (if clear, packet is a request).
+ *
+ * More Bit: Set for all packets but the last in a response which
+ * requires more than one packet.
+ *
+ * Version Number: 2 for current version
+ *
+ * Mode: Always 7
+ *
+ * Authenticated bit: If set, this packet is authenticated.
+ *
+ * Sequence number: For a multipacket response, contains the sequence
+ * number of this packet. 0 is the first in the sequence,
+ * 127 (or less) is the last. The More Bit must be set in
+ * all packets but the last.
+ *
+ * Implementation number: The number of the implementation this request code
+ * is defined by. An implementation number of zero is used
+ * for requst codes/data formats which all implementations
+ * agree on. Implementation number 255 is reserved (for
+ * extensions, in case we run out).
+ *
+ * Request code: An implementation-specific code which specifies the
+ * operation to be (which has been) performed and/or the
+ * format and semantics of the data included in the packet.
+ *
+ * Err: Must be 0 for a request. For a response, holds an error
+ * code relating to the request. If nonzero, the operation
+ * requested wasn't performed.
+ *
+ * 0 - no error
+ * 1 - incompatible implementation number
+ * 2 - unimplemented request code
+ * 3 - format error (wrong data items, data size, packet size etc.)
+ * 4 - no data available (e.g. request for details on unknown peer)
+ * 5-6 I don't know
+ * 7 - authentication failure (i.e. permission denied)
+ *
+ * Number of data items: number of data items in packet. 0 to 500
+ *
+ * MBZ: A reserved data field, must be zero in requests and responses.
+ *
+ * Size of data item: size of each data item in packet. 0 to 500
+ *
+ * Data: Variable sized area containing request/response data. For
+ * requests and responses the size in octets must be greater
+ * than or equal to the product of the number of data items
+ * and the size of a data item. For requests the data area
+ * must be exactly 40 octets in length. For responses the
+ * data area may be any length between 0 and 500 octets
+ * inclusive.
+ *
+ * Message Authentication Code: Same as NTP spec, in definition and function.
+ * May optionally be included in requests which require
+ * authentication, is never included in responses.
+ *
+ * The version number, mode and keyid have the same function and are
+ * in the same location as a standard NTP packet. The request packet
+ * is the same size as a standard NTP packet to ease receive buffer
+ * management, and to allow the same encryption procedure to be used
+ * both on mode 7 and standard NTP packets. The mac is included when
+ * it is required that a request be authenticated, the keyid should be
+ * zero in requests in which the mac is not included.
+ *
+ * The data format depends on the implementation number/request code pair
+ * and whether the packet is a request or a response. The only requirement
+ * is that data items start in the octet immediately following the size
+ * word and that data items be concatenated without padding between (i.e.
+ * if the data area is larger than data_items*size, all padding is at
+ * the end). Padding is ignored, other than for encryption purposes.
+ * Implementations using encryption might want to include a time stamp
+ * or other data in the request packet padding. The key used for requests
+ * is implementation defined, but key 15 is suggested as a default.
+ */
+
+/*
+ * union of raw addresses to save space
+ */
+union addrun {
+ struct in6_addr addr6;
+ struct in_addr addr;
+};
+
+#define MODE7_PAYLOAD_LIM 176
+
+typedef union req_data_u_tag {
+ u_int32 u32[MODE7_PAYLOAD_LIM / sizeof(u_int32)];
+ char data[MODE7_PAYLOAD_LIM]; /* data area (176 byte max) */
+} req_data_u; /* struct conf_peer must fit */
+
+/*
+ * A request packet. These are almost a fixed length.
+ */
+struct req_pkt {
+ u_char rm_vn_mode; /* response, more, version, mode */
+ u_char auth_seq; /* key, sequence number */
+ u_char implementation; /* implementation number */
+ u_char request; /* request number */
+ u_short err_nitems; /* error code/number of data items */
+ u_short mbz_itemsize; /* item size */
+ req_data_u u; /* data area */
+ l_fp tstamp; /* time stamp, for authentication */
+ keyid_t keyid; /* (optional) encryption key */
+ char mac[MAX_MAC_LEN-sizeof(keyid_t)]; /* (optional) auth code */
+};
+
+/*
+ * The req_pkt_tail structure is used by ntpd to adjust for different
+ * packet sizes that may arrive.
+ */
+struct req_pkt_tail {
+ l_fp tstamp; /* time stamp, for authentication */
+ keyid_t keyid; /* (optional) encryption key */
+ char mac[MAX_MAC_LEN-sizeof(keyid_t)]; /* (optional) auth code */
+};
+
+/* MODE_PRIVATE request packet header length before optional items. */
+#define REQ_LEN_HDR (offsetof(struct req_pkt, u))
+/* MODE_PRIVATE request packet fixed length without MAC. */
+#define REQ_LEN_NOMAC (offsetof(struct req_pkt, keyid))
+/* MODE_PRIVATE req_pkt_tail minimum size (16 octet digest) */
+#define REQ_TAIL_MIN \
+ (sizeof(struct req_pkt_tail) - (MAX_MAC_LEN - MAX_MD5_LEN))
+
+/*
+ * A MODE_PRIVATE response packet. The length here is variable, this
+ * is a maximally sized one. Note that this implementation doesn't
+ * authenticate responses.
+ */
+#define RESP_HEADER_SIZE (offsetof(struct resp_pkt, u))
+#define RESP_DATA_SIZE 500
+
+typedef union resp_pkt_u_tag {
+ char data[RESP_DATA_SIZE];
+ u_int32 u32[RESP_DATA_SIZE / sizeof(u_int32)];
+} resp_pkt_u;
+
+struct resp_pkt {
+ u_char rm_vn_mode; /* response, more, version, mode */
+ u_char auth_seq; /* key, sequence number */
+ u_char implementation; /* implementation number */
+ u_char request; /* request number */
+ u_short err_nitems; /* error code/number of data items */
+ u_short mbz_itemsize; /* item size */
+ resp_pkt_u u; /* data area */
+};
+
+
+/*
+ * Information error codes
+ */
+#define INFO_OKAY 0
+#define INFO_ERR_IMPL 1 /* incompatible implementation */
+#define INFO_ERR_REQ 2 /* unknown request code */
+#define INFO_ERR_FMT 3 /* format error */
+#define INFO_ERR_NODATA 4 /* no data for this request */
+#define INFO_ERR_AUTH 7 /* authentication failure */
+#define MAX_INFO_ERR INFO_ERR_AUTH
+
+/*
+ * Maximum sequence number.
+ */
+#define MAXSEQ 127
+
+
+/*
+ * Bit setting macros for multifield items.
+ */
+#define RESP_BIT 0x80
+#define MORE_BIT 0x40
+
+#define ISRESPONSE(rm_vn_mode) (((rm_vn_mode)&RESP_BIT)!=0)
+#define ISMORE(rm_vn_mode) (((rm_vn_mode)&MORE_BIT)!=0)
+#define INFO_VERSION(rm_vn_mode) ((u_char)(((rm_vn_mode)>>3)&0x7))
+#define INFO_MODE(rm_vn_mode) ((rm_vn_mode)&0x7)
+
+#define RM_VN_MODE(resp, more, version) \
+ ((u_char)(((resp)?RESP_BIT:0)\
+ |((more)?MORE_BIT:0)\
+ |((version?version:(NTP_OLDVERSION+1))<<3)\
+ |(MODE_PRIVATE)))
+
+#define INFO_IS_AUTH(auth_seq) (((auth_seq) & 0x80) != 0)
+#define INFO_SEQ(auth_seq) ((auth_seq)&0x7f)
+#define AUTH_SEQ(auth, seq) ((u_char)((((auth)!=0)?0x80:0)|((seq)&0x7f)))
+
+#define INFO_ERR(err_nitems) ((u_short)((ntohs(err_nitems)>>12)&0xf))
+#define INFO_NITEMS(err_nitems) ((u_short)(ntohs(err_nitems)&0xfff))
+#define ERR_NITEMS(err, nitems) (htons((u_short)((((u_short)(err)<<12)&0xf000)\
+ |((u_short)(nitems)&0xfff))))
+
+#define INFO_MBZ(mbz_itemsize) ((ntohs(mbz_itemsize)>>12)&0xf)
+#define INFO_ITEMSIZE(mbz_itemsize) ((u_short)(ntohs(mbz_itemsize)&0xfff))
+#define MBZ_ITEMSIZE(itemsize) (htons((u_short)(itemsize)))
+
+
+/*
+ * Implementation numbers. One for universal use and one for ntpd.
+ */
+#define IMPL_UNIV 0
+#define IMPL_XNTPD_OLD 2 /* Used by pre ipv6 ntpdc */
+#define IMPL_XNTPD 3 /* Used by post ipv6 ntpdc */
+
+/*
+ * Some limits related to authentication. Frames which are
+ * authenticated must include a time stamp which differs from
+ * the receive time stamp by no more than 10 seconds.
+ */
+#define INFO_TS_MAXSKEW 10.
+
+/*
+ * Universal request codes go here. There aren't any.
+ */
+
+/*
+ * ntpdc -> ntpd request codes go here.
+ */
+#define REQ_PEER_LIST 0 /* return list of peers */
+#define REQ_PEER_LIST_SUM 1 /* return summary info for all peers */
+#define REQ_PEER_INFO 2 /* get standard information on peer */
+#define REQ_PEER_STATS 3 /* get statistics for peer */
+#define REQ_SYS_INFO 4 /* get system information */
+#define REQ_SYS_STATS 5 /* get system stats */
+#define REQ_IO_STATS 6 /* get I/O stats */
+#define REQ_MEM_STATS 7 /* stats related to peer list maint */
+#define REQ_LOOP_INFO 8 /* info from the loop filter */
+#define REQ_TIMER_STATS 9 /* get timer stats */
+#define REQ_CONFIG 10 /* configure a new peer */
+#define REQ_UNCONFIG 11 /* unconfigure an existing peer */
+#define REQ_SET_SYS_FLAG 12 /* set system flags */
+#define REQ_CLR_SYS_FLAG 13 /* clear system flags */
+#define REQ_MONITOR 14 /* (not used) */
+#define REQ_NOMONITOR 15 /* (not used) */
+#define REQ_GET_RESTRICT 16 /* return restrict list */
+#define REQ_RESADDFLAGS 17 /* add flags to restrict list */
+#define REQ_RESSUBFLAGS 18 /* remove flags from restrict list */
+#define REQ_UNRESTRICT 19 /* remove entry from restrict list */
+#define REQ_MON_GETLIST 20 /* return data collected by monitor */
+#define REQ_RESET_STATS 21 /* reset stat counters */
+#define REQ_RESET_PEER 22 /* reset peer stat counters */
+#define REQ_REREAD_KEYS 23 /* reread the encryption key file */
+#define REQ_DO_DIRTY_HACK 24 /* (not used) */
+#define REQ_DONT_DIRTY_HACK 25 /* (not used) */
+#define REQ_TRUSTKEY 26 /* add a trusted key */
+#define REQ_UNTRUSTKEY 27 /* remove a trusted key */
+#define REQ_AUTHINFO 28 /* return authentication info */
+#define REQ_TRAPS 29 /* return currently set traps */
+#define REQ_ADD_TRAP 30 /* add a trap */
+#define REQ_CLR_TRAP 31 /* clear a trap */
+#define REQ_REQUEST_KEY 32 /* define a new request keyid */
+#define REQ_CONTROL_KEY 33 /* define a new control keyid */
+#define REQ_GET_CTLSTATS 34 /* get stats from the control module */
+#define REQ_GET_LEAPINFO 35 /* (not used) */
+#define REQ_GET_CLOCKINFO 36 /* get clock information */
+#define REQ_SET_CLKFUDGE 37 /* set clock fudge factors */
+#define REQ_GET_KERNEL 38 /* get kernel pll/pps information */
+#define REQ_GET_CLKBUGINFO 39 /* get clock debugging info */
+#define REQ_SET_PRECISION 41 /* (not used) */
+#define REQ_MON_GETLIST_1 42 /* return collected v1 monitor data */
+#define REQ_HOSTNAME_ASSOCID 43 /* Here is a hostname + assoc_id */
+#define REQ_IF_STATS 44 /* get interface statistics */
+#define REQ_IF_RELOAD 45 /* reload interface list */
+
+/* Determine size of pre-v6 version of structures */
+#define v4sizeof(type) offsetof(type, v6_flag)
+
+/*
+ * Flags in the peer information returns
+ */
+#define INFO_FLAG_CONFIG 0x1
+#define INFO_FLAG_SYSPEER 0x2
+#define INFO_FLAG_BURST 0x4
+#define INFO_FLAG_REFCLOCK 0x8
+#define INFO_FLAG_PREFER 0x10
+#define INFO_FLAG_AUTHENABLE 0x20
+#define INFO_FLAG_SEL_CANDIDATE 0x40
+#define INFO_FLAG_SHORTLIST 0x80
+#define INFO_FLAG_IBURST 0x100
+
+/*
+ * Flags in the system information returns
+ */
+#define INFO_FLAG_BCLIENT 0x1
+#define INFO_FLAG_AUTHENTICATE 0x2
+#define INFO_FLAG_NTP 0x4
+#define INFO_FLAG_KERNEL 0x8
+#define INFO_FLAG_MONITOR 0x40
+#define INFO_FLAG_FILEGEN 0x80
+#define INFO_FLAG_CAL 0x10
+#define INFO_FLAG_PPS_SYNC 0x20
+
+/*
+ * Peer list structure. Used to return raw lists of peers. It goes
+ * without saying that everything returned is in network byte order.
+ * Well, it *would* have gone without saying, but somebody said it.
+ */
+struct info_peer_list {
+ u_int32 addr; /* address of peer */
+ u_short port; /* port number of peer */
+ u_char hmode; /* mode for this peer */
+ u_char flags; /* flags (from above) */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* (unused) padding for addr6 */
+ struct in6_addr addr6; /* v6 address of peer */
+};
+
+
+/*
+ * Peer summary structure. Sort of the info that ntpdc returns by default.
+ */
+struct info_peer_summary {
+ u_int32 dstadr; /* local address (zero for undetermined) */
+ u_int32 srcadr; /* source address */
+ u_short srcport; /* source port */
+ u_char stratum; /* stratum of peer */
+ s_char hpoll; /* host polling interval */
+ s_char ppoll; /* peer polling interval */
+ u_char reach; /* reachability register */
+ u_char flags; /* flags, from above */
+ u_char hmode; /* peer mode */
+ s_fp delay; /* peer.estdelay */
+ l_fp offset; /* peer.estoffset */
+ u_fp dispersion; /* peer.estdisp */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* (unused) padding for dstadr6 */
+ struct in6_addr dstadr6; /* local address (v6) */
+ struct in6_addr srcadr6; /* source address (v6) */
+};
+
+
+/*
+ * Peer information structure.
+ */
+struct info_peer {
+ u_int32 dstadr; /* local address */
+ u_int32 srcadr; /* source address */
+ u_short srcport; /* remote port */
+ u_char flags; /* peer flags */
+ u_char leap; /* peer.leap */
+ u_char hmode; /* peer.hmode */
+ u_char pmode; /* peer.pmode */
+ u_char stratum; /* peer.stratum */
+ u_char ppoll; /* peer.ppoll */
+ u_char hpoll; /* peer.hpoll */
+ s_char precision; /* peer.precision */
+ u_char version; /* peer.version */
+ u_char unused8;
+ u_char reach; /* peer.reach */
+ u_char unreach; /* peer.unreach */
+ u_char flash; /* old peer.flash */
+ u_char ttl; /* peer.ttl */
+ u_short flash2; /* new peer.flash */
+ associd_t associd; /* association ID */
+ keyid_t keyid; /* peer.keyid */
+ u_int32 pkeyid; /* unused */
+ u_int32 refid; /* peer.refid */
+ u_int32 timer; /* peer.timer */
+ s_fp rootdelay; /* peer.delay */
+ u_fp rootdispersion; /* peer.dispersion */
+ l_fp reftime; /* peer.reftime */
+ l_fp org; /* peer.org */
+ l_fp rec; /* peer.rec */
+ l_fp xmt; /* peer.xmt */
+ s_fp filtdelay[NTP_SHIFT]; /* delay shift register */
+ l_fp filtoffset[NTP_SHIFT]; /* offset shift register */
+ u_char order[NTP_SHIFT]; /* order of peers from last filter */
+ s_fp delay; /* peer.estdelay */
+ u_fp dispersion; /* peer.estdisp */
+ l_fp offset; /* peer.estoffset */
+ u_fp selectdisp; /* peer select dispersion */
+ int32 unused1; /* (obsolete) */
+ int32 unused2;
+ int32 unused3;
+ int32 unused4;
+ int32 unused5;
+ int32 unused6;
+ int32 unused7;
+ s_fp estbdelay; /* broadcast offset */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused9; /* (unused) padding for dstadr6 */
+ struct in6_addr dstadr6; /* local address (v6-like) */
+ struct in6_addr srcadr6; /* sources address (v6-like) */
+};
+
+
+/*
+ * Peer statistics structure
+ */
+struct info_peer_stats {
+ u_int32 dstadr; /* local address */
+ u_int32 srcadr; /* remote address */
+ u_short srcport; /* remote port */
+ u_short flags; /* peer flags */
+ u_int32 timereset; /* time counters were reset */
+ u_int32 timereceived; /* time since a packet received */
+ u_int32 timetosend; /* time until a packet sent */
+ u_int32 timereachable; /* time peer has been reachable */
+ u_int32 sent; /* number sent */
+ u_int32 unused1; /* (unused) */
+ u_int32 processed; /* number processed */
+ u_int32 unused2; /* (unused) */
+ u_int32 badauth; /* bad authentication */
+ u_int32 bogusorg; /* bogus origin */
+ u_int32 oldpkt; /* duplicate */
+ u_int32 unused3; /* (unused) */
+ u_int32 unused4; /* (unused) */
+ u_int32 seldisp; /* bad dispersion */
+ u_int32 selbroken; /* bad reference time */
+ u_int32 unused5; /* (unused) */
+ u_char candidate; /* select order */
+ u_char unused6; /* (unused) */
+ u_char unused7; /* (unused) */
+ u_char unused8; /* (unused) */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused9; /* (unused) padding for dstadr6 */
+ struct in6_addr dstadr6; /* local address */
+ struct in6_addr srcadr6; /* remote address */
+};
+
+
+/*
+ * Loop filter variables
+ */
+struct info_loop {
+ l_fp last_offset;
+ l_fp drift_comp;
+ u_int32 compliance;
+ u_int32 watchdog_timer;
+};
+
+
+/*
+ * System info. Mostly the sys.* variables, plus a few unique to
+ * the implementation.
+ */
+struct info_sys {
+ u_int32 peer; /* system peer address (v4) */
+ u_char peer_mode; /* mode we are syncing to peer in */
+ u_char leap; /* system leap bits */
+ u_char stratum; /* our stratum */
+ s_char precision; /* local clock precision */
+ s_fp rootdelay; /* delay from sync source */
+ u_fp rootdispersion; /* dispersion from sync source */
+ u_int32 refid; /* reference ID of sync source */
+ l_fp reftime; /* system reference time */
+ u_int32 poll; /* system poll interval */
+ u_char flags; /* system flags */
+ u_char unused1; /* unused */
+ u_char unused2; /* unused */
+ u_char unused3; /* unused */
+ s_fp bdelay; /* default broadcast offset */
+ s_fp frequency; /* frequency residual (scaled ppm) */
+ l_fp authdelay; /* default authentication delay */
+ u_fp stability; /* clock stability (scaled ppm) */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused4; /* unused, padding for peer6 */
+ struct in6_addr peer6; /* system peer address (v6) */
+};
+
+
+/*
+ * System stats. These are collected in the protocol module
+ */
+struct info_sys_stats {
+ u_int32 timeup; /* time since restart */
+ u_int32 timereset; /* time since reset */
+ u_int32 denied; /* access denied */
+ u_int32 oldversionpkt; /* recent version */
+ u_int32 newversionpkt; /* current version */
+ u_int32 unknownversion; /* bad version */
+ u_int32 badlength; /* bad length or format */
+ u_int32 processed; /* packets processed */
+ u_int32 badauth; /* bad authentication */
+ u_int32 received; /* packets received */
+ u_int32 limitrejected; /* rate exceeded */
+};
+
+
+/*
+ * System stats - old version
+ */
+struct old_info_sys_stats {
+ u_int32 timeup; /* time since restart */
+ u_int32 timereset; /* time since reset */
+ u_int32 denied; /* access denied */
+ u_int32 oldversionpkt; /* recent version */
+ u_int32 newversionpkt; /* current version */
+ u_int32 unknownversion; /* bad version */
+ u_int32 badlength; /* bad length or format */
+ u_int32 processed; /* packets processed */
+ u_int32 badauth; /* bad authentication */
+ u_int32 wanderhold; /* (not used) */
+};
+
+
+/*
+ * Peer memory statistics. Collected in the peer module.
+ */
+struct info_mem_stats {
+ u_int32 timereset; /* time since reset */
+ u_short totalpeermem;
+ u_short freepeermem;
+ u_int32 findpeer_calls;
+ u_int32 allocations;
+ u_int32 demobilizations;
+ u_char hashcount[NTP_HASH_SIZE];
+};
+
+
+/*
+ * I/O statistics. Collected in the I/O module
+ */
+struct info_io_stats {
+ u_int32 timereset; /* time since reset */
+ u_short totalrecvbufs; /* total receive bufs */
+ u_short freerecvbufs; /* free buffers */
+ u_short fullrecvbufs; /* full buffers */
+ u_short lowwater; /* number of times we've added buffers */
+ u_int32 dropped; /* dropped packets */
+ u_int32 ignored; /* ignored packets */
+ u_int32 received; /* received packets */
+ u_int32 sent; /* packets sent */
+ u_int32 notsent; /* packets not sent */
+ u_int32 interrupts; /* interrupts we've handled */
+ u_int32 int_received; /* received by interrupt handler */
+};
+
+
+/*
+ * Timer stats. Guess where from.
+ */
+struct info_timer_stats {
+ u_int32 timereset; /* time since reset */
+ u_int32 alarms; /* alarms we've handled */
+ u_int32 overflows; /* timer overflows */
+ u_int32 xmtcalls; /* calls to xmit */
+};
+
+
+/*
+ * Structure for passing peer configuration information
+ */
+struct old_conf_peer {
+ u_int32 peeraddr; /* address to poll */
+ u_char hmode; /* mode, either broadcast, active or client */
+ u_char version; /* version number to poll with */
+ u_char minpoll; /* min host poll interval */
+ u_char maxpoll; /* max host poll interval */
+ u_char flags; /* flags for this request */
+ u_char ttl; /* time to live (multicast) or refclock mode */
+ u_short unused; /* unused */
+ keyid_t keyid; /* key to use for this association */
+};
+
+struct conf_peer {
+ u_int32 peeraddr; /* address to poll */
+ u_char hmode; /* mode, either broadcast, active or client */
+ u_char version; /* version number to poll with */
+ u_char minpoll; /* min host poll interval */
+ u_char maxpoll; /* max host poll interval */
+ u_char flags; /* flags for this request */
+ u_char ttl; /* time to live (multicast) or refclock mode */
+ u_short unused1; /* unused */
+ keyid_t keyid; /* key to use for this association */
+ char keystr[128]; /* public key file name */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused2; /* unused, padding for peeraddr6 */
+ struct in6_addr peeraddr6; /* ipv6 address to poll */
+};
+
+#define CONF_FLAG_AUTHENABLE 0x01
+#define CONF_FLAG_PREFER 0x02
+#define CONF_FLAG_BURST 0x04
+#define CONF_FLAG_IBURST 0x08
+#define CONF_FLAG_NOSELECT 0x10
+#define CONF_FLAG_SKEY 0x20
+
+/*
+ * Structure for passing peer deletion information. Currently
+ * we only pass the address and delete all configured peers with
+ * this addess.
+ */
+struct conf_unpeer {
+ u_int32 peeraddr; /* address of peer */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr peeraddr6; /* address of peer (v6) */
+};
+
+/*
+ * Structure for carrying system flags.
+ */
+struct conf_sys_flags {
+ u_int32 flags;
+};
+
+/*
+ * System flags we can set/clear
+ */
+#define SYS_FLAG_BCLIENT 0x01
+#define SYS_FLAG_PPS 0x02
+#define SYS_FLAG_NTP 0x04
+#define SYS_FLAG_KERNEL 0x08
+#define SYS_FLAG_MONITOR 0x10
+#define SYS_FLAG_FILEGEN 0x20
+#define SYS_FLAG_AUTH 0x40
+#define SYS_FLAG_CAL 0x80
+
+/*
+ * Structure used for returning restrict entries
+ */
+struct info_restrict {
+ u_int32 addr; /* match address */
+ u_int32 mask; /* match mask */
+ u_int32 count; /* number of packets matched */
+ u_short flags; /* restrict flags */
+ u_short mflags; /* match flags */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* unused, padding for addr6 */
+ struct in6_addr addr6; /* match address (v6) */
+ struct in6_addr mask6; /* match mask (v6) */
+};
+
+
+/*
+ * Structure used for specifying restrict entries
+ */
+struct conf_restrict {
+ u_int32 addr; /* match address */
+ u_int32 mask; /* match mask */
+ u_short flags; /* restrict flags */
+ u_short mflags; /* match flags */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr addr6; /* match address (v6) */
+ struct in6_addr mask6; /* match mask (v6) */
+};
+
+
+/*
+ * Structure used for returning monitor data
+ */
+struct info_monitor_1 {
+ u_int32 avg_int; /* avg s between packets from this host */
+ u_int32 last_int; /* s since we last received a packet */
+ u_int32 restr; /* restrict bits (was named lastdrop) */
+ u_int32 count; /* count of packets received */
+ u_int32 addr; /* host address V4 style */
+ u_int32 daddr; /* destination host address */
+ u_int32 flags; /* flags about destination */
+ u_short port; /* port number of last reception */
+ u_char mode; /* mode of last packet */
+ u_char version; /* version number of last packet */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* unused, padding for addr6 */
+ struct in6_addr addr6; /* host address V6 style */
+ struct in6_addr daddr6; /* host address V6 style */
+};
+
+
+/*
+ * Structure used for returning monitor data
+ */
+struct info_monitor {
+ u_int32 avg_int; /* avg s between packets from this host */
+ u_int32 last_int; /* s since we last received a packet */
+ u_int32 restr; /* restrict bits (was named lastdrop) */
+ u_int32 count; /* count of packets received */
+ u_int32 addr; /* host address */
+ u_short port; /* port number of last reception */
+ u_char mode; /* mode of last packet */
+ u_char version; /* version number of last packet */
+ u_int v6_flag; /* is this v6 or not */
+ u_int unused1; /* unused, padding for addr6 */
+ struct in6_addr addr6; /* host v6 address */
+};
+
+/*
+ * Structure used for returning monitor data (old format)
+ */
+struct old_info_monitor {
+ u_int32 lasttime; /* last packet from this host */
+ u_int32 firsttime; /* first time we received a packet */
+ u_int32 count; /* count of packets received */
+ u_int32 addr; /* host address */
+ u_short port; /* port number of last reception */
+ u_char mode; /* mode of last packet */
+ u_char version; /* version number of last packet */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr addr6; /* host address (v6)*/
+};
+
+/*
+ * Structure used for passing indication of flags to clear
+ */
+struct reset_flags {
+ u_int32 flags;
+};
+
+#define RESET_FLAG_ALLPEERS 0x01
+#define RESET_FLAG_IO 0x02
+#define RESET_FLAG_SYS 0x04
+#define RESET_FLAG_MEM 0x08
+#define RESET_FLAG_TIMER 0x10
+#define RESET_FLAG_AUTH 0x20
+#define RESET_FLAG_CTL 0x40
+
+#define RESET_ALLFLAGS ( \
+ RESET_FLAG_ALLPEERS | \
+ RESET_FLAG_IO | \
+ RESET_FLAG_SYS | \
+ RESET_FLAG_MEM | \
+ RESET_FLAG_TIMER | \
+ RESET_FLAG_AUTH | \
+ RESET_FLAG_CTL \
+)
+
+/*
+ * Structure used to return information concerning the authentication
+ * module.
+ */
+struct info_auth {
+ u_int32 timereset; /* time counters were reset */
+ u_int32 numkeys; /* number of keys we know */
+ u_int32 numfreekeys; /* number of free keys */
+ u_int32 keylookups; /* calls to authhavekey() */
+ u_int32 keynotfound; /* requested key unknown */
+ u_int32 encryptions; /* number of encryptions */
+ u_int32 decryptions; /* number of decryptions */
+ u_int32 expired; /* number of expired keys */
+ u_int32 keyuncached; /* calls to encrypt/decrypt with uncached key */
+};
+
+
+/*
+ * Structure used to pass trap information to the client
+ */
+struct info_trap {
+ u_int32 local_address; /* local interface addres (v4) */
+ u_int32 trap_address; /* remote client's addres (v4) */
+ u_short trap_port; /* remote port number */
+ u_short sequence; /* sequence number */
+ u_int32 settime; /* time trap last set */
+ u_int32 origtime; /* time trap originally set */
+ u_int32 resets; /* number of resets on this trap */
+ u_int32 flags; /* trap flags, as defined in ntp_control.h */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr local_address6; /* local interface address (v6) */
+ struct in6_addr trap_address6; /* remote client's address (v6) */
+};
+
+/*
+ * Structure used to pass add/clear trap information to the client
+ */
+struct conf_trap {
+ u_int32 local_address; /* remote client's address */
+ u_int32 trap_address; /* local interface address */
+ u_short trap_port; /* remote client's port */
+ u_short unused; /* (unused) */
+ u_int v6_flag; /* is this v6 or not */
+ struct in6_addr local_address6; /* local interface address (v6) */
+ struct in6_addr trap_address6; /* remote client's address (v6) */
+};
+
+
+/*
+ * Structure used to return statistics from the control module
+ */
+struct info_control {
+ u_int32 ctltimereset;
+ u_int32 numctlreq; /* number of requests we've received */
+ u_int32 numctlbadpkts; /* number of bad control packets */
+ u_int32 numctlresponses; /* # resp packets sent */
+ u_int32 numctlfrags; /* # of fragments sent */
+ u_int32 numctlerrors; /* number of error responses sent */
+ u_int32 numctltooshort; /* number of too short input packets */
+ u_int32 numctlinputresp; /* number of responses on input */
+ u_int32 numctlinputfrag; /* number of fragments on input */
+ u_int32 numctlinputerr; /* # input pkts with err bit set */
+ u_int32 numctlbadoffset; /* # input pkts with nonzero offset */
+ u_int32 numctlbadversion; /* # input pkts with unknown version */
+ u_int32 numctldatatooshort; /* data too short for count */
+ u_int32 numctlbadop; /* bad op code found in packet */
+ u_int32 numasyncmsgs; /* # async messages we've sent */
+};
+
+
+/*
+ * Structure used to return clock information
+ */
+struct info_clock {
+ u_int32 clockadr;
+ u_char type;
+ u_char flags;
+ u_char lastevent;
+ u_char currentstatus;
+ u_int32 polls;
+ u_int32 noresponse;
+ u_int32 badformat;
+ u_int32 baddata;
+ u_int32 timestarted;
+ l_fp fudgetime1;
+ l_fp fudgetime2;
+ int32 fudgeval1;
+ u_int32 fudgeval2;
+};
+
+
+/*
+ * Structure used for setting clock fudge factors
+ */
+struct conf_fudge {
+ u_int32 clockadr;
+ u_int32 which;
+ l_fp fudgetime;
+ u_int32 fudgeval_flags;
+};
+
+#define FUDGE_TIME1 1
+#define FUDGE_TIME2 2
+#define FUDGE_VAL1 3
+#define FUDGE_VAL2 4
+#define FUDGE_FLAGS 5
+
+
+/*
+ * Structure used for returning clock debugging info
+ */
+#define NUMCBUGVALUES 16
+#define NUMCBUGTIMES 32
+
+struct info_clkbug {
+ u_int32 clockadr;
+ u_char nvalues;
+ u_char ntimes;
+ u_short svalues;
+ u_int32 stimes;
+ u_int32 values[NUMCBUGVALUES];
+ l_fp times[NUMCBUGTIMES];
+};
+
+/*
+ * Structure used for returning kernel pll/PPS information
+ */
+struct info_kernel {
+ int32 offset;
+ int32 freq;
+ int32 maxerror;
+ int32 esterror;
+ u_short status;
+ u_short shift;
+ int32 constant;
+ int32 precision;
+ int32 tolerance;
+
+/*
+ * Variables used only if PPS signal discipline is implemented
+ */
+ int32 ppsfreq;
+ int32 jitter;
+ int32 stabil;
+ int32 jitcnt;
+ int32 calcnt;
+ int32 errcnt;
+ int32 stbcnt;
+};
+
+/*
+ * interface statistics
+ */
+struct info_if_stats {
+ union addrun unaddr; /* address */
+ union addrun unbcast; /* broadcast */
+ union addrun unmask; /* mask */
+ u_int32 v6_flag; /* is this v6 */
+ char name[32]; /* name of interface */
+ int32 flags; /* interface flags */
+ int32 last_ttl; /* last TTL specified */
+ int32 num_mcast; /* No. of IP addresses in multicast socket */
+ int32 received; /* number of incoming packets */
+ int32 sent; /* number of outgoing packets */
+ int32 notsent; /* number of send failures */
+ int32 uptime; /* number of seconds this interface was active */
+ u_int32 scopeid; /* Scope used for Multicasting */
+ u_int32 ifindex; /* interface index - from system */
+ u_int32 ifnum; /* sequential interface number */
+ u_int32 peercnt; /* number of peers referencinf this interface - informational only */
+ u_short family; /* Address family */
+ u_char ignore_packets; /* Specify whether the packet should be ignored */
+ u_char action; /* reason the item is listed */
+ int32 _filler0; /* pad to a 64 bit size boundary */
+};
+
+#define IFS_EXISTS 1 /* just exists */
+#define IFS_CREATED 2 /* was just created */
+#define IFS_DELETED 3 /* was just delete */
+
+/*
+ * Info returned with IP -> hostname lookup
+ */
+/* 144 might need to become 32, matching data[] member of req_pkt */
+#define NTP_MAXHOSTNAME (32 - sizeof(u_int32) - sizeof(u_short))
+struct info_dns_assoc {
+ u_int32 peeraddr; /* peer address (HMS: being careful...) */
+ associd_t associd; /* association ID */
+ char hostname[NTP_MAXHOSTNAME]; /* hostname */
+};
+
+/*
+ * function declarations
+ */
+int get_packet_mode(struct recvbuf *rbufp); /* Return packet mode */
+
+#endif /* NTP_REQUEST_H */
diff --git a/include/ntp_rfc2553.h b/include/ntp_rfc2553.h
new file mode 100644
index 0000000..08ccbc4
--- /dev/null
+++ b/include/ntp_rfc2553.h
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1982, 1986, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)in.h 8.3 (Berkeley) 1/3/94
+ */
+
+/*
+ * Compatability shims with the rfc2553 API to simplify ntp.
+ */
+#ifndef NTP_RFC2553_H
+#define NTP_RFC2553_H
+
+#include <netdb.h>
+#include <isc/net.h>
+
+#include "ntp_types.h"
+#include "ntp_malloc.h"
+
+struct addrinfo *copy_addrinfo_impl(const struct addrinfo *
+#ifdef EREALLOC_CALLSITE /* from ntp_malloc.h */
+ ,
+ const char *, int
+#endif
+ );
+struct addrinfo *copy_addrinfo_list_impl(const struct addrinfo *
+#ifdef EREALLOC_CALLSITE /* from ntp_malloc.h */
+ ,
+ const char *, int
+#endif
+ );
+#ifdef EREALLOC_CALLSITE
+# define copy_addrinfo(l) \
+ copy_addrinfo_impl((l), __FILE__, __LINE__)
+# define copy_addrinfo_list(l) \
+ copy_addrinfo_list_impl((l), __FILE__, __LINE__)
+#else
+# define copy_addrinfo(l) copy_addrinfo_impl(l)
+# define copy_addrinfo_list(l) copy_addrinfo_list_impl(l)
+#endif
+
+/*
+ * If various macros are not defined we need to define them
+ */
+
+#ifndef AF_INET6
+# define AF_INET6 AF_MAX
+# define PF_INET6 AF_INET6
+#endif
+
+#if !defined(_SS_MAXSIZE) && !defined(_SS_ALIGNSIZE)
+
+# define _SS_MAXSIZE 128
+# define _SS_ALIGNSIZE (sizeof(ntp_uint64_t))
+# ifdef ISC_PLATFORM_HAVESALEN
+# define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) - sizeof(ntp_u_int8_t))
+# define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) - sizeof(ntp_u_int8_t) - \
+ _SS_PAD1SIZE - _SS_ALIGNSIZE)
+# else
+# define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(short))
+# define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(short) - \
+ _SS_PAD1SIZE - _SS_ALIGNSIZE)
+# endif /* ISC_PLATFORM_HAVESALEN */
+#endif
+
+#ifndef INET6_ADDRSTRLEN
+# define INET6_ADDRSTRLEN 46 /* max len of IPv6 addr in ascii */
+#endif
+
+/*
+ * If we don't have the sockaddr_storage structure
+ * we need to define it
+ */
+
+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
+struct sockaddr_storage {
+#ifdef ISC_PLATFORM_HAVESALEN
+ ntp_u_int8_t ss_len; /* address length */
+ ntp_u_int8_t ss_family; /* address family */
+#else
+ short ss_family; /* address family */
+#endif
+ char __ss_pad1[_SS_PAD1SIZE];
+ ntp_uint64_t __ss_align; /* force desired structure storage alignment */
+ char __ss_pad2[_SS_PAD2SIZE];
+};
+#endif
+
+/*
+ * Finally if the platform doesn't support IPv6 we need some
+ * additional definitions
+ */
+
+/*
+ * Flag values for getaddrinfo()
+ */
+#ifndef AI_PASSIVE
+#define AI_PASSIVE 0x00000001 /* get address to use bind() */
+#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
+#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
+/* valid flags for addrinfo */
+#define AI_MASK \
+ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG)
+
+#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
+#endif /* !AI_PASSIVE */
+
+#ifndef AI_NUMERICHOST /* such as AIX 4.3 */
+# define Z_AI_NUMERICHOST 0
+#else
+# define Z_AI_NUMERICHOST AI_NUMERICHOST
+#endif
+
+#ifndef AI_NUMERICSERV /* not in RFC 2553 */
+# define Z_AI_NUMERICSERV 0
+#else
+# define Z_AI_NUMERICSERV AI_NUMERICSERV
+#endif
+
+#ifndef ISC_PLATFORM_HAVEIPV6
+
+#ifdef SYS_WINNT
+# define in6_addr in_addr6
+#endif
+
+struct addrinfo {
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ size_t ai_addrlen; /* length of ai_addr */
+ char *ai_canonname; /* canonical name for hostname */
+ struct sockaddr *ai_addr; /* binary address */
+ struct addrinfo *ai_next; /* next structure in linked list */
+};
+
+/*
+ * Error return codes from getaddrinfo()
+ */
+#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
+#define EAI_AGAIN 2 /* temporary failure in name resolution */
+#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
+#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
+#define EAI_FAMILY 5 /* ai_family not supported */
+#define EAI_MEMORY 6 /* memory allocation failure */
+#define EAI_NODATA 7 /* no address associated with hostname */
+#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
+#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
+#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
+#define EAI_SYSTEM 11 /* system error returned in errno */
+#define EAI_BADHINTS 12
+#define EAI_PROTOCOL 13
+#define EAI_MAX 14
+
+
+int getaddrinfo (const char *, const char *,
+ const struct addrinfo *, struct addrinfo **);
+int getnameinfo (const struct sockaddr *, u_int, char *,
+ size_t, char *, size_t, int);
+void freeaddrinfo (struct addrinfo *);
+char *gai_strerror (int);
+
+/*
+ * Constants for getnameinfo()
+ */
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#define NI_MAXSERV 32
+#endif
+
+/*
+ * Flag values for getnameinfo()
+ */
+#ifndef NI_NUMERICHOST
+#define NI_NOFQDN 0x00000001
+#define NI_NUMERICHOST 0x00000002
+#define NI_NAMEREQD 0x00000004
+#define NI_NUMERICSERV 0x00000008
+#define NI_DGRAM 0x00000010
+#define NI_WITHSCOPEID 0x00000020
+#endif
+
+#endif /* !ISC_PLATFORM_HAVEIPV6 */
+
+/*
+ * Set up some macros to look for IPv6 and IPv6 multicast
+ */
+
+#if defined(ISC_PLATFORM_HAVEIPV6) && defined(WANT_IPV6)
+# define INCLUDE_IPV6_SUPPORT
+# if defined(IPV6_JOIN_GROUP) && defined(IPV6_LEAVE_GROUP)
+# define INCLUDE_IPV6_MULTICAST_SUPPORT
+# endif /* IPV6 Multicast Support */
+#endif /* IPv6 Support */
+
+#endif /* !NTP_RFC2553_H */
diff --git a/include/ntp_select.h b/include/ntp_select.h
new file mode 100644
index 0000000..2c0fbee
--- /dev/null
+++ b/include/ntp_select.h
@@ -0,0 +1,35 @@
+/*
+ * Not all machines define FD_SET in sys/types.h
+ */
+#ifndef NTP_SELECT_H
+#define NTP_SELECT_H /* note: tested by include/l_stdlib.h */
+
+/* Was: (defined(RS6000)||defined(SYS_PTX))&&!defined(_BSD) */
+/* Could say: !defined(FD_SET) && defined(HAVE_SYS_SELECT_H) */
+/* except FD_SET can legitimately be a typedef... */
+#if defined(HAVE_SYS_SELECT_H) && !defined(_BSD)
+# ifndef SYS_VXWORKS
+# include <sys/select.h>
+# else
+# include <sockLib.h>
+extern int select(int width, fd_set *pReadFds, fd_set *pWriteFds,
+ fd_set *pExceptFds, struct timeval *pTimeOut);
+# endif
+#endif
+
+#if !defined(FD_SET)
+# define NFDBITS 32
+# define FD_SETSIZE 32
+# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
+# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
+# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
+# define FD_ZERO(p) memset((p), 0, sizeof(*(p)))
+#endif
+
+#if defined(VMS)
+typedef struct {
+ unsigned int fds_bits[1];
+} fd_set;
+#endif
+
+#endif /* NTP_SELECT_H */
diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h
new file mode 100644
index 0000000..7c884fc
--- /dev/null
+++ b/include/ntp_stdlib.h
@@ -0,0 +1,267 @@
+/*
+ * ntp_stdlib.h - Prototypes for NTP lib.
+ */
+#ifndef NTP_STDLIB_H
+#define NTP_STDLIB_H
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#include "declcond.h" /* ntpd uses ntpd/declcond.h, others include/ */
+#include "l_stdlib.h"
+#include "ntp_net.h"
+#include "ntp_debug.h"
+#include "ntp_malloc.h"
+#include "ntp_string.h"
+#include "ntp_syslog.h"
+
+#ifdef __GNUC__
+#define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
+#else
+#define NTP_PRINTF(fmt, args)
+#endif
+
+extern int mprintf(const char *, ...) NTP_PRINTF(1, 2);
+extern int mfprintf(FILE *, const char *, ...) NTP_PRINTF(2, 3);
+extern int mvfprintf(FILE *, const char *, va_list) NTP_PRINTF(2, 0);
+extern int mvsnprintf(char *, size_t, const char *, va_list)
+ NTP_PRINTF(3, 0);
+extern int msnprintf(char *, size_t, const char *, ...)
+ NTP_PRINTF(3, 4);
+extern void msyslog(int, const char *, ...) NTP_PRINTF(2, 3);
+extern void init_logging (const char *, u_int32, int);
+extern int change_logfile (const char *, int);
+extern void setup_logfile (const char *);
+#ifndef errno_to_str
+extern void errno_to_str(int, char *, size_t);
+#endif
+
+/*
+ * When building without OpenSSL, use a few macros of theirs to
+ * minimize source differences in NTP.
+ */
+#ifndef OPENSSL
+#define NID_md5 4 /* from openssl/objects.h */
+/* from openssl/evp.h */
+#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */
+#endif
+
+#define SAVE_ERRNO(stmt) \
+ { \
+ int preserved_errno; \
+ \
+ preserved_errno = socket_errno(); \
+ { \
+ stmt \
+ } \
+ errno = preserved_errno; \
+ }
+
+typedef void (*ctrl_c_fn)(void);
+
+/* authkeys.c */
+extern void auth_delkeys (void);
+extern int auth_havekey (keyid_t);
+extern int authdecrypt (keyid_t, u_int32 *, int, int);
+extern int authencrypt (keyid_t, u_int32 *, int);
+extern int authhavekey (keyid_t);
+extern int authistrusted (keyid_t);
+extern int authreadkeys (const char *);
+extern void authtrust (keyid_t, u_long);
+extern int authusekey (keyid_t, int, const u_char *);
+
+/*
+ * Based on the NTP timestamp, calculate the NTP timestamp of
+ * the corresponding calendar unit. Use the pivot time to unfold
+ * the NTP timestamp properly, or the current system time if the
+ * pivot pointer is NULL.
+ */
+extern u_int32 calyearstart (u_int32 ntptime, const time_t *pivot);
+extern u_int32 calmonthstart (u_int32 ntptime, const time_t *pivot);
+extern u_int32 calweekstart (u_int32 ntptime, const time_t *pivot);
+extern u_int32 caldaystart (u_int32 ntptime, const time_t *pivot);
+
+extern const char *clockname (int);
+extern int clocktime (int, int, int, int, int, u_int32, u_long *, u_int32 *);
+extern int ntp_getopt (int, char **, const char *);
+extern void init_auth (void);
+extern void init_lib (void);
+extern struct savekey *auth_findkey (keyid_t);
+extern void auth_moremem (int);
+extern void auth_prealloc_symkeys(int);
+extern int ymd2yd (int, int, int);
+
+/* a_md5encrypt.c */
+extern int MD5authdecrypt (int, u_char *, u_int32 *, int, int);
+extern int MD5authencrypt (int, u_char *, u_int32 *, int);
+extern void MD5auth_setkey (keyid_t, int, const u_char *, int);
+extern u_int32 addr2refid (sockaddr_u *);
+
+/* emalloc.c */
+#ifndef EREALLOC_CALLSITE /* ntp_malloc.h defines */
+extern void * ereallocz (void *, size_t, size_t, int);
+#define erealloczsite(p, n, o, z, f, l) ereallocz(p, n, o, (z))
+extern void * emalloc (size_t);
+#define emalloc_zero(c) ereallocz(NULL, (c), 0, TRUE)
+#define erealloc(p, c) ereallocz(p, (c), 0, FALSE)
+#define erealloc_zero(p, n, o) ereallocz(p, n, (o), TRUE)
+extern char * estrdup_impl (const char *);
+#define estrdup(s) estrdup_impl(s)
+#else
+extern void * ereallocz (void *, size_t, size_t, int,
+ const char *, int);
+#define erealloczsite ereallocz
+#define emalloc(c) ereallocz(NULL, (c), 0, FALSE, \
+ __FILE__, __LINE__)
+#define emalloc_zero(c) ereallocz(NULL, (c), 0, TRUE, \
+ __FILE__, __LINE__)
+#define erealloc(p, c) ereallocz(p, (c), 0, FALSE, \
+ __FILE__, __LINE__)
+#define erealloc_zero(p, n, o) ereallocz(p, n, (o), TRUE, \
+ __FILE__, __LINE__)
+extern char * estrdup_impl (const char *, const char *, int);
+#define estrdup(s) estrdup_impl((s), __FILE__, __LINE__)
+#endif
+
+
+extern int atoint (const char *, long *);
+extern int atouint (const char *, u_long *);
+extern int hextoint (const char *, u_long *);
+extern char * humanlogtime (void);
+extern char * humantime (time_t);
+extern char * mfptoa (u_int32, u_int32, short);
+extern char * mfptoms (u_int32, u_int32, short);
+extern const char * modetoa (int);
+extern const char * eventstr (int);
+extern const char * ceventstr (int);
+extern const char * res_match_flags(u_short);
+extern const char * res_access_flags(u_short);
+#ifdef KERNEL_PLL
+extern const char * k_st_flags (u_int32);
+#endif
+extern char * statustoa (int, int);
+extern sockaddr_u * netof (sockaddr_u *);
+extern char * numtoa (u_int32);
+extern char * numtohost (u_int32);
+extern const char * socktoa (const sockaddr_u *);
+extern const char * sockporttoa(const sockaddr_u *);
+extern u_short sock_hash (const sockaddr_u *);
+extern int sockaddr_masktoprefixlen(const sockaddr_u *);
+extern const char * socktohost (const sockaddr_u *);
+extern int octtoint (const char *, u_long *);
+extern u_long ranp2 (int);
+extern const char *refnumtoa (sockaddr_u *);
+extern const char *refid_str (u_int32, int);
+
+extern int decodenetnum (const char *, sockaddr_u *);
+
+extern const char * FindConfig (const char *);
+
+extern void signal_no_reset (int, RETSIGTYPE (*func)(int));
+extern void set_ctrl_c_hook (ctrl_c_fn);
+
+extern void getauthkeys (const char *);
+extern void auth_agekeys (void);
+extern void rereadkeys (void);
+
+/*
+ * Variable declarations for libntp.
+ */
+
+/* authkeys.c */
+extern u_long authkeynotfound; /* keys not found */
+extern u_long authkeylookups; /* calls to lookup keys */
+extern u_long authnumkeys; /* number of active keys */
+extern u_long authkeyexpired; /* key lifetime expirations */
+extern u_long authkeyuncached; /* cache misses */
+extern u_long authencryptions; /* calls to encrypt */
+extern u_long authdecryptions; /* calls to decrypt */
+
+extern int authnumfreekeys;
+
+/*
+ * The key cache. We cache the last key we looked at here.
+ */
+extern keyid_t cache_keyid; /* key identifier */
+extern int cache_type; /* key type */
+extern u_char * cache_secret; /* secret */
+extern u_short cache_secretsize; /* secret octets */
+extern u_short cache_flags; /* KEY_ bit flags */
+
+/* getopt.c */
+extern char * ntp_optarg; /* global argument pointer */
+extern int ntp_optind; /* global argv index */
+
+/* lib_strbuf.c */
+extern int ipv4_works;
+extern int ipv6_works;
+
+/* machines.c */
+typedef void (*pset_tod_using)(const char *);
+extern pset_tod_using set_tod_using;
+
+/* ssl_init.c */
+#ifdef OPENSSL
+extern void ssl_init (void);
+extern void ssl_check_version (void);
+extern int ssl_init_done;
+#define INIT_SSL() \
+ do { \
+ if (!ssl_init_done) \
+ ssl_init(); \
+ } while (0)
+#else /* !OPENSSL follows */
+#define INIT_SSL() do {} while (0)
+#endif
+extern int keytype_from_text (const char *, size_t *);
+extern const char *keytype_name (int);
+extern char * getpass_keytype (int);
+
+/* strl-obsd.c */
+#ifndef HAVE_STRLCPY /* + */
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+extern size_t strlcpy(char *dst, const char *src, size_t siz);
+#endif
+#ifndef HAVE_STRLCAT /* + */
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+extern size_t strlcat(char *dst, const char *src, size_t siz);
+#endif
+
+
+
+/* lib/isc/win32/strerror.c
+ *
+ * To minimize Windows-specific changes to the rest of the NTP code,
+ * particularly reference clocks, we hijack calls to strerror() to deal
+ * with our mixture of error codes from the C runtime (open, write)
+ * and Windows (sockets, serial ports). This is an ugly hack because
+ * both use the lowest values differently, but particularly for ntpd,
+ * it's not a problem.
+ */
+#ifdef NTP_REDEFINE_STRERROR
+#define strerror(e) ntp_strerror(e)
+extern char * ntp_strerror (int e);
+#endif
+
+/* systime.c */
+extern double sys_tick; /* tick size or time to read */
+extern double measured_tick; /* non-overridable sys_tick */
+extern double sys_fuzz; /* min clock read latency */
+extern int trunc_os_clock; /* sys_tick > measured_tick */
+
+/* version.c */
+extern const char *Version; /* version declaration */
+
+#endif /* NTP_STDLIB_H */
diff --git a/include/ntp_string.h b/include/ntp_string.h
new file mode 100644
index 0000000..9b62ec2
--- /dev/null
+++ b/include/ntp_string.h
@@ -0,0 +1,37 @@
+/*
+ * Define string ops: strchr strrchr memcmp memmove memset
+ */
+
+#ifndef NTP_STRING_H
+#define NTP_STRING_H
+
+#ifdef HAVE_MEMORY_H
+# include <memory.h>
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+#ifdef HAVE_BSTRING_H
+# include <bstring.h>
+#endif
+
+#ifdef NTP_NEED_BOPS
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h> /* bcmp, bcopy, bzero */
+#endif
+
+void ntp_memset (char *, int, int);
+
+#define memcmp(a, b, c) bcmp(a, b, (int)(c))
+#define memmove(t, f, c) bcopy(f, t, (int)(c))
+#define memcpy(t, f, c) bcopy(f, t, (int)(c))
+#define memset(a, x, c) if (0 == (x)) \
+ bzero(a, (int)(c)); \
+ else \
+ ntp_memset((char *)(a), x, c)
+#endif /* NTP_NEED_BOPS */
+
+#endif /* NTP_STRING_H */
diff --git a/include/ntp_syscall.h b/include/ntp_syscall.h
new file mode 100644
index 0000000..d1ce03e
--- /dev/null
+++ b/include/ntp_syscall.h
@@ -0,0 +1,56 @@
+/*
+ * ntp_syscall.h - various ways to perform the ntp_adjtime() and ntp_gettime()
+ * system calls.
+ */
+
+#ifndef NTP_SYSCALL_H
+#define NTP_SYSCALL_H
+
+#ifdef HAVE_SYS_TIMEX_H
+# include <sys/timex.h>
+#endif
+
+#ifndef NTP_SYSCALLS_LIBC
+# ifdef NTP_SYSCALLS_STD
+# define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
+# define ntp_gettime(t) syscall(SYS_ntp_gettime, (t))
+# else /* !NTP_SYSCALLS_STD */
+# ifdef HAVE_NTP_ADJTIME
+extern int ntp_adjtime (struct timex *);
+
+# ifndef HAVE_STRUCT_NTPTIMEVAL
+struct ntptimeval
+{
+ struct timeval time; /* current time (ro) */
+ long int maxerror; /* maximum error (us) (ro) */
+ long int esterror; /* estimated error (us) (ro) */
+};
+# endif
+
+# ifndef HAVE_NTP_GETTIME
+static inline int
+ntp_gettime(
+ struct ntptimeval *ntv
+ )
+{
+ struct timex tntx;
+ int result;
+
+ ZERO(tntx);
+ result = ntp_adjtime(&tntx);
+ ntv->time = tntx.time;
+ ntv->maxerror = tntx.maxerror;
+ ntv->esterror = tntx.esterror;
+# ifdef NTP_API
+# if NTP_API > 3
+ ntv->tai = tntx.tai;
+# endif
+# endif
+ return result;
+}
+# endif /* !HAVE_NTP_GETTIME */
+# endif /* !HAVE_NTP_ADJTIME */
+# endif /* !NTP_SYSCALLS_STD */
+#endif /* !NTP_SYSCALLS_LIBC */
+
+#endif /* NTP_SYSCALL_H */
diff --git a/include/ntp_syslog.h b/include/ntp_syslog.h
new file mode 100644
index 0000000..a0152b5
--- /dev/null
+++ b/include/ntp_syslog.h
@@ -0,0 +1,85 @@
+/*
+ * A hack for platforms which require specially built syslog facilities
+ */
+
+#ifndef NTP_SYSLOG_H
+#define NTP_SYSLOG_H
+
+#include <ntp_types.h> /* u_int32 type */
+
+#ifdef VMS
+extern void msyslog();
+#else
+# ifndef SYS_VXWORKS
+# include <syslog.h>
+# endif
+#endif /* VMS */
+#include <stdio.h>
+
+extern int syslogit;
+extern int msyslog_term; /* duplicate to stdout/err */
+extern int msyslog_term_pid;
+extern int msyslog_include_timestamp;
+extern FILE * syslog_file; /* if syslogit is FALSE, log to
+ this file and not syslog */
+extern char * syslog_fname;
+extern char * syslog_abs_fname;
+
+#if defined(VMS) || defined (SYS_VXWORKS)
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but signification condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
+#endif /* VMS || VXWORKS */
+
+/*
+ * syslog output control
+ */
+#define NLOG_INFO 0x00000001
+#define NLOG_EVENT 0x00000002
+#define NLOG_STATUS 0x00000004
+#define NLOG_STATIST 0x00000008
+
+#define NLOG_OSYS 0 /* offset for system flags */
+#define NLOG_SYSMASK 0x0000000F /* system log events */
+#define NLOG_SYSINFO 0x00000001 /* system info log events */
+#define NLOG_SYSEVENT 0x00000002 /* system events */
+#define NLOG_SYSSTATUS 0x00000004 /* system status (sync/unsync) */
+#define NLOG_SYSSTATIST 0x00000008 /* system statistics output */
+
+#define NLOG_OPEER 4 /* offset for peer flags */
+#define NLOG_PEERMASK 0x000000F0 /* peer log events */
+#define NLOG_PEERINFO 0x00000010 /* peer info log events */
+#define NLOG_PEEREVENT 0x00000020 /* peer events */
+#define NLOG_PEERSTATUS 0x00000040 /* peer status (sync/unsync) */
+#define NLOG_PEERSTATIST 0x00000080 /* peer statistics output */
+
+#define NLOG_OCLOCK 8 /* offset for clock flags */
+#define NLOG_CLOCKMASK 0x00000F00 /* clock log events */
+#define NLOG_CLOCKINFO 0x00000100 /* clock info log events */
+#define NLOG_CLOCKEVENT 0x00000200 /* clock events */
+#define NLOG_CLOCKSTATUS 0x00000400 /* clock status (sync/unsync) */
+#define NLOG_CLOCKSTATIST 0x00000800 /* clock statistics output */
+
+#define NLOG_OSYNC 12 /* offset for sync flags */
+#define NLOG_SYNCMASK 0x0000F000 /* sync log events */
+#define NLOG_SYNCINFO 0x00001000 /* sync info log events */
+#define NLOG_SYNCEVENT 0x00002000 /* sync events */
+#define NLOG_SYNCSTATUS 0x00004000 /* sync status (sync/unsync) */
+#define NLOG_SYNCSTATIST 0x00008000 /* sync statistics output */
+
+extern u_int32 ntp_syslogmask;
+
+#define NLOG(bits) if (ntp_syslogmask & (bits))
+
+#define LOGIF(nlog_suffix, msl_args) \
+do { \
+ NLOG(NLOG_##nlog_suffix) /* like "if (...) */ \
+ msyslog msl_args; \
+} while (FALSE)
+
+#endif /* NTP_SYSLOG_H */
diff --git a/include/ntp_tty.h b/include/ntp_tty.h
new file mode 100644
index 0000000..6dc48b6
--- /dev/null
+++ b/include/ntp_tty.h
@@ -0,0 +1,103 @@
+/*
+ * ntp_tty.h - header file for serial lines handling
+ */
+#ifndef NTP_TTY_H
+#define NTP_TTY_H
+
+/*
+ * use only one tty model - no use in initialising
+ * a tty in three ways
+ * HAVE_TERMIOS is preferred over HAVE_SYSV_TTYS over HAVE_BSD_TTYS
+ */
+
+#if defined(HAVE_TERMIOS_H) || defined(HAVE_SYS_TERMIOS_H)
+# define HAVE_TERMIOS
+#elif defined(HAVE_TERMIO_H)
+# define HAVE_SYSV_TTYS
+#elif defined(HAVE_SGTTY_H)
+# define HAVE_BSD_TTYS
+#endif
+
+#if !defined(VMS) && !defined(SYS_VXWORKS)
+# if !defined(HAVE_SYSV_TTYS) \
+ && !defined(HAVE_BSD_TTYS) \
+ && !defined(HAVE_TERMIOS)
+#include "ERROR: no tty type defined!"
+# endif
+#endif /* !VMS && !SYS_VXWORKS*/
+
+#if defined(HAVE_BSD_TTYS)
+#include <sgtty.h>
+#define TTY struct sgttyb
+#endif /* HAVE_BSD_TTYS */
+
+#if defined(HAVE_SYSV_TTYS)
+#include <termio.h>
+#define TTY struct termio
+#ifndef tcsetattr
+#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
+#endif
+#ifndef TCSANOW
+#define TCSANOW TCSETA
+#endif
+#ifndef TCIFLUSH
+#define TCIFLUSH 0
+#endif
+#ifndef TCOFLUSH
+#define TCOFLUSH 1
+#endif
+#ifndef TCIOFLUSH
+#define TCIOFLUSH 2
+#endif
+#ifndef tcflush
+#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
+#endif
+#endif /* HAVE_SYSV_TTYS */
+
+#if defined(HAVE_TERMIOS)
+# if defined(HAVE_TERMIOS_H)
+# ifdef TERMIOS_NEEDS__SVID3
+# define _SVID3
+# endif
+# include <termios.h>
+# ifdef TERMIOS_NEEDS__SVID3
+# undef _SVID3
+# endif
+# elif defined(HAVE_SYS_TERMIOS_H)
+# include <sys/termios.h>
+# endif
+# define TTY struct termios
+#endif
+
+#if defined(HAVE_SYS_MODEM_H)
+#include <sys/modem.h>
+#endif
+
+/*
+ * Line discipline flags. The depredated ones required line discipline
+ * or streams modules to be installed/loaded in the kernel and are now
+ * ignored. Leave the LDISC_CLK and other deprecated symbols defined
+ * until 2013 or 2014 to avoid complicating the use of newer drivers on
+ * older ntpd, which is often as easy as dropping in the refclock *.c.
+ */
+#define LDISC_STD 0x000 /* standard */
+#define LDISC_CLK 0x001 /* depredated tty_clk \n */
+#define LDISC_CLKPPS 0x002 /* depredated tty_clk \377 */
+#define LDISC_ACTS 0x004 /* depredated tty_clk #* */
+#define LDISC_CHU 0x008 /* depredated */
+#define LDISC_PPS 0x010 /* depredated */
+#define LDISC_RAW 0x020 /* raw binary */
+#define LDISC_ECHO 0x040 /* enable echo */
+#define LDISC_REMOTE 0x080 /* remote mode */
+#define LDISC_7O1 0x100 /* 7-bit, odd parity for Z3801A */
+
+/* function prototypes for ntp_tty.c */
+#if !defined(SYS_VXWORKS) && !defined(SYS_WINNT)
+# if defined(HAVE_TERMIOS) || defined(HAVE_SYSV_TTYS) || \
+ defined(HAVE_BSD_TTYS)
+extern int ntp_tty_setup(int, u_int, u_int);
+extern int ntp_tty_ioctl(int, u_int);
+# endif
+#endif
+
+#endif /* NTP_TTY_H */
diff --git a/include/ntp_types.h b/include/ntp_types.h
new file mode 100644
index 0000000..1beb166
--- /dev/null
+++ b/include/ntp_types.h
@@ -0,0 +1,288 @@
+/*
+ * ntp_types.h - defines how int32 and u_int32 are treated.
+ *
+ * New style: Make sure C99 fixed width integer types are available:
+ * intN_t and uintN_t
+
+ * Old style: defines how int32 and u_int32 are treated.
+ * For 64 bit systems like the DEC Alpha, they have to be defined
+ * as int and u_int.
+ * For 32 bit systems, define them as long and u_long
+ */
+#ifndef NTP_TYPES_H
+#define NTP_TYPES_H
+
+#include <sys/types.h>
+#if defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+# include <stdint.h>
+#endif
+
+#include "ntp_machine.h"
+
+
+#ifndef TRUE
+# define TRUE 1
+#endif
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+/*
+ * This is another naming conflict.
+ * On NetBSD for MAC the macro "mac" is defined as 1
+ * this is fun for us as a packet structure contains an
+ * optional "mac" member - severe confusion results 8-)
+ * As we hopefully do not have to rely on that macro we
+ * just undefine that.
+ */
+#ifdef mac
+#undef mac
+#endif
+
+/*
+ * used to quiet compiler warnings
+ */
+#ifndef UNUSED_ARG
+#define UNUSED_ARG(arg) ((void)(arg))
+#endif
+#ifndef UNUSED_LOCAL
+#define UNUSED_LOCAL(arg) ((void)(arg))
+#endif
+
+/*
+ * COUNTOF(array) - size of array in elements
+ */
+#define COUNTOF(arr) (sizeof(arr) / sizeof((arr)[0]))
+
+/*
+ * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H,
+ * and u_int isn't defined anywhere
+ */
+#if defined(VMS)
+#include <socket.h>
+typedef unsigned int u_int;
+#endif /* VMS */
+
+#ifdef HAVE_UINT32_T
+# ifndef HAVE_INT32
+ typedef int32_t int32;
+# endif
+# ifndef HAVE_U_INT32
+ typedef uint32_t u_int32;
+# if defined(UINT32_MAX) && !defined(U_INT32_MAX)
+# define U_INT32_MAX UINT32_MAX
+# endif
+# endif
+#elif (SIZEOF_INT == 4)
+# if !defined(HAVE_INT32) && !defined(int32)
+ typedef int int32;
+# ifndef INT32_MIN
+# define INT32_MIN INT_MIN
+# endif
+# ifndef INT32_MAX
+# define INT32_MAX INT_MAX
+# endif
+# endif
+# if !defined(HAVE_U_INT32) && !defined(u_int32)
+ typedef unsigned u_int32;
+# if defined(UINT_MAX) && !defined(U_INT32_MAX)
+# define U_INT32_MAX UINT_MAX
+# endif
+# endif
+#else /* SIZEOF_INT != 4 */
+# if (SIZEOF_LONG == 4)
+# if !defined(HAVE_INT32) && !defined(int32)
+ typedef long int32;
+# ifndef INT32_MIN
+# define INT32_MIN LONG_MIN
+# endif
+# ifndef INT32_MAX
+# define INT32_MAX LONG_MAX
+# endif
+# endif
+# if !defined(HAVE_U_INT32) && !defined(u_int32)
+ typedef unsigned long u_int32;
+# if defined(ULONG_MAX) && !defined(U_INT32_MAX)
+# define U_INT32_MAX ULONG_MAX
+# endif
+# endif
+# else /* SIZEOF_LONG != 4 */
+# include "Bletch: what's 32 bits on this machine?"
+# endif
+#endif /* !HAVE_UINT32_T && SIZEOF_INT != 4 */
+
+#ifndef U_INT32_MAX
+# define U_INT32_MAX 0xffffffff
+#endif
+
+
+/*
+ * Ugly dance to find out if we have 64bit integer type.
+ */
+#if !defined(HAVE_INT64)
+
+/* assume best for now, fix if frustrated later. */
+# define HAVE_INT64
+# define HAVE_U_INT64
+
+/* now check the cascade. Feel free to add things. */
+# ifdef INT64_MAX
+
+typedef int64_t int64;
+typedef uint64_t u_int64;
+
+# elif SIZEOF_LONG == 8
+
+typedef long int64;
+typedef unsigned long u_int64;
+
+# elif SIZEOF_LONG_LONG == 8
+
+typedef long long int64;
+typedef unsigned long long u_int64;
+
+# else
+
+/* no 64bit scalar, give it up. */
+# undef HAVE_INT64
+# undef HAVE_U_INT64
+
+# endif
+
+#endif
+
+/*
+ * and here the trouble starts: We need a representation with more than
+ * 64 bits. If a scalar of that size is not available, we need a struct
+ * that holds the value in split representation.
+ *
+ * To ease the usage a bit, we alwys use a union that is in processor
+ * byte order and might or might not contain a 64bit scalar.
+ */
+
+#if SIZEOF_SHORT != 2
+# error short is not 2 bytes -- what is 16 bit integer on this target?
+#endif
+
+typedef union {
+# ifdef WORDS_BIGENDIAN
+ struct {
+ int16_t hh; uint16_t hl; uint16_t lh; uint16_t ll;
+ } w_s;
+ struct {
+ uint16_t hh; uint16_t hl; uint16_t lh; uint16_t ll;
+ } W_s;
+ struct {
+ int32 hi; u_int32 lo;
+ } d_s;
+ struct {
+ u_int32 hi; u_int32 lo;
+ } D_s;
+# else
+ struct {
+ uint16_t ll; uint16_t lh; uint16_t hl; int16_t hh;
+ } w_s;
+ struct {
+ uint16_t ll; uint16_t lh; uint16_t hl; uint16_t hh;
+ } W_s;
+ struct {
+ u_int32 lo; int32 hi;
+ } d_s;
+ struct {
+ u_int32 lo; u_int32 hi;
+ } D_s;
+# endif
+
+# ifdef HAVE_INT64
+ int64 q_s; /* signed quad scalar */
+ u_int64 Q_s; /* unsigned quad scalar */
+# endif
+} vint64; /* variant int 64 */
+
+
+typedef uint8_t ntp_u_int8_t;
+typedef uint16_t ntp_u_int16_t;
+typedef uint32_t ntp_u_int32_t;
+
+typedef struct ntp_uint64_t { u_int32 val[2]; } ntp_uint64_t;
+
+typedef uint16_t associd_t; /* association ID */
+#define ASSOCID_MAX USHRT_MAX
+typedef u_int32 keyid_t; /* cryptographic key ID */
+#define KEYID_T_MAX (0xffffffff)
+typedef u_int32 tstamp_t; /* NTP seconds timestamp */
+
+/*
+ * Cloning malloc()'s behavior of always returning pointers suitably
+ * aligned for the strictest alignment requirement of any type is not
+ * easy to do portably, as the maximum alignment required is not
+ * exposed. Use the size of a union of the types known to represent the
+ * strictest alignment on some platform.
+ */
+typedef union max_alignment_tag {
+ double d;
+} max_alignment;
+
+#define MAXALIGN sizeof(max_alignment)
+#define ALIGN_UNITS(sz) (((sz) + MAXALIGN - 1) / MAXALIGN)
+#define ALIGNED_SIZE(sz) (MAXALIGN * ALIGN_UNITS(sz))
+#define INC_ALIGNED_PTR(b, m) ((void *)aligned_ptr((void *)(b), m))
+
+static inline
+max_alignment *
+aligned_ptr(
+ max_alignment * base,
+ size_t minsize
+ )
+{
+ return base + ALIGN_UNITS((minsize < 1) ? 1 : minsize);
+}
+
+/*
+ * Macro to use in otherwise-empty source files to comply with ANSI C
+ * requirement that each translation unit (source file) contain some
+ * declaration. This has commonly been done by declaring an unused
+ * global variable of type int or char. An extern reference to exit()
+ * serves the same purpose without bloat.
+ */
+#define NONEMPTY_TRANSLATION_UNIT extern void exit(int);
+
+/*
+ * On Unix struct sock_timeval is equivalent to struct timeval.
+ * On Windows built with 64-bit time_t, sock_timeval.tv_sec is a long
+ * as required by Windows' socket() interface timeout argument, while
+ * timeval.tv_sec is time_t for the more common use as a UTC time
+ * within NTP.
+ */
+#ifndef SYS_WINNT
+#define sock_timeval timeval
+#endif
+
+/*
+ * On Unix open() works for tty (serial) devices just fine, while on
+ * Windows refclock serial devices are opened using CreateFile, a lower
+ * level than the CRT-provided descriptors, because the C runtime lacks
+ * tty APIs. For refclocks which wish to use open() as well as or
+ * instead of refclock_open(), tty_open() is equivalent to open() on
+ * Unix and implemented in the Windows port similarly to
+ * refclock_open().
+ * Similarly, the termios emulation in the Windows code needs to know
+ * about serial ports being closed, while the Posix systems do not.
+ */
+#ifndef SYS_WINNT
+# define tty_open(f, a, m) open(f, a, m)
+# define closeserial(fd) close(fd)
+# define closesocket(fd) close(fd)
+typedef int SOCKET;
+# define INVALID_SOCKET (-1)
+# define SOCKET_ERROR (-1)
+# define socket_errno() (errno)
+#else /* SYS_WINNT follows */
+# define socket_errno() (errno = WSAGetLastError())
+#endif
+
+
+
+#endif /* NTP_TYPES_H */
diff --git a/include/ntp_unixtime.h b/include/ntp_unixtime.h
new file mode 100644
index 0000000..eaa8b1e
--- /dev/null
+++ b/include/ntp_unixtime.h
@@ -0,0 +1,47 @@
+/*
+ * ntp_unixtime.h - much of what was here is now in timevalops.h
+ */
+
+#ifndef NTP_UNIXTIME_H
+#define NTP_UNIXTIME_H
+
+#include "ntp_types.h" /* picks up time.h via ntp_machine.h */
+#include "ntp_calendar.h"
+
+#ifdef SIM
+# define GETTIMEOFDAY(a, b) (node_gettime(&ntp_node, a))
+# define SETTIMEOFDAY(a, b) (node_settime(&ntp_node, a))
+# define ADJTIMEOFDAY(a, b) (node_adjtime(&ntp_node, a, b))
+#else
+# define ADJTIMEOFDAY(a, b) (adjtime(a, b))
+/* gettimeofday() takes two args in BSD and only one in SYSV */
+# if defined(HAVE_SYS_TIMERS_H) && defined(HAVE_GETCLOCK)
+# include <sys/timers.h>
+int getclock (int clock_type, struct timespec *tp);
+# define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
+# define SETTIMEOFDAY(a, b) (settimeofday(a, b))
+# else /* not (HAVE_SYS_TIMERS_H && HAVE_GETCLOCK) */
+# ifdef SYSV_TIMEOFDAY
+# define GETTIMEOFDAY(a, b) (gettimeofday(a))
+# define SETTIMEOFDAY(a, b) (settimeofday(a))
+# else /* ! SYSV_TIMEOFDAY */
+#if defined SYS_CYGWIN32
+# define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
+# define SETTIMEOFDAY(a, b) (settimeofday_NT(a))
+#else
+# define GETTIMEOFDAY(a, b) (gettimeofday(a, b))
+# define SETTIMEOFDAY(a, b) (settimeofday(a, b))
+#endif
+# endif /* SYSV_TIMEOFDAY */
+# endif /* not (HAVE_SYS_TIMERS_H && HAVE_GETCLOCK) */
+#endif /* SIM */
+
+/*
+ * Time of day conversion constant. Ntp's time scale starts in 1900,
+ * Unix in 1970. The value is 1970 - 1900 in seconds, 0x83aa7e80 or
+ * 2208988800. This is larger than 32-bit INT_MAX, so unsigned
+ * type is forced.
+ */
+#define JAN_1970 ((u_int)NTP_TO_UNIX_DAYS * (u_int)SECSPERDAY)
+
+#endif /* !defined(NTP_UNIXTIME_H) */
diff --git a/include/ntp_worker.h b/include/ntp_worker.h
new file mode 100644
index 0000000..f7e8d5b
--- /dev/null
+++ b/include/ntp_worker.h
@@ -0,0 +1,162 @@
+/*
+ * ntp_worker.h
+ */
+
+#ifndef NTP_WORKER_H
+#define NTP_WORKER_H
+
+#include "ntp_workimpl.h"
+
+#ifdef WORKER
+# if defined(WORK_THREAD) && defined(WORK_PIPE)
+# ifdef HAVE_SEMAPHORE_H
+# include <semaphore.h>
+# endif
+# endif
+#include "ntp_stdlib.h"
+
+/* #define TEST_BLOCKING_WORKER */ /* ntp_config.c ntp_intres.c */
+
+typedef enum blocking_work_req_tag {
+ BLOCKING_GETNAMEINFO,
+ BLOCKING_GETADDRINFO,
+} blocking_work_req;
+
+typedef void (*blocking_work_callback)(blocking_work_req, void *, size_t, void *);
+
+typedef enum blocking_magic_sig_e {
+ BLOCKING_REQ_MAGIC = 0x510c7ecf,
+ BLOCKING_RESP_MAGIC = 0x510c7e54,
+} blocking_magic_sig;
+
+/*
+ * The same header is used for both requests to and responses from
+ * the child. In the child, done_func and context are opaque.
+ */
+typedef struct blocking_pipe_header_tag {
+ size_t octets;
+ blocking_magic_sig magic_sig;
+ blocking_work_req rtype;
+ u_int child_idx;
+ blocking_work_callback done_func;
+ void * context;
+} blocking_pipe_header;
+
+# ifdef WORK_THREAD
+# ifdef WORK_PIPE
+typedef pthread_t * thr_ref;
+typedef sem_t * sem_ref;
+# else
+typedef HANDLE thr_ref;
+typedef HANDLE sem_ref;
+# endif
+# endif
+
+/*
+ *
+ */
+#ifdef WORK_FORK
+typedef struct blocking_child_tag {
+ int reusable;
+ int pid;
+ int req_write_pipe; /* parent */
+ int resp_read_pipe;
+ void * resp_read_ctx;
+ int req_read_pipe; /* child */
+ int resp_write_pipe;
+ int ispipe;
+} blocking_child;
+#elif defined(WORK_THREAD)
+typedef struct blocking_child_tag {
+/*
+ * blocking workitems and blocking_responses are dynamically-sized
+ * one-dimensional arrays of pointers to blocking worker requests and
+ * responses.
+ */
+ int reusable;
+ thr_ref thread_ref;
+ u_int thread_id;
+ blocking_pipe_header * volatile * volatile
+ workitems;
+ volatile size_t workitems_alloc;
+ size_t next_workitem; /* parent */
+ size_t next_workeritem; /* child */
+ blocking_pipe_header * volatile * volatile
+ responses;
+ volatile size_t responses_alloc;
+ size_t next_response; /* child */
+ size_t next_workresp; /* parent */
+ /* event handles / sem_t pointers */
+ /* sem_ref child_is_blocking; */
+ sem_ref blocking_req_ready;
+ sem_ref wake_scheduled_sleep;
+#ifdef WORK_PIPE
+ int resp_read_pipe; /* parent */
+ int resp_write_pipe;/* child */
+ int ispipe;
+ void * resp_read_ctx; /* child */
+#else
+ sem_ref blocking_response_ready;
+#endif
+} blocking_child;
+
+#endif /* WORK_THREAD */
+
+extern blocking_child ** blocking_children;
+extern size_t blocking_children_alloc;
+extern int worker_per_query; /* boolean */
+extern int intres_req_pending;
+
+extern u_int available_blocking_child_slot(void);
+extern int queue_blocking_request(blocking_work_req, void *,
+ size_t, blocking_work_callback,
+ void *);
+extern int queue_blocking_response(blocking_child *,
+ blocking_pipe_header *, size_t,
+ const blocking_pipe_header *);
+extern void process_blocking_resp(blocking_child *);
+extern int send_blocking_req_internal(blocking_child *,
+ blocking_pipe_header *,
+ void *);
+extern int send_blocking_resp_internal(blocking_child *,
+ blocking_pipe_header *);
+extern blocking_pipe_header *
+ receive_blocking_req_internal(blocking_child *);
+extern blocking_pipe_header *
+ receive_blocking_resp_internal(blocking_child *);
+extern int blocking_child_common(blocking_child *);
+extern void exit_worker(int)
+ __attribute__ ((__noreturn__));
+extern int worker_sleep(blocking_child *, time_t);
+extern void worker_idle_timer_fired(void);
+extern void interrupt_worker_sleep(void);
+extern int req_child_exit(blocking_child *);
+#ifndef HAVE_IO_COMPLETION_PORT
+extern int pipe_socketpair(int fds[2], int *is_pipe);
+extern void close_all_beyond(int);
+extern void close_all_except(int);
+extern void kill_asyncio (int);
+#endif
+
+# ifdef WORK_PIPE
+typedef void (*addremove_io_fd_func)(int, int, int);
+extern addremove_io_fd_func addremove_io_fd;
+# else
+extern void handle_blocking_resp_sem(void *);
+typedef void (*addremove_io_semaphore_func)(sem_ref, int);
+extern addremove_io_semaphore_func addremove_io_semaphore;
+# endif
+
+# ifdef WORK_FORK
+extern int worker_process;
+# endif
+
+#endif /* WORKER */
+
+#if defined(HAVE_DROPROOT) && defined(WORK_FORK)
+extern void fork_deferred_worker(void);
+#else
+# define fork_deferred_worker() do {} while (0)
+#endif
+
+#endif /* !NTP_WORKER_H */
diff --git a/include/ntp_workimpl.h b/include/ntp_workimpl.h
new file mode 100644
index 0000000..a86c2cd
--- /dev/null
+++ b/include/ntp_workimpl.h
@@ -0,0 +1,30 @@
+/*
+ * ntp_workimpl.h - selects worker child implementation
+ */
+#ifndef NTP_WORKIMPL_H
+#define NTP_WORKIMPL_H
+
+/*
+ * Some systems do not support fork() and don't have an alternate
+ * threads implementation of ntp_intres. Such systems are limited
+ * to using numeric IP addresses.
+ */
+#if defined(SYS_WINNT)
+# define WORK_THREAD
+#elif defined(ISC_PLATFORM_USETHREADS) && \
+ defined(HAVE_SEM_TIMEDWAIT) && \
+ (defined(HAVE_GETCLOCK) || defined(HAVE_CLOCK_GETTIME))
+# define WORK_THREAD
+# define WORK_PIPE
+#elif defined(VMS) || defined(SYS_VXWORKS)
+ /* empty */
+#elif defined(HAVE_WORKING_FORK)
+# define WORK_FORK
+# define WORK_PIPE
+#endif
+
+#if defined(WORK_FORK) || defined(WORK_THREAD)
+# define WORKER
+#endif
+
+#endif /* !NTP_WORKIMPL_H */
diff --git a/include/ntpd.h b/include/ntpd.h
new file mode 100644
index 0000000..51d8f2a
--- /dev/null
+++ b/include/ntpd.h
@@ -0,0 +1,568 @@
+/*
+ * ntpd.h - Prototypes and external variables for ntpd.
+ *
+ * Note the first half is primarily function prototypes, type
+ * declarations, and preprocessor macros, with variables declared
+ * primarily in the second half.
+ *
+ * Each half is further divided into sections for each source file.
+ */
+
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include "ntp_syslog.h"
+#include "ntp_debug.h"
+#include "ntp_syslog.h"
+#include "ntp_select.h"
+#include "ntp_malloc.h"
+#include "ntp_refclock.h"
+#include "ntp_intres.h"
+#include "recvbuff.h"
+
+/*
+ * First half: ntpd types, functions, macros
+ * -----------------------------------------
+ */
+
+/*
+ * macro for debugging output - cut down on #ifdef pollution.
+ *
+ * DPRINTF() is for use by ntpd only, and compiles away to nothing
+ * without DEBUG (configure --disable-debugging).
+ *
+ * TRACE() is similar for libntp and utilities, which retain full
+ * debug capability even when compiled without DEBUG.
+ *
+ * The calling convention is not attractive:
+ * DPRINTF(debuglevel, (fmt, ...));
+ * DPRINTF(2, ("shows #ifdef DEBUG and if debug >= %d\n", 2));
+ */
+#ifdef DEBUG
+# define DPRINTF(lvl, arg) \
+ do { \
+ if (debug >= (lvl)) \
+ mprintf arg; \
+ } while (0)
+#else
+# define DPRINTF(lvl, arg) do {} while (0)
+#endif
+
+
+/* nt_clockstuff.c */
+#ifdef SYS_WINNT
+extern void win_time_stepped(void);
+#endif
+
+/* ntp_config.c */
+#define TAI_1972 10 /* initial TAI offset (s) */
+extern char *keysdir; /* crypto keys and leaptable directory */
+extern char * saveconfigdir; /* ntpq saveconfig output directory */
+
+extern void getconfig (int, char **);
+extern void ctl_clr_stats (void);
+extern int ctlclrtrap (sockaddr_u *, struct interface *, int);
+extern u_short ctlpeerstatus (struct peer *);
+extern int ctlsettrap (sockaddr_u *, struct interface *, int, int);
+extern u_short ctlsysstatus (void);
+extern void init_control (void);
+extern void process_control (struct recvbuf *, int);
+extern void report_event (int, struct peer *, const char *);
+extern int mprintf_event (int, struct peer *, const char *, ...)
+ NTP_PRINTF(3, 4);
+
+/* ntp_control.c */
+/*
+ * Structure for translation tables between internal system
+ * variable indices and text format.
+ */
+struct ctl_var {
+ u_short code;
+ u_short flags;
+ char *text;
+};
+/*
+ * Flag values
+ */
+#define CAN_READ 0x01
+#define CAN_WRITE 0x02
+
+#define DEF 0x20
+#define PADDING 0x40
+#define EOV 0x80
+
+#define RO (CAN_READ)
+#define WO (CAN_WRITE)
+#define RW (CAN_READ|CAN_WRITE)
+
+extern char * add_var (struct ctl_var **, u_long, u_short);
+extern void free_varlist (struct ctl_var *);
+extern void set_var (struct ctl_var **, const char *, u_long, u_short);
+extern void set_sys_var (const char *, u_long, u_short);
+extern const char * get_ext_sys_var(const char *tag);
+
+/* ntp_io.c */
+typedef struct interface_info {
+ endpt * ep;
+ u_char action;
+} interface_info_t;
+
+typedef void (*interface_receiver_t) (void *, interface_info_t *);
+
+extern void interface_enumerate (interface_receiver_t, void *);
+extern endpt * getinterface (sockaddr_u *, u_int32);
+extern endpt * select_peerinterface (struct peer *, sockaddr_u *,
+ endpt *);
+extern endpt * findinterface (sockaddr_u *);
+extern endpt * findbcastinter (sockaddr_u *);
+extern void enable_broadcast (endpt *, sockaddr_u *);
+extern void enable_multicast_if (endpt *, sockaddr_u *);
+extern void interface_update (interface_receiver_t, void *);
+#ifndef HAVE_IO_COMPLETION_PORT
+extern void io_handler (void);
+#endif
+extern void init_io (void);
+extern void io_open_sockets (void);
+extern void io_clr_stats (void);
+extern void io_setbclient (void);
+extern void io_unsetbclient (void);
+extern void io_multicast_add(sockaddr_u *);
+extern void io_multicast_del(sockaddr_u *);
+extern void sendpkt (sockaddr_u *, struct interface *, int, struct pkt *, int);
+#ifdef DEBUG
+extern void collect_timing (struct recvbuf *, const char *, int, l_fp *);
+#endif
+#ifdef HAVE_SIGNALED_IO
+extern void wait_for_signal (void);
+extern void unblock_io_and_alarm (void);
+extern void block_io_and_alarm (void);
+# define UNBLOCK_IO_AND_ALARM() unblock_io_and_alarm()
+# define BLOCK_IO_AND_ALARM() block_io_and_alarm()
+#else
+# define UNBLOCK_IO_AND_ALARM() do {} while (0)
+# define BLOCK_IO_AND_ALARM() do {} while (0)
+#endif
+#define latoa(pif) localaddrtoa(pif)
+extern const char * localaddrtoa(endpt *);
+
+/* ntp_loopfilter.c */
+extern void init_loopfilter(void);
+extern int local_clock(struct peer *, double);
+extern void adj_host_clock(void);
+extern void loop_config(int, double);
+extern void select_loop(int);
+extern void huffpuff(void);
+extern u_long sys_clocktime;
+extern u_int sys_tai;
+extern int freq_cnt;
+
+/* ntp_monitor.c */
+#define MON_HASH_SIZE (1U << mon_hash_bits)
+#define MON_HASH_MASK (MON_HASH_SIZE - 1)
+#define MON_HASH(addr) (sock_hash(addr) & MON_HASH_MASK)
+extern void init_mon (void);
+extern void mon_start (int);
+extern void mon_stop (int);
+extern u_short ntp_monitor (struct recvbuf *, u_short);
+extern void mon_clearinterface(endpt *interface);
+
+/* ntp_peer.c */
+extern void init_peer (void);
+extern struct peer *findexistingpeer(sockaddr_u *, const char *,
+ struct peer *, int, u_char);
+extern struct peer *findpeer (struct recvbuf *, int, int *);
+extern struct peer *findpeerbyassoc(associd_t);
+extern void set_peerdstadr (struct peer *, endpt *);
+extern struct peer *newpeer (sockaddr_u *, const char *,
+ endpt *, u_char, u_char,
+ u_char, u_char, u_int, u_char, u_int32,
+ keyid_t, const char *);
+extern void peer_all_reset (void);
+extern void peer_clr_stats (void);
+extern struct peer *peer_config(sockaddr_u *, const char *,
+ endpt *, u_char, u_char,
+ u_char, u_char, u_int, u_int32,
+ keyid_t, const char *);
+extern void peer_reset (struct peer *);
+extern void refresh_all_peerinterfaces(void);
+extern void unpeer (struct peer *);
+extern void clear_all (void);
+extern int score_all (struct peer *);
+extern struct peer *findmanycastpeer(struct recvbuf *);
+
+/* ntp_crypto.c */
+#ifdef AUTOKEY
+extern int crypto_recv (struct peer *, struct recvbuf *);
+extern int crypto_xmit (struct peer *, struct pkt *,
+ struct recvbuf *, int,
+ struct exten *, keyid_t);
+extern keyid_t session_key (sockaddr_u *, sockaddr_u *, keyid_t,
+ keyid_t, u_long);
+extern int make_keylist (struct peer *, struct interface *);
+extern void key_expire (struct peer *);
+extern void crypto_update (void);
+extern void crypto_config (int, char *);
+extern void crypto_setup (void);
+extern u_int crypto_ident (struct peer *);
+extern struct exten *crypto_args (struct peer *, u_int, associd_t, char *);
+extern int crypto_public (struct peer *, u_char *, u_int);
+extern void value_free (struct value *);
+extern char *iffpar_file;
+extern EVP_PKEY *iffpar_pkey;
+extern char *gqpar_file;
+extern EVP_PKEY *gqpar_pkey;
+extern char *mvpar_file;
+extern EVP_PKEY *mvpar_pkey;
+extern struct value tai_leap;
+#endif /* AUTOKEY */
+
+/* ntp_proto.c */
+extern void transmit (struct peer *);
+extern void receive (struct recvbuf *);
+extern void peer_clear (struct peer *, char *);
+extern void process_packet (struct peer *, struct pkt *, u_int);
+extern void clock_select (void);
+
+extern u_long leapsec; /* seconds to next leap (proximity class) */
+extern int leapdif; /* TAI difference step at next leap second*/
+extern int sys_orphan;
+extern double sys_mindisp;
+extern double sys_maxdist;
+
+extern char *sys_ident; /* identity scheme */
+extern void poll_update (struct peer *, u_char);
+
+extern void clear (struct peer *);
+extern void clock_filter (struct peer *, double, double, double);
+extern void init_proto (void);
+extern void set_sys_tick_precision(double);
+extern void proto_config (int, u_long, double, sockaddr_u *);
+extern void proto_clr_stats (void);
+
+/* ntp_refclock.c */
+#ifdef REFCLOCK
+extern int refclock_newpeer (struct peer *);
+extern void refclock_unpeer (struct peer *);
+extern void refclock_receive (struct peer *);
+extern void refclock_transmit (struct peer *);
+extern void init_refclock (void);
+#endif /* REFCLOCK */
+
+/* ntp_request.c */
+extern void init_request (void);
+extern void process_private (struct recvbuf *, int);
+extern void reset_auth_stats(void);
+
+/* ntp_restrict.c */
+extern void init_restrict (void);
+extern u_short restrictions (sockaddr_u *);
+extern void hack_restrict (int, sockaddr_u *, sockaddr_u *,
+ u_short, u_short, u_long);
+extern void restrict_source (sockaddr_u *, int, u_long);
+
+/* ntp_timer.c */
+extern void init_timer (void);
+extern void reinit_timer (void);
+extern void timer (void);
+extern void timer_clr_stats (void);
+extern void timer_interfacetimeout (u_long);
+extern volatile int interface_interval;
+extern u_long orphwait; /* orphan wait time */
+#ifdef AUTOKEY
+extern char *sys_hostname; /* host name */
+extern char *sys_groupname; /* group name */
+extern char *group_name; /* group name */
+extern u_long sys_revoke; /* keys revoke timeout */
+extern u_long sys_automax; /* session key timeout */
+#endif /* AUTOKEY */
+
+/* ntp_util.c */
+extern void init_util (void);
+extern void write_stats (void);
+extern void stats_config (int, const char *);
+extern void record_peer_stats (sockaddr_u *, int, double, double, double, double);
+extern void record_proto_stats (char *);
+extern void record_loop_stats (double, double, double, double, int);
+extern void record_clock_stats (sockaddr_u *, const char *);
+extern int mprintf_clock_stats(sockaddr_u *, const char *, ...)
+ NTP_PRINTF(2, 3);
+extern void record_raw_stats (sockaddr_u *srcadr, sockaddr_u *dstadr, l_fp *t1, l_fp *t2, l_fp *t3, l_fp *t4, int leap, int version, int mode, int stratum, int poll, int precision, double root_delay, double root_dispersion, u_int32 refid);
+extern void check_leap_file (int is_daily_check, u_int32 ntptime, const time_t * systime);
+extern void record_crypto_stats (sockaddr_u *, const char *);
+#ifdef DEBUG
+extern void record_timing_stats (const char *);
+#endif
+extern char * fstostr(time_t); /* NTP timescale seconds */
+
+/* ntpd.c */
+extern void parse_cmdline_opts(int *, char ***);
+/*
+ * Signals we catch for debugging.
+ */
+#define MOREDEBUGSIG SIGUSR1
+#define LESSDEBUGSIG SIGUSR2
+/*
+ * Signals which terminate us gracefully.
+ */
+#ifndef SYS_WINNT
+# define SIGDIE1 SIGHUP
+# define SIGDIE2 SIGINT
+# define SIGDIE3 SIGQUIT
+# define SIGDIE4 SIGTERM
+#endif /* SYS_WINNT */
+
+
+/*
+ * Last half: ntpd variables
+ * -------------------------
+ */
+
+/* ntp_config.c */
+extern char const * progname;
+extern char *sys_phone[]; /* ACTS phone numbers */
+#if defined(HAVE_SCHED_SETSCHEDULER)
+extern int config_priority_override;
+extern int config_priority;
+#endif
+extern char *ntp_signd_socket;
+extern struct config_tree_tag *cfg_tree_history;
+
+#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
+/*
+ * backwards compatibility flags
+ */
+typedef struct bc_entry_tag {
+ int token;
+ int enabled;
+} bc_entry;
+
+extern bc_entry bc_list[];
+#endif
+
+/* ntp_control.c */
+extern int num_ctl_traps;
+extern keyid_t ctl_auth_keyid; /* keyid used for authenticating write requests */
+
+/*
+ * Statistic counters to keep track of requests and responses.
+ */
+extern u_long ctltimereset; /* time stats reset */
+extern u_long numctlreq; /* number of requests we've received */
+extern u_long numctlbadpkts; /* number of bad control packets */
+extern u_long numctlresponses; /* number of resp packets sent with data */
+extern u_long numctlfrags; /* number of fragments sent */
+extern u_long numctlerrors; /* number of error responses sent */
+extern u_long numctltooshort; /* number of too short input packets */
+extern u_long numctlinputresp; /* number of responses on input */
+extern u_long numctlinputfrag; /* number of fragments on input */
+extern u_long numctlinputerr; /* number of input pkts with err bit set */
+extern u_long numctlbadoffset; /* number of input pkts with nonzero offset */
+extern u_long numctlbadversion; /* number of input pkts with unknown version */
+extern u_long numctldatatooshort; /* data too short for count */
+extern u_long numctlbadop; /* bad op code found in packet */
+extern u_long numasyncmsgs; /* number of async messages we've sent */
+
+/*
+ * Other statistics of possible interest
+ */
+extern volatile u_long packets_dropped; /* total number of packets dropped on reception */
+extern volatile u_long packets_ignored; /* packets received on wild card interface */
+extern volatile u_long packets_received;/* total number of packets received */
+extern u_long packets_sent; /* total number of packets sent */
+extern u_long packets_notsent; /* total number of packets which couldn't be sent */
+
+extern volatile u_long handler_calls; /* number of calls to interrupt handler */
+extern volatile u_long handler_pkts; /* number of pkts received by handler */
+extern u_long io_timereset; /* time counters were reset */
+
+/* ntp_io.c */
+extern int disable_dynamic_updates;
+extern u_int sys_ifnum; /* next .ifnum to assign */
+extern endpt * any_interface; /* IPv4 wildcard */
+extern endpt * any6_interface; /* IPv6 wildcard */
+extern endpt * loopback_interface; /* IPv4 loopback for refclocks */
+extern endpt * ep_list; /* linked list */
+
+/* ntp_loopfilter.c */
+extern double drift_comp; /* clock frequency (s/s) */
+extern double clock_stability; /* clock stability (s/s) */
+extern double clock_max; /* max offset before step (s) */
+extern double clock_panic; /* max offset before panic (s) */
+extern double clock_phi; /* dispersion rate (s/s) */
+extern double clock_minstep; /* step timeout (s) */
+extern double clock_codec; /* codec frequency */
+#ifdef KERNEL_PLL
+extern int pll_status; /* status bits for kernel pll */
+#endif /* KERNEL_PLL */
+
+/*
+ * Clock state machine control flags
+ */
+extern int ntp_enable; /* clock discipline enabled */
+extern int pll_control; /* kernel support available */
+extern int kern_enable; /* kernel support enabled */
+extern int hardpps_enable; /* kernel PPS discipline enabled */
+extern int ext_enable; /* external clock enabled */
+extern int cal_enable; /* refclock calibrate enable */
+extern int allow_panic; /* allow panic correction */
+extern int mode_ntpdate; /* exit on first clock set */
+extern int peer_ntpdate; /* count of ntpdate peers */
+
+/*
+ * Clock state machine variables
+ */
+extern u_char sys_poll; /* system poll interval (log2 s) */
+extern int state; /* clock discipline state */
+extern int tc_counter; /* poll-adjust counter */
+extern u_long last_time; /* time of last clock update (s) */
+extern double last_offset; /* last clock offset (s) */
+extern u_char allan_xpt; /* Allan intercept (log2 s) */
+extern double clock_jitter; /* clock jitter (s) */
+extern double sys_offset; /* system offset (s) */
+extern double sys_jitter; /* system jitter (s) */
+
+/* ntp_monitor.c */
+extern u_char mon_hash_bits; /* log2 size of hash table */
+extern mon_entry ** mon_hash; /* MRU hash table */
+extern mon_entry mon_mru_list; /* mru listhead */
+extern u_int mon_enabled; /* MON_OFF (0) or other MON_* */
+extern u_int mru_alloc; /* mru list + free list count */
+extern u_int mru_entries; /* mru list count */
+extern u_int mru_peakentries; /* highest mru_entries */
+extern u_int mru_initalloc; /* entries to preallocate */
+extern u_int mru_incalloc; /* allocation batch factor */
+extern u_int mru_mindepth; /* preempt above this */
+extern int mru_maxage; /* for entries older than */
+extern u_int mru_maxdepth; /* MRU size hard limit */
+extern int mon_age; /* preemption limit */
+
+/* ntp_peer.c */
+extern struct peer *peer_hash[NTP_HASH_SIZE]; /* peer hash table */
+extern int peer_hash_count[NTP_HASH_SIZE]; /* count of in each bucket */
+extern struct peer *assoc_hash[NTP_HASH_SIZE]; /* association ID hash table */
+extern int assoc_hash_count[NTP_HASH_SIZE];/* count of in each bucket */
+extern struct peer *peer_list; /* peer structures list */
+extern int peer_count; /* count in peer_list */
+extern int peer_free_count; /* count in peer_free */
+
+/*
+ * Miscellaneous statistic counters which may be queried.
+ */
+extern u_long peer_timereset; /* time stat counters were zeroed */
+extern u_long findpeer_calls; /* number of calls to findpeer */
+extern u_long assocpeer_calls; /* number of calls to findpeerbyassoc */
+extern u_long peer_allocations; /* number of allocations from the free list */
+extern u_long peer_demobilizations; /* number of structs freed to free list */
+extern int total_peer_structs; /* number of peer structs in circulation */
+extern int peer_associations; /* mobilized associations */
+extern int peer_preempt; /* preemptable associations */
+
+/* ntp_proto.c */
+/*
+ * System variables are declared here. See Section 3.2 of the
+ * specification.
+ */
+extern u_char sys_leap; /* system leap indicator */
+extern u_char sys_stratum; /* system stratum */
+extern s_char sys_precision; /* local clock precision */
+extern double sys_rootdelay; /* roundtrip delay to primary source */
+extern double sys_rootdisp; /* dispersion to primary source */
+extern u_int32 sys_refid; /* reference id */
+extern l_fp sys_reftime; /* last update time */
+extern struct peer *sys_peer; /* current peer */
+
+/*
+ * Nonspecified system state variables.
+ */
+extern int sys_bclient; /* we set our time to broadcasts */
+extern double sys_bdelay; /* broadcast client default delay */
+extern int sys_authenticate; /* requre authentication for config */
+extern l_fp sys_authdelay; /* authentication delay */
+extern u_long sys_epoch; /* last clock update time */
+extern keyid_t sys_private; /* private value for session seed */
+extern int sys_manycastserver; /* respond to manycast client pkts */
+extern int sys_minclock; /* minimum survivors */
+extern int sys_minsane; /* minimum candidates */
+extern int sys_floor; /* cluster stratum floor */
+extern int sys_ceiling; /* cluster stratum ceiling */
+extern u_char sys_ttl[MAX_TTL]; /* ttl mapping vector */
+extern int sys_ttlmax; /* max ttl mapping vector index */
+
+/*
+ * Statistics counters
+ */
+extern u_long sys_stattime; /* time since reset */
+extern u_long sys_received; /* packets received */
+extern u_long sys_processed; /* packets for this host */
+extern u_long sys_restricted; /* restricted packets */
+extern u_long sys_newversion; /* current version */
+extern u_long sys_oldversion; /* old version */
+extern u_long sys_restricted; /* access denied */
+extern u_long sys_badlength; /* bad length or format */
+extern u_long sys_badauth; /* bad authentication */
+extern u_long sys_declined; /* declined */
+extern u_long sys_limitrejected; /* rate exceeded */
+extern u_long sys_kodsent; /* KoD sent */
+
+/* ntp_request.c */
+extern keyid_t info_auth_keyid; /* keyid used to authenticate requests */
+extern u_long auth_timereset;
+
+/* ntp_restrict.c */
+extern restrict_u * restrictlist4; /* IPv4 restriction list */
+extern restrict_u * restrictlist6; /* IPv6 restriction list */
+extern int ntp_minpkt;
+extern u_char ntp_minpoll;
+
+/* ntp_scanner.c */
+extern u_int32 conf_file_sum; /* Simple sum of characters */
+
+/* ntp_signd.c */
+#ifdef HAVE_NTP_SIGND
+extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int,
+ struct pkt *);
+#endif
+
+/* ntp_timer.c */
+extern volatile int alarm_flag; /* alarm flag */
+extern volatile u_long alarm_overflow;
+extern u_long current_time; /* seconds since startup */
+extern u_long timer_timereset;
+extern u_long timer_overflows;
+extern u_long timer_xmtcalls;
+#ifdef SYS_WINNT
+HANDLE WaitableTimerHandle;
+#endif
+
+/* ntp_util.c */
+extern char statsdir[MAXFILENAME];
+extern int stats_control; /* write stats to fileset? */
+extern int stats_write_period; /* # of seconds between writes. */
+extern double stats_write_tolerance;
+extern double wander_threshold;
+
+/* ntpd.c */
+extern int nofork; /* no-fork flag */
+extern int initializing; /* initializing flag */
+#ifdef HAVE_DROPROOT
+extern int droproot; /* flag: try to drop root privileges after startup */
+extern int root_dropped; /* root has been dropped */
+extern char *user; /* user to switch to */
+extern char *group; /* group to switch to */
+extern const char *chrootdir; /* directory to chroot() to */
+#endif
+#ifdef HAVE_WORKING_FORK
+extern int waitsync_fd_to_close; /* -w/--wait-sync */
+#endif
+
+/* ntservice.c */
+#ifdef SYS_WINNT
+extern int accept_wildcard_if_for_winnt;
+#endif
+
+/* refclock_conf.c */
+#ifdef REFCLOCK
+/* refclock configuration table */
+extern struct refclock * const refclock_conf[];
+extern u_char num_refclock_conf;
+#endif
+
diff --git a/include/ntpsim.h b/include/ntpsim.h
new file mode 100644
index 0000000..b270ce6
--- /dev/null
+++ b/include/ntpsim.h
@@ -0,0 +1,146 @@
+/* ntpsim.h
+ *
+ * The header file for the ntp discrete event simulator.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Copyright (c) 2006
+ */
+
+#ifndef NTPSIM_H
+#define NTPSIM_H
+
+#include <stdio.h>
+#include <math.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <arpa/inet.h>
+#include "ntp_syslog.h"
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "ntp_select.h"
+#include "ntp_malloc.h"
+#include "ntp_refclock.h"
+#include "recvbuff.h"
+#include "ntp_io.h"
+#include "ntp_stdlib.h"
+#include "ntp_prio_q.h"
+
+/* CONSTANTS */
+
+#ifdef PI
+# undef PI
+#endif
+#define PI 3.1415926535 /* The world's most famous constant */
+#define SIM_TIME 86400 /* end simulation time */
+#define NET_DLY .001 /* network delay */
+#define PROC_DLY .001 /* processing delay */
+#define BEEP_DLY 3600 /* beep interval (s) */
+
+
+/* Discrete Event Queue
+ * --------------------
+ * The NTP simulator is a discrete event simulator.
+ *
+ * Central to this simulator is an event queue which is a priority queue
+ * in which the "priority" is given by the time of arrival of the event.
+ *
+ * A discrete set of events can happen and are stored in the queue to arrive
+ * at a particular time.
+ */
+
+/* Possible Discrete Events */
+
+typedef enum {
+ BEEP, /* Event to record simulator stats */
+ CLOCK, /* Event to advance the clock to the specified time */
+ TIMER, /* Event that designates a timer interrupt. */
+ PACKET /* Event that designates arrival of a packet */
+} funcTkn;
+
+
+/* Event information */
+
+typedef struct {
+ double time; /* Time at which event occurred */
+ funcTkn function; /* Type of event that occured */
+ union {
+ struct pkt evnt_pkt;
+ struct recvbuf evnt_buf;
+ } buffer; /* Other data associated with the event */
+#define ntp_pkt buffer.evnt_pkt
+#define rcv_buf buffer.evnt_buf
+} Event;
+
+
+/* Server Script Information */
+typedef struct script_info_tag script_info;
+struct script_info_tag {
+ script_info * link;
+ double duration;
+ double freq_offset;
+ double wander;
+ double jitter;
+ double prop_delay;
+ double proc_delay;
+};
+
+typedef DECL_FIFO_ANCHOR(script_info) script_info_fifo;
+
+
+/* Server Structures */
+
+typedef struct server_info_tag server_info;
+struct server_info_tag {
+ server_info * link;
+ double server_time;
+ sockaddr_u * addr;
+ script_info_fifo * script;
+ script_info * curr_script;
+};
+
+typedef DECL_FIFO_ANCHOR(server_info) server_info_fifo;
+
+
+/* Simulation control information */
+
+typedef struct Sim_Info {
+ double sim_time; /* Time in the simulation */
+ double end_time; /* Time at which simulation needs to be ended */
+ double beep_delay; /* Delay between simulation "beeps" at which
+ simulation stats are recorded. */
+ int num_of_servers; /* Number of servers in the simulation */
+ server_info *servers; /* Pointer to array of servers */
+} sim_info;
+
+
+/* Local Clock (Client) Variables */
+
+typedef struct Local_Clock_Info {
+ double local_time; /* Client disciplined time */
+ double adj; /* Remaining time correction */
+ double slew; /* Correction Slew Rate */
+ double last_read_time; /* Last time the clock was read */
+} local_clock_info;
+
+extern local_clock_info simclock; /* Local Clock Variables */
+extern sim_info simulation; /* Simulation Control Variables */
+
+/* Function Prototypes */
+
+int ntpsim (int argc, char *argv[]);
+Event *event (double t, funcTkn f);
+void sim_event_timer (Event *e);
+int simulate_server (sockaddr_u *serv_addr, endpt *inter,
+ struct pkt *rpkt);
+void sim_update_clocks (Event *e);
+void sim_event_recv_packet (Event *e);
+void sim_event_beep (Event *e);
+void abortsim (char *errmsg);
+double gauss (double, double);
+double poisson (double, double);
+void create_server_associations(void);
+
+#endif /* NTPSIM_H */
diff --git a/include/parse.h b/include/parse.h
new file mode 100644
index 0000000..3a98408
--- /dev/null
+++ b/include/parse.h
@@ -0,0 +1,421 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/include/parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A
+ *
+ * parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __PARSE_H__
+#define __PARSE_H__
+#if !(defined(lint) || defined(__GNUC__))
+ static char parsehrcsid[]="parse.h,v 4.12 2007/01/14 08:36:03 kardel RELEASE_20070114_A";
+#endif
+
+#include "ntp_types.h"
+
+#include "parse_conf.h"
+
+/*
+ * we use the following datastructures in two modes
+ * either in the NTP itself where we use NTP time stamps at some places
+ * or in the kernel, where only struct timeval will be used.
+ */
+#undef PARSEKERNEL
+#if defined(KERNEL) || defined(_KERNEL)
+#ifndef PARSESTREAM
+#define PARSESTREAM
+#endif
+#endif
+#if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
+#define PARSEKERNEL
+#endif
+#ifdef PARSEKERNEL
+#ifndef _KERNEL
+extern caddr_t kmem_alloc (unsigned int);
+extern caddr_t kmem_free (caddr_t, unsigned int);
+extern unsigned int splx (unsigned int);
+extern unsigned int splhigh (void);
+extern unsigned int splclock (void);
+#define MALLOC(_X_) (char *)kmem_alloc(_X_)
+#define FREE(_X_, _Y_) kmem_free((caddr_t)_X_, _Y_)
+#else
+#include <sys/kmem.h>
+#define MALLOC(_X_) (char *)kmem_alloc(_X_, KM_SLEEP)
+#define FREE(_X_, _Y_) kmem_free((caddr_t)_X_, _Y_)
+#endif
+#else
+#define MALLOC(_X_) malloc(_X_)
+#define FREE(_X_, _Y_) free(_X_)
+#endif
+
+#if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
+#include <sys/stream.h>
+#include <sys/stropts.h>
+#else /* STREAM */
+#include <stdio.h>
+#include "ntp_syslog.h"
+#ifdef DEBUG
+#define DD_PARSE 5
+#define DD_RAWDCF 4
+#define parseprintf(LEVEL, ARGS) if (debug > LEVEL) printf ARGS
+#else /* DEBUG */
+#define parseprintf(LEVEL, ARGS)
+#endif /* DEBUG */
+#endif /* PARSESTREAM */
+
+#if defined(timercmp) && defined(__GNUC__)
+#undef timercmp
+#endif
+
+#if !defined(timercmp)
+#define timercmp(tvp, uvp, cmp) \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec || \
+ ((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec))
+#endif
+
+#ifndef TIMES10
+#define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1))
+#endif
+
+/*
+ * state flags
+ */
+#define PARSEB_POWERUP 0x00000001 /* no synchronisation */
+#define PARSEB_NOSYNC 0x00000002 /* timecode currently not confirmed */
+
+/*
+ * time zone information
+ */
+#define PARSEB_ANNOUNCE 0x00000010 /* switch time zone warning (DST switch) */
+#define PARSEB_DST 0x00000020 /* DST in effect */
+#define PARSEB_UTC 0x00000040 /* UTC time */
+
+/*
+ * leap information
+ */
+#define PARSEB_LEAPDEL 0x00000100 /* LEAP deletion warning */
+#define PARSEB_LEAPADD 0x00000200 /* LEAP addition warning */
+#define PARSEB_LEAPS 0x00000300 /* LEAP warnings */
+#define PARSEB_LEAPSECOND 0x00000400 /* actual leap second */
+/*
+ * optional status information
+ */
+#define PARSEB_ALTERNATE 0x00001000 /* alternate antenna used */
+#define PARSEB_POSITION 0x00002000 /* position available */
+#define PARSEB_MESSAGE 0x00004000 /* addtitional message data */
+/*
+ * feature information
+ */
+#define PARSEB_S_LEAP 0x00010000 /* supports LEAP */
+#define PARSEB_S_ANTENNA 0x00020000 /* supports antenna information */
+#define PARSEB_S_PPS 0x00040000 /* supports PPS time stamping */
+#define PARSEB_S_POSITION 0x00080000 /* supports position information (GPS) */
+
+/*
+ * time stamp availability
+ */
+#define PARSEB_TIMECODE 0x10000000 /* valid time code sample */
+#define PARSEB_PPS 0x20000000 /* valid PPS sample */
+
+#define PARSE_TCINFO (PARSEB_ANNOUNCE|PARSEB_POWERUP|PARSEB_NOSYNC|PARSEB_DST|\
+ PARSEB_UTC|PARSEB_LEAPS|PARSEB_ALTERNATE|PARSEB_S_LEAP|\
+ PARSEB_S_LOCATION|PARSEB_TIMECODE|PARSEB_MESSAGE)
+
+#define PARSE_POWERUP(x) ((x) & PARSEB_POWERUP)
+#define PARSE_NOSYNC(x) (((x) & (PARSEB_POWERUP|PARSEB_NOSYNC)) == PARSEB_NOSYNC)
+#define PARSE_SYNC(x) (((x) & (PARSEB_POWERUP|PARSEB_NOSYNC)) == 0)
+#define PARSE_ANNOUNCE(x) ((x) & PARSEB_ANNOUNCE)
+#define PARSE_DST(x) ((x) & PARSEB_DST)
+#define PARSE_UTC(x) ((x) & PARSEB_UTC)
+#define PARSE_LEAPADD(x) (PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPADD))
+#define PARSE_LEAPDEL(x) (PARSE_SYNC(x) && (((x) & PARSEB_LEAPS) == PARSEB_LEAPDEL))
+#define PARSE_ALTERNATE(x) ((x) & PARSEB_ALTERNATE)
+#define PARSE_LEAPSECOND(x) (PARSE_SYNC(x) && ((x) & PARSEB_LEAP_SECOND))
+
+#define PARSE_S_LEAP(x) ((x) & PARSEB_S_LEAP)
+#define PARSE_S_ANTENNA(x) ((x) & PARSEB_S_ANTENNA)
+#define PARSE_S_PPS(x) ((x) & PARSEB_S_PPS)
+#define PARSE_S_POSITION(x) ((x) & PARSEB_S_POSITION)
+
+#define PARSE_TIMECODE(x) ((x) & PARSEB_TIMECODE)
+#define PARSE_PPS(x) ((x) & PARSEB_PPS)
+#define PARSE_POSITION(x) ((x) & PARSEB_POSITION)
+#define PARSE_MESSAGE(x) ((x) & PARSEB_MESSAGE)
+
+/*
+ * operation flags - lower nibble contains fudge flags
+ */
+#define PARSE_TRUSTTIME CLK_FLAG1 /* use flag1 to indicate the time2 references mean the trust time */
+#define PARSE_CLEAR CLK_FLAG2 /* use flag2 to control pps on assert */
+#define PARSE_PPSKERNEL CLK_FLAG3 /* use flag3 to bind PPS to kernel */
+#define PARSE_LEAP_DELETE CLK_FLAG4 /* use flag4 to force leap deletion - only necessary when earth slows down */
+
+#define PARSE_FIXED_FMT 0x10 /* fixed format */
+#define PARSE_PPSCLOCK 0x20 /* try to get PPS time stamp via ppsclock ioctl */
+
+/*
+ * size of buffers
+ */
+#define PARSE_TCMAX 400 /* maximum addition data size */
+
+typedef union
+{
+ struct timeval tv; /* timeval - kernel view */
+ l_fp fp; /* fixed point - ntp view */
+} timestamp_t;
+
+/*
+ * standard time stamp structure
+ */
+struct parsetime
+{
+ u_long parse_status; /* data status - CVT_OK, CVT_NONE, CVT_FAIL ... */
+ timestamp_t parse_time; /* PARSE timestamp */
+ timestamp_t parse_stime; /* telegram sample timestamp */
+ timestamp_t parse_ptime; /* PPS time stamp */
+ long parse_usecerror; /* sampled usec error */
+ u_long parse_state; /* current receiver state */
+ unsigned short parse_format; /* format code */
+ unsigned short parse_msglen; /* length of message */
+ unsigned char parse_msg[PARSE_TCMAX]; /* original messages */
+};
+
+typedef struct parsetime parsetime_t;
+
+/*---------- STREAMS interface ----------*/
+
+#ifdef HAVE_SYS_STREAM_H
+/*
+ * ioctls
+ */
+#define PARSEIOC_ENABLE (('D'<<8) + 'E')
+#define PARSEIOC_DISABLE (('D'<<8) + 'D')
+#define PARSEIOC_SETFMT (('D'<<8) + 'f')
+#define PARSEIOC_GETFMT (('D'<<8) + 'F')
+#define PARSEIOC_SETCS (('D'<<8) + 'C')
+#define PARSEIOC_TIMECODE (('D'<<8) + 'T')
+
+#endif
+
+/*------ IO handling flags (sorry) ------*/
+
+#define PARSE_IO_CSIZE 0x00000003
+#define PARSE_IO_CS5 0x00000000
+#define PARSE_IO_CS6 0x00000001
+#define PARSE_IO_CS7 0x00000002
+#define PARSE_IO_CS8 0x00000003
+
+/*
+ * ioctl structure
+ */
+union parsectl
+{
+ struct parsegettc
+ {
+ u_long parse_state; /* last state */
+ u_long parse_badformat; /* number of bad packets since last query */
+ unsigned short parse_format;/* last decoded format */
+ unsigned short parse_count; /* count of valid time code bytes */
+ char parse_buffer[PARSE_TCMAX+1]; /* timecode buffer */
+ } parsegettc;
+
+ struct parseformat
+ {
+ unsigned short parse_format;/* number of examined format */
+ unsigned short parse_count; /* count of valid string bytes */
+ char parse_buffer[PARSE_TCMAX+1]; /* format code string */
+ } parseformat;
+
+ struct parsesetcs
+ {
+ u_long parse_cs; /* character size (needed for stripping) */
+ } parsesetcs;
+};
+
+typedef union parsectl parsectl_t;
+
+/*------ for conversion routines --------*/
+
+struct parse /* parse module local data */
+{
+ int parse_flags; /* operation and current status flags */
+
+ int parse_ioflags; /* io handling flags (5-8 Bit control currently) */
+
+ /*
+ * private data - fixed format only
+ */
+ unsigned short parse_plen; /* length of private data */
+ void *parse_pdata; /* private data pointer */
+
+ /*
+ * time code input buffer (from RS232 or PPS)
+ */
+ unsigned short parse_index; /* current buffer index */
+ char *parse_data; /* data buffer */
+ unsigned short parse_dsize; /* size of data buffer */
+ unsigned short parse_lformat; /* last format used */
+ u_long parse_lstate; /* last state code */
+ char *parse_ldata; /* last data buffer */
+ unsigned short parse_ldsize; /* last data buffer length */
+ u_long parse_badformat; /* number of unparsable pakets */
+
+ timestamp_t parse_lastchar; /* last time a character was received */
+ parsetime_t parse_dtime; /* external data prototype */
+};
+
+typedef struct parse parse_t;
+
+struct clocktime /* clock time broken up from time code */
+{
+ long day;
+ long month;
+ long year;
+ long hour;
+ long minute;
+ long second;
+ long usecond;
+ long utcoffset; /* in seconds */
+ time_t utctime; /* the actual time - alternative to date/time */
+ u_long flags; /* current clock status */
+};
+
+typedef struct clocktime clocktime_t;
+
+/*
+ * parser related return/error codes
+ */
+#define CVT_MASK (unsigned)0x0000000F /* conversion exit code */
+#define CVT_NONE (unsigned)0x00000001 /* format not applicable */
+#define CVT_FAIL (unsigned)0x00000002 /* conversion failed - error code returned */
+#define CVT_OK (unsigned)0x00000004 /* conversion succeeded */
+#define CVT_SKIP (unsigned)0x00000008 /* conversion succeeded */
+#define CVT_ADDITIONAL (unsigned)0x00000010 /* additional data is available */
+#define CVT_BADFMT (unsigned)0x00000100 /* general format error - (unparsable) */
+#define CVT_BADDATE (unsigned)0x00000200 /* date field incorrect */
+#define CVT_BADTIME (unsigned)0x00000400 /* time field incorrect */
+
+/*
+ * return codes used by special input parsers
+ */
+#define PARSE_INP_SKIP 0x00 /* discard data - may have been consumed */
+#define PARSE_INP_TIME 0x01 /* time code assembled */
+#define PARSE_INP_PARSE 0x02 /* parse data using normal algorithm */
+#define PARSE_INP_DATA 0x04 /* additional data to pass up */
+#define PARSE_INP_SYNTH 0x08 /* just pass up synthesized time */
+
+/*
+ * PPS edge info
+ */
+#define SYNC_ZERO 0x00
+#define SYNC_ONE 0x01
+
+struct clockformat
+{
+ /* special input protocol - implies fixed format */
+ u_long (*input) (parse_t *, unsigned int, timestamp_t *);
+ /* conversion routine */
+ u_long (*convert) (unsigned char *, int, struct format *, clocktime_t *, void *);
+ /* routine for handling RS232 sync events (time stamps) */
+ /* PPS input routine */
+ u_long (*syncpps) (parse_t *, int, timestamp_t *);
+ /* time code synthesizer */
+
+ void *data; /* local parameters */
+ const char *name; /* clock format name */
+ unsigned short length; /* maximum length of data packet */
+ unsigned short plen; /* length of private data - implies fixed format */
+};
+
+typedef struct clockformat clockformat_t;
+
+/*
+ * parse interface
+ */
+extern int parse_ioinit (parse_t *);
+extern void parse_ioend (parse_t *);
+extern int parse_ioread (parse_t *, unsigned int, timestamp_t *);
+extern int parse_iopps (parse_t *, int, timestamp_t *);
+extern void parse_iodone (parse_t *);
+extern int parse_timecode (parsectl_t *, parse_t *);
+extern int parse_getfmt (parsectl_t *, parse_t *);
+extern int parse_setfmt (parsectl_t *, parse_t *);
+extern int parse_setcs (parsectl_t *, parse_t *);
+
+extern unsigned int parse_restart (parse_t *, unsigned int);
+extern unsigned int parse_addchar (parse_t *, unsigned int);
+extern unsigned int parse_end (parse_t *);
+
+extern int Strok (const unsigned char *, const unsigned char *);
+extern int Stoi (const unsigned char *, long *, int);
+
+extern time_t parse_to_unixtime (clocktime_t *, u_long *);
+extern u_long updatetimeinfo (parse_t *, u_long);
+extern void syn_simple (parse_t *, timestamp_t *, struct format *, u_long);
+extern u_long pps_simple (parse_t *, int, timestamp_t *);
+extern u_long pps_one (parse_t *, int, timestamp_t *);
+extern u_long pps_zero (parse_t *, int, timestamp_t *);
+extern int parse_timedout (parse_t *, timestamp_t *, struct timeval *);
+
+#endif
+
+/*
+ * History:
+ *
+ * parse.h,v
+ * Revision 4.12 2007/01/14 08:36:03 kardel
+ * make timestamp union anonymous to avoid conflicts with
+ * some OSes that choose to create a nameing conflic here.
+ *
+ * Revision 4.11 2005/06/25 10:58:45 kardel
+ * add missing log keywords
+ *
+ * Revision 4.5 1998/08/09 22:23:32 kardel
+ * 4.0.73e2 adjustments
+ *
+ * Revision 4.4 1998/06/14 21:09:27 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.3 1998/06/13 11:49:25 kardel
+ * STREAM macro gone in favor of HAVE_SYS_STREAM_H
+ *
+ * Revision 4.2 1998/06/12 15:14:25 kardel
+ * fixed prototypes
+ *
+ * Revision 4.1 1998/05/24 10:07:59 kardel
+ * removed old data structure cruft (new input model)
+ * new PARSE_INP* macros for input handling
+ * removed old SYNC_* macros from old input model
+ * (struct clockformat): removed old parse functions in favor of the
+ * new input model
+ * updated prototypes
+ *
+ * form V3 3.31 - log info deleted 1998/04/11 kardel
+ */
diff --git a/include/parse_conf.h b/include/parse_conf.h
new file mode 100644
index 0000000..319dd54
--- /dev/null
+++ b/include/parse_conf.h
@@ -0,0 +1,83 @@
+/*
+ * /src/NTP/ntp4-dev/include/parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
+ *
+ * parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef __PARSE_CONF_H__
+#define __PARSE_CONF_H__
+#if !(defined(lint) || defined(__GNUC__))
+ static char prshrcsid[] = "parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A";
+#endif
+
+/*
+ * field location structure
+ */
+#define O_DAY 0
+#define O_MONTH 1
+#define O_YEAR 2
+#define O_HOUR 3
+#define O_MIN 4
+#define O_SEC 5
+#define O_WDAY 6
+#define O_FLAGS 7
+#define O_ZONE 8
+#define O_UTCHOFFSET 9
+#define O_UTCMOFFSET 10
+#define O_UTCSOFFSET 11
+#define O_COUNT (O_UTCSOFFSET+1)
+
+#define MBG_EXTENDED 0x00000001
+
+/*
+ * see below for field offsets
+ */
+
+struct format
+{
+ struct foff
+ {
+ unsigned short offset; /* offset into buffer */
+ unsigned short length; /* length of field */
+ } field_offsets[O_COUNT];
+ const unsigned char *fixed_string; /* string with must be chars (blanks = wildcards) */
+ u_long flags;
+};
+#endif
+
+/*
+ * History:
+ *
+ * parse_conf.h,v
+ * Revision 4.7 2005/06/25 10:58:45 kardel
+ * add missing log keywords
+ *
+ */
diff --git a/include/recvbuff.h b/include/recvbuff.h
new file mode 100644
index 0000000..92188f5
--- /dev/null
+++ b/include/recvbuff.h
@@ -0,0 +1,123 @@
+#ifndef RECVBUFF_H
+#define RECVBUFF_H
+
+#include "ntp.h"
+#include "ntp_net.h"
+#include "ntp_lists.h"
+
+#include <isc/result.h>
+
+/*
+ * recvbuf memory management
+ */
+#define RECV_INIT 10 /* 10 buffers initially */
+#define RECV_LOWAT 3 /* when we're down to three buffers get more */
+#define RECV_INC 5 /* get 5 more at a time */
+#define RECV_TOOMANY 40 /* this is way too many buffers */
+
+#if defined HAVE_IO_COMPLETION_PORT
+# include "ntp_iocompletionport.h"
+# include "ntp_timer.h"
+
+# define RECV_BLOCK_IO() EnterCriticalSection(&RecvCritSection)
+# define RECV_UNBLOCK_IO() LeaveCriticalSection(&RecvCritSection)
+
+/* Return the event which is set when items are added to the full list
+ */
+extern HANDLE get_recv_buff_event(void);
+#else
+# define RECV_BLOCK_IO()
+# define RECV_UNBLOCK_IO()
+#endif
+
+
+/*
+ * Format of a recvbuf. These are used by the asynchronous receive
+ * routine to store incoming packets and related information.
+ */
+
+/*
+ * the maximum length NTP packet contains the NTP header, one Autokey
+ * request, one Autokey response and the MAC. Assuming certificates don't
+ * get too big, the maximum packet length is set arbitrarily at 1000.
+ */
+#define RX_BUFF_SIZE 1000 /* hail Mary */
+
+
+typedef struct recvbuf recvbuf_t;
+
+struct recvbuf {
+ recvbuf_t * link; /* next in list */
+ union {
+ sockaddr_u X_recv_srcadr;
+ caddr_t X_recv_srcclock;
+ struct peer * X_recv_peer;
+ } X_from_where;
+#define recv_srcadr X_from_where.X_recv_srcadr
+#define recv_srcclock X_from_where.X_recv_srcclock
+#define recv_peer X_from_where.X_recv_peer
+#ifndef HAVE_IO_COMPLETION_PORT
+ sockaddr_u srcadr; /* where packet came from */
+#else
+ int recv_srcadr_len;/* filled in on completion */
+#endif
+ endpt * dstadr; /* address pkt arrived on */
+ SOCKET fd; /* fd on which it was received */
+ int msg_flags; /* Flags received about the packet */
+ l_fp recv_time; /* time of arrival */
+ void (*receiver)(struct recvbuf *); /* callback */
+ int recv_length; /* number of octets received */
+ union {
+ struct pkt X_recv_pkt;
+ u_char X_recv_buffer[RX_BUFF_SIZE];
+ } recv_space;
+#define recv_pkt recv_space.X_recv_pkt
+#define recv_buffer recv_space.X_recv_buffer
+ int used; /* reference count */
+};
+
+extern void init_recvbuff(int);
+
+/* freerecvbuf - make a single recvbuf available for reuse
+ */
+extern void freerecvbuf(struct recvbuf *);
+
+/* Get a free buffer (typically used so an async
+ * read can directly place data into the buffer
+ *
+ * The buffer is removed from the free list. Make sure
+ * you put it back with freerecvbuf() or
+ */
+
+/* signal safe - no malloc */
+extern struct recvbuf *get_free_recv_buffer(void);
+/* signal unsafe - may malloc */
+extern struct recvbuf *get_free_recv_buffer_alloc(void);
+
+/* Add a buffer to the full list
+ */
+extern void add_full_recv_buffer(struct recvbuf *);
+
+/* number of recvbufs on freelist */
+extern u_long free_recvbuffs(void);
+extern u_long full_recvbuffs(void);
+extern u_long total_recvbuffs(void);
+extern u_long lowater_additions(void);
+
+/* Returns the next buffer in the full list.
+ *
+ */
+extern struct recvbuf *get_full_recv_buffer(void);
+
+/*
+ * purge_recv_buffers_for_fd() - purges any previously-received input
+ * from a given file descriptor.
+ */
+extern void purge_recv_buffers_for_fd(SOCKET);
+
+/*
+ * Checks to see if there are buffers to process
+ */
+extern isc_boolean_t has_full_recv_buffer(void);
+
+#endif /* RECVBUFF_H */
diff --git a/include/refclock_atom.h b/include/refclock_atom.h
new file mode 100644
index 0000000..452e933
--- /dev/null
+++ b/include/refclock_atom.h
@@ -0,0 +1,15 @@
+/*
+ * Definitions for the atom driver and its friends
+ */
+#undef NANOSECOND /* some systems define it differently */
+#define NANOSECOND 1000000000 /* one second (ns) */
+
+struct refclock_atom {
+ pps_handle_t handle;
+ pps_params_t pps_params;
+ struct timespec ts;
+};
+
+extern int refclock_ppsapi(int, struct refclock_atom *);
+extern int refclock_params(int, struct refclock_atom *);
+extern int refclock_pps(struct peer *, struct refclock_atom *, int);
diff --git a/include/ssl_applink.c b/include/ssl_applink.c
new file mode 100644
index 0000000..ba1f4a8
--- /dev/null
+++ b/include/ssl_applink.c
@@ -0,0 +1,74 @@
+/*
+ * include/ssl_applink.c -- common NTP code for openssl/applink.c
+ *
+ * Each program which uses OpenSSL should include this file in _one_
+ * of its source files and call ssl_applink() before any OpenSSL
+ * functions.
+ */
+
+#if defined(OPENSSL) && defined(SYS_WINNT)
+# ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4152)
+# endif
+# include <openssl/applink.c>
+# ifdef _MSC_VER
+# pragma warning(pop)
+# endif
+#endif
+
+#if defined(OPENSSL) && defined(_MSC_VER) && defined(_DEBUG)
+#define WRAP_DBG_MALLOC
+#endif
+
+#ifdef WRAP_DBG_MALLOC
+void *wrap_dbg_malloc(size_t s, const char *f, int l);
+void *wrap_dbg_realloc(void *p, size_t s, const char *f, int l);
+void wrap_dbg_free(void *p);
+#endif
+
+
+#if defined(OPENSSL) && defined(SYS_WINNT)
+void ssl_applink(void);
+
+void
+ssl_applink(void)
+{
+#ifdef WRAP_DBG_MALLOC
+ CRYPTO_set_mem_ex_functions(wrap_dbg_malloc, wrap_dbg_realloc, wrap_dbg_free);
+#else
+ CRYPTO_malloc_init();
+#endif
+}
+#else /* !OPENSSL || !SYS_WINNT */
+#define ssl_applink() do {} while (0)
+#endif
+
+
+#ifdef WRAP_DBG_MALLOC
+/*
+ * OpenSSL malloc overriding uses different parameters
+ * for DEBUG malloc/realloc/free (lacking block type).
+ * Simple wrappers convert.
+ */
+void *wrap_dbg_malloc(size_t s, const char *f, int l)
+{
+ void *ret;
+
+ ret = _malloc_dbg(s, _NORMAL_BLOCK, f, l);
+ return ret;
+}
+
+void *wrap_dbg_realloc(void *p, size_t s, const char *f, int l)
+{
+ void *ret;
+
+ ret = _realloc_dbg(p, s, _NORMAL_BLOCK, f, l);
+ return ret;
+}
+
+void wrap_dbg_free(void *p)
+{
+ _free_dbg(p, _NORMAL_BLOCK);
+}
+#endif /* WRAP_DBG_MALLOC */
diff --git a/include/timepps-SCO.h b/include/timepps-SCO.h
new file mode 100644
index 0000000..ce9052e
--- /dev/null
+++ b/include/timepps-SCO.h
@@ -0,0 +1,503 @@
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2000 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and with or without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * this modified timepps.h can be used to provide a PPSAPI interface *
+ * to a machine running SCO Unix. *
+ * *
+ ***********************************************************************
+ * *
+ * A full PPSAPI interface to the SCO Unix kernel would be better, but *
+ * this at least removes the necessity for special coding from the NTP *
+ * NTP drivers. *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+/*SCO UNIX version, TIOCDCDTIMESTAMP assumed to exist. */
+
+#ifndef _SYS_TIMEPPS_H_
+#define _SYS_TIMEPPS_H_
+
+#include <termios.h> /* to get TIOCDCDTIMESTAMP */
+
+/* Implementation note: the logical states ``assert'' and ``clear''
+ * are implemented in terms of the UART register, i.e. ``assert''
+ * means the bit is set.
+ */
+
+/*
+ * The following definitions are architecture independent
+ */
+
+#define PPS_API_VERS_1 1 /* API version number */
+#define PPS_JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
+#define PPS_NANOSECOND 1000000000L /* one nanosecond in decimal */
+#define PPS_FRAC 4294967296. /* 2^32 as a double */
+
+#define PPS_NORMALIZE(x) /* normalize timespec */ \
+ do { \
+ if ((x).tv_nsec >= PPS_NANOSECOND) { \
+ (x).tv_nsec -= PPS_NANOSECOND; \
+ (x).tv_sec++; \
+ } else if ((x).tv_nsec < 0) { \
+ (x).tv_nsec += PPS_NANOSECOND; \
+ (x).tv_sec--; \
+ } \
+ } while (0)
+
+#define PPS_TSPECTONTP(x) /* convert timespec to l_fp */ \
+ do { \
+ double d_temp; \
+ \
+ (x).integral += (unsigned int)PPS_JAN_1970; \
+ d_temp = (x).fractional * PPS_FRAC / PPS_NANOSECOND; \
+ if (d_temp >= PPS_FRAC) \
+ (x).integral++; \
+ (x).fractional = (unsigned int)d_temp; \
+ } while (0)
+
+/*
+ * Device/implementation parameters (mode)
+ */
+
+#define PPS_CAPTUREASSERT 0x01 /* capture assert events */
+#define PPS_CAPTURECLEAR 0x02 /* capture clear events */
+#define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */
+
+#define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */
+#define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */
+#define PPS_OFFSETBOTH 0x30 /* apply compensation for both */
+
+#define PPS_CANWAIT 0x100 /* Can we wait for an event? */
+#define PPS_CANPOLL 0x200 /* "This bit is reserved for */
+
+/*
+ * Kernel actions (mode)
+ */
+
+#define PPS_ECHOASSERT 0x40 /* feed back assert event to output */
+#define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */
+
+/*
+ * Timestamp formats (tsformat)
+ */
+
+#define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */
+#define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */
+
+/*
+ * Kernel discipline actions (not used in Solaris)
+ */
+
+#define PPS_KC_HARDPPS 0 /* enable kernel consumer */
+#define PPS_KC_HARDPPS_PLL 1 /* phase-lock mode */
+#define PPS_KC_HARDPPS_FLL 2 /* frequency-lock mode */
+
+/*
+ * Type definitions
+ */
+
+typedef unsigned long pps_seq_t; /* sequence number */
+
+typedef struct ntp_fp {
+ unsigned int integral;
+ unsigned int fractional;
+} ntp_fp_t; /* NTP-compatible time stamp */
+
+typedef union pps_timeu { /* timestamp format */
+ struct timespec tspec;
+ ntp_fp_t ntpfp;
+ unsigned long longpad[3];
+} pps_timeu_t; /* generic data type to represent time stamps */
+
+/*
+ * Timestamp information structure
+ */
+
+typedef struct pps_info {
+ pps_seq_t assert_sequence; /* seq. num. of assert event */
+ pps_seq_t clear_sequence; /* seq. num. of clear event */
+ pps_timeu_t assert_tu; /* time of assert event */
+ pps_timeu_t clear_tu; /* time of clear event */
+ int current_mode; /* current mode bits */
+} pps_info_t;
+
+#define assert_timestamp assert_tu.tspec
+#define clear_timestamp clear_tu.tspec
+
+#define assert_timestamp_ntpfp assert_tu.ntpfp
+#define clear_timestamp_ntpfp clear_tu.ntpfp
+
+/*
+ * Parameter structure
+ */
+
+typedef struct pps_params {
+ int api_version; /* API version # */
+ int mode; /* mode bits */
+ pps_timeu_t assert_off_tu; /* offset compensation for assert */
+ pps_timeu_t clear_off_tu; /* offset compensation for clear */
+} pps_params_t;
+
+#define assert_offset assert_off_tu.tspec
+#define clear_offset clear_off_tu.tspec
+
+#define assert_offset_ntpfp assert_off_tu.ntpfp
+#define clear_offset_ntpfp clear_off_tu.ntpfp
+
+/*
+ * The following definitions are architecture-dependent
+ */
+
+#define PPS_CAP (PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+#define PPS_RO (PPS_CANWAIT | PPS_CANPOLL | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+
+typedef struct {
+ int filedes; /* file descriptor */
+ pps_params_t params; /* PPS parameters set by user */
+ struct timeval tv_save;
+ pps_seq_t serial;
+} pps_unit_t;
+
+typedef pps_unit_t* pps_handle_t; /* pps handlebars */
+
+/*
+ *------ Here begins the implementation-specific part! ------
+ */
+
+#include <errno.h>
+
+/*
+ * create PPS handle from file descriptor
+ */
+
+static inline int
+time_pps_create(
+ int filedes, /* file descriptor */
+ pps_handle_t *handle /* returned handle */
+ )
+{
+ int one = 1;
+
+ /*
+ * Check for valid arguments and attach PPS signal.
+ */
+
+ if (!handle) {
+ errno = EFAULT;
+ return (-1); /* null pointer */
+ }
+
+ /*
+ * Allocate and initialize default unit structure.
+ */
+
+ *handle = malloc(sizeof(pps_unit_t));
+ if (!(*handle)) {
+ errno = EBADF;
+ return (-1); /* what, no memory? */
+ }
+
+ memset(*handle, 0, sizeof(pps_unit_t));
+ (*handle)->filedes = filedes;
+ (*handle)->params.api_version = PPS_API_VERS_1;
+ (*handle)->params.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
+ return (0);
+}
+
+/*
+ * release PPS handle
+ */
+
+static inline int
+time_pps_destroy(
+ pps_handle_t handle
+ )
+{
+ /*
+ * Check for valid arguments and detach PPS signal.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+ free(handle);
+ return (0);
+}
+
+/*
+ * set parameters for handle
+ */
+
+static inline int
+time_pps_setparams(
+ pps_handle_t handle,
+ const pps_params_t *params
+ )
+{
+ int mode, mode_in;
+ /*
+ * Check for valid arguments and set parameters.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!params) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ /*
+ * There was no reasonable consensu in the API working group.
+ * I require `api_version' to be set!
+ */
+
+ if (params->api_version != PPS_API_VERS_1) {
+ errno = EINVAL;
+ return(-1);
+ }
+
+ /*
+ * only settable modes are PPS_CAPTUREASSERT and PPS_OFFSETASSERT
+ */
+
+ mode_in = params->mode;
+
+ /* turn off read-only bits */
+
+ mode_in &= ~PPS_RO;
+
+ /* test remaining bits, should only have captureassert and/or offsetassert */
+
+ if (mode_in & ~(PPS_CAPTUREASSERT | PPS_OFFSETASSERT)) {
+ errno = EOPNOTSUPP;
+ return(-1);
+ }
+
+ /*
+ * ok, ready to go.
+ */
+
+ mode = handle->params.mode;
+ memcpy(&handle->params, params, sizeof(pps_params_t));
+ handle->params.api_version = PPS_API_VERS_1;
+ handle->params.mode = mode | mode_in;
+ return (0);
+}
+
+/*
+ * get parameters for handle
+ */
+
+static inline int
+time_pps_getparams(
+ pps_handle_t handle,
+ pps_params_t *params
+ )
+{
+ /*
+ * Check for valid arguments and get parameters.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!params) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ memcpy(params, &handle->params, sizeof(pps_params_t));
+ return (0);
+}
+
+/* (
+ * get capabilities for handle
+ */
+
+static inline int
+time_pps_getcap(
+ pps_handle_t handle,
+ int *mode
+ )
+{
+ /*
+ * Check for valid arguments and get capabilities.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!mode) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+ *mode = PPS_CAP;
+ return (0);
+}
+
+/*
+ * Fetch timestamps
+ */
+
+static inline int
+time_pps_fetch(
+ pps_handle_t handle,
+ const int tsformat,
+ pps_info_t *ppsinfo,
+ const struct timespec *timeout
+ )
+{
+ struct timeval tv;
+ pps_info_t infobuf;
+
+ /*
+ * Check for valid arguments and fetch timestamps
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!ppsinfo) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ /*
+ * nb. PPS_CANWAIT is NOT set by the implementation, we can totally
+ * ignore the timeout variable.
+ */
+
+ memset(&infobuf, 0, sizeof(infobuf));
+
+ /*
+ * if not captureassert, nothing to return.
+ */
+
+ if (!handle->params.mode & PPS_CAPTUREASSERT) {
+ memcpy(ppsinfo, &infobuf, sizeof(pps_info_t));
+ return (0);
+ }
+
+ if (ioctl(instance->filedes, TIOCDCDTIMESTAMP, &tv) < 0) {
+ perror("time_pps_fetch:");
+ errno = EOPNOTSUPP;
+ return(-1);
+ }
+
+ /*
+ * fake serial here
+ */
+
+ if (tv.tv_sec != handle->tv_save.tv_sec || tv.tv_usec != handle->tv_save.tv_usec) {
+ handle->tv_save = tv;
+ handle->serial++;
+ }
+
+ /*
+ * Apply offsets as specified. Note that only assert timestamps
+ * are captured by this interface.
+ */
+
+ infobuf.assert_sequence = handle->serial;
+ infobuf.assert_timestamp.tv_sec = tv.tv_sec;
+ infobuf.assert_timestamp.tv_nsec = tv.tv_usec * 1000;
+
+ if (handle->params.mode & PPS_OFFSETASSERT) {
+ infobuf.assert_timestamp.tv_sec += handle->params.assert_offset.tv_sec;
+ infobuf.assert_timestamp.tv_nsec += handle->params.assert_offset.tv_nsec;
+ PPS_NORMALIZE(infobuf.assert_timestamp);
+ }
+
+ /*
+ * Translate to specified format
+ */
+
+ switch (tsformat) {
+ case PPS_TSFMT_TSPEC:
+ break; /* timespec format requires no translation */
+
+ case PPS_TSFMT_NTPFP: /* NTP format requires conversion to fraction form */
+ PPS_TSPECTONTP(infobuf.assert_timestamp_ntpfp);
+ break;
+
+ default:
+ errno = EINVAL;
+ return (-1);
+ }
+
+ infobuf.current_mode = handle->params.mode;
+ memcpy(ppsinfo, &infobuf, sizeof(pps_info_t));
+ return (0);
+}
+
+/*
+ * specify kernel consumer
+ */
+
+static inline int
+time_pps_kcbind(
+ pps_handle_t handle,
+ const int kernel_consumer,
+ const int edge, const int tsformat
+ )
+{
+ /*
+ * Check for valid arguments and bind kernel consumer
+ */
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+ if (geteuid() != 0) {
+ errno = EPERM;
+ return (-1); /* must be superuser */
+ }
+ errno = EOPNOTSUPP;
+ return(-1);
+}
+
+#endif /* _SYS_TIMEPPS_H_ */
diff --git a/include/timepps-Solaris.h b/include/timepps-Solaris.h
new file mode 100644
index 0000000..a2b1fbe
--- /dev/null
+++ b/include/timepps-Solaris.h
@@ -0,0 +1,569 @@
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2009 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and with or without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * this modified timepps.h can be used to provide a PPSAPI interface *
+ * to a machine running Solaris (2.6 and above). *
+ * *
+ ***********************************************************************
+ * *
+ * A full PPSAPI interface to the Solaris kernel would be better, but *
+ * this at least removes the necessity for special coding from the NTP *
+ * NTP drivers. *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+/* Solaris version, TIOCGPPSEV and TIOCSPPS assumed to exist. */
+
+#ifndef _SYS_TIMEPPS_H_
+#define _SYS_TIMEPPS_H_
+
+#include <termios.h> /* to get TOCGPPSEV and TIOCSPPS */
+
+/* Implementation note: the logical states ``assert'' and ``clear''
+ * are implemented in terms of the UART register, i.e. ``assert''
+ * means the bit is set.
+ */
+
+/*
+ * The following definitions are architecture independent
+ */
+
+#define PPS_API_VERS_1 1 /* API version number */
+#define PPS_JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
+#define PPS_NANOSECOND 1000000000L /* one nanosecond in decimal */
+#define PPS_FRAC 4294967296. /* 2^32 as a double */
+
+#define PPS_NORMALIZE(x) /* normalize timespec */ \
+ do { \
+ if ((x).tv_nsec >= PPS_NANOSECOND) { \
+ (x).tv_nsec -= PPS_NANOSECOND; \
+ (x).tv_sec++; \
+ } else if ((x).tv_nsec < 0) { \
+ (x).tv_nsec += PPS_NANOSECOND; \
+ (x).tv_sec--; \
+ } \
+ } while (0)
+
+#define PPS_TSPECTONTP(x) /* convert timespec to l_fp */ \
+ do { \
+ double d_temp; \
+ \
+ (x).integral += (unsigned int)PPS_JAN_1970; \
+ d_temp = (x).fractional * PPS_FRAC / PPS_NANOSECOND; \
+ if (d_temp >= PPS_FRAC) \
+ (x).integral++; \
+ (x).fractional = (unsigned int)d_temp; \
+ } while (0)
+
+/*
+ * Device/implementation parameters (mode)
+ */
+
+#define PPS_CAPTUREASSERT 0x01 /* capture assert events */
+#define PPS_CAPTURECLEAR 0x02 /* capture clear events */
+#define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */
+
+#define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */
+#define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */
+#define PPS_OFFSETBOTH 0x30 /* apply compensation for both */
+
+#define PPS_CANWAIT 0x100 /* Can we wait for an event? */
+#define PPS_CANPOLL 0x200 /* "This bit is reserved for */
+
+/*
+ * Kernel actions (mode)
+ */
+
+#define PPS_ECHOASSERT 0x40 /* feed back assert event to output */
+#define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */
+
+/*
+ * Timestamp formats (tsformat)
+ */
+
+#define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */
+#define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */
+
+/*
+ * Kernel discipline actions (not used in Solaris)
+ */
+
+#define PPS_KC_HARDPPS 0 /* enable kernel consumer */
+#define PPS_KC_HARDPPS_PLL 1 /* phase-lock mode */
+#define PPS_KC_HARDPPS_FLL 2 /* frequency-lock mode */
+
+/*
+ * Type definitions
+ */
+
+typedef unsigned long pps_seq_t; /* sequence number */
+
+typedef struct ntp_fp {
+ unsigned int integral;
+ unsigned int fractional;
+} ntp_fp_t; /* NTP-compatible time stamp */
+
+typedef union pps_timeu { /* timestamp format */
+ struct timespec tspec;
+ ntp_fp_t ntpfp;
+ unsigned long longpad[3];
+} pps_timeu_t; /* generic data type to represent time stamps */
+
+/*
+ * Timestamp information structure
+ */
+
+typedef struct pps_info {
+ pps_seq_t assert_sequence; /* seq. num. of assert event */
+ pps_seq_t clear_sequence; /* seq. num. of clear event */
+ pps_timeu_t assert_tu; /* time of assert event */
+ pps_timeu_t clear_tu; /* time of clear event */
+ int current_mode; /* current mode bits */
+} pps_info_t;
+
+#define assert_timestamp assert_tu.tspec
+#define clear_timestamp clear_tu.tspec
+
+#define assert_timestamp_ntpfp assert_tu.ntpfp
+#define clear_timestamp_ntpfp clear_tu.ntpfp
+
+/*
+ * Parameter structure
+ */
+
+typedef struct pps_params {
+ int api_version; /* API version # */
+ int mode; /* mode bits */
+ pps_timeu_t assert_off_tu; /* offset compensation for assert */
+ pps_timeu_t clear_off_tu; /* offset compensation for clear */
+} pps_params_t;
+
+#define assert_offset assert_off_tu.tspec
+#define clear_offset clear_off_tu.tspec
+
+#define assert_offset_ntpfp assert_off_tu.ntpfp
+#define clear_offset_ntpfp clear_off_tu.ntpfp
+
+/* addition of NTP fixed-point format */
+
+#define NTPFP_M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \
+ do { \
+ register u_int32 lo_tmp; \
+ register u_int32 hi_tmp; \
+ \
+ lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \
+ hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \
+ if (lo_tmp & 0x10000) \
+ hi_tmp++; \
+ (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
+ \
+ (r_i) += (a_i); \
+ if (hi_tmp & 0x10000) \
+ (r_i)++; \
+ } while (0)
+
+#define NTPFP_L_ADDS(r, a) NTPFP_M_ADD((r)->integral, (r)->fractional, \
+ (int)(a)->integral, (a)->fractional)
+
+/*
+ * The following definitions are architecture-dependent
+ */
+
+#define PPS_CAP (PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+#define PPS_RO (PPS_CANWAIT | PPS_CANPOLL)
+
+typedef struct {
+ int filedes; /* file descriptor */
+ pps_params_t params; /* PPS parameters set by user */
+} pps_unit_t;
+
+/*
+ *------ Here begins the implementation-specific part! ------
+ */
+
+#include <errno.h>
+
+/*
+ * pps handlebars, which are required to be an opaque scalar. This
+ * implementation uses the handle as a pointer so it must be large
+ * enough. uintptr_t is as large as a pointer.
+ */
+typedef uintptr_t pps_handle_t;
+
+/*
+ * create PPS handle from file descriptor
+ */
+
+static inline int
+time_pps_create(
+ int filedes, /* file descriptor */
+ pps_handle_t *handle /* returned handle */
+ )
+{
+ pps_unit_t *punit;
+ int one = 1;
+
+ /*
+ * Check for valid arguments and attach PPS signal.
+ */
+
+ if (!handle) {
+ errno = EFAULT;
+ return (-1); /* null pointer */
+ }
+
+ if (ioctl(filedes, TIOCSPPS, &one) < 0) {
+ perror("refclock_ioctl: TIOCSPPS failed:");
+ return (-1);
+ }
+
+ /*
+ * Allocate and initialize default unit structure.
+ */
+
+ punit = malloc(sizeof(*punit));
+ if (NULL == punit) {
+ errno = ENOMEM;
+ return (-1); /* what, no memory? */
+ }
+
+ memset(punit, 0, sizeof(*punit));
+ punit->filedes = filedes;
+ punit->params.api_version = PPS_API_VERS_1;
+ punit->params.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
+
+ *handle = (pps_handle_t)punit;
+ return (0);
+}
+
+/*
+ * release PPS handle
+ */
+
+static inline int
+time_pps_destroy(
+ pps_handle_t handle
+ )
+{
+ pps_unit_t *punit;
+
+ /*
+ * Check for valid arguments and detach PPS signal.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+ punit = (pps_unit_t *)handle;
+ free(punit);
+ return (0);
+}
+
+/*
+ * set parameters for handle
+ */
+
+static inline int
+time_pps_setparams(
+ pps_handle_t handle,
+ const pps_params_t *params
+ )
+{
+ pps_unit_t * punit;
+ int mode, mode_in;
+ /*
+ * Check for valid arguments and set parameters.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!params) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ /*
+ * There was no reasonable consensu in the API working group.
+ * I require `api_version' to be set!
+ */
+
+ if (params->api_version != PPS_API_VERS_1) {
+ errno = EINVAL;
+ return(-1);
+ }
+
+ /*
+ * only settable modes are PPS_CAPTUREASSERT and PPS_OFFSETASSERT
+ */
+
+ mode_in = params->mode;
+ punit = (pps_unit_t *)handle;
+
+ /*
+ * Only one of the time formats may be selected
+ * if a nonzero assert offset is supplied.
+ */
+ if ((mode_in & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) ==
+ (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) {
+
+ if (punit->params.assert_offset.tv_sec ||
+ punit->params.assert_offset.tv_nsec) {
+
+ errno = EINVAL;
+ return(-1);
+ }
+
+ /*
+ * If no offset was specified but both time
+ * format flags are used consider it harmless
+ * but turn off PPS_TSFMT_NTPFP so getparams
+ * will not show both formats lit.
+ */
+ mode_in &= ~PPS_TSFMT_NTPFP;
+ }
+
+ /* turn off read-only bits */
+
+ mode_in &= ~PPS_RO;
+
+ /*
+ * test remaining bits, should only have captureassert,
+ * offsetassert, and/or timestamp format bits.
+ */
+
+ if (mode_in & ~(PPS_CAPTUREASSERT | PPS_OFFSETASSERT |
+ PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) {
+ errno = EOPNOTSUPP;
+ return(-1);
+ }
+
+ /*
+ * ok, ready to go.
+ */
+
+ mode = punit->params.mode;
+ memcpy(&punit->params, params, sizeof(punit->params));
+ punit->params.api_version = PPS_API_VERS_1;
+ punit->params.mode = mode | mode_in;
+ return (0);
+}
+
+/*
+ * get parameters for handle
+ */
+
+static inline int
+time_pps_getparams(
+ pps_handle_t handle,
+ pps_params_t *params
+ )
+{
+ pps_unit_t * punit;
+
+ /*
+ * Check for valid arguments and get parameters.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!params) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ punit = (pps_unit_t *)handle;
+ memcpy(params, &punit->params, sizeof(params));
+ return (0);
+}
+
+/*
+ * get capabilities for handle
+ */
+
+static inline int
+time_pps_getcap(
+ pps_handle_t handle,
+ int *mode
+ )
+{
+ /*
+ * Check for valid arguments and get capabilities.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!mode) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+ *mode = PPS_CAP;
+ return (0);
+}
+
+/*
+ * Fetch timestamps
+ */
+
+static inline int
+time_pps_fetch(
+ pps_handle_t handle,
+ const int tsformat,
+ pps_info_t *ppsinfo,
+ const struct timespec *timeout
+ )
+{
+ struct ppsclockev {
+ struct timeval tv;
+ u_int serial;
+ } ev;
+
+ pps_info_t infobuf;
+ pps_unit_t * punit;
+
+ /*
+ * Check for valid arguments and fetch timestamps
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!ppsinfo) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ /*
+ * nb. PPS_CANWAIT is NOT set by the implementation, we can totally
+ * ignore the timeout variable.
+ */
+
+ memset(&infobuf, 0, sizeof(infobuf));
+ punit = (pps_unit_t *)handle;
+
+ /*
+ * if not captureassert, nothing to return.
+ */
+
+ if (!punit->params.mode & PPS_CAPTUREASSERT) {
+ memcpy(ppsinfo, &infobuf, sizeof(*ppsinfo));
+ return (0);
+ }
+
+ if (ioctl(punit->filedes, TIOCGPPSEV, (caddr_t) &ev) < 0) {
+ perror("time_pps_fetch:");
+ errno = EOPNOTSUPP;
+ return(-1);
+ }
+
+ infobuf.assert_sequence = ev.serial;
+ infobuf.assert_timestamp.tv_sec = ev.tv.tv_sec;
+ infobuf.assert_timestamp.tv_nsec = ev.tv.tv_usec * 1000;
+
+ /*
+ * Translate to specified format then apply offset
+ */
+
+ switch (tsformat) {
+ case PPS_TSFMT_TSPEC:
+ /* timespec format requires no conversion */
+ if (punit->params.mode & PPS_OFFSETASSERT) {
+ infobuf.assert_timestamp.tv_sec +=
+ punit->params.assert_offset.tv_sec;
+ infobuf.assert_timestamp.tv_nsec +=
+ punit->params.assert_offset.tv_nsec;
+ PPS_NORMALIZE(infobuf.assert_timestamp);
+ }
+ break;
+
+ case PPS_TSFMT_NTPFP:
+ /* NTP format requires conversion to fraction form */
+ PPS_TSPECTONTP(infobuf.assert_timestamp_ntpfp);
+ if (punit->params.mode & PPS_OFFSETASSERT)
+ NTPFP_L_ADDS(&infobuf.assert_timestamp_ntpfp,
+ &punit->params.assert_offset_ntpfp);
+ break;
+
+ default:
+ errno = EINVAL;
+ return (-1);
+ }
+
+ infobuf.current_mode = punit->params.mode;
+ memcpy(ppsinfo, &infobuf, sizeof(*ppsinfo));
+ return (0);
+}
+
+/*
+ * specify kernel consumer
+ */
+
+static inline int
+time_pps_kcbind(
+ pps_handle_t handle,
+ const int kernel_consumer,
+ const int edge,
+ const int tsformat
+ )
+{
+ /*
+ * Check for valid arguments and bind kernel consumer
+ */
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+ if (geteuid() != 0) {
+ errno = EPERM;
+ return (-1); /* must be superuser */
+ }
+ errno = EOPNOTSUPP;
+ return(-1);
+}
+
+#endif /* _SYS_TIMEPPS_H_ */
diff --git a/include/timepps-SunOS.h b/include/timepps-SunOS.h
new file mode 100644
index 0000000..4e4c05e
--- /dev/null
+++ b/include/timepps-SunOS.h
@@ -0,0 +1,504 @@
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2000 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and with or without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * this modified timepps.h can be used to provide a PPSAPI interface *
+ * to a machine running SunOS. *
+ * *
+ ***********************************************************************
+ * *
+ * A full PPSAPI interface to the SunOS kernel would be better, but *
+ * this at least removes the necessity for special coding from the NTP *
+ * NTP drivers. *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+/* SunOS version, CIOGETEV assumed to exist for SunOS */
+
+#ifndef _SYS_TIMEPPS_H_
+#define _SYS_TIMEPPS_H_
+
+#include <termios.h> /* to get CIOGETEV */
+
+/* Implementation note: the logical states ``assert'' and ``clear''
+ * are implemented in terms of the UART register, i.e. ``assert''
+ * means the bit is set.
+ */
+
+/*
+ * The following definitions are architecture independent
+ */
+
+#define PPS_API_VERS_1 1 /* API version number */
+#define PPS_JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
+#define PPS_NANOSECOND 1000000000L /* one nanosecond in decimal */
+#define PPS_FRAC 4294967296. /* 2^32 as a double */
+
+#define PPS_NORMALIZE(x) /* normalize timespec */ \
+ do { \
+ if ((x).tv_nsec >= PPS_NANOSECOND) { \
+ (x).tv_nsec -= PPS_NANOSECOND; \
+ (x).tv_sec++; \
+ } else if ((x).tv_nsec < 0) { \
+ (x).tv_nsec += PPS_NANOSECOND; \
+ (x).tv_sec--; \
+ } \
+ } while (0)
+
+#define PPS_TSPECTONTP(x) /* convert timespec to l_fp */ \
+ do { \
+ double d_temp; \
+ \
+ (x).integral += (unsigned int)PPS_JAN_1970; \
+ d_temp = (x).fractional * PPS_FRAC / PPS_NANOSECOND; \
+ if (d_temp >= PPS_FRAC) \
+ (x).integral++; \
+ (x).fractional = (unsigned int)d_temp; \
+ } while (0)
+
+/*
+ * Device/implementation parameters (mode)
+ */
+
+#define PPS_CAPTUREASSERT 0x01 /* capture assert events */
+#define PPS_CAPTURECLEAR 0x02 /* capture clear events */
+#define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */
+
+#define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */
+#define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */
+#define PPS_OFFSETBOTH 0x30 /* apply compensation for both */
+
+#define PPS_CANWAIT 0x100 /* Can we wait for an event? */
+#define PPS_CANPOLL 0x200 /* "This bit is reserved for */
+
+/*
+ * Kernel actions (mode)
+ */
+
+#define PPS_ECHOASSERT 0x40 /* feed back assert event to output */
+#define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */
+
+/*
+ * Timestamp formats (tsformat)
+ */
+
+#define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */
+#define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */
+
+/*
+ * Kernel discipline actions (not used in SunOS)
+ */
+
+#define PPS_KC_HARDPPS 0 /* enable kernel consumer */
+#define PPS_KC_HARDPPS_PLL 1 /* phase-lock mode */
+#define PPS_KC_HARDPPS_FLL 2 /* frequency-lock mode */
+
+/*
+ * Type definitions
+ */
+
+typedef unsigned long pps_seq_t; /* sequence number */
+
+typedef struct ntp_fp {
+ unsigned int integral;
+ unsigned int fractional;
+} ntp_fp_t; /* NTP-compatible time stamp */
+
+typedef union pps_timeu { /* timestamp format */
+ struct timespec tspec;
+ ntp_fp_t ntpfp;
+ unsigned long longpad[3];
+} pps_timeu_t; /* generic data type to represent time stamps */
+
+/*
+ * Timestamp information structure
+ */
+
+typedef struct pps_info {
+ pps_seq_t assert_sequence; /* seq. num. of assert event */
+ pps_seq_t clear_sequence; /* seq. num. of clear event */
+ pps_timeu_t assert_tu; /* time of assert event */
+ pps_timeu_t clear_tu; /* time of clear event */
+ int current_mode; /* current mode bits */
+} pps_info_t;
+
+#define assert_timestamp assert_tu.tspec
+#define clear_timestamp clear_tu.tspec
+
+#define assert_timestamp_ntpfp assert_tu.ntpfp
+#define clear_timestamp_ntpfp clear_tu.ntpfp
+
+/*
+ * Parameter structure
+ */
+
+typedef struct pps_params {
+ int api_version; /* API version # */
+ int mode; /* mode bits */
+ pps_timeu_t assert_off_tu; /* offset compensation for assert */
+ pps_timeu_t clear_off_tu; /* offset compensation for clear */
+} pps_params_t;
+
+#define assert_offset assert_off_tu.tspec
+#define clear_offset clear_off_tu.tspec
+
+#define assert_offset_ntpfp assert_off_tu.ntpfp
+#define clear_offset_ntpfp clear_off_tu.ntpfp
+
+/*
+ * The following definitions are architecture-dependent
+ */
+
+#define PPS_CAP (PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+#define PPS_RO (PPS_CANWAIT | PPS_CANPOLL | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+
+typedef struct {
+ int filedes; /* file descriptor */
+ pps_params_t params; /* PPS parameters set by user */
+} pps_unit_t;
+
+typedef pps_unit_t* pps_handle_t; /* pps handlebars */
+
+/*
+ *------ Here begins the implementation-specific part! ------
+ */
+
+#include <errno.h>
+
+/*
+ * create PPS handle from file descriptor
+ */
+
+static inline int
+time_pps_create(
+ int filedes, /* file descriptor */
+ pps_handle_t *handle /* returned handle */
+ )
+{
+ /*
+ * Check for valid arguments and attach PPS signal.
+ */
+
+ if (!handle) {
+ errno = EFAULT;
+ return (-1); /* null pointer */
+ }
+
+ if (ioctl(filedes, I_PUSH, "ppsclock") < 0) {
+ perror("time_pps_create: I_PUSH ppsclock failed");
+ return (-1);
+ }
+
+ /*
+ * Allocate and initialize default unit structure.
+ */
+
+ *handle = malloc(sizeof(pps_unit_t));
+ if (!(*handle)) {
+ errno = EBADF;
+ return (-1); /* what, no memory? */
+ }
+
+ memset(*handle, 0, sizeof(pps_unit_t));
+ (*handle)->filedes = filedes;
+ (*handle)->params.api_version = PPS_API_VERS_1;
+ (*handle)->params.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
+ return (0);
+}
+
+/*
+ * release PPS handle
+ */
+
+static inline int
+time_pps_destroy(
+ pps_handle_t handle
+ )
+{
+ /*
+ * Check for valid arguments and detach PPS signal.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+ free(handle);
+ return (0);
+}
+
+/*
+ * set parameters for handle
+ */
+
+static inline int
+time_pps_setparams(
+ pps_handle_t handle,
+ const pps_params_t *params
+ )
+{
+ int mode, mode_in;
+ /*
+ * Check for valid arguments and set parameters.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!params) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ /*
+ * There was no reasonable consensu in the API working group.
+ * I require `api_version' to be set!
+ */
+
+ if (params->api_version != PPS_API_VERS_1) {
+ errno = EINVAL;
+ return(-1);
+ }
+
+ /*
+ * only settable modes are PPS_CAPTUREASSERT and PPS_OFFSETASSERT
+ */
+
+ mode_in = params->mode;
+
+ /* turn off read-only bits */
+
+ mode_in &= ~PPS_RO;
+
+ /* test remaining bits, should only have captureassert and/or offsetassert */
+
+ if (mode_in & ~(PPS_CAPTUREASSERT | PPS_OFFSETASSERT)) {
+ errno = EOPNOTSUPP;
+ return(-1);
+ }
+
+ /*
+ * ok, ready to go.
+ */
+
+ mode = handle->params.mode;
+ memcpy(&handle->params, params, sizeof(pps_params_t));
+ handle->params.api_version = PPS_API_VERS_1;
+ handle->params.mode = mode | mode_in;
+ return (0);
+}
+
+/*
+ * get parameters for handle
+ */
+
+static inline int
+time_pps_getparams(
+ pps_handle_t handle,
+ pps_params_t *params
+ )
+{
+ /*
+ * Check for valid arguments and get parameters.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!params) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ memcpy(params, &handle->params, sizeof(pps_params_t));
+ return (0);
+}
+
+/* (
+ * get capabilities for handle
+ */
+
+static inline int
+time_pps_getcap(
+ pps_handle_t handle,
+ int *mode
+ )
+{
+ /*
+ * Check for valid arguments and get capabilities.
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!mode) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+ *mode = PPS_CAP;
+ return (0);
+}
+
+/*
+ * Fetch timestamps
+ */
+
+static inline int
+time_pps_fetch(
+ pps_handle_t handle,
+ const int tsformat,
+ pps_info_t *ppsinfo,
+ const struct timespec *timeout
+ )
+{
+ struct ppsclockev {
+ struct timeval tv;
+ u_int serial;
+ } ev;
+ pps_info_t infobuf;
+
+ /*
+ * Check for valid arguments and fetch timestamps
+ */
+
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+
+ if (!ppsinfo) {
+ errno = EFAULT;
+ return (-1); /* bad argument */
+ }
+
+ /*
+ * nb. PPS_CANWAIT is NOT set by the implementation, we can totally
+ * ignore the timeout variable.
+ */
+
+ memset(&infobuf, 0, sizeof(infobuf));
+
+ /*
+ * if not captureassert, nothing to return.
+ */
+
+ if (!handle->params.mode & PPS_CAPTUREASSERT) {
+ memcpy(ppsinfo, &infobuf, sizeof(pps_info_t));
+ return (0);
+ }
+
+#if defined(__STDC__)
+#define CIOGETEV _IOR('C', 0, struct ppsclockev) /* get last pps event */
+#else
+#define CIOGETEV _IOR(C, 0, struct ppsclockev) /* get last pps event */
+#endif
+
+ if (ioctl(handle->filedes, CIOGETEV, (caddr_t) &ev) < 0) {
+ perror("time_pps_fetch:");
+ errno = EOPNOTSUPP;
+ return(-1);
+ }
+
+ /*
+ * Apply offsets as specified. Note that only assert timestamps
+ * are captured by this interface.
+ */
+
+ infobuf.assert_sequence = ev.serial;
+ infobuf.assert_timestamp.tv_sec = ev.tv.tv_sec;
+ infobuf.assert_timestamp.tv_nsec = ev.tv.tv_usec * 1000;
+
+ if (handle->params.mode & PPS_OFFSETASSERT) {
+ infobuf.assert_timestamp.tv_sec += handle->params.assert_offset.tv_sec;
+ infobuf.assert_timestamp.tv_nsec += handle->params.assert_offset.tv_nsec;
+ PPS_NORMALIZE(infobuf.assert_timestamp);
+ }
+
+ /*
+ * Translate to specified format
+ */
+
+ switch (tsformat) {
+ case PPS_TSFMT_TSPEC:
+ break; /* timespec format requires no translation */
+
+ case PPS_TSFMT_NTPFP: /* NTP format requires conversion to fraction form */
+ PPS_TSPECTONTP(infobuf.assert_timestamp_ntpfp);
+ break;
+
+ default:
+ errno = EINVAL;
+ return (-1);
+ }
+
+ infobuf.current_mode = handle->params.mode;
+ memcpy(ppsinfo, &infobuf, sizeof(pps_info_t));
+ return (0);
+}
+
+/*
+ * specify kernel consumer
+ */
+
+static inline int
+time_pps_kcbind(
+ pps_handle_t handle,
+ const int kernel_consumer,
+ const int edge, const int tsformat
+ )
+{
+ /*
+ * Check for valid arguments and bind kernel consumer
+ */
+ if (!handle) {
+ errno = EBADF;
+ return (-1); /* bad handle */
+ }
+ if (geteuid() != 0) {
+ errno = EPERM;
+ return (-1); /* must be superuser */
+ }
+ errno = EOPNOTSUPP;
+ return(-1);
+}
+
+#endif /* _SYS_TIMEPPS_H_ */
diff --git a/include/timespecops.h b/include/timespecops.h
new file mode 100644
index 0000000..fa32e42
--- /dev/null
+++ b/include/timespecops.h
@@ -0,0 +1,393 @@
+/*
+ * timespecops.h -- calculations on 'struct timespec' values
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ *
+ * Rationale
+ * ---------
+ *
+ * Doing basic arithmetic on a 'struct timespec' is not exceedingly
+ * hard, but it requires tedious and repetitive code to keep the result
+ * normalised. We consider a timespec normalised when the nanosecond
+ * fraction is in the interval [0 .. 10^9[ ; there are multiple value
+ * pairs of seconds and nanoseconds that denote the same time interval,
+ * but the normalised representation is unique. No two different
+ * intervals can have the same normalised representation.
+ *
+ * Another topic is the representation of negative time intervals.
+ * There's more than one way to this, since both the seconds and the
+ * nanoseconds of a timespec are signed values. IMHO, the easiest way is
+ * to use a complement representation where the nanoseconds are still
+ * normalised, no matter what the sign of the seconds value. This makes
+ * normalisation easier, since the sign of the integer part is
+ * irrelevant, and it removes several sign decision cases during the
+ * calculations.
+ *
+ * As long as no signed integer overflow can occur with the nanosecond
+ * part of the operands, all operations work as expected and produce a
+ * normalised result.
+ *
+ * The exception to this are functions fix a '_fast' suffix, which do no
+ * normalisation on input data and therefore expect the input data to be
+ * normalised.
+ *
+ * Input and output operands may overlap; all input is consumed before
+ * the output is written to.
+ */
+#ifndef TIMESPECOPS_H
+#define TIMESPECOPS_H
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <math.h>
+
+#include "ntp.h"
+#include "timetoa.h"
+
+
+/* nanoseconds per second */
+#define NANOSECONDS 1000000000
+
+/* predicate: returns TRUE if the nanoseconds are in nominal range */
+#define timespec_isnormal(x) \
+ ((x)->tv_nsec >= 0 && (x)->tv_nsec < NANOSECONDS)
+
+/* predicate: returns TRUE if the nanoseconds are out-of-bounds */
+#define timespec_isdenormal(x) (!timespec_isnormal(x))
+
+/* conversion between l_fp fractions and nanoseconds */
+#ifdef HAVE_U_INT64
+# define FTOTVN(tsf) \
+ ((int32) \
+ (((u_int64)(tsf) * NANOSECONDS + 0x80000000) >> 32))
+# define TVNTOF(tvu) \
+ ((u_int32) \
+ ((((u_int64)(tvu) << 32) + NANOSECONDS / 2) / \
+ NANOSECONDS))
+#else
+# define NSECFRAC (FRAC / NANOSECONDS)
+# define FTOTVN(tsf) \
+ ((int32)((tsf) / NSECFRAC + 0.5))
+# define TVNTOF(tvu) \
+ ((u_int32)((tvu) * NSECFRAC + 0.5))
+#endif
+
+
+
+/* make sure nanoseconds are in nominal range */
+static inline struct timespec
+normalize_tspec(
+ struct timespec x
+ )
+{
+#if SIZEOF_LONG > 4
+ long z;
+
+ /*
+ * tv_nsec is of type 'long', and on a 64-bit machine using only
+ * loops becomes prohibitive once the upper 32 bits get
+ * involved. On the other hand, division by constant should be
+ * fast enough; so we do a division of the nanoseconds in that
+ * case. The floor adjustment step follows with the standard
+ * normalisation loops. And labs() is intentionally not used
+ * here: it has implementation-defined behaviour when applied
+ * to LONG_MIN.
+ */
+ if (x.tv_nsec < -3l * NANOSECONDS ||
+ x.tv_nsec > 3l * NANOSECONDS) {
+ z = x.tv_nsec / NANOSECONDS;
+ x.tv_nsec -= z * NANOSECONDS;
+ x.tv_sec += z;
+ }
+#endif
+ /* since 10**9 is close to 2**32, we don't divide but do a
+ * normalisation in a loop; this takes 3 steps max, and should
+ * outperform a division even if the mul-by-inverse trick is
+ * employed. */
+ if (x.tv_nsec < 0)
+ do {
+ x.tv_nsec += NANOSECONDS;
+ x.tv_sec--;
+ } while (x.tv_nsec < 0);
+ else if (x.tv_nsec >= NANOSECONDS)
+ do {
+ x.tv_nsec -= NANOSECONDS;
+ x.tv_sec++;
+ } while (x.tv_nsec >= NANOSECONDS);
+
+ return x;
+}
+
+/* x = a + b */
+static inline struct timespec
+add_tspec(
+ struct timespec a,
+ struct timespec b
+ )
+{
+ struct timespec x;
+
+ x = a;
+ x.tv_sec += b.tv_sec;
+ x.tv_nsec += b.tv_nsec;
+
+ return normalize_tspec(x);
+}
+
+/* x = a + b, b is fraction only */
+static inline struct timespec
+add_tspec_ns(
+ struct timespec a,
+ long b
+ )
+{
+ struct timespec x;
+
+ x = a;
+ x.tv_nsec += b;
+
+ return normalize_tspec(x);
+}
+
+/* x = a - b */
+static inline struct timespec
+sub_tspec(
+ struct timespec a,
+ struct timespec b
+ )
+{
+ struct timespec x;
+
+ x = a;
+ x.tv_sec -= b.tv_sec;
+ x.tv_nsec -= b.tv_nsec;
+
+ return normalize_tspec(x);
+}
+
+/* x = a - b, b is fraction only */
+static inline struct timespec
+sub_tspec_ns(
+ struct timespec a,
+ long b
+ )
+{
+ struct timespec x;
+
+ x = a;
+ x.tv_nsec -= b;
+
+ return normalize_tspec(x);
+}
+
+/* x = -a */
+static inline struct timespec
+neg_tspec(
+ struct timespec a
+ )
+{
+ struct timespec x;
+
+ x.tv_sec = -a.tv_sec;
+ x.tv_nsec = -a.tv_nsec;
+
+ return normalize_tspec(x);
+}
+
+/* x = abs(a) */
+static inline struct timespec
+abs_tspec(
+ struct timespec a
+ )
+{
+ struct timespec c;
+
+ c = normalize_tspec(a);
+ if (c.tv_sec < 0) {
+ if (c.tv_nsec != 0) {
+ c.tv_sec = -c.tv_sec - 1;
+ c.tv_nsec = NANOSECONDS - c.tv_nsec;
+ } else {
+ c.tv_sec = -c.tv_sec;
+ }
+ }
+
+ return c;
+}
+
+/*
+ * compare previously-normalised a and b
+ * return 1 / 0 / -1 if a < / == / > b
+ */
+static inline int
+cmp_tspec(
+ struct timespec a,
+ struct timespec b
+ )
+{
+ int r;
+
+ r = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
+ if (0 == r)
+ r = (a.tv_nsec > b.tv_nsec) -
+ (a.tv_nsec < b.tv_nsec);
+
+ return r;
+}
+
+/*
+ * compare possibly-denormal a and b
+ * return 1 / 0 / -1 if a < / == / > b
+ */
+static inline int
+cmp_tspec_denorm(
+ struct timespec a,
+ struct timespec b
+ )
+{
+ return cmp_tspec(normalize_tspec(a), normalize_tspec(b));
+}
+
+/*
+ * test previously-normalised a
+ * return 1 / 0 / -1 if a < / == / > 0
+ */
+static inline int
+test_tspec(
+ struct timespec a
+ )
+{
+ int r;
+
+ r = (a.tv_sec > 0) - (a.tv_sec < 0);
+ if (r == 0)
+ r = (a.tv_nsec > 0);
+
+ return r;
+}
+
+/*
+ * test possibly-denormal a
+ * return 1 / 0 / -1 if a < / == / > 0
+ */
+static inline int
+test_tspec_denorm(
+ struct timespec a
+ )
+{
+ return test_tspec(normalize_tspec(a));
+}
+
+/* return LIB buffer ptr to string rep */
+static inline const char *
+tspectoa(
+ struct timespec x
+ )
+{
+ return format_time_fraction(x.tv_sec, x.tv_nsec, 9);
+}
+
+/*
+ * convert to l_fp type, relative and absolute
+ */
+
+/* convert from timespec duration to l_fp duration */
+static inline l_fp
+tspec_intv_to_lfp(
+ struct timespec x
+ )
+{
+ struct timespec v;
+ l_fp y;
+
+ v = normalize_tspec(x);
+ y.l_uf = TVNTOF(v.tv_nsec);
+ y.l_i = (int32)v.tv_sec;
+
+ return y;
+}
+
+/* x must be UN*X epoch, output will be in NTP epoch */
+static inline l_fp
+tspec_stamp_to_lfp(
+ struct timespec x
+ )
+{
+ l_fp y;
+
+ y = tspec_intv_to_lfp(x);
+ y.l_ui += JAN_1970;
+
+ return y;
+}
+
+/* convert from l_fp type, relative signed/unsigned and absolute */
+static inline struct timespec
+lfp_intv_to_tspec(
+ l_fp x
+ )
+{
+ struct timespec out;
+ l_fp absx;
+ int neg;
+
+ neg = L_ISNEG(&x);
+ absx = x;
+ if (neg) {
+ L_NEG(&absx);
+ }
+ out.tv_nsec = FTOTVN(absx.l_uf);
+ out.tv_sec = absx.l_i;
+ if (neg) {
+ out.tv_sec = -out.tv_sec;
+ out.tv_nsec = -out.tv_nsec;
+ out = normalize_tspec(out);
+ }
+
+ return out;
+}
+
+static inline struct timespec
+lfp_uintv_to_tspec(
+ l_fp x
+ )
+{
+ struct timespec out;
+
+ out.tv_nsec = FTOTVN(x.l_uf);
+ out.tv_sec = x.l_ui;
+
+ return out;
+}
+
+/*
+ * absolute (timestamp) conversion. Input is time in NTP epoch, output
+ * is in UN*X epoch. The NTP time stamp will be expanded around the
+ * pivot time *p or the current time, if p is NULL.
+ */
+static inline struct timespec
+lfp_stamp_to_tspec(
+ l_fp x,
+ const time_t * p
+ )
+{
+ struct timespec out;
+ vint64 sec;
+
+ sec = ntpcal_ntp_to_time(x.l_ui, p);
+ out.tv_nsec = FTOTVN(x.l_uf);
+
+ /* copying a vint64 to a time_t needs some care... */
+#if SIZEOF_TIME_T <= 4
+ out.tv_sec = (time_t)sec.d_s.lo;
+#elif defined(HAVE_INT64)
+ out.tv_sec = (time_t)sec.q_s;
+#else
+ out.tv_sec = ((time_t)sec.d_s.hi << 32) | sec.d_s.lo;
+#endif
+
+ return out;
+}
+
+#endif /* TIMESPECOPS_H */
diff --git a/include/timetoa.h b/include/timetoa.h
new file mode 100644
index 0000000..2599449
--- /dev/null
+++ b/include/timetoa.h
@@ -0,0 +1,83 @@
+/*
+ * timetoa.h -- time_t related string formatting
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ *
+ * Printing a 'time_t' has some portability pitfalls, due to it's opaque
+ * base type. The only requirement imposed by the standard is that it
+ * must be a numeric type. For all practical purposes it's a signed int,
+ * and 32 bits are common.
+ *
+ * Since the UN*X time epoch will cause a signed integer overflow for
+ * 32-bit signed int values in the year 2038, implementations slowly
+ * move to 64bit base types for time_t, even in 32-bit environments. In
+ * such an environment sizeof(time_t) could be bigger than sizeof(long)
+ * and the commonly used idiom of casting to long leads to truncation.
+ *
+ * As the printf() family has no standardised type specifier for time_t,
+ * guessing the right output format specifier is a bit troublesome and
+ * best done with the help of the preprocessor and "config.h".
+ */
+#ifndef TIMETOA_H
+#define TIMETOA_H
+
+#include "ntp_fp.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+
+/*
+ * Given the size of time_t, guess what can be used as an unsigned value
+ * to hold a time_t and the printf() format specifcation.
+ *
+ * These should be used with the string constant concatenation feature
+ * of the compiler like this:
+ *
+ * printf("a time stamp: %" TIME_FORMAT " and more\n", a_time_t_value);
+ *
+ * It's not exactly nice, but there's not much leeway once we want to
+ * use the printf() family on time_t values.
+ */
+
+#if SIZEOF_TIME_T <= SIZEOF_INT
+
+typedef unsigned int u_time;
+#define TIME_FORMAT "d"
+#define UTIME_FORMAT "u"
+
+#elif SIZEOF_TIME_T <= SIZEOF_LONG
+
+typedef unsigned long u_time;
+#define TIME_FORMAT "ld"
+#define UTIME_FORMAT "lu"
+
+#elif defined(SIZEOF_LONG_LONG) && SIZEOF_TIME_T <= SIZEOF_LONG_LONG
+
+typedef unsigned long long u_time;
+#define TIME_FORMAT "lld"
+#define UTIME_FORMAT "llu"
+
+#else
+#include "GRONK: what size has a time_t here?"
+#endif
+
+/*
+ * general fractional time stamp formatting.
+ *
+ * secs - integral seconds of time stamp
+ * frac - fractional units
+ * prec - log10 of units per second (3=milliseconds, 6=microseconds,..)
+ * or in other words: the count of decimal digits required.
+ * If prec is < 0, abs(prec) is taken for the precision and secs
+ * is treated as an unsigned value.
+ *
+ * The function will eventually normalise the fraction and adjust the
+ * seconds accordingly.
+ *
+ * This function uses the string buffer library for the return value,
+ * so do not keep the resulting pointers around.
+ */
+extern const char *
+format_time_fraction(time_t secs, long frac, int prec);
+
+#endif /* !defined(TIMETOA_H) */
diff --git a/include/timevalops.h b/include/timevalops.h
new file mode 100644
index 0000000..e873b8b
--- /dev/null
+++ b/include/timevalops.h
@@ -0,0 +1,446 @@
+/*
+ * timevalops.h -- calculations on 'struct timeval' values
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ *
+ * For a rationale look at 'timespecops.h'; we do the same here, but the
+ * normalisation keeps the microseconds in [0 .. 10^6[, of course.
+ */
+#ifndef TIMEVALOPS_H
+#define TIMEVALOPS_H
+
+#include <sys/types.h>
+#include <stdio.h>
+
+#include "ntp.h"
+#include "timetoa.h"
+
+
+/* microseconds per second */
+#define MICROSECONDS 1000000
+
+#ifndef HAVE_U_INT64
+# define USE_TSF_USEC_TABLES
+#endif
+
+/*
+ * Convert usec to a time stamp fraction.
+ */
+#ifdef USE_TSF_USEC_TABLES
+extern const u_int32 ustotslo[];
+extern const u_int32 ustotsmid[];
+extern const u_int32 ustotshi[];
+
+# define TVUTOTSF(tvu, tsf) \
+ ((tsf) = ustotslo[(tvu) & 0xff] \
+ + ustotsmid[((tvu) >> 8) & 0xff] \
+ + ustotshi[((tvu) >> 16) & 0xf])
+#else
+# define TVUTOTSF(tvu, tsf) \
+ ((tsf) = (u_int32) \
+ ((((u_int64)(tvu) << 32) + MICROSECONDS / 2) / \
+ MICROSECONDS))
+#endif
+
+/*
+ * Convert a time stamp fraction to microseconds. The time stamp
+ * fraction is assumed to be unsigned.
+ */
+#ifdef USE_TSF_USEC_TABLES
+extern const u_int32 tstouslo[256];
+extern const u_int32 tstousmid[256];
+extern const u_int32 tstoushi[128];
+
+/*
+ * TV_SHIFT is used to turn the table result into a usec value. To
+ * round, add in TV_ROUNDBIT before shifting.
+ */
+#define TV_SHIFT 3
+#define TV_ROUNDBIT 0x4
+
+# define TSFTOTVU(tsf, tvu) \
+ ((tvu) = (tstoushi[((tsf) >> 24) & 0xff] \
+ + tstousmid[((tsf) >> 16) & 0xff] \
+ + tstouslo[((tsf) >> 9) & 0x7f] \
+ + TV_ROUNDBIT) >> TV_SHIFT)
+#else
+# define TSFTOTVU(tsf, tvu) \
+ ((tvu) = (int32) \
+ (((u_int64)(tsf) * MICROSECONDS + 0x80000000) >> 32))
+#endif
+
+/*
+ * Convert a struct timeval to a time stamp.
+ */
+#define TVTOTS(tv, ts) \
+ do { \
+ (ts)->l_ui = (u_long)(tv)->tv_sec; \
+ TVUTOTSF((tv)->tv_usec, (ts)->l_uf); \
+ } while (FALSE)
+
+#define sTVTOTS(tv, ts) \
+ do { \
+ int isneg = 0; \
+ long usec; \
+ (ts)->l_ui = (tv)->tv_sec; \
+ usec = (tv)->tv_usec; \
+ if (((tv)->tv_sec < 0) || ((tv)->tv_usec < 0)) { \
+ usec = -usec; \
+ (ts)->l_ui = -(ts)->l_ui; \
+ isneg = 1; \
+ } \
+ TVUTOTSF(usec, (ts)->l_uf); \
+ if (isneg) { \
+ L_NEG((ts)); \
+ } \
+ } while (FALSE)
+
+/*
+ * Convert a time stamp to a struct timeval. The time stamp
+ * has to be positive.
+ */
+#define TSTOTV(ts, tv) \
+ do { \
+ (tv)->tv_sec = (ts)->l_ui; \
+ TSFTOTVU((ts)->l_uf, (tv)->tv_usec); \
+ if ((tv)->tv_usec == 1000000) { \
+ (tv)->tv_sec++; \
+ (tv)->tv_usec = 0; \
+ } \
+ } while (FALSE)
+
+
+/*
+ * predicate: returns TRUE if the microseconds are in nominal range
+ * use like: int timeval_isnormal(const struct timeval *x)
+ */
+#define timeval_isnormal(x) \
+ ((x)->tv_usec >= 0 && (x)->tv_usec < MICROSECONDS)
+
+/*
+ * Convert milliseconds to a time stamp fraction. Unused except for
+ * refclock_leitch.c, so accompanying lookup tables were removed in
+ * favor of reusing the microseconds conversion tables.
+ */
+#define MSUTOTSF(msu, tsf) TVUTOTSF((msu) * 1000, tsf)
+
+/*
+ * predicate: returns TRUE if the microseconds are out-of-bounds
+ * use like: int timeval_isdenormal(const struct timeval *x)
+ */
+#define timeval_isdenormal(x) (!timeval_isnormal(x))
+
+/* make sure microseconds are in nominal range */
+static inline struct timeval
+normalize_tval(
+ struct timeval x
+ )
+{
+ long z;
+
+ /*
+ * If the fraction becomes excessive denormal, we use division
+ * to do first partial normalisation. The normalisation loops
+ * following will do the remaining cleanup. Since the size of
+ * tv_usec has a peculiar definition by the standard the range
+ * check is coded manually. And labs() is intentionally not used
+ * here: it has implementation-defined behaviour when applied
+ * to LONG_MIN.
+ */
+ if (x.tv_usec < -3l * MICROSECONDS ||
+ x.tv_usec > 3l * MICROSECONDS ) {
+ z = x.tv_usec / MICROSECONDS;
+ x.tv_usec -= z * MICROSECONDS;
+ x.tv_sec += z;
+ }
+
+ /*
+ * Do any remaining normalisation steps in loops. This takes 3
+ * steps max, and should outperform a division even if the
+ * mul-by-inverse trick is employed. (It also does the floor
+ * division adjustment if the above division was executed.)
+ */
+ if (x.tv_usec < 0)
+ do {
+ x.tv_usec += MICROSECONDS;
+ x.tv_sec--;
+ } while (x.tv_usec < 0);
+ else if (x.tv_usec >= MICROSECONDS)
+ do {
+ x.tv_usec -= MICROSECONDS;
+ x.tv_sec++;
+ } while (x.tv_usec >= MICROSECONDS);
+
+ return x;
+}
+
+/* x = a + b */
+static inline struct timeval
+add_tval(
+ struct timeval a,
+ struct timeval b
+ )
+{
+ struct timeval x;
+
+ x = a;
+ x.tv_sec += b.tv_sec;
+ x.tv_usec += b.tv_usec;
+
+ return normalize_tval(x);
+}
+
+/* x = a + b, b is fraction only */
+static inline struct timeval
+add_tval_us(
+ struct timeval a,
+ long b
+ )
+{
+ struct timeval x;
+
+ x = a;
+ x.tv_usec += b;
+
+ return normalize_tval(x);
+}
+
+/* x = a - b */
+static inline struct timeval
+sub_tval(
+ struct timeval a,
+ struct timeval b
+ )
+{
+ struct timeval x;
+
+ x = a;
+ x.tv_sec -= b.tv_sec;
+ x.tv_usec -= b.tv_usec;
+
+ return normalize_tval(x);
+}
+
+/* x = a - b, b is fraction only */
+static inline struct timeval
+sub_tval_us(
+ struct timeval a,
+ long b
+ )
+{
+ struct timeval x;
+
+ x = a;
+ x.tv_usec -= b;
+
+ return normalize_tval(x);
+}
+
+/* x = -a */
+static inline struct timeval
+neg_tval(
+ struct timeval a
+ )
+{
+ struct timeval x;
+
+ x.tv_sec = -a.tv_sec;
+ x.tv_usec = -a.tv_usec;
+
+ return normalize_tval(x);
+}
+
+/* x = abs(a) */
+static inline struct timeval
+abs_tval(
+ struct timeval a
+ )
+{
+ struct timeval c;
+
+ c = normalize_tval(a);
+ if (c.tv_sec < 0) {
+ if (c.tv_usec != 0) {
+ c.tv_sec = -c.tv_sec - 1;
+ c.tv_usec = MICROSECONDS - c.tv_usec;
+ } else {
+ c.tv_sec = -c.tv_sec;
+ }
+ }
+
+ return c;
+}
+
+/*
+ * compare previously-normalised a and b
+ * return 1 / 0 / -1 if a < / == / > b
+ */
+static inline int
+cmp_tval(
+ struct timeval a,
+ struct timeval b
+ )
+{
+ int r;
+
+ r = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
+ if (0 == r)
+ r = (a.tv_usec > b.tv_usec) -
+ (a.tv_usec < b.tv_usec);
+
+ return r;
+}
+
+/*
+ * compare possibly-denormal a and b
+ * return 1 / 0 / -1 if a < / == / > b
+ */
+static inline int
+cmp_tval_denorm(
+ struct timeval a,
+ struct timeval b
+ )
+{
+ return cmp_tval(normalize_tval(a), normalize_tval(b));
+}
+
+/*
+ * test previously-normalised a
+ * return 1 / 0 / -1 if a < / == / > 0
+ */
+static inline int
+test_tval(
+ struct timeval a
+ )
+{
+ int r;
+
+ r = (a.tv_sec > 0) - (a.tv_sec < 0);
+ if (r == 0)
+ r = (a.tv_usec > 0);
+
+ return r;
+}
+
+/*
+ * test possibly-denormal a
+ * return 1 / 0 / -1 if a < / == / > 0
+ */
+static inline int
+test_tval_denorm(
+ struct timeval a
+ )
+{
+ return test_tval(normalize_tval(a));
+}
+
+/* return LIB buffer ptr to string rep */
+static inline const char *
+tvaltoa(
+ struct timeval x
+ )
+{
+ return format_time_fraction(x.tv_sec, x.tv_usec, 6);
+}
+
+/* convert from timeval duration to l_fp duration */
+static inline l_fp
+tval_intv_to_lfp(
+ struct timeval x
+ )
+{
+ struct timeval v;
+ l_fp y;
+
+ v = normalize_tval(x);
+ TVUTOTSF(v.tv_usec, y.l_uf);
+ y.l_i = (int32)v.tv_sec;
+
+ return y;
+}
+
+/* x must be UN*X epoch, output *y will be in NTP epoch */
+static inline l_fp
+tval_stamp_to_lfp(
+ struct timeval x
+ )
+{
+ l_fp y;
+
+ y = tval_intv_to_lfp(x);
+ y.l_ui += JAN_1970;
+
+ return y;
+}
+
+/* convert to l_fp type, relative signed/unsigned and absolute */
+static inline struct timeval
+lfp_intv_to_tval(
+ l_fp x
+ )
+{
+ struct timeval out;
+ l_fp absx;
+ int neg;
+
+ neg = L_ISNEG(&x);
+ absx = x;
+ if (neg) {
+ L_NEG(&absx);
+ }
+ TSFTOTVU(absx.l_uf, out.tv_usec);
+ out.tv_sec = absx.l_i;
+ if (neg) {
+ out.tv_sec = -out.tv_sec;
+ out.tv_usec = -out.tv_usec;
+ out = normalize_tval(out);
+ }
+
+ return out;
+}
+
+static inline struct timeval
+lfp_uintv_to_tval(
+ l_fp x
+ )
+{
+ struct timeval out;
+
+ TSFTOTVU(x.l_uf, out.tv_usec);
+ out.tv_sec = x.l_ui;
+
+ return out;
+}
+
+/*
+ * absolute (timestamp) conversion. Input is time in NTP epoch, output
+ * is in UN*X epoch. The NTP time stamp will be expanded around the
+ * pivot time *p or the current time, if p is NULL.
+ */
+static inline struct timeval
+lfp_stamp_to_tval(
+ l_fp x,
+ const time_t * p
+ )
+{
+ struct timeval out;
+ vint64 sec;
+
+ sec = ntpcal_ntp_to_time(x.l_ui, p);
+ TSFTOTVU(x.l_uf, out.tv_usec);
+
+ /* copying a vint64 to a time_t needs some care... */
+#if SIZEOF_TIME_T <= 4
+ out.tv_sec = (time_t)sec.d_s.lo;
+#elif defined(HAVE_INT64)
+ out.tv_sec = (time_t)sec.q_s;
+#else
+ out.tv_sec = ((time_t)sec.d_s.hi << 32) | sec.d_s.lo;
+#endif
+ out = normalize_tval(out);
+
+ return out;
+}
+
+#endif /* TIMEVALOPS_H */
diff --git a/include/trimble.h b/include/trimble.h
new file mode 100644
index 0000000..aaa5baa
--- /dev/null
+++ b/include/trimble.h
@@ -0,0 +1,160 @@
+/*
+ * /src/NTP/ntp4-dev/include/trimble.h,v 4.6 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * trimble.h,v 4.6 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Aug 2 16:16:49 1998 $
+ *
+ * Copyright (c) 1998-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#ifndef TRIMBLE_H
+#define TRIMBLE_H
+
+/*
+ * Trimble packet command codes - commands being sent/received
+ * keep comments formatted as shown - they are used to generate
+ * translation tables
+ */
+#define CMD_CCLROSC 0x1D /* clear oscillator offset */
+#define CMD_CCLRRST 0x1E /* clear battery backup and RESET */
+#define CMD_CVERSION 0x1F /* return software version */
+#define CMD_CALMANAC 0x20 /* almanac */
+#define CMD_CCURTIME 0x21 /* current time */
+#define CMD_CMODESEL 0x22 /* mode select (2-d, 3-D, auto) */
+#define CMD_CINITPOS 0x23 /* initial position */
+#define CMD_CRECVPOS 0x24 /* receiver position fix mode */
+#define CMD_CRESET 0x25 /* soft reset & selftest */
+#define CMD_CRECVHEALTH 0x26 /* receiver health */
+#define CMD_CSIGNALLV 0x27 /* signal levels */
+#define CMD_CMESSAGE 0x28 /* GPS system message */
+#define CMD_CALMAHEALTH 0x29 /* almanac healt page */
+#define CMD_C2DALTITUDE 0x2A /* altitude for 2-D mode */
+#define CMD_CINITPOSLLA 0x2B /* initial position LLA */
+#define CMD_COPERPARAM 0x2C /* operating parameters */
+#define CMD_COSCOFFSET 0x2D /* oscillator offset */
+#define CMD_CSETGPSTIME 0x2E /* set GPS time */
+#define CMD_CUTCPARAM 0x2F /* UTC parameters */
+#define CMD_CACCPOSXYZ 0x31 /* accurate initial position (XYZ/ECEF) */
+#define CMD_CACCPOS 0x32 /* accurate initial position */
+#define CMD_CANALOGDIG 0x33 /* analog to digital */
+#define CMD_CSAT1SAT 0x34 /* satellite for 1-Sat mode */
+#define CMD_CIOOPTIONS 0x35 /* I/O options */
+#define CMD_CVELOCAID 0x36 /* velocity aiding of acquisition */
+#define CMD_CSTATLSTPOS 0x37 /* status and values of last pos. and vel. */
+#define CMD_CLOADSSATDT 0x38 /* load satellite system data */
+#define CMD_CSATDISABLE 0x39 /* satellite disable */
+#define CMD_CLASTRAW 0x3A /* last raw measurement */
+#define CMD_CSTATSATEPH 0x3B /* satellite ephemeris status */
+#define CMD_CSTATTRACK 0x3C /* tracking status */
+#define CMD_CCHANADGPS 0x3D /* configure channel A for differential GPS */
+#define CMD_CADDITFIX 0x3E /* additional fix data */
+#define CMD_CDGPSFIXMD 0x62 /* set/request differential GPS position fix mode */
+#define CMD_CDGPSCORR 0x65 /* differential correction status */
+#define CMD_CPOSFILT 0x71 /* position filter parameters */
+#define CMD_CHEIGHTFILT 0x73 /* height filter control */
+#define CMD_CHIGH8CNT 0x75 /* high-8 (best 4) / high-6 (overdetermined) control */
+#define CMD_CMAXDGPSCOR 0x77 /* maximum rate of DGPS corrections */
+#define CMD_CSUPER 0x8E /* super paket */
+
+#define CMD_RDATAA 0x3D /* data channel A configuration:trimble_channelA:RO */
+#define CMD_RALMANAC 0x40 /* almanac data for sat:gps_almanac:RO */
+#define CMD_RCURTIME 0x41 /* GPS time:gps_time:RO */
+#define CMD_RSPOSXYZ 0x42 /* single precision XYZ position:gps_position(XYZ):RO|DEF */
+#define CMD_RVELOXYZ 0x43 /* velocity fix (XYZ ECEF):gps_velocity(XYZ):RO|DEF */
+#define CMD_RBEST4 0x44 /* best 4 satellite selection:trimble_best4:RO|DEF */
+#define CMD_RVERSION 0x45 /* software version:trimble_version:RO|DEF */
+#define CMD_RRECVHEALTH 0x46 /* receiver health:trimble_receiver_health:RO|DEF */
+#define CMD_RSIGNALLV 0x47 /* signal levels of all satellites:trimble_signal_levels:RO */
+#define CMD_RMESSAGE 0x48 /* GPS system message:gps-message:RO|DEF */
+#define CMD_RALMAHEALTH 0x49 /* almanac health page for all satellites:gps_almanac_health:RO */
+#define CMD_RSLLAPOS 0x4A /* single LLA position:gps_position(LLA):RO|DEF */
+#define CMD_RMACHSTAT 0x4B /* machine code / status:trimble_status:RO|DEF */
+#define CMD_ROPERPARAM 0x4C /* operating parameters:trimble_opparam:RO */
+#define CMD_ROSCOFFSET 0x4D /* oscillator offset:trimble_oscoffset:RO */
+#define CMD_RSETGPSTIME 0x4E /* response to set GPS time:trimble_setgpstime:RO */
+#define CMD_RUTCPARAM 0x4F /* UTC parameters:gps_utc_correction:RO|DEF */
+#define CMD_RANALOGDIG 0x53 /* analog to digital:trimble_analogdigital:RO */
+#define CMD_RSAT1BIAS 0x54 /* one-satellite bias & bias rate:trimble_sat1bias:RO */
+#define CMD_RIOOPTIONS 0x55 /* I/O options:trimble_iooptions:RO */
+#define CMD_RVELOCFIX 0x56 /* velocity fix (ENU):trimble_velocfix */
+#define CMD_RSTATLSTFIX 0x57 /* status and values of last pos. and vel.:trimble_status_lastpos:RO */
+#define CMD_RLOADSSATDT 0x58 /* response to load satellite system data:trimble_loaddata:RO */
+#define CMD_RSATDISABLE 0x59 /* satellite disable:trimble_satdisble:RO */
+#define CMD_RLASTRAW 0x5A /* last raw measurement:trimble_lastraw:RO */
+#define CMD_RSTATSATEPH 0x5B /* satellite ephemeris status:trimble_ephstatus:RO */
+#define CMD_RSTATTRACK 0x5C /* tracking status:trimble_tracking_status:RO|DEF */
+#define CMD_RADDITFIX 0x5E /* additional fix data:trimble_addfix:RO */
+#define CMD_RALLINVIEW 0x6D /* all in view satellite selection:trimble_satview:RO|DEF */
+#define CMD_RPOSFILT 0x72 /* position filter parameters:trimble_posfilt:RO */
+#define CMD_RHEIGHTFILT 0x74 /* height filter control:trimble_heightfilt:RO */
+#define CMD_RHIGH8CNT 0x76 /* high-8 (best 4) / high-6 (overdetermined) control:trimble_high8control:RO */
+#define CMD_RMAXAGE 0x78 /* DC MaxAge:trimble_dgpsmaxage:RO */
+#define CMD_RDGPSFIX 0x82 /* differential position fix mode:trimble_dgpsfixmode:RO */
+#define CMD_RDOUBLEXYZ 0x83 /* double precision XYZ:gps_position_ext(XYZ):RO|DEF */
+#define CMD_RDOUBLELLA 0x84 /* double precision LLA:gps_position_ext(LLA):RO|DEF */
+#define CMD_RDGPSSTAT 0x85 /* differential correction status:trimble_dgpsstatus:RO */
+#define CMD_RSUPER 0x8F /* super paket::0 */
+
+typedef struct cmd_info
+{
+ unsigned char cmd; /* command code */
+ const char *cmdname; /* command name */
+ const char *cmddesc; /* command description */
+ const char *varname; /* name of variable */
+ int varmode; /* mode of variable */
+} cmd_info_t;
+
+extern cmd_info_t trimble_rcmds[];
+extern cmd_info_t trimble_scmds[];
+
+extern cmd_info_t *trimble_convert (unsigned int cmd, cmd_info_t *tbl);
+
+#endif
+/*
+ * History:
+ *
+ * trimble.h,v
+ * Revision 4.6 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.5 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.4 1999/02/28 11:41:11 kardel
+ * (CMD_RUTCPARAM): control variable name unification
+ *
+ * Revision 4.3 1998/12/20 23:45:25 kardel
+ * fix types and warnings
+ *
+ * Revision 4.2 1998/08/16 18:45:05 kardel
+ * (CMD_RSTATTRACK): renamed mode 6 variable name
+ *
+ * Revision 4.1 1998/08/09 22:24:35 kardel
+ * Trimble TSIP support
+ *
+ */
diff --git a/include/vint64ops.h b/include/vint64ops.h
new file mode 100644
index 0000000..2c3deff
--- /dev/null
+++ b/include/vint64ops.h
@@ -0,0 +1,28 @@
+/*
+ * vint64ops.h - operations on 'vint64' values
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ * ----------------------------------------------------------------------
+ * This is an attempt to get the vint64 calculations stuff centralised.
+ */
+#ifndef VINT64OPS_H
+#define VINT64OPS_H
+
+/* signed/unsigned compare. returns 1/0/-1 if lhs >/=/< rhs */
+extern int icmpv64(const vint64 * lhs, const vint64 * rhs);
+extern int ucmpv64(const vint64 * lhs, const vint64 * rhs);
+
+/* add / subtract */
+extern vint64 addv64(const vint64 *lhs, const vint64 *rhs);
+extern vint64 addv64i32(const vint64 * lhs, int32_t rhs);
+extern vint64 addv64u32(const vint64 * lhs, uint32_t rhs);
+
+extern vint64 subv64(const vint64 *lhs, const vint64 *rhs);
+extern vint64 subv64i32(const vint64 * lhs, int32_t rhs);
+extern vint64 subv64u32(const vint64 * lhs, uint32_t rhs);
+
+/* parsing. works like strtoul() or strtoull() */
+extern vint64 strtouv64(const char * begp, char ** endp, int base);
+
+#endif /*!defined(VINT64OPS_H)*/
diff --git a/includes.mf b/includes.mf
new file mode 100644
index 0000000..e868ba4
--- /dev/null
+++ b/includes.mf
@@ -0,0 +1,6 @@
+## includes.mf - automake fragment
+
+NTP_INCS = -I$(top_srcdir)/include
+NTP_INCS += -I$(top_srcdir)/lib/isc/include
+NTP_INCS += -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include
+NTP_INCS += -I$(top_srcdir)/lib/isc/unix/include
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..4d4a951
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-05-14.22
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
+
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
+done
+
+if test -z "$1"; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $cpprog "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/kernel/Makefile.am b/kernel/Makefile.am
new file mode 100644
index 0000000..081839c
--- /dev/null
+++ b/kernel/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = sys
diff --git a/kernel/Makefile.in b/kernel/Makefile.in
new file mode 100644
index 0000000..ff1a6e4
--- /dev/null
+++ b/kernel/Makefile.in
@@ -0,0 +1,731 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = kernel
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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@
+SUBDIRS = sys
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign kernel/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign kernel/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/kernel/sys/Makefile.am b/kernel/sys/Makefile.am
new file mode 100644
index 0000000..7292344
--- /dev/null
+++ b/kernel/sys/Makefile.am
@@ -0,0 +1,2 @@
+noinst_HEADERS = bsd_audioirig.h i8253.h parsestreams.h \
+ pcl720.h ppsclock.h timex.h tpro.h tt560_api.h
diff --git a/kernel/sys/Makefile.in b/kernel/sys/Makefile.in
new file mode 100644
index 0000000..57bc7fd
--- /dev/null
+++ b/kernel/sys/Makefile.in
@@ -0,0 +1,584 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = kernel/sys
+DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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@
+noinst_HEADERS = bsd_audioirig.h i8253.h parsestreams.h \
+ pcl720.h ppsclock.h timex.h tpro.h tt560_api.h
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign kernel/sys/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign kernel/sys/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool ctags distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/kernel/sys/README b/kernel/sys/README
new file mode 100644
index 0000000..b9d95d9
--- /dev/null
+++ b/kernel/sys/README
@@ -0,0 +1,11 @@
+README file for directory ./kernel/sys of the NTP Version 3 distribution
+
+This directory contains system header files used by the clock discipline
+and STREAMS modules in the .. (./kernel) directory.
+
+If the precision-time kernel (KERNEL_PLL define) is configured, the
+installation process requires the header file /usr/include/sys/timex.h
+for the particular architecture to be in place. The file timex.h included
+in this distribution is for Suns; the files for other systems can be
+found in the kernel distributions available from the manufacturer's
+representatives.
diff --git a/kernel/sys/bsd_audioirig.h b/kernel/sys/bsd_audioirig.h
new file mode 100644
index 0000000..9b7c690
--- /dev/null
+++ b/kernel/sys/bsd_audioirig.h
@@ -0,0 +1,101 @@
+/*
+ * $Header: bsd_audioirig.h,v 1.0 93/08/02 12:42:00
+ */
+
+#ifndef _BSD_AUDIOIRIG_H_
+#define _BSD_AUDIOIRIG_H_
+
+#include <sys/time.h>
+
+/********************************************************************/
+/* user interface */
+
+/*
+ * irig ioctls
+ */
+#if defined(__STDC__) || (!defined(sun) && !defined(ibm032) && !defined(__GNUC))
+#define AUDIO_IRIG_OPEN _IO('A', 50)
+#define AUDIO_IRIG_CLOSE _IO('A', 51)
+#define AUDIO_IRIG_SETFORMAT _IOWR('A', 52, int)
+#else
+#define AUDIO_IRIG_OPEN _IO(A, 50)
+#define AUDIO_IRIG_CLOSE _IO(A, 51)
+#define AUDIO_IRIG_SETFORMAT _IOWR(A, 52, int)
+#endif
+
+/*
+ * irig error codes
+ */
+#define AUDIO_IRIG_BADSIGNAL 0x01
+#define AUDIO_IRIG_BADDATA 0x02
+#define AUDIO_IRIG_BADSYNC 0x04
+#define AUDIO_IRIG_BADCLOCK 0x08
+#define AUDIO_IRIG_OLDDATA 0x10
+
+/********************************************************************/
+
+/*
+ * auib definitions
+ */
+#define AUIB_SIZE (0x0040)
+#define AUIB_INC (0x0008)
+#define AUIB_MOD(k) ((k) & 0x0038)
+#define AUIB_INIT(ib) ((ib)->ib_head = (ib)->ib_tail = (ib)->ib_lock = \
+ (ib)->phase = (ib)->shi = (ib)->slo = (ib)->high = \
+ (ib)->level0 = (ib)->level1 = \
+ (ib)->shift[0] = (ib)->shift[1] = (ib)->shift[2] = \
+ (ib)->shift[3] = (ib)->sdata[0] = (ib)->sdata[1] = \
+ (ib)->sdata[2] = (ib)->sdata[3] = (ib)->err = 0)
+#define AUIB_EMPTY(ib) ((ib)->ib_head == (ib)->ib_tail)
+#define AUIB_LEN(ib) (AUIB_MOD((ib)->ib_tail - (ib)->ib_head))
+#define AUIB_LEFT(ib) (AUIB_MOD((ib)->ib_head - (ib)->ib_tail - 1))
+#define IRIGDELAY 3
+#define IRIGLEVEL 1355
+
+#ifndef LOCORE
+/*
+ * irig_time holds IRIG data for one second
+ */
+struct irig_time {
+ struct timeval stamp; /* timestamp */
+ u_char bits[13]; /* 100 irig data bits */
+ u_char status; /* status byte */
+ char time[14]; /* time string */
+};
+
+/*
+ * auib's are used for IRIG data communication between the trap
+ * handler and the software interrupt.
+ */
+struct auib {
+ /* driver variables */
+ u_short active; /* 0=inactive, else=active */
+ u_short format; /* time output format */
+ struct irig_time timestr; /* time structure */
+ char buffer[14]; /* output formation buffer */
+
+ /* hardware interrupt variables */
+ struct timeval tv1,tv2,tv3; /* time stamps (median filter) */
+ int level0,level1; /* lo/hi input levels */
+ int level; /* decision level */
+ int high; /* recent largest sample */
+ int sl0,sl1; /* recent sample levels */
+ int lasts; /* last sample value */
+ u_short scount; /* sample count */
+ u_long eacc; /* 10-bit element accumulator */
+ u_long ebit; /* current bit in element */
+ u_char r_level,mmr1; /* recording level 0-255 */
+ int shi,slo,phase; /* AGC variables */
+ u_long err; /* error status bits */
+ int ecount; /* count of elements this second */
+ long shift[4]; /* shift register of pos ident */
+ long sdata[4]; /* shift register of symbols */
+
+ int ib_head; /* queue head */
+ int ib_tail; /* queue tail */
+ u_short ib_lock; /* queue head lock */
+ u_long ib_data[AUIB_SIZE]; /* data buffer */
+};
+#endif
+
+#endif /* _BSD_AUDIOIRIG_H_ */
diff --git a/kernel/sys/i8253.h b/kernel/sys/i8253.h
new file mode 100644
index 0000000..7096593
--- /dev/null
+++ b/kernel/sys/i8253.h
@@ -0,0 +1,48 @@
+/* Copyright (c) 1995 Vixie Enterprises
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Vixie Enterprises not be used in advertising or publicity
+ * pertaining to distribution of the document or software without specific,
+ * written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND VIXIE ENTERPRISES DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VIXIE ENTERPRISES
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#ifndef _I8253_DEFINED
+#define _I8253_DEFINED
+
+typedef union {
+ unsigned char i;
+ struct {
+ unsigned int bcd : 1;
+#define i8253_binary 0
+#define i8253_bcd 1
+ unsigned int mode : 3;
+#define i8253_termcnt 0
+#define i8253_oneshot 1
+#define i8253_rategen 2
+#define i8253_sqrwave 3
+#define i8253_softstb 4
+#define i8253_hardstb 5
+ unsigned int rl : 2;
+#define i8253_latch 0
+#define i8253_lsb 1
+#define i8253_msb 2
+#define i8253_lmb 3
+ unsigned int cntr : 2;
+#define i8253_cntr_0 0
+#define i8253_cntr_1 1
+#define i8253_cntr_2 2
+ } s;
+} i8253_ctrl;
+
+#endif /*_I8253_DEFINED*/
diff --git a/kernel/sys/parsestreams.h b/kernel/sys/parsestreams.h
new file mode 100644
index 0000000..e784f9e
--- /dev/null
+++ b/kernel/sys/parsestreams.h
@@ -0,0 +1,133 @@
+/*
+ * /src/NTP/ntp4-dev/kernel/sys/parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
+ *
+ * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if !(defined(lint) || defined(__GNUC__))
+ static char sysparsehrcsid[] = "parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A";
+#endif
+
+#undef PARSEKERNEL
+#if defined(KERNEL) || defined(_KERNEL)
+#ifndef PARSESTREAM
+#define PARSESTREAM
+#endif
+#endif
+#if defined(PARSESTREAM) && defined(HAVE_SYS_STREAM_H)
+#define PARSEKERNEL
+
+#ifdef HAVE_SYS_TERMIOS_H
+#include <sys/termios.h>
+#endif
+
+#include <sys/ppsclock.h>
+
+#ifndef NTP_NEED_BOPS
+#define NTP_NEED_BOPS
+#endif
+
+#if defined(PARSESTREAM) && (defined(_sun) || defined(__sun)) && defined(HAVE_SYS_STREAM_H)
+/*
+ * Sorry, but in SunOS 4.x AND Solaris 2.x kernels there are no
+ * mem* operations. I don't want them - bcopy, bzero
+ * are fine in the kernel
+ */
+#undef HAVE_STRING_H /* don't include that at kernel level - prototype mismatch in Solaris 2.6 */
+#include "ntp_string.h"
+#else
+#include <stdio.h>
+#endif
+
+struct parsestream /* parse module local data */
+{
+ queue_t *parse_queue; /* read stream for this channel */
+ queue_t *parse_dqueue; /* driver queue entry (PPS support) */
+ unsigned long parse_status; /* operation flags */
+ void *parse_data; /* local data space (PPS support) */
+ parse_t parse_io; /* io structure */
+ struct ppsclockev parse_ppsclockev; /* copy of last pps event */
+};
+
+typedef struct parsestream parsestream_t;
+
+#define PARSE_ENABLE 0x0001
+
+/*--------------- debugging support ---------------------------------*/
+
+#define DD_OPEN 0x00000001
+#define DD_CLOSE 0x00000002
+#define DD_RPUT 0x00000004
+#define DD_WPUT 0x00000008
+#define DD_RSVC 0x00000010
+#define DD_PARSE 0x00000020
+#define DD_INSTALL 0x00000040
+#define DD_ISR 0x00000080
+#define DD_RAWDCF 0x00000100
+
+extern int parsedebug;
+
+#ifdef DEBUG_PARSE
+
+#define parseprintf(X, Y) if ((X) & parsedebug) printf Y
+
+#else
+
+#define parseprintf(X, Y)
+
+#endif
+#endif
+
+/*
+ * History:
+ *
+ * parsestreams.h,v
+ * Revision 4.5 2005/06/25 10:52:47 kardel
+ * fix version id / add version log
+ *
+ * Revision 4.4 1998/06/14 21:09:32 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.3 1998/06/13 18:14:32 kardel
+ * make mem*() to b*() mapping magic work on Solaris too
+ *
+ * Revision 4.2 1998/06/13 15:16:22 kardel
+ * fix mem*() to b*() function macro emulation
+ *
+ * Revision 4.1 1998/06/13 11:50:37 kardel
+ * STREAM macro gone in favor of HAVE_SYS_STREAM_H
+ *
+ * Revision 4.0 1998/04/10 19:51:30 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.2 1998/04/10 19:27:42 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ *
+ */
diff --git a/kernel/sys/pcl720.h b/kernel/sys/pcl720.h
new file mode 100644
index 0000000..cf4eccd
--- /dev/null
+++ b/kernel/sys/pcl720.h
@@ -0,0 +1,95 @@
+/* Copyright (c) 1995 Vixie Enterprises
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Vixie Enterprises not be used in advertising or publicity
+ * pertaining to distribution of the document or software without specific,
+ * written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND VIXIE ENTERPRISES DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VIXIE ENTERPRISES
+ * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#ifndef _PCL720_DEFINED
+#define _PCL720_DEFINED
+
+#define pcl720_data(base,bit) (base+(bit>>3))
+#define pcl720_data_0_7(base) (base+0)
+#define pcl720_data_8_15(base) (base+1)
+#define pcl720_data_16_23(base) (base+2)
+#define pcl720_data_24_31(base) (base+3)
+#define pcl720_cntr(base,cntr) (base+4+cntr) /* cntr: 0..2 */
+#define pcl720_cntr_0(base) (base+4)
+#define pcl720_cntr_1(base) (base+5)
+#define pcl720_cntr_2(base) (base+6)
+#define pcl720_ctrl(base) (base+7)
+
+#ifndef DEBUG_PCL720
+#define pcl720_inb(x) inb(x)
+#define pcl720_outb(x,y) outb(x,y)
+#else
+static unsigned char pcl720_inb(int addr) {
+ unsigned char x = inb(addr);
+ fprintf(DEBUG_PCL720, "inb(0x%x) -> 0x%x\n", addr, x);
+ return (x);
+}
+static void pcl720_outb(int addr, unsigned char x) {
+ outb(addr, x);
+ fprintf(DEBUG_PCL720, "outb(0x%x, 0x%x)\n", addr, x);
+}
+#endif
+
+#define pcl720_load(Base,Cntr,Mode,Val) \
+ ({ register unsigned int b = Base, c = Cntr, v = Val; \
+ i8253_ctrl ctrl; \
+ \
+ ctrl.s.bcd = i8253_binary; \
+ ctrl.s.mode = Mode; \
+ ctrl.s.rl = i8253_lmb; \
+ ctrl.s.cntr = c; \
+ pcl720_outb(pcl720_ctrl(b), ctrl.i); \
+ pcl720_outb(pcl720_cntr(b,c), v); \
+ pcl720_outb(pcl720_cntr(b,c), v >> 8); \
+ v; \
+ })
+
+#define pcl720_read(Base,Cntr) \
+ ({ register unsigned int b = Base, v; \
+ i8253_ctrl ctrl; \
+ \
+ ctrl.s.rl = i8253_latch; \
+ ctrl.s.cntr = i8253_cntr_0; \
+ pcl720_outb(pcl720_ctrl(b), ctrl.i); \
+ v = pcl720_inb(pcl720_cntr_0(b)); \
+ v |= (pcl720_inb(pcl720_cntr_0(b)) << 8); \
+ v; \
+ })
+
+#define pcl720_input(Base) \
+ ({ register unsigned int b = Base, v; \
+ \
+ v = pcl720_inb(pcl720_data_0_7(b)); \
+ v |= (pcl720_inb(pcl720_data_8_15(b)) << 8); \
+ v |= (pcl720_inb(pcl720_data_16_23(b)) << 16); \
+ v |= (pcl720_inb(pcl720_data_24_31(b)) << 24); \
+ v; \
+ })
+
+#define pcl720_output(Base,Value) \
+ ({ register unsigned int b = Base, v = Value; \
+ \
+ pcl720_outb(pcl720_data_0_7(b), v); \
+ pcl720_outb(pcl720_data_8_15(b), v << 8); \
+ pcl720_outb(pcl720_data_16_23(b), v << 16); \
+ pcl720_outb(pcl720_data_24_31(b), v << 24); \
+ v; \
+ })
+
+#endif /*_PCL720_DEFINED*/
diff --git a/kernel/sys/ppsclock.h b/kernel/sys/ppsclock.h
new file mode 100644
index 0000000..b0fe407
--- /dev/null
+++ b/kernel/sys/ppsclock.h
@@ -0,0 +1,64 @@
+/*
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66.
+ *
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Lawrence Berkeley Laboratory.
+ * 4. The name of the University may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef TIOCGPPSEV
+#define PPSCLOCKSTR "ppsclock"
+
+#ifndef HAVE_STRUCT_PPSCLOCKEV
+struct ppsclockev {
+ struct timeval tv;
+ u_int serial;
+};
+#endif
+
+#if defined(__STDC__) || defined(SYS_HPUX)
+#ifdef _IOR
+#define CIOGETEV _IOR('C', 0, struct ppsclockev) /* get last pps event */
+#else /* XXX SOLARIS is different */
+#define CIO ('C'<<8)
+#define CIOGETEV (CIO|0) /* get last pps event */
+#endif /* _IOR */
+#else /* __STDC__ */
+#ifdef _IOR
+#define CIOGETEV _IOR(C, 0, struct ppsclockev) /* get last pps event */
+#else /* XXX SOLARIS is different */
+#define CIO ('C'<<8)
+#define CIOGETEV (CIO|0) /* get last pps event */
+#endif /* _IOR */
+#endif /* __STDC__ */
+#else
+#define CIOGETEV TIOCGPPSEV
+#endif
diff --git a/kernel/sys/timex.h b/kernel/sys/timex.h
new file mode 100644
index 0000000..d42ec08
--- /dev/null
+++ b/kernel/sys/timex.h
@@ -0,0 +1,309 @@
+/******************************************************************************
+ * *
+ * Copyright (c) David L. Mills 1993, 1994 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and its *
+ * documentation for any purpose and without fee is hereby granted, provided *
+ * that the above copyright notice appears in all copies and that both the *
+ * copyright notice and this permission notice appear in supporting *
+ * documentation, and that the name University of Delaware not be used in *
+ * advertising or publicity pertaining to distribution of the software *
+ * without specific, written prior permission. The University of Delaware *
+ * makes no representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied warranty. *
+ * *
+ ******************************************************************************/
+
+/*
+ * Modification history timex.h
+ *
+ * 26 Sep 94 David L. Mills
+ * Added defines for hybrid phase/frequency-lock loop.
+ *
+ * 19 Mar 94 David L. Mills
+ * Moved defines from kernel routines to header file and added new
+ * defines for PPS phase-lock loop.
+ *
+ * 20 Feb 94 David L. Mills
+ * Revised status codes and structures for external clock and PPS
+ * signal discipline.
+ *
+ * 28 Nov 93 David L. Mills
+ * Adjusted parameters to improve stability and increase poll
+ * interval.
+ *
+ * 17 Sep 93 David L. Mills
+ * Created file
+ */
+/*
+ * This header file defines the Network Time Protocol (NTP) interfaces
+ * for user and daemon application programs. These are implemented using
+ * private syscalls and data structures and require specific kernel
+ * support.
+ *
+ * NAME
+ * ntp_gettime - NTP user application interface
+ *
+ * SYNOPSIS
+ * #include <sys/timex.h>
+ *
+ * int syscall(SYS_ntp_gettime, tptr)
+ *
+ * int SYS_ntp_gettime defined in syscall.h header file
+ * struct ntptimeval *tptr pointer to ntptimeval structure
+ *
+ * NAME
+ * ntp_adjtime - NTP daemon application interface
+ *
+ * SYNOPSIS
+ * #include <sys/timex.h>
+ *
+ * int syscall(SYS_ntp_adjtime, mode, tptr)
+ *
+ * int SYS_ntp_adjtime defined in syscall.h header file
+ * struct timex *tptr pointer to timex structure
+ *
+ */
+#ifndef _SYS_TIMEX_H_
+#define _SYS_TIMEX_H_ 1
+
+#ifndef MSDOS /* Microsoft specific */
+#include <sys/syscall.h>
+#endif /* MSDOS */
+
+/*
+ * The following defines establish the engineering parameters of the
+ * phase-lock loop (PLL) model used in the kernel implementation. These
+ * parameters have been carefully chosen by analysis for good stability
+ * and wide dynamic range.
+ *
+ * The hz variable is defined in the kernel build environment. It
+ * establishes the timer interrupt frequency, 100 Hz for the SunOS
+ * kernel, 256 Hz for the Ultrix kernel and 1024 Hz for the OSF/1
+ * kernel. SHIFT_HZ expresses the same value as the nearest power of two
+ * in order to avoid hardware multiply operations.
+ *
+ * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
+ * for a slightly underdamped convergence characteristic. SHIFT_KH
+ * establishes the damping of the FLL and is chosen by wisdom and black
+ * art.
+ *
+ * MAXTC establishes the maximum time constant of the PLL. With the
+ * SHIFT_KG and SHIFT_KF values given and a time constant range from
+ * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
+ * respectively.
+ */
+#define SHIFT_HZ 7 /* log2(hz) */
+#define SHIFT_KG 6 /* phase factor (shift) */
+#define SHIFT_KF 16 /* PLL frequency factor (shift) */
+#define SHIFT_KH 2 /* FLL frequency factor (shift) */
+#define MAXTC 6 /* maximum time constant (shift) */
+
+/*
+ * The following defines establish the scaling of the various variables
+ * used by the PLL. They are chosen to allow the greatest precision
+ * possible without overflow of a 32-bit word.
+ *
+ * SHIFT_SCALE defines the scaling (shift) of the time_phase variable,
+ * which serves as a an extension to the low-order bits of the system
+ * clock variable time.tv_usec.
+ *
+ * SHIFT_UPDATE defines the scaling (shift) of the time_offset variable,
+ * which represents the current time offset with respect to standard
+ * time.
+ *
+ * SHIFT_USEC defines the scaling (shift) of the time_freq and
+ * time_tolerance variables, which represent the current frequency
+ * offset and maximum frequency tolerance.
+ *
+ * FINEUSEC is 1 us in SHIFT_UPDATE units of the time_phase variable.
+ */
+#define SHIFT_SCALE 22 /* phase scale (shift) */
+#define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */
+#define SHIFT_USEC 16 /* frequency offset scale (shift) */
+#define FINEUSEC (1L << SHIFT_SCALE) /* 1 us in phase units */
+
+/*
+ * The following defines establish the performance envelope of the PLL.
+ * They insure it operates within predefined limits, in order to satisfy
+ * correctness assertions. An excursion which exceeds these bounds is
+ * clamped to the bound and operation proceeds accordingly. In practice,
+ * this can occur only if something has failed or is operating out of
+ * tolerance, but otherwise the PLL continues to operate in a stable
+ * mode.
+ *
+ * MAXPHASE must be set greater than or equal to CLOCK.MAX (128 ms), as
+ * defined in the NTP specification. CLOCK.MAX establishes the maximum
+ * time offset allowed before the system time is reset, rather than
+ * incrementally adjusted. Here, the maximum offset is clamped to
+ * MAXPHASE only in order to prevent overflow errors due to defective
+ * protocol implementations.
+ *
+ * MAXFREQ is the maximum frequency tolerance of the CPU clock
+ * oscillator plus the maximum slew rate allowed by the protocol. It
+ * should be set to at least the frequency tolerance of the oscillator
+ * plus 100 ppm for vernier frequency adjustments. If the kernel
+ * PPS discipline code is configured (PPS_SYNC), the oscillator time and
+ * frequency are disciplined to an external source, presumably with
+ * negligible time and frequency error relative to UTC, and MAXFREQ can
+ * be reduced.
+ *
+ * MAXTIME is the maximum jitter tolerance of the PPS signal if the
+ * kernel PPS discipline code is configured (PPS_SYNC).
+ *
+ * MINSEC and MAXSEC define the lower and upper bounds on the interval
+ * between protocol updates.
+ */
+#define MAXPHASE 512000L /* max phase error (us) */
+#ifdef PPS_SYNC
+#define MAXFREQ (512L << SHIFT_USEC) /* max freq error (100 ppm) */
+#define MAXTIME (200L << PPS_AVG) /* max PPS error (jitter) (200 us) */
+#else
+#define MAXFREQ (512L << SHIFT_USEC) /* max freq error (200 ppm) */
+#endif /* PPS_SYNC */
+#define MINSEC 16L /* min interval between updates (s) */
+#define MAXSEC 1200L /* max interval between updates (s) */
+
+#ifdef PPS_SYNC
+/*
+ * The following defines are used only if a pulse-per-second (PPS)
+ * signal is available and connected via a modem control lead, such as
+ * produced by the optional ppsclock feature incorporated in the Sun
+ * asynch driver. They establish the design parameters of the frequency-
+ * lock loop used to discipline the CPU clock oscillator to the PPS
+ * signal.
+ *
+ * PPS_AVG is the averaging factor for the frequency loop, as well as
+ * the time and frequency dispersion.
+ *
+ * PPS_SHIFT and PPS_SHIFTMAX specify the minimum and maximum
+ * calibration intervals, respectively, in seconds as a power of two.
+ *
+ * PPS_VALID is the maximum interval before the PPS signal is considered
+ * invalid and protocol updates used directly instead.
+ *
+ * MAXGLITCH is the maximum interval before a time offset of more than
+ * MAXTIME is believed.
+ */
+#define PPS_AVG 2 /* pps averaging constant (shift) */
+#define PPS_SHIFT 2 /* min interval duration (s) (shift) */
+#define PPS_SHIFTMAX 8 /* max interval duration (s) (shift) */
+#define PPS_VALID 120 /* pps signal watchdog max (s) */
+#define MAXGLITCH 30 /* pps signal glitch max (s) */
+#endif /* PPS_SYNC */
+
+/*
+ * The following defines and structures define the user interface for
+ * the ntp_gettime() and ntp_adjtime() system calls.
+ *
+ * Control mode codes (timex.modes)
+ */
+#define MOD_OFFSET 0x0001 /* set time offset */
+#define MOD_FREQUENCY 0x0002 /* set frequency offset */
+#define MOD_MAXERROR 0x0004 /* set maximum time error */
+#define MOD_ESTERROR 0x0008 /* set estimated time error */
+#define MOD_STATUS 0x0010 /* set clock status bits */
+#define MOD_TIMECONST 0x0020 /* set pll time constant */
+#define MOD_CANSCALE 0x0040 /* kernel can scale offset field */
+#define MOD_DOSCALE 0x0080 /* userland wants to scale offset field */
+
+/*
+ * Status codes (timex.status)
+ */
+#define STA_PLL 0x0001 /* enable PLL updates (rw) */
+#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
+#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
+
+#define STA_INS 0x0010 /* insert leap (rw) */
+#define STA_DEL 0x0020 /* delete leap (rw) */
+#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
+#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
+#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+ STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
+
+/*
+ * Clock states (time_state)
+ */
+#define TIME_OK 0 /* no leap second warning */
+#define TIME_INS 1 /* insert leap second warning */
+#define TIME_DEL 2 /* delete leap second warning */
+#define TIME_OOP 3 /* leap second in progress */
+#define TIME_WAIT 4 /* leap second has occurred */
+#define TIME_ERROR 5 /* clock not synchronized */
+
+/*
+ * NTP user interface (ntp_gettime()) - used to read kernel clock values
+ *
+ * Note: maximum error = NTP synch distance = dispersion + delay / 2;
+ * estimated error = NTP dispersion.
+ */
+struct ntptimeval {
+ struct timeval time; /* current time (ro) */
+ long maxerror; /* maximum error (us) (ro) */
+ long esterror; /* estimated error (us) (ro) */
+};
+
+/*
+ * NTP daemon interface - (ntp_adjtime()) used to discipline CPU clock
+ * oscillator
+ */
+struct timex {
+ unsigned int modes; /* clock mode bits (wo) */
+ long offset; /* time offset (us) (rw) */
+ long freq; /* frequency offset (scaled ppm) (rw) */
+ long maxerror; /* maximum error (us) (rw) */
+ long esterror; /* estimated error (us) (rw) */
+ int status; /* clock status bits (rw) */
+ long constant; /* pll time constant (rw) */
+ long precision; /* clock precision (us) (ro) */
+ long tolerance; /* clock frequency tolerance (scaled
+ * ppm) (ro) */
+ /*
+ * The following read-only structure members are implemented
+ * only if the PPS signal discipline is configured in the
+ * kernel.
+ */
+ long ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ long jitter; /* pps jitter (us) (ro) */
+ int shift; /* interval duration (s) (shift) (ro) */
+ long stabil; /* pps stability (scaled ppm) (ro) */
+ long jitcnt; /* jitter limit exceeded (ro) */
+ long calcnt; /* calibration intervals (ro) */
+ long errcnt; /* calibration errors (ro) */
+ long stbcnt; /* stability limit exceeded (ro) */
+
+};
+#ifdef __FreeBSD__
+
+/*
+ * sysctl identifiers underneath kern.ntp_pll
+ */
+#define NTP_PLL_GETTIME 1 /* used by ntp_gettime() */
+#define NTP_PLL_MAXID 2 /* number of valid ids */
+
+#define NTP_PLL_NAMES { \
+ { 0, 0 }, \
+ { "gettime", CTLTYPE_STRUCT }, \
+ }
+
+#ifndef KERNEL
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+extern int ntp_gettime __P((struct ntptimeval *));
+extern int ntp_adjtime __P((struct timex *));
+__END_DECLS
+
+#endif /* not KERNEL */
+
+#endif /* __FreeBSD__ */
+#endif /* _SYS_TIMEX_H_ */
diff --git a/kernel/sys/tpro.h b/kernel/sys/tpro.h
new file mode 100644
index 0000000..f276f81
--- /dev/null
+++ b/kernel/sys/tpro.h
@@ -0,0 +1,34 @@
+/*
+ * Structure for the KSI/Odetics TPRO-S data returned in reponse to a
+ * read() call. Note that these are driver-specific and not dependent on
+ * 32/64-bit architecture.
+ */
+struct tproval {
+ u_short day100; /* days * 100 */
+ u_short day10; /* days * 10 */
+ u_short day1; /* days * 1 */
+ u_short hour10; /* hours * 10 */
+ u_short hour1; /* hours * 1 */
+ u_short min10; /* minutes * 10 */
+ u_short min1; /* minutes * 1 */
+ u_short sec10; /* seconds * 10 */
+ u_short sec1; /* seconds * 1*/
+ u_short ms100; /* milliseconds * 100 */
+ u_short ms10; /* milliseconds * 10 */
+ u_short ms1; /* milliseconds * 1 */
+ u_short usec100; /* microseconds * 100 */
+ u_short usec10; /* microseconds * 10 */
+ u_short usec1; /* microseconds * 1 */
+ long tv_sec; /* seconds */
+ long tv_usec; /* microseconds */
+ u_short status; /* status register */
+};
+
+/*
+ * Status register bits
+ */
+#define TIMEAVAIL 0x0001 /* time available */
+#define NOSIGNAL 0x0002 /* insufficient IRIG-B signal */
+#define NOSYNC 0x0004 /* local oscillator not synchronized */
+
+/* end of tpro.h */
diff --git a/kernel/sys/tt560_api.h b/kernel/sys/tt560_api.h
new file mode 100644
index 0000000..c87a7b1
--- /dev/null
+++ b/kernel/sys/tt560_api.h
@@ -0,0 +1,489 @@
+/***********************************************************************
+ *
+ * Module: ttime_api.h
+ *
+ * Author: SIS 1998
+ * LM NE&SS 2001
+ *
+ * Description
+ *
+ * This header file contains data necessary for the API to the
+ * True Time board. This contains all of the structure definitions
+ * for the individual registers.
+ *
+ ***********************************************************************/
+#ifndef TTIME_API_H
+#define TTIME_API_H
+
+#ifdef CPP
+extern "C" {
+#endif
+
+#include <time.h>
+
+typedef struct
+{
+ unsigned int micro_sec;
+ unsigned int milli_sec;
+ struct tm gps_tm;
+} gps_time_t;
+
+typedef struct
+{
+ unsigned char reserved_1;
+ unsigned unit_ms : 4;
+ unsigned filler_0 : 4;
+ unsigned hun_ms : 4;
+ unsigned tens_ms : 4;
+ unsigned tens_sec : 4;
+ unsigned unit_sec : 4;
+
+ unsigned tens_min : 4;
+ unsigned unit_min : 4;
+ unsigned tens_hour : 4;
+ unsigned unit_hour : 4;
+ unsigned tens_day : 4;
+ unsigned unit_day : 4;
+ unsigned filler_1 : 4;
+ unsigned hun_day : 4;
+
+ unsigned tens_year : 4;
+ unsigned unit_year : 4;
+ unsigned thou_year : 4;
+ unsigned hun_year : 4;
+ unsigned char reserved_2[2];
+} preset_time_reg_t;
+
+typedef struct
+{
+ unsigned n_d0 : 2;
+ unsigned antenna_short_stat : 1; /* 0 = fault */
+ unsigned antenna_open_stat : 1; /* 0 = fault */
+ unsigned n_d1 : 1;
+ unsigned rate_gen_pulse_stat : 1;
+ unsigned time_cmp_pulse_stat : 1;
+ unsigned ext_event_stat : 1;
+
+} hw_stat_reg_t;
+
+typedef struct
+{
+ unsigned tens_us : 4;
+ unsigned unit_us : 4;
+ unsigned unit_ms : 4;
+ unsigned hun_us : 4;
+ unsigned char hw_stat; /* hw_stat_reg_t hw_stat; */
+ unsigned char reserved_3;
+
+ unsigned hun_ms : 4;
+ unsigned tens_ms : 4;
+ unsigned tens_sec : 4;
+ unsigned unit_sec : 4;
+ unsigned tens_min : 4;
+ unsigned unit_min : 4;
+ unsigned tens_hour : 4;
+ unsigned unit_hour : 4;
+
+ unsigned tens_day : 4;
+ unsigned unit_day : 4;
+ unsigned status : 4;
+ unsigned hun_day : 4;
+ unsigned tens_year : 4;
+ unsigned unit_year : 4;
+ unsigned thou_year : 4;
+ unsigned hun_year : 4;
+} time_freeze_reg_t;
+
+typedef struct
+{
+ unsigned char off_low;
+ unsigned char off_high;
+ unsigned char reserved_4[2];
+} sync_gen_off_reg_t;
+
+typedef struct
+{
+ unsigned tens_min : 4;
+ unsigned unit_min : 4;
+ unsigned tens_hour : 4;
+ unsigned unit_hour : 4;
+ unsigned char sign_ascii; /* '+' or '-' */
+ unsigned char reserved_5;
+} local_off_t;
+
+/*
+ * This structure can be used for both the position freeze
+ * and position preset registers.
+ */
+typedef struct
+{
+ unsigned lat_tens_degee : 4;
+ unsigned lat_unit_degee : 4;
+ unsigned filler_0 : 4;
+ unsigned lat_hun_degree : 4;
+ unsigned lat_tens_min : 4;
+ unsigned lat_unit_min : 4;
+ unsigned char lat_north_south; /* 'N' or 'S' */
+
+ unsigned filler_1 : 4;
+ unsigned lat_tenth_sec : 4;
+ unsigned lat_tens_sec : 4;
+ unsigned lat_unit_sec : 4;
+ unsigned long_tens_degree : 4;
+ unsigned long_unit_degree : 4;
+ unsigned filler_2 : 4;
+ unsigned long_hun_degree : 4;
+
+ unsigned long_tens_min : 4;
+ unsigned long_unit_min : 4;
+ unsigned char long_east_west; /* 'E' or 'W' */
+ unsigned filler_3 : 4;
+ unsigned long_tenth_sec : 4;
+ unsigned long_tens_sec : 4;
+ unsigned long_unit_sec : 4;
+
+ unsigned elv_tens_km : 4;
+ unsigned elv_unit_km : 4;
+ unsigned char elv_sign; /* '+' or '-' */
+ unsigned elv_unit_m : 4;
+ unsigned elv_tenth_m : 4;
+ unsigned elv_hun_m : 4;
+ unsigned elv_tens_m : 4;
+} pos_reg_t;
+
+typedef struct
+{
+ unsigned char prn1_tens_units;
+ unsigned char prn1_reserved;
+ unsigned char lvl1_tenths_hundredths;
+ unsigned char lvl1_tens_units;
+
+ unsigned char prn2_tens_units;
+ unsigned char prn2_reserved;
+ unsigned char lvl2_tenths_hundredths;
+ unsigned char lvl2_tens_units;
+
+ unsigned char prn3_tens_units;
+ unsigned char prn3_reserved;
+ unsigned char lvl3_tenths_hundredths;
+ unsigned char lvl3_tens_units;
+
+ unsigned char prn4_tens_units;
+ unsigned char prn4_reserved;
+ unsigned char lvl4_tenths_hundredths;
+ unsigned char lvl4_tens_units;
+
+ unsigned char prn5_tens_units;
+ unsigned char prn5_reserved;
+ unsigned char lvl5_tenths_hundredths;
+ unsigned char lvl5_tens_units;
+
+ unsigned char prn6_tens_units;
+ unsigned char prn6_reserved;
+ unsigned char lvl6_tenths_hundredths;
+ unsigned char lvl6_tens_units;
+
+ unsigned char flag;
+ unsigned char reserved[3];
+} sig_levels_t;
+
+typedef struct
+{
+ unsigned tens_us : 4;
+ unsigned unit_us : 4;
+ unsigned unit_ms : 4;
+ unsigned hun_us : 4;
+ unsigned hun_ms : 4;
+ unsigned tens_ms : 4;
+ unsigned tens_sec : 4;
+ unsigned unit_sec : 4;
+
+ unsigned tens_min : 4;
+ unsigned unit_min : 4;
+ unsigned tens_hour : 4;
+ unsigned unit_hour : 4;
+ unsigned tens_day : 4;
+ unsigned unit_day : 4;
+ unsigned stat : 4;
+ unsigned hun_day : 4;
+
+ unsigned tens_year : 4;
+ unsigned unit_year : 4;
+ unsigned thou_year : 4;
+ unsigned hun_year : 4;
+ unsigned char reserved_5[2];
+} ext_time_event_reg_t;
+
+typedef struct
+{
+ unsigned tens_us : 4;
+ unsigned unit_us : 4;
+ unsigned unit_ms : 4;
+ unsigned hun_us : 4;
+ unsigned hun_ms : 4;
+ unsigned tens_ms : 4;
+ unsigned tens_sec : 4;
+ unsigned unit_sec : 4;
+
+ unsigned tens_min : 4;
+ unsigned unit_min : 4;
+ unsigned tens_hour : 4;
+ unsigned unit_hour : 4;
+ unsigned tens_day : 4;
+ unsigned unit_day : 4;
+ unsigned mask : 4;
+ unsigned hun_day : 4;
+} time_cmp_reg_t;
+
+typedef struct
+{
+ unsigned char err_stat;
+ unsigned char no_def;
+ unsigned char oscillator_stat[2];
+} diag_reg_t;
+
+typedef struct
+{
+ unsigned res :2;
+ unsigned rate_int_mask :1;
+ unsigned cmp_int_mask :1;
+ unsigned ext_int_mask :1;
+ unsigned rate_stat_clr :1;
+ unsigned cmp_stat_clr :1;
+ unsigned ext_stat_clr :1;
+ unsigned char reserved[3];
+} hw_ctl_reg_t;
+
+typedef struct
+{
+ unsigned preset_pos_rdy :1;
+ unsigned sel_pps_ref :1;
+ unsigned sel_gps_ref :1;
+ unsigned sel_time_code :1;
+ unsigned gen_stp_run :1;
+ unsigned preset_time_rdy :1;
+ unsigned dst :1;
+ unsigned mode_sel :1;
+
+ unsigned ctl_am_dc :1;
+ unsigned reserved :3;
+ unsigned input_code :4;
+
+ unsigned char rate_reserved;
+
+ unsigned rate_flag :4;
+ unsigned rate_reserved1 :4;
+} conf_reg_t;
+
+typedef struct
+{
+ unsigned char mem_reserved[0xf8];
+
+ hw_ctl_reg_t hw_ctl_reg;
+
+ time_freeze_reg_t time_freeze_reg;
+
+ pos_reg_t pos_freeze_reg;
+
+ conf_reg_t conf_reg;
+
+ diag_reg_t diag_reg;
+
+ local_off_t local_offset;
+
+ sync_gen_off_reg_t sync_gen_offset;
+
+ unsigned char reserved[4];
+
+ unsigned char config_reg2_ctl;
+
+ unsigned char reserved2[11];
+
+ time_cmp_reg_t time_compare_reg;
+
+ unsigned char reserved3[24];
+
+ preset_time_reg_t preset_time_reg;
+
+ pos_reg_t preset_pos_reg;
+
+ ext_time_event_reg_t extern_time_event_reg;
+
+ unsigned char reserved4[24];
+
+ sig_levels_t signal_levels_reg;
+
+ unsigned char reserved5[12];
+} tt_mem_space_t;
+
+#define TTIME_MEMORY_SIZE 0x200
+
+/*
+ * Defines for register offsets
+ */
+#define HW_CTL_REG 0x0f8
+#define TIME_FREEZE_REG 0x0fc
+#define HW_STAT_REG 0x0fe
+#define POS_FREEZE_REG 0x108
+#define CONFIG_REG_1 0x118
+#define DIAG_REG 0x11c
+#define LOCAL_OFF_REG 0x120
+#define SYNC_GEN_OFF_REG 0x124
+#define CONFIG_REG_2 0x12c
+#define TIME_CMP_REG 0x138
+#define PRESET_TIME_REG 0x158
+#define PRESET_POS_REG 0x164
+#define EXT_EVENT_REG 0x174
+#define SIG_LVL_PRN1 0x198
+#define SIG_LVL_PRN2 0x19c
+#define SIG_LVL_PRN3 0x1a0
+#define SIG_LVL_PRN4 0x1a4
+#define SIG_LVL_PRN5 0x1a8
+#define SIG_LVL_PRN6 0x1ac
+#define SIG_LVL_FLAG 0x1b0
+
+/*
+ * Defines for accessing the hardware status register.
+ */
+#define HW_STAT_ANTENNA_SHORT 0 /* access the antenna short bit */
+#define HW_STAT_ANTENNA_OPEN 1 /* access the antenna open bit */
+#define HW_STAT_RATE_GEN_PULSE_STAT 2 /* access the rate gen pulse bit */
+#define HW_STAT_TIME_CMP_PULSE_STAT 3 /* access the time cmp bit */
+#define HW_STAT_EXT_EVENT_STAT 4 /* access the external event bit */
+
+/*
+ * Defines for accessing the hardware control register
+ */
+
+#define HW_CTL_RATE_INT_MASK 0 /* access rate generator int mask */
+#define HW_CTL_CMP_INT_MASK 1 /* access compare interrupt mask */
+#define HW_CTL_EXT_INT_MASK 2 /* access external event interrupt mask */
+#define HW_CTL_RATE_GEN_INT_CLEAR 3 /* access rate gen. interrupt clear field */
+#define HW_CTL_TIME_CMP_INT_CLEAR 4 /* access time cmp interrupt clear field */
+#define HW_CTL_EXT_EVENT_INT_CLEAR 5 /* access external event int clear field */
+
+/*
+ * Defines for configuration register bit fields.
+ */
+#define PRESET_POS_RDY_BIT 0 /* access the preset pos. rdy. bit */
+#define SEL_1_PPS_REF_BIT 1 /* access the select 1 pps reference bit */
+#define SEL_GPS_REF_BIT 2 /* access the select gps reference bit */
+#define SEL_TIME_CODE_REF_BIT 3 /* access the select time code reference bit */
+#define GEN_STOP_BIT 4 /* access the generator start/stop bit */
+#define PRESET_TIME_RDY_BIT 5 /* access the preset time ready bit */
+#define DST_BIT 6 /* access the DST bit */
+#define MODE_SEL_BIT 7 /* access the mode select bit */
+#define AM_DC_BIT 8 /* access the code bits AM/DC bit */
+#define IN_CODE_SEL_BIT 9 /* access the input code select bit */
+#define FLAG_BIT 10 /* access the flag bit */
+
+/*
+ * The following defines are used to set modes in the
+ * configuration register.
+ */
+
+#define CONF_SET_AM 0 /* Set code to AM */
+#define CONF_SET_DC 1 /* Set code to DC */
+#define CONF_SET_IRIG_B 0 /* Set code IRIG B */
+#define CONF_SET_IRIG_A 1 /* Set code IRIG A */
+
+#define CONF_FLAG_DISABLE 0 /* Disable pulse */
+#define CONF_FLAG_10K_PPS 1 /* Set rate to 10k PPS */
+#define CONF_FLAG_1K_PPS 2 /* Set rate to 1k PPS */
+#define CONF_FLAG_100_PPS 3 /* Set rate to 100 PPS */
+#define CONF_FLAG_10_PPS 4 /* Set rate to 10 PPS */
+#define CONF_FLAG_1_PPS 5 /* Set rate to 1 PPS */
+
+/*
+ * Defines for read commands
+ */
+
+#define TT_RD_FREEZE_REG 0x01
+#define TT_RD_HW_CTL_REG 0x02
+#define TT_RD_CNFG_REG 0x03
+#define TT_RD_DIAG_REG 0x04
+#define TT_RD_LCL_OFFSET 0x05
+#define TT_RD_SYNC_GEN_OFF 0x06
+#define TT_RD_CNFG_REG_2 0x07
+#define TT_RD_TIME_CMP_REG 0x08
+#define TT_RD_PRESET_REG 0x09
+#define TT_RD_EXT_EVNT_REG 0x0a
+#define TT_RD_SIG_LVL_REG 0x0b
+
+/*
+ * Defines for write commands
+ */
+#define TT_WRT_FREEZE_REG 0x0c
+#define TT_WRT_HW_CTL_REG 0x0d
+#define TT_WRT_CNFG_REG 0x0e
+#define TT_WRT_DIAG_REG 0x0f
+#define TT_WRT_LCL_OFFSET 0x10
+#define TT_WRT_SYNC_GEN_OFF 0x11
+#define TT_WRT_CNFG_REG_2 0x12
+#define TT_WRT_TIME_CMP_REG 0x13
+#define TT_WRT_PRESET_REG 0x14
+#define TT_WRT_EXT_EVNT_REG 0x15
+#define TT_WRT_SIG_LVL_REG 0x16
+
+/*
+ * Define the length of the buffers to move (in 32 bit words).
+ */
+
+#define HW_CTL_REG_LEN 1
+#define CNFG_REG_1_LEN 1
+#define DIAG_REG_LEN 1
+#define LCL_OFFSET_LEN 1
+#define SYNC_GEN_OFF_LEN 1
+#define CNFG_REG_2_LEN 1
+
+#define TIME_CMP_REG_LEN 2
+#define PRESET_TIME_REG_LEN 3
+#define PRESET_POS_REG_LEN 4
+#define PRESET_REG_LEN (PRESET_TIME_REG_LEN+PRESET_POS_REG_LEN)
+#define TIME_FREEZE_REG_LEN 3
+#define POSN_FREEZE_REG_LEN 4
+#define FREEZE_REG_LEN (TIME_FREEZE_REG_LEN+POSN_FREEZE_REG_LEN)
+#define EXT_EVNT_REG_LEN 3
+#define SIG_LVL_REG_LEN 7
+#define GPS_TIME_LEN 7
+
+/*
+ * Define BCD - INT - BCD macros.
+ */
+
+#define BCDTOI(a) ( ( ( ( (a) & 0xf0 ) >> 4 ) * 10 ) + ( (a) & 0x0f ) )
+#define ITOBCD(a) ( ( ( ( (a) ) / 10) << 4 ) + ( ( (a) ) % 10) )
+#define LTOBCD(a) ( ( ( ( (uint64_t)(a) ) / 10) << 4 ) + ( ( (uint64_t)(a) ) % 10) )
+
+extern int init_560 ( );
+extern void close_560 ( );
+extern int write_hw_ctl_reg (hw_ctl_reg_t *);
+extern int write_hw_ctl_reg_bitfield (int, int );
+extern int read_conf_reg (conf_reg_t *);
+extern int read_conf_reg_bitfield (int );
+extern int write_conf_reg (conf_reg_t *);
+extern int write_conf_reg_bitfield (int, unsigned char );
+extern int read_hw_stat_reg_bitfield (int );
+extern int read_local_offset_reg (local_off_t *);
+extern int write_local_offset_reg (local_off_t *);
+extern int read_sync_offset_reg (sync_gen_off_reg_t *);
+extern int write_sync_offset_reg (sync_gen_off_reg_t *);
+extern int read_time_cmp_reg (time_cmp_reg_t *);
+extern int write_time_cmp_reg (time_cmp_reg_t *);
+extern int read_preset_time_reg (preset_time_reg_t *);
+extern int write_preset_time_reg (preset_time_reg_t *);
+extern int reset_time ( );
+extern int set_new_time (preset_time_reg_t *);
+extern int read_preset_position_reg (pos_reg_t *);
+extern int write_preset_position_reg (pos_reg_t *);
+extern int read_external_event_reg (ext_time_event_reg_t *);
+extern int read_signal_level_reg (sig_levels_t *);
+extern int freeze_time ( );
+extern int snapshot_time (time_freeze_reg_t *);
+extern int read_position_freeze_reg (pos_reg_t *);
+extern int read_diag_reg (diag_reg_t *);
+
+#ifdef CPP
+}
+#endif
+#endif
diff --git a/lib/isc/Atffile b/lib/isc/Atffile
new file mode 100644
index 0000000..1edb838
--- /dev/null
+++ b/lib/isc/Atffile
@@ -0,0 +1,5 @@
+Content-Type: application/X-atf-atffile; version="1"
+
+prop: test-suite = bind9
+
+tp: tests
diff --git a/lib/isc/alpha/include/isc/atomic.h b/lib/isc/alpha/include/isc/atomic.h
new file mode 100644
index 0000000..a6232ad
--- /dev/null
+++ b/lib/isc/alpha/include/isc/atomic.h
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: atomic.h,v 1.7 2009/04/08 06:48:23 tbox Exp $ */
+
+/*
+ * This code was written based on FreeBSD's kernel source whose copyright
+ * follows:
+ */
+
+/*-
+ * Copyright (c) 1998 Doug Rabson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/sys/alpha/include/atomic.h,v 1.18.6.1 2004/09/13 21:52:04 wilko Exp $
+ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#ifdef ISC_PLATFORM_USEOSFASM
+#include <c_asm.h>
+
+#pragma intrinsic(asm)
+
+/*
+ * This routine atomically increments the value stored in 'p' by 'val', and
+ * returns the previous value. Memory access ordering around this function
+ * can be critical, so we add explicit memory block instructions at the
+ * beginning and the end of it (same for other functions).
+ */
+static inline isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ return (asm("mb;"
+ "1:"
+ "ldl_l %t0, 0(%a0);" /* load old value */
+ "mov %t0, %v0;" /* copy the old value */
+ "addl %t0, %a1, %t0;" /* calculate new value */
+ "stl_c %t0, 0(%a0);" /* attempt to store */
+ "beq %t0, 1b;" /* spin if failed */
+ "mb;",
+ p, val));
+}
+
+/*
+ * This routine atomically stores the value 'val' in 'p'.
+ */
+static inline void
+isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+ (void)asm("mb;"
+ "1:"
+ "ldl_l %t0, 0(%a0);" /* load old value */
+ "mov %a1, %t0;" /* value to store */
+ "stl_c %t0, 0(%a0);" /* attempt to store */
+ "beq %t0, 1b;" /* spin if failed */
+ "mb;",
+ p, val);
+}
+
+/*
+ * This routine atomically replaces the value in 'p' with 'val', if the
+ * original value is equal to 'cmpval'. The original value is returned in any
+ * case.
+ */
+static inline isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+
+ return(asm("mb;"
+ "1:"
+ "ldl_l %t0, 0(%a0);" /* load old value */
+ "mov %t0, %v0;" /* copy the old value */
+ "cmpeq %t0, %a1, %t0;" /* compare */
+ "beq %t0, 2f;" /* exit if not equal */
+ "mov %a2, %t0;" /* value to store */
+ "stl_c %t0, 0(%a0);" /* attempt to store */
+ "beq %t0, 1b;" /* if it failed, spin */
+ "2:"
+ "mb;",
+ p, cmpval, val));
+}
+#elif defined (ISC_PLATFORM_USEGCCASM)
+static inline isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ isc_int32_t temp, prev;
+
+ __asm__ volatile(
+ "mb;"
+ "1:"
+ "ldl_l %0, %1;" /* load old value */
+ "mov %0, %2;" /* copy the old value */
+ "addl %0, %3, %0;" /* calculate new value */
+ "stl_c %0, %1;" /* attempt to store */
+ "beq %0, 1b;" /* spin if failed */
+ "mb;"
+ : "=&r"(temp), "+m"(*p), "=&r"(prev)
+ : "r"(val)
+ : "memory");
+
+ return (prev);
+}
+
+static inline void
+isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+ isc_int32_t temp;
+
+ __asm__ volatile(
+ "mb;"
+ "1:"
+ "ldl_l %0, %1;" /* load old value */
+ "mov %2, %0;" /* value to store */
+ "stl_c %0, %1;" /* attempt to store */
+ "beq %0, 1b;" /* if it failed, spin */
+ "mb;"
+ : "=&r"(temp), "+m"(*p)
+ : "r"(val)
+ : "memory");
+}
+
+static inline isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+ isc_int32_t temp, prev;
+
+ __asm__ volatile(
+ "mb;"
+ "1:"
+ "ldl_l %0, %1;" /* load old value */
+ "mov %0, %2;" /* copy the old value */
+ "cmpeq %0, %3, %0;" /* compare */
+ "beq %0, 2f;" /* exit if not equal */
+ "mov %4, %0;" /* value to store */
+ "stl_c %0, %1;" /* attempt to store */
+ "beq %0, 1b;" /* if it failed, spin */
+ "2:"
+ "mb;"
+ : "=&r"(temp), "+m"(*p), "=&r"(prev)
+ : "r"(cmpval), "r"(val)
+ : "memory");
+
+ return (prev);
+}
+#else
+
+#error "unsupported compiler. disable atomic ops by --disable-atomic"
+
+#endif
+
+#endif /* ISC_ATOMIC_H */
diff --git a/lib/isc/api b/lib/isc/api
new file mode 100644
index 0000000..ed4b69f
--- /dev/null
+++ b/lib/isc/api
@@ -0,0 +1,8 @@
+# LIBINTERFACE ranges
+# 9.6: 50-59, 110-119
+# 9.7: 60-79
+# 9.8: 80-89
+# 9.9: 90-109
+LIBINTERFACE = 91
+LIBREVISION = 1
+LIBAGE = 1
diff --git a/lib/isc/app_api.c b/lib/isc/app_api.c
new file mode 100644
index 0000000..ce767d1
--- /dev/null
+++ b/lib/isc/app_api.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: app_api.c,v 1.5 2009/09/02 23:48:02 tbox Exp $ */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <isc/app.h>
+#include <isc/magic.h>
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/util.h>
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_appctxcreatefunc_t appctx_createfunc = NULL;
+
+#define ISCAPI_APPMETHODS_VALID(m) ISC_MAGIC_VALID(m, ISCAPI_APPMETHODS_MAGIC)
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_app_register(isc_appctxcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (appctx_createfunc == NULL)
+ appctx_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp) {
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(appctx_createfunc != NULL);
+ result = (*appctx_createfunc)(mctx, ctxp);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_appctx_destroy(isc_appctx_t **ctxp) {
+ REQUIRE(ctxp != NULL && ISCAPI_APPCTX_VALID(*ctxp));
+
+ (*ctxp)->methods->ctxdestroy(ctxp);
+
+ ENSURE(*ctxp == NULL);
+}
+
+isc_result_t
+isc_app_ctxstart(isc_appctx_t *ctx) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+
+ return (ctx->methods->ctxstart(ctx));
+}
+
+isc_result_t
+isc_app_ctxrun(isc_appctx_t *ctx) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+
+ return (ctx->methods->ctxrun(ctx));
+}
+
+isc_result_t
+isc_app_ctxsuspend(isc_appctx_t *ctx) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+
+ return (ctx->methods->ctxsuspend(ctx));
+}
+
+isc_result_t
+isc_app_ctxshutdown(isc_appctx_t *ctx) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+
+ return (ctx->methods->ctxshutdown(ctx));
+}
+
+void
+isc_app_ctxfinish(isc_appctx_t *ctx) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+
+ ctx->methods->ctxfinish(ctx);
+}
+
+void
+isc_appctx_settaskmgr(isc_appctx_t *ctx, isc_taskmgr_t *taskmgr) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ REQUIRE(taskmgr != NULL);
+
+ ctx->methods->settaskmgr(ctx, taskmgr);
+}
+
+void
+isc_appctx_setsocketmgr(isc_appctx_t *ctx, isc_socketmgr_t *socketmgr) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ REQUIRE(socketmgr != NULL);
+
+ ctx->methods->setsocketmgr(ctx, socketmgr);
+}
+
+void
+isc_appctx_settimermgr(isc_appctx_t *ctx, isc_timermgr_t *timermgr) {
+ REQUIRE(ISCAPI_APPCTX_VALID(ctx));
+ REQUIRE(timermgr != NULL);
+
+ ctx->methods->settimermgr(ctx, timermgr);
+}
diff --git a/lib/isc/assertions.c b/lib/isc/assertions.c
new file mode 100644
index 0000000..31c4fe7
--- /dev/null
+++ b/lib/isc/assertions.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: assertions.c,v 1.26 2009/09/29 15:06:07 fdupont Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <isc/assertions.h>
+#include <isc/backtrace.h>
+#include <isc/msgs.h>
+#include <isc/result.h>
+
+/*
+ * The maximum number of stack frames to dump on assertion failure.
+ */
+#ifndef BACKTRACE_MAXFRAME
+#define BACKTRACE_MAXFRAME 128
+#endif
+
+/*%
+ * Forward.
+ */
+static void
+default_callback(const char *, int, isc_assertiontype_t, const char *);
+
+static isc_assertioncallback_t isc_assertion_failed_cb = default_callback;
+
+/*%
+ * Public.
+ */
+
+/*% assertion failed handler */
+/* coverity[+kill] */
+void
+isc_assertion_failed(const char *file, int line, isc_assertiontype_t type,
+ const char *cond)
+{
+ isc_assertion_failed_cb(file, line, type, cond);
+ abort();
+ /* NOTREACHED */
+}
+
+/*% Set callback. */
+void
+isc_assertion_setcallback(isc_assertioncallback_t cb) {
+ if (cb == NULL)
+ isc_assertion_failed_cb = default_callback;
+ else
+ isc_assertion_failed_cb = cb;
+}
+
+/*% Type to Text */
+const char *
+isc_assertion_typetotext(isc_assertiontype_t type) {
+ const char *result;
+
+ /*
+ * These strings have purposefully not been internationalized
+ * because they are considered to essentially be keywords of
+ * the ISC development environment.
+ */
+ switch (type) {
+ case isc_assertiontype_require:
+ result = "REQUIRE";
+ break;
+ case isc_assertiontype_ensure:
+ result = "ENSURE";
+ break;
+ case isc_assertiontype_insist:
+ result = "INSIST";
+ break;
+ case isc_assertiontype_invariant:
+ result = "INVARIANT";
+ break;
+ default:
+ result = NULL;
+ }
+ return (result);
+}
+
+/*
+ * Private.
+ */
+
+static void
+default_callback(const char *file, int line, isc_assertiontype_t type,
+ const char *cond)
+{
+ void *tracebuf[BACKTRACE_MAXFRAME];
+ int i, nframes;
+ const char *logsuffix = ".";
+ const char *fname;
+ isc_result_t result;
+
+ result = isc_backtrace_gettrace(tracebuf, BACKTRACE_MAXFRAME, &nframes);
+ if (result == ISC_R_SUCCESS && nframes > 0)
+ logsuffix = ", back trace";
+
+ fprintf(stderr, "%s:%d: %s(%s) %s%s\n",
+ file, line, isc_assertion_typetotext(type), cond,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"), logsuffix);
+ if (result == ISC_R_SUCCESS) {
+ for (i = 0; i < nframes; i++) {
+ unsigned long offset;
+
+ fname = NULL;
+ result = isc_backtrace_getsymbol(tracebuf[i], &fname,
+ &offset);
+ if (result == ISC_R_SUCCESS) {
+ fprintf(stderr, "#%d %p in %s()+0x%lx\n", i,
+ tracebuf[i], fname, offset);
+ } else {
+ fprintf(stderr, "#%d %p in ??\n", i,
+ tracebuf[i]);
+ }
+ }
+ }
+ fflush(stderr);
+}
diff --git a/lib/isc/backtrace-emptytbl.c b/lib/isc/backtrace-emptytbl.c
new file mode 100644
index 0000000..bd534d6
--- /dev/null
+++ b/lib/isc/backtrace-emptytbl.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: backtrace-emptytbl.c,v 1.3 2009/09/01 20:13:44 each Exp $ */
+
+/*! \file */
+
+/*
+ * This file defines an empty (default) symbol table used in backtrace.c
+ * If the application wants to have a complete symbol table, it should redefine
+ * isc__backtrace_symtable with the complete table in some way, and link the
+ * version of the library not including this definition
+ * (e.g. libisc-nosymbol.a).
+ */
+
+#include <config.h>
+
+#include <isc/backtrace.h>
+
+const int isc__backtrace_nsymbols = 0;
+const isc_backtrace_symmap_t isc__backtrace_symtable[] = { { NULL, "" } };
diff --git a/lib/isc/backtrace.c b/lib/isc/backtrace.c
new file mode 100644
index 0000000..d2f044c
--- /dev/null
+++ b/lib/isc/backtrace.c
@@ -0,0 +1,285 @@
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: backtrace.c,v 1.3 2009/09/02 23:48:02 tbox Exp $ */
+
+/*! \file */
+
+#include "config.h"
+
+#include <string.h>
+#include <stdlib.h>
+#ifdef HAVE_LIBCTRACE
+#include <execinfo.h>
+#endif
+
+#include <isc/backtrace.h>
+#include <isc/result.h>
+#include <isc/util.h>
+
+#ifdef ISC_PLATFORM_USEBACKTRACE
+/*
+ * Getting a back trace of a running process is tricky and highly platform
+ * dependent. Our current approach is as follows:
+ * 1. If the system library supports the "backtrace()" function, use it.
+ * 2. Otherwise, if the compiler is gcc and the architecture is x86_64 or IA64,
+ * then use gcc's (hidden) Unwind_Backtrace() function. Note that this
+ * function doesn't work for C programs on many other architectures.
+ * 3. Otherwise, if the architecture x86 or x86_64, try to unwind the stack
+ * frame following frame pointers. This assumes the executable binary
+ * compiled with frame pointers; this is not always true for x86_64 (rather,
+ * compiler optimizations often disable frame pointers). The validation
+ * checks in getnextframeptr() hopefully rejects bogus values stored in
+ * the RBP register in such a case. If the backtrace function itself crashes
+ * due to this problem, the whole package should be rebuilt with
+ * --disable-backtrace.
+ */
+#ifdef HAVE_LIBCTRACE
+#define BACKTRACE_LIBC
+#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__ia64__))
+#define BACKTRACE_GCC
+#elif defined(__x86_64__) || defined(__i386__)
+#define BACKTRACE_X86STACK
+#else
+#define BACKTRACE_DISABLED
+#endif /* HAVE_LIBCTRACE */
+#else /* !ISC_PLATFORM_USEBACKTRACE */
+#define BACKTRACE_DISABLED
+#endif /* ISC_PLATFORM_USEBACKTRACE */
+
+#ifdef BACKTRACE_LIBC
+isc_result_t
+isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
+ int n;
+
+ /*
+ * Validate the arguments: intentionally avoid using REQUIRE().
+ * See notes in backtrace.h.
+ */
+ if (addrs == NULL || nframes == NULL)
+ return (ISC_R_FAILURE);
+
+ /*
+ * backtrace(3) includes this function itself in the address array,
+ * which should be eliminated from the returned sequence.
+ */
+ n = backtrace(addrs, maxaddrs);
+ if (n < 2)
+ return (ISC_R_NOTFOUND);
+ n--;
+ memmove(addrs, &addrs[1], sizeof(void *) * n);
+ *nframes = n;
+ return (ISC_R_SUCCESS);
+}
+#elif defined(BACKTRACE_GCC)
+extern int _Unwind_Backtrace(void* fn, void* a);
+extern void* _Unwind_GetIP(void* ctx);
+
+typedef struct {
+ void **result;
+ int max_depth;
+ int skip_count;
+ int count;
+} trace_arg_t;
+
+static int
+btcallback(void *uc, void *opq) {
+ trace_arg_t *arg = (trace_arg_t *)opq;
+
+ if (arg->skip_count > 0)
+ arg->skip_count--;
+ else
+ arg->result[arg->count++] = (void *)_Unwind_GetIP(uc);
+ if (arg->count == arg->max_depth)
+ return (5); /* _URC_END_OF_STACK */
+
+ return (0); /* _URC_NO_REASON */
+}
+
+isc_result_t
+isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
+ trace_arg_t arg;
+
+ /* Argument validation: see above. */
+ if (addrs == NULL || nframes == NULL)
+ return (ISC_R_FAILURE);
+
+ arg.skip_count = 1;
+ arg.result = addrs;
+ arg.max_depth = maxaddrs;
+ arg.count = 0;
+ _Unwind_Backtrace(btcallback, &arg);
+
+ *nframes = arg.count;
+
+ return (ISC_R_SUCCESS);
+}
+#elif defined(BACKTRACE_X86STACK)
+#ifdef __x86_64__
+static unsigned long
+getrbp() {
+ __asm("movq %rbp, %rax\n");
+}
+#endif
+
+static void **
+getnextframeptr(void **sp) {
+ void **newsp = (void **)*sp;
+
+ /*
+ * Perform sanity check for the new frame pointer, derived from
+ * google glog. This can actually be bogus depending on compiler.
+ */
+
+ /* prohibit the stack frames from growing downwards */
+ if (newsp <= sp)
+ return (NULL);
+
+ /* A heuristics to reject "too large" frame: this actually happened. */
+ if ((char *)newsp - (char *)sp > 100000)
+ return (NULL);
+
+ /*
+ * Not sure if other checks used in glog are needed at this moment.
+ * For our purposes we don't have to consider non-contiguous frames,
+ * for example.
+ */
+
+ return (newsp);
+}
+
+isc_result_t
+isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
+ int i = 0;
+ void **sp;
+
+ /* Argument validation: see above. */
+ if (addrs == NULL || nframes == NULL)
+ return (ISC_R_FAILURE);
+
+#ifdef __x86_64__
+ sp = (void **)getrbp();
+ if (sp == NULL)
+ return (ISC_R_NOTFOUND);
+ /*
+ * sp is the frame ptr of this function itself due to the call to
+ * getrbp(), so need to unwind one frame for consistency.
+ */
+ sp = getnextframeptr(sp);
+#else
+ /*
+ * i386: the frame pointer is stored 2 words below the address for the
+ * first argument. Note that the body of this function cannot be
+ * inlined since it depends on the address of the function argument.
+ */
+ sp = (void **)&addrs - 2;
+#endif
+
+ while (sp != NULL && i < maxaddrs) {
+ addrs[i++] = *(sp + 1);
+ sp = getnextframeptr(sp);
+ }
+
+ *nframes = i;
+
+ return (ISC_R_SUCCESS);
+}
+#elif defined(BACKTRACE_DISABLED)
+isc_result_t
+isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
+ /* Argument validation: see above. */
+ if (addrs == NULL || nframes == NULL)
+ return (ISC_R_FAILURE);
+
+ UNUSED(maxaddrs);
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+#endif
+
+isc_result_t
+isc_backtrace_getsymbolfromindex(int index, const void **addrp,
+ const char **symbolp)
+{
+ REQUIRE(addrp != NULL && *addrp == NULL);
+ REQUIRE(symbolp != NULL && *symbolp == NULL);
+
+ if (index < 0 || index >= isc__backtrace_nsymbols)
+ return (ISC_R_RANGE);
+
+ *addrp = isc__backtrace_symtable[index].addr;
+ *symbolp = isc__backtrace_symtable[index].symbol;
+ return (ISC_R_SUCCESS);
+}
+
+static int
+symtbl_compare(const void *addr, const void *entryarg) {
+ const isc_backtrace_symmap_t *entry = entryarg;
+ const isc_backtrace_symmap_t *end =
+ &isc__backtrace_symtable[isc__backtrace_nsymbols - 1];
+
+ if (isc__backtrace_nsymbols == 1 || entry == end) {
+ if (addr >= entry->addr) {
+ /*
+ * If addr is equal to or larger than that of the last
+ * entry of the table, we cannot be sure if this is
+ * within a valid range so we consider it valid.
+ */
+ return (0);
+ }
+ return (-1);
+ }
+
+ /* entry + 1 is a valid entry from now on. */
+ if (addr < entry->addr)
+ return (-1);
+ else if (addr >= (entry + 1)->addr)
+ return (1);
+ return (0);
+}
+
+isc_result_t
+isc_backtrace_getsymbol(const void *addr, const char **symbolp,
+ unsigned long *offsetp)
+{
+ isc_result_t result = ISC_R_SUCCESS;
+ isc_backtrace_symmap_t *found;
+
+ /*
+ * Validate the arguments: intentionally avoid using REQUIRE().
+ * See notes in backtrace.h.
+ */
+ if (symbolp == NULL || *symbolp != NULL || offsetp == NULL)
+ return (ISC_R_FAILURE);
+
+ if (isc__backtrace_nsymbols < 1)
+ return (ISC_R_NOTFOUND);
+
+ /*
+ * Search the table for the entry that meets:
+ * entry.addr <= addr < next_entry.addr.
+ */
+ found = bsearch(addr, isc__backtrace_symtable, isc__backtrace_nsymbols,
+ sizeof(isc__backtrace_symtable[0]), symtbl_compare);
+ if (found == NULL)
+ result = ISC_R_NOTFOUND;
+ else {
+ *symbolp = found->symbol;
+ *offsetp = (const char *)addr - (char *)found->addr;
+ }
+
+ return (result);
+}
diff --git a/lib/isc/base32.c b/lib/isc/base32.c
new file mode 100644
index 0000000..d25e3c4
--- /dev/null
+++ b/lib/isc/base32.c
@@ -0,0 +1,373 @@
+/*
+ * Copyright (C) 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: base32.c,v 1.6 2009/10/21 01:22:29 each Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/base32.h>
+#include <isc/buffer.h>
+#include <isc/lex.h>
+#include <isc/region.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+#define RETERR(x) do { \
+ isc_result_t _r = (x); \
+ if (_r != ISC_R_SUCCESS) \
+ return (_r); \
+ } while (0)
+
+
+/*@{*/
+/*!
+ * These static functions are also present in lib/dns/rdata.c. I'm not
+ * sure where they should go. -- bwelling
+ */
+static isc_result_t
+str_totext(const char *source, isc_buffer_t *target);
+
+static isc_result_t
+mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
+
+/*@}*/
+
+static const char base32[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=abcdefghijklmnopqrstuvwxyz234567";
+static const char base32hex[] =
+ "0123456789ABCDEFGHIJKLMNOPQRSTUV=0123456789abcdefghijklmnopqrstuv";
+
+static isc_result_t
+base32_totext(isc_region_t *source, int wordlength, const char *wordbreak,
+ isc_buffer_t *target, const char base[])
+{
+ char buf[9];
+ unsigned int loops = 0;
+
+ if (wordlength >= 0 && wordlength < 8)
+ wordlength = 8;
+
+ memset(buf, 0, sizeof(buf));
+ while (source->length > 0) {
+ buf[0] = base[((source->base[0]>>3)&0x1f)]; /* 5 + */
+ if (source->length == 1) {
+ buf[1] = base[(source->base[0]<<2)&0x1c];
+ buf[2] = buf[3] = buf[4] = '=';
+ buf[5] = buf[6] = buf[7] = '=';
+ RETERR(str_totext(buf, target));
+ break;
+ }
+ buf[1] = base[((source->base[0]<<2)&0x1c)| /* 3 = 8 */
+ ((source->base[1]>>6)&0x03)]; /* 2 + */
+ buf[2] = base[((source->base[1]>>1)&0x1f)]; /* 5 + */
+ if (source->length == 2) {
+ buf[3] = base[(source->base[1]<<4)&0x10];
+ buf[4] = buf[5] = buf[6] = buf[7] = '=';
+ RETERR(str_totext(buf, target));
+ break;
+ }
+ buf[3] = base[((source->base[1]<<4)&0x10)| /* 1 = 8 */
+ ((source->base[2]>>4)&0x0f)]; /* 4 + */
+ if (source->length == 3) {
+ buf[4] = base[(source->base[2]<<1)&0x1e];
+ buf[5] = buf[6] = buf[7] = '=';
+ RETERR(str_totext(buf, target));
+ break;
+ }
+ buf[4] = base[((source->base[2]<<1)&0x1e)| /* 4 = 8 */
+ ((source->base[3]>>7)&0x01)]; /* 1 + */
+ buf[5] = base[((source->base[3]>>2)&0x1f)]; /* 5 + */
+ if (source->length == 4) {
+ buf[6] = base[(source->base[3]<<3)&0x18];
+ buf[7] = '=';
+ RETERR(str_totext(buf, target));
+ break;
+ }
+ buf[6] = base[((source->base[3]<<3)&0x18)| /* 2 = 8 */
+ ((source->base[4]>>5)&0x07)]; /* 3 + */
+ buf[7] = base[source->base[4]&0x1f]; /* 5 = 8 */
+ RETERR(str_totext(buf, target));
+ isc_region_consume(source, 5);
+
+ loops++;
+ if (source->length != 0 && wordlength >= 0 &&
+ (int)((loops + 1) * 8) >= wordlength)
+ {
+ loops = 0;
+ RETERR(str_totext(wordbreak, target));
+ }
+ }
+ if (source->length > 0)
+ isc_region_consume(source, source->length);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_base32_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target)
+{
+ return (base32_totext(source, wordlength, wordbreak, target, base32));
+}
+
+isc_result_t
+isc_base32hex_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target)
+{
+ return (base32_totext(source, wordlength, wordbreak, target,
+ base32hex));
+}
+
+/*%
+ * State of a base32 decoding process in progress.
+ */
+typedef struct {
+ int length; /*%< Desired length of binary data or -1 */
+ isc_buffer_t *target; /*%< Buffer for resulting binary data */
+ int digits; /*%< Number of buffered base32 digits */
+ isc_boolean_t seen_end; /*%< True if "=" end marker seen */
+ int val[8];
+ const char *base; /*%< Which encoding we are using */
+ int seen_32; /*%< Number of significant bytes if non zero */
+} base32_decode_ctx_t;
+
+static inline void
+base32_decode_init(base32_decode_ctx_t *ctx, int length,
+ const char base[], isc_buffer_t *target)
+{
+ ctx->digits = 0;
+ ctx->seen_end = ISC_FALSE;
+ ctx->seen_32 = 0;
+ ctx->length = length;
+ ctx->target = target;
+ ctx->base = base;
+}
+
+static inline isc_result_t
+base32_decode_char(base32_decode_ctx_t *ctx, int c) {
+ char *s;
+ unsigned int last;
+
+ if (ctx->seen_end)
+ return (ISC_R_BADBASE32);
+ if ((s = strchr(ctx->base, c)) == NULL)
+ return (ISC_R_BADBASE32);
+ last = s - ctx->base;
+ /*
+ * Handle lower case.
+ */
+ if (last > 32)
+ last -= 33;
+ /*
+ * Check that padding is contiguous.
+ */
+ if (last != 32 && ctx->seen_32 != 0)
+ return (ISC_R_BADBASE32);
+ /*
+ * Check that padding starts at the right place and that
+ * bits that should be zero are.
+ * Record how many significant bytes in answer (seen_32).
+ */
+ if (last == 32 && ctx->seen_32 == 0)
+ switch (ctx->digits) {
+ case 0:
+ case 1:
+ return (ISC_R_BADBASE32);
+ case 2:
+ if ((ctx->val[1]&0x03) != 0)
+ return (ISC_R_BADBASE32);
+ ctx->seen_32 = 1;
+ break;
+ case 3:
+ return (ISC_R_BADBASE32);
+ case 4:
+ if ((ctx->val[3]&0x0f) != 0)
+ return (ISC_R_BADBASE32);
+ ctx->seen_32 = 3;
+ break;
+ case 5:
+ if ((ctx->val[4]&0x01) != 0)
+ return (ISC_R_BADBASE32);
+ ctx->seen_32 = 3;
+ break;
+ case 6:
+ return (ISC_R_BADBASE32);
+ case 7:
+ if ((ctx->val[6]&0x07) != 0)
+ return (ISC_R_BADBASE32);
+ ctx->seen_32 = 4;
+ break;
+ }
+ /*
+ * Zero fill pad values.
+ */
+ ctx->val[ctx->digits++] = (last == 32) ? 0 : last;
+
+ if (ctx->digits == 8) {
+ int n = 5;
+ unsigned char buf[5];
+
+ if (ctx->seen_32 != 0) {
+ ctx->seen_end = ISC_TRUE;
+ n = ctx->seen_32;
+ }
+ buf[0] = (ctx->val[0]<<3)|(ctx->val[1]>>2);
+ buf[1] = (ctx->val[1]<<6)|(ctx->val[2]<<1)|(ctx->val[3]>>4);
+ buf[2] = (ctx->val[3]<<4)|(ctx->val[4]>>1);
+ buf[3] = (ctx->val[4]<<7)|(ctx->val[5]<<2)|(ctx->val[6]>>3);
+ buf[4] = (ctx->val[6]<<5)|(ctx->val[7]);
+ RETERR(mem_tobuffer(ctx->target, buf, n));
+ if (ctx->length >= 0) {
+ if (n > ctx->length)
+ return (ISC_R_BADBASE32);
+ else
+ ctx->length -= n;
+ }
+ ctx->digits = 0;
+ }
+ return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+base32_decode_finish(base32_decode_ctx_t *ctx) {
+ if (ctx->length > 0)
+ return (ISC_R_UNEXPECTEDEND);
+ if (ctx->digits != 0)
+ return (ISC_R_BADBASE32);
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+base32_tobuffer(isc_lex_t *lexer, const char base[], isc_buffer_t *target,
+ int length)
+{
+ base32_decode_ctx_t ctx;
+ isc_textregion_t *tr;
+ isc_token_t token;
+ isc_boolean_t eol;
+
+ base32_decode_init(&ctx, length, base, target);
+
+ while (!ctx.seen_end && (ctx.length != 0)) {
+ unsigned int i;
+
+ if (length > 0)
+ eol = ISC_FALSE;
+ else
+ eol = ISC_TRUE;
+ RETERR(isc_lex_getmastertoken(lexer, &token,
+ isc_tokentype_string, eol));
+ if (token.type != isc_tokentype_string)
+ break;
+ tr = &token.value.as_textregion;
+ for (i = 0; i < tr->length; i++)
+ RETERR(base32_decode_char(&ctx, tr->base[i]));
+ }
+ if (ctx.length < 0 && !ctx.seen_end)
+ isc_lex_ungettoken(lexer, &token);
+ RETERR(base32_decode_finish(&ctx));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
+ return (base32_tobuffer(lexer, base32, target, length));
+}
+
+isc_result_t
+isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
+ return (base32_tobuffer(lexer, base32hex, target, length));
+}
+
+static isc_result_t
+base32_decodestring(const char *cstr, const char base[], isc_buffer_t *target) {
+ base32_decode_ctx_t ctx;
+
+ base32_decode_init(&ctx, -1, base, target);
+ for (;;) {
+ int c = *cstr++;
+ if (c == '\0')
+ break;
+ if (c == ' ' || c == '\t' || c == '\n' || c== '\r')
+ continue;
+ RETERR(base32_decode_char(&ctx, c));
+ }
+ RETERR(base32_decode_finish(&ctx));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_base32_decodestring(const char *cstr, isc_buffer_t *target) {
+ return (base32_decodestring(cstr, base32, target));
+}
+
+isc_result_t
+isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target) {
+ return (base32_decodestring(cstr, base32hex, target));
+}
+
+static isc_result_t
+base32_decoderegion(isc_region_t *source, const char base[], isc_buffer_t *target) {
+ base32_decode_ctx_t ctx;
+
+ base32_decode_init(&ctx, -1, base, target);
+ while (source->length != 0) {
+ int c = *source->base;
+ RETERR(base32_decode_char(&ctx, c));
+ isc_region_consume(source, 1);
+ }
+ RETERR(base32_decode_finish(&ctx));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target) {
+ return (base32_decoderegion(source, base32, target));
+}
+
+isc_result_t
+isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target) {
+ return (base32_decoderegion(source, base32hex, target));
+}
+
+static isc_result_t
+str_totext(const char *source, isc_buffer_t *target) {
+ unsigned int l;
+ isc_region_t region;
+
+ isc_buffer_availableregion(target, &region);
+ l = strlen(source);
+
+ if (l > region.length)
+ return (ISC_R_NOSPACE);
+
+ memcpy(region.base, source, l);
+ isc_buffer_add(target, l);
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
+ isc_region_t tr;
+
+ isc_buffer_availableregion(target, &tr);
+ if (length > tr.length)
+ return (ISC_R_NOSPACE);
+ memcpy(tr.base, base, length);
+ isc_buffer_add(target, length);
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/base64.c b/lib/isc/base64.c
new file mode 100644
index 0000000..bad1565
--- /dev/null
+++ b/lib/isc/base64.c
@@ -0,0 +1,252 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: base64.c,v 1.34 2009/10/21 23:48:05 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/base64.h>
+#include <isc/buffer.h>
+#include <isc/lex.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+#define RETERR(x) do { \
+ isc_result_t _r = (x); \
+ if (_r != ISC_R_SUCCESS) \
+ return (_r); \
+ } while (0)
+
+
+/*@{*/
+/*!
+ * These static functions are also present in lib/dns/rdata.c. I'm not
+ * sure where they should go. -- bwelling
+ */
+static isc_result_t
+str_totext(const char *source, isc_buffer_t *target);
+
+static isc_result_t
+mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
+
+static const char base64[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+/*@}*/
+
+isc_result_t
+isc_base64_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target)
+{
+ char buf[5];
+ unsigned int loops = 0;
+
+ if (wordlength < 4)
+ wordlength = 4;
+
+ memset(buf, 0, sizeof(buf));
+ while (source->length > 2) {
+ buf[0] = base64[(source->base[0]>>2)&0x3f];
+ buf[1] = base64[((source->base[0]<<4)&0x30)|
+ ((source->base[1]>>4)&0x0f)];
+ buf[2] = base64[((source->base[1]<<2)&0x3c)|
+ ((source->base[2]>>6)&0x03)];
+ buf[3] = base64[source->base[2]&0x3f];
+ RETERR(str_totext(buf, target));
+ isc_region_consume(source, 3);
+
+ loops++;
+ if (source->length != 0 &&
+ (int)((loops + 1) * 4) >= wordlength)
+ {
+ loops = 0;
+ RETERR(str_totext(wordbreak, target));
+ }
+ }
+ if (source->length == 2) {
+ buf[0] = base64[(source->base[0]>>2)&0x3f];
+ buf[1] = base64[((source->base[0]<<4)&0x30)|
+ ((source->base[1]>>4)&0x0f)];
+ buf[2] = base64[((source->base[1]<<2)&0x3c)];
+ buf[3] = '=';
+ RETERR(str_totext(buf, target));
+ isc_region_consume(source, 2);
+ } else if (source->length == 1) {
+ buf[0] = base64[(source->base[0]>>2)&0x3f];
+ buf[1] = base64[((source->base[0]<<4)&0x30)];
+ buf[2] = buf[3] = '=';
+ RETERR(str_totext(buf, target));
+ isc_region_consume(source, 1);
+ }
+ return (ISC_R_SUCCESS);
+}
+
+/*%
+ * State of a base64 decoding process in progress.
+ */
+typedef struct {
+ int length; /*%< Desired length of binary data or -1 */
+ isc_buffer_t *target; /*%< Buffer for resulting binary data */
+ int digits; /*%< Number of buffered base64 digits */
+ isc_boolean_t seen_end; /*%< True if "=" end marker seen */
+ int val[4];
+} base64_decode_ctx_t;
+
+static inline void
+base64_decode_init(base64_decode_ctx_t *ctx, int length, isc_buffer_t *target)
+{
+ ctx->digits = 0;
+ ctx->seen_end = ISC_FALSE;
+ ctx->length = length;
+ ctx->target = target;
+}
+
+static inline isc_result_t
+base64_decode_char(base64_decode_ctx_t *ctx, int c) {
+ char *s;
+
+ if (ctx->seen_end)
+ return (ISC_R_BADBASE64);
+ if ((s = strchr(base64, c)) == NULL)
+ return (ISC_R_BADBASE64);
+ ctx->val[ctx->digits++] = s - base64;
+ if (ctx->digits == 4) {
+ int n;
+ unsigned char buf[3];
+ if (ctx->val[0] == 64 || ctx->val[1] == 64)
+ return (ISC_R_BADBASE64);
+ if (ctx->val[2] == 64 && ctx->val[3] != 64)
+ return (ISC_R_BADBASE64);
+ /*
+ * Check that bits that should be zero are.
+ */
+ if (ctx->val[2] == 64 && (ctx->val[1] & 0xf) != 0)
+ return (ISC_R_BADBASE64);
+ /*
+ * We don't need to test for ctx->val[2] != 64 as
+ * the bottom two bits of 64 are zero.
+ */
+ if (ctx->val[3] == 64 && (ctx->val[2] & 0x3) != 0)
+ return (ISC_R_BADBASE64);
+ n = (ctx->val[2] == 64) ? 1 :
+ (ctx->val[3] == 64) ? 2 : 3;
+ if (n != 3) {
+ ctx->seen_end = ISC_TRUE;
+ if (ctx->val[2] == 64)
+ ctx->val[2] = 0;
+ if (ctx->val[3] == 64)
+ ctx->val[3] = 0;
+ }
+ buf[0] = (ctx->val[0]<<2)|(ctx->val[1]>>4);
+ buf[1] = (ctx->val[1]<<4)|(ctx->val[2]>>2);
+ buf[2] = (ctx->val[2]<<6)|(ctx->val[3]);
+ RETERR(mem_tobuffer(ctx->target, buf, n));
+ if (ctx->length >= 0) {
+ if (n > ctx->length)
+ return (ISC_R_BADBASE64);
+ else
+ ctx->length -= n;
+ }
+ ctx->digits = 0;
+ }
+ return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+base64_decode_finish(base64_decode_ctx_t *ctx) {
+ if (ctx->length > 0)
+ return (ISC_R_UNEXPECTEDEND);
+ if (ctx->digits != 0)
+ return (ISC_R_BADBASE64);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
+ base64_decode_ctx_t ctx;
+ isc_textregion_t *tr;
+ isc_token_t token;
+ isc_boolean_t eol;
+
+ base64_decode_init(&ctx, length, target);
+
+ while (!ctx.seen_end && (ctx.length != 0)) {
+ unsigned int i;
+
+ if (length > 0)
+ eol = ISC_FALSE;
+ else
+ eol = ISC_TRUE;
+ RETERR(isc_lex_getmastertoken(lexer, &token,
+ isc_tokentype_string, eol));
+ if (token.type != isc_tokentype_string)
+ break;
+ tr = &token.value.as_textregion;
+ for (i = 0; i < tr->length; i++)
+ RETERR(base64_decode_char(&ctx, tr->base[i]));
+ }
+ if (ctx.length < 0 && !ctx.seen_end)
+ isc_lex_ungettoken(lexer, &token);
+ RETERR(base64_decode_finish(&ctx));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_base64_decodestring(const char *cstr, isc_buffer_t *target) {
+ base64_decode_ctx_t ctx;
+
+ base64_decode_init(&ctx, -1, target);
+ for (;;) {
+ int c = *cstr++;
+ if (c == '\0')
+ break;
+ if (c == ' ' || c == '\t' || c == '\n' || c== '\r')
+ continue;
+ RETERR(base64_decode_char(&ctx, c));
+ }
+ RETERR(base64_decode_finish(&ctx));
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+str_totext(const char *source, isc_buffer_t *target) {
+ unsigned int l;
+ isc_region_t region;
+
+ isc_buffer_availableregion(target, &region);
+ l = strlen(source);
+
+ if (l > region.length)
+ return (ISC_R_NOSPACE);
+
+ memcpy(region.base, source, l);
+ isc_buffer_add(target, l);
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
+ isc_region_t tr;
+
+ isc_buffer_availableregion(target, &tr);
+ if (length > tr.length)
+ return (ISC_R_NOSPACE);
+ memcpy(tr.base, base, length);
+ isc_buffer_add(target, length);
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/bitstring.c b/lib/isc/bitstring.c
new file mode 100644
index 0000000..33c7c1f
--- /dev/null
+++ b/lib/isc/bitstring.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bitstring.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h>
+
+#include <isc/magic.h>
+#include <isc/bitstring.h>
+#include <isc/util.h>
+
+#define DIV8(x) ((x) >> 3)
+#define MOD8(x) ((x) & 0x00000007U)
+#define OCTETS(n) (((n) + 7) >> 3)
+#define PADDED(n) ((((n) + 7) >> 3) << 3)
+#define BITSET(bs, n) (((bs)->data[DIV8(n)] & \
+ (1 << (7 - MOD8(n)))) != 0)
+#define SETBIT(bs, n) (bs)->data[DIV8(n)] |= (1 << (7 - MOD8(n)))
+#define CLEARBIT(bs, n) (bs)->data[DIV8(n)] &= ~(1 << (7 - MOD8(n)))
+
+#define BITSTRING_MAGIC ISC_MAGIC('B', 'S', 't', 'r')
+#define VALID_BITSTRING(b) ISC_MAGIC_VALID(b, BITSTRING_MAGIC)
+
+void
+isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data,
+ unsigned int length, unsigned int size, isc_boolean_t lsb0)
+{
+ /*
+ * Make 'bitstring' refer to the bitstring of 'size' bits starting
+ * at 'data'. 'length' bits of the bitstring are valid. If 'lsb0'
+ * is set then, bit 0 refers to the least significant bit of the
+ * bitstring. Otherwise bit 0 is the most significant bit.
+ */
+
+ REQUIRE(bitstring != NULL);
+ REQUIRE(data != NULL);
+ REQUIRE(length <= size);
+
+ bitstring->magic = BITSTRING_MAGIC;
+ bitstring->data = data;
+ bitstring->length = length;
+ bitstring->size = size;
+ bitstring->lsb0 = lsb0;
+}
+
+void
+isc_bitstring_invalidate(isc_bitstring_t *bitstring) {
+
+ /*
+ * Invalidate 'bitstring'.
+ */
+
+ REQUIRE(VALID_BITSTRING(bitstring));
+
+ bitstring->magic = 0;
+ bitstring->data = NULL;
+ bitstring->length = 0;
+ bitstring->size = 0;
+ bitstring->lsb0 = ISC_FALSE;
+}
+
+void
+isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
+ isc_bitstring_t *target, unsigned int tbitpos,
+ unsigned int n)
+{
+ unsigned int tlast;
+
+ /*
+ * Starting at bit 'sbitpos', copy 'n' bits from 'source' to
+ * the 'n' bits of 'target' starting at 'tbitpos'.
+ */
+
+ REQUIRE(VALID_BITSTRING(source));
+ REQUIRE(VALID_BITSTRING(target));
+ REQUIRE(source->lsb0 == target->lsb0);
+ if (source->lsb0) {
+ REQUIRE(sbitpos <= source->length);
+ sbitpos = PADDED(source->size) - sbitpos;
+ REQUIRE(sbitpos >= n);
+ sbitpos -= n;
+ } else
+ REQUIRE(sbitpos + n <= source->length);
+ tlast = tbitpos + n;
+ if (target->lsb0) {
+ REQUIRE(tbitpos <= target->length);
+ tbitpos = PADDED(target->size) - tbitpos;
+ REQUIRE(tbitpos >= n);
+ tbitpos -= n;
+ } else
+ REQUIRE(tlast <= target->size);
+
+ if (tlast > target->length)
+ target->length = tlast;
+
+ /*
+ * This is far from optimal...
+ */
+
+ while (n > 0) {
+ if (BITSET(source, sbitpos))
+ SETBIT(target, tbitpos);
+ else
+ CLEARBIT(target, tbitpos);
+ sbitpos++;
+ tbitpos++;
+ n--;
+ }
+}
diff --git a/lib/isc/buffer.c b/lib/isc/buffer.c
new file mode 100644
index 0000000..1b59e65
--- /dev/null
+++ b/lib/isc/buffer.c
@@ -0,0 +1,489 @@
+/*
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: buffer.c,v 1.49 2008/09/25 04:02:39 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/buffer.h>
+#include <isc/mem.h>
+#include <isc/region.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+void
+isc__buffer_init(isc_buffer_t *b, const void *base, unsigned int length) {
+ /*
+ * Make 'b' refer to the 'length'-byte region starting at 'base'.
+ * XXXDCL see the comment in buffer.h about base being const.
+ */
+
+ REQUIRE(b != NULL);
+
+ ISC__BUFFER_INIT(b, base, length);
+}
+
+void
+isc__buffer_initnull(isc_buffer_t *b) {
+ /*
+ * Initialize a new buffer which has no backing store. This can
+ * later be grown as needed and swapped in place.
+ */
+
+ ISC__BUFFER_INIT(b, NULL, 0);
+}
+
+void
+isc_buffer_reinit(isc_buffer_t *b, void *base, unsigned int length) {
+ /*
+ * Re-initialize the buffer enough to reconfigure the base of the
+ * buffer. We will swap in the new buffer, after copying any
+ * data we contain into the new buffer and adjusting all of our
+ * internal pointers.
+ *
+ * The buffer must not be smaller than the length of the original
+ * buffer.
+ */
+ REQUIRE(b->length <= length);
+ REQUIRE(base != NULL);
+
+ (void)memmove(base, b->base, b->length);
+ b->base = base;
+ b->length = length;
+}
+
+void
+isc__buffer_invalidate(isc_buffer_t *b) {
+ /*
+ * Make 'b' an invalid buffer.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(!ISC_LINK_LINKED(b, link));
+ REQUIRE(b->mctx == NULL);
+
+ ISC__BUFFER_INVALIDATE(b);
+}
+
+void
+isc__buffer_region(isc_buffer_t *b, isc_region_t *r) {
+ /*
+ * Make 'r' refer to the region of 'b'.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(r != NULL);
+
+ ISC__BUFFER_REGION(b, r);
+}
+
+void
+isc__buffer_usedregion(isc_buffer_t *b, isc_region_t *r) {
+ /*
+ * Make 'r' refer to the used region of 'b'.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(r != NULL);
+
+ ISC__BUFFER_USEDREGION(b, r);
+}
+
+void
+isc__buffer_availableregion(isc_buffer_t *b, isc_region_t *r) {
+ /*
+ * Make 'r' refer to the available region of 'b'.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(r != NULL);
+
+ ISC__BUFFER_AVAILABLEREGION(b, r);
+}
+
+void
+isc__buffer_add(isc_buffer_t *b, unsigned int n) {
+ /*
+ * Increase the 'used' region of 'b' by 'n' bytes.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used + n <= b->length);
+
+ ISC__BUFFER_ADD(b, n);
+}
+
+void
+isc__buffer_subtract(isc_buffer_t *b, unsigned int n) {
+ /*
+ * Decrease the 'used' region of 'b' by 'n' bytes.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used >= n);
+
+ ISC__BUFFER_SUBTRACT(b, n);
+}
+
+void
+isc__buffer_clear(isc_buffer_t *b) {
+ /*
+ * Make the used region empty.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+
+ ISC__BUFFER_CLEAR(b);
+}
+
+void
+isc__buffer_consumedregion(isc_buffer_t *b, isc_region_t *r) {
+ /*
+ * Make 'r' refer to the consumed region of 'b'.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(r != NULL);
+
+ ISC__BUFFER_CONSUMEDREGION(b, r);
+}
+
+void
+isc__buffer_remainingregion(isc_buffer_t *b, isc_region_t *r) {
+ /*
+ * Make 'r' refer to the remaining region of 'b'.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(r != NULL);
+
+ ISC__BUFFER_REMAININGREGION(b, r);
+}
+
+void
+isc__buffer_activeregion(isc_buffer_t *b, isc_region_t *r) {
+ /*
+ * Make 'r' refer to the active region of 'b'.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(r != NULL);
+
+ ISC__BUFFER_ACTIVEREGION(b, r);
+}
+
+void
+isc__buffer_setactive(isc_buffer_t *b, unsigned int n) {
+ /*
+ * Sets the end of the active region 'n' bytes after current.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->current + n <= b->used);
+
+ ISC__BUFFER_SETACTIVE(b, n);
+}
+
+void
+isc__buffer_first(isc_buffer_t *b) {
+ /*
+ * Make the consumed region empty.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+
+ ISC__BUFFER_FIRST(b);
+}
+
+void
+isc__buffer_forward(isc_buffer_t *b, unsigned int n) {
+ /*
+ * Increase the 'consumed' region of 'b' by 'n' bytes.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->current + n <= b->used);
+
+ ISC__BUFFER_FORWARD(b, n);
+}
+
+void
+isc__buffer_back(isc_buffer_t *b, unsigned int n) {
+ /*
+ * Decrease the 'consumed' region of 'b' by 'n' bytes.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(n <= b->current);
+
+ ISC__BUFFER_BACK(b, n);
+}
+
+void
+isc_buffer_compact(isc_buffer_t *b) {
+ unsigned int length;
+ void *src;
+
+ /*
+ * Compact the used region by moving the remaining region so it occurs
+ * at the start of the buffer. The used region is shrunk by the size
+ * of the consumed region, and the consumed region is then made empty.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+
+ src = isc_buffer_current(b);
+ length = isc_buffer_remaininglength(b);
+ (void)memmove(b->base, src, (size_t)length);
+
+ if (b->active > b->current)
+ b->active -= b->current;
+ else
+ b->active = 0;
+ b->current = 0;
+ b->used = length;
+}
+
+isc_uint8_t
+isc_buffer_getuint8(isc_buffer_t *b) {
+ unsigned char *cp;
+ isc_uint8_t result;
+
+ /*
+ * Read an unsigned 8-bit integer from 'b' and return it.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used - b->current >= 1);
+
+ cp = isc_buffer_current(b);
+ b->current += 1;
+ result = ((isc_uint8_t)(cp[0]));
+
+ return (result);
+}
+
+void
+isc__buffer_putuint8(isc_buffer_t *b, isc_uint8_t val) {
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used + 1 <= b->length);
+
+ ISC__BUFFER_PUTUINT8(b, val);
+}
+
+isc_uint16_t
+isc_buffer_getuint16(isc_buffer_t *b) {
+ unsigned char *cp;
+ isc_uint16_t result;
+
+ /*
+ * Read an unsigned 16-bit integer in network byte order from 'b',
+ * convert it to host byte order, and return it.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used - b->current >= 2);
+
+ cp = isc_buffer_current(b);
+ b->current += 2;
+ result = ((unsigned int)(cp[0])) << 8;
+ result |= ((unsigned int)(cp[1]));
+
+ return (result);
+}
+
+void
+isc__buffer_putuint16(isc_buffer_t *b, isc_uint16_t val) {
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used + 2 <= b->length);
+
+ ISC__BUFFER_PUTUINT16(b, val);
+}
+
+void
+isc__buffer_putuint24(isc_buffer_t *b, isc_uint32_t val) {
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used + 3 <= b->length);
+
+ ISC__BUFFER_PUTUINT24(b, val);
+}
+
+isc_uint32_t
+isc_buffer_getuint32(isc_buffer_t *b) {
+ unsigned char *cp;
+ isc_uint32_t result;
+
+ /*
+ * Read an unsigned 32-bit integer in network byte order from 'b',
+ * convert it to host byte order, and return it.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used - b->current >= 4);
+
+ cp = isc_buffer_current(b);
+ b->current += 4;
+ result = ((unsigned int)(cp[0])) << 24;
+ result |= ((unsigned int)(cp[1])) << 16;
+ result |= ((unsigned int)(cp[2])) << 8;
+ result |= ((unsigned int)(cp[3]));
+
+ return (result);
+}
+
+void
+isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val) {
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used + 4 <= b->length);
+
+ ISC__BUFFER_PUTUINT32(b, val);
+}
+
+isc_uint64_t
+isc_buffer_getuint48(isc_buffer_t *b) {
+ unsigned char *cp;
+ isc_uint64_t result;
+
+ /*
+ * Read an unsigned 48-bit integer in network byte order from 'b',
+ * convert it to host byte order, and return it.
+ */
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used - b->current >= 6);
+
+ cp = isc_buffer_current(b);
+ b->current += 6;
+ result = ((isc_int64_t)(cp[0])) << 40;
+ result |= ((isc_int64_t)(cp[1])) << 32;
+ result |= ((isc_int64_t)(cp[2])) << 24;
+ result |= ((isc_int64_t)(cp[3])) << 16;
+ result |= ((isc_int64_t)(cp[4])) << 8;
+ result |= ((isc_int64_t)(cp[5]));
+
+ return (result);
+}
+
+void
+isc__buffer_putuint48(isc_buffer_t *b, isc_uint64_t val) {
+ isc_uint16_t valhi;
+ isc_uint32_t vallo;
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used + 6 <= b->length);
+
+ valhi = (isc_uint16_t)(val >> 32);
+ vallo = (isc_uint32_t)(val & 0xFFFFFFFF);
+ ISC__BUFFER_PUTUINT16(b, valhi);
+ ISC__BUFFER_PUTUINT32(b, vallo);
+}
+
+void
+isc__buffer_putmem(isc_buffer_t *b, const unsigned char *base,
+ unsigned int length)
+{
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(b->used + length <= b->length);
+
+ ISC__BUFFER_PUTMEM(b, base, length);
+}
+
+void
+isc__buffer_putstr(isc_buffer_t *b, const char *source) {
+ unsigned int l;
+ unsigned char *cp;
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(source != NULL);
+
+ /*
+ * Do not use ISC__BUFFER_PUTSTR(), so strlen is only done once.
+ */
+ l = strlen(source);
+
+ REQUIRE(l <= isc_buffer_availablelength(b));
+
+ cp = isc_buffer_used(b);
+ memcpy(cp, source, l);
+ b->used += l;
+}
+
+isc_result_t
+isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r) {
+ unsigned char *base;
+ unsigned int available;
+
+ REQUIRE(ISC_BUFFER_VALID(b));
+ REQUIRE(r != NULL);
+
+ /*
+ * XXXDCL
+ */
+ base = isc_buffer_used(b);
+ available = isc_buffer_availablelength(b);
+ if (r->length > available)
+ return (ISC_R_NOSPACE);
+ memcpy(base, r->base, r->length);
+ b->used += r->length;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
+ unsigned int length)
+{
+ isc_buffer_t *dbuf;
+
+ REQUIRE(dynbuffer != NULL);
+ REQUIRE(*dynbuffer == NULL);
+
+ dbuf = isc_mem_get(mctx, length + sizeof(isc_buffer_t));
+ if (dbuf == NULL)
+ return (ISC_R_NOMEMORY);
+
+ isc_buffer_init(dbuf, ((unsigned char *)dbuf) + sizeof(isc_buffer_t),
+ length);
+ dbuf->mctx = mctx;
+
+ *dynbuffer = dbuf;
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_buffer_free(isc_buffer_t **dynbuffer) {
+ unsigned int real_length;
+ isc_buffer_t *dbuf;
+ isc_mem_t *mctx;
+
+ REQUIRE(dynbuffer != NULL);
+ REQUIRE(ISC_BUFFER_VALID(*dynbuffer));
+ REQUIRE((*dynbuffer)->mctx != NULL);
+
+ dbuf = *dynbuffer;
+ *dynbuffer = NULL; /* destroy external reference */
+
+ real_length = dbuf->length + sizeof(isc_buffer_t);
+ mctx = dbuf->mctx;
+ dbuf->mctx = NULL;
+ isc_buffer_invalidate(dbuf);
+
+ isc_mem_put(mctx, dbuf, real_length);
+}
diff --git a/lib/isc/bufferlist.c b/lib/isc/bufferlist.c
new file mode 100644
index 0000000..0e5c125
--- /dev/null
+++ b/lib/isc/bufferlist.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bufferlist.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h>
+
+#include <isc/buffer.h>
+#include <isc/bufferlist.h>
+#include <isc/util.h>
+
+unsigned int
+isc_bufferlist_usedcount(isc_bufferlist_t *bl) {
+ isc_buffer_t *buffer;
+ unsigned int length;
+
+ REQUIRE(bl != NULL);
+
+ length = 0;
+ buffer = ISC_LIST_HEAD(*bl);
+ while (buffer != NULL) {
+ REQUIRE(ISC_BUFFER_VALID(buffer));
+ length += isc_buffer_usedlength(buffer);
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ return (length);
+}
+
+unsigned int
+isc_bufferlist_availablecount(isc_bufferlist_t *bl) {
+ isc_buffer_t *buffer;
+ unsigned int length;
+
+ REQUIRE(bl != NULL);
+
+ length = 0;
+ buffer = ISC_LIST_HEAD(*bl);
+ while (buffer != NULL) {
+ REQUIRE(ISC_BUFFER_VALID(buffer));
+ length += isc_buffer_availablelength(buffer);
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ return (length);
+}
diff --git a/lib/isc/commandline.c b/lib/isc/commandline.c
new file mode 100644
index 0000000..aca1203
--- /dev/null
+++ b/lib/isc/commandline.c
@@ -0,0 +1,225 @@
+/*
+ * Portions Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1987, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $Id: commandline.c,v 1.22 2008/09/25 04:02:39 tbox Exp $ */
+
+/*! \file
+ * This file was adapted from the NetBSD project's source tree, RCS ID:
+ * NetBSD: getopt.c,v 1.15 1999/09/20 04:39:37 lukem Exp
+ *
+ * The primary change has been to rename items to the ISC namespace
+ * and format in the ISC coding style.
+ */
+
+/*
+ * \author Principal Authors: Computer Systems Research Group at UC Berkeley
+ * \author Principal ISC caretaker: DCL
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <isc/commandline.h>
+#include <isc/msgs.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+/*% Index into parent argv vector. */
+LIBISC_EXTERNAL_DATA int isc_commandline_index = 1;
+/*% Character checked for validity. */
+LIBISC_EXTERNAL_DATA int isc_commandline_option;
+/*% Argument associated with option. */
+LIBISC_EXTERNAL_DATA char *isc_commandline_argument;
+/*% For printing error messages. */
+LIBISC_EXTERNAL_DATA char *isc_commandline_progname;
+/*% Print error messages. */
+LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_errprint = ISC_TRUE;
+/*% Reset processing. */
+LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_reset = ISC_TRUE;
+
+static char endopt = '\0';
+
+#define BADOPT '?'
+#define BADARG ':'
+#define ENDOPT &endopt
+
+/*!
+ * getopt --
+ * Parse argc/argv argument vector.
+ */
+int
+isc_commandline_parse(int argc, char * const *argv, const char *options) {
+ static char *place = ENDOPT;
+ char *option; /* Index into *options of option. */
+
+ REQUIRE(argc >= 0 && argv != NULL && options != NULL);
+
+ /*
+ * Update scanning pointer, either because a reset was requested or
+ * the previous argv was finished.
+ */
+ if (isc_commandline_reset || *place == '\0') {
+ if (isc_commandline_reset) {
+ isc_commandline_index = 1;
+ isc_commandline_reset = ISC_FALSE;
+ }
+
+ if (isc_commandline_progname == NULL)
+ isc_commandline_progname = argv[0];
+
+ if (isc_commandline_index >= argc ||
+ *(place = argv[isc_commandline_index]) != '-') {
+ /*
+ * Index out of range or points to non-option.
+ */
+ place = ENDOPT;
+ return (-1);
+ }
+
+ if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
+ /*
+ * Found '--' to signal end of options. Advance
+ * index to next argv, the first non-option.
+ */
+ isc_commandline_index++;
+ place = ENDOPT;
+ return (-1);
+ }
+ }
+
+ isc_commandline_option = *place++;
+ option = strchr(options, isc_commandline_option);
+
+ /*
+ * Ensure valid option has been passed as specified by options string.
+ * '-:' is never a valid command line option because it could not
+ * distinguish ':' from the argument specifier in the options string.
+ */
+ if (isc_commandline_option == ':' || option == NULL) {
+ if (*place == '\0')
+ isc_commandline_index++;
+
+ if (isc_commandline_errprint && *options != ':')
+ fprintf(stderr, "%s: %s -- %c\n",
+ isc_commandline_progname,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_COMMANDLINE,
+ ISC_MSG_ILLEGALOPT,
+ "illegal option"),
+ isc_commandline_option);
+
+ return (BADOPT);
+ }
+
+ if (*++option != ':') {
+ /*
+ * Option does not take an argument.
+ */
+ isc_commandline_argument = NULL;
+
+ /*
+ * Skip to next argv if at the end of the current argv.
+ */
+ if (*place == '\0')
+ ++isc_commandline_index;
+
+ } else {
+ /*
+ * Option needs an argument.
+ */
+ if (*place != '\0')
+ /*
+ * Option is in this argv, -D1 style.
+ */
+ isc_commandline_argument = place;
+
+ else if (argc > ++isc_commandline_index)
+ /*
+ * Option is next argv, -D 1 style.
+ */
+ isc_commandline_argument = argv[isc_commandline_index];
+
+ else {
+ /*
+ * Argument needed, but no more argv.
+ */
+ place = ENDOPT;
+
+ /*
+ * Silent failure with "missing argument" return
+ * when ':' starts options string, per historical spec.
+ */
+ if (*options == ':')
+ return (BADARG);
+
+ if (isc_commandline_errprint)
+ fprintf(stderr, "%s: %s -- %c\n",
+ isc_commandline_progname,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_COMMANDLINE,
+ ISC_MSG_OPTNEEDARG,
+ "option requires "
+ "an argument"),
+ isc_commandline_option);
+
+ return (BADOPT);
+ }
+
+ place = ENDOPT;
+
+ /*
+ * Point to argv that follows argument.
+ */
+ isc_commandline_index++;
+ }
+
+ return (isc_commandline_option);
+}
diff --git a/lib/isc/entropy.c b/lib/isc/entropy.c
new file mode 100644
index 0000000..da9e81f
--- /dev/null
+++ b/lib/isc/entropy.c
@@ -0,0 +1,1277 @@
+/*
+ * Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: entropy.c,v 1.22 2010/08/10 23:48:19 tbox Exp $ */
+
+/*! \file
+ * \brief
+ * This is the system independent part of the entropy module. It is
+ * compiled via inclusion from the relevant OS source file, ie,
+ * \link unix/entropy.c unix/entropy.c \endlink or win32/entropy.c.
+ *
+ * \author Much of this code is modeled after the NetBSD /dev/random implementation,
+ * written by Michael Graff <explorer@netbsd.org>.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+#include <isc/buffer.h>
+#include <isc/entropy.h>
+#include <isc/keyboard.h>
+#include <isc/list.h>
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/mutex.h>
+#include <isc/platform.h>
+#include <isc/region.h>
+#include <isc/sha1.h>
+#include <isc/string.h>
+#include <isc/time.h>
+#include <isc/util.h>
+
+
+#define ENTROPY_MAGIC ISC_MAGIC('E', 'n', 't', 'e')
+#define SOURCE_MAGIC ISC_MAGIC('E', 'n', 't', 's')
+
+#define VALID_ENTROPY(e) ISC_MAGIC_VALID(e, ENTROPY_MAGIC)
+#define VALID_SOURCE(s) ISC_MAGIC_VALID(s, SOURCE_MAGIC)
+
+/***
+ *** "constants." Do not change these unless you _really_ know what
+ *** you are doing.
+ ***/
+
+/*%
+ * Size of entropy pool in 32-bit words. This _MUST_ be a power of 2.
+ */
+#define RND_POOLWORDS 128
+/*% Pool in bytes. */
+#define RND_POOLBYTES (RND_POOLWORDS * 4)
+/*% Pool in bits. */
+#define RND_POOLBITS (RND_POOLWORDS * 32)
+
+/*%
+ * Number of bytes returned per hash. This must be true:
+ * threshold * 2 <= digest_size_in_bytes
+ */
+#define RND_ENTROPY_THRESHOLD 10
+#define THRESHOLD_BITS (RND_ENTROPY_THRESHOLD * 8)
+
+/*%
+ * Size of the input event queue in samples.
+ */
+#define RND_EVENTQSIZE 32
+
+/*%
+ * The number of times we'll "reseed" for pseudorandom seeds. This is an
+ * extremely weak pseudorandom seed. If the caller is using lots of
+ * pseudorandom data and they cannot provide a stronger random source,
+ * there is little we can do other than hope they're smart enough to
+ * call _adddata() with something better than we can come up with.
+ */
+#define RND_INITIALIZE 128
+
+/*% Entropy Pool */
+typedef struct {
+ isc_uint32_t cursor; /*%< current add point in the pool */
+ isc_uint32_t entropy; /*%< current entropy estimate in bits */
+ isc_uint32_t pseudo; /*%< bits extracted in pseudorandom */
+ isc_uint32_t rotate; /*%< how many bits to rotate by */
+ isc_uint32_t pool[RND_POOLWORDS]; /*%< random pool data */
+} isc_entropypool_t;
+
+struct isc_entropy {
+ unsigned int magic;
+ isc_mem_t *mctx;
+ isc_mutex_t lock;
+ unsigned int refcnt;
+ isc_uint32_t initialized;
+ isc_uint32_t initcount;
+ isc_entropypool_t pool;
+ unsigned int nsources;
+ isc_entropysource_t *nextsource;
+ ISC_LIST(isc_entropysource_t) sources;
+};
+
+/*% Sample Queue */
+typedef struct {
+ isc_uint32_t last_time; /*%< last time recorded */
+ isc_uint32_t last_delta; /*%< last delta value */
+ isc_uint32_t last_delta2; /*%< last delta2 value */
+ isc_uint32_t nsamples; /*%< number of samples filled in */
+ isc_uint32_t *samples; /*%< the samples */
+ isc_uint32_t *extra; /*%< extra samples added in */
+} sample_queue_t;
+
+typedef struct {
+ sample_queue_t samplequeue;
+} isc_entropysamplesource_t;
+
+typedef struct {
+ isc_boolean_t start_called;
+ isc_entropystart_t startfunc;
+ isc_entropyget_t getfunc;
+ isc_entropystop_t stopfunc;
+ void *arg;
+ sample_queue_t samplequeue;
+} isc_cbsource_t;
+
+typedef struct {
+ FILESOURCE_HANDLE_TYPE handle;
+} isc_entropyfilesource_t;
+
+struct isc_entropysource {
+ unsigned int magic;
+ unsigned int type;
+ isc_entropy_t *ent;
+ isc_uint32_t total; /*%< entropy from this source */
+ ISC_LINK(isc_entropysource_t) link;
+ char name[32];
+ isc_boolean_t bad;
+ isc_boolean_t warn_keyboard;
+ isc_keyboard_t kbd;
+ union {
+ isc_entropysamplesource_t sample;
+ isc_entropyfilesource_t file;
+ isc_cbsource_t callback;
+ isc_entropyusocketsource_t usocket;
+ } sources;
+};
+
+#define ENTROPY_SOURCETYPE_SAMPLE 1 /*%< Type is a sample source */
+#define ENTROPY_SOURCETYPE_FILE 2 /*%< Type is a file source */
+#define ENTROPY_SOURCETYPE_CALLBACK 3 /*%< Type is a callback source */
+#define ENTROPY_SOURCETYPE_USOCKET 4 /*%< Type is a Unix socket source */
+
+/*@{*/
+/*%
+ * The random pool "taps"
+ */
+#define TAP1 99
+#define TAP2 59
+#define TAP3 31
+#define TAP4 9
+#define TAP5 7
+/*@}*/
+
+/*@{*/
+/*%
+ * Declarations for function provided by the system dependent sources that
+ * include this file.
+ */
+static void
+fillpool(isc_entropy_t *, unsigned int, isc_boolean_t);
+
+static int
+wait_for_sources(isc_entropy_t *);
+
+static void
+destroyfilesource(isc_entropyfilesource_t *source);
+
+static void
+destroyusocketsource(isc_entropyusocketsource_t *source);
+
+/*@}*/
+
+static void
+samplequeue_release(isc_entropy_t *ent, sample_queue_t *sq) {
+ REQUIRE(sq->samples != NULL);
+ REQUIRE(sq->extra != NULL);
+
+ isc_mem_put(ent->mctx, sq->samples, RND_EVENTQSIZE * 4);
+ isc_mem_put(ent->mctx, sq->extra, RND_EVENTQSIZE * 4);
+ sq->samples = NULL;
+ sq->extra = NULL;
+}
+
+static isc_result_t
+samplesource_allocate(isc_entropy_t *ent, sample_queue_t *sq) {
+ sq->samples = isc_mem_get(ent->mctx, RND_EVENTQSIZE * 4);
+ if (sq->samples == NULL)
+ return (ISC_R_NOMEMORY);
+
+ sq->extra = isc_mem_get(ent->mctx, RND_EVENTQSIZE * 4);
+ if (sq->extra == NULL) {
+ isc_mem_put(ent->mctx, sq->samples, RND_EVENTQSIZE * 4);
+ sq->samples = NULL;
+ return (ISC_R_NOMEMORY);
+ }
+
+ sq->nsamples = 0;
+
+ return (ISC_R_SUCCESS);
+}
+
+/*%
+ * Add in entropy, even when the value we're adding in could be
+ * very large.
+ */
+static inline void
+add_entropy(isc_entropy_t *ent, isc_uint32_t entropy) {
+ /* clamp input. Yes, this must be done. */
+ entropy = ISC_MIN(entropy, RND_POOLBITS);
+ /* Add in the entropy we already have. */
+ entropy += ent->pool.entropy;
+ /* Clamp. */
+ ent->pool.entropy = ISC_MIN(entropy, RND_POOLBITS);
+}
+
+/*%
+ * Decrement the amount of entropy the pool has.
+ */
+static inline void
+subtract_entropy(isc_entropy_t *ent, isc_uint32_t entropy) {
+ entropy = ISC_MIN(entropy, ent->pool.entropy);
+ ent->pool.entropy -= entropy;
+}
+
+/*!
+ * Add in entropy, even when the value we're adding in could be
+ * very large.
+ */
+static inline void
+add_pseudo(isc_entropy_t *ent, isc_uint32_t pseudo) {
+ /* clamp input. Yes, this must be done. */
+ pseudo = ISC_MIN(pseudo, RND_POOLBITS * 8);
+ /* Add in the pseudo we already have. */
+ pseudo += ent->pool.pseudo;
+ /* Clamp. */
+ ent->pool.pseudo = ISC_MIN(pseudo, RND_POOLBITS * 8);
+}
+
+/*!
+ * Decrement the amount of pseudo the pool has.
+ */
+static inline void
+subtract_pseudo(isc_entropy_t *ent, isc_uint32_t pseudo) {
+ pseudo = ISC_MIN(pseudo, ent->pool.pseudo);
+ ent->pool.pseudo -= pseudo;
+}
+
+/*!
+ * Add one word to the pool, rotating the input as needed.
+ */
+static inline void
+entropypool_add_word(isc_entropypool_t *rp, isc_uint32_t val) {
+ /*
+ * Steal some values out of the pool, and xor them into the
+ * word we were given.
+ *
+ * Mix the new value into the pool using xor. This will
+ * prevent the actual values from being known to the caller
+ * since the previous values are assumed to be unknown as well.
+ */
+ val ^= rp->pool[(rp->cursor + TAP1) & (RND_POOLWORDS - 1)];
+ val ^= rp->pool[(rp->cursor + TAP2) & (RND_POOLWORDS - 1)];
+ val ^= rp->pool[(rp->cursor + TAP3) & (RND_POOLWORDS - 1)];
+ val ^= rp->pool[(rp->cursor + TAP4) & (RND_POOLWORDS - 1)];
+ val ^= rp->pool[(rp->cursor + TAP5) & (RND_POOLWORDS - 1)];
+ if (rp->rotate == 0)
+ rp->pool[rp->cursor++] ^= val;
+ else
+ rp->pool[rp->cursor++] ^=
+ ((val << rp->rotate) | (val >> (32 - rp->rotate)));
+
+ /*
+ * If we have looped around the pool, increment the rotate
+ * variable so the next value will get xored in rotated to
+ * a different position.
+ * Increment by a value that is relatively prime to the word size
+ * to try to spread the bits throughout the pool quickly when the
+ * pool is empty.
+ */
+ if (rp->cursor == RND_POOLWORDS) {
+ rp->cursor = 0;
+ rp->rotate = (rp->rotate + 7) & 31;
+ }
+}
+
+/*!
+ * Add a buffer's worth of data to the pool.
+ *
+ * Requires that the lock is held on the entropy pool.
+ */
+static void
+entropypool_adddata(isc_entropy_t *ent, void *p, unsigned int len,
+ isc_uint32_t entropy)
+{
+ isc_uint32_t val;
+ unsigned long addr;
+ isc_uint8_t *buf;
+
+ addr = (unsigned long)p;
+ buf = p;
+
+ if ((addr & 0x03U) != 0U) {
+ val = 0;
+ switch (len) {
+ case 3:
+ val = *buf++;
+ len--;
+ case 2:
+ val = val << 8 | *buf++;
+ len--;
+ case 1:
+ val = val << 8 | *buf++;
+ len--;
+ }
+
+ entropypool_add_word(&ent->pool, val);
+ }
+
+ for (; len > 3; len -= 4) {
+ val = *((isc_uint32_t *)buf);
+
+ entropypool_add_word(&ent->pool, val);
+ buf += 4;
+ }
+
+ if (len != 0) {
+ val = 0;
+ switch (len) {
+ case 3:
+ val = *buf++;
+ case 2:
+ val = val << 8 | *buf++;
+ case 1:
+ val = val << 8 | *buf++;
+ }
+
+ entropypool_add_word(&ent->pool, val);
+ }
+
+ add_entropy(ent, entropy);
+ subtract_pseudo(ent, entropy);
+}
+
+static inline void
+reseed(isc_entropy_t *ent) {
+ isc_time_t t;
+ pid_t pid;
+
+ if (ent->initcount == 0) {
+ pid = getpid();
+ entropypool_adddata(ent, &pid, sizeof(pid), 0);
+ pid = getppid();
+ entropypool_adddata(ent, &pid, sizeof(pid), 0);
+ }
+
+ /*!
+ * After we've reseeded 100 times, only add new timing info every
+ * 50 requests. This will keep us from using lots and lots of
+ * CPU just to return bad pseudorandom data anyway.
+ */
+ if (ent->initcount > 100)
+ if ((ent->initcount % 50) != 0)
+ return;
+
+ TIME_NOW(&t);
+ entropypool_adddata(ent, &t, sizeof(t), 0);
+ ent->initcount++;
+}
+
+static inline unsigned int
+estimate_entropy(sample_queue_t *sq, isc_uint32_t t) {
+ isc_int32_t delta;
+ isc_int32_t delta2;
+ isc_int32_t delta3;
+
+ /*!
+ * If the time counter has overflowed, calculate the real difference.
+ * If it has not, it is simpler.
+ */
+ if (t < sq->last_time)
+ delta = UINT_MAX - sq->last_time + t;
+ else
+ delta = sq->last_time - t;
+
+ if (delta < 0)
+ delta = -delta;
+
+ /*
+ * Calculate the second and third order differentials
+ */
+ delta2 = sq->last_delta - delta;
+ if (delta2 < 0)
+ delta2 = -delta2;
+
+ delta3 = sq->last_delta2 - delta2;
+ if (delta3 < 0)
+ delta3 = -delta3;
+
+ sq->last_time = t;
+ sq->last_delta = delta;
+ sq->last_delta2 = delta2;
+
+ /*
+ * If any delta is 0, we got no entropy. If all are non-zero, we
+ * might have something.
+ */
+ if (delta == 0 || delta2 == 0 || delta3 == 0)
+ return 0;
+
+ /*
+ * We could find the smallest delta and claim we got log2(delta)
+ * bits, but for now return that we found 1 bit.
+ */
+ return 1;
+}
+
+static unsigned int
+crunchsamples(isc_entropy_t *ent, sample_queue_t *sq) {
+ unsigned int ns;
+ unsigned int added;
+
+ if (sq->nsamples < 6)
+ return (0);
+
+ added = 0;
+ sq->last_time = sq->samples[0];
+ sq->last_delta = 0;
+ sq->last_delta2 = 0;
+
+ /*
+ * Prime the values by adding in the first 4 samples in. This
+ * should completely initialize the delta calculations.
+ */
+ for (ns = 0; ns < 4; ns++)
+ (void)estimate_entropy(sq, sq->samples[ns]);
+
+ for (ns = 4; ns < sq->nsamples; ns++)
+ added += estimate_entropy(sq, sq->samples[ns]);
+
+ entropypool_adddata(ent, sq->samples, sq->nsamples * 4, added);
+ entropypool_adddata(ent, sq->extra, sq->nsamples * 4, 0);
+
+ /*
+ * Move the last 4 samples into the first 4 positions, and start
+ * adding new samples from that point.
+ */
+ for (ns = 0; ns < 4; ns++) {
+ sq->samples[ns] = sq->samples[sq->nsamples - 4 + ns];
+ sq->extra[ns] = sq->extra[sq->nsamples - 4 + ns];
+ }
+
+ sq->nsamples = 4;
+
+ return (added);
+}
+
+static unsigned int
+get_from_callback(isc_entropysource_t *source, unsigned int desired,
+ isc_boolean_t blocking)
+{
+ isc_entropy_t *ent = source->ent;
+ isc_cbsource_t *cbs = &source->sources.callback;
+ unsigned int added;
+ unsigned int got;
+ isc_result_t result;
+
+ if (desired == 0)
+ return (0);
+
+ if (source->bad)
+ return (0);
+
+ if (!cbs->start_called && cbs->startfunc != NULL) {
+ result = cbs->startfunc(source, cbs->arg, blocking);
+ if (result != ISC_R_SUCCESS)
+ return (0);
+ cbs->start_called = ISC_TRUE;
+ }
+
+ added = 0;
+ result = ISC_R_SUCCESS;
+ while (desired > 0 && result == ISC_R_SUCCESS) {
+ result = cbs->getfunc(source, cbs->arg, blocking);
+ if (result == ISC_R_QUEUEFULL) {
+ got = crunchsamples(ent, &cbs->samplequeue);
+ added += got;
+ desired -= ISC_MIN(got, desired);
+ result = ISC_R_SUCCESS;
+ } else if (result != ISC_R_SUCCESS &&
+ result != ISC_R_NOTBLOCKING)
+ source->bad = ISC_TRUE;
+
+ }
+
+ return (added);
+}
+
+/*
+ * Extract some number of bytes from the random pool, decreasing the
+ * estimate of randomness as each byte is extracted.
+ *
+ * Do this by stiring the pool and returning a part of hash as randomness.
+ * Note that no secrets are given away here since parts of the hash are
+ * xored together before returned.
+ *
+ * Honor the request from the caller to only return good data, any data,
+ * etc.
+ */
+isc_result_t
+isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length,
+ unsigned int *returned, unsigned int flags)
+{
+ unsigned int i;
+ isc_sha1_t hash;
+ unsigned char digest[ISC_SHA1_DIGESTLENGTH];
+ isc_uint32_t remain, deltae, count, total;
+ isc_uint8_t *buf;
+ isc_boolean_t goodonly, partial, blocking;
+
+ REQUIRE(VALID_ENTROPY(ent));
+ REQUIRE(data != NULL);
+ REQUIRE(length > 0);
+
+ goodonly = ISC_TF((flags & ISC_ENTROPY_GOODONLY) != 0);
+ partial = ISC_TF((flags & ISC_ENTROPY_PARTIAL) != 0);
+ blocking = ISC_TF((flags & ISC_ENTROPY_BLOCKING) != 0);
+
+ REQUIRE(!partial || returned != NULL);
+
+ LOCK(&ent->lock);
+
+ remain = length;
+ buf = data;
+ total = 0;
+ while (remain != 0) {
+ count = ISC_MIN(remain, RND_ENTROPY_THRESHOLD);
+
+ /*
+ * If we are extracting good data only, make certain we
+ * have enough data in our pool for this pass. If we don't,
+ * get some, and fail if we can't, and partial returns
+ * are not ok.
+ */
+ if (goodonly) {
+ unsigned int fillcount;
+
+ fillcount = ISC_MAX(remain * 8, count * 8);
+
+ /*
+ * If, however, we have at least THRESHOLD_BITS
+ * of entropy in the pool, don't block here. It is
+ * better to drain the pool once in a while and
+ * then refill it than it is to constantly keep the
+ * pool full.
+ */
+ if (ent->pool.entropy >= THRESHOLD_BITS)
+ fillpool(ent, fillcount, ISC_FALSE);
+ else
+ fillpool(ent, fillcount, blocking);
+
+ /*
+ * Verify that we got enough entropy to do one
+ * extraction. If we didn't, bail.
+ */
+ if (ent->pool.entropy < THRESHOLD_BITS) {
+ if (!partial)
+ goto zeroize;
+ else
+ goto partial_output;
+ }
+ } else {
+ /*
+ * If we've extracted half our pool size in bits
+ * since the last refresh, try to refresh here.
+ */
+ if (ent->initialized < THRESHOLD_BITS)
+ fillpool(ent, THRESHOLD_BITS, blocking);
+ else
+ fillpool(ent, 0, ISC_FALSE);
+
+ /*
+ * If we've not initialized with enough good random
+ * data, seed with our crappy code.
+ */
+ if (ent->initialized < THRESHOLD_BITS)
+ reseed(ent);
+ }
+
+ isc_sha1_init(&hash);
+ isc_sha1_update(&hash, (void *)(ent->pool.pool),
+ RND_POOLBYTES);
+ isc_sha1_final(&hash, digest);
+
+ /*
+ * Stir the extracted data (all of it) back into the pool.
+ */
+ entropypool_adddata(ent, digest, ISC_SHA1_DIGESTLENGTH, 0);
+
+ for (i = 0; i < count; i++)
+ buf[i] = digest[i] ^ digest[i + RND_ENTROPY_THRESHOLD];
+
+ buf += count;
+ remain -= count;
+
+ deltae = count * 8;
+ deltae = ISC_MIN(deltae, ent->pool.entropy);
+ total += deltae;
+ subtract_entropy(ent, deltae);
+ add_pseudo(ent, count * 8);
+ }
+
+ partial_output:
+ memset(digest, 0, sizeof(digest));
+
+ if (returned != NULL)
+ *returned = (length - remain);
+
+ UNLOCK(&ent->lock);
+
+ return (ISC_R_SUCCESS);
+
+ zeroize:
+ /* put the entropy we almost extracted back */
+ add_entropy(ent, total);
+ memset(data, 0, length);
+ memset(digest, 0, sizeof(digest));
+ if (returned != NULL)
+ *returned = 0;
+
+ UNLOCK(&ent->lock);
+
+ return (ISC_R_NOENTROPY);
+}
+
+static void
+isc_entropypool_init(isc_entropypool_t *pool) {
+ pool->cursor = RND_POOLWORDS - 1;
+ pool->entropy = 0;
+ pool->pseudo = 0;
+ pool->rotate = 0;
+ memset(pool->pool, 0, RND_POOLBYTES);
+}
+
+static void
+isc_entropypool_invalidate(isc_entropypool_t *pool) {
+ pool->cursor = 0;
+ pool->entropy = 0;
+ pool->pseudo = 0;
+ pool->rotate = 0;
+ memset(pool->pool, 0, RND_POOLBYTES);
+}
+
+isc_result_t
+isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp) {
+ isc_result_t result;
+ isc_entropy_t *ent;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(entp != NULL && *entp == NULL);
+
+ ent = isc_mem_get(mctx, sizeof(isc_entropy_t));
+ if (ent == NULL)
+ return (ISC_R_NOMEMORY);
+
+ /*
+ * We need a lock.
+ */
+ result = isc_mutex_init(&ent->lock);
+ if (result != ISC_R_SUCCESS)
+ goto errout;
+
+ /*
+ * From here down, no failures will/can occur.
+ */
+ ISC_LIST_INIT(ent->sources);
+ ent->nextsource = NULL;
+ ent->nsources = 0;
+ ent->mctx = NULL;
+ isc_mem_attach(mctx, &ent->mctx);
+ ent->refcnt = 1;
+ ent->initialized = 0;
+ ent->initcount = 0;
+ ent->magic = ENTROPY_MAGIC;
+
+ isc_entropypool_init(&ent->pool);
+
+ *entp = ent;
+ return (ISC_R_SUCCESS);
+
+ errout:
+ isc_mem_put(mctx, ent, sizeof(isc_entropy_t));
+
+ return (result);
+}
+
+/*!
+ * Requires "ent" be locked.
+ */
+static void
+destroysource(isc_entropysource_t **sourcep) {
+ isc_entropysource_t *source;
+ isc_entropy_t *ent;
+ isc_cbsource_t *cbs;
+
+ source = *sourcep;
+ *sourcep = NULL;
+ ent = source->ent;
+
+ ISC_LIST_UNLINK(ent->sources, source, link);
+ ent->nextsource = NULL;
+ REQUIRE(ent->nsources > 0);
+ ent->nsources--;
+
+ switch (source->type) {
+ case ENTROPY_SOURCETYPE_FILE:
+ if (! source->bad)
+ destroyfilesource(&source->sources.file);
+ break;
+ case ENTROPY_SOURCETYPE_USOCKET:
+ if (! source->bad)
+ destroyusocketsource(&source->sources.usocket);
+ break;
+ case ENTROPY_SOURCETYPE_SAMPLE:
+ samplequeue_release(ent, &source->sources.sample.samplequeue);
+ break;
+ case ENTROPY_SOURCETYPE_CALLBACK:
+ cbs = &source->sources.callback;
+ if (cbs->start_called && cbs->stopfunc != NULL) {
+ cbs->stopfunc(source, cbs->arg);
+ cbs->start_called = ISC_FALSE;
+ }
+ samplequeue_release(ent, &cbs->samplequeue);
+ break;
+ }
+
+ memset(source, 0, sizeof(isc_entropysource_t));
+
+ isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t));
+}
+
+static inline isc_boolean_t
+destroy_check(isc_entropy_t *ent) {
+ isc_entropysource_t *source;
+
+ if (ent->refcnt > 0)
+ return (ISC_FALSE);
+
+ source = ISC_LIST_HEAD(ent->sources);
+ while (source != NULL) {
+ switch (source->type) {
+ case ENTROPY_SOURCETYPE_FILE:
+ case ENTROPY_SOURCETYPE_USOCKET:
+ break;
+ default:
+ return (ISC_FALSE);
+ }
+ source = ISC_LIST_NEXT(source, link);
+ }
+
+ return (ISC_TRUE);
+}
+
+static void
+destroy(isc_entropy_t **entp) {
+ isc_entropy_t *ent;
+ isc_entropysource_t *source;
+ isc_mem_t *mctx;
+
+ REQUIRE(entp != NULL && *entp != NULL);
+ ent = *entp;
+ *entp = NULL;
+
+ LOCK(&ent->lock);
+
+ REQUIRE(ent->refcnt == 0);
+
+ /*
+ * Here, detach non-sample sources.
+ */
+ source = ISC_LIST_HEAD(ent->sources);
+ while (source != NULL) {
+ switch(source->type) {
+ case ENTROPY_SOURCETYPE_FILE:
+ case ENTROPY_SOURCETYPE_USOCKET:
+ destroysource(&source);
+ break;
+ }
+ source = ISC_LIST_HEAD(ent->sources);
+ }
+
+ /*
+ * If there are other types of sources, we've found a bug.
+ */
+ REQUIRE(ISC_LIST_EMPTY(ent->sources));
+
+ mctx = ent->mctx;
+
+ isc_entropypool_invalidate(&ent->pool);
+
+ UNLOCK(&ent->lock);
+
+ DESTROYLOCK(&ent->lock);
+
+ memset(ent, 0, sizeof(isc_entropy_t));
+ isc_mem_put(mctx, ent, sizeof(isc_entropy_t));
+ isc_mem_detach(&mctx);
+}
+
+void
+isc_entropy_destroysource(isc_entropysource_t **sourcep) {
+ isc_entropysource_t *source;
+ isc_entropy_t *ent;
+ isc_boolean_t killit;
+
+ REQUIRE(sourcep != NULL);
+ REQUIRE(VALID_SOURCE(*sourcep));
+
+ source = *sourcep;
+ *sourcep = NULL;
+
+ ent = source->ent;
+ REQUIRE(VALID_ENTROPY(ent));
+
+ LOCK(&ent->lock);
+
+ destroysource(&source);
+
+ killit = destroy_check(ent);
+
+ UNLOCK(&ent->lock);
+
+ if (killit)
+ destroy(&ent);
+}
+
+isc_result_t
+isc_entropy_createcallbacksource(isc_entropy_t *ent,
+ isc_entropystart_t start,
+ isc_entropyget_t get,
+ isc_entropystop_t stop,
+ void *arg,
+ isc_entropysource_t **sourcep)
+{
+ isc_result_t result;
+ isc_entropysource_t *source;
+ isc_cbsource_t *cbs;
+
+ REQUIRE(VALID_ENTROPY(ent));
+ REQUIRE(get != NULL);
+ REQUIRE(sourcep != NULL && *sourcep == NULL);
+
+ LOCK(&ent->lock);
+
+ source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t));
+ if (source == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto errout;
+ }
+ source->bad = ISC_FALSE;
+
+ cbs = &source->sources.callback;
+
+ result = samplesource_allocate(ent, &cbs->samplequeue);
+ if (result != ISC_R_SUCCESS)
+ goto errout;
+
+ cbs->start_called = ISC_FALSE;
+ cbs->startfunc = start;
+ cbs->getfunc = get;
+ cbs->stopfunc = stop;
+ cbs->arg = arg;
+
+ /*
+ * From here down, no failures can occur.
+ */
+ source->magic = SOURCE_MAGIC;
+ source->type = ENTROPY_SOURCETYPE_CALLBACK;
+ source->ent = ent;
+ source->total = 0;
+ memset(source->name, 0, sizeof(source->name));
+ ISC_LINK_INIT(source, link);
+
+ /*
+ * Hook it into the entropy system.
+ */
+ ISC_LIST_APPEND(ent->sources, source, link);
+ ent->nsources++;
+
+ *sourcep = source;
+
+ UNLOCK(&ent->lock);
+ return (ISC_R_SUCCESS);
+
+ errout:
+ if (source != NULL)
+ isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t));
+
+ UNLOCK(&ent->lock);
+
+ return (result);
+}
+
+void
+isc_entropy_stopcallbacksources(isc_entropy_t *ent) {
+ isc_entropysource_t *source;
+ isc_cbsource_t *cbs;
+
+ REQUIRE(VALID_ENTROPY(ent));
+
+ LOCK(&ent->lock);
+
+ source = ISC_LIST_HEAD(ent->sources);
+ while (source != NULL) {
+ if (source->type == ENTROPY_SOURCETYPE_CALLBACK) {
+ cbs = &source->sources.callback;
+ if (cbs->start_called && cbs->stopfunc != NULL) {
+ cbs->stopfunc(source, cbs->arg);
+ cbs->start_called = ISC_FALSE;
+ }
+ }
+
+ source = ISC_LIST_NEXT(source, link);
+ }
+
+ UNLOCK(&ent->lock);
+}
+
+isc_result_t
+isc_entropy_createsamplesource(isc_entropy_t *ent,
+ isc_entropysource_t **sourcep)
+{
+ isc_result_t result;
+ isc_entropysource_t *source;
+ sample_queue_t *sq;
+
+ REQUIRE(VALID_ENTROPY(ent));
+ REQUIRE(sourcep != NULL && *sourcep == NULL);
+
+ LOCK(&ent->lock);
+
+ source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t));
+ if (source == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto errout;
+ }
+
+ sq = &source->sources.sample.samplequeue;
+ result = samplesource_allocate(ent, sq);
+ if (result != ISC_R_SUCCESS)
+ goto errout;
+
+ /*
+ * From here down, no failures can occur.
+ */
+ source->magic = SOURCE_MAGIC;
+ source->type = ENTROPY_SOURCETYPE_SAMPLE;
+ source->ent = ent;
+ source->total = 0;
+ memset(source->name, 0, sizeof(source->name));
+ ISC_LINK_INIT(source, link);
+
+ /*
+ * Hook it into the entropy system.
+ */
+ ISC_LIST_APPEND(ent->sources, source, link);
+ ent->nsources++;
+
+ *sourcep = source;
+
+ UNLOCK(&ent->lock);
+ return (ISC_R_SUCCESS);
+
+ errout:
+ if (source != NULL)
+ isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t));
+
+ UNLOCK(&ent->lock);
+
+ return (result);
+}
+
+/*!
+ * Add a sample, and return ISC_R_SUCCESS if the queue has become full,
+ * ISC_R_NOENTROPY if it has space remaining, and ISC_R_NOMORE if the
+ * queue was full when this function was called.
+ */
+static isc_result_t
+addsample(sample_queue_t *sq, isc_uint32_t sample, isc_uint32_t extra) {
+ if (sq->nsamples >= RND_EVENTQSIZE)
+ return (ISC_R_NOMORE);
+
+ sq->samples[sq->nsamples] = sample;
+ sq->extra[sq->nsamples] = extra;
+ sq->nsamples++;
+
+ if (sq->nsamples >= RND_EVENTQSIZE)
+ return (ISC_R_QUEUEFULL);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample,
+ isc_uint32_t extra)
+{
+ isc_entropy_t *ent;
+ sample_queue_t *sq;
+ unsigned int entropy;
+ isc_result_t result;
+
+ REQUIRE(VALID_SOURCE(source));
+
+ ent = source->ent;
+
+ LOCK(&ent->lock);
+
+ sq = &source->sources.sample.samplequeue;
+ result = addsample(sq, sample, extra);
+ if (result == ISC_R_QUEUEFULL) {
+ entropy = crunchsamples(ent, sq);
+ add_entropy(ent, entropy);
+ }
+
+ UNLOCK(&ent->lock);
+
+ return (result);
+}
+
+isc_result_t
+isc_entropy_addcallbacksample(isc_entropysource_t *source, isc_uint32_t sample,
+ isc_uint32_t extra)
+{
+ sample_queue_t *sq;
+ isc_result_t result;
+
+ REQUIRE(VALID_SOURCE(source));
+ REQUIRE(source->type == ENTROPY_SOURCETYPE_CALLBACK);
+
+ sq = &source->sources.callback.samplequeue;
+ result = addsample(sq, sample, extra);
+
+ return (result);
+}
+
+void
+isc_entropy_putdata(isc_entropy_t *ent, void *data, unsigned int length,
+ isc_uint32_t entropy)
+{
+ REQUIRE(VALID_ENTROPY(ent));
+
+ LOCK(&ent->lock);
+
+ entropypool_adddata(ent, data, length, entropy);
+
+ if (ent->initialized < THRESHOLD_BITS)
+ ent->initialized = THRESHOLD_BITS;
+
+ UNLOCK(&ent->lock);
+}
+
+static void
+dumpstats(isc_entropy_t *ent, FILE *out) {
+ fprintf(out,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_ENTROPY,
+ ISC_MSG_ENTROPYSTATS,
+ "Entropy pool %p: refcnt %u cursor %u,"
+ " rotate %u entropy %u pseudo %u nsources %u"
+ " nextsource %p initialized %u initcount %u\n"),
+ ent, ent->refcnt,
+ ent->pool.cursor, ent->pool.rotate,
+ ent->pool.entropy, ent->pool.pseudo,
+ ent->nsources, ent->nextsource, ent->initialized,
+ ent->initcount);
+}
+
+/*
+ * This function ignores locking. Use at your own risk.
+ */
+void
+isc_entropy_stats(isc_entropy_t *ent, FILE *out) {
+ REQUIRE(VALID_ENTROPY(ent));
+
+ LOCK(&ent->lock);
+ dumpstats(ent, out);
+ UNLOCK(&ent->lock);
+}
+
+unsigned int
+isc_entropy_status(isc_entropy_t *ent) {
+ unsigned int estimate;
+
+ LOCK(&ent->lock);
+ estimate = ent->pool.entropy;
+ UNLOCK(&ent->lock);
+
+ return estimate;
+}
+
+void
+isc_entropy_attach(isc_entropy_t *ent, isc_entropy_t **entp) {
+ REQUIRE(VALID_ENTROPY(ent));
+ REQUIRE(entp != NULL && *entp == NULL);
+
+ LOCK(&ent->lock);
+
+ ent->refcnt++;
+ *entp = ent;
+
+ UNLOCK(&ent->lock);
+}
+
+void
+isc_entropy_detach(isc_entropy_t **entp) {
+ isc_entropy_t *ent;
+ isc_boolean_t killit;
+
+ REQUIRE(entp != NULL && VALID_ENTROPY(*entp));
+ ent = *entp;
+ *entp = NULL;
+
+ LOCK(&ent->lock);
+
+ REQUIRE(ent->refcnt > 0);
+ ent->refcnt--;
+
+ killit = destroy_check(ent);
+
+ UNLOCK(&ent->lock);
+
+ if (killit)
+ destroy(&ent);
+}
+
+static isc_result_t
+kbdstart(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
+ /*
+ * The intent of "first" is to provide a warning message only once
+ * during the run of a program that might try to gather keyboard
+ * entropy multiple times.
+ */
+ static isc_boolean_t first = ISC_TRUE;
+
+ UNUSED(arg);
+
+ if (! blocking)
+ return (ISC_R_NOENTROPY);
+
+ if (first) {
+ if (source->warn_keyboard)
+ fprintf(stderr, "You must use the keyboard to create "
+ "entropy, since your system is lacking\n"
+ "/dev/random (or equivalent)\n\n");
+ first = ISC_FALSE;
+ }
+ fprintf(stderr, "start typing:\n");
+
+ return (isc_keyboard_open(&source->kbd));
+}
+
+static void
+kbdstop(isc_entropysource_t *source, void *arg) {
+
+ UNUSED(arg);
+
+ if (! isc_keyboard_canceled(&source->kbd))
+ fprintf(stderr, "stop typing.\r\n");
+
+ (void)isc_keyboard_close(&source->kbd, 3);
+}
+
+static isc_result_t
+kbdget(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
+ isc_result_t result;
+ isc_time_t t;
+ isc_uint32_t sample;
+ isc_uint32_t extra;
+ unsigned char c;
+
+ UNUSED(arg);
+
+ if (!blocking)
+ return (ISC_R_NOTBLOCKING);
+
+ result = isc_keyboard_getchar(&source->kbd, &c);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ TIME_NOW(&t);
+
+ sample = isc_time_nanoseconds(&t);
+ extra = c;
+
+ result = isc_entropy_addcallbacksample(source, sample, extra);
+ if (result != ISC_R_SUCCESS) {
+ fprintf(stderr, "\r\n");
+ return (result);
+ }
+
+ fprintf(stderr, ".");
+ fflush(stderr);
+
+ return (result);
+}
+
+isc_result_t
+isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source,
+ const char *randomfile, int use_keyboard)
+{
+ isc_result_t result;
+ isc_result_t final_result = ISC_R_NOENTROPY;
+ isc_boolean_t userfile = ISC_TRUE;
+
+ REQUIRE(VALID_ENTROPY(ectx));
+ REQUIRE(source != NULL && *source == NULL);
+ REQUIRE(use_keyboard == ISC_ENTROPY_KEYBOARDYES ||
+ use_keyboard == ISC_ENTROPY_KEYBOARDNO ||
+ use_keyboard == ISC_ENTROPY_KEYBOARDMAYBE);
+
+#ifdef PATH_RANDOMDEV
+ if (randomfile == NULL) {
+ randomfile = PATH_RANDOMDEV;
+ userfile = ISC_FALSE;
+ }
+#endif
+
+ if (randomfile != NULL && use_keyboard != ISC_ENTROPY_KEYBOARDYES) {
+ result = isc_entropy_createfilesource(ectx, randomfile);
+ if (result == ISC_R_SUCCESS &&
+ use_keyboard == ISC_ENTROPY_KEYBOARDMAYBE)
+ use_keyboard = ISC_ENTROPY_KEYBOARDNO;
+ if (result != ISC_R_SUCCESS && userfile)
+ return (result);
+
+ final_result = result;
+ }
+
+ if (use_keyboard != ISC_ENTROPY_KEYBOARDNO) {
+ result = isc_entropy_createcallbacksource(ectx, kbdstart,
+ kbdget, kbdstop,
+ NULL, source);
+ if (result == ISC_R_SUCCESS)
+ (*source)->warn_keyboard =
+ ISC_TF(use_keyboard ==
+ ISC_ENTROPY_KEYBOARDMAYBE);
+
+ if (final_result != ISC_R_SUCCESS)
+ final_result = result;
+ }
+
+ /*
+ * final_result is ISC_R_SUCCESS if at least one source of entropy
+ * could be started, otherwise it is the error from the most recently
+ * failed operation (or ISC_R_NOENTROPY if PATH_RANDOMDEV is not
+ * defined and use_keyboard is ISC_ENTROPY_KEYBOARDNO).
+ */
+ return (final_result);
+}
diff --git a/lib/isc/error.c b/lib/isc/error.c
new file mode 100644
index 0000000..095100a
--- /dev/null
+++ b/lib/isc/error.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: error.c,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <isc/error.h>
+#include <isc/msgs.h>
+
+/*% Default unexpected callback. */
+static void
+default_unexpected_callback(const char *, int, const char *, va_list)
+ ISC_FORMAT_PRINTF(3, 0);
+
+/*% Default fatal callback. */
+static void
+default_fatal_callback(const char *, int, const char *, va_list)
+ ISC_FORMAT_PRINTF(3, 0);
+
+/*% unexpected_callback */
+static isc_errorcallback_t unexpected_callback = default_unexpected_callback;
+static isc_errorcallback_t fatal_callback = default_fatal_callback;
+
+void
+isc_error_setunexpected(isc_errorcallback_t cb) {
+ if (cb == NULL)
+ unexpected_callback = default_unexpected_callback;
+ else
+ unexpected_callback = cb;
+}
+
+void
+isc_error_setfatal(isc_errorcallback_t cb) {
+ if (cb == NULL)
+ fatal_callback = default_fatal_callback;
+ else
+ fatal_callback = cb;
+}
+
+void
+isc_error_unexpected(const char *file, int line, const char *format, ...) {
+ va_list args;
+
+ va_start(args, format);
+ (unexpected_callback)(file, line, format, args);
+ va_end(args);
+}
+
+void
+isc_error_fatal(const char *file, int line, const char *format, ...) {
+ va_list args;
+
+ va_start(args, format);
+ (fatal_callback)(file, line, format, args);
+ va_end(args);
+ abort();
+}
+
+void
+isc_error_runtimecheck(const char *file, int line, const char *expression) {
+ isc_error_fatal(file, line, "RUNTIME_CHECK(%s) %s", expression,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+}
+
+static void
+default_unexpected_callback(const char *file, int line, const char *format,
+ va_list args)
+{
+ fprintf(stderr, "%s:%d: ", file, line);
+ vfprintf(stderr, format, args);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+}
+
+static void
+default_fatal_callback(const char *file, int line, const char *format,
+ va_list args)
+{
+ fprintf(stderr, "%s:%d: %s: ", file, line,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FATALERROR, "fatal error"));
+ vfprintf(stderr, format, args);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+}
diff --git a/lib/isc/event.c b/lib/isc/event.c
new file mode 100644
index 0000000..8ab7524
--- /dev/null
+++ b/lib/isc/event.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: event.c,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+
+/*!
+ * \file
+ * \author Principal Author: Bob Halley
+ */
+
+#include <config.h>
+
+#include <isc/event.h>
+#include <isc/mem.h>
+#include <isc/util.h>
+
+/***
+ *** Events.
+ ***/
+
+static void
+destroy(isc_event_t *event) {
+ isc_mem_t *mctx = event->ev_destroy_arg;
+
+ isc_mem_put(mctx, event, event->ev_size);
+}
+
+isc_event_t *
+isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type,
+ isc_taskaction_t action, const void *arg, size_t size)
+{
+ isc_event_t *event;
+ void *deconst_arg;
+
+ REQUIRE(size >= sizeof(struct isc_event));
+ REQUIRE(action != NULL);
+
+ event = isc_mem_get(mctx, size);
+ if (event == NULL)
+ return (NULL);
+
+ /*
+ * Removing the const attribute from "arg" is the best of two
+ * evils here. If the event->ev_arg member is made const, then
+ * it affects a great many users of the task/event subsystem
+ * which are not passing in an "arg" which starts its life as
+ * const. Changing isc_event_allocate() and isc_task_onshutdown()
+ * to not have "arg" prototyped as const (which is quite legitimate,
+ * because neither of those functions modify arg) can cause
+ * compiler whining anytime someone does want to use a const
+ * arg that they themselves never modify, such as with
+ * gcc -Wwrite-strings and using a string "arg".
+ */
+ DE_CONST(arg, deconst_arg);
+
+ ISC_EVENT_INIT(event, size, 0, NULL, type, action, deconst_arg,
+ sender, destroy, mctx);
+
+ return (event);
+}
+
+void
+isc_event_free(isc_event_t **eventp) {
+ isc_event_t *event;
+
+ REQUIRE(eventp != NULL);
+ event = *eventp;
+ REQUIRE(event != NULL);
+
+ if (event->ev_destroy != NULL)
+ (event->ev_destroy)(event);
+
+ *eventp = NULL;
+}
diff --git a/lib/isc/fsaccess.c b/lib/isc/fsaccess.c
new file mode 100644
index 0000000..5c97183
--- /dev/null
+++ b/lib/isc/fsaccess.c
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: fsaccess.c,v 1.10 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file
+ * \brief
+ * This file contains the OS-independent functionality of the API.
+ */
+#include <isc/fsaccess.h>
+#include <isc/result.h>
+#include <isc/util.h>
+
+/*!
+ * Shorthand. Maybe ISC__FSACCESS_PERMISSIONBITS should not even be in
+ * <isc/fsaccess.h>. Could check consistency with sizeof(isc_fsaccess_t)
+ * and the number of bits in each function.
+ */
+#define STEP (ISC__FSACCESS_PERMISSIONBITS)
+#define GROUP (STEP)
+#define OTHER (STEP * 2)
+
+void
+isc_fsaccess_add(int trustee, int permission, isc_fsaccess_t *access) {
+ REQUIRE(trustee <= 0x7);
+ REQUIRE(permission <= 0xFF);
+
+ if ((trustee & ISC_FSACCESS_OWNER) != 0)
+ *access |= permission;
+
+ if ((trustee & ISC_FSACCESS_GROUP) != 0)
+ *access |= (permission << GROUP);
+
+ if ((trustee & ISC_FSACCESS_OTHER) != 0)
+ *access |= (permission << OTHER);
+}
+
+void
+isc_fsaccess_remove(int trustee, int permission, isc_fsaccess_t *access) {
+ REQUIRE(trustee <= 0x7);
+ REQUIRE(permission <= 0xFF);
+
+
+ if ((trustee & ISC_FSACCESS_OWNER) != 0)
+ *access &= ~permission;
+
+ if ((trustee & ISC_FSACCESS_GROUP) != 0)
+ *access &= ~(permission << GROUP);
+
+ if ((trustee & ISC_FSACCESS_OTHER) != 0)
+ *access &= ~(permission << OTHER);
+}
+
+static isc_result_t
+check_bad_bits(isc_fsaccess_t access, isc_boolean_t is_dir) {
+ isc_fsaccess_t bits;
+
+ /*
+ * Check for disallowed user bits.
+ */
+ if (is_dir)
+ bits = ISC_FSACCESS_READ |
+ ISC_FSACCESS_WRITE |
+ ISC_FSACCESS_EXECUTE;
+ else
+ bits = ISC_FSACCESS_CREATECHILD |
+ ISC_FSACCESS_ACCESSCHILD |
+ ISC_FSACCESS_DELETECHILD |
+ ISC_FSACCESS_LISTDIRECTORY;
+
+ /*
+ * Set group bad bits.
+ */
+ bits |= bits << STEP;
+ /*
+ * Set other bad bits.
+ */
+ bits |= bits << STEP;
+
+ if ((access & bits) != 0) {
+ if (is_dir)
+ return (ISC_R_NOTFILE);
+ else
+ return (ISC_R_NOTDIRECTORY);
+ }
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/hash.c b/lib/isc/hash.c
new file mode 100644
index 0000000..f1d68c7
--- /dev/null
+++ b/lib/isc/hash.c
@@ -0,0 +1,404 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: hash.c,v 1.16 2009/09/01 00:22:28 jinmei Exp $ */
+
+/*! \file
+ * Some portion of this code was derived from universal hash function
+ * libraries of Rice University.
+\section license UH Universal Hashing Library
+
+Copyright ((c)) 2002, Rice University
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * Neither the name of Rice University (RICE) nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+
+This software is provided by RICE and the contributors on an "as is"
+basis, without any representations or warranties of any kind, express
+or implied including, but not limited to, representations or
+warranties of non-infringement, merchantability or fitness for a
+particular purpose. In no event shall RICE or contributors be liable
+for any direct, indirect, incidental, special, exemplary, or
+consequential damages (including, but not limited to, procurement of
+substitute goods or services; loss of use, data, or profits; or
+business interruption) however caused and on any theory of liability,
+whether in contract, strict liability, or tort (including negligence
+or otherwise) arising in any way out of the use of this software, even
+if advised of the possibility of such damage.
+*/
+
+#include <config.h>
+
+#include <isc/entropy.h>
+#include <isc/hash.h>
+#include <isc/mem.h>
+#include <isc/magic.h>
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/random.h>
+#include <isc/refcount.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+#define HASH_MAGIC ISC_MAGIC('H', 'a', 's', 'h')
+#define VALID_HASH(h) ISC_MAGIC_VALID((h), HASH_MAGIC)
+
+/*%
+ * A large 32-bit prime number that specifies the range of the hash output.
+ */
+#define PRIME32 0xFFFFFFFB /* 2^32 - 5 */
+
+/*@{*/
+/*%
+ * Types of random seed and hash accumulator. Perhaps they can be system
+ * dependent.
+ */
+typedef isc_uint32_t hash_accum_t;
+typedef isc_uint16_t hash_random_t;
+/*@}*/
+
+/*% isc hash structure */
+struct isc_hash {
+ unsigned int magic;
+ isc_mem_t *mctx;
+ isc_mutex_t lock;
+ isc_boolean_t initialized;
+ isc_refcount_t refcnt;
+ isc_entropy_t *entropy; /*%< entropy source */
+ unsigned int limit; /*%< upper limit of key length */
+ size_t vectorlen; /*%< size of the vector below */
+ hash_random_t *rndvector; /*%< random vector for universal hashing */
+};
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_hash_t *hash = NULL;
+
+static unsigned char maptolower[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
+};
+
+isc_result_t
+isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy,
+ unsigned int limit, isc_hash_t **hctxp)
+{
+ isc_result_t result;
+ isc_hash_t *hctx;
+ size_t vlen;
+ hash_random_t *rv;
+ hash_accum_t overflow_limit;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(hctxp != NULL && *hctxp == NULL);
+
+ /*
+ * Overflow check. Since our implementation only does a modulo
+ * operation at the last stage of hash calculation, the accumulator
+ * must not overflow.
+ */
+ overflow_limit =
+ 1 << (((sizeof(hash_accum_t) - sizeof(hash_random_t))) * 8);
+ if (overflow_limit < (limit + 1) * 0xff)
+ return (ISC_R_RANGE);
+
+ hctx = isc_mem_get(mctx, sizeof(isc_hash_t));
+ if (hctx == NULL)
+ return (ISC_R_NOMEMORY);
+
+ vlen = sizeof(hash_random_t) * (limit + 1);
+ rv = isc_mem_get(mctx, vlen);
+ if (rv == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto errout;
+ }
+
+ /*
+ * We need a lock.
+ */
+ result = isc_mutex_init(&hctx->lock);
+ if (result != ISC_R_SUCCESS)
+ goto errout;
+
+ /*
+ * From here down, no failures will/can occur.
+ */
+ hctx->magic = HASH_MAGIC;
+ hctx->mctx = NULL;
+ isc_mem_attach(mctx, &hctx->mctx);
+ hctx->initialized = ISC_FALSE;
+ result = isc_refcount_init(&hctx->refcnt, 1);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup_lock;
+ hctx->entropy = NULL;
+ hctx->limit = limit;
+ hctx->vectorlen = vlen;
+ hctx->rndvector = rv;
+
+#ifdef BIND9
+ if (entropy != NULL)
+ isc_entropy_attach(entropy, &hctx->entropy);
+#else
+ UNUSED(entropy);
+#endif
+
+ *hctxp = hctx;
+ return (ISC_R_SUCCESS);
+
+ cleanup_lock:
+ DESTROYLOCK(&hctx->lock);
+ errout:
+ isc_mem_put(mctx, hctx, sizeof(isc_hash_t));
+ if (rv != NULL)
+ isc_mem_put(mctx, rv, vlen);
+
+ return (result);
+}
+
+static void
+initialize_lock(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(mctx != NULL);
+ INSIST(hash == NULL);
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize_lock) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+
+ if (hash == NULL)
+ result = isc_hash_ctxcreate(mctx, entropy, limit, &hash);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_hash_ctxinit(isc_hash_t *hctx) {
+ LOCK(&hctx->lock);
+
+ if (hctx->initialized == ISC_TRUE)
+ goto out;
+
+ if (hctx->entropy) {
+#ifdef BIND9
+ isc_result_t result;
+
+ result = isc_entropy_getdata(hctx->entropy,
+ hctx->rndvector, hctx->vectorlen,
+ NULL, 0);
+ INSIST(result == ISC_R_SUCCESS);
+#else
+ INSIST(0);
+#endif
+ } else {
+ isc_uint32_t pr;
+ unsigned int i, copylen;
+ unsigned char *p;
+
+ p = (unsigned char *)hctx->rndvector;
+ for (i = 0; i < hctx->vectorlen; i += copylen, p += copylen) {
+ isc_random_get(&pr);
+ if (i + sizeof(pr) <= hctx->vectorlen)
+ copylen = sizeof(pr);
+ else
+ copylen = hctx->vectorlen - i;
+
+ memcpy(p, &pr, copylen);
+ }
+ INSIST(p == (unsigned char *)hctx->rndvector +
+ hctx->vectorlen);
+ }
+
+ hctx->initialized = ISC_TRUE;
+
+ out:
+ UNLOCK(&hctx->lock);
+}
+
+void
+isc_hash_init() {
+ INSIST(hash != NULL && VALID_HASH(hash));
+
+ isc_hash_ctxinit(hash);
+}
+
+void
+isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp) {
+ REQUIRE(VALID_HASH(hctx));
+ REQUIRE(hctxp != NULL && *hctxp == NULL);
+
+ isc_refcount_increment(&hctx->refcnt, NULL);
+ *hctxp = hctx;
+}
+
+static void
+destroy(isc_hash_t **hctxp) {
+ isc_hash_t *hctx;
+ isc_mem_t *mctx;
+ unsigned char canary0[4], canary1[4];
+
+ REQUIRE(hctxp != NULL && *hctxp != NULL);
+ hctx = *hctxp;
+ *hctxp = NULL;
+
+ LOCK(&hctx->lock);
+
+ isc_refcount_destroy(&hctx->refcnt);
+
+ mctx = hctx->mctx;
+#ifdef BIND9
+ if (hctx->entropy != NULL)
+ isc_entropy_detach(&hctx->entropy);
+#endif
+ if (hctx->rndvector != NULL)
+ isc_mem_put(mctx, hctx->rndvector, hctx->vectorlen);
+
+ UNLOCK(&hctx->lock);
+
+ DESTROYLOCK(&hctx->lock);
+
+ memcpy(canary0, hctx + 1, sizeof(canary0));
+ memset(hctx, 0, sizeof(isc_hash_t));
+ memcpy(canary1, hctx + 1, sizeof(canary1));
+ INSIST(memcmp(canary0, canary1, sizeof(canary0)) == 0);
+ isc_mem_put(mctx, hctx, sizeof(isc_hash_t));
+ isc_mem_detach(&mctx);
+}
+
+void
+isc_hash_ctxdetach(isc_hash_t **hctxp) {
+ isc_hash_t *hctx;
+ unsigned int refs;
+
+ REQUIRE(hctxp != NULL && VALID_HASH(*hctxp));
+ hctx = *hctxp;
+
+ isc_refcount_decrement(&hctx->refcnt, &refs);
+ if (refs == 0)
+ destroy(&hctx);
+
+ *hctxp = NULL;
+}
+
+void
+isc_hash_destroy() {
+ unsigned int refs;
+
+ INSIST(hash != NULL && VALID_HASH(hash));
+
+ isc_refcount_decrement(&hash->refcnt, &refs);
+ INSIST(refs == 0);
+
+ destroy(&hash);
+}
+
+static inline unsigned int
+hash_calc(isc_hash_t *hctx, const unsigned char *key, unsigned int keylen,
+ isc_boolean_t case_sensitive)
+{
+ hash_accum_t partial_sum = 0;
+ hash_random_t *p = hctx->rndvector;
+ unsigned int i = 0;
+
+ /* Make it sure that the hash context is initialized. */
+ if (hctx->initialized == ISC_FALSE)
+ isc_hash_ctxinit(hctx);
+
+ if (case_sensitive) {
+ for (i = 0; i < keylen; i++)
+ partial_sum += key[i] * (hash_accum_t)p[i];
+ } else {
+ for (i = 0; i < keylen; i++)
+ partial_sum += maptolower[key[i]] * (hash_accum_t)p[i];
+ }
+
+ partial_sum += p[i];
+
+ return ((unsigned int)(partial_sum % PRIME32));
+}
+
+unsigned int
+isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key,
+ unsigned int keylen, isc_boolean_t case_sensitive)
+{
+ REQUIRE(hctx != NULL && VALID_HASH(hctx));
+ REQUIRE(keylen <= hctx->limit);
+
+ return (hash_calc(hctx, key, keylen, case_sensitive));
+}
+
+unsigned int
+isc_hash_calc(const unsigned char *key, unsigned int keylen,
+ isc_boolean_t case_sensitive)
+{
+ INSIST(hash != NULL && VALID_HASH(hash));
+ REQUIRE(keylen <= hash->limit);
+
+ return (hash_calc(hash, key, keylen, case_sensitive));
+}
diff --git a/lib/isc/heap.c b/lib/isc/heap.c
new file mode 100644
index 0000000..ebadd2f
--- /dev/null
+++ b/lib/isc/heap.c
@@ -0,0 +1,265 @@
+/*
+ * Copyright (C) 2004-2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file
+ * Heap implementation of priority queues adapted from the following:
+ *
+ * \li "Introduction to Algorithms," Cormen, Leiserson, and Rivest,
+ * MIT Press / McGraw Hill, 1990, ISBN 0-262-03141-8, chapter 7.
+ *
+ * \li "Algorithms," Second Edition, Sedgewick, Addison-Wesley, 1988,
+ * ISBN 0-201-06673-4, chapter 11.
+ */
+
+#include <config.h>
+
+#include <isc/heap.h>
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/string.h> /* Required for memcpy. */
+#include <isc/util.h>
+
+/*@{*/
+/*%
+ * Note: to make heap_parent and heap_left easy to compute, the first
+ * element of the heap array is not used; i.e. heap subscripts are 1-based,
+ * not 0-based. The parent is index/2, and the left-child is index*2.
+ * The right child is index*2+1.
+ */
+#define heap_parent(i) ((i) >> 1)
+#define heap_left(i) ((i) << 1)
+/*@}*/
+
+#define SIZE_INCREMENT 1024
+
+#define HEAP_MAGIC ISC_MAGIC('H', 'E', 'A', 'P')
+#define VALID_HEAP(h) ISC_MAGIC_VALID(h, HEAP_MAGIC)
+
+/*%
+ * When the heap is in a consistent state, the following invariant
+ * holds true: for every element i > 1, heap_parent(i) has a priority
+ * higher than or equal to that of i.
+ */
+#define HEAPCONDITION(i) ((i) == 1 || \
+ ! heap->compare(heap->array[(i)], \
+ heap->array[heap_parent(i)]))
+
+/*% ISC heap structure. */
+struct isc_heap {
+ unsigned int magic;
+ isc_mem_t * mctx;
+ unsigned int size;
+ unsigned int size_increment;
+ unsigned int last;
+ void **array;
+ isc_heapcompare_t compare;
+ isc_heapindex_t index;
+};
+
+isc_result_t
+isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
+ isc_heapindex_t index, unsigned int size_increment,
+ isc_heap_t **heapp)
+{
+ isc_heap_t *heap;
+
+ REQUIRE(heapp != NULL && *heapp == NULL);
+ REQUIRE(compare != NULL);
+
+ heap = isc_mem_get(mctx, sizeof(*heap));
+ if (heap == NULL)
+ return (ISC_R_NOMEMORY);
+ heap->magic = HEAP_MAGIC;
+ heap->size = 0;
+ heap->mctx = NULL;
+ isc_mem_attach(mctx, &heap->mctx);
+ if (size_increment == 0)
+ heap->size_increment = SIZE_INCREMENT;
+ else
+ heap->size_increment = size_increment;
+ heap->last = 0;
+ heap->array = NULL;
+ heap->compare = compare;
+ heap->index = index;
+
+ *heapp = heap;
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_heap_destroy(isc_heap_t **heapp) {
+ isc_heap_t *heap;
+
+ REQUIRE(heapp != NULL);
+ heap = *heapp;
+ REQUIRE(VALID_HEAP(heap));
+
+ if (heap->array != NULL)
+ isc_mem_put(heap->mctx, heap->array,
+ heap->size * sizeof(void *));
+ heap->magic = 0;
+ isc_mem_putanddetach(&heap->mctx, heap, sizeof(*heap));
+
+ *heapp = NULL;
+}
+
+static isc_boolean_t
+resize(isc_heap_t *heap) {
+ void **new_array;
+ size_t new_size;
+
+ REQUIRE(VALID_HEAP(heap));
+
+ new_size = heap->size + heap->size_increment;
+ new_array = isc_mem_get(heap->mctx, new_size * sizeof(void *));
+ if (new_array == NULL)
+ return (ISC_FALSE);
+ if (heap->array != NULL) {
+ memcpy(new_array, heap->array, heap->size * sizeof(void *));
+ isc_mem_put(heap->mctx, heap->array,
+ heap->size * sizeof(void *));
+ }
+ heap->size = new_size;
+ heap->array = new_array;
+
+ return (ISC_TRUE);
+}
+
+static void
+float_up(isc_heap_t *heap, unsigned int i, void *elt) {
+ unsigned int p;
+
+ for (p = heap_parent(i) ;
+ i > 1 && heap->compare(elt, heap->array[p]) ;
+ i = p, p = heap_parent(i)) {
+ heap->array[i] = heap->array[p];
+ if (heap->index != NULL)
+ (heap->index)(heap->array[i], i);
+ }
+ heap->array[i] = elt;
+ if (heap->index != NULL)
+ (heap->index)(heap->array[i], i);
+
+ INSIST(HEAPCONDITION(i));
+}
+
+static void
+sink_down(isc_heap_t *heap, unsigned int i, void *elt) {
+ unsigned int j, size, half_size;
+ size = heap->last;
+ half_size = size / 2;
+ while (i <= half_size) {
+ /* Find the smallest of the (at most) two children. */
+ j = heap_left(i);
+ if (j < size && heap->compare(heap->array[j+1],
+ heap->array[j]))
+ j++;
+ if (heap->compare(elt, heap->array[j]))
+ break;
+ heap->array[i] = heap->array[j];
+ if (heap->index != NULL)
+ (heap->index)(heap->array[i], i);
+ i = j;
+ }
+ heap->array[i] = elt;
+ if (heap->index != NULL)
+ (heap->index)(heap->array[i], i);
+
+ INSIST(HEAPCONDITION(i));
+}
+
+isc_result_t
+isc_heap_insert(isc_heap_t *heap, void *elt) {
+ unsigned int new_last;
+
+ REQUIRE(VALID_HEAP(heap));
+
+ new_last = heap->last + 1;
+ RUNTIME_CHECK(new_last > 0); /* overflow check */
+ if (new_last >= heap->size && !resize(heap))
+ return (ISC_R_NOMEMORY);
+ heap->last = new_last;
+
+ float_up(heap, new_last, elt);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_heap_delete(isc_heap_t *heap, unsigned int index) {
+ void *elt;
+ isc_boolean_t less;
+
+ REQUIRE(VALID_HEAP(heap));
+ REQUIRE(index >= 1 && index <= heap->last);
+
+ if (index == heap->last) {
+ heap->array[heap->last] = NULL;
+ heap->last--;
+ } else {
+ elt = heap->array[heap->last];
+ heap->array[heap->last] = NULL;
+ heap->last--;
+
+ less = heap->compare(elt, heap->array[index]);
+ heap->array[index] = elt;
+ if (less)
+ float_up(heap, index, heap->array[index]);
+ else
+ sink_down(heap, index, heap->array[index]);
+ }
+}
+
+void
+isc_heap_increased(isc_heap_t *heap, unsigned int index) {
+ REQUIRE(VALID_HEAP(heap));
+ REQUIRE(index >= 1 && index <= heap->last);
+
+ float_up(heap, index, heap->array[index]);
+}
+
+void
+isc_heap_decreased(isc_heap_t *heap, unsigned int index) {
+ REQUIRE(VALID_HEAP(heap));
+ REQUIRE(index >= 1 && index <= heap->last);
+
+ sink_down(heap, index, heap->array[index]);
+}
+
+void *
+isc_heap_element(isc_heap_t *heap, unsigned int index) {
+ REQUIRE(VALID_HEAP(heap));
+ REQUIRE(index >= 1);
+
+ if (index <= heap->last)
+ return (heap->array[index]);
+ return (NULL);
+}
+
+void
+isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap) {
+ unsigned int i;
+
+ REQUIRE(VALID_HEAP(heap));
+ REQUIRE(action != NULL);
+
+ for (i = 1 ; i <= heap->last ; i++)
+ (action)(heap->array[i], uap);
+}
diff --git a/lib/isc/hex.c b/lib/isc/hex.c
new file mode 100644
index 0000000..3fa0e69
--- /dev/null
+++ b/lib/isc/hex.c
@@ -0,0 +1,201 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: hex.c,v 1.20 2008/09/25 04:02:39 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <ctype.h>
+
+#include <isc/buffer.h>
+#include <isc/hex.h>
+#include <isc/lex.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+#define RETERR(x) do { \
+ isc_result_t _r = (x); \
+ if (_r != ISC_R_SUCCESS) \
+ return (_r); \
+ } while (0)
+
+
+/*
+ * BEW: These static functions are copied from lib/dns/rdata.c.
+ */
+static isc_result_t
+str_totext(const char *source, isc_buffer_t *target);
+
+static isc_result_t
+mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length);
+
+static const char hex[] = "0123456789ABCDEF";
+
+isc_result_t
+isc_hex_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target)
+{
+ char buf[3];
+ unsigned int loops = 0;
+
+ if (wordlength < 2)
+ wordlength = 2;
+
+ memset(buf, 0, sizeof(buf));
+ while (source->length > 0) {
+ buf[0] = hex[(source->base[0] >> 4) & 0xf];
+ buf[1] = hex[(source->base[0]) & 0xf];
+ RETERR(str_totext(buf, target));
+ isc_region_consume(source, 1);
+
+ loops++;
+ if (source->length != 0 &&
+ (int)((loops + 1) * 2) >= wordlength)
+ {
+ loops = 0;
+ RETERR(str_totext(wordbreak, target));
+ }
+ }
+ return (ISC_R_SUCCESS);
+}
+
+/*%
+ * State of a hex decoding process in progress.
+ */
+typedef struct {
+ int length; /*%< Desired length of binary data or -1 */
+ isc_buffer_t *target; /*%< Buffer for resulting binary data */
+ int digits; /*%< Number of buffered hex digits */
+ int val[2];
+} hex_decode_ctx_t;
+
+static inline void
+hex_decode_init(hex_decode_ctx_t *ctx, int length, isc_buffer_t *target)
+{
+ ctx->digits = 0;
+ ctx->length = length;
+ ctx->target = target;
+}
+
+static inline isc_result_t
+hex_decode_char(hex_decode_ctx_t *ctx, int c) {
+ char *s;
+
+ if ((s = strchr(hex, toupper(c))) == NULL)
+ return (ISC_R_BADHEX);
+ ctx->val[ctx->digits++] = s - hex;
+ if (ctx->digits == 2) {
+ unsigned char num;
+
+ num = (ctx->val[0] << 4) + (ctx->val[1]);
+ RETERR(mem_tobuffer(ctx->target, &num, 1));
+ if (ctx->length >= 0) {
+ if (ctx->length == 0)
+ return (ISC_R_BADHEX);
+ else
+ ctx->length -= 1;
+ }
+ ctx->digits = 0;
+ }
+ return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+hex_decode_finish(hex_decode_ctx_t *ctx) {
+ if (ctx->length > 0)
+ return (ISC_R_UNEXPECTEDEND);
+ if (ctx->digits != 0)
+ return (ISC_R_BADHEX);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
+ hex_decode_ctx_t ctx;
+ isc_textregion_t *tr;
+ isc_token_t token;
+ isc_boolean_t eol;
+
+ hex_decode_init(&ctx, length, target);
+
+ while (ctx.length != 0) {
+ unsigned int i;
+
+ if (length > 0)
+ eol = ISC_FALSE;
+ else
+ eol = ISC_TRUE;
+ RETERR(isc_lex_getmastertoken(lexer, &token,
+ isc_tokentype_string, eol));
+ if (token.type != isc_tokentype_string)
+ break;
+ tr = &token.value.as_textregion;
+ for (i = 0; i < tr->length; i++)
+ RETERR(hex_decode_char(&ctx, tr->base[i]));
+ }
+ if (ctx.length < 0)
+ isc_lex_ungettoken(lexer, &token);
+ RETERR(hex_decode_finish(&ctx));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_hex_decodestring(const char *cstr, isc_buffer_t *target) {
+ hex_decode_ctx_t ctx;
+
+ hex_decode_init(&ctx, -1, target);
+ for (;;) {
+ int c = *cstr++;
+ if (c == '\0')
+ break;
+ if (c == ' ' || c == '\t' || c == '\n' || c== '\r')
+ continue;
+ RETERR(hex_decode_char(&ctx, c));
+ }
+ RETERR(hex_decode_finish(&ctx));
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+str_totext(const char *source, isc_buffer_t *target) {
+ unsigned int l;
+ isc_region_t region;
+
+ isc_buffer_availableregion(target, &region);
+ l = strlen(source);
+
+ if (l > region.length)
+ return (ISC_R_NOSPACE);
+
+ memcpy(region.base, source, l);
+ isc_buffer_add(target, l);
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
+ isc_region_t tr;
+
+ isc_buffer_availableregion(target, &tr);
+ if (length > tr.length)
+ return (ISC_R_NOSPACE);
+ memcpy(tr.base, base, length);
+ isc_buffer_add(target, length);
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/hmacmd5.c b/lib/isc/hmacmd5.c
new file mode 100644
index 0000000..6abe6e2
--- /dev/null
+++ b/lib/isc/hmacmd5.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: hmacmd5.c,v 1.16 2009/02/06 23:47:42 tbox Exp $ */
+
+/*! \file
+ * This code implements the HMAC-MD5 keyed hash algorithm
+ * described in RFC2104.
+ */
+
+#include "config.h"
+
+#include <isc/assertions.h>
+#include <isc/hmacmd5.h>
+#include <isc/md5.h>
+#include <isc/platform.h>
+#include <isc/string.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+
+void
+isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ HMAC_Init(ctx, (const void *) key, (int) len, EVP_md5());
+}
+
+void
+isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx) {
+ HMAC_CTX_cleanup(ctx);
+}
+
+void
+isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ HMAC_Update(ctx, buf, (int) len);
+}
+
+void
+isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest) {
+ HMAC_Final(ctx, digest, NULL);
+ HMAC_CTX_cleanup(ctx);
+}
+
+#else
+
+#define PADLEN 64
+#define IPAD 0x36
+#define OPAD 0x5C
+
+/*!
+ * Start HMAC-MD5 process. Initialize an md5 context and digest the key.
+ */
+void
+isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ unsigned char ipad[PADLEN];
+ int i;
+
+ memset(ctx->key, 0, sizeof(ctx->key));
+ if (len > sizeof(ctx->key)) {
+ isc_md5_t md5ctx;
+ isc_md5_init(&md5ctx);
+ isc_md5_update(&md5ctx, key, len);
+ isc_md5_final(&md5ctx, ctx->key);
+ } else
+ memcpy(ctx->key, key, len);
+
+ isc_md5_init(&ctx->md5ctx);
+ memset(ipad, IPAD, sizeof(ipad));
+ for (i = 0; i < PADLEN; i++)
+ ipad[i] ^= ctx->key[i];
+ isc_md5_update(&ctx->md5ctx, ipad, sizeof(ipad));
+}
+
+void
+isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx) {
+ isc_md5_invalidate(&ctx->md5ctx);
+ memset(ctx->key, 0, sizeof(ctx->key));
+}
+
+/*!
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ isc_md5_update(&ctx->md5ctx, buf, len);
+}
+
+/*!
+ * Compute signature - finalize MD5 operation and reapply MD5.
+ */
+void
+isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest) {
+ unsigned char opad[PADLEN];
+ int i;
+
+ isc_md5_final(&ctx->md5ctx, digest);
+
+ memset(opad, OPAD, sizeof(opad));
+ for (i = 0; i < PADLEN; i++)
+ opad[i] ^= ctx->key[i];
+
+ isc_md5_init(&ctx->md5ctx);
+ isc_md5_update(&ctx->md5ctx, opad, sizeof(opad));
+ isc_md5_update(&ctx->md5ctx, digest, ISC_MD5_DIGESTLENGTH);
+ isc_md5_final(&ctx->md5ctx, digest);
+ isc_hmacmd5_invalidate(ctx);
+}
+#endif /* !ISC_PLATFORM_OPENSSLHASH */
+
+/*!
+ * Verify signature - finalize MD5 operation and reapply MD5, then
+ * compare to the supplied digest.
+ */
+isc_boolean_t
+isc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest) {
+ return (isc_hmacmd5_verify2(ctx, digest, ISC_MD5_DIGESTLENGTH));
+}
+
+isc_boolean_t
+isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_MD5_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_MD5_DIGESTLENGTH);
+ isc_hmacmd5_sign(ctx, newdigest);
+ return (ISC_TF(memcmp(digest, newdigest, len) == 0));
+}
diff --git a/lib/isc/hmacsha.c b/lib/isc/hmacsha.c
new file mode 100644
index 0000000..d7b9f18
--- /dev/null
+++ b/lib/isc/hmacsha.c
@@ -0,0 +1,594 @@
+/*
+ * Copyright (C) 2005-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*
+ * This code implements the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384
+ * and HMAC-SHA512 keyed hash algorithm described in RFC 2104 and
+ * draft-ietf-dnsext-tsig-sha-01.txt.
+ */
+
+#include "config.h"
+
+#include <isc/assertions.h>
+#include <isc/hmacsha.h>
+#include <isc/platform.h>
+#include <isc/sha1.h>
+#include <isc/sha2.h>
+#include <isc/string.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+
+void
+isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha1());
+}
+
+void
+isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) {
+ HMAC_CTX_cleanup(ctx);
+}
+
+void
+isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ HMAC_Update(ctx, buf, (int) len);
+}
+
+void
+isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA1_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA1_DIGESTLENGTH);
+
+ HMAC_Final(ctx, newdigest, NULL);
+ HMAC_CTX_cleanup(ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+void
+isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha224());
+}
+
+void
+isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) {
+ HMAC_CTX_cleanup(ctx);
+}
+
+void
+isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ HMAC_Update(ctx, buf, (int) len);
+}
+
+void
+isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA224_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA224_DIGESTLENGTH);
+
+ HMAC_Final(ctx, newdigest, NULL);
+ HMAC_CTX_cleanup(ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+void
+isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha256());
+}
+
+void
+isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) {
+ HMAC_CTX_cleanup(ctx);
+}
+
+void
+isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ HMAC_Update(ctx, buf, (int) len);
+}
+
+void
+isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA256_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA256_DIGESTLENGTH);
+
+ HMAC_Final(ctx, newdigest, NULL);
+ HMAC_CTX_cleanup(ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+void
+isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha384());
+}
+
+void
+isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) {
+ HMAC_CTX_cleanup(ctx);
+}
+
+void
+isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ HMAC_Update(ctx, buf, (int) len);
+}
+
+void
+isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA384_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA384_DIGESTLENGTH);
+
+ HMAC_Final(ctx, newdigest, NULL);
+ HMAC_CTX_cleanup(ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+void
+isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ HMAC_Init(ctx, (const void *) key, (int) len, EVP_sha512());
+}
+
+void
+isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) {
+ HMAC_CTX_cleanup(ctx);
+}
+
+void
+isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ HMAC_Update(ctx, buf, (int) len);
+}
+
+void
+isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA512_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA512_DIGESTLENGTH);
+
+ HMAC_Final(ctx, newdigest, NULL);
+ HMAC_CTX_cleanup(ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+#else
+
+#define IPAD 0x36
+#define OPAD 0x5C
+
+/*
+ * Start HMAC-SHA1 process. Initialize an sha1 context and digest the key.
+ */
+void
+isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ unsigned char ipad[ISC_SHA1_BLOCK_LENGTH];
+ unsigned int i;
+
+ memset(ctx->key, 0, sizeof(ctx->key));
+ if (len > sizeof(ctx->key)) {
+ isc_sha1_t sha1ctx;
+ isc_sha1_init(&sha1ctx);
+ isc_sha1_update(&sha1ctx, key, len);
+ isc_sha1_final(&sha1ctx, ctx->key);
+ } else
+ memcpy(ctx->key, key, len);
+
+ isc_sha1_init(&ctx->sha1ctx);
+ memset(ipad, IPAD, sizeof(ipad));
+ for (i = 0; i < ISC_SHA1_BLOCK_LENGTH; i++)
+ ipad[i] ^= ctx->key[i];
+ isc_sha1_update(&ctx->sha1ctx, ipad, sizeof(ipad));
+}
+
+void
+isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) {
+ isc_sha1_invalidate(&ctx->sha1ctx);
+ memset(ctx, 0, sizeof(*ctx));
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ isc_sha1_update(&ctx->sha1ctx, buf, len);
+}
+
+/*
+ * Compute signature - finalize SHA1 operation and reapply SHA1.
+ */
+void
+isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char opad[ISC_SHA1_BLOCK_LENGTH];
+ unsigned char newdigest[ISC_SHA1_DIGESTLENGTH];
+ unsigned int i;
+
+ REQUIRE(len <= ISC_SHA1_DIGESTLENGTH);
+ isc_sha1_final(&ctx->sha1ctx, newdigest);
+
+ memset(opad, OPAD, sizeof(opad));
+ for (i = 0; i < ISC_SHA1_BLOCK_LENGTH; i++)
+ opad[i] ^= ctx->key[i];
+
+ isc_sha1_init(&ctx->sha1ctx);
+ isc_sha1_update(&ctx->sha1ctx, opad, sizeof(opad));
+ isc_sha1_update(&ctx->sha1ctx, newdigest, ISC_SHA1_DIGESTLENGTH);
+ isc_sha1_final(&ctx->sha1ctx, newdigest);
+ isc_hmacsha1_invalidate(ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+/*
+ * Start HMAC-SHA224 process. Initialize an sha224 context and digest the key.
+ */
+void
+isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ unsigned char ipad[ISC_SHA224_BLOCK_LENGTH];
+ unsigned int i;
+
+ memset(ctx->key, 0, sizeof(ctx->key));
+ if (len > sizeof(ctx->key)) {
+ isc_sha224_t sha224ctx;
+ isc_sha224_init(&sha224ctx);
+ isc_sha224_update(&sha224ctx, key, len);
+ isc_sha224_final(ctx->key, &sha224ctx);
+ } else
+ memcpy(ctx->key, key, len);
+
+ isc_sha224_init(&ctx->sha224ctx);
+ memset(ipad, IPAD, sizeof(ipad));
+ for (i = 0; i < ISC_SHA224_BLOCK_LENGTH; i++)
+ ipad[i] ^= ctx->key[i];
+ isc_sha224_update(&ctx->sha224ctx, ipad, sizeof(ipad));
+}
+
+void
+isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) {
+ memset(ctx, 0, sizeof(*ctx));
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ isc_sha224_update(&ctx->sha224ctx, buf, len);
+}
+
+/*
+ * Compute signature - finalize SHA224 operation and reapply SHA224.
+ */
+void
+isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char opad[ISC_SHA224_BLOCK_LENGTH];
+ unsigned char newdigest[ISC_SHA224_DIGESTLENGTH];
+ unsigned int i;
+
+ REQUIRE(len <= ISC_SHA224_DIGESTLENGTH);
+ isc_sha224_final(newdigest, &ctx->sha224ctx);
+
+ memset(opad, OPAD, sizeof(opad));
+ for (i = 0; i < ISC_SHA224_BLOCK_LENGTH; i++)
+ opad[i] ^= ctx->key[i];
+
+ isc_sha224_init(&ctx->sha224ctx);
+ isc_sha224_update(&ctx->sha224ctx, opad, sizeof(opad));
+ isc_sha224_update(&ctx->sha224ctx, newdigest, ISC_SHA224_DIGESTLENGTH);
+ isc_sha224_final(newdigest, &ctx->sha224ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+/*
+ * Start HMAC-SHA256 process. Initialize an sha256 context and digest the key.
+ */
+void
+isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ unsigned char ipad[ISC_SHA256_BLOCK_LENGTH];
+ unsigned int i;
+
+ memset(ctx->key, 0, sizeof(ctx->key));
+ if (len > sizeof(ctx->key)) {
+ isc_sha256_t sha256ctx;
+ isc_sha256_init(&sha256ctx);
+ isc_sha256_update(&sha256ctx, key, len);
+ isc_sha256_final(ctx->key, &sha256ctx);
+ } else
+ memcpy(ctx->key, key, len);
+
+ isc_sha256_init(&ctx->sha256ctx);
+ memset(ipad, IPAD, sizeof(ipad));
+ for (i = 0; i < ISC_SHA256_BLOCK_LENGTH; i++)
+ ipad[i] ^= ctx->key[i];
+ isc_sha256_update(&ctx->sha256ctx, ipad, sizeof(ipad));
+}
+
+void
+isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) {
+ memset(ctx, 0, sizeof(*ctx));
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ isc_sha256_update(&ctx->sha256ctx, buf, len);
+}
+
+/*
+ * Compute signature - finalize SHA256 operation and reapply SHA256.
+ */
+void
+isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char opad[ISC_SHA256_BLOCK_LENGTH];
+ unsigned char newdigest[ISC_SHA256_DIGESTLENGTH];
+ unsigned int i;
+
+ REQUIRE(len <= ISC_SHA256_DIGESTLENGTH);
+ isc_sha256_final(newdigest, &ctx->sha256ctx);
+
+ memset(opad, OPAD, sizeof(opad));
+ for (i = 0; i < ISC_SHA256_BLOCK_LENGTH; i++)
+ opad[i] ^= ctx->key[i];
+
+ isc_sha256_init(&ctx->sha256ctx);
+ isc_sha256_update(&ctx->sha256ctx, opad, sizeof(opad));
+ isc_sha256_update(&ctx->sha256ctx, newdigest, ISC_SHA256_DIGESTLENGTH);
+ isc_sha256_final(newdigest, &ctx->sha256ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+/*
+ * Start HMAC-SHA384 process. Initialize an sha384 context and digest the key.
+ */
+void
+isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ unsigned char ipad[ISC_SHA384_BLOCK_LENGTH];
+ unsigned int i;
+
+ memset(ctx->key, 0, sizeof(ctx->key));
+ if (len > sizeof(ctx->key)) {
+ isc_sha384_t sha384ctx;
+ isc_sha384_init(&sha384ctx);
+ isc_sha384_update(&sha384ctx, key, len);
+ isc_sha384_final(ctx->key, &sha384ctx);
+ } else
+ memcpy(ctx->key, key, len);
+
+ isc_sha384_init(&ctx->sha384ctx);
+ memset(ipad, IPAD, sizeof(ipad));
+ for (i = 0; i < ISC_SHA384_BLOCK_LENGTH; i++)
+ ipad[i] ^= ctx->key[i];
+ isc_sha384_update(&ctx->sha384ctx, ipad, sizeof(ipad));
+}
+
+void
+isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) {
+ memset(ctx, 0, sizeof(*ctx));
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ isc_sha384_update(&ctx->sha384ctx, buf, len);
+}
+
+/*
+ * Compute signature - finalize SHA384 operation and reapply SHA384.
+ */
+void
+isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char opad[ISC_SHA384_BLOCK_LENGTH];
+ unsigned char newdigest[ISC_SHA384_DIGESTLENGTH];
+ unsigned int i;
+
+ REQUIRE(len <= ISC_SHA384_DIGESTLENGTH);
+ isc_sha384_final(newdigest, &ctx->sha384ctx);
+
+ memset(opad, OPAD, sizeof(opad));
+ for (i = 0; i < ISC_SHA384_BLOCK_LENGTH; i++)
+ opad[i] ^= ctx->key[i];
+
+ isc_sha384_init(&ctx->sha384ctx);
+ isc_sha384_update(&ctx->sha384ctx, opad, sizeof(opad));
+ isc_sha384_update(&ctx->sha384ctx, newdigest, ISC_SHA384_DIGESTLENGTH);
+ isc_sha384_final(newdigest, &ctx->sha384ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+
+/*
+ * Start HMAC-SHA512 process. Initialize an sha512 context and digest the key.
+ */
+void
+isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key,
+ unsigned int len)
+{
+ unsigned char ipad[ISC_SHA512_BLOCK_LENGTH];
+ unsigned int i;
+
+ memset(ctx->key, 0, sizeof(ctx->key));
+ if (len > sizeof(ctx->key)) {
+ isc_sha512_t sha512ctx;
+ isc_sha512_init(&sha512ctx);
+ isc_sha512_update(&sha512ctx, key, len);
+ isc_sha512_final(ctx->key, &sha512ctx);
+ } else
+ memcpy(ctx->key, key, len);
+
+ isc_sha512_init(&ctx->sha512ctx);
+ memset(ipad, IPAD, sizeof(ipad));
+ for (i = 0; i < ISC_SHA512_BLOCK_LENGTH; i++)
+ ipad[i] ^= ctx->key[i];
+ isc_sha512_update(&ctx->sha512ctx, ipad, sizeof(ipad));
+}
+
+void
+isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) {
+ memset(ctx, 0, sizeof(*ctx));
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf,
+ unsigned int len)
+{
+ isc_sha512_update(&ctx->sha512ctx, buf, len);
+}
+
+/*
+ * Compute signature - finalize SHA512 operation and reapply SHA512.
+ */
+void
+isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char opad[ISC_SHA512_BLOCK_LENGTH];
+ unsigned char newdigest[ISC_SHA512_DIGESTLENGTH];
+ unsigned int i;
+
+ REQUIRE(len <= ISC_SHA512_DIGESTLENGTH);
+ isc_sha512_final(newdigest, &ctx->sha512ctx);
+
+ memset(opad, OPAD, sizeof(opad));
+ for (i = 0; i < ISC_SHA512_BLOCK_LENGTH; i++)
+ opad[i] ^= ctx->key[i];
+
+ isc_sha512_init(&ctx->sha512ctx);
+ isc_sha512_update(&ctx->sha512ctx, opad, sizeof(opad));
+ isc_sha512_update(&ctx->sha512ctx, newdigest, ISC_SHA512_DIGESTLENGTH);
+ isc_sha512_final(newdigest, &ctx->sha512ctx);
+ memcpy(digest, newdigest, len);
+ memset(newdigest, 0, sizeof(newdigest));
+}
+#endif /* !ISC_PLATFORM_OPENSSLHASH */
+
+/*
+ * Verify signature - finalize SHA1 operation and reapply SHA1, then
+ * compare to the supplied digest.
+ */
+isc_boolean_t
+isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA1_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA1_DIGESTLENGTH);
+ isc_hmacsha1_sign(ctx, newdigest, ISC_SHA1_DIGESTLENGTH);
+ return (ISC_TF(memcmp(digest, newdigest, len) == 0));
+}
+
+/*
+ * Verify signature - finalize SHA224 operation and reapply SHA224, then
+ * compare to the supplied digest.
+ */
+isc_boolean_t
+isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA224_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA224_DIGESTLENGTH);
+ isc_hmacsha224_sign(ctx, newdigest, ISC_SHA224_DIGESTLENGTH);
+ return (ISC_TF(memcmp(digest, newdigest, len) == 0));
+}
+
+/*
+ * Verify signature - finalize SHA256 operation and reapply SHA256, then
+ * compare to the supplied digest.
+ */
+isc_boolean_t
+isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA256_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA256_DIGESTLENGTH);
+ isc_hmacsha256_sign(ctx, newdigest, ISC_SHA256_DIGESTLENGTH);
+ return (ISC_TF(memcmp(digest, newdigest, len) == 0));
+}
+
+/*
+ * Verify signature - finalize SHA384 operation and reapply SHA384, then
+ * compare to the supplied digest.
+ */
+isc_boolean_t
+isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA384_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA384_DIGESTLENGTH);
+ isc_hmacsha384_sign(ctx, newdigest, ISC_SHA384_DIGESTLENGTH);
+ return (ISC_TF(memcmp(digest, newdigest, len) == 0));
+}
+
+/*
+ * Verify signature - finalize SHA512 operation and reapply SHA512, then
+ * compare to the supplied digest.
+ */
+isc_boolean_t
+isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len) {
+ unsigned char newdigest[ISC_SHA512_DIGESTLENGTH];
+
+ REQUIRE(len <= ISC_SHA512_DIGESTLENGTH);
+ isc_hmacsha512_sign(ctx, newdigest, ISC_SHA512_DIGESTLENGTH);
+ return (ISC_TF(memcmp(digest, newdigest, len) == 0));
+}
diff --git a/lib/isc/httpd.c b/lib/isc/httpd.c
new file mode 100644
index 0000000..16a8c9f
--- /dev/null
+++ b/lib/isc/httpd.c
@@ -0,0 +1,1028 @@
+/*
+ * Copyright (C) 2006-2008, 2010-2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/buffer.h>
+#include <isc/httpd.h>
+#include <isc/mem.h>
+#include <isc/socket.h>
+#include <isc/string.h>
+#include <isc/task.h>
+#include <isc/util.h>
+
+#include <string.h>
+
+/*%
+ * TODO:
+ *
+ * o Put in better checks to make certain things are passed in correctly.
+ * This includes a magic number for externally-visible structures,
+ * checking for NULL-ness before dereferencing, etc.
+ * o Make the URL processing external functions which will fill-in a buffer
+ * structure we provide, or return an error and we will render a generic
+ * page and close the client.
+ */
+
+#define MSHUTTINGDOWN(cm) ((cm->flags & ISC_HTTPDMGR_FLAGSHUTTINGDOWN) != 0)
+#define MSETSHUTTINGDOWN(cm) (cm->flags |= ISC_HTTPDMGR_FLAGSHUTTINGDOWN)
+
+#ifdef DEBUG_HTTPD
+#define ENTER(x) do { fprintf(stderr, "ENTER %s\n", (x)); } while (0)
+#define EXIT(x) do { fprintf(stderr, "EXIT %s\n", (x)); } while (0)
+#define NOTICE(x) do { fprintf(stderr, "NOTICE %s\n", (x)); } while (0)
+#else
+#define ENTER(x) do { } while(0)
+#define EXIT(x) do { } while(0)
+#define NOTICE(x) do { } while(0)
+#endif
+
+#define HTTP_RECVLEN 1024
+#define HTTP_SENDGROW 1024
+#define HTTP_SEND_MAXLEN 10240
+
+/*%
+ * HTTP urls. These are the URLs we manage, and the function to call to
+ * provide the data for it. We pass in the base url (so the same function
+ * can handle multiple requests), and a structure to fill in to return a
+ * result to the client. We also pass in a pointer to be filled in for
+ * the data cleanup function.
+ */
+struct isc_httpdurl {
+ char *url;
+ isc_httpdaction_t *action;
+ void *action_arg;
+ ISC_LINK(isc_httpdurl_t) link;
+};
+
+#define HTTPD_CLOSE 0x0001 /* Got a Connection: close header */
+#define HTTPD_FOUNDHOST 0x0002 /* Got a Host: header */
+
+/*% http client */
+struct isc_httpd {
+ isc_httpdmgr_t *mgr; /*%< our parent */
+ ISC_LINK(isc_httpd_t) link;
+ unsigned int state;
+ isc_socket_t *sock;
+
+ /*%
+ * Received data state.
+ */
+ char recvbuf[HTTP_RECVLEN]; /*%< receive buffer */
+ isc_uint32_t recvlen; /*%< length recv'd */
+ unsigned int method;
+ char *url;
+ char *querystring;
+ char *protocol;
+
+ /*
+ * Flags on the httpd client.
+ */
+ int flags;
+
+ /*%
+ * Transmit data state.
+ *
+ * This is the data buffer we will transmit.
+ *
+ * This free function pointer is filled in by the rendering function
+ * we call. The free function is called after the data is transmitted
+ * to the client.
+ *
+ * The bufflist is the list of buffers we are currently transmitting.
+ * The headerdata is where we render our headers to. If we run out of
+ * space when rendering a header, we will change the size of our
+ * buffer. We will not free it until we are finished, and will
+ * allocate an additional HTTP_SENDGROW bytes per header space grow.
+ *
+ * We currently use two buffers total, one for the headers (which
+ * we manage) and another for the client to fill in (which it manages,
+ * it provides the space for it, etc) -- we will pass that buffer
+ * structure back to the caller, who is responsible for managing the
+ * space it may have allocated as backing store for it. This second
+ * buffer is bodybuffer, and we only allocate the buffer itself, not
+ * the backing store.
+ */
+ isc_bufferlist_t bufflist;
+ char *headerdata; /*%< send header buf */
+ unsigned int headerlen; /*%< current header buffer size */
+ isc_buffer_t headerbuffer;
+
+ const char *mimetype;
+ unsigned int retcode;
+ const char *retmsg;
+ isc_buffer_t bodybuffer;
+ isc_httpdfree_t *freecb;
+ void *freecb_arg;
+};
+
+/*% lightweight socket manager for httpd output */
+struct isc_httpdmgr {
+ isc_mem_t *mctx;
+ isc_socket_t *sock; /*%< listening socket */
+ isc_task_t *task; /*%< owning task */
+ isc_timermgr_t *timermgr;
+
+ isc_httpdclientok_t *client_ok; /*%< client validator */
+ isc_httpdondestroy_t *ondestroy; /*%< cleanup callback */
+ void *cb_arg; /*%< argument for the above */
+
+ unsigned int flags;
+ ISC_LIST(isc_httpd_t) running; /*%< running clients */
+
+ isc_mutex_t lock;
+
+ ISC_LIST(isc_httpdurl_t) urls; /*%< urls we manage */
+ isc_httpdaction_t *render_404;
+ isc_httpdaction_t *render_500;
+};
+
+/*%
+ * HTTP methods.
+ */
+#define ISC_HTTPD_METHODUNKNOWN 0
+#define ISC_HTTPD_METHODGET 1
+#define ISC_HTTPD_METHODPOST 2
+
+/*%
+ * Client states.
+ *
+ * _IDLE The client is not doing anything at all. This state should
+ * only occur just after creation, and just before being
+ * destroyed.
+ *
+ * _RECV The client is waiting for data after issuing a socket recv().
+ *
+ * _RECVDONE Data has been received, and is being processed.
+ *
+ * _SEND All data for a response has completed, and a reply was
+ * sent via a socket send() call.
+ *
+ * _SENDDONE Send is completed.
+ *
+ * Badly formatted state table:
+ *
+ * IDLE -> RECV when client has a recv() queued.
+ *
+ * RECV -> RECVDONE when recvdone event received.
+ *
+ * RECVDONE -> SEND if the data for a reply is at hand.
+ *
+ * SEND -> RECV when a senddone event was received.
+ *
+ * At any time -> RECV on error. If RECV fails, the client will
+ * self-destroy, closing the socket and freeing memory.
+ */
+#define ISC_HTTPD_STATEIDLE 0
+#define ISC_HTTPD_STATERECV 1
+#define ISC_HTTPD_STATERECVDONE 2
+#define ISC_HTTPD_STATESEND 3
+#define ISC_HTTPD_STATESENDDONE 4
+
+#define ISC_HTTPD_ISRECV(c) ((c)->state == ISC_HTTPD_STATERECV)
+#define ISC_HTTPD_ISRECVDONE(c) ((c)->state == ISC_HTTPD_STATERECVDONE)
+#define ISC_HTTPD_ISSEND(c) ((c)->state == ISC_HTTPD_STATESEND)
+#define ISC_HTTPD_ISSENDDONE(c) ((c)->state == ISC_HTTPD_STATESENDDONE)
+
+/*%
+ * Overall magic test that means we're not idle.
+ */
+#define ISC_HTTPD_SETRECV(c) ((c)->state = ISC_HTTPD_STATERECV)
+#define ISC_HTTPD_SETRECVDONE(c) ((c)->state = ISC_HTTPD_STATERECVDONE)
+#define ISC_HTTPD_SETSEND(c) ((c)->state = ISC_HTTPD_STATESEND)
+#define ISC_HTTPD_SETSENDDONE(c) ((c)->state = ISC_HTTPD_STATESENDDONE)
+
+static void isc_httpd_accept(isc_task_t *, isc_event_t *);
+static void isc_httpd_recvdone(isc_task_t *, isc_event_t *);
+static void isc_httpd_senddone(isc_task_t *, isc_event_t *);
+static void destroy_client(isc_httpd_t **);
+static isc_result_t process_request(isc_httpd_t *, int);
+static void httpdmgr_destroy(isc_httpdmgr_t *);
+static isc_result_t grow_headerspace(isc_httpd_t *);
+static void reset_client(isc_httpd_t *httpd);
+static isc_result_t render_404(const char *, const char *,
+ void *,
+ unsigned int *, const char **,
+ const char **, isc_buffer_t *,
+ isc_httpdfree_t **, void **);
+static isc_result_t render_500(const char *, const char *,
+ void *,
+ unsigned int *, const char **,
+ const char **, isc_buffer_t *,
+ isc_httpdfree_t **, void **);
+
+static void
+destroy_client(isc_httpd_t **httpdp)
+{
+ isc_httpd_t *httpd = *httpdp;
+ isc_httpdmgr_t *httpdmgr = httpd->mgr;
+
+ *httpdp = NULL;
+
+ LOCK(&httpdmgr->lock);
+
+ isc_socket_detach(&httpd->sock);
+ ISC_LIST_UNLINK(httpdmgr->running, httpd, link);
+
+ if (httpd->headerlen > 0)
+ isc_mem_put(httpdmgr->mctx, httpd->headerdata,
+ httpd->headerlen);
+
+ isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t));
+
+ UNLOCK(&httpdmgr->lock);
+
+ httpdmgr_destroy(httpdmgr);
+}
+
+isc_result_t
+isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task,
+ isc_httpdclientok_t *client_ok,
+ isc_httpdondestroy_t *ondestroy, void *cb_arg,
+ isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp)
+{
+ isc_result_t result;
+ isc_httpdmgr_t *httpd;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(sock != NULL);
+ REQUIRE(task != NULL);
+ REQUIRE(tmgr != NULL);
+ REQUIRE(httpdp != NULL && *httpdp == NULL);
+
+ httpd = isc_mem_get(mctx, sizeof(isc_httpdmgr_t));
+ if (httpd == NULL)
+ return (ISC_R_NOMEMORY);
+
+ result = isc_mutex_init(&httpd->lock);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_put(mctx, httpd, sizeof(isc_httpdmgr_t));
+ return (result);
+ }
+ httpd->mctx = NULL;
+ isc_mem_attach(mctx, &httpd->mctx);
+ httpd->sock = NULL;
+ isc_socket_attach(sock, &httpd->sock);
+ httpd->task = NULL;
+ isc_task_attach(task, &httpd->task);
+ httpd->timermgr = tmgr; /* XXXMLG no attach function? */
+ httpd->client_ok = client_ok;
+ httpd->ondestroy = ondestroy;
+ httpd->cb_arg = cb_arg;
+
+ ISC_LIST_INIT(httpd->running);
+ ISC_LIST_INIT(httpd->urls);
+
+ /* XXXMLG ignore errors on isc_socket_listen() */
+ result = isc_socket_listen(sock, SOMAXCONN);
+ if (result != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_socket_listen() failed: %s",
+ isc_result_totext(result));
+ goto cleanup;
+ }
+
+ (void)isc_socket_filter(sock, "httpready");
+
+ result = isc_socket_accept(sock, task, isc_httpd_accept, httpd);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
+
+ httpd->render_404 = render_404;
+ httpd->render_500 = render_500;
+
+ *httpdp = httpd;
+ return (ISC_R_SUCCESS);
+
+ cleanup:
+ isc_task_detach(&httpd->task);
+ isc_socket_detach(&httpd->sock);
+ isc_mem_detach(&httpd->mctx);
+ (void)isc_mutex_destroy(&httpd->lock);
+ isc_mem_put(mctx, httpd, sizeof(isc_httpdmgr_t));
+ return (result);
+}
+
+static void
+httpdmgr_destroy(isc_httpdmgr_t *httpdmgr)
+{
+ isc_mem_t *mctx;
+ isc_httpdurl_t *url;
+
+ ENTER("httpdmgr_destroy");
+
+ LOCK(&httpdmgr->lock);
+
+ if (!MSHUTTINGDOWN(httpdmgr)) {
+ NOTICE("httpdmgr_destroy not shutting down yet");
+ UNLOCK(&httpdmgr->lock);
+ return;
+ }
+
+ /*
+ * If all clients are not shut down, don't do anything yet.
+ */
+ if (!ISC_LIST_EMPTY(httpdmgr->running)) {
+ NOTICE("httpdmgr_destroy clients still active");
+ UNLOCK(&httpdmgr->lock);
+ return;
+ }
+
+ NOTICE("httpdmgr_destroy detaching socket, task, and timermgr");
+
+ isc_socket_detach(&httpdmgr->sock);
+ isc_task_detach(&httpdmgr->task);
+ httpdmgr->timermgr = NULL;
+
+ /*
+ * Clear out the list of all actions we know about. Just free the
+ * memory.
+ */
+ url = ISC_LIST_HEAD(httpdmgr->urls);
+ while (url != NULL) {
+ isc_mem_free(httpdmgr->mctx, url->url);
+ ISC_LIST_UNLINK(httpdmgr->urls, url, link);
+ isc_mem_put(httpdmgr->mctx, url, sizeof(isc_httpdurl_t));
+ url = ISC_LIST_HEAD(httpdmgr->urls);
+ }
+
+ UNLOCK(&httpdmgr->lock);
+ (void)isc_mutex_destroy(&httpdmgr->lock);
+
+ if (httpdmgr->ondestroy != NULL)
+ (httpdmgr->ondestroy)(httpdmgr->cb_arg);
+
+ mctx = httpdmgr->mctx;
+ isc_mem_putanddetach(&mctx, httpdmgr, sizeof(isc_httpdmgr_t));
+
+ EXIT("httpdmgr_destroy");
+}
+
+#define LENGTHOK(s) (httpd->recvbuf - (s) < (int)httpd->recvlen)
+#define BUFLENOK(s) (httpd->recvbuf - (s) < HTTP_RECVLEN)
+
+static isc_result_t
+process_request(isc_httpd_t *httpd, int length)
+{
+ char *s;
+ char *p;
+ int delim;
+
+ ENTER("request");
+
+ httpd->recvlen += length;
+
+ httpd->recvbuf[httpd->recvlen] = 0;
+
+ /*
+ * If we don't find a blank line in our buffer, return that we need
+ * more data.
+ */
+ s = strstr(httpd->recvbuf, "\r\n\r\n");
+ delim = 1;
+ if (s == NULL) {
+ s = strstr(httpd->recvbuf, "\n\n");
+ delim = 2;
+ }
+ if (s == NULL)
+ return (ISC_R_NOTFOUND);
+
+ /*
+ * Determine if this is a POST or GET method. Any other values will
+ * cause an error to be returned.
+ */
+ if (strncmp(httpd->recvbuf, "GET ", 4) == 0) {
+ httpd->method = ISC_HTTPD_METHODGET;
+ p = httpd->recvbuf + 4;
+ } else if (strncmp(httpd->recvbuf, "POST ", 5) == 0) {
+ httpd->method = ISC_HTTPD_METHODPOST;
+ p = httpd->recvbuf + 5;
+ } else {
+ return (ISC_R_RANGE);
+ }
+
+ /*
+ * From now on, p is the start of our buffer.
+ */
+
+ /*
+ * Extract the URL.
+ */
+ s = p;
+ while (LENGTHOK(s) && BUFLENOK(s) &&
+ (*s != '\n' && *s != '\r' && *s != '\0' && *s != ' '))
+ s++;
+ if (!LENGTHOK(s))
+ return (ISC_R_NOTFOUND);
+ if (!BUFLENOK(s))
+ return (ISC_R_NOMEMORY);
+ *s = 0;
+
+ /*
+ * Make the URL relative.
+ */
+ if ((strncmp(p, "http:/", 6) == 0)
+ || (strncmp(p, "https:/", 7) == 0)) {
+ /* Skip first / */
+ while (*p != '/' && *p != 0)
+ p++;
+ if (*p == 0)
+ return (ISC_R_RANGE);
+ p++;
+ /* Skip second / */
+ while (*p != '/' && *p != 0)
+ p++;
+ if (*p == 0)
+ return (ISC_R_RANGE);
+ p++;
+ /* Find third / */
+ while (*p != '/' && *p != 0)
+ p++;
+ if (*p == 0) {
+ p--;
+ *p = '/';
+ }
+ }
+
+ httpd->url = p;
+ p = s + delim;
+ s = p;
+
+ /*
+ * Now, see if there is a ? mark in the URL. If so, this is
+ * part of the query string, and we will split it from the URL.
+ */
+ httpd->querystring = strchr(httpd->url, '?');
+ if (httpd->querystring != NULL) {
+ *(httpd->querystring) = 0;
+ httpd->querystring++;
+ }
+
+ /*
+ * Extract the HTTP/1.X protocol. We will bounce on anything but
+ * HTTP/1.1 for now.
+ */
+ while (LENGTHOK(s) && BUFLENOK(s) &&
+ (*s != '\n' && *s != '\r' && *s != '\0'))
+ s++;
+ if (!LENGTHOK(s))
+ return (ISC_R_NOTFOUND);
+ if (!BUFLENOK(s))
+ return (ISC_R_NOMEMORY);
+ *s = 0;
+ if ((strncmp(p, "HTTP/1.0", 8) != 0)
+ && (strncmp(p, "HTTP/1.1", 8) != 0))
+ return (ISC_R_RANGE);
+ httpd->protocol = p;
+ p = s + 1;
+ s = p;
+
+ if (strstr(s, "Connection: close") != NULL)
+ httpd->flags |= HTTPD_CLOSE;
+
+ if (strstr(s, "Host: ") != NULL)
+ httpd->flags |= HTTPD_FOUNDHOST;
+
+ /*
+ * Standards compliance hooks here.
+ */
+ if (strcmp(httpd->protocol, "HTTP/1.1") == 0
+ && ((httpd->flags & HTTPD_FOUNDHOST) == 0))
+ return (ISC_R_RANGE);
+
+ EXIT("request");
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+isc_httpd_accept(isc_task_t *task, isc_event_t *ev)
+{
+ isc_result_t result;
+ isc_httpdmgr_t *httpdmgr = ev->ev_arg;
+ isc_httpd_t *httpd;
+ isc_region_t r;
+ isc_socket_newconnev_t *nev = (isc_socket_newconnev_t *)ev;
+ isc_sockaddr_t peeraddr;
+
+ ENTER("accept");
+
+ LOCK(&httpdmgr->lock);
+ if (MSHUTTINGDOWN(httpdmgr)) {
+ NOTICE("accept shutting down, goto out");
+ goto out;
+ }
+
+ if (nev->result == ISC_R_CANCELED) {
+ NOTICE("accept canceled, goto out");
+ goto out;
+ }
+
+ if (nev->result != ISC_R_SUCCESS) {
+ /* XXXMLG log failure */
+ NOTICE("accept returned failure, goto requeue");
+ goto requeue;
+ }
+
+ (void)isc_socket_getpeername(nev->newsocket, &peeraddr);
+ if (httpdmgr->client_ok != NULL &&
+ !(httpdmgr->client_ok)(&peeraddr, httpdmgr->cb_arg)) {
+ isc_socket_detach(&nev->newsocket);
+ goto requeue;
+ }
+
+ httpd = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpd_t));
+ if (httpd == NULL) {
+ /* XXXMLG log failure */
+ NOTICE("accept failed to allocate memory, goto requeue");
+ isc_socket_detach(&nev->newsocket);
+ goto requeue;
+ }
+
+ httpd->mgr = httpdmgr;
+ ISC_LINK_INIT(httpd, link);
+ ISC_LIST_APPEND(httpdmgr->running, httpd, link);
+ ISC_HTTPD_SETRECV(httpd);
+ httpd->sock = nev->newsocket;
+ isc_socket_setname(httpd->sock, "httpd", NULL);
+ httpd->flags = 0;
+
+ /*
+ * Initialize the buffer for our headers.
+ */
+ httpd->headerdata = isc_mem_get(httpdmgr->mctx, HTTP_SENDGROW);
+ if (httpd->headerdata == NULL) {
+ isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t));
+ isc_socket_detach(&nev->newsocket);
+ goto requeue;
+ }
+ httpd->headerlen = HTTP_SENDGROW;
+ isc_buffer_init(&httpd->headerbuffer, httpd->headerdata,
+ httpd->headerlen);
+
+ ISC_LIST_INIT(httpd->bufflist);
+
+ isc_buffer_initnull(&httpd->bodybuffer);
+ reset_client(httpd);
+
+ r.base = (unsigned char *)httpd->recvbuf;
+ r.length = HTTP_RECVLEN - 1;
+ result = isc_socket_recv(httpd->sock, &r, 1, task, isc_httpd_recvdone,
+ httpd);
+ /* FIXME!!! */
+ POST(result);
+ NOTICE("accept queued recv on socket");
+
+ requeue:
+ result = isc_socket_accept(httpdmgr->sock, task, isc_httpd_accept,
+ httpdmgr);
+ if (result != ISC_R_SUCCESS) {
+ /* XXXMLG what to do? Log failure... */
+ NOTICE("accept could not reaccept due to failure");
+ }
+
+ out:
+ UNLOCK(&httpdmgr->lock);
+
+ httpdmgr_destroy(httpdmgr);
+
+ isc_event_free(&ev);
+
+ EXIT("accept");
+}
+
+static isc_result_t
+render_404(const char *url, const char *querystring,
+ void *arg,
+ unsigned int *retcode, const char **retmsg,
+ const char **mimetype, isc_buffer_t *b,
+ isc_httpdfree_t **freecb, void **freecb_args)
+{
+ static char msg[] = "No such URL.";
+
+ UNUSED(url);
+ UNUSED(querystring);
+ UNUSED(arg);
+
+ *retcode = 404;
+ *retmsg = "No such URL";
+ *mimetype = "text/plain";
+ isc_buffer_reinit(b, msg, strlen(msg));
+ isc_buffer_add(b, strlen(msg));
+ *freecb = NULL;
+ *freecb_args = NULL;
+
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+render_500(const char *url, const char *querystring,
+ void *arg,
+ unsigned int *retcode, const char **retmsg,
+ const char **mimetype, isc_buffer_t *b,
+ isc_httpdfree_t **freecb, void **freecb_args)
+{
+ static char msg[] = "Internal server failure.";
+
+ UNUSED(url);
+ UNUSED(querystring);
+ UNUSED(arg);
+
+ *retcode = 500;
+ *retmsg = "Internal server failure";
+ *mimetype = "text/plain";
+ isc_buffer_reinit(b, msg, strlen(msg));
+ isc_buffer_add(b, strlen(msg));
+ *freecb = NULL;
+ *freecb_args = NULL;
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+isc_httpd_recvdone(isc_task_t *task, isc_event_t *ev)
+{
+ isc_region_t r;
+ isc_result_t result;
+ isc_httpd_t *httpd = ev->ev_arg;
+ isc_socketevent_t *sev = (isc_socketevent_t *)ev;
+ isc_httpdurl_t *url;
+ isc_time_t now;
+ char datebuf[32]; /* Only need 30, but safety first */
+
+ ENTER("recv");
+
+ INSIST(ISC_HTTPD_ISRECV(httpd));
+
+ if (sev->result != ISC_R_SUCCESS) {
+ NOTICE("recv destroying client");
+ destroy_client(&httpd);
+ goto out;
+ }
+
+ result = process_request(httpd, sev->n);
+ if (result == ISC_R_NOTFOUND) {
+ if (httpd->recvlen >= HTTP_RECVLEN - 1) {
+ destroy_client(&httpd);
+ goto out;
+ }
+ r.base = (unsigned char *)httpd->recvbuf + httpd->recvlen;
+ r.length = HTTP_RECVLEN - httpd->recvlen - 1;
+ /* check return code? */
+ (void)isc_socket_recv(httpd->sock, &r, 1, task,
+ isc_httpd_recvdone, httpd);
+ goto out;
+ } else if (result != ISC_R_SUCCESS) {
+ destroy_client(&httpd);
+ goto out;
+ }
+
+ ISC_HTTPD_SETSEND(httpd);
+
+ /*
+ * XXXMLG Call function here. Provide an add-header function
+ * which will append the common headers to a response we generate.
+ */
+ isc_buffer_initnull(&httpd->bodybuffer);
+ isc_time_now(&now);
+ isc_time_formathttptimestamp(&now, datebuf, sizeof(datebuf));
+ url = ISC_LIST_HEAD(httpd->mgr->urls);
+ while (url != NULL) {
+ if (strcmp(httpd->url, url->url) == 0)
+ break;
+ url = ISC_LIST_NEXT(url, link);
+ }
+ if (url == NULL)
+ result = httpd->mgr->render_404(httpd->url, httpd->querystring,
+ NULL,
+ &httpd->retcode,
+ &httpd->retmsg,
+ &httpd->mimetype,
+ &httpd->bodybuffer,
+ &httpd->freecb,
+ &httpd->freecb_arg);
+ else
+ result = url->action(httpd->url, httpd->querystring,
+ url->action_arg,
+ &httpd->retcode, &httpd->retmsg,
+ &httpd->mimetype, &httpd->bodybuffer,
+ &httpd->freecb, &httpd->freecb_arg);
+ if (result != ISC_R_SUCCESS) {
+ result = httpd->mgr->render_500(httpd->url, httpd->querystring,
+ NULL, &httpd->retcode,
+ &httpd->retmsg,
+ &httpd->mimetype,
+ &httpd->bodybuffer,
+ &httpd->freecb,
+ &httpd->freecb_arg);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ }
+
+ isc_httpd_response(httpd);
+ isc_httpd_addheader(httpd, "Content-Type", httpd->mimetype);
+ isc_httpd_addheader(httpd, "Date", datebuf);
+ isc_httpd_addheader(httpd, "Expires", datebuf);
+ isc_httpd_addheader(httpd, "Last-Modified", datebuf);
+ isc_httpd_addheader(httpd, "Pragma: no-cache", NULL);
+ isc_httpd_addheader(httpd, "Cache-Control: no-cache", NULL);
+ isc_httpd_addheader(httpd, "Server: libisc", NULL);
+ isc_httpd_addheaderuint(httpd, "Content-Length",
+ isc_buffer_usedlength(&httpd->bodybuffer));
+ isc_httpd_endheaders(httpd); /* done */
+
+ ISC_LIST_APPEND(httpd->bufflist, &httpd->headerbuffer, link);
+ /*
+ * Link the data buffer into our send queue, should we have any data
+ * rendered into it. If no data is present, we won't do anything
+ * with the buffer.
+ */
+ if (isc_buffer_length(&httpd->bodybuffer) > 0)
+ ISC_LIST_APPEND(httpd->bufflist, &httpd->bodybuffer, link);
+
+ /* check return code? */
+ (void)isc_socket_sendv(httpd->sock, &httpd->bufflist, task,
+ isc_httpd_senddone, httpd);
+
+ out:
+ isc_event_free(&ev);
+ EXIT("recv");
+}
+
+void
+isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdmgrp)
+{
+ isc_httpdmgr_t *httpdmgr;
+ isc_httpd_t *httpd;
+ httpdmgr = *httpdmgrp;
+ *httpdmgrp = NULL;
+
+ ENTER("isc_httpdmgr_shutdown");
+
+ LOCK(&httpdmgr->lock);
+
+ MSETSHUTTINGDOWN(httpdmgr);
+
+ isc_socket_cancel(httpdmgr->sock, httpdmgr->task, ISC_SOCKCANCEL_ALL);
+
+ httpd = ISC_LIST_HEAD(httpdmgr->running);
+ while (httpd != NULL) {
+ isc_socket_cancel(httpd->sock, httpdmgr->task,
+ ISC_SOCKCANCEL_ALL);
+ httpd = ISC_LIST_NEXT(httpd, link);
+ }
+
+ UNLOCK(&httpdmgr->lock);
+
+ EXIT("isc_httpdmgr_shutdown");
+}
+
+static isc_result_t
+grow_headerspace(isc_httpd_t *httpd)
+{
+ char *newspace;
+ unsigned int newlen;
+ isc_region_t r;
+
+ newlen = httpd->headerlen + HTTP_SENDGROW;
+ if (newlen > HTTP_SEND_MAXLEN)
+ return (ISC_R_NOSPACE);
+
+ newspace = isc_mem_get(httpd->mgr->mctx, newlen);
+ if (newspace == NULL)
+ return (ISC_R_NOMEMORY);
+ isc_buffer_region(&httpd->headerbuffer, &r);
+ isc_buffer_reinit(&httpd->headerbuffer, newspace, newlen);
+
+ isc_mem_put(httpd->mgr->mctx, r.base, r.length);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_httpd_response(isc_httpd_t *httpd)
+{
+ isc_result_t result;
+ unsigned int needlen;
+
+ needlen = strlen(httpd->protocol) + 1; /* protocol + space */
+ needlen += 3 + 1; /* room for response code, always 3 bytes */
+ needlen += strlen(httpd->retmsg) + 2; /* return msg + CRLF */
+
+ while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+ result = grow_headerspace(httpd);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ }
+
+ sprintf(isc_buffer_used(&httpd->headerbuffer), "%s %03d %s\r\n",
+ httpd->protocol, httpd->retcode, httpd->retmsg);
+ isc_buffer_add(&httpd->headerbuffer, needlen);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_httpd_addheader(isc_httpd_t *httpd, const char *name,
+ const char *val)
+{
+ isc_result_t result;
+ unsigned int needlen;
+
+ needlen = strlen(name); /* name itself */
+ if (val != NULL)
+ needlen += 2 + strlen(val); /* :<space> and val */
+ needlen += 2; /* CRLF */
+
+ while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+ result = grow_headerspace(httpd);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ }
+
+ if (val != NULL)
+ sprintf(isc_buffer_used(&httpd->headerbuffer),
+ "%s: %s\r\n", name, val);
+ else
+ sprintf(isc_buffer_used(&httpd->headerbuffer),
+ "%s\r\n", name);
+
+ isc_buffer_add(&httpd->headerbuffer, needlen);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_httpd_endheaders(isc_httpd_t *httpd)
+{
+ isc_result_t result;
+
+ while (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
+ result = grow_headerspace(httpd);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ }
+
+ sprintf(isc_buffer_used(&httpd->headerbuffer), "\r\n");
+ isc_buffer_add(&httpd->headerbuffer, 2);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) {
+ isc_result_t result;
+ unsigned int needlen;
+ char buf[sizeof "18446744073709551616"];
+
+ sprintf(buf, "%d", val);
+
+ needlen = strlen(name); /* name itself */
+ needlen += 2 + strlen(buf); /* :<space> and val */
+ needlen += 2; /* CRLF */
+
+ while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+ result = grow_headerspace(httpd);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ }
+
+ sprintf(isc_buffer_used(&httpd->headerbuffer),
+ "%s: %s\r\n", name, buf);
+
+ isc_buffer_add(&httpd->headerbuffer, needlen);
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+isc_httpd_senddone(isc_task_t *task, isc_event_t *ev)
+{
+ isc_httpd_t *httpd = ev->ev_arg;
+ isc_region_t r;
+ isc_socketevent_t *sev = (isc_socketevent_t *)ev;
+
+ ENTER("senddone");
+ INSIST(ISC_HTTPD_ISSEND(httpd));
+
+ /*
+ * First, unlink our header buffer from the socket's bufflist. This
+ * is sort of an evil hack, since we know our buffer will be there,
+ * and we know it's address, so we can just remove it directly.
+ */
+ NOTICE("senddone unlinked header");
+ ISC_LIST_UNLINK(sev->bufferlist, &httpd->headerbuffer, link);
+
+ /*
+ * We will always want to clean up our receive buffer, even if we
+ * got an error on send or we are shutting down.
+ *
+ * We will pass in the buffer only if there is data in it. If
+ * there is no data, we will pass in a NULL.
+ */
+ if (httpd->freecb != NULL) {
+ isc_buffer_t *b = NULL;
+ if (isc_buffer_length(&httpd->bodybuffer) > 0)
+ b = &httpd->bodybuffer;
+ httpd->freecb(b, httpd->freecb_arg);
+ NOTICE("senddone free callback performed");
+ }
+ if (ISC_LINK_LINKED(&httpd->bodybuffer, link)) {
+ ISC_LIST_UNLINK(sev->bufferlist, &httpd->bodybuffer, link);
+ NOTICE("senddone body buffer unlinked");
+ }
+
+ if (sev->result != ISC_R_SUCCESS) {
+ destroy_client(&httpd);
+ goto out;
+ }
+
+ if ((httpd->flags & HTTPD_CLOSE) != 0) {
+ destroy_client(&httpd);
+ goto out;
+ }
+
+ ISC_HTTPD_SETRECV(httpd);
+
+ NOTICE("senddone restarting recv on socket");
+
+ reset_client(httpd);
+
+ r.base = (unsigned char *)httpd->recvbuf;
+ r.length = HTTP_RECVLEN - 1;
+ /* check return code? */
+ (void)isc_socket_recv(httpd->sock, &r, 1, task,
+ isc_httpd_recvdone, httpd);
+
+out:
+ isc_event_free(&ev);
+ EXIT("senddone");
+}
+
+static void
+reset_client(isc_httpd_t *httpd)
+{
+ /*
+ * Catch errors here. We MUST be in RECV mode, and we MUST NOT have
+ * any outstanding buffers. If we have buffers, we have a leak.
+ */
+ INSIST(ISC_HTTPD_ISRECV(httpd));
+ INSIST(!ISC_LINK_LINKED(&httpd->headerbuffer, link));
+ INSIST(!ISC_LINK_LINKED(&httpd->bodybuffer, link));
+
+ httpd->recvbuf[0] = 0;
+ httpd->recvlen = 0;
+ httpd->method = ISC_HTTPD_METHODUNKNOWN;
+ httpd->url = NULL;
+ httpd->querystring = NULL;
+ httpd->protocol = NULL;
+ httpd->flags = 0;
+
+ isc_buffer_clear(&httpd->headerbuffer);
+ isc_buffer_invalidate(&httpd->bodybuffer);
+}
+
+isc_result_t
+isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url,
+ isc_httpdaction_t *func, void *arg)
+{
+ isc_httpdurl_t *item;
+
+ if (url == NULL) {
+ httpdmgr->render_404 = func;
+ return (ISC_R_SUCCESS);
+ }
+
+ item = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpdurl_t));
+ if (item == NULL)
+ return (ISC_R_NOMEMORY);
+
+ item->url = isc_mem_strdup(httpdmgr->mctx, url);
+ if (item->url == NULL) {
+ isc_mem_put(httpdmgr->mctx, item, sizeof(isc_httpdurl_t));
+ return (ISC_R_NOMEMORY);
+ }
+
+ item->action = func;
+ item->action_arg = arg;
+ ISC_LINK_INIT(item, link);
+ ISC_LIST_APPEND(httpdmgr->urls, item, link);
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/ia64/include/isc/atomic.h b/lib/isc/ia64/include/isc/atomic.h
new file mode 100644
index 0000000..6c22f2a
--- /dev/null
+++ b/lib/isc/ia64/include/isc/atomic.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: atomic.h,v 1.7 2009/06/24 02:22:50 marka Exp $ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#ifdef ISC_PLATFORM_USEGCCASM
+/*
+ * This routine atomically increments the value stored in 'p' by 'val', and
+ * returns the previous value.
+ *
+ * Open issue: can 'fetchadd' make the code faster for some particular values
+ * (e.g., 1 and -1)?
+ */
+static inline isc_int32_t
+#ifdef __GNUC__
+__attribute__ ((unused))
+#endif
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val)
+{
+ isc_int32_t prev, swapped;
+
+ for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) {
+ swapped = prev + val;
+ __asm__ volatile(
+ "mov ar.ccv=%2;"
+ "cmpxchg4.acq %0=%4,%3,ar.ccv"
+ : "=r" (swapped), "=m" (*p)
+ : "r" (prev), "r" (swapped), "m" (*p)
+ : "memory");
+ if (swapped == prev)
+ break;
+ }
+
+ return (prev);
+}
+
+/*
+ * This routine atomically stores the value 'val' in 'p'.
+ */
+static inline void
+#ifdef __GNUC__
+__attribute__ ((unused))
+#endif
+isc_atomic_store(isc_int32_t *p, isc_int32_t val)
+{
+ __asm__ volatile(
+ "st4.rel %0=%1"
+ : "=m" (*p)
+ : "r" (val)
+ : "memory"
+ );
+}
+
+/*
+ * This routine atomically replaces the value in 'p' with 'val', if the
+ * original value is equal to 'cmpval'. The original value is returned in any
+ * case.
+ */
+static inline isc_int32_t
+#ifdef __GNUC__
+__attribute__ ((unused))
+#endif
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val)
+{
+ isc_int32_t ret;
+
+ __asm__ volatile(
+ "mov ar.ccv=%2;"
+ "cmpxchg4.acq %0=%4,%3,ar.ccv"
+ : "=r" (ret), "=m" (*p)
+ : "r" (cmpval), "r" (val), "m" (*p)
+ : "memory");
+
+ return (ret);
+}
+#else /* !ISC_PLATFORM_USEGCCASM */
+
+#error "unsupported compiler. disable atomic ops by --disable-atomic"
+
+#endif
+#endif /* ISC_ATOMIC_H */
diff --git a/lib/isc/include/isc/Makefile b/lib/isc/include/isc/Makefile
new file mode 100644
index 0000000..5ed6d20
--- /dev/null
+++ b/lib/isc/include/isc/Makefile
@@ -0,0 +1,439 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# lib/isc/include/isc/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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.
+
+
+
+srcdir = /deacon/backroom/snaps/ntp-dev/lib/isc/include/isc
+top_srcdir = /deacon/backroom/snaps/ntp-dev
+VPATH = /deacon/backroom/snaps/ntp-dev/lib/isc/include/isc
+pkgdatadir = $(datadir)/ntp
+pkglibdir = $(libdir)/ntp
+pkgincludedir = $(includedir)/ntp
+top_builddir = ../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = /usr/local/gnu/bin/install -c
+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 = sparc-sun-solaris2.10
+host_triplet = sparc-sun-solaris2.10
+subdir = lib/isc/include/isc
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
+ $(top_srcdir)/m4/define_dir.m4 \
+ $(top_srcdir)/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/version.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run aclocal-1.9
+AMDEP_FALSE = #
+AMDEP_TRUE =
+AMTAR = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run tar
+AR = ar
+ARLIB_DIR = arlib
+AUTOCONF = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run autoconf
+AUTOHEADER = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run autoheader
+AUTOMAKE = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run automake-1.9
+AWK = gawk
+BINSUBDIR = bin
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2 -D_LARGEFILE64_SOURCE -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Winit-self -Wno-strict-prototypes
+CHUTEST =
+CLKTEST =
+CPP = gcc -E
+CPPFLAGS = -D__EXTENSIONS__ -I/usr/sfw/include
+CYGPATH_W = echo
+DCFD =
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EDITLINE_LIBS =
+EF_LIBS =
+EF_PROGS =
+EGREP = grep -E
+EXEEXT =
+HAVE_INLINE =
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_LIBOPTS_FALSE =
+INSTALL_LIBOPTS_TRUE = #
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+LCRYPTO = -lcrypto
+LDFLAGS = -L/usr/sfw/lib -R/usr/sfw/lib
+LIBOBJS =
+LIBOPTS_CFLAGS = -I$(top_srcdir)/libopts
+LIBOPTS_DIR = libopts
+LIBOPTS_LDADD = $(top_builddir)/libopts/libopts.la
+LIBPARSE =
+LIBS = -lkvm -lelf -lsocket -lrt -lmd5 -lnsl -lgen
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LN_S = ln -s
+LSCF = -lscf
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run makeinfo
+MAKE_ADJTIMED =
+MAKE_CHECK_LAYOUT = check-layout
+MAKE_CHECK_Y2K =
+MAKE_LIBNTPSIM = libntpsim.a
+MAKE_LIBPARSE =
+MAKE_LIBPARSE_KERNEL =
+MAKE_NTPDSIM = ntpdsim
+MAKE_NTPSNMPD =
+MAKE_NTPTIME = ntptime
+MAKE_PARSEKMODULE =
+MAKE_TICKADJ = tickadj
+MAKE_TIMETRIM =
+NEED_LIBOPTS_FALSE = #
+NEED_LIBOPTS_TRUE =
+OBJEXT = o
+OPENSSL =
+OPENSSL_INC = /usr/sfw/include
+OPENSSL_LIB = /usr/sfw/lib
+PACKAGE = ntp
+PACKAGE_BUGREPORT =
+PACKAGE_NAME = ntp
+PACKAGE_STRING = ntp 4.2.5p221
+PACKAGE_TARNAME = ntp
+PACKAGE_VERSION = 4.2.5p221
+PATH_NET_SNMP_CONFIG =
+PATH_PERL = /usr/local/bin/perl
+PATH_SEPARATOR = :
+PATH_SH = /bin/sh
+PROPDELAY =
+RANLIB = ranlib
+SET_MAKE =
+SHELL = /bin/sh
+SNMP_CFLAGS =
+SNMP_CPPFLAGS =
+SNMP_LIBS =
+STRIP = strip
+TESTDCF =
+VERSION = 4.2.5p221
+VPATH_HACK_FALSE =
+VPATH_HACK_TRUE = #
+YACC = bison -y
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_RANLIB = ranlib
+ac_ct_STRIP = strip
+am__fastdepCC_FALSE = #
+am__fastdepCC_TRUE =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = sparc-sun-solaris2.10
+build_alias =
+build_cpu = sparc
+build_os = solaris2.10
+build_vendor = sun
+datadir = ${prefix}/share
+exec_prefix = ${prefix}
+host = sparc-sun-solaris2.10
+host_alias =
+host_cpu = sparc
+host_os = solaris2.10
+host_vendor = sun
+includedir = ${prefix}/include
+infodir = ${prefix}/info
+install_sh = /deacon/backroom/snaps/ntp-dev/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localstatedir = ${prefix}/var
+mandir = ${prefix}/man
+mkdir_p = mkdir -p --
+oldincludedir = /usr/include
+prefix = /usr/local
+program_transform_name = s,x,x,
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+subdirs = arlib sntp
+sysconfdir = ${prefix}/etc
+target_alias =
+NULL =
+#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
+AUTOMAKE_OPTIONS =
+ETAGS_ARGS = $(srcdir)/Makefile.am
+#EXTRA_DIST = TAGS
+noinst_HEADERS = \
+ app.h \
+ assertions.h \
+ boolean.h \
+ buffer.h \
+ error.h \
+ file.h \
+ formatcheck.h \
+ interfaceiter.h \
+ ipv6.h \
+ lang.h \
+ lib.h \
+ list.h \
+ log.h \
+ magic.h \
+ md5.h \
+ mem.h \
+ msgcat.h \
+ msgs.h \
+ mutex.h \
+ netaddr.h \
+ netscope.h \
+ once.h \
+ platform.h \
+ print.h \
+ result.h \
+ region.h \
+ sockaddr.h \
+ stdio.h \
+ string.h \
+ types.h \
+ util.h \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/isc/include/isc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign lib/isc/include/isc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool ctags distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/isc/include/isc/app.h b/lib/isc/include/isc/app.h
new file mode 100644
index 0000000..e0be790
--- /dev/null
+++ b/lib/isc/include/isc/app.h
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: app.h,v 1.11 2009/09/02 23:48:03 tbox Exp $ */
+
+#ifndef ISC_APP_H
+#define ISC_APP_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/app.h
+ * \brief ISC Application Support
+ *
+ * Dealing with program termination can be difficult, especially in a
+ * multithreaded program. The routines in this module help coordinate
+ * the shutdown process. They are used as follows by the initial (main)
+ * thread of the application:
+ *
+ *\li isc_app_start(); Call very early in main(), before
+ * any other threads have been created.
+ *
+ *\li isc_app_run(); This will post any on-run events,
+ * and then block until application
+ * shutdown is requested. A shutdown
+ * request is made by calling
+ * isc_app_shutdown(), or by sending
+ * SIGINT or SIGTERM to the process.
+ * After isc_app_run() returns, the
+ * application should shutdown itself.
+ *
+ *\li isc_app_finish(); Call very late in main().
+ *
+ * Applications that want to use SIGHUP/isc_app_reload() to trigger reloading
+ * should check the result of isc_app_run() and call the reload routine if
+ * the result is ISC_R_RELOAD. They should then call isc_app_run() again
+ * to resume waiting for reload or termination.
+ *
+ * Use of this module is not required. In particular, isc_app_start() is
+ * NOT an ISC library initialization routine.
+ *
+ * This module also supports per-thread 'application contexts'. With this
+ * mode, a thread-based application will have a separate context, in which
+ * it uses other ISC library services such as tasks or timers. Signals are
+ * not caught in this mode, so that the application can handle the signals
+ * in its preferred way.
+ *
+ * \li MP:
+ * Clients must ensure that isc_app_start(), isc_app_run(), and
+ * isc_app_finish() are called at most once. isc_app_shutdown()
+ * is safe to use by any thread (provided isc_app_start() has been
+ * called previously).
+ *
+ * The same note applies to isc_app_ctxXXX() functions, but in this case
+ * it's a per-thread restriction. For example, a thread with an
+ * application context must ensure that isc_app_ctxstart() with the
+ * context is called at most once.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * None.
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+#include <isc/eventclass.h>
+#include <isc/lang.h>
+#include <isc/magic.h>
+#include <isc/result.h>
+
+/***
+ *** Types
+ ***/
+
+typedef isc_event_t isc_appevent_t;
+
+#define ISC_APPEVENT_FIRSTEVENT (ISC_EVENTCLASS_APP + 0)
+#define ISC_APPEVENT_SHUTDOWN (ISC_EVENTCLASS_APP + 1)
+#define ISC_APPEVENT_LASTEVENT (ISC_EVENTCLASS_APP + 65535)
+
+/*%
+ * app module methods. Only app driver implementations use this structure.
+ * Other clients should use the top-level interfaces (i.e., isc_app_xxx
+ * functions). magic must be ISCAPI_APPMETHODS_MAGIC.
+ */
+typedef struct isc_appmethods {
+ void (*ctxdestroy)(isc_appctx_t **ctxp);
+ isc_result_t (*ctxstart)(isc_appctx_t *ctx);
+ isc_result_t (*ctxrun)(isc_appctx_t *ctx);
+ isc_result_t (*ctxsuspend)(isc_appctx_t *ctx);
+ isc_result_t (*ctxshutdown)(isc_appctx_t *ctx);
+ void (*ctxfinish)(isc_appctx_t *ctx);
+ void (*settaskmgr)(isc_appctx_t *ctx,
+ isc_taskmgr_t *timermgr);
+ void (*setsocketmgr)(isc_appctx_t *ctx,
+ isc_socketmgr_t *timermgr);
+ void (*settimermgr)(isc_appctx_t *ctx,
+ isc_timermgr_t *timermgr);
+} isc_appmethods_t;
+
+/*%
+ * This structure is actually just the common prefix of an application context
+ * implementation's version of an isc_appctx_t.
+ * \brief
+ * Direct use of this structure by clients is forbidden. app implementations
+ * may change the structure. 'magic' must be ISCAPI_APPCTX_MAGIC for any
+ * of the isc_app_ routines to work. app implementations must maintain
+ * all app context invariants.
+ */
+struct isc_appctx {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_appmethods_t *methods;
+};
+
+#define ISCAPI_APPCTX_MAGIC ISC_MAGIC('A','a','p','c')
+#define ISCAPI_APPCTX_VALID(c) ((c) != NULL && \
+ (c)->magic == ISCAPI_APPCTX_MAGIC)
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_app_ctxstart(isc_appctx_t *ctx);
+
+isc_result_t
+isc_app_start(void);
+/*!<
+ * \brief Start an ISC library application.
+ *
+ * Notes:
+ * This call should be made before any other ISC library call, and as
+ * close to the beginning of the application as possible.
+ *
+ * Requires:
+ * 'ctx' is a valid application context (for app_ctxstart()).
+ */
+
+isc_result_t
+isc_app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action,
+ void *arg);
+/*!<
+ * \brief Request delivery of an event when the application is run.
+ *
+ * Requires:
+ *\li isc_app_start() has been called.
+ *
+ * Returns:
+ * ISC_R_SUCCESS
+ * ISC_R_NOMEMORY
+ */
+
+isc_result_t
+isc_app_ctxrun(isc_appctx_t *ctx);
+
+isc_result_t
+isc_app_run(void);
+/*!<
+ * \brief Run an ISC library application.
+ *
+ * Notes:
+ *\li The caller (typically the initial thread of an application) will
+ * block until shutdown is requested. When the call returns, the
+ * caller should start shutting down the application.
+ *
+ * Requires:
+ *\li isc_app_[ctx]start() has been called.
+ *
+ * Ensures:
+ *\li Any events requested via isc_app_onrun() will have been posted (in
+ * FIFO order) before isc_app_run() blocks.
+ *\li 'ctx' is a valid application context (for app_ctxrun()).
+ *
+ * Returns:
+ *\li ISC_R_SUCCESS Shutdown has been requested.
+ *\li ISC_R_RELOAD Reload has been requested.
+ */
+
+isc_result_t
+isc_app_ctxshutdown(isc_appctx_t *ctx);
+
+isc_result_t
+isc_app_shutdown(void);
+/*!<
+ * \brief Request application shutdown.
+ *
+ * Notes:
+ *\li It is safe to call isc_app_shutdown() multiple times. Shutdown will
+ * only be triggered once.
+ *
+ * Requires:
+ *\li isc_app_[ctx]run() has been called.
+ *\li 'ctx' is a valid application context (for app_ctxshutdown()).
+ *
+ * Returns:
+ *\li ISC_R_SUCCESS
+ *\li ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_app_ctxsuspend(isc_appctx_t *ctx);
+/*!<
+ * \brief This has the same behavior as isc_app_ctxsuspend().
+ */
+
+isc_result_t
+isc_app_reload(void);
+/*!<
+ * \brief Request application reload.
+ *
+ * Requires:
+ *\li isc_app_run() has been called.
+ *
+ * Returns:
+ *\li ISC_R_SUCCESS
+ *\li ISC_R_UNEXPECTED
+ */
+
+void
+isc_app_ctxfinish(isc_appctx_t *ctx);
+
+void
+isc_app_finish(void);
+/*!<
+ * \brief Finish an ISC library application.
+ *
+ * Notes:
+ *\li This call should be made at or near the end of main().
+ *
+ * Requires:
+ *\li isc_app_start() has been called.
+ *\li 'ctx' is a valid application context (for app_ctxfinish()).
+ *
+ * Ensures:
+ *\li Any resources allocated by isc_app_start() have been released.
+ */
+
+void
+isc_app_block(void);
+/*!<
+ * \brief Indicate that a blocking operation will be performed.
+ *
+ * Notes:
+ *\li If a blocking operation is in process, a call to isc_app_shutdown()
+ * or an external signal will abort the program, rather than allowing
+ * clean shutdown. This is primarily useful for reading user input.
+ *
+ * Requires:
+ * \li isc_app_start() has been called.
+ * \li No other blocking operations are in progress.
+ */
+
+void
+isc_app_unblock(void);
+/*!<
+ * \brief Indicate that a blocking operation is complete.
+ *
+ * Notes:
+ * \li When a blocking operation has completed, return the program to a
+ * state where a call to isc_app_shutdown() or an external signal will
+ * shutdown normally.
+ *
+ * Requires:
+ * \li isc_app_start() has been called.
+ * \li isc_app_block() has been called by the same thread.
+ */
+
+isc_result_t
+isc_appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp);
+/*!<
+ * \brief Create an application context.
+ *
+ * Requires:
+ *\li 'mctx' is a valid memory context.
+ *\li 'ctxp' != NULL && *ctxp == NULL.
+ */
+
+void
+isc_appctx_destroy(isc_appctx_t **ctxp);
+/*!<
+ * \brief Destroy an application context.
+ *
+ * Requires:
+ *\li '*ctxp' is a valid application context.
+ *
+ * Ensures:
+ *\li *ctxp == NULL.
+ */
+
+void
+isc_appctx_settaskmgr(isc_appctx_t *ctx, isc_taskmgr_t *taskmgr);
+/*!<
+ * \brief Associate a task manager with an application context.
+ *
+ * This must be done before running tasks within the application context.
+ *
+ * Requires:
+ *\li 'ctx' is a valid application context.
+ *\li 'taskmgr' is a valid task manager.
+ */
+
+void
+isc_appctx_setsocketmgr(isc_appctx_t *ctx, isc_socketmgr_t *socketmgr);
+/*!<
+ * \brief Associate a socket manager with an application context.
+ *
+ * This must be done before handling socket events within the application
+ * context.
+ *
+ * Requires:
+ *\li 'ctx' is a valid application context.
+ *\li 'socketmgr' is a valid socket manager.
+ */
+
+void
+isc_appctx_settimermgr(isc_appctx_t *ctx, isc_timermgr_t *timermgr);
+/*!<
+ * \brief Associate a socket timer with an application context.
+ *
+ * This must be done before handling timer events within the application
+ * context.
+ *
+ * Requires:
+ *\li 'ctx' is a valid application context.
+ *\li 'timermgr' is a valid timer manager.
+ */
+
+#ifdef USE_APPIMPREGISTER
+/*%<
+ * See isc_appctx_create() above.
+ */
+typedef isc_result_t
+(*isc_appctxcreatefunc_t)(isc_mem_t *mctx, isc_appctx_t **ctxp);
+
+isc_result_t
+isc_app_register(isc_appctxcreatefunc_t createfunc);
+/*%<
+ * Register a new application implementation and add it to the list of
+ * supported implementations. This function must be called when a different
+ * event library is used than the one contained in the ISC library.
+ */
+
+isc_result_t
+isc__app_register(void);
+/*%<
+ * A short cut function that specifies the application module in the ISC
+ * library for isc_app_register(). An application that uses the ISC library
+ * usually do not have to care about this function: it would call
+ * isc_lib_register(), which internally calls this function.
+ */
+#endif /* USE_APPIMPREGISTER */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_APP_H */
diff --git a/lib/isc/include/isc/assertions.h b/lib/isc/include/isc/assertions.h
new file mode 100644
index 0000000..2c81b1a
--- /dev/null
+++ b/lib/isc/include/isc/assertions.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: assertions.h,v 1.28 2009/09/29 23:48:04 tbox Exp $
+ */
+/*! \file isc/assertions.h
+ */
+
+#ifndef ISC_ASSERTIONS_H
+#define ISC_ASSERTIONS_H 1
+
+#include <isc/lang.h>
+#include <isc/platform.h>
+
+ISC_LANG_BEGINDECLS
+
+/*% isc assertion type */
+typedef enum {
+ isc_assertiontype_require,
+ isc_assertiontype_ensure,
+ isc_assertiontype_insist,
+ isc_assertiontype_invariant
+} isc_assertiontype_t;
+
+typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
+ const char *);
+
+/* coverity[+kill] */
+ISC_PLATFORM_NORETURN_PRE
+void isc_assertion_failed(const char *, int, isc_assertiontype_t,
+ const char *) ISC_PLATFORM_NORETURN_POST;
+
+void
+isc_assertion_setcallback(isc_assertioncallback_t);
+
+const char *
+isc_assertion_typetotext(isc_assertiontype_t type);
+
+#if defined(ISC_CHECK_ALL) || defined(__COVERITY__)
+#define ISC_CHECK_REQUIRE 1
+#define ISC_CHECK_ENSURE 1
+#define ISC_CHECK_INSIST 1
+#define ISC_CHECK_INVARIANT 1
+#endif
+
+#if defined(ISC_CHECK_NONE) && !defined(__COVERITY__)
+#define ISC_CHECK_REQUIRE 0
+#define ISC_CHECK_ENSURE 0
+#define ISC_CHECK_INSIST 0
+#define ISC_CHECK_INVARIANT 0
+#endif
+
+#ifndef ISC_CHECK_REQUIRE
+#define ISC_CHECK_REQUIRE 1
+#endif
+
+#ifndef ISC_CHECK_ENSURE
+#define ISC_CHECK_ENSURE 1
+#endif
+
+#ifndef ISC_CHECK_INSIST
+#define ISC_CHECK_INSIST 1
+#endif
+
+#ifndef ISC_CHECK_INVARIANT
+#define ISC_CHECK_INVARIANT 1
+#endif
+
+#if ISC_CHECK_REQUIRE != 0
+#define ISC_REQUIRE(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_require, \
+ #cond), 0)))
+#else
+#define ISC_REQUIRE(cond) ((void) 0)
+#endif /* ISC_CHECK_REQUIRE */
+
+#if ISC_CHECK_ENSURE != 0
+#define ISC_ENSURE(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_ensure, \
+ #cond), 0)))
+#else
+#define ISC_ENSURE(cond) ((void) 0)
+#endif /* ISC_CHECK_ENSURE */
+
+#if ISC_CHECK_INSIST != 0
+#define ISC_INSIST(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_insist, \
+ #cond), 0)))
+#else
+#define ISC_INSIST(cond) ((void) 0)
+#endif /* ISC_CHECK_INSIST */
+
+#if ISC_CHECK_INVARIANT != 0
+#define ISC_INVARIANT(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_invariant, \
+ #cond), 0)))
+#else
+#define ISC_INVARIANT(cond) ((void) 0)
+#endif /* ISC_CHECK_INVARIANT */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_ASSERTIONS_H */
diff --git a/lib/isc/include/isc/backtrace.h b/lib/isc/include/isc/backtrace.h
new file mode 100644
index 0000000..c0e98c0
--- /dev/null
+++ b/lib/isc/include/isc/backtrace.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: backtrace.h,v 1.2 2009/09/01 18:40:25 jinmei Exp $ */
+
+/*! \file isc/backtrace.h
+ * \brief provide a back trace of the running process to help debug problems.
+ *
+ * This module tries to get a back trace of the process using some platform
+ * dependent way when available. It also manages an internal symbol table
+ * that maps function addresses used in the process to their textual symbols.
+ * This module is expected to be used to help debug when some fatal error
+ * happens.
+ *
+ * IMPORTANT NOTE: since the (major) intended use case of this module is
+ * dumping a back trace on a fatal error, normally followed by self termination,
+ * functions defined in this module generally doesn't employ assertion checks
+ * (if it did, a program bug could cause infinite recursive calls to a
+ * backtrace function). These functions still perform minimal checks and return
+ * ISC_R_FAILURE if they detect an error, but the caller should therefore be
+ * very careful about the use of these functions, and generally discouraged to
+ * use them except in an exit path. The exception is
+ * isc_backtrace_getsymbolfromindex(), which is expected to be used in a
+ * non-error-handling context and validates arguments with assertion checks.
+ */
+
+#ifndef ISC_BACKTRACE_H
+#define ISC_BACKTRACE_H 1
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/types.h>
+
+/***
+ *** Types
+ ***/
+struct isc_backtrace_symmap {
+ void *addr;
+ const char *symbol;
+};
+
+extern const int isc__backtrace_nsymbols;
+extern const isc_backtrace_symmap_t isc__backtrace_symtable[];
+
+/***
+ *** Functions
+ ***/
+
+ISC_LANG_BEGINDECLS
+isc_result_t
+isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes);
+/*%<
+ * Get a back trace of the running process above this function itself. On
+ * success, addrs[i] will store the address of the call point of the i-th
+ * stack frame (addrs[0] is the caller of this function). *nframes will store
+ * the total number of frames.
+ *
+ * Requires (note that these are not ensured by assertion checks, see above):
+ *
+ *\li 'addrs' is a valid array containing at least 'maxaddrs' void * entries.
+ *
+ *\li 'nframes' must be non NULL.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_FAILURE
+ *\li #ISC_R_NOTFOUND
+ *\li #ISC_R_NOTIMPLEMENTED
+ */
+
+isc_result_t
+isc_backtrace_getsymbolfromindex(int index, const void **addrp,
+ const char **symbolp);
+/*%<
+ * Returns the content of the internal symbol table of the given index.
+ * On success, *addrsp and *symbolp point to the address and the symbol of
+ * the 'index'th entry of the table, respectively. If 'index' is not in the
+ * range of the symbol table, ISC_R_RANGE will be returned.
+ *
+ * Requires
+ *
+ *\li 'addrp' must be non NULL && '*addrp' == NULL.
+ *
+ *\li 'symbolp' must be non NULL && '*symbolp' == NULL.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_RANGE
+ */
+
+isc_result_t
+isc_backtrace_getsymbol(const void *addr, const char **symbolp,
+ unsigned long *offsetp);
+/*%<
+ * Searches the internal symbol table for the symbol that most matches the
+ * given 'addr'. On success, '*symbolp' will point to the name of function
+ * to which the address 'addr' belong, and '*offsetp' will store the offset
+ * from the function's entry address to 'addr'.
+ *
+ * Requires (note that these are not ensured by assertion checks, see above):
+ *
+ *\li 'symbolp' must be non NULL && '*symbolp' == NULL.
+ *
+ *\li 'offsetp' must be non NULL.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_FAILURE
+ *\li #ISC_R_NOTFOUND
+ */
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_BACKTRACE_H */
diff --git a/lib/isc/include/isc/base32.h b/lib/isc/include/isc/base32.h
new file mode 100644
index 0000000..978a8db
--- /dev/null
+++ b/lib/isc/include/isc/base32.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: base32.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */
+
+#ifndef ISC_BASE32_H
+#define ISC_BASE32_H 1
+
+/*! \file */
+
+/*
+ * Routines for manipulating base 32 and base 32 hex encoded data.
+ * Based on RFC 4648.
+ *
+ * Base 32 hex preserves the sort order of data when it is encoded /
+ * decoded.
+ */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Functions
+ ***/
+
+isc_result_t
+isc_base32_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target);
+isc_result_t
+isc_base32hex_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target);
+/*!<
+ * \brief Convert data into base32 encoded text.
+ *
+ * Notes:
+ *\li The base32 encoded text in 'target' will be divided into
+ * words of at most 'wordlength' characters, separated by
+ * the 'wordbreak' string. No parentheses will surround
+ * the text.
+ *
+ * Requires:
+ *\li 'source' is a region containing binary data
+ *\li 'target' is a text buffer containing available space
+ *\li 'wordbreak' points to a null-terminated string of
+ * zero or more whitespace characters
+ *
+ * Ensures:
+ *\li target will contain the base32 encoded version of the data
+ * in source. The 'used' pointer in target will be advanced as
+ * necessary.
+ */
+
+isc_result_t
+isc_base32_decodestring(const char *cstr, isc_buffer_t *target);
+isc_result_t
+isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target);
+/*!<
+ * \brief Decode a null-terminated base32 string.
+ *
+ * Requires:
+ *\li 'cstr' is non-null.
+ *\li 'target' is a valid buffer.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
+ * fit in 'target'.
+ *\li #ISC_R_BADBASE32 -- 'cstr' is not a valid base32 encoding.
+ *
+ * Other error returns are any possible error code from:
+ *\li isc_lex_create(),
+ *\li isc_lex_openbuffer(),
+ *\li isc_base32_tobuffer().
+ */
+
+isc_result_t
+isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
+isc_result_t
+isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
+/*!<
+ * \brief Convert base32 encoded text from a lexer context into data.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer context
+ *\li 'target' is a buffer containing binary data
+ *\li 'length' is an integer
+ *
+ * Ensures:
+ *\li target will contain the data represented by the base32 encoded
+ * string parsed by the lexer. No more than length bytes will be read,
+ * if length is positive. The 'used' pointer in target will be
+ * advanced as necessary.
+ */
+
+isc_result_t
+isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target);
+isc_result_t
+isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target);
+/*!<
+ * \brief Decode a packed (no white space permitted) base32 region.
+ *
+ * Requires:
+ *\li 'source' is a valid region.
+ *\li 'target' is a valid buffer.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
+ * fit in 'target'.
+ *\li #ISC_R_BADBASE32 -- 'source' is not a valid base32 encoding.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_BASE32_H */
diff --git a/lib/isc/include/isc/base64.h b/lib/isc/include/isc/base64.h
new file mode 100644
index 0000000..e48ef2a
--- /dev/null
+++ b/lib/isc/include/isc/base64.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: base64.h,v 1.22 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_BASE64_H
+#define ISC_BASE64_H 1
+
+/*! \file isc/base64.h */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Functions
+ ***/
+
+isc_result_t
+isc_base64_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target);
+/*!<
+ * \brief Convert data into base64 encoded text.
+ *
+ * Notes:
+ *\li The base64 encoded text in 'target' will be divided into
+ * words of at most 'wordlength' characters, separated by
+ * the 'wordbreak' string. No parentheses will surround
+ * the text.
+ *
+ * Requires:
+ *\li 'source' is a region containing binary data
+ *\li 'target' is a text buffer containing available space
+ *\li 'wordbreak' points to a null-terminated string of
+ * zero or more whitespace characters
+ *
+ * Ensures:
+ *\li target will contain the base64 encoded version of the data
+ * in source. The 'used' pointer in target will be advanced as
+ * necessary.
+ */
+
+isc_result_t
+isc_base64_decodestring(const char *cstr, isc_buffer_t *target);
+/*!<
+ * \brief Decode a null-terminated base64 string.
+ *
+ * Requires:
+ *\li 'cstr' is non-null.
+ *\li 'target' is a valid buffer.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
+ * fit in 'target'.
+ *\li #ISC_R_BADBASE64 -- 'cstr' is not a valid base64 encoding.
+ *
+ * Other error returns are any possible error code from:
+ *\li isc_lex_create(),
+ *\li isc_lex_openbuffer(),
+ *\li isc_base64_tobuffer().
+ */
+
+isc_result_t
+isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
+/*!<
+ * \brief Convert base64 encoded text from a lexer context into data.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer context
+ *\li 'target' is a buffer containing binary data
+ *\li 'length' is an integer
+ *
+ * Ensures:
+ *\li target will contain the data represented by the base64 encoded
+ * string parsed by the lexer. No more than length bytes will be read,
+ * if length is positive. The 'used' pointer in target will be
+ * advanced as necessary.
+ */
+
+
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_BASE64_H */
diff --git a/lib/isc/include/isc/bind9.h b/lib/isc/include/isc/bind9.h
new file mode 100644
index 0000000..00bcb24
--- /dev/null
+++ b/lib/isc/include/isc/bind9.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bind9.h,v 1.2 2009/12/05 23:31:41 each Exp $ */
+
+#ifndef ISC_BIND9_H
+#define ISC_BIND9_H 1
+
+/*
+ * This determines whether we are building BIND9 or using the exported
+ * libisc/libdns libraries. The version of this file included in the
+ * standard BIND9 build defines BIND9; the version included with the
+ * exportable libraries does not.
+ */
+#define BIND9 1
+
+#endif /* ISC_BIND9_H */
diff --git a/lib/isc/include/isc/bitstring.h b/lib/isc/include/isc/bitstring.h
new file mode 100644
index 0000000..252d111
--- /dev/null
+++ b/lib/isc/include/isc/bitstring.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bitstring.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_BITSTRING_H
+#define ISC_BITSTRING_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/bitstring.h
+ *
+ * \brief Bitstring manipulation functions.
+ *
+ * A bitstring is a packed array of bits, stored in a contiguous
+ * sequence of octets. The "most significant bit" (msb) of a bitstring
+ * is the high bit of the first octet. The "least significant bit" of a
+ * bitstring is the low bit of the last octet.
+ *
+ * Two bit numbering schemes are supported, "msb0" and "lsb0".
+ *
+ * In the "msb0" scheme, bit number 0 designates the most significant bit,
+ * and any padding bits required to make the bitstring a multiple of 8 bits
+ * long are added to the least significant end of the last octet.
+ *
+ * In the "lsb0" scheme, bit number 0 designates the least significant bit,
+ * and any padding bits required to make the bitstring a multiple of 8 bits
+ * long are added to the most significant end of the first octet.
+ *
+ * E.g., consider the bitstring "11010001111". This bitstring is 11 bits
+ * long and will take two octets. Let "p" denote a pad bit. In the msb0
+ * encoding, it would be
+ *
+ * \verbatim
+ * Octet 0 Octet 1
+ * |
+ * 1 1 0 1 0 0 0 1 | 1 1 1 p p p p p
+ * ^ | ^
+ * | |
+ * bit 0 bit 15
+ * \endverbatim
+ *
+ * In the lsb0 encoding, it would be
+ *
+ * \verbatim
+ * Octet 0 Octet 1
+ * |
+ * p p p p p 1 1 0 | 1 0 0 0 1 1 1 1
+ * ^ | ^
+ * | |
+ * bit 15 bit 0
+ * \endverbatim
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Types
+ ***/
+
+struct isc_bitstring {
+ unsigned int magic;
+ unsigned char * data;
+ unsigned int length;
+ unsigned int size;
+ isc_boolean_t lsb0;
+};
+
+/***
+ *** Functions
+ ***/
+
+void
+isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data,
+ unsigned int length, unsigned int size, isc_boolean_t lsb0);
+/*!<
+ * \brief Make 'bitstring' refer to the bitstring of 'size' bits starting
+ * at 'data'. 'length' bits of the bitstring are valid. If 'lsb0'
+ * is set then, bit 0 refers to the least significant bit of the
+ * bitstring. Otherwise bit 0 is the most significant bit.
+ *
+ * Requires:
+ *
+ *\li 'bitstring' points to a isc_bitstring_t.
+ *
+ *\li 'data' points to an array of unsigned char large enough to hold
+ * 'size' bits.
+ *
+ *\li 'length' <= 'size'.
+ *
+ * Ensures:
+ *
+ *\li 'bitstring' is a valid bitstring.
+ */
+
+void
+isc_bitstring_invalidate(isc_bitstring_t *bitstring);
+/*!<
+ * \brief Invalidate 'bitstring'.
+ *
+ * Requires:
+ *
+ *\li 'bitstring' is a valid bitstring.
+ *
+ * Ensures:
+ *
+ *\li 'bitstring' is not a valid bitstring.
+ */
+
+void
+isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
+ isc_bitstring_t *target, unsigned int tbitpos,
+ unsigned int n);
+/*!<
+ * \brief Starting at bit 'sbitpos', copy 'n' bits from 'source' to
+ * the 'n' bits of 'target' starting at 'tbitpos'.
+ *
+ * Requires:
+ *
+ *\li 'source' and target are valid bitstrings with the same lsb0 setting.
+ *
+ *\li 'sbitpos' + 'n' is less than or equal to the length of 'source'.
+ *
+ *\li 'tbitpos' + 'n' is less than or equal to the size of 'target'.
+ *
+ * Ensures:
+ *
+ *\li The specified bits have been copied, and the length of 'target'
+ * adjusted (if required).
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_BITSTRING_H */
diff --git a/lib/isc/include/isc/boolean.h b/lib/isc/include/isc/boolean.h
new file mode 100644
index 0000000..348b096
--- /dev/null
+++ b/lib/isc/include/isc/boolean.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: boolean.h,v 1.19 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_BOOLEAN_H
+#define ISC_BOOLEAN_H 1
+
+/*! \file isc/boolean.h */
+
+typedef enum { isc_boolean_false = 0, isc_boolean_true = 1 } isc_boolean_t;
+
+#define ISC_FALSE isc_boolean_false
+#define ISC_TRUE isc_boolean_true
+#define ISC_TF(x) ((x) ? ISC_TRUE : ISC_FALSE)
+
+#endif /* ISC_BOOLEAN_H */
diff --git a/lib/isc/include/isc/buffer.h b/lib/isc/include/isc/buffer.h
new file mode 100644
index 0000000..ae7e4c3
--- /dev/null
+++ b/lib/isc/include/isc/buffer.h
@@ -0,0 +1,904 @@
+/*
+ * Copyright (C) 2004-2008, 2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: buffer.h,v 1.55 2010/12/20 23:47:21 tbox Exp $ */
+
+#ifndef ISC_BUFFER_H
+#define ISC_BUFFER_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/buffer.h
+ *
+ * \brief A buffer is a region of memory, together with a set of related subregions.
+ * Buffers are used for parsing and I/O operations.
+ *
+ * The 'used region' and the 'available' region are disjoint, and their
+ * union is the buffer's region. The used region extends from the beginning
+ * of the buffer region to the last used byte. The available region
+ * extends from one byte greater than the last used byte to the end of the
+ * buffer's region. The size of the used region can be changed using various
+ * buffer commands. Initially, the used region is empty.
+ *
+ * The used region is further subdivided into two disjoint regions: the
+ * 'consumed region' and the 'remaining region'. The union of these two
+ * regions is the used region. The consumed region extends from the beginning
+ * of the used region to the byte before the 'current' offset (if any). The
+ * 'remaining' region the current pointer to the end of the used
+ * region. The size of the consumed region can be changed using various
+ * buffer commands. Initially, the consumed region is empty.
+ *
+ * The 'active region' is an (optional) subregion of the remaining region.
+ * It extends from the current offset to an offset in the remaining region
+ * that is selected with isc_buffer_setactive(). Initially, the active region
+ * is empty. If the current offset advances beyond the chosen offset, the
+ * active region will also be empty.
+ *
+ * \verbatim
+ * /------------entire length---------------\
+ * /----- used region -----\/-- available --\
+ * +----------------------------------------+
+ * | consumed | remaining | |
+ * +----------------------------------------+
+ * a b c d e
+ *
+ * a == base of buffer.
+ * b == current pointer. Can be anywhere between a and d.
+ * c == active pointer. Meaningful between b and d.
+ * d == used pointer.
+ * e == length of buffer.
+ *
+ * a-e == entire length of buffer.
+ * a-d == used region.
+ * a-b == consumed region.
+ * b-d == remaining region.
+ * b-c == optional active region.
+ *\endverbatim
+ *
+ * The following invariants are maintained by all routines:
+ *
+ *\code
+ * length > 0
+ *
+ * base is a valid pointer to length bytes of memory
+ *
+ * 0 <= used <= length
+ *
+ * 0 <= current <= used
+ *
+ * 0 <= active <= used
+ * (although active < current implies empty active region)
+ *\endcode
+ *
+ * \li MP:
+ * Buffers have no synchronization. Clients must ensure exclusive
+ * access.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * Memory: 1 pointer + 6 unsigned integers per buffer.
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/lang.h>
+#include <isc/magic.h>
+#include <isc/types.h>
+
+/*!
+ * To make many functions be inline macros (via \#define) define this.
+ * If it is undefined, a function will be used.
+ */
+/* #define ISC_BUFFER_USEINLINE */
+
+ISC_LANG_BEGINDECLS
+
+/*@{*/
+/*!
+ *** Magic numbers
+ ***/
+#define ISC_BUFFER_MAGIC 0x42756621U /* Buf!. */
+#define ISC_BUFFER_VALID(b) ISC_MAGIC_VALID(b, ISC_BUFFER_MAGIC)
+/*@}*/
+
+/*
+ * The following macros MUST be used only on valid buffers. It is the
+ * caller's responsibility to ensure this by using the ISC_BUFFER_VALID
+ * check above, or by calling another isc_buffer_*() function (rather than
+ * another macro.)
+ */
+
+/*@{*/
+/*!
+ * Fundamental buffer elements. (A through E in the introductory comment.)
+ */
+#define isc_buffer_base(b) ((void *)(b)->base) /*a*/
+#define isc_buffer_current(b) \
+ ((void *)((unsigned char *)(b)->base + (b)->current)) /*b*/
+#define isc_buffer_active(b) \
+ ((void *)((unsigned char *)(b)->base + (b)->active)) /*c*/
+#define isc_buffer_used(b) \
+ ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
+#define isc_buffer_length(b) ((b)->length) /*e*/
+/*@}*/
+
+/*@{*/
+/*!
+ * Derived lengths. (Described in the introductory comment.)
+ */
+#define isc_buffer_usedlength(b) ((b)->used) /* d-a */
+#define isc_buffer_consumedlength(b) ((b)->current) /* b-a */
+#define isc_buffer_remaininglength(b) ((b)->used - (b)->current) /* d-b */
+#define isc_buffer_activelength(b) ((b)->active - (b)->current) /* c-b */
+#define isc_buffer_availablelength(b) ((b)->length - (b)->used) /* e-d */
+/*@}*/
+
+/*!
+ * Note that the buffer structure is public. This is principally so buffer
+ * operations can be implemented using macros. Applications are strongly
+ * discouraged from directly manipulating the structure.
+ */
+
+struct isc_buffer {
+ unsigned int magic;
+ void *base;
+ /*@{*/
+ /*! The following integers are byte offsets from 'base'. */
+ unsigned int length;
+ unsigned int used;
+ unsigned int current;
+ unsigned int active;
+ /*@}*/
+ /*! linkable */
+ ISC_LINK(isc_buffer_t) link;
+ /*! private internal elements */
+ isc_mem_t *mctx;
+};
+
+/***
+ *** Functions
+ ***/
+
+isc_result_t
+isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
+ unsigned int length);
+/*!<
+ * \brief Allocate a dynamic linkable buffer which has "length" bytes in the
+ * data region.
+ *
+ * Requires:
+ *\li "mctx" is valid.
+ *
+ *\li "dynbuffer" is non-NULL, and "*dynbuffer" is NULL.
+ *
+ * Returns:
+ *\li ISC_R_SUCCESS - success
+ *\li ISC_R_NOMEMORY - no memory available
+ *
+ * Note:
+ *\li Changing the buffer's length field is not permitted.
+ */
+
+void
+isc_buffer_free(isc_buffer_t **dynbuffer);
+/*!<
+ * \brief Release resources allocated for a dynamic buffer.
+ *
+ * Requires:
+ *\li "dynbuffer" is not NULL.
+ *
+ *\li "*dynbuffer" is a valid dynamic buffer.
+ *
+ * Ensures:
+ *\li "*dynbuffer" will be NULL on return, and all memory associated with
+ * the dynamic buffer is returned to the memory context used in
+ * isc_buffer_allocate().
+ */
+
+void
+isc__buffer_init(isc_buffer_t *b, const void *base, unsigned int length);
+/*!<
+ * \brief Make 'b' refer to the 'length'-byte region starting at base.
+ *
+ * Requires:
+ *
+ *\li 'length' > 0
+ *
+ *\li 'base' is a pointer to a sequence of 'length' bytes.
+ *
+ */
+
+void
+isc__buffer_initnull(isc_buffer_t *b);
+/*!<
+ *\brief Initialize a buffer 'b' with a null data and zero length/
+ */
+
+void
+isc_buffer_reinit(isc_buffer_t *b, void *base, unsigned int length);
+/*!<
+ * \brief Make 'b' refer to the 'length'-byte region starting at base.
+ * Any existing data will be copied.
+ *
+ * Requires:
+ *
+ *\li 'length' > 0 AND length >= previous length
+ *
+ *\li 'base' is a pointer to a sequence of 'length' bytes.
+ *
+ */
+
+void
+isc__buffer_invalidate(isc_buffer_t *b);
+/*!<
+ * \brief Make 'b' an invalid buffer.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ * Ensures:
+ *\li If assertion checking is enabled, future attempts to use 'b' without
+ * calling isc_buffer_init() on it will cause an assertion failure.
+ */
+
+void
+isc__buffer_region(isc_buffer_t *b, isc_region_t *r);
+/*!<
+ * \brief Make 'r' refer to the region of 'b'.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'r' points to a region structure.
+ */
+
+void
+isc__buffer_usedregion(isc_buffer_t *b, isc_region_t *r);
+/*!<
+ * \brief Make 'r' refer to the used region of 'b'.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'r' points to a region structure.
+ */
+
+void
+isc__buffer_availableregion(isc_buffer_t *b, isc_region_t *r);
+/*!<
+ * \brief Make 'r' refer to the available region of 'b'.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'r' points to a region structure.
+ */
+
+void
+isc__buffer_add(isc_buffer_t *b, unsigned int n);
+/*!<
+ * \brief Increase the 'used' region of 'b' by 'n' bytes.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer
+ *
+ *\li used + n <= length
+ *
+ */
+
+void
+isc__buffer_subtract(isc_buffer_t *b, unsigned int n);
+/*!<
+ * \brief Decrease the 'used' region of 'b' by 'n' bytes.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer
+ *
+ *\li used >= n
+ *
+ */
+
+void
+isc__buffer_clear(isc_buffer_t *b);
+/*!<
+ * \brief Make the used region empty.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer
+ *
+ * Ensures:
+ *
+ *\li used = 0
+ *
+ */
+
+void
+isc__buffer_consumedregion(isc_buffer_t *b, isc_region_t *r);
+/*!<
+ * \brief Make 'r' refer to the consumed region of 'b'.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'r' points to a region structure.
+ */
+
+void
+isc__buffer_remainingregion(isc_buffer_t *b, isc_region_t *r);
+/*!<
+ * \brief Make 'r' refer to the remaining region of 'b'.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'r' points to a region structure.
+ */
+
+void
+isc__buffer_activeregion(isc_buffer_t *b, isc_region_t *r);
+/*!<
+ * \brief Make 'r' refer to the active region of 'b'.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'r' points to a region structure.
+ */
+
+void
+isc__buffer_setactive(isc_buffer_t *b, unsigned int n);
+/*!<
+ * \brief Sets the end of the active region 'n' bytes after current.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li current + n <= used
+ */
+
+void
+isc__buffer_first(isc_buffer_t *b);
+/*!<
+ * \brief Make the consumed region empty.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer
+ *
+ * Ensures:
+ *
+ *\li current == 0
+ *
+ */
+
+void
+isc__buffer_forward(isc_buffer_t *b, unsigned int n);
+/*!<
+ * \brief Increase the 'consumed' region of 'b' by 'n' bytes.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer
+ *
+ *\li current + n <= used
+ *
+ */
+
+void
+isc__buffer_back(isc_buffer_t *b, unsigned int n);
+/*!<
+ * \brief Decrease the 'consumed' region of 'b' by 'n' bytes.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer
+ *
+ *\li n <= current
+ *
+ */
+
+void
+isc_buffer_compact(isc_buffer_t *b);
+/*!<
+ * \brief Compact the used region by moving the remaining region so it occurs
+ * at the start of the buffer. The used region is shrunk by the size of
+ * the consumed region, and the consumed region is then made empty.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer
+ *
+ * Ensures:
+ *
+ *\li current == 0
+ *
+ *\li The size of the used region is now equal to the size of the remaining
+ * region (as it was before the call). The contents of the used region
+ * are those of the remaining region (as it was before the call).
+ */
+
+isc_uint8_t
+isc_buffer_getuint8(isc_buffer_t *b);
+/*!<
+ * \brief Read an unsigned 8-bit integer from 'b' and return it.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the available region of 'b' is at least 1.
+ *
+ * Ensures:
+ *
+ *\li The current pointer in 'b' is advanced by 1.
+ *
+ * Returns:
+ *
+ *\li A 8-bit unsigned integer.
+ */
+
+void
+isc__buffer_putuint8(isc_buffer_t *b, isc_uint8_t val);
+/*!<
+ * \brief Store an unsigned 8-bit integer from 'val' into 'b'.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the unused region of 'b' is at least 1.
+ *
+ * Ensures:
+ *\li The used pointer in 'b' is advanced by 1.
+ */
+
+isc_uint16_t
+isc_buffer_getuint16(isc_buffer_t *b);
+/*!<
+ * \brief Read an unsigned 16-bit integer in network byte order from 'b', convert
+ * it to host byte order, and return it.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the available region of 'b' is at least 2.
+ *
+ * Ensures:
+ *
+ *\li The current pointer in 'b' is advanced by 2.
+ *
+ * Returns:
+ *
+ *\li A 16-bit unsigned integer.
+ */
+
+void
+isc__buffer_putuint16(isc_buffer_t *b, isc_uint16_t val);
+/*!<
+ * \brief Store an unsigned 16-bit integer in host byte order from 'val'
+ * into 'b' in network byte order.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the unused region of 'b' is at least 2.
+ *
+ * Ensures:
+ *\li The used pointer in 'b' is advanced by 2.
+ */
+
+isc_uint32_t
+isc_buffer_getuint32(isc_buffer_t *b);
+/*!<
+ * \brief Read an unsigned 32-bit integer in network byte order from 'b', convert
+ * it to host byte order, and return it.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the available region of 'b' is at least 4.
+ *
+ * Ensures:
+ *
+ *\li The current pointer in 'b' is advanced by 4.
+ *
+ * Returns:
+ *
+ *\li A 32-bit unsigned integer.
+ */
+
+void
+isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val);
+/*!<
+ * \brief Store an unsigned 32-bit integer in host byte order from 'val'
+ * into 'b' in network byte order.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the unused region of 'b' is at least 4.
+ *
+ * Ensures:
+ *\li The used pointer in 'b' is advanced by 4.
+ */
+
+isc_uint64_t
+isc_buffer_getuint48(isc_buffer_t *b);
+/*!<
+ * \brief Read an unsigned 48-bit integer in network byte order from 'b',
+ * convert it to host byte order, and return it.
+ *
+ * Requires:
+ *
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the available region of 'b' is at least 6.
+ *
+ * Ensures:
+ *
+ *\li The current pointer in 'b' is advanced by 6.
+ *
+ * Returns:
+ *
+ *\li A 48-bit unsigned integer (stored in a 64-bit integer).
+ */
+
+void
+isc__buffer_putuint48(isc_buffer_t *b, isc_uint64_t val);
+/*!<
+ * \brief Store an unsigned 48-bit integer in host byte order from 'val'
+ * into 'b' in network byte order.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ *\li The length of the unused region of 'b' is at least 6.
+ *
+ * Ensures:
+ *\li The used pointer in 'b' is advanced by 6.
+ */
+
+void
+isc__buffer_putuint24(isc_buffer_t *b, isc_uint32_t val);
+/*!<
+ * Store an unsigned 24-bit integer in host byte order from 'val'
+ * into 'b' in network byte order.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ * The length of the unused region of 'b' is at least 3.
+ *
+ * Ensures:
+ *\li The used pointer in 'b' is advanced by 3.
+ */
+
+void
+isc__buffer_putmem(isc_buffer_t *b, const unsigned char *base,
+ unsigned int length);
+/*!<
+ * \brief Copy 'length' bytes of memory at 'base' into 'b'.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'base' points to 'length' bytes of valid memory.
+ *
+ */
+
+void
+isc__buffer_putstr(isc_buffer_t *b, const char *source);
+/*!<
+ * \brief Copy 'source' into 'b', not including terminating NUL.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'source' to be a valid NULL terminated string.
+ *
+ *\li strlen(source) <= isc_buffer_available(b)
+ */
+
+isc_result_t
+isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r);
+/*!<
+ * \brief Copy the contents of 'r' into 'b'.
+ *
+ * Requires:
+ *\li 'b' is a valid buffer.
+ *
+ *\li 'r' is a valid region.
+ *
+ * Returns:
+ *
+ *\li ISC_R_SUCCESS
+ *\li ISC_R_NOSPACE The available region of 'b' is not
+ * big enough.
+ */
+
+ISC_LANG_ENDDECLS
+
+/*
+ * Inline macro versions of the functions. These should never be called
+ * directly by an application, but will be used by the functions within
+ * buffer.c. The callers should always use "isc_buffer_*()" names, never
+ * ones beginning with "isc__"
+ */
+
+/*! \note
+ * XXXDCL Something more could be done with initializing buffers that
+ * point to const data. For example, a new function, isc_buffer_initconst,
+ * could be used, and a new boolean flag in the buffer structure could
+ * indicate whether the buffer was initialized with that function.
+ * (isc_bufer_init itself would be reprototyped to *not* have its "base"
+ * parameter be const.) Then if the boolean were true, the isc_buffer_put*
+ * functions could assert a contractual requirement for a non-const buffer.
+ * One drawback is that the isc_buffer_* functions (macros) that return
+ * pointers would still need to return non-const pointers to avoid compiler
+ * warnings, so it would be up to code that uses them to have to deal
+ * with the possibility that the buffer was initialized as const --
+ * a problem that they *already* have to deal with but have absolutely
+ * no ability to. With a new isc_buffer_isconst() function returning
+ * true/false, they could at least assert a contractual requirement for
+ * non-const buffers when needed.
+ */
+#define ISC__BUFFER_INIT(_b, _base, _length) \
+ do { \
+ union { \
+ const void * konst; \
+ void * var; \
+ } _u; \
+ _u.konst = (_base); \
+ (_b)->base = _u.var; \
+ (_b)->length = (_length); \
+ (_b)->used = 0; \
+ (_b)->current = 0; \
+ (_b)->active = 0; \
+ (_b)->mctx = NULL; \
+ ISC_LINK_INIT(_b, link); \
+ (_b)->magic = ISC_BUFFER_MAGIC; \
+ } while (0)
+
+#define ISC__BUFFER_INITNULL(_b) ISC__BUFFER_INIT(_b, NULL, 0)
+
+#define ISC__BUFFER_INVALIDATE(_b) \
+ do { \
+ (_b)->magic = 0; \
+ (_b)->base = NULL; \
+ (_b)->length = 0; \
+ (_b)->used = 0; \
+ (_b)->current = 0; \
+ (_b)->active = 0; \
+ } while (0)
+
+#define ISC__BUFFER_REGION(_b, _r) \
+ do { \
+ (_r)->base = (_b)->base; \
+ (_r)->length = (_b)->length; \
+ } while (0)
+
+#define ISC__BUFFER_USEDREGION(_b, _r) \
+ do { \
+ (_r)->base = (_b)->base; \
+ (_r)->length = (_b)->used; \
+ } while (0)
+
+#define ISC__BUFFER_AVAILABLEREGION(_b, _r) \
+ do { \
+ (_r)->base = isc_buffer_used(_b); \
+ (_r)->length = isc_buffer_availablelength(_b); \
+ } while (0)
+
+#define ISC__BUFFER_ADD(_b, _n) \
+ do { \
+ (_b)->used += (_n); \
+ } while (0)
+
+#define ISC__BUFFER_SUBTRACT(_b, _n) \
+ do { \
+ (_b)->used -= (_n); \
+ if ((_b)->current > (_b)->used) \
+ (_b)->current = (_b)->used; \
+ if ((_b)->active > (_b)->used) \
+ (_b)->active = (_b)->used; \
+ } while (0)
+
+#define ISC__BUFFER_CLEAR(_b) \
+ do { \
+ (_b)->used = 0; \
+ (_b)->current = 0; \
+ (_b)->active = 0; \
+ } while (0)
+
+#define ISC__BUFFER_CONSUMEDREGION(_b, _r) \
+ do { \
+ (_r)->base = (_b)->base; \
+ (_r)->length = (_b)->current; \
+ } while (0)
+
+#define ISC__BUFFER_REMAININGREGION(_b, _r) \
+ do { \
+ (_r)->base = isc_buffer_current(_b); \
+ (_r)->length = isc_buffer_remaininglength(_b); \
+ } while (0)
+
+#define ISC__BUFFER_ACTIVEREGION(_b, _r) \
+ do { \
+ if ((_b)->current < (_b)->active) { \
+ (_r)->base = isc_buffer_current(_b); \
+ (_r)->length = isc_buffer_activelength(_b); \
+ } else { \
+ (_r)->base = NULL; \
+ (_r)->length = 0; \
+ } \
+ } while (0)
+
+#define ISC__BUFFER_SETACTIVE(_b, _n) \
+ do { \
+ (_b)->active = (_b)->current + (_n); \
+ } while (0)
+
+#define ISC__BUFFER_FIRST(_b) \
+ do { \
+ (_b)->current = 0; \
+ } while (0)
+
+#define ISC__BUFFER_FORWARD(_b, _n) \
+ do { \
+ (_b)->current += (_n); \
+ } while (0)
+
+#define ISC__BUFFER_BACK(_b, _n) \
+ do { \
+ (_b)->current -= (_n); \
+ } while (0)
+
+#define ISC__BUFFER_PUTMEM(_b, _base, _length) \
+ do { \
+ memcpy(isc_buffer_used(_b), (_base), (_length)); \
+ (_b)->used += (_length); \
+ } while (0)
+
+#define ISC__BUFFER_PUTSTR(_b, _source) \
+ do { \
+ unsigned int _length; \
+ unsigned char *_cp; \
+ _length = strlen(_source); \
+ _cp = isc_buffer_used(_b); \
+ memcpy(_cp, (_source), _length); \
+ (_b)->used += (_length); \
+ } while (0)
+
+#define ISC__BUFFER_PUTUINT8(_b, _val) \
+ do { \
+ unsigned char *_cp; \
+ isc_uint8_t _val2 = (_val); \
+ _cp = isc_buffer_used(_b); \
+ (_b)->used++; \
+ _cp[0] = _val2 & 0x00ff; \
+ } while (0)
+
+#define ISC__BUFFER_PUTUINT16(_b, _val) \
+ do { \
+ unsigned char *_cp; \
+ isc_uint16_t _val2 = (_val); \
+ _cp = isc_buffer_used(_b); \
+ (_b)->used += 2; \
+ _cp[0] = (unsigned char)((_val2 & 0xff00U) >> 8); \
+ _cp[1] = (unsigned char)(_val2 & 0x00ffU); \
+ } while (0)
+
+#define ISC__BUFFER_PUTUINT24(_b, _val) \
+ do { \
+ unsigned char *_cp; \
+ isc_uint32_t _val2 = (_val); \
+ _cp = isc_buffer_used(_b); \
+ (_b)->used += 3; \
+ _cp[0] = (unsigned char)((_val2 & 0xff0000U) >> 16); \
+ _cp[1] = (unsigned char)((_val2 & 0xff00U) >> 8); \
+ _cp[2] = (unsigned char)(_val2 & 0x00ffU); \
+ } while (0)
+
+#define ISC__BUFFER_PUTUINT32(_b, _val) \
+ do { \
+ unsigned char *_cp; \
+ isc_uint32_t _val2 = (_val); \
+ _cp = isc_buffer_used(_b); \
+ (_b)->used += 4; \
+ _cp[0] = (unsigned char)((_val2 & 0xff000000) >> 24); \
+ _cp[1] = (unsigned char)((_val2 & 0x00ff0000) >> 16); \
+ _cp[2] = (unsigned char)((_val2 & 0x0000ff00) >> 8); \
+ _cp[3] = (unsigned char)((_val2 & 0x000000ff)); \
+ } while (0)
+
+#if defined(ISC_BUFFER_USEINLINE)
+#define isc_buffer_init ISC__BUFFER_INIT
+#define isc_buffer_initnull ISC__BUFFER_INITNULL
+#define isc_buffer_invalidate ISC__BUFFER_INVALIDATE
+#define isc_buffer_region ISC__BUFFER_REGION
+#define isc_buffer_usedregion ISC__BUFFER_USEDREGION
+#define isc_buffer_availableregion ISC__BUFFER_AVAILABLEREGION
+#define isc_buffer_add ISC__BUFFER_ADD
+#define isc_buffer_subtract ISC__BUFFER_SUBTRACT
+#define isc_buffer_clear ISC__BUFFER_CLEAR
+#define isc_buffer_consumedregion ISC__BUFFER_CONSUMEDREGION
+#define isc_buffer_remainingregion ISC__BUFFER_REMAININGREGION
+#define isc_buffer_activeregion ISC__BUFFER_ACTIVEREGION
+#define isc_buffer_setactive ISC__BUFFER_SETACTIVE
+#define isc_buffer_first ISC__BUFFER_FIRST
+#define isc_buffer_forward ISC__BUFFER_FORWARD
+#define isc_buffer_back ISC__BUFFER_BACK
+#define isc_buffer_putmem ISC__BUFFER_PUTMEM
+#define isc_buffer_putstr ISC__BUFFER_PUTSTR
+#define isc_buffer_putuint8 ISC__BUFFER_PUTUINT8
+#define isc_buffer_putuint16 ISC__BUFFER_PUTUINT16
+#define isc_buffer_putuint24 ISC__BUFFER_PUTUINT24
+#define isc_buffer_putuint32 ISC__BUFFER_PUTUINT32
+#else
+#define isc_buffer_init isc__buffer_init
+#define isc_buffer_initnull isc__buffer_initnull
+#define isc_buffer_invalidate isc__buffer_invalidate
+#define isc_buffer_region isc__buffer_region
+#define isc_buffer_usedregion isc__buffer_usedregion
+#define isc_buffer_availableregion isc__buffer_availableregion
+#define isc_buffer_add isc__buffer_add
+#define isc_buffer_subtract isc__buffer_subtract
+#define isc_buffer_clear isc__buffer_clear
+#define isc_buffer_consumedregion isc__buffer_consumedregion
+#define isc_buffer_remainingregion isc__buffer_remainingregion
+#define isc_buffer_activeregion isc__buffer_activeregion
+#define isc_buffer_setactive isc__buffer_setactive
+#define isc_buffer_first isc__buffer_first
+#define isc_buffer_forward isc__buffer_forward
+#define isc_buffer_back isc__buffer_back
+#define isc_buffer_putmem isc__buffer_putmem
+#define isc_buffer_putstr isc__buffer_putstr
+#define isc_buffer_putuint8 isc__buffer_putuint8
+#define isc_buffer_putuint16 isc__buffer_putuint16
+#define isc_buffer_putuint24 isc__buffer_putuint24
+#define isc_buffer_putuint32 isc__buffer_putuint32
+#endif
+
+/*
+ * No inline method for this one (yet).
+ */
+#define isc_buffer_putuint48 isc__buffer_putuint48
+
+#endif /* ISC_BUFFER_H */
diff --git a/lib/isc/include/isc/bufferlist.h b/lib/isc/include/isc/bufferlist.h
new file mode 100644
index 0000000..54e00c7
--- /dev/null
+++ b/lib/isc/include/isc/bufferlist.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bufferlist.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_BUFFERLIST_H
+#define ISC_BUFFERLIST_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/bufferlist.h
+ *
+ *
+ *\brief Buffer lists have no synchronization. Clients must ensure exclusive
+ * access.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Functions
+ ***/
+
+unsigned int
+isc_bufferlist_usedcount(isc_bufferlist_t *bl);
+/*!<
+ * \brief Return the length of the sum of all used regions of all buffers in
+ * the buffer list 'bl'
+ *
+ * Requires:
+ *
+ *\li 'bl' is not NULL.
+ *
+ * Returns:
+ *\li sum of all used regions' lengths.
+ */
+
+unsigned int
+isc_bufferlist_availablecount(isc_bufferlist_t *bl);
+/*!<
+ * \brief Return the length of the sum of all available regions of all buffers in
+ * the buffer list 'bl'
+ *
+ * Requires:
+ *
+ *\li 'bl' is not NULL.
+ *
+ * Returns:
+ *\li sum of all available regions' lengths.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_BUFFERLIST_H */
diff --git a/lib/isc/include/isc/commandline.h b/lib/isc/include/isc/commandline.h
new file mode 100644
index 0000000..384640a
--- /dev/null
+++ b/lib/isc/include/isc/commandline.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: commandline.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_COMMANDLINE_H
+#define ISC_COMMANDLINE_H 1
+
+/*! \file isc/commandline.h */
+
+#include <isc/boolean.h>
+#include <isc/lang.h>
+#include <isc/platform.h>
+
+/*% Index into parent argv vector. */
+LIBISC_EXTERNAL_DATA extern int isc_commandline_index;
+/*% Character checked for validity. */
+LIBISC_EXTERNAL_DATA extern int isc_commandline_option;
+/*% Argument associated with option. */
+LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument;
+/*% For printing error messages. */
+LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname;
+/*% Print error message. */
+LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_errprint;
+/*% Reset getopt. */
+LIBISC_EXTERNAL_DATA extern isc_boolean_t isc_commandline_reset;
+
+ISC_LANG_BEGINDECLS
+
+/*% parse command line */
+int
+isc_commandline_parse(int argc, char * const *argv, const char *options);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_COMMANDLINE_H */
diff --git a/lib/isc/include/isc/entropy.h b/lib/isc/include/isc/entropy.h
new file mode 100644
index 0000000..d28f29a
--- /dev/null
+++ b/lib/isc/include/isc/entropy.h
@@ -0,0 +1,314 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: entropy.h,v 1.35 2009/10/19 02:37:08 marka Exp $ */
+
+#ifndef ISC_ENTROPY_H
+#define ISC_ENTROPY_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/entropy.h
+ * \brief The entropy API
+ *
+ * \li MP:
+ * The entropy object is locked internally. All callbacks into
+ * application-provided functions (for setup, gathering, and
+ * shutdown of sources) are guaranteed to be called with the
+ * entropy API lock held. This means these functions are
+ * not permitted to call back into the entropy API.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * A buffer, used as an entropy pool.
+ *
+ * \li Security:
+ * While this code is believed to implement good entropy gathering
+ * and distribution, it has not been reviewed by a cryptographic
+ * expert.
+ * Since the added entropy is only as good as the sources used,
+ * this module could hand out bad data and never know it.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/*@{*/
+/*% Entropy callback function. */
+typedef isc_result_t (*isc_entropystart_t)(isc_entropysource_t *source,
+ void *arg, isc_boolean_t blocking);
+typedef isc_result_t (*isc_entropyget_t)(isc_entropysource_t *source,
+ void *arg, isc_boolean_t blocking);
+typedef void (*isc_entropystop_t)(isc_entropysource_t *source, void *arg);
+/*@}*/
+
+/***
+ *** Flags.
+ ***/
+
+/*!
+ * \brief
+ * Extract only "good" data; return failure if there is not enough
+ * data available and there are no sources which we can poll to get
+ * data, or those sources are empty.
+ *
+ *
+ */
+#define ISC_ENTROPY_GOODONLY 0x00000001U
+/*!
+ * \brief
+ * Extract as much good data as possible, but if there isn't enough
+ * at hand, return what is available. This flag only makes sense
+ * when used with _GOODONLY.
+ */
+#define ISC_ENTROPY_PARTIAL 0x00000002U
+/*!
+ * \brief
+ * Block the task until data is available. This is contrary to the
+ * ISC task system, where tasks should never block. However, if
+ * this is a special purpose application where blocking a task is
+ * acceptable (say, an offline zone signer) this flag may be set.
+ * This flag only makes sense when used with _GOODONLY, and will
+ * block regardless of the setting for _PARTIAL.
+ */
+#define ISC_ENTROPY_BLOCKING 0x00000004U
+
+/*!
+ * \brief
+ * Estimate the amount of entropy contained in the sample pool.
+ * If this is not set, the source will be gathered and periodically
+ * mixed into the entropy pool, but no increment in contained entropy
+ * will be assumed. This flag only makes sense on sample sources.
+ */
+#define ISC_ENTROPYSOURCE_ESTIMATE 0x00000001U
+
+/*
+ * For use with isc_entropy_usebestsource().
+ */
+/*!
+ * \brief
+ * Use the keyboard as the only entropy source.
+ */
+#define ISC_ENTROPY_KEYBOARDYES 1
+/*!
+ * \brief
+ * Never use the keyboard as an entropy source.
+ */
+#define ISC_ENTROPY_KEYBOARDNO 2
+/*!
+ * \brief
+ * Use the keyboard as an entropy source only if opening the
+ * random device fails.
+ */
+#define ISC_ENTROPY_KEYBOARDMAYBE 3
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Functions
+ ***/
+
+isc_result_t
+isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp);
+/*!<
+ * \brief Create a new entropy object.
+ */
+
+void
+isc_entropy_attach(isc_entropy_t *ent, isc_entropy_t **entp);
+/*!<
+ * Attaches to an entropy object.
+ */
+
+void
+isc_entropy_detach(isc_entropy_t **entp);
+/*!<
+ * \brief Detaches from an entropy object.
+ */
+
+isc_result_t
+isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname);
+/*!<
+ * \brief Create a new entropy source from a file.
+ *
+ * The file is assumed to contain good randomness, and will be mixed directly
+ * into the pool with every byte adding 8 bits of entropy.
+ *
+ * The file will be put into non-blocking mode, so it may be a device file,
+ * such as /dev/random. /dev/urandom should not be used here if it can
+ * be avoided, since it will always provide data even if it isn't good.
+ * We will make as much pseudorandom data as we need internally if our
+ * caller asks for it.
+ *
+ * If we hit end-of-file, we will stop reading from this source. Callers
+ * who require strong random data will get failure when our pool drains.
+ * The file will never be opened/read again once EOF is reached.
+ */
+
+void
+isc_entropy_destroysource(isc_entropysource_t **sourcep);
+/*!<
+ * \brief Removes an entropy source from the entropy system.
+ */
+
+isc_result_t
+isc_entropy_createsamplesource(isc_entropy_t *ent,
+ isc_entropysource_t **sourcep);
+/*!<
+ * \brief Create an entropy source that consists of samples. Each sample is
+ * added to the source via isc_entropy_addsamples(), below.
+ */
+
+isc_result_t
+isc_entropy_createcallbacksource(isc_entropy_t *ent,
+ isc_entropystart_t start,
+ isc_entropyget_t get,
+ isc_entropystop_t stop,
+ void *arg,
+ isc_entropysource_t **sourcep);
+/*!<
+ * \brief Create an entropy source that is polled via a callback.
+ *
+ * This would
+ * be used when keyboard input is used, or a GUI input method. It can
+ * also be used to hook in any external entropy source.
+ *
+ * Samples are added via isc_entropy_addcallbacksample(), below.
+ * _addcallbacksample() is the only function which may be called from
+ * within an entropy API callback function.
+ */
+
+void
+isc_entropy_stopcallbacksources(isc_entropy_t *ent);
+/*!<
+ * \brief Call the stop functions for callback sources that have had their
+ * start functions called.
+ */
+
+/*@{*/
+isc_result_t
+isc_entropy_addcallbacksample(isc_entropysource_t *source, isc_uint32_t sample,
+ isc_uint32_t extra);
+isc_result_t
+isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample,
+ isc_uint32_t extra);
+/*!<
+ * \brief Add a sample to the sample source.
+ *
+ * The sample MUST be a timestamp
+ * that increases over time, with the exception of wrap-around for
+ * extremely high resolution timers which will quickly wrap-around
+ * a 32-bit integer.
+ *
+ * The "extra" parameter is used only to add a bit more unpredictable
+ * data. It is not used other than included in the hash of samples.
+ *
+ * When in an entropy API callback function, _addcallbacksource() must be
+ * used. At all other times, _addsample() must be used.
+ */
+/*@}*/
+
+isc_result_t
+isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length,
+ unsigned int *returned, unsigned int flags);
+/*!<
+ * \brief Extract data from the entropy pool. This may load the pool from various
+ * sources.
+ *
+ * Do this by stiring the pool and returning a part of hash as randomness.
+ * Note that no secrets are given away here since parts of the hash are
+ * xored together before returned.
+ *
+ * Honor the request from the caller to only return good data, any data,
+ * etc.
+ */
+
+void
+isc_entropy_putdata(isc_entropy_t *ent, void *data, unsigned int length,
+ isc_uint32_t entropy);
+/*!<
+ * \brief Add "length" bytes in "data" to the entropy pool, incrementing the
+ * pool's entropy count by "entropy."
+ *
+ * These bytes will prime the pseudorandom portion even if no entropy is
+ * actually added.
+ */
+
+void
+isc_entropy_stats(isc_entropy_t *ent, FILE *out);
+/*!<
+ * \brief Dump some (trivial) stats to the stdio stream "out".
+ */
+
+unsigned int
+isc_entropy_status(isc_entropy_t *end);
+/*
+ * Returns the number of bits the pool currently contains. This is just
+ * an estimate.
+ */
+
+isc_result_t
+isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source,
+ const char *randomfile, int use_keyboard);
+/*!<
+ * \brief Use whatever source of entropy is best.
+ *
+ * Notes:
+ *\li If "randomfile" is not NULL, open it with
+ * isc_entropy_createfilesource().
+ *
+ *\li If "randomfile" is NULL and the system's random device was detected
+ * when the program was configured and built, open that device with
+ * isc_entropy_createfilesource().
+ *
+ *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDYES, then always open
+ * the keyboard as an entropy source (possibly in addition to
+ * "randomfile" or the random device).
+ *
+ *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDMAYBE, open the keyboard only
+ * if opening the random file/device fails. A message will be
+ * printed describing the need for keyboard input.
+ *
+ *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDNO, the keyboard will
+ * never be opened.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS if at least one source of entropy could be started.
+ *
+ *\li #ISC_R_NOENTROPY if use_keyboard is #ISC_ENTROPY_KEYBOARDNO and
+ * there is no random device pathname compiled into the program.
+ *
+ *\li A return code from isc_entropy_createfilesource() or
+ * isc_entropy_createcallbacksource().
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_ENTROPY_H */
diff --git a/lib/isc/include/isc/error.h b/lib/isc/include/isc/error.h
new file mode 100644
index 0000000..e0cdfa8
--- /dev/null
+++ b/lib/isc/include/isc/error.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: error.h,v 1.22 2009/09/29 23:48:04 tbox Exp $ */
+
+#ifndef ISC_ERROR_H
+#define ISC_ERROR_H 1
+
+/*! \file isc/error.h */
+
+#include <stdarg.h>
+
+#include <isc/formatcheck.h>
+#include <isc/lang.h>
+#include <isc/platform.h>
+
+ISC_LANG_BEGINDECLS
+
+typedef void (*isc_errorcallback_t)(const char *, int, const char *, va_list);
+
+/*% set unexpected error */
+void
+isc_error_setunexpected(isc_errorcallback_t);
+
+/*% set fatal error */
+void
+isc_error_setfatal(isc_errorcallback_t);
+
+/*% unexpected error */
+void
+isc_error_unexpected(const char *, int, const char *, ...)
+ ISC_FORMAT_PRINTF(3, 4);
+
+/*% fatal error */
+ISC_PLATFORM_NORETURN_PRE void
+isc_error_fatal(const char *, int, const char *, ...)
+ISC_FORMAT_PRINTF(3, 4) ISC_PLATFORM_NORETURN_POST;
+
+/*% runtimecheck error */
+void
+isc_error_runtimecheck(const char *, int, const char *);
+
+#define ISC_ERROR_RUNTIMECHECK(cond) \
+ ((void) ((cond) || \
+ ((isc_error_runtimecheck)(__FILE__, __LINE__, #cond), 0)))
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_ERROR_H */
diff --git a/lib/isc/include/isc/event.h b/lib/isc/include/isc/event.h
new file mode 100644
index 0000000..68fabb2
--- /dev/null
+++ b/lib/isc/include/isc/event.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: event.h,v 1.34 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_EVENT_H
+#define ISC_EVENT_H 1
+
+/*! \file isc/event.h */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/*****
+ ***** Events.
+ *****/
+
+typedef void (*isc_eventdestructor_t)(isc_event_t *);
+
+#define ISC_EVENT_COMMON(ltype) \
+ size_t ev_size; \
+ unsigned int ev_attributes; \
+ void * ev_tag; \
+ isc_eventtype_t ev_type; \
+ isc_taskaction_t ev_action; \
+ void * ev_arg; \
+ void * ev_sender; \
+ isc_eventdestructor_t ev_destroy; \
+ void * ev_destroy_arg; \
+ ISC_LINK(ltype) ev_link
+
+/*%
+ * Attributes matching a mask of 0x000000ff are reserved for the task library's
+ * definition. Attributes of 0xffffff00 may be used by the application
+ * or non-ISC libraries.
+ */
+#define ISC_EVENTATTR_NOPURGE 0x00000001
+
+/*%
+ * The ISC_EVENTATTR_CANCELED attribute is intended to indicate
+ * that an event is delivered as a result of a canceled operation
+ * rather than successful completion, by mutual agreement
+ * between the sender and receiver. It is not set or used by
+ * the task system.
+ */
+#define ISC_EVENTATTR_CANCELED 0x00000002
+
+#define ISC_EVENT_INIT(event, sz, at, ta, ty, ac, ar, sn, df, da) \
+do { \
+ (event)->ev_size = (sz); \
+ (event)->ev_attributes = (at); \
+ (event)->ev_tag = (ta); \
+ (event)->ev_type = (ty); \
+ (event)->ev_action = (ac); \
+ (event)->ev_arg = (ar); \
+ (event)->ev_sender = (sn); \
+ (event)->ev_destroy = (df); \
+ (event)->ev_destroy_arg = (da); \
+ ISC_LINK_INIT((event), ev_link); \
+} while (0)
+
+/*%
+ * This structure is public because "subclassing" it may be useful when
+ * defining new event types.
+ */
+struct isc_event {
+ ISC_EVENT_COMMON(struct isc_event);
+};
+
+#define ISC_EVENTTYPE_FIRSTEVENT 0x00000000
+#define ISC_EVENTTYPE_LASTEVENT 0xffffffff
+
+#define ISC_EVENT_PTR(p) ((isc_event_t **)(void *)(p))
+
+ISC_LANG_BEGINDECLS
+
+isc_event_t *
+isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type,
+ isc_taskaction_t action, const void *arg, size_t size);
+/*%<
+ * Allocate an event structure.
+ *
+ * Allocate and initialize in a structure with initial elements
+ * defined by:
+ *
+ * \code
+ * struct {
+ * ISC_EVENT_COMMON(struct isc_event);
+ * ...
+ * };
+ * \endcode
+ *
+ * Requires:
+ *\li 'size' >= sizeof(struct isc_event)
+ *\li 'action' to be non NULL
+ *
+ * Returns:
+ *\li a pointer to a initialized structure of the requested size.
+ *\li NULL if unable to allocate memory.
+ */
+
+void
+isc_event_free(isc_event_t **);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_EVENT_H */
diff --git a/lib/isc/include/isc/eventclass.h b/lib/isc/include/isc/eventclass.h
new file mode 100644
index 0000000..9e6c145
--- /dev/null
+++ b/lib/isc/include/isc/eventclass.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: eventclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_EVENTCLASS_H
+#define ISC_EVENTCLASS_H 1
+
+/*! \file isc/eventclass.h
+ ***** Registry of Predefined Event Type Classes
+ *****/
+
+/*%
+ * An event class is an unsigned 16 bit number. Each class may contain up
+ * to 65536 events. An event type is formed by adding the event number
+ * within the class to the class number.
+ *
+ */
+
+#define ISC_EVENTCLASS(eclass) ((eclass) << 16)
+
+/*@{*/
+/*!
+ * Classes < 1024 are reserved for ISC use.
+ * Event classes >= 1024 and <= 65535 are reserved for application use.
+ */
+
+#define ISC_EVENTCLASS_TASK ISC_EVENTCLASS(0)
+#define ISC_EVENTCLASS_TIMER ISC_EVENTCLASS(1)
+#define ISC_EVENTCLASS_SOCKET ISC_EVENTCLASS(2)
+#define ISC_EVENTCLASS_FILE ISC_EVENTCLASS(3)
+#define ISC_EVENTCLASS_DNS ISC_EVENTCLASS(4)
+#define ISC_EVENTCLASS_APP ISC_EVENTCLASS(5)
+#define ISC_EVENTCLASS_OMAPI ISC_EVENTCLASS(6)
+#define ISC_EVENTCLASS_RATELIMITER ISC_EVENTCLASS(7)
+#define ISC_EVENTCLASS_ISCCC ISC_EVENTCLASS(8)
+/*@}*/
+
+#endif /* ISC_EVENTCLASS_H */
diff --git a/lib/isc/include/isc/file.h b/lib/isc/include/isc/file.h
new file mode 100644
index 0000000..5db506a
--- /dev/null
+++ b/lib/isc/include/isc/file.h
@@ -0,0 +1,304 @@
+/*
+ * Copyright (C) 2004-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_FILE_H
+#define ISC_FILE_H 1
+
+/*! \file isc/file.h */
+
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_file_settime(const char *file, isc_time_t *itime);
+
+isc_result_t
+isc_file_getmodtime(const char *file, isc_time_t *itime);
+/*!<
+ * \brief Get the time of last modification of a file.
+ *
+ * Notes:
+ *\li The time that is set is relative to the (OS-specific) epoch, as are
+ * all isc_time_t structures.
+ *
+ * Requires:
+ *\li file != NULL.
+ *\li time != NULL.
+ *
+ * Ensures:
+ *\li If the file could not be accessed, 'time' is unchanged.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ * Success.
+ *\li #ISC_R_NOTFOUND
+ * No such file exists.
+ *\li #ISC_R_INVALIDFILE
+ * The path specified was not usable by the operating system.
+ *\li #ISC_R_NOPERM
+ * The file's metainformation could not be retrieved because
+ * permission was denied to some part of the file's path.
+ *\li #ISC_R_EIO
+ * Hardware error interacting with the filesystem.
+ *\li #ISC_R_UNEXPECTED
+ * Something totally unexpected happened.
+ *
+ */
+
+isc_result_t
+isc_file_mktemplate(const char *path, char *buf, size_t buflen);
+/*!<
+ * \brief Generate a template string suitable for use with isc_file_openunique().
+ *
+ * Notes:
+ *\li This function is intended to make creating temporary files
+ * portable between different operating systems.
+ *
+ *\li The path is prepended to an implementation-defined string and
+ * placed into buf. The string has no path characters in it,
+ * and its maximum length is 14 characters plus a NUL. Thus
+ * buflen should be at least strlen(path) + 15 characters or
+ * an error will be returned.
+ *
+ * Requires:
+ *\li buf != NULL.
+ *
+ * Ensures:
+ *\li If result == #ISC_R_SUCCESS:
+ * buf contains a string suitable for use as the template argument
+ * to isc_file_openunique().
+ *
+ *\li If result != #ISC_R_SUCCESS:
+ * buf is unchanged.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success.
+ *\li #ISC_R_NOSPACE buflen indicates buf is too small for the catenation
+ * of the path with the internal template string.
+ */
+
+
+isc_result_t
+isc_file_openunique(char *templet, FILE **fp);
+isc_result_t
+isc_file_openuniqueprivate(char *templet, FILE **fp);
+isc_result_t
+isc_file_openuniquemode(char *templet, int mode, FILE **fp);
+/*!<
+ * \brief Create and open a file with a unique name based on 'templet'.
+ *
+ * Notes:
+ *\li 'template' is a reserved work in C++. If you want to complain
+ * about the spelling of 'templet', first look it up in the
+ * Merriam-Webster English dictionary. (http://www.m-w.com/)
+ *
+ *\li This function works by using the template to generate file names.
+ * The template must be a writable string, as it is modified in place.
+ * Trailing X characters in the file name (full file name on Unix,
+ * basename on Win32 -- eg, tmp-XXXXXX vs XXXXXX.tmp, respectively)
+ * are replaced with ASCII characters until a non-existent filename
+ * is found. If the template does not include pathname information,
+ * the files in the working directory of the program are searched.
+ *
+ *\li isc_file_mktemplate is a good, portable way to get a template.
+ *
+ * Requires:
+ *\li 'fp' is non-NULL and '*fp' is NULL.
+ *
+ *\li 'template' is non-NULL, and of a form suitable for use by
+ * the system as described above.
+ *
+ * Ensures:
+ *\li If result is #ISC_R_SUCCESS:
+ * *fp points to an stream opening in stdio's "w+" mode.
+ *
+ *\li If result is not #ISC_R_SUCCESS:
+ * *fp is NULL.
+ *
+ * No file is open. Even if one was created (but unable
+ * to be reopened as a stdio FILE pointer) then it has been
+ * removed.
+ *
+ *\li This function does *not* ensure that the template string has not been
+ * modified, even if the operation was unsuccessful.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ * Success.
+ *\li #ISC_R_EXISTS
+ * No file with a unique name could be created based on the
+ * template.
+ *\li #ISC_R_INVALIDFILE
+ * The path specified was not usable by the operating system.
+ *\li #ISC_R_NOPERM
+ * The file could not be created because permission was denied
+ * to some part of the file's path.
+ *\li #ISC_R_IOERROR
+ * Hardware error interacting with the filesystem.
+ *\li #ISC_R_UNEXPECTED
+ * Something totally unexpected happened.
+ */
+
+isc_result_t
+isc_file_remove(const char *filename);
+/*!<
+ * \brief Remove the file named by 'filename'.
+ */
+
+isc_result_t
+isc_file_rename(const char *oldname, const char *newname);
+/*!<
+ * \brief Rename the file 'oldname' to 'newname'.
+ */
+
+isc_boolean_t
+isc_file_exists(const char *pathname);
+/*!<
+ * \brief Return #ISC_TRUE if the calling process can tell that the given file exists.
+ * Will not return true if the calling process has insufficient privileges
+ * to search the entire path.
+ */
+
+isc_boolean_t
+isc_file_isabsolute(const char *filename);
+/*!<
+ * \brief Return #ISC_TRUE if the given file name is absolute.
+ */
+
+isc_result_t
+isc_file_isplainfile(const char *name);
+/*!<
+ * \brief Check that the file is a plain file
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ * Success. The file is a plain file.
+ *\li #ISC_R_INVALIDFILE
+ * The path specified was not usable by the operating system.
+ *\li #ISC_R_FILENOTFOUND
+ * The file does not exist. This return code comes from
+ * errno=ENOENT when stat returns -1. This code is mentioned
+ * here, because in logconf.c, it is the one rcode that is
+ * permitted in addition to ISC_R_SUCCESS. This is done since
+ * the next call in logconf.c is to isc_stdio_open(), which
+ * will create the file if it can.
+ *\li #other ISC_R_* errors translated from errno
+ * These occur when stat returns -1 and an errno.
+ */
+
+isc_boolean_t
+isc_file_iscurrentdir(const char *filename);
+/*!<
+ * \brief Return #ISC_TRUE if the given file name is the current directory (".").
+ */
+
+isc_boolean_t
+isc_file_ischdiridempotent(const char *filename);
+/*%<
+ * Return #ISC_TRUE if calling chdir(filename) multiple times will give
+ * the same result as calling it once.
+ */
+
+const char *
+isc_file_basename(const char *filename);
+/*%<
+ * Return the final component of the path in the file name.
+ */
+
+isc_result_t
+isc_file_progname(const char *filename, char *buf, size_t buflen);
+/*!<
+ * \brief Given an operating system specific file name "filename"
+ * referring to a program, return the canonical program name.
+ *
+ *
+ * Any directory prefix or executable file name extension (if
+ * used on the OS in case) is stripped. On systems where program
+ * names are case insensitive, the name is canonicalized to all
+ * lower case. The name is written to 'buf', an array of 'buflen'
+ * chars, and null terminated.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOSPACE The name did not fit in 'buf'.
+ */
+
+isc_result_t
+isc_file_template(const char *path, const char *templet, char *buf,
+ size_t buflen);
+/*%<
+ * Create an OS specific template using 'path' to define the directory
+ * 'templet' to describe the filename and store the result in 'buf'
+ * such that path can be renamed to buf atomically.
+ */
+
+isc_result_t
+isc_file_renameunique(const char *file, char *templet);
+/*%<
+ * Rename 'file' using 'templet' as a template for the new file name.
+ */
+
+isc_result_t
+isc_file_absolutepath(const char *filename, char *path, size_t pathlen);
+/*%<
+ * Given a file name, return the fully qualified path to the file.
+ */
+
+/*
+ * XXX We should also have a isc_file_writeeopen() function
+ * for safely open a file in a publicly writable directory
+ * (see write_open() in BIND 8's ns_config.c).
+ */
+
+isc_result_t
+isc_file_truncate(const char *filename, isc_offset_t size);
+/*%<
+ * Truncate/extend the file specified to 'size' bytes.
+ */
+
+isc_result_t
+isc_file_safecreate(const char *filename, FILE **fp);
+/*%<
+ * Open 'filename' for writing, truncating if necessary. Ensure that
+ * if it existed it was a normal file. If creating the file, ensure
+ * that only the owner can read/write it.
+ */
+
+isc_result_t
+isc_file_splitpath(isc_mem_t *mctx, char *path,
+ char **dirname, char **basename);
+/*%<
+ * Split a path into dirname and basename. If 'path' contains no slash
+ * (or, on windows, backslash), then '*dirname' is set to ".".
+ *
+ * Allocates memory for '*dirname', which can be freed with isc_mem_free().
+ *
+ * Returns:
+ * - ISC_R_SUCCESS on success
+ * - ISC_R_INVALIDFILE if 'path' is empty or ends with '/'
+ * - ISC_R_NOMEMORY if unable to allocate memory
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_FILE_H */
diff --git a/lib/isc/include/isc/formatcheck.h b/lib/isc/include/isc/formatcheck.h
new file mode 100644
index 0000000..51ce3ca
--- /dev/null
+++ b/lib/isc/include/isc/formatcheck.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: formatcheck.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_FORMATCHECK_H
+#define ISC_FORMATCHECK_H 1
+
+/*! \file isc/formatcheck.h */
+
+/*%
+ * ISC_FORMAT_PRINTF().
+ *
+ * \li fmt is the location of the format string parameter.
+ * \li args is the location of the first argument (or 0 for no argument checking).
+ *
+ * Note:
+ * \li The first parameter is 1, not 0.
+ */
+#ifdef __GNUC__
+#define ISC_FORMAT_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
+#else
+#define ISC_FORMAT_PRINTF(fmt, args)
+#endif
+
+#endif /* ISC_FORMATCHECK_H */
diff --git a/lib/isc/include/isc/fsaccess.h b/lib/isc/include/isc/fsaccess.h
new file mode 100644
index 0000000..7962bbe
--- /dev/null
+++ b/lib/isc/include/isc/fsaccess.h
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: fsaccess.h,v 1.16 2009/01/17 23:47:43 tbox Exp $ */
+
+#ifndef ISC_FSACCESS_H
+#define ISC_FSACCESS_H 1
+
+/*! \file isc/fsaccess.h
+ * \brief The ISC filesystem access module encapsulates the setting of file
+ * and directory access permissions into one API that is meant to be
+ * portable to multiple operating systems.
+ *
+ * The two primary operating system flavors that are initially accommodated
+ * are POSIX and Windows NT 4.0 and later. The Windows NT access model is
+ * considerable more flexible than POSIX's model (as much as I am loathe to
+ * admit it), and so the ISC API has a higher degree of complexity than would
+ * be needed to simply address POSIX's needs.
+ *
+ * The full breadth of NT's flexibility is not available either, for the
+ * present time. Much of it is to provide compatibility with what Unix
+ * programmers are expecting. This is also due to not yet really needing all
+ * of the functionality of an NT system (or, for that matter, a POSIX system)
+ * in BIND9, and so resolving how to handle the various incompatibilities has
+ * been a purely theoretical exercise with no operational experience to
+ * indicate how flawed the thinking may be.
+ *
+ * Some of the more notable dumbing down of NT for this API includes:
+ *
+ *\li Each of FILE_READ_DATA and FILE_READ_EA are set with #ISC_FSACCESS_READ.
+ *
+ * \li All of FILE_WRITE_DATA, FILE_WRITE_EA and FILE_APPEND_DATA are
+ * set with #ISC_FSACCESS_WRITE. FILE_WRITE_ATTRIBUTES is not set
+ * so as to be consistent with Unix, where only the owner of the file
+ * or the superuser can change the attributes/mode of a file.
+ *
+ * \li Both of FILE_ADD_FILE and FILE_ADD_SUBDIRECTORY are set with
+ * #ISC_FSACCESS_CREATECHILD. This is similar to setting the WRITE
+ * permission on a Unix directory.
+ *
+ * \li SYNCHRONIZE is always set for files and directories, unless someone
+ * can give me a reason why this is a bad idea.
+ *
+ * \li READ_CONTROL and FILE_READ_ATTRIBUTES are always set; this is
+ * consistent with Unix, where any file or directory can be stat()'d
+ * unless the directory path disallows complete access somewhere along
+ * the way.
+ *
+ * \li WRITE_DAC is only set for the owner. This too is consistent with
+ * Unix, and is tighter security than allowing anyone else to be
+ * able to set permissions.
+ *
+ * \li DELETE is only set for the owner. On Unix the ability to delete
+ * a file is controlled by the directory permissions, but it isn't
+ * currently clear to me what happens on NT if the directory has
+ * FILE_DELETE_CHILD set but a file within it does not have DELETE
+ * set. Always setting DELETE on the file/directory for the owner
+ * gives maximum flexibility to the owner without exposing the
+ * file to deletion by others.
+ *
+ * \li WRITE_OWNER is never set. This too is consistent with Unix,
+ * and is also tighter security than allowing anyone to change the
+ * ownership of the file apart from the superu..ahem, Administrator.
+ *
+ * \li Inheritance is set to NO_INHERITANCE.
+ *
+ * Unix's dumbing down includes:
+ *
+ * \li The sticky bit cannot be set.
+ *
+ * \li setuid and setgid cannot be set.
+ *
+ * \li Only regular files and directories can be set.
+ *
+ * The rest of this comment discusses a few of the incompatibilities
+ * between the two systems that need more thought if this API is to
+ * be extended to accommodate them.
+ *
+ * The Windows standard access right "DELETE" doesn't have a direct
+ * equivalent in the Unix world, so it isn't clear what should be done
+ * with it.
+ *
+ * The Unix sticky bit is not supported. While NT does have a concept
+ * of allowing users to create files in a directory but not delete or
+ * rename them, it does not have a concept of allowing them to be deleted
+ * if they are owned by the user trying to delete/rename. While it is
+ * probable that something could be cobbled together in NT 5 with inheritance,
+ * it can't really be done in NT 4 as a single property that you could
+ * set on a directory. You'd need to coordinate something with file creation
+ * so that every file created had DELETE set for the owner but noone else.
+ *
+ * On Unix systems, setting #ISC_FSACCESS_LISTDIRECTORY sets READ.
+ * ... setting either #ISC_FSACCESS_CREATECHILD or #ISC_FSACCESS_DELETECHILD
+ * sets WRITE.
+ * ... setting #ISC_FSACCESS_ACCESSCHILD sets EXECUTE.
+ *
+ * On NT systems, setting #ISC_FSACCESS_LISTDIRECTORY sets FILE_LIST_DIRECTORY.
+ * ... setting #ISC_FSACCESS_CREATECHILD sets FILE_CREATE_CHILD independently.
+ * ... setting #ISC_FSACCESS_DELETECHILD sets FILE_DELETE_CHILD independently.
+ * ... setting #ISC_FSACCESS_ACCESSCHILD sets FILE_TRAVERSE.
+ *
+ * Unresolved: XXXDCL
+ * \li What NT access right controls the ability to rename a file?
+ * \li How does DELETE work? If a directory has FILE_DELETE_CHILD but a
+ * file or directory within it does not have DELETE, is that file
+ * or directory deletable?
+ * \li To implement isc_fsaccess_get(), mapping an existing Unix permission
+ * mode_t back to an isc_fsaccess_t is pretty trivial; however, mapping
+ * an NT DACL could be impossible to do in a responsible way.
+ * \li Similarly, trying to implement the functionality of being able to
+ * say "add group writability to whatever permissions already exist"
+ * could be tricky on NT because of the order-of-entry issue combined
+ * with possibly having one or more matching ACEs already explicitly
+ * granting or denying access. Because this functionality is
+ * not yet needed by the ISC, no code has been written to try to
+ * solve this problem.
+ */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/*
+ * Trustees.
+ */
+#define ISC_FSACCESS_OWNER 0x1 /*%< User account. */
+#define ISC_FSACCESS_GROUP 0x2 /*%< Primary group owner. */
+#define ISC_FSACCESS_OTHER 0x4 /*%< Not the owner or the group owner. */
+#define ISC_FSACCESS_WORLD 0x7 /*%< User, Group, Other. */
+
+/*
+ * Types of permission.
+ */
+#define ISC_FSACCESS_READ 0x00000001 /*%< File only. */
+#define ISC_FSACCESS_WRITE 0x00000002 /*%< File only. */
+#define ISC_FSACCESS_EXECUTE 0x00000004 /*%< File only. */
+#define ISC_FSACCESS_CREATECHILD 0x00000008 /*%< Dir only. */
+#define ISC_FSACCESS_DELETECHILD 0x00000010 /*%< Dir only. */
+#define ISC_FSACCESS_LISTDIRECTORY 0x00000020 /*%< Dir only. */
+#define ISC_FSACCESS_ACCESSCHILD 0x00000040 /*%< Dir only. */
+
+/*%
+ * Adding any permission bits beyond 0x200 would mean typedef'ing
+ * isc_fsaccess_t as isc_uint64_t, and redefining this value to
+ * reflect the new range of permission types, Probably to 21 for
+ * maximum flexibility. The number of bits has to accommodate all of
+ * the permission types, and three full sets of them have to fit
+ * within an isc_fsaccess_t.
+ */
+#define ISC__FSACCESS_PERMISSIONBITS 10
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_fsaccess_add(int trustee, int permission, isc_fsaccess_t *access);
+
+void
+isc_fsaccess_remove(int trustee, int permission, isc_fsaccess_t *access);
+
+isc_result_t
+isc_fsaccess_set(const char *path, isc_fsaccess_t access);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_FSACCESS_H */
diff --git a/lib/isc/include/isc/hash.h b/lib/isc/include/isc/hash.h
new file mode 100644
index 0000000..ca04b4e
--- /dev/null
+++ b/lib/isc/include/isc/hash.h
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: hash.h,v 1.12 2009/01/17 23:47:43 tbox Exp $ */
+
+#ifndef ISC_HASH_H
+#define ISC_HASH_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/hash.h
+ *
+ * \brief The hash API
+ * provides an unpredictable hash value for variable length data.
+ * A hash object contains a random vector (which is hidden from clients
+ * of this API) to make the actual hash value unpredictable.
+ *
+ * The algorithm used in the API guarantees the probability of hash
+ * collision; in the current implementation, as long as the values stored
+ * in the random vector are unpredictable, the probability of hash
+ * collision between arbitrary two different values is at most 1/2^16.
+ *
+ * Although the API is generic about the hash keys, it mainly expects
+ * DNS names (and sometimes IPv4/v6 addresses) as inputs. It has an
+ * upper limit of the input length, and may run slow to calculate the
+ * hash values for large inputs.
+ *
+ * This API is designed to be general so that it can provide multiple
+ * different hash contexts that have different random vectors. However,
+ * it should be typical to have a single context for an entire system.
+ * To support such cases, the API also provides a single-context mode.
+ *
+ * \li MP:
+ * The hash object is almost read-only. Once the internal random vector
+ * is initialized, no write operation will occur, and there will be no
+ * need to lock the object to calculate actual hash values.
+ *
+ * \li Reliability:
+ * In some cases this module uses low-level data copy to initialize the
+ * random vector. Errors in this part are likely to crash the server or
+ * corrupt memory.
+ *
+ * \li Resources:
+ * A buffer, used as a random vector for calculating hash values.
+ *
+ * \li Security:
+ * This module intends to provide unpredictable hash values in
+ * adversarial environments in order to avoid denial of service attacks
+ * to hash buckets.
+ * Its unpredictability relies on the quality of entropy to build the
+ * random vector.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/types.h>
+
+/***
+ *** Functions
+ ***/
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy, unsigned int limit,
+ isc_hash_t **hctx);
+isc_result_t
+isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit);
+/*!<
+ * \brief Create a new hash object.
+ *
+ * isc_hash_ctxcreate() creates a different object.
+ *
+ * isc_hash_create() creates a module-internal object to support the
+ * single-context mode. It should be called only once.
+ *
+ * 'entropy' must be NULL or a valid entropy object. If 'entropy' is NULL,
+ * pseudo random values will be used to build the random vector, which may
+ * weaken security.
+ *
+ * 'limit' specifies the maximum number of hash keys. If it is too large,
+ * these functions may fail.
+ */
+
+void
+isc_hash_ctxattach(isc_hash_t *hctx, isc_hash_t **hctxp);
+/*!<
+ * \brief Attach to a hash object.
+ *
+ * This function is only necessary for the multiple-context mode.
+ */
+
+void
+isc_hash_ctxdetach(isc_hash_t **hctxp);
+/*!<
+ * \brief Detach from a hash object.
+ *
+ * This function is for the multiple-context mode, and takes a valid
+ * hash object as an argument.
+ */
+
+void
+isc_hash_destroy(void);
+/*!<
+ * \brief This function is for the single-context mode, and is expected to be used
+ * as a counterpart of isc_hash_create().
+ *
+ * A valid module-internal hash object must have been created, and this
+ * function should be called only once.
+ */
+
+/*@{*/
+void
+isc_hash_ctxinit(isc_hash_t *hctx);
+void
+isc_hash_init(void);
+/*!<
+ * \brief Initialize a hash object.
+ *
+ * It fills in the random vector with a proper
+ * source of entropy, which is typically from the entropy object specified
+ * at the creation. Thus, it is desirable to call these functions after
+ * initializing the entropy object with some good entropy sources.
+ *
+ * These functions should be called before the first hash calculation.
+ *
+ * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash
+ * object as an argument.
+ *
+ * isc_hash_init() is for the single-context mode. A valid module-internal
+ * hash object must have been created, and this function should be called only
+ * once.
+ */
+/*@}*/
+
+/*@{*/
+unsigned int
+isc_hash_ctxcalc(isc_hash_t *hctx, const unsigned char *key,
+ unsigned int keylen, isc_boolean_t case_sensitive);
+unsigned int
+isc_hash_calc(const unsigned char *key, unsigned int keylen,
+ isc_boolean_t case_sensitive);
+/*!<
+ * \brief Calculate a hash value.
+ *
+ * isc_hash_ctxinit() is for the multiple-context mode, and takes a valid hash
+ * object as an argument.
+ *
+ * isc_hash_init() is for the single-context mode. A valid module-internal
+ * hash object must have been created.
+ *
+ * 'key' is the hash key, which is a variable length buffer.
+ *
+ * 'keylen' specifies the key length, which must not be larger than the limit
+ * specified for the corresponding hash object.
+ *
+ * 'case_sensitive' specifies whether the hash key should be treated as
+ * case_sensitive values. It should typically be ISC_FALSE if the hash key
+ * is a DNS name.
+ */
+/*@}*/
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_HASH_H */
diff --git a/lib/isc/include/isc/heap.h b/lib/isc/include/isc/heap.h
new file mode 100644
index 0000000..77bf07c
--- /dev/null
+++ b/lib/isc/include/isc/heap.h
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: heap.h,v 1.26 2009/01/17 23:47:43 tbox Exp $ */
+
+#ifndef ISC_HEAP_H
+#define ISC_HEAP_H 1
+
+/*! \file isc/heap.h */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/*%
+ * The comparison function returns ISC_TRUE if the first argument has
+ * higher priority than the second argument, and ISC_FALSE otherwise.
+ */
+typedef isc_boolean_t (*isc_heapcompare_t)(void *, void *);
+
+/*%
+ * The index function allows the client of the heap to receive a callback
+ * when an item's index number changes. This allows it to maintain
+ * sync with its external state, but still delete itself, since deletions
+ * from the heap require the index be provided.
+ */
+typedef void (*isc_heapindex_t)(void *, unsigned int);
+
+/*%
+ * The heapaction function is used when iterating over the heap.
+ *
+ * NOTE: The heap structure CANNOT BE MODIFIED during the call to
+ * isc_heap_foreach().
+ */
+typedef void (*isc_heapaction_t)(void *, void *);
+
+typedef struct isc_heap isc_heap_t;
+
+isc_result_t
+isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
+ isc_heapindex_t index, unsigned int size_increment,
+ isc_heap_t **heapp);
+/*!<
+ * \brief Create a new heap. The heap is implemented using a space-efficient
+ * storage method. When the heap elements are deleted space is not freed
+ * but will be reused when new elements are inserted.
+ *
+ * Requires:
+ *\li "mctx" is valid.
+ *\li "compare" is a function which takes two void * arguments and
+ * returns ISC_TRUE if the first argument has a higher priority than
+ * the second, and ISC_FALSE otherwise.
+ *\li "index" is a function which takes a void *, and an unsigned int
+ * argument. This function will be called whenever an element's
+ * index value changes, so it may continue to delete itself from the
+ * heap. This option may be NULL if this functionality is unneeded.
+ *\li "size_increment" is a hint about how large the heap should grow
+ * when resizing is needed. If this is 0, a default size will be
+ * used, which is currently 1024, allowing space for an additional 1024
+ * heap elements to be inserted before adding more space.
+ *\li "heapp" is not NULL, and "*heap" is NULL.
+ *
+ * Returns:
+ *\li ISC_R_SUCCESS - success
+ *\li ISC_R_NOMEMORY - insufficient memory
+ */
+
+void
+isc_heap_destroy(isc_heap_t **heapp);
+/*!<
+ * \brief Destroys a heap.
+ *
+ * Requires:
+ *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
+ */
+
+isc_result_t
+isc_heap_insert(isc_heap_t *heap, void *elt);
+/*!<
+ * \brief Inserts a new element into a heap.
+ *
+ * Requires:
+ *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
+ */
+
+void
+isc_heap_delete(isc_heap_t *heap, unsigned int index);
+/*!<
+ * \brief Deletes an element from a heap, by element index.
+ *
+ * Requires:
+ *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
+ *\li "index" is a valid element index, as provided by the "index" callback
+ * provided during heap creation.
+ */
+
+void
+isc_heap_increased(isc_heap_t *heap, unsigned int index);
+/*!<
+ * \brief Indicates to the heap that an element's priority has increased.
+ * This function MUST be called whenever an element has increased in priority.
+ *
+ * Requires:
+ *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
+ *\li "index" is a valid element index, as provided by the "index" callback
+ * provided during heap creation.
+ */
+
+void
+isc_heap_decreased(isc_heap_t *heap, unsigned int index);
+/*!<
+ * \brief Indicates to the heap that an element's priority has decreased.
+ * This function MUST be called whenever an element has decreased in priority.
+ *
+ * Requires:
+ *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
+ *\li "index" is a valid element index, as provided by the "index" callback
+ * provided during heap creation.
+ */
+
+void *
+isc_heap_element(isc_heap_t *heap, unsigned int index);
+/*!<
+ * \brief Returns the element for a specific element index.
+ *
+ * Requires:
+ *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
+ *\li "index" is a valid element index, as provided by the "index" callback
+ * provided during heap creation.
+ *
+ * Returns:
+ *\li A pointer to the element for the element index.
+ */
+
+void
+isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap);
+/*!<
+ * \brief Iterate over the heap, calling an action for each element. The
+ * order of iteration is not sorted.
+ *
+ * Requires:
+ *\li "heapp" is not NULL and "*heap" points to a valid isc_heap_t.
+ *\li "action" is not NULL, and is a function which takes two arguments.
+ * The first is a void *, representing the element, and the second is
+ * "uap" as provided to isc_heap_foreach.
+ *\li "uap" is a caller-provided argument, and may be NULL.
+ *
+ * Note:
+ *\li The heap structure CANNOT be modified during this iteration. The only
+ * safe function to call while iterating the heap is isc_heap_element().
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_HEAP_H */
diff --git a/lib/isc/include/isc/hex.h b/lib/isc/include/isc/hex.h
new file mode 100644
index 0000000..a5e2f53
--- /dev/null
+++ b/lib/isc/include/isc/hex.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: hex.h,v 1.13 2008/09/25 04:02:39 tbox Exp $ */
+
+#ifndef ISC_HEX_H
+#define ISC_HEX_H 1
+
+/*! \file isc/hex.h */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Functions
+ ***/
+
+isc_result_t
+isc_hex_totext(isc_region_t *source, int wordlength,
+ const char *wordbreak, isc_buffer_t *target);
+/*!<
+ * \brief Convert data into hex encoded text.
+ *
+ * Notes:
+ *\li The hex encoded text in 'target' will be divided into
+ * words of at most 'wordlength' characters, separated by
+ * the 'wordbreak' string. No parentheses will surround
+ * the text.
+ *
+ * Requires:
+ *\li 'source' is a region containing binary data
+ *\li 'target' is a text buffer containing available space
+ *\li 'wordbreak' points to a null-terminated string of
+ * zero or more whitespace characters
+ *
+ * Ensures:
+ *\li target will contain the hex encoded version of the data
+ * in source. The 'used' pointer in target will be advanced as
+ * necessary.
+ */
+
+isc_result_t
+isc_hex_decodestring(const char *cstr, isc_buffer_t *target);
+/*!<
+ * \brief Decode a null-terminated hex string.
+ *
+ * Requires:
+ *\li 'cstr' is non-null.
+ *\li 'target' is a valid buffer.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
+ * fit in 'target'.
+ *\li #ISC_R_BADHEX -- 'cstr' is not a valid hex encoding.
+ *
+ * Other error returns are any possible error code from:
+ * isc_lex_create(),
+ * isc_lex_openbuffer(),
+ * isc_hex_tobuffer().
+ */
+
+isc_result_t
+isc_hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
+/*!<
+ * \brief Convert hex encoded text from a lexer context into data.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer context
+ *\li 'target' is a buffer containing binary data
+ *\li 'length' is an integer
+ *
+ * Ensures:
+ *\li target will contain the data represented by the hex encoded
+ * string parsed by the lexer. No more than length bytes will be read,
+ * if length is positive. The 'used' pointer in target will be
+ * advanced as necessary.
+ */
+
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_HEX_H */
diff --git a/lib/isc/include/isc/hmacmd5.h b/lib/isc/include/isc/hmacmd5.h
new file mode 100644
index 0000000..9ecad45
--- /dev/null
+++ b/lib/isc/include/isc/hmacmd5.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: hmacmd5.h,v 1.14 2009/02/06 23:47:42 tbox Exp $ */
+
+/*! \file isc/hmacmd5.h
+ * \brief This is the header file for the HMAC-MD5 keyed hash algorithm
+ * described in RFC2104.
+ */
+
+#ifndef ISC_HMACMD5_H
+#define ISC_HMACMD5_H 1
+
+#include <isc/lang.h>
+#include <isc/md5.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#define ISC_HMACMD5_KEYLENGTH 64
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+#include <openssl/hmac.h>
+
+typedef HMAC_CTX isc_hmacmd5_t;
+
+#else
+
+typedef struct {
+ isc_md5_t md5ctx;
+ unsigned char key[ISC_HMACMD5_KEYLENGTH];
+} isc_hmacmd5_t;
+#endif
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key,
+ unsigned int len);
+
+void
+isc_hmacmd5_invalidate(isc_hmacmd5_t *ctx);
+
+void
+isc_hmacmd5_update(isc_hmacmd5_t *ctx, const unsigned char *buf,
+ unsigned int len);
+
+void
+isc_hmacmd5_sign(isc_hmacmd5_t *ctx, unsigned char *digest);
+
+isc_boolean_t
+isc_hmacmd5_verify(isc_hmacmd5_t *ctx, unsigned char *digest);
+
+isc_boolean_t
+isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_HMACMD5_H */
diff --git a/lib/isc/include/isc/hmacsha.h b/lib/isc/include/isc/hmacsha.h
new file mode 100644
index 0000000..1d0e184
--- /dev/null
+++ b/lib/isc/include/isc/hmacsha.h
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2005-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: hmacsha.h,v 1.9 2009/02/06 23:47:42 tbox Exp $ */
+
+/*! \file isc/hmacsha.h
+ * This is the header file for the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
+ * HMAC-SHA334 and HMAC-SHA512 hash algorithm described in RFC 2104.
+ */
+
+#ifndef ISC_HMACSHA_H
+#define ISC_HMACSHA_H 1
+
+#include <isc/lang.h>
+#include <isc/platform.h>
+#include <isc/sha1.h>
+#include <isc/sha2.h>
+#include <isc/types.h>
+
+#define ISC_HMACSHA1_KEYLENGTH ISC_SHA1_BLOCK_LENGTH
+#define ISC_HMACSHA224_KEYLENGTH ISC_SHA224_BLOCK_LENGTH
+#define ISC_HMACSHA256_KEYLENGTH ISC_SHA256_BLOCK_LENGTH
+#define ISC_HMACSHA384_KEYLENGTH ISC_SHA384_BLOCK_LENGTH
+#define ISC_HMACSHA512_KEYLENGTH ISC_SHA512_BLOCK_LENGTH
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+#include <openssl/hmac.h>
+
+typedef HMAC_CTX isc_hmacsha1_t;
+typedef HMAC_CTX isc_hmacsha224_t;
+typedef HMAC_CTX isc_hmacsha256_t;
+typedef HMAC_CTX isc_hmacsha384_t;
+typedef HMAC_CTX isc_hmacsha512_t;
+
+#else
+
+typedef struct {
+ isc_sha1_t sha1ctx;
+ unsigned char key[ISC_HMACSHA1_KEYLENGTH];
+} isc_hmacsha1_t;
+
+typedef struct {
+ isc_sha224_t sha224ctx;
+ unsigned char key[ISC_HMACSHA224_KEYLENGTH];
+} isc_hmacsha224_t;
+
+typedef struct {
+ isc_sha256_t sha256ctx;
+ unsigned char key[ISC_HMACSHA256_KEYLENGTH];
+} isc_hmacsha256_t;
+
+typedef struct {
+ isc_sha384_t sha384ctx;
+ unsigned char key[ISC_HMACSHA384_KEYLENGTH];
+} isc_hmacsha384_t;
+
+typedef struct {
+ isc_sha512_t sha512ctx;
+ unsigned char key[ISC_HMACSHA512_KEYLENGTH];
+} isc_hmacsha512_t;
+#endif
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_hmacsha1_init(isc_hmacsha1_t *ctx, const unsigned char *key,
+ unsigned int len);
+
+void
+isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx);
+
+void
+isc_hmacsha1_update(isc_hmacsha1_t *ctx, const unsigned char *buf,
+ unsigned int len);
+
+void
+isc_hmacsha1_sign(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len);
+
+isc_boolean_t
+isc_hmacsha1_verify(isc_hmacsha1_t *ctx, unsigned char *digest, size_t len);
+
+
+void
+isc_hmacsha224_init(isc_hmacsha224_t *ctx, const unsigned char *key,
+ unsigned int len);
+
+void
+isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx);
+
+void
+isc_hmacsha224_update(isc_hmacsha224_t *ctx, const unsigned char *buf,
+ unsigned int len);
+
+void
+isc_hmacsha224_sign(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len);
+
+isc_boolean_t
+isc_hmacsha224_verify(isc_hmacsha224_t *ctx, unsigned char *digest, size_t len);
+
+
+void
+isc_hmacsha256_init(isc_hmacsha256_t *ctx, const unsigned char *key,
+ unsigned int len);
+
+void
+isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx);
+
+void
+isc_hmacsha256_update(isc_hmacsha256_t *ctx, const unsigned char *buf,
+ unsigned int len);
+
+void
+isc_hmacsha256_sign(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len);
+
+isc_boolean_t
+isc_hmacsha256_verify(isc_hmacsha256_t *ctx, unsigned char *digest, size_t len);
+
+
+void
+isc_hmacsha384_init(isc_hmacsha384_t *ctx, const unsigned char *key,
+ unsigned int len);
+
+void
+isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx);
+
+void
+isc_hmacsha384_update(isc_hmacsha384_t *ctx, const unsigned char *buf,
+ unsigned int len);
+
+void
+isc_hmacsha384_sign(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len);
+
+isc_boolean_t
+isc_hmacsha384_verify(isc_hmacsha384_t *ctx, unsigned char *digest, size_t len);
+
+
+void
+isc_hmacsha512_init(isc_hmacsha512_t *ctx, const unsigned char *key,
+ unsigned int len);
+
+void
+isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx);
+
+void
+isc_hmacsha512_update(isc_hmacsha512_t *ctx, const unsigned char *buf,
+ unsigned int len);
+
+void
+isc_hmacsha512_sign(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len);
+
+isc_boolean_t
+isc_hmacsha512_verify(isc_hmacsha512_t *ctx, unsigned char *digest, size_t len);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_HMACSHA_H */
diff --git a/lib/isc/include/isc/httpd.h b/lib/isc/include/isc/httpd.h
new file mode 100644
index 0000000..ba7f900
--- /dev/null
+++ b/lib/isc/include/isc/httpd.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2006-2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: httpd.h,v 1.9 2008/08/08 05:06:49 marka Exp $ */
+
+#ifndef ISC_HTTPD_H
+#define ISC_HTTPD_H 1
+
+/*! \file */
+
+#include <isc/event.h>
+#include <isc/eventclass.h>
+#include <isc/types.h>
+#include <isc/mutex.h>
+#include <isc/task.h>
+
+#define HTTPD_EVENTCLASS ISC_EVENTCLASS(4300)
+#define HTTPD_SHUTDOWN (HTTPD_EVENTCLASS + 0x0001)
+
+#define ISC_HTTPDMGR_FLAGSHUTTINGDOWN 0x00000001
+
+/*
+ * Create a new http daemon which will send, once every time period,
+ * a http-like header followed by HTTP data.
+ */
+isc_result_t
+isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task,
+ isc_httpdclientok_t *client_ok,
+ isc_httpdondestroy_t *ondestory, void *cb_arg,
+ isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp);
+
+void
+isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdp);
+
+isc_result_t
+isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url,
+ isc_httpdaction_t *func, void *arg);
+
+isc_result_t
+isc_httpd_response(isc_httpd_t *httpd);
+
+isc_result_t
+isc_httpd_addheader(isc_httpd_t *httpd, const char *name,
+ const char *val);
+
+isc_result_t
+isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val);
+
+isc_result_t isc_httpd_endheaders(isc_httpd_t *httpd);
+
+#endif /* ISC_HTTPD_H */
diff --git a/lib/isc/include/isc/interfaceiter.h b/lib/isc/include/isc/interfaceiter.h
new file mode 100644
index 0000000..544f54b
--- /dev/null
+++ b/lib/isc/include/isc/interfaceiter.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: interfaceiter.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_INTERFACEITER_H
+#define ISC_INTERFACEITER_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/interfaceiter.h
+ * \brief Iterates over the list of network interfaces.
+ *
+ * Interfaces whose address family is not supported are ignored and never
+ * returned by the iterator. Interfaces whose netmask, interface flags,
+ * or similar cannot be obtained are also ignored, and the failure is logged.
+ *
+ * Standards:
+ * The API for scanning varies greatly among operating systems.
+ * This module attempts to hide the differences.
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/lang.h>
+#include <isc/netaddr.h>
+#include <isc/types.h>
+
+/*!
+ * \brief Public structure describing a network interface.
+ */
+
+struct isc_interface {
+ char name[32]; /*%< Interface name, null-terminated. */
+ unsigned int af; /*%< Address family. */
+ isc_netaddr_t address; /*%< Local address. */
+ isc_netaddr_t netmask; /*%< Network mask. */
+ isc_netaddr_t broadcast; /*&< Broadcast address. */
+ isc_netaddr_t dstaddress; /*%< Destination address (point-to-point only). */
+ isc_uint32_t flags; /*%< Flags; see INTERFACE flags. */
+ unsigned int ifindex; /*%< Interface index for IP(V6)_MULTICAST_IF. */
+};
+
+/*@{*/
+/*! Interface flags. */
+
+#define INTERFACE_F_UP 0x00000001U
+#define INTERFACE_F_POINTTOPOINT 0x00000002U
+#define INTERFACE_F_LOOPBACK 0x00000004U
+#define INTERFACE_F_BROADCAST 0x00000008U
+#define INTERFACE_F_MULTICAST 0x00000010U
+#define INTERFACE_F_PRIVACY 0x00000020U /* RFC 4941 */
+/*@}*/
+
+/***
+ *** Functions
+ ***/
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp);
+/*!<
+ * \brief Create an iterator for traversing the operating system's list
+ * of network interfaces.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ * \li #ISC_R_NOMEMORY
+ *\li Various network-related errors
+ */
+
+isc_result_t
+isc_interfaceiter_first(isc_interfaceiter_t *iter);
+/*!<
+ * \brief Position the iterator on the first interface.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success.
+ *\li #ISC_R_NOMORE There are no interfaces.
+ */
+
+isc_result_t
+isc_interfaceiter_current(isc_interfaceiter_t *iter,
+ isc_interface_t *ifdata);
+/*!<
+ * \brief Get information about the interface the iterator is currently
+ * positioned at and store it at *ifdata.
+ *
+ * Requires:
+ *\li The iterator has been successfully positioned using
+ * isc_interface_iter_first() / isc_interface_iter_next().
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success.
+ */
+
+isc_result_t
+isc_interfaceiter_next(isc_interfaceiter_t *iter);
+/*!<
+ * \brief Position the iterator on the next interface.
+ *
+ * Requires:
+ * \li The iterator has been successfully positioned using
+ * isc_interface_iter_first() / isc_interface_iter_next().
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success.
+ *\li #ISC_R_NOMORE There are no more interfaces.
+ */
+
+void
+isc_interfaceiter_destroy(isc_interfaceiter_t **iterp);
+/*!<
+ * \brief Destroy the iterator.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_INTERFACEITER_H */
diff --git a/lib/isc/include/isc/ipv6.h b/lib/isc/include/isc/ipv6.h
new file mode 100644
index 0000000..8054c9e
--- /dev/null
+++ b/lib/isc/include/isc/ipv6.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ipv6.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_IPV6_H
+#define ISC_IPV6_H 1
+
+/*!
+ * Also define LWRES_IPV6_H to keep it from being included if liblwres is
+ * being used, or redefinition errors will occur.
+ */
+#define LWRES_IPV6_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/ipv6.h
+ * \brief IPv6 definitions for systems which do not support IPv6.
+ *
+ * \li MP:
+ * No impact.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * N/A.
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * RFC2553.
+ */
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/int.h>
+#include <isc/platform.h>
+
+/***
+ *** Types.
+ ***/
+
+struct in6_addr {
+ union {
+ isc_uint8_t _S6_u8[16];
+ isc_uint16_t _S6_u16[8];
+ isc_uint32_t _S6_u32[4];
+ } _S6_un;
+};
+#define s6_addr _S6_un._S6_u8
+#define s6_addr8 _S6_un._S6_u8
+#define s6_addr16 _S6_un._S6_u16
+#define s6_addr32 _S6_un._S6_u32
+
+#define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}}
+#define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}}
+
+LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_any;
+LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_loopback;
+
+struct sockaddr_in6 {
+#ifdef ISC_PLATFORM_HAVESALEN
+ isc_uint8_t sin6_len;
+ isc_uint8_t sin6_family;
+#else
+ isc_uint16_t sin6_family;
+#endif
+ isc_uint16_t sin6_port;
+ isc_uint32_t sin6_flowinfo;
+ struct in6_addr sin6_addr;
+ isc_uint32_t sin6_scope_id;
+};
+
+#ifdef ISC_PLATFORM_HAVESALEN
+#define SIN6_LEN 1
+#endif
+
+/*%
+ * Unspecified
+ */
+#define IN6_IS_ADDR_UNSPECIFIED(a) \
+ (((a)->s6_addr32[0] == 0) && \
+ ((a)->s6_addr32[1] == 0) && \
+ ((a)->s6_addr32[2] == 0) && \
+ ((a)->s6_addr32[3] == 0))
+
+/*%
+ * Loopback
+ */
+#define IN6_IS_ADDR_LOOPBACK(a) \
+ (((a)->s6_addr32[0] == 0) && \
+ ((a)->s6_addr32[1] == 0) && \
+ ((a)->s6_addr32[2] == 0) && \
+ ((a)->s6_addr32[3] == htonl(1)))
+
+/*%
+ * IPv4 compatible
+ */
+#define IN6_IS_ADDR_V4COMPAT(a) \
+ (((a)->s6_addr32[0] == 0) && \
+ ((a)->s6_addr32[1] == 0) && \
+ ((a)->s6_addr32[2] == 0) && \
+ ((a)->s6_addr32[3] != 0) && \
+ ((a)->s6_addr32[3] != htonl(1)))
+
+/*%
+ * Mapped
+ */
+#define IN6_IS_ADDR_V4MAPPED(a) \
+ (((a)->s6_addr32[0] == 0) && \
+ ((a)->s6_addr32[1] == 0) && \
+ ((a)->s6_addr32[2] == htonl(0x0000ffff)))
+
+/*%
+ * Multicast
+ */
+#define IN6_IS_ADDR_MULTICAST(a) \
+ ((a)->s6_addr8[0] == 0xffU)
+
+/*%
+ * Unicast link / site local.
+ */
+#define IN6_IS_ADDR_LINKLOCAL(a) \
+ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
+#define IN6_IS_ADDR_SITELOCAL(a) \
+ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
+
+#endif /* ISC_IPV6_H */
diff --git a/lib/isc/include/isc/iterated_hash.h b/lib/isc/include/isc/iterated_hash.h
new file mode 100644
index 0000000..a8173f0
--- /dev/null
+++ b/lib/isc/include/isc/iterated_hash.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: iterated_hash.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */
+
+#ifndef ISC_ITERATED_HASH_H
+#define ISC_ITERATED_HASH_H 1
+
+#include <isc/lang.h>
+#include <isc/sha1.h>
+
+/*
+ * The maximal hash length that can be encoded it a name
+ * using base32hex. floor(255/8)*5
+ */
+#define NSEC3_MAX_HASH_LENGTH 155
+
+/*
+ * The maximum has that can be encoded in a single label using
+ * base32hex. floor(63/8)*5
+ */
+#define NSEC3_MAX_LABEL_HASH 35
+
+ISC_LANG_BEGINDECLS
+
+int isc_iterated_hash(unsigned char out[NSEC3_MAX_HASH_LENGTH],
+ unsigned int hashalg, int iterations,
+ const unsigned char *salt, int saltlength,
+ const unsigned char *in, int inlength);
+
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_ITERATED_HASH_H */
diff --git a/lib/isc/include/isc/lang.h b/lib/isc/include/isc/lang.h
new file mode 100644
index 0000000..8c60866
--- /dev/null
+++ b/lib/isc/include/isc/lang.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: lang.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_LANG_H
+#define ISC_LANG_H 1
+
+/*! \file isc/lang.h */
+
+#ifdef __cplusplus
+#define ISC_LANG_BEGINDECLS extern "C" {
+#define ISC_LANG_ENDDECLS }
+#else
+#define ISC_LANG_BEGINDECLS
+#define ISC_LANG_ENDDECLS
+#endif
+
+#endif /* ISC_LANG_H */
diff --git a/lib/isc/include/isc/lex.h b/lib/isc/include/isc/lex.h
new file mode 100644
index 0000000..8612150
--- /dev/null
+++ b/lib/isc/include/isc/lex.h
@@ -0,0 +1,431 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: lex.h,v 1.37 2008/05/30 23:47:01 tbox Exp $ */
+
+#ifndef ISC_LEX_H
+#define ISC_LEX_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/lex.h
+ * \brief The "lex" module provides a lightweight tokenizer. It can operate
+ * on files or buffers, and can handle "include". It is designed for
+ * parsing of DNS master files and the BIND configuration file, but
+ * should be general enough to tokenize other things, e.g. HTTP.
+ *
+ * \li MP:
+ * No synchronization is provided. Clients must ensure exclusive
+ * access.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * TBS
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/region.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Options
+ ***/
+
+/*@{*/
+/*!
+ * Various options for isc_lex_gettoken().
+ */
+
+#define ISC_LEXOPT_EOL 0x01 /*%< Want end-of-line token. */
+#define ISC_LEXOPT_EOF 0x02 /*%< Want end-of-file token. */
+#define ISC_LEXOPT_INITIALWS 0x04 /*%< Want initial whitespace. */
+#define ISC_LEXOPT_NUMBER 0x08 /*%< Recognize numbers. */
+#define ISC_LEXOPT_QSTRING 0x10 /*%< Recognize qstrings. */
+/*@}*/
+
+/*@{*/
+/*!
+ * The ISC_LEXOPT_DNSMULTILINE option handles the processing of '(' and ')' in
+ * the DNS master file format. If this option is set, then the
+ * ISC_LEXOPT_INITIALWS and ISC_LEXOPT_EOL options will be ignored when
+ * the paren count is > 0. To use this option, '(' and ')' must be special
+ * characters.
+ */
+#define ISC_LEXOPT_DNSMULTILINE 0x20 /*%< Handle '(' and ')'. */
+#define ISC_LEXOPT_NOMORE 0x40 /*%< Want "no more" token. */
+
+#define ISC_LEXOPT_CNUMBER 0x80 /*%< Recognize octal and hex. */
+#define ISC_LEXOPT_ESCAPE 0x100 /*%< Recognize escapes. */
+#define ISC_LEXOPT_QSTRINGMULTILINE 0x200 /*%< Allow multiline "" strings */
+#define ISC_LEXOPT_OCTAL 0x400 /*%< Expect a octal number. */
+/*@}*/
+/*@{*/
+/*!
+ * Various commenting styles, which may be changed at any time with
+ * isc_lex_setcomments().
+ */
+
+#define ISC_LEXCOMMENT_C 0x01
+#define ISC_LEXCOMMENT_CPLUSPLUS 0x02
+#define ISC_LEXCOMMENT_SHELL 0x04
+#define ISC_LEXCOMMENT_DNSMASTERFILE 0x08
+/*@}*/
+
+/***
+ *** Types
+ ***/
+
+/*! Lex */
+
+typedef char isc_lexspecials_t[256];
+
+/* Tokens */
+
+typedef enum {
+ isc_tokentype_unknown = 0,
+ isc_tokentype_string = 1,
+ isc_tokentype_number = 2,
+ isc_tokentype_qstring = 3,
+ isc_tokentype_eol = 4,
+ isc_tokentype_eof = 5,
+ isc_tokentype_initialws = 6,
+ isc_tokentype_special = 7,
+ isc_tokentype_nomore = 8
+} isc_tokentype_t;
+
+typedef union {
+ char as_char;
+ unsigned long as_ulong;
+ isc_region_t as_region;
+ isc_textregion_t as_textregion;
+ void * as_pointer;
+} isc_tokenvalue_t;
+
+typedef struct isc_token {
+ isc_tokentype_t type;
+ isc_tokenvalue_t value;
+} isc_token_t;
+
+/***
+ *** Functions
+ ***/
+
+isc_result_t
+isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp);
+/*%<
+ * Create a lexer.
+ *
+ * 'max_token' is a hint of the number of bytes in the largest token.
+ *
+ * Requires:
+ *\li '*lexp' is a valid lexer.
+ *
+ *\li max_token > 0.
+ *
+ * Ensures:
+ *\li On success, *lexp is attached to the newly created lexer.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ */
+
+void
+isc_lex_destroy(isc_lex_t **lexp);
+/*%<
+ * Destroy the lexer.
+ *
+ * Requires:
+ *\li '*lexp' is a valid lexer.
+ *
+ * Ensures:
+ *\li *lexp == NULL
+ */
+
+unsigned int
+isc_lex_getcomments(isc_lex_t *lex);
+/*%<
+ * Return the current lexer commenting styles.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ * Returns:
+ *\li The commenting sytles which are currently allowed.
+ */
+
+void
+isc_lex_setcomments(isc_lex_t *lex, unsigned int comments);
+/*%<
+ * Set allowed lexer commenting styles.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'comments' has meaningful values.
+ */
+
+void
+isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials);
+/*%<
+ * Put the current list of specials into 'specials'.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ */
+
+void
+isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials);
+/*!<
+ * The characters in 'specials' are returned as tokens. Along with
+ * whitespace, they delimit strings and numbers.
+ *
+ * Note:
+ *\li Comment processing takes precedence over special character
+ * recognition.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ */
+
+isc_result_t
+isc_lex_openfile(isc_lex_t *lex, const char *filename);
+/*%<
+ * Open 'filename' and make it the current input source for 'lex'.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li filename is a valid C string.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY Out of memory
+ *\li #ISC_R_NOTFOUND File not found
+ *\li #ISC_R_NOPERM No permission to open file
+ *\li #ISC_R_FAILURE Couldn't open file, not sure why
+ *\li #ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_lex_openstream(isc_lex_t *lex, FILE *stream);
+/*%<
+ * Make 'stream' the current input source for 'lex'.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'stream' is a valid C stream.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY Out of memory
+ */
+
+isc_result_t
+isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer);
+/*%<
+ * Make 'buffer' the current input source for 'lex'.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'buffer' is a valid buffer.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY Out of memory
+ */
+
+isc_result_t
+isc_lex_close(isc_lex_t *lex);
+/*%<
+ * Close the most recently opened object (i.e. file or buffer).
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMORE No more input sources
+ */
+
+isc_result_t
+isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp);
+/*%<
+ * Get the next token.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'lex' has an input source.
+ *
+ *\li 'options' contains valid options.
+ *
+ *\li '*tokenp' is a valid pointer.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_UNEXPECTEDEND
+ *\li #ISC_R_NOMEMORY
+ *
+ * These two results are returned only if their corresponding lexer
+ * options are not set.
+ *
+ *\li #ISC_R_EOF End of input source
+ *\li #ISC_R_NOMORE No more input sources
+ */
+
+isc_result_t
+isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token,
+ isc_tokentype_t expect, isc_boolean_t eol);
+/*%<
+ * Get the next token from a DNS master file type stream. This is a
+ * convenience function that sets appropriate options and handles quoted
+ * strings and end of line correctly for master files. It also ungets
+ * unexpected tokens.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'token' is a valid pointer
+ *
+ * Returns:
+ *
+ * \li any return code from isc_lex_gettoken().
+ */
+
+isc_result_t
+isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol);
+/*%<
+ * Get the next token from a DNS master file type stream. This is a
+ * convenience function that sets appropriate options and handles end
+ * of line correctly for master files. It also ungets unexpected tokens.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'token' is a valid pointer
+ *
+ * Returns:
+ *
+ * \li any return code from isc_lex_gettoken().
+ */
+
+void
+isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp);
+/*%<
+ * Unget the current token.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'lex' has an input source.
+ *
+ *\li 'tokenp' points to a valid token.
+ *
+ *\li There is no ungotten token already.
+ */
+
+void
+isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r);
+/*%<
+ * Returns a region containing the text of the last token returned.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ *\li 'lex' has an input source.
+ *
+ *\li 'tokenp' points to a valid token.
+ *
+ *\li A token has been gotten and not ungotten.
+ */
+
+char *
+isc_lex_getsourcename(isc_lex_t *lex);
+/*%<
+ * Return the input source name.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ * Returns:
+ * \li source name or NULL if no current source.
+ *\li result valid while current input source exists.
+ */
+
+
+unsigned long
+isc_lex_getsourceline(isc_lex_t *lex);
+/*%<
+ * Return the input source line number.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ * Returns:
+ *\li Current line number or 0 if no current source.
+ */
+
+isc_result_t
+isc_lex_setsourcename(isc_lex_t *lex, const char *name);
+/*%<
+ * Assigns a new name to the input source.
+ *
+ * Requires:
+ *
+ * \li 'lex' is a valid lexer.
+ *
+ * Returns:
+ * \li #ISC_R_SUCCESS
+ * \li #ISC_R_NOMEMORY
+ * \li #ISC_R_NOTFOUND - there are no sources.
+ */
+
+isc_boolean_t
+isc_lex_isfile(isc_lex_t *lex);
+/*%<
+ * Return whether the current input source is a file.
+ *
+ * Requires:
+ *\li 'lex' is a valid lexer.
+ *
+ * Returns:
+ * \li #ISC_TRUE if the current input is a file,
+ *\li #ISC_FALSE otherwise.
+ */
+
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_LEX_H */
diff --git a/lib/isc/include/isc/lfsr.h b/lib/isc/include/isc/lfsr.h
new file mode 100644
index 0000000..d4d9707
--- /dev/null
+++ b/lib/isc/include/isc/lfsr.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: lfsr.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_LFSR_H
+#define ISC_LFSR_H 1
+
+/*! \file isc/lfsr.h */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+typedef struct isc_lfsr isc_lfsr_t;
+
+/*%
+ * This function is called when reseeding is needed. It is allowed to
+ * modify any state in the LFSR in any way it sees fit OTHER THAN "bits".
+ *
+ * It MUST set "count" to a new value or the lfsr will never reseed again.
+ *
+ * Also, a reseed will never occur in the middle of an extraction. This
+ * is purely an optimization, and is probably what one would want.
+ */
+typedef void (*isc_lfsrreseed_t)(isc_lfsr_t *, void *);
+
+/*%
+ * The members of this structure can be used by the application, but care
+ * needs to be taken to not change state once the lfsr is in operation.
+ */
+struct isc_lfsr {
+ isc_uint32_t state; /*%< previous state */
+ unsigned int bits; /*%< length */
+ isc_uint32_t tap; /*%< bit taps */
+ unsigned int count; /*%< reseed count (in BITS!) */
+ isc_lfsrreseed_t reseed; /*%< reseed function */
+ void *arg; /*%< reseed function argument */
+};
+
+ISC_LANG_BEGINDECLS
+
+
+void
+isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits,
+ isc_uint32_t tap, unsigned int count,
+ isc_lfsrreseed_t reseed, void *arg);
+/*%<
+ * Initialize an LFSR.
+ *
+ * Note:
+ *
+ *\li Putting untrusted values into this function will cause the LFSR to
+ * generate (perhaps) non-maximal length sequences.
+ *
+ * Requires:
+ *
+ *\li lfsr != NULL
+ *
+ *\li 8 <= bits <= 32
+ *
+ *\li tap != 0
+ */
+
+void
+isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count);
+/*%<
+ * Returns "count" bytes of data from the LFSR.
+ *
+ * Requires:
+ *
+ *\li lfsr be valid.
+ *
+ *\li data != NULL.
+ *
+ *\li count > 0.
+ */
+
+void
+isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip);
+/*%<
+ * Skip "skip" states.
+ *
+ * Requires:
+ *
+ *\li lfsr be valid.
+ */
+
+isc_uint32_t
+isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2);
+/*%<
+ * Given two LFSRs, use the current state from each to skip entries in the
+ * other. The next states are then xor'd together and returned.
+ *
+ * WARNING:
+ *
+ *\li This function is used only for very, very low security data, such
+ * as DNS message IDs where it is desired to have an unpredictable
+ * stream of bytes that are harder to predict than a simple flooding
+ * attack.
+ *
+ * Notes:
+ *
+ *\li Since the current state from each of the LFSRs is used to skip
+ * state in the other, it is important that no state be leaked
+ * from either LFSR.
+ *
+ * Requires:
+ *
+ *\li lfsr1 and lfsr2 be valid.
+ *
+ *\li 1 <= skipbits <= 31
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_LFSR_H */
diff --git a/lib/isc/include/isc/lib.h b/lib/isc/include/isc/lib.h
new file mode 100644
index 0000000..f24fef8
--- /dev/null
+++ b/lib/isc/include/isc/lib.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: lib.h,v 1.16 2009/09/02 23:48:03 tbox Exp $ */
+
+#ifndef ISC_LIB_H
+#define ISC_LIB_H 1
+
+/*! \file isc/lib.h */
+
+#include <isc/types.h>
+#include <isc/lang.h>
+
+ISC_LANG_BEGINDECLS
+
+LIBISC_EXTERNAL_DATA extern isc_msgcat_t *isc_msgcat;
+
+void
+isc_lib_initmsgcat(void);
+/*!<
+ * \brief Initialize the ISC library's message catalog, isc_msgcat, if it
+ * has not already been initialized.
+ */
+
+void
+isc_lib_register(void);
+/*!<
+ * \brief Register the ISC library implementations for some base services
+ * such as memory or event management and handling socket or timer events.
+ * An external application that wants to use the ISC library must call this
+ * function very early in main().
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_LIB_H */
diff --git a/lib/isc/include/isc/list.h b/lib/isc/include/isc/list.h
new file mode 100644
index 0000000..c9bdfc7
--- /dev/null
+++ b/lib/isc/include/isc/list.h
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2004, 2006, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_LIST_H
+#define ISC_LIST_H 1
+#include <isc/boolean.h>
+#include <isc/assertions.h>
+
+#ifdef ISC_LIST_CHECKINIT
+#define ISC_LINK_INSIST(x) ISC_INSIST(x)
+#else
+#define ISC_LINK_INSIST(x)
+#endif
+
+#define ISC_LIST(type) struct { type *head, *tail; }
+#define ISC_LIST_INIT(list) \
+ do { (list).head = NULL; (list).tail = NULL; } while (0)
+
+#define ISC_LINK(type) struct { type *prev, *next; }
+#define ISC_LINK_INIT_TYPE(elt, link, type) \
+ do { \
+ (elt)->link.prev = (type *)(-1); \
+ (elt)->link.next = (type *)(-1); \
+ } while (0)
+#define ISC_LINK_INIT(elt, link) \
+ ISC_LINK_INIT_TYPE(elt, link, void)
+#define ISC_LINK_LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1))
+
+#define ISC_LIST_HEAD(list) ((list).head)
+#define ISC_LIST_TAIL(list) ((list).tail)
+#define ISC_LIST_EMPTY(list) ISC_TF((list).head == NULL)
+
+#define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \
+ do { \
+ if ((list).head != NULL) \
+ (list).head->link.prev = (elt); \
+ else \
+ (list).tail = (elt); \
+ (elt)->link.prev = NULL; \
+ (elt)->link.next = (list).head; \
+ (list).head = (elt); \
+ } while (0)
+
+#define ISC_LIST_PREPEND(list, elt, link) \
+ do { \
+ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
+ __ISC_LIST_PREPENDUNSAFE(list, elt, link); \
+ } while (0)
+
+#define ISC_LIST_INITANDPREPEND(list, elt, link) \
+ __ISC_LIST_PREPENDUNSAFE(list, elt, link)
+
+#define __ISC_LIST_APPENDUNSAFE(list, elt, link) \
+ do { \
+ if ((list).tail != NULL) \
+ (list).tail->link.next = (elt); \
+ else \
+ (list).head = (elt); \
+ (elt)->link.prev = (list).tail; \
+ (elt)->link.next = NULL; \
+ (list).tail = (elt); \
+ } while (0)
+
+#define ISC_LIST_APPEND(list, elt, link) \
+ do { \
+ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
+ __ISC_LIST_APPENDUNSAFE(list, elt, link); \
+ } while (0)
+
+#define ISC_LIST_INITANDAPPEND(list, elt, link) \
+ __ISC_LIST_APPENDUNSAFE(list, elt, link)
+
+#define __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type) \
+ do { \
+ if ((elt)->link.next != NULL) \
+ (elt)->link.next->link.prev = (elt)->link.prev; \
+ else { \
+ ISC_INSIST((list).tail == (elt)); \
+ (list).tail = (elt)->link.prev; \
+ } \
+ if ((elt)->link.prev != NULL) \
+ (elt)->link.prev->link.next = (elt)->link.next; \
+ else { \
+ ISC_INSIST((list).head == (elt)); \
+ (list).head = (elt)->link.next; \
+ } \
+ (elt)->link.prev = (type *)(-1); \
+ (elt)->link.next = (type *)(-1); \
+ } while (0)
+
+#define __ISC_LIST_UNLINKUNSAFE(list, elt, link) \
+ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, void)
+
+#define ISC_LIST_UNLINK_TYPE(list, elt, link, type) \
+ do { \
+ ISC_LINK_INSIST(ISC_LINK_LINKED(elt, link)); \
+ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type); \
+ } while (0)
+#define ISC_LIST_UNLINK(list, elt, link) \
+ ISC_LIST_UNLINK_TYPE(list, elt, link, void)
+
+#define ISC_LIST_PREV(elt, link) ((elt)->link.prev)
+#define ISC_LIST_NEXT(elt, link) ((elt)->link.next)
+
+#define __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \
+ do { \
+ if ((before)->link.prev == NULL) \
+ ISC_LIST_PREPEND(list, elt, link); \
+ else { \
+ (elt)->link.prev = (before)->link.prev; \
+ (before)->link.prev = (elt); \
+ (elt)->link.prev->link.next = (elt); \
+ (elt)->link.next = (before); \
+ } \
+ } while (0)
+
+#define ISC_LIST_INSERTBEFORE(list, before, elt, link) \
+ do { \
+ ISC_LINK_INSIST(ISC_LINK_LINKED(before, link)); \
+ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
+ __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link); \
+ } while (0)
+
+#define __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \
+ do { \
+ if ((after)->link.next == NULL) \
+ ISC_LIST_APPEND(list, elt, link); \
+ else { \
+ (elt)->link.next = (after)->link.next; \
+ (after)->link.next = (elt); \
+ (elt)->link.next->link.prev = (elt); \
+ (elt)->link.prev = (after); \
+ } \
+ } while (0)
+
+#define ISC_LIST_INSERTAFTER(list, after, elt, link) \
+ do { \
+ ISC_LINK_INSIST(ISC_LINK_LINKED(after, link)); \
+ ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
+ __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link); \
+ } while (0)
+
+#define ISC_LIST_APPENDLIST(list1, list2, link) \
+ do { \
+ if (ISC_LIST_EMPTY(list1)) \
+ (list1) = (list2); \
+ else if (!ISC_LIST_EMPTY(list2)) { \
+ (list1).tail->link.next = (list2).head; \
+ (list2).head->link.prev = (list1).tail; \
+ (list1).tail = (list2).tail; \
+ } \
+ (list2).head = NULL; \
+ (list2).tail = NULL; \
+ } while (0)
+
+#define ISC_LIST_PREPENDLIST(list1, list2, link) \
+ do { \
+ if (ISC_LIST_EMPTY(list1)) \
+ (list1) = (list2); \
+ else if (!ISC_LIST_EMPTY(list2)) { \
+ (list2).tail->link.next = (list1).head; \
+ (list1).head->link.prev = (list2).tail; \
+ (list1).head = (list2).head; \
+ } \
+ (list2).head = NULL; \
+ (list2).tail = NULL; \
+ } while (0)
+
+#define ISC_LIST_ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link)
+#define __ISC_LIST_ENQUEUEUNSAFE(list, elt, link) \
+ __ISC_LIST_APPENDUNSAFE(list, elt, link)
+#define ISC_LIST_DEQUEUE(list, elt, link) \
+ ISC_LIST_UNLINK_TYPE(list, elt, link, void)
+#define ISC_LIST_DEQUEUE_TYPE(list, elt, link, type) \
+ ISC_LIST_UNLINK_TYPE(list, elt, link, type)
+#define __ISC_LIST_DEQUEUEUNSAFE(list, elt, link) \
+ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, void)
+#define __ISC_LIST_DEQUEUEUNSAFE_TYPE(list, elt, link, type) \
+ __ISC_LIST_UNLINKUNSAFE_TYPE(list, elt, link, type)
+
+#endif /* ISC_LIST_H */
diff --git a/lib/isc/include/isc/log.h b/lib/isc/include/isc/log.h
new file mode 100644
index 0000000..741c532
--- /dev/null
+++ b/lib/isc/include/isc/log.h
@@ -0,0 +1,914 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: log.h,v 1.59 2009/02/16 02:01:16 marka Exp $ */
+
+#ifndef ISC_LOG_H
+#define ISC_LOG_H 1
+
+/*! \file isc/log.h */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <syslog.h> /* XXXDCL NT */
+
+#include <isc/formatcheck.h>
+#include <isc/lang.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+
+/*@{*/
+/*!
+ * \brief Severity levels, patterned after Unix's syslog levels.
+ *
+ */
+#define ISC_LOG_DEBUG(level) (level)
+/*!
+ * #ISC_LOG_DYNAMIC can only be used for defining channels with
+ * isc_log_createchannel(), not to specify a level in isc_log_write().
+ */
+#define ISC_LOG_DYNAMIC 0
+#define ISC_LOG_INFO (-1)
+#define ISC_LOG_NOTICE (-2)
+#define ISC_LOG_WARNING (-3)
+#define ISC_LOG_ERROR (-4)
+#define ISC_LOG_CRITICAL (-5)
+/*@}*/
+
+/*@{*/
+/*!
+ * \brief Destinations.
+ */
+#define ISC_LOG_TONULL 1
+#define ISC_LOG_TOSYSLOG 2
+#define ISC_LOG_TOFILE 3
+#define ISC_LOG_TOFILEDESC 4
+/*@}*/
+
+/*@{*/
+/*%
+ * Channel flags.
+ */
+#define ISC_LOG_PRINTTIME 0x0001
+#define ISC_LOG_PRINTLEVEL 0x0002
+#define ISC_LOG_PRINTCATEGORY 0x0004
+#define ISC_LOG_PRINTMODULE 0x0008
+#define ISC_LOG_PRINTTAG 0x0010
+#define ISC_LOG_PRINTALL 0x001F
+#define ISC_LOG_DEBUGONLY 0x1000
+#define ISC_LOG_OPENERR 0x8000 /* internal */
+/*@}*/
+
+/*@{*/
+/*!
+ * \brief Other options.
+ *
+ * XXXDCL INFINITE doesn't yet work. Arguably it isn't needed, but
+ * since I am intend to make large number of versions work efficiently,
+ * INFINITE is going to be trivial to add to that.
+ */
+#define ISC_LOG_ROLLINFINITE (-1)
+#define ISC_LOG_ROLLNEVER (-2)
+/*@}*/
+
+/*!
+ * \brief Used to name the categories used by a library.
+ *
+ * An array of isc_logcategory
+ * structures names each category, and the id value is initialized by calling
+ * isc_log_registercategories.
+ */
+struct isc_logcategory {
+ const char *name;
+ unsigned int id;
+};
+
+/*%
+ * Similar to isc_logcategory, but for all the modules a library defines.
+ */
+struct isc_logmodule {
+ const char *name;
+ unsigned int id;
+};
+
+/*%
+ * The isc_logfile structure is initialized as part of an isc_logdestination
+ * before calling isc_log_createchannel().
+ *
+ * When defining an #ISC_LOG_TOFILE
+ * channel the name, versions and maximum_size should be set before calling
+ * isc_log_createchannel(). To define an #ISC_LOG_TOFILEDESC channel set only
+ * the stream before the call.
+ *
+ * Setting maximum_size to zero implies no maximum.
+ */
+typedef struct isc_logfile {
+ FILE *stream; /*%< Initialized to NULL for #ISC_LOG_TOFILE. */
+ const char *name; /*%< NULL for #ISC_LOG_TOFILEDESC. */
+ int versions; /* >= 0, #ISC_LOG_ROLLNEVER, #ISC_LOG_ROLLINFINITE. */
+ /*%
+ * stdio's ftell is standardized to return a long, which may well not
+ * be big enough for the largest file supportable by the operating
+ * system (though it is _probably_ big enough for the largest log
+ * anyone would want). st_size returned by fstat should be typedef'd
+ * to a size large enough for the largest possible file on a system.
+ */
+ isc_offset_t maximum_size;
+ isc_boolean_t maximum_reached; /*%< Private. */
+} isc_logfile_t;
+
+/*%
+ * Passed to isc_log_createchannel to define the attributes of either
+ * a stdio or a syslog log.
+ */
+typedef union isc_logdestination {
+ isc_logfile_t file;
+ int facility; /* XXXDCL NT */
+} isc_logdestination_t;
+
+/*@{*/
+/*%
+ * The built-in categories of libisc.
+ *
+ * Each library registering categories should provide library_LOGCATEGORY_name
+ * definitions with indexes into its isc_logcategory structure corresponding to
+ * the order of the names.
+ */
+LIBISC_EXTERNAL_DATA extern isc_logcategory_t isc_categories[];
+LIBISC_EXTERNAL_DATA extern isc_log_t *isc_lctx;
+LIBISC_EXTERNAL_DATA extern isc_logmodule_t isc_modules[];
+/*@}*/
+
+/*@{*/
+/*%
+ * Do not log directly to DEFAULT. Use another category. When in doubt,
+ * use GENERAL.
+ */
+#define ISC_LOGCATEGORY_DEFAULT (&isc_categories[0])
+#define ISC_LOGCATEGORY_GENERAL (&isc_categories[1])
+/*@}*/
+
+#define ISC_LOGMODULE_SOCKET (&isc_modules[0])
+#define ISC_LOGMODULE_TIME (&isc_modules[1])
+#define ISC_LOGMODULE_INTERFACE (&isc_modules[2])
+#define ISC_LOGMODULE_TIMER (&isc_modules[3])
+#define ISC_LOGMODULE_FILE (&isc_modules[4])
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp);
+/*%<
+ * Establish a new logging context, with default channels.
+ *
+ * Notes:
+ *\li isc_log_create() calls isc_logconfig_create(), so see its comment
+ * below for more information.
+ *
+ * Requires:
+ *\li mctx is a valid memory context.
+ *\li lctxp is not null and *lctxp is null.
+ *\li lcfgp is null or lcfgp is not null and *lcfgp is null.
+ *
+ * Ensures:
+ *\li *lctxp will point to a valid logging context if all of the necessary
+ * memory was allocated, or NULL otherwise.
+ *\li *lcfgp will point to a valid logging configuration if all of the
+ * necessary memory was allocated, or NULL otherwise.
+ *\li On failure, no additional memory is allocated.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success
+ *\li #ISC_R_NOMEMORY Resource limit: Out of memory
+ */
+
+isc_result_t
+isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp);
+/*%<
+ * Create the data structure that holds all of the configurable information
+ * about where messages are actually supposed to be sent -- the information
+ * that could changed based on some configuration file, as opposed to the
+ * the category/module specification of isc_log_[v]write[1] that is compiled
+ * into a program, or the debug_level which is dynamic state information.
+ *
+ * Notes:
+ *\li It is necessary to specify the logging context the configuration
+ * will be used with because the number of categories and modules
+ * needs to be known in order to set the configuration. However,
+ * the configuration is not used by the logging context until the
+ * isc_logconfig_use function is called.
+ *
+ *\li The memory context used for operations that allocate memory for
+ * the configuration is that of the logging context, as specified
+ * in the isc_log_create call.
+ *
+ *\li Four default channels are established:
+ *\verbatim
+ * default_syslog
+ * - log to syslog's daemon facility #ISC_LOG_INFO or higher
+ * default_stderr
+ * - log to stderr #ISC_LOG_INFO or higher
+ * default_debug
+ * - log to stderr #ISC_LOG_DEBUG dynamically
+ * null
+ * - log nothing
+ *\endverbatim
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *\li lcftp is not null and *lcfgp is null.
+ *
+ * Ensures:
+ *\li *lcfgp will point to a valid logging context if all of the necessary
+ * memory was allocated, or NULL otherwise.
+ *\li On failure, no additional memory is allocated.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success
+ *\li #ISC_R_NOMEMORY Resource limit: Out of memory
+ */
+
+isc_logconfig_t *
+isc_logconfig_get(isc_log_t *lctx);
+/*%<
+ * Returns a pointer to the configuration currently in use by the log context.
+ *
+ * Requires:
+ *\li lctx is a valid context.
+ *
+ * Ensures:
+ *\li The configuration pointer is non-null.
+ *
+ * Returns:
+ *\li The configuration pointer.
+ */
+
+isc_result_t
+isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg);
+/*%<
+ * Associate a new configuration with a logging context.
+ *
+ * Notes:
+ *\li This is thread safe. The logging context will lock a mutex
+ * before attempting to swap in the new configuration, and isc_log_doit
+ * (the internal function used by all of isc_log_[v]write[1]) locks
+ * the same lock for the duration of its use of the configuration.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *\li lcfg is a valid logging configuration.
+ *\li lctx is the same configuration given to isc_logconfig_create
+ * when the configuration was created.
+ *
+ * Ensures:
+ *\li Future calls to isc_log_write will use the new configuration.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success
+ *\li #ISC_R_NOMEMORY Resource limit: Out of memory
+ */
+
+void
+isc_log_destroy(isc_log_t **lctxp);
+/*%<
+ * Deallocate the memory associated with a logging context.
+ *
+ * Requires:
+ *\li *lctx is a valid logging context.
+ *
+ * Ensures:
+ *\li All of the memory associated with the logging context is returned
+ * to the free memory pool.
+ *
+ *\li Any open files are closed.
+ *
+ *\li The logging context is marked as invalid.
+ */
+
+void
+isc_logconfig_destroy(isc_logconfig_t **lcfgp);
+/*%<
+ * Destroy a logging configuration.
+ *
+ * Notes:
+ *\li This function cannot be used directly with the return value of
+ * isc_logconfig_get, because a logging context must always have
+ * a valid configuration associated with it.
+ *
+ * Requires:
+ *\li lcfgp is not null and *lcfgp is a valid logging configuration.
+ *\li The logging configuration is not in use by an existing logging context.
+ *
+ * Ensures:
+ *\li All memory allocated for the configuration is freed.
+ *
+ *\li The configuration is marked as invalid.
+ */
+
+void
+isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]);
+/*%<
+ * Identify logging categories a library will use.
+ *
+ * Notes:
+ *\li A category should only be registered once, but no mechanism enforces
+ * this rule.
+ *
+ *\li The end of the categories array is identified by a NULL name.
+ *
+ *\li Because the name is used by #ISC_LOG_PRINTCATEGORY, it should not
+ * be altered or destroyed after isc_log_registercategories().
+ *
+ *\li Because each element of the categories array is used by
+ * isc_log_categorybyname, it should not be altered or destroyed
+ * after registration.
+ *
+ *\li The value of the id integer in each structure is overwritten
+ * by this function, and so id need not be initialized to any particular
+ * value prior to the function call.
+ *
+ *\li A subsequent call to isc_log_registercategories with the same
+ * logging context (but new categories) will cause the last
+ * element of the categories array from the prior call to have
+ * its "name" member changed from NULL to point to the new
+ * categories array, and its "id" member set to UINT_MAX.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *\li categories != NULL.
+ *\li categories[0].name != NULL.
+ *
+ * Ensures:
+ * \li There are references to each category in the logging context,
+ * so they can be used with isc_log_usechannel() and isc_log_write().
+ */
+
+void
+isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]);
+/*%<
+ * Identify logging categories a library will use.
+ *
+ * Notes:
+ *\li A module should only be registered once, but no mechanism enforces
+ * this rule.
+ *
+ *\li The end of the modules array is identified by a NULL name.
+ *
+ *\li Because the name is used by #ISC_LOG_PRINTMODULE, it should not
+ * be altered or destroyed after isc_log_registermodules().
+ *
+ *\li Because each element of the modules array is used by
+ * isc_log_modulebyname, it should not be altered or destroyed
+ * after registration.
+ *
+ *\li The value of the id integer in each structure is overwritten
+ * by this function, and so id need not be initialized to any particular
+ * value prior to the function call.
+ *
+ *\li A subsequent call to isc_log_registermodules with the same
+ * logging context (but new modules) will cause the last
+ * element of the modules array from the prior call to have
+ * its "name" member changed from NULL to point to the new
+ * modules array, and its "id" member set to UINT_MAX.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *\li modules != NULL.
+ *\li modules[0].name != NULL;
+ *
+ * Ensures:
+ *\li Each module has a reference in the logging context, so they can be
+ * used with isc_log_usechannel() and isc_log_write().
+ */
+
+isc_result_t
+isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
+ unsigned int type, int level,
+ const isc_logdestination_t *destination,
+ unsigned int flags);
+/*%<
+ * Specify the parameters of a logging channel.
+ *
+ * Notes:
+ *\li The name argument is copied to memory in the logging context, so
+ * it can be altered or destroyed after isc_log_createchannel().
+ *
+ *\li Defining a very large number of channels will have a performance
+ * impact on isc_log_usechannel(), since the names are searched
+ * linearly until a match is made. This same issue does not affect
+ * isc_log_write, however.
+ *
+ *\li Channel names can be redefined; this is primarily useful for programs
+ * that want their own definition of default_syslog, default_debug
+ * and default_stderr.
+ *
+ *\li Any channel that is redefined will not affect logging that was
+ * already directed to its original definition, _except_ for the
+ * default_stderr channel. This case is handled specially so that
+ * the default logging category can be changed by redefining
+ * default_stderr. (XXXDCL Though now that I think of it, the default
+ * logging category can be changed with only one additional function
+ * call by defining a new channel and then calling isc_log_usechannel()
+ * for #ISC_LOGCATEGORY_DEFAULT.)
+ *
+ *\li Specifying #ISC_LOG_PRINTTIME or #ISC_LOG_PRINTTAG for syslog is allowed,
+ * but probably not what you wanted to do.
+ *
+ * #ISC_LOG_DEBUGONLY will mark the channel as usable only when the
+ * debug level of the logging context (see isc_log_setdebuglevel)
+ * is non-zero.
+ *
+ * Requires:
+ *\li lcfg is a valid logging configuration.
+ *
+ *\li name is not NULL.
+ *
+ *\li type is #ISC_LOG_TOSYSLOG, #ISC_LOG_TOFILE, #ISC_LOG_TOFILEDESC or
+ * #ISC_LOG_TONULL.
+ *
+ *\li destination is not NULL unless type is #ISC_LOG_TONULL.
+ *
+ *\li level is >= #ISC_LOG_CRITICAL (the most negative logging level).
+ *
+ *\li flags does not include any bits aside from the ISC_LOG_PRINT* bits
+ * or #ISC_LOG_DEBUGONLY.
+ *
+ * Ensures:
+ *\li #ISC_R_SUCCESS
+ * A channel with the given name is usable with
+ * isc_log_usechannel().
+ *
+ *\li #ISC_R_NOMEMORY or #ISC_R_UNEXPECTED
+ * No additional memory is being used by the logging context.
+ * Any channel that previously existed with the given name
+ * is not redefined.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success
+ *\li #ISC_R_NOMEMORY Resource limit: Out of memory
+ *\li #ISC_R_UNEXPECTED type was out of range and REQUIRE()
+ * was disabled.
+ */
+
+isc_result_t
+isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
+ const isc_logcategory_t *category,
+ const isc_logmodule_t *module);
+/*%<
+ * Associate a named logging channel with a category and module that
+ * will use it.
+ *
+ * Notes:
+ *\li The name is searched for linearly in the set of known channel names
+ * until a match is found. (Note the performance impact of a very large
+ * number of named channels.) When multiple channels of the same
+ * name are defined, the most recent definition is found.
+ *
+ *\li Specifying a very large number of channels for a category will have
+ * a moderate impact on performance in isc_log_write(), as each
+ * call looks up the category for the start of a linked list, which
+ * it follows all the way to the end to find matching modules. The
+ * test for matching modules is integral, though.
+ *
+ *\li If category is NULL, then the channel is associated with the indicated
+ * module for all known categories (including the "default" category).
+ *
+ *\li If module is NULL, then the channel is associated with every module
+ * that uses that category.
+ *
+ *\li Passing both category and module as NULL would make every log message
+ * use the indicated channel.
+ *
+ * \li Specifying a channel that is #ISC_LOG_TONULL for a category/module pair
+ * has no effect on any other channels associated with that pair,
+ * regardless of ordering. Thus you cannot use it to "mask out" one
+ * category/module pair when you have specified some other channel that
+ * is also used by that category/module pair.
+ *
+ * Requires:
+ *\li lcfg is a valid logging configuration.
+ *
+ *\li category is NULL or has an id that is in the range of known ids.
+ *
+ * module is NULL or has an id that is in the range of known ids.
+ *
+ * Ensures:
+ *\li #ISC_R_SUCCESS
+ * The channel will be used by the indicated category/module
+ * arguments.
+ *
+ *\li #ISC_R_NOMEMORY
+ * If assignment for a specific category has been requested,
+ * the channel has not been associated with the indicated
+ * category/module arguments and no additional memory is
+ * used by the logging context.
+ * If assignment for all categories has been requested
+ * then _some_ may have succeeded (starting with category
+ * "default" and progressing through the order of categories
+ * passed to isc_log_registercategories()) and additional memory
+ * is being used by whatever assignments succeeded.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success
+ *\li #ISC_R_NOMEMORY Resource limit: Out of memory
+ */
+
+/* Attention: next four comments PRECEED code */
+/*!
+ * \brief
+ * Write a message to the log channels.
+ *
+ * Notes:
+ *\li Log messages containing natural language text should be logged with
+ * isc_log_iwrite() to allow for localization.
+ *
+ *\li lctx can be NULL; this is allowed so that programs which use
+ * libraries that use the ISC logging system are not required to
+ * also use it.
+ *
+ *\li The format argument is a printf(3) string, with additional arguments
+ * as necessary.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *
+ *\li The category and module arguments must have ids that are in the
+ * range of known ids, as established by isc_log_registercategories()
+ * and isc_log_registermodules().
+ *
+ *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define
+ * channels, and explicit debugging level must be identified for
+ * isc_log_write() via ISC_LOG_DEBUG(level).
+ *
+ *\li format != NULL.
+ *
+ * Ensures:
+ *\li The log message is written to every channel associated with the
+ * indicated category/module pair.
+ *
+ * Returns:
+ *\li Nothing. Failure to log a message is not construed as a
+ * meaningful error.
+ */
+void
+isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ const char *format, ...)
+
+ISC_FORMAT_PRINTF(5, 6);
+
+/*%
+ * Write a message to the log channels.
+ *
+ * Notes:
+ *\li lctx can be NULL; this is allowed so that programs which use
+ * libraries that use the ISC logging system are not required to
+ * also use it.
+ *
+ *\li The format argument is a printf(3) string, with additional arguments
+ * as necessary.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *
+ *\li The category and module arguments must have ids that are in the
+ * range of known ids, as established by isc_log_registercategories()
+ * and isc_log_registermodules().
+ *
+ *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define
+ * channels, and explicit debugging level must be identified for
+ * isc_log_write() via ISC_LOG_DEBUG(level).
+ *
+ *\li format != NULL.
+ *
+ * Ensures:
+ *\li The log message is written to every channel associated with the
+ * indicated category/module pair.
+ *
+ * Returns:
+ *\li Nothing. Failure to log a message is not construed as a
+ * meaningful error.
+ */
+void
+isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ const char *format, va_list args)
+
+ISC_FORMAT_PRINTF(5, 0);
+
+/*%
+ * Write a message to the log channels, pruning duplicates that occur within
+ * a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).
+ * This function is otherwise identical to isc_log_write().
+ */
+void
+isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level, const char *format, ...)
+
+ISC_FORMAT_PRINTF(5, 6);
+
+/*%
+ * Write a message to the log channels, pruning duplicates that occur within
+ * a configurable amount of seconds (see isc_log_[sg]etduplicateinterval).
+ * This function is otherwise identical to isc_log_vwrite().
+ */
+void
+isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level, const char *format,
+ va_list args)
+
+ISC_FORMAT_PRINTF(5, 0);
+
+/*%
+ * These are four internationalized versions of the isc_log_[v]write[1]
+ * functions.
+ *
+ * The only difference is that they take arguments for a message
+ * catalog, message set, and message number, all immediately preceding the
+ * format argument. The format argument becomes the default text, a la
+ * isc_msgcat_get. If the message catalog is NULL, no lookup is attempted
+ * for a message -- which makes the message set and message number irrelevant,
+ * and the non-internationalized call should have probably been used instead.
+ *
+ * Yes, that means there are now *eight* interfaces to logging a message.
+ * Sheesh. Make the madness stop!
+ */
+/*@{*/
+void
+isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *format, ...)
+ISC_FORMAT_PRINTF(8, 9);
+
+void
+isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *format, va_list args)
+ISC_FORMAT_PRINTF(8, 0);
+
+void
+isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *format, ...)
+ISC_FORMAT_PRINTF(8, 9);
+
+void
+isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *format, va_list args)
+ISC_FORMAT_PRINTF(8, 0);
+/*@}*/
+
+void
+isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level);
+/*%<
+ * Set the debugging level used for logging.
+ *
+ * Notes:
+ *\li Setting the debugging level to 0 disables debugging log messages.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *
+ * Ensures:
+ *\li The debugging level is set to the requested value.
+ */
+
+unsigned int
+isc_log_getdebuglevel(isc_log_t *lctx);
+/*%<
+ * Get the current debugging level.
+ *
+ * Notes:
+ *\li This is provided so that a program can have a notion of
+ * "increment debugging level" or "decrement debugging level"
+ * without needing to keep track of what the current level is.
+ *
+ *\li A return value of 0 indicates that debugging messages are disabled.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *
+ * Ensures:
+ *\li The current logging debugging level is returned.
+ */
+
+isc_boolean_t
+isc_log_wouldlog(isc_log_t *lctx, int level);
+/*%<
+ * Determine whether logging something to 'lctx' at 'level' would
+ * actually cause something to be logged somewhere.
+ *
+ * If #ISC_FALSE is returned, it is guaranteed that nothing would
+ * be logged, allowing the caller to omit unnecessary
+ * isc_log_write() calls and possible message preformatting.
+ */
+
+void
+isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval);
+/*%<
+ * Set the interval over which duplicate log messages will be ignored
+ * by isc_log_[v]write1(), in seconds.
+ *
+ * Notes:
+ *\li Increasing the duplicate interval from X to Y will not necessarily
+ * filter out duplicates of messages logged in Y - X seconds since the
+ * increase. (Example: Message1 is logged at midnight. Message2
+ * is logged at 00:01:00, when the interval is only 30 seconds, causing
+ * Message1 to be expired from the log message history. Then the interval
+ * is increased to 3000 (five minutes) and at 00:04:00 Message1 is logged
+ * again. It will appear the second time even though less than five
+ * passed since the first occurrence.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ */
+
+unsigned int
+isc_log_getduplicateinterval(isc_logconfig_t *lcfg);
+/*%<
+ * Get the current duplicate filtering interval.
+ *
+ * Requires:
+ *\li lctx is a valid logging context.
+ *
+ * Returns:
+ *\li The current duplicate filtering interval.
+ */
+
+isc_result_t
+isc_log_settag(isc_logconfig_t *lcfg, const char *tag);
+/*%<
+ * Set the program name or other identifier for #ISC_LOG_PRINTTAG.
+ *
+ * Requires:
+ *\li lcfg is a valid logging configuration.
+ *
+ * Notes:
+ *\li If this function has not set the tag to a non-NULL, non-empty value,
+ * then the #ISC_LOG_PRINTTAG channel flag will not print anything.
+ * Unlike some implementations of syslog on Unix systems, you *must* set
+ * the tag in order to get it logged. It is not implicitly derived from
+ * the program name (which is pretty impossible to infer portably).
+ *
+ *\li Setting the tag to NULL or the empty string will also cause the
+ * #ISC_LOG_PRINTTAG channel flag to not print anything. If tag equals the
+ * empty string, calls to isc_log_gettag will return NULL.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success
+ *\li #ISC_R_NOMEMORY Resource Limit: Out of memory
+ *
+ * XXXDCL when creating a new isc_logconfig_t, it might be nice if the tag
+ * of the currently active isc_logconfig_t was inherited. this does not
+ * currently happen.
+ */
+
+char *
+isc_log_gettag(isc_logconfig_t *lcfg);
+/*%<
+ * Get the current identifier printed with #ISC_LOG_PRINTTAG.
+ *
+ * Requires:
+ *\li lcfg is a valid logging configuration.
+ *
+ * Notes:
+ *\li Since isc_log_settag() will not associate a zero-length string
+ * with the logging configuration, attempts to do so will cause
+ * this function to return NULL. However, a determined programmer
+ * will observe that (currently) a tag of length greater than zero
+ * could be set, and then modified to be zero length.
+ *
+ * Returns:
+ *\li A pointer to the current identifier, or NULL if none has been set.
+ */
+
+void
+isc_log_opensyslog(const char *tag, int options, int facility);
+/*%<
+ * Initialize syslog logging.
+ *
+ * Notes:
+ *\li XXXDCL NT
+ * This is currently equivalent to openlog(), but is not going to remain
+ * that way. In the meantime, the arguments are all identical to
+ * those used by openlog(3), as follows:
+ *
+ * \code
+ * tag: The string to use in the position of the program
+ * name in syslog messages. Most (all?) syslogs
+ * will use basename(argv[0]) if tag is NULL.
+ *
+ * options: LOG_CONS, LOG_PID, LOG_NDELAY ... whatever your
+ * syslog supports.
+ *
+ * facility: The default syslog facility. This is irrelevant
+ * since isc_log_write will ALWAYS use the channel's
+ * declared facility.
+ * \endcode
+ *
+ *\li Zero effort has been made (yet) to accommodate systems with openlog()
+ * that only takes two arguments, or to identify valid syslog
+ * facilities or options for any given architecture.
+ *
+ *\li It is necessary to call isc_log_opensyslog() to initialize
+ * syslogging on machines which do not support network connections to
+ * syslogd because they require a Unix domain socket to be used. Since
+ * this is a chore to determine at run-time, it is suggested that it
+ * always be called by programs using the ISC logging system.
+ *
+ * Requires:
+ *\li Nothing.
+ *
+ * Ensures:
+ *\li openlog() is called to initialize the syslog system.
+ */
+
+void
+isc_log_closefilelogs(isc_log_t *lctx);
+/*%<
+ * Close all open files used by #ISC_LOG_TOFILE channels.
+ *
+ * Notes:
+ *\li This function is provided for programs that want to use their own
+ * log rolling mechanism rather than the one provided internally.
+ * For example, a program that wanted to keep daily logs would define
+ * a channel which used #ISC_LOG_ROLLNEVER, then once a day would
+ * rename the log file and call isc_log_closefilelogs().
+ *
+ *\li #ISC_LOG_TOFILEDESC channels are unaffected.
+ *
+ * Requires:
+ *\li lctx is a valid context.
+ *
+ * Ensures:
+ *\li The open files are closed and will be reopened when they are
+ * next needed.
+ */
+
+isc_logcategory_t *
+isc_log_categorybyname(isc_log_t *lctx, const char *name);
+/*%<
+ * Find a category by its name.
+ *
+ * Notes:
+ *\li The string name of a category is not required to be unique.
+ *
+ * Requires:
+ *\li lctx is a valid context.
+ *\li name is not NULL.
+ *
+ * Returns:
+ *\li A pointer to the _first_ isc_logcategory_t structure used by "name".
+ *
+ *\li NULL if no category exists by that name.
+ */
+
+isc_logmodule_t *
+isc_log_modulebyname(isc_log_t *lctx, const char *name);
+/*%<
+ * Find a module by its name.
+ *
+ * Notes:
+ *\li The string name of a module is not required to be unique.
+ *
+ * Requires:
+ *\li lctx is a valid context.
+ *\li name is not NULL.
+ *
+ * Returns:
+ *\li A pointer to the _first_ isc_logmodule_t structure used by "name".
+ *
+ *\li NULL if no module exists by that name.
+ */
+
+void
+isc_log_setcontext(isc_log_t *lctx);
+/*%<
+ * Sets the context used by the libisc for logging.
+ *
+ * Requires:
+ *\li lctx be a valid context.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_LOG_H */
diff --git a/lib/isc/include/isc/magic.h b/lib/isc/include/isc/magic.h
new file mode 100644
index 0000000..073de90
--- /dev/null
+++ b/lib/isc/include/isc/magic.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: magic.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_MAGIC_H
+#define ISC_MAGIC_H 1
+
+/*! \file isc/magic.h */
+
+typedef struct {
+ unsigned int magic;
+} isc__magic_t;
+
+
+/*%
+ * To use this macro the magic number MUST be the first thing in the
+ * structure, and MUST be of type "unsigned int".
+ * The intent of this is to allow magic numbers to be checked even though
+ * the object is otherwise opaque.
+ */
+#define ISC_MAGIC_VALID(a,b) (((a) != NULL) && \
+ (((const isc__magic_t *)(a))->magic == (b)))
+
+#define ISC_MAGIC(a, b, c, d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
+
+#endif /* ISC_MAGIC_H */
diff --git a/lib/isc/include/isc/md5.h b/lib/isc/include/isc/md5.h
new file mode 100644
index 0000000..dfa586d
--- /dev/null
+++ b/lib/isc/include/isc/md5.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: md5.h,v 1.20 2010/01/07 23:48:54 tbox Exp $ */
+
+/*! \file isc/md5.h
+ * \brief This is the header file for the MD5 message-digest algorithm.
+ *
+ * The algorithm is due to Ron Rivest. This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ *
+ * Changed so as no longer to depend on Colin Plumb's `usual.h'
+ * header definitions; now uses stuff from dpkg's config.h
+ * - Ian Jackson <ijackson@nyx.cs.du.edu>.
+ * Still in the public domain.
+ */
+
+#ifndef ISC_MD5_H
+#define ISC_MD5_H 1
+
+#include <isc/lang.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#define ISC_MD5_DIGESTLENGTH 16U
+#define ISC_MD5_BLOCK_LENGTH 64U
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+#include <openssl/evp.h>
+
+typedef EVP_MD_CTX isc_md5_t;
+
+#else
+
+typedef struct {
+ isc_uint32_t buf[4];
+ isc_uint32_t bytes[2];
+ isc_uint32_t in[16];
+} isc_md5_t;
+#endif
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_md5_init(isc_md5_t *ctx);
+
+void
+isc_md5_invalidate(isc_md5_t *ctx);
+
+void
+isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len);
+
+void
+isc_md5_final(isc_md5_t *ctx, unsigned char *digest);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_MD5_H */
diff --git a/lib/isc/include/isc/mem.h b/lib/isc/include/isc/mem.h
new file mode 100644
index 0000000..5101ea3
--- /dev/null
+++ b/lib/isc/include/isc/mem.h
@@ -0,0 +1,750 @@
+/*
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_MEM_H
+#define ISC_MEM_H 1
+
+/*! \file isc/mem.h */
+
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+#include <isc/xml.h>
+
+ISC_LANG_BEGINDECLS
+
+#define ISC_MEM_LOWATER 0
+#define ISC_MEM_HIWATER 1
+typedef void (*isc_mem_water_t)(void *, int);
+
+typedef void * (*isc_memalloc_t)(void *, size_t);
+typedef void (*isc_memfree_t)(void *, void *);
+
+/*%
+ * Define ISC_MEM_DEBUG=1 to make all functions that free memory
+ * set the pointer being freed to NULL after being freed.
+ * This is the default; set ISC_MEM_DEBUG=0 to disable it.
+ */
+#ifndef ISC_MEM_DEBUG
+#define ISC_MEM_DEBUG 1
+#endif
+
+/*%
+ * Define ISC_MEM_TRACKLINES=1 to turn on detailed tracing of memory
+ * allocation and freeing by file and line number.
+ */
+#ifndef ISC_MEM_TRACKLINES
+#define ISC_MEM_TRACKLINES 1
+#endif
+
+/*%
+ * Define ISC_MEM_CHECKOVERRUN=1 to turn on checks for using memory outside
+ * the requested space. This will increase the size of each allocation.
+ */
+#ifndef ISC_MEM_CHECKOVERRUN
+#define ISC_MEM_CHECKOVERRUN 1
+#endif
+
+/*%
+ * Define ISC_MEM_FILL=1 to fill each block of memory returned to the system
+ * with the byte string '0xbe'. This helps track down uninitialized pointers
+ * and the like. On freeing memory, the space is filled with '0xde' for
+ * the same reasons.
+ */
+#ifndef ISC_MEM_FILL
+#define ISC_MEM_FILL 1
+#endif
+
+/*%
+ * Define ISC_MEMPOOL_NAMES=1 to make memory pools store a symbolic
+ * name so that the leaking pool can be more readily identified in
+ * case of a memory leak.
+ */
+#ifndef ISC_MEMPOOL_NAMES
+#define ISC_MEMPOOL_NAMES 1
+#endif
+
+LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging;
+/*@{*/
+#define ISC_MEM_DEBUGTRACE 0x00000001U
+#define ISC_MEM_DEBUGRECORD 0x00000002U
+#define ISC_MEM_DEBUGUSAGE 0x00000004U
+#define ISC_MEM_DEBUGSIZE 0x00000008U
+#define ISC_MEM_DEBUGCTX 0x00000010U
+#define ISC_MEM_DEBUGALL 0x0000001FU
+/*!<
+ * The variable isc_mem_debugging holds a set of flags for
+ * turning certain memory debugging options on or off at
+ * runtime. It is initialized to the value ISC_MEM_DEGBUGGING,
+ * which is 0 by default but may be overridden at compile time.
+ * The following flags can be specified:
+ *
+ * \li #ISC_MEM_DEBUGTRACE
+ * Log each allocation and free to isc_lctx.
+ *
+ * \li #ISC_MEM_DEBUGRECORD
+ * Remember each allocation, and match them up on free.
+ * Crash if a free doesn't match an allocation.
+ *
+ * \li #ISC_MEM_DEBUGUSAGE
+ * If a hi_water mark is set, print the maximum inuse memory
+ * every time it is raised once it exceeds the hi_water mark.
+ *
+ * \li #ISC_MEM_DEBUGSIZE
+ * Check the size argument being passed to isc_mem_put() matches
+ * that passed to isc_mem_get().
+ *
+ * \li #ISC_MEM_DEBUGCTX
+ * Check the mctx argument being passed to isc_mem_put() matches
+ * that passed to isc_mem_get().
+ */
+/*@}*/
+
+#if ISC_MEM_TRACKLINES
+#define _ISC_MEM_FILELINE , __FILE__, __LINE__
+#define _ISC_MEM_FLARG , const char *, unsigned int
+#else
+#define _ISC_MEM_FILELINE
+#define _ISC_MEM_FLARG
+#endif
+
+/*!
+ * Define ISC_MEM_USE_INTERNAL_MALLOC=1 to use the internal malloc()
+ * implementation in preference to the system one. The internal malloc()
+ * is very space-efficient, and quite fast on uniprocessor systems. It
+ * performs poorly on multiprocessor machines.
+ * JT: we can overcome the performance issue on multiprocessor machines
+ * by carefully separating memory contexts.
+ */
+
+#ifndef ISC_MEM_USE_INTERNAL_MALLOC
+#define ISC_MEM_USE_INTERNAL_MALLOC 1
+#endif
+
+/*
+ * Flags for isc_mem_create2()calls.
+ */
+#define ISC_MEMFLAG_NOLOCK 0x00000001 /* no lock is necessary */
+#define ISC_MEMFLAG_INTERNAL 0x00000002 /* use internal malloc */
+#if ISC_MEM_USE_INTERNAL_MALLOC
+#define ISC_MEMFLAG_DEFAULT ISC_MEMFLAG_INTERNAL
+#else
+#define ISC_MEMFLAG_DEFAULT 0
+#endif
+
+
+/*%<
+ * We use either isc___mem (three underscores) or isc__mem (two) depending on
+ * whether it's for BIND9's internal purpose (with -DBIND9) or generic export
+ * library. This condition is generally handled in isc/namespace.h, but for
+ * Windows it doesn't work if it involves multiple times of macro expansion
+ * (such as isc_mem to isc__mem then to isc___mem). The following definitions
+ * are used to work around this portability issue. Right now, we don't support
+ * the export library for Windows, so we always use the three-underscore
+ * version.
+ */
+#ifdef WIN32
+#define ISCMEMFUNC(sfx) isc___mem_ ## sfx
+#define ISCMEMPOOLFUNC(sfx) isc___mempool_ ## sfx
+#else
+#define ISCMEMFUNC(sfx) isc__mem_ ## sfx
+#define ISCMEMPOOLFUNC(sfx) isc__mempool_ ## sfx
+#endif
+
+#define isc_mem_get(c, s) ISCMEMFUNC(get)((c), (s) _ISC_MEM_FILELINE)
+#define isc_mem_allocate(c, s) ISCMEMFUNC(allocate)((c), (s) _ISC_MEM_FILELINE)
+#define isc_mem_reallocate(c, p, s) ISCMEMFUNC(reallocate)((c), (p), (s) _ISC_MEM_FILELINE)
+#define isc_mem_strdup(c, p) ISCMEMFUNC(strdup)((c), (p) _ISC_MEM_FILELINE)
+#define isc_mempool_get(c) ISCMEMPOOLFUNC(get)((c) _ISC_MEM_FILELINE)
+
+/*%
+ * isc_mem_putanddetach() is a convenience function for use where you
+ * have a structure with an attached memory context.
+ *
+ * Given:
+ *
+ * \code
+ * struct {
+ * ...
+ * isc_mem_t *mctx;
+ * ...
+ * } *ptr;
+ *
+ * isc_mem_t *mctx;
+ *
+ * isc_mem_putanddetach(&ptr->mctx, ptr, sizeof(*ptr));
+ * \endcode
+ *
+ * is the equivalent of:
+ *
+ * \code
+ * mctx = NULL;
+ * isc_mem_attach(ptr->mctx, &mctx);
+ * isc_mem_detach(&ptr->mctx);
+ * isc_mem_put(mctx, ptr, sizeof(*ptr));
+ * isc_mem_detach(&mctx);
+ * \endcode
+ */
+
+/*% memory and memory pool methods */
+typedef struct isc_memmethods {
+ void (*attach)(isc_mem_t *source, isc_mem_t **targetp);
+ void (*detach)(isc_mem_t **mctxp);
+ void (*destroy)(isc_mem_t **mctxp);
+ void *(*memget)(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG);
+ void (*memput)(isc_mem_t *mctx, void *ptr, size_t size _ISC_MEM_FLARG);
+ void (*memputanddetach)(isc_mem_t **mctxp, void *ptr,
+ size_t size _ISC_MEM_FLARG);
+ void *(*memallocate)(isc_mem_t *mctx, size_t size _ISC_MEM_FLARG);
+ void *(*memreallocate)(isc_mem_t *mctx, void *ptr,
+ size_t size _ISC_MEM_FLARG);
+ char *(*memstrdup)(isc_mem_t *mctx, const char *s _ISC_MEM_FLARG);
+ void (*memfree)(isc_mem_t *mctx, void *ptr _ISC_MEM_FLARG);
+ void (*setdestroycheck)(isc_mem_t *mctx, isc_boolean_t flag);
+ void (*setwater)(isc_mem_t *ctx, isc_mem_water_t water,
+ void *water_arg, size_t hiwater, size_t lowater);
+ void (*waterack)(isc_mem_t *ctx, int flag);
+ size_t (*inuse)(isc_mem_t *mctx);
+ isc_boolean_t (*isovermem)(isc_mem_t *mctx);
+ isc_result_t (*mpcreate)(isc_mem_t *mctx, size_t size,
+ isc_mempool_t **mpctxp);
+} isc_memmethods_t;
+
+typedef struct isc_mempoolmethods {
+ void (*destroy)(isc_mempool_t **mpctxp);
+ void *(*get)(isc_mempool_t *mpctx _ISC_MEM_FLARG);
+ void (*put)(isc_mempool_t *mpctx, void *mem _ISC_MEM_FLARG);
+ unsigned int (*getallocated)(isc_mempool_t *mpctx);
+ void (*setmaxalloc)(isc_mempool_t *mpctx, unsigned int limit);
+ void (*setfreemax)(isc_mempool_t *mpctx, unsigned int limit);
+ void (*setname)(isc_mempool_t *mpctx, const char *name);
+ void (*associatelock)(isc_mempool_t *mpctx, isc_mutex_t *lock);
+ void (*setfillcount)(isc_mempool_t *mpctx, unsigned int limit);
+} isc_mempoolmethods_t;
+
+/*%
+ * This structure is actually just the common prefix of a memory context
+ * implementation's version of an isc_mem_t.
+ * \brief
+ * Direct use of this structure by clients is forbidden. mctx implementations
+ * may change the structure. 'magic' must be ISCAPI_MCTX_MAGIC for any of the
+ * isc_mem_ routines to work. mctx implementations must maintain all mctx
+ * invariants.
+ */
+struct isc_mem {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_memmethods_t *methods;
+};
+
+#define ISCAPI_MCTX_MAGIC ISC_MAGIC('A','m','c','x')
+#define ISCAPI_MCTX_VALID(m) ((m) != NULL && \
+ (m)->magic == ISCAPI_MCTX_MAGIC)
+
+/*%
+ * This is the common prefix of a memory pool context. The same note as
+ * that for the mem structure applies.
+ */
+struct isc_mempool {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_mempoolmethods_t *methods;
+};
+
+#define ISCAPI_MPOOL_MAGIC ISC_MAGIC('A','m','p','l')
+#define ISCAPI_MPOOL_VALID(mp) ((mp) != NULL && \
+ (mp)->magic == ISCAPI_MPOOL_MAGIC)
+
+#if ISC_MEM_DEBUG
+#define isc_mem_put(c, p, s) \
+ do { \
+ ISCMEMFUNC(put)((c), (p), (s) _ISC_MEM_FILELINE); \
+ (p) = NULL; \
+ } while (0)
+#define isc_mem_putanddetach(c, p, s) \
+ do { \
+ ISCMEMFUNC(putanddetach)((c), (p), (s) _ISC_MEM_FILELINE); \
+ (p) = NULL; \
+ } while (0)
+#define isc_mem_free(c, p) \
+ do { \
+ ISCMEMFUNC(free)((c), (p) _ISC_MEM_FILELINE); \
+ (p) = NULL; \
+ } while (0)
+#define isc_mempool_put(c, p) \
+ do { \
+ ISCMEMPOOLFUNC(put)((c), (p) _ISC_MEM_FILELINE); \
+ (p) = NULL; \
+ } while (0)
+#else
+#define isc_mem_put(c, p, s) ISCMEMFUNC(put)((c), (p), (s) _ISC_MEM_FILELINE)
+#define isc_mem_putanddetach(c, p, s) \
+ ISCMEMFUNC(putanddetach)((c), (p), (s) _ISC_MEM_FILELINE)
+#define isc_mem_free(c, p) ISCMEMFUNC(free)((c), (p) _ISC_MEM_FILELINE)
+#define isc_mempool_put(c, p) ISCMEMPOOLFUNC(put)((c), (p) _ISC_MEM_FILELINE)
+#endif
+
+/*@{*/
+isc_result_t
+isc_mem_create(size_t max_size, size_t target_size,
+ isc_mem_t **mctxp);
+
+isc_result_t
+isc_mem_create2(size_t max_size, size_t target_size,
+ isc_mem_t **mctxp, unsigned int flags);
+
+isc_result_t
+isc_mem_createx(size_t max_size, size_t target_size,
+ isc_memalloc_t memalloc, isc_memfree_t memfree,
+ void *arg, isc_mem_t **mctxp);
+
+isc_result_t
+isc_mem_createx2(size_t max_size, size_t target_size,
+ isc_memalloc_t memalloc, isc_memfree_t memfree,
+ void *arg, isc_mem_t **mctxp, unsigned int flags);
+
+/*!<
+ * \brief Create a memory context.
+ *
+ * 'max_size' and 'target_size' are tuning parameters. When
+ * ISC_MEMFLAG_INTERNAL is set, allocations smaller than 'max_size'
+ * will be satisfied by getting blocks of size 'target_size' from the
+ * system allocator and breaking them up into pieces; larger allocations
+ * will use the system allocator directly. If 'max_size' and/or
+ * 'target_size' are zero, default values will be * used. When
+ * ISC_MEMFLAG_INTERNAL is not set, 'target_size' is ignored.
+ *
+ * 'max_size' is also used to size the statistics arrays and the array
+ * used to record active memory when ISC_MEM_DEBUGRECORD is set. Setting
+ * 'max_size' too low can have detrimental effects on performance.
+ *
+ * A memory context created using isc_mem_createx() will obtain
+ * memory from the system by calling 'memalloc' and 'memfree',
+ * passing them the argument 'arg'. A memory context created
+ * using isc_mem_create() will use the standard library malloc()
+ * and free().
+ *
+ * If ISC_MEMFLAG_NOLOCK is set in 'flags', the corresponding memory context
+ * will be accessed without locking. The user who creates the context must
+ * ensure there be no race. Since this can be a source of bug, it is generally
+ * inadvisable to use this flag unless the user is very sure about the race
+ * condition and the access to the object is highly performance sensitive.
+ *
+ * Requires:
+ * mctxp != NULL && *mctxp == NULL */
+/*@}*/
+
+/*@{*/
+void
+isc_mem_attach(isc_mem_t *, isc_mem_t **);
+void
+isc_mem_detach(isc_mem_t **);
+/*!<
+ * \brief Attach to / detach from a memory context.
+ *
+ * This is intended for applications that use multiple memory contexts
+ * in such a way that it is not obvious when the last allocations from
+ * a given context has been freed and destroying the context is safe.
+ *
+ * Most applications do not need to call these functions as they can
+ * simply create a single memory context at the beginning of main()
+ * and destroy it at the end of main(), thereby guaranteeing that it
+ * is not destroyed while there are outstanding allocations.
+ */
+/*@}*/
+
+void
+isc_mem_destroy(isc_mem_t **);
+/*%<
+ * Destroy a memory context.
+ */
+
+isc_result_t
+isc_mem_ondestroy(isc_mem_t *ctx,
+ isc_task_t *task,
+ isc_event_t **event);
+/*%<
+ * Request to be notified with an event when a memory context has
+ * been successfully destroyed.
+ */
+
+void
+isc_mem_stats(isc_mem_t *mctx, FILE *out);
+/*%<
+ * Print memory usage statistics for 'mctx' on the stream 'out'.
+ */
+
+void
+isc_mem_setdestroycheck(isc_mem_t *mctx,
+ isc_boolean_t on);
+/*%<
+ * If 'on' is ISC_TRUE, 'mctx' will check for memory leaks when
+ * destroyed and abort the program if any are present.
+ */
+
+/*@{*/
+void
+isc_mem_setquota(isc_mem_t *, size_t);
+size_t
+isc_mem_getquota(isc_mem_t *);
+/*%<
+ * Set/get the memory quota of 'mctx'. This is a hard limit
+ * on the amount of memory that may be allocated from mctx;
+ * if it is exceeded, allocations will fail.
+ */
+/*@}*/
+
+size_t
+isc_mem_inuse(isc_mem_t *mctx);
+/*%<
+ * Get an estimate of the number of memory in use in 'mctx', in bytes.
+ * This includes quantization overhead, but does not include memory
+ * allocated from the system but not yet used.
+ */
+
+isc_boolean_t
+isc_mem_isovermem(isc_mem_t *mctx);
+/*%<
+ * Return true iff the memory context is in "over memory" state, i.e.,
+ * a hiwater mark has been set and the used amount of memory has exceeds
+ * the mark.
+ */
+
+void
+isc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg,
+ size_t hiwater, size_t lowater);
+/*%<
+ * Set high and low water marks for this memory context.
+ *
+ * When the memory usage of 'mctx' exceeds 'hiwater',
+ * '(water)(water_arg, #ISC_MEM_HIWATER)' will be called. 'water' needs to
+ * call isc_mem_waterack() with #ISC_MEM_HIWATER to acknowledge the state
+ * change. 'water' may be called multiple times.
+ *
+ * When the usage drops below 'lowater', 'water' will again be called, this
+ * time with #ISC_MEM_LOWATER. 'water' need to calls isc_mem_waterack() with
+ * #ISC_MEM_LOWATER to acknowledge the change.
+ *
+ * static void
+ * water(void *arg, int mark) {
+ * struct foo *foo = arg;
+ *
+ * LOCK(&foo->marklock);
+ * if (foo->mark != mark) {
+ * foo->mark = mark;
+ * ....
+ * isc_mem_waterack(foo->mctx, mark);
+ * }
+ * UNLOCK(&foo->marklock);
+ * }
+ *
+ * If 'water' is NULL then 'water_arg', 'hi_water' and 'lo_water' are
+ * ignored and the state is reset.
+ *
+ * Requires:
+ *
+ * 'water' is not NULL.
+ * hi_water >= lo_water
+ */
+
+void
+isc_mem_waterack(isc_mem_t *ctx, int mark);
+/*%<
+ * Called to acknowledge changes in signaled by calls to 'water'.
+ */
+
+void
+isc_mem_printactive(isc_mem_t *mctx, FILE *file);
+/*%<
+ * Print to 'file' all active memory in 'mctx'.
+ *
+ * Requires ISC_MEM_DEBUGRECORD to have been set.
+ */
+
+void
+isc_mem_printallactive(FILE *file);
+/*%<
+ * Print to 'file' all active memory in all contexts.
+ *
+ * Requires ISC_MEM_DEBUGRECORD to have been set.
+ */
+
+void
+isc_mem_checkdestroyed(FILE *file);
+/*%<
+ * Check that all memory contexts have been destroyed.
+ * Prints out those that have not been.
+ * Fatally fails if there are still active contexts.
+ */
+
+unsigned int
+isc_mem_references(isc_mem_t *ctx);
+/*%<
+ * Return the current reference count.
+ */
+
+void
+isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag);
+/*%<
+ * Name 'ctx'.
+ *
+ * Notes:
+ *
+ *\li Only the first 15 characters of 'name' will be copied.
+ *
+ *\li 'tag' is for debugging purposes only.
+ *
+ * Requires:
+ *
+ *\li 'ctx' is a valid ctx.
+ */
+
+const char *
+isc_mem_getname(isc_mem_t *ctx);
+/*%<
+ * Get the name of 'ctx', as previously set using isc_mem_setname().
+ *
+ * Requires:
+ *\li 'ctx' is a valid ctx.
+ *
+ * Returns:
+ *\li A non-NULL pointer to a null-terminated string.
+ * If the ctx has not been named, the string is
+ * empty.
+ */
+
+void *
+isc_mem_gettag(isc_mem_t *ctx);
+/*%<
+ * Get the tag value for 'task', as previously set using isc_mem_setname().
+ *
+ * Requires:
+ *\li 'ctx' is a valid ctx.
+ *
+ * Notes:
+ *\li This function is for debugging purposes only.
+ *
+ * Requires:
+ *\li 'ctx' is a valid task.
+ */
+
+#ifdef HAVE_LIBXML2
+void
+isc_mem_renderxml(xmlTextWriterPtr writer);
+/*%<
+ * Render all contexts' statistics and status in XML for writer.
+ */
+#endif /* HAVE_LIBXML2 */
+
+/*
+ * Memory pools
+ */
+
+isc_result_t
+isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp);
+/*%<
+ * Create a memory pool.
+ *
+ * Requires:
+ *\li mctx is a valid memory context.
+ *\li size > 0
+ *\li mpctxp != NULL and *mpctxp == NULL
+ *
+ * Defaults:
+ *\li maxalloc = UINT_MAX
+ *\li freemax = 1
+ *\li fillcount = 1
+ *
+ * Returns:
+ *\li #ISC_R_NOMEMORY -- not enough memory to create pool
+ *\li #ISC_R_SUCCESS -- all is well.
+ */
+
+void
+isc_mempool_destroy(isc_mempool_t **mpctxp);
+/*%<
+ * Destroy a memory pool.
+ *
+ * Requires:
+ *\li mpctxp != NULL && *mpctxp is a valid pool.
+ *\li The pool has no un"put" allocations outstanding
+ */
+
+void
+isc_mempool_setname(isc_mempool_t *mpctx, const char *name);
+/*%<
+ * Associate a name with a memory pool. At most 15 characters may be used.
+ *
+ * Requires:
+ *\li mpctx is a valid pool.
+ *\li name != NULL;
+ */
+
+void
+isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock);
+/*%<
+ * Associate a lock with this memory pool.
+ *
+ * This lock is used when getting or putting items using this memory pool,
+ * and it is also used to set or get internal state via the isc_mempool_get*()
+ * and isc_mempool_set*() set of functions.
+ *
+ * Multiple pools can each share a single lock. For instance, if "manager"
+ * type object contained pools for various sizes of events, and each of
+ * these pools used a common lock. Note that this lock must NEVER be used
+ * by other than mempool routines once it is given to a pool, since that can
+ * easily cause double locking.
+ *
+ * Requires:
+ *
+ *\li mpctpx is a valid pool.
+ *
+ *\li lock != NULL.
+ *
+ *\li No previous lock is assigned to this pool.
+ *
+ *\li The lock is initialized before calling this function via the normal
+ * means of doing that.
+ */
+
+/*
+ * The following functions get/set various parameters. Note that due to
+ * the unlocked nature of pools these are potentially random values unless
+ * the imposed externally provided locking protocols are followed.
+ *
+ * Also note that the quota limits will not always take immediate effect.
+ * For instance, setting "maxalloc" to a number smaller than the currently
+ * allocated count is permitted. New allocations will be refused until
+ * the count drops below this threshold.
+ *
+ * All functions require (in addition to other requirements):
+ * mpctx is a valid memory pool
+ */
+
+unsigned int
+isc_mempool_getfreemax(isc_mempool_t *mpctx);
+/*%<
+ * Returns the maximum allowed size of the free list.
+ */
+
+void
+isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit);
+/*%<
+ * Sets the maximum allowed size of the free list.
+ */
+
+unsigned int
+isc_mempool_getfreecount(isc_mempool_t *mpctx);
+/*%<
+ * Returns current size of the free list.
+ */
+
+unsigned int
+isc_mempool_getmaxalloc(isc_mempool_t *mpctx);
+/*!<
+ * Returns the maximum allowed number of allocations.
+ */
+
+void
+isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit);
+/*%<
+ * Sets the maximum allowed number of allocations.
+ *
+ * Additional requirements:
+ *\li limit > 0
+ */
+
+unsigned int
+isc_mempool_getallocated(isc_mempool_t *mpctx);
+/*%<
+ * Returns the number of items allocated from this pool.
+ */
+
+unsigned int
+isc_mempool_getfillcount(isc_mempool_t *mpctx);
+/*%<
+ * Returns the number of items allocated as a block from the parent memory
+ * context when the free list is empty.
+ */
+
+void
+isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit);
+/*%<
+ * Sets the fillcount.
+ *
+ * Additional requirements:
+ *\li limit > 0
+ */
+
+
+/*
+ * Pseudo-private functions for use via macros. Do not call directly.
+ */
+void *
+ISCMEMFUNC(get)(isc_mem_t *, size_t _ISC_MEM_FLARG);
+void
+ISCMEMFUNC(putanddetach)(isc_mem_t **, void *, size_t _ISC_MEM_FLARG);
+void
+ISCMEMFUNC(put)(isc_mem_t *, void *, size_t _ISC_MEM_FLARG);
+void *
+ISCMEMFUNC(allocate)(isc_mem_t *, size_t _ISC_MEM_FLARG);
+void *
+ISCMEMFUNC(reallocate)(isc_mem_t *, void *, size_t _ISC_MEM_FLARG);
+void
+ISCMEMFUNC(free)(isc_mem_t *, void * _ISC_MEM_FLARG);
+char *
+ISCMEMFUNC(strdup)(isc_mem_t *, const char *_ISC_MEM_FLARG);
+void *
+ISCMEMPOOLFUNC(get)(isc_mempool_t * _ISC_MEM_FLARG);
+void
+ISCMEMPOOLFUNC(put)(isc_mempool_t *, void * _ISC_MEM_FLARG);
+
+#ifdef USE_MEMIMPREGISTER
+
+/*%<
+ * See isc_mem_create2() above.
+ */
+typedef isc_result_t
+(*isc_memcreatefunc_t)(size_t init_max_size, size_t target_size,
+ isc_mem_t **ctxp, unsigned int flags);
+
+isc_result_t
+isc_mem_register(isc_memcreatefunc_t createfunc);
+/*%<
+ * Register a new memory management implementation and add it to the list of
+ * supported implementations. This function must be called when a different
+ * memory management library is used than the one contained in the ISC library.
+ */
+
+isc_result_t
+isc__mem_register(void);
+/*%<
+ * A short cut function that specifies the memory management module in the ISC
+ * library for isc_mem_register(). An application that uses the ISC library
+ * usually do not have to care about this function: it would call
+ * isc_lib_register(), which internally calls this function.
+ */
+#endif /* USE_MEMIMPREGISTER */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_MEM_H */
diff --git a/lib/isc/include/isc/msgcat.h b/lib/isc/include/isc/msgcat.h
new file mode 100644
index 0000000..fe3d336
--- /dev/null
+++ b/lib/isc/include/isc/msgcat.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: msgcat.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_MSGCAT_H
+#define ISC_MSGCAT_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/msgcat.h
+ * \brief The ISC Message Catalog
+ * aids internationalization of applications by allowing
+ * messages to be retrieved from locale-specific files instead of
+ * hardwiring them into the application. This allows translations of
+ * messages appropriate to the locale to be supplied without recompiling
+ * the application.
+ *
+ * Notes:
+ *\li It's very important that message catalogs work, even if only the
+ * default_text can be used.
+ *
+ * MP:
+ *\li The caller must ensure appropriate synchronization of
+ * isc_msgcat_open() and isc_msgcat_close(). isc_msgcat_get()
+ * ensures appropriate synchronization.
+ *
+ * Reliability:
+ *\li No anticipated impact.
+ *
+ * Resources:
+ *\li TBS
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/*****
+ ***** Imports
+ *****/
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/*****
+ ***** Methods
+ *****/
+
+void
+isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp);
+/*%<
+ * Open a message catalog.
+ *
+ * Notes:
+ *
+ *\li If memory cannot be allocated or other failures occur, *msgcatp
+ * will be set to NULL. If a NULL msgcat is given to isc_msgcat_get(),
+ * the default_text will be returned, ensuring that some message text
+ * will be available, no matter what's going wrong.
+ *
+ * Requires:
+ *
+ *\li 'name' is a valid string.
+ *
+ *\li msgcatp != NULL && *msgcatp == NULL
+ */
+
+void
+isc_msgcat_close(isc_msgcat_t **msgcatp);
+/*%<
+ * Close a message catalog.
+ *
+ * Notes:
+ *
+ *\li Any string pointers returned by prior calls to isc_msgcat_get() are
+ * invalid after isc_msgcat_close() has been called and must not be
+ * used.
+ *
+ * Requires:
+ *
+ *\li *msgcatp is a valid message catalog or is NULL.
+ *
+ * Ensures:
+ *
+ *\li All resources associated with the message catalog are released.
+ *
+ *\li *msgcatp == NULL
+ */
+
+const char *
+isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
+ const char *default_text);
+/*%<
+ * Get message 'message' from message set 'set' in 'msgcat'. If it
+ * is not available, use 'default_text'.
+ *
+ * Requires:
+ *
+ *\li 'msgcat' is a valid message catalog or is NULL.
+ *
+ *\li set > 0
+ *
+ *\li message > 0
+ *
+ *\li 'default_text' is a valid string.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_MSGCAT_H */
diff --git a/lib/isc/include/isc/msgs.h b/lib/isc/include/isc/msgs.h
new file mode 100644
index 0000000..60c5c7c
--- /dev/null
+++ b/lib/isc/include/isc/msgs.h
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: msgs.h,v 1.19 2009/10/01 23:48:08 tbox Exp $ */
+
+#ifndef ISC_MSGS_H
+#define ISC_MSGS_H 1
+
+/*! \file isc/msgs.h */
+
+#include <isc/lib.h> /* Provide isc_msgcat global variable. */
+#include <isc/msgcat.h> /* Provide isc_msgcat_*() functions. */
+
+/*@{*/
+/*!
+ * \brief Message sets, named per source file, excepting "GENERAL".
+ *
+ * IMPORTANT: The original list is alphabetical, but any new sets must
+ * be added to the end.
+ */
+#define ISC_MSGSET_GENERAL 1
+/* ISC_RESULT_RESULTSET 2 */ /* XXX */
+/* ISC_RESULT_UNAVAILABLESET 3 */ /* XXX */
+#define ISC_MSGSET_APP 4
+#define ISC_MSGSET_COMMANDLINE 5
+#define ISC_MSGSET_ENTROPY 6
+#define ISC_MSGSET_IFITERIOCTL 7
+#define ISC_MSGSET_IFITERSYSCTL 8
+#define ISC_MSGSET_LEX 9
+#define ISC_MSGSET_LOG 10
+#define ISC_MSGSET_MEM 11
+#define ISC_MSGSET_NETADDR 12
+#define ISC_MSGSET_PRINT 13
+#define ISC_MSGSET_RESULT 14
+#define ISC_MSGSET_RWLOCK 15
+#define ISC_MSGSET_SOCKADDR 16
+#define ISC_MSGSET_SOCKET 17
+#define ISC_MSGSET_TASK 18
+#define ISC_MSGSET_TIMER 19
+#define ISC_MSGSET_UTIL 20
+#define ISC_MSGSET_IFITERGETIFADDRS 21
+/*@}*/
+
+/*@{*/
+/*!
+ * Message numbers
+ * are only required to be unique per message set,
+ * but are unique throughout the entire catalog to not be as confusing when
+ * debugging.
+ *
+ * The initial numbering was done by multiply by 100 the set number the
+ * message appears in then adding the incremental message number.
+ */
+#define ISC_MSG_FAILED 101 /*%< "failed" */
+#define ISC_MSG_SUCCEEDED 102 /*%< Compatible with "failed" */
+#define ISC_MSG_SUCCESS 103 /*%< More usual way to say "success" */
+#define ISC_MSG_STARTING 104 /*%< As in "daemon: starting" */
+#define ISC_MSG_STOPING 105 /*%< As in "daemon: stopping" */
+#define ISC_MSG_ENTERING 106 /*%< As in "some_subr: entering" */
+#define ISC_MSG_EXITING 107 /*%< As in "some_subr: exiting" */
+#define ISC_MSG_CALLING 108 /*%< As in "calling some_subr()" */
+#define ISC_MSG_RETURNED 109 /*%< As in "some_subr: returned <foo>" */
+#define ISC_MSG_FATALERROR 110 /*%< "fatal error" */
+#define ISC_MSG_SHUTTINGDOWN 111 /*%< "shutting down" */
+#define ISC_MSG_RUNNING 112 /*%< "running" */
+#define ISC_MSG_WAIT 113 /*%< "wait" */
+#define ISC_MSG_WAITUNTIL 114 /*%< "waituntil" */
+
+#define ISC_MSG_SIGNALSETUP 201 /*%< "handle_signal() %d setup: %s" */
+
+#define ISC_MSG_ILLEGALOPT 301 /*%< "illegal option" */
+#define ISC_MSG_OPTNEEDARG 302 /*%< "option requires an argument" */
+
+#define ISC_MSG_ENTROPYSTATS 401 /*%< "Entropy pool %p: refcnt %u ..." */
+
+#define ISC_MSG_MAKESCANSOCKET 501 /*%< "making interface scan socket: %s" */
+#define ISC_MSG_GETIFCONFIG 502 /*%< "get interface configuration: %s" */
+#define ISC_MSG_BUFFERMAX 503 /*%< "... maximum buffer size exceeded" */
+#define ISC_MSG_GETDESTADDR 504 /*%< "%s: getting destination address: %s" */
+#define ISC_MSG_GETNETMASK 505 /*%< "%s: getting netmask: %s" */
+#define ISC_MSG_GETBCSTADDR 506 /*%< "%s: getting broadcast address: %s" */
+
+#define ISC_MSG_GETIFLISTSIZE 601 /*%< "getting interface list size: ..." */
+#define ISC_MSG_GETIFLIST 602 /*%< "getting interface list: ..." */
+#define ISC_MSG_UNEXPECTEDTYPE 603 /*%< "... unexpected ... message type" */
+
+#define ISC_MSG_UNEXPECTEDSTATE 701 /*%< "Unexpected state %d" */
+
+#define ISC_MSG_BADTIME 801 /*%< "Bad 00 99:99:99.999 " */
+#define ISC_MSG_LEVEL 802 /*%< "level %d: " */
+
+#define ISC_MSG_ADDTRACE 901 /*%< "add %p size %u " */
+#define ISC_MSG_DELTRACE 902 /*%< "del %p size %u " */
+#define ISC_MSG_POOLSTATS 903 /*%< "[Pool statistics]\n" */
+#define ISC_MSG_POOLNAME 904 /*%< "name" */
+#define ISC_MSG_POOLSIZE 905 /*%< "size" */
+#define ISC_MSG_POOLMAXALLOC 906 /*%< "maxalloc" */
+#define ISC_MSG_POOLALLOCATED 907 /*%< "allocated" */
+#define ISC_MSG_POOLFREECOUNT 908 /*%< "freecount" */
+#define ISC_MSG_POOLFREEMAX 909 /*%< "freemax" */
+#define ISC_MSG_POOLFILLCOUNT 910 /*%< "fillcount" */
+#define ISC_MSG_POOLGETS 911 /*%< "gets" */
+#define ISC_MSG_DUMPALLOC 912 /*%< "DUMP OF ALL OUTSTANDING MEMORY ..." */
+#define ISC_MSG_NONE 913 /*%< "\tNone.\n" */
+#define ISC_MSG_PTRFILELINE 914 /*%< "\tptr %p file %s line %u\n" */
+
+#define ISC_MSG_UNKNOWNADDR 1001 /*%< "<unknown address, family %u>" */
+
+#define ISC_MSG_NOLONGDBL 1104 /*%< "long doubles are not supported" */
+
+#define ISC_MSG_PRINTLOCK 1201 /*%< "rwlock %p thread %lu ..." */
+#define ISC_MSG_READ 1202 /*%< "read" */
+#define ISC_MSG_WRITE 1203 /*%< "write" */
+#define ISC_MSG_READING 1204 /*%< "reading" */
+#define ISC_MSG_WRITING 1205 /*%< "writing" */
+#define ISC_MSG_PRELOCK 1206 /*%< "prelock" */
+#define ISC_MSG_POSTLOCK 1207 /*%< "postlock" */
+#define ISC_MSG_PREUNLOCK 1208 /*%< "preunlock" */
+#define ISC_MSG_POSTUNLOCK 1209 /*%< "postunlock" */
+
+#define ISC_MSG_UNKNOWNFAMILY 1301 /*%< "unknown address family: %d" */
+
+#define ISC_MSG_WRITEFAILED 1401 /*%< "write() failed during watcher ..." */
+#define ISC_MSG_READFAILED 1402 /*%< "read() failed during watcher ... " */
+#define ISC_MSG_PROCESSCMSG 1403 /*%< "processing cmsg %p" */
+#define ISC_MSG_IFRECEIVED 1404 /*%< "interface received on ifindex %u" */
+#define ISC_MSG_SENDTODATA 1405 /*%< "sendto pktinfo data, ifindex %u" */
+#define ISC_MSG_DOIORECV 1406 /*%< "doio_recv: recvmsg(%d) %d bytes ..." */
+#define ISC_MSG_PKTRECV 1407 /*%< "packet received correctly" */
+#define ISC_MSG_DESTROYING 1408 /*%< "destroying" */
+#define ISC_MSG_CREATED 1409 /*%< "created" */
+#define ISC_MSG_ACCEPTLOCK 1410 /*%< "internal_accept called, locked ..." */
+#define ISC_MSG_ACCEPTEDCXN 1411 /*%< "accepted connection, new socket %p" */
+#define ISC_MSG_INTERNALRECV 1412 /*%< "internal_recv: task %p got event %p" */
+#define ISC_MSG_INTERNALSEND 1413 /*%< "internal_send: task %p got event %p" */
+#define ISC_MSG_WATCHERMSG 1414 /*%< "watcher got message %d" */
+#define ISC_MSG_SOCKETSREMAIN 1415 /*%< "sockets exist" */
+#define ISC_MSG_PKTINFOPROVIDED 1416 /*%< "pktinfo structure provided, ..." */
+#define ISC_MSG_BOUND 1417 /*%< "bound" */
+#define ISC_MSG_ACCEPTRETURNED 1418 /*%< accept() returned %d/%s */
+#define ISC_MSG_TOOMANYFDS 1419 /*%< %s: too many open file descriptors */
+#define ISC_MSG_ZEROPORT 1420 /*%< dropping source port zero packet */
+#define ISC_MSG_FILTER 1421 /*%< setsockopt(SO_ACCEPTFILTER): %s */
+
+#define ISC_MSG_TOOMANYHANDLES 1422 /*%< %s: too many open WSA event handles: %s */
+#define ISC_MSG_POKED 1423 /*%< "poked flags: %d" */
+
+#define ISC_MSG_AWAKE 1502 /*%< "awake" */
+#define ISC_MSG_WORKING 1503 /*%< "working" */
+#define ISC_MSG_EXECUTE 1504 /*%< "execute action" */
+#define ISC_MSG_EMPTY 1505 /*%< "empty" */
+#define ISC_MSG_DONE 1506 /*%< "done" */
+#define ISC_MSG_QUANTUM 1507 /*%< "quantum" */
+
+#define ISC_MSG_SCHEDULE 1601 /*%< "schedule" */
+#define ISC_MSG_SIGNALSCHED 1602 /*%< "signal (schedule)" */
+#define ISC_MSG_SIGNALDESCHED 1603 /*%< "signal (deschedule)" */
+#define ISC_MSG_SIGNALDESTROY 1604 /*%< "signal (destroy)" */
+#define ISC_MSG_IDLERESCHED 1605 /*%< "idle reschedule" */
+#define ISC_MSG_EVENTNOTALLOC 1606 /*%< "couldn't allocate event" */
+#define ISC_MSG_SCHEDFAIL 1607 /*%< "couldn't schedule timer: %u" */
+#define ISC_MSG_POSTING 1608 /*%< "posting" */
+#define ISC_MSG_WAKEUP 1609 /*%< "wakeup" */
+
+#define ISC_MSG_LOCK 1701 /*%< "LOCK" */
+#define ISC_MSG_LOCKING 1702 /*%< "LOCKING" */
+#define ISC_MSG_LOCKED 1703 /*%< "LOCKED" */
+#define ISC_MSG_UNLOCKED 1704 /*%< "UNLOCKED" */
+#define ISC_MSG_RWLOCK 1705 /*%< "RWLOCK" */
+#define ISC_MSG_RWLOCKED 1706 /*%< "RWLOCKED" */
+#define ISC_MSG_RWUNLOCK 1707 /*%< "RWUNLOCK" */
+#define ISC_MSG_BROADCAST 1708 /*%< "BROADCAST" */
+#define ISC_MSG_SIGNAL 1709 /*%< "SIGNAL" */
+#define ISC_MSG_UTILWAIT 1710 /*%< "WAIT" */
+#define ISC_MSG_WAITED 1711 /*%< "WAITED" */
+
+#define ISC_MSG_GETIFADDRS 1801 /*%< "getting interface addresses: ..." */
+
+/*@}*/
+
+#endif /* ISC_MSGS_H */
diff --git a/lib/isc/include/isc/mutexblock.h b/lib/isc/include/isc/mutexblock.h
new file mode 100644
index 0000000..65bf2bf
--- /dev/null
+++ b/lib/isc/include/isc/mutexblock.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mutexblock.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_MUTEXBLOCK_H
+#define ISC_MUTEXBLOCK_H 1
+
+/*! \file isc/mutexblock.h */
+
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
+/*%<
+ * Initialize a block of locks. If an error occurs all initialized locks
+ * will be destroyed, if possible.
+ *
+ * Requires:
+ *
+ *\li block != NULL
+ *
+ *\li count > 0
+ *
+ * Returns:
+ *
+ *\li Any code isc_mutex_init() can return is a valid return for this
+ * function.
+ */
+
+isc_result_t
+isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
+/*%<
+ * Destroy a block of locks.
+ *
+ * Requires:
+ *
+ *\li block != NULL
+ *
+ *\li count > 0
+ *
+ *\li Each lock in the block be initialized via isc_mutex_init() or
+ * the whole block was initialized via isc_mutex_initblock().
+ *
+ * Returns:
+ *
+ *\li Any code isc_mutex_init() can return is a valid return for this
+ * function.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_MUTEXBLOCK_H */
diff --git a/lib/isc/include/isc/namespace.h b/lib/isc/include/isc/namespace.h
new file mode 100644
index 0000000..cd4ec9a
--- /dev/null
+++ b/lib/isc/include/isc/namespace.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISCAPI_NAMESPACE_H
+#define ISCAPI_NAMESPACE_H 1
+
+/*%
+ * name space conversions
+ */
+
+#ifdef BIND9
+
+#define isc_app_start isc__app_start
+#define isc_app_ctxstart isc__app_ctxstart
+#define isc_app_onrun isc__app_onrun
+#define isc_app_run isc__app_run
+#define isc_app_ctxrun isc__app_ctxrun
+#define isc_app_shutdown isc__app_shutdown
+#define isc_app_ctxfinish isc__app_ctxfinish
+#define isc_app_ctxshutdown isc__app_ctxshutdown
+#define isc_app_ctxsuspend isc__app_ctxsuspend
+#define isc_app_reload isc__app_reload
+#define isc_app_finish isc__app_finish
+#define isc_app_block isc__app_block
+#define isc_app_unblock isc__app_unblock
+#define isc_appctx_create isc__appctx_create
+#define isc_appctx_destroy isc__appctx_destroy
+#define isc_appctx_settaskmgr isc__appctx_settaskmgr
+#define isc_appctx_setsocketmgr isc__appctx_setsocketmgr
+#define isc_appctx_settimermgr isc__appctx_settimermgr
+
+#define isc_mem_checkdestroyed isc__mem_checkdestroyed
+#define isc_mem_createx isc__mem_createx
+#define isc_mem_createx2 isc__mem_createx2
+#define isc_mem_create isc__mem_create
+#define isc_mem_create2 isc__mem_create2
+#define isc_mem_attach isc__mem_attach
+#define isc_mem_detach isc__mem_detach
+#define isc__mem_putanddetach isc___mem_putanddetach
+#define isc_mem_destroy isc__mem_destroy
+#define isc_mem_ondestroy isc__mem_ondestroy
+#define isc__mem_get isc___mem_get
+#define isc__mem_put isc___mem_put
+#define isc_mem_stats isc__mem_stats
+#define isc__mem_allocate isc___mem_allocate
+#define isc__mem_free isc___mem_free
+#define isc__mem_strdup isc___mem_strdup
+#define isc__mem_reallocate isc___mem_reallocate
+#define isc_mem_references isc__mem_references
+#define isc_mem_setdestroycheck isc__mem_setdestroycheck
+#define isc_mem_setquota isc__mem_setquota
+#define isc_mem_getname isc__mem_getname
+#define isc_mem_getquota isc__mem_getquota
+#define isc_mem_gettag isc__mem_gettag
+#define isc_mem_inuse isc__mem_inuse
+#define isc_mem_isovermem isc__mem_isovermem
+#define isc_mem_setname isc__mem_setname
+#define isc_mem_setwater isc__mem_setwater
+#define isc_mem_printallactive isc__mem_printallactive
+#define isc_mem_waterack isc__mem_waterack
+#define isc_mempool_create isc__mempool_create
+#define isc_mempool_setname isc__mempool_setname
+#define isc_mempool_destroy isc__mempool_destroy
+#define isc_mempool_associatelock isc__mempool_associatelock
+#define isc__mempool_get isc___mempool_get
+#define isc__mempool_put isc___mempool_put
+#define isc_mempool_setfreemax isc__mempool_setfreemax
+#define isc_mempool_getfreemax isc__mempool_getfreemax
+#define isc_mempool_getfreecount isc__mempool_getfreecount
+#define isc_mempool_setmaxalloc isc__mempool_setmaxalloc
+#define isc_mempool_getmaxalloc isc__mempool_getmaxalloc
+#define isc_mempool_getallocated isc__mempool_getallocated
+#define isc_mempool_setfillcount isc__mempool_setfillcount
+#define isc_mempool_getfillcount isc__mempool_getfillcount
+
+#define isc_socket_create isc__socket_create
+#define isc_socket_dup isc__socket_dup
+#define isc_socket_attach isc__socket_attach
+#define isc_socket_detach isc__socket_detach
+#define isc_socketmgr_create isc__socketmgr_create
+#define isc_socketmgr_create2 isc__socketmgr_create2
+#define isc_socketmgr_destroy isc__socketmgr_destroy
+#define isc_socket_open isc__socket_open
+#define isc_socket_close isc__socket_close
+#define isc_socket_recvv isc__socket_recvv
+#define isc_socket_recv isc__socket_recv
+#define isc_socket_recv2 isc__socket_recv2
+#define isc_socket_send isc__socket_send
+#define isc_socket_sendto isc__socket_sendto
+#define isc_socket_sendv isc__socket_sendv
+#define isc_socket_sendtov isc__socket_sendtov
+#define isc_socket_sendto2 isc__socket_sendto2
+#define isc_socket_cleanunix isc__socket_cleanunix
+#define isc_socket_permunix isc__socket_permunix
+#define isc_socket_bind isc__socket_bind
+#define isc_socket_filter isc__socket_filter
+#define isc_socket_listen isc__socket_listen
+#define isc_socket_accept isc__socket_accept
+#define isc_socket_connect isc__socket_connect
+#define isc_socket_getfd isc__socket_getfd
+#define isc_socket_getname isc__socket_getname
+#define isc_socket_gettag isc__socket_gettag
+#define isc_socket_getpeername isc__socket_getpeername
+#define isc_socket_getsockname isc__socket_getsockname
+#define isc_socket_cancel isc__socket_cancel
+#define isc_socket_gettype isc__socket_gettype
+#define isc_socket_isbound isc__socket_isbound
+#define isc_socket_ipv6only isc__socket_ipv6only
+#define isc_socket_setname isc__socket_setname
+#define isc_socketmgr_getmaxsockets isc__socketmgr_getmaxsockets
+#define isc_socketmgr_setstats isc__socketmgr_setstats
+#define isc_socketmgr_setreserved isc__socketmgr_setreserved
+#define isc__socketmgr_maxudp isc___socketmgr_maxudp
+#define isc_socket_fdwatchcreate isc__socket_fdwatchcreate
+#define isc_socket_fdwatchpoke isc__socket_fdwatchpoke
+
+#define isc_task_create isc__task_create
+#define isc_task_attach isc__task_attach
+#define isc_task_detach isc__task_detach
+/* #define isc_task_exiting isc__task_exiting XXXMPA */
+#define isc_task_send isc__task_send
+#define isc_task_sendanddetach isc__task_sendanddetach
+#define isc_task_purgerange isc__task_purgerange
+#define isc_task_purge isc__task_purge
+#define isc_task_purgeevent isc__task_purgeevent
+#define isc_task_unsendrange isc__task_unsendrange
+#define isc_task_unsend isc__task_unsend
+#define isc_task_onshutdown isc__task_onshutdown
+#define isc_task_shutdown isc__task_shutdown
+#define isc_task_destroy isc__task_destroy
+#define isc_task_setname isc__task_setname
+#define isc_task_getname isc__task_getname
+#define isc_task_gettag isc__task_gettag
+#define isc_task_getcurrenttime isc__task_getcurrenttime
+#define isc_taskmgr_create isc__taskmgr_create
+#define isc_taskmgr_setmode isc__taskmgr_setmode
+#define isc_taskmgr_mode isc__taskmgr_mode
+#define isc_taskmgr_destroy isc__taskmgr_destroy
+#define isc_task_beginexclusive isc__task_beginexclusive
+#define isc_task_endexclusive isc__task_endexclusive
+#define isc_task_setprivilege isc__task_setprivilege
+#define isc_task_privilege isc__task_privilege
+
+#define isc_timer_create isc__timer_create
+#define isc_timer_reset isc__timer_reset
+#define isc_timer_gettype isc__timer_gettype
+#define isc_timer_touch isc__timer_touch
+#define isc_timer_attach isc__timer_attach
+#define isc_timer_detach isc__timer_detach
+#define isc_timermgr_create isc__timermgr_create
+#define isc_timermgr_poke isc__timermgr_poke
+#define isc_timermgr_destroy isc__timermgr_destroy
+
+#endif /* BIND9 */
+
+#endif /* ISCAPI_NAMESPACE_H */
diff --git a/lib/isc/include/isc/netaddr.h b/lib/isc/include/isc/netaddr.h
new file mode 100644
index 0000000..954d770
--- /dev/null
+++ b/lib/isc/include/isc/netaddr.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: netaddr.h,v 1.37 2009/01/17 23:47:43 tbox Exp $ */
+
+#ifndef ISC_NETADDR_H
+#define ISC_NETADDR_H 1
+
+/*! \file isc/netaddr.h */
+
+#include <isc/lang.h>
+#include <isc/net.h>
+#include <isc/types.h>
+
+#ifdef ISC_PLATFORM_HAVESYSUNH
+#include <sys/types.h>
+#include <sys/un.h>
+#endif
+
+ISC_LANG_BEGINDECLS
+
+struct isc_netaddr {
+ unsigned int family;
+ union {
+ struct in_addr in;
+ struct in6_addr in6;
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ char un[sizeof(((struct sockaddr_un *)0)->sun_path)];
+#endif
+ } type;
+ isc_uint32_t zone;
+};
+
+isc_boolean_t
+isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b);
+
+/*%<
+ * Compare network addresses 'a' and 'b'. Return #ISC_TRUE if
+ * they are equal, #ISC_FALSE if not.
+ */
+
+isc_boolean_t
+isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b,
+ unsigned int prefixlen);
+/*%<
+ * Compare the 'prefixlen' most significant bits of the network
+ * addresses 'a' and 'b'. If 'b''s scope is zero then 'a''s scope is
+ * ignored. Return #ISC_TRUE if they are equal, #ISC_FALSE if not.
+ */
+
+isc_result_t
+isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp);
+/*%<
+ * Convert a netmask in 's' into a prefix length in '*lenp'.
+ * The mask should consist of zero or more '1' bits in the most
+ * most significant part of the address, followed by '0' bits.
+ * If this is not the case, #ISC_R_MASKNONCONTIG is returned.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_MASKNONCONTIG
+ */
+
+isc_result_t
+isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target);
+/*%<
+ * Append a text representation of 'sockaddr' to the buffer 'target'.
+ * The text is NOT null terminated. Handles IPv4 and IPv6 addresses.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOSPACE The text or the null termination did not fit.
+ *\li #ISC_R_FAILURE Unspecified failure
+ */
+
+void
+isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size);
+/*%<
+ * Format a human-readable representation of the network address '*na'
+ * into the character array 'array', which is of size 'size'.
+ * The resulting string is guaranteed to be null-terminated.
+ */
+
+#define ISC_NETADDR_FORMATSIZE \
+ sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS")
+/*%<
+ * Minimum size of array to pass to isc_netaddr_format().
+ */
+
+void
+isc_netaddr_fromsockaddr(isc_netaddr_t *netaddr, const isc_sockaddr_t *source);
+
+void
+isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina);
+
+void
+isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6);
+
+isc_result_t
+isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path);
+
+void
+isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone);
+
+isc_uint32_t
+isc_netaddr_getzone(const isc_netaddr_t *netaddr);
+
+void
+isc_netaddr_any(isc_netaddr_t *netaddr);
+/*%<
+ * Return the IPv4 wildcard address.
+ */
+
+void
+isc_netaddr_any6(isc_netaddr_t *netaddr);
+/*%<
+ * Return the IPv6 wildcard address.
+ */
+
+isc_boolean_t
+isc_netaddr_ismulticast(isc_netaddr_t *na);
+/*%<
+ * Returns ISC_TRUE if the address is a multicast address.
+ */
+
+isc_boolean_t
+isc_netaddr_isexperimental(isc_netaddr_t *na);
+/*%<
+ * Returns ISC_TRUE if the address is a experimental (CLASS E) address.
+ */
+
+isc_boolean_t
+isc_netaddr_islinklocal(isc_netaddr_t *na);
+/*%<
+ * Returns #ISC_TRUE if the address is a link local address.
+ */
+
+isc_boolean_t
+isc_netaddr_issitelocal(isc_netaddr_t *na);
+/*%<
+ * Returns #ISC_TRUE if the address is a site local address.
+ */
+
+void
+isc_netaddr_fromv4mapped(isc_netaddr_t *t, const isc_netaddr_t *s);
+/*%<
+ * Convert an IPv6 v4mapped address into an IPv4 address.
+ */
+
+isc_result_t
+isc_netaddr_prefixok(const isc_netaddr_t *na, unsigned int prefixlen);
+/*
+ * Test whether the netaddr 'na' and 'prefixlen' are consistant.
+ * e.g. prefixlen within range.
+ * na does not have bits set which are not covered by the prefixlen.
+ *
+ * Returns:
+ * ISC_R_SUCCESS
+ * ISC_R_RANGE prefixlen out of range
+ * ISC_R_NOTIMPLEMENTED unsupported family
+ * ISC_R_FAILURE extra bits.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_NETADDR_H */
diff --git a/lib/isc/include/isc/netscope.h b/lib/isc/include/isc/netscope.h
new file mode 100644
index 0000000..163a08c
--- /dev/null
+++ b/lib/isc/include/isc/netscope.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: netscope.h,v 1.13 2009/06/25 23:48:02 tbox Exp $ */
+
+#ifndef ISC_NETSCOPE_H
+#define ISC_NETSCOPE_H 1
+
+/*! \file isc/netscope.h */
+
+ISC_LANG_BEGINDECLS
+
+/*%
+ * Convert a string of an IPv6 scope zone to zone index. If the conversion
+ * succeeds, 'zoneid' will store the index value.
+ *
+ * XXXJT: when a standard interface for this purpose is defined,
+ * we should use it.
+ *
+ * Returns:
+ * \li ISC_R_SUCCESS: conversion succeeds
+ * \li ISC_R_FAILURE: conversion fails
+ */
+isc_result_t
+isc_netscope_pton(int af, char *scopename, void *addr, isc_uint32_t *zoneid);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_NETSCOPE_H */
diff --git a/lib/isc/include/isc/ondestroy.h b/lib/isc/include/isc/ondestroy.h
new file mode 100644
index 0000000..64bd643
--- /dev/null
+++ b/lib/isc/include/isc/ondestroy.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ondestroy.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_ONDESTROY_H
+#define ISC_ONDESTROY_H 1
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/*! \file isc/ondestroy.h
+ * ondestroy handling.
+ *
+ * Any class ``X'' of objects that wants to send out notifications
+ * on its destruction should declare a field of type isc_ondestroy_t
+ * (call it 'ondest').
+ *
+ * \code
+ * typedef struct {
+ * ...
+ * isc_ondestroy_t ondest;
+ * ...
+ * } X;
+ * \endcode
+ *
+ * When an object ``A'' of type X is created
+ * it must initialize the field ondest with a call to
+ *
+ * \code
+ * isc_ondestroy_init(&A->ondest).
+ * \endcode
+ *
+ * X should also provide a registration function for third-party
+ * objects to call to register their interest in being told about
+ * the destruction of a particular instance of X.
+ *
+ * \code
+ * isc_result_t
+ * X_ondestroy(X *instance, isc_task_t *task,
+ * isc_event_t **eventp) {
+ * return(isc_ondestroy_register(&instance->ondest, task,eventp));
+ * }
+ * \endcode
+ *
+ * Note: locking of the ondestory structure embedded inside of X, is
+ * X's responsibility.
+ *
+ * When an instance of X is destroyed, a call to isc_ondestroy_notify()
+ * sends the notifications:
+ *
+ * \code
+ * X *instance;
+ * isc_ondestroy_t ondest = instance->ondest;
+ *
+ * ... completely cleanup 'instance' here...
+ *
+ * isc_ondestroy_notify(&ondest, instance);
+ * \endcode
+ *
+ *
+ * see lib/dns/zone.c for an ifdef'd-out example.
+ */
+
+struct isc_ondestroy {
+ unsigned int magic;
+ isc_eventlist_t events;
+};
+
+void
+isc_ondestroy_init(isc_ondestroy_t *ondest);
+/*%<
+ * Initialize the on ondest structure. *must* be called before first call
+ * to isc_ondestroy_register().
+ */
+
+isc_result_t
+isc_ondestroy_register(isc_ondestroy_t *ondest, isc_task_t *task,
+ isc_event_t **eventp);
+
+/*%<
+ * Stores task and *eventp away inside *ondest. Ownership of **event is
+ * taken from the caller (and *eventp is set to NULL). The task is attached
+ * to.
+ */
+
+void
+isc_ondestroy_notify(isc_ondestroy_t *ondest, void *sender);
+/*%<
+ * Dispatches the event(s) to the task(s) that were given in
+ * isc_ondestroy_register call(s) (done via calls to
+ * isc_task_sendanddetach()). Before dispatch, the sender value of each
+ * event structure is set to the value of the sender paramater. The
+ * internal structures of the ondest parameter are cleaned out, so no other
+ * cleanup is needed.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_ONDESTROY_H */
diff --git a/lib/isc/include/isc/os.h b/lib/isc/include/isc/os.h
new file mode 100644
index 0000000..3cf59e2
--- /dev/null
+++ b/lib/isc/include/isc/os.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: os.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_OS_H
+#define ISC_OS_H 1
+
+/*! \file isc/os.h */
+
+#include <isc/lang.h>
+
+ISC_LANG_BEGINDECLS
+
+unsigned int
+isc_os_ncpus(void);
+/*%<
+ * Return the number of CPUs available on the system, or 1 if this cannot
+ * be determined.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_OS_H */
diff --git a/lib/isc/include/isc/parseint.h b/lib/isc/include/isc/parseint.h
new file mode 100644
index 0000000..5047676
--- /dev/null
+++ b/lib/isc/include/isc/parseint.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001, 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: parseint.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_PARSEINT_H
+#define ISC_PARSEINT_H 1
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/*! \file isc/parseint.h
+ * \brief Parse integers, in a saner way than atoi() or strtoul() do.
+ */
+
+/***
+ *** Functions
+ ***/
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_parse_uint32(isc_uint32_t *uip, const char *string, int base);
+
+isc_result_t
+isc_parse_uint16(isc_uint16_t *uip, const char *string, int base);
+
+isc_result_t
+isc_parse_uint8(isc_uint8_t *uip, const char *string, int base);
+/*%<
+ * Parse the null-terminated string 'string' containing a base 'base'
+ * integer, storing the result in '*uip'.
+ * The base is interpreted
+ * as in strtoul(). Unlike strtoul(), leading whitespace, minus or
+ * plus signs are not accepted, and all errors (including overflow)
+ * are reported uniformly through the return value.
+ *
+ * Requires:
+ *\li 'string' points to a null-terminated string
+ *\li 0 <= 'base' <= 36
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_BADNUMBER The string is not numeric (in the given base)
+ *\li #ISC_R_RANGE The number is not representable as the requested type.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_PARSEINT_H */
diff --git a/lib/isc/include/isc/platform.h b/lib/isc/include/isc/platform.h
new file mode 100644
index 0000000..bd11a25
--- /dev/null
+++ b/lib/isc/include/isc/platform.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: platform.h.in,v 1.28 2001/11/19 03:08:26 mayer Exp $ */
+
+#ifndef ISC_PLATFORM_H
+#define ISC_PLATFORM_H 1
+
+
+#ifndef ISC_PLATFORM_USEDECLSPEC
+#define LIBISC_EXTERNAL_DATA
+#define LIBDNS_EXTERNAL_DATA
+#define LIBISCCC_EXTERNAL_DATA
+#define LIBISCCFG_EXTERNAL_DATA
+#define LIBBIND9_EXTERNAL_DATA
+#endif /* ISC_PLATFORM_USEDECLSPEC */
+
+/*
+ * Tell emacs to use C mode for this file.
+ *
+ * Local Variables:
+ * mode: c
+ * End:
+ */
+
+#endif /* ISC_PLATFORM_H */
diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in
new file mode 100644
index 0000000..03c2710
--- /dev/null
+++ b/lib/isc/include/isc/platform.h.in
@@ -0,0 +1,367 @@
+/*
+ * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: platform.h.in,v 1.56 2010/12/18 01:56:23 each Exp $ */
+
+#ifndef ISC_PLATFORM_H
+#define ISC_PLATFORM_H 1
+
+/*! \file */
+
+/*****
+ ***** Platform-dependent defines.
+ *****/
+
+/***
+ *** Network.
+ ***/
+
+/*! \brief
+ * Define if this system needs the <netinet/in6.h> header file included
+ * for full IPv6 support (pretty much only UnixWare).
+ */
+@ISC_PLATFORM_NEEDNETINETIN6H@
+
+/*! \brief
+ * Define if this system needs the <netinet6/in6.h> header file included
+ * to support in6_pkinfo (pretty much only BSD/OS).
+ */
+@ISC_PLATFORM_NEEDNETINET6IN6H@
+
+/*! \brief
+ * If sockaddrs on this system have an sa_len field, ISC_PLATFORM_HAVESALEN
+ * will be defined.
+ */
+@ISC_PLATFORM_HAVESALEN@
+
+/*! \brief
+ * If this system has the IPv6 structure definitions, ISC_PLATFORM_HAVEIPV6
+ * will be defined.
+ */
+@ISC_PLATFORM_HAVEIPV6@
+
+/*! \brief
+ * If this system is missing in6addr_any, ISC_PLATFORM_NEEDIN6ADDRANY will
+ * be defined.
+ */
+@ISC_PLATFORM_NEEDIN6ADDRANY@
+
+/*! \brief
+ * If this system is missing in6addr_loopback, ISC_PLATFORM_NEEDIN6ADDRLOOPBACK
+ * will be defined.
+ */
+@ISC_PLATFORM_NEEDIN6ADDRLOOPBACK@
+
+/*! \brief
+ * If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be
+ * defined.
+ */
+@ISC_PLATFORM_HAVEIN6PKTINFO@
+
+/*! \brief
+ * If this system has in_addr6, rather than in6_addr, ISC_PLATFORM_HAVEINADDR6
+ * will be defined.
+ */
+@ISC_PLATFORM_HAVEINADDR6@
+
+/*! \brief
+ * If this system has sin6_scope_id, ISC_PLATFORM_HAVESCOPEID will be defined.
+ */
+@ISC_PLATFORM_HAVESCOPEID@
+
+/*! \brief
+ * If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined.
+ */
+@ISC_PLATFORM_NEEDNTOP@
+
+/*! \brief
+ * If this system needs inet_pton(), ISC_PLATFORM_NEEDPTON will be defined.
+ */
+@ISC_PLATFORM_NEEDPTON@
+
+/*! \brief
+ * If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined.
+ */
+@ISC_PLATFORM_NEEDPORTT@
+
+/*! \brief
+ * Define if the system has struct lifconf which is a extended struct ifconf
+ * for IPv6.
+ */
+@ISC_PLATFORM_HAVELIFCONF@
+
+/*! \brief
+ * Define if the system has struct if_laddrconf which is a extended struct
+ * ifconf for IPv6.
+ */
+@ISC_PLATFORM_HAVEIF_LADDRCONF@
+
+/*! \brief
+ * Define if the system has struct if_laddrreq.
+ */
+@ISC_PLATFORM_HAVEIF_LADDRREQ@
+
+/*! \brief
+ * Define either ISC_PLATFORM_BSD44MSGHDR or ISC_PLATFORM_BSD43MSGHDR.
+ */
+@ISC_PLATFORM_MSGHDRFLAVOR@
+
+/*! \brief
+ * Define if the system supports if_nametoindex.
+ */
+@ISC_PLATFORM_HAVEIFNAMETOINDEX@
+
+/*! \brief
+ * Define on some UnixWare systems to fix erroneous definitions of various
+ * IN6_IS_ADDR_* macros.
+ */
+@ISC_PLATFORM_FIXIN6ISADDR@
+
+/*! \brief
+ * Define if the system supports kqueue multiplexing
+ */
+@ISC_PLATFORM_HAVEKQUEUE@
+
+/*! \brief
+ * Define if the system supports epoll multiplexing
+ */
+@ISC_PLATFORM_HAVEEPOLL@
+
+/*! \brief
+ * Define if the system supports /dev/poll multiplexing
+ */
+@ISC_PLATFORM_HAVEDEVPOLL@
+
+/*! \brief
+ * Define if we want to log backtrace
+ */
+@ISC_PLATFORM_USEBACKTRACE@
+
+/*
+ *** Printing.
+ ***/
+
+/*! \brief
+ * If this system needs vsnprintf() and snprintf(), ISC_PLATFORM_NEEDVSNPRINTF
+ * will be defined.
+ */
+@ISC_PLATFORM_NEEDVSNPRINTF@
+
+/*! \brief
+ * If this system need a modern sprintf() that returns (int) not (char*).
+ */
+@ISC_PLATFORM_NEEDSPRINTF@
+
+/*! \brief
+ * The printf format string modifier to use with isc_uint64_t values.
+ */
+@ISC_PLATFORM_QUADFORMAT@
+
+/***
+ *** String functions.
+ ***/
+/*
+ * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined.
+ */
+@ISC_PLATFORM_NEEDSTRSEP@
+
+/*
+ * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
+ */
+@ISC_PLATFORM_NEEDSTRLCPY@
+
+/*
+ * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined.
+ */
+@ISC_PLATFORM_NEEDSTRLCAT@
+
+/*
+ * Define if this system needs strtoul.
+ */
+@ISC_PLATFORM_NEEDSTRTOUL@
+
+/*
+ * Define if this system needs memmove.
+ */
+@ISC_PLATFORM_NEEDMEMMOVE@
+
+/***
+ *** Miscellaneous.
+ ***/
+
+/*
+ * Defined if we are using threads.
+ */
+@ISC_PLATFORM_USETHREADS@
+
+/*
+ * Defined if unistd.h does not cause fd_set to be delared.
+ */
+@ISC_PLATFORM_NEEDSYSSELECTH@
+
+/*
+ * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include
+ * the GSSAPI header.
+ */
+@ISC_PLATFORM_GSSAPIHEADER@
+
+/*
+ * Defined to <gssapi_krb5.h> or <gssapi/gssapi_krb5.h> for how to
+ * include the GSSAPI KRB5 header.
+ */
+@ISC_PLATFORM_GSSAPI_KRB5_HEADER@
+
+/*
+ * Defined to <krb5.h> or <krb5/krb5.h> for how to include
+ * the KRB5 header.
+ */
+@ISC_PLATFORM_KRB5HEADER@
+
+/*
+ * Type used for resource limits.
+ */
+@ISC_PLATFORM_RLIMITTYPE@
+
+/*
+ * Define if your compiler supports "long long int".
+ */
+@ISC_PLATFORM_HAVELONGLONG@
+
+/*
+ * Define if PTHREAD_ONCE_INIT should be surrounded by braces to
+ * prevent compiler warnings (such as with gcc on Solaris 2.8).
+ */
+@ISC_PLATFORM_BRACEPTHREADONCEINIT@
+
+/*
+ * Used to control how extern data is linked; needed for Win32 platforms.
+ */
+@ISC_PLATFORM_USEDECLSPEC@
+
+/*
+ * Define if the platform has <sys/un.h>.
+ */
+@ISC_PLATFORM_HAVESYSUNH@
+
+/*
+ * If the "xadd" operation is available on this architecture,
+ * ISC_PLATFORM_HAVEXADD will be defined.
+ */
+@ISC_PLATFORM_HAVEXADD@
+
+/*
+ * If the "xaddq" operation (64bit xadd) is available on this architecture,
+ * ISC_PLATFORM_HAVEXADDQ will be defined.
+ */
+@ISC_PLATFORM_HAVEXADDQ@
+
+/*
+ * If the "atomic swap" operation is available on this architecture,
+ * ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
+ */
+@ISC_PLATFORM_HAVEATOMICSTORE@
+
+/*
+ * If the "compare-and-exchange" operation is available on this architecture,
+ * ISC_PLATFORM_HAVECMPXCHG will be defined.
+ */
+@ISC_PLATFORM_HAVECMPXCHG@
+
+/*
+ * Define if gcc ASM extension is available
+ */
+@ISC_PLATFORM_USEGCCASM@
+
+/*
+ * Define if Tru64 style ASM syntax must be used.
+ */
+@ISC_PLATFORM_USEOSFASM@
+
+/*
+ * Define if the standard __asm function must be used.
+ */
+@ISC_PLATFORM_USESTDASM@
+
+/*
+ * Define if the platform has <strings.h>.
+ */
+@ISC_PLATFORM_HAVESTRINGSH@
+
+/*
+ * Define if the hash functions must be provided by OpenSSL.
+ */
+@ISC_PLATFORM_OPENSSLHASH@
+
+/*
+ * Defines for the noreturn attribute.
+ */
+@ISC_PLATFORM_NORETURN_PRE@
+@ISC_PLATFORM_NORETURN_POST@
+
+/***
+ *** Windows dll support.
+ ***/
+
+/*
+ * Define if MacOS style of PPC assembly must be used.
+ * e.g. "r6", not "6", for register six.
+ */
+@ISC_PLATFORM_USEMACASM@
+
+#ifndef ISC_PLATFORM_USEDECLSPEC
+#define LIBISC_EXTERNAL_DATA
+#define LIBDNS_EXTERNAL_DATA
+#define LIBISCCC_EXTERNAL_DATA
+#define LIBISCCFG_EXTERNAL_DATA
+#define LIBBIND9_EXTERNAL_DATA
+#else /*! \brief ISC_PLATFORM_USEDECLSPEC */
+#ifdef LIBISC_EXPORTS
+#define LIBISC_EXTERNAL_DATA __declspec(dllexport)
+#else
+#define LIBISC_EXTERNAL_DATA __declspec(dllimport)
+#endif
+#ifdef LIBDNS_EXPORTS
+#define LIBDNS_EXTERNAL_DATA __declspec(dllexport)
+#else
+#define LIBDNS_EXTERNAL_DATA __declspec(dllimport)
+#endif
+#ifdef LIBISCCC_EXPORTS
+#define LIBISCCC_EXTERNAL_DATA __declspec(dllexport)
+#else
+#define LIBISCCC_EXTERNAL_DATA __declspec(dllimport)
+#endif
+#ifdef LIBISCCFG_EXPORTS
+#define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport)
+#else
+#define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport)
+#endif
+#ifdef LIBBIND9_EXPORTS
+#define LIBBIND9_EXTERNAL_DATA __declspec(dllexport)
+#else
+#define LIBBIND9_EXTERNAL_DATA __declspec(dllimport)
+#endif
+#endif /*! \brief ISC_PLATFORM_USEDECLSPEC */
+
+/*
+ * Tell emacs to use C mode for this file.
+ *
+ * Local Variables:
+ * mode: c
+ * End:
+ */
+
+#endif /* ISC_PLATFORM_H */
diff --git a/lib/isc/include/isc/portset.h b/lib/isc/include/isc/portset.h
new file mode 100644
index 0000000..774d6bb
--- /dev/null
+++ b/lib/isc/include/isc/portset.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: portset.h,v 1.6 2009/06/25 05:28:34 marka Exp $ */
+
+/*! \file isc/portset.h
+ * \brief Transport Protocol Port Manipulation Module
+ *
+ * This module provides simple utilities to handle a set of transport protocol
+ * (UDP or TCP) port numbers, e.g., for creating an ACL list. An isc_portset_t
+ * object is an opaque instance of a port set, for which the user can add or
+ * remove a specific port or a range of consecutive ports. This object is
+ * expected to be used as a temporary work space only, and does not protect
+ * simultaneous access from multiple threads. Therefore it must not be stored
+ * in a place that can be accessed from multiple threads.
+ */
+
+#ifndef ISC_PORTSET_H
+#define ISC_PORTSET_H 1
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/net.h>
+
+/***
+ *** Functions
+ ***/
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp);
+/*%<
+ * Create a port set and initialize it as an empty set.
+ *
+ * Requires:
+ *\li 'mctx' to be valid.
+ *\li 'portsetp' to be non NULL and '*portsetp' to be NULL;
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ */
+
+void
+isc_portset_destroy(isc_mem_t *mctx, isc_portset_t **portsetp);
+/*%<
+ * Destroy a port set.
+ *
+ * Requires:
+ *\li 'mctx' to be valid and must be the same context given when the port set
+ * was created.
+ *\li '*portsetp' to be a valid set.
+ */
+
+isc_boolean_t
+isc_portset_isset(isc_portset_t *portset, in_port_t port);
+/*%<
+ * Test whether the given port is stored in the portset.
+ *
+ * Requires:
+ *\li 'portset' to be a valid set.
+ *
+ * Returns
+ * \li #ISC_TRUE if the port is found, ISC_FALSE otherwise.
+ */
+
+unsigned int
+isc_portset_nports(isc_portset_t *portset);
+/*%<
+ * Provides the number of ports stored in the given portset.
+ *
+ * Requires:
+ *\li 'portset' to be a valid set.
+ *
+ * Returns
+ * \li the number of ports stored in portset.
+ */
+
+void
+isc_portset_add(isc_portset_t *portset, in_port_t port);
+/*%<
+ * Add the given port to the portset. The port may or may not be stored in
+ * the portset.
+ *
+ * Requires:
+ *\li 'portlist' to be valid.
+ */
+
+void
+isc_portset_remove(isc_portset_t *portset, in_port_t port);
+/*%<
+ * Remove the given port to the portset. The port may or may not be stored in
+ * the portset.
+ *
+ * Requires:
+ *\li 'portlist' to be valid.
+ */
+
+void
+isc_portset_addrange(isc_portset_t *portset, in_port_t port_lo,
+ in_port_t port_hi);
+/*%<
+ * Add a subset of [port_lo, port_hi] (inclusive) to the portset. Ports in the
+ * subset may or may not be stored in portset.
+ *
+ * Requires:
+ *\li 'portlist' to be valid.
+ *\li port_lo <= port_hi
+ */
+
+void
+isc_portset_removerange(isc_portset_t *portset, in_port_t port_lo,
+ in_port_t port_hi);
+/*%<
+ * Subtract a subset of [port_lo, port_hi] (inclusive) from the portset. Ports
+ * in the subset may or may not be stored in portset.
+ *
+ * Requires:
+ *\li 'portlist' to be valid.
+ *\li port_lo <= port_hi
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_PORTSET_H */
diff --git a/lib/isc/include/isc/print.h b/lib/isc/include/isc/print.h
new file mode 100644
index 0000000..cd1e38e
--- /dev/null
+++ b/lib/isc/include/isc/print.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: print.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_PRINT_H
+#define ISC_PRINT_H 1
+
+/*! \file isc/print.h */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/formatcheck.h> /* Required for ISC_FORMAT_PRINTF() macro. */
+#include <isc/lang.h>
+#include <isc/platform.h>
+
+/*!
+ * This block allows lib/isc/print.c to be cleanly compiled even if
+ * the platform does not need it. The standard Makefile will still
+ * not compile print.c or archive print.o, so this is just to make test
+ * compilation ("make print.o") easier.
+ */
+#if !defined(ISC_PLATFORM_NEEDVSNPRINTF) && defined(ISC__PRINT_SOURCE)
+#define ISC_PLATFORM_NEEDVSNPRINTF
+#endif
+
+#if !defined(ISC_PLATFORM_NEEDSPRINTF) && defined(ISC__PRINT_SOURCE)
+#define ISC_PLATFORM_NEEDSPRINTF
+#endif
+
+/***
+ *** Macros
+ ***/
+#define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT
+
+/***
+ *** Functions
+ ***/
+
+#ifdef ISC_PLATFORM_NEEDVSNPRINTF
+#include <stdarg.h>
+#include <stddef.h>
+#endif
+#ifdef ISC_PLATFORM_NEEDSPRINTF
+#include <stdio.h>
+#endif
+
+
+ISC_LANG_BEGINDECLS
+
+#ifdef ISC_PLATFORM_NEEDVSNPRINTF
+int
+isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap)
+ ISC_FORMAT_PRINTF(3, 0);
+#define vsnprintf isc_print_vsnprintf
+
+int
+isc_print_snprintf(char *str, size_t size, const char *format, ...)
+ ISC_FORMAT_PRINTF(3, 4);
+#define snprintf isc_print_snprintf
+#endif /* ISC_PLATFORM_NEEDVSNPRINTF */
+
+#ifdef ISC_PLATFORM_NEEDSPRINTF
+int
+isc_print_sprintf(char *str, const char *format, ...) ISC_FORMAT_PRINTF(2, 3);
+#define sprintf isc_print_sprintf
+#endif
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_PRINT_H */
diff --git a/lib/isc/include/isc/queue.h b/lib/isc/include/isc/queue.h
new file mode 100644
index 0000000..5bf84c5
--- /dev/null
+++ b/lib/isc/include/isc/queue.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*
+ * This is a generic implementation of a two-lock concurrent queue.
+ * There are built-in mutex locks for the head and tail of the queue,
+ * allowing elements to be safely added and removed at the same time.
+ */
+
+#ifndef ISC_QUEUE_H
+#define ISC_QUEUE_H 1
+#include <isc/assertions.h>
+#include <isc/boolean.h>
+#include <isc/mutex.h>
+
+#ifdef ISC_QUEUE_CHECKINIT
+#define ISC_QLINK_INSIST(x) ISC_INSIST(x)
+#else
+#define ISC_QLINK_INSIST(x) (void)0
+#endif
+
+#define ISC_QLINK(type) struct { void *next; isc_boolean_t linked; }
+#define ISC_QLINK_INIT(elt, link) \
+ do { \
+ (elt)->link.next = (void *)(-1); \
+ (elt)->link.linked = ISC_FALSE; \
+ } while (0)
+#define ISC_QLINK_LINKED(elt, link) ((elt)->link.linked)
+
+#define ISC_QUEUE(type) struct { \
+ type headnode; \
+ type *head, *tail; \
+ isc_mutex_t headlock, taillock; \
+}
+
+#define ISC_QUEUE_INIT(queue, link) \
+ do { \
+ isc_mutex_init(&(queue).headlock); \
+ isc_mutex_init(&(queue).taillock); \
+ (queue).head = (void *) &((queue).headnode); \
+ (queue).tail = (void *) &((queue).headnode); \
+ ISC_QLINK_INIT((queue).head, link); \
+ } while (0)
+
+#define ISC_QUEUE_EMPTY(queue) ISC_TF((queue).head == (queue).tail)
+
+#define ISC_QUEUE_DESTROY(queue) \
+ do { \
+ ISC_QLINK_INSIST(ISC_QUEUE_EMPTY(queue)); \
+ isc_mutex_destroy(&(queue).headlock); \
+ isc_mutex_destroy(&(queue).taillock); \
+ } while (0)
+
+#define ISC_QUEUE_PUSH(queue, elt, link) \
+ do { \
+ ISC_QLINK_INSIST(!ISC_QLINK_LINKED(elt, link)); \
+ (elt)->link.next = (void *)(-1); \
+ LOCK(&(queue).taillock); \
+ (queue).tail->link.next = elt; \
+ (queue).tail = elt; \
+ UNLOCK(&(queue).taillock); \
+ (elt)->link.linked = ISC_TRUE; \
+ } while (0)
+
+#define ISC_QUEUE_POP(queue, link, ret) \
+ do { \
+ LOCK(&(queue).headlock); \
+ ret = (queue).head->link.next; \
+ if (ret == (void *)(-1)) { \
+ UNLOCK(&(queue).headlock); \
+ ret = NULL; \
+ } else { \
+ (queue).head->link.next = ret->link.next; \
+ if (ret->link.next == (void *)(-1)) { \
+ LOCK(&(queue).taillock); \
+ (queue).tail = (queue).head; \
+ UNLOCK(&(queue).taillock); \
+ } \
+ UNLOCK(&(queue).headlock); \
+ ret->link.next = (void *)(-1); \
+ ret->link.linked = ISC_FALSE; \
+ } \
+ } while (0)
+
+#endif /* ISC_QUEUE_H */
diff --git a/lib/isc/include/isc/quota.h b/lib/isc/include/isc/quota.h
new file mode 100644
index 0000000..7b0d0d9
--- /dev/null
+++ b/lib/isc/include/isc/quota.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: quota.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_QUOTA_H
+#define ISC_QUOTA_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/quota.h
+ *
+ * \brief The isc_quota_t object is a simple helper object for implementing
+ * quotas on things like the number of simultaneous connections to
+ * a server. It keeps track of the amount of quota in use, and
+ * encapsulates the locking necessary to allow multiple tasks to
+ * share a quota.
+ */
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/types.h>
+
+/*****
+ ***** Types.
+ *****/
+
+ISC_LANG_BEGINDECLS
+
+/*% isc_quota structure */
+struct isc_quota {
+ isc_mutex_t lock; /*%< Locked by lock. */
+ int max;
+ int used;
+ int soft;
+};
+
+isc_result_t
+isc_quota_init(isc_quota_t *quota, int max);
+/*%<
+ * Initialize a quota object.
+ *
+ * Returns:
+ * ISC_R_SUCCESS
+ * Other error Lock creation failed.
+ */
+
+void
+isc_quota_destroy(isc_quota_t *quota);
+/*%<
+ * Destroy a quota object.
+ */
+
+void
+isc_quota_soft(isc_quota_t *quota, int soft);
+/*%<
+ * Set a soft quota.
+ */
+
+void
+isc_quota_max(isc_quota_t *quota, int max);
+/*%<
+ * Re-set a maximum quota.
+ */
+
+isc_result_t
+isc_quota_reserve(isc_quota_t *quota);
+/*%<
+ * Attempt to reserve one unit of 'quota'.
+ *
+ * Returns:
+ * \li #ISC_R_SUCCESS Success
+ * \li #ISC_R_SOFTQUOTA Success soft quota reached
+ * \li #ISC_R_QUOTA Quota is full
+ */
+
+void
+isc_quota_release(isc_quota_t *quota);
+/*%<
+ * Release one unit of quota.
+ */
+
+isc_result_t
+isc_quota_attach(isc_quota_t *quota, isc_quota_t **p);
+/*%<
+ * Like isc_quota_reserve, and also attaches '*p' to the
+ * quota if successful (ISC_R_SUCCESS or ISC_R_SOFTQUOTA).
+ */
+
+void
+isc_quota_detach(isc_quota_t **p);
+/*%<
+ * Like isc_quota_release, and also detaches '*p' from the
+ * quota.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_QUOTA_H */
diff --git a/lib/isc/include/isc/radix.h b/lib/isc/include/isc/radix.h
new file mode 100644
index 0000000..6b413a2
--- /dev/null
+++ b/lib/isc/include/isc/radix.h
@@ -0,0 +1,240 @@
+/*
+ * Copyright (C) 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: radix.h,v 1.13 2008/12/01 23:47:45 tbox Exp $ */
+
+/*
+ * This source was adapted from MRT's RCS Ids:
+ * Id: radix.h,v 1.6 1999/08/03 03:32:53 masaki Exp
+ * Id: mrt.h,v 1.57.2.6 1999/12/28 23:41:27 labovit Exp
+ * Id: defs.h,v 1.5.2.2 2000/01/15 14:19:16 masaki Exp
+ */
+
+#include <isc/magic.h>
+#include <isc/types.h>
+#include <isc/mutex.h>
+#include <isc/net.h>
+#include <isc/refcount.h>
+
+#include <string.h>
+
+#ifndef _RADIX_H
+#define _RADIX_H
+
+#define NETADDR_TO_PREFIX_T(na,pt,bits) \
+ do { \
+ memset(&(pt), 0, sizeof(pt)); \
+ if((na) != NULL) { \
+ (pt).family = (na)->family; \
+ (pt).bitlen = (bits); \
+ if ((pt).family == AF_INET6) { \
+ memcpy(&(pt).add.sin6, &(na)->type.in6, \
+ ((bits)+7)/8); \
+ } else \
+ memcpy(&(pt).add.sin, &(na)->type.in, \
+ ((bits)+7)/8); \
+ } else { \
+ (pt).family = AF_UNSPEC; \
+ (pt).bitlen = 0; \
+ } \
+ isc_refcount_init(&(pt).refcount, 0); \
+ } while(0)
+
+typedef struct isc_prefix {
+ unsigned int family; /* AF_INET | AF_INET6, or AF_UNSPEC for "any" */
+ unsigned int bitlen; /* 0 for "any" */
+ isc_refcount_t refcount;
+ union {
+ struct in_addr sin;
+ struct in6_addr sin6;
+ } add;
+} isc_prefix_t;
+
+typedef void (*isc_radix_destroyfunc_t)(void *);
+typedef void (*isc_radix_processfunc_t)(isc_prefix_t *, void **);
+
+#define isc_prefix_tochar(prefix) ((char *)&(prefix)->add.sin)
+#define isc_prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin)
+
+#define BIT_TEST(f, b) ((f) & (b))
+
+/*
+ * We need "first match" when we search the radix tree to preserve
+ * compatibility with the existing ACL implementation. Radix trees
+ * naturally lend themselves to "best match". In order to get "first match"
+ * behavior, we keep track of the order in which entries are added to the
+ * tree--and when a search is made, we find all matching entries, and
+ * return the one that was added first.
+ *
+ * An IPv4 prefix and an IPv6 prefix may share a radix tree node if they
+ * have the same length and bit pattern (e.g., 127/8 and 7f::/8). To
+ * disambiguate between them, node_num and data are two-element arrays;
+ * node_num[0] and data[0] are used for IPv4 addresses, node_num[1]
+ * and data[1] for IPv6 addresses. The only exception is a prefix of
+ * 0/0 (aka "any" or "none"), which is always stored as IPv4 but matches
+ * IPv6 addresses too.
+ */
+
+#define ISC_IS6(family) ((family) == AF_INET6 ? 1 : 0)
+typedef struct isc_radix_node {
+ isc_uint32_t bit; /* bit length of the prefix */
+ isc_prefix_t *prefix; /* who we are in radix tree */
+ struct isc_radix_node *l, *r; /* left and right children */
+ struct isc_radix_node *parent; /* may be used */
+ void *data[2]; /* pointers to IPv4 and IPV6 data */
+ int node_num[2]; /* which node this was in the tree,
+ or -1 for glue nodes */
+} isc_radix_node_t;
+
+#define RADIX_TREE_MAGIC ISC_MAGIC('R','d','x','T');
+#define RADIX_TREE_VALID(a) ISC_MAGIC_VALID(a, RADIX_TREE_MAGIC);
+
+typedef struct isc_radix_tree {
+ unsigned int magic;
+ isc_mem_t *mctx;
+ isc_radix_node_t *head;
+ isc_uint32_t maxbits; /* for IP, 32 bit addresses */
+ int num_active_node; /* for debugging purposes */
+ int num_added_node; /* total number of nodes */
+} isc_radix_tree_t;
+
+isc_result_t
+isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target,
+ isc_prefix_t *prefix);
+/*%<
+ * Search 'radix' for the best match to 'prefix'.
+ * Return the node found in '*target'.
+ *
+ * Requires:
+ * \li 'radix' to be valid.
+ * \li 'target' is not NULL and "*target" is NULL.
+ * \li 'prefix' to be valid.
+ *
+ * Returns:
+ * \li ISC_R_NOTFOUND
+ * \li ISC_R_SUCCESS
+ */
+
+isc_result_t
+isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target,
+ isc_radix_node_t *source, isc_prefix_t *prefix);
+/*%<
+ * Insert 'source' or 'prefix' into the radix tree 'radix'.
+ * Return the node added in 'target'.
+ *
+ * Requires:
+ * \li 'radix' to be valid.
+ * \li 'target' is not NULL and "*target" is NULL.
+ * \li 'prefix' to be valid or 'source' to be non NULL and contain
+ * a valid prefix.
+ *
+ * Returns:
+ * \li ISC_R_NOMEMORY
+ * \li ISC_R_SUCCESS
+ */
+
+void
+isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node);
+/*%<
+ * Remove the node 'node' from the radix tree 'radix'.
+ *
+ * Requires:
+ * \li 'radix' to be valid.
+ * \li 'node' to be valid.
+ */
+
+isc_result_t
+isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits);
+/*%<
+ * Create a radix tree with a maximum depth of 'maxbits';
+ *
+ * Requires:
+ * \li 'mctx' to be valid.
+ * \li 'target' to be non NULL and '*target' to be NULL.
+ * \li 'maxbits' to be less than or equal to RADIX_MAXBITS.
+ *
+ * Returns:
+ * \li ISC_R_NOMEMORY
+ * \li ISC_R_SUCCESS
+ */
+
+void
+isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func);
+/*%<
+ * Destroy a radix tree optionally calling 'func' to clean up node data.
+ *
+ * Requires:
+ * \li 'radix' to be valid.
+ */
+
+void
+isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func);
+/*%<
+ * Walk a radix tree calling 'func' to process node data.
+ *
+ * Requires:
+ * \li 'radix' to be valid.
+ * \li 'func' to point to a function.
+ */
+
+#define RADIX_MAXBITS 128
+#define RADIX_NBIT(x) (0x80 >> ((x) & 0x7f))
+#define RADIX_NBYTE(x) ((x) >> 3)
+
+#define RADIX_DATA_GET(node, type) (type *)((node)->data)
+#define RADIX_DATA_SET(node, value) ((node)->data = (void *)(value))
+
+#define RADIX_WALK(Xhead, Xnode) \
+ do { \
+ isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \
+ isc_radix_node_t **Xsp = Xstack; \
+ isc_radix_node_t *Xrn = (Xhead); \
+ while ((Xnode = Xrn)) { \
+ if (Xnode->prefix)
+
+#define RADIX_WALK_ALL(Xhead, Xnode) \
+do { \
+ isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \
+ isc_radix_node_t **Xsp = Xstack; \
+ isc_radix_node_t *Xrn = (Xhead); \
+ while ((Xnode = Xrn)) { \
+ if (1)
+
+#define RADIX_WALK_BREAK { \
+ if (Xsp != Xstack) { \
+ Xrn = *(--Xsp); \
+ } else { \
+ Xrn = (radix_node_t *) 0; \
+ } \
+ continue; }
+
+#define RADIX_WALK_END \
+ if (Xrn->l) { \
+ if (Xrn->r) { \
+ *Xsp++ = Xrn->r; \
+ } \
+ Xrn = Xrn->l; \
+ } else if (Xrn->r) { \
+ Xrn = Xrn->r; \
+ } else if (Xsp != Xstack) { \
+ Xrn = *(--Xsp); \
+ } else { \
+ Xrn = (isc_radix_node_t *) 0; \
+ } \
+ } \
+ } while (0)
+
+#endif /* _RADIX_H */
diff --git a/lib/isc/include/isc/random.h b/lib/isc/include/isc/random.h
new file mode 100644
index 0000000..1f9572d
--- /dev/null
+++ b/lib/isc/include/isc/random.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: random.h,v 1.20 2009/01/17 23:47:43 tbox Exp $ */
+
+#ifndef ISC_RANDOM_H
+#define ISC_RANDOM_H 1
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/*! \file isc/random.h
+ * \brief Implements a random state pool which will let the caller return a
+ * series of possibly non-reproducible random values.
+ *
+ * Note that the
+ * strength of these numbers is not all that high, and should not be
+ * used in cryptography functions. It is useful for jittering values
+ * a bit here and there, such as timeouts, etc.
+ */
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_random_seed(isc_uint32_t seed);
+/*%<
+ * Set the initial seed of the random state.
+ */
+
+void
+isc_random_get(isc_uint32_t *val);
+/*%<
+ * Get a random value.
+ *
+ * Requires:
+ * val != NULL.
+ */
+
+isc_uint32_t
+isc_random_jitter(isc_uint32_t max, isc_uint32_t jitter);
+/*%<
+ * Get a random value between (max - jitter) and (max).
+ * This is useful for jittering timer values.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_RANDOM_H */
diff --git a/lib/isc/include/isc/ratelimiter.h b/lib/isc/include/isc/ratelimiter.h
new file mode 100644
index 0000000..00a7209
--- /dev/null
+++ b/lib/isc/include/isc/ratelimiter.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ratelimiter.h,v 1.23 2009/01/18 23:48:14 tbox Exp $ */
+
+#ifndef ISC_RATELIMITER_H
+#define ISC_RATELIMITER_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/ratelimiter.h
+ * \brief A rate limiter is a mechanism for dispatching events at a limited
+ * rate. This is intended to be used when sending zone maintenance
+ * SOA queries, NOTIFY messages, etc.
+ */
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/*****
+ ***** Functions.
+ *****/
+
+isc_result_t
+isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr,
+ isc_task_t *task, isc_ratelimiter_t **ratelimiterp);
+/*%<
+ * Create a rate limiter. The execution interval is initially undefined.
+ */
+
+isc_result_t
+isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval);
+/*!<
+ * Set the minimum interval between event executions.
+ * The interval value is copied, so the caller need not preserve it.
+ *
+ * Requires:
+ * '*interval' is a nonzero interval.
+ */
+
+void
+isc_ratelimiter_setpertic(isc_ratelimiter_t *rl, isc_uint32_t perint);
+/*%<
+ * Set the number of events processed per interval timer tick.
+ * If 'perint' is zero it is treated as 1.
+ */
+
+isc_result_t
+isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task,
+ isc_event_t **eventp);
+/*%<
+ * Queue an event for rate-limited execution.
+ *
+ * This is similar
+ * to doing an isc_task_send() to the 'task', except that the
+ * execution may be delayed to achieve the desired rate of
+ * execution.
+ *
+ * '(*eventp)->ev_sender' is used to hold the task. The caller
+ * must ensure that the task exists until the event is delivered.
+ *
+ * Requires:
+ *\li An interval has been set by calling
+ * isc_ratelimiter_setinterval().
+ *
+ *\li 'task' to be non NULL.
+ *\li '(*eventp)->ev_sender' to be NULL.
+ */
+
+void
+isc_ratelimiter_shutdown(isc_ratelimiter_t *ratelimiter);
+/*%<
+ * Shut down a rate limiter.
+ *
+ * Ensures:
+ *\li All events that have not yet been
+ * dispatched to the task are dispatched immediately with
+ * the #ISC_EVENTATTR_CANCELED bit set in ev_attributes.
+ *
+ *\li Further attempts to enqueue events will fail with
+ * #ISC_R_SHUTTINGDOWN.
+ *
+ *\li The rate limiter is no longer attached to its task.
+ */
+
+void
+isc_ratelimiter_attach(isc_ratelimiter_t *source, isc_ratelimiter_t **target);
+/*%<
+ * Attach to a rate limiter.
+ */
+
+void
+isc_ratelimiter_detach(isc_ratelimiter_t **ratelimiterp);
+/*%<
+ * Detach from a rate limiter.
+ */
+
+isc_result_t
+isc_ratelimiter_stall(isc_ratelimiter_t *rl);
+/*%<
+ * Stall event processing.
+ */
+
+isc_result_t
+isc_ratelimiter_release(isc_ratelimiter_t *rl);
+/*%<
+ * Release a stalled rate limiter.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_RATELIMITER_H */
diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h
new file mode 100644
index 0000000..b72b158
--- /dev/null
+++ b/lib/isc/include/isc/refcount.h
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: refcount.h,v 1.17 2009/09/29 23:48:04 tbox Exp $ */
+
+#ifndef ISC_REFCOUNT_H
+#define ISC_REFCOUNT_H 1
+
+#include <isc/atomic.h>
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+/*! \file isc/refcount.h
+ * \brief Implements a locked reference counter.
+ *
+ * These functions may actually be
+ * implemented using macros, and implementations of these macros are below.
+ * The isc_refcount_t type should not be accessed directly, as its contents
+ * depend on the implementation.
+ */
+
+ISC_LANG_BEGINDECLS
+
+/*
+ * Function prototypes
+ */
+
+/*
+ * isc_result_t
+ * isc_refcount_init(isc_refcount_t *ref, unsigned int n);
+ *
+ * Initialize the reference counter. There will be 'n' initial references.
+ *
+ * Requires:
+ * ref != NULL
+ */
+
+/*
+ * void
+ * isc_refcount_destroy(isc_refcount_t *ref);
+ *
+ * Destroys a reference counter.
+ *
+ * Requires:
+ * ref != NULL
+ * The number of references is 0.
+ */
+
+/*
+ * void
+ * isc_refcount_increment(isc_refcount_t *ref, unsigned int *targetp);
+ * isc_refcount_increment0(isc_refcount_t *ref, unsigned int *targetp);
+ *
+ * Increments the reference count, returning the new value in targetp if it's
+ * not NULL. The reference counter typically begins with the initial counter
+ * of 1, and will be destroyed once the counter reaches 0. Thus,
+ * isc_refcount_increment() additionally requires the previous counter be
+ * larger than 0 so that an error which violates the usage can be easily
+ * caught. isc_refcount_increment0() does not have this restriction.
+ *
+ * Requires:
+ * ref != NULL.
+ */
+
+/*
+ * void
+ * isc_refcount_decrement(isc_refcount_t *ref, unsigned int *targetp);
+ *
+ * Decrements the reference count, returning the new value in targetp if it's
+ * not NULL.
+ *
+ * Requires:
+ * ref != NULL.
+ */
+
+
+/*
+ * Sample implementations
+ */
+#ifdef ISC_PLATFORM_USETHREADS
+#ifdef ISC_PLATFORM_HAVEXADD
+
+#define ISC_REFCOUNT_HAVEATOMIC 1
+
+typedef struct isc_refcount {
+ isc_int32_t refs;
+} isc_refcount_t;
+
+#define isc_refcount_destroy(rp) REQUIRE((rp)->refs == 0)
+#define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
+
+#define isc_refcount_increment0(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ isc_int32_t prev; \
+ prev = isc_atomic_xadd(&(rp)->refs, 1); \
+ if (_tmp != NULL) \
+ *_tmp = prev + 1; \
+ } while (0)
+
+#define isc_refcount_increment(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ isc_int32_t prev; \
+ prev = isc_atomic_xadd(&(rp)->refs, 1); \
+ REQUIRE(prev > 0); \
+ if (_tmp != NULL) \
+ *_tmp = prev + 1; \
+ } while (0)
+
+#define isc_refcount_decrement(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ isc_int32_t prev; \
+ prev = isc_atomic_xadd(&(rp)->refs, -1); \
+ REQUIRE(prev > 0); \
+ if (_tmp != NULL) \
+ *_tmp = prev - 1; \
+ } while (0)
+
+#else /* ISC_PLATFORM_HAVEXADD */
+
+typedef struct isc_refcount {
+ int refs;
+ isc_mutex_t lock;
+} isc_refcount_t;
+
+/*% Destroys a reference counter. */
+#define isc_refcount_destroy(rp) \
+ do { \
+ REQUIRE((rp)->refs == 0); \
+ DESTROYLOCK(&(rp)->lock); \
+ } while (0)
+
+#define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
+
+/*% Increments the reference count, returning the new value in targetp if it's not NULL. */
+#define isc_refcount_increment0(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ LOCK(&(rp)->lock); \
+ ++((rp)->refs); \
+ if (_tmp != NULL) \
+ *_tmp = ((rp)->refs); \
+ UNLOCK(&(rp)->lock); \
+ } while (0)
+
+#define isc_refcount_increment(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ LOCK(&(rp)->lock); \
+ REQUIRE((rp)->refs > 0); \
+ ++((rp)->refs); \
+ if (_tmp != NULL) \
+ *_tmp = ((rp)->refs); \
+ UNLOCK(&(rp)->lock); \
+ } while (0)
+
+/*% Decrements the reference count, returning the new value in targetp if it's not NULL. */
+#define isc_refcount_decrement(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ LOCK(&(rp)->lock); \
+ REQUIRE((rp)->refs > 0); \
+ --((rp)->refs); \
+ if (_tmp != NULL) \
+ *_tmp = ((rp)->refs); \
+ UNLOCK(&(rp)->lock); \
+ } while (0)
+
+#endif /* ISC_PLATFORM_HAVEXADD */
+#else /* ISC_PLATFORM_USETHREADS */
+
+typedef struct isc_refcount {
+ int refs;
+} isc_refcount_t;
+
+#define isc_refcount_destroy(rp) REQUIRE((rp)->refs == 0)
+#define isc_refcount_current(rp) ((unsigned int)((rp)->refs))
+
+#define isc_refcount_increment0(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ int _n = ++(rp)->refs; \
+ if (_tmp != NULL) \
+ *_tmp = _n; \
+ } while (0)
+
+#define isc_refcount_increment(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ int _n; \
+ REQUIRE((rp)->refs > 0); \
+ _n = ++(rp)->refs; \
+ if (_tmp != NULL) \
+ *_tmp = _n; \
+ } while (0)
+
+#define isc_refcount_decrement(rp, tp) \
+ do { \
+ unsigned int *_tmp = (unsigned int *)(tp); \
+ int _n; \
+ REQUIRE((rp)->refs > 0); \
+ _n = --(rp)->refs; \
+ if (_tmp != NULL) \
+ *_tmp = _n; \
+ } while (0)
+
+#endif /* ISC_PLATFORM_USETHREADS */
+
+isc_result_t
+isc_refcount_init(isc_refcount_t *ref, unsigned int n);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_REFCOUNT_H */
diff --git a/lib/isc/include/isc/region.h b/lib/isc/include/isc/region.h
new file mode 100644
index 0000000..43d8f8f
--- /dev/null
+++ b/lib/isc/include/isc/region.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: region.h,v 1.25 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_REGION_H
+#define ISC_REGION_H 1
+
+/*! \file isc/region.h */
+
+#include <isc/types.h>
+
+struct isc_region {
+ unsigned char * base;
+ unsigned int length;
+};
+
+struct isc_textregion {
+ char * base;
+ unsigned int length;
+};
+
+/* XXXDCL questionable ... bears discussion. we have been putting off
+ * discussing the region api.
+ */
+struct isc_constregion {
+ const void * base;
+ unsigned int length;
+};
+
+struct isc_consttextregion {
+ const char * base;
+ unsigned int length;
+};
+
+/*@{*/
+/*!
+ * The region structure is not opaque, and is usually directly manipulated.
+ * Some macros are defined below for convenience.
+ */
+
+#define isc_region_consume(r,l) \
+ do { \
+ isc_region_t *_r = (r); \
+ unsigned int _l = (l); \
+ INSIST(_r->length >= _l); \
+ _r->base += _l; \
+ _r->length -= _l; \
+ } while (0)
+
+#define isc_textregion_consume(r,l) \
+ do { \
+ isc_textregion_t *_r = (r); \
+ unsigned int _l = (l); \
+ INSIST(_r->length >= _l); \
+ _r->base += _l; \
+ _r->length -= _l; \
+ } while (0)
+
+#define isc_constregion_consume(r,l) \
+ do { \
+ isc_constregion_t *_r = (r); \
+ unsigned int _l = (l); \
+ INSIST(_r->length >= _l); \
+ _r->base += _l; \
+ _r->length -= _l; \
+ } while (0)
+/*@}*/
+
+int
+isc_region_compare(isc_region_t *r1, isc_region_t *r2);
+/*%<
+ * Compares the contents of two regions
+ *
+ * Requires:
+ *\li 'r1' is a valid region
+ *\li 'r2' is a valid region
+ *
+ * Returns:
+ *\li < 0 if r1 is lexicographically less than r2
+ *\li = 0 if r1 is lexicographically identical to r2
+ *\li > 0 if r1 is lexicographically greater than r2
+ */
+
+#endif /* ISC_REGION_H */
diff --git a/lib/isc/include/isc/resource.h b/lib/isc/include/isc/resource.h
new file mode 100644
index 0000000..747c9fd
--- /dev/null
+++ b/lib/isc/include/isc/resource.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: resource.h,v 1.13 2008/07/11 23:47:09 tbox Exp $ */
+
+#ifndef ISC_RESOURCE_H
+#define ISC_RESOURCE_H 1
+
+/*! \file isc/resource.h */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+#define ISC_RESOURCE_UNLIMITED ((isc_resourcevalue_t)ISC_UINT64_MAX)
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value);
+/*%<
+ * Set the maximum limit for a system resource.
+ *
+ * Notes:
+ *\li If 'value' exceeds the maximum possible on the operating system,
+ * it is silently limited to that maximum -- or to "infinity", if
+ * the operating system has that concept. #ISC_RESOURCE_UNLIMITED
+ * can be used to explicitly ask for the maximum.
+ *
+ * Requires:
+ *\li 'resource' is a valid member of the isc_resource_t enumeration.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success.
+ *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
+ *\li #ISC_R_NOPERM The calling process did not have adequate permission
+ * to change the resource limit.
+ */
+
+isc_result_t
+isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value);
+/*%<
+ * Get the maximum limit for a system resource.
+ *
+ * Notes:
+ *\li 'value' is set to the maximum limit.
+ *
+ *\li #ISC_RESOURCE_UNLIMITED is the maximum value of isc_resourcevalue_t.
+ *
+ *\li On many (all?) Unix systems, RLIM_INFINITY is a valid value that is
+ * significantly less than #ISC_RESOURCE_UNLIMITED, but which in practice
+ * behaves the same.
+ *
+ *\li The current ISC libdns configuration file parser assigns a value
+ * of ISC_UINT32_MAX for a size_spec of "unlimited" and ISC_UNIT32_MAX - 1
+ * for "default", the latter of which is supposed to represent "the
+ * limit that was in force when the server started". Since these are
+ * valid values in the middle of the range of isc_resourcevalue_t,
+ * there is the possibility for confusion over what exactly those
+ * particular values are supposed to represent in a particular context --
+ * discrete integral values or generalized concepts.
+ *
+ * Requires:
+ *\li 'resource' is a valid member of the isc_resource_t enumeration.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success.
+ *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
+ */
+
+isc_result_t
+isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value);
+/*%<
+ * Same as isc_resource_getlimit(), but returns the current (soft) limit.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS Success.
+ *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_RESOURCE_H */
+
diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h
new file mode 100644
index 0000000..dcd457b
--- /dev/null
+++ b/lib/isc/include/isc/result.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2004-2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_RESULT_H
+#define ISC_RESULT_H 1
+
+/*! \file isc/result.h */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+#define ISC_R_SUCCESS 0 /*%< success */
+#define ISC_R_NOMEMORY 1 /*%< out of memory */
+#define ISC_R_TIMEDOUT 2 /*%< timed out */
+#define ISC_R_NOTHREADS 3 /*%< no available threads */
+#define ISC_R_ADDRNOTAVAIL 4 /*%< address not available */
+#define ISC_R_ADDRINUSE 5 /*%< address in use */
+#define ISC_R_NOPERM 6 /*%< permission denied */
+#define ISC_R_NOCONN 7 /*%< no pending connections */
+#define ISC_R_NETUNREACH 8 /*%< network unreachable */
+#define ISC_R_HOSTUNREACH 9 /*%< host unreachable */
+#define ISC_R_NETDOWN 10 /*%< network down */
+#define ISC_R_HOSTDOWN 11 /*%< host down */
+#define ISC_R_CONNREFUSED 12 /*%< connection refused */
+#define ISC_R_NORESOURCES 13 /*%< not enough free resources */
+#define ISC_R_EOF 14 /*%< end of file */
+#define ISC_R_BOUND 15 /*%< socket already bound */
+#define ISC_R_RELOAD 16 /*%< reload */
+#define ISC_R_SUSPEND ISC_R_RELOAD /*%< alias of 'reload' */
+#define ISC_R_LOCKBUSY 17 /*%< lock busy */
+#define ISC_R_EXISTS 18 /*%< already exists */
+#define ISC_R_NOSPACE 19 /*%< ran out of space */
+#define ISC_R_CANCELED 20 /*%< operation canceled */
+#define ISC_R_NOTBOUND 21 /*%< socket is not bound */
+#define ISC_R_SHUTTINGDOWN 22 /*%< shutting down */
+#define ISC_R_NOTFOUND 23 /*%< not found */
+#define ISC_R_UNEXPECTEDEND 24 /*%< unexpected end of input */
+#define ISC_R_FAILURE 25 /*%< generic failure */
+#define ISC_R_IOERROR 26 /*%< I/O error */
+#define ISC_R_NOTIMPLEMENTED 27 /*%< not implemented */
+#define ISC_R_UNBALANCED 28 /*%< unbalanced parentheses */
+#define ISC_R_NOMORE 29 /*%< no more */
+#define ISC_R_INVALIDFILE 30 /*%< invalid file */
+#define ISC_R_BADBASE64 31 /*%< bad base64 encoding */
+#define ISC_R_UNEXPECTEDTOKEN 32 /*%< unexpected token */
+#define ISC_R_QUOTA 33 /*%< quota reached */
+#define ISC_R_UNEXPECTED 34 /*%< unexpected error */
+#define ISC_R_ALREADYRUNNING 35 /*%< already running */
+#define ISC_R_IGNORE 36 /*%< ignore */
+#define ISC_R_MASKNONCONTIG 37 /*%< addr mask not contiguous */
+#define ISC_R_FILENOTFOUND 38 /*%< file not found */
+#define ISC_R_FILEEXISTS 39 /*%< file already exists */
+#define ISC_R_NOTCONNECTED 40 /*%< socket is not connected */
+#define ISC_R_RANGE 41 /*%< out of range */
+#define ISC_R_NOENTROPY 42 /*%< out of entropy */
+#define ISC_R_MULTICAST 43 /*%< invalid use of multicast */
+#define ISC_R_NOTFILE 44 /*%< not a file */
+#define ISC_R_NOTDIRECTORY 45 /*%< not a directory */
+#define ISC_R_QUEUEFULL 46 /*%< queue is full */
+#define ISC_R_FAMILYMISMATCH 47 /*%< address family mismatch */
+#define ISC_R_FAMILYNOSUPPORT 48 /*%< AF not supported */
+#define ISC_R_BADHEX 49 /*%< bad hex encoding */
+#define ISC_R_TOOMANYOPENFILES 50 /*%< too many open files */
+#define ISC_R_NOTBLOCKING 51 /*%< not blocking */
+#define ISC_R_UNBALANCEDQUOTES 52 /*%< unbalanced quotes */
+#define ISC_R_INPROGRESS 53 /*%< operation in progress */
+#define ISC_R_CONNECTIONRESET 54 /*%< connection reset */
+#define ISC_R_SOFTQUOTA 55 /*%< soft quota reached */
+#define ISC_R_BADNUMBER 56 /*%< not a valid number */
+#define ISC_R_DISABLED 57 /*%< disabled */
+#define ISC_R_MAXSIZE 58 /*%< max size */
+#define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */
+#define ISC_R_BADBASE32 60 /*%< bad base32 encoding */
+#define ISC_R_UNSET 61 /*%< unset */
+
+/*% Not a result code: the number of results. */
+#define ISC_R_NRESULTS 62
+
+ISC_LANG_BEGINDECLS
+
+const char *
+isc_result_totext(isc_result_t);
+/*%<
+ * Convert an isc_result_t into a string message describing the result.
+ */
+
+isc_result_t
+isc_result_register(unsigned int base, unsigned int nresults,
+ const char **text, isc_msgcat_t *msgcat, int set);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_RESULT_H */
diff --git a/lib/isc/include/isc/resultclass.h b/lib/isc/include/isc/resultclass.h
new file mode 100644
index 0000000..d91e800
--- /dev/null
+++ b/lib/isc/include/isc/resultclass.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: resultclass.h,v 1.20 2009/09/02 23:48:03 tbox Exp $ */
+
+#ifndef ISC_RESULTCLASS_H
+#define ISC_RESULTCLASS_H 1
+
+
+/*! \file isc/resultclass.h
+ * \brief Registry of Predefined Result Type Classes
+ *
+ * A result class number is an unsigned 16 bit number. Each class may
+ * contain up to 65536 results. A result code is formed by adding the
+ * result number within the class to the class number multiplied by 65536.
+ *
+ * Classes < 1024 are reserved for ISC use.
+ * Result classes >= 1024 and <= 65535 are reserved for application use.
+ */
+
+#define ISC_RESULTCLASS_FROMNUM(num) ((num) << 16)
+#define ISC_RESULTCLASS_TONUM(rclass) ((rclass) >> 16)
+#define ISC_RESULTCLASS_SIZE 65536
+#define ISC_RESULTCLASS_INCLASS(rclass, result) \
+ ((rclass) == ((result) & 0xFFFF0000))
+
+
+#define ISC_RESULTCLASS_ISC ISC_RESULTCLASS_FROMNUM(0)
+#define ISC_RESULTCLASS_DNS ISC_RESULTCLASS_FROMNUM(1)
+#define ISC_RESULTCLASS_DST ISC_RESULTCLASS_FROMNUM(2)
+#define ISC_RESULTCLASS_DNSRCODE ISC_RESULTCLASS_FROMNUM(3)
+#define ISC_RESULTCLASS_OMAPI ISC_RESULTCLASS_FROMNUM(4)
+#define ISC_RESULTCLASS_ISCCC ISC_RESULTCLASS_FROMNUM(5)
+#define ISC_RESULTCLASS_DHCP ISC_RESULTCLASS_FROMNUM(6)
+
+
+#endif /* ISC_RESULTCLASS_H */
diff --git a/lib/isc/include/isc/rwlock.h b/lib/isc/include/isc/rwlock.h
new file mode 100644
index 0000000..28052cd
--- /dev/null
+++ b/lib/isc/include/isc/rwlock.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: rwlock.h,v 1.28 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_RWLOCK_H
+#define ISC_RWLOCK_H 1
+
+/*! \file isc/rwlock.h */
+
+#include <isc/condition.h>
+#include <isc/lang.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+typedef enum {
+ isc_rwlocktype_none = 0,
+ isc_rwlocktype_read,
+ isc_rwlocktype_write
+} isc_rwlocktype_t;
+
+#ifdef ISC_PLATFORM_USETHREADS
+#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG)
+#define ISC_RWLOCK_USEATOMIC 1
+#endif
+
+struct isc_rwlock {
+ /* Unlocked. */
+ unsigned int magic;
+ isc_mutex_t lock;
+
+#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG)
+ /*
+ * When some atomic instructions with hardware assistance are
+ * available, rwlock will use those so that concurrent readers do not
+ * interfere with each other through mutex as long as no writers
+ * appear, massively reducing the lock overhead in the typical case.
+ *
+ * The basic algorithm of this approach is the "simple
+ * writer-preference lock" shown in the following URL:
+ * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html
+ * but our implementation does not rely on the spin lock unlike the
+ * original algorithm to be more portable as a user space application.
+ */
+
+ /* Read or modified atomically. */
+ isc_int32_t write_requests;
+ isc_int32_t write_completions;
+ isc_int32_t cnt_and_flag;
+
+ /* Locked by lock. */
+ isc_condition_t readable;
+ isc_condition_t writeable;
+ unsigned int readers_waiting;
+
+ /* Locked by rwlock itself. */
+ unsigned int write_granted;
+
+ /* Unlocked. */
+ unsigned int write_quota;
+
+#else /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */
+
+ /*%< Locked by lock. */
+ isc_condition_t readable;
+ isc_condition_t writeable;
+ isc_rwlocktype_t type;
+
+ /*% The number of threads that have the lock. */
+ unsigned int active;
+
+ /*%
+ * The number of lock grants made since the lock was last switched
+ * from reading to writing or vice versa; used in determining
+ * when the quota is reached and it is time to switch.
+ */
+ unsigned int granted;
+
+ unsigned int readers_waiting;
+ unsigned int writers_waiting;
+ unsigned int read_quota;
+ unsigned int write_quota;
+ isc_rwlocktype_t original;
+#endif /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */
+};
+#else /* ISC_PLATFORM_USETHREADS */
+struct isc_rwlock {
+ unsigned int magic;
+ isc_rwlocktype_t type;
+ unsigned int active;
+};
+#endif /* ISC_PLATFORM_USETHREADS */
+
+
+isc_result_t
+isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
+ unsigned int write_quota);
+
+isc_result_t
+isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
+
+isc_result_t
+isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
+
+isc_result_t
+isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type);
+
+isc_result_t
+isc_rwlock_tryupgrade(isc_rwlock_t *rwl);
+
+void
+isc_rwlock_downgrade(isc_rwlock_t *rwl);
+
+void
+isc_rwlock_destroy(isc_rwlock_t *rwl);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_RWLOCK_H */
diff --git a/lib/isc/include/isc/serial.h b/lib/isc/include/isc/serial.h
new file mode 100644
index 0000000..a5e0397
--- /dev/null
+++ b/lib/isc/include/isc/serial.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: serial.h,v 1.18 2009/01/18 23:48:14 tbox Exp $ */
+
+#ifndef ISC_SERIAL_H
+#define ISC_SERIAL_H 1
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/*! \file isc/serial.h
+ * \brief Implement 32 bit serial space arithmetic comparison functions.
+ * Note: Undefined results are returned as ISC_FALSE.
+ */
+
+/***
+ *** Functions
+ ***/
+
+ISC_LANG_BEGINDECLS
+
+isc_boolean_t
+isc_serial_lt(isc_uint32_t a, isc_uint32_t b);
+/*%<
+ * Return true if 'a' < 'b' otherwise false.
+ */
+
+isc_boolean_t
+isc_serial_gt(isc_uint32_t a, isc_uint32_t b);
+/*%<
+ * Return true if 'a' > 'b' otherwise false.
+ */
+
+isc_boolean_t
+isc_serial_le(isc_uint32_t a, isc_uint32_t b);
+/*%<
+ * Return true if 'a' <= 'b' otherwise false.
+ */
+
+isc_boolean_t
+isc_serial_ge(isc_uint32_t a, isc_uint32_t b);
+/*%<
+ * Return true if 'a' >= 'b' otherwise false.
+ */
+
+isc_boolean_t
+isc_serial_eq(isc_uint32_t a, isc_uint32_t b);
+/*%<
+ * Return true if 'a' == 'b' otherwise false.
+ */
+
+isc_boolean_t
+isc_serial_ne(isc_uint32_t a, isc_uint32_t b);
+/*%<
+ * Return true if 'a' != 'b' otherwise false.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SERIAL_H */
diff --git a/lib/isc/include/isc/sha1.h b/lib/isc/include/isc/sha1.h
new file mode 100644
index 0000000..313ff96
--- /dev/null
+++ b/lib/isc/include/isc/sha1.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef ISC_SHA1_H
+#define ISC_SHA1_H 1
+
+/* $Id: sha1.h,v 1.19 2009/02/06 23:47:42 tbox Exp $ */
+
+/* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
+
+/*! \file isc/sha1.h
+ * \brief SHA-1 in C
+ * \author By Steve Reid <steve@edmweb.com>
+ * \note 100% Public Domain
+ */
+
+#include <isc/lang.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#define ISC_SHA1_DIGESTLENGTH 20U
+#define ISC_SHA1_BLOCK_LENGTH 64U
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+#include <openssl/evp.h>
+
+typedef EVP_MD_CTX isc_sha1_t;
+
+#else
+
+typedef struct {
+ isc_uint32_t state[5];
+ isc_uint32_t count[2];
+ unsigned char buffer[ISC_SHA1_BLOCK_LENGTH];
+} isc_sha1_t;
+#endif
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_sha1_init(isc_sha1_t *ctx);
+
+void
+isc_sha1_invalidate(isc_sha1_t *ctx);
+
+void
+isc_sha1_update(isc_sha1_t *ctx, const unsigned char *data, unsigned int len);
+
+void
+isc_sha1_final(isc_sha1_t *ctx, unsigned char *digest);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SHA1_H */
diff --git a/lib/isc/include/isc/sha2.h b/lib/isc/include/isc/sha2.h
new file mode 100644
index 0000000..439bbb9
--- /dev/null
+++ b/lib/isc/include/isc/sha2.h
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2005-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: sha2.h,v 1.12 2009/10/22 02:21:31 each Exp $ */
+
+/* $FreeBSD: src/sys/crypto/sha2/sha2.h,v 1.1.2.1 2001/07/03 11:01:36 ume Exp $ */
+/* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */
+
+/*
+ * sha2.h
+ *
+ * Version 1.0.0beta1
+ *
+ * Written by Aaron D. Gifford <me@aarongifford.com>
+ *
+ * Copyright 2000 Aaron D. Gifford. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef ISC_SHA2_H
+#define ISC_SHA2_H
+
+#include <isc/lang.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+
+/*** SHA-224/256/384/512 Various Length Definitions ***********************/
+
+#define ISC_SHA224_BLOCK_LENGTH 64U
+#define ISC_SHA224_DIGESTLENGTH 28U
+#define ISC_SHA224_DIGESTSTRINGLENGTH (ISC_SHA224_DIGESTLENGTH * 2 + 1)
+#define ISC_SHA256_BLOCK_LENGTH 64U
+#define ISC_SHA256_DIGESTLENGTH 32U
+#define ISC_SHA256_DIGESTSTRINGLENGTH (ISC_SHA256_DIGESTLENGTH * 2 + 1)
+#define ISC_SHA384_BLOCK_LENGTH 128
+#define ISC_SHA384_DIGESTLENGTH 48U
+#define ISC_SHA384_DIGESTSTRINGLENGTH (ISC_SHA384_DIGESTLENGTH * 2 + 1)
+#define ISC_SHA512_BLOCK_LENGTH 128U
+#define ISC_SHA512_DIGESTLENGTH 64U
+#define ISC_SHA512_DIGESTSTRINGLENGTH (ISC_SHA512_DIGESTLENGTH * 2 + 1)
+
+/*** SHA-256/384/512 Context Structures *******************************/
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+#include <openssl/evp.h>
+
+typedef EVP_MD_CTX isc_sha256_t;
+typedef EVP_MD_CTX isc_sha512_t;
+
+#else
+
+/*
+ * Keep buffer immediately after bitcount to preserve alignment.
+ */
+typedef struct {
+ isc_uint32_t state[8];
+ isc_uint64_t bitcount;
+ isc_uint8_t buffer[ISC_SHA256_BLOCK_LENGTH];
+} isc_sha256_t;
+
+/*
+ * Keep buffer immediately after bitcount to preserve alignment.
+ */
+typedef struct {
+ isc_uint64_t state[8];
+ isc_uint64_t bitcount[2];
+ isc_uint8_t buffer[ISC_SHA512_BLOCK_LENGTH];
+} isc_sha512_t;
+#endif
+
+typedef isc_sha256_t isc_sha224_t;
+typedef isc_sha512_t isc_sha384_t;
+
+ISC_LANG_BEGINDECLS
+
+/*** SHA-224/256/384/512 Function Prototypes ******************************/
+
+void isc_sha224_init (isc_sha224_t *);
+void isc_sha224_invalidate (isc_sha224_t *);
+void isc_sha224_update (isc_sha224_t *, const isc_uint8_t *, size_t);
+void isc_sha224_final (isc_uint8_t[ISC_SHA224_DIGESTLENGTH], isc_sha224_t *);
+char *isc_sha224_end (isc_sha224_t *, char[ISC_SHA224_DIGESTSTRINGLENGTH]);
+char *isc_sha224_data (const isc_uint8_t *, size_t, char[ISC_SHA224_DIGESTSTRINGLENGTH]);
+
+void isc_sha256_init (isc_sha256_t *);
+void isc_sha256_invalidate (isc_sha256_t *);
+void isc_sha256_update (isc_sha256_t *, const isc_uint8_t *, size_t);
+void isc_sha256_final (isc_uint8_t[ISC_SHA256_DIGESTLENGTH], isc_sha256_t *);
+char *isc_sha256_end (isc_sha256_t *, char[ISC_SHA256_DIGESTSTRINGLENGTH]);
+char *isc_sha256_data (const isc_uint8_t *, size_t, char[ISC_SHA256_DIGESTSTRINGLENGTH]);
+
+void isc_sha384_init (isc_sha384_t *);
+void isc_sha384_invalidate (isc_sha384_t *);
+void isc_sha384_update (isc_sha384_t *, const isc_uint8_t *, size_t);
+void isc_sha384_final (isc_uint8_t[ISC_SHA384_DIGESTLENGTH], isc_sha384_t *);
+char *isc_sha384_end (isc_sha384_t *, char[ISC_SHA384_DIGESTSTRINGLENGTH]);
+char *isc_sha384_data (const isc_uint8_t *, size_t, char[ISC_SHA384_DIGESTSTRINGLENGTH]);
+
+void isc_sha512_init (isc_sha512_t *);
+void isc_sha512_invalidate (isc_sha512_t *);
+void isc_sha512_update (isc_sha512_t *, const isc_uint8_t *, size_t);
+void isc_sha512_final (isc_uint8_t[ISC_SHA512_DIGESTLENGTH], isc_sha512_t *);
+char *isc_sha512_end (isc_sha512_t *, char[ISC_SHA512_DIGESTSTRINGLENGTH]);
+char *isc_sha512_data (const isc_uint8_t *, size_t, char[ISC_SHA512_DIGESTSTRINGLENGTH]);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SHA2_H */
diff --git a/lib/isc/include/isc/sockaddr.h b/lib/isc/include/isc/sockaddr.h
new file mode 100644
index 0000000..1e69142
--- /dev/null
+++ b/lib/isc/include/isc/sockaddr.h
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: sockaddr.h,v 1.57 2009/01/18 23:48:14 tbox Exp $ */
+
+#ifndef ISC_SOCKADDR_H
+#define ISC_SOCKADDR_H 1
+
+/*! \file isc/sockaddr.h */
+
+#include <isc/lang.h>
+#include <isc/net.h>
+#include <isc/types.h>
+#ifdef ISC_PLATFORM_HAVESYSUNH
+#include <sys/un.h>
+#endif
+
+struct isc_sockaddr {
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ struct sockaddr_un sunix;
+#endif
+ } type;
+ unsigned int length; /* XXXRTH beginning? */
+ ISC_LINK(struct isc_sockaddr) link;
+};
+
+typedef ISC_LIST(struct isc_sockaddr) isc_sockaddrlist_t;
+
+#define ISC_SOCKADDR_CMPADDR 0x0001 /*%< compare the address
+ * sin_addr/sin6_addr */
+#define ISC_SOCKADDR_CMPPORT 0x0002 /*%< compare the port
+ * sin_port/sin6_port */
+#define ISC_SOCKADDR_CMPSCOPE 0x0004 /*%< compare the scope
+ * sin6_scope */
+#define ISC_SOCKADDR_CMPSCOPEZERO 0x0008 /*%< when comparing scopes
+ * zero scopes always match */
+
+ISC_LANG_BEGINDECLS
+
+isc_boolean_t
+isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
+ unsigned int flags);
+/*%<
+ * Compare the elements of the two address ('a' and 'b') as specified
+ * by 'flags' and report if they are equal or not.
+ *
+ * 'flags' is set from ISC_SOCKADDR_CMP*.
+ */
+
+isc_boolean_t
+isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
+/*%<
+ * Return ISC_TRUE iff the socket addresses 'a' and 'b' are equal.
+ */
+
+isc_boolean_t
+isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
+/*%<
+ * Return ISC_TRUE iff the address parts of the socket addresses
+ * 'a' and 'b' are equal, ignoring the ports.
+ */
+
+isc_boolean_t
+isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
+ unsigned int prefixlen);
+/*%<
+ * Return ISC_TRUE iff the most significant 'prefixlen' bits of the
+ * socket addresses 'a' and 'b' are equal, ignoring the ports.
+ * If 'b''s scope is zero then 'a''s scope will be ignored.
+ */
+
+unsigned int
+isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only);
+/*%<
+ * Return a hash value for the socket address 'sockaddr'. If 'address_only'
+ * is ISC_TRUE, the hash value will not depend on the port.
+ *
+ * IPv6 addresses containing mapped IPv4 addresses generate the same hash
+ * value as the equivalent IPv4 address.
+ */
+
+void
+isc_sockaddr_any(isc_sockaddr_t *sockaddr);
+/*%<
+ * Return the IPv4 wildcard address.
+ */
+
+void
+isc_sockaddr_any6(isc_sockaddr_t *sockaddr);
+/*%<
+ * Return the IPv6 wildcard address.
+ */
+
+void
+isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int family);
+/*%<
+ * Set '*sockaddr' to the wildcard address of protocol family
+ * 'family'.
+ *
+ * Requires:
+ * \li 'family' is AF_INET or AF_INET6.
+ */
+
+void
+isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
+ in_port_t port);
+/*%<
+ * Construct an isc_sockaddr_t from an IPv4 address and port.
+ */
+
+void
+isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6,
+ in_port_t port);
+/*%<
+ * Construct an isc_sockaddr_t from an IPv6 address and port.
+ */
+
+void
+isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
+ in_port_t port);
+/*%<
+ * Construct an IPv6 isc_sockaddr_t representing a mapped IPv4 address.
+ */
+
+void
+isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
+ in_port_t port);
+/*%<
+ * Construct an isc_sockaddr_t from an isc_netaddr_t and port.
+ */
+
+int
+isc_sockaddr_pf(const isc_sockaddr_t *sockaddr);
+/*%<
+ * Get the protocol family of 'sockaddr'.
+ *
+ * Requires:
+ *
+ *\li 'sockaddr' is a valid sockaddr with an address family of AF_INET
+ * or AF_INET6.
+ *
+ * Returns:
+ *
+ *\li The protocol family of 'sockaddr', e.g. PF_INET or PF_INET6.
+ */
+
+void
+isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port);
+/*%<
+ * Set the port of 'sockaddr' to 'port'.
+ */
+
+in_port_t
+isc_sockaddr_getport(const isc_sockaddr_t *sockaddr);
+/*%<
+ * Get the port stored in 'sockaddr'.
+ */
+
+isc_result_t
+isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target);
+/*%<
+ * Append a text representation of 'sockaddr' to the buffer 'target'.
+ * The text will include both the IP address (v4 or v6) and the port.
+ * The text is null terminated, but the terminating null is not
+ * part of the buffer's used region.
+ *
+ * Returns:
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_NOSPACE The text or the null termination did not fit.
+ */
+
+void
+isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size);
+/*%<
+ * Format a human-readable representation of the socket address '*sa'
+ * into the character array 'array', which is of size 'size'.
+ * The resulting string is guaranteed to be null-terminated.
+ */
+
+isc_boolean_t
+isc_sockaddr_ismulticast(const isc_sockaddr_t *sa);
+/*%<
+ * Returns #ISC_TRUE if the address is a multicast address.
+ */
+
+isc_boolean_t
+isc_sockaddr_isexperimental(const isc_sockaddr_t *sa);
+/*
+ * Returns ISC_TRUE if the address is a experimental (CLASS E) address.
+ */
+
+isc_boolean_t
+isc_sockaddr_islinklocal(const isc_sockaddr_t *sa);
+/*%<
+ * Returns ISC_TRUE if the address is a link local address.
+ */
+
+isc_boolean_t
+isc_sockaddr_issitelocal(const isc_sockaddr_t *sa);
+/*%<
+ * Returns ISC_TRUE if the address is a sitelocal address.
+ */
+
+isc_result_t
+isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path);
+/*
+ * Create a UNIX domain sockaddr that refers to path.
+ *
+ * Returns:
+ * \li ISC_R_NOSPACE
+ * \li ISC_R_NOTIMPLEMENTED
+ * \li ISC_R_SUCCESS
+ */
+
+#define ISC_SOCKADDR_FORMATSIZE \
+ sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS#YYYYY")
+/*%<
+ * Minimum size of array to pass to isc_sockaddr_format().
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SOCKADDR_H */
diff --git a/lib/isc/include/isc/socket.h b/lib/isc/include/isc/socket.h
new file mode 100644
index 0000000..38f6f78
--- /dev/null
+++ b/lib/isc/include/isc/socket.h
@@ -0,0 +1,1168 @@
+/*
+ * Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_SOCKET_H
+#define ISC_SOCKET_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/socket.h
+ * \brief Provides TCP and UDP sockets for network I/O. The sockets are event
+ * sources in the task system.
+ *
+ * When I/O completes, a completion event for the socket is posted to the
+ * event queue of the task which requested the I/O.
+ *
+ * \li MP:
+ * The module ensures appropriate synchronization of data structures it
+ * creates and manipulates.
+ * Clients of this module must not be holding a socket's task's lock when
+ * making a call that affects that socket. Failure to follow this rule
+ * can result in deadlock.
+ * The caller must ensure that isc_socketmgr_destroy() is called only
+ * once for a given manager.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * TBS
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/lang.h>
+#include <isc/types.h>
+#include <isc/event.h>
+#include <isc/eventclass.h>
+#include <isc/time.h>
+#include <isc/region.h>
+#include <isc/sockaddr.h>
+#include <isc/xml.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Constants
+ ***/
+
+/*%
+ * Maximum number of buffers in a scatter/gather read/write. The operating
+ * system in use must support at least this number (plus one on some.)
+ */
+#define ISC_SOCKET_MAXSCATTERGATHER 8
+
+/*%
+ * In isc_socket_bind() set socket option SO_REUSEADDR prior to calling
+ * bind() if a non zero port is specified (AF_INET and AF_INET6).
+ */
+#define ISC_SOCKET_REUSEADDRESS 0x01U
+
+/*%
+ * Statistics counters. Used as isc_statscounter_t values.
+ */
+enum {
+ isc_sockstatscounter_udp4open = 0,
+ isc_sockstatscounter_udp6open = 1,
+ isc_sockstatscounter_tcp4open = 2,
+ isc_sockstatscounter_tcp6open = 3,
+ isc_sockstatscounter_unixopen = 4,
+
+ isc_sockstatscounter_udp4openfail = 5,
+ isc_sockstatscounter_udp6openfail = 6,
+ isc_sockstatscounter_tcp4openfail = 7,
+ isc_sockstatscounter_tcp6openfail = 8,
+ isc_sockstatscounter_unixopenfail = 9,
+
+ isc_sockstatscounter_udp4close = 10,
+ isc_sockstatscounter_udp6close = 11,
+ isc_sockstatscounter_tcp4close = 12,
+ isc_sockstatscounter_tcp6close = 13,
+ isc_sockstatscounter_unixclose = 14,
+ isc_sockstatscounter_fdwatchclose = 15,
+
+ isc_sockstatscounter_udp4bindfail = 16,
+ isc_sockstatscounter_udp6bindfail = 17,
+ isc_sockstatscounter_tcp4bindfail = 18,
+ isc_sockstatscounter_tcp6bindfail = 19,
+ isc_sockstatscounter_unixbindfail = 20,
+ isc_sockstatscounter_fdwatchbindfail = 21,
+
+ isc_sockstatscounter_udp4connect = 22,
+ isc_sockstatscounter_udp6connect = 23,
+ isc_sockstatscounter_tcp4connect = 24,
+ isc_sockstatscounter_tcp6connect = 25,
+ isc_sockstatscounter_unixconnect = 26,
+ isc_sockstatscounter_fdwatchconnect = 27,
+
+ isc_sockstatscounter_udp4connectfail = 28,
+ isc_sockstatscounter_udp6connectfail = 29,
+ isc_sockstatscounter_tcp4connectfail = 30,
+ isc_sockstatscounter_tcp6connectfail = 31,
+ isc_sockstatscounter_unixconnectfail = 32,
+ isc_sockstatscounter_fdwatchconnectfail = 33,
+
+ isc_sockstatscounter_tcp4accept = 34,
+ isc_sockstatscounter_tcp6accept = 35,
+ isc_sockstatscounter_unixaccept = 36,
+
+ isc_sockstatscounter_tcp4acceptfail = 37,
+ isc_sockstatscounter_tcp6acceptfail = 38,
+ isc_sockstatscounter_unixacceptfail = 39,
+
+ isc_sockstatscounter_udp4sendfail = 40,
+ isc_sockstatscounter_udp6sendfail = 41,
+ isc_sockstatscounter_tcp4sendfail = 42,
+ isc_sockstatscounter_tcp6sendfail = 43,
+ isc_sockstatscounter_unixsendfail = 44,
+ isc_sockstatscounter_fdwatchsendfail = 45,
+
+ isc_sockstatscounter_udp4recvfail = 46,
+ isc_sockstatscounter_udp6recvfail = 47,
+ isc_sockstatscounter_tcp4recvfail = 48,
+ isc_sockstatscounter_tcp6recvfail = 49,
+ isc_sockstatscounter_unixrecvfail = 50,
+ isc_sockstatscounter_fdwatchrecvfail = 51,
+
+ isc_sockstatscounter_max = 52
+};
+
+/***
+ *** Types
+ ***/
+
+struct isc_socketevent {
+ ISC_EVENT_COMMON(isc_socketevent_t);
+ isc_result_t result; /*%< OK, EOF, whatever else */
+ unsigned int minimum; /*%< minimum i/o for event */
+ unsigned int n; /*%< bytes read or written */
+ unsigned int offset; /*%< offset into buffer list */
+ isc_region_t region; /*%< for single-buffer i/o */
+ isc_bufferlist_t bufferlist; /*%< list of buffers */
+ isc_sockaddr_t address; /*%< source address */
+ isc_time_t timestamp; /*%< timestamp of packet recv */
+ struct in6_pktinfo pktinfo; /*%< ipv6 pktinfo */
+ isc_uint32_t attributes; /*%< see below */
+ isc_eventdestructor_t destroy; /*%< original destructor */
+};
+
+typedef struct isc_socket_newconnev isc_socket_newconnev_t;
+struct isc_socket_newconnev {
+ ISC_EVENT_COMMON(isc_socket_newconnev_t);
+ isc_socket_t * newsocket;
+ isc_result_t result; /*%< OK, EOF, whatever else */
+ isc_sockaddr_t address; /*%< source address */
+};
+
+typedef struct isc_socket_connev isc_socket_connev_t;
+struct isc_socket_connev {
+ ISC_EVENT_COMMON(isc_socket_connev_t);
+ isc_result_t result; /*%< OK, EOF, whatever else */
+};
+
+/*@{*/
+/*!
+ * _ATTACHED: Internal use only.
+ * _TRUNC: Packet was truncated on receive.
+ * _CTRUNC: Packet control information was truncated. This can
+ * indicate that the packet is not complete, even though
+ * all the data is valid.
+ * _TIMESTAMP: The timestamp member is valid.
+ * _PKTINFO: The pktinfo member is valid.
+ * _MULTICAST: The UDP packet was received via a multicast transmission.
+ */
+#define ISC_SOCKEVENTATTR_ATTACHED 0x80000000U /* internal */
+#define ISC_SOCKEVENTATTR_TRUNC 0x00800000U /* public */
+#define ISC_SOCKEVENTATTR_CTRUNC 0x00400000U /* public */
+#define ISC_SOCKEVENTATTR_TIMESTAMP 0x00200000U /* public */
+#define ISC_SOCKEVENTATTR_PKTINFO 0x00100000U /* public */
+#define ISC_SOCKEVENTATTR_MULTICAST 0x00080000U /* public */
+/*@}*/
+
+#define ISC_SOCKEVENT_ANYEVENT (0)
+#define ISC_SOCKEVENT_RECVDONE (ISC_EVENTCLASS_SOCKET + 1)
+#define ISC_SOCKEVENT_SENDDONE (ISC_EVENTCLASS_SOCKET + 2)
+#define ISC_SOCKEVENT_NEWCONN (ISC_EVENTCLASS_SOCKET + 3)
+#define ISC_SOCKEVENT_CONNECT (ISC_EVENTCLASS_SOCKET + 4)
+
+/*
+ * Internal events.
+ */
+#define ISC_SOCKEVENT_INTR (ISC_EVENTCLASS_SOCKET + 256)
+#define ISC_SOCKEVENT_INTW (ISC_EVENTCLASS_SOCKET + 257)
+
+typedef enum {
+ isc_sockettype_udp = 1,
+ isc_sockettype_tcp = 2,
+ isc_sockettype_unix = 3,
+ isc_sockettype_fdwatch = 4
+} isc_sockettype_t;
+
+/*@{*/
+/*!
+ * How a socket should be shutdown in isc_socket_shutdown() calls.
+ */
+#define ISC_SOCKSHUT_RECV 0x00000001 /*%< close read side */
+#define ISC_SOCKSHUT_SEND 0x00000002 /*%< close write side */
+#define ISC_SOCKSHUT_ALL 0x00000003 /*%< close them all */
+/*@}*/
+
+/*@{*/
+/*!
+ * What I/O events to cancel in isc_socket_cancel() calls.
+ */
+#define ISC_SOCKCANCEL_RECV 0x00000001 /*%< cancel recv */
+#define ISC_SOCKCANCEL_SEND 0x00000002 /*%< cancel send */
+#define ISC_SOCKCANCEL_ACCEPT 0x00000004 /*%< cancel accept */
+#define ISC_SOCKCANCEL_CONNECT 0x00000008 /*%< cancel connect */
+#define ISC_SOCKCANCEL_ALL 0x0000000f /*%< cancel everything */
+/*@}*/
+
+/*@{*/
+/*!
+ * Flags for isc_socket_send() and isc_socket_recv() calls.
+ */
+#define ISC_SOCKFLAG_IMMEDIATE 0x00000001 /*%< send event only if needed */
+#define ISC_SOCKFLAG_NORETRY 0x00000002 /*%< drop failed UDP sends */
+/*@}*/
+
+/*@{*/
+/*!
+ * Flags for fdwatchcreate.
+ */
+#define ISC_SOCKFDWATCH_READ 0x00000001 /*%< watch for readable */
+#define ISC_SOCKFDWATCH_WRITE 0x00000002 /*%< watch for writable */
+/*@}*/
+
+/*% Socket and socket manager methods */
+typedef struct isc_socketmgrmethods {
+ void (*destroy)(isc_socketmgr_t **managerp);
+ isc_result_t (*socketcreate)(isc_socketmgr_t *manager, int pf,
+ isc_sockettype_t type,
+ isc_socket_t **socketp);
+ isc_result_t (*fdwatchcreate)(isc_socketmgr_t *manager, int fd,
+ int flags,
+ isc_sockfdwatch_t callback,
+ void *cbarg, isc_task_t *task,
+ isc_socket_t **socketp);
+} isc_socketmgrmethods_t;
+
+typedef struct isc_socketmethods {
+ void (*attach)(isc_socket_t *socket,
+ isc_socket_t **socketp);
+ void (*detach)(isc_socket_t **socketp);
+ isc_result_t (*bind)(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
+ unsigned int options);
+ isc_result_t (*sendto)(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action,
+ const void *arg, isc_sockaddr_t *address,
+ struct in6_pktinfo *pktinfo);
+ isc_result_t (*connect)(isc_socket_t *sock, isc_sockaddr_t *addr,
+ isc_task_t *task, isc_taskaction_t action,
+ const void *arg);
+ isc_result_t (*recv)(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg);
+ void (*cancel)(isc_socket_t *sock, isc_task_t *task,
+ unsigned int how);
+ isc_result_t (*getsockname)(isc_socket_t *sock,
+ isc_sockaddr_t *addressp);
+ isc_sockettype_t (*gettype)(isc_socket_t *sock);
+ void (*ipv6only)(isc_socket_t *sock, isc_boolean_t yes);
+ isc_result_t (*fdwatchpoke)(isc_socket_t *sock, int flags);
+ isc_result_t (*dup)(isc_socket_t *socket,
+ isc_socket_t **socketp);
+ int (*getfd)(isc_socket_t *socket);
+} isc_socketmethods_t;
+
+/*%
+ * This structure is actually just the common prefix of a socket manager
+ * object implementation's version of an isc_socketmgr_t.
+ * \brief
+ * Direct use of this structure by clients is forbidden. socket implementations
+ * may change the structure. 'magic' must be ISCAPI_SOCKETMGR_MAGIC for any
+ * of the isc_socket_ routines to work. socket implementations must maintain
+ * all socket invariants.
+ * In effect, this definition is used only for non-BIND9 version ("export")
+ * of the library, and the export version does not work for win32. So, to avoid
+ * the definition conflict with win32/socket.c, we enable this definition only
+ * for non-Win32 (i.e. Unix) platforms.
+ */
+#ifndef WIN32
+struct isc_socketmgr {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_socketmgrmethods_t *methods;
+};
+#endif
+
+#define ISCAPI_SOCKETMGR_MAGIC ISC_MAGIC('A','s','m','g')
+#define ISCAPI_SOCKETMGR_VALID(m) ((m) != NULL && \
+ (m)->magic == ISCAPI_SOCKETMGR_MAGIC)
+
+/*%
+ * This is the common prefix of a socket object. The same note as
+ * that for the socketmgr structure applies.
+ */
+#ifndef WIN32
+struct isc_socket {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_socketmethods_t *methods;
+};
+#endif
+
+#define ISCAPI_SOCKET_MAGIC ISC_MAGIC('A','s','c','t')
+#define ISCAPI_SOCKET_VALID(s) ((s) != NULL && \
+ (s)->magic == ISCAPI_SOCKET_MAGIC)
+
+/***
+ *** Socket and Socket Manager Functions
+ ***
+ *** Note: all Ensures conditions apply only if the result is success for
+ *** those functions which return an isc_result.
+ ***/
+
+isc_result_t
+isc_socket_fdwatchcreate(isc_socketmgr_t *manager,
+ int fd,
+ int flags,
+ isc_sockfdwatch_t callback,
+ void *cbarg,
+ isc_task_t *task,
+ isc_socket_t **socketp);
+/*%<
+ * Create a new file descriptor watch socket managed by 'manager'.
+ *
+ * Note:
+ *
+ *\li 'fd' is the already-opened file descriptor.
+ *\li This function is not available on Windows.
+ *\li The callback function is called "in-line" - this means the function
+ * needs to return as fast as possible, as all other I/O will be suspended
+ * until the callback completes.
+ *
+ * Requires:
+ *
+ *\li 'manager' is a valid manager
+ *
+ *\li 'socketp' is a valid pointer, and *socketp == NULL
+ *
+ *\li 'fd' be opened.
+ *
+ * Ensures:
+ *
+ * '*socketp' is attached to the newly created fdwatch socket
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_NORESOURCES
+ *\li #ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_socket_fdwatchpoke(isc_socket_t *sock,
+ int flags);
+/*%<
+ * Poke a file descriptor watch socket informing the manager that it
+ * should restart watching the socket
+ *
+ * Note:
+ *
+ *\li 'sock' is the socket returned by isc_socket_fdwatchcreate
+ *
+ *\li 'flags' indicates what the manager should watch for on the socket
+ * in addition to what it may already be watching. It can be one or
+ * both of ISC_SOCKFDWATCH_READ and ISC_SOCKFDWATCH_WRITE. To
+ * temporarily disable watching on a socket the value indicating
+ * no more data should be returned from the call back routine.
+ *
+ *\li This function is not available on Windows.
+ *
+ * Requires:
+ *
+ *\li 'sock' is a valid isc socket
+ *
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ */
+
+isc_result_t
+isc_socket_create(isc_socketmgr_t *manager,
+ int pf,
+ isc_sockettype_t type,
+ isc_socket_t **socketp);
+/*%<
+ * Create a new 'type' socket managed by 'manager'.
+ *
+ * For isc_sockettype_fdwatch sockets you should use isc_socket_fdwatchcreate()
+ * rather than isc_socket_create().
+ *
+ * Note:
+ *
+ *\li 'pf' is the desired protocol family, e.g. PF_INET or PF_INET6.
+ *
+ * Requires:
+ *
+ *\li 'manager' is a valid manager
+ *
+ *\li 'socketp' is a valid pointer, and *socketp == NULL
+ *
+ *\li 'type' is not isc_sockettype_fdwatch
+ *
+ * Ensures:
+ *
+ * '*socketp' is attached to the newly created socket
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_NORESOURCES
+ *\li #ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_socket_dup(isc_socket_t *sock0, isc_socket_t **socketp);
+/*%<
+ * Duplicate an existing socket, reusing its file descriptor.
+ */
+
+void
+isc_socket_cancel(isc_socket_t *sock, isc_task_t *task,
+ unsigned int how);
+/*%<
+ * Cancel pending I/O of the type specified by "how".
+ *
+ * Note: if "task" is NULL, then the cancel applies to all tasks using the
+ * socket.
+ *
+ * Requires:
+ *
+ * \li "socket" is a valid socket
+ *
+ * \li "task" is NULL or a valid task
+ *
+ * "how" is a bitmask describing the type of cancelation to perform.
+ * The type ISC_SOCKCANCEL_ALL will cancel all pending I/O on this
+ * socket.
+ *
+ * \li ISC_SOCKCANCEL_RECV:
+ * Cancel pending isc_socket_recv() calls.
+ *
+ * \li ISC_SOCKCANCEL_SEND:
+ * Cancel pending isc_socket_send() and isc_socket_sendto() calls.
+ *
+ * \li ISC_SOCKCANCEL_ACCEPT:
+ * Cancel pending isc_socket_accept() calls.
+ *
+ * \li ISC_SOCKCANCEL_CONNECT:
+ * Cancel pending isc_socket_connect() call.
+ */
+
+void
+isc_socket_shutdown(isc_socket_t *sock, unsigned int how);
+/*%<
+ * Shutdown 'socket' according to 'how'.
+ *
+ * Requires:
+ *
+ * \li 'socket' is a valid socket.
+ *
+ * \li 'task' is NULL or is a valid task.
+ *
+ * \li If 'how' is 'ISC_SOCKSHUT_RECV' or 'ISC_SOCKSHUT_ALL' then
+ *
+ * The read queue must be empty.
+ *
+ * No further read requests may be made.
+ *
+ * \li If 'how' is 'ISC_SOCKSHUT_SEND' or 'ISC_SOCKSHUT_ALL' then
+ *
+ * The write queue must be empty.
+ *
+ * No further write requests may be made.
+ */
+
+void
+isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp);
+/*%<
+ * Attach *socketp to socket.
+ *
+ * Requires:
+ *
+ * \li 'socket' is a valid socket.
+ *
+ * \li 'socketp' points to a NULL socket.
+ *
+ * Ensures:
+ *
+ * \li *socketp is attached to socket.
+ */
+
+void
+isc_socket_detach(isc_socket_t **socketp);
+/*%<
+ * Detach *socketp from its socket.
+ *
+ * Requires:
+ *
+ * \li 'socketp' points to a valid socket.
+ *
+ * \li If '*socketp' is the last reference to the socket,
+ * then:
+ *
+ * There must be no pending I/O requests.
+ *
+ * Ensures:
+ *
+ * \li *socketp is NULL.
+ *
+ * \li If '*socketp' is the last reference to the socket,
+ * then:
+ *
+ * The socket will be shutdown (both reading and writing)
+ * for all tasks.
+ *
+ * All resources used by the socket have been freed
+ */
+
+isc_result_t
+isc_socket_open(isc_socket_t *sock);
+/*%<
+ * Open a new socket file descriptor of the given socket structure. It simply
+ * opens a new descriptor; all of the other parameters including the socket
+ * type are inherited from the existing socket. This function is provided to
+ * avoid overhead of destroying and creating sockets when many short-lived
+ * sockets are frequently opened and closed. When the efficiency is not an
+ * issue, it should be safer to detach the unused socket and re-create a new
+ * one. This optimization may not be available for some systems, in which
+ * case this function will return ISC_R_NOTIMPLEMENTED and must not be used.
+ *
+ * isc_socket_open() should not be called on sockets created by
+ * isc_socket_fdwatchcreate().
+ *
+ * Requires:
+ *
+ * \li there must be no other reference to this socket.
+ *
+ * \li 'socket' is a valid and previously closed by isc_socket_close()
+ *
+ * \li 'sock->type' is not isc_sockettype_fdwatch
+ *
+ * Returns:
+ * Same as isc_socket_create().
+ * \li ISC_R_NOTIMPLEMENTED
+ */
+
+isc_result_t
+isc_socket_close(isc_socket_t *sock);
+/*%<
+ * Close a socket file descriptor of the given socket structure. This function
+ * is provided as an alternative to destroying an unused socket when overhead
+ * destroying/re-creating sockets can be significant, and is expected to be
+ * used with isc_socket_open(). This optimization may not be available for some
+ * systems, in which case this function will return ISC_R_NOTIMPLEMENTED and
+ * must not be used.
+ *
+ * isc_socket_close() should not be called on sockets created by
+ * isc_socket_fdwatchcreate().
+ *
+ * Requires:
+ *
+ * \li The socket must have a valid descriptor.
+ *
+ * \li There must be no other reference to this socket.
+ *
+ * \li There must be no pending I/O requests.
+ *
+ * \li 'sock->type' is not isc_sockettype_fdwatch
+ *
+ * Returns:
+ * \li #ISC_R_NOTIMPLEMENTED
+ */
+
+isc_result_t
+isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp,
+ unsigned int options);
+/*%<
+ * Bind 'socket' to '*addressp'.
+ *
+ * Requires:
+ *
+ * \li 'socket' is a valid socket
+ *
+ * \li 'addressp' points to a valid isc_sockaddr.
+ *
+ * Returns:
+ *
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_NOPERM
+ * \li ISC_R_ADDRNOTAVAIL
+ * \li ISC_R_ADDRINUSE
+ * \li ISC_R_BOUND
+ * \li ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_socket_filter(isc_socket_t *sock, const char *filter);
+/*%<
+ * Inform the kernel that it should perform accept filtering.
+ * If filter is NULL the current filter will be removed.:w
+ */
+
+isc_result_t
+isc_socket_listen(isc_socket_t *sock, unsigned int backlog);
+/*%<
+ * Set listen mode on the socket. After this call, the only function that
+ * can be used (other than attach and detach) is isc_socket_accept().
+ *
+ * Notes:
+ *
+ * \li 'backlog' is as in the UNIX system call listen() and may be
+ * ignored by non-UNIX implementations.
+ *
+ * \li If 'backlog' is zero, a reasonable system default is used, usually
+ * SOMAXCONN.
+ *
+ * Requires:
+ *
+ * \li 'socket' is a valid, bound TCP socket or a valid, bound UNIX socket.
+ *
+ * Returns:
+ *
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_socket_accept(isc_socket_t *sock,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+/*%<
+ * Queue accept event. When a new connection is received, the task will
+ * get an ISC_SOCKEVENT_NEWCONN event with the sender set to the listen
+ * socket. The new socket structure is sent inside the isc_socket_newconnev_t
+ * event type, and is attached to the task 'task'.
+ *
+ * REQUIRES:
+ * \li 'socket' is a valid TCP socket that isc_socket_listen() was called
+ * on.
+ *
+ * \li 'task' is a valid task
+ *
+ * \li 'action' is a valid action
+ *
+ * RETURNS:
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_NOMEMORY
+ * \li ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addressp,
+ isc_task_t *task, isc_taskaction_t action,
+ const void *arg);
+/*%<
+ * Connect 'socket' to peer with address *saddr. When the connection
+ * succeeds, or when an error occurs, a CONNECT event with action 'action'
+ * and arg 'arg' will be posted to the event queue for 'task'.
+ *
+ * Requires:
+ *
+ * \li 'socket' is a valid TCP socket
+ *
+ * \li 'addressp' points to a valid isc_sockaddr
+ *
+ * \li 'task' is a valid task
+ *
+ * \li 'action' is a valid action
+ *
+ * Returns:
+ *
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_NOMEMORY
+ * \li ISC_R_UNEXPECTED
+ *
+ * Posted event's result code:
+ *
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_TIMEDOUT
+ * \li ISC_R_CONNREFUSED
+ * \li ISC_R_NETUNREACH
+ * \li ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp);
+/*%<
+ * Get the name of the peer connected to 'socket'.
+ *
+ * Requires:
+ *
+ * \li 'socket' is a valid TCP socket.
+ *
+ * Returns:
+ *
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_TOOSMALL
+ * \li ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp);
+/*%<
+ * Get the name of 'socket'.
+ *
+ * Requires:
+ *
+ * \li 'socket' is a valid socket.
+ *
+ * Returns:
+ *
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_TOOSMALL
+ * \li ISC_R_UNEXPECTED
+ */
+
+/*@{*/
+isc_result_t
+isc_socket_recv(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+isc_result_t
+isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ unsigned int minimum,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+
+isc_result_t
+isc_socket_recv2(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_socketevent_t *event, unsigned int flags);
+
+/*!
+ * Receive from 'socket', storing the results in region.
+ *
+ * Notes:
+ *
+ *\li Let 'length' refer to the length of 'region' or to the sum of all
+ * available regions in the list of buffers '*buflist'.
+ *
+ *\li If 'minimum' is non-zero and at least that many bytes are read,
+ * the completion event will be posted to the task 'task.' If minimum
+ * is zero, the exact number of bytes requested in the region must
+ * be read for an event to be posted. This only makes sense for TCP
+ * connections, and is always set to 1 byte for UDP.
+ *
+ *\li The read will complete when the desired number of bytes have been
+ * read, if end-of-input occurs, or if an error occurs. A read done
+ * event with the given 'action' and 'arg' will be posted to the
+ * event queue of 'task'.
+ *
+ *\li The caller may not modify 'region', the buffers which are passed
+ * into this function, or any data they refer to until the completion
+ * event is received.
+ *
+ *\li For isc_socket_recvv():
+ * On successful completion, '*buflist' will be empty, and the list of
+ * all buffers will be returned in the done event's 'bufferlist'
+ * member. On error return, '*buflist' will be unchanged.
+ *
+ *\li For isc_socket_recv2():
+ * 'event' is not NULL, and the non-socket specific fields are
+ * expected to be initialized.
+ *
+ *\li For isc_socket_recv2():
+ * The only defined value for 'flags' is ISC_SOCKFLAG_IMMEDIATE. If
+ * set and the operation completes, the return value will be
+ * ISC_R_SUCCESS and the event will be filled in and not sent. If the
+ * operation does not complete, the return value will be
+ * ISC_R_INPROGRESS and the event will be sent when the operation
+ * completes.
+ *
+ * Requires:
+ *
+ *\li 'socket' is a valid, bound socket.
+ *
+ *\li For isc_socket_recv():
+ * 'region' is a valid region
+ *
+ *\li For isc_socket_recvv():
+ * 'buflist' is non-NULL, and '*buflist' contain at least one buffer.
+ *
+ *\li 'task' is a valid task
+ *
+ *\li For isc_socket_recv() and isc_socket_recvv():
+ * action != NULL and is a valid action
+ *
+ *\li For isc_socket_recv2():
+ * event != NULL
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_INPROGRESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_UNEXPECTED
+ *
+ * Event results:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_UNEXPECTED
+ *\li XXX needs other net-type errors
+ */
+/*@}*/
+
+/*@{*/
+isc_result_t
+isc_socket_send(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+isc_result_t
+isc_socket_sendto(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
+isc_result_t
+isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+isc_result_t
+isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
+isc_result_t
+isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
+ isc_socketevent_t *event, unsigned int flags);
+
+/*!
+ * Send the contents of 'region' to the socket's peer.
+ *
+ * Notes:
+ *
+ *\li Shutting down the requestor's task *may* result in any
+ * still pending writes being dropped or completed, depending on the
+ * underlying OS implementation.
+ *
+ *\li If 'action' is NULL, then no completion event will be posted.
+ *
+ *\li The caller may not modify 'region', the buffers which are passed
+ * into this function, or any data they refer to until the completion
+ * event is received.
+ *
+ *\li For isc_socket_sendv() and isc_socket_sendtov():
+ * On successful completion, '*buflist' will be empty, and the list of
+ * all buffers will be returned in the done event's 'bufferlist'
+ * member. On error return, '*buflist' will be unchanged.
+ *
+ *\li For isc_socket_sendto2():
+ * 'event' is not NULL, and the non-socket specific fields are
+ * expected to be initialized.
+ *
+ *\li For isc_socket_sendto2():
+ * The only defined values for 'flags' are ISC_SOCKFLAG_IMMEDIATE
+ * and ISC_SOCKFLAG_NORETRY.
+ *
+ *\li If ISC_SOCKFLAG_IMMEDIATE is set and the operation completes, the
+ * return value will be ISC_R_SUCCESS and the event will be filled
+ * in and not sent. If the operation does not complete, the return
+ * value will be ISC_R_INPROGRESS and the event will be sent when
+ * the operation completes.
+ *
+ *\li ISC_SOCKFLAG_NORETRY can only be set for UDP sockets. If set
+ * and the send operation fails due to a transient error, the send
+ * will not be retried and the error will be indicated in the event.
+ * Using this option along with ISC_SOCKFLAG_IMMEDIATE allows the caller
+ * to specify a region that is allocated on the stack.
+ *
+ * Requires:
+ *
+ *\li 'socket' is a valid, bound socket.
+ *
+ *\li For isc_socket_send():
+ * 'region' is a valid region
+ *
+ *\li For isc_socket_sendv() and isc_socket_sendtov():
+ * 'buflist' is non-NULL, and '*buflist' contain at least one buffer.
+ *
+ *\li 'task' is a valid task
+ *
+ *\li For isc_socket_sendv(), isc_socket_sendtov(), isc_socket_send(), and
+ * isc_socket_sendto():
+ * action == NULL or is a valid action
+ *
+ *\li For isc_socket_sendto2():
+ * event != NULL
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_INPROGRESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_UNEXPECTED
+ *
+ * Event results:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_UNEXPECTED
+ *\li XXX needs other net-type errors
+ */
+/*@}*/
+
+isc_result_t
+isc_socketmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ isc_socketmgr_t **managerp);
+
+isc_result_t
+isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
+
+isc_result_t
+isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
+ unsigned int maxsocks);
+/*%<
+ * Create a socket manager. If "maxsocks" is non-zero, it specifies the
+ * maximum number of sockets that the created manager should handle.
+ * isc_socketmgr_create() is equivalent of isc_socketmgr_create2() with
+ * "maxsocks" being zero.
+ * isc_socketmgr_createinctx() also associates the new manager with the
+ * specified application context.
+ *
+ * Notes:
+ *
+ *\li All memory will be allocated in memory context 'mctx'.
+ *
+ * Requires:
+ *
+ *\li 'mctx' is a valid memory context.
+ *
+ *\li 'managerp' points to a NULL isc_socketmgr_t.
+ *
+ *\li 'actx' is a valid application context (for createinctx()).
+ *
+ * Ensures:
+ *
+ *\li '*managerp' is a valid isc_socketmgr_t.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_UNEXPECTED
+ *\li #ISC_R_NOTIMPLEMENTED
+ */
+
+isc_result_t
+isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp);
+/*%<
+ * Returns in "*nsockp" the maximum number of sockets this manager may open.
+ *
+ * Requires:
+ *
+ *\li '*manager' is a valid isc_socketmgr_t.
+ *\li 'nsockp' is not NULL.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOTIMPLEMENTED
+ */
+
+void
+isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats);
+/*%<
+ * Set a general socket statistics counter set 'stats' for 'manager'.
+ *
+ * Requires:
+ * \li 'manager' is valid, hasn't opened any socket, and doesn't have
+ * stats already set.
+ *
+ *\li stats is a valid statistics supporting socket statistics counters
+ * (see above).
+ */
+
+void
+isc_socketmgr_destroy(isc_socketmgr_t **managerp);
+/*%<
+ * Destroy a socket manager.
+ *
+ * Notes:
+ *
+ *\li This routine blocks until there are no sockets left in the manager,
+ * so if the caller holds any socket references using the manager, it
+ * must detach them before calling isc_socketmgr_destroy() or it will
+ * block forever.
+ *
+ * Requires:
+ *
+ *\li '*managerp' is a valid isc_socketmgr_t.
+ *
+ *\li All sockets managed by this manager are fully detached.
+ *
+ * Ensures:
+ *
+ *\li *managerp == NULL
+ *
+ *\li All resources used by the manager have been freed.
+ */
+
+isc_sockettype_t
+isc_socket_gettype(isc_socket_t *sock);
+/*%<
+ * Returns the socket type for "sock."
+ *
+ * Requires:
+ *
+ *\li "sock" is a valid socket.
+ */
+
+/*@{*/
+isc_boolean_t
+isc_socket_isbound(isc_socket_t *sock);
+
+void
+isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes);
+/*%<
+ * If the socket is an IPv6 socket set/clear the IPV6_IPV6ONLY socket
+ * option if the host OS supports this option.
+ *
+ * Requires:
+ *\li 'sock' is a valid socket.
+ */
+/*@}*/
+
+void
+isc_socket_cleanunix(isc_sockaddr_t *addr, isc_boolean_t active);
+
+/*%<
+ * Cleanup UNIX domain sockets in the file-system. If 'active' is true
+ * then just unlink the socket. If 'active' is false try to determine
+ * if there is a listener of the socket or not. If no listener is found
+ * then unlink socket.
+ *
+ * Prior to unlinking the path is tested to see if it a socket.
+ *
+ * Note: there are a number of race conditions which cannot be avoided
+ * both in the filesystem and any application using UNIX domain
+ * sockets (e.g. socket is tested between bind() and listen(),
+ * the socket is deleted and replaced in the file-system between
+ * stat() and unlink()).
+ */
+
+isc_result_t
+isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
+ isc_uint32_t owner, isc_uint32_t group);
+/*%<
+ * Set ownership and file permissions on the UNIX domain socket.
+ *
+ * Note: On Solaris and SunOS this secures the directory containing
+ * the socket as Solaris and SunOS do not honour the filesystem
+ * permissions on the socket.
+ *
+ * Requires:
+ * \li 'sockaddr' to be a valid UNIX domain sockaddr.
+ *
+ * Returns:
+ * \li #ISC_R_SUCCESS
+ * \li #ISC_R_FAILURE
+ */
+
+void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag);
+/*%<
+ * Set the name and optional tag for a socket. This allows tracking of the
+ * owner or purpose for this socket, and is useful for tracing and statistics
+ * reporting.
+ */
+
+const char *isc_socket_getname(isc_socket_t *socket);
+/*%<
+ * Get the name associated with a socket, if any.
+ */
+
+void *isc_socket_gettag(isc_socket_t *socket);
+/*%<
+ * Get the tag associated with a socket, if any.
+ */
+
+int isc_socket_getfd(isc_socket_t *socket);
+/*%<
+ * Get the file descriptor associated with a socket
+ */
+
+void
+isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t);
+/*%<
+ * Temporary. For use by named only.
+ */
+
+void
+isc__socketmgr_maxudp(isc_socketmgr_t *mgr, int maxudp);
+/*%<
+ * Test interface. Drop UDP packet > 'maxudp'.
+ */
+
+#ifdef HAVE_LIBXML2
+
+void
+isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer);
+/*%<
+ * Render internal statistics and other state into the XML document.
+ */
+
+#endif /* HAVE_LIBXML2 */
+
+#ifdef USE_SOCKETIMPREGISTER
+/*%<
+ * See isc_socketmgr_create() above.
+ */
+typedef isc_result_t
+(*isc_socketmgrcreatefunc_t)(isc_mem_t *mctx, isc_socketmgr_t **managerp);
+
+isc_result_t
+isc_socket_register(isc_socketmgrcreatefunc_t createfunc);
+/*%<
+ * Register a new socket I/O implementation and add it to the list of
+ * supported implementations. This function must be called when a different
+ * event library is used than the one contained in the ISC library.
+ */
+
+isc_result_t
+isc__socket_register(void);
+/*%<
+ * A short cut function that specifies the socket I/O module in the ISC
+ * library for isc_socket_register(). An application that uses the ISC library
+ * usually do not have to care about this function: it would call
+ * isc_lib_register(), which internally calls this function.
+ */
+#endif /* USE_SOCKETIMPREGISTER */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SOCKET_H */
diff --git a/lib/isc/include/isc/stats.h b/lib/isc/include/isc/stats.h
new file mode 100644
index 0000000..682eefd
--- /dev/null
+++ b/lib/isc/include/isc/stats.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_STATS_H
+#define ISC_STATS_H 1
+
+/*! \file isc/stats.h */
+
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/*%<
+ * Flag(s) for isc_stats_dump().
+ */
+#define ISC_STATSDUMP_VERBOSE 0x00000001 /*%< dump 0-value counters */
+
+/*%<
+ * Dump callback type.
+ */
+typedef void (*isc_stats_dumper_t)(isc_statscounter_t, isc_uint64_t, void *);
+
+isc_result_t
+isc_stats_create(isc_mem_t *mctx, isc_stats_t **statsp, int ncounters);
+/*%<
+ * Create a statistics counter structure of general type. It counts a general
+ * set of counters indexed by an ID between 0 and ncounters -1.
+ *
+ * Requires:
+ *\li 'mctx' must be a valid memory context.
+ *
+ *\li 'statsp' != NULL && '*statsp' == NULL.
+ *
+ * Returns:
+ *\li ISC_R_SUCCESS -- all ok
+ *
+ *\li anything else -- failure
+ */
+
+void
+isc_stats_attach(isc_stats_t *stats, isc_stats_t **statsp);
+/*%<
+ * Attach to a statistics set.
+ *
+ * Requires:
+ *\li 'stats' is a valid isc_stats_t.
+ *
+ *\li 'statsp' != NULL && '*statsp' == NULL
+ */
+
+void
+isc_stats_detach(isc_stats_t **statsp);
+/*%<
+ * Detaches from the statistics set.
+ *
+ * Requires:
+ *\li 'statsp' != NULL and '*statsp' is a valid isc_stats_t.
+ */
+
+int
+isc_stats_ncounters(isc_stats_t *stats);
+/*%<
+ * Returns the number of counters contained in stats.
+ *
+ * Requires:
+ *\li 'stats' is a valid isc_stats_t.
+ *
+ */
+
+void
+isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter);
+/*%<
+ * Increment the counter-th counter of stats.
+ *
+ * Requires:
+ *\li 'stats' is a valid isc_stats_t.
+ *
+ *\li counter is less than the maximum available ID for the stats specified
+ * on creation.
+ */
+
+void
+isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter);
+/*%<
+ * Decrement the counter-th counter of stats.
+ *
+ * Requires:
+ *\li 'stats' is a valid isc_stats_t.
+ */
+
+void
+isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn, void *arg,
+ unsigned int options);
+/*%<
+ * Dump the current statistics counters in a specified way. For each counter
+ * in stats, dump_fn is called with its current value and the given argument
+ * arg. By default counters that have a value of 0 is skipped; if options has
+ * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped.
+ *
+ * Requires:
+ *\li 'stats' is a valid isc_stats_t.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_STATS_H */
diff --git a/lib/isc/include/isc/stdio.h b/lib/isc/include/isc/stdio.h
new file mode 100644
index 0000000..1a7ae64
--- /dev/null
+++ b/lib/isc/include/isc/stdio.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: stdio.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_STDIO_H
+#define ISC_STDIO_H 1
+
+/*! \file isc/stdio.h */
+
+/*%
+ * These functions are wrappers around the corresponding stdio functions.
+ *
+ * They return a detailed error code in the form of an an isc_result_t. ANSI C
+ * does not guarantee that stdio functions set errno, hence these functions
+ * must use platform dependent methods (e.g., the POSIX errno) to construct the
+ * error code.
+ */
+
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+ISC_LANG_BEGINDECLS
+
+/*% Open */
+isc_result_t
+isc_stdio_open(const char *filename, const char *mode, FILE **fp);
+
+/*% Close */
+isc_result_t
+isc_stdio_close(FILE *f);
+
+/*% Seek */
+isc_result_t
+isc_stdio_seek(FILE *f, long offset, int whence);
+
+/*% Read */
+isc_result_t
+isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f,
+ size_t *nret);
+
+/*% Write */
+isc_result_t
+isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f,
+ size_t *nret);
+
+/*% Flush */
+isc_result_t
+isc_stdio_flush(FILE *f);
+
+isc_result_t
+isc_stdio_sync(FILE *f);
+/*%<
+ * Invoke fsync() on the file descriptor underlying an stdio stream, or an
+ * equivalent system-dependent operation. Note that this function has no
+ * direct counterpart in the stdio library.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_STDIO_H */
diff --git a/lib/isc/include/isc/stdlib.h b/lib/isc/include/isc/stdlib.h
new file mode 100644
index 0000000..02243f0
--- /dev/null
+++ b/lib/isc/include/isc/stdlib.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: stdlib.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_STDLIB_H
+#define ISC_STDLIB_H 1
+
+/*! \file isc/stdlib.h */
+
+#include <stdlib.h>
+
+#include <isc/lang.h>
+#include <isc/platform.h>
+
+#ifdef ISC_PLATFORM_NEEDSTRTOUL
+#define strtoul isc_strtoul
+#endif
+
+ISC_LANG_BEGINDECLS
+
+unsigned long isc_strtoul(const char *, char **, int);
+
+ISC_LANG_ENDDECLS
+
+#endif
diff --git a/lib/isc/include/isc/string.h b/lib/isc/include/isc/string.h
new file mode 100644
index 0000000..b49fdbc
--- /dev/null
+++ b/lib/isc/include/isc/string.h
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: string.h,v 1.23 2007/09/13 04:48:16 each Exp $ */
+
+#ifndef ISC_STRING_H
+#define ISC_STRING_H 1
+
+/*! \file isc/string.h */
+
+#include <isc/formatcheck.h>
+#include <isc/int.h>
+#include <isc/lang.h>
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#include <string.h>
+
+#ifdef ISC_PLATFORM_HAVESTRINGSH
+#include <strings.h>
+#endif
+
+#define ISC_STRING_MAGIC 0x5e
+
+ISC_LANG_BEGINDECLS
+
+isc_uint64_t
+isc_string_touint64(char *source, char **endp, int base);
+/*%<
+ * Convert the string pointed to by 'source' to isc_uint64_t.
+ *
+ * On successful conversion 'endp' points to the first character
+ * after conversion is complete.
+ *
+ * 'base': 0 or 2..36
+ *
+ * If base is 0 the base is computed from the string type.
+ *
+ * On error 'endp' points to 'source'.
+ */
+
+isc_result_t
+isc_string_copy(char *target, size_t size, const char *source);
+/*
+ * Copy the string pointed to by 'source' to 'target' which is a
+ * pointer to a string of at least 'size' bytes.
+ *
+ * Requires:
+ * 'target' is a pointer to a char[] of at least 'size' bytes.
+ * 'size' an integer > 0.
+ * 'source' == NULL or points to a NUL terminated string.
+ *
+ * Ensures:
+ * If result == ISC_R_SUCCESS
+ * 'target' will be a NUL terminated string of no more
+ * than 'size' bytes (including NUL).
+ *
+ * If result == ISC_R_NOSPACE
+ * 'target' is undefined.
+ *
+ * Returns:
+ * ISC_R_SUCCESS -- 'source' was successfully copied to 'target'.
+ * ISC_R_NOSPACE -- 'source' could not be copied since 'target'
+ * is too small.
+ */
+
+void
+isc_string_copy_truncate(char *target, size_t size, const char *source);
+/*
+ * Copy the string pointed to by 'source' to 'target' which is a
+ * pointer to a string of at least 'size' bytes.
+ *
+ * Requires:
+ * 'target' is a pointer to a char[] of at least 'size' bytes.
+ * 'size' an integer > 0.
+ * 'source' == NULL or points to a NUL terminated string.
+ *
+ * Ensures:
+ * 'target' will be a NUL terminated string of no more
+ * than 'size' bytes (including NUL).
+ */
+
+isc_result_t
+isc_string_append(char *target, size_t size, const char *source);
+/*
+ * Append the string pointed to by 'source' to 'target' which is a
+ * pointer to a NUL terminated string of at least 'size' bytes.
+ *
+ * Requires:
+ * 'target' is a pointer to a NUL terminated char[] of at
+ * least 'size' bytes.
+ * 'size' an integer > 0.
+ * 'source' == NULL or points to a NUL terminated string.
+ *
+ * Ensures:
+ * If result == ISC_R_SUCCESS
+ * 'target' will be a NUL terminated string of no more
+ * than 'size' bytes (including NUL).
+ *
+ * If result == ISC_R_NOSPACE
+ * 'target' is undefined.
+ *
+ * Returns:
+ * ISC_R_SUCCESS -- 'source' was successfully appended to 'target'.
+ * ISC_R_NOSPACE -- 'source' could not be appended since 'target'
+ * is too small.
+ */
+
+void
+isc_string_append_truncate(char *target, size_t size, const char *source);
+/*
+ * Append the string pointed to by 'source' to 'target' which is a
+ * pointer to a NUL terminated string of at least 'size' bytes.
+ *
+ * Requires:
+ * 'target' is a pointer to a NUL terminated char[] of at
+ * least 'size' bytes.
+ * 'size' an integer > 0.
+ * 'source' == NULL or points to a NUL terminated string.
+ *
+ * Ensures:
+ * 'target' will be a NUL terminated string of no more
+ * than 'size' bytes (including NUL).
+ */
+
+isc_result_t
+isc_string_printf(char *target, size_t size, const char *format, ...)
+ ISC_FORMAT_PRINTF(3, 4);
+/*
+ * Print 'format' to 'target' which is a pointer to a string of at least
+ * 'size' bytes.
+ *
+ * Requires:
+ * 'target' is a pointer to a char[] of at least 'size' bytes.
+ * 'size' an integer > 0.
+ * 'format' == NULL or points to a NUL terminated string.
+ *
+ * Ensures:
+ * If result == ISC_R_SUCCESS
+ * 'target' will be a NUL terminated string of no more
+ * than 'size' bytes (including NUL).
+ *
+ * If result == ISC_R_NOSPACE
+ * 'target' is undefined.
+ *
+ * Returns:
+ * ISC_R_SUCCESS -- 'format' was successfully printed to 'target'.
+ * ISC_R_NOSPACE -- 'format' could not be printed to 'target' since it
+ * is too small.
+ */
+
+void
+isc_string_printf_truncate(char *target, size_t size, const char *format, ...)
+ ISC_FORMAT_PRINTF(3, 4);
+/*
+ * Print 'format' to 'target' which is a pointer to a string of at least
+ * 'size' bytes.
+ *
+ * Requires:
+ * 'target' is a pointer to a char[] of at least 'size' bytes.
+ * 'size' an integer > 0.
+ * 'format' == NULL or points to a NUL terminated string.
+ *
+ * Ensures:
+ * 'target' will be a NUL terminated string of no more
+ * than 'size' bytes (including NUL).
+ */
+
+
+char *
+isc_string_regiondup(isc_mem_t *mctx, const isc_region_t *source);
+/*
+ * Copy the region pointed to by r to a NUL terminated string
+ * allocated from the memory context pointed to by mctx.
+ *
+ * The result should be deallocated using isc_mem_free()
+ *
+ * Requires:
+ * 'mctx' is a point to a valid memory context.
+ * 'source' is a pointer to a valid region.
+ *
+ * Returns:
+ * a pointer to a NUL terminated string or
+ * NULL if memory for the copy could not be allocated
+ *
+ */
+
+char *
+isc_string_separate(char **stringp, const char *delim);
+
+#ifdef ISC_PLATFORM_NEEDSTRSEP
+#define strsep isc_string_separate
+#endif
+
+#ifdef ISC_PLATFORM_NEEDMEMMOVE
+#define memmove(a,b,c) bcopy(b,a,c)
+#endif
+
+size_t
+isc_string_strlcpy(char *dst, const char *src, size_t size);
+
+
+#ifdef ISC_PLATFORM_NEEDSTRLCPY
+#define strlcpy isc_string_strlcpy
+#endif
+
+
+size_t
+isc_string_strlcat(char *dst, const char *src, size_t size);
+
+#ifdef ISC_PLATFORM_NEEDSTRLCAT
+#define strlcat isc_string_strlcat
+#endif
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_STRING_H */
diff --git a/lib/isc/include/isc/symtab.h b/lib/isc/include/isc/symtab.h
new file mode 100644
index 0000000..9d0e5e2
--- /dev/null
+++ b/lib/isc/include/isc/symtab.h
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2004-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_SYMTAB_H
+#define ISC_SYMTAB_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/symtab.h
+ * \brief Provides a simple memory-based symbol table.
+ *
+ * Keys are C strings, and key comparisons are case-insensitive. A type may
+ * be specified when looking up, defining, or undefining. A type value of
+ * 0 means "match any type"; any other value will only match the given
+ * type.
+ *
+ * It's possible that a client will attempt to define a <key, type, value>
+ * tuple when a tuple with the given key and type already exists in the table.
+ * What to do in this case is specified by the client. Possible policies are:
+ *
+ *\li #isc_symexists_reject Disallow the define, returning #ISC_R_EXISTS
+ *\li #isc_symexists_replace Replace the old value with the new. The
+ * undefine action (if provided) will be called
+ * with the old <key, type, value> tuple.
+ *\li #isc_symexists_add Add the new tuple, leaving the old tuple in
+ * the table. Subsequent lookups will retrieve
+ * the most-recently-defined tuple.
+ *
+ * A lookup of a key using type 0 will return the most-recently defined
+ * symbol with that key. An undefine of a key using type 0 will undefine the
+ * most-recently defined symbol with that key. Trying to define a key with
+ * type 0 is illegal.
+ *
+ * The symbol table library does not make a copy the key field, so the
+ * caller must ensure that any key it passes to isc_symtab_define() will not
+ * change until it calls isc_symtab_undefine() or isc_symtab_destroy().
+ *
+ * A user-specified action will be called (if provided) when a symbol is
+ * undefined. It can be used to free memory associated with keys and/or
+ * values.
+ *
+ * A symbol table is implemented as a hash table of lists; the size of the
+ * hash table is set by the 'size' parameter to isc_symtbl_create(). When
+ * the number of entries in the symbol table reaches three quarters of this
+ * value, the hash table is reallocated with size doubled, in order to
+ * optimize lookup performance. This has a negative effect on insertion
+ * performance, which can be mitigated by sizing the table appropriately
+ * when creating it.
+ *
+ * \li MP:
+ * The callers of this module must ensure any required synchronization.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * TBS
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/*
+ *** Symbol Tables.
+ ***/
+/*% Symbol table value. */
+typedef union isc_symvalue {
+ void * as_pointer;
+ const void * as_cpointer;
+ int as_integer;
+ unsigned int as_uinteger;
+} isc_symvalue_t;
+
+typedef void (*isc_symtabaction_t)(char *key, unsigned int type,
+ isc_symvalue_t value, void *userarg);
+/*% Symbol table exists. */
+typedef enum {
+ isc_symexists_reject = 0, /*%< Disallow the define */
+ isc_symexists_replace = 1, /*%< Replace the old value with the new */
+ isc_symexists_add = 2 /*%< Add the new tuple */
+} isc_symexists_t;
+
+ISC_LANG_BEGINDECLS
+
+/*% Create a symbol table. */
+isc_result_t
+isc_symtab_create(isc_mem_t *mctx, unsigned int size,
+ isc_symtabaction_t undefine_action, void *undefine_arg,
+ isc_boolean_t case_sensitive, isc_symtab_t **symtabp);
+
+/*% Destroy a symbol table. */
+void
+isc_symtab_destroy(isc_symtab_t **symtabp);
+
+/*% Lookup a symbol table. */
+isc_result_t
+isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type,
+ isc_symvalue_t *value);
+
+/*% Define a symbol table. */
+isc_result_t
+isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type,
+ isc_symvalue_t value, isc_symexists_t exists_policy);
+
+/*% Undefine a symbol table. */
+isc_result_t
+isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SYMTAB_H */
diff --git a/lib/isc/include/isc/task.h b/lib/isc/include/isc/task.h
new file mode 100644
index 0000000..594d80f
--- /dev/null
+++ b/lib/isc/include/isc/task.h
@@ -0,0 +1,796 @@
+/*
+ * Copyright (C) 2004-2007, 2009-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_TASK_H
+#define ISC_TASK_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/task.h
+ * \brief The task system provides a lightweight execution context, which is
+ * basically an event queue.
+
+ * When a task's event queue is non-empty, the
+ * task is runnable. A small work crew of threads, typically one per CPU,
+ * execute runnable tasks by dispatching the events on the tasks' event
+ * queues. Context switching between tasks is fast.
+ *
+ * \li MP:
+ * The module ensures appropriate synchronization of data structures it
+ * creates and manipulates.
+ * The caller must ensure that isc_taskmgr_destroy() is called only
+ * once for a given manager.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * TBS
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ *
+ * \section purge Purging and Unsending
+ *
+ * Events which have been queued for a task but not delivered may be removed
+ * from the task's event queue by purging or unsending.
+ *
+ * With both types, the caller specifies a matching pattern that selects
+ * events based upon their sender, type, and tag.
+ *
+ * Purging calls isc_event_free() on the matching events.
+ *
+ * Unsending returns a list of events that matched the pattern.
+ * The caller is then responsible for them.
+ *
+ * Consumers of events should purge, not unsend.
+ *
+ * Producers of events often want to remove events when the caller indicates
+ * it is no longer interested in the object, e.g. by canceling a timer.
+ * Sometimes this can be done by purging, but for some event types, the
+ * calls to isc_event_free() cause deadlock because the event free routine
+ * wants to acquire a lock the caller is already holding. Unsending instead
+ * of purging solves this problem. As a general rule, producers should only
+ * unsend events which they have sent.
+ */
+
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/eventclass.h>
+#include <isc/lang.h>
+#include <isc/stdtime.h>
+#include <isc/types.h>
+#include <isc/xml.h>
+
+#define ISC_TASKEVENT_FIRSTEVENT (ISC_EVENTCLASS_TASK + 0)
+#define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 1)
+#define ISC_TASKEVENT_TEST (ISC_EVENTCLASS_TASK + 1)
+#define ISC_TASKEVENT_LASTEVENT (ISC_EVENTCLASS_TASK + 65535)
+
+/*****
+ ***** Tasks.
+ *****/
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Types
+ ***/
+
+typedef enum {
+ isc_taskmgrmode_normal = 0,
+ isc_taskmgrmode_privileged
+} isc_taskmgrmode_t;
+
+/*% Task and task manager methods */
+typedef struct isc_taskmgrmethods {
+ void (*destroy)(isc_taskmgr_t **managerp);
+ void (*setmode)(isc_taskmgr_t *manager,
+ isc_taskmgrmode_t mode);
+ isc_taskmgrmode_t (*mode)(isc_taskmgr_t *manager);
+ isc_result_t (*taskcreate)(isc_taskmgr_t *manager,
+ unsigned int quantum,
+ isc_task_t **taskp);
+} isc_taskmgrmethods_t;
+
+typedef struct isc_taskmethods {
+ void (*attach)(isc_task_t *source, isc_task_t **targetp);
+ void (*detach)(isc_task_t **taskp);
+ void (*destroy)(isc_task_t **taskp);
+ void (*send)(isc_task_t *task, isc_event_t **eventp);
+ void (*sendanddetach)(isc_task_t **taskp, isc_event_t **eventp);
+ unsigned int (*unsend)(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag, isc_eventlist_t *events);
+ isc_result_t (*onshutdown)(isc_task_t *task, isc_taskaction_t action,
+ const void *arg);
+ void (*shutdown)(isc_task_t *task);
+ void (*setname)(isc_task_t *task, const char *name, void *tag);
+ unsigned int (*purgeevents)(isc_task_t *task, void *sender,
+ isc_eventtype_t type, void *tag);
+ unsigned int (*purgerange)(isc_task_t *task, void *sender,
+ isc_eventtype_t first, isc_eventtype_t last,
+ void *tag);
+ isc_result_t (*beginexclusive)(isc_task_t *task);
+ void (*endexclusive)(isc_task_t *task);
+ void (*setprivilege)(isc_task_t *task, isc_boolean_t priv);
+ isc_boolean_t (*privilege)(isc_task_t *task);
+} isc_taskmethods_t;
+
+/*%
+ * This structure is actually just the common prefix of a task manager
+ * object implementation's version of an isc_taskmgr_t.
+ * \brief
+ * Direct use of this structure by clients is forbidden. task implementations
+ * may change the structure. 'magic' must be ISCAPI_TASKMGR_MAGIC for any
+ * of the isc_task_ routines to work. task implementations must maintain
+ * all task invariants.
+ */
+struct isc_taskmgr {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_taskmgrmethods_t *methods;
+};
+
+#define ISCAPI_TASKMGR_MAGIC ISC_MAGIC('A','t','m','g')
+#define ISCAPI_TASKMGR_VALID(m) ((m) != NULL && \
+ (m)->magic == ISCAPI_TASKMGR_MAGIC)
+
+/*%
+ * This is the common prefix of a task object. The same note as
+ * that for the taskmgr structure applies.
+ */
+struct isc_task {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_taskmethods_t *methods;
+};
+
+#define ISCAPI_TASK_MAGIC ISC_MAGIC('A','t','s','t')
+#define ISCAPI_TASK_VALID(s) ((s) != NULL && \
+ (s)->magic == ISCAPI_TASK_MAGIC)
+
+isc_result_t
+isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
+ isc_task_t **taskp);
+/*%<
+ * Create a task.
+ *
+ * Notes:
+ *
+ *\li If 'quantum' is non-zero, then only that many events can be dispatched
+ * before the task must yield to other tasks waiting to execute. If
+ * quantum is zero, then the default quantum of the task manager will
+ * be used.
+ *
+ *\li The 'quantum' option may be removed from isc_task_create() in the
+ * future. If this happens, isc_task_getquantum() and
+ * isc_task_setquantum() will be provided.
+ *
+ * Requires:
+ *
+ *\li 'manager' is a valid task manager.
+ *
+ *\li taskp != NULL && *taskp == NULL
+ *
+ * Ensures:
+ *
+ *\li On success, '*taskp' is bound to the new task.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_UNEXPECTED
+ *\li #ISC_R_SHUTTINGDOWN
+ */
+
+void
+isc_task_attach(isc_task_t *source, isc_task_t **targetp);
+/*%<
+ * Attach *targetp to source.
+ *
+ * Requires:
+ *
+ *\li 'source' is a valid task.
+ *
+ *\li 'targetp' points to a NULL isc_task_t *.
+ *
+ * Ensures:
+ *
+ *\li *targetp is attached to source.
+ */
+
+void
+isc_task_detach(isc_task_t **taskp);
+/*%<
+ * Detach *taskp from its task.
+ *
+ * Requires:
+ *
+ *\li '*taskp' is a valid task.
+ *
+ * Ensures:
+ *
+ *\li *taskp is NULL.
+ *
+ *\li If '*taskp' is the last reference to the task, the task is idle (has
+ * an empty event queue), and has not been shutdown, the task will be
+ * shutdown.
+ *
+ *\li If '*taskp' is the last reference to the task and
+ * the task has been shutdown,
+ * all resources used by the task will be freed.
+ */
+
+void
+isc_task_send(isc_task_t *task, isc_event_t **eventp);
+/*%<
+ * Send '*event' to 'task'.
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *\li eventp != NULL && *eventp != NULL.
+ *
+ * Ensures:
+ *
+ *\li *eventp == NULL.
+ */
+
+void
+isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp);
+/*%<
+ * Send '*event' to '*taskp' and then detach '*taskp' from its
+ * task.
+ *
+ * Requires:
+ *
+ *\li '*taskp' is a valid task.
+ *\li eventp != NULL && *eventp != NULL.
+ *
+ * Ensures:
+ *
+ *\li *eventp == NULL.
+ *
+ *\li *taskp == NULL.
+ *
+ *\li If '*taskp' is the last reference to the task, the task is
+ * idle (has an empty event queue), and has not been shutdown,
+ * the task will be shutdown.
+ *
+ *\li If '*taskp' is the last reference to the task and
+ * the task has been shutdown,
+ * all resources used by the task will be freed.
+ */
+
+
+unsigned int
+isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag);
+/*%<
+ * Purge events from a task's event queue.
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *
+ *\li last >= first
+ *
+ * Ensures:
+ *
+ *\li Events in the event queue of 'task' whose sender is 'sender', whose
+ * type is >= first and <= last, and whose tag is 'tag' will be purged,
+ * unless they are marked as unpurgable.
+ *
+ *\li A sender of NULL will match any sender. A NULL tag matches any
+ * tag.
+ *
+ * Returns:
+ *
+ *\li The number of events purged.
+ */
+
+unsigned int
+isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag);
+/*%<
+ * Purge events from a task's event queue.
+ *
+ * Notes:
+ *
+ *\li This function is equivalent to
+ *
+ *\code
+ * isc_task_purgerange(task, sender, type, type, tag);
+ *\endcode
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *
+ * Ensures:
+ *
+ *\li Events in the event queue of 'task' whose sender is 'sender', whose
+ * type is 'type', and whose tag is 'tag' will be purged, unless they
+ * are marked as unpurgable.
+ *
+ *\li A sender of NULL will match any sender. A NULL tag matches any
+ * tag.
+ *
+ * Returns:
+ *
+ *\li The number of events purged.
+ */
+
+isc_boolean_t
+isc_task_purgeevent(isc_task_t *task, isc_event_t *event);
+/*%<
+ * Purge 'event' from a task's event queue.
+ *
+ * XXXRTH: WARNING: This method may be removed before beta.
+ *
+ * Notes:
+ *
+ *\li If 'event' is on the task's event queue, it will be purged,
+ * unless it is marked as unpurgeable. 'event' does not have to be
+ * on the task's event queue; in fact, it can even be an invalid
+ * pointer. Purging only occurs if the event is actually on the task's
+ * event queue.
+ *
+ * \li Purging never changes the state of the task.
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *
+ * Ensures:
+ *
+ *\li 'event' is not in the event queue for 'task'.
+ *
+ * Returns:
+ *
+ *\li #ISC_TRUE The event was purged.
+ *\li #ISC_FALSE The event was not in the event queue,
+ * or was marked unpurgeable.
+ */
+
+unsigned int
+isc_task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag, isc_eventlist_t *events);
+/*%<
+ * Remove events from a task's event queue.
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *
+ *\li last >= first.
+ *
+ *\li *events is a valid list.
+ *
+ * Ensures:
+ *
+ *\li Events in the event queue of 'task' whose sender is 'sender', whose
+ * type is >= first and <= last, and whose tag is 'tag' will be dequeued
+ * and appended to *events.
+ *
+ *\li A sender of NULL will match any sender. A NULL tag matches any
+ * tag.
+ *
+ * Returns:
+ *
+ *\li The number of events unsent.
+ */
+
+unsigned int
+isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag, isc_eventlist_t *events);
+/*%<
+ * Remove events from a task's event queue.
+ *
+ * Notes:
+ *
+ *\li This function is equivalent to
+ *
+ *\code
+ * isc_task_unsendrange(task, sender, type, type, tag, events);
+ *\endcode
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *
+ *\li *events is a valid list.
+ *
+ * Ensures:
+ *
+ *\li Events in the event queue of 'task' whose sender is 'sender', whose
+ * type is 'type', and whose tag is 'tag' will be dequeued and appended
+ * to *events.
+ *
+ * Returns:
+ *
+ *\li The number of events unsent.
+ */
+
+isc_result_t
+isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action,
+ const void *arg);
+/*%<
+ * Send a shutdown event with action 'action' and argument 'arg' when
+ * 'task' is shutdown.
+ *
+ * Notes:
+ *
+ *\li Shutdown events are posted in LIFO order.
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *
+ *\li 'action' is a valid task action.
+ *
+ * Ensures:
+ *
+ *\li When the task is shutdown, shutdown events requested with
+ * isc_task_onshutdown() will be appended to the task's event queue.
+ *
+
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_TASKSHUTTINGDOWN Task is shutting down.
+ */
+
+void
+isc_task_shutdown(isc_task_t *task);
+/*%<
+ * Shutdown 'task'.
+ *
+ * Notes:
+ *
+ *\li Shutting down a task causes any shutdown events requested with
+ * isc_task_onshutdown() to be posted (in LIFO order). The task
+ * moves into a "shutting down" mode which prevents further calls
+ * to isc_task_onshutdown().
+ *
+ *\li Trying to shutdown a task that has already been shutdown has no
+ * effect.
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ *
+ * Ensures:
+ *
+ *\li Any shutdown events requested with isc_task_onshutdown() have been
+ * posted (in LIFO order).
+ */
+
+void
+isc_task_destroy(isc_task_t **taskp);
+/*%<
+ * Destroy '*taskp'.
+ *
+ * Notes:
+ *
+ *\li This call is equivalent to:
+ *
+ *\code
+ * isc_task_shutdown(*taskp);
+ * isc_task_detach(taskp);
+ *\endcode
+ *
+ * Requires:
+ *
+ * '*taskp' is a valid task.
+ *
+ * Ensures:
+ *
+ *\li Any shutdown events requested with isc_task_onshutdown() have been
+ * posted (in LIFO order).
+ *
+ *\li *taskp == NULL
+ *
+ *\li If '*taskp' is the last reference to the task,
+ * all resources used by the task will be freed.
+ */
+
+void
+isc_task_setname(isc_task_t *task, const char *name, void *tag);
+/*%<
+ * Name 'task'.
+ *
+ * Notes:
+ *
+ *\li Only the first 15 characters of 'name' will be copied.
+ *
+ *\li Naming a task is currently only useful for debugging purposes.
+ *
+ * Requires:
+ *
+ *\li 'task' is a valid task.
+ */
+
+const char *
+isc_task_getname(isc_task_t *task);
+/*%<
+ * Get the name of 'task', as previously set using isc_task_setname().
+ *
+ * Notes:
+ *\li This function is for debugging purposes only.
+ *
+ * Requires:
+ *\li 'task' is a valid task.
+ *
+ * Returns:
+ *\li A non-NULL pointer to a null-terminated string.
+ * If the task has not been named, the string is
+ * empty.
+ *
+ */
+
+void *
+isc_task_gettag(isc_task_t *task);
+/*%<
+ * Get the tag value for 'task', as previously set using isc_task_settag().
+ *
+ * Notes:
+ *\li This function is for debugging purposes only.
+ *
+ * Requires:
+ *\li 'task' is a valid task.
+ */
+
+isc_result_t
+isc_task_beginexclusive(isc_task_t *task);
+/*%<
+ * Request exclusive access for 'task', which must be the calling
+ * task. Waits for any other concurrently executing tasks to finish their
+ * current event, and prevents any new events from executing in any of the
+ * tasks sharing a task manager with 'task'.
+ *
+ * The exclusive access must be relinquished by calling
+ * isc_task_endexclusive() before returning from the current event handler.
+ *
+ * Requires:
+ *\li 'task' is the calling task.
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS The current task now has exclusive access.
+ *\li #ISC_R_LOCKBUSY Another task has already requested exclusive
+ * access.
+ */
+
+void
+isc_task_endexclusive(isc_task_t *task);
+/*%<
+ * Relinquish the exclusive access obtained by isc_task_beginexclusive(),
+ * allowing other tasks to execute.
+ *
+ * Requires:
+ *\li 'task' is the calling task, and has obtained
+ * exclusive access by calling isc_task_spl().
+ */
+
+void
+isc_task_getcurrenttime(isc_task_t *task, isc_stdtime_t *t);
+/*%<
+ * Provide the most recent timestamp on the task. The timestamp is considered
+ * as the "current time" in the second-order granularity.
+ *
+ * Requires:
+ *\li 'task' is a valid task.
+ *\li 't' is a valid non NULL pointer.
+ *
+ * Ensures:
+ *\li '*t' has the "current time".
+ */
+
+isc_boolean_t
+isc_task_exiting(isc_task_t *t);
+/*%<
+ * Returns ISC_TRUE if the task is in the process of shutting down,
+ * ISC_FALSE otherwise.
+ *
+ * Requires:
+ *\li 'task' is a valid task.
+ */
+
+void
+isc_task_setprivilege(isc_task_t *task, isc_boolean_t priv);
+/*%<
+ * Set or unset the task's "privileged" flag depending on the value of
+ * 'priv'.
+ *
+ * Under normal circumstances this flag has no effect on the task behavior,
+ * but when the task manager has been set to privileged exeuction mode via
+ * isc_taskmgr_setmode(), only tasks with the flag set will be executed,
+ * and all other tasks will wait until they're done. Once all privileged
+ * tasks have finished executing, the task manager will automatically
+ * return to normal execution mode and nonprivileged task can resume.
+ *
+ * Requires:
+ *\li 'task' is a valid task.
+ */
+
+isc_boolean_t
+isc_task_privilege(isc_task_t *task);
+/*%<
+ * Returns the current value of the task's privilege flag.
+ *
+ * Requires:
+ *\li 'task' is a valid task.
+ */
+
+/*****
+ ***** Task Manager.
+ *****/
+
+isc_result_t
+isc_taskmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ unsigned int workers, unsigned int default_quantum,
+ isc_taskmgr_t **managerp);
+isc_result_t
+isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
+ unsigned int default_quantum, isc_taskmgr_t **managerp);
+/*%<
+ * Create a new task manager. isc_taskmgr_createinctx() also associates
+ * the new manager with the specified application context.
+ *
+ * Notes:
+ *
+ *\li 'workers' in the number of worker threads to create. In general,
+ * the value should be close to the number of processors in the system.
+ * The 'workers' value is advisory only. An attempt will be made to
+ * create 'workers' threads, but if at least one thread creation
+ * succeeds, isc_taskmgr_create() may return ISC_R_SUCCESS.
+ *
+ *\li If 'default_quantum' is non-zero, then it will be used as the default
+ * quantum value when tasks are created. If zero, then an implementation
+ * defined default quantum will be used.
+ *
+ * Requires:
+ *
+ *\li 'mctx' is a valid memory context.
+ *
+ *\li workers > 0
+ *
+ *\li managerp != NULL && *managerp == NULL
+ *
+ *\li 'actx' is a valid application context (for createinctx()).
+ *
+ * Ensures:
+ *
+ *\li On success, '*managerp' will be attached to the newly created task
+ * manager.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_NOTHREADS No threads could be created.
+ *\li #ISC_R_UNEXPECTED An unexpected error occurred.
+ *\li #ISC_R_SHUTTINGDOWN The non-threaded, shared, task
+ * manager shutting down.
+ */
+
+void
+isc_taskmgr_setmode(isc_taskmgr_t *manager, isc_taskmgrmode_t mode);
+
+isc_taskmgrmode_t
+isc_taskmgr_mode(isc_taskmgr_t *manager);
+/*%<
+ * Set/get the current operating mode of the task manager. Valid modes are:
+ *
+ *\li isc_taskmgrmode_normal
+ *\li isc_taskmgrmode_privileged
+ *
+ * In privileged execution mode, only tasks that have had the "privilege"
+ * flag set via isc_task_setprivilege() can be executed. When all such
+ * tasks are complete, the manager automatically returns to normal mode
+ * and proceeds with running non-privileged ready tasks. This means it is
+ * necessary to have at least one privileged task waiting on the ready
+ * queue *before* setting the manager into privileged execution mode,
+ * which in turn means the task which calls this function should be in
+ * task-exclusive mode when it does so.
+ *
+ * Requires:
+ *
+ *\li 'manager' is a valid task manager.
+ */
+
+void
+isc_taskmgr_destroy(isc_taskmgr_t **managerp);
+/*%<
+ * Destroy '*managerp'.
+ *
+ * Notes:
+ *
+ *\li Calling isc_taskmgr_destroy() will shutdown all tasks managed by
+ * *managerp that haven't already been shutdown. The call will block
+ * until all tasks have entered the done state.
+ *
+ *\li isc_taskmgr_destroy() must not be called by a task event action,
+ * because it would block forever waiting for the event action to
+ * complete. An event action that wants to cause task manager shutdown
+ * should request some non-event action thread of execution to do the
+ * shutdown, e.g. by signaling a condition variable or using
+ * isc_app_shutdown().
+ *
+ *\li Task manager references are not reference counted, so the caller
+ * must ensure that no attempt will be made to use the manager after
+ * isc_taskmgr_destroy() returns.
+ *
+ * Requires:
+ *
+ *\li '*managerp' is a valid task manager.
+ *
+ *\li isc_taskmgr_destroy() has not be called previously on '*managerp'.
+ *
+ * Ensures:
+ *
+ *\li All resources used by the task manager, and any tasks it managed,
+ * have been freed.
+ */
+
+#ifdef HAVE_LIBXML2
+
+void
+isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer);
+
+#endif
+
+/*%<
+ * See isc_taskmgr_create() above.
+ */
+typedef isc_result_t
+(*isc_taskmgrcreatefunc_t)(isc_mem_t *mctx, unsigned int workers,
+ unsigned int default_quantum,
+ isc_taskmgr_t **managerp);
+
+isc_result_t
+isc_task_register(isc_taskmgrcreatefunc_t createfunc);
+/*%<
+ * Register a new task management implementation and add it to the list of
+ * supported implementations. This function must be called when a different
+ * event library is used than the one contained in the ISC library.
+ */
+
+isc_result_t
+isc__task_register(void);
+/*%<
+ * A short cut function that specifies the task management module in the ISC
+ * library for isc_task_register(). An application that uses the ISC library
+ * usually do not have to care about this function: it would call
+ * isc_lib_register(), which internally calls this function.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_TASK_H */
diff --git a/lib/isc/include/isc/taskpool.h b/lib/isc/include/isc/taskpool.h
new file mode 100644
index 0000000..46f395e
--- /dev/null
+++ b/lib/isc/include/isc/taskpool.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2004-2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_TASKPOOL_H
+#define ISC_TASKPOOL_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/taskpool.h
+ * \brief A task pool is a mechanism for sharing a small number of tasks
+ * among a large number of objects such that each object is
+ * assigned a unique task, but each task may be shared by several
+ * objects.
+ *
+ * Task pools are used to let objects that can exist in large
+ * numbers (e.g., zones) use tasks for synchronization without
+ * the memory overhead and unfair scheduling competition that
+ * could result from creating a separate task for each object.
+ */
+
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/lang.h>
+#include <isc/task.h>
+
+ISC_LANG_BEGINDECLS
+
+/*****
+ ***** Types.
+ *****/
+
+typedef struct isc_taskpool isc_taskpool_t;
+
+/*****
+ ***** Functions.
+ *****/
+
+isc_result_t
+isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx,
+ unsigned int ntasks, unsigned int quantum,
+ isc_taskpool_t **poolp);
+/*%<
+ * Create a task pool of "ntasks" tasks, each with quantum
+ * "quantum".
+ *
+ * Requires:
+ *
+ *\li 'tmgr' is a valid task manager.
+ *
+ *\li 'mctx' is a valid memory context.
+ *
+ *\li poolp != NULL && *poolp == NULL
+ *
+ * Ensures:
+ *
+ *\li On success, '*taskp' points to the new task pool.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS
+ *\li #ISC_R_NOMEMORY
+ *\li #ISC_R_UNEXPECTED
+ */
+
+void
+isc_taskpool_gettask(isc_taskpool_t *pool, isc_task_t **targetp);
+/*%<
+ * Attach to a task from the pool. Currently the next task is chosen
+ * from the pool at random. (This may be changed in the future to
+ * something that guaratees balance.)
+ */
+
+int
+isc_taskpool_size(isc_taskpool_t *pool);
+/*%<
+ * Returns the number of tasks in the task pool 'pool'.
+ */
+
+isc_result_t
+isc_taskpool_expand(isc_taskpool_t **sourcep, unsigned int size,
+ isc_taskpool_t **targetp);
+
+/*%<
+ * If 'size' is larger than the number of tasks in the pool pointed to by
+ * 'sourcep', then a new taskpool of size 'size' is allocated, the existing
+ * tasks from are moved into it, additional tasks are created to bring the
+ * total number up to 'size', and the resulting pool is attached to
+ * 'targetp'.
+ *
+ * If 'size' is less than or equal to the tasks in pool 'source', then
+ * 'sourcep' is attached to 'targetp' without any other action being taken.
+ *
+ * In either case, 'sourcep' is detached.
+ *
+ * Requires:
+ *
+ * \li 'sourcep' is not NULL and '*source' is not NULL
+ * \li 'targetp' is not NULL and '*source' is NULL
+ *
+ * Ensures:
+ *
+ * \li On success, '*targetp' points to a valid task pool.
+ * \li On success, '*sourcep' points to NULL.
+ *
+ * Returns:
+ *
+ * \li #ISC_R_SUCCESS
+ * \li #ISC_R_NOMEMORY
+ */
+
+void
+isc_taskpool_destroy(isc_taskpool_t **poolp);
+/*%<
+ * Destroy a task pool. The tasks in the pool are detached but not
+ * shut down.
+ *
+ * Requires:
+ * \li '*poolp' is a valid task pool.
+ */
+
+void
+isc_taskpool_setprivilege(isc_taskpool_t *pool, isc_boolean_t priv);
+/*%<
+ * Set the privilege flag on all tasks in 'pool' to 'priv'. If 'priv' is
+ * true, then when the task manager is set into privileged mode, only
+ * tasks wihin this pool will be able to execute. (Note: It is important
+ * to turn the pool tasks' privilege back off before the last task finishes
+ * executing.)
+ *
+ * Requires:
+ * \li 'pool' is a valid task pool.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_TASKPOOL_H */
diff --git a/lib/isc/include/isc/timer.h b/lib/isc/include/isc/timer.h
new file mode 100644
index 0000000..fa9abb1
--- /dev/null
+++ b/lib/isc/include/isc/timer.h
@@ -0,0 +1,431 @@
+/*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: timer.h,v 1.43 2009/09/02 23:48:03 tbox Exp $ */
+
+#ifndef ISC_TIMER_H
+#define ISC_TIMER_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file isc/timer.h
+ * \brief Provides timers which are event sources in the task system.
+ *
+ * Three types of timers are supported:
+ *
+ *\li 'ticker' timers generate a periodic tick event.
+ *
+ *\li 'once' timers generate an idle timeout event if they are idle for too
+ * long, and generate a life timeout event if their lifetime expires.
+ * They are used to implement both (possibly expiring) idle timers and
+ * 'one-shot' timers.
+ *
+ *\li 'limited' timers generate a periodic tick event until they reach
+ * their lifetime when they generate a life timeout event.
+ *
+ *\li 'inactive' timers generate no events.
+ *
+ * Timers can change type. It is typical to create a timer as
+ * an 'inactive' timer and then change it into a 'ticker' or
+ * 'once' timer.
+ *
+ *\li MP:
+ * The module ensures appropriate synchronization of data structures it
+ * creates and manipulates.
+ * Clients of this module must not be holding a timer's task's lock when
+ * making a call that affects that timer. Failure to follow this rule
+ * can result in deadlock.
+ * The caller must ensure that isc_timermgr_destroy() is called only
+ * once for a given manager.
+ *
+ * \li Reliability:
+ * No anticipated impact.
+ *
+ * \li Resources:
+ * TBS
+ *
+ * \li Security:
+ * No anticipated impact.
+ *
+ * \li Standards:
+ * None.
+ */
+
+
+/***
+ *** Imports
+ ***/
+
+#include <isc/types.h>
+#include <isc/event.h>
+#include <isc/eventclass.h>
+#include <isc/lang.h>
+#include <isc/time.h>
+
+ISC_LANG_BEGINDECLS
+
+/***
+ *** Types
+ ***/
+
+/*% Timer Type */
+typedef enum {
+ isc_timertype_ticker = 0, /*%< Ticker */
+ isc_timertype_once = 1, /*%< Once */
+ isc_timertype_limited = 2, /*%< Limited */
+ isc_timertype_inactive = 3 /*%< Inactive */
+} isc_timertype_t;
+
+typedef struct isc_timerevent {
+ struct isc_event common;
+ isc_time_t due;
+} isc_timerevent_t;
+
+#define ISC_TIMEREVENT_FIRSTEVENT (ISC_EVENTCLASS_TIMER + 0)
+#define ISC_TIMEREVENT_TICK (ISC_EVENTCLASS_TIMER + 1)
+#define ISC_TIMEREVENT_IDLE (ISC_EVENTCLASS_TIMER + 2)
+#define ISC_TIMEREVENT_LIFE (ISC_EVENTCLASS_TIMER + 3)
+#define ISC_TIMEREVENT_LASTEVENT (ISC_EVENTCLASS_TIMER + 65535)
+
+/*% Timer and timer manager methods */
+typedef struct {
+ void (*destroy)(isc_timermgr_t **managerp);
+ isc_result_t (*timercreate)(isc_timermgr_t *manager,
+ isc_timertype_t type,
+ isc_time_t *expires,
+ isc_interval_t *interval,
+ isc_task_t *task,
+ isc_taskaction_t action,
+ const void *arg,
+ isc_timer_t **timerp);
+} isc_timermgrmethods_t;
+
+typedef struct {
+ void (*attach)(isc_timer_t *timer, isc_timer_t **timerp);
+ void (*detach)(isc_timer_t **timerp);
+ isc_result_t (*reset)(isc_timer_t *timer, isc_timertype_t type,
+ isc_time_t *expires, isc_interval_t *interval,
+ isc_boolean_t purge);
+ isc_result_t (*touch)(isc_timer_t *timer);
+} isc_timermethods_t;
+
+/*%
+ * This structure is actually just the common prefix of a timer manager
+ * object implementation's version of an isc_timermgr_t.
+ * \brief
+ * Direct use of this structure by clients is forbidden. timer implementations
+ * may change the structure. 'magic' must be ISCAPI_TIMERMGR_MAGIC for any
+ * of the isc_timer_ routines to work. timer implementations must maintain
+ * all timer invariants.
+ */
+struct isc_timermgr {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_timermgrmethods_t *methods;
+};
+
+#define ISCAPI_TIMERMGR_MAGIC ISC_MAGIC('A','t','m','g')
+#define ISCAPI_TIMERMGR_VALID(m) ((m) != NULL && \
+ (m)->magic == ISCAPI_TIMERMGR_MAGIC)
+
+/*%
+ * This is the common prefix of a timer object. The same note as
+ * that for the timermgr structure applies.
+ */
+struct isc_timer {
+ unsigned int impmagic;
+ unsigned int magic;
+ isc_timermethods_t *methods;
+};
+
+#define ISCAPI_TIMER_MAGIC ISC_MAGIC('A','t','m','r')
+#define ISCAPI_TIMER_VALID(s) ((s) != NULL && \
+ (s)->magic == ISCAPI_TIMER_MAGIC)
+
+/***
+ *** Timer and Timer Manager Functions
+ ***
+ *** Note: all Ensures conditions apply only if the result is success for
+ *** those functions which return an isc_result_t.
+ ***/
+
+isc_result_t
+isc_timer_create(isc_timermgr_t *manager,
+ isc_timertype_t type,
+ isc_time_t *expires,
+ isc_interval_t *interval,
+ isc_task_t *task,
+ isc_taskaction_t action,
+ const void *arg,
+ isc_timer_t **timerp);
+/*%<
+ * Create a new 'type' timer managed by 'manager'. The timers parameters
+ * are specified by 'expires' and 'interval'. Events will be posted to
+ * 'task' and when dispatched 'action' will be called with 'arg' as the
+ * arg value. The new timer is returned in 'timerp'.
+ *
+ * Notes:
+ *
+ *\li For ticker timers, the timer will generate a 'tick' event every
+ * 'interval' seconds. The value of 'expires' is ignored.
+ *
+ *\li For once timers, 'expires' specifies the time when a life timeout
+ * event should be generated. If 'expires' is 0 (the epoch), then no life
+ * timeout will be generated. 'interval' specifies how long the timer
+ * can be idle before it generates an idle timeout. If 0, then no
+ * idle timeout will be generated.
+ *
+ *\li If 'expires' is NULL, the epoch will be used.
+ *
+ * If 'interval' is NULL, the zero interval will be used.
+ *
+ * Requires:
+ *
+ *\li 'manager' is a valid manager
+ *
+ *\li 'task' is a valid task
+ *
+ *\li 'action' is a valid action
+ *
+ *\li 'expires' points to a valid time, or is NULL.
+ *
+ *\li 'interval' points to a valid interval, or is NULL.
+ *
+ *\li type == isc_timertype_inactive ||
+ * ('expires' and 'interval' are not both 0)
+ *
+ *\li 'timerp' is a valid pointer, and *timerp == NULL
+ *
+ * Ensures:
+ *
+ *\li '*timerp' is attached to the newly created timer
+ *
+ *\li The timer is attached to the task
+ *
+ *\li An idle timeout will not be generated until at least Now + the
+ * timer's interval if 'timer' is a once timer with a non-zero
+ * interval.
+ *
+ * Returns:
+ *
+ *\li Success
+ *\li No memory
+ *\li Unexpected error
+ */
+
+isc_result_t
+isc_timer_reset(isc_timer_t *timer,
+ isc_timertype_t type,
+ isc_time_t *expires,
+ isc_interval_t *interval,
+ isc_boolean_t purge);
+/*%<
+ * Change the timer's type, expires, and interval values to the given
+ * values. If 'purge' is TRUE, any pending events from this timer
+ * are purged from its task's event queue.
+ *
+ * Notes:
+ *
+ *\li If 'expires' is NULL, the epoch will be used.
+ *
+ *\li If 'interval' is NULL, the zero interval will be used.
+ *
+ * Requires:
+ *
+ *\li 'timer' is a valid timer
+ *
+ *\li The same requirements that isc_timer_create() imposes on 'type',
+ * 'expires' and 'interval' apply.
+ *
+ * Ensures:
+ *
+ *\li An idle timeout will not be generated until at least Now + the
+ * timer's interval if 'timer' is a once timer with a non-zero
+ * interval.
+ *
+ * Returns:
+ *
+ *\li Success
+ *\li No memory
+ *\li Unexpected error
+ */
+
+isc_result_t
+isc_timer_touch(isc_timer_t *timer);
+/*%<
+ * Set the last-touched time of 'timer' to the current time.
+ *
+ * Requires:
+ *
+ *\li 'timer' is a valid once timer.
+ *
+ * Ensures:
+ *
+ *\li An idle timeout will not be generated until at least Now + the
+ * timer's interval if 'timer' is a once timer with a non-zero
+ * interval.
+ *
+ * Returns:
+ *
+ *\li Success
+ *\li Unexpected error
+ */
+
+void
+isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp);
+/*%<
+ * Attach *timerp to timer.
+ *
+ * Requires:
+ *
+ *\li 'timer' is a valid timer.
+ *
+ *\li 'timerp' points to a NULL timer.
+ *
+ * Ensures:
+ *
+ *\li *timerp is attached to timer.
+ */
+
+void
+isc_timer_detach(isc_timer_t **timerp);
+/*%<
+ * Detach *timerp from its timer.
+ *
+ * Requires:
+ *
+ *\li 'timerp' points to a valid timer.
+ *
+ * Ensures:
+ *
+ *\li *timerp is NULL.
+ *
+ *\li If '*timerp' is the last reference to the timer,
+ * then:
+ *
+ *\code
+ * The timer will be shutdown
+ *
+ * The timer will detach from its task
+ *
+ * All resources used by the timer have been freed
+ *
+ * Any events already posted by the timer will be purged.
+ * Therefore, if isc_timer_detach() is called in the context
+ * of the timer's task, it is guaranteed that no more
+ * timer event callbacks will run after the call.
+ *\endcode
+ */
+
+isc_timertype_t
+isc_timer_gettype(isc_timer_t *timer);
+/*%<
+ * Return the timer type.
+ *
+ * Requires:
+ *
+ *\li 'timer' to be a valid timer.
+ */
+
+isc_result_t
+isc_timermgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ isc_timermgr_t **managerp);
+
+isc_result_t
+isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp);
+/*%<
+ * Create a timer manager. isc_timermgr_createinctx() also associates
+ * the new manager with the specified application context.
+ *
+ * Notes:
+ *
+ *\li All memory will be allocated in memory context 'mctx'.
+ *
+ * Requires:
+ *
+ *\li 'mctx' is a valid memory context.
+ *
+ *\li 'managerp' points to a NULL isc_timermgr_t.
+ *
+ *\li 'actx' is a valid application context (for createinctx()).
+ *
+ * Ensures:
+ *
+ *\li '*managerp' is a valid isc_timermgr_t.
+ *
+ * Returns:
+ *
+ *\li Success
+ *\li No memory
+ *\li Unexpected error
+ */
+
+void
+isc_timermgr_destroy(isc_timermgr_t **managerp);
+/*%<
+ * Destroy a timer manager.
+ *
+ * Notes:
+ *
+ *\li This routine blocks until there are no timers left in the manager,
+ * so if the caller holds any timer references using the manager, it
+ * must detach them before calling isc_timermgr_destroy() or it will
+ * block forever.
+ *
+ * Requires:
+ *
+ *\li '*managerp' is a valid isc_timermgr_t.
+ *
+ * Ensures:
+ *
+ *\li *managerp == NULL
+ *
+ *\li All resources used by the manager have been freed.
+ */
+
+void isc_timermgr_poke(isc_timermgr_t *m);
+
+#ifdef USE_TIMERIMPREGISTER
+/*%<
+ * See isc_timermgr_create() above.
+ */
+typedef isc_result_t
+(*isc_timermgrcreatefunc_t)(isc_mem_t *mctx, isc_timermgr_t **managerp);
+
+isc_result_t
+isc__timer_register(void);
+/*%<
+ * Register a new timer management implementation and add it to the list of
+ * supported implementations. This function must be called when a different
+ * event library is used than the one contained in the ISC library.
+ */
+
+isc_result_t
+isc_timer_register(isc_timermgrcreatefunc_t createfunc);
+/*%<
+ * A short cut function that specifies the timer management module in the ISC
+ * library for isc_timer_register(). An application that uses the ISC library
+ * usually do not have to care about this function: it would call
+ * isc_lib_register(), which internally calls this function.
+ */
+#endif /* USE_TIMERIMPREGISTER */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_TIMER_H */
diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h
new file mode 100644
index 0000000..8dbf67e
--- /dev/null
+++ b/lib/isc/include/isc/types.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2004-2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_TYPES_H
+#define ISC_TYPES_H 1
+
+#include <isc/bind9.h>
+#include <isc/namespace.h>
+
+/*! \file isc/types.h
+ * \brief
+ * OS-specific types, from the OS-specific include directories.
+ */
+#include <isc/int.h>
+#include <isc/offset.h>
+
+/*
+ * XXXDCL should isc_boolean_t be moved here, requiring an explicit include
+ * of <isc/boolean.h> when ISC_TRUE/ISC_FALSE/ISC_TF() are desired?
+ */
+#include <isc/boolean.h>
+/*
+ * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other
+ * list macros too.
+ */
+#include <isc/list.h>
+
+/* Core Types. Alphabetized by defined type. */
+
+typedef struct isc_appctx isc_appctx_t; /*%< Application context */
+typedef struct isc_backtrace_symmap isc_backtrace_symmap_t; /*%< Symbol Table Entry */
+typedef struct isc_bitstring isc_bitstring_t; /*%< Bitstring */
+typedef struct isc_buffer isc_buffer_t; /*%< Buffer */
+typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t; /*%< Buffer List */
+typedef struct isc_constregion isc_constregion_t; /*%< Const region */
+typedef struct isc_consttextregion isc_consttextregion_t; /*%< Const Text Region */
+typedef struct isc_entropy isc_entropy_t; /*%< Entropy */
+typedef struct isc_entropysource isc_entropysource_t; /*%< Entropy Source */
+typedef struct isc_event isc_event_t; /*%< Event */
+typedef ISC_LIST(isc_event_t) isc_eventlist_t; /*%< Event List */
+typedef unsigned int isc_eventtype_t; /*%< Event Type */
+typedef isc_uint32_t isc_fsaccess_t; /*%< FS Access */
+typedef struct isc_hash isc_hash_t; /*%< Hash */
+typedef struct isc_httpd isc_httpd_t; /*%< HTTP client */
+typedef void (isc_httpdfree_t)(isc_buffer_t *, void *); /*%< HTTP free function */
+typedef struct isc_httpdmgr isc_httpdmgr_t; /*%< HTTP manager */
+typedef struct isc_httpdurl isc_httpdurl_t; /*%< HTTP URL */
+typedef void (isc_httpdondestroy_t)(void *); /*%< Callback on destroying httpd */
+typedef struct isc_interface isc_interface_t; /*%< Interface */
+typedef struct isc_interfaceiter isc_interfaceiter_t; /*%< Interface Iterator */
+typedef struct isc_interval isc_interval_t; /*%< Interval */
+typedef struct isc_lex isc_lex_t; /*%< Lex */
+typedef struct isc_log isc_log_t; /*%< Log */
+typedef struct isc_logcategory isc_logcategory_t; /*%< Log Category */
+typedef struct isc_logconfig isc_logconfig_t; /*%< Log Configuration */
+typedef struct isc_logmodule isc_logmodule_t; /*%< Log Module */
+typedef struct isc_mem isc_mem_t; /*%< Memory */
+typedef struct isc_mempool isc_mempool_t; /*%< Memory Pool */
+typedef struct isc_msgcat isc_msgcat_t; /*%< Message Catalog */
+typedef struct isc_ondestroy isc_ondestroy_t; /*%< On Destroy */
+typedef struct isc_netaddr isc_netaddr_t; /*%< Net Address */
+typedef struct isc_portset isc_portset_t; /*%< Port Set */
+typedef struct isc_quota isc_quota_t; /*%< Quota */
+typedef struct isc_random isc_random_t; /*%< Random */
+typedef struct isc_ratelimiter isc_ratelimiter_t; /*%< Rate Limiter */
+typedef struct isc_region isc_region_t; /*%< Region */
+typedef isc_uint64_t isc_resourcevalue_t; /*%< Resource Value */
+typedef unsigned int isc_result_t; /*%< Result */
+typedef struct isc_rwlock isc_rwlock_t; /*%< Read Write Lock */
+typedef struct isc_sockaddr isc_sockaddr_t; /*%< Socket Address */
+typedef struct isc_socket isc_socket_t; /*%< Socket */
+typedef struct isc_socketevent isc_socketevent_t; /*%< Socket Event */
+typedef struct isc_socketmgr isc_socketmgr_t; /*%< Socket Manager */
+typedef struct isc_stats isc_stats_t; /*%< Statistics */
+typedef int isc_statscounter_t; /*%< Statistics Counter */
+typedef struct isc_symtab isc_symtab_t; /*%< Symbol Table */
+typedef struct isc_task isc_task_t; /*%< Task */
+typedef ISC_LIST(isc_task_t) isc_tasklist_t; /*%< Task List */
+typedef struct isc_taskmgr isc_taskmgr_t; /*%< Task Manager */
+typedef struct isc_textregion isc_textregion_t; /*%< Text Region */
+typedef struct isc_time isc_time_t; /*%< Time */
+typedef struct isc_timer isc_timer_t; /*%< Timer */
+typedef struct isc_timermgr isc_timermgr_t; /*%< Timer Manager */
+
+typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *);
+typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *, int);
+
+/* The following cannot be listed alphabetically due to forward reference */
+typedef isc_result_t (isc_httpdaction_t)(const char *url,
+ const char *querystring,
+ void *arg,
+ unsigned int *retcode,
+ const char **retmsg,
+ const char **mimetype,
+ isc_buffer_t *body,
+ isc_httpdfree_t **freecb,
+ void **freecb_args);
+typedef isc_boolean_t (isc_httpdclientok_t)(const isc_sockaddr_t *, void *);
+
+/*% Resource */
+typedef enum {
+ isc_resource_coresize = 1,
+ isc_resource_cputime,
+ isc_resource_datasize,
+ isc_resource_filesize,
+ isc_resource_lockedmemory,
+ isc_resource_openfiles,
+ isc_resource_processes,
+ isc_resource_residentsize,
+ isc_resource_stacksize
+} isc_resource_t;
+
+#endif /* ISC_TYPES_H */
diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h
new file mode 100644
index 0000000..670b28b
--- /dev/null
+++ b/lib/isc/include/isc/util.h
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2004-2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_UTIL_H
+#define ISC_UTIL_H 1
+
+/*! \file isc/util.h
+ * NOTE:
+ *
+ * This file is not to be included from any <isc/???.h> (or other) library
+ * files.
+ *
+ * \brief
+ * Including this file puts several macros in your name space that are
+ * not protected (as all the other ISC functions/macros do) by prepending
+ * ISC_ or isc_ to the name.
+ */
+
+/***
+ *** General Macros.
+ ***/
+
+/*%
+ * Use this to hide unused function arguments.
+ * \code
+ * int
+ * foo(char *bar)
+ * {
+ * UNUSED(bar);
+ * }
+ * \endcode
+ */
+#define UNUSED(x) (void)(x)
+
+/*%
+ * The opposite: silent warnings about stored values which are never read.
+ */
+#define POST(x) (void)(x)
+
+#define ISC_MAX(a, b) ((a) > (b) ? (a) : (b))
+#define ISC_MIN(a, b) ((a) < (b) ? (a) : (b))
+
+/*%
+ * Use this to remove the const qualifier of a variable to assign it to
+ * a non-const variable or pass it as a non-const function argument ...
+ * but only when you are sure it won't then be changed!
+ * This is necessary to sometimes shut up some compilers
+ * (as with gcc -Wcast-qual) when there is just no other good way to avoid the
+ * situation.
+ */
+#define DE_CONST(konst, var) \
+ do { \
+ union { const void *k; void *v; } _u; \
+ _u.k = konst; \
+ var = _u.v; \
+ } while (0)
+
+/*%
+ * Use this in translation units that would otherwise be empty, to
+ * suppress compiler warnings.
+ */
+#define EMPTY_TRANSLATION_UNIT extern void exit(int);
+
+/*%
+ * We use macros instead of calling the routines directly because
+ * the capital letters make the locking stand out.
+ * We RUNTIME_CHECK for success since in general there's no way
+ * for us to continue if they fail.
+ */
+
+#ifdef ISC_UTIL_TRACEON
+#define ISC_UTIL_TRACE(a) a
+#include <stdio.h> /* Required for fprintf/stderr when tracing. */
+#include <isc/msgs.h> /* Required for isc_msgcat when tracing. */
+#else
+#define ISC_UTIL_TRACE(a)
+#endif
+
+#include <isc/result.h> /* Contractual promise. */
+
+#define LOCK(lp) do { \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_LOCKING, "LOCKING"), \
+ (lp), __FILE__, __LINE__)); \
+ RUNTIME_CHECK(isc_mutex_lock((lp)) == ISC_R_SUCCESS); \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_LOCKED, "LOCKED"), \
+ (lp), __FILE__, __LINE__)); \
+ } while (0)
+#define UNLOCK(lp) do { \
+ RUNTIME_CHECK(isc_mutex_unlock((lp)) == ISC_R_SUCCESS); \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_UNLOCKED, "UNLOCKED"), \
+ (lp), __FILE__, __LINE__)); \
+ } while (0)
+#define ISLOCKED(lp) (1)
+#define DESTROYLOCK(lp) \
+ RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS)
+
+
+#define BROADCAST(cvp) do { \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_BROADCAST, "BROADCAST"),\
+ (cvp), __FILE__, __LINE__)); \
+ RUNTIME_CHECK(isc_condition_broadcast((cvp)) == ISC_R_SUCCESS); \
+ } while (0)
+#define SIGNAL(cvp) do { \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_SIGNAL, "SIGNAL"), \
+ (cvp), __FILE__, __LINE__)); \
+ RUNTIME_CHECK(isc_condition_signal((cvp)) == ISC_R_SUCCESS); \
+ } while (0)
+#define WAIT(cvp, lp) do { \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_UTILWAIT, "WAIT"), \
+ (cvp), \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_LOCK, "LOCK"), \
+ (lp), __FILE__, __LINE__)); \
+ RUNTIME_CHECK(isc_condition_wait((cvp), (lp)) == ISC_R_SUCCESS); \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %p %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_WAITED, "WAITED"), \
+ (cvp), \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_LOCKED, "LOCKED"), \
+ (lp), __FILE__, __LINE__)); \
+ } while (0)
+
+/*
+ * isc_condition_waituntil can return ISC_R_TIMEDOUT, so we
+ * don't RUNTIME_CHECK the result.
+ *
+ * XXX Also, can't really debug this then...
+ */
+
+#define WAITUNTIL(cvp, lp, tp) \
+ isc_condition_waituntil((cvp), (lp), (tp))
+
+#define RWLOCK(lp, t) do { \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_RWLOCK, "RWLOCK"), \
+ (lp), (t), __FILE__, __LINE__)); \
+ RUNTIME_CHECK(isc_rwlock_lock((lp), (t)) == ISC_R_SUCCESS); \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_RWLOCKED, "RWLOCKED"), \
+ (lp), (t), __FILE__, __LINE__)); \
+ } while (0)
+#define RWUNLOCK(lp, t) do { \
+ ISC_UTIL_TRACE(fprintf(stderr, "%s %p, %d %s %d\n", \
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_UTIL, \
+ ISC_MSG_RWUNLOCK, "RWUNLOCK"), \
+ (lp), (t), __FILE__, __LINE__)); \
+ RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \
+ } while (0)
+
+#define DESTROYMUTEXBLOCK(bp, n) \
+ RUNTIME_CHECK(isc_mutexblock_destroy((bp), (n)) == ISC_R_SUCCESS)
+
+/*
+ * List Macros.
+ */
+#include <isc/list.h> /* Contractual promise. */
+
+#define LIST(type) ISC_LIST(type)
+#define INIT_LIST(type) ISC_LIST_INIT(type)
+#define LINK(type) ISC_LINK(type)
+#define INIT_LINK(elt, link) ISC_LINK_INIT(elt, link)
+#define HEAD(list) ISC_LIST_HEAD(list)
+#define TAIL(list) ISC_LIST_TAIL(list)
+#define EMPTY(list) ISC_LIST_EMPTY(list)
+#define PREV(elt, link) ISC_LIST_PREV(elt, link)
+#define NEXT(elt, link) ISC_LIST_NEXT(elt, link)
+#define APPEND(list, elt, link) ISC_LIST_APPEND(list, elt, link)
+#define PREPEND(list, elt, link) ISC_LIST_PREPEND(list, elt, link)
+#define UNLINK(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
+#define ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link)
+#define DEQUEUE(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
+#define INSERTBEFORE(li, b, e, ln) ISC_LIST_INSERTBEFORE(li, b, e, ln)
+#define INSERTAFTER(li, a, e, ln) ISC_LIST_INSERTAFTER(li, a, e, ln)
+#define APPENDLIST(list1, list2, link) ISC_LIST_APPENDLIST(list1, list2, link)
+
+/*
+ * Assertions
+ */
+#include <isc/assertions.h> /* Contractual promise. */
+
+/*% Require Assertion */
+#define REQUIRE(e) ISC_REQUIRE(e)
+/*% Ensure Assertion */
+#define ENSURE(e) ISC_ENSURE(e)
+/*% Insist Assertion */
+#define INSIST(e) ISC_INSIST(e)
+/*% Invariant Assertion */
+#define INVARIANT(e) ISC_INVARIANT(e)
+
+/*
+ * Errors
+ */
+#include <isc/error.h> /* Contractual promise. */
+
+/*% Unexpected Error */
+#define UNEXPECTED_ERROR isc_error_unexpected
+/*% Fatal Error */
+#define FATAL_ERROR isc_error_fatal
+/*% Runtime Check */
+#define RUNTIME_CHECK(cond) ISC_ERROR_RUNTIMECHECK(cond)
+
+/*%
+ * Time
+ */
+#define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
+
+#endif /* ISC_UTIL_H */
diff --git a/lib/isc/include/isc/version.h b/lib/isc/include/isc/version.h
new file mode 100644
index 0000000..ec00bde
--- /dev/null
+++ b/lib/isc/include/isc/version.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: version.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */
+
+/*! \file isc/version.h */
+
+#include <isc/platform.h>
+
+LIBISC_EXTERNAL_DATA extern const char isc_version[];
+
+LIBISC_EXTERNAL_DATA extern const unsigned int isc_libinterface;
+LIBISC_EXTERNAL_DATA extern const unsigned int isc_librevision;
+LIBISC_EXTERNAL_DATA extern const unsigned int isc_libage;
diff --git a/lib/isc/include/isc/xml.h b/lib/isc/include/isc/xml.h
new file mode 100644
index 0000000..d31a31a
--- /dev/null
+++ b/lib/isc/include/isc/xml.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: xml.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_XML_H
+#define ISC_XML_H 1
+
+/*
+ * This file is here mostly to make it easy to add additional libxml header
+ * files as needed across all the users of this file. Rather than place
+ * these libxml includes in each file, one include makes it easy to handle
+ * the ifdef as well as adding the ability to add additional functions
+ * which may be useful.
+ */
+
+#ifdef HAVE_LIBXML2
+#include <libxml/encoding.h>
+#include <libxml/xmlwriter.h>
+#endif
+
+#define ISC_XMLCHAR (const xmlChar *)
+
+#define ISC_XML_RENDERCONFIG 0x00000001 /* render config data */
+#define ISC_XML_RENDERSTATS 0x00000002 /* render stats */
+#define ISC_XML_RENDERALL 0x000000ff /* render everything */
+
+#endif /* ISC_XML_H */
diff --git a/lib/isc/inet_aton.c b/lib/isc/inet_aton.c
new file mode 100644
index 0000000..14b4887
--- /dev/null
+++ b/lib/isc/inet_aton.c
@@ -0,0 +1,196 @@
+/*
+ * Portions Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1996-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1983, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+/*! \file */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
+static char rcsid[] = "$Id: inet_aton.c,v 1.23 2008/12/01 23:47:45 tbox Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <config.h>
+
+#include <ctype.h>
+#include <stddef.h> /* Required for NULL. */
+
+#include <isc/types.h>
+#include <isc/net.h>
+
+/*%
+ * Check whether "cp" is a valid ascii representation
+ * of an Internet address and convert to a binary address.
+ * Returns 1 if the address is valid, 0 if not.
+ * This replaces inet_addr, the return value from which
+ * cannot distinguish between failure and a local broadcast address.
+ */
+int
+isc_net_aton(const char *cp, struct in_addr *addr) {
+ unsigned long val;
+ int base, n;
+ unsigned char c;
+ isc_uint8_t parts[4];
+ isc_uint8_t *pp = parts;
+ int digit;
+
+ c = *cp;
+ for (;;) {
+ /*
+ * Collect number up to ``.''.
+ * Values are specified as for C:
+ * 0x=hex, 0=octal, isdigit=decimal.
+ */
+ if (!isdigit(c & 0xff))
+ return (0);
+ val = 0; base = 10; digit = 0;
+ if (c == '0') {
+ c = *++cp;
+ if (c == 'x' || c == 'X')
+ base = 16, c = *++cp;
+ else {
+ base = 8;
+ digit = 1;
+ }
+ }
+ for (;;) {
+ /*
+ * isascii() is valid for all integer values, and
+ * when it is true, c is known to be in scope
+ * for isdigit(). No cast necessary. Similar
+ * comment applies for later ctype uses.
+ */
+ if (isascii(c) && isdigit(c)) {
+ if (base == 8 && (c == '8' || c == '9'))
+ return (0);
+ val = (val * base) + (c - '0');
+ c = *++cp;
+ digit = 1;
+ } else if (base == 16 && isascii(c) && isxdigit(c)) {
+ val = (val << 4) |
+ (c + 10 - (islower(c) ? 'a' : 'A'));
+ c = *++cp;
+ digit = 1;
+ } else
+ break;
+ }
+ if (c == '.') {
+ /*
+ * Internet format:
+ * a.b.c.d
+ * a.b.c (with c treated as 16 bits)
+ * a.b (with b treated as 24 bits)
+ */
+ if (pp >= parts + 3 || val > 0xffU)
+ return (0);
+ *pp++ = (isc_uint8_t)val;
+ c = *++cp;
+ } else
+ break;
+ }
+ /*
+ * Check for trailing characters.
+ */
+ if (c != '\0' && (!isascii(c) || !isspace(c)))
+ return (0);
+ /*
+ * Did we get a valid digit?
+ */
+ if (!digit)
+ return (0);
+ /*
+ * Concoct the address according to
+ * the number of parts specified.
+ */
+ n = pp - parts + 1;
+ switch (n) {
+ case 1: /* a -- 32 bits */
+ break;
+
+ case 2: /* a.b -- 8.24 bits */
+ if (val > 0xffffffU)
+ return (0);
+ val |= parts[0] << 24;
+ break;
+
+ case 3: /* a.b.c -- 8.8.16 bits */
+ if (val > 0xffffU)
+ return (0);
+ val |= (parts[0] << 24) | (parts[1] << 16);
+ break;
+
+ case 4: /* a.b.c.d -- 8.8.8.8 bits */
+ if (val > 0xffU)
+ return (0);
+ val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
+ break;
+ }
+ if (addr != NULL)
+ addr->s_addr = htonl(val);
+
+ return (1);
+}
diff --git a/lib/isc/inet_ntop.c b/lib/isc/inet_ntop.c
new file mode 100644
index 0000000..26d5dca
--- /dev/null
+++ b/lib/isc/inet_ntop.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*! \file */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] =
+ "$Id: inet_ntop.c,v 1.21 2009/07/17 23:47:41 tbox Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <config.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <isc/net.h>
+#include <isc/print.h>
+
+#define NS_INT16SZ 2
+#define NS_IN6ADDRSZ 16
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static const char *inet_ntop4(const unsigned char *src, char *dst,
+ size_t size);
+
+#ifdef AF_INET6
+static const char *inet_ntop6(const unsigned char *src, char *dst,
+ size_t size);
+#endif
+const char *isc_net_ntop(int af, const void *src, char *dst, size_t size);
+
+/*! char *
+ * isc_net_ntop(af, src, dst, size)
+ * convert a network format address to presentation format.
+ * \return
+ * pointer to presentation format address (`dst'), or NULL (see errno).
+ * \author
+ * Paul Vixie, 1996.
+ */
+const char *
+isc_net_ntop(int af, const void *src, char *dst, size_t size)
+{
+ switch (af) {
+ case AF_INET:
+ return (inet_ntop4(src, dst, size));
+#ifdef AF_INET6
+ case AF_INET6:
+ return (inet_ntop6(src, dst, size));
+#endif
+ default:
+ errno = EAFNOSUPPORT;
+ return (NULL);
+ }
+ /* NOTREACHED */
+}
+
+/*! const char *
+ * inet_ntop4(src, dst, size)
+ * format an IPv4 address
+ * \return
+ * `dst' (as a const)
+ * \note
+ * (1) uses no statics
+ * \note
+ * (2) takes a unsigned char* not an in_addr as input
+ * \author
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4(const unsigned char *src, char *dst, size_t size)
+{
+ static const char *fmt = "%u.%u.%u.%u";
+ char tmp[sizeof("255.255.255.255")];
+ int len;
+
+ len = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
+ if (len < 0 || (size_t)len >= size)
+ {
+ errno = ENOSPC;
+ return (NULL);
+ }
+ memcpy(dst, tmp, 1 + len);
+
+ return (dst);
+}
+
+/*! const char *
+ * isc_inet_ntop6(src, dst, size)
+ * convert IPv6 binary address into presentation (printable) format
+ * \author
+ * Paul Vixie, 1996.
+ */
+#ifdef AF_INET6
+static const char *
+inet_ntop6(const unsigned char *src, char *dst, size_t size)
+{
+ /*
+ * Note that int32_t and int16_t need only be "at least" large enough
+ * to contain a value of the specified size. On some systems, like
+ * Crays, there is no such thing as an integer variable with 16 bits.
+ * Keep this in mind if you think this function should have been coded
+ * to use pointer overlays. All the world's not a VAX.
+ */
+ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")], *tp;
+ struct { int base, len; } best, cur;
+ unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+ int i;
+
+ /*
+ * Preprocess:
+ * Copy the input (bytewise) array into a wordwise array.
+ * Find the longest run of 0x00's in src[] for :: shorthanding.
+ */
+ memset(words, '\0', sizeof(words));
+ for (i = 0; i < NS_IN6ADDRSZ; i++)
+ words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
+ best.base = -1;
+ cur.base = -1;
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+ if (words[i] == 0) {
+ if (cur.base == -1)
+ cur.base = i, cur.len = 1;
+ else
+ cur.len++;
+ } else {
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ cur.base = -1;
+ }
+ }
+ }
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ }
+ if (best.base != -1 && best.len < 2)
+ best.base = -1;
+
+ /*
+ * Format the result.
+ */
+ tp = tmp;
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+ /* Are we inside the best run of 0x00's? */
+ if (best.base != -1 && i >= best.base &&
+ i < (best.base + best.len)) {
+ if (i == best.base)
+ *tp++ = ':';
+ continue;
+ }
+ /* Are we following an initial run of 0x00s or any real hex? */
+ if (i != 0)
+ *tp++ = ':';
+ /* Is this address an encapsulated IPv4? */
+ if (i == 6 && best.base == 0 && (best.len == 6 ||
+ (best.len == 7 && words[7] != 0x0001) ||
+ (best.len == 5 && words[5] == 0xffff))) {
+ if (!inet_ntop4(src+12, tp,
+ sizeof(tmp) - (tp - tmp)))
+ return (NULL);
+ tp += strlen(tp);
+ break;
+ }
+ tp += snprintf(tp, sizeof(tmp) - (tp - tmp), "%x", words[i]);
+ }
+ /* Was it a trailing run of 0x00's? */
+ if (best.base != -1 && (best.base + best.len) ==
+ (NS_IN6ADDRSZ / NS_INT16SZ))
+ *tp++ = ':';
+ *tp++ = '\0';
+
+ /*
+ * Check for overflow, copy, and we're done.
+ */
+ if ((size_t)(tp - tmp) > size) {
+ errno = ENOSPC;
+ return (NULL);
+ }
+ memcpy(dst, tmp, (size_t)(tp - tmp));
+ return (dst);
+}
+#endif /* AF_INET6 */
diff --git a/lib/isc/inet_pton.c b/lib/isc/inet_pton.c
new file mode 100644
index 0000000..66b5de0
--- /dev/null
+++ b/lib/isc/inet_pton.c
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*! \file */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] =
+ "$Id: inet_pton.c,v 1.19 2007/06/19 23:47:17 tbox Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <config.h>
+
+#include <errno.h>
+#include <string.h>
+
+#include <isc/net.h>
+
+/*% INT16 Size */
+#define NS_INT16SZ 2
+/*% IPv4 Address Size */
+#define NS_INADDRSZ 4
+/*% IPv6 Address Size */
+#define NS_IN6ADDRSZ 16
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static int inet_pton4(const char *src, unsigned char *dst);
+static int inet_pton6(const char *src, unsigned char *dst);
+int isc_net_pton(int af, const char *src, void *dst);
+
+/*%
+ * convert from presentation format (which usually means ASCII printable)
+ * to network format (which is usually some kind of binary format).
+ * \return
+ * 1 if the address was valid for the specified address family
+ * 0 if the address wasn't valid (`dst' is untouched in this case)
+ * -1 if some other error occurred (`dst' is untouched in this case, too)
+ * \author
+ * Paul Vixie, 1996.
+ */
+int
+isc_net_pton(int af, const char *src, void *dst) {
+ switch (af) {
+ case AF_INET:
+ return (inet_pton4(src, dst));
+ case AF_INET6:
+ return (inet_pton6(src, dst));
+ default:
+ errno = EAFNOSUPPORT;
+ return (-1);
+ }
+ /* NOTREACHED */
+}
+
+/*!\fn static int inet_pton4(const char *src, unsigned char *dst)
+ * \brief
+ * like inet_aton() but without all the hexadecimal and shorthand.
+ * \return
+ * 1 if `src' is a valid dotted quad, else 0.
+ * \note
+ * does not touch `dst' unless it's returning 1.
+ * \author
+ * Paul Vixie, 1996.
+ */
+static int
+inet_pton4(const char *src, unsigned char *dst) {
+ static const char digits[] = "0123456789";
+ int saw_digit, octets, ch;
+ unsigned char tmp[NS_INADDRSZ], *tp;
+
+ saw_digit = 0;
+ octets = 0;
+ *(tp = tmp) = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ if ((pch = strchr(digits, ch)) != NULL) {
+ unsigned int newv = *tp * 10 + (pch - digits);
+
+ if (saw_digit && *tp == 0)
+ return (0);
+ if (newv > 255)
+ return (0);
+ *tp = (unsigned char)newv;
+ if (!saw_digit) {
+ if (++octets > 4)
+ return (0);
+ saw_digit = 1;
+ }
+ } else if (ch == '.' && saw_digit) {
+ if (octets == 4)
+ return (0);
+ *++tp = 0;
+ saw_digit = 0;
+ } else
+ return (0);
+ }
+ if (octets < 4)
+ return (0);
+ memcpy(dst, tmp, NS_INADDRSZ);
+ return (1);
+}
+
+/*%
+ * convert presentation level address to network order binary form.
+ * \return
+ * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
+ * \note
+ * (1) does not touch `dst' unless it's returning 1.
+ * \note
+ * (2) :: in a full address is silently ignored.
+ * \author
+ * inspired by Mark Andrews.
+ * \author
+ * Paul Vixie, 1996.
+ */
+static int
+inet_pton6(const char *src, unsigned char *dst) {
+ static const char xdigits_l[] = "0123456789abcdef",
+ xdigits_u[] = "0123456789ABCDEF";
+ unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+ const char *xdigits, *curtok;
+ int ch, seen_xdigits;
+ unsigned int val;
+
+ memset((tp = tmp), '\0', NS_IN6ADDRSZ);
+ endp = tp + NS_IN6ADDRSZ;
+ colonp = NULL;
+ /* Leading :: requires some special handling. */
+ if (*src == ':')
+ if (*++src != ':')
+ return (0);
+ curtok = src;
+ seen_xdigits = 0;
+ val = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+ pch = strchr((xdigits = xdigits_u), ch);
+ if (pch != NULL) {
+ val <<= 4;
+ val |= (pch - xdigits);
+ if (++seen_xdigits > 4)
+ return (0);
+ continue;
+ }
+ if (ch == ':') {
+ curtok = src;
+ if (!seen_xdigits) {
+ if (colonp)
+ return (0);
+ colonp = tp;
+ continue;
+ }
+ if (tp + NS_INT16SZ > endp)
+ return (0);
+ *tp++ = (unsigned char) (val >> 8) & 0xff;
+ *tp++ = (unsigned char) val & 0xff;
+ seen_xdigits = 0;
+ val = 0;
+ continue;
+ }
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+ inet_pton4(curtok, tp) > 0) {
+ tp += NS_INADDRSZ;
+ seen_xdigits = 0;
+ break; /* '\0' was seen by inet_pton4(). */
+ }
+ return (0);
+ }
+ if (seen_xdigits) {
+ if (tp + NS_INT16SZ > endp)
+ return (0);
+ *tp++ = (unsigned char) (val >> 8) & 0xff;
+ *tp++ = (unsigned char) val & 0xff;
+ }
+ if (colonp != NULL) {
+ /*
+ * Since some memmove()'s erroneously fail to handle
+ * overlapping regions, we'll do the shift by hand.
+ */
+ const int n = tp - colonp;
+ int i;
+
+ if (tp == endp)
+ return (0);
+ for (i = 1; i <= n; i++) {
+ endp[- i] = colonp[n - i];
+ colonp[n - i] = 0;
+ }
+ tp = endp;
+ }
+ if (tp != endp)
+ return (0);
+ memcpy(dst, tmp, NS_IN6ADDRSZ);
+ return (1);
+}
diff --git a/lib/isc/iterated_hash.c b/lib/isc/iterated_hash.c
new file mode 100644
index 0000000..86dedde
--- /dev/null
+++ b/lib/isc/iterated_hash.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2006, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: iterated_hash.c,v 1.6 2009/02/18 23:47:48 tbox Exp $ */
+
+#include "config.h"
+
+#include <stdio.h>
+
+#include <isc/sha1.h>
+#include <isc/iterated_hash.h>
+
+int
+isc_iterated_hash(unsigned char out[ISC_SHA1_DIGESTLENGTH],
+ unsigned int hashalg, int iterations,
+ const unsigned char *salt, int saltlength,
+ const unsigned char *in, int inlength)
+{
+ isc_sha1_t ctx;
+ int n = 0;
+
+ if (hashalg != 1)
+ return (0);
+
+ do {
+ isc_sha1_init(&ctx);
+ isc_sha1_update(&ctx, in, inlength);
+ isc_sha1_update(&ctx, salt, saltlength);
+ isc_sha1_final(&ctx, out);
+ in = out;
+ inlength = ISC_SHA1_DIGESTLENGTH;
+ } while (n++ < iterations);
+
+ return (ISC_SHA1_DIGESTLENGTH);
+}
diff --git a/lib/isc/lex.c b/lib/isc/lex.c
new file mode 100644
index 0000000..8749ed0
--- /dev/null
+++ b/lib/isc/lex.c
@@ -0,0 +1,959 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: lex.c,v 1.86 2007/09/17 09:56:29 shane Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#include <isc/buffer.h>
+#include <isc/file.h>
+#include <isc/lex.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/parseint.h>
+#include <isc/print.h>
+#include <isc/stdio.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+typedef struct inputsource {
+ isc_result_t result;
+ isc_boolean_t is_file;
+ isc_boolean_t need_close;
+ isc_boolean_t at_eof;
+ isc_buffer_t * pushback;
+ unsigned int ignored;
+ void * input;
+ char * name;
+ unsigned long line;
+ unsigned long saved_line;
+ ISC_LINK(struct inputsource) link;
+} inputsource;
+
+#define LEX_MAGIC ISC_MAGIC('L', 'e', 'x', '!')
+#define VALID_LEX(l) ISC_MAGIC_VALID(l, LEX_MAGIC)
+
+struct isc_lex {
+ /* Unlocked. */
+ unsigned int magic;
+ isc_mem_t * mctx;
+ size_t max_token;
+ char * data;
+ unsigned int comments;
+ isc_boolean_t comment_ok;
+ isc_boolean_t last_was_eol;
+ unsigned int paren_count;
+ unsigned int saved_paren_count;
+ isc_lexspecials_t specials;
+ LIST(struct inputsource) sources;
+};
+
+static inline isc_result_t
+grow_data(isc_lex_t *lex, size_t *remainingp, char **currp, char **prevp) {
+ char *new;
+
+ new = isc_mem_get(lex->mctx, lex->max_token * 2 + 1);
+ if (new == NULL)
+ return (ISC_R_NOMEMORY);
+ memcpy(new, lex->data, lex->max_token + 1);
+ *currp = new + (*currp - lex->data);
+ if (*prevp != NULL)
+ *prevp = new + (*prevp - lex->data);
+ isc_mem_put(lex->mctx, lex->data, lex->max_token + 1);
+ lex->data = new;
+ *remainingp += lex->max_token;
+ lex->max_token *= 2;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp) {
+ isc_lex_t *lex;
+
+ /*
+ * Create a lexer.
+ */
+
+ REQUIRE(lexp != NULL && *lexp == NULL);
+ REQUIRE(max_token > 0U);
+
+ lex = isc_mem_get(mctx, sizeof(*lex));
+ if (lex == NULL)
+ return (ISC_R_NOMEMORY);
+ lex->data = isc_mem_get(mctx, max_token + 1);
+ if (lex->data == NULL) {
+ isc_mem_put(mctx, lex, sizeof(*lex));
+ return (ISC_R_NOMEMORY);
+ }
+ lex->mctx = mctx;
+ lex->max_token = max_token;
+ lex->comments = 0;
+ lex->comment_ok = ISC_TRUE;
+ lex->last_was_eol = ISC_TRUE;
+ lex->paren_count = 0;
+ lex->saved_paren_count = 0;
+ memset(lex->specials, 0, 256);
+ INIT_LIST(lex->sources);
+ lex->magic = LEX_MAGIC;
+
+ *lexp = lex;
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_lex_destroy(isc_lex_t **lexp) {
+ isc_lex_t *lex;
+
+ /*
+ * Destroy the lexer.
+ */
+
+ REQUIRE(lexp != NULL);
+ lex = *lexp;
+ REQUIRE(VALID_LEX(lex));
+
+ while (!EMPTY(lex->sources))
+ RUNTIME_CHECK(isc_lex_close(lex) == ISC_R_SUCCESS);
+ if (lex->data != NULL)
+ isc_mem_put(lex->mctx, lex->data, lex->max_token + 1);
+ lex->magic = 0;
+ isc_mem_put(lex->mctx, lex, sizeof(*lex));
+
+ *lexp = NULL;
+}
+
+unsigned int
+isc_lex_getcomments(isc_lex_t *lex) {
+ /*
+ * Return the current lexer commenting styles.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ return (lex->comments);
+}
+
+void
+isc_lex_setcomments(isc_lex_t *lex, unsigned int comments) {
+ /*
+ * Set allowed lexer commenting styles.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ lex->comments = comments;
+}
+
+void
+isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials) {
+ /*
+ * Put the current list of specials into 'specials'.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ memcpy(specials, lex->specials, 256);
+}
+
+void
+isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials) {
+ /*
+ * The characters in 'specials' are returned as tokens. Along with
+ * whitespace, they delimit strings and numbers.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ memcpy(lex->specials, specials, 256);
+}
+
+static inline isc_result_t
+new_source(isc_lex_t *lex, isc_boolean_t is_file, isc_boolean_t need_close,
+ void *input, const char *name)
+{
+ inputsource *source;
+ isc_result_t result;
+
+ source = isc_mem_get(lex->mctx, sizeof(*source));
+ if (source == NULL)
+ return (ISC_R_NOMEMORY);
+ source->result = ISC_R_SUCCESS;
+ source->is_file = is_file;
+ source->need_close = need_close;
+ source->at_eof = ISC_FALSE;
+ source->input = input;
+ source->name = isc_mem_strdup(lex->mctx, name);
+ if (source->name == NULL) {
+ isc_mem_put(lex->mctx, source, sizeof(*source));
+ return (ISC_R_NOMEMORY);
+ }
+ source->pushback = NULL;
+ result = isc_buffer_allocate(lex->mctx, &source->pushback,
+ lex->max_token);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_free(lex->mctx, source->name);
+ isc_mem_put(lex->mctx, source, sizeof(*source));
+ return (result);
+ }
+ source->ignored = 0;
+ source->line = 1;
+ ISC_LIST_INITANDPREPEND(lex->sources, source, link);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_lex_openfile(isc_lex_t *lex, const char *filename) {
+ isc_result_t result;
+ FILE *stream = NULL;
+
+ /*
+ * Open 'filename' and make it the current input source for 'lex'.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ result = isc_stdio_open(filename, "r", &stream);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ result = new_source(lex, ISC_TRUE, ISC_TRUE, stream, filename);
+ if (result != ISC_R_SUCCESS)
+ (void)fclose(stream);
+ return (result);
+}
+
+isc_result_t
+isc_lex_openstream(isc_lex_t *lex, FILE *stream) {
+ char name[128];
+
+ /*
+ * Make 'stream' the current input source for 'lex'.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ snprintf(name, sizeof(name), "stream-%p", stream);
+
+ return (new_source(lex, ISC_TRUE, ISC_FALSE, stream, name));
+}
+
+isc_result_t
+isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer) {
+ char name[128];
+
+ /*
+ * Make 'buffer' the current input source for 'lex'.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ snprintf(name, sizeof(name), "buffer-%p", buffer);
+
+ return (new_source(lex, ISC_FALSE, ISC_FALSE, buffer, name));
+}
+
+isc_result_t
+isc_lex_close(isc_lex_t *lex) {
+ inputsource *source;
+
+ /*
+ * Close the most recently opened object (i.e. file or buffer).
+ */
+
+ REQUIRE(VALID_LEX(lex));
+
+ source = HEAD(lex->sources);
+ if (source == NULL)
+ return (ISC_R_NOMORE);
+
+ ISC_LIST_UNLINK(lex->sources, source, link);
+ if (source->is_file) {
+ if (source->need_close)
+ (void)fclose((FILE *)(source->input));
+ }
+ isc_mem_free(lex->mctx, source->name);
+ isc_buffer_free(&source->pushback);
+ isc_mem_put(lex->mctx, source, sizeof(*source));
+
+ return (ISC_R_SUCCESS);
+}
+
+typedef enum {
+ lexstate_start,
+ lexstate_crlf,
+ lexstate_string,
+ lexstate_number,
+ lexstate_maybecomment,
+ lexstate_ccomment,
+ lexstate_ccommentend,
+ lexstate_eatline,
+ lexstate_qstring
+} lexstate;
+
+#define IWSEOL (ISC_LEXOPT_INITIALWS | ISC_LEXOPT_EOL)
+
+static void
+pushback(inputsource *source, int c) {
+ REQUIRE(source->pushback->current > 0);
+ if (c == EOF) {
+ source->at_eof = ISC_FALSE;
+ return;
+ }
+ source->pushback->current--;
+ if (c == '\n')
+ source->line--;
+}
+
+static isc_result_t
+pushandgrow(isc_lex_t *lex, inputsource *source, int c) {
+ if (isc_buffer_availablelength(source->pushback) == 0) {
+ isc_buffer_t *tbuf = NULL;
+ unsigned int oldlen;
+ isc_region_t used;
+ isc_result_t result;
+
+ oldlen = isc_buffer_length(source->pushback);
+ result = isc_buffer_allocate(lex->mctx, &tbuf, oldlen * 2);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ isc_buffer_usedregion(source->pushback, &used);
+ result = isc_buffer_copyregion(tbuf, &used);
+ INSIST(result == ISC_R_SUCCESS);
+ tbuf->current = source->pushback->current;
+ isc_buffer_free(&source->pushback);
+ source->pushback = tbuf;
+ }
+ isc_buffer_putuint8(source->pushback, (isc_uint8_t)c);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
+ inputsource *source;
+ int c;
+ isc_boolean_t done = ISC_FALSE;
+ isc_boolean_t no_comments = ISC_FALSE;
+ isc_boolean_t escaped = ISC_FALSE;
+ lexstate state = lexstate_start;
+ lexstate saved_state = lexstate_start;
+ isc_buffer_t *buffer;
+ FILE *stream;
+ char *curr, *prev;
+ size_t remaining;
+ isc_uint32_t as_ulong;
+ unsigned int saved_options;
+ isc_result_t result;
+
+ /*
+ * Get the next token.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+ source = HEAD(lex->sources);
+ REQUIRE(tokenp != NULL);
+
+ if (source == NULL) {
+ if ((options & ISC_LEXOPT_NOMORE) != 0) {
+ tokenp->type = isc_tokentype_nomore;
+ return (ISC_R_SUCCESS);
+ }
+ return (ISC_R_NOMORE);
+ }
+
+ if (source->result != ISC_R_SUCCESS)
+ return (source->result);
+
+ lex->saved_paren_count = lex->paren_count;
+ source->saved_line = source->line;
+
+ if (isc_buffer_remaininglength(source->pushback) == 0 &&
+ source->at_eof)
+ {
+ if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 &&
+ lex->paren_count != 0) {
+ lex->paren_count = 0;
+ return (ISC_R_UNBALANCED);
+ }
+ if ((options & ISC_LEXOPT_EOF) != 0) {
+ tokenp->type = isc_tokentype_eof;
+ return (ISC_R_SUCCESS);
+ }
+ return (ISC_R_EOF);
+ }
+
+ isc_buffer_compact(source->pushback);
+
+ saved_options = options;
+ if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && lex->paren_count > 0)
+ options &= ~IWSEOL;
+
+ curr = lex->data;
+ *curr = '\0';
+
+ prev = NULL;
+ remaining = lex->max_token;
+
+#ifdef HAVE_FLOCKFILE
+ if (source->is_file)
+ flockfile(source->input);
+#endif
+
+ do {
+ if (isc_buffer_remaininglength(source->pushback) == 0) {
+ if (source->is_file) {
+ stream = source->input;
+
+#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED)
+ c = getc_unlocked(stream);
+#else
+ c = getc(stream);
+#endif
+ if (c == EOF) {
+ if (ferror(stream)) {
+ source->result = ISC_R_IOERROR;
+ result = source->result;
+ goto done;
+ }
+ source->at_eof = ISC_TRUE;
+ }
+ } else {
+ buffer = source->input;
+
+ if (buffer->current == buffer->used) {
+ c = EOF;
+ source->at_eof = ISC_TRUE;
+ } else {
+ c = *((char *)buffer->base +
+ buffer->current);
+ buffer->current++;
+ }
+ }
+ if (c != EOF) {
+ source->result = pushandgrow(lex, source, c);
+ if (source->result != ISC_R_SUCCESS) {
+ result = source->result;
+ goto done;
+ }
+ }
+ }
+
+ if (!source->at_eof) {
+ if (state == lexstate_start)
+ /* Token has not started yet. */
+ source->ignored =
+ isc_buffer_consumedlength(source->pushback);
+ c = isc_buffer_getuint8(source->pushback);
+ } else {
+ c = EOF;
+ }
+
+ if (c == '\n')
+ source->line++;
+
+ if (lex->comment_ok && !no_comments) {
+ if (!escaped && c == ';' &&
+ ((lex->comments & ISC_LEXCOMMENT_DNSMASTERFILE)
+ != 0)) {
+ saved_state = state;
+ state = lexstate_eatline;
+ no_comments = ISC_TRUE;
+ continue;
+ } else if (c == '/' &&
+ (lex->comments &
+ (ISC_LEXCOMMENT_C|
+ ISC_LEXCOMMENT_CPLUSPLUS)) != 0) {
+ saved_state = state;
+ state = lexstate_maybecomment;
+ no_comments = ISC_TRUE;
+ continue;
+ } else if (c == '#' &&
+ ((lex->comments & ISC_LEXCOMMENT_SHELL)
+ != 0)) {
+ saved_state = state;
+ state = lexstate_eatline;
+ no_comments = ISC_TRUE;
+ continue;
+ }
+ }
+
+ no_read:
+ /* INSIST(c == EOF || (c >= 0 && c <= 255)); */
+ switch (state) {
+ case lexstate_start:
+ if (c == EOF) {
+ lex->last_was_eol = ISC_FALSE;
+ if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 &&
+ lex->paren_count != 0) {
+ lex->paren_count = 0;
+ result = ISC_R_UNBALANCED;
+ goto done;
+ }
+ if ((options & ISC_LEXOPT_EOF) == 0) {
+ result = ISC_R_EOF;
+ goto done;
+ }
+ tokenp->type = isc_tokentype_eof;
+ done = ISC_TRUE;
+ } else if (c == ' ' || c == '\t') {
+ if (lex->last_was_eol &&
+ (options & ISC_LEXOPT_INITIALWS)
+ != 0) {
+ lex->last_was_eol = ISC_FALSE;
+ tokenp->type = isc_tokentype_initialws;
+ tokenp->value.as_char = c;
+ done = ISC_TRUE;
+ }
+ } else if (c == '\n') {
+ if ((options & ISC_LEXOPT_EOL) != 0) {
+ tokenp->type = isc_tokentype_eol;
+ done = ISC_TRUE;
+ }
+ lex->last_was_eol = ISC_TRUE;
+ } else if (c == '\r') {
+ if ((options & ISC_LEXOPT_EOL) != 0)
+ state = lexstate_crlf;
+ } else if (c == '"' &&
+ (options & ISC_LEXOPT_QSTRING) != 0) {
+ lex->last_was_eol = ISC_FALSE;
+ no_comments = ISC_TRUE;
+ state = lexstate_qstring;
+ } else if (lex->specials[c]) {
+ lex->last_was_eol = ISC_FALSE;
+ if ((c == '(' || c == ')') &&
+ (options & ISC_LEXOPT_DNSMULTILINE) != 0) {
+ if (c == '(') {
+ if (lex->paren_count == 0)
+ options &= ~IWSEOL;
+ lex->paren_count++;
+ } else {
+ if (lex->paren_count == 0) {
+ result = ISC_R_UNBALANCED;
+ goto done;
+ }
+ lex->paren_count--;
+ if (lex->paren_count == 0)
+ options =
+ saved_options;
+ }
+ continue;
+ }
+ tokenp->type = isc_tokentype_special;
+ tokenp->value.as_char = c;
+ done = ISC_TRUE;
+ } else if (isdigit((unsigned char)c) &&
+ (options & ISC_LEXOPT_NUMBER) != 0) {
+ lex->last_was_eol = ISC_FALSE;
+ if ((options & ISC_LEXOPT_OCTAL) != 0 &&
+ (c == '8' || c == '9'))
+ state = lexstate_string;
+ else
+ state = lexstate_number;
+ goto no_read;
+ } else {
+ lex->last_was_eol = ISC_FALSE;
+ state = lexstate_string;
+ goto no_read;
+ }
+ break;
+ case lexstate_crlf:
+ if (c != '\n')
+ pushback(source, c);
+ tokenp->type = isc_tokentype_eol;
+ done = ISC_TRUE;
+ lex->last_was_eol = ISC_TRUE;
+ break;
+ case lexstate_number:
+ if (c == EOF || !isdigit((unsigned char)c)) {
+ if (c == ' ' || c == '\t' || c == '\r' ||
+ c == '\n' || c == EOF ||
+ lex->specials[c]) {
+ int base;
+ if ((options & ISC_LEXOPT_OCTAL) != 0)
+ base = 8;
+ else if ((options & ISC_LEXOPT_CNUMBER) != 0)
+ base = 0;
+ else
+ base = 10;
+ pushback(source, c);
+
+ result = isc_parse_uint32(&as_ulong,
+ lex->data,
+ base);
+ if (result == ISC_R_SUCCESS) {
+ tokenp->type =
+ isc_tokentype_number;
+ tokenp->value.as_ulong =
+ as_ulong;
+ } else if (result == ISC_R_BADNUMBER) {
+ isc_tokenvalue_t *v;
+
+ tokenp->type =
+ isc_tokentype_string;
+ v = &(tokenp->value);
+ v->as_textregion.base =
+ lex->data;
+ v->as_textregion.length =
+ lex->max_token -
+ remaining;
+ } else
+ goto done;
+ done = ISC_TRUE;
+ continue;
+ } else if (!(options & ISC_LEXOPT_CNUMBER) ||
+ ((c != 'x' && c != 'X') ||
+ (curr != &lex->data[1]) ||
+ (lex->data[0] != '0'))) {
+ /* Above test supports hex numbers */
+ state = lexstate_string;
+ }
+ } else if ((options & ISC_LEXOPT_OCTAL) != 0 &&
+ (c == '8' || c == '9')) {
+ state = lexstate_string;
+ }
+ if (remaining == 0U) {
+ result = grow_data(lex, &remaining,
+ &curr, &prev);
+ if (result != ISC_R_SUCCESS)
+ goto done;
+ }
+ INSIST(remaining > 0U);
+ *curr++ = c;
+ *curr = '\0';
+ remaining--;
+ break;
+ case lexstate_string:
+ /*
+ * EOF needs to be checked before lex->specials[c]
+ * as lex->specials[EOF] is not a good idea.
+ */
+ if (c == '\r' || c == '\n' || c == EOF ||
+ (!escaped &&
+ (c == ' ' || c == '\t' || lex->specials[c]))) {
+ pushback(source, c);
+ if (source->result != ISC_R_SUCCESS) {
+ result = source->result;
+ goto done;
+ }
+ tokenp->type = isc_tokentype_string;
+ tokenp->value.as_textregion.base = lex->data;
+ tokenp->value.as_textregion.length =
+ lex->max_token - remaining;
+ done = ISC_TRUE;
+ continue;
+ }
+ if ((options & ISC_LEXOPT_ESCAPE) != 0)
+ escaped = (!escaped && c == '\\') ?
+ ISC_TRUE : ISC_FALSE;
+ if (remaining == 0U) {
+ result = grow_data(lex, &remaining,
+ &curr, &prev);
+ if (result != ISC_R_SUCCESS)
+ goto done;
+ }
+ INSIST(remaining > 0U);
+ *curr++ = c;
+ *curr = '\0';
+ remaining--;
+ break;
+ case lexstate_maybecomment:
+ if (c == '*' &&
+ (lex->comments & ISC_LEXCOMMENT_C) != 0) {
+ state = lexstate_ccomment;
+ continue;
+ } else if (c == '/' &&
+ (lex->comments & ISC_LEXCOMMENT_CPLUSPLUS) != 0) {
+ state = lexstate_eatline;
+ continue;
+ }
+ pushback(source, c);
+ c = '/';
+ no_comments = ISC_FALSE;
+ state = saved_state;
+ goto no_read;
+ case lexstate_ccomment:
+ if (c == EOF) {
+ result = ISC_R_UNEXPECTEDEND;
+ goto done;
+ }
+ if (c == '*')
+ state = lexstate_ccommentend;
+ break;
+ case lexstate_ccommentend:
+ if (c == EOF) {
+ result = ISC_R_UNEXPECTEDEND;
+ goto done;
+ }
+ if (c == '/') {
+ /*
+ * C-style comments become a single space.
+ * We do this to ensure that a comment will
+ * act as a delimiter for strings and
+ * numbers.
+ */
+ c = ' ';
+ no_comments = ISC_FALSE;
+ state = saved_state;
+ goto no_read;
+ } else if (c != '*')
+ state = lexstate_ccomment;
+ break;
+ case lexstate_eatline:
+ if ((c == '\n') || (c == EOF)) {
+ no_comments = ISC_FALSE;
+ state = saved_state;
+ goto no_read;
+ }
+ break;
+ case lexstate_qstring:
+ if (c == EOF) {
+ result = ISC_R_UNEXPECTEDEND;
+ goto done;
+ }
+ if (c == '"') {
+ if (escaped) {
+ escaped = ISC_FALSE;
+ /*
+ * Overwrite the preceding backslash.
+ */
+ INSIST(prev != NULL);
+ *prev = '"';
+ } else {
+ tokenp->type = isc_tokentype_qstring;
+ tokenp->value.as_textregion.base =
+ lex->data;
+ tokenp->value.as_textregion.length =
+ lex->max_token - remaining;
+ no_comments = ISC_FALSE;
+ done = ISC_TRUE;
+ }
+ } else {
+ if (c == '\n' && !escaped &&
+ (options & ISC_LEXOPT_QSTRINGMULTILINE) == 0) {
+ pushback(source, c);
+ result = ISC_R_UNBALANCEDQUOTES;
+ goto done;
+ }
+ if (c == '\\' && !escaped)
+ escaped = ISC_TRUE;
+ else
+ escaped = ISC_FALSE;
+ if (remaining == 0U) {
+ result = grow_data(lex, &remaining,
+ &curr, &prev);
+ if (result != ISC_R_SUCCESS)
+ goto done;
+ }
+ INSIST(remaining > 0U);
+ prev = curr;
+ *curr++ = c;
+ *curr = '\0';
+ remaining--;
+ }
+ break;
+ default:
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_LEX,
+ ISC_MSG_UNEXPECTEDSTATE,
+ "Unexpected state %d"),
+ state);
+ /* Does not return. */
+ }
+
+ } while (!done);
+
+ result = ISC_R_SUCCESS;
+ done:
+#ifdef HAVE_FLOCKFILE
+ if (source->is_file)
+ funlockfile(source->input);
+#endif
+ return (result);
+}
+
+isc_result_t
+isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token,
+ isc_tokentype_t expect, isc_boolean_t eol)
+{
+ unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF |
+ ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE;
+ isc_result_t result;
+
+ if (expect == isc_tokentype_qstring)
+ options |= ISC_LEXOPT_QSTRING;
+ else if (expect == isc_tokentype_number)
+ options |= ISC_LEXOPT_NUMBER;
+ result = isc_lex_gettoken(lex, options, token);
+ if (result == ISC_R_RANGE)
+ isc_lex_ungettoken(lex, token);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ if (eol && ((token->type == isc_tokentype_eol) ||
+ (token->type == isc_tokentype_eof)))
+ return (ISC_R_SUCCESS);
+ if (token->type == isc_tokentype_string &&
+ expect == isc_tokentype_qstring)
+ return (ISC_R_SUCCESS);
+ if (token->type != expect) {
+ isc_lex_ungettoken(lex, token);
+ if (token->type == isc_tokentype_eol ||
+ token->type == isc_tokentype_eof)
+ return (ISC_R_UNEXPECTEDEND);
+ if (expect == isc_tokentype_number)
+ return (ISC_R_BADNUMBER);
+ return (ISC_R_UNEXPECTEDTOKEN);
+ }
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol)
+{
+ unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF |
+ ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE|
+ ISC_LEXOPT_NUMBER | ISC_LEXOPT_OCTAL;
+ isc_result_t result;
+
+ result = isc_lex_gettoken(lex, options, token);
+ if (result == ISC_R_RANGE)
+ isc_lex_ungettoken(lex, token);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ if (eol && ((token->type == isc_tokentype_eol) ||
+ (token->type == isc_tokentype_eof)))
+ return (ISC_R_SUCCESS);
+ if (token->type != isc_tokentype_number) {
+ isc_lex_ungettoken(lex, token);
+ if (token->type == isc_tokentype_eol ||
+ token->type == isc_tokentype_eof)
+ return (ISC_R_UNEXPECTEDEND);
+ return (ISC_R_BADNUMBER);
+ }
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) {
+ inputsource *source;
+ /*
+ * Unget the current token.
+ */
+
+ REQUIRE(VALID_LEX(lex));
+ source = HEAD(lex->sources);
+ REQUIRE(source != NULL);
+ REQUIRE(tokenp != NULL);
+ REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 ||
+ tokenp->type == isc_tokentype_eof);
+
+ UNUSED(tokenp);
+
+ isc_buffer_first(source->pushback);
+ lex->paren_count = lex->saved_paren_count;
+ source->line = source->saved_line;
+ source->at_eof = ISC_FALSE;
+}
+
+void
+isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r)
+{
+ inputsource *source;
+
+ REQUIRE(VALID_LEX(lex));
+ source = HEAD(lex->sources);
+ REQUIRE(source != NULL);
+ REQUIRE(tokenp != NULL);
+ REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 ||
+ tokenp->type == isc_tokentype_eof);
+
+ UNUSED(tokenp);
+
+ INSIST(source->ignored <= isc_buffer_consumedlength(source->pushback));
+ r->base = (unsigned char *)isc_buffer_base(source->pushback) +
+ source->ignored;
+ r->length = isc_buffer_consumedlength(source->pushback) -
+ source->ignored;
+}
+
+
+char *
+isc_lex_getsourcename(isc_lex_t *lex) {
+ inputsource *source;
+
+ REQUIRE(VALID_LEX(lex));
+ source = HEAD(lex->sources);
+
+ if (source == NULL)
+ return (NULL);
+
+ return (source->name);
+}
+
+unsigned long
+isc_lex_getsourceline(isc_lex_t *lex) {
+ inputsource *source;
+
+ REQUIRE(VALID_LEX(lex));
+ source = HEAD(lex->sources);
+
+ if (source == NULL)
+ return (0);
+
+ return (source->line);
+}
+
+
+isc_result_t
+isc_lex_setsourcename(isc_lex_t *lex, const char *name) {
+ inputsource *source;
+ char *newname;
+
+ REQUIRE(VALID_LEX(lex));
+ source = HEAD(lex->sources);
+
+ if (source == NULL)
+ return(ISC_R_NOTFOUND);
+ newname = isc_mem_strdup(lex->mctx, name);
+ if (newname == NULL)
+ return (ISC_R_NOMEMORY);
+ isc_mem_free(lex->mctx, source->name);
+ source->name = newname;
+ return (ISC_R_SUCCESS);
+}
+
+isc_boolean_t
+isc_lex_isfile(isc_lex_t *lex) {
+ inputsource *source;
+
+ REQUIRE(VALID_LEX(lex));
+
+ source = HEAD(lex->sources);
+
+ if (source == NULL)
+ return (ISC_FALSE);
+
+ return (source->is_file);
+}
diff --git a/lib/isc/lfsr.c b/lib/isc/lfsr.c
new file mode 100644
index 0000000..0b8d782
--- /dev/null
+++ b/lib/isc/lfsr.c
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: lfsr.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#include <isc/assertions.h>
+#include <isc/lfsr.h>
+#include <isc/util.h>
+
+#define VALID_LFSR(x) (x != NULL)
+
+void
+isc_lfsr_init(isc_lfsr_t *lfsr, isc_uint32_t state, unsigned int bits,
+ isc_uint32_t tap, unsigned int count,
+ isc_lfsrreseed_t reseed, void *arg)
+{
+ REQUIRE(VALID_LFSR(lfsr));
+ REQUIRE(8 <= bits && bits <= 32);
+ REQUIRE(tap != 0);
+
+ lfsr->state = state;
+ lfsr->bits = bits;
+ lfsr->tap = tap;
+ lfsr->count = count;
+ lfsr->reseed = reseed;
+ lfsr->arg = arg;
+
+ if (count == 0 && reseed != NULL)
+ reseed(lfsr, arg);
+ if (lfsr->state == 0)
+ lfsr->state = 0xffffffffU >> (32 - lfsr->bits);
+}
+
+/*!
+ * Return the next state of the lfsr.
+ */
+static inline isc_uint32_t
+lfsr_generate(isc_lfsr_t *lfsr)
+{
+
+ /*
+ * If the previous state is zero, we must fill it with something
+ * here, or we will begin to generate an extremely predictable output.
+ *
+ * First, give the reseed function a crack at it. If the state is
+ * still 0, set it to all ones.
+ */
+ if (lfsr->state == 0) {
+ if (lfsr->reseed != NULL)
+ lfsr->reseed(lfsr, lfsr->arg);
+ if (lfsr->state == 0)
+ lfsr->state = 0xffffffffU >> (32 - lfsr->bits);
+ }
+
+ if (lfsr->state & 0x01) {
+ lfsr->state = (lfsr->state >> 1) ^ lfsr->tap;
+ return (1);
+ } else {
+ lfsr->state >>= 1;
+ return (0);
+ }
+}
+
+void
+isc_lfsr_generate(isc_lfsr_t *lfsr, void *data, unsigned int count)
+{
+ unsigned char *p;
+ unsigned int bit;
+ unsigned int byte;
+
+ REQUIRE(VALID_LFSR(lfsr));
+ REQUIRE(data != NULL);
+ REQUIRE(count > 0);
+
+ p = data;
+ byte = count;
+
+ while (byte--) {
+ *p = 0;
+ for (bit = 0; bit < 7; bit++) {
+ *p |= lfsr_generate(lfsr);
+ *p <<= 1;
+ }
+ *p |= lfsr_generate(lfsr);
+ p++;
+ }
+
+ if (lfsr->count != 0 && lfsr->reseed != NULL) {
+ if (lfsr->count <= count * 8)
+ lfsr->reseed(lfsr, lfsr->arg);
+ else
+ lfsr->count -= (count * 8);
+ }
+}
+
+static inline isc_uint32_t
+lfsr_skipgenerate(isc_lfsr_t *lfsr, unsigned int skip)
+{
+ while (skip--)
+ (void)lfsr_generate(lfsr);
+
+ (void)lfsr_generate(lfsr);
+
+ return (lfsr->state);
+}
+
+/*
+ * Skip "skip" states in "lfsr".
+ */
+void
+isc_lfsr_skip(isc_lfsr_t *lfsr, unsigned int skip)
+{
+ REQUIRE(VALID_LFSR(lfsr));
+
+ while (skip--)
+ (void)lfsr_generate(lfsr);
+}
+
+/*
+ * Skip states in lfsr1 and lfsr2 using the other's current state.
+ * Return the final state of lfsr1 ^ lfsr2.
+ */
+isc_uint32_t
+isc_lfsr_generate32(isc_lfsr_t *lfsr1, isc_lfsr_t *lfsr2)
+{
+ isc_uint32_t state1, state2;
+ isc_uint32_t skip1, skip2;
+
+ REQUIRE(VALID_LFSR(lfsr1));
+ REQUIRE(VALID_LFSR(lfsr2));
+
+ skip1 = lfsr1->state & 0x01;
+ skip2 = lfsr2->state & 0x01;
+
+ /* cross-skip. */
+ state1 = lfsr_skipgenerate(lfsr1, skip2);
+ state2 = lfsr_skipgenerate(lfsr2, skip1);
+
+ return (state1 ^ state2);
+}
diff --git a/lib/isc/lib.c b/lib/isc/lib.c
new file mode 100644
index 0000000..a505425
--- /dev/null
+++ b/lib/isc/lib.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: lib.c,v 1.16 2009/09/02 23:48:02 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <isc/app.h>
+#include <isc/lib.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/once.h>
+#include <isc/socket.h>
+#include <isc/task.h>
+#include <isc/timer.h>
+#include <isc/util.h>
+
+/***
+ *** Globals
+ ***/
+
+LIBISC_EXTERNAL_DATA isc_msgcat_t * isc_msgcat = NULL;
+
+
+/***
+ *** Private
+ ***/
+
+static isc_once_t msgcat_once = ISC_ONCE_INIT;
+
+/***
+ *** Functions
+ ***/
+
+static void
+open_msgcat(void) {
+ isc_msgcat_open("libisc.cat", &isc_msgcat);
+}
+
+void
+isc_lib_initmsgcat(void) {
+ isc_result_t result;
+
+ /*!
+ * Initialize the ISC library's message catalog, isc_msgcat, if it
+ * has not already been initialized.
+ */
+
+ result = isc_once_do(&msgcat_once, open_msgcat);
+ if (result != ISC_R_SUCCESS) {
+ /*
+ * Normally we'd use RUNTIME_CHECK() or FATAL_ERROR(), but
+ * we can't do that here, since they might call us!
+ * (Note that the catalog might be open anyway, so we might
+ * as well try to provide an internationalized message.)
+ */
+ fprintf(stderr, "%s:%d: %s: isc_once_do() %s.\n",
+ __FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FATALERROR, "fatal error"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ abort();
+ }
+}
+
+#ifndef BIND9
+static isc_once_t register_once = ISC_ONCE_INIT;
+
+static void
+do_register(void) {
+ RUNTIME_CHECK(isc__mem_register() == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc__app_register() == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc__task_register() == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc__socket_register() == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc__timer_register() == ISC_R_SUCCESS);
+}
+
+void
+isc_lib_register() {
+ RUNTIME_CHECK(isc_once_do(&register_once, do_register)
+ == ISC_R_SUCCESS);
+}
+#endif
diff --git a/lib/isc/log.c b/lib/isc/log.c
new file mode 100644
index 0000000..0c142ce
--- /dev/null
+++ b/lib/isc/log.c
@@ -0,0 +1,1766 @@
+/*
+ * Copyright (C) 2004-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file
+ * \author Principal Authors: DCL */
+
+#include <config.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <time.h>
+
+#include <sys/types.h> /* dev_t FreeBSD 2.1 */
+
+#include <isc/dir.h>
+#include <isc/file.h>
+#include <isc/log.h>
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/print.h>
+#include <isc/stat.h>
+#include <isc/stdio.h>
+#include <isc/string.h>
+#include <isc/time.h>
+#include <isc/util.h>
+#include "ntp_stdlib.h" /* NTP change for strlcpy, strlcat */
+
+#define LCTX_MAGIC ISC_MAGIC('L', 'c', 't', 'x')
+#define VALID_CONTEXT(lctx) ISC_MAGIC_VALID(lctx, LCTX_MAGIC)
+
+#define LCFG_MAGIC ISC_MAGIC('L', 'c', 'f', 'g')
+#define VALID_CONFIG(lcfg) ISC_MAGIC_VALID(lcfg, LCFG_MAGIC)
+
+/*
+ * XXXDCL make dynamic?
+ */
+#define LOG_BUFFER_SIZE (8 * 1024)
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024 /* AIX and others don't define this. */
+#endif
+
+/*!
+ * This is the structure that holds each named channel. A simple linked
+ * list chains all of the channels together, so an individual channel is
+ * found by doing strcmp()s with the names down the list. Their should
+ * be no performance penalty from this as it is expected that the number
+ * of named channels will be no more than a dozen or so, and name lookups
+ * from the head of the list are only done when isc_log_usechannel() is
+ * called, which should also be very infrequent.
+ */
+typedef struct isc_logchannel isc_logchannel_t;
+
+struct isc_logchannel {
+ char * name;
+ unsigned int type;
+ int level;
+ unsigned int flags;
+ isc_logdestination_t destination;
+ ISC_LINK(isc_logchannel_t) link;
+};
+
+/*!
+ * The logchannellist structure associates categories and modules with
+ * channels. First the appropriate channellist is found based on the
+ * category, and then each structure in the linked list is checked for
+ * a matching module. It is expected that the number of channels
+ * associated with any given category will be very short, no more than
+ * three or four in the more unusual cases.
+ */
+typedef struct isc_logchannellist isc_logchannellist_t;
+
+struct isc_logchannellist {
+ const isc_logmodule_t * module;
+ isc_logchannel_t * channel;
+ ISC_LINK(isc_logchannellist_t) link;
+};
+
+/*!
+ * This structure is used to remember messages for pruning via
+ * isc_log_[v]write1().
+ */
+typedef struct isc_logmessage isc_logmessage_t;
+
+struct isc_logmessage {
+ char * text;
+ isc_time_t time;
+ ISC_LINK(isc_logmessage_t) link;
+};
+
+/*!
+ * The isc_logconfig structure is used to store the configurable information
+ * about where messages are actually supposed to be sent -- the information
+ * that could changed based on some configuration file, as opposed to the
+ * the category/module specification of isc_log_[v]write[1] that is compiled
+ * into a program, or the debug_level which is dynamic state information.
+ */
+struct isc_logconfig {
+ unsigned int magic;
+ isc_log_t * lctx;
+ ISC_LIST(isc_logchannel_t) channels;
+ ISC_LIST(isc_logchannellist_t) *channellists;
+ unsigned int channellist_count;
+ unsigned int duplicate_interval;
+ int highest_level;
+ char * tag;
+ isc_boolean_t dynamic;
+};
+
+/*!
+ * This isc_log structure provides the context for the isc_log functions.
+ * The log context locks itself in isc_log_doit, the internal backend to
+ * isc_log_write. The locking is necessary both to provide exclusive access
+ * to the buffer into which the message is formatted and to guard against
+ * competing threads trying to write to the same syslog resource. (On
+ * some systems, such as BSD/OS, stdio is thread safe but syslog is not.)
+ * Unfortunately, the lock cannot guard against a _different_ logging
+ * context in the same program competing for syslog's attention. Thus
+ * There Can Be Only One, but this is not enforced.
+ * XXXDCL enforce it?
+ *
+ * Note that the category and module information is not locked.
+ * This is because in the usual case, only one isc_log_t is ever created
+ * in a program, and the category/module registration happens only once.
+ * XXXDCL it might be wise to add more locking overall.
+ */
+struct isc_log {
+ /* Not locked. */
+ unsigned int magic;
+ isc_mem_t * mctx;
+ isc_logcategory_t * categories;
+ unsigned int category_count;
+ isc_logmodule_t * modules;
+ unsigned int module_count;
+ int debug_level;
+ isc_mutex_t lock;
+ /* Locked by isc_log lock. */
+ isc_logconfig_t * logconfig;
+ char buffer[LOG_BUFFER_SIZE];
+ ISC_LIST(isc_logmessage_t) messages;
+};
+
+/*!
+ * Used when ISC_LOG_PRINTLEVEL is enabled for a channel.
+ */
+static const char *log_level_strings[] = {
+ "debug",
+ "info",
+ "notice",
+ "warning",
+ "error",
+ "critical"
+};
+
+/*!
+ * Used to convert ISC_LOG_* priorities into syslog priorities.
+ * XXXDCL This will need modification for NT.
+ */
+static const int syslog_map[] = {
+ LOG_DEBUG,
+ LOG_INFO,
+ LOG_NOTICE,
+ LOG_WARNING,
+ LOG_ERR,
+ LOG_CRIT
+};
+
+/*!
+ * When adding new categories, a corresponding ISC_LOGCATEGORY_foo
+ * definition needs to be added to <isc/log.h>.
+ *
+ * The default category is provided so that the internal default can
+ * be overridden. Since the default is always looked up as the first
+ * channellist in the log context, it must come first in isc_categories[].
+ */
+LIBISC_EXTERNAL_DATA isc_logcategory_t isc_categories[] = {
+ { "default", 0 }, /* "default" must come first. */
+ { "general", 0 },
+ { NULL, 0 }
+};
+
+/*!
+ * See above comment for categories on LIBISC_EXTERNAL_DATA, and apply it to modules.
+ */
+LIBISC_EXTERNAL_DATA isc_logmodule_t isc_modules[] = {
+ { "socket", 0 },
+ { "time", 0 },
+ { "interface", 0 },
+ { "timer", 0 },
+ { "file", 0 },
+ { NULL, 0 }
+};
+
+/*!
+ * This essentially constant structure must be filled in at run time,
+ * because its channel member is pointed to a channel that is created
+ * dynamically with isc_log_createchannel.
+ */
+static isc_logchannellist_t default_channel;
+
+/*!
+ * libisc logs to this context.
+ */
+LIBISC_EXTERNAL_DATA isc_log_t *isc_lctx = NULL;
+
+/*!
+ * Forward declarations.
+ */
+static isc_result_t
+assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
+ const isc_logmodule_t *module, isc_logchannel_t *channel);
+
+static isc_result_t
+sync_channellist(isc_logconfig_t *lcfg);
+
+static isc_result_t
+greatest_version(isc_logchannel_t *channel, int *greatest);
+
+static isc_result_t
+roll_log(isc_logchannel_t *channel);
+
+static void
+isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level, isc_boolean_t write_once,
+ isc_msgcat_t *msgcat, int msgset, int msg,
+ const char *format, va_list args)
+ ISC_FORMAT_PRINTF(9, 0);
+
+/*@{*/
+/*!
+ * Convenience macros.
+ */
+
+#define FACILITY(channel) (channel->destination.facility)
+#define FILE_NAME(channel) (channel->destination.file.name)
+#define FILE_STREAM(channel) (channel->destination.file.stream)
+#define FILE_VERSIONS(channel) (channel->destination.file.versions)
+#define FILE_MAXSIZE(channel) (channel->destination.file.maximum_size)
+#define FILE_MAXREACHED(channel) (channel->destination.file.maximum_reached)
+
+/*@}*/
+/****
+ **** Public interfaces.
+ ****/
+
+/*
+ * Establish a new logging context, with default channels.
+ */
+isc_result_t
+isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp) {
+ isc_log_t *lctx;
+ isc_logconfig_t *lcfg = NULL;
+ isc_result_t result;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(lctxp != NULL && *lctxp == NULL);
+ REQUIRE(lcfgp == NULL || *lcfgp == NULL);
+
+ lctx = isc_mem_get(mctx, sizeof(*lctx));
+ if (lctx != NULL) {
+ lctx->mctx = mctx;
+ lctx->categories = NULL;
+ lctx->category_count = 0;
+ lctx->modules = NULL;
+ lctx->module_count = 0;
+ lctx->debug_level = 0;
+
+ ISC_LIST_INIT(lctx->messages);
+
+ result = isc_mutex_init(&lctx->lock);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_put(mctx, lctx, sizeof(*lctx));
+ return (result);
+ }
+
+ /*
+ * Normally setting the magic number is the last step done
+ * in a creation function, but a valid log context is needed
+ * by isc_log_registercategories and isc_logconfig_create.
+ * If either fails, the lctx is destroyed and not returned
+ * to the caller.
+ */
+ lctx->magic = LCTX_MAGIC;
+
+ isc_log_registercategories(lctx, isc_categories);
+ isc_log_registermodules(lctx, isc_modules);
+ result = isc_logconfig_create(lctx, &lcfg);
+
+ } else
+ result = ISC_R_NOMEMORY;
+
+ if (result == ISC_R_SUCCESS)
+ result = sync_channellist(lcfg);
+
+ if (result == ISC_R_SUCCESS) {
+ lctx->logconfig = lcfg;
+
+ *lctxp = lctx;
+ if (lcfgp != NULL)
+ *lcfgp = lcfg;
+
+ } else {
+ if (lcfg != NULL)
+ isc_logconfig_destroy(&lcfg);
+ if (lctx != NULL)
+ isc_log_destroy(&lctx);
+ }
+
+ return (result);
+}
+
+isc_result_t
+isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp) {
+ isc_logconfig_t *lcfg;
+ isc_logdestination_t destination;
+ isc_result_t result = ISC_R_SUCCESS;
+ int level = ISC_LOG_INFO;
+
+ REQUIRE(lcfgp != NULL && *lcfgp == NULL);
+ REQUIRE(VALID_CONTEXT(lctx));
+
+ lcfg = isc_mem_get(lctx->mctx, sizeof(*lcfg));
+
+ if (lcfg != NULL) {
+ lcfg->lctx = lctx;
+ lcfg->channellists = NULL;
+ lcfg->channellist_count = 0;
+ lcfg->duplicate_interval = 0;
+ lcfg->highest_level = level;
+ lcfg->tag = NULL;
+ lcfg->dynamic = ISC_FALSE;
+
+ ISC_LIST_INIT(lcfg->channels);
+
+ /*
+ * Normally the magic number is the last thing set in the
+ * structure, but isc_log_createchannel() needs a valid
+ * config. If the channel creation fails, the lcfg is not
+ * returned to the caller.
+ */
+ lcfg->magic = LCFG_MAGIC;
+
+ } else
+ result = ISC_R_NOMEMORY;
+
+ /*
+ * Create the default channels:
+ * default_syslog, default_stderr, default_debug and null.
+ */
+ if (result == ISC_R_SUCCESS) {
+ destination.facility = LOG_DAEMON;
+ result = isc_log_createchannel(lcfg, "default_syslog",
+ ISC_LOG_TOSYSLOG, level,
+ &destination, 0);
+ }
+
+ if (result == ISC_R_SUCCESS) {
+ destination.file.stream = stderr;
+ destination.file.name = NULL;
+ destination.file.versions = ISC_LOG_ROLLNEVER;
+ destination.file.maximum_size = 0;
+ result = isc_log_createchannel(lcfg, "default_stderr",
+ ISC_LOG_TOFILEDESC,
+ level,
+ &destination,
+ ISC_LOG_PRINTTIME);
+ }
+
+ if (result == ISC_R_SUCCESS) {
+ /*
+ * Set the default category's channel to default_stderr,
+ * which is at the head of the channels list because it was
+ * just created.
+ */
+ default_channel.channel = ISC_LIST_HEAD(lcfg->channels);
+
+ destination.file.stream = stderr;
+ destination.file.name = NULL;
+ destination.file.versions = ISC_LOG_ROLLNEVER;
+ destination.file.maximum_size = 0;
+ result = isc_log_createchannel(lcfg, "default_debug",
+ ISC_LOG_TOFILEDESC,
+ ISC_LOG_DYNAMIC,
+ &destination,
+ ISC_LOG_PRINTTIME);
+ }
+
+ if (result == ISC_R_SUCCESS)
+ result = isc_log_createchannel(lcfg, "null",
+ ISC_LOG_TONULL,
+ ISC_LOG_DYNAMIC,
+ NULL, 0);
+
+ if (result == ISC_R_SUCCESS)
+ *lcfgp = lcfg;
+
+ else
+ if (lcfg != NULL)
+ isc_logconfig_destroy(&lcfg);
+
+ return (result);
+}
+
+isc_logconfig_t *
+isc_logconfig_get(isc_log_t *lctx) {
+ REQUIRE(VALID_CONTEXT(lctx));
+
+ ENSURE(lctx->logconfig != NULL);
+
+ return (lctx->logconfig);
+}
+
+isc_result_t
+isc_logconfig_use(isc_log_t *lctx, isc_logconfig_t *lcfg) {
+ isc_logconfig_t *old_cfg;
+ isc_result_t result;
+
+ REQUIRE(VALID_CONTEXT(lctx));
+ REQUIRE(VALID_CONFIG(lcfg));
+ REQUIRE(lcfg->lctx == lctx);
+
+ /*
+ * Ensure that lcfg->channellist_count == lctx->category_count.
+ * They won't be equal if isc_log_usechannel has not been called
+ * since any call to isc_log_registercategories.
+ */
+ result = sync_channellist(lcfg);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ LOCK(&lctx->lock);
+
+ old_cfg = lctx->logconfig;
+ lctx->logconfig = lcfg;
+
+ UNLOCK(&lctx->lock);
+
+ isc_logconfig_destroy(&old_cfg);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_log_destroy(isc_log_t **lctxp) {
+ isc_log_t *lctx;
+ isc_logconfig_t *lcfg;
+ isc_mem_t *mctx;
+ isc_logmessage_t *message;
+
+ REQUIRE(lctxp != NULL && VALID_CONTEXT(*lctxp));
+
+ lctx = *lctxp;
+ mctx = lctx->mctx;
+
+ if (lctx->logconfig != NULL) {
+ lcfg = lctx->logconfig;
+ lctx->logconfig = NULL;
+ isc_logconfig_destroy(&lcfg);
+ }
+
+ DESTROYLOCK(&lctx->lock);
+
+ while ((message = ISC_LIST_HEAD(lctx->messages)) != NULL) {
+ ISC_LIST_UNLINK(lctx->messages, message, link);
+
+ isc_mem_put(mctx, message,
+ sizeof(*message) + strlen(message->text) + 1);
+ }
+
+ lctx->buffer[0] = '\0';
+ lctx->debug_level = 0;
+ lctx->categories = NULL;
+ lctx->category_count = 0;
+ lctx->modules = NULL;
+ lctx->module_count = 0;
+ lctx->mctx = NULL;
+ lctx->magic = 0;
+
+ isc_mem_put(mctx, lctx, sizeof(*lctx));
+
+ *lctxp = NULL;
+}
+
+void
+isc_logconfig_destroy(isc_logconfig_t **lcfgp) {
+ isc_logconfig_t *lcfg;
+ isc_mem_t *mctx;
+ isc_logchannel_t *channel;
+ isc_logchannellist_t *item;
+ char *filename;
+ unsigned int i;
+
+ REQUIRE(lcfgp != NULL && VALID_CONFIG(*lcfgp));
+
+ lcfg = *lcfgp;
+
+ /*
+ * This function cannot be called with a logconfig that is in
+ * use by a log context.
+ */
+ REQUIRE(lcfg->lctx != NULL && lcfg->lctx->logconfig != lcfg);
+
+ mctx = lcfg->lctx->mctx;
+
+ while ((channel = ISC_LIST_HEAD(lcfg->channels)) != NULL) {
+ ISC_LIST_UNLINK(lcfg->channels, channel, link);
+
+ if (channel->type == ISC_LOG_TOFILE) {
+ /*
+ * The filename for the channel may have ultimately
+ * started its life in user-land as a const string,
+ * but in isc_log_createchannel it gets copied
+ * into writable memory and is not longer truly const.
+ */
+ DE_CONST(FILE_NAME(channel), filename);
+ isc_mem_free(mctx, filename);
+
+ if (FILE_STREAM(channel) != NULL)
+ (void)fclose(FILE_STREAM(channel));
+ }
+
+ isc_mem_free(mctx, channel->name);
+ isc_mem_put(mctx, channel, sizeof(*channel));
+ }
+
+ for (i = 0; i < lcfg->channellist_count; i++)
+ while ((item = ISC_LIST_HEAD(lcfg->channellists[i])) != NULL) {
+ ISC_LIST_UNLINK(lcfg->channellists[i], item, link);
+ isc_mem_put(mctx, item, sizeof(*item));
+ }
+
+ if (lcfg->channellist_count > 0)
+ isc_mem_put(mctx, lcfg->channellists,
+ lcfg->channellist_count *
+ sizeof(ISC_LIST(isc_logchannellist_t)));
+
+ lcfg->dynamic = ISC_FALSE;
+ if (lcfg->tag != NULL)
+ isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
+ lcfg->tag = NULL;
+ lcfg->highest_level = 0;
+ lcfg->duplicate_interval = 0;
+ lcfg->magic = 0;
+
+ isc_mem_put(mctx, lcfg, sizeof(*lcfg));
+
+ *lcfgp = NULL;
+}
+
+void
+isc_log_registercategories(isc_log_t *lctx, isc_logcategory_t categories[]) {
+ isc_logcategory_t *catp;
+
+ REQUIRE(VALID_CONTEXT(lctx));
+ REQUIRE(categories != NULL && categories[0].name != NULL);
+
+ /*
+ * XXXDCL This somewhat sleazy situation of using the last pointer
+ * in one category array to point to the next array exists because
+ * this registration function returns void and I didn't want to have
+ * change everything that used it by making it return an isc_result_t.
+ * It would need to do that if it had to allocate memory to store
+ * pointers to each array passed in.
+ */
+ if (lctx->categories == NULL)
+ lctx->categories = categories;
+
+ else {
+ /*
+ * Adjust the last (NULL) pointer of the already registered
+ * categories to point to the incoming array.
+ */
+ for (catp = lctx->categories; catp->name != NULL; )
+ if (catp->id == UINT_MAX)
+ /*
+ * The name pointer points to the next array.
+ * Ick.
+ */
+ DE_CONST(catp->name, catp);
+ else
+ catp++;
+
+ catp->name = (void *)categories;
+ catp->id = UINT_MAX;
+ }
+
+ /*
+ * Update the id number of the category with its new global id.
+ */
+ for (catp = categories; catp->name != NULL; catp++)
+ catp->id = lctx->category_count++;
+}
+
+isc_logcategory_t *
+isc_log_categorybyname(isc_log_t *lctx, const char *name) {
+ isc_logcategory_t *catp;
+
+ REQUIRE(VALID_CONTEXT(lctx));
+ REQUIRE(name != NULL);
+
+ for (catp = lctx->categories; catp->name != NULL; )
+ if (catp->id == UINT_MAX)
+ /*
+ * catp is neither modified nor returned to the
+ * caller, so removing its const qualifier is ok.
+ */
+ DE_CONST(catp->name, catp);
+ else {
+ if (strcmp(catp->name, name) == 0)
+ return (catp);
+ catp++;
+ }
+
+ return (NULL);
+}
+
+void
+isc_log_registermodules(isc_log_t *lctx, isc_logmodule_t modules[]) {
+ isc_logmodule_t *modp;
+
+ REQUIRE(VALID_CONTEXT(lctx));
+ REQUIRE(modules != NULL && modules[0].name != NULL);
+
+ /*
+ * XXXDCL This somewhat sleazy situation of using the last pointer
+ * in one category array to point to the next array exists because
+ * this registration function returns void and I didn't want to have
+ * change everything that used it by making it return an isc_result_t.
+ * It would need to do that if it had to allocate memory to store
+ * pointers to each array passed in.
+ */
+ if (lctx->modules == NULL)
+ lctx->modules = modules;
+
+ else {
+ /*
+ * Adjust the last (NULL) pointer of the already registered
+ * modules to point to the incoming array.
+ */
+ for (modp = lctx->modules; modp->name != NULL; )
+ if (modp->id == UINT_MAX)
+ /*
+ * The name pointer points to the next array.
+ * Ick.
+ */
+ DE_CONST(modp->name, modp);
+ else
+ modp++;
+
+ modp->name = (void *)modules;
+ modp->id = UINT_MAX;
+ }
+
+ /*
+ * Update the id number of the module with its new global id.
+ */
+ for (modp = modules; modp->name != NULL; modp++)
+ modp->id = lctx->module_count++;
+}
+
+isc_logmodule_t *
+isc_log_modulebyname(isc_log_t *lctx, const char *name) {
+ isc_logmodule_t *modp;
+
+ REQUIRE(VALID_CONTEXT(lctx));
+ REQUIRE(name != NULL);
+
+ for (modp = lctx->modules; modp->name != NULL; )
+ if (modp->id == UINT_MAX)
+ /*
+ * modp is neither modified nor returned to the
+ * caller, so removing its const qualifier is ok.
+ */
+ DE_CONST(modp->name, modp);
+ else {
+ if (strcmp(modp->name, name) == 0)
+ return (modp);
+ modp++;
+ }
+
+ return (NULL);
+}
+
+isc_result_t
+isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
+ unsigned int type, int level,
+ const isc_logdestination_t *destination,
+ unsigned int flags)
+{
+ isc_logchannel_t *channel;
+ isc_mem_t *mctx;
+
+ REQUIRE(VALID_CONFIG(lcfg));
+ REQUIRE(name != NULL);
+ REQUIRE(type == ISC_LOG_TOSYSLOG || type == ISC_LOG_TOFILE ||
+ type == ISC_LOG_TOFILEDESC || type == ISC_LOG_TONULL);
+ REQUIRE(destination != NULL || type == ISC_LOG_TONULL);
+ REQUIRE(level >= ISC_LOG_CRITICAL);
+ REQUIRE((flags &
+ (unsigned int)~(ISC_LOG_PRINTALL | ISC_LOG_DEBUGONLY)) == 0);
+
+ /* XXXDCL find duplicate names? */
+
+ mctx = lcfg->lctx->mctx;
+
+ channel = isc_mem_get(mctx, sizeof(*channel));
+ if (channel == NULL)
+ return (ISC_R_NOMEMORY);
+
+ channel->name = isc_mem_strdup(mctx, name);
+ if (channel->name == NULL) {
+ isc_mem_put(mctx, channel, sizeof(*channel));
+ return (ISC_R_NOMEMORY);
+ }
+
+ channel->type = type;
+ channel->level = level;
+ channel->flags = flags;
+ ISC_LINK_INIT(channel, link);
+
+ switch (type) {
+ case ISC_LOG_TOSYSLOG:
+ FACILITY(channel) = destination->facility;
+ break;
+
+ case ISC_LOG_TOFILE:
+ /*
+ * The file name is copied because greatest_version wants
+ * to scribble on it, so it needs to be definitely in
+ * writable memory.
+ */
+ FILE_NAME(channel) =
+ isc_mem_strdup(mctx, destination->file.name);
+ FILE_STREAM(channel) = NULL;
+ FILE_VERSIONS(channel) = destination->file.versions;
+ FILE_MAXSIZE(channel) = destination->file.maximum_size;
+ FILE_MAXREACHED(channel) = ISC_FALSE;
+ break;
+
+ case ISC_LOG_TOFILEDESC:
+ FILE_NAME(channel) = NULL;
+ FILE_STREAM(channel) = destination->file.stream;
+ FILE_MAXSIZE(channel) = 0;
+ FILE_VERSIONS(channel) = ISC_LOG_ROLLNEVER;
+ break;
+
+ case ISC_LOG_TONULL:
+ /* Nothing. */
+ break;
+
+ default:
+ isc_mem_put(mctx, channel->name, strlen(channel->name) + 1);
+ isc_mem_put(mctx, channel, sizeof(*channel));
+ return (ISC_R_UNEXPECTED);
+ }
+
+ ISC_LIST_PREPEND(lcfg->channels, channel, link);
+
+ /*
+ * If default_stderr was redefined, make the default category
+ * point to the new default_stderr.
+ */
+ if (strcmp(name, "default_stderr") == 0)
+ default_channel.channel = channel;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_log_usechannel(isc_logconfig_t *lcfg, const char *name,
+ const isc_logcategory_t *category,
+ const isc_logmodule_t *module)
+{
+ isc_log_t *lctx;
+ isc_logchannel_t *channel;
+ isc_result_t result = ISC_R_SUCCESS;
+ unsigned int i;
+
+ REQUIRE(VALID_CONFIG(lcfg));
+ REQUIRE(name != NULL);
+
+ lctx = lcfg->lctx;
+
+ REQUIRE(category == NULL || category->id < lctx->category_count);
+ REQUIRE(module == NULL || module->id < lctx->module_count);
+
+ for (channel = ISC_LIST_HEAD(lcfg->channels); channel != NULL;
+ channel = ISC_LIST_NEXT(channel, link))
+ if (strcmp(name, channel->name) == 0)
+ break;
+
+ if (channel == NULL)
+ return (ISC_R_NOTFOUND);
+
+ if (category != NULL)
+ result = assignchannel(lcfg, category->id, module, channel);
+
+ else
+ /*
+ * Assign to all categories. Note that this includes
+ * the default channel.
+ */
+ for (i = 0; i < lctx->category_count; i++) {
+ result = assignchannel(lcfg, i, module, channel);
+ if (result != ISC_R_SUCCESS)
+ break;
+ }
+
+ return (result);
+}
+
+void
+isc_log_write(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level, const char *format, ...)
+{
+ va_list args;
+
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+
+ va_start(args, format);
+ isc_log_doit(lctx, category, module, level, ISC_FALSE,
+ NULL, 0, 0, format, args);
+ va_end(args);
+}
+
+void
+isc_log_vwrite(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ const char *format, va_list args)
+{
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+ isc_log_doit(lctx, category, module, level, ISC_FALSE,
+ NULL, 0, 0, format, args);
+}
+
+void
+isc_log_write1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level, const char *format, ...)
+{
+ va_list args;
+
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+
+ va_start(args, format);
+ isc_log_doit(lctx, category, module, level, ISC_TRUE,
+ NULL, 0, 0, format, args);
+ va_end(args);
+}
+
+void
+isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ const char *format, va_list args)
+{
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+ isc_log_doit(lctx, category, module, level, ISC_TRUE,
+ NULL, 0, 0, format, args);
+}
+
+void
+isc_log_iwrite(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int msg,
+ const char *format, ...)
+{
+ va_list args;
+
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+
+ va_start(args, format);
+ isc_log_doit(lctx, category, module, level, ISC_FALSE,
+ msgcat, msgset, msg, format, args);
+ va_end(args);
+}
+
+void
+isc_log_ivwrite(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int msg,
+ const char *format, va_list args)
+{
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+ isc_log_doit(lctx, category, module, level, ISC_FALSE,
+ msgcat, msgset, msg, format, args);
+}
+
+void
+isc_log_iwrite1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int msg,
+ const char *format, ...)
+{
+ va_list args;
+
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+
+ va_start(args, format);
+ isc_log_doit(lctx, category, module, level, ISC_TRUE,
+ msgcat, msgset, msg, format, args);
+ va_end(args);
+}
+
+void
+isc_log_ivwrite1(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int msg,
+ const char *format, va_list args)
+{
+ /*
+ * Contract checking is done in isc_log_doit().
+ */
+ isc_log_doit(lctx, category, module, level, ISC_TRUE,
+ msgcat, msgset, msg, format, args);
+}
+
+void
+isc_log_setcontext(isc_log_t *lctx) {
+ isc_lctx = lctx;
+}
+
+void
+isc_log_setdebuglevel(isc_log_t *lctx, unsigned int level) {
+ isc_logchannel_t *channel;
+
+ REQUIRE(VALID_CONTEXT(lctx));
+
+ LOCK(&lctx->lock);
+
+ lctx->debug_level = level;
+ /*
+ * Close ISC_LOG_DEBUGONLY channels if level is zero.
+ */
+ if (lctx->debug_level == 0)
+ for (channel = ISC_LIST_HEAD(lctx->logconfig->channels);
+ channel != NULL;
+ channel = ISC_LIST_NEXT(channel, link))
+ if (channel->type == ISC_LOG_TOFILE &&
+ (channel->flags & ISC_LOG_DEBUGONLY) != 0 &&
+ FILE_STREAM(channel) != NULL) {
+ (void)fclose(FILE_STREAM(channel));
+ FILE_STREAM(channel) = NULL;
+ }
+ UNLOCK(&lctx->lock);
+}
+
+unsigned int
+isc_log_getdebuglevel(isc_log_t *lctx) {
+ REQUIRE(VALID_CONTEXT(lctx));
+
+ return (lctx->debug_level);
+}
+
+void
+isc_log_setduplicateinterval(isc_logconfig_t *lcfg, unsigned int interval) {
+ REQUIRE(VALID_CONFIG(lcfg));
+
+ lcfg->duplicate_interval = interval;
+}
+
+unsigned int
+isc_log_getduplicateinterval(isc_logconfig_t *lcfg) {
+ REQUIRE(VALID_CONTEXT(lcfg));
+
+ return (lcfg->duplicate_interval);
+}
+
+isc_result_t
+isc_log_settag(isc_logconfig_t *lcfg, const char *tag) {
+ REQUIRE(VALID_CONFIG(lcfg));
+
+ if (tag != NULL && *tag != '\0') {
+ if (lcfg->tag != NULL)
+ isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
+ lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag);
+ if (lcfg->tag == NULL)
+ return (ISC_R_NOMEMORY);
+
+ } else {
+ if (lcfg->tag != NULL)
+ isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
+ lcfg->tag = NULL;
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+char *
+isc_log_gettag(isc_logconfig_t *lcfg) {
+ REQUIRE(VALID_CONFIG(lcfg));
+
+ return (lcfg->tag);
+}
+
+/* XXXDCL NT -- This interface will assuredly be changing. */
+void
+isc_log_opensyslog(const char *tag, int options, int facility) {
+ (void)openlog(tag, options, facility);
+}
+
+void
+isc_log_closefilelogs(isc_log_t *lctx) {
+ isc_logchannel_t *channel;
+
+ REQUIRE(VALID_CONTEXT(lctx));
+
+ LOCK(&lctx->lock);
+ for (channel = ISC_LIST_HEAD(lctx->logconfig->channels);
+ channel != NULL;
+ channel = ISC_LIST_NEXT(channel, link))
+
+ if (channel->type == ISC_LOG_TOFILE &&
+ FILE_STREAM(channel) != NULL) {
+ (void)fclose(FILE_STREAM(channel));
+ FILE_STREAM(channel) = NULL;
+ }
+ UNLOCK(&lctx->lock);
+}
+
+/****
+ **** Internal functions
+ ****/
+
+static isc_result_t
+assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
+ const isc_logmodule_t *module, isc_logchannel_t *channel)
+{
+ isc_logchannellist_t *new_item;
+ isc_log_t *lctx;
+ isc_result_t result;
+
+ REQUIRE(VALID_CONFIG(lcfg));
+
+ lctx = lcfg->lctx;
+
+ REQUIRE(category_id < lctx->category_count);
+ REQUIRE(module == NULL || module->id < lctx->module_count);
+ REQUIRE(channel != NULL);
+
+ /*
+ * Ensure lcfg->channellist_count == lctx->category_count.
+ */
+ result = sync_channellist(lcfg);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ new_item = isc_mem_get(lctx->mctx, sizeof(*new_item));
+ if (new_item == NULL)
+ return (ISC_R_NOMEMORY);
+
+ new_item->channel = channel;
+ new_item->module = module;
+ ISC_LIST_INITANDPREPEND(lcfg->channellists[category_id],
+ new_item, link);
+
+ /*
+ * Remember the highest logging level set by any channel in the
+ * logging config, so isc_log_doit() can quickly return if the
+ * message is too high to be logged by any channel.
+ */
+ if (channel->type != ISC_LOG_TONULL) {
+ if (lcfg->highest_level < channel->level)
+ lcfg->highest_level = channel->level;
+ if (channel->level == ISC_LOG_DYNAMIC)
+ lcfg->dynamic = ISC_TRUE;
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * This would ideally be part of isc_log_registercategories(), except then
+ * that function would have to return isc_result_t instead of void.
+ */
+static isc_result_t
+sync_channellist(isc_logconfig_t *lcfg) {
+ unsigned int bytes;
+ isc_log_t *lctx;
+ void *lists;
+
+ REQUIRE(VALID_CONFIG(lcfg));
+
+ lctx = lcfg->lctx;
+
+ REQUIRE(lctx->category_count != 0);
+
+ if (lctx->category_count == lcfg->channellist_count)
+ return (ISC_R_SUCCESS);
+
+ bytes = lctx->category_count * sizeof(ISC_LIST(isc_logchannellist_t));
+
+ lists = isc_mem_get(lctx->mctx, bytes);
+
+ if (lists == NULL)
+ return (ISC_R_NOMEMORY);
+
+ memset(lists, 0, bytes);
+
+ if (lcfg->channellist_count != 0) {
+ bytes = lcfg->channellist_count *
+ sizeof(ISC_LIST(isc_logchannellist_t));
+ memcpy(lists, lcfg->channellists, bytes);
+ isc_mem_put(lctx->mctx, lcfg->channellists, bytes);
+ }
+
+ lcfg->channellists = lists;
+ lcfg->channellist_count = lctx->category_count;
+
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+greatest_version(isc_logchannel_t *channel, int *greatestp) {
+ /* XXXDCL HIGHLY NT */
+ char *basename, *digit_end;
+ const char *dirname;
+ int version, greatest = -1;
+ unsigned int basenamelen;
+ isc_dir_t dir;
+ isc_result_t result;
+ char sep = '/';
+#ifdef _WIN32
+ char *basename2;
+#endif
+
+ REQUIRE(channel->type == ISC_LOG_TOFILE);
+
+ /*
+ * It is safe to DE_CONST the file.name because it was copied
+ * with isc_mem_strdup in isc_log_createchannel.
+ */
+ basename = strrchr(FILE_NAME(channel), sep);
+#ifdef _WIN32
+ basename2 = strrchr(FILE_NAME(channel), '\\');
+ if ((basename != NULL && basename2 != NULL && basename2 > basename) ||
+ (basename == NULL && basename2 != NULL)) {
+ basename = basename2;
+ sep = '\\';
+ }
+#endif
+ if (basename != NULL) {
+ *basename++ = '\0';
+ dirname = FILE_NAME(channel);
+ } else {
+ DE_CONST(FILE_NAME(channel), basename);
+ dirname = ".";
+ }
+ basenamelen = strlen(basename);
+
+ isc_dir_init(&dir);
+ result = isc_dir_open(&dir, dirname);
+
+ /*
+ * Replace the file separator if it was taken out.
+ */
+ if (basename != FILE_NAME(channel))
+ *(basename - 1) = sep;
+
+ /*
+ * Return if the directory open failed.
+ */
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ while (isc_dir_read(&dir) == ISC_R_SUCCESS) {
+ if (dir.entry.length > basenamelen &&
+ strncmp(dir.entry.name, basename, basenamelen) == 0 &&
+ dir.entry.name[basenamelen] == '.') {
+
+ version = strtol(&dir.entry.name[basenamelen + 1],
+ &digit_end, 10);
+ if (*digit_end == '\0' && version > greatest)
+ greatest = version;
+ }
+ }
+ isc_dir_close(&dir);
+
+ *greatestp = ++greatest;
+
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+roll_log(isc_logchannel_t *channel) {
+ int i, n, greatest;
+ char current[PATH_MAX + 1];
+ char new[PATH_MAX + 1];
+ const char *path;
+ isc_result_t result;
+
+ /*
+ * Do nothing (not even excess version trimming) if ISC_LOG_ROLLNEVER
+ * is specified. Apparently complete external control over the log
+ * files is desired.
+ */
+ if (FILE_VERSIONS(channel) == ISC_LOG_ROLLNEVER)
+ return (ISC_R_SUCCESS);
+
+ path = FILE_NAME(channel);
+
+ /*
+ * Set greatest_version to the greatest existing version
+ * (not the maximum requested version). This is 1 based even
+ * though the file names are 0 based, so an oldest log of log.1
+ * is a greatest_version of 2.
+ */
+ result = greatest_version(channel, &greatest);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /*
+ * Now greatest should be set to the highest version number desired.
+ * Since the highest number is one less than FILE_VERSIONS(channel)
+ * when not doing infinite log rolling, greatest will need to be
+ * decremented when it is equal to -- or greater than --
+ * FILE_VERSIONS(channel). When greatest is less than
+ * FILE_VERSIONS(channel), it is already suitable for use as
+ * the maximum version number.
+ */
+
+ if (FILE_VERSIONS(channel) == ISC_LOG_ROLLINFINITE ||
+ FILE_VERSIONS(channel) > greatest)
+ ; /* Do nothing. */
+ else
+ /*
+ * When greatest is >= FILE_VERSIONS(channel), it needs to
+ * be reduced until it is FILE_VERSIONS(channel) - 1.
+ * Remove any excess logs on the way to that value.
+ */
+ while (--greatest >= FILE_VERSIONS(channel)) {
+ n = snprintf(current, sizeof(current), "%s.%d",
+ path, greatest);
+ if (n >= (int)sizeof(current) || n < 0)
+ result = ISC_R_NOSPACE;
+ else
+ result = isc_file_remove(current);
+ if (result != ISC_R_SUCCESS &&
+ result != ISC_R_FILENOTFOUND)
+ syslog(LOG_ERR,
+ "unable to remove log file '%s.%d': %s",
+ path, greatest,
+ isc_result_totext(result));
+ }
+
+ for (i = greatest; i > 0; i--) {
+ result = ISC_R_SUCCESS;
+ n = snprintf(current, sizeof(current), "%s.%d", path, i - 1);
+ if (n >= (int)sizeof(current) || n < 0)
+ result = ISC_R_NOSPACE;
+ if (result == ISC_R_SUCCESS) {
+ n = snprintf(new, sizeof(new), "%s.%d", path, i);
+ if (n >= (int)sizeof(new) || n < 0)
+ result = ISC_R_NOSPACE;
+ }
+ if (result == ISC_R_SUCCESS)
+ result = isc_file_rename(current, new);
+ if (result != ISC_R_SUCCESS &&
+ result != ISC_R_FILENOTFOUND)
+ syslog(LOG_ERR,
+ "unable to rename log file '%s.%d' to "
+ "'%s.%d': %s", path, i - 1, path, i,
+ isc_result_totext(result));
+ }
+
+ if (FILE_VERSIONS(channel) != 0) {
+ n = snprintf(new, sizeof(new), "%s.0", path);
+ if (n >= (int)sizeof(new) || n < 0)
+ result = ISC_R_NOSPACE;
+ else
+ result = isc_file_rename(path, new);
+ if (result != ISC_R_SUCCESS &&
+ result != ISC_R_FILENOTFOUND)
+ syslog(LOG_ERR,
+ "unable to rename log file '%s' to '%s.0': %s",
+ path, path, isc_result_totext(result));
+ } else {
+ result = isc_file_remove(path);
+ if (result != ISC_R_SUCCESS &&
+ result != ISC_R_FILENOTFOUND)
+ syslog(LOG_ERR, "unable to remove log file '%s': %s",
+ path, isc_result_totext(result));
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+isc_log_open(isc_logchannel_t *channel) {
+ struct stat statbuf;
+ isc_boolean_t regular_file;
+ isc_boolean_t roll = ISC_FALSE;
+ isc_result_t result = ISC_R_SUCCESS;
+ const char *path;
+
+ REQUIRE(channel->type == ISC_LOG_TOFILE);
+ REQUIRE(FILE_STREAM(channel) == NULL);
+
+ path = FILE_NAME(channel);
+
+ REQUIRE(path != NULL && *path != '\0');
+
+ /*
+ * Determine type of file; only regular files will be
+ * version renamed, and only if the base file exists
+ * and either has no size limit or has reached its size limit.
+ */
+ if (stat(path, &statbuf) == 0) {
+ regular_file = S_ISREG(statbuf.st_mode) ? ISC_TRUE : ISC_FALSE;
+ /* XXXDCL if not regular_file complain? */
+ if ((FILE_MAXSIZE(channel) == 0 &&
+ FILE_VERSIONS(channel) != ISC_LOG_ROLLNEVER) ||
+ (FILE_MAXSIZE(channel) > 0 &&
+ statbuf.st_size >= FILE_MAXSIZE(channel)))
+ roll = regular_file;
+ } else if (errno == ENOENT) {
+ regular_file = ISC_TRUE;
+ POST(regular_file);
+ } else
+ result = ISC_R_INVALIDFILE;
+
+ /*
+ * Version control.
+ */
+ if (result == ISC_R_SUCCESS && roll) {
+ if (FILE_VERSIONS(channel) == ISC_LOG_ROLLNEVER)
+ return (ISC_R_MAXSIZE);
+ result = roll_log(channel);
+ if (result != ISC_R_SUCCESS) {
+ if ((channel->flags & ISC_LOG_OPENERR) == 0) {
+ syslog(LOG_ERR,
+ "isc_log_open: roll_log '%s' "
+ "failed: %s",
+ FILE_NAME(channel),
+ isc_result_totext(result));
+ channel->flags |= ISC_LOG_OPENERR;
+ }
+ return (result);
+ }
+ }
+
+ result = isc_stdio_open(path, "a", &FILE_STREAM(channel));
+
+ return (result);
+}
+
+isc_boolean_t
+isc_log_wouldlog(isc_log_t *lctx, int level) {
+ /*
+ * Try to avoid locking the mutex for messages which can't
+ * possibly be logged to any channels -- primarily debugging
+ * messages that the debug level is not high enough to print.
+ *
+ * If the level is (mathematically) less than or equal to the
+ * highest_level, or if there is a dynamic channel and the level is
+ * less than or equal to the debug level, the main loop must be
+ * entered to see if the message should really be output.
+ *
+ * NOTE: this is UNLOCKED access to the logconfig. However,
+ * the worst thing that can happen is that a bad decision is made
+ * about returning without logging, and that's not a big concern,
+ * because that's a risk anyway if the logconfig is being
+ * dynamically changed.
+ */
+
+ if (lctx == NULL || lctx->logconfig == NULL)
+ return (ISC_FALSE);
+
+ return (ISC_TF(level <= lctx->logconfig->highest_level ||
+ (lctx->logconfig->dynamic &&
+ level <= lctx->debug_level)));
+}
+
+static void
+isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level, isc_boolean_t write_once,
+ isc_msgcat_t *msgcat, int msgset, int msg,
+ const char *format, va_list args)
+{
+ int syslog_level;
+ char time_string[64];
+ char level_string[24];
+ size_t octets;
+ const char *iformat;
+ struct stat statbuf;
+ isc_boolean_t matched = ISC_FALSE;
+ isc_boolean_t printtime, printtag;
+ isc_boolean_t printcategory, printmodule, printlevel;
+ isc_logconfig_t *lcfg;
+ isc_logchannel_t *channel;
+ isc_logchannellist_t *category_channels;
+ isc_result_t result;
+
+ REQUIRE(lctx == NULL || VALID_CONTEXT(lctx));
+ REQUIRE(category != NULL);
+ REQUIRE(module != NULL);
+ REQUIRE(level != ISC_LOG_DYNAMIC);
+ REQUIRE(format != NULL);
+
+ /*
+ * Programs can use libraries that use this logging code without
+ * wanting to do any logging, thus the log context is allowed to
+ * be non-existent.
+ */
+ if (lctx == NULL)
+ return;
+
+ REQUIRE(category->id < lctx->category_count);
+ REQUIRE(module->id < lctx->module_count);
+
+ if (! isc_log_wouldlog(lctx, level))
+ return;
+
+ if (msgcat != NULL)
+ iformat = isc_msgcat_get(msgcat, msgset, msg, format);
+ else
+ iformat = format;
+
+ time_string[0] = '\0';
+ level_string[0] = '\0';
+
+ LOCK(&lctx->lock);
+
+ lctx->buffer[0] = '\0';
+
+ lcfg = lctx->logconfig;
+
+ category_channels = ISC_LIST_HEAD(lcfg->channellists[category->id]);
+
+ /*
+ * XXXDCL add duplicate filtering? (To not write multiple times to
+ * the same source via various channels).
+ */
+ do {
+ /*
+ * If the channel list end was reached and a match was made,
+ * everything is finished.
+ */
+ if (category_channels == NULL && matched)
+ break;
+
+ if (category_channels == NULL && ! matched &&
+ category_channels != ISC_LIST_HEAD(lcfg->channellists[0]))
+ /*
+ * No category/module pair was explicitly configured.
+ * Try the category named "default".
+ */
+ category_channels =
+ ISC_LIST_HEAD(lcfg->channellists[0]);
+
+ if (category_channels == NULL && ! matched)
+ /*
+ * No matching module was explicitly configured
+ * for the category named "default". Use the internal
+ * default channel.
+ */
+ category_channels = &default_channel;
+
+ if (category_channels->module != NULL &&
+ category_channels->module != module) {
+ category_channels = ISC_LIST_NEXT(category_channels,
+ link);
+ continue;
+ }
+
+ matched = ISC_TRUE;
+
+ channel = category_channels->channel;
+ category_channels = ISC_LIST_NEXT(category_channels, link);
+
+ if (((channel->flags & ISC_LOG_DEBUGONLY) != 0) &&
+ lctx->debug_level == 0)
+ continue;
+
+ if (channel->level == ISC_LOG_DYNAMIC) {
+ if (lctx->debug_level < level)
+ continue;
+ } else if (channel->level < level)
+ continue;
+
+ if ((channel->flags & ISC_LOG_PRINTTIME) != 0 &&
+ time_string[0] == '\0') {
+ isc_time_t isctime;
+
+ TIME_NOW(&isctime);
+ isc_time_formattimestamp(&isctime, time_string,
+ sizeof(time_string));
+ }
+
+ if ((channel->flags & ISC_LOG_PRINTLEVEL) != 0 &&
+ level_string[0] == '\0') {
+ if (level < ISC_LOG_CRITICAL)
+ snprintf(level_string, sizeof(level_string),
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_LOG,
+ ISC_MSG_LEVEL,
+ "level %d: "),
+ level);
+ else if (level > ISC_LOG_DYNAMIC)
+ snprintf(level_string, sizeof(level_string),
+ "%s %d: ", log_level_strings[0],
+ level);
+ else
+ snprintf(level_string, sizeof(level_string),
+ "%s: ", log_level_strings[-level]);
+ }
+
+ /*
+ * Only format the message once.
+ */
+ if (lctx->buffer[0] == '\0') {
+ (void)vsnprintf(lctx->buffer, sizeof(lctx->buffer),
+ iformat, args);
+
+ /*
+ * Check for duplicates.
+ */
+ if (write_once) {
+ isc_logmessage_t *message, *new;
+ isc_time_t oldest;
+ isc_interval_t interval;
+
+ isc_interval_set(&interval,
+ lcfg->duplicate_interval, 0);
+
+ /*
+ * 'oldest' is the age of the oldest messages
+ * which fall within the duplicate_interval
+ * range.
+ */
+ TIME_NOW(&oldest);
+ if (isc_time_subtract(&oldest, &interval, &oldest)
+ != ISC_R_SUCCESS)
+ /*
+ * Can't effectively do the checking
+ * without having a valid time.
+ */
+ message = NULL;
+ else
+ message =ISC_LIST_HEAD(lctx->messages);
+
+ while (message != NULL) {
+ if (isc_time_compare(&message->time,
+ &oldest) < 0) {
+ /*
+ * This message is older
+ * than the duplicate_interval,
+ * so it should be dropped from
+ * the history.
+ *
+ * Setting the interval to be
+ * to be longer will obviously
+ * not cause the expired
+ * message to spring back into
+ * existence.
+ */
+ new = ISC_LIST_NEXT(message,
+ link);
+
+ ISC_LIST_UNLINK(lctx->messages,
+ message, link);
+
+ isc_mem_put(lctx->mctx,
+ message,
+ sizeof(*message) + 1 +
+ strlen(message->text));
+
+ message = new;
+ continue;
+ }
+
+ /*
+ * This message is in the duplicate
+ * filtering interval ...
+ */
+ if (strcmp(lctx->buffer, message->text)
+ == 0) {
+ /*
+ * ... and it is a duplicate.
+ * Unlock the mutex and
+ * get the hell out of Dodge.
+ */
+ UNLOCK(&lctx->lock);
+ return;
+ }
+
+ message = ISC_LIST_NEXT(message, link);
+ }
+
+ /*
+ * It wasn't in the duplicate interval,
+ * so add it to the message list.
+ */
+ octets = strlen(lctx->buffer) + 1;
+ new = isc_mem_get(lctx->mctx,
+ sizeof(isc_logmessage_t) +
+ octets);
+ if (new != NULL) {
+ /*
+ * Put the text immediately after
+ * the struct. The strcpy is safe.
+ */
+ new->text = (char *)(new + 1);
+ strlcpy(new->text, lctx->buffer, octets);
+
+ TIME_NOW(&new->time);
+
+ ISC_LIST_APPEND(lctx->messages,
+ new, link);
+ }
+ }
+ }
+
+ printtime = ISC_TF((channel->flags & ISC_LOG_PRINTTIME)
+ != 0);
+ printtag = ISC_TF((channel->flags & ISC_LOG_PRINTTAG)
+ != 0 && lcfg->tag != NULL);
+ printcategory = ISC_TF((channel->flags & ISC_LOG_PRINTCATEGORY)
+ != 0);
+ printmodule = ISC_TF((channel->flags & ISC_LOG_PRINTMODULE)
+ != 0);
+ printlevel = ISC_TF((channel->flags & ISC_LOG_PRINTLEVEL)
+ != 0);
+
+ switch (channel->type) {
+ case ISC_LOG_TOFILE:
+ if (FILE_MAXREACHED(channel)) {
+ /*
+ * If the file can be rolled, OR
+ * If the file no longer exists, OR
+ * If the file is less than the maximum size,
+ * (such as if it had been renamed and
+ * a new one touched, or it was truncated
+ * in place)
+ * ... then close it to trigger reopening.
+ */
+ if (FILE_VERSIONS(channel) !=
+ ISC_LOG_ROLLNEVER ||
+ (stat(FILE_NAME(channel), &statbuf) != 0 &&
+ errno == ENOENT) ||
+ statbuf.st_size < FILE_MAXSIZE(channel)) {
+ (void)fclose(FILE_STREAM(channel));
+ FILE_STREAM(channel) = NULL;
+ FILE_MAXREACHED(channel) = ISC_FALSE;
+ } else
+ /*
+ * Eh, skip it.
+ */
+ break;
+ }
+
+ if (FILE_STREAM(channel) == NULL) {
+ result = isc_log_open(channel);
+ if (result != ISC_R_SUCCESS &&
+ result != ISC_R_MAXSIZE &&
+ (channel->flags & ISC_LOG_OPENERR) == 0) {
+ syslog(LOG_ERR,
+ "isc_log_open '%s' failed: %s",
+ FILE_NAME(channel),
+ isc_result_totext(result));
+ channel->flags |= ISC_LOG_OPENERR;
+ }
+ if (result != ISC_R_SUCCESS)
+ break;
+ channel->flags &= ~ISC_LOG_OPENERR;
+ }
+ /* FALLTHROUGH */
+
+ case ISC_LOG_TOFILEDESC:
+ fprintf(FILE_STREAM(channel), "%s%s%s%s%s%s%s%s%s%s\n",
+ printtime ? time_string : "",
+ printtime ? " " : "",
+ printtag ? lcfg->tag : "",
+ printtag ? ": " : "",
+ printcategory ? category->name : "",
+ printcategory ? ": " : "",
+ printmodule ? (module != NULL ? module->name
+ : "no_module")
+ : "",
+ printmodule ? ": " : "",
+ printlevel ? level_string : "",
+ lctx->buffer);
+
+ fflush(FILE_STREAM(channel));
+
+ /*
+ * If the file now exceeds its maximum size
+ * threshold, note it so that it will not be logged
+ * to any more.
+ */
+ if (FILE_MAXSIZE(channel) > 0) {
+ INSIST(channel->type == ISC_LOG_TOFILE);
+
+ /* XXXDCL NT fstat/fileno */
+ /* XXXDCL complain if fstat fails? */
+ if (fstat(fileno(FILE_STREAM(channel)),
+ &statbuf) >= 0 &&
+ statbuf.st_size > FILE_MAXSIZE(channel))
+ FILE_MAXREACHED(channel) = ISC_TRUE;
+ }
+
+ break;
+
+ case ISC_LOG_TOSYSLOG:
+ if (level > 0)
+ syslog_level = LOG_DEBUG;
+ else if (level < ISC_LOG_CRITICAL)
+ syslog_level = LOG_CRIT;
+ else
+ syslog_level = syslog_map[-level];
+
+ (void)syslog(FACILITY(channel) | syslog_level,
+ "%s%s%s%s%s%s%s%s%s%s",
+ printtime ? time_string : "",
+ printtime ? " " : "",
+ printtag ? lcfg->tag : "",
+ printtag ? ": " : "",
+ printcategory ? category->name : "",
+ printcategory ? ": " : "",
+ printmodule ? (module != NULL ? module->name
+ : "no_module")
+ : "",
+ printmodule ? ": " : "",
+ printlevel ? level_string : "",
+ lctx->buffer);
+ break;
+
+ case ISC_LOG_TONULL:
+ break;
+
+ }
+
+ } while (1);
+
+ UNLOCK(&lctx->lock);
+}
diff --git a/lib/isc/md5.c b/lib/isc/md5.c
new file mode 100644
index 0000000..7c6419b
--- /dev/null
+++ b/lib/isc/md5.c
@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: md5.c,v 1.16 2009/02/06 23:47:42 tbox Exp $ */
+
+/*! \file
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest. This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+
+#include "config.h"
+
+#include <isc/assertions.h>
+#include <isc/md5.h>
+#include <isc/platform.h>
+#include <isc/string.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+
+void
+isc_md5_init(isc_md5_t *ctx) {
+ EVP_DigestInit(ctx, EVP_md5());
+}
+
+void
+isc_md5_invalidate(isc_md5_t *ctx) {
+ EVP_MD_CTX_cleanup(ctx);
+}
+
+void
+isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len) {
+ EVP_DigestUpdate(ctx, (const void *) buf, (size_t) len);
+}
+
+void
+isc_md5_final(isc_md5_t *ctx, unsigned char *digest) {
+ EVP_DigestFinal(ctx, digest, NULL);
+}
+
+#else
+
+static void
+byteSwap(isc_uint32_t *buf, unsigned words)
+{
+ unsigned char *p = (unsigned char *)buf;
+
+ do {
+ *buf++ = (isc_uint32_t)((unsigned)p[3] << 8 | p[2]) << 16 |
+ ((unsigned)p[1] << 8 | p[0]);
+ p += 4;
+ } while (--words);
+}
+
+/*!
+ * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+void
+isc_md5_init(isc_md5_t *ctx) {
+ ctx->buf[0] = 0x67452301;
+ ctx->buf[1] = 0xefcdab89;
+ ctx->buf[2] = 0x98badcfe;
+ ctx->buf[3] = 0x10325476;
+
+ ctx->bytes[0] = 0;
+ ctx->bytes[1] = 0;
+}
+
+void
+isc_md5_invalidate(isc_md5_t *ctx) {
+ memset(ctx, 0, sizeof(isc_md5_t));
+}
+
+/*@{*/
+/*! The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+/*@}*/
+
+/*! This is the central step in the MD5 algorithm. */
+#define MD5STEP(f,w,x,y,z,in,s) \
+ (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
+
+/*!
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data. MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+static void
+transform(isc_uint32_t buf[4], isc_uint32_t const in[16]) {
+ register isc_uint32_t a, b, c, d;
+
+ a = buf[0];
+ b = buf[1];
+ c = buf[2];
+ d = buf[3];
+
+ MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+ MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+ MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+ MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+ MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+ MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+ MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+ MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+ MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+ MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+ MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+ MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+ MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+ MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+ MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+ MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+ MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+ MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+ MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+ MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+ MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+ MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+ MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+ MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+ MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+ MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+ MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+ MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+ MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+ MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+ MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+ MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+ MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+ MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+ MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+ MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+ MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+ MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+ MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+ MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+ MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+ MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+ MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+ MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+ MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+ MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+ MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+ MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+ MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+ MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+ MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+ MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+ MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+ MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+ MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+ MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+ MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+ MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+ MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+ MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+ MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+ MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+ MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+ MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
+}
+
+/*!
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len) {
+ isc_uint32_t t;
+
+ /* Update byte count */
+
+ t = ctx->bytes[0];
+ if ((ctx->bytes[0] = t + len) < t)
+ ctx->bytes[1]++; /* Carry from low to high */
+
+ t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */
+ if (t > len) {
+ memcpy((unsigned char *)ctx->in + 64 - t, buf, len);
+ return;
+ }
+ /* First chunk is an odd size */
+ memcpy((unsigned char *)ctx->in + 64 - t, buf, t);
+ byteSwap(ctx->in, 16);
+ transform(ctx->buf, ctx->in);
+ buf += t;
+ len -= t;
+
+ /* Process data in 64-byte chunks */
+ while (len >= 64) {
+ memcpy(ctx->in, buf, 64);
+ byteSwap(ctx->in, 16);
+ transform(ctx->buf, ctx->in);
+ buf += 64;
+ len -= 64;
+ }
+
+ /* Handle any remaining bytes of data. */
+ memcpy(ctx->in, buf, len);
+}
+
+/*!
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+void
+isc_md5_final(isc_md5_t *ctx, unsigned char *digest) {
+ int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */
+ unsigned char *p = (unsigned char *)ctx->in + count;
+
+ /* Set the first char of padding to 0x80. There is always room. */
+ *p++ = 0x80;
+
+ /* Bytes of padding needed to make 56 bytes (-8..55) */
+ count = 56 - 1 - count;
+
+ if (count < 0) { /* Padding forces an extra block */
+ memset(p, 0, count + 8);
+ byteSwap(ctx->in, 16);
+ transform(ctx->buf, ctx->in);
+ p = (unsigned char *)ctx->in;
+ count = 56;
+ }
+ memset(p, 0, count);
+ byteSwap(ctx->in, 14);
+
+ /* Append length in bits and transform */
+ ctx->in[14] = ctx->bytes[0] << 3;
+ ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29;
+ transform(ctx->buf, ctx->in);
+
+ byteSwap(ctx->buf, 4);
+ memcpy(digest, ctx->buf, 16);
+ memset(ctx, 0, sizeof(isc_md5_t)); /* In case it's sensitive */
+}
+#endif
diff --git a/lib/isc/mem.c b/lib/isc/mem.c
new file mode 100644
index 0000000..5b4b16c
--- /dev/null
+++ b/lib/isc/mem.c
@@ -0,0 +1,2477 @@
+/*
+ * Copyright (C) 2004-2010, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+
+#include <limits.h>
+
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/once.h>
+#include <isc/ondestroy.h>
+#include <isc/string.h>
+#include <isc/mutex.h>
+#include <isc/print.h>
+#include <isc/util.h>
+#include <isc/xml.h>
+
+#define MCTXLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) LOCK(l)
+#define MCTXUNLOCK(m, l) if (((m)->flags & ISC_MEMFLAG_NOLOCK) == 0) UNLOCK(l)
+
+#ifndef ISC_MEM_DEBUGGING
+#define ISC_MEM_DEBUGGING 0
+#endif
+LIBISC_EXTERNAL_DATA unsigned int isc_mem_debugging = ISC_MEM_DEBUGGING;
+
+/*
+ * Constants.
+ */
+
+#define DEF_MAX_SIZE 1100
+#define DEF_MEM_TARGET 4096
+#define ALIGNMENT_SIZE 8U /*%< must be a power of 2 */
+#define NUM_BASIC_BLOCKS 64 /*%< must be > 1 */
+#define TABLE_INCREMENT 1024
+#define DEBUGLIST_COUNT 1024
+
+/*
+ * Types.
+ */
+typedef struct isc__mem isc__mem_t;
+typedef struct isc__mempool isc__mempool_t;
+
+#if ISC_MEM_TRACKLINES
+typedef struct debuglink debuglink_t;
+struct debuglink {
+ ISC_LINK(debuglink_t) link;
+ const void *ptr[DEBUGLIST_COUNT];
+ unsigned int size[DEBUGLIST_COUNT];
+ const char *file[DEBUGLIST_COUNT];
+ unsigned int line[DEBUGLIST_COUNT];
+ unsigned int count;
+};
+
+#define FLARG_PASS , file, line
+#define FLARG , const char *file, unsigned int line
+#else
+#define FLARG_PASS
+#define FLARG
+#endif
+
+typedef struct element element;
+struct element {
+ element * next;
+};
+
+typedef struct {
+ /*!
+ * This structure must be ALIGNMENT_SIZE bytes.
+ */
+ union {
+ size_t size;
+ isc__mem_t *ctx;
+ char bytes[ALIGNMENT_SIZE];
+ } u;
+} size_info;
+
+struct stats {
+ unsigned long gets;
+ unsigned long totalgets;
+ unsigned long blocks;
+ unsigned long freefrags;
+};
+
+#define MEM_MAGIC ISC_MAGIC('M', 'e', 'm', 'C')
+#define VALID_CONTEXT(c) ISC_MAGIC_VALID(c, MEM_MAGIC)
+
+#if ISC_MEM_TRACKLINES
+typedef ISC_LIST(debuglink_t) debuglist_t;
+#endif
+
+/* List of all active memory contexts. */
+
+static ISC_LIST(isc__mem_t) contexts;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_mutex_t lock;
+
+/*%
+ * Total size of lost memory due to a bug of external library.
+ * Locked by the global lock.
+ */
+static isc_uint64_t totallost;
+
+struct isc__mem {
+ isc_mem_t common;
+ isc_ondestroy_t ondestroy;
+ unsigned int flags;
+ isc_mutex_t lock;
+ isc_memalloc_t memalloc;
+ isc_memfree_t memfree;
+ void * arg;
+ size_t max_size;
+ isc_boolean_t checkfree;
+ struct stats * stats;
+ unsigned int references;
+ char name[16];
+ void * tag;
+ size_t quota;
+ size_t total;
+ size_t inuse;
+ size_t maxinuse;
+ size_t hi_water;
+ size_t lo_water;
+ isc_boolean_t hi_called;
+ isc_boolean_t is_overmem;
+ isc_mem_water_t water;
+ void * water_arg;
+ ISC_LIST(isc__mempool_t) pools;
+ unsigned int poolcnt;
+
+ /* ISC_MEMFLAG_INTERNAL */
+ size_t mem_target;
+ element ** freelists;
+ element * basic_blocks;
+ unsigned char ** basic_table;
+ unsigned int basic_table_count;
+ unsigned int basic_table_size;
+ unsigned char * lowest;
+ unsigned char * highest;
+
+#if ISC_MEM_TRACKLINES
+ debuglist_t * debuglist;
+ unsigned int debuglistcnt;
+#endif
+
+ unsigned int memalloc_failures;
+ ISC_LINK(isc__mem_t) link;
+};
+
+#define MEMPOOL_MAGIC ISC_MAGIC('M', 'E', 'M', 'p')
+#define VALID_MEMPOOL(c) ISC_MAGIC_VALID(c, MEMPOOL_MAGIC)
+
+struct isc__mempool {
+ /* always unlocked */
+ isc_mempool_t common; /*%< common header of mempool's */
+ isc_mutex_t *lock; /*%< optional lock */
+ isc__mem_t *mctx; /*%< our memory context */
+ /*%< locked via the memory context's lock */
+ ISC_LINK(isc__mempool_t) link; /*%< next pool in this mem context */
+ /*%< optionally locked from here down */
+ element *items; /*%< low water item list */
+ size_t size; /*%< size of each item on this pool */
+ unsigned int maxalloc; /*%< max number of items allowed */
+ unsigned int allocated; /*%< # of items currently given out */
+ unsigned int freecount; /*%< # of items on reserved list */
+ unsigned int freemax; /*%< # of items allowed on free list */
+ unsigned int fillcount; /*%< # of items to fetch on each fill */
+ /*%< Stats only. */
+ unsigned int gets; /*%< # of requests to this pool */
+ /*%< Debugging only. */
+#if ISC_MEMPOOL_NAMES
+ char name[16]; /*%< printed name in stats reports */
+#endif
+};
+
+/*
+ * Private Inline-able.
+ */
+
+#if ! ISC_MEM_TRACKLINES
+#define ADD_TRACE(a, b, c, d, e)
+#define DELETE_TRACE(a, b, c, d, e)
+#else
+#define ADD_TRACE(a, b, c, d, e) \
+ do { \
+ if ((isc_mem_debugging & (ISC_MEM_DEBUGTRACE | \
+ ISC_MEM_DEBUGRECORD)) != 0 && \
+ b != NULL) \
+ add_trace_entry(a, b, c, d, e); \
+ } while (0)
+#define DELETE_TRACE(a, b, c, d, e) delete_trace_entry(a, b, c, d, e)
+
+static void
+print_active(isc__mem_t *ctx, FILE *out);
+
+/*%
+ * The following can be either static or public, depending on build environment.
+ */
+
+#ifdef BIND9
+#define ISC_MEMFUNC_SCOPE
+#else
+#define ISC_MEMFUNC_SCOPE static
+#endif
+
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_createx(size_t init_max_size, size_t target_size,
+ isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
+ isc_mem_t **ctxp);
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_createx2(size_t init_max_size, size_t target_size,
+ isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
+ isc_mem_t **ctxp, unsigned int flags);
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_create(size_t init_max_size, size_t target_size, isc_mem_t **ctxp);
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_create2(size_t init_max_size, size_t target_size,
+ isc_mem_t **ctxp, unsigned int flags);
+ISC_MEMFUNC_SCOPE void
+isc__mem_attach(isc_mem_t *source, isc_mem_t **targetp);
+ISC_MEMFUNC_SCOPE void
+isc__mem_detach(isc_mem_t **ctxp);
+ISC_MEMFUNC_SCOPE void
+isc___mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG);
+ISC_MEMFUNC_SCOPE void
+isc__mem_destroy(isc_mem_t **ctxp);
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_ondestroy(isc_mem_t *ctx, isc_task_t *task, isc_event_t **event);
+ISC_MEMFUNC_SCOPE void *
+isc___mem_get(isc_mem_t *ctx, size_t size FLARG);
+ISC_MEMFUNC_SCOPE void
+isc___mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG);
+ISC_MEMFUNC_SCOPE void
+isc__mem_stats(isc_mem_t *ctx, FILE *out);
+ISC_MEMFUNC_SCOPE void *
+isc___mem_allocate(isc_mem_t *ctx, size_t size FLARG);
+ISC_MEMFUNC_SCOPE void *
+isc___mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG);
+ISC_MEMFUNC_SCOPE void
+isc___mem_free(isc_mem_t *ctx, void *ptr FLARG);
+ISC_MEMFUNC_SCOPE char *
+isc___mem_strdup(isc_mem_t *mctx, const char *s FLARG);
+ISC_MEMFUNC_SCOPE void
+isc__mem_setdestroycheck(isc_mem_t *ctx, isc_boolean_t flag);
+ISC_MEMFUNC_SCOPE void
+isc__mem_setquota(isc_mem_t *ctx, size_t quota);
+ISC_MEMFUNC_SCOPE size_t
+isc__mem_getquota(isc_mem_t *ctx);
+ISC_MEMFUNC_SCOPE size_t
+isc__mem_inuse(isc_mem_t *ctx);
+ISC_MEMFUNC_SCOPE isc_boolean_t
+isc__mem_isovermem(isc_mem_t *ctx);
+ISC_MEMFUNC_SCOPE void
+isc__mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg,
+ size_t hiwater, size_t lowater);
+ISC_MEMFUNC_SCOPE void
+isc__mem_waterack(isc_mem_t *ctx0, int flag);
+ISC_MEMFUNC_SCOPE void
+isc__mem_setname(isc_mem_t *ctx, const char *name, void *tag);
+ISC_MEMFUNC_SCOPE const char *
+isc__mem_getname(isc_mem_t *ctx);
+ISC_MEMFUNC_SCOPE void *
+isc__mem_gettag(isc_mem_t *ctx);
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp);
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setname(isc_mempool_t *mpctx, const char *name);
+ISC_MEMFUNC_SCOPE void
+isc__mempool_destroy(isc_mempool_t **mpctxp);
+ISC_MEMFUNC_SCOPE void
+isc__mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock);
+ISC_MEMFUNC_SCOPE void *
+isc___mempool_get(isc_mempool_t *mpctx FLARG);
+ISC_MEMFUNC_SCOPE void
+isc___mempool_put(isc_mempool_t *mpctx, void *mem FLARG);
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit);
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getfreemax(isc_mempool_t *mpctx);
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getfreecount(isc_mempool_t *mpctx);
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit);
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getmaxalloc(isc_mempool_t *mpctx);
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getallocated(isc_mempool_t *mpctx);
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit);
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getfillcount(isc_mempool_t *mpctx);
+#ifdef BIND9
+ISC_MEMFUNC_SCOPE void
+isc__mem_printactive(isc_mem_t *ctx0, FILE *file);
+ISC_MEMFUNC_SCOPE void
+isc__mem_printallactive(FILE *file);
+ISC_MEMFUNC_SCOPE void
+isc__mem_checkdestroyed(FILE *file);
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mem_references(isc_mem_t *ctx0);
+#endif
+
+static struct isc__memmethods {
+ isc_memmethods_t methods;
+
+ /*%
+ * The following are defined just for avoiding unused static functions.
+ */
+#ifndef BIND9
+ void *createx, *create, *create2, *ondestroy, *stats,
+ *setquota, *getquota, *setname, *getname, *gettag;
+#endif
+} memmethods = {
+ {
+ isc__mem_attach,
+ isc__mem_detach,
+ isc__mem_destroy,
+ isc___mem_get,
+ isc___mem_put,
+ isc___mem_putanddetach,
+ isc___mem_allocate,
+ isc___mem_reallocate,
+ isc___mem_strdup,
+ isc___mem_free,
+ isc__mem_setdestroycheck,
+ isc__mem_setwater,
+ isc__mem_waterack,
+ isc__mem_inuse,
+ isc__mem_isovermem,
+ isc__mempool_create
+ }
+#ifndef BIND9
+ ,
+ (void *)isc__mem_createx, (void *)isc__mem_create,
+ (void *)isc__mem_create2, (void *)isc__mem_ondestroy,
+ (void *)isc__mem_stats, (void *)isc__mem_setquota,
+ (void *)isc__mem_getquota, (void *)isc__mem_setname,
+ (void *)isc__mem_getname, (void *)isc__mem_gettag
+#endif
+};
+
+static struct isc__mempoolmethods {
+ isc_mempoolmethods_t methods;
+
+ /*%
+ * The following are defined just for avoiding unused static functions.
+ */
+#ifndef BIND9
+ void *getfreemax, *getfreecount, *getmaxalloc, *getfillcount;
+#endif
+} mempoolmethods = {
+ {
+ isc__mempool_destroy,
+ isc___mempool_get,
+ isc___mempool_put,
+ isc__mempool_getallocated,
+ isc__mempool_setmaxalloc,
+ isc__mempool_setfreemax,
+ isc__mempool_setname,
+ isc__mempool_associatelock,
+ isc__mempool_setfillcount
+ }
+#ifndef BIND9
+ ,
+ (void *)isc__mempool_getfreemax, (void *)isc__mempool_getfreecount,
+ (void *)isc__mempool_getmaxalloc, (void *)isc__mempool_getfillcount
+#endif
+};
+
+/*!
+ * mctx must be locked.
+ */
+static inline void
+add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size
+ FLARG)
+{
+ debuglink_t *dl;
+ unsigned int i;
+ unsigned int mysize = size;
+
+ if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0)
+ fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_ADDTRACE,
+ "add %p size %u "
+ "file %s line %u mctx %p\n"),
+ ptr, size, file, line, mctx);
+
+ if (mctx->debuglist == NULL)
+ return;
+
+ if (mysize > mctx->max_size)
+ mysize = mctx->max_size;
+
+ dl = ISC_LIST_HEAD(mctx->debuglist[mysize]);
+ while (dl != NULL) {
+ if (dl->count == DEBUGLIST_COUNT)
+ goto next;
+ for (i = 0; i < DEBUGLIST_COUNT; i++) {
+ if (dl->ptr[i] == NULL) {
+ dl->ptr[i] = ptr;
+ dl->size[i] = size;
+ dl->file[i] = file;
+ dl->line[i] = line;
+ dl->count++;
+ return;
+ }
+ }
+ next:
+ dl = ISC_LIST_NEXT(dl, link);
+ }
+
+ dl = malloc(sizeof(debuglink_t));
+ INSIST(dl != NULL);
+
+ ISC_LINK_INIT(dl, link);
+ for (i = 1; i < DEBUGLIST_COUNT; i++) {
+ dl->ptr[i] = NULL;
+ dl->size[i] = 0;
+ dl->file[i] = NULL;
+ dl->line[i] = 0;
+ }
+
+ dl->ptr[0] = ptr;
+ dl->size[0] = size;
+ dl->file[0] = file;
+ dl->line[0] = line;
+ dl->count = 1;
+
+ ISC_LIST_PREPEND(mctx->debuglist[mysize], dl, link);
+ mctx->debuglistcnt++;
+}
+
+static inline void
+delete_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size,
+ const char *file, unsigned int line)
+{
+ debuglink_t *dl;
+ unsigned int i;
+
+ if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0)
+ fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_DELTRACE,
+ "del %p size %u "
+ "file %s line %u mctx %p\n"),
+ ptr, size, file, line, mctx);
+
+ if (mctx->debuglist == NULL)
+ return;
+
+ if (size > mctx->max_size)
+ size = mctx->max_size;
+
+ dl = ISC_LIST_HEAD(mctx->debuglist[size]);
+ while (dl != NULL) {
+ for (i = 0; i < DEBUGLIST_COUNT; i++) {
+ if (dl->ptr[i] == ptr) {
+ dl->ptr[i] = NULL;
+ dl->size[i] = 0;
+ dl->file[i] = NULL;
+ dl->line[i] = 0;
+
+ INSIST(dl->count > 0);
+ dl->count--;
+ if (dl->count == 0) {
+ ISC_LIST_UNLINK(mctx->debuglist[size],
+ dl, link);
+ free(dl);
+ }
+ return;
+ }
+ }
+ dl = ISC_LIST_NEXT(dl, link);
+ }
+
+ /*
+ * If we get here, we didn't find the item on the list. We're
+ * screwed.
+ */
+ INSIST(dl != NULL);
+}
+#endif /* ISC_MEM_TRACKLINES */
+
+static inline size_t
+rmsize(size_t size) {
+ /*
+ * round down to ALIGNMENT_SIZE
+ */
+ return (size & (~(ALIGNMENT_SIZE - 1)));
+}
+
+static inline size_t
+quantize(size_t size) {
+ /*!
+ * Round up the result in order to get a size big
+ * enough to satisfy the request and be aligned on ALIGNMENT_SIZE
+ * byte boundaries.
+ */
+
+ if (size == 0U)
+ return (ALIGNMENT_SIZE);
+ return ((size + ALIGNMENT_SIZE - 1) & (~(ALIGNMENT_SIZE - 1)));
+}
+
+static inline isc_boolean_t
+more_basic_blocks(isc__mem_t *ctx) {
+ void *new;
+ unsigned char *curr, *next;
+ unsigned char *first, *last;
+ unsigned char **table;
+ unsigned int table_size;
+ size_t increment;
+ int i;
+
+ /* Require: we hold the context lock. */
+
+ /*
+ * Did we hit the quota for this context?
+ */
+ increment = NUM_BASIC_BLOCKS * ctx->mem_target;
+ if (ctx->quota != 0U && ctx->total + increment > ctx->quota)
+ return (ISC_FALSE);
+
+ INSIST(ctx->basic_table_count <= ctx->basic_table_size);
+ if (ctx->basic_table_count == ctx->basic_table_size) {
+ table_size = ctx->basic_table_size + TABLE_INCREMENT;
+ table = (ctx->memalloc)(ctx->arg,
+ table_size * sizeof(unsigned char *));
+ if (table == NULL) {
+ ctx->memalloc_failures++;
+ return (ISC_FALSE);
+ }
+ if (ctx->basic_table_size != 0) {
+ memcpy(table, ctx->basic_table,
+ ctx->basic_table_size *
+ sizeof(unsigned char *));
+ (ctx->memfree)(ctx->arg, ctx->basic_table);
+ }
+ ctx->basic_table = table;
+ ctx->basic_table_size = table_size;
+ }
+
+ new = (ctx->memalloc)(ctx->arg, NUM_BASIC_BLOCKS * ctx->mem_target);
+ if (new == NULL) {
+ ctx->memalloc_failures++;
+ return (ISC_FALSE);
+ }
+ ctx->total += increment;
+ ctx->basic_table[ctx->basic_table_count] = new;
+ ctx->basic_table_count++;
+
+ curr = new;
+ next = curr + ctx->mem_target;
+ for (i = 0; i < (NUM_BASIC_BLOCKS - 1); i++) {
+ ((element *)curr)->next = (element *)next;
+ curr = next;
+ next += ctx->mem_target;
+ }
+ /*
+ * curr is now pointing at the last block in the
+ * array.
+ */
+ ((element *)curr)->next = NULL;
+ first = new;
+ last = first + NUM_BASIC_BLOCKS * ctx->mem_target - 1;
+ if (first < ctx->lowest || ctx->lowest == NULL)
+ ctx->lowest = first;
+ if (last > ctx->highest)
+ ctx->highest = last;
+ ctx->basic_blocks = new;
+
+ return (ISC_TRUE);
+}
+
+static inline isc_boolean_t
+more_frags(isc__mem_t *ctx, size_t new_size) {
+ int i, frags;
+ size_t total_size;
+ void *new;
+ unsigned char *curr, *next;
+
+ /*!
+ * Try to get more fragments by chopping up a basic block.
+ */
+
+ if (ctx->basic_blocks == NULL) {
+ if (!more_basic_blocks(ctx)) {
+ /*
+ * We can't get more memory from the OS, or we've
+ * hit the quota for this context.
+ */
+ /*
+ * XXXRTH "At quota" notification here.
+ */
+ return (ISC_FALSE);
+ }
+ }
+
+ total_size = ctx->mem_target;
+ new = ctx->basic_blocks;
+ ctx->basic_blocks = ctx->basic_blocks->next;
+ frags = total_size / new_size;
+ ctx->stats[new_size].blocks++;
+ ctx->stats[new_size].freefrags += frags;
+ /*
+ * Set up a linked-list of blocks of size
+ * "new_size".
+ */
+ curr = new;
+ next = curr + new_size;
+ total_size -= new_size;
+ for (i = 0; i < (frags - 1); i++) {
+ ((element *)curr)->next = (element *)next;
+ curr = next;
+ next += new_size;
+ total_size -= new_size;
+ }
+ /*
+ * Add the remaining fragment of the basic block to a free list.
+ */
+ total_size = rmsize(total_size);
+ if (total_size > 0U) {
+ ((element *)next)->next = ctx->freelists[total_size];
+ ctx->freelists[total_size] = (element *)next;
+ ctx->stats[total_size].freefrags++;
+ }
+ /*
+ * curr is now pointing at the last block in the
+ * array.
+ */
+ ((element *)curr)->next = NULL;
+ ctx->freelists[new_size] = new;
+
+ return (ISC_TRUE);
+}
+
+static inline void *
+mem_getunlocked(isc__mem_t *ctx, size_t size) {
+ size_t new_size = quantize(size);
+ void *ret;
+
+ if (size >= ctx->max_size || new_size >= ctx->max_size) {
+ /*
+ * memget() was called on something beyond our upper limit.
+ */
+ if (ctx->quota != 0U && ctx->total + size > ctx->quota) {
+ ret = NULL;
+ goto done;
+ }
+ ret = (ctx->memalloc)(ctx->arg, size);
+ if (ret == NULL) {
+ ctx->memalloc_failures++;
+ goto done;
+ }
+ ctx->total += size;
+ ctx->inuse += size;
+ ctx->stats[ctx->max_size].gets++;
+ ctx->stats[ctx->max_size].totalgets++;
+ /*
+ * If we don't set new_size to size, then the
+ * ISC_MEM_FILL code might write over bytes we
+ * don't own.
+ */
+ new_size = size;
+ goto done;
+ }
+
+ /*
+ * If there are no blocks in the free list for this size, get a chunk
+ * of memory and then break it up into "new_size"-sized blocks, adding
+ * them to the free list.
+ */
+ if (ctx->freelists[new_size] == NULL && !more_frags(ctx, new_size))
+ return (NULL);
+
+ /*
+ * The free list uses the "rounded-up" size "new_size".
+ */
+ ret = ctx->freelists[new_size];
+ ctx->freelists[new_size] = ctx->freelists[new_size]->next;
+
+ /*
+ * The stats[] uses the _actual_ "size" requested by the
+ * caller, with the caveat (in the code above) that "size" >= the
+ * max. size (max_size) ends up getting recorded as a call to
+ * max_size.
+ */
+ ctx->stats[size].gets++;
+ ctx->stats[size].totalgets++;
+ ctx->stats[new_size].freefrags--;
+ ctx->inuse += new_size;
+
+ done:
+
+#if ISC_MEM_FILL
+ if (ret != NULL)
+ memset(ret, 0xbe, new_size); /* Mnemonic for "beef". */
+#endif
+
+ return (ret);
+}
+
+#if ISC_MEM_FILL && ISC_MEM_CHECKOVERRUN
+static inline void
+check_overrun(void *mem, size_t size, size_t new_size) {
+ unsigned char *cp;
+
+ cp = (unsigned char *)mem;
+ cp += size;
+ while (size < new_size) {
+ INSIST(*cp == 0xbe);
+ cp++;
+ size++;
+ }
+}
+#endif
+
+static inline void
+mem_putunlocked(isc__mem_t *ctx, void *mem, size_t size) {
+ size_t new_size = quantize(size);
+
+ if (size == ctx->max_size || new_size >= ctx->max_size) {
+ /*
+ * memput() called on something beyond our upper limit.
+ */
+#if ISC_MEM_FILL
+ memset(mem, 0xde, size); /* Mnemonic for "dead". */
+#endif
+ (ctx->memfree)(ctx->arg, mem);
+ INSIST(ctx->stats[ctx->max_size].gets != 0U);
+ ctx->stats[ctx->max_size].gets--;
+ INSIST(size <= ctx->total);
+ ctx->inuse -= size;
+ ctx->total -= size;
+ return;
+ }
+
+#if ISC_MEM_FILL
+#if ISC_MEM_CHECKOVERRUN
+ check_overrun(mem, size, new_size);
+#endif
+ memset(mem, 0xde, new_size); /* Mnemonic for "dead". */
+#endif
+
+ /*
+ * The free list uses the "rounded-up" size "new_size".
+ */
+ ((element *)mem)->next = ctx->freelists[new_size];
+ ctx->freelists[new_size] = (element *)mem;
+
+ /*
+ * The stats[] uses the _actual_ "size" requested by the
+ * caller, with the caveat (in the code above) that "size" >= the
+ * max. size (max_size) ends up getting recorded as a call to
+ * max_size.
+ */
+ INSIST(ctx->stats[size].gets != 0U);
+ ctx->stats[size].gets--;
+ ctx->stats[new_size].freefrags++;
+ ctx->inuse -= new_size;
+}
+
+/*!
+ * Perform a malloc, doing memory filling and overrun detection as necessary.
+ */
+static inline void *
+mem_get(isc__mem_t *ctx, size_t size) {
+ char *ret;
+
+#if ISC_MEM_CHECKOVERRUN
+ size += 1;
+#endif
+
+ ret = (ctx->memalloc)(ctx->arg, size);
+ if (ret == NULL)
+ ctx->memalloc_failures++;
+
+#if ISC_MEM_FILL
+ if (ret != NULL)
+ memset(ret, 0xbe, size); /* Mnemonic for "beef". */
+#else
+# if ISC_MEM_CHECKOVERRUN
+ if (ret != NULL)
+ ret[size-1] = 0xbe;
+# endif
+#endif
+
+ return (ret);
+}
+
+/*!
+ * Perform a free, doing memory filling and overrun detection as necessary.
+ */
+static inline void
+mem_put(isc__mem_t *ctx, void *mem, size_t size) {
+#if ISC_MEM_CHECKOVERRUN
+ INSIST(((unsigned char *)mem)[size] == 0xbe);
+#endif
+#if ISC_MEM_FILL
+ memset(mem, 0xde, size); /* Mnemonic for "dead". */
+#else
+ UNUSED(size);
+#endif
+ (ctx->memfree)(ctx->arg, mem);
+}
+
+/*!
+ * Update internal counters after a memory get.
+ */
+static inline void
+mem_getstats(isc__mem_t *ctx, size_t size) {
+ ctx->total += size;
+ ctx->inuse += size;
+
+ if (size > ctx->max_size) {
+ ctx->stats[ctx->max_size].gets++;
+ ctx->stats[ctx->max_size].totalgets++;
+ } else {
+ ctx->stats[size].gets++;
+ ctx->stats[size].totalgets++;
+ }
+}
+
+/*!
+ * Update internal counters after a memory put.
+ */
+static inline void
+mem_putstats(isc__mem_t *ctx, void *ptr, size_t size) {
+ UNUSED(ptr);
+
+ INSIST(ctx->inuse >= size);
+ ctx->inuse -= size;
+
+ if (size > ctx->max_size) {
+ INSIST(ctx->stats[ctx->max_size].gets > 0U);
+ ctx->stats[ctx->max_size].gets--;
+ } else {
+ INSIST(ctx->stats[size].gets > 0U);
+ ctx->stats[size].gets--;
+ }
+}
+
+/*
+ * Private.
+ */
+
+static void *
+default_memalloc(void *arg, size_t size) {
+ UNUSED(arg);
+ if (size == 0U)
+ size = 1;
+ return (malloc(size));
+}
+
+static void
+default_memfree(void *arg, void *ptr) {
+ UNUSED(arg);
+ free(ptr);
+}
+
+static void
+initialize_action(void) {
+ RUNTIME_CHECK(isc_mutex_init(&lock) == ISC_R_SUCCESS);
+ ISC_LIST_INIT(contexts);
+ totallost = 0;
+}
+
+/*
+ * Public.
+ */
+
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_createx(size_t init_max_size, size_t target_size,
+ isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
+ isc_mem_t **ctxp)
+{
+ return (isc__mem_createx2(init_max_size, target_size, memalloc, memfree,
+ arg, ctxp, ISC_MEMFLAG_DEFAULT));
+
+}
+
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_createx2(size_t init_max_size, size_t target_size,
+ isc_memalloc_t memalloc, isc_memfree_t memfree, void *arg,
+ isc_mem_t **ctxp, unsigned int flags)
+{
+ isc__mem_t *ctx;
+ isc_result_t result;
+
+ REQUIRE(ctxp != NULL && *ctxp == NULL);
+ REQUIRE(memalloc != NULL);
+ REQUIRE(memfree != NULL);
+
+ INSIST((ALIGNMENT_SIZE & (ALIGNMENT_SIZE - 1)) == 0);
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+
+ ctx = (memalloc)(arg, sizeof(*ctx));
+ if (ctx == NULL)
+ return (ISC_R_NOMEMORY);
+
+ if ((flags & ISC_MEMFLAG_NOLOCK) == 0) {
+ result = isc_mutex_init(&ctx->lock);
+ if (result != ISC_R_SUCCESS) {
+ (memfree)(arg, ctx);
+ return (result);
+ }
+ }
+
+ if (init_max_size == 0U)
+ ctx->max_size = DEF_MAX_SIZE;
+ else
+ ctx->max_size = init_max_size;
+ ctx->flags = flags;
+ ctx->references = 1;
+ memset(ctx->name, 0, sizeof(ctx->name));
+ ctx->tag = NULL;
+ ctx->quota = 0;
+ ctx->total = 0;
+ ctx->inuse = 0;
+ ctx->maxinuse = 0;
+ ctx->hi_water = 0;
+ ctx->lo_water = 0;
+ ctx->hi_called = ISC_FALSE;
+ ctx->is_overmem = ISC_FALSE;
+ ctx->water = NULL;
+ ctx->water_arg = NULL;
+ ctx->common.impmagic = MEM_MAGIC;
+ ctx->common.magic = ISCAPI_MCTX_MAGIC;
+ ctx->common.methods = (isc_memmethods_t *)&memmethods;
+ isc_ondestroy_init(&ctx->ondestroy);
+ ctx->memalloc = memalloc;
+ ctx->memfree = memfree;
+ ctx->arg = arg;
+ ctx->stats = NULL;
+ ctx->checkfree = ISC_TRUE;
+#if ISC_MEM_TRACKLINES
+ ctx->debuglist = NULL;
+ ctx->debuglistcnt = 0;
+#endif
+ ISC_LIST_INIT(ctx->pools);
+ ctx->poolcnt = 0;
+ ctx->freelists = NULL;
+ ctx->basic_blocks = NULL;
+ ctx->basic_table = NULL;
+ ctx->basic_table_count = 0;
+ ctx->basic_table_size = 0;
+ ctx->lowest = NULL;
+ ctx->highest = NULL;
+
+ ctx->stats = (memalloc)(arg,
+ (ctx->max_size+1) * sizeof(struct stats));
+ if (ctx->stats == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto error;
+ }
+ memset(ctx->stats, 0, (ctx->max_size + 1) * sizeof(struct stats));
+
+ if ((flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ if (target_size == 0U)
+ ctx->mem_target = DEF_MEM_TARGET;
+ else
+ ctx->mem_target = target_size;
+ ctx->freelists = (memalloc)(arg, ctx->max_size *
+ sizeof(element *));
+ if (ctx->freelists == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto error;
+ }
+ memset(ctx->freelists, 0,
+ ctx->max_size * sizeof(element *));
+ }
+
+#if ISC_MEM_TRACKLINES
+ if ((isc_mem_debugging & ISC_MEM_DEBUGRECORD) != 0) {
+ unsigned int i;
+
+ ctx->debuglist = (memalloc)(arg,
+ (ctx->max_size+1) * sizeof(debuglist_t));
+ if (ctx->debuglist == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto error;
+ }
+ for (i = 0; i <= ctx->max_size; i++)
+ ISC_LIST_INIT(ctx->debuglist[i]);
+ }
+#endif
+
+ ctx->memalloc_failures = 0;
+
+ LOCK(&lock);
+ ISC_LIST_INITANDAPPEND(contexts, ctx, link);
+ UNLOCK(&lock);
+
+ *ctxp = (isc_mem_t *)ctx;
+ return (ISC_R_SUCCESS);
+
+ error:
+ if (ctx != NULL) {
+ if (ctx->stats != NULL)
+ (memfree)(arg, ctx->stats);
+ if (ctx->freelists != NULL)
+ (memfree)(arg, ctx->freelists);
+#if ISC_MEM_TRACKLINES
+ if (ctx->debuglist != NULL)
+ (ctx->memfree)(ctx->arg, ctx->debuglist);
+#endif /* ISC_MEM_TRACKLINES */
+ if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0)
+ DESTROYLOCK(&ctx->lock);
+ (memfree)(arg, ctx);
+ }
+
+ return (result);
+}
+
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_create(size_t init_max_size, size_t target_size, isc_mem_t **ctxp) {
+ return (isc__mem_createx2(init_max_size, target_size,
+ default_memalloc, default_memfree, NULL,
+ ctxp, ISC_MEMFLAG_DEFAULT));
+}
+
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_create2(size_t init_max_size, size_t target_size,
+ isc_mem_t **ctxp, unsigned int flags)
+{
+ return (isc__mem_createx2(init_max_size, target_size,
+ default_memalloc, default_memfree, NULL,
+ ctxp, flags));
+}
+
+static void
+destroy(isc__mem_t *ctx) {
+ unsigned int i;
+ isc_ondestroy_t ondest;
+
+ LOCK(&lock);
+ ISC_LIST_UNLINK(contexts, ctx, link);
+ totallost += ctx->inuse;
+ UNLOCK(&lock);
+
+ ctx->common.impmagic = 0;
+ ctx->common.magic = 0;
+
+ INSIST(ISC_LIST_EMPTY(ctx->pools));
+
+#if ISC_MEM_TRACKLINES
+ if (ctx->debuglist != NULL) {
+ if (ctx->checkfree) {
+ for (i = 0; i <= ctx->max_size; i++) {
+ if (!ISC_LIST_EMPTY(ctx->debuglist[i]))
+ print_active(ctx, stderr);
+ INSIST(ISC_LIST_EMPTY(ctx->debuglist[i]));
+ }
+ } else {
+ debuglink_t *dl;
+
+ for (i = 0; i <= ctx->max_size; i++)
+ for (dl = ISC_LIST_HEAD(ctx->debuglist[i]);
+ dl != NULL;
+ dl = ISC_LIST_HEAD(ctx->debuglist[i])) {
+ ISC_LIST_UNLINK(ctx->debuglist[i],
+ dl, link);
+ free(dl);
+ }
+ }
+ (ctx->memfree)(ctx->arg, ctx->debuglist);
+ }
+#endif
+ INSIST(ctx->references == 0);
+
+ if (ctx->checkfree) {
+ for (i = 0; i <= ctx->max_size; i++) {
+#if ISC_MEM_TRACKLINES
+ if (ctx->stats[i].gets != 0U)
+ print_active(ctx, stderr);
+#endif
+ INSIST(ctx->stats[i].gets == 0U);
+ }
+ }
+
+ (ctx->memfree)(ctx->arg, ctx->stats);
+
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ for (i = 0; i < ctx->basic_table_count; i++)
+ (ctx->memfree)(ctx->arg, ctx->basic_table[i]);
+ (ctx->memfree)(ctx->arg, ctx->freelists);
+ if (ctx->basic_table != NULL)
+ (ctx->memfree)(ctx->arg, ctx->basic_table);
+ }
+
+ ondest = ctx->ondestroy;
+
+ if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0)
+ DESTROYLOCK(&ctx->lock);
+ (ctx->memfree)(ctx->arg, ctx);
+
+ isc_ondestroy_notify(&ondest, ctx);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_attach(isc_mem_t *source0, isc_mem_t **targetp) {
+ isc__mem_t *source = (isc__mem_t *)source0;
+
+ REQUIRE(VALID_CONTEXT(source));
+ REQUIRE(targetp != NULL && *targetp == NULL);
+
+ MCTXLOCK(source, &source->lock);
+ source->references++;
+ MCTXUNLOCK(source, &source->lock);
+
+ *targetp = (isc_mem_t *)source;
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_detach(isc_mem_t **ctxp) {
+ isc__mem_t *ctx;
+ isc_boolean_t want_destroy = ISC_FALSE;
+
+ REQUIRE(ctxp != NULL);
+ ctx = (isc__mem_t *)*ctxp;
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ MCTXLOCK(ctx, &ctx->lock);
+ INSIST(ctx->references > 0);
+ ctx->references--;
+ if (ctx->references == 0)
+ want_destroy = ISC_TRUE;
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ if (want_destroy)
+ destroy(ctx);
+
+ *ctxp = NULL;
+}
+
+/*
+ * isc_mem_putanddetach() is the equivalent of:
+ *
+ * mctx = NULL;
+ * isc_mem_attach(ptr->mctx, &mctx);
+ * isc_mem_detach(&ptr->mctx);
+ * isc_mem_put(mctx, ptr, sizeof(*ptr);
+ * isc_mem_detach(&mctx);
+ */
+
+ISC_MEMFUNC_SCOPE void
+isc___mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG) {
+ isc__mem_t *ctx;
+ isc_boolean_t want_destroy = ISC_FALSE;
+ size_info *si;
+ size_t oldsize;
+
+ REQUIRE(ctxp != NULL);
+ ctx = (isc__mem_t *)*ctxp;
+ REQUIRE(VALID_CONTEXT(ctx));
+ REQUIRE(ptr != NULL);
+
+ /*
+ * Must be before mem_putunlocked() as ctxp is usually within
+ * [ptr..ptr+size).
+ */
+ *ctxp = NULL;
+
+ if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) {
+ if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) {
+ si = &(((size_info *)ptr)[-1]);
+ oldsize = si->u.size - ALIGNMENT_SIZE;
+ if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)
+ oldsize -= ALIGNMENT_SIZE;
+ INSIST(oldsize == size);
+ }
+ isc_mem_free((isc_mem_t *)ctx, ptr);
+
+ MCTXLOCK(ctx, &ctx->lock);
+ ctx->references--;
+ if (ctx->references == 0)
+ want_destroy = ISC_TRUE;
+ MCTXUNLOCK(ctx, &ctx->lock);
+ if (want_destroy)
+ destroy(ctx);
+
+ return;
+ }
+
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ MCTXLOCK(ctx, &ctx->lock);
+ mem_putunlocked(ctx, ptr, size);
+ } else {
+ mem_put(ctx, ptr, size);
+ MCTXLOCK(ctx, &ctx->lock);
+ mem_putstats(ctx, ptr, size);
+ }
+
+ DELETE_TRACE(ctx, ptr, size, file, line);
+ INSIST(ctx->references > 0);
+ ctx->references--;
+ if (ctx->references == 0)
+ want_destroy = ISC_TRUE;
+
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ if (want_destroy)
+ destroy(ctx);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_destroy(isc_mem_t **ctxp) {
+ isc__mem_t *ctx;
+
+ /*
+ * This routine provides legacy support for callers who use mctxs
+ * without attaching/detaching.
+ */
+
+ REQUIRE(ctxp != NULL);
+ ctx = (isc__mem_t *)*ctxp;
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ MCTXLOCK(ctx, &ctx->lock);
+#if ISC_MEM_TRACKLINES
+ if (ctx->references != 1)
+ print_active(ctx, stderr);
+#endif
+ REQUIRE(ctx->references == 1);
+ ctx->references--;
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ destroy(ctx);
+
+ *ctxp = NULL;
+}
+
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mem_ondestroy(isc_mem_t *ctx0, isc_task_t *task, isc_event_t **event) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ isc_result_t res;
+
+ MCTXLOCK(ctx, &ctx->lock);
+ res = isc_ondestroy_register(&ctx->ondestroy, task, event);
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ return (res);
+}
+
+ISC_MEMFUNC_SCOPE void *
+isc___mem_get(isc_mem_t *ctx0, size_t size FLARG) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ void *ptr;
+ isc_boolean_t call_water = ISC_FALSE;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0)
+ return (isc__mem_allocate(ctx0, size FLARG_PASS));
+
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ MCTXLOCK(ctx, &ctx->lock);
+ ptr = mem_getunlocked(ctx, size);
+ } else {
+ ptr = mem_get(ctx, size);
+ MCTXLOCK(ctx, &ctx->lock);
+ if (ptr != NULL)
+ mem_getstats(ctx, size);
+ }
+
+ ADD_TRACE(ctx, ptr, size, file, line);
+ if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water &&
+ !ctx->is_overmem) {
+ ctx->is_overmem = ISC_TRUE;
+ }
+ if (ctx->hi_water != 0U && !ctx->hi_called &&
+ ctx->inuse > ctx->hi_water) {
+ call_water = ISC_TRUE;
+ }
+ if (ctx->inuse > ctx->maxinuse) {
+ ctx->maxinuse = ctx->inuse;
+ if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water &&
+ (isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0)
+ fprintf(stderr, "maxinuse = %lu\n",
+ (unsigned long)ctx->inuse);
+ }
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ if (call_water)
+ (ctx->water)(ctx->water_arg, ISC_MEM_HIWATER);
+
+ return (ptr);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc___mem_put(isc_mem_t *ctx0, void *ptr, size_t size FLARG) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ isc_boolean_t call_water = ISC_FALSE;
+ size_info *si;
+ size_t oldsize;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ REQUIRE(ptr != NULL);
+
+ if ((isc_mem_debugging & (ISC_MEM_DEBUGSIZE|ISC_MEM_DEBUGCTX)) != 0) {
+ if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) {
+ si = &(((size_info *)ptr)[-1]);
+ oldsize = si->u.size - ALIGNMENT_SIZE;
+ if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)
+ oldsize -= ALIGNMENT_SIZE;
+ INSIST(oldsize == size);
+ }
+ isc_mem_free((isc_mem_t *)ctx, ptr);
+ return;
+ }
+
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ MCTXLOCK(ctx, &ctx->lock);
+ mem_putunlocked(ctx, ptr, size);
+ } else {
+ mem_put(ctx, ptr, size);
+ MCTXLOCK(ctx, &ctx->lock);
+ mem_putstats(ctx, ptr, size);
+ }
+
+ DELETE_TRACE(ctx, ptr, size, file, line);
+
+ /*
+ * The check against ctx->lo_water == 0 is for the condition
+ * when the context was pushed over hi_water but then had
+ * isc_mem_setwater() called with 0 for hi_water and lo_water.
+ */
+ if (ctx->is_overmem &&
+ (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) {
+ ctx->is_overmem = ISC_FALSE;
+ }
+ if (ctx->hi_called &&
+ (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) {
+ if (ctx->water != NULL)
+ call_water = ISC_TRUE;
+ }
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ if (call_water)
+ (ctx->water)(ctx->water_arg, ISC_MEM_LOWATER);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_waterack(isc_mem_t *ctx0, int flag) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ MCTXLOCK(ctx, &ctx->lock);
+ if (flag == ISC_MEM_LOWATER)
+ ctx->hi_called = ISC_FALSE;
+ else if (flag == ISC_MEM_HIWATER)
+ ctx->hi_called = ISC_TRUE;
+ MCTXUNLOCK(ctx, &ctx->lock);
+}
+
+#if ISC_MEM_TRACKLINES
+static void
+print_active(isc__mem_t *mctx, FILE *out) {
+ if (mctx->debuglist != NULL) {
+ debuglink_t *dl;
+ unsigned int i, j;
+ const char *format;
+ isc_boolean_t found;
+
+ fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_DUMPALLOC,
+ "Dump of all outstanding "
+ "memory allocations:\n"));
+ found = ISC_FALSE;
+ format = isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_PTRFILELINE,
+ "\tptr %p size %u file %s line %u\n");
+ for (i = 0; i <= mctx->max_size; i++) {
+ dl = ISC_LIST_HEAD(mctx->debuglist[i]);
+
+ if (dl != NULL)
+ found = ISC_TRUE;
+
+ while (dl != NULL) {
+ for (j = 0; j < DEBUGLIST_COUNT; j++)
+ if (dl->ptr[j] != NULL)
+ fprintf(out, format,
+ dl->ptr[j],
+ dl->size[j],
+ dl->file[j],
+ dl->line[j]);
+ dl = ISC_LIST_NEXT(dl, link);
+ }
+ }
+ if (!found)
+ fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_NONE, "\tNone.\n"));
+ }
+}
+#endif
+
+/*
+ * Print the stats[] on the stream "out" with suitable formatting.
+ */
+ISC_MEMFUNC_SCOPE void
+isc__mem_stats(isc_mem_t *ctx0, FILE *out) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ size_t i;
+ const struct stats *s;
+ const isc__mempool_t *pool;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ MCTXLOCK(ctx, &ctx->lock);
+
+ for (i = 0; i <= ctx->max_size; i++) {
+ s = &ctx->stats[i];
+
+ if (s->totalgets == 0U && s->gets == 0U)
+ continue;
+ fprintf(out, "%s%5lu: %11lu gets, %11lu rem",
+ (i == ctx->max_size) ? ">=" : " ",
+ (unsigned long) i, s->totalgets, s->gets);
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0 &&
+ (s->blocks != 0U || s->freefrags != 0U))
+ fprintf(out, " (%lu bl, %lu ff)",
+ s->blocks, s->freefrags);
+ fputc('\n', out);
+ }
+
+ /*
+ * Note that since a pool can be locked now, these stats might be
+ * somewhat off if the pool is in active use at the time the stats
+ * are dumped. The link fields are protected by the isc_mem_t's
+ * lock, however, so walking this list and extracting integers from
+ * stats fields is always safe.
+ */
+ pool = ISC_LIST_HEAD(ctx->pools);
+ if (pool != NULL) {
+ fprintf(out, "%s", isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLSTATS,
+ "[Pool statistics]\n"));
+ fprintf(out, "%15s %10s %10s %10s %10s %10s %10s %10s %1s\n",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLNAME, "name"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLSIZE, "size"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLMAXALLOC, "maxalloc"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLALLOCATED, "allocated"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLFREECOUNT, "freecount"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLFREEMAX, "freemax"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLFILLCOUNT, "fillcount"),
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM,
+ ISC_MSG_POOLGETS, "gets"),
+ "L");
+ }
+ while (pool != NULL) {
+ fprintf(out, "%15s %10lu %10u %10u %10u %10u %10u %10u %s\n",
+ pool->name, (unsigned long) pool->size, pool->maxalloc,
+ pool->allocated, pool->freecount, pool->freemax,
+ pool->fillcount, pool->gets,
+ (pool->lock == NULL ? "N" : "Y"));
+ pool = ISC_LIST_NEXT(pool, link);
+ }
+
+#if ISC_MEM_TRACKLINES
+ print_active(ctx, out);
+#endif
+
+ MCTXUNLOCK(ctx, &ctx->lock);
+}
+
+/*
+ * Replacements for malloc() and free() -- they implicitly remember the
+ * size of the object allocated (with some additional overhead).
+ */
+
+static void *
+isc__mem_allocateunlocked(isc_mem_t *ctx0, size_t size) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ size_info *si;
+
+ size += ALIGNMENT_SIZE;
+ if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)
+ size += ALIGNMENT_SIZE;
+
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0)
+ si = mem_getunlocked(ctx, size);
+ else
+ si = mem_get(ctx, size);
+
+ if (si == NULL)
+ return (NULL);
+ if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) {
+ si->u.ctx = ctx;
+ si++;
+ }
+ si->u.size = size;
+ return (&si[1]);
+}
+
+ISC_MEMFUNC_SCOPE void *
+isc___mem_allocate(isc_mem_t *ctx0, size_t size FLARG) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ size_info *si;
+ isc_boolean_t call_water = ISC_FALSE;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ MCTXLOCK(ctx, &ctx->lock);
+ si = isc__mem_allocateunlocked((isc_mem_t *)ctx, size);
+ } else {
+ si = isc__mem_allocateunlocked((isc_mem_t *)ctx, size);
+ MCTXLOCK(ctx, &ctx->lock);
+ if (si != NULL)
+ mem_getstats(ctx, si[-1].u.size);
+ }
+
+#if ISC_MEM_TRACKLINES
+ ADD_TRACE(ctx, si, si[-1].u.size, file, line);
+#endif
+ if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water &&
+ !ctx->is_overmem) {
+ ctx->is_overmem = ISC_TRUE;
+ }
+
+ if (ctx->hi_water != 0U && !ctx->hi_called &&
+ ctx->inuse > ctx->hi_water) {
+ ctx->hi_called = ISC_TRUE;
+ call_water = ISC_TRUE;
+ }
+ if (ctx->inuse > ctx->maxinuse) {
+ ctx->maxinuse = ctx->inuse;
+ if (ctx->hi_water != 0U && ctx->inuse > ctx->hi_water &&
+ (isc_mem_debugging & ISC_MEM_DEBUGUSAGE) != 0)
+ fprintf(stderr, "maxinuse = %lu\n",
+ (unsigned long)ctx->inuse);
+ }
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ if (call_water)
+ (ctx->water)(ctx->water_arg, ISC_MEM_HIWATER);
+
+ return (si);
+}
+
+ISC_MEMFUNC_SCOPE void *
+isc___mem_reallocate(isc_mem_t *ctx0, void *ptr, size_t size FLARG) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ void *new_ptr = NULL;
+ size_t oldsize, copysize;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ /*
+ * This function emulates the realloc(3) standard library function:
+ * - if size > 0, allocate new memory; and if ptr is non NULL, copy
+ * as much of the old contents to the new buffer and free the old one.
+ * Note that when allocation fails the original pointer is intact;
+ * the caller must free it.
+ * - if size is 0 and ptr is non NULL, simply free the given ptr.
+ * - this function returns:
+ * pointer to the newly allocated memory, or
+ * NULL if allocation fails or doesn't happen.
+ */
+ if (size > 0U) {
+ new_ptr = isc__mem_allocate(ctx0, size FLARG_PASS);
+ if (new_ptr != NULL && ptr != NULL) {
+ oldsize = (((size_info *)ptr)[-1]).u.size;
+ INSIST(oldsize >= ALIGNMENT_SIZE);
+ oldsize -= ALIGNMENT_SIZE;
+ copysize = oldsize > size ? size : oldsize;
+ memcpy(new_ptr, ptr, copysize);
+ isc__mem_free(ctx0, ptr FLARG_PASS);
+ }
+ } else if (ptr != NULL)
+ isc__mem_free(ctx0, ptr FLARG_PASS);
+
+ return (new_ptr);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc___mem_free(isc_mem_t *ctx0, void *ptr FLARG) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ size_info *si;
+ size_t size;
+ isc_boolean_t call_water= ISC_FALSE;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ REQUIRE(ptr != NULL);
+
+ if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) {
+ si = &(((size_info *)ptr)[-2]);
+ REQUIRE(si->u.ctx == ctx);
+ size = si[1].u.size;
+ } else {
+ si = &(((size_info *)ptr)[-1]);
+ size = si->u.size;
+ }
+
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ MCTXLOCK(ctx, &ctx->lock);
+ mem_putunlocked(ctx, si, size);
+ } else {
+ mem_put(ctx, si, size);
+ MCTXLOCK(ctx, &ctx->lock);
+ mem_putstats(ctx, si, size);
+ }
+
+ DELETE_TRACE(ctx, ptr, size, file, line);
+
+ /*
+ * The check against ctx->lo_water == 0 is for the condition
+ * when the context was pushed over hi_water but then had
+ * isc_mem_setwater() called with 0 for hi_water and lo_water.
+ */
+ if (ctx->is_overmem &&
+ (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) {
+ ctx->is_overmem = ISC_FALSE;
+ }
+
+ if (ctx->hi_called &&
+ (ctx->inuse < ctx->lo_water || ctx->lo_water == 0U)) {
+ ctx->hi_called = ISC_FALSE;
+
+ if (ctx->water != NULL)
+ call_water = ISC_TRUE;
+ }
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ if (call_water)
+ (ctx->water)(ctx->water_arg, ISC_MEM_LOWATER);
+}
+
+
+/*
+ * Other useful things.
+ */
+
+ISC_MEMFUNC_SCOPE char *
+isc___mem_strdup(isc_mem_t *mctx0, const char *s FLARG) {
+ isc__mem_t *mctx = (isc__mem_t *)mctx0;
+ size_t len;
+ char *ns;
+
+ REQUIRE(VALID_CONTEXT(mctx));
+ REQUIRE(s != NULL);
+
+ len = strlen(s);
+
+ ns = isc___mem_allocate((isc_mem_t *)mctx, len + 1 FLARG_PASS);
+
+ if (ns != NULL)
+ strncpy(ns, s, len + 1);
+
+ return (ns);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_setdestroycheck(isc_mem_t *ctx0, isc_boolean_t flag) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ MCTXLOCK(ctx, &ctx->lock);
+
+ ctx->checkfree = flag;
+
+ MCTXUNLOCK(ctx, &ctx->lock);
+}
+
+/*
+ * Quotas
+ */
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_setquota(isc_mem_t *ctx0, size_t quota) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ MCTXLOCK(ctx, &ctx->lock);
+
+ ctx->quota = quota;
+
+ MCTXUNLOCK(ctx, &ctx->lock);
+}
+
+ISC_MEMFUNC_SCOPE size_t
+isc__mem_getquota(isc_mem_t *ctx0) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ size_t quota;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ MCTXLOCK(ctx, &ctx->lock);
+
+ quota = ctx->quota;
+
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ return (quota);
+}
+
+ISC_MEMFUNC_SCOPE size_t
+isc__mem_inuse(isc_mem_t *ctx0) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ size_t inuse;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ MCTXLOCK(ctx, &ctx->lock);
+
+ inuse = ctx->inuse;
+
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ return (inuse);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_setwater(isc_mem_t *ctx0, isc_mem_water_t water, void *water_arg,
+ size_t hiwater, size_t lowater)
+{
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ isc_boolean_t callwater = ISC_FALSE;
+ isc_mem_water_t oldwater;
+ void *oldwater_arg;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ REQUIRE(hiwater >= lowater);
+
+ MCTXLOCK(ctx, &ctx->lock);
+ oldwater = ctx->water;
+ oldwater_arg = ctx->water_arg;
+ if (water == NULL) {
+ callwater = ctx->hi_called;
+ ctx->water = NULL;
+ ctx->water_arg = NULL;
+ ctx->hi_water = 0;
+ ctx->lo_water = 0;
+ ctx->hi_called = ISC_FALSE;
+ } else {
+ if (ctx->hi_called &&
+ (ctx->water != water || ctx->water_arg != water_arg ||
+ ctx->inuse < lowater || lowater == 0U))
+ callwater = ISC_TRUE;
+ ctx->water = water;
+ ctx->water_arg = water_arg;
+ ctx->hi_water = hiwater;
+ ctx->lo_water = lowater;
+ ctx->hi_called = ISC_FALSE;
+ }
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ if (callwater && oldwater != NULL)
+ (oldwater)(oldwater_arg, ISC_MEM_LOWATER);
+}
+
+ISC_MEMFUNC_SCOPE isc_boolean_t
+isc__mem_isovermem(isc_mem_t *ctx0) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ /*
+ * We don't bother to lock the context because 100% accuracy isn't
+ * necessary (and even if we locked the context the returned value
+ * could be different from the actual state when it's used anyway)
+ */
+ return (ctx->is_overmem);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_setname(isc_mem_t *ctx0, const char *name, void *tag) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ LOCK(&ctx->lock);
+ memset(ctx->name, 0, sizeof(ctx->name));
+ strncpy(ctx->name, name, sizeof(ctx->name) - 1);
+ ctx->tag = tag;
+ UNLOCK(&ctx->lock);
+}
+
+ISC_MEMFUNC_SCOPE const char *
+isc__mem_getname(isc_mem_t *ctx0) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ return (ctx->name);
+}
+
+ISC_MEMFUNC_SCOPE void *
+isc__mem_gettag(isc_mem_t *ctx0) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ return (ctx->tag);
+}
+
+/*
+ * Memory pool stuff
+ */
+
+ISC_MEMFUNC_SCOPE isc_result_t
+isc__mempool_create(isc_mem_t *mctx0, size_t size, isc_mempool_t **mpctxp) {
+ isc__mem_t *mctx = (isc__mem_t *)mctx0;
+ isc__mempool_t *mpctx;
+
+ REQUIRE(VALID_CONTEXT(mctx));
+ REQUIRE(size > 0U);
+ REQUIRE(mpctxp != NULL && *mpctxp == NULL);
+
+ /*
+ * Allocate space for this pool, initialize values, and if all works
+ * well, attach to the memory context.
+ */
+ mpctx = isc_mem_get((isc_mem_t *)mctx, sizeof(isc__mempool_t));
+ if (mpctx == NULL)
+ return (ISC_R_NOMEMORY);
+
+ mpctx->common.methods = (isc_mempoolmethods_t *)&mempoolmethods;
+ mpctx->common.impmagic = MEMPOOL_MAGIC;
+ mpctx->common.magic = ISCAPI_MPOOL_MAGIC;
+ mpctx->lock = NULL;
+ mpctx->mctx = mctx;
+ mpctx->size = size;
+ mpctx->maxalloc = UINT_MAX;
+ mpctx->allocated = 0;
+ mpctx->freecount = 0;
+ mpctx->freemax = 1;
+ mpctx->fillcount = 1;
+ mpctx->gets = 0;
+#if ISC_MEMPOOL_NAMES
+ mpctx->name[0] = 0;
+#endif
+ mpctx->items = NULL;
+
+ *mpctxp = (isc_mempool_t *)mpctx;
+
+ MCTXLOCK(mctx, &mctx->lock);
+ ISC_LIST_INITANDAPPEND(mctx->pools, mpctx, link);
+ mctx->poolcnt++;
+ MCTXUNLOCK(mctx, &mctx->lock);
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setname(isc_mempool_t *mpctx0, const char *name) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+
+ REQUIRE(name != NULL);
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+#if ISC_MEMPOOL_NAMES
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ strncpy(mpctx->name, name, sizeof(mpctx->name) - 1);
+ mpctx->name[sizeof(mpctx->name) - 1] = '\0';
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+#else
+ UNUSED(mpctx);
+ UNUSED(name);
+#endif
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mempool_destroy(isc_mempool_t **mpctxp) {
+ isc__mempool_t *mpctx;
+ isc__mem_t *mctx;
+ isc_mutex_t *lock;
+ element *item;
+
+ REQUIRE(mpctxp != NULL);
+ mpctx = (isc__mempool_t *)*mpctxp;
+ REQUIRE(VALID_MEMPOOL(mpctx));
+#if ISC_MEMPOOL_NAMES
+ if (mpctx->allocated > 0)
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc__mempool_destroy(): mempool %s "
+ "leaked memory",
+ mpctx->name);
+#endif
+ REQUIRE(mpctx->allocated == 0);
+
+ mctx = mpctx->mctx;
+
+ lock = mpctx->lock;
+
+ if (lock != NULL)
+ LOCK(lock);
+
+ /*
+ * Return any items on the free list
+ */
+ MCTXLOCK(mctx, &mctx->lock);
+ while (mpctx->items != NULL) {
+ INSIST(mpctx->freecount > 0);
+ mpctx->freecount--;
+ item = mpctx->items;
+ mpctx->items = item->next;
+
+ if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ mem_putunlocked(mctx, item, mpctx->size);
+ } else {
+ mem_put(mctx, item, mpctx->size);
+ mem_putstats(mctx, item, mpctx->size);
+ }
+ }
+ MCTXUNLOCK(mctx, &mctx->lock);
+
+ /*
+ * Remove our linked list entry from the memory context.
+ */
+ MCTXLOCK(mctx, &mctx->lock);
+ ISC_LIST_UNLINK(mctx->pools, mpctx, link);
+ mctx->poolcnt--;
+ MCTXUNLOCK(mctx, &mctx->lock);
+
+ mpctx->common.impmagic = 0;
+ mpctx->common.magic = 0;
+
+ isc_mem_put((isc_mem_t *)mpctx->mctx, mpctx, sizeof(isc__mempool_t));
+
+ if (lock != NULL)
+ UNLOCK(lock);
+
+ *mpctxp = NULL;
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mempool_associatelock(isc_mempool_t *mpctx0, isc_mutex_t *lock) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+ REQUIRE(mpctx->lock == NULL);
+ REQUIRE(lock != NULL);
+
+ mpctx->lock = lock;
+}
+
+ISC_MEMFUNC_SCOPE void *
+isc___mempool_get(isc_mempool_t *mpctx0 FLARG) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+ element *item;
+ isc__mem_t *mctx;
+ unsigned int i;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ mctx = mpctx->mctx;
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ /*
+ * Don't let the caller go over quota
+ */
+ if (mpctx->allocated >= mpctx->maxalloc) {
+ item = NULL;
+ goto out;
+ }
+
+ /*
+ * if we have a free list item, return the first here
+ */
+ item = mpctx->items;
+ if (item != NULL) {
+ mpctx->items = item->next;
+ INSIST(mpctx->freecount > 0);
+ mpctx->freecount--;
+ mpctx->gets++;
+ mpctx->allocated++;
+ goto out;
+ }
+
+ /*
+ * We need to dip into the well. Lock the memory context here and
+ * fill up our free list.
+ */
+ MCTXLOCK(mctx, &mctx->lock);
+ for (i = 0; i < mpctx->fillcount; i++) {
+ if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ item = mem_getunlocked(mctx, mpctx->size);
+ } else {
+ item = mem_get(mctx, mpctx->size);
+ if (item != NULL)
+ mem_getstats(mctx, mpctx->size);
+ }
+ if (item == NULL)
+ break;
+ item->next = mpctx->items;
+ mpctx->items = item;
+ mpctx->freecount++;
+ }
+ MCTXUNLOCK(mctx, &mctx->lock);
+
+ /*
+ * If we didn't get any items, return NULL.
+ */
+ item = mpctx->items;
+ if (item == NULL)
+ goto out;
+
+ mpctx->items = item->next;
+ mpctx->freecount--;
+ mpctx->gets++;
+ mpctx->allocated++;
+
+ out:
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+
+#if ISC_MEM_TRACKLINES
+ if (item != NULL) {
+ MCTXLOCK(mctx, &mctx->lock);
+ ADD_TRACE(mctx, item, mpctx->size, file, line);
+ MCTXUNLOCK(mctx, &mctx->lock);
+ }
+#endif /* ISC_MEM_TRACKLINES */
+
+ return (item);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc___mempool_put(isc_mempool_t *mpctx0, void *mem FLARG) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+ isc__mem_t *mctx;
+ element *item;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+ REQUIRE(mem != NULL);
+
+ mctx = mpctx->mctx;
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ INSIST(mpctx->allocated > 0);
+ mpctx->allocated--;
+
+#if ISC_MEM_TRACKLINES
+ MCTXLOCK(mctx, &mctx->lock);
+ DELETE_TRACE(mctx, mem, mpctx->size, file, line);
+ MCTXUNLOCK(mctx, &mctx->lock);
+#endif /* ISC_MEM_TRACKLINES */
+
+ /*
+ * If our free list is full, return this to the mctx directly.
+ */
+ if (mpctx->freecount >= mpctx->freemax) {
+ if ((mctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ MCTXLOCK(mctx, &mctx->lock);
+ mem_putunlocked(mctx, mem, mpctx->size);
+ MCTXUNLOCK(mctx, &mctx->lock);
+ } else {
+ mem_put(mctx, mem, mpctx->size);
+ MCTXLOCK(mctx, &mctx->lock);
+ mem_putstats(mctx, mem, mpctx->size);
+ MCTXUNLOCK(mctx, &mctx->lock);
+ }
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+ return;
+ }
+
+ /*
+ * Otherwise, attach it to our free list and bump the counter.
+ */
+ mpctx->freecount++;
+ item = (element *)mem;
+ item->next = mpctx->items;
+ mpctx->items = item;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+}
+
+/*
+ * Quotas
+ */
+
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setfreemax(isc_mempool_t *mpctx0, unsigned int limit) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ mpctx->freemax = limit;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+}
+
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getfreemax(isc_mempool_t *mpctx0) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+ unsigned int freemax;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ freemax = mpctx->freemax;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+
+ return (freemax);
+}
+
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getfreecount(isc_mempool_t *mpctx0) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+ unsigned int freecount;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ freecount = mpctx->freecount;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+
+ return (freecount);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setmaxalloc(isc_mempool_t *mpctx0, unsigned int limit) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+
+ REQUIRE(limit > 0);
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ mpctx->maxalloc = limit;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+}
+
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getmaxalloc(isc_mempool_t *mpctx0) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+ unsigned int maxalloc;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ maxalloc = mpctx->maxalloc;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+
+ return (maxalloc);
+}
+
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getallocated(isc_mempool_t *mpctx0) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+ unsigned int allocated;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ allocated = mpctx->allocated;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+
+ return (allocated);
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mempool_setfillcount(isc_mempool_t *mpctx0, unsigned int limit) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+
+ REQUIRE(limit > 0);
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ mpctx->fillcount = limit;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+}
+
+ISC_MEMFUNC_SCOPE unsigned int
+isc__mempool_getfillcount(isc_mempool_t *mpctx0) {
+ isc__mempool_t *mpctx = (isc__mempool_t *)mpctx0;
+
+ unsigned int fillcount;
+
+ REQUIRE(VALID_MEMPOOL(mpctx));
+
+ if (mpctx->lock != NULL)
+ LOCK(mpctx->lock);
+
+ fillcount = mpctx->fillcount;
+
+ if (mpctx->lock != NULL)
+ UNLOCK(mpctx->lock);
+
+ return (fillcount);
+}
+
+#ifdef USE_MEMIMPREGISTER
+isc_result_t
+isc__mem_register() {
+ return (isc_mem_register(isc__mem_create2));
+}
+#endif
+
+#ifdef BIND9
+ISC_MEMFUNC_SCOPE void
+isc__mem_printactive(isc_mem_t *ctx0, FILE *file) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ REQUIRE(file != NULL);
+
+#if !ISC_MEM_TRACKLINES
+ UNUSED(ctx);
+ UNUSED(file);
+#else
+ print_active(ctx, file);
+#endif
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_printallactive(FILE *file) {
+#if !ISC_MEM_TRACKLINES
+ UNUSED(file);
+#else
+ isc__mem_t *ctx;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+
+ LOCK(&lock);
+ for (ctx = ISC_LIST_HEAD(contexts);
+ ctx != NULL;
+ ctx = ISC_LIST_NEXT(ctx, link)) {
+ fprintf(file, "context: %p\n", ctx);
+ print_active(ctx, file);
+ }
+ UNLOCK(&lock);
+#endif
+}
+
+ISC_MEMFUNC_SCOPE void
+isc__mem_checkdestroyed(FILE *file) {
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+
+ LOCK(&lock);
+ if (!ISC_LIST_EMPTY(contexts)) {
+#if ISC_MEM_TRACKLINES
+ isc__mem_t *ctx;
+
+ for (ctx = ISC_LIST_HEAD(contexts);
+ ctx != NULL;
+ ctx = ISC_LIST_NEXT(ctx, link)) {
+ fprintf(file, "context: %p\n", ctx);
+ print_active(ctx, file);
+ }
+ fflush(file);
+#endif
+ INSIST(0);
+ }
+ UNLOCK(&lock);
+}
+
+ISC_MEMFUNC_SCOPE unsigned int
+isc_mem_references(isc_mem_t *ctx0) {
+ isc__mem_t *ctx = (isc__mem_t *)ctx0;
+ unsigned int references;
+
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ MCTXLOCK(ctx, &ctx->lock);
+ references = ctx->references;
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ return (references);
+}
+
+#ifdef HAVE_LIBXML2
+
+typedef struct summarystat {
+ isc_uint64_t total;
+ isc_uint64_t inuse;
+ isc_uint64_t blocksize;
+ isc_uint64_t contextsize;
+} summarystat_t;
+
+static void
+renderctx(isc__mem_t *ctx, summarystat_t *summary, xmlTextWriterPtr writer) {
+ REQUIRE(VALID_CONTEXT(ctx));
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "context");
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "id");
+ xmlTextWriterWriteFormatString(writer, "%p", ctx);
+ xmlTextWriterEndElement(writer); /* id */
+
+ if (ctx->name[0] != 0) {
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "name");
+ xmlTextWriterWriteFormatString(writer, "%s", ctx->name);
+ xmlTextWriterEndElement(writer); /* name */
+ }
+
+ REQUIRE(VALID_CONTEXT(ctx));
+ MCTXLOCK(ctx, &ctx->lock);
+
+ summary->contextsize += sizeof(*ctx) +
+ (ctx->max_size + 1) * sizeof(struct stats) +
+ ctx->max_size * sizeof(element *) +
+ ctx->basic_table_count * sizeof(char *);
+#if ISC_MEM_TRACKLINES
+ if (ctx->debuglist != NULL) {
+ summary->contextsize +=
+ (ctx->max_size + 1) * sizeof(debuglist_t) +
+ ctx->debuglistcnt * sizeof(debuglink_t);
+ }
+#endif
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
+ xmlTextWriterWriteFormatString(writer, "%d", ctx->references);
+ xmlTextWriterEndElement(writer); /* references */
+
+ summary->total += ctx->total;
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "total");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ (isc_uint64_t)ctx->total);
+ xmlTextWriterEndElement(writer); /* total */
+
+ summary->inuse += ctx->inuse;
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "inuse");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ (isc_uint64_t)ctx->inuse);
+ xmlTextWriterEndElement(writer); /* inuse */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "maxinuse");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ (isc_uint64_t)ctx->maxinuse);
+ xmlTextWriterEndElement(writer); /* maxinuse */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "blocksize");
+ if ((ctx->flags & ISC_MEMFLAG_INTERNAL) != 0) {
+ summary->blocksize += ctx->basic_table_count *
+ NUM_BASIC_BLOCKS * ctx->mem_target;
+ xmlTextWriterWriteFormatString(writer,
+ "%" ISC_PRINT_QUADFORMAT "u",
+ (isc_uint64_t)
+ ctx->basic_table_count *
+ NUM_BASIC_BLOCKS *
+ ctx->mem_target);
+ } else
+ xmlTextWriterWriteFormatString(writer, "%s", "-");
+ xmlTextWriterEndElement(writer); /* blocksize */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "pools");
+ xmlTextWriterWriteFormatString(writer, "%u", ctx->poolcnt);
+ xmlTextWriterEndElement(writer); /* pools */
+ summary->contextsize += ctx->poolcnt * sizeof(isc_mempool_t);
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "hiwater");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ (isc_uint64_t)ctx->hi_water);
+ xmlTextWriterEndElement(writer); /* hiwater */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "lowater");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ (isc_uint64_t)ctx->lo_water);
+ xmlTextWriterEndElement(writer); /* lowater */
+
+ MCTXUNLOCK(ctx, &ctx->lock);
+
+ xmlTextWriterEndElement(writer); /* context */
+}
+
+void
+isc_mem_renderxml(xmlTextWriterPtr writer) {
+ isc__mem_t *ctx;
+ summarystat_t summary;
+ isc_uint64_t lost;
+
+ memset(&summary, 0, sizeof(summary));
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "contexts");
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+
+ LOCK(&lock);
+ lost = totallost;
+ for (ctx = ISC_LIST_HEAD(contexts);
+ ctx != NULL;
+ ctx = ISC_LIST_NEXT(ctx, link)) {
+ renderctx(ctx, &summary, writer);
+ }
+ UNLOCK(&lock);
+
+ xmlTextWriterEndElement(writer); /* contexts */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "summary");
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "TotalUse");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ summary.total);
+ xmlTextWriterEndElement(writer); /* TotalUse */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "InUse");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ summary.inuse);
+ xmlTextWriterEndElement(writer); /* InUse */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "BlockSize");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ summary.blocksize);
+ xmlTextWriterEndElement(writer); /* BlockSize */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "ContextSize");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ summary.contextsize);
+ xmlTextWriterEndElement(writer); /* ContextSize */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "Lost");
+ xmlTextWriterWriteFormatString(writer, "%" ISC_PRINT_QUADFORMAT "u",
+ lost);
+ xmlTextWriterEndElement(writer); /* Lost */
+
+ xmlTextWriterEndElement(writer); /* summary */
+}
+
+#endif /* HAVE_LIBXML2 */
+#endif /* BIND9 */
diff --git a/lib/isc/mem_api.c b/lib/isc/mem_api.c
new file mode 100644
index 0000000..85abb9b
--- /dev/null
+++ b/lib/isc/mem_api.c
@@ -0,0 +1,303 @@
+/*
+ * Copyright (C) 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mem_api.c,v 1.8 2010/08/12 21:30:26 jinmei Exp $ */
+
+#include <config.h>
+
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/once.h>
+#include <isc/util.h>
+
+#if ISC_MEM_TRACKLINES
+#define FLARG_PASS , file, line
+#define FLARG , const char *file, unsigned int line
+#else
+#define FLARG_PASS
+#define FLARG
+#endif
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_memcreatefunc_t mem_createfunc = NULL;
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_mem_register(isc_memcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (mem_createfunc == NULL)
+ mem_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_mem_create(size_t init_max_size, size_t target_size, isc_mem_t **mctxp) {
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(mem_createfunc != NULL);
+ result = (*mem_createfunc)(init_max_size, target_size, mctxp,
+ ISC_MEMFLAG_DEFAULT);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_mem_create2(size_t init_max_size, size_t target_size, isc_mem_t **mctxp,
+ unsigned int flags)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(mem_createfunc != NULL);
+ result = (*mem_createfunc)(init_max_size, target_size, mctxp, flags);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_mem_attach(isc_mem_t *source, isc_mem_t **targetp) {
+ REQUIRE(ISCAPI_MCTX_VALID(source));
+ REQUIRE(targetp != NULL && *targetp == NULL);
+
+ source->methods->attach(source, targetp);
+
+ ENSURE(*targetp == source);
+}
+
+void
+isc_mem_detach(isc_mem_t **mctxp) {
+ REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
+
+ (*mctxp)->methods->detach(mctxp);
+
+ ENSURE(*mctxp == NULL);
+}
+
+void
+isc_mem_destroy(isc_mem_t **mctxp) {
+ REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
+
+ (*mctxp)->methods->destroy(mctxp);
+
+ ENSURE(*mctxp == NULL);
+}
+
+void *
+isc__mem_get(isc_mem_t *mctx, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->memget(mctx, size FLARG_PASS));
+}
+
+void
+isc__mem_put(isc_mem_t *mctx, void *ptr, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ mctx->methods->memput(mctx, ptr, size FLARG_PASS);
+}
+
+void
+isc__mem_putanddetach(isc_mem_t **mctxp, void *ptr, size_t size FLARG) {
+ REQUIRE(mctxp != NULL && ISCAPI_MCTX_VALID(*mctxp));
+
+ (*mctxp)->methods->memputanddetach(mctxp, ptr, size FLARG_PASS);
+
+ /*
+ * XXX: We cannot always ensure *mctxp == NULL here
+ * (see lib/isc/mem.c).
+ */
+}
+
+void *
+isc__mem_allocate(isc_mem_t *mctx, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->memallocate(mctx, size FLARG_PASS));
+}
+
+void *
+isc__mem_reallocate(isc_mem_t *mctx, void *ptr, size_t size FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->memreallocate(mctx, ptr, size FLARG_PASS));
+}
+
+char *
+isc__mem_strdup(isc_mem_t *mctx, const char *s FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->memstrdup(mctx, s FLARG_PASS));
+}
+
+void
+isc__mem_free(isc_mem_t *mctx, void *ptr FLARG) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ mctx->methods->memfree(mctx, ptr FLARG_PASS);
+}
+
+void
+isc_mem_setdestroycheck(isc_mem_t *mctx, isc_boolean_t flag) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ mctx->methods->setdestroycheck(mctx, flag);
+}
+
+void
+isc_mem_setwater(isc_mem_t *ctx, isc_mem_water_t water, void *water_arg,
+ size_t hiwater, size_t lowater)
+{
+ REQUIRE(ISCAPI_MCTX_VALID(ctx));
+
+ ctx->methods->setwater(ctx, water, water_arg, hiwater, lowater);
+}
+
+void
+isc_mem_waterack(isc_mem_t *ctx, int flag) {
+ REQUIRE(ISCAPI_MCTX_VALID(ctx));
+
+ ctx->methods->waterack(ctx, flag);
+}
+
+size_t
+isc_mem_inuse(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->inuse(mctx));
+}
+
+isc_boolean_t
+isc_mem_isovermem(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->isovermem(mctx));
+}
+
+void
+isc_mem_setname(isc_mem_t *mctx, const char *name, void *tag) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ UNUSED(name);
+ UNUSED(tag);
+
+ return;
+}
+
+const char *
+isc_mem_getname(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return ("");
+}
+
+void *
+isc_mem_gettag(isc_mem_t *mctx) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (NULL);
+}
+
+isc_result_t
+isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp) {
+ REQUIRE(ISCAPI_MCTX_VALID(mctx));
+
+ return (mctx->methods->mpcreate(mctx, size, mpctxp));
+}
+
+void
+isc_mempool_destroy(isc_mempool_t **mpctxp) {
+ REQUIRE(mpctxp != NULL && ISCAPI_MPOOL_VALID(*mpctxp));
+
+ (*mpctxp)->methods->destroy(mpctxp);
+
+ ENSURE(*mpctxp == NULL);
+}
+
+void *
+isc__mempool_get(isc_mempool_t *mpctx FLARG) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ return (mpctx->methods->get(mpctx FLARG_PASS));
+}
+
+void
+isc__mempool_put(isc_mempool_t *mpctx, void *mem FLARG) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ mpctx->methods->put(mpctx, mem FLARG_PASS);
+}
+
+unsigned int
+isc_mempool_getallocated(isc_mempool_t *mpctx) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ return (mpctx->methods->getallocated(mpctx));
+}
+
+void
+isc_mempool_setmaxalloc(isc_mempool_t *mpctx, unsigned int limit) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ mpctx->methods->setmaxalloc(mpctx, limit);
+}
+
+void
+isc_mempool_setfreemax(isc_mempool_t *mpctx, unsigned int limit) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ mpctx->methods->setfreemax(mpctx, limit);
+}
+
+void
+isc_mempool_setname(isc_mempool_t *mpctx, const char *name) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ mpctx->methods->setname(mpctx, name);
+}
+
+void
+isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ mpctx->methods->associatelock(mpctx, lock);
+}
+
+void
+isc_mempool_setfillcount(isc_mempool_t *mpctx, unsigned int limit) {
+ REQUIRE(ISCAPI_MPOOL_VALID(mpctx));
+
+ mpctx->methods->setfillcount(mpctx, limit);
+}
diff --git a/lib/isc/mips/include/isc/atomic.h b/lib/isc/mips/include/isc/atomic.h
new file mode 100644
index 0000000..bb739f7
--- /dev/null
+++ b/lib/isc/mips/include/isc/atomic.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: atomic.h,v 1.3 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#ifdef ISC_PLATFORM_USEGCCASM
+/*
+ * This routine atomically increments the value stored in 'p' by 'val', and
+ * returns the previous value.
+ */
+static inline isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, int val) {
+ isc_int32_t orig;
+
+ /* add is a cheat, since MIPS has no mov instruction */
+ __asm__ volatile (
+ "1:"
+ "ll $3, %1\n"
+ "add %0, $0, $3\n"
+ "add $3, $3, %2\n"
+ "sc $3, %1\n"
+ "beq $3, 0, 1b"
+ : "=&r"(orig)
+ : "m"(*p), "r"(val)
+ : "memory", "$3"
+ );
+
+ return (orig);
+}
+
+/*
+ * This routine atomically stores the value 'val' in 'p'.
+ */
+static inline void
+isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+ __asm__ volatile (
+ "1:"
+ "ll $3, %0\n"
+ "add $3, $0, %1\n"
+ "sc $3, %0\n"
+ "beq $3, 0, 1b"
+ :
+ : "m"(*p), "r"(val)
+ : "memory", "$3"
+ );
+}
+
+/*
+ * This routine atomically replaces the value in 'p' with 'val', if the
+ * original value is equal to 'cmpval'. The original value is returned in any
+ * case.
+ */
+static inline isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, int cmpval, int val) {
+ isc_int32_t orig;
+
+ __asm__ volatile(
+ "1:"
+ "ll $3, %1\n"
+ "add %0, $0, $3\n"
+ "bne $3, %2, 2f\n"
+ "add $3, $0, %3\n"
+ "sc $3, %1\n"
+ "beq $3, 0, 1b\n"
+ "2:"
+ : "=&r"(orig)
+ : "m"(*p), "r"(cmpval), "r"(val)
+ : "memory", "$3"
+ );
+
+ return (orig);
+}
+
+#else /* !ISC_PLATFORM_USEGCCASM */
+
+#error "unsupported compiler. disable atomic ops by --disable-atomic"
+
+#endif
+#endif /* ISC_ATOMIC_H */
diff --git a/lib/isc/mutexblock.c b/lib/isc/mutexblock.c
new file mode 100644
index 0000000..d41e9d2
--- /dev/null
+++ b/lib/isc/mutexblock.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/mutexblock.h>
+#include <isc/util.h>
+
+isc_result_t
+isc_mutexblock_init(isc_mutex_t *block, unsigned int count) {
+ isc_result_t result;
+ unsigned int i;
+
+ for (i = 0; i < count; i++) {
+ result = isc_mutex_init(&block[i]);
+ if (result != ISC_R_SUCCESS) {
+ while (i > 0U) {
+ i--;
+ DESTROYLOCK(&block[i]);
+ }
+ return (result);
+ }
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) {
+ isc_result_t result;
+ unsigned int i;
+
+ for (i = 0; i < count; i++) {
+ result = isc_mutex_destroy(&block[i]);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ }
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c
new file mode 100644
index 0000000..d6928c1
--- /dev/null
+++ b/lib/isc/netaddr.c
@@ -0,0 +1,435 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <isc/buffer.h>
+#include <isc/msgs.h>
+#include <isc/net.h>
+#include <isc/netaddr.h>
+#include <isc/print.h>
+#include <isc/sockaddr.h>
+#include <isc/string.h>
+#include <isc/util.h>
+#include "ntp_stdlib.h" /* NTP change for strlcpy, strlcat */
+
+isc_boolean_t
+isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b) {
+ REQUIRE(a != NULL && b != NULL);
+
+ if (a->family != b->family)
+ return (ISC_FALSE);
+
+ if (a->zone != b->zone)
+ return (ISC_FALSE);
+
+ switch (a->family) {
+ case AF_INET:
+ if (a->type.in.s_addr != b->type.in.s_addr)
+ return (ISC_FALSE);
+ break;
+ case AF_INET6:
+ if (memcmp(&a->type.in6, &b->type.in6,
+ sizeof(a->type.in6)) != 0 ||
+ a->zone != b->zone)
+ return (ISC_FALSE);
+ break;
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ case AF_UNIX:
+ if (strcmp(a->type.un, b->type.un) != 0)
+ return (ISC_FALSE);
+ break;
+#endif
+ default:
+ return (ISC_FALSE);
+ }
+ return (ISC_TRUE);
+}
+
+isc_boolean_t
+isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b,
+ unsigned int prefixlen)
+{
+ const unsigned char *pa = NULL, *pb = NULL;
+ unsigned int ipabytes = 0; /* Length of whole IP address in bytes */
+ unsigned int nbytes; /* Number of significant whole bytes */
+ unsigned int nbits; /* Number of significant leftover bits */
+
+ REQUIRE(a != NULL && b != NULL);
+
+ if (a->family != b->family)
+ return (ISC_FALSE);
+
+ if (a->zone != b->zone && b->zone != 0)
+ return (ISC_FALSE);
+
+ switch (a->family) {
+ case AF_INET:
+ pa = (const unsigned char *) &a->type.in;
+ pb = (const unsigned char *) &b->type.in;
+ ipabytes = 4;
+ break;
+ case AF_INET6:
+ pa = (const unsigned char *) &a->type.in6;
+ pb = (const unsigned char *) &b->type.in6;
+ ipabytes = 16;
+ break;
+ default:
+ return (ISC_FALSE);
+ }
+
+ /*
+ * Don't crash if we get a pattern like 10.0.0.1/9999999.
+ */
+ if (prefixlen > ipabytes * 8)
+ prefixlen = ipabytes * 8;
+
+ nbytes = prefixlen / 8;
+ nbits = prefixlen % 8;
+
+ if (nbytes > 0) {
+ if (memcmp(pa, pb, nbytes) != 0)
+ return (ISC_FALSE);
+ }
+ if (nbits > 0) {
+ unsigned int bytea, byteb, mask;
+ INSIST(nbytes < ipabytes);
+ INSIST(nbits < 8);
+ bytea = pa[nbytes];
+ byteb = pb[nbytes];
+ mask = (0xFF << (8-nbits)) & 0xFF;
+ if ((bytea & mask) != (byteb & mask))
+ return (ISC_FALSE);
+ }
+ return (ISC_TRUE);
+}
+
+isc_result_t
+isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target) {
+ char abuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255")];
+ char zbuf[sizeof("%4294967295")];
+ unsigned int alen;
+ int zlen;
+ const char *r;
+ const void *type;
+
+ REQUIRE(netaddr != NULL);
+
+ switch (netaddr->family) {
+ case AF_INET:
+ type = &netaddr->type.in;
+ break;
+ case AF_INET6:
+ type = &netaddr->type.in6;
+ break;
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ case AF_UNIX:
+ alen = strlen(netaddr->type.un);
+ if (alen > isc_buffer_availablelength(target))
+ return (ISC_R_NOSPACE);
+ isc_buffer_putmem(target,
+ (const unsigned char *)(netaddr->type.un),
+ alen);
+ return (ISC_R_SUCCESS);
+#endif
+ default:
+ return (ISC_R_FAILURE);
+ }
+ r = inet_ntop(netaddr->family, type, abuf, sizeof(abuf));
+ if (r == NULL)
+ return (ISC_R_FAILURE);
+
+ alen = strlen(abuf);
+ INSIST(alen < sizeof(abuf));
+
+ zlen = 0;
+ if (netaddr->family == AF_INET6 && netaddr->zone != 0) {
+ zlen = snprintf(zbuf, sizeof(zbuf), "%%%u", netaddr->zone);
+ if (zlen < 0)
+ return (ISC_R_FAILURE);
+ INSIST((unsigned int)zlen < sizeof(zbuf));
+ }
+
+ if (alen + zlen > isc_buffer_availablelength(target))
+ return (ISC_R_NOSPACE);
+
+ isc_buffer_putmem(target, (unsigned char *)abuf, alen);
+ isc_buffer_putmem(target, (unsigned char *)zbuf, zlen);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size) {
+ isc_result_t result;
+ isc_buffer_t buf;
+
+ isc_buffer_init(&buf, array, size);
+ result = isc_netaddr_totext(na, &buf);
+
+ if (size == 0)
+ return;
+
+ /*
+ * Null terminate.
+ */
+ if (result == ISC_R_SUCCESS) {
+ if (isc_buffer_availablelength(&buf) >= 1)
+ isc_buffer_putuint8(&buf, 0);
+ else
+ result = ISC_R_NOSPACE;
+ }
+
+ if (result != ISC_R_SUCCESS) {
+ snprintf(array, size,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_NETADDR,
+ ISC_MSG_UNKNOWNADDR,
+ "<unknown address, family %u>"),
+ na->family);
+ array[size - 1] = '\0';
+ }
+}
+
+
+isc_result_t
+isc_netaddr_prefixok(const isc_netaddr_t *na, unsigned int prefixlen) {
+ static const unsigned char zeros[16] = { 0 };
+ unsigned int nbits, nbytes, ipbytes = 0;
+ const unsigned char *p;
+
+ switch (na->family) {
+ case AF_INET:
+ p = (const unsigned char *) &na->type.in;
+ ipbytes = 4;
+ if (prefixlen > 32)
+ return (ISC_R_RANGE);
+ break;
+ case AF_INET6:
+ p = (const unsigned char *) &na->type.in6;
+ ipbytes = 16;
+ if (prefixlen > 128)
+ return (ISC_R_RANGE);
+ break;
+ default:
+ return (ISC_R_NOTIMPLEMENTED);
+ }
+ nbytes = prefixlen / 8;
+ nbits = prefixlen % 8;
+ if (nbits != 0) {
+ if ((p[nbytes] & (0xff>>nbits)) != 0U)
+ return (ISC_R_FAILURE);
+ nbytes++;
+ }
+ if (memcmp(p + nbytes, zeros, ipbytes - nbytes) != 0)
+ return (ISC_R_FAILURE);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp) {
+ unsigned int nbits = 0, nbytes = 0, ipbytes = 0, i;
+ const unsigned char *p;
+
+ switch (s->family) {
+ case AF_INET:
+ p = (const unsigned char *) &s->type.in;
+ ipbytes = 4;
+ break;
+ case AF_INET6:
+ p = (const unsigned char *) &s->type.in6;
+ ipbytes = 16;
+ break;
+ default:
+ return (ISC_R_NOTIMPLEMENTED);
+ }
+ for (i = 0; i < ipbytes; i++) {
+ if (p[i] != 0xFF)
+ break;
+ }
+ nbytes = i;
+ if (i < ipbytes) {
+ unsigned int c = p[nbytes];
+ while ((c & 0x80) != 0 && nbits < 8) {
+ c <<= 1; nbits++;
+ }
+ if ((c & 0xFF) != 0)
+ return (ISC_R_MASKNONCONTIG);
+ i++;
+ }
+ for (; i < ipbytes; i++) {
+ if (p[i] != 0)
+ return (ISC_R_MASKNONCONTIG);
+ i++;
+ }
+ *lenp = nbytes * 8 + nbits;
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina) {
+ memset(netaddr, 0, sizeof(*netaddr));
+ netaddr->family = AF_INET;
+ netaddr->type.in = *ina;
+}
+
+void
+isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6) {
+ memset(netaddr, 0, sizeof(*netaddr));
+ netaddr->family = AF_INET6;
+ netaddr->type.in6 = *ina6;
+}
+
+isc_result_t
+isc_netaddr_frompath(isc_netaddr_t *netaddr, const char *path) {
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ if (strlen(path) > sizeof(netaddr->type.un) - 1)
+ return (ISC_R_NOSPACE);
+
+ memset(netaddr, 0, sizeof(*netaddr));
+ netaddr->family = AF_UNIX;
+ strlcpy(netaddr->type.un, path, sizeof(netaddr->type.un));
+ netaddr->zone = 0;
+ return (ISC_R_SUCCESS);
+#else
+ UNUSED(netaddr);
+ UNUSED(path);
+ return (ISC_R_NOTIMPLEMENTED);
+#endif
+}
+
+
+void
+isc_netaddr_setzone(isc_netaddr_t *netaddr, isc_uint32_t zone) {
+ /* we currently only support AF_INET6. */
+ REQUIRE(netaddr->family == AF_INET6);
+
+ netaddr->zone = zone;
+}
+
+isc_uint32_t
+isc_netaddr_getzone(const isc_netaddr_t *netaddr) {
+ return (netaddr->zone);
+}
+
+void
+isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) {
+ int family = s->type.sa.sa_family;
+ t->family = family;
+ switch (family) {
+ case AF_INET:
+ t->type.in = s->type.sin.sin_addr;
+ t->zone = 0;
+ break;
+ case AF_INET6:
+ memcpy(&t->type.in6, &s->type.sin6.sin6_addr, 16);
+#ifdef ISC_PLATFORM_HAVESCOPEID
+ t->zone = s->type.sin6.sin6_scope_id;
+#else
+ t->zone = 0;
+#endif
+ break;
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ case AF_UNIX:
+ memcpy(t->type.un, s->type.sunix.sun_path, sizeof(t->type.un));
+ t->zone = 0;
+ break;
+#endif
+ default:
+ INSIST(0);
+ }
+}
+
+void
+isc_netaddr_any(isc_netaddr_t *netaddr) {
+ memset(netaddr, 0, sizeof(*netaddr));
+ netaddr->family = AF_INET;
+ netaddr->type.in.s_addr = INADDR_ANY;
+}
+
+void
+isc_netaddr_any6(isc_netaddr_t *netaddr) {
+ memset(netaddr, 0, sizeof(*netaddr));
+ netaddr->family = AF_INET6;
+ netaddr->type.in6 = in6addr_any;
+}
+
+isc_boolean_t
+isc_netaddr_ismulticast(isc_netaddr_t *na) {
+ switch (na->family) {
+ case AF_INET:
+ return (ISC_TF(ISC_IPADDR_ISMULTICAST(na->type.in.s_addr)));
+ case AF_INET6:
+ return (ISC_TF(IN6_IS_ADDR_MULTICAST(&na->type.in6)));
+ default:
+ return (ISC_FALSE); /* XXXMLG ? */
+ }
+}
+
+isc_boolean_t
+isc_netaddr_isexperimental(isc_netaddr_t *na) {
+ switch (na->family) {
+ case AF_INET:
+ return (ISC_TF(ISC_IPADDR_ISEXPERIMENTAL(na->type.in.s_addr)));
+ default:
+ return (ISC_FALSE); /* XXXMLG ? */
+ }
+}
+
+isc_boolean_t
+isc_netaddr_islinklocal(isc_netaddr_t *na) {
+ switch (na->family) {
+ case AF_INET:
+ return (ISC_FALSE);
+ case AF_INET6:
+ return (ISC_TF(IN6_IS_ADDR_LINKLOCAL(&na->type.in6)));
+ default:
+ return (ISC_FALSE);
+ }
+}
+
+isc_boolean_t
+isc_netaddr_issitelocal(isc_netaddr_t *na) {
+ switch (na->family) {
+ case AF_INET:
+ return (ISC_FALSE);
+ case AF_INET6:
+ return (ISC_TF(IN6_IS_ADDR_SITELOCAL(&na->type.in6)));
+ default:
+ return (ISC_FALSE);
+ }
+}
+
+void
+isc_netaddr_fromv4mapped(isc_netaddr_t *t, const isc_netaddr_t *s) {
+ isc_netaddr_t *src;
+
+ DE_CONST(s, src); /* Must come before IN6_IS_ADDR_V4MAPPED. */
+
+ REQUIRE(s->family == AF_INET6);
+ REQUIRE(IN6_IS_ADDR_V4MAPPED(&src->type.in6));
+
+ memset(t, 0, sizeof(*t));
+ t->family = AF_INET;
+ memcpy(&t->type.in, (char *)&src->type.in6 + 12, 4);
+ return;
+}
diff --git a/lib/isc/netscope.c b/lib/isc/netscope.c
new file mode 100644
index 0000000..9aa11db
--- /dev/null
+++ b/lib/isc/netscope.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*! \file */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] =
+ "$Id: netscope.c,v 1.13 2007/06/19 23:47:17 tbox Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <config.h>
+
+#include <isc/string.h>
+#include <isc/net.h>
+#include <isc/netscope.h>
+#include <isc/result.h>
+
+isc_result_t
+isc_netscope_pton(int af, char *scopename, void *addr, isc_uint32_t *zoneid) {
+ char *ep;
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+ unsigned int ifid;
+#endif
+ struct in6_addr *in6;
+ isc_uint32_t zone;
+ isc_uint64_t llz;
+
+ /* at this moment, we only support AF_INET6 */
+ if (af != AF_INET6)
+ return (ISC_R_FAILURE);
+
+ in6 = (struct in6_addr *)addr;
+
+ /*
+ * Basically, "names" are more stable than numeric IDs in terms of
+ * renumbering, and are more preferred. However, since there is no
+ * standard naming convention and APIs to deal with the names. Thus,
+ * we only handle the case of link-local addresses, for which we use
+ * interface names as link names, assuming one to one mapping between
+ * interfaces and links.
+ */
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+ if (IN6_IS_ADDR_LINKLOCAL(in6) &&
+ (ifid = if_nametoindex((const char *)scopename)) != 0)
+ zone = (isc_uint32_t)ifid;
+ else {
+#endif
+ llz = isc_string_touint64(scopename, &ep, 10);
+ if (ep == scopename)
+ return (ISC_R_FAILURE);
+
+ /* check overflow */
+ zone = (isc_uint32_t)(llz & 0xffffffffUL);
+ if (zone != llz)
+ return (ISC_R_FAILURE);
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+ }
+#endif
+
+ *zoneid = zone;
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/nls/msgcat.c b/lib/isc/nls/msgcat.c
new file mode 100644
index 0000000..3d6b676
--- /dev/null
+++ b/lib/isc/nls/msgcat.c
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: msgcat.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+
+/*! \file msgcat.c
+ *
+ * \author Principal Author: Bob Halley
+ */
+
+#include <config.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#include <isc/magic.h>
+#include <isc/msgcat.h>
+#include <isc/util.h>
+
+#ifdef HAVE_CATGETS
+#include <nl_types.h> /* Required for nl_catd. */
+#endif
+
+/*
+ * Implementation Notes:
+ *
+ * We use malloc() and free() instead of isc_mem_get() and isc_mem_put()
+ * because we don't want to require a memory context to be specified
+ * in order to use a message catalog.
+ */
+
+struct isc_msgcat {
+ unsigned int magic;
+#ifdef HAVE_CATGETS
+ nl_catd catalog;
+#endif
+};
+
+#define MSGCAT_MAGIC ISC_MAGIC('M', 'C', 'a', 't')
+#define VALID_MSGCAT(m) ISC_MAGIC_VALID(m, MSGCAT_MAGIC)
+
+void
+isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp) {
+ isc_msgcat_t *msgcat;
+
+ /*
+ * Open a message catalog.
+ */
+
+ REQUIRE(name != NULL);
+ REQUIRE(msgcatp != NULL && *msgcatp == NULL);
+
+ msgcat = malloc(sizeof(*msgcat));
+ if (msgcat == NULL) {
+ *msgcatp = NULL;
+ return;
+ }
+
+#ifdef HAVE_CATGETS
+ /*
+ * We don't check if catopen() fails because we don't care.
+ * If it does fail, then when we call catgets(), it will use
+ * the default string.
+ */
+ msgcat->catalog = catopen(name, 0);
+#endif
+ msgcat->magic = MSGCAT_MAGIC;
+
+ *msgcatp = msgcat;
+}
+
+void
+isc_msgcat_close(isc_msgcat_t **msgcatp) {
+ isc_msgcat_t *msgcat;
+
+ /*
+ * Close a message catalog.
+ */
+
+ REQUIRE(msgcatp != NULL);
+ msgcat = *msgcatp;
+ REQUIRE(VALID_MSGCAT(msgcat) || msgcat == NULL);
+
+ if (msgcat != NULL) {
+#ifdef HAVE_CATGETS
+ if (msgcat->catalog != (nl_catd)(-1))
+ (void)catclose(msgcat->catalog);
+#endif
+ msgcat->magic = 0;
+ free(msgcat);
+ }
+
+ *msgcatp = NULL;
+}
+
+const char *
+isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
+ const char *default_text)
+{
+ /*
+ * Get message 'message' from message set 'set' in 'msgcat'. If it
+ * is not available, use 'default'.
+ */
+
+ REQUIRE(VALID_MSGCAT(msgcat) || msgcat == NULL);
+ REQUIRE(set > 0);
+ REQUIRE(message > 0);
+ REQUIRE(default_text != NULL);
+
+#ifdef HAVE_CATGETS
+ if (msgcat == NULL)
+ return (default_text);
+ return (catgets(msgcat->catalog, set, message, default_text));
+#else
+ return (default_text);
+#endif
+}
diff --git a/lib/isc/noatomic/include/isc/atomic.h b/lib/isc/noatomic/include/isc/atomic.h
new file mode 100644
index 0000000..942ba03
--- /dev/null
+++ b/lib/isc/noatomic/include/isc/atomic.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: atomic.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+/* This file is inherently empty. */
+
+#endif /* ISC_ATOMIC_H */
diff --git a/lib/isc/nothreads/condition.c b/lib/isc/nothreads/condition.c
new file mode 100644
index 0000000..9be8f83
--- /dev/null
+++ b/lib/isc/nothreads/condition.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: condition.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */
+
+#include <config.h>
+
+#include <isc/util.h>
+
+EMPTY_TRANSLATION_UNIT
diff --git a/lib/isc/nothreads/include/isc/condition.h b/lib/isc/nothreads/include/isc/condition.h
new file mode 100644
index 0000000..b269f82
--- /dev/null
+++ b/lib/isc/nothreads/include/isc/condition.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: condition.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+
+/*
+ * This provides a limited subset of the isc_condition_t
+ * functionality for use by single-threaded programs that
+ * need to block waiting for events. Only a single
+ * call to isc_condition_wait() may be blocked at any given
+ * time, and the _waituntil and _broadcast functions are not
+ * supported. This is intended primarily for use by the omapi
+ * library, and may go away once omapi goes away. Use for
+ * other purposes is strongly discouraged.
+ */
+
+#ifndef ISC_CONDITION_H
+#define ISC_CONDITION_H 1
+
+#include <isc/mutex.h>
+
+typedef int isc_condition_t;
+
+isc_result_t isc__nothread_wait_hack(isc_condition_t *cp, isc_mutex_t *mp);
+isc_result_t isc__nothread_signal_hack(isc_condition_t *cp);
+
+#define isc_condition_init(cp) \
+ (*(cp) = 0, ISC_R_SUCCESS)
+
+#define isc_condition_wait(cp, mp) \
+ isc__nothread_wait_hack(cp, mp)
+
+#define isc_condition_waituntil(cp, mp, tp) \
+ ((void)(cp), (void)(mp), (void)(tp), ISC_R_NOTIMPLEMENTED)
+
+#define isc_condition_signal(cp) \
+ isc__nothread_signal_hack(cp)
+
+#define isc_condition_broadcast(cp) \
+ ((void)(cp), ISC_R_NOTIMPLEMENTED)
+
+#define isc_condition_destroy(cp) \
+ (*(cp) == 0 ? (*(cp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED)
+
+#endif /* ISC_CONDITION_H */
diff --git a/lib/isc/nothreads/include/isc/mutex.h b/lib/isc/nothreads/include/isc/mutex.h
new file mode 100644
index 0000000..1f2187b
--- /dev/null
+++ b/lib/isc/nothreads/include/isc/mutex.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mutex.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_MUTEX_H
+#define ISC_MUTEX_H 1
+
+#include <isc/result.h> /* for ISC_R_ codes */
+
+typedef int isc_mutex_t;
+
+#define isc_mutex_init(mp) \
+ (*(mp) = 0, ISC_R_SUCCESS)
+#define isc_mutex_lock(mp) \
+ ((*(mp))++ == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#define isc_mutex_unlock(mp) \
+ (--(*(mp)) == 0 ? ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#define isc_mutex_trylock(mp) \
+ (*(mp) == 0 ? ((*(mp))++, ISC_R_SUCCESS) : ISC_R_LOCKBUSY)
+#define isc_mutex_destroy(mp) \
+ (*(mp) == 0 ? (*(mp) = -1, ISC_R_SUCCESS) : ISC_R_UNEXPECTED)
+#define isc_mutex_stats(fp)
+
+#endif /* ISC_MUTEX_H */
diff --git a/lib/isc/nothreads/include/isc/once.h b/lib/isc/nothreads/include/isc/once.h
new file mode 100644
index 0000000..ab705a4
--- /dev/null
+++ b/lib/isc/nothreads/include/isc/once.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: once.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_ONCE_H
+#define ISC_ONCE_H 1
+
+#include <isc/result.h>
+
+typedef isc_boolean_t isc_once_t;
+
+#define ISC_ONCE_INIT ISC_FALSE
+
+#define isc_once_do(op, f) \
+ (!*(op) ? (f(), *(op) = ISC_TRUE, ISC_R_SUCCESS) : ISC_R_SUCCESS)
+
+#endif /* ISC_ONCE_H */
diff --git a/lib/isc/nothreads/include/isc/thread.h b/lib/isc/nothreads/include/isc/thread.h
new file mode 100644
index 0000000..313bc5f
--- /dev/null
+++ b/lib/isc/nothreads/include/isc/thread.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: thread.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_THREAD_H
+#define ISC_THREAD_H 1
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_thread_setconcurrency(unsigned int level);
+
+#define isc_thread_self() ((unsigned long)0)
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_THREAD_H */
diff --git a/lib/isc/nothreads/mutex.c b/lib/isc/nothreads/mutex.c
new file mode 100644
index 0000000..50ba0f4
--- /dev/null
+++ b/lib/isc/nothreads/mutex.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mutex.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */
+
+#include <config.h>
+
+#include <isc/util.h>
+
+EMPTY_TRANSLATION_UNIT
+
diff --git a/lib/isc/nothreads/thread.c b/lib/isc/nothreads/thread.c
new file mode 100644
index 0000000..9075e25
--- /dev/null
+++ b/lib/isc/nothreads/thread.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: thread.c,v 1.5 2007/06/19 23:47:18 tbox Exp $ */
+
+#include <config.h>
+
+#include <isc/thread.h>
+#include <isc/util.h>
+
+void
+isc_thread_setconcurrency(unsigned int level) {
+ UNUSED(level);
+}
diff --git a/lib/isc/ondestroy.c b/lib/isc/ondestroy.c
new file mode 100644
index 0000000..32a75e1
--- /dev/null
+++ b/lib/isc/ondestroy.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ondestroy.c,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h>
+
+#include <isc/event.h>
+#include <isc/magic.h>
+#include <isc/ondestroy.h>
+#include <isc/task.h>
+#include <isc/util.h>
+
+#define ONDESTROY_MAGIC ISC_MAGIC('D', 'e', 'S', 't')
+#define VALID_ONDESTROY(s) ISC_MAGIC_VALID(s, ONDESTROY_MAGIC)
+
+void
+isc_ondestroy_init(isc_ondestroy_t *ondest) {
+ ondest->magic = ONDESTROY_MAGIC;
+ ISC_LIST_INIT(ondest->events);
+}
+
+isc_result_t
+isc_ondestroy_register(isc_ondestroy_t *ondest, isc_task_t *task,
+ isc_event_t **eventp)
+{
+ isc_event_t *theevent;
+ isc_task_t *thetask = NULL;
+
+ REQUIRE(VALID_ONDESTROY(ondest));
+ REQUIRE(task != NULL);
+ REQUIRE(eventp != NULL);
+
+ theevent = *eventp;
+
+ REQUIRE(theevent != NULL);
+
+ isc_task_attach(task, &thetask);
+
+ theevent->ev_sender = thetask;
+
+ ISC_LIST_APPEND(ondest->events, theevent, ev_link);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_ondestroy_notify(isc_ondestroy_t *ondest, void *sender) {
+ isc_event_t *eventp;
+ isc_task_t *task;
+
+ REQUIRE(VALID_ONDESTROY(ondest));
+
+ eventp = ISC_LIST_HEAD(ondest->events);
+ while (eventp != NULL) {
+ ISC_LIST_UNLINK(ondest->events, eventp, ev_link);
+
+ task = eventp->ev_sender;
+ eventp->ev_sender = sender;
+
+ isc_task_sendanddetach(&task, &eventp);
+
+ eventp = ISC_LIST_HEAD(ondest->events);
+ }
+}
+
+
diff --git a/lib/isc/parseint.c b/lib/isc/parseint.c
new file mode 100644
index 0000000..266d44c
--- /dev/null
+++ b/lib/isc/parseint.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: parseint.c,v 1.8 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <isc/parseint.h>
+#include <isc/result.h>
+#include <isc/stdlib.h>
+
+isc_result_t
+isc_parse_uint32(isc_uint32_t *uip, const char *string, int base) {
+ unsigned long n;
+ char *e;
+ if (! isalnum((unsigned char)(string[0])))
+ return (ISC_R_BADNUMBER);
+ errno = 0;
+ n = strtoul(string, &e, base);
+ if (*e != '\0')
+ return (ISC_R_BADNUMBER);
+ if (n == ULONG_MAX && errno == ERANGE)
+ return (ISC_R_RANGE);
+ *uip = n;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_parse_uint16(isc_uint16_t *uip, const char *string, int base) {
+ isc_uint32_t val;
+ isc_result_t result;
+ result = isc_parse_uint32(&val, string, base);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ if (val > 0xFFFF)
+ return (ISC_R_RANGE);
+ *uip = (isc_uint16_t) val;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_parse_uint8(isc_uint8_t *uip, const char *string, int base) {
+ isc_uint32_t val;
+ isc_result_t result;
+ result = isc_parse_uint32(&val, string, base);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ if (val > 0xFF)
+ return (ISC_R_RANGE);
+ *uip = (isc_uint8_t) val;
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/portset.c b/lib/isc/portset.c
new file mode 100644
index 0000000..471ca8e
--- /dev/null
+++ b/lib/isc/portset.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: portset.c,v 1.4 2008/06/24 23:24:35 marka Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/mem.h>
+#include <isc/portset.h>
+#include <isc/string.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+#define ISC_PORTSET_BUFSIZE (65536 / (sizeof(isc_uint32_t) * 8))
+
+/*%
+ * Internal representation of portset. It's an array of 32-bit integers, each
+ * bit corresponding to a single port in the ascending order. For example,
+ * the second most significant bit of buf[0] corresponds to port 1.
+ */
+struct isc_portset {
+ unsigned int nports; /*%< number of ports in the set */
+ isc_uint32_t buf[ISC_PORTSET_BUFSIZE];
+};
+
+static inline isc_boolean_t
+portset_isset(isc_portset_t *portset, in_port_t port) {
+ return (ISC_TF((portset->buf[port >> 5] & (1 << (port & 31))) != 0));
+}
+
+static inline void
+portset_add(isc_portset_t *portset, in_port_t port) {
+ if (!portset_isset(portset, port)) {
+ portset->nports++;
+ portset->buf[port >> 5] |= (1 << (port & 31));
+ }
+}
+
+static inline void
+portset_remove(isc_portset_t *portset, in_port_t port) {
+ if (portset_isset(portset, port)) {
+ portset->nports--;
+ portset->buf[port >> 5] &= ~(1 << (port & 31));
+ }
+}
+
+isc_result_t
+isc_portset_create(isc_mem_t *mctx, isc_portset_t **portsetp) {
+ isc_portset_t *portset;
+
+ REQUIRE(portsetp != NULL && *portsetp == NULL);
+
+ portset = isc_mem_get(mctx, sizeof(*portset));
+ if (portset == NULL)
+ return (ISC_R_NOMEMORY);
+
+ /* Make the set 'empty' by default */
+ memset(portset, 0, sizeof(*portset));
+ *portsetp = portset;
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_portset_destroy(isc_mem_t *mctx, isc_portset_t **portsetp) {
+ isc_portset_t *portset;
+
+ REQUIRE(portsetp != NULL);
+ portset = *portsetp;
+
+ isc_mem_put(mctx, portset, sizeof(*portset));
+}
+
+isc_boolean_t
+isc_portset_isset(isc_portset_t *portset, in_port_t port) {
+ REQUIRE(portset != NULL);
+
+ return (portset_isset(portset, port));
+}
+
+unsigned int
+isc_portset_nports(isc_portset_t *portset) {
+ REQUIRE(portset != NULL);
+
+ return (portset->nports);
+}
+
+void
+isc_portset_add(isc_portset_t *portset, in_port_t port) {
+ REQUIRE(portset != NULL);
+
+ portset_add(portset, port);
+}
+
+void
+isc_portset_remove(isc_portset_t *portset, in_port_t port) {
+ portset_remove(portset, port);
+}
+
+void
+isc_portset_addrange(isc_portset_t *portset, in_port_t port_lo,
+ in_port_t port_hi)
+{
+ in_port_t p;
+
+ REQUIRE(portset != NULL);
+ REQUIRE(port_lo <= port_hi);
+
+ p = port_lo;
+ do {
+ portset_add(portset, p);
+ } while (p++ < port_hi);
+}
+
+void
+isc_portset_removerange(isc_portset_t *portset, in_port_t port_lo,
+ in_port_t port_hi)
+{
+ in_port_t p;
+
+ REQUIRE(portset != NULL);
+ REQUIRE(port_lo <= port_hi);
+
+ p = port_lo;
+ do {
+ portset_remove(portset, p);
+ } while (p++ < port_hi);
+}
diff --git a/lib/isc/powerpc/include/isc/atomic.h b/lib/isc/powerpc/include/isc/atomic.h
new file mode 100644
index 0000000..030007f
--- /dev/null
+++ b/lib/isc/powerpc/include/isc/atomic.h
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2005, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+#include <isc/platform.h>
+#include <isc/types.h>
+
+/*!\file
+ * static inline isc_int32_t
+ * isc_atomic_xadd(isc_int32_t *p, isc_int32_t val);
+ *
+ * This routine atomically increments the value stored in 'p' by 'val', and
+ * returns the previous value.
+ *
+ * static inline void
+ * isc_atomic_store(void *p, isc_int32_t val);
+ *
+ * This routine atomically stores the value 'val' in 'p'.
+ *
+ * static inline isc_int32_t
+ * isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val);
+ *
+ * This routine atomically replaces the value in 'p' with 'val', if the
+ * original value is equal to 'cmpval'. The original value is returned in any
+ * case.
+ */
+
+#if defined(_AIX)
+
+#include <sys/atomic_op.h>
+
+#define isc_atomic_store(p, v) _clear_lock(p, v)
+
+#ifdef __GNUC__
+static inline isc_int32_t
+#else
+static isc_int32_t
+#endif
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ int ret;
+
+#ifdef __GNUC__
+ asm("ics");
+#else
+ __isync();
+#endif
+
+ ret = fetch_and_add((atomic_p)p, (int)val);
+
+#ifdef __GNUC__
+ asm("ics");
+#else
+ __isync();
+#endif
+
+ return (ret);
+}
+
+#ifdef __GNUC__
+static inline int
+#else
+static int
+#endif
+isc_atomic_cmpxchg(atomic_p p, int old, int new) {
+ int orig = old;
+
+#ifdef __GNUC__
+ asm("ics");
+#else
+ __isync();
+#endif
+ if (compare_and_swap(p, &orig, new))
+ orig = old;
+
+#ifdef __GNUC__
+ asm("ics");
+#else
+ __isync();
+#endif
+
+ return (orig);
+}
+
+#elif defined(ISC_PLATFORM_USEGCCASM) || defined(ISC_PLATFORM_USEMACASM)
+static inline isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ isc_int32_t orig;
+
+ __asm__ volatile (
+#ifdef ISC_PLATFORM_USEMACASM
+ "1:"
+ "lwarx r6, 0, %1\n"
+ "mr %0, r6\n"
+ "add r6, r6, %2\n"
+ "stwcx. r6, 0, %1\n"
+ "bne- 1b\n"
+ "sync"
+#else
+ "1:"
+ "lwarx 6, 0, %1\n"
+ "mr %0, 6\n"
+ "add 6, 6, %2\n"
+ "stwcx. 6, 0, %1\n"
+ "bne- 1b\n"
+ "sync"
+#endif
+ : "=&r"(orig)
+ : "r"(p), "r"(val)
+ : "r6", "memory"
+ );
+
+ return (orig);
+}
+
+static inline void
+isc_atomic_store(void *p, isc_int32_t val) {
+ __asm__ volatile (
+#ifdef ISC_PLATFORM_USEMACASM
+ "1:"
+ "lwarx r6, 0, %0\n"
+ "lwz r6, %1\n"
+ "stwcx. r6, 0, %0\n"
+ "bne- 1b\n"
+ "sync"
+#else
+ "1:"
+ "lwarx 6, 0, %0\n"
+ "lwz 6, %1\n"
+ "stwcx. 6, 0, %0\n"
+ "bne- 1b\n"
+ "sync"
+#endif
+ :
+ : "r"(p), "m"(val)
+ : "r6", "memory"
+ );
+}
+
+static inline isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+ isc_int32_t orig;
+
+ __asm__ volatile (
+#ifdef ISC_PLATFORM_USEMACASM
+ "1:"
+ "lwarx r6, 0, %1\n"
+ "mr %0,r6\n"
+ "cmpw r6, %2\n"
+ "bne 2f\n"
+ "mr r6, %3\n"
+ "stwcx. r6, 0, %1\n"
+ "bne- 1b\n"
+ "2:\n"
+ "sync"
+#else
+ "1:"
+ "lwarx 6, 0, %1\n"
+ "mr %0,6\n"
+ "cmpw 6, %2\n"
+ "bne 2f\n"
+ "mr 6, %3\n"
+ "stwcx. 6, 0, %1\n"
+ "bne- 1b\n"
+ "2:\n"
+ "sync"
+#endif
+ : "=&r" (orig)
+ : "r"(p), "r"(cmpval), "r"(val)
+ : "r6", "memory"
+ );
+
+ return (orig);
+}
+
+#else
+
+#error "unsupported compiler. disable atomic ops by --disable-atomic"
+
+#endif
+#endif /* ISC_ATOMIC_H */
diff --git a/lib/isc/print.c b/lib/isc/print.c
new file mode 100644
index 0000000..a5e5ba6
--- /dev/null
+++ b/lib/isc/print.c
@@ -0,0 +1,624 @@
+/*
+ * Copyright (C) 2004-2008, 2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: print.c,v 1.37 2010/10/18 23:47:08 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <ctype.h>
+#include <stdio.h> /* for sprintf() */
+#include <string.h> /* for strlen() */
+
+#define ISC__PRINT_SOURCE /* Used to get the isc_print_* prototypes. */
+
+#include <isc/assertions.h>
+#include <isc/int.h>
+#include <isc/msgs.h>
+#include <isc/print.h>
+#include <isc/stdlib.h>
+#include <isc/util.h>
+
+int
+isc_print_sprintf(char *str, const char *format, ...) {
+ va_list ap;
+
+ va_start(ap, format);
+ vsprintf(str, format, ap);
+ va_end(ap);
+ return (strlen(str));
+}
+
+/*!
+ * Return length of string that would have been written if not truncated.
+ */
+
+int
+isc_print_snprintf(char *str, size_t size, const char *format, ...) {
+ va_list ap;
+ int ret;
+
+ va_start(ap, format);
+ ret = vsnprintf(str, size, format, ap);
+ va_end(ap);
+ return (ret);
+
+}
+
+/*!
+ * Return length of string that would have been written if not truncated.
+ */
+
+int
+isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
+ int h;
+ int l;
+ int q;
+ int alt;
+ int zero;
+ int left;
+ int plus;
+ int space;
+ int neg;
+ isc_int64_t tmpi;
+ isc_uint64_t tmpui;
+ unsigned long width;
+ unsigned long precision;
+ unsigned int length;
+ char buf[1024];
+ char c;
+ void *v;
+ char *save = str;
+ const char *cp;
+ const char *head;
+ int count = 0;
+ int pad;
+ int zeropad;
+ int dot;
+ double dbl;
+#ifdef HAVE_LONG_DOUBLE
+ long double ldbl;
+#endif
+ char fmt[32];
+
+ INSIST(str != NULL);
+ INSIST(format != NULL);
+
+ while (*format != '\0') {
+ if (*format != '%') {
+ if (size > 1) {
+ *str++ = *format;
+ size--;
+ }
+ count++;
+ format++;
+ continue;
+ }
+ format++;
+
+ /*
+ * Reset flags.
+ */
+ dot = neg = space = plus = left = zero = alt = h = l = q = 0;
+ width = precision = 0;
+ head = "";
+ length = pad = zeropad = 0;
+
+ do {
+ if (*format == '#') {
+ alt = 1;
+ format++;
+ } else if (*format == '-') {
+ left = 1;
+ zero = 0;
+ format++;
+ } else if (*format == ' ') {
+ if (!plus)
+ space = 1;
+ format++;
+ } else if (*format == '+') {
+ plus = 1;
+ space = 0;
+ format++;
+ } else if (*format == '0') {
+ if (!left)
+ zero = 1;
+ format++;
+ } else
+ break;
+ } while (1);
+
+ /*
+ * Width.
+ */
+ if (*format == '*') {
+ width = va_arg(ap, int);
+ format++;
+ } else if (isdigit((unsigned char)*format)) {
+ char *e;
+ width = strtoul(format, &e, 10);
+ format = e;
+ }
+
+ /*
+ * Precision.
+ */
+ if (*format == '.') {
+ format++;
+ dot = 1;
+ if (*format == '*') {
+ precision = va_arg(ap, int);
+ format++;
+ } else if (isdigit((unsigned char)*format)) {
+ char *e;
+ precision = strtoul(format, &e, 10);
+ format = e;
+ }
+ }
+
+ switch (*format) {
+ case '\0':
+ continue;
+ case '%':
+ if (size > 1) {
+ *str++ = *format;
+ size--;
+ }
+ count++;
+ break;
+ case 'q':
+ q = 1;
+ format++;
+ goto doint;
+ case 'h':
+ h = 1;
+ format++;
+ goto doint;
+ case 'l':
+ l = 1;
+ format++;
+ if (*format == 'l') {
+ q = 1;
+ format++;
+ }
+ goto doint;
+ case 'n':
+ case 'i':
+ case 'd':
+ case 'o':
+ case 'u':
+ case 'x':
+ case 'X':
+ doint:
+ if (precision != 0)
+ zero = 0;
+ switch (*format) {
+ case 'n':
+ if (h) {
+ short int *p;
+ p = va_arg(ap, short *);
+ REQUIRE(p != NULL);
+ *p = str - save;
+ } else if (l) {
+ long int *p;
+ p = va_arg(ap, long *);
+ REQUIRE(p != NULL);
+ *p = str - save;
+ } else {
+ int *p;
+ p = va_arg(ap, int *);
+ REQUIRE(p != NULL);
+ *p = str - save;
+ }
+ break;
+ case 'i':
+ case 'd':
+ if (q)
+ tmpi = va_arg(ap, isc_int64_t);
+ else if (l)
+ tmpi = va_arg(ap, long int);
+ else
+ tmpi = va_arg(ap, int);
+ if (tmpi < 0) {
+ head = "-";
+ tmpui = -tmpi;
+ } else {
+ if (plus)
+ head = "+";
+ else if (space)
+ head = " ";
+ else
+ head = "";
+ tmpui = tmpi;
+ }
+ if (tmpui <= 0xffffffffU)
+ sprintf(buf, "%lu",
+ (unsigned long)tmpui);
+ else {
+ unsigned long mid;
+ unsigned long lo;
+ unsigned long hi;
+ lo = tmpui % 1000000000;
+ tmpui /= 1000000000;
+ mid = tmpui % 1000000000;
+ hi = tmpui / 1000000000;
+ if (hi != 0)
+ sprintf(buf, "%lu", hi);
+ else
+ buf[0] = '\n';
+ sprintf(buf + strlen(buf), "%lu", mid);
+ sprintf(buf + strlen(buf), "%lu", lo);
+ }
+ goto printint;
+ case 'o':
+ if (q)
+ tmpui = va_arg(ap, isc_uint64_t);
+ else if (l)
+ tmpui = va_arg(ap, long int);
+ else
+ tmpui = va_arg(ap, int);
+ if (tmpui <= 0xffffffffU)
+ sprintf(buf, alt ? "%#lo" : "%lo",
+ (unsigned long)tmpui);
+ else {
+ unsigned long mid;
+ unsigned long lo;
+ unsigned long hi;
+ lo = tmpui % 010000000000;
+ tmpui /= 010000000000;
+ mid = tmpui % 010000000000;
+ hi = tmpui / 010000000000;
+ if (hi != 0) {
+ sprintf(buf,
+ alt ? "%#lo" : "%lo",
+ hi);
+ sprintf(buf + strlen(buf),
+ "%lo", mid);
+ } else
+ sprintf(buf,
+ alt ? "%#lo" : "%lo",
+ mid);
+ sprintf(buf + strlen(buf), "%lo", lo);
+ }
+ goto printint;
+ case 'u':
+ if (q)
+ tmpui = va_arg(ap, isc_uint64_t);
+ else if (l)
+ tmpui = va_arg(ap, unsigned long int);
+ else
+ tmpui = va_arg(ap, unsigned int);
+ if (tmpui <= 0xffffffffU)
+ sprintf(buf, "%lu",
+ (unsigned long)tmpui);
+ else {
+ unsigned long mid;
+ unsigned long lo;
+ unsigned long hi;
+ lo = tmpui % 1000000000;
+ tmpui /= 1000000000;
+ mid = tmpui % 1000000000;
+ hi = tmpui / 1000000000;
+ if (hi != 0)
+ sprintf(buf, "%lu", hi);
+ else
+ buf[0] = '\n';
+ sprintf(buf + strlen(buf), "%lu", mid);
+ sprintf(buf + strlen(buf), "%lu", lo);
+ }
+ goto printint;
+ case 'x':
+ if (q)
+ tmpui = va_arg(ap, isc_uint64_t);
+ else if (l)
+ tmpui = va_arg(ap, unsigned long int);
+ else
+ tmpui = va_arg(ap, unsigned int);
+ if (alt) {
+ head = "0x";
+ if (precision > 2)
+ precision -= 2;
+ }
+ if (tmpui <= 0xffffffffU)
+ sprintf(buf, "%lx",
+ (unsigned long)tmpui);
+ else {
+ unsigned long hi = tmpui>>32;
+ unsigned long lo = tmpui & 0xffffffff;
+ sprintf(buf, "%lx", hi);
+ sprintf(buf + strlen(buf), "%lx", lo);
+ }
+ goto printint;
+ case 'X':
+ if (q)
+ tmpui = va_arg(ap, isc_uint64_t);
+ else if (l)
+ tmpui = va_arg(ap, unsigned long int);
+ else
+ tmpui = va_arg(ap, unsigned int);
+ if (alt) {
+ head = "0X";
+ if (precision > 2)
+ precision -= 2;
+ }
+ if (tmpui <= 0xffffffffU)
+ sprintf(buf, "%lX",
+ (unsigned long)tmpui);
+ else {
+ unsigned long hi = tmpui>>32;
+ unsigned long lo = tmpui & 0xffffffff;
+ sprintf(buf, "%lX", hi);
+ sprintf(buf + strlen(buf), "%lX", lo);
+ }
+ goto printint;
+ printint:
+ if (precision != 0 || width != 0) {
+ length = strlen(buf);
+ if (length < precision)
+ zeropad = precision - length;
+ else if (length < width && zero)
+ zeropad = width - length;
+ if (width != 0) {
+ pad = width - length -
+ zeropad - strlen(head);
+ if (pad < 0)
+ pad = 0;
+ }
+ }
+ count += strlen(head) + strlen(buf) + pad +
+ zeropad;
+ if (!left) {
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ }
+ cp = head;
+ while (*cp != '\0' && size > 1) {
+ *str++ = *cp++;
+ size--;
+ }
+ while (zeropad > 0 && size > 1) {
+ *str++ = '0';
+ size--;
+ zeropad--;
+ }
+ cp = buf;
+ while (*cp != '\0' && size > 1) {
+ *str++ = *cp++;
+ size--;
+ }
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case 's':
+ cp = va_arg(ap, char *);
+ REQUIRE(cp != NULL);
+
+ if (precision != 0) {
+ /*
+ * cp need not be NULL terminated.
+ */
+ const char *tp;
+ unsigned long n;
+
+ n = precision;
+ tp = cp;
+ while (n != 0 && *tp != '\0')
+ n--, tp++;
+ length = precision - n;
+ } else {
+ length = strlen(cp);
+ }
+ if (width != 0) {
+ pad = width - length;
+ if (pad < 0)
+ pad = 0;
+ }
+ count += pad + length;
+ if (!left)
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ if (precision != 0)
+ while (precision > 0 && *cp != '\0' &&
+ size > 1) {
+ *str++ = *cp++;
+ size--;
+ precision--;
+ }
+ else
+ while (*cp != '\0' && size > 1) {
+ *str++ = *cp++;
+ size--;
+ }
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ break;
+ case 'c':
+ c = va_arg(ap, int);
+ if (width > 0) {
+ count += width;
+ width--;
+ if (left && size > 1) {
+ *str++ = c;
+ size--;
+ }
+ while (width-- > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ }
+ if (!left && size > 1) {
+ *str++ = c;
+ size--;
+ }
+ } else {
+ count++;
+ if (size > 1) {
+ *str++ = c;
+ size--;
+ }
+ }
+ break;
+ case 'p':
+ v = va_arg(ap, void *);
+ sprintf(buf, "%p", v);
+ length = strlen(buf);
+ if (precision > length)
+ zeropad = precision - length;
+ if (width > 0) {
+ pad = width - length - zeropad;
+ if (pad < 0)
+ pad = 0;
+ }
+ count += length + pad + zeropad;
+ if (!left)
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ cp = buf;
+ if (zeropad > 0 && buf[0] == '0' &&
+ (buf[1] == 'x' || buf[1] == 'X')) {
+ if (size > 1) {
+ *str++ = *cp++;
+ size--;
+ }
+ if (size > 1) {
+ *str++ = *cp++;
+ size--;
+ }
+ while (zeropad > 0 && size > 1) {
+ *str++ = '0';
+ size--;
+ zeropad--;
+ }
+ }
+ while (*cp != '\0' && size > 1) {
+ *str++ = *cp++;
+ size--;
+ }
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ break;
+ case 'D': /*deprecated*/
+ INSIST("use %ld instead of %D" == NULL);
+ case 'O': /*deprecated*/
+ INSIST("use %lo instead of %O" == NULL);
+ case 'U': /*deprecated*/
+ INSIST("use %lu instead of %U" == NULL);
+
+ case 'L':
+#ifdef HAVE_LONG_DOUBLE
+ l = 1;
+#else
+ INSIST("long doubles are not supported" == NULL);
+#endif
+ /*FALLTHROUGH*/
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'g':
+ case 'G':
+ if (!dot)
+ precision = 6;
+ /*
+ * IEEE floating point.
+ * MIN 2.2250738585072014E-308
+ * MAX 1.7976931348623157E+308
+ * VAX floating point has a smaller range than IEEE.
+ *
+ * precisions > 324 don't make much sense.
+ * if we cap the precision at 512 we will not
+ * overflow buf.
+ */
+ if (precision > 512)
+ precision = 512;
+ sprintf(fmt, "%%%s%s.%lu%s%c", alt ? "#" : "",
+ plus ? "+" : space ? " " : "",
+ precision, l ? "L" : "", *format);
+ switch (*format) {
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'g':
+ case 'G':
+#ifdef HAVE_LONG_DOUBLE
+ if (l) {
+ ldbl = va_arg(ap, long double);
+ sprintf(buf, fmt, ldbl);
+ } else
+#endif
+ {
+ dbl = va_arg(ap, double);
+ sprintf(buf, fmt, dbl);
+ }
+ length = strlen(buf);
+ if (width > 0) {
+ pad = width - length;
+ if (pad < 0)
+ pad = 0;
+ }
+ count += length + pad;
+ if (!left)
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ cp = buf;
+ while (*cp != ' ' && size > 1) {
+ *str++ = *cp++;
+ size--;
+ }
+ while (pad > 0 && size > 1) {
+ *str++ = ' ';
+ size--;
+ pad--;
+ }
+ break;
+ default:
+ continue;
+ }
+ break;
+ default:
+ continue;
+ }
+ format++;
+ }
+ if (size > 0)
+ *str = '\0';
+ return (count);
+}
diff --git a/lib/isc/pthreads/condition.c b/lib/isc/pthreads/condition.c
new file mode 100644
index 0000000..50281a2
--- /dev/null
+++ b/lib/isc/pthreads/condition.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: condition.c,v 1.36 2007/06/19 23:47:18 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <errno.h>
+
+#include <isc/condition.h>
+#include <isc/msgs.h>
+#include <isc/strerror.h>
+#include <isc/string.h>
+#include <isc/time.h>
+#include <isc/util.h>
+
+isc_result_t
+isc_condition_waituntil(isc_condition_t *c, isc_mutex_t *m, isc_time_t *t) {
+ int presult;
+ isc_result_t result;
+ struct timespec ts;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(c != NULL && m != NULL && t != NULL);
+
+ /*
+ * POSIX defines a timespec's tv_sec as time_t.
+ */
+ result = isc_time_secondsastimet(t, &ts.tv_sec);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /*!
+ * POSIX defines a timespec's tv_nsec as long. isc_time_nanoseconds
+ * ensures its return value is < 1 billion, which will fit in a long.
+ */
+ ts.tv_nsec = (long)isc_time_nanoseconds(t);
+
+ do {
+#if ISC_MUTEX_PROFILE
+ presult = pthread_cond_timedwait(c, &m->mutex, &ts);
+#else
+ presult = pthread_cond_timedwait(c, m, &ts);
+#endif
+ if (presult == 0)
+ return (ISC_R_SUCCESS);
+ if (presult == ETIMEDOUT)
+ return (ISC_R_TIMEDOUT);
+ } while (presult == EINTR);
+
+ isc__strerror(presult, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "pthread_cond_timedwait() %s %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_RETURNED, "returned"),
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+}
diff --git a/lib/isc/pthreads/include/isc/condition.h b/lib/isc/pthreads/include/isc/condition.h
new file mode 100644
index 0000000..04a6118
--- /dev/null
+++ b/lib/isc/pthreads/include/isc/condition.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: condition.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_CONDITION_H
+#define ISC_CONDITION_H 1
+
+/*! \file */
+
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/result.h>
+#include <isc/types.h>
+
+typedef pthread_cond_t isc_condition_t;
+
+#define isc_condition_init(cp) \
+ ((pthread_cond_init((cp), NULL) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+
+#if ISC_MUTEX_PROFILE
+#define isc_condition_wait(cp, mp) \
+ ((pthread_cond_wait((cp), &((mp)->mutex)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#else
+#define isc_condition_wait(cp, mp) \
+ ((pthread_cond_wait((cp), (mp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#endif
+
+#define isc_condition_signal(cp) \
+ ((pthread_cond_signal((cp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+
+#define isc_condition_broadcast(cp) \
+ ((pthread_cond_broadcast((cp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+
+#define isc_condition_destroy(cp) \
+ ((pthread_cond_destroy((cp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_condition_waituntil(isc_condition_t *, isc_mutex_t *, isc_time_t *);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_CONDITION_H */
diff --git a/lib/isc/pthreads/include/isc/mutex.h b/lib/isc/pthreads/include/isc/mutex.h
new file mode 100644
index 0000000..dd7d326
--- /dev/null
+++ b/lib/isc/pthreads/include/isc/mutex.h
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mutex.h,v 1.30 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_MUTEX_H
+#define ISC_MUTEX_H 1
+
+/*! \file */
+
+#include <pthread.h>
+#include <stdio.h>
+
+#include <isc/lang.h>
+#include <isc/result.h> /* for ISC_R_ codes */
+
+ISC_LANG_BEGINDECLS
+
+/*!
+ * Supply mutex attributes that enable deadlock detection
+ * (helpful when debugging). This is system dependent and
+ * currently only supported on NetBSD.
+ */
+#if ISC_MUTEX_DEBUG && defined(__NetBSD__) && defined(PTHREAD_MUTEX_ERRORCHECK)
+extern pthread_mutexattr_t isc__mutex_attrs;
+#define ISC__MUTEX_ATTRS &isc__mutex_attrs
+#else
+#define ISC__MUTEX_ATTRS NULL
+#endif
+
+/* XXX We could do fancier error handling... */
+
+/*!
+ * Define ISC_MUTEX_PROFILE to turn on profiling of mutexes by line. When
+ * enabled, isc_mutex_stats() can be used to print a table showing the
+ * number of times each type of mutex was locked and the amount of time
+ * waiting to obtain the lock.
+ */
+#ifndef ISC_MUTEX_PROFILE
+#define ISC_MUTEX_PROFILE 0
+#endif
+
+#if ISC_MUTEX_PROFILE
+typedef struct isc_mutexstats isc_mutexstats_t;
+
+typedef struct {
+ pthread_mutex_t mutex; /*%< The actual mutex. */
+ isc_mutexstats_t * stats; /*%< Mutex statistics. */
+} isc_mutex_t;
+#else
+typedef pthread_mutex_t isc_mutex_t;
+#endif
+
+
+#if ISC_MUTEX_PROFILE
+#define isc_mutex_init(mp) \
+ isc_mutex_init_profile((mp), __FILE__, __LINE__)
+#else
+#if ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK)
+#define isc_mutex_init(mp) \
+ isc_mutex_init_errcheck((mp))
+#else
+#define isc_mutex_init(mp) \
+ isc__mutex_init((mp), __FILE__, __LINE__)
+isc_result_t isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line);
+#endif
+#endif
+
+#if ISC_MUTEX_PROFILE
+#define isc_mutex_lock(mp) \
+ isc_mutex_lock_profile((mp), __FILE__, __LINE__)
+#else
+#define isc_mutex_lock(mp) \
+ ((pthread_mutex_lock((mp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#endif
+
+#if ISC_MUTEX_PROFILE
+#define isc_mutex_unlock(mp) \
+ isc_mutex_unlock_profile((mp), __FILE__, __LINE__)
+#else
+#define isc_mutex_unlock(mp) \
+ ((pthread_mutex_unlock((mp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#endif
+
+#if ISC_MUTEX_PROFILE
+#define isc_mutex_trylock(mp) \
+ ((pthread_mutex_trylock((&(mp)->mutex)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_LOCKBUSY)
+#else
+#define isc_mutex_trylock(mp) \
+ ((pthread_mutex_trylock((mp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_LOCKBUSY)
+#endif
+
+#if ISC_MUTEX_PROFILE
+#define isc_mutex_destroy(mp) \
+ ((pthread_mutex_destroy((&(mp)->mutex)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#else
+#define isc_mutex_destroy(mp) \
+ ((pthread_mutex_destroy((mp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+#endif
+
+#if ISC_MUTEX_PROFILE
+#define isc_mutex_stats(fp) isc_mutex_statsprofile(fp);
+#else
+#define isc_mutex_stats(fp)
+#endif
+
+#if ISC_MUTEX_PROFILE
+
+isc_result_t
+isc_mutex_init_profile(isc_mutex_t *mp, const char * _file, int _line);
+isc_result_t
+isc_mutex_lock_profile(isc_mutex_t *mp, const char * _file, int _line);
+isc_result_t
+isc_mutex_unlock_profile(isc_mutex_t *mp, const char * _file, int _line);
+
+void
+isc_mutex_statsprofile(FILE *fp);
+
+isc_result_t
+isc_mutex_init_errcheck(isc_mutex_t *mp);
+
+#endif /* ISC_MUTEX_PROFILE */
+
+ISC_LANG_ENDDECLS
+#endif /* ISC_MUTEX_H */
diff --git a/lib/isc/pthreads/include/isc/once.h b/lib/isc/pthreads/include/isc/once.h
new file mode 100644
index 0000000..31d76fb
--- /dev/null
+++ b/lib/isc/pthreads/include/isc/once.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: once.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_ONCE_H
+#define ISC_ONCE_H 1
+
+/*! \file */
+
+#include <pthread.h>
+
+#include <isc/platform.h>
+#include <isc/result.h>
+
+typedef pthread_once_t isc_once_t;
+
+#ifdef ISC_PLATFORM_BRACEPTHREADONCEINIT
+/*!
+ * This accomodates systems that define PTHRAD_ONCE_INIT improperly.
+ */
+#define ISC_ONCE_INIT { PTHREAD_ONCE_INIT }
+#else
+/*!
+ * This is the usual case.
+ */
+#define ISC_ONCE_INIT PTHREAD_ONCE_INIT
+#endif
+
+/* XXX We could do fancier error handling... */
+
+#define isc_once_do(op, f) \
+ ((pthread_once((op), (f)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+
+#endif /* ISC_ONCE_H */
diff --git a/lib/isc/pthreads/include/isc/thread.h b/lib/isc/pthreads/include/isc/thread.h
new file mode 100644
index 0000000..7dcc952
--- /dev/null
+++ b/lib/isc/pthreads/include/isc/thread.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: thread.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
+
+#ifndef ISC_THREAD_H
+#define ISC_THREAD_H 1
+
+/*! \file */
+
+#include <pthread.h>
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+ISC_LANG_BEGINDECLS
+
+typedef pthread_t isc_thread_t;
+typedef void * isc_threadresult_t;
+typedef void * isc_threadarg_t;
+typedef isc_threadresult_t (*isc_threadfunc_t)(isc_threadarg_t);
+typedef pthread_key_t isc_thread_key_t;
+
+isc_result_t
+isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *);
+
+void
+isc_thread_setconcurrency(unsigned int level);
+
+/* XXX We could do fancier error handling... */
+
+#define isc_thread_join(t, rp) \
+ ((pthread_join((t), (rp)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+
+#define isc_thread_self \
+ (unsigned long)pthread_self
+
+#define isc_thread_key_create pthread_key_create
+#define isc_thread_key_getspecific pthread_getspecific
+#define isc_thread_key_setspecific pthread_setspecific
+#define isc_thread_key_delete pthread_key_delete
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_THREAD_H */
diff --git a/lib/isc/pthreads/mutex.c b/lib/isc/pthreads/mutex.c
new file mode 100644
index 0000000..62ad540
--- /dev/null
+++ b/lib/isc/pthreads/mutex.c
@@ -0,0 +1,284 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mutex.c,v 1.18 2011/01/04 23:47:14 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <errno.h>
+
+#include <isc/mutex.h>
+#include <isc/util.h>
+#include <isc/strerror.h>
+
+#if HAVE_PTHREADS < 5 /* HP-UX 10.20 has 4, needs this */
+# define pthread_mutex_init(m, a) \
+ pthread_mutex_init(m, (a) \
+ ? *(const pthread_mutexattr_t *)(a) \
+ : pthread_mutexattr_default)
+# define PTHREAD_MUTEX_RECURSIVE MUTEX_RECURSIVE_NP
+# define pthread_mutexattr_settype pthread_mutexattr_setkind_np
+#endif
+
+#if ISC_MUTEX_PROFILE
+
+/*@{*/
+/*% Operations on timevals; adapted from FreeBSD's sys/time.h */
+#define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
+#define timevaladd(vvp, uvp) \
+ do { \
+ (vvp)->tv_sec += (uvp)->tv_sec; \
+ (vvp)->tv_usec += (uvp)->tv_usec; \
+ if ((vvp)->tv_usec >= 1000000) { \
+ (vvp)->tv_sec++; \
+ (vvp)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+#define timevalsub(vvp, uvp) \
+ do { \
+ (vvp)->tv_sec -= (uvp)->tv_sec; \
+ (vvp)->tv_usec -= (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+
+/*@}*/
+
+#define ISC_MUTEX_MAX_LOCKERS 32
+
+typedef struct {
+ const char * file;
+ int line;
+ unsigned count;
+ struct timeval locked_total;
+ struct timeval wait_total;
+} isc_mutexlocker_t;
+
+struct isc_mutexstats {
+ const char * file; /*%< File mutex was created in. */
+ int line; /*%< Line mutex was created on. */
+ unsigned count;
+ struct timeval lock_t;
+ struct timeval locked_total;
+ struct timeval wait_total;
+ isc_mutexlocker_t * cur_locker;
+ isc_mutexlocker_t lockers[ISC_MUTEX_MAX_LOCKERS];
+};
+
+#ifndef ISC_MUTEX_PROFTABLESIZE
+#define ISC_MUTEX_PROFTABLESIZE (1024 * 1024)
+#endif
+static isc_mutexstats_t stats[ISC_MUTEX_PROFTABLESIZE];
+static int stats_next = 0;
+static isc_boolean_t stats_init = ISC_FALSE;
+static pthread_mutex_t statslock = PTHREAD_MUTEX_INITIALIZER;
+
+
+isc_result_t
+isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) {
+ int i, err;
+
+ err = pthread_mutex_init(&mp->mutex, NULL);
+ if (err == ENOMEM)
+ return (ISC_R_NOMEMORY);
+ if (err != 0)
+ return (ISC_R_UNEXPECTED);
+
+ RUNTIME_CHECK(pthread_mutex_lock(&statslock) == 0);
+
+ if (stats_init == ISC_FALSE)
+ stats_init = ISC_TRUE;
+
+ /*
+ * If all statistics entries have been used, give up and trigger an
+ * assertion failure. There would be no other way to deal with this
+ * because we'd like to keep record of all locks for the purpose of
+ * debugging and the number of necessary locks is unpredictable.
+ * If this failure is triggered while debugging, named should be
+ * rebuilt with an increased ISC_MUTEX_PROFTABLESIZE.
+ */
+ RUNTIME_CHECK(stats_next < ISC_MUTEX_PROFTABLESIZE);
+ mp->stats = &stats[stats_next++];
+
+ RUNTIME_CHECK(pthread_mutex_unlock(&statslock) == 0);
+
+ mp->stats->file = file;
+ mp->stats->line = line;
+ mp->stats->count = 0;
+ timevalclear(&mp->stats->locked_total);
+ timevalclear(&mp->stats->wait_total);
+ for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) {
+ mp->stats->lockers[i].file = NULL;
+ mp->stats->lockers[i].line = 0;
+ mp->stats->lockers[i].count = 0;
+ timevalclear(&mp->stats->lockers[i].locked_total);
+ timevalclear(&mp->stats->lockers[i].wait_total);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) {
+ struct timeval prelock_t;
+ struct timeval postlock_t;
+ isc_mutexlocker_t *locker = NULL;
+ int i;
+
+ gettimeofday(&prelock_t, NULL);
+
+ if (pthread_mutex_lock(&mp->mutex) != 0)
+ return (ISC_R_UNEXPECTED);
+
+ gettimeofday(&postlock_t, NULL);
+ mp->stats->lock_t = postlock_t;
+
+ timevalsub(&postlock_t, &prelock_t);
+
+ mp->stats->count++;
+ timevaladd(&mp->stats->wait_total, &postlock_t);
+
+ for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) {
+ if (mp->stats->lockers[i].file == NULL) {
+ locker = &mp->stats->lockers[i];
+ locker->file = file;
+ locker->line = line;
+ break;
+ } else if (mp->stats->lockers[i].file == file &&
+ mp->stats->lockers[i].line == line) {
+ locker = &mp->stats->lockers[i];
+ break;
+ }
+ }
+
+ if (locker != NULL) {
+ locker->count++;
+ timevaladd(&locker->wait_total, &postlock_t);
+ }
+
+ mp->stats->cur_locker = locker;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_mutex_unlock_profile(isc_mutex_t *mp, const char *file, int line) {
+ struct timeval unlock_t;
+
+ UNUSED(file);
+ UNUSED(line);
+
+ if (mp->stats->cur_locker != NULL) {
+ gettimeofday(&unlock_t, NULL);
+ timevalsub(&unlock_t, &mp->stats->lock_t);
+ timevaladd(&mp->stats->locked_total, &unlock_t);
+ timevaladd(&mp->stats->cur_locker->locked_total, &unlock_t);
+ mp->stats->cur_locker = NULL;
+ }
+
+ return ((pthread_mutex_unlock((&mp->mutex)) == 0) ? \
+ ISC_R_SUCCESS : ISC_R_UNEXPECTED);
+}
+
+
+void
+isc_mutex_statsprofile(FILE *fp) {
+ isc_mutexlocker_t *locker;
+ int i, j;
+
+ fprintf(fp, "Mutex stats (in us)\n");
+ for (i = 0; i < stats_next; i++) {
+ fprintf(fp, "%-12s %4d: %10u %lu.%06lu %lu.%06lu %5d\n",
+ stats[i].file, stats[i].line, stats[i].count,
+ stats[i].locked_total.tv_sec,
+ stats[i].locked_total.tv_usec,
+ stats[i].wait_total.tv_sec,
+ stats[i].wait_total.tv_usec,
+ i);
+ for (j = 0; j < ISC_MUTEX_MAX_LOCKERS; j++) {
+ locker = &stats[i].lockers[j];
+ if (locker->file == NULL)
+ continue;
+ fprintf(fp, " %-11s %4d: %10u %lu.%06lu %lu.%06lu %5d\n",
+ locker->file, locker->line, locker->count,
+ locker->locked_total.tv_sec,
+ locker->locked_total.tv_usec,
+ locker->wait_total.tv_sec,
+ locker->wait_total.tv_usec,
+ i);
+ }
+ }
+}
+
+#endif /* ISC_MUTEX_PROFILE */
+
+#if ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK)
+isc_result_t
+isc_mutex_init_errcheck(isc_mutex_t *mp)
+{
+ pthread_mutexattr_t attr;
+ int err;
+
+ if (pthread_mutexattr_init(&attr) != 0)
+ return (ISC_R_UNEXPECTED);
+
+ if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0) {
+ pthread_mutexattr_destroy(&attr);
+ return (ISC_R_UNEXPECTED);
+ }
+
+ err = pthread_mutex_init(mp, &attr) != 0)
+ pthread_mutexattr_destroy(&attr);
+ if (err == ENOMEM)
+ return (ISC_R_NOMEMORY);
+ return ((err == 0) ? ISC_R_SUCCESS : ISC_R_UNEXPECTED);
+}
+#endif
+
+#if ISC_MUTEX_DEBUG && defined(__NetBSD__) && defined(PTHREAD_MUTEX_ERRORCHECK)
+pthread_mutexattr_t isc__mutex_attrs = {
+ PTHREAD_MUTEX_ERRORCHECK, /* m_type */
+ 0 /* m_flags, which appears to be unused. */
+};
+#endif
+
+#if !(ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK)) && !ISC_MUTEX_PROFILE
+isc_result_t
+isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line) {
+ char strbuf[ISC_STRERRORSIZE];
+ isc_result_t result = ISC_R_SUCCESS;
+ int err;
+
+ err = pthread_mutex_init(mp, ISC__MUTEX_ATTRS);
+ if (err == ENOMEM)
+ return (ISC_R_NOMEMORY);
+ if (err != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(file, line, "isc_mutex_init() failed: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ }
+ return (result);
+}
+#endif
diff --git a/lib/isc/pthreads/thread.c b/lib/isc/pthreads/thread.c
new file mode 100644
index 0000000..4b5b491
--- /dev/null
+++ b/lib/isc/pthreads/thread.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: thread.c,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/thread.h>
+#include <isc/util.h>
+
+#ifndef THREAD_MINSTACKSIZE
+#define THREAD_MINSTACKSIZE (64U * 1024)
+#endif
+
+isc_result_t
+isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg,
+ isc_thread_t *thread)
+{
+ pthread_attr_t attr;
+ size_t stacksize;
+ int ret;
+
+ pthread_attr_init(&attr);
+
+#if defined(HAVE_PTHREAD_ATTR_GETSTACKSIZE) && \
+ defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+ ret = pthread_attr_getstacksize(&attr, &stacksize);
+ if (ret != 0)
+ return (ISC_R_UNEXPECTED);
+
+ if (stacksize < THREAD_MINSTACKSIZE) {
+ ret = pthread_attr_setstacksize(&attr, THREAD_MINSTACKSIZE);
+ if (ret != 0)
+ return (ISC_R_UNEXPECTED);
+ }
+#endif
+
+#if defined(PTHREAD_SCOPE_SYSTEM) && defined(NEED_PTHREAD_SCOPE_SYSTEM)
+ ret = pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+ if (ret != 0)
+ return (ISC_R_UNEXPECTED);
+#endif
+
+ ret = pthread_create(thread, &attr, func, arg);
+ if (ret != 0)
+ return (ISC_R_UNEXPECTED);
+
+ pthread_attr_destroy(&attr);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_thread_setconcurrency(unsigned int level) {
+#if defined(CALL_PTHREAD_SETCONCURRENCY)
+ (void)pthread_setconcurrency(level);
+#else
+ UNUSED(level);
+#endif
+}
diff --git a/lib/isc/quota.c b/lib/isc/quota.c
new file mode 100644
index 0000000..5e5c50c
--- /dev/null
+++ b/lib/isc/quota.c
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: quota.c,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h>
+
+#include <isc/quota.h>
+#include <isc/util.h>
+
+isc_result_t
+isc_quota_init(isc_quota_t *quota, int max) {
+ quota->max = max;
+ quota->used = 0;
+ quota->soft = 0;
+ return (isc_mutex_init(&quota->lock));
+}
+
+void
+isc_quota_destroy(isc_quota_t *quota) {
+ INSIST(quota->used == 0);
+ quota->max = 0;
+ quota->used = 0;
+ quota->soft = 0;
+ DESTROYLOCK(&quota->lock);
+}
+
+void
+isc_quota_soft(isc_quota_t *quota, int soft) {
+ LOCK(&quota->lock);
+ quota->soft = soft;
+ UNLOCK(&quota->lock);
+}
+
+void
+isc_quota_max(isc_quota_t *quota, int max) {
+ LOCK(&quota->lock);
+ quota->max = max;
+ UNLOCK(&quota->lock);
+}
+
+isc_result_t
+isc_quota_reserve(isc_quota_t *quota) {
+ isc_result_t result;
+ LOCK(&quota->lock);
+ if (quota->max == 0 || quota->used < quota->max) {
+ if (quota->soft == 0 || quota->used < quota->soft)
+ result = ISC_R_SUCCESS;
+ else
+ result = ISC_R_SOFTQUOTA;
+ quota->used++;
+ } else
+ result = ISC_R_QUOTA;
+ UNLOCK(&quota->lock);
+ return (result);
+}
+
+void
+isc_quota_release(isc_quota_t *quota) {
+ LOCK(&quota->lock);
+ INSIST(quota->used > 0);
+ quota->used--;
+ UNLOCK(&quota->lock);
+}
+
+isc_result_t
+isc_quota_attach(isc_quota_t *quota, isc_quota_t **p)
+{
+ isc_result_t result;
+ INSIST(p != NULL && *p == NULL);
+ result = isc_quota_reserve(quota);
+ if (result == ISC_R_SUCCESS || result == ISC_R_SOFTQUOTA)
+ *p = quota;
+ return (result);
+}
+
+void
+isc_quota_detach(isc_quota_t **p)
+{
+ INSIST(p != NULL && *p != NULL);
+ isc_quota_release(*p);
+ *p = NULL;
+}
diff --git a/lib/isc/radix.c b/lib/isc/radix.c
new file mode 100644
index 0000000..ac211ef
--- /dev/null
+++ b/lib/isc/radix.c
@@ -0,0 +1,706 @@
+/*
+ * Copyright (C) 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*
+ * This source was adapted from MRT's RCS Ids:
+ * Id: radix.c,v 1.10.2.1 1999/11/29 05:16:24 masaki Exp
+ * Id: prefix.c,v 1.37.2.9 2000/03/10 02:53:19 labovit Exp
+ */
+
+#include <config.h>
+
+#include <isc/mem.h>
+#include <isc/types.h>
+#include <isc/util.h>
+#include <isc/radix.h>
+
+static isc_result_t
+_new_prefix(isc_mem_t *mctx, isc_prefix_t **target, int family,
+ void *dest, int bitlen);
+
+static void
+_deref_prefix(isc_mem_t *mctx, isc_prefix_t *prefix);
+
+static isc_result_t
+_ref_prefix(isc_mem_t *mctx, isc_prefix_t **target, isc_prefix_t *prefix);
+
+static int
+_comp_with_mask(void *addr, void *dest, u_int mask);
+
+static void
+_clear_radix(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func);
+
+static isc_result_t
+_new_prefix(isc_mem_t *mctx, isc_prefix_t **target, int family, void *dest,
+ int bitlen)
+{
+ isc_prefix_t *prefix;
+
+ REQUIRE(target != NULL);
+
+ if (family != AF_INET6 && family != AF_INET && family != AF_UNSPEC)
+ return (ISC_R_NOTIMPLEMENTED);
+
+ prefix = isc_mem_get(mctx, sizeof(isc_prefix_t));
+ if (prefix == NULL)
+ return (ISC_R_NOMEMORY);
+
+ if (family == AF_INET6) {
+ prefix->bitlen = (bitlen >= 0) ? bitlen : 128;
+ memcpy(&prefix->add.sin6, dest, 16);
+ } else {
+ /* AF_UNSPEC is "any" or "none"--treat it as AF_INET */
+ prefix->bitlen = (bitlen >= 0) ? bitlen : 32;
+ memcpy(&prefix->add.sin, dest, 4);
+ }
+
+ prefix->family = family;
+
+ isc_refcount_init(&prefix->refcount, 1);
+
+ *target = prefix;
+ return (ISC_R_SUCCESS);
+}
+
+static void
+_deref_prefix(isc_mem_t *mctx, isc_prefix_t *prefix) {
+ int refs;
+
+ if (prefix == NULL)
+ return;
+
+ isc_refcount_decrement(&prefix->refcount, &refs);
+
+ if (refs <= 0) {
+ isc_refcount_destroy(&prefix->refcount);
+ isc_mem_put(mctx, prefix, sizeof(isc_prefix_t));
+ }
+}
+
+static isc_result_t
+_ref_prefix(isc_mem_t *mctx, isc_prefix_t **target, isc_prefix_t *prefix) {
+ INSIST(prefix != NULL);
+ INSIST((prefix->family == AF_INET && prefix->bitlen <= 32) ||
+ (prefix->family == AF_INET6 && prefix->bitlen <= 128) ||
+ (prefix->family == AF_UNSPEC && prefix->bitlen == 0));
+ REQUIRE(target != NULL && *target == NULL);
+
+ /*
+ * If this prefix is a static allocation, copy it into new memory.
+ * (Note, the refcount still has to be destroyed by the calling
+ * routine.)
+ */
+ if (isc_refcount_current(&prefix->refcount) == 0) {
+ isc_result_t ret;
+ ret = _new_prefix(mctx, target, prefix->family,
+ &prefix->add, prefix->bitlen);
+ return ret;
+ }
+
+ isc_refcount_increment(&prefix->refcount, NULL);
+
+ *target = prefix;
+ return (ISC_R_SUCCESS);
+}
+
+static int
+_comp_with_mask(void *addr, void *dest, u_int mask) {
+
+ /* Mask length of zero matches everything */
+ if (mask == 0)
+ return (1);
+
+ if (memcmp(addr, dest, mask / 8) == 0) {
+ int n = mask / 8;
+ int m = ((~0) << (8 - (mask % 8)));
+
+ if ((mask % 8) == 0 ||
+ (((u_char *)addr)[n] & m) == (((u_char *)dest)[n] & m))
+ return (1);
+ }
+ return (0);
+}
+
+isc_result_t
+isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits) {
+ isc_radix_tree_t *radix;
+
+ REQUIRE(target != NULL && *target == NULL);
+
+ radix = isc_mem_get(mctx, sizeof(isc_radix_tree_t));
+ if (radix == NULL)
+ return (ISC_R_NOMEMORY);
+
+ radix->mctx = mctx;
+ radix->maxbits = maxbits;
+ radix->head = NULL;
+ radix->num_active_node = 0;
+ radix->num_added_node = 0;
+ RUNTIME_CHECK(maxbits <= RADIX_MAXBITS); /* XXX */
+ radix->magic = RADIX_TREE_MAGIC;
+ *target = radix;
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * if func is supplied, it will be called as func(node->data)
+ * before deleting the node
+ */
+
+static void
+_clear_radix(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func) {
+
+ REQUIRE(radix != NULL);
+
+ if (radix->head != NULL) {
+
+ isc_radix_node_t *Xstack[RADIX_MAXBITS+1];
+ isc_radix_node_t **Xsp = Xstack;
+ isc_radix_node_t *Xrn = radix->head;
+
+ while (Xrn != NULL) {
+ isc_radix_node_t *l = Xrn->l;
+ isc_radix_node_t *r = Xrn->r;
+
+ if (Xrn->prefix != NULL) {
+ _deref_prefix(radix->mctx, Xrn->prefix);
+ if (func != NULL && (Xrn->data[0] != NULL ||
+ Xrn->data[1] != NULL))
+ func(Xrn->data);
+ } else {
+ INSIST(Xrn->data[0] == NULL &&
+ Xrn->data[1] == NULL);
+ }
+
+ isc_mem_put(radix->mctx, Xrn, sizeof(*Xrn));
+ radix->num_active_node--;
+
+ if (l != NULL) {
+ if (r != NULL) {
+ *Xsp++ = r;
+ }
+ Xrn = l;
+ } else if (r != NULL) {
+ Xrn = r;
+ } else if (Xsp != Xstack) {
+ Xrn = *(--Xsp);
+ } else {
+ Xrn = NULL;
+ }
+ }
+ }
+ RUNTIME_CHECK(radix->num_active_node == 0);
+}
+
+
+void
+isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func)
+{
+ REQUIRE(radix != NULL);
+ _clear_radix(radix, func);
+ isc_mem_put(radix->mctx, radix, sizeof(*radix));
+}
+
+
+/*
+ * func will be called as func(node->prefix, node->data)
+ */
+void
+isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func)
+{
+ isc_radix_node_t *node;
+
+ REQUIRE(func != NULL);
+
+ RADIX_WALK(radix->head, node) {
+ func(node->prefix, node->data);
+ } RADIX_WALK_END;
+}
+
+
+isc_result_t
+isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target,
+ isc_prefix_t *prefix)
+{
+ isc_radix_node_t *node;
+ isc_radix_node_t *stack[RADIX_MAXBITS + 1];
+ u_char *addr;
+ isc_uint32_t bitlen;
+ int tfamily = -1;
+ int cnt = 0;
+
+ REQUIRE(radix != NULL);
+ REQUIRE(prefix != NULL);
+ REQUIRE(target != NULL && *target == NULL);
+ RUNTIME_CHECK(prefix->bitlen <= radix->maxbits);
+
+ *target = NULL;
+
+ if (radix->head == NULL) {
+ return (ISC_R_NOTFOUND);
+ }
+
+ node = radix->head;
+ addr = isc_prefix_touchar(prefix);
+ bitlen = prefix->bitlen;
+
+ while (node->bit < bitlen) {
+ if (node->prefix)
+ stack[cnt++] = node;
+
+ if (BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07)))
+ node = node->r;
+ else
+ node = node->l;
+
+ if (node == NULL)
+ break;
+ }
+
+ if (node && node->prefix)
+ stack[cnt++] = node;
+
+ while (cnt-- > 0) {
+ node = stack[cnt];
+
+ if (_comp_with_mask(isc_prefix_tochar(node->prefix),
+ isc_prefix_tochar(prefix),
+ node->prefix->bitlen)) {
+ if (node->node_num[ISC_IS6(prefix->family)] != -1 &&
+ ((*target == NULL) ||
+ (*target)->node_num[ISC_IS6(tfamily)] >
+ node->node_num[ISC_IS6(prefix->family)])) {
+ *target = node;
+ tfamily = prefix->family;
+ }
+ }
+ }
+
+ if (*target == NULL) {
+ return (ISC_R_NOTFOUND);
+ } else {
+ return (ISC_R_SUCCESS);
+ }
+}
+
+isc_result_t
+isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target,
+ isc_radix_node_t *source, isc_prefix_t *prefix)
+{
+ isc_radix_node_t *node, *new_node, *parent, *glue = NULL;
+ u_char *addr, *test_addr;
+ isc_uint32_t bitlen, fam, check_bit, differ_bit;
+ isc_uint32_t i, j, r;
+ isc_result_t result;
+
+ REQUIRE(radix != NULL);
+ REQUIRE(target != NULL && *target == NULL);
+ REQUIRE(prefix != NULL || (source != NULL && source->prefix != NULL));
+ RUNTIME_CHECK(prefix == NULL || prefix->bitlen <= radix->maxbits);
+
+ if (prefix == NULL)
+ prefix = source->prefix;
+
+ INSIST(prefix != NULL);
+
+ bitlen = prefix->bitlen;
+ fam = prefix->family;
+
+ if (radix->head == NULL) {
+ node = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t));
+ if (node == NULL)
+ return (ISC_R_NOMEMORY);
+ node->bit = bitlen;
+ node->node_num[0] = node->node_num[1] = -1;
+ node->prefix = NULL;
+ result = _ref_prefix(radix->mctx, &node->prefix, prefix);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_put(radix->mctx, node,
+ sizeof(isc_radix_node_t));
+ return (result);
+ }
+ node->parent = NULL;
+ node->l = node->r = NULL;
+ if (source != NULL) {
+ /*
+ * If source is non-NULL, then we're merging in a
+ * node from an existing radix tree. To keep
+ * the node_num values consistent, the calling
+ * function will add the total number of nodes
+ * added to num_added_node at the end of
+ * the merge operation--we don't do it here.
+ */
+ if (source->node_num[0] != -1)
+ node->node_num[0] = radix->num_added_node +
+ source->node_num[0];
+ if (source->node_num[1] != -1)
+ node->node_num[1] = radix->num_added_node +
+ source->node_num[1];
+ node->data[0] = source->data[0];
+ node->data[1] = source->data[1];
+ } else {
+ if (fam == AF_UNSPEC) {
+ /* "any" or "none" */
+ node->node_num[0] = node->node_num[1] =
+ ++radix->num_added_node;
+ } else {
+ node->node_num[ISC_IS6(fam)] =
+ ++radix->num_added_node;
+ }
+ node->data[0] = NULL;
+ node->data[1] = NULL;
+ }
+ radix->head = node;
+ radix->num_active_node++;
+ *target = node;
+ return (ISC_R_SUCCESS);
+ }
+
+ addr = isc_prefix_touchar(prefix);
+ node = radix->head;
+
+ while (node->bit < bitlen || node->prefix == NULL) {
+ if (node->bit < radix->maxbits &&
+ BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07)))
+ {
+ if (node->r == NULL)
+ break;
+ node = node->r;
+ } else {
+ if (node->l == NULL)
+ break;
+ node = node->l;
+ }
+
+ INSIST(node != NULL);
+ }
+
+ INSIST(node->prefix != NULL);
+
+ test_addr = isc_prefix_touchar(node->prefix);
+ /* Find the first bit different. */
+ check_bit = (node->bit < bitlen) ? node->bit : bitlen;
+ differ_bit = 0;
+ for (i = 0; i*8 < check_bit; i++) {
+ if ((r = (addr[i] ^ test_addr[i])) == 0) {
+ differ_bit = (i + 1) * 8;
+ continue;
+ }
+ /* I know the better way, but for now. */
+ for (j = 0; j < 8; j++) {
+ if (BIT_TEST (r, (0x80 >> j)))
+ break;
+ }
+ /* Must be found. */
+ INSIST(j < 8);
+ differ_bit = i * 8 + j;
+ break;
+ }
+
+ if (differ_bit > check_bit)
+ differ_bit = check_bit;
+
+ parent = node->parent;
+ while (parent != NULL && parent->bit >= differ_bit) {
+ node = parent;
+ parent = node->parent;
+ }
+
+ if (differ_bit == bitlen && node->bit == bitlen) {
+ if (node->prefix != NULL) {
+ /* Set node_num only if it hasn't been set before */
+ if (source != NULL) {
+ /* Merging node */
+ if (node->node_num[0] == -1 &&
+ source->node_num[0] != -1) {
+ node->node_num[0] =
+ radix->num_added_node +
+ source->node_num[0];
+ node->data[0] = source->data[0];
+ }
+ if (node->node_num[1] == -1 &&
+ source->node_num[0] != -1) {
+ node->node_num[1] =
+ radix->num_added_node +
+ source->node_num[1];
+ node->data[1] = source->data[1];
+ }
+ } else {
+ if (fam == AF_UNSPEC) {
+ /* "any" or "none" */
+ int next = radix->num_added_node + 1;
+ if (node->node_num[0] == -1) {
+ node->node_num[0] = next;
+ radix->num_added_node = next;
+ }
+ if (node->node_num[1] == -1) {
+ node->node_num[1] = next;
+ radix->num_added_node = next;
+ }
+ } else {
+ if (node->node_num[ISC_IS6(fam)] == -1)
+ node->node_num[ISC_IS6(fam)]
+ = ++radix->num_added_node;
+ }
+ }
+ *target = node;
+ return (ISC_R_SUCCESS);
+ } else {
+ result =
+ _ref_prefix(radix->mctx, &node->prefix, prefix);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ }
+ INSIST(node->data[0] == NULL && node->node_num[0] == -1 &&
+ node->data[1] == NULL && node->node_num[1] == -1);
+ if (source != NULL) {
+ /* Merging node */
+ if (source->node_num[0] != -1) {
+ node->node_num[0] = radix->num_added_node +
+ source->node_num[0];
+ node->data[0] = source->data[0];
+ }
+ if (source->node_num[1] != -1) {
+ node->node_num[1] = radix->num_added_node +
+ source->node_num[1];
+ node->data[1] = source->data[1];
+ }
+ } else {
+ if (fam == AF_UNSPEC) {
+ /* "any" or "none" */
+ node->node_num[0] = node->node_num[1] =
+ ++radix->num_added_node;
+ } else {
+ node->node_num[ISC_IS6(fam)] =
+ ++radix->num_added_node;
+ }
+ }
+ *target = node;
+ return (ISC_R_SUCCESS);
+ }
+
+ new_node = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t));
+ if (new_node == NULL)
+ return (ISC_R_NOMEMORY);
+ if (node->bit != differ_bit && bitlen != differ_bit) {
+ glue = isc_mem_get(radix->mctx, sizeof(isc_radix_node_t));
+ if (glue == NULL) {
+ isc_mem_put(radix->mctx, new_node,
+ sizeof(isc_radix_node_t));
+ return (ISC_R_NOMEMORY);
+ }
+ }
+ new_node->bit = bitlen;
+ new_node->prefix = NULL;
+ result = _ref_prefix(radix->mctx, &new_node->prefix, prefix);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_put(radix->mctx, new_node, sizeof(isc_radix_node_t));
+ if (glue != NULL)
+ isc_mem_put(radix->mctx, glue,
+ sizeof(isc_radix_node_t));
+ return (result);
+ }
+ new_node->parent = NULL;
+ new_node->l = new_node->r = NULL;
+ new_node->node_num[0] = new_node->node_num[1] = -1;
+ radix->num_active_node++;
+
+ if (source != NULL) {
+ /* Merging node */
+ if (source->node_num[0] != -1)
+ new_node->node_num[0] = radix->num_added_node +
+ source->node_num[0];
+ if (source->node_num[1] != -1)
+ new_node->node_num[1] = radix->num_added_node +
+ source->node_num[1];
+ new_node->data[0] = source->data[0];
+ new_node->data[1] = source->data[1];
+ } else {
+ if (fam == AF_UNSPEC) {
+ /* "any" or "none" */
+ new_node->node_num[0] = new_node->node_num[1] =
+ ++radix->num_added_node;
+ } else {
+ new_node->node_num[ISC_IS6(fam)] =
+ ++radix->num_added_node;
+ }
+ new_node->data[0] = NULL;
+ new_node->data[1] = NULL;
+ }
+
+ if (node->bit == differ_bit) {
+ INSIST(glue == NULL);
+ new_node->parent = node;
+ if (node->bit < radix->maxbits &&
+ BIT_TEST(addr[node->bit >> 3], 0x80 >> (node->bit & 0x07)))
+ {
+ INSIST(node->r == NULL);
+ node->r = new_node;
+ } else {
+ INSIST(node->l == NULL);
+ node->l = new_node;
+ }
+ *target = new_node;
+ return (ISC_R_SUCCESS);
+ }
+
+ if (bitlen == differ_bit) {
+ INSIST(glue == NULL);
+ if (bitlen < radix->maxbits &&
+ BIT_TEST(test_addr[bitlen >> 3], 0x80 >> (bitlen & 0x07))) {
+ new_node->r = node;
+ } else {
+ new_node->l = node;
+ }
+ new_node->parent = node->parent;
+ if (node->parent == NULL) {
+ INSIST(radix->head == node);
+ radix->head = new_node;
+ } else if (node->parent->r == node) {
+ node->parent->r = new_node;
+ } else {
+ node->parent->l = new_node;
+ }
+ node->parent = new_node;
+ } else {
+ INSIST(glue != NULL);
+ glue->bit = differ_bit;
+ glue->prefix = NULL;
+ glue->parent = node->parent;
+ glue->data[0] = glue->data[1] = NULL;
+ glue->node_num[0] = glue->node_num[1] = -1;
+ radix->num_active_node++;
+ if (differ_bit < radix->maxbits &&
+ BIT_TEST(addr[differ_bit>>3], 0x80 >> (differ_bit & 07))) {
+ glue->r = new_node;
+ glue->l = node;
+ } else {
+ glue->r = node;
+ glue->l = new_node;
+ }
+ new_node->parent = glue;
+
+ if (node->parent == NULL) {
+ INSIST(radix->head == node);
+ radix->head = glue;
+ } else if (node->parent->r == node) {
+ node->parent->r = glue;
+ } else {
+ node->parent->l = glue;
+ }
+ node->parent = glue;
+ }
+
+ *target = new_node;
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node) {
+ isc_radix_node_t *parent, *child;
+
+ REQUIRE(radix != NULL);
+ REQUIRE(node != NULL);
+
+ if (node->r && node->l) {
+ /*
+ * This might be a placeholder node -- have to check and
+ * make sure there is a prefix associated with it!
+ */
+ if (node->prefix != NULL)
+ _deref_prefix(radix->mctx, node->prefix);
+
+ node->prefix = NULL;
+ node->data[0] = node->data[1] = NULL;
+ return;
+ }
+
+ if (node->r == NULL && node->l == NULL) {
+ parent = node->parent;
+ _deref_prefix(radix->mctx, node->prefix);
+ isc_mem_put(radix->mctx, node, sizeof(*node));
+ radix->num_active_node--;
+
+ if (parent == NULL) {
+ INSIST(radix->head == node);
+ radix->head = NULL;
+ return;
+ }
+
+ if (parent->r == node) {
+ parent->r = NULL;
+ child = parent->l;
+ } else {
+ INSIST(parent->l == node);
+ parent->l = NULL;
+ child = parent->r;
+ }
+
+ if (parent->prefix)
+ return;
+
+ /* We need to remove parent too. */
+
+ if (parent->parent == NULL) {
+ INSIST(radix->head == parent);
+ radix->head = child;
+ } else if (parent->parent->r == parent) {
+ parent->parent->r = child;
+ } else {
+ INSIST(parent->parent->l == parent);
+ parent->parent->l = child;
+ }
+ child->parent = parent->parent;
+ isc_mem_put(radix->mctx, parent, sizeof(*parent));
+ radix->num_active_node--;
+ return;
+ }
+
+ if (node->r) {
+ child = node->r;
+ } else {
+ INSIST(node->l != NULL);
+ child = node->l;
+ }
+ parent = node->parent;
+ child->parent = parent;
+
+ _deref_prefix(radix->mctx, node->prefix);
+ isc_mem_put(radix->mctx, node, sizeof(*node));
+ radix->num_active_node--;
+
+ if (parent == NULL) {
+ INSIST(radix->head == node);
+ radix->head = child;
+ return;
+ }
+
+ if (parent->r == node) {
+ parent->r = child;
+ } else {
+ INSIST(parent->l == node);
+ parent->l = child;
+ }
+}
+
+/*
+Local Variables:
+c-basic-offset: 4
+indent-tabs-mode: t
+End:
+*/
diff --git a/lib/isc/random.c b/lib/isc/random.c
new file mode 100644
index 0000000..8b73ed5
--- /dev/null
+++ b/lib/isc/random.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: random.c,v 1.28 2009/07/16 05:52:46 marka Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <time.h> /* Required for time(). */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/random.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+static isc_once_t once = ISC_ONCE_INIT;
+
+static void
+initialize_rand(void)
+{
+#ifndef HAVE_ARC4RANDOM
+ unsigned int pid = getpid();
+
+ /*
+ * The low bits of pid generally change faster.
+ * Xor them with the high bits of time which change slowly.
+ */
+ pid = ((pid << 16) & 0xffff0000) | ((pid >> 16) & 0xffff);
+
+ srand(time(NULL) ^ pid);
+#endif
+}
+
+static void
+initialize(void)
+{
+ RUNTIME_CHECK(isc_once_do(&once, initialize_rand) == ISC_R_SUCCESS);
+}
+
+void
+isc_random_seed(isc_uint32_t seed)
+{
+ initialize();
+
+#ifndef HAVE_ARC4RANDOM
+ srand(seed);
+#else
+ arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t));
+#endif
+}
+
+void
+isc_random_get(isc_uint32_t *val)
+{
+ REQUIRE(val != NULL);
+
+ initialize();
+
+#ifndef HAVE_ARC4RANDOM
+ /*
+ * rand()'s lower bits are not random.
+ * rand()'s upper bit is zero.
+ */
+#if RAND_MAX >= 0xfffff
+ /* We have at least 20 bits. Use lower 16 excluding lower most 4 */
+ *val = ((rand() >> 4) & 0xffff) | ((rand() << 12) & 0xffff0000);
+#elif RAND_MAX >= 0x7fff
+ /* We have at least 15 bits. Use lower 10/11 excluding lower most 4 */
+ *val = ((rand() >> 4) & 0x000007ff) | ((rand() << 7) & 0x003ff800) |
+ ((rand() << 18) & 0xffc00000);
+#else
+#error RAND_MAX is too small
+#endif
+#else
+ *val = arc4random();
+#endif
+}
+
+isc_uint32_t
+isc_random_jitter(isc_uint32_t max, isc_uint32_t jitter) {
+ isc_uint32_t rnd;
+
+ REQUIRE(jitter < max || (jitter == 0 && max == 0));
+
+ if (jitter == 0)
+ return (max);
+
+ isc_random_get(&rnd);
+ return (max - rnd % jitter);
+}
diff --git a/lib/isc/ratelimiter.c b/lib/isc/ratelimiter.c
new file mode 100644
index 0000000..07bcc7c
--- /dev/null
+++ b/lib/isc/ratelimiter.c
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ratelimiter.c,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/mem.h>
+#include <isc/ratelimiter.h>
+#include <isc/task.h>
+#include <isc/time.h>
+#include <isc/timer.h>
+#include <isc/util.h>
+
+typedef enum {
+ isc_ratelimiter_stalled = 0,
+ isc_ratelimiter_ratelimited = 1,
+ isc_ratelimiter_idle = 2,
+ isc_ratelimiter_shuttingdown = 3
+} isc_ratelimiter_state_t;
+
+struct isc_ratelimiter {
+ isc_mem_t * mctx;
+ isc_mutex_t lock;
+ int refs;
+ isc_task_t * task;
+ isc_timer_t * timer;
+ isc_interval_t interval;
+ isc_uint32_t pertic;
+ isc_ratelimiter_state_t state;
+ isc_event_t shutdownevent;
+ ISC_LIST(isc_event_t) pending;
+};
+
+#define ISC_RATELIMITEREVENT_SHUTDOWN (ISC_EVENTCLASS_RATELIMITER + 1)
+
+static void
+ratelimiter_tick(isc_task_t *task, isc_event_t *event);
+
+static void
+ratelimiter_shutdowncomplete(isc_task_t *task, isc_event_t *event);
+
+isc_result_t
+isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr,
+ isc_task_t *task, isc_ratelimiter_t **ratelimiterp)
+{
+ isc_result_t result;
+ isc_ratelimiter_t *rl;
+ INSIST(ratelimiterp != NULL && *ratelimiterp == NULL);
+
+ rl = isc_mem_get(mctx, sizeof(*rl));
+ if (rl == NULL)
+ return ISC_R_NOMEMORY;
+ rl->mctx = mctx;
+ rl->refs = 1;
+ rl->task = task;
+ isc_interval_set(&rl->interval, 0, 0);
+ rl->timer = NULL;
+ rl->pertic = 1;
+ rl->state = isc_ratelimiter_idle;
+ ISC_LIST_INIT(rl->pending);
+
+ result = isc_mutex_init(&rl->lock);
+ if (result != ISC_R_SUCCESS)
+ goto free_mem;
+ result = isc_timer_create(timermgr, isc_timertype_inactive,
+ NULL, NULL, rl->task, ratelimiter_tick,
+ rl, &rl->timer);
+ if (result != ISC_R_SUCCESS)
+ goto free_mutex;
+
+ /*
+ * Increment the reference count to indicate that we may
+ * (soon) have events outstanding.
+ */
+ rl->refs++;
+
+ ISC_EVENT_INIT(&rl->shutdownevent,
+ sizeof(isc_event_t),
+ 0, NULL, ISC_RATELIMITEREVENT_SHUTDOWN,
+ ratelimiter_shutdowncomplete, rl, rl, NULL, NULL);
+
+ *ratelimiterp = rl;
+ return (ISC_R_SUCCESS);
+
+free_mutex:
+ DESTROYLOCK(&rl->lock);
+free_mem:
+ isc_mem_put(mctx, rl, sizeof(*rl));
+ return (result);
+}
+
+isc_result_t
+isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval) {
+ isc_result_t result = ISC_R_SUCCESS;
+ LOCK(&rl->lock);
+ rl->interval = *interval;
+ /*
+ * If the timer is currently running, change its rate.
+ */
+ if (rl->state == isc_ratelimiter_ratelimited) {
+ result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL,
+ &rl->interval, ISC_FALSE);
+ }
+ UNLOCK(&rl->lock);
+ return (result);
+}
+
+void
+isc_ratelimiter_setpertic(isc_ratelimiter_t *rl, isc_uint32_t pertic) {
+ if (pertic == 0)
+ pertic = 1;
+ rl->pertic = pertic;
+}
+
+isc_result_t
+isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task,
+ isc_event_t **eventp)
+{
+ isc_result_t result = ISC_R_SUCCESS;
+ isc_event_t *ev;
+
+ REQUIRE(eventp != NULL && *eventp != NULL);
+ REQUIRE(task != NULL);
+ ev = *eventp;
+ REQUIRE(ev->ev_sender == NULL);
+
+ LOCK(&rl->lock);
+ if (rl->state == isc_ratelimiter_ratelimited ||
+ rl->state == isc_ratelimiter_stalled) {
+ isc_event_t *ev = *eventp;
+ ev->ev_sender = task;
+ ISC_LIST_APPEND(rl->pending, ev, ev_link);
+ *eventp = NULL;
+ } else if (rl->state == isc_ratelimiter_idle) {
+ result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL,
+ &rl->interval, ISC_FALSE);
+ if (result == ISC_R_SUCCESS) {
+ ev->ev_sender = task;
+ rl->state = isc_ratelimiter_ratelimited;
+ }
+ } else {
+ INSIST(rl->state == isc_ratelimiter_shuttingdown);
+ result = ISC_R_SHUTTINGDOWN;
+ }
+ UNLOCK(&rl->lock);
+ if (*eventp != NULL && result == ISC_R_SUCCESS)
+ isc_task_send(task, eventp);
+ return (result);
+}
+
+static void
+ratelimiter_tick(isc_task_t *task, isc_event_t *event) {
+ isc_result_t result = ISC_R_SUCCESS;
+ isc_ratelimiter_t *rl = (isc_ratelimiter_t *)event->ev_arg;
+ isc_event_t *p;
+ isc_uint32_t pertic;
+
+ UNUSED(task);
+
+ isc_event_free(&event);
+
+ pertic = rl->pertic;
+ while (pertic != 0) {
+ pertic--;
+ LOCK(&rl->lock);
+ p = ISC_LIST_HEAD(rl->pending);
+ if (p != NULL) {
+ /*
+ * There is work to do. Let's do it after unlocking.
+ */
+ ISC_LIST_UNLINK(rl->pending, p, ev_link);
+ } else {
+ /*
+ * No work left to do. Stop the timer so that we don't
+ * waste resources by having it fire periodically.
+ */
+ result = isc_timer_reset(rl->timer,
+ isc_timertype_inactive,
+ NULL, NULL, ISC_FALSE);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ rl->state = isc_ratelimiter_idle;
+ pertic = 0; /* Force the loop to exit. */
+ }
+ UNLOCK(&rl->lock);
+ if (p != NULL) {
+ isc_task_t *evtask = p->ev_sender;
+ isc_task_send(evtask, &p);
+ }
+ INSIST(p == NULL);
+ }
+}
+
+void
+isc_ratelimiter_shutdown(isc_ratelimiter_t *rl) {
+ isc_event_t *ev;
+ isc_task_t *task;
+ LOCK(&rl->lock);
+ rl->state = isc_ratelimiter_shuttingdown;
+ (void)isc_timer_reset(rl->timer, isc_timertype_inactive,
+ NULL, NULL, ISC_FALSE);
+ while ((ev = ISC_LIST_HEAD(rl->pending)) != NULL) {
+ ISC_LIST_UNLINK(rl->pending, ev, ev_link);
+ ev->ev_attributes |= ISC_EVENTATTR_CANCELED;
+ task = ev->ev_sender;
+ isc_task_send(task, &ev);
+ }
+ isc_timer_detach(&rl->timer);
+ /*
+ * Send an event to our task. The delivery of this event
+ * indicates that no more timer events will be delivered.
+ */
+ ev = &rl->shutdownevent;
+ isc_task_send(rl->task, &ev);
+
+ UNLOCK(&rl->lock);
+}
+
+static void
+ratelimiter_shutdowncomplete(isc_task_t *task, isc_event_t *event) {
+ isc_ratelimiter_t *rl = (isc_ratelimiter_t *)event->ev_arg;
+
+ UNUSED(task);
+
+ isc_ratelimiter_detach(&rl);
+}
+
+static void
+ratelimiter_free(isc_ratelimiter_t *rl) {
+ DESTROYLOCK(&rl->lock);
+ isc_mem_put(rl->mctx, rl, sizeof(*rl));
+}
+
+void
+isc_ratelimiter_attach(isc_ratelimiter_t *source, isc_ratelimiter_t **target) {
+ REQUIRE(source != NULL);
+ REQUIRE(target != NULL && *target == NULL);
+
+ LOCK(&source->lock);
+ REQUIRE(source->refs > 0);
+ source->refs++;
+ INSIST(source->refs > 0);
+ UNLOCK(&source->lock);
+ *target = source;
+}
+
+void
+isc_ratelimiter_detach(isc_ratelimiter_t **rlp) {
+ isc_ratelimiter_t *rl = *rlp;
+ isc_boolean_t free_now = ISC_FALSE;
+
+ LOCK(&rl->lock);
+ REQUIRE(rl->refs > 0);
+ rl->refs--;
+ if (rl->refs == 0)
+ free_now = ISC_TRUE;
+ UNLOCK(&rl->lock);
+
+ if (free_now)
+ ratelimiter_free(rl);
+
+ *rlp = NULL;
+}
+
+isc_result_t
+isc_ratelimiter_stall(isc_ratelimiter_t *rl) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ LOCK(&rl->lock);
+ switch (rl->state) {
+ case isc_ratelimiter_shuttingdown:
+ result = ISC_R_SHUTTINGDOWN;
+ break;
+ case isc_ratelimiter_ratelimited:
+ result = isc_timer_reset(rl->timer, isc_timertype_inactive,
+ NULL, NULL, ISC_FALSE);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ case isc_ratelimiter_idle:
+ case isc_ratelimiter_stalled:
+ rl->state = isc_ratelimiter_stalled;
+ break;
+ }
+ UNLOCK(&rl->lock);
+ return (result);
+}
+
+isc_result_t
+isc_ratelimiter_release(isc_ratelimiter_t *rl) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ LOCK(&rl->lock);
+ switch (rl->state) {
+ case isc_ratelimiter_shuttingdown:
+ result = ISC_R_SHUTTINGDOWN;
+ break;
+ case isc_ratelimiter_stalled:
+ if (!ISC_LIST_EMPTY(rl->pending)) {
+ result = isc_timer_reset(rl->timer,
+ isc_timertype_ticker, NULL,
+ &rl->interval, ISC_FALSE);
+ if (result == ISC_R_SUCCESS)
+ rl->state = isc_ratelimiter_ratelimited;
+ } else
+ rl->state = isc_ratelimiter_idle;
+ break;
+ case isc_ratelimiter_ratelimited:
+ case isc_ratelimiter_idle:
+ break;
+ }
+ UNLOCK(&rl->lock);
+ return (result);
+}
diff --git a/lib/isc/refcount.c b/lib/isc/refcount.c
new file mode 100644
index 0000000..36dfff2
--- /dev/null
+++ b/lib/isc/refcount.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: refcount.c,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
+
+#include <config.h>
+
+#include <stddef.h>
+
+#include <isc/mutex.h>
+#include <isc/refcount.h>
+#include <isc/result.h>
+
+isc_result_t
+isc_refcount_init(isc_refcount_t *ref, unsigned int n) {
+ REQUIRE(ref != NULL);
+
+ ref->refs = n;
+#if defined(ISC_PLATFORM_USETHREADS) && !defined(ISC_PLATFORM_HAVEXADD)
+ return (isc_mutex_init(&ref->lock));
+#else
+ return (ISC_R_SUCCESS);
+#endif
+}
diff --git a/lib/isc/region.c b/lib/isc/region.c
new file mode 100644
index 0000000..cf64979
--- /dev/null
+++ b/lib/isc/region.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: region.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/region.h>
+#include <isc/util.h>
+
+int
+isc_region_compare(isc_region_t *r1, isc_region_t *r2) {
+ unsigned int l;
+ int result;
+
+ REQUIRE(r1 != NULL);
+ REQUIRE(r2 != NULL);
+
+ l = (r1->length < r2->length) ? r1->length : r2->length;
+
+ if ((result = memcmp(r1->base, r2->base, l)) != 0)
+ return ((result < 0) ? -1 : 1);
+ else
+ return ((r1->length == r2->length) ? 0 :
+ (r1->length < r2->length) ? -1 : 1);
+}
diff --git a/lib/isc/result.c b/lib/isc/result.c
new file mode 100644
index 0000000..520f161
--- /dev/null
+++ b/lib/isc/result.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#include <isc/lib.h>
+#include <isc/msgs.h>
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/resultclass.h>
+#include <isc/util.h>
+
+typedef struct resulttable {
+ unsigned int base;
+ unsigned int last;
+ const char ** text;
+ isc_msgcat_t * msgcat;
+ int set;
+ ISC_LINK(struct resulttable) link;
+} resulttable;
+
+static const char *text[ISC_R_NRESULTS] = {
+ "success", /*%< 0 */
+ "out of memory", /*%< 1 */
+ "timed out", /*%< 2 */
+ "no available threads", /*%< 3 */
+ "address not available", /*%< 4 */
+ "address in use", /*%< 5 */
+ "permission denied", /*%< 6 */
+ "no pending connections", /*%< 7 */
+ "network unreachable", /*%< 8 */
+ "host unreachable", /*%< 9 */
+ "network down", /*%< 10 */
+ "host down", /*%< 11 */
+ "connection refused", /*%< 12 */
+ "not enough free resources", /*%< 13 */
+ "end of file", /*%< 14 */
+ "socket already bound", /*%< 15 */
+ "reload", /*%< 16 */
+ "lock busy", /*%< 17 */
+ "already exists", /*%< 18 */
+ "ran out of space", /*%< 19 */
+ "operation canceled", /*%< 20 */
+ "socket is not bound", /*%< 21 */
+ "shutting down", /*%< 22 */
+ "not found", /*%< 23 */
+ "unexpected end of input", /*%< 24 */
+ "failure", /*%< 25 */
+ "I/O error", /*%< 26 */
+ "not implemented", /*%< 27 */
+ "unbalanced parentheses", /*%< 28 */
+ "no more", /*%< 29 */
+ "invalid file", /*%< 30 */
+ "bad base64 encoding", /*%< 31 */
+ "unexpected token", /*%< 32 */
+ "quota reached", /*%< 33 */
+ "unexpected error", /*%< 34 */
+ "already running", /*%< 35 */
+ "ignore", /*%< 36 */
+ "address mask not contiguous", /*%< 37 */
+ "file not found", /*%< 38 */
+ "file already exists", /*%< 39 */
+ "socket is not connected", /*%< 40 */
+ "out of range", /*%< 41 */
+ "out of entropy", /*%< 42 */
+ "invalid use of multicast address", /*%< 43 */
+ "not a file", /*%< 44 */
+ "not a directory", /*%< 45 */
+ "queue is full", /*%< 46 */
+ "address family mismatch", /*%< 47 */
+ "address family not supported", /*%< 48 */
+ "bad hex encoding", /*%< 49 */
+ "too many open files", /*%< 50 */
+ "not blocking", /*%< 51 */
+ "unbalanced quotes", /*%< 52 */
+ "operation in progress", /*%< 53 */
+ "connection reset", /*%< 54 */
+ "soft quota reached", /*%< 55 */
+ "not a valid number", /*%< 56 */
+ "disabled", /*%< 57 */
+ "max size", /*%< 58 */
+ "invalid address format", /*%< 59 */
+ "bad base32 encoding", /*%< 60 */
+ "unset", /*%< 61 */
+};
+
+#define ISC_RESULT_RESULTSET 2
+#define ISC_RESULT_UNAVAILABLESET 3
+
+static isc_once_t once = ISC_ONCE_INIT;
+static ISC_LIST(resulttable) tables;
+static isc_mutex_t lock;
+
+static isc_result_t
+register_table(unsigned int base, unsigned int nresults, const char **txt,
+ isc_msgcat_t *msgcat, int set)
+{
+ resulttable *table;
+
+ REQUIRE(base % ISC_RESULTCLASS_SIZE == 0);
+ REQUIRE(nresults <= ISC_RESULTCLASS_SIZE);
+ REQUIRE(txt != NULL);
+
+ /*
+ * We use malloc() here because we we want to be able to use
+ * isc_result_totext() even if there is no memory context.
+ */
+ table = malloc(sizeof(*table));
+ if (table == NULL)
+ return (ISC_R_NOMEMORY);
+ table->base = base;
+ table->last = base + nresults - 1;
+ table->text = txt;
+ table->msgcat = msgcat;
+ table->set = set;
+ ISC_LINK_INIT(table, link);
+
+ LOCK(&lock);
+
+ ISC_LIST_APPEND(tables, table, link);
+
+ UNLOCK(&lock);
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+initialize_action(void) {
+ isc_result_t result;
+
+ RUNTIME_CHECK(isc_mutex_init(&lock) == ISC_R_SUCCESS);
+ ISC_LIST_INIT(tables);
+
+ result = register_table(ISC_RESULTCLASS_ISC, ISC_R_NRESULTS, text,
+ isc_msgcat, ISC_RESULT_RESULTSET);
+ if (result != ISC_R_SUCCESS)
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "register_table() %s: %u",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ result);
+}
+
+static void
+initialize(void) {
+ isc_lib_initmsgcat();
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+}
+
+const char *
+isc_result_totext(isc_result_t result) {
+ resulttable *table;
+ const char *txt, *default_text;
+ int index;
+
+ initialize();
+
+ LOCK(&lock);
+
+ txt = NULL;
+ for (table = ISC_LIST_HEAD(tables);
+ table != NULL;
+ table = ISC_LIST_NEXT(table, link)) {
+ if (result >= table->base && result <= table->last) {
+ index = (int)(result - table->base);
+ default_text = table->text[index];
+ /*
+ * Note: we use 'index + 1' as the message number
+ * instead of index because isc_msgcat_get() requires
+ * the message number to be > 0.
+ */
+ txt = isc_msgcat_get(table->msgcat, table->set,
+ index + 1, default_text);
+ break;
+ }
+ }
+ if (txt == NULL)
+ txt = isc_msgcat_get(isc_msgcat, ISC_RESULT_UNAVAILABLESET,
+ 1, "(result code text not available)");
+
+ UNLOCK(&lock);
+
+ return (txt);
+}
+
+isc_result_t
+isc_result_register(unsigned int base, unsigned int nresults,
+ const char **txt, isc_msgcat_t *msgcat, int set)
+{
+ initialize();
+
+ return (register_table(base, nresults, txt, msgcat, set));
+}
diff --git a/lib/isc/rwlock.c b/lib/isc/rwlock.c
new file mode 100644
index 0000000..9c84c25
--- /dev/null
+++ b/lib/isc/rwlock.c
@@ -0,0 +1,809 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h>
+
+#include <isc/atomic.h>
+#include <isc/magic.h>
+#include <isc/msgs.h>
+#include <isc/platform.h>
+#include <isc/rwlock.h>
+#include <isc/util.h>
+
+#define RWLOCK_MAGIC ISC_MAGIC('R', 'W', 'L', 'k')
+#define VALID_RWLOCK(rwl) ISC_MAGIC_VALID(rwl, RWLOCK_MAGIC)
+
+#ifdef ISC_PLATFORM_USETHREADS
+
+#ifndef RWLOCK_DEFAULT_READ_QUOTA
+#define RWLOCK_DEFAULT_READ_QUOTA 4
+#endif
+
+#ifndef RWLOCK_DEFAULT_WRITE_QUOTA
+#define RWLOCK_DEFAULT_WRITE_QUOTA 4
+#endif
+
+#ifdef ISC_RWLOCK_TRACE
+#include <stdio.h> /* Required for fprintf/stderr. */
+#include <isc/thread.h> /* Required for isc_thread_self(). */
+
+static void
+print_lock(const char *operation, isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ fprintf(stderr,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_PRINTLOCK,
+ "rwlock %p thread %lu %s(%s): %s, %u active, "
+ "%u granted, %u rwaiting, %u wwaiting\n"),
+ rwl, isc_thread_self(), operation,
+ (type == isc_rwlocktype_read ?
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_READ, "read") :
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_WRITE, "write")),
+ (rwl->type == isc_rwlocktype_read ?
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_READING, "reading") :
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_WRITING, "writing")),
+ rwl->active, rwl->granted, rwl->readers_waiting,
+ rwl->writers_waiting);
+}
+#endif
+
+isc_result_t
+isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
+ unsigned int write_quota)
+{
+ isc_result_t result;
+
+ REQUIRE(rwl != NULL);
+
+ /*
+ * In case there's trouble initializing, we zero magic now. If all
+ * goes well, we'll set it to RWLOCK_MAGIC.
+ */
+ rwl->magic = 0;
+
+#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG)
+ rwl->write_requests = 0;
+ rwl->write_completions = 0;
+ rwl->cnt_and_flag = 0;
+ rwl->readers_waiting = 0;
+ rwl->write_granted = 0;
+ if (read_quota != 0) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "read quota is not supported");
+ }
+ if (write_quota == 0)
+ write_quota = RWLOCK_DEFAULT_WRITE_QUOTA;
+ rwl->write_quota = write_quota;
+#else
+ rwl->type = isc_rwlocktype_read;
+ rwl->original = isc_rwlocktype_none;
+ rwl->active = 0;
+ rwl->granted = 0;
+ rwl->readers_waiting = 0;
+ rwl->writers_waiting = 0;
+ if (read_quota == 0)
+ read_quota = RWLOCK_DEFAULT_READ_QUOTA;
+ rwl->read_quota = read_quota;
+ if (write_quota == 0)
+ write_quota = RWLOCK_DEFAULT_WRITE_QUOTA;
+ rwl->write_quota = write_quota;
+#endif
+
+ result = isc_mutex_init(&rwl->lock);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ result = isc_condition_init(&rwl->readable);
+ if (result != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init(readable) %s: %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ isc_result_totext(result));
+ result = ISC_R_UNEXPECTED;
+ goto destroy_lock;
+ }
+ result = isc_condition_init(&rwl->writeable);
+ if (result != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init(writeable) %s: %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ isc_result_totext(result));
+ result = ISC_R_UNEXPECTED;
+ goto destroy_rcond;
+ }
+
+ rwl->magic = RWLOCK_MAGIC;
+
+ return (ISC_R_SUCCESS);
+
+ destroy_rcond:
+ (void)isc_condition_destroy(&rwl->readable);
+ destroy_lock:
+ DESTROYLOCK(&rwl->lock);
+
+ return (result);
+}
+
+void
+isc_rwlock_destroy(isc_rwlock_t *rwl) {
+ REQUIRE(VALID_RWLOCK(rwl));
+
+#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG)
+ REQUIRE(rwl->write_requests == rwl->write_completions &&
+ rwl->cnt_and_flag == 0 && rwl->readers_waiting == 0);
+#else
+ LOCK(&rwl->lock);
+ REQUIRE(rwl->active == 0 &&
+ rwl->readers_waiting == 0 &&
+ rwl->writers_waiting == 0);
+ UNLOCK(&rwl->lock);
+#endif
+
+ rwl->magic = 0;
+ (void)isc_condition_destroy(&rwl->readable);
+ (void)isc_condition_destroy(&rwl->writeable);
+ DESTROYLOCK(&rwl->lock);
+}
+
+#if defined(ISC_PLATFORM_HAVEXADD) && defined(ISC_PLATFORM_HAVECMPXCHG)
+
+/*
+ * When some architecture-dependent atomic operations are available,
+ * rwlock can be more efficient than the generic algorithm defined below.
+ * The basic algorithm is described in the following URL:
+ * http://www.cs.rochester.edu/u/scott/synchronization/pseudocode/rw.html
+ *
+ * The key is to use the following integer variables modified atomically:
+ * write_requests, write_completions, and cnt_and_flag.
+ *
+ * write_requests and write_completions act as a waiting queue for writers
+ * in order to ensure the FIFO order. Both variables begin with the initial
+ * value of 0. When a new writer tries to get a write lock, it increments
+ * write_requests and gets the previous value of the variable as a "ticket".
+ * When write_completions reaches the ticket number, the new writer can start
+ * writing. When the writer completes its work, it increments
+ * write_completions so that another new writer can start working. If the
+ * write_requests is not equal to write_completions, it means a writer is now
+ * working or waiting. In this case, a new readers cannot start reading, or
+ * in other words, this algorithm basically prefers writers.
+ *
+ * cnt_and_flag is a "lock" shared by all readers and writers. This integer
+ * variable is a kind of structure with two members: writer_flag (1 bit) and
+ * reader_count (31 bits). The writer_flag shows whether a writer is working,
+ * and the reader_count shows the number of readers currently working or almost
+ * ready for working. A writer who has the current "ticket" tries to get the
+ * lock by exclusively setting the writer_flag to 1, provided that the whole
+ * 32-bit is 0 (meaning no readers or writers working). On the other hand,
+ * a new reader tries to increment the "reader_count" field provided that
+ * the writer_flag is 0 (meaning there is no writer working).
+ *
+ * If some of the above operations fail, the reader or the writer sleeps
+ * until the related condition changes. When a working reader or writer
+ * completes its work, some readers or writers are sleeping, and the condition
+ * that suspended the reader or writer has changed, it wakes up the sleeping
+ * readers or writers.
+ *
+ * As already noted, this algorithm basically prefers writers. In order to
+ * prevent readers from starving, however, the algorithm also introduces the
+ * "writer quota" (Q). When Q consecutive writers have completed their work,
+ * suspending readers, the last writer will wake up the readers, even if a new
+ * writer is waiting.
+ *
+ * Implementation specific note: due to the combination of atomic operations
+ * and a mutex lock, ordering between the atomic operation and locks can be
+ * very sensitive in some cases. In particular, it is generally very important
+ * to check the atomic variable that requires a reader or writer to sleep after
+ * locking the mutex and before actually sleeping; otherwise, it could be very
+ * likely to cause a deadlock. For example, assume "var" is a variable
+ * atomically modified, then the corresponding code would be:
+ * if (var == need_sleep) {
+ * LOCK(lock);
+ * if (var == need_sleep)
+ * WAIT(cond, lock);
+ * UNLOCK(lock);
+ * }
+ * The second check is important, since "var" is protected by the atomic
+ * operation, not by the mutex, and can be changed just before sleeping.
+ * (The first "if" could be omitted, but this is also important in order to
+ * make the code efficient by avoiding the use of the mutex unless it is
+ * really necessary.)
+ */
+
+#define WRITER_ACTIVE 0x1
+#define READER_INCR 0x2
+
+isc_result_t
+isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ isc_int32_t cntflag;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_PRELOCK, "prelock"), rwl, type);
+#endif
+
+ if (type == isc_rwlocktype_read) {
+ if (rwl->write_requests != rwl->write_completions) {
+ /* there is a waiting or active writer */
+ LOCK(&rwl->lock);
+ if (rwl->write_requests != rwl->write_completions) {
+ rwl->readers_waiting++;
+ WAIT(&rwl->readable, &rwl->lock);
+ rwl->readers_waiting--;
+ }
+ UNLOCK(&rwl->lock);
+ }
+
+ cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR);
+ POST(cntflag);
+ while (1) {
+ if ((rwl->cnt_and_flag & WRITER_ACTIVE) == 0)
+ break;
+
+ /* A writer is still working */
+ LOCK(&rwl->lock);
+ rwl->readers_waiting++;
+ if ((rwl->cnt_and_flag & WRITER_ACTIVE) != 0)
+ WAIT(&rwl->readable, &rwl->lock);
+ rwl->readers_waiting--;
+ UNLOCK(&rwl->lock);
+
+ /*
+ * Typically, the reader should be able to get a lock
+ * at this stage:
+ * (1) there should have been no pending writer when
+ * the reader was trying to increment the
+ * counter; otherwise, the writer should be in
+ * the waiting queue, preventing the reader from
+ * proceeding to this point.
+ * (2) once the reader increments the counter, no
+ * more writer can get a lock.
+ * Still, it is possible another writer can work at
+ * this point, e.g. in the following scenario:
+ * A previous writer unlocks the writer lock.
+ * This reader proceeds to point (1).
+ * A new writer appears, and gets a new lock before
+ * the reader increments the counter.
+ * The reader then increments the counter.
+ * The previous writer notices there is a waiting
+ * reader who is almost ready, and wakes it up.
+ * So, the reader needs to confirm whether it can now
+ * read explicitly (thus we loop). Note that this is
+ * not an infinite process, since the reader has
+ * incremented the counter at this point.
+ */
+ }
+
+ /*
+ * If we are temporarily preferred to writers due to the writer
+ * quota, reset the condition (race among readers doesn't
+ * matter).
+ */
+ rwl->write_granted = 0;
+ } else {
+ isc_int32_t prev_writer;
+
+ /* enter the waiting queue, and wait for our turn */
+ prev_writer = isc_atomic_xadd(&rwl->write_requests, 1);
+ while (rwl->write_completions != prev_writer) {
+ LOCK(&rwl->lock);
+ if (rwl->write_completions != prev_writer) {
+ WAIT(&rwl->writeable, &rwl->lock);
+ UNLOCK(&rwl->lock);
+ continue;
+ }
+ UNLOCK(&rwl->lock);
+ break;
+ }
+
+ while (1) {
+ cntflag = isc_atomic_cmpxchg(&rwl->cnt_and_flag, 0,
+ WRITER_ACTIVE);
+ if (cntflag == 0)
+ break;
+
+ /* Another active reader or writer is working. */
+ LOCK(&rwl->lock);
+ if (rwl->cnt_and_flag != 0)
+ WAIT(&rwl->writeable, &rwl->lock);
+ UNLOCK(&rwl->lock);
+ }
+
+ INSIST((rwl->cnt_and_flag & WRITER_ACTIVE) != 0);
+ rwl->write_granted++;
+ }
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_POSTLOCK, "postlock"), rwl, type);
+#endif
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ isc_int32_t cntflag;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_PRELOCK, "prelock"), rwl, type);
+#endif
+
+ if (type == isc_rwlocktype_read) {
+ /* If a writer is waiting or working, we fail. */
+ if (rwl->write_requests != rwl->write_completions)
+ return (ISC_R_LOCKBUSY);
+
+ /* Otherwise, be ready for reading. */
+ cntflag = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR);
+ if ((cntflag & WRITER_ACTIVE) != 0) {
+ /*
+ * A writer is working. We lose, and cancel the read
+ * request.
+ */
+ cntflag = isc_atomic_xadd(&rwl->cnt_and_flag,
+ -READER_INCR);
+ /*
+ * If no other readers are waiting and we've suspended
+ * new writers in this short period, wake them up.
+ */
+ if (cntflag == READER_INCR &&
+ rwl->write_completions != rwl->write_requests) {
+ LOCK(&rwl->lock);
+ BROADCAST(&rwl->writeable);
+ UNLOCK(&rwl->lock);
+ }
+
+ return (ISC_R_LOCKBUSY);
+ }
+ } else {
+ /* Try locking without entering the waiting queue. */
+ cntflag = isc_atomic_cmpxchg(&rwl->cnt_and_flag, 0,
+ WRITER_ACTIVE);
+ if (cntflag != 0)
+ return (ISC_R_LOCKBUSY);
+
+ /*
+ * XXXJT: jump into the queue, possibly breaking the writer
+ * order.
+ */
+ (void)isc_atomic_xadd(&rwl->write_completions, -1);
+
+ rwl->write_granted++;
+ }
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_POSTLOCK, "postlock"), rwl, type);
+#endif
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_rwlock_tryupgrade(isc_rwlock_t *rwl) {
+ isc_int32_t prevcnt;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+
+ /* Try to acquire write access. */
+ prevcnt = isc_atomic_cmpxchg(&rwl->cnt_and_flag,
+ READER_INCR, WRITER_ACTIVE);
+ /*
+ * There must have been no writer, and there must have been at least
+ * one reader.
+ */
+ INSIST((prevcnt & WRITER_ACTIVE) == 0 &&
+ (prevcnt & ~WRITER_ACTIVE) != 0);
+
+ if (prevcnt == READER_INCR) {
+ /*
+ * We are the only reader and have been upgraded.
+ * Now jump into the head of the writer waiting queue.
+ */
+ (void)isc_atomic_xadd(&rwl->write_completions, -1);
+ } else
+ return (ISC_R_LOCKBUSY);
+
+ return (ISC_R_SUCCESS);
+
+}
+
+void
+isc_rwlock_downgrade(isc_rwlock_t *rwl) {
+ isc_int32_t prev_readers;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+
+ /* Become an active reader. */
+ prev_readers = isc_atomic_xadd(&rwl->cnt_and_flag, READER_INCR);
+ /* We must have been a writer. */
+ INSIST((prev_readers & WRITER_ACTIVE) != 0);
+
+ /* Complete write */
+ (void)isc_atomic_xadd(&rwl->cnt_and_flag, -WRITER_ACTIVE);
+ (void)isc_atomic_xadd(&rwl->write_completions, 1);
+
+ /* Resume other readers */
+ LOCK(&rwl->lock);
+ if (rwl->readers_waiting > 0)
+ BROADCAST(&rwl->readable);
+ UNLOCK(&rwl->lock);
+}
+
+isc_result_t
+isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ isc_int32_t prev_cnt;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_PREUNLOCK, "preunlock"), rwl, type);
+#endif
+
+ if (type == isc_rwlocktype_read) {
+ prev_cnt = isc_atomic_xadd(&rwl->cnt_and_flag, -READER_INCR);
+
+ /*
+ * If we're the last reader and any writers are waiting, wake
+ * them up. We need to wake up all of them to ensure the
+ * FIFO order.
+ */
+ if (prev_cnt == READER_INCR &&
+ rwl->write_completions != rwl->write_requests) {
+ LOCK(&rwl->lock);
+ BROADCAST(&rwl->writeable);
+ UNLOCK(&rwl->lock);
+ }
+ } else {
+ isc_boolean_t wakeup_writers = ISC_TRUE;
+
+ /*
+ * Reset the flag, and (implicitly) tell other writers
+ * we are done.
+ */
+ (void)isc_atomic_xadd(&rwl->cnt_and_flag, -WRITER_ACTIVE);
+ (void)isc_atomic_xadd(&rwl->write_completions, 1);
+
+ if (rwl->write_granted >= rwl->write_quota ||
+ rwl->write_requests == rwl->write_completions ||
+ (rwl->cnt_and_flag & ~WRITER_ACTIVE) != 0) {
+ /*
+ * We have passed the write quota, no writer is
+ * waiting, or some readers are almost ready, pending
+ * possible writers. Note that the last case can
+ * happen even if write_requests != write_completions
+ * (which means a new writer in the queue), so we need
+ * to catch the case explicitly.
+ */
+ LOCK(&rwl->lock);
+ if (rwl->readers_waiting > 0) {
+ wakeup_writers = ISC_FALSE;
+ BROADCAST(&rwl->readable);
+ }
+ UNLOCK(&rwl->lock);
+ }
+
+ if (rwl->write_requests != rwl->write_completions &&
+ wakeup_writers) {
+ LOCK(&rwl->lock);
+ BROADCAST(&rwl->writeable);
+ UNLOCK(&rwl->lock);
+ }
+ }
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_POSTUNLOCK, "postunlock"),
+ rwl, type);
+#endif
+
+ return (ISC_R_SUCCESS);
+}
+
+#else /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */
+
+static isc_result_t
+doit(isc_rwlock_t *rwl, isc_rwlocktype_t type, isc_boolean_t nonblock) {
+ isc_boolean_t skip = ISC_FALSE;
+ isc_boolean_t done = ISC_FALSE;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+
+ LOCK(&rwl->lock);
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_PRELOCK, "prelock"), rwl, type);
+#endif
+
+ if (type == isc_rwlocktype_read) {
+ if (rwl->readers_waiting != 0)
+ skip = ISC_TRUE;
+ while (!done) {
+ if (!skip &&
+ ((rwl->active == 0 ||
+ (rwl->type == isc_rwlocktype_read &&
+ (rwl->writers_waiting == 0 ||
+ rwl->granted < rwl->read_quota)))))
+ {
+ rwl->type = isc_rwlocktype_read;
+ rwl->active++;
+ rwl->granted++;
+ done = ISC_TRUE;
+ } else if (nonblock) {
+ result = ISC_R_LOCKBUSY;
+ done = ISC_TRUE;
+ } else {
+ skip = ISC_FALSE;
+ rwl->readers_waiting++;
+ WAIT(&rwl->readable, &rwl->lock);
+ rwl->readers_waiting--;
+ }
+ }
+ } else {
+ if (rwl->writers_waiting != 0)
+ skip = ISC_TRUE;
+ while (!done) {
+ if (!skip && rwl->active == 0) {
+ rwl->type = isc_rwlocktype_write;
+ rwl->active = 1;
+ rwl->granted++;
+ done = ISC_TRUE;
+ } else if (nonblock) {
+ result = ISC_R_LOCKBUSY;
+ done = ISC_TRUE;
+ } else {
+ skip = ISC_FALSE;
+ rwl->writers_waiting++;
+ WAIT(&rwl->writeable, &rwl->lock);
+ rwl->writers_waiting--;
+ }
+ }
+ }
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_POSTLOCK, "postlock"), rwl, type);
+#endif
+
+ UNLOCK(&rwl->lock);
+
+ return (result);
+}
+
+isc_result_t
+isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ return (doit(rwl, type, ISC_FALSE));
+}
+
+isc_result_t
+isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ return (doit(rwl, type, ISC_TRUE));
+}
+
+isc_result_t
+isc_rwlock_tryupgrade(isc_rwlock_t *rwl) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+ LOCK(&rwl->lock);
+ REQUIRE(rwl->type == isc_rwlocktype_read);
+ REQUIRE(rwl->active != 0);
+
+ /* If we are the only reader then succeed. */
+ if (rwl->active == 1) {
+ rwl->original = (rwl->original == isc_rwlocktype_none) ?
+ isc_rwlocktype_read : isc_rwlocktype_none;
+ rwl->type = isc_rwlocktype_write;
+ } else
+ result = ISC_R_LOCKBUSY;
+
+ UNLOCK(&rwl->lock);
+ return (result);
+}
+
+void
+isc_rwlock_downgrade(isc_rwlock_t *rwl) {
+
+ REQUIRE(VALID_RWLOCK(rwl));
+ LOCK(&rwl->lock);
+ REQUIRE(rwl->type == isc_rwlocktype_write);
+ REQUIRE(rwl->active == 1);
+
+ rwl->type = isc_rwlocktype_read;
+ rwl->original = (rwl->original == isc_rwlocktype_none) ?
+ isc_rwlocktype_write : isc_rwlocktype_none;
+ /*
+ * Resume processing any read request that were blocked when
+ * we upgraded.
+ */
+ if (rwl->original == isc_rwlocktype_none &&
+ (rwl->writers_waiting == 0 || rwl->granted < rwl->read_quota) &&
+ rwl->readers_waiting > 0)
+ BROADCAST(&rwl->readable);
+
+ UNLOCK(&rwl->lock);
+}
+
+isc_result_t
+isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+
+ REQUIRE(VALID_RWLOCK(rwl));
+ LOCK(&rwl->lock);
+ REQUIRE(rwl->type == type);
+
+ UNUSED(type);
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_PREUNLOCK, "preunlock"), rwl, type);
+#endif
+
+ INSIST(rwl->active > 0);
+ rwl->active--;
+ if (rwl->active == 0) {
+ if (rwl->original != isc_rwlocktype_none) {
+ rwl->type = rwl->original;
+ rwl->original = isc_rwlocktype_none;
+ }
+ if (rwl->type == isc_rwlocktype_read) {
+ rwl->granted = 0;
+ if (rwl->writers_waiting > 0) {
+ rwl->type = isc_rwlocktype_write;
+ SIGNAL(&rwl->writeable);
+ } else if (rwl->readers_waiting > 0) {
+ /* Does this case ever happen? */
+ BROADCAST(&rwl->readable);
+ }
+ } else {
+ if (rwl->readers_waiting > 0) {
+ if (rwl->writers_waiting > 0 &&
+ rwl->granted < rwl->write_quota) {
+ SIGNAL(&rwl->writeable);
+ } else {
+ rwl->granted = 0;
+ rwl->type = isc_rwlocktype_read;
+ BROADCAST(&rwl->readable);
+ }
+ } else if (rwl->writers_waiting > 0) {
+ rwl->granted = 0;
+ SIGNAL(&rwl->writeable);
+ } else {
+ rwl->granted = 0;
+ }
+ }
+ }
+ INSIST(rwl->original == isc_rwlocktype_none);
+
+#ifdef ISC_RWLOCK_TRACE
+ print_lock(isc_msgcat_get(isc_msgcat, ISC_MSGSET_RWLOCK,
+ ISC_MSG_POSTUNLOCK, "postunlock"),
+ rwl, type);
+#endif
+
+ UNLOCK(&rwl->lock);
+
+ return (ISC_R_SUCCESS);
+}
+
+#endif /* ISC_PLATFORM_HAVEXADD && ISC_PLATFORM_HAVECMPXCHG */
+#else /* ISC_PLATFORM_USETHREADS */
+
+isc_result_t
+isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
+ unsigned int write_quota)
+{
+ REQUIRE(rwl != NULL);
+
+ UNUSED(read_quota);
+ UNUSED(write_quota);
+
+ rwl->type = isc_rwlocktype_read;
+ rwl->active = 0;
+ rwl->magic = RWLOCK_MAGIC;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ REQUIRE(VALID_RWLOCK(rwl));
+
+ if (type == isc_rwlocktype_read) {
+ if (rwl->type != isc_rwlocktype_read && rwl->active != 0)
+ return (ISC_R_LOCKBUSY);
+ rwl->type = isc_rwlocktype_read;
+ rwl->active++;
+ } else {
+ if (rwl->active != 0)
+ return (ISC_R_LOCKBUSY);
+ rwl->type = isc_rwlocktype_write;
+ rwl->active = 1;
+ }
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_rwlock_trylock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ return (isc_rwlock_lock(rwl, type));
+}
+
+isc_result_t
+isc_rwlock_tryupgrade(isc_rwlock_t *rwl) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(VALID_RWLOCK(rwl));
+ REQUIRE(rwl->type == isc_rwlocktype_read);
+ REQUIRE(rwl->active != 0);
+
+ /* If we are the only reader then succeed. */
+ if (rwl->active == 1)
+ rwl->type = isc_rwlocktype_write;
+ else
+ result = ISC_R_LOCKBUSY;
+ return (result);
+}
+
+void
+isc_rwlock_downgrade(isc_rwlock_t *rwl) {
+
+ REQUIRE(VALID_RWLOCK(rwl));
+ REQUIRE(rwl->type == isc_rwlocktype_write);
+ REQUIRE(rwl->active == 1);
+
+ rwl->type = isc_rwlocktype_read;
+}
+
+isc_result_t
+isc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
+ REQUIRE(VALID_RWLOCK(rwl));
+ REQUIRE(rwl->type == type);
+
+ UNUSED(type);
+
+ INSIST(rwl->active > 0);
+ rwl->active--;
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_rwlock_destroy(isc_rwlock_t *rwl) {
+ REQUIRE(rwl != NULL);
+ REQUIRE(rwl->active == 0);
+ rwl->magic = 0;
+}
+
+#endif /* ISC_PLATFORM_USETHREADS */
diff --git a/lib/isc/serial.c b/lib/isc/serial.c
new file mode 100644
index 0000000..b43aac7
--- /dev/null
+++ b/lib/isc/serial.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: serial.c,v 1.12 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/serial.h>
+
+isc_boolean_t
+isc_serial_lt(isc_uint32_t a, isc_uint32_t b) {
+ /*
+ * Undefined => ISC_FALSE
+ */
+ if (a == (b ^ 0x80000000U))
+ return (ISC_FALSE);
+ return (((isc_int32_t)(a - b) < 0) ? ISC_TRUE : ISC_FALSE);
+}
+
+isc_boolean_t
+isc_serial_gt(isc_uint32_t a, isc_uint32_t b) {
+ return (((isc_int32_t)(a - b) > 0) ? ISC_TRUE : ISC_FALSE);
+}
+
+isc_boolean_t
+isc_serial_le(isc_uint32_t a, isc_uint32_t b) {
+ return ((a == b) ? ISC_TRUE : isc_serial_lt(a, b));
+}
+
+isc_boolean_t
+isc_serial_ge(isc_uint32_t a, isc_uint32_t b) {
+ return ((a == b) ? ISC_TRUE : isc_serial_gt(a, b));
+}
+
+isc_boolean_t
+isc_serial_eq(isc_uint32_t a, isc_uint32_t b) {
+ return ((a == b) ? ISC_TRUE : ISC_FALSE);
+}
+
+isc_boolean_t
+isc_serial_ne(isc_uint32_t a, isc_uint32_t b) {
+ return ((a != b) ? ISC_TRUE : ISC_FALSE);
+}
diff --git a/lib/isc/sha1.c b/lib/isc/sha1.c
new file mode 100644
index 0000000..cce9603
--- /dev/null
+++ b/lib/isc/sha1.c
@@ -0,0 +1,354 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/* $NetBSD: sha1.c,v 1.5 2000/01/22 22:19:14 mycroft Exp $ */
+/* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */
+
+/*! \file
+ * SHA-1 in C
+ * \author By Steve Reid <steve@edmweb.com>
+ * 100% Public Domain
+ * \verbatim
+ * Test Vectors (from FIPS PUB 180-1)
+ * "abc"
+ * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
+ * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
+ * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
+ * A million repetitions of "a"
+ * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
+ * \endverbatim
+ */
+
+#include "config.h"
+
+#include <isc/assertions.h>
+#include <isc/platform.h>
+#include <isc/sha1.h>
+#include <isc/string.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+
+void
+isc_sha1_init(isc_sha1_t *context)
+{
+ INSIST(context != NULL);
+
+ EVP_DigestInit(context, EVP_sha1());
+}
+
+void
+isc_sha1_invalidate(isc_sha1_t *context) {
+ EVP_MD_CTX_cleanup(context);
+}
+
+void
+isc_sha1_update(isc_sha1_t *context, const unsigned char *data,
+ unsigned int len)
+{
+ INSIST(context != 0);
+ INSIST(data != 0);
+
+ EVP_DigestUpdate(context, (const void *) data, (size_t) len);
+}
+
+void
+isc_sha1_final(isc_sha1_t *context, unsigned char *digest) {
+ INSIST(digest != 0);
+ INSIST(context != 0);
+
+ EVP_DigestFinal(context, digest, NULL);
+}
+
+#else
+
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
+
+/*@{*/
+/*!
+ * blk0() and blk() perform the initial expand.
+ * I got the idea of expanding during the round function from SSLeay
+ */
+#if !defined(WORDS_BIGENDIAN)
+# define blk0(i) \
+ (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) \
+ | (rol(block->l[i], 8) & 0x00FF00FF))
+#else
+# define blk0(i) block->l[i]
+#endif
+#define blk(i) \
+ (block->l[i & 15] = rol(block->l[(i + 13) & 15] \
+ ^ block->l[(i + 8) & 15] \
+ ^ block->l[(i + 2) & 15] \
+ ^ block->l[i & 15], 1))
+
+/*@}*/
+/*@{*/
+/*!
+ * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
+ */
+#define R0(v,w,x,y,z,i) \
+ z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); \
+ w = rol(w, 30);
+#define R1(v,w,x,y,z,i) \
+ z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \
+ w = rol(w, 30);
+#define R2(v,w,x,y,z,i) \
+ z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); \
+ w = rol(w, 30);
+#define R3(v,w,x,y,z,i) \
+ z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \
+ w = rol(w, 30);
+#define R4(v,w,x,y,z,i) \
+ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \
+ w = rol(w, 30);
+
+/*@}*/
+
+typedef union {
+ unsigned char c[64];
+ unsigned int l[16];
+} CHAR64LONG16;
+
+#ifdef __sparc_v9__
+static void do_R01(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c,
+ isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *);
+static void do_R2(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c,
+ isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *);
+static void do_R3(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c,
+ isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *);
+static void do_R4(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c,
+ isc_uint32_t *d, isc_uint32_t *e, CHAR64LONG16 *);
+
+#define nR0(v,w,x,y,z,i) R0(*v,*w,*x,*y,*z,i)
+#define nR1(v,w,x,y,z,i) R1(*v,*w,*x,*y,*z,i)
+#define nR2(v,w,x,y,z,i) R2(*v,*w,*x,*y,*z,i)
+#define nR3(v,w,x,y,z,i) R3(*v,*w,*x,*y,*z,i)
+#define nR4(v,w,x,y,z,i) R4(*v,*w,*x,*y,*z,i)
+
+static void
+do_R01(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d,
+ isc_uint32_t *e, CHAR64LONG16 *block)
+{
+ nR0(a,b,c,d,e, 0); nR0(e,a,b,c,d, 1); nR0(d,e,a,b,c, 2);
+ nR0(c,d,e,a,b, 3); nR0(b,c,d,e,a, 4); nR0(a,b,c,d,e, 5);
+ nR0(e,a,b,c,d, 6); nR0(d,e,a,b,c, 7); nR0(c,d,e,a,b, 8);
+ nR0(b,c,d,e,a, 9); nR0(a,b,c,d,e,10); nR0(e,a,b,c,d,11);
+ nR0(d,e,a,b,c,12); nR0(c,d,e,a,b,13); nR0(b,c,d,e,a,14);
+ nR0(a,b,c,d,e,15); nR1(e,a,b,c,d,16); nR1(d,e,a,b,c,17);
+ nR1(c,d,e,a,b,18); nR1(b,c,d,e,a,19);
+}
+
+static void
+do_R2(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d,
+ isc_uint32_t *e, CHAR64LONG16 *block)
+{
+ nR2(a,b,c,d,e,20); nR2(e,a,b,c,d,21); nR2(d,e,a,b,c,22);
+ nR2(c,d,e,a,b,23); nR2(b,c,d,e,a,24); nR2(a,b,c,d,e,25);
+ nR2(e,a,b,c,d,26); nR2(d,e,a,b,c,27); nR2(c,d,e,a,b,28);
+ nR2(b,c,d,e,a,29); nR2(a,b,c,d,e,30); nR2(e,a,b,c,d,31);
+ nR2(d,e,a,b,c,32); nR2(c,d,e,a,b,33); nR2(b,c,d,e,a,34);
+ nR2(a,b,c,d,e,35); nR2(e,a,b,c,d,36); nR2(d,e,a,b,c,37);
+ nR2(c,d,e,a,b,38); nR2(b,c,d,e,a,39);
+}
+
+static void
+do_R3(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d,
+ isc_uint32_t *e, CHAR64LONG16 *block)
+{
+ nR3(a,b,c,d,e,40); nR3(e,a,b,c,d,41); nR3(d,e,a,b,c,42);
+ nR3(c,d,e,a,b,43); nR3(b,c,d,e,a,44); nR3(a,b,c,d,e,45);
+ nR3(e,a,b,c,d,46); nR3(d,e,a,b,c,47); nR3(c,d,e,a,b,48);
+ nR3(b,c,d,e,a,49); nR3(a,b,c,d,e,50); nR3(e,a,b,c,d,51);
+ nR3(d,e,a,b,c,52); nR3(c,d,e,a,b,53); nR3(b,c,d,e,a,54);
+ nR3(a,b,c,d,e,55); nR3(e,a,b,c,d,56); nR3(d,e,a,b,c,57);
+ nR3(c,d,e,a,b,58); nR3(b,c,d,e,a,59);
+}
+
+static void
+do_R4(isc_uint32_t *a, isc_uint32_t *b, isc_uint32_t *c, isc_uint32_t *d,
+ isc_uint32_t *e, CHAR64LONG16 *block)
+{
+ nR4(a,b,c,d,e,60); nR4(e,a,b,c,d,61); nR4(d,e,a,b,c,62);
+ nR4(c,d,e,a,b,63); nR4(b,c,d,e,a,64); nR4(a,b,c,d,e,65);
+ nR4(e,a,b,c,d,66); nR4(d,e,a,b,c,67); nR4(c,d,e,a,b,68);
+ nR4(b,c,d,e,a,69); nR4(a,b,c,d,e,70); nR4(e,a,b,c,d,71);
+ nR4(d,e,a,b,c,72); nR4(c,d,e,a,b,73); nR4(b,c,d,e,a,74);
+ nR4(a,b,c,d,e,75); nR4(e,a,b,c,d,76); nR4(d,e,a,b,c,77);
+ nR4(c,d,e,a,b,78); nR4(b,c,d,e,a,79);
+}
+#endif
+
+/*!
+ * Hash a single 512-bit block. This is the core of the algorithm.
+ */
+static void
+transform(isc_uint32_t state[5], const unsigned char buffer[64]) {
+ isc_uint32_t a, b, c, d, e;
+ CHAR64LONG16 *block;
+ CHAR64LONG16 workspace;
+
+ INSIST(buffer != NULL);
+ INSIST(state != NULL);
+
+ block = &workspace;
+ (void)memcpy(block, buffer, 64);
+
+ /* Copy context->state[] to working vars */
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+ e = state[4];
+
+#ifdef __sparc_v9__
+ do_R01(&a, &b, &c, &d, &e, block);
+ do_R2(&a, &b, &c, &d, &e, block);
+ do_R3(&a, &b, &c, &d, &e, block);
+ do_R4(&a, &b, &c, &d, &e, block);
+#else
+ /* 4 rounds of 20 operations each. Loop unrolled. */
+ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
+ R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
+ R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
+ R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
+ R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
+ R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
+ R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
+ R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
+ R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
+ R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
+ R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
+ R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
+ R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
+ R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
+ R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
+ R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
+ R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
+ R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
+ R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
+ R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
+#endif
+
+ /* Add the working vars back into context.state[] */
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+ state[4] += e;
+
+ /* Wipe variables */
+ a = b = c = d = e = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e);
+}
+
+
+/*!
+ * isc_sha1_init - Initialize new context
+ */
+void
+isc_sha1_init(isc_sha1_t *context)
+{
+ INSIST(context != NULL);
+
+ /* SHA1 initialization constants */
+ context->state[0] = 0x67452301;
+ context->state[1] = 0xEFCDAB89;
+ context->state[2] = 0x98BADCFE;
+ context->state[3] = 0x10325476;
+ context->state[4] = 0xC3D2E1F0;
+ context->count[0] = 0;
+ context->count[1] = 0;
+}
+
+void
+isc_sha1_invalidate(isc_sha1_t *context) {
+ memset(context, 0, sizeof(isc_sha1_t));
+}
+
+/*!
+ * Run your data through this.
+ */
+void
+isc_sha1_update(isc_sha1_t *context, const unsigned char *data,
+ unsigned int len)
+{
+ unsigned int i, j;
+
+ INSIST(context != 0);
+ INSIST(data != 0);
+
+ j = context->count[0];
+ if ((context->count[0] += len << 3) < j)
+ context->count[1] += (len >> 29) + 1;
+ j = (j >> 3) & 63;
+ if ((j + len) > 63) {
+ (void)memcpy(&context->buffer[j], data, (i = 64 - j));
+ transform(context->state, context->buffer);
+ for (; i + 63 < len; i += 64)
+ transform(context->state, &data[i]);
+ j = 0;
+ } else {
+ i = 0;
+ }
+
+ (void)memcpy(&context->buffer[j], &data[i], len - i);
+}
+
+
+/*!
+ * Add padding and return the message digest.
+ */
+
+static const unsigned char final_200 = 128;
+static const unsigned char final_0 = 0;
+
+void
+isc_sha1_final(isc_sha1_t *context, unsigned char *digest) {
+ unsigned int i;
+ unsigned char finalcount[8];
+
+ INSIST(digest != 0);
+ INSIST(context != 0);
+
+ for (i = 0; i < 8; i++) {
+ /* Endian independent */
+ finalcount[i] = (unsigned char)
+ ((context->count[(i >= 4 ? 0 : 1)]
+ >> ((3 - (i & 3)) * 8)) & 255);
+ }
+
+ isc_sha1_update(context, &final_200, 1);
+ while ((context->count[0] & 504) != 448)
+ isc_sha1_update(context, &final_0, 1);
+ /* The next Update should cause a transform() */
+ isc_sha1_update(context, finalcount, 8);
+
+ if (digest) {
+ for (i = 0; i < 20; i++)
+ digest[i] = (unsigned char)
+ ((context->state[i >> 2]
+ >> ((3 - (i & 3)) * 8)) & 255);
+ }
+
+ memset(context, 0, sizeof(isc_sha1_t));
+}
+#endif
diff --git a/lib/isc/sha2.c b/lib/isc/sha2.c
new file mode 100644
index 0000000..db2e349
--- /dev/null
+++ b/lib/isc/sha2.c
@@ -0,0 +1,1449 @@
+/*
+ * Copyright (C) 2005-2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/* $FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.2.2.2 2002/03/05 08:36:47 ume Exp $ */
+/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */
+
+/*
+ * sha2.c
+ *
+ * Version 1.0.0beta1
+ *
+ * Written by Aaron D. Gifford <me@aarongifford.com>
+ *
+ * Copyright 2000 Aaron D. Gifford. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+
+#include <config.h>
+
+#include <isc/assertions.h>
+#include <isc/platform.h>
+#include <isc/sha2.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+#ifdef ISC_PLATFORM_OPENSSLHASH
+
+void
+isc_sha224_init(isc_sha224_t *context) {
+ if (context == (isc_sha224_t *)0) {
+ return;
+ }
+ EVP_DigestInit(context, EVP_sha224());
+}
+
+void
+isc_sha224_invalidate(isc_sha224_t *context) {
+ EVP_MD_CTX_cleanup(context);
+}
+
+void
+isc_sha224_update(isc_sha224_t *context, const isc_uint8_t* data, size_t len) {
+ if (len == 0U) {
+ /* Calling with no data is valid - we do nothing */
+ return;
+ }
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha224_t *)0 && data != (isc_uint8_t*)0);
+
+ EVP_DigestUpdate(context, (const void *) data, len);
+}
+
+void
+isc_sha224_final(isc_uint8_t digest[], isc_sha224_t *context) {
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha224_t *)0);
+
+ /* If no digest buffer is passed, we don't bother doing this: */
+ if (digest != (isc_uint8_t*)0) {
+ EVP_DigestFinal(context, digest, NULL);
+ } else {
+ EVP_MD_CTX_cleanup(context);
+ }
+}
+
+void
+isc_sha256_init(isc_sha256_t *context) {
+ if (context == (isc_sha256_t *)0) {
+ return;
+ }
+ EVP_DigestInit(context, EVP_sha256());
+}
+
+void
+isc_sha256_invalidate(isc_sha256_t *context) {
+ EVP_MD_CTX_cleanup(context);
+}
+
+void
+isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) {
+ if (len == 0U) {
+ /* Calling with no data is valid - we do nothing */
+ return;
+ }
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha256_t *)0 && data != (isc_uint8_t*)0);
+
+ EVP_DigestUpdate(context, (const void *) data, len);
+}
+
+void
+isc_sha256_final(isc_uint8_t digest[], isc_sha256_t *context) {
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha256_t *)0);
+
+ /* If no digest buffer is passed, we don't bother doing this: */
+ if (digest != (isc_uint8_t*)0) {
+ EVP_DigestFinal(context, digest, NULL);
+ } else {
+ EVP_MD_CTX_cleanup(context);
+ }
+}
+
+void
+isc_sha512_init(isc_sha512_t *context) {
+ if (context == (isc_sha512_t *)0) {
+ return;
+ }
+ EVP_DigestInit(context, EVP_sha512());
+}
+
+void
+isc_sha512_invalidate(isc_sha512_t *context) {
+ EVP_MD_CTX_cleanup(context);
+}
+
+void isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) {
+ if (len == 0U) {
+ /* Calling with no data is valid - we do nothing */
+ return;
+ }
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha512_t *)0 && data != (isc_uint8_t*)0);
+
+ EVP_DigestUpdate(context, (const void *) data, len);
+}
+
+void isc_sha512_final(isc_uint8_t digest[], isc_sha512_t *context) {
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha512_t *)0);
+
+ /* If no digest buffer is passed, we don't bother doing this: */
+ if (digest != (isc_uint8_t*)0) {
+ EVP_DigestFinal(context, digest, NULL);
+ } else {
+ EVP_MD_CTX_cleanup(context);
+ }
+}
+
+void
+isc_sha384_init(isc_sha384_t *context) {
+ if (context == (isc_sha384_t *)0) {
+ return;
+ }
+ EVP_DigestInit(context, EVP_sha384());
+}
+
+void
+isc_sha384_invalidate(isc_sha384_t *context) {
+ EVP_MD_CTX_cleanup(context);
+}
+
+void
+isc_sha384_update(isc_sha384_t *context, const isc_uint8_t* data, size_t len) {
+ if (len == 0U) {
+ /* Calling with no data is valid - we do nothing */
+ return;
+ }
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha512_t *)0 && data != (isc_uint8_t*)0);
+
+ EVP_DigestUpdate(context, (const void *) data, len);
+}
+
+void
+isc_sha384_final(isc_uint8_t digest[], isc_sha384_t *context) {
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha384_t *)0);
+
+ /* If no digest buffer is passed, we don't bother doing this: */
+ if (digest != (isc_uint8_t*)0) {
+ EVP_DigestFinal(context, digest, NULL);
+ } else {
+ EVP_MD_CTX_cleanup(context);
+ }
+}
+
+#else
+
+/*
+ * UNROLLED TRANSFORM LOOP NOTE:
+ * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform
+ * loop version for the hash transform rounds (defined using macros
+ * later in this file). Either define on the command line, for example:
+ *
+ * cc -DISC_SHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c
+ *
+ * or define below:
+ *
+ * \#define ISC_SHA2_UNROLL_TRANSFORM
+ *
+ */
+
+/*** SHA-256/384/512 Machine Architecture Definitions *****************/
+/*
+ * BYTE_ORDER NOTE:
+ *
+ * Please make sure that your system defines BYTE_ORDER. If your
+ * architecture is little-endian, make sure it also defines
+ * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are
+ * equivalent.
+ *
+ * If your system does not define the above, then you can do so by
+ * hand like this:
+ *
+ * \#define LITTLE_ENDIAN 1234
+ * \#define BIG_ENDIAN 4321
+ *
+ * And for little-endian machines, add:
+ *
+ * \#define BYTE_ORDER LITTLE_ENDIAN
+ *
+ * Or for big-endian machines:
+ *
+ * \#define BYTE_ORDER BIG_ENDIAN
+ *
+ * The FreeBSD machine this was written on defines BYTE_ORDER
+ * appropriately by including <sys/types.h> (which in turn includes
+ * <machine/endian.h> where the appropriate definitions are actually
+ * made).
+ */
+#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN)
+#ifndef BYTE_ORDER
+#ifndef BIG_ENDIAN
+#define BIG_ENDIAN 4321
+#endif
+#ifndef LITTLE_ENDIAN
+#define LITTLE_ENDIAN 1234
+#endif
+#ifdef WORDS_BIGENDIAN
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+#else
+#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN
+#endif
+#endif
+
+/*** SHA-256/384/512 Various Length Definitions ***********************/
+/* NOTE: Most of these are in sha2.h */
+#define ISC_SHA256_SHORT_BLOCK_LENGTH (ISC_SHA256_BLOCK_LENGTH - 8)
+#define ISC_SHA384_SHORT_BLOCK_LENGTH (ISC_SHA384_BLOCK_LENGTH - 16)
+#define ISC_SHA512_SHORT_BLOCK_LENGTH (ISC_SHA512_BLOCK_LENGTH - 16)
+
+
+/*** ENDIAN REVERSAL MACROS *******************************************/
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define REVERSE32(w,x) { \
+ isc_uint32_t tmp = (w); \
+ tmp = (tmp >> 16) | (tmp << 16); \
+ (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \
+}
+#ifdef WIN32
+#define REVERSE64(w,x) { \
+ isc_uint64_t tmp = (w); \
+ tmp = (tmp >> 32) | (tmp << 32); \
+ tmp = ((tmp & 0xff00ff00ff00ff00UL) >> 8) | \
+ ((tmp & 0x00ff00ff00ff00ffUL) << 8); \
+ (x) = ((tmp & 0xffff0000ffff0000UL) >> 16) | \
+ ((tmp & 0x0000ffff0000ffffUL) << 16); \
+}
+#else
+#define REVERSE64(w,x) { \
+ isc_uint64_t tmp = (w); \
+ tmp = (tmp >> 32) | (tmp << 32); \
+ tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \
+ ((tmp & 0x00ff00ff00ff00ffULL) << 8); \
+ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \
+ ((tmp & 0x0000ffff0000ffffULL) << 16); \
+}
+#endif
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+
+/*
+ * Macro for incrementally adding the unsigned 64-bit integer n to the
+ * unsigned 128-bit integer (represented using a two-element array of
+ * 64-bit words):
+ */
+#define ADDINC128(w,n) { \
+ (w)[0] += (isc_uint64_t)(n); \
+ if ((w)[0] < (n)) { \
+ (w)[1]++; \
+ } \
+}
+
+/*** THE SIX LOGICAL FUNCTIONS ****************************************/
+/*
+ * Bit shifting and rotation (used by the six SHA-XYZ logical functions:
+ *
+ * NOTE: The naming of R and S appears backwards here (R is a SHIFT and
+ * S is a ROTATION) because the SHA-256/384/512 description document
+ * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this
+ * same "backwards" definition.
+ */
+/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */
+#define R(b,x) ((x) >> (b))
+/* 32-bit Rotate-right (used in SHA-256): */
+#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b))))
+/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */
+#define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b))))
+
+/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */
+#define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
+#define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
+
+/* Four of six logical functions used in SHA-256: */
+#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x)))
+#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x)))
+#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x)))
+#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x)))
+
+/* Four of six logical functions used in SHA-384 and SHA-512: */
+#define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x)))
+#define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x)))
+#define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x)))
+#define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x)))
+
+/*** INTERNAL FUNCTION PROTOTYPES *************************************/
+/* NOTE: These should not be accessed directly from outside this
+ * library -- they are intended for private internal visibility/use
+ * only.
+ */
+void isc_sha512_last(isc_sha512_t *);
+void isc_sha256_transform(isc_sha256_t *, const isc_uint32_t*);
+void isc_sha512_transform(isc_sha512_t *, const isc_uint64_t*);
+
+
+/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/
+/* Hash constant words K for SHA-224 and SHA-256: */
+static const isc_uint32_t K256[64] = {
+ 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
+ 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
+ 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
+ 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
+ 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
+ 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
+ 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
+ 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
+ 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
+ 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
+ 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
+ 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
+ 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
+ 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
+ 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
+ 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
+};
+
+/* Initial hash value H for SHA-224: */
+static const isc_uint32_t sha224_initial_hash_value[8] = {
+ 0xc1059ed8UL,
+ 0x367cd507UL,
+ 0x3070dd17UL,
+ 0xf70e5939UL,
+ 0xffc00b31UL,
+ 0x68581511UL,
+ 0x64f98fa7UL,
+ 0xbefa4fa4UL
+};
+
+/* Initial hash value H for SHA-256: */
+static const isc_uint32_t sha256_initial_hash_value[8] = {
+ 0x6a09e667UL,
+ 0xbb67ae85UL,
+ 0x3c6ef372UL,
+ 0xa54ff53aUL,
+ 0x510e527fUL,
+ 0x9b05688cUL,
+ 0x1f83d9abUL,
+ 0x5be0cd19UL
+};
+
+#ifdef WIN32
+/* Hash constant words K for SHA-384 and SHA-512: */
+static const isc_uint64_t K512[80] = {
+ 0x428a2f98d728ae22UL, 0x7137449123ef65cdUL,
+ 0xb5c0fbcfec4d3b2fUL, 0xe9b5dba58189dbbcUL,
+ 0x3956c25bf348b538UL, 0x59f111f1b605d019UL,
+ 0x923f82a4af194f9bUL, 0xab1c5ed5da6d8118UL,
+ 0xd807aa98a3030242UL, 0x12835b0145706fbeUL,
+ 0x243185be4ee4b28cUL, 0x550c7dc3d5ffb4e2UL,
+ 0x72be5d74f27b896fUL, 0x80deb1fe3b1696b1UL,
+ 0x9bdc06a725c71235UL, 0xc19bf174cf692694UL,
+ 0xe49b69c19ef14ad2UL, 0xefbe4786384f25e3UL,
+ 0x0fc19dc68b8cd5b5UL, 0x240ca1cc77ac9c65UL,
+ 0x2de92c6f592b0275UL, 0x4a7484aa6ea6e483UL,
+ 0x5cb0a9dcbd41fbd4UL, 0x76f988da831153b5UL,
+ 0x983e5152ee66dfabUL, 0xa831c66d2db43210UL,
+ 0xb00327c898fb213fUL, 0xbf597fc7beef0ee4UL,
+ 0xc6e00bf33da88fc2UL, 0xd5a79147930aa725UL,
+ 0x06ca6351e003826fUL, 0x142929670a0e6e70UL,
+ 0x27b70a8546d22ffcUL, 0x2e1b21385c26c926UL,
+ 0x4d2c6dfc5ac42aedUL, 0x53380d139d95b3dfUL,
+ 0x650a73548baf63deUL, 0x766a0abb3c77b2a8UL,
+ 0x81c2c92e47edaee6UL, 0x92722c851482353bUL,
+ 0xa2bfe8a14cf10364UL, 0xa81a664bbc423001UL,
+ 0xc24b8b70d0f89791UL, 0xc76c51a30654be30UL,
+ 0xd192e819d6ef5218UL, 0xd69906245565a910UL,
+ 0xf40e35855771202aUL, 0x106aa07032bbd1b8UL,
+ 0x19a4c116b8d2d0c8UL, 0x1e376c085141ab53UL,
+ 0x2748774cdf8eeb99UL, 0x34b0bcb5e19b48a8UL,
+ 0x391c0cb3c5c95a63UL, 0x4ed8aa4ae3418acbUL,
+ 0x5b9cca4f7763e373UL, 0x682e6ff3d6b2b8a3UL,
+ 0x748f82ee5defb2fcUL, 0x78a5636f43172f60UL,
+ 0x84c87814a1f0ab72UL, 0x8cc702081a6439ecUL,
+ 0x90befffa23631e28UL, 0xa4506cebde82bde9UL,
+ 0xbef9a3f7b2c67915UL, 0xc67178f2e372532bUL,
+ 0xca273eceea26619cUL, 0xd186b8c721c0c207UL,
+ 0xeada7dd6cde0eb1eUL, 0xf57d4f7fee6ed178UL,
+ 0x06f067aa72176fbaUL, 0x0a637dc5a2c898a6UL,
+ 0x113f9804bef90daeUL, 0x1b710b35131c471bUL,
+ 0x28db77f523047d84UL, 0x32caab7b40c72493UL,
+ 0x3c9ebe0a15c9bebcUL, 0x431d67c49c100d4cUL,
+ 0x4cc5d4becb3e42b6UL, 0x597f299cfc657e2aUL,
+ 0x5fcb6fab3ad6faecUL, 0x6c44198c4a475817UL
+};
+
+/* Initial hash value H for SHA-384: */
+static const isc_uint64_t sha384_initial_hash_value[8] = {
+ 0xcbbb9d5dc1059ed8UL,
+ 0x629a292a367cd507UL,
+ 0x9159015a3070dd17UL,
+ 0x152fecd8f70e5939UL,
+ 0x67332667ffc00b31UL,
+ 0x8eb44a8768581511UL,
+ 0xdb0c2e0d64f98fa7UL,
+ 0x47b5481dbefa4fa4UL
+};
+
+/* Initial hash value H for SHA-512: */
+static const isc_uint64_t sha512_initial_hash_value[8] = {
+ 0x6a09e667f3bcc908U,
+ 0xbb67ae8584caa73bUL,
+ 0x3c6ef372fe94f82bUL,
+ 0xa54ff53a5f1d36f1UL,
+ 0x510e527fade682d1UL,
+ 0x9b05688c2b3e6c1fUL,
+ 0x1f83d9abfb41bd6bUL,
+ 0x5be0cd19137e2179UL
+};
+#else
+/* Hash constant words K for SHA-384 and SHA-512: */
+static const isc_uint64_t K512[80] = {
+ 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
+ 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL,
+ 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
+ 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL,
+ 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL,
+ 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
+ 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL,
+ 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL,
+ 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
+ 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL,
+ 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL,
+ 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
+ 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL,
+ 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL,
+ 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
+ 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL,
+ 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL,
+ 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
+ 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL,
+ 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL,
+ 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
+ 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL,
+ 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL,
+ 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
+ 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL,
+ 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL,
+ 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
+ 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL,
+ 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL,
+ 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
+ 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL,
+ 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL,
+ 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
+ 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL,
+ 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL,
+ 0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
+ 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL,
+ 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL,
+ 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
+ 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL
+};
+
+/* Initial hash value H for SHA-384: */
+static const isc_uint64_t sha384_initial_hash_value[8] = {
+ 0xcbbb9d5dc1059ed8ULL,
+ 0x629a292a367cd507ULL,
+ 0x9159015a3070dd17ULL,
+ 0x152fecd8f70e5939ULL,
+ 0x67332667ffc00b31ULL,
+ 0x8eb44a8768581511ULL,
+ 0xdb0c2e0d64f98fa7ULL,
+ 0x47b5481dbefa4fa4ULL
+};
+
+/* Initial hash value H for SHA-512: */
+static const isc_uint64_t sha512_initial_hash_value[8] = {
+ 0x6a09e667f3bcc908ULL,
+ 0xbb67ae8584caa73bULL,
+ 0x3c6ef372fe94f82bULL,
+ 0xa54ff53a5f1d36f1ULL,
+ 0x510e527fade682d1ULL,
+ 0x9b05688c2b3e6c1fULL,
+ 0x1f83d9abfb41bd6bULL,
+ 0x5be0cd19137e2179ULL
+};
+#endif
+
+
+/*** SHA-224: *********************************************************/
+void
+isc_sha224_init(isc_sha224_t *context) {
+ if (context == (isc_sha256_t *)0) {
+ return;
+ }
+ memcpy(context->state, sha224_initial_hash_value,
+ ISC_SHA256_DIGESTLENGTH);
+ memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH);
+ context->bitcount = 0;
+}
+
+void
+isc_sha224_invalidate(isc_sha224_t *context) {
+ memset(context, 0, sizeof(isc_sha224_t));
+}
+
+void
+isc_sha224_update(isc_sha224_t *context, const isc_uint8_t* data, size_t len) {
+ isc_sha256_update((isc_sha256_t *)context, data, len);
+}
+
+void
+isc_sha224_final(isc_uint8_t digest[], isc_sha224_t *context) {
+ isc_uint8_t sha256_digest[ISC_SHA256_DIGESTLENGTH];
+ isc_sha256_final(sha256_digest, (isc_sha256_t *)context);
+ memcpy(digest, sha256_digest, ISC_SHA224_DIGESTLENGTH);
+ memset(sha256_digest, 0, ISC_SHA256_DIGESTLENGTH);
+}
+
+/*** SHA-256: *********************************************************/
+void
+isc_sha256_init(isc_sha256_t *context) {
+ if (context == (isc_sha256_t *)0) {
+ return;
+ }
+ memcpy(context->state, sha256_initial_hash_value,
+ ISC_SHA256_DIGESTLENGTH);
+ memset(context->buffer, 0, ISC_SHA256_BLOCK_LENGTH);
+ context->bitcount = 0;
+}
+
+void
+isc_sha256_invalidate(isc_sha256_t *context) {
+ memset(context, 0, sizeof(isc_sha256_t));
+}
+
+#ifdef ISC_SHA2_UNROLL_TRANSFORM
+
+/* Unrolled SHA-256 round macros: */
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+
+#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \
+ REVERSE32(*data++, W256[j]); \
+ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
+ K256[j] + W256[j]; \
+ (d) += T1; \
+ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
+ j++
+
+
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \
+ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
+ K256[j] + (W256[j] = *data++); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
+ j++
+
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND256(a,b,c,d,e,f,g,h) \
+ s0 = W256[(j+1)&0x0f]; \
+ s0 = sigma0_256(s0); \
+ s1 = W256[(j+14)&0x0f]; \
+ s1 = sigma1_256(s1); \
+ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \
+ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
+ j++
+
+void isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) {
+ isc_uint32_t a, b, c, d, e, f, g, h, s0, s1;
+ isc_uint32_t T1, *W256;
+ int j;
+
+ W256 = (isc_uint32_t*)context->buffer;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = context->state[0];
+ b = context->state[1];
+ c = context->state[2];
+ d = context->state[3];
+ e = context->state[4];
+ f = context->state[5];
+ g = context->state[6];
+ h = context->state[7];
+
+ j = 0;
+ do {
+ /* Rounds 0 to 15 (unrolled): */
+ ROUND256_0_TO_15(a,b,c,d,e,f,g,h);
+ ROUND256_0_TO_15(h,a,b,c,d,e,f,g);
+ ROUND256_0_TO_15(g,h,a,b,c,d,e,f);
+ ROUND256_0_TO_15(f,g,h,a,b,c,d,e);
+ ROUND256_0_TO_15(e,f,g,h,a,b,c,d);
+ ROUND256_0_TO_15(d,e,f,g,h,a,b,c);
+ ROUND256_0_TO_15(c,d,e,f,g,h,a,b);
+ ROUND256_0_TO_15(b,c,d,e,f,g,h,a);
+ } while (j < 16);
+
+ /* Now for the remaining rounds to 64: */
+ do {
+ ROUND256(a,b,c,d,e,f,g,h);
+ ROUND256(h,a,b,c,d,e,f,g);
+ ROUND256(g,h,a,b,c,d,e,f);
+ ROUND256(f,g,h,a,b,c,d,e);
+ ROUND256(e,f,g,h,a,b,c,d);
+ ROUND256(d,e,f,g,h,a,b,c);
+ ROUND256(c,d,e,f,g,h,a,b);
+ ROUND256(b,c,d,e,f,g,h,a);
+ } while (j < 64);
+
+ /* Compute the current intermediate hash value */
+ context->state[0] += a;
+ context->state[1] += b;
+ context->state[2] += c;
+ context->state[3] += d;
+ context->state[4] += e;
+ context->state[5] += f;
+ context->state[6] += g;
+ context->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1);
+}
+
+#else /* ISC_SHA2_UNROLL_TRANSFORM */
+
+void
+isc_sha256_transform(isc_sha256_t *context, const isc_uint32_t* data) {
+ isc_uint32_t a, b, c, d, e, f, g, h, s0, s1;
+ isc_uint32_t T1, T2, *W256;
+ int j;
+
+ W256 = (isc_uint32_t*)context->buffer;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = context->state[0];
+ b = context->state[1];
+ c = context->state[2];
+ d = context->state[3];
+ e = context->state[4];
+ f = context->state[5];
+ g = context->state[6];
+ h = context->state[7];
+
+ j = 0;
+ do {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Copy data while converting to host byte order */
+ REVERSE32(*data++,W256[j]);
+ /* Apply the SHA-256 compression function to update a..h */
+ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j];
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+ /* Apply the SHA-256 compression function to update a..h with copy */
+ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+ T2 = Sigma0_256(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 16);
+
+ do {
+ /* Part of the message block expansion: */
+ s0 = W256[(j+1)&0x0f];
+ s0 = sigma0_256(s0);
+ s1 = W256[(j+14)&0x0f];
+ s1 = sigma1_256(s1);
+
+ /* Apply the SHA-256 compression function to update a..h */
+ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +
+ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
+ T2 = Sigma0_256(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 64);
+
+ /* Compute the current intermediate hash value */
+ context->state[0] += a;
+ context->state[1] += b;
+ context->state[2] += c;
+ context->state[3] += d;
+ context->state[4] += e;
+ context->state[5] += f;
+ context->state[6] += g;
+ context->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = T2 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1); POST(T2);
+}
+
+#endif /* ISC_SHA2_UNROLL_TRANSFORM */
+
+void
+isc_sha256_update(isc_sha256_t *context, const isc_uint8_t *data, size_t len) {
+ unsigned int freespace, usedspace;
+
+ if (len == 0U) {
+ /* Calling with no data is valid - we do nothing */
+ return;
+ }
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha256_t *)0 && data != (isc_uint8_t*)0);
+
+ usedspace = (unsigned int)((context->bitcount >> 3) %
+ ISC_SHA256_BLOCK_LENGTH);
+ if (usedspace > 0) {
+ /* Calculate how much free space is available in the buffer */
+ freespace = ISC_SHA256_BLOCK_LENGTH - usedspace;
+
+ if (len >= freespace) {
+ /* Fill the buffer completely and process it */
+ memcpy(&context->buffer[usedspace], data, freespace);
+ context->bitcount += freespace << 3;
+ len -= freespace;
+ data += freespace;
+ isc_sha256_transform(context,
+ (isc_uint32_t*)context->buffer);
+ } else {
+ /* The buffer is not yet full */
+ memcpy(&context->buffer[usedspace], data, len);
+ context->bitcount += len << 3;
+ /* Clean up: */
+ usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
+ return;
+ }
+ }
+ while (len >= ISC_SHA256_BLOCK_LENGTH) {
+ /* Process as many complete blocks as we can */
+ memcpy(context->buffer, data, ISC_SHA256_BLOCK_LENGTH);
+ isc_sha256_transform(context, (isc_uint32_t*)context->buffer);
+ context->bitcount += ISC_SHA256_BLOCK_LENGTH << 3;
+ len -= ISC_SHA256_BLOCK_LENGTH;
+ data += ISC_SHA256_BLOCK_LENGTH;
+ }
+ if (len > 0U) {
+ /* There's left-overs, so save 'em */
+ memcpy(context->buffer, data, len);
+ context->bitcount += len << 3;
+ }
+ /* Clean up: */
+ usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
+}
+
+void
+isc_sha256_final(isc_uint8_t digest[], isc_sha256_t *context) {
+ isc_uint32_t *d = (isc_uint32_t*)digest;
+ unsigned int usedspace;
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha256_t *)0);
+
+ /* If no digest buffer is passed, we don't bother doing this: */
+ if (digest != (isc_uint8_t*)0) {
+ usedspace = (unsigned int)((context->bitcount >> 3) %
+ ISC_SHA256_BLOCK_LENGTH);
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Convert FROM host byte order */
+ REVERSE64(context->bitcount,context->bitcount);
+#endif
+ if (usedspace > 0) {
+ /* Begin padding with a 1 bit: */
+ context->buffer[usedspace++] = 0x80;
+
+ if (usedspace <= ISC_SHA256_SHORT_BLOCK_LENGTH) {
+ /* Set-up for the last transform: */
+ memset(&context->buffer[usedspace], 0,
+ ISC_SHA256_SHORT_BLOCK_LENGTH - usedspace);
+ } else {
+ if (usedspace < ISC_SHA256_BLOCK_LENGTH) {
+ memset(&context->buffer[usedspace], 0,
+ ISC_SHA256_BLOCK_LENGTH -
+ usedspace);
+ }
+ /* Do second-to-last transform: */
+ isc_sha256_transform(context,
+ (isc_uint32_t*)context->buffer);
+
+ /* And set-up for the last transform: */
+ memset(context->buffer, 0,
+ ISC_SHA256_SHORT_BLOCK_LENGTH);
+ }
+ } else {
+ /* Set-up for the last transform: */
+ memset(context->buffer, 0, ISC_SHA256_SHORT_BLOCK_LENGTH);
+
+ /* Begin padding with a 1 bit: */
+ *context->buffer = 0x80;
+ }
+ /* Set the bit count: */
+ *(isc_uint64_t*)&context->buffer[ISC_SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
+
+ /* Final transform: */
+ isc_sha256_transform(context, (isc_uint32_t*)context->buffer);
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+ {
+ /* Convert TO host byte order */
+ int j;
+ for (j = 0; j < 8; j++) {
+ REVERSE32(context->state[j],context->state[j]);
+ *d++ = context->state[j];
+ }
+ }
+#else
+ memcpy(d, context->state, ISC_SHA256_DIGESTLENGTH);
+#endif
+ }
+
+ /* Clean up state data: */
+ memset(context, 0, sizeof(*context));
+ usedspace = 0;
+ POST(usedspace);
+}
+
+/*** SHA-512: *********************************************************/
+void
+isc_sha512_init(isc_sha512_t *context) {
+ if (context == (isc_sha512_t *)0) {
+ return;
+ }
+ memcpy(context->state, sha512_initial_hash_value,
+ ISC_SHA512_DIGESTLENGTH);
+ memset(context->buffer, 0, ISC_SHA512_BLOCK_LENGTH);
+ context->bitcount[0] = context->bitcount[1] = 0;
+}
+
+void
+isc_sha512_invalidate(isc_sha512_t *context) {
+ memset(context, 0, sizeof(isc_sha512_t));
+}
+
+#ifdef ISC_SHA2_UNROLL_TRANSFORM
+
+/* Unrolled SHA-512 round macros: */
+#if BYTE_ORDER == LITTLE_ENDIAN
+
+#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \
+ REVERSE64(*data++, W512[j]); \
+ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \
+ K512[j] + W512[j]; \
+ (d) += T1, \
+ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \
+ j++
+
+
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \
+ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \
+ K512[j] + (W512[j] = *data++); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \
+ j++
+
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+
+#define ROUND512(a,b,c,d,e,f,g,h) \
+ s0 = W512[(j+1)&0x0f]; \
+ s0 = sigma0_512(s0); \
+ s1 = W512[(j+14)&0x0f]; \
+ s1 = sigma1_512(s1); \
+ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \
+ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \
+ (d) += T1; \
+ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \
+ j++
+
+void isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) {
+ isc_uint64_t a, b, c, d, e, f, g, h, s0, s1;
+ isc_uint64_t T1, *W512 = (isc_uint64_t*)context->buffer;
+ int j;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = context->state[0];
+ b = context->state[1];
+ c = context->state[2];
+ d = context->state[3];
+ e = context->state[4];
+ f = context->state[5];
+ g = context->state[6];
+ h = context->state[7];
+
+ j = 0;
+ do {
+ ROUND512_0_TO_15(a,b,c,d,e,f,g,h);
+ ROUND512_0_TO_15(h,a,b,c,d,e,f,g);
+ ROUND512_0_TO_15(g,h,a,b,c,d,e,f);
+ ROUND512_0_TO_15(f,g,h,a,b,c,d,e);
+ ROUND512_0_TO_15(e,f,g,h,a,b,c,d);
+ ROUND512_0_TO_15(d,e,f,g,h,a,b,c);
+ ROUND512_0_TO_15(c,d,e,f,g,h,a,b);
+ ROUND512_0_TO_15(b,c,d,e,f,g,h,a);
+ } while (j < 16);
+
+ /* Now for the remaining rounds up to 79: */
+ do {
+ ROUND512(a,b,c,d,e,f,g,h);
+ ROUND512(h,a,b,c,d,e,f,g);
+ ROUND512(g,h,a,b,c,d,e,f);
+ ROUND512(f,g,h,a,b,c,d,e);
+ ROUND512(e,f,g,h,a,b,c,d);
+ ROUND512(d,e,f,g,h,a,b,c);
+ ROUND512(c,d,e,f,g,h,a,b);
+ ROUND512(b,c,d,e,f,g,h,a);
+ } while (j < 80);
+
+ /* Compute the current intermediate hash value */
+ context->state[0] += a;
+ context->state[1] += b;
+ context->state[2] += c;
+ context->state[3] += d;
+ context->state[4] += e;
+ context->state[5] += f;
+ context->state[6] += g;
+ context->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1);
+}
+
+#else /* ISC_SHA2_UNROLL_TRANSFORM */
+
+void
+isc_sha512_transform(isc_sha512_t *context, const isc_uint64_t* data) {
+ isc_uint64_t a, b, c, d, e, f, g, h, s0, s1;
+ isc_uint64_t T1, T2, *W512 = (isc_uint64_t*)context->buffer;
+ int j;
+
+ /* Initialize registers with the prev. intermediate value */
+ a = context->state[0];
+ b = context->state[1];
+ c = context->state[2];
+ d = context->state[3];
+ e = context->state[4];
+ f = context->state[5];
+ g = context->state[6];
+ h = context->state[7];
+
+ j = 0;
+ do {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Convert TO host byte order */
+ REVERSE64(*data++, W512[j]);
+ /* Apply the SHA-512 compression function to update a..h */
+ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j];
+#else /* BYTE_ORDER == LITTLE_ENDIAN */
+ /* Apply the SHA-512 compression function to update a..h with copy */
+ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
+#endif /* BYTE_ORDER == LITTLE_ENDIAN */
+ T2 = Sigma0_512(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 16);
+
+ do {
+ /* Part of the message block expansion: */
+ s0 = W512[(j+1)&0x0f];
+ s0 = sigma0_512(s0);
+ s1 = W512[(j+14)&0x0f];
+ s1 = sigma1_512(s1);
+
+ /* Apply the SHA-512 compression function to update a..h */
+ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] +
+ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0);
+ T2 = Sigma0_512(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + T1;
+ d = c;
+ c = b;
+ b = a;
+ a = T1 + T2;
+
+ j++;
+ } while (j < 80);
+
+ /* Compute the current intermediate hash value */
+ context->state[0] += a;
+ context->state[1] += b;
+ context->state[2] += c;
+ context->state[3] += d;
+ context->state[4] += e;
+ context->state[5] += f;
+ context->state[6] += g;
+ context->state[7] += h;
+
+ /* Clean up */
+ a = b = c = d = e = f = g = h = T1 = T2 = 0;
+ /* Avoid compiler warnings */
+ POST(a); POST(b); POST(c); POST(d); POST(e); POST(f);
+ POST(g); POST(h); POST(T1); POST(T2);
+}
+
+#endif /* ISC_SHA2_UNROLL_TRANSFORM */
+
+void isc_sha512_update(isc_sha512_t *context, const isc_uint8_t *data, size_t len) {
+ unsigned int freespace, usedspace;
+
+ if (len == 0U) {
+ /* Calling with no data is valid - we do nothing */
+ return;
+ }
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha512_t *)0 && data != (isc_uint8_t*)0);
+
+ usedspace = (unsigned int)((context->bitcount[0] >> 3) %
+ ISC_SHA512_BLOCK_LENGTH);
+ if (usedspace > 0) {
+ /* Calculate how much free space is available in the buffer */
+ freespace = ISC_SHA512_BLOCK_LENGTH - usedspace;
+
+ if (len >= freespace) {
+ /* Fill the buffer completely and process it */
+ memcpy(&context->buffer[usedspace], data, freespace);
+ ADDINC128(context->bitcount, freespace << 3);
+ len -= freespace;
+ data += freespace;
+ isc_sha512_transform(context,
+ (isc_uint64_t*)context->buffer);
+ } else {
+ /* The buffer is not yet full */
+ memcpy(&context->buffer[usedspace], data, len);
+ ADDINC128(context->bitcount, len << 3);
+ /* Clean up: */
+ usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
+ return;
+ }
+ }
+ while (len >= ISC_SHA512_BLOCK_LENGTH) {
+ /* Process as many complete blocks as we can */
+ memcpy(context->buffer, data, ISC_SHA512_BLOCK_LENGTH);
+ isc_sha512_transform(context, (isc_uint64_t*)context->buffer);
+ ADDINC128(context->bitcount, ISC_SHA512_BLOCK_LENGTH << 3);
+ len -= ISC_SHA512_BLOCK_LENGTH;
+ data += ISC_SHA512_BLOCK_LENGTH;
+ }
+ if (len > 0U) {
+ /* There's left-overs, so save 'em */
+ memcpy(context->buffer, data, len);
+ ADDINC128(context->bitcount, len << 3);
+ }
+ /* Clean up: */
+ usedspace = freespace = 0;
+ /* Avoid compiler warnings: */
+ POST(usedspace); POST(freespace);
+}
+
+void isc_sha512_last(isc_sha512_t *context) {
+ unsigned int usedspace;
+
+ usedspace = (unsigned int)((context->bitcount[0] >> 3) %
+ ISC_SHA512_BLOCK_LENGTH);
+#if BYTE_ORDER == LITTLE_ENDIAN
+ /* Convert FROM host byte order */
+ REVERSE64(context->bitcount[0],context->bitcount[0]);
+ REVERSE64(context->bitcount[1],context->bitcount[1]);
+#endif
+ if (usedspace > 0) {
+ /* Begin padding with a 1 bit: */
+ context->buffer[usedspace++] = 0x80;
+
+ if (usedspace <= ISC_SHA512_SHORT_BLOCK_LENGTH) {
+ /* Set-up for the last transform: */
+ memset(&context->buffer[usedspace], 0,
+ ISC_SHA512_SHORT_BLOCK_LENGTH - usedspace);
+ } else {
+ if (usedspace < ISC_SHA512_BLOCK_LENGTH) {
+ memset(&context->buffer[usedspace], 0,
+ ISC_SHA512_BLOCK_LENGTH - usedspace);
+ }
+ /* Do second-to-last transform: */
+ isc_sha512_transform(context,
+ (isc_uint64_t*)context->buffer);
+
+ /* And set-up for the last transform: */
+ memset(context->buffer, 0, ISC_SHA512_BLOCK_LENGTH - 2);
+ }
+ } else {
+ /* Prepare for final transform: */
+ memset(context->buffer, 0, ISC_SHA512_SHORT_BLOCK_LENGTH);
+
+ /* Begin padding with a 1 bit: */
+ *context->buffer = 0x80;
+ }
+ /* Store the length of input data (in bits): */
+ *(isc_uint64_t*)&context->buffer[ISC_SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1];
+ *(isc_uint64_t*)&context->buffer[ISC_SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0];
+
+ /* Final transform: */
+ isc_sha512_transform(context, (isc_uint64_t*)context->buffer);
+}
+
+void isc_sha512_final(isc_uint8_t digest[], isc_sha512_t *context) {
+ isc_uint64_t *d = (isc_uint64_t*)digest;
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha512_t *)0);
+
+ /* If no digest buffer is passed, we don't bother doing this: */
+ if (digest != (isc_uint8_t*)0) {
+ isc_sha512_last(context);
+
+ /* Save the hash data for output: */
+#if BYTE_ORDER == LITTLE_ENDIAN
+ {
+ /* Convert TO host byte order */
+ int j;
+ for (j = 0; j < 8; j++) {
+ REVERSE64(context->state[j],context->state[j]);
+ *d++ = context->state[j];
+ }
+ }
+#else
+ memcpy(d, context->state, ISC_SHA512_DIGESTLENGTH);
+#endif
+ }
+
+ /* Zero out state data */
+ memset(context, 0, sizeof(*context));
+}
+
+
+/*** SHA-384: *********************************************************/
+void
+isc_sha384_init(isc_sha384_t *context) {
+ if (context == (isc_sha384_t *)0) {
+ return;
+ }
+ memcpy(context->state, sha384_initial_hash_value,
+ ISC_SHA512_DIGESTLENGTH);
+ memset(context->buffer, 0, ISC_SHA384_BLOCK_LENGTH);
+ context->bitcount[0] = context->bitcount[1] = 0;
+}
+
+void
+isc_sha384_invalidate(isc_sha384_t *context) {
+ memset(context, 0, sizeof(isc_sha384_t));
+}
+
+void
+isc_sha384_update(isc_sha384_t *context, const isc_uint8_t* data, size_t len) {
+ isc_sha512_update((isc_sha512_t *)context, data, len);
+}
+
+void
+isc_sha384_final(isc_uint8_t digest[], isc_sha384_t *context) {
+ isc_uint64_t *d = (isc_uint64_t*)digest;
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha384_t *)0);
+
+ /* If no digest buffer is passed, we don't bother doing this: */
+ if (digest != (isc_uint8_t*)0) {
+ isc_sha512_last((isc_sha512_t *)context);
+
+ /* Save the hash data for output: */
+#if BYTE_ORDER == LITTLE_ENDIAN
+ {
+ /* Convert TO host byte order */
+ int j;
+ for (j = 0; j < 6; j++) {
+ REVERSE64(context->state[j],context->state[j]);
+ *d++ = context->state[j];
+ }
+ }
+#else
+ memcpy(d, context->state, ISC_SHA384_DIGESTLENGTH);
+#endif
+ }
+
+ /* Zero out state data */
+ memset(context, 0, sizeof(*context));
+}
+#endif /* !ISC_PLATFORM_OPENSSLHASH */
+
+/*
+ * Constant used by SHA256/384/512_End() functions for converting the
+ * digest to a readable hexadecimal character string:
+ */
+static const char *sha2_hex_digits = "0123456789abcdef";
+
+char *
+isc_sha224_end(isc_sha224_t *context, char buffer[]) {
+ isc_uint8_t digest[ISC_SHA224_DIGESTLENGTH], *d = digest;
+ unsigned int i;
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha224_t *)0);
+
+ if (buffer != (char*)0) {
+ isc_sha224_final(digest, context);
+
+ for (i = 0; i < ISC_SHA224_DIGESTLENGTH; i++) {
+ *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
+ *buffer++ = sha2_hex_digits[*d & 0x0f];
+ d++;
+ }
+ *buffer = (char)0;
+ } else {
+#ifdef ISC_PLATFORM_OPENSSLHASH
+ EVP_MD_CTX_cleanup(context);
+#else
+ memset(context, 0, sizeof(*context));
+#endif
+ }
+ memset(digest, 0, ISC_SHA224_DIGESTLENGTH);
+ return buffer;
+}
+
+char *
+isc_sha224_data(const isc_uint8_t *data, size_t len,
+ char digest[ISC_SHA224_DIGESTSTRINGLENGTH])
+{
+ isc_sha224_t context;
+
+ isc_sha224_init(&context);
+ isc_sha224_update(&context, data, len);
+ return (isc_sha224_end(&context, digest));
+}
+
+char *
+isc_sha256_end(isc_sha256_t *context, char buffer[]) {
+ isc_uint8_t digest[ISC_SHA256_DIGESTLENGTH], *d = digest;
+ unsigned int i;
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha256_t *)0);
+
+ if (buffer != (char*)0) {
+ isc_sha256_final(digest, context);
+
+ for (i = 0; i < ISC_SHA256_DIGESTLENGTH; i++) {
+ *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
+ *buffer++ = sha2_hex_digits[*d & 0x0f];
+ d++;
+ }
+ *buffer = (char)0;
+ } else {
+#ifdef ISC_PLATFORM_OPENSSLHASH
+ EVP_MD_CTX_cleanup(context);
+#else
+ memset(context, 0, sizeof(*context));
+#endif
+ }
+ memset(digest, 0, ISC_SHA256_DIGESTLENGTH);
+ return buffer;
+}
+
+char *
+isc_sha256_data(const isc_uint8_t* data, size_t len,
+ char digest[ISC_SHA256_DIGESTSTRINGLENGTH])
+{
+ isc_sha256_t context;
+
+ isc_sha256_init(&context);
+ isc_sha256_update(&context, data, len);
+ return (isc_sha256_end(&context, digest));
+}
+
+char *
+isc_sha512_end(isc_sha512_t *context, char buffer[]) {
+ isc_uint8_t digest[ISC_SHA512_DIGESTLENGTH], *d = digest;
+ unsigned int i;
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha512_t *)0);
+
+ if (buffer != (char*)0) {
+ isc_sha512_final(digest, context);
+
+ for (i = 0; i < ISC_SHA512_DIGESTLENGTH; i++) {
+ *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
+ *buffer++ = sha2_hex_digits[*d & 0x0f];
+ d++;
+ }
+ *buffer = (char)0;
+ } else {
+#ifdef ISC_PLATFORM_OPENSSLHASH
+ EVP_MD_CTX_cleanup(context);
+#else
+ memset(context, 0, sizeof(*context));
+#endif
+ }
+ memset(digest, 0, ISC_SHA512_DIGESTLENGTH);
+ return buffer;
+}
+
+char *
+isc_sha512_data(const isc_uint8_t *data, size_t len,
+ char digest[ISC_SHA512_DIGESTSTRINGLENGTH])
+{
+ isc_sha512_t context;
+
+ isc_sha512_init(&context);
+ isc_sha512_update(&context, data, len);
+ return (isc_sha512_end(&context, digest));
+}
+
+char *
+isc_sha384_end(isc_sha384_t *context, char buffer[]) {
+ isc_uint8_t digest[ISC_SHA384_DIGESTLENGTH], *d = digest;
+ unsigned int i;
+
+ /* Sanity check: */
+ REQUIRE(context != (isc_sha384_t *)0);
+
+ if (buffer != (char*)0) {
+ isc_sha384_final(digest, context);
+
+ for (i = 0; i < ISC_SHA384_DIGESTLENGTH; i++) {
+ *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
+ *buffer++ = sha2_hex_digits[*d & 0x0f];
+ d++;
+ }
+ *buffer = (char)0;
+ } else {
+#ifdef ISC_PLATFORM_OPENSSLHASH
+ EVP_MD_CTX_cleanup(context);
+#else
+ memset(context, 0, sizeof(*context));
+#endif
+ }
+ memset(digest, 0, ISC_SHA384_DIGESTLENGTH);
+ return buffer;
+}
+
+char *
+isc_sha384_data(const isc_uint8_t *data, size_t len,
+ char digest[ISC_SHA384_DIGESTSTRINGLENGTH])
+{
+ isc_sha384_t context;
+
+ isc_sha384_init(&context);
+ isc_sha384_update(&context, data, len);
+ return (isc_sha384_end(&context, digest));
+}
diff --git a/lib/isc/sockaddr.c b/lib/isc/sockaddr.c
new file mode 100644
index 0000000..2a7268f
--- /dev/null
+++ b/lib/isc/sockaddr.c
@@ -0,0 +1,506 @@
+/*
+ * Copyright (C) 2004-2007, 2010-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <isc/buffer.h>
+#include <isc/hash.h>
+#include <isc/msgs.h>
+#include <isc/netaddr.h>
+#include <isc/print.h>
+#include <isc/region.h>
+#include <isc/sockaddr.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+isc_boolean_t
+isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b) {
+ return (isc_sockaddr_compare(a, b, ISC_SOCKADDR_CMPADDR|
+ ISC_SOCKADDR_CMPPORT|
+ ISC_SOCKADDR_CMPSCOPE));
+}
+
+isc_boolean_t
+isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b) {
+ return (isc_sockaddr_compare(a, b, ISC_SOCKADDR_CMPADDR|
+ ISC_SOCKADDR_CMPSCOPE));
+}
+
+isc_boolean_t
+isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
+ unsigned int flags)
+{
+ REQUIRE(a != NULL && b != NULL);
+
+ if (a->length != b->length)
+ return (ISC_FALSE);
+
+ /*
+ * We don't just memcmp because the sin_zero field isn't always
+ * zero.
+ */
+
+ if (a->type.sa.sa_family != b->type.sa.sa_family)
+ return (ISC_FALSE);
+ switch (a->type.sa.sa_family) {
+ case AF_INET:
+ if ((flags & ISC_SOCKADDR_CMPADDR) != 0 &&
+ memcmp(&a->type.sin.sin_addr, &b->type.sin.sin_addr,
+ sizeof(a->type.sin.sin_addr)) != 0)
+ return (ISC_FALSE);
+ if ((flags & ISC_SOCKADDR_CMPPORT) != 0 &&
+ a->type.sin.sin_port != b->type.sin.sin_port)
+ return (ISC_FALSE);
+ break;
+ case AF_INET6:
+ if ((flags & ISC_SOCKADDR_CMPADDR) != 0 &&
+ memcmp(&a->type.sin6.sin6_addr, &b->type.sin6.sin6_addr,
+ sizeof(a->type.sin6.sin6_addr)) != 0)
+ return (ISC_FALSE);
+#ifdef ISC_PLATFORM_HAVESCOPEID
+ /*
+ * If ISC_SOCKADDR_CMPSCOPEZERO is set then don't return
+ * ISC_FALSE if one of the scopes in zero.
+ */
+ if ((flags & ISC_SOCKADDR_CMPSCOPE) != 0 &&
+ a->type.sin6.sin6_scope_id != b->type.sin6.sin6_scope_id &&
+ ((flags & ISC_SOCKADDR_CMPSCOPEZERO) == 0 ||
+ (a->type.sin6.sin6_scope_id != 0 &&
+ b->type.sin6.sin6_scope_id != 0)))
+ return (ISC_FALSE);
+#endif
+ if ((flags & ISC_SOCKADDR_CMPPORT) != 0 &&
+ a->type.sin6.sin6_port != b->type.sin6.sin6_port)
+ return (ISC_FALSE);
+ break;
+ default:
+ if (memcmp(&a->type, &b->type, a->length) != 0)
+ return (ISC_FALSE);
+ }
+ return (ISC_TRUE);
+}
+
+isc_boolean_t
+isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
+ unsigned int prefixlen)
+{
+ isc_netaddr_t na, nb;
+ isc_netaddr_fromsockaddr(&na, a);
+ isc_netaddr_fromsockaddr(&nb, b);
+ return (isc_netaddr_eqprefix(&na, &nb, prefixlen));
+}
+
+isc_result_t
+isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target) {
+ isc_result_t result;
+ isc_netaddr_t netaddr;
+ char pbuf[sizeof("65000")];
+ unsigned int plen;
+ isc_region_t avail;
+
+ REQUIRE(sockaddr != NULL);
+
+ /*
+ * Do the port first, giving us the opportunity to check for
+ * unsupported address families before calling
+ * isc_netaddr_fromsockaddr().
+ */
+ switch (sockaddr->type.sa.sa_family) {
+ case AF_INET:
+ snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin.sin_port));
+ break;
+ case AF_INET6:
+ snprintf(pbuf, sizeof(pbuf), "%u", ntohs(sockaddr->type.sin6.sin6_port));
+ break;
+#ifdef ISC_PLAFORM_HAVESYSUNH
+ case AF_UNIX:
+ plen = strlen(sockaddr->type.sunix.sun_path);
+ if (plen >= isc_buffer_availablelength(target))
+ return (ISC_R_NOSPACE);
+
+ isc_buffer_putmem(target, sockaddr->type.sunix.sun_path, plen);
+
+ /*
+ * Null terminate after used region.
+ */
+ isc_buffer_availableregion(target, &avail);
+ INSIST(avail.length >= 1);
+ avail.base[0] = '\0';
+
+ return (ISC_R_SUCCESS);
+#endif
+ default:
+ return (ISC_R_FAILURE);
+ }
+
+ plen = strlen(pbuf);
+ INSIST(plen < sizeof(pbuf));
+
+ isc_netaddr_fromsockaddr(&netaddr, sockaddr);
+ result = isc_netaddr_totext(&netaddr, target);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ if (1 + plen + 1 > isc_buffer_availablelength(target))
+ return (ISC_R_NOSPACE);
+
+ isc_buffer_putmem(target, (const unsigned char *)"#", 1);
+ isc_buffer_putmem(target, (const unsigned char *)pbuf, plen);
+
+ /*
+ * Null terminate after used region.
+ */
+ isc_buffer_availableregion(target, &avail);
+ INSIST(avail.length >= 1);
+ avail.base[0] = '\0';
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size) {
+ isc_result_t result;
+ isc_buffer_t buf;
+
+ if (size == 0U)
+ return;
+
+ isc_buffer_init(&buf, array, size);
+ result = isc_sockaddr_totext(sa, &buf);
+ if (result != ISC_R_SUCCESS) {
+ /*
+ * The message is the same as in netaddr.c.
+ */
+ snprintf(array, size,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_NETADDR,
+ ISC_MSG_UNKNOWNADDR,
+ "<unknown address, family %u>"),
+ sa->type.sa.sa_family);
+ array[size - 1] = '\0';
+ }
+}
+
+unsigned int
+isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only) {
+ unsigned int length = 0;
+ const unsigned char *s = NULL;
+ unsigned int h = 0;
+ unsigned int g;
+ unsigned int p = 0;
+ const struct in6_addr *in6;
+
+ REQUIRE(sockaddr != NULL);
+
+ switch (sockaddr->type.sa.sa_family) {
+ case AF_INET:
+ s = (const unsigned char *)&sockaddr->type.sin.sin_addr;
+ p = ntohs(sockaddr->type.sin.sin_port);
+ length = sizeof(sockaddr->type.sin.sin_addr.s_addr);
+ break;
+ case AF_INET6:
+ in6 = &sockaddr->type.sin6.sin6_addr;
+ if (IN6_IS_ADDR_V4MAPPED(in6)) {
+ s = (const unsigned char *)&in6 + 12;
+ length = sizeof(sockaddr->type.sin.sin_addr.s_addr);
+ } else {
+ s = (const unsigned char *)in6;
+ length = sizeof(sockaddr->type.sin6.sin6_addr);
+ }
+ p = ntohs(sockaddr->type.sin6.sin6_port);
+ break;
+ default:
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_SOCKADDR,
+ ISC_MSG_UNKNOWNFAMILY,
+ "unknown address family: %d"),
+ (int)sockaddr->type.sa.sa_family);
+ s = (const unsigned char *)&sockaddr->type;
+ length = sockaddr->length;
+ p = 0;
+ }
+
+ h = isc_hash_calc(s, length, ISC_TRUE);
+ if (!address_only) {
+ g = isc_hash_calc((const unsigned char *)&p, sizeof(p),
+ ISC_TRUE);
+ h = h ^ g; /* XXX: we should concatenate h and p first */
+ }
+
+ return (h);
+}
+
+void
+isc_sockaddr_any(isc_sockaddr_t *sockaddr)
+{
+ memset(sockaddr, 0, sizeof(*sockaddr));
+ sockaddr->type.sin.sin_family = AF_INET;
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sin.sin_len = sizeof(sockaddr->type.sin);
+#endif
+ sockaddr->type.sin.sin_addr.s_addr = INADDR_ANY;
+ sockaddr->type.sin.sin_port = 0;
+ sockaddr->length = sizeof(sockaddr->type.sin);
+ ISC_LINK_INIT(sockaddr, link);
+}
+
+void
+isc_sockaddr_any6(isc_sockaddr_t *sockaddr)
+{
+ memset(sockaddr, 0, sizeof(*sockaddr));
+ sockaddr->type.sin6.sin6_family = AF_INET6;
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6);
+#endif
+ sockaddr->type.sin6.sin6_addr = in6addr_any;
+ sockaddr->type.sin6.sin6_port = 0;
+ sockaddr->length = sizeof(sockaddr->type.sin6);
+ ISC_LINK_INIT(sockaddr, link);
+}
+
+void
+isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
+ in_port_t port)
+{
+ memset(sockaddr, 0, sizeof(*sockaddr));
+ sockaddr->type.sin.sin_family = AF_INET;
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sin.sin_len = sizeof(sockaddr->type.sin);
+#endif
+ sockaddr->type.sin.sin_addr = *ina;
+ sockaddr->type.sin.sin_port = htons(port);
+ sockaddr->length = sizeof(sockaddr->type.sin);
+ ISC_LINK_INIT(sockaddr, link);
+}
+
+void
+isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int pf) {
+ switch (pf) {
+ case AF_INET:
+ isc_sockaddr_any(sockaddr);
+ break;
+ case AF_INET6:
+ isc_sockaddr_any6(sockaddr);
+ break;
+ default:
+ INSIST(0);
+ }
+}
+
+void
+isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6,
+ in_port_t port)
+{
+ memset(sockaddr, 0, sizeof(*sockaddr));
+ sockaddr->type.sin6.sin6_family = AF_INET6;
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6);
+#endif
+ sockaddr->type.sin6.sin6_addr = *ina6;
+ sockaddr->type.sin6.sin6_port = htons(port);
+ sockaddr->length = sizeof(sockaddr->type.sin6);
+ ISC_LINK_INIT(sockaddr, link);
+}
+
+void
+isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
+ in_port_t port)
+{
+ memset(sockaddr, 0, sizeof(*sockaddr));
+ sockaddr->type.sin6.sin6_family = AF_INET6;
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6);
+#endif
+ sockaddr->type.sin6.sin6_addr.s6_addr[10] = 0xff;
+ sockaddr->type.sin6.sin6_addr.s6_addr[11] = 0xff;
+ memcpy(&sockaddr->type.sin6.sin6_addr.s6_addr[12], ina, 4);
+ sockaddr->type.sin6.sin6_port = htons(port);
+ sockaddr->length = sizeof(sockaddr->type.sin6);
+ ISC_LINK_INIT(sockaddr, link);
+}
+
+int
+isc_sockaddr_pf(const isc_sockaddr_t *sockaddr) {
+
+ /*
+ * Get the protocol family of 'sockaddr'.
+ */
+
+#if (AF_INET == PF_INET && AF_INET6 == PF_INET6)
+ /*
+ * Assume that PF_xxx == AF_xxx for all AF and PF.
+ */
+ return (sockaddr->type.sa.sa_family);
+#else
+ switch (sockaddr->type.sa.sa_family) {
+ case AF_INET:
+ return (PF_INET);
+ case AF_INET6:
+ return (PF_INET6);
+ default:
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
+ ISC_MSG_UNKNOWNFAMILY,
+ "unknown address family: %d"),
+ (int)sockaddr->type.sa.sa_family);
+ }
+#endif
+}
+
+void
+isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
+ in_port_t port)
+{
+ memset(sockaddr, 0, sizeof(*sockaddr));
+ sockaddr->type.sin.sin_family = (short)na->family;
+ switch (na->family) {
+ case AF_INET:
+ sockaddr->length = sizeof(sockaddr->type.sin);
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sin.sin_len = sizeof(sockaddr->type.sin);
+#endif
+ sockaddr->type.sin.sin_addr = na->type.in;
+ sockaddr->type.sin.sin_port = htons(port);
+ break;
+ case AF_INET6:
+ sockaddr->length = sizeof(sockaddr->type.sin6);
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6);
+#endif
+ memcpy(&sockaddr->type.sin6.sin6_addr, &na->type.in6, 16);
+#ifdef ISC_PLATFORM_HAVESCOPEID
+ sockaddr->type.sin6.sin6_scope_id = isc_netaddr_getzone(na);
+#endif
+ sockaddr->type.sin6.sin6_port = htons(port);
+ break;
+ default:
+ INSIST(0);
+ }
+ ISC_LINK_INIT(sockaddr, link);
+}
+
+void
+isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port) {
+ switch (sockaddr->type.sa.sa_family) {
+ case AF_INET:
+ sockaddr->type.sin.sin_port = htons(port);
+ break;
+ case AF_INET6:
+ sockaddr->type.sin6.sin6_port = htons(port);
+ break;
+ default:
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
+ ISC_MSG_UNKNOWNFAMILY,
+ "unknown address family: %d"),
+ (int)sockaddr->type.sa.sa_family);
+ }
+}
+
+in_port_t
+isc_sockaddr_getport(const isc_sockaddr_t *sockaddr) {
+ in_port_t port = 0;
+
+ switch (sockaddr->type.sa.sa_family) {
+ case AF_INET:
+ port = ntohs(sockaddr->type.sin.sin_port);
+ break;
+ case AF_INET6:
+ port = ntohs(sockaddr->type.sin6.sin6_port);
+ break;
+ default:
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
+ ISC_MSG_UNKNOWNFAMILY,
+ "unknown address family: %d"),
+ (int)sockaddr->type.sa.sa_family);
+ }
+
+ return (port);
+}
+
+isc_boolean_t
+isc_sockaddr_ismulticast(const isc_sockaddr_t *sockaddr) {
+ isc_netaddr_t netaddr;
+
+ if (sockaddr->type.sa.sa_family == AF_INET ||
+ sockaddr->type.sa.sa_family == AF_INET6) {
+ isc_netaddr_fromsockaddr(&netaddr, sockaddr);
+ return (isc_netaddr_ismulticast(&netaddr));
+ }
+ return (ISC_FALSE);
+}
+
+isc_boolean_t
+isc_sockaddr_isexperimental(const isc_sockaddr_t *sockaddr) {
+ isc_netaddr_t netaddr;
+
+ if (sockaddr->type.sa.sa_family == AF_INET) {
+ isc_netaddr_fromsockaddr(&netaddr, sockaddr);
+ return (isc_netaddr_isexperimental(&netaddr));
+ }
+ return (ISC_FALSE);
+}
+
+isc_boolean_t
+isc_sockaddr_issitelocal(const isc_sockaddr_t *sockaddr) {
+ isc_netaddr_t netaddr;
+
+ if (sockaddr->type.sa.sa_family == AF_INET6) {
+ isc_netaddr_fromsockaddr(&netaddr, sockaddr);
+ return (isc_netaddr_issitelocal(&netaddr));
+ }
+ return (ISC_FALSE);
+}
+
+isc_boolean_t
+isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) {
+ isc_netaddr_t netaddr;
+
+ if (sockaddr->type.sa.sa_family == AF_INET6) {
+ isc_netaddr_fromsockaddr(&netaddr, sockaddr);
+ return (isc_netaddr_islinklocal(&netaddr));
+ }
+ return (ISC_FALSE);
+}
+
+isc_result_t
+isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path) {
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ if (strlen(path) >= sizeof(sockaddr->type.sunix.sun_path))
+ return (ISC_R_NOSPACE);
+ memset(sockaddr, 0, sizeof(*sockaddr));
+ sockaddr->length = sizeof(sockaddr->type.sunix);
+ sockaddr->type.sunix.sun_family = AF_UNIX;
+#ifdef ISC_PLATFORM_HAVESALEN
+ sockaddr->type.sunix.sun_len =
+ (unsigned char)sizeof(sockaddr->type.sunix);
+#endif
+ strcpy(sockaddr->type.sunix.sun_path, path);
+ return (ISC_R_SUCCESS);
+#else
+ UNUSED(sockaddr);
+ UNUSED(path);
+ return (ISC_R_NOTIMPLEMENTED);
+#endif
+}
diff --git a/lib/isc/socket_api.c b/lib/isc/socket_api.c
new file mode 100644
index 0000000..3394ce0
--- /dev/null
+++ b/lib/isc/socket_api.c
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#include <config.h>
+
+#include <isc/app.h>
+#include <isc/magic.h>
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/socket.h>
+#include <isc/util.h>
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_socketmgrcreatefunc_t socketmgr_createfunc = NULL;
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_socket_register(isc_socketmgrcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (socketmgr_createfunc == NULL)
+ socketmgr_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_socketmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ isc_socketmgr_t **managerp)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(socketmgr_createfunc != NULL);
+ result = (*socketmgr_createfunc)(mctx, managerp);
+
+ UNLOCK(&createlock);
+
+ if (result == ISC_R_SUCCESS)
+ isc_appctx_setsocketmgr(actx, *managerp);
+
+ return (result);
+}
+
+isc_result_t
+isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) {
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(socketmgr_createfunc != NULL);
+ result = (*socketmgr_createfunc)(mctx, managerp);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
+ REQUIRE(managerp != NULL && ISCAPI_SOCKETMGR_VALID(*managerp));
+
+ (*managerp)->methods->destroy(managerp);
+
+ ENSURE(*managerp == NULL);
+}
+
+isc_result_t
+isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
+ isc_socket_t **socketp)
+{
+ REQUIRE(ISCAPI_SOCKETMGR_VALID(manager));
+
+ return (manager->methods->socketcreate(manager, pf, type, socketp));
+}
+
+void
+isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp) {
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+
+ sock->methods->attach(sock, socketp);
+
+ ENSURE(*socketp == sock);
+}
+
+void
+isc_socket_detach(isc_socket_t **socketp) {
+ REQUIRE(socketp != NULL && ISCAPI_SOCKET_VALID(*socketp));
+
+ (*socketp)->methods->detach(socketp);
+
+ ENSURE(*socketp == NULL);
+}
+
+isc_result_t
+isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
+ unsigned int options)
+{
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return (sock->methods->bind(sock, sockaddr, options));
+}
+
+isc_result_t
+isc_socket_sendto(isc_socket_t *sock, isc_region_t *region, isc_task_t *task,
+ isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
+{
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return (sock->methods->sendto(sock, region, task, action, arg, address,
+ pktinfo));
+}
+
+isc_result_t
+isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, isc_task_t *task,
+ isc_taskaction_t action, const void *arg)
+{
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return (sock->methods->connect(sock, addr, task, action, arg));
+}
+
+isc_result_t
+isc_socket_recv(isc_socket_t *sock, isc_region_t *region, unsigned int minimum,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return (sock->methods->recv(sock, region, minimum, task, action, arg));
+}
+
+void
+isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) {
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ sock->methods->cancel(sock, task, how);
+}
+
+isc_result_t
+isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) {
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return (sock->methods->getsockname(sock, addressp));
+}
+
+void
+isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes) {
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ sock->methods->ipv6only(sock, yes);
+}
+
+isc_sockettype_t
+isc_socket_gettype(isc_socket_t *sock) {
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return (sock->methods->gettype(sock));
+}
+
+void
+isc_socket_setname(isc_socket_t *socket, const char *name, void *tag) {
+ REQUIRE(ISCAPI_SOCKET_VALID(socket));
+
+ UNUSED(socket); /* in case REQUIRE() is empty */
+ UNUSED(name);
+ UNUSED(tag);
+}
+
+isc_result_t
+isc_socket_fdwatchcreate(isc_socketmgr_t *manager, int fd, int flags,
+ isc_sockfdwatch_t callback, void *cbarg,
+ isc_task_t *task, isc_socket_t **socketp)
+{
+ REQUIRE(ISCAPI_SOCKETMGR_VALID(manager));
+
+ return (manager->methods->fdwatchcreate(manager, fd, flags,
+ callback, cbarg, task,
+ socketp));
+}
+
+isc_result_t
+isc_socket_fdwatchpoke(isc_socket_t *sock, int flags)
+{
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return(sock->methods->fdwatchpoke(sock, flags));
+}
+
+isc_result_t
+isc_socket_dup(isc_socket_t *sock, isc_socket_t **socketp) {
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+
+ return(sock->methods->dup(sock, socketp));
+}
+
+int
+isc_socket_getfd(isc_socket_t *sock) {
+ REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+ return(sock->methods->getfd(sock));
+}
diff --git a/lib/isc/sparc64/include/isc/atomic.h b/lib/isc/sparc64/include/isc/atomic.h
new file mode 100644
index 0000000..5533ddb
--- /dev/null
+++ b/lib/isc/sparc64/include/isc/atomic.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: atomic.h,v 1.5 2007/06/19 23:47:18 tbox Exp $ */
+
+/*
+ * This code was written based on FreeBSD's kernel source whose copyright
+ * follows:
+ */
+
+/*-
+ * Copyright (c) 1998 Doug Rabson.
+ * Copyright (c) 2001 Jake Burkholder.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: FreeBSD: src/sys/i386/include/atomic.h,v 1.20 2001/02/11
+ * $FreeBSD: src/sys/sparc64/include/atomic.h,v 1.8 2004/05/22 00:52:16 marius Exp $
+ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#define ASI_P 0x80 /* Primary Address Space Identifier */
+
+#ifdef ISC_PLATFORM_USEGCCASM
+
+/*
+ * This routine atomically increments the value stored in 'p' by 'val', and
+ * returns the previous value.
+ */
+static inline isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ isc_int32_t prev, swapped;
+
+ for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) {
+ swapped = prev + val;
+ __asm__ volatile(
+ "casa [%1] %2, %3, %0"
+ : "+r"(swapped)
+ : "r"(p), "n"(ASI_P), "r"(prev));
+ if (swapped == prev)
+ break;
+ }
+
+ return (prev);
+}
+
+/*
+ * This routine atomically stores the value 'val' in 'p'.
+ */
+static inline void
+isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+ isc_int32_t prev, swapped;
+
+ for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) {
+ swapped = val;
+ __asm__ volatile(
+ "casa [%1] %2, %3, %0"
+ : "+r"(swapped)
+ : "r"(p), "n"(ASI_P), "r"(prev)
+ : "memory");
+ if (swapped == prev)
+ break;
+ }
+}
+
+/*
+ * This routine atomically replaces the value in 'p' with 'val', if the
+ * original value is equal to 'cmpval'. The original value is returned in any
+ * case.
+ */
+static inline isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+ isc_int32_t temp = val;
+
+ __asm__ volatile(
+ "casa [%1] %2, %3, %0"
+ : "+r"(temp)
+ : "r"(p), "n"(ASI_P), "r"(cmpval));
+
+ return (temp);
+}
+
+#else /* ISC_PLATFORM_USEGCCASM */
+
+#error "unsupported compiler. disable atomic ops by --disable-atomic"
+
+#endif /* ISC_PLATFORM_USEGCCASM */
+
+#endif /* ISC_ATOMIC_H */
diff --git a/lib/isc/stats.c b/lib/isc/stats.c
new file mode 100644
index 0000000..8b624b2
--- /dev/null
+++ b/lib/isc/stats.c
@@ -0,0 +1,326 @@
+/*
+ * Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <isc/atomic.h>
+#include <isc/buffer.h>
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/platform.h>
+#include <isc/print.h>
+#include <isc/rwlock.h>
+#include <isc/stats.h>
+#include <isc/util.h>
+
+#define ISC_STATS_MAGIC ISC_MAGIC('S', 't', 'a', 't')
+#define ISC_STATS_VALID(x) ISC_MAGIC_VALID(x, ISC_STATS_MAGIC)
+
+#ifndef ISC_STATS_USEMULTIFIELDS
+#if defined(ISC_RWLOCK_USEATOMIC) && defined(ISC_PLATFORM_HAVEXADD) && !defined(ISC_PLATFORM_HAVEXADDQ)
+#define ISC_STATS_USEMULTIFIELDS 1
+#else
+#define ISC_STATS_USEMULTIFIELDS 0
+#endif
+#endif /* ISC_STATS_USEMULTIFIELDS */
+
+#if ISC_STATS_USEMULTIFIELDS
+typedef struct {
+ isc_uint32_t hi;
+ isc_uint32_t lo;
+} isc_stat_t;
+#else
+typedef isc_uint64_t isc_stat_t;
+#endif
+
+struct isc_stats {
+ /*% Unlocked */
+ unsigned int magic;
+ isc_mem_t *mctx;
+ int ncounters;
+
+ isc_mutex_t lock;
+ unsigned int references; /* locked by lock */
+
+ /*%
+ * Locked by counterlock or unlocked if efficient rwlock is not
+ * available.
+ */
+#ifdef ISC_RWLOCK_USEATOMIC
+ isc_rwlock_t counterlock;
+#endif
+ isc_stat_t *counters;
+
+ /*%
+ * We don't want to lock the counters while we are dumping, so we first
+ * copy the current counter values into a local array. This buffer
+ * will be used as the copy destination. It's allocated on creation
+ * of the stats structure so that the dump operation won't fail due
+ * to memory allocation failure.
+ * XXX: this approach is weird for non-threaded build because the
+ * additional memory and the copy overhead could be avoided. We prefer
+ * simplicity here, however, under the assumption that this function
+ * should be only rarely called.
+ */
+ isc_uint64_t *copiedcounters;
+};
+
+static isc_result_t
+create_stats(isc_mem_t *mctx, int ncounters, isc_stats_t **statsp) {
+ isc_stats_t *stats;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(statsp != NULL && *statsp == NULL);
+
+ stats = isc_mem_get(mctx, sizeof(*stats));
+ if (stats == NULL)
+ return (ISC_R_NOMEMORY);
+
+ result = isc_mutex_init(&stats->lock);
+ if (result != ISC_R_SUCCESS)
+ goto clean_stats;
+
+ stats->counters = isc_mem_get(mctx, sizeof(isc_stat_t) * ncounters);
+ if (stats->counters == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto clean_mutex;
+ }
+ stats->copiedcounters = isc_mem_get(mctx,
+ sizeof(isc_uint64_t) * ncounters);
+ if (stats->copiedcounters == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto clean_counters;
+ }
+
+#ifdef ISC_RWLOCK_USEATOMIC
+ result = isc_rwlock_init(&stats->counterlock, 0, 0);
+ if (result != ISC_R_SUCCESS)
+ goto clean_copiedcounters;
+#endif
+
+ stats->references = 1;
+ memset(stats->counters, 0, sizeof(isc_stat_t) * ncounters);
+ stats->mctx = NULL;
+ isc_mem_attach(mctx, &stats->mctx);
+ stats->ncounters = ncounters;
+ stats->magic = ISC_STATS_MAGIC;
+
+ *statsp = stats;
+
+ return (result);
+
+clean_counters:
+ isc_mem_put(mctx, stats->counters, sizeof(isc_stat_t) * ncounters);
+
+#ifdef ISC_RWLOCK_USEATOMIC
+clean_copiedcounters:
+ isc_mem_put(mctx, stats->copiedcounters,
+ sizeof(isc_stat_t) * ncounters);
+#endif
+
+clean_mutex:
+ DESTROYLOCK(&stats->lock);
+
+clean_stats:
+ isc_mem_put(mctx, stats, sizeof(*stats));
+
+ return (result);
+}
+
+void
+isc_stats_attach(isc_stats_t *stats, isc_stats_t **statsp) {
+ REQUIRE(ISC_STATS_VALID(stats));
+ REQUIRE(statsp != NULL && *statsp == NULL);
+
+ LOCK(&stats->lock);
+ stats->references++;
+ UNLOCK(&stats->lock);
+
+ *statsp = stats;
+}
+
+void
+isc_stats_detach(isc_stats_t **statsp) {
+ isc_stats_t *stats;
+
+ REQUIRE(statsp != NULL && ISC_STATS_VALID(*statsp));
+
+ stats = *statsp;
+ *statsp = NULL;
+
+ LOCK(&stats->lock);
+ stats->references--;
+ UNLOCK(&stats->lock);
+
+ if (stats->references == 0) {
+ isc_mem_put(stats->mctx, stats->copiedcounters,
+ sizeof(isc_stat_t) * stats->ncounters);
+ isc_mem_put(stats->mctx, stats->counters,
+ sizeof(isc_stat_t) * stats->ncounters);
+ DESTROYLOCK(&stats->lock);
+#ifdef ISC_RWLOCK_USEATOMIC
+ isc_rwlock_destroy(&stats->counterlock);
+#endif
+ isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
+ }
+}
+
+int
+isc_stats_ncounters(isc_stats_t *stats) {
+ REQUIRE(ISC_STATS_VALID(stats));
+
+ return (stats->ncounters);
+}
+
+static inline void
+incrementcounter(isc_stats_t *stats, int counter) {
+ isc_int32_t prev;
+
+#ifdef ISC_RWLOCK_USEATOMIC
+ /*
+ * We use a "read" lock to prevent other threads from reading the
+ * counter while we "writing" a counter field. The write access itself
+ * is protected by the atomic operation.
+ */
+ isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_read);
+#endif
+
+#if ISC_STATS_USEMULTIFIELDS
+ prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, 1);
+ /*
+ * If the lower 32-bit field overflows, increment the higher field.
+ * Note that it's *theoretically* possible that the lower field
+ * overlaps again before the higher field is incremented. It doesn't
+ * matter, however, because we don't read the value until
+ * isc_stats_copy() is called where the whole process is protected
+ * by the write (exclusive) lock.
+ */
+ if (prev == (isc_int32_t)0xffffffff)
+ isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi, 1);
+#elif defined(ISC_PLATFORM_HAVEXADDQ)
+ UNUSED(prev);
+ isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], 1);
+#else
+ UNUSED(prev);
+ stats->counters[counter]++;
+#endif
+
+#ifdef ISC_RWLOCK_USEATOMIC
+ isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_read);
+#endif
+}
+
+static inline void
+decrementcounter(isc_stats_t *stats, int counter) {
+ isc_int32_t prev;
+
+#ifdef ISC_RWLOCK_USEATOMIC
+ isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_read);
+#endif
+
+#if ISC_STATS_USEMULTIFIELDS
+ prev = isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].lo, -1);
+ if (prev == 0)
+ isc_atomic_xadd((isc_int32_t *)&stats->counters[counter].hi,
+ -1);
+#elif defined(ISC_PLATFORM_HAVEXADDQ)
+ UNUSED(prev);
+ isc_atomic_xaddq((isc_int64_t *)&stats->counters[counter], -1);
+#else
+ UNUSED(prev);
+ stats->counters[counter]--;
+#endif
+
+#ifdef ISC_RWLOCK_USEATOMIC
+ isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_read);
+#endif
+}
+
+static void
+copy_counters(isc_stats_t *stats) {
+ int i;
+
+#ifdef ISC_RWLOCK_USEATOMIC
+ /*
+ * We use a "write" lock before "reading" the statistics counters as
+ * an exclusive lock.
+ */
+ isc_rwlock_lock(&stats->counterlock, isc_rwlocktype_write);
+#endif
+
+#if ISC_STATS_USEMULTIFIELDS
+ for (i = 0; i < stats->ncounters; i++) {
+ stats->copiedcounters[i] =
+ (isc_uint64_t)(stats->counters[i].hi) << 32 |
+ stats->counters[i].lo;
+ }
+#else
+ UNUSED(i);
+ memcpy(stats->copiedcounters, stats->counters,
+ stats->ncounters * sizeof(isc_stat_t));
+#endif
+
+#ifdef ISC_RWLOCK_USEATOMIC
+ isc_rwlock_unlock(&stats->counterlock, isc_rwlocktype_write);
+#endif
+}
+
+isc_result_t
+isc_stats_create(isc_mem_t *mctx, isc_stats_t **statsp, int ncounters) {
+ REQUIRE(statsp != NULL && *statsp == NULL);
+
+ return (create_stats(mctx, ncounters, statsp));
+}
+
+void
+isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter) {
+ REQUIRE(ISC_STATS_VALID(stats));
+ REQUIRE(counter < stats->ncounters);
+
+ incrementcounter(stats, (int)counter);
+}
+
+void
+isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter) {
+ REQUIRE(ISC_STATS_VALID(stats));
+ REQUIRE(counter < stats->ncounters);
+
+ decrementcounter(stats, (int)counter);
+}
+
+void
+isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn,
+ void *arg, unsigned int options)
+{
+ int i;
+
+ REQUIRE(ISC_STATS_VALID(stats));
+
+ copy_counters(stats);
+
+ for (i = 0; i < stats->ncounters; i++) {
+ if ((options & ISC_STATSDUMP_VERBOSE) == 0 &&
+ stats->copiedcounters[i] == 0)
+ continue;
+ dump_fn((isc_statscounter_t)i, stats->copiedcounters[i], arg);
+ }
+}
diff --git a/lib/isc/string.c b/lib/isc/string.c
new file mode 100644
index 0000000..cba517c
--- /dev/null
+++ b/lib/isc/string.c
@@ -0,0 +1,271 @@
+/*
+ * Copyright (C) 2004-2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <ctype.h>
+
+#include <isc/mem.h>
+#include <isc/print.h>
+#include <isc/region.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+static char digits[] = "0123456789abcdefghijklmnoprstuvwxyz";
+
+isc_uint64_t
+isc_string_touint64(char *source, char **end, int base) {
+ isc_uint64_t tmp;
+ isc_uint64_t overflow;
+ char *s = source;
+ char *o;
+ char c;
+
+ if ((base < 0) || (base == 1) || (base > 36)) {
+ *end = source;
+ return (0);
+ }
+
+ while (*s != 0 && isascii(*s&0xff) && isspace(*s&0xff))
+ s++;
+ if (*s == '+' /* || *s == '-' */)
+ s++;
+ if (base == 0) {
+ if (*s == '0' && (*(s+1) == 'X' || *(s+1) == 'x')) {
+ s += 2;
+ base = 16;
+ } else if (*s == '0')
+ base = 8;
+ else
+ base = 10;
+ }
+ if (*s == 0) {
+ *end = source;
+ return (0);
+ }
+ overflow = ~0;
+ overflow /= base;
+ tmp = 0;
+
+ while ((c = *s) != 0) {
+ c = tolower(c&0xff);
+ /* end ? */
+ if ((o = strchr(digits, c)) == NULL) {
+ *end = s;
+ return (tmp);
+ }
+ /* end ? */
+ if ((o - digits) >= base) {
+ *end = s;
+ return (tmp);
+ }
+ /* overflow ? */
+ if (tmp > overflow) {
+ *end = source;
+ return (0);
+ }
+ tmp *= base;
+ /* overflow ? */
+ if ((tmp + (o - digits)) < tmp) {
+ *end = source;
+ return (0);
+ }
+ tmp += o - digits;
+ s++;
+ }
+ *end = s;
+ return (tmp);
+}
+
+isc_result_t
+isc_string_copy(char *target, size_t size, const char *source) {
+ REQUIRE(size > 0U);
+
+ if (strlcpy(target, source, size) >= size) {
+ memset(target, ISC_STRING_MAGIC, size);
+ return (ISC_R_NOSPACE);
+ }
+
+ ENSURE(strlen(target) < size);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_string_copy_truncate(char *target, size_t size, const char *source) {
+ REQUIRE(size > 0U);
+
+ strlcpy(target, source, size);
+
+ ENSURE(strlen(target) < size);
+}
+
+isc_result_t
+isc_string_append(char *target, size_t size, const char *source) {
+ REQUIRE(size > 0U);
+ REQUIRE(strlen(target) < size);
+
+ if (strlcat(target, source, size) >= size) {
+ memset(target, ISC_STRING_MAGIC, size);
+ return (ISC_R_NOSPACE);
+ }
+
+ ENSURE(strlen(target) < size);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_string_append_truncate(char *target, size_t size, const char *source) {
+ REQUIRE(size > 0U);
+ REQUIRE(strlen(target) < size);
+
+ strlcat(target, source, size);
+
+ ENSURE(strlen(target) < size);
+}
+
+isc_result_t
+isc_string_printf(char *target, size_t size, const char *format, ...) {
+ va_list args;
+ size_t n;
+
+ REQUIRE(size > 0U);
+
+ va_start(args, format);
+ n = vsnprintf(target, size, format, args);
+ va_end(args);
+
+ if (n >= size) {
+ memset(target, ISC_STRING_MAGIC, size);
+ return (ISC_R_NOSPACE);
+ }
+
+ ENSURE(strlen(target) < size);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_string_printf_truncate(char *target, size_t size, const char *format, ...)
+{
+ va_list args;
+
+ REQUIRE(size > 0U);
+
+ va_start(args, format);
+ /* check return code? */
+ (void)vsnprintf(target, size, format, args);
+ va_end(args);
+
+ ENSURE(strlen(target) < size);
+}
+
+char *
+isc_string_regiondup(isc_mem_t *mctx, const isc_region_t *source) {
+ char *target;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(source != NULL);
+
+ target = (char *) isc_mem_allocate(mctx, source->length + 1);
+ if (target != NULL) {
+ memcpy(source->base, target, source->length);
+ target[source->length] = '\0';
+ }
+
+ return (target);
+}
+
+char *
+isc_string_separate(char **stringp, const char *delim) {
+ char *string = *stringp;
+ char *s;
+ const char *d;
+ char sc, dc;
+
+ if (string == NULL)
+ return (NULL);
+
+ for (s = string; (sc = *s) != '\0'; s++)
+ for (d = delim; (dc = *d) != '\0'; d++)
+ if (sc == dc) {
+ *s++ = '\0';
+ *stringp = s;
+ return (string);
+ }
+ *stringp = NULL;
+ return (string);
+}
+
+size_t
+isc_string_strlcpy(char *dst, const char *src, size_t size)
+{
+ char *d = dst;
+ const char *s = src;
+ size_t n = size;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0U && --n != 0U) {
+ do {
+ if ((*d++ = *s++) == 0)
+ break;
+ } while (--n != 0U);
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0U) {
+ if (size != 0U)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return(s - src - 1); /* count does not include NUL */
+}
+
+size_t
+isc_string_strlcat(char *dst, const char *src, size_t size)
+{
+ char *d = dst;
+ const char *s = src;
+ size_t n = size;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0U && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = size - dlen;
+
+ if (n == 0U)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1U) {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return(dlen + (s - src)); /* count does not include NUL */
+}
diff --git a/lib/isc/strtoul.c b/lib/isc/strtoul.c
new file mode 100644
index 0000000..18d93e2
--- /dev/null
+++ b/lib/isc/strtoul.c
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*! \file */
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+/* $Id: strtoul.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+
+#include <config.h>
+
+#include <limits.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include <isc/stdlib.h>
+#include <isc/util.h>
+
+/*!
+ * Convert a string to an unsigned long integer.
+ *
+ * Ignores `locale' stuff. Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+unsigned long
+isc_strtoul(const char *nptr, char **endptr, int base) {
+ const char *s = nptr;
+ unsigned long acc;
+ unsigned char c;
+ unsigned long cutoff;
+ int neg = 0, any, cutlim;
+
+ /*
+ * See strtol for comments as to the logic used.
+ */
+ do {
+ c = *s++;
+ } while (isspace(c));
+ if (c == '-') {
+ neg = 1;
+ c = *s++;
+ } else if (c == '+')
+ c = *s++;
+ if ((base == 0 || base == 16) &&
+ c == '0' && (*s == 'x' || *s == 'X')) {
+ c = s[1];
+ s += 2;
+ base = 16;
+ }
+ if (base == 0)
+ base = c == '0' ? 8 : 10;
+ cutoff = (unsigned long)ULONG_MAX / (unsigned long)base;
+ cutlim = (unsigned long)ULONG_MAX % (unsigned long)base;
+ for (acc = 0, any = 0;; c = *s++) {
+ if (!isascii(c))
+ break;
+ if (isdigit(c))
+ c -= '0';
+ else if (isalpha(c))
+ c -= isupper(c) ? 'A' - 10 : 'a' - 10;
+ else
+ break;
+ if (c >= base)
+ break;
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
+ any = -1;
+ else {
+ any = 1;
+ acc *= base;
+ acc += c;
+ }
+ }
+ if (any < 0) {
+ acc = ULONG_MAX;
+ errno = ERANGE;
+ } else if (neg)
+ acc = -acc;
+ if (endptr != 0)
+ DE_CONST(any ? s - 1 : nptr, *endptr);
+ return (acc);
+}
diff --git a/lib/isc/symtab.c b/lib/isc/symtab.c
new file mode 100644
index 0000000..d4c1dcc
--- /dev/null
+++ b/lib/isc/symtab.c
@@ -0,0 +1,301 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <ctype.h>
+
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/string.h>
+#include <isc/symtab.h>
+#include <isc/util.h>
+
+typedef struct elt {
+ char * key;
+ unsigned int type;
+ isc_symvalue_t value;
+ LINK(struct elt) link;
+} elt_t;
+
+typedef LIST(elt_t) eltlist_t;
+
+#define SYMTAB_MAGIC ISC_MAGIC('S', 'y', 'm', 'T')
+#define VALID_SYMTAB(st) ISC_MAGIC_VALID(st, SYMTAB_MAGIC)
+
+struct isc_symtab {
+ /* Unlocked. */
+ unsigned int magic;
+ isc_mem_t * mctx;
+ unsigned int size;
+ unsigned int count;
+ unsigned int maxload;
+ eltlist_t * table;
+ isc_symtabaction_t undefine_action;
+ void * undefine_arg;
+ isc_boolean_t case_sensitive;
+};
+
+isc_result_t
+isc_symtab_create(isc_mem_t *mctx, unsigned int size,
+ isc_symtabaction_t undefine_action,
+ void *undefine_arg,
+ isc_boolean_t case_sensitive,
+ isc_symtab_t **symtabp)
+{
+ isc_symtab_t *symtab;
+ unsigned int i;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(symtabp != NULL && *symtabp == NULL);
+ REQUIRE(size > 0); /* Should be prime. */
+
+ symtab = (isc_symtab_t *)isc_mem_get(mctx, sizeof(*symtab));
+ if (symtab == NULL)
+ return (ISC_R_NOMEMORY);
+ symtab->table = (eltlist_t *)isc_mem_get(mctx,
+ size * sizeof(eltlist_t));
+ if (symtab->table == NULL) {
+ isc_mem_put(mctx, symtab, sizeof(*symtab));
+ return (ISC_R_NOMEMORY);
+ }
+ for (i = 0; i < size; i++)
+ INIT_LIST(symtab->table[i]);
+ symtab->mctx = mctx;
+ symtab->size = size;
+ symtab->count = 0;
+ symtab->maxload = size * 3 / 4;
+ symtab->undefine_action = undefine_action;
+ symtab->undefine_arg = undefine_arg;
+ symtab->case_sensitive = case_sensitive;
+ symtab->magic = SYMTAB_MAGIC;
+
+ *symtabp = symtab;
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_symtab_destroy(isc_symtab_t **symtabp) {
+ isc_symtab_t *symtab;
+ unsigned int i;
+ elt_t *elt, *nelt;
+
+ REQUIRE(symtabp != NULL);
+ symtab = *symtabp;
+ REQUIRE(VALID_SYMTAB(symtab));
+
+ for (i = 0; i < symtab->size; i++) {
+ for (elt = HEAD(symtab->table[i]); elt != NULL; elt = nelt) {
+ nelt = NEXT(elt, link);
+ if (symtab->undefine_action != NULL)
+ (symtab->undefine_action)(elt->key,
+ elt->type,
+ elt->value,
+ symtab->undefine_arg);
+ isc_mem_put(symtab->mctx, elt, sizeof(*elt));
+ }
+ }
+ isc_mem_put(symtab->mctx, symtab->table,
+ symtab->size * sizeof(eltlist_t));
+ symtab->magic = 0;
+ isc_mem_put(symtab->mctx, symtab, sizeof(*symtab));
+
+ *symtabp = NULL;
+}
+
+static inline unsigned int
+hash(const char *key, isc_boolean_t case_sensitive) {
+ const char *s;
+ unsigned int h = 0;
+ int c;
+
+ /*
+ * This hash function is similar to the one Ousterhout
+ * uses in Tcl.
+ */
+
+ if (case_sensitive) {
+ for (s = key; *s != '\0'; s++) {
+ h += (h << 3) + *s;
+ }
+ } else {
+ for (s = key; *s != '\0'; s++) {
+ c = *s;
+ c = tolower((unsigned char)c);
+ h += (h << 3) + c;
+ }
+ }
+
+ return (h);
+}
+
+#define FIND(s, k, t, b, e) \
+ b = hash((k), (s)->case_sensitive) % (s)->size; \
+ if ((s)->case_sensitive) { \
+ for (e = HEAD((s)->table[b]); e != NULL; e = NEXT(e, link)) { \
+ if (((t) == 0 || e->type == (t)) && \
+ strcmp(e->key, (k)) == 0) \
+ break; \
+ } \
+ } else { \
+ for (e = HEAD((s)->table[b]); e != NULL; e = NEXT(e, link)) { \
+ if (((t) == 0 || e->type == (t)) && \
+ strcasecmp(e->key, (k)) == 0) \
+ break; \
+ } \
+ }
+
+isc_result_t
+isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type,
+ isc_symvalue_t *value)
+{
+ unsigned int bucket;
+ elt_t *elt;
+
+ REQUIRE(VALID_SYMTAB(symtab));
+ REQUIRE(key != NULL);
+
+ FIND(symtab, key, type, bucket, elt);
+
+ if (elt == NULL)
+ return (ISC_R_NOTFOUND);
+
+ if (value != NULL)
+ *value = elt->value;
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+grow_table(isc_symtab_t *symtab) {
+ eltlist_t *newtable;
+ unsigned int i, newsize, newmax;
+
+ REQUIRE(symtab != NULL);
+
+ newsize = symtab->size * 2;
+ newmax = newsize * 3 / 4;
+ INSIST(newsize > 0U && newmax > 0U);
+
+ newtable = isc_mem_get(symtab->mctx, newsize * sizeof(eltlist_t));
+ if (newtable == NULL)
+ return;
+
+ for (i = 0; i < newsize; i++)
+ INIT_LIST(newtable[i]);
+
+ for (i = 0; i < symtab->size; i++) {
+ elt_t *elt, *nelt;
+
+ for (elt = HEAD(symtab->table[i]); elt != NULL; elt = nelt) {
+ unsigned int hv;
+
+ nelt = NEXT(elt, link);
+
+ UNLINK(symtab->table[i], elt, link);
+ hv = hash(elt->key, symtab->case_sensitive);
+ APPEND(newtable[hv % newsize], elt, link);
+ }
+ }
+
+ isc_mem_put(symtab->mctx, symtab->table,
+ symtab->size * sizeof(eltlist_t));
+
+ symtab->table = newtable;
+ symtab->size = newsize;
+ symtab->maxload = newmax;
+}
+
+isc_result_t
+isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type,
+ isc_symvalue_t value, isc_symexists_t exists_policy)
+{
+ unsigned int bucket;
+ elt_t *elt;
+
+ REQUIRE(VALID_SYMTAB(symtab));
+ REQUIRE(key != NULL);
+ REQUIRE(type != 0);
+
+ FIND(symtab, key, type, bucket, elt);
+
+ if (exists_policy != isc_symexists_add && elt != NULL) {
+ if (exists_policy == isc_symexists_reject)
+ return (ISC_R_EXISTS);
+ INSIST(exists_policy == isc_symexists_replace);
+ UNLINK(symtab->table[bucket], elt, link);
+ if (symtab->undefine_action != NULL)
+ (symtab->undefine_action)(elt->key, elt->type,
+ elt->value,
+ symtab->undefine_arg);
+ } else {
+ elt = (elt_t *)isc_mem_get(symtab->mctx, sizeof(*elt));
+ if (elt == NULL)
+ return (ISC_R_NOMEMORY);
+ ISC_LINK_INIT(elt, link);
+ symtab->count++;
+ }
+
+ /*
+ * Though the "key" can be const coming in, it is not stored as const
+ * so that the calling program can easily have writable access to
+ * it in its undefine_action function. In the event that it *was*
+ * truly const coming in and then the caller modified it anyway ...
+ * well, don't do that!
+ */
+ DE_CONST(key, elt->key);
+ elt->type = type;
+ elt->value = value;
+
+ /*
+ * We prepend so that the most recent definition will be found.
+ */
+ PREPEND(symtab->table[bucket], elt, link);
+
+ if (symtab->count > symtab->maxload)
+ grow_table(symtab);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type) {
+ unsigned int bucket;
+ elt_t *elt;
+
+ REQUIRE(VALID_SYMTAB(symtab));
+ REQUIRE(key != NULL);
+
+ FIND(symtab, key, type, bucket, elt);
+
+ if (elt == NULL)
+ return (ISC_R_NOTFOUND);
+
+ if (symtab->undefine_action != NULL)
+ (symtab->undefine_action)(elt->key, elt->type,
+ elt->value, symtab->undefine_arg);
+ UNLINK(symtab->table[bucket], elt, link);
+ isc_mem_put(symtab->mctx, elt, sizeof(*elt));
+ symtab->count--;
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/task.c b/lib/isc/task.c
new file mode 100644
index 0000000..cd19d2d
--- /dev/null
+++ b/lib/isc/task.c
@@ -0,0 +1,1813 @@
+/*
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file
+ * \author Principal Author: Bob Halley
+ */
+
+/*
+ * XXXRTH Need to document the states a task can be in, and the rules
+ * for changing states.
+ */
+
+#include <config.h>
+
+#include <isc/condition.h>
+#include <isc/event.h>
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/platform.h>
+#include <isc/string.h>
+#include <isc/task.h>
+#include <isc/thread.h>
+#include <isc/util.h>
+#include <isc/xml.h>
+
+#ifdef OPENSSL_LEAKS
+#include <openssl/err.h>
+#endif
+
+/*%
+ * For BIND9 internal applications:
+ * when built with threads we use multiple worker threads shared by the whole
+ * application.
+ * when built without threads we share a single global task manager and use
+ * an integrated event loop for socket, timer, and other generic task events.
+ * For generic library:
+ * we don't use either of them: an application can have multiple task managers
+ * whether or not it's threaded, and if the application is threaded each thread
+ * is expected to have a separate manager; no "worker threads" are shared by
+ * the application threads.
+ */
+#ifdef BIND9
+#ifdef ISC_PLATFORM_USETHREADS
+#define USE_WORKER_THREADS
+#else
+#define USE_SHARED_MANAGER
+#endif /* ISC_PLATFORM_USETHREADS */
+#endif /* BIND9 */
+
+#include "task_p.h"
+
+#ifdef ISC_TASK_TRACE
+#define XTRACE(m) fprintf(stderr, "task %p thread %lu: %s\n", \
+ task, isc_thread_self(), (m))
+#define XTTRACE(t, m) fprintf(stderr, "task %p thread %lu: %s\n", \
+ (t), isc_thread_self(), (m))
+#define XTHREADTRACE(m) fprintf(stderr, "thread %lu: %s\n", \
+ isc_thread_self(), (m))
+#else
+#define XTRACE(m)
+#define XTTRACE(t, m)
+#define XTHREADTRACE(m)
+#endif
+
+/***
+ *** Types.
+ ***/
+
+typedef enum {
+ task_state_idle, task_state_ready, task_state_running,
+ task_state_done
+} task_state_t;
+
+#if defined(HAVE_LIBXML2) && defined(BIND9)
+static const char *statenames[] = {
+ "idle", "ready", "running", "done",
+};
+#endif
+
+#define TASK_MAGIC ISC_MAGIC('T', 'A', 'S', 'K')
+#define VALID_TASK(t) ISC_MAGIC_VALID(t, TASK_MAGIC)
+
+typedef struct isc__task isc__task_t;
+typedef struct isc__taskmgr isc__taskmgr_t;
+
+struct isc__task {
+ /* Not locked. */
+ isc_task_t common;
+ isc__taskmgr_t * manager;
+ isc_mutex_t lock;
+ /* Locked by task lock. */
+ task_state_t state;
+ unsigned int references;
+ isc_eventlist_t events;
+ isc_eventlist_t on_shutdown;
+ unsigned int quantum;
+ unsigned int flags;
+ isc_stdtime_t now;
+ char name[16];
+ void * tag;
+ /* Locked by task manager lock. */
+ LINK(isc__task_t) link;
+ LINK(isc__task_t) ready_link;
+ LINK(isc__task_t) ready_priority_link;
+};
+
+#define TASK_F_SHUTTINGDOWN 0x01
+#define TASK_F_PRIVILEGED 0x02
+
+#define TASK_SHUTTINGDOWN(t) (((t)->flags & TASK_F_SHUTTINGDOWN) \
+ != 0)
+
+#define TASK_MANAGER_MAGIC ISC_MAGIC('T', 'S', 'K', 'M')
+#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, TASK_MANAGER_MAGIC)
+
+typedef ISC_LIST(isc__task_t) isc__tasklist_t;
+
+struct isc__taskmgr {
+ /* Not locked. */
+ isc_taskmgr_t common;
+ isc_mem_t * mctx;
+ isc_mutex_t lock;
+#ifdef ISC_PLATFORM_USETHREADS
+ unsigned int workers;
+ isc_thread_t * threads;
+#endif /* ISC_PLATFORM_USETHREADS */
+ /* Locked by task manager lock. */
+ unsigned int default_quantum;
+ LIST(isc__task_t) tasks;
+ isc__tasklist_t ready_tasks;
+ isc__tasklist_t ready_priority_tasks;
+ isc_taskmgrmode_t mode;
+#ifdef ISC_PLATFORM_USETHREADS
+ isc_condition_t work_available;
+ isc_condition_t exclusive_granted;
+ isc_condition_t paused;
+#endif /* ISC_PLATFORM_USETHREADS */
+ unsigned int tasks_running;
+ isc_boolean_t pause_requested;
+ isc_boolean_t exclusive_requested;
+ isc_boolean_t exiting;
+#ifdef USE_SHARED_MANAGER
+ unsigned int refs;
+#endif /* ISC_PLATFORM_USETHREADS */
+};
+
+#define DEFAULT_TASKMGR_QUANTUM 10
+#define DEFAULT_DEFAULT_QUANTUM 5
+#define FINISHED(m) ((m)->exiting && EMPTY((m)->tasks))
+
+#ifdef USE_SHARED_MANAGER
+static isc__taskmgr_t *taskmgr = NULL;
+#endif /* USE_SHARED_MANAGER */
+
+/*%
+ * The following can be either static or public, depending on build environment.
+ */
+
+#ifdef BIND9
+#define ISC_TASKFUNC_SCOPE
+#else
+#define ISC_TASKFUNC_SCOPE static
+#endif
+
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__task_create(isc_taskmgr_t *manager0, unsigned int quantum,
+ isc_task_t **taskp);
+ISC_TASKFUNC_SCOPE void
+isc__task_attach(isc_task_t *source0, isc_task_t **targetp);
+ISC_TASKFUNC_SCOPE void
+isc__task_detach(isc_task_t **taskp);
+ISC_TASKFUNC_SCOPE void
+isc__task_send(isc_task_t *task0, isc_event_t **eventp);
+ISC_TASKFUNC_SCOPE void
+isc__task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp);
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_purgerange(isc_task_t *task0, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag);
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag);
+ISC_TASKFUNC_SCOPE isc_boolean_t
+isc__task_purgeevent(isc_task_t *task0, isc_event_t *event);
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag,
+ isc_eventlist_t *events);
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag, isc_eventlist_t *events);
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__task_onshutdown(isc_task_t *task0, isc_taskaction_t action,
+ const void *arg);
+ISC_TASKFUNC_SCOPE void
+isc__task_shutdown(isc_task_t *task0);
+ISC_TASKFUNC_SCOPE void
+isc__task_destroy(isc_task_t **taskp);
+ISC_TASKFUNC_SCOPE void
+isc__task_setname(isc_task_t *task0, const char *name, void *tag);
+ISC_TASKFUNC_SCOPE const char *
+isc__task_getname(isc_task_t *task0);
+ISC_TASKFUNC_SCOPE void *
+isc__task_gettag(isc_task_t *task0);
+ISC_TASKFUNC_SCOPE void
+isc__task_getcurrenttime(isc_task_t *task0, isc_stdtime_t *t);
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
+ unsigned int default_quantum, isc_taskmgr_t **managerp);
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_destroy(isc_taskmgr_t **managerp);
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__task_beginexclusive(isc_task_t *task);
+ISC_TASKFUNC_SCOPE void
+isc__task_endexclusive(isc_task_t *task0);
+ISC_TASKFUNC_SCOPE void
+isc__task_setprivilege(isc_task_t *task0, isc_boolean_t priv);
+ISC_TASKFUNC_SCOPE isc_boolean_t
+isc__task_privilege(isc_task_t *task0);
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_setmode(isc_taskmgr_t *manager0, isc_taskmgrmode_t mode);
+ISC_TASKFUNC_SCOPE isc_taskmgrmode_t
+isc__taskmgr_mode(isc_taskmgr_t *manager0);
+
+static inline isc_boolean_t
+empty_readyq(isc__taskmgr_t *manager);
+
+static inline isc__task_t *
+pop_readyq(isc__taskmgr_t *manager);
+
+static inline void
+push_readyq(isc__taskmgr_t *manager, isc__task_t *task);
+
+static struct isc__taskmethods {
+ isc_taskmethods_t methods;
+
+ /*%
+ * The following are defined just for avoiding unused static functions.
+ */
+#ifndef BIND9
+ void *purgeevent, *unsendrange, *getname, *gettag, *getcurrenttime;
+#endif
+} taskmethods = {
+ {
+ isc__task_attach,
+ isc__task_detach,
+ isc__task_destroy,
+ isc__task_send,
+ isc__task_sendanddetach,
+ isc__task_unsend,
+ isc__task_onshutdown,
+ isc__task_shutdown,
+ isc__task_setname,
+ isc__task_purge,
+ isc__task_purgerange,
+ isc__task_beginexclusive,
+ isc__task_endexclusive,
+ isc__task_setprivilege,
+ isc__task_privilege
+ }
+#ifndef BIND9
+ ,
+ (void *)isc__task_purgeevent, (void *)isc__task_unsendrange,
+ (void *)isc__task_getname, (void *)isc__task_gettag,
+ (void *)isc__task_getcurrenttime
+#endif
+};
+
+static isc_taskmgrmethods_t taskmgrmethods = {
+ isc__taskmgr_destroy,
+ isc__taskmgr_setmode,
+ isc__taskmgr_mode,
+ isc__task_create
+};
+
+/***
+ *** Tasks.
+ ***/
+
+static void
+task_finished(isc__task_t *task) {
+ isc__taskmgr_t *manager = task->manager;
+
+ REQUIRE(EMPTY(task->events));
+ REQUIRE(EMPTY(task->on_shutdown));
+ REQUIRE(task->references == 0);
+ REQUIRE(task->state == task_state_done);
+
+ XTRACE("task_finished");
+
+ LOCK(&manager->lock);
+ UNLINK(manager->tasks, task, link);
+#ifdef USE_WORKER_THREADS
+ if (FINISHED(manager)) {
+ /*
+ * All tasks have completed and the
+ * task manager is exiting. Wake up
+ * any idle worker threads so they
+ * can exit.
+ */
+ BROADCAST(&manager->work_available);
+ }
+#endif /* USE_WORKER_THREADS */
+ UNLOCK(&manager->lock);
+
+ DESTROYLOCK(&task->lock);
+ task->common.impmagic = 0;
+ task->common.magic = 0;
+ isc_mem_put(manager->mctx, task, sizeof(*task));
+}
+
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__task_create(isc_taskmgr_t *manager0, unsigned int quantum,
+ isc_task_t **taskp)
+{
+ isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
+ isc__task_t *task;
+ isc_boolean_t exiting;
+ isc_result_t result;
+
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(taskp != NULL && *taskp == NULL);
+
+ task = isc_mem_get(manager->mctx, sizeof(*task));
+ if (task == NULL)
+ return (ISC_R_NOMEMORY);
+ XTRACE("isc_task_create");
+ result = isc_mutex_init(&task->lock);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_put(manager->mctx, task, sizeof(*task));
+ return (result);
+ }
+ LOCK(&manager->lock);
+ LOCK(&task->lock); /* helps coverity analysis noise ratio */
+ task->manager = manager;
+ task->state = task_state_idle;
+ task->references = 1;
+ INIT_LIST(task->events);
+ INIT_LIST(task->on_shutdown);
+ task->quantum = quantum;
+ task->flags = 0;
+ task->now = 0;
+ memset(task->name, 0, sizeof(task->name));
+ task->tag = NULL;
+ INIT_LINK(task, link);
+ INIT_LINK(task, ready_link);
+ INIT_LINK(task, ready_priority_link);
+ UNLOCK(&task->lock);
+ UNLOCK(&manager->lock);
+
+ exiting = ISC_FALSE;
+ LOCK(&manager->lock);
+ if (!manager->exiting) {
+ if (task->quantum == 0)
+ task->quantum = manager->default_quantum;
+ APPEND(manager->tasks, task, link);
+ } else
+ exiting = ISC_TRUE;
+ UNLOCK(&manager->lock);
+
+ if (exiting) {
+ DESTROYLOCK(&task->lock);
+ isc_mem_put(manager->mctx, task, sizeof(*task));
+ return (ISC_R_SHUTTINGDOWN);
+ }
+
+ task->common.methods = (isc_taskmethods_t *)&taskmethods;
+ task->common.magic = ISCAPI_TASK_MAGIC;
+ task->common.impmagic = TASK_MAGIC;
+ *taskp = (isc_task_t *)task;
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_attach(isc_task_t *source0, isc_task_t **targetp) {
+ isc__task_t *source = (isc__task_t *)source0;
+
+ /*
+ * Attach *targetp to source.
+ */
+
+ REQUIRE(VALID_TASK(source));
+ REQUIRE(targetp != NULL && *targetp == NULL);
+
+ XTTRACE(source, "isc_task_attach");
+
+ LOCK(&source->lock);
+ source->references++;
+ UNLOCK(&source->lock);
+
+ *targetp = (isc_task_t *)source;
+}
+
+static inline isc_boolean_t
+task_shutdown(isc__task_t *task) {
+ isc_boolean_t was_idle = ISC_FALSE;
+ isc_event_t *event, *prev;
+
+ /*
+ * Caller must be holding the task's lock.
+ */
+
+ XTRACE("task_shutdown");
+
+ if (! TASK_SHUTTINGDOWN(task)) {
+ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_SHUTTINGDOWN, "shutting down"));
+ task->flags |= TASK_F_SHUTTINGDOWN;
+ if (task->state == task_state_idle) {
+ INSIST(EMPTY(task->events));
+ task->state = task_state_ready;
+ was_idle = ISC_TRUE;
+ }
+ INSIST(task->state == task_state_ready ||
+ task->state == task_state_running);
+
+ /*
+ * Note that we post shutdown events LIFO.
+ */
+ for (event = TAIL(task->on_shutdown);
+ event != NULL;
+ event = prev) {
+ prev = PREV(event, ev_link);
+ DEQUEUE(task->on_shutdown, event, ev_link);
+ ENQUEUE(task->events, event, ev_link);
+ }
+ }
+
+ return (was_idle);
+}
+
+/*
+ * Moves a task onto the appropriate run queue.
+ *
+ * Caller must NOT hold manager lock.
+ */
+static inline void
+task_ready(isc__task_t *task) {
+ isc__taskmgr_t *manager = task->manager;
+#ifdef USE_WORKER_THREADS
+ isc_boolean_t has_privilege = isc__task_privilege((isc_task_t *) task);
+#endif /* USE_WORKER_THREADS */
+
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(task->state == task_state_ready);
+
+ XTRACE("task_ready");
+
+ LOCK(&manager->lock);
+ push_readyq(manager, task);
+#ifdef USE_WORKER_THREADS
+ if (manager->mode == isc_taskmgrmode_normal || has_privilege)
+ SIGNAL(&manager->work_available);
+#endif /* USE_WORKER_THREADS */
+ UNLOCK(&manager->lock);
+}
+
+static inline isc_boolean_t
+task_detach(isc__task_t *task) {
+
+ /*
+ * Caller must be holding the task lock.
+ */
+
+ REQUIRE(task->references > 0);
+
+ XTRACE("detach");
+
+ task->references--;
+ if (task->references == 0 && task->state == task_state_idle) {
+ INSIST(EMPTY(task->events));
+ /*
+ * There are no references to this task, and no
+ * pending events. We could try to optimize and
+ * either initiate shutdown or clean up the task,
+ * depending on its state, but it's easier to just
+ * make the task ready and allow run() or the event
+ * loop to deal with shutting down and termination.
+ */
+ task->state = task_state_ready;
+ return (ISC_TRUE);
+ }
+
+ return (ISC_FALSE);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_detach(isc_task_t **taskp) {
+ isc__task_t *task;
+ isc_boolean_t was_idle;
+
+ /*
+ * Detach *taskp from its task.
+ */
+
+ REQUIRE(taskp != NULL);
+ task = (isc__task_t *)*taskp;
+ REQUIRE(VALID_TASK(task));
+
+ XTRACE("isc_task_detach");
+
+ LOCK(&task->lock);
+ was_idle = task_detach(task);
+ UNLOCK(&task->lock);
+
+ if (was_idle)
+ task_ready(task);
+
+ *taskp = NULL;
+}
+
+static inline isc_boolean_t
+task_send(isc__task_t *task, isc_event_t **eventp) {
+ isc_boolean_t was_idle = ISC_FALSE;
+ isc_event_t *event;
+
+ /*
+ * Caller must be holding the task lock.
+ */
+
+ REQUIRE(eventp != NULL);
+ event = *eventp;
+ REQUIRE(event != NULL);
+ REQUIRE(event->ev_type > 0);
+ REQUIRE(task->state != task_state_done);
+
+ XTRACE("task_send");
+
+ if (task->state == task_state_idle) {
+ was_idle = ISC_TRUE;
+ INSIST(EMPTY(task->events));
+ task->state = task_state_ready;
+ }
+ INSIST(task->state == task_state_ready ||
+ task->state == task_state_running);
+ ENQUEUE(task->events, event, ev_link);
+ *eventp = NULL;
+
+ return (was_idle);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_send(isc_task_t *task0, isc_event_t **eventp) {
+ isc__task_t *task = (isc__task_t *)task0;
+ isc_boolean_t was_idle;
+
+ /*
+ * Send '*event' to 'task'.
+ */
+
+ REQUIRE(VALID_TASK(task));
+
+ XTRACE("isc_task_send");
+
+ /*
+ * We're trying hard to hold locks for as short a time as possible.
+ * We're also trying to hold as few locks as possible. This is why
+ * some processing is deferred until after the lock is released.
+ */
+ LOCK(&task->lock);
+ was_idle = task_send(task, eventp);
+ UNLOCK(&task->lock);
+
+ if (was_idle) {
+ /*
+ * We need to add this task to the ready queue.
+ *
+ * We've waited until now to do it because making a task
+ * ready requires locking the manager. If we tried to do
+ * this while holding the task lock, we could deadlock.
+ *
+ * We've changed the state to ready, so no one else will
+ * be trying to add this task to the ready queue. The
+ * only way to leave the ready state is by executing the
+ * task. It thus doesn't matter if events are added,
+ * removed, or a shutdown is started in the interval
+ * between the time we released the task lock, and the time
+ * we add the task to the ready queue.
+ */
+ task_ready(task);
+ }
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) {
+ isc_boolean_t idle1, idle2;
+ isc__task_t *task;
+
+ /*
+ * Send '*event' to '*taskp' and then detach '*taskp' from its
+ * task.
+ */
+
+ REQUIRE(taskp != NULL);
+ task = (isc__task_t *)*taskp;
+ REQUIRE(VALID_TASK(task));
+
+ XTRACE("isc_task_sendanddetach");
+
+ LOCK(&task->lock);
+ idle1 = task_send(task, eventp);
+ idle2 = task_detach(task);
+ UNLOCK(&task->lock);
+
+ /*
+ * If idle1, then idle2 shouldn't be true as well since we're holding
+ * the task lock, and thus the task cannot switch from ready back to
+ * idle.
+ */
+ INSIST(!(idle1 && idle2));
+
+ if (idle1 || idle2)
+ task_ready(task);
+
+ *taskp = NULL;
+}
+
+#define PURGE_OK(event) (((event)->ev_attributes & ISC_EVENTATTR_NOPURGE) == 0)
+
+static unsigned int
+dequeue_events(isc__task_t *task, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag,
+ isc_eventlist_t *events, isc_boolean_t purging)
+{
+ isc_event_t *event, *next_event;
+ unsigned int count = 0;
+
+ REQUIRE(VALID_TASK(task));
+ REQUIRE(last >= first);
+
+ XTRACE("dequeue_events");
+
+ /*
+ * Events matching 'sender', whose type is >= first and <= last, and
+ * whose tag is 'tag' will be dequeued. If 'purging', matching events
+ * which are marked as unpurgable will not be dequeued.
+ *
+ * sender == NULL means "any sender", and tag == NULL means "any tag".
+ */
+
+ LOCK(&task->lock);
+
+ for (event = HEAD(task->events); event != NULL; event = next_event) {
+ next_event = NEXT(event, ev_link);
+ if (event->ev_type >= first && event->ev_type <= last &&
+ (sender == NULL || event->ev_sender == sender) &&
+ (tag == NULL || event->ev_tag == tag) &&
+ (!purging || PURGE_OK(event))) {
+ DEQUEUE(task->events, event, ev_link);
+ ENQUEUE(*events, event, ev_link);
+ count++;
+ }
+ }
+
+ UNLOCK(&task->lock);
+
+ return (count);
+}
+
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_purgerange(isc_task_t *task0, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag)
+{
+ isc__task_t *task = (isc__task_t *)task0;
+ unsigned int count;
+ isc_eventlist_t events;
+ isc_event_t *event, *next_event;
+
+ /*
+ * Purge events from a task's event queue.
+ */
+
+ XTRACE("isc_task_purgerange");
+
+ ISC_LIST_INIT(events);
+
+ count = dequeue_events(task, sender, first, last, tag, &events,
+ ISC_TRUE);
+
+ for (event = HEAD(events); event != NULL; event = next_event) {
+ next_event = NEXT(event, ev_link);
+ isc_event_free(&event);
+ }
+
+ /*
+ * Note that purging never changes the state of the task.
+ */
+
+ return (count);
+}
+
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_purge(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag)
+{
+ /*
+ * Purge events from a task's event queue.
+ */
+
+ XTRACE("isc_task_purge");
+
+ return (isc__task_purgerange(task, sender, type, type, tag));
+}
+
+ISC_TASKFUNC_SCOPE isc_boolean_t
+isc__task_purgeevent(isc_task_t *task0, isc_event_t *event) {
+ isc__task_t *task = (isc__task_t *)task0;
+ isc_event_t *curr_event, *next_event;
+
+ /*
+ * Purge 'event' from a task's event queue.
+ *
+ * XXXRTH: WARNING: This method may be removed before beta.
+ */
+
+ REQUIRE(VALID_TASK(task));
+
+ /*
+ * If 'event' is on the task's event queue, it will be purged,
+ * unless it is marked as unpurgeable. 'event' does not have to be
+ * on the task's event queue; in fact, it can even be an invalid
+ * pointer. Purging only occurs if the event is actually on the task's
+ * event queue.
+ *
+ * Purging never changes the state of the task.
+ */
+
+ LOCK(&task->lock);
+ for (curr_event = HEAD(task->events);
+ curr_event != NULL;
+ curr_event = next_event) {
+ next_event = NEXT(curr_event, ev_link);
+ if (curr_event == event && PURGE_OK(event)) {
+ DEQUEUE(task->events, curr_event, ev_link);
+ break;
+ }
+ }
+ UNLOCK(&task->lock);
+
+ if (curr_event == NULL)
+ return (ISC_FALSE);
+
+ isc_event_free(&curr_event);
+
+ return (ISC_TRUE);
+}
+
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_unsendrange(isc_task_t *task, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag,
+ isc_eventlist_t *events)
+{
+ /*
+ * Remove events from a task's event queue.
+ */
+
+ XTRACE("isc_task_unsendrange");
+
+ return (dequeue_events((isc__task_t *)task, sender, first,
+ last, tag, events, ISC_FALSE));
+}
+
+ISC_TASKFUNC_SCOPE unsigned int
+isc__task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag, isc_eventlist_t *events)
+{
+ /*
+ * Remove events from a task's event queue.
+ */
+
+ XTRACE("isc_task_unsend");
+
+ return (dequeue_events((isc__task_t *)task, sender, type,
+ type, tag, events, ISC_FALSE));
+}
+
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__task_onshutdown(isc_task_t *task0, isc_taskaction_t action,
+ const void *arg)
+{
+ isc__task_t *task = (isc__task_t *)task0;
+ isc_boolean_t disallowed = ISC_FALSE;
+ isc_result_t result = ISC_R_SUCCESS;
+ isc_event_t *event;
+
+ /*
+ * Send a shutdown event with action 'action' and argument 'arg' when
+ * 'task' is shutdown.
+ */
+
+ REQUIRE(VALID_TASK(task));
+ REQUIRE(action != NULL);
+
+ event = isc_event_allocate(task->manager->mctx,
+ NULL,
+ ISC_TASKEVENT_SHUTDOWN,
+ action,
+ arg,
+ sizeof(*event));
+ if (event == NULL)
+ return (ISC_R_NOMEMORY);
+
+ LOCK(&task->lock);
+ if (TASK_SHUTTINGDOWN(task)) {
+ disallowed = ISC_TRUE;
+ result = ISC_R_SHUTTINGDOWN;
+ } else
+ ENQUEUE(task->on_shutdown, event, ev_link);
+ UNLOCK(&task->lock);
+
+ if (disallowed)
+ isc_mem_put(task->manager->mctx, event, sizeof(*event));
+
+ return (result);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_shutdown(isc_task_t *task0) {
+ isc__task_t *task = (isc__task_t *)task0;
+ isc_boolean_t was_idle;
+
+ /*
+ * Shutdown 'task'.
+ */
+
+ REQUIRE(VALID_TASK(task));
+
+ LOCK(&task->lock);
+ was_idle = task_shutdown(task);
+ UNLOCK(&task->lock);
+
+ if (was_idle)
+ task_ready(task);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_destroy(isc_task_t **taskp) {
+
+ /*
+ * Destroy '*taskp'.
+ */
+
+ REQUIRE(taskp != NULL);
+
+ isc_task_shutdown(*taskp);
+ isc_task_detach(taskp);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_setname(isc_task_t *task0, const char *name, void *tag) {
+ isc__task_t *task = (isc__task_t *)task0;
+
+ /*
+ * Name 'task'.
+ */
+
+ REQUIRE(VALID_TASK(task));
+
+ LOCK(&task->lock);
+ memset(task->name, 0, sizeof(task->name));
+ strncpy(task->name, name, sizeof(task->name) - 1);
+ task->tag = tag;
+ UNLOCK(&task->lock);
+}
+
+ISC_TASKFUNC_SCOPE const char *
+isc__task_getname(isc_task_t *task0) {
+ isc__task_t *task = (isc__task_t *)task0;
+
+ REQUIRE(VALID_TASK(task));
+
+ return (task->name);
+}
+
+ISC_TASKFUNC_SCOPE void *
+isc__task_gettag(isc_task_t *task0) {
+ isc__task_t *task = (isc__task_t *)task0;
+
+ REQUIRE(VALID_TASK(task));
+
+ return (task->tag);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_getcurrenttime(isc_task_t *task0, isc_stdtime_t *t) {
+ isc__task_t *task = (isc__task_t *)task0;
+
+ REQUIRE(VALID_TASK(task));
+ REQUIRE(t != NULL);
+
+ LOCK(&task->lock);
+ *t = task->now;
+ UNLOCK(&task->lock);
+}
+
+/***
+ *** Task Manager.
+ ***/
+
+/*
+ * Return ISC_TRUE if the current ready list for the manager, which is
+ * either ready_tasks or the ready_priority_tasks, depending on whether
+ * the manager is currently in normal or privileged execution mode.
+ *
+ * Caller must hold the task manager lock.
+ */
+static inline isc_boolean_t
+empty_readyq(isc__taskmgr_t *manager) {
+ isc__tasklist_t queue;
+
+ if (manager->mode == isc_taskmgrmode_normal)
+ queue = manager->ready_tasks;
+ else
+ queue = manager->ready_priority_tasks;
+
+ return (ISC_TF(EMPTY(queue)));
+}
+
+/*
+ * Dequeue and return a pointer to the first task on the current ready
+ * list for the manager.
+ * If the task is privileged, dequeue it from the other ready list
+ * as well.
+ *
+ * Caller must hold the task manager lock.
+ */
+static inline isc__task_t *
+pop_readyq(isc__taskmgr_t *manager) {
+ isc__task_t *task;
+
+ if (manager->mode == isc_taskmgrmode_normal)
+ task = HEAD(manager->ready_tasks);
+ else
+ task = HEAD(manager->ready_priority_tasks);
+
+ if (task != NULL) {
+ DEQUEUE(manager->ready_tasks, task, ready_link);
+ if (ISC_LINK_LINKED(task, ready_priority_link))
+ DEQUEUE(manager->ready_priority_tasks, task,
+ ready_priority_link);
+ }
+
+ return (task);
+}
+
+/*
+ * Push 'task' onto the ready_tasks queue. If 'task' has the privilege
+ * flag set, then also push it onto the ready_priority_tasks queue.
+ *
+ * Caller must hold the task manager lock.
+ */
+static inline void
+push_readyq(isc__taskmgr_t *manager, isc__task_t *task) {
+ ENQUEUE(manager->ready_tasks, task, ready_link);
+ if ((task->flags & TASK_F_PRIVILEGED) != 0)
+ ENQUEUE(manager->ready_priority_tasks, task,
+ ready_priority_link);
+}
+
+static void
+dispatch(isc__taskmgr_t *manager) {
+ isc__task_t *task;
+#ifndef USE_WORKER_THREADS
+ unsigned int total_dispatch_count = 0;
+ isc__tasklist_t new_ready_tasks;
+ isc__tasklist_t new_priority_tasks;
+#endif /* USE_WORKER_THREADS */
+
+ REQUIRE(VALID_MANAGER(manager));
+
+ /*
+ * Again we're trying to hold the lock for as short a time as possible
+ * and to do as little locking and unlocking as possible.
+ *
+ * In both while loops, the appropriate lock must be held before the
+ * while body starts. Code which acquired the lock at the top of
+ * the loop would be more readable, but would result in a lot of
+ * extra locking. Compare:
+ *
+ * Straightforward:
+ *
+ * LOCK();
+ * ...
+ * UNLOCK();
+ * while (expression) {
+ * LOCK();
+ * ...
+ * UNLOCK();
+ *
+ * Unlocked part here...
+ *
+ * LOCK();
+ * ...
+ * UNLOCK();
+ * }
+ *
+ * Note how if the loop continues we unlock and then immediately lock.
+ * For N iterations of the loop, this code does 2N+1 locks and 2N+1
+ * unlocks. Also note that the lock is not held when the while
+ * condition is tested, which may or may not be important, depending
+ * on the expression.
+ *
+ * As written:
+ *
+ * LOCK();
+ * while (expression) {
+ * ...
+ * UNLOCK();
+ *
+ * Unlocked part here...
+ *
+ * LOCK();
+ * ...
+ * }
+ * UNLOCK();
+ *
+ * For N iterations of the loop, this code does N+1 locks and N+1
+ * unlocks. The while expression is always protected by the lock.
+ */
+
+#ifndef USE_WORKER_THREADS
+ ISC_LIST_INIT(new_ready_tasks);
+ ISC_LIST_INIT(new_priority_tasks);
+#endif
+ LOCK(&manager->lock);
+
+ while (!FINISHED(manager)) {
+#ifdef USE_WORKER_THREADS
+ /*
+ * For reasons similar to those given in the comment in
+ * isc_task_send() above, it is safe for us to dequeue
+ * the task while only holding the manager lock, and then
+ * change the task to running state while only holding the
+ * task lock.
+ *
+ * If a pause has been requested, don't do any work
+ * until it's been released.
+ */
+ while ((empty_readyq(manager) || manager->pause_requested ||
+ manager->exclusive_requested) && !FINISHED(manager))
+ {
+ XTHREADTRACE(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_WAIT, "wait"));
+ WAIT(&manager->work_available, &manager->lock);
+ XTHREADTRACE(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TASK,
+ ISC_MSG_AWAKE, "awake"));
+ }
+#else /* USE_WORKER_THREADS */
+ if (total_dispatch_count >= DEFAULT_TASKMGR_QUANTUM ||
+ empty_readyq(manager))
+ break;
+#endif /* USE_WORKER_THREADS */
+ XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK,
+ ISC_MSG_WORKING, "working"));
+
+ task = pop_readyq(manager);
+ if (task != NULL) {
+ unsigned int dispatch_count = 0;
+ isc_boolean_t done = ISC_FALSE;
+ isc_boolean_t requeue = ISC_FALSE;
+ isc_boolean_t finished = ISC_FALSE;
+ isc_event_t *event;
+
+ INSIST(VALID_TASK(task));
+
+ /*
+ * Note we only unlock the manager lock if we actually
+ * have a task to do. We must reacquire the manager
+ * lock before exiting the 'if (task != NULL)' block.
+ */
+ manager->tasks_running++;
+ UNLOCK(&manager->lock);
+
+ LOCK(&task->lock);
+ INSIST(task->state == task_state_ready);
+ task->state = task_state_running;
+ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_RUNNING, "running"));
+ isc_stdtime_get(&task->now);
+ do {
+ if (!EMPTY(task->events)) {
+ event = HEAD(task->events);
+ DEQUEUE(task->events, event, ev_link);
+
+ /*
+ * Execute the event action.
+ */
+ XTRACE(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TASK,
+ ISC_MSG_EXECUTE,
+ "execute action"));
+ if (event->ev_action != NULL) {
+ UNLOCK(&task->lock);
+ (event->ev_action)(
+ (isc_task_t *)task,
+ event);
+ LOCK(&task->lock);
+ }
+ dispatch_count++;
+#ifndef USE_WORKER_THREADS
+ total_dispatch_count++;
+#endif /* USE_WORKER_THREADS */
+ }
+
+ if (task->references == 0 &&
+ EMPTY(task->events) &&
+ !TASK_SHUTTINGDOWN(task)) {
+ isc_boolean_t was_idle;
+
+ /*
+ * There are no references and no
+ * pending events for this task,
+ * which means it will not become
+ * runnable again via an external
+ * action (such as sending an event
+ * or detaching).
+ *
+ * We initiate shutdown to prevent
+ * it from becoming a zombie.
+ *
+ * We do this here instead of in
+ * the "if EMPTY(task->events)" block
+ * below because:
+ *
+ * If we post no shutdown events,
+ * we want the task to finish.
+ *
+ * If we did post shutdown events,
+ * will still want the task's
+ * quantum to be applied.
+ */
+ was_idle = task_shutdown(task);
+ INSIST(!was_idle);
+ }
+
+ if (EMPTY(task->events)) {
+ /*
+ * Nothing else to do for this task
+ * right now.
+ */
+ XTRACE(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TASK,
+ ISC_MSG_EMPTY,
+ "empty"));
+ if (task->references == 0 &&
+ TASK_SHUTTINGDOWN(task)) {
+ /*
+ * The task is done.
+ */
+ XTRACE(isc_msgcat_get(
+ isc_msgcat,
+ ISC_MSGSET_TASK,
+ ISC_MSG_DONE,
+ "done"));
+ finished = ISC_TRUE;
+ task->state = task_state_done;
+ } else
+ task->state = task_state_idle;
+ done = ISC_TRUE;
+ } else if (dispatch_count >= task->quantum) {
+ /*
+ * Our quantum has expired, but
+ * there is more work to be done.
+ * We'll requeue it to the ready
+ * queue later.
+ *
+ * We don't check quantum until
+ * dispatching at least one event,
+ * so the minimum quantum is one.
+ */
+ XTRACE(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TASK,
+ ISC_MSG_QUANTUM,
+ "quantum"));
+ task->state = task_state_ready;
+ requeue = ISC_TRUE;
+ done = ISC_TRUE;
+ }
+ } while (!done);
+ UNLOCK(&task->lock);
+
+ if (finished)
+ task_finished(task);
+
+ LOCK(&manager->lock);
+ manager->tasks_running--;
+#ifdef USE_WORKER_THREADS
+ if (manager->exclusive_requested &&
+ manager->tasks_running == 1) {
+ SIGNAL(&manager->exclusive_granted);
+ } else if (manager->pause_requested &&
+ manager->tasks_running == 0) {
+ SIGNAL(&manager->paused);
+ }
+#endif /* USE_WORKER_THREADS */
+ if (requeue) {
+ /*
+ * We know we're awake, so we don't have
+ * to wakeup any sleeping threads if the
+ * ready queue is empty before we requeue.
+ *
+ * A possible optimization if the queue is
+ * empty is to 'goto' the 'if (task != NULL)'
+ * block, avoiding the ENQUEUE of the task
+ * and the subsequent immediate DEQUEUE
+ * (since it is the only executable task).
+ * We don't do this because then we'd be
+ * skipping the exit_requested check. The
+ * cost of ENQUEUE is low anyway, especially
+ * when you consider that we'd have to do
+ * an extra EMPTY check to see if we could
+ * do the optimization. If the ready queue
+ * were usually nonempty, the 'optimization'
+ * might even hurt rather than help.
+ */
+#ifdef USE_WORKER_THREADS
+ push_readyq(manager, task);
+#else
+ ENQUEUE(new_ready_tasks, task, ready_link);
+ if ((task->flags & TASK_F_PRIVILEGED) != 0)
+ ENQUEUE(new_priority_tasks, task,
+ ready_priority_link);
+#endif
+ }
+ }
+
+#ifdef USE_WORKER_THREADS
+ /*
+ * If we are in privileged execution mode and there are no
+ * tasks remaining on the current ready queue, then
+ * we're stuck. Automatically drop privileges at that
+ * point and continue with the regular ready queue.
+ */
+ if (manager->tasks_running == 0 && empty_readyq(manager)) {
+ manager->mode = isc_taskmgrmode_normal;
+ if (!empty_readyq(manager))
+ BROADCAST(&manager->work_available);
+ }
+#endif
+ }
+
+#ifndef USE_WORKER_THREADS
+ ISC_LIST_APPENDLIST(manager->ready_tasks, new_ready_tasks, ready_link);
+ ISC_LIST_APPENDLIST(manager->ready_priority_tasks, new_priority_tasks,
+ ready_priority_link);
+ if (empty_readyq(manager))
+ manager->mode = isc_taskmgrmode_normal;
+#endif
+
+ UNLOCK(&manager->lock);
+}
+
+#ifdef USE_WORKER_THREADS
+static isc_threadresult_t
+#ifdef _WIN32
+WINAPI
+#endif
+run(void *uap) {
+ isc__taskmgr_t *manager = uap;
+
+ XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_STARTING, "starting"));
+
+ dispatch(manager);
+
+ XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_EXITING, "exiting"));
+
+#ifdef OPENSSL_LEAKS
+ ERR_remove_state(0);
+#endif
+
+ return ((isc_threadresult_t)0);
+}
+#endif /* USE_WORKER_THREADS */
+
+static void
+manager_free(isc__taskmgr_t *manager) {
+ isc_mem_t *mctx;
+
+ LOCK(&manager->lock);
+#ifdef USE_WORKER_THREADS
+ (void)isc_condition_destroy(&manager->exclusive_granted);
+ (void)isc_condition_destroy(&manager->work_available);
+ (void)isc_condition_destroy(&manager->paused);
+ isc_mem_free(manager->mctx, manager->threads);
+#endif /* USE_WORKER_THREADS */
+ manager->common.impmagic = 0;
+ manager->common.magic = 0;
+ mctx = manager->mctx;
+ UNLOCK(&manager->lock);
+ DESTROYLOCK(&manager->lock);
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ isc_mem_detach(&mctx);
+
+#ifdef USE_SHARED_MANAGER
+ taskmgr = NULL;
+#endif /* USE_SHARED_MANAGER */
+}
+
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
+ unsigned int default_quantum, isc_taskmgr_t **managerp)
+{
+ isc_result_t result;
+ unsigned int i, started = 0;
+ isc__taskmgr_t *manager;
+
+ /*
+ * Create a new task manager.
+ */
+
+ REQUIRE(workers > 0);
+ REQUIRE(managerp != NULL && *managerp == NULL);
+
+#ifndef USE_WORKER_THREADS
+ UNUSED(i);
+ UNUSED(started);
+#endif
+
+#ifdef USE_SHARED_MANAGER
+ if (taskmgr != NULL) {
+ if (taskmgr->refs == 0)
+ return (ISC_R_SHUTTINGDOWN);
+ taskmgr->refs++;
+ *managerp = (isc_taskmgr_t *)taskmgr;
+ return (ISC_R_SUCCESS);
+ }
+#endif /* USE_SHARED_MANAGER */
+
+ manager = isc_mem_get(mctx, sizeof(*manager));
+ if (manager == NULL)
+ return (ISC_R_NOMEMORY);
+ manager->common.methods = &taskmgrmethods;
+ manager->common.impmagic = TASK_MANAGER_MAGIC;
+ manager->common.magic = ISCAPI_TASKMGR_MAGIC;
+ manager->mode = isc_taskmgrmode_normal;
+ manager->mctx = NULL;
+ result = isc_mutex_init(&manager->lock);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup_mgr;
+ LOCK(&manager->lock);
+
+#ifdef USE_WORKER_THREADS
+ manager->workers = 0;
+ manager->threads = isc_mem_allocate(mctx,
+ workers * sizeof(isc_thread_t));
+ if (manager->threads == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto cleanup_lock;
+ }
+ if (isc_condition_init(&manager->work_available) != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ result = ISC_R_UNEXPECTED;
+ goto cleanup_threads;
+ }
+ if (isc_condition_init(&manager->exclusive_granted) != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ result = ISC_R_UNEXPECTED;
+ goto cleanup_workavailable;
+ }
+ if (isc_condition_init(&manager->paused) != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ result = ISC_R_UNEXPECTED;
+ goto cleanup_exclusivegranted;
+ }
+#endif /* USE_WORKER_THREADS */
+ if (default_quantum == 0)
+ default_quantum = DEFAULT_DEFAULT_QUANTUM;
+ manager->default_quantum = default_quantum;
+ INIT_LIST(manager->tasks);
+ INIT_LIST(manager->ready_tasks);
+ INIT_LIST(manager->ready_priority_tasks);
+ manager->tasks_running = 0;
+ manager->exclusive_requested = ISC_FALSE;
+ manager->pause_requested = ISC_FALSE;
+ manager->exiting = ISC_FALSE;
+
+ isc_mem_attach(mctx, &manager->mctx);
+
+#ifdef USE_WORKER_THREADS
+ /*
+ * Start workers.
+ */
+ for (i = 0; i < workers; i++) {
+ if (isc_thread_create(run, manager,
+ &manager->threads[manager->workers]) ==
+ ISC_R_SUCCESS) {
+ manager->workers++;
+ started++;
+ }
+ }
+ UNLOCK(&manager->lock);
+
+ if (started == 0) {
+ manager_free(manager);
+ return (ISC_R_NOTHREADS);
+ }
+ isc_thread_setconcurrency(workers);
+#endif /* USE_WORKER_THREADS */
+#ifdef USE_SHARED_MANAGER
+ manager->refs = 1;
+ UNLOCK(&manager->lock);
+ taskmgr = manager;
+#endif /* USE_SHARED_MANAGER */
+
+ *managerp = (isc_taskmgr_t *)manager;
+
+ return (ISC_R_SUCCESS);
+
+#ifdef USE_WORKER_THREADS
+ cleanup_exclusivegranted:
+ (void)isc_condition_destroy(&manager->exclusive_granted);
+ cleanup_workavailable:
+ (void)isc_condition_destroy(&manager->work_available);
+ cleanup_threads:
+ isc_mem_free(mctx, manager->threads);
+ cleanup_lock:
+ UNLOCK(&manager->lock);
+ DESTROYLOCK(&manager->lock);
+#endif
+ cleanup_mgr:
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ return (result);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_destroy(isc_taskmgr_t **managerp) {
+ isc__taskmgr_t *manager;
+ isc__task_t *task;
+ unsigned int i;
+
+ /*
+ * Destroy '*managerp'.
+ */
+
+ REQUIRE(managerp != NULL);
+ manager = (isc__taskmgr_t *)*managerp;
+ REQUIRE(VALID_MANAGER(manager));
+
+#ifndef USE_WORKER_THREADS
+ UNUSED(i);
+#endif /* USE_WORKER_THREADS */
+
+#ifdef USE_SHARED_MANAGER
+ manager->refs--;
+ if (manager->refs > 0) {
+ *managerp = NULL;
+ return;
+ }
+#endif
+
+ XTHREADTRACE("isc_taskmgr_destroy");
+ /*
+ * Only one non-worker thread may ever call this routine.
+ * If a worker thread wants to initiate shutdown of the
+ * task manager, it should ask some non-worker thread to call
+ * isc_taskmgr_destroy(), e.g. by signalling a condition variable
+ * that the startup thread is sleeping on.
+ */
+
+ /*
+ * Unlike elsewhere, we're going to hold this lock a long time.
+ * We need to do so, because otherwise the list of tasks could
+ * change while we were traversing it.
+ *
+ * This is also the only function where we will hold both the
+ * task manager lock and a task lock at the same time.
+ */
+
+ LOCK(&manager->lock);
+
+ /*
+ * Make sure we only get called once.
+ */
+ INSIST(!manager->exiting);
+ manager->exiting = ISC_TRUE;
+
+ /*
+ * If privileged mode was on, turn it off.
+ */
+ manager->mode = isc_taskmgrmode_normal;
+
+ /*
+ * Post shutdown event(s) to every task (if they haven't already been
+ * posted).
+ */
+ for (task = HEAD(manager->tasks);
+ task != NULL;
+ task = NEXT(task, link)) {
+ LOCK(&task->lock);
+ if (task_shutdown(task))
+ push_readyq(manager, task);
+ UNLOCK(&task->lock);
+ }
+#ifdef USE_WORKER_THREADS
+ /*
+ * Wake up any sleeping workers. This ensures we get work done if
+ * there's work left to do, and if there are already no tasks left
+ * it will cause the workers to see manager->exiting.
+ */
+ BROADCAST(&manager->work_available);
+ UNLOCK(&manager->lock);
+
+ /*
+ * Wait for all the worker threads to exit.
+ */
+ for (i = 0; i < manager->workers; i++)
+ (void)isc_thread_join(manager->threads[i], NULL);
+#else /* USE_WORKER_THREADS */
+ /*
+ * Dispatch the shutdown events.
+ */
+ UNLOCK(&manager->lock);
+ while (isc__taskmgr_ready((isc_taskmgr_t *)manager))
+ (void)isc__taskmgr_dispatch((isc_taskmgr_t *)manager);
+#ifdef BIND9
+ if (!ISC_LIST_EMPTY(manager->tasks))
+ isc_mem_printallactive(stderr);
+#endif
+ INSIST(ISC_LIST_EMPTY(manager->tasks));
+#ifdef USE_SHARED_MANAGER
+ taskmgr = NULL;
+#endif
+#endif /* USE_WORKER_THREADS */
+
+ manager_free(manager);
+
+ *managerp = NULL;
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_setmode(isc_taskmgr_t *manager0, isc_taskmgrmode_t mode) {
+ isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
+
+ LOCK(&manager->lock);
+ manager->mode = mode;
+ UNLOCK(&manager->lock);
+}
+
+ISC_TASKFUNC_SCOPE isc_taskmgrmode_t
+isc__taskmgr_mode(isc_taskmgr_t *manager0) {
+ isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
+ isc_taskmgrmode_t mode;
+ LOCK(&manager->lock);
+ mode = manager->mode;
+ UNLOCK(&manager->lock);
+ return (mode);
+}
+
+#ifndef USE_WORKER_THREADS
+isc_boolean_t
+isc__taskmgr_ready(isc_taskmgr_t *manager0) {
+ isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
+ isc_boolean_t is_ready;
+
+#ifdef USE_SHARED_MANAGER
+ if (manager == NULL)
+ manager = taskmgr;
+#endif
+ if (manager == NULL)
+ return (ISC_FALSE);
+
+ LOCK(&manager->lock);
+ is_ready = !empty_readyq(manager);
+ UNLOCK(&manager->lock);
+
+ return (is_ready);
+}
+
+isc_result_t
+isc__taskmgr_dispatch(isc_taskmgr_t *manager0) {
+ isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
+
+#ifdef USE_SHARED_MANAGER
+ if (manager == NULL)
+ manager = taskmgr;
+#endif
+ if (manager == NULL)
+ return (ISC_R_NOTFOUND);
+
+ dispatch(manager);
+
+ return (ISC_R_SUCCESS);
+}
+
+#else
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_pause(isc_taskmgr_t *manager0) {
+ isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
+ LOCK(&manager->lock);
+ while (manager->tasks_running > 0) {
+ WAIT(&manager->paused, &manager->lock);
+ }
+ manager->pause_requested = ISC_TRUE;
+ UNLOCK(&manager->lock);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__taskmgr_resume(isc_taskmgr_t *manager0) {
+ isc__taskmgr_t *manager = (isc__taskmgr_t *)manager0;
+
+ LOCK(&manager->lock);
+ if (manager->pause_requested) {
+ manager->pause_requested = ISC_FALSE;
+ BROADCAST(&manager->work_available);
+ }
+ UNLOCK(&manager->lock);
+}
+#endif /* USE_WORKER_THREADS */
+
+ISC_TASKFUNC_SCOPE isc_result_t
+isc__task_beginexclusive(isc_task_t *task0) {
+#ifdef USE_WORKER_THREADS
+ isc__task_t *task = (isc__task_t *)task0;
+ isc__taskmgr_t *manager = task->manager;
+ REQUIRE(task->state == task_state_running);
+ LOCK(&manager->lock);
+ if (manager->exclusive_requested) {
+ UNLOCK(&manager->lock);
+ return (ISC_R_LOCKBUSY);
+ }
+ manager->exclusive_requested = ISC_TRUE;
+ while (manager->tasks_running > 1) {
+ WAIT(&manager->exclusive_granted, &manager->lock);
+ }
+ UNLOCK(&manager->lock);
+#else
+ UNUSED(task0);
+#endif
+ return (ISC_R_SUCCESS);
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_endexclusive(isc_task_t *task0) {
+#ifdef USE_WORKER_THREADS
+ isc__task_t *task = (isc__task_t *)task0;
+ isc__taskmgr_t *manager = task->manager;
+
+ REQUIRE(task->state == task_state_running);
+ LOCK(&manager->lock);
+ REQUIRE(manager->exclusive_requested);
+ manager->exclusive_requested = ISC_FALSE;
+ BROADCAST(&manager->work_available);
+ UNLOCK(&manager->lock);
+#else
+ UNUSED(task0);
+#endif
+}
+
+ISC_TASKFUNC_SCOPE void
+isc__task_setprivilege(isc_task_t *task0, isc_boolean_t priv) {
+ isc__task_t *task = (isc__task_t *)task0;
+ isc__taskmgr_t *manager = task->manager;
+ isc_boolean_t oldpriv;
+
+ LOCK(&task->lock);
+ oldpriv = ISC_TF((task->flags & TASK_F_PRIVILEGED) != 0);
+ if (priv)
+ task->flags |= TASK_F_PRIVILEGED;
+ else
+ task->flags &= ~TASK_F_PRIVILEGED;
+ UNLOCK(&task->lock);
+
+ if (priv == oldpriv)
+ return;
+
+ LOCK(&manager->lock);
+ if (priv && ISC_LINK_LINKED(task, ready_link))
+ ENQUEUE(manager->ready_priority_tasks, task,
+ ready_priority_link);
+ else if (!priv && ISC_LINK_LINKED(task, ready_priority_link))
+ DEQUEUE(manager->ready_priority_tasks, task,
+ ready_priority_link);
+ UNLOCK(&manager->lock);
+}
+
+ISC_TASKFUNC_SCOPE isc_boolean_t
+isc__task_privilege(isc_task_t *task0) {
+ isc__task_t *task = (isc__task_t *)task0;
+ isc_boolean_t priv;
+
+ LOCK(&task->lock);
+ priv = ISC_TF((task->flags & TASK_F_PRIVILEGED) != 0);
+ UNLOCK(&task->lock);
+ return (priv);
+}
+
+#ifdef USE_SOCKETIMPREGISTER
+isc_result_t
+isc__task_register() {
+ return (isc_task_register(isc__taskmgr_create));
+}
+#endif
+
+isc_boolean_t
+isc_task_exiting(isc_task_t *t) {
+ isc__task_t *task = (isc__task_t *)t;
+
+ REQUIRE(VALID_TASK(task));
+ return (TASK_SHUTTINGDOWN(task));
+}
+
+
+#if defined(HAVE_LIBXML2) && defined(BIND9)
+void
+isc_taskmgr_renderxml(isc_taskmgr_t *mgr0, xmlTextWriterPtr writer) {
+ isc__taskmgr_t *mgr = (isc__taskmgr_t *)mgr0;
+ isc__task_t *task;
+
+ LOCK(&mgr->lock);
+
+ /*
+ * Write out the thread-model, and some details about each depending
+ * on which type is enabled.
+ */
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "thread-model");
+#ifdef ISC_PLATFORM_USETHREADS
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "type");
+ xmlTextWriterWriteString(writer, ISC_XMLCHAR "threaded");
+ xmlTextWriterEndElement(writer); /* type */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "worker-threads");
+ xmlTextWriterWriteFormatString(writer, "%d", mgr->workers);
+ xmlTextWriterEndElement(writer); /* worker-threads */
+#else /* ISC_PLATFORM_USETHREADS */
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "type");
+ xmlTextWriterWriteString(writer, ISC_XMLCHAR "non-threaded");
+ xmlTextWriterEndElement(writer); /* type */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
+ xmlTextWriterWriteFormatString(writer, "%d", mgr->refs);
+ xmlTextWriterEndElement(writer); /* references */
+#endif /* ISC_PLATFORM_USETHREADS */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "default-quantum");
+ xmlTextWriterWriteFormatString(writer, "%d", mgr->default_quantum);
+ xmlTextWriterEndElement(writer); /* default-quantum */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "tasks-running");
+ xmlTextWriterWriteFormatString(writer, "%d", mgr->tasks_running);
+ xmlTextWriterEndElement(writer); /* tasks-running */
+
+ xmlTextWriterEndElement(writer); /* thread-model */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "tasks");
+ task = ISC_LIST_HEAD(mgr->tasks);
+ while (task != NULL) {
+ LOCK(&task->lock);
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "task");
+
+ if (task->name[0] != 0) {
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "name");
+ xmlTextWriterWriteFormatString(writer, "%s",
+ task->name);
+ xmlTextWriterEndElement(writer); /* name */
+ }
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
+ xmlTextWriterWriteFormatString(writer, "%d", task->references);
+ xmlTextWriterEndElement(writer); /* references */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "id");
+ xmlTextWriterWriteFormatString(writer, "%p", task);
+ xmlTextWriterEndElement(writer); /* id */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "state");
+ xmlTextWriterWriteFormatString(writer, "%s",
+ statenames[task->state]);
+ xmlTextWriterEndElement(writer); /* state */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "quantum");
+ xmlTextWriterWriteFormatString(writer, "%d", task->quantum);
+ xmlTextWriterEndElement(writer); /* quantum */
+
+ xmlTextWriterEndElement(writer);
+
+ UNLOCK(&task->lock);
+ task = ISC_LIST_NEXT(task, link);
+ }
+ xmlTextWriterEndElement(writer); /* tasks */
+
+ UNLOCK(&mgr->lock);
+}
+#endif /* HAVE_LIBXML2 && BIND9 */
diff --git a/lib/isc/task_api.c b/lib/isc/task_api.c
new file mode 100644
index 0000000..34510ff
--- /dev/null
+++ b/lib/isc/task_api.c
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2009-2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <isc/app.h>
+#include <isc/magic.h>
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/task.h>
+#include <isc/util.h>
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_taskmgrcreatefunc_t taskmgr_createfunc = NULL;
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_task_register(isc_taskmgrcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (taskmgr_createfunc == NULL)
+ taskmgr_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_taskmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ unsigned int workers, unsigned int default_quantum,
+ isc_taskmgr_t **managerp)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(taskmgr_createfunc != NULL);
+ result = (*taskmgr_createfunc)(mctx, workers, default_quantum,
+ managerp);
+
+ UNLOCK(&createlock);
+
+ if (result == ISC_R_SUCCESS)
+ isc_appctx_settaskmgr(actx, *managerp);
+
+ return (result);
+}
+
+isc_result_t
+isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
+ unsigned int default_quantum, isc_taskmgr_t **managerp)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(taskmgr_createfunc != NULL);
+ result = (*taskmgr_createfunc)(mctx, workers, default_quantum,
+ managerp);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_taskmgr_destroy(isc_taskmgr_t **managerp) {
+ REQUIRE(managerp != NULL && ISCAPI_TASKMGR_VALID(*managerp));
+
+ (*managerp)->methods->destroy(managerp);
+
+ ENSURE(*managerp == NULL);
+}
+
+void
+isc_taskmgr_setmode(isc_taskmgr_t *manager, isc_taskmgrmode_t mode) {
+ REQUIRE(ISCAPI_TASKMGR_VALID(manager));
+
+ manager->methods->setmode(manager, mode);
+}
+
+isc_taskmgrmode_t
+isc_taskmgr_mode(isc_taskmgr_t *manager) {
+ REQUIRE(ISCAPI_TASKMGR_VALID(manager));
+
+ return (manager->methods->mode(manager));
+}
+
+isc_result_t
+isc_task_create(isc_taskmgr_t *manager, unsigned int quantum,
+ isc_task_t **taskp)
+{
+ REQUIRE(ISCAPI_TASKMGR_VALID(manager));
+ REQUIRE(taskp != NULL && *taskp == NULL);
+
+ return (manager->methods->taskcreate(manager, quantum, taskp));
+}
+
+void
+isc_task_attach(isc_task_t *source, isc_task_t **targetp) {
+ REQUIRE(ISCAPI_TASK_VALID(source));
+ REQUIRE(targetp != NULL && *targetp == NULL);
+
+ source->methods->attach(source, targetp);
+
+ ENSURE(*targetp == source);
+}
+
+void
+isc_task_detach(isc_task_t **taskp) {
+ REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp));
+
+ (*taskp)->methods->detach(taskp);
+
+ ENSURE(*taskp == NULL);
+}
+
+void
+isc_task_send(isc_task_t *task, isc_event_t **eventp) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+ REQUIRE(eventp != NULL && *eventp != NULL);
+
+ task->methods->send(task, eventp);
+
+ ENSURE(*eventp == NULL);
+}
+
+void
+isc_task_sendanddetach(isc_task_t **taskp, isc_event_t **eventp) {
+ REQUIRE(taskp != NULL && ISCAPI_TASK_VALID(*taskp));
+ REQUIRE(eventp != NULL && *eventp != NULL);
+
+ (*taskp)->methods->sendanddetach(taskp, eventp);
+
+ ENSURE(*taskp == NULL && *eventp == NULL);
+}
+
+unsigned int
+isc_task_unsend(isc_task_t *task, void *sender, isc_eventtype_t type,
+ void *tag, isc_eventlist_t *events)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ return (task->methods->unsend(task, sender, type, tag, events));
+}
+
+isc_result_t
+isc_task_onshutdown(isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ return (task->methods->onshutdown(task, action, arg));
+}
+
+void
+isc_task_shutdown(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ task->methods->shutdown(task);
+}
+
+void
+isc_task_setname(isc_task_t *task, const char *name, void *tag) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ task->methods->setname(task, name, tag);
+}
+
+unsigned int
+isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type, void *tag)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ return (task->methods->purgeevents(task, sender, type, tag));
+}
+
+isc_result_t
+isc_task_beginexclusive(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ return (task->methods->beginexclusive(task));
+}
+
+void
+isc_task_endexclusive(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ task->methods->endexclusive(task);
+}
+
+void
+isc_task_setprivilege(isc_task_t *task, isc_boolean_t priv) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ task->methods->setprivilege(task, priv);
+}
+
+isc_boolean_t
+isc_task_privilege(isc_task_t *task) {
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ return (task->methods->privilege(task));
+}
+
+
+/*%
+ * This is necessary for libisc's internal timer implementation. Other
+ * implementation might skip implementing this.
+ */
+unsigned int
+isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first,
+ isc_eventtype_t last, void *tag)
+{
+ REQUIRE(ISCAPI_TASK_VALID(task));
+
+ return (task->methods->purgerange(task, sender, first, last, tag));
+}
diff --git a/lib/isc/task_p.h b/lib/isc/task_p.h
new file mode 100644
index 0000000..8c1e4c5
--- /dev/null
+++ b/lib/isc/task_p.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_TASK_P_H
+#define ISC_TASK_P_H
+
+/*! \file */
+
+#if defined(BIND9) && defined(ISC_PLATFORM_USETHREADS)
+void
+isc__taskmgr_pause(isc_taskmgr_t *taskmgr);
+
+void
+isc__taskmgr_resume(isc_taskmgr_t *taskmgr);
+#else
+isc_boolean_t
+isc__taskmgr_ready(isc_taskmgr_t *taskmgr);
+
+isc_result_t
+isc__taskmgr_dispatch(isc_taskmgr_t *taskmgr);
+#endif /* !BIND9 || !ISC_PLATFORM_USETHREADS */
+
+#endif /* ISC_TASK_P_H */
diff --git a/lib/isc/taskpool.c b/lib/isc/taskpool.c
new file mode 100644
index 0000000..25d9516
--- /dev/null
+++ b/lib/isc/taskpool.c
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/mem.h>
+#include <isc/random.h>
+#include <isc/taskpool.h>
+#include <isc/util.h>
+
+/***
+ *** Types.
+ ***/
+
+struct isc_taskpool {
+ isc_mem_t * mctx;
+ isc_taskmgr_t * tmgr;
+ unsigned int ntasks;
+ unsigned int quantum;
+ isc_task_t ** tasks;
+};
+
+/***
+ *** Functions.
+ ***/
+
+static isc_result_t
+alloc_pool(isc_taskmgr_t *tmgr, isc_mem_t *mctx, unsigned int ntasks,
+ unsigned int quantum, isc_taskpool_t **poolp)
+{
+ isc_taskpool_t *pool;
+ unsigned int i;
+
+ pool = isc_mem_get(mctx, sizeof(*pool));
+ if (pool == NULL)
+ return (ISC_R_NOMEMORY);
+ pool->mctx = mctx;
+ pool->ntasks = ntasks;
+ pool->quantum = quantum;
+ pool->tmgr = tmgr;
+ pool->tasks = isc_mem_get(mctx, ntasks * sizeof(isc_task_t *));
+ if (pool->tasks == NULL) {
+ isc_mem_put(mctx, pool, sizeof(*pool));
+ return (ISC_R_NOMEMORY);
+ }
+ for (i = 0; i < ntasks; i++)
+ pool->tasks[i] = NULL;
+
+ *poolp = pool;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_taskpool_create(isc_taskmgr_t *tmgr, isc_mem_t *mctx,
+ unsigned int ntasks, unsigned int quantum,
+ isc_taskpool_t **poolp)
+{
+ unsigned int i;
+ isc_taskpool_t *pool = NULL;
+ isc_result_t result;
+
+ INSIST(ntasks > 0);
+
+ /* Allocate the pool structure */
+ result = alloc_pool(tmgr, mctx, ntasks, quantum, &pool);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /* Create the tasks */
+ for (i = 0; i < ntasks; i++) {
+ result = isc_task_create(tmgr, quantum, &pool->tasks[i]);
+ if (result != ISC_R_SUCCESS) {
+ isc_taskpool_destroy(&pool);
+ return (result);
+ }
+ isc_task_setname(pool->tasks[i], "taskpool", NULL);
+ }
+
+ *poolp = pool;
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_taskpool_gettask(isc_taskpool_t *pool, isc_task_t **targetp) {
+ isc_uint32_t i;
+ isc_random_get(&i);
+ isc_task_attach(pool->tasks[i % pool->ntasks], targetp);
+}
+
+int
+isc_taskpool_size(isc_taskpool_t *pool) {
+ REQUIRE(pool != NULL);
+ return (pool->ntasks);
+}
+
+isc_result_t
+isc_taskpool_expand(isc_taskpool_t **sourcep, unsigned int size,
+ isc_taskpool_t **targetp)
+{
+ isc_result_t result;
+ isc_taskpool_t *pool;
+
+ REQUIRE(sourcep != NULL && *sourcep != NULL);
+ REQUIRE(targetp != NULL && *targetp == NULL);
+
+ pool = *sourcep;
+ if (size > pool->ntasks) {
+ isc_taskpool_t *newpool = NULL;
+ unsigned int i;
+
+ /* Allocate a new pool structure */
+ result = alloc_pool(pool->tmgr, pool->mctx, size,
+ pool->quantum, &newpool);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /* Copy over the tasks from the old pool */
+ for (i = 0; i < pool->ntasks; i++) {
+ newpool->tasks[i] = pool->tasks[i];
+ pool->tasks[i] = NULL;
+ }
+
+ /* Create new tasks */
+ for (i = pool->ntasks; i < size; i++) {
+ result = isc_task_create(pool->tmgr, pool->quantum,
+ &newpool->tasks[i]);
+ if (result != ISC_R_SUCCESS) {
+ isc_taskpool_destroy(&newpool);
+ return (result);
+ }
+ isc_task_setname(newpool->tasks[i], "taskpool", NULL);
+ }
+
+ isc_taskpool_destroy(&pool);
+ pool = newpool;
+ }
+
+ *sourcep = NULL;
+ *targetp = pool;
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_taskpool_destroy(isc_taskpool_t **poolp) {
+ unsigned int i;
+ isc_taskpool_t *pool = *poolp;
+ for (i = 0; i < pool->ntasks; i++) {
+ if (pool->tasks[i] != NULL)
+ isc_task_detach(&pool->tasks[i]);
+ }
+ isc_mem_put(pool->mctx, pool->tasks,
+ pool->ntasks * sizeof(isc_task_t *));
+ isc_mem_put(pool->mctx, pool, sizeof(*pool));
+ *poolp = NULL;
+}
+
+void
+isc_taskpool_setprivilege(isc_taskpool_t *pool, isc_boolean_t priv) {
+ unsigned int i;
+
+ REQUIRE(pool != NULL);
+
+ for (i = 0; i < pool->ntasks; i++) {
+ if (pool->tasks[i] != NULL)
+ isc_task_setprivilege(pool->tasks[i], priv);
+ }
+}
diff --git a/lib/isc/tests/Atffile b/lib/isc/tests/Atffile
new file mode 100644
index 0000000..c3e044f
--- /dev/null
+++ b/lib/isc/tests/Atffile
@@ -0,0 +1,5 @@
+Content-Type: application/X-atf-atffile; version="1"
+
+prop: test-suite = bind9
+
+tp-glob: *_test
diff --git a/lib/isc/tests/hash_test.c b/lib/isc/tests/hash_test.c
new file mode 100644
index 0000000..836d7b6
--- /dev/null
+++ b/lib/isc/tests/hash_test.c
@@ -0,0 +1,1805 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/* ! \file */
+
+#include <config.h>
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <isc/hmacmd5.h>
+#include <isc/hmacsha.h>
+#include <isc/md5.h>
+#include <isc/sha1.h>
+#include <isc/util.h>
+#include <isc/string.h>
+
+/*
+ * Test data from RFC6234
+ */
+
+unsigned char digest[ISC_SHA512_DIGESTLENGTH];
+unsigned char buffer[1024];
+const char *s;
+char str[ISC_SHA512_DIGESTLENGTH];
+unsigned char key[20];
+int i = 0;
+
+isc_result_t
+tohexstr(unsigned char *d, unsigned int len, char *out);
+/*
+ * Precondition: a hexadecimal number in *d, the length of that number in len,
+ * and a pointer to a character array to put the output (*out).
+ * Postcondition: A String representation of the given hexadecimal number is
+ * placed into the array *out
+ *
+ * 'out' MUST point to an array of at least len / 2 + 1
+ *
+ * Return values: ISC_R_SUCCESS if the operation is sucessful
+ */
+
+isc_result_t
+tohexstr(unsigned char *d, unsigned int len, char *out) {
+
+ out[0]='\0';
+ char c_ret[] = "AA";
+ unsigned int i;
+ strcat(out, "0x");
+ for (i = 0; i < len; i++) {
+ sprintf(c_ret, "%02X", d[i]);
+ strcat(out, c_ret);
+ }
+ strcat(out, "\0");
+ return (ISC_R_SUCCESS);
+}
+
+
+#define TEST_INPUT(x) (x), sizeof(x)-1
+
+typedef struct hash_testcase {
+ const char *input;
+ size_t input_len;
+ const char *result;
+ int repeats;
+} hash_testcase_t;
+
+typedef struct hash_test_key {
+ const char *key;
+ const int len;
+} hash_test_key_t;
+
+/* non-hmac tests */
+
+ATF_TC(isc_sha1);
+ATF_TC_HEAD(isc_sha1, tc) {
+ atf_tc_set_md_var(tc, "descr", "sha1 examples from RFC4634");
+}
+ATF_TC_BODY(isc_sha1, tc) {
+ isc_sha1_t sha1;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("abc"),
+ "0xA9993E364706816ABA3E25717850C26C9CD0D89D",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("abcdbcdecdefdefgefghfghighijhijkijk"
+ "ljklmklmnlmnomnopnopq"),
+ "0x84983E441C3BD26EBAAE4AA1F95129E5E54670F1",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("a") /* times 1000000 */,
+ "0x34AA973CD4C4DAA4F61EEB2BDBAD27316534016F",
+ 1000000
+ },
+ /* Test 4 -- exact multiple of 512 bits */
+ {
+ TEST_INPUT("01234567012345670123456701234567"),
+ "0xDEA356A2CDDD90C7A7ECEDC5EBB563934F460452",
+ 20 /* 20 times */
+ },
+#if 0
+ /* Test 5 -- optional feature, not implemented */
+ {
+ TEST_INPUT(""),
+ /* "extrabits": 0x98 , "numberextrabits": 5 */
+ "0x29826B003B906E660EFF4027CE98AF3531AC75BA",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("\x5e"),
+ "0x5E6F80A34A9798CAFC6A5DB96CC57BA4C4DB59C2",
+ 1
+ },
+#if 0
+ /* Test 7 -- optional feature, not implemented */
+ {
+ TEST_INPUT("\x49\xb2\xae\xc2\x59\x4b\xbe\x3a"
+ "\x3b\x11\x75\x42\xd9\x4a\xc8"),
+ /* "extrabits": 0x80, "numberextrabits": 3 */
+ "0x6239781E03729919C01955B3FFA8ACB60B988340", 1 },
+#endif
+ /* Test 8 */
+ {
+ TEST_INPUT("\x9a\x7d\xfd\xf1\xec\xea\xd0\x6e\xd6\x46"
+ "\xaa\x55\xfe\x75\x71\x46"),
+ "0x82ABFF6605DBE1C17DEF12A394FA22A82B544A35",
+ 1
+ },
+#if 0
+ /* Test 9 -- optional feature, not implemented */
+ {
+ TEST_INPUT("\x65\xf9\x32\x99\x5b\xa4\xce\x2c\xb1\xb4"
+ "\xa2\xe7\x1a\xe7\x02\x20\xaa\xce\xc8\x96"
+ "\x2d\xd4\x49\x9c\xbd\x7c\x88\x7a\x94\xea"
+ "\xaa\x10\x1e\xa5\xaa\xbc\x52\x9b\x4e\x7e"
+ "\x43\x66\x5a\x5a\xf2\xcd\x03\xfe\x67\x8e"
+ "\xa6\xa5\x00\x5b\xba\x3b\x08\x22\x04\xc2"
+ "\x8b\x91\x09\xf4\x69\xda\xc9\x2a\xaa\xb3"
+ "\xaa\x7c\x11\xa1\xb3\x2a"),
+ /* "extrabits": 0xE0 , "numberextrabits": 3 */
+ "0x8C5B2A5DDAE5A97FC7F9D85661C672ADBF7933D4",
+ 1
+ },
+#endif
+ /* Test 10 */
+ {
+ TEST_INPUT("\xf7\x8f\x92\x14\x1b\xcd\x17\x0a\xe8\x9b"
+ "\x4f\xba\x15\xa1\xd5\x9f\x3f\xd8\x4d\x22"
+ "\x3c\x92\x51\xbd\xac\xbb\xae\x61\xd0\x5e"
+ "\xd1\x15\xa0\x6a\x7c\xe1\x17\xb7\xbe\xea"
+ "\xd2\x44\x21\xde\xd9\xc3\x25\x92\xbd\x57"
+ "\xed\xea\xe3\x9c\x39\xfa\x1f\xe8\x94\x6a"
+ "\x84\xd0\xcf\x1f\x7b\xee\xad\x17\x13\xe2"
+ "\xe0\x95\x98\x97\x34\x7f\x67\xc8\x0b\x04"
+ "\x00\xc2\x09\x81\x5d\x6b\x10\xa6\x83\x83"
+ "\x6f\xd5\x56\x2a\x56\xca\xb1\xa2\x8e\x81"
+ "\xb6\x57\x66\x54\x63\x1c\xf1\x65\x66\xb8"
+ "\x6e\x3b\x33\xa1\x08\xb0\x53\x07\xc0\x0a"
+ "\xff\x14\xa7\x68\xed\x73\x50\x60\x6a\x0f"
+ "\x85\xe6\xa9\x1d\x39\x6f\x5b\x5c\xbe\x57"
+ "\x7f\x9b\x38\x80\x7c\x7d\x52\x3d\x6d\x79"
+ "\x2f\x6e\xbc\x24\xa4\xec\xf2\xb3\xa4\x27"
+ "\xcd\xbb\xfb"),
+ "0xCB0082C8F197D260991BA6A460E76E202BAD27B3",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ isc_sha1_init(&sha1);
+ for(i = 0; i < testcase->repeats; i++) {
+ isc_sha1_update(&sha1,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ }
+ isc_sha1_final(&sha1, digest);
+ tohexstr(digest, ISC_SHA1_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ }
+}
+
+
+ATF_TC(isc_sha224);
+ATF_TC_HEAD(isc_sha224, tc) {
+ atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634");
+}
+ATF_TC_BODY(isc_sha224, tc) {
+ isc_sha224_t sha224;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("abc"),
+ "0x23097D223405D8228642A477BDA255B32AADBCE4BDA0B3F7"
+ "E36C9DA7",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("abcdbcdecdefdefgefghfghighijhijkijklj"
+ "klmklmnlmnomnopnopq"),
+ "0x75388B16512776CC5DBA5DA1FD890150B0C6455CB4F58B"
+ "1952522525",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("a"),
+ "0x20794655980C91D8BBB4C1EA97618A4BF03F42581948B2"
+ "EE4EE7AD67",
+ 1000000
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("01234567012345670123456701234567"),
+ "0x567F69F168CD7844E65259CE658FE7AADFA25216E68ECA"
+ "0EB7AB8262",
+ 20
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("\x07"),
+ "0x00ECD5F138422B8AD74C9799FD826C531BAD2FCABC7450"
+ "BEE2AA8C2A",
+ 1
+ },
+#if 0
+ /* Test 7 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 8 */
+ {
+ TEST_INPUT("\x18\x80\x40\x05\xdd\x4f\xbd\x15\x56\x29"
+ "\x9d\x6f\x9d\x93\xdf\x62"),
+ "0xDF90D78AA78821C99B40BA4C966921ACCD8FFB1E98AC38"
+ "8E56191DB1",
+ 1
+ },
+#if 0
+ /* Test 9 */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 10 */
+ {
+ TEST_INPUT("\x55\xb2\x10\x07\x9c\x61\xb5\x3a\xdd\x52"
+ "\x06\x22\xd1\xac\x97\xd5\xcd\xbe\x8c\xb3"
+ "\x3a\xa0\xae\x34\x45\x17\xbe\xe4\xd7\xba"
+ "\x09\xab\xc8\x53\x3c\x52\x50\x88\x7a\x43"
+ "\xbe\xbb\xac\x90\x6c\x2e\x18\x37\xf2\x6b"
+ "\x36\xa5\x9a\xe3\xbe\x78\x14\xd5\x06\x89"
+ "\x6b\x71\x8b\x2a\x38\x3e\xcd\xac\x16\xb9"
+ "\x61\x25\x55\x3f\x41\x6f\xf3\x2c\x66\x74"
+ "\xc7\x45\x99\xa9\x00\x53\x86\xd9\xce\x11"
+ "\x12\x24\x5f\x48\xee\x47\x0d\x39\x6c\x1e"
+ "\xd6\x3b\x92\x67\x0c\xa5\x6e\xc8\x4d\xee"
+ "\xa8\x14\xb6\x13\x5e\xca\x54\x39\x2b\xde"
+ "\xdb\x94\x89\xbc\x9b\x87\x5a\x8b\xaf\x0d"
+ "\xc1\xae\x78\x57\x36\x91\x4a\xb7\xda\xa2"
+ "\x64\xbc\x07\x9d\x26\x9f\x2c\x0d\x7e\xdd"
+ "\xd8\x10\xa4\x26\x14\x5a\x07\x76\xf6\x7c"
+ "\x87\x82\x73"),
+ "0x0B31894EC8937AD9B91BDFBCBA294D9ADEFAA18E09305E"
+ "9F20D5C3A4",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ isc_sha224_init(&sha224);
+ for(i = 0; i < testcase->repeats; i++) {
+ isc_sha224_update(&sha224,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ }
+ isc_sha224_final(digest, &sha224);
+ /*
+ *API inconsistency BUG HERE
+ * in order to be consistant with the other isc_hash_final
+ * functions the call should be
+ * isc_sha224_final(&sha224, digest);
+ */
+ tohexstr(digest, ISC_SHA224_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ }
+
+}
+
+ATF_TC(isc_sha256);
+ATF_TC_HEAD(isc_sha256, tc) {
+ atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634");
+}
+ATF_TC_BODY(isc_sha256, tc) {
+ isc_sha256_t sha256;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("abc"),
+ "0xBA7816BF8F01CFEA414140DE5DAE2223B00361A396177A"
+ "9CB410FF61F20015AD",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("abcdbcdecdefdefgefghfghighijhijkijkljk"
+ "lmklmnlmnomnopnopq"),
+ "0x248D6A61D20638B8E5C026930C3E6039A33CE45964FF21"
+ "67F6ECEDD419DB06C1",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("a"),
+ "0xCDC76E5C9914FB9281A1C7E284D73E67F1809A48A49720"
+ "0E046D39CCC7112CD0",
+ 1000000 },
+ /* Test 4 */
+ {
+ TEST_INPUT("01234567012345670123456701234567"),
+ "0x594847328451BDFA85056225462CC1D867D877FB388DF0"
+ "CE35F25AB5562BFBB5",
+ 20
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("\x19"),
+ "0x68AA2E2EE5DFF96E3355E6C7EE373E3D6A4E17F75F9518"
+ "D843709C0C9BC3E3D4",
+ 1
+ },
+#if 0
+ /* Test 7 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 8 */
+ {
+ TEST_INPUT("\xe3\xd7\x25\x70\xdc\xdd\x78\x7c\xe3"
+ "\x88\x7a\xb2\xcd\x68\x46\x52"),
+ "0x175EE69B02BA9B58E2B0A5FD13819CEA573F3940A94F82"
+ "5128CF4209BEABB4E8",
+ 1
+ },
+#if 0
+ /* Test 9 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 10 */
+ {
+ TEST_INPUT("\x83\x26\x75\x4e\x22\x77\x37\x2f\x4f\xc1"
+ "\x2b\x20\x52\x7a\xfe\xf0\x4d\x8a\x05\x69"
+ "\x71\xb1\x1a\xd5\x71\x23\xa7\xc1\x37\x76"
+ "\x00\x00\xd7\xbe\xf6\xf3\xc1\xf7\xa9\x08"
+ "\x3a\xa3\x9d\x81\x0d\xb3\x10\x77\x7d\xab"
+ "\x8b\x1e\x7f\x02\xb8\x4a\x26\xc7\x73\x32"
+ "\x5f\x8b\x23\x74\xde\x7a\x4b\x5a\x58\xcb"
+ "\x5c\x5c\xf3\x5b\xce\xe6\xfb\x94\x6e\x5b"
+ "\xd6\x94\xfa\x59\x3a\x8b\xeb\x3f\x9d\x65"
+ "\x92\xec\xed\xaa\x66\xca\x82\xa2\x9d\x0c"
+ "\x51\xbc\xf9\x33\x62\x30\xe5\xd7\x84\xe4"
+ "\xc0\xa4\x3f\x8d\x79\xa3\x0a\x16\x5c\xba"
+ "\xbe\x45\x2b\x77\x4b\x9c\x71\x09\xa9\x7d"
+ "\x13\x8f\x12\x92\x28\x96\x6f\x6c\x0a\xdc"
+ "\x10\x6a\xad\x5a\x9f\xdd\x30\x82\x57\x69"
+ "\xb2\xc6\x71\xaf\x67\x59\xdf\x28\xeb\x39"
+ "\x3d\x54\xd6"),
+ "0x97DBCA7DF46D62C8A422C941DD7E835B8AD3361763F7E9"
+ "B2D95F4F0DA6E1CCBC",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ isc_sha256_init(&sha256);
+ for(i = 0; i < testcase->repeats; i++) {
+ isc_sha256_update(&sha256,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ }
+ isc_sha256_final(digest, &sha256);
+ /*
+ *API inconsistency BUG HERE
+ * in order to be consistant with the other isc_hash_final
+ * functions the call should be
+ * isc_sha224_final(&sha224, digest);
+ */
+ tohexstr(digest, ISC_SHA256_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ }
+
+}
+
+ATF_TC(isc_sha384);
+ATF_TC_HEAD(isc_sha384, tc) {
+ atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634");
+}
+ATF_TC_BODY(isc_sha384, tc) {
+ isc_sha384_t sha384;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("abc"),
+ "0xCB00753F45A35E8BB5A03D699AC65007272C32AB0EDED1"
+ "631A8B605A43FF5BED8086072BA1E7CC2358BAEC"
+ "A134C825A7",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("abcdefghbcdefghicdefghijdefghijkefghijkl"
+ "fghijklmghijklmnhijklmnoijklmnopjklmnopq"
+ "klmnopqrlmnopqrsmnopqrstnopqrstu"),
+ "0x09330C33F71147E83D192FC782CD1B4753111B173B3B05"
+ "D22FA08086E3B0F712FCC7C71A557E2DB966C3E9"
+ "FA91746039",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("a"),
+ "0x9D0E1809716474CB086E834E310A4A1CED149E9C00F248"
+ "527972CEC5704C2A5B07B8B3DC38ECC4EBAE97DD"
+ "D87F3D8985",
+ 1000000
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("01234567012345670123456701234567"),
+ "0x2FC64A4F500DDB6828F6A3430B8DD72A368EB7F3A8322A"
+ "70BC84275B9C0B3AB00D27A5CC3C2D224AA6B61A"
+ "0D79FB4596",
+ 20
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 6 */
+ { TEST_INPUT("\xb9"),
+ "0xBC8089A19007C0B14195F4ECC74094FEC64F01F9092928"
+ "2C2FB392881578208AD466828B1C6C283D2722CF"
+ "0AD1AB6938",
+ 1
+ },
+#if 0
+ /* Test 7 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 8 */
+ {
+ TEST_INPUT("\xa4\x1c\x49\x77\x79\xc0\x37\x5f\xf1"
+ "\x0a\x7f\x4e\x08\x59\x17\x39"),
+ "0xC9A68443A005812256B8EC76B00516F0DBB74FAB26D665"
+ "913F194B6FFB0E91EA9967566B58109CBC675CC2"
+ "08E4C823F7",
+ 1
+ },
+#if 0
+ /* Test 9 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 10 */
+ {
+ TEST_INPUT("\x39\x96\x69\xe2\x8f\x6b\x9c\x6d\xbc\xbb"
+ "\x69\x12\xec\x10\xff\xcf\x74\x79\x03\x49"
+ "\xb7\xdc\x8f\xbe\x4a\x8e\x7b\x3b\x56\x21"
+ "\xdb\x0f\x3e\x7d\xc8\x7f\x82\x32\x64\xbb"
+ "\xe4\x0d\x18\x11\xc9\xea\x20\x61\xe1\xc8"
+ "\x4a\xd1\x0a\x23\xfa\xc1\x72\x7e\x72\x02"
+ "\xfc\x3f\x50\x42\xe6\xbf\x58\xcb\xa8\xa2"
+ "\x74\x6e\x1f\x64\xf9\xb9\xea\x35\x2c\x71"
+ "\x15\x07\x05\x3c\xf4\xe5\x33\x9d\x52\x86"
+ "\x5f\x25\xcc\x22\xb5\xe8\x77\x84\xa1\x2f"
+ "\xc9\x61\xd6\x6c\xb6\xe8\x95\x73\x19\x9a"
+ "\x2c\xe6\x56\x5c\xbd\xf1\x3d\xca\x40\x38"
+ "\x32\xcf\xcb\x0e\x8b\x72\x11\xe8\x3a\xf3"
+ "\x2a\x11\xac\x17\x92\x9f\xf1\xc0\x73\xa5"
+ "\x1c\xc0\x27\xaa\xed\xef\xf8\x5a\xad\x7c"
+ "\x2b\x7c\x5a\x80\x3e\x24\x04\xd9\x6d\x2a"
+ "\x77\x35\x7b\xda\x1a\x6d\xae\xed\x17\x15"
+ "\x1c\xb9\xbc\x51\x25\xa4\x22\xe9\x41\xde"
+ "\x0c\xa0\xfc\x50\x11\xc2\x3e\xcf\xfe\xfd"
+ "\xd0\x96\x76\x71\x1c\xf3\xdb\x0a\x34\x40"
+ "\x72\x0e\x16\x15\xc1\xf2\x2f\xbc\x3c\x72"
+ "\x1d\xe5\x21\xe1\xb9\x9b\xa1\xbd\x55\x77"
+ "\x40\x86\x42\x14\x7e\xd0\x96"),
+ "0x4F440DB1E6EDD2899FA335F09515AA025EE177A79F4B4A"
+ "AF38E42B5C4DE660F5DE8FB2A5B2FBD2A3CBFFD2"
+ "0CFF1288C0",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ isc_sha384_init(&sha384);
+ for(i = 0; i < testcase->repeats; i++) {
+ isc_sha384_update(&sha384,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ }
+ isc_sha384_final(digest, &sha384);
+ /*
+ *API inconsistency BUG HERE
+ * in order to be consistant with the other isc_hash_final
+ * functions the call should be
+ * isc_sha224_final(&sha224, digest);
+ */
+ tohexstr(digest, ISC_SHA384_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ }
+
+}
+
+ATF_TC(isc_sha512);
+ATF_TC_HEAD(isc_sha512, tc) {
+ atf_tc_set_md_var(tc, "descr", "sha224 examples from RFC4634");
+}
+ATF_TC_BODY(isc_sha512, tc) {
+ isc_sha512_t sha512;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("abc"),
+ "0xDDAF35A193617ABACC417349AE20413112E6FA4E89A97E"
+ "A20A9EEEE64B55D39A2192992A274FC1A836BA3C"
+ "23A3FEEBBD454D4423643CE80E2A9AC94FA54CA49F",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("abcdefghbcdefghicdefghijdefghijkefghijkl"
+ "fghijklmghijklmnhijklmnoijklmnopjklmnopq"
+ "klmnopqrlmnopqrsmnopqrstnopqrstu"),
+ "0x8E959B75DAE313DA8CF4F72814FC143F8F7779C6EB9F7F"
+ "A17299AEADB6889018501D289E4900F7E4331B99"
+ "DEC4B5433AC7D329EEB6DD26545E96E55B874BE909",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("a"),
+ "0xE718483D0CE769644E2E42C7BC15B4638E1F98B13B2044"
+ "285632A803AFA973EBDE0FF244877EA60A4CB043"
+ "2CE577C31BEB009C5C2C49AA2E4EADB217AD8CC09B",
+ 1000000
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("01234567012345670123456701234567"),
+ "0x89D05BA632C699C31231DED4FFC127D5A894DAD412C0E0"
+ "24DB872D1ABD2BA8141A0F85072A9BE1E2AA04CF"
+ "33C765CB510813A39CD5A84C4ACAA64D3F3FB7BAE9",
+ 20
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("\xD0"),
+ "0x9992202938E882E73E20F6B69E68A0A7149090423D93C8"
+ "1BAB3F21678D4ACEEEE50E4E8CAFADA4C85A54EA"
+ "8306826C4AD6E74CECE9631BFA8A549B4AB3FBBA15",
+ 1
+ },
+#if 0
+ /* Test 7 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 8 */
+ {
+ TEST_INPUT("\x8d\x4e\x3c\x0e\x38\x89\x19\x14\x91\x81"
+ "\x6e\x9d\x98\xbf\xf0\xa0"),
+ "0xCB0B67A4B8712CD73C9AABC0B199E9269B20844AFB75AC"
+ "BDD1C153C9828924C3DDEDAAFE669C5FDD0BC66F"
+ "630F6773988213EB1B16F517AD0DE4B2F0C95C90F8",
+ 1
+ },
+#if 0
+ /* Test 9 -- unimplemented optional functionality */
+ {
+ TEST_INPUT(""),
+ "0xXXX",
+ 1
+ },
+#endif
+ /* Test 10 */
+ {
+ TEST_INPUT("\xa5\x5f\x20\xc4\x11\xaa\xd1\x32\x80\x7a"
+ "\x50\x2d\x65\x82\x4e\x31\xa2\x30\x54\x32"
+ "\xaa\x3d\x06\xd3\xe2\x82\xa8\xd8\x4e\x0d"
+ "\xe1\xde\x69\x74\xbf\x49\x54\x69\xfc\x7f"
+ "\x33\x8f\x80\x54\xd5\x8c\x26\xc4\x93\x60"
+ "\xc3\xe8\x7a\xf5\x65\x23\xac\xf6\xd8\x9d"
+ "\x03\xe5\x6f\xf2\xf8\x68\x00\x2b\xc3\xe4"
+ "\x31\xed\xc4\x4d\xf2\xf0\x22\x3d\x4b\xb3"
+ "\xb2\x43\x58\x6e\x1a\x7d\x92\x49\x36\x69"
+ "\x4f\xcb\xba\xf8\x8d\x95\x19\xe4\xeb\x50"
+ "\xa6\x44\xf8\xe4\xf9\x5e\xb0\xea\x95\xbc"
+ "\x44\x65\xc8\x82\x1a\xac\xd2\xfe\x15\xab"
+ "\x49\x81\x16\x4b\xbb\x6d\xc3\x2f\x96\x90"
+ "\x87\xa1\x45\xb0\xd9\xcc\x9c\x67\xc2\x2b"
+ "\x76\x32\x99\x41\x9c\xc4\x12\x8b\xe9\xa0"
+ "\x77\xb3\xac\xe6\x34\x06\x4e\x6d\x99\x28"
+ "\x35\x13\xdc\x06\xe7\x51\x5d\x0d\x73\x13"
+ "\x2e\x9a\x0d\xc6\xd3\xb1\xf8\xb2\x46\xf1"
+ "\xa9\x8a\x3f\xc7\x29\x41\xb1\xe3\xbb\x20"
+ "\x98\xe8\xbf\x16\xf2\x68\xd6\x4f\x0b\x0f"
+ "\x47\x07\xfe\x1e\xa1\xa1\x79\x1b\xa2\xf3"
+ "\xc0\xc7\x58\xe5\xf5\x51\x86\x3a\x96\xc9"
+ "\x49\xad\x47\xd7\xfb\x40\xd2"),
+ "0xC665BEFB36DA189D78822D10528CBF3B12B3EEF7260399"
+ "09C1A16A270D48719377966B957A878E72058477"
+ "9A62825C18DA26415E49A7176A894E7510FD1451F5",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ isc_sha512_init(&sha512);
+ for(i = 0; i < testcase->repeats; i++) {
+ isc_sha512_update(&sha512,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ }
+ isc_sha512_final(digest, &sha512);
+ /*
+ *API inconsistency BUG HERE
+ * in order to be consistant with the other isc_hash_final
+ * functions the call should be
+ * isc_sha224_final(&sha224, digest);
+ */
+ tohexstr(digest, ISC_SHA512_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ }
+
+}
+
+ATF_TC(isc_md5);
+ATF_TC_HEAD(isc_md5, tc) {
+ atf_tc_set_md_var(tc, "descr", "md5 example from RFC1321");
+}
+ATF_TC_BODY(isc_md5, tc) {
+ isc_md5_t md5;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ {
+ TEST_INPUT(""),
+ "0xD41D8CD98F00B204E9800998ECF8427E",
+ 1
+ },
+ {
+ TEST_INPUT("a"),
+ "0x0CC175B9C0F1B6A831C399E269772661",
+ 1
+ },
+ {
+ TEST_INPUT("abc"),
+ "0x900150983CD24FB0D6963F7D28E17F72",
+ 1
+ },
+ {
+ TEST_INPUT("message digest"),
+ "0xF96B697D7CB7938D525A2F31AAF161D0",
+ 1
+ },
+ {
+ TEST_INPUT("abcdefghijklmnopqrstuvwxyz"),
+ "0xC3FCD3D76192E4007DFB496CCA67E13B",
+ 1
+ },
+ {
+ TEST_INPUT("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm"
+ "nopqrstuvwxyz0123456789"),
+ "0xD174AB98D277D9F5A5611C2C9F419D9F",
+ 1
+ },
+ {
+ TEST_INPUT("123456789012345678901234567890123456789"
+ "01234567890123456789012345678901234567890"),
+ "0x57EDF4A22BE3C955AC49DA2E2107B67A",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ isc_md5_init(&md5);
+ for(i = 0; i < testcase->repeats; i++) {
+ isc_md5_update(&md5,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ }
+ isc_md5_final(&md5, digest);
+ tohexstr(digest, ISC_MD5_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ }
+}
+
+/* HMAC-SHA1 test */
+ATF_TC(isc_hmacsha1);
+ATF_TC_HEAD(isc_hmacsha1, tc) {
+ atf_tc_set_md_var(tc, "descr", "HMAC-SHA1 examples from RFC2104");
+}
+ATF_TC_BODY(isc_hmacsha1, tc) {
+ isc_hmacsha1_t hmacsha1;
+
+ UNUSED(tc);
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"),
+ "0xB617318655057264E28BC0B6FB378C8EF146BE00",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61"
+ "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20"
+ "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"),
+ "0xEFFCDF6AE5EB2FA2D27416D5F184DF9C259A7C79",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"),
+ "0x125D7342B9AC11CD91A39AF48AA17B4F63F175D3",
+ 1
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"),
+ "0x4C9007F4026250C6BC8414F9BF50C86C2D7235DA",
+ 1
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test With Truncation"),
+ "0x4C1A03424B55E07FE7F27BE1",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key - "
+ "Hash Key First"),
+ "0xAA4AE5E15272D00E95705637CE8A3B55ED402112", 1 },
+ /* Test 7 */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key and "
+ "Larger Than One Block-Size Data"),
+ "0xE8E99D0F45237D786D6BBAA7965C7808BBFF1A91",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ hash_test_key_t test_keys[] = {
+ /* Key 1 */
+ { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 },
+ /* Key 2 */
+ { "Jefe", 4 },
+ /* Key 3 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 },
+ /* Key 4 */
+ { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a"
+ "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+ "\x15\x16\x17\x18\x19", 25 },
+#if 0
+ /* Key 5 */
+ { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
+ "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 },
+#endif
+ /* Key 6 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 80 },
+ /* Key 7 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 80 },
+ { "", 0 }
+ };
+
+ hash_test_key_t *test_key = test_keys;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ memcpy(buffer, test_key->key, test_key->len);
+ isc_hmacsha1_init(&hmacsha1, buffer, test_key->len);
+ isc_hmacsha1_update(&hmacsha1,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ isc_hmacsha1_sign(&hmacsha1, digest, ISC_SHA1_DIGESTLENGTH);
+ tohexstr(digest, ISC_SHA1_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ test_key++;
+ }
+}
+
+/* HMAC-SHA224 test */
+ATF_TC(isc_hmacsha224);
+ATF_TC_HEAD(isc_hmacsha224, tc) {
+ atf_tc_set_md_var(tc, "descr", "HMAC-SHA224 examples from RFC4634");
+}
+ATF_TC_BODY(isc_hmacsha224, tc) {
+ isc_hmacsha224_t hmacsha224;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"),
+ "0x896FB1128ABBDF196832107CD49DF33F47B4B1169912BA"
+ "4F53684B22",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61"
+ "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20"
+ "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"),
+ "0xA30E01098BC6DBBF45690F3A7E9E6D0F8BBEA2A39E61480"
+ "08FD05E44",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"),
+ "0x7FB3CB3588C6C1F6FFA9694D7D6AD2649365B0C1F65D69"
+ "D1EC8333EA",
+ 1
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"),
+ "0x6C11506874013CAC6A2ABC1BB382627CEC6A90D86EFC01"
+ "2DE7AFEC5A",
+ 1
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test With Truncation"),
+ "0x4C1A03424B55E07FE7F27BE1",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key - "
+ "Hash Key First"),
+ "0x95E9A0DB962095ADAEBE9B2D6F0DBCE2D499F112F2D2B7"
+ "273FA6870E",
+ 1
+ },
+ /* Test 7 */
+ {
+ TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20"
+ "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67"
+ "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20"
+ "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
+ "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20"
+ "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67"
+ "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c"
+ "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64"
+ "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b"
+ "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74"
+ "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65"
+ "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62"
+ "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20"
+ "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41"
+ "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68"
+ "\x6d\x2e"),
+ "0x3A854166AC5D9F023F54D517D0B39DBD946770DB9C2B95"
+ "C9F6F565D1",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ hash_test_key_t test_keys[] = {
+ /* Key 1 */
+ { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 },
+ /* Key 2 */
+ { "Jefe", 4 },
+ /* Key 3 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 },
+ /* Key 4 */
+ { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a"
+ "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+ "\x15\x16\x17\x18\x19", 25 },
+#if 0
+ /* Key 5 */
+ { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
+ "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 },
+#endif
+ /* Key 6 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ /* Key 7 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ { "", 0 }
+ };
+
+ hash_test_key_t *test_key = test_keys;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ memcpy(buffer, test_key->key, test_key->len);
+ isc_hmacsha224_init(&hmacsha224, buffer, test_key->len);
+ isc_hmacsha224_update(&hmacsha224,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ isc_hmacsha224_sign(&hmacsha224, digest, ISC_SHA224_DIGESTLENGTH);
+ tohexstr(digest, ISC_SHA224_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ test_key++;
+ }
+}
+
+/* HMAC-SHA256 test */
+ATF_TC(isc_hmacsha256);
+ATF_TC_HEAD(isc_hmacsha256, tc) {
+ atf_tc_set_md_var(tc, "descr", "HMAC-SHA256 examples from RFC4634");
+}
+ATF_TC_BODY(isc_hmacsha256, tc) {
+ isc_hmacsha256_t hmacsha256;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"),
+ "0xB0344C61D8DB38535CA8AFCEAF0BF12B881DC200C9833D"
+ "A726E9376C2E32CFF7",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61"
+ "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20"
+ "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"),
+ "0x5BDCC146BF60754E6A042426089575C75A003F089D2739"
+ "839DEC58B964EC3843",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"),
+ "0x773EA91E36800E46854DB8EBD09181A72959098B3EF8C1"
+ "22D9635514CED565FE",
+ 1
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"),
+ "0x82558A389A443C0EA4CC819899F2083A85F0FAA3E578F8"
+ "077A2E3FF46729665B",
+ 1
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test With Truncation"),
+ "0x4C1A03424B55E07FE7F27BE1",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key - "
+ "Hash Key First"),
+ "0x60E431591EE0B67F0D8A26AACBF5B77F8E0BC6213728C5"
+ "140546040F0EE37F54",
+ 1
+ },
+ /* Test 7 */
+ {
+ TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20"
+ "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67"
+ "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20"
+ "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
+ "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20"
+ "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67"
+ "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c"
+ "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64"
+ "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b"
+ "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74"
+ "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65"
+ "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62"
+ "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20"
+ "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41"
+ "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68"
+ "\x6d\x2e"),
+ "0x9B09FFA71B942FCB27635FBCD5B0E944BFDC63644F0713"
+ "938A7F51535C3A35E2",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ hash_test_key_t test_keys[] = {
+ /* Key 1 */
+ { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 },
+ /* Key 2 */
+ { "Jefe", 4 },
+ /* Key 3 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 },
+ /* Key 4 */
+ { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a"
+ "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+ "\x15\x16\x17\x18\x19", 25 },
+#if 0
+ /* Key 5 */
+ { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
+ "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 },
+#endif
+ /* Key 6 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ /* Key 7 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ { "", 0 }
+ };
+
+ hash_test_key_t *test_key = test_keys;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ memcpy(buffer, test_key->key, test_key->len);
+ isc_hmacsha256_init(&hmacsha256, buffer, test_key->len);
+ isc_hmacsha256_update(&hmacsha256,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ isc_hmacsha256_sign(&hmacsha256, digest, ISC_SHA256_DIGESTLENGTH);
+ tohexstr(digest, ISC_SHA256_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ test_key++;
+ }
+}
+
+/* HMAC-SHA384 test */
+ATF_TC(isc_hmacsha384);
+ATF_TC_HEAD(isc_hmacsha384, tc) {
+ atf_tc_set_md_var(tc, "descr", "HMAC-SHA384 examples from RFC4634");
+}
+ATF_TC_BODY(isc_hmacsha384, tc) {
+ isc_hmacsha384_t hmacsha384;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"),
+ "0xAFD03944D84895626B0825F4AB46907F15F9DADBE4101E"
+ "C682AA034C7CEBC59CFAEA9EA9076EDE7F4AF152"
+ "E8B2FA9CB6",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61"
+ "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20"
+ "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"),
+ "0xAF45D2E376484031617F78D2B58A6B1B9C7EF464F5A01B"
+ "47E42EC3736322445E8E2240CA5E69E2C78B3239"
+ "ECFAB21649",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"),
+ "0x88062608D3E6AD8A0AA2ACE014C8A86F0AA635D947AC9F"
+ "EBE83EF4E55966144B2A5AB39DC13814B94E3AB6"
+ "E101A34F27",
+ 1
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"),
+ "0x3E8A69B7783C25851933AB6290AF6CA77A998148085000"
+ "9CC5577C6E1F573B4E6801DD23C4A7D679CCF8A3"
+ "86C674CFFB",
+ 1
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test With Truncation"),
+ "0x4C1A03424B55E07FE7F27BE1",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key - "
+ "Hash Key First"),
+ "0x4ECE084485813E9088D2C63A041BC5B44F9EF1012A2B58"
+ "8F3CD11F05033AC4C60C2EF6AB4030FE8296248D"
+ "F163F44952",
+ 1
+ },
+ /* Test 7 */
+ {
+ TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20"
+ "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67"
+ "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20"
+ "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
+ "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20"
+ "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67"
+ "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c"
+ "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64"
+ "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b"
+ "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74"
+ "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65"
+ "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62"
+ "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20"
+ "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41"
+ "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68"
+ "\x6d\x2e"),
+ "0x6617178E941F020D351E2F254E8FD32C602420FEB0B8FB"
+ "9ADCCEBB82461E99C5A678CC31E799176D3860E6"
+ "110C46523E",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ hash_test_key_t test_keys[] = {
+ /* Key 1 */
+ { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 },
+ /* Key 2 */
+ { "Jefe", 4 },
+ /* Key 3 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 },
+ /* Key 4 */
+ { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a"
+ "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+ "\x15\x16\x17\x18\x19", 25 },
+#if 0
+ /* Key 5 */
+ { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
+ "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 },
+#endif
+ /* Key 6 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ /* Key 7 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ { "", 0 }
+ };
+
+ hash_test_key_t *test_key = test_keys;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ memcpy(buffer, test_key->key, test_key->len);
+ isc_hmacsha384_init(&hmacsha384, buffer, test_key->len);
+ isc_hmacsha384_update(&hmacsha384,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ isc_hmacsha384_sign(&hmacsha384, digest, ISC_SHA384_DIGESTLENGTH);
+ tohexstr(digest, ISC_SHA384_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ test_key++;
+ }
+}
+
+/* HMAC-SHA512 test */
+ATF_TC(isc_hmacsha512);
+ATF_TC_HEAD(isc_hmacsha512, tc) {
+ atf_tc_set_md_var(tc, "descr", "HMAC-SHA512 examples from RFC4634");
+}
+ATF_TC_BODY(isc_hmacsha512, tc) {
+ isc_hmacsha512_t hmacsha512;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"),
+ "0x87AA7CDEA5EF619D4FF0B4241A1D6CB02379F4E2CE4EC2"
+ "787AD0B30545E17CDEDAA833B7D6B8A702038B27"
+ "4EAEA3F4E4BE9D914EEB61F1702E696C203A126854",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61"
+ "\x20\x77\x61\x6e\x74\x20\x66\x6f\x72\x20"
+ "\x6e\x6f\x74\x68\x69\x6e\x67\x3f"),
+ "0x164B7A7BFCF819E2E395FBE73B56E0A387BD64222E831F"
+ "D610270CD7EA2505549758BF75C05A994A6D034F"
+ "65F8F0E6FDCAEAB1A34D4A6B4B636E070A38BCE737",
+ 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"),
+ "0xFA73B0089D56A284EFB0F0756C890BE9B1B5DBDD8EE81A"
+ "3655F83E33B2279D39BF3E848279A722C806B485"
+ "A47E67C807B946A337BEE8942674278859E13292FB",
+ 1
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"),
+ "0xB0BA465637458C6990E5A8C5F61D4AF7E576D97FF94B87"
+ "2DE76F8050361EE3DBA91CA5C11AA25EB4D67927"
+ "5CC5788063A5F19741120C4F2DE2ADEBEB10A298DD",
+ 1
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test With Truncation"),
+ "0x4C1A03424B55E07FE7F27BE1",
+ 1
+ },
+#endif
+ /* Test 6 */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key - "
+ "Hash Key First"),
+ "0x80B24263C7C1A3EBB71493C1DD7BE8B49B46D1F41B4AEE"
+ "C1121B013783F8F3526B56D037E05F2598BD0FD2"
+ "215D6A1E5295E64F73F63F0AEC8B915A985D786598",
+ 1
+ },
+ /* Test 7 */
+ {
+ TEST_INPUT("\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20"
+ "\x74\x65\x73\x74\x20\x75\x73\x69\x6e\x67"
+ "\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20"
+ "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b"
+ "\x2d\x73\x69\x7a\x65\x20\x6b\x65\x79\x20"
+ "\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67"
+ "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c"
+ "\x6f\x63\x6b\x2d\x73\x69\x7a\x65\x20\x64"
+ "\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b"
+ "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74"
+ "\x6f\x20\x62\x65\x20\x68\x61\x73\x68\x65"
+ "\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62"
+ "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20"
+ "\x62\x79\x20\x74\x68\x65\x20\x48\x4d\x41"
+ "\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68"
+ "\x6d\x2e"),
+ "0xE37B6A775DC87DBAA4DFA9F96E5E3FFDDEBD71F8867289"
+ "865DF5A32D20CDC944B6022CAC3C4982B10D5EEB"
+ "55C3E4DE15134676FB6DE0446065C97440FA8C6A58",
+ 1
+ },
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ hash_test_key_t test_keys[] = {
+ /* Key 1 */
+ { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
+ "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", 20 },
+ /* Key 2 */
+ { "Jefe", 4 },
+ /* Key 3 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 20 },
+ /* Key 4 */
+ { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a"
+ "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+ "\x15\x16\x17\x18\x19", 25 },
+#if 0
+ /* Key 5 */
+ { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
+ "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 },
+#endif
+ /* Key 6 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ /* Key 7 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ { "", 0 }
+ };
+
+ hash_test_key_t *test_key = test_keys;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ memcpy(buffer, test_key->key, test_key->len);
+ isc_hmacsha512_init(&hmacsha512, buffer, test_key->len);
+ isc_hmacsha512_update(&hmacsha512,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ isc_hmacsha512_sign(&hmacsha512, digest, ISC_SHA512_DIGESTLENGTH);
+ tohexstr(digest, ISC_SHA512_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ test_key++;
+ }
+}
+
+
+/* HMAC-MD5 Test */
+ATF_TC(isc_hmacmd5);
+ATF_TC_HEAD(isc_hmacmd5, tc) {
+ atf_tc_set_md_var(tc, "descr", "HMAC-MD5 examples from RFC2104");
+}
+ATF_TC_BODY(isc_hmacmd5, tc) {
+ isc_hmacmd5_t hmacmd5;
+
+ UNUSED(tc);
+
+ /*
+ * These are the various test vectors. All of these are passed
+ * through the hash function and the results are compared to the
+ * result specified here.
+ */
+ hash_testcase_t testcases[] = {
+ /* Test 1 */
+ {
+ TEST_INPUT("\x48\x69\x20\x54\x68\x65\x72\x65"),
+ "0x9294727A3638BB1C13F48EF8158BFC9D",
+ 1
+ },
+ /* Test 2 */
+ {
+ TEST_INPUT("\x77\x68\x61\x74\x20\x64\x6f\x20\x79"
+ "\x61\x20\x77\x61\x6e\x74\x20\x66\x6f"
+ "\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f"),
+ "0x750C783E6AB0B503EAA86E310A5DB738", 1
+ },
+ /* Test 3 */
+ {
+ TEST_INPUT("\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+ "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"),
+ "0x56BE34521D144C88DBB8C733F0E8B3F6",
+ 1
+ },
+ /* Test 4 */
+ {
+ TEST_INPUT("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
+ "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"),
+ "0x697EAF0ACA3A3AEA3A75164746FFAA79",
+ 1
+ },
+#if 0
+ /* Test 5 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test With Truncation"),
+ "0x4C1A03424B55E07FE7F27BE1",
+ 1
+ },
+ /* Test 6 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key - "
+ "Hash Key First"),
+ "0xAA4AE5E15272D00E95705637CE8A3B55ED402112",
+ 1
+ },
+ /* Test 7 -- unimplemented optional functionality */
+ {
+ TEST_INPUT("Test Using Larger Than Block-Size Key and "
+ "Larger Than One Block-Size Data"),
+ "0xE8E99D0F45237D786D6BBAA7965C7808BBFF1A91",
+ 1
+ },
+#endif
+ { NULL, 0, NULL, 1 }
+ };
+
+ hash_testcase_t *testcase = testcases;
+
+ hash_test_key_t test_keys[] = {
+ /* Key 1 */
+ { "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
+ "\x0b\x0b\x0b\x0b\x0b\x0b", 16 },
+ /* Key 2 */
+ { "Jefe", 4 },
+ /* Key 3 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa", 16 },
+ /* Key 4 */
+ { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a"
+ "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14"
+ "\x15\x16\x17\x18\x19", 25 },
+#if 0
+ /* Key 5 */
+ { "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
+ "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", 20 },
+ /* Key 6 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+ /* Key 7 */
+ { "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
+ "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", 131 },
+#endif
+ { "", 0 }
+ };
+
+ hash_test_key_t *test_key = test_keys;
+
+ while (testcase->input != NULL && testcase->result != NULL) {
+ memcpy(buffer, test_key->key, test_key->len);
+ isc_hmacmd5_init(&hmacmd5, buffer, test_key->len);
+ isc_hmacmd5_update(&hmacmd5,
+ (const isc_uint8_t *) testcase->input,
+ testcase->input_len);
+ isc_hmacmd5_sign(&hmacmd5, digest);
+ tohexstr(digest, ISC_MD5_DIGESTLENGTH, str);
+ ATF_CHECK_STREQ(str, testcase->result);
+
+ testcase++;
+ test_key++;
+ }
+}
+
+/*
+ * Main
+ */
+ATF_TP_ADD_TCS(tp) {
+ ATF_TP_ADD_TC(tp, isc_hmacmd5);
+ ATF_TP_ADD_TC(tp, isc_hmacsha1);
+ ATF_TP_ADD_TC(tp, isc_hmacsha224);
+ ATF_TP_ADD_TC(tp, isc_hmacsha256);
+ ATF_TP_ADD_TC(tp, isc_hmacsha384);
+ ATF_TP_ADD_TC(tp, isc_hmacsha512);
+ ATF_TP_ADD_TC(tp, isc_md5);
+ ATF_TP_ADD_TC(tp, isc_sha1);
+ ATF_TP_ADD_TC(tp, isc_sha224);
+ ATF_TP_ADD_TC(tp, isc_sha256);
+ ATF_TP_ADD_TC(tp, isc_sha384);
+ ATF_TP_ADD_TC(tp, isc_sha512);
+ return (atf_no_error());
+}
+
diff --git a/lib/isc/tests/isctest.c b/lib/isc/tests/isctest.c
new file mode 100644
index 0000000..e118bbf
--- /dev/null
+++ b/lib/isc/tests/isctest.c
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <time.h>
+
+#include <isc/app.h>
+#include <isc/buffer.h>
+#include <isc/entropy.h>
+#include <isc/hash.h>
+#include <isc/mem.h>
+#include <isc/os.h>
+#include <isc/socket.h>
+#include <isc/string.h>
+#include <isc/task.h>
+#include <isc/timer.h>
+#include <isc/util.h>
+
+#include "isctest.h"
+
+isc_mem_t *mctx = NULL;
+isc_entropy_t *ectx = NULL;
+isc_log_t *lctx = NULL;
+isc_taskmgr_t *taskmgr = NULL;
+isc_timermgr_t *timermgr = NULL;
+isc_socketmgr_t *socketmgr = NULL;
+int ncpus;
+
+static isc_boolean_t hash_active = ISC_FALSE;
+
+/*
+ * Logging categories: this needs to match the list in bin/named/log.c.
+ */
+static isc_logcategory_t categories[] = {
+ { "", 0 },
+ { "client", 0 },
+ { "network", 0 },
+ { "update", 0 },
+ { "queries", 0 },
+ { "unmatched", 0 },
+ { "update-security", 0 },
+ { "query-errors", 0 },
+ { NULL, 0 }
+};
+
+static void
+cleanup_managers() {
+ if (socketmgr != NULL)
+ isc_socketmgr_destroy(&socketmgr);
+ if (taskmgr != NULL)
+ isc_taskmgr_destroy(&taskmgr);
+ if (timermgr != NULL)
+ isc_timermgr_destroy(&timermgr);
+}
+
+static isc_result_t
+create_managers() {
+ isc_result_t result;
+#ifdef ISC_PLATFORM_USETHREADS
+ ncpus = isc_os_ncpus();
+#else
+ ncpus = 1;
+#endif
+
+ CHECK(isc_taskmgr_create(mctx, ncpus, 0, &taskmgr));
+ CHECK(isc_timermgr_create(mctx, &timermgr));
+ CHECK(isc_socketmgr_create(mctx, &socketmgr));
+ return (ISC_R_SUCCESS);
+
+ cleanup:
+ cleanup_managers();
+ return (result);
+}
+
+isc_result_t
+isc_test_begin(FILE *logfile, isc_boolean_t start_managers) {
+ isc_result_t result;
+
+ isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
+ CHECK(isc_mem_create(0, 0, &mctx));
+ CHECK(isc_entropy_create(mctx, &ectx));
+
+ CHECK(isc_hash_create(mctx, ectx, 255));
+ hash_active = ISC_TRUE;
+
+ if (logfile != NULL) {
+ isc_logdestination_t destination;
+ isc_logconfig_t *logconfig = NULL;
+
+ CHECK(isc_log_create(mctx, &lctx, &logconfig));
+ isc_log_registercategories(lctx, categories);
+ isc_log_setcontext(lctx);
+
+ destination.file.stream = logfile;
+ destination.file.name = NULL;
+ destination.file.versions = ISC_LOG_ROLLNEVER;
+ destination.file.maximum_size = 0;
+ CHECK(isc_log_createchannel(logconfig, "stderr",
+ ISC_LOG_TOFILEDESC,
+ ISC_LOG_DYNAMIC,
+ &destination, 0));
+ CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL));
+ }
+
+#ifdef ISC_PLATFORM_USETHREADS
+ ncpus = isc_os_ncpus();
+#else
+ ncpus = 1;
+#endif
+
+ if (start_managers)
+ CHECK(create_managers());
+
+ return (ISC_R_SUCCESS);
+
+ cleanup:
+ isc_test_end();
+ return (result);
+}
+
+void
+isc_test_end() {
+ if (taskmgr != NULL)
+ isc_taskmgr_destroy(&taskmgr);
+ if (lctx != NULL)
+ isc_log_destroy(&lctx);
+ if (hash_active) {
+ isc_hash_destroy();
+ hash_active = ISC_FALSE;
+ }
+ if (ectx != NULL)
+ isc_entropy_detach(&ectx);
+
+ cleanup_managers();
+
+ if (mctx != NULL)
+ isc_mem_destroy(&mctx);
+}
+
+/*
+ * Sleep for 'usec' microseconds.
+ */
+void
+isc_test_nap(isc_uint32_t usec) {
+#ifdef HAVE_NANOSLEEP
+ struct timespec ts;
+
+ ts.tv_sec = usec / 1000000;
+ ts.tv_nsec = (usec % 1000000) * 1000;
+ nanosleep(&ts, NULL);
+#elif HAVE_USLEEP
+ usleep(usec);
+#else
+ /*
+ * No fractional-second sleep function is available, so we
+ * round up to the nearest second and sleep instead
+ */
+ sleep((usec / 1000000) + 1);
+#endif
+}
diff --git a/lib/isc/tests/isctest.h b/lib/isc/tests/isctest.h
new file mode 100644
index 0000000..03423c8
--- /dev/null
+++ b/lib/isc/tests/isctest.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/buffer.h>
+#include <isc/entropy.h>
+#include <isc/hash.h>
+#include <isc/log.h>
+#include <isc/mem.h>
+#include <isc/print.h>
+#include <isc/result.h>
+#include <isc/string.h>
+#include <isc/task.h>
+#include <isc/timer.h>
+#include <isc/util.h>
+
+#define CHECK(r) \
+ do { \
+ result = (r); \
+ if (result != ISC_R_SUCCESS) \
+ goto cleanup; \
+ } while (0)
+
+extern isc_mem_t *mctx;
+extern isc_entropy_t *ectx;
+extern isc_log_t *lctx;
+extern isc_taskmgr_t *taskmgr;
+isc_timermgr_t *timermgr;
+isc_socketmgr_t *socketmgr;
+extern int ncpus;
+
+isc_result_t
+isc_test_begin(FILE *logfile, isc_boolean_t start_managers);
+
+void
+isc_test_end(void);
+
+void
+isc_test_nap(isc_uint32_t usec);
diff --git a/lib/isc/tests/queue_test.c b/lib/isc/tests/queue_test.c
new file mode 100644
index 0000000..74620fe
--- /dev/null
+++ b/lib/isc/tests/queue_test.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <atf-c.h>
+
+#include <unistd.h>
+#include <time.h>
+
+#include <isc/queue.h>
+
+#include "isctest.h"
+
+typedef struct item {
+ int value;
+ ISC_QLINK(item_t) qlink;
+} item_t;
+
+typedef ISC_QUEUE(item_t) item_queue_t;
+
+static void
+item_init(item_t *item, int value) {
+ item->value = value;
+ ISC_QLINK_INIT(item, qlink);
+}
+
+/*
+ * Individual unit tests
+ */
+
+/* Test UDP sendto/recv (IPv4) */
+ATF_TC(queue_valid);
+ATF_TC_HEAD(queue_valid, tc) {
+ atf_tc_set_md_var(tc, "descr", "Check queue validity");
+}
+ATF_TC_BODY(queue_valid, tc) {
+ isc_result_t result;
+ item_queue_t queue;
+ item_t one, two, three, four, five;
+ item_t *p;
+
+ UNUSED(tc);
+
+ ISC_QUEUE_INIT(queue, qlink);
+
+ item_init(&one, 1);
+ item_init(&two, 2);
+ item_init(&three, 3);
+ item_init(&four, 4);
+ item_init(&five, 5);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ ATF_CHECK(ISC_QUEUE_EMPTY(queue));
+
+ ISC_QUEUE_POP(queue, qlink, p);
+ ATF_CHECK(p == NULL);
+
+ ATF_CHECK(! ISC_QLINK_LINKED(&one, qlink));
+ ISC_QUEUE_PUSH(queue, &one, qlink);
+ ATF_CHECK(ISC_QLINK_LINKED(&one, qlink));
+
+ ATF_CHECK(! ISC_QUEUE_EMPTY(queue));
+
+ ISC_QUEUE_POP(queue, qlink, p);
+ ATF_REQUIRE(p != NULL);
+ ATF_CHECK_EQ(p->value, 1);
+ ATF_CHECK(ISC_QUEUE_EMPTY(queue));
+ ATF_CHECK(! ISC_QLINK_LINKED(p, qlink));
+
+ ISC_QUEUE_PUSH(queue, p, qlink);
+ ATF_CHECK(! ISC_QUEUE_EMPTY(queue));
+ ATF_CHECK(ISC_QLINK_LINKED(p, qlink));
+
+ ATF_CHECK(! ISC_QLINK_LINKED(&two, qlink));
+ ISC_QUEUE_PUSH(queue, &two, qlink);
+ ATF_CHECK(ISC_QLINK_LINKED(&two, qlink));
+
+ ATF_CHECK(! ISC_QLINK_LINKED(&three, qlink));
+ ISC_QUEUE_PUSH(queue, &three, qlink);
+ ATF_CHECK(ISC_QLINK_LINKED(&three, qlink));
+
+ ATF_CHECK(! ISC_QLINK_LINKED(&four, qlink));
+ ISC_QUEUE_PUSH(queue, &four, qlink);
+ ATF_CHECK(ISC_QLINK_LINKED(&four, qlink));
+
+ ATF_CHECK(! ISC_QLINK_LINKED(&five, qlink));
+ ISC_QUEUE_PUSH(queue, &five, qlink);
+ ATF_CHECK(ISC_QLINK_LINKED(&five, qlink));
+
+ ISC_QUEUE_POP(queue, qlink, p);
+ ATF_REQUIRE(p != NULL);
+ ATF_CHECK_EQ(p->value, 1);
+
+ ISC_QUEUE_POP(queue, qlink, p);
+ ATF_REQUIRE(p != NULL);
+ ATF_CHECK_EQ(p->value, 2);
+
+ ISC_QUEUE_POP(queue, qlink, p);
+ ATF_REQUIRE(p != NULL);
+ ATF_CHECK_EQ(p->value, 3);
+
+ ISC_QUEUE_POP(queue, qlink, p);
+ ATF_REQUIRE(p != NULL);
+ ATF_CHECK_EQ(p->value, 4);
+
+ ISC_QUEUE_POP(queue, qlink, p);
+ ATF_REQUIRE(p != NULL);
+ ATF_CHECK_EQ(p->value, 5);
+
+ ATF_CHECK(ISC_QUEUE_EMPTY(queue));
+
+ ISC_QUEUE_DESTROY(queue);
+ isc_test_end();
+}
+
+/*
+ * Main
+ */
+ATF_TP_ADD_TCS(tp) {
+ ATF_TP_ADD_TC(tp, queue_valid);
+
+ return (atf_no_error());
+}
+
diff --git a/lib/isc/tests/socket_test.c b/lib/isc/tests/socket_test.c
new file mode 100644
index 0000000..724d79d
--- /dev/null
+++ b/lib/isc/tests/socket_test.c
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <atf-c.h>
+
+#include <unistd.h>
+#include <time.h>
+
+#include <isc/socket.h>
+
+#include "../task_p.h"
+#include "isctest.h"
+
+/*
+ * Helper functions
+ */
+typedef struct {
+ isc_boolean_t done;
+ isc_result_t result;
+} completion_t;
+
+static void
+completion_init(completion_t *completion) {
+ completion->done = ISC_FALSE;
+}
+
+static void
+event_done(isc_task_t *task, isc_event_t *event) {
+ isc_socketevent_t *dev;
+ completion_t *completion = event->ev_arg;
+
+ UNUSED(task);
+
+ dev = (isc_socketevent_t *) event;
+ completion->result = dev->result;
+ completion->done = ISC_TRUE;
+ isc_event_free(&event);
+}
+
+static isc_result_t
+waitfor(completion_t *completion) {
+ int i = 0;
+ while (!completion->done && i++ < 5000) {
+#ifndef ISC_PLATFORM_USETHREADS
+ while (isc__taskmgr_ready(taskmgr))
+ isc__taskmgr_dispatch(taskmgr);
+#endif
+ isc_test_nap(1000);
+ }
+ if (completion->done)
+ return (ISC_R_SUCCESS);
+ return (ISC_R_FAILURE);
+}
+
+/*
+ * Individual unit tests
+ */
+
+/* Test UDP sendto/recv (IPv4) */
+ATF_TC(udp_sendto);
+ATF_TC_HEAD(udp_sendto, tc) {
+ atf_tc_set_md_var(tc, "descr", "UDP sendto/recv");
+}
+ATF_TC_BODY(udp_sendto, tc) {
+ isc_result_t result;
+ isc_sockaddr_t addr1, addr2;
+ struct in_addr in;
+ isc_socket_t *s1 = NULL, *s2 = NULL;
+ isc_task_t *task = NULL;
+ char sendbuf[BUFSIZ], recvbuf[BUFSIZ];
+ completion_t completion;
+ isc_region_t r;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ /*
+ * Create two sockets: 127.0.0.1/5444 and 127.0.0.1/5445, talking to
+ * each other.
+ */
+ in.s_addr = inet_addr("127.0.0.1");
+ isc_sockaddr_fromin(&addr1, &in, 5444);
+ isc_sockaddr_fromin(&addr2, &in, 5445);
+
+ result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s1);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ result = isc_socket_bind(s1, &addr1, ISC_SOCKET_REUSEADDRESS);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s2);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ result = isc_socket_bind(s2, &addr2, ISC_SOCKET_REUSEADDRESS);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_task_create(taskmgr, 0, &task);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ strcpy(sendbuf, "Hello");
+ r.base = (void *) sendbuf;
+ r.length = strlen(sendbuf) + 1;
+
+ completion_init(&completion);
+ result = isc_socket_sendto(s1, &r, task, event_done, &completion,
+ &addr2, NULL);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ waitfor(&completion);
+ ATF_CHECK(completion.done);
+ ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS);
+
+ r.base = (void *) recvbuf;
+ r.length = BUFSIZ;
+ completion_init(&completion);
+ result = isc_socket_recv(s2, &r, 1, task, event_done, &completion);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ waitfor(&completion);
+ ATF_CHECK(completion.done);
+ ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS);
+ ATF_CHECK_STREQ(recvbuf, "Hello");
+
+ isc_task_detach(&task);
+
+ isc_socket_detach(&s1);
+ isc_socket_detach(&s2);
+
+ isc_test_end();
+}
+
+/* Test UDP sendto/recv with duplicated socket */
+ATF_TC(udp_dup);
+ATF_TC_HEAD(udp_dup, tc) {
+ atf_tc_set_md_var(tc, "descr", "duplicated socket sendto/recv");
+}
+ATF_TC_BODY(udp_dup, tc) {
+ isc_result_t result;
+ isc_sockaddr_t addr1, addr2;
+ struct in_addr in;
+ isc_socket_t *s1 = NULL, *s2 = NULL, *s3 = NULL;
+ isc_task_t *task = NULL;
+ char sendbuf[BUFSIZ], recvbuf[BUFSIZ];
+ completion_t completion;
+ isc_region_t r;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ /*
+ * Create two sockets: 127.0.0.1/5444 and 127.0.0.1/5445, talking to
+ * each other.
+ */
+ in.s_addr = inet_addr("127.0.0.1");
+ isc_sockaddr_fromin(&addr1, &in, 5444);
+ isc_sockaddr_fromin(&addr2, &in, 5445);
+
+ result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s1);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ result = isc_socket_bind(s1, &addr1, ISC_SOCKET_REUSEADDRESS);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp, &s2);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ result = isc_socket_bind(s2, &addr2, ISC_SOCKET_REUSEADDRESS);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_socket_dup(s2, &s3);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_task_create(taskmgr, 0, &task);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ strcpy(sendbuf, "Hello");
+ r.base = (void *) sendbuf;
+ r.length = strlen(sendbuf) + 1;
+
+ completion_init(&completion);
+ result = isc_socket_sendto(s1, &r, task, event_done, &completion,
+ &addr2, NULL);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ waitfor(&completion);
+ ATF_CHECK(completion.done);
+ ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS);
+
+ strcpy(sendbuf, "World");
+ r.base = (void *) sendbuf;
+ r.length = strlen(sendbuf) + 1;
+
+ completion_init(&completion);
+ result = isc_socket_sendto(s1, &r, task, event_done, &completion,
+ &addr2, NULL);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ waitfor(&completion);
+ ATF_CHECK(completion.done);
+ ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS);
+
+ r.base = (void *) recvbuf;
+ r.length = BUFSIZ;
+ completion_init(&completion);
+ result = isc_socket_recv(s2, &r, 1, task, event_done, &completion);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ waitfor(&completion);
+ ATF_CHECK(completion.done);
+ ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS);
+ ATF_CHECK_STREQ(recvbuf, "Hello");
+
+ r.base = (void *) recvbuf;
+ r.length = BUFSIZ;
+ completion_init(&completion);
+ result = isc_socket_recv(s3, &r, 1, task, event_done, &completion);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ waitfor(&completion);
+ ATF_CHECK(completion.done);
+ ATF_CHECK_EQ(completion.result, ISC_R_SUCCESS);
+ ATF_CHECK_STREQ(recvbuf, "World");
+
+ isc_task_detach(&task);
+
+ isc_socket_detach(&s1);
+ isc_socket_detach(&s2);
+ isc_socket_detach(&s3);
+
+ isc_test_end();
+}
+
+/*
+ * Main
+ */
+ATF_TP_ADD_TCS(tp) {
+ ATF_TP_ADD_TC(tp, udp_sendto);
+ ATF_TP_ADD_TC(tp, udp_dup);
+
+ return (atf_no_error());
+}
+
diff --git a/lib/isc/tests/symtab_test.c b/lib/isc/tests/symtab_test.c
new file mode 100644
index 0000000..21444b4
--- /dev/null
+++ b/lib/isc/tests/symtab_test.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <atf-c.h>
+
+#include <unistd.h>
+
+#include <isc/symtab.h>
+#include <isc/print.h>
+
+#include "isctest.h"
+
+static void
+undefine(char *key, unsigned int type, isc_symvalue_t value, void *arg) {
+ UNUSED(arg);
+
+ ATF_REQUIRE_EQ(type, 1);
+ isc_mem_free(mctx, key);
+ isc_mem_free(mctx, value.as_pointer);
+}
+
+/*
+ * Individual unit tests
+ */
+
+ATF_TC(symtab_grow);
+ATF_TC_HEAD(symtab_grow, tc) {
+ atf_tc_set_md_var(tc, "descr", "symbol table growth");
+}
+ATF_TC_BODY(symtab_grow, tc) {
+ isc_result_t result;
+ isc_symtab_t *st = NULL;
+ isc_symvalue_t value;
+ isc_symexists_t policy = isc_symexists_reject;
+ int i;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_symtab_create(mctx, 3, undefine, NULL, ISC_FALSE, &st);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE(st != NULL);
+
+ /* Nothing should be in the table yet */
+
+ /*
+ * Put 1024 entries in the table (this should necessate
+ * regrowing the hash table several times
+ */
+ for (i = 0; i < 1024; i++) {
+ char str[16], *key;
+
+ snprintf(str, sizeof(str), "%04x", i);
+ key = isc_mem_strdup(mctx, str);
+ ATF_REQUIRE(key != NULL);
+ value.as_pointer = isc_mem_strdup(mctx, str);
+ ATF_REQUIRE(value.as_pointer != NULL);
+ result = isc_symtab_define(st, key, 1, value, policy);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ if (result != ISC_R_SUCCESS)
+ undefine(key, 1, value, NULL);
+ }
+
+ /*
+ * Try to put them in again; this should fail
+ */
+ for (i = 0; i < 1024; i++) {
+ char str[16], *key;
+
+ snprintf(str, sizeof(str), "%04x", i);
+ key = isc_mem_strdup(mctx, str);
+ ATF_REQUIRE(key != NULL);
+ value.as_pointer = isc_mem_strdup(mctx, str);
+ ATF_REQUIRE(value.as_pointer != NULL);
+ result = isc_symtab_define(st, key, 1, value, policy);
+ ATF_CHECK_EQ(result, ISC_R_EXISTS);
+ undefine(key, 1, value, NULL);
+ }
+
+ /*
+ * Retrieve them; this should succeed
+ */
+ for (i = 0; i < 1024; i++) {
+ char str[16];
+
+ snprintf(str, sizeof(str), "%04x", i);
+ result = isc_symtab_lookup(st, str, 0, &value);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ ATF_CHECK_STREQ(str, value.as_pointer);
+ }
+
+ /*
+ * Undefine them
+ */
+ for (i = 0; i < 1024; i++) {
+ char str[16];
+
+ snprintf(str, sizeof(str), "%04x", i);
+ result = isc_symtab_undefine(st, str, 1);
+ ATF_CHECK_EQ(result, ISC_R_SUCCESS);
+ }
+
+ /*
+ * Retrieve them again; this should fail
+ */
+ for (i = 0; i < 1024; i++) {
+ char str[16];
+
+ snprintf(str, sizeof(str), "%04x", i);
+ result = isc_symtab_lookup(st, str, 0, &value);
+ ATF_CHECK_EQ(result, ISC_R_NOTFOUND);
+ }
+
+ isc_symtab_destroy(&st);
+ isc_test_end();
+}
+
+/*
+ * Main
+ */
+ATF_TP_ADD_TCS(tp) {
+ ATF_TP_ADD_TC(tp, symtab_grow);
+
+ return (atf_no_error());
+}
+
diff --git a/lib/isc/tests/task_test.c b/lib/isc/tests/task_test.c
new file mode 100644
index 0000000..7294d86
--- /dev/null
+++ b/lib/isc/tests/task_test.c
@@ -0,0 +1,416 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <atf-c.h>
+
+#include <unistd.h>
+
+#include <isc/task.h>
+#include <isc/util.h>
+
+#include "../task_p.h"
+#include "isctest.h"
+
+/*
+ * Helper functions
+ */
+
+/* task event handler, sets a boolean to true */
+int counter = 0;
+isc_mutex_t set_lock;
+
+static void
+set(isc_task_t *task, isc_event_t *event) {
+ int *value = (int *) event->ev_arg;
+
+ UNUSED(task);
+
+ isc_event_free(&event);
+ LOCK(&set_lock);
+ *value = counter++;
+ UNLOCK(&set_lock);
+}
+
+static void
+set_and_drop(isc_task_t *task, isc_event_t *event) {
+ int *value = (int *) event->ev_arg;
+
+ UNUSED(task);
+
+ isc_event_free(&event);
+ LOCK(&set_lock);
+ *value = (int) isc_taskmgr_mode(taskmgr);
+ counter++;
+ UNLOCK(&set_lock);
+ isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_normal);
+}
+
+/*
+ * Individual unit tests
+ */
+
+/* Create a task */
+ATF_TC(create_task);
+ATF_TC_HEAD(create_task, tc) {
+ atf_tc_set_md_var(tc, "descr", "create and destroy a task");
+}
+ATF_TC_BODY(create_task, tc) {
+ isc_result_t result;
+ isc_task_t *task = NULL;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_task_create(taskmgr, 0, &task);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ isc_task_destroy(&task);
+ ATF_REQUIRE_EQ(task, NULL);
+
+ isc_test_end();
+}
+
+/* Process events */
+ATF_TC(all_events);
+ATF_TC_HEAD(all_events, tc) {
+ atf_tc_set_md_var(tc, "descr", "process task events");
+}
+ATF_TC_BODY(all_events, tc) {
+ isc_result_t result;
+ isc_task_t *task = NULL;
+ isc_event_t *event;
+ int a = 0, b = 0;
+ int i = 0;
+
+ UNUSED(tc);
+
+ counter = 1;
+
+ result = isc_mutex_init(&set_lock);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_task_create(taskmgr, 0, &task);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ /* First event */
+ event = isc_event_allocate(mctx, task, ISC_TASKEVENT_TEST,
+ set, &a, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(a, 0);
+ isc_task_send(task, &event);
+
+ event = isc_event_allocate(mctx, task, ISC_TASKEVENT_TEST,
+ set, &b, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(b, 0);
+ isc_task_send(task, &event);
+
+ while ((a == 0 || b == 0) && i++ < 5000) {
+#ifndef ISC_PLATFORM_USETHREADS
+ while (isc__taskmgr_ready(taskmgr))
+ isc__taskmgr_dispatch(taskmgr);
+#endif
+ isc_test_nap(1000);
+ }
+
+ ATF_CHECK(a != 0);
+ ATF_CHECK(b != 0);
+
+ isc_task_destroy(&task);
+ ATF_REQUIRE_EQ(task, NULL);
+
+ isc_test_end();
+}
+
+/* Privileged events */
+ATF_TC(privileged_events);
+ATF_TC_HEAD(privileged_events, tc) {
+ atf_tc_set_md_var(tc, "descr", "process privileged events");
+}
+ATF_TC_BODY(privileged_events, tc) {
+ isc_result_t result;
+ isc_task_t *task1 = NULL, *task2 = NULL;
+ isc_event_t *event;
+ int a = 0, b = 0, c = 0, d = 0, e = 0;
+ int i = 0;
+
+ UNUSED(tc);
+
+ counter = 1;
+ result = isc_mutex_init(&set_lock);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+#ifdef ISC_PLATFORM_USETHREADS
+ /*
+ * Pause the task manager so we can fill up the work queue
+ * without things happening while we do it.
+ */
+ isc__taskmgr_pause(taskmgr);
+#endif
+
+ result = isc_task_create(taskmgr, 0, &task1);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ isc_task_setname(task1, "privileged", NULL);
+ ATF_CHECK(!isc_task_privilege(task1));
+ isc_task_setprivilege(task1, ISC_TRUE);
+ ATF_CHECK(isc_task_privilege(task1));
+
+ result = isc_task_create(taskmgr, 0, &task2);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ isc_task_setname(task2, "normal", NULL);
+ ATF_CHECK(!isc_task_privilege(task2));
+
+ /* First event: privileged */
+ event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ set, &a, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(a, 0);
+ isc_task_send(task1, &event);
+
+ /* Second event: not privileged */
+ event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ set, &b, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(b, 0);
+ isc_task_send(task2, &event);
+
+ /* Third event: privileged */
+ event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ set, &c, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(c, 0);
+ isc_task_send(task1, &event);
+
+ /* Fourth event: privileged */
+ event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ set, &d, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(d, 0);
+ isc_task_send(task1, &event);
+
+ /* Fifth event: not privileged */
+ event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ set, &e, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(e, 0);
+ isc_task_send(task2, &event);
+
+ ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal);
+ isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged);
+ ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged);
+
+#ifdef ISC_PLATFORM_USETHREADS
+ isc__taskmgr_resume(taskmgr);
+#endif
+
+ /* We're waiting for *all* variables to be set */
+ while ((a == 0 || b == 0 || c == 0 || d == 0 || e == 0) && i++ < 5000) {
+#ifndef ISC_PLATFORM_USETHREADS
+ while (isc__taskmgr_ready(taskmgr))
+ isc__taskmgr_dispatch(taskmgr);
+#endif
+ isc_test_nap(1000);
+ }
+
+ /*
+ * We can't guarantee what order the events fire, but
+ * we do know the privileged tasks that set a, c, and d
+ * would have fired first.
+ */
+ ATF_CHECK(a <= 3);
+ ATF_CHECK(c <= 3);
+ ATF_CHECK(d <= 3);
+
+ /* ...and the non-privileged tasks that set b and e, last */
+ ATF_CHECK(b >= 4);
+ ATF_CHECK(e >= 4);
+
+ ATF_CHECK_EQ(counter, 6);
+
+ isc_task_setprivilege(task1, ISC_FALSE);
+ ATF_CHECK(!isc_task_privilege(task1));
+
+ ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal);
+
+ isc_task_destroy(&task1);
+ ATF_REQUIRE_EQ(task1, NULL);
+ isc_task_destroy(&task2);
+ ATF_REQUIRE_EQ(task2, NULL);
+
+ isc_test_end();
+}
+
+/*
+ * Edge case: this tests that the task manager behaves as expected when
+ * we explicitly set it into normal mode *while* running privileged.
+ */
+ATF_TC(privilege_drop);
+ATF_TC_HEAD(privilege_drop, tc) {
+ atf_tc_set_md_var(tc, "descr", "process privileged events");
+}
+ATF_TC_BODY(privilege_drop, tc) {
+ isc_result_t result;
+ isc_task_t *task1 = NULL, *task2 = NULL;
+ isc_event_t *event;
+ int a = -1, b = -1, c = -1, d = -1, e = -1; /* non valid states */
+ int i = 0;
+
+ UNUSED(tc);
+
+ counter = 1;
+ result = isc_mutex_init(&set_lock);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+#ifdef ISC_PLATFORM_USETHREADS
+ /*
+ * Pause the task manager so we can fill up the work queue
+ * without things happening while we do it.
+ */
+ isc__taskmgr_pause(taskmgr);
+#endif
+
+ result = isc_task_create(taskmgr, 0, &task1);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ isc_task_setname(task1, "privileged", NULL);
+ ATF_CHECK(!isc_task_privilege(task1));
+ isc_task_setprivilege(task1, ISC_TRUE);
+ ATF_CHECK(isc_task_privilege(task1));
+
+ result = isc_task_create(taskmgr, 0, &task2);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ isc_task_setname(task2, "normal", NULL);
+ ATF_CHECK(!isc_task_privilege(task2));
+
+ /* First event: privileged */
+ event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ set_and_drop, &a, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(a, -1);
+ isc_task_send(task1, &event);
+
+ /* Second event: not privileged */
+ event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ set_and_drop, &b, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(b, -1);
+ isc_task_send(task2, &event);
+
+ /* Third event: privileged */
+ event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ set_and_drop, &c, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(c, -1);
+ isc_task_send(task1, &event);
+
+ /* Fourth event: privileged */
+ event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ set_and_drop, &d, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(d, -1);
+ isc_task_send(task1, &event);
+
+ /* Fifth event: not privileged */
+ event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ set_and_drop, &e, sizeof (isc_event_t));
+ ATF_REQUIRE(event != NULL);
+
+ ATF_CHECK_EQ(e, -1);
+ isc_task_send(task2, &event);
+
+ ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal);
+ isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged);
+ ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged);
+
+#ifdef ISC_PLATFORM_USETHREADS
+ isc__taskmgr_resume(taskmgr);
+#endif
+
+ /* We're waiting for all variables to be set. */
+ while ((a == -1 || b == -1 || c == -1 || d == -1 || e == -1) &&
+ i++ < 5000) {
+#ifndef ISC_PLATFORM_USETHREADS
+ while (isc__taskmgr_ready(taskmgr))
+ isc__taskmgr_dispatch(taskmgr);
+#endif
+ isc_test_nap(1000);
+ }
+
+ /*
+ * We can't guarantee what order the events fire, but
+ * we do know *exactly one* of the privileged tasks will
+ * have run in privileged mode...
+ */
+ ATF_CHECK(a == isc_taskmgrmode_privileged ||
+ c == isc_taskmgrmode_privileged ||
+ d == isc_taskmgrmode_privileged);
+ ATF_CHECK(a + c + d == isc_taskmgrmode_privileged);
+
+ /* ...and neither of the non-privileged tasks did... */
+ ATF_CHECK(b == isc_taskmgrmode_normal || e == isc_taskmgrmode_normal);
+
+ /* ...but all five of them did run. */
+ ATF_CHECK_EQ(counter, 6);
+
+ ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_normal);
+
+ isc_task_destroy(&task1);
+ ATF_REQUIRE_EQ(task1, NULL);
+ isc_task_destroy(&task2);
+ ATF_REQUIRE_EQ(task2, NULL);
+
+ isc_test_end();
+}
+
+/*
+ * Main
+ */
+ATF_TP_ADD_TCS(tp) {
+ ATF_TP_ADD_TC(tp, create_task);
+ ATF_TP_ADD_TC(tp, all_events);
+ ATF_TP_ADD_TC(tp, privileged_events);
+ ATF_TP_ADD_TC(tp, privilege_drop);
+
+ return (atf_no_error());
+}
+
diff --git a/lib/isc/tests/taskpool_test.c b/lib/isc/tests/taskpool_test.c
new file mode 100644
index 0000000..aecb694
--- /dev/null
+++ b/lib/isc/tests/taskpool_test.c
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <atf-c.h>
+
+#include <unistd.h>
+
+#include <isc/task.h>
+#include <isc/taskpool.h>
+
+#include "isctest.h"
+
+/*
+ * Individual unit tests
+ */
+
+/* Create a taskpool */
+ATF_TC(create_pool);
+ATF_TC_HEAD(create_pool, tc) {
+ atf_tc_set_md_var(tc, "descr", "create a taskpool");
+}
+ATF_TC_BODY(create_pool, tc) {
+ isc_result_t result;
+ isc_taskpool_t *pool = NULL;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_taskpool_create(taskmgr, mctx, 8, 2, &pool);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE_EQ(isc_taskpool_size(pool), 8);
+
+ isc_taskpool_destroy(&pool);
+ ATF_REQUIRE_EQ(pool, NULL);
+
+ isc_test_end();
+}
+
+/* Resize a taskpool */
+ATF_TC(expand_pool);
+ATF_TC_HEAD(expand_pool, tc) {
+ atf_tc_set_md_var(tc, "descr", "expand a taskpool");
+}
+ATF_TC_BODY(expand_pool, tc) {
+ isc_result_t result;
+ isc_taskpool_t *pool1 = NULL, *pool2 = NULL, *hold = NULL;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_taskpool_create(taskmgr, mctx, 10, 2, &pool1);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE_EQ(isc_taskpool_size(pool1), 10);
+
+ /* resizing to a smaller size should have no effect */
+ hold = pool1;
+ result = isc_taskpool_expand(&pool1, 5, &pool2);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE_EQ(isc_taskpool_size(pool2), 10);
+ ATF_REQUIRE_EQ(pool2, hold);
+ ATF_REQUIRE_EQ(pool1, NULL);
+ pool1 = pool2;
+ pool2 = NULL;
+
+ /* resizing to the same size should have no effect */
+ hold = pool1;
+ result = isc_taskpool_expand(&pool1, 10, &pool2);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE_EQ(isc_taskpool_size(pool2), 10);
+ ATF_REQUIRE_EQ(pool2, hold);
+ ATF_REQUIRE_EQ(pool1, NULL);
+ pool1 = pool2;
+ pool2 = NULL;
+
+ /* resizing to larger size should make a new pool */
+ hold = pool1;
+ result = isc_taskpool_expand(&pool1, 20, &pool2);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE_EQ(isc_taskpool_size(pool2), 20);
+ ATF_REQUIRE(pool2 != hold);
+ ATF_REQUIRE_EQ(pool1, NULL);
+
+ isc_taskpool_destroy(&pool2);
+ ATF_REQUIRE_EQ(pool2, NULL);
+
+ isc_test_end();
+}
+
+/* Get tasks */
+ATF_TC(get_tasks);
+ATF_TC_HEAD(get_tasks, tc) {
+ atf_tc_set_md_var(tc, "descr", "create a taskpool");
+}
+ATF_TC_BODY(get_tasks, tc) {
+ isc_result_t result;
+ isc_taskpool_t *pool = NULL;
+ isc_task_t *task1 = NULL, *task2 = NULL, *task3 = NULL;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE_EQ(isc_taskpool_size(pool), 2);
+
+ /* two tasks in pool; make sure we can access them more than twice */
+ isc_taskpool_gettask(pool, &task1);
+ ATF_REQUIRE(ISCAPI_TASK_VALID(task1));
+
+ isc_taskpool_gettask(pool, &task2);
+ ATF_REQUIRE(ISCAPI_TASK_VALID(task2));
+
+ isc_taskpool_gettask(pool, &task3);
+ ATF_REQUIRE(ISCAPI_TASK_VALID(task3));
+
+ isc_task_destroy(&task1);
+ isc_task_destroy(&task2);
+ isc_task_destroy(&task3);
+
+ isc_taskpool_destroy(&pool);
+ ATF_REQUIRE_EQ(pool, NULL);
+
+ isc_test_end();
+}
+
+/* Get tasks */
+ATF_TC(set_privilege);
+ATF_TC_HEAD(set_privilege, tc) {
+ atf_tc_set_md_var(tc, "descr", "create a taskpool");
+}
+ATF_TC_BODY(set_privilege, tc) {
+ isc_result_t result;
+ isc_taskpool_t *pool = NULL;
+ isc_task_t *task1 = NULL, *task2 = NULL, *task3 = NULL;
+
+ UNUSED(tc);
+
+ result = isc_test_begin(NULL, ISC_TRUE);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+
+ result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool);
+ ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
+ ATF_REQUIRE_EQ(isc_taskpool_size(pool), 2);
+
+ isc_taskpool_setprivilege(pool, ISC_TRUE);
+
+ isc_taskpool_gettask(pool, &task1);
+ isc_taskpool_gettask(pool, &task2);
+ isc_taskpool_gettask(pool, &task3);
+
+ ATF_CHECK(ISCAPI_TASK_VALID(task1));
+ ATF_CHECK(ISCAPI_TASK_VALID(task2));
+ ATF_CHECK(ISCAPI_TASK_VALID(task3));
+
+ ATF_CHECK(isc_task_privilege(task1));
+ ATF_CHECK(isc_task_privilege(task2));
+ ATF_CHECK(isc_task_privilege(task3));
+
+ isc_taskpool_setprivilege(pool, ISC_FALSE);
+
+ ATF_CHECK(!isc_task_privilege(task1));
+ ATF_CHECK(!isc_task_privilege(task2));
+ ATF_CHECK(!isc_task_privilege(task3));
+
+ isc_task_destroy(&task1);
+ isc_task_destroy(&task2);
+ isc_task_destroy(&task3);
+
+ isc_taskpool_destroy(&pool);
+ ATF_REQUIRE_EQ(pool, NULL);
+
+ isc_test_end();
+}
+
+/*
+ * Main
+ */
+ATF_TP_ADD_TCS(tp) {
+ ATF_TP_ADD_TC(tp, create_pool);
+ ATF_TP_ADD_TC(tp, expand_pool);
+ ATF_TP_ADD_TC(tp, get_tasks);
+ ATF_TP_ADD_TC(tp, set_privilege);
+
+ return (atf_no_error());
+}
+
diff --git a/lib/isc/timer.c b/lib/isc/timer.c
new file mode 100644
index 0000000..0da251f
--- /dev/null
+++ b/lib/isc/timer.c
@@ -0,0 +1,1072 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/condition.h>
+#include <isc/heap.h>
+#include <isc/log.h>
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/platform.h>
+#include <isc/task.h>
+#include <isc/thread.h>
+#include <isc/time.h>
+#include <isc/timer.h>
+#include <isc/util.h>
+
+#ifdef OPENSSL_LEAKS
+#include <openssl/err.h>
+#endif
+
+/* See task.c about the following definition: */
+#ifdef BIND9
+#ifdef ISC_PLATFORM_USETHREADS
+#define USE_TIMER_THREAD
+#else
+#define USE_SHARED_MANAGER
+#endif /* ISC_PLATFORM_USETHREADS */
+#endif /* BIND9 */
+
+#ifndef USE_TIMER_THREAD
+#include "timer_p.h"
+#endif /* USE_TIMER_THREAD */
+
+#ifdef ISC_TIMER_TRACE
+#define XTRACE(s) fprintf(stderr, "%s\n", (s))
+#define XTRACEID(s, t) fprintf(stderr, "%s %p\n", (s), (t))
+#define XTRACETIME(s, d) fprintf(stderr, "%s %u.%09u\n", (s), \
+ (d).seconds, (d).nanoseconds)
+#define XTRACETIME2(s, d, n) fprintf(stderr, "%s %u.%09u %u.%09u\n", (s), \
+ (d).seconds, (d).nanoseconds, (n).seconds, (n).nanoseconds)
+#define XTRACETIMER(s, t, d) fprintf(stderr, "%s %p %u.%09u\n", (s), (t), \
+ (d).seconds, (d).nanoseconds)
+#else
+#define XTRACE(s)
+#define XTRACEID(s, t)
+#define XTRACETIME(s, d)
+#define XTRACETIME2(s, d, n)
+#define XTRACETIMER(s, t, d)
+#endif /* ISC_TIMER_TRACE */
+
+#define TIMER_MAGIC ISC_MAGIC('T', 'I', 'M', 'R')
+#define VALID_TIMER(t) ISC_MAGIC_VALID(t, TIMER_MAGIC)
+
+typedef struct isc__timer isc__timer_t;
+typedef struct isc__timermgr isc__timermgr_t;
+
+struct isc__timer {
+ /*! Not locked. */
+ isc_timer_t common;
+ isc__timermgr_t * manager;
+ isc_mutex_t lock;
+ /*! Locked by timer lock. */
+ unsigned int references;
+ isc_time_t idle;
+ /*! Locked by manager lock. */
+ isc_timertype_t type;
+ isc_time_t expires;
+ isc_interval_t interval;
+ isc_task_t * task;
+ isc_taskaction_t action;
+ void * arg;
+ unsigned int index;
+ isc_time_t due;
+ LINK(isc__timer_t) link;
+};
+
+#define TIMER_MANAGER_MAGIC ISC_MAGIC('T', 'I', 'M', 'M')
+#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, TIMER_MANAGER_MAGIC)
+
+struct isc__timermgr {
+ /* Not locked. */
+ isc_timermgr_t common;
+ isc_mem_t * mctx;
+ isc_mutex_t lock;
+ /* Locked by manager lock. */
+ isc_boolean_t done;
+ LIST(isc__timer_t) timers;
+ unsigned int nscheduled;
+ isc_time_t due;
+#ifdef USE_TIMER_THREAD
+ isc_condition_t wakeup;
+ isc_thread_t thread;
+#endif /* USE_TIMER_THREAD */
+#ifdef USE_SHARED_MANAGER
+ unsigned int refs;
+#endif /* USE_SHARED_MANAGER */
+ isc_heap_t * heap;
+};
+
+/*%
+ * The followings can be either static or public, depending on build
+ * environment.
+ */
+
+#ifdef BIND9
+#define ISC_TIMERFUNC_SCOPE
+#else
+#define ISC_TIMERFUNC_SCOPE static
+#endif
+
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timer_create(isc_timermgr_t *manager, isc_timertype_t type,
+ isc_time_t *expires, isc_interval_t *interval,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_timer_t **timerp);
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timer_reset(isc_timer_t *timer, isc_timertype_t type,
+ isc_time_t *expires, isc_interval_t *interval,
+ isc_boolean_t purge);
+ISC_TIMERFUNC_SCOPE isc_timertype_t
+isc__timer_gettype(isc_timer_t *timer);
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timer_touch(isc_timer_t *timer);
+ISC_TIMERFUNC_SCOPE void
+isc__timer_attach(isc_timer_t *timer0, isc_timer_t **timerp);
+ISC_TIMERFUNC_SCOPE void
+isc__timer_detach(isc_timer_t **timerp);
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp);
+ISC_TIMERFUNC_SCOPE void
+isc__timermgr_poke(isc_timermgr_t *manager0);
+ISC_TIMERFUNC_SCOPE void
+isc__timermgr_destroy(isc_timermgr_t **managerp);
+
+static struct isc__timermethods {
+ isc_timermethods_t methods;
+
+ /*%
+ * The following are defined just for avoiding unused static functions.
+ */
+#ifndef BIND9
+ void *gettype;
+#endif
+} timermethods = {
+ {
+ isc__timer_attach,
+ isc__timer_detach,
+ isc__timer_reset,
+ isc__timer_touch
+ }
+#ifndef BIND9
+ ,
+ (void *)isc__timer_gettype
+#endif
+};
+
+static struct isc__timermgrmethods {
+ isc_timermgrmethods_t methods;
+#ifndef BIND9
+ void *poke; /* see above */
+#endif
+} timermgrmethods = {
+ {
+ isc__timermgr_destroy,
+ isc__timer_create
+ }
+#ifndef BIND9
+ ,
+ (void *)isc__timermgr_poke
+#endif
+};
+
+#ifdef USE_SHARED_MANAGER
+/*!
+ * If the manager is supposed to be shared, there can be only one.
+ */
+static isc__timermgr_t *timermgr = NULL;
+#endif /* USE_SHARED_MANAGER */
+
+static inline isc_result_t
+schedule(isc__timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) {
+ isc_result_t result;
+ isc__timermgr_t *manager;
+ isc_time_t due;
+ int cmp;
+#ifdef USE_TIMER_THREAD
+ isc_boolean_t timedwait;
+#endif
+
+ /*!
+ * Note: the caller must ensure locking.
+ */
+
+ REQUIRE(timer->type != isc_timertype_inactive);
+
+#ifndef USE_TIMER_THREAD
+ UNUSED(signal_ok);
+#endif /* USE_TIMER_THREAD */
+
+ manager = timer->manager;
+
+#ifdef USE_TIMER_THREAD
+ /*!
+ * If the manager was timed wait, we may need to signal the
+ * manager to force a wakeup.
+ */
+ timedwait = ISC_TF(manager->nscheduled > 0 &&
+ isc_time_seconds(&manager->due) != 0);
+#endif
+
+ /*
+ * Compute the new due time.
+ */
+ if (timer->type != isc_timertype_once) {
+ result = isc_time_add(now, &timer->interval, &due);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ if (timer->type == isc_timertype_limited &&
+ isc_time_compare(&timer->expires, &due) < 0)
+ due = timer->expires;
+ } else {
+ if (isc_time_isepoch(&timer->idle))
+ due = timer->expires;
+ else if (isc_time_isepoch(&timer->expires))
+ due = timer->idle;
+ else if (isc_time_compare(&timer->idle, &timer->expires) < 0)
+ due = timer->idle;
+ else
+ due = timer->expires;
+ }
+
+ /*
+ * Schedule the timer.
+ */
+
+ if (timer->index > 0) {
+ /*
+ * Already scheduled.
+ */
+ cmp = isc_time_compare(&due, &timer->due);
+ timer->due = due;
+ switch (cmp) {
+ case -1:
+ isc_heap_increased(manager->heap, timer->index);
+ break;
+ case 1:
+ isc_heap_decreased(manager->heap, timer->index);
+ break;
+ case 0:
+ /* Nothing to do. */
+ break;
+ }
+ } else {
+ timer->due = due;
+ result = isc_heap_insert(manager->heap, timer);
+ if (result != ISC_R_SUCCESS) {
+ INSIST(result == ISC_R_NOMEMORY);
+ return (ISC_R_NOMEMORY);
+ }
+ manager->nscheduled++;
+ }
+
+ XTRACETIMER(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER,
+ ISC_MSG_SCHEDULE, "schedule"), timer, due);
+
+ /*
+ * If this timer is at the head of the queue, we need to ensure
+ * that we won't miss it if it has a more recent due time than
+ * the current "next" timer. We do this either by waking up the
+ * run thread, or explicitly setting the value in the manager.
+ */
+#ifdef USE_TIMER_THREAD
+
+ /*
+ * This is a temporary (probably) hack to fix a bug on tru64 5.1
+ * and 5.1a. Sometimes, pthread_cond_timedwait() doesn't actually
+ * return when the time expires, so here, we check to see if
+ * we're 15 seconds or more behind, and if we are, we signal
+ * the dispatcher. This isn't such a bad idea as a general purpose
+ * watchdog, so perhaps we should just leave it in here.
+ */
+ if (signal_ok && timedwait) {
+ isc_interval_t fifteen;
+ isc_time_t then;
+
+ isc_interval_set(&fifteen, 15, 0);
+ result = isc_time_add(&manager->due, &fifteen, &then);
+
+ if (result == ISC_R_SUCCESS &&
+ isc_time_compare(&then, now) < 0) {
+ SIGNAL(&manager->wakeup);
+ signal_ok = ISC_FALSE;
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_TIMER, ISC_LOG_WARNING,
+ "*** POKED TIMER ***");
+ }
+ }
+
+ if (timer->index == 1 && signal_ok) {
+ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER,
+ ISC_MSG_SIGNALSCHED,
+ "signal (schedule)"));
+ SIGNAL(&manager->wakeup);
+ }
+#else /* USE_TIMER_THREAD */
+ if (timer->index == 1 &&
+ isc_time_compare(&timer->due, &manager->due) < 0)
+ manager->due = timer->due;
+#endif /* USE_TIMER_THREAD */
+
+ return (ISC_R_SUCCESS);
+}
+
+static inline void
+deschedule(isc__timer_t *timer) {
+#ifdef USE_TIMER_THREAD
+ isc_boolean_t need_wakeup = ISC_FALSE;
+#endif
+ isc__timermgr_t *manager;
+
+ /*
+ * The caller must ensure locking.
+ */
+
+ manager = timer->manager;
+ if (timer->index > 0) {
+#ifdef USE_TIMER_THREAD
+ if (timer->index == 1)
+ need_wakeup = ISC_TRUE;
+#endif
+ isc_heap_delete(manager->heap, timer->index);
+ timer->index = 0;
+ INSIST(manager->nscheduled > 0);
+ manager->nscheduled--;
+#ifdef USE_TIMER_THREAD
+ if (need_wakeup) {
+ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER,
+ ISC_MSG_SIGNALDESCHED,
+ "signal (deschedule)"));
+ SIGNAL(&manager->wakeup);
+ }
+#endif /* USE_TIMER_THREAD */
+ }
+}
+
+static void
+destroy(isc__timer_t *timer) {
+ isc__timermgr_t *manager = timer->manager;
+
+ /*
+ * The caller must ensure it is safe to destroy the timer.
+ */
+
+ LOCK(&manager->lock);
+
+ (void)isc_task_purgerange(timer->task,
+ timer,
+ ISC_TIMEREVENT_FIRSTEVENT,
+ ISC_TIMEREVENT_LASTEVENT,
+ NULL);
+ deschedule(timer);
+ UNLINK(manager->timers, timer, link);
+
+ UNLOCK(&manager->lock);
+
+ isc_task_detach(&timer->task);
+ DESTROYLOCK(&timer->lock);
+ timer->common.impmagic = 0;
+ timer->common.magic = 0;
+ isc_mem_put(manager->mctx, timer, sizeof(*timer));
+}
+
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type,
+ isc_time_t *expires, isc_interval_t *interval,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_timer_t **timerp)
+{
+ isc__timermgr_t *manager = (isc__timermgr_t *)manager0;
+ isc__timer_t *timer;
+ isc_result_t result;
+ isc_time_t now;
+
+ /*
+ * Create a new 'type' timer managed by 'manager'. The timers
+ * parameters are specified by 'expires' and 'interval'. Events
+ * will be posted to 'task' and when dispatched 'action' will be
+ * called with 'arg' as the arg value. The new timer is returned
+ * in 'timerp'.
+ */
+
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+ if (expires == NULL)
+ expires = isc_time_epoch;
+ if (interval == NULL)
+ interval = isc_interval_zero;
+ REQUIRE(type == isc_timertype_inactive ||
+ !(isc_time_isepoch(expires) && isc_interval_iszero(interval)));
+ REQUIRE(timerp != NULL && *timerp == NULL);
+ REQUIRE(type != isc_timertype_limited ||
+ !(isc_time_isepoch(expires) || isc_interval_iszero(interval)));
+
+ /*
+ * Get current time.
+ */
+ if (type != isc_timertype_inactive) {
+ TIME_NOW(&now);
+ } else {
+ /*
+ * We don't have to do this, but it keeps the compiler from
+ * complaining about "now" possibly being used without being
+ * set, even though it will never actually happen.
+ */
+ isc_time_settoepoch(&now);
+ }
+
+
+ timer = isc_mem_get(manager->mctx, sizeof(*timer));
+ if (timer == NULL)
+ return (ISC_R_NOMEMORY);
+
+ timer->manager = manager;
+ timer->references = 1;
+
+ if (type == isc_timertype_once && !isc_interval_iszero(interval)) {
+ result = isc_time_add(&now, interval, &timer->idle);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_put(manager->mctx, timer, sizeof(*timer));
+ return (result);
+ }
+ } else
+ isc_time_settoepoch(&timer->idle);
+
+ timer->type = type;
+ timer->expires = *expires;
+ timer->interval = *interval;
+ timer->task = NULL;
+ isc_task_attach(task, &timer->task);
+ timer->action = action;
+ /*
+ * Removing the const attribute from "arg" is the best of two
+ * evils here. If the timer->arg member is made const, then
+ * it affects a great many recipients of the timer event
+ * which did not pass in an "arg" that was truly const.
+ * Changing isc_timer_create() to not have "arg" prototyped as const,
+ * though, can cause compilers warnings for calls that *do*
+ * have a truly const arg. The caller will have to carefully
+ * keep track of whether arg started as a true const.
+ */
+ DE_CONST(arg, timer->arg);
+ timer->index = 0;
+ result = isc_mutex_init(&timer->lock);
+ if (result != ISC_R_SUCCESS) {
+ isc_task_detach(&timer->task);
+ isc_mem_put(manager->mctx, timer, sizeof(*timer));
+ return (result);
+ }
+ ISC_LINK_INIT(timer, link);
+ timer->common.impmagic = TIMER_MAGIC;
+ timer->common.magic = ISCAPI_TIMER_MAGIC;
+ timer->common.methods = (isc_timermethods_t *)&timermethods;
+
+ LOCK(&manager->lock);
+
+ /*
+ * Note we don't have to lock the timer like we normally would because
+ * there are no external references to it yet.
+ */
+
+ if (type != isc_timertype_inactive)
+ result = schedule(timer, &now, ISC_TRUE);
+ else
+ result = ISC_R_SUCCESS;
+ if (result == ISC_R_SUCCESS)
+ APPEND(manager->timers, timer, link);
+
+ UNLOCK(&manager->lock);
+
+ if (result != ISC_R_SUCCESS) {
+ timer->common.impmagic = 0;
+ timer->common.magic = 0;
+ DESTROYLOCK(&timer->lock);
+ isc_task_detach(&timer->task);
+ isc_mem_put(manager->mctx, timer, sizeof(*timer));
+ return (result);
+ }
+
+ *timerp = (isc_timer_t *)timer;
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timer_reset(isc_timer_t *timer0, isc_timertype_t type,
+ isc_time_t *expires, isc_interval_t *interval,
+ isc_boolean_t purge)
+{
+ isc__timer_t *timer = (isc__timer_t *)timer0;
+ isc_time_t now;
+ isc__timermgr_t *manager;
+ isc_result_t result;
+
+ /*
+ * Change the timer's type, expires, and interval values to the given
+ * values. If 'purge' is ISC_TRUE, any pending events from this timer
+ * are purged from its task's event queue.
+ */
+
+ REQUIRE(VALID_TIMER(timer));
+ manager = timer->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ if (expires == NULL)
+ expires = isc_time_epoch;
+ if (interval == NULL)
+ interval = isc_interval_zero;
+ REQUIRE(type == isc_timertype_inactive ||
+ !(isc_time_isepoch(expires) && isc_interval_iszero(interval)));
+ REQUIRE(type != isc_timertype_limited ||
+ !(isc_time_isepoch(expires) || isc_interval_iszero(interval)));
+
+ /*
+ * Get current time.
+ */
+ if (type != isc_timertype_inactive) {
+ TIME_NOW(&now);
+ } else {
+ /*
+ * We don't have to do this, but it keeps the compiler from
+ * complaining about "now" possibly being used without being
+ * set, even though it will never actually happen.
+ */
+ isc_time_settoepoch(&now);
+ }
+
+ LOCK(&manager->lock);
+ LOCK(&timer->lock);
+
+ if (purge)
+ (void)isc_task_purgerange(timer->task,
+ timer,
+ ISC_TIMEREVENT_FIRSTEVENT,
+ ISC_TIMEREVENT_LASTEVENT,
+ NULL);
+ timer->type = type;
+ timer->expires = *expires;
+ timer->interval = *interval;
+ if (type == isc_timertype_once && !isc_interval_iszero(interval)) {
+ result = isc_time_add(&now, interval, &timer->idle);
+ } else {
+ isc_time_settoepoch(&timer->idle);
+ result = ISC_R_SUCCESS;
+ }
+
+ if (result == ISC_R_SUCCESS) {
+ if (type == isc_timertype_inactive) {
+ deschedule(timer);
+ result = ISC_R_SUCCESS;
+ } else
+ result = schedule(timer, &now, ISC_TRUE);
+ }
+
+ UNLOCK(&timer->lock);
+ UNLOCK(&manager->lock);
+
+ return (result);
+}
+
+ISC_TIMERFUNC_SCOPE isc_timertype_t
+isc__timer_gettype(isc_timer_t *timer0) {
+ isc__timer_t *timer = (isc__timer_t *)timer0;
+ isc_timertype_t t;
+
+ REQUIRE(VALID_TIMER(timer));
+
+ LOCK(&timer->lock);
+ t = timer->type;
+ UNLOCK(&timer->lock);
+
+ return (t);
+}
+
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timer_touch(isc_timer_t *timer0) {
+ isc__timer_t *timer = (isc__timer_t *)timer0;
+ isc_result_t result;
+ isc_time_t now;
+
+ /*
+ * Set the last-touched time of 'timer' to the current time.
+ */
+
+ REQUIRE(VALID_TIMER(timer));
+
+ LOCK(&timer->lock);
+
+ /*
+ * We'd like to
+ *
+ * REQUIRE(timer->type == isc_timertype_once);
+ *
+ * but we cannot without locking the manager lock too, which we
+ * don't want to do.
+ */
+
+ TIME_NOW(&now);
+ result = isc_time_add(&now, &timer->interval, &timer->idle);
+
+ UNLOCK(&timer->lock);
+
+ return (result);
+}
+
+ISC_TIMERFUNC_SCOPE void
+isc__timer_attach(isc_timer_t *timer0, isc_timer_t **timerp) {
+ isc__timer_t *timer = (isc__timer_t *)timer0;
+
+ /*
+ * Attach *timerp to timer.
+ */
+
+ REQUIRE(VALID_TIMER(timer));
+ REQUIRE(timerp != NULL && *timerp == NULL);
+
+ LOCK(&timer->lock);
+ timer->references++;
+ UNLOCK(&timer->lock);
+
+ *timerp = (isc_timer_t *)timer;
+}
+
+ISC_TIMERFUNC_SCOPE void
+isc__timer_detach(isc_timer_t **timerp) {
+ isc__timer_t *timer;
+ isc_boolean_t free_timer = ISC_FALSE;
+
+ /*
+ * Detach *timerp from its timer.
+ */
+
+ REQUIRE(timerp != NULL);
+ timer = (isc__timer_t *)*timerp;
+ REQUIRE(VALID_TIMER(timer));
+
+ LOCK(&timer->lock);
+ REQUIRE(timer->references > 0);
+ timer->references--;
+ if (timer->references == 0)
+ free_timer = ISC_TRUE;
+ UNLOCK(&timer->lock);
+
+ if (free_timer)
+ destroy(timer);
+
+ *timerp = NULL;
+}
+
+static void
+dispatch(isc__timermgr_t *manager, isc_time_t *now) {
+ isc_boolean_t done = ISC_FALSE, post_event, need_schedule;
+ isc_timerevent_t *event;
+ isc_eventtype_t type = 0;
+ isc__timer_t *timer;
+ isc_result_t result;
+ isc_boolean_t idle;
+
+ /*!
+ * The caller must be holding the manager lock.
+ */
+
+ while (manager->nscheduled > 0 && !done) {
+ timer = isc_heap_element(manager->heap, 1);
+ INSIST(timer->type != isc_timertype_inactive);
+ if (isc_time_compare(now, &timer->due) >= 0) {
+ if (timer->type == isc_timertype_ticker) {
+ type = ISC_TIMEREVENT_TICK;
+ post_event = ISC_TRUE;
+ need_schedule = ISC_TRUE;
+ } else if (timer->type == isc_timertype_limited) {
+ int cmp;
+ cmp = isc_time_compare(now, &timer->expires);
+ if (cmp >= 0) {
+ type = ISC_TIMEREVENT_LIFE;
+ post_event = ISC_TRUE;
+ need_schedule = ISC_FALSE;
+ } else {
+ type = ISC_TIMEREVENT_TICK;
+ post_event = ISC_TRUE;
+ need_schedule = ISC_TRUE;
+ }
+ } else if (!isc_time_isepoch(&timer->expires) &&
+ isc_time_compare(now,
+ &timer->expires) >= 0) {
+ type = ISC_TIMEREVENT_LIFE;
+ post_event = ISC_TRUE;
+ need_schedule = ISC_FALSE;
+ } else {
+ idle = ISC_FALSE;
+
+ LOCK(&timer->lock);
+ if (!isc_time_isepoch(&timer->idle) &&
+ isc_time_compare(now,
+ &timer->idle) >= 0) {
+ idle = ISC_TRUE;
+ }
+ UNLOCK(&timer->lock);
+ if (idle) {
+ type = ISC_TIMEREVENT_IDLE;
+ post_event = ISC_TRUE;
+ need_schedule = ISC_FALSE;
+ } else {
+ /*
+ * Idle timer has been touched;
+ * reschedule.
+ */
+ XTRACEID(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TIMER,
+ ISC_MSG_IDLERESCHED,
+ "idle reschedule"),
+ timer);
+ post_event = ISC_FALSE;
+ need_schedule = ISC_TRUE;
+ }
+ }
+
+ if (post_event) {
+ XTRACEID(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TIMER,
+ ISC_MSG_POSTING,
+ "posting"), timer);
+ /*
+ * XXX We could preallocate this event.
+ */
+ event = (isc_timerevent_t *)isc_event_allocate(manager->mctx,
+ timer,
+ type,
+ timer->action,
+ timer->arg,
+ sizeof(*event));
+
+ if (event != NULL) {
+ event->due = timer->due;
+ isc_task_send(timer->task,
+ ISC_EVENT_PTR(&event));
+ } else
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TIMER,
+ ISC_MSG_EVENTNOTALLOC,
+ "couldn't "
+ "allocate event"));
+ }
+
+ timer->index = 0;
+ isc_heap_delete(manager->heap, 1);
+ manager->nscheduled--;
+
+ if (need_schedule) {
+ result = schedule(timer, now, ISC_FALSE);
+ if (result != ISC_R_SUCCESS)
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "%s: %u",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_TIMER,
+ ISC_MSG_SCHEDFAIL,
+ "couldn't schedule "
+ "timer"),
+ result);
+ }
+ } else {
+ manager->due = timer->due;
+ done = ISC_TRUE;
+ }
+ }
+}
+
+#ifdef USE_TIMER_THREAD
+static isc_threadresult_t
+#ifdef _WIN32 /* XXXDCL */
+WINAPI
+#endif
+run(void *uap) {
+ isc__timermgr_t *manager = uap;
+ isc_time_t now;
+ isc_result_t result;
+
+ LOCK(&manager->lock);
+ while (!manager->done) {
+ TIME_NOW(&now);
+
+ XTRACETIME(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_RUNNING,
+ "running"), now);
+
+ dispatch(manager, &now);
+
+ if (manager->nscheduled > 0) {
+ XTRACETIME2(isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_WAITUNTIL,
+ "waituntil"),
+ manager->due, now);
+ result = WAITUNTIL(&manager->wakeup, &manager->lock, &manager->due);
+ INSIST(result == ISC_R_SUCCESS ||
+ result == ISC_R_TIMEDOUT);
+ } else {
+ XTRACETIME(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_WAIT, "wait"), now);
+ WAIT(&manager->wakeup, &manager->lock);
+ }
+ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER,
+ ISC_MSG_WAKEUP, "wakeup"));
+ }
+ UNLOCK(&manager->lock);
+
+#ifdef OPENSSL_LEAKS
+ ERR_remove_state(0);
+#endif
+
+ return ((isc_threadresult_t)0);
+}
+#endif /* USE_TIMER_THREAD */
+
+static isc_boolean_t
+sooner(void *v1, void *v2) {
+ isc__timer_t *t1, *t2;
+
+ t1 = v1;
+ t2 = v2;
+ REQUIRE(VALID_TIMER(t1));
+ REQUIRE(VALID_TIMER(t2));
+
+ if (isc_time_compare(&t1->due, &t2->due) < 0)
+ return (ISC_TRUE);
+ return (ISC_FALSE);
+}
+
+static void
+set_index(void *what, unsigned int index) {
+ isc__timer_t *timer;
+
+ timer = what;
+ REQUIRE(VALID_TIMER(timer));
+
+ timer->index = index;
+}
+
+ISC_TIMERFUNC_SCOPE isc_result_t
+isc__timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
+ isc__timermgr_t *manager;
+ isc_result_t result;
+
+ /*
+ * Create a timer manager.
+ */
+
+ REQUIRE(managerp != NULL && *managerp == NULL);
+
+#ifdef USE_SHARED_MANAGER
+ if (timermgr != NULL) {
+ timermgr->refs++;
+ *managerp = (isc_timermgr_t *)timermgr;
+ return (ISC_R_SUCCESS);
+ }
+#endif /* USE_SHARED_MANAGER */
+
+ manager = isc_mem_get(mctx, sizeof(*manager));
+ if (manager == NULL)
+ return (ISC_R_NOMEMORY);
+
+ manager->common.impmagic = TIMER_MANAGER_MAGIC;
+ manager->common.magic = ISCAPI_TIMERMGR_MAGIC;
+ manager->common.methods = (isc_timermgrmethods_t *)&timermgrmethods;
+ manager->mctx = NULL;
+ manager->done = ISC_FALSE;
+ INIT_LIST(manager->timers);
+ manager->nscheduled = 0;
+ isc_time_settoepoch(&manager->due);
+ manager->heap = NULL;
+ result = isc_heap_create(mctx, sooner, set_index, 0, &manager->heap);
+ if (result != ISC_R_SUCCESS) {
+ INSIST(result == ISC_R_NOMEMORY);
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ return (ISC_R_NOMEMORY);
+ }
+ result = isc_mutex_init(&manager->lock);
+ if (result != ISC_R_SUCCESS) {
+ isc_heap_destroy(&manager->heap);
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ return (result);
+ }
+ isc_mem_attach(mctx, &manager->mctx);
+#ifdef USE_TIMER_THREAD
+ if (isc_condition_init(&manager->wakeup) != ISC_R_SUCCESS) {
+ isc_mem_detach(&manager->mctx);
+ DESTROYLOCK(&manager->lock);
+ isc_heap_destroy(&manager->heap);
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ return (ISC_R_UNEXPECTED);
+ }
+ if (isc_thread_create(run, manager, &manager->thread) !=
+ ISC_R_SUCCESS) {
+ isc_mem_detach(&manager->mctx);
+ (void)isc_condition_destroy(&manager->wakeup);
+ DESTROYLOCK(&manager->lock);
+ isc_heap_destroy(&manager->heap);
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_thread_create() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ return (ISC_R_UNEXPECTED);
+ }
+#endif
+#ifdef USE_SHARED_MANAGER
+ manager->refs = 1;
+ timermgr = manager;
+#endif /* USE_SHARED_MANAGER */
+
+ *managerp = (isc_timermgr_t *)manager;
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_TIMERFUNC_SCOPE void
+isc__timermgr_poke(isc_timermgr_t *manager0) {
+#ifdef USE_TIMER_THREAD
+ isc__timermgr_t *manager = (isc__timermgr_t *)manager0;
+
+ REQUIRE(VALID_MANAGER(manager));
+
+ SIGNAL(&manager->wakeup);
+#else
+ UNUSED(manager0);
+#endif
+}
+
+ISC_TIMERFUNC_SCOPE void
+isc__timermgr_destroy(isc_timermgr_t **managerp) {
+ isc__timermgr_t *manager;
+ isc_mem_t *mctx;
+
+ /*
+ * Destroy a timer manager.
+ */
+
+ REQUIRE(managerp != NULL);
+ manager = (isc__timermgr_t *)*managerp;
+ REQUIRE(VALID_MANAGER(manager));
+
+ LOCK(&manager->lock);
+
+#ifdef USE_SHARED_MANAGER
+ manager->refs--;
+ if (manager->refs > 0) {
+ UNLOCK(&manager->lock);
+ *managerp = NULL;
+ return;
+ }
+ timermgr = NULL;
+#endif /* USE_SHARED_MANAGER */
+
+#ifndef USE_TIMER_THREAD
+ isc__timermgr_dispatch((isc_timermgr_t *)manager);
+#endif
+
+ REQUIRE(EMPTY(manager->timers));
+ manager->done = ISC_TRUE;
+
+#ifdef USE_TIMER_THREAD
+ XTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TIMER,
+ ISC_MSG_SIGNALDESTROY, "signal (destroy)"));
+ SIGNAL(&manager->wakeup);
+#endif /* USE_TIMER_THREAD */
+
+ UNLOCK(&manager->lock);
+
+#ifdef USE_TIMER_THREAD
+ /*
+ * Wait for thread to exit.
+ */
+ if (isc_thread_join(manager->thread, NULL) != ISC_R_SUCCESS)
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_thread_join() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+#endif /* USE_TIMER_THREAD */
+
+ /*
+ * Clean up.
+ */
+#ifdef USE_TIMER_THREAD
+ (void)isc_condition_destroy(&manager->wakeup);
+#endif /* USE_TIMER_THREAD */
+ DESTROYLOCK(&manager->lock);
+ isc_heap_destroy(&manager->heap);
+ manager->common.impmagic = 0;
+ manager->common.magic = 0;
+ mctx = manager->mctx;
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ isc_mem_detach(&mctx);
+
+ *managerp = NULL;
+
+#ifdef USE_SHARED_MANAGER
+ timermgr = NULL;
+#endif
+}
+
+#ifndef USE_TIMER_THREAD
+isc_result_t
+isc__timermgr_nextevent(isc_timermgr_t *manager0, isc_time_t *when) {
+ isc__timermgr_t *manager = (isc__timermgr_t *)manager0;
+
+#ifdef USE_SHARED_MANAGER
+ if (manager == NULL)
+ manager = timermgr;
+#endif
+ if (manager == NULL || manager->nscheduled == 0)
+ return (ISC_R_NOTFOUND);
+ *when = manager->due;
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc__timermgr_dispatch(isc_timermgr_t *manager0) {
+ isc__timermgr_t *manager = (isc__timermgr_t *)manager0;
+ isc_time_t now;
+
+#ifdef USE_SHARED_MANAGER
+ if (manager == NULL)
+ manager = timermgr;
+#endif
+ if (manager == NULL)
+ return;
+ TIME_NOW(&now);
+ dispatch(manager, &now);
+}
+#endif /* USE_TIMER_THREAD */
+
+#ifdef USE_TIMERIMPREGISTER
+isc_result_t
+isc__timer_register() {
+ return (isc_timer_register(isc__timermgr_create));
+}
+#endif
diff --git a/lib/isc/timer_api.c b/lib/isc/timer_api.c
new file mode 100644
index 0000000..97e62b3
--- /dev/null
+++ b/lib/isc/timer_api.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: timer_api.c,v 1.4 2009/09/02 23:48:02 tbox Exp $ */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <isc/app.h>
+#include <isc/magic.h>
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/timer.h>
+#include <isc/util.h>
+
+static isc_mutex_t createlock;
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_timermgrcreatefunc_t timermgr_createfunc = NULL;
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_timer_register(isc_timermgrcreatefunc_t createfunc) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
+
+ LOCK(&createlock);
+ if (timermgr_createfunc == NULL)
+ timermgr_createfunc = createfunc;
+ else
+ result = ISC_R_EXISTS;
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+isc_result_t
+isc_timermgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
+ isc_timermgr_t **managerp)
+{
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(timermgr_createfunc != NULL);
+ result = (*timermgr_createfunc)(mctx, managerp);
+
+ UNLOCK(&createlock);
+
+ if (result == ISC_R_SUCCESS)
+ isc_appctx_settimermgr(actx, *managerp);
+
+ return (result);
+}
+
+isc_result_t
+isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
+ isc_result_t result;
+
+ LOCK(&createlock);
+
+ REQUIRE(timermgr_createfunc != NULL);
+ result = (*timermgr_createfunc)(mctx, managerp);
+
+ UNLOCK(&createlock);
+
+ return (result);
+}
+
+void
+isc_timermgr_destroy(isc_timermgr_t **managerp) {
+ REQUIRE(*managerp != NULL && ISCAPI_TIMERMGR_VALID(*managerp));
+
+ (*managerp)->methods->destroy(managerp);
+
+ ENSURE(*managerp == NULL);
+}
+
+isc_result_t
+isc_timer_create(isc_timermgr_t *manager, isc_timertype_t type,
+ isc_time_t *expires, isc_interval_t *interval,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_timer_t **timerp)
+{
+ REQUIRE(ISCAPI_TIMERMGR_VALID(manager));
+
+ return (manager->methods->timercreate(manager, type, expires,
+ interval, task, action, arg,
+ timerp));
+}
+
+void
+isc_timer_attach(isc_timer_t *timer, isc_timer_t **timerp) {
+ REQUIRE(ISCAPI_TIMER_VALID(timer));
+ REQUIRE(timerp != NULL && *timerp == NULL);
+
+ timer->methods->attach(timer, timerp);
+
+ ENSURE(*timerp == timer);
+}
+
+void
+isc_timer_detach(isc_timer_t **timerp) {
+ REQUIRE(timerp != NULL && ISCAPI_TIMER_VALID(*timerp));
+
+ (*timerp)->methods->detach(timerp);
+
+ ENSURE(*timerp == NULL);
+}
+
+isc_result_t
+isc_timer_reset(isc_timer_t *timer, isc_timertype_t type,
+ isc_time_t *expires, isc_interval_t *interval,
+ isc_boolean_t purge)
+{
+ REQUIRE(ISCAPI_TIMER_VALID(timer));
+
+ return (timer->methods->reset(timer, type, expires, interval, purge));
+}
+
+isc_result_t
+isc_timer_touch(isc_timer_t *timer) {
+ REQUIRE(ISCAPI_TIMER_VALID(timer));
+
+ return (timer->methods->touch(timer));
+}
diff --git a/lib/isc/timer_p.h b/lib/isc/timer_p.h
new file mode 100644
index 0000000..d6f7c99
--- /dev/null
+++ b/lib/isc/timer_p.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: timer_p.h,v 1.12 2009/09/02 23:48:02 tbox Exp $ */
+
+#ifndef ISC_TIMER_P_H
+#define ISC_TIMER_P_H
+
+/*! \file */
+
+isc_result_t
+isc__timermgr_nextevent(isc_timermgr_t *timermgr, isc_time_t *when);
+
+void
+isc__timermgr_dispatch(isc_timermgr_t *timermgr);
+
+#endif /* ISC_TIMER_P_H */
diff --git a/lib/isc/unix/app.c b/lib/isc/unix/app.c
new file mode 100644
index 0000000..5393be9
--- /dev/null
+++ b/lib/isc/unix/app.c
@@ -0,0 +1,946 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: app.c,v 1.64 2009/11/04 05:58:46 marka Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <sys/param.h> /* Openserver 5.0.6A and FD_SETSIZE */
+#include <sys/types.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+#include <sys/time.h>
+#ifdef HAVE_EPOLL
+#include <sys/epoll.h>
+#endif
+
+#include <isc/app.h>
+#include <isc/boolean.h>
+#include <isc/condition.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/mutex.h>
+#include <isc/event.h>
+#include <isc/platform.h>
+#include <isc/strerror.h>
+#include <isc/string.h>
+#include <isc/task.h>
+#include <isc/time.h>
+#include <isc/util.h>
+
+/*%
+ * For BIND9 internal applications built with threads, we use a single app
+ * context and let multiple worker, I/O, timer threads do actual jobs.
+ * For other cases (including BIND9 built without threads) an app context acts
+ * as an event loop dispatching various events.
+ */
+#if defined(ISC_PLATFORM_USETHREADS) && defined(BIND9)
+#define USE_THREADS_SINGLECTX
+#endif
+
+#ifdef ISC_PLATFORM_USETHREADS
+#include <pthread.h>
+#endif
+
+#ifndef USE_THREADS_SINGLECTX
+#include "../timer_p.h"
+#include "../task_p.h"
+#include "socket_p.h"
+#endif /* USE_THREADS_SINGLECTX */
+
+#ifdef ISC_PLATFORM_USETHREADS
+static pthread_t blockedthread;
+#endif /* ISC_PLATFORM_USETHREADS */
+
+/*%
+ * The following can be either static or public, depending on build environment.
+ */
+
+#ifdef BIND9
+#define ISC_APPFUNC_SCOPE
+#else
+#define ISC_APPFUNC_SCOPE static
+#endif
+
+ISC_APPFUNC_SCOPE isc_result_t isc__app_start(void);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxstart(isc_appctx_t *ctx);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_onrun(isc_mem_t *mctx,
+ isc_task_t *task,
+ isc_taskaction_t action,
+ void *arg);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxrun(isc_appctx_t *ctx);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_run(void);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxshutdown(isc_appctx_t *ctx);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_shutdown(void);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_reload(void);
+ISC_APPFUNC_SCOPE isc_result_t isc__app_ctxsuspend(isc_appctx_t *ctx);
+ISC_APPFUNC_SCOPE void isc__app_ctxfinish(isc_appctx_t *ctx);
+ISC_APPFUNC_SCOPE void isc__app_finish(void);
+ISC_APPFUNC_SCOPE void isc__app_block(void);
+ISC_APPFUNC_SCOPE void isc__app_unblock(void);
+ISC_APPFUNC_SCOPE isc_result_t isc__appctx_create(isc_mem_t *mctx,
+ isc_appctx_t **ctxp);
+ISC_APPFUNC_SCOPE void isc__appctx_destroy(isc_appctx_t **ctxp);
+ISC_APPFUNC_SCOPE void isc__appctx_settaskmgr(isc_appctx_t *ctx,
+ isc_taskmgr_t *taskmgr);
+ISC_APPFUNC_SCOPE void isc__appctx_setsocketmgr(isc_appctx_t *ctx,
+ isc_socketmgr_t *socketmgr);
+ISC_APPFUNC_SCOPE void isc__appctx_settimermgr(isc_appctx_t *ctx,
+ isc_timermgr_t *timermgr);
+
+/*
+ * The application context of this module. This implementation actually
+ * doesn't use it. (This may change in the future).
+ */
+#define APPCTX_MAGIC ISC_MAGIC('A', 'p', 'c', 'x')
+#define VALID_APPCTX(c) ISC_MAGIC_VALID(c, APPCTX_MAGIC)
+
+typedef struct isc__appctx {
+ isc_appctx_t common;
+ isc_mem_t *mctx;
+ isc_mutex_t lock;
+ isc_eventlist_t on_run;
+ isc_boolean_t shutdown_requested;
+ isc_boolean_t running;
+
+ /*!
+ * We assume that 'want_shutdown' can be read and written atomically.
+ */
+ isc_boolean_t want_shutdown;
+ /*
+ * We assume that 'want_reload' can be read and written atomically.
+ */
+ isc_boolean_t want_reload;
+
+ isc_boolean_t blocked;
+
+ isc_taskmgr_t *taskmgr;
+ isc_socketmgr_t *socketmgr;
+ isc_timermgr_t *timermgr;
+} isc__appctx_t;
+
+static isc__appctx_t isc_g_appctx;
+
+static struct {
+ isc_appmethods_t methods;
+
+ /*%
+ * The following are defined just for avoiding unused static functions.
+ */
+#ifndef BIND9
+ void *run, *shutdown, *start, *onrun, *reload, *finish,
+ *block, *unblock;
+#endif
+} appmethods = {
+ {
+ isc__appctx_destroy,
+ isc__app_ctxstart,
+ isc__app_ctxrun,
+ isc__app_ctxsuspend,
+ isc__app_ctxshutdown,
+ isc__app_ctxfinish,
+ isc__appctx_settaskmgr,
+ isc__appctx_setsocketmgr,
+ isc__appctx_settimermgr
+ }
+#ifndef BIND9
+ ,
+ (void *)isc__app_run, (void *)isc__app_shutdown,
+ (void *)isc__app_start, (void *)isc__app_onrun, (void *)isc__app_reload,
+ (void *)isc__app_finish, (void *)isc__app_block,
+ (void *)isc__app_unblock
+#endif
+};
+
+#ifdef HAVE_LINUXTHREADS
+/*!
+ * Linux has sigwait(), but it appears to prevent signal handlers from
+ * running, even if they're not in the set being waited for. This makes
+ * it impossible to get the default actions for SIGILL, SIGSEGV, etc.
+ * Instead of messing with it, we just use sigsuspend() instead.
+ */
+#undef HAVE_SIGWAIT
+/*!
+ * We need to remember which thread is the main thread...
+ */
+static pthread_t main_thread;
+#endif
+
+#ifndef HAVE_SIGWAIT
+static void
+exit_action(int arg) {
+ UNUSED(arg);
+ isc_g_appctx.want_shutdown = ISC_TRUE;
+}
+
+static void
+reload_action(int arg) {
+ UNUSED(arg);
+ isc_g_appctx.want_reload = ISC_TRUE;
+}
+#endif
+
+static isc_result_t
+handle_signal(int sig, void (*handler)(int)) {
+ struct sigaction sa;
+ char strbuf[ISC_STRERRORSIZE];
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = handler;
+
+ if (sigfillset(&sa.sa_mask) != 0 ||
+ sigaction(sig, &sa, NULL) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_APP,
+ ISC_MSG_SIGNALSETUP,
+ "handle_signal() %d setup: %s"),
+ sig, strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_ctxstart(isc_appctx_t *ctx0) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+ isc_result_t result;
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+ /*
+ * Start an ISC library application.
+ */
+
+#ifdef NEED_PTHREAD_INIT
+ /*
+ * BSDI 3.1 seg faults in pthread_sigmask() if we don't do this.
+ */
+ presult = pthread_init();
+ if (presult != 0) {
+ isc__strerror(presult, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_start() pthread_init: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+#endif
+
+#ifdef HAVE_LINUXTHREADS
+ main_thread = pthread_self();
+#endif
+
+ result = isc_mutex_init(&ctx->lock);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ ISC_LIST_INIT(ctx->on_run);
+
+ ctx->shutdown_requested = ISC_FALSE;
+ ctx->running = ISC_FALSE;
+ ctx->want_shutdown = ISC_FALSE;
+ ctx->want_reload = ISC_FALSE;
+ ctx->blocked = ISC_FALSE;
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_start(void) {
+ isc_result_t result;
+ int presult;
+ sigset_t sset;
+ char strbuf[ISC_STRERRORSIZE];
+
+ isc_g_appctx.common.impmagic = APPCTX_MAGIC;
+ isc_g_appctx.common.magic = ISCAPI_APPCTX_MAGIC;
+ isc_g_appctx.common.methods = &appmethods.methods;
+ isc_g_appctx.mctx = NULL;
+ /* The remaining members will be initialized in ctxstart() */
+
+ result = isc__app_ctxstart((isc_appctx_t *)&isc_g_appctx);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+#ifndef HAVE_SIGWAIT
+ /*
+ * Install do-nothing handlers for SIGINT and SIGTERM.
+ *
+ * We install them now because BSDI 3.1 won't block
+ * the default actions, regardless of what we do with
+ * pthread_sigmask().
+ */
+ result = handle_signal(SIGINT, exit_action);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ result = handle_signal(SIGTERM, exit_action);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+#endif
+
+ /*
+ * Always ignore SIGPIPE.
+ */
+ result = handle_signal(SIGPIPE, SIG_IGN);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /*
+ * On Solaris 2, delivery of a signal whose action is SIG_IGN
+ * will not cause sigwait() to return. We may have inherited
+ * unexpected actions for SIGHUP, SIGINT, and SIGTERM from our parent
+ * process (e.g, Solaris cron). Set an action of SIG_DFL to make
+ * sure sigwait() works as expected. Only do this for SIGTERM and
+ * SIGINT if we don't have sigwait(), since a different handler is
+ * installed above.
+ */
+ result = handle_signal(SIGHUP, SIG_DFL);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+#ifdef HAVE_SIGWAIT
+ result = handle_signal(SIGTERM, SIG_DFL);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ result = handle_signal(SIGINT, SIG_DFL);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+#endif
+
+#ifdef ISC_PLATFORM_USETHREADS
+ /*
+ * Block SIGHUP, SIGINT, SIGTERM.
+ *
+ * If isc_app_start() is called from the main thread before any other
+ * threads have been created, then the pthread_sigmask() call below
+ * will result in all threads having SIGHUP, SIGINT and SIGTERM
+ * blocked by default, ensuring that only the thread that calls
+ * sigwait() for them will get those signals.
+ */
+ if (sigemptyset(&sset) != 0 ||
+ sigaddset(&sset, SIGHUP) != 0 ||
+ sigaddset(&sset, SIGINT) != 0 ||
+ sigaddset(&sset, SIGTERM) != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_start() sigsetops: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ presult = pthread_sigmask(SIG_BLOCK, &sset, NULL);
+ if (presult != 0) {
+ isc__strerror(presult, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_start() pthread_sigmask: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+#else /* ISC_PLATFORM_USETHREADS */
+ /*
+ * Unblock SIGHUP, SIGINT, SIGTERM.
+ *
+ * If we're not using threads, we need to make sure that SIGHUP,
+ * SIGINT and SIGTERM are not inherited as blocked from the parent
+ * process.
+ */
+ if (sigemptyset(&sset) != 0 ||
+ sigaddset(&sset, SIGHUP) != 0 ||
+ sigaddset(&sset, SIGINT) != 0 ||
+ sigaddset(&sset, SIGTERM) != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_start() sigsetops: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ presult = sigprocmask(SIG_UNBLOCK, &sset, NULL);
+ if (presult != 0) {
+ isc__strerror(presult, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_start() sigprocmask: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+#endif /* ISC_PLATFORM_USETHREADS */
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action,
+ void *arg)
+{
+ isc_event_t *event;
+ isc_task_t *cloned_task = NULL;
+ isc_result_t result;
+
+ LOCK(&isc_g_appctx.lock);
+
+ if (isc_g_appctx.running) {
+ result = ISC_R_ALREADYRUNNING;
+ goto unlock;
+ }
+
+ /*
+ * Note that we store the task to which we're going to send the event
+ * in the event's "sender" field.
+ */
+ isc_task_attach(task, &cloned_task);
+ event = isc_event_allocate(mctx, cloned_task, ISC_APPEVENT_SHUTDOWN,
+ action, arg, sizeof(*event));
+ if (event == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto unlock;
+ }
+
+ ISC_LIST_APPEND(isc_g_appctx.on_run, event, ev_link);
+
+ result = ISC_R_SUCCESS;
+
+ unlock:
+ UNLOCK(&isc_g_appctx.lock);
+
+ return (result);
+}
+
+#ifndef USE_THREADS_SINGLECTX
+/*!
+ * Event loop for nonthreaded programs.
+ */
+static isc_result_t
+evloop(isc__appctx_t *ctx) {
+ isc_result_t result;
+
+ while (!ctx->want_shutdown) {
+ int n;
+ isc_time_t when, now;
+ struct timeval tv, *tvp;
+ isc_socketwait_t *swait;
+ isc_boolean_t readytasks;
+ isc_boolean_t call_timer_dispatch = ISC_FALSE;
+
+ /*
+ * Check the reload (or suspend) case first for exiting the
+ * loop as fast as possible in case:
+ * - the direct call to isc__taskmgr_dispatch() in
+ * isc__app_ctxrun() completes all the tasks so far,
+ * - there is thus currently no active task, and
+ * - there is a timer event
+ */
+ if (ctx->want_reload) {
+ ctx->want_reload = ISC_FALSE;
+ return (ISC_R_RELOAD);
+ }
+
+ readytasks = isc__taskmgr_ready(ctx->taskmgr);
+ if (readytasks) {
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ tvp = &tv;
+ call_timer_dispatch = ISC_TRUE;
+ } else {
+ result = isc__timermgr_nextevent(ctx->timermgr, &when);
+ if (result != ISC_R_SUCCESS)
+ tvp = NULL;
+ else {
+ isc_uint64_t us;
+
+ TIME_NOW(&now);
+ us = isc_time_microdiff(&when, &now);
+ if (us == 0)
+ call_timer_dispatch = ISC_TRUE;
+ tv.tv_sec = us / 1000000;
+ tv.tv_usec = us % 1000000;
+ tvp = &tv;
+ }
+ }
+
+ swait = NULL;
+ n = isc__socketmgr_waitevents(ctx->socketmgr, tvp, &swait);
+
+ if (n == 0 || call_timer_dispatch) {
+ /*
+ * We call isc__timermgr_dispatch() only when
+ * necessary, in order to reduce overhead. If the
+ * select() call indicates a timeout, we need the
+ * dispatch. Even if not, if we set the 0-timeout
+ * for the select() call, we need to check the timer
+ * events. In the 'readytasks' case, there may be no
+ * timeout event actually, but there is no other way
+ * to reduce the overhead.
+ * Note that we do not have to worry about the case
+ * where a new timer is inserted during the select()
+ * call, since this loop only runs in the non-thread
+ * mode.
+ */
+ isc__timermgr_dispatch(ctx->timermgr);
+ }
+ if (n > 0)
+ (void)isc__socketmgr_dispatch(ctx->socketmgr, swait);
+ (void)isc__taskmgr_dispatch(ctx->taskmgr);
+ }
+ return (ISC_R_SUCCESS);
+}
+#endif /* USE_THREADS_SINGLECTX */
+
+#ifndef ISC_PLATFORM_USETHREADS
+/*
+ * This is a gross hack to support waiting for condition
+ * variables in nonthreaded programs in a limited way;
+ * see lib/isc/nothreads/include/isc/condition.h.
+ * We implement isc_condition_wait() by entering the
+ * event loop recursively until the want_shutdown flag
+ * is set by isc_condition_signal().
+ */
+
+/*!
+ * \brief True if we are currently executing in the recursive
+ * event loop.
+ */
+static isc_boolean_t in_recursive_evloop = ISC_FALSE;
+
+/*!
+ * \brief True if we are exiting the event loop as the result of
+ * a call to isc_condition_signal() rather than a shutdown
+ * or reload.
+ */
+static isc_boolean_t signalled = ISC_FALSE;
+
+isc_result_t
+isc__nothread_wait_hack(isc_condition_t *cp, isc_mutex_t *mp) {
+ isc_result_t result;
+
+ UNUSED(cp);
+ UNUSED(mp);
+
+ INSIST(!in_recursive_evloop);
+ in_recursive_evloop = ISC_TRUE;
+
+ INSIST(*mp == 1); /* Mutex must be locked on entry. */
+ --*mp;
+
+ result = evloop(&isc_g_appctx);
+ if (result == ISC_R_RELOAD)
+ isc_g_appctx.want_reload = ISC_TRUE;
+ if (signalled) {
+ isc_g_appctx.want_shutdown = ISC_FALSE;
+ signalled = ISC_FALSE;
+ }
+
+ ++*mp;
+ in_recursive_evloop = ISC_FALSE;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__nothread_signal_hack(isc_condition_t *cp) {
+
+ UNUSED(cp);
+
+ INSIST(in_recursive_evloop);
+
+ isc_g_appctx.want_shutdown = ISC_TRUE;
+ signalled = ISC_TRUE;
+ return (ISC_R_SUCCESS);
+}
+
+#endif /* ISC_PLATFORM_USETHREADS */
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_ctxrun(isc_appctx_t *ctx0) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+ int result;
+ isc_event_t *event, *next_event;
+ isc_task_t *task;
+#ifdef USE_THREADS_SINGLECTX
+ sigset_t sset;
+ char strbuf[ISC_STRERRORSIZE];
+#ifdef HAVE_SIGWAIT
+ int sig;
+#endif
+#endif /* USE_THREADS_SINGLECTX */
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+#ifdef HAVE_LINUXTHREADS
+ REQUIRE(main_thread == pthread_self());
+#endif
+
+ LOCK(&ctx->lock);
+
+ if (!ctx->running) {
+ ctx->running = ISC_TRUE;
+
+ /*
+ * Post any on-run events (in FIFO order).
+ */
+ for (event = ISC_LIST_HEAD(ctx->on_run);
+ event != NULL;
+ event = next_event) {
+ next_event = ISC_LIST_NEXT(event, ev_link);
+ ISC_LIST_UNLINK(ctx->on_run, event, ev_link);
+ task = event->ev_sender;
+ event->ev_sender = NULL;
+ isc_task_sendanddetach(&task, &event);
+ }
+
+ }
+
+ UNLOCK(&ctx->lock);
+
+#ifndef HAVE_SIGWAIT
+ /*
+ * Catch SIGHUP.
+ *
+ * We do this here to ensure that the signal handler is installed
+ * (i.e. that it wasn't a "one-shot" handler).
+ */
+ if (ctx == &isc_g_appctx) {
+ result = handle_signal(SIGHUP, reload_action);
+ if (result != ISC_R_SUCCESS)
+ return (ISC_R_SUCCESS);
+ }
+#endif
+
+#ifdef USE_THREADS_SINGLECTX
+ /*
+ * When we are using multiple contexts, we don't rely on signals.
+ */
+ if (ctx != &isc_g_appctx)
+ return (ISC_R_SUCCESS);
+
+ /*
+ * There is no danger if isc_app_shutdown() is called before we wait
+ * for signals. Signals are blocked, so any such signal will simply
+ * be made pending and we will get it when we call sigwait().
+ */
+
+ while (!ctx->want_shutdown) {
+#ifdef HAVE_SIGWAIT
+ /*
+ * Wait for SIGHUP, SIGINT, or SIGTERM.
+ */
+ if (sigemptyset(&sset) != 0 ||
+ sigaddset(&sset, SIGHUP) != 0 ||
+ sigaddset(&sset, SIGINT) != 0 ||
+ sigaddset(&sset, SIGTERM) != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_run() sigsetops: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+
+#ifndef HAVE_UNIXWARE_SIGWAIT
+ result = sigwait(&sset, &sig);
+ if (result == 0) {
+ if (sig == SIGINT || sig == SIGTERM)
+ ctx->want_shutdown = ISC_TRUE;
+ else if (sig == SIGHUP)
+ ctx->want_reload = ISC_TRUE;
+ }
+
+#else /* Using UnixWare sigwait semantics. */
+ sig = sigwait(&sset);
+ if (sig >= 0) {
+ if (sig == SIGINT || sig == SIGTERM)
+ ctx->want_shutdown = ISC_TRUE;
+ else if (sig == SIGHUP)
+ ctx->want_reload = ISC_TRUE;
+ }
+
+#endif /* HAVE_UNIXWARE_SIGWAIT */
+#else /* Don't have sigwait(). */
+ /*
+ * Listen for all signals.
+ */
+ if (sigemptyset(&sset) != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_run() sigsetops: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ result = sigsuspend(&sset);
+#endif /* HAVE_SIGWAIT */
+
+ if (ctx->want_reload) {
+ ctx->want_reload = ISC_FALSE;
+ return (ISC_R_RELOAD);
+ }
+
+ if (ctx->want_shutdown && ctx->blocked)
+ exit(1);
+ }
+
+#else /* USE_THREADS_SINGLECTX */
+
+ (void)isc__taskmgr_dispatch(ctx->taskmgr);
+
+ result = evloop(ctx);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+#endif /* USE_THREADS_SINGLECTX */
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_run() {
+ return (isc__app_ctxrun((isc_appctx_t *)&isc_g_appctx));
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_ctxshutdown(isc_appctx_t *ctx0) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+ isc_boolean_t want_kill = ISC_TRUE;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+ LOCK(&ctx->lock);
+
+ REQUIRE(ctx->running);
+
+ if (ctx->shutdown_requested)
+ want_kill = ISC_FALSE;
+ else
+ ctx->shutdown_requested = ISC_TRUE;
+
+ UNLOCK(&ctx->lock);
+
+ if (want_kill) {
+ if (ctx != &isc_g_appctx)
+ ctx->want_shutdown = ISC_TRUE;
+ else {
+#ifdef HAVE_LINUXTHREADS
+ int result;
+
+ result = pthread_kill(main_thread, SIGTERM);
+ if (result != 0) {
+ isc__strerror(result, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_shutdown() "
+ "pthread_kill: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+#else
+ if (kill(getpid(), SIGTERM) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_shutdown() "
+ "kill: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+#endif /* HAVE_LINUXTHREADS */
+ }
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_shutdown() {
+ return (isc__app_ctxshutdown((isc_appctx_t *)&isc_g_appctx));
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_ctxsuspend(isc_appctx_t *ctx0) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+ isc_boolean_t want_kill = ISC_TRUE;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+ LOCK(&ctx->lock);
+
+ REQUIRE(ctx->running);
+
+ /*
+ * Don't send the reload signal if we're shutting down.
+ */
+ if (ctx->shutdown_requested)
+ want_kill = ISC_FALSE;
+
+ UNLOCK(&ctx->lock);
+
+ if (want_kill) {
+ if (ctx != &isc_g_appctx)
+ ctx->want_reload = ISC_TRUE;
+ else {
+#ifdef HAVE_LINUXTHREADS
+ int result;
+
+ result = pthread_kill(main_thread, SIGHUP);
+ if (result != 0) {
+ isc__strerror(result, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_reload() "
+ "pthread_kill: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+#else
+ if (kill(getpid(), SIGHUP) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_app_reload() "
+ "kill: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+#endif
+ }
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__app_reload(void) {
+ return (isc__app_ctxsuspend((isc_appctx_t *)&isc_g_appctx));
+}
+
+ISC_APPFUNC_SCOPE void
+isc__app_ctxfinish(isc_appctx_t *ctx0) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+ DESTROYLOCK(&ctx->lock);
+}
+
+ISC_APPFUNC_SCOPE void
+isc__app_finish(void) {
+ isc__app_ctxfinish((isc_appctx_t *)&isc_g_appctx);
+}
+
+ISC_APPFUNC_SCOPE void
+isc__app_block(void) {
+#ifdef ISC_PLATFORM_USETHREADS
+ sigset_t sset;
+#endif /* ISC_PLATFORM_USETHREADS */
+ REQUIRE(isc_g_appctx.running);
+ REQUIRE(!isc_g_appctx.blocked);
+
+ isc_g_appctx.blocked = ISC_TRUE;
+#ifdef ISC_PLATFORM_USETHREADS
+ blockedthread = pthread_self();
+ RUNTIME_CHECK(sigemptyset(&sset) == 0 &&
+ sigaddset(&sset, SIGINT) == 0 &&
+ sigaddset(&sset, SIGTERM) == 0);
+ RUNTIME_CHECK(pthread_sigmask(SIG_UNBLOCK, &sset, NULL) == 0);
+#endif /* ISC_PLATFORM_USETHREADS */
+}
+
+ISC_APPFUNC_SCOPE void
+isc__app_unblock(void) {
+#ifdef ISC_PLATFORM_USETHREADS
+ sigset_t sset;
+#endif /* ISC_PLATFORM_USETHREADS */
+
+ REQUIRE(isc_g_appctx.running);
+ REQUIRE(isc_g_appctx.blocked);
+
+ isc_g_appctx.blocked = ISC_FALSE;
+
+#ifdef ISC_PLATFORM_USETHREADS
+ REQUIRE(blockedthread == pthread_self());
+
+ RUNTIME_CHECK(sigemptyset(&sset) == 0 &&
+ sigaddset(&sset, SIGINT) == 0 &&
+ sigaddset(&sset, SIGTERM) == 0);
+ RUNTIME_CHECK(pthread_sigmask(SIG_BLOCK, &sset, NULL) == 0);
+#endif /* ISC_PLATFORM_USETHREADS */
+}
+
+ISC_APPFUNC_SCOPE isc_result_t
+isc__appctx_create(isc_mem_t *mctx, isc_appctx_t **ctxp) {
+ isc__appctx_t *ctx;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(ctxp != NULL && *ctxp == NULL);
+
+ ctx = isc_mem_get(mctx, sizeof(*ctx));
+ if (ctx == NULL)
+ return (ISC_R_NOMEMORY);
+
+ ctx->common.impmagic = APPCTX_MAGIC;
+ ctx->common.magic = ISCAPI_APPCTX_MAGIC;
+ ctx->common.methods = &appmethods.methods;
+
+ ctx->mctx = NULL;
+ isc_mem_attach(mctx, &ctx->mctx);
+
+ ctx->taskmgr = NULL;
+ ctx->socketmgr = NULL;
+ ctx->timermgr = NULL;
+
+ *ctxp = (isc_appctx_t *)ctx;
+
+ return (ISC_R_SUCCESS);
+}
+
+ISC_APPFUNC_SCOPE void
+isc__appctx_destroy(isc_appctx_t **ctxp) {
+ isc__appctx_t *ctx;
+
+ REQUIRE(ctxp != NULL);
+ ctx = (isc__appctx_t *)*ctxp;
+ REQUIRE(VALID_APPCTX(ctx));
+
+ isc_mem_putanddetach(&ctx->mctx, ctx, sizeof(*ctx));
+
+ *ctxp = NULL;
+}
+
+ISC_APPFUNC_SCOPE void
+isc__appctx_settaskmgr(isc_appctx_t *ctx0, isc_taskmgr_t *taskmgr) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+ ctx->taskmgr = taskmgr;
+}
+
+ISC_APPFUNC_SCOPE void
+isc__appctx_setsocketmgr(isc_appctx_t *ctx0, isc_socketmgr_t *socketmgr) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+ ctx->socketmgr = socketmgr;
+}
+
+ISC_APPFUNC_SCOPE void
+isc__appctx_settimermgr(isc_appctx_t *ctx0, isc_timermgr_t *timermgr) {
+ isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
+
+ REQUIRE(VALID_APPCTX(ctx));
+
+ ctx->timermgr = timermgr;
+}
+
+#ifdef USE_APPIMPREGISTER
+isc_result_t
+isc__app_register() {
+ return (isc_app_register(isc__appctx_create));
+}
+#endif
diff --git a/lib/isc/unix/dir.c b/lib/isc/unix/dir.c
new file mode 100644
index 0000000..613ee56
--- /dev/null
+++ b/lib/isc/unix/dir.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file
+ * \author Principal Authors: DCL */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <isc/dir.h>
+#include <isc/magic.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+#include "errno2result.h"
+#include "ntp_stdlib.h" /* NTP change for strlcpy, strlcat */
+
+#define ISC_DIR_MAGIC ISC_MAGIC('D', 'I', 'R', '*')
+#define VALID_DIR(dir) ISC_MAGIC_VALID(dir, ISC_DIR_MAGIC)
+
+void
+isc_dir_init(isc_dir_t *dir) {
+ REQUIRE(dir != NULL);
+
+ dir->entry.name[0] = '\0';
+ dir->entry.length = 0;
+
+ dir->handle = NULL;
+
+ dir->magic = ISC_DIR_MAGIC;
+}
+
+/*!
+ * \brief Allocate workspace and open directory stream. If either one fails,
+ * NULL will be returned.
+ */
+isc_result_t
+isc_dir_open(isc_dir_t *dir, const char *dirname) {
+ char *p;
+ size_t octets;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(VALID_DIR(dir));
+ REQUIRE(dirname != NULL);
+
+ /*
+ * Copy directory name. Need to have enough space for the name,
+ * a possible path separator, the wildcard, and the final NUL.
+ */
+ octets = strlen(dirname) + 1;
+ if (octets + 2 > sizeof(dir->dirname))
+ /* XXXDCL ? */
+ return (ISC_R_NOSPACE);
+ strlcpy(dir->dirname, dirname, octets);
+
+ /*
+ * Append path separator, if needed, and "*".
+ */
+ p = dir->dirname + strlen(dir->dirname);
+ if (dir->dirname < p && *(p - 1) != '/')
+ *p++ = '/';
+ *p++ = '*';
+ *p = '\0';
+
+ /*
+ * Open stream.
+ */
+ dir->handle = opendir(dirname);
+
+ if (dir->handle == NULL)
+ return isc__errno2result(errno);
+
+ return (result);
+}
+
+/*!
+ * \brief Return previously retrieved file or get next one.
+
+ * Unix's dirent has
+ * separate open and read functions, but the Win32 and DOS interfaces open
+ * the dir stream and reads the first file in one operation.
+ */
+isc_result_t
+isc_dir_read(isc_dir_t *dir) {
+ struct dirent *entry;
+ size_t octets;
+
+ REQUIRE(VALID_DIR(dir) && dir->handle != NULL);
+
+ /*
+ * Fetch next file in directory.
+ */
+ entry = readdir(dir->handle);
+
+ if (entry == NULL)
+ return (ISC_R_NOMORE);
+
+ /*
+ * Make sure that the space for the name is long enough.
+ */
+ octets = strlen(entry->d_name) + 1;
+ if (sizeof(dir->entry.name) < octets)
+ return (ISC_R_UNEXPECTED);
+
+ strlcpy(dir->entry.name, entry->d_name, octets);
+
+ /*
+ * Some dirents have d_namlen, but it is not portable.
+ */
+ dir->entry.length = strlen(entry->d_name);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*!
+ * \brief Close directory stream.
+ */
+void
+isc_dir_close(isc_dir_t *dir) {
+ REQUIRE(VALID_DIR(dir) && dir->handle != NULL);
+
+ (void)closedir(dir->handle);
+ dir->handle = NULL;
+}
+
+/*!
+ * \brief Reposition directory stream at start.
+ */
+isc_result_t
+isc_dir_reset(isc_dir_t *dir) {
+ REQUIRE(VALID_DIR(dir) && dir->handle != NULL);
+
+ rewinddir(dir->handle);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_dir_chdir(const char *dirname) {
+ /*!
+ * \brief Change the current directory to 'dirname'.
+ */
+
+ REQUIRE(dirname != NULL);
+
+ if (chdir(dirname) < 0)
+ return (isc__errno2result(errno));
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_dir_chroot(const char *dirname) {
+
+ REQUIRE(dirname != NULL);
+
+#ifdef HAVE_CHROOT
+ if (chroot(dirname) < 0 || chdir("/") < 0)
+ return (isc__errno2result(errno));
+
+ return (ISC_R_SUCCESS);
+#else
+ return (ISC_R_NOTIMPLEMENTED);
+#endif
+}
+
+isc_result_t
+isc_dir_createunique(char *templet) {
+ isc_result_t result;
+ char *x;
+ char *p;
+ int i;
+ int pid;
+
+ REQUIRE(templet != NULL);
+
+ /*!
+ * \brief mkdtemp is not portable, so this emulates it.
+ */
+
+ pid = getpid();
+
+ /*
+ * Replace trailing Xs with the process-id, zero-filled.
+ */
+ for (x = templet + strlen(templet) - 1; *x == 'X' && x >= templet;
+ x--, pid /= 10)
+ *x = pid % 10 + '0';
+
+ x++; /* Set x to start of ex-Xs. */
+
+ do {
+ i = mkdir(templet, 0700);
+ if (i == 0 || errno != EEXIST)
+ break;
+
+ /*
+ * The BSD algorithm.
+ */
+ p = x;
+ while (*p != '\0') {
+ if (isdigit(*p & 0xff))
+ *p = 'a';
+ else if (*p != 'z')
+ ++*p;
+ else {
+ /*
+ * Reset character and move to next.
+ */
+ *p++ = 'a';
+ continue;
+ }
+
+ break;
+ }
+
+ if (*p == '\0') {
+ /*
+ * Tried all combinations. errno should already
+ * be EEXIST, but ensure it is anyway for
+ * isc__errno2result().
+ */
+ errno = EEXIST;
+ break;
+ }
+ } while (1);
+
+ if (i == -1)
+ result = isc__errno2result(errno);
+ else
+ result = ISC_R_SUCCESS;
+
+ return (result);
+}
diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c
new file mode 100644
index 0000000..ab53faf
--- /dev/null
+++ b/lib/isc/unix/entropy.c
@@ -0,0 +1,605 @@
+/*
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: entropy.c,v 1.82 2008/12/01 23:47:45 tbox Exp $ */
+
+/* \file unix/entropy.c
+ * \brief
+ * This is the system dependent part of the ISC entropy API.
+ */
+
+#include <config.h>
+
+#include <sys/param.h> /* Openserver 5.0.6A and FD_SETSIZE */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#ifdef HAVE_NANOSLEEP
+#include <time.h>
+#endif
+#include <unistd.h>
+
+#include <isc/platform.h>
+#include <isc/strerror.h>
+
+#ifdef ISC_PLATFORM_NEEDSYSSELECTH
+#include <sys/select.h>
+#endif
+
+#include "errno2result.h"
+
+/*%
+ * There is only one variable in the entropy data structures that is not
+ * system independent, but pulling the structure that uses it into this file
+ * ultimately means pulling several other independent structures here also to
+ * resolve their interdependencies. Thus only the problem variable's type
+ * is defined here.
+ */
+#define FILESOURCE_HANDLE_TYPE int
+
+typedef struct {
+ int handle;
+ enum {
+ isc_usocketsource_disconnected,
+ isc_usocketsource_connecting,
+ isc_usocketsource_connected,
+ isc_usocketsource_ndesired,
+ isc_usocketsource_wrote,
+ isc_usocketsource_reading
+ } status;
+ size_t sz_to_recv;
+} isc_entropyusocketsource_t;
+
+#include "../entropy.c"
+
+static unsigned int
+get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) {
+ isc_entropy_t *ent = source->ent;
+ unsigned char buf[128];
+ int fd = source->sources.file.handle;
+ ssize_t n, ndesired;
+ unsigned int added;
+
+ if (source->bad)
+ return (0);
+
+ desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0);
+
+ added = 0;
+ while (desired > 0) {
+ ndesired = ISC_MIN(desired, sizeof(buf));
+ n = read(fd, buf, ndesired);
+ if (n < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ goto out;
+ goto err;
+ }
+ if (n == 0)
+ goto err;
+
+ entropypool_adddata(ent, buf, n, n * 8);
+ added += n * 8;
+ desired -= n;
+ }
+ goto out;
+
+ err:
+ (void)close(fd);
+ source->sources.file.handle = -1;
+ source->bad = ISC_TRUE;
+
+ out:
+ return (added);
+}
+
+static unsigned int
+get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
+ isc_entropy_t *ent = source->ent;
+ unsigned char buf[128];
+ int fd = source->sources.usocket.handle;
+ ssize_t n = 0, ndesired;
+ unsigned int added;
+ size_t sz_to_recv = source->sources.usocket.sz_to_recv;
+
+ if (source->bad)
+ return (0);
+
+ desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0);
+
+ added = 0;
+ while (desired > 0) {
+ ndesired = ISC_MIN(desired, sizeof(buf));
+ eagain_loop:
+
+ switch ( source->sources.usocket.status ) {
+ case isc_usocketsource_ndesired:
+ buf[0] = ndesired;
+ if ((n = sendto(fd, buf, 1, 0, NULL, 0)) < 0) {
+ if (errno == EWOULDBLOCK || errno == EINTR ||
+ errno == ECONNRESET)
+ goto out;
+ goto err;
+ }
+ INSIST(n == 1);
+ source->sources.usocket.status =
+ isc_usocketsource_wrote;
+ goto eagain_loop;
+
+ case isc_usocketsource_connecting:
+ case isc_usocketsource_connected:
+ buf[0] = 1;
+ buf[1] = ndesired;
+ if ((n = sendto(fd, buf, 2, 0, NULL, 0)) < 0) {
+ if (errno == EWOULDBLOCK || errno == EINTR ||
+ errno == ECONNRESET)
+ goto out;
+ goto err;
+ }
+ if (n == 1) {
+ source->sources.usocket.status =
+ isc_usocketsource_ndesired;
+ goto eagain_loop;
+ }
+ INSIST(n == 2);
+ source->sources.usocket.status =
+ isc_usocketsource_wrote;
+ /*FALLTHROUGH*/
+
+ case isc_usocketsource_wrote:
+ if (recvfrom(fd, buf, 1, 0, NULL, NULL) != 1) {
+ if (errno == EAGAIN) {
+ /*
+ * The problem of EAGAIN (try again
+ * later) is a major issue on HP-UX.
+ * Solaris actually tries the recvfrom
+ * call again, while HP-UX just dies.
+ * This code is an attempt to let the
+ * entropy pool fill back up (at least
+ * that's what I think the problem is.)
+ * We go to eagain_loop because if we
+ * just "break", then the "desired"
+ * amount gets borked.
+ */
+#ifdef HAVE_NANOSLEEP
+ struct timespec ts;
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 1000000;
+ nanosleep(&ts, NULL);
+#else
+ usleep(1000);
+#endif
+ goto eagain_loop;
+ }
+ if (errno == EWOULDBLOCK || errno == EINTR)
+ goto out;
+ goto err;
+ }
+ source->sources.usocket.status =
+ isc_usocketsource_reading;
+ sz_to_recv = buf[0];
+ source->sources.usocket.sz_to_recv = sz_to_recv;
+ if (sz_to_recv > sizeof(buf))
+ goto err;
+ /*FALLTHROUGH*/
+
+ case isc_usocketsource_reading:
+ if (sz_to_recv != 0U) {
+ n = recv(fd, buf, sz_to_recv, 0);
+ if (n < 0) {
+ if (errno == EWOULDBLOCK ||
+ errno == EINTR)
+ goto out;
+ goto err;
+ }
+ } else
+ n = 0;
+ break;
+
+ default:
+ goto err;
+ }
+
+ if ((size_t)n != sz_to_recv)
+ source->sources.usocket.sz_to_recv -= n;
+ else
+ source->sources.usocket.status =
+ isc_usocketsource_connected;
+
+ if (n == 0)
+ goto out;
+
+ entropypool_adddata(ent, buf, n, n * 8);
+ added += n * 8;
+ desired -= n;
+ }
+ goto out;
+
+ err:
+ close(fd);
+ source->bad = ISC_TRUE;
+ source->sources.usocket.status = isc_usocketsource_disconnected;
+ source->sources.usocket.handle = -1;
+
+ out:
+ return (added);
+}
+
+/*
+ * Poll each source, trying to get data from it to stuff into the entropy
+ * pool.
+ */
+static void
+fillpool(isc_entropy_t *ent, unsigned int desired, isc_boolean_t blocking) {
+ unsigned int added;
+ unsigned int remaining;
+ unsigned int needed;
+ unsigned int nsource;
+ isc_entropysource_t *source;
+
+ REQUIRE(VALID_ENTROPY(ent));
+
+ needed = desired;
+
+ /*
+ * This logic is a little strange, so an explanation is in order.
+ *
+ * If needed is 0, it means we are being asked to "fill to whatever
+ * we think is best." This means that if we have at least a
+ * partially full pool (say, > 1/4th of the pool) we probably don't
+ * need to add anything.
+ *
+ * Also, we will check to see if the "pseudo" count is too high.
+ * If it is, try to mix in better data. Too high is currently
+ * defined as 1/4th of the pool.
+ *
+ * Next, if we are asked to add a specific bit of entropy, make
+ * certain that we will do so. Clamp how much we try to add to
+ * (DIGEST_SIZE * 8 < needed < POOLBITS - entropy).
+ *
+ * Note that if we are in a blocking mode, we will only try to
+ * get as much data as we need, not as much as we might want
+ * to build up.
+ */
+ if (needed == 0) {
+ REQUIRE(!blocking);
+
+ if ((ent->pool.entropy >= RND_POOLBITS / 4)
+ && (ent->pool.pseudo <= RND_POOLBITS / 4))
+ return;
+
+ needed = THRESHOLD_BITS * 4;
+ } else {
+ needed = ISC_MAX(needed, THRESHOLD_BITS);
+ needed = ISC_MIN(needed, RND_POOLBITS);
+ }
+
+ /*
+ * In any case, clamp how much we need to how much we can add.
+ */
+ needed = ISC_MIN(needed, RND_POOLBITS - ent->pool.entropy);
+
+ /*
+ * But wait! If we're not yet initialized, we need at least
+ * THRESHOLD_BITS
+ * of randomness.
+ */
+ if (ent->initialized < THRESHOLD_BITS)
+ needed = ISC_MAX(needed, THRESHOLD_BITS - ent->initialized);
+
+ /*
+ * Poll each file source to see if we can read anything useful from
+ * it. XXXMLG When where are multiple sources, we should keep a
+ * record of which one we last used so we can start from it (or the
+ * next one) to avoid letting some sources build up entropy while
+ * others are always drained.
+ */
+
+ added = 0;
+ remaining = needed;
+ if (ent->nextsource == NULL) {
+ ent->nextsource = ISC_LIST_HEAD(ent->sources);
+ if (ent->nextsource == NULL)
+ return;
+ }
+ source = ent->nextsource;
+ again_file:
+ for (nsource = 0; nsource < ent->nsources; nsource++) {
+ unsigned int got;
+
+ if (remaining == 0)
+ break;
+
+ got = 0;
+
+ switch ( source->type ) {
+ case ENTROPY_SOURCETYPE_FILE:
+ got = get_from_filesource(source, remaining);
+ break;
+
+ case ENTROPY_SOURCETYPE_USOCKET:
+ got = get_from_usocketsource(source, remaining);
+ break;
+ }
+
+ added += got;
+
+ remaining -= ISC_MIN(remaining, got);
+
+ source = ISC_LIST_NEXT(source, link);
+ if (source == NULL)
+ source = ISC_LIST_HEAD(ent->sources);
+ }
+ ent->nextsource = source;
+
+ if (blocking && remaining != 0) {
+ int fds;
+
+ fds = wait_for_sources(ent);
+ if (fds > 0)
+ goto again_file;
+ }
+
+ /*
+ * Here, if there are bits remaining to be had and we can block,
+ * check to see if we have a callback source. If so, call them.
+ */
+ source = ISC_LIST_HEAD(ent->sources);
+ while ((remaining != 0) && (source != NULL)) {
+ unsigned int got;
+
+ got = 0;
+
+ if (source->type == ENTROPY_SOURCETYPE_CALLBACK)
+ got = get_from_callback(source, remaining, blocking);
+
+ added += got;
+ remaining -= ISC_MIN(remaining, got);
+
+ if (added >= needed)
+ break;
+
+ source = ISC_LIST_NEXT(source, link);
+ }
+
+ /*
+ * Mark as initialized if we've added enough data.
+ */
+ if (ent->initialized < THRESHOLD_BITS)
+ ent->initialized += added;
+}
+
+static int
+wait_for_sources(isc_entropy_t *ent) {
+ isc_entropysource_t *source;
+ int maxfd, fd;
+ int cc;
+ fd_set reads;
+ fd_set writes;
+
+ maxfd = -1;
+ FD_ZERO(&reads);
+ FD_ZERO(&writes);
+
+ source = ISC_LIST_HEAD(ent->sources);
+ while (source != NULL) {
+ if (source->type == ENTROPY_SOURCETYPE_FILE) {
+ fd = source->sources.file.handle;
+ if (fd >= 0) {
+ maxfd = ISC_MAX(maxfd, fd);
+ FD_SET(fd, &reads);
+ }
+ }
+ if (source->type == ENTROPY_SOURCETYPE_USOCKET) {
+ fd = source->sources.usocket.handle;
+ if (fd >= 0) {
+ switch (source->sources.usocket.status) {
+ case isc_usocketsource_disconnected:
+ break;
+ case isc_usocketsource_connecting:
+ case isc_usocketsource_connected:
+ case isc_usocketsource_ndesired:
+ maxfd = ISC_MAX(maxfd, fd);
+ FD_SET(fd, &writes);
+ break;
+ case isc_usocketsource_wrote:
+ case isc_usocketsource_reading:
+ maxfd = ISC_MAX(maxfd, fd);
+ FD_SET(fd, &reads);
+ break;
+ }
+ }
+ }
+ source = ISC_LIST_NEXT(source, link);
+ }
+
+ if (maxfd < 0)
+ return (-1);
+
+ cc = select(maxfd + 1, &reads, &writes, NULL, NULL);
+ if (cc < 0)
+ return (-1);
+
+ return (cc);
+}
+
+static void
+destroyfilesource(isc_entropyfilesource_t *source) {
+ (void)close(source->handle);
+}
+
+static void
+destroyusocketsource(isc_entropyusocketsource_t *source) {
+ close(source->handle);
+}
+
+/*
+ * Make a fd non-blocking
+ */
+static isc_result_t
+make_nonblock(int fd) {
+ int ret;
+ int flags;
+ char strbuf[ISC_STRERRORSIZE];
+#ifdef USE_FIONBIO_IOCTL
+ int on = 1;
+
+ ret = ioctl(fd, FIONBIO, (char *)&on);
+#else
+ flags = fcntl(fd, F_GETFL, 0);
+ flags |= PORT_NONBLOCK;
+ ret = fcntl(fd, F_SETFL, flags);
+#endif
+
+ if (ret == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+#ifdef USE_FIONBIO_IOCTL
+ "ioctl(%d, FIONBIO, &on): %s", fd,
+#else
+ "fcntl(%d, F_SETFL, %d): %s", fd, flags,
+#endif
+ strbuf);
+
+ return (ISC_R_UNEXPECTED);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
+ int fd;
+ struct stat _stat;
+ isc_boolean_t is_usocket = ISC_FALSE;
+ isc_boolean_t is_connected = ISC_FALSE;
+ isc_result_t ret;
+ isc_entropysource_t *source;
+
+ REQUIRE(VALID_ENTROPY(ent));
+ REQUIRE(fname != NULL);
+
+ LOCK(&ent->lock);
+
+ if (stat(fname, &_stat) < 0) {
+ ret = isc__errno2result(errno);
+ goto errout;
+ }
+ /*
+ * Solaris 2.5.1 does not have support for sockets (S_IFSOCK),
+ * but it does return type S_IFIFO (the OS believes that
+ * the socket is a fifo). This may be an issue if we tell
+ * the program to look at an actual FIFO as its source of
+ * entropy.
+ */
+#if defined(S_ISSOCK)
+ if (S_ISSOCK(_stat.st_mode))
+ is_usocket = ISC_TRUE;
+#endif
+#if defined(S_ISFIFO) && defined(sun)
+ if (S_ISFIFO(_stat.st_mode))
+ is_usocket = ISC_TRUE;
+#endif
+ if (is_usocket)
+ fd = socket(PF_UNIX, SOCK_STREAM, 0);
+ else
+ fd = open(fname, O_RDONLY | PORT_NONBLOCK, 0);
+
+ if (fd < 0) {
+ ret = isc__errno2result(errno);
+ goto errout;
+ }
+
+ ret = make_nonblock(fd);
+ if (ret != ISC_R_SUCCESS)
+ goto closefd;
+
+ if (is_usocket) {
+ struct sockaddr_un sname;
+
+ memset(&sname, 0, sizeof(sname));
+ sname.sun_family = AF_UNIX;
+ strncpy(sname.sun_path, fname, sizeof(sname.sun_path));
+ sname.sun_path[sizeof(sname.sun_path)-1] = '0';
+#ifdef ISC_PLATFORM_HAVESALEN
+#if !defined(SUN_LEN)
+#define SUN_LEN(su) \
+ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+#endif
+ sname.sun_len = SUN_LEN(&sname);
+#endif
+
+ if (connect(fd, (struct sockaddr *) &sname,
+ sizeof(struct sockaddr_un)) < 0) {
+ if (errno != EINPROGRESS) {
+ ret = isc__errno2result(errno);
+ goto closefd;
+ }
+ } else
+ is_connected = ISC_TRUE;
+ }
+
+ source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t));
+ if (source == NULL) {
+ ret = ISC_R_NOMEMORY;
+ goto closefd;
+ }
+
+ /*
+ * From here down, no failures can occur.
+ */
+ source->magic = SOURCE_MAGIC;
+ source->ent = ent;
+ source->total = 0;
+ source->bad = ISC_FALSE;
+ memset(source->name, 0, sizeof(source->name));
+ ISC_LINK_INIT(source, link);
+ if (is_usocket) {
+ source->sources.usocket.handle = fd;
+ if (is_connected)
+ source->sources.usocket.status =
+ isc_usocketsource_connected;
+ else
+ source->sources.usocket.status =
+ isc_usocketsource_connecting;
+ source->sources.usocket.sz_to_recv = 0;
+ source->type = ENTROPY_SOURCETYPE_USOCKET;
+ } else {
+ source->sources.file.handle = fd;
+ source->type = ENTROPY_SOURCETYPE_FILE;
+ }
+
+ /*
+ * Hook it into the entropy system.
+ */
+ ISC_LIST_APPEND(ent->sources, source, link);
+ ent->nsources++;
+
+ UNLOCK(&ent->lock);
+ return (ISC_R_SUCCESS);
+
+ closefd:
+ (void)close(fd);
+
+ errout:
+ UNLOCK(&ent->lock);
+
+ return (ret);
+}
diff --git a/lib/isc/unix/errno2result.c b/lib/isc/unix/errno2result.c
new file mode 100644
index 0000000..f20aa29
--- /dev/null
+++ b/lib/isc/unix/errno2result.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/result.h>
+#include <isc/strerror.h>
+#include <isc/util.h>
+
+#include "errno2result.h"
+
+/*%
+ * Convert a POSIX errno value into an isc_result_t. The
+ * list of supported errno values is not complete; new users
+ * of this function should add any expected errors that are
+ * not already there.
+ */
+isc_result_t
+isc___errno2result(int posixerrno, const char *file, unsigned int line) {
+ char strbuf[ISC_STRERRORSIZE];
+
+ switch (posixerrno) {
+ case ENOTDIR:
+ case ELOOP:
+ case EINVAL: /* XXX sometimes this is not for files */
+ case ENAMETOOLONG:
+ case EBADF:
+ return (ISC_R_INVALIDFILE);
+ case ENOENT:
+ return (ISC_R_FILENOTFOUND);
+ case EACCES:
+ case EPERM:
+ return (ISC_R_NOPERM);
+ case EEXIST:
+ return (ISC_R_FILEEXISTS);
+ case EIO:
+ return (ISC_R_IOERROR);
+ case ENOMEM:
+ return (ISC_R_NOMEMORY);
+ case ENFILE:
+ case EMFILE:
+ return (ISC_R_TOOMANYOPENFILES);
+ case EPIPE:
+#ifdef ECONNRESET
+ case ECONNRESET:
+#endif
+#ifdef ECONNABORTED
+ case ECONNABORTED:
+#endif
+ return (ISC_R_CONNECTIONRESET);
+#ifdef ENOTCONN
+ case ENOTCONN:
+ return (ISC_R_NOTCONNECTED);
+#endif
+#ifdef ETIMEDOUT
+ case ETIMEDOUT:
+ return (ISC_R_TIMEDOUT);
+#endif
+#ifdef ENOBUFS
+ case ENOBUFS:
+ return (ISC_R_NORESOURCES);
+#endif
+#ifdef EAFNOSUPPORT
+ case EAFNOSUPPORT:
+ return (ISC_R_FAMILYNOSUPPORT);
+#endif
+#ifdef ENETDOWN
+ case ENETDOWN:
+ return (ISC_R_NETDOWN);
+#endif
+#ifdef EHOSTDOWN
+ case EHOSTDOWN:
+ return (ISC_R_HOSTDOWN);
+#endif
+#ifdef ENETUNREACH
+ case ENETUNREACH:
+ return (ISC_R_NETUNREACH);
+#endif
+#ifdef EHOSTUNREACH
+ case EHOSTUNREACH:
+ return (ISC_R_HOSTUNREACH);
+#endif
+#ifdef EADDRINUSE
+ case EADDRINUSE:
+ return (ISC_R_ADDRINUSE);
+#endif
+ case EADDRNOTAVAIL:
+ return (ISC_R_ADDRNOTAVAIL);
+ case ECONNREFUSED:
+ return (ISC_R_CONNREFUSED);
+ default:
+ isc__strerror(posixerrno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(file, line, "unable to convert errno "
+ "to isc_result: %d: %s",
+ posixerrno, strbuf);
+ /*
+ * XXXDCL would be nice if perhaps this function could
+ * return the system's error string, so the caller
+ * might have something more descriptive than "unexpected
+ * error" to log with.
+ */
+ return (ISC_R_UNEXPECTED);
+ }
+}
diff --git a/lib/isc/unix/errno2result.h b/lib/isc/unix/errno2result.h
new file mode 100644
index 0000000..1e49ed1
--- /dev/null
+++ b/lib/isc/unix/errno2result.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef UNIX_ERRNO2RESULT_H
+#define UNIX_ERRNO2RESULT_H 1
+
+/*! \file */
+
+/* XXXDCL this should be moved to lib/isc/include/isc/errno2result.h. */
+
+#include <errno.h> /* Provides errno. */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+#define isc__errno2result(x) isc___errno2result(x, __FILE__, __LINE__)
+
+isc_result_t
+isc___errno2result(int posixerrno, const char *file, unsigned int line);
+
+ISC_LANG_ENDDECLS
+
+#endif /* UNIX_ERRNO2RESULT_H */
diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c
new file mode 100644
index 0000000..3b59e86
--- /dev/null
+++ b/lib/isc/unix/file.c
@@ -0,0 +1,544 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <time.h> /* Required for utimes on some platforms. */
+#include <unistd.h> /* Required for mkstemp on NetBSD. */
+
+
+#include <sys/stat.h>
+#include <sys/time.h>
+
+#include <isc/dir.h>
+#include <isc/file.h>
+#include <isc/log.h>
+#include <isc/mem.h>
+#include <isc/random.h>
+#include <isc/string.h>
+#include <isc/time.h>
+#include <isc/util.h>
+
+#include "errno2result.h"
+#include "ntp_stdlib.h" /* NTP change for strlcpy, strlcat */
+
+/*
+ * XXXDCL As the API for accessing file statistics undoubtedly gets expanded,
+ * it might be good to provide a mechanism that allows for the results
+ * of a previous stat() to be used again without having to do another stat,
+ * such as perl's mechanism of using "_" in place of a file name to indicate
+ * that the results of the last stat should be used. But then you get into
+ * annoying MP issues. BTW, Win32 has stat().
+ */
+static isc_result_t
+file_stats(const char *file, struct stat *stats) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(file != NULL);
+ REQUIRE(stats != NULL);
+
+ if (stat(file, stats) != 0)
+ result = isc__errno2result(errno);
+
+ return (result);
+}
+
+isc_result_t
+isc_file_getmodtime(const char *file, isc_time_t *itime) {
+ isc_result_t result;
+ struct stat stats;
+
+ REQUIRE(file != NULL);
+ REQUIRE(itime != NULL);
+
+ result = file_stats(file, &stats);
+
+ if (result == ISC_R_SUCCESS)
+ /*
+ * XXXDCL some operating systems provide nanoseconds, too,
+ * such as BSD/OS via st_mtimespec.
+ */
+ isc_time_set(itime, stats.st_mtime, 0);
+
+ return (result);
+}
+
+isc_result_t
+isc_file_settime(const char *file, isc_time_t *itime) {
+ struct timeval times[2];
+
+ REQUIRE(file != NULL && itime != NULL);
+
+ /*
+ * tv_sec is at least a 32 bit quantity on all platforms we're
+ * dealing with, but it is signed on most (all?) of them,
+ * so we need to make sure the high bit isn't set. This unfortunately
+ * loses when either:
+ * * tv_sec becomes a signed 64 bit integer but long is 32 bits
+ * and isc_time_seconds > LONG_MAX, or
+ * * isc_time_seconds is changed to be > 32 bits but long is 32 bits
+ * and isc_time_seconds has at least 33 significant bits.
+ */
+ times[0].tv_sec = times[1].tv_sec = (long)isc_time_seconds(itime);
+
+ /*
+ * Here is the real check for the high bit being set.
+ */
+ if ((times[0].tv_sec &
+ (1ULL << (sizeof(times[0].tv_sec) * CHAR_BIT - 1))) != 0)
+ return (ISC_R_RANGE);
+
+ /*
+ * isc_time_nanoseconds guarantees a value that divided by 1000 will
+ * fit into the minimum possible size tv_usec field. Unfortunately,
+ * we don't know what that type is so can't cast directly ... but
+ * we can at least cast to signed so the IRIX compiler shuts up.
+ */
+ times[0].tv_usec = times[1].tv_usec =
+ (isc_int32_t)(isc_time_nanoseconds(itime) / 1000);
+
+ if (utimes(file, times) < 0)
+ return (isc__errno2result(errno));
+
+ return (ISC_R_SUCCESS);
+}
+
+#undef TEMPLATE
+#define TEMPLATE "tmp-XXXXXXXXXX" /*%< 14 characters. */
+
+isc_result_t
+isc_file_mktemplate(const char *path, char *buf, size_t buflen) {
+ return (isc_file_template(path, TEMPLATE, buf, buflen));
+}
+
+isc_result_t
+isc_file_template(const char *path, const char *templet, char *buf,
+ size_t buflen) {
+ char *s;
+
+ REQUIRE(path != NULL);
+ REQUIRE(templet != NULL);
+ REQUIRE(buf != NULL);
+
+ s = strrchr(templet, '/');
+ if (s != NULL)
+ templet = s + 1;
+
+ s = strrchr(path, '/');
+
+ if (s != NULL) {
+ if ((s - path + 1 + strlen(templet) + 1) > buflen)
+ return (ISC_R_NOSPACE);
+
+ strlcpy(buf, path, buflen);
+ buf[s - path + 1] = '\0';
+ strlcat(buf, templet, buflen);
+ } else {
+ if ((strlen(templet) + 1) > buflen)
+ return (ISC_R_NOSPACE);
+
+ strlcpy(buf, templet, buflen);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+static char alphnum[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+
+isc_result_t
+isc_file_renameunique(const char *file, char *templet) {
+ char *x;
+ char *cp;
+ isc_uint32_t which;
+
+ REQUIRE(file != NULL);
+ REQUIRE(templet != NULL);
+
+ cp = templet;
+ while (*cp != '\0')
+ cp++;
+ if (cp == templet)
+ return (ISC_R_FAILURE);
+
+ x = cp--;
+ while (cp >= templet && *cp == 'X') {
+ isc_random_get(&which);
+ *cp = alphnum[which % (sizeof(alphnum) - 1)];
+ x = cp--;
+ }
+ while (link(file, templet) == -1) {
+ if (errno != EEXIST)
+ return (isc__errno2result(errno));
+ for (cp = x;;) {
+ char *t;
+ if (*cp == '\0')
+ return (ISC_R_FAILURE);
+ t = strchr(alphnum, *cp);
+ if (t == NULL || *++t == '\0')
+ *cp++ = alphnum[0];
+ else {
+ *cp = *t;
+ break;
+ }
+ }
+ }
+ if (unlink(file) < 0)
+ if (errno != ENOENT)
+ return (isc__errno2result(errno));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_openunique(char *templet, FILE **fp) {
+ int mode = S_IWUSR|S_IRUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
+ return (isc_file_openuniquemode(templet, mode, fp));
+}
+
+isc_result_t
+isc_file_openuniqueprivate(char *templet, FILE **fp) {
+ int mode = S_IWUSR|S_IRUSR;
+ return (isc_file_openuniquemode(templet, mode, fp));
+}
+
+isc_result_t
+isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
+ int fd;
+ FILE *f;
+ isc_result_t result = ISC_R_SUCCESS;
+ char *x;
+ char *cp;
+ isc_uint32_t which;
+
+ REQUIRE(templet != NULL);
+ REQUIRE(fp != NULL && *fp == NULL);
+
+ cp = templet;
+ while (*cp != '\0')
+ cp++;
+ if (cp == templet)
+ return (ISC_R_FAILURE);
+
+ x = cp--;
+ while (cp >= templet && *cp == 'X') {
+ isc_random_get(&which);
+ *cp = alphnum[which % (sizeof(alphnum) - 1)];
+ x = cp--;
+ }
+
+
+ while ((fd = open(templet, O_RDWR|O_CREAT|O_EXCL, mode)) == -1) {
+ if (errno != EEXIST)
+ return (isc__errno2result(errno));
+ for (cp = x;;) {
+ char *t;
+ if (*cp == '\0')
+ return (ISC_R_FAILURE);
+ t = strchr(alphnum, *cp);
+ if (t == NULL || *++t == '\0')
+ *cp++ = alphnum[0];
+ else {
+ *cp = *t;
+ break;
+ }
+ }
+ }
+ f = fdopen(fd, "w+");
+ if (f == NULL) {
+ result = isc__errno2result(errno);
+ if (remove(templet) < 0) {
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_FILE, ISC_LOG_ERROR,
+ "remove '%s': failed", templet);
+ }
+ (void)close(fd);
+ } else
+ *fp = f;
+
+ return (result);
+}
+
+isc_result_t
+isc_file_remove(const char *filename) {
+ int r;
+
+ REQUIRE(filename != NULL);
+
+ r = unlink(filename);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_file_rename(const char *oldname, const char *newname) {
+ int r;
+
+ REQUIRE(oldname != NULL);
+ REQUIRE(newname != NULL);
+
+ r = rename(oldname, newname);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_boolean_t
+isc_file_exists(const char *pathname) {
+ struct stat stats;
+
+ REQUIRE(pathname != NULL);
+
+ return (ISC_TF(file_stats(pathname, &stats) == ISC_R_SUCCESS));
+}
+
+isc_result_t
+isc_file_isplainfile(const char *filename) {
+ /*
+ * This function returns success if filename is a plain file.
+ */
+ struct stat filestat;
+ memset(&filestat,0,sizeof(struct stat));
+
+ if ((stat(filename, &filestat)) == -1)
+ return(isc__errno2result(errno));
+
+ if(! S_ISREG(filestat.st_mode))
+ return(ISC_R_INVALIDFILE);
+
+ return(ISC_R_SUCCESS);
+}
+
+isc_boolean_t
+isc_file_isabsolute(const char *filename) {
+ REQUIRE(filename != NULL);
+ return (ISC_TF(filename[0] == '/'));
+}
+
+isc_boolean_t
+isc_file_iscurrentdir(const char *filename) {
+ REQUIRE(filename != NULL);
+ return (ISC_TF(filename[0] == '.' && filename[1] == '\0'));
+}
+
+isc_boolean_t
+isc_file_ischdiridempotent(const char *filename) {
+ REQUIRE(filename != NULL);
+ if (isc_file_isabsolute(filename))
+ return (ISC_TRUE);
+ if (isc_file_iscurrentdir(filename))
+ return (ISC_TRUE);
+ return (ISC_FALSE);
+}
+
+const char *
+isc_file_basename(const char *filename) {
+ char *s;
+
+ REQUIRE(filename != NULL);
+
+ s = strrchr(filename, '/');
+ if (s == NULL)
+ return (filename);
+
+ return (s + 1);
+}
+
+isc_result_t
+isc_file_progname(const char *filename, char *buf, size_t buflen) {
+ const char *base;
+ size_t len;
+
+ REQUIRE(filename != NULL);
+ REQUIRE(buf != NULL);
+
+ base = isc_file_basename(filename);
+ len = strlen(base) + 1;
+
+ if (len > buflen)
+ return (ISC_R_NOSPACE);
+ memcpy(buf, base, len);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Put the absolute name of the current directory into 'dirname', which is
+ * a buffer of at least 'length' characters. End the string with the
+ * appropriate path separator, such that the final product could be
+ * concatenated with a relative pathname to make a valid pathname string.
+ */
+static isc_result_t
+dir_current(char *dirname, size_t length) {
+ char *cwd;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(dirname != NULL);
+ REQUIRE(length > 0U);
+
+ cwd = getcwd(dirname, length);
+
+ if (cwd == NULL) {
+ if (errno == ERANGE)
+ result = ISC_R_NOSPACE;
+ else
+ result = isc__errno2result(errno);
+ } else {
+ if (strlen(dirname) + 1 == length)
+ result = ISC_R_NOSPACE;
+ else if (dirname[1] != '\0')
+ strlcat(dirname, "/", length);
+ }
+
+ return (result);
+}
+
+isc_result_t
+isc_file_absolutepath(const char *filename, char *path, size_t pathlen) {
+ isc_result_t result;
+ result = dir_current(path, pathlen);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ if (strlen(path) + strlen(filename) + 1 > pathlen)
+ return (ISC_R_NOSPACE);
+ strlcat(path, filename, pathlen);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_truncate(const char *filename, isc_offset_t size) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ if (truncate(filename, size) < 0)
+ result = isc__errno2result(errno);
+ return (result);
+}
+
+isc_result_t
+isc_file_safecreate(const char *filename, FILE **fp) {
+ isc_result_t result;
+ int flags;
+ struct stat sb;
+ FILE *f;
+ int fd;
+
+ REQUIRE(filename != NULL);
+ REQUIRE(fp != NULL && *fp == NULL);
+
+ result = file_stats(filename, &sb);
+ if (result == ISC_R_SUCCESS) {
+ if ((sb.st_mode & S_IFREG) == 0)
+ return (ISC_R_INVALIDFILE);
+ flags = O_WRONLY | O_TRUNC;
+ } else if (result == ISC_R_FILENOTFOUND) {
+ flags = O_WRONLY | O_CREAT | O_EXCL;
+ } else
+ return (result);
+
+ fd = open(filename, flags, S_IRUSR | S_IWUSR);
+ if (fd == -1)
+ return (isc__errno2result(errno));
+
+ f = fdopen(fd, "w");
+ if (f == NULL) {
+ result = isc__errno2result(errno);
+ close(fd);
+ return (result);
+ }
+
+ *fp = f;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
+{
+ char *dir, *file, *slash;
+
+ REQUIRE(path != NULL);
+
+ slash = strrchr(path, '/');
+
+ if (slash == path) {
+ file = ++slash;
+ dir = isc_mem_strdup(mctx, "/");
+ } else if (slash != NULL) {
+ file = ++slash;
+ dir = isc_mem_allocate(mctx, slash - path);
+ if (dir != NULL)
+ strlcpy(dir, path, slash - path);
+ } else {
+ file = path;
+ dir = isc_mem_strdup(mctx, ".");
+ }
+
+ if (dir == NULL)
+ return (ISC_R_NOMEMORY);
+
+ if (*file == '\0') {
+ isc_mem_free(mctx, dir);
+ return (ISC_R_INVALIDFILE);
+ }
+
+ *dirname = dir;
+ *basename = file;
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/unix/fsaccess.c b/lib/isc/unix/fsaccess.c
new file mode 100644
index 0000000..a2bd89a
--- /dev/null
+++ b/lib/isc/unix/fsaccess.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: fsaccess.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+
+#include "errno2result.h"
+
+/*! \file
+ * \brief
+ * The OS-independent part of the API is in lib/isc.
+ */
+#include "../fsaccess.c"
+
+isc_result_t
+isc_fsaccess_set(const char *path, isc_fsaccess_t access) {
+ struct stat statb;
+ mode_t mode;
+ isc_boolean_t is_dir = ISC_FALSE;
+ isc_fsaccess_t bits;
+ isc_result_t result;
+
+ if (stat(path, &statb) != 0)
+ return (isc__errno2result(errno));
+
+ if ((statb.st_mode & S_IFDIR) != 0)
+ is_dir = ISC_TRUE;
+ else if ((statb.st_mode & S_IFREG) == 0)
+ return (ISC_R_INVALIDFILE);
+
+ result = check_bad_bits(access, is_dir);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /*
+ * Done with checking bad bits. Set mode_t.
+ */
+ mode = 0;
+
+#define SET_AND_CLEAR1(modebit) \
+ if ((access & bits) != 0) { \
+ mode |= modebit; \
+ access &= ~bits; \
+ }
+#define SET_AND_CLEAR(user, group, other) \
+ SET_AND_CLEAR1(user); \
+ bits <<= STEP; \
+ SET_AND_CLEAR1(group); \
+ bits <<= STEP; \
+ SET_AND_CLEAR1(other);
+
+ bits = ISC_FSACCESS_READ | ISC_FSACCESS_LISTDIRECTORY;
+
+ SET_AND_CLEAR(S_IRUSR, S_IRGRP, S_IROTH);
+
+ bits = ISC_FSACCESS_WRITE |
+ ISC_FSACCESS_CREATECHILD |
+ ISC_FSACCESS_DELETECHILD;
+
+ SET_AND_CLEAR(S_IWUSR, S_IWGRP, S_IWOTH);
+
+ bits = ISC_FSACCESS_EXECUTE |
+ ISC_FSACCESS_ACCESSCHILD;
+
+ SET_AND_CLEAR(S_IXUSR, S_IXGRP, S_IXOTH);
+
+ INSIST(access == 0);
+
+ if (chmod(path, mode) < 0)
+ return (isc__errno2result(errno));
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/unix/ifiter_getifaddrs.c b/lib/isc/unix/ifiter_getifaddrs.c
new file mode 100644
index 0000000..547a83f
--- /dev/null
+++ b/lib/isc/unix/ifiter_getifaddrs.c
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ifiter_getifaddrs.c,v 1.13 2009/09/24 23:48:13 tbox Exp $ */
+
+/*! \file
+ * \brief
+ * Obtain the list of network interfaces using the getifaddrs(3) library.
+ */
+
+#include <ifaddrs.h>
+
+/*% Iterator Magic */
+#define IFITER_MAGIC ISC_MAGIC('I', 'F', 'I', 'G')
+/*% Valid Iterator */
+#define VALID_IFITER(t) ISC_MAGIC_VALID(t, IFITER_MAGIC)
+
+#ifdef __linux
+static isc_boolean_t seenv6 = ISC_FALSE;
+#endif
+
+/*% Iterator structure */
+struct isc_interfaceiter {
+ unsigned int magic; /*%< Magic number. */
+ isc_mem_t *mctx;
+ void *buf; /*%< (unused) */
+ unsigned int bufsize; /*%< (always 0) */
+ struct ifaddrs *ifaddrs; /*%< List of ifaddrs */
+ struct ifaddrs *pos; /*%< Ptr to current ifaddr */
+ isc_interface_t current; /*%< Current interface data. */
+ isc_result_t result; /*%< Last result code. */
+#ifdef __linux
+ FILE * proc;
+ char entry[ISC_IF_INET6_SZ];
+ isc_result_t valid;
+#endif
+};
+
+isc_result_t
+isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
+ isc_interfaceiter_t *iter;
+ isc_result_t result;
+ char strbuf[ISC_STRERRORSIZE];
+ int trys, ret;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(iterp != NULL);
+ REQUIRE(*iterp == NULL);
+
+ iter = isc_mem_get(mctx, sizeof(*iter));
+ if (iter == NULL)
+ return (ISC_R_NOMEMORY);
+
+ iter->mctx = mctx;
+ iter->buf = NULL;
+ iter->bufsize = 0;
+ iter->ifaddrs = NULL;
+#ifdef __linux
+ /*
+ * Only open "/proc/net/if_inet6" if we have never seen a IPv6
+ * address returned by getifaddrs().
+ */
+ if (!seenv6) {
+ iter->proc = fopen("/proc/net/if_inet6", "r");
+ if (iter->proc == NULL) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING,
+ "failed to open /proc/net/if_inet6");
+ }
+ } else
+ iter->proc = NULL;
+ iter->valid = ISC_R_FAILURE;
+#endif
+
+ /* If interrupted, try again */
+ for (trys = 0; trys < 3; trys++) {
+ if ((ret = getifaddrs(&iter->ifaddrs)) >= 0)
+ break;
+ if (errno != EINTR)
+ break;
+ }
+ if (ret < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERGETIFADDRS, ISC_MSG_GETIFADDRS,
+ "getting interface addresses: getifaddrs: %s"), strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto failure;
+ }
+
+ /*
+ * A newly created iterator has an undefined position
+ * until isc_interfaceiter_first() is called.
+ */
+ iter->pos = NULL;
+ iter->result = ISC_R_FAILURE;
+
+ iter->magic = IFITER_MAGIC;
+ *iterp = iter;
+ return (ISC_R_SUCCESS);
+
+ failure:
+#ifdef __linux
+ if (iter->proc != NULL)
+ fclose(iter->proc);
+#endif
+ if (iter->ifaddrs != NULL) /* just in case */
+ freeifaddrs(iter->ifaddrs);
+ isc_mem_put(mctx, iter, sizeof(*iter));
+ return (result);
+}
+
+/*
+ * Get information about the current interface to iter->current.
+ * If successful, return ISC_R_SUCCESS.
+ * If the interface has an unsupported address family,
+ * return ISC_R_IGNORE.
+ */
+
+static isc_result_t
+internal_current(isc_interfaceiter_t *iter) {
+ struct ifaddrs *ifa;
+ int family;
+ unsigned int namelen;
+
+ REQUIRE(VALID_IFITER(iter));
+
+ ifa = iter->pos;
+
+#ifdef __linux
+ if (iter->pos == NULL)
+ return (linux_if_inet6_current(iter));
+#endif
+
+ INSIST(ifa != NULL);
+ INSIST(ifa->ifa_name != NULL);
+
+ if (ifa->ifa_addr == NULL)
+ return (ISC_R_IGNORE);
+
+ family = ifa->ifa_addr->sa_family;
+ if (family != AF_INET && family != AF_INET6)
+ return (ISC_R_IGNORE);
+
+#ifdef __linux
+ if (family == AF_INET6)
+ seenv6 = ISC_TRUE;
+#endif
+
+ memset(&iter->current, 0, sizeof(iter->current));
+
+ namelen = strlen(ifa->ifa_name);
+ if (namelen > sizeof(iter->current.name) - 1)
+ namelen = sizeof(iter->current.name) - 1;
+
+ memset(iter->current.name, 0, sizeof(iter->current.name));
+ memcpy(iter->current.name, ifa->ifa_name, namelen);
+
+ iter->current.flags = 0;
+
+ if ((ifa->ifa_flags & IFF_UP) != 0)
+ iter->current.flags |= INTERFACE_F_UP;
+
+ if ((ifa->ifa_flags & IFF_POINTOPOINT) != 0)
+ iter->current.flags |= INTERFACE_F_POINTTOPOINT;
+
+ if ((ifa->ifa_flags & IFF_LOOPBACK) != 0)
+ iter->current.flags |= INTERFACE_F_LOOPBACK;
+
+ if ((ifa->ifa_flags & IFF_BROADCAST) != 0)
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+
+#ifdef IFF_MULTICAST
+ if ((ifa->ifa_flags & IFF_MULTICAST) != 0)
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+#endif
+
+ iter->current.af = family;
+
+ get_addr(family, &iter->current.address, ifa->ifa_addr, ifa->ifa_name);
+
+ if (ifa->ifa_netmask != NULL)
+ get_addr(family, &iter->current.netmask, ifa->ifa_netmask,
+ ifa->ifa_name);
+
+ if (ifa->ifa_dstaddr != NULL &&
+ (iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0)
+ get_addr(family, &iter->current.dstaddress, ifa->ifa_dstaddr,
+ ifa->ifa_name);
+
+ if (ifa->ifa_broadaddr != NULL &&
+ (iter->current.flags & INTERFACE_F_BROADCAST) != 0)
+ get_addr(family, &iter->current.broadcast, ifa->ifa_broadaddr,
+ ifa->ifa_name);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Step the iterator to the next interface. Unlike
+ * isc_interfaceiter_next(), this may leave the iterator
+ * positioned on an interface that will ultimately
+ * be ignored. Return ISC_R_NOMORE if there are no more
+ * interfaces, otherwise ISC_R_SUCCESS.
+ */
+static isc_result_t
+internal_next(isc_interfaceiter_t *iter) {
+
+ if (iter->pos != NULL)
+ iter->pos = iter->pos->ifa_next;
+ if (iter->pos == NULL) {
+#ifdef __linux
+ if (!seenv6)
+ return (linux_if_inet6_next(iter));
+#endif
+ return (ISC_R_NOMORE);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+internal_destroy(isc_interfaceiter_t *iter) {
+
+#ifdef __linux
+ if (iter->proc != NULL)
+ fclose(iter->proc);
+ iter->proc = NULL;
+#endif
+ if (iter->ifaddrs)
+ freeifaddrs(iter->ifaddrs);
+ iter->ifaddrs = NULL;
+}
+
+static
+void internal_first(isc_interfaceiter_t *iter) {
+
+#ifdef __linux
+ linux_if_inet6_first(iter);
+#endif
+ iter->pos = iter->ifaddrs;
+}
diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c
new file mode 100644
index 0000000..a684867
--- /dev/null
+++ b/lib/isc/unix/ifiter_ioctl.c
@@ -0,0 +1,1018 @@
+/*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ifiter_ioctl.c,v 1.62 2009/01/18 23:48:14 tbox Exp $ */
+
+/*! \file
+ * \brief
+ * Obtain the list of network interfaces using the SIOCGLIFCONF ioctl.
+ * See netintro(4).
+ */
+
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+#ifdef ISC_PLATFORM_HAVEIF_LADDRCONF
+#define lifc_len iflc_len
+#define lifc_buf iflc_buf
+#define lifc_req iflc_req
+#define LIFCONF if_laddrconf
+#else
+#define ISC_HAVE_LIFC_FAMILY 1
+#define ISC_HAVE_LIFC_FLAGS 1
+#define LIFCONF lifconf
+#endif
+
+#ifdef ISC_PLATFORM_HAVEIF_LADDRREQ
+#define lifr_addr iflr_addr
+#define lifr_name iflr_name
+#define lifr_dstaddr iflr_dstaddr
+#define lifr_broadaddr iflr_broadaddr
+#define lifr_flags iflr_flags
+#define lifr_index iflr_index
+#define ss_family sa_family
+#define LIFREQ if_laddrreq
+#else
+#define LIFREQ lifreq
+#endif
+#endif
+
+#define IFITER_MAGIC ISC_MAGIC('I', 'F', 'I', 'T')
+#define VALID_IFITER(t) ISC_MAGIC_VALID(t, IFITER_MAGIC)
+
+struct isc_interfaceiter {
+ unsigned int magic; /* Magic number. */
+ isc_mem_t *mctx;
+ int mode;
+ int socket;
+ struct ifconf ifc;
+ void *buf; /* Buffer for sysctl data. */
+ unsigned int bufsize; /* Bytes allocated. */
+ unsigned int pos; /* Current offset in
+ SIOCGIFCONF data */
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ int socket6;
+ struct LIFCONF lifc;
+ void *buf6; /* Buffer for sysctl data. */
+ unsigned int bufsize6; /* Bytes allocated. */
+ unsigned int pos6; /* Current offset in
+ SIOCGLIFCONF data */
+ isc_result_t result6; /* Last result code. */
+ isc_boolean_t first6;
+#endif
+#ifdef HAVE_TRUCLUSTER
+ int clua_context; /* Cluster alias context */
+ isc_boolean_t clua_done;
+ struct sockaddr clua_sa;
+#endif
+#ifdef __linux
+ FILE * proc;
+ char entry[ISC_IF_INET6_SZ];
+ isc_result_t valid;
+#endif
+ isc_interface_t current; /* Current interface data. */
+ isc_result_t result; /* Last result code. */
+};
+
+#ifdef HAVE_TRUCLUSTER
+#include <clua/clua.h>
+#include <sys/socket.h>
+#endif
+
+
+/*%
+ * Size of buffer for SIOCGLIFCONF, in bytes. We assume no sane system
+ * will have more than a megabyte of interface configuration data.
+ */
+#define IFCONF_BUFSIZE_INITIAL 4096
+#define IFCONF_BUFSIZE_MAX 1048576
+
+#ifdef __linux
+#ifndef IF_NAMESIZE
+# ifdef IFNAMSIZ
+# define IF_NAMESIZE IFNAMSIZ
+# else
+# define IF_NAMESIZE 16
+# endif
+#endif
+#endif
+
+int
+isc_ioctl(int fildes, int req, char *arg) {
+ int trys;
+ int ret;
+
+ for (trys = 0; trys < 3; trys++) {
+ if ((ret = ioctl(fildes, req, arg)) < 0) {
+ if (errno == EINTR)
+ continue;
+ }
+ break;
+ }
+ return (ret);
+}
+
+static isc_result_t
+getbuf4(isc_interfaceiter_t *iter) {
+ char strbuf[ISC_STRERRORSIZE];
+
+ iter->bufsize = IFCONF_BUFSIZE_INITIAL;
+
+ for (;;) {
+ iter->buf = isc_mem_get(iter->mctx, iter->bufsize);
+ if (iter->buf == NULL)
+ return (ISC_R_NOMEMORY);
+
+ memset(&iter->ifc.ifc_len, 0, sizeof(iter->ifc.ifc_len));
+ iter->ifc.ifc_len = iter->bufsize;
+ iter->ifc.ifc_buf = iter->buf;
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion". It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(iter->socket, SIOCGIFCONF, (char *)&iter->ifc)
+ == -1) {
+ if (errno != EINVAL) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETIFCONFIG,
+ "get interface "
+ "configuration: %s"),
+ strbuf);
+ goto unexpected;
+ }
+ /*
+ * EINVAL. Retry with a bigger buffer.
+ */
+ } else {
+ /*
+ * The ioctl succeeded.
+ * Some OS's just return what will fit rather
+ * than set EINVAL if the buffer is too small
+ * to fit all the interfaces in. If
+ * ifc.lifc_len is too near to the end of the
+ * buffer we will grow it just in case and
+ * retry.
+ */
+ if (iter->ifc.ifc_len + 2 * sizeof(struct ifreq)
+ < iter->bufsize)
+ break;
+ }
+ if (iter->bufsize >= IFCONF_BUFSIZE_MAX) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_BUFFERMAX,
+ "get interface "
+ "configuration: "
+ "maximum buffer "
+ "size exceeded"));
+ goto unexpected;
+ }
+ isc_mem_put(iter->mctx, iter->buf, iter->bufsize);
+
+ iter->bufsize *= 2;
+ }
+ return (ISC_R_SUCCESS);
+
+ unexpected:
+ isc_mem_put(iter->mctx, iter->buf, iter->bufsize);
+ iter->buf = NULL;
+ return (ISC_R_UNEXPECTED);
+}
+
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+static isc_result_t
+getbuf6(isc_interfaceiter_t *iter) {
+ char strbuf[ISC_STRERRORSIZE];
+ isc_result_t result;
+
+ iter->bufsize6 = IFCONF_BUFSIZE_INITIAL;
+
+ for (;;) {
+ iter->buf6 = isc_mem_get(iter->mctx, iter->bufsize6);
+ if (iter->buf6 == NULL)
+ return (ISC_R_NOMEMORY);
+
+ memset(&iter->lifc, 0, sizeof(iter->lifc));
+#ifdef ISC_HAVE_LIFC_FAMILY
+ iter->lifc.lifc_family = AF_INET6;
+#endif
+#ifdef ISC_HAVE_LIFC_FLAGS
+ iter->lifc.lifc_flags = 0;
+#endif
+ iter->lifc.lifc_len = iter->bufsize6;
+ iter->lifc.lifc_buf = iter->buf6;
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion". It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(iter->socket6, SIOCGLIFCONF, (char *)&iter->lifc)
+ == -1) {
+#ifdef __hpux
+ /*
+ * IPv6 interface scanning is not available on all
+ * kernels w/ IPv6 sockets.
+ */
+ if (errno == ENOENT) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_INTERFACE,
+ ISC_LOG_DEBUG(1),
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETIFCONFIG,
+ "get interface "
+ "configuration: %s"),
+ strbuf);
+ result = ISC_R_FAILURE;
+ goto cleanup;
+ }
+#endif
+ if (errno != EINVAL) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETIFCONFIG,
+ "get interface "
+ "configuration: %s"),
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto cleanup;
+ }
+ /*
+ * EINVAL. Retry with a bigger buffer.
+ */
+ } else {
+ /*
+ * The ioctl succeeded.
+ * Some OS's just return what will fit rather
+ * than set EINVAL if the buffer is too small
+ * to fit all the interfaces in. If
+ * ifc.ifc_len is too near to the end of the
+ * buffer we will grow it just in case and
+ * retry.
+ */
+ if (iter->lifc.lifc_len + 2 * sizeof(struct LIFREQ)
+ < iter->bufsize6)
+ break;
+ }
+ if (iter->bufsize6 >= IFCONF_BUFSIZE_MAX) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_BUFFERMAX,
+ "get interface "
+ "configuration: "
+ "maximum buffer "
+ "size exceeded"));
+ result = ISC_R_UNEXPECTED;
+ goto cleanup;
+ }
+ isc_mem_put(iter->mctx, iter->buf6, iter->bufsize6);
+
+ iter->bufsize6 *= 2;
+ }
+
+ if (iter->lifc.lifc_len != 0)
+ iter->mode = 6;
+ return (ISC_R_SUCCESS);
+
+ cleanup:
+ isc_mem_put(iter->mctx, iter->buf6, iter->bufsize6);
+ iter->buf6 = NULL;
+ return (result);
+}
+#endif
+
+isc_result_t
+isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
+ isc_interfaceiter_t *iter;
+ isc_result_t result;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(iterp != NULL);
+ REQUIRE(*iterp == NULL);
+
+ iter = isc_mem_get(mctx, sizeof(*iter));
+ if (iter == NULL)
+ return (ISC_R_NOMEMORY);
+
+ iter->mctx = mctx;
+ iter->mode = 4;
+ iter->buf = NULL;
+ iter->pos = (unsigned int) -1;
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ iter->buf6 = NULL;
+ iter->pos6 = (unsigned int) -1;
+ iter->result6 = ISC_R_NOMORE;
+ iter->socket6 = -1;
+ iter->first6 = ISC_FALSE;
+#endif
+
+ /*
+ * Get the interface configuration, allocating more memory if
+ * necessary.
+ */
+
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ result = isc_net_probeipv6();
+ if (result == ISC_R_SUCCESS) {
+ /*
+ * Create an unbound datagram socket to do the SIOCGLIFCONF
+ * ioctl on. HP/UX requires an AF_INET6 socket for
+ * SIOCGLIFCONF to get IPv6 addresses.
+ */
+ if ((iter->socket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_MAKESCANSOCKET,
+ "making interface "
+ "scan socket: %s"),
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto socket6_failure;
+ }
+ result = iter->result6 = getbuf6(iter);
+ if (result != ISC_R_NOTIMPLEMENTED && result != ISC_R_SUCCESS)
+ goto ioctl6_failure;
+ }
+#endif
+ if ((iter->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_MAKESCANSOCKET,
+ "making interface "
+ "scan socket: %s"),
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto socket_failure;
+ }
+ result = getbuf4(iter);
+ if (result != ISC_R_SUCCESS)
+ goto ioctl_failure;
+
+ /*
+ * A newly created iterator has an undefined position
+ * until isc_interfaceiter_first() is called.
+ */
+#ifdef HAVE_TRUCLUSTER
+ iter->clua_context = -1;
+ iter->clua_done = ISC_TRUE;
+#endif
+#ifdef __linux
+ iter->proc = fopen("/proc/net/if_inet6", "r");
+ iter->valid = ISC_R_FAILURE;
+#endif
+ iter->result = ISC_R_FAILURE;
+
+ iter->magic = IFITER_MAGIC;
+ *iterp = iter;
+ return (ISC_R_SUCCESS);
+
+ ioctl_failure:
+ if (iter->buf != NULL)
+ isc_mem_put(mctx, iter->buf, iter->bufsize);
+ (void) close(iter->socket);
+
+ socket_failure:
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ if (iter->buf6 != NULL)
+ isc_mem_put(mctx, iter->buf6, iter->bufsize6);
+ ioctl6_failure:
+ if (iter->socket6 != -1)
+ (void) close(iter->socket6);
+ socket6_failure:
+#endif
+
+ isc_mem_put(mctx, iter, sizeof(*iter));
+ return (result);
+}
+
+#ifdef HAVE_TRUCLUSTER
+static void
+get_inaddr(isc_netaddr_t *dst, struct in_addr *src) {
+ dst->family = AF_INET;
+ memcpy(&dst->type.in, src, sizeof(struct in_addr));
+}
+
+static isc_result_t
+internal_current_clusteralias(isc_interfaceiter_t *iter) {
+ struct clua_info ci;
+ if (clua_getaliasinfo(&iter->clua_sa, &ci) != CLUA_SUCCESS)
+ return (ISC_R_IGNORE);
+ memset(&iter->current, 0, sizeof(iter->current));
+ iter->current.af = iter->clua_sa.sa_family;
+ memset(iter->current.name, 0, sizeof(iter->current.name));
+ sprintf(iter->current.name, "clua%d", ci.aliasid);
+ iter->current.flags = INTERFACE_F_UP;
+ get_inaddr(&iter->current.address, &ci.addr);
+ get_inaddr(&iter->current.netmask, &ci.netmask);
+ return (ISC_R_SUCCESS);
+}
+#endif
+
+/*
+ * Get information about the current interface to iter->current.
+ * If successful, return ISC_R_SUCCESS.
+ * If the interface has an unsupported address family, or if
+ * some operation on it fails, return ISC_R_IGNORE to make
+ * the higher-level iterator code ignore it.
+ */
+
+static isc_result_t
+internal_current4(isc_interfaceiter_t *iter) {
+ struct ifreq *ifrp;
+ struct ifreq ifreq;
+ int family;
+ char strbuf[ISC_STRERRORSIZE];
+#if !defined(ISC_PLATFORM_HAVEIF_LADDRREQ) && defined(SIOCGLIFADDR)
+ struct lifreq lifreq;
+#else
+ char sabuf[256];
+#endif
+ int i, bits, prefixlen;
+
+ REQUIRE(VALID_IFITER(iter));
+
+ if (iter->ifc.ifc_len == 0 ||
+ iter->pos == (unsigned int)iter->ifc.ifc_len) {
+#ifdef __linux
+ return (linux_if_inet6_current(iter));
+#else
+ return (ISC_R_NOMORE);
+#endif
+ }
+
+ INSIST( iter->pos < (unsigned int) iter->ifc.ifc_len);
+
+ ifrp = (void *)((char *) iter->ifc.ifc_req + iter->pos);
+
+ memset(&ifreq, 0, sizeof(ifreq));
+ memcpy(&ifreq, ifrp, sizeof(ifreq));
+
+ family = ifreq.ifr_addr.sa_family;
+#if defined(ISC_PLATFORM_HAVEIPV6)
+ if (family != AF_INET && family != AF_INET6)
+#else
+ if (family != AF_INET)
+#endif
+ return (ISC_R_IGNORE);
+
+ memset(&iter->current, 0, sizeof(iter->current));
+ iter->current.af = family;
+
+ INSIST(sizeof(ifreq.ifr_name) <= sizeof(iter->current.name));
+ memset(iter->current.name, 0, sizeof(iter->current.name));
+ memcpy(iter->current.name, ifreq.ifr_name, sizeof(ifreq.ifr_name));
+
+ get_addr(family, &iter->current.address,
+ (struct sockaddr *)&ifrp->ifr_addr, ifreq.ifr_name);
+
+ /*
+ * If the interface does not have a address ignore it.
+ */
+ switch (family) {
+ case AF_INET:
+ if (iter->current.address.type.in.s_addr == htonl(INADDR_ANY))
+ return (ISC_R_IGNORE);
+ break;
+ case AF_INET6:
+ if (memcmp(&iter->current.address.type.in6, &in6addr_any,
+ sizeof(in6addr_any)) == 0)
+ return (ISC_R_IGNORE);
+ break;
+ }
+
+ /*
+ * Get interface flags.
+ */
+
+ iter->current.flags = 0;
+
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(iter->socket, SIOCGIFFLAGS, (char *) &ifreq) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "%s: getting interface flags: %s",
+ ifreq.ifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+
+ if ((ifreq.ifr_flags & IFF_UP) != 0)
+ iter->current.flags |= INTERFACE_F_UP;
+
+#ifdef IFF_POINTOPOINT
+ if ((ifreq.ifr_flags & IFF_POINTOPOINT) != 0)
+ iter->current.flags |= INTERFACE_F_POINTTOPOINT;
+#endif
+
+ if ((ifreq.ifr_flags & IFF_LOOPBACK) != 0)
+ iter->current.flags |= INTERFACE_F_LOOPBACK;
+
+ if ((ifreq.ifr_flags & IFF_BROADCAST) != 0)
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+
+#ifdef IFF_MULTICAST
+ if ((ifreq.ifr_flags & IFF_MULTICAST) != 0)
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+#endif
+
+ if (family == AF_INET)
+ goto inet;
+
+#if !defined(ISC_PLATFORM_HAVEIF_LADDRREQ) && defined(SIOCGLIFADDR)
+ memset(&lifreq, 0, sizeof(lifreq));
+ memcpy(lifreq.lifr_name, iter->current.name, sizeof(lifreq.lifr_name));
+ memcpy(&lifreq.lifr_addr, &iter->current.address.type.in6,
+ sizeof(iter->current.address.type.in6));
+
+ if (isc_ioctl(iter->socket, SIOCGLIFADDR, &lifreq) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "%s: getting interface address: %s",
+ ifreq.ifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ prefixlen = lifreq.lifr_addrlen;
+#else
+ isc_netaddr_format(&iter->current.address, sabuf, sizeof(sabuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_INTERFACE,
+ ISC_LOG_INFO,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETIFCONFIG,
+ "prefix length for %s is unknown "
+ "(assume 128)"), sabuf);
+ prefixlen = 128;
+#endif
+
+ /*
+ * Netmask already zeroed.
+ */
+ iter->current.netmask.family = family;
+ for (i = 0; i < 16; i++) {
+ if (prefixlen > 8) {
+ bits = 0;
+ prefixlen -= 8;
+ } else {
+ bits = 8 - prefixlen;
+ prefixlen = 0;
+ }
+ iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff;
+ }
+ return (ISC_R_SUCCESS);
+
+ inet:
+ if (family != AF_INET)
+ return (ISC_R_IGNORE);
+#ifdef IFF_POINTOPOINT
+ /*
+ * If the interface is point-to-point, get the destination address.
+ */
+ if ((iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0) {
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(iter->socket, SIOCGIFDSTADDR, (char *)&ifreq)
+ < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETDESTADDR,
+ "%s: getting "
+ "destination address: %s"),
+ ifreq.ifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.dstaddress,
+ (struct sockaddr *)&ifreq.ifr_dstaddr, ifreq.ifr_name);
+ }
+#endif
+
+ if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) {
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(iter->socket, SIOCGIFBRDADDR, (char *)&ifreq)
+ < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETBCSTADDR,
+ "%s: getting "
+ "broadcast address: %s"),
+ ifreq.ifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.broadcast,
+ (struct sockaddr *)&ifreq.ifr_broadaddr, ifreq.ifr_name);
+ }
+
+ /*
+ * Get the network mask.
+ */
+ memset(&ifreq, 0, sizeof(ifreq));
+ memcpy(&ifreq, ifrp, sizeof(ifreq));
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(iter->socket, SIOCGIFNETMASK, (char *)&ifreq) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETNETMASK,
+ "%s: getting netmask: %s"),
+ ifreq.ifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.netmask,
+ (struct sockaddr *)&ifreq.ifr_addr, ifreq.ifr_name);
+ return (ISC_R_SUCCESS);
+}
+
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+static isc_result_t
+internal_current6(isc_interfaceiter_t *iter) {
+ struct LIFREQ *ifrp;
+ struct LIFREQ lifreq;
+ int family;
+ char strbuf[ISC_STRERRORSIZE];
+ int fd;
+
+ REQUIRE(VALID_IFITER(iter));
+ if (iter->result6 != ISC_R_SUCCESS)
+ return (iter->result6);
+ REQUIRE(iter->pos6 < (unsigned int) iter->lifc.lifc_len);
+
+ ifrp = (void *)((char *)iter->lifc.lifc_req + iter->pos6);
+
+ memset(&lifreq, 0, sizeof(lifreq));
+ memcpy(&lifreq, ifrp, sizeof(lifreq));
+
+ family = lifreq.lifr_addr.ss_family;
+#ifdef ISC_PLATFORM_HAVEIPV6
+ if (family != AF_INET && family != AF_INET6)
+#else
+ if (family != AF_INET)
+#endif
+ return (ISC_R_IGNORE);
+
+ memset(&iter->current, 0, sizeof(iter->current));
+ iter->current.af = family;
+
+ INSIST(sizeof(lifreq.lifr_name) <= sizeof(iter->current.name));
+ memset(iter->current.name, 0, sizeof(iter->current.name));
+ memcpy(iter->current.name, lifreq.lifr_name, sizeof(lifreq.lifr_name));
+
+ get_addr(family, &iter->current.address,
+ (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name);
+
+ iter->current.ifindex = lifreq.lifr_index;
+ if (isc_netaddr_islinklocal(&iter->current.address))
+ isc_netaddr_setzone(&iter->current.address,
+ (isc_uint32_t)lifreq.lifr_index);
+
+ /*
+ * If the interface does not have a address ignore it.
+ */
+ switch (family) {
+ case AF_INET:
+ if (iter->current.address.type.in.s_addr == htonl(INADDR_ANY))
+ return (ISC_R_IGNORE);
+ break;
+ case AF_INET6:
+ if (memcmp(&iter->current.address.type.in6, &in6addr_any,
+ sizeof(in6addr_any)) == 0)
+ return (ISC_R_IGNORE);
+ break;
+ }
+
+ /*
+ * Get interface flags.
+ */
+
+ iter->current.flags = 0;
+
+ if (family == AF_INET6)
+ fd = iter->socket6;
+ else
+ fd = iter->socket;
+
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(fd, SIOCGLIFFLAGS, (char *) &lifreq) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "%s: getting interface flags: %s",
+ lifreq.lifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+
+ if ((lifreq.lifr_flags & IFF_UP) != 0)
+ iter->current.flags |= INTERFACE_F_UP;
+
+#ifdef IFF_POINTOPOINT
+ if ((lifreq.lifr_flags & IFF_POINTOPOINT) != 0)
+ iter->current.flags |= INTERFACE_F_POINTTOPOINT;
+#endif
+
+ if ((lifreq.lifr_flags & IFF_LOOPBACK) != 0)
+ iter->current.flags |= INTERFACE_F_LOOPBACK;
+
+ if ((lifreq.lifr_flags & IFF_BROADCAST) != 0) {
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+ }
+
+#ifdef IFF_MULTICAST
+ if ((lifreq.lifr_flags & IFF_MULTICAST) != 0) {
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+ }
+#endif
+
+#ifdef IFF_POINTOPOINT
+ /*
+ * If the interface is point-to-point, get the destination address.
+ */
+ if ((iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0) {
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(fd, SIOCGLIFDSTADDR, (char *)&lifreq)
+ < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETDESTADDR,
+ "%s: getting "
+ "destination address: %s"),
+ lifreq.lifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.dstaddress,
+ (struct sockaddr *)&lifreq.lifr_dstaddr,
+ lifreq.lifr_name);
+ }
+#endif
+
+#ifdef SIOCGLIFBRDADDR
+ if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0) {
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(iter->socket, SIOCGLIFBRDADDR, (char *)&lifreq)
+ < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETBCSTADDR,
+ "%s: getting "
+ "broadcast address: %s"),
+ lifreq.lifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.broadcast,
+ (struct sockaddr *)&lifreq.lifr_broadaddr,
+ lifreq.lifr_name);
+ }
+#endif /* SIOCGLIFBRDADDR */
+
+ /*
+ * Get the network mask. Netmask already zeroed.
+ */
+ memset(&lifreq, 0, sizeof(lifreq));
+ memcpy(&lifreq, ifrp, sizeof(lifreq));
+
+#ifdef lifr_addrlen
+ /*
+ * Special case: if the system provides lifr_addrlen member, the
+ * netmask of an IPv6 address can be derived from the length, since
+ * an IPv6 address always has a contiguous mask.
+ */
+ if (family == AF_INET6) {
+ int i, bits;
+
+ iter->current.netmask.family = family;
+ for (i = 0; i < lifreq.lifr_addrlen; i += 8) {
+ bits = lifreq.lifr_addrlen - i;
+ bits = (bits < 8) ? (8 - bits) : 0;
+ iter->current.netmask.type.in6.s6_addr[i / 8] =
+ (~0 << bits) & 0xff;
+ }
+
+ return (ISC_R_SUCCESS);
+ }
+#endif
+
+ /*
+ * Ignore the HP/UX warning about "integer overflow during
+ * conversion. It comes from its own macro definition,
+ * and is really hard to shut up.
+ */
+ if (isc_ioctl(fd, SIOCGLIFNETMASK, (char *)&lifreq) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERIOCTL,
+ ISC_MSG_GETNETMASK,
+ "%s: getting netmask: %s"),
+ lifreq.lifr_name, strbuf);
+ return (ISC_R_IGNORE);
+ }
+ get_addr(family, &iter->current.netmask,
+ (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name);
+
+ return (ISC_R_SUCCESS);
+}
+#endif
+
+static isc_result_t
+internal_current(isc_interfaceiter_t *iter) {
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ if (iter->mode == 6) {
+ iter->result6 = internal_current6(iter);
+ if (iter->result6 != ISC_R_NOMORE)
+ return (iter->result6);
+ }
+#endif
+#ifdef HAVE_TRUCLUSTER
+ if (!iter->clua_done)
+ return(internal_current_clusteralias(iter));
+#endif
+ return (internal_current4(iter));
+}
+
+/*
+ * Step the iterator to the next interface. Unlike
+ * isc_interfaceiter_next(), this may leave the iterator
+ * positioned on an interface that will ultimately
+ * be ignored. Return ISC_R_NOMORE if there are no more
+ * interfaces, otherwise ISC_R_SUCCESS.
+ */
+static isc_result_t
+internal_next4(isc_interfaceiter_t *iter) {
+#ifdef ISC_PLATFORM_HAVESALEN
+ struct ifreq *ifrp;
+#endif
+
+ if (iter->pos < (unsigned int) iter->ifc.ifc_len) {
+#ifdef ISC_PLATFORM_HAVESALEN
+ ifrp = (struct ifreq *)((char *) iter->ifc.ifc_req + iter->pos);
+
+ if (ifrp->ifr_addr.sa_len > sizeof(struct sockaddr))
+ iter->pos += sizeof(ifrp->ifr_name) +
+ ifrp->ifr_addr.sa_len;
+ else
+#endif
+ iter->pos += sizeof(struct ifreq);
+
+ } else {
+ INSIST(iter->pos == (unsigned int) iter->ifc.ifc_len);
+#ifdef __linux
+ return (linux_if_inet6_next(iter));
+#else
+ return (ISC_R_NOMORE);
+#endif
+ }
+ return (ISC_R_SUCCESS);
+}
+
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+static isc_result_t
+internal_next6(isc_interfaceiter_t *iter) {
+#ifdef ISC_PLATFORM_HAVESALEN
+ struct LIFREQ *ifrp;
+#endif
+
+ if (iter->result6 != ISC_R_SUCCESS && iter->result6 != ISC_R_IGNORE)
+ return (iter->result6);
+
+ REQUIRE(iter->pos6 < (unsigned int) iter->lifc.lifc_len);
+
+#ifdef ISC_PLATFORM_HAVESALEN
+ ifrp = (struct LIFREQ *)((char *) iter->lifc.lifc_req + iter->pos6);
+
+ if (ifrp->lifr_addr.sa_len > sizeof(struct sockaddr))
+ iter->pos6 += sizeof(ifrp->lifr_name) + ifrp->lifr_addr.sa_len;
+ else
+#endif
+ iter->pos6 += sizeof(struct LIFREQ);
+
+ if (iter->pos6 >= (unsigned int) iter->lifc.lifc_len)
+ return (ISC_R_NOMORE);
+
+ return (ISC_R_SUCCESS);
+}
+#endif
+
+static isc_result_t
+internal_next(isc_interfaceiter_t *iter) {
+#ifdef HAVE_TRUCLUSTER
+ int clua_result;
+#endif
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ if (iter->mode == 6) {
+ iter->result6 = internal_next6(iter);
+ if (iter->result6 != ISC_R_NOMORE)
+ return (iter->result6);
+ if (iter->first6) {
+ iter->first6 = ISC_FALSE;
+ return (ISC_R_SUCCESS);
+ }
+ }
+#endif
+#ifdef HAVE_TRUCLUSTER
+ if (!iter->clua_done) {
+ clua_result = clua_getaliasaddress(&iter->clua_sa,
+ &iter->clua_context);
+ if (clua_result != CLUA_SUCCESS)
+ iter->clua_done = ISC_TRUE;
+ return (ISC_R_SUCCESS);
+ }
+#endif
+ return (internal_next4(iter));
+}
+
+static void
+internal_destroy(isc_interfaceiter_t *iter) {
+ (void) close(iter->socket);
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ if (iter->socket6 != -1)
+ (void) close(iter->socket6);
+ if (iter->buf6 != NULL) {
+ isc_mem_put(iter->mctx, iter->buf6, iter->bufsize6);
+ }
+#endif
+#ifdef __linux
+ if (iter->proc != NULL)
+ fclose(iter->proc);
+#endif
+}
+
+static
+void internal_first(isc_interfaceiter_t *iter) {
+#ifdef HAVE_TRUCLUSTER
+ int clua_result;
+#endif
+ iter->pos = 0;
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR)
+ iter->pos6 = 0;
+ if (iter->result6 == ISC_R_NOMORE)
+ iter->result6 = ISC_R_SUCCESS;
+ iter->first6 = ISC_TRUE;
+#endif
+#ifdef HAVE_TRUCLUSTER
+ iter->clua_context = 0;
+ clua_result = clua_getaliasaddress(&iter->clua_sa,
+ &iter->clua_context);
+ iter->clua_done = ISC_TF(clua_result != CLUA_SUCCESS);
+#endif
+#ifdef __linux
+ linux_if_inet6_first(iter);
+#endif
+}
diff --git a/lib/isc/unix/ifiter_sysctl.c b/lib/isc/unix/ifiter_sysctl.c
new file mode 100644
index 0000000..0fbb377
--- /dev/null
+++ b/lib/isc/unix/ifiter_sysctl.c
@@ -0,0 +1,321 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ifiter_sysctl.c,v 1.25 2007/06/19 23:47:18 tbox Exp $ */
+
+/*! \file
+ * \brief
+ * Obtain the list of network interfaces using sysctl.
+ * See TCP/IP Illustrated Volume 2, sections 19.8, 19.14,
+ * and 19.16.
+ */
+
+#include <sys/param.h>
+#include <sys/sysctl.h>
+
+#include <net/route.h>
+#include <net/if_dl.h>
+
+/* XXX what about Alpha? */
+#ifdef sgi
+#define ROUNDUP(a) ((a) > 0 ? \
+ (1 + (((a) - 1) | (sizeof(__uint64_t) - 1))) : \
+ sizeof(__uint64_t))
+#else
+#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) \
+ : sizeof(long))
+#endif
+
+#define IFITER_MAGIC ISC_MAGIC('I', 'F', 'I', 'S')
+#define VALID_IFITER(t) ISC_MAGIC_VALID(t, IFITER_MAGIC)
+
+struct isc_interfaceiter {
+ unsigned int magic; /* Magic number. */
+ isc_mem_t *mctx;
+ void *buf; /* Buffer for sysctl data. */
+ unsigned int bufsize; /* Bytes allocated. */
+ unsigned int bufused; /* Bytes used. */
+ unsigned int pos; /* Current offset in
+ sysctl data. */
+ isc_interface_t current; /* Current interface data. */
+ isc_result_t result; /* Last result code. */
+};
+
+static int mib[6] = {
+ CTL_NET,
+ PF_ROUTE,
+ 0,
+ 0, /* Any address family. */
+ NET_RT_IFLIST,
+ 0 /* Flags. */
+};
+
+isc_result_t
+isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
+ isc_interfaceiter_t *iter;
+ isc_result_t result;
+ size_t bufsize;
+ size_t bufused;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(iterp != NULL);
+ REQUIRE(*iterp == NULL);
+
+ iter = isc_mem_get(mctx, sizeof(*iter));
+ if (iter == NULL)
+ return (ISC_R_NOMEMORY);
+
+ iter->mctx = mctx;
+ iter->buf = 0;
+
+ /*
+ * Determine the amount of memory needed.
+ */
+ bufsize = 0;
+ if (sysctl(mib, 6, NULL, &bufsize, NULL, (size_t) 0) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERSYSCTL,
+ ISC_MSG_GETIFLISTSIZE,
+ "getting interface "
+ "list size: sysctl: %s"),
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto failure;
+ }
+ iter->bufsize = bufsize;
+
+ iter->buf = isc_mem_get(iter->mctx, iter->bufsize);
+ if (iter->buf == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto failure;
+ }
+
+ bufused = bufsize;
+ if (sysctl(mib, 6, iter->buf, &bufused, NULL, (size_t) 0) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERSYSCTL,
+ ISC_MSG_GETIFLIST,
+ "getting interface list: "
+ "sysctl: %s"),
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto failure;
+ }
+ iter->bufused = bufused;
+ INSIST(iter->bufused <= iter->bufsize);
+
+ /*
+ * A newly created iterator has an undefined position
+ * until isc_interfaceiter_first() is called.
+ */
+ iter->pos = (unsigned int) -1;
+ iter->result = ISC_R_FAILURE;
+
+ iter->magic = IFITER_MAGIC;
+ *iterp = iter;
+ return (ISC_R_SUCCESS);
+
+ failure:
+ if (iter->buf != NULL)
+ isc_mem_put(mctx, iter->buf, iter->bufsize);
+ isc_mem_put(mctx, iter, sizeof(*iter));
+ return (result);
+}
+
+/*
+ * Get information about the current interface to iter->current.
+ * If successful, return ISC_R_SUCCESS.
+ * If the interface has an unsupported address family,
+ * return ISC_R_IGNORE. In case of other failure,
+ * return ISC_R_UNEXPECTED.
+ */
+
+static isc_result_t
+internal_current(isc_interfaceiter_t *iter) {
+ struct ifa_msghdr *ifam, *ifam_end;
+
+ REQUIRE(VALID_IFITER(iter));
+ REQUIRE (iter->pos < (unsigned int) iter->bufused);
+
+ ifam = (struct ifa_msghdr *) ((char *) iter->buf + iter->pos);
+ ifam_end = (struct ifa_msghdr *) ((char *) iter->buf + iter->bufused);
+
+ // Skip wrong RTM version headers
+ if (ifam->ifam_version != RTM_VERSION)
+ return (ISC_R_IGNORE);
+
+ if (ifam->ifam_type == RTM_IFINFO) {
+ struct if_msghdr *ifm = (struct if_msghdr *) ifam;
+ struct sockaddr_dl *sdl = (struct sockaddr_dl *) (ifm + 1);
+ unsigned int namelen;
+
+ memset(&iter->current, 0, sizeof(iter->current));
+
+ iter->current.ifindex = sdl->sdl_index;
+ namelen = sdl->sdl_nlen;
+ if (namelen > sizeof(iter->current.name) - 1)
+ namelen = sizeof(iter->current.name) - 1;
+
+ memset(iter->current.name, 0, sizeof(iter->current.name));
+ memcpy(iter->current.name, sdl->sdl_data, namelen);
+
+ iter->current.flags = 0;
+
+ if ((ifam->ifam_flags & IFF_UP) != 0)
+ iter->current.flags |= INTERFACE_F_UP;
+
+ if ((ifam->ifam_flags & IFF_POINTOPOINT) != 0)
+ iter->current.flags |= INTERFACE_F_POINTTOPOINT;
+
+ if ((ifam->ifam_flags & IFF_LOOPBACK) != 0)
+ iter->current.flags |= INTERFACE_F_LOOPBACK;
+
+ if ((ifam->ifam_flags & IFF_BROADCAST) != 0)
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+
+#ifdef IFF_MULTICAST
+ if ((ifam->ifam_flags & IFF_MULTICAST) != 0)
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+#endif
+
+ /*
+ * This is not an interface address.
+ * Force another iteration.
+ */
+ return (ISC_R_IGNORE);
+ } else if (ifam->ifam_type == RTM_NEWADDR) {
+ int i;
+ int family;
+ struct sockaddr *mask_sa = NULL;
+ struct sockaddr *addr_sa = NULL;
+ struct sockaddr *dst_sa = NULL;
+
+ struct sockaddr *sa = (struct sockaddr *)(ifam + 1);
+ family = sa->sa_family;
+
+ for (i = 0; i < RTAX_MAX; i++)
+ {
+ if ((ifam->ifam_addrs & (1 << i)) == 0)
+ continue;
+
+ INSIST(sa < (struct sockaddr *) ifam_end);
+
+ switch (i) {
+ case RTAX_NETMASK: /* Netmask */
+ mask_sa = sa;
+ break;
+ case RTAX_IFA: /* Interface address */
+ addr_sa = sa;
+ break;
+ case RTAX_BRD: /* Broadcast or destination address */
+ dst_sa = sa;
+ break;
+ }
+#ifdef ISC_PLATFORM_HAVESALEN
+ sa = (struct sockaddr *)((char*)(sa)
+ + ROUNDUP(sa->sa_len));
+#else
+#ifdef sgi
+ /*
+ * Do as the contributed SGI code does.
+ */
+ sa = (struct sockaddr *)((char*)(sa)
+ + ROUNDUP(_FAKE_SA_LEN_DST(sa)));
+#else
+ /* XXX untested. */
+ sa = (struct sockaddr *)((char*)(sa)
+ + ROUNDUP(sizeof(struct sockaddr)));
+#endif
+#endif
+ }
+
+ if (addr_sa == NULL)
+ return (ISC_R_IGNORE);
+
+ family = addr_sa->sa_family;
+ if (family != AF_INET && family != AF_INET6)
+ return (ISC_R_IGNORE);
+
+ iter->current.af = family;
+
+ get_addr(family, &iter->current.address, addr_sa,
+ iter->current.name);
+
+ if (mask_sa != NULL)
+ get_addr(family, &iter->current.netmask, mask_sa,
+ iter->current.name);
+
+ if (dst_sa != NULL &&
+ (iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0)
+ get_addr(family, &iter->current.dstaddress, dst_sa,
+ iter->current.name);
+
+ if (dst_sa != NULL &&
+ (iter->current.flags & INTERFACE_F_BROADCAST) != 0)
+ get_addr(family, &iter->current.broadcast, dst_sa,
+ iter->current.name);
+
+ return (ISC_R_SUCCESS);
+ } else {
+ printf("%s", isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERSYSCTL,
+ ISC_MSG_UNEXPECTEDTYPE,
+ "warning: unexpected interface "
+ "list message type\n"));
+ return (ISC_R_IGNORE);
+ }
+}
+
+/*
+ * Step the iterator to the next interface. Unlike
+ * isc_interfaceiter_next(), this may leave the iterator
+ * positioned on an interface that will ultimately
+ * be ignored. Return ISC_R_NOMORE if there are no more
+ * interfaces, otherwise ISC_R_SUCCESS.
+ */
+static isc_result_t
+internal_next(isc_interfaceiter_t *iter) {
+ struct ifa_msghdr *ifam;
+ REQUIRE (iter->pos < (unsigned int) iter->bufused);
+
+ ifam = (struct ifa_msghdr *) ((char *) iter->buf + iter->pos);
+
+ iter->pos += ifam->ifam_msglen;
+
+ if (iter->pos >= iter->bufused)
+ return (ISC_R_NOMORE);
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+internal_destroy(isc_interfaceiter_t *iter) {
+ UNUSED(iter); /* Unused. */
+ /*
+ * Do nothing.
+ */
+}
+
+static
+void internal_first(isc_interfaceiter_t *iter) {
+ iter->pos = 0;
+}
diff --git a/lib/isc/unix/include/isc/Makefile b/lib/isc/unix/include/isc/Makefile
new file mode 100644
index 0000000..7c9a4b0
--- /dev/null
+++ b/lib/isc/unix/include/isc/Makefile
@@ -0,0 +1,415 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# lib/isc/unix/include/isc/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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.
+
+
+
+srcdir = /deacon/backroom/snaps/ntp-dev/lib/isc/unix/include/isc
+top_srcdir = /deacon/backroom/snaps/ntp-dev
+VPATH = /deacon/backroom/snaps/ntp-dev/lib/isc/unix/include/isc
+pkgdatadir = $(datadir)/ntp
+pkglibdir = $(libdir)/ntp
+pkgincludedir = $(includedir)/ntp
+top_builddir = ../../../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = /usr/local/gnu/bin/install -c
+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 = sparc-sun-solaris2.10
+host_triplet = sparc-sun-solaris2.10
+subdir = lib/isc/unix/include/isc
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
+ $(top_srcdir)/m4/define_dir.m4 \
+ $(top_srcdir)/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/version.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run aclocal-1.9
+AMDEP_FALSE = #
+AMDEP_TRUE =
+AMTAR = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run tar
+AR = ar
+ARLIB_DIR = arlib
+AUTOCONF = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run autoconf
+AUTOHEADER = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run autoheader
+AUTOMAKE = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run automake-1.9
+AWK = gawk
+BINSUBDIR = bin
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2 -D_LARGEFILE64_SOURCE -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Winit-self -Wno-strict-prototypes
+CHUTEST =
+CLKTEST =
+CPP = gcc -E
+CPPFLAGS = -D__EXTENSIONS__ -I/usr/sfw/include
+CYGPATH_W = echo
+DCFD =
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EDITLINE_LIBS =
+EF_LIBS =
+EF_PROGS =
+EGREP = grep -E
+EXEEXT =
+HAVE_INLINE =
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_LIBOPTS_FALSE =
+INSTALL_LIBOPTS_TRUE = #
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+LCRYPTO = -lcrypto
+LDFLAGS = -L/usr/sfw/lib -R/usr/sfw/lib
+LIBOBJS =
+LIBOPTS_CFLAGS = -I$(top_srcdir)/libopts
+LIBOPTS_DIR = libopts
+LIBOPTS_LDADD = $(top_builddir)/libopts/libopts.la
+LIBPARSE =
+LIBS = -lkvm -lelf -lsocket -lrt -lmd5 -lnsl -lgen
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LN_S = ln -s
+LSCF = -lscf
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /deacon/backroom/snaps/ntp-dev/missing --run makeinfo
+MAKE_ADJTIMED =
+MAKE_CHECK_LAYOUT = check-layout
+MAKE_CHECK_Y2K =
+MAKE_LIBNTPSIM = libntpsim.a
+MAKE_LIBPARSE =
+MAKE_LIBPARSE_KERNEL =
+MAKE_NTPDSIM = ntpdsim
+MAKE_NTPSNMPD =
+MAKE_NTPTIME = ntptime
+MAKE_PARSEKMODULE =
+MAKE_TICKADJ = tickadj
+MAKE_TIMETRIM =
+NEED_LIBOPTS_FALSE = #
+NEED_LIBOPTS_TRUE =
+OBJEXT = o
+OPENSSL =
+OPENSSL_INC = /usr/sfw/include
+OPENSSL_LIB = /usr/sfw/lib
+PACKAGE = ntp
+PACKAGE_BUGREPORT =
+PACKAGE_NAME = ntp
+PACKAGE_STRING = ntp 4.2.5p221
+PACKAGE_TARNAME = ntp
+PACKAGE_VERSION = 4.2.5p221
+PATH_NET_SNMP_CONFIG =
+PATH_PERL = /usr/local/bin/perl
+PATH_SEPARATOR = :
+PATH_SH = /bin/sh
+PROPDELAY =
+RANLIB = ranlib
+SET_MAKE =
+SHELL = /bin/sh
+SNMP_CFLAGS =
+SNMP_CPPFLAGS =
+SNMP_LIBS =
+STRIP = strip
+TESTDCF =
+VERSION = 4.2.5p221
+VPATH_HACK_FALSE =
+VPATH_HACK_TRUE = #
+YACC = bison -y
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_RANLIB = ranlib
+ac_ct_STRIP = strip
+am__fastdepCC_FALSE = #
+am__fastdepCC_TRUE =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = sparc-sun-solaris2.10
+build_alias =
+build_cpu = sparc
+build_os = solaris2.10
+build_vendor = sun
+datadir = ${prefix}/share
+exec_prefix = ${prefix}
+host = sparc-sun-solaris2.10
+host_alias =
+host_cpu = sparc
+host_os = solaris2.10
+host_vendor = sun
+includedir = ${prefix}/include
+infodir = ${prefix}/info
+install_sh = /deacon/backroom/snaps/ntp-dev/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localstatedir = ${prefix}/var
+mandir = ${prefix}/man
+mkdir_p = mkdir -p --
+oldincludedir = /usr/include
+prefix = /usr/local
+program_transform_name = s,x,x,
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+subdirs = arlib sntp
+sysconfdir = ${prefix}/etc
+target_alias =
+NULL =
+#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
+AUTOMAKE_OPTIONS =
+ETAGS_ARGS = $(srcdir)/Makefile.am
+#EXTRA_DIST = TAGS
+noinst_HEADERS = \
+ dir.h \
+ int.h \
+ net.h \
+ offset.h \
+ stat.h \
+ strerror.h \
+ time.h \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/isc/unix/include/isc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign lib/isc/unix/include/isc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool ctags distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/isc/unix/include/isc/dir.h b/lib/isc/unix/include/isc/dir.h
new file mode 100644
index 0000000..e4a2ad0
--- /dev/null
+++ b/lib/isc/unix/include/isc/dir.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: dir.h,v 1.21 2007/06/19 23:47:19 tbox Exp $ */
+
+/* Principal Authors: DCL */
+
+#ifndef ISC_DIR_H
+#define ISC_DIR_H 1
+
+/*! \file */
+
+#include <sys/types.h> /* Required on some systems. */
+#include <dirent.h>
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+#define ISC_DIR_NAMEMAX 256
+#define ISC_DIR_PATHMAX 1024
+
+/*% Directory Entry */
+typedef struct isc_direntry {
+ /*!
+ * Ideally, this should be NAME_MAX, but AIX does not define it by
+ * default and dynamically allocating the space based on pathconf()
+ * complicates things undesirably, as does adding special conditionals
+ * just for AIX. So a comfortably sized buffer is chosen instead.
+ */
+ char name[ISC_DIR_NAMEMAX];
+ unsigned int length;
+} isc_direntry_t;
+
+/*% Directory */
+typedef struct isc_dir {
+ unsigned int magic;
+ /*!
+ * As with isc_direntry_t->name, making this "right" for all systems
+ * is slightly problematic because AIX does not define PATH_MAX.
+ */
+ char dirname[ISC_DIR_PATHMAX];
+ isc_direntry_t entry;
+ DIR * handle;
+} isc_dir_t;
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_dir_init(isc_dir_t *dir);
+
+isc_result_t
+isc_dir_open(isc_dir_t *dir, const char *dirname);
+
+isc_result_t
+isc_dir_read(isc_dir_t *dir);
+
+isc_result_t
+isc_dir_reset(isc_dir_t *dir);
+
+void
+isc_dir_close(isc_dir_t *dir);
+
+isc_result_t
+isc_dir_chdir(const char *dirname);
+
+isc_result_t
+isc_dir_chroot(const char *dirname);
+
+isc_result_t
+isc_dir_createunique(char *templet);
+/*!<
+ * Use a templet (such as from isc_file_mktemplate()) to create a uniquely
+ * named, empty directory. The templet string is modified in place.
+ * If result == ISC_R_SUCCESS, it is the name of the directory that was
+ * created.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_DIR_H */
diff --git a/lib/isc/unix/include/isc/int.h b/lib/isc/unix/include/isc/int.h
new file mode 100644
index 0000000..73feb3b
--- /dev/null
+++ b/lib/isc/unix/include/isc/int.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: int.h,v 1.16 2007/06/19 23:47:19 tbox Exp $ */
+
+#ifndef ISC_INT_H
+#define ISC_INT_H 1
+
+/*! \file */
+
+typedef char isc_int8_t;
+typedef unsigned char isc_uint8_t;
+typedef short isc_int16_t;
+typedef unsigned short isc_uint16_t;
+typedef int isc_int32_t;
+typedef unsigned int isc_uint32_t;
+typedef long long isc_int64_t;
+typedef unsigned long long isc_uint64_t;
+
+#define ISC_INT8_MIN -128
+#define ISC_INT8_MAX 127
+#define ISC_UINT8_MAX 255
+
+#define ISC_INT16_MIN -32768
+#define ISC_INT16_MAX 32767
+#define ISC_UINT16_MAX 65535
+
+/*%
+ * Note that "int" is 32 bits on all currently supported Unix-like operating
+ * systems, but "long" can be either 32 bits or 64 bits, thus the 32 bit
+ * constants are not qualified with "L".
+ */
+#define ISC_INT32_MIN -2147483648
+#define ISC_INT32_MAX 2147483647
+#define ISC_UINT32_MAX 4294967295U
+
+#define ISC_INT64_MIN -9223372036854775808LL
+#define ISC_INT64_MAX 9223372036854775807LL
+#define ISC_UINT64_MAX 18446744073709551615ULL
+
+#endif /* ISC_INT_H */
diff --git a/lib/isc/unix/include/isc/keyboard.h b/lib/isc/unix/include/isc/keyboard.h
new file mode 100644
index 0000000..43f5e7e
--- /dev/null
+++ b/lib/isc/unix/include/isc/keyboard.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: keyboard.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */
+
+#ifndef ISC_KEYBOARD_H
+#define ISC_KEYBOARD_H 1
+
+/*! \file */
+
+#include <termios.h>
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+ISC_LANG_BEGINDECLS
+
+typedef struct {
+ int fd;
+ struct termios saved_mode;
+ isc_result_t result;
+} isc_keyboard_t;
+
+isc_result_t
+isc_keyboard_open(isc_keyboard_t *keyboard);
+
+isc_result_t
+isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleepseconds);
+
+isc_result_t
+isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp);
+
+isc_boolean_t
+isc_keyboard_canceled(isc_keyboard_t *keyboard);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_KEYBOARD_H */
diff --git a/lib/isc/unix/include/isc/net.h b/lib/isc/unix/include/isc/net.h
new file mode 100644
index 0000000..37a0f3b
--- /dev/null
+++ b/lib/isc/unix/include/isc/net.h
@@ -0,0 +1,364 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_NET_H
+#define ISC_NET_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file
+ * \brief
+ * Basic Networking Types
+ *
+ * This module is responsible for defining the following basic networking
+ * types:
+ *
+ *\li struct in_addr
+ *\li struct in6_addr
+ *\li struct in6_pktinfo
+ *\li struct sockaddr
+ *\li struct sockaddr_in
+ *\li struct sockaddr_in6
+ *\li in_port_t
+ *
+ * It ensures that the AF_ and PF_ macros are defined.
+ *
+ * It declares ntoh[sl]() and hton[sl]().
+ *
+ * It declares inet_aton(), inet_ntop(), and inet_pton().
+ *
+ * It ensures that #INADDR_LOOPBACK, #INADDR_ANY, #IN6ADDR_ANY_INIT,
+ * in6addr_any, and in6addr_loopback are available.
+ *
+ * It ensures that IN_MULTICAST() is available to check for multicast
+ * addresses.
+ *
+ * MP:
+ *\li No impact.
+ *
+ * Reliability:
+ *\li No anticipated impact.
+ *
+ * Resources:
+ *\li N/A.
+ *
+ * Security:
+ *\li No anticipated impact.
+ *
+ * Standards:
+ *\li BSD Socket API
+ *\li RFC2553
+ */
+
+/***
+ *** Imports.
+ ***/
+#include <isc/platform.h>
+
+#include <sys/types.h>
+#include <sys/socket.h> /* Contractual promise. */
+
+#include <net/if.h>
+
+#include <netinet/in.h> /* Contractual promise. */
+#include <arpa/inet.h> /* Contractual promise. */
+#ifdef ISC_PLATFORM_NEEDNETINETIN6H
+#include <netinet/in6.h> /* Required on UnixWare. */
+#endif
+#ifdef ISC_PLATFORM_NEEDNETINET6IN6H
+#include <netinet6/in6.h> /* Required on BSD/OS for in6_pktinfo. */
+#endif
+
+#ifndef ISC_PLATFORM_HAVEIPV6
+#include <isc/ipv6.h> /* Contractual promise. */
+#endif
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+#ifdef ISC_PLATFORM_HAVEINADDR6
+#define in6_addr in_addr6 /*%< Required for pre RFC2133 implementations. */
+#endif
+
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifndef IN6ADDR_ANY_INIT
+#ifdef s6_addr
+/*%
+ * Required for some pre RFC2133 implementations.
+ * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
+ * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt.
+ * If 's6_addr' is defined then assume that there is a union and three
+ * levels otherwise assume two levels required.
+ */
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+#else
+#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
+#endif
+#endif
+
+#ifndef IN6ADDR_LOOPBACK_INIT
+#ifdef s6_addr
+/*% IPv6 address loopback init */
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+#else
+#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
+#endif
+#endif
+
+#ifndef IN6_IS_ADDR_V4MAPPED
+/*% Is IPv6 address V4 mapped? */
+#define IN6_IS_ADDR_V4MAPPED(x) \
+ (memcmp((x)->s6_addr, in6addr_any.s6_addr, 10) == 0 && \
+ (x)->s6_addr[10] == 0xff && (x)->s6_addr[11] == 0xff)
+#endif
+
+#ifndef IN6_IS_ADDR_V4COMPAT
+/*% Is IPv6 address V4 compatible? */
+#define IN6_IS_ADDR_V4COMPAT(x) \
+ (memcmp((x)->s6_addr, in6addr_any.s6_addr, 12) == 0 && \
+ ((x)->s6_addr[12] != 0 || (x)->s6_addr[13] != 0 || \
+ (x)->s6_addr[14] != 0 || \
+ ((x)->s6_addr[15] != 0 && (x)->s6_addr[15] != 1)))
+#endif
+
+#ifndef IN6_IS_ADDR_MULTICAST
+/*% Is IPv6 address multicast? */
+#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
+#endif
+
+#ifndef IN6_IS_ADDR_LINKLOCAL
+/*% Is IPv6 address linklocal? */
+#define IN6_IS_ADDR_LINKLOCAL(a) \
+ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
+#endif
+
+#ifndef IN6_IS_ADDR_SITELOCAL
+/*% is IPv6 address sitelocal? */
+#define IN6_IS_ADDR_SITELOCAL(a) \
+ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
+#endif
+
+
+#ifndef IN6_IS_ADDR_LOOPBACK
+/*% is IPv6 address loopback? */
+#define IN6_IS_ADDR_LOOPBACK(x) \
+ (memcmp((x)->s6_addr, in6addr_loopback.s6_addr, 16) == 0)
+#endif
+#endif
+
+#ifndef AF_INET6
+/*% IPv6 */
+#define AF_INET6 99
+#endif
+
+#ifndef PF_INET6
+/*% IPv6 */
+#define PF_INET6 AF_INET6
+#endif
+
+#ifndef INADDR_LOOPBACK
+/*% inaddr loopback */
+#define INADDR_LOOPBACK 0x7f000001UL
+#endif
+
+#ifndef ISC_PLATFORM_HAVEIN6PKTINFO
+/*% IPv6 packet info */
+struct in6_pktinfo {
+ struct in6_addr ipi6_addr; /*%< src/dst IPv6 address */
+ unsigned int ipi6_ifindex; /*%< send/recv interface index */
+};
+#endif
+
+#if defined(ISC_PLATFORM_NEEDIN6ADDRANY)
+extern const struct in6_addr isc_net_in6addrany;
+/*%
+ * Cope with a missing in6addr_any and in6addr_loopback.
+ */
+#define in6addr_any isc_net_in6addrany
+#endif
+
+#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
+extern const struct in6_addr isc_net_in6addrloop;
+#define in6addr_loopback isc_net_in6addrloop
+#endif
+
+#ifdef ISC_PLATFORM_FIXIN6ISADDR
+#undef IN6_IS_ADDR_GEOGRAPHIC
+/*!
+ * \brief
+ * Fix UnixWare 7.1.1's broken IN6_IS_ADDR_* definitions.
+ */
+#define IN6_IS_ADDR_GEOGRAPHIC(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x80)
+#undef IN6_IS_ADDR_IPX
+#define IN6_IS_ADDR_IPX(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x04)
+#undef IN6_IS_ADDR_LINKLOCAL
+#define IN6_IS_ADDR_LINKLOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0x80FE)
+#undef IN6_IS_ADDR_MULTICAST
+#define IN6_IS_ADDR_MULTICAST(a) (((a)->S6_un.S6_l[0] & 0xFF) == 0xFF)
+#undef IN6_IS_ADDR_NSAP
+#define IN6_IS_ADDR_NSAP(a) (((a)->S6_un.S6_l[0] & 0xFE) == 0x02)
+#undef IN6_IS_ADDR_PROVIDER
+#define IN6_IS_ADDR_PROVIDER(a) (((a)->S6_un.S6_l[0] & 0xE0) == 0x40)
+#undef IN6_IS_ADDR_SITELOCAL
+#define IN6_IS_ADDR_SITELOCAL(a) (((a)->S6_un.S6_l[0] & 0xC0FF) == 0xC0FE)
+#endif /* ISC_PLATFORM_FIXIN6ISADDR */
+
+#ifdef ISC_PLATFORM_NEEDPORTT
+/*%
+ * Ensure type in_port_t is defined.
+ */
+typedef isc_uint16_t in_port_t;
+#endif
+
+#ifndef MSG_TRUNC
+/*%
+ * If this system does not have MSG_TRUNC (as returned from recvmsg())
+ * ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC
+ * faking code in socket.c.
+ */
+#define ISC_PLATFORM_RECVOVERFLOW
+#endif
+
+/*% IP address. */
+#define ISC__IPADDR(x) ((isc_uint32_t)htonl((isc_uint32_t)(x)))
+
+/*% Is IP address multicast? */
+#define ISC_IPADDR_ISMULTICAST(i) \
+ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
+ == ISC__IPADDR(0xe0000000))
+
+#define ISC_IPADDR_ISEXPERIMENTAL(i) \
+ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
+ == ISC__IPADDR(0xf0000000))
+
+/***
+ *** Functions.
+ ***/
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_net_probeipv4(void);
+/*%<
+ * Check if the system's kernel supports IPv4.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS IPv4 is supported.
+ *\li #ISC_R_NOTFOUND IPv4 is not supported.
+ *\li #ISC_R_DISABLED IPv4 is disabled.
+ *\li #ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_net_probeipv6(void);
+/*%<
+ * Check if the system's kernel supports IPv6.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS IPv6 is supported.
+ *\li #ISC_R_NOTFOUND IPv6 is not supported.
+ *\li #ISC_R_DISABLED IPv6 is disabled.
+ *\li #ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_net_probe_ipv6only(void);
+/*%<
+ * Check if the system's kernel supports the IPV6_V6ONLY socket option.
+ *
+ * Returns:
+ *
+ *\li #ISC_R_SUCCESS the option is supported for both TCP and UDP.
+ *\li #ISC_R_NOTFOUND IPv6 itself or the option is not supported.
+ *\li #ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_net_probe_ipv6pktinfo(void);
+/*
+ * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option
+ * for UDP sockets.
+ *
+ * Returns:
+ *
+ * \li #ISC_R_SUCCESS the option is supported.
+ * \li #ISC_R_NOTFOUND IPv6 itself or the option is not supported.
+ * \li #ISC_R_UNEXPECTED
+ */
+
+void
+isc_net_disableipv4(void);
+
+void
+isc_net_disableipv6(void);
+
+void
+isc_net_enableipv4(void);
+
+void
+isc_net_enableipv6(void);
+
+isc_result_t
+isc_net_probeunix(void);
+/*
+ * Returns whether UNIX domain sockets are supported.
+ */
+
+isc_result_t
+isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high);
+/*%<
+ * Returns system's default range of ephemeral UDP ports, if defined.
+ * If the range is not available or unknown, ISC_NET_PORTRANGELOW and
+ * ISC_NET_PORTRANGEHIGH will be returned.
+ *
+ * Requires:
+ *
+ *\li 'low' and 'high' must be non NULL.
+ *
+ * Returns:
+ *
+ *\li *low and *high will be the ports specifying the low and high ends of
+ * the range.
+ */
+
+#ifdef ISC_PLATFORM_NEEDNTOP
+const char *
+isc_net_ntop(int af, const void *src, char *dst, size_t size);
+#define inet_ntop isc_net_ntop
+#endif
+
+#ifdef ISC_PLATFORM_NEEDPTON
+int
+isc_net_pton(int af, const char *src, void *dst);
+#undef inet_pton
+#define inet_pton isc_net_pton
+#endif
+
+int
+isc_net_aton(const char *cp, struct in_addr *addr);
+#undef inet_aton
+#define inet_aton isc_net_aton
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_NET_H */
diff --git a/lib/isc/unix/include/isc/netdb.h b/lib/isc/unix/include/isc/netdb.h
new file mode 100644
index 0000000..ff12a26
--- /dev/null
+++ b/lib/isc/unix/include/isc/netdb.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: netdb.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */
+
+#ifndef ISC_NETDB_H
+#define ISC_NETDB_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file
+ * \brief
+ * Portable netdb.h support.
+ *
+ * This module is responsible for defining the get<x>by<y> APIs.
+ *
+ * MP:
+ *\li No impact.
+ *
+ * Reliability:
+ *\li No anticipated impact.
+ *
+ * Resources:
+ *\li N/A.
+ *
+ * Security:
+ *\li No anticipated impact.
+ *
+ * Standards:
+ *\li BSD API
+ */
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/net.h>
+
+#include <netdb.h>
+
+#endif /* ISC_NETDB_H */
diff --git a/lib/isc/unix/include/isc/offset.h b/lib/isc/unix/include/isc/offset.h
new file mode 100644
index 0000000..8bf3779
--- /dev/null
+++ b/lib/isc/unix/include/isc/offset.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: offset.h,v 1.17 2008/12/01 23:47:45 tbox Exp $ */
+
+#ifndef ISC_OFFSET_H
+#define ISC_OFFSET_H 1
+
+/*! \file
+ * \brief
+ * File offsets are operating-system dependent.
+ */
+#include <limits.h> /* Required for CHAR_BIT. */
+#include <sys/types.h>
+#include <stddef.h> /* For Linux Standard Base. */
+
+typedef off_t isc_offset_t;
+
+/*%
+ * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral
+ * types", so the maximum value is all 1s except for the high bit.
+ * This definition is more complex than it really needs to be because it was
+ * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about
+ * integer overflow. For example, though this is equivalent to just left
+ * shifting 1 to the high bit and then inverting the bits, the SunOS compiler
+ * is unhappy about shifting a positive "1" to negative in a signed integer.
+ */
+#define ISC_OFFSET_MAXIMUM \
+ (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \
+ << (sizeof(off_t) * CHAR_BIT - 1)))
+
+#endif /* ISC_OFFSET_H */
diff --git a/lib/isc/unix/include/isc/stat.h b/lib/isc/unix/include/isc/stat.h
new file mode 100644
index 0000000..b7a7986
--- /dev/null
+++ b/lib/isc/unix/include/isc/stat.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: stat.h,v 1.5 2007/06/19 23:47:19 tbox Exp $ */
+
+#ifndef ISC_STAT_H
+#define ISC_STAT_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*
+ * Portable netdb.h support.
+ *
+ * This module is responsible for defining S_IS??? macros.
+ *
+ * MP:
+ * No impact.
+ *
+ * Reliability:
+ * No anticipated impact.
+ *
+ * Resources:
+ * N/A.
+ *
+ * Security:
+ * No anticipated impact.
+ *
+ */
+
+/***
+ *** Imports.
+ ***/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#endif /* ISC_STAT_H */
diff --git a/lib/isc/unix/include/isc/stdtime.h b/lib/isc/unix/include/isc/stdtime.h
new file mode 100644
index 0000000..c4931bf
--- /dev/null
+++ b/lib/isc/unix/include/isc/stdtime.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_STDTIME_H
+#define ISC_STDTIME_H 1
+
+/*! \file */
+
+#include <isc/lang.h>
+#include <isc/int.h>
+
+/*%
+ * It's public information that 'isc_stdtime_t' is an unsigned integral type.
+ * Applications that want maximum portability should not assume anything
+ * about its size.
+ */
+typedef isc_uint32_t isc_stdtime_t;
+
+/* but this flag helps... */
+#define STDTIME_ON_32BITS 1
+
+/*
+ * isc_stdtime32_t is a 32-bit version of isc_stdtime_t. A variable of this
+ * type should only be used as an opaque integer (e.g.,) to compare two
+ * time values.
+ */
+typedef isc_uint32_t isc_stdtime32_t;
+
+ISC_LANG_BEGINDECLS
+/* */
+void
+isc_stdtime_get(isc_stdtime_t *t);
+/*%<
+ * Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970.
+ *
+ * Requires:
+ *
+ *\li 't' is a valid pointer.
+ */
+
+#define isc_stdtime_convert32(t, t32p) (*(t32p) = t)
+/*
+ * Convert the standard time to its 32-bit version.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_STDTIME_H */
diff --git a/lib/isc/unix/include/isc/strerror.h b/lib/isc/unix/include/isc/strerror.h
new file mode 100644
index 0000000..899043b
--- /dev/null
+++ b/lib/isc/unix/include/isc/strerror.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: strerror.h,v 1.10 2008/12/01 23:47:45 tbox Exp $ */
+
+#ifndef ISC_STRERROR_H
+#define ISC_STRERROR_H
+
+/*! \file */
+
+#include <sys/types.h>
+
+#include <isc/lang.h>
+
+ISC_LANG_BEGINDECLS
+
+/*% String Error Size */
+#define ISC_STRERRORSIZE 128
+
+/*%
+ * Provide a thread safe wrapper to strerror().
+ *
+ * Requires:
+ * 'buf' to be non NULL.
+ */
+void
+isc__strerror(int num, char *buf, size_t bufsize);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_STRERROR_H */
diff --git a/lib/isc/unix/include/isc/syslog.h b/lib/isc/unix/include/isc/syslog.h
new file mode 100644
index 0000000..7e0c88c
--- /dev/null
+++ b/lib/isc/unix/include/isc/syslog.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */
+
+#ifndef ISC_SYSLOG_H
+#define ISC_SYSLOG_H 1
+
+/*! \file */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_syslog_facilityfromstring(const char *str, int *facilityp);
+/*%<
+ * Convert 'str' to the appropriate syslog facility constant.
+ *
+ * Requires:
+ *
+ *\li 'str' is not NULL
+ *\li 'facilityp' is not NULL
+ *
+ * Returns:
+ * \li #ISC_R_SUCCESS
+ * \li #ISC_R_NOTFOUND
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SYSLOG_H */
diff --git a/lib/isc/unix/include/isc/time.h b/lib/isc/unix/include/isc/time.h
new file mode 100644
index 0000000..dc1cef9
--- /dev/null
+++ b/lib/isc/unix/include/isc/time.h
@@ -0,0 +1,334 @@
+/*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: time.h,v 1.40 2009/01/05 23:47:54 tbox Exp $ */
+
+#ifndef ISC_TIME_H
+#define ISC_TIME_H 1
+
+/*! \file */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/***
+ *** Intervals
+ ***/
+
+/*!
+ * \brief
+ * The contents of this structure are private, and MUST NOT be accessed
+ * directly by callers.
+ *
+ * The contents are exposed only to allow callers to avoid dynamic allocation.
+ */
+struct isc_interval {
+ unsigned int seconds;
+ unsigned int nanoseconds;
+};
+
+extern isc_interval_t *isc_interval_zero;
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_interval_set(isc_interval_t *i,
+ unsigned int seconds, unsigned int nanoseconds);
+/*%<
+ * Set 'i' to a value representing an interval of 'seconds' seconds and
+ * 'nanoseconds' nanoseconds, suitable for use in isc_time_add() and
+ * isc_time_subtract().
+ *
+ * Requires:
+ *
+ *\li 't' is a valid pointer.
+ *\li nanoseconds < 1000000000.
+ */
+
+isc_boolean_t
+isc_interval_iszero(const isc_interval_t *i);
+/*%<
+ * Returns ISC_TRUE iff. 'i' is the zero interval.
+ *
+ * Requires:
+ *
+ *\li 'i' is a valid pointer.
+ */
+
+/***
+ *** Absolute Times
+ ***/
+
+/*%
+ * The contents of this structure are private, and MUST NOT be accessed
+ * directly by callers.
+ *
+ * The contents are exposed only to allow callers to avoid dynamic allocation.
+ */
+
+struct isc_time {
+ unsigned int seconds;
+ unsigned int nanoseconds;
+};
+
+extern isc_time_t *isc_time_epoch;
+
+void
+isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds);
+/*%<
+ * Set 't' to a value which represents the given number of seconds and
+ * nanoseconds since 00:00:00 January 1, 1970, UTC.
+ *
+ * Notes:
+ *\li The Unix version of this call is equivalent to:
+ *\code
+ * isc_time_settoepoch(t);
+ * isc_interval_set(i, seconds, nanoseconds);
+ * isc_time_add(t, i, t);
+ *\endcode
+ *
+ * Requires:
+ *\li 't' is a valid pointer.
+ *\li nanoseconds < 1000000000.
+ */
+
+void
+isc_time_settoepoch(isc_time_t *t);
+/*%<
+ * Set 't' to the time of the epoch.
+ *
+ * Notes:
+ *\li The date of the epoch is platform-dependent.
+ *
+ * Requires:
+ *
+ *\li 't' is a valid pointer.
+ */
+
+isc_boolean_t
+isc_time_isepoch(const isc_time_t *t);
+/*%<
+ * Returns ISC_TRUE iff. 't' is the epoch ("time zero").
+ *
+ * Requires:
+ *
+ *\li 't' is a valid pointer.
+ */
+
+isc_result_t
+isc_time_now(isc_time_t *t);
+/*%<
+ * Set 't' to the current absolute time.
+ *
+ * Requires:
+ *
+ *\li 't' is a valid pointer.
+ *
+ * Returns:
+ *
+ *\li Success
+ *\li Unexpected error
+ * Getting the time from the system failed.
+ *\li Out of range
+ * The time from the system is too large to be represented
+ * in the current definition of isc_time_t.
+ */
+
+isc_result_t
+isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i);
+/*%<
+ * Set *t to the current absolute time + i.
+ *
+ * Note:
+ *\li This call is equivalent to:
+ *
+ *\code
+ * isc_time_now(t);
+ * isc_time_add(t, i, t);
+ *\endcode
+ *
+ * Requires:
+ *
+ *\li 't' and 'i' are valid pointers.
+ *
+ * Returns:
+ *
+ *\li Success
+ *\li Unexpected error
+ * Getting the time from the system failed.
+ *\li Out of range
+ * The interval added to the time from the system is too large to
+ * be represented in the current definition of isc_time_t.
+ */
+
+int
+isc_time_compare(const isc_time_t *t1, const isc_time_t *t2);
+/*%<
+ * Compare the times referenced by 't1' and 't2'
+ *
+ * Requires:
+ *
+ *\li 't1' and 't2' are valid pointers.
+ *
+ * Returns:
+ *
+ *\li -1 t1 < t2 (comparing times, not pointers)
+ *\li 0 t1 = t2
+ *\li 1 t1 > t2
+ */
+
+isc_result_t
+isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result);
+/*%<
+ * Add 'i' to 't', storing the result in 'result'.
+ *
+ * Requires:
+ *
+ *\li 't', 'i', and 'result' are valid pointers.
+ *
+ * Returns:
+ *\li Success
+ *\li Out of range
+ * The interval added to the time is too large to
+ * be represented in the current definition of isc_time_t.
+ */
+
+isc_result_t
+isc_time_subtract(const isc_time_t *t, const isc_interval_t *i,
+ isc_time_t *result);
+/*%<
+ * Subtract 'i' from 't', storing the result in 'result'.
+ *
+ * Requires:
+ *
+ *\li 't', 'i', and 'result' are valid pointers.
+ *
+ * Returns:
+ *\li Success
+ *\li Out of range
+ * The interval is larger than the time since the epoch.
+ */
+
+isc_uint64_t
+isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2);
+/*%<
+ * Find the difference in microseconds between time t1 and time t2.
+ * t2 is the subtrahend of t1; ie, difference = t1 - t2.
+ *
+ * Requires:
+ *
+ *\li 't1' and 't2' are valid pointers.
+ *
+ * Returns:
+ *\li The difference of t1 - t2, or 0 if t1 <= t2.
+ */
+
+isc_uint32_t
+isc_time_seconds(const isc_time_t *t);
+/*%<
+ * Return the number of seconds since the epoch stored in a time structure.
+ *
+ * Requires:
+ *
+ *\li 't' is a valid pointer.
+ */
+
+isc_result_t
+isc_time_secondsastimet(const isc_time_t *t, time_t *secondsp);
+/*%<
+ * Ensure the number of seconds in an isc_time_t is representable by a time_t.
+ *
+ * Notes:
+ *\li The number of seconds stored in an isc_time_t might be larger
+ * than the number of seconds a time_t is able to handle. Since
+ * time_t is mostly opaque according to the ANSI/ISO standard
+ * (essentially, all you can be sure of is that it is an arithmetic type,
+ * not even necessarily integral), it can be tricky to ensure that
+ * the isc_time_t is in the range a time_t can handle. Use this
+ * function in place of isc_time_seconds() any time you need to set a
+ * time_t from an isc_time_t.
+ *
+ * Requires:
+ *\li 't' is a valid pointer.
+ *
+ * Returns:
+ *\li Success
+ *\li Out of range
+ */
+
+isc_uint32_t
+isc_time_nanoseconds(const isc_time_t *t);
+/*%<
+ * Return the number of nanoseconds stored in a time structure.
+ *
+ * Notes:
+ *\li This is the number of nanoseconds in excess of the number
+ * of seconds since the epoch; it will always be less than one
+ * full second.
+ *
+ * Requires:
+ *\li 't' is a valid pointer.
+ *
+ * Ensures:
+ *\li The returned value is less than 1*10^9.
+ */
+
+void
+isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len);
+/*%<
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using a format like "30-Aug-2000 04:06:47.997" and the local time zone.
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ *\li 'len' > 0
+ *\li 'buf' points to an array of at least len chars
+ *
+ */
+
+void
+isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len);
+/*%<
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using a format like "Mon, 30 Aug 2000 04:06:47 GMT"
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ *\li 'len' > 0
+ *\li 'buf' points to an array of at least len chars
+ *
+ */
+
+void
+isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len);
+/*%<
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using the ISO8601 format: "yyyy-mm-ddThh:mm:ssZ"
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ *\li 'len' > 0
+ *\li 'buf' points to an array of at least len chars
+ *
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_TIME_H */
diff --git a/lib/isc/unix/interfaceiter.c b/lib/isc/unix/interfaceiter.c
new file mode 100644
index 0000000..c42fa68
--- /dev/null
+++ b/lib/isc/unix/interfaceiter.c
@@ -0,0 +1,327 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: interfaceiter.c,v 1.45 2008/12/01 03:51:47 marka Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h> /* Required for ifiter_ioctl.c. */
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <isc/interfaceiter.h>
+#include <isc/log.h>
+#include <isc/magic.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/net.h>
+#include <isc/print.h>
+#include <isc/result.h>
+#include <isc/strerror.h>
+#include <isc/string.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+/* Must follow <isc/net.h>. */
+#ifdef HAVE_NET_IF6_H
+#include <net/if6.h>
+#endif
+#include <net/if.h>
+
+#ifdef HAVE_LINUX_IF_ADDR_H
+# include <linux/if_addr.h>
+#endif
+
+/* Common utility functions */
+
+/*%
+ * Extract the network address part from a "struct sockaddr".
+ * \brief
+ * The address family is given explicitly
+ * instead of using src->sa_family, because the latter does not work
+ * for copying a network mask obtained by SIOCGIFNETMASK (it does
+ * not have a valid address family).
+ */
+
+static void
+get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
+ char *ifname)
+{
+ struct sockaddr_in6 *sa6;
+
+#if !defined(ISC_PLATFORM_HAVEIFNAMETOINDEX) || \
+ !defined(ISC_PLATFORM_HAVESCOPEID)
+ UNUSED(ifname);
+#endif
+
+ /* clear any remaining value for safety */
+ memset(dst, 0, sizeof(*dst));
+
+ dst->family = family;
+ switch (family) {
+ case AF_INET:
+ memcpy(&dst->type.in,
+ &((struct sockaddr_in *)(void *)src)->sin_addr,
+ sizeof(struct in_addr));
+ break;
+ case AF_INET6:
+ sa6 = (struct sockaddr_in6 *)(void *)src;
+ memcpy(&dst->type.in6, &sa6->sin6_addr,
+ sizeof(struct in6_addr));
+#ifdef ISC_PLATFORM_HAVESCOPEID
+ if (sa6->sin6_scope_id != 0)
+ isc_netaddr_setzone(dst, sa6->sin6_scope_id);
+ else {
+ /*
+ * BSD variants embed scope zone IDs in the 128bit
+ * address as a kernel internal form. Unfortunately,
+ * the embedded IDs are not hidden from applications
+ * when getting access to them by sysctl or ioctl.
+ * We convert the internal format to the pure address
+ * part and the zone ID part.
+ * Since multicast addresses should not appear here
+ * and they cannot be distinguished from netmasks,
+ * we only consider unicast link-local addresses.
+ */
+ if (IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr)) {
+ isc_uint16_t zone16;
+
+ memcpy(&zone16, &sa6->sin6_addr.s6_addr[2],
+ sizeof(zone16));
+ zone16 = ntohs(zone16);
+ if (zone16 != 0) {
+ /* the zone ID is embedded */
+ isc_netaddr_setzone(dst,
+ (isc_uint32_t)zone16);
+ dst->type.in6.s6_addr[2] = 0;
+ dst->type.in6.s6_addr[3] = 0;
+#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+ } else if (ifname != NULL) {
+ unsigned int zone;
+
+ /*
+ * sin6_scope_id is still not provided,
+ * but the corresponding interface name
+ * is know. Use the interface ID as
+ * the link ID.
+ */
+ zone = if_nametoindex(ifname);
+ if (zone != 0) {
+ isc_netaddr_setzone(dst,
+ (isc_uint32_t)zone);
+ }
+#endif
+ }
+ }
+ }
+#endif
+ break;
+ default:
+ INSIST(0);
+ break;
+ }
+}
+
+/*
+ * Include system-dependent code.
+ */
+
+#ifdef __linux
+#define ISC_IF_INET6_SZ \
+ sizeof("00000000000000000000000000000001 01 80 10 80 XXXXXXloXXXXXXXX\n")
+static isc_result_t linux_if_inet6_next(isc_interfaceiter_t *);
+static isc_result_t linux_if_inet6_current(isc_interfaceiter_t *);
+static void linux_if_inet6_first(isc_interfaceiter_t *iter);
+#endif
+
+#if HAVE_GETIFADDRS
+#include "ifiter_getifaddrs.c"
+#elif HAVE_IFLIST_SYSCTL
+#include "ifiter_sysctl.c"
+#else
+#include "ifiter_ioctl.c"
+#endif
+
+#ifdef __linux
+static void
+linux_if_inet6_first(isc_interfaceiter_t *iter) {
+ if (iter->proc != NULL) {
+ rewind(iter->proc);
+ (void)linux_if_inet6_next(iter);
+ } else
+ iter->valid = ISC_R_NOMORE;
+}
+
+static isc_result_t
+linux_if_inet6_next(isc_interfaceiter_t *iter) {
+ if (iter->proc != NULL &&
+ fgets(iter->entry, sizeof(iter->entry), iter->proc) != NULL)
+ iter->valid = ISC_R_SUCCESS;
+ else
+ iter->valid = ISC_R_NOMORE;
+ return (iter->valid);
+}
+
+static isc_result_t
+linux_if_inet6_current(isc_interfaceiter_t *iter) {
+ char address[33];
+ char name[IF_NAMESIZE+1];
+ struct in6_addr addr6;
+ unsigned int ifindex;
+ int prefix, scope, flags;
+ int res;
+ unsigned int i;
+
+ if (iter->valid != ISC_R_SUCCESS)
+ return (iter->valid);
+ if (iter->proc == NULL) {
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR,
+ "/proc/net/if_inet6:iter->proc == NULL");
+ return (ISC_R_FAILURE);
+ }
+
+ res = sscanf(iter->entry, "%32[a-f0-9] %x %x %x %x %16s\n",
+ address, &ifindex, &prefix, &scope, &flags, name);
+ if (res != 6) {
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR,
+ "/proc/net/if_inet6:sscanf() -> %d (expected 6)",
+ res);
+ return (ISC_R_FAILURE);
+ }
+ if (strlen(address) != 32) {
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR,
+ "/proc/net/if_inet6:strlen(%s) != 32", address);
+ return (ISC_R_FAILURE);
+ }
+ /*
+ ** Ignore DAD addresses --
+ ** we can't bind to them until they are resolved
+ */
+#ifdef IFA_F_TENTATIVE
+ if (flags & IFA_F_TENTATIVE)
+ return (ISC_R_IGNORE);
+#endif
+
+ for (i = 0; i < 16; i++) {
+ unsigned char byte;
+ static const char hex[] = "0123456789abcdef";
+ byte = ((strchr(hex, address[i * 2]) - hex) << 4) |
+ (strchr(hex, address[i * 2 + 1]) - hex);
+ addr6.s6_addr[i] = byte;
+ }
+ iter->current.af = AF_INET6;
+ iter->current.flags = INTERFACE_F_UP;
+ isc_netaddr_fromin6(&iter->current.address, &addr6);
+ iter->current.ifindex = ifindex;
+ if (isc_netaddr_islinklocal(&iter->current.address)) {
+ isc_netaddr_setzone(&iter->current.address,
+ (isc_uint32_t)ifindex);
+ }
+ for (i = 0; i < 16; i++) {
+ if (prefix > 8) {
+ addr6.s6_addr[i] = 0xff;
+ prefix -= 8;
+ } else {
+ addr6.s6_addr[i] = (0xff << (8 - prefix)) & 0xff;
+ prefix = 0;
+ }
+ }
+ isc_netaddr_fromin6(&iter->current.netmask, &addr6);
+ strncpy(iter->current.name, name, sizeof(iter->current.name));
+ return (ISC_R_SUCCESS);
+}
+#endif
+
+/*
+ * The remaining code is common to the sysctl and ioctl case.
+ */
+
+isc_result_t
+isc_interfaceiter_current(isc_interfaceiter_t *iter,
+ isc_interface_t *ifdata)
+{
+ REQUIRE(iter->result == ISC_R_SUCCESS);
+ memcpy(ifdata, &iter->current, sizeof(*ifdata));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_interfaceiter_first(isc_interfaceiter_t *iter) {
+ isc_result_t result;
+
+ REQUIRE(VALID_IFITER(iter));
+
+ internal_first(iter);
+ for (;;) {
+ result = internal_current(iter);
+ if (result != ISC_R_IGNORE)
+ break;
+ result = internal_next(iter);
+ if (result != ISC_R_SUCCESS)
+ break;
+ }
+ iter->result = result;
+ return (result);
+}
+
+isc_result_t
+isc_interfaceiter_next(isc_interfaceiter_t *iter) {
+ isc_result_t result;
+
+ REQUIRE(VALID_IFITER(iter));
+ REQUIRE(iter->result == ISC_R_SUCCESS);
+
+ for (;;) {
+ result = internal_next(iter);
+ if (result != ISC_R_SUCCESS)
+ break;
+ result = internal_current(iter);
+ if (result != ISC_R_IGNORE)
+ break;
+ }
+ iter->result = result;
+ return (result);
+}
+
+void
+isc_interfaceiter_destroy(isc_interfaceiter_t **iterp)
+{
+ isc_interfaceiter_t *iter;
+ REQUIRE(iterp != NULL);
+ iter = *iterp;
+ REQUIRE(VALID_IFITER(iter));
+
+ internal_destroy(iter);
+ if (iter->buf != NULL)
+ isc_mem_put(iter->mctx, iter->buf, iter->bufsize);
+
+ iter->magic = 0;
+ isc_mem_put(iter->mctx, iter, sizeof(*iter));
+ *iterp = NULL;
+}
diff --git a/lib/isc/unix/ipv6.c b/lib/isc/unix/ipv6.c
new file mode 100644
index 0000000..61e984f
--- /dev/null
+++ b/lib/isc/unix/ipv6.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ipv6.c,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <isc/ipv6.h>
+
+const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
diff --git a/lib/isc/unix/keyboard.c b/lib/isc/unix/keyboard.c
new file mode 100644
index 0000000..8ee62d3
--- /dev/null
+++ b/lib/isc/unix/keyboard.c
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: keyboard.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+
+#include <config.h>
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <isc/keyboard.h>
+#include <isc/util.h>
+
+isc_result_t
+isc_keyboard_open(isc_keyboard_t *keyboard) {
+ int fd;
+ isc_result_t ret;
+ struct termios current_mode;
+
+ REQUIRE(keyboard != NULL);
+
+ fd = open("/dev/tty", O_RDONLY, 0);
+ if (fd < 0)
+ return (ISC_R_IOERROR);
+
+ keyboard->fd = fd;
+
+ if (tcgetattr(fd, &keyboard->saved_mode) < 0) {
+ ret = ISC_R_IOERROR;
+ goto errout;
+ }
+
+ current_mode = keyboard->saved_mode;
+
+ current_mode.c_iflag &=
+ ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+ current_mode.c_oflag &= ~OPOST;
+ current_mode.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+ current_mode.c_cflag &= ~(CSIZE|PARENB);
+ current_mode.c_cflag |= CS8;
+
+ current_mode.c_cc[VMIN] = 1;
+ current_mode.c_cc[VTIME] = 0;
+ if (tcsetattr(fd, TCSAFLUSH, &current_mode) < 0) {
+ ret = ISC_R_IOERROR;
+ goto errout;
+ }
+
+ keyboard->result = ISC_R_SUCCESS;
+
+ return (ISC_R_SUCCESS);
+
+ errout:
+ close (fd);
+
+ return (ret);
+}
+
+isc_result_t
+isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleeptime) {
+ REQUIRE(keyboard != NULL);
+
+ if (sleeptime > 0 && keyboard->result != ISC_R_CANCELED)
+ (void)sleep(sleeptime);
+
+ (void)tcsetattr(keyboard->fd, TCSAFLUSH, &keyboard->saved_mode);
+ (void)close(keyboard->fd);
+
+ keyboard->fd = -1;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp) {
+ ssize_t cc;
+ unsigned char c;
+ cc_t *controlchars;
+
+ REQUIRE(keyboard != NULL);
+ REQUIRE(cp != NULL);
+
+ cc = read(keyboard->fd, &c, 1);
+ if (cc < 0) {
+ keyboard->result = ISC_R_IOERROR;
+ return (keyboard->result);
+ }
+
+ controlchars = keyboard->saved_mode.c_cc;
+ if (c == controlchars[VINTR] || c == controlchars[VQUIT]) {
+ keyboard->result = ISC_R_CANCELED;
+ return (keyboard->result);
+ }
+
+ *cp = c;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_boolean_t
+isc_keyboard_canceled(isc_keyboard_t *keyboard) {
+ return (ISC_TF(keyboard->result == ISC_R_CANCELED));
+}
diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c
new file mode 100644
index 0000000..2ba17d1
--- /dev/null
+++ b/lib/isc/unix/net.c
@@ -0,0 +1,522 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#include <config.h>
+
+#include <sys/types.h>
+
+#if defined(HAVE_SYS_SYSCTL_H)
+#if defined(HAVE_SYS_PARAM_H)
+#include <sys/param.h>
+#endif
+#include <sys/sysctl.h>
+#endif
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <isc/log.h>
+#include <isc/msgs.h>
+#include <isc/net.h>
+#include <isc/once.h>
+#include <isc/strerror.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+/*%
+ * Definitions about UDP port range specification. This is a total mess of
+ * portability variants: some use sysctl (but the sysctl names vary), some use
+ * system-specific interfaces, some have the same interface for IPv4 and IPv6,
+ * some separate them, etc...
+ */
+
+/*%
+ * The last resort defaults: use all non well known port space
+ */
+#ifndef ISC_NET_PORTRANGELOW
+#define ISC_NET_PORTRANGELOW 1024
+#endif /* ISC_NET_PORTRANGELOW */
+#ifndef ISC_NET_PORTRANGEHIGH
+#define ISC_NET_PORTRANGEHIGH 65535
+#endif /* ISC_NET_PORTRANGEHIGH */
+
+#ifdef HAVE_SYSCTLBYNAME
+
+/*%
+ * sysctl variants
+ */
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__)
+#define USE_SYSCTL_PORTRANGE
+#define SYSCTL_V4PORTRANGE_LOW "net.inet.ip.portrange.hifirst"
+#define SYSCTL_V4PORTRANGE_HIGH "net.inet.ip.portrange.hilast"
+#define SYSCTL_V6PORTRANGE_LOW "net.inet.ip.portrange.hifirst"
+#define SYSCTL_V6PORTRANGE_HIGH "net.inet.ip.portrange.hilast"
+#endif
+
+#ifdef __NetBSD__
+#define USE_SYSCTL_PORTRANGE
+#define SYSCTL_V4PORTRANGE_LOW "net.inet.ip.anonportmin"
+#define SYSCTL_V4PORTRANGE_HIGH "net.inet.ip.anonportmax"
+#define SYSCTL_V6PORTRANGE_LOW "net.inet6.ip6.anonportmin"
+#define SYSCTL_V6PORTRANGE_HIGH "net.inet6.ip6.anonportmax"
+#endif
+
+#else /* !HAVE_SYSCTLBYNAME */
+
+#ifdef __OpenBSD__
+#define USE_SYSCTL_PORTRANGE
+#define SYSCTL_V4PORTRANGE_LOW { CTL_NET, PF_INET, IPPROTO_IP, \
+ IPCTL_IPPORT_HIFIRSTAUTO }
+#define SYSCTL_V4PORTRANGE_HIGH { CTL_NET, PF_INET, IPPROTO_IP, \
+ IPCTL_IPPORT_HILASTAUTO }
+/* Same for IPv6 */
+#define SYSCTL_V6PORTRANGE_LOW SYSCTL_V4PORTRANGE_LOW
+#define SYSCTL_V6PORTRANGE_HIGH SYSCTL_V4PORTRANGE_HIGH
+#endif
+
+#endif /* HAVE_SYSCTLBYNAME */
+
+#if defined(ISC_PLATFORM_NEEDIN6ADDRANY)
+const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT;
+#endif
+
+#if defined(ISC_PLATFORM_HAVEIPV6)
+
+# if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
+const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT;
+# endif
+
+# if defined(WANT_IPV6)
+static isc_once_t once_ipv6only = ISC_ONCE_INIT;
+# endif
+
+# if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
+static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT;
+# endif
+#endif /* ISC_PLATFORM_HAVEIPV6 */
+
+static isc_once_t once = ISC_ONCE_INIT;
+
+static isc_result_t ipv4_result = ISC_R_NOTFOUND;
+static isc_result_t ipv6_result = ISC_R_NOTFOUND;
+static isc_result_t unix_result = ISC_R_NOTFOUND;
+static isc_result_t ipv6only_result = ISC_R_NOTFOUND;
+static isc_result_t ipv6pktinfo_result = ISC_R_NOTFOUND;
+
+static isc_result_t
+try_proto(int domain) {
+ int s;
+ isc_result_t result = ISC_R_SUCCESS;
+ char strbuf[ISC_STRERRORSIZE];
+
+ s = socket(domain, SOCK_STREAM, 0);
+ if (s == -1) {
+ switch (errno) {
+#ifdef EAFNOSUPPORT
+ case EAFNOSUPPORT:
+#endif
+#ifdef EPROTONOSUPPORT
+ case EPROTONOSUPPORT:
+#endif
+#ifdef EINVAL
+ case EINVAL:
+#endif
+ return (ISC_R_NOTFOUND);
+ default:
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+ if (domain == PF_INET6) {
+ struct sockaddr_in6 sin6;
+ GETSOCKNAME_SOCKLEN_TYPE len; /* NTP local change */
+
+ /*
+ * Check to see if IPv6 is broken, as is common on Linux.
+ */
+ len = sizeof(sin6);
+ if (getsockname(s, (struct sockaddr *)&sin6, &len) < 0)
+ {
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "retrieving the address of an IPv6 "
+ "socket from the kernel failed.");
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "IPv6 is not supported.");
+ result = ISC_R_NOTFOUND;
+ } else {
+ if (len == sizeof(struct sockaddr_in6))
+ result = ISC_R_SUCCESS;
+ else {
+ isc_log_write(isc_lctx,
+ ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET,
+ ISC_LOG_ERROR,
+ "IPv6 structures in kernel and "
+ "user space do not match.");
+ isc_log_write(isc_lctx,
+ ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET,
+ ISC_LOG_ERROR,
+ "IPv6 is not supported.");
+ result = ISC_R_NOTFOUND;
+ }
+ }
+ }
+#endif
+#endif
+#endif
+
+ (void)close(s);
+
+ return (result);
+}
+
+static void
+initialize_action(void) {
+ ipv4_result = try_proto(PF_INET);
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+ ipv6_result = try_proto(PF_INET6);
+#endif
+#endif
+#endif
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ unix_result = try_proto(PF_UNIX);
+#endif
+}
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_net_probeipv4(void) {
+ initialize();
+ return (ipv4_result);
+}
+
+isc_result_t
+isc_net_probeipv6(void) {
+ initialize();
+ return (ipv6_result);
+}
+
+isc_result_t
+isc_net_probeunix(void) {
+ initialize();
+ return (unix_result);
+}
+
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+static void
+try_ipv6only(void) {
+#ifdef IPV6_V6ONLY
+ int s, on;
+ char strbuf[ISC_STRERRORSIZE];
+#endif
+ isc_result_t result;
+
+ result = isc_net_probeipv6();
+ if (result != ISC_R_SUCCESS) {
+ ipv6only_result = result;
+ return;
+ }
+
+#ifndef IPV6_V6ONLY
+ ipv6only_result = ISC_R_NOTFOUND;
+ return;
+#else
+ /* check for TCP sockets */
+ s = socket(PF_INET6, SOCK_STREAM, 0);
+ if (s == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ ipv6only_result = ISC_R_UNEXPECTED;
+ return;
+ }
+
+ on = 1;
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) {
+ ipv6only_result = ISC_R_NOTFOUND;
+ goto close;
+ }
+
+ close(s);
+
+ /* check for UDP sockets */
+ s = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (s == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ ipv6only_result = ISC_R_UNEXPECTED;
+ return;
+ }
+
+ on = 1;
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) {
+ ipv6only_result = ISC_R_NOTFOUND;
+ goto close;
+ }
+
+ ipv6only_result = ISC_R_SUCCESS;
+
+close:
+ close(s);
+ return;
+#endif /* IPV6_V6ONLY */
+}
+
+static void
+initialize_ipv6only(void) {
+ RUNTIME_CHECK(isc_once_do(&once_ipv6only,
+ try_ipv6only) == ISC_R_SUCCESS);
+}
+
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+static void
+try_ipv6pktinfo(void) {
+ int s, on;
+ char strbuf[ISC_STRERRORSIZE];
+ isc_result_t result;
+ int optname;
+
+ result = isc_net_probeipv6();
+ if (result != ISC_R_SUCCESS) {
+ ipv6pktinfo_result = result;
+ return;
+ }
+
+ /* we only use this for UDP sockets */
+ s = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+ if (s == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ ipv6pktinfo_result = ISC_R_UNEXPECTED;
+ return;
+ }
+
+#ifdef IPV6_RECVPKTINFO
+ optname = IPV6_RECVPKTINFO;
+#else
+ optname = IPV6_PKTINFO;
+#endif
+ on = 1;
+ if (setsockopt(s, IPPROTO_IPV6, optname, &on, sizeof(on)) < 0) {
+ ipv6pktinfo_result = ISC_R_NOTFOUND;
+ goto close;
+ }
+
+ ipv6pktinfo_result = ISC_R_SUCCESS;
+
+close:
+ close(s);
+ return;
+}
+
+static void
+initialize_ipv6pktinfo(void) {
+ RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo,
+ try_ipv6pktinfo) == ISC_R_SUCCESS);
+}
+#endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
+#endif /* WANT_IPV6 */
+#endif /* ISC_PLATFORM_HAVEIPV6 */
+
+isc_result_t
+isc_net_probe_ipv6only(void) {
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+ initialize_ipv6only();
+#else
+ ipv6only_result = ISC_R_NOTFOUND;
+#endif
+#endif
+ return (ipv6only_result);
+}
+
+isc_result_t
+isc_net_probe_ipv6pktinfo(void) {
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+#ifdef WANT_IPV6
+ initialize_ipv6pktinfo();
+#else
+ ipv6pktinfo_result = ISC_R_NOTFOUND;
+#endif
+#endif
+#endif
+ return (ipv6pktinfo_result);
+}
+
+#if defined(USE_SYSCTL_PORTRANGE)
+#if defined(HAVE_SYSCTLBYNAME)
+static isc_result_t
+getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
+ int port_low, port_high;
+ size_t portlen;
+ const char *sysctlname_lowport, *sysctlname_hiport;
+
+ if (af == AF_INET) {
+ sysctlname_lowport = SYSCTL_V4PORTRANGE_LOW;
+ sysctlname_hiport = SYSCTL_V4PORTRANGE_HIGH;
+ } else {
+ sysctlname_lowport = SYSCTL_V6PORTRANGE_LOW;
+ sysctlname_hiport = SYSCTL_V6PORTRANGE_HIGH;
+ }
+ portlen = sizeof(portlen);
+ if (sysctlbyname(sysctlname_lowport, &port_low, &portlen,
+ NULL, 0) < 0) {
+ return (ISC_R_FAILURE);
+ }
+ portlen = sizeof(portlen);
+ if (sysctlbyname(sysctlname_hiport, &port_high, &portlen,
+ NULL, 0) < 0) {
+ return (ISC_R_FAILURE);
+ }
+ if ((port_low & ~0xffff) != 0 || (port_high & ~0xffff) != 0)
+ return (ISC_R_RANGE);
+
+ *low = (in_port_t)port_low;
+ *high = (in_port_t)port_high;
+
+ return (ISC_R_SUCCESS);
+}
+#else /* !HAVE_SYSCTLBYNAME */
+static isc_result_t
+getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
+ int mib_lo4[4] = SYSCTL_V4PORTRANGE_LOW;
+ int mib_hi4[4] = SYSCTL_V4PORTRANGE_HIGH;
+ int mib_lo6[4] = SYSCTL_V6PORTRANGE_LOW;
+ int mib_hi6[4] = SYSCTL_V6PORTRANGE_HIGH;
+ int *mib_lo, *mib_hi, miblen;
+ int port_low, port_high;
+ size_t portlen;
+
+ if (af == AF_INET) {
+ mib_lo = mib_lo4;
+ mib_hi = mib_hi4;
+ miblen = sizeof(mib_lo4) / sizeof(mib_lo4[0]);
+ } else {
+ mib_lo = mib_lo6;
+ mib_hi = mib_hi6;
+ miblen = sizeof(mib_lo6) / sizeof(mib_lo6[0]);
+ }
+
+ portlen = sizeof(portlen);
+ if (sysctl(mib_lo, miblen, &port_low, &portlen, NULL, 0) < 0) {
+ return (ISC_R_FAILURE);
+ }
+
+ portlen = sizeof(portlen);
+ if (sysctl(mib_hi, miblen, &port_high, &portlen, NULL, 0) < 0) {
+ return (ISC_R_FAILURE);
+ }
+
+ if ((port_low & ~0xffff) != 0 || (port_high & ~0xffff) != 0)
+ return (ISC_R_RANGE);
+
+ *low = (in_port_t) port_low;
+ *high = (in_port_t) port_high;
+
+ return (ISC_R_SUCCESS);
+}
+#endif /* HAVE_SYSCTLBYNAME */
+#endif /* USE_SYSCTL_PORTRANGE */
+
+isc_result_t
+isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high) {
+ int result = ISC_R_FAILURE;
+
+ REQUIRE(low != NULL && high != NULL);
+
+#if defined(USE_SYSCTL_PORTRANGE)
+ result = getudpportrange_sysctl(af, low, high);
+#else
+ UNUSED(af);
+#endif
+
+ if (result != ISC_R_SUCCESS) {
+ *low = ISC_NET_PORTRANGELOW;
+ *high = ISC_NET_PORTRANGEHIGH;
+ }
+
+ return (ISC_R_SUCCESS); /* we currently never fail in this function */
+}
+
+void
+isc_net_disableipv4(void) {
+ initialize();
+ if (ipv4_result == ISC_R_SUCCESS)
+ ipv4_result = ISC_R_DISABLED;
+}
+
+void
+isc_net_disableipv6(void) {
+ initialize();
+ if (ipv6_result == ISC_R_SUCCESS)
+ ipv6_result = ISC_R_DISABLED;
+}
+
+void
+isc_net_enableipv4(void) {
+ initialize();
+ if (ipv4_result == ISC_R_DISABLED)
+ ipv4_result = ISC_R_SUCCESS;
+}
+
+void
+isc_net_enableipv6(void) {
+ initialize();
+ if (ipv6_result == ISC_R_DISABLED)
+ ipv6_result = ISC_R_SUCCESS;
+}
diff --git a/lib/isc/unix/os.c b/lib/isc/unix/os.c
new file mode 100644
index 0000000..c050d14
--- /dev/null
+++ b/lib/isc/unix/os.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: os.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+
+#include <config.h>
+
+#include <isc/os.h>
+
+
+#ifdef HAVE_SYSCONF
+
+#include <unistd.h>
+
+#ifndef __hpux
+static inline long
+sysconf_ncpus(void) {
+#if defined(_SC_NPROCESSORS_ONLN)
+ return sysconf((_SC_NPROCESSORS_ONLN));
+#elif defined(_SC_NPROC_ONLN)
+ return sysconf((_SC_NPROC_ONLN));
+#else
+ return (0);
+#endif
+}
+#endif
+#endif /* HAVE_SYSCONF */
+
+
+#ifdef __hpux
+
+#include <sys/pstat.h>
+
+static inline int
+hpux_ncpus(void) {
+ struct pst_dynamic psd;
+ if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) != -1)
+ return (psd.psd_proc_cnt);
+ else
+ return (0);
+}
+
+#endif /* __hpux */
+
+#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME)
+#include <sys/types.h> /* for FreeBSD */
+#include <sys/param.h> /* for NetBSD */
+#include <sys/sysctl.h>
+
+static int
+sysctl_ncpus(void) {
+ int ncpu, result;
+ size_t len;
+
+ len = sizeof(ncpu);
+ result = sysctlbyname("hw.ncpu", &ncpu, &len , 0, 0);
+ if (result != -1)
+ return (ncpu);
+ return (0);
+}
+#endif
+
+unsigned int
+isc_os_ncpus(void) {
+ long ncpus = 0;
+
+#ifdef __hpux
+ ncpus = hpux_ncpus();
+#elif defined(HAVE_SYSCONF)
+ ncpus = sysconf_ncpus();
+#endif
+#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME)
+ if (ncpus <= 0)
+ ncpus = sysctl_ncpus();
+#endif
+ if (ncpus <= 0)
+ ncpus = 1;
+
+ return ((unsigned int)ncpus);
+}
diff --git a/lib/isc/unix/resource.c b/lib/isc/unix/resource.c
new file mode 100644
index 0000000..29596e2
--- /dev/null
+++ b/lib/isc/unix/resource.c
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: resource.c,v 1.23 2009/02/13 23:48:14 tbox Exp $ */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/time.h> /* Required on some systems for <sys/resource.h>. */
+#include <sys/resource.h>
+
+#include <isc/platform.h>
+#include <isc/resource.h>
+#include <isc/result.h>
+#include <isc/util.h>
+
+#ifdef __linux__
+#include <linux/fs.h> /* To get the large NR_OPEN. */
+#endif
+
+#if defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H)
+#include <sys/dyntune.h>
+#endif
+
+#include "errno2result.h"
+
+static isc_result_t
+resource2rlim(isc_resource_t resource, int *rlim_resource) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ switch (resource) {
+ case isc_resource_coresize:
+ *rlim_resource = RLIMIT_CORE;
+ break;
+ case isc_resource_cputime:
+ *rlim_resource = RLIMIT_CPU;
+ break;
+ case isc_resource_datasize:
+ *rlim_resource = RLIMIT_DATA;
+ break;
+ case isc_resource_filesize:
+ *rlim_resource = RLIMIT_FSIZE;
+ break;
+ case isc_resource_lockedmemory:
+#ifdef RLIMIT_MEMLOCK
+ *rlim_resource = RLIMIT_MEMLOCK;
+#else
+ result = ISC_R_NOTIMPLEMENTED;
+#endif
+ break;
+ case isc_resource_openfiles:
+#ifdef RLIMIT_NOFILE
+ *rlim_resource = RLIMIT_NOFILE;
+#else
+ result = ISC_R_NOTIMPLEMENTED;
+#endif
+ break;
+ case isc_resource_processes:
+#ifdef RLIMIT_NPROC
+ *rlim_resource = RLIMIT_NPROC;
+#else
+ result = ISC_R_NOTIMPLEMENTED;
+#endif
+ break;
+ case isc_resource_residentsize:
+#ifdef RLIMIT_RSS
+ *rlim_resource = RLIMIT_RSS;
+#else
+ result = ISC_R_NOTIMPLEMENTED;
+#endif
+ break;
+ case isc_resource_stacksize:
+ *rlim_resource = RLIMIT_STACK;
+ break;
+ default:
+ /*
+ * This test is not very robust if isc_resource_t
+ * changes, but generates a clear assertion message.
+ */
+ REQUIRE(resource >= isc_resource_coresize &&
+ resource <= isc_resource_stacksize);
+
+ result = ISC_R_RANGE;
+ break;
+ }
+
+ return (result);
+}
+
+isc_result_t
+isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) {
+ struct rlimit rl;
+ ISC_PLATFORM_RLIMITTYPE rlim_value;
+ int unixresult;
+ int unixresource;
+ isc_result_t result;
+
+ result = resource2rlim(resource, &unixresource);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ if (value == ISC_RESOURCE_UNLIMITED)
+ rlim_value = RLIM_INFINITY;
+
+ else {
+ /*
+ * isc_resourcevalue_t was chosen as an unsigned 64 bit
+ * integer so that it could contain the maximum range of
+ * reasonable values. Unfortunately, this exceeds the typical
+ * range on Unix systems. Ensure the range of
+ * ISC_PLATFORM_RLIMITTYPE is not overflowed.
+ */
+ isc_resourcevalue_t rlim_max;
+ isc_boolean_t rlim_t_is_signed =
+ ISC_TF(((double)(ISC_PLATFORM_RLIMITTYPE)-1) < 0);
+
+ if (rlim_t_is_signed)
+ rlim_max = ~((ISC_PLATFORM_RLIMITTYPE)1 <<
+ (sizeof(ISC_PLATFORM_RLIMITTYPE) * 8 - 1));
+ else
+ rlim_max = (ISC_PLATFORM_RLIMITTYPE)-1;
+
+ if (value > rlim_max)
+ value = rlim_max;
+
+ rlim_value = value;
+ }
+
+ rl.rlim_cur = rl.rlim_max = rlim_value;
+ unixresult = setrlimit(unixresource, &rl);
+
+ if (unixresult == 0)
+ return (ISC_R_SUCCESS);
+
+#if defined(OPEN_MAX) && defined(__APPLE__)
+ /*
+ * The Darwin kernel doesn't accept RLIM_INFINITY for rlim_cur; the
+ * maximum possible value is OPEN_MAX. BIND8 used to use
+ * sysconf(_SC_OPEN_MAX) for such a case, but this value is much
+ * smaller than OPEN_MAX and is not really effective.
+ */
+ if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
+ rl.rlim_cur = OPEN_MAX;
+ unixresult = setrlimit(unixresource, &rl);
+ if (unixresult == 0)
+ return (ISC_R_SUCCESS);
+ }
+#elif defined(__linux__)
+#ifndef NR_OPEN
+#define NR_OPEN (1024*1024)
+#endif
+
+ /*
+ * Some Linux kernels don't accept RLIM_INFINIT; the maximum
+ * possible value is the NR_OPEN defined in linux/fs.h.
+ */
+ if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
+ rl.rlim_cur = rl.rlim_max = NR_OPEN;
+ unixresult = setrlimit(unixresource, &rl);
+ if (unixresult == 0)
+ return (ISC_R_SUCCESS);
+ }
+#elif defined(__hpux) && defined(HAVE_SYS_DYNTUNE_H)
+ if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
+ uint64_t maxfiles;
+ if (gettune("maxfiles_lim", &maxfiles) == 0) {
+ rl.rlim_cur = rl.rlim_max = maxfiles;
+ unixresult = setrlimit(unixresource, &rl);
+ if (unixresult == 0)
+ return (ISC_R_SUCCESS);
+ }
+ }
+#endif
+ if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
+ if (getrlimit(unixresource, &rl) == 0) {
+ rl.rlim_cur = rl.rlim_max;
+ unixresult = setrlimit(unixresource, &rl);
+ if (unixresult == 0)
+ return (ISC_R_SUCCESS);
+ }
+ }
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value) {
+ int unixresult;
+ int unixresource;
+ struct rlimit rl;
+ isc_result_t result;
+
+ result = resource2rlim(resource, &unixresource);
+ if (result == ISC_R_SUCCESS) {
+ unixresult = getrlimit(unixresource, &rl);
+ INSIST(unixresult == 0);
+ *value = rl.rlim_max;
+ }
+
+ return (result);
+}
+
+isc_result_t
+isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value) {
+ int unixresult;
+ int unixresource;
+ struct rlimit rl;
+ isc_result_t result;
+
+ result = resource2rlim(resource, &unixresource);
+ if (result == ISC_R_SUCCESS) {
+ unixresult = getrlimit(unixresource, &rl);
+ INSIST(unixresult == 0);
+ *value = rl.rlim_cur;
+ }
+
+ return (result);
+}
diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
new file mode 100644
index 0000000..5fed888
--- /dev/null
+++ b/lib/isc/unix/socket.c
@@ -0,0 +1,6011 @@
+/*
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <isc/buffer.h>
+#include <isc/bufferlist.h>
+#include <isc/condition.h>
+#include <isc/formatcheck.h>
+#include <isc/list.h>
+#include <isc/log.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/mutex.h>
+#include <isc/net.h>
+#include <isc/once.h>
+#include <isc/platform.h>
+#include <isc/print.h>
+#include <isc/region.h>
+#include <isc/socket.h>
+#include <isc/stats.h>
+#include <isc/strerror.h>
+#include <isc/task.h>
+#include <isc/thread.h>
+#include <isc/util.h>
+#include <isc/xml.h>
+
+#ifdef ISC_PLATFORM_HAVESYSUNH
+#include <sys/un.h>
+#endif
+#ifdef ISC_PLATFORM_HAVEKQUEUE
+#include <sys/event.h>
+#endif
+#ifdef ISC_PLATFORM_HAVEEPOLL
+#include <sys/epoll.h>
+#endif
+#ifdef ISC_PLATFORM_HAVEDEVPOLL
+#if defined(HAVE_SYS_DEVPOLL_H)
+#include <sys/devpoll.h>
+#elif defined(HAVE_DEVPOLL_H)
+#include <devpoll.h>
+#endif
+#endif
+
+#include "errno2result.h"
+
+/* See task.c about the following definition: */
+#ifdef BIND9
+#ifdef ISC_PLATFORM_USETHREADS
+#define USE_WATCHER_THREAD
+#else
+#define USE_SHARED_MANAGER
+#endif /* ISC_PLATFORM_USETHREADS */
+#endif /* BIND9 */
+
+#ifndef USE_WATCHER_THREAD
+#include "socket_p.h"
+#include "../task_p.h"
+#endif /* USE_WATCHER_THREAD */
+
+#if defined(SO_BSDCOMPAT) && defined(__linux__)
+#include <sys/utsname.h>
+#endif
+
+/*%
+ * Choose the most preferable multiplex method.
+ */
+#ifdef ISC_PLATFORM_HAVEKQUEUE
+#define USE_KQUEUE
+#elif defined (ISC_PLATFORM_HAVEEPOLL)
+#define USE_EPOLL
+#elif defined (ISC_PLATFORM_HAVEDEVPOLL)
+#define USE_DEVPOLL
+typedef struct {
+ unsigned int want_read : 1,
+ want_write : 1;
+} pollinfo_t;
+#else
+#define USE_SELECT
+#endif /* ISC_PLATFORM_HAVEKQUEUE */
+
+#ifndef USE_WATCHER_THREAD
+#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
+struct isc_socketwait {
+ int nevents;
+};
+#elif defined (USE_SELECT)
+struct isc_socketwait {
+ fd_set *readset;
+ fd_set *writeset;
+ int nfds;
+ int maxfd;
+};
+#endif /* USE_KQUEUE */
+#endif /* !USE_WATCHER_THREAD */
+
+/*%
+ * Maximum number of allowable open sockets. This is also the maximum
+ * allowable socket file descriptor.
+ *
+ * Care should be taken before modifying this value for select():
+ * The API standard doesn't ensure select() accept more than (the system default
+ * of) FD_SETSIZE descriptors, and the default size should in fact be fine in
+ * the vast majority of cases. This constant should therefore be increased only
+ * when absolutely necessary and possible, i.e., the server is exhausting all
+ * available file descriptors (up to FD_SETSIZE) and the select() function
+ * and FD_xxx macros support larger values than FD_SETSIZE (which may not
+ * always by true, but we keep using some of them to ensure as much
+ * portability as possible). Note also that overall server performance
+ * may be rather worsened with a larger value of this constant due to
+ * inherent scalability problems of select().
+ *
+ * As a special note, this value shouldn't have to be touched if
+ * this is a build for an authoritative only DNS server.
+ */
+#ifndef ISC_SOCKET_MAXSOCKETS
+#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
+#define ISC_SOCKET_MAXSOCKETS 4096
+#elif defined(USE_SELECT)
+#define ISC_SOCKET_MAXSOCKETS FD_SETSIZE
+#endif /* USE_KQUEUE... */
+#endif /* ISC_SOCKET_MAXSOCKETS */
+
+#ifdef USE_SELECT
+/*%
+ * Mac OS X needs a special definition to support larger values in select().
+ * We always define this because a larger value can be specified run-time.
+ */
+#ifdef __APPLE__
+#define _DARWIN_UNLIMITED_SELECT
+#endif /* __APPLE__ */
+#endif /* USE_SELECT */
+
+#ifdef ISC_SOCKET_USE_POLLWATCH
+/*%
+ * If this macro is defined, enable workaround for a Solaris /dev/poll kernel
+ * bug: DP_POLL ioctl could keep sleeping even if socket I/O is possible for
+ * some of the specified FD. The idea is based on the observation that it's
+ * likely for a busy server to keep receiving packets. It specifically works
+ * as follows: the socket watcher is first initialized with the state of
+ * "poll_idle". While it's in the idle state it keeps sleeping until a socket
+ * event occurs. When it wakes up for a socket I/O event, it moves to the
+ * poll_active state, and sets the poll timeout to a short period
+ * (ISC_SOCKET_POLLWATCH_TIMEOUT msec). If timeout occurs in this state, the
+ * watcher goes to the poll_checking state with the same timeout period.
+ * In this state, the watcher tries to detect whether this is a break
+ * during intermittent events or the kernel bug is triggered. If the next
+ * polling reports an event within the short period, the previous timeout is
+ * likely to be a kernel bug, and so the watcher goes back to the active state.
+ * Otherwise, it moves to the idle state again.
+ *
+ * It's not clear whether this is a thread-related bug, but since we've only
+ * seen this with threads, this workaround is used only when enabling threads.
+ */
+
+typedef enum { poll_idle, poll_active, poll_checking } pollstate_t;
+
+#ifndef ISC_SOCKET_POLLWATCH_TIMEOUT
+#define ISC_SOCKET_POLLWATCH_TIMEOUT 10
+#endif /* ISC_SOCKET_POLLWATCH_TIMEOUT */
+#endif /* ISC_SOCKET_USE_POLLWATCH */
+
+/*%
+ * Size of per-FD lock buckets.
+ */
+#ifdef ISC_PLATFORM_USETHREADS
+#define FDLOCK_COUNT 1024
+#define FDLOCK_ID(fd) ((fd) % FDLOCK_COUNT)
+#else
+#define FDLOCK_COUNT 1
+#define FDLOCK_ID(fd) 0
+#endif /* ISC_PLATFORM_USETHREADS */
+
+/*%
+ * Maximum number of events communicated with the kernel. There should normally
+ * be no need for having a large number.
+ */
+#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
+#ifndef ISC_SOCKET_MAXEVENTS
+#define ISC_SOCKET_MAXEVENTS 64
+#endif
+#endif
+
+/*%
+ * Some systems define the socket length argument as an int, some as size_t,
+ * some as socklen_t. This is here so it can be easily changed if needed.
+ */
+#ifndef ISC_SOCKADDR_LEN_T
+#define ISC_SOCKADDR_LEN_T unsigned int
+#endif
+
+/*%
+ * Define what the possible "soft" errors can be. These are non-fatal returns
+ * of various network related functions, like recv() and so on.
+ *
+ * For some reason, BSDI (and perhaps others) will sometimes return <0
+ * from recv() but will have errno==0. This is broken, but we have to
+ * work around it here.
+ */
+#define SOFT_ERROR(e) ((e) == EAGAIN || \
+ (e) == EWOULDBLOCK || \
+ (e) == EINTR || \
+ (e) == 0)
+
+#define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x)
+
+/*!<
+ * DLVL(90) -- Function entry/exit and other tracing.
+ * DLVL(70) -- Socket "correctness" -- including returning of events, etc.
+ * DLVL(60) -- Socket data send/receive
+ * DLVL(50) -- Event tracing, including receiving/sending completion events.
+ * DLVL(20) -- Socket creation/destruction.
+ */
+#define TRACE_LEVEL 90
+#define CORRECTNESS_LEVEL 70
+#define IOEVENT_LEVEL 60
+#define EVENT_LEVEL 50
+#define CREATION_LEVEL 20
+
+#define TRACE DLVL(TRACE_LEVEL)
+#define CORRECTNESS DLVL(CORRECTNESS_LEVEL)
+#define IOEVENT DLVL(IOEVENT_LEVEL)
+#define EVENT DLVL(EVENT_LEVEL)
+#define CREATION DLVL(CREATION_LEVEL)
+
+typedef isc_event_t intev_t;
+
+#define SOCKET_MAGIC ISC_MAGIC('I', 'O', 'i', 'o')
+#define VALID_SOCKET(s) ISC_MAGIC_VALID(s, SOCKET_MAGIC)
+
+/*!
+ * IPv6 control information. If the socket is an IPv6 socket we want
+ * to collect the destination address and interface so the client can
+ * set them on outgoing packets.
+ */
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+#ifndef USE_CMSG
+#define USE_CMSG 1
+#endif
+#endif
+
+/*%
+ * NetBSD and FreeBSD can timestamp packets. XXXMLG Should we have
+ * a setsockopt() like interface to request timestamps, and if the OS
+ * doesn't do it for us, call gettimeofday() on every UDP receive?
+ */
+#ifdef SO_TIMESTAMP
+#ifndef USE_CMSG
+#define USE_CMSG 1
+#endif
+#endif
+
+/*%
+ * The size to raise the receive buffer to (from BIND 8).
+ */
+#define RCVBUFSIZE (32*1024)
+
+/*%
+ * The number of times a send operation is repeated if the result is EINTR.
+ */
+#define NRETRIES 10
+
+typedef struct isc__socket isc__socket_t;
+typedef struct isc__socketmgr isc__socketmgr_t;
+
+#define NEWCONNSOCK(ev) ((isc__socket_t *)(ev)->newsocket)
+
+struct isc__socket {
+ /* Not locked. */
+ isc_socket_t common;
+ isc__socketmgr_t *manager;
+ isc_mutex_t lock;
+ isc_sockettype_t type;
+ const isc_statscounter_t *statsindex;
+
+ /* Locked by socket lock. */
+ ISC_LINK(isc__socket_t) link;
+ unsigned int references;
+ int fd;
+ int pf;
+ char name[16];
+ void * tag;
+
+ ISC_LIST(isc_socketevent_t) send_list;
+ ISC_LIST(isc_socketevent_t) recv_list;
+ ISC_LIST(isc_socket_newconnev_t) accept_list;
+ isc_socket_connev_t *connect_ev;
+
+ /*
+ * Internal events. Posted when a descriptor is readable or
+ * writable. These are statically allocated and never freed.
+ * They will be set to non-purgable before use.
+ */
+ intev_t readable_ev;
+ intev_t writable_ev;
+
+ isc_sockaddr_t peer_address; /* remote address */
+
+ unsigned int pending_recv : 1,
+ pending_send : 1,
+ pending_accept : 1,
+ listener : 1, /* listener socket */
+ connected : 1,
+ connecting : 1, /* connect pending */
+ bound : 1, /* bound to local addr */
+ dupped : 1;
+
+#ifdef ISC_NET_RECVOVERFLOW
+ unsigned char overflow; /* used for MSG_TRUNC fake */
+#endif
+
+ char *recvcmsgbuf;
+ ISC_SOCKADDR_LEN_T recvcmsgbuflen;
+ char *sendcmsgbuf;
+ ISC_SOCKADDR_LEN_T sendcmsgbuflen;
+
+ void *fdwatcharg;
+ isc_sockfdwatch_t fdwatchcb;
+ int fdwatchflags;
+ isc_task_t *fdwatchtask;
+};
+
+#define SOCKET_MANAGER_MAGIC ISC_MAGIC('I', 'O', 'm', 'g')
+#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, SOCKET_MANAGER_MAGIC)
+
+struct isc__socketmgr {
+ /* Not locked. */
+ isc_socketmgr_t common;
+ isc_mem_t *mctx;
+ isc_mutex_t lock;
+ isc_mutex_t *fdlock;
+ isc_stats_t *stats;
+#ifdef USE_KQUEUE
+ int kqueue_fd;
+ int nevents;
+ struct kevent *events;
+#endif /* USE_KQUEUE */
+#ifdef USE_EPOLL
+ int epoll_fd;
+ int nevents;
+ struct epoll_event *events;
+#endif /* USE_EPOLL */
+#ifdef USE_DEVPOLL
+ int devpoll_fd;
+ int nevents;
+ struct pollfd *events;
+#endif /* USE_DEVPOLL */
+#ifdef USE_SELECT
+ int fd_bufsize;
+#endif /* USE_SELECT */
+ unsigned int maxsocks;
+#ifdef ISC_PLATFORM_USETHREADS
+ int pipe_fds[2];
+#endif
+
+ /* Locked by fdlock. */
+ isc__socket_t **fds;
+ int *fdstate;
+#ifdef USE_DEVPOLL
+ pollinfo_t *fdpollinfo;
+#endif
+
+ /* Locked by manager lock. */
+ ISC_LIST(isc__socket_t) socklist;
+#ifdef USE_SELECT
+ fd_set *read_fds;
+ fd_set *read_fds_copy;
+ fd_set *write_fds;
+ fd_set *write_fds_copy;
+ int maxfd;
+#endif /* USE_SELECT */
+ int reserved; /* unlocked */
+#ifdef USE_WATCHER_THREAD
+ isc_thread_t watcher;
+ isc_condition_t shutdown_ok;
+#else /* USE_WATCHER_THREAD */
+ unsigned int refs;
+#endif /* USE_WATCHER_THREAD */
+ int maxudp;
+};
+
+#ifdef USE_SHARED_MANAGER
+static isc__socketmgr_t *socketmgr = NULL;
+#endif /* USE_SHARED_MANAGER */
+
+#define CLOSED 0 /* this one must be zero */
+#define MANAGED 1
+#define CLOSE_PENDING 2
+
+/*
+ * send() and recv() iovec counts
+ */
+#define MAXSCATTERGATHER_SEND (ISC_SOCKET_MAXSCATTERGATHER)
+#ifdef ISC_NET_RECVOVERFLOW
+# define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER + 1)
+#else
+# define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER)
+#endif
+
+static isc_result_t socket_create(isc_socketmgr_t *manager0, int pf,
+ isc_sockettype_t type,
+ isc_socket_t **socketp,
+ isc_socket_t *dup_socket);
+static void send_recvdone_event(isc__socket_t *, isc_socketevent_t **);
+static void send_senddone_event(isc__socket_t *, isc_socketevent_t **);
+static void free_socket(isc__socket_t **);
+static isc_result_t allocate_socket(isc__socketmgr_t *, isc_sockettype_t,
+ isc__socket_t **);
+static void destroy(isc__socket_t **);
+static void internal_accept(isc_task_t *, isc_event_t *);
+static void internal_connect(isc_task_t *, isc_event_t *);
+static void internal_recv(isc_task_t *, isc_event_t *);
+static void internal_send(isc_task_t *, isc_event_t *);
+static void internal_fdwatch_write(isc_task_t *, isc_event_t *);
+static void internal_fdwatch_read(isc_task_t *, isc_event_t *);
+static void process_cmsg(isc__socket_t *, struct msghdr *, isc_socketevent_t *);
+static void build_msghdr_send(isc__socket_t *, isc_socketevent_t *,
+ struct msghdr *, struct iovec *, size_t *);
+static void build_msghdr_recv(isc__socket_t *, isc_socketevent_t *,
+ struct msghdr *, struct iovec *, size_t *);
+#ifdef USE_WATCHER_THREAD
+static isc_boolean_t process_ctlfd(isc__socketmgr_t *manager);
+#endif
+
+/*%
+ * The following can be either static or public, depending on build environment.
+ */
+
+#ifdef BIND9
+#define ISC_SOCKETFUNC_SCOPE
+#else
+#define ISC_SOCKETFUNC_SCOPE static
+#endif
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
+ isc_socket_t **socketp);
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_attach(isc_socket_t *sock, isc_socket_t **socketp);
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_detach(isc_socket_t **socketp);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
+ unsigned int maxsocks);
+ISC_SOCKETFUNC_SCOPE void
+isc__socketmgr_destroy(isc_socketmgr_t **managerp);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_recv(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_recv2(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_socketevent_t *event, unsigned int flags);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_send(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendto(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendto2(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
+ isc_socketevent_t *event, unsigned int flags);
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
+ isc_uint32_t owner, isc_uint32_t group);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
+ unsigned int options);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_filter(isc_socket_t *sock, const char *filter);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_listen(isc_socket_t *sock, unsigned int backlog);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_accept(isc_socket_t *sock,
+ isc_task_t *task, isc_taskaction_t action, const void *arg);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
+ isc_task_t *task, isc_taskaction_t action,
+ const void *arg);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp);
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how);
+ISC_SOCKETFUNC_SCOPE isc_sockettype_t
+isc__socket_gettype(isc_socket_t *sock);
+ISC_SOCKETFUNC_SCOPE isc_boolean_t
+isc__socket_isbound(isc_socket_t *sock);
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes);
+#if defined(HAVE_LIBXML2) && defined(BIND9)
+ISC_SOCKETFUNC_SCOPE void
+isc__socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer);
+#endif
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_fdwatchcreate(isc_socketmgr_t *manager, int fd, int flags,
+ isc_sockfdwatch_t callback, void *cbarg,
+ isc_task_t *task, isc_socket_t **socketp);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_fdwatchpoke(isc_socket_t *sock, int flags);
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp);
+ISC_SOCKETFUNC_SCOPE int
+isc__socket_getfd(isc_socket_t *sock);
+
+static struct {
+ isc_socketmethods_t methods;
+
+ /*%
+ * The following are defined just for avoiding unused static functions.
+ */
+#ifndef BIND9
+ void *recvv, *send, *sendv, *sendto2, *cleanunix, *permunix, *filter,
+ *listen, *accept, *getpeername, *isbound;
+#endif
+} socketmethods = {
+ {
+ isc__socket_attach,
+ isc__socket_detach,
+ isc__socket_bind,
+ isc__socket_sendto,
+ isc__socket_connect,
+ isc__socket_recv,
+ isc__socket_cancel,
+ isc__socket_getsockname,
+ isc__socket_gettype,
+ isc__socket_ipv6only,
+ isc__socket_fdwatchpoke,
+ isc__socket_dup,
+ isc__socket_getfd
+ }
+#ifndef BIND9
+ ,
+ (void *)isc__socket_recvv, (void *)isc__socket_send,
+ (void *)isc__socket_sendv, (void *)isc__socket_sendto2,
+ (void *)isc__socket_cleanunix, (void *)isc__socket_permunix,
+ (void *)isc__socket_filter, (void *)isc__socket_listen,
+ (void *)isc__socket_accept, (void *)isc__socket_getpeername,
+ (void *)isc__socket_isbound
+#endif
+};
+
+static isc_socketmgrmethods_t socketmgrmethods = {
+ isc__socketmgr_destroy,
+ isc__socket_create,
+ isc__socket_fdwatchcreate
+};
+
+#define SELECT_POKE_SHUTDOWN (-1)
+#define SELECT_POKE_NOTHING (-2)
+#define SELECT_POKE_READ (-3)
+#define SELECT_POKE_ACCEPT (-3) /*%< Same as _READ */
+#define SELECT_POKE_WRITE (-4)
+#define SELECT_POKE_CONNECT (-4) /*%< Same as _WRITE */
+#define SELECT_POKE_CLOSE (-5)
+
+#define SOCK_DEAD(s) ((s)->references == 0)
+
+/*%
+ * Shortcut index arrays to get access to statistics counters.
+ */
+enum {
+ STATID_OPEN = 0,
+ STATID_OPENFAIL = 1,
+ STATID_CLOSE = 2,
+ STATID_BINDFAIL = 3,
+ STATID_CONNECTFAIL = 4,
+ STATID_CONNECT = 5,
+ STATID_ACCEPTFAIL = 6,
+ STATID_ACCEPT = 7,
+ STATID_SENDFAIL = 8,
+ STATID_RECVFAIL = 9
+};
+static const isc_statscounter_t upd4statsindex[] = {
+ isc_sockstatscounter_udp4open,
+ isc_sockstatscounter_udp4openfail,
+ isc_sockstatscounter_udp4close,
+ isc_sockstatscounter_udp4bindfail,
+ isc_sockstatscounter_udp4connectfail,
+ isc_sockstatscounter_udp4connect,
+ -1,
+ -1,
+ isc_sockstatscounter_udp4sendfail,
+ isc_sockstatscounter_udp4recvfail
+};
+static const isc_statscounter_t upd6statsindex[] = {
+ isc_sockstatscounter_udp6open,
+ isc_sockstatscounter_udp6openfail,
+ isc_sockstatscounter_udp6close,
+ isc_sockstatscounter_udp6bindfail,
+ isc_sockstatscounter_udp6connectfail,
+ isc_sockstatscounter_udp6connect,
+ -1,
+ -1,
+ isc_sockstatscounter_udp6sendfail,
+ isc_sockstatscounter_udp6recvfail
+};
+static const isc_statscounter_t tcp4statsindex[] = {
+ isc_sockstatscounter_tcp4open,
+ isc_sockstatscounter_tcp4openfail,
+ isc_sockstatscounter_tcp4close,
+ isc_sockstatscounter_tcp4bindfail,
+ isc_sockstatscounter_tcp4connectfail,
+ isc_sockstatscounter_tcp4connect,
+ isc_sockstatscounter_tcp4acceptfail,
+ isc_sockstatscounter_tcp4accept,
+ isc_sockstatscounter_tcp4sendfail,
+ isc_sockstatscounter_tcp4recvfail
+};
+static const isc_statscounter_t tcp6statsindex[] = {
+ isc_sockstatscounter_tcp6open,
+ isc_sockstatscounter_tcp6openfail,
+ isc_sockstatscounter_tcp6close,
+ isc_sockstatscounter_tcp6bindfail,
+ isc_sockstatscounter_tcp6connectfail,
+ isc_sockstatscounter_tcp6connect,
+ isc_sockstatscounter_tcp6acceptfail,
+ isc_sockstatscounter_tcp6accept,
+ isc_sockstatscounter_tcp6sendfail,
+ isc_sockstatscounter_tcp6recvfail
+};
+static const isc_statscounter_t unixstatsindex[] = {
+ isc_sockstatscounter_unixopen,
+ isc_sockstatscounter_unixopenfail,
+ isc_sockstatscounter_unixclose,
+ isc_sockstatscounter_unixbindfail,
+ isc_sockstatscounter_unixconnectfail,
+ isc_sockstatscounter_unixconnect,
+ isc_sockstatscounter_unixacceptfail,
+ isc_sockstatscounter_unixaccept,
+ isc_sockstatscounter_unixsendfail,
+ isc_sockstatscounter_unixrecvfail
+};
+static const isc_statscounter_t fdwatchstatsindex[] = {
+ -1,
+ -1,
+ isc_sockstatscounter_fdwatchclose,
+ isc_sockstatscounter_fdwatchbindfail,
+ isc_sockstatscounter_fdwatchconnectfail,
+ isc_sockstatscounter_fdwatchconnect,
+ -1,
+ -1,
+ isc_sockstatscounter_fdwatchsendfail,
+ isc_sockstatscounter_fdwatchrecvfail
+};
+
+#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL) || \
+ defined(USE_WATCHER_THREAD)
+static void
+manager_log(isc__socketmgr_t *sockmgr,
+ isc_logcategory_t *category, isc_logmodule_t *module, int level,
+ const char *fmt, ...) ISC_FORMAT_PRINTF(5, 6);
+static void
+manager_log(isc__socketmgr_t *sockmgr,
+ isc_logcategory_t *category, isc_logmodule_t *module, int level,
+ const char *fmt, ...)
+{
+ char msgbuf[2048];
+ va_list ap;
+
+ if (! isc_log_wouldlog(isc_lctx, level))
+ return;
+
+ va_start(ap, fmt);
+ vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
+ va_end(ap);
+
+ isc_log_write(isc_lctx, category, module, level,
+ "sockmgr %p: %s", sockmgr, msgbuf);
+}
+#endif
+
+static void
+socket_log(isc__socket_t *sock, isc_sockaddr_t *address,
+ isc_logcategory_t *category, isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10);
+static void
+socket_log(isc__socket_t *sock, isc_sockaddr_t *address,
+ isc_logcategory_t *category, isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *fmt, ...)
+{
+ char msgbuf[2048];
+ char peerbuf[ISC_SOCKADDR_FORMATSIZE];
+ va_list ap;
+
+ if (! isc_log_wouldlog(isc_lctx, level))
+ return;
+
+ va_start(ap, fmt);
+ vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
+ va_end(ap);
+
+ if (address == NULL) {
+ isc_log_iwrite(isc_lctx, category, module, level,
+ msgcat, msgset, message,
+ "socket %p: %s", sock, msgbuf);
+ } else {
+ isc_sockaddr_format(address, peerbuf, sizeof(peerbuf));
+ isc_log_iwrite(isc_lctx, category, module, level,
+ msgcat, msgset, message,
+ "socket %p %s: %s", sock, peerbuf, msgbuf);
+ }
+}
+
+#if defined(_AIX) && defined(ISC_NET_BSD44MSGHDR) && \
+ defined(USE_CMSG) && defined(IPV6_RECVPKTINFO)
+/*
+ * AIX has a kernel bug where IPV6_RECVPKTINFO gets cleared by
+ * setting IPV6_V6ONLY.
+ */
+static void
+FIX_IPV6_RECVPKTINFO(isc__socket_t *sock)
+{
+ char strbuf[ISC_STRERRORSIZE];
+ int on = 1;
+
+ if (sock->pf != AF_INET6 || sock->type != isc_sockettype_udp)
+ return;
+
+ if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
+ (void *)&on, sizeof(on)) < 0) {
+
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, IPV6_RECVPKTINFO) "
+ "%s: %s", sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+}
+#else
+#define FIX_IPV6_RECVPKTINFO(sock) (void)0
+#endif
+
+/*%
+ * Increment socket-related statistics counters.
+ */
+static inline void
+inc_stats(isc_stats_t *stats, isc_statscounter_t counterid) {
+ REQUIRE(counterid != -1);
+
+ if (stats != NULL)
+ isc_stats_increment(stats, counterid);
+}
+
+static inline isc_result_t
+watch_fd(isc__socketmgr_t *manager, int fd, int msg) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+#ifdef USE_KQUEUE
+ struct kevent evchange;
+
+ memset(&evchange, 0, sizeof(evchange));
+ if (msg == SELECT_POKE_READ)
+ evchange.filter = EVFILT_READ;
+ else
+ evchange.filter = EVFILT_WRITE;
+ evchange.flags = EV_ADD;
+ evchange.ident = fd;
+ if (kevent(manager->kqueue_fd, &evchange, 1, NULL, 0, NULL) != 0)
+ result = isc__errno2result(errno);
+
+ return (result);
+#elif defined(USE_EPOLL)
+ struct epoll_event event;
+
+ if (msg == SELECT_POKE_READ)
+ event.events = EPOLLIN;
+ else
+ event.events = EPOLLOUT;
+ memset(&event.data, 0, sizeof(event.data));
+ event.data.fd = fd;
+ if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1 &&
+ errno != EEXIST) {
+ result = isc__errno2result(errno);
+ }
+
+ return (result);
+#elif defined(USE_DEVPOLL)
+ struct pollfd pfd;
+ int lockid = FDLOCK_ID(fd);
+
+ memset(&pfd, 0, sizeof(pfd));
+ if (msg == SELECT_POKE_READ)
+ pfd.events = POLLIN;
+ else
+ pfd.events = POLLOUT;
+ pfd.fd = fd;
+ pfd.revents = 0;
+ LOCK(&manager->fdlock[lockid]);
+ if (write(manager->devpoll_fd, &pfd, sizeof(pfd)) == -1)
+ result = isc__errno2result(errno);
+ else {
+ if (msg == SELECT_POKE_READ)
+ manager->fdpollinfo[fd].want_read = 1;
+ else
+ manager->fdpollinfo[fd].want_write = 1;
+ }
+ UNLOCK(&manager->fdlock[lockid]);
+
+ return (result);
+#elif defined(USE_SELECT)
+ LOCK(&manager->lock);
+ if (msg == SELECT_POKE_READ)
+ FD_SET(fd, manager->read_fds);
+ if (msg == SELECT_POKE_WRITE)
+ FD_SET(fd, manager->write_fds);
+ UNLOCK(&manager->lock);
+
+ return (result);
+#endif
+}
+
+static inline isc_result_t
+unwatch_fd(isc__socketmgr_t *manager, int fd, int msg) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+#ifdef USE_KQUEUE
+ struct kevent evchange;
+
+ memset(&evchange, 0, sizeof(evchange));
+ if (msg == SELECT_POKE_READ)
+ evchange.filter = EVFILT_READ;
+ else
+ evchange.filter = EVFILT_WRITE;
+ evchange.flags = EV_DELETE;
+ evchange.ident = fd;
+ if (kevent(manager->kqueue_fd, &evchange, 1, NULL, 0, NULL) != 0)
+ result = isc__errno2result(errno);
+
+ return (result);
+#elif defined(USE_EPOLL)
+ struct epoll_event event;
+
+ if (msg == SELECT_POKE_READ)
+ event.events = EPOLLIN;
+ else
+ event.events = EPOLLOUT;
+ memset(&event.data, 0, sizeof(event.data));
+ event.data.fd = fd;
+ if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_DEL, fd, &event) == -1 &&
+ errno != ENOENT) {
+ char strbuf[ISC_STRERRORSIZE];
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "epoll_ctl(DEL), %d: %s", fd, strbuf);
+ result = ISC_R_UNEXPECTED;
+ }
+ return (result);
+#elif defined(USE_DEVPOLL)
+ struct pollfd pfds[2];
+ size_t writelen = sizeof(pfds[0]);
+ int lockid = FDLOCK_ID(fd);
+
+ memset(pfds, 0, sizeof(pfds));
+ pfds[0].events = POLLREMOVE;
+ pfds[0].fd = fd;
+
+ /*
+ * Canceling read or write polling via /dev/poll is tricky. Since it
+ * only provides a way of canceling per FD, we may need to re-poll the
+ * socket for the other operation.
+ */
+ LOCK(&manager->fdlock[lockid]);
+ if (msg == SELECT_POKE_READ &&
+ manager->fdpollinfo[fd].want_write == 1) {
+ pfds[1].events = POLLOUT;
+ pfds[1].fd = fd;
+ writelen += sizeof(pfds[1]);
+ }
+ if (msg == SELECT_POKE_WRITE &&
+ manager->fdpollinfo[fd].want_read == 1) {
+ pfds[1].events = POLLIN;
+ pfds[1].fd = fd;
+ writelen += sizeof(pfds[1]);
+ }
+
+ if (write(manager->devpoll_fd, pfds, writelen) == -1)
+ result = isc__errno2result(errno);
+ else {
+ if (msg == SELECT_POKE_READ)
+ manager->fdpollinfo[fd].want_read = 0;
+ else
+ manager->fdpollinfo[fd].want_write = 0;
+ }
+ UNLOCK(&manager->fdlock[lockid]);
+
+ return (result);
+#elif defined(USE_SELECT)
+ LOCK(&manager->lock);
+ if (msg == SELECT_POKE_READ)
+ FD_CLR(fd, manager->read_fds);
+ else if (msg == SELECT_POKE_WRITE)
+ FD_CLR(fd, manager->write_fds);
+ UNLOCK(&manager->lock);
+
+ return (result);
+#endif
+}
+
+static void
+wakeup_socket(isc__socketmgr_t *manager, int fd, int msg) {
+ isc_result_t result;
+ int lockid = FDLOCK_ID(fd);
+
+ /*
+ * This is a wakeup on a socket. If the socket is not in the
+ * process of being closed, start watching it for either reads
+ * or writes.
+ */
+
+ INSIST(fd >= 0 && fd < (int)manager->maxsocks);
+
+ if (msg == SELECT_POKE_CLOSE) {
+ /* No one should be updating fdstate, so no need to lock it */
+ INSIST(manager->fdstate[fd] == CLOSE_PENDING);
+ manager->fdstate[fd] = CLOSED;
+ (void)unwatch_fd(manager, fd, SELECT_POKE_READ);
+ (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
+ (void)close(fd);
+ return;
+ }
+
+ LOCK(&manager->fdlock[lockid]);
+ if (manager->fdstate[fd] == CLOSE_PENDING) {
+ UNLOCK(&manager->fdlock[lockid]);
+
+ /*
+ * We accept (and ignore) any error from unwatch_fd() as we are
+ * closing the socket, hoping it doesn't leave dangling state in
+ * the kernel.
+ * Note that unwatch_fd() must be called after releasing the
+ * fdlock; otherwise it could cause deadlock due to a lock order
+ * reversal.
+ */
+ (void)unwatch_fd(manager, fd, SELECT_POKE_READ);
+ (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
+ return;
+ }
+ if (manager->fdstate[fd] != MANAGED) {
+ UNLOCK(&manager->fdlock[lockid]);
+ return;
+ }
+ UNLOCK(&manager->fdlock[lockid]);
+
+ /*
+ * Set requested bit.
+ */
+ result = watch_fd(manager, fd, msg);
+ if (result != ISC_R_SUCCESS) {
+ /*
+ * XXXJT: what should we do? Ignoring the failure of watching
+ * a socket will make the application dysfunctional, but there
+ * seems to be no reasonable recovery process.
+ */
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "failed to start watching FD (%d): %s",
+ fd, isc_result_totext(result));
+ }
+}
+
+#ifdef USE_WATCHER_THREAD
+/*
+ * Poke the select loop when there is something for us to do.
+ * The write is required (by POSIX) to complete. That is, we
+ * will not get partial writes.
+ */
+static void
+select_poke(isc__socketmgr_t *mgr, int fd, int msg) {
+ int cc;
+ int buf[2];
+ char strbuf[ISC_STRERRORSIZE];
+
+ buf[0] = fd;
+ buf[1] = msg;
+
+ do {
+ cc = write(mgr->pipe_fds[1], buf, sizeof(buf));
+#ifdef ENOSR
+ /*
+ * Treat ENOSR as EAGAIN but loop slowly as it is
+ * unlikely to clear fast.
+ */
+ if (cc < 0 && errno == ENOSR) {
+ sleep(1);
+ errno = EAGAIN;
+ }
+#endif
+ } while (cc < 0 && SOFT_ERROR(errno));
+
+ if (cc < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_WRITEFAILED,
+ "write() failed "
+ "during watcher poke: %s"),
+ strbuf);
+ }
+
+ INSIST(cc == sizeof(buf));
+}
+
+/*
+ * Read a message on the internal fd.
+ */
+static void
+select_readmsg(isc__socketmgr_t *mgr, int *fd, int *msg) {
+ int buf[2];
+ int cc;
+ char strbuf[ISC_STRERRORSIZE];
+
+ cc = read(mgr->pipe_fds[0], buf, sizeof(buf));
+ if (cc < 0) {
+ *msg = SELECT_POKE_NOTHING;
+ *fd = -1; /* Silence compiler. */
+ if (SOFT_ERROR(errno))
+ return;
+
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_READFAILED,
+ "read() failed "
+ "during watcher poke: %s"),
+ strbuf);
+
+ return;
+ }
+ INSIST(cc == sizeof(buf));
+
+ *fd = buf[0];
+ *msg = buf[1];
+}
+#else /* USE_WATCHER_THREAD */
+/*
+ * Update the state of the socketmgr when something changes.
+ */
+static void
+select_poke(isc__socketmgr_t *manager, int fd, int msg) {
+ if (msg == SELECT_POKE_SHUTDOWN)
+ return;
+ else if (fd >= 0)
+ wakeup_socket(manager, fd, msg);
+ return;
+}
+#endif /* USE_WATCHER_THREAD */
+
+/*
+ * Make a fd non-blocking.
+ */
+static isc_result_t
+make_nonblock(int fd) {
+ int ret;
+ int flags;
+ char strbuf[ISC_STRERRORSIZE];
+#ifdef USE_FIONBIO_IOCTL
+ int on = 1;
+
+ ret = ioctl(fd, FIONBIO, (char *)&on);
+#else
+ flags = fcntl(fd, F_GETFL, 0);
+ flags |= PORT_NONBLOCK;
+ ret = fcntl(fd, F_SETFL, flags);
+#endif
+
+ if (ret == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+#ifdef USE_FIONBIO_IOCTL
+ "ioctl(%d, FIONBIO, &on): %s", fd,
+#else
+ "fcntl(%d, F_SETFL, %d): %s", fd, flags,
+#endif
+ strbuf);
+
+ return (ISC_R_UNEXPECTED);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+#ifdef USE_CMSG
+/*
+ * Not all OSes support advanced CMSG macros: CMSG_LEN and CMSG_SPACE.
+ * In order to ensure as much portability as possible, we provide wrapper
+ * functions of these macros.
+ * Note that cmsg_space() could run slow on OSes that do not have
+ * CMSG_SPACE.
+ */
+static inline ISC_SOCKADDR_LEN_T
+cmsg_len(ISC_SOCKADDR_LEN_T len) {
+#ifdef CMSG_LEN
+ return (CMSG_LEN(len));
+#else
+ ISC_SOCKADDR_LEN_T hdrlen;
+
+ /*
+ * Cast NULL so that any pointer arithmetic performed by CMSG_DATA
+ * is correct.
+ */
+ hdrlen = (ISC_SOCKADDR_LEN_T)CMSG_DATA(((struct cmsghdr *)NULL));
+ return (hdrlen + len);
+#endif
+}
+
+static inline ISC_SOCKADDR_LEN_T
+cmsg_space(ISC_SOCKADDR_LEN_T len) {
+#ifdef CMSG_SPACE
+ return (CMSG_SPACE(len));
+#else
+ struct msghdr msg;
+ struct cmsghdr *cmsgp;
+ /*
+ * XXX: The buffer length is an ad-hoc value, but should be enough
+ * in a practical sense.
+ */
+ char dummybuf[sizeof(struct cmsghdr) + 1024];
+
+ memset(&msg, 0, sizeof(msg));
+ msg.msg_control = dummybuf;
+ msg.msg_controllen = sizeof(dummybuf);
+
+ cmsgp = (struct cmsghdr *)dummybuf;
+ cmsgp->cmsg_len = cmsg_len(len);
+
+ cmsgp = CMSG_NXTHDR(&msg, cmsgp);
+ if (cmsgp != NULL)
+ return ((char *)cmsgp - (char *)msg.msg_control);
+ else
+ return (0);
+#endif
+}
+#endif /* USE_CMSG */
+
+/*
+ * Process control messages received on a socket.
+ */
+static void
+process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
+#ifdef USE_CMSG
+ struct cmsghdr *cmsgp;
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+ struct in6_pktinfo *pktinfop;
+#endif
+#ifdef SO_TIMESTAMP
+ struct timeval *timevalp;
+#endif
+#endif
+
+ /*
+ * sock is used only when ISC_NET_BSD44MSGHDR and USE_CMSG are defined.
+ * msg and dev are used only when ISC_NET_BSD44MSGHDR is defined.
+ * They are all here, outside of the CPP tests, because it is
+ * more consistent with the usual ISC coding style.
+ */
+ UNUSED(sock);
+ UNUSED(msg);
+ UNUSED(dev);
+
+#ifdef ISC_NET_BSD44MSGHDR
+
+#ifdef MSG_TRUNC
+ if ((msg->msg_flags & MSG_TRUNC) == MSG_TRUNC)
+ dev->attributes |= ISC_SOCKEVENTATTR_TRUNC;
+#endif
+
+#ifdef MSG_CTRUNC
+ if ((msg->msg_flags & MSG_CTRUNC) == MSG_CTRUNC)
+ dev->attributes |= ISC_SOCKEVENTATTR_CTRUNC;
+#endif
+
+#ifndef USE_CMSG
+ return;
+#else
+ if (msg->msg_controllen == 0U || msg->msg_control == NULL)
+ return;
+
+#ifdef SO_TIMESTAMP
+ timevalp = NULL;
+#endif
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+ pktinfop = NULL;
+#endif
+
+ cmsgp = CMSG_FIRSTHDR(msg);
+ while (cmsgp != NULL) {
+ socket_log(sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PROCESSCMSG,
+ "processing cmsg %p", cmsgp);
+
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+ if (cmsgp->cmsg_level == IPPROTO_IPV6
+ && cmsgp->cmsg_type == IPV6_PKTINFO) {
+
+ pktinfop = (struct in6_pktinfo *)CMSG_DATA(cmsgp);
+ memcpy(&dev->pktinfo, pktinfop,
+ sizeof(struct in6_pktinfo));
+ dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
+ socket_log(sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_IFRECEIVED,
+ "interface received on ifindex %u",
+ dev->pktinfo.ipi6_ifindex);
+ if (IN6_IS_ADDR_MULTICAST(&pktinfop->ipi6_addr))
+ dev->attributes |= ISC_SOCKEVENTATTR_MULTICAST;
+ goto next;
+ }
+#endif
+
+#ifdef SO_TIMESTAMP
+ if (cmsgp->cmsg_level == SOL_SOCKET
+ && cmsgp->cmsg_type == SCM_TIMESTAMP) {
+ timevalp = (struct timeval *)CMSG_DATA(cmsgp);
+ dev->timestamp.seconds = timevalp->tv_sec;
+ dev->timestamp.nanoseconds = timevalp->tv_usec * 1000;
+ dev->attributes |= ISC_SOCKEVENTATTR_TIMESTAMP;
+ goto next;
+ }
+#endif
+
+ next:
+ cmsgp = CMSG_NXTHDR(msg, cmsgp);
+ }
+#endif /* USE_CMSG */
+
+#endif /* ISC_NET_BSD44MSGHDR */
+}
+
+/*
+ * Construct an iov array and attach it to the msghdr passed in. This is
+ * the SEND constructor, which will use the used region of the buffer
+ * (if using a buffer list) or will use the internal region (if a single
+ * buffer I/O is requested).
+ *
+ * Nothing can be NULL, and the done event must list at least one buffer
+ * on the buffer linked list for this function to be meaningful.
+ *
+ * If write_countp != NULL, *write_countp will hold the number of bytes
+ * this transaction can send.
+ */
+static void
+build_msghdr_send(isc__socket_t *sock, isc_socketevent_t *dev,
+ struct msghdr *msg, struct iovec *iov, size_t *write_countp)
+{
+ unsigned int iovcount;
+ isc_buffer_t *buffer;
+ isc_region_t used;
+ size_t write_count;
+ size_t skip_count;
+
+ memset(msg, 0, sizeof(*msg));
+
+ if (!sock->connected) {
+ msg->msg_name = (void *)&dev->address.type.sa;
+ msg->msg_namelen = dev->address.length;
+ } else {
+ msg->msg_name = NULL;
+ msg->msg_namelen = 0;
+ }
+
+ buffer = ISC_LIST_HEAD(dev->bufferlist);
+ write_count = 0;
+ iovcount = 0;
+
+ /*
+ * Single buffer I/O? Skip what we've done so far in this region.
+ */
+ if (buffer == NULL) {
+ write_count = dev->region.length - dev->n;
+ iov[0].iov_base = (void *)(dev->region.base + dev->n);
+ iov[0].iov_len = write_count;
+ iovcount = 1;
+
+ goto config;
+ }
+
+ /*
+ * Multibuffer I/O.
+ * Skip the data in the buffer list that we have already written.
+ */
+ skip_count = dev->n;
+ while (buffer != NULL) {
+ REQUIRE(ISC_BUFFER_VALID(buffer));
+ if (skip_count < isc_buffer_usedlength(buffer))
+ break;
+ skip_count -= isc_buffer_usedlength(buffer);
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ while (buffer != NULL) {
+ INSIST(iovcount < MAXSCATTERGATHER_SEND);
+
+ isc_buffer_usedregion(buffer, &used);
+
+ if (used.length > 0) {
+ iov[iovcount].iov_base = (void *)(used.base
+ + skip_count);
+ iov[iovcount].iov_len = used.length - skip_count;
+ write_count += (used.length - skip_count);
+ skip_count = 0;
+ iovcount++;
+ }
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ INSIST(skip_count == 0U);
+
+ config:
+ msg->msg_iov = iov;
+ msg->msg_iovlen = iovcount;
+
+#ifdef ISC_NET_BSD44MSGHDR
+ msg->msg_control = NULL;
+ msg->msg_controllen = 0;
+ msg->msg_flags = 0;
+#if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO)
+ if ((sock->type == isc_sockettype_udp)
+ && ((dev->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0)) {
+#if defined(IPV6_USE_MIN_MTU)
+ int use_min_mtu = 1; /* -1, 0, 1 */
+#endif
+ struct cmsghdr *cmsgp;
+ struct in6_pktinfo *pktinfop;
+
+ socket_log(sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_SENDTODATA,
+ "sendto pktinfo data, ifindex %u",
+ dev->pktinfo.ipi6_ifindex);
+
+ msg->msg_controllen = cmsg_space(sizeof(struct in6_pktinfo));
+ INSIST(msg->msg_controllen <= sock->sendcmsgbuflen);
+ msg->msg_control = (void *)sock->sendcmsgbuf;
+
+ cmsgp = (struct cmsghdr *)sock->sendcmsgbuf;
+ cmsgp->cmsg_level = IPPROTO_IPV6;
+ cmsgp->cmsg_type = IPV6_PKTINFO;
+ cmsgp->cmsg_len = cmsg_len(sizeof(struct in6_pktinfo));
+ pktinfop = (struct in6_pktinfo *)CMSG_DATA(cmsgp);
+ memcpy(pktinfop, &dev->pktinfo, sizeof(struct in6_pktinfo));
+#if defined(IPV6_USE_MIN_MTU)
+ /*
+ * Set IPV6_USE_MIN_MTU as a per packet option as FreeBSD
+ * ignores setsockopt(IPV6_USE_MIN_MTU) when IPV6_PKTINFO
+ * is used.
+ */
+ cmsgp = (struct cmsghdr *)(sock->sendcmsgbuf +
+ msg->msg_controllen);
+ msg->msg_controllen += cmsg_space(sizeof(use_min_mtu));
+ INSIST(msg->msg_controllen <= sock->sendcmsgbuflen);
+
+ cmsgp->cmsg_level = IPPROTO_IPV6;
+ cmsgp->cmsg_type = IPV6_USE_MIN_MTU;
+ cmsgp->cmsg_len = cmsg_len(sizeof(use_min_mtu));
+ memcpy(CMSG_DATA(cmsgp), &use_min_mtu, sizeof(use_min_mtu));
+#endif
+ }
+#endif /* USE_CMSG && ISC_PLATFORM_HAVEIPV6 */
+#else /* ISC_NET_BSD44MSGHDR */
+ msg->msg_accrights = NULL;
+ msg->msg_accrightslen = 0;
+#endif /* ISC_NET_BSD44MSGHDR */
+
+ if (write_countp != NULL)
+ *write_countp = write_count;
+}
+
+/*
+ * Construct an iov array and attach it to the msghdr passed in. This is
+ * the RECV constructor, which will use the available region of the buffer
+ * (if using a buffer list) or will use the internal region (if a single
+ * buffer I/O is requested).
+ *
+ * Nothing can be NULL, and the done event must list at least one buffer
+ * on the buffer linked list for this function to be meaningful.
+ *
+ * If read_countp != NULL, *read_countp will hold the number of bytes
+ * this transaction can receive.
+ */
+static void
+build_msghdr_recv(isc__socket_t *sock, isc_socketevent_t *dev,
+ struct msghdr *msg, struct iovec *iov, size_t *read_countp)
+{
+ unsigned int iovcount;
+ isc_buffer_t *buffer;
+ isc_region_t available;
+ size_t read_count;
+
+ memset(msg, 0, sizeof(struct msghdr));
+
+ if (sock->type == isc_sockettype_udp) {
+ memset(&dev->address, 0, sizeof(dev->address));
+#ifdef BROKEN_RECVMSG
+ if (sock->pf == AF_INET) {
+ msg->msg_name = (void *)&dev->address.type.sin;
+ msg->msg_namelen = sizeof(dev->address.type.sin6);
+ } else if (sock->pf == AF_INET6) {
+ msg->msg_name = (void *)&dev->address.type.sin6;
+ msg->msg_namelen = sizeof(dev->address.type.sin6);
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ } else if (sock->pf == AF_UNIX) {
+ msg->msg_name = (void *)&dev->address.type.sunix;
+ msg->msg_namelen = sizeof(dev->address.type.sunix);
+#endif
+ } else {
+ msg->msg_name = (void *)&dev->address.type.sa;
+ msg->msg_namelen = sizeof(dev->address.type);
+ }
+#else
+ msg->msg_name = (void *)&dev->address.type.sa;
+ msg->msg_namelen = sizeof(dev->address.type);
+#endif
+#ifdef ISC_NET_RECVOVERFLOW
+ /* If needed, steal one iovec for overflow detection. */
+ maxiov--;
+#endif
+ } else { /* TCP */
+ msg->msg_name = NULL;
+ msg->msg_namelen = 0;
+ dev->address = sock->peer_address;
+ }
+
+ buffer = ISC_LIST_HEAD(dev->bufferlist);
+ read_count = 0;
+
+ /*
+ * Single buffer I/O? Skip what we've done so far in this region.
+ */
+ if (buffer == NULL) {
+ read_count = dev->region.length - dev->n;
+ iov[0].iov_base = (void *)(dev->region.base + dev->n);
+ iov[0].iov_len = read_count;
+ iovcount = 1;
+
+ goto config;
+ }
+
+ /*
+ * Multibuffer I/O.
+ * Skip empty buffers.
+ */
+ while (buffer != NULL) {
+ REQUIRE(ISC_BUFFER_VALID(buffer));
+ if (isc_buffer_availablelength(buffer) != 0)
+ break;
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ iovcount = 0;
+ while (buffer != NULL) {
+ INSIST(iovcount < MAXSCATTERGATHER_RECV);
+
+ isc_buffer_availableregion(buffer, &available);
+
+ if (available.length > 0) {
+ iov[iovcount].iov_base = (void *)(available.base);
+ iov[iovcount].iov_len = available.length;
+ read_count += available.length;
+ iovcount++;
+ }
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ config:
+
+ /*
+ * If needed, set up to receive that one extra byte. Note that
+ * we know there is at least one iov left, since we stole it
+ * at the top of this function.
+ */
+#ifdef ISC_NET_RECVOVERFLOW
+ if (sock->type == isc_sockettype_udp) {
+ iov[iovcount].iov_base = (void *)(&sock->overflow);
+ iov[iovcount].iov_len = 1;
+ iovcount++;
+ }
+#endif
+
+ msg->msg_iov = iov;
+ msg->msg_iovlen = iovcount;
+
+#ifdef ISC_NET_BSD44MSGHDR
+ msg->msg_control = NULL;
+ msg->msg_controllen = 0;
+ msg->msg_flags = 0;
+#if defined(USE_CMSG)
+ if (sock->type == isc_sockettype_udp) {
+ msg->msg_control = sock->recvcmsgbuf;
+ msg->msg_controllen = sock->recvcmsgbuflen;
+ }
+#endif /* USE_CMSG */
+#else /* ISC_NET_BSD44MSGHDR */
+ msg->msg_accrights = NULL;
+ msg->msg_accrightslen = 0;
+#endif /* ISC_NET_BSD44MSGHDR */
+
+ if (read_countp != NULL)
+ *read_countp = read_count;
+}
+
+static void
+set_dev_address(isc_sockaddr_t *address, isc__socket_t *sock,
+ isc_socketevent_t *dev)
+{
+ if (sock->type == isc_sockettype_udp) {
+ if (address != NULL)
+ dev->address = *address;
+ else
+ dev->address = sock->peer_address;
+ } else if (sock->type == isc_sockettype_tcp) {
+ INSIST(address == NULL);
+ dev->address = sock->peer_address;
+ }
+}
+
+static void
+destroy_socketevent(isc_event_t *event) {
+ isc_socketevent_t *ev = (isc_socketevent_t *)event;
+
+ INSIST(ISC_LIST_EMPTY(ev->bufferlist));
+
+ (ev->destroy)(event);
+}
+
+static isc_socketevent_t *
+allocate_socketevent(isc__socket_t *sock, isc_eventtype_t eventtype,
+ isc_taskaction_t action, const void *arg)
+{
+ isc_socketevent_t *ev;
+
+ ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx,
+ sock, eventtype,
+ action, arg,
+ sizeof(*ev));
+
+ if (ev == NULL)
+ return (NULL);
+
+ ev->result = ISC_R_UNSET;
+ ISC_LINK_INIT(ev, ev_link);
+ ISC_LIST_INIT(ev->bufferlist);
+ ev->region.base = NULL;
+ ev->n = 0;
+ ev->offset = 0;
+ ev->attributes = 0;
+ ev->destroy = ev->ev_destroy;
+ ev->ev_destroy = destroy_socketevent;
+
+ return (ev);
+}
+
+#if defined(ISC_SOCKET_DEBUG)
+static void
+dump_msg(struct msghdr *msg) {
+ unsigned int i;
+
+ printf("MSGHDR %p\n", msg);
+ printf("\tname %p, namelen %ld\n", msg->msg_name,
+ (long) msg->msg_namelen);
+ printf("\tiov %p, iovlen %ld\n", msg->msg_iov,
+ (long) msg->msg_iovlen);
+ for (i = 0; i < (unsigned int)msg->msg_iovlen; i++)
+ printf("\t\t%d\tbase %p, len %ld\n", i,
+ msg->msg_iov[i].iov_base,
+ (long) msg->msg_iov[i].iov_len);
+#ifdef ISC_NET_BSD44MSGHDR
+ printf("\tcontrol %p, controllen %ld\n", msg->msg_control,
+ (long) msg->msg_controllen);
+#endif
+}
+#endif
+
+#define DOIO_SUCCESS 0 /* i/o ok, event sent */
+#define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */
+#define DOIO_HARD 2 /* i/o error, event sent */
+#define DOIO_EOF 3 /* EOF, no event sent */
+
+static int
+doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) {
+ int cc;
+ struct iovec iov[MAXSCATTERGATHER_RECV];
+ size_t read_count;
+ size_t actual_count;
+ struct msghdr msghdr;
+ isc_buffer_t *buffer;
+ int recv_errno;
+ char strbuf[ISC_STRERRORSIZE];
+
+ build_msghdr_recv(sock, dev, &msghdr, iov, &read_count);
+
+#if defined(ISC_SOCKET_DEBUG)
+ dump_msg(&msghdr);
+#endif
+
+ cc = recvmsg(sock->fd, &msghdr, 0);
+ recv_errno = errno;
+
+#if defined(ISC_SOCKET_DEBUG)
+ dump_msg(&msghdr);
+#endif
+
+ if (cc < 0) {
+ if (SOFT_ERROR(recv_errno))
+ return (DOIO_SOFT);
+
+ if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
+ isc__strerror(recv_errno, strbuf, sizeof(strbuf));
+ socket_log(sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_DOIORECV,
+ "doio_recv: recvmsg(%d) %d bytes, err %d/%s",
+ sock->fd, cc, recv_errno, strbuf);
+ }
+
+#define SOFT_OR_HARD(_system, _isc) \
+ if (recv_errno == _system) { \
+ if (sock->connected) { \
+ dev->result = _isc; \
+ inc_stats(sock->manager->stats, \
+ sock->statsindex[STATID_RECVFAIL]); \
+ return (DOIO_HARD); \
+ } \
+ return (DOIO_SOFT); \
+ }
+#define ALWAYS_HARD(_system, _isc) \
+ if (recv_errno == _system) { \
+ dev->result = _isc; \
+ inc_stats(sock->manager->stats, \
+ sock->statsindex[STATID_RECVFAIL]); \
+ return (DOIO_HARD); \
+ }
+
+ SOFT_OR_HARD(ECONNREFUSED, ISC_R_CONNREFUSED);
+ SOFT_OR_HARD(ENETUNREACH, ISC_R_NETUNREACH);
+ SOFT_OR_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH);
+ SOFT_OR_HARD(EHOSTDOWN, ISC_R_HOSTDOWN);
+ /* HPUX 11.11 can return EADDRNOTAVAIL. */
+ SOFT_OR_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
+ ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES);
+ /*
+ * HPUX returns EPROTO and EINVAL on receiving some ICMP/ICMPv6
+ * errors.
+ */
+#ifdef EPROTO
+ SOFT_OR_HARD(EPROTO, ISC_R_HOSTUNREACH);
+#endif
+ SOFT_OR_HARD(EINVAL, ISC_R_HOSTUNREACH);
+
+#undef SOFT_OR_HARD
+#undef ALWAYS_HARD
+
+ dev->result = isc__errno2result(recv_errno);
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_RECVFAIL]);
+ return (DOIO_HARD);
+ }
+
+ /*
+ * On TCP and UNIX sockets, zero length reads indicate EOF,
+ * while on UDP sockets, zero length reads are perfectly valid,
+ * although strange.
+ */
+ switch (sock->type) {
+ case isc_sockettype_tcp:
+ case isc_sockettype_unix:
+ if (cc == 0)
+ return (DOIO_EOF);
+ break;
+ case isc_sockettype_udp:
+ break;
+ case isc_sockettype_fdwatch:
+ default:
+ INSIST(0);
+ }
+
+ if (sock->type == isc_sockettype_udp) {
+ dev->address.length = msghdr.msg_namelen;
+ if (isc_sockaddr_getport(&dev->address) == 0) {
+ if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
+ socket_log(sock, &dev->address, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_ZEROPORT,
+ "dropping source port zero packet");
+ }
+ return (DOIO_SOFT);
+ }
+ /*
+ * Simulate a firewall blocking UDP responses bigger than
+ * 512 bytes.
+ */
+ if (sock->manager->maxudp != 0 && cc > sock->manager->maxudp)
+ return (DOIO_SOFT);
+ }
+
+ socket_log(sock, &dev->address, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PKTRECV,
+ "packet received correctly");
+
+ /*
+ * Overflow bit detection. If we received MORE bytes than we should,
+ * this indicates an overflow situation. Set the flag in the
+ * dev entry and adjust how much we read by one.
+ */
+#ifdef ISC_NET_RECVOVERFLOW
+ if ((sock->type == isc_sockettype_udp) && ((size_t)cc > read_count)) {
+ dev->attributes |= ISC_SOCKEVENTATTR_TRUNC;
+ cc--;
+ }
+#endif
+
+ /*
+ * If there are control messages attached, run through them and pull
+ * out the interesting bits.
+ */
+ if (sock->type == isc_sockettype_udp)
+ process_cmsg(sock, &msghdr, dev);
+
+ /*
+ * update the buffers (if any) and the i/o count
+ */
+ dev->n += cc;
+ actual_count = cc;
+ buffer = ISC_LIST_HEAD(dev->bufferlist);
+ while (buffer != NULL && actual_count > 0U) {
+ REQUIRE(ISC_BUFFER_VALID(buffer));
+ if (isc_buffer_availablelength(buffer) <= actual_count) {
+ actual_count -= isc_buffer_availablelength(buffer);
+ isc_buffer_add(buffer,
+ isc_buffer_availablelength(buffer));
+ } else {
+ isc_buffer_add(buffer, actual_count);
+ actual_count = 0;
+ POST(actual_count);
+ break;
+ }
+ buffer = ISC_LIST_NEXT(buffer, link);
+ if (buffer == NULL) {
+ INSIST(actual_count == 0U);
+ }
+ }
+
+ /*
+ * If we read less than we expected, update counters,
+ * and let the upper layer poke the descriptor.
+ */
+ if (((size_t)cc != read_count) && (dev->n < dev->minimum))
+ return (DOIO_SOFT);
+
+ /*
+ * Full reads are posted, or partials if partials are ok.
+ */
+ dev->result = ISC_R_SUCCESS;
+ return (DOIO_SUCCESS);
+}
+
+/*
+ * Returns:
+ * DOIO_SUCCESS The operation succeeded. dev->result contains
+ * ISC_R_SUCCESS.
+ *
+ * DOIO_HARD A hard or unexpected I/O error was encountered.
+ * dev->result contains the appropriate error.
+ *
+ * DOIO_SOFT A soft I/O error was encountered. No senddone
+ * event was sent. The operation should be retried.
+ *
+ * No other return values are possible.
+ */
+static int
+doio_send(isc__socket_t *sock, isc_socketevent_t *dev) {
+ int cc;
+ struct iovec iov[MAXSCATTERGATHER_SEND];
+ size_t write_count;
+ struct msghdr msghdr;
+ char addrbuf[ISC_SOCKADDR_FORMATSIZE];
+ int attempts = 0;
+ int send_errno;
+ char strbuf[ISC_STRERRORSIZE];
+
+ build_msghdr_send(sock, dev, &msghdr, iov, &write_count);
+
+ resend:
+ cc = sendmsg(sock->fd, &msghdr, 0);
+ send_errno = errno;
+
+ /*
+ * Check for error or block condition.
+ */
+ if (cc < 0) {
+ if (send_errno == EINTR && ++attempts < NRETRIES)
+ goto resend;
+
+ if (SOFT_ERROR(send_errno))
+ return (DOIO_SOFT);
+
+#define SOFT_OR_HARD(_system, _isc) \
+ if (send_errno == _system) { \
+ if (sock->connected) { \
+ dev->result = _isc; \
+ inc_stats(sock->manager->stats, \
+ sock->statsindex[STATID_SENDFAIL]); \
+ return (DOIO_HARD); \
+ } \
+ return (DOIO_SOFT); \
+ }
+#define ALWAYS_HARD(_system, _isc) \
+ if (send_errno == _system) { \
+ dev->result = _isc; \
+ inc_stats(sock->manager->stats, \
+ sock->statsindex[STATID_SENDFAIL]); \
+ return (DOIO_HARD); \
+ }
+
+ SOFT_OR_HARD(ECONNREFUSED, ISC_R_CONNREFUSED);
+ ALWAYS_HARD(EACCES, ISC_R_NOPERM);
+ ALWAYS_HARD(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL);
+ ALWAYS_HARD(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
+ ALWAYS_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH);
+#ifdef EHOSTDOWN
+ ALWAYS_HARD(EHOSTDOWN, ISC_R_HOSTUNREACH);
+#endif
+ ALWAYS_HARD(ENETUNREACH, ISC_R_NETUNREACH);
+ ALWAYS_HARD(ENOBUFS, ISC_R_NORESOURCES);
+ ALWAYS_HARD(EPERM, ISC_R_HOSTUNREACH);
+ ALWAYS_HARD(EPIPE, ISC_R_NOTCONNECTED);
+ ALWAYS_HARD(ECONNRESET, ISC_R_CONNECTIONRESET);
+
+#undef SOFT_OR_HARD
+#undef ALWAYS_HARD
+
+ /*
+ * The other error types depend on whether or not the
+ * socket is UDP or TCP. If it is UDP, some errors
+ * that we expect to be fatal under TCP are merely
+ * annoying, and are really soft errors.
+ *
+ * However, these soft errors are still returned as
+ * a status.
+ */
+ isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf));
+ isc__strerror(send_errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "internal_send: %s: %s",
+ addrbuf, strbuf);
+ dev->result = isc__errno2result(send_errno);
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_SENDFAIL]);
+ return (DOIO_HARD);
+ }
+
+ if (cc == 0) {
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_SENDFAIL]);
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "doio_send: send() %s 0",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_RETURNED, "returned"));
+ }
+
+ /*
+ * If we write less than we expected, update counters, poke.
+ */
+ dev->n += cc;
+ if ((size_t)cc != write_count)
+ return (DOIO_SOFT);
+
+ /*
+ * Exactly what we wanted to write. We're done with this
+ * entry. Post its completion event.
+ */
+ dev->result = ISC_R_SUCCESS;
+ return (DOIO_SUCCESS);
+}
+
+/*
+ * Kill.
+ *
+ * Caller must ensure that the socket is not locked and no external
+ * references exist.
+ */
+static void
+closesocket(isc__socketmgr_t *manager, isc__socket_t *sock, int fd) {
+ isc_sockettype_t type = sock->type;
+ int lockid = FDLOCK_ID(fd);
+
+ /*
+ * No one has this socket open, so the watcher doesn't have to be
+ * poked, and the socket doesn't have to be locked.
+ */
+ LOCK(&manager->fdlock[lockid]);
+ manager->fds[fd] = NULL;
+ if (type == isc_sockettype_fdwatch)
+ manager->fdstate[fd] = CLOSED;
+ else
+ manager->fdstate[fd] = CLOSE_PENDING;
+ UNLOCK(&manager->fdlock[lockid]);
+ if (type == isc_sockettype_fdwatch) {
+ /*
+ * The caller may close the socket once this function returns,
+ * and `fd' may be reassigned for a new socket. So we do
+ * unwatch_fd() here, rather than defer it via select_poke().
+ * Note: this may complicate data protection among threads and
+ * may reduce performance due to additional locks. One way to
+ * solve this would be to dup() the watched descriptor, but we
+ * take a simpler approach at this moment.
+ */
+ (void)unwatch_fd(manager, fd, SELECT_POKE_READ);
+ (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
+ } else
+ select_poke(manager, fd, SELECT_POKE_CLOSE);
+
+ inc_stats(manager->stats, sock->statsindex[STATID_CLOSE]);
+
+ /*
+ * update manager->maxfd here (XXX: this should be implemented more
+ * efficiently)
+ */
+#ifdef USE_SELECT
+ LOCK(&manager->lock);
+ if (manager->maxfd == fd) {
+ int i;
+
+ manager->maxfd = 0;
+ for (i = fd - 1; i >= 0; i--) {
+ lockid = FDLOCK_ID(i);
+
+ LOCK(&manager->fdlock[lockid]);
+ if (manager->fdstate[i] == MANAGED) {
+ manager->maxfd = i;
+ UNLOCK(&manager->fdlock[lockid]);
+ break;
+ }
+ UNLOCK(&manager->fdlock[lockid]);
+ }
+#ifdef ISC_PLATFORM_USETHREADS
+ if (manager->maxfd < manager->pipe_fds[0])
+ manager->maxfd = manager->pipe_fds[0];
+#endif
+ }
+ UNLOCK(&manager->lock);
+#endif /* USE_SELECT */
+}
+
+static void
+destroy(isc__socket_t **sockp) {
+ int fd;
+ isc__socket_t *sock = *sockp;
+ isc__socketmgr_t *manager = sock->manager;
+
+ socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_DESTROYING, "destroying");
+
+ INSIST(ISC_LIST_EMPTY(sock->accept_list));
+ INSIST(ISC_LIST_EMPTY(sock->recv_list));
+ INSIST(ISC_LIST_EMPTY(sock->send_list));
+ INSIST(sock->connect_ev == NULL);
+ REQUIRE(sock->fd == -1 || sock->fd < (int)manager->maxsocks);
+
+ if (sock->fd >= 0) {
+ fd = sock->fd;
+ sock->fd = -1;
+ closesocket(manager, sock, fd);
+ }
+
+ LOCK(&manager->lock);
+
+ ISC_LIST_UNLINK(manager->socklist, sock, link);
+
+#ifdef USE_WATCHER_THREAD
+ if (ISC_LIST_EMPTY(manager->socklist))
+ SIGNAL(&manager->shutdown_ok);
+#endif /* USE_WATCHER_THREAD */
+
+ /* can't unlock manager as its memory context is still used */
+ free_socket(sockp);
+
+ UNLOCK(&manager->lock);
+}
+
+static isc_result_t
+allocate_socket(isc__socketmgr_t *manager, isc_sockettype_t type,
+ isc__socket_t **socketp)
+{
+ isc__socket_t *sock;
+ isc_result_t result;
+ ISC_SOCKADDR_LEN_T cmsgbuflen;
+
+ sock = isc_mem_get(manager->mctx, sizeof(*sock));
+
+ if (sock == NULL)
+ return (ISC_R_NOMEMORY);
+
+ sock->common.magic = 0;
+ sock->common.impmagic = 0;
+ sock->references = 0;
+
+ sock->manager = manager;
+ sock->type = type;
+ sock->fd = -1;
+ sock->dupped = 0;
+ sock->statsindex = NULL;
+
+ ISC_LINK_INIT(sock, link);
+
+ sock->recvcmsgbuf = NULL;
+ sock->sendcmsgbuf = NULL;
+
+ /*
+ * set up cmsg buffers
+ */
+ cmsgbuflen = 0;
+#if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO)
+ cmsgbuflen += cmsg_space(sizeof(struct in6_pktinfo));
+#endif
+#if defined(USE_CMSG) && defined(SO_TIMESTAMP)
+ cmsgbuflen += cmsg_space(sizeof(struct timeval));
+#endif
+ sock->recvcmsgbuflen = cmsgbuflen;
+ if (sock->recvcmsgbuflen != 0U) {
+ sock->recvcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen);
+ if (sock->recvcmsgbuf == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto error;
+ }
+ }
+
+ cmsgbuflen = 0;
+#if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO)
+ cmsgbuflen += cmsg_space(sizeof(struct in6_pktinfo));
+#if defined(IPV6_USE_MIN_MTU)
+ /*
+ * Provide space for working around FreeBSD's broken IPV6_USE_MIN_MTU
+ * support.
+ */
+ cmsgbuflen += cmsg_space(sizeof(int));
+#endif
+#endif
+ sock->sendcmsgbuflen = cmsgbuflen;
+ if (sock->sendcmsgbuflen != 0U) {
+ sock->sendcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen);
+ if (sock->sendcmsgbuf == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto error;
+ }
+ }
+
+ memset(sock->name, 0, sizeof(sock->name));
+ sock->tag = NULL;
+
+ /*
+ * set up list of readers and writers to be initially empty
+ */
+ ISC_LIST_INIT(sock->recv_list);
+ ISC_LIST_INIT(sock->send_list);
+ ISC_LIST_INIT(sock->accept_list);
+ sock->connect_ev = NULL;
+ sock->pending_recv = 0;
+ sock->pending_send = 0;
+ sock->pending_accept = 0;
+ sock->listener = 0;
+ sock->connected = 0;
+ sock->connecting = 0;
+ sock->bound = 0;
+
+ /*
+ * initialize the lock
+ */
+ result = isc_mutex_init(&sock->lock);
+ if (result != ISC_R_SUCCESS) {
+ sock->common.magic = 0;
+ sock->common.impmagic = 0;
+ goto error;
+ }
+
+ /*
+ * Initialize readable and writable events
+ */
+ ISC_EVENT_INIT(&sock->readable_ev, sizeof(intev_t),
+ ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTR,
+ NULL, sock, sock, NULL, NULL);
+ ISC_EVENT_INIT(&sock->writable_ev, sizeof(intev_t),
+ ISC_EVENTATTR_NOPURGE, NULL, ISC_SOCKEVENT_INTW,
+ NULL, sock, sock, NULL, NULL);
+
+ sock->common.magic = ISCAPI_SOCKET_MAGIC;
+ sock->common.impmagic = SOCKET_MAGIC;
+ *socketp = sock;
+
+ return (ISC_R_SUCCESS);
+
+ error:
+ if (sock->recvcmsgbuf != NULL)
+ isc_mem_put(manager->mctx, sock->recvcmsgbuf,
+ sock->recvcmsgbuflen);
+ if (sock->sendcmsgbuf != NULL)
+ isc_mem_put(manager->mctx, sock->sendcmsgbuf,
+ sock->sendcmsgbuflen);
+ isc_mem_put(manager->mctx, sock, sizeof(*sock));
+
+ return (result);
+}
+
+/*
+ * This event requires that the various lists be empty, that the reference
+ * count be 1, and that the magic number is valid. The other socket bits,
+ * like the lock, must be initialized as well. The fd associated must be
+ * marked as closed, by setting it to -1 on close, or this routine will
+ * also close the socket.
+ */
+static void
+free_socket(isc__socket_t **socketp) {
+ isc__socket_t *sock = *socketp;
+
+ INSIST(sock->references == 0);
+ INSIST(VALID_SOCKET(sock));
+ INSIST(!sock->connecting);
+ INSIST(!sock->pending_recv);
+ INSIST(!sock->pending_send);
+ INSIST(!sock->pending_accept);
+ INSIST(ISC_LIST_EMPTY(sock->recv_list));
+ INSIST(ISC_LIST_EMPTY(sock->send_list));
+ INSIST(ISC_LIST_EMPTY(sock->accept_list));
+ INSIST(!ISC_LINK_LINKED(sock, link));
+
+ if (sock->recvcmsgbuf != NULL)
+ isc_mem_put(sock->manager->mctx, sock->recvcmsgbuf,
+ sock->recvcmsgbuflen);
+ if (sock->sendcmsgbuf != NULL)
+ isc_mem_put(sock->manager->mctx, sock->sendcmsgbuf,
+ sock->sendcmsgbuflen);
+
+ sock->common.magic = 0;
+ sock->common.impmagic = 0;
+
+ DESTROYLOCK(&sock->lock);
+
+ isc_mem_put(sock->manager->mctx, sock, sizeof(*sock));
+
+ *socketp = NULL;
+}
+
+#ifdef SO_BSDCOMPAT
+/*
+ * This really should not be necessary to do. Having to workout
+ * which kernel version we are on at run time so that we don't cause
+ * the kernel to issue a warning about us using a deprecated socket option.
+ * Such warnings should *never* be on by default in production kernels.
+ *
+ * We can't do this a build time because executables are moved between
+ * machines and hence kernels.
+ *
+ * We can't just not set SO_BSDCOMAT because some kernels require it.
+ */
+
+static isc_once_t bsdcompat_once = ISC_ONCE_INIT;
+isc_boolean_t bsdcompat = ISC_TRUE;
+
+static void
+clear_bsdcompat(void) {
+#ifdef __linux__
+ struct utsname buf;
+ char *endp;
+ long int major;
+ long int minor;
+
+ uname(&buf); /* Can only fail if buf is bad in Linux. */
+
+ /* Paranoia in parsing can be increased, but we trust uname(). */
+ major = strtol(buf.release, &endp, 10);
+ if (*endp == '.') {
+ minor = strtol(endp+1, &endp, 10);
+ if ((major > 2) || ((major == 2) && (minor >= 4))) {
+ bsdcompat = ISC_FALSE;
+ }
+ }
+#endif /* __linux __ */
+}
+#endif
+
+static isc_result_t
+opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
+ isc__socket_t *dup_socket)
+{
+ isc_result_t result;
+ char strbuf[ISC_STRERRORSIZE];
+ const char *err = "socket";
+ int tries = 0;
+#if defined(USE_CMSG) || defined(SO_BSDCOMPAT)
+ int on = 1;
+#endif
+#if defined(SO_RCVBUF)
+ ISC_SOCKADDR_LEN_T optlen;
+ int size;
+#endif
+
+ again:
+ if (dup_socket == NULL) {
+ switch (sock->type) {
+ case isc_sockettype_udp:
+ sock->fd = socket(sock->pf, SOCK_DGRAM, IPPROTO_UDP);
+ break;
+ case isc_sockettype_tcp:
+ sock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP);
+ break;
+ case isc_sockettype_unix:
+ sock->fd = socket(sock->pf, SOCK_STREAM, 0);
+ break;
+ case isc_sockettype_fdwatch:
+ /*
+ * We should not be called for isc_sockettype_fdwatch
+ * sockets.
+ */
+ INSIST(0);
+ break;
+ }
+ } else {
+ sock->fd = dup(dup_socket->fd);
+ sock->dupped = 1;
+ sock->bound = dup_socket->bound;
+ }
+ if (sock->fd == -1 && errno == EINTR && tries++ < 42)
+ goto again;
+
+#ifdef F_DUPFD
+ /*
+ * Leave a space for stdio and TCP to work in.
+ */
+ if (manager->reserved != 0 && sock->type == isc_sockettype_udp &&
+ sock->fd >= 0 && sock->fd < manager->reserved) {
+ int new, tmp;
+ new = fcntl(sock->fd, F_DUPFD, manager->reserved);
+ tmp = errno;
+ (void)close(sock->fd);
+ errno = tmp;
+ sock->fd = new;
+ err = "isc_socket_create: fcntl/reserved";
+ } else if (sock->fd >= 0 && sock->fd < 20) {
+ int new, tmp;
+ new = fcntl(sock->fd, F_DUPFD, 20);
+ tmp = errno;
+ (void)close(sock->fd);
+ errno = tmp;
+ sock->fd = new;
+ err = "isc_socket_create: fcntl";
+ }
+#endif
+
+ if (sock->fd >= (int)manager->maxsocks) {
+ (void)close(sock->fd);
+ isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_TOOMANYFDS,
+ "socket: file descriptor exceeds limit (%d/%u)",
+ sock->fd, manager->maxsocks);
+ return (ISC_R_NORESOURCES);
+ }
+
+ if (sock->fd < 0) {
+ switch (errno) {
+ case EMFILE:
+ case ENFILE:
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_TOOMANYFDS,
+ "%s: %s", err, strbuf);
+ /* fallthrough */
+ case ENOBUFS:
+ return (ISC_R_NORESOURCES);
+
+ case EPROTONOSUPPORT:
+ case EPFNOSUPPORT:
+ case EAFNOSUPPORT:
+ /*
+ * Linux 2.2 (and maybe others) return EINVAL instead of
+ * EAFNOSUPPORT.
+ */
+ case EINVAL:
+ return (ISC_R_FAMILYNOSUPPORT);
+
+ default:
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "%s() %s: %s", err,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+
+ if (dup_socket != NULL)
+ goto setup_done;
+
+ result = make_nonblock(sock->fd);
+ if (result != ISC_R_SUCCESS) {
+ (void)close(sock->fd);
+ return (result);
+ }
+
+#ifdef SO_BSDCOMPAT
+ RUNTIME_CHECK(isc_once_do(&bsdcompat_once,
+ clear_bsdcompat) == ISC_R_SUCCESS);
+ if (sock->type != isc_sockettype_unix && bsdcompat &&
+ setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT,
+ (void *)&on, sizeof(on)) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, SO_BSDCOMPAT) %s: %s",
+ sock->fd,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+ /* Press on... */
+ }
+#endif
+
+#ifdef SO_NOSIGPIPE
+ if (setsockopt(sock->fd, SOL_SOCKET, SO_NOSIGPIPE,
+ (void *)&on, sizeof(on)) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, SO_NOSIGPIPE) %s: %s",
+ sock->fd,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+ /* Press on... */
+ }
+#endif
+
+#if defined(USE_CMSG) || defined(SO_RCVBUF)
+ if (sock->type == isc_sockettype_udp) {
+
+#if defined(USE_CMSG)
+#if defined(SO_TIMESTAMP)
+ if (setsockopt(sock->fd, SOL_SOCKET, SO_TIMESTAMP,
+ (void *)&on, sizeof(on)) < 0
+ && errno != ENOPROTOOPT) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, SO_TIMESTAMP) %s: %s",
+ sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ /* Press on... */
+ }
+#endif /* SO_TIMESTAMP */
+
+#if defined(ISC_PLATFORM_HAVEIPV6)
+ if (sock->pf == AF_INET6 && sock->recvcmsgbuflen == 0U) {
+ /*
+ * Warn explicitly because this anomaly can be hidden
+ * in usual operation (and unexpectedly appear later).
+ */
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "No buffer available to receive "
+ "IPv6 destination");
+ }
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+#ifdef IPV6_RECVPKTINFO
+ /* RFC 3542 */
+ if ((sock->pf == AF_INET6)
+ && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
+ (void *)&on, sizeof(on)) < 0)) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, IPV6_RECVPKTINFO) "
+ "%s: %s", sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+#else
+ /* RFC 2292 */
+ if ((sock->pf == AF_INET6)
+ && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO,
+ (void *)&on, sizeof(on)) < 0)) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, IPV6_PKTINFO) %s: %s",
+ sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+#endif /* IPV6_RECVPKTINFO */
+#endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
+#ifdef IPV6_USE_MIN_MTU /* RFC 3542, not too common yet*/
+ /* use minimum MTU */
+ if (sock->pf == AF_INET6 &&
+ setsockopt(sock->fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU,
+ (void *)&on, sizeof(on)) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, IPV6_USE_MIN_MTU) "
+ "%s: %s", sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+#endif
+#if defined(IPV6_MTU)
+ /*
+ * Use minimum MTU on IPv6 sockets.
+ */
+ if (sock->pf == AF_INET6) {
+ int mtu = 1280;
+ (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_MTU,
+ &mtu, sizeof(mtu));
+ }
+#endif
+#if defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT)
+ /*
+ * Turn off Path MTU discovery on IPv6/UDP sockets.
+ */
+ if (sock->pf == AF_INET6) {
+ int action = IPV6_PMTUDISC_DONT;
+ (void)setsockopt(sock->fd, IPPROTO_IPV6,
+ IPV6_MTU_DISCOVER, &action,
+ sizeof(action));
+ }
+#endif
+#endif /* ISC_PLATFORM_HAVEIPV6 */
+#endif /* defined(USE_CMSG) */
+
+#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
+ /*
+ * Turn off Path MTU discovery on IPv4/UDP sockets.
+ */
+ if (sock->pf == AF_INET) {
+ int action = IP_PMTUDISC_DONT;
+ (void)setsockopt(sock->fd, IPPROTO_IP, IP_MTU_DISCOVER,
+ &action, sizeof(action));
+ }
+#endif
+#if defined(IP_DONTFRAG)
+ /*
+ * Turn off Path MTU discovery on IPv4/UDP sockets.
+ */
+ if (sock->pf == AF_INET) {
+ int off = 0;
+ (void)setsockopt(sock->fd, IPPROTO_IP, IP_DONTFRAG,
+ &off, sizeof(off));
+ }
+#endif
+
+#if defined(SO_RCVBUF)
+ optlen = sizeof(size);
+ if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF,
+ (void *)&size, &optlen) >= 0 &&
+ size < RCVBUFSIZE) {
+ size = RCVBUFSIZE;
+ if (setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF,
+ (void *)&size, sizeof(size)) == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, SO_RCVBUF, %d) %s: %s",
+ sock->fd, size,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+ }
+#endif
+ }
+#endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */
+
+setup_done:
+ inc_stats(manager->stats, sock->statsindex[STATID_OPEN]);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Create a 'type' socket or duplicate an existing socket, managed
+ * by 'manager'. Events will be posted to 'task' and when dispatched
+ * 'action' will be called with 'arg' as the arg value. The new
+ * socket is returned in 'socketp'.
+ */
+static isc_result_t
+socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
+ isc_socket_t **socketp, isc_socket_t *dup_socket)
+{
+ isc__socket_t *sock = NULL;
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+ isc_result_t result;
+ int lockid;
+
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+ REQUIRE(type != isc_sockettype_fdwatch);
+
+ result = allocate_socket(manager, type, &sock);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ switch (sock->type) {
+ case isc_sockettype_udp:
+ sock->statsindex =
+ (pf == AF_INET) ? upd4statsindex : upd6statsindex;
+ break;
+ case isc_sockettype_tcp:
+ sock->statsindex =
+ (pf == AF_INET) ? tcp4statsindex : tcp6statsindex;
+ break;
+ case isc_sockettype_unix:
+ sock->statsindex = unixstatsindex;
+ break;
+ default:
+ INSIST(0);
+ }
+
+ sock->pf = pf;
+
+ result = opensocket(manager, sock, (isc__socket_t *)dup_socket);
+ if (result != ISC_R_SUCCESS) {
+ inc_stats(manager->stats, sock->statsindex[STATID_OPENFAIL]);
+ free_socket(&sock);
+ return (result);
+ }
+
+ sock->common.methods = (isc_socketmethods_t *)&socketmethods;
+ sock->references = 1;
+ *socketp = (isc_socket_t *)sock;
+
+ /*
+ * Note we don't have to lock the socket like we normally would because
+ * there are no external references to it yet.
+ */
+
+ lockid = FDLOCK_ID(sock->fd);
+ LOCK(&manager->fdlock[lockid]);
+ manager->fds[sock->fd] = sock;
+ manager->fdstate[sock->fd] = MANAGED;
+#ifdef USE_DEVPOLL
+ INSIST(sock->manager->fdpollinfo[sock->fd].want_read == 0 &&
+ sock->manager->fdpollinfo[sock->fd].want_write == 0);
+#endif
+ UNLOCK(&manager->fdlock[lockid]);
+
+ LOCK(&manager->lock);
+ ISC_LIST_APPEND(manager->socklist, sock, link);
+#ifdef USE_SELECT
+ if (manager->maxfd < sock->fd)
+ manager->maxfd = sock->fd;
+#endif
+ UNLOCK(&manager->lock);
+
+ socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_CREATED, dup_socket == NULL ? "dupped" : "created");
+
+ return (ISC_R_SUCCESS);
+}
+
+/*%
+ * Create a new 'type' socket managed by 'manager'. Events
+ * will be posted to 'task' and when dispatched 'action' will be
+ * called with 'arg' as the arg value. The new socket is returned
+ * in 'socketp'.
+ */
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
+ isc_socket_t **socketp)
+{
+ return (socket_create(manager0, pf, type, socketp, NULL));
+}
+
+/*%
+ * Duplicate an existing socket. The new socket is returned
+ * in 'socketp'.
+ */
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_dup(isc_socket_t *sock0, isc_socket_t **socketp) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+
+ return (socket_create((isc_socketmgr_t *) sock->manager,
+ sock->pf, sock->type, socketp,
+ sock0));
+}
+
+#ifdef BIND9
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_open(isc_socket_t *sock0) {
+ isc_result_t result;
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ REQUIRE(sock->references == 1);
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
+ UNLOCK(&sock->lock);
+ /*
+ * We don't need to retain the lock hereafter, since no one else has
+ * this socket.
+ */
+ REQUIRE(sock->fd == -1);
+
+ result = opensocket(sock->manager, sock, NULL);
+ if (result != ISC_R_SUCCESS)
+ sock->fd = -1;
+
+ if (result == ISC_R_SUCCESS) {
+ int lockid = FDLOCK_ID(sock->fd);
+
+ LOCK(&sock->manager->fdlock[lockid]);
+ sock->manager->fds[sock->fd] = sock;
+ sock->manager->fdstate[sock->fd] = MANAGED;
+#ifdef USE_DEVPOLL
+ INSIST(sock->manager->fdpollinfo[sock->fd].want_read == 0 &&
+ sock->manager->fdpollinfo[sock->fd].want_write == 0);
+#endif
+ UNLOCK(&sock->manager->fdlock[lockid]);
+
+#ifdef USE_SELECT
+ LOCK(&sock->manager->lock);
+ if (sock->manager->maxfd < sock->fd)
+ sock->manager->maxfd = sock->fd;
+ UNLOCK(&sock->manager->lock);
+#endif
+ }
+
+ return (result);
+}
+#endif /* BIND9 */
+
+/*
+ * Create a new 'type' socket managed by 'manager'. Events
+ * will be posted to 'task' and when dispatched 'action' will be
+ * called with 'arg' as the arg value. The new socket is returned
+ * in 'socketp'.
+ */
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_fdwatchcreate(isc_socketmgr_t *manager0, int fd, int flags,
+ isc_sockfdwatch_t callback, void *cbarg,
+ isc_task_t *task, isc_socket_t **socketp)
+{
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+ isc__socket_t *sock = NULL;
+ isc_result_t result;
+ int lockid;
+
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+
+ result = allocate_socket(manager, isc_sockettype_fdwatch, &sock);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ sock->fd = fd;
+ sock->fdwatcharg = cbarg;
+ sock->fdwatchcb = callback;
+ sock->fdwatchflags = flags;
+ sock->fdwatchtask = task;
+ sock->statsindex = fdwatchstatsindex;
+
+ sock->common.methods = (isc_socketmethods_t *)&socketmethods;
+ sock->references = 1;
+ *socketp = (isc_socket_t *)sock;
+
+ /*
+ * Note we don't have to lock the socket like we normally would because
+ * there are no external references to it yet.
+ */
+
+ lockid = FDLOCK_ID(sock->fd);
+ LOCK(&manager->fdlock[lockid]);
+ manager->fds[sock->fd] = sock;
+ manager->fdstate[sock->fd] = MANAGED;
+ UNLOCK(&manager->fdlock[lockid]);
+
+ LOCK(&manager->lock);
+ ISC_LIST_APPEND(manager->socklist, sock, link);
+#ifdef USE_SELECT
+ if (manager->maxfd < sock->fd)
+ manager->maxfd = sock->fd;
+#endif
+ UNLOCK(&manager->lock);
+
+ if (flags & ISC_SOCKFDWATCH_READ)
+ select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
+ if (flags & ISC_SOCKFDWATCH_WRITE)
+ select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE);
+
+ socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_CREATED, "fdwatch-created");
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Indicate to the manager that it should watch the socket again.
+ * This can be used to restart watching if the previous event handler
+ * didn't indicate there was more data to be processed. Primarily
+ * it is for writing but could be used for reading if desired
+ */
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_fdwatchpoke(isc_socket_t *sock0, int flags)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ /*
+ * We check both flags first to allow us to get the lock
+ * once but only if we need it.
+ */
+
+ if ((flags & (ISC_SOCKFDWATCH_READ | ISC_SOCKFDWATCH_WRITE)) != 0) {
+ LOCK(&sock->lock);
+ if (((flags & ISC_SOCKFDWATCH_READ) != 0) &&
+ !sock->pending_recv)
+ select_poke(sock->manager, sock->fd,
+ SELECT_POKE_READ);
+ if (((flags & ISC_SOCKFDWATCH_WRITE) != 0) &&
+ !sock->pending_send)
+ select_poke(sock->manager, sock->fd,
+ SELECT_POKE_WRITE);
+ UNLOCK(&sock->lock);
+ }
+
+ socket_log(sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_POKED, "fdwatch-poked flags: %d", flags);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Attach to a socket. Caller must explicitly detach when it is done.
+ */
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_attach(isc_socket_t *sock0, isc_socket_t **socketp) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+
+ LOCK(&sock->lock);
+ sock->references++;
+ UNLOCK(&sock->lock);
+
+ *socketp = (isc_socket_t *)sock;
+}
+
+/*
+ * Dereference a socket. If this is the last reference to it, clean things
+ * up by destroying the socket.
+ */
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_detach(isc_socket_t **socketp) {
+ isc__socket_t *sock;
+ isc_boolean_t kill_socket = ISC_FALSE;
+
+ REQUIRE(socketp != NULL);
+ sock = (isc__socket_t *)*socketp;
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ REQUIRE(sock->references > 0);
+ sock->references--;
+ if (sock->references == 0)
+ kill_socket = ISC_TRUE;
+ UNLOCK(&sock->lock);
+
+ if (kill_socket)
+ destroy(&sock);
+
+ *socketp = NULL;
+}
+
+#ifdef BIND9
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_close(isc_socket_t *sock0) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ int fd;
+ isc__socketmgr_t *manager;
+
+ fflush(stdout);
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+
+ REQUIRE(sock->references == 1);
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
+ REQUIRE(sock->fd >= 0 && sock->fd < (int)sock->manager->maxsocks);
+
+ INSIST(!sock->connecting);
+ INSIST(!sock->pending_recv);
+ INSIST(!sock->pending_send);
+ INSIST(!sock->pending_accept);
+ INSIST(ISC_LIST_EMPTY(sock->recv_list));
+ INSIST(ISC_LIST_EMPTY(sock->send_list));
+ INSIST(ISC_LIST_EMPTY(sock->accept_list));
+ INSIST(sock->connect_ev == NULL);
+
+ manager = sock->manager;
+ fd = sock->fd;
+ sock->fd = -1;
+ sock->dupped = 0;
+ memset(sock->name, 0, sizeof(sock->name));
+ sock->tag = NULL;
+ sock->listener = 0;
+ sock->connected = 0;
+ sock->connecting = 0;
+ sock->bound = 0;
+ isc_sockaddr_any(&sock->peer_address);
+
+ UNLOCK(&sock->lock);
+
+ closesocket(manager, sock, fd);
+
+ return (ISC_R_SUCCESS);
+}
+#endif /* BIND9 */
+
+/*
+ * I/O is possible on a given socket. Schedule an event to this task that
+ * will call an internal function to do the I/O. This will charge the
+ * task with the I/O operation and let our select loop handler get back
+ * to doing something real as fast as possible.
+ *
+ * The socket and manager must be locked before calling this function.
+ */
+static void
+dispatch_recv(isc__socket_t *sock) {
+ intev_t *iev;
+ isc_socketevent_t *ev;
+ isc_task_t *sender;
+
+ INSIST(!sock->pending_recv);
+
+ if (sock->type != isc_sockettype_fdwatch) {
+ ev = ISC_LIST_HEAD(sock->recv_list);
+ if (ev == NULL)
+ return;
+ socket_log(sock, NULL, EVENT, NULL, 0, 0,
+ "dispatch_recv: event %p -> task %p",
+ ev, ev->ev_sender);
+ sender = ev->ev_sender;
+ } else {
+ sender = sock->fdwatchtask;
+ }
+
+ sock->pending_recv = 1;
+ iev = &sock->readable_ev;
+
+ sock->references++;
+ iev->ev_sender = sock;
+ if (sock->type == isc_sockettype_fdwatch)
+ iev->ev_action = internal_fdwatch_read;
+ else
+ iev->ev_action = internal_recv;
+ iev->ev_arg = sock;
+
+ isc_task_send(sender, (isc_event_t **)&iev);
+}
+
+static void
+dispatch_send(isc__socket_t *sock) {
+ intev_t *iev;
+ isc_socketevent_t *ev;
+ isc_task_t *sender;
+
+ INSIST(!sock->pending_send);
+
+ if (sock->type != isc_sockettype_fdwatch) {
+ ev = ISC_LIST_HEAD(sock->send_list);
+ if (ev == NULL)
+ return;
+ socket_log(sock, NULL, EVENT, NULL, 0, 0,
+ "dispatch_send: event %p -> task %p",
+ ev, ev->ev_sender);
+ sender = ev->ev_sender;
+ } else {
+ sender = sock->fdwatchtask;
+ }
+
+ sock->pending_send = 1;
+ iev = &sock->writable_ev;
+
+ sock->references++;
+ iev->ev_sender = sock;
+ if (sock->type == isc_sockettype_fdwatch)
+ iev->ev_action = internal_fdwatch_write;
+ else
+ iev->ev_action = internal_send;
+ iev->ev_arg = sock;
+
+ isc_task_send(sender, (isc_event_t **)&iev);
+}
+
+/*
+ * Dispatch an internal accept event.
+ */
+static void
+dispatch_accept(isc__socket_t *sock) {
+ intev_t *iev;
+ isc_socket_newconnev_t *ev;
+
+ INSIST(!sock->pending_accept);
+
+ /*
+ * Are there any done events left, or were they all canceled
+ * before the manager got the socket lock?
+ */
+ ev = ISC_LIST_HEAD(sock->accept_list);
+ if (ev == NULL)
+ return;
+
+ sock->pending_accept = 1;
+ iev = &sock->readable_ev;
+
+ sock->references++; /* keep socket around for this internal event */
+ iev->ev_sender = sock;
+ iev->ev_action = internal_accept;
+ iev->ev_arg = sock;
+
+ isc_task_send(ev->ev_sender, (isc_event_t **)&iev);
+}
+
+static void
+dispatch_connect(isc__socket_t *sock) {
+ intev_t *iev;
+ isc_socket_connev_t *ev;
+
+ iev = &sock->writable_ev;
+
+ ev = sock->connect_ev;
+ INSIST(ev != NULL); /* XXX */
+
+ INSIST(sock->connecting);
+
+ sock->references++; /* keep socket around for this internal event */
+ iev->ev_sender = sock;
+ iev->ev_action = internal_connect;
+ iev->ev_arg = sock;
+
+ isc_task_send(ev->ev_sender, (isc_event_t **)&iev);
+}
+
+/*
+ * Dequeue an item off the given socket's read queue, set the result code
+ * in the done event to the one provided, and send it to the task it was
+ * destined for.
+ *
+ * If the event to be sent is on a list, remove it before sending. If
+ * asked to, send and detach from the socket as well.
+ *
+ * Caller must have the socket locked if the event is attached to the socket.
+ */
+static void
+send_recvdone_event(isc__socket_t *sock, isc_socketevent_t **dev) {
+ isc_task_t *task;
+
+ task = (*dev)->ev_sender;
+
+ (*dev)->ev_sender = sock;
+
+ if (ISC_LINK_LINKED(*dev, ev_link))
+ ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link);
+
+ if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
+ == ISC_SOCKEVENTATTR_ATTACHED)
+ isc_task_sendanddetach(&task, (isc_event_t **)dev);
+ else
+ isc_task_send(task, (isc_event_t **)dev);
+}
+
+/*
+ * See comments for send_recvdone_event() above.
+ *
+ * Caller must have the socket locked if the event is attached to the socket.
+ */
+static void
+send_senddone_event(isc__socket_t *sock, isc_socketevent_t **dev) {
+ isc_task_t *task;
+
+ INSIST(dev != NULL && *dev != NULL);
+
+ task = (*dev)->ev_sender;
+ (*dev)->ev_sender = sock;
+
+ if (ISC_LINK_LINKED(*dev, ev_link))
+ ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link);
+
+ if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
+ == ISC_SOCKEVENTATTR_ATTACHED)
+ isc_task_sendanddetach(&task, (isc_event_t **)dev);
+ else
+ isc_task_send(task, (isc_event_t **)dev);
+}
+
+/*
+ * Call accept() on a socket, to get the new file descriptor. The listen
+ * socket is used as a prototype to create a new isc_socket_t. The new
+ * socket has one outstanding reference. The task receiving the event
+ * will be detached from just after the event is delivered.
+ *
+ * On entry to this function, the event delivered is the internal
+ * readable event, and the first item on the accept_list should be
+ * the done event we want to send. If the list is empty, this is a no-op,
+ * so just unlock and return.
+ */
+static void
+internal_accept(isc_task_t *me, isc_event_t *ev) {
+ isc__socket_t *sock;
+ isc__socketmgr_t *manager;
+ isc_socket_newconnev_t *dev;
+ isc_task_t *task;
+ ISC_SOCKADDR_LEN_T addrlen;
+ int fd;
+ isc_result_t result = ISC_R_SUCCESS;
+ char strbuf[ISC_STRERRORSIZE];
+ const char *err = "accept";
+
+ UNUSED(me);
+
+ sock = ev->ev_sender;
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ socket_log(sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK,
+ "internal_accept called, locked socket");
+
+ manager = sock->manager;
+ INSIST(VALID_MANAGER(manager));
+
+ INSIST(sock->listener);
+ INSIST(sock->pending_accept == 1);
+ sock->pending_accept = 0;
+
+ INSIST(sock->references > 0);
+ sock->references--; /* the internal event is done with this socket */
+ if (sock->references == 0) {
+ UNLOCK(&sock->lock);
+ destroy(&sock);
+ return;
+ }
+
+ /*
+ * Get the first item off the accept list.
+ * If it is empty, unlock the socket and return.
+ */
+ dev = ISC_LIST_HEAD(sock->accept_list);
+ if (dev == NULL) {
+ UNLOCK(&sock->lock);
+ return;
+ }
+
+ /*
+ * Try to accept the new connection. If the accept fails with
+ * EAGAIN or EINTR, simply poke the watcher to watch this socket
+ * again. Also ignore ECONNRESET, which has been reported to
+ * be spuriously returned on Linux 2.2.19 although it is not
+ * a documented error for accept(). ECONNABORTED has been
+ * reported for Solaris 8. The rest are thrown in not because
+ * we have seen them but because they are ignored by other
+ * daemons such as BIND 8 and Apache.
+ */
+
+ addrlen = sizeof(NEWCONNSOCK(dev)->peer_address.type);
+ memset(&NEWCONNSOCK(dev)->peer_address.type, 0, addrlen);
+ fd = accept(sock->fd, &NEWCONNSOCK(dev)->peer_address.type.sa,
+ (void *)&addrlen);
+
+#ifdef F_DUPFD
+ /*
+ * Leave a space for stdio to work in.
+ */
+ if (fd >= 0 && fd < 20) {
+ int new, tmp;
+ new = fcntl(fd, F_DUPFD, 20);
+ tmp = errno;
+ (void)close(fd);
+ errno = tmp;
+ fd = new;
+ err = "accept/fcntl";
+ }
+#endif
+
+ if (fd < 0) {
+ if (SOFT_ERROR(errno))
+ goto soft_error;
+ switch (errno) {
+ case ENFILE:
+ case EMFILE:
+ isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_TOOMANYFDS,
+ "%s: too many open file descriptors",
+ err);
+ goto soft_error;
+
+ case ENOBUFS:
+ case ENOMEM:
+ case ECONNRESET:
+ case ECONNABORTED:
+ case EHOSTUNREACH:
+ case EHOSTDOWN:
+ case ENETUNREACH:
+ case ENETDOWN:
+ case ECONNREFUSED:
+#ifdef EPROTO
+ case EPROTO:
+#endif
+#ifdef ENONET
+ case ENONET:
+#endif
+ goto soft_error;
+ default:
+ break;
+ }
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "internal_accept: %s() %s: %s", err,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ fd = -1;
+ result = ISC_R_UNEXPECTED;
+ } else {
+ if (addrlen == 0U) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "internal_accept(): "
+ "accept() failed to return "
+ "remote address");
+
+ (void)close(fd);
+ goto soft_error;
+ } else if (NEWCONNSOCK(dev)->peer_address.type.sa.sa_family !=
+ sock->pf)
+ {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "internal_accept(): "
+ "accept() returned peer address "
+ "family %u (expected %u)",
+ NEWCONNSOCK(dev)->peer_address.
+ type.sa.sa_family,
+ sock->pf);
+ (void)close(fd);
+ goto soft_error;
+ } else if (fd >= (int)manager->maxsocks) {
+ isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_TOOMANYFDS,
+ "accept: "
+ "file descriptor exceeds limit (%d/%u)",
+ fd, manager->maxsocks);
+ (void)close(fd);
+ goto soft_error;
+ }
+ }
+
+ if (fd != -1) {
+ NEWCONNSOCK(dev)->peer_address.length = addrlen;
+ NEWCONNSOCK(dev)->pf = sock->pf;
+ }
+
+ /*
+ * Pull off the done event.
+ */
+ ISC_LIST_UNLINK(sock->accept_list, dev, ev_link);
+
+ /*
+ * Poke watcher if there are more pending accepts.
+ */
+ if (!ISC_LIST_EMPTY(sock->accept_list))
+ select_poke(sock->manager, sock->fd, SELECT_POKE_ACCEPT);
+
+ UNLOCK(&sock->lock);
+
+ if (fd != -1) {
+ result = make_nonblock(fd);
+ if (result != ISC_R_SUCCESS) {
+ (void)close(fd);
+ fd = -1;
+ }
+ }
+
+ /*
+ * -1 means the new socket didn't happen.
+ */
+ if (fd != -1) {
+ int lockid = FDLOCK_ID(fd);
+
+ LOCK(&manager->fdlock[lockid]);
+ manager->fds[fd] = NEWCONNSOCK(dev);
+ manager->fdstate[fd] = MANAGED;
+ UNLOCK(&manager->fdlock[lockid]);
+
+ LOCK(&manager->lock);
+ ISC_LIST_APPEND(manager->socklist, NEWCONNSOCK(dev), link);
+
+ NEWCONNSOCK(dev)->fd = fd;
+ NEWCONNSOCK(dev)->bound = 1;
+ NEWCONNSOCK(dev)->connected = 1;
+
+ /*
+ * Save away the remote address
+ */
+ dev->address = NEWCONNSOCK(dev)->peer_address;
+
+#ifdef USE_SELECT
+ if (manager->maxfd < fd)
+ manager->maxfd = fd;
+#endif
+
+ socket_log(sock, &NEWCONNSOCK(dev)->peer_address, CREATION,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN,
+ "accepted connection, new socket %p",
+ dev->newsocket);
+
+ UNLOCK(&manager->lock);
+
+ inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]);
+ } else {
+ inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]);
+ NEWCONNSOCK(dev)->references--;
+ free_socket((isc__socket_t **)&dev->newsocket);
+ }
+
+ /*
+ * Fill in the done event details and send it off.
+ */
+ dev->result = result;
+ task = dev->ev_sender;
+ dev->ev_sender = sock;
+
+ isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev));
+ return;
+
+ soft_error:
+ select_poke(sock->manager, sock->fd, SELECT_POKE_ACCEPT);
+ UNLOCK(&sock->lock);
+
+ inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]);
+ return;
+}
+
+static void
+internal_recv(isc_task_t *me, isc_event_t *ev) {
+ isc_socketevent_t *dev;
+ isc__socket_t *sock;
+
+ INSIST(ev->ev_type == ISC_SOCKEVENT_INTR);
+
+ sock = ev->ev_sender;
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ socket_log(sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV,
+ "internal_recv: task %p got event %p", me, ev);
+
+ INSIST(sock->pending_recv == 1);
+ sock->pending_recv = 0;
+
+ INSIST(sock->references > 0);
+ sock->references--; /* the internal event is done with this socket */
+ if (sock->references == 0) {
+ UNLOCK(&sock->lock);
+ destroy(&sock);
+ return;
+ }
+
+ /*
+ * Try to do as much I/O as possible on this socket. There are no
+ * limits here, currently.
+ */
+ dev = ISC_LIST_HEAD(sock->recv_list);
+ while (dev != NULL) {
+ switch (doio_recv(sock, dev)) {
+ case DOIO_SOFT:
+ goto poke;
+
+ case DOIO_EOF:
+ /*
+ * read of 0 means the remote end was closed.
+ * Run through the event queue and dispatch all
+ * the events with an EOF result code.
+ */
+ do {
+ dev->result = ISC_R_EOF;
+ send_recvdone_event(sock, &dev);
+ dev = ISC_LIST_HEAD(sock->recv_list);
+ } while (dev != NULL);
+ goto poke;
+
+ case DOIO_SUCCESS:
+ case DOIO_HARD:
+ send_recvdone_event(sock, &dev);
+ break;
+ }
+
+ dev = ISC_LIST_HEAD(sock->recv_list);
+ }
+
+ poke:
+ if (!ISC_LIST_EMPTY(sock->recv_list))
+ select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
+
+ UNLOCK(&sock->lock);
+}
+
+static void
+internal_send(isc_task_t *me, isc_event_t *ev) {
+ isc_socketevent_t *dev;
+ isc__socket_t *sock;
+
+ INSIST(ev->ev_type == ISC_SOCKEVENT_INTW);
+
+ /*
+ * Find out what socket this is and lock it.
+ */
+ sock = (isc__socket_t *)ev->ev_sender;
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ socket_log(sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND,
+ "internal_send: task %p got event %p", me, ev);
+
+ INSIST(sock->pending_send == 1);
+ sock->pending_send = 0;
+
+ INSIST(sock->references > 0);
+ sock->references--; /* the internal event is done with this socket */
+ if (sock->references == 0) {
+ UNLOCK(&sock->lock);
+ destroy(&sock);
+ return;
+ }
+
+ /*
+ * Try to do as much I/O as possible on this socket. There are no
+ * limits here, currently.
+ */
+ dev = ISC_LIST_HEAD(sock->send_list);
+ while (dev != NULL) {
+ switch (doio_send(sock, dev)) {
+ case DOIO_SOFT:
+ goto poke;
+
+ case DOIO_HARD:
+ case DOIO_SUCCESS:
+ send_senddone_event(sock, &dev);
+ break;
+ }
+
+ dev = ISC_LIST_HEAD(sock->send_list);
+ }
+
+ poke:
+ if (!ISC_LIST_EMPTY(sock->send_list))
+ select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE);
+
+ UNLOCK(&sock->lock);
+}
+
+static void
+internal_fdwatch_write(isc_task_t *me, isc_event_t *ev) {
+ isc__socket_t *sock;
+ int more_data;
+
+ INSIST(ev->ev_type == ISC_SOCKEVENT_INTW);
+
+ /*
+ * Find out what socket this is and lock it.
+ */
+ sock = (isc__socket_t *)ev->ev_sender;
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ socket_log(sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND,
+ "internal_fdwatch_write: task %p got event %p", me, ev);
+
+ INSIST(sock->pending_send == 1);
+
+ UNLOCK(&sock->lock);
+ more_data = (sock->fdwatchcb)(me, (isc_socket_t *)sock,
+ sock->fdwatcharg, ISC_SOCKFDWATCH_WRITE);
+ LOCK(&sock->lock);
+
+ sock->pending_send = 0;
+
+ INSIST(sock->references > 0);
+ sock->references--; /* the internal event is done with this socket */
+ if (sock->references == 0) {
+ UNLOCK(&sock->lock);
+ destroy(&sock);
+ return;
+ }
+
+ if (more_data)
+ select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE);
+
+ UNLOCK(&sock->lock);
+}
+
+static void
+internal_fdwatch_read(isc_task_t *me, isc_event_t *ev) {
+ isc__socket_t *sock;
+ int more_data;
+
+ INSIST(ev->ev_type == ISC_SOCKEVENT_INTR);
+
+ /*
+ * Find out what socket this is and lock it.
+ */
+ sock = (isc__socket_t *)ev->ev_sender;
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ socket_log(sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV,
+ "internal_fdwatch_read: task %p got event %p", me, ev);
+
+ INSIST(sock->pending_recv == 1);
+
+ UNLOCK(&sock->lock);
+ more_data = (sock->fdwatchcb)(me, (isc_socket_t *)sock,
+ sock->fdwatcharg, ISC_SOCKFDWATCH_READ);
+ LOCK(&sock->lock);
+
+ sock->pending_recv = 0;
+
+ INSIST(sock->references > 0);
+ sock->references--; /* the internal event is done with this socket */
+ if (sock->references == 0) {
+ UNLOCK(&sock->lock);
+ destroy(&sock);
+ return;
+ }
+
+ if (more_data)
+ select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
+
+ UNLOCK(&sock->lock);
+}
+
+/*
+ * Process read/writes on each fd here. Avoid locking
+ * and unlocking twice if both reads and writes are possible.
+ */
+static void
+process_fd(isc__socketmgr_t *manager, int fd, isc_boolean_t readable,
+ isc_boolean_t writeable)
+{
+ isc__socket_t *sock;
+ isc_boolean_t unlock_sock;
+ isc_boolean_t unwatch_read = ISC_FALSE, unwatch_write = ISC_FALSE;
+ int lockid = FDLOCK_ID(fd);
+
+ /*
+ * If the socket is going to be closed, don't do more I/O.
+ */
+ LOCK(&manager->fdlock[lockid]);
+ if (manager->fdstate[fd] == CLOSE_PENDING) {
+ UNLOCK(&manager->fdlock[lockid]);
+
+ (void)unwatch_fd(manager, fd, SELECT_POKE_READ);
+ (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
+ return;
+ }
+
+ sock = manager->fds[fd];
+ unlock_sock = ISC_FALSE;
+ if (readable) {
+ if (sock == NULL) {
+ unwatch_read = ISC_TRUE;
+ goto check_write;
+ }
+ unlock_sock = ISC_TRUE;
+ LOCK(&sock->lock);
+ if (!SOCK_DEAD(sock)) {
+ if (sock->listener)
+ dispatch_accept(sock);
+ else
+ dispatch_recv(sock);
+ }
+ unwatch_read = ISC_TRUE;
+ }
+check_write:
+ if (writeable) {
+ if (sock == NULL) {
+ unwatch_write = ISC_TRUE;
+ goto unlock_fd;
+ }
+ if (!unlock_sock) {
+ unlock_sock = ISC_TRUE;
+ LOCK(&sock->lock);
+ }
+ if (!SOCK_DEAD(sock)) {
+ if (sock->connecting)
+ dispatch_connect(sock);
+ else
+ dispatch_send(sock);
+ }
+ unwatch_write = ISC_TRUE;
+ }
+ if (unlock_sock)
+ UNLOCK(&sock->lock);
+
+ unlock_fd:
+ UNLOCK(&manager->fdlock[lockid]);
+ if (unwatch_read)
+ (void)unwatch_fd(manager, fd, SELECT_POKE_READ);
+ if (unwatch_write)
+ (void)unwatch_fd(manager, fd, SELECT_POKE_WRITE);
+
+}
+
+#ifdef USE_KQUEUE
+static isc_boolean_t
+process_fds(isc__socketmgr_t *manager, struct kevent *events, int nevents) {
+ int i;
+ isc_boolean_t readable, writable;
+ isc_boolean_t done = ISC_FALSE;
+#ifdef USE_WATCHER_THREAD
+ isc_boolean_t have_ctlevent = ISC_FALSE;
+#endif
+
+ if (nevents == manager->nevents) {
+ /*
+ * This is not an error, but something unexpected. If this
+ * happens, it may indicate the need for increasing
+ * ISC_SOCKET_MAXEVENTS.
+ */
+ manager_log(manager, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_INFO,
+ "maximum number of FD events (%d) received",
+ nevents);
+ }
+
+ for (i = 0; i < nevents; i++) {
+ REQUIRE(events[i].ident < manager->maxsocks);
+#ifdef USE_WATCHER_THREAD
+ if (events[i].ident == (uintptr_t)manager->pipe_fds[0]) {
+ have_ctlevent = ISC_TRUE;
+ continue;
+ }
+#endif
+ readable = ISC_TF(events[i].filter == EVFILT_READ);
+ writable = ISC_TF(events[i].filter == EVFILT_WRITE);
+ process_fd(manager, events[i].ident, readable, writable);
+ }
+
+#ifdef USE_WATCHER_THREAD
+ if (have_ctlevent)
+ done = process_ctlfd(manager);
+#endif
+
+ return (done);
+}
+#elif defined(USE_EPOLL)
+static isc_boolean_t
+process_fds(isc__socketmgr_t *manager, struct epoll_event *events, int nevents)
+{
+ int i;
+ isc_boolean_t done = ISC_FALSE;
+#ifdef USE_WATCHER_THREAD
+ isc_boolean_t have_ctlevent = ISC_FALSE;
+#endif
+
+ if (nevents == manager->nevents) {
+ manager_log(manager, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_INFO,
+ "maximum number of FD events (%d) received",
+ nevents);
+ }
+
+ for (i = 0; i < nevents; i++) {
+ REQUIRE(events[i].data.fd < (int)manager->maxsocks);
+#ifdef USE_WATCHER_THREAD
+ if (events[i].data.fd == manager->pipe_fds[0]) {
+ have_ctlevent = ISC_TRUE;
+ continue;
+ }
+#endif
+ if ((events[i].events & EPOLLERR) != 0 ||
+ (events[i].events & EPOLLHUP) != 0) {
+ /*
+ * epoll does not set IN/OUT bits on an erroneous
+ * condition, so we need to try both anyway. This is a
+ * bit inefficient, but should be okay for such rare
+ * events. Note also that the read or write attempt
+ * won't block because we use non-blocking sockets.
+ */
+ events[i].events |= (EPOLLIN | EPOLLOUT);
+ }
+ process_fd(manager, events[i].data.fd,
+ (events[i].events & EPOLLIN) != 0,
+ (events[i].events & EPOLLOUT) != 0);
+ }
+
+#ifdef USE_WATCHER_THREAD
+ if (have_ctlevent)
+ done = process_ctlfd(manager);
+#endif
+
+ return (done);
+}
+#elif defined(USE_DEVPOLL)
+static isc_boolean_t
+process_fds(isc__socketmgr_t *manager, struct pollfd *events, int nevents) {
+ int i;
+ isc_boolean_t done = ISC_FALSE;
+#ifdef USE_WATCHER_THREAD
+ isc_boolean_t have_ctlevent = ISC_FALSE;
+#endif
+
+ if (nevents == manager->nevents) {
+ manager_log(manager, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_INFO,
+ "maximum number of FD events (%d) received",
+ nevents);
+ }
+
+ for (i = 0; i < nevents; i++) {
+ REQUIRE(events[i].fd < (int)manager->maxsocks);
+#ifdef USE_WATCHER_THREAD
+ if (events[i].fd == manager->pipe_fds[0]) {
+ have_ctlevent = ISC_TRUE;
+ continue;
+ }
+#endif
+ process_fd(manager, events[i].fd,
+ (events[i].events & POLLIN) != 0,
+ (events[i].events & POLLOUT) != 0);
+ }
+
+#ifdef USE_WATCHER_THREAD
+ if (have_ctlevent)
+ done = process_ctlfd(manager);
+#endif
+
+ return (done);
+}
+#elif defined(USE_SELECT)
+static void
+process_fds(isc__socketmgr_t *manager, int maxfd, fd_set *readfds,
+ fd_set *writefds)
+{
+ int i;
+
+ REQUIRE(maxfd <= (int)manager->maxsocks);
+
+ for (i = 0; i < maxfd; i++) {
+#ifdef USE_WATCHER_THREAD
+ if (i == manager->pipe_fds[0] || i == manager->pipe_fds[1])
+ continue;
+#endif /* USE_WATCHER_THREAD */
+ process_fd(manager, i, FD_ISSET(i, readfds),
+ FD_ISSET(i, writefds));
+ }
+}
+#endif
+
+#ifdef USE_WATCHER_THREAD
+static isc_boolean_t
+process_ctlfd(isc__socketmgr_t *manager) {
+ int msg, fd;
+
+ for (;;) {
+ select_readmsg(manager, &fd, &msg);
+
+ manager_log(manager, IOEVENT,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_WATCHERMSG,
+ "watcher got message %d "
+ "for socket %d"), msg, fd);
+
+ /*
+ * Nothing to read?
+ */
+ if (msg == SELECT_POKE_NOTHING)
+ break;
+
+ /*
+ * Handle shutdown message. We really should
+ * jump out of this loop right away, but
+ * it doesn't matter if we have to do a little
+ * more work first.
+ */
+ if (msg == SELECT_POKE_SHUTDOWN)
+ return (ISC_TRUE);
+
+ /*
+ * This is a wakeup on a socket. Look
+ * at the event queue for both read and write,
+ * and decide if we need to watch on it now
+ * or not.
+ */
+ wakeup_socket(manager, fd, msg);
+ }
+
+ return (ISC_FALSE);
+}
+
+/*
+ * This is the thread that will loop forever, always in a select or poll
+ * call.
+ *
+ * When select returns something to do, track down what thread gets to do
+ * this I/O and post the event to it.
+ */
+static isc_threadresult_t
+watcher(void *uap) {
+ isc__socketmgr_t *manager = uap;
+ isc_boolean_t done;
+ int cc;
+#ifdef USE_KQUEUE
+ const char *fnname = "kevent()";
+#elif defined (USE_EPOLL)
+ const char *fnname = "epoll_wait()";
+#elif defined(USE_DEVPOLL)
+ const char *fnname = "ioctl(DP_POLL)";
+ struct dvpoll dvp;
+#elif defined (USE_SELECT)
+ const char *fnname = "select()";
+ int maxfd;
+ int ctlfd;
+#endif
+ char strbuf[ISC_STRERRORSIZE];
+#ifdef ISC_SOCKET_USE_POLLWATCH
+ pollstate_t pollstate = poll_idle;
+#endif
+
+#if defined (USE_SELECT)
+ /*
+ * Get the control fd here. This will never change.
+ */
+ ctlfd = manager->pipe_fds[0];
+#endif
+ done = ISC_FALSE;
+ while (!done) {
+ do {
+#ifdef USE_KQUEUE
+ cc = kevent(manager->kqueue_fd, NULL, 0,
+ manager->events, manager->nevents, NULL);
+#elif defined(USE_EPOLL)
+ cc = epoll_wait(manager->epoll_fd, manager->events,
+ manager->nevents, -1);
+#elif defined(USE_DEVPOLL)
+ dvp.dp_fds = manager->events;
+ dvp.dp_nfds = manager->nevents;
+#ifndef ISC_SOCKET_USE_POLLWATCH
+ dvp.dp_timeout = -1;
+#else
+ if (pollstate == poll_idle)
+ dvp.dp_timeout = -1;
+ else
+ dvp.dp_timeout = ISC_SOCKET_POLLWATCH_TIMEOUT;
+#endif /* ISC_SOCKET_USE_POLLWATCH */
+ cc = ioctl(manager->devpoll_fd, DP_POLL, &dvp);
+#elif defined(USE_SELECT)
+ LOCK(&manager->lock);
+ memcpy(manager->read_fds_copy, manager->read_fds,
+ manager->fd_bufsize);
+ memcpy(manager->write_fds_copy, manager->write_fds,
+ manager->fd_bufsize);
+ maxfd = manager->maxfd + 1;
+ UNLOCK(&manager->lock);
+
+ cc = select(maxfd, manager->read_fds_copy,
+ manager->write_fds_copy, NULL, NULL);
+#endif /* USE_KQUEUE */
+
+ if (cc < 0 && !SOFT_ERROR(errno)) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ "%s %s: %s", fnname,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"), strbuf);
+ }
+
+#if defined(USE_DEVPOLL) && defined(ISC_SOCKET_USE_POLLWATCH)
+ if (cc == 0) {
+ if (pollstate == poll_active)
+ pollstate = poll_checking;
+ else if (pollstate == poll_checking)
+ pollstate = poll_idle;
+ } else if (cc > 0) {
+ if (pollstate == poll_checking) {
+ /*
+ * XXX: We'd like to use a more
+ * verbose log level as it's actually an
+ * unexpected event, but the kernel bug
+ * reportedly happens pretty frequently
+ * (and it can also be a false positive)
+ * so it would be just too noisy.
+ */
+ manager_log(manager,
+ ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET,
+ ISC_LOG_DEBUG(1),
+ "unexpected POLL timeout");
+ }
+ pollstate = poll_active;
+ }
+#endif
+ } while (cc < 0);
+
+#if defined(USE_KQUEUE) || defined (USE_EPOLL) || defined (USE_DEVPOLL)
+ done = process_fds(manager, manager->events, cc);
+#elif defined(USE_SELECT)
+ process_fds(manager, maxfd, manager->read_fds_copy,
+ manager->write_fds_copy);
+
+ /*
+ * Process reads on internal, control fd.
+ */
+ if (FD_ISSET(ctlfd, manager->read_fds_copy))
+ done = process_ctlfd(manager);
+#endif
+ }
+
+ manager_log(manager, TRACE, "%s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_EXITING, "watcher exiting"));
+
+ return ((isc_threadresult_t)0);
+}
+#endif /* USE_WATCHER_THREAD */
+
+#ifdef BIND9
+ISC_SOCKETFUNC_SCOPE void
+isc__socketmgr_setreserved(isc_socketmgr_t *manager0, isc_uint32_t reserved) {
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+
+ REQUIRE(VALID_MANAGER(manager));
+
+ manager->reserved = reserved;
+}
+
+ISC_SOCKETFUNC_SCOPE void
+isc___socketmgr_maxudp(isc_socketmgr_t *manager0, int maxudp) {
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+
+ REQUIRE(VALID_MANAGER(manager));
+
+ manager->maxudp = maxudp;
+}
+#endif /* BIND9 */
+
+/*
+ * Create a new socket manager.
+ */
+
+static isc_result_t
+setup_watcher(isc_mem_t *mctx, isc__socketmgr_t *manager) {
+ isc_result_t result;
+#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
+ char strbuf[ISC_STRERRORSIZE];
+#endif
+
+#ifdef USE_KQUEUE
+ manager->nevents = ISC_SOCKET_MAXEVENTS;
+ manager->events = isc_mem_get(mctx, sizeof(struct kevent) *
+ manager->nevents);
+ if (manager->events == NULL)
+ return (ISC_R_NOMEMORY);
+ manager->kqueue_fd = kqueue();
+ if (manager->kqueue_fd == -1) {
+ result = isc__errno2result(errno);
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "kqueue %s: %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct kevent) * manager->nevents);
+ return (result);
+ }
+
+#ifdef USE_WATCHER_THREAD
+ result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ);
+ if (result != ISC_R_SUCCESS) {
+ close(manager->kqueue_fd);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct kevent) * manager->nevents);
+ return (result);
+ }
+#endif /* USE_WATCHER_THREAD */
+#elif defined(USE_EPOLL)
+ manager->nevents = ISC_SOCKET_MAXEVENTS;
+ manager->events = isc_mem_get(mctx, sizeof(struct epoll_event) *
+ manager->nevents);
+ if (manager->events == NULL)
+ return (ISC_R_NOMEMORY);
+ manager->epoll_fd = epoll_create(manager->nevents);
+ if (manager->epoll_fd == -1) {
+ result = isc__errno2result(errno);
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "epoll_create %s: %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct epoll_event) * manager->nevents);
+ return (result);
+ }
+#ifdef USE_WATCHER_THREAD
+ result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ);
+ if (result != ISC_R_SUCCESS) {
+ close(manager->epoll_fd);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct epoll_event) * manager->nevents);
+ return (result);
+ }
+#endif /* USE_WATCHER_THREAD */
+#elif defined(USE_DEVPOLL)
+ /*
+ * XXXJT: /dev/poll seems to reject large numbers of events,
+ * so we should be careful about redefining ISC_SOCKET_MAXEVENTS.
+ */
+ manager->nevents = ISC_SOCKET_MAXEVENTS;
+ manager->events = isc_mem_get(mctx, sizeof(struct pollfd) *
+ manager->nevents);
+ if (manager->events == NULL)
+ return (ISC_R_NOMEMORY);
+ /*
+ * Note: fdpollinfo should be able to support all possible FDs, so
+ * it must have maxsocks entries (not nevents).
+ */
+ manager->fdpollinfo = isc_mem_get(mctx, sizeof(pollinfo_t) *
+ manager->maxsocks);
+ if (manager->fdpollinfo == NULL) {
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct pollfd) * manager->nevents);
+ return (ISC_R_NOMEMORY);
+ }
+ memset(manager->fdpollinfo, 0, sizeof(pollinfo_t) * manager->maxsocks);
+ manager->devpoll_fd = open("/dev/poll", O_RDWR);
+ if (manager->devpoll_fd == -1) {
+ result = isc__errno2result(errno);
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "open(/dev/poll) %s: %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct pollfd) * manager->nevents);
+ isc_mem_put(mctx, manager->fdpollinfo,
+ sizeof(pollinfo_t) * manager->maxsocks);
+ return (result);
+ }
+#ifdef USE_WATCHER_THREAD
+ result = watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ);
+ if (result != ISC_R_SUCCESS) {
+ close(manager->devpoll_fd);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct pollfd) * manager->nevents);
+ isc_mem_put(mctx, manager->fdpollinfo,
+ sizeof(pollinfo_t) * manager->maxsocks);
+ return (result);
+ }
+#endif /* USE_WATCHER_THREAD */
+#elif defined(USE_SELECT)
+ UNUSED(result);
+
+#if ISC_SOCKET_MAXSOCKETS > FD_SETSIZE
+ /*
+ * Note: this code should also cover the case of MAXSOCKETS <=
+ * FD_SETSIZE, but we separate the cases to avoid possible portability
+ * issues regarding howmany() and the actual representation of fd_set.
+ */
+ manager->fd_bufsize = howmany(manager->maxsocks, NFDBITS) *
+ sizeof(fd_mask);
+#else
+ manager->fd_bufsize = sizeof(fd_set);
+#endif
+
+ manager->read_fds = NULL;
+ manager->read_fds_copy = NULL;
+ manager->write_fds = NULL;
+ manager->write_fds_copy = NULL;
+
+ manager->read_fds = isc_mem_get(mctx, manager->fd_bufsize);
+ if (manager->read_fds != NULL)
+ manager->read_fds_copy = isc_mem_get(mctx, manager->fd_bufsize);
+ if (manager->read_fds_copy != NULL)
+ manager->write_fds = isc_mem_get(mctx, manager->fd_bufsize);
+ if (manager->write_fds != NULL) {
+ manager->write_fds_copy = isc_mem_get(mctx,
+ manager->fd_bufsize);
+ }
+ if (manager->write_fds_copy == NULL) {
+ if (manager->write_fds != NULL) {
+ isc_mem_put(mctx, manager->write_fds,
+ manager->fd_bufsize);
+ }
+ if (manager->read_fds_copy != NULL) {
+ isc_mem_put(mctx, manager->read_fds_copy,
+ manager->fd_bufsize);
+ }
+ if (manager->read_fds != NULL) {
+ isc_mem_put(mctx, manager->read_fds,
+ manager->fd_bufsize);
+ }
+ return (ISC_R_NOMEMORY);
+ }
+ memset(manager->read_fds, 0, manager->fd_bufsize);
+ memset(manager->write_fds, 0, manager->fd_bufsize);
+
+#ifdef USE_WATCHER_THREAD
+ (void)watch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ);
+ manager->maxfd = manager->pipe_fds[0];
+#else /* USE_WATCHER_THREAD */
+ manager->maxfd = 0;
+#endif /* USE_WATCHER_THREAD */
+#endif /* USE_KQUEUE */
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+cleanup_watcher(isc_mem_t *mctx, isc__socketmgr_t *manager) {
+#ifdef USE_WATCHER_THREAD
+ isc_result_t result;
+
+ result = unwatch_fd(manager, manager->pipe_fds[0], SELECT_POKE_READ);
+ if (result != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "epoll_ctl(DEL) %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ }
+#endif /* USE_WATCHER_THREAD */
+
+#ifdef USE_KQUEUE
+ close(manager->kqueue_fd);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct kevent) * manager->nevents);
+#elif defined(USE_EPOLL)
+ close(manager->epoll_fd);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct epoll_event) * manager->nevents);
+#elif defined(USE_DEVPOLL)
+ close(manager->devpoll_fd);
+ isc_mem_put(mctx, manager->events,
+ sizeof(struct pollfd) * manager->nevents);
+ isc_mem_put(mctx, manager->fdpollinfo,
+ sizeof(pollinfo_t) * manager->maxsocks);
+#elif defined(USE_SELECT)
+ if (manager->read_fds != NULL)
+ isc_mem_put(mctx, manager->read_fds, manager->fd_bufsize);
+ if (manager->read_fds_copy != NULL)
+ isc_mem_put(mctx, manager->read_fds_copy, manager->fd_bufsize);
+ if (manager->write_fds != NULL)
+ isc_mem_put(mctx, manager->write_fds, manager->fd_bufsize);
+ if (manager->write_fds_copy != NULL)
+ isc_mem_put(mctx, manager->write_fds_copy, manager->fd_bufsize);
+#endif /* USE_KQUEUE */
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) {
+ return (isc__socketmgr_create2(mctx, managerp, 0));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
+ unsigned int maxsocks)
+{
+ int i;
+ isc__socketmgr_t *manager;
+#ifdef USE_WATCHER_THREAD
+ char strbuf[ISC_STRERRORSIZE];
+#endif
+ isc_result_t result;
+
+ REQUIRE(managerp != NULL && *managerp == NULL);
+
+#ifdef USE_SHARED_MANAGER
+ if (socketmgr != NULL) {
+ /* Don't allow maxsocks to be updated */
+ if (maxsocks > 0 && socketmgr->maxsocks != maxsocks)
+ return (ISC_R_EXISTS);
+
+ socketmgr->refs++;
+ *managerp = (isc_socketmgr_t *)socketmgr;
+ return (ISC_R_SUCCESS);
+ }
+#endif /* USE_SHARED_MANAGER */
+
+ if (maxsocks == 0)
+ maxsocks = ISC_SOCKET_MAXSOCKETS;
+
+ manager = isc_mem_get(mctx, sizeof(*manager));
+ if (manager == NULL)
+ return (ISC_R_NOMEMORY);
+
+ /* zero-clear so that necessary cleanup on failure will be easy */
+ memset(manager, 0, sizeof(*manager));
+ manager->maxsocks = maxsocks;
+ manager->reserved = 0;
+ manager->maxudp = 0;
+ manager->fds = isc_mem_get(mctx,
+ manager->maxsocks * sizeof(isc__socket_t *));
+ if (manager->fds == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto free_manager;
+ }
+ manager->fdstate = isc_mem_get(mctx, manager->maxsocks * sizeof(int));
+ if (manager->fdstate == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto free_manager;
+ }
+ manager->stats = NULL;
+
+ manager->common.methods = &socketmgrmethods;
+ manager->common.magic = ISCAPI_SOCKETMGR_MAGIC;
+ manager->common.impmagic = SOCKET_MANAGER_MAGIC;
+ manager->mctx = NULL;
+ memset(manager->fds, 0, manager->maxsocks * sizeof(isc_socket_t *));
+ ISC_LIST_INIT(manager->socklist);
+ result = isc_mutex_init(&manager->lock);
+ if (result != ISC_R_SUCCESS)
+ goto free_manager;
+ manager->fdlock = isc_mem_get(mctx, FDLOCK_COUNT * sizeof(isc_mutex_t));
+ if (manager->fdlock == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto cleanup_lock;
+ }
+ for (i = 0; i < FDLOCK_COUNT; i++) {
+ result = isc_mutex_init(&manager->fdlock[i]);
+ if (result != ISC_R_SUCCESS) {
+ while (--i >= 0)
+ DESTROYLOCK(&manager->fdlock[i]);
+ isc_mem_put(mctx, manager->fdlock,
+ FDLOCK_COUNT * sizeof(isc_mutex_t));
+ manager->fdlock = NULL;
+ goto cleanup_lock;
+ }
+ }
+
+#ifdef USE_WATCHER_THREAD
+ if (isc_condition_init(&manager->shutdown_ok) != ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ result = ISC_R_UNEXPECTED;
+ goto cleanup_lock;
+ }
+
+ /*
+ * Create the special fds that will be used to wake up the
+ * select/poll loop when something internal needs to be done.
+ */
+ if (pipe(manager->pipe_fds) != 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "pipe() %s: %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto cleanup_condition;
+ }
+
+ RUNTIME_CHECK(make_nonblock(manager->pipe_fds[0]) == ISC_R_SUCCESS);
+#if 0
+ RUNTIME_CHECK(make_nonblock(manager->pipe_fds[1]) == ISC_R_SUCCESS);
+#endif
+#endif /* USE_WATCHER_THREAD */
+
+#ifdef USE_SHARED_MANAGER
+ manager->refs = 1;
+#endif /* USE_SHARED_MANAGER */
+
+ /*
+ * Set up initial state for the select loop
+ */
+ result = setup_watcher(mctx, manager);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
+ memset(manager->fdstate, 0, manager->maxsocks * sizeof(int));
+#ifdef USE_WATCHER_THREAD
+ /*
+ * Start up the select/poll thread.
+ */
+ if (isc_thread_create(watcher, manager, &manager->watcher) !=
+ ISC_R_SUCCESS) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_thread_create() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ cleanup_watcher(mctx, manager);
+ result = ISC_R_UNEXPECTED;
+ goto cleanup;
+ }
+#endif /* USE_WATCHER_THREAD */
+ isc_mem_attach(mctx, &manager->mctx);
+
+#ifdef USE_SHARED_MANAGER
+ socketmgr = manager;
+#endif /* USE_SHARED_MANAGER */
+ *managerp = (isc_socketmgr_t *)manager;
+
+ return (ISC_R_SUCCESS);
+
+cleanup:
+#ifdef USE_WATCHER_THREAD
+ (void)close(manager->pipe_fds[0]);
+ (void)close(manager->pipe_fds[1]);
+#endif /* USE_WATCHER_THREAD */
+
+#ifdef USE_WATCHER_THREAD
+cleanup_condition:
+ (void)isc_condition_destroy(&manager->shutdown_ok);
+#endif /* USE_WATCHER_THREAD */
+
+
+cleanup_lock:
+ if (manager->fdlock != NULL) {
+ for (i = 0; i < FDLOCK_COUNT; i++)
+ DESTROYLOCK(&manager->fdlock[i]);
+ }
+ DESTROYLOCK(&manager->lock);
+
+free_manager:
+ if (manager->fdlock != NULL) {
+ isc_mem_put(mctx, manager->fdlock,
+ FDLOCK_COUNT * sizeof(isc_mutex_t));
+ }
+ if (manager->fdstate != NULL) {
+ isc_mem_put(mctx, manager->fdstate,
+ manager->maxsocks * sizeof(int));
+ }
+ if (manager->fds != NULL) {
+ isc_mem_put(mctx, manager->fds,
+ manager->maxsocks * sizeof(isc_socket_t *));
+ }
+ isc_mem_put(mctx, manager, sizeof(*manager));
+
+ return (result);
+}
+
+#ifdef BIND9
+isc_result_t
+isc__socketmgr_getmaxsockets(isc_socketmgr_t *manager0, unsigned int *nsockp) {
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(nsockp != NULL);
+
+ *nsockp = manager->maxsocks;
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc__socketmgr_setstats(isc_socketmgr_t *manager0, isc_stats_t *stats) {
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(ISC_LIST_EMPTY(manager->socklist));
+ REQUIRE(manager->stats == NULL);
+ REQUIRE(isc_stats_ncounters(stats) == isc_sockstatscounter_max);
+
+ isc_stats_attach(stats, &manager->stats);
+}
+#endif
+
+ISC_SOCKETFUNC_SCOPE void
+isc__socketmgr_destroy(isc_socketmgr_t **managerp) {
+ isc__socketmgr_t *manager;
+ int i;
+ isc_mem_t *mctx;
+
+ /*
+ * Destroy a socket manager.
+ */
+
+ REQUIRE(managerp != NULL);
+ manager = (isc__socketmgr_t *)*managerp;
+ REQUIRE(VALID_MANAGER(manager));
+
+#ifdef USE_SHARED_MANAGER
+ manager->refs--;
+ if (manager->refs > 0) {
+ *managerp = NULL;
+ return;
+ }
+ socketmgr = NULL;
+#endif /* USE_SHARED_MANAGER */
+
+ LOCK(&manager->lock);
+
+ /*
+ * Wait for all sockets to be destroyed.
+ */
+ while (!ISC_LIST_EMPTY(manager->socklist)) {
+#ifdef USE_WATCHER_THREAD
+ manager_log(manager, CREATION, "%s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_SOCKETSREMAIN,
+ "sockets exist"));
+ WAIT(&manager->shutdown_ok, &manager->lock);
+#else /* USE_WATCHER_THREAD */
+ UNLOCK(&manager->lock);
+ isc__taskmgr_dispatch(NULL);
+ LOCK(&manager->lock);
+#endif /* USE_WATCHER_THREAD */
+ }
+
+ UNLOCK(&manager->lock);
+
+ /*
+ * Here, poke our select/poll thread. Do this by closing the write
+ * half of the pipe, which will send EOF to the read half.
+ * This is currently a no-op in the non-threaded case.
+ */
+ select_poke(manager, 0, SELECT_POKE_SHUTDOWN);
+
+#ifdef USE_WATCHER_THREAD
+ /*
+ * Wait for thread to exit.
+ */
+ if (isc_thread_join(manager->watcher, NULL) != ISC_R_SUCCESS)
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_thread_join() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+#endif /* USE_WATCHER_THREAD */
+
+ /*
+ * Clean up.
+ */
+ cleanup_watcher(manager->mctx, manager);
+
+#ifdef USE_WATCHER_THREAD
+ (void)close(manager->pipe_fds[0]);
+ (void)close(manager->pipe_fds[1]);
+ (void)isc_condition_destroy(&manager->shutdown_ok);
+#endif /* USE_WATCHER_THREAD */
+
+ for (i = 0; i < (int)manager->maxsocks; i++)
+ if (manager->fdstate[i] == CLOSE_PENDING) /* no need to lock */
+ (void)close(i);
+
+ isc_mem_put(manager->mctx, manager->fds,
+ manager->maxsocks * sizeof(isc__socket_t *));
+ isc_mem_put(manager->mctx, manager->fdstate,
+ manager->maxsocks * sizeof(int));
+
+ if (manager->stats != NULL)
+ isc_stats_detach(&manager->stats);
+
+ if (manager->fdlock != NULL) {
+ for (i = 0; i < FDLOCK_COUNT; i++)
+ DESTROYLOCK(&manager->fdlock[i]);
+ isc_mem_put(manager->mctx, manager->fdlock,
+ FDLOCK_COUNT * sizeof(isc_mutex_t));
+ }
+ DESTROYLOCK(&manager->lock);
+ manager->common.magic = 0;
+ manager->common.impmagic = 0;
+ mctx= manager->mctx;
+ isc_mem_put(mctx, manager, sizeof(*manager));
+
+ isc_mem_detach(&mctx);
+
+ *managerp = NULL;
+
+#ifdef USE_SHARED_MANAGER
+ socketmgr = NULL;
+#endif
+}
+
+static isc_result_t
+socket_recv(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
+ unsigned int flags)
+{
+ int io_state;
+ isc_boolean_t have_lock = ISC_FALSE;
+ isc_task_t *ntask = NULL;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ dev->ev_sender = task;
+
+ if (sock->type == isc_sockettype_udp) {
+ io_state = doio_recv(sock, dev);
+ } else {
+ LOCK(&sock->lock);
+ have_lock = ISC_TRUE;
+
+ if (ISC_LIST_EMPTY(sock->recv_list))
+ io_state = doio_recv(sock, dev);
+ else
+ io_state = DOIO_SOFT;
+ }
+
+ switch (io_state) {
+ case DOIO_SOFT:
+ /*
+ * We couldn't read all or part of the request right now, so
+ * queue it.
+ *
+ * Attach to socket and to task
+ */
+ isc_task_attach(task, &ntask);
+ dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
+
+ if (!have_lock) {
+ LOCK(&sock->lock);
+ have_lock = ISC_TRUE;
+ }
+
+ /*
+ * Enqueue the request. If the socket was previously not being
+ * watched, poke the watcher to start paying attention to it.
+ */
+ if (ISC_LIST_EMPTY(sock->recv_list) && !sock->pending_recv)
+ select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
+ ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link);
+
+ socket_log(sock, NULL, EVENT, NULL, 0, 0,
+ "socket_recv: event %p -> task %p",
+ dev, ntask);
+
+ if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0)
+ result = ISC_R_INPROGRESS;
+ break;
+
+ case DOIO_EOF:
+ dev->result = ISC_R_EOF;
+ /* fallthrough */
+
+ case DOIO_HARD:
+ case DOIO_SUCCESS:
+ if ((flags & ISC_SOCKFLAG_IMMEDIATE) == 0)
+ send_recvdone_event(sock, &dev);
+ break;
+ }
+
+ if (have_lock)
+ UNLOCK(&sock->lock);
+
+ return (result);
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_recvv(isc_socket_t *sock0, isc_bufferlist_t *buflist,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_socketevent_t *dev;
+ isc__socketmgr_t *manager;
+ unsigned int iocount;
+ isc_buffer_t *buffer;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(buflist != NULL);
+ REQUIRE(!ISC_LIST_EMPTY(*buflist));
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ iocount = isc_bufferlist_availablecount(buflist);
+ REQUIRE(iocount > 0);
+
+ INSIST(sock->bound);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg);
+ if (dev == NULL)
+ return (ISC_R_NOMEMORY);
+
+ /*
+ * UDP sockets are always partial read
+ */
+ if (sock->type == isc_sockettype_udp)
+ dev->minimum = 1;
+ else {
+ if (minimum == 0)
+ dev->minimum = iocount;
+ else
+ dev->minimum = minimum;
+ }
+
+ /*
+ * Move each buffer from the passed in list to our internal one.
+ */
+ buffer = ISC_LIST_HEAD(*buflist);
+ while (buffer != NULL) {
+ ISC_LIST_DEQUEUE(*buflist, buffer, link);
+ ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
+ buffer = ISC_LIST_HEAD(*buflist);
+ }
+
+ return (socket_recv(sock, dev, task, 0));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_recv(isc_socket_t *sock0, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_socketevent_t *dev;
+ isc__socketmgr_t *manager;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ INSIST(sock->bound);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg);
+ if (dev == NULL)
+ return (ISC_R_NOMEMORY);
+
+ return (isc__socket_recv2(sock0, region, minimum, task, dev, 0));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_recv2(isc_socket_t *sock0, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_socketevent_t *event, unsigned int flags)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ event->ev_sender = sock;
+ event->result = ISC_R_UNSET;
+ ISC_LIST_INIT(event->bufferlist);
+ event->region = *region;
+ event->n = 0;
+ event->offset = 0;
+ event->attributes = 0;
+
+ /*
+ * UDP sockets are always partial read.
+ */
+ if (sock->type == isc_sockettype_udp)
+ event->minimum = 1;
+ else {
+ if (minimum == 0)
+ event->minimum = region->length;
+ else
+ event->minimum = minimum;
+ }
+
+ return (socket_recv(sock, event, task, flags));
+}
+
+static isc_result_t
+socket_send(isc__socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
+ unsigned int flags)
+{
+ int io_state;
+ isc_boolean_t have_lock = ISC_FALSE;
+ isc_task_t *ntask = NULL;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ dev->ev_sender = task;
+
+ set_dev_address(address, sock, dev);
+ if (pktinfo != NULL) {
+ dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
+ dev->pktinfo = *pktinfo;
+
+ if (!isc_sockaddr_issitelocal(&dev->address) &&
+ !isc_sockaddr_islinklocal(&dev->address)) {
+ socket_log(sock, NULL, TRACE, isc_msgcat,
+ ISC_MSGSET_SOCKET, ISC_MSG_PKTINFOPROVIDED,
+ "pktinfo structure provided, ifindex %u "
+ "(set to 0)", pktinfo->ipi6_ifindex);
+
+ /*
+ * Set the pktinfo index to 0 here, to let the
+ * kernel decide what interface it should send on.
+ */
+ dev->pktinfo.ipi6_ifindex = 0;
+ }
+ }
+
+ if (sock->type == isc_sockettype_udp)
+ io_state = doio_send(sock, dev);
+ else {
+ LOCK(&sock->lock);
+ have_lock = ISC_TRUE;
+
+ if (ISC_LIST_EMPTY(sock->send_list))
+ io_state = doio_send(sock, dev);
+ else
+ io_state = DOIO_SOFT;
+ }
+
+ switch (io_state) {
+ case DOIO_SOFT:
+ /*
+ * We couldn't send all or part of the request right now, so
+ * queue it unless ISC_SOCKFLAG_NORETRY is set.
+ */
+ if ((flags & ISC_SOCKFLAG_NORETRY) == 0) {
+ isc_task_attach(task, &ntask);
+ dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
+
+ if (!have_lock) {
+ LOCK(&sock->lock);
+ have_lock = ISC_TRUE;
+ }
+
+ /*
+ * Enqueue the request. If the socket was previously
+ * not being watched, poke the watcher to start
+ * paying attention to it.
+ */
+ if (ISC_LIST_EMPTY(sock->send_list) &&
+ !sock->pending_send)
+ select_poke(sock->manager, sock->fd,
+ SELECT_POKE_WRITE);
+ ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link);
+
+ socket_log(sock, NULL, EVENT, NULL, 0, 0,
+ "socket_send: event %p -> task %p",
+ dev, ntask);
+
+ if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0)
+ result = ISC_R_INPROGRESS;
+ break;
+ }
+
+ case DOIO_HARD:
+ case DOIO_SUCCESS:
+ if ((flags & ISC_SOCKFLAG_IMMEDIATE) == 0)
+ send_senddone_event(sock, &dev);
+ break;
+ }
+
+ if (have_lock)
+ UNLOCK(&sock->lock);
+
+ return (result);
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_send(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ /*
+ * REQUIRE() checking is performed in isc_socket_sendto().
+ */
+ return (isc__socket_sendto(sock, region, task, action, arg, NULL,
+ NULL));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendto(isc_socket_t *sock0, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_socketevent_t *dev;
+ isc__socketmgr_t *manager;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(region != NULL);
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ INSIST(sock->bound);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
+ if (dev == NULL)
+ return (ISC_R_NOMEMORY);
+
+ dev->region = *region;
+
+ return (socket_send(sock, dev, task, address, pktinfo, 0));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ return (isc__socket_sendtov(sock, buflist, task, action, arg, NULL,
+ NULL));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendtov(isc_socket_t *sock0, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_socketevent_t *dev;
+ isc__socketmgr_t *manager;
+ unsigned int iocount;
+ isc_buffer_t *buffer;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(buflist != NULL);
+ REQUIRE(!ISC_LIST_EMPTY(*buflist));
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ iocount = isc_bufferlist_usedcount(buflist);
+ REQUIRE(iocount > 0);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
+ if (dev == NULL)
+ return (ISC_R_NOMEMORY);
+
+ /*
+ * Move each buffer from the passed in list to our internal one.
+ */
+ buffer = ISC_LIST_HEAD(*buflist);
+ while (buffer != NULL) {
+ ISC_LIST_DEQUEUE(*buflist, buffer, link);
+ ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
+ buffer = ISC_LIST_HEAD(*buflist);
+ }
+
+ return (socket_send(sock, dev, task, address, pktinfo, 0));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_sendto2(isc_socket_t *sock0, isc_region_t *region,
+ isc_task_t *task,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
+ isc_socketevent_t *event, unsigned int flags)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE((flags & ~(ISC_SOCKFLAG_IMMEDIATE|ISC_SOCKFLAG_NORETRY)) == 0);
+ if ((flags & ISC_SOCKFLAG_NORETRY) != 0)
+ REQUIRE(sock->type == isc_sockettype_udp);
+ event->ev_sender = sock;
+ event->result = ISC_R_UNSET;
+ ISC_LIST_INIT(event->bufferlist);
+ event->region = *region;
+ event->n = 0;
+ event->offset = 0;
+ event->attributes = 0;
+
+ return (socket_send(sock, event, task, address, pktinfo, flags));
+}
+
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ int s;
+ struct stat sb;
+ char strbuf[ISC_STRERRORSIZE];
+
+ if (sockaddr->type.sa.sa_family != AF_UNIX)
+ return;
+
+#ifndef S_ISSOCK
+#if defined(S_IFMT) && defined(S_IFSOCK)
+#define S_ISSOCK(mode) ((mode & S_IFMT)==S_IFSOCK)
+#elif defined(_S_IFMT) && defined(S_IFSOCK)
+#define S_ISSOCK(mode) ((mode & _S_IFMT)==S_IFSOCK)
+#endif
+#endif
+
+#ifndef S_ISFIFO
+#if defined(S_IFMT) && defined(S_IFIFO)
+#define S_ISFIFO(mode) ((mode & S_IFMT)==S_IFIFO)
+#elif defined(_S_IFMT) && defined(S_IFIFO)
+#define S_ISFIFO(mode) ((mode & _S_IFMT)==S_IFIFO)
+#endif
+#endif
+
+#if !defined(S_ISFIFO) && !defined(S_ISSOCK)
+#error You need to define S_ISFIFO and S_ISSOCK as appropriate for your platform. See <sys/stat.h>.
+#endif
+
+#ifndef S_ISFIFO
+#define S_ISFIFO(mode) 0
+#endif
+
+#ifndef S_ISSOCK
+#define S_ISSOCK(mode) 0
+#endif
+
+ if (active) {
+ if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "isc_socket_cleanunix: stat(%s): %s",
+ sockaddr->type.sunix.sun_path, strbuf);
+ return;
+ }
+ if (!(S_ISSOCK(sb.st_mode) || S_ISFIFO(sb.st_mode))) {
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "isc_socket_cleanunix: %s: not a socket",
+ sockaddr->type.sunix.sun_path);
+ return;
+ }
+ if (unlink(sockaddr->type.sunix.sun_path) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "isc_socket_cleanunix: unlink(%s): %s",
+ sockaddr->type.sunix.sun_path, strbuf);
+ }
+ return;
+ }
+
+ s = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (s < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING,
+ "isc_socket_cleanunix: socket(%s): %s",
+ sockaddr->type.sunix.sun_path, strbuf);
+ return;
+ }
+
+ if (stat(sockaddr->type.sunix.sun_path, &sb) < 0) {
+ switch (errno) {
+ case ENOENT: /* We exited cleanly last time */
+ break;
+ default:
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING,
+ "isc_socket_cleanunix: stat(%s): %s",
+ sockaddr->type.sunix.sun_path, strbuf);
+ break;
+ }
+ goto cleanup;
+ }
+
+ if (!(S_ISSOCK(sb.st_mode) || S_ISFIFO(sb.st_mode))) {
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING,
+ "isc_socket_cleanunix: %s: not a socket",
+ sockaddr->type.sunix.sun_path);
+ goto cleanup;
+ }
+
+ if (connect(s, (struct sockaddr *)&sockaddr->type.sunix,
+ sizeof(sockaddr->type.sunix)) < 0) {
+ switch (errno) {
+ case ECONNREFUSED:
+ case ECONNRESET:
+ if (unlink(sockaddr->type.sunix.sun_path) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET,
+ ISC_LOG_WARNING,
+ "isc_socket_cleanunix: "
+ "unlink(%s): %s",
+ sockaddr->type.sunix.sun_path,
+ strbuf);
+ }
+ break;
+ default:
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING,
+ "isc_socket_cleanunix: connect(%s): %s",
+ sockaddr->type.sunix.sun_path, strbuf);
+ break;
+ }
+ }
+ cleanup:
+ close(s);
+#else
+ UNUSED(sockaddr);
+ UNUSED(active);
+#endif
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
+ isc_uint32_t owner, isc_uint32_t group)
+{
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ isc_result_t result = ISC_R_SUCCESS;
+ char strbuf[ISC_STRERRORSIZE];
+ char path[sizeof(sockaddr->type.sunix.sun_path)];
+#ifdef NEED_SECURE_DIRECTORY
+ char *slash;
+#endif
+
+ REQUIRE(sockaddr->type.sa.sa_family == AF_UNIX);
+ INSIST(strlen(sockaddr->type.sunix.sun_path) < sizeof(path));
+ strcpy(path, sockaddr->type.sunix.sun_path);
+
+#ifdef NEED_SECURE_DIRECTORY
+ slash = strrchr(path, '/');
+ if (slash != NULL) {
+ if (slash != path)
+ *slash = '\0';
+ else
+ strcpy(path, "/");
+ } else
+ strcpy(path, ".");
+#endif
+
+ if (chmod(path, perm) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "isc_socket_permunix: chmod(%s, %d): %s",
+ path, perm, strbuf);
+ result = ISC_R_FAILURE;
+ }
+ if (chown(path, owner, group) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ "isc_socket_permunix: chown(%s, %d, %d): %s",
+ path, owner, group,
+ strbuf);
+ result = ISC_R_FAILURE;
+ }
+ return (result);
+#else
+ UNUSED(sockaddr);
+ UNUSED(perm);
+ UNUSED(owner);
+ UNUSED(group);
+ return (ISC_R_NOTIMPLEMENTED);
+#endif
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_bind(isc_socket_t *sock0, isc_sockaddr_t *sockaddr,
+ unsigned int options) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ char strbuf[ISC_STRERRORSIZE];
+ int on = 1;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+
+ INSIST(!sock->bound);
+ INSIST(!sock->dupped);
+
+ if (sock->pf != sockaddr->type.sa.sa_family) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_FAMILYMISMATCH);
+ }
+
+ /*
+ * Only set SO_REUSEADDR when we want a specific port.
+ */
+#ifdef AF_UNIX
+ if (sock->pf == AF_UNIX)
+ goto bind_socket;
+#endif
+ if ((options & ISC_SOCKET_REUSEADDRESS) != 0 &&
+ isc_sockaddr_getport(sockaddr) != (in_port_t)0 &&
+ setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on,
+ sizeof(on)) < 0) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d) %s", sock->fd,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ /* Press on... */
+ }
+#ifdef AF_UNIX
+ bind_socket:
+#endif
+ if (bind(sock->fd, &sockaddr->type.sa, sockaddr->length) < 0) {
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_BINDFAIL]);
+
+ UNLOCK(&sock->lock);
+ switch (errno) {
+ case EACCES:
+ return (ISC_R_NOPERM);
+ case EADDRNOTAVAIL:
+ return (ISC_R_ADDRNOTAVAIL);
+ case EADDRINUSE:
+ return (ISC_R_ADDRINUSE);
+ case EINVAL:
+ return (ISC_R_BOUND);
+ default:
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "bind: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+
+ socket_log(sock, sockaddr, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "bound");
+ sock->bound = 1;
+
+ UNLOCK(&sock->lock);
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Enable this only for specific OS versions, and only when they have repaired
+ * their problems with it. Until then, this is is broken and needs to be
+ * diabled by default. See RT22589 for details.
+ */
+#undef ENABLE_ACCEPTFILTER
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_filter(isc_socket_t *sock0, const char *filter) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+#if defined(SO_ACCEPTFILTER) && defined(ENABLE_ACCEPTFILTER)
+ char strbuf[ISC_STRERRORSIZE];
+ struct accept_filter_arg afa;
+#else
+ UNUSED(sock);
+ UNUSED(filter);
+#endif
+
+ REQUIRE(VALID_SOCKET(sock));
+
+#if defined(SO_ACCEPTFILTER) && defined(ENABLE_ACCEPTFILTER)
+ bzero(&afa, sizeof(afa));
+ strncpy(afa.af_name, filter, sizeof(afa.af_name));
+ if (setsockopt(sock->fd, SOL_SOCKET, SO_ACCEPTFILTER,
+ &afa, sizeof(afa)) == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ socket_log(sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FILTER, "setsockopt(SO_ACCEPTFILTER): %s",
+ strbuf);
+ return (ISC_R_FAILURE);
+ }
+ return (ISC_R_SUCCESS);
+#else
+ return (ISC_R_NOTIMPLEMENTED);
+#endif
+}
+
+/*
+ * Set up to listen on a given socket. We do this by creating an internal
+ * event that will be dispatched when the socket has read activity. The
+ * watcher will send the internal event to the task when there is a new
+ * connection.
+ *
+ * Unlike in read, we don't preallocate a done event here. Every time there
+ * is a new connection we'll have to allocate a new one anyway, so we might
+ * as well keep things simple rather than having to track them.
+ */
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_listen(isc_socket_t *sock0, unsigned int backlog) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+
+ REQUIRE(!sock->listener);
+ REQUIRE(sock->bound);
+ REQUIRE(sock->type == isc_sockettype_tcp ||
+ sock->type == isc_sockettype_unix);
+
+ if (backlog == 0)
+ backlog = SOMAXCONN;
+
+ if (listen(sock->fd, (int)backlog) < 0) {
+ UNLOCK(&sock->lock);
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "listen: %s", strbuf);
+
+ return (ISC_R_UNEXPECTED);
+ }
+
+ sock->listener = 1;
+
+ UNLOCK(&sock->lock);
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * This should try to do aggressive accept() XXXMLG
+ */
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_accept(isc_socket_t *sock0,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_socket_newconnev_t *dev;
+ isc__socketmgr_t *manager;
+ isc_task_t *ntask = NULL;
+ isc__socket_t *nsock;
+ isc_result_t result;
+ isc_boolean_t do_poke = ISC_FALSE;
+
+ REQUIRE(VALID_SOCKET(sock));
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ LOCK(&sock->lock);
+
+ REQUIRE(sock->listener);
+
+ /*
+ * Sender field is overloaded here with the task we will be sending
+ * this event to. Just before the actual event is delivered the
+ * actual ev_sender will be touched up to be the socket.
+ */
+ dev = (isc_socket_newconnev_t *)
+ isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN,
+ action, arg, sizeof(*dev));
+ if (dev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+ ISC_LINK_INIT(dev, ev_link);
+
+ result = allocate_socket(manager, sock->type, &nsock);
+ if (result != ISC_R_SUCCESS) {
+ isc_event_free(ISC_EVENT_PTR(&dev));
+ UNLOCK(&sock->lock);
+ return (result);
+ }
+
+ /*
+ * Attach to socket and to task.
+ */
+ isc_task_attach(task, &ntask);
+ if (isc_task_exiting(ntask)) {
+ free_socket(&nsock);
+ isc_task_detach(&ntask);
+ isc_event_free(ISC_EVENT_PTR(&dev));
+ UNLOCK(&sock->lock);
+ return (ISC_R_SHUTTINGDOWN);
+ }
+ nsock->references++;
+ nsock->statsindex = sock->statsindex;
+
+ dev->ev_sender = ntask;
+ dev->newsocket = (isc_socket_t *)nsock;
+
+ /*
+ * Poke watcher here. We still have the socket locked, so there
+ * is no race condition. We will keep the lock for such a short
+ * bit of time waking it up now or later won't matter all that much.
+ */
+ if (ISC_LIST_EMPTY(sock->accept_list))
+ do_poke = ISC_TRUE;
+
+ ISC_LIST_ENQUEUE(sock->accept_list, dev, ev_link);
+
+ if (do_poke)
+ select_poke(manager, sock->fd, SELECT_POKE_ACCEPT);
+
+ UNLOCK(&sock->lock);
+ return (ISC_R_SUCCESS);
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_connect(isc_socket_t *sock0, isc_sockaddr_t *addr,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_socket_connev_t *dev;
+ isc_task_t *ntask = NULL;
+ isc__socketmgr_t *manager;
+ int cc;
+ char strbuf[ISC_STRERRORSIZE];
+ char addrbuf[ISC_SOCKADDR_FORMATSIZE];
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(addr != NULL);
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(addr != NULL);
+
+ if (isc_sockaddr_ismulticast(addr))
+ return (ISC_R_MULTICAST);
+
+ LOCK(&sock->lock);
+
+ REQUIRE(!sock->connecting);
+
+ dev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock,
+ ISC_SOCKEVENT_CONNECT,
+ action, arg,
+ sizeof(*dev));
+ if (dev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+ ISC_LINK_INIT(dev, ev_link);
+
+ /*
+ * Try to do the connect right away, as there can be only one
+ * outstanding, and it might happen to complete.
+ */
+ sock->peer_address = *addr;
+ cc = connect(sock->fd, &addr->type.sa, addr->length);
+ if (cc < 0) {
+ /*
+ * HP-UX "fails" to connect a UDP socket and sets errno to
+ * EINPROGRESS if it's non-blocking. We'd rather regard this as
+ * a success and let the user detect it if it's really an error
+ * at the time of sending a packet on the socket.
+ */
+ if (sock->type == isc_sockettype_udp && errno == EINPROGRESS) {
+ cc = 0;
+ goto success;
+ }
+ if (SOFT_ERROR(errno) || errno == EINPROGRESS)
+ goto queue;
+
+ switch (errno) {
+#define ERROR_MATCH(a, b) case a: dev->result = b; goto err_exit;
+ ERROR_MATCH(EACCES, ISC_R_NOPERM);
+ ERROR_MATCH(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
+ ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL);
+ ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED);
+ ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH);
+#ifdef EHOSTDOWN
+ ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH);
+#endif
+ ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH);
+ ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES);
+ ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);
+ ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED);
+ ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET);
+#undef ERROR_MATCH
+ }
+
+ sock->connected = 0;
+
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ isc_sockaddr_format(addr, addrbuf, sizeof(addrbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "connect(%s) %d/%s",
+ addrbuf, errno, strbuf);
+
+ UNLOCK(&sock->lock);
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_CONNECTFAIL]);
+ isc_event_free(ISC_EVENT_PTR(&dev));
+ return (ISC_R_UNEXPECTED);
+
+ err_exit:
+ sock->connected = 0;
+ isc_task_send(task, ISC_EVENT_PTR(&dev));
+
+ UNLOCK(&sock->lock);
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_CONNECTFAIL]);
+ return (ISC_R_SUCCESS);
+ }
+
+ /*
+ * If connect completed, fire off the done event.
+ */
+ success:
+ if (cc == 0) {
+ sock->connected = 1;
+ sock->bound = 1;
+ dev->result = ISC_R_SUCCESS;
+ isc_task_send(task, ISC_EVENT_PTR(&dev));
+
+ UNLOCK(&sock->lock);
+
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_CONNECT]);
+
+ return (ISC_R_SUCCESS);
+ }
+
+ queue:
+
+ /*
+ * Attach to task.
+ */
+ isc_task_attach(task, &ntask);
+
+ sock->connecting = 1;
+
+ dev->ev_sender = ntask;
+
+ /*
+ * Poke watcher here. We still have the socket locked, so there
+ * is no race condition. We will keep the lock for such a short
+ * bit of time waking it up now or later won't matter all that much.
+ */
+ if (sock->connect_ev == NULL)
+ select_poke(manager, sock->fd, SELECT_POKE_CONNECT);
+
+ sock->connect_ev = dev;
+
+ UNLOCK(&sock->lock);
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Called when a socket with a pending connect() finishes.
+ */
+static void
+internal_connect(isc_task_t *me, isc_event_t *ev) {
+ isc__socket_t *sock;
+ isc_socket_connev_t *dev;
+ isc_task_t *task;
+ int cc;
+ ISC_SOCKADDR_LEN_T optlen;
+ char strbuf[ISC_STRERRORSIZE];
+ char peerbuf[ISC_SOCKADDR_FORMATSIZE];
+
+ UNUSED(me);
+ INSIST(ev->ev_type == ISC_SOCKEVENT_INTW);
+
+ sock = ev->ev_sender;
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+
+ /*
+ * When the internal event was sent the reference count was bumped
+ * to keep the socket around for us. Decrement the count here.
+ */
+ INSIST(sock->references > 0);
+ sock->references--;
+ if (sock->references == 0) {
+ UNLOCK(&sock->lock);
+ destroy(&sock);
+ return;
+ }
+
+ /*
+ * Has this event been canceled?
+ */
+ dev = sock->connect_ev;
+ if (dev == NULL) {
+ INSIST(!sock->connecting);
+ UNLOCK(&sock->lock);
+ return;
+ }
+
+ INSIST(sock->connecting);
+ sock->connecting = 0;
+
+ /*
+ * Get any possible error status here.
+ */
+ optlen = sizeof(cc);
+ if (getsockopt(sock->fd, SOL_SOCKET, SO_ERROR,
+ (void *)&cc, (void *)&optlen) < 0)
+ cc = errno;
+ else
+ errno = cc;
+
+ if (errno != 0) {
+ /*
+ * If the error is EAGAIN, just re-select on this
+ * fd and pretend nothing strange happened.
+ */
+ if (SOFT_ERROR(errno) || errno == EINPROGRESS) {
+ sock->connecting = 1;
+ select_poke(sock->manager, sock->fd,
+ SELECT_POKE_CONNECT);
+ UNLOCK(&sock->lock);
+
+ return;
+ }
+
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_CONNECTFAIL]);
+
+ /*
+ * Translate other errors into ISC_R_* flavors.
+ */
+ switch (errno) {
+#define ERROR_MATCH(a, b) case a: dev->result = b; break;
+ ERROR_MATCH(EACCES, ISC_R_NOPERM);
+ ERROR_MATCH(EADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
+ ERROR_MATCH(EAFNOSUPPORT, ISC_R_ADDRNOTAVAIL);
+ ERROR_MATCH(ECONNREFUSED, ISC_R_CONNREFUSED);
+ ERROR_MATCH(EHOSTUNREACH, ISC_R_HOSTUNREACH);
+#ifdef EHOSTDOWN
+ ERROR_MATCH(EHOSTDOWN, ISC_R_HOSTUNREACH);
+#endif
+ ERROR_MATCH(ENETUNREACH, ISC_R_NETUNREACH);
+ ERROR_MATCH(ENOBUFS, ISC_R_NORESOURCES);
+ ERROR_MATCH(EPERM, ISC_R_HOSTUNREACH);
+ ERROR_MATCH(EPIPE, ISC_R_NOTCONNECTED);
+ ERROR_MATCH(ETIMEDOUT, ISC_R_TIMEDOUT);
+ ERROR_MATCH(ECONNRESET, ISC_R_CONNECTIONRESET);
+#undef ERROR_MATCH
+ default:
+ dev->result = ISC_R_UNEXPECTED;
+ isc_sockaddr_format(&sock->peer_address, peerbuf,
+ sizeof(peerbuf));
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "internal_connect: connect(%s) %s",
+ peerbuf, strbuf);
+ }
+ } else {
+ inc_stats(sock->manager->stats,
+ sock->statsindex[STATID_CONNECT]);
+ dev->result = ISC_R_SUCCESS;
+ sock->connected = 1;
+ sock->bound = 1;
+ }
+
+ sock->connect_ev = NULL;
+
+ UNLOCK(&sock->lock);
+
+ task = dev->ev_sender;
+ dev->ev_sender = sock;
+ isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev));
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_getpeername(isc_socket_t *sock0, isc_sockaddr_t *addressp) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_result_t result;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(addressp != NULL);
+
+ LOCK(&sock->lock);
+
+ if (sock->connected) {
+ *addressp = sock->peer_address;
+ result = ISC_R_SUCCESS;
+ } else {
+ result = ISC_R_NOTCONNECTED;
+ }
+
+ UNLOCK(&sock->lock);
+
+ return (result);
+}
+
+ISC_SOCKETFUNC_SCOPE isc_result_t
+isc__socket_getsockname(isc_socket_t *sock0, isc_sockaddr_t *addressp) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ ISC_SOCKADDR_LEN_T len;
+ isc_result_t result;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(addressp != NULL);
+
+ LOCK(&sock->lock);
+
+ if (!sock->bound) {
+ result = ISC_R_NOTBOUND;
+ goto out;
+ }
+
+ result = ISC_R_SUCCESS;
+
+ len = sizeof(addressp->type);
+ if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "getsockname: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto out;
+ }
+ addressp->length = (unsigned int)len;
+
+ out:
+ UNLOCK(&sock->lock);
+
+ return (result);
+}
+
+/*
+ * Run through the list of events on this socket, and cancel the ones
+ * queued for task "task" of type "how". "how" is a bitmask.
+ */
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_cancel(isc_socket_t *sock0, isc_task_t *task, unsigned int how) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ /*
+ * Quick exit if there is nothing to do. Don't even bother locking
+ * in this case.
+ */
+ if (how == 0)
+ return;
+
+ LOCK(&sock->lock);
+
+ /*
+ * All of these do the same thing, more or less.
+ * Each will:
+ * o If the internal event is marked as "posted" try to
+ * remove it from the task's queue. If this fails, mark it
+ * as canceled instead, and let the task clean it up later.
+ * o For each I/O request for that task of that type, post
+ * its done event with status of "ISC_R_CANCELED".
+ * o Reset any state needed.
+ */
+ if (((how & ISC_SOCKCANCEL_RECV) == ISC_SOCKCANCEL_RECV)
+ && !ISC_LIST_EMPTY(sock->recv_list)) {
+ isc_socketevent_t *dev;
+ isc_socketevent_t *next;
+ isc_task_t *current_task;
+
+ dev = ISC_LIST_HEAD(sock->recv_list);
+
+ while (dev != NULL) {
+ current_task = dev->ev_sender;
+ next = ISC_LIST_NEXT(dev, ev_link);
+
+ if ((task == NULL) || (task == current_task)) {
+ dev->result = ISC_R_CANCELED;
+ send_recvdone_event(sock, &dev);
+ }
+ dev = next;
+ }
+ }
+
+ if (((how & ISC_SOCKCANCEL_SEND) == ISC_SOCKCANCEL_SEND)
+ && !ISC_LIST_EMPTY(sock->send_list)) {
+ isc_socketevent_t *dev;
+ isc_socketevent_t *next;
+ isc_task_t *current_task;
+
+ dev = ISC_LIST_HEAD(sock->send_list);
+
+ while (dev != NULL) {
+ current_task = dev->ev_sender;
+ next = ISC_LIST_NEXT(dev, ev_link);
+
+ if ((task == NULL) || (task == current_task)) {
+ dev->result = ISC_R_CANCELED;
+ send_senddone_event(sock, &dev);
+ }
+ dev = next;
+ }
+ }
+
+ if (((how & ISC_SOCKCANCEL_ACCEPT) == ISC_SOCKCANCEL_ACCEPT)
+ && !ISC_LIST_EMPTY(sock->accept_list)) {
+ isc_socket_newconnev_t *dev;
+ isc_socket_newconnev_t *next;
+ isc_task_t *current_task;
+
+ dev = ISC_LIST_HEAD(sock->accept_list);
+ while (dev != NULL) {
+ current_task = dev->ev_sender;
+ next = ISC_LIST_NEXT(dev, ev_link);
+
+ if ((task == NULL) || (task == current_task)) {
+
+ ISC_LIST_UNLINK(sock->accept_list, dev,
+ ev_link);
+
+ NEWCONNSOCK(dev)->references--;
+ free_socket((isc__socket_t **)&dev->newsocket);
+
+ dev->result = ISC_R_CANCELED;
+ dev->ev_sender = sock;
+ isc_task_sendanddetach(&current_task,
+ ISC_EVENT_PTR(&dev));
+ }
+
+ dev = next;
+ }
+ }
+
+ /*
+ * Connecting is not a list.
+ */
+ if (((how & ISC_SOCKCANCEL_CONNECT) == ISC_SOCKCANCEL_CONNECT)
+ && sock->connect_ev != NULL) {
+ isc_socket_connev_t *dev;
+ isc_task_t *current_task;
+
+ INSIST(sock->connecting);
+ sock->connecting = 0;
+
+ dev = sock->connect_ev;
+ current_task = dev->ev_sender;
+
+ if ((task == NULL) || (task == current_task)) {
+ sock->connect_ev = NULL;
+
+ dev->result = ISC_R_CANCELED;
+ dev->ev_sender = sock;
+ isc_task_sendanddetach(&current_task,
+ ISC_EVENT_PTR(&dev));
+ }
+ }
+
+ UNLOCK(&sock->lock);
+}
+
+ISC_SOCKETFUNC_SCOPE isc_sockettype_t
+isc__socket_gettype(isc_socket_t *sock0) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ return (sock->type);
+}
+
+ISC_SOCKETFUNC_SCOPE isc_boolean_t
+isc__socket_isbound(isc_socket_t *sock0) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+ isc_boolean_t val;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ val = ((sock->bound) ? ISC_TRUE : ISC_FALSE);
+ UNLOCK(&sock->lock);
+
+ return (val);
+}
+
+ISC_SOCKETFUNC_SCOPE void
+isc__socket_ipv6only(isc_socket_t *sock0, isc_boolean_t yes) {
+ isc__socket_t *sock = (isc__socket_t *)sock0;
+#if defined(IPV6_V6ONLY)
+ int onoff = yes ? 1 : 0;
+#else
+ UNUSED(yes);
+ UNUSED(sock);
+#endif
+
+ REQUIRE(VALID_SOCKET(sock));
+ INSIST(!sock->dupped);
+
+#ifdef IPV6_V6ONLY
+ if (sock->pf == AF_INET6) {
+ if (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY,
+ (void *)&onoff, sizeof(int)) < 0) {
+ char strbuf[ISC_STRERRORSIZE];
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, IPV6_V6ONLY) "
+ "%s: %s", sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+ }
+ FIX_IPV6_RECVPKTINFO(sock); /* AIX */
+#endif
+}
+
+#ifndef USE_WATCHER_THREAD
+/*
+ * In our assumed scenario, we can simply use a single static object.
+ * XXX: this is not true if the application uses multiple threads with
+ * 'multi-context' mode. Fixing this is a future TODO item.
+ */
+static isc_socketwait_t swait_private;
+
+int
+isc__socketmgr_waitevents(isc_socketmgr_t *manager0, struct timeval *tvp,
+ isc_socketwait_t **swaitp)
+{
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+
+
+ int n;
+#ifdef USE_KQUEUE
+ struct timespec ts, *tsp;
+#endif
+#ifdef USE_EPOLL
+ int timeout;
+#endif
+#ifdef USE_DEVPOLL
+ struct dvpoll dvp;
+#endif
+
+ REQUIRE(swaitp != NULL && *swaitp == NULL);
+
+#ifdef USE_SHARED_MANAGER
+ if (manager == NULL)
+ manager = socketmgr;
+#endif
+ if (manager == NULL)
+ return (0);
+
+#ifdef USE_KQUEUE
+ if (tvp != NULL) {
+ ts.tv_sec = tvp->tv_sec;
+ ts.tv_nsec = tvp->tv_usec * 1000;
+ tsp = &ts;
+ } else
+ tsp = NULL;
+ swait_private.nevents = kevent(manager->kqueue_fd, NULL, 0,
+ manager->events, manager->nevents,
+ tsp);
+ n = swait_private.nevents;
+#elif defined(USE_EPOLL)
+ if (tvp != NULL)
+ timeout = tvp->tv_sec * 1000 + (tvp->tv_usec + 999) / 1000;
+ else
+ timeout = -1;
+ swait_private.nevents = epoll_wait(manager->epoll_fd,
+ manager->events,
+ manager->nevents, timeout);
+ n = swait_private.nevents;
+#elif defined(USE_DEVPOLL)
+ dvp.dp_fds = manager->events;
+ dvp.dp_nfds = manager->nevents;
+ if (tvp != NULL) {
+ dvp.dp_timeout = tvp->tv_sec * 1000 +
+ (tvp->tv_usec + 999) / 1000;
+ } else
+ dvp.dp_timeout = -1;
+ swait_private.nevents = ioctl(manager->devpoll_fd, DP_POLL, &dvp);
+ n = swait_private.nevents;
+#elif defined(USE_SELECT)
+ memcpy(manager->read_fds_copy, manager->read_fds, manager->fd_bufsize);
+ memcpy(manager->write_fds_copy, manager->write_fds,
+ manager->fd_bufsize);
+
+ swait_private.readset = manager->read_fds_copy;
+ swait_private.writeset = manager->write_fds_copy;
+ swait_private.maxfd = manager->maxfd + 1;
+
+ n = select(swait_private.maxfd, swait_private.readset,
+ swait_private.writeset, NULL, tvp);
+#endif
+
+ *swaitp = &swait_private;
+ return (n);
+}
+
+isc_result_t
+isc__socketmgr_dispatch(isc_socketmgr_t *manager0, isc_socketwait_t *swait) {
+ isc__socketmgr_t *manager = (isc__socketmgr_t *)manager0;
+
+ REQUIRE(swait == &swait_private);
+
+#ifdef USE_SHARED_MANAGER
+ if (manager == NULL)
+ manager = socketmgr;
+#endif
+ if (manager == NULL)
+ return (ISC_R_NOTFOUND);
+
+#if defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
+ (void)process_fds(manager, manager->events, swait->nevents);
+ return (ISC_R_SUCCESS);
+#elif defined(USE_SELECT)
+ process_fds(manager, swait->maxfd, swait->readset, swait->writeset);
+ return (ISC_R_SUCCESS);
+#endif
+}
+#endif /* USE_WATCHER_THREAD */
+
+#ifdef BIND9
+void
+isc__socket_setname(isc_socket_t *socket0, const char *name, void *tag) {
+ isc__socket_t *socket = (isc__socket_t *)socket0;
+
+ /*
+ * Name 'socket'.
+ */
+
+ REQUIRE(VALID_SOCKET(socket));
+
+ LOCK(&socket->lock);
+ memset(socket->name, 0, sizeof(socket->name));
+ strncpy(socket->name, name, sizeof(socket->name) - 1);
+ socket->tag = tag;
+ UNLOCK(&socket->lock);
+}
+
+ISC_SOCKETFUNC_SCOPE const char *
+isc__socket_getname(isc_socket_t *socket0) {
+ isc__socket_t *socket = (isc__socket_t *)socket0;
+
+ return (socket->name);
+}
+
+void *
+isc__socket_gettag(isc_socket_t *socket0) {
+ isc__socket_t *socket = (isc__socket_t *)socket0;
+
+ return (socket->tag);
+}
+#endif /* BIND9 */
+
+#ifdef USE_SOCKETIMPREGISTER
+isc_result_t
+isc__socket_register() {
+ return (isc_socket_register(isc__socketmgr_create));
+}
+#endif
+
+ISC_SOCKETFUNC_SCOPE int
+isc__socket_getfd(isc_socket_t *socket0) {
+ isc__socket_t *socket = (isc__socket_t *)socket0;
+
+ return ((short) socket->fd);
+}
+
+#if defined(HAVE_LIBXML2) && defined(BIND9)
+
+static const char *
+_socktype(isc_sockettype_t type)
+{
+ if (type == isc_sockettype_udp)
+ return ("udp");
+ else if (type == isc_sockettype_tcp)
+ return ("tcp");
+ else if (type == isc_sockettype_unix)
+ return ("unix");
+ else if (type == isc_sockettype_fdwatch)
+ return ("fdwatch");
+ else
+ return ("not-initialized");
+}
+
+ISC_SOCKETFUNC_SCOPE void
+isc_socketmgr_renderxml(isc_socketmgr_t *mgr0, xmlTextWriterPtr writer) {
+ isc__socketmgr_t *mgr = (isc__socketmgr_t *)mgr0;
+ isc__socket_t *sock;
+ char peerbuf[ISC_SOCKADDR_FORMATSIZE];
+ isc_sockaddr_t addr;
+ ISC_SOCKADDR_LEN_T len;
+
+ LOCK(&mgr->lock);
+
+#ifdef USE_SHARED_MANAGER
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
+ xmlTextWriterWriteFormatString(writer, "%d", mgr->refs);
+ xmlTextWriterEndElement(writer);
+#endif /* USE_SHARED_MANAGER */
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "sockets");
+ sock = ISC_LIST_HEAD(mgr->socklist);
+ while (sock != NULL) {
+ LOCK(&sock->lock);
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "socket");
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "id");
+ xmlTextWriterWriteFormatString(writer, "%p", sock);
+ xmlTextWriterEndElement(writer);
+
+ if (sock->name[0] != 0) {
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "name");
+ xmlTextWriterWriteFormatString(writer, "%s",
+ sock->name);
+ xmlTextWriterEndElement(writer); /* name */
+ }
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
+ xmlTextWriterWriteFormatString(writer, "%d", sock->references);
+ xmlTextWriterEndElement(writer);
+
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type",
+ ISC_XMLCHAR _socktype(sock->type));
+
+ if (sock->connected) {
+ isc_sockaddr_format(&sock->peer_address, peerbuf,
+ sizeof(peerbuf));
+ xmlTextWriterWriteElement(writer,
+ ISC_XMLCHAR "peer-address",
+ ISC_XMLCHAR peerbuf);
+ }
+
+ len = sizeof(addr);
+ if (getsockname(sock->fd, &addr.type.sa, (void *)&len) == 0) {
+ isc_sockaddr_format(&addr, peerbuf, sizeof(peerbuf));
+ xmlTextWriterWriteElement(writer,
+ ISC_XMLCHAR "local-address",
+ ISC_XMLCHAR peerbuf);
+ }
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "states");
+ if (sock->pending_recv)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "pending-receive");
+ if (sock->pending_send)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "pending-send");
+ if (sock->pending_accept)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "pending_accept");
+ if (sock->listener)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "listener");
+ if (sock->connected)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "connected");
+ if (sock->connecting)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "connecting");
+ if (sock->bound)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "bound");
+
+ xmlTextWriterEndElement(writer); /* states */
+
+ xmlTextWriterEndElement(writer); /* socket */
+
+ UNLOCK(&sock->lock);
+ sock = ISC_LIST_NEXT(sock, link);
+ }
+ xmlTextWriterEndElement(writer); /* sockets */
+
+ UNLOCK(&mgr->lock);
+}
+#endif /* HAVE_LIBXML2 */
diff --git a/lib/isc/unix/socket_p.h b/lib/isc/unix/socket_p.h
new file mode 100644
index 0000000..1316011
--- /dev/null
+++ b/lib/isc/unix/socket_p.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: socket_p.h,v 1.15 2009/09/02 23:48:03 tbox Exp $ */
+
+#ifndef ISC_SOCKET_P_H
+#define ISC_SOCKET_P_H
+
+/*! \file */
+
+#ifdef ISC_PLATFORM_NEEDSYSSELECTH
+#include <sys/select.h>
+#endif
+
+typedef struct isc_socketwait isc_socketwait_t;
+int isc__socketmgr_waitevents(isc_socketmgr_t *, struct timeval *,
+ isc_socketwait_t **);
+isc_result_t isc__socketmgr_dispatch(isc_socketmgr_t *, isc_socketwait_t *);
+#endif /* ISC_SOCKET_P_H */
diff --git a/lib/isc/unix/stdio.c b/lib/isc/unix/stdio.c
new file mode 100644
index 0000000..360c8c6
--- /dev/null
+++ b/lib/isc/unix/stdio.c
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2004, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#include <config.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <isc/stdio.h>
+#include <isc/stat.h>
+
+#include "errno2result.h"
+
+isc_result_t
+isc_stdio_open(const char *filename, const char *mode, FILE **fp) {
+ FILE *f;
+
+ f = fopen(filename, mode);
+ if (f == NULL)
+ return (isc__errno2result(errno));
+ *fp = f;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_stdio_close(FILE *f) {
+ int r;
+
+ r = fclose(f);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_stdio_seek(FILE *f, long offset, int whence) {
+ int r;
+
+ r = fseek(f, offset, whence);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) {
+ isc_result_t result = ISC_R_SUCCESS;
+ size_t r;
+
+ clearerr(f);
+ r = fread(ptr, size, nmemb, f);
+ if (r != nmemb) {
+ if (feof(f))
+ result = ISC_R_EOF;
+ else
+ result = isc__errno2result(errno);
+ }
+ if (nret != NULL)
+ *nret = r;
+ return (result);
+}
+
+isc_result_t
+isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f,
+ size_t *nret)
+{
+ isc_result_t result = ISC_R_SUCCESS;
+ size_t r;
+
+ clearerr(f);
+ r = fwrite(ptr, size, nmemb, f);
+ if (r != nmemb)
+ result = isc__errno2result(errno);
+ if (nret != NULL)
+ *nret = r;
+ return (result);
+}
+
+isc_result_t
+isc_stdio_flush(FILE *f) {
+ int r;
+
+ r = fflush(f);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+/*
+ * OpenBSD has deprecated ENOTSUP in favor of EOPNOTSUPP.
+ */
+#if defined(EOPNOTSUPP) && !defined(ENOTSUP)
+#define ENOTSUP EOPNOTSUPP
+#endif
+
+isc_result_t
+isc_stdio_sync(FILE *f) {
+ int r;
+
+ r = fsync(fileno(f));
+ /*
+ * fsync is not supported on sockets and pipes which
+ * result in EINVAL / ENOTSUP.
+ */
+ if (r == 0 || errno == EINVAL || errno == ENOTSUP)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
diff --git a/lib/isc/unix/stdtime.c b/lib/isc/unix/stdtime.c
new file mode 100644
index 0000000..c5d0c47
--- /dev/null
+++ b/lib/isc/unix/stdtime.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: stdtime.c,v 1.19 2007/06/19 23:47:18 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stddef.h> /* NULL */
+#include <stdlib.h> /* NULL */
+#include <syslog.h>
+
+#include <sys/time.h>
+
+#include <isc/stdtime.h>
+#include <isc/util.h>
+
+#ifndef ISC_FIX_TV_USEC
+#define ISC_FIX_TV_USEC 1
+#endif
+
+#define US_PER_S 1000000
+
+#if ISC_FIX_TV_USEC
+static inline void
+fix_tv_usec(struct timeval *tv) {
+ isc_boolean_t fixed = ISC_FALSE;
+
+ if (tv->tv_usec < 0) {
+ fixed = ISC_TRUE;
+ do {
+ tv->tv_sec -= 1;
+ tv->tv_usec += US_PER_S;
+ } while (tv->tv_usec < 0);
+ } else if (tv->tv_usec >= US_PER_S) {
+ fixed = ISC_TRUE;
+ do {
+ tv->tv_sec += 1;
+ tv->tv_usec -= US_PER_S;
+ } while (tv->tv_usec >=US_PER_S);
+ }
+ /*
+ * Call syslog directly as we are called from the logging functions.
+ */
+ if (fixed)
+ (void)syslog(LOG_ERR, "gettimeofday returned bad tv_usec: corrected");
+}
+#endif
+
+void
+isc_stdtime_get(isc_stdtime_t *t) {
+ struct timeval tv;
+
+ /*
+ * Set 't' to the number of seconds since 00:00:00 UTC, January 1,
+ * 1970.
+ */
+
+ REQUIRE(t != NULL);
+
+ RUNTIME_CHECK(gettimeofday(&tv, NULL) != -1);
+
+#if ISC_FIX_TV_USEC
+ fix_tv_usec(&tv);
+ INSIST(tv.tv_usec >= 0);
+#else
+ INSIST(tv.tv_usec >= 0 && tv.tv_usec < US_PER_S);
+#endif
+
+ *t = (unsigned int)tv.tv_sec;
+}
diff --git a/lib/isc/unix/strerror.c b/lib/isc/unix/strerror.c
new file mode 100644
index 0000000..2278009
--- /dev/null
+++ b/lib/isc/unix/strerror.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: strerror.c,v 1.10 2009/02/16 23:48:04 tbox Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/print.h>
+#include <isc/strerror.h>
+#include <isc/util.h>
+
+#include "l_stdlib.h" /* NTP local change */
+
+#ifdef HAVE_STRERROR
+/*%
+ * We need to do this this way for profiled locks.
+ */
+static isc_mutex_t isc_strerror_lock;
+static void init_lock(void) {
+ RUNTIME_CHECK(isc_mutex_init(&isc_strerror_lock) == ISC_R_SUCCESS);
+}
+#else
+extern const char * const sys_errlist[];
+extern const int sys_nerr;
+#endif
+
+void
+isc__strerror(int num, char *buf, size_t size) {
+#ifdef HAVE_STRERROR
+ char *msg;
+ unsigned int unum = (unsigned int)num;
+ static isc_once_t once = ISC_ONCE_INIT;
+
+ REQUIRE(buf != NULL);
+
+ RUNTIME_CHECK(isc_once_do(&once, init_lock) == ISC_R_SUCCESS);
+
+ LOCK(&isc_strerror_lock);
+ msg = strerror(num);
+ if (msg != NULL)
+ snprintf(buf, size, "%s", msg);
+ else
+ snprintf(buf, size, "Unknown error: %u", unum);
+ UNLOCK(&isc_strerror_lock);
+#else
+ unsigned int unum = (unsigned int)num;
+
+ REQUIRE(buf != NULL);
+
+ if (num >= 0 && num < sys_nerr)
+ snprintf(buf, size, "%s", sys_errlist[num]);
+ else
+ snprintf(buf, size, "Unknown error: %u", unum);
+#endif
+}
diff --git a/lib/isc/unix/syslog.c b/lib/isc/unix/syslog.c
new file mode 100644
index 0000000..997508e
--- /dev/null
+++ b/lib/isc/unix/syslog.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: syslog.c,v 1.8 2007/09/13 04:45:18 each Exp $ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <syslog.h>
+
+#include <isc/result.h>
+#include <isc/string.h>
+#include <isc/syslog.h>
+#include <isc/util.h>
+
+static struct dsn_c_pvt_sfnt {
+ int val;
+ const char *strval;
+} facilities[] = {
+ { LOG_KERN, "kern" },
+ { LOG_USER, "user" },
+ { LOG_MAIL, "mail" },
+ { LOG_DAEMON, "daemon" },
+ { LOG_AUTH, "auth" },
+ { LOG_SYSLOG, "syslog" },
+ { LOG_LPR, "lpr" },
+#ifdef LOG_NEWS
+ { LOG_NEWS, "news" },
+#endif
+#ifdef LOG_UUCP
+ { LOG_UUCP, "uucp" },
+#endif
+#ifdef LOG_CRON
+ { LOG_CRON, "cron" },
+#endif
+#ifdef LOG_AUTHPRIV
+ { LOG_AUTHPRIV, "authpriv" },
+#endif
+#ifdef LOG_FTP
+ { LOG_FTP, "ftp" },
+#endif
+ { LOG_LOCAL0, "local0"},
+ { LOG_LOCAL1, "local1"},
+ { LOG_LOCAL2, "local2"},
+ { LOG_LOCAL3, "local3"},
+ { LOG_LOCAL4, "local4"},
+ { LOG_LOCAL5, "local5"},
+ { LOG_LOCAL6, "local6"},
+ { LOG_LOCAL7, "local7"},
+ { 0, NULL }
+};
+
+isc_result_t
+isc_syslog_facilityfromstring(const char *str, int *facilityp) {
+ int i;
+
+ REQUIRE(str != NULL);
+ REQUIRE(facilityp != NULL);
+
+ for (i = 0; facilities[i].strval != NULL; i++) {
+ if (strcasecmp(facilities[i].strval, str) == 0) {
+ *facilityp = facilities[i].val;
+ return (ISC_R_SUCCESS);
+ }
+ }
+ return (ISC_R_NOTFOUND);
+
+}
diff --git a/lib/isc/unix/time.c b/lib/isc/unix/time.c
new file mode 100644
index 0000000..ac23ae0
--- /dev/null
+++ b/lib/isc/unix/time.c
@@ -0,0 +1,420 @@
+/*
+ * Copyright (C) 2004-2008, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/*! \file */
+
+#include <config.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <syslog.h>
+#include <time.h>
+
+#include <sys/time.h> /* Required for struct timeval on some platforms. */
+
+#include <isc/log.h>
+#include <isc/print.h>
+#include <isc/strerror.h>
+#include <isc/string.h>
+#include <isc/time.h>
+#include <isc/util.h>
+
+#define NS_PER_S 1000000000 /*%< Nanoseconds per second. */
+#define NS_PER_US 1000 /*%< Nanoseconds per microsecond. */
+#define US_PER_S 1000000 /*%< Microseconds per second. */
+
+/*
+ * All of the INSIST()s checks of nanoseconds < NS_PER_S are for
+ * consistency checking of the type. In lieu of magic numbers, it
+ * is the best we've got. The check is only performed on functions which
+ * need an initialized type.
+ */
+
+#ifndef ISC_FIX_TV_USEC
+#define ISC_FIX_TV_USEC 1
+#endif
+
+/*%
+ *** Intervals
+ ***/
+
+static isc_interval_t zero_interval = { 0, 0 };
+isc_interval_t *isc_interval_zero = &zero_interval;
+
+#if ISC_FIX_TV_USEC
+static inline void
+fix_tv_usec(struct timeval *tv) {
+ isc_boolean_t fixed = ISC_FALSE;
+
+ if (tv->tv_usec < 0) {
+ fixed = ISC_TRUE;
+ do {
+ tv->tv_sec -= 1;
+ tv->tv_usec += US_PER_S;
+ } while (tv->tv_usec < 0);
+ } else if (tv->tv_usec >= US_PER_S) {
+ fixed = ISC_TRUE;
+ do {
+ tv->tv_sec += 1;
+ tv->tv_usec -= US_PER_S;
+ } while (tv->tv_usec >=US_PER_S);
+ }
+ /*
+ * Call syslog directly as was are called from the logging functions.
+ */
+ if (fixed)
+ (void)syslog(LOG_ERR, "gettimeofday returned bad tv_usec: corrected");
+}
+#endif
+
+void
+isc_interval_set(isc_interval_t *i,
+ unsigned int seconds, unsigned int nanoseconds)
+{
+ REQUIRE(i != NULL);
+ REQUIRE(nanoseconds < NS_PER_S);
+
+ i->seconds = seconds;
+ i->nanoseconds = nanoseconds;
+}
+
+isc_boolean_t
+isc_interval_iszero(const isc_interval_t *i) {
+ REQUIRE(i != NULL);
+ INSIST(i->nanoseconds < NS_PER_S);
+
+ if (i->seconds == 0 && i->nanoseconds == 0)
+ return (ISC_TRUE);
+
+ return (ISC_FALSE);
+}
+
+
+/***
+ *** Absolute Times
+ ***/
+
+static isc_time_t epoch = { 0, 0 };
+isc_time_t *isc_time_epoch = &epoch;
+
+void
+isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds) {
+ REQUIRE(t != NULL);
+ REQUIRE(nanoseconds < NS_PER_S);
+
+ t->seconds = seconds;
+ t->nanoseconds = nanoseconds;
+}
+
+void
+isc_time_settoepoch(isc_time_t *t) {
+ REQUIRE(t != NULL);
+
+ t->seconds = 0;
+ t->nanoseconds = 0;
+}
+
+isc_boolean_t
+isc_time_isepoch(const isc_time_t *t) {
+ REQUIRE(t != NULL);
+ INSIST(t->nanoseconds < NS_PER_S);
+
+ if (t->seconds == 0 && t->nanoseconds == 0)
+ return (ISC_TRUE);
+
+ return (ISC_FALSE);
+}
+
+
+isc_result_t
+isc_time_now(isc_time_t *t) {
+ struct timeval tv;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(t != NULL);
+
+ if (gettimeofday(&tv, NULL) == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+
+ /*
+ * Does POSIX guarantee the signedness of tv_sec and tv_usec? If not,
+ * then this test will generate warnings for platforms on which it is
+ * unsigned. In any event, the chances of any of these problems
+ * happening are pretty much zero, but since the libisc library ensures
+ * certain things to be true ...
+ */
+#if ISC_FIX_TV_USEC
+ fix_tv_usec(&tv);
+ if (tv.tv_sec < 0)
+ return (ISC_R_UNEXPECTED);
+#else
+ if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
+ return (ISC_R_UNEXPECTED);
+#endif
+
+ /*
+ * Ensure the tv_sec value fits in t->seconds.
+ */
+ if (sizeof(tv.tv_sec) > sizeof(t->seconds) &&
+ ((tv.tv_sec | (unsigned int)-1) ^ (unsigned int)-1) != 0U)
+ return (ISC_R_RANGE);
+
+ t->seconds = tv.tv_sec;
+ t->nanoseconds = tv.tv_usec * NS_PER_US;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i) {
+ struct timeval tv;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(t != NULL);
+ REQUIRE(i != NULL);
+ INSIST(i->nanoseconds < NS_PER_S);
+
+ if (gettimeofday(&tv, NULL) == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+
+ /*
+ * Does POSIX guarantee the signedness of tv_sec and tv_usec? If not,
+ * then this test will generate warnings for platforms on which it is
+ * unsigned. In any event, the chances of any of these problems
+ * happening are pretty much zero, but since the libisc library ensures
+ * certain things to be true ...
+ */
+#if ISC_FIX_TV_USEC
+ fix_tv_usec(&tv);
+ if (tv.tv_sec < 0)
+ return (ISC_R_UNEXPECTED);
+#else
+ if (tv.tv_sec < 0 || tv.tv_usec < 0 || tv.tv_usec >= US_PER_S)
+ return (ISC_R_UNEXPECTED);
+#endif
+
+ /*
+ * Ensure the resulting seconds value fits in the size of an
+ * unsigned int. (It is written this way as a slight optimization;
+ * note that even if both values == INT_MAX, then when added
+ * and getting another 1 added below the result is UINT_MAX.)
+ */
+ if ((tv.tv_sec > INT_MAX || i->seconds > INT_MAX) &&
+ ((long long)tv.tv_sec + i->seconds > UINT_MAX))
+ return (ISC_R_RANGE);
+
+ t->seconds = tv.tv_sec + i->seconds;
+ t->nanoseconds = tv.tv_usec * NS_PER_US + i->nanoseconds;
+ if (t->nanoseconds >= NS_PER_S) {
+ t->seconds++;
+ t->nanoseconds -= NS_PER_S;
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+int
+isc_time_compare(const isc_time_t *t1, const isc_time_t *t2) {
+ REQUIRE(t1 != NULL && t2 != NULL);
+ INSIST(t1->nanoseconds < NS_PER_S && t2->nanoseconds < NS_PER_S);
+
+ if (t1->seconds < t2->seconds)
+ return (-1);
+ if (t1->seconds > t2->seconds)
+ return (1);
+ if (t1->nanoseconds < t2->nanoseconds)
+ return (-1);
+ if (t1->nanoseconds > t2->nanoseconds)
+ return (1);
+ return (0);
+}
+
+isc_result_t
+isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result)
+{
+ REQUIRE(t != NULL && i != NULL && result != NULL);
+ INSIST(t->nanoseconds < NS_PER_S && i->nanoseconds < NS_PER_S);
+
+ /*
+ * Ensure the resulting seconds value fits in the size of an
+ * unsigned int. (It is written this way as a slight optimization;
+ * note that even if both values == INT_MAX, then when added
+ * and getting another 1 added below the result is UINT_MAX.)
+ */
+ if ((t->seconds > INT_MAX || i->seconds > INT_MAX) &&
+ ((long long)t->seconds + i->seconds > UINT_MAX))
+ return (ISC_R_RANGE);
+
+ result->seconds = t->seconds + i->seconds;
+ result->nanoseconds = t->nanoseconds + i->nanoseconds;
+ if (result->nanoseconds >= NS_PER_S) {
+ result->seconds++;
+ result->nanoseconds -= NS_PER_S;
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_time_subtract(const isc_time_t *t, const isc_interval_t *i,
+ isc_time_t *result)
+{
+ REQUIRE(t != NULL && i != NULL && result != NULL);
+ INSIST(t->nanoseconds < NS_PER_S && i->nanoseconds < NS_PER_S);
+
+ if ((unsigned int)t->seconds < i->seconds ||
+ ((unsigned int)t->seconds == i->seconds &&
+ t->nanoseconds < i->nanoseconds))
+ return (ISC_R_RANGE);
+
+ result->seconds = t->seconds - i->seconds;
+ if (t->nanoseconds >= i->nanoseconds)
+ result->nanoseconds = t->nanoseconds - i->nanoseconds;
+ else {
+ result->nanoseconds = NS_PER_S - i->nanoseconds +
+ t->nanoseconds;
+ result->seconds--;
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_uint64_t
+isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2) {
+ isc_uint64_t i1, i2, i3;
+
+ REQUIRE(t1 != NULL && t2 != NULL);
+ INSIST(t1->nanoseconds < NS_PER_S && t2->nanoseconds < NS_PER_S);
+
+ i1 = (isc_uint64_t)t1->seconds * NS_PER_S + t1->nanoseconds;
+ i2 = (isc_uint64_t)t2->seconds * NS_PER_S + t2->nanoseconds;
+
+ if (i1 <= i2)
+ return (0);
+
+ i3 = i1 - i2;
+
+ /*
+ * Convert to microseconds.
+ */
+ i3 /= NS_PER_US;
+
+ return (i3);
+}
+
+isc_uint32_t
+isc_time_seconds(const isc_time_t *t) {
+ REQUIRE(t != NULL);
+ INSIST(t->nanoseconds < NS_PER_S);
+
+ return ((isc_uint32_t)t->seconds);
+}
+
+isc_result_t
+isc_time_secondsastimet(const isc_time_t *t, time_t *secondsp) {
+ time_t seconds;
+
+ REQUIRE(t != NULL);
+ INSIST(t->nanoseconds < NS_PER_S);
+
+ /*
+ * Ensure that the number of seconds represented by t->seconds
+ * can be represented by a time_t. Since t->seconds is an unsigned
+ * int and since time_t is mostly opaque, this is trickier than
+ * it seems. (This standardized opaqueness of time_t is *very*
+ * frustrating; time_t is not even limited to being an integral
+ * type.)
+ *
+ * The mission, then, is to avoid generating any kind of warning
+ * about "signed versus unsigned" while trying to determine if the
+ * the unsigned int t->seconds is out range for tv_sec, which is
+ * pretty much only true if time_t is a signed integer of the same
+ * size as the return value of isc_time_seconds.
+ *
+ * If the paradox in the if clause below is true, t->seconds is out
+ * of range for time_t.
+ */
+ seconds = (time_t)t->seconds;
+
+ INSIST(sizeof(unsigned int) == sizeof(isc_uint32_t));
+ INSIST(sizeof(time_t) >= sizeof(isc_uint32_t));
+
+ if (t->seconds > (~0U>>1) && seconds <= (time_t)(~0U>>1))
+ return (ISC_R_RANGE);
+
+ *secondsp = seconds;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_uint32_t
+isc_time_nanoseconds(const isc_time_t *t) {
+ REQUIRE(t != NULL);
+
+ ENSURE(t->nanoseconds < NS_PER_S);
+
+ return ((isc_uint32_t)t->nanoseconds);
+}
+
+void
+isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) {
+ time_t now;
+ unsigned int flen;
+
+ REQUIRE(len > 0);
+
+ now = (time_t) t->seconds;
+ flen = strftime(buf, len, "%d-%b-%Y %X", localtime(&now));
+ INSIST(flen < len);
+ if (flen != 0)
+ snprintf(buf + flen, len - flen,
+ ".%03u", t->nanoseconds / 1000000);
+ else
+ snprintf(buf, len, "99-Bad-9999 99:99:99.999");
+}
+
+void
+isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len) {
+ time_t now;
+ unsigned int flen;
+
+ REQUIRE(len > 0);
+
+ now = (time_t)t->seconds;
+ flen = strftime(buf, len, "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now));
+ INSIST(flen < len);
+}
+
+void
+isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len) {
+ time_t now;
+ unsigned int flen;
+
+ REQUIRE(len > 0);
+
+ now = (time_t)t->seconds;
+ flen = strftime(buf, len, "%Y-%m-%dT%H:%M:%SZ", gmtime(&now));
+ INSIST(flen < len);
+}
diff --git a/lib/isc/version.c b/lib/isc/version.c
new file mode 100644
index 0000000..bfe4d6d
--- /dev/null
+++ b/lib/isc/version.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: version.c,v 1.15 2007/06/19 23:47:17 tbox Exp $ */
+
+/*! \file */
+
+#include <isc/version.h>
+
+const char isc_version[] = VERSION;
+
+const unsigned int isc_libinterface = LIBINTERFACE;
+const unsigned int isc_librevision = LIBREVISION;
+const unsigned int isc_libage = LIBAGE;
diff --git a/lib/isc/win32/DLLMain.c b/lib/isc/win32/DLLMain.c
new file mode 100644
index 0000000..ed84fcf
--- /dev/null
+++ b/lib/isc/win32/DLLMain.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: DLLMain.c,v 1.7 2007/06/18 23:47:49 tbox Exp $ */
+
+#include <windows.h>
+#include <stdio.h>
+
+/*
+ * Called when we enter the DLL
+ */
+__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL,
+ DWORD fdwReason, LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ /*
+ * The DLL is loading due to process
+ * initialization or a call to LoadLibrary.
+ */
+ case DLL_PROCESS_ATTACH:
+ break;
+
+ /* The attached process creates a new thread. */
+ case DLL_THREAD_ATTACH:
+ break;
+
+ /* The thread of the attached process terminates. */
+ case DLL_THREAD_DETACH:
+ break;
+
+ /*
+ * The DLL is unloading from a process due to
+ * process termination or a call to FreeLibrary.
+ */
+ case DLL_PROCESS_DETACH:
+ break;
+
+ default:
+ break;
+ }
+ return (TRUE);
+}
+
diff --git a/lib/isc/win32/app.c b/lib/isc/win32/app.c
new file mode 100644
index 0000000..04b1638
--- /dev/null
+++ b/lib/isc/win32/app.c
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: app.c,v 1.9 2009/09/02 23:48:03 tbox Exp $ */
+
+#include <config.h>
+
+#include <sys/types.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <process.h>
+
+#include <isc/app.h>
+#include <isc/boolean.h>
+#include <isc/condition.h>
+#include <isc/msgs.h>
+#include <isc/mutex.h>
+#include <isc/event.h>
+#include <isc/platform.h>
+#include <isc/string.h>
+#include <isc/task.h>
+#include <isc/time.h>
+#include <isc/util.h>
+#include <isc/thread.h>
+
+static isc_eventlist_t on_run;
+static isc_mutex_t lock;
+static isc_boolean_t shutdown_requested = ISC_FALSE;
+static isc_boolean_t running = ISC_FALSE;
+/*
+ * We assume that 'want_shutdown' can be read and written atomically.
+ */
+static isc_boolean_t want_shutdown = ISC_FALSE;
+/*
+ * We assume that 'want_reload' can be read and written atomically.
+ */
+static isc_boolean_t want_reload = ISC_FALSE;
+
+static isc_boolean_t blocked = ISC_FALSE;
+
+static isc_thread_t blockedthread;
+
+/* Events to wait for */
+
+#define NUM_EVENTS 2
+
+enum {
+ RELOAD_EVENT,
+ SHUTDOWN_EVENT
+};
+
+static HANDLE hEvents[NUM_EVENTS];
+DWORD dwWaitResult;
+
+/*
+ * We need to remember which thread is the main thread...
+ */
+static isc_thread_t main_thread;
+
+isc_result_t
+isc__app_start(void) {
+ isc_result_t result;
+
+ /*
+ * Start an ISC library application.
+ */
+
+ main_thread = GetCurrentThread();
+
+ result = isc_mutex_init(&lock);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /* Create the reload event in a non-signaled state */
+ hEvents[RELOAD_EVENT] = CreateEvent(NULL, FALSE, FALSE, NULL);
+
+ /* Create the shutdown event in a non-signaled state */
+ hEvents[SHUTDOWN_EVENT] = CreateEvent(NULL, FALSE, FALSE, NULL);
+
+ ISC_LIST_INIT(on_run);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__app_onrun(isc_mem_t *mctx, isc_task_t *task, isc_taskaction_t action,
+ void *arg) {
+ isc_event_t *event;
+ isc_task_t *cloned_task = NULL;
+ isc_result_t result;
+
+
+ LOCK(&lock);
+ if (running) {
+ result = ISC_R_ALREADYRUNNING;
+ goto unlock;
+ }
+
+ /*
+ * Note that we store the task to which we're going to send the event
+ * in the event's "sender" field.
+ */
+ isc_task_attach(task, &cloned_task);
+ event = isc_event_allocate(mctx, cloned_task, ISC_APPEVENT_SHUTDOWN,
+ action, arg, sizeof(*event));
+ if (event == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto unlock;
+ }
+
+ ISC_LIST_APPEND(on_run, event, ev_link);
+ result = ISC_R_SUCCESS;
+
+ unlock:
+ UNLOCK(&lock);
+ return (result);
+}
+
+isc_result_t
+isc__app_run(void) {
+ isc_event_t *event, *next_event;
+ isc_task_t *task;
+ HANDLE *pHandles = NULL;
+
+ REQUIRE(main_thread == GetCurrentThread());
+ LOCK(&lock);
+ if (!running) {
+ running = ISC_TRUE;
+
+ /*
+ * Post any on-run events (in FIFO order).
+ */
+ for (event = ISC_LIST_HEAD(on_run);
+ event != NULL;
+ event = next_event) {
+ next_event = ISC_LIST_NEXT(event, ev_link);
+ ISC_LIST_UNLINK(on_run, event, ev_link);
+ task = event->ev_sender;
+ event->ev_sender = NULL;
+ isc_task_sendanddetach(&task, &event);
+ }
+
+ }
+
+ UNLOCK(&lock);
+
+ /*
+ * There is no danger if isc_app_shutdown() is called before we wait
+ * for events.
+ */
+
+ while (!want_shutdown) {
+ dwWaitResult = WaitForMultipleObjects(NUM_EVENTS, hEvents,
+ FALSE, INFINITE);
+
+ /* See why we returned */
+
+ if (WaitSucceeded(dwWaitResult, NUM_EVENTS)) {
+ /*
+ * The return was due to one of the events
+ * being signaled
+ */
+ switch (WaitSucceededIndex(dwWaitResult)) {
+ case RELOAD_EVENT:
+ want_reload = ISC_TRUE;
+ break;
+
+ case SHUTDOWN_EVENT:
+ want_shutdown = ISC_TRUE;
+ break;
+ }
+ }
+ if (want_reload) {
+ want_reload = ISC_FALSE;
+ return (ISC_R_RELOAD);
+ }
+
+ if (want_shutdown && blocked)
+ exit(-1);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__app_shutdown(void) {
+ isc_boolean_t want_kill = ISC_TRUE;
+
+ LOCK(&lock);
+ REQUIRE(running);
+
+ if (shutdown_requested)
+ want_kill = ISC_FALSE; /* We're only signaling once */
+ else
+ shutdown_requested = ISC_TRUE;
+
+ UNLOCK(&lock);
+ if (want_kill)
+ SetEvent(hEvents[SHUTDOWN_EVENT]);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__app_reload(void) {
+ isc_boolean_t want_reload = ISC_TRUE;
+
+ LOCK(&lock);
+ REQUIRE(running);
+
+ /*
+ * Don't send the reload signal if we're shutting down.
+ */
+ if (shutdown_requested)
+ want_reload = ISC_FALSE;
+
+ UNLOCK(&lock);
+ if (want_reload)
+ SetEvent(hEvents[RELOAD_EVENT]);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc__app_finish(void) {
+ DESTROYLOCK(&lock);
+}
+
+void
+isc__app_block(void) {
+ REQUIRE(running);
+ REQUIRE(!blocked);
+
+ blocked = ISC_TRUE;
+ blockedthread = GetCurrentThread();
+}
+
+void
+isc__app_unblock(void) {
+ REQUIRE(running);
+ REQUIRE(blocked);
+ blocked = ISC_FALSE;
+ REQUIRE(blockedthread == GetCurrentThread());
+}
diff --git a/lib/isc/win32/condition.c b/lib/isc/win32/condition.c
new file mode 100644
index 0000000..27d4e76
--- /dev/null
+++ b/lib/isc/win32/condition.c
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: condition.c,v 1.23 2007/06/18 23:47:49 tbox Exp $ */
+
+#include <config.h>
+
+#include <isc/condition.h>
+#include <isc/assertions.h>
+#include <isc/util.h>
+#include <isc/thread.h>
+#include <isc/time.h>
+
+#define LSIGNAL 0
+#define LBROADCAST 1
+
+isc_result_t
+isc_condition_init(isc_condition_t *cond) {
+ HANDLE h;
+
+ REQUIRE(cond != NULL);
+
+ cond->waiters = 0;
+ /*
+ * This handle is shared across all threads
+ */
+ h = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (h == NULL) {
+ /* XXX */
+ return (ISC_R_UNEXPECTED);
+ }
+ cond->events[LSIGNAL] = h;
+
+ /*
+ * The threadlist will hold the actual events needed
+ * for the wait condition
+ */
+ ISC_LIST_INIT(cond->threadlist);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Add the thread to the threadlist along with the required events
+ */
+static isc_result_t
+register_thread(unsigned long thrd, isc_condition_t *gblcond,
+ isc_condition_thread_t **localcond)
+{
+ HANDLE hc;
+ isc_condition_thread_t *newthread;
+
+ REQUIRE(localcond != NULL && *localcond == NULL);
+
+ newthread = malloc(sizeof(isc_condition_thread_t));
+ if (newthread == NULL)
+ return (ISC_R_NOMEMORY);
+
+ /*
+ * Create the thread-specific handle
+ */
+ hc = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (hc == NULL) {
+ free(newthread);
+ return (ISC_R_UNEXPECTED);
+ }
+
+ /*
+ * Add the thread ID and handles to list of threads for broadcast
+ */
+ newthread->handle[LSIGNAL] = gblcond->events[LSIGNAL];
+ newthread->handle[LBROADCAST] = hc;
+ newthread->th = thrd;
+
+ /*
+ * The thread is holding the manager lock so this is safe
+ */
+ ISC_LIST_APPEND(gblcond->threadlist, newthread, link);
+ *localcond = newthread;
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+find_thread_condition(unsigned long thrd, isc_condition_t *cond,
+ isc_condition_thread_t **threadcondp)
+{
+ isc_condition_thread_t *threadcond;
+
+ REQUIRE(threadcondp != NULL && *threadcondp == NULL);
+
+ /*
+ * Look for the thread ID.
+ */
+ for (threadcond = ISC_LIST_HEAD(cond->threadlist);
+ threadcond != NULL;
+ threadcond = ISC_LIST_NEXT(threadcond, link)) {
+
+ if (threadcond->th == thrd) {
+ *threadcondp = threadcond;
+ return (ISC_R_SUCCESS);
+ }
+ }
+
+ /*
+ * Not found, so add it.
+ */
+ return (register_thread(thrd, cond, threadcondp));
+}
+
+isc_result_t
+isc_condition_signal(isc_condition_t *cond) {
+
+ /*
+ * Unlike pthreads, the caller MUST hold the lock associated with
+ * the condition variable when calling us.
+ */
+ REQUIRE(cond != NULL);
+
+ if (!SetEvent(cond->events[LSIGNAL])) {
+ /* XXX */
+ return (ISC_R_UNEXPECTED);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_condition_broadcast(isc_condition_t *cond) {
+
+ isc_condition_thread_t *threadcond;
+ isc_boolean_t failed = ISC_FALSE;
+
+ /*
+ * Unlike pthreads, the caller MUST hold the lock associated with
+ * the condition variable when calling us.
+ */
+ REQUIRE(cond != NULL);
+
+ /*
+ * Notify every thread registered for this
+ */
+ for (threadcond = ISC_LIST_HEAD(cond->threadlist);
+ threadcond != NULL;
+ threadcond = ISC_LIST_NEXT(threadcond, link)) {
+
+ if (!SetEvent(threadcond->handle[LBROADCAST]))
+ failed = ISC_TRUE;
+ }
+
+ if (failed)
+ return (ISC_R_UNEXPECTED);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_condition_destroy(isc_condition_t *cond) {
+
+ isc_condition_thread_t *next, *threadcond;
+
+ REQUIRE(cond != NULL);
+ REQUIRE(cond->waiters == 0);
+
+ (void)CloseHandle(cond->events[LSIGNAL]);
+
+ /*
+ * Delete the threadlist
+ */
+ threadcond = ISC_LIST_HEAD(cond->threadlist);
+
+ while (threadcond != NULL) {
+ next = ISC_LIST_NEXT(threadcond, link);
+ DEQUEUE(cond->threadlist, threadcond, link);
+ (void) CloseHandle(threadcond->handle[LBROADCAST]);
+ free(threadcond);
+ threadcond = next;
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * This is always called when the mutex (lock) is held, but because
+ * we are waiting we need to release it and reacquire it as soon as the wait
+ * is over. This allows other threads to make use of the object guarded
+ * by the mutex but it should never try to delete it as long as the
+ * number of waiters > 0. Always reacquire the mutex regardless of the
+ * result of the wait. Note that EnterCriticalSection will wait to acquire
+ * the mutex.
+ */
+static isc_result_t
+wait(isc_condition_t *cond, isc_mutex_t *mutex, DWORD milliseconds) {
+ DWORD result;
+ isc_result_t tresult;
+ isc_condition_thread_t *threadcond = NULL;
+
+ /*
+ * Get the thread events needed for the wait
+ */
+ tresult = find_thread_condition(isc_thread_self(), cond, &threadcond);
+ if (tresult != ISC_R_SUCCESS)
+ return (tresult);
+
+ cond->waiters++;
+ LeaveCriticalSection(mutex);
+ result = WaitForMultipleObjects(2, threadcond->handle, FALSE,
+ milliseconds);
+ EnterCriticalSection(mutex);
+ cond->waiters--;
+ if (result == WAIT_FAILED) {
+ /* XXX */
+ return (ISC_R_UNEXPECTED);
+ }
+ if (result == WAIT_TIMEOUT)
+ return (ISC_R_TIMEDOUT);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_condition_wait(isc_condition_t *cond, isc_mutex_t *mutex) {
+ return (wait(cond, mutex, INFINITE));
+}
+
+isc_result_t
+isc_condition_waituntil(isc_condition_t *cond, isc_mutex_t *mutex,
+ isc_time_t *t) {
+ DWORD milliseconds;
+ isc_uint64_t microseconds;
+ isc_time_t now;
+
+ if (isc_time_now(&now) != ISC_R_SUCCESS) {
+ /* XXX */
+ return (ISC_R_UNEXPECTED);
+ }
+
+ microseconds = isc_time_microdiff(t, &now);
+ if (microseconds > 0xFFFFFFFFi64 * 1000)
+ milliseconds = 0xFFFFFFFF;
+ else
+ milliseconds = (DWORD)(microseconds / 1000);
+
+ return (wait(cond, mutex, milliseconds));
+}
diff --git a/lib/isc/win32/dir.c b/lib/isc/win32/dir.c
new file mode 100644
index 0000000..14fadde
--- /dev/null
+++ b/lib/isc/win32/dir.c
@@ -0,0 +1,312 @@
+/*
+ * Copyright (C) 2004, 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/* Principal Authors: DCL */
+
+#include <config.h>
+
+#include <string.h>
+#include <direct.h>
+#include <process.h>
+#include <io.h>
+
+#include <sys/stat.h>
+
+#include <isc/dir.h>
+#include <isc/magic.h>
+#include <isc/assertions.h>
+#include <isc/util.h>
+
+#include "errno2result.h"
+
+#define ISC_DIR_MAGIC ISC_MAGIC('D', 'I', 'R', '*')
+#define VALID_DIR(dir) ISC_MAGIC_VALID(dir, ISC_DIR_MAGIC)
+
+static isc_result_t
+start_directory(isc_dir_t *p);
+
+void
+isc_dir_init(isc_dir_t *dir) {
+ REQUIRE(dir != NULL);
+
+ dir->dirname[0] = '\0';
+
+ dir->entry.name[0] = '\0';
+ dir->entry.length = 0;
+ memset(&(dir->entry.find_data), 0, sizeof(dir->entry.find_data));
+
+ dir->entry_filled = ISC_FALSE;
+ dir->search_handle = INVALID_HANDLE_VALUE;
+
+ dir->magic = ISC_DIR_MAGIC;
+}
+
+/*
+ * Allocate workspace and open directory stream. If either one fails,
+ * NULL will be returned.
+ */
+isc_result_t
+isc_dir_open(isc_dir_t *dir, const char *dirname) {
+ char *p;
+ isc_result_t result;
+
+ REQUIRE(dirname != NULL);
+ REQUIRE(VALID_DIR(dir) && dir->search_handle == INVALID_HANDLE_VALUE);
+
+ /*
+ * Copy directory name. Need to have enough space for the name,
+ * a possible path separator, the wildcard, and the final NUL.
+ */
+ if (strlen(dirname) + 3 > sizeof(dir->dirname))
+ /* XXXDCL ? */
+ return (ISC_R_NOSPACE);
+ strcpy(dir->dirname, dirname);
+
+ /*
+ * Append path separator, if needed, and "*".
+ */
+ p = dir->dirname + strlen(dir->dirname);
+ if (dir->dirname < p && *(p - 1) != '\\' && *(p - 1) != ':')
+ *p++ = '\\';
+ *p++ = '*';
+ *p = '\0';
+
+ /*
+ * Open stream.
+ */
+ result = start_directory(dir);
+
+ return (result);
+}
+
+/*
+ * Return previously retrieved file or get next one. Unix's dirent has
+ * separate open and read functions, but the Win32 and DOS interfaces open
+ * the dir stream and reads the first file in one operation.
+ */
+isc_result_t
+isc_dir_read(isc_dir_t *dir) {
+ REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE);
+
+ if (dir->entry_filled)
+ /*
+ * start_directory() already filled in the first entry.
+ */
+ dir->entry_filled = ISC_FALSE;
+
+ else {
+ /*
+ * Fetch next file in directory.
+ */
+ if (FindNextFile(dir->search_handle,
+ &dir->entry.find_data) == FALSE)
+ /*
+ * Either the last file has been processed or
+ * an error has occurred. The former is not
+ * really an error, but the latter is.
+ */
+ if (GetLastError() == ERROR_NO_MORE_FILES)
+ return (ISC_R_NOMORE);
+ else
+ return (ISC_R_UNEXPECTED);
+ }
+
+ /*
+ * Make sure that the space for the name is long enough.
+ */
+ strcpy(dir->entry.name, dir->entry.find_data.cFileName);
+ dir->entry.length = strlen(dir->entry.name);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Close directory stream.
+ */
+void
+isc_dir_close(isc_dir_t *dir) {
+ REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE);
+
+ FindClose(dir->search_handle);
+ dir->search_handle = INVALID_HANDLE_VALUE;
+}
+
+/*
+ * Reposition directory stream at start.
+ */
+isc_result_t
+isc_dir_reset(isc_dir_t *dir) {
+ isc_result_t result;
+
+ REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE);
+ REQUIRE(dir->dirname != NULL);
+
+ /*
+ * NT cannot reposition the seek pointer to the beginning of the
+ * the directory stream, but rather the directory needs to be
+ * closed and reopened. The latter might fail.
+ */
+
+ isc_dir_close(dir);
+
+ result = start_directory(dir);
+
+ return (result);
+}
+
+/*
+ * Initialize isc_dir_t structure with new directory. The function
+ * returns 0 on failure and nonzero on success.
+ *
+ * Note:
+ * - Be sure to close previous stream before opening new one
+ */
+static isc_result_t
+start_directory(isc_dir_t *dir)
+{
+ REQUIRE(VALID_DIR(dir));
+ REQUIRE(dir->search_handle == INVALID_HANDLE_VALUE);
+
+ dir->entry_filled = ISC_FALSE;
+
+ /*
+ * Open stream and retrieve first file.
+ */
+ dir->search_handle = FindFirstFile(dir->dirname,
+ &dir->entry.find_data);
+
+ if (dir->search_handle == INVALID_HANDLE_VALUE) {
+ /*
+ * Something went wrong but we don't know what. GetLastError()
+ * could give us more information about the error, but the
+ * MSDN documentation is frustratingly thin about what
+ * possible errors could have resulted. (Score one for
+ * the Unix manual pages.) So there is just this lame error
+ * instead of being able to differentiate ISC_R_NOTFOUND
+ * from ISC_R_UNEXPECTED.
+ */
+ return (ISC_R_FAILURE);
+ }
+
+ /*
+ * Make sure that the space for the name is long enough.
+ */
+ INSIST(sizeof(dir->entry.name) >
+ strlen(dir->entry.find_data.cFileName));
+
+ /*
+ * Fill in the data for the first entry of the directory.
+ */
+ strcpy(dir->entry.name, dir->entry.find_data.cFileName);
+ dir->entry.length = strlen(dir->entry.name);
+
+ dir->entry_filled = ISC_TRUE;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_dir_chdir(const char *dirname) {
+ /*
+ * Change the current directory to 'dirname'.
+ */
+
+ REQUIRE(dirname != NULL);
+
+ if (chdir(dirname) < 0)
+ return (isc__errno2result(errno));
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_dir_chroot(const char *dirname) {
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+isc_result_t
+isc_dir_createunique(char *templet) {
+ isc_result_t result;
+ char *x;
+ char *p;
+ int i;
+ int pid;
+
+ REQUIRE(templet != NULL);
+
+ /*
+ * mkdtemp is not portable, so this emulates it.
+ */
+
+ pid = getpid();
+
+ /*
+ * Replace trailing Xs with the process-id, zero-filled.
+ */
+ for (x = templet + strlen(templet) - 1; *x == 'X' && x >= templet;
+ x--, pid /= 10)
+ *x = pid % 10 + '0';
+
+ x++; /* Set x to start of ex-Xs. */
+
+ do {
+ i = mkdir(templet);
+ i = chmod(templet, 0700);
+
+ if (i == 0 || errno != EEXIST)
+ break;
+
+ /*
+ * The BSD algorithm.
+ */
+ p = x;
+ while (*p != '\0') {
+ if (isdigit(*p & 0xff))
+ *p = 'a';
+ else if (*p != 'z')
+ ++*p;
+ else {
+ /*
+ * Reset character and move to next.
+ */
+ *p++ = 'a';
+ continue;
+ }
+
+ break;
+ }
+
+ if (*p == '\0') {
+ /*
+ * Tried all combinations. errno should already
+ * be EEXIST, but ensure it is anyway for
+ * isc__errno2result().
+ */
+ errno = EEXIST;
+ break;
+ }
+ } while (1);
+
+ if (i == -1)
+ result = isc__errno2result(errno);
+ else
+ result = ISC_R_SUCCESS;
+
+ return (result);
+}
diff --git a/lib/isc/win32/entropy.c b/lib/isc/win32/entropy.c
new file mode 100644
index 0000000..5a316e6
--- /dev/null
+++ b/lib/isc/win32/entropy.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: entropy.c,v 1.10 2009/01/18 23:48:14 tbox Exp $ */
+
+/*
+ * This is the system dependent part of the ISC entropy API.
+ */
+
+#include <config.h>
+
+#include <windows.h>
+#include <wincrypt.h>
+
+#include <process.h>
+#include <io.h>
+#include <share.h>
+
+/*
+ * There is only one variable in the entropy data structures that is not
+ * system independent, but pulling the structure that uses it into this file
+ * ultimately means pulling several other independent structures here also to
+ * resolve their interdependencies. Thus only the problem variable's type
+ * is defined here.
+ */
+#define FILESOURCE_HANDLE_TYPE HCRYPTPROV
+
+typedef struct {
+ int dummy;
+} isc_entropyusocketsource_t;
+
+#include "../entropy.c"
+
+static unsigned int
+get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) {
+ isc_entropy_t *ent = source->ent;
+ unsigned char buf[128];
+ HCRYPTPROV hcryptprov = source->sources.file.handle;
+ ssize_t ndesired;
+ unsigned int added;
+
+ if (source->bad)
+ return (0);
+
+ desired = desired / 8 + (((desired & 0x07) > 0) ? 1 : 0);
+
+ added = 0;
+ while (desired > 0) {
+ ndesired = ISC_MIN(desired, sizeof(buf));
+ if (!CryptGenRandom(hcryptprov, ndesired, buf)) {
+ CryptReleaseContext(hcryptprov, 0);
+ source->bad = ISC_TRUE;
+ goto out;
+ }
+
+ entropypool_adddata(ent, buf, ndesired, ndesired * 8);
+ added += ndesired * 8;
+ desired -= ndesired;
+ }
+
+ out:
+ return (added);
+}
+
+/*
+ * Poll each source, trying to get data from it to stuff into the entropy
+ * pool.
+ */
+static void
+fillpool(isc_entropy_t *ent, unsigned int desired, isc_boolean_t blocking) {
+ unsigned int added;
+ unsigned int remaining;
+ unsigned int needed;
+ unsigned int nsource;
+ isc_entropysource_t *source;
+ isc_entropysource_t *firstsource;
+
+ REQUIRE(VALID_ENTROPY(ent));
+
+ needed = desired;
+
+ /*
+ * This logic is a little strange, so an explanation is in order.
+ *
+ * If needed is 0, it means we are being asked to "fill to whatever
+ * we think is best." This means that if we have at least a
+ * partially full pool (say, > 1/4th of the pool) we probably don't
+ * need to add anything.
+ *
+ * Also, we will check to see if the "pseudo" count is too high.
+ * If it is, try to mix in better data. Too high is currently
+ * defined as 1/4th of the pool.
+ *
+ * Next, if we are asked to add a specific bit of entropy, make
+ * certain that we will do so. Clamp how much we try to add to
+ * (DIGEST_SIZE * 8 < needed < POOLBITS - entropy).
+ *
+ * Note that if we are in a blocking mode, we will only try to
+ * get as much data as we need, not as much as we might want
+ * to build up.
+ */
+ if (needed == 0) {
+ REQUIRE(!blocking);
+
+ if ((ent->pool.entropy >= RND_POOLBITS / 4)
+ && (ent->pool.pseudo <= RND_POOLBITS / 4))
+ return;
+
+ needed = THRESHOLD_BITS * 4;
+ } else {
+ needed = ISC_MAX(needed, THRESHOLD_BITS);
+ needed = ISC_MIN(needed, RND_POOLBITS);
+ }
+
+ /*
+ * In any case, clamp how much we need to how much we can add.
+ */
+ needed = ISC_MIN(needed, RND_POOLBITS - ent->pool.entropy);
+
+ /*
+ * But wait! If we're not yet initialized, we need at least
+ * THRESHOLD_BITS
+ * of randomness.
+ */
+ if (ent->initialized < THRESHOLD_BITS)
+ needed = ISC_MAX(needed, THRESHOLD_BITS - ent->initialized);
+
+ /*
+ * Poll each file source to see if we can read anything useful from
+ * it. XXXMLG When where are multiple sources, we should keep a
+ * record of which one we last used so we can start from it (or the
+ * next one) to avoid letting some sources build up entropy while
+ * others are always drained.
+ */
+
+ added = 0;
+ remaining = needed;
+ if (ent->nextsource == NULL) {
+ ent->nextsource = ISC_LIST_HEAD(ent->sources);
+ if (ent->nextsource == NULL)
+ return;
+ }
+ source = ent->nextsource;
+ /*
+ * Remember the first source so we can break if we have looped back to
+ * the beginning and still have nothing
+ */
+ firstsource = source;
+ again_file:
+ for (nsource = 0; nsource < ent->nsources; nsource++) {
+ unsigned int got;
+
+ if (remaining == 0)
+ break;
+
+ got = 0;
+
+ if (source->type == ENTROPY_SOURCETYPE_FILE)
+ got = get_from_filesource(source, remaining);
+
+ added += got;
+
+ remaining -= ISC_MIN(remaining, got);
+
+ source = ISC_LIST_NEXT(source, link);
+ if (source == NULL)
+ source = ISC_LIST_HEAD(ent->sources);
+ }
+ ent->nextsource = source;
+
+ /*
+ * Go again only if there's been progress and we've not
+ * gone back to the beginning
+ */
+ if (!(ent->nextsource == firstsource && added == 0)) {
+ if (blocking && remaining != 0) {
+ goto again_file;
+ }
+ }
+
+ /*
+ * Here, if there are bits remaining to be had and we can block,
+ * check to see if we have a callback source. If so, call them.
+ */
+ source = ISC_LIST_HEAD(ent->sources);
+ while ((remaining != 0) && (source != NULL)) {
+ unsigned int got;
+
+ got = 0;
+
+ if (source->type == ENTROPY_SOURCETYPE_CALLBACK)
+ got = get_from_callback(source, remaining, blocking);
+
+ added += got;
+ remaining -= ISC_MIN(remaining, got);
+
+ if (added >= needed)
+ break;
+
+ source = ISC_LIST_NEXT(source, link);
+ }
+
+ /*
+ * Mark as initialized if we've added enough data.
+ */
+ if (ent->initialized < THRESHOLD_BITS)
+ ent->initialized += added;
+}
+
+
+
+/*
+ * Requires "ent" be locked.
+ */
+static void
+destroyfilesource(isc_entropyfilesource_t *source) {
+ CryptReleaseContext(source->handle, 0);
+}
+
+static void
+destroyusocketsource(isc_entropyusocketsource_t *source) {
+ UNUSED(source);
+}
+
+
+isc_result_t
+isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
+ isc_result_t ret;
+ isc_entropysource_t *source;
+ HCRYPTPROV hcryptprov;
+ DWORD errval;
+ BOOL err;
+
+ REQUIRE(VALID_ENTROPY(ent));
+ REQUIRE(fname != NULL);
+
+ LOCK(&ent->lock);
+
+ source = NULL;
+
+ /*
+ * The first time we just try to acquire the context
+ */
+ err = CryptAcquireContext(&hcryptprov, NULL, NULL, PROV_RSA_FULL,
+ CRYPT_VERIFYCONTEXT);
+ if (!err){
+ errval = GetLastError();
+ ret = ISC_R_IOERROR;
+ goto errout;
+ }
+
+ source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t));
+ if (source == NULL) {
+ ret = ISC_R_NOMEMORY;
+ goto closecontext;
+ }
+
+ /*
+ * From here down, no failures can occur.
+ */
+ source->magic = SOURCE_MAGIC;
+ source->type = ENTROPY_SOURCETYPE_FILE;
+ source->ent = ent;
+ source->total = 0;
+ source->bad = ISC_FALSE;
+ memset(source->name, 0, sizeof(source->name));
+ ISC_LINK_INIT(source, link);
+ source->sources.file.handle = hcryptprov;
+
+ /*
+ * Hook it into the entropy system.
+ */
+ ISC_LIST_APPEND(ent->sources, source, link);
+ ent->nsources++;
+
+ UNLOCK(&ent->lock);
+ return (ISC_R_SUCCESS);
+
+ closecontext:
+ CryptReleaseContext(hcryptprov, 0);
+
+ errout:
+ if (source != NULL)
+ isc_mem_put(ent->mctx, source, sizeof(isc_entropysource_t));
+
+ UNLOCK(&ent->lock);
+
+ return (ret);
+}
+
+
+
+
diff --git a/lib/isc/win32/errno2result.c b/lib/isc/win32/errno2result.c
new file mode 100644
index 0000000..c3d54d6
--- /dev/null
+++ b/lib/isc/win32/errno2result.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: errno2result.c,v 1.17 2008/09/12 04:46:25 marka Exp $ */
+
+#include <config.h>
+
+#include <winsock2.h>
+#include "errno2result.h"
+#include <isc/result.h>
+#include <isc/strerror.h>
+#include <isc/util.h>
+
+/*
+ * Convert a POSIX errno value into an isc_result_t. The
+ * list of supported errno values is not complete; new users
+ * of this function should add any expected errors that are
+ * not already there.
+ */
+isc_result_t
+isc__errno2resultx(int posixerrno, const char *file, int line) {
+ char strbuf[ISC_STRERRORSIZE];
+
+ switch (posixerrno) {
+ case ENOTDIR:
+ case WSAELOOP:
+ case WSAEINVAL:
+ case EINVAL: /* XXX sometimes this is not for files */
+ case ENAMETOOLONG:
+ case WSAENAMETOOLONG:
+ case EBADF:
+ case WSAEBADF:
+ return (ISC_R_INVALIDFILE);
+ case ENOENT:
+ return (ISC_R_FILENOTFOUND);
+ case EACCES:
+ case WSAEACCES:
+ case EPERM:
+ return (ISC_R_NOPERM);
+ case EEXIST:
+ return (ISC_R_FILEEXISTS);
+ case EIO:
+ return (ISC_R_IOERROR);
+ case ENOMEM:
+ return (ISC_R_NOMEMORY);
+ case ENFILE:
+ case EMFILE:
+ case WSAEMFILE:
+ return (ISC_R_TOOMANYOPENFILES);
+ case ERROR_CANCELLED:
+ return (ISC_R_CANCELED);
+ case ERROR_CONNECTION_REFUSED:
+ case WSAECONNREFUSED:
+ return (ISC_R_CONNREFUSED);
+ case WSAENOTCONN:
+ case ERROR_CONNECTION_INVALID:
+ return (ISC_R_NOTCONNECTED);
+ case ERROR_HOST_UNREACHABLE:
+ case WSAEHOSTUNREACH:
+ return (ISC_R_HOSTUNREACH);
+ case ERROR_NETWORK_UNREACHABLE:
+ case WSAENETUNREACH:
+ return (ISC_R_NETUNREACH);
+ case ERROR_NO_NETWORK:
+ return (ISC_R_NETUNREACH);
+ case ERROR_PORT_UNREACHABLE:
+ return (ISC_R_HOSTUNREACH);
+ case ERROR_SEM_TIMEOUT:
+ return (ISC_R_TIMEDOUT);
+ case WSAECONNRESET:
+ case WSAENETRESET:
+ case WSAECONNABORTED:
+ case WSAEDISCON:
+ case ERROR_OPERATION_ABORTED:
+ case ERROR_CONNECTION_ABORTED:
+ case ERROR_REQUEST_ABORTED:
+ return (ISC_R_CONNECTIONRESET);
+ case WSAEADDRNOTAVAIL:
+ return (ISC_R_ADDRNOTAVAIL);
+ case ERROR_NETNAME_DELETED:
+ case WSAENETDOWN:
+ return (ISC_R_NETUNREACH);
+ case WSAEHOSTDOWN:
+ return (ISC_R_HOSTUNREACH);
+ case WSAENOBUFS:
+ return (ISC_R_NORESOURCES);
+ default:
+ isc__strerror(posixerrno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(file, line, "unable to convert errno "
+ "to isc_result: %d: %s", posixerrno, strbuf);
+ /*
+ * XXXDCL would be nice if perhaps this function could
+ * return the system's error string, so the caller
+ * might have something more descriptive than "unexpected
+ * error" to log with.
+ */
+ return (ISC_R_UNEXPECTED);
+ }
+}
diff --git a/lib/isc/win32/errno2result.h b/lib/isc/win32/errno2result.h
new file mode 100644
index 0000000..41682db
--- /dev/null
+++ b/lib/isc/win32/errno2result.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: errno2result.h,v 1.10 2007/06/19 23:47:19 tbox Exp $ */
+
+#ifndef UNIX_ERRNO2RESULT_H
+#define UNIX_ERRNO2RESULT_H 1
+
+/* XXXDCL this should be moved to lib/isc/include/isc/errno2result.h. */
+
+#include <errno.h> /* Provides errno. */
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+#define isc__errno2result(posixerrno) \
+ isc__errno2resultx(posixerrno, __FILE__, __LINE__)
+
+isc_result_t
+isc__errno2resultx(int posixerrno, const char *file, int line);
+
+ISC_LANG_ENDDECLS
+
+#endif /* UNIX_ERRNO2RESULT_H */
diff --git a/lib/isc/win32/file.c b/lib/isc/win32/file.c
new file mode 100644
index 0000000..c6b9e4f
--- /dev/null
+++ b/lib/isc/win32/file.c
@@ -0,0 +1,619 @@
+/*
+ * Copyright (C) 2004, 2007, 2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#include <config.h>
+
+#undef rename
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <io.h>
+#include <process.h>
+
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/utime.h>
+
+#include <isc/file.h>
+#include <isc/mem.h>
+#include <isc/result.h>
+#include <isc/time.h>
+#include <isc/util.h>
+#include <isc/stat.h>
+#include <isc/string.h>
+
+#include "errno2result.h"
+
+/*
+ * Emulate UNIX mkstemp, which returns an open FD to the new file
+ *
+ */
+static int
+gettemp(char *path, int *doopen) {
+ char *start, *trv;
+ struct stat sbuf;
+ int pid;
+
+ trv = strrchr(path, 'X');
+ trv++;
+ pid = getpid();
+ /* extra X's get set to 0's */
+ while (*--trv == 'X') {
+ *trv = (pid % 10) + '0';
+ pid /= 10;
+ }
+ /*
+ * check the target directory; if you have six X's and it
+ * doesn't exist this runs for a *very* long time.
+ */
+ for (start = trv + 1;; --trv) {
+ if (trv <= path)
+ break;
+ if (*trv == '\\') {
+ *trv = '\0';
+ if (stat(path, &sbuf))
+ return (0);
+ if (!S_ISDIR(sbuf.st_mode)) {
+ errno = ENOTDIR;
+ return (0);
+ }
+ *trv = '\\';
+ break;
+ }
+ }
+
+ for (;;) {
+ if (doopen) {
+ if ((*doopen =
+ open(path, O_CREAT|O_EXCL|O_RDWR,
+ _S_IREAD | _S_IWRITE)) >= 0)
+ return (1);
+ if (errno != EEXIST)
+ return (0);
+ } else if (stat(path, &sbuf))
+ return (errno == ENOENT ? 1 : 0);
+
+ /* tricky little algorithm for backward compatibility */
+ for (trv = start;;) {
+ if (!*trv)
+ return (0);
+ if (*trv == 'z')
+ *trv++ = 'a';
+ else {
+ if (isdigit(*trv))
+ *trv = 'a';
+ else
+ ++*trv;
+ break;
+ }
+ }
+ }
+ /*NOTREACHED*/
+}
+
+static int
+mkstemp(char *path) {
+ int fd;
+
+ return (gettemp(path, &fd) ? fd : -1);
+}
+
+/*
+ * XXXDCL As the API for accessing file statistics undoubtedly gets expanded,
+ * it might be good to provide a mechanism that allows for the results
+ * of a previous stat() to be used again without having to do another stat,
+ * such as perl's mechanism of using "_" in place of a file name to indicate
+ * that the results of the last stat should be used. But then you get into
+ * annoying MP issues. BTW, Win32 has stat().
+ */
+static isc_result_t
+file_stats(const char *file, struct stat *stats) {
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(file != NULL);
+ REQUIRE(stats != NULL);
+
+ if (stat(file, stats) != 0)
+ result = isc__errno2result(errno);
+
+ return (result);
+}
+
+/*
+ * isc_file_safemovefile is needed to be defined here to ensure that
+ * any file with the new name is renamed to a backup name and then the
+ * rename is done. If all goes well then the backup can be deleted,
+ * otherwise it gets renamed back.
+ */
+
+int
+isc_file_safemovefile(const char *oldname, const char *newname) {
+ BOOL filestatus;
+ char buf[512];
+ struct stat sbuf;
+ BOOL exists = FALSE;
+ int tmpfd;
+
+ /*
+ * Make sure we have something to do
+ */
+ if (stat(oldname, &sbuf) != 0) {
+ errno = ENOENT;
+ return (-1);
+ }
+
+ /*
+ * Rename to a backup the new file if it still exists
+ */
+ if (stat(newname, &sbuf) == 0) {
+ exists = TRUE;
+ strcpy(buf, newname);
+ strcat(buf, ".XXXXX");
+ tmpfd = mkstemp(buf);
+ if (tmpfd > 0)
+ _close(tmpfd);
+ DeleteFile(buf);
+ _chmod(newname, _S_IREAD | _S_IWRITE);
+
+ filestatus = MoveFile(newname, buf);
+ }
+ /* Now rename the file to the new name
+ */
+ _chmod(oldname, _S_IREAD | _S_IWRITE);
+
+ filestatus = MoveFile(oldname, newname);
+ if (filestatus == 0) {
+ /*
+ * Try to rename the backup back to the original name
+ * if the backup got created
+ */
+ if (exists == TRUE) {
+ filestatus = MoveFile(buf, newname);
+ if (filestatus == 0)
+ errno = EACCES;
+ }
+ return (-1);
+ }
+
+ /*
+ * Delete the backup file if it got created
+ */
+ if (exists == TRUE)
+ filestatus = DeleteFile(buf);
+ return (0);
+}
+
+isc_result_t
+isc_file_getmodtime(const char *file, isc_time_t *time) {
+ int fh;
+
+ REQUIRE(file != NULL);
+ REQUIRE(time != NULL);
+
+ if ((fh = open(file, _O_RDONLY | _O_BINARY)) < 0)
+ return (isc__errno2result(errno));
+
+ if (!GetFileTime((HANDLE) _get_osfhandle(fh),
+ NULL,
+ NULL,
+ &time->absolute))
+ {
+ close(fh);
+ errno = EINVAL;
+ return (isc__errno2result(errno));
+ }
+ close(fh);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_settime(const char *file, isc_time_t *time) {
+ int fh;
+
+ REQUIRE(file != NULL && time != NULL);
+
+ if ((fh = open(file, _O_RDWR | _O_BINARY)) < 0)
+ return (isc__errno2result(errno));
+
+ /*
+ * Set the date via the filedate system call and return. Failing
+ * this call implies the new file times are not supported by the
+ * underlying file system.
+ */
+ if (!SetFileTime((HANDLE) _get_osfhandle(fh),
+ NULL,
+ &time->absolute,
+ &time->absolute))
+ {
+ close(fh);
+ errno = EINVAL;
+ return (isc__errno2result(errno));
+ }
+
+ close(fh);
+ return (ISC_R_SUCCESS);
+
+}
+
+#undef TEMPLATE
+#define TEMPLATE "XXXXXXXXXX.tmp" /* 14 characters. */
+
+isc_result_t
+isc_file_mktemplate(const char *path, char *buf, size_t buflen) {
+ return (isc_file_template(path, TEMPLATE, buf, buflen));
+}
+
+isc_result_t
+isc_file_template(const char *path, const char *templet, char *buf,
+ size_t buflen) {
+ char *s;
+
+ REQUIRE(path != NULL);
+ REQUIRE(templet != NULL);
+ REQUIRE(buf != NULL);
+
+ s = strrchr(templet, '\\');
+ if (s != NULL)
+ templet = s + 1;
+
+ s = strrchr(path, '\\');
+
+ if (s != NULL) {
+ if ((s - path + 1 + strlen(templet) + 1) > buflen)
+ return (ISC_R_NOSPACE);
+
+ strncpy(buf, path, s - path + 1);
+ buf[s - path + 1] = '\0';
+ strcat(buf, templet);
+ } else {
+ if ((strlen(templet) + 1) > buflen)
+ return (ISC_R_NOSPACE);
+
+ strcpy(buf, templet);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_renameunique(const char *file, char *templet) {
+ int fd = -1;
+ int res = 0;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(file != NULL);
+ REQUIRE(templet != NULL);
+
+ fd = mkstemp(templet);
+ if (fd == -1)
+ result = isc__errno2result(errno);
+ else
+ close(fd);
+
+ if (result == ISC_R_SUCCESS) {
+ res = isc_file_safemovefile(file, templet);
+ if (res != 0) {
+ result = isc__errno2result(errno);
+ (void)unlink(templet);
+ }
+ }
+ return (result);
+}
+
+isc_result_t
+isc_file_openuniqueprivate(char *templet, FILE **fp) {
+ int mode = _S_IREAD | _S_IWRITE;
+ return (isc_file_openuniquemode(templet, mode, fp));
+}
+
+isc_result_t
+isc_file_openunique(char *templet, FILE **fp) {
+ int mode = _S_IREAD | _S_IWRITE;
+ return (isc_file_openuniquemode(templet, mode, fp));
+}
+
+isc_result_t
+isc_file_openuniquemode(char *templet, int mode, FILE **fp) {
+ int fd;
+ FILE *f;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ REQUIRE(templet != NULL);
+ REQUIRE(fp != NULL && *fp == NULL);
+
+ /*
+ * Win32 does not have mkstemp. Using emulation above.
+ */
+ fd = mkstemp(templet);
+
+ if (fd == -1)
+ result = isc__errno2result(errno);
+ if (result == ISC_R_SUCCESS) {
+#if 1
+ UNUSED(mode);
+#else
+ (void)fchmod(fd, mode);
+#endif
+ f = fdopen(fd, "w+");
+ if (f == NULL) {
+ result = isc__errno2result(errno);
+ (void)remove(templet);
+ (void)close(fd);
+ } else
+ *fp = f;
+ }
+
+ return (result);
+}
+
+isc_result_t
+isc_file_remove(const char *filename) {
+ int r;
+
+ REQUIRE(filename != NULL);
+
+ r = unlink(filename);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_file_rename(const char *oldname, const char *newname) {
+ int r;
+
+ REQUIRE(oldname != NULL);
+ REQUIRE(newname != NULL);
+
+ r = isc_file_safemovefile(oldname, newname);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_boolean_t
+isc_file_exists(const char *pathname) {
+ struct stat stats;
+
+ REQUIRE(pathname != NULL);
+
+ return (ISC_TF(file_stats(pathname, &stats) == ISC_R_SUCCESS));
+}
+
+isc_result_t
+isc_file_isplainfile(const char *filename) {
+ /*
+ * This function returns success if filename is a plain file.
+ */
+ struct stat filestat;
+ memset(&filestat,0,sizeof(struct stat));
+
+ if ((stat(filename, &filestat)) == -1)
+ return(isc__errno2result(errno));
+
+ if(! S_ISREG(filestat.st_mode))
+ return(ISC_R_INVALIDFILE);
+
+ return(ISC_R_SUCCESS);
+}
+
+isc_boolean_t
+isc_file_isabsolute(const char *filename) {
+ REQUIRE(filename != NULL);
+ /*
+ * Look for c:\path\... style, c:/path/... or \\computer\shar\path...
+ * the UNC style file specs
+ */
+ if ((filename[0] == '\\') && (filename[1] == '\\'))
+ return (ISC_TRUE);
+ if (isalpha(filename[0]) && filename[1] == ':' && filename[2] == '\\')
+ return (ISC_TRUE);
+ if (isalpha(filename[0]) && filename[1] == ':' && filename[2] == '/')
+ return (ISC_TRUE);
+ return (ISC_FALSE);
+}
+
+isc_boolean_t
+isc_file_iscurrentdir(const char *filename) {
+ REQUIRE(filename != NULL);
+ return (ISC_TF(filename[0] == '.' && filename[1] == '\0'));
+}
+
+isc_boolean_t
+isc_file_ischdiridempotent(const char *filename) {
+ REQUIRE(filename != NULL);
+
+ if (isc_file_isabsolute(filename))
+ return (ISC_TRUE);
+ if (filename[0] == '\\')
+ return (ISC_TRUE);
+ if (filename[0] == '/')
+ return (ISC_TRUE);
+ if (isc_file_iscurrentdir(filename))
+ return (ISC_TRUE);
+ return (ISC_FALSE);
+}
+
+const char *
+isc_file_basename(const char *filename) {
+ char *s;
+
+ REQUIRE(filename != NULL);
+
+ s = strrchr(filename, '\\');
+ if (s == NULL)
+ return (filename);
+ return (s + 1);
+}
+
+isc_result_t
+isc_file_progname(const char *filename, char *progname, size_t namelen) {
+ const char *s;
+ char *p;
+ size_t len;
+
+ REQUIRE(filename != NULL);
+ REQUIRE(progname != NULL);
+
+ /*
+ * Strip the path from the name
+ */
+ s = isc_file_basename(filename);
+ if (s == NULL) {
+ return (ISC_R_NOSPACE);
+ }
+
+ /*
+ * Strip any and all suffixes
+ */
+ p = strchr(s, '.');
+ if (p == NULL) {
+ if (namelen <= strlen(s))
+ return (ISC_R_NOSPACE);
+
+ strcpy(progname, s);
+ return (ISC_R_SUCCESS);
+ }
+
+ /*
+ * Copy the result to the buffer
+ */
+ len = p - s;
+ if (len >= namelen)
+ return (ISC_R_NOSPACE);
+
+ strncpy(progname, s, len);
+ progname[len] = '\0';
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_absolutepath(const char *filename, char *path, size_t pathlen) {
+ char *ptrname;
+ DWORD retval;
+
+ REQUIRE(filename != NULL);
+ REQUIRE(path != NULL);
+
+ retval = GetFullPathName(filename, pathlen, path, &ptrname);
+
+ /* Something went wrong in getting the path */
+ if (retval == 0)
+ return (ISC_R_NOTFOUND);
+ /* Caller needs to provide a larger buffer to contain the string */
+ if (retval >= pathlen)
+ return (ISC_R_NOSPACE);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_truncate(const char *filename, isc_offset_t size) {
+ int fh;
+
+ REQUIRE(filename != NULL && size >= 0);
+
+ if ((fh = open(filename, _O_RDWR | _O_BINARY)) < 0)
+ return (isc__errno2result(errno));
+
+ if(_chsize(fh, size) != 0) {
+ close(fh);
+ return (isc__errno2result(errno));
+ }
+ close(fh);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_safecreate(const char *filename, FILE **fp) {
+ isc_result_t result;
+ int flags;
+ struct stat sb;
+ FILE *f;
+ int fd;
+
+ REQUIRE(filename != NULL);
+ REQUIRE(fp != NULL && *fp == NULL);
+
+ result = file_stats(filename, &sb);
+ if (result == ISC_R_SUCCESS) {
+ if ((sb.st_mode & S_IFREG) == 0)
+ return (ISC_R_INVALIDFILE);
+ flags = O_WRONLY | O_TRUNC;
+ } else if (result == ISC_R_FILENOTFOUND) {
+ flags = O_WRONLY | O_CREAT | O_EXCL;
+ } else
+ return (result);
+
+ fd = open(filename, flags, S_IRUSR | S_IWUSR);
+ if (fd == -1)
+ return (isc__errno2result(errno));
+
+ f = fdopen(fd, "w");
+ if (f == NULL) {
+ result = isc__errno2result(errno);
+ close(fd);
+ return (result);
+ }
+
+ *fp = f;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename)
+{
+ char *dir, *file, *slash;
+ char *backslash;
+
+ slash = strrchr(path, '/');
+
+ backslash = strrchr(path, '\\');
+ if ((slash != NULL && backslash != NULL && backslash > slash) ||
+ (slash == NULL && backslash != NULL))
+ slash = backslash;
+
+ if (slash == path) {
+ file = ++slash;
+ dir = isc_mem_strdup(mctx, "/");
+ } else if (slash != NULL) {
+ file = ++slash;
+ dir = isc_mem_allocate(mctx, slash - path);
+ if (dir != NULL)
+ strlcpy(dir, path, slash - path);
+ } else {
+ file = path;
+ dir = isc_mem_strdup(mctx, ".");
+ }
+
+ if (dir == NULL)
+ return (ISC_R_NOMEMORY);
+
+ if (*file == '\0') {
+ isc_mem_free(mctx, dir);
+ return (ISC_R_INVALIDFILE);
+ }
+
+ *dirname = dir;
+ *basename = file;
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/win32/fsaccess.c b/lib/isc/win32/fsaccess.c
new file mode 100644
index 0000000..8de793f
--- /dev/null
+++ b/lib/isc/win32/fsaccess.c
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: fsaccess.c,v 1.15 2007/06/19 23:47:19 tbox Exp $ */
+
+/*
+ * Note that Win32 does not have the concept of files having access
+ * and ownership bits. The FAT File system only has a readonly flag
+ * for everyone and that's all. NTFS uses ACL's which is a totally
+ * different concept of controlling access.
+ *
+ * This code needs to be revisited to set up proper access control for
+ * NTFS file systems. Nothing can be done for FAT file systems.
+ */
+
+#include <config.h>
+
+#include <aclapi.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <io.h>
+#include <errno.h>
+
+#include <isc/file.h>
+#include <isc/stat.h>
+
+#include "errno2result.h"
+
+/*
+ * The OS-independent part of the API is in lib/isc.
+ */
+#include "../fsaccess.c"
+
+/* Store the user account name locally */
+static char username[255] = "\0";
+static DWORD namelen = 0;
+
+/*
+ * In order to set or retrieve access information, we need to obtain
+ * the File System type. These could be UNC-type shares.
+ */
+
+BOOL
+is_ntfs(const char * file) {
+
+ char drive[255];
+ char FSType[20];
+ char tmpbuf[256];
+ char *machinename;
+ char *sharename;
+ char filename[1024];
+
+ REQUIRE(filename != NULL);
+
+ if (isc_file_absolutepath(file, filename,
+ sizeof(filename)) != ISC_R_SUCCESS) {
+ return (FALSE);
+ }
+
+ /*
+ * Look for c:\path\... style, c:/path/... or \\computer\shar\path...
+ * the UNC style file specs
+ */
+ if (isalpha(filename[0]) && filename[1] == ':' &&
+ (filename[2] == '\\' || filename[2] == '/')) {
+ strncpy(drive, filename, 3);
+ drive[3] = '\0';
+ }
+
+ else if ((filename[0] == '\\') && (filename[1] == '\\')) {
+ /* Find the machine and share name and rebuild the UNC */
+ strcpy(tmpbuf, filename);
+ machinename = strtok(tmpbuf, "\\");
+ sharename = strtok(NULL, "\\");
+ strcpy(drive, "\\\\");
+ strcat(drive, machinename);
+ strcat(drive, "\\");
+ strcat(drive, sharename);
+ strcat(drive, "\\");
+
+ }
+ else /* Not determinable */
+ return (FALSE);
+
+ GetVolumeInformation(drive, NULL, 0, NULL, 0, NULL, FSType,
+ sizeof(FSType));
+ if(strcmp(FSType,"NTFS") == 0)
+ return (TRUE);
+ else
+ return (FALSE);
+}
+
+/*
+ * If it's not NTFS, we assume that it is FAT and proceed
+ * with almost nothing to do. Only the write flag can be set or
+ * cleared.
+ */
+isc_result_t
+FAT_fsaccess_set(const char *path, isc_fsaccess_t access) {
+ int mode;
+ isc_fsaccess_t bits;
+
+ /*
+ * Done with checking bad bits. Set mode_t.
+ */
+ mode = 0;
+
+#define SET_AND_CLEAR1(modebit) \
+ if ((access & bits) != 0) { \
+ mode |= modebit; \
+ access &= ~bits; \
+ }
+#define SET_AND_CLEAR(user, group, other) \
+ SET_AND_CLEAR1(user); \
+ bits <<= STEP; \
+ SET_AND_CLEAR1(group); \
+ bits <<= STEP; \
+ SET_AND_CLEAR1(other);
+
+ bits = ISC_FSACCESS_READ | ISC_FSACCESS_LISTDIRECTORY;
+
+ SET_AND_CLEAR(S_IRUSR, S_IRGRP, S_IROTH);
+
+ bits = ISC_FSACCESS_WRITE |
+ ISC_FSACCESS_CREATECHILD |
+ ISC_FSACCESS_DELETECHILD;
+
+ SET_AND_CLEAR(S_IWUSR, S_IWGRP, S_IWOTH);
+
+ INSIST(access == 0);
+
+ if (_chmod(path, mode) < 0)
+ return (isc__errno2result(errno));
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+NTFS_Access_Control(const char *filename, const char *user, int access,
+ isc_boolean_t isdir) {
+ SECURITY_DESCRIPTOR sd;
+ BYTE aclBuffer[1024];
+ PACL pacl=(PACL)&aclBuffer;
+ BYTE sidBuffer[100];
+ PSID psid=(PSID) &sidBuffer;
+ DWORD sidBufferSize = sizeof(sidBuffer);
+ BYTE adminSidBuffer[100];
+ PSID padminsid=(PSID) &adminSidBuffer;
+ DWORD adminSidBufferSize = sizeof(adminSidBuffer);
+ BYTE otherSidBuffer[100];
+ PSID pothersid=(PSID) &otherSidBuffer;
+ DWORD otherSidBufferSize = sizeof(otherSidBuffer);
+ char domainBuffer[100];
+ DWORD domainBufferSize = sizeof(domainBuffer);
+ SID_NAME_USE snu;
+ int errval;
+ DWORD NTFSbits;
+ int caccess;
+
+
+ /* Initialize an ACL */
+ if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION))
+ return (ISC_R_NOPERM);
+ if (!InitializeAcl(pacl, sizeof(aclBuffer), ACL_REVISION))
+ return (ISC_R_NOPERM);
+ if (!LookupAccountName(0, user, psid, &sidBufferSize, domainBuffer,
+ &domainBufferSize, &snu))
+ return (ISC_R_NOPERM);
+ domainBufferSize = sizeof(domainBuffer);
+ if (!LookupAccountName(0, "Administrators", padminsid,
+ &adminSidBufferSize, domainBuffer, &domainBufferSize, &snu)) {
+ errval = GetLastError();
+ return (ISC_R_NOPERM);
+ }
+ domainBufferSize = sizeof(domainBuffer);
+ if (!LookupAccountName(0, "Everyone", pothersid,
+ &otherSidBufferSize, domainBuffer, &domainBufferSize, &snu)) {
+ errval = GetLastError();
+ return (ISC_R_NOPERM);
+ }
+
+ caccess = access;
+ /* Owner check */
+
+ NTFSbits = 0;
+ if (caccess & ISC_FSACCESS_READ)
+ NTFSbits |= FILE_GENERIC_READ;
+ if (caccess & ISC_FSACCESS_WRITE)
+ NTFSbits |= FILE_GENERIC_WRITE;
+ if (caccess & ISC_FSACCESS_EXECUTE)
+ NTFSbits |= FILE_GENERIC_EXECUTE;
+
+ /* For directories check the directory-specific bits */
+ if (isdir == ISC_TRUE) {
+ if (caccess & ISC_FSACCESS_CREATECHILD)
+ NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE;
+ if (caccess & ISC_FSACCESS_DELETECHILD)
+ NTFSbits |= FILE_DELETE_CHILD;
+ if (caccess & ISC_FSACCESS_LISTDIRECTORY)
+ NTFSbits |= FILE_LIST_DIRECTORY;
+ if (caccess & ISC_FSACCESS_ACCESSCHILD)
+ NTFSbits |= FILE_TRAVERSE;
+ }
+
+ if (NTFSbits == (FILE_GENERIC_READ | FILE_GENERIC_WRITE
+ | FILE_GENERIC_EXECUTE))
+ NTFSbits |= FILE_ALL_ACCESS;
+ /*
+ * Owner and Administrator also get STANDARD_RIGHTS_ALL
+ * to ensure that they have full control
+ */
+
+ NTFSbits |= STANDARD_RIGHTS_ALL;
+
+ /* Add the ACE to the ACL */
+ if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, psid))
+ return (ISC_R_NOPERM);
+ if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits, padminsid))
+ return (ISC_R_NOPERM);
+
+ /*
+ * Group is ignored since we can be in multiple groups or no group
+ * and its meaning is not clear on Win32
+ */
+
+ caccess = caccess >> STEP;
+
+ /*
+ * Other check. We translate this to be the same as Everyone
+ */
+
+ caccess = caccess >> STEP;
+
+ NTFSbits = 0;
+ if (caccess & ISC_FSACCESS_READ)
+ NTFSbits |= FILE_GENERIC_READ;
+ if (caccess & ISC_FSACCESS_WRITE)
+ NTFSbits |= FILE_GENERIC_WRITE;
+ if (caccess & ISC_FSACCESS_EXECUTE)
+ NTFSbits |= FILE_GENERIC_EXECUTE;
+
+ /* For directories check the directory-specific bits */
+ if (isdir == TRUE) {
+ if (caccess & ISC_FSACCESS_CREATECHILD)
+ NTFSbits |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE;
+ if (caccess & ISC_FSACCESS_DELETECHILD)
+ NTFSbits |= FILE_DELETE_CHILD;
+ if (caccess & ISC_FSACCESS_LISTDIRECTORY)
+ NTFSbits |= FILE_LIST_DIRECTORY;
+ if (caccess & ISC_FSACCESS_ACCESSCHILD)
+ NTFSbits |= FILE_TRAVERSE;
+ }
+ /* Add the ACE to the ACL */
+ if (!AddAccessAllowedAce(pacl, ACL_REVISION, NTFSbits,
+ pothersid))
+ return (ISC_R_NOPERM);
+
+ if (!SetSecurityDescriptorDacl(&sd, TRUE, pacl, FALSE))
+ return (ISC_R_NOPERM);
+ if (!SetFileSecurity(filename, DACL_SECURITY_INFORMATION, &sd)) {
+ return (ISC_R_NOPERM);
+ }
+
+ return(ISC_R_SUCCESS);
+}
+
+isc_result_t
+NTFS_fsaccess_set(const char *path, isc_fsaccess_t access,
+ isc_boolean_t isdir){
+
+ /*
+ * For NTFS we first need to get the name of the account under
+ * which BIND is running
+ */
+ if (namelen <= 0) {
+ namelen = sizeof(username);
+ if (GetUserName(username, &namelen) == 0)
+ return (ISC_R_FAILURE);
+ }
+ return (NTFS_Access_Control(path, username, access, isdir));
+}
+
+isc_result_t
+isc_fsaccess_set(const char *path, isc_fsaccess_t access) {
+ struct stat statb;
+ isc_boolean_t is_dir = ISC_FALSE;
+ isc_result_t result;
+
+ if (stat(path, &statb) != 0)
+ return (isc__errno2result(errno));
+
+ if ((statb.st_mode & S_IFDIR) != 0)
+ is_dir = ISC_TRUE;
+ else if ((statb.st_mode & S_IFREG) == 0)
+ return (ISC_R_INVALIDFILE);
+
+ result = check_bad_bits(access, is_dir);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ /*
+ * Determine if this is a FAT or NTFS disk and
+ * call the appropriate function to set the permissions
+ */
+ if (is_ntfs(path))
+ return (NTFS_fsaccess_set(path, access, is_dir));
+ else
+ return (FAT_fsaccess_set(path, access));
+}
+
+isc_result_t
+isc_fsaccess_changeowner(const char *filename, const char *user) {
+ SECURITY_DESCRIPTOR psd;
+ BYTE sidBuffer[500];
+ BYTE groupBuffer[500];
+ PSID psid=(PSID) &sidBuffer;
+ DWORD sidBufferSize = sizeof(sidBuffer);
+ char domainBuffer[100];
+ DWORD domainBufferSize = sizeof(domainBuffer);
+ SID_NAME_USE snu;
+ PSID pSidGroup = (PSID) &groupBuffer;
+ DWORD groupBufferSize = sizeof(groupBuffer);
+
+
+ /*
+ * Determine if this is a FAT or NTFS disk and
+ * call the appropriate function to set the ownership
+ * FAT disks do not have ownership attributes so it's
+ * a noop.
+ */
+ if (is_ntfs(filename) == FALSE)
+ return (ISC_R_SUCCESS);
+
+ if (!InitializeSecurityDescriptor(&psd, SECURITY_DESCRIPTOR_REVISION))
+ return (ISC_R_NOPERM);
+
+ if (!LookupAccountName(0, user, psid, &sidBufferSize, domainBuffer,
+ &domainBufferSize, &snu))
+ return (ISC_R_NOPERM);
+
+ /* Make sure administrators can get to it */
+ domainBufferSize = sizeof(domainBuffer);
+ if (!LookupAccountName(0, "Administrators", pSidGroup,
+ &groupBufferSize, domainBuffer, &domainBufferSize, &snu))
+ return (ISC_R_NOPERM);
+
+ if (!SetSecurityDescriptorOwner(&psd, psid, FALSE))
+ return (ISC_R_NOPERM);
+
+ if (!SetSecurityDescriptorGroup(&psd, pSidGroup, FALSE))
+ return (ISC_R_NOPERM);
+
+ if (!SetFileSecurity(filename,
+ OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION,
+ &psd))
+ return (ISC_R_NOPERM);
+
+ return (ISC_R_SUCCESS);
+}
+
diff --git a/lib/isc/win32/include/isc/bind_registry.h b/lib/isc/win32/include/isc/bind_registry.h
new file mode 100644
index 0000000..c4dc876
--- /dev/null
+++ b/lib/isc/win32/include/isc/bind_registry.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bind_registry.h,v 1.8 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_BINDREGISTRY_H
+#define ISC_BINDREGISTRY_H
+
+/*
+ * BIND makes use of the following Registry keys in various places, especially
+ * during startup and installation
+ */
+
+#define BIND_SUBKEY "Software\\ISC\\BIND"
+#define BIND_SESSION "CurrentSession"
+#define BIND_SESSION_SUBKEY "Software\\ISC\\BIND\\CurrentSession"
+#define BIND_UNINSTALL_SUBKEY \
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\ISC BIND"
+
+#define EVENTLOG_APP_SUBKEY \
+ "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application"
+#define BIND_MESSAGE_SUBKEY \
+ "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\named"
+#define BIND_MESSAGE_NAME "named"
+
+#define BIND_SERVICE_SUBKEY \
+ "SYSTEM\\CurrentControlSet\\Services\\named"
+
+
+#define BIND_CONFIGFILE 0
+#define BIND_DEBUGLEVEL 1
+#define BIND_QUERYLOG 2
+#define BIND_FOREGROUND 3
+#define BIND_PORT 4
+
+#endif /* ISC_BINDREGISTRY_H */
diff --git a/lib/isc/win32/include/isc/bindevt.h b/lib/isc/win32/include/isc/bindevt.h
new file mode 100644
index 0000000..72cf2d1
--- /dev/null
+++ b/lib/isc/win32/include/isc/bindevt.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bindevt.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_BINDEVT_H
+#define ISC_BINDEVT_H 1
+
+/*
+ * This is used for the event log for both logging the messages and
+ * later on by the event viewer when looking at the events
+ */
+
+/*
+ * Values are 32 bit values layed out as follows:
+ *
+ * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+ * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+ * +---+-+-+-----------------------+-------------------------------+
+ * |Sev|C|R| Facility | Code |
+ * +---+-+-+-----------------------+-------------------------------+
+ *
+ * where
+ *
+ * Sev - is the severity code
+ *
+ * 00 - Success
+ * 01 - Informational
+ * 10 - Warning
+ * 11 - Error
+ *
+ * C - is the Customer code flag
+ *
+ * R - is a reserved bit
+ *
+ * Facility - is the facility code
+ *
+ * Code - is the facility's status code
+ *
+ *
+ * Define the facility codes
+ */
+
+
+/*
+ * Define the severity codes
+ */
+
+
+/*
+ * MessageId: BIND_ERR_MSG
+ *
+ * MessageText:
+ *
+ * %1
+ */
+#define BIND_ERR_MSG ((DWORD)0xC0000001L)
+
+/*
+ * MessageId: BIND_WARN_MSG
+ *
+ * MessageText:
+ *
+ * %1
+ */
+#define BIND_WARN_MSG ((DWORD)0x80000002L)
+
+/*
+ * MessageId: BIND_INFO_MSG
+ *
+ * MessageText:
+ *
+ * %1
+ */
+#define BIND_INFO_MSG ((DWORD)0x40000003L)
+
+#endif /* ISC_BINDEVT_H */
diff --git a/lib/isc/win32/include/isc/condition.h b/lib/isc/win32/include/isc/condition.h
new file mode 100644
index 0000000..34015bc
--- /dev/null
+++ b/lib/isc/win32/include/isc/condition.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: condition.h,v 1.17 2007/06/18 23:47:49 tbox Exp $ */
+
+#ifndef ISC_CONDITION_H
+#define ISC_CONDITION_H 1
+
+#include <windows.h>
+
+#include <isc/lang.h>
+#include <isc/mutex.h>
+#include <isc/thread.h>
+#include <isc/types.h>
+
+typedef struct isc_condition_thread isc_condition_thread_t;
+
+struct isc_condition_thread {
+ unsigned long th;
+ HANDLE handle[2];
+ ISC_LINK(isc_condition_thread_t) link;
+
+};
+
+typedef struct isc_condition {
+ HANDLE events[2];
+ unsigned int waiters;
+ ISC_LIST(isc_condition_thread_t) threadlist;
+} isc_condition_t;
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_condition_init(isc_condition_t *);
+
+isc_result_t
+isc_condition_wait(isc_condition_t *, isc_mutex_t *);
+
+isc_result_t
+isc_condition_signal(isc_condition_t *);
+
+isc_result_t
+isc_condition_broadcast(isc_condition_t *);
+
+isc_result_t
+isc_condition_destroy(isc_condition_t *);
+
+isc_result_t
+isc_condition_waituntil(isc_condition_t *, isc_mutex_t *, isc_time_t *);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_CONDITION_H */
diff --git a/lib/isc/win32/include/isc/dir.h b/lib/isc/win32/include/isc/dir.h
new file mode 100644
index 0000000..653427a
--- /dev/null
+++ b/lib/isc/win32/include/isc/dir.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: dir.h,v 1.15 2007/06/19 23:47:20 tbox Exp $ */
+
+/* Principal Authors: DCL */
+
+#ifndef ISC_DIR_H
+#define ISC_DIR_H 1
+
+#include <windows.h>
+#include <stdlib.h>
+
+#include <isc/lang.h>
+#include <isc/boolean.h>
+#include <isc/result.h>
+
+#define ISC_DIR_NAMEMAX _MAX_FNAME
+#define ISC_DIR_PATHMAX _MAX_PATH
+
+typedef struct {
+ char name[ISC_DIR_NAMEMAX];
+ unsigned int length;
+ WIN32_FIND_DATA find_data;
+} isc_direntry_t;
+
+typedef struct {
+ unsigned int magic;
+ char dirname[ISC_DIR_PATHMAX];
+ isc_direntry_t entry;
+ isc_boolean_t entry_filled;
+ HANDLE search_handle;
+} isc_dir_t;
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_dir_init(isc_dir_t *dir);
+
+isc_result_t
+isc_dir_open(isc_dir_t *dir, const char *dirname);
+
+isc_result_t
+isc_dir_read(isc_dir_t *dir);
+
+isc_result_t
+isc_dir_reset(isc_dir_t *dir);
+
+void
+isc_dir_close(isc_dir_t *dir);
+
+isc_result_t
+isc_dir_chdir(const char *dirname);
+
+isc_result_t
+isc_dir_chroot(const char *dirname);
+
+isc_result_t
+isc_dir_createunique(char *templet);
+/*
+ * Use a templet (such as from isc_file_mktemplate()) to create a uniquely
+ * named, empty directory. The templet string is modified in place.
+ * If result == ISC_R_SUCCESS, it is the name of the directory that was
+ * created.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_DIR_H */
diff --git a/lib/isc/win32/include/isc/int.h b/lib/isc/win32/include/isc/int.h
new file mode 100644
index 0000000..2ee8bf9
--- /dev/null
+++ b/lib/isc/win32/include/isc/int.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: int.h,v 1.13 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_INT_H
+#define ISC_INT_H 1
+
+#define _INTEGRAL_MAX_BITS 64
+#include <limits.h>
+
+typedef __int8 isc_int8_t;
+typedef unsigned __int8 isc_uint8_t;
+typedef __int16 isc_int16_t;
+typedef unsigned __int16 isc_uint16_t;
+typedef __int32 isc_int32_t;
+typedef unsigned __int32 isc_uint32_t;
+typedef __int64 isc_int64_t;
+typedef unsigned __int64 isc_uint64_t;
+
+#define ISC_INT8_MIN -128
+#define ISC_INT8_MAX 127
+#define ISC_UINT8_MAX 255
+
+#define ISC_INT16_MIN -32768
+#define ISC_INT16_MAX 32767
+#define ISC_UINT16_MAX 65535
+
+/*
+ * Note that "int" is 32 bits on all currently supported Unix-like operating
+ * systems, but "long" can be either 32 bits or 64 bits, thus the 32 bit
+ * constants are not qualified with "L".
+ */
+#define ISC_INT32_MIN _I32_MIN
+#define ISC_INT32_MAX _I32_MAX
+#define ISC_UINT32_MAX _UI32_MAX
+
+#define ISC_INT64_MIN _I64_MIN
+#define ISC_INT64_MAX _I64_MAX
+#define ISC_UINT64_MAX _UI64_MAX
+
+#endif /* ISC_INT_H */
diff --git a/lib/isc/win32/include/isc/ipv6.h b/lib/isc/win32/include/isc/ipv6.h
new file mode 100644
index 0000000..27384a3
--- /dev/null
+++ b/lib/isc/win32/include/isc/ipv6.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_IPV6_H
+#define ISC_IPV6_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*
+ * IPv6 definitions for systems which do not support IPv6.
+ *
+ * MP:
+ * No impact.
+ *
+ * Reliability:
+ * No anticipated impact.
+ *
+ * Resources:
+ * N/A.
+ *
+ * Security:
+ * No anticipated impact.
+ *
+ * Standards:
+ * RFC2553.
+ */
+
+#if _MSC_VER < 1300
+#define in6_addr in_addr6
+#endif
+
+#ifndef IN6ADDR_ANY_INIT
+#define IN6ADDR_ANY_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}
+#endif
+#ifndef IN6ADDR_LOOPBACK_INIT
+#define IN6ADDR_LOOPBACK_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}
+#endif
+
+LIBISC_EXTERNAL_DATA extern const struct in6_addr isc_net_in6addrany;
+LIBISC_EXTERNAL_DATA extern const struct in6_addr isc_net_in6addrloop;
+
+/*
+ * Unspecified
+ */
+#ifndef IN6_IS_ADDR_UNSPECIFIED
+#define IN6_IS_ADDR_UNSPECIFIED(a) (\
+*((u_long *)((a)->s6_addr) ) == 0 && \
+*((u_long *)((a)->s6_addr) + 1) == 0 && \
+*((u_long *)((a)->s6_addr) + 2) == 0 && \
+*((u_long *)((a)->s6_addr) + 3) == 0 \
+)
+#endif
+
+/*
+ * Loopback
+ */
+#ifndef IN6_IS_ADDR_LOOPBACK
+#define IN6_IS_ADDR_LOOPBACK(a) (\
+*((u_long *)((a)->s6_addr) ) == 0 && \
+*((u_long *)((a)->s6_addr) + 1) == 0 && \
+*((u_long *)((a)->s6_addr) + 2) == 0 && \
+*((u_long *)((a)->s6_addr) + 3) == htonl(1) \
+)
+#endif
+
+/*
+ * IPv4 compatible
+ */
+#define IN6_IS_ADDR_V4COMPAT(a) (\
+*((u_long *)((a)->s6_addr) ) == 0 && \
+*((u_long *)((a)->s6_addr) + 1) == 0 && \
+*((u_long *)((a)->s6_addr) + 2) == 0 && \
+*((u_long *)((a)->s6_addr) + 3) != 0 && \
+*((u_long *)((a)->s6_addr) + 3) != htonl(1) \
+)
+
+/*
+ * Mapped
+ */
+#define IN6_IS_ADDR_V4MAPPED(a) (\
+*((u_long *)((a)->s6_addr) ) == 0 && \
+*((u_long *)((a)->s6_addr) + 1) == 0 && \
+*((u_long *)((a)->s6_addr) + 2) == htonl(0x0000ffff))
+
+/*
+ * Multicast
+ */
+#define IN6_IS_ADDR_MULTICAST(a) \
+ ((a)->s6_addr[0] == 0xffU)
+
+/*
+ * Unicast link / site local.
+ */
+#ifndef IN6_IS_ADDR_LINKLOCAL
+#define IN6_IS_ADDR_LINKLOCAL(a) (\
+ ((a)->s6_addr[0] == 0xfe) && \
+ (((a)->s6_addr[1] & 0xc0) == 0x80))
+#endif
+
+#ifndef IN6_IS_ADDR_SITELOCAL
+#define IN6_IS_ADDR_SITELOCAL(a) (\
+ ((a)->s6_addr[0] == 0xfe) && \
+ (((a)->s6_addr[1] & 0xc0) == 0xc0))
+#endif
+
+#endif /* ISC_IPV6_H */
diff --git a/lib/isc/win32/include/isc/keyboard.h b/lib/isc/win32/include/isc/keyboard.h
new file mode 100644
index 0000000..e781c5f
--- /dev/null
+++ b/lib/isc/win32/include/isc/keyboard.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: keyboard.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_KEYBOARD_H
+#define ISC_KEYBOARD_H 1
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+ISC_LANG_BEGINDECLS
+
+typedef struct {
+ int fd;
+ isc_result_t result;
+} isc_keyboard_t;
+
+isc_result_t
+isc_keyboard_open(isc_keyboard_t *keyboard);
+
+isc_result_t
+isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleepseconds);
+
+isc_result_t
+isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp);
+
+isc_boolean_t
+isc_keyboard_canceled(isc_keyboard_t *keyboard);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_KEYBOARD_H */
diff --git a/lib/isc/win32/include/isc/mutex.h b/lib/isc/win32/include/isc/mutex.h
new file mode 100644
index 0000000..5cf1bae
--- /dev/null
+++ b/lib/isc/win32/include/isc/mutex.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: mutex.h,v 1.22 2009/01/18 23:48:14 tbox Exp $ */
+
+#ifndef ISC_MUTEX_H
+#define ISC_MUTEX_H 1
+
+#include <isc/net.h>
+#include <windows.h>
+
+#include <isc/result.h>
+
+typedef CRITICAL_SECTION isc_mutex_t;
+
+/*
+ * This definition is here since some versions of WINBASE.H
+ * omits it for some reason.
+ */
+#if (_WIN32_WINNT < 0x0400)
+WINBASEAPI BOOL WINAPI
+TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
+#endif /* _WIN32_WINNT < 0x0400 */
+
+#define isc_mutex_init(mp) \
+ (InitializeCriticalSection((mp)), ISC_R_SUCCESS)
+#define isc_mutex_lock(mp) \
+ (EnterCriticalSection((mp)), ISC_R_SUCCESS)
+#define isc_mutex_unlock(mp) \
+ (LeaveCriticalSection((mp)), ISC_R_SUCCESS)
+#define isc_mutex_trylock(mp) \
+ (TryEnterCriticalSection((mp)) ? ISC_R_SUCCESS : ISC_R_LOCKBUSY)
+#define isc_mutex_destroy(mp) \
+ (DeleteCriticalSection((mp)), ISC_R_SUCCESS)
+
+/*
+ * This is a placeholder for now since we are not keeping any mutex stats
+ */
+#define isc_mutex_stats(fp) do {} while (0)
+
+#endif /* ISC_MUTEX_H */
diff --git a/lib/isc/win32/include/isc/net.h b/lib/isc/win32/include/isc/net.h
new file mode 100644
index 0000000..10be85b
--- /dev/null
+++ b/lib/isc/win32/include/isc/net.h
@@ -0,0 +1,374 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_NET_H
+#define ISC_NET_H 1
+
+#include <errno.h>
+
+/*
+ * Also define LWRES_IPV6_H to keep it from being included if liblwres is
+ * being used, or redefinition errors will occur.
+ */
+#define LWRES_IPV6_H 1
+
+
+
+/*****
+ ***** Module Info
+ *****/
+
+/*
+ * Basic Networking Types
+ *
+ * This module is responsible for defining the following basic networking
+ * types:
+ *
+ * struct in_addr
+ * struct in6_addr
+ * struct in6_pktinfo
+ * struct sockaddr
+ * struct sockaddr_in
+ * struct sockaddr_in6
+ * in_port_t
+ *
+ * It ensures that the AF_ and PF_ macros are defined.
+ *
+ * It declares ntoh[sl]() and hton[sl]().
+ *
+ * It declares inet_aton(), inet_ntop(), and inet_pton().
+ *
+ * It ensures that INADDR_ANY, IN6ADDR_ANY_INIT, in6addr_any, and
+ * in6addr_loopback are available.
+ *
+ * It ensures that IN_MULTICAST() is available to check for multicast
+ * addresses.
+ *
+ * MP:
+ * No impact.
+ *
+ * Reliability:
+ * No anticipated impact.
+ *
+ * Resources:
+ * N/A.
+ *
+ * Security:
+ * No anticipated impact.
+ *
+ * Standards:
+ * BSD Socket API
+ * RFC2553
+ */
+
+/***
+ *** Imports.
+ ***/
+#include <isc/platform.h>
+
+/*
+ * Because of some sort of problem in the MS header files, this cannot
+ * be simple "#include <winsock2.h>", because winsock2.h tries to include
+ * windows.h, which then generates an error out of mswsock.h. _You_
+ * figure it out.
+ */
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
+#endif
+
+#include <winsock2.h>
+
+#include <sys/types.h>
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+#include <ws2tcpip.h>
+#include <isc/ipv6.h>
+
+/*
+ * This is here because named client, interfacemgr.c, etc. use the name as
+ * a variable
+ */
+#undef interface
+
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001UL
+#endif
+
+#ifndef ISC_PLATFORM_HAVEIN6PKTINFO
+struct in6_pktinfo {
+ struct in6_addr ipi6_addr; /* src/dst IPv6 address */
+ unsigned int ipi6_ifindex; /* send/recv interface index */
+};
+#endif
+
+#if _MSC_VER < 1300
+#define in6addr_any isc_net_in6addrany
+#define in6addr_loopback isc_net_in6addrloop
+#endif
+
+/*
+ * Ensure type in_port_t is defined.
+ */
+#ifdef ISC_PLATFORM_NEEDPORTT
+typedef isc_uint16_t in_port_t;
+#endif
+
+/*
+ * If this system does not have MSG_TRUNC (as returned from recvmsg())
+ * ISC_PLATFORM_RECVOVERFLOW will be defined. This will enable the MSG_TRUNC
+ * faking code in socket.c.
+ */
+#ifndef MSG_TRUNC
+#define ISC_PLATFORM_RECVOVERFLOW
+#endif
+
+#define ISC__IPADDR(x) ((isc_uint32_t)htonl((isc_uint32_t)(x)))
+
+#define ISC_IPADDR_ISMULTICAST(i) \
+ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
+ == ISC__IPADDR(0xe0000000))
+
+#define ISC_IPADDR_ISEXPERIMENTAL(i) \
+ (((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
+ == ISC__IPADDR(0xf0000000))
+
+/*
+ * Fix the FD_SET and FD_CLR Macros to properly cast
+ */
+#undef FD_CLR
+#define FD_CLR(fd, set) do { \
+ u_int __i; \
+ for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \
+ if (((fd_set FAR *)(set))->fd_array[__i] == (SOCKET) fd) { \
+ while (__i < ((fd_set FAR *)(set))->fd_count-1) { \
+ ((fd_set FAR *)(set))->fd_array[__i] = \
+ ((fd_set FAR *)(set))->fd_array[__i+1]; \
+ __i++; \
+ } \
+ ((fd_set FAR *)(set))->fd_count--; \
+ break; \
+ } \
+ } \
+} while (0)
+
+#undef FD_SET
+#define FD_SET(fd, set) do { \
+ u_int __i; \
+ for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \
+ if (((fd_set FAR *)(set))->fd_array[__i] == (SOCKET)(fd)) { \
+ break; \
+ } \
+ } \
+ if (__i == ((fd_set FAR *)(set))->fd_count) { \
+ if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \
+ ((fd_set FAR *)(set))->fd_array[__i] = (SOCKET)(fd); \
+ ((fd_set FAR *)(set))->fd_count++; \
+ } \
+ } \
+} while (0)
+
+/*
+ * Windows Sockets errors redefined as regular Berkeley error constants.
+ * These are usually commented out in Windows NT to avoid conflicts with errno.h.
+ * Use the WSA constants instead.
+ * Starting with VC9 (VC++ 2010) many of these are defined incompatibly
+ * by errno.h -- #undef the conflicting values, which are not relevant to
+ * Win32.
+ */
+
+#undef EWOULDBLOCK
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#undef EINPROGRESS
+#define EINPROGRESS WSAEINPROGRESS
+#undef EALREADY
+#define EALREADY WSAEALREADY
+#undef ENOTSOCK
+#define ENOTSOCK WSAENOTSOCK
+#undef EDESTADDRREQ
+#define EDESTADDRREQ WSAEDESTADDRREQ
+#undef EMSGSIZE
+#define EMSGSIZE WSAEMSGSIZE
+#undef EPROTOTYPE
+#define EPROTOTYPE WSAEPROTOTYPE
+#undef ENOPROTOOPT
+#define ENOPROTOOPT WSAENOPROTOOPT
+#undef EPROTONOSUPPORT
+#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
+#undef EOPNOTSUPP
+#define EOPNOTSUPP WSAEOPNOTSUPP
+#define EPFNOSUPPORT WSAEPFNOSUPPORT
+#undef EAFNOSUPPORT
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#undef EADDRINUSE
+#define EADDRINUSE WSAEADDRINUSE
+#undef EADDRNOTAVAIL
+#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
+#undef ENETDOWN
+#define ENETDOWN WSAENETDOWN
+#undef ENETUNREACH
+#define ENETUNREACH WSAENETUNREACH
+#undef ENETRESET
+#define ENETRESET WSAENETRESET
+#undef ECONNABORTED
+#define ECONNABORTED WSAECONNABORTED
+#undef ECONNRESET
+#define ECONNRESET WSAECONNRESET
+#undef ENOBUFS
+#define ENOBUFS WSAENOBUFS
+#undef EISCONN
+#define EISCONN WSAEISCONN
+#undef ENOTCONN
+#define ENOTCONN WSAENOTCONN
+#define ESHUTDOWN WSAESHUTDOWN
+#define ETOOMANYREFS WSAETOOMANYREFS
+#undef ETIMEDOUT
+#define ETIMEDOUT WSAETIMEDOUT
+#undef ECONNREFUSED
+#define ECONNREFUSED WSAECONNREFUSED
+#undef ELOOP
+#define ELOOP WSAELOOP
+#define EHOSTDOWN WSAEHOSTDOWN
+#undef EHOSTUNREACH
+#define EHOSTUNREACH WSAEHOSTUNREACH
+#define EPROCLIM WSAEPROCLIM
+#define EUSERS WSAEUSERS
+#define EDQUOT WSAEDQUOT
+#define ESTALE WSAESTALE
+#define EREMOTE WSAEREMOTE
+
+
+/***
+ *** Functions.
+ ***/
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_net_probeipv4(void);
+/*
+ * Check if the system's kernel supports IPv4.
+ *
+ * Returns:
+ *
+ * ISC_R_SUCCESS IPv4 is supported.
+ * ISC_R_NOTFOUND IPv4 is not supported.
+ * ISC_R_DISABLED IPv4 is disabled.
+ * ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_net_probeipv6(void);
+/*
+ * Check if the system's kernel supports IPv6.
+ *
+ * Returns:
+ *
+ * ISC_R_SUCCESS IPv6 is supported.
+ * ISC_R_NOTFOUND IPv6 is not supported.
+ * ISC_R_DISABLED IPv6 is disabled.
+ * ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_net_probeunix(void);
+/*
+ * Check if UNIX domain sockets are supported.
+ *
+ * Returns:
+ *
+ * ISC_R_SUCCESS
+ * ISC_R_NOTFOUND
+ */
+
+isc_result_t
+isc_net_probe_ipv6only(void);
+/*
+ * Check if the system's kernel supports the IPV6_V6ONLY socket option.
+ *
+ * Returns:
+ *
+ * ISC_R_SUCCESS the option is supported for both TCP and UDP.
+ * ISC_R_NOTFOUND IPv6 itself or the option is not supported.
+ * ISC_R_UNEXPECTED
+ */
+
+isc_result_t
+isc_net_probe_ipv6pktinfo(void);
+/*
+ * Check if the system's kernel supports the IPV6_(RECV)PKTINFO socket option
+ * for UDP sockets.
+ *
+ * Returns:
+ *
+ * ISC_R_SUCCESS the option is supported.
+ * ISC_R_NOTFOUND IPv6 itself or the option is not supported.
+ * ISC_R_UNEXPECTED
+ */
+
+void
+isc_net_disableipv4(void);
+
+void
+isc_net_disableipv6(void);
+
+void
+isc_net_enableipv4(void);
+
+void
+isc_net_enableipv6(void);
+
+isc_result_t
+isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high);
+/*%<
+ * Returns system's default range of ephemeral UDP ports, if defined.
+ * If the range is not available or unknown, ISC_NET_PORTRANGELOW and
+ * ISC_NET_PORTRANGEHIGH will be returned.
+ *
+ * Requires:
+ *
+ *\li 'low' and 'high' must be non NULL.
+ *
+ * Returns:
+ *
+ *\li *low and *high will be the ports specifying the low and high ends of
+ * the range.
+ */
+
+#ifdef ISC_PLATFORM_NEEDNTOP
+const char *
+isc_net_ntop(int af, const void *src, char *dst, size_t size);
+#define inet_ntop isc_net_ntop
+#endif
+
+#ifdef ISC_PLATFORM_NEEDPTON
+int
+isc_net_pton(int af, const char *src, void *dst);
+#define inet_pton isc_net_pton
+#endif
+
+int
+isc_net_aton(const char *cp, struct in_addr *addr);
+#define inet_aton isc_net_aton
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_NET_H */
diff --git a/lib/isc/win32/include/isc/netdb.h b/lib/isc/win32/include/isc/netdb.h
new file mode 100644
index 0000000..6625afd
--- /dev/null
+++ b/lib/isc/win32/include/isc/netdb.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: netdb.h,v 1.9 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_NETDB_H
+#define ISC_NETDB_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*
+ * Portable netdb.h support.
+ *
+ * This module is responsible for defining the get<x>by<y> APIs.
+ *
+ * MP:
+ * No impact.
+ *
+ * Reliability:
+ * No anticipated impact.
+ *
+ * Resources:
+ * N/A.
+ *
+ * Security:
+ * No anticipated impact.
+ *
+ * Standards:
+ * BSD API
+ */
+
+/***
+ *** Imports.
+ ***/
+
+#include <isc/net.h>
+
+#endif /* ISC_NETDB_H */
diff --git a/lib/isc/win32/include/isc/ntgroups.h b/lib/isc/win32/include/isc/ntgroups.h
new file mode 100644
index 0000000..b4cd020
--- /dev/null
+++ b/lib/isc/win32/include/isc/ntgroups.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ntgroups.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_NTGROUPS_H
+#define ISC_NTGROUPS_H 1
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+ISC_LANG_BEGINDECLS
+
+
+isc_result_t
+isc_ntsecurity_getaccountgroups(char *name, char **Groups, unsigned int maxgroups,
+ unsigned int *total);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_NTGROUPS_H */
diff --git a/lib/isc/win32/include/isc/ntpaths.h b/lib/isc/win32/include/isc/ntpaths.h
new file mode 100644
index 0000000..39bcb62
--- /dev/null
+++ b/lib/isc/win32/include/isc/ntpaths.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ntpaths.h,v 1.20 2009/07/14 22:54:57 each Exp $ */
+
+/*
+ * Windows-specific path definitions
+ * These routines are used to set up and return system-specific path
+ * information about the files enumerated in NtPaths
+ */
+
+#ifndef ISC_NTPATHS_H
+#define ISC_NTPATHS_H
+
+#include <isc/lang.h>
+
+/*
+ * Index of paths needed
+ */
+enum NtPaths {
+ NAMED_CONF_PATH,
+ LWRES_CONF_PATH,
+ RESOLV_CONF_PATH,
+ RNDC_CONF_PATH,
+ NAMED_PID_PATH,
+ LWRESD_PID_PATH,
+ LOCAL_STATE_DIR,
+ SYS_CONF_DIR,
+ RNDC_KEY_PATH,
+ SESSION_KEY_PATH
+};
+
+/*
+ * Define macros to get the path of the config files
+ */
+#define NAMED_CONFFILE isc_ntpaths_get(NAMED_CONF_PATH)
+#define RNDC_CONFFILE isc_ntpaths_get(RNDC_CONF_PATH)
+#define RNDC_KEYFILE isc_ntpaths_get(RNDC_KEY_PATH)
+#define SESSION_KEYFILE isc_ntpaths_get(SESSION_KEY_PATH)
+#define RESOLV_CONF isc_ntpaths_get(RESOLV_CONF_PATH)
+
+/*
+ * Information about where the files are on disk
+ */
+#define NS_LOCALSTATEDIR "/dns/bin"
+#define NS_SYSCONFDIR "/dns/etc"
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_ntpaths_init(void);
+
+char *
+isc_ntpaths_get(int);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_NTPATHS_H */
diff --git a/lib/isc/win32/include/isc/offset.h b/lib/isc/win32/include/isc/offset.h
new file mode 100644
index 0000000..f22fdce
--- /dev/null
+++ b/lib/isc/win32/include/isc/offset.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: offset.h,v 1.6 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_OFFSET_H
+#define ISC_OFFSET_H 1
+
+/*
+ * File offsets are operating-system dependent.
+ */
+#include <limits.h> /* Required for CHAR_BIT. */
+#include <sys/types.h>
+
+typedef _off_t isc_offset_t;
+
+/*
+ * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral
+ * types", so the maximum value is all 1s except for the high bit.
+ * This definition is more complex than it really needs to be because it was
+ * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about
+ * integer overflow. For example, though this is equivalent to just left
+ * shifting 1 to the high bit and then inverting the bits, the SunOS compiler
+ * is unhappy about shifting a positive "1" to negative in a signed integer.
+ */
+#define ISC_OFFSET_MAXIMUM \
+ (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \
+ << (sizeof(off_t) * CHAR_BIT - 1)))
+
+#endif /* ISC_OFFSET_H */
diff --git a/lib/isc/win32/include/isc/once.h b/lib/isc/win32/include/isc/once.h
new file mode 100644
index 0000000..0dc1686
--- /dev/null
+++ b/lib/isc/win32/include/isc/once.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: once.h,v 1.9 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_ONCE_H
+#define ISC_ONCE_H 1
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+ISC_LANG_BEGINDECLS
+
+typedef struct {
+ int status;
+ LONG counter;
+} isc_once_t;
+
+#define ISC_ONCE_INIT_NEEDED 0
+#define ISC_ONCE_INIT_DONE 1
+
+#define ISC_ONCE_INIT { ISC_ONCE_INIT_NEEDED, 1 }
+
+isc_result_t
+isc_once_do(isc_once_t *controller, void(*function)(void));
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_ONCE_H */
diff --git a/lib/isc/win32/include/isc/platform.h b/lib/isc/win32/include/isc/platform.h
new file mode 100644
index 0000000..94b8ba5
--- /dev/null
+++ b/lib/isc/win32/include/isc/platform.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: platform.h,v 1.19 2009/09/29 23:48:04 tbox Exp $ */
+
+#ifndef ISC_PLATFORM_H
+#define ISC_PLATFORM_H 1
+
+/*****
+ ***** Platform-dependent defines.
+ *****/
+
+#define ISC_PLATFORM_USETHREADS
+
+/***
+ *** Network.
+ ***/
+
+#if _MSC_VER > 1200
+#define ISC_PLATFORM_HAVEIPV6
+#define ISC_PLATFORM_HAVEIN6PKTINFO
+#define ISC_PLATFORM_HAVESCOPEID
+#endif
+#define ISC_PLATFORM_NEEDPORTT
+#undef MSG_TRUNC
+#define ISC_PLATFORM_NEEDNTOP
+#define ISC_PLATFORM_NEEDPTON
+
+#ifndef ISC_PLATFORM_QUADFORMAT
+#define ISC_PLATFORM_QUADFORMAT "I64"
+#endif
+
+#define ISC_PLATFORM_NEEDSTRSEP
+#define ISC_PLATFORM_NEEDSTRLCPY
+#define ISC_PLATFORM_NEEDSTRLCAT
+#define ISC_PLATFORM_NEEDSTRLCPY
+
+/*
+ * Used to control how extern data is linked; needed for Win32 platforms.
+ */
+#define ISC_PLATFORM_USEDECLSPEC 1
+
+/*
+ * Define this here for now as winsock2.h defines h_errno
+ * and we don't want to redeclare it.
+ */
+#define ISC_PLATFORM_NONSTDHERRNO
+
+/*
+ * Define if the platform has <sys/un.h>.
+ */
+#undef ISC_PLATFORM_HAVESYSUNH
+
+/*
+ * Defines for the noreturn attribute.
+ */
+#define ISC_PLATFORM_NORETURN_PRE __declspec(noreturn)
+#define ISC_PLATFORM_NORETURN_POST
+
+/*
+ * Set up a macro for importing and exporting from the DLL
+ *
+ * To build static libraries on win32, #define ISC_STATIC_WIN
+ */
+#ifndef ISC_STATIC_WIN
+#define ISC_DLLEXP __declspec(dllexport)
+#define ISC_DLLIMP __declspec(dllimport)
+#else
+#define ISC_DLLEXP
+#define ISC_DLLIMP
+#endif
+
+#ifdef LIBISC_EXPORTS
+#define LIBISC_EXTERNAL_DATA ISC_DLLEXP
+#else
+#define LIBISC_EXTERNAL_DATA ISC_DLLIMP
+#endif
+
+#ifdef LIBISCCFG_EXPORTS
+#define LIBISCCFG_EXTERNAL_DATA ISC_DLLEXP
+#else
+#define LIBISCCFG_EXTERNAL_DATA ISC_DLLIMP
+#endif
+
+#ifdef LIBISCCC_EXPORTS
+#define LIBISCCC_EXTERNAL_DATA ISC_DLLEXP
+#else
+#define LIBISCCC_EXTERNAL_DATA ISC_DLLIMP
+#endif
+
+#ifdef LIBDNS_EXPORTS
+#define LIBDNS_EXTERNAL_DATA ISC_DLLEXP
+#else
+#define LIBDNS_EXTERNAL_DATA ISC_DLLIMP
+#endif
+
+#ifdef LIBBIND9_EXPORTS
+#define LIBBIND9_EXTERNAL_DATA ISC_DLLEXP
+#else
+#define LIBBIND9_EXTERNAL_DATA ISC_DLLIMP
+#endif
+
+#endif /* ISC_PLATFORM_H */
diff --git a/lib/isc/win32/include/isc/stat.h b/lib/isc/win32/include/isc/stat.h
new file mode 100644
index 0000000..f95e3b0
--- /dev/null
+++ b/lib/isc/win32/include/isc/stat.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: stat.h,v 1.9 2009/10/01 23:48:08 tbox Exp $ */
+
+#ifndef ISC_STAT_H
+#define ISC_STAT_H 1
+
+#include <sys/stat.h>
+
+/* open() under unix allows setting of read/write permissions
+ * at the owner, group and other levels. These don't exist in NT
+ * We'll just map them all to the NT equivalent
+ */
+
+#define S_IREAD _S_IREAD /* read permission, owner */
+#define S_IWRITE _S_IWRITE /* write permission, owner */
+#define S_IEXEC _S_IEXEC /* execute/search permission, owner */
+#define S_IRUSR _S_IREAD /* Owner read permission */
+#define S_IWUSR _S_IWRITE /* Owner write permission */
+#define S_IRGRP _S_IREAD /* Group read permission */
+#define S_IWGRP _S_IWRITE /* Group write permission */
+#define S_IROTH _S_IREAD /* Other read permission */
+#define S_IWOTH _S_IWRITE /* Other write permission */
+
+#ifndef S_IFMT
+# define S_IFMT _S_IFMT
+#endif
+#ifndef S_IFDIR
+# define S_IFDIR _S_IFDIR
+#endif
+#ifndef S_IFCHR
+# define S_IFCHR _S_IFCHR
+#endif
+#ifndef S_IFREG
+# define S_IFREG _S_IFREG
+#endif
+
+#ifndef S_ISDIR
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+#ifndef S_ISREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+
+#define O_RDONLY _O_RDONLY
+#define O_WRONLY _O_WRONLY
+#define O_RDWR _O_RDWR
+#define O_APPEND _O_APPEND
+#define O_CREAT _O_CREAT
+#define O_TRUNC _O_TRUNC
+#define O_EXCL _O_EXCL
+
+#endif /* ISC_STAT_H */
diff --git a/lib/isc/win32/include/isc/stdtime.h b/lib/isc/win32/include/isc/stdtime.h
new file mode 100644
index 0000000..abbbc16
--- /dev/null
+++ b/lib/isc/win32/include/isc/stdtime.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef ISC_STDTIME_H
+#define ISC_STDTIME_H 1
+
+#include <isc/lang.h>
+#include <isc/int.h>
+
+/*
+ * It's public information that 'isc_stdtime_t' is an unsigned integral type.
+ * Applications that want maximum portability should not assume anything
+ * about its size.
+ */
+typedef isc_uint32_t isc_stdtime_t;
+
+/* but this flag helps... */
+#define STDTIME_ON_32BITS 1
+
+/*
+ * isc_stdtime32_t is a 32-bit version of isc_stdtime_t. A variable of this
+ * type should only be used as an opaque integer (e.g.,) to compare two
+ * time values.
+ */
+typedef isc_uint32_t isc_stdtime32_t;
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_stdtime_get(isc_stdtime_t *t);
+/*
+ * Set 't' to the number of seconds since 00:00:00 UTC, January 1, 1970.
+ *
+ * Requires:
+ *
+ * 't' is a valid pointer.
+ */
+
+#define isc_stdtime_convert32(t, t32p) (*(t32p) = t)
+/*
+ * Convert the standard time to its 32-bit version.
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_STDTIME_H */
diff --git a/lib/isc/win32/include/isc/strerror.h b/lib/isc/win32/include/isc/strerror.h
new file mode 100644
index 0000000..38d2ef2
--- /dev/null
+++ b/lib/isc/win32/include/isc/strerror.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: strerror.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_STRERROR_H
+#define ISC_STRERROR_H
+
+#include <sys/types.h>
+
+#include <isc/lang.h>
+
+ISC_LANG_BEGINDECLS
+
+#define ISC_STRERRORSIZE 128
+
+/*
+ * Provide a thread safe wrapper to strerrror().
+ *
+ * Requires:
+ * 'buf' to be non NULL.
+ */
+void
+isc__strerror(int num, char *buf, size_t bufsize);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_STRERROR_H */
diff --git a/lib/isc/win32/include/isc/syslog.h b/lib/isc/win32/include/isc/syslog.h
new file mode 100644
index 0000000..765c0e5
--- /dev/null
+++ b/lib/isc/win32/include/isc/syslog.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: syslog.h,v 1.5 2007/06/19 23:47:20 tbox Exp $ */
+
+#ifndef ISC_SYSLOG_H
+#define ISC_SYSLOG_H 1
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_syslog_facilityfromstring(const char *str, int *facilityp);
+/*
+ * Convert 'str' to the appropriate syslog facility constant.
+ *
+ * Requires:
+ *
+ * 'str' is not NULL
+ * 'facilityp' is not NULL
+ *
+ * Returns:
+ * ISC_R_SUCCESS
+ * ISC_R_NOTFOUND
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_SYSLOG_H */
diff --git a/lib/isc/win32/include/isc/thread.h b/lib/isc/win32/include/isc/thread.h
new file mode 100644
index 0000000..2eb923b
--- /dev/null
+++ b/lib/isc/win32/include/isc/thread.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: thread.h,v 1.25 2009/09/29 04:37:08 marka Exp $ */
+
+#ifndef ISC_THREAD_H
+#define ISC_THREAD_H 1
+
+#include <windows.h>
+
+#include <isc/lang.h>
+#include <isc/result.h>
+
+/*
+ * Inlines to help with wait retrun checking
+ */
+
+/* check handle for NULL and INVALID_HANDLE */
+inline BOOL IsValidHandle( HANDLE hHandle) {
+ return ((hHandle != NULL) && (hHandle != INVALID_HANDLE_VALUE));
+}
+
+/* validate wait return codes... */
+inline BOOL WaitSucceeded( DWORD dwWaitResult, DWORD dwHandleCount) {
+ return ((dwWaitResult >= WAIT_OBJECT_0) &&
+ (dwWaitResult < WAIT_OBJECT_0 + dwHandleCount));
+}
+
+inline BOOL WaitAbandoned( DWORD dwWaitResult, DWORD dwHandleCount) {
+ return ((dwWaitResult >= WAIT_ABANDONED_0) &&
+ (dwWaitResult < WAIT_ABANDONED_0 + dwHandleCount));
+}
+
+inline BOOL WaitTimeout( DWORD dwWaitResult) {
+ return (dwWaitResult == WAIT_TIMEOUT);
+}
+
+inline BOOL WaitFailed( DWORD dwWaitResult) {
+ return (dwWaitResult == WAIT_FAILED);
+}
+
+/* compute object indices for waits... */
+inline DWORD WaitSucceededIndex( DWORD dwWaitResult) {
+ return (dwWaitResult - WAIT_OBJECT_0);
+}
+
+inline DWORD WaitAbandonedIndex( DWORD dwWaitResult) {
+ return (dwWaitResult - WAIT_ABANDONED_0);
+}
+
+
+
+typedef HANDLE isc_thread_t;
+typedef DWORD isc_threadresult_t;
+typedef void * isc_threadarg_t;
+typedef isc_threadresult_t (WINAPI *isc_threadfunc_t)(isc_threadarg_t);
+typedef DWORD isc_thread_key_t;
+
+#define isc_thread_self (unsigned long)GetCurrentThreadId
+
+ISC_LANG_BEGINDECLS
+
+isc_result_t
+isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *);
+
+isc_result_t
+isc_thread_join(isc_thread_t, isc_threadresult_t *);
+
+void
+isc_thread_setconcurrency(unsigned int level);
+
+int
+isc_thread_key_create(isc_thread_key_t *key, void (*func)(void *));
+
+int
+isc_thread_key_delete(isc_thread_key_t key);
+
+void *
+isc_thread_key_getspecific(isc_thread_key_t);
+
+int
+isc_thread_key_setspecific(isc_thread_key_t key, void *value);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_THREAD_H */
diff --git a/lib/isc/win32/include/isc/time.h b/lib/isc/win32/include/isc/time.h
new file mode 100644
index 0000000..8ffb24b
--- /dev/null
+++ b/lib/isc/win32/include/isc/time.h
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: time.h,v 1.35 2009/01/05 23:47:54 tbox Exp $ */
+
+#ifndef ISC_TIME_H
+#define ISC_TIME_H 1
+
+#include <windows.h>
+
+#include <isc/lang.h>
+#include <isc/types.h>
+
+/***
+ *** Intervals
+ ***/
+
+/*
+ * The contents of this structure are private, and MUST NOT be accessed
+ * directly by callers.
+ *
+ * The contents are exposed only to allow callers to avoid dynamic allocation.
+ */
+struct isc_interval {
+ isc_int64_t interval;
+};
+
+LIBISC_EXTERNAL_DATA extern isc_interval_t *isc_interval_zero;
+
+ISC_LANG_BEGINDECLS
+
+void
+isc_interval_set(isc_interval_t *i,
+ unsigned int seconds, unsigned int nanoseconds);
+/*
+ * Set 'i' to a value representing an interval of 'seconds' seconds and
+ * 'nanoseconds' nanoseconds, suitable for use in isc_time_add() and
+ * isc_time_subtract().
+ *
+ * Requires:
+ *
+ * 't' is a valid pointer.
+ * nanoseconds < 1000000000.
+ */
+
+isc_boolean_t
+isc_interval_iszero(const isc_interval_t *i);
+/*
+ * Returns ISC_TRUE iff. 'i' is the zero interval.
+ *
+ * Requires:
+ *
+ * 'i' is a valid pointer.
+ */
+
+/***
+ *** Absolute Times
+ ***/
+
+/*
+ * The contents of this structure are private, and MUST NOT be accessed
+ * directly by callers.
+ *
+ * The contents are exposed only to allow callers to avoid dynamic allocation.
+ */
+
+struct isc_time {
+ FILETIME absolute;
+};
+
+LIBISC_EXTERNAL_DATA extern isc_time_t *isc_time_epoch;
+
+void
+isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds);
+/*%<
+ * Set 't' to a value which represents the given number of seconds and
+ * nanoseconds since 00:00:00 January 1, 1970, UTC.
+ *
+ * Requires:
+ *\li 't' is a valid pointer.
+ *\li nanoseconds < 1000000000.
+ */
+
+void
+isc_time_settoepoch(isc_time_t *t);
+/*
+ * Set 't' to the time of the epoch.
+ *
+ * Notes:
+ * The date of the epoch is platform-dependent.
+ *
+ * Requires:
+ *
+ * 't' is a valid pointer.
+ */
+
+isc_boolean_t
+isc_time_isepoch(const isc_time_t *t);
+/*
+ * Returns ISC_TRUE iff. 't' is the epoch ("time zero").
+ *
+ * Requires:
+ *
+ * 't' is a valid pointer.
+ */
+
+isc_result_t
+isc_time_now(isc_time_t *t);
+/*
+ * Set 't' to the current absolute time.
+ *
+ * Requires:
+ *
+ * 't' is a valid pointer.
+ *
+ * Returns:
+ *
+ * Success
+ * Unexpected error
+ * Getting the time from the system failed.
+ * Out of range
+ * The time from the system is too large to be represented
+ * in the current definition of isc_time_t.
+ */
+
+isc_result_t
+isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i);
+/*
+ * Set *t to the current absolute time + i.
+ *
+ * Note:
+ * This call is equivalent to:
+ *
+ * isc_time_now(t);
+ * isc_time_add(t, i, t);
+ *
+ * Requires:
+ *
+ * 't' and 'i' are valid pointers.
+ *
+ * Returns:
+ *
+ * Success
+ * Unexpected error
+ * Getting the time from the system failed.
+ * Out of range
+ * The interval added to the time from the system is too large to
+ * be represented in the current definition of isc_time_t.
+ */
+
+int
+isc_time_compare(const isc_time_t *t1, const isc_time_t *t2);
+/*
+ * Compare the times referenced by 't1' and 't2'
+ *
+ * Requires:
+ *
+ * 't1' and 't2' are valid pointers.
+ *
+ * Returns:
+ *
+ * -1 t1 < t2 (comparing times, not pointers)
+ * 0 t1 = t2
+ * 1 t1 > t2
+ */
+
+isc_result_t
+isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result);
+/*
+ * Add 'i' to 't', storing the result in 'result'.
+ *
+ * Requires:
+ *
+ * 't', 'i', and 'result' are valid pointers.
+ *
+ * Returns:
+ * Success
+ * Out of range
+ * The interval added to the time is too large to
+ * be represented in the current definition of isc_time_t.
+ */
+
+isc_result_t
+isc_time_subtract(const isc_time_t *t, const isc_interval_t *i,
+ isc_time_t *result);
+/*
+ * Subtract 'i' from 't', storing the result in 'result'.
+ *
+ * Requires:
+ *
+ * 't', 'i', and 'result' are valid pointers.
+ *
+ * Returns:
+ * Success
+ * Out of range
+ * The interval is larger than the time since the epoch.
+ */
+
+isc_uint64_t
+isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2);
+/*
+ * Find the difference in milliseconds between time t1 and time t2.
+ * t2 is the subtrahend of t1; ie, difference = t1 - t2.
+ *
+ * Requires:
+ *
+ * 't1' and 't2' are valid pointers.
+ *
+ * Returns:
+ * The difference of t1 - t2, or 0 if t1 <= t2.
+ */
+
+isc_uint32_t
+isc_time_nanoseconds(const isc_time_t *t);
+/*
+ * Return the number of nanoseconds stored in a time structure.
+ *
+ * Notes:
+ * This is the number of nanoseconds in excess of the number
+ * of seconds since the epoch; it will always be less than one
+ * full second.
+ *
+ * Requires:
+ * 't' is a valid pointer.
+ *
+ * Ensures:
+ * The returned value is less than 1*10^9.
+ */
+
+void
+isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len);
+/*
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using a format like "30-Aug-2000 04:06:47.997" and the local time zone.
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ * 'len' > 0
+ * 'buf' points to an array of at least len chars
+ *
+ */
+
+void
+isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len);
+/*
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using a format like "Mon, 30 Aug 2000 04:06:47 GMT"
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ * 'len' > 0
+ * 'buf' points to an array of at least len chars
+ *
+ */
+
+void
+isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len);
+/*%<
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using the ISO8601 format: "yyyy-mm-ddThh:mm:ssZ"
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ *\li 'len' > 0
+ *\li 'buf' points to an array of at least len chars
+ *
+ */
+
+isc_uint32_t
+isc_time_seconds(const isc_time_t *t);
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_TIME_H */
diff --git a/lib/isc/win32/include/isc/win32os.h b/lib/isc/win32/include/isc/win32os.h
new file mode 100644
index 0000000..bd40393
--- /dev/null
+++ b/lib/isc/win32/include/isc/win32os.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: win32os.h,v 1.7 2009/06/25 23:48:02 tbox Exp $ */
+
+#ifndef ISC_WIN32OS_H
+#define ISC_WIN32OS_H 1
+
+#include <isc/lang.h>
+
+ISC_LANG_BEGINDECLS
+
+/*
+ * Return the number of CPUs available on the system, or 1 if this cannot
+ * be determined.
+ */
+
+unsigned int
+isc_win32os_majorversion(void);
+/*
+ * Major Version of the O/S.
+ */
+
+unsigned int
+isc_win32os_minorversion(void);
+/*
+ * Minor Version of the O/S.
+ */
+
+unsigned int
+isc_win32os_servicepackmajor(void);
+/*
+ * Major Version of the Service Pack for O/S.
+ */
+
+unsigned int
+isc_win32os_servicepackminor(void);
+/*
+ * Minor Version of the Service Pack for O/S.
+ */
+
+int
+isc_win32os_versioncheck(unsigned int major, unsigned int minor,
+ unsigned int updatemajor, unsigned int updateminor);
+
+/*
+ * Checks the current version of the operating system with the
+ * supplied version information.
+ * Returns:
+ * -1 if less than the version information supplied
+ * 0 if equal to all of the version information supplied
+ * +1 if greater than the version information supplied
+ */
+
+ISC_LANG_ENDDECLS
+
+#endif /* ISC_WIN32OS_H */
diff --git a/lib/isc/win32/interfaceiter.c b/lib/isc/win32/interfaceiter.c
new file mode 100644
index 0000000..8753aa8
--- /dev/null
+++ b/lib/isc/win32/interfaceiter.c
@@ -0,0 +1,807 @@
+/*
+ * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: interfaceiter.c,v 1.15 2009/01/18 23:48:14 tbox Exp $ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <gaa_compat.h>
+
+#include <isc/interfaceiter.h>
+#include <isc/mem.h>
+#include <isc/result.h>
+#include <isc/string.h>
+#include <isc/strerror.h>
+#include <isc/types.h>
+#include <isc/util.h>
+#include <isc/win32os.h>
+
+void InitSockets(void);
+
+
+#define IFITER_MAGIC 0x49464954U /* IFIT. */
+#define VALID_IFITER(t) ((t) != NULL && (t)->magic == IFITER_MAGIC)
+
+struct isc_interfaceiter {
+ unsigned int magic; /* Magic number. */
+ /* common fields */
+ isc_mem_t *mctx;
+ isc_interface_t current; /* Current interface data. */
+ isc_result_t result; /* Last result code. */
+ /* fields used if GetAdaptersAddresses is available at runtime */
+ IP_ADAPTER_ADDRESSES * ipaa; /* GAA() result buffer */
+ ULONG ipaasize; /* Bytes allocated */
+ IP_ADAPTER_ADDRESSES * ipaaCur; /* enumeration position */
+ IP_ADAPTER_UNICAST_ADDRESS *ipuaCur; /* enumeration subposition */
+ /* fields used for the older address enumeration ioctls */
+ int socket;
+ INTERFACE_INFO IFData; /* Current Interface Info */
+ int numIF; /* Current Interface count */
+ int v4IF; /* Number of IPv4 Interfaces */
+ INTERFACE_INFO *buf4; /* Buffer for WSAIoctl data. */
+ unsigned int buf4size; /* Bytes allocated. */
+ INTERFACE_INFO *pos4; /* Current offset in IF List */
+ SOCKET_ADDRESS_LIST *buf6;
+ unsigned int buf6size; /* Bytes allocated. */
+ unsigned int pos6; /* buf6 index, counts down */
+ struct in6_addr loop__1; /* ::1 node-scope localhost */
+ struct in6_addr loopfe80__1; /* fe80::1 link-scope localhost */
+};
+
+typedef ULONG (WINAPI *PGETADAPTERSADDRESSES)(
+ ULONG Family,
+ ULONG Flags,
+ PVOID Reserved,
+ PIP_ADAPTER_ADDRESSES AdapterAddresses,
+ PULONG SizePointer
+);
+
+static isc_boolean_t use_GAA;
+static isc_boolean_t use_GAA_determined;
+static HMODULE hmod_iphlpapi;
+static PGETADAPTERSADDRESSES pGAA;
+
+
+/*
+ * Size of buffer for SIO_GET_INTERFACE_LIST, in number of interfaces.
+ * We assume no sane system will have more than than 1K of IP addresses on
+ * all of its adapters.
+ */
+#define IFCONF_SIZE_INITIAL 16
+#define IFCONF_SIZE_INCREMENT 64
+#define IFCONF_SIZE_MAX 1040
+
+
+/* Common utility functions */
+
+/*
+ * Windows always provides 255.255.255.255 as the the broadcast
+ * address. ntpd needs to know the broadcast address which will target
+ * only that network interface, not all. Reconstruct it from the
+ * address and mask.
+ */
+static void
+get_broadcastaddr(isc_netaddr_t *bcastaddr, isc_netaddr_t *addr, isc_netaddr_t *netmask) {
+
+ isc_uint32_t * b;
+ isc_uint32_t a, n;
+
+ b = (isc_uint32_t *)&bcastaddr->type.in;
+ a = *(isc_uint32_t *)&addr->type.in;
+ n = *(isc_uint32_t *)&netmask->type.in;
+
+ *b = a | ~n;
+}
+
+isc_result_t
+isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
+ char strbuf[ISC_STRERRORSIZE];
+ isc_interfaceiter_t *iter;
+ isc_result_t result;
+ unsigned int major;
+ unsigned int minor;
+ unsigned int spmajor;
+ ULONG err;
+ int tries;
+ int error;
+ unsigned long bytesReturned = 0;
+
+ REQUIRE(mctx != NULL);
+ REQUIRE(iterp != NULL);
+ REQUIRE(*iterp == NULL);
+
+ iter = isc_mem_get(mctx, sizeof(*iter));
+ if (iter == NULL)
+ return (ISC_R_NOMEMORY);
+
+ InitSockets();
+
+ iter->mctx = mctx;
+ iter->ipaa = NULL;
+ iter->buf4 = NULL;
+ iter->buf6 = NULL;
+ iter->pos4 = NULL;
+ iter->ipaaCur = NULL;
+ iter->ipuaCur = NULL;
+ iter->ipaasize = 0;
+ iter->pos6 = 0;
+ iter->buf6size = 0;
+ iter->buf4size = 0;
+ iter->result = ISC_R_FAILURE;
+ iter->numIF = 0;
+ iter->v4IF = 0;
+
+ /*
+ * Use GetAdaptersAddresses in preference to ioctls when running
+ * on Windows XP SP1 or later. Earlier GetAdaptersAddresses do
+ * not appear to provide enough information to associate unicast
+ * addresses with their prefixes.
+ */
+ if (!use_GAA_determined) {
+ major = isc_win32os_majorversion();
+ minor = isc_win32os_minorversion();
+ spmajor = isc_win32os_servicepackmajor();
+ if (major > 5 || (5 == major &&
+ (minor > 1 || (1 == minor && spmajor >= 1)))) {
+ if (NULL == hmod_iphlpapi)
+ hmod_iphlpapi = LoadLibrary("iphlpapi");
+ if (NULL != hmod_iphlpapi)
+ pGAA = (PGETADAPTERSADDRESSES)
+ GetProcAddress(
+ hmod_iphlpapi,
+ "GetAdaptersAddresses");
+ if (NULL != pGAA)
+ use_GAA = ISC_TRUE;
+ }
+ use_GAA_determined = ISC_TRUE;
+ }
+
+ if (!use_GAA)
+ goto use_ioctls;
+
+ iter->ipaasize = 16 * 1024;
+
+ for (tries = 0; tries < 5; tries++) {
+ iter->ipaa = isc_mem_reallocate(mctx, iter->ipaa,
+ iter->ipaasize);
+ if (NULL == iter->ipaa) {
+ result = ISC_R_NOMEMORY;
+ goto put_iter;
+ }
+ err = (*pGAA)(
+ AF_UNSPEC,
+ GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_SKIP_ANYCAST,
+ NULL,
+ iter->ipaa,
+ &iter->ipaasize);
+ if (NO_ERROR == err || ERROR_BUFFER_OVERFLOW != err)
+ break;
+ }
+
+ if (NO_ERROR != err) {
+ isc__strerror(err, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "GetAdaptersAddresses: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto gaa_failure;
+ }
+
+ iter->ipaaCur = iter->ipaa;
+ goto success;
+
+ use_ioctls:
+ /*
+ * Create an unbound datagram socket to do the
+ * SIO_GET_INTERFACE_LIST WSAIoctl on.
+ */
+ if ((iter->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ error = WSAGetLastError();
+ if (error == WSAEAFNOSUPPORT)
+ goto inet6_only;
+ isc__strerror(error, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "making interface scan socket: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto put_iter;
+ }
+
+ /*
+ * Get the interface configuration, allocating more memory if
+ * necessary.
+ */
+ iter->buf4size = IFCONF_SIZE_INITIAL*sizeof(INTERFACE_INFO);
+
+ for (;;) {
+ iter->buf4 = isc_mem_get(mctx, iter->buf4size);
+ if (iter->buf4 == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto alloc_failure;
+ }
+
+ if (WSAIoctl(iter->socket, SIO_GET_INTERFACE_LIST,
+ 0, 0, iter->buf4, iter->buf4size,
+ &bytesReturned, 0, 0) == SOCKET_ERROR)
+ {
+ error = WSAGetLastError();
+ if (error != WSAEFAULT && error != WSAENOBUFS) {
+ errno = error;
+ isc__strerror(error, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "get interface configuration: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto ioctl_failure;
+ }
+ /*
+ * EINVAL. Retry with a bigger buffer.
+ */
+ } else {
+ /*
+ * The WSAIoctl succeeded.
+ * If the number of the returned bytes is the same
+ * as the buffer size, we will grow it just in
+ * case and retry.
+ */
+ if (bytesReturned > 0 &&
+ (bytesReturned < iter->buf4size))
+ break;
+ }
+ if (iter->buf4size >= IFCONF_SIZE_MAX*sizeof(INTERFACE_INFO)) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "get interface configuration: "
+ "maximum buffer size exceeded");
+ result = ISC_R_UNEXPECTED;
+ goto ioctl_failure;
+ }
+ isc_mem_put(mctx, iter->buf4, iter->buf4size);
+
+ iter->buf4size += IFCONF_SIZE_INCREMENT *
+ sizeof(INTERFACE_INFO);
+ }
+
+ /*
+ * A newly created iterator has an undefined position
+ * until isc_interfaceiter_first() is called.
+ */
+ iter->v4IF = bytesReturned/sizeof(INTERFACE_INFO);
+
+ /* We don't need the socket any more, so close it */
+ closesocket(iter->socket);
+
+ inet6_only:
+ /*
+ * Create an unbound datagram socket to do the
+ * SIO_ADDRESS_LIST_QUERY WSAIoctl on.
+ */
+ if ((iter->socket = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
+ error = WSAGetLastError();
+ if (error == WSAEAFNOSUPPORT)
+ goto success;
+ isc__strerror(error, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "making interface scan socket: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto put_iter;
+ }
+
+ /*
+ * Get the interface configuration, allocating more memory if
+ * necessary.
+ */
+ iter->buf6size = sizeof(SOCKET_ADDRESS_LIST) +
+ IFCONF_SIZE_INITIAL*sizeof(SOCKET_ADDRESS);
+
+ for (;;) {
+ iter->buf6 = isc_mem_get(mctx, iter->buf6size);
+ if (iter->buf6 == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto ioctl_failure;
+ }
+
+ if (WSAIoctl(iter->socket, SIO_ADDRESS_LIST_QUERY,
+ 0, 0, iter->buf6, iter->buf6size,
+ &bytesReturned, 0, 0) == SOCKET_ERROR)
+ {
+ error = WSAGetLastError();
+ if (error != WSAEFAULT && error != WSAENOBUFS) {
+ errno = error;
+ isc__strerror(error, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "sio address list query: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto ioctl6_failure;
+ }
+ /*
+ * EINVAL. Retry with a bigger buffer.
+ */
+ } else
+ break;
+
+ if (iter->buf6size >= IFCONF_SIZE_MAX*sizeof(SOCKET_ADDRESS)) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "get interface configuration: "
+ "maximum buffer size exceeded");
+ result = ISC_R_UNEXPECTED;
+ goto ioctl6_failure;
+ }
+ isc_mem_put(mctx, iter->buf6, iter->buf6size);
+
+ iter->buf6size += IFCONF_SIZE_INCREMENT *
+ sizeof(SOCKET_ADDRESS);
+ }
+
+ /*
+ * initialize loop__1 to [::1] and loopfe80__1 to [fe80::1].
+ * used by internal_current6().
+ */
+ memset(&iter->loop__1, 0, sizeof(iter->loop__1));
+ memset(&iter->loopfe80__1, 0, sizeof(iter->loopfe80__1));
+ iter->loop__1.s6_addr[15] = 1;
+ iter->loopfe80__1.s6_addr[15] = 1;
+ iter->loopfe80__1.s6_addr[0] = 0xfe;
+ iter->loopfe80__1.s6_addr[1] = 0x80;
+
+ closesocket(iter->socket);
+
+ success:
+ iter->magic = IFITER_MAGIC;
+ *iterp = iter;
+ return (ISC_R_SUCCESS);
+
+ gaa_failure:
+ isc_mem_put(mctx, iter->ipaa, iter->ipaasize);
+ goto put_iter;
+
+ ioctl6_failure:
+ isc_mem_put(mctx, iter->buf6, iter->buf6size);
+
+ ioctl_failure:
+ if (iter->buf4 != NULL)
+ isc_mem_put(mctx, iter->buf4, iter->buf4size);
+
+ alloc_failure:
+ if (iter->socket >= 0)
+ (void) closesocket(iter->socket);
+
+ put_iter:
+ isc_mem_put(mctx, iter, sizeof(*iter));
+ return (result);
+}
+
+static unsigned char
+GAA_find_prefix(isc_interfaceiter_t *iter) {
+ IP_ADAPTER_PREFIX * ipap;
+ IP_ADAPTER_PREFIX * ipap_match;
+ int match_len;
+ int max_len;
+ isc_netaddr_t target;
+ u_short af;
+ isc_netaddr_t pfx;
+ int pfx_len;
+ size_t nbytes;
+ unsigned char nbits;
+ unsigned char * pbits;
+ unsigned int octets;
+
+ match_len = 0;
+ ipap_match = NULL;
+ isc_netaddr_fromsockaddr(&target,
+ (isc_sockaddr_t *)iter->ipuaCur->Address.lpSockaddr);
+ af = (u_short)target.family;
+ INSIST(AF_INET == af || AF_INET6 == af);
+ max_len = (AF_INET6 == af) ? 128 : 32;
+ iter->current.netmask.family = af;
+ for (ipap = iter->ipaaCur->FirstPrefix;
+ ipap != NULL;
+ ipap = ipap->Next) {
+ if (ipap->Address.lpSockaddr->sa_family != af)
+ continue;
+ isc_netaddr_fromsockaddr(&pfx,
+ (isc_sockaddr_t *)ipap->Address.lpSockaddr);
+ pfx_len = ipap->PrefixLength;
+ INSIST(0 <= pfx_len && pfx_len <= max_len);
+ if (pfx_len > match_len && pfx_len < max_len &&
+ isc_netaddr_eqprefix(&target, &pfx, pfx_len)) {
+ ipap_match = ipap;
+ match_len = pfx_len;
+ }
+ }
+ if (NULL == ipap_match) {
+ /* presume all-ones mask */
+ if (AF_INET6 == af)
+ octets = sizeof(iter->current.netmask.type.in6);
+ else
+ octets = sizeof(iter->current.netmask.type.in);
+ memset(&iter->current.netmask.type, 0xFF, octets);
+ return (8 * (unsigned char)octets);
+ }
+ nbytes = match_len / 8;
+ nbits = match_len % 8;
+ memset(&iter->current.netmask.type.in6, 0xFF, nbytes);
+ pbits = (void *)&iter->current.netmask.type.in6;
+ pbits += nbytes;
+ *pbits |= 0xFF << (8 - nbits);
+ return ((unsigned char)match_len);
+}
+
+static isc_result_t
+internal_current_GAA(isc_interfaceiter_t *iter) {
+ IP_ADAPTER_ADDRESSES *adap;
+ IP_ADAPTER_UNICAST_ADDRESS *addr;
+ unsigned char prefix_len;
+
+ REQUIRE(iter->ipaaCur != NULL);
+ REQUIRE(iter->ipuaCur != NULL);
+ adap = iter->ipaaCur;
+ addr = iter->ipuaCur;
+ if (IpDadStatePreferred != addr->DadState)
+ return (ISC_R_IGNORE);
+ memset(&iter->current, 0, sizeof(iter->current));
+ iter->current.af = addr->Address.lpSockaddr->sa_family;
+ isc_netaddr_fromsockaddr(&iter->current.address,
+ (isc_sockaddr_t *)addr->Address.lpSockaddr);
+ if (AF_INET6 == iter->current.af)
+ iter->current.ifindex = adap->Ipv6IfIndex;
+ iter->current.name[0] = '\0';
+ WideCharToMultiByte(
+ CP_ACP,
+ 0,
+ adap->FriendlyName,
+ -1,
+ iter->current.name,
+ sizeof(iter->current.name),
+ NULL,
+ NULL);
+ iter->current.name[sizeof(iter->current.name) - 1] = '\0';
+ if (IfOperStatusUp == adap->OperStatus)
+ iter->current.flags |= INTERFACE_F_UP;
+ if (IF_TYPE_PPP == adap->IfType)
+ iter->current.flags |= INTERFACE_F_POINTTOPOINT;
+ else if (IF_TYPE_SOFTWARE_LOOPBACK == adap->IfType)
+ iter->current.flags |= INTERFACE_F_LOOPBACK;
+ if ((IP_ADAPTER_NO_MULTICAST & adap->Flags) == 0)
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+ if (IpSuffixOriginRandom == addr->SuffixOrigin)
+ iter->current.flags |= INTERFACE_F_PRIVACY;
+
+ prefix_len = GAA_find_prefix(iter);
+ /* I'm failing to see a broadcast flag via GAA */
+ if (AF_INET == iter->current.af && prefix_len < 32 &&
+ (INTERFACE_F_LOOPBACK & iter->current.flags) == 0) {
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+ get_broadcastaddr(&iter->current.broadcast,
+ &iter->current.address,
+ &iter->current.netmask);
+ }
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Get information about the current interface to iter->current.
+ * If successful, return ISC_R_SUCCESS.
+ * If the interface has an unsupported address family, or if
+ * some operation on it fails, return ISC_R_IGNORE to make
+ * the higher-level iterator code ignore it.
+ */
+
+static isc_result_t
+internal_current(isc_interfaceiter_t *iter) {
+ BOOL ifNamed = FALSE;
+ unsigned long flags;
+
+ REQUIRE(VALID_IFITER(iter));
+ REQUIRE(iter->numIF >= 0);
+
+ memset(&iter->current, 0, sizeof(iter->current));
+ iter->current.af = AF_INET;
+
+ isc_netaddr_fromsockaddr(&iter->current.address,
+ (isc_sockaddr_t *)&(iter->IFData.iiAddress));
+
+ /*
+ * Get interface flags.
+ */
+
+ iter->current.flags = 0;
+ flags = iter->IFData.iiFlags;
+
+ if ((flags & IFF_UP) != 0)
+ iter->current.flags |= INTERFACE_F_UP;
+
+ if ((flags & IFF_BROADCAST) != 0)
+ iter->current.flags |= INTERFACE_F_BROADCAST;
+
+ if ((flags & IFF_MULTICAST) != 0)
+ iter->current.flags |= INTERFACE_F_MULTICAST;
+
+ if ((flags & IFF_POINTTOPOINT) != 0) {
+ iter->current.flags |= INTERFACE_F_POINTTOPOINT;
+ snprintf(iter->current.name, sizeof(iter->current.name),
+ "PPP %d", iter->numIF);
+ ifNamed = TRUE;
+ }
+
+ if ((flags & IFF_LOOPBACK) != 0) {
+ iter->current.flags |= INTERFACE_F_LOOPBACK;
+ snprintf(iter->current.name, sizeof(iter->current.name),
+ "v4loop %d", iter->numIF);
+ ifNamed = TRUE;
+ }
+
+ /*
+ * If the interface is point-to-point, get the destination address.
+ */
+ if ((iter->current.flags & INTERFACE_F_POINTTOPOINT) != 0)
+ isc_netaddr_fromsockaddr(&iter->current.dstaddress,
+ (isc_sockaddr_t *)&(iter->IFData.iiBroadcastAddress));
+
+ /*
+ * Get the network mask.
+ */
+ isc_netaddr_fromsockaddr(&iter->current.netmask,
+ (isc_sockaddr_t *)&(iter->IFData.iiNetmask));
+
+ /*
+ * If the interface is broadcast, get the broadcast address,
+ * based on the unicast address and network mask.
+ */
+ if ((iter->current.flags & INTERFACE_F_BROADCAST) != 0)
+ get_broadcastaddr(&iter->current.broadcast,
+ &iter->current.address,
+ &iter->current.netmask);
+
+ if (ifNamed == FALSE)
+ snprintf(iter->current.name, sizeof(iter->current.name),
+ "IPv4 %d", iter->numIF);
+
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+internal_current6(isc_interfaceiter_t *iter) {
+ BOOL ifNamed = FALSE;
+ struct sockaddr_in6 *psa6;
+ BOOL localhostSeen;
+ int i;
+
+ REQUIRE(VALID_IFITER(iter));
+ REQUIRE(iter->pos6 >= 0);
+ REQUIRE(iter->buf6 != 0);
+
+ memset(&iter->current, 0, sizeof(iter->current));
+ iter->current.af = AF_INET6;
+
+ /*
+ * synthesize localhost ::1 before returning the rest, if ::1
+ * is not on the list.
+ */
+ if (iter->pos6 >= (unsigned)iter->buf6->iAddressCount) {
+ localhostSeen = FALSE;
+ for (i = 0; i < iter->buf6->iAddressCount; i++) {
+ psa6 = (struct sockaddr_in6 *)
+ iter->buf6->Address[i].lpSockaddr;
+ if (!memcmp(&iter->loop__1, &psa6->sin6_addr,
+ sizeof(iter->loop__1))) {
+ localhostSeen = TRUE;
+ break;
+ }
+ }
+ if (localhostSeen)
+ iter->pos6 = iter->buf6->iAddressCount - 1;
+ }
+
+ if (iter->pos6 < (unsigned)iter->buf6->iAddressCount) {
+ isc_netaddr_fromsockaddr(&iter->current.address,
+ (isc_sockaddr_t *)iter->buf6->Address[iter->pos6].lpSockaddr);
+ } else {
+ iter->current.address.family = AF_INET6;
+ memcpy(&iter->current.address.type.in6, &iter->loop__1,
+ sizeof(iter->current.address.type.in6));
+ }
+
+ /*
+ * Get interface flags.
+ */
+
+ iter->current.flags = INTERFACE_F_UP | INTERFACE_F_MULTICAST;
+
+ if (!memcmp(&iter->current.address.type.in6, &iter->loop__1,
+ sizeof(iter->current.address.type.in6)) ||
+ !memcmp(&iter->current.address.type.in6, &iter->loopfe80__1,
+ sizeof(iter->current.address.type.in6))) {
+
+ iter->current.flags |= INTERFACE_F_LOOPBACK;
+ snprintf(iter->current.name, sizeof(iter->current.name),
+ "v6loop %d",
+ iter->buf6->iAddressCount - iter->pos6);
+ ifNamed = TRUE;
+ }
+
+ if (ifNamed == FALSE)
+ snprintf(iter->current.name, sizeof(iter->current.name),
+ "IPv6 %d",
+ iter->buf6->iAddressCount - iter->pos6);
+
+ memset(iter->current.netmask.type.in6.s6_addr, 0xff,
+ sizeof(iter->current.netmask.type.in6.s6_addr));
+ iter->current.netmask.family = AF_INET6;
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+internal_next_GAA(isc_interfaceiter_t *iter) {
+ REQUIRE(use_GAA);
+ if (NULL == iter->ipaaCur)
+ return (ISC_R_NOMORE);
+ if (NULL == iter->ipuaCur)
+ iter->ipuaCur = iter->ipaaCur->FirstUnicastAddress;
+ else
+ iter->ipuaCur = iter->ipuaCur->Next;
+ while (NULL == iter->ipuaCur) {
+ iter->ipaaCur = iter->ipaaCur->Next;
+ if (NULL == iter->ipaaCur)
+ return (ISC_R_NOMORE);
+ iter->ipuaCur = iter->ipaaCur->FirstUnicastAddress;
+ }
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Step the iterator to the next interface. Unlike
+ * isc_interfaceiter_next(), this may leave the iterator
+ * positioned on an interface that will ultimately
+ * be ignored. Return ISC_R_NOMORE if there are no more
+ * interfaces, otherwise ISC_R_SUCCESS.
+ */
+static isc_result_t
+internal_next(isc_interfaceiter_t *iter) {
+ if (iter->numIF >= iter->v4IF)
+ return (ISC_R_NOMORE);
+
+ /*
+ * The first one needs to be set up to point to the last
+ * Element of the array. Go to the end and back up
+ * Microsoft's implementation is peculiar for returning
+ * the list in reverse order
+ */
+
+ if (iter->numIF == 0)
+ iter->pos4 = (INTERFACE_INFO *)(iter->buf4 + (iter->v4IF));
+
+ iter->pos4--;
+ if (&(iter->pos4) < &(iter->buf4))
+ return (ISC_R_NOMORE);
+
+ memset(&(iter->IFData), 0, sizeof(INTERFACE_INFO));
+ memcpy(&(iter->IFData), iter->pos4, sizeof(INTERFACE_INFO));
+ iter->numIF++;
+
+ return (ISC_R_SUCCESS);
+}
+
+static isc_result_t
+internal_next6(isc_interfaceiter_t *iter) {
+ if (iter->pos6 == 0)
+ return (ISC_R_NOMORE);
+ iter->pos6--;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_interfaceiter_current(isc_interfaceiter_t *iter,
+ isc_interface_t *ifdata) {
+ REQUIRE(iter->result == ISC_R_SUCCESS);
+ memcpy(ifdata, &iter->current, sizeof(*ifdata));
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_interfaceiter_first(isc_interfaceiter_t *iter) {
+ REQUIRE(VALID_IFITER(iter));
+ REQUIRE(use_GAA_determined);
+ /*
+ * SIO_ADDRESS_LIST_QUERY (used to query IPv6 addresses)
+ * intentionally omits localhost addresses [::1] and [::fe80] in
+ * some cases. ntpd depends on enumerating [::1] to listen on
+ * it, and ntpq and ntpdc default to "localhost" as the target,
+ * so they will attempt to talk to [::1]:123 and fail. This
+ * means we need to synthesize ::1, which we will do first,
+ * hence iAddressCount + 1. internal_next6() will decrement
+ * it before the first use as an index, and internal_current6()
+ * will treat pos6 == iAddressCount as a sign to synthesize
+ * [::1] if needed.
+ */
+ if (!use_GAA && iter->buf6 != NULL)
+ iter->pos6 = iter->buf6->iAddressCount + 1;
+ iter->result = ISC_R_SUCCESS;
+ return (isc_interfaceiter_next(iter));
+}
+
+isc_result_t
+isc_interfaceiter_next(isc_interfaceiter_t *iter) {
+ isc_result_t result;
+
+ REQUIRE(VALID_IFITER(iter));
+ REQUIRE(iter->result == ISC_R_SUCCESS);
+ REQUIRE(use_GAA_determined);
+
+ if (use_GAA) {
+ do {
+ result = internal_next_GAA(iter);
+ if (ISC_R_NOMORE == result)
+ goto set_result;
+ result = internal_current_GAA(iter);
+ } while (ISC_R_IGNORE == result);
+ goto set_result;
+ }
+
+ for (;;) {
+ result = internal_next(iter);
+ if (result == ISC_R_NOMORE) {
+ result = internal_next6(iter);
+ if (result != ISC_R_SUCCESS)
+ break;
+ result = internal_current6(iter);
+ if (result != ISC_R_IGNORE)
+ break;
+ } else if (result != ISC_R_SUCCESS)
+ break;
+ result = internal_current(iter);
+ if (result != ISC_R_IGNORE)
+ break;
+ }
+ set_result:
+ iter->result = result;
+ return (result);
+}
+
+void
+isc_interfaceiter_destroy(isc_interfaceiter_t **iterp) {
+ isc_interfaceiter_t *iter;
+
+ REQUIRE(iterp != NULL);
+ iter = *iterp;
+ REQUIRE(VALID_IFITER(iter));
+ REQUIRE(use_GAA_determined);
+
+ if (use_GAA) {
+ REQUIRE(NULL == iter->buf4);
+ REQUIRE(NULL == iter->buf4);
+ if (iter->ipaa != NULL)
+ isc_mem_put(iter->mctx, iter->ipaa, iter->ipaasize);
+ } else {
+ REQUIRE(NULL == iter->ipaa);
+ if (iter->buf4 != NULL)
+ isc_mem_put(iter->mctx, iter->buf4, iter->buf4size);
+ if (iter->buf6 != NULL)
+ isc_mem_put(iter->mctx, iter->buf6, iter->buf6size);
+ }
+
+ iter->magic = 0;
+ isc_mem_put(iter->mctx, iter, sizeof(*iter));
+ *iterp = NULL;
+}
diff --git a/lib/isc/win32/ipv6.c b/lib/isc/win32/ipv6.c
new file mode 100644
index 0000000..511ae21
--- /dev/null
+++ b/lib/isc/win32/ipv6.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ipv6.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <isc/net.h>
+#include <isc/platform.h>
+
+LIBISC_EXTERNAL_DATA const struct in6_addr isc_in6addr_any =
+ IN6ADDR_ANY_INIT;
+
+LIBISC_EXTERNAL_DATA const struct in6_addr isc_in6addr_loopback =
+ IN6ADDR_LOOPBACK_INIT;
diff --git a/lib/isc/win32/keyboard.c b/lib/isc/win32/keyboard.c
new file mode 100644
index 0000000..d569e7c
--- /dev/null
+++ b/lib/isc/win32/keyboard.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: keyboard.c,v 1.7 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <config.h>
+
+#include <sys/types.h>
+
+#include <windows.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <io.h>
+
+#include <isc/keyboard.h>
+#include <isc/util.h>
+
+isc_result_t
+isc_keyboard_open(isc_keyboard_t *keyboard) {
+ int fd;
+
+ REQUIRE(keyboard != NULL);
+
+ fd = _fileno(stdin);
+ if (fd < 0)
+ return (ISC_R_IOERROR);
+
+ keyboard->fd = fd;
+
+ keyboard->result = ISC_R_SUCCESS;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleeptime) {
+ REQUIRE(keyboard != NULL);
+
+ if (sleeptime > 0 && keyboard->result != ISC_R_CANCELED)
+ (void)Sleep(sleeptime*1000);
+
+ keyboard->fd = -1;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp) {
+ ssize_t cc;
+ unsigned char c;
+
+ REQUIRE(keyboard != NULL);
+ REQUIRE(cp != NULL);
+
+ cc = read(keyboard->fd, &c, 1);
+ if (cc < 0) {
+ keyboard->result = ISC_R_IOERROR;
+ return (keyboard->result);
+ }
+
+ *cp = c;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_boolean_t
+isc_keyboard_canceled(isc_keyboard_t *keyboard) {
+ return (ISC_TF(keyboard->result == ISC_R_CANCELED));
+}
+
diff --git a/lib/isc/win32/libgen.h b/lib/isc/win32/libgen.h
new file mode 100644
index 0000000..1c58a95
--- /dev/null
+++ b/lib/isc/win32/libgen.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: libgen.h,v 1.3 2009/07/17 23:47:41 tbox Exp $ */
+
+#ifndef LIBGEN_H
+#define LIBGEN_H 1
+
+char *basename(const char *);
+char *dirname(const char *);
+
+#endif
diff --git a/lib/isc/win32/libisc.def b/lib/isc/win32/libisc.def
new file mode 100644
index 0000000..fb08410
--- /dev/null
+++ b/lib/isc/win32/libisc.def
@@ -0,0 +1,583 @@
+LIBRARY libisc
+
+; Exported Functions
+EXPORTS
+
+NTReportError
+closelog
+isc___mem_allocate
+isc___mem_free
+isc___mem_get
+isc___mem_put
+isc___mem_putanddetach
+isc___mem_reallocate
+isc___mem_strdup
+isc___mempool_get
+isc___mempool_put
+isc___socketmgr_maxudp
+isc__app_block
+isc__app_finish
+isc__app_onrun
+isc__app_reload
+isc__app_run
+isc__app_shutdown
+isc__app_start
+isc__app_unblock
+isc__backtrace_nsymbols
+isc__backtrace_symtable
+isc__buffer_activeregion
+isc__buffer_add
+isc__buffer_availableregion
+isc__buffer_back
+isc__buffer_clear
+isc__buffer_consumedregion
+isc__buffer_first
+isc__buffer_forward
+isc__buffer_init
+isc__buffer_invalidate
+isc__buffer_putmem
+isc__buffer_putstr
+isc__buffer_putuint16
+isc__buffer_putuint32
+isc__buffer_putuint48
+isc__buffer_putuint8
+isc__buffer_region
+isc__buffer_remainingregion
+isc__buffer_setactive
+isc__buffer_subtract
+isc__buffer_usedregion
+isc__mem_attach
+isc__mem_checkdestroyed
+isc__mem_create
+isc__mem_create2
+isc__mem_createx
+isc__mem_createx2
+isc__mem_destroy
+isc__mem_detach
+isc__mem_getname
+isc__mem_getquota
+isc__mem_gettag
+isc__mem_inuse
+isc__mem_isovermem
+isc__mem_ondestroy
+isc__mem_references
+isc__mem_setdestroycheck
+isc__mem_setname
+isc__mem_setquota
+isc__mem_setwater
+isc__mem_stats
+isc__mem_waterack
+isc__mempool_associatelock
+isc__mempool_create
+isc__mempool_destroy
+isc__mempool_getallocated
+isc__mempool_getfillcount
+isc__mempool_getfreecount
+isc__mempool_getfreemax
+isc__mempool_getmaxalloc
+isc__mempool_setfillcount
+isc__mempool_setfreemax
+isc__mempool_setmaxalloc
+isc__mempool_setname
+isc__socket_accept
+isc__socket_attach
+isc__socket_bind
+isc__socket_cancel
+isc__socket_cleanunix
+isc__socket_close
+isc__socket_connect
+isc__socket_create
+isc__socket_detach
+isc__socket_dup
+isc__socket_filter
+isc__socket_getfd
+isc__socket_getname
+isc__socket_getpeername
+isc__socket_getsockname
+isc__socket_gettag
+isc__socket_gettype
+isc__socket_ipv6only
+isc__socket_isbound
+isc__socket_listen
+isc__socket_open
+isc__socket_permunix
+isc__socket_recv
+isc__socket_recv2
+isc__socket_recvv
+isc__socket_send
+isc__socket_sendto
+isc__socket_sendto2
+isc__socket_sendtov
+isc__socket_sendv
+isc__socket_setname
+isc__socketmgr_create
+isc__socketmgr_create2
+isc__socketmgr_destroy
+isc__socketmgr_getmaxsockets
+isc__socketmgr_setreserved
+isc__socketmgr_setstats
+isc__strerror
+isc__task_attach
+isc__task_beginexclusive
+isc__task_create
+isc__task_destroy
+isc__task_detach
+isc__task_endexclusive
+isc__task_getcurrenttime
+isc__task_getname
+isc__task_gettag
+isc__task_onshutdown
+isc__task_privilege
+isc__task_purge
+isc__task_purgeevent
+isc__task_purgerange
+isc__task_send
+isc__task_sendanddetach
+isc__task_setname
+isc__task_setprivilege
+isc__task_shutdown
+isc__task_unsend
+isc__task_unsendrange
+isc__taskmgr_create
+isc__taskmgr_destroy
+isc__taskmgr_mode
+isc__taskmgr_setmode
+isc__timer_attach
+isc__timer_create
+isc__timer_detach
+isc__timer_reset
+isc__timer_touch
+isc__timermgr_create
+isc__timermgr_destroy
+isc__timermgr_poke
+isc_assertion_failed
+isc_assertion_setcallback
+isc_assertion_typetotext
+isc_backtrace_getsymbol
+isc_backtrace_getsymbolfromindex
+isc_backtrace_gettrace
+isc_base32_decoderegion
+isc_base32_decodestring
+isc_base32_tobuffer
+isc_base32_totext
+isc_base32hex_decoderegion
+isc_base32hex_decodestring
+isc_base32hex_tobuffer
+isc_base32hex_totext
+isc_base64_decodestring
+isc_base64_tobuffer
+isc_base64_totext
+isc_bitstring_copy
+isc_bitstring_init
+isc_bitstring_invalidate
+isc_buffer_allocate
+isc_buffer_compact
+isc_buffer_copyregion
+isc_buffer_free
+isc_buffer_getuint16
+isc_buffer_getuint32
+isc_buffer_getuint8
+isc_buffer_reinit
+isc_bufferlist_availablecount
+isc_bufferlist_usedcount
+isc_commandline_parse
+isc_condition_broadcast
+isc_condition_destroy
+isc_condition_init
+isc_condition_signal
+isc_condition_wait
+isc_condition_waituntil
+isc_dir_chdir
+isc_dir_chroot
+isc_dir_close
+isc_dir_init
+isc_dir_open
+isc_dir_read
+isc_dir_reset
+isc_entropy_addcallbacksample
+isc_entropy_addsample
+isc_entropy_attach
+isc_entropy_create
+isc_entropy_createcallbacksource
+isc_entropy_createfilesource
+isc_entropy_createsamplesource
+isc_entropy_destroysource
+isc_entropy_detach
+isc_entropy_getdata
+isc_entropy_putdata
+isc_entropy_stats
+isc_entropy_status
+isc_entropy_stopcallbacksources
+isc_entropy_usebestsource
+isc_error_fatal
+isc_error_runtimecheck
+isc_error_setfatal
+isc_error_setunexpected
+isc_error_unexpected
+isc_event_allocate
+isc_event_free
+isc_file_absolutepath
+isc_file_basename
+isc_file_exists
+isc_file_getmodtime
+isc_file_isabsolute
+isc_file_ischdiridempotent
+isc_file_iscurrentdir
+isc_file_isplainfile
+isc_file_mktemplate
+isc_file_openunique
+isc_file_openuniquemode
+isc_file_openuniqueprivate
+isc_file_progname
+isc_file_remove
+isc_file_rename
+isc_file_renameunique
+isc_file_safecreate
+isc_file_safemovefile
+isc_file_settime
+isc_file_splitpath
+isc_file_template
+isc_file_truncate
+isc_fsaccess_add
+isc_fsaccess_changeowner
+isc_fsaccess_remove
+isc_fsaccess_set
+isc_hash_calc
+isc_hash_create
+isc_hash_ctxattach
+isc_hash_ctxcalc
+isc_hash_ctxcreate
+isc_hash_ctxdetach
+isc_hash_ctxinit
+isc_hash_destroy
+isc_hash_init
+isc_heap_create
+isc_heap_decreased
+isc_heap_delete
+isc_heap_destroy
+isc_heap_element
+isc_heap_increased
+isc_heap_insert
+isc_hex_decodestring
+isc_hex_tobuffer
+isc_hex_totext
+isc_hmacmd5_init
+isc_hmacmd5_invalidate
+isc_hmacmd5_sign
+isc_hmacmd5_update
+isc_hmacmd5_verify
+isc_hmacmd5_verify2
+isc_hmacsha1_init
+isc_hmacsha1_invalidate
+isc_hmacsha1_sign
+isc_hmacsha1_update
+isc_hmacsha1_verify
+isc_hmacsha224_init
+isc_hmacsha224_invalidate
+isc_hmacsha224_sign
+isc_hmacsha224_update
+isc_hmacsha224_verify
+isc_hmacsha256_init
+isc_hmacsha256_invalidate
+isc_hmacsha256_sign
+isc_hmacsha256_update
+isc_hmacsha256_verify
+isc_hmacsha384_init
+isc_hmacsha384_invalidate
+isc_hmacsha384_sign
+isc_hmacsha384_update
+isc_hmacsha384_verify
+isc_hmacsha512_init
+isc_hmacsha512_invalidate
+isc_hmacsha512_sign
+isc_hmacsha512_update
+isc_hmacsha512_verify
+isc_httpdmgr_addurl
+isc_httpdmgr_create
+isc_httpdmgr_shutdown
+isc_interfaceiter_create
+isc_interfaceiter_current
+isc_interfaceiter_destroy
+isc_interfaceiter_first
+isc_interfaceiter_next
+isc_interval_iszero
+isc_interval_set
+isc_iterated_hash
+isc_keyboard_canceled
+isc_keyboard_close
+isc_keyboard_getchar
+isc_keyboard_open
+isc_lex_close
+isc_lex_create
+isc_lex_destroy
+isc_lex_getcomments
+isc_lex_getlasttokentext
+isc_lex_getmastertoken
+isc_lex_getoctaltoken
+isc_lex_getsourceline
+isc_lex_getsourcename
+isc_lex_getspecials
+isc_lex_gettoken
+isc_lex_isfile
+isc_lex_openbuffer
+isc_lex_openfile
+isc_lex_openstream
+isc_lex_setcomments
+isc_lex_setspecials
+isc_lex_ungettoken
+isc_lfsr_generate
+isc_lfsr_generate32
+isc_lfsr_init
+isc_lfsr_skip
+isc_lib_initmsgcat
+isc_log_categorybyname
+isc_log_closefilelogs
+isc_log_create
+isc_log_createchannel
+isc_log_destroy
+isc_log_getdebuglevel
+isc_log_getduplicateinterval
+isc_log_gettag
+isc_log_ivwrite
+isc_log_ivwrite1
+isc_log_iwrite
+isc_log_iwrite1
+isc_log_modulebyname
+isc_log_opensyslog
+isc_log_registercategories
+isc_log_registermodules
+isc_log_setcontext
+isc_log_setdebuglevel
+isc_log_setduplicateinterval
+isc_log_settag
+isc_log_usechannel
+isc_log_vwrite
+isc_log_vwrite1
+isc_log_wouldlog
+isc_log_write
+isc_log_write1
+isc_logconfig_create
+isc_logconfig_destroy
+isc_logconfig_get
+isc_logconfig_use
+isc_md5_final
+isc_md5_init
+isc_md5_invalidate
+isc_md5_update
+isc_mem_renderxml
+isc_msgcat_close
+isc_msgcat_get
+isc_msgcat_open
+isc_mutexblock_destroy
+isc_mutexblock_init
+isc_net_aton
+isc_net_disableipv4
+isc_net_disableipv6
+isc_net_getudpportrange
+isc_net_ntop
+isc_net_probe_ipv6only
+isc_net_probe_ipv6pktinfo
+isc_net_probeipv4
+isc_net_probeipv6
+isc_net_probeunix
+isc_net_pton
+isc_netaddr_any
+isc_netaddr_any6
+isc_netaddr_eqprefix
+isc_netaddr_equal
+isc_netaddr_format
+isc_netaddr_fromin
+isc_netaddr_fromin6
+isc_netaddr_frompath
+isc_netaddr_fromsockaddr
+isc_netaddr_fromv4mapped
+isc_netaddr_getzone
+isc_netaddr_ismulticast
+isc_netaddr_masktoprefixlen
+isc_netaddr_prefixok
+isc_netaddr_setzone
+isc_netaddr_totext
+isc_netscope_pton
+isc_ntpaths_get
+isc_ntpaths_init
+isc_once_do
+isc_ondestroy_init
+isc_ondestroy_notify
+isc_ondestroy_register
+isc_os_ncpus
+isc_parse_uint16
+isc_parse_uint32
+isc_parse_uint8
+isc_portset_add
+isc_portset_addrange
+isc_portset_create
+isc_portset_destroy
+isc_portset_isset
+isc_portset_nports
+isc_portset_remove
+isc_portset_removerange
+isc_quota_attach
+isc_quota_destroy
+isc_quota_detach
+isc_quota_init
+isc_quota_max
+isc_quota_release
+isc_quota_reserve
+isc_quota_soft
+isc_radix_create
+isc_radix_destroy
+isc_radix_insert
+isc_radix_process
+isc_radix_remove
+isc_radix_search
+isc_random_get
+isc_random_jitter
+isc_random_seed
+isc_ratelimiter_attach
+isc_ratelimiter_create
+isc_ratelimiter_detach
+isc_ratelimiter_enqueue
+isc_ratelimiter_setinterval
+isc_ratelimiter_setpertic
+isc_ratelimiter_shutdown
+isc_refcount_init
+isc_region_compare
+isc_resource_getcurlimit
+isc_resource_getlimit
+isc_resource_setlimit
+isc_result_register
+isc_result_totext
+isc_rwlock_destroy
+isc_rwlock_downgrade
+isc_rwlock_init
+isc_rwlock_lock
+isc_rwlock_trylock
+isc_rwlock_tryupgrade
+isc_rwlock_unlock
+isc_serial_eq
+isc_serial_ge
+isc_serial_gt
+isc_serial_le
+isc_serial_lt
+isc_serial_ne
+isc_sha1_final
+isc_sha1_init
+isc_sha1_invalidate
+isc_sha1_update
+isc_sha224_final
+isc_sha224_init
+isc_sha224_invalidate
+isc_sha224_update
+isc_sha256_data
+isc_sha256_final
+isc_sha256_init
+isc_sha256_invalidate
+isc_sha256_update
+isc_sha384_final
+isc_sha384_init
+isc_sha384_invalidate
+isc_sha384_update
+isc_sha512_final
+isc_sha512_init
+isc_sha512_invalidate
+isc_sha512_update
+isc_sockaddr_any
+isc_sockaddr_any6
+isc_sockaddr_anyofpf
+isc_sockaddr_compare
+isc_sockaddr_eqaddr
+isc_sockaddr_eqaddrprefix
+isc_sockaddr_equal
+isc_sockaddr_format
+isc_sockaddr_fromin
+isc_sockaddr_fromin6
+isc_sockaddr_fromnetaddr
+isc_sockaddr_frompath
+isc_sockaddr_getport
+isc_sockaddr_hash
+isc_sockaddr_isexperimental
+isc_sockaddr_ismulticast
+isc_sockaddr_pf
+isc_sockaddr_setport
+isc_sockaddr_totext
+isc_sockaddr_v6fromin
+isc_socketmgr_renderxml
+isc_stats_attach
+isc_stats_create
+isc_stats_decrement
+isc_stats_detach
+isc_stats_dump
+isc_stats_increment
+isc_stats_ncounters
+isc_stdio_close
+isc_stdio_flush
+isc_stdio_open
+isc_stdio_read
+isc_stdio_seek
+isc_stdio_sync
+isc_stdio_write
+isc_stdtime_get
+isc_string_append
+isc_string_append_truncate
+isc_string_copy
+isc_string_copy_truncate
+isc_string_printf
+isc_string_printf_truncate
+isc_string_regiondup
+isc_string_separate
+isc_string_strlcat
+isc_string_strlcpy
+isc_string_touint64
+isc_symtab_create
+isc_symtab_define
+isc_symtab_destroy
+isc_symtab_lookup
+isc_symtab_undefine
+isc_syslog_facilityfromstring
+isc_taskmgr_renderxml
+isc_taskpool_create
+isc_taskpool_destroy
+isc_taskpool_expand
+isc_taskpool_gettask
+isc_taskpool_setprivilege
+isc_taskpool_size
+isc_thread_create
+isc_thread_join
+isc_thread_key_create
+isc_thread_key_delete
+isc_thread_key_getspecific
+isc_thread_key_setspecific
+isc_thread_setconcurrency
+isc_time_add
+isc_time_compare
+isc_time_formatISO8601
+isc_time_formattimestamp
+isc_time_isepoch
+isc_time_microdiff
+isc_time_nanoseconds
+isc_time_now
+isc_time_nowplusinterval
+isc_time_seconds
+isc_time_set
+isc_time_settoepoch
+isc_time_subtract
+isc_win32os_majorversion
+isc_win32os_minorversion
+isc_win32os_servicepackmajor
+isc_win32os_servicepackminor
+isc_win32os_versioncheck
+openlog
+syslog
+
+; Exported Data
+
+EXPORTS
+
+isc_commandline_argument DATA
+isc_commandline_errprint DATA
+isc_commandline_index DATA
+isc_commandline_option DATA
+isc_commandline_progname DATA
+isc_commandline_reset DATA
+isc_mem_debugging DATA
+
diff --git a/lib/isc/win32/libisc.dsp b/lib/isc/win32/libisc.dsp
new file mode 100644
index 0000000..8e4441c
--- /dev/null
+++ b/lib/isc/win32/libisc.dsp
@@ -0,0 +1,802 @@
+# Microsoft Developer Studio Project File - Name="libisc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=libisc - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libisc.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libisc.mak" CFG="libisc - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libisc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libisc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "BIND9" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "../../../" /I "../../../../libxml2-2.7.3/include" /I "include" /I "../include" /I "../noatomic/include" /I "win32" /I "../../isccfg/include" /D "BIND9" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 ../../../../libxml2-2.7.3/win32/bin.msvc/libxml2.lib
+# ADD LINK32 user32.lib advapi32.lib ws2_32.lib /nologo /dll /machine:I386 /out:"../../../Build/Release/libisc.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "BIND9" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "./" /I "../../../" /I "../../../../libxml2-2.7.3/include" /I "include" /I "../include" /I "../noatomic/include" /I "win32" /I "../../isccfg/include" /D "BIND9" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__STDC__" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ../../../../libxml2-2.7.3/win32/bin.msvc/libxml2.lib
+# ADD LINK32 user32.lib advapi32.lib ws2_32.lib /nologo /dll /map /debug /machine:I386 /out:"../../../Build/Debug/libisc.dll" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "libisc - Win32 Release"
+# Name "libisc - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\app.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\condition.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\dir.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\DLLMain.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\entropy.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\errno2result.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\fsaccess.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\interfaceiter.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ipv6.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\iterated_hash.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\keyboard.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\net.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ntpaths.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\once.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\socket.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strerror.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\stdio.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\stdtime.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\syslog.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\thread.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\time.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\version.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\include\isc\app.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\assertions.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\backtrace.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\backtrace-emptytbl.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\base32.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\base64.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\bind_registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\bindevt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\bitstring.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\boolean.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\buffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\bufferlist.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\commandline.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\condition.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\dir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\entropy.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\errno2result.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\error.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\event.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\eventclass.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\file.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\formatcheck.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\fsaccess.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\hash.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\heap.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\hex.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\hmacmd5.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\hmacsha.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\httpd.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\int.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\interfaceiter.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\ipv6.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\iterated_hash.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\keyboard.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\lang.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\lex.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\lfsr.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\lib.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\list.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\log.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\magic.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\md5.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\mem.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\msgcat.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\msioctl.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\mutex.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\mutexblock.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\net.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\netaddr.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\netscope.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\netdb.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\ntpaths.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\offset.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\once.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\ondestroy.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\parseint.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\portset.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\os.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\platform.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\print.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\quota.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\radix.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\random.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\ratelimiter.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\refcount.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\region.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\result.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\resultclass.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\rwlock.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\serial.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\sha1.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\sha2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\sockaddr.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\socket.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\stats.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\stdio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\strerror.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\stdtime.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\string.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\symtab.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\syslog.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\syslog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\task.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\taskpool.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\thread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\time.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\timer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\isc\win32os.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\types.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\unistd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\isc\util.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\versions.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Group "Main Isc Lib"
+
+# PROP Default_Filter "c"
+# Begin Source File
+
+SOURCE=..\assertions.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\backtrace.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\backtrace-emptytbl.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\base32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\base64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\bitstring.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\buffer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\bufferlist.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\commandline.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\error.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\event.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\heap.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hmacmd5.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hmacsha.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\httpd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\inet_aton.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\inet_ntop.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\inet_pton.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lfsr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\md5.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mem.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\nls\msgcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mutexblock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\netaddr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\netscope.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ondestroy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\parseint.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\portset.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\quota.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\radix.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\random.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ratelimiter.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\refcount.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\result.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\rwlock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\serial.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sha1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sha2.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sockaddr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\stats.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\string.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\symtab.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\task.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\taskpool.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\timer.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\win32os.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\noatomic\include\atomic.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\libisc.def
+# End Source File
+# End Target
+# End Project
diff --git a/lib/isc/win32/libisc.dsw b/lib/isc/win32/libisc.dsw
new file mode 100644
index 0000000..c66c56e
--- /dev/null
+++ b/lib/isc/win32/libisc.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "libisc"=".\libisc.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/lib/isc/win32/libisc.mak b/lib/isc/win32/libisc.mak
new file mode 100644
index 0000000..e15b46b
--- /dev/null
+++ b/lib/isc/win32/libisc.mak
@@ -0,0 +1,2055 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on libisc.dsp
+!IF "$(CFG)" == ""
+CFG=libisc - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to libisc - Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "libisc - Win32 Release" && "$(CFG)" != "libisc - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libisc.mak" CFG="libisc - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libisc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libisc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+LIBXML=../../../../libxml2-2.7.3/win32/bin.msvc/libxml2.lib
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+_VC_MANIFEST_INC=0
+_VC_MANIFEST_BASENAME=__VC80
+!ELSE
+_VC_MANIFEST_INC=1
+_VC_MANIFEST_BASENAME=__VC80.Debug
+!ENDIF
+
+####################################################
+# Specifying name of temporary resource file used only in incremental builds:
+
+!if "$(_VC_MANIFEST_INC)" == "1"
+_VC_MANIFEST_AUTO_RES=$(_VC_MANIFEST_BASENAME).auto.res
+!else
+_VC_MANIFEST_AUTO_RES=
+!endif
+
+####################################################
+# _VC_MANIFEST_EMBED_EXE - command to embed manifest in EXE:
+
+!if "$(_VC_MANIFEST_INC)" == "1"
+
+#MT_SPECIAL_RETURN=1090650113
+#MT_SPECIAL_SWITCH=-notify_resource_update
+MT_SPECIAL_RETURN=0
+MT_SPECIAL_SWITCH=
+_VC_MANIFEST_EMBED_EXE= \
+if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \
+if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \
+rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \
+link $** /out:$@ $(LFLAGS)
+
+!else
+
+_VC_MANIFEST_EMBED_EXE= \
+if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
+
+!endif
+
+####################################################
+# _VC_MANIFEST_EMBED_DLL - command to embed manifest in DLL:
+
+!if "$(_VC_MANIFEST_INC)" == "1"
+
+#MT_SPECIAL_RETURN=1090650113
+#MT_SPECIAL_SWITCH=-notify_resource_update
+MT_SPECIAL_RETURN=0
+MT_SPECIAL_SWITCH=
+_VC_MANIFEST_EMBED_EXE= \
+if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \
+if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \
+rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \
+link $** /out:$@ $(LFLAGS)
+
+!else
+
+_VC_MANIFEST_EMBED_EXE= \
+if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;2
+
+!endif
+####################################################
+# _VC_MANIFEST_CLEAN - command to clean resources files generated temporarily:
+
+!if "$(_VC_MANIFEST_INC)" == "1"
+
+_VC_MANIFEST_CLEAN=-del $(_VC_MANIFEST_BASENAME).auto.res \
+ $(_VC_MANIFEST_BASENAME).auto.rc \
+ $(_VC_MANIFEST_BASENAME).auto.manifest
+
+!else
+
+_VC_MANIFEST_CLEAN=
+
+!endif
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+
+ALL : "..\..\..\Build\Release\libisc.dll"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\app.obj"
+ -@erase "$(INTDIR)\assertions.obj"
+ -@erase "$(INTDIR)\backtrace.obj"
+ -@erase "$(INTDIR)\backtrace-emptytbl.obj"
+ -@erase "$(INTDIR)\base32.obj"
+ -@erase "$(INTDIR)\base64.obj"
+ -@erase "$(INTDIR)\bitstring.obj"
+ -@erase "$(INTDIR)\buffer.obj"
+ -@erase "$(INTDIR)\bufferlist.obj"
+ -@erase "$(INTDIR)\commandline.obj"
+ -@erase "$(INTDIR)\condition.obj"
+ -@erase "$(INTDIR)\dir.obj"
+ -@erase "$(INTDIR)\DLLMain.obj"
+ -@erase "$(INTDIR)\entropy.obj"
+ -@erase "$(INTDIR)\errno2result.obj"
+ -@erase "$(INTDIR)\error.obj"
+ -@erase "$(INTDIR)\event.obj"
+ -@erase "$(INTDIR)\file.obj"
+ -@erase "$(INTDIR)\fsaccess.obj"
+ -@erase "$(INTDIR)\hash.obj"
+ -@erase "$(INTDIR)\heap.obj"
+ -@erase "$(INTDIR)\hex.obj"
+ -@erase "$(INTDIR)\hmacmd5.obj"
+ -@erase "$(INTDIR)\hmacsha.obj"
+ -@erase "$(INTDIR)\httpd.obj"
+ -@erase "$(INTDIR)\inet_aton.obj"
+ -@erase "$(INTDIR)\inet_ntop.obj"
+ -@erase "$(INTDIR)\inet_pton.obj"
+ -@erase "$(INTDIR)\interfaceiter.obj"
+ -@erase "$(INTDIR)\ipv6.obj"
+ -@erase "$(INTDIR)\iterated_hash.obj"
+ -@erase "$(INTDIR)\keyboard.obj"
+ -@erase "$(INTDIR)\lex.obj"
+ -@erase "$(INTDIR)\lfsr.obj"
+ -@erase "$(INTDIR)\lib.obj"
+ -@erase "$(INTDIR)\log.obj"
+ -@erase "$(INTDIR)\md5.obj"
+ -@erase "$(INTDIR)\mem.obj"
+ -@erase "$(INTDIR)\msgcat.obj"
+ -@erase "$(INTDIR)\mutexblock.obj"
+ -@erase "$(INTDIR)\net.obj"
+ -@erase "$(INTDIR)\netaddr.obj"
+ -@erase "$(INTDIR)\netscope.obj"
+ -@erase "$(INTDIR)\ntpaths.obj"
+ -@erase "$(INTDIR)\once.obj"
+ -@erase "$(INTDIR)\ondestroy.obj"
+ -@erase "$(INTDIR)\os.obj"
+ -@erase "$(INTDIR)\parseint.obj"
+ -@erase "$(INTDIR)\portset.obj"
+ -@erase "$(INTDIR)\quota.obj"
+ -@erase "$(INTDIR)\radix.obj"
+ -@erase "$(INTDIR)\random.obj"
+ -@erase "$(INTDIR)\ratelimiter.obj"
+ -@erase "$(INTDIR)\refcount.obj"
+ -@erase "$(INTDIR)\region.obj"
+ -@erase "$(INTDIR)\resource.obj"
+ -@erase "$(INTDIR)\result.obj"
+ -@erase "$(INTDIR)\rwlock.obj"
+ -@erase "$(INTDIR)\serial.obj"
+ -@erase "$(INTDIR)\sha1.obj"
+ -@erase "$(INTDIR)\sha2.obj"
+ -@erase "$(INTDIR)\sockaddr.obj"
+ -@erase "$(INTDIR)\socket.obj"
+ -@erase "$(INTDIR)\stats.obj"
+ -@erase "$(INTDIR)\stdio.obj"
+ -@erase "$(INTDIR)\stdtime.obj"
+ -@erase "$(INTDIR)\strerror.obj"
+ -@erase "$(INTDIR)\string.obj"
+ -@erase "$(INTDIR)\symtab.obj"
+ -@erase "$(INTDIR)\syslog.obj"
+ -@erase "$(INTDIR)\task.obj"
+ -@erase "$(INTDIR)\taskpool.obj"
+ -@erase "$(INTDIR)\thread.obj"
+ -@erase "$(INTDIR)\time.obj"
+ -@erase "$(INTDIR)\timer.obj"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\version.obj"
+ -@erase "$(INTDIR)\win32os.obj"
+ -@erase "$(OUTDIR)\libisc.exp"
+ -@erase "$(OUTDIR)\libisc.lib"
+ -@erase "..\..\..\Build\Release\libisc.dll"
+ -@$(_VC_MANIFEST_CLEAN)
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "./" /I "../../../" /I "include" /I "../include" /I "../../../lib/isc/noatomic/include" /I "win32" /I "../../isccfg/include" /I "../../../../libxml2-2.7.3/include" /D "BIND9" /D "WIN32" /D "NDEBUG" /D "__STDC__" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /Fp"$(INTDIR)\libisc.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\libisc.bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=user32.lib advapi32.lib ws2_32.lib $(LIBXML) /nologo /dll /incremental:no /pdb:"$(OUTDIR)\libisc.pdb" /machine:I386 /def:".\libisc.def" /out:"../../../Build/Release/libisc.dll" /implib:"$(OUTDIR)\libisc.lib"
+DEF_FILE= \
+ ".\libisc.def"
+LINK32_OBJS= \
+ "$(INTDIR)\app.obj" \
+ "$(INTDIR)\condition.obj" \
+ "$(INTDIR)\dir.obj" \
+ "$(INTDIR)\DLLMain.obj" \
+ "$(INTDIR)\entropy.obj" \
+ "$(INTDIR)\errno2result.obj" \
+ "$(INTDIR)\file.obj" \
+ "$(INTDIR)\fsaccess.obj" \
+ "$(INTDIR)\interfaceiter.obj" \
+ "$(INTDIR)\ipv6.obj" \
+ "$(INTDIR)\iterated_hash.obj" \
+ "$(INTDIR)\keyboard.obj" \
+ "$(INTDIR)\net.obj" \
+ "$(INTDIR)\ntpaths.obj" \
+ "$(INTDIR)\once.obj" \
+ "$(INTDIR)\os.obj" \
+ "$(INTDIR)\resource.obj" \
+ "$(INTDIR)\socket.obj" \
+ "$(INTDIR)\stdio.obj" \
+ "$(INTDIR)\stdtime.obj" \
+ "$(INTDIR)\strerror.obj" \
+ "$(INTDIR)\syslog.obj" \
+ "$(INTDIR)\thread.obj" \
+ "$(INTDIR)\time.obj" \
+ "$(INTDIR)\version.obj" \
+ "$(INTDIR)\win32os.obj" \
+ "$(INTDIR)\assertions.obj" \
+ "$(INTDIR)\backtrace.obj" \
+ "$(INTDIR)\backtrace-emptytbl.obj" \
+ "$(INTDIR)\base32.obj" \
+ "$(INTDIR)\base64.obj" \
+ "$(INTDIR)\bitstring.obj" \
+ "$(INTDIR)\buffer.obj" \
+ "$(INTDIR)\bufferlist.obj" \
+ "$(INTDIR)\commandline.obj" \
+ "$(INTDIR)\error.obj" \
+ "$(INTDIR)\event.obj" \
+ "$(INTDIR)\hash.obj" \
+ "$(INTDIR)\heap.obj" \
+ "$(INTDIR)\hex.obj" \
+ "$(INTDIR)\hmacmd5.obj" \
+ "$(INTDIR)\hmacsha.obj" \
+ "$(INTDIR)\httpd.obj" \
+ "$(INTDIR)\inet_aton.obj" \
+ "$(INTDIR)\inet_ntop.obj" \
+ "$(INTDIR)\inet_pton.obj" \
+ "$(INTDIR)\lex.obj" \
+ "$(INTDIR)\lfsr.obj" \
+ "$(INTDIR)\lib.obj" \
+ "$(INTDIR)\log.obj" \
+ "$(INTDIR)\md5.obj" \
+ "$(INTDIR)\mem.obj" \
+ "$(INTDIR)\msgcat.obj" \
+ "$(INTDIR)\mutexblock.obj" \
+ "$(INTDIR)\netaddr.obj" \
+ "$(INTDIR)\netscope.obj" \
+ "$(INTDIR)\ondestroy.obj" \
+ "$(INTDIR)\quota.obj" \
+ "$(INTDIR)\radix.obj" \
+ "$(INTDIR)\random.obj" \
+ "$(INTDIR)\ratelimiter.obj" \
+ "$(INTDIR)\refcount.obj" \
+ "$(INTDIR)\result.obj" \
+ "$(INTDIR)\rwlock.obj" \
+ "$(INTDIR)\serial.obj" \
+ "$(INTDIR)\sha1.obj" \
+ "$(INTDIR)\sha2.obj" \
+ "$(INTDIR)\sockaddr.obj" \
+ "$(INTDIR)\stats.obj" \
+ "$(INTDIR)\string.obj" \
+ "$(INTDIR)\symtab.obj" \
+ "$(INTDIR)\task.obj" \
+ "$(INTDIR)\taskpool.obj" \
+ "$(INTDIR)\timer.obj" \
+ "$(INTDIR)\parseint.obj" \
+ "$(INTDIR)\portset.obj" \
+ "$(INTDIR)\region.obj"
+
+"..\..\..\Build\Release\libisc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ $(_VC_MANIFEST_EMBED_DLL)
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "..\..\..\Build\Debug\libisc.dll" "$(OUTDIR)\libisc.bsc"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\app.obj"
+ -@erase "$(INTDIR)\app.sbr"
+ -@erase "$(INTDIR)\assertions.obj"
+ -@erase "$(INTDIR)\assertions.sbr"
+ -@erase "$(INTDIR)\backtrace.obj"
+ -@erase "$(INTDIR)\backtrace-emptytbl.obj"
+ -@erase "$(INTDIR)\backtrace.sbr"
+ -@erase "$(INTDIR)\backtrace-emptytbl.sbr"
+ -@erase "$(INTDIR)\base32.obj"
+ -@erase "$(INTDIR)\base32.sbr"
+ -@erase "$(INTDIR)\base64.obj"
+ -@erase "$(INTDIR)\base64.sbr"
+ -@erase "$(INTDIR)\bitstring.obj"
+ -@erase "$(INTDIR)\bitstring.sbr"
+ -@erase "$(INTDIR)\buffer.obj"
+ -@erase "$(INTDIR)\buffer.sbr"
+ -@erase "$(INTDIR)\bufferlist.obj"
+ -@erase "$(INTDIR)\bufferlist.sbr"
+ -@erase "$(INTDIR)\commandline.obj"
+ -@erase "$(INTDIR)\commandline.sbr"
+ -@erase "$(INTDIR)\condition.obj"
+ -@erase "$(INTDIR)\condition.sbr"
+ -@erase "$(INTDIR)\dir.obj"
+ -@erase "$(INTDIR)\dir.sbr"
+ -@erase "$(INTDIR)\DLLMain.obj"
+ -@erase "$(INTDIR)\DLLMain.sbr"
+ -@erase "$(INTDIR)\entropy.obj"
+ -@erase "$(INTDIR)\entropy.sbr"
+ -@erase "$(INTDIR)\errno2result.obj"
+ -@erase "$(INTDIR)\errno2result.sbr"
+ -@erase "$(INTDIR)\error.obj"
+ -@erase "$(INTDIR)\error.sbr"
+ -@erase "$(INTDIR)\event.obj"
+ -@erase "$(INTDIR)\event.sbr"
+ -@erase "$(INTDIR)\file.obj"
+ -@erase "$(INTDIR)\file.sbr"
+ -@erase "$(INTDIR)\fsaccess.obj"
+ -@erase "$(INTDIR)\fsaccess.sbr"
+ -@erase "$(INTDIR)\hash.obj"
+ -@erase "$(INTDIR)\hash.sbr"
+ -@erase "$(INTDIR)\heap.obj"
+ -@erase "$(INTDIR)\heap.sbr"
+ -@erase "$(INTDIR)\hex.obj"
+ -@erase "$(INTDIR)\hex.sbr"
+ -@erase "$(INTDIR)\hmacmd5.obj"
+ -@erase "$(INTDIR)\hmacmd5.sbr"
+ -@erase "$(INTDIR)\hmacsha.obj"
+ -@erase "$(INTDIR)\hmacsha.sbr"
+ -@erase "$(INTDIR)\httpd.obj"
+ -@erase "$(INTDIR)\httpd.sbr"
+ -@erase "$(INTDIR)\inet_aton.obj"
+ -@erase "$(INTDIR)\inet_aton.sbr"
+ -@erase "$(INTDIR)\inet_ntop.obj"
+ -@erase "$(INTDIR)\inet_ntop.sbr"
+ -@erase "$(INTDIR)\inet_pton.obj"
+ -@erase "$(INTDIR)\inet_pton.sbr"
+ -@erase "$(INTDIR)\interfaceiter.obj"
+ -@erase "$(INTDIR)\interfaceiter.sbr"
+ -@erase "$(INTDIR)\ipv6.obj"
+ -@erase "$(INTDIR)\ipv6.sbr"
+ -@erase "$(INTDIR)\iterated_hash.obj"
+ -@erase "$(INTDIR)\iterated_hash.sbr"
+ -@erase "$(INTDIR)\keyboard.obj"
+ -@erase "$(INTDIR)\keyboard.sbr"
+ -@erase "$(INTDIR)\lex.obj"
+ -@erase "$(INTDIR)\lex.sbr"
+ -@erase "$(INTDIR)\lfsr.obj"
+ -@erase "$(INTDIR)\lfsr.sbr"
+ -@erase "$(INTDIR)\lib.obj"
+ -@erase "$(INTDIR)\lib.sbr"
+ -@erase "$(INTDIR)\log.obj"
+ -@erase "$(INTDIR)\log.sbr"
+ -@erase "$(INTDIR)\md5.obj"
+ -@erase "$(INTDIR)\md5.sbr"
+ -@erase "$(INTDIR)\mem.obj"
+ -@erase "$(INTDIR)\mem.sbr"
+ -@erase "$(INTDIR)\msgcat.obj"
+ -@erase "$(INTDIR)\msgcat.sbr"
+ -@erase "$(INTDIR)\mutexblock.obj"
+ -@erase "$(INTDIR)\mutexblock.sbr"
+ -@erase "$(INTDIR)\net.obj"
+ -@erase "$(INTDIR)\net.sbr"
+ -@erase "$(INTDIR)\netaddr.obj"
+ -@erase "$(INTDIR)\netaddr.sbr"
+ -@erase "$(INTDIR)\netscope.obj"
+ -@erase "$(INTDIR)\netscope.sbr"
+ -@erase "$(INTDIR)\ntpaths.obj"
+ -@erase "$(INTDIR)\ntpaths.sbr"
+ -@erase "$(INTDIR)\once.obj"
+ -@erase "$(INTDIR)\once.sbr"
+ -@erase "$(INTDIR)\ondestroy.obj"
+ -@erase "$(INTDIR)\ondestroy.sbr"
+ -@erase "$(INTDIR)\os.obj"
+ -@erase "$(INTDIR)\os.sbr"
+ -@erase "$(INTDIR)\parseint.obj"
+ -@erase "$(INTDIR)\parseint.sbr"
+ -@erase "$(INTDIR)\portset.obj"
+ -@erase "$(INTDIR)\portset.sbr"
+ -@erase "$(INTDIR)\quota.obj"
+ -@erase "$(INTDIR)\quota.sbr"
+ -@erase "$(INTDIR)\radix.obj"
+ -@erase "$(INTDIR)\radix.sbr"
+ -@erase "$(INTDIR)\random.obj"
+ -@erase "$(INTDIR)\random.sbr"
+ -@erase "$(INTDIR)\ratelimiter.obj"
+ -@erase "$(INTDIR)\ratelimiter.sbr"
+ -@erase "$(INTDIR)\refcount.obj"
+ -@erase "$(INTDIR)\refcount.sbr"
+ -@erase "$(INTDIR)\region.obj"
+ -@erase "$(INTDIR)\region.sbr"
+ -@erase "$(INTDIR)\resource.obj"
+ -@erase "$(INTDIR)\resource.sbr"
+ -@erase "$(INTDIR)\result.obj"
+ -@erase "$(INTDIR)\result.sbr"
+ -@erase "$(INTDIR)\rwlock.obj"
+ -@erase "$(INTDIR)\rwlock.sbr"
+ -@erase "$(INTDIR)\serial.obj"
+ -@erase "$(INTDIR)\serial.sbr"
+ -@erase "$(INTDIR)\sha1.obj"
+ -@erase "$(INTDIR)\sha1.sbr"
+ -@erase "$(INTDIR)\sha2.obj"
+ -@erase "$(INTDIR)\sha2.sbr"
+ -@erase "$(INTDIR)\sockaddr.obj"
+ -@erase "$(INTDIR)\sockaddr.sbr"
+ -@erase "$(INTDIR)\socket.obj"
+ -@erase "$(INTDIR)\socket.sbr"
+ -@erase "$(INTDIR)\stats.obj"
+ -@erase "$(INTDIR)\stats.sbr"
+ -@erase "$(INTDIR)\stdio.obj"
+ -@erase "$(INTDIR)\stdio.sbr"
+ -@erase "$(INTDIR)\stdtime.obj"
+ -@erase "$(INTDIR)\stdtime.sbr"
+ -@erase "$(INTDIR)\strerror.obj"
+ -@erase "$(INTDIR)\strerror.sbr"
+ -@erase "$(INTDIR)\string.obj"
+ -@erase "$(INTDIR)\string.sbr"
+ -@erase "$(INTDIR)\symtab.obj"
+ -@erase "$(INTDIR)\symtab.sbr"
+ -@erase "$(INTDIR)\syslog.obj"
+ -@erase "$(INTDIR)\syslog.sbr"
+ -@erase "$(INTDIR)\task.obj"
+ -@erase "$(INTDIR)\task.sbr"
+ -@erase "$(INTDIR)\taskpool.obj"
+ -@erase "$(INTDIR)\taskpool.sbr"
+ -@erase "$(INTDIR)\thread.obj"
+ -@erase "$(INTDIR)\thread.sbr"
+ -@erase "$(INTDIR)\time.obj"
+ -@erase "$(INTDIR)\time.sbr"
+ -@erase "$(INTDIR)\timer.obj"
+ -@erase "$(INTDIR)\timer.sbr"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(INTDIR)\version.obj"
+ -@erase "$(INTDIR)\version.sbr"
+ -@erase "$(INTDIR)\win32os.obj"
+ -@erase "$(INTDIR)\win32os.sbr"
+ -@erase "$(OUTDIR)\libisc.bsc"
+ -@erase "$(OUTDIR)\libisc.exp"
+ -@erase "$(OUTDIR)\libisc.lib"
+ -@erase "$(OUTDIR)\libisc.map"
+ -@erase "$(OUTDIR)\libisc.pdb"
+ -@erase "..\..\..\Build\Debug\libisc.dll"
+ -@erase "..\..\..\Build\Debug\libisc.ilk"
+ -@$(_VC_MANIFEST_CLEAN)
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "./" /I "../../../" /I "include" /I "../include" /I "../../../lib/isc/noatomic/include" /I "win32" /I "../../isccfg/include" /I "../../../../libxml2-2.7.3/include" /D "BIND9" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__STDC__" /D "_MBCS" /D "_USRDLL" /D "LIBISC_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\libisc.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\libisc.bsc"
+BSC32_SBRS= \
+ "$(INTDIR)\app.sbr" \
+ "$(INTDIR)\condition.sbr" \
+ "$(INTDIR)\dir.sbr" \
+ "$(INTDIR)\DLLMain.sbr" \
+ "$(INTDIR)\entropy.sbr" \
+ "$(INTDIR)\errno2result.sbr" \
+ "$(INTDIR)\file.sbr" \
+ "$(INTDIR)\fsaccess.sbr" \
+ "$(INTDIR)\interfaceiter.sbr" \
+ "$(INTDIR)\ipv6.sbr" \
+ "$(INTDIR)\iterated_hash.sbr" \
+ "$(INTDIR)\keyboard.sbr" \
+ "$(INTDIR)\net.sbr" \
+ "$(INTDIR)\ntpaths.sbr" \
+ "$(INTDIR)\once.sbr" \
+ "$(INTDIR)\os.sbr" \
+ "$(INTDIR)\resource.sbr" \
+ "$(INTDIR)\socket.sbr" \
+ "$(INTDIR)\stdio.sbr" \
+ "$(INTDIR)\stdtime.sbr" \
+ "$(INTDIR)\strerror.sbr" \
+ "$(INTDIR)\syslog.sbr" \
+ "$(INTDIR)\thread.sbr" \
+ "$(INTDIR)\time.sbr" \
+ "$(INTDIR)\version.sbr" \
+ "$(INTDIR)\win32os.sbr" \
+ "$(INTDIR)\assertions.sbr" \
+ "$(INTDIR)\backtrace.sbr" \
+ "$(INTDIR)\backtrace-emptytbl.sbr" \
+ "$(INTDIR)\base32.sbr" \
+ "$(INTDIR)\base64.sbr" \
+ "$(INTDIR)\bitstring.sbr" \
+ "$(INTDIR)\buffer.sbr" \
+ "$(INTDIR)\bufferlist.sbr" \
+ "$(INTDIR)\commandline.sbr" \
+ "$(INTDIR)\error.sbr" \
+ "$(INTDIR)\event.sbr" \
+ "$(INTDIR)\hash.sbr" \
+ "$(INTDIR)\heap.sbr" \
+ "$(INTDIR)\hex.sbr" \
+ "$(INTDIR)\hmacmd5.sbr" \
+ "$(INTDIR)\hmacsha.sbr" \
+ "$(INTDIR)\httpd.sbr" \
+ "$(INTDIR)\inet_aton.sbr" \
+ "$(INTDIR)\inet_ntop.sbr" \
+ "$(INTDIR)\inet_pton.sbr" \
+ "$(INTDIR)\lex.sbr" \
+ "$(INTDIR)\lfsr.sbr" \
+ "$(INTDIR)\lib.sbr" \
+ "$(INTDIR)\log.sbr" \
+ "$(INTDIR)\md5.sbr" \
+ "$(INTDIR)\mem.sbr" \
+ "$(INTDIR)\msgcat.sbr" \
+ "$(INTDIR)\mutexblock.sbr" \
+ "$(INTDIR)\netaddr.sbr" \
+ "$(INTDIR)\netscope.sbr" \
+ "$(INTDIR)\ondestroy.sbr" \
+ "$(INTDIR)\quota.sbr" \
+ "$(INTDIR)\radix.sbr" \
+ "$(INTDIR)\random.sbr" \
+ "$(INTDIR)\ratelimiter.sbr" \
+ "$(INTDIR)\refcount.sbr" \
+ "$(INTDIR)\result.sbr" \
+ "$(INTDIR)\rwlock.sbr" \
+ "$(INTDIR)\serial.sbr" \
+ "$(INTDIR)\sha1.sbr" \
+ "$(INTDIR)\sha2.sbr" \
+ "$(INTDIR)\sockaddr.sbr" \
+ "$(INTDIR)\stats.sbr" \
+ "$(INTDIR)\string.sbr" \
+ "$(INTDIR)\symtab.sbr" \
+ "$(INTDIR)\task.sbr" \
+ "$(INTDIR)\taskpool.sbr" \
+ "$(INTDIR)\timer.sbr" \
+ "$(INTDIR)\parseint.sbr" \
+ "$(INTDIR)\portset.sbr" \
+ "$(INTDIR)\region.sbr"
+
+"$(OUTDIR)\libisc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=user32.lib advapi32.lib ws2_32.lib $(LIBXML) /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\libisc.pdb" /map:"$(INTDIR)\libisc.map" /debug /machine:I386 /def:".\libisc.def" /out:"../../../Build/Debug/libisc.dll" /implib:"$(OUTDIR)\libisc.lib" /pdbtype:sept
+DEF_FILE= \
+ ".\libisc.def"
+LINK32_OBJS= \
+ "$(INTDIR)\app.obj" \
+ "$(INTDIR)\condition.obj" \
+ "$(INTDIR)\dir.obj" \
+ "$(INTDIR)\DLLMain.obj" \
+ "$(INTDIR)\entropy.obj" \
+ "$(INTDIR)\errno2result.obj" \
+ "$(INTDIR)\file.obj" \
+ "$(INTDIR)\fsaccess.obj" \
+ "$(INTDIR)\interfaceiter.obj" \
+ "$(INTDIR)\ipv6.obj" \
+ "$(INTDIR)\iterated_hash.obj" \
+ "$(INTDIR)\keyboard.obj" \
+ "$(INTDIR)\net.obj" \
+ "$(INTDIR)\ntpaths.obj" \
+ "$(INTDIR)\once.obj" \
+ "$(INTDIR)\os.obj" \
+ "$(INTDIR)\resource.obj" \
+ "$(INTDIR)\socket.obj" \
+ "$(INTDIR)\stdio.obj" \
+ "$(INTDIR)\stdtime.obj" \
+ "$(INTDIR)\strerror.obj" \
+ "$(INTDIR)\syslog.obj" \
+ "$(INTDIR)\thread.obj" \
+ "$(INTDIR)\time.obj" \
+ "$(INTDIR)\version.obj" \
+ "$(INTDIR)\win32os.obj" \
+ "$(INTDIR)\assertions.obj" \
+ "$(INTDIR)\backtrace.obj" \
+ "$(INTDIR)\backtrace-emptytbl.obj" \
+ "$(INTDIR)\base32.obj" \
+ "$(INTDIR)\base64.obj" \
+ "$(INTDIR)\bitstring.obj" \
+ "$(INTDIR)\buffer.obj" \
+ "$(INTDIR)\bufferlist.obj" \
+ "$(INTDIR)\commandline.obj" \
+ "$(INTDIR)\error.obj" \
+ "$(INTDIR)\event.obj" \
+ "$(INTDIR)\hash.obj" \
+ "$(INTDIR)\heap.obj" \
+ "$(INTDIR)\hex.obj" \
+ "$(INTDIR)\hmacmd5.obj" \
+ "$(INTDIR)\hmacsha.obj" \
+ "$(INTDIR)\httpd.obj" \
+ "$(INTDIR)\inet_aton.obj" \
+ "$(INTDIR)\inet_ntop.obj" \
+ "$(INTDIR)\inet_pton.obj" \
+ "$(INTDIR)\lex.obj" \
+ "$(INTDIR)\lfsr.obj" \
+ "$(INTDIR)\lib.obj" \
+ "$(INTDIR)\log.obj" \
+ "$(INTDIR)\md5.obj" \
+ "$(INTDIR)\mem.obj" \
+ "$(INTDIR)\msgcat.obj" \
+ "$(INTDIR)\mutexblock.obj" \
+ "$(INTDIR)\netaddr.obj" \
+ "$(INTDIR)\netscope.obj" \
+ "$(INTDIR)\ondestroy.obj" \
+ "$(INTDIR)\quota.obj" \
+ "$(INTDIR)\radix.obj" \
+ "$(INTDIR)\random.obj" \
+ "$(INTDIR)\ratelimiter.obj" \
+ "$(INTDIR)\refcount.obj" \
+ "$(INTDIR)\result.obj" \
+ "$(INTDIR)\rwlock.obj" \
+ "$(INTDIR)\serial.obj" \
+ "$(INTDIR)\sha1.obj" \
+ "$(INTDIR)\sha2.obj" \
+ "$(INTDIR)\sockaddr.obj" \
+ "$(INTDIR)\stats.obj" \
+ "$(INTDIR)\string.obj" \
+ "$(INTDIR)\symtab.obj" \
+ "$(INTDIR)\task.obj" \
+ "$(INTDIR)\taskpool.obj" \
+ "$(INTDIR)\timer.obj" \
+ "$(INTDIR)\parseint.obj" \
+ "$(INTDIR)\portset.obj" \
+ "$(INTDIR)\region.obj"
+
+"..\..\..\Build\Debug\libisc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+ $(_VC_MANIFEST_EMBED_DLL)
+
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("libisc.dep")
+!INCLUDE "libisc.dep"
+!ELSE
+!MESSAGE Warning: cannot find "libisc.dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(CFG)" == "libisc - Win32 Release" || "$(CFG)" == "libisc - Win32 Debug"
+SOURCE=.\app.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\app.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\app.obj" "$(INTDIR)\app.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\condition.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\condition.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\condition.obj" "$(INTDIR)\condition.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\dir.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\dir.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\dir.obj" "$(INTDIR)\dir.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\DLLMain.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\DLLMain.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\DLLMain.obj" "$(INTDIR)\DLLMain.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\entropy.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\entropy.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\entropy.obj" "$(INTDIR)\entropy.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\errno2result.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\errno2result.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\errno2result.obj" "$(INTDIR)\errno2result.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\file.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\file.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\file.obj" "$(INTDIR)\file.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\fsaccess.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\fsaccess.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\fsaccess.obj" "$(INTDIR)\fsaccess.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\interfaceiter.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\interfaceiter.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\interfaceiter.obj" "$(INTDIR)\interfaceiter.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\ipv6.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\ipv6.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\ipv6.obj" "$(INTDIR)\ipv6.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+
+SOURCE=.\keyboard.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\keyboard.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\keyboard.obj" "$(INTDIR)\keyboard.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\net.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\net.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\net.obj" "$(INTDIR)\net.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\ntpaths.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\ntpaths.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\ntpaths.obj" "$(INTDIR)\ntpaths.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\once.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\once.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\once.obj" "$(INTDIR)\once.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\os.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\os.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\os.obj" "$(INTDIR)\os.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\resource.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\resource.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\resource.obj" "$(INTDIR)\resource.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\socket.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\socket.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\socket.obj" "$(INTDIR)\socket.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\stdio.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\stdio.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\stdio.obj" "$(INTDIR)\stdio.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\stdtime.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\stdtime.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\stdtime.obj" "$(INTDIR)\stdtime.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\strerror.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\strerror.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\strerror.obj" "$(INTDIR)\strerror.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\syslog.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\syslog.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\syslog.obj" "$(INTDIR)\syslog.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\thread.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\thread.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\thread.obj" "$(INTDIR)\thread.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\time.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\time.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\time.obj" "$(INTDIR)\time.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\version.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\version.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\version.obj" "$(INTDIR)\version.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=.\win32os.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\win32os.obj" : $(SOURCE) "$(INTDIR)"
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\win32os.obj" "$(INTDIR)\win32os.sbr" : $(SOURCE) "$(INTDIR)"
+
+
+!ENDIF
+
+SOURCE=..\assertions.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\assertions.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\assertions.obj" "$(INTDIR)\assertions.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\backtrace.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\backtrace.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\backtrace.obj" "$(INTDIR)\backtrace.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\backtrace-emptytbl.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\backtrace-emptytbl.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\backtrace-emptytbl.obj" "$(INTDIR)\backtrace-emptytbl.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\base32.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\base32.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\base32.obj" "$(INTDIR)\base32.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\base64.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\base64.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\base64.obj" "$(INTDIR)\base64.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\bitstring.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\bitstring.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\bitstring.obj" "$(INTDIR)\bitstring.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\buffer.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\buffer.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\buffer.obj" "$(INTDIR)\buffer.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\bufferlist.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\bufferlist.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\bufferlist.obj" "$(INTDIR)\bufferlist.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\commandline.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\commandline.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\commandline.obj" "$(INTDIR)\commandline.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\error.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\error.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\error.obj" "$(INTDIR)\error.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\event.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\event.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\event.obj" "$(INTDIR)\event.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\hash.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\heap.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\heap.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\heap.obj" "$(INTDIR)\heap.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\hex.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\hex.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\hex.obj" "$(INTDIR)\hex.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\hmacmd5.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\hmacmd5.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\hmacmd5.obj" "$(INTDIR)\hmacmd5.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\hmacsha.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\hmacsha.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\hmacsha.obj" "$(INTDIR)\hmacsha.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\httpd.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\httpd.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\httpd.obj" "$(INTDIR)\httpd.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\inet_aton.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\inet_aton.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\inet_aton.obj" "$(INTDIR)\inet_aton.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\inet_ntop.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\inet_ntop.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\inet_ntop.obj" "$(INTDIR)\inet_ntop.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\inet_pton.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\inet_pton.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\inet_pton.obj" "$(INTDIR)\inet_pton.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\iterated_hash.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\iterated_hash.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\iterated_hash.obj" "$(INTDIR)\iterated_hash.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\lex.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\lex.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\lex.obj" "$(INTDIR)\lex.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\lfsr.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\lfsr.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\lfsr.obj" "$(INTDIR)\lfsr.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\lib.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\lib.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\lib.obj" "$(INTDIR)\lib.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\log.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\log.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\log.obj" "$(INTDIR)\log.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\md5.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\md5.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\md5.obj" "$(INTDIR)\md5.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\mem.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\mem.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\mem.obj" "$(INTDIR)\mem.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\nls\msgcat.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\msgcat.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\msgcat.obj" "$(INTDIR)\msgcat.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\mutexblock.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\mutexblock.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\mutexblock.obj" "$(INTDIR)\mutexblock.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\netaddr.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\netaddr.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\netaddr.obj" "$(INTDIR)\netaddr.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\netscope.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\netscope.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\netscope.obj" "$(INTDIR)\netscope.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\ondestroy.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\ondestroy.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\ondestroy.obj" "$(INTDIR)\ondestroy.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\parseint.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\parseint.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\parseint.obj" "$(INTDIR)\parseint.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\portset.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\portset.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\portset.obj" "$(INTDIR)\portset.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\quota.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\quota.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\quota.obj" "$(INTDIR)\quota.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\radix.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\radix.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\radix.obj" "$(INTDIR)\radix.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\random.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\random.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\random.obj" "$(INTDIR)\random.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\ratelimiter.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\ratelimiter.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\ratelimiter.obj" "$(INTDIR)\ratelimiter.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\refcount.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\refcount.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\refcount.obj" "$(INTDIR)\refcount.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\region.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\region.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\region.obj" "$(INTDIR)\region.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\result.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\result.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\result.obj" "$(INTDIR)\result.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\rwlock.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\rwlock.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\rwlock.obj" "$(INTDIR)\rwlock.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\serial.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\serial.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\serial.obj" "$(INTDIR)\serial.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\sha1.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\sha1.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\sha1.obj" "$(INTDIR)\sha1.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\sha2.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\sha2.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\sha2.obj" "$(INTDIR)\sha2.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\sockaddr.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\sockaddr.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\sockaddr.obj" "$(INTDIR)\sockaddr.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\stats.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\stats.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\stats.obj" "$(INTDIR)\stats.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\string.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\string.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\string.obj" "$(INTDIR)\string.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\symtab.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\symtab.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\symtab.obj" "$(INTDIR)\symtab.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\task.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\task.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\task.obj" "$(INTDIR)\task.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\taskpool.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\taskpool.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\taskpool.obj" "$(INTDIR)\taskpool.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\timer.c
+
+!IF "$(CFG)" == "libisc - Win32 Release"
+
+
+"$(INTDIR)\timer.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "libisc - Win32 Debug"
+
+
+"$(INTDIR)\timer.obj" "$(INTDIR)\timer.sbr" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+
+!ENDIF
+
+####################################################
+# Commands to generate initial empty manifest file and the RC file
+# that references it, and for generating the .res file:
+
+$(_VC_MANIFEST_BASENAME).auto.res : $(_VC_MANIFEST_BASENAME).auto.rc
+
+$(_VC_MANIFEST_BASENAME).auto.rc : $(_VC_MANIFEST_BASENAME).auto.manifest
+ type <<$@
+#include <winuser.h>
+1RT_MANIFEST"$(_VC_MANIFEST_BASENAME).auto.manifest"
+<< KEEP
+
+$(_VC_MANIFEST_BASENAME).auto.manifest :
+ type <<$@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+</assembly>
+<< KEEP
diff --git a/lib/isc/win32/net.c b/lib/isc/win32/net.c
new file mode 100644
index 0000000..12876da
--- /dev/null
+++ b/lib/isc/win32/net.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2004, 2005, 2007-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#include <config.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <isc/log.h>
+#include <isc/msgs.h>
+#include <isc/net.h>
+#include <isc/once.h>
+#include <isc/strerror.h>
+#include <isc/string.h>
+#include <isc/util.h>
+
+/*%
+ * Definitions about UDP port range specification. This is a total mess of
+ * portability variants: some use sysctl (but the sysctl names vary), some use
+ * system-specific interfaces, some have the same interface for IPv4 and IPv6,
+ * some separate them, etc...
+ */
+
+/*%
+ * The last resort defaults: use all non well known port space
+ */
+#ifndef ISC_NET_PORTRANGELOW
+#define ISC_NET_PORTRANGELOW 1024
+#endif /* ISC_NET_PORTRANGELOW */
+#ifndef ISC_NET_PORTRANGEHIGH
+#define ISC_NET_PORTRANGEHIGH 65535
+#endif /* ISC_NET_PORTRANGEHIGH */
+
+#if defined(ISC_PLATFORM_NEEDIN6ADDRANY)
+const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT;
+#endif
+
+#if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
+const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT;
+#endif
+
+
+static isc_once_t once = ISC_ONCE_INIT;
+static isc_once_t once_ipv6only = ISC_ONCE_INIT;
+static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT;
+static isc_result_t ipv4_result = ISC_R_NOTFOUND;
+static isc_result_t ipv6_result = ISC_R_NOTFOUND;
+static isc_result_t ipv6only_result = ISC_R_NOTFOUND;
+static isc_result_t ipv6pktinfo_result = ISC_R_NOTFOUND;
+
+void InitSockets(void);
+
+static isc_result_t
+try_proto(int domain) {
+ SOCKET s;
+ char strbuf[ISC_STRERRORSIZE];
+ int errval;
+
+ s = socket(domain, SOCK_STREAM, IPPROTO_TCP);
+ if (s == INVALID_SOCKET) {
+ errval = WSAGetLastError();
+ switch (errval) {
+ case WSAEAFNOSUPPORT:
+ case WSAEPROTONOSUPPORT:
+ case WSAEINVAL:
+ return (ISC_R_NOTFOUND);
+ default:
+ isc__strerror(errval, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+
+ closesocket(s);
+
+ return (ISC_R_SUCCESS);
+}
+
+static void
+initialize_action(void) {
+ InitSockets();
+ ipv4_result = try_proto(PF_INET);
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
+ ipv6_result = try_proto(PF_INET6);
+#endif
+#endif
+#endif
+}
+
+static void
+initialize(void) {
+ RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_net_probeipv4(void) {
+ initialize();
+ return (ipv4_result);
+}
+
+isc_result_t
+isc_net_probeipv6(void) {
+ initialize();
+ return (ipv6_result);
+}
+
+isc_result_t
+isc_net_probeunix(void) {
+ return (ISC_R_NOTFOUND);
+}
+
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+static void
+try_ipv6only(void) {
+#ifdef IPV6_V6ONLY
+ SOCKET s;
+ int on;
+ char strbuf[ISC_STRERRORSIZE];
+#endif
+ isc_result_t result;
+
+ result = isc_net_probeipv6();
+ if (result != ISC_R_SUCCESS) {
+ ipv6only_result = result;
+ return;
+ }
+
+#ifndef IPV6_V6ONLY
+ ipv6only_result = ISC_R_NOTFOUND;
+ return;
+#else
+ /* check for TCP sockets */
+ s = socket(PF_INET6, SOCK_STREAM, 0);
+ if (s == INVALID_SOCKET) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ ipv6only_result = ISC_R_UNEXPECTED;
+ return;
+ }
+
+ on = 1;
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&on,
+ sizeof(on)) < 0) {
+ ipv6only_result = ISC_R_NOTFOUND;
+ goto close;
+ }
+
+ closesocket(s);
+
+ /* check for UDP sockets */
+ s = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (s == INVALID_SOCKET) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ ipv6only_result = ISC_R_UNEXPECTED;
+ return;
+ }
+
+ on = 1;
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&on,
+ sizeof(on)) < 0) {
+ ipv6only_result = ISC_R_NOTFOUND;
+ goto close;
+ }
+
+ ipv6only_result = ISC_R_SUCCESS;
+
+close:
+ closesocket(s);
+ return;
+#endif /* IPV6_V6ONLY */
+}
+
+static void
+initialize_ipv6only(void) {
+ RUNTIME_CHECK(isc_once_do(&once_ipv6only,
+ try_ipv6only) == ISC_R_SUCCESS);
+}
+
+static void
+try_ipv6pktinfo(void) {
+ int s, on;
+ char strbuf[ISC_STRERRORSIZE];
+ isc_result_t result;
+ int optname;
+
+ result = isc_net_probeipv6();
+ if (result != ISC_R_SUCCESS) {
+ ipv6pktinfo_result = result;
+ return;
+ }
+
+ /* we only use this for UDP sockets */
+ s = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+ if (s == INVALID_SOCKET) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ ipv6pktinfo_result = ISC_R_UNEXPECTED;
+ return;
+ }
+
+#ifdef IPV6_RECVPKTINFO
+ optname = IPV6_RECVPKTINFO;
+#else
+ optname = IPV6_PKTINFO;
+#endif
+ on = 1;
+ if (setsockopt(s, IPPROTO_IPV6, optname, (const char *) &on,
+ sizeof(on)) < 0) {
+ ipv6pktinfo_result = ISC_R_NOTFOUND;
+ goto close;
+ }
+
+ ipv6pktinfo_result = ISC_R_SUCCESS;
+
+close:
+ closesocket(s);
+ return;
+}
+
+static void
+initialize_ipv6pktinfo(void) {
+ RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo,
+ try_ipv6pktinfo) == ISC_R_SUCCESS);
+}
+#endif /* WANT_IPV6 */
+#endif /* ISC_PLATFORM_HAVEIPV6 */
+
+isc_result_t
+isc_net_probe_ipv6only(void) {
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+ initialize_ipv6only();
+#else
+ ipv6only_result = ISC_R_NOTFOUND;
+#endif
+#endif
+ return (ipv6only_result);
+}
+
+isc_result_t
+isc_net_probe_ipv6pktinfo(void) {
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef WANT_IPV6
+ initialize_ipv6pktinfo();
+#else
+ ipv6pktinfo_result = ISC_R_NOTFOUND;
+#endif
+#endif
+ return (ipv6pktinfo_result);
+}
+
+isc_result_t
+isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high) {
+ int result = ISC_R_FAILURE;
+
+ REQUIRE(low != NULL && high != NULL);
+
+ UNUSED(af);
+
+ if (result != ISC_R_SUCCESS) {
+ *low = ISC_NET_PORTRANGELOW;
+ *high = ISC_NET_PORTRANGEHIGH;
+ }
+
+ return (ISC_R_SUCCESS); /* we currently never fail in this function */
+}
+
+void
+isc_net_disableipv4(void) {
+ initialize();
+ if (ipv4_result == ISC_R_SUCCESS)
+ ipv4_result = ISC_R_DISABLED;
+}
+
+void
+isc_net_disableipv6(void) {
+ initialize();
+ if (ipv6_result == ISC_R_SUCCESS)
+ ipv6_result = ISC_R_DISABLED;
+}
+
+void
+isc_net_enableipv4(void) {
+ initialize();
+ if (ipv4_result == ISC_R_DISABLED)
+ ipv4_result = ISC_R_SUCCESS;
+}
+
+void
+isc_net_enableipv6(void) {
+ initialize();
+ if (ipv6_result == ISC_R_DISABLED)
+ ipv6_result = ISC_R_SUCCESS;
+}
diff --git a/lib/isc/win32/netdb.h b/lib/isc/win32/netdb.h
new file mode 100644
index 0000000..f8d936a
--- /dev/null
+++ b/lib/isc/win32/netdb.h
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2004, 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: netdb.h,v 1.9 2009/01/18 23:48:14 tbox Exp $ */
+
+#ifndef NETDB_H
+#define NETDB_H 1
+
+#include <stddef.h>
+#include <winsock2.h>
+
+/*
+ * Define if <netdb.h> does not declare struct addrinfo.
+ */
+
+struct addrinfo {
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ size_t ai_addrlen; /* Length of ai_addr */
+ char *ai_canonname; /* Canonical name for hostname */
+ struct sockaddr *ai_addr; /* Binary address */
+ struct addrinfo *ai_next; /* Next structure in linked list */
+};
+
+
+/*
+ * Undefine all \#defines we are interested in as <netdb.h> may or may not have
+ * defined them.
+ */
+
+/*
+ * Error return codes from gethostbyname() and gethostbyaddr()
+ * (left in extern int h_errno).
+ */
+
+#undef NETDB_INTERNAL
+#undef NETDB_SUCCESS
+#undef HOST_NOT_FOUND
+#undef TRY_AGAIN
+#undef NO_RECOVERY
+#undef NO_DATA
+#undef NO_ADDRESS
+
+#define NETDB_INTERNAL -1 /* see errno */
+#define NETDB_SUCCESS 0 /* no problem */
+#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
+#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
+#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
+#define NO_DATA 4 /* Valid name, no data record of requested type */
+#define NO_ADDRESS NO_DATA /* no address, look for MX record */
+
+/*
+ * Error return codes from getaddrinfo()
+ */
+
+#undef EAI_ADDRFAMILY
+#undef EAI_AGAIN
+#undef EAI_BADFLAGS
+#undef EAI_FAIL
+#undef EAI_FAMILY
+#undef EAI_MEMORY
+#undef EAI_NODATA
+#undef EAI_NONAME
+#undef EAI_SERVICE
+#undef EAI_SOCKTYPE
+#undef EAI_SYSTEM
+#undef EAI_BADHINTS
+#undef EAI_PROTOCOL
+#undef EAI_MAX
+
+#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
+#define EAI_AGAIN 2 /* temporary failure in name resolution */
+#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
+#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
+#define EAI_FAMILY 5 /* ai_family not supported */
+#define EAI_MEMORY 6 /* memory allocation failure */
+#define EAI_NODATA 7 /* no address associated with hostname */
+#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
+#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
+#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
+#define EAI_SYSTEM 11 /* system error returned in errno */
+#define EAI_BADHINTS 12
+#define EAI_PROTOCOL 13
+#define EAI_MAX 14
+
+/*
+ * Flag values for getaddrinfo()
+ */
+#undef AI_PASSIVE
+#undef AI_CANONNAME
+#undef AI_NUMERICHOST
+
+#define AI_PASSIVE 0x00000001
+#define AI_CANONNAME 0x00000002
+#define AI_NUMERICHOST 0x00000004
+
+/*
+ * Flag values for getipnodebyname()
+ */
+#undef AI_V4MAPPED
+#undef AI_ALL
+#undef AI_ADDRCONFIG
+#undef AI_DEFAULT
+
+#define AI_V4MAPPED 0x00000008
+#define AI_ALL 0x00000010
+#define AI_ADDRCONFIG 0x00000020
+#define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG)
+
+/*
+ * Constants for getnameinfo()
+ */
+#undef NI_MAXHOST
+#undef NI_MAXSERV
+
+#define NI_MAXHOST 1025
+#define NI_MAXSERV 32
+
+/*
+ * Flag values for getnameinfo()
+ */
+#undef NI_NOFQDN
+#undef NI_NUMERICHOST
+#undef NI_NAMEREQD
+#undef NI_NUMERICSERV
+#undef NI_DGRAM
+#undef NI_NUMERICSCOPE
+
+#define NI_NOFQDN 0x00000001
+#define NI_NUMERICHOST 0x00000002
+#define NI_NAMEREQD 0x00000004
+#define NI_NUMERICSERV 0x00000008
+#define NI_DGRAM 0x00000010
+#define NI_NUMERICSCOPE 0x00000020 /*2553bis-00*/
+
+/*
+ * Structures for getrrsetbyname()
+ */
+struct rdatainfo {
+ unsigned int rdi_length;
+ unsigned char *rdi_data;
+};
+
+struct rrsetinfo {
+ unsigned int rri_flags;
+ int rri_rdclass;
+ int rri_rdtype;
+ unsigned int rri_ttl;
+ unsigned int rri_nrdatas;
+ unsigned int rri_nsigs;
+ char *rri_name;
+ struct rdatainfo *rri_rdatas;
+ struct rdatainfo *rri_sigs;
+};
+
+/*
+ * Flags for getrrsetbyname()
+ */
+#define RRSET_VALIDATED 0x00000001
+ /* Set was dnssec validated */
+
+/*
+ * Return codes for getrrsetbyname()
+ */
+#define ERRSET_SUCCESS 0
+#define ERRSET_NOMEMORY 1
+#define ERRSET_FAIL 2
+#define ERRSET_INVAL 3
+
+
+#endif /* NETDB_H */
diff --git a/lib/isc/win32/ntgroups.c b/lib/isc/win32/ntgroups.c
new file mode 100644
index 0000000..729cf07
--- /dev/null
+++ b/lib/isc/win32/ntgroups.c
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2004, 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ntgroups.c,v 1.12 2009/09/29 23:48:04 tbox Exp $ */
+
+/*
+ * The NT Groups have two groups that are not well documented and are
+ * not normally seen: None and Everyone. A user account belongs to
+ * any number of groups, but if it is not a member of any group then
+ * it is a member of the None Group. The None group is not listed
+ * anywhere. You cannot remove an account from the none group except
+ * by making it a member of some other group, The second group is the
+ * Everyone group. All accounts, no matter how many groups that they
+ * belong to, also belong to the Everyone group. You cannot remove an
+ * account from the Everyone group.
+ */
+
+#ifndef UNICODE
+#define UNICODE
+#endif /* UNICODE */
+
+/*
+ * Silence warnings.
+ */
+#define _CRT_SECURE_NO_DEPRECATE 1
+
+#include <windows.h>
+#include <assert.h>
+#include <lm.h>
+
+#include <isc/ntgroups.h>
+#include <isc/result.h>
+
+#define MAX_NAME_LENGTH 256
+
+isc_result_t
+isc_ntsecurity_getaccountgroups(char *username, char **GroupList,
+ unsigned int maxgroups,
+ unsigned int *totalGroups) {
+ LPGROUP_USERS_INFO_0 pTmpBuf;
+ LPLOCALGROUP_USERS_INFO_0 pTmpLBuf;
+ DWORD i;
+ LPLOCALGROUP_USERS_INFO_0 pBuf = NULL;
+ LPGROUP_USERS_INFO_0 pgrpBuf = NULL;
+ DWORD dwLevel = 0;
+ DWORD dwFlags = LG_INCLUDE_INDIRECT;
+ DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;
+ DWORD dwEntriesRead = 0;
+ DWORD dwTotalEntries = 0;
+ NET_API_STATUS nStatus;
+ DWORD dwTotalCount = 0;
+ size_t retlen;
+ wchar_t user[MAX_NAME_LENGTH];
+
+ retlen = mbstowcs(user, username, MAX_NAME_LENGTH);
+
+ *totalGroups = 0;
+ /*
+ * Call the NetUserGetLocalGroups function
+ * specifying information level 0.
+ *
+ * The LG_INCLUDE_INDIRECT flag specifies that the
+ * function should also return the names of the local
+ * groups in which the user is indirectly a member.
+ */
+ nStatus = NetUserGetLocalGroups(NULL,
+ user,
+ dwLevel,
+ dwFlags,
+ (LPBYTE *) &pBuf,
+ dwPrefMaxLen,
+ &dwEntriesRead,
+ &dwTotalEntries);
+ /*
+ * See if the call succeeds,
+ */
+ if (nStatus != NERR_Success) {
+ if (nStatus == ERROR_ACCESS_DENIED)
+ return (ISC_R_NOPERM);
+ if (nStatus == ERROR_MORE_DATA)
+ return (ISC_R_NOSPACE);
+ if (nStatus == NERR_UserNotFound)
+ dwEntriesRead = 0;
+ }
+
+ dwTotalCount = 0;
+ if (pBuf != NULL) {
+ pTmpLBuf = pBuf;
+ /*
+ * Loop through the entries
+ */
+ for (i = 0;
+ (i < dwEntriesRead && *totalGroups < maxgroups); i++) {
+ assert(pTmpLBuf != NULL);
+ if (pTmpLBuf == NULL)
+ break;
+ retlen = wcslen(pTmpLBuf->lgrui0_name);
+ GroupList[*totalGroups] = (char *) malloc(retlen +1);
+ if (GroupList[*totalGroups] == NULL)
+ return (ISC_R_NOMEMORY);
+
+ retlen = wcstombs(GroupList[*totalGroups],
+ pTmpLBuf->lgrui0_name, retlen);
+ GroupList[*totalGroups][retlen] = '\0';
+ if (strcmp(GroupList[*totalGroups], "None") == 0)
+ free(GroupList[*totalGroups]);
+ else
+ (*totalGroups)++;
+ pTmpLBuf++;
+ }
+ }
+ /* Free the allocated memory. */
+ if (pBuf != NULL)
+ NetApiBufferFree(pBuf);
+
+
+ /*
+ * Call the NetUserGetGroups function, specifying level 0.
+ */
+ nStatus = NetUserGetGroups(NULL,
+ user,
+ dwLevel,
+ (LPBYTE*)&pgrpBuf,
+ dwPrefMaxLen,
+ &dwEntriesRead,
+ &dwTotalEntries);
+ /*
+ * See if the call succeeds,
+ */
+ if (nStatus != NERR_Success) {
+ if (nStatus == ERROR_ACCESS_DENIED)
+ return (ISC_R_NOPERM);
+ if (nStatus == ERROR_MORE_DATA)
+ return (ISC_R_NOSPACE);
+ if (nStatus == NERR_UserNotFound)
+ dwEntriesRead = 0;
+ }
+
+ if (pgrpBuf != NULL) {
+ pTmpBuf = pgrpBuf;
+ /*
+ * Loop through the entries
+ */
+ for (i = 0;
+ (i < dwEntriesRead && *totalGroups < maxgroups); i++) {
+ assert(pTmpBuf != NULL);
+
+ if (pTmpBuf == NULL)
+ break;
+ retlen = wcslen(pTmpBuf->grui0_name);
+ GroupList[*totalGroups] = (char *) malloc(retlen +1);
+ if (GroupList[*totalGroups] == NULL)
+ return (ISC_R_NOMEMORY);
+
+ retlen = wcstombs(GroupList[*totalGroups],
+ pTmpBuf->grui0_name, retlen);
+ GroupList[*totalGroups][retlen] = '\0';
+ if (strcmp(GroupList[*totalGroups], "None") == 0)
+ free(GroupList[*totalGroups]);
+ else
+ (*totalGroups)++;
+ pTmpBuf++;
+ }
+ }
+ /*
+ * Free the allocated memory.
+ */
+ if (pgrpBuf != NULL)
+ NetApiBufferFree(pgrpBuf);
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/win32/ntpaths.c b/lib/isc/win32/ntpaths.c
new file mode 100644
index 0000000..1ff8c5a
--- /dev/null
+++ b/lib/isc/win32/ntpaths.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: ntpaths.c,v 1.15 2009/07/14 22:54:57 each Exp $ */
+
+/*
+ * This module fetches the required path information that is specific
+ * to NT systems which can have its configuration and system files
+ * almost anywhere. It can be used to override whatever the application
+ * had previously assigned to the pointer. Basic information about the
+ * file locations are stored in the registry.
+ */
+
+#include <config.h>
+#include <isc/bind_registry.h>
+#include <isc/ntpaths.h>
+
+/*
+ * Module Variables
+ */
+
+static char systemDir[MAX_PATH];
+static char namedBase[MAX_PATH];
+static char ns_confFile[MAX_PATH];
+static char lwresd_confFile[MAX_PATH];
+static char lwresd_resolvconfFile[MAX_PATH];
+static char rndc_confFile[MAX_PATH];
+static char ns_defaultpidfile[MAX_PATH];
+static char lwresd_defaultpidfile[MAX_PATH];
+static char local_state_dir[MAX_PATH];
+static char sys_conf_dir[MAX_PATH];
+static char rndc_keyFile[MAX_PATH];
+static char session_keyFile[MAX_PATH];
+
+static DWORD baseLen = MAX_PATH;
+static BOOL Initialized = FALSE;
+
+void
+isc_ntpaths_init() {
+ HKEY hKey;
+ BOOL keyFound = TRUE;
+
+ memset(namedBase, 0, MAX_PATH);
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, BIND_SUBKEY, 0, KEY_READ, &hKey)
+ != ERROR_SUCCESS)
+ keyFound = FALSE;
+
+ if (keyFound == TRUE) {
+ /* Get the named directory */
+ if (RegQueryValueEx(hKey, "InstallDir", NULL, NULL,
+ (LPBYTE)namedBase, &baseLen) != ERROR_SUCCESS)
+ keyFound = FALSE;
+ RegCloseKey(hKey);
+ }
+
+ GetSystemDirectory(systemDir, MAX_PATH);
+
+ if (keyFound == FALSE)
+ /* Use the System Directory as a default */
+ strcpy(namedBase, systemDir);
+
+ strcpy(ns_confFile, namedBase);
+ strcat(ns_confFile, "\\etc\\named.conf");
+
+ strcpy(lwresd_confFile, namedBase);
+ strcat(lwresd_confFile, "\\etc\\lwresd.conf");
+
+ strcpy(lwresd_resolvconfFile, systemDir);
+ strcat(lwresd_resolvconfFile, "\\Drivers\\etc\\resolv.conf");
+
+ strcpy(rndc_keyFile, namedBase);
+ strcat(rndc_keyFile, "\\etc\\rndc.key");
+
+ strcpy(session_keyFile, namedBase);
+ strcat(session_keyFile, "\\etc\\session.key");
+
+ strcpy(rndc_confFile, namedBase);
+ strcat(rndc_confFile, "\\etc\\rndc.conf");
+ strcpy(ns_defaultpidfile, namedBase);
+ strcat(ns_defaultpidfile, "\\etc\\named.pid");
+
+ strcpy(lwresd_defaultpidfile, namedBase);
+ strcat(lwresd_defaultpidfile, "\\etc\\lwresd.pid");
+
+ strcpy(local_state_dir, namedBase);
+ strcat(local_state_dir, "\\bin");
+
+ strcpy(sys_conf_dir, namedBase);
+ strcat(sys_conf_dir, "\\etc");
+
+ Initialized = TRUE;
+}
+
+char *
+isc_ntpaths_get(int ind) {
+ if (!Initialized)
+ isc_ntpaths_init();
+
+ switch (ind) {
+ case NAMED_CONF_PATH:
+ return (ns_confFile);
+ break;
+ case LWRES_CONF_PATH:
+ return (lwresd_confFile);
+ break;
+ case RESOLV_CONF_PATH:
+ return (lwresd_resolvconfFile);
+ break;
+ case RNDC_CONF_PATH:
+ return (rndc_confFile);
+ break;
+ case NAMED_PID_PATH:
+ return (ns_defaultpidfile);
+ break;
+ case LWRESD_PID_PATH:
+ return (lwresd_defaultpidfile);
+ break;
+ case LOCAL_STATE_DIR:
+ return (local_state_dir);
+ break;
+ case SYS_CONF_DIR:
+ return (sys_conf_dir);
+ break;
+ case RNDC_KEY_PATH:
+ return (rndc_keyFile);
+ break;
+ case SESSION_KEY_PATH:
+ return (session_keyFile);
+ break;
+ default:
+ return (NULL);
+ }
+}
diff --git a/lib/isc/win32/once.c b/lib/isc/win32/once.c
new file mode 100644
index 0000000..b504776
--- /dev/null
+++ b/lib/isc/win32/once.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: once.c,v 1.12 2007/06/18 23:47:49 tbox Exp $ */
+
+/* Principal Authors: DCL */
+
+#include <config.h>
+
+#include <windows.h>
+
+#include <isc/once.h>
+#include <isc/assertions.h>
+#include <isc/util.h>
+
+isc_result_t
+isc_once_do(isc_once_t *controller, void(*function)(void)) {
+ REQUIRE(controller != NULL && function != NULL);
+
+ if (controller->status == ISC_ONCE_INIT_NEEDED) {
+
+ if (InterlockedDecrement(&controller->counter) == 0) {
+ if (controller->status == ISC_ONCE_INIT_NEEDED) {
+ function();
+ controller->status = ISC_ONCE_INIT_DONE;
+ }
+ } else {
+ while (controller->status == ISC_ONCE_INIT_NEEDED) {
+ /*
+ * Sleep(0) indicates that this thread
+ * should be suspended to allow other
+ * waiting threads to execute.
+ */
+ Sleep(0);
+ }
+ }
+ }
+
+ return (ISC_R_SUCCESS);
+}
diff --git a/lib/isc/win32/os.c b/lib/isc/win32/os.c
new file mode 100644
index 0000000..bbd5f1d
--- /dev/null
+++ b/lib/isc/win32/os.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: os.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <windows.h>
+
+#include <isc/os.h>
+
+static BOOL bInit = FALSE;
+static SYSTEM_INFO SystemInfo;
+
+static void
+initialize_action(void) {
+ if (bInit)
+ return;
+
+ GetSystemInfo(&SystemInfo);
+ bInit = TRUE;
+}
+
+unsigned int
+isc_os_ncpus(void) {
+ long ncpus = 1;
+ initialize_action();
+ ncpus = SystemInfo.dwNumberOfProcessors;
+ if (ncpus <= 0)
+ ncpus = 1;
+
+ return ((unsigned int)ncpus);
+}
diff --git a/lib/isc/win32/resource.c b/lib/isc/win32/resource.c
new file mode 100644
index 0000000..e7e7cf4
--- /dev/null
+++ b/lib/isc/win32/resource.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2004, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: resource.c,v 1.10 2008/07/11 23:47:09 tbox Exp $ */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <isc/platform.h>
+#include <isc/resource.h>
+#include <isc/result.h>
+#include <isc/util.h>
+
+#include "errno2result.h"
+
+/*
+ * Windows limits the maximum number of open files to 2048
+ */
+
+#define WIN32_MAX_OPEN_FILES 2048
+
+isc_result_t
+isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) {
+ isc_resourcevalue_t rlim_value;
+ int wresult;
+
+ if (resource != isc_resource_openfiles)
+ return (ISC_R_NOTIMPLEMENTED);
+
+
+ if (value == ISC_RESOURCE_UNLIMITED)
+ rlim_value = WIN32_MAX_OPEN_FILES;
+ else
+ rlim_value = min(value, WIN32_MAX_OPEN_FILES);
+
+ wresult = _setmaxstdio((int) rlim_value);
+
+ if (wresult > 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value) {
+
+ if (resource != isc_resource_openfiles)
+ return (ISC_R_NOTIMPLEMENTED);
+
+ *value = WIN32_MAX_OPEN_FILES;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value) {
+ return (isc_resource_getlimit(resource, value));
+}
diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c
new file mode 100644
index 0000000..ffcefb0
--- /dev/null
+++ b/lib/isc/win32/socket.c
@@ -0,0 +1,3967 @@
+/*
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/* This code uses functions which are only available on Server 2003 and
+ * higher, and Windows XP and higher.
+ *
+ * This code is by nature multithreaded and takes advantage of various
+ * features to pass on information through the completion port for
+ * when I/O is completed. All sends, receives, accepts, and connects are
+ * completed through the completion port.
+ *
+ * The number of Completion Port Worker threads used is the total number
+ * of CPU's + 1. This increases the likelihood that a Worker Thread is
+ * available for processing a completed request.
+ *
+ * XXXPDM 5 August, 2002
+ */
+
+#define MAKE_EXTERNAL 1
+#include <config.h>
+
+#include <sys/types.h>
+
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
+#endif
+
+#include <errno.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <io.h>
+#include <fcntl.h>
+#include <process.h>
+
+#include <isc/buffer.h>
+#include <isc/bufferlist.h>
+#include <isc/condition.h>
+#include <isc/list.h>
+#include <isc/log.h>
+#include <isc/mem.h>
+#include <isc/msgs.h>
+#include <isc/mutex.h>
+#include <isc/net.h>
+#include <isc/once.h>
+#include <isc/os.h>
+#include <isc/platform.h>
+#include <isc/print.h>
+#include <isc/region.h>
+#include <isc/socket.h>
+#include <isc/stats.h>
+#include <isc/strerror.h>
+#include <isc/syslog.h>
+#include <isc/task.h>
+#include <isc/thread.h>
+#include <isc/util.h>
+#include <isc/win32os.h>
+
+#include <mswsock.h>
+
+#include "errno2result.h"
+
+/*
+ * How in the world can Microsoft exist with APIs like this?
+ * We can't actually call this directly, because it turns out
+ * no library exports this function. Instead, we need to
+ * issue a runtime call to get the address.
+ */
+LPFN_CONNECTEX ISCConnectEx;
+LPFN_ACCEPTEX ISCAcceptEx;
+LPFN_GETACCEPTEXSOCKADDRS ISCGetAcceptExSockaddrs;
+
+/*
+ * Run expensive internal consistency checks.
+ */
+#ifdef ISC_SOCKET_CONSISTENCY_CHECKS
+#define CONSISTENT(sock) consistent(sock)
+#else
+#define CONSISTENT(sock) do {} while (0)
+#endif
+static void consistent(isc_socket_t *sock);
+
+/*
+ * Define this macro to control the behavior of connection
+ * resets on UDP sockets. See Microsoft KnowledgeBase Article Q263823
+ * for details.
+ * NOTE: This requires that Windows 2000 systems install Service Pack 2
+ * or later.
+ */
+#ifndef SIO_UDP_CONNRESET
+#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
+#endif
+
+/*
+ * Some systems define the socket length argument as an int, some as size_t,
+ * some as socklen_t. This is here so it can be easily changed if needed.
+ */
+#ifndef ISC_SOCKADDR_LEN_T
+#define ISC_SOCKADDR_LEN_T unsigned int
+#endif
+
+/*
+ * Define what the possible "soft" errors can be. These are non-fatal returns
+ * of various network related functions, like recv() and so on.
+ */
+#define SOFT_ERROR(e) ((e) == WSAEINTR || \
+ (e) == WSAEWOULDBLOCK || \
+ (e) == EWOULDBLOCK || \
+ (e) == EINTR || \
+ (e) == EAGAIN || \
+ (e) == 0)
+
+/*
+ * Pending errors are not really errors and should be
+ * kept separate
+ */
+#define PENDING_ERROR(e) ((e) == WSA_IO_PENDING || (e) == 0)
+
+#define DOIO_SUCCESS 0 /* i/o ok, event sent */
+#define DOIO_SOFT 1 /* i/o ok, soft error, no event sent */
+#define DOIO_HARD 2 /* i/o error, event sent */
+#define DOIO_EOF 3 /* EOF, no event sent */
+#define DOIO_PENDING 4 /* status when i/o is in process */
+#define DOIO_NEEDMORE 5 /* IO was processed, but we need more due to minimum */
+
+#define DLVL(x) ISC_LOGCATEGORY_GENERAL, ISC_LOGMODULE_SOCKET, ISC_LOG_DEBUG(x)
+
+/*
+ * DLVL(90) -- Function entry/exit and other tracing.
+ * DLVL(70) -- Socket "correctness" -- including returning of events, etc.
+ * DLVL(60) -- Socket data send/receive
+ * DLVL(50) -- Event tracing, including receiving/sending completion events.
+ * DLVL(20) -- Socket creation/destruction.
+ */
+#define TRACE_LEVEL 90
+#define CORRECTNESS_LEVEL 70
+#define IOEVENT_LEVEL 60
+#define EVENT_LEVEL 50
+#define CREATION_LEVEL 20
+
+#define TRACE DLVL(TRACE_LEVEL)
+#define CORRECTNESS DLVL(CORRECTNESS_LEVEL)
+#define IOEVENT DLVL(IOEVENT_LEVEL)
+#define EVENT DLVL(EVENT_LEVEL)
+#define CREATION DLVL(CREATION_LEVEL)
+
+typedef isc_event_t intev_t;
+
+/*
+ * Socket State
+ */
+enum {
+ SOCK_INITIALIZED, /* Socket Initialized */
+ SOCK_OPEN, /* Socket opened but nothing yet to do */
+ SOCK_DATA, /* Socket sending or receiving data */
+ SOCK_LISTEN, /* TCP Socket listening for connects */
+ SOCK_ACCEPT, /* TCP socket is waiting to accept */
+ SOCK_CONNECT, /* TCP Socket connecting */
+ SOCK_CLOSED, /* Socket has been closed */
+};
+
+#define SOCKET_MAGIC ISC_MAGIC('I', 'O', 'i', 'o')
+#define VALID_SOCKET(t) ISC_MAGIC_VALID(t, SOCKET_MAGIC)
+
+/*
+ * IPv6 control information. If the socket is an IPv6 socket we want
+ * to collect the destination address and interface so the client can
+ * set them on outgoing packets.
+ */
+#ifdef ISC_PLATFORM_HAVEIPV6
+#ifndef USE_CMSG
+#define USE_CMSG 1
+#endif
+#endif
+
+/*
+ * We really don't want to try and use these control messages. Win32
+ * doesn't have this mechanism before XP.
+ */
+#undef USE_CMSG
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ * Used value-result for recvmsg, value only for sendmsg.
+ */
+struct msghdr {
+ SOCKADDR_STORAGE to_addr; /* UDP send/recv address */
+ int to_addr_len; /* length of the address */
+ WSABUF *msg_iov; /* scatter/gather array */
+ u_int msg_iovlen; /* # elements in msg_iov */
+ void *msg_control; /* ancillary data, see below */
+ u_int msg_controllen; /* ancillary data buffer len */
+ int msg_totallen; /* total length of this message */
+} msghdr;
+
+/*
+ * The size to raise the receive buffer to.
+ */
+#define RCVBUFSIZE (32*1024)
+
+/*
+ * The number of times a send operation is repeated if the result
+ * is WSAEINTR.
+ */
+#define NRETRIES 10
+
+struct isc_socket {
+ /* Not locked. */
+ unsigned int magic;
+ isc_socketmgr_t *manager;
+ isc_mutex_t lock;
+ isc_sockettype_t type;
+
+ /* Pointers to scatter/gather buffers */
+ WSABUF iov[ISC_SOCKET_MAXSCATTERGATHER];
+
+ /* Locked by socket lock. */
+ ISC_LINK(isc_socket_t) link;
+ unsigned int references; /* EXTERNAL references */
+ SOCKET fd; /* file handle */
+ int pf; /* protocol family */
+ char name[16];
+ void * tag;
+
+ /*
+ * Each recv() call uses this buffer. It is a per-socket receive
+ * buffer that allows us to decouple the system recv() from the
+ * recv_list done events. This means the items on the recv_list
+ * can be removed without having to cancel pending system recv()
+ * calls. It also allows us to read-ahead in some cases.
+ */
+ struct {
+ SOCKADDR_STORAGE from_addr; // UDP send/recv address
+ int from_addr_len; // length of the address
+ char *base; // the base of the buffer
+ char *consume_position; // where to start copying data from next
+ unsigned int len; // the actual size of this buffer
+ unsigned int remaining; // the number of bytes remaining
+ } recvbuf;
+
+ ISC_LIST(isc_socketevent_t) send_list;
+ ISC_LIST(isc_socketevent_t) recv_list;
+ ISC_LIST(isc_socket_newconnev_t) accept_list;
+ isc_socket_connev_t *connect_ev;
+
+ isc_sockaddr_t address; /* remote address */
+
+ unsigned int listener : 1, /* listener socket */
+ connected : 1,
+ pending_connect : 1, /* connect pending */
+ bound : 1, /* bound to local addr */
+ dupped : 1; /* created by isc_socket_dup() */
+ unsigned int pending_iocp; /* Should equal the counters below. Debug. */
+ unsigned int pending_recv; /* Number of outstanding recv() calls. */
+ unsigned int pending_send; /* Number of outstanding send() calls. */
+ unsigned int pending_accept; /* Number of outstanding accept() calls. */
+ unsigned int state; /* Socket state. Debugging and consistency checking. */
+ int state_lineno; /* line which last touched state */
+};
+
+#define _set_state(sock, _state) do { (sock)->state = (_state); (sock)->state_lineno = __LINE__; } while (0)
+
+/*
+ * Buffer structure
+ */
+typedef struct buflist buflist_t;
+
+struct buflist {
+ void *buf;
+ unsigned int buflen;
+ ISC_LINK(buflist_t) link;
+};
+
+/*
+ * I/O Completion ports Info structures
+ */
+
+static HANDLE hHeapHandle = NULL;
+typedef struct IoCompletionInfo {
+ OVERLAPPED overlapped;
+ isc_socketevent_t *dev; /* send()/recv() done event */
+ isc_socket_connev_t *cdev; /* connect() done event */
+ isc_socket_newconnev_t *adev; /* accept() done event */
+ void *acceptbuffer;
+ DWORD received_bytes;
+ int request_type;
+ struct msghdr messagehdr;
+ ISC_LIST(buflist_t) bufferlist; /*%< list of buffers */
+} IoCompletionInfo;
+
+/*
+ * Define a maximum number of I/O Completion Port worker threads
+ * to handle the load on the Completion Port. The actual number
+ * used is the number of CPU's + 1.
+ */
+#define MAX_IOCPTHREADS 20
+
+#define SOCKET_MANAGER_MAGIC ISC_MAGIC('I', 'O', 'm', 'g')
+#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, SOCKET_MANAGER_MAGIC)
+
+struct isc_socketmgr {
+ /* Not locked. */
+ unsigned int magic;
+ isc_mem_t *mctx;
+ isc_mutex_t lock;
+ isc_stats_t *stats;
+
+ /* Locked by manager lock. */
+ ISC_LIST(isc_socket_t) socklist;
+ isc_boolean_t bShutdown;
+ isc_condition_t shutdown_ok;
+ HANDLE hIoCompletionPort;
+ int maxIOCPThreads;
+ HANDLE hIOCPThreads[MAX_IOCPTHREADS];
+ DWORD dwIOCPThreadIds[MAX_IOCPTHREADS];
+
+ /*
+ * Debugging.
+ * Modified by InterlockedIncrement() and InterlockedDecrement()
+ */
+ LONG totalSockets;
+ LONG iocp_total;
+};
+
+enum {
+ SOCKET_RECV,
+ SOCKET_SEND,
+ SOCKET_ACCEPT,
+ SOCKET_CONNECT
+};
+
+/*
+ * send() and recv() iovec counts
+ */
+#define MAXSCATTERGATHER_SEND (ISC_SOCKET_MAXSCATTERGATHER)
+#define MAXSCATTERGATHER_RECV (ISC_SOCKET_MAXSCATTERGATHER)
+
+static isc_result_t socket_create(isc_socketmgr_t *manager0, int pf,
+ isc_sockettype_t type,
+ isc_socket_t **socketp,
+ isc_socket_t *dup_socket);
+static isc_threadresult_t WINAPI SocketIoThread(LPVOID ThreadContext);
+static void maybe_free_socket(isc_socket_t **, int);
+static void free_socket(isc_socket_t **, int);
+static isc_boolean_t senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev);
+static isc_boolean_t acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev);
+static isc_boolean_t connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev);
+static void send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev);
+static void send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev);
+static void send_acceptdone_event(isc_socket_t *sock, isc_socket_newconnev_t **adev);
+static void send_connectdone_event(isc_socket_t *sock, isc_socket_connev_t **cdev);
+static void send_recvdone_abort(isc_socket_t *sock, isc_result_t result);
+static void queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev);
+static void queue_receive_request(isc_socket_t *sock);
+
+/*
+ * This is used to dump the contents of the sock structure
+ * You should make sure that the sock is locked before
+ * dumping it. Since the code uses simple printf() statements
+ * it should only be used interactively.
+ */
+void
+sock_dump(isc_socket_t *sock) {
+ isc_socketevent_t *ldev;
+ isc_socket_newconnev_t *ndev;
+
+#if 0
+ isc_sockaddr_t addr;
+ char socktext[256];
+
+ isc_socket_getpeername(sock, &addr);
+ isc_sockaddr_format(&addr, socktext, sizeof(socktext));
+ printf("Remote Socket: %s\n", socktext);
+ isc_socket_getsockname(sock, &addr);
+ isc_sockaddr_format(&addr, socktext, sizeof(socktext));
+ printf("This Socket: %s\n", socktext);
+#endif
+
+ printf("\n\t\tSock Dump\n");
+ printf("\t\tfd: %u\n", sock->fd);
+ printf("\t\treferences: %d\n", sock->references);
+ printf("\t\tpending_accept: %d\n", sock->pending_accept);
+ printf("\t\tconnecting: %d\n", sock->pending_connect);
+ printf("\t\tconnected: %d\n", sock->connected);
+ printf("\t\tbound: %d\n", sock->bound);
+ printf("\t\tpending_iocp: %d\n", sock->pending_iocp);
+ printf("\t\tsocket type: %d\n", sock->type);
+
+ printf("\n\t\tSock Recv List\n");
+ ldev = ISC_LIST_HEAD(sock->recv_list);
+ while (ldev != NULL) {
+ printf("\t\tdev: %p\n", ldev);
+ ldev = ISC_LIST_NEXT(ldev, ev_link);
+ }
+
+ printf("\n\t\tSock Send List\n");
+ ldev = ISC_LIST_HEAD(sock->send_list);
+ while (ldev != NULL) {
+ printf("\t\tdev: %p\n", ldev);
+ ldev = ISC_LIST_NEXT(ldev, ev_link);
+ }
+
+ printf("\n\t\tSock Accept List\n");
+ ndev = ISC_LIST_HEAD(sock->accept_list);
+ while (ndev != NULL) {
+ printf("\t\tdev: %p\n", ldev);
+ ndev = ISC_LIST_NEXT(ndev, ev_link);
+ }
+}
+
+static void
+socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address,
+ isc_logcategory_t *category, isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *fmt, ...) ISC_FORMAT_PRINTF(9, 10);
+
+/* This function will add an entry to the I/O completion port
+ * that will signal the I/O thread to exit (gracefully)
+ */
+static void
+signal_iocompletionport_exit(isc_socketmgr_t *manager) {
+ int i;
+ int errval;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_MANAGER(manager));
+ for (i = 0; i < manager->maxIOCPThreads; i++) {
+ if (!PostQueuedCompletionStatus(manager->hIoCompletionPort,
+ 0, 0, 0)) {
+ errval = GetLastError();
+ isc__strerror(errval, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FAILED,
+ "Can't request service thread to exit: %s"),
+ strbuf);
+ }
+ }
+}
+
+/*
+ * Create the worker threads for the I/O Completion Port
+ */
+void
+iocompletionport_createthreads(int total_threads, isc_socketmgr_t *manager) {
+ int errval;
+ char strbuf[ISC_STRERRORSIZE];
+ int i;
+
+ INSIST(total_threads > 0);
+ REQUIRE(VALID_MANAGER(manager));
+ /*
+ * We need at least one
+ */
+ for (i = 0; i < total_threads; i++) {
+ manager->hIOCPThreads[i] = CreateThread(NULL, 0, SocketIoThread,
+ manager, 0,
+ &manager->dwIOCPThreadIds[i]);
+ if (manager->hIOCPThreads[i] == NULL) {
+ errval = GetLastError();
+ isc__strerror(errval, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FAILED,
+ "Can't create IOCP thread: %s"),
+ strbuf);
+ exit(1);
+ }
+ }
+}
+
+/*
+ * Create/initialise the I/O completion port
+ */
+void
+iocompletionport_init(isc_socketmgr_t *manager) {
+ int errval;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_MANAGER(manager));
+ /*
+ * Create a private heap to handle the socket overlapped structure
+ * The minimum number of structures is 10, there is no maximum
+ */
+ hHeapHandle = HeapCreate(0, 10 * sizeof(IoCompletionInfo), 0);
+ if (hHeapHandle == NULL) {
+ errval = GetLastError();
+ isc__strerror(errval, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FAILED,
+ "HeapCreate() failed during "
+ "initialization: %s"),
+ strbuf);
+ exit(1);
+ }
+
+ manager->maxIOCPThreads = min(isc_os_ncpus() + 1, MAX_IOCPTHREADS);
+
+ /* Now Create the Completion Port */
+ manager->hIoCompletionPort = CreateIoCompletionPort(
+ INVALID_HANDLE_VALUE, NULL,
+ 0, manager->maxIOCPThreads);
+ if (manager->hIoCompletionPort == NULL) {
+ errval = GetLastError();
+ isc__strerror(errval, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FAILED,
+ "CreateIoCompletionPort() failed "
+ "during initialization: %s"),
+ strbuf);
+ exit(1);
+ }
+
+ /*
+ * Worker threads for servicing the I/O
+ */
+ iocompletionport_createthreads(manager->maxIOCPThreads, manager);
+}
+
+/*
+ * Associate a socket with an IO Completion Port. This allows us to queue events for it
+ * and have our worker pool of threads process them.
+ */
+void
+iocompletionport_update(isc_socket_t *sock) {
+ HANDLE hiocp;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ hiocp = CreateIoCompletionPort((HANDLE)sock->fd,
+ sock->manager->hIoCompletionPort, (ULONG_PTR)sock, 0);
+
+ if (hiocp == NULL) {
+ DWORD errval = GetLastError();
+ isc__strerror(errval, strbuf, sizeof(strbuf));
+ isc_log_iwrite(isc_lctx,
+ ISC_LOGCATEGORY_GENERAL,
+ ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_TOOMANYHANDLES,
+ "iocompletionport_update: failed to open"
+ " io completion port: %s",
+ strbuf);
+
+ /* XXXMLG temporary hack to make failures detected.
+ * This function should return errors to the caller, not
+ * exit here.
+ */
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FAILED,
+ "CreateIoCompletionPort() failed "
+ "during initialization: %s"),
+ strbuf);
+ exit(1);
+ }
+
+ InterlockedIncrement(&sock->manager->iocp_total);
+}
+
+/*
+ * Routine to cleanup and then close the socket.
+ * Only close the socket here if it is NOT associated
+ * with an event, otherwise the WSAWaitForMultipleEvents
+ * may fail due to the fact that the Wait should not
+ * be running while closing an event or a socket.
+ * The socket is locked before calling this function
+ */
+void
+socket_close(isc_socket_t *sock) {
+
+ REQUIRE(sock != NULL);
+
+ if (sock->fd != INVALID_SOCKET) {
+ closesocket(sock->fd);
+ sock->fd = INVALID_SOCKET;
+ _set_state(sock, SOCK_CLOSED);
+ InterlockedDecrement(&sock->manager->totalSockets);
+ }
+}
+
+static isc_once_t initialise_once = ISC_ONCE_INIT;
+static isc_boolean_t initialised = ISC_FALSE;
+
+static void
+initialise(void) {
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+ SOCKET sock;
+ GUID GUIDConnectEx = WSAID_CONNECTEX;
+ GUID GUIDAcceptEx = WSAID_ACCEPTEX;
+ GUID GUIDGetAcceptExSockaddrs = WSAID_GETACCEPTEXSOCKADDRS;
+ DWORD dwBytes;
+
+ /* Need Winsock 2.2 or better */
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+ if (err != 0) {
+ char strbuf[ISC_STRERRORSIZE];
+ isc__strerror(err, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__, "WSAStartup() %s: %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"),
+ strbuf);
+ exit(1);
+ }
+ /*
+ * The following APIs do not exist as functions in a library, but we must
+ * ask winsock for them. They are "extensions" -- but why they cannot be
+ * actual functions is beyond me. So, ask winsock for the pointers to the
+ * functions we need.
+ */
+ sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ INSIST(sock != INVALID_SOCKET);
+ err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &GUIDConnectEx, sizeof(GUIDConnectEx),
+ &ISCConnectEx, sizeof(ISCConnectEx),
+ &dwBytes, NULL, NULL);
+ INSIST(err == 0);
+
+ err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &GUIDAcceptEx, sizeof(GUIDAcceptEx),
+ &ISCAcceptEx, sizeof(ISCAcceptEx),
+ &dwBytes, NULL, NULL);
+ INSIST(err == 0);
+
+ err = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &GUIDGetAcceptExSockaddrs, sizeof(GUIDGetAcceptExSockaddrs),
+ &ISCGetAcceptExSockaddrs, sizeof(ISCGetAcceptExSockaddrs),
+ &dwBytes, NULL, NULL);
+ INSIST(err == 0);
+
+ closesocket(sock);
+
+ initialised = ISC_TRUE;
+}
+
+/*
+ * Initialize socket services
+ */
+void
+InitSockets(void) {
+ RUNTIME_CHECK(isc_once_do(&initialise_once,
+ initialise) == ISC_R_SUCCESS);
+ if (!initialised)
+ exit(1);
+}
+
+int
+internal_sendmsg(isc_socket_t *sock, IoCompletionInfo *lpo,
+ struct msghdr *messagehdr, int flags, int *Error)
+{
+ int Result;
+ DWORD BytesSent;
+ DWORD Flags = flags;
+ int total_sent;
+
+ *Error = 0;
+ Result = WSASendTo(sock->fd, messagehdr->msg_iov,
+ messagehdr->msg_iovlen, &BytesSent,
+ Flags, (SOCKADDR *)&messagehdr->to_addr,
+ messagehdr->to_addr_len, (LPWSAOVERLAPPED)lpo,
+ NULL);
+
+ total_sent = (int)BytesSent;
+
+ /* Check for errors.*/
+ if (Result == SOCKET_ERROR) {
+ *Error = WSAGetLastError();
+
+ switch (*Error) {
+ case WSA_IO_INCOMPLETE:
+ case WSA_WAIT_IO_COMPLETION:
+ case WSA_IO_PENDING:
+ case NO_ERROR: /* Strange, but okay */
+ sock->pending_iocp++;
+ sock->pending_send++;
+ break;
+
+ default:
+ return (-1);
+ break;
+ }
+ } else {
+ sock->pending_iocp++;
+ sock->pending_send++;
+ }
+
+ if (lpo != NULL)
+ return (0);
+ else
+ return (total_sent);
+}
+
+static void
+queue_receive_request(isc_socket_t *sock) {
+ DWORD Flags = 0;
+ DWORD NumBytes = 0;
+ int total_bytes = 0;
+ int Result;
+ int Error;
+ int need_retry;
+ WSABUF iov[1];
+ IoCompletionInfo *lpo = NULL;
+ isc_result_t isc_result;
+
+ retry:
+ need_retry = ISC_FALSE;
+
+ /*
+ * If we already have a receive pending, do nothing.
+ */
+ if (sock->pending_recv > 0) {
+ if (lpo != NULL)
+ HeapFree(hHeapHandle, 0, lpo);
+ return;
+ }
+
+ /*
+ * If no one is waiting, do nothing.
+ */
+ if (ISC_LIST_EMPTY(sock->recv_list)) {
+ if (lpo != NULL)
+ HeapFree(hHeapHandle, 0, lpo);
+ return;
+ }
+
+ INSIST(sock->recvbuf.remaining == 0);
+ INSIST(sock->fd != INVALID_SOCKET);
+
+ iov[0].len = sock->recvbuf.len;
+ iov[0].buf = sock->recvbuf.base;
+
+ if (lpo == NULL) {
+ lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle,
+ HEAP_ZERO_MEMORY,
+ sizeof(IoCompletionInfo));
+ RUNTIME_CHECK(lpo != NULL);
+ } else
+ ZeroMemory(lpo, sizeof(IoCompletionInfo));
+ lpo->request_type = SOCKET_RECV;
+
+ sock->recvbuf.from_addr_len = sizeof(sock->recvbuf.from_addr);
+
+ Error = 0;
+ Result = WSARecvFrom((SOCKET)sock->fd, iov, 1,
+ &NumBytes, &Flags,
+ (SOCKADDR *)&sock->recvbuf.from_addr,
+ &sock->recvbuf.from_addr_len,
+ (LPWSAOVERLAPPED)lpo, NULL);
+
+ /* Check for errors. */
+ if (Result == SOCKET_ERROR) {
+ Error = WSAGetLastError();
+
+ switch (Error) {
+ case WSA_IO_PENDING:
+ sock->pending_iocp++;
+ sock->pending_recv++;
+ break;
+
+ /* direct error: no completion event */
+ case ERROR_HOST_UNREACHABLE:
+ case WSAENETRESET:
+ case WSAECONNRESET:
+ if (!sock->connected) {
+ /* soft error */
+ need_retry = ISC_TRUE;
+ break;
+ }
+ /* FALLTHROUGH */
+
+ default:
+ isc_result = isc__errno2result(Error);
+ if (isc_result == ISC_R_UNEXPECTED)
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "WSARecvFrom: Windows error code: %d, isc result %d",
+ Error, isc_result);
+ send_recvdone_abort(sock, isc_result);
+ HeapFree(hHeapHandle, 0, lpo);
+ lpo = NULL;
+ break;
+ }
+ } else {
+ /*
+ * The recv() finished immediately, but we will still get
+ * a completion event. Rather than duplicate code, let
+ * that thread handle sending the data along its way.
+ */
+ sock->pending_iocp++;
+ sock->pending_recv++;
+ }
+
+ socket_log(__LINE__, sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_DOIORECV,
+ "queue_io_request: fd %d result %d error %d",
+ sock->fd, Result, Error);
+
+ CONSISTENT(sock);
+
+ if (need_retry)
+ goto retry;
+}
+
+static void
+manager_log(isc_socketmgr_t *sockmgr, isc_logcategory_t *category,
+ isc_logmodule_t *module, int level, const char *fmt, ...)
+{
+ char msgbuf[2048];
+ va_list ap;
+
+ if (!isc_log_wouldlog(isc_lctx, level))
+ return;
+
+ va_start(ap, fmt);
+ vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
+ va_end(ap);
+
+ isc_log_write(isc_lctx, category, module, level,
+ "sockmgr %p: %s", sockmgr, msgbuf);
+}
+
+static void
+socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address,
+ isc_logcategory_t *category, isc_logmodule_t *module, int level,
+ isc_msgcat_t *msgcat, int msgset, int message,
+ const char *fmt, ...)
+{
+ char msgbuf[2048];
+ char peerbuf[256];
+ va_list ap;
+
+
+ if (!isc_log_wouldlog(isc_lctx, level))
+ return;
+
+ va_start(ap, fmt);
+ vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
+ va_end(ap);
+
+ if (address == NULL) {
+ isc_log_iwrite(isc_lctx, category, module, level,
+ msgcat, msgset, message,
+ "socket %p line %d: %s", sock, lineno, msgbuf);
+ } else {
+ isc_sockaddr_format(address, peerbuf, sizeof(peerbuf));
+ isc_log_iwrite(isc_lctx, category, module, level,
+ msgcat, msgset, message,
+ "socket %p line %d peer %s: %s", sock, lineno,
+ peerbuf, msgbuf);
+ }
+
+}
+
+/*
+ * Make an fd SOCKET non-blocking.
+ */
+static isc_result_t
+make_nonblock(SOCKET fd) {
+ int ret;
+ unsigned long flags = 1;
+ char strbuf[ISC_STRERRORSIZE];
+
+ /* Set the socket to non-blocking */
+ ret = ioctlsocket(fd, FIONBIO, &flags);
+
+ if (ret == -1) {
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "ioctlsocket(%d, FIOBIO, %d): %s",
+ fd, flags, strbuf);
+
+ return (ISC_R_UNEXPECTED);
+ }
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * Windows 2000 systems incorrectly cause UDP sockets using WSARecvFrom
+ * to not work correctly, returning a WSACONNRESET error when a WSASendTo
+ * fails with an "ICMP port unreachable" response and preventing the
+ * socket from using the WSARecvFrom in subsequent operations.
+ * The function below fixes this, but requires that Windows 2000
+ * Service Pack 2 or later be installed on the system. NT 4.0
+ * systems are not affected by this and work correctly.
+ * See Microsoft Knowledge Base Article Q263823 for details of this.
+ */
+isc_result_t
+connection_reset_fix(SOCKET fd) {
+ DWORD dwBytesReturned = 0;
+ BOOL bNewBehavior = FALSE;
+ DWORD status;
+
+ if (isc_win32os_majorversion() < 5)
+ return (ISC_R_SUCCESS); /* NT 4.0 has no problem */
+
+ /* disable bad behavior using IOCTL: SIO_UDP_CONNRESET */
+ status = WSAIoctl(fd, SIO_UDP_CONNRESET, &bNewBehavior,
+ sizeof(bNewBehavior), NULL, 0,
+ &dwBytesReturned, NULL, NULL);
+ if (status != SOCKET_ERROR)
+ return (ISC_R_SUCCESS);
+ else {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "WSAIoctl(SIO_UDP_CONNRESET, oldBehaviour) %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ return (ISC_R_UNEXPECTED);
+ }
+}
+
+/*
+ * Construct an iov array and attach it to the msghdr passed in. This is
+ * the SEND constructor, which will use the used region of the buffer
+ * (if using a buffer list) or will use the internal region (if a single
+ * buffer I/O is requested).
+ *
+ * Nothing can be NULL, and the done event must list at least one buffer
+ * on the buffer linked list for this function to be meaningful.
+ */
+static void
+build_msghdr_send(isc_socket_t *sock, isc_socketevent_t *dev,
+ struct msghdr *msg, char *cmsg, WSABUF *iov,
+ IoCompletionInfo *lpo)
+{
+ unsigned int iovcount;
+ isc_buffer_t *buffer;
+ buflist_t *cpbuffer;
+ isc_region_t used;
+ size_t write_count;
+ size_t skip_count;
+
+ memset(msg, 0, sizeof(*msg));
+
+ memcpy(&msg->to_addr, &dev->address.type, dev->address.length);
+ msg->to_addr_len = dev->address.length;
+
+ buffer = ISC_LIST_HEAD(dev->bufferlist);
+ write_count = 0;
+ iovcount = 0;
+
+ /*
+ * Single buffer I/O? Skip what we've done so far in this region.
+ */
+ if (buffer == NULL) {
+ write_count = dev->region.length - dev->n;
+ cpbuffer = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(buflist_t));
+ RUNTIME_CHECK(cpbuffer != NULL);
+ cpbuffer->buf = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, write_count);
+ RUNTIME_CHECK(cpbuffer->buf != NULL);
+
+ socket_log(__LINE__, sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK,
+ "alloc_buffer %p %d %p %d", cpbuffer, sizeof(buflist_t),
+ cpbuffer->buf, write_count);
+
+ memcpy(cpbuffer->buf,(dev->region.base + dev->n), write_count);
+ cpbuffer->buflen = write_count;
+ ISC_LIST_ENQUEUE(lpo->bufferlist, cpbuffer, link);
+ iov[0].buf = cpbuffer->buf;
+ iov[0].len = write_count;
+ iovcount = 1;
+
+ goto config;
+ }
+
+ /*
+ * Multibuffer I/O.
+ * Skip the data in the buffer list that we have already written.
+ */
+ skip_count = dev->n;
+ while (buffer != NULL) {
+ REQUIRE(ISC_BUFFER_VALID(buffer));
+ if (skip_count < isc_buffer_usedlength(buffer))
+ break;
+ skip_count -= isc_buffer_usedlength(buffer);
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ while (buffer != NULL) {
+ INSIST(iovcount < MAXSCATTERGATHER_SEND);
+
+ isc_buffer_usedregion(buffer, &used);
+
+ if (used.length > 0) {
+ int uselen = used.length - skip_count;
+ cpbuffer = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, sizeof(buflist_t));
+ RUNTIME_CHECK(cpbuffer != NULL);
+ cpbuffer->buf = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, uselen);
+ RUNTIME_CHECK(cpbuffer->buf != NULL);
+
+ socket_log(__LINE__, sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK,
+ "alloc_buffer %p %d %p %d", cpbuffer, sizeof(buflist_t),
+ cpbuffer->buf, write_count);
+
+ memcpy(cpbuffer->buf,(used.base + skip_count), uselen);
+ cpbuffer->buflen = uselen;
+ iov[iovcount].buf = cpbuffer->buf;
+ iov[iovcount].len = used.length - skip_count;
+ write_count += uselen;
+ skip_count = 0;
+ iovcount++;
+ }
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+
+ INSIST(skip_count == 0);
+
+ config:
+ msg->msg_iov = iov;
+ msg->msg_iovlen = iovcount;
+ msg->msg_totallen = write_count;
+}
+
+static void
+set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock,
+ isc_socketevent_t *dev)
+{
+ if (sock->type == isc_sockettype_udp) {
+ if (address != NULL)
+ dev->address = *address;
+ else
+ dev->address = sock->address;
+ } else if (sock->type == isc_sockettype_tcp) {
+ INSIST(address == NULL);
+ dev->address = sock->address;
+ }
+}
+
+static void
+destroy_socketevent(isc_event_t *event) {
+ isc_socketevent_t *ev = (isc_socketevent_t *)event;
+
+ INSIST(ISC_LIST_EMPTY(ev->bufferlist));
+
+ (ev->destroy)(event);
+}
+
+static isc_socketevent_t *
+allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype,
+ isc_taskaction_t action, const void *arg)
+{
+ isc_socketevent_t *ev;
+
+ ev = (isc_socketevent_t *)isc_event_allocate(sock->manager->mctx,
+ sock, eventtype,
+ action, arg,
+ sizeof(*ev));
+ if (ev == NULL)
+ return (NULL);
+
+ ev->result = ISC_R_IOERROR; // XXXMLG temporary change to detect failure to set
+ ISC_LINK_INIT(ev, ev_link);
+ ISC_LIST_INIT(ev->bufferlist);
+ ev->region.base = NULL;
+ ev->n = 0;
+ ev->offset = 0;
+ ev->attributes = 0;
+ ev->destroy = ev->ev_destroy;
+ ev->ev_destroy = destroy_socketevent;
+
+ return (ev);
+}
+
+#if defined(ISC_SOCKET_DEBUG)
+static void
+dump_msg(struct msghdr *msg, isc_socket_t *sock) {
+ unsigned int i;
+
+ printf("MSGHDR %p, Socket #: %u\n", msg, sock->fd);
+ printf("\tname %p, namelen %d\n", msg->msg_name, msg->msg_namelen);
+ printf("\tiov %p, iovlen %d\n", msg->msg_iov, msg->msg_iovlen);
+ for (i = 0; i < (unsigned int)msg->msg_iovlen; i++)
+ printf("\t\t%d\tbase %p, len %d\n", i,
+ msg->msg_iov[i].buf,
+ msg->msg_iov[i].len);
+}
+#endif
+
+/*
+ * map the error code
+ */
+int
+map_socket_error(isc_socket_t *sock, int windows_errno, int *isc_errno,
+ char *errorstring, size_t bufsize) {
+
+ int doreturn;
+ switch (windows_errno) {
+ case WSAECONNREFUSED:
+ *isc_errno = ISC_R_CONNREFUSED;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case WSAENETUNREACH:
+ case ERROR_NETWORK_UNREACHABLE:
+ *isc_errno = ISC_R_NETUNREACH;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case ERROR_PORT_UNREACHABLE:
+ case ERROR_HOST_UNREACHABLE:
+ case WSAEHOSTUNREACH:
+ *isc_errno = ISC_R_HOSTUNREACH;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case WSAENETDOWN:
+ *isc_errno = ISC_R_NETDOWN;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case WSAEHOSTDOWN:
+ *isc_errno = ISC_R_HOSTDOWN;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case WSAEACCES:
+ *isc_errno = ISC_R_NOPERM;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case WSAECONNRESET:
+ case WSAENETRESET:
+ case WSAECONNABORTED:
+ case WSAEDISCON:
+ *isc_errno = ISC_R_CONNECTIONRESET;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case WSAENOTCONN:
+ *isc_errno = ISC_R_NOTCONNECTED;
+ if (sock->connected)
+ doreturn = DOIO_HARD;
+ else
+ doreturn = DOIO_SOFT;
+ break;
+ case ERROR_OPERATION_ABORTED:
+ case ERROR_CONNECTION_ABORTED:
+ case ERROR_REQUEST_ABORTED:
+ *isc_errno = ISC_R_CONNECTIONRESET;
+ doreturn = DOIO_HARD;
+ break;
+ case WSAENOBUFS:
+ *isc_errno = ISC_R_NORESOURCES;
+ doreturn = DOIO_HARD;
+ break;
+ case WSAEAFNOSUPPORT:
+ *isc_errno = ISC_R_FAMILYNOSUPPORT;
+ doreturn = DOIO_HARD;
+ break;
+ case WSAEADDRNOTAVAIL:
+ *isc_errno = ISC_R_ADDRNOTAVAIL;
+ doreturn = DOIO_HARD;
+ break;
+ case WSAEDESTADDRREQ:
+ *isc_errno = ISC_R_BADADDRESSFORM;
+ doreturn = DOIO_HARD;
+ break;
+ case ERROR_NETNAME_DELETED:
+ *isc_errno = ISC_R_NETDOWN;
+ doreturn = DOIO_HARD;
+ break;
+ default:
+ *isc_errno = ISC_R_IOERROR;
+ doreturn = DOIO_HARD;
+ break;
+ }
+ if (doreturn == DOIO_HARD) {
+ isc__strerror(windows_errno, errorstring, bufsize);
+ }
+ return (doreturn);
+}
+
+static void
+fill_recv(isc_socket_t *sock, isc_socketevent_t *dev) {
+ isc_region_t r;
+ int copylen;
+ isc_buffer_t *buffer;
+
+ INSIST(dev->n < dev->minimum);
+ INSIST(sock->recvbuf.remaining > 0);
+ INSIST(sock->pending_recv == 0);
+
+ if (sock->type == isc_sockettype_udp) {
+ dev->address.length = sock->recvbuf.from_addr_len;
+ memcpy(&dev->address.type, &sock->recvbuf.from_addr,
+ sock->recvbuf.from_addr_len);
+ if (isc_sockaddr_getport(&dev->address) == 0) {
+ if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
+ socket_log(__LINE__, sock, &dev->address, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_ZEROPORT,
+ "dropping source port zero packet");
+ }
+ sock->recvbuf.remaining = 0;
+ return;
+ }
+ } else if (sock->type == isc_sockettype_tcp) {
+ dev->address = sock->address;
+ }
+
+ /*
+ * Run through the list of buffers we were given, and find the
+ * first one with space. Once it is found, loop through, filling
+ * the buffers as much as possible.
+ */
+ buffer = ISC_LIST_HEAD(dev->bufferlist);
+ if (buffer != NULL) { // Multi-buffer receive
+ while (buffer != NULL && sock->recvbuf.remaining > 0) {
+ REQUIRE(ISC_BUFFER_VALID(buffer));
+ if (isc_buffer_availablelength(buffer) > 0) {
+ isc_buffer_availableregion(buffer, &r);
+ copylen = min(r.length, sock->recvbuf.remaining);
+ memcpy(r.base, sock->recvbuf.consume_position, copylen);
+ sock->recvbuf.consume_position += copylen;
+ sock->recvbuf.remaining -= copylen;
+ isc_buffer_add(buffer, copylen);
+ dev->n += copylen;
+ }
+ buffer = ISC_LIST_NEXT(buffer, link);
+ }
+ } else { // Single-buffer receive
+ copylen = min(dev->region.length - dev->n, sock->recvbuf.remaining);
+ memcpy(dev->region.base + dev->n, sock->recvbuf.consume_position, copylen);
+ sock->recvbuf.consume_position += copylen;
+ sock->recvbuf.remaining -= copylen;
+ dev->n += copylen;
+ }
+
+ /*
+ * UDP receives are all-consuming. That is, if we have 4k worth of
+ * data in our receive buffer, and the caller only gave us
+ * 1k of space, we will toss the remaining 3k of data. TCP
+ * will keep the extra data around and use it for later requests.
+ */
+ if (sock->type == isc_sockettype_udp)
+ sock->recvbuf.remaining = 0;
+}
+
+/*
+ * Copy out as much data from the internal buffer to done events.
+ * As each done event is filled, send it along its way.
+ */
+static void
+completeio_recv(isc_socket_t *sock)
+{
+ isc_socketevent_t *dev;
+
+ /*
+ * If we are in the process of filling our buffer, we cannot
+ * touch it yet, so don't.
+ */
+ if (sock->pending_recv > 0)
+ return;
+
+ while (sock->recvbuf.remaining > 0 && !ISC_LIST_EMPTY(sock->recv_list)) {
+ dev = ISC_LIST_HEAD(sock->recv_list);
+
+ /*
+ * See if we have sufficient data in our receive buffer
+ * to handle this. If we do, copy out the data.
+ */
+ fill_recv(sock, dev);
+
+ /*
+ * Did we satisfy it?
+ */
+ if (dev->n >= dev->minimum) {
+ dev->result = ISC_R_SUCCESS;
+ send_recvdone_event(sock, &dev);
+ }
+ }
+}
+
+/*
+ * Returns:
+ * DOIO_SUCCESS The operation succeeded. dev->result contains
+ * ISC_R_SUCCESS.
+ *
+ * DOIO_HARD A hard or unexpected I/O error was encountered.
+ * dev->result contains the appropriate error.
+ *
+ * DOIO_SOFT A soft I/O error was encountered. No senddone
+ * event was sent. The operation should be retried.
+ *
+ * No other return values are possible.
+ */
+static int
+completeio_send(isc_socket_t *sock, isc_socketevent_t *dev,
+ struct msghdr *messagehdr, int cc, int send_errno)
+{
+ char addrbuf[ISC_SOCKADDR_FORMATSIZE];
+ char strbuf[ISC_STRERRORSIZE];
+
+ if (send_errno != 0) {
+ if (SOFT_ERROR(send_errno))
+ return (DOIO_SOFT);
+
+ return (map_socket_error(sock, send_errno, &dev->result,
+ strbuf, sizeof(strbuf)));
+
+ /*
+ * The other error types depend on whether or not the
+ * socket is UDP or TCP. If it is UDP, some errors
+ * that we expect to be fatal under TCP are merely
+ * annoying, and are really soft errors.
+ *
+ * However, these soft errors are still returned as
+ * a status.
+ */
+ isc_sockaddr_format(&dev->address, addrbuf, sizeof(addrbuf));
+ isc__strerror(send_errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "completeio_send: %s: %s",
+ addrbuf, strbuf);
+ dev->result = isc__errno2result(send_errno);
+ return (DOIO_HARD);
+ }
+
+ /*
+ * If we write less than we expected, update counters, poke.
+ */
+ dev->n += cc;
+ if (cc != messagehdr->msg_totallen)
+ return (DOIO_SOFT);
+
+ /*
+ * Exactly what we wanted to write. We're done with this
+ * entry. Post its completion event.
+ */
+ dev->result = ISC_R_SUCCESS;
+ return (DOIO_SUCCESS);
+}
+
+static int
+startio_send(isc_socket_t *sock, isc_socketevent_t *dev, int *nbytes,
+ int *send_errno)
+{
+ char *cmsg = NULL;
+ char strbuf[ISC_STRERRORSIZE];
+ IoCompletionInfo *lpo;
+ int status;
+ struct msghdr *msghdr;
+
+ lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle,
+ HEAP_ZERO_MEMORY,
+ sizeof(IoCompletionInfo));
+ RUNTIME_CHECK(lpo != NULL);
+ lpo->request_type = SOCKET_SEND;
+ lpo->dev = dev;
+ msghdr = &lpo->messagehdr;
+ memset(msghdr, 0, sizeof(struct msghdr));
+ ISC_LIST_INIT(lpo->bufferlist);
+
+ build_msghdr_send(sock, dev, msghdr, cmsg, sock->iov, lpo);
+
+ *nbytes = internal_sendmsg(sock, lpo, msghdr, 0, send_errno);
+
+ if (*nbytes < 0) {
+ /*
+ * I/O has been initiated
+ * completion will be through the completion port
+ */
+ if (PENDING_ERROR(*send_errno)) {
+ status = DOIO_PENDING;
+ goto done;
+ }
+
+ if (SOFT_ERROR(*send_errno)) {
+ status = DOIO_SOFT;
+ goto done;
+ }
+
+ /*
+ * If we got this far then something is wrong
+ */
+ if (isc_log_wouldlog(isc_lctx, IOEVENT_LEVEL)) {
+ isc__strerror(*send_errno, strbuf, sizeof(strbuf));
+ socket_log(__LINE__, sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_INTERNALSEND,
+ "startio_send: internal_sendmsg(%d) %d "
+ "bytes, err %d/%s",
+ sock->fd, *nbytes, *send_errno, strbuf);
+ }
+ status = DOIO_HARD;
+ goto done;
+ }
+ dev->result = ISC_R_SUCCESS;
+ status = DOIO_SOFT;
+ done:
+ _set_state(sock, SOCK_DATA);
+ return (status);
+}
+
+static isc_result_t
+allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type,
+ isc_socket_t **socketp) {
+ isc_socket_t *sock;
+ isc_result_t result;
+
+ sock = isc_mem_get(manager->mctx, sizeof(*sock));
+
+ if (sock == NULL)
+ return (ISC_R_NOMEMORY);
+
+ sock->magic = 0;
+ sock->references = 0;
+
+ sock->manager = manager;
+ sock->type = type;
+ sock->fd = INVALID_SOCKET;
+
+ ISC_LINK_INIT(sock, link);
+
+ /*
+ * set up list of readers and writers to be initially empty
+ */
+ ISC_LIST_INIT(sock->recv_list);
+ ISC_LIST_INIT(sock->send_list);
+ ISC_LIST_INIT(sock->accept_list);
+ sock->connect_ev = NULL;
+ sock->pending_accept = 0;
+ sock->pending_recv = 0;
+ sock->pending_send = 0;
+ sock->pending_iocp = 0;
+ sock->listener = 0;
+ sock->connected = 0;
+ sock->pending_connect = 0;
+ sock->bound = 0;
+ sock->dupped = 0;
+ memset(sock->name, 0, sizeof(sock->name)); // zero the name field
+ _set_state(sock, SOCK_INITIALIZED);
+
+ sock->recvbuf.len = 65536;
+ sock->recvbuf.consume_position = sock->recvbuf.base;
+ sock->recvbuf.remaining = 0;
+ sock->recvbuf.base = isc_mem_get(manager->mctx, sock->recvbuf.len); // max buffer size
+ if (sock->recvbuf.base == NULL) {
+ sock->magic = 0;
+ goto error;
+ }
+
+ /*
+ * initialize the lock
+ */
+ result = isc_mutex_init(&sock->lock);
+ if (result != ISC_R_SUCCESS) {
+ sock->magic = 0;
+ isc_mem_put(manager->mctx, sock->recvbuf.base, sock->recvbuf.len);
+ sock->recvbuf.base = NULL;
+ goto error;
+ }
+
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "allocated");
+
+ sock->magic = SOCKET_MAGIC;
+ *socketp = sock;
+
+ return (ISC_R_SUCCESS);
+
+ error:
+ isc_mem_put(manager->mctx, sock, sizeof(*sock));
+
+ return (result);
+}
+
+/*
+ * Verify that the socket state is consistent.
+ */
+static void
+consistent(isc_socket_t *sock) {
+
+ isc_socketevent_t *dev;
+ isc_socket_newconnev_t *nev;
+ unsigned int count;
+ char *crash_reason;
+ isc_boolean_t crash = ISC_FALSE;
+
+ REQUIRE(sock->pending_iocp == sock->pending_recv + sock->pending_send
+ + sock->pending_accept + sock->pending_connect);
+
+ dev = ISC_LIST_HEAD(sock->send_list);
+ count = 0;
+ while (dev != NULL) {
+ count++;
+ dev = ISC_LIST_NEXT(dev, ev_link);
+ }
+ if (count > sock->pending_send) {
+ crash = ISC_TRUE;
+ crash_reason = "send_list > sock->pending_send";
+ }
+
+ nev = ISC_LIST_HEAD(sock->accept_list);
+ count = 0;
+ while (nev != NULL) {
+ count++;
+ nev = ISC_LIST_NEXT(nev, ev_link);
+ }
+ if (count > sock->pending_accept) {
+ crash = ISC_TRUE;
+ crash_reason = "send_list > sock->pending_send";
+ }
+
+ if (crash) {
+ socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_DESTROYING, "SOCKET INCONSISTENT: %s",
+ crash_reason);
+ sock_dump(sock);
+ INSIST(crash == ISC_FALSE);
+ }
+}
+
+/*
+ * Maybe free the socket.
+ *
+ * This function will verify tht the socket is no longer in use in any way,
+ * either internally or externally. This is the only place where this
+ * check is to be made; if some bit of code believes that IT is done with
+ * the socket (e.g., some reference counter reaches zero), it should call
+ * this function.
+ *
+ * When calling this function, the socket must be locked, and the manager
+ * must be unlocked.
+ *
+ * When this function returns, *socketp will be NULL. No tricks to try
+ * to hold on to this pointer are allowed.
+ */
+static void
+maybe_free_socket(isc_socket_t **socketp, int lineno) {
+ isc_socket_t *sock = *socketp;
+ *socketp = NULL;
+
+ INSIST(VALID_SOCKET(sock));
+ CONSISTENT(sock);
+
+ if (sock->pending_iocp > 0
+ || sock->pending_recv > 0
+ || sock->pending_send > 0
+ || sock->pending_accept > 0
+ || sock->references > 0
+ || sock->pending_connect == 1
+ || !ISC_LIST_EMPTY(sock->recv_list)
+ || !ISC_LIST_EMPTY(sock->send_list)
+ || !ISC_LIST_EMPTY(sock->accept_list)
+ || sock->fd != INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return;
+ }
+ UNLOCK(&sock->lock);
+
+ free_socket(&sock, lineno);
+}
+
+void
+free_socket(isc_socket_t **sockp, int lineno) {
+ isc_socketmgr_t *manager;
+ isc_socket_t *sock = *sockp;
+ *sockp = NULL;
+
+ manager = sock->manager;
+
+ /*
+ * Seems we can free the socket after all.
+ */
+ manager = sock->manager;
+ socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_DESTROYING, "freeing socket line %d fd %d lock %p semaphore %p",
+ lineno, sock->fd, &sock->lock, sock->lock.LockSemaphore);
+
+ sock->magic = 0;
+ DESTROYLOCK(&sock->lock);
+
+ if (sock->recvbuf.base != NULL)
+ isc_mem_put(manager->mctx, sock->recvbuf.base, sock->recvbuf.len);
+
+ LOCK(&manager->lock);
+ if (ISC_LINK_LINKED(sock, link))
+ ISC_LIST_UNLINK(manager->socklist, sock, link);
+ isc_mem_put(manager->mctx, sock, sizeof(*sock));
+
+ if (ISC_LIST_EMPTY(manager->socklist))
+ SIGNAL(&manager->shutdown_ok);
+ UNLOCK(&manager->lock);
+}
+
+/*
+ * Create a new 'type' socket managed by 'manager'. Events
+ * will be posted to 'task' and when dispatched 'action' will be
+ * called with 'arg' as the arg value. The new socket is returned
+ * in 'socketp'.
+ */
+static isc_result_t
+socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
+ isc_socket_t **socketp, isc_socket_t *dup_socket)
+{
+ isc_socket_t *sock = NULL;
+ isc_result_t result;
+#if defined(USE_CMSG)
+ int on = 1;
+#endif
+#if defined(SO_RCVBUF)
+ ISC_SOCKADDR_LEN_T optlen;
+ int size;
+#endif
+ int socket_errno;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+ REQUIRE(type != isc_sockettype_fdwatch);
+
+ if (dup_socket != NULL)
+ return (ISC_R_NOTIMPLEMENTED);
+
+ result = allocate_socket(manager, type, &sock);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+
+ sock->pf = pf;
+#if 0
+ if (dup_socket == NULL) {
+#endif
+ switch (type) {
+ case isc_sockettype_udp:
+ sock->fd = socket(pf, SOCK_DGRAM, IPPROTO_UDP);
+ if (sock->fd != INVALID_SOCKET) {
+ result = connection_reset_fix(sock->fd);
+ if (result != ISC_R_SUCCESS) {
+ socket_log(__LINE__, sock,
+ NULL, EVENT, NULL, 0, 0,
+ "closed %d %d %d "
+ "con_reset_fix_failed",
+ sock->pending_recv,
+ sock->pending_send,
+ sock->references);
+ closesocket(sock->fd);
+ _set_state(sock, SOCK_CLOSED);
+ sock->fd = INVALID_SOCKET;
+ free_socket(&sock, __LINE__);
+ return (result);
+ }
+ }
+ break;
+ case isc_sockettype_tcp:
+ sock->fd = socket(pf, SOCK_STREAM, IPPROTO_TCP);
+ break;
+ }
+#if 0
+ } else {
+ /*
+ * XXX: dup() is deprecated in windows, use _dup()
+ * instead. In future we may want to investigate
+ * WSADuplicateSocket().
+ */
+ sock->fd = _dup(dup_socket->fd);
+ sock->dupped = 1;
+ sock->bound = dup_socket->bound;
+ }
+#endif
+
+ if (sock->fd == INVALID_SOCKET) {
+ socket_errno = WSAGetLastError();
+ free_socket(&sock, __LINE__);
+
+ switch (socket_errno) {
+ case WSAEMFILE:
+ case WSAENOBUFS:
+ return (ISC_R_NORESOURCES);
+
+ case WSAEPROTONOSUPPORT:
+ case WSAEPFNOSUPPORT:
+ case WSAEAFNOSUPPORT:
+ return (ISC_R_FAMILYNOSUPPORT);
+
+ default:
+ isc__strerror(socket_errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "socket() %s: %s",
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+
+ result = make_nonblock(sock->fd);
+ if (result != ISC_R_SUCCESS) {
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "closed %d %d %d make_nonblock_failed",
+ sock->pending_recv, sock->pending_send,
+ sock->references);
+ closesocket(sock->fd);
+ sock->fd = INVALID_SOCKET;
+ free_socket(&sock, __LINE__);
+ return (result);
+ }
+
+
+#if defined(USE_CMSG) || defined(SO_RCVBUF)
+ if (type == isc_sockettype_udp) {
+
+#if defined(USE_CMSG)
+#if defined(ISC_PLATFORM_HAVEIPV6)
+#ifdef IPV6_RECVPKTINFO
+ /* 2292bis */
+ if ((pf == AF_INET6)
+ && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_RECVPKTINFO,
+ (char *)&on, sizeof(on)) < 0)) {
+ isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, IPV6_RECVPKTINFO) "
+ "%s: %s", sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+#else
+ /* 2292 */
+ if ((pf == AF_INET6)
+ && (setsockopt(sock->fd, IPPROTO_IPV6, IPV6_PKTINFO,
+ (char *)&on, sizeof(on)) < 0)) {
+ isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d, IPV6_PKTINFO) %s: %s",
+ sock->fd,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED,
+ "failed"),
+ strbuf);
+ }
+#endif /* IPV6_RECVPKTINFO */
+#ifdef IPV6_USE_MIN_MTU /*2292bis, not too common yet*/
+ /* use minimum MTU */
+ if (pf == AF_INET6) {
+ (void)setsockopt(sock->fd, IPPROTO_IPV6,
+ IPV6_USE_MIN_MTU,
+ (char *)&on, sizeof(on));
+ }
+#endif
+#endif /* ISC_PLATFORM_HAVEIPV6 */
+#endif /* defined(USE_CMSG) */
+
+#if defined(SO_RCVBUF)
+ optlen = sizeof(size);
+ if (getsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF,
+ (char *)&size, &optlen) >= 0 &&
+ size < RCVBUFSIZE) {
+ size = RCVBUFSIZE;
+ (void)setsockopt(sock->fd, SOL_SOCKET, SO_RCVBUF,
+ (char *)&size, sizeof(size));
+ }
+#endif
+
+ }
+#endif /* defined(USE_CMSG) || defined(SO_RCVBUF) */
+
+ _set_state(sock, SOCK_OPEN);
+ sock->references = 1;
+ *socketp = sock;
+
+ iocompletionport_update(sock);
+
+ /*
+ * Note we don't have to lock the socket like we normally would because
+ * there are no external references to it yet.
+ */
+ LOCK(&manager->lock);
+ ISC_LIST_APPEND(manager->socklist, sock, link);
+ InterlockedIncrement(&manager->totalSockets);
+ UNLOCK(&manager->lock);
+
+ socket_log(__LINE__, sock, NULL, CREATION, isc_msgcat,
+ ISC_MSGSET_SOCKET, ISC_MSG_CREATED,
+ "created %u type %u", sock->fd, type);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
+ isc_socket_t **socketp)
+{
+ return (socket_create(manager, pf, type, socketp, NULL));
+}
+
+isc_result_t
+isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp) {
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+
+#if 1
+ return (ISC_R_NOTIMPLEMENTED);
+#else
+ return (socket_create(sock->manager, sock->pf, sock->type,
+ socketp, sock));
+#endif
+}
+
+isc_result_t
+isc_socket_open(isc_socket_t *sock) {
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+/*
+ * Attach to a socket. Caller must explicitly detach when it is done.
+ */
+void
+isc__socket_attach(isc_socket_t *sock, isc_socket_t **socketp) {
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(socketp != NULL && *socketp == NULL);
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+ sock->references++;
+ UNLOCK(&sock->lock);
+
+ *socketp = sock;
+}
+
+/*
+ * Dereference a socket. If this is the last reference to it, clean things
+ * up by destroying the socket.
+ */
+void
+isc__socket_detach(isc_socket_t **socketp) {
+ isc_socket_t *sock;
+ isc_boolean_t kill_socket = ISC_FALSE;
+
+ REQUIRE(socketp != NULL);
+ sock = *socketp;
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+ REQUIRE(sock->references > 0);
+ sock->references--;
+
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "detach_socket %d %d %d",
+ sock->pending_recv, sock->pending_send,
+ sock->references);
+
+ if (sock->references == 0 && sock->fd != INVALID_SOCKET) {
+ closesocket(sock->fd);
+ sock->fd = INVALID_SOCKET;
+ _set_state(sock, SOCK_CLOSED);
+ }
+
+ maybe_free_socket(&sock, __LINE__);
+
+ *socketp = NULL;
+}
+
+isc_result_t
+isc_socket_close(isc_socket_t *sock) {
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+/*
+ * Dequeue an item off the given socket's read queue, set the result code
+ * in the done event to the one provided, and send it to the task it was
+ * destined for.
+ *
+ * If the event to be sent is on a list, remove it before sending. If
+ * asked to, send and detach from the task as well.
+ *
+ * Caller must have the socket locked if the event is attached to the socket.
+ */
+static void
+send_recvdone_event(isc_socket_t *sock, isc_socketevent_t **dev) {
+ isc_task_t *task;
+
+ task = (*dev)->ev_sender;
+ (*dev)->ev_sender = sock;
+
+ if (ISC_LINK_LINKED(*dev, ev_link))
+ ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link);
+
+ if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
+ == ISC_SOCKEVENTATTR_ATTACHED)
+ isc_task_sendanddetach(&task, (isc_event_t **)dev);
+ else
+ isc_task_send(task, (isc_event_t **)dev);
+
+ CONSISTENT(sock);
+}
+
+/*
+ * See comments for send_recvdone_event() above.
+ */
+static void
+send_senddone_event(isc_socket_t *sock, isc_socketevent_t **dev) {
+ isc_task_t *task;
+
+ INSIST(dev != NULL && *dev != NULL);
+
+ task = (*dev)->ev_sender;
+ (*dev)->ev_sender = sock;
+
+ if (ISC_LINK_LINKED(*dev, ev_link))
+ ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link);
+
+ if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED)
+ == ISC_SOCKEVENTATTR_ATTACHED)
+ isc_task_sendanddetach(&task, (isc_event_t **)dev);
+ else
+ isc_task_send(task, (isc_event_t **)dev);
+
+ CONSISTENT(sock);
+}
+
+/*
+ * See comments for send_recvdone_event() above.
+ */
+static void
+send_acceptdone_event(isc_socket_t *sock, isc_socket_newconnev_t **adev) {
+ isc_task_t *task;
+
+ INSIST(adev != NULL && *adev != NULL);
+
+ task = (*adev)->ev_sender;
+ (*adev)->ev_sender = sock;
+
+ if (ISC_LINK_LINKED(*adev, ev_link))
+ ISC_LIST_DEQUEUE(sock->accept_list, *adev, ev_link);
+
+ isc_task_sendanddetach(&task, (isc_event_t **)adev);
+
+ CONSISTENT(sock);
+}
+
+/*
+ * See comments for send_recvdone_event() above.
+ */
+static void
+send_connectdone_event(isc_socket_t *sock, isc_socket_connev_t **cdev) {
+ isc_task_t *task;
+
+ INSIST(cdev != NULL && *cdev != NULL);
+
+ task = (*cdev)->ev_sender;
+ (*cdev)->ev_sender = sock;
+
+ sock->connect_ev = NULL;
+
+ isc_task_sendanddetach(&task, (isc_event_t **)cdev);
+
+ CONSISTENT(sock);
+}
+
+/*
+ * On entry to this function, the event delivered is the internal
+ * readable event, and the first item on the accept_list should be
+ * the done event we want to send. If the list is empty, this is a no-op,
+ * so just close the new connection, unlock, and return.
+ *
+ * Note the socket is locked before entering here
+ */
+static void
+internal_accept(isc_socket_t *sock, IoCompletionInfo *lpo, int accept_errno) {
+ isc_socket_newconnev_t *adev;
+ isc_result_t result = ISC_R_SUCCESS;
+ isc_socket_t *nsock;
+ struct sockaddr *localaddr;
+ int localaddr_len = sizeof(*localaddr);
+ struct sockaddr *remoteaddr;
+ int remoteaddr_len = sizeof(*remoteaddr);
+
+ INSIST(VALID_SOCKET(sock));
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ socket_log(__LINE__, sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK,
+ "internal_accept called");
+
+ INSIST(sock->listener);
+
+ INSIST(sock->pending_iocp > 0);
+ sock->pending_iocp--;
+ INSIST(sock->pending_accept > 0);
+ sock->pending_accept--;
+
+ adev = lpo->adev;
+
+ /*
+ * If the event is no longer in the list we can just return.
+ */
+ if (!acceptdone_is_active(sock, adev))
+ goto done;
+
+ nsock = adev->newsocket;
+
+ /*
+ * Pull off the done event.
+ */
+ ISC_LIST_UNLINK(sock->accept_list, adev, ev_link);
+
+ /*
+ * Extract the addresses from the socket, copy them into the structure,
+ * and return the new socket.
+ */
+ ISCGetAcceptExSockaddrs(lpo->acceptbuffer, 0,
+ sizeof(SOCKADDR_STORAGE) + 16, sizeof(SOCKADDR_STORAGE) + 16,
+ (LPSOCKADDR *)&localaddr, &localaddr_len,
+ (LPSOCKADDR *)&remoteaddr, &remoteaddr_len);
+ memcpy(&adev->address.type, remoteaddr, remoteaddr_len);
+ adev->address.length = remoteaddr_len;
+ nsock->address = adev->address;
+ nsock->pf = adev->address.type.sa.sa_family;
+
+ socket_log(__LINE__, nsock, &nsock->address, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK,
+ "internal_accept parent %p", sock);
+
+ result = make_nonblock(adev->newsocket->fd);
+ INSIST(result == ISC_R_SUCCESS);
+
+ INSIST(setsockopt(nsock->fd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
+ (char *)&sock->fd, sizeof(sock->fd)) == 0);
+
+ /*
+ * Hook it up into the manager.
+ */
+ nsock->bound = 1;
+ nsock->connected = 1;
+ _set_state(nsock, SOCK_OPEN);
+
+ LOCK(&nsock->manager->lock);
+ ISC_LIST_APPEND(nsock->manager->socklist, nsock, link);
+ InterlockedIncrement(&nsock->manager->totalSockets);
+ UNLOCK(&nsock->manager->lock);
+
+ socket_log(__LINE__, sock, &nsock->address, CREATION,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN,
+ "accepted_connection new_socket %p fd %d",
+ nsock, nsock->fd);
+
+ adev->result = result;
+ send_acceptdone_event(sock, &adev);
+
+done:
+ CONSISTENT(sock);
+ UNLOCK(&sock->lock);
+
+ HeapFree(hHeapHandle, 0, lpo->acceptbuffer);
+ lpo->acceptbuffer = NULL;
+}
+
+/*
+ * Called when a socket with a pending connect() finishes.
+ * Note that the socket is locked before entering.
+ */
+static void
+internal_connect(isc_socket_t *sock, IoCompletionInfo *lpo, int connect_errno) {
+ isc_socket_connev_t *cdev;
+ char strbuf[ISC_STRERRORSIZE];
+
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+
+ INSIST(sock->pending_iocp > 0);
+ sock->pending_iocp--;
+ INSIST(sock->pending_connect == 1);
+ sock->pending_connect = 0;
+
+ /*
+ * Has this event been canceled?
+ */
+ cdev = lpo->cdev;
+ if (!connectdone_is_active(sock, cdev)) {
+ sock->pending_connect = 0;
+ if (sock->fd != INVALID_SOCKET) {
+ closesocket(sock->fd);
+ sock->fd = INVALID_SOCKET;
+ _set_state(sock, SOCK_CLOSED);
+ }
+ CONSISTENT(sock);
+ UNLOCK(&sock->lock);
+ return;
+ }
+
+ /*
+ * Check possible Windows network event error status here.
+ */
+ if (connect_errno != 0) {
+ /*
+ * If the error is SOFT, just try again on this
+ * fd and pretend nothing strange happened.
+ */
+ if (SOFT_ERROR(connect_errno) ||
+ connect_errno == WSAEINPROGRESS) {
+ sock->pending_connect = 1;
+ CONSISTENT(sock);
+ UNLOCK(&sock->lock);
+ return;
+ }
+
+ /*
+ * Translate other errors into ISC_R_* flavors.
+ */
+ switch (connect_errno) {
+#define ERROR_MATCH(a, b) case a: cdev->result = b; break;
+ ERROR_MATCH(WSAEACCES, ISC_R_NOPERM);
+ ERROR_MATCH(WSAEADDRNOTAVAIL, ISC_R_ADDRNOTAVAIL);
+ ERROR_MATCH(WSAEAFNOSUPPORT, ISC_R_ADDRNOTAVAIL);
+ ERROR_MATCH(WSAECONNREFUSED, ISC_R_CONNREFUSED);
+ ERROR_MATCH(WSAEHOSTUNREACH, ISC_R_HOSTUNREACH);
+ ERROR_MATCH(WSAEHOSTDOWN, ISC_R_HOSTDOWN);
+ ERROR_MATCH(WSAENETUNREACH, ISC_R_NETUNREACH);
+ ERROR_MATCH(WSAENETDOWN, ISC_R_NETDOWN);
+ ERROR_MATCH(WSAENOBUFS, ISC_R_NORESOURCES);
+ ERROR_MATCH(WSAECONNRESET, ISC_R_CONNECTIONRESET);
+ ERROR_MATCH(WSAECONNABORTED, ISC_R_CONNECTIONRESET);
+ ERROR_MATCH(WSAETIMEDOUT, ISC_R_TIMEDOUT);
+#undef ERROR_MATCH
+ default:
+ cdev->result = ISC_R_UNEXPECTED;
+ isc__strerror(connect_errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "internal_connect: connect() %s",
+ strbuf);
+ }
+ } else {
+ INSIST(setsockopt(sock->fd, SOL_SOCKET,
+ SO_UPDATE_CONNECT_CONTEXT, NULL, 0) == 0);
+ cdev->result = ISC_R_SUCCESS;
+ sock->connected = 1;
+ socket_log(__LINE__, sock, &sock->address, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTEDCXN,
+ "internal_connect: success");
+ }
+
+ send_connectdone_event(sock, &cdev);
+
+ UNLOCK(&sock->lock);
+}
+
+/*
+ * Loop through the socket, returning ISC_R_EOF for each done event pending.
+ */
+static void
+send_recvdone_abort(isc_socket_t *sock, isc_result_t result) {
+ isc_socketevent_t *dev;
+
+ while (!ISC_LIST_EMPTY(sock->recv_list)) {
+ dev = ISC_LIST_HEAD(sock->recv_list);
+ dev->result = result;
+ send_recvdone_event(sock, &dev);
+ }
+}
+
+/*
+ * Take the data we received in our private buffer, and if any recv() calls on
+ * our list are satisfied, send the corresponding done event.
+ *
+ * If we need more data (there are still items on the recv_list after we consume all
+ * our data) then arrange for another system recv() call to fill our buffers.
+ */
+static void
+internal_recv(isc_socket_t *sock, int nbytes)
+{
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ socket_log(__LINE__, sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALRECV,
+ "internal_recv: %d bytes received", nbytes);
+
+ /*
+ * If we got here, the I/O operation succeeded. However, we might still have removed this
+ * event from our notification list (or never placed it on it due to immediate completion.)
+ * Handle the reference counting here, and handle the cancellation event just after.
+ */
+ INSIST(sock->pending_iocp > 0);
+ sock->pending_iocp--;
+ INSIST(sock->pending_recv > 0);
+ sock->pending_recv--;
+
+ /*
+ * The only way we could have gotten here is that our I/O has successfully completed.
+ * Update our pointers, and move on. The only odd case here is that we might not
+ * have received enough data on a TCP stream to satisfy the minimum requirements. If
+ * this is the case, we will re-issue the recv() call for what we need.
+ *
+ * We do check for a recv() of 0 bytes on a TCP stream. This means the remote end
+ * has closed.
+ */
+ if (nbytes == 0 && sock->type == isc_sockettype_tcp) {
+ send_recvdone_abort(sock, ISC_R_EOF);
+ maybe_free_socket(&sock, __LINE__);
+ return;
+ }
+ sock->recvbuf.remaining = nbytes;
+ sock->recvbuf.consume_position = sock->recvbuf.base;
+ completeio_recv(sock);
+
+ /*
+ * If there are more receivers waiting for data, queue another receive
+ * here.
+ */
+ queue_receive_request(sock);
+
+ /*
+ * Unlock and/or destroy if we are the last thing this socket has left to do.
+ */
+ maybe_free_socket(&sock, __LINE__);
+}
+
+static void
+internal_send(isc_socket_t *sock, isc_socketevent_t *dev,
+ struct msghdr *messagehdr, int nbytes, int send_errno, IoCompletionInfo *lpo)
+{
+ buflist_t *buffer;
+
+ /*
+ * Find out what socket this is and lock it.
+ */
+ INSIST(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ socket_log(__LINE__, sock, NULL, IOEVENT,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_INTERNALSEND,
+ "internal_send: task got socket event %p", dev);
+
+ buffer = ISC_LIST_HEAD(lpo->bufferlist);
+ while (buffer != NULL) {
+ ISC_LIST_DEQUEUE(lpo->bufferlist, buffer, link);
+
+ socket_log(__LINE__, sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_ACCEPTLOCK,
+ "free_buffer %p %p", buffer, buffer->buf);
+
+ HeapFree(hHeapHandle, 0, buffer->buf);
+ HeapFree(hHeapHandle, 0, buffer);
+ buffer = ISC_LIST_HEAD(lpo->bufferlist);
+ }
+
+ INSIST(sock->pending_iocp > 0);
+ sock->pending_iocp--;
+ INSIST(sock->pending_send > 0);
+ sock->pending_send--;
+
+ /* If the event is no longer in the list we can just return */
+ if (!senddone_is_active(sock, dev))
+ goto done;
+
+ /*
+ * Set the error code and send things on its way.
+ */
+ switch (completeio_send(sock, dev, messagehdr, nbytes, send_errno)) {
+ case DOIO_SOFT:
+ break;
+ case DOIO_HARD:
+ case DOIO_SUCCESS:
+ send_senddone_event(sock, &dev);
+ break;
+ }
+
+ done:
+ maybe_free_socket(&sock, __LINE__);
+}
+
+/*
+ * These return if the done event passed in is on the list (or for connect, is
+ * the one we're waiting for. Using these ensures we will not double-send an
+ * event.
+ */
+static isc_boolean_t
+senddone_is_active(isc_socket_t *sock, isc_socketevent_t *dev)
+{
+ isc_socketevent_t *ldev;
+
+ ldev = ISC_LIST_HEAD(sock->send_list);
+ while (ldev != NULL && ldev != dev)
+ ldev = ISC_LIST_NEXT(ldev, ev_link);
+
+ return (ldev == NULL ? ISC_FALSE : ISC_TRUE);
+}
+
+static isc_boolean_t
+acceptdone_is_active(isc_socket_t *sock, isc_socket_newconnev_t *dev)
+{
+ isc_socket_newconnev_t *ldev;
+
+ ldev = ISC_LIST_HEAD(sock->accept_list);
+ while (ldev != NULL && ldev != dev)
+ ldev = ISC_LIST_NEXT(ldev, ev_link);
+
+ return (ldev == NULL ? ISC_FALSE : ISC_TRUE);
+}
+
+static isc_boolean_t
+connectdone_is_active(isc_socket_t *sock, isc_socket_connev_t *dev)
+{
+ return (sock->connect_ev == dev ? ISC_TRUE : ISC_FALSE);
+}
+
+//
+// The Windows network stack seems to have two very distinct paths depending
+// on what is installed. Specifically, if something is looking at network
+// connections (like an anti-virus or anti-malware application, such as
+// McAfee products) Windows may return additional error conditions which
+// were not previously returned.
+//
+// One specific one is when a TCP SYN scan is used. In this situation,
+// Windows responds with the SYN-ACK, but the scanner never responds with
+// the 3rd packet, the ACK. Windows consiers this a partially open connection.
+// Most Unix networking stacks, and Windows without McAfee installed, will
+// not return this to the caller. However, with this product installed,
+// Windows returns this as a failed status on the Accept() call. Here, we
+// will just re-issue the ISCAcceptEx() call as if nothing had happened.
+//
+// This code should only be called when the listening socket has received
+// such an error. Additionally, the "parent" socket must be locked.
+// Additionally, the lpo argument is re-used here, and must not be freed
+// by the caller.
+//
+static isc_result_t
+restart_accept(isc_socket_t *parent, IoCompletionInfo *lpo)
+{
+ isc_socket_t *nsock = lpo->adev->newsocket;
+ SOCKET new_fd;
+
+ /*
+ * AcceptEx() requires we pass in a socket. Note that we carefully
+ * do not close the previous socket in case of an error message returned by
+ * our new socket() call. If we return an error here, our caller will
+ * clean up.
+ */
+ new_fd = socket(parent->pf, SOCK_STREAM, IPPROTO_TCP);
+ if (nsock->fd == INVALID_SOCKET) {
+ return (ISC_R_FAILURE); // parent will ask windows for error message
+ }
+ closesocket(nsock->fd);
+ nsock->fd = new_fd;
+
+ memset(&lpo->overlapped, 0, sizeof(lpo->overlapped));
+
+ ISCAcceptEx(parent->fd,
+ nsock->fd, /* Accepted Socket */
+ lpo->acceptbuffer, /* Buffer for initial Recv */
+ 0, /* Length of Buffer */
+ sizeof(SOCKADDR_STORAGE) + 16, /* Local address length + 16 */
+ sizeof(SOCKADDR_STORAGE) + 16, /* Remote address lengh + 16 */
+ (LPDWORD)&lpo->received_bytes, /* Bytes Recved */
+ (LPOVERLAPPED)lpo /* Overlapped structure */
+ );
+
+ InterlockedDecrement(&nsock->manager->iocp_total);
+ iocompletionport_update(nsock);
+
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * This is the I/O Completion Port Worker Function. It loops forever
+ * waiting for I/O to complete and then forwards them for further
+ * processing. There are a number of these in separate threads.
+ */
+static isc_threadresult_t WINAPI
+SocketIoThread(LPVOID ThreadContext) {
+ isc_socketmgr_t *manager = ThreadContext;
+ BOOL bSuccess = FALSE;
+ DWORD nbytes;
+ IoCompletionInfo *lpo = NULL;
+ isc_socket_t *sock = NULL;
+ int request;
+ struct msghdr *messagehdr = NULL;
+ int errval;
+ char strbuf[ISC_STRERRORSIZE];
+ int errstatus;
+
+ REQUIRE(VALID_MANAGER(manager));
+
+ /*
+ * Set the thread priority high enough so I/O will
+ * preempt normal recv packet processing, but not
+ * higher than the timer sync thread.
+ */
+ if (!SetThreadPriority(GetCurrentThread(),
+ THREAD_PRIORITY_ABOVE_NORMAL)) {
+ errval = GetLastError();
+ isc__strerror(errval, strbuf, sizeof(strbuf));
+ FATAL_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_FAILED,
+ "Can't set thread priority: %s"),
+ strbuf);
+ }
+
+ /*
+ * Loop forever waiting on I/O Completions and then processing them
+ */
+ while (TRUE) {
+ wait_again:
+ bSuccess = GetQueuedCompletionStatus(manager->hIoCompletionPort,
+ &nbytes, (LPDWORD)&sock,
+ (LPWSAOVERLAPPED *)&lpo,
+ INFINITE);
+ if (lpo == NULL) /* Received request to exit */
+ break;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ request = lpo->request_type;
+
+ errstatus = 0;
+ if (!bSuccess) {
+ isc_result_t isc_result;
+
+ /*
+ * Did the I/O operation complete?
+ */
+ errstatus = GetLastError();
+ isc_result = isc__errno2resultx(errstatus, __FILE__, __LINE__);
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+ switch (request) {
+ case SOCKET_RECV:
+ INSIST(sock->pending_iocp > 0);
+ sock->pending_iocp--;
+ INSIST(sock->pending_recv > 0);
+ sock->pending_recv--;
+ if (!sock->connected &&
+ ((errstatus == ERROR_HOST_UNREACHABLE) ||
+ (errstatus == WSAENETRESET) ||
+ (errstatus == WSAECONNRESET))) {
+ /* ignore soft errors */
+ queue_receive_request(sock);
+ break;
+ }
+ send_recvdone_abort(sock, isc_result);
+ if (isc_result == ISC_R_UNEXPECTED) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "SOCKET_RECV: Windows error code: %d, returning ISC error %d",
+ errstatus, isc_result);
+ }
+ break;
+
+ case SOCKET_SEND:
+ INSIST(sock->pending_iocp > 0);
+ sock->pending_iocp--;
+ INSIST(sock->pending_send > 0);
+ sock->pending_send--;
+ if (senddone_is_active(sock, lpo->dev)) {
+ lpo->dev->result = isc_result;
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "canceled_send");
+ send_senddone_event(sock, &lpo->dev);
+ }
+ break;
+
+ case SOCKET_ACCEPT:
+ INSIST(sock->pending_iocp > 0);
+ INSIST(sock->pending_accept > 0);
+
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "Accept: errstatus=%d isc_result=%d", errstatus, isc_result);
+
+ if (acceptdone_is_active(sock, lpo->adev)) {
+ if (restart_accept(sock, lpo) == ISC_R_SUCCESS) {
+ UNLOCK(&sock->lock);
+ goto wait_again;
+ } else {
+ errstatus = GetLastError();
+ isc_result = isc__errno2resultx(errstatus, __FILE__, __LINE__);
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "restart_accept() failed: errstatus=%d isc_result=%d",
+ errstatus, isc_result);
+ }
+ }
+
+ sock->pending_iocp--;
+ sock->pending_accept--;
+ if (acceptdone_is_active(sock, lpo->adev)) {
+ closesocket(lpo->adev->newsocket->fd);
+ lpo->adev->newsocket->fd = INVALID_SOCKET;
+ lpo->adev->newsocket->references--;
+ free_socket(&lpo->adev->newsocket, __LINE__);
+ lpo->adev->result = isc_result;
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "canceled_accept");
+ send_acceptdone_event(sock, &lpo->adev);
+ }
+ break;
+
+ case SOCKET_CONNECT:
+ INSIST(sock->pending_iocp > 0);
+ sock->pending_iocp--;
+ INSIST(sock->pending_connect == 1);
+ sock->pending_connect = 0;
+ if (connectdone_is_active(sock, lpo->cdev)) {
+ lpo->cdev->result = isc_result;
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "canceled_connect");
+ send_connectdone_event(sock, &lpo->cdev);
+ }
+ break;
+ }
+ maybe_free_socket(&sock, __LINE__);
+
+ if (lpo != NULL)
+ HeapFree(hHeapHandle, 0, lpo);
+ continue;
+ }
+
+ messagehdr = &lpo->messagehdr;
+
+ switch (request) {
+ case SOCKET_RECV:
+ internal_recv(sock, nbytes);
+ break;
+ case SOCKET_SEND:
+ internal_send(sock, lpo->dev, messagehdr, nbytes, errstatus, lpo);
+ break;
+ case SOCKET_ACCEPT:
+ internal_accept(sock, lpo, errstatus);
+ break;
+ case SOCKET_CONNECT:
+ internal_connect(sock, lpo, errstatus);
+ break;
+ }
+
+ if (lpo != NULL)
+ HeapFree(hHeapHandle, 0, lpo);
+ }
+
+ /*
+ * Exit Completion Port Thread
+ */
+ manager_log(manager, TRACE,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_EXITING, "SocketIoThread exiting"));
+ return ((isc_threadresult_t)0);
+}
+
+/*
+ * Create a new socket manager.
+ */
+isc_result_t
+isc__socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp) {
+ return (isc_socketmgr_create2(mctx, managerp, 0));
+}
+
+isc_result_t
+isc__socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
+ unsigned int maxsocks)
+{
+ isc_socketmgr_t *manager;
+ isc_result_t result;
+
+ REQUIRE(managerp != NULL && *managerp == NULL);
+
+ if (maxsocks != 0)
+ return (ISC_R_NOTIMPLEMENTED);
+
+ manager = isc_mem_get(mctx, sizeof(*manager));
+ if (manager == NULL)
+ return (ISC_R_NOMEMORY);
+
+ InitSockets();
+
+ manager->magic = SOCKET_MANAGER_MAGIC;
+ manager->mctx = NULL;
+ manager->stats = NULL;
+ ISC_LIST_INIT(manager->socklist);
+ result = isc_mutex_init(&manager->lock);
+ if (result != ISC_R_SUCCESS) {
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ return (result);
+ }
+ if (isc_condition_init(&manager->shutdown_ok) != ISC_R_SUCCESS) {
+ DESTROYLOCK(&manager->lock);
+ isc_mem_put(mctx, manager, sizeof(*manager));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_condition_init() %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ return (ISC_R_UNEXPECTED);
+ }
+
+ isc_mem_attach(mctx, &manager->mctx);
+
+ iocompletionport_init(manager); /* Create the Completion Ports */
+
+ manager->bShutdown = ISC_FALSE;
+ manager->totalSockets = 0;
+ manager->iocp_total = 0;
+
+ *managerp = manager;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp) {
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(nsockp != NULL);
+
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+void
+isc__socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats) {
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(ISC_LIST_EMPTY(manager->socklist));
+ REQUIRE(manager->stats == NULL);
+ REQUIRE(isc_stats_ncounters(stats) == isc_sockstatscounter_max);
+
+ isc_stats_attach(stats, &manager->stats);
+}
+
+void
+isc__socketmgr_destroy(isc_socketmgr_t **managerp) {
+ isc_socketmgr_t *manager;
+ int i;
+ isc_mem_t *mctx;
+
+ /*
+ * Destroy a socket manager.
+ */
+
+ REQUIRE(managerp != NULL);
+ manager = *managerp;
+ REQUIRE(VALID_MANAGER(manager));
+
+ LOCK(&manager->lock);
+
+ /*
+ * Wait for all sockets to be destroyed.
+ */
+ while (!ISC_LIST_EMPTY(manager->socklist)) {
+ manager_log(manager, CREATION,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_SOCKETSREMAIN,
+ "sockets exist"));
+ WAIT(&manager->shutdown_ok, &manager->lock);
+ }
+
+ UNLOCK(&manager->lock);
+
+ /*
+ * Here, we need to had some wait code for the completion port
+ * thread.
+ */
+ signal_iocompletionport_exit(manager);
+ manager->bShutdown = ISC_TRUE;
+
+ /*
+ * Wait for threads to exit.
+ */
+ for (i = 0; i < manager->maxIOCPThreads; i++) {
+ if (isc_thread_join((isc_thread_t) manager->hIOCPThreads[i],
+ NULL) != ISC_R_SUCCESS)
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "isc_thread_join() for Completion Port %s",
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ }
+ /*
+ * Clean up.
+ */
+
+ CloseHandle(manager->hIoCompletionPort);
+
+ (void)isc_condition_destroy(&manager->shutdown_ok);
+
+ DESTROYLOCK(&manager->lock);
+ if (manager->stats != NULL)
+ isc_stats_detach(&manager->stats);
+ manager->magic = 0;
+ mctx= manager->mctx;
+ isc_mem_put(mctx, manager, sizeof(*manager));
+
+ isc_mem_detach(&mctx);
+
+ *managerp = NULL;
+}
+
+static void
+queue_receive_event(isc_socket_t *sock, isc_task_t *task, isc_socketevent_t *dev)
+{
+ isc_task_t *ntask = NULL;
+
+ isc_task_attach(task, &ntask);
+ dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
+
+ /*
+ * Enqueue the request.
+ */
+ INSIST(!ISC_LINK_LINKED(dev, ev_link));
+ ISC_LIST_ENQUEUE(sock->recv_list, dev, ev_link);
+
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "queue_receive_event: event %p -> task %p",
+ dev, ntask);
+}
+
+/*
+ * Check the pending receive queue, and if we have data pending, give it to this
+ * caller. If we have none, queue an I/O request. If this caller is not the first
+ * on the list, then we will just queue this event and return.
+ *
+ * Caller must have the socket locked.
+ */
+static isc_result_t
+socket_recv(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
+ unsigned int flags)
+{
+ int cc = 0;
+ isc_task_t *ntask = NULL;
+ isc_result_t result = ISC_R_SUCCESS;
+ int recv_errno = 0;
+
+ dev->ev_sender = task;
+
+ if (sock->fd == INVALID_SOCKET)
+ return (ISC_R_EOF);
+
+ /*
+ * Queue our event on the list of things to do. Call our function to
+ * attempt to fill buffers as much as possible, and return done events.
+ * We are going to lie about our handling of the ISC_SOCKFLAG_IMMEDIATE
+ * here and tell our caller that we could not satisfy it immediately.
+ */
+ queue_receive_event(sock, task, dev);
+ if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0)
+ result = ISC_R_INPROGRESS;
+
+ completeio_recv(sock);
+
+ /*
+ * If there are more receivers waiting for data, queue another receive
+ * here. If the
+ */
+ queue_receive_request(sock);
+
+ return (result);
+}
+
+isc_result_t
+isc__socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg)
+{
+ isc_socketevent_t *dev;
+ isc_socketmgr_t *manager;
+ unsigned int iocount;
+ isc_buffer_t *buffer;
+ isc_result_t ret;
+
+ REQUIRE(VALID_SOCKET(sock));
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * Make sure that the socket is not closed. XXXMLG change error here?
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ REQUIRE(buflist != NULL);
+ REQUIRE(!ISC_LIST_EMPTY(*buflist));
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ iocount = isc_bufferlist_availablecount(buflist);
+ REQUIRE(iocount > 0);
+
+ INSIST(sock->bound);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg);
+ if (dev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+
+ /*
+ * UDP sockets are always partial read
+ */
+ if (sock->type == isc_sockettype_udp)
+ dev->minimum = 1;
+ else {
+ if (minimum == 0)
+ dev->minimum = iocount;
+ else
+ dev->minimum = minimum;
+ }
+
+ /*
+ * Move each buffer from the passed in list to our internal one.
+ */
+ buffer = ISC_LIST_HEAD(*buflist);
+ while (buffer != NULL) {
+ ISC_LIST_DEQUEUE(*buflist, buffer, link);
+ ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
+ buffer = ISC_LIST_HEAD(*buflist);
+ }
+
+ ret = socket_recv(sock, dev, task, 0);
+
+ UNLOCK(&sock->lock);
+ return (ret);
+}
+
+isc_result_t
+isc__socket_recv(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_taskaction_t action, const void *arg)
+{
+ isc_socketevent_t *dev;
+ isc_socketmgr_t *manager;
+ isc_result_t ret;
+
+ REQUIRE(VALID_SOCKET(sock));
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ INSIST(sock->bound);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_RECVDONE, action, arg);
+ if (dev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+
+ ret = isc_socket_recv2(sock, region, minimum, task, dev, 0);
+ UNLOCK(&sock->lock);
+ return (ret);
+}
+
+isc_result_t
+isc__socket_recv2(isc_socket_t *sock, isc_region_t *region,
+ unsigned int minimum, isc_task_t *task,
+ isc_socketevent_t *event, unsigned int flags)
+{
+ isc_result_t ret;
+
+ REQUIRE(VALID_SOCKET(sock));
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ event->result = ISC_R_UNEXPECTED;
+ event->ev_sender = sock;
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ ISC_LIST_INIT(event->bufferlist);
+ event->region = *region;
+ event->n = 0;
+ event->offset = 0;
+ event->attributes = 0;
+
+ /*
+ * UDP sockets are always partial read.
+ */
+ if (sock->type == isc_sockettype_udp)
+ event->minimum = 1;
+ else {
+ if (minimum == 0)
+ event->minimum = region->length;
+ else
+ event->minimum = minimum;
+ }
+
+ ret = socket_recv(sock, event, task, flags);
+ UNLOCK(&sock->lock);
+ return (ret);
+}
+
+/*
+ * Caller must have the socket locked.
+ */
+static isc_result_t
+socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
+ unsigned int flags)
+{
+ int io_state;
+ int send_errno = 0;
+ int cc = 0;
+ isc_task_t *ntask = NULL;
+ isc_result_t result = ISC_R_SUCCESS;
+
+ dev->ev_sender = task;
+
+ set_dev_address(address, sock, dev);
+ if (pktinfo != NULL) {
+ socket_log(__LINE__, sock, NULL, TRACE, isc_msgcat, ISC_MSGSET_SOCKET,
+ ISC_MSG_PKTINFOPROVIDED,
+ "pktinfo structure provided, ifindex %u (set to 0)",
+ pktinfo->ipi6_ifindex);
+
+ dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
+ dev->pktinfo = *pktinfo;
+ /*
+ * Set the pktinfo index to 0 here, to let the kernel decide
+ * what interface it should send on.
+ */
+ dev->pktinfo.ipi6_ifindex = 0;
+ }
+
+ io_state = startio_send(sock, dev, &cc, &send_errno);
+ switch (io_state) {
+ case DOIO_PENDING: /* I/O started. Nothing more to do */
+ case DOIO_SOFT:
+ /*
+ * We couldn't send all or part of the request right now, so
+ * queue it unless ISC_SOCKFLAG_NORETRY is set.
+ */
+ if ((flags & ISC_SOCKFLAG_NORETRY) == 0) {
+ isc_task_attach(task, &ntask);
+ dev->attributes |= ISC_SOCKEVENTATTR_ATTACHED;
+
+ /*
+ * Enqueue the request.
+ */
+ INSIST(!ISC_LINK_LINKED(dev, ev_link));
+ ISC_LIST_ENQUEUE(sock->send_list, dev, ev_link);
+
+ socket_log(__LINE__, sock, NULL, EVENT, NULL, 0, 0,
+ "socket_send: event %p -> task %p",
+ dev, ntask);
+
+ if ((flags & ISC_SOCKFLAG_IMMEDIATE) != 0)
+ result = ISC_R_INPROGRESS;
+ break;
+ }
+
+ case DOIO_SUCCESS:
+ break;
+ }
+
+ return (result);
+}
+
+isc_result_t
+isc__socket_send(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ /*
+ * REQUIRE() checking is performed in isc_socket_sendto().
+ */
+ return (isc_socket_sendto(sock, region, task, action, arg, NULL,
+ NULL));
+}
+
+isc_result_t
+isc__socket_sendto(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
+{
+ isc_socketevent_t *dev;
+ isc_socketmgr_t *manager;
+ isc_result_t ret;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+ REQUIRE(region != NULL);
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ INSIST(sock->bound);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
+ if (dev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+ dev->region = *region;
+
+ ret = socket_send(sock, dev, task, address, pktinfo, 0);
+ UNLOCK(&sock->lock);
+ return (ret);
+}
+
+isc_result_t
+isc__socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ return (isc_socket_sendtov(sock, buflist, task, action, arg, NULL,
+ NULL));
+}
+
+isc_result_t
+isc__socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
+ isc_task_t *task, isc_taskaction_t action, const void *arg,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo)
+{
+ isc_socketevent_t *dev;
+ isc_socketmgr_t *manager;
+ unsigned int iocount;
+ isc_buffer_t *buffer;
+ isc_result_t ret;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+ REQUIRE(buflist != NULL);
+ REQUIRE(!ISC_LIST_EMPTY(*buflist));
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ iocount = isc_bufferlist_usedcount(buflist);
+ REQUIRE(iocount > 0);
+
+ dev = allocate_socketevent(sock, ISC_SOCKEVENT_SENDDONE, action, arg);
+ if (dev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+
+ /*
+ * Move each buffer from the passed in list to our internal one.
+ */
+ buffer = ISC_LIST_HEAD(*buflist);
+ while (buffer != NULL) {
+ ISC_LIST_DEQUEUE(*buflist, buffer, link);
+ ISC_LIST_ENQUEUE(dev->bufferlist, buffer, link);
+ buffer = ISC_LIST_HEAD(*buflist);
+ }
+
+ ret = socket_send(sock, dev, task, address, pktinfo, 0);
+ UNLOCK(&sock->lock);
+ return (ret);
+}
+
+isc_result_t
+isc__socket_sendto2(isc_socket_t *sock, isc_region_t *region,
+ isc_task_t *task,
+ isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
+ isc_socketevent_t *event, unsigned int flags)
+{
+ isc_result_t ret;
+
+ REQUIRE(VALID_SOCKET(sock));
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ REQUIRE((flags & ~(ISC_SOCKFLAG_IMMEDIATE|ISC_SOCKFLAG_NORETRY)) == 0);
+ if ((flags & ISC_SOCKFLAG_NORETRY) != 0)
+ REQUIRE(sock->type == isc_sockettype_udp);
+ event->ev_sender = sock;
+ event->result = ISC_R_UNEXPECTED;
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+ ISC_LIST_INIT(event->bufferlist);
+ event->region = *region;
+ event->n = 0;
+ event->offset = 0;
+ event->attributes = 0;
+
+ ret = socket_send(sock, event, task, address, pktinfo, flags);
+ UNLOCK(&sock->lock);
+ return (ret);
+}
+
+isc_result_t
+isc__socket_bind(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
+ unsigned int options) {
+ int bind_errno;
+ char strbuf[ISC_STRERRORSIZE];
+ int on = 1;
+
+ REQUIRE(VALID_SOCKET(sock));
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ INSIST(!sock->bound);
+ INSIST(!sock->dupped);
+
+ if (sock->pf != sockaddr->type.sa.sa_family) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_FAMILYMISMATCH);
+ }
+ /*
+ * Only set SO_REUSEADDR when we want a specific port.
+ */
+ if ((options & ISC_SOCKET_REUSEADDRESS) != 0 &&
+ isc_sockaddr_getport(sockaddr) != (in_port_t)0 &&
+ setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, (char *)&on,
+ sizeof(on)) < 0) {
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "setsockopt(%d) %s", sock->fd,
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
+ ISC_MSG_FAILED, "failed"));
+ /* Press on... */
+ }
+ if (bind(sock->fd, &sockaddr->type.sa, sockaddr->length) < 0) {
+ bind_errno = WSAGetLastError();
+ UNLOCK(&sock->lock);
+ switch (bind_errno) {
+ case WSAEACCES:
+ return (ISC_R_NOPERM);
+ case WSAEADDRNOTAVAIL:
+ return (ISC_R_ADDRNOTAVAIL);
+ case WSAEADDRINUSE:
+ return (ISC_R_ADDRINUSE);
+ case WSAEINVAL:
+ return (ISC_R_BOUND);
+ default:
+ isc__strerror(bind_errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "bind: %s",
+ strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+
+ socket_log(__LINE__, sock, sockaddr, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "bound");
+ sock->bound = 1;
+
+ UNLOCK(&sock->lock);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__socket_filter(isc_socket_t *sock, const char *filter) {
+ UNUSED(sock);
+ UNUSED(filter);
+
+ REQUIRE(VALID_SOCKET(sock));
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+/*
+ * Set up to listen on a given socket. We do this by creating an internal
+ * event that will be dispatched when the socket has read activity. The
+ * watcher will send the internal event to the task when there is a new
+ * connection.
+ *
+ * Unlike in read, we don't preallocate a done event here. Every time there
+ * is a new connection we'll have to allocate a new one anyway, so we might
+ * as well keep things simple rather than having to track them.
+ */
+isc_result_t
+isc__socket_listen(isc_socket_t *sock, unsigned int backlog) {
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ REQUIRE(!sock->listener);
+ REQUIRE(sock->bound);
+ REQUIRE(sock->type == isc_sockettype_tcp);
+
+ if (backlog == 0)
+ backlog = SOMAXCONN;
+
+ if (listen(sock->fd, (int)backlog) < 0) {
+ UNLOCK(&sock->lock);
+ isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf));
+
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "listen: %s", strbuf);
+
+ return (ISC_R_UNEXPECTED);
+ }
+
+ socket_log(__LINE__, sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND, "listening");
+ sock->listener = 1;
+ _set_state(sock, SOCK_LISTEN);
+
+ UNLOCK(&sock->lock);
+ return (ISC_R_SUCCESS);
+}
+
+/*
+ * This should try to do aggressive accept() XXXMLG
+ */
+isc_result_t
+isc__socket_accept(isc_socket_t *sock,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ isc_socket_newconnev_t *adev;
+ isc_socketmgr_t *manager;
+ isc_task_t *ntask = NULL;
+ isc_socket_t *nsock;
+ isc_result_t result;
+ IoCompletionInfo *lpo;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ REQUIRE(sock->listener);
+
+ /*
+ * Sender field is overloaded here with the task we will be sending
+ * this event to. Just before the actual event is delivered the
+ * actual ev_sender will be touched up to be the socket.
+ */
+ adev = (isc_socket_newconnev_t *)
+ isc_event_allocate(manager->mctx, task, ISC_SOCKEVENT_NEWCONN,
+ action, arg, sizeof(*adev));
+ if (adev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+ ISC_LINK_INIT(adev, ev_link);
+
+ result = allocate_socket(manager, sock->type, &nsock);
+ if (result != ISC_R_SUCCESS) {
+ isc_event_free((isc_event_t **)&adev);
+ UNLOCK(&sock->lock);
+ return (result);
+ }
+
+ /*
+ * AcceptEx() requires we pass in a socket.
+ */
+ nsock->fd = socket(sock->pf, SOCK_STREAM, IPPROTO_TCP);
+ if (nsock->fd == INVALID_SOCKET) {
+ free_socket(&nsock, __LINE__);
+ isc_event_free((isc_event_t **)&adev);
+ UNLOCK(&sock->lock);
+ return (ISC_R_FAILURE); // XXXMLG need real error message
+ }
+
+ /*
+ * Attach to socket and to task.
+ */
+ isc_task_attach(task, &ntask);
+ if (isc_task_exiting(ntask)) {
+ free_socket(&nsock, __LINE__);
+ isc_task_detach(&ntask);
+ isc_event_free(ISC_EVENT_PTR(&adev));
+ UNLOCK(&sock->lock);
+ return (ISC_R_SHUTTINGDOWN);
+ }
+ nsock->references++;
+
+ adev->ev_sender = ntask;
+ adev->newsocket = nsock;
+ _set_state(nsock, SOCK_ACCEPT);
+
+ /*
+ * Queue io completion for an accept().
+ */
+ lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle,
+ HEAP_ZERO_MEMORY,
+ sizeof(IoCompletionInfo));
+ RUNTIME_CHECK(lpo != NULL);
+ lpo->acceptbuffer = (void *)HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY,
+ (sizeof(SOCKADDR_STORAGE) + 16) * 2);
+ RUNTIME_CHECK(lpo->acceptbuffer != NULL);
+
+ lpo->adev = adev;
+ lpo->request_type = SOCKET_ACCEPT;
+
+ ISCAcceptEx(sock->fd,
+ nsock->fd, /* Accepted Socket */
+ lpo->acceptbuffer, /* Buffer for initial Recv */
+ 0, /* Length of Buffer */
+ sizeof(SOCKADDR_STORAGE) + 16, /* Local address length + 16 */
+ sizeof(SOCKADDR_STORAGE) + 16, /* Remote address lengh + 16 */
+ (LPDWORD)&lpo->received_bytes, /* Bytes Recved */
+ (LPOVERLAPPED)lpo /* Overlapped structure */
+ );
+ iocompletionport_update(nsock);
+
+ socket_log(__LINE__, sock, NULL, TRACE,
+ isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_BOUND,
+ "accepting for nsock %p fd %d", nsock, nsock->fd);
+
+ /*
+ * Enqueue the event
+ */
+ ISC_LIST_ENQUEUE(sock->accept_list, adev, ev_link);
+ sock->pending_accept++;
+ sock->pending_iocp++;
+
+ UNLOCK(&sock->lock);
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
+ isc_task_t *task, isc_taskaction_t action, const void *arg)
+{
+ char strbuf[ISC_STRERRORSIZE];
+ isc_socket_connev_t *cdev;
+ isc_task_t *ntask = NULL;
+ isc_socketmgr_t *manager;
+ IoCompletionInfo *lpo;
+ int bind_errno;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(addr != NULL);
+ REQUIRE(task != NULL);
+ REQUIRE(action != NULL);
+
+ manager = sock->manager;
+ REQUIRE(VALID_MANAGER(manager));
+ REQUIRE(addr != NULL);
+
+ if (isc_sockaddr_ismulticast(addr))
+ return (ISC_R_MULTICAST);
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ /*
+ * Windows sockets won't connect unless the socket is bound.
+ */
+ if (!sock->bound) {
+ isc_sockaddr_t any;
+
+ isc_sockaddr_anyofpf(&any, isc_sockaddr_pf(addr));
+ if (bind(sock->fd, &any.type.sa, any.length) < 0) {
+ bind_errno = WSAGetLastError();
+ UNLOCK(&sock->lock);
+ switch (bind_errno) {
+ case WSAEACCES:
+ return (ISC_R_NOPERM);
+ case WSAEADDRNOTAVAIL:
+ return (ISC_R_ADDRNOTAVAIL);
+ case WSAEADDRINUSE:
+ return (ISC_R_ADDRINUSE);
+ case WSAEINVAL:
+ return (ISC_R_BOUND);
+ default:
+ isc__strerror(bind_errno, strbuf,
+ sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "bind: %s", strbuf);
+ return (ISC_R_UNEXPECTED);
+ }
+ }
+ sock->bound = 1;
+ }
+
+ REQUIRE(!sock->pending_connect);
+
+ cdev = (isc_socket_connev_t *)isc_event_allocate(manager->mctx, sock,
+ ISC_SOCKEVENT_CONNECT,
+ action, arg,
+ sizeof(*cdev));
+ if (cdev == NULL) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_NOMEMORY);
+ }
+ ISC_LINK_INIT(cdev, ev_link);
+
+ if (sock->type == isc_sockettype_tcp) {
+ /*
+ * Queue io completion for an accept().
+ */
+ lpo = (IoCompletionInfo *)HeapAlloc(hHeapHandle,
+ HEAP_ZERO_MEMORY,
+ sizeof(IoCompletionInfo));
+ lpo->cdev = cdev;
+ lpo->request_type = SOCKET_CONNECT;
+
+ sock->address = *addr;
+ ISCConnectEx(sock->fd, &addr->type.sa, addr->length,
+ NULL, 0, NULL, (LPOVERLAPPED)lpo);
+
+ /*
+ * Attach to task.
+ */
+ isc_task_attach(task, &ntask);
+ cdev->ev_sender = ntask;
+
+ sock->pending_connect = 1;
+ _set_state(sock, SOCK_CONNECT);
+
+ /*
+ * Enqueue the request.
+ */
+ sock->connect_ev = cdev;
+ sock->pending_iocp++;
+ } else {
+ WSAConnect(sock->fd, &addr->type.sa, addr->length, NULL, NULL, NULL, NULL);
+ cdev->result = ISC_R_SUCCESS;
+ isc_task_send(task, (isc_event_t **)&cdev);
+ }
+ CONSISTENT(sock);
+ UNLOCK(&sock->lock);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc__socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp) {
+ isc_result_t result;
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(addressp != NULL);
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ if (sock->connected) {
+ *addressp = sock->address;
+ result = ISC_R_SUCCESS;
+ } else {
+ result = ISC_R_NOTCONNECTED;
+ }
+
+ UNLOCK(&sock->lock);
+
+ return (result);
+}
+
+isc_result_t
+isc__socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp) {
+ ISC_SOCKADDR_LEN_T len;
+ isc_result_t result;
+ char strbuf[ISC_STRERRORSIZE];
+
+ REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(addressp != NULL);
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ if (!sock->bound) {
+ result = ISC_R_NOTBOUND;
+ goto out;
+ }
+
+ result = ISC_R_SUCCESS;
+
+ len = sizeof(addressp->type);
+ if (getsockname(sock->fd, &addressp->type.sa, (void *)&len) < 0) {
+ isc__strerror(WSAGetLastError(), strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__, "getsockname: %s",
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto out;
+ }
+ addressp->length = (unsigned int)len;
+
+ out:
+ UNLOCK(&sock->lock);
+
+ return (result);
+}
+
+/*
+ * Run through the list of events on this socket, and cancel the ones
+ * queued for task "task" of type "how". "how" is a bitmask.
+ */
+void
+isc__socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) {
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ /*
+ * Quick exit if there is nothing to do. Don't even bother locking
+ * in this case.
+ */
+ if (how == 0)
+ return;
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return;
+ }
+
+ /*
+ * All of these do the same thing, more or less.
+ * Each will:
+ * o If the internal event is marked as "posted" try to
+ * remove it from the task's queue. If this fails, mark it
+ * as canceled instead, and let the task clean it up later.
+ * o For each I/O request for that task of that type, post
+ * its done event with status of "ISC_R_CANCELED".
+ * o Reset any state needed.
+ */
+
+ if ((how & ISC_SOCKCANCEL_RECV) == ISC_SOCKCANCEL_RECV) {
+ isc_socketevent_t *dev;
+ isc_socketevent_t *next;
+ isc_task_t *current_task;
+
+ dev = ISC_LIST_HEAD(sock->recv_list);
+ while (dev != NULL) {
+ current_task = dev->ev_sender;
+ next = ISC_LIST_NEXT(dev, ev_link);
+ if ((task == NULL) || (task == current_task)) {
+ dev->result = ISC_R_CANCELED;
+ send_recvdone_event(sock, &dev);
+ }
+ dev = next;
+ }
+ }
+ how &= ~ISC_SOCKCANCEL_RECV;
+
+ if ((how & ISC_SOCKCANCEL_SEND) == ISC_SOCKCANCEL_SEND) {
+ isc_socketevent_t *dev;
+ isc_socketevent_t *next;
+ isc_task_t *current_task;
+
+ dev = ISC_LIST_HEAD(sock->send_list);
+
+ while (dev != NULL) {
+ current_task = dev->ev_sender;
+ next = ISC_LIST_NEXT(dev, ev_link);
+ if ((task == NULL) || (task == current_task)) {
+ dev->result = ISC_R_CANCELED;
+ send_senddone_event(sock, &dev);
+ }
+ dev = next;
+ }
+ }
+ how &= ~ISC_SOCKCANCEL_SEND;
+
+ if (((how & ISC_SOCKCANCEL_ACCEPT) == ISC_SOCKCANCEL_ACCEPT)
+ && !ISC_LIST_EMPTY(sock->accept_list)) {
+ isc_socket_newconnev_t *dev;
+ isc_socket_newconnev_t *next;
+ isc_task_t *current_task;
+
+ dev = ISC_LIST_HEAD(sock->accept_list);
+ while (dev != NULL) {
+ current_task = dev->ev_sender;
+ next = ISC_LIST_NEXT(dev, ev_link);
+
+ if ((task == NULL) || (task == current_task)) {
+
+ dev->newsocket->references--;
+ closesocket(dev->newsocket->fd);
+ dev->newsocket->fd = INVALID_SOCKET;
+ free_socket(&dev->newsocket, __LINE__);
+
+ dev->result = ISC_R_CANCELED;
+ send_acceptdone_event(sock, &dev);
+ }
+
+ dev = next;
+ }
+ }
+ how &= ~ISC_SOCKCANCEL_ACCEPT;
+
+ /*
+ * Connecting is not a list.
+ */
+ if (((how & ISC_SOCKCANCEL_CONNECT) == ISC_SOCKCANCEL_CONNECT)
+ && sock->connect_ev != NULL) {
+ isc_socket_connev_t *dev;
+ isc_task_t *current_task;
+
+ INSIST(sock->pending_connect);
+
+ dev = sock->connect_ev;
+ current_task = dev->ev_sender;
+
+ if ((task == NULL) || (task == current_task)) {
+ closesocket(sock->fd);
+ sock->fd = INVALID_SOCKET;
+ _set_state(sock, SOCK_CLOSED);
+
+ sock->connect_ev = NULL;
+ dev->result = ISC_R_CANCELED;
+ send_connectdone_event(sock, &dev);
+ }
+ }
+ how &= ~ISC_SOCKCANCEL_CONNECT;
+
+ maybe_free_socket(&sock, __LINE__);
+}
+
+isc_sockettype_t
+isc__socket_gettype(isc_socket_t *sock) {
+ isc_sockettype_t type;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_R_CONNREFUSED);
+ }
+
+ type = sock->type;
+ UNLOCK(&sock->lock);
+ return (type);
+}
+
+isc_boolean_t
+isc__socket_isbound(isc_socket_t *sock) {
+ isc_boolean_t val;
+
+ REQUIRE(VALID_SOCKET(sock));
+
+ LOCK(&sock->lock);
+ CONSISTENT(sock);
+
+ /*
+ * make sure that the socket's not closed
+ */
+ if (sock->fd == INVALID_SOCKET) {
+ UNLOCK(&sock->lock);
+ return (ISC_FALSE);
+ }
+
+ val = ((sock->bound) ? ISC_TRUE : ISC_FALSE);
+ UNLOCK(&sock->lock);
+
+ return (val);
+}
+
+void
+isc__socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes) {
+#if defined(IPV6_V6ONLY)
+ int onoff = yes ? 1 : 0;
+#else
+ UNUSED(yes);
+#endif
+
+ REQUIRE(VALID_SOCKET(sock));
+
+#ifdef IPV6_V6ONLY
+ if (sock->pf == AF_INET6) {
+ (void)setsockopt(sock->fd, IPPROTO_IPV6, IPV6_V6ONLY,
+ (char *)&onoff, sizeof(onoff));
+ }
+#endif
+}
+
+void
+isc__socket_cleanunix(isc_sockaddr_t *addr, isc_boolean_t active) {
+ UNUSED(addr);
+ UNUSED(active);
+}
+
+isc_result_t
+isc__socket_permunix(isc_sockaddr_t *addr, isc_uint32_t perm,
+ isc_uint32_t owner, isc_uint32_t group)
+{
+ UNUSED(addr);
+ UNUSED(perm);
+ UNUSED(owner);
+ UNUSED(group);
+ return (ISC_R_NOTIMPLEMENTED);
+}
+
+void
+isc__socket_setname(isc_socket_t *socket, const char *name, void *tag) {
+
+ /*
+ * Name 'socket'.
+ */
+
+ REQUIRE(VALID_SOCKET(socket));
+
+ LOCK(&socket->lock);
+ memset(socket->name, 0, sizeof(socket->name));
+ strncpy(socket->name, name, sizeof(socket->name) - 1);
+ socket->tag = tag;
+ UNLOCK(&socket->lock);
+}
+
+const char *
+isc__socket_getname(isc_socket_t *socket) {
+ return (socket->name);
+}
+
+void *
+isc__socket_gettag(isc_socket_t *socket) {
+ return (socket->tag);
+}
+
+int
+isc__socket_getfd(isc_socket_t *socket) {
+ return ((short) socket->fd);
+}
+
+void
+isc__socketmgr_setreserved(isc_socketmgr_t *manager, isc_uint32_t reserved) {
+ UNUSED(manager);
+ UNUSED(reserved);
+}
+
+void
+isc___socketmgr_maxudp(isc_socketmgr_t *manager, int maxudp) {
+
+ UNUSED(manager);
+ UNUSED(maxudp);
+}
+
+#ifdef HAVE_LIBXML2
+
+static const char *
+_socktype(isc_sockettype_t type)
+{
+ if (type == isc_sockettype_udp)
+ return ("udp");
+ else if (type == isc_sockettype_tcp)
+ return ("tcp");
+ else if (type == isc_sockettype_unix)
+ return ("unix");
+ else if (type == isc_sockettype_fdwatch)
+ return ("fdwatch");
+ else
+ return ("not-initialized");
+}
+
+void
+isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer)
+{
+ isc_socket_t *sock;
+ char peerbuf[ISC_SOCKADDR_FORMATSIZE];
+ isc_sockaddr_t addr;
+ ISC_SOCKADDR_LEN_T len;
+
+ LOCK(&mgr->lock);
+
+#ifndef ISC_PLATFORM_USETHREADS
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
+ xmlTextWriterWriteFormatString(writer, "%d", mgr->refs);
+ xmlTextWriterEndElement(writer);
+#endif
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "sockets");
+ sock = ISC_LIST_HEAD(mgr->socklist);
+ while (sock != NULL) {
+ LOCK(&sock->lock);
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "socket");
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "id");
+ xmlTextWriterWriteFormatString(writer, "%p", sock);
+ xmlTextWriterEndElement(writer);
+
+ if (sock->name[0] != 0) {
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "name");
+ xmlTextWriterWriteFormatString(writer, "%s",
+ sock->name);
+ xmlTextWriterEndElement(writer); /* name */
+ }
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "references");
+ xmlTextWriterWriteFormatString(writer, "%d", sock->references);
+ xmlTextWriterEndElement(writer);
+
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type",
+ ISC_XMLCHAR _socktype(sock->type));
+
+ if (sock->connected) {
+ isc_sockaddr_format(&sock->address, peerbuf,
+ sizeof(peerbuf));
+ xmlTextWriterWriteElement(writer,
+ ISC_XMLCHAR "peer-address",
+ ISC_XMLCHAR peerbuf);
+ }
+
+ len = sizeof(addr);
+ if (getsockname(sock->fd, &addr.type.sa, (void *)&len) == 0) {
+ isc_sockaddr_format(&addr, peerbuf, sizeof(peerbuf));
+ xmlTextWriterWriteElement(writer,
+ ISC_XMLCHAR "local-address",
+ ISC_XMLCHAR peerbuf);
+ }
+
+ xmlTextWriterStartElement(writer, ISC_XMLCHAR "states");
+ if (sock->pending_recv)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "pending-receive");
+ if (sock->pending_send)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "pending-send");
+ if (sock->pending_accept)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "pending_accept");
+ if (sock->listener)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "listener");
+ if (sock->connected)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "connected");
+ if (sock->pending_connect)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "connecting");
+ if (sock->bound)
+ xmlTextWriterWriteElement(writer, ISC_XMLCHAR "state",
+ ISC_XMLCHAR "bound");
+
+ xmlTextWriterEndElement(writer); /* states */
+
+ xmlTextWriterEndElement(writer); /* socket */
+
+ UNLOCK(&sock->lock);
+ sock = ISC_LIST_NEXT(sock, link);
+ }
+ xmlTextWriterEndElement(writer); /* sockets */
+
+ UNLOCK(&mgr->lock);
+}
+#endif /* HAVE_LIBXML2 */
diff --git a/lib/isc/win32/stdio.c b/lib/isc/win32/stdio.c
new file mode 100644
index 0000000..427a8e1
--- /dev/null
+++ b/lib/isc/win32/stdio.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: stdio.c,v 1.6 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <config.h>
+
+#include <io.h>
+#include <errno.h>
+
+#include <isc/stdio.h>
+
+#include "errno2result.h"
+
+isc_result_t
+isc_stdio_open(const char *filename, const char *mode, FILE **fp) {
+ FILE *f;
+
+ f = fopen(filename, mode);
+ if (f == NULL)
+ return (isc__errno2result(errno));
+ *fp = f;
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_stdio_close(FILE *f) {
+ int r;
+
+ r = fclose(f);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_stdio_seek(FILE *f, long offset, int whence) {
+ int r;
+
+ r = fseek(f, offset, whence);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) {
+ isc_result_t result = ISC_R_SUCCESS;
+ size_t r;
+
+ clearerr(f);
+ r = fread(ptr, size, nmemb, f);
+ if (r != nmemb) {
+ if (feof(f))
+ result = ISC_R_EOF;
+ else
+ result = isc__errno2result(errno);
+ }
+ if (nret != NULL)
+ *nret = r;
+ return (result);
+}
+
+isc_result_t
+isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f,
+ size_t *nret)
+{
+ isc_result_t result = ISC_R_SUCCESS;
+ size_t r;
+
+ clearerr(f);
+ r = fwrite(ptr, size, nmemb, f);
+ if (r != nmemb)
+ result = isc__errno2result(errno);
+ if (nret != NULL)
+ *nret = r;
+ return (result);
+}
+
+isc_result_t
+isc_stdio_flush(FILE *f) {
+ int r;
+
+ r = fflush(f);
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
+isc_result_t
+isc_stdio_sync(FILE *f) {
+ int r;
+
+ r = _commit(_fileno(f));
+ if (r == 0)
+ return (ISC_R_SUCCESS);
+ else
+ return (isc__errno2result(errno));
+}
+
diff --git a/lib/isc/win32/stdtime.c b/lib/isc/win32/stdtime.c
new file mode 100644
index 0000000..ca46251
--- /dev/null
+++ b/lib/isc/win32/stdtime.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: stdtime.c,v 1.12 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <config.h>
+
+#include <time.h>
+
+#include <isc/assertions.h>
+#include <isc/stdtime.h>
+#include <isc/util.h>
+
+void
+isc_stdtime_get(isc_stdtime_t *t) {
+ /*
+ * Set 't' to the number of seconds past 00:00:00 UTC, January 1, 1970.
+ */
+
+ REQUIRE(t != NULL);
+
+ (void)time((time_t *)t);
+}
diff --git a/lib/isc/win32/strerror.c b/lib/isc/win32/strerror.c
new file mode 100644
index 0000000..4174332
--- /dev/null
+++ b/lib/isc/win32/strerror.c
@@ -0,0 +1,459 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001, 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: strerror.c,v 1.8 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <winsock2.h>
+
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/print.h>
+#include <isc/strerror.h>
+#include <isc/util.h>
+
+/*
+ * Forward declarations
+ */
+
+char *
+FormatError(int error);
+
+char *
+GetWSAErrorMessage(int errval);
+
+char *
+NTstrerror(int err, BOOL *bfreebuf);
+
+/*
+ * We need to do this this way for profiled locks.
+ */
+
+static isc_mutex_t isc_strerror_lock;
+static void init_lock(void) {
+ RUNTIME_CHECK(isc_mutex_init(&isc_strerror_lock) == ISC_R_SUCCESS);
+}
+
+/*
+ * This routine needs to free up any buffer allocated by FormatMessage
+ * if that routine gets used.
+ */
+
+void
+isc__strerror(int num, char *buf, size_t size) {
+ char *msg;
+ BOOL freebuf;
+ unsigned int unum = num;
+ static isc_once_t once = ISC_ONCE_INIT;
+
+ REQUIRE(buf != NULL);
+
+ RUNTIME_CHECK(isc_once_do(&once, init_lock) == ISC_R_SUCCESS);
+
+ LOCK(&isc_strerror_lock);
+ freebuf = FALSE;
+ msg = NTstrerror(num, &freebuf);
+ if (msg != NULL)
+ snprintf(buf, size, "%s", msg);
+ else
+ snprintf(buf, size, "Unknown error: %u", unum);
+ if(freebuf && msg != NULL) {
+ LocalFree(msg);
+ }
+ UNLOCK(&isc_strerror_lock);
+}
+
+/*
+ * Note this will cause a memory leak unless the memory allocated here
+ * is freed by calling LocalFree. isc__strerror does this before unlocking.
+ * This only gets called if there is a system type of error and will likely
+ * be an unusual event.
+ */
+char *
+FormatError(int error) {
+ LPVOID lpMsgBuf = NULL;
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ error,
+ /* Default language */
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL);
+
+ return (lpMsgBuf);
+}
+
+/*
+ * This routine checks the error value and calls the WSA Windows Sockets
+ * Error message function GetWSAErrorMessage below if it's within that range
+ * since those messages are not available in the system error messages.
+ */
+char *
+NTstrerror(int err, BOOL *bfreebuf) {
+ char *retmsg = NULL;
+
+ /* Copy the error value first in case of other errors */
+ DWORD errval = err;
+
+ *bfreebuf = FALSE;
+
+ /* Get the Winsock2 error messages */
+ if (errval >= WSABASEERR && errval <= (WSABASEERR + 1015)) {
+ retmsg = GetWSAErrorMessage(errval);
+ if (retmsg != NULL)
+ return (retmsg);
+ }
+ /*
+ * If it's not one of the standard Unix error codes,
+ * try a system error message
+ */
+ if (errval > (DWORD) _sys_nerr) {
+ *bfreebuf = TRUE;
+ return (FormatError(errval));
+ } else {
+ return (strerror(errval));
+ }
+}
+
+/*
+ * This is a replacement for perror
+ */
+void __cdecl
+NTperror(char *errmsg) {
+ /* Copy the error value first in case of other errors */
+ int errval = errno;
+ BOOL bfreebuf = FALSE;
+ char *msg;
+
+ msg = NTstrerror(errval, &bfreebuf);
+ fprintf(stderr, "%s: %s\n", errmsg, msg);
+ if(bfreebuf == TRUE) {
+ LocalFree(msg);
+ }
+
+}
+
+/*
+ * Return the error string related to Winsock2 errors.
+ * This function is necessary since FormatMessage knows nothing about them
+ * and there is no function to get them.
+ */
+char *
+GetWSAErrorMessage(int errval) {
+ char *msg;
+
+ switch (errval) {
+
+ case WSAEINTR:
+ msg = "Interrupted system call";
+ break;
+
+ case WSAEBADF:
+ msg = "Bad file number";
+ break;
+
+ case WSAEACCES:
+ msg = "Permission denied";
+ break;
+
+ case WSAEFAULT:
+ msg = "Bad address";
+ break;
+
+ case WSAEINVAL:
+ msg = "Invalid argument";
+ break;
+
+ case WSAEMFILE:
+ msg = "Too many open sockets";
+ break;
+
+ case WSAEWOULDBLOCK:
+ msg = "Operation would block";
+ break;
+
+ case WSAEINPROGRESS:
+ msg = "Operation now in progress";
+ break;
+
+ case WSAEALREADY:
+ msg = "Operation already in progress";
+ break;
+
+ case WSAENOTSOCK:
+ msg = "Socket operation on non-socket";
+ break;
+
+ case WSAEDESTADDRREQ:
+ msg = "Destination address required";
+ break;
+
+ case WSAEMSGSIZE:
+ msg = "Message too long";
+ break;
+
+ case WSAEPROTOTYPE:
+ msg = "Protocol wrong type for socket";
+ break;
+
+ case WSAENOPROTOOPT:
+ msg = "Bad protocol option";
+ break;
+
+ case WSAEPROTONOSUPPORT:
+ msg = "Protocol not supported";
+ break;
+
+ case WSAESOCKTNOSUPPORT:
+ msg = "Socket type not supported";
+ break;
+
+ case WSAEOPNOTSUPP:
+ msg = "Operation not supported on socket";
+ break;
+
+ case WSAEPFNOSUPPORT:
+ msg = "Protocol family not supported";
+ break;
+
+ case WSAEAFNOSUPPORT:
+ msg = "Address family not supported";
+ break;
+
+ case WSAEADDRINUSE:
+ msg = "Address already in use";
+ break;
+
+ case WSAEADDRNOTAVAIL:
+ msg = "Can't assign requested address";
+ break;
+
+ case WSAENETDOWN:
+ msg = "Network is down";
+ break;
+
+ case WSAENETUNREACH:
+ msg = "Network is unreachable";
+ break;
+
+ case WSAENETRESET:
+ msg = "Net connection reset";
+ break;
+
+ case WSAECONNABORTED:
+ msg = "Software caused connection abort";
+ break;
+
+ case WSAECONNRESET:
+ msg = "Connection reset by peer";
+ break;
+
+ case WSAENOBUFS:
+ msg = "No buffer space available";
+ break;
+
+ case WSAEISCONN:
+ msg = "Socket is already connected";
+ break;
+
+ case WSAENOTCONN:
+ msg = "Socket is not connected";
+ break;
+
+ case WSAESHUTDOWN:
+ msg = "Can't send after socket shutdown";
+ break;
+
+ case WSAETOOMANYREFS:
+ msg = "Too many references: can't splice";
+ break;
+
+ case WSAETIMEDOUT:
+ msg = "Connection timed out";
+ break;
+
+ case WSAECONNREFUSED:
+ msg = "Connection refused";
+ break;
+
+ case WSAELOOP:
+ msg = "Too many levels of symbolic links";
+ break;
+
+ case WSAENAMETOOLONG:
+ msg = "File name too long";
+ break;
+
+ case WSAEHOSTDOWN:
+ msg = "Host is down";
+ break;
+
+ case WSAEHOSTUNREACH:
+ msg = "No route to host";
+ break;
+
+ case WSAENOTEMPTY:
+ msg = "Directory not empty";
+ break;
+
+ case WSAEPROCLIM:
+ msg = "Too many processes";
+ break;
+
+ case WSAEUSERS:
+ msg = "Too many users";
+ break;
+
+ case WSAEDQUOT:
+ msg = "Disc quota exceeded";
+ break;
+
+ case WSAESTALE:
+ msg = "Stale NFS file handle";
+ break;
+
+ case WSAEREMOTE:
+ msg = "Too many levels of remote in path";
+ break;
+
+ case WSASYSNOTREADY:
+ msg = "Network system is unavailable";
+ break;
+
+ case WSAVERNOTSUPPORTED:
+ msg = "Winsock version out of range";
+ break;
+
+ case WSANOTINITIALISED:
+ msg = "WSAStartup not yet called";
+ break;
+
+ case WSAEDISCON:
+ msg = "Graceful shutdown in progress";
+ break;
+/*
+ case WSAHOST_NOT_FOUND:
+ msg = "Host not found";
+ break;
+
+ case WSANO_DATA:
+ msg = "No host data of that type was found";
+ break;
+*/
+ default:
+ msg = NULL;
+ break;
+ }
+ return (msg);
+}
+
+/*
+ * These error messages are more informative about CryptAPI Errors than the
+ * standard error messages
+ */
+
+char *
+GetCryptErrorMessage(int errval) {
+ char *msg;
+
+ switch (errval) {
+
+ case NTE_BAD_FLAGS:
+ msg = "The dwFlags parameter has an illegal value.";
+ break;
+ case NTE_BAD_KEYSET:
+ msg = "The Registry entry for the key container "
+ "could not be opened and may not exist.";
+ break;
+ case NTE_BAD_KEYSET_PARAM:
+ msg = "The pszContainer or pszProvider parameter "
+ "is set to an illegal value.";
+ break;
+ case NTE_BAD_PROV_TYPE:
+ msg = "The value of the dwProvType parameter is out "
+ "of range. All provider types must be from "
+ "1 to 999, inclusive.";
+ break;
+ case NTE_BAD_SIGNATURE:
+ msg = "The provider DLL signature did not verify "
+ "correctly. Either the DLL or the digital "
+ "signature has been tampered with.";
+ break;
+ case NTE_EXISTS:
+ msg = "The dwFlags parameter is CRYPT_NEWKEYSET, but the key"
+ " container already exists.";
+ break;
+ case NTE_KEYSET_ENTRY_BAD:
+ msg = "The Registry entry for the pszContainer key container "
+ "was found (in the HKEY_CURRENT_USER window), but is "
+ "corrupt. See the section System Administration for "
+ " etails about CryptoAPI's Registry usage.";
+ break;
+ case NTE_KEYSET_NOT_DEF:
+ msg = "No Registry entry exists in the HKEY_CURRENT_USER "
+ "window for the key container specified by "
+ "pszContainer.";
+ break;
+ case NTE_NO_MEMORY:
+ msg = "The CSP ran out of memory during the operation.";
+ break;
+ case NTE_PROV_DLL_NOT_FOUND:
+ msg = "The provider DLL file does not exist or is not on the "
+ "current path.";
+ break;
+ case NTE_PROV_TYPE_ENTRY_BAD:
+ msg = "The Registry entry for the provider type specified by "
+ "dwProvType is corrupt. This error may relate to "
+ "either the user default CSP list or the machine "
+ "default CSP list. See the section System "
+ "Administration for details about CryptoAPI's "
+ "Registry usage.";
+ break;
+ case NTE_PROV_TYPE_NO_MATCH:
+ msg = "The provider type specified by dwProvType does not "
+ "match the provider type found in the Registry. Note "
+ "that this error can only occur when pszProvider "
+ "specifies an actual CSP name.";
+ break;
+ case NTE_PROV_TYPE_NOT_DEF:
+ msg = "No Registry entry exists for the provider type "
+ "specified by dwProvType.";
+ break;
+ case NTE_PROVIDER_DLL_FAIL:
+ msg = "The provider DLL file could not be loaded, and "
+ "may not exist. If it exists, then the file is "
+ "not a valid DLL.";
+ break;
+ case NTE_SIGNATURE_FILE_BAD:
+ msg = "An error occurred while loading the DLL file image, "
+ "prior to verifying its signature.";
+ break;
+
+ default:
+ msg = NULL;
+ break;
+ }
+ return msg;
+}
+
diff --git a/lib/isc/win32/syslog.c b/lib/isc/win32/syslog.c
new file mode 100644
index 0000000..375784f
--- /dev/null
+++ b/lib/isc/win32/syslog.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: syslog.c,v 1.10 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <windows.h>
+#include <string.h>
+#include <stdlib.h>
+#include <syslog.h>
+
+#include <isc/bindevt.h>
+#include <isc/result.h>
+#include <isc/syslog.h>
+#include <isc/util.h>
+
+static HANDLE hAppLog = NULL;
+static FILE *log_stream;
+static int debug_level = 0;
+
+static struct dsn_c_pvt_sfnt {
+ int val;
+ const char *strval;
+} facilities[] = {
+ { LOG_KERN, "kern" },
+ { LOG_USER, "user" },
+ { LOG_MAIL, "mail" },
+ { LOG_DAEMON, "daemon" },
+ { LOG_AUTH, "auth" },
+ { LOG_SYSLOG, "syslog" },
+ { LOG_LPR, "lpr" },
+#ifdef LOG_NEWS
+ { LOG_NEWS, "news" },
+#endif
+#ifdef LOG_UUCP
+ { LOG_UUCP, "uucp" },
+#endif
+#ifdef LOG_CRON
+ { LOG_CRON, "cron" },
+#endif
+#ifdef LOG_AUTHPRIV
+ { LOG_AUTHPRIV, "authpriv" },
+#endif
+#ifdef LOG_FTP
+ { LOG_FTP, "ftp" },
+#endif
+ { LOG_LOCAL0, "local0"},
+ { LOG_LOCAL1, "local1"},
+ { LOG_LOCAL2, "local2"},
+ { LOG_LOCAL3, "local3"},
+ { LOG_LOCAL4, "local4"},
+ { LOG_LOCAL5, "local5"},
+ { LOG_LOCAL6, "local6"},
+ { LOG_LOCAL7, "local7"},
+ { 0, NULL }
+};
+
+isc_result_t
+isc_syslog_facilityfromstring(const char *str, int *facilityp) {
+ int i;
+
+ REQUIRE(str != NULL);
+ REQUIRE(facilityp != NULL);
+
+ for (i = 0; facilities[i].strval != NULL; i++) {
+ if (strcasecmp(facilities[i].strval, str) == 0) {
+ *facilityp = facilities[i].val;
+ return (ISC_R_SUCCESS);
+ }
+ }
+ return (ISC_R_NOTFOUND);
+}
+
+/*
+ * Log to the NT Event Log
+ */
+void
+syslog(int level, const char *fmt, ...) {
+ va_list ap;
+ char buf[1024];
+ char *str[1];
+
+ str[0] = buf;
+
+ va_start(ap, fmt);
+ vsprintf(buf, fmt, ap);
+ va_end(ap);
+
+ /* Make sure that the channel is open to write the event */
+ if (hAppLog != NULL) {
+ switch (level) {
+ case LOG_INFO:
+ case LOG_NOTICE:
+ case LOG_DEBUG:
+ ReportEvent(hAppLog, EVENTLOG_INFORMATION_TYPE, 0,
+ BIND_INFO_MSG, NULL, 1, 0, str, NULL);
+ break;
+ case LOG_WARNING:
+ ReportEvent(hAppLog, EVENTLOG_WARNING_TYPE, 0,
+ BIND_WARN_MSG, NULL, 1, 0, str, NULL);
+ break;
+ default:
+ ReportEvent(hAppLog, EVENTLOG_ERROR_TYPE, 0,
+ BIND_ERR_MSG, NULL, 1, 0, str, NULL);
+ break;
+ }
+ }
+}
+
+/*
+ * Initialize event logging
+ */
+void
+openlog(const char *name, int flags, ...) {
+ /* Get a handle to the Application event log */
+ hAppLog = RegisterEventSource(NULL, name);
+}
+
+/*
+ * Close the Handle to the application Event Log
+ * We don't care whether or not we succeeded so ignore return values
+ * In fact if we failed then we would have nowhere to put the message
+ */
+void
+closelog() {
+ DeregisterEventSource(hAppLog);
+}
+
+/*
+ * Keep event logging synced with the current debug level
+ */
+void
+ModifyLogLevel(int level) {
+ debug_level = level;
+}
+
+/*
+ * Initialize logging for the port section of libbind.
+ * Piggyback onto stream given.
+ */
+void
+InitNTLogging(FILE *stream, int debug) {
+ log_stream = stream;
+ ModifyLogLevel(debug);
+}
+/*
+ * This function is for reporting errors to the application
+ * event log in case the regular syslog is not available
+ * mainly during startup. It should not be used under normal
+ * circumstances.
+ */
+void
+NTReportError(const char *name, const char *str) {
+ HANDLE hNTAppLog = NULL;
+ const char *buf[1];
+
+ buf[0] = str;
+
+ hNTAppLog = RegisterEventSource(NULL, name);
+
+ ReportEvent(hNTAppLog, EVENTLOG_ERROR_TYPE, 0,
+ BIND_ERR_MSG, NULL, 1, 0, buf, NULL);
+
+ DeregisterEventSource(hNTAppLog);
+}
diff --git a/lib/isc/win32/syslog.h b/lib/isc/win32/syslog.h
new file mode 100644
index 0000000..fd4b3a6
--- /dev/null
+++ b/lib/isc/win32/syslog.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001, 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */
+
+#ifndef _SYSLOG_H
+#define _SYSLOG_H
+
+#include <stdio.h>
+
+/* Constant definitions for openlog() */
+#define LOG_PID 1
+#define LOG_CONS 2
+/* NT event log does not support facility level */
+#define LOG_KERN 0
+#define LOG_USER 0
+#define LOG_MAIL 0
+#define LOG_DAEMON 0
+#define LOG_AUTH 0
+#define LOG_SYSLOG 0
+#define LOG_LPR 0
+#define LOG_LOCAL0 0
+#define LOG_LOCAL1 0
+#define LOG_LOCAL2 0
+#define LOG_LOCAL3 0
+#define LOG_LOCAL4 0
+#define LOG_LOCAL5 0
+#define LOG_LOCAL6 0
+#define LOG_LOCAL7 0
+
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but signification condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
+
+void
+syslog(int level, const char *fmt, ...);
+
+void
+openlog(const char *, int, ...);
+
+void
+closelog(void);
+
+void
+ModifyLogLevel(int level);
+
+void
+InitNTLogging(FILE *, int);
+
+void
+NTReportError(const char *, const char *);
+/*
+ * Include the event codes required for logging.
+ */
+#include <isc/bindevt.h>
+
+#endif
diff --git a/lib/isc/win32/thread.c b/lib/isc/win32/thread.c
new file mode 100644
index 0000000..85ffef1
--- /dev/null
+++ b/lib/isc/win32/thread.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: thread.c,v 1.24 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <config.h>
+
+#include <process.h>
+
+#include <isc/thread.h>
+
+isc_result_t
+isc_thread_create(isc_threadfunc_t start, isc_threadarg_t arg,
+ isc_thread_t *threadp)
+{
+ isc_thread_t thread;
+ unsigned int id;
+
+ thread = (isc_thread_t)_beginthreadex(NULL, 0, start, arg, 0, &id);
+ if (thread == NULL) {
+ /* XXX */
+ return (ISC_R_UNEXPECTED);
+ }
+
+ *threadp = thread;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_thread_join(isc_thread_t thread, isc_threadresult_t *rp) {
+ DWORD result;
+ DWORD threadrc;
+
+ result = WaitForSingleObject(thread, INFINITE);
+ if (result != WAIT_OBJECT_0) {
+ /* XXX */
+ return (ISC_R_UNEXPECTED);
+ }
+ if (rp != NULL) {
+ if(!GetExitCodeThread(thread, &threadrc)) {
+ /* XXX */
+ return (ISC_R_UNEXPECTED);
+ }
+ *rp = threadrc;
+ }
+ (void)CloseHandle(thread);
+
+ return (ISC_R_SUCCESS);
+}
+
+void
+isc_thread_setconcurrency(unsigned int level) {
+ /*
+ * This is unnecessary on Win32 systems, but is here so that the
+ * call exists
+ */
+}
+
+void *
+isc_thread_key_getspecific(isc_thread_key_t key) {
+ return(TlsGetValue(key));
+}
+
+int
+isc_thread_key_setspecific(isc_thread_key_t key, void *value) {
+ return (TlsSetValue(key, value) ? 0 : GetLastError());
+}
+
+int
+isc_thread_key_create(isc_thread_key_t *key, void (*func)(void *)) {
+ *key = TlsAlloc();
+
+ return ((*key != -1) ? 0 : GetLastError());
+}
+
+int
+isc_thread_key_delete(isc_thread_key_t key) {
+ return (TlsFree(key) ? 0 : GetLastError());
+}
diff --git a/lib/isc/win32/time.c b/lib/isc/win32/time.c
new file mode 100644
index 0000000..aafd70b
--- /dev/null
+++ b/lib/isc/win32/time.c
@@ -0,0 +1,320 @@
+/*
+ * Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: time.c,v 1.52 2009/08/14 07:51:08 marka Exp $ */
+
+#include <config.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include <windows.h>
+
+#include <isc/assertions.h>
+#include <isc/time.h>
+#include <isc/util.h>
+
+/*
+ * struct FILETIME uses "100-nanoseconds intervals".
+ * NS / S = 1000000000 (10^9).
+ * While it is reasonably obvious that this makes the needed
+ * conversion factor 10^7, it is coded this way for additional clarity.
+ */
+#define NS_PER_S 1000000000
+#define NS_INTERVAL 100
+#define INTERVALS_PER_S (NS_PER_S / NS_INTERVAL)
+#define UINT64_MAX _UI64_MAX
+
+/***
+ *** Absolute Times
+ ***/
+
+static isc_time_t epoch = { { 0, 0 } };
+LIBISC_EXTERNAL_DATA isc_time_t *isc_time_epoch = &epoch;
+
+/***
+ *** Intervals
+ ***/
+
+static isc_interval_t zero_interval = { 0 };
+LIBISC_EXTERNAL_DATA isc_interval_t *isc_interval_zero = &zero_interval;
+
+void
+isc_interval_set(isc_interval_t *i, unsigned int seconds,
+ unsigned int nanoseconds)
+{
+ REQUIRE(i != NULL);
+ REQUIRE(nanoseconds < NS_PER_S);
+
+ /*
+ * This rounds nanoseconds up not down.
+ */
+ i->interval = (LONGLONG)seconds * INTERVALS_PER_S
+ + (nanoseconds + NS_INTERVAL - 1) / NS_INTERVAL;
+}
+
+isc_boolean_t
+isc_interval_iszero(const isc_interval_t *i) {
+ REQUIRE(i != NULL);
+ if (i->interval == 0)
+ return (ISC_TRUE);
+
+ return (ISC_FALSE);
+}
+
+void
+isc_time_set(isc_time_t *t, unsigned int seconds, unsigned int nanoseconds) {
+ SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 };
+ FILETIME temp;
+ ULARGE_INTEGER i1;
+
+ REQUIRE(t != NULL);
+ REQUIRE(nanoseconds < NS_PER_S);
+
+ SystemTimeToFileTime(&epoch, &temp);
+
+ i1.LowPart = t->absolute.dwLowDateTime;
+ i1.HighPart = t->absolute.dwHighDateTime;
+
+ i1.QuadPart += (unsigned __int64)nanoseconds/100;
+ i1.QuadPart += (unsigned __int64)seconds*10000000;
+
+ t->absolute.dwLowDateTime = i1.LowPart;
+ t->absolute.dwHighDateTime = i1.HighPart;
+}
+
+void
+isc_time_settoepoch(isc_time_t *t) {
+ REQUIRE(t != NULL);
+
+ t->absolute.dwLowDateTime = 0;
+ t->absolute.dwHighDateTime = 0;
+}
+
+isc_boolean_t
+isc_time_isepoch(const isc_time_t *t) {
+ REQUIRE(t != NULL);
+
+ if (t->absolute.dwLowDateTime == 0 &&
+ t->absolute.dwHighDateTime == 0)
+ return (ISC_TRUE);
+
+ return (ISC_FALSE);
+}
+
+isc_result_t
+isc_time_now(isc_time_t *t) {
+ REQUIRE(t != NULL);
+
+ GetSystemTimeAsFileTime(&t->absolute);
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_time_nowplusinterval(isc_time_t *t, const isc_interval_t *i) {
+ ULARGE_INTEGER i1;
+
+ REQUIRE(t != NULL);
+ REQUIRE(i != NULL);
+
+ GetSystemTimeAsFileTime(&t->absolute);
+
+ i1.LowPart = t->absolute.dwLowDateTime;
+ i1.HighPart = t->absolute.dwHighDateTime;
+
+ if (UINT64_MAX - i1.QuadPart < (unsigned __int64)i->interval)
+ return (ISC_R_RANGE);
+
+ i1.QuadPart += i->interval;
+
+ t->absolute.dwLowDateTime = i1.LowPart;
+ t->absolute.dwHighDateTime = i1.HighPart;
+
+ return (ISC_R_SUCCESS);
+}
+
+int
+isc_time_compare(const isc_time_t *t1, const isc_time_t *t2) {
+ REQUIRE(t1 != NULL && t2 != NULL);
+
+ return ((int)CompareFileTime(&t1->absolute, &t2->absolute));
+}
+
+isc_result_t
+isc_time_add(const isc_time_t *t, const isc_interval_t *i, isc_time_t *result)
+{
+ ULARGE_INTEGER i1;
+
+ REQUIRE(t != NULL && i != NULL && result != NULL);
+
+ i1.LowPart = t->absolute.dwLowDateTime;
+ i1.HighPart = t->absolute.dwHighDateTime;
+
+ if (UINT64_MAX - i1.QuadPart < (unsigned __int64)i->interval)
+ return (ISC_R_RANGE);
+
+ i1.QuadPart += i->interval;
+
+ result->absolute.dwLowDateTime = i1.LowPart;
+ result->absolute.dwHighDateTime = i1.HighPart;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_result_t
+isc_time_subtract(const isc_time_t *t, const isc_interval_t *i,
+ isc_time_t *result) {
+ ULARGE_INTEGER i1;
+
+ REQUIRE(t != NULL && i != NULL && result != NULL);
+
+ i1.LowPart = t->absolute.dwLowDateTime;
+ i1.HighPart = t->absolute.dwHighDateTime;
+
+ if (i1.QuadPart < (unsigned __int64) i->interval)
+ return (ISC_R_RANGE);
+
+ i1.QuadPart -= i->interval;
+
+ result->absolute.dwLowDateTime = i1.LowPart;
+ result->absolute.dwHighDateTime = i1.HighPart;
+
+ return (ISC_R_SUCCESS);
+}
+
+isc_uint64_t
+isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2) {
+ ULARGE_INTEGER i1, i2;
+ LONGLONG i3;
+
+ REQUIRE(t1 != NULL && t2 != NULL);
+
+ i1.LowPart = t1->absolute.dwLowDateTime;
+ i1.HighPart = t1->absolute.dwHighDateTime;
+ i2.LowPart = t2->absolute.dwLowDateTime;
+ i2.HighPart = t2->absolute.dwHighDateTime;
+
+ if (i1.QuadPart <= i2.QuadPart)
+ return (0);
+
+ /*
+ * Convert to microseconds.
+ */
+ i3 = (i1.QuadPart - i2.QuadPart) / 10;
+
+ return (i3);
+}
+
+isc_uint32_t
+isc_time_seconds(const isc_time_t *t) {
+ SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 };
+ FILETIME temp;
+ ULARGE_INTEGER i1, i2;
+ LONGLONG i3;
+
+ SystemTimeToFileTime(&epoch, &temp);
+
+ i1.LowPart = t->absolute.dwLowDateTime;
+ i1.HighPart = t->absolute.dwHighDateTime;
+ i2.LowPart = temp.dwLowDateTime;
+ i2.HighPart = temp.dwHighDateTime;
+
+ i3 = (i1.QuadPart - i2.QuadPart) / 10000000;
+
+ return ((isc_uint32_t)i3);
+}
+
+isc_uint32_t
+isc_time_nanoseconds(const isc_time_t *t) {
+ ULARGE_INTEGER i;
+
+ i.LowPart = t->absolute.dwLowDateTime;
+ i.HighPart = t->absolute.dwHighDateTime;
+ return ((isc_uint32_t)(i.QuadPart % 10000000) * 100);
+}
+
+void
+isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) {
+ FILETIME localft;
+ SYSTEMTIME st;
+ char DateBuf[50];
+ char TimeBuf[50];
+
+ static const char badtime[] = "99-Bad-9999 99:99:99.999";
+
+ REQUIRE(len > 0);
+ if (FileTimeToLocalFileTime(&t->absolute, &localft) &&
+ FileTimeToSystemTime(&localft, &st)) {
+ GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "dd-MMM-yyyy",
+ DateBuf, 50);
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER|
+ TIME_FORCE24HOURFORMAT, &st, NULL, TimeBuf, 50);
+
+ snprintf(buf, len, "%s %s.%03u", DateBuf, TimeBuf,
+ st.wMilliseconds);
+
+ } else
+ snprintf(buf, len, badtime);
+}
+
+void
+isc_time_formathttptimestamp(const isc_time_t *t, char *buf, unsigned int len) {
+ SYSTEMTIME st;
+ char DateBuf[50];
+ char TimeBuf[50];
+
+/* strftime() format: "%a, %d %b %Y %H:%M:%S GMT" */
+
+ REQUIRE(len > 0);
+ if (FileTimeToSystemTime(&t->absolute, &st)) {
+ GetDateFormat(LOCALE_USER_DEFAULT, 0, &st,
+ "ddd',', dd-MMM-yyyy", DateBuf, 50);
+ GetTimeFormat(LOCALE_USER_DEFAULT,
+ TIME_NOTIMEMARKER | TIME_FORCE24HOURFORMAT,
+ &st, "hh':'mm':'ss", TimeBuf, 50);
+
+ snprintf(buf, len, "%s %s GMT", DateBuf, TimeBuf);
+ } else {
+ buf[0] = 0;
+ }
+}
+
+void
+isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len) {
+ SYSTEMTIME st;
+ char DateBuf[50];
+ char TimeBuf[50];
+
+/* strtime() format: "%Y-%m-%dT%H:%M:%SZ" */
+
+ REQUIRE(len > 0);
+ if (FileTimeToSystemTime(&t->absolute, &st)) {
+ GetDateFormat(LOCALE_NEUTRAL, 0, &st, "yyyy-MM-dd",
+ DateBuf, 50);
+ GetTimeFormat(LOCALE_NEUTRAL,
+ TIME_NOTIMEMARKER | TIME_FORCE24HOURFORMAT,
+ &st, "hh':'mm':'ss", TimeBuf, 50);
+ snprintf(buf, len, "%s%sZ", DateBuf, TimeBuf);
+ } else {
+ buf[0] = 0;
+ }
+}
diff --git a/lib/isc/win32/unistd.h b/lib/isc/win32/unistd.h
new file mode 100644
index 0000000..bcb3b25
--- /dev/null
+++ b/lib/isc/win32/unistd.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2004, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: unistd.h,v 1.10 2009/07/17 23:47:41 tbox Exp $ */
+
+/* None of these are defined in NT, so define them for our use */
+#define O_NONBLOCK 1
+#define PORT_NONBLOCK O_NONBLOCK
+
+/*
+ * fcntl() commands
+ */
+#define F_SETFL 0
+#define F_GETFL 1
+#define F_SETFD 2
+#define F_GETFD 3
+/*
+ * Enough problems not having full fcntl() without worrying about this!
+ */
+#undef F_DUPFD
+
+int fcntl(int, int, ...);
+
+/*
+ * access() related definitions for winXP
+ */
+#include <io.h>
+#ifndef F_OK
+#define F_OK 0
+#endif
+
+#ifndef X_OK
+#define X_OK 1
+#endif
+
+#ifndef W_OK
+#define W_OK 2
+#endif
+
+#ifndef R_OK
+#define R_OK 4
+#endif
+
+#define access _access
+
+#include <process.h>
diff --git a/lib/isc/win32/version.c b/lib/isc/win32/version.c
new file mode 100644
index 0000000..6d5c1fd
--- /dev/null
+++ b/lib/isc/win32/version.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: version.c,v 1.7 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <versions.h>
+
+#include <isc/version.h>
+
+LIBISC_EXTERNAL_DATA const char isc_version[] = VERSION;
+
+LIBISC_EXTERNAL_DATA const unsigned int isc_libinterface = LIBINTERFACE;
+LIBISC_EXTERNAL_DATA const unsigned int isc_librevision = LIBREVISION;
+LIBISC_EXTERNAL_DATA const unsigned int isc_libage = LIBAGE;
diff --git a/lib/isc/win32/win32os.c b/lib/isc/win32/win32os.c
new file mode 100644
index 0000000..56498d0
--- /dev/null
+++ b/lib/isc/win32/win32os.c
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: win32os.c,v 1.5 2007/06/19 23:47:19 tbox Exp $ */
+
+#include <windows.h>
+
+#include <isc/win32os.h>
+
+static BOOL bInit = FALSE;
+static OSVERSIONINFOEX osVer;
+
+static void
+initialize_action(void) {
+ BOOL bSuccess;
+
+ if (bInit)
+ return;
+ /*
+ * NOTE: VC++ 6.0 gets this function declaration wrong
+ * so we compensate by casting the argument
+ */
+ osVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ bSuccess = GetVersionEx((OSVERSIONINFO *) &osVer);
+
+ /*
+ * Versions of NT before NT4.0 SP6 did not return the
+ * extra info that the EX structure provides and returns
+ * a failure so we need to retry with the old structure.
+ */
+ if(!bSuccess) {
+ osVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ bSuccess = GetVersionEx((OSVERSIONINFO *) &osVer);
+ }
+ bInit = TRUE;
+}
+
+unsigned int
+isc_win32os_majorversion(void) {
+ initialize_action();
+ return ((unsigned int)osVer.dwMajorVersion);
+}
+
+unsigned int
+isc_win32os_minorversion(void) {
+ initialize_action();
+ return ((unsigned int)osVer.dwMinorVersion);
+}
+
+unsigned int
+isc_win32os_servicepackmajor(void) {
+ initialize_action();
+ return ((unsigned int)osVer.wServicePackMajor);
+}
+
+unsigned int
+isc_win32os_servicepackminor(void) {
+ initialize_action();
+ return ((unsigned int)osVer.wServicePackMinor);
+}
+
+int
+isc_win32os_versioncheck(unsigned int major, unsigned int minor,
+ unsigned int spmajor, unsigned int spminor) {
+
+ initialize_action();
+
+ if (major < isc_win32os_majorversion())
+ return (1);
+ if (major > isc_win32os_majorversion())
+ return (-1);
+ if (minor < isc_win32os_minorversion())
+ return (1);
+ if (minor > isc_win32os_minorversion())
+ return (-1);
+ if (spmajor < isc_win32os_servicepackmajor())
+ return (1);
+ if (spmajor > isc_win32os_servicepackmajor())
+ return (-1);
+ if (spminor < isc_win32os_servicepackminor())
+ return (1);
+ if (spminor > isc_win32os_servicepackminor())
+ return (-1);
+
+ /* Exact */
+ return (0);
+} \ No newline at end of file
diff --git a/lib/isc/x86_32/include/isc/atomic.h b/lib/isc/x86_32/include/isc/atomic.h
new file mode 100644
index 0000000..bf2148c
--- /dev/null
+++ b/lib/isc/x86_32/include/isc/atomic.h
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: atomic.h,v 1.10 2008/01/24 23:47:00 tbox Exp $ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#ifdef ISC_PLATFORM_USEGCCASM
+/*
+ * This routine atomically increments the value stored in 'p' by 'val', and
+ * returns the previous value.
+ */
+static __inline__ isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ isc_int32_t prev = val;
+
+ __asm__ volatile(
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "xadd %0, %1"
+ :"=q"(prev)
+ :"m"(*p), "0"(prev)
+ :"memory", "cc");
+
+ return (prev);
+}
+
+#ifdef ISC_PLATFORM_HAVEXADDQ
+static __inline__ isc_int64_t
+isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) {
+ isc_int64_t prev = val;
+
+ __asm__ volatile(
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "xaddq %0, %1"
+ :"=q"(prev)
+ :"m"(*p), "0"(prev)
+ :"memory", "cc");
+
+ return (prev);
+}
+#endif /* ISC_PLATFORM_HAVEXADDQ */
+
+/*
+ * This routine atomically stores the value 'val' in 'p'.
+ */
+static __inline__ void
+isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+ __asm__ volatile(
+#ifdef ISC_PLATFORM_USETHREADS
+ /*
+ * xchg should automatically lock memory, but we add it
+ * explicitly just in case (it at least doesn't harm)
+ */
+ "lock;"
+#endif
+
+ "xchgl %1, %0"
+ :
+ : "r"(val), "m"(*p)
+ : "memory");
+}
+
+/*
+ * This routine atomically replaces the value in 'p' with 'val', if the
+ * original value is equal to 'cmpval'. The original value is returned in any
+ * case.
+ */
+static __inline__ isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+ __asm__ volatile(
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "cmpxchgl %1, %2"
+ : "=a"(cmpval)
+ : "r"(val), "m"(*p), "a"(cmpval)
+ : "memory");
+
+ return (cmpval);
+}
+
+#elif defined(ISC_PLATFORM_USESTDASM)
+/*
+ * The followings are "generic" assembly code which implements the same
+ * functionality in case the gcc extension cannot be used. It should be
+ * better to avoid inlining below, since we directly refer to specific
+ * positions of the stack frame, which would not actually point to the
+ * intended address in the embedded mnemonic.
+ */
+#include <isc/util.h> /* for 'UNUSED' macro */
+
+static isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ UNUSED(p);
+ UNUSED(val);
+
+ __asm (
+ "movl 8(%ebp), %ecx\n"
+ "movl 12(%ebp), %edx\n"
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "xadd %edx, (%ecx)\n"
+
+ /*
+ * set the return value directly in the register so that we
+ * can avoid guessing the correct position in the stack for a
+ * local variable.
+ */
+ "movl %edx, %eax"
+ );
+}
+
+static void
+isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+ UNUSED(p);
+ UNUSED(val);
+
+ __asm (
+ "movl 8(%ebp), %ecx\n"
+ "movl 12(%ebp), %edx\n"
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "xchgl (%ecx), %edx\n"
+ );
+}
+
+static isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+ UNUSED(p);
+ UNUSED(cmpval);
+ UNUSED(val);
+
+ __asm (
+ "movl 8(%ebp), %ecx\n"
+ "movl 12(%ebp), %eax\n" /* must be %eax for cmpxchgl */
+ "movl 16(%ebp), %edx\n"
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+
+ /*
+ * If (%ecx) == %eax then (%ecx) := %edx.
+ % %eax is set to old (%ecx), which will be the return value.
+ */
+ "cmpxchgl %edx, (%ecx)"
+ );
+}
+#else /* !ISC_PLATFORM_USEGCCASM && !ISC_PLATFORM_USESTDASM */
+
+#error "unsupported compiler. disable atomic ops by --disable-atomic"
+
+#endif
+#endif /* ISC_ATOMIC_H */
diff --git a/lib/isc/x86_64/include/isc/atomic.h b/lib/isc/x86_64/include/isc/atomic.h
new file mode 100644
index 0000000..f57bd2a
--- /dev/null
+++ b/lib/isc/x86_64/include/isc/atomic.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: atomic.h,v 1.6 2008/01/24 23:47:00 tbox Exp $ */
+
+#ifndef ISC_ATOMIC_H
+#define ISC_ATOMIC_H 1
+
+#include <isc/platform.h>
+#include <isc/types.h>
+
+#ifdef ISC_PLATFORM_USEGCCASM
+
+/* We share the gcc-version with x86_32 */
+#error "impossible case. check build configuration"
+
+#elif defined(ISC_PLATFORM_USESTDASM)
+/*
+ * The followings are "generic" assembly code which implements the same
+ * functionality in case the gcc extension cannot be used. It should be
+ * better to avoid inlining below, since we directly refer to specific
+ * registers for arguments, which would not actually correspond to the
+ * intended address or value in the embedded mnemonic.
+ */
+#include <isc/util.h> /* for 'UNUSED' macro */
+
+static isc_int32_t
+isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
+ UNUSED(p);
+ UNUSED(val);
+
+ __asm (
+ "movq %rdi, %rdx\n"
+ "movl %esi, %eax\n"
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "xadd %eax, (%rdx)\n"
+ /*
+ * XXX: assume %eax will be used as the return value.
+ */
+ );
+}
+
+#ifdef ISC_PLATFORM_HAVEXADDQ
+static isc_int64_t
+isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) {
+ UNUSED(p);
+ UNUSED(val);
+
+ __asm (
+ "movq %rdi, %rdx\n"
+ "movq %rsi, %rax\n"
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "xaddq %rax, (%rdx)\n"
+ /*
+ * XXX: assume %rax will be used as the return value.
+ */
+ );
+}
+#endif
+
+static void
+isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+ UNUSED(p);
+ UNUSED(val);
+
+ __asm (
+ "movq %rdi, %rax\n"
+ "movl %esi, %edx\n"
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ "xchgl (%rax), %edx\n"
+ /*
+ * XXX: assume %rax will be used as the return value.
+ */
+ );
+}
+
+static isc_int32_t
+isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
+ UNUSED(p);
+ UNUSED(cmpval);
+ UNUSED(val);
+
+ __asm (
+ "movl %edx, %ecx\n"
+ "movl %esi, %eax\n"
+ "movq %rdi, %rdx\n"
+
+#ifdef ISC_PLATFORM_USETHREADS
+ "lock;"
+#endif
+ /*
+ * If (%rdi) == %eax then (%rdi) := %edx.
+ * %eax is set to old (%ecx), which will be the return value.
+ */
+ "cmpxchgl %ecx, (%rdx)"
+ );
+}
+
+#else /* !ISC_PLATFORM_USEGCCASM && !ISC_PLATFORM_USESTDASM */
+
+#error "unsupported compiler. disable atomic ops by --disable-atomic"
+
+#endif
+#endif /* ISC_ATOMIC_H */
diff --git a/libjsmn/LICENSE b/libjsmn/LICENSE
new file mode 100644
index 0000000..c84fb2e
--- /dev/null
+++ b/libjsmn/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Serge A. Zaitsev
+
+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.
+
diff --git a/libjsmn/Makefile b/libjsmn/Makefile
new file mode 100644
index 0000000..ac947a3
--- /dev/null
+++ b/libjsmn/Makefile
@@ -0,0 +1,27 @@
+# You can put your build options here
+-include config.mk
+
+all: libjsmn.a
+
+libjsmn.a: jsmn.o
+ $(AR) rc $@ $^
+
+%.o: %.c jsmn.h
+ $(CC) -c $(CFLAGS) $< -o $@
+
+test: jsmn_test
+ ./jsmn_test
+
+jsmn_test: jsmn_test.o
+ $(CC) -L. -ljsmn $< -o $@
+
+jsmn_test.o: jsmn_test.c libjsmn.a
+
+clean:
+ rm -f jsmn.o jsmn_test.o
+ rm -f jsmn_test
+ rm -f jsmn_test.exe
+ rm -f libjsmn.a
+
+.PHONY: all clean test
+
diff --git a/libjsmn/README.md b/libjsmn/README.md
new file mode 100644
index 0000000..abccffa
--- /dev/null
+++ b/libjsmn/README.md
@@ -0,0 +1,161 @@
+
+JSMN
+====
+
+jsmn (pronounced like 'jasmine') is a minimalistic JSON parser in C. It can be
+easily integrated into resource-limited or embedded projects.
+
+You can find more information about JSON format at [json.org][1]
+
+Library sources are available at [bitbucket.org/zserge/jsmn][2]
+
+The web page with some information about jsmn can be found at
+[http://zserge.com/jsmn.html][3]
+
+Philosophy
+----------
+
+Most JSON parsers offer you a bunch of functions to load JSON data, parse it
+and extract any value by its name. jsmn proves that checking the correctness of
+every JSON packet or allocating temporary objects to store parsed JSON fields
+often is an overkill.
+
+JSON format itself is extremely simple, so why should we complicate it?
+
+jsmn is designed to be **robust** (it should work fine even with erroneous
+data), **fast** (it should parse data on the fly), **portable** (no superfluous
+dependencies or non-standard C extensions). An of course, **simplicity** is a
+key feature - simple code style, simple algorithm, simple integration into
+other projects.
+
+Features
+--------
+
+* compatible with C89
+* no dependencies (even libc!)
+* highly portable (tested on x86/amd64, ARM, AVR)
+* about 200 lines of code
+* extremely small code footprint
+* API contains only 2 functions
+* no dynamic memory allocation
+* incremental single-pass parsing
+* library code is covered with unit-tests
+
+Design
+------
+
+The rudimentary jsmn object is a **token**. Let's consider a JSON string:
+
+ '{ "name" : "Jack", "age" : 27 }'
+
+It holds the following tokens:
+
+* Object: `{ "name" : "Jack", "age" : 27}` (the whole object)
+* Strings: `"name"`, `"Jack"`, `"age"` (keys and some values)
+* Number: `27`
+
+In jsmn, tokens do not hold any data, but point to token boundaries in JSON
+string instead. In the example above jsmn will create tokens like: Object
+[0..31], String [3..7], String [12..16], String [20..23], Number [27..29].
+
+Every jsmn token has a type, which indicates the type of corresponding JSON
+token. jsmn supports the following token types:
+
+* Object - a container of key-value pairs, e.g.:
+ `{ "foo":"bar", "x":0.3 }`
+* Array - a sequence of values, e.g.:
+ `[ 1, 2, 3 ]`
+* String - a quoted sequence of chars, e.g.: `"foo"`
+* Primitive - a number, a boolean (`true`, `false`) or `null`
+
+Besides start/end positions, jsmn tokens for complex types (like arrays
+or objects) also contain a number of child items, so you can easily follow
+object hierarchy.
+
+This approach provides enough information for parsing any JSON data and makes
+it possible to use zero-copy techniques.
+
+Install
+-------
+
+To clone the repository you should have mercurial installed. Just run:
+
+ $ hg clone http://bitbucket.org/zserge/jsmn jsmn
+
+Repository layout is simple: jsmn.c and jsmn.h are library files; demo.c is an
+example of how to use jsmn (it is also used in unit tests); test.sh is a test
+script. You will also find README, LICENSE and Makefile files inside.
+
+To build the library, run `make`. It is also recommended to run `make test`.
+Let me know, if some tests fail.
+
+If build was successful, you should get a `libjsmn.a` library.
+The header file you should include is called `"jsmn.h"`.
+
+API
+---
+
+Token types are described by `jsmntype_t`:
+
+ typedef enum {
+ JSMN_PRIMITIVE = 0,
+ JSMN_OBJECT = 1,
+ JSMN_ARRAY = 2,
+ JSMN_STRING = 3
+ } jsmntype_t;
+
+**Note:** Unlike JSON data types, primitive tokens are not divided into
+numbers, booleans and null, because one can easily tell the type using the
+first character:
+
+* <code>'t', 'f'</code> - boolean
+* <code>'n'</code> - null
+* <code>'-', '0'..'9'</code> - number
+
+Token is an object of `jsmntok_t` type:
+
+ typedef struct {
+ jsmntype_t type; // Token type
+ int start; // Token start position
+ int end; // Token end position
+ int size; // Number of child (nested) tokens
+ } jsmntok_t;
+
+**Note:** string tokens point to the first character after
+the opening quote and the previous symbol before final quote. This was made
+to simplify string extraction from JSON data.
+
+All job is done by `jsmn_parser` object. You can initialize a new parser using:
+
+ struct jsmn_parser parser;
+ jsmntok_t tokens[10];
+
+ // js - pointer to JSON string
+ // tokens - an array of tokens available
+ // 10 - number of tokens available
+ jsmn_init_parser(&parser, js, tokens, 10);
+
+This will create a parser, that can parse up to 10 JSON tokens from `js` string.
+
+Later, you can use `jsmn_parse(&parser)` function to process JSON string with the parser.
+If something goes wrong, you will get an error. Error will be one of these:
+
+* `JSMN_SUCCESS` - everything went fine. String was parsed
+* `JSMN_ERROR_INVAL` - bad token, JSON string is corrupted
+* `JSMN_ERROR_NOMEM` - not enough tokens, JSON string is too large
+* `JSMN_ERROR_PART` - JSON string is too short, expecting more JSON data
+
+If you get `JSON_ERROR_NOMEM`, you can re-allocate more tokens and call
+`jsmn_parse` once more. If you read json data from the stream, you can
+periodically call `jsmn_parse` and check if return value is `JSON_ERROR_PART`.
+You will get this error until you reach the end of JSON data.
+
+Other info
+----------
+
+This software is distributed under [MIT license](http://www.opensource.org/licenses/mit-license.php),
+ so feel free to integrate it in your commercial products.
+
+[1]: http://www.json.org/
+[2]: https://bitbucket.org/zserge/jsmn/wiki/Home
+[3]: http://zserge.com/jsmn.html
diff --git a/libjsmn/jsmn.c b/libjsmn/jsmn.c
new file mode 100644
index 0000000..4f70adb
--- /dev/null
+++ b/libjsmn/jsmn.c
@@ -0,0 +1,268 @@
+#include <stdlib.h>
+#include <string.h>
+
+#include "jsmn.h"
+
+/**
+ * Allocates a fresh unused token from the token pull.
+ */
+static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser,
+ jsmntok_t *tokens, size_t num_tokens) {
+ jsmntok_t *tok;
+ if (parser->toknext >= num_tokens) {
+ return NULL;
+ }
+ tok = &tokens[parser->toknext++];
+ tok->start = tok->end = -1;
+ tok->size = 0;
+#ifdef JSMN_PARENT_LINKS
+ tok->parent = -1;
+#endif
+ return tok;
+}
+
+/**
+ * Fills token type and boundaries.
+ */
+static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
+ int start, int end) {
+ token->type = type;
+ token->start = start;
+ token->end = end;
+ token->size = 0;
+}
+
+/**
+ * Fills next available token with JSON primitive.
+ */
+static jsmnerr_t jsmn_parse_primitive(jsmn_parser *parser, const char *js,
+ jsmntok_t *tokens, size_t num_tokens) {
+ jsmntok_t *token;
+ int start;
+
+ start = parser->pos;
+
+ for (; js[parser->pos] != '\0'; parser->pos++) {
+ switch (js[parser->pos]) {
+#ifndef JSMN_STRICT
+ /* In strict mode primitive must be followed by "," or "}" or "]" */
+ case ':':
+#endif
+ case '\t' : case '\r' : case '\n' : case ' ' :
+ case ',' : case ']' : case '}' :
+ goto found;
+ }
+ if (js[parser->pos] < 32 || js[parser->pos] >= 127) {
+ parser->pos = start;
+ return JSMN_ERROR_INVAL;
+ }
+ }
+#ifdef JSMN_STRICT
+ /* In strict mode primitive must be followed by a comma/object/array */
+ parser->pos = start;
+ return JSMN_ERROR_PART;
+#endif
+
+found:
+ token = jsmn_alloc_token(parser, tokens, num_tokens);
+ if (token == NULL) {
+ parser->pos = start;
+ return JSMN_ERROR_NOMEM;
+ }
+ jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
+#ifdef JSMN_PARENT_LINKS
+ token->parent = parser->toksuper;
+#endif
+ parser->pos--;
+ return JSMN_SUCCESS;
+}
+
+/**
+ * Filsl next token with JSON string.
+ */
+static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js,
+ jsmntok_t *tokens, size_t num_tokens) {
+ jsmntok_t *token;
+
+ int start = parser->pos;
+
+ parser->pos++;
+
+ /* Skip starting quote */
+ for (; js[parser->pos] != '\0'; parser->pos++) {
+ char c = js[parser->pos];
+
+ /* Quote: end of string */
+ if (c == '\"') {
+ token = jsmn_alloc_token(parser, tokens, num_tokens);
+ if (token == NULL) {
+ parser->pos = start;
+ return JSMN_ERROR_NOMEM;
+ }
+ jsmn_fill_token(token, JSMN_STRING, start+1, parser->pos);
+#ifdef JSMN_PARENT_LINKS
+ token->parent = parser->toksuper;
+#endif
+ return JSMN_SUCCESS;
+ }
+
+ /* Backslash: Quoted symbol expected */
+ if (c == '\\') {
+ parser->pos++;
+ switch (js[parser->pos]) {
+ /* Allowed escaped symbols */
+ case '\"': case '/' : case '\\' : case 'b' :
+ case 'f' : case 'r' : case 'n' : case 't' :
+ break;
+ /* Allows escaped symbol \uXXXX */
+ case 'u':
+ parser->pos++;
+ int i = 0;
+ for(; i < 4 && js[parser->pos] != '\0'; i++) {
+ /* If it isn't a hex character we have an error */
+ if(!((js[parser->pos] >= 48 && js[parser->pos] <= 57) || /* 0-9 */
+ (js[parser->pos] >= 65 && js[parser->pos] <= 70) || /* A-F */
+ (js[parser->pos] >= 97 && js[parser->pos] <= 102))) { /* a-f */
+ parser->pos = start;
+ return JSMN_ERROR_INVAL;
+ }
+ parser->pos++;
+ }
+ parser->pos--;
+ break;
+ /* Unexpected symbol */
+ default:
+ parser->pos = start;
+ return JSMN_ERROR_INVAL;
+ }
+ }
+ }
+ parser->pos = start;
+ return JSMN_ERROR_PART;
+}
+
+/**
+ * Parse JSON string and fill tokens.
+ */
+jsmnerr_t jsmn_parse(jsmn_parser *parser, const char *js, jsmntok_t *tokens,
+ unsigned int num_tokens) {
+ jsmnerr_t r;
+ int i;
+ jsmntok_t *token;
+
+ for (; js[parser->pos] != '\0'; parser->pos++) {
+ char c;
+ jsmntype_t type;
+
+ c = js[parser->pos];
+ switch (c) {
+ case '{': case '[':
+ token = jsmn_alloc_token(parser, tokens, num_tokens);
+ if (token == NULL)
+ return JSMN_ERROR_NOMEM;
+ if (parser->toksuper != -1) {
+ tokens[parser->toksuper].size++;
+#ifdef JSMN_PARENT_LINKS
+ token->parent = parser->toksuper;
+#endif
+ }
+ token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
+ token->start = parser->pos;
+ parser->toksuper = parser->toknext - 1;
+ break;
+ case '}': case ']':
+ type = (c == '}' ? JSMN_OBJECT : JSMN_ARRAY);
+#ifdef JSMN_PARENT_LINKS
+ if (parser->toknext < 1) {
+ return JSMN_ERROR_INVAL;
+ }
+ token = &tokens[parser->toknext - 1];
+ for (;;) {
+ if (token->start != -1 && token->end == -1) {
+ if (token->type != type) {
+ return JSMN_ERROR_INVAL;
+ }
+ token->end = parser->pos + 1;
+ parser->toksuper = token->parent;
+ break;
+ }
+ if (token->parent == -1) {
+ break;
+ }
+ token = &tokens[token->parent];
+ }
+#else
+ for (i = parser->toknext - 1; i >= 0; i--) {
+ token = &tokens[i];
+ if (token->start != -1 && token->end == -1) {
+ if (token->type != type) {
+ return JSMN_ERROR_INVAL;
+ }
+ parser->toksuper = -1;
+ token->end = parser->pos + 1;
+ break;
+ }
+ }
+ /* Error if unmatched closing bracket */
+ if (i == -1) return JSMN_ERROR_INVAL;
+ for (; i >= 0; i--) {
+ token = &tokens[i];
+ if (token->start != -1 && token->end == -1) {
+ parser->toksuper = i;
+ break;
+ }
+ }
+#endif
+ break;
+ case '\"':
+ r = jsmn_parse_string(parser, js, tokens, num_tokens);
+ if (r < 0) return r;
+ if (parser->toksuper != -1)
+ tokens[parser->toksuper].size++;
+ break;
+ case '\t' : case '\r' : case '\n' : case ':' : case ',': case ' ':
+ break;
+#ifdef JSMN_STRICT
+ /* In strict mode primitives are: numbers and booleans */
+ case '-': case '0': case '1' : case '2': case '3' : case '4':
+ case '5': case '6': case '7' : case '8': case '9':
+ case 't': case 'f': case 'n' :
+#else
+ /* In non-strict mode every unquoted value is a primitive */
+ default:
+#endif
+ r = jsmn_parse_primitive(parser, js, tokens, num_tokens);
+ if (r < 0) return r;
+ if (parser->toksuper != -1)
+ tokens[parser->toksuper].size++;
+ break;
+
+#ifdef JSMN_STRICT
+ /* Unexpected char in strict mode */
+ default:
+ return JSMN_ERROR_INVAL;
+#endif
+
+ }
+ }
+
+ for (i = parser->toknext - 1; i >= 0; i--) {
+ /* Unmatched opened object or array */
+ if (tokens[i].start != -1 && tokens[i].end == -1) {
+ return JSMN_ERROR_PART;
+ }
+ }
+
+ return JSMN_SUCCESS;
+}
+
+/**
+ * Creates a new parser based over a given buffer with an array of tokens
+ * available.
+ */
+void jsmn_init(jsmn_parser *parser) {
+ parser->pos = 0;
+ parser->toknext = 0;
+ parser->toksuper = -1;
+}
+
diff --git a/libjsmn/jsmn.h b/libjsmn/jsmn.h
new file mode 100644
index 0000000..03b2c1a
--- /dev/null
+++ b/libjsmn/jsmn.h
@@ -0,0 +1,67 @@
+#ifndef __JSMN_H_
+#define __JSMN_H_
+
+/**
+ * JSON type identifier. Basic types are:
+ * o Object
+ * o Array
+ * o String
+ * o Other primitive: number, boolean (true/false) or null
+ */
+typedef enum {
+ JSMN_PRIMITIVE = 0,
+ JSMN_OBJECT = 1,
+ JSMN_ARRAY = 2,
+ JSMN_STRING = 3
+} jsmntype_t;
+
+typedef enum {
+ /* Not enough tokens were provided */
+ JSMN_ERROR_NOMEM = -1,
+ /* Invalid character inside JSON string */
+ JSMN_ERROR_INVAL = -2,
+ /* The string is not a full JSON packet, more bytes expected */
+ JSMN_ERROR_PART = -3,
+ /* Everything was fine */
+ JSMN_SUCCESS = 0
+} jsmnerr_t;
+
+/**
+ * JSON token description.
+ * @param type type (object, array, string etc.)
+ * @param start start position in JSON data string
+ * @param end end position in JSON data string
+ */
+typedef struct {
+ jsmntype_t type;
+ int start;
+ int end;
+ int size;
+#ifdef JSMN_PARENT_LINKS
+ int parent;
+#endif
+} jsmntok_t;
+
+/**
+ * JSON parser. Contains an array of token blocks available. Also stores
+ * the string being parsed now and current position in that string
+ */
+typedef struct {
+ unsigned int pos; /* offset in the JSON string */
+ int toknext; /* next token to allocate */
+ int toksuper; /* superior token node, e.g parent object or array */
+} jsmn_parser;
+
+/**
+ * Create JSON parser over an array of tokens
+ */
+void jsmn_init(jsmn_parser *parser);
+
+/**
+ * Run JSON parser. It parses a JSON data string into and array of tokens, each describing
+ * a single JSON object.
+ */
+jsmnerr_t jsmn_parse(jsmn_parser *parser, const char *js,
+ jsmntok_t *tokens, unsigned int num_tokens);
+
+#endif /* __JSMN_H_ */
diff --git a/libjsmn/jsmn_test.c b/libjsmn/jsmn_test.c
new file mode 100644
index 0000000..fe5f000
--- /dev/null
+++ b/libjsmn/jsmn_test.c
@@ -0,0 +1,409 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "jsmn.c"
+
+static int test_passed = 0;
+static int test_failed = 0;
+
+/* Terminate current test with error */
+#define fail() return __LINE__
+
+/* Successfull end of the test case */
+#define done() return 0
+
+/* Check single condition */
+#define check(cond) do { if (!(cond)) fail(); } while (0)
+
+/* Test runner */
+static void test(int (*func)(void), const char *name) {
+ int r = func();
+ if (r == 0) {
+ test_passed++;
+ } else {
+ test_failed++;
+ printf("FAILED: %s (at line %d)\n", name, r);
+ }
+}
+
+#define TOKEN_EQ(t, tok_start, tok_end, tok_type) \
+ ((t).start == tok_start \
+ && (t).end == tok_end \
+ && (t).type == (tok_type))
+
+#define TOKEN_STRING(js, t, s) \
+ (strncmp(js+(t).start, s, (t).end - (t).start) == 0 \
+ && strlen(s) == (t).end - (t).start)
+
+#define TOKEN_PRINT(t) \
+ printf("start: %d, end: %d, type: %d, size: %d\n", \
+ (t).start, (t).end, (t).type, (t).size)
+
+int test_empty() {
+ const char *js;
+ int r;
+ jsmn_parser p;
+ jsmntok_t t[10];
+
+ js = "{}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, t, 10);
+ check(r == JSMN_SUCCESS);
+ check(t[0].type == JSMN_OBJECT);
+ check(t[0].start == 0 && t[0].end == 2);
+
+ js = "[]";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, t, 10);
+ check(r == JSMN_SUCCESS);
+ check(t[0].type == JSMN_ARRAY);
+ check(t[0].start == 0 && t[0].end == 2);
+
+ js = "{\"a\":[]}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, t, 10);
+ check(r == JSMN_SUCCESS);
+ check(t[0].type == JSMN_OBJECT && t[0].start == 0 && t[0].end == 8);
+ check(t[1].type == JSMN_STRING && t[1].start == 2 && t[1].end == 3);
+ check(t[2].type == JSMN_ARRAY && t[2].start == 5 && t[2].end == 7);
+
+ js = "[{},{}]";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, t, 10);
+ check(r == JSMN_SUCCESS);
+ check(t[0].type == JSMN_ARRAY && t[0].start == 0 && t[0].end == 7);
+ check(t[1].type == JSMN_OBJECT && t[1].start == 1 && t[1].end == 3);
+ check(t[2].type == JSMN_OBJECT && t[2].start == 4 && t[2].end == 6);
+ return 0;
+}
+
+int test_simple() {
+ const char *js;
+ int r;
+ jsmn_parser p;
+ jsmntok_t tokens[10];
+
+ js = "{\"a\": 0}";
+
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+ check(TOKEN_EQ(tokens[0], 0, 8, JSMN_OBJECT));
+ check(TOKEN_EQ(tokens[1], 2, 3, JSMN_STRING));
+ check(TOKEN_EQ(tokens[2], 6, 7, JSMN_PRIMITIVE));
+
+ check(TOKEN_STRING(js, tokens[0], js));
+ check(TOKEN_STRING(js, tokens[1], "a"));
+ check(TOKEN_STRING(js, tokens[2], "0"));
+
+ jsmn_init(&p);
+ js = "[\"a\":{},\"b\":{}]";
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ jsmn_init(&p);
+ js = "{\n \"Day\": 26,\n \"Month\": 9,\n \"Year\": 12\n }";
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ return 0;
+}
+
+int test_primitive() {
+ int r;
+ jsmn_parser p;
+ jsmntok_t tok[10];
+ const char *js;
+#ifndef JSMN_STRICT
+ js = "\"boolVar\" : true";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_PRIMITIVE);
+ check(TOKEN_STRING(js, tok[0], "boolVar"));
+ check(TOKEN_STRING(js, tok[1], "true"));
+
+ js = "\"boolVar\" : false";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_PRIMITIVE);
+ check(TOKEN_STRING(js, tok[0], "boolVar"));
+ check(TOKEN_STRING(js, tok[1], "false"));
+
+ js = "\"intVar\" : 12345";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_PRIMITIVE);
+ check(TOKEN_STRING(js, tok[0], "intVar"));
+ check(TOKEN_STRING(js, tok[1], "12345"));
+
+ js = "\"floatVar\" : 12.345";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_PRIMITIVE);
+ check(TOKEN_STRING(js, tok[0], "floatVar"));
+ check(TOKEN_STRING(js, tok[1], "12.345"));
+
+ js = "\"nullVar\" : null";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_PRIMITIVE);
+ check(TOKEN_STRING(js, tok[0], "nullVar"));
+ check(TOKEN_STRING(js, tok[1], "null"));
+#endif
+ return 0;
+}
+
+int test_string() {
+ int r;
+ jsmn_parser p;
+ jsmntok_t tok[10];
+ const char *js;
+
+ js = "\"strVar\" : \"hello world\"";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_STRING);
+ check(TOKEN_STRING(js, tok[0], "strVar"));
+ check(TOKEN_STRING(js, tok[1], "hello world"));
+
+ js = "\"strVar\" : \"escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\\"";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_STRING);
+ check(TOKEN_STRING(js, tok[0], "strVar"));
+ check(TOKEN_STRING(js, tok[1], "escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\"));
+
+ js = "\"strVar\" : \"\"";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_STRING);
+ check(TOKEN_STRING(js, tok[0], "strVar"));
+ check(TOKEN_STRING(js, tok[1], ""));
+
+ return 0;
+}
+
+int test_partial_string() {
+ int r;
+ jsmn_parser p;
+ jsmntok_t tok[10];
+ const char *js;
+
+ jsmn_init(&p);
+ js = "\"x\": \"va";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_ERROR_PART && tok[0].type == JSMN_STRING);
+ check(TOKEN_STRING(js, tok[0], "x"));
+ check(p.toknext == 1);
+
+ js = "\"x\": \"valu";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_ERROR_PART && tok[0].type == JSMN_STRING);
+ check(TOKEN_STRING(js, tok[0], "x"));
+ check(p.toknext == 1);
+
+ js = "\"x\": \"value\"";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_STRING);
+ check(TOKEN_STRING(js, tok[0], "x"));
+ check(TOKEN_STRING(js, tok[1], "value"));
+
+ js = "\"x\": \"value\", \"y\": \"value y\"";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_STRING
+ && tok[1].type == JSMN_STRING && tok[2].type == JSMN_STRING
+ && tok[3].type == JSMN_STRING);
+ check(TOKEN_STRING(js, tok[0], "x"));
+ check(TOKEN_STRING(js, tok[1], "value"));
+ check(TOKEN_STRING(js, tok[2], "y"));
+ check(TOKEN_STRING(js, tok[3], "value y"));
+
+ return 0;
+}
+
+int test_unquoted_keys() {
+#ifndef JSMN_STRICT
+ int r;
+ jsmn_parser p;
+ jsmntok_t tok[10];
+ const char *js;
+
+ jsmn_init(&p);
+ js = "key1: \"value\"\nkey2 : 123";
+
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_PRIMITIVE
+ && tok[1].type == JSMN_STRING && tok[2].type == JSMN_PRIMITIVE
+ && tok[3].type == JSMN_PRIMITIVE);
+ check(TOKEN_STRING(js, tok[0], "key1"));
+ check(TOKEN_STRING(js, tok[1], "value"));
+ check(TOKEN_STRING(js, tok[2], "key2"));
+ check(TOKEN_STRING(js, tok[3], "123"));
+#endif
+ return 0;
+}
+
+int test_partial_array() {
+ int r;
+ jsmn_parser p;
+ jsmntok_t tok[10];
+ const char *js;
+
+ jsmn_init(&p);
+ js = " [ 1, true, ";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_ERROR_PART && tok[0].type == JSMN_ARRAY
+ && tok[1].type == JSMN_PRIMITIVE && tok[2].type == JSMN_PRIMITIVE);
+
+ js = " [ 1, true, [123, \"hello";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_ERROR_PART && tok[0].type == JSMN_ARRAY
+ && tok[1].type == JSMN_PRIMITIVE && tok[2].type == JSMN_PRIMITIVE
+ && tok[3].type == JSMN_ARRAY && tok[4].type == JSMN_PRIMITIVE);
+
+ js = " [ 1, true, [123, \"hello\"]";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_ERROR_PART && tok[0].type == JSMN_ARRAY
+ && tok[1].type == JSMN_PRIMITIVE && tok[2].type == JSMN_PRIMITIVE
+ && tok[3].type == JSMN_ARRAY && tok[4].type == JSMN_PRIMITIVE
+ && tok[5].type == JSMN_STRING);
+ /* check child nodes of the 2nd array */
+ check(tok[3].size == 2);
+
+ js = " [ 1, true, [123, \"hello\"]]";
+ r = jsmn_parse(&p, js, tok, 10);
+ check(r == JSMN_SUCCESS && tok[0].type == JSMN_ARRAY
+ && tok[1].type == JSMN_PRIMITIVE && tok[2].type == JSMN_PRIMITIVE
+ && tok[3].type == JSMN_ARRAY && tok[4].type == JSMN_PRIMITIVE
+ && tok[5].type == JSMN_STRING);
+ check(tok[3].size == 2);
+ check(tok[0].size == 3);
+ return 0;
+}
+
+int test_array_nomem() {
+ int i;
+ int r;
+ jsmn_parser p;
+ jsmntok_t toksmall[10], toklarge[10];
+ const char *js;
+
+ js = " [ 1, true, [123, \"hello\"]]";
+
+ for (i = 0; i < 6; i++) {
+ jsmn_init(&p);
+ memset(toksmall, 0, sizeof(toksmall));
+ memset(toklarge, 0, sizeof(toklarge));
+ r = jsmn_parse(&p, js, toksmall, i);
+ check(r == JSMN_ERROR_NOMEM);
+
+ memcpy(toklarge, toksmall, sizeof(toksmall));
+
+ r = jsmn_parse(&p, js, toklarge, 10);
+ check(r == JSMN_SUCCESS);
+
+ check(toklarge[0].type == JSMN_ARRAY && toklarge[0].size == 3);
+ check(toklarge[3].type == JSMN_ARRAY && toklarge[3].size == 2);
+ }
+ return 0;
+}
+
+int test_objects_arrays() {
+ int i;
+ int r;
+ jsmn_parser p;
+ jsmntok_t tokens[10];
+ const char *js;
+
+ js = "[10}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_ERROR_INVAL);
+
+ js = "[10]";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ js = "{\"a\": 1]";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_ERROR_INVAL);
+
+ js = "{\"a\": 1}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ return 0;
+}
+
+int test_unicode_characters() {
+ jsmn_parser p;
+ jsmntok_t tokens[10];
+ const char *js;
+
+ int r;
+ js = "{\"a\":\"\\uAbcD\"}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ js = "{\"a\":\"str\\u0000\"}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ js = "{\"a\":\"\\uFFFFstr\"}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ js = "{\"a\":\"str\\uFFGFstr\"}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_ERROR_INVAL);
+
+ js = "{\"a\":\"str\\u@FfF\"}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_ERROR_INVAL);
+
+ js = "{\"a\":[\"\\u028\"]}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_ERROR_INVAL);
+
+ js = "{\"a\":[\"\\u0280\"]}";
+ jsmn_init(&p);
+ r = jsmn_parse(&p, js, tokens, 10);
+ check(r == JSMN_SUCCESS);
+
+ return 0;
+}
+
+int main() {
+ test(test_empty, "general test for a empty JSON objects/arrays");
+ test(test_simple, "general test for a simple JSON string");
+ test(test_primitive, "test primitive JSON data types");
+ test(test_string, "test string JSON data types");
+ test(test_partial_string, "test partial JSON string parsing");
+ test(test_partial_array, "test partial array reading");
+ test(test_array_nomem, "test array reading with a smaller number of tokens");
+ test(test_unquoted_keys, "test unquoted keys (like in JavaScript)");
+ test(test_objects_arrays, "test objects and arrays");
+ test(test_unicode_characters, "test unicode characters");
+ printf("\nPASSED: %d\nFAILED: %d\n", test_passed, test_failed);
+ return 0;
+}
+
diff --git a/libntp/Makefile.am b/libntp/Makefile.am
new file mode 100644
index 0000000..515fa9a
--- /dev/null
+++ b/libntp/Makefile.am
@@ -0,0 +1,125 @@
+NULL=
+BUILT_SOURCES =
+CLEANFILES =
+noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@
+EXTRA_LIBRARIES = libntpsim.a
+
+libisc_SRCS = \
+ $(srcdir)/../lib/isc/assertions.c \
+ $(srcdir)/../lib/isc/buffer.c \
+ $(srcdir)/../lib/isc/backtrace-emptytbl.c \
+ $(srcdir)/../lib/isc/backtrace.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \
+ $(srcdir)/../lib/isc/unix/dir.c \
+ $(srcdir)/../lib/isc/error.c \
+ $(srcdir)/../lib/isc/unix/errno2result.c \
+ $(srcdir)/../lib/isc/event.c \
+ $(srcdir)/../lib/isc/unix/file.c \
+ $(srcdir)/../lib/isc/inet_ntop.c \
+ $(srcdir)/../lib/isc/inet_pton.c \
+ $(srcdir)/../lib/isc/unix/interfaceiter.c \
+ $(srcdir)/../lib/isc/lib.c \
+ $(srcdir)/../lib/isc/log.c \
+ $(srcdir)/../lib/isc/md5.c \
+ $(srcdir)/../lib/isc/nls/msgcat.c \
+ $(srcdir)/../lib/isc/unix/net.c \
+ $(srcdir)/../lib/isc/netaddr.c \
+ $(srcdir)/../lib/isc/netscope.c \
+ $(srcdir)/../lib/isc/ondestroy.c \
+ $(srcdir)/../lib/isc/random.c \
+ $(srcdir)/../lib/isc/result.c \
+ $(srcdir)/../lib/isc/unix/stdio.c \
+ $(srcdir)/../lib/isc/unix/stdtime.c \
+ $(srcdir)/../lib/isc/unix/strerror.c \
+ $(srcdir)/../lib/isc/task.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \
+ $(srcdir)/../lib/isc/unix/time.c \
+ $(srcdir)/../lib/isc/sha1.c \
+ $(srcdir)/../lib/isc/sockaddr.c \
+ $(NULL)
+
+if PTHREADS
+libisc_SRCS += $(srcdir)/../lib/isc/pthreads/mutex.c
+endif
+
+libntp_a_SRCS = \
+ a_md5encrypt.c \
+ adjtime.c \
+ atoint.c \
+ atolfp.c \
+ atouint.c \
+ audio.c \
+ authkeys.c \
+ authreadkeys.c \
+ authusekey.c \
+ bsd_strerror.c \
+ buftvtots.c \
+ caljulian.c \
+ caltontp.c \
+ calyearstart.c \
+ clocktime.c \
+ clocktypes.c \
+ decodenetnum.c \
+ dofptoa.c \
+ dolfptoa.c \
+ emalloc.c \
+ findconfig.c \
+ getopt.c \
+ hextoint.c \
+ hextolfp.c \
+ humandate.c \
+ icom.c \
+ iosignal.c \
+ lib_strbuf.c \
+ machines.c \
+ mktime.c \
+ modetoa.c \
+ mstolfp.c \
+ msyslog.c \
+ netof.c \
+ ntp_calendar.c \
+ ntp_intres.c \
+ ntp_libopts.c \
+ ntp_lineedit.c \
+ ntp_rfc2553.c \
+ ntp_worker.c \
+ numtoa.c \
+ numtohost.c \
+ octtoint.c \
+ prettydate.c \
+ ntp_random.c \
+ recvbuff.c \
+ refnumtoa.c \
+ snprintf.c \
+ socket.c \
+ socktoa.c \
+ socktohost.c \
+ ssl_init.c \
+ statestr.c \
+ strdup.c \
+ strl_obsd.c \
+ syssignal.c \
+ timetoa.c \
+ timevalops.c \
+ uglydate.c \
+ vint64ops.c \
+ work_fork.c \
+ work_thread.c \
+ ymd2yd.c \
+ $(libisc_SRCS) \
+ $(NULL)
+
+libntp_a_SOURCES = systime.c $(libntp_a_SRCS)
+libntpsim_a_SOURCES = systime_s.c $(libntp_a_SRCS)
+EXTRA_libntp_a_SOURCES = adjtimex.c
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+EXTRA_DIST = README
+
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/libntp/Makefile.in b/libntp/Makefile.in
new file mode 100644
index 0000000..87645ca
--- /dev/null
+++ b/libntp/Makefile.in
@@ -0,0 +1,1557 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@PTHREADS_TRUE@am__append_1 = $(srcdir)/../lib/isc/pthreads/mutex.c
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf
+subdir = libntp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+am__v_AR_0 = @echo " AR " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+libntp_a_AR = $(AR) $(ARFLAGS)
+libntp_a_LIBADD =
+am__libntp_a_SOURCES_DIST = systime.c a_md5encrypt.c adjtime.c \
+ atoint.c atolfp.c atouint.c audio.c authkeys.c authreadkeys.c \
+ authusekey.c bsd_strerror.c buftvtots.c caljulian.c caltontp.c \
+ calyearstart.c clocktime.c clocktypes.c decodenetnum.c \
+ dofptoa.c dolfptoa.c emalloc.c findconfig.c getopt.c \
+ hextoint.c hextolfp.c humandate.c icom.c iosignal.c \
+ lib_strbuf.c machines.c mktime.c modetoa.c mstolfp.c msyslog.c \
+ netof.c ntp_calendar.c ntp_intres.c ntp_libopts.c \
+ ntp_lineedit.c ntp_rfc2553.c ntp_worker.c numtoa.c numtohost.c \
+ octtoint.c prettydate.c ntp_random.c recvbuff.c refnumtoa.c \
+ snprintf.c socket.c socktoa.c socktohost.c ssl_init.c \
+ statestr.c strdup.c strl_obsd.c syssignal.c timetoa.c \
+ timevalops.c uglydate.c vint64ops.c work_fork.c work_thread.c \
+ ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
+ $(srcdir)/../lib/isc/buffer.c \
+ $(srcdir)/../lib/isc/backtrace-emptytbl.c \
+ $(srcdir)/../lib/isc/backtrace.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \
+ $(srcdir)/../lib/isc/unix/dir.c $(srcdir)/../lib/isc/error.c \
+ $(srcdir)/../lib/isc/unix/errno2result.c \
+ $(srcdir)/../lib/isc/event.c $(srcdir)/../lib/isc/unix/file.c \
+ $(srcdir)/../lib/isc/inet_ntop.c \
+ $(srcdir)/../lib/isc/inet_pton.c \
+ $(srcdir)/../lib/isc/unix/interfaceiter.c \
+ $(srcdir)/../lib/isc/lib.c $(srcdir)/../lib/isc/log.c \
+ $(srcdir)/../lib/isc/md5.c $(srcdir)/../lib/isc/nls/msgcat.c \
+ $(srcdir)/../lib/isc/unix/net.c $(srcdir)/../lib/isc/netaddr.c \
+ $(srcdir)/../lib/isc/netscope.c \
+ $(srcdir)/../lib/isc/ondestroy.c $(srcdir)/../lib/isc/random.c \
+ $(srcdir)/../lib/isc/result.c \
+ $(srcdir)/../lib/isc/unix/stdio.c \
+ $(srcdir)/../lib/isc/unix/stdtime.c \
+ $(srcdir)/../lib/isc/unix/strerror.c \
+ $(srcdir)/../lib/isc/task.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \
+ $(srcdir)/../lib/isc/unix/time.c $(srcdir)/../lib/isc/sha1.c \
+ $(srcdir)/../lib/isc/sockaddr.c \
+ $(srcdir)/../lib/isc/pthreads/mutex.c
+am__objects_1 =
+@PTHREADS_TRUE@am__objects_2 = mutex.$(OBJEXT)
+am__objects_3 = assertions.$(OBJEXT) buffer.$(OBJEXT) \
+ backtrace-emptytbl.$(OBJEXT) backtrace.$(OBJEXT) \
+ condition.$(OBJEXT) dir.$(OBJEXT) error.$(OBJEXT) \
+ errno2result.$(OBJEXT) event.$(OBJEXT) file.$(OBJEXT) \
+ inet_ntop.$(OBJEXT) inet_pton.$(OBJEXT) \
+ interfaceiter.$(OBJEXT) lib.$(OBJEXT) log.$(OBJEXT) \
+ md5.$(OBJEXT) msgcat.$(OBJEXT) net.$(OBJEXT) netaddr.$(OBJEXT) \
+ netscope.$(OBJEXT) ondestroy.$(OBJEXT) random.$(OBJEXT) \
+ result.$(OBJEXT) stdio.$(OBJEXT) stdtime.$(OBJEXT) \
+ strerror.$(OBJEXT) task.$(OBJEXT) thread.$(OBJEXT) \
+ time.$(OBJEXT) sha1.$(OBJEXT) sockaddr.$(OBJEXT) \
+ $(am__objects_1) $(am__objects_2)
+am__objects_4 = a_md5encrypt.$(OBJEXT) adjtime.$(OBJEXT) \
+ atoint.$(OBJEXT) atolfp.$(OBJEXT) atouint.$(OBJEXT) \
+ audio.$(OBJEXT) authkeys.$(OBJEXT) authreadkeys.$(OBJEXT) \
+ authusekey.$(OBJEXT) bsd_strerror.$(OBJEXT) \
+ buftvtots.$(OBJEXT) caljulian.$(OBJEXT) caltontp.$(OBJEXT) \
+ calyearstart.$(OBJEXT) clocktime.$(OBJEXT) \
+ clocktypes.$(OBJEXT) decodenetnum.$(OBJEXT) dofptoa.$(OBJEXT) \
+ dolfptoa.$(OBJEXT) emalloc.$(OBJEXT) findconfig.$(OBJEXT) \
+ getopt.$(OBJEXT) hextoint.$(OBJEXT) hextolfp.$(OBJEXT) \
+ humandate.$(OBJEXT) icom.$(OBJEXT) iosignal.$(OBJEXT) \
+ lib_strbuf.$(OBJEXT) machines.$(OBJEXT) mktime.$(OBJEXT) \
+ modetoa.$(OBJEXT) mstolfp.$(OBJEXT) msyslog.$(OBJEXT) \
+ netof.$(OBJEXT) ntp_calendar.$(OBJEXT) ntp_intres.$(OBJEXT) \
+ ntp_libopts.$(OBJEXT) ntp_lineedit.$(OBJEXT) \
+ ntp_rfc2553.$(OBJEXT) ntp_worker.$(OBJEXT) numtoa.$(OBJEXT) \
+ numtohost.$(OBJEXT) octtoint.$(OBJEXT) prettydate.$(OBJEXT) \
+ ntp_random.$(OBJEXT) recvbuff.$(OBJEXT) refnumtoa.$(OBJEXT) \
+ snprintf.$(OBJEXT) socket.$(OBJEXT) socktoa.$(OBJEXT) \
+ socktohost.$(OBJEXT) ssl_init.$(OBJEXT) statestr.$(OBJEXT) \
+ strdup.$(OBJEXT) strl_obsd.$(OBJEXT) syssignal.$(OBJEXT) \
+ timetoa.$(OBJEXT) timevalops.$(OBJEXT) uglydate.$(OBJEXT) \
+ vint64ops.$(OBJEXT) work_fork.$(OBJEXT) work_thread.$(OBJEXT) \
+ ymd2yd.$(OBJEXT) $(am__objects_3) $(am__objects_1)
+am_libntp_a_OBJECTS = systime.$(OBJEXT) $(am__objects_4)
+libntp_a_OBJECTS = $(am_libntp_a_OBJECTS)
+libntpsim_a_AR = $(AR) $(ARFLAGS)
+libntpsim_a_LIBADD =
+am__libntpsim_a_SOURCES_DIST = systime_s.c a_md5encrypt.c adjtime.c \
+ atoint.c atolfp.c atouint.c audio.c authkeys.c authreadkeys.c \
+ authusekey.c bsd_strerror.c buftvtots.c caljulian.c caltontp.c \
+ calyearstart.c clocktime.c clocktypes.c decodenetnum.c \
+ dofptoa.c dolfptoa.c emalloc.c findconfig.c getopt.c \
+ hextoint.c hextolfp.c humandate.c icom.c iosignal.c \
+ lib_strbuf.c machines.c mktime.c modetoa.c mstolfp.c msyslog.c \
+ netof.c ntp_calendar.c ntp_intres.c ntp_libopts.c \
+ ntp_lineedit.c ntp_rfc2553.c ntp_worker.c numtoa.c numtohost.c \
+ octtoint.c prettydate.c ntp_random.c recvbuff.c refnumtoa.c \
+ snprintf.c socket.c socktoa.c socktohost.c ssl_init.c \
+ statestr.c strdup.c strl_obsd.c syssignal.c timetoa.c \
+ timevalops.c uglydate.c vint64ops.c work_fork.c work_thread.c \
+ ymd2yd.c $(srcdir)/../lib/isc/assertions.c \
+ $(srcdir)/../lib/isc/buffer.c \
+ $(srcdir)/../lib/isc/backtrace-emptytbl.c \
+ $(srcdir)/../lib/isc/backtrace.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \
+ $(srcdir)/../lib/isc/unix/dir.c $(srcdir)/../lib/isc/error.c \
+ $(srcdir)/../lib/isc/unix/errno2result.c \
+ $(srcdir)/../lib/isc/event.c $(srcdir)/../lib/isc/unix/file.c \
+ $(srcdir)/../lib/isc/inet_ntop.c \
+ $(srcdir)/../lib/isc/inet_pton.c \
+ $(srcdir)/../lib/isc/unix/interfaceiter.c \
+ $(srcdir)/../lib/isc/lib.c $(srcdir)/../lib/isc/log.c \
+ $(srcdir)/../lib/isc/md5.c $(srcdir)/../lib/isc/nls/msgcat.c \
+ $(srcdir)/../lib/isc/unix/net.c $(srcdir)/../lib/isc/netaddr.c \
+ $(srcdir)/../lib/isc/netscope.c \
+ $(srcdir)/../lib/isc/ondestroy.c $(srcdir)/../lib/isc/random.c \
+ $(srcdir)/../lib/isc/result.c \
+ $(srcdir)/../lib/isc/unix/stdio.c \
+ $(srcdir)/../lib/isc/unix/stdtime.c \
+ $(srcdir)/../lib/isc/unix/strerror.c \
+ $(srcdir)/../lib/isc/task.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \
+ $(srcdir)/../lib/isc/unix/time.c $(srcdir)/../lib/isc/sha1.c \
+ $(srcdir)/../lib/isc/sockaddr.c \
+ $(srcdir)/../lib/isc/pthreads/mutex.c
+am_libntpsim_a_OBJECTS = systime_s.$(OBJEXT) $(am__objects_4)
+libntpsim_a_OBJECTS = $(am_libntpsim_a_OBJECTS)
+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
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libntp_a_SOURCES) $(EXTRA_libntp_a_SOURCES) \
+ $(libntpsim_a_SOURCES)
+DIST_SOURCES = $(am__libntp_a_SOURCES_DIST) $(EXTRA_libntp_a_SOURCES) \
+ $(am__libntpsim_a_SOURCES_DIST)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 = .deps-ver
+CLEANFILES = .deps-ver
+noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@
+EXTRA_LIBRARIES = libntpsim.a
+libisc_SRCS = $(srcdir)/../lib/isc/assertions.c \
+ $(srcdir)/../lib/isc/buffer.c \
+ $(srcdir)/../lib/isc/backtrace-emptytbl.c \
+ $(srcdir)/../lib/isc/backtrace.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c \
+ $(srcdir)/../lib/isc/unix/dir.c $(srcdir)/../lib/isc/error.c \
+ $(srcdir)/../lib/isc/unix/errno2result.c \
+ $(srcdir)/../lib/isc/event.c $(srcdir)/../lib/isc/unix/file.c \
+ $(srcdir)/../lib/isc/inet_ntop.c \
+ $(srcdir)/../lib/isc/inet_pton.c \
+ $(srcdir)/../lib/isc/unix/interfaceiter.c \
+ $(srcdir)/../lib/isc/lib.c $(srcdir)/../lib/isc/log.c \
+ $(srcdir)/../lib/isc/md5.c $(srcdir)/../lib/isc/nls/msgcat.c \
+ $(srcdir)/../lib/isc/unix/net.c $(srcdir)/../lib/isc/netaddr.c \
+ $(srcdir)/../lib/isc/netscope.c \
+ $(srcdir)/../lib/isc/ondestroy.c $(srcdir)/../lib/isc/random.c \
+ $(srcdir)/../lib/isc/result.c \
+ $(srcdir)/../lib/isc/unix/stdio.c \
+ $(srcdir)/../lib/isc/unix/stdtime.c \
+ $(srcdir)/../lib/isc/unix/strerror.c \
+ $(srcdir)/../lib/isc/task.c \
+ $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c \
+ $(srcdir)/../lib/isc/unix/time.c $(srcdir)/../lib/isc/sha1.c \
+ $(srcdir)/../lib/isc/sockaddr.c $(NULL) $(am__append_1)
+libntp_a_SRCS = \
+ a_md5encrypt.c \
+ adjtime.c \
+ atoint.c \
+ atolfp.c \
+ atouint.c \
+ audio.c \
+ authkeys.c \
+ authreadkeys.c \
+ authusekey.c \
+ bsd_strerror.c \
+ buftvtots.c \
+ caljulian.c \
+ caltontp.c \
+ calyearstart.c \
+ clocktime.c \
+ clocktypes.c \
+ decodenetnum.c \
+ dofptoa.c \
+ dolfptoa.c \
+ emalloc.c \
+ findconfig.c \
+ getopt.c \
+ hextoint.c \
+ hextolfp.c \
+ humandate.c \
+ icom.c \
+ iosignal.c \
+ lib_strbuf.c \
+ machines.c \
+ mktime.c \
+ modetoa.c \
+ mstolfp.c \
+ msyslog.c \
+ netof.c \
+ ntp_calendar.c \
+ ntp_intres.c \
+ ntp_libopts.c \
+ ntp_lineedit.c \
+ ntp_rfc2553.c \
+ ntp_worker.c \
+ numtoa.c \
+ numtohost.c \
+ octtoint.c \
+ prettydate.c \
+ ntp_random.c \
+ recvbuff.c \
+ refnumtoa.c \
+ snprintf.c \
+ socket.c \
+ socktoa.c \
+ socktohost.c \
+ ssl_init.c \
+ statestr.c \
+ strdup.c \
+ strl_obsd.c \
+ syssignal.c \
+ timetoa.c \
+ timevalops.c \
+ uglydate.c \
+ vint64ops.c \
+ work_fork.c \
+ work_thread.c \
+ ymd2yd.c \
+ $(libisc_SRCS) \
+ $(NULL)
+
+libntp_a_SOURCES = systime.c $(libntp_a_SRCS)
+libntpsim_a_SOURCES = systime_s.c $(libntp_a_SRCS)
+EXTRA_libntp_a_SOURCES = adjtimex.c
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_NTP)
+EXTRA_DIST = README
+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 .o .obj
+$(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 libntp/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libntp/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libntp.a: $(libntp_a_OBJECTS) $(libntp_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libntp.a
+ $(AM_V_AR)$(libntp_a_AR) libntp.a $(libntp_a_OBJECTS) $(libntp_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libntp.a
+libntpsim.a: $(libntpsim_a_OBJECTS) $(libntpsim_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libntpsim.a
+ $(AM_V_AR)$(libntpsim_a_AR) libntpsim.a $(libntpsim_a_OBJECTS) $(libntpsim_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libntpsim.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_md5encrypt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assertions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atolfp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atouint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authkeys.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authreadkeys.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authusekey.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace-emptytbl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_strerror.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buftvtots.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caljulian.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caltontp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calyearstart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktypes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/condition.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decodenetnum.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dofptoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dolfptoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emalloc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errno2result.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findconfig.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hextolfp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/humandate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icom.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interfaceiter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iosignal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_strbuf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machines.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modetoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgcat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mstolfp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msyslog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netaddr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netscope.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_calendar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_intres.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_libopts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_lineedit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_random.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_rfc2553.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_worker.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numtohost.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/octtoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ondestroy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prettydate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvbuff.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refnumtoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktohost.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statestr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdtime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strl_obsd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syssignal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systime_s.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timevalops.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uglydate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vint64ops.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_fork.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/work_thread.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 $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+assertions.o: $(srcdir)/../lib/isc/assertions.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT assertions.o -MD -MP -MF $(DEPDIR)/assertions.Tpo -c -o assertions.o `test -f '$(srcdir)/../lib/isc/assertions.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/assertions.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/assertions.Tpo $(DEPDIR)/assertions.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/assertions.c' object='assertions.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o assertions.o `test -f '$(srcdir)/../lib/isc/assertions.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/assertions.c
+
+assertions.obj: $(srcdir)/../lib/isc/assertions.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT assertions.obj -MD -MP -MF $(DEPDIR)/assertions.Tpo -c -o assertions.obj `if test -f '$(srcdir)/../lib/isc/assertions.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/assertions.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/assertions.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/assertions.Tpo $(DEPDIR)/assertions.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/assertions.c' object='assertions.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o assertions.obj `if test -f '$(srcdir)/../lib/isc/assertions.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/assertions.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/assertions.c'; fi`
+
+buffer.o: $(srcdir)/../lib/isc/buffer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.o -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.o `test -f '$(srcdir)/../lib/isc/buffer.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/buffer.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/buffer.c' object='buffer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.o `test -f '$(srcdir)/../lib/isc/buffer.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/buffer.c
+
+buffer.obj: $(srcdir)/../lib/isc/buffer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.obj -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.obj `if test -f '$(srcdir)/../lib/isc/buffer.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/buffer.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/buffer.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/buffer.c' object='buffer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.obj `if test -f '$(srcdir)/../lib/isc/buffer.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/buffer.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/buffer.c'; fi`
+
+backtrace-emptytbl.o: $(srcdir)/../lib/isc/backtrace-emptytbl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace-emptytbl.o -MD -MP -MF $(DEPDIR)/backtrace-emptytbl.Tpo -c -o backtrace-emptytbl.o `test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace-emptytbl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace-emptytbl.Tpo $(DEPDIR)/backtrace-emptytbl.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/backtrace-emptytbl.c' object='backtrace-emptytbl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace-emptytbl.o `test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace-emptytbl.c
+
+backtrace-emptytbl.obj: $(srcdir)/../lib/isc/backtrace-emptytbl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace-emptytbl.obj -MD -MP -MF $(DEPDIR)/backtrace-emptytbl.Tpo -c -o backtrace-emptytbl.obj `if test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace-emptytbl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace-emptytbl.Tpo $(DEPDIR)/backtrace-emptytbl.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/backtrace-emptytbl.c' object='backtrace-emptytbl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace-emptytbl.obj `if test -f '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace-emptytbl.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace-emptytbl.c'; fi`
+
+backtrace.o: $(srcdir)/../lib/isc/backtrace.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace.o -MD -MP -MF $(DEPDIR)/backtrace.Tpo -c -o backtrace.o `test -f '$(srcdir)/../lib/isc/backtrace.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace.Tpo $(DEPDIR)/backtrace.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/backtrace.c' object='backtrace.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace.o `test -f '$(srcdir)/../lib/isc/backtrace.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/backtrace.c
+
+backtrace.obj: $(srcdir)/../lib/isc/backtrace.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backtrace.obj -MD -MP -MF $(DEPDIR)/backtrace.Tpo -c -o backtrace.obj `if test -f '$(srcdir)/../lib/isc/backtrace.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backtrace.Tpo $(DEPDIR)/backtrace.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/backtrace.c' object='backtrace.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace.obj `if test -f '$(srcdir)/../lib/isc/backtrace.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/backtrace.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/backtrace.c'; fi`
+
+condition.o: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT condition.o -MD -MP -MF $(DEPDIR)/condition.Tpo -c -o condition.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/condition.Tpo $(DEPDIR)/condition.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' object='condition.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o condition.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c
+
+condition.obj: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT condition.obj -MD -MP -MF $(DEPDIR)/condition.Tpo -c -o condition.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/condition.Tpo $(DEPDIR)/condition.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c' object='condition.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o condition.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/condition.c'; fi`
+
+dir.o: $(srcdir)/../lib/isc/unix/dir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir.o -MD -MP -MF $(DEPDIR)/dir.Tpo -c -o dir.o `test -f '$(srcdir)/../lib/isc/unix/dir.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/dir.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dir.Tpo $(DEPDIR)/dir.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/dir.c' object='dir.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir.o `test -f '$(srcdir)/../lib/isc/unix/dir.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/dir.c
+
+dir.obj: $(srcdir)/../lib/isc/unix/dir.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dir.obj -MD -MP -MF $(DEPDIR)/dir.Tpo -c -o dir.obj `if test -f '$(srcdir)/../lib/isc/unix/dir.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/dir.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/dir.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dir.Tpo $(DEPDIR)/dir.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/dir.c' object='dir.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dir.obj `if test -f '$(srcdir)/../lib/isc/unix/dir.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/dir.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/dir.c'; fi`
+
+error.o: $(srcdir)/../lib/isc/error.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.o -MD -MP -MF $(DEPDIR)/error.Tpo -c -o error.o `test -f '$(srcdir)/../lib/isc/error.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/error.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/error.Tpo $(DEPDIR)/error.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/error.c' object='error.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.o `test -f '$(srcdir)/../lib/isc/error.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/error.c
+
+error.obj: $(srcdir)/../lib/isc/error.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.obj -MD -MP -MF $(DEPDIR)/error.Tpo -c -o error.obj `if test -f '$(srcdir)/../lib/isc/error.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/error.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/error.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/error.Tpo $(DEPDIR)/error.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/error.c' object='error.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.obj `if test -f '$(srcdir)/../lib/isc/error.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/error.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/error.c'; fi`
+
+errno2result.o: $(srcdir)/../lib/isc/unix/errno2result.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT errno2result.o -MD -MP -MF $(DEPDIR)/errno2result.Tpo -c -o errno2result.o `test -f '$(srcdir)/../lib/isc/unix/errno2result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/errno2result.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/errno2result.Tpo $(DEPDIR)/errno2result.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/errno2result.c' object='errno2result.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o errno2result.o `test -f '$(srcdir)/../lib/isc/unix/errno2result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/errno2result.c
+
+errno2result.obj: $(srcdir)/../lib/isc/unix/errno2result.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT errno2result.obj -MD -MP -MF $(DEPDIR)/errno2result.Tpo -c -o errno2result.obj `if test -f '$(srcdir)/../lib/isc/unix/errno2result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/errno2result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/errno2result.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/errno2result.Tpo $(DEPDIR)/errno2result.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/errno2result.c' object='errno2result.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o errno2result.obj `if test -f '$(srcdir)/../lib/isc/unix/errno2result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/errno2result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/errno2result.c'; fi`
+
+event.o: $(srcdir)/../lib/isc/event.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT event.o -MD -MP -MF $(DEPDIR)/event.Tpo -c -o event.o `test -f '$(srcdir)/../lib/isc/event.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/event.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/event.Tpo $(DEPDIR)/event.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/event.c' object='event.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o event.o `test -f '$(srcdir)/../lib/isc/event.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/event.c
+
+event.obj: $(srcdir)/../lib/isc/event.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT event.obj -MD -MP -MF $(DEPDIR)/event.Tpo -c -o event.obj `if test -f '$(srcdir)/../lib/isc/event.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/event.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/event.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/event.Tpo $(DEPDIR)/event.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/event.c' object='event.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o event.obj `if test -f '$(srcdir)/../lib/isc/event.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/event.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/event.c'; fi`
+
+file.o: $(srcdir)/../lib/isc/unix/file.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f '$(srcdir)/../lib/isc/unix/file.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/file.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/file.c' object='file.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f '$(srcdir)/../lib/isc/unix/file.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/file.c
+
+file.obj: $(srcdir)/../lib/isc/unix/file.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f '$(srcdir)/../lib/isc/unix/file.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/file.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/file.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/file.c' object='file.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f '$(srcdir)/../lib/isc/unix/file.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/file.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/file.c'; fi`
+
+inet_ntop.o: $(srcdir)/../lib/isc/inet_ntop.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_ntop.o -MD -MP -MF $(DEPDIR)/inet_ntop.Tpo -c -o inet_ntop.o `test -f '$(srcdir)/../lib/isc/inet_ntop.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_ntop.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_ntop.Tpo $(DEPDIR)/inet_ntop.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_ntop.c' object='inet_ntop.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_ntop.o `test -f '$(srcdir)/../lib/isc/inet_ntop.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_ntop.c
+
+inet_ntop.obj: $(srcdir)/../lib/isc/inet_ntop.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_ntop.obj -MD -MP -MF $(DEPDIR)/inet_ntop.Tpo -c -o inet_ntop.obj `if test -f '$(srcdir)/../lib/isc/inet_ntop.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_ntop.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_ntop.Tpo $(DEPDIR)/inet_ntop.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_ntop.c' object='inet_ntop.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_ntop.obj `if test -f '$(srcdir)/../lib/isc/inet_ntop.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_ntop.c'; fi`
+
+inet_pton.o: $(srcdir)/../lib/isc/inet_pton.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_pton.o -MD -MP -MF $(DEPDIR)/inet_pton.Tpo -c -o inet_pton.o `test -f '$(srcdir)/../lib/isc/inet_pton.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_pton.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_pton.Tpo $(DEPDIR)/inet_pton.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_pton.c' object='inet_pton.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_pton.o `test -f '$(srcdir)/../lib/isc/inet_pton.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/inet_pton.c
+
+inet_pton.obj: $(srcdir)/../lib/isc/inet_pton.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT inet_pton.obj -MD -MP -MF $(DEPDIR)/inet_pton.Tpo -c -o inet_pton.obj `if test -f '$(srcdir)/../lib/isc/inet_pton.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_pton.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/inet_pton.Tpo $(DEPDIR)/inet_pton.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/inet_pton.c' object='inet_pton.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o inet_pton.obj `if test -f '$(srcdir)/../lib/isc/inet_pton.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/inet_pton.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/inet_pton.c'; fi`
+
+interfaceiter.o: $(srcdir)/../lib/isc/unix/interfaceiter.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interfaceiter.o -MD -MP -MF $(DEPDIR)/interfaceiter.Tpo -c -o interfaceiter.o `test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/interfaceiter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/interfaceiter.Tpo $(DEPDIR)/interfaceiter.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/interfaceiter.c' object='interfaceiter.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interfaceiter.o `test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/interfaceiter.c
+
+interfaceiter.obj: $(srcdir)/../lib/isc/unix/interfaceiter.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT interfaceiter.obj -MD -MP -MF $(DEPDIR)/interfaceiter.Tpo -c -o interfaceiter.obj `if test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/interfaceiter.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/interfaceiter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/interfaceiter.Tpo $(DEPDIR)/interfaceiter.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/interfaceiter.c' object='interfaceiter.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o interfaceiter.obj `if test -f '$(srcdir)/../lib/isc/unix/interfaceiter.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/interfaceiter.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/interfaceiter.c'; fi`
+
+lib.o: $(srcdir)/../lib/isc/lib.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib.o -MD -MP -MF $(DEPDIR)/lib.Tpo -c -o lib.o `test -f '$(srcdir)/../lib/isc/lib.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/lib.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lib.Tpo $(DEPDIR)/lib.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/lib.c' object='lib.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib.o `test -f '$(srcdir)/../lib/isc/lib.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/lib.c
+
+lib.obj: $(srcdir)/../lib/isc/lib.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib.obj -MD -MP -MF $(DEPDIR)/lib.Tpo -c -o lib.obj `if test -f '$(srcdir)/../lib/isc/lib.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/lib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/lib.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lib.Tpo $(DEPDIR)/lib.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/lib.c' object='lib.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib.obj `if test -f '$(srcdir)/../lib/isc/lib.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/lib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/lib.c'; fi`
+
+log.o: $(srcdir)/../lib/isc/log.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.o -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.o `test -f '$(srcdir)/../lib/isc/log.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/log.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/log.c' object='log.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.o `test -f '$(srcdir)/../lib/isc/log.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/log.c
+
+log.obj: $(srcdir)/../lib/isc/log.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.obj -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.obj `if test -f '$(srcdir)/../lib/isc/log.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/log.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/log.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/log.c' object='log.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.obj `if test -f '$(srcdir)/../lib/isc/log.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/log.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/log.c'; fi`
+
+md5.o: $(srcdir)/../lib/isc/md5.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.o -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.o `test -f '$(srcdir)/../lib/isc/md5.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/md5.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/md5.c' object='md5.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.o `test -f '$(srcdir)/../lib/isc/md5.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/md5.c
+
+md5.obj: $(srcdir)/../lib/isc/md5.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5.obj -MD -MP -MF $(DEPDIR)/md5.Tpo -c -o md5.obj `if test -f '$(srcdir)/../lib/isc/md5.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/md5.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/md5.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5.Tpo $(DEPDIR)/md5.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/md5.c' object='md5.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5.obj `if test -f '$(srcdir)/../lib/isc/md5.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/md5.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/md5.c'; fi`
+
+msgcat.o: $(srcdir)/../lib/isc/nls/msgcat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT msgcat.o -MD -MP -MF $(DEPDIR)/msgcat.Tpo -c -o msgcat.o `test -f '$(srcdir)/../lib/isc/nls/msgcat.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nls/msgcat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msgcat.Tpo $(DEPDIR)/msgcat.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nls/msgcat.c' object='msgcat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o msgcat.o `test -f '$(srcdir)/../lib/isc/nls/msgcat.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/nls/msgcat.c
+
+msgcat.obj: $(srcdir)/../lib/isc/nls/msgcat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT msgcat.obj -MD -MP -MF $(DEPDIR)/msgcat.Tpo -c -o msgcat.obj `if test -f '$(srcdir)/../lib/isc/nls/msgcat.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nls/msgcat.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nls/msgcat.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msgcat.Tpo $(DEPDIR)/msgcat.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/nls/msgcat.c' object='msgcat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o msgcat.obj `if test -f '$(srcdir)/../lib/isc/nls/msgcat.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/nls/msgcat.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/nls/msgcat.c'; fi`
+
+net.o: $(srcdir)/../lib/isc/unix/net.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net.o -MD -MP -MF $(DEPDIR)/net.Tpo -c -o net.o `test -f '$(srcdir)/../lib/isc/unix/net.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/net.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/net.Tpo $(DEPDIR)/net.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/net.c' object='net.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net.o `test -f '$(srcdir)/../lib/isc/unix/net.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/net.c
+
+net.obj: $(srcdir)/../lib/isc/unix/net.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT net.obj -MD -MP -MF $(DEPDIR)/net.Tpo -c -o net.obj `if test -f '$(srcdir)/../lib/isc/unix/net.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/net.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/net.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/net.Tpo $(DEPDIR)/net.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/net.c' object='net.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o net.obj `if test -f '$(srcdir)/../lib/isc/unix/net.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/net.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/net.c'; fi`
+
+netaddr.o: $(srcdir)/../lib/isc/netaddr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netaddr.o -MD -MP -MF $(DEPDIR)/netaddr.Tpo -c -o netaddr.o `test -f '$(srcdir)/../lib/isc/netaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netaddr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netaddr.Tpo $(DEPDIR)/netaddr.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netaddr.c' object='netaddr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netaddr.o `test -f '$(srcdir)/../lib/isc/netaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netaddr.c
+
+netaddr.obj: $(srcdir)/../lib/isc/netaddr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netaddr.obj -MD -MP -MF $(DEPDIR)/netaddr.Tpo -c -o netaddr.obj `if test -f '$(srcdir)/../lib/isc/netaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netaddr.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netaddr.Tpo $(DEPDIR)/netaddr.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netaddr.c' object='netaddr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netaddr.obj `if test -f '$(srcdir)/../lib/isc/netaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netaddr.c'; fi`
+
+netscope.o: $(srcdir)/../lib/isc/netscope.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netscope.o -MD -MP -MF $(DEPDIR)/netscope.Tpo -c -o netscope.o `test -f '$(srcdir)/../lib/isc/netscope.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netscope.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netscope.Tpo $(DEPDIR)/netscope.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netscope.c' object='netscope.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netscope.o `test -f '$(srcdir)/../lib/isc/netscope.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/netscope.c
+
+netscope.obj: $(srcdir)/../lib/isc/netscope.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netscope.obj -MD -MP -MF $(DEPDIR)/netscope.Tpo -c -o netscope.obj `if test -f '$(srcdir)/../lib/isc/netscope.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netscope.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netscope.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netscope.Tpo $(DEPDIR)/netscope.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/netscope.c' object='netscope.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netscope.obj `if test -f '$(srcdir)/../lib/isc/netscope.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/netscope.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/netscope.c'; fi`
+
+ondestroy.o: $(srcdir)/../lib/isc/ondestroy.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ondestroy.o -MD -MP -MF $(DEPDIR)/ondestroy.Tpo -c -o ondestroy.o `test -f '$(srcdir)/../lib/isc/ondestroy.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/ondestroy.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ondestroy.Tpo $(DEPDIR)/ondestroy.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/ondestroy.c' object='ondestroy.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ondestroy.o `test -f '$(srcdir)/../lib/isc/ondestroy.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/ondestroy.c
+
+ondestroy.obj: $(srcdir)/../lib/isc/ondestroy.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ondestroy.obj -MD -MP -MF $(DEPDIR)/ondestroy.Tpo -c -o ondestroy.obj `if test -f '$(srcdir)/../lib/isc/ondestroy.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/ondestroy.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/ondestroy.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ondestroy.Tpo $(DEPDIR)/ondestroy.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/ondestroy.c' object='ondestroy.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ondestroy.obj `if test -f '$(srcdir)/../lib/isc/ondestroy.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/ondestroy.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/ondestroy.c'; fi`
+
+random.o: $(srcdir)/../lib/isc/random.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.o -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.o `test -f '$(srcdir)/../lib/isc/random.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/random.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/random.Tpo $(DEPDIR)/random.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/random.c' object='random.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o random.o `test -f '$(srcdir)/../lib/isc/random.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/random.c
+
+random.obj: $(srcdir)/../lib/isc/random.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.obj -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.obj `if test -f '$(srcdir)/../lib/isc/random.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/random.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/random.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/random.Tpo $(DEPDIR)/random.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/random.c' object='random.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o random.obj `if test -f '$(srcdir)/../lib/isc/random.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/random.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/random.c'; fi`
+
+result.o: $(srcdir)/../lib/isc/result.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT result.o -MD -MP -MF $(DEPDIR)/result.Tpo -c -o result.o `test -f '$(srcdir)/../lib/isc/result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/result.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/result.Tpo $(DEPDIR)/result.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/result.c' object='result.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o result.o `test -f '$(srcdir)/../lib/isc/result.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/result.c
+
+result.obj: $(srcdir)/../lib/isc/result.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT result.obj -MD -MP -MF $(DEPDIR)/result.Tpo -c -o result.obj `if test -f '$(srcdir)/../lib/isc/result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/result.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/result.Tpo $(DEPDIR)/result.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/result.c' object='result.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o result.obj `if test -f '$(srcdir)/../lib/isc/result.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/result.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/result.c'; fi`
+
+stdio.o: $(srcdir)/../lib/isc/unix/stdio.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdio.o -MD -MP -MF $(DEPDIR)/stdio.Tpo -c -o stdio.o `test -f '$(srcdir)/../lib/isc/unix/stdio.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdio.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdio.Tpo $(DEPDIR)/stdio.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdio.c' object='stdio.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdio.o `test -f '$(srcdir)/../lib/isc/unix/stdio.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdio.c
+
+stdio.obj: $(srcdir)/../lib/isc/unix/stdio.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdio.obj -MD -MP -MF $(DEPDIR)/stdio.Tpo -c -o stdio.obj `if test -f '$(srcdir)/../lib/isc/unix/stdio.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdio.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdio.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdio.Tpo $(DEPDIR)/stdio.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdio.c' object='stdio.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdio.obj `if test -f '$(srcdir)/../lib/isc/unix/stdio.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdio.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdio.c'; fi`
+
+stdtime.o: $(srcdir)/../lib/isc/unix/stdtime.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdtime.o -MD -MP -MF $(DEPDIR)/stdtime.Tpo -c -o stdtime.o `test -f '$(srcdir)/../lib/isc/unix/stdtime.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdtime.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdtime.Tpo $(DEPDIR)/stdtime.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdtime.c' object='stdtime.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdtime.o `test -f '$(srcdir)/../lib/isc/unix/stdtime.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/stdtime.c
+
+stdtime.obj: $(srcdir)/../lib/isc/unix/stdtime.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stdtime.obj -MD -MP -MF $(DEPDIR)/stdtime.Tpo -c -o stdtime.obj `if test -f '$(srcdir)/../lib/isc/unix/stdtime.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdtime.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdtime.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stdtime.Tpo $(DEPDIR)/stdtime.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/stdtime.c' object='stdtime.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stdtime.obj `if test -f '$(srcdir)/../lib/isc/unix/stdtime.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/stdtime.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/stdtime.c'; fi`
+
+strerror.o: $(srcdir)/../lib/isc/unix/strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strerror.o -MD -MP -MF $(DEPDIR)/strerror.Tpo -c -o strerror.o `test -f '$(srcdir)/../lib/isc/unix/strerror.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strerror.Tpo $(DEPDIR)/strerror.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/strerror.c' object='strerror.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strerror.o `test -f '$(srcdir)/../lib/isc/unix/strerror.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/strerror.c
+
+strerror.obj: $(srcdir)/../lib/isc/unix/strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT strerror.obj -MD -MP -MF $(DEPDIR)/strerror.Tpo -c -o strerror.obj `if test -f '$(srcdir)/../lib/isc/unix/strerror.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/strerror.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/strerror.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strerror.Tpo $(DEPDIR)/strerror.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/strerror.c' object='strerror.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strerror.obj `if test -f '$(srcdir)/../lib/isc/unix/strerror.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/strerror.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/strerror.c'; fi`
+
+task.o: $(srcdir)/../lib/isc/task.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.o -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.o `test -f '$(srcdir)/../lib/isc/task.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/task.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/task.c' object='task.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.o `test -f '$(srcdir)/../lib/isc/task.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/task.c
+
+task.obj: $(srcdir)/../lib/isc/task.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.obj -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.obj `if test -f '$(srcdir)/../lib/isc/task.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/task.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/task.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/task.c' object='task.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.obj `if test -f '$(srcdir)/../lib/isc/task.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/task.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/task.c'; fi`
+
+thread.o: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.o -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' object='thread.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.o `test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c
+
+thread.obj: $(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT thread.obj -MD -MP -MF $(DEPDIR)/thread.Tpo -c -o thread.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/thread.Tpo $(DEPDIR)/thread.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c' object='thread.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o thread.obj `if test -f '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/thread.c'; fi`
+
+time.o: $(srcdir)/../lib/isc/unix/time.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT time.o -MD -MP -MF $(DEPDIR)/time.Tpo -c -o time.o `test -f '$(srcdir)/../lib/isc/unix/time.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/time.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/time.Tpo $(DEPDIR)/time.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/time.c' object='time.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o time.o `test -f '$(srcdir)/../lib/isc/unix/time.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/unix/time.c
+
+time.obj: $(srcdir)/../lib/isc/unix/time.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT time.obj -MD -MP -MF $(DEPDIR)/time.Tpo -c -o time.obj `if test -f '$(srcdir)/../lib/isc/unix/time.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/time.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/time.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/time.Tpo $(DEPDIR)/time.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/unix/time.c' object='time.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o time.obj `if test -f '$(srcdir)/../lib/isc/unix/time.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/unix/time.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/unix/time.c'; fi`
+
+sha1.o: $(srcdir)/../lib/isc/sha1.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1.o -MD -MP -MF $(DEPDIR)/sha1.Tpo -c -o sha1.o `test -f '$(srcdir)/../lib/isc/sha1.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sha1.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha1.Tpo $(DEPDIR)/sha1.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/sha1.c' object='sha1.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha1.o `test -f '$(srcdir)/../lib/isc/sha1.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sha1.c
+
+sha1.obj: $(srcdir)/../lib/isc/sha1.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sha1.obj -MD -MP -MF $(DEPDIR)/sha1.Tpo -c -o sha1.obj `if test -f '$(srcdir)/../lib/isc/sha1.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sha1.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sha1.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sha1.Tpo $(DEPDIR)/sha1.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/sha1.c' object='sha1.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha1.obj `if test -f '$(srcdir)/../lib/isc/sha1.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sha1.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sha1.c'; fi`
+
+sockaddr.o: $(srcdir)/../lib/isc/sockaddr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockaddr.o -MD -MP -MF $(DEPDIR)/sockaddr.Tpo -c -o sockaddr.o `test -f '$(srcdir)/../lib/isc/sockaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sockaddr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockaddr.Tpo $(DEPDIR)/sockaddr.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/sockaddr.c' object='sockaddr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockaddr.o `test -f '$(srcdir)/../lib/isc/sockaddr.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/sockaddr.c
+
+sockaddr.obj: $(srcdir)/../lib/isc/sockaddr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockaddr.obj -MD -MP -MF $(DEPDIR)/sockaddr.Tpo -c -o sockaddr.obj `if test -f '$(srcdir)/../lib/isc/sockaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sockaddr.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sockaddr.Tpo $(DEPDIR)/sockaddr.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/sockaddr.c' object='sockaddr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockaddr.obj `if test -f '$(srcdir)/../lib/isc/sockaddr.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/sockaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/sockaddr.c'; fi`
+
+mutex.o: $(srcdir)/../lib/isc/pthreads/mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mutex.o -MD -MP -MF $(DEPDIR)/mutex.Tpo -c -o mutex.o `test -f '$(srcdir)/../lib/isc/pthreads/mutex.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/pthreads/mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mutex.Tpo $(DEPDIR)/mutex.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/pthreads/mutex.c' object='mutex.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mutex.o `test -f '$(srcdir)/../lib/isc/pthreads/mutex.c' || echo '$(srcdir)/'`$(srcdir)/../lib/isc/pthreads/mutex.c
+
+mutex.obj: $(srcdir)/../lib/isc/pthreads/mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mutex.obj -MD -MP -MF $(DEPDIR)/mutex.Tpo -c -o mutex.obj `if test -f '$(srcdir)/../lib/isc/pthreads/mutex.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/pthreads/mutex.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/pthreads/mutex.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mutex.Tpo $(DEPDIR)/mutex.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../lib/isc/pthreads/mutex.c' object='mutex.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mutex.obj `if test -f '$(srcdir)/../lib/isc/pthreads/mutex.c'; then $(CYGPATH_W) '$(srcdir)/../lib/isc/pthreads/mutex.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../lib/isc/pthreads/mutex.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/libntp/README b/libntp/README
new file mode 100644
index 0000000..fac7185
--- /dev/null
+++ b/libntp/README
@@ -0,0 +1,5 @@
+README file for directory ./libntp of the NTP Version 4 distribution
+
+This directory contains the sources for the NTP library used by most
+programs in this distribution. See the README and RELNOTES files in the
+parent directory for directions on how to make this library.
diff --git a/libntp/a_md5encrypt.c b/libntp/a_md5encrypt.c
new file mode 100644
index 0000000..ffabc47
--- /dev/null
+++ b/libntp/a_md5encrypt.c
@@ -0,0 +1,137 @@
+/*
+ * digest support for NTP, MD5 and with OpenSSL more
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ntp_fp.h"
+#include "ntp_string.h"
+#include "ntp_stdlib.h"
+#include "ntp.h"
+#include "ntp_md5.h" /* provides OpenSSL digest API */
+
+/*
+ * MD5authencrypt - generate message digest
+ *
+ * Returns length of MAC including key ID and digest.
+ */
+int
+MD5authencrypt(
+ int type, /* hash algorithm */
+ u_char *key, /* key pointer */
+ u_int32 *pkt, /* packet pointer */
+ int length /* packet length */
+ )
+{
+ u_char digest[EVP_MAX_MD_SIZE];
+ u_int len;
+ EVP_MD_CTX ctx;
+
+ /*
+ * Compute digest of key concatenated with packet. Note: the
+ * key type and digest type have been verified when the key
+ * was creaded.
+ */
+ INIT_SSL();
+#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x0090700fL
+ if (!EVP_DigestInit(&ctx, EVP_get_digestbynid(type))) {
+ msyslog(LOG_ERR,
+ "MAC encrypt: digest init failed");
+ return (0);
+ }
+#else
+ EVP_DigestInit(&ctx, EVP_get_digestbynid(type));
+#endif
+ EVP_DigestUpdate(&ctx, key, cache_secretsize);
+ EVP_DigestUpdate(&ctx, (u_char *)pkt, (u_int)length);
+ EVP_DigestFinal(&ctx, digest, &len);
+ memmove((u_char *)pkt + length + 4, digest, len);
+ return (len + 4);
+}
+
+
+/*
+ * MD5authdecrypt - verify MD5 message authenticator
+ *
+ * Returns one if digest valid, zero if invalid.
+ */
+int
+MD5authdecrypt(
+ int type, /* hash algorithm */
+ u_char *key, /* key pointer */
+ u_int32 *pkt, /* packet pointer */
+ int length, /* packet length */
+ int size /* MAC size */
+ )
+{
+ u_char digest[EVP_MAX_MD_SIZE];
+ u_int len;
+ EVP_MD_CTX ctx;
+
+ /*
+ * Compute digest of key concatenated with packet. Note: the
+ * key type and digest type have been verified when the key
+ * was created.
+ */
+ INIT_SSL();
+#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x0090700fL
+ if (!EVP_DigestInit(&ctx, EVP_get_digestbynid(type))) {
+ msyslog(LOG_ERR,
+ "MAC decrypt: digest init failed");
+ return (0);
+ }
+#else
+ EVP_DigestInit(&ctx, EVP_get_digestbynid(type));
+#endif
+ EVP_DigestUpdate(&ctx, key, cache_secretsize);
+ EVP_DigestUpdate(&ctx, (u_char *)pkt, (u_int)length);
+ EVP_DigestFinal(&ctx, digest, &len);
+ if ((u_int)size != len + 4) {
+ msyslog(LOG_ERR,
+ "MAC decrypt: MAC length error");
+ return (0);
+ }
+ return !memcmp(digest, (char *)pkt + length + 4, len);
+}
+
+/*
+ * Calculate the reference id from the address. If it is an IPv4
+ * address, use it as is. If it is an IPv6 address, do a md5 on
+ * it and use the bottom 4 bytes.
+ * The result is in network byte order.
+ */
+u_int32
+addr2refid(sockaddr_u *addr)
+{
+ u_char digest[20];
+ u_int32 addr_refid;
+ EVP_MD_CTX ctx;
+ u_int len;
+
+ if (IS_IPV4(addr))
+ return (NSRCADR(addr));
+
+ INIT_SSL();
+
+#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x0090700fL
+ EVP_MD_CTX_init(&ctx);
+#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
+ /* MD5 is not used as a crypto hash here. */
+ EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
+#endif
+ if (!EVP_DigestInit_ex(&ctx, EVP_md5(), NULL)) {
+ msyslog(LOG_ERR,
+ "MD5 init failed");
+ exit(1);
+ }
+#else
+ EVP_DigestInit(&ctx, EVP_md5());
+#endif
+
+ EVP_DigestUpdate(&ctx, (u_char *)PSOCK_ADDR6(addr),
+ sizeof(struct in6_addr));
+ EVP_DigestFinal(&ctx, digest, &len);
+ memcpy(&addr_refid, digest, sizeof(addr_refid));
+ return (addr_refid);
+}
diff --git a/libntp/adjtime.c b/libntp/adjtime.c
new file mode 100644
index 0000000..a8e6580
--- /dev/null
+++ b/libntp/adjtime.c
@@ -0,0 +1,386 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef MPE
+/*
+ * MPE lacks adjtime(), so we define our own. But note that time slewing has
+ * a sub-second accuracy bug documented in SR 5003462838 which prevents ntpd
+ * from being able to maintain clock synch. Because of the bug, this adjtime()
+ * implementation as used by ntpd has a side-effect of screwing up the hardware
+ * PDC clock, which will need to be reset with a reboot.
+ *
+ * This problem affects all versions of MPE at the time of this writing (when
+ * MPE/iX 7.0 is the most current). It only causes bad things to happen when
+ * doing continuous clock synchronization with ntpd; note that you CAN run ntpd
+ * with "disable ntp" in ntp.conf if you wish to provide a time server.
+ *
+ * The one-time clock adjustment functionality of ntpdate and ntp_timeset can
+ * be used without screwing up the PDC clock.
+ *
+ */
+#include <time.h>
+
+int adjtime(struct timeval *delta, struct timeval *olddelta);
+
+int adjtime(struct timeval *delta, struct timeval *olddelta)
+
+{
+/* Documented, supported MPE system intrinsics. */
+
+extern void GETPRIVMODE(void);
+extern void GETUSERMODE(void);
+
+/* Undocumented, unsupported MPE internal functions. */
+
+extern long long current_correction_usecs(void);
+extern long long get_time(void);
+extern void get_time_change_info(long long *, char *, char *);
+extern long long pdc_time(int *);
+extern void set_time_correction(long long, int, int);
+extern long long ticks_to_micro(long long);
+
+long long big_sec, big_usec, new_correction = 0LL;
+long long prev_correction;
+
+if (delta != NULL) {
+ /* Adjustment required. Convert delta to 64-bit microseconds. */
+ big_sec = (long)delta->tv_sec;
+ big_usec = delta->tv_usec;
+ new_correction = (big_sec * 1000000LL) + big_usec;
+}
+
+GETPRIVMODE();
+
+/* Determine how much of a previous correction (if any) we're interrupting. */
+prev_correction = current_correction_usecs();
+
+if (delta != NULL) {
+ /* Adjustment required. */
+
+#if 0
+ /* Speculative code disabled until bug SR 5003462838 is fixed. This bug
+ prevents accurate time slewing, and indeed renders ntpd inoperable. */
+
+ if (prev_correction != 0LL) {
+ /* A previous adjustment did not complete. Since the PDC UTC clock was
+ immediately jumped at the start of the previous adjustment, we must
+ explicitly reset it to the value of the MPE local time clock minus the
+ time zone offset. */
+
+ char pwf_since_boot, recover_pwf_time;
+ long long offset_ticks, offset_usecs, pdc_usecs_current, pdc_usecs_wanted;
+ int hpe_status;
+
+ get_time_change_info(&offset_ticks, &pwf_since_boot, &recover_pwf_time);
+ offset_usecs = ticks_to_micro(offset_ticks);
+ pdc_usecs_wanted = get_time() - offset_usecs;
+ pdc_usecs_current = pdc_time(&hpe_status);
+ if (hpe_status == 0)
+ /* Force new PDC time by starting an extra correction. */
+ set_time_correction(pdc_usecs_wanted - pdc_usecs_current,0,1);
+ }
+#endif /* 0 */
+
+ /* Immediately jump the PDC time to the new value, and then initiate a
+ gradual MPE time correction slew. */
+ set_time_correction(new_correction,0,1);
+}
+
+GETUSERMODE();
+
+if (olddelta != NULL) {
+ /* Caller wants to know remaining amount of previous correction. */
+ (long)olddelta->tv_sec = prev_correction / 1000000LL;
+ olddelta->tv_usec = prev_correction % 1000000LL;
+}
+
+return 0;
+}
+#endif /* MPE */
+
+#ifdef NEED_HPUX_ADJTIME
+/*************************************************************************/
+/* (c) Copyright Tai Jin, 1988. All Rights Reserved. */
+/* Hewlett-Packard Laboratories. */
+/* */
+/* Permission is hereby granted for unlimited modification, use, and */
+/* distribution. This software is made available with no warranty of */
+/* any kind, express or implied. This copyright notice must remain */
+/* intact in all versions of this software. */
+/* */
+/* The author would appreciate it if any bug fixes and enhancements were */
+/* to be sent back to him for incorporation into future versions of this */
+/* software. Please send changes to tai@iag.hp.com or ken@sdd.hp.com. */
+/*************************************************************************/
+
+/*
+ * Revision history
+ *
+ * 9 Jul 94 David L. Mills, Unibergity of Delabunch
+ * Implemented variable threshold to limit age of
+ * corrections; reformatted code for readability.
+ */
+
+#ifndef lint
+static char RCSid[] = "adjtime.c,v 3.1 1993/07/06 01:04:42 jbj Exp";
+#endif
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <time.h>
+#include <signal.h>
+#include "adjtime.h"
+
+#define abs(x) ((x) < 0 ? -(x) : (x))
+
+/*
+ * The following paramters are appropriate for an NTP adjustment
+ * interval of one second.
+ */
+#define ADJ_THRESH 200 /* initial threshold */
+#define ADJ_DELTA 4 /* threshold decrement */
+
+static long adjthresh; /* adjustment threshold */
+static long saveup; /* corrections accumulator */
+
+/*
+ * clear_adjtime - reset accumulator and threshold variables
+ */
+void
+_clear_adjtime(void)
+{
+ saveup = 0;
+ adjthresh = ADJ_THRESH;
+}
+
+/*
+ * adjtime - hp-ux copout of the standard Unix adjtime() system call
+ */
+int
+adjtime(
+ register struct timeval *delta,
+ register struct timeval *olddelta
+ )
+{
+ struct timeval newdelta;
+
+ /*
+ * Corrections greater than one second are done immediately.
+ */
+ if (delta->tv_sec) {
+ adjthresh = ADJ_THRESH;
+ saveup = 0;
+ return(_adjtime(delta, olddelta));
+ }
+
+ /*
+ * Corrections less than one second are accumulated until
+ * tripping a threshold, which is initially set at ADJ_THESH and
+ * reduced in ADJ_DELTA steps to zero. The idea here is to
+ * introduce large corrections quickly, while making sure that
+ * small corrections are introduced without excessive delay. The
+ * idea comes from the ARPAnet routing update algorithm.
+ */
+ saveup += delta->tv_usec;
+ if (abs(saveup) >= adjthresh) {
+ adjthresh = ADJ_THRESH;
+ newdelta.tv_sec = 0;
+ newdelta.tv_usec = saveup;
+ saveup = 0;
+ return(_adjtime(&newdelta, olddelta));
+ } else {
+ adjthresh -= ADJ_DELTA;
+ }
+
+ /*
+ * While nobody uses it, return the residual before correction,
+ * as per Unix convention.
+ */
+ if (olddelta)
+ olddelta->tv_sec = olddelta->tv_usec = 0;
+ return(0);
+}
+
+/*
+ * _adjtime - does the actual work
+ */
+int
+_adjtime(
+ register struct timeval *delta,
+ register struct timeval *olddelta
+ )
+{
+ register int mqid;
+ MsgBuf msg;
+ register MsgBuf *msgp = &msg;
+
+ /*
+ * Get the key to the adjtime message queue (note that we must
+ * get it every time because the queue might have been removed
+ * and recreated)
+ */
+ if ((mqid = msgget(KEY, 0)) == -1)
+ return (-1);
+ msgp->msgb.mtype = CLIENT;
+ msgp->msgb.tv = *delta;
+ if (olddelta)
+ msgp->msgb.code = DELTA2;
+ else
+ msgp->msgb.code = DELTA1;
+
+ /*
+ * Tickle adjtimed and snatch residual, if indicated. Lots of
+ * fanatic error checking here.
+ */
+ if (msgsnd(mqid, &msgp->msgp, MSGSIZE, 0) == -1)
+ return (-1);
+ if (olddelta) {
+ if (msgrcv(mqid, &msgp->msgp, MSGSIZE, SERVER, 0) == -1)
+ return (-1);
+ *olddelta = msgp->msgb.tv;
+ }
+ return (0);
+}
+
+#else
+# if NEED_QNX_ADJTIME
+/*
+ * Emulate adjtime() using QNX ClockAdjust().
+ * Chris Burghart <burghart@atd.ucar.edu>, 11/2001
+ * Miroslaw Pabich <miroslaw_pabich@o2.pl>, 09/2005
+ *
+ * This is an implementation of adjtime() for QNX.
+ * ClockAdjust() is used to tweak the system clock for about
+ * 1 second period until the desired delta is achieved.
+ * Time correction slew is limited to reasonable value.
+ * Internal rounding and relative errors are reduced.
+ */
+# include <sys/neutrino.h>
+# include <sys/time.h>
+
+# include <ntp_stdlib.h>
+
+/*
+ * Time correction slew limit. QNX is a hard real-time system,
+ * so don't adjust system clock too fast.
+ */
+#define CORR_SLEW_LIMIT 0.02 /* [s/s] */
+
+/*
+ * Period of system clock adjustment. It should be equal to adjtime
+ * execution period (1s). If slightly less than 1s (0.95-0.99), then olddelta
+ * residual error (introduced by execution period jitter) will be reduced.
+ */
+#define ADJUST_PERIOD 0.97 /* [s] */
+
+int
+adjtime (struct timeval *delta, struct timeval *olddelta)
+{
+ double delta_nsec;
+ double delta_nsec_old;
+ struct _clockadjust adj;
+ struct _clockadjust oldadj;
+
+ /*
+ * How many nanoseconds are we adjusting?
+ */
+ if (delta != NULL)
+ delta_nsec = 1e9 * (long)delta->tv_sec + 1e3 * delta->tv_usec;
+ else
+ delta_nsec = 0;
+
+ /*
+ * Build the adjust structure and call ClockAdjust()
+ */
+ if (delta_nsec != 0)
+ {
+ struct _clockperiod period;
+ long count;
+ long increment;
+ long increment_limit;
+ int isneg = 0;
+
+ /*
+ * Convert to absolute value for future processing
+ */
+ if (delta_nsec < 0)
+ {
+ isneg = 1;
+ delta_nsec = -delta_nsec;
+ }
+
+ /*
+ * Get the current clock period (nanoseconds)
+ */
+ if (ClockPeriod (CLOCK_REALTIME, 0, &period, 0) < 0)
+ return -1;
+
+ /*
+ * Compute count and nanoseconds increment
+ */
+ count = 1e9 * ADJUST_PERIOD / period.nsec;
+ increment = delta_nsec / count + .5;
+ /* Reduce relative error */
+ if (count > increment + 1)
+ {
+ increment = 1 + (long)((delta_nsec - 1) / count);
+ count = delta_nsec / increment + .5;
+ }
+
+ /*
+ * Limit the adjust increment to appropriate value
+ */
+ increment_limit = CORR_SLEW_LIMIT * period.nsec;
+ if (increment > increment_limit)
+ {
+ increment = increment_limit;
+ count = delta_nsec / increment + .5;
+ /* Reduce relative error */
+ if (increment > count + 1)
+ {
+ count = 1 + (long)((delta_nsec - 1) / increment);
+ increment = delta_nsec / count + .5;
+ }
+ }
+
+ adj.tick_nsec_inc = isneg ? -increment : increment;
+ adj.tick_count = count;
+ }
+ else
+ {
+ adj.tick_nsec_inc = 0;
+ adj.tick_count = 0;
+ }
+
+ if (ClockAdjust (CLOCK_REALTIME, &adj, &oldadj) < 0)
+ return -1;
+
+ /*
+ * Build olddelta
+ */
+ delta_nsec_old = (double)oldadj.tick_count * oldadj.tick_nsec_inc;
+ if (olddelta != NULL)
+ {
+ if (delta_nsec_old != 0)
+ {
+ /* Reduce rounding error */
+ delta_nsec_old += (delta_nsec_old < 0) ? -500 : 500;
+ olddelta->tv_sec = delta_nsec_old / 1e9;
+ olddelta->tv_usec = (long)(delta_nsec_old - 1e9
+ * (long)olddelta->tv_sec) / 1000;
+ }
+ else
+ {
+ olddelta->tv_sec = 0;
+ olddelta->tv_usec = 0;
+ }
+ }
+
+ return 0;
+}
+# else /* no special adjtime() needed */
+int adjtime_bs;
+# endif
+#endif
diff --git a/libntp/adjtimex.c b/libntp/adjtimex.c
new file mode 100644
index 0000000..03e9d79
--- /dev/null
+++ b/libntp/adjtimex.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+_sccsid:.asciz "11/19/91 ULTRIX @(#)adjtime.c 6.1"
+#endif not lint
+
+#include "SYS.h"
+
+SYSCALL(adjtimex)
+ ret
+
diff --git a/libntp/atoint.c b/libntp/atoint.c
new file mode 100644
index 0000000..1064b36
--- /dev/null
+++ b/libntp/atoint.c
@@ -0,0 +1,51 @@
+/*
+ * atoint - convert an ascii string to a signed long, with error checking
+ */
+#include <config.h>
+#include <sys/types.h>
+#include <ctype.h>
+
+#include "ntp_types.h"
+#include "ntp_stdlib.h"
+
+int
+atoint(
+ const char *str,
+ long *ival
+ )
+{
+ register long u;
+ register const char *cp;
+ register int isneg;
+ register int oflow_digit;
+
+ cp = str;
+
+ if (*cp == '-') {
+ cp++;
+ isneg = 1;
+ oflow_digit = '8';
+ } else {
+ isneg = 0;
+ oflow_digit = '7';
+ }
+
+ if (*cp == '\0')
+ return 0;
+
+ u = 0;
+ while (*cp != '\0') {
+ if (!isdigit((int)*cp))
+ return 0;
+ if (u > 214748364 || (u == 214748364 && *cp > oflow_digit))
+ return 0; /* overflow */
+ u = (u << 3) + (u << 1);
+ u += *cp++ - '0'; /* ascii dependent */
+ }
+
+ if (isneg)
+ *ival = -u;
+ else
+ *ival = u;
+ return 1;
+}
diff --git a/libntp/atolfp.c b/libntp/atolfp.c
new file mode 100644
index 0000000..4afeb23
--- /dev/null
+++ b/libntp/atolfp.c
@@ -0,0 +1,122 @@
+/*
+ * atolfp - convert an ascii string to an l_fp number
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntp_fp.h"
+#include "ntp_string.h"
+#include "ntp_assert.h"
+
+/*
+ * Powers of 10
+ */
+static u_long ten_to_the_n[10] = {
+ 0,
+ 10,
+ 100,
+ 1000,
+ 10000,
+ 100000,
+ 1000000,
+ 10000000,
+ 100000000,
+ 1000000000,
+};
+
+
+int
+atolfp(
+ const char *str,
+ l_fp *lfp
+ )
+{
+ register const char *cp;
+ register u_long dec_i;
+ register u_long dec_f;
+ char *ind;
+ int ndec;
+ int isneg;
+ static const char *digits = "0123456789";
+
+ NTP_REQUIRE(str != NULL);
+
+ isneg = 0;
+ dec_i = dec_f = 0;
+ ndec = 0;
+ cp = str;
+
+ /*
+ * We understand numbers of the form:
+ *
+ * [spaces][-|+][digits][.][digits][spaces|\n|\0]
+ */
+ while (isspace((int)*cp))
+ cp++;
+
+ if (*cp == '-') {
+ cp++;
+ isneg = 1;
+ }
+
+ if (*cp == '+')
+ cp++;
+
+ if (*cp != '.' && !isdigit((int)*cp))
+ return 0;
+
+ while (*cp != '\0' && (ind = strchr(digits, *cp)) != NULL) {
+ dec_i = (dec_i << 3) + (dec_i << 1); /* multiply by 10 */
+ dec_i += (ind - digits);
+ cp++;
+ }
+
+ if (*cp != '\0' && !isspace((int)*cp)) {
+ if (*cp++ != '.')
+ return 0;
+
+ while (ndec < 9 && *cp != '\0'
+ && (ind = strchr(digits, *cp)) != NULL) {
+ ndec++;
+ dec_f = (dec_f << 3) + (dec_f << 1); /* *10 */
+ dec_f += (ind - digits);
+ cp++;
+ }
+
+ while (isdigit((int)*cp))
+ cp++;
+
+ if (*cp != '\0' && !isspace((int)*cp))
+ return 0;
+ }
+
+ if (ndec > 0) {
+ register u_long tmp;
+ register u_long bit;
+ register u_long ten_fact;
+
+ ten_fact = ten_to_the_n[ndec];
+
+ tmp = 0;
+ bit = 0x80000000;
+ while (bit != 0) {
+ dec_f <<= 1;
+ if (dec_f >= ten_fact) {
+ tmp |= bit;
+ dec_f -= ten_fact;
+ }
+ bit >>= 1;
+ }
+ if ((dec_f << 1) > ten_fact)
+ tmp++;
+ dec_f = tmp;
+ }
+
+ if (isneg)
+ M_NEG(dec_i, dec_f);
+
+ lfp->l_ui = dec_i;
+ lfp->l_uf = dec_f;
+ return 1;
+}
diff --git a/libntp/atouint.c b/libntp/atouint.c
new file mode 100644
index 0000000..ab86130
--- /dev/null
+++ b/libntp/atouint.c
@@ -0,0 +1,42 @@
+#include <config.h>
+#include <sys/types.h>
+#include <ctype.h>
+
+#include "ntp_types.h"
+#include "ntp_stdlib.h"
+
+/*
+ * atouint() - convert an ascii string representing a whole base 10
+ * number to u_long *uval, returning TRUE if successful.
+ * Does not modify *uval and returns FALSE if str is not
+ * a positive base10 integer or is too large for a u_int32.
+ * this function uses u_long but should use u_int32, and
+ * probably be renamed.
+ */
+int
+atouint(
+ const char *str,
+ u_long *uval
+ )
+{
+ u_long u;
+ const char *cp;
+
+ cp = str;
+ if ('\0' == *cp)
+ return 0;
+
+ u = 0;
+ while ('\0' != *cp) {
+ if (!isdigit(*cp))
+ return 0;
+ if (u > 429496729 || (u == 429496729 && *cp >= '6'))
+ return 0; /* overflow */
+ /* hand-optimized u *= 10; */
+ u = (u << 3) + (u << 1);
+ u += *cp++ - '0'; /* not '\0' */
+ }
+
+ *uval = u;
+ return 1;
+}
diff --git a/libntp/audio.c b/libntp/audio.c
new file mode 100644
index 0000000..2a56619
--- /dev/null
+++ b/libntp/audio.c
@@ -0,0 +1,504 @@
+/*
+ * audio.c - audio interface for reference clock audio drivers
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(HAVE_SYS_AUDIOIO_H) || defined(HAVE_SUN_AUDIOIO_H) || \
+ defined(HAVE_SYS_SOUNDCARD_H) || defined(HAVE_MACHINE_SOUNDCARD_H)
+
+#include "audio.h"
+#include "ntp_stdlib.h"
+#include "ntp_syslog.h"
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+#include "ntp_string.h"
+
+#ifdef HAVE_SYS_AUDIOIO_H
+# include <sys/audioio.h>
+#endif /* HAVE_SYS_AUDIOIO_H */
+
+#ifdef HAVE_SUN_AUDIOIO_H
+# include <sys/ioccom.h>
+# include <sun/audioio.h>
+#endif /* HAVE_SUN_AUDIOIO_H */
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#include <fcntl.h>
+
+#ifdef HAVE_MACHINE_SOUNDCARD_H
+# include <machine/soundcard.h>
+# define PCM_STYLE_SOUND
+#else
+# ifdef HAVE_SYS_SOUNDCARD_H
+# include <sys/soundcard.h>
+# define PCM_STYLE_SOUND
+# endif
+#endif
+
+#ifdef PCM_STYLE_SOUND
+# include <ctype.h>
+#endif
+
+/*
+ * Global variables
+ */
+#ifdef HAVE_SYS_AUDIOIO_H
+static struct audio_device device; /* audio device ident */
+#endif /* HAVE_SYS_AUDIOIO_H */
+#ifdef PCM_STYLE_SOUND
+# define INIT_FILE "/etc/ntp.audio"
+int agc = SOUND_MIXER_WRITE_RECLEV; /* or IGAIN or LINE */
+int monitor = SOUND_MIXER_WRITE_VOLUME; /* or OGAIN */
+int devmask = 0;
+int recmask = 0;
+char cf_c_dev[100], cf_i_dev[100], cf_agc[100], cf_monitor[100];
+
+const char *m_names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
+#else /* not PCM_STYLE_SOUND */
+static struct audio_info info; /* audio device info */
+#endif /* not PCM_STYLE_SOUND */
+static int ctl_fd; /* audio control file descriptor */
+
+#ifdef PCM_STYLE_SOUND
+static void audio_config_read (int, char **, char **);
+static int mixer_name (const char *, int);
+
+
+int
+mixer_name(
+ const char *m_name,
+ int m_mask
+ )
+{
+ int i;
+
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; ++i)
+ if (((1 << i) & m_mask)
+ && !strcmp(m_names[i], m_name))
+ break;
+
+ return (SOUND_MIXER_NRDEVICES == i)
+ ? -1
+ : i
+ ;
+}
+
+
+/*
+ * Check:
+ *
+ * /etc/ntp.audio# where # is the unit number
+ * /etc/ntp.audio.# where # is the unit number
+ * /etc/ntp.audio
+ *
+ * for contents of the form:
+ *
+ * idev /dev/input_device
+ * cdev /dev/control_device
+ * agc pcm_input_device {igain,line,line1,...}
+ * monitor pcm_monitor_device {ogain,...}
+ *
+ * The device names for the "agc" and "monitor" keywords
+ * can be found by running either the "mixer" program or the
+ * util/audio-pcm program.
+ *
+ * Great hunks of this subroutine were swiped from refclock_oncore.c
+ */
+static void
+audio_config_read(
+ int unit,
+ char **c_dev, /* Control device */
+ char **i_dev /* input device */
+ )
+{
+ FILE *fd;
+ char device[20], line[100], ab[100];
+
+ snprintf(device, sizeof(device), "%s%d", INIT_FILE, unit);
+ if ((fd = fopen(device, "r")) == NULL) {
+ printf("audio_config_read: <%s> NO\n", device);
+ snprintf(device, sizeof(device), "%s.%d", INIT_FILE,
+ unit);
+ if ((fd = fopen(device, "r")) == NULL) {
+ printf("audio_config_read: <%s> NO\n", device);
+ snprintf(device, sizeof(device), "%s",
+ INIT_FILE);
+ if ((fd = fopen(device, "r")) == NULL) {
+ printf("audio_config_read: <%s> NO\n",
+ device);
+ return;
+ }
+ }
+ }
+ printf("audio_config_read: reading <%s>\n", device);
+ while (fgets(line, sizeof line, fd)) {
+ char *cp, *cc, *ca;
+ int i;
+
+ /* Remove comments */
+ if ((cp = strchr(line, '#')))
+ *cp = '\0';
+
+ /* Remove any trailing spaces */
+ for (i = strlen(line);
+ i > 0 && isascii((int)line[i - 1]) && isspace((int)line[i - 1]);
+ )
+ line[--i] = '\0';
+
+ /* Remove leading space */
+ for (cc = line; *cc && isascii((int)*cc) && isspace((int)*cc); cc++)
+ continue;
+
+ /* Stop if nothing left */
+ if (!*cc)
+ continue;
+
+ /* Uppercase the command and find the arg */
+ for (ca = cc; *ca; ca++) {
+ if (isascii((int)*ca)) {
+ if (islower((int)*ca)) {
+ *ca = toupper(*ca);
+ } else if (isspace((int)*ca) || (*ca == '='))
+ break;
+ }
+ }
+
+ /* Remove space (and possible =) leading the arg */
+ for (; *ca && isascii((int)*ca) && (isspace((int)*ca) || (*ca == '=')); ca++)
+ continue;
+
+ if (!strncmp(cc, "IDEV", 4) &&
+ 1 == sscanf(ca, "%99s", ab)) {
+ strlcpy(cf_i_dev, ab, sizeof(cf_i_dev));
+ printf("idev <%s>\n", ab);
+ } else if (!strncmp(cc, "CDEV", 4) &&
+ 1 == sscanf(ca, "%99s", ab)) {
+ strlcpy(cf_c_dev, ab, sizeof(cf_c_dev));
+ printf("cdev <%s>\n", ab);
+ } else if (!strncmp(cc, "AGC", 3) &&
+ 1 == sscanf(ca, "%99s", ab)) {
+ strlcpy(cf_agc, ab, sizeof(cf_agc));
+ printf("agc <%s> %d\n", ab, i);
+ } else if (!strncmp(cc, "MONITOR", 7) &&
+ 1 == sscanf(ca, "%99s", ab)) {
+ strlcpy(cf_monitor, ab, sizeof(cf_monitor));
+ printf("monitor <%s> %d\n", ab, mixer_name(ab, -1));
+ }
+ }
+ fclose(fd);
+ return;
+}
+#endif /* PCM_STYLE_SOUND */
+
+/*
+ * audio_init - open and initialize audio device
+ *
+ * This code works with SunOS 4.x, Solaris 2.x, and PCM; however, it is
+ * believed generic and applicable to other systems with a minor twid
+ * or two. All it does is open the device, set the buffer size (Solaris
+ * only), preset the gain and set the input port. It assumes that the
+ * codec sample rate (8000 Hz), precision (8 bits), number of channels
+ * (1) and encoding (ITU-T G.711 mu-law companded) have been set by
+ * default.
+ */
+int
+audio_init(
+ char *dname, /* device name */
+ int bufsiz, /* buffer size */
+ int unit /* device unit (0-3) */
+ )
+{
+#ifdef PCM_STYLE_SOUND
+# define ACTL_DEV "/dev/mixer%d"
+ char actl_dev[30];
+# ifdef HAVE_STRUCT_SND_SIZE
+ struct snd_size s_size;
+# endif
+# ifdef AIOGFMT
+ snd_chan_param s_c_p;
+# endif
+#endif
+ int fd;
+ int rval;
+ char *actl =
+#ifdef PCM_STYLE_SOUND
+ actl_dev
+#else
+ "/dev/audioctl"
+#endif
+ ;
+
+#ifdef PCM_STYLE_SOUND
+ snprintf(actl_dev, sizeof(actl_dev), ACTL_DEV, unit);
+
+ audio_config_read(unit, &actl, &dname);
+ /* If we have values for cf_c_dev or cf_i_dev, use them. */
+ if (*cf_c_dev)
+ actl = cf_c_dev;
+ if (*cf_i_dev)
+ dname = cf_i_dev;
+#endif
+
+ /*
+ * Open audio device
+ */
+ fd = open(dname, O_RDWR | O_NONBLOCK, 0777);
+ if (fd < 0) {
+ msyslog(LOG_ERR, "audio_init: %s %m", dname);
+ return (fd);
+ }
+
+ /*
+ * Open audio control device.
+ */
+ ctl_fd = open(actl, O_RDWR);
+ if (ctl_fd < 0) {
+ msyslog(LOG_ERR, "audio_init: invalid control device <%s>",
+ actl);
+ close(fd);
+ return(ctl_fd);
+ }
+
+ /*
+ * Set audio device parameters.
+ */
+#ifdef PCM_STYLE_SOUND
+ printf("audio_init: <%s> bufsiz %d\n", dname, bufsiz);
+ rval = fd;
+
+# ifdef HAVE_STRUCT_SND_SIZE
+ if (ioctl(fd, AIOGSIZE, &s_size) == -1)
+ printf("audio_init: AIOGSIZE: %s\n", strerror(errno));
+ else
+ printf("audio_init: orig: play_size %d, rec_size %d\n",
+ s_size.play_size, s_size.rec_size);
+
+ s_size.play_size = s_size.rec_size = bufsiz;
+ printf("audio_init: want: play_size %d, rec_size %d\n",
+ s_size.play_size, s_size.rec_size);
+
+ if (ioctl(fd, AIOSSIZE, &s_size) == -1)
+ printf("audio_init: AIOSSIZE: %s\n", strerror(errno));
+ else
+ printf("audio_init: set: play_size %d, rec_size %d\n",
+ s_size.play_size, s_size.rec_size);
+# endif /* HAVE_STRUCT_SND_SIZE */
+
+# ifdef SNDCTL_DSP_SETFRAGMENT
+ {
+ int tmp = (16 << 16) + 6; /* 16 fragments, each 2^6 bytes */
+ if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1)
+ printf("audio_init: SNDCTL_DSP_SETFRAGMENT: %s\n",
+ strerror(errno));
+ }
+# endif /* SNDCTL_DSP_SETFRAGMENT */
+
+# ifdef AIOGFMT
+ if (ioctl(fd, AIOGFMT, &s_c_p) == -1)
+ printf("audio_init: AIOGFMT: %s\n", strerror(errno));
+ else
+ printf("audio_init: play_rate %lu, rec_rate %lu, play_format %#lx, rec_format %#lx\n",
+ s_c_p.play_rate, s_c_p.rec_rate, s_c_p.play_format, s_c_p.rec_format);
+# endif
+
+ /* Grab the device and record masks */
+
+ if (ioctl(ctl_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1)
+ printf("SOUND_MIXER_READ_DEVMASK: %s\n", strerror(errno));
+ if (ioctl(ctl_fd, SOUND_MIXER_READ_RECMASK, &recmask) == -1)
+ printf("SOUND_MIXER_READ_RECMASK: %s\n", strerror(errno));
+
+ /* validate and set any specified config file stuff */
+ if (cf_agc[0] != '\0') {
+ int i;
+
+ /* recmask */
+ i = mixer_name(cf_agc, recmask);
+ if (i >= 0)
+ agc = MIXER_WRITE(i);
+ else
+ printf("input %s not in recmask %#x\n",
+ cf_agc, recmask);
+ }
+
+ if (cf_monitor[0] != '\0') {
+ int i;
+
+ /* devmask */
+ i = mixer_name(cf_monitor, devmask);
+ if (i >= 0)
+ monitor = MIXER_WRITE(i);
+ else
+ printf("monitor %s not in devmask %#x\n",
+ cf_monitor, devmask);
+ }
+
+#else /* not PCM_STYLE_SOUND */
+ AUDIO_INITINFO(&info);
+ info.play.gain = AUDIO_MAX_GAIN;
+ info.play.port = AUDIO_SPEAKER;
+# ifdef HAVE_SYS_AUDIOIO_H
+ info.record.buffer_size = bufsiz;
+# endif /* HAVE_SYS_AUDIOIO_H */
+ rval = ioctl(ctl_fd, (int)AUDIO_SETINFO, (char *)&info);
+ if (rval < 0) {
+ msyslog(LOG_ERR, "audio: invalid control device parameters");
+ close(ctl_fd);
+ close(fd);
+ return(rval);
+ }
+ rval = fd;
+#endif /* not PCM_STYLE_SOUND */
+ return (rval);
+}
+
+
+/*
+ * audio_gain - adjust codec gains and port
+ */
+int
+audio_gain(
+ int gain, /* volume level (gain) 0-255 */
+ int mongain, /* input to output mix (monitor gain) 0-255 */
+ int port /* selected I/O port: 1 mic/2 line in */
+ )
+{
+ int rval;
+ static int o_mongain = -1;
+ static int o_port = -1;
+
+#ifdef PCM_STYLE_SOUND
+ int l, r;
+
+ rval = 0;
+
+ r = l = 100 * gain / 255; /* Normalize to 0-100 */
+# ifdef DEBUG
+ if (debug > 1)
+ printf("audio_gain: gain %d/%d\n", gain, l);
+# endif
+#if 0 /* not a good idea to do this; connector wiring dependency */
+ /* figure out what channel(s) to use. just nuke right for now. */
+ r = 0 ; /* setting to zero nicely mutes the channel */
+#endif
+ l |= r << 8;
+ if (cf_agc[0] != '\0')
+ rval = ioctl(ctl_fd, agc, &l);
+ else
+ if (2 == port)
+ rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_LINE, &l);
+ else
+ rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_MIC, &l);
+ if (-1 == rval) {
+ printf("audio_gain: agc write: %s\n", strerror(errno));
+ return rval;
+ }
+
+ if (o_mongain != mongain) {
+ r = l = 100 * mongain / 255; /* Normalize to 0-100 */
+# ifdef DEBUG
+ if (debug > 1)
+ printf("audio_gain: mongain %d/%d\n", mongain, l);
+# endif
+ l |= r << 8;
+ if (cf_monitor[0] != '\0')
+ rval = ioctl(ctl_fd, monitor, &l );
+ else
+ rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_VOLUME,
+ &l);
+ if (-1 == rval) {
+ printf("audio_gain: mongain write: %s\n",
+ strerror(errno));
+ return (rval);
+ }
+ o_mongain = mongain;
+ }
+
+ if (o_port != port) {
+# ifdef DEBUG
+ if (debug > 1)
+ printf("audio_gain: port %d\n", port);
+# endif
+ l = (1 << ((port == 2) ? SOUND_MIXER_LINE : SOUND_MIXER_MIC));
+ rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_RECSRC, &l);
+ if (rval == -1) {
+ printf("SOUND_MIXER_WRITE_RECSRC: %s\n",
+ strerror(errno));
+ return (rval);
+ }
+# ifdef DEBUG
+ if (debug > 1) {
+ if (ioctl(ctl_fd, SOUND_MIXER_READ_RECSRC, &l) == -1)
+ printf("SOUND_MIXER_WRITE_RECSRC: %s\n",
+ strerror(errno));
+ else
+ printf("audio_gain: recsrc is %d\n", l);
+ }
+# endif
+ o_port = port;
+ }
+#else /* not PCM_STYLE_SOUND */
+ ioctl(ctl_fd, (int)AUDIO_GETINFO, (char *)&info);
+ info.record.encoding = AUDIO_ENCODING_ULAW;
+ info.record.error = 0;
+ info.record.gain = gain;
+ if (o_mongain != mongain)
+ o_mongain = info.monitor_gain = mongain;
+ if (o_port != port)
+ o_port = info.record.port = port;
+ rval = ioctl(ctl_fd, (int)AUDIO_SETINFO, (char *)&info);
+ if (rval < 0) {
+ msyslog(LOG_ERR, "audio_gain: %m");
+ return (rval);
+ }
+ rval = info.record.error;
+#endif /* not PCM_STYLE_SOUND */
+ return (rval);
+}
+
+
+/*
+ * audio_show - display audio parameters
+ *
+ * This code doesn't really do anything, except satisfy curiousity and
+ * verify the ioctl's work.
+ */
+void
+audio_show(void)
+{
+#ifdef PCM_STYLE_SOUND
+ int recsrc = 0;
+
+ printf("audio_show: ctl_fd %d\n", ctl_fd);
+ if (ioctl(ctl_fd, SOUND_MIXER_READ_RECSRC, &recsrc) == -1)
+ printf("SOUND_MIXER_READ_RECSRC: %s\n", strerror(errno));
+
+#else /* not PCM_STYLE_SOUND */
+# ifdef HAVE_SYS_AUDIOIO_H
+ ioctl(ctl_fd, (int)AUDIO_GETDEV, &device);
+ printf("audio: name %s, version %s, config %s\n",
+ device.name, device.version, device.config);
+# endif /* HAVE_SYS_AUDIOIO_H */
+ ioctl(ctl_fd, (int)AUDIO_GETINFO, (char *)&info);
+ printf(
+ "audio: rate %d, chan %d, prec %d, code %d, gain %d, mon %d, port %d\n",
+ info.record.sample_rate, info.record.channels,
+ info.record.precision, info.record.encoding,
+ info.record.gain, info.monitor_gain, info.record.port);
+ printf(
+ "audio: samples %d, eof %d, pause %d, error %d, waiting %d, balance %d\n",
+ info.record.samples, info.record.eof,
+ info.record.pause, info.record.error,
+ info.record.waiting, info.record.balance);
+#endif /* not PCM_STYLE_SOUND */
+}
+#else
+int audio_bs;
+#endif /* HAVE_{SYS_AUDIOIO,SUN_AUDIOIO,MACHINE_SOUNDCARD,SYS_SOUNDCARD}_H */
diff --git a/libntp/authkeys.c b/libntp/authkeys.c
new file mode 100644
index 0000000..7b4427c
--- /dev/null
+++ b/libntp/authkeys.c
@@ -0,0 +1,687 @@
+/*
+ * authkeys.c - routines to manage the storage of authentication keys
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <math.h>
+#include <stdio.h>
+
+#include "ntp.h"
+#include "ntp_fp.h"
+#include "ntpd.h"
+#include "ntp_lists.h"
+#include "ntp_string.h"
+#include "ntp_malloc.h"
+#include "ntp_stdlib.h"
+
+/*
+ * Structure to store keys in in the hash table.
+ */
+typedef struct savekey symkey;
+
+struct savekey {
+ symkey * hlink; /* next in hash bucket */
+ DECL_DLIST_LINK(symkey, llink); /* for overall & free lists */
+ u_char * secret; /* shared secret */
+ u_long lifetime; /* remaining lifetime */
+ keyid_t keyid; /* key identifier */
+ u_short type; /* OpenSSL digest NID */
+ u_short secretsize; /* secret octets */
+ u_short flags; /* KEY_ flags that wave */
+};
+
+/* define the payload region of symkey beyond the list pointers */
+#define symkey_payload secret
+
+#define KEY_TRUSTED 0x001 /* this key is trusted */
+
+#ifdef DEBUG
+typedef struct symkey_alloc_tag symkey_alloc;
+
+struct symkey_alloc_tag {
+ symkey_alloc * link;
+ void * mem; /* enable free() atexit */
+};
+
+symkey_alloc * authallocs;
+#endif /* DEBUG */
+
+static inline u_short auth_log2(double x);
+static void auth_resize_hashtable(void);
+static void allocsymkey(symkey **, keyid_t, u_short,
+ u_short, u_long, u_short, u_char *);
+static void freesymkey(symkey *, symkey **);
+#ifdef DEBUG
+static void free_auth_mem(void);
+#endif
+
+symkey key_listhead; /* list of all in-use keys */;
+/*
+ * The hash table. This is indexed by the low order bits of the
+ * keyid. We make this fairly big for potentially busy servers.
+ */
+#define DEF_AUTHHASHSIZE 64
+//#define HASHMASK ((HASHSIZE)-1)
+#define KEYHASH(keyid) ((keyid) & authhashmask)
+
+int authhashdisabled;
+u_short authhashbuckets = DEF_AUTHHASHSIZE;
+u_short authhashmask = DEF_AUTHHASHSIZE - 1;
+symkey **key_hash;
+
+u_long authkeynotfound; /* keys not found */
+u_long authkeylookups; /* calls to lookup keys */
+u_long authnumkeys; /* number of active keys */
+u_long authkeyexpired; /* key lifetime expirations */
+u_long authkeyuncached; /* cache misses */
+u_long authnokey; /* calls to encrypt with no key */
+u_long authencryptions; /* calls to encrypt */
+u_long authdecryptions; /* calls to decrypt */
+
+/*
+ * Storage for free symkey structures. We malloc() such things but
+ * never free them.
+ */
+symkey *authfreekeys;
+int authnumfreekeys;
+
+#define MEMINC 16 /* number of new free ones to get */
+
+/*
+ * The key cache. We cache the last key we looked at here.
+ */
+keyid_t cache_keyid; /* key identifier */
+u_char *cache_secret; /* secret */
+u_short cache_secretsize; /* secret length */
+int cache_type; /* OpenSSL digest NID */
+u_short cache_flags; /* flags that wave */
+
+
+/*
+ * init_auth - initialize internal data
+ */
+void
+init_auth(void)
+{
+ size_t newalloc;
+
+ /*
+ * Initialize hash table and free list
+ */
+ newalloc = authhashbuckets * sizeof(key_hash[0]);
+
+ key_hash = erealloc(key_hash, newalloc);
+ memset(key_hash, '\0', newalloc);
+
+ INIT_DLIST(key_listhead, llink);
+
+#ifdef DEBUG
+ atexit(&free_auth_mem);
+#endif
+}
+
+
+/*
+ * free_auth_mem - assist in leak detection by freeing all dynamic
+ * allocations from this module.
+ */
+#ifdef DEBUG
+static void
+free_auth_mem(void)
+{
+ symkey * sk;
+ symkey_alloc * alloc;
+ symkey_alloc * next_alloc;
+
+ while (NULL != (sk = HEAD_DLIST(key_listhead, llink))) {
+ freesymkey(sk, &key_hash[KEYHASH(sk->keyid)]);
+ }
+ free(key_hash);
+ key_hash = NULL;
+ cache_keyid = 0;
+ cache_flags = 0;
+ for (alloc = authallocs; alloc != NULL; alloc = next_alloc) {
+ next_alloc = alloc->link;
+ free(alloc->mem);
+ }
+ authfreekeys = NULL;
+ authnumfreekeys = 0;
+}
+#endif /* DEBUG */
+
+
+/*
+ * auth_moremem - get some more free key structures
+ */
+void
+auth_moremem(
+ int keycount
+ )
+{
+ symkey * sk;
+ int i;
+#ifdef DEBUG
+ void * base;
+ symkey_alloc * allocrec;
+# define MOREMEM_EXTRA_ALLOC (sizeof(*allocrec))
+#else
+# define MOREMEM_EXTRA_ALLOC (0)
+#endif
+
+ i = (keycount > 0)
+ ? keycount
+ : MEMINC;
+ sk = emalloc_zero(i * sizeof(*sk) + MOREMEM_EXTRA_ALLOC);
+#ifdef DEBUG
+ base = sk;
+#endif
+ authnumfreekeys += i;
+
+ for (; i > 0; i--, sk++) {
+ LINK_SLIST(authfreekeys, sk, llink.f);
+ }
+
+#ifdef DEBUG
+ allocrec = (void *)sk;
+ allocrec->mem = base;
+ LINK_SLIST(authallocs, allocrec, link);
+#endif
+}
+
+
+/*
+ * auth_prealloc_symkeys
+ */
+void
+auth_prealloc_symkeys(
+ int keycount
+ )
+{
+ int allocated;
+ int additional;
+
+ allocated = authnumkeys + authnumfreekeys;
+ additional = keycount - allocated;
+ if (additional > 0)
+ auth_moremem(additional);
+ auth_resize_hashtable();
+}
+
+
+static inline u_short
+auth_log2(double x)
+{
+ return (u_short)(log10(x) / log10(2));
+}
+
+
+/*
+ * auth_resize_hashtable
+ *
+ * Size hash table to average 4 or fewer entries per bucket initially,
+ * within the bounds of at least 4 and no more than 15 bits for the hash
+ * table index. Populate the hash table.
+ */
+static void
+auth_resize_hashtable(void)
+{
+ u_long totalkeys;
+ u_short hashbits;
+ u_short hash;
+ size_t newalloc;
+ symkey * sk;
+
+ totalkeys = authnumkeys + authnumfreekeys;
+ hashbits = auth_log2(totalkeys / 4.0) + 1;
+ hashbits = max(4, hashbits);
+ hashbits = min(15, hashbits);
+
+ authhashbuckets = 1 << hashbits;
+ authhashmask = authhashbuckets - 1;
+ newalloc = authhashbuckets * sizeof(key_hash[0]);
+
+ key_hash = erealloc(key_hash, newalloc);
+ memset(key_hash, '\0', newalloc);
+
+ ITER_DLIST_BEGIN(key_listhead, sk, llink, symkey)
+ hash = KEYHASH(sk->keyid);
+ LINK_SLIST(key_hash[hash], sk, hlink);
+ ITER_DLIST_END()
+}
+
+
+/*
+ * allocsymkey - common code to allocate and link in symkey
+ *
+ * secret must be allocated with a free-compatible allocator. It is
+ * owned by the referring symkey structure, and will be free()d by
+ * freesymkey().
+ */
+static void
+allocsymkey(
+ symkey ** bucket,
+ keyid_t id,
+ u_short flags,
+ u_short type,
+ u_long lifetime,
+ u_short secretsize,
+ u_char * secret
+ )
+{
+ symkey * sk;
+
+ if (authnumfreekeys < 1)
+ auth_moremem(-1);
+ UNLINK_HEAD_SLIST(sk, authfreekeys, llink.f);
+ DEBUG_ENSURE(sk != NULL);
+ sk->keyid = id;
+ sk->flags = flags;
+ sk->type = type;
+ sk->secretsize = secretsize;
+ sk->secret = secret;
+ sk->lifetime = lifetime;
+ LINK_SLIST(*bucket, sk, hlink);
+ LINK_TAIL_DLIST(key_listhead, sk, llink);
+ authnumfreekeys--;
+ authnumkeys++;
+}
+
+
+/*
+ * freesymkey - common code to remove a symkey and recycle its entry.
+ */
+static void
+freesymkey(
+ symkey * sk,
+ symkey ** bucket
+ )
+{
+ symkey * unlinked;
+
+ if (sk->secret != NULL) {
+ memset(sk->secret, '\0', sk->secretsize);
+ free(sk->secret);
+ }
+ UNLINK_SLIST(unlinked, *bucket, sk, hlink, symkey);
+ DEBUG_ENSURE(sk == unlinked);
+ UNLINK_DLIST(sk, llink);
+ memset((char *)sk + offsetof(symkey, symkey_payload), '\0',
+ sizeof(*sk) - offsetof(symkey, symkey_payload));
+ LINK_SLIST(authfreekeys, sk, llink.f);
+ authnumkeys--;
+ authnumfreekeys++;
+}
+
+
+/*
+ * auth_findkey - find a key in the hash table
+ */
+struct savekey *
+auth_findkey(
+ keyid_t id
+ )
+{
+ symkey * sk;
+
+ for (sk = key_hash[KEYHASH(id)]; sk != NULL; sk = sk->hlink) {
+ if (id == sk->keyid) {
+ return sk;
+ }
+ }
+
+ return NULL;
+}
+
+
+/*
+ * auth_havekey - return TRUE if the key id is zero or known
+ */
+int
+auth_havekey(
+ keyid_t id
+ )
+{
+ symkey * sk;
+
+ if (0 == id || cache_keyid == id) {
+ return TRUE;
+ }
+
+ for (sk = key_hash[KEYHASH(id)]; sk != NULL; sk = sk->hlink) {
+ if (id == sk->keyid) {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * authhavekey - return TRUE and cache the key, if zero or both known
+ * and trusted.
+ */
+int
+authhavekey(
+ keyid_t id
+ )
+{
+ symkey * sk;
+
+ authkeylookups++;
+ if (0 == id || cache_keyid == id) {
+ return TRUE;
+ }
+
+ /*
+ * Seach the bin for the key. If found and the key type
+ * is zero, somebody marked it trusted without specifying
+ * a key or key type. In this case consider the key missing.
+ */
+ authkeyuncached++;
+ for (sk = key_hash[KEYHASH(id)]; sk != NULL; sk = sk->hlink) {
+ if (id == sk->keyid) {
+ if (0 == sk->type) {
+ authkeynotfound++;
+ return FALSE;
+ }
+ break;
+ }
+ }
+
+ /*
+ * If the key is not found, or if it is found but not trusted,
+ * the key is not considered found.
+ */
+ if (NULL == sk) {
+ authkeynotfound++;
+ return FALSE;
+ }
+ if (!(KEY_TRUSTED & sk->flags)) {
+ authnokey++;
+ return FALSE;
+ }
+
+ /*
+ * The key is found and trusted. Initialize the key cache.
+ */
+ cache_keyid = sk->keyid;
+ cache_type = sk->type;
+ cache_flags = sk->flags;
+ cache_secret = sk->secret;
+ cache_secretsize = sk->secretsize;
+
+ return TRUE;
+}
+
+
+/*
+ * authtrust - declare a key to be trusted/untrusted
+ */
+void
+authtrust(
+ keyid_t id,
+ u_long trust
+ )
+{
+ symkey ** bucket;
+ symkey * sk;
+ u_long lifetime;
+
+ /*
+ * Search bin for key; if it does not exist and is untrusted,
+ * forget it.
+ */
+ bucket = &key_hash[KEYHASH(id)];
+ for (sk = *bucket; sk != NULL; sk = sk->hlink) {
+ if (id == sk->keyid)
+ break;
+ }
+ if (!trust && NULL == sk)
+ return;
+
+ /*
+ * There are two conditions remaining. Either it does not
+ * exist and is to be trusted or it does exist and is or is
+ * not to be trusted.
+ */
+ if (sk != NULL) {
+ if (cache_keyid == id) {
+ cache_flags = 0;
+ cache_keyid = 0;
+ }
+
+ /*
+ * Key exists. If it is to be trusted, say so and
+ * update its lifetime.
+ */
+ if (trust > 0) {
+ sk->flags |= KEY_TRUSTED;
+ if (trust > 1)
+ sk->lifetime = current_time + trust;
+ else
+ sk->lifetime = 0;
+ return;
+ }
+
+ /* No longer trusted, return it to the free list. */
+ freesymkey(sk, bucket);
+ return;
+ }
+
+ /*
+ * keyid is not present, but the is to be trusted. We allocate
+ * a new key, but do not specify a key type or secret.
+ */
+ if (trust > 1) {
+ lifetime = current_time + trust;
+ } else {
+ lifetime = 0;
+ }
+ allocsymkey(bucket, id, KEY_TRUSTED, 0, lifetime, 0, NULL);
+}
+
+
+/*
+ * authistrusted - determine whether a key is trusted
+ */
+int
+authistrusted(
+ keyid_t keyno
+ )
+{
+ symkey * sk;
+ symkey ** bucket;
+
+ if (keyno == cache_keyid)
+ return !!(KEY_TRUSTED & cache_flags);
+
+ authkeyuncached++;
+ bucket = &key_hash[KEYHASH(keyno)];
+ for (sk = *bucket; sk != NULL; sk = sk->hlink) {
+ if (keyno == sk->keyid)
+ break;
+ }
+ if (NULL == sk || !(KEY_TRUSTED & sk->flags)) {
+ authkeynotfound++;
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+void
+MD5auth_setkey(
+ keyid_t keyno,
+ int keytype,
+ const u_char *key,
+ int len
+ )
+{
+ symkey * sk;
+ symkey ** bucket;
+ u_char * secret;
+ size_t secretsize;
+
+ DEBUG_ENSURE(keytype <= USHRT_MAX);
+ DEBUG_ENSURE(len < 4 * 1024);
+ len = max(0, len);
+ /*
+ * See if we already have the key. If so just stick in the
+ * new value.
+ */
+ bucket = &key_hash[KEYHASH(keyno)];
+ for (sk = *bucket; sk != NULL; sk = sk->hlink) {
+ if (keyno == sk->keyid) {
+ sk->type = (u_short)keytype;
+ secretsize = len;
+ sk->secretsize = (u_short)secretsize;
+#ifndef DISABLE_BUG1243_FIX
+ memcpy(sk->secret, key, secretsize);
+#else
+ strlcpy((char *)sk->secret, (const char *)key,
+ secretsize);
+#endif
+ if (cache_keyid == keyno) {
+ cache_flags = 0;
+ cache_keyid = 0;
+ }
+ return;
+ }
+ }
+
+ /*
+ * Need to allocate new structure. Do it.
+ */
+ secretsize = len;
+ secret = emalloc(secretsize);
+#ifndef DISABLE_BUG1243_FIX
+ memcpy(secret, key, secretsize);
+#else
+ strlcpy((char *)secret, (const char *)key, secretsize);
+#endif
+ allocsymkey(bucket, keyno, 0, (u_short)keytype, 0,
+ (u_short)secretsize, secret);
+#ifdef DEBUG
+ if (debug >= 4) {
+ size_t j;
+
+ printf("auth_setkey: key %d type %d len %d ", (int)keyno,
+ keytype, (int)secretsize);
+ for (j = 0; j < secretsize; j++)
+ printf("%02x", secret[j]);
+ printf("\n");
+ }
+#endif
+}
+
+
+/*
+ * auth_delkeys - delete non-autokey untrusted keys, and clear all info
+ * except the trusted bit of non-autokey trusted keys, in
+ * preparation for rereading the keys file.
+ */
+void
+auth_delkeys(void)
+{
+ symkey * sk;
+
+ ITER_DLIST_BEGIN(key_listhead, sk, llink, symkey)
+ if (sk->keyid > NTP_MAXKEY) { /* autokey */
+ continue;
+ }
+
+ /*
+ * Don't lose info as to which keys are trusted.
+ */
+ if (KEY_TRUSTED & sk->flags) {
+ if (sk->secret != NULL) {
+ memset(sk->secret, '\0', sk->secretsize);
+ free(sk->secret);
+ }
+ sk->secretsize = 0;
+ sk->lifetime = 0;
+ } else {
+ freesymkey(sk, &key_hash[KEYHASH(sk->keyid)]);
+ }
+ ITER_DLIST_END()
+}
+
+
+/*
+ * auth_agekeys - delete keys whose lifetimes have expired
+ */
+void
+auth_agekeys(void)
+{
+ symkey * sk;
+
+ ITER_DLIST_BEGIN(key_listhead, sk, llink, symkey)
+ if (sk->lifetime > 0 && current_time > sk->lifetime) {
+ freesymkey(sk, &key_hash[KEYHASH(sk->keyid)]);
+ authkeyexpired++;
+ }
+ ITER_DLIST_END()
+ DPRINTF(1, ("auth_agekeys: at %lu keys %lu expired %lu\n",
+ current_time, authnumkeys, authkeyexpired));
+}
+
+
+/*
+ * authencrypt - generate message authenticator
+ *
+ * Returns length of authenticator field, zero if key not found.
+ */
+int
+authencrypt(
+ keyid_t keyno,
+ u_int32 * pkt,
+ int length
+ )
+{\
+ /*
+ * A zero key identifier means the sender has not verified
+ * the last message was correctly authenticated. The MAC
+ * consists of a single word with value zero.
+ */
+ authencryptions++;
+ pkt[length / 4] = htonl(keyno);
+ if (0 == keyno) {
+ return 4;
+ }
+ if (!authhavekey(keyno)) {
+ return 0;
+ }
+
+ return MD5authencrypt(cache_type, cache_secret, pkt, length);
+}
+
+
+/*
+ * authdecrypt - verify message authenticator
+ *
+ * Returns TRUE if authenticator valid, FALSE if invalid or not found.
+ */
+int
+authdecrypt(
+ keyid_t keyno,
+ u_int32 * pkt,
+ int length,
+ int size
+ )
+{
+ /*
+ * A zero key identifier means the sender has not verified
+ * the last message was correctly authenticated. For our
+ * purpose this is an invalid authenticator.
+ */
+ authdecryptions++;
+ if (0 == keyno || !authhavekey(keyno) || size < 4) {
+ return FALSE;
+ }
+
+ return MD5authdecrypt(cache_type, cache_secret, pkt, length,
+ size);
+}
diff --git a/libntp/authreadkeys.c b/libntp/authreadkeys.c
new file mode 100644
index 0000000..9b02119
--- /dev/null
+++ b/libntp/authreadkeys.c
@@ -0,0 +1,207 @@
+/*
+ * authreadkeys.c - routines to support the reading of the key file
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+
+#ifdef OPENSSL
+#include "openssl/objects.h"
+#include "openssl/evp.h"
+#endif /* OPENSSL */
+
+/* Forwards */
+static char *nexttok (char **);
+
+/*
+ * nexttok - basic internal tokenizing routine
+ */
+static char *
+nexttok(
+ char **str
+ )
+{
+ register char *cp;
+ char *starttok;
+
+ cp = *str;
+
+ /*
+ * Space past white space
+ */
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+
+ /*
+ * Save this and space to end of token
+ */
+ starttok = cp;
+ while (*cp != '\0' && *cp != '\n' && *cp != ' '
+ && *cp != '\t' && *cp != '#')
+ cp++;
+
+ /*
+ * If token length is zero return an error, else set end of
+ * token to zero and return start.
+ */
+ if (starttok == cp)
+ return NULL;
+
+ if (*cp == ' ' || *cp == '\t')
+ *cp++ = '\0';
+ else
+ *cp = '\0';
+
+ *str = cp;
+ return starttok;
+}
+
+
+/*
+ * authreadkeys - (re)read keys from a file.
+ */
+int
+authreadkeys(
+ const char *file
+ )
+{
+ FILE *fp;
+ char *line;
+ char *token;
+ keyid_t keyno;
+ int keytype;
+ char buf[512]; /* lots of room for line */
+ u_char keystr[32]; /* Bug 2537 */
+ int len;
+ int j;
+
+ /*
+ * Open file. Complain and return if it can't be opened.
+ */
+ fp = fopen(file, "r");
+ if (fp == NULL) {
+ msyslog(LOG_ERR, "authreadkeys: file %s: %m",
+ file);
+ return (0);
+ }
+ INIT_SSL();
+
+ /*
+ * Remove all existing keys
+ */
+ auth_delkeys();
+
+ /*
+ * Now read lines from the file, looking for key entries
+ */
+ while ((line = fgets(buf, sizeof buf, fp)) != NULL) {
+ token = nexttok(&line);
+ if (token == NULL)
+ continue;
+
+ /*
+ * First is key number. See if it is okay.
+ */
+ keyno = atoi(token);
+ if (keyno == 0) {
+ msyslog(LOG_ERR,
+ "authreadkeys: cannot change key %s", token);
+ continue;
+ }
+
+ if (keyno > NTP_MAXKEY) {
+ msyslog(LOG_ERR,
+ "authreadkeys: key %s > %d reserved for Autokey",
+ token, NTP_MAXKEY);
+ continue;
+ }
+
+ /*
+ * Next is keytype. See if that is all right.
+ */
+ token = nexttok(&line);
+ if (token == NULL) {
+ msyslog(LOG_ERR,
+ "authreadkeys: no key type for key %d", keyno);
+ continue;
+ }
+#ifdef OPENSSL
+ /*
+ * The key type is the NID used by the message digest
+ * algorithm. There are a number of inconsistencies in
+ * the OpenSSL database. We attempt to discover them
+ * here and prevent use of inconsistent data later.
+ */
+ keytype = keytype_from_text(token, NULL);
+ if (keytype == 0) {
+ msyslog(LOG_ERR,
+ "authreadkeys: invalid type for key %d", keyno);
+ continue;
+ }
+ if (EVP_get_digestbynid(keytype) == NULL) {
+ msyslog(LOG_ERR,
+ "authreadkeys: no algorithm for key %d", keyno);
+ continue;
+ }
+#else /* !OPENSSL follows */
+
+ /*
+ * The key type is unused, but is required to be 'M' or
+ * 'm' for compatibility.
+ */
+ if (!(*token == 'M' || *token == 'm')) {
+ msyslog(LOG_ERR,
+ "authreadkeys: invalid type for key %d", keyno);
+ continue;
+ }
+ keytype = KEY_TYPE_MD5;
+#endif /* !OPENSSL */
+
+ /*
+ * Finally, get key and insert it. If it is longer than 20
+ * characters, it is a binary string encoded in hex;
+ * otherwise, it is a text string of printable ASCII
+ * characters.
+ */
+ token = nexttok(&line);
+ if (token == NULL) {
+ msyslog(LOG_ERR,
+ "authreadkeys: no key for key %d", keyno);
+ continue;
+ }
+ len = strlen(token);
+ if (len <= 20) { /* Bug 2537 */
+ MD5auth_setkey(keyno, keytype, (u_char *)token, len);
+ } else {
+ char hex[] = "0123456789abcdef";
+ u_char temp;
+ char *ptr;
+ int jlim;
+
+ jlim = min(len, 2 * sizeof(keystr));
+ for (j = 0; j < jlim; j++) {
+ ptr = strchr(hex, tolower(token[j]));
+ if (ptr == NULL)
+ break; /* abort decoding */
+ temp = (u_char)(ptr - hex);
+ if (j & 1)
+ keystr[j / 2] |= temp;
+ else
+ keystr[j / 2] = temp << 4;
+ }
+ if (j < jlim) {
+ msyslog(LOG_ERR,
+ "authreadkeys: invalid hex digit for key %d", keyno);
+ continue;
+ }
+ MD5auth_setkey(keyno, keytype, keystr, jlim / 2);
+ }
+ }
+ fclose(fp);
+ return (1);
+}
diff --git a/libntp/authusekey.c b/libntp/authusekey.c
new file mode 100644
index 0000000..c1d0813
--- /dev/null
+++ b/libntp/authusekey.c
@@ -0,0 +1,34 @@
+/*
+ * authusekey - decode a key from ascii and use it
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntp_types.h"
+#include "ntp_string.h"
+#include "ntp_stdlib.h"
+
+/*
+ * Types of ascii representations for keys. "Standard" means a 64 bit
+ * hex number in NBS format, i.e. with the low order bit of each byte
+ * a parity bit. "NTP" means a 64 bit key in NTP format, with the
+ * high order bit of each byte a parity bit. "Ascii" means a 1-to-8
+ * character string whose ascii representation is used as the key.
+ */
+int
+authusekey(
+ keyid_t keyno,
+ int keytype,
+ const u_char *str
+ )
+{
+ int len;
+
+ len = strlen((const char *)str);
+ if (0 == len)
+ return 0;
+
+ MD5auth_setkey(keyno, keytype, str, len);
+ return 1;
+}
diff --git a/libntp/bsd_strerror.c b/libntp/bsd_strerror.c
new file mode 100644
index 0000000..5ace9aa
--- /dev/null
+++ b/libntp/bsd_strerror.c
@@ -0,0 +1,49 @@
+#include <config.h>
+
+#if !HAVE_STRERROR
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)strerror.c 5.1 (Berkeley) 4/9/89";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "l_stdlib.h"
+
+char *
+strerror(
+ int errnum
+ )
+{
+ extern int sys_nerr;
+ extern char *sys_errlist[];
+ static char ebuf[20];
+
+ if ((unsigned int)errnum < sys_nerr)
+ return sys_errlist[errnum];
+ snprintf(ebuf, sizeof(ebuf), "Unknown error: %d", errnum);
+
+ return ebuf;
+}
+#else
+int strerror_bs;
+#endif
diff --git a/libntp/buftvtots.c b/libntp/buftvtots.c
new file mode 100644
index 0000000..a77e9f7
--- /dev/null
+++ b/libntp/buftvtots.c
@@ -0,0 +1,38 @@
+/*
+ * buftvtots - pull a Unix-format (struct timeval) time stamp out of
+ * an octet stream and convert it to a l_fp time stamp.
+ * This is useful when using the clock line discipline.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "ntp_fp.h"
+#include "ntp_string.h"
+#include "timevalops.h"
+
+#ifndef SYS_WINNT
+int
+buftvtots(
+ const char *bufp,
+ l_fp *ts
+ )
+{
+ struct timeval tv;
+
+ /*
+ * copy to adhere to alignment restrictions
+ */
+ memcpy(&tv, bufp, sizeof(tv));
+
+ /*
+ * and use it
+ */
+ if (tv.tv_usec > MICROSECONDS - 1)
+ return FALSE;
+
+ *ts = tval_stamp_to_lfp(tv);
+
+ return TRUE;
+}
+#endif /* !SYS_WINNT */
diff --git a/libntp/caljulian.c b/libntp/caljulian.c
new file mode 100644
index 0000000..6463699
--- /dev/null
+++ b/libntp/caljulian.c
@@ -0,0 +1,41 @@
+/*
+ * caljulian - determine the Julian date from an NTP time.
+ *
+ * (Note: since we use the GREGORIAN calendar, this should be renamed to
+ * 'calgregorian' eventually...)
+ */
+#include <config.h>
+#include <sys/types.h>
+
+#include "ntp_types.h"
+#include "ntp_calendar.h"
+
+#if !(defined(ISC_CHECK_ALL) || defined(ISC_CHECK_NONE) || \
+ defined(ISC_CHECK_ENSURE) || defined(ISC_CHECK_INSIST) || \
+ defined(ISC_CHECK_INVARIANT))
+# define ISC_CHECK_ALL
+#endif
+
+#include "ntp_assert.h"
+
+void
+caljulian(
+ uint32_t ntp,
+ struct calendar * jt
+ )
+{
+ vint64 vlong;
+ ntpcal_split split;
+
+
+ NTP_INSIST(NULL != jt);
+
+ /*
+ * Unfold ntp time around current time into NTP domain. Split
+ * into days and seconds, shift days into CE domain and
+ * process the parts.
+ */
+ vlong = ntpcal_ntp_to_ntp(ntp, NULL);
+ split = ntpcal_daysplit(&vlong);
+ ntpcal_daysplit_to_date(jt, &split, DAY_NTP_STARTS);
+}
diff --git a/libntp/caltontp.c b/libntp/caltontp.c
new file mode 100644
index 0000000..4246a6a
--- /dev/null
+++ b/libntp/caltontp.c
@@ -0,0 +1,68 @@
+/*
+ * caltontp - convert a date to an NTP time
+ */
+#include <config.h>
+#include <sys/types.h>
+
+#include "ntp_types.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+#include "ntp_unixtime.h"
+
+/*
+ * Juergen Perlinger, 2008-11-12
+ * Add support for full calendar calculatios. If the day-of-year is provided
+ * (that is, not zero) it will be used instead of month and day-of-month;
+ * otherwise a full turn through the calendar calculations will be taken.
+ *
+ * I know that Harlan Stenn likes to see assertions in production code, and I
+ * agree there, but it would be a tricky thing here. The algorithm is quite
+ * capable of producing sensible answers even to seemingly weird inputs: the
+ * date <any year here>-03-00, the 0.th March of the year, will be automtically
+ * treated as the last day of February, no matter whether the year is a leap
+ * year or not. So adding constraints is merely for the benefit of the callers,
+ * because the only thing we can check for consistency is our input, produced
+ * by somebody else.
+ *
+ * BTW: A total roundtrip using 'caljulian' would be a quite shaky thing:
+ * Because of the truncation of the NTP time stamp to 32 bits and the epoch
+ * unfolding around the current time done by 'caljulian' the roundtrip does
+ * *not* necessarily reproduce the input, especially if the time spec is more
+ * than 68 years off from the current time...
+ */
+
+uint32_t
+caltontp(
+ const struct calendar *jt
+ )
+{
+ int32_t eraday; /* CE Rata Die number */
+ vint64 ntptime;/* resulting NTP time */
+
+ NTP_INSIST(jt != NULL);
+
+ NTP_REQUIRE(jt->month <= 13); /* permit month 0..13! */
+ NTP_REQUIRE(jt->monthday <= 32);
+ NTP_REQUIRE(jt->yearday <= 366);
+ NTP_REQUIRE(jt->hour <= 24);
+ NTP_REQUIRE(jt->minute <= MINSPERHR);
+ NTP_REQUIRE(jt->second <= SECSPERMIN);
+
+ /*
+ * First convert the date to he corresponding RataDie
+ * number. If yearday is not zero, assume that it contains a
+ * useable value and avoid all calculations involving month
+ * and day-of-month. Do a full evaluation otherwise.
+ */
+ if (jt->yearday)
+ eraday = ntpcal_year_to_ystart(jt->year)
+ + jt->yearday - 1;
+ else
+ eraday = ntpcal_date_to_rd(jt);
+
+ ntptime = ntpcal_dayjoin(eraday - DAY_NTP_STARTS,
+ ntpcal_etime_to_seconds(jt->hour, jt->minute,
+ jt->second));
+ return ntptime.d_s.lo;
+}
diff --git a/libntp/calyearstart.c b/libntp/calyearstart.c
new file mode 100644
index 0000000..9e3f58f
--- /dev/null
+++ b/libntp/calyearstart.c
@@ -0,0 +1,88 @@
+/*
+ * calyearstart - determine the NTP time at midnight of January 1 in
+ * the year of the given date.
+ */
+#include <config.h>
+#include <sys/types.h>
+
+#include "ntp_types.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+
+/*
+ * Juergen Perlinger, 2010-05-02
+ *
+ * Redone in terms of the calendar functions. It's rather simple:
+ * - expand the NTP time stamp
+ * - split into days and seconds since midnight, dropping the partial day
+ * - get full number of days before year start in NTP epoch
+ * - convert to seconds, truncated to 32 bits.
+ */
+u_int32
+calyearstart(u_int32 ntptime, const time_t *pivot)
+{
+ u_int32 ndays; /* elapsed days since NTP starts */
+ vint64 vlong;
+ ntpcal_split split;
+
+ vlong = ntpcal_ntp_to_ntp(ntptime, pivot);
+ split = ntpcal_daysplit(&vlong);
+ ndays = ntpcal_rd_to_ystart(split.hi + DAY_NTP_STARTS)
+ - DAY_NTP_STARTS;
+
+ return (u_int32)(ndays * SECSPERDAY);
+}
+
+/*
+ * calmonthstart - get NTP time at midnight of the first day of the
+ * current month.
+ */
+u_int32
+calmonthstart(u_int32 ntptime, const time_t *pivot)
+{
+ u_int32 ndays; /* elapsed days since NTP starts */
+ vint64 vlong;
+ ntpcal_split split;
+
+ vlong = ntpcal_ntp_to_ntp(ntptime, pivot);
+ split = ntpcal_daysplit(&vlong);
+ ndays = ntpcal_rd_to_mstart(split.hi + DAY_NTP_STARTS)
+ - DAY_NTP_STARTS;
+
+ return (u_int32)(ndays * SECSPERDAY);
+}
+
+/*
+ * calweekstart - get NTP time at midnight of the last monday on or
+ * before the current date.
+ */
+u_int32
+calweekstart(u_int32 ntptime, const time_t *pivot)
+{
+ u_int32 ndays; /* elapsed days since NTP starts */
+ vint64 vlong;
+ ntpcal_split split;
+
+ vlong = ntpcal_ntp_to_ntp(ntptime, pivot);
+ split = ntpcal_daysplit(&vlong);
+ ndays = ntpcal_weekday_le(split.hi + DAY_NTP_STARTS, CAL_MONDAY)
+ - DAY_NTP_STARTS;
+
+ return (u_int32)(ndays * SECSPERDAY);
+}
+
+/*
+ * caldaystart - get NTP time at midnight of the current day.
+ */
+u_int32
+caldaystart(u_int32 ntptime, const time_t *pivot)
+{
+ vint64 vlong;
+ ntpcal_split split;
+
+ vlong = ntpcal_ntp_to_ntp(ntptime, pivot);
+ split = ntpcal_daysplit(&vlong);
+
+ return ntptime - split.lo;
+}
diff --git a/libntp/clocktime.c b/libntp/clocktime.c
new file mode 100644
index 0000000..c1a3ba0
--- /dev/null
+++ b/libntp/clocktime.c
@@ -0,0 +1,149 @@
+/*
+ * clocktime - compute the NTP date from a day of year, hour, minute
+ * and second.
+ */
+#include <config.h>
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+
+/*
+ * We check that the time be within CLOSETIME seconds of the receive
+ * time stamp. This is about 4 hours, which hopefully should be wide
+ * enough to collect most data, while close enough to keep things from
+ * getting confused.
+ */
+#define CLOSETIME (4u*60u*60u)
+
+/*
+ * Since we try to match years, the result of a full search will not
+ * change when we are already less than a half year from the receive
+ * time stamp. Since the length of a year is variable we use a
+ * slightly narrower limit; this might require a full evaluation near
+ * the edge, but will make sure we always get the correct result.
+ */
+#define NEARTIME (182u * SECSPERDAY)
+
+/*
+ * local calendar helpers
+ */
+static int32 ntp_to_year(u_int32);
+static u_int32 year_to_ntp(int32);
+
+/*
+ * Take a time spec given as day-of-year, hour, minute and second as
+ * well as a GMT offset in hours and convert it to a NTP time stamp in
+ * '*ts_ui'. The value will be in the range (rec_ui-0.5yrs) to
+ * (rec_ui+0.5yrs). A hint for the current start-of-year will be
+ * read from '*yearstart'.
+ *
+ * On return '*ts_ui' will always the best matching solution, and
+ * '*yearstart' will receive the associated start-of-year.
+ *
+ * The function will tell if the result in 'ts_ui' is in CLOSETIME
+ * (+/-4hrs) around the receive time by returning a non-zero value.
+ *
+ * Note: The function puts no constraints on the value ranges for the
+ * time specification, but evaluates the effective seconds in
+ * 32-bit arithmetic.
+ */
+int
+clocktime(
+ int yday , /* day-of-year */
+ int hour , /* hour of day */
+ int minute , /* minute of hour */
+ int second , /* second of minute */
+ int tzoff , /* hours west of GMT */
+ u_int32 rec_ui , /* pivot value */
+ u_long *yearstart, /* cached start-of-year, should be fixed to u_int32 */
+ u_int32 *ts_ui ) /* effective time stamp */
+{
+ u_int32 ystt[3]; /* year start */
+ u_int32 test[3]; /* result time stamp */
+ u_int32 diff[3]; /* abs difference to receive */
+ int32 y, tmp, idx, min;
+
+ /*
+ * Compute the offset into the year in seconds. Note that
+ * this could come out to be a negative number.
+ */
+ tmp = ((int32)second +
+ SECSPERMIN * ((int32)minute +
+ MINSPERHR * ((int32)hour + (int32)tzoff +
+ HRSPERDAY * ((int32)yday - 1))));
+ /*
+ * Based on the cached year start, do a first attempt. Be
+ * happy and return if this gets us better than NEARTIME to
+ * the receive time stamp. Do this only if the cached year
+ * start is not zero, which will not happen after 1900 for the
+ * next few thousand years.
+ */
+ if (*yearstart) {
+ /* -- get time stamp of potential solution */
+ test[0] = (u_int32)(*yearstart) + tmp;
+ /* -- calc absolute difference to receive time */
+ diff[0] = test[0] - rec_ui;
+ if (diff[0] >= 0x80000000u)
+ diff[0] = ~diff[0] + 1;
+ /* -- can't get closer if diff < NEARTIME */
+ if (diff[0] < NEARTIME) {
+ *ts_ui = test[0];
+ return diff[0] < CLOSETIME;
+ }
+ }
+
+ /*
+ * Now the dance begins. Based on the receive time stamp and
+ * the seconds offset in 'tmp', we make an educated guess
+ * about the year to start with. This takes us on the spot
+ * with a fuzz of +/-1 year.
+ *
+ * We calculate the effective timestamps for the three years
+ * around the guess and select the entry with the minimum
+ * absolute difference to the receive time stamp.
+ */
+ y = ntp_to_year(rec_ui - tmp);
+ for (idx = 0; idx < 3; idx++) {
+ /* -- get year start of potential solution */
+ ystt[idx] = year_to_ntp(y + idx - 1);
+ /* -- get time stamp of potential solution */
+ test[idx] = ystt[idx] + tmp;
+ /* -- calc absolute difference to receive time */
+ diff[idx] = test[idx] - rec_ui;
+ if (diff[idx] >= 0x80000000u)
+ diff[idx] = ~diff[idx] + 1;
+ }
+ /* -*- assume current year fits best, then search best fit */
+ for (min = 1, idx = 0; idx < 3; idx++)
+ if (diff[idx] < diff[min])
+ min = idx;
+ /* -*- store results and update year start */
+ *ts_ui = test[min];
+ *yearstart = ystt[min];
+
+ /* -*- tell if we could get into CLOSETIME*/
+ return diff[min] < CLOSETIME;
+}
+
+static int32
+ntp_to_year(
+ u_int32 ntp)
+{
+ vint64 t;
+ ntpcal_split s;
+
+ t = ntpcal_ntp_to_ntp(ntp, NULL);
+ s = ntpcal_daysplit(&t);
+ s = ntpcal_split_eradays(s.hi + DAY_NTP_STARTS - 1, NULL);
+ return s.hi + 1;
+}
+
+static u_int32
+year_to_ntp(
+ int32 year)
+{
+ u_int32 days;
+ days = ntpcal_days_in_years(year-1) - DAY_NTP_STARTS + 1;
+ return days * SECSPERDAY;
+}
diff --git a/libntp/clocktypes.c b/libntp/clocktypes.c
new file mode 100644
index 0000000..de7f6b4
--- /dev/null
+++ b/libntp/clocktypes.c
@@ -0,0 +1,123 @@
+/*
+ * Data for pretty printing clock types
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "lib_strbuf.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+struct clktype clktypes[] = {
+ { REFCLK_NONE, "unspecified type (0)",
+ "UNKNOWN" },
+ { REFCLK_LOCALCLOCK, "Undisciplined local clock (1)",
+ "LOCAL" },
+ { REFCLK_GPS_TRAK, "TRAK 8810 GPS Receiver (2)",
+ "GPS_TRAK" },
+ { REFCLK_WWV_PST, "PSTI/Traconex WWV/WWVH Receiver (3)",
+ "WWV_PST" },
+ { REFCLK_SPECTRACOM, "Spectracom (generic) Receivers (4)",
+ "SPECTRACOM" },
+ { REFCLK_TRUETIME, "TrueTime (generic) Receivers (5)",
+ "TRUETIME" },
+ { REFCLK_IRIG_AUDIO, "IRIG Audio Decoder (6)",
+ "IRIG_AUDIO" },
+ { REFCLK_CHU_AUDIO, "CHU Audio Demodulator/Decoder (7)",
+ "CHU_AUDIO" },
+ { REFCLK_PARSE, "Generic reference clock driver (8)",
+ "GENERIC" },
+ { REFCLK_GPS_MX4200, "Magnavox MX4200 GPS Receiver (9)",
+ "GPS_MX4200" },
+ { REFCLK_GPS_AS2201, "Austron 2201A GPS Receiver (10)",
+ "GPS_AS2201" },
+ { REFCLK_GPS_ARBITER, "Arbiter 1088A/B GPS Receiver (11)",
+ "GPS_ARBITER" },
+ { REFCLK_IRIG_TPRO, "KSI/Odetics TPRO/S IRIG Interface (12)",
+ "IRIG_TPRO" },
+ { REFCLK_ATOM_LEITCH, "Leitch CSD 5300 Master Clock Controller (13)",
+ "ATOM_LEITCH" },
+ { REFCLK_MSF_EES, "EES M201 MSF Receiver (14)",
+ "MSF_EES" },
+ { REFCLK_NONE, "not used (15)",
+ "NOT_USED" },
+ { REFCLK_IRIG_BANCOMM, "Bancomm GPS/IRIG Receiver (16)",
+ "GPS_BANC" },
+ { REFCLK_GPS_DATUM, "Datum Precision Time System (17)",
+ "GPS_DATUM" },
+ { REFCLK_ACTS, "Automated Computer Time Service (18)",
+ "ACTS_MODEM" },
+ { REFCLK_WWV_HEATH, "Heath WWV/WWVH Receiver (19)",
+ "WWV_HEATH" },
+ { REFCLK_GPS_NMEA, "Generic NMEA GPS Receiver (20)",
+ "GPS_NMEA" },
+ { REFCLK_GPS_VME, "TrueTime GPS-VME Interface (21)",
+ "GPS_VME" },
+ { REFCLK_ATOM_PPS, "PPS Clock Discipline (22)",
+ "PPS" },
+ { REFCLK_NONE, "not used (23)",
+ "NOT_USED" },
+ { REFCLK_NONE, "not used (24)",
+ "NOT_USED" },
+ { REFCLK_NONE, "not used (25)",
+ "NOT_USED" },
+ { REFCLK_GPS_HP, "HP 58503A GPS Time & Frequency Receiver (26)",
+ "GPS_HP" },
+ { REFCLK_ARCRON_MSF, "ARCRON MSF (and DCF77) Receiver (27)",
+ "MSF_ARCRON" },
+ { REFCLK_SHM, "Clock attached thru shared Memory (28)",
+ "SHM" },
+ { REFCLK_PALISADE, "Trimble Navigation Palisade GPS (29)",
+ "GPS_PALISADE" },
+ { REFCLK_ONCORE, "Motorola UT Oncore GPS (30)",
+ "GPS_ONCORE" },
+ { REFCLK_GPS_JUPITER, "Rockwell Jupiter GPS (31)",
+ "GPS_JUPITER" },
+ { REFCLK_CHRONOLOG, "Chrono-log K (32)",
+ "CHRONOLOG" },
+ { REFCLK_DUMBCLOCK, "Dumb generic hh:mm:ss local clock (33)",
+ "DUMBCLOCK" },
+ { REFCLK_ULINK, "Ultralink M320 WWVB receiver (34)",
+ "ULINK_M320"},
+ { REFCLK_PCF, "Conrad parallel port radio clock (35)",
+ "PCF"},
+ { REFCLK_WWV_AUDIO, "WWV/H Audio Demodulator/Decoder (36)",
+ "WWV_AUDIO"},
+ { REFCLK_FG, "Forum Graphic GPS Dating Station (37)",
+ "GPS_FG"},
+ { REFCLK_HOPF_SERIAL, "hopf Elektronic serial line receiver (38)",
+ "HOPF_S"},
+ { REFCLK_HOPF_PCI, "hopf Elektronic PCI receiver (39)",
+ "HOPF_P"},
+ { REFCLK_JJY, "JJY receiver (40)",
+ "JJY"},
+ { REFCLK_TT560, "TrueTime 560 IRIG-B decoder (41)",
+ "TT_IRIG"},
+ { REFCLK_ZYFER, "Zyfer GPStarplus receiver (42)",
+ "GPS_ZYFER" },
+ { REFCLK_RIPENCC, "RIPE NCC Trimble driver (43)",
+ "GPS_RIPENCC" },
+ { REFCLK_NEOCLOCK4X, "NeoClock4X DCF77 / TDF receiver (44)",
+ "NEOCLK4X"},
+ { REFCLK_TSYNCPCI, "Spectracom TSYNC PCI timing board (45)",
+ "PCI_TSYNC"},
+ { REFCLK_GPSDJSON, "GPSD JSON socket (46)",
+ "GPSD_JSON"},
+ { -1, "", "" }
+};
+
+const char *
+clockname(
+ int num
+ )
+{
+ register struct clktype *clk;
+
+ for (clk = clktypes; clk->code != -1; clk++) {
+ if (num == clk->code)
+ return (clk->abbrev);
+ }
+ return (NULL);
+}
diff --git a/libntp/decodenetnum.c b/libntp/decodenetnum.c
new file mode 100644
index 0000000..187d5ca
--- /dev/null
+++ b/libntp/decodenetnum.c
@@ -0,0 +1,83 @@
+/*
+ * decodenetnum - return a net number (this is crude, but careful)
+ */
+#include <config.h>
+#include <sys/types.h>
+#include <ctype.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+
+/*
+ * decodenetnum convert text IP address and port to sockaddr_u
+ *
+ * Returns 0 for failure, 1 for success.
+ */
+int
+decodenetnum(
+ const char *num,
+ sockaddr_u *netnum
+ )
+{
+ struct addrinfo hints, *ai = NULL;
+ int err;
+ u_short port;
+ const char *cp;
+ const char *port_str;
+ char *pp;
+ char *np;
+ char name[80];
+
+ NTP_REQUIRE(num != NULL);
+ NTP_REQUIRE(strlen(num) < sizeof(name));
+
+ port_str = NULL;
+ if ('[' != num[0]) {
+ /*
+ * to distinguish IPv6 embedded colons from a port
+ * specification on an IPv4 address, assume all
+ * legal IPv6 addresses have at least two colons.
+ */
+ pp = strchr(num, ':');
+ if (NULL == pp)
+ cp = num; /* no colons */
+ else if (NULL != strchr(pp + 1, ':'))
+ cp = num; /* two or more colons */
+ else { /* one colon */
+ strlcpy(name, num, sizeof(name));
+ cp = name;
+ pp = strchr(cp, ':');
+ *pp = '\0';
+ port_str = pp + 1;
+ }
+ } else {
+ cp = num + 1;
+ np = name;
+ while (*cp && ']' != *cp)
+ *np++ = *cp++;
+ *np = 0;
+ if (']' == cp[0] && ':' == cp[1] && '\0' != cp[2])
+ port_str = &cp[2];
+ cp = name;
+ }
+ ZERO(hints);
+ hints.ai_flags = Z_AI_NUMERICHOST;
+ err = getaddrinfo(cp, "ntp", &hints, &ai);
+ if (err != 0)
+ return 0;
+ NTP_INSIST(ai->ai_addrlen <= sizeof(*netnum));
+ ZERO(*netnum);
+ memcpy(netnum, ai->ai_addr, ai->ai_addrlen);
+ freeaddrinfo(ai);
+ if (NULL == port_str || 1 != sscanf(port_str, "%hu", &port))
+ port = NTP_PORT;
+ SET_PORT(netnum, port);
+ return 1;
+}
diff --git a/libntp/dofptoa.c b/libntp/dofptoa.c
new file mode 100644
index 0000000..758af2f
--- /dev/null
+++ b/libntp/dofptoa.c
@@ -0,0 +1,159 @@
+/*
+ * dofptoa - do the grunge work to convert an fp number to ascii
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "lib_strbuf.h"
+#include "ntp_string.h"
+#include "ntp_stdlib.h"
+
+char *
+dofptoa(
+ u_fp fpv,
+ int neg,
+ short ndec,
+ int msec
+ )
+{
+ register u_char *cp, *cpend;
+ register u_long val;
+ register short dec;
+ u_char cbuf[12];
+ u_char *cpdec;
+ char *buf;
+ char *bp;
+
+ /*
+ * Get a string buffer before starting
+ */
+ LIB_GETBUF(buf);
+
+ /*
+ * Zero out the buffer
+ */
+ ZERO(cbuf);
+
+ /*
+ * Set the pointers to point at the first
+ * decimal place. Get a local copy of the value.
+ */
+ cp = cpend = &cbuf[5];
+ val = fpv;
+
+ /*
+ * If we have to, decode the integral part
+ */
+ if (!(val & 0xffff0000))
+ cp--;
+ else {
+ register u_short sv = (u_short)(val >> 16);
+ register u_short tmp;
+ register u_short ten = 10;
+
+ do {
+ tmp = sv;
+ sv = (u_short) (sv/ten);
+ *(--cp) = (u_char)(tmp - ((sv<<3) + (sv<<1)));
+ } while (sv != 0);
+ }
+
+ /*
+ * Figure out how much of the fraction to do
+ */
+ if (msec) {
+ dec = (short)(ndec + 3);
+ if (dec < 3)
+ dec = 3;
+ cpdec = &cbuf[8];
+ } else {
+ dec = ndec;
+ cpdec = cpend;
+ }
+
+ if (dec > 6)
+ dec = 6;
+
+ if (dec > 0) {
+ do {
+ val &= 0xffff;
+ val = (val << 3) + (val << 1);
+ *cpend++ = (u_char)(val >> 16);
+ } while (--dec > 0);
+ }
+
+ if (val & 0x8000) {
+ register u_char *tp;
+ /*
+ * Round it. Ick.
+ */
+ tp = cpend;
+ *(--tp) += 1;
+ while (*tp >= 10) {
+ *tp = 0;
+ *(--tp) += 1;
+ }
+ }
+
+ /*
+ * Remove leading zeroes if necessary
+ */
+ while (cp < (cpdec -1) && *cp == 0)
+ cp++;
+
+ /*
+ * Copy it into the buffer, asciizing as we go.
+ */
+ bp = buf;
+ if (neg)
+ *bp++ = '-';
+
+ while (cp < cpend) {
+ if (cp == cpdec)
+ *bp++ = '.';
+ *bp++ = (char)(*cp++ + '0');
+ }
+ *bp = '\0';
+ return buf;
+}
+
+
+char *
+fptoa(
+ s_fp fpv,
+ short ndec
+ )
+{
+ u_fp plusfp;
+ int neg;
+
+ neg = (fpv < 0);
+ if (neg) {
+ plusfp = (u_fp)(-fpv);
+ } else {
+ plusfp = (u_fp)fpv;
+ }
+
+ return dofptoa(plusfp, neg, ndec, FALSE);
+}
+
+
+char *
+fptoms(
+ s_fp fpv,
+ short ndec
+ )
+{
+ u_fp plusfp;
+ int neg;
+
+ neg = (fpv < 0);
+ if (neg) {
+ plusfp = (u_fp)(-fpv);
+ } else {
+ plusfp = (u_fp)fpv;
+ }
+
+ return dofptoa(plusfp, neg, ndec, TRUE);
+}
diff --git a/libntp/dolfptoa.c b/libntp/dolfptoa.c
new file mode 100644
index 0000000..07ead95
--- /dev/null
+++ b/libntp/dolfptoa.c
@@ -0,0 +1,174 @@
+/*
+ * dolfptoa - do the grunge work of converting an l_fp number to decimal
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "lib_strbuf.h"
+#include "ntp_string.h"
+#include "ntp_stdlib.h"
+
+char *
+dolfptoa(
+ u_int32 fpi,
+ u_int32 fpv,
+ int neg,
+ short ndec,
+ int msec
+ )
+{
+ u_char *cp, *cpend, *cpdec;
+ int dec;
+ u_char cbuf[24];
+ char *buf, *bp;
+
+ /*
+ * Get a string buffer before starting
+ */
+ LIB_GETBUF(buf);
+
+ /*
+ * Zero the character buffer
+ */
+ ZERO(cbuf);
+
+ /*
+ * Work on the integral part. This should work reasonable on
+ * all machines with 32 bit arithmetic. Please note that 32 bits
+ * can *always* be represented with at most 10 decimal digits,
+ * including a possible rounding from the fractional part.
+ */
+ cp = cpend = cpdec = &cbuf[10];
+ for (dec = cp - cbuf; dec > 0 && fpi != 0; dec--) {
+ /* can add another digit */
+ u_int32 digit;
+
+ digit = fpi;
+ fpi /= 10U;
+ digit -= (fpi << 3) + (fpi << 1); /* i*10 */
+ *--cp = (u_char)digit;
+ }
+
+ /*
+ * Done that, now deal with the problem of the fraction. First
+ * determine the number of decimal places.
+ */
+ dec = ndec;
+ if (dec < 0)
+ dec = 0;
+ if (msec) {
+ dec += 3;
+ cpdec += 3;
+ }
+ if ((size_t)dec > sizeof(cbuf) - (cpend - cbuf))
+ dec = sizeof(cbuf) - (cpend - cbuf);
+
+ /*
+ * If there's a fraction to deal with, do so.
+ */
+ for (/*NOP*/; dec > 0 && fpv != 0; dec--) {
+ u_int32 digit, tmph, tmpl;
+
+ /*
+ * The scheme here is to multiply the fraction
+ * (0.1234...) by ten. This moves a junk of BCD into
+ * the units part. record that and iterate.
+ * multiply by shift/add in two dwords.
+ */
+ digit = 0;
+ M_LSHIFT(digit, fpv);
+ tmph = digit;
+ tmpl = fpv;
+ M_LSHIFT(digit, fpv);
+ M_LSHIFT(digit, fpv);
+ M_ADD(digit, fpv, tmph, tmpl);
+ *cpend++ = (u_char)digit;
+ }
+
+ /* decide whether to round or simply extend by zeros */
+ if (dec > 0) {
+ /* only '0' digits left -- just reposition end */
+ cpend += dec;
+ } else {
+ /* some bits remain in 'fpv'; do round */
+ u_char *tp = cpend;
+ int carry = ((fpv & 0x80000000) != 0);
+
+ for (dec = tp - cbuf; carry && dec > 0; dec--) {
+ *--tp += 1;
+ if (*tp == 10)
+ *tp = 0;
+ else
+ carry = FALSE;
+ }
+
+ if (tp < cp) /* rounding from 999 to 1000 or similiar? */
+ cp = tp;
+ }
+
+ /*
+ * We've now got the fraction in cbuf[], with cp pointing at
+ * the first character, cpend pointing past the last, and
+ * cpdec pointing at the first character past the decimal.
+ * Remove leading zeros, then format the number into the
+ * buffer.
+ */
+ while (cp < cpdec && *cp == 0)
+ cp++;
+ if (cp >= cpdec)
+ cp = cpdec - 1;
+
+ bp = buf;
+ if (neg)
+ *bp++ = '-';
+ while (cp < cpend) {
+ if (cp == cpdec)
+ *bp++ = '.';
+ *bp++ = (char)(*cp++) + '0';
+ }
+ *bp = '\0';
+
+ /*
+ * Done!
+ */
+ return buf;
+}
+
+
+char *
+mfptoa(
+ u_int32 fpi,
+ u_int32 fpf,
+ short ndec
+ )
+{
+ int isneg;
+
+ isneg = M_ISNEG(fpi);
+ if (isneg) {
+ M_NEG(fpi, fpf);
+ }
+
+ return dolfptoa(fpi, fpf, isneg, ndec, FALSE);
+}
+
+
+char *
+mfptoms(
+ u_int32 fpi,
+ u_int32 fpf,
+ short ndec
+ )
+{
+ int isneg;
+
+ isneg = M_ISNEG(fpi);
+ if (isneg) {
+ M_NEG(fpi, fpf);
+ }
+
+ return dolfptoa(fpi, fpf, isneg, ndec, TRUE);
+}
+
+
diff --git a/libntp/emalloc.c b/libntp/emalloc.c
new file mode 100644
index 0000000..c49c5c1
--- /dev/null
+++ b/libntp/emalloc.c
@@ -0,0 +1,96 @@
+/*
+ * emalloc - return new memory obtained from the system. Belch if none.
+ */
+#include <config.h>
+#include "ntp_types.h"
+#include "ntp_malloc.h"
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+
+
+/*
+ * When using the debug MS CRT allocator, each allocation stores the
+ * callsite __FILE__ and __LINE__, which is then displayed at process
+ * termination, to track down leaks. We don't want all of our
+ * allocations to show up as coming from emalloc.c, so we preserve the
+ * original callsite's source file and line using macros which pass
+ * __FILE__ and __LINE__ as parameters to these routines.
+ * Other debug malloc implementations can be used by defining
+ * EREALLOC_IMPL() as ports/winnt/include/config.h does.
+ */
+
+void *
+ereallocz(
+ void * ptr,
+ size_t newsz,
+ size_t priorsz,
+ int zero_init
+#ifdef EREALLOC_CALLSITE /* ntp_malloc.h */
+ ,
+ const char * file,
+ int line
+#endif
+ )
+{
+ char * mem;
+ size_t allocsz;
+
+ if (0 == newsz)
+ allocsz = 1;
+ else
+ allocsz = newsz;
+
+ mem = EREALLOC_IMPL(ptr, allocsz, file, line);
+ if (NULL == mem) {
+ msyslog_term = TRUE;
+#ifndef EREALLOC_CALLSITE
+ msyslog(LOG_ERR, "fatal out of memory (%lu bytes)",
+ (u_long)newsz);
+#else
+ msyslog(LOG_ERR,
+ "fatal out of memory %s line %d (%lu bytes)",
+ file, line, (u_long)newsz);
+#endif
+ exit(1);
+ }
+
+ if (zero_init && newsz > priorsz)
+ zero_mem(mem + priorsz, newsz - priorsz);
+
+ return mem;
+}
+
+
+char *
+estrdup_impl(
+ const char * str
+#ifdef EREALLOC_CALLSITE
+ ,
+ const char * file,
+ int line
+#endif
+ )
+{
+ char * copy;
+ size_t bytes;
+
+ bytes = strlen(str) + 1;
+ copy = ereallocz(NULL, bytes, 0, FALSE
+#ifdef EREALLOC_CALLSITE
+ , file, line
+#endif
+ );
+ memcpy(copy, str, bytes);
+
+ return copy;
+}
+
+
+#ifndef EREALLOC_CALLSITE
+void *
+emalloc(size_t newsz)
+{
+ return ereallocz(NULL, newsz, 0, FALSE);
+}
+#endif
+
diff --git a/libntp/findconfig.c b/libntp/findconfig.c
new file mode 100644
index 0000000..1785ff7
--- /dev/null
+++ b/libntp/findconfig.c
@@ -0,0 +1,74 @@
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef NEED_HPUX_FINDCONFIG
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+
+const char *
+FindConfig(
+ const char *base
+ )
+{
+ static char result[BUFSIZ];
+ char hostname[BUFSIZ], *cp;
+ struct stat sbuf;
+ struct utsname unamebuf;
+
+ /* All keyed by initial target being a directory */
+ strlcpy(result, base, sizeof(result));
+ if (stat(result, &sbuf) == 0) {
+ if (S_ISDIR(sbuf.st_mode)) {
+
+ /* First choice is my hostname */
+ if (gethostname(hostname, BUFSIZ) >= 0) {
+ snprintf(result, sizeof(result), "%s/%s", base, hostname);
+ if (stat(result, &sbuf) == 0) {
+ goto outahere;
+ } else {
+
+ /* Second choice is of form default.835 */
+ (void) uname(&unamebuf);
+ if (strncmp(unamebuf.machine, "9000/", 5) == 0)
+ cp = unamebuf.machine + 5;
+ else
+ cp = unamebuf.machine;
+ snprintf(result, sizeof(result), "%s/default.%s", base, cp);
+ if (stat(result, &sbuf) == 0) {
+ goto outahere;
+ } else {
+
+ /* Last choice is just default */
+ snprintf(result, sizeof(result), "%s/default", base);
+ if (stat(result, &sbuf) == 0) {
+ goto outahere;
+ } else {
+ strlcpy(result,
+ "/not/found",
+ sizeof(result));
+ }
+ }
+ }
+ }
+ }
+ }
+ outahere:
+ return(result);
+}
+#else
+#include "ntp_stdlib.h"
+
+const char *
+FindConfig(
+ const char *base
+ )
+{
+ return base;
+}
+#endif
diff --git a/libntp/getopt.c b/libntp/getopt.c
new file mode 100644
index 0000000..63c82fa
--- /dev/null
+++ b/libntp/getopt.c
@@ -0,0 +1,108 @@
+/*
+ * getopt - get option letter from argv
+ *
+ * This is a version of the public domain getopt() implementation by
+ * Henry Spencer, changed for 4.3BSD compatibility (in addition to System V).
+ * It allows rescanning of an option list by setting optind to 0 before
+ * calling, which is why we use it even if the system has its own (in fact,
+ * this one has a unique name so as not to conflict with the system's).
+ * Thanks to Dennis Ferguson for the appropriate modifications.
+ *
+ * This file is in the Public Domain.
+ */
+
+/*LINTLIBRARY*/
+
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_stdlib.h"
+
+#ifdef lint
+#undef putc
+#define putc fputc
+#endif /* lint */
+
+char *ntp_optarg; /* Global argument pointer. */
+int ntp_optind = 0; /* Global argv index. */
+int ntp_opterr = 1; /* for compatibility, should error be printed? */
+int ntp_optopt; /* for compatibility, option character checked */
+
+static char *scan = NULL; /* Private scan pointer. */
+static const char *prog = "amnesia";
+
+/*
+ * Print message about a bad option.
+ */
+static int
+badopt(
+ const char *mess,
+ int ch
+ )
+{
+ if (ntp_opterr) {
+ fputs(prog, stderr);
+ fputs(mess, stderr);
+ (void) putc(ch, stderr);
+ (void) putc('\n', stderr);
+ }
+ return ('?');
+}
+
+int
+ntp_getopt(
+ int argc,
+ char *argv[],
+ const char *optstring
+ )
+{
+ register char c;
+ register const char *place;
+
+ prog = argv[0];
+ ntp_optarg = NULL;
+
+ if (ntp_optind == 0) {
+ scan = NULL;
+ ntp_optind++;
+ }
+
+ if (scan == NULL || *scan == '\0') {
+ if (ntp_optind >= argc
+ || argv[ntp_optind][0] != '-'
+ || argv[ntp_optind][1] == '\0') {
+ return (EOF);
+ }
+ if (argv[ntp_optind][1] == '-'
+ && argv[ntp_optind][2] == '\0') {
+ ntp_optind++;
+ return (EOF);
+ }
+
+ scan = argv[ntp_optind++]+1;
+ }
+
+ c = *scan++;
+ ntp_optopt = c & 0377;
+ for (place = optstring; place != NULL && *place != '\0'; ++place)
+ if (*place == c)
+ break;
+
+ if (place == NULL || *place == '\0' || c == ':' || c == '?') {
+ return (badopt(": unknown option -", c));
+ }
+
+ place++;
+ if (*place == ':') {
+ if (*scan != '\0') {
+ ntp_optarg = scan;
+ scan = NULL;
+ } else if (ntp_optind >= argc) {
+ return (badopt(": option requires argument -", c));
+ } else {
+ ntp_optarg = argv[ntp_optind++];
+ }
+ }
+
+ return (c & 0377);
+}
diff --git a/libntp/hextoint.c b/libntp/hextoint.c
new file mode 100644
index 0000000..d24b5a0
--- /dev/null
+++ b/libntp/hextoint.c
@@ -0,0 +1,42 @@
+/*
+ * hextoint - convert an ascii string in hex to an unsigned
+ * long, with error checking
+ */
+#include <config.h>
+#include <ctype.h>
+
+#include "ntp_stdlib.h"
+
+int
+hextoint(
+ const char *str,
+ u_long *pu
+ )
+{
+ register u_long u;
+ register const char *cp;
+
+ cp = str;
+
+ if (*cp == '\0')
+ return 0;
+
+ u = 0;
+ while (*cp != '\0') {
+ if (!isxdigit(*cp))
+ return 0;
+ if (u & 0xF0000000)
+ return 0; /* overflow */
+ u <<= 4;
+ if ('0' <= *cp && *cp <= '9')
+ u += *cp++ - '0';
+ else if ('a' <= *cp && *cp <= 'f')
+ u += *cp++ - 'a' + 10;
+ else if ('A' <= *cp && *cp <= 'F')
+ u += *cp++ - 'A' + 10;
+ else
+ return 0;
+ }
+ *pu = u;
+ return 1;
+}
diff --git a/libntp/hextolfp.c b/libntp/hextolfp.c
new file mode 100644
index 0000000..8fbce2e
--- /dev/null
+++ b/libntp/hextolfp.c
@@ -0,0 +1,68 @@
+/*
+ * hextolfp - convert an ascii hex string to an l_fp number
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntp_fp.h"
+#include "ntp_string.h"
+#include "ntp_stdlib.h"
+
+int
+hextolfp(
+ const char *str,
+ l_fp *lfp
+ )
+{
+ register const char *cp;
+ register const char *cpstart;
+ register u_long dec_i;
+ register u_long dec_f;
+ char *ind = NULL;
+ static const char *digits = "0123456789abcdefABCDEF";
+
+ dec_i = dec_f = 0;
+ cp = str;
+
+ /*
+ * We understand numbers of the form:
+ *
+ * [spaces]8_hex_digits[.]8_hex_digits[spaces|\n|\0]
+ */
+ while (isspace((int)*cp))
+ cp++;
+
+ cpstart = cp;
+ while (*cp != '\0' && (cp - cpstart) < 8 &&
+ (ind = strchr(digits, *cp)) != NULL) {
+ dec_i = dec_i << 4; /* multiply by 16 */
+ dec_i += ((ind - digits) > 15) ? (ind - digits) - 6
+ : (ind - digits);
+ cp++;
+ }
+
+ if ((cp - cpstart) < 8 || ind == NULL)
+ return 0;
+ if (*cp == '.')
+ cp++;
+
+ cpstart = cp;
+ while (*cp != '\0' && (cp - cpstart) < 8 &&
+ (ind = strchr(digits, *cp)) != NULL) {
+ dec_f = dec_f << 4; /* multiply by 16 */
+ dec_f += ((ind - digits) > 15) ? (ind - digits) - 6
+ : (ind - digits);
+ cp++;
+ }
+
+ if ((cp - cpstart) < 8 || ind == NULL)
+ return 0;
+
+ if (*cp != '\0' && !isspace((int)*cp))
+ return 0;
+
+ lfp->l_ui = dec_i;
+ lfp->l_uf = dec_f;
+ return 1;
+}
diff --git a/libntp/humandate.c b/libntp/humandate.c
new file mode 100644
index 0000000..f88d8d2
--- /dev/null
+++ b/libntp/humandate.c
@@ -0,0 +1,60 @@
+/*
+ * humandate.c - convert an NTP (or the current) time to something readable
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h" /* includes <sys/time.h> and <time.h> */
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+
+
+/* This is used in msyslog.c; we don't want to clutter up the log with
+ the year and day of the week, etc.; just the minimal date and time. */
+
+char *
+humanlogtime(void)
+{
+ char * bp;
+ time_t cursec;
+ struct tm * tm;
+
+ cursec = time(NULL);
+ tm = localtime(&cursec);
+ if (!tm)
+ return "-- --- --:--:--";
+
+ LIB_GETBUF(bp);
+
+ snprintf(bp, LIB_BUFLENGTH, "%2d %s %02d:%02d:%02d",
+ tm->tm_mday, months[tm->tm_mon],
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+
+ return bp;
+}
+
+
+/*
+ * humantime() -- like humanlogtime() but without date, and with the
+ * time to display given as an argument.
+ */
+char *
+humantime(
+ time_t cursec
+ )
+{
+ char * bp;
+ struct tm * tm;
+
+ tm = localtime(&cursec);
+ if (!tm)
+ return "--:--:--";
+
+ LIB_GETBUF(bp);
+
+ snprintf(bp, LIB_BUFLENGTH, "%02d:%02d:%02d",
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+
+ return bp;
+}
diff --git a/libntp/icom.c b/libntp/icom.c
new file mode 100644
index 0000000..c981d85
--- /dev/null
+++ b/libntp/icom.c
@@ -0,0 +1,164 @@
+/*
+ * Program to control ICOM radios
+ *
+ * This is a ripoff of the utility routines in the ICOM software
+ * distribution. The only function provided is to load the radio
+ * frequency. All other parameters must be manually set before use.
+ */
+#include <config.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 */
+extern int async_write(int, const void *, unsigned int);
+#define write(fd, data, octets) async_write(fd, data, octets)
+#endif
+
+/*
+ * Packet routines
+ *
+ * These routines send a packet and receive the response. If an error
+ * (collision) occurs on transmit, the packet is resent. If an error
+ * occurs on receive (timeout), all input to the terminating FI is
+ * discarded and the packet is resent. If the maximum number of retries
+ * is not exceeded, the program returns the number of octets in the user
+ * buffer; otherwise, it returns zero.
+ *
+ * ICOM frame format
+ *
+ * Frames begin with a two-octet preamble PR-PR followyd by the
+ * transceiver address RE, controller address TX, control code CN, zero
+ * or more data octets DA (depending on command), and terminator FI.
+ * Since the bus is bidirectional, every octet output is echoed on
+ * input. Every valid frame sent is answered with a frame in the same
+ * format, but with the RE and TX fields interchanged. The CN field is
+ * set to NAK if an error has occurred. Otherwise, the data are returned
+ * in this and following DA octets. If no data are returned, the CN
+ * octet is set to ACK.
+ *
+ * +------+------+------+------+------+--//--+------+
+ * | PR | PR | RE | TX | CN | DA | FI |
+ * +------+------+------+------+------+--//--+------+
+ */
+/*
+ * Scraps
+ */
+#define DICOM /dev/icom/ /* ICOM port link */
+
+/*
+ * Local function prototypes
+ */
+static void doublefreq (double, u_char *, int);
+
+
+/*
+ * icom_freq(fd, ident, freq) - load radio frequency
+ */
+int
+icom_freq( /* returns 0 (ok), EIO (error) */
+ int fd, /* file descriptor */
+ int ident, /* ICOM radio identifier */
+ double freq /* frequency (MHz) */
+ )
+{
+ u_char cmd[] = {PAD, PR, PR, 0, TX, V_SFREQ, 0, 0, 0, 0, FI,
+ FI};
+ int temp;
+
+ cmd[3] = (char)ident;
+ if (ident == IC735)
+ temp = 4;
+ else
+ temp = 5;
+ doublefreq(freq * 1e6, &cmd[6], temp);
+ temp = write(fd, cmd, temp + 7);
+
+ return (0);
+}
+
+
+/*
+ * doublefreq(freq, y, len) - double to ICOM frequency with padding
+ */
+static void
+doublefreq( /* returns void */
+ double freq, /* frequency */
+ u_char *x, /* radio frequency */
+ int len /* length (octets) */
+ )
+{
+ int i;
+ char s1[16];
+ char *y;
+
+ snprintf(s1, sizeof(s1), " %10.0f", freq);
+ y = s1 + 10;
+ i = 0;
+ while (*y != ' ') {
+ x[i] = *y-- & 0x0f;
+ x[i] = x[i] | ((*y-- & 0x0f) << 4);
+ i++;
+ }
+ for ( ; i < len; i++)
+ x[i] = 0;
+ x[i] = FI;
+}
+
+/*
+ * icom_init() - open and initialize serial interface
+ *
+ * This routine opens the serial interface for raw transmission; that
+ * is, character-at-a-time, no stripping, checking or monkeying with the
+ * bits. For Unix, an input operation ends either with the receipt of a
+ * character or a 0.5-s timeout.
+ */
+int
+icom_init(
+ char *device, /* device name/link */
+ int speed, /* line speed */
+ int trace /* trace flags */ )
+{
+ TTY ttyb;
+ int fd;
+ int flags;
+ int rc;
+ int saved_errno;
+
+ flags = trace;
+ fd = tty_open(device, O_RDWR, 0777);
+ if (fd < 0)
+ return -1;
+
+ rc = tcgetattr(fd, &ttyb);
+ if (rc < 0) {
+ saved_errno = errno;
+ close(fd);
+ errno = saved_errno;
+ return -1;
+ }
+ ttyb.c_iflag = 0; /* input modes */
+ ttyb.c_oflag = 0; /* output modes */
+ ttyb.c_cflag = IBAUD|CS8|CLOCAL; /* control modes (no read) */
+ ttyb.c_lflag = 0; /* local modes */
+ ttyb.c_cc[VMIN] = 0; /* min chars */
+ ttyb.c_cc[VTIME] = 5; /* receive timeout */
+ cfsetispeed(&ttyb, (u_int)speed);
+ cfsetospeed(&ttyb, (u_int)speed);
+ rc = tcsetattr(fd, TCSANOW, &ttyb);
+ if (rc < 0) {
+ saved_errno = errno;
+ close(fd);
+ errno = saved_errno;
+ return -1;
+ }
+ return (fd);
+}
+
+/* end program */
diff --git a/libntp/iosignal.c b/libntp/iosignal.c
new file mode 100644
index 0000000..8749a23
--- /dev/null
+++ b/libntp/iosignal.c
@@ -0,0 +1,546 @@
+/*
+ * iosignal.c - input/output routines for ntpd. The socket-opening code
+ * was shamelessly stolen from ntpd.
+ */
+
+/*
+ * [Bug 158]
+ * Do the #includes differently, as under some versions of Linux
+ * sys/param.h has a #undef CONFIG_PHONE line in it.
+ *
+ * As we have ~40 CONFIG_ variables, I don't feel like renaming them
+ * every time somebody adds a new macro to some system header.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <signal.h>
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif /* HAVE_SYS_PARAM_H */
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
+#include <arpa/inet.h>
+
+#if _BSDI_VERSION >= 199510
+# include <ifaddrs.h>
+#endif
+
+# ifdef __QNXNTO__
+# include <fcntl.h>
+# include <unix.h>
+# define FNDELAY O_NDELAY
+# endif
+
+#include "ntp_machine.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_if.h"
+#include "ntp_stdlib.h"
+#include "iosignal.h"
+
+#if defined(HAVE_SIGNALED_IO)
+static RETSIGTYPE sigio_handler (int);
+
+/* consistency safegurad to catch BLOCK/UNBLOCK oversights */
+static int sigio_block_count = 0;
+
+/* main inputhandler to be called on SIGIO */
+static input_handler_t *input_handler_callback = NULL;
+
+# if defined(HAVE_SIGACTION)
+/*
+ * If sigaction() is used for signal handling and a signal is
+ * pending then the kernel blocks the signal before it calls
+ * the signal handler.
+ *
+ * The variable below is used to take care that the SIGIO signal
+ * is not unintentionally unblocked inside the sigio_handler()
+ * if the handler executes a piece of code that is normally
+ * bracketed by BLOCKIO()/UNBLOCKIO() calls.
+ */
+static int sigio_handler_active = 0;
+# endif
+
+/*
+ * SIGPOLL and SIGIO ROUTINES.
+ */
+
+
+
+/*
+ * TTY initialization routines.
+ */
+int
+init_clock_sig(
+ struct refclockio *rio
+ )
+{
+# ifdef USE_TTY_SIGPOLL
+ {
+ /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
+ if (ioctl(rio->fd, I_SETSIG, S_INPUT) < 0)
+ {
+ msyslog(LOG_ERR,
+ "init_clock_sig: ioctl(I_SETSIG, S_INPUT) failed: %m");
+ return 1;
+ }
+ return 0;
+ }
+# else
+ /*
+ * Special cases first!
+ */
+ /* Was: defined(SYS_HPUX) */
+# if defined(FIOSSAIOOWN) && defined(FIOSNBIO) && defined(FIOSSAIOSTAT)
+#define CLOCK_DONE
+ {
+ int pgrp, on = 1;
+
+ /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
+ pgrp = getpid();
+ if (ioctl(rio->fd, FIOSSAIOOWN, (char *)&pgrp) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(FIOSSAIOOWN) fails for clock I/O: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ /*
+ * set non-blocking, async I/O on the descriptor
+ */
+ if (ioctl(rio->fd, FIOSNBIO, (char *)&on) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(FIOSNBIO) fails for clock I/O: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ if (ioctl(rio->fd, FIOSSAIOSTAT, (char *)&on) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(FIOSSAIOSTAT) fails for clock I/O: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ return 0;
+ }
+# endif /* SYS_HPUX: FIOSSAIOOWN && FIOSNBIO && FIOSSAIOSTAT */
+ /* Was: defined(SYS_AIX) && !defined(_BSD) */
+# if !defined(_BSD) && defined(_AIX) && defined(FIOASYNC) && defined(FIOSETOWN)
+ /*
+ * SYSV compatibility mode under AIX.
+ */
+#define CLOCK_DONE
+ {
+ int pgrp, on = 1;
+
+ /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
+ if (ioctl(rio->fd, FIOASYNC, (char *)&on) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(FIOASYNC) fails for clock I/O: %m");
+ return 1;
+ }
+ pgrp = -getpid();
+ if (ioctl(rio->fd, FIOSETOWN, (char*)&pgrp) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(FIOSETOWN) fails for clock I/O: %m");
+ return 1;
+ }
+
+ if (fcntl(rio->fd, F_SETFL, FNDELAY|FASYNC) < 0)
+ {
+ msyslog(LOG_ERR, "fcntl(FNDELAY|FASYNC) fails for clock I/O: %m");
+ return 1;
+ }
+ return 0;
+ }
+# endif /* AIX && !BSD: !_BSD && FIOASYNC && FIOSETOWN */
+# ifndef CLOCK_DONE
+ {
+ /* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
+# if defined(TIOCSCTTY) && defined(USE_FSETOWNCTTY)
+ /*
+ * there are, however, always exceptions to the rules
+ * one is, that OSF accepts SETOWN on TTY fd's only, iff they are
+ * CTTYs. SunOS and HPUX do not semm to have this restriction.
+ * another question is: how can you do multiple SIGIO from several
+ * ttys (as they all should be CTTYs), wondering...
+ *
+ * kd 95-07-16
+ */
+ if (ioctl(rio->fd, TIOCSCTTY, 0) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(TIOCSCTTY, 0) fails for clock I/O: %m");
+ return 1;
+ }
+# endif /* TIOCSCTTY && USE_FSETOWNCTTY */
+
+ if (fcntl(rio->fd, F_SETOWN, getpid()) == -1)
+ {
+ msyslog(LOG_ERR, "fcntl(F_SETOWN) fails for clock I/O: %m");
+ return 1;
+ }
+
+ if (fcntl(rio->fd, F_SETFL, FNDELAY|FASYNC) < 0)
+ {
+ msyslog(LOG_ERR,
+ "fcntl(FNDELAY|FASYNC) fails for clock I/O: %m");
+ return 1;
+ }
+ return 0;
+ }
+# endif /* CLOCK_DONE */
+# endif /* !USE_TTY_SIGPOLL */
+}
+
+
+
+void
+init_socket_sig(
+ int fd
+ )
+{
+# ifdef USE_UDP_SIGPOLL
+ {
+ if (ioctl(fd, I_SETSIG, S_INPUT) < 0)
+ {
+ msyslog(LOG_ERR,
+ "init_socket_sig: ioctl(I_SETSIG, S_INPUT) failed: %m - EXITING");
+ exit(1);
+ }
+ }
+# else /* USE_UDP_SIGPOLL */
+ {
+ int pgrp;
+# ifdef FIOASYNC
+ int on = 1;
+# endif
+
+# if defined(FIOASYNC)
+ if (ioctl(fd, FIOASYNC, (char *)&on) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(FIOASYNC) fails: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+# elif defined(FASYNC)
+ {
+ int flags;
+
+ if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
+ {
+ msyslog(LOG_ERR, "fcntl(F_GETFL) fails: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ if (fcntl(fd, F_SETFL, flags|FASYNC) < 0)
+ {
+ msyslog(LOG_ERR, "fcntl(...|FASYNC) fails: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ }
+# else
+# include "Bletch: Need asynchronous I/O!"
+# endif
+
+# ifdef UDP_BACKWARDS_SETOWN
+ pgrp = -getpid();
+# else
+ pgrp = getpid();
+# endif
+
+# if defined(SIOCSPGRP)
+ if (ioctl(fd, SIOCSPGRP, (char *)&pgrp) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(SIOCSPGRP) fails: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+# elif defined(FIOSETOWN)
+ if (ioctl(fd, FIOSETOWN, (char*)&pgrp) == -1)
+ {
+ msyslog(LOG_ERR, "ioctl(FIOSETOWN) fails: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+# elif defined(F_SETOWN)
+ if (fcntl(fd, F_SETOWN, pgrp) == -1)
+ {
+ msyslog(LOG_ERR, "fcntl(F_SETOWN) fails: %m - EXITING");
+ exit(1);
+ /*NOTREACHED*/
+ }
+# else
+# include "Bletch: Need to set process(group) to receive SIG(IO|POLL)"
+# endif
+ }
+# endif /* USE_UDP_SIGPOLL */
+}
+
+static RETSIGTYPE
+sigio_handler(
+ int sig
+ )
+{
+ int saved_errno = errno;
+ l_fp ts;
+
+ get_systime(&ts);
+
+# if defined(HAVE_SIGACTION)
+ sigio_handler_active++;
+ if (sigio_handler_active != 1) /* This should never happen! */
+ msyslog(LOG_ERR, "sigio_handler: sigio_handler_active != 1");
+# endif
+
+ INSIST(input_handler_callback != NULL);
+ (*input_handler_callback)(&ts);
+
+# if defined(HAVE_SIGACTION)
+ sigio_handler_active--;
+ if (sigio_handler_active != 0) /* This should never happen! */
+ msyslog(LOG_ERR, "sigio_handler: sigio_handler_active != 0");
+# endif
+
+ errno = saved_errno;
+}
+
+/*
+ * Signal support routines.
+ */
+# ifdef HAVE_SIGACTION
+void
+set_signal(input_handler_t *input)
+{
+ INSIST(input != NULL);
+
+ input_handler_callback = input;
+
+ using_sigio = TRUE;
+# ifdef USE_SIGIO
+ (void) signal_no_reset(SIGIO, sigio_handler);
+# endif
+# ifdef USE_SIGPOLL
+ (void) signal_no_reset(SIGPOLL, sigio_handler);
+# endif
+}
+
+void
+block_io_and_alarm(void)
+{
+ sigset_t set;
+
+ if (sigemptyset(&set))
+ msyslog(LOG_ERR, "block_io_and_alarm: sigemptyset() failed: %m");
+# if defined(USE_SIGIO)
+ if (sigaddset(&set, SIGIO))
+ msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGIO) failed: %m");
+# endif
+# if defined(USE_SIGPOLL)
+ if (sigaddset(&set, SIGPOLL))
+ msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGPOLL) failed: %m");
+# endif
+ if (sigaddset(&set, SIGALRM))
+ msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGALRM) failed: %m");
+
+ if (sigprocmask(SIG_BLOCK, &set, NULL))
+ msyslog(LOG_ERR, "block_io_and_alarm: sigprocmask() failed: %m");
+}
+
+void
+block_sigio(void)
+{
+ if ( sigio_handler_active == 0 ) /* not called from within signal handler */
+ {
+ sigset_t set;
+
+ ++sigio_block_count;
+ if (sigio_block_count > 1)
+ msyslog(LOG_INFO, "block_sigio: sigio_block_count > 1");
+ if (sigio_block_count < 1)
+ msyslog(LOG_INFO, "block_sigio: sigio_block_count < 1");
+
+ if (sigemptyset(&set))
+ msyslog(LOG_ERR, "block_sigio: sigemptyset() failed: %m");
+# if defined(USE_SIGIO)
+ if (sigaddset(&set, SIGIO))
+ msyslog(LOG_ERR, "block_sigio: sigaddset(SIGIO) failed: %m");
+# endif
+# if defined(USE_SIGPOLL)
+ if (sigaddset(&set, SIGPOLL))
+ msyslog(LOG_ERR, "block_sigio: sigaddset(SIGPOLL) failed: %m");
+# endif
+
+ if (sigprocmask(SIG_BLOCK, &set, NULL))
+ msyslog(LOG_ERR, "block_sigio: sigprocmask() failed: %m");
+ }
+}
+
+void
+unblock_io_and_alarm(void)
+{
+ sigset_t unset;
+
+ if (sigemptyset(&unset))
+ msyslog(LOG_ERR, "unblock_io_and_alarm: sigemptyset() failed: %m");
+
+# if defined(USE_SIGIO)
+ if (sigaddset(&unset, SIGIO))
+ msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGIO) failed: %m");
+# endif
+# if defined(USE_SIGPOLL)
+ if (sigaddset(&unset, SIGPOLL))
+ msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGPOLL) failed: %m");
+# endif
+ if (sigaddset(&unset, SIGALRM))
+ msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGALRM) failed: %m");
+
+ if (sigprocmask(SIG_UNBLOCK, &unset, NULL))
+ msyslog(LOG_ERR, "unblock_io_and_alarm: sigprocmask() failed: %m");
+}
+
+void
+unblock_sigio(void)
+{
+ if ( sigio_handler_active == 0 ) /* not called from within signal handler */
+ {
+ sigset_t unset;
+
+ --sigio_block_count;
+ if (sigio_block_count > 0)
+ msyslog(LOG_INFO, "unblock_sigio: sigio_block_count > 0");
+ if (sigio_block_count < 0)
+ msyslog(LOG_INFO, "unblock_sigio: sigio_block_count < 0");
+
+ if (sigemptyset(&unset))
+ msyslog(LOG_ERR, "unblock_sigio: sigemptyset() failed: %m");
+
+# if defined(USE_SIGIO)
+ if (sigaddset(&unset, SIGIO))
+ msyslog(LOG_ERR, "unblock_sigio: sigaddset(SIGIO) failed: %m");
+# endif
+# if defined(USE_SIGPOLL)
+ if (sigaddset(&unset, SIGPOLL))
+ msyslog(LOG_ERR, "unblock_sigio: sigaddset(SIGPOLL) failed: %m");
+# endif
+
+ if (sigprocmask(SIG_UNBLOCK, &unset, NULL))
+ msyslog(LOG_ERR, "unblock_sigio: sigprocmask() failed: %m");
+ }
+}
+
+void
+wait_for_signal(void)
+{
+ sigset_t old;
+
+ if (sigprocmask(SIG_UNBLOCK, NULL, &old))
+ msyslog(LOG_ERR, "wait_for_signal: sigprocmask() failed: %m");
+
+# if defined(USE_SIGIO)
+ if (sigdelset(&old, SIGIO))
+ msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGIO) failed: %m");
+# endif
+# if defined(USE_SIGPOLL)
+ if (sigdelset(&old, SIGPOLL))
+ msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGPOLL) failed: %m");
+# endif
+ if (sigdelset(&old, SIGALRM))
+ msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGALRM) failed: %m");
+
+ if (sigsuspend(&old) && (errno != EINTR))
+ msyslog(LOG_ERR, "wait_for_signal: sigsuspend() failed: %m");
+}
+
+# else /* !HAVE_SIGACTION */
+/*
+ * Must be an old bsd system.
+ * We assume there is no SIGPOLL.
+ */
+
+void
+block_io_and_alarm(void)
+{
+ int mask;
+
+ mask = sigmask(SIGIO) | sigmask(SIGALRM);
+ if (sigblock(mask))
+ msyslog(LOG_ERR, "block_io_and_alarm: sigblock() failed: %m");
+}
+
+void
+block_sigio(void)
+{
+ int mask;
+
+ ++sigio_block_count;
+ if (sigio_block_count > 1)
+ msyslog(LOG_INFO, "block_sigio: sigio_block_count > 1");
+ if (sigio_block_count < 1)
+ msyslog(LOG_INFO, "block_sigio: sigio_block_count < 1");
+
+ mask = sigmask(SIGIO);
+ if (sigblock(mask))
+ msyslog(LOG_ERR, "block_sigio: sigblock() failed: %m");
+}
+
+void
+set_signal(input_handler_t *input)
+{
+ INSIST(input != NULL);
+
+ input_handler_callback = input;
+
+ using_sigio = TRUE;
+ (void) signal_no_reset(SIGIO, sigio_handler);
+}
+
+void
+unblock_io_and_alarm(void)
+{
+ int mask, omask;
+
+ mask = sigmask(SIGIO) | sigmask(SIGALRM);
+ omask = sigblock(0);
+ omask &= ~mask;
+ (void) sigsetmask(omask);
+}
+
+void
+unblock_sigio(void)
+{
+ int mask, omask;
+
+ --sigio_block_count;
+ if (sigio_block_count > 0)
+ msyslog(LOG_INFO, "unblock_sigio: sigio_block_count > 0");
+ if (sigio_block_count < 0)
+ msyslog(LOG_INFO, "unblock_sigio: sigio_block_count < 0");
+ mask = sigmask(SIGIO);
+ omask = sigblock(0);
+ omask &= ~mask;
+ (void) sigsetmask(omask);
+}
+
+void
+wait_for_signal(void)
+{
+ int mask, omask;
+
+ mask = sigmask(SIGIO) | sigmask(SIGALRM);
+ omask = sigblock(0);
+ omask &= ~mask;
+ if (sigpause(omask) && (errno != EINTR))
+ msyslog(LOG_ERR, "wait_for_signal: sigspause() failed: %m");
+}
+
+# endif /* HAVE_SIGACTION */
+#else
+int NotAnEmptyCompilationUnit;
+#endif
diff --git a/libntp/lib_strbuf.c b/libntp/lib_strbuf.c
new file mode 100644
index 0000000..76f7016
--- /dev/null
+++ b/libntp/lib_strbuf.c
@@ -0,0 +1,39 @@
+/*
+ * lib_strbuf - library string storage
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <isc/net.h>
+#include <isc/result.h>
+
+#include "ntp_fp.h"
+#include "ntp_stdlib.h"
+#include "lib_strbuf.h"
+
+
+/*
+ * Storage declarations
+ */
+int debug;
+libbufstr lib_stringbuf[LIB_NUMBUF];
+int lib_nextbuf;
+int ipv4_works;
+int ipv6_works;
+int lib_inited;
+
+
+/*
+ * initialization routine. Might be needed if the code is ROMized.
+ */
+void
+init_lib(void)
+{
+ if (lib_inited)
+ return;
+ ipv4_works = (ISC_R_SUCCESS == isc_net_probeipv4());
+ ipv6_works = (ISC_R_SUCCESS == isc_net_probeipv6());
+ init_systime();
+ lib_inited = TRUE;
+}
diff --git a/libntp/machines.c b/libntp/machines.c
new file mode 100644
index 0000000..43944f9
--- /dev/null
+++ b/libntp/machines.c
@@ -0,0 +1,533 @@
+/* machines.c - provide special support for peculiar architectures
+ *
+ * Real bummers unite !
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "ntp.h"
+#include "ntp_machine.h"
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "lib_strbuf.h"
+#include "ntp_debug.h"
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef SYS_WINNT
+int _getch(void); /* Declare the one function rather than include conio.h */
+#else
+
+#ifdef SYS_VXWORKS
+#include "taskLib.h"
+#include "sysLib.h"
+#include "time.h"
+#include "ntp_syslog.h"
+
+/* some translations to the world of vxWorkings -casey */
+/* first some netdb type things */
+#include "ioLib.h"
+#include <socket.h>
+int h_errno;
+
+struct hostent *gethostbyname(char *name)
+ {
+ struct hostent *host1;
+ h_errno = 0; /* we are always successful!!! */
+ host1 = (struct hostent *) malloc (sizeof(struct hostent));
+ host1->h_name = name;
+ host1->h_addrtype = AF_INET;
+ host1->h_aliases = name;
+ host1->h_length = 4;
+ host1->h_addr_list[0] = (char *)hostGetByName (name);
+ host1->h_addr_list[1] = NULL;
+ return host1;
+ }
+
+struct hostent *gethostbyaddr(char *name, int size, int addr_type)
+ {
+ struct hostent *host1;
+ h_errno = 0; /* we are always successful!!! */
+ host1 = (struct hostent *) malloc (sizeof(struct hostent));
+ host1->h_name = name;
+ host1->h_addrtype = AF_INET;
+ host1->h_aliases = name;
+ host1->h_length = 4;
+ host1->h_addr_list = NULL;
+ return host1;
+ }
+
+struct servent *getservbyname (char *name, char *type)
+ {
+ struct servent *serv1;
+ serv1 = (struct servent *) malloc (sizeof(struct servent));
+ serv1->s_name = "ntp"; /* official service name */
+ serv1->s_aliases = NULL; /* alias list */
+ serv1->s_port = 123; /* port # */
+ serv1->s_proto = "udp"; /* protocol to use */
+ return serv1;
+ }
+
+/* second
+ * vxworks thinks it has insomnia
+ * we have to sleep for number of seconds
+ */
+
+#define CLKRATE sysClkRateGet()
+
+/* I am not sure how valid the granularity is - it is from G. Eger's port */
+#define CLK_GRANULARITY 1 /* Granularity of system clock in usec */
+ /* Used to round down # usecs/tick */
+ /* On a VCOM-100, PIT gets 8 MHz clk, */
+ /* & it prescales by 32, thus 4 usec */
+ /* on mv167, granularity is 1usec anyway*/
+ /* To defeat rounding, set to 1 */
+#define USECS_PER_SEC MILLION /* Microseconds per second */
+#define TICK (((USECS_PER_SEC / CLKRATE) / CLK_GRANULARITY) * CLK_GRANULARITY)
+
+/* emulate unix sleep
+ * casey
+ */
+void sleep(int seconds)
+ {
+ taskDelay(seconds*TICK);
+ }
+/* emulate unix alarm
+ * that pauses and calls SIGALRM after the seconds are up...
+ * so ... taskDelay() fudged for seconds should amount to the same thing.
+ * casey
+ */
+void alarm (int seconds)
+ {
+ sleep(seconds);
+ }
+
+#endif /* SYS_VXWORKS */
+
+#ifdef SYS_PTX /* Does PTX still need this? */
+/*#include <sys/types.h> */
+#include <sys/procstats.h>
+
+int
+gettimeofday(
+ struct timeval *tvp
+ )
+{
+ /*
+ * hi, this is Sequents sneak path to get to a clock
+ * this is also the most logical syscall for such a function
+ */
+ return (get_process_stats(tvp, PS_SELF, (struct procstats *) 0,
+ (struct procstats *) 0));
+}
+#endif /* SYS_PTX */
+
+#ifdef MPE
+/* This is a substitute for bind() that if called for an AF_INET socket
+port less than 1024, GETPRIVMODE() and GETUSERMODE() calls will be done. */
+
+#undef bind
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/un.h>
+
+extern void GETPRIVMODE(void);
+extern void GETUSERMODE(void);
+
+int __ntp_mpe_bind(int s, void *addr, int addrlen);
+
+int __ntp_mpe_bind(int s, void *addr, int addrlen) {
+ int priv = 0;
+ int result;
+
+if (addrlen == sizeof(struct sockaddr_in)) { /* AF_INET */
+ if (((struct sockaddr_in *)addr)->sin_port > 0 &&
+ ((struct sockaddr_in *)addr)->sin_port < 1024) {
+ priv = 1;
+ GETPRIVMODE();
+ }
+/* ((struct sockaddr_in *)addr)->sin_addr.s_addr = 0; */
+ result = bind(s,addr,addrlen);
+ if (priv == 1) GETUSERMODE();
+} else /* AF_UNIX */
+ result = bind(s,addr,addrlen);
+
+return result;
+}
+
+/*
+ * MPE stupidly requires sfcntl() to be used on sockets instead of fcntl(),
+ * so we define a wrapper to analyze the file descriptor and call the correct
+ * function.
+ */
+
+#undef fcntl
+#include <errno.h>
+#include <fcntl.h>
+
+int __ntp_mpe_fcntl(int fd, int cmd, int arg);
+
+int __ntp_mpe_fcntl(int fd, int cmd, int arg) {
+ int len;
+ struct sockaddr sa;
+
+ extern int sfcntl(int, int, int);
+
+ len = sizeof sa;
+ if (getsockname(fd, &sa, &len) == -1) {
+ if (errno == EAFNOSUPPORT) /* AF_UNIX socket */
+ return sfcntl(fd, cmd, arg);
+ if (errno == ENOTSOCK) /* file or pipe */
+ return fcntl(fd, cmd, arg);
+ return (-1); /* unknown getsockname() failure */
+ } else /* AF_INET socket */
+ return sfcntl(fd, cmd, arg);
+}
+
+/*
+ * Setitimer emulation support. Note that we implement this using alarm(),
+ * and since alarm() only delivers one signal, we must re-enable the alarm
+ * by enabling our own SIGALRM setitimer_mpe_handler routine to be called
+ * before the real handler routine and re-enable the alarm at that time.
+ *
+ * Note that this solution assumes that sigaction(SIGALRM) is called before
+ * calling setitimer(). If it should ever to become necessary to support
+ * sigaction(SIGALRM) after calling setitimer(), it will be necessary to trap
+ * those sigaction() calls.
+ */
+
+#include <limits.h>
+#include <signal.h>
+
+/*
+ * Some global data that needs to be shared between setitimer() and
+ * setitimer_mpe_handler().
+ */
+
+struct {
+ unsigned long current_msec; /* current alarm() value in effect */
+ unsigned long interval_msec; /* next alarm() value from setitimer */
+ unsigned long value_msec; /* first alarm() value from setitimer */
+ struct itimerval current_itimerval; /* current itimerval in effect */
+ struct sigaction oldact; /* SIGALRM state saved by setitimer */
+} setitimer_mpe_ctx = { 0, 0, 0 };
+
+/*
+ * Undocumented, unsupported function to do alarm() in milliseconds.
+ */
+
+extern unsigned int px_alarm(unsigned long, int *);
+
+/*
+ * The SIGALRM handler routine enabled by setitimer(). Re-enable the alarm or
+ * restore the original SIGALRM setting if no more alarms are needed. Then
+ * call the original SIGALRM handler (if any).
+ */
+
+static RETSIGTYPE setitimer_mpe_handler(int sig)
+{
+int alarm_hpe_status;
+
+/* Update the new current alarm value */
+
+setitimer_mpe_ctx.current_msec = setitimer_mpe_ctx.interval_msec;
+
+if (setitimer_mpe_ctx.interval_msec > 0) {
+ /* Additional intervals needed; re-arm the alarm timer */
+ px_alarm(setitimer_mpe_ctx.interval_msec,&alarm_hpe_status);
+} else {
+ /* No more intervals, so restore previous original SIGALRM handler */
+ sigaction(SIGALRM, &setitimer_mpe_ctx.oldact, NULL);
+}
+
+/* Call the original SIGALRM handler if it is a function and not just a flag */
+
+if (setitimer_mpe_ctx.oldact.sa_handler != SIG_DFL &&
+ setitimer_mpe_ctx.oldact.sa_handler != SIG_ERR &&
+ setitimer_mpe_ctx.oldact.sa_handler != SIG_IGN)
+ (*setitimer_mpe_ctx.oldact.sa_handler)(SIGALRM);
+
+}
+
+/*
+ * Our implementation of setitimer().
+ */
+
+int
+setitimer(int which, struct itimerval *value,
+ struct itimerval *ovalue)
+{
+
+int alarm_hpe_status;
+unsigned long remaining_msec, value_msec, interval_msec;
+struct sigaction newact;
+
+/*
+ * Convert the initial interval to milliseconds
+ */
+
+if (value->it_value.tv_sec > (UINT_MAX / 1000))
+ value_msec = UINT_MAX;
+else
+ value_msec = value->it_value.tv_sec * 1000;
+
+value_msec += value->it_value.tv_usec / 1000;
+
+/*
+ * Convert the reset interval to milliseconds
+ */
+
+if (value->it_interval.tv_sec > (UINT_MAX / 1000))
+ interval_msec = UINT_MAX;
+else
+ interval_msec = value->it_interval.tv_sec * 1000;
+
+interval_msec += value->it_interval.tv_usec / 1000;
+
+if (value_msec > 0 && interval_msec > 0) {
+ /*
+ * We'll be starting an interval timer that will be repeating, so we need to
+ * insert our own SIGALRM signal handler to schedule the repeats.
+ */
+
+ /* Read the current SIGALRM action */
+
+ if (sigaction(SIGALRM, NULL, &setitimer_mpe_ctx.oldact) < 0) {
+ fprintf(stderr,"MPE setitimer old handler failed, errno=%d\n",errno);
+ return -1;
+ }
+
+ /* Initialize the new action to call our SIGALRM handler instead */
+
+ newact.sa_handler = &setitimer_mpe_handler;
+ newact.sa_mask = setitimer_mpe_ctx.oldact.sa_mask;
+ newact.sa_flags = setitimer_mpe_ctx.oldact.sa_flags;
+
+ if (sigaction(SIGALRM, &newact, NULL) < 0) {
+ fprintf(stderr,"MPE setitimer new handler failed, errno=%d\n",errno);
+ return -1;
+ }
+}
+
+/*
+ * Return previous itimerval if desired
+ */
+
+if (ovalue != NULL) *ovalue = setitimer_mpe_ctx.current_itimerval;
+
+/*
+ * Save current parameters for later usage
+ */
+
+setitimer_mpe_ctx.current_itimerval = *value;
+setitimer_mpe_ctx.current_msec = value_msec;
+setitimer_mpe_ctx.value_msec = value_msec;
+setitimer_mpe_ctx.interval_msec = interval_msec;
+
+/*
+ * Schedule the first alarm
+ */
+
+remaining_msec = px_alarm(value_msec, &alarm_hpe_status);
+if (alarm_hpe_status == 0)
+ return (0);
+else
+ return (-1);
+}
+
+/*
+ * MPE lacks gettimeofday(), so we define our own.
+ */
+
+int gettimeofday(struct timeval *tvp)
+
+{
+/* Documented, supported MPE functions. */
+extern void GETPRIVMODE(void);
+extern void GETUSERMODE(void);
+
+/* Undocumented, unsupported MPE functions. */
+extern long long get_time(void);
+extern void get_time_change_info(long long *, char *, char *);
+extern long long ticks_to_micro(long long);
+
+char pwf_since_boot, recover_pwf_time;
+long long mpetime, offset_ticks, offset_usec;
+
+GETPRIVMODE();
+mpetime = get_time(); /* MPE local time usecs since Jan 1 1970 */
+get_time_change_info(&offset_ticks, &pwf_since_boot, &recover_pwf_time);
+offset_usec = ticks_to_micro(offset_ticks); /* UTC offset usecs */
+GETUSERMODE();
+
+mpetime = mpetime - offset_usec; /* Convert from local time to UTC */
+tvp->tv_sec = mpetime / 1000000LL;
+tvp->tv_usec = mpetime % 1000000LL;
+
+return 0;
+}
+
+/*
+ * MPE lacks settimeofday(), so we define our own.
+ */
+
+#define HAVE_SETTIMEOFDAY
+
+int settimeofday(struct timeval *tvp)
+
+{
+/* Documented, supported MPE functions. */
+extern void GETPRIVMODE(void);
+extern void GETUSERMODE(void);
+
+/* Undocumented, unsupported MPE functions. */
+extern void get_time_change_info(long long *, char *, char *);
+extern void initialize_system_time(long long, int);
+extern void set_time_correction(long long, int, int);
+extern long long ticks_to_micro(long long);
+
+char pwf_since_boot, recover_pwf_time;
+long long big_sec, big_usec, mpetime, offset_ticks, offset_usec;
+
+big_sec = tvp->tv_sec;
+big_usec = tvp->tv_usec;
+mpetime = (big_sec * 1000000LL) + big_usec; /* Desired UTC microseconds */
+
+GETPRIVMODE();
+set_time_correction(0LL,0,0); /* Cancel previous time correction, if any */
+get_time_change_info(&offset_ticks, &pwf_since_boot, &recover_pwf_time);
+offset_usec = ticks_to_micro(offset_ticks); /* UTC offset microseconds */
+mpetime = mpetime + offset_usec; /* Convert from UTC to local time */
+initialize_system_time(mpetime,1);
+GETUSERMODE();
+
+return 0;
+}
+#endif /* MPE */
+
+#define SET_TOD_UNDETERMINED 0
+#define SET_TOD_CLOCK_SETTIME 1
+#define SET_TOD_SETTIMEOFDAY 2
+#define SET_TOD_STIME 3
+
+const char * const set_tod_used[] = {
+ "undetermined",
+ "clock_settime",
+ "settimeofday",
+ "stime"
+};
+
+pset_tod_using set_tod_using = NULL;
+
+
+int
+ntp_set_tod(
+ struct timeval *tvp,
+ void *tzp
+ )
+{
+ static int tod;
+ int rc;
+ int saved_errno;
+
+ TRACE(1, ("In ntp_set_tod\n"));
+ rc = -1;
+ saved_errno = 0;
+
+#ifdef HAVE_CLOCK_SETTIME
+ if (rc && (SET_TOD_CLOCK_SETTIME == tod || !tod)) {
+ struct timespec ts;
+
+ /* Convert timeval to timespec */
+ ts.tv_sec = tvp->tv_sec;
+ ts.tv_nsec = 1000 * tvp->tv_usec;
+
+ errno = 0;
+ rc = clock_settime(CLOCK_REALTIME, &ts);
+ saved_errno = errno;
+ TRACE(1, ("ntp_set_tod: clock_settime: %d %m\n", rc));
+ if (!tod && !rc)
+ tod = SET_TOD_CLOCK_SETTIME;
+
+ }
+#endif /* HAVE_CLOCK_SETTIME */
+#ifdef HAVE_SETTIMEOFDAY
+ if (rc && (SET_TOD_SETTIMEOFDAY == tod || !tod)) {
+ struct timeval adjtv;
+
+ /*
+ * Some broken systems don't reset adjtime() when the
+ * clock is stepped.
+ */
+ adjtv.tv_sec = adjtv.tv_usec = 0;
+ adjtime(&adjtv, NULL);
+ errno = 0;
+ rc = SETTIMEOFDAY(tvp, tzp);
+ saved_errno = errno;
+ TRACE(1, ("ntp_set_tod: settimeofday: %d %m\n", rc));
+ if (!tod && !rc)
+ tod = SET_TOD_SETTIMEOFDAY;
+ }
+#endif /* HAVE_SETTIMEOFDAY */
+#ifdef HAVE_STIME
+ if (rc && (SET_TOD_STIME == tod || !tod)) {
+ long tp = tvp->tv_sec;
+
+ errno = 0;
+ rc = stime(&tp); /* lie as bad as SysVR4 */
+ saved_errno = errno;
+ TRACE(1, ("ntp_set_tod: stime: %d %m\n", rc));
+ if (!tod && !rc)
+ tod = SET_TOD_STIME;
+ }
+#endif /* HAVE_STIME */
+
+ errno = saved_errno; /* for %m below */
+ TRACE(1, ("ntp_set_tod: Final result: %s: %d %m\n",
+ set_tod_used[tod], rc));
+ /*
+ * Say how we're setting the time of day
+ */
+ if (!rc && NULL != set_tod_using) {
+ (*set_tod_using)(set_tod_used[tod]);
+ set_tod_using = NULL;
+ }
+
+ if (rc)
+ errno = saved_errno;
+
+ return rc;
+}
+
+#endif /* not SYS_WINNT */
+
+#if defined (SYS_WINNT) || defined (SYS_VXWORKS) || defined(MPE)
+/* getpass is used in ntpq.c and ntpdc.c */
+
+char *
+getpass(const char * prompt)
+{
+ int c, i;
+ static char password[32];
+
+ fprintf(stderr, "%s", prompt);
+ fflush(stderr);
+
+ for (i=0; i<sizeof(password)-1 && ((c=_getch())!='\n' && c!='\r'); i++) {
+ password[i] = (char) c;
+ }
+ password[i] = '\0';
+
+ fputc('\n', stderr);
+ fflush(stderr);
+
+ return password;
+}
+#endif /* SYS_WINNT */
diff --git a/libntp/mktime.c b/libntp/mktime.c
new file mode 100644
index 0000000..50d2a08
--- /dev/null
+++ b/libntp/mktime.c
@@ -0,0 +1,310 @@
+/*
+ * Copyright (c) 1987, 1989 Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Arthur David Olson of the National Cancer Institute.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE. */
+
+/*static char *sccsid = "from: @(#)ctime.c 5.26 (Berkeley) 2/23/91";*/
+
+/*
+ * This implementation of mktime is lifted straight from the NetBSD (BSD 4.4)
+ * version. I modified it slightly to divorce it from the internals of the
+ * ctime library. Thus this version can't use details of the internal
+ * timezone state file to figure out strange unnormalized struct tm values,
+ * as might result from someone doing date math on the tm struct then passing
+ * it to mktime.
+ *
+ * It just does as well as it can at normalizing the tm input, then does a
+ * binary search of the time space using the system's localtime() function.
+ *
+ * The original binary search was defective in that it didn't consider the
+ * setting of tm_isdst when comparing tm values, causing the search to be
+ * flubbed for times near the dst/standard time changeover. The original
+ * code seems to make up for this by grubbing through the timezone info
+ * whenever the binary search barfed. Since I don't have that luxury in
+ * portable code, I have to take care of tm_isdst in the comparison routine.
+ * This requires knowing how many minutes offset dst is from standard time.
+ *
+ * So, if you live somewhere in the world where dst is not 60 minutes offset,
+ * and your vendor doesn't supply mktime(), you'll have to edit this variable
+ * by hand. Sorry about that.
+ */
+
+#include <config.h>
+#include "ntp_machine.h"
+
+#if !defined(HAVE_MKTIME) || ( !defined(HAVE_TIMEGM) && defined(WANT_TIMEGM) )
+
+#if SIZEOF_TIME_T >= 8
+#error libntp supplied mktime()/timegm() do not support 64-bit time_t
+#endif
+
+#ifndef DSTMINUTES
+#define DSTMINUTES 60
+#endif
+
+#define FALSE 0
+#define TRUE 1
+
+/* some constants from tzfile.h */
+#define SECSPERMIN 60
+#define MINSPERHOUR 60
+#define HOURSPERDAY 24
+#define DAYSPERWEEK 7
+#define DAYSPERNYEAR 365
+#define DAYSPERLYEAR 366
+#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
+#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
+#define MONSPERYEAR 12
+#define TM_YEAR_BASE 1900
+#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
+
+static int mon_lengths[2][MONSPERYEAR] = {
+ { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
+ { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+};
+
+static int year_lengths[2] = {
+ DAYSPERNYEAR, DAYSPERLYEAR
+};
+
+/*
+** Adapted from code provided by Robert Elz, who writes:
+** The "best" way to do mktime I think is based on an idea of Bob
+** Kridle's (so its said...) from a long time ago. (mtxinu!kridle now).
+** It does a binary search of the time_t space. Since time_t's are
+** just 32 bits, its a max of 32 iterations (even at 64 bits it
+** would still be very reasonable).
+*/
+
+#ifndef WRONG
+#define WRONG (-1)
+#endif /* !defined WRONG */
+
+static void
+normalize(
+ int * tensptr,
+ int * unitsptr,
+ int base
+ )
+{
+ if (*unitsptr >= base) {
+ *tensptr += *unitsptr / base;
+ *unitsptr %= base;
+ } else if (*unitsptr < 0) {
+ --*tensptr;
+ *unitsptr += base;
+ if (*unitsptr < 0) {
+ *tensptr -= 1 + (-*unitsptr) / base;
+ *unitsptr = base - (-*unitsptr) % base;
+ }
+ }
+}
+
+static struct tm *
+mkdst(
+ struct tm * tmp
+ )
+{
+ /* jds */
+ static struct tm tmbuf;
+
+ tmbuf = *tmp;
+ tmbuf.tm_isdst = 1;
+ tmbuf.tm_min += DSTMINUTES;
+ normalize(&tmbuf.tm_hour, &tmbuf.tm_min, MINSPERHOUR);
+ return &tmbuf;
+}
+
+static int
+tmcomp(
+ register struct tm * atmp,
+ register struct tm * btmp
+ )
+{
+ register int result;
+
+ /* compare down to the same day */
+
+ if ((result = (atmp->tm_year - btmp->tm_year)) == 0 &&
+ (result = (atmp->tm_mon - btmp->tm_mon)) == 0)
+ result = (atmp->tm_mday - btmp->tm_mday);
+
+ if(result != 0)
+ return result;
+
+ /* get rid of one-sided dst bias */
+
+ if(atmp->tm_isdst == 1 && !btmp->tm_isdst)
+ btmp = mkdst(btmp);
+ else if(btmp->tm_isdst == 1 && !atmp->tm_isdst)
+ atmp = mkdst(atmp);
+
+ /* compare the rest of the way */
+
+ if ((result = (atmp->tm_hour - btmp->tm_hour)) == 0 &&
+ (result = (atmp->tm_min - btmp->tm_min)) == 0)
+ result = atmp->tm_sec - btmp->tm_sec;
+ return result;
+}
+
+
+static time_t
+time2(
+ struct tm * tmp,
+ int * okayp,
+ int usezn
+ )
+{
+ register int dir;
+ register int bits;
+ register int i;
+ register int saved_seconds;
+ time_t t;
+ struct tm yourtm, mytm;
+
+ *okayp = FALSE;
+ yourtm = *tmp;
+ if (yourtm.tm_sec >= SECSPERMIN + 2 || yourtm.tm_sec < 0)
+ normalize(&yourtm.tm_min, &yourtm.tm_sec, SECSPERMIN);
+ normalize(&yourtm.tm_hour, &yourtm.tm_min, MINSPERHOUR);
+ normalize(&yourtm.tm_mday, &yourtm.tm_hour, HOURSPERDAY);
+ normalize(&yourtm.tm_year, &yourtm.tm_mon, MONSPERYEAR);
+ while (yourtm.tm_mday <= 0) {
+ --yourtm.tm_year;
+ yourtm.tm_mday +=
+ year_lengths[isleap(yourtm.tm_year + TM_YEAR_BASE)];
+ }
+ for ( ; ; ) {
+ i = mon_lengths[isleap(yourtm.tm_year +
+ TM_YEAR_BASE)][yourtm.tm_mon];
+ if (yourtm.tm_mday <= i)
+ break;
+ yourtm.tm_mday -= i;
+ if (++yourtm.tm_mon >= MONSPERYEAR) {
+ yourtm.tm_mon = 0;
+ ++yourtm.tm_year;
+ }
+ }
+ saved_seconds = yourtm.tm_sec;
+ yourtm.tm_sec = 0;
+ /*
+ ** Calculate the number of magnitude bits in a time_t
+ ** (this works regardless of whether time_t is
+ ** signed or unsigned, though lint complains if unsigned).
+ */
+ for (bits = 0, t = 1; t > 0; ++bits, t <<= 1)
+ ;
+ /*
+ ** If time_t is signed, then 0 is the median value,
+ ** if time_t is unsigned, then 1 << bits is median.
+ */
+ t = (t < 0) ? 0 : ((time_t) 1 << bits);
+ for ( ; ; ) {
+ if (usezn)
+ mytm = *localtime(&t);
+ else
+ mytm = *gmtime(&t);
+ dir = tmcomp(&mytm, &yourtm);
+ if (dir != 0) {
+ if (bits-- < 0)
+ return WRONG;
+ if (bits < 0)
+ --t;
+ else if (dir > 0)
+ t -= (time_t) 1 << bits;
+ else t += (time_t) 1 << bits;
+ continue;
+ }
+ if (yourtm.tm_isdst < 0 || mytm.tm_isdst == yourtm.tm_isdst)
+ break;
+
+ return WRONG;
+ }
+ t += saved_seconds;
+ if (usezn)
+ *tmp = *localtime(&t);
+ else
+ *tmp = *gmtime(&t);
+ *okayp = TRUE;
+ return t;
+}
+#else
+int mktime_bs;
+#endif /* !HAVE_MKTIME || !HAVE_TIMEGM */
+
+#ifndef HAVE_MKTIME
+static time_t
+time1(
+ struct tm * tmp
+ )
+{
+ register time_t t;
+ int okay;
+
+ if (tmp->tm_isdst > 1)
+ tmp->tm_isdst = 1;
+ t = time2(tmp, &okay, 1);
+ if (okay || tmp->tm_isdst < 0)
+ return t;
+
+ return WRONG;
+}
+
+time_t
+mktime(
+ struct tm * tmp
+ )
+{
+ return time1(tmp);
+}
+#endif /* !HAVE_MKTIME */
+
+#ifdef WANT_TIMEGM
+#ifndef HAVE_TIMEGM
+time_t
+timegm(
+ struct tm * tmp
+ )
+{
+ register time_t t;
+ int okay;
+
+ tmp->tm_isdst = 0;
+ t = time2(tmp, &okay, 0);
+ if (okay || tmp->tm_isdst < 0)
+ return t;
+
+ return WRONG;
+}
+#endif /* !HAVE_TIMEGM */
+#endif /* WANT_TIMEGM */
diff --git a/libntp/modetoa.c b/libntp/modetoa.c
new file mode 100644
index 0000000..b476bc9
--- /dev/null
+++ b/libntp/modetoa.c
@@ -0,0 +1,35 @@
+/*
+ * modetoa - return an asciized mode
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+
+const char *
+modetoa(
+ int mode
+ )
+{
+ char *bp;
+ static const char * const modestrings[] = {
+ "unspec",
+ "sym_active",
+ "sym_passive",
+ "client",
+ "server",
+ "broadcast",
+ "control",
+ "private",
+ "bclient",
+ };
+
+ if (mode < 0 || mode >= COUNTOF(modestrings)) {
+ LIB_GETBUF(bp);
+ snprintf(bp, LIB_BUFLENGTH, "mode#%d", mode);
+ return bp;
+ }
+
+ return modestrings[mode];
+}
diff --git a/libntp/mstolfp.c b/libntp/mstolfp.c
new file mode 100644
index 0000000..1a1a02b
--- /dev/null
+++ b/libntp/mstolfp.c
@@ -0,0 +1,101 @@
+/*
+ * mstolfp - convert an ascii string in milliseconds to an l_fp number
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntp_fp.h"
+#include "ntp_stdlib.h"
+
+int
+mstolfp(
+ const char *str,
+ l_fp *lfp
+ )
+{
+ register const char *cp;
+ register char *bp;
+ register const char *cpdec;
+ char buf[100];
+
+ /*
+ * We understand numbers of the form:
+ *
+ * [spaces][-][digits][.][digits][spaces|\n|\0]
+ *
+ * This is one enormous hack. Since I didn't feel like
+ * rewriting the decoding routine for milliseconds, what
+ * is essentially done here is to make a copy of the string
+ * with the decimal moved over three places so the seconds
+ * decoding routine can be used.
+ */
+ bp = buf;
+ cp = str;
+ while (isspace((int)*cp))
+ cp++;
+
+ if (*cp == '-') {
+ *bp++ = '-';
+ cp++;
+ }
+
+ if (*cp != '.' && !isdigit((int)*cp))
+ return 0;
+
+
+ /*
+ * Search forward for the decimal point or the end of the string.
+ */
+ cpdec = cp;
+ while (isdigit((int)*cpdec))
+ cpdec++;
+
+ /*
+ * Found something. If we have more than three digits copy the
+ * excess over, else insert a leading 0.
+ */
+ if ((cpdec - cp) > 3) {
+ do {
+ *bp++ = (char)*cp++;
+ } while ((cpdec - cp) > 3);
+ } else {
+ *bp++ = '0';
+ }
+
+ /*
+ * Stick the decimal in. If we've got less than three digits in
+ * front of the millisecond decimal we insert the appropriate number
+ * of zeros.
+ */
+ *bp++ = '.';
+ if ((cpdec - cp) < 3) {
+ register int i = 3 - (cpdec - cp);
+
+ do {
+ *bp++ = '0';
+ } while (--i > 0);
+ }
+
+ /*
+ * Copy the remainder up to the millisecond decimal. If cpdec
+ * is pointing at a decimal point, copy in the trailing number too.
+ */
+ while (cp < cpdec)
+ *bp++ = (char)*cp++;
+
+ if (*cp == '.') {
+ cp++;
+ while (isdigit((int)*cp))
+ *bp++ = (char)*cp++;
+ }
+ *bp = '\0';
+
+ /*
+ * Check to make sure the string is properly terminated. If
+ * so, give the buffer to the decoding routine.
+ */
+ if (*cp != '\0' && !isspace((int)*cp))
+ return 0;
+ return atolfp(buf, lfp);
+}
diff --git a/libntp/msyslog.c b/libntp/msyslog.c
new file mode 100644
index 0000000..283414d
--- /dev/null
+++ b/libntp/msyslog.c
@@ -0,0 +1,572 @@
+/*
+ * msyslog - either send a message to the terminal or print it on
+ * the standard output.
+ *
+ * Converted to use varargs, much better ... jks
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+
+#include "ntp_string.h"
+#include "ntp.h"
+#include "ntp_debug.h"
+#include "ntp_syslog.h"
+
+#ifdef SYS_WINNT
+# include <stdarg.h>
+# include "..\ports\winnt\libntp\messages.h"
+#endif
+
+
+int syslogit = TRUE;
+int msyslog_term = FALSE; /* duplicate to stdout/err */
+int msyslog_term_pid = TRUE;
+int msyslog_include_timestamp = TRUE;
+FILE * syslog_file;
+char * syslog_fname;
+char * syslog_abs_fname;
+
+/* libntp default ntp_syslogmask is all bits lit */
+#define INIT_NTP_SYSLOGMASK ~(u_int32)0
+u_int32 ntp_syslogmask = INIT_NTP_SYSLOGMASK;
+
+extern char * progname;
+
+/* Declare the local functions */
+void addto_syslog (int, const char *);
+#ifndef VSNPRINTF_PERCENT_M
+void format_errmsg (char *, size_t, const char *, int);
+
+/* format_errmsg() is under #ifndef VSNPRINTF_PERCENT_M above */
+void
+format_errmsg(
+ char * nfmt,
+ size_t lennfmt,
+ const char * fmt,
+ int errval
+ )
+{
+ char errmsg[256];
+ char c;
+ char *n;
+ const char *f;
+ size_t len;
+
+ n = nfmt;
+ f = fmt;
+ while ((c = *f++) != '\0' && n < (nfmt + lennfmt - 1)) {
+ if (c != '%') {
+ *n++ = c;
+ continue;
+ }
+ if ((c = *f++) != 'm') {
+ *n++ = '%';
+ if ('\0' == c)
+ break;
+ *n++ = c;
+ continue;
+ }
+ errno_to_str(errval, errmsg, sizeof(errmsg));
+ len = strlen(errmsg);
+
+ /* Make sure we have enough space for the error message */
+ if ((n + len) < (nfmt + lennfmt - 1)) {
+ memcpy(n, errmsg, len);
+ n += len;
+ }
+ }
+ *n = '\0';
+}
+#endif /* VSNPRINTF_PERCENT_M */
+
+
+/*
+ * errno_to_str() - a thread-safe strerror() replacement.
+ * Hides the varied signatures of strerror_r().
+ * For Windows, we have:
+ * #define errno_to_str isc_strerror
+ */
+#ifndef errno_to_str
+void
+errno_to_str(
+ int err,
+ char * buf,
+ size_t bufsiz
+ )
+{
+# if defined(STRERROR_R_CHAR_P) || !HAVE_DECL_STRERROR_R
+ char * pstatic;
+
+ buf[0] = '\0';
+# ifdef STRERROR_R_CHAR_P
+ pstatic = strerror_r(err, buf, bufsiz);
+# else
+ pstatic = strerror(err);
+# endif
+ if (NULL == pstatic && '\0' == buf[0])
+ snprintf(buf, bufsiz, "%s(%d): errno %d",
+# ifdef STRERROR_R_CHAR_P
+ "strerror_r",
+# else
+ "strerror",
+# endif
+ err, errno);
+ /* protect against believing an int return is a pointer */
+ else if (pstatic != buf && pstatic > (char *)bufsiz)
+ strlcpy(buf, pstatic, bufsiz);
+# else
+ int rc;
+
+ rc = strerror_r(err, buf, bufsiz);
+ if (rc < 0)
+ snprintf(buf, bufsiz, "strerror_r(%d): errno %d",
+ err, errno);
+# endif
+}
+#endif /* errno_to_str */
+
+
+/*
+ * addto_syslog()
+ * This routine adds the contents of a buffer to the syslog or an
+ * application-specific logfile.
+ */
+void
+addto_syslog(
+ int level,
+ const char * msg
+ )
+{
+ static char * prevcall_progname;
+ static char * prog;
+ const char nl[] = "\n";
+ const char empty[] = "";
+ FILE * term_file;
+ int log_to_term;
+ int log_to_file;
+ int pid;
+ const char * nl_or_empty;
+ const char * human_time;
+
+ /* setup program basename static var prog if needed */
+ if (progname != prevcall_progname) {
+ prevcall_progname = progname;
+ prog = strrchr(progname, DIR_SEP);
+ if (prog != NULL)
+ prog++;
+ else
+ prog = progname;
+ }
+
+ log_to_term = msyslog_term;
+ log_to_file = FALSE;
+#if !defined(VMS) && !defined(SYS_VXWORKS)
+ if (syslogit)
+ syslog(level, "%s", msg);
+ else
+#endif
+ if (syslog_file != NULL)
+ log_to_file = TRUE;
+ else
+ log_to_term = TRUE;
+#if DEBUG
+ if (debug > 0)
+ log_to_term = TRUE;
+#endif
+ if (!(log_to_file || log_to_term))
+ return;
+
+ /* syslog() adds the timestamp, name, and pid */
+ if (msyslog_include_timestamp)
+ human_time = humanlogtime();
+ else /* suppress gcc pot. uninit. warning */
+ human_time = NULL;
+ if (msyslog_term_pid || log_to_file)
+ pid = getpid();
+ else /* suppress gcc pot. uninit. warning */
+ pid = -1;
+
+ /* syslog() adds trailing \n if not present */
+ if ('\n' != msg[strlen(msg) - 1])
+ nl_or_empty = nl;
+ else
+ nl_or_empty = empty;
+
+ if (log_to_term) {
+ term_file = (level <= LOG_ERR)
+ ? stderr
+ : stdout;
+ if (msyslog_include_timestamp)
+ fprintf(term_file, "%s ", human_time);
+ if (msyslog_term_pid)
+ fprintf(term_file, "%s[%d]: ", prog, pid);
+ fprintf(term_file, "%s%s", msg, nl_or_empty);
+ fflush(term_file);
+ }
+
+ if (log_to_file) {
+ if (msyslog_include_timestamp)
+ fprintf(syslog_file, "%s ", human_time);
+ fprintf(syslog_file, "%s[%d]: %s%s", prog, pid, msg,
+ nl_or_empty);
+ fflush(syslog_file);
+ }
+}
+
+
+int
+mvsnprintf(
+ char * buf,
+ size_t bufsiz,
+ const char * fmt,
+ va_list ap
+ )
+{
+#ifndef VSNPRINTF_PERCENT_M
+ char nfmt[256];
+#else
+ const char * nfmt = fmt;
+#endif
+ int errval;
+
+ /*
+ * Save the error value as soon as possible
+ */
+#ifdef SYS_WINNT
+ errval = GetLastError();
+ if (NO_ERROR == errval)
+#endif /* SYS_WINNT */
+ errval = errno;
+
+#ifndef VSNPRINTF_PERCENT_M
+ format_errmsg(nfmt, sizeof(nfmt), fmt, errval);
+#else
+ errno = errval;
+#endif
+ return vsnprintf(buf, bufsiz, nfmt, ap);
+}
+
+
+int
+mvfprintf(
+ FILE * fp,
+ const char * fmt,
+ va_list ap
+ )
+{
+#ifndef VSNPRINTF_PERCENT_M
+ char nfmt[256];
+#else
+ const char * nfmt = fmt;
+#endif
+ int errval;
+
+ /*
+ * Save the error value as soon as possible
+ */
+#ifdef SYS_WINNT
+ errval = GetLastError();
+ if (NO_ERROR == errval)
+#endif /* SYS_WINNT */
+ errval = errno;
+
+#ifndef VSNPRINTF_PERCENT_M
+ format_errmsg(nfmt, sizeof(nfmt), fmt, errval);
+#else
+ errno = errval;
+#endif
+ return vfprintf(fp, nfmt, ap);
+}
+
+
+int
+mfprintf(
+ FILE * fp,
+ const char * fmt,
+ ...
+ )
+{
+ va_list ap;
+ int rc;
+
+ va_start(ap, fmt);
+ rc = mvfprintf(fp, fmt, ap);
+ va_end(ap);
+
+ return rc;
+}
+
+
+int
+mprintf(
+ const char * fmt,
+ ...
+ )
+{
+ va_list ap;
+ int rc;
+
+ va_start(ap, fmt);
+ rc = mvfprintf(stdout, fmt, ap);
+ va_end(ap);
+
+ return rc;
+}
+
+
+int
+msnprintf(
+ char * buf,
+ size_t bufsiz,
+ const char * fmt,
+ ...
+ )
+{
+ va_list ap;
+ size_t rc;
+
+ va_start(ap, fmt);
+ rc = mvsnprintf(buf, bufsiz, fmt, ap);
+ va_end(ap);
+
+ return rc;
+}
+
+
+void
+msyslog(
+ int level,
+ const char * fmt,
+ ...
+ )
+{
+ char buf[1024];
+ va_list ap;
+
+ va_start(ap, fmt);
+ mvsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ addto_syslog(level, buf);
+}
+
+
+/*
+ * Initialize the logging
+ *
+ * Called once per process, including forked children.
+ */
+void
+init_logging(
+ const char * name,
+ u_int32 def_syslogmask,
+ int is_daemon
+ )
+{
+ static int was_daemon;
+ const char * cp;
+ const char * pname;
+
+ /*
+ * ntpd defaults to only logging sync-category events, when
+ * NLOG() is used to conditionalize. Other libntp clients
+ * leave it alone so that all NLOG() conditionals will fire.
+ * This presumes all bits lit in ntp_syslogmask can't be
+ * configured via logconfig and all lit is thereby a sentinel
+ * that ntp_syslogmask is still at its default from libntp,
+ * keeping in mind this function is called in forked children
+ * where it has already been called in the parent earlier.
+ * Forked children pass 0 for def_syslogmask.
+ */
+ if (INIT_NTP_SYSLOGMASK == ntp_syslogmask &&
+ 0 != def_syslogmask)
+ ntp_syslogmask = def_syslogmask; /* set more via logconfig */
+
+ /*
+ * Logging. This may actually work on the gizmo board. Find a name
+ * to log with by using the basename
+ */
+ cp = strrchr(name, DIR_SEP);
+ if (NULL == cp)
+ pname = name;
+ else
+ pname = 1 + cp; /* skip DIR_SEP */
+ progname = estrdup(pname);
+#ifdef SYS_WINNT /* strip ".exe" */
+ cp = strrchr(progname, '.');
+ if (NULL != cp && !strcasecmp(cp, ".exe"))
+ progname[cp - progname] = '\0';
+#endif
+
+#if !defined(VMS)
+
+ if (is_daemon)
+ was_daemon = TRUE;
+# ifndef LOG_DAEMON
+ openlog(progname, LOG_PID);
+# else /* LOG_DAEMON */
+
+# ifndef LOG_NTP
+# define LOG_NTP LOG_DAEMON
+# endif
+ openlog(progname, LOG_PID | LOG_NDELAY, (was_daemon)
+ ? LOG_NTP
+ : 0);
+# ifdef DEBUG
+ if (debug)
+ setlogmask(LOG_UPTO(LOG_DEBUG));
+ else
+# endif /* DEBUG */
+ setlogmask(LOG_UPTO(LOG_DEBUG)); /* @@@ was INFO */
+# endif /* LOG_DAEMON */
+#endif /* !VMS */
+}
+
+
+/*
+ * change_logfile()
+ *
+ * Used to change from syslog to a logfile, or from one logfile to
+ * another, and to reopen logfiles after forking. On systems where
+ * ntpd forks, deals with converting relative logfile paths to
+ * absolute (root-based) because we reopen logfiles after the current
+ * directory has changed.
+ */
+int
+change_logfile(
+ const char * fname,
+ int leave_crumbs
+ )
+{
+ FILE * new_file;
+ const char * log_fname;
+ char * abs_fname;
+#if !defined(SYS_WINNT) && !defined(SYS_VXWORKS) && !defined(VMS)
+ char curdir[512];
+ size_t cd_octets;
+ size_t octets;
+#endif /* POSIX */
+
+ NTP_REQUIRE(fname != NULL);
+ log_fname = fname;
+
+ /*
+ * In a forked child of a parent which is logging to a file
+ * instead of syslog, syslog_file will be NULL and both
+ * syslog_fname and syslog_abs_fname will be non-NULL.
+ * If we are given the same filename previously opened
+ * and it's still open, there's nothing to do here.
+ */
+ if (syslog_file != NULL && syslog_fname != NULL &&
+ 0 == strcmp(syslog_fname, log_fname))
+ return 0;
+
+ if (0 == strcmp(log_fname, "stderr")) {
+ new_file = stderr;
+ abs_fname = estrdup(log_fname);
+ } else if (0 == strcmp(log_fname, "stdout")) {
+ new_file = stdout;
+ abs_fname = estrdup(log_fname);
+ } else {
+ if (syslog_fname != NULL &&
+ 0 == strcmp(log_fname, syslog_fname))
+ log_fname = syslog_abs_fname;
+#if !defined(SYS_WINNT) && !defined(SYS_VXWORKS) && !defined(VMS)
+ if (log_fname != syslog_abs_fname &&
+ DIR_SEP != log_fname[0] &&
+ 0 != strcmp(log_fname, "stderr") &&
+ 0 != strcmp(log_fname, "stdout") &&
+ NULL != getcwd(curdir, sizeof(curdir))) {
+ cd_octets = strlen(curdir);
+ /* trim any trailing '/' */
+ if (cd_octets > 1 &&
+ DIR_SEP == curdir[cd_octets - 1])
+ cd_octets--;
+ octets = cd_octets;
+ octets += 1; /* separator '/' */
+ octets += strlen(log_fname);
+ octets += 1; /* NUL terminator */
+ abs_fname = emalloc(octets);
+ snprintf(abs_fname, octets, "%.*s%c%s",
+ (int)cd_octets, curdir, DIR_SEP,
+ log_fname);
+ } else
+#endif
+ abs_fname = estrdup(log_fname);
+ TRACE(1, ("attempting to open log %s\n", abs_fname));
+ new_file = fopen(abs_fname, "a");
+ }
+
+ if (NULL == new_file) {
+ free(abs_fname);
+ return -1;
+ }
+
+ /* leave a pointer in the old log */
+ if (leave_crumbs && (syslogit || log_fname != syslog_abs_fname))
+ msyslog(LOG_NOTICE, "switching logging to file %s",
+ abs_fname);
+
+ if (syslog_file != NULL &&
+ syslog_file != stderr && syslog_file != stdout &&
+ fileno(syslog_file) != fileno(new_file))
+ fclose(syslog_file);
+ syslog_file = new_file;
+ if (log_fname == syslog_abs_fname) {
+ free(abs_fname);
+ } else {
+ if (syslog_abs_fname != NULL &&
+ syslog_abs_fname != syslog_fname)
+ free(syslog_abs_fname);
+ if (syslog_fname != NULL)
+ free(syslog_fname);
+ syslog_fname = estrdup(log_fname);
+ syslog_abs_fname = abs_fname;
+ }
+ syslogit = FALSE;
+
+ return 0;
+}
+
+
+/*
+ * setup_logfile()
+ *
+ * Redirect logging to a file if requested with -l/--logfile or via
+ * ntp.conf logfile directive.
+ *
+ * This routine is invoked three different times in the sequence of a
+ * typical daemon ntpd with DNS lookups to do. First it is invoked in
+ * the original ntpd process, then again in the daemon after closing
+ * all descriptors. In both of those cases, ntp.conf has not been
+ * processed, so only -l/--logfile will trigger logfile redirection in
+ * those invocations. Finally, if DNS names are resolved, the worker
+ * child invokes this routine after its fork and close of all
+ * descriptors. In this case, ntp.conf has been processed and any
+ * "logfile" directive needs to be honored in the child as well.
+ */
+void
+setup_logfile(
+ const char * name
+ )
+{
+ if (NULL == syslog_fname && NULL != name) {
+ if (-1 == change_logfile(name, TRUE))
+ msyslog(LOG_ERR, "Cannot open log file %s, %m",
+ name);
+ return ;
+ }
+ if (NULL == syslog_fname)
+ return;
+
+ if (-1 == change_logfile(syslog_fname, FALSE))
+ msyslog(LOG_ERR, "Cannot reopen log file %s, %m",
+ syslog_fname);
+}
diff --git a/libntp/netof.c b/libntp/netof.c
new file mode 100644
index 0000000..c8831c3
--- /dev/null
+++ b/libntp/netof.c
@@ -0,0 +1,55 @@
+/*
+ * netof - return the net address part of an ip address in a sockaddr_storage structure
+ * (zero out host part)
+ */
+#include <config.h>
+#include <stdio.h>
+#include <syslog.h>
+
+#include "ntp_fp.h"
+#include "ntp_net.h"
+#include "ntp_stdlib.h"
+#include "ntp.h"
+
+sockaddr_u *
+netof(
+ sockaddr_u *hostaddr
+ )
+{
+ static sockaddr_u netofbuf[8];
+ static int next_netofbuf;
+ u_int32 netnum;
+ sockaddr_u * netaddr;
+
+ netaddr = &netofbuf[next_netofbuf];
+ next_netofbuf = (next_netofbuf + 1) % COUNTOF(netofbuf);
+
+ memcpy(netaddr, hostaddr, sizeof(*netaddr));
+
+ if (IS_IPV4(netaddr)) {
+ netnum = SRCADR(netaddr);
+
+ /*
+ * We live in a modern CIDR world where the basement nets, which
+ * used to be class A, are now probably associated with each
+ * host address. So, for class-A nets, all bits are significant.
+ */
+ if (IN_CLASSC(netnum))
+ netnum &= IN_CLASSC_NET;
+ else if (IN_CLASSB(netnum))
+ netnum &= IN_CLASSB_NET;
+
+ SET_ADDR4(netaddr, netnum);
+
+ } else if (IS_IPV6(netaddr))
+ /* assume the typical /64 subnet size */
+ zero_mem(&NSRCADR6(netaddr)[8], 8);
+#ifdef DEBUG
+ else {
+ msyslog(LOG_ERR, "netof unknown AF %d", AF(netaddr));
+ exit(1);
+ }
+#endif
+
+ return netaddr;
+}
diff --git a/libntp/ntp_calendar.c b/libntp/ntp_calendar.c
new file mode 100644
index 0000000..e557f4e
--- /dev/null
+++ b/libntp/ntp_calendar.c
@@ -0,0 +1,1615 @@
+/*
+ * ntp_calendar.c - calendar and helper functions
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ */
+#include <config.h>
+#include <sys/types.h>
+
+#include "ntp_types.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+
+/*
+ *---------------------------------------------------------------------
+ * replacing the 'time()' function
+ * --------------------------------------------------------------------
+ */
+
+static systime_func_ptr systime_func = &time;
+static inline time_t now(void);
+
+
+systime_func_ptr
+ntpcal_set_timefunc(
+ systime_func_ptr nfunc
+ )
+{
+ systime_func_ptr res;
+
+ res = systime_func;
+ if (NULL == nfunc)
+ nfunc = &time;
+ systime_func = nfunc;
+
+ return res;
+}
+
+
+static inline time_t
+now(void)
+{
+ return (*systime_func)(NULL);
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert between 'time_t' and 'vint64'
+ *---------------------------------------------------------------------
+ */
+vint64
+time_to_vint64(
+ const time_t * ptt
+ )
+{
+ vint64 res;
+ time_t tt;
+
+ tt = *ptt;
+
+#if SIZEOF_TIME_T <= 4
+
+ res.D_s.hi = 0;
+ if (tt < 0) {
+ res.D_s.lo = (uint32_t)-tt;
+ M_NEG(res.D_s.hi, res.D_s.lo);
+ } else {
+ res.D_s.lo = (uint32_t)tt;
+ }
+
+#elif defined(HAVE_INT64)
+
+ res.q_s = tt;
+
+#else
+ /*
+ * shifting negative signed quantities is compiler-dependent, so
+ * we better avoid it and do it all manually. And shifting more
+ * than the width of a quantity is undefined. Also a don't do!
+ */
+ if (tt < 0) {
+ tt = -tt;
+ res.D_s.lo = (uint32_t)tt;
+ res.D_s.hi = (uint32_t)(tt >> 32);
+ M_NEG(res.D_s.hi, res.D_s.lo);
+ } else {
+ res.D_s.lo = (uint32_t)tt;
+ res.D_s.hi = (uint32_t)(tt >> 32);
+ }
+
+#endif
+
+ return res;
+}
+
+
+time_t
+vint64_to_time(
+ const vint64 *tv
+ )
+{
+ time_t res;
+
+#if SIZEOF_TIME_T <= 4
+
+ res = (time_t)tv->D_s.lo;
+
+#elif defined(HAVE_INT64)
+
+ res = (time_t)tv->q_s;
+
+#else
+
+ res = ((time_t)tv->d_s.hi << 32) | tv->D_s.lo;
+
+#endif
+
+ return res;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Get the build date & time
+ *---------------------------------------------------------------------
+ */
+int
+ntpcal_get_build_date(
+ struct calendar * jd
+ )
+{
+ /* The C standard tells us the format of '__DATE__':
+ *
+ * __DATE__ The date of translation of the preprocessing
+ * translation unit: a character string literal of the form "Mmm
+ * dd yyyy", where the names of the months are the same as those
+ * generated by the asctime function, and the first character of
+ * dd is a space character if the value is less than 10. If the
+ * date of translation is not available, an
+ * implementation-defined valid date shall be supplied.
+ *
+ * __TIME__ The time of translation of the preprocessing
+ * translation unit: a character string literal of the form
+ * "hh:mm:ss" as in the time generated by the asctime
+ * function. If the time of translation is not available, an
+ * implementation-defined valid time shall be supplied.
+ *
+ * Note that MSVC declares DATE and TIME to be in the local time
+ * zone, while neither the C standard nor the GCC docs make any
+ * statement about this. As a result, we may be +/-12hrs off
+ * UTC. But for practical purposes, this should not be a
+ * problem.
+ *
+ */
+ static const char build[] = __TIME__ "/" __DATE__;
+ static const char mlist[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
+
+ char monstr[4];
+ const char * cp;
+ unsigned short hour, minute, second, day, year;
+ /* Note: The above quantities are used for sscanf 'hu' format,
+ * so using 'uint16_t' is contra-indicated!
+ */
+
+#ifdef DEBUG
+ static int ignore = 0;
+#endif
+
+ ZERO(*jd);
+ jd->year = 1970;
+ jd->month = 1;
+ jd->monthday = 1;
+
+#ifdef DEBUG
+ /* check environment if build date should be ignored */
+ if (0 == ignore) {
+ const char * envstr;
+ envstr = getenv("NTPD_IGNORE_BUILD_DATE");
+ ignore = 1 + (envstr && (!*envstr || !strcasecmp(envstr, "yes")));
+ }
+ if (ignore > 1)
+ return FALSE;
+#endif
+
+ if (6 == sscanf(build, "%hu:%hu:%hu/%3s %hu %hu",
+ &hour, &minute, &second, monstr, &day, &year)) {
+ cp = strstr(mlist, monstr);
+ if (NULL != cp) {
+ jd->year = year;
+ jd->month = (uint8_t)((cp - mlist) / 3 + 1);
+ jd->monthday = (uint8_t)day;
+ jd->hour = (uint8_t)hour;
+ jd->minute = (uint8_t)minute;
+ jd->second = (uint8_t)second;
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+/*
+ *---------------------------------------------------------------------
+ * basic calendar stuff
+ * --------------------------------------------------------------------
+ */
+
+/* month table for a year starting with March,1st */
+static const uint16_t shift_month_table[13] = {
+ 0, 31, 61, 92, 122, 153, 184, 214, 245, 275, 306, 337, 366
+};
+
+/* month tables for years starting with January,1st; regular & leap */
+static const uint16_t 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 }
+};
+
+/*
+ * Some notes on the terminology:
+ *
+ * We use the proleptic Gregorian calendar, which is the Gregorian
+ * calendar extended in both directions ad infinitum. This totally
+ * disregards the fact that this calendar was invented in 1582, and
+ * was adopted at various dates over the world; sometimes even after
+ * the start of the NTP epoch.
+ *
+ * Normally date parts are given as current cycles, while time parts
+ * are given as elapsed cycles:
+ *
+ * 1970-01-01/03:04:05 means 'IN the 1970st. year, IN the first month,
+ * ON the first day, with 3hrs, 4minutes and 5 seconds elapsed.
+ *
+ * The basic calculations for this calendar implementation deal with
+ * ELAPSED date units, which is the number of full years, full months
+ * and full days before a date: 1970-01-01 would be (1969, 0, 0) in
+ * that notation.
+ *
+ * To ease the numeric computations, month and day values outside the
+ * normal range are acceptable: 2001-03-00 will be treated as the day
+ * before 2001-03-01, 2000-13-32 will give the same result as
+ * 2001-02-01 and so on.
+ *
+ * 'rd' or 'RD' is used as an abbreviation for the latin 'rata die'
+ * (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.
+ */
+
+
+/*
+ * ==================================================================
+ *
+ * General algorithmic stuff
+ *
+ * ==================================================================
+ */
+
+/*
+ *---------------------------------------------------------------------
+ * Do a periodic extension of 'value' around 'pivot' with a period of
+ * 'cycle'.
+ *
+ * The result 'res' is a number that holds to the following properties:
+ *
+ * 1) res MOD cycle == value MOD cycle
+ * 2) pivot <= res < pivot + cycle
+ * (replace </<= with >/>= for negative cycles)
+ *
+ * where 'MOD' denotes the modulo operator for FLOOR DIVISION, which
+ * is not the same as the '%' operator in C: C requires division to be
+ * a truncated division, where remainder and dividend have the same
+ * sign if the remainder is not zero, whereas floor division requires
+ * divider and modulus to have the same sign for a non-zero modulus.
+ *
+ * This function has some useful applications:
+ *
+ * + let Y be a calendar year and V a truncated 2-digit year: then
+ * periodic_extend(Y-50, V, 100)
+ * is the closest expansion of the truncated year with respect to
+ * the full year, that is a 4-digit year with a difference of less
+ * than 50 years to the year Y. ("century unfolding")
+ *
+ * + let T be a UN*X time stamp and V be seconds-of-day: then
+ * perodic_extend(T-43200, V, 86400)
+ * is a time stamp that has the same seconds-of-day as the input
+ * value, with an absolute difference to T of <= 12hrs. ("day
+ * unfolding")
+ *
+ * + Wherever you have a truncated periodic value and a non-truncated
+ * base value and you want to match them somehow...
+ *
+ * Basically, the function delivers 'pivot + (value - pivot) % cycle',
+ * but the implementation takes some pains to avoid internal signed
+ * integer overflows in the '(value - pivot) % cycle' part and adheres
+ * to the floor division convention.
+ *
+ * If 64bit scalars where available on all intended platforms, writing a
+ * version that uses 64 bit ops would be easy; writing a general
+ * division routine for 64bit ops on a platform that can only do
+ * 32/16bit divisions and is still performant is a bit more
+ * difficult. Since most usecases can be coded in a way that does only
+ * require the 32-bit version a 64bit version is NOT provided here.
+ * ---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_periodic_extend(
+ int32_t pivot,
+ int32_t value,
+ int32_t cycle
+ )
+{
+ uint32_t diff;
+ char cpl = 0; /* modulo complement flag */
+ char neg = 0; /* sign change flag */
+
+ /* make the cycle positive and adjust the flags */
+ if (cycle < 0) {
+ cycle = - cycle;
+ neg ^= 1;
+ cpl ^= 1;
+ }
+ /* guard against div by zero or one */
+ if (cycle > 1) {
+ /*
+ * 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!
+ */
+ if (value >= pivot) {
+ diff = (uint32_t)value - (uint32_t)pivot;
+ } else {
+ diff = (uint32_t)pivot - (uint32_t)value;
+ cpl ^= 1;
+ }
+ diff %= (uint32_t)cycle;
+ if (diff) {
+ if (cpl)
+ diff = cycle - diff;
+ if (neg)
+ diff = ~diff + 1;
+ pivot += diff;
+ }
+ }
+ return pivot;
+}
+
+/*
+ *-------------------------------------------------------------------
+ * Convert a timestamp in NTP scale to a 64bit seconds value in the UN*X
+ * scale with proper epoch unfolding around a given pivot or the current
+ * system time. This function happily accepts negative pivot values as
+ * timestamps befor 1970-01-01, so be aware of possible trouble on
+ * platforms with 32bit 'time_t'!
+ *
+ * This is also a periodic extension, but since the cycle is 2^32 and
+ * the shift is 2^31, we can do some *very* fast math without explicit
+ * divisions.
+ *-------------------------------------------------------------------
+ */
+vint64
+ntpcal_ntp_to_time(
+ uint32_t ntp,
+ const time_t * pivot
+ )
+{
+ vint64 res;
+
+#ifdef HAVE_INT64
+
+ res.q_s = (pivot != NULL)
+ ? *pivot
+ : now();
+ res.Q_s -= 0x80000000; /* unshift of half range */
+ ntp -= (uint32_t)JAN_1970; /* warp into UN*X domain */
+ ntp -= res.D_s.lo; /* cycle difference */
+ res.Q_s += (uint64_t)ntp; /* get expanded time */
+
+#else /* no 64bit scalars */
+
+ time_t tmp;
+
+ tmp = (pivot != NULL)
+ ? *pivot
+ : now();
+ res = time_to_vint64(&tmp);
+ M_SUB(res.D_s.hi, res.D_s.lo, 0, 0x80000000);
+ ntp -= (uint32_t)JAN_1970; /* warp into UN*X domain */
+ ntp -= res.D_s.lo; /* cycle difference */
+ M_ADD(res.D_s.hi, res.D_s.lo, 0, ntp);
+
+#endif /* no 64bit scalars */
+
+ return res;
+}
+
+/*
+ *-------------------------------------------------------------------
+ * Convert a timestamp in NTP scale to a 64bit seconds value in the NTP
+ * scale with proper epoch unfolding around a given pivot or the current
+ * system time.
+ *
+ * Note: The pivot must be given in the UN*X time domain!
+ *
+ * This is also a periodic extension, but since the cycle is 2^32 and
+ * the shift is 2^31, we can do some *very* fast math without explicit
+ * divisions.
+ *-------------------------------------------------------------------
+ */
+vint64
+ntpcal_ntp_to_ntp(
+ uint32_t ntp,
+ const time_t *pivot
+ )
+{
+ vint64 res;
+
+#ifdef HAVE_INT64
+
+ res.q_s = (pivot)
+ ? *pivot
+ : now();
+ res.Q_s -= 0x80000000; /* unshift of half range */
+ res.Q_s += (uint32_t)JAN_1970; /* warp into NTP domain */
+ ntp -= res.D_s.lo; /* cycle difference */
+ res.Q_s += (uint64_t)ntp; /* get expanded time */
+
+#else /* no 64bit scalars */
+
+ time_t tmp;
+
+ tmp = (pivot)
+ ? *pivot
+ : now();
+ res = time_to_vint64(&tmp);
+ M_SUB(res.D_s.hi, res.D_s.lo, 0, 0x80000000u);
+ M_ADD(res.D_s.hi, res.D_s.lo, 0, (uint32_t)JAN_1970);/*into NTP */
+ ntp -= res.D_s.lo; /* cycle difference */
+ M_ADD(res.D_s.hi, res.D_s.lo, 0, ntp);
+
+#endif /* no 64bit scalars */
+
+ return res;
+}
+
+
+/*
+ * ==================================================================
+ *
+ * Splitting values to composite entities
+ *
+ * ==================================================================
+ */
+
+/*
+ *-------------------------------------------------------------------
+ * Split a 64bit seconds value into elapsed days in 'res.hi' and
+ * elapsed seconds since midnight in 'res.lo' using explicit floor
+ * division. This function happily accepts negative time values as
+ * timestamps before the respective epoch start.
+ * -------------------------------------------------------------------
+ */
+ntpcal_split
+ntpcal_daysplit(
+ const vint64 *ts
+ )
+{
+ ntpcal_split res;
+
+#ifdef HAVE_INT64
+
+ /* 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;
+ }
+
+#else
+
+ /*
+ * 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.
+ */
+ vint64 op;
+ uint32_t q, r, a;
+ int isneg;
+
+ 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.
+ */
+ 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;
+
+#endif
+ return res;
+}
+
+/*
+ *-------------------------------------------------------------------
+ * Split a 32bit seconds value into h/m/s and excessive days. This
+ * function happily accepts negative time values as timestamps before
+ * midnight.
+ * -------------------------------------------------------------------
+ */
+static int32_t
+priv_timesplit(
+ int32_t split[3],
+ 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;
+ }
+ }
+
+ /* get secs, mins, hours */
+ split[2] = (uint8_t)(ts % SECSPERMIN);
+ ts /= SECSPERMIN;
+ split[1] = (uint8_t)(ts % MINSPERHR);
+ split[0] = (uint8_t)(ts / MINSPERHR);
+
+ return days;
+}
+
+/*
+ * ---------------------------------------------------------------------
+ * Given the number of elapsed days in the calendar era, split this
+ * number into the number of elapsed years in 'res.hi' and the number
+ * of elapsed days of that year in 'res.lo'.
+ *
+ * if 'isleapyear' is not NULL, it will receive an integer that is 0 for
+ * regular years and a non-zero value for leap years.
+ *---------------------------------------------------------------------
+ */
+ntpcal_split
+ntpcal_split_eradays(
+ int32_t days,
+ 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.
+ */
+ 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
+ */
+ 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;
+
+ return res;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Given a number of elapsed days in a year and a leap year indicator,
+ * split the number of elapsed days into the number of elapsed months in
+ * 'res.hi' and the number of elapsed days of that month in 'res.lo'.
+ *
+ * This function will fail and return {-1,-1} if the number of elapsed
+ * days is not in the valid range!
+ *---------------------------------------------------------------------
+ */
+ntpcal_split
+ntpcal_split_yeardays(
+ int32_t eyd,
+ int isleapyear
+ )
+{
+ ntpcal_split res;
+ const uint16_t *lt; /* month length table */
+
+ /* check leap year flag and select proper table */
+ lt = real_month_table[(isleapyear != 0)];
+ if (0 <= eyd && eyd < lt[12]) {
+ /* get zero-based month by approximation & correction step */
+ res.hi = eyd >> 5; /* approx month; might be 1 too low */
+ if (lt[res.hi + 1] <= eyd) /* fixup approximative month value */
+ res.hi += 1;
+ res.lo = eyd - lt[res.hi];
+ } else {
+ res.lo = res.hi = -1;
+ }
+
+ return res;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert a RD into the date part of a 'struct calendar'.
+ *---------------------------------------------------------------------
+ */
+int
+ntpcal_rd_to_date(
+ struct calendar *jd,
+ int32_t rd
+ )
+{
+ ntpcal_split split;
+ int leaps;
+ int retv;
+
+ leaps = 0;
+ retv = 0;
+ /* get day-of-week first */
+ 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->yearday = (uint16_t)split.lo + 1;
+
+ /* convert to month and mday */
+ split = ntpcal_split_yeardays(split.lo, leaps);
+ jd->month = (uint8_t)split.hi + 1;
+ jd->monthday = (uint8_t)split.lo + 1;
+
+ return retv ? retv : leaps;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert a RD into the date part of a 'struct tm'.
+ *---------------------------------------------------------------------
+ */
+int
+ntpcal_rd_to_tm(
+ struct tm *utm,
+ int32_t rd
+ )
+{
+ ntpcal_split split;
+ int leaps;
+
+ leaps = 0;
+ /* get day-of-week first */
+ utm->tm_wday = rd % 7;
+ if (utm->tm_wday < 0)
+ utm->tm_wday += 7;
+
+ /* get year and day-of-year */
+ split = ntpcal_split_eradays(rd - 1, &leaps);
+ 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);
+ utm->tm_mon = split.hi; /* 0-based */
+ utm->tm_mday = split.lo + 1; /* 1-based */
+
+ return leaps;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Take a value of seconds since midnight and split it into hhmmss in a
+ * 'struct calendar'.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_daysec_to_date(
+ struct calendar *jd,
+ int32_t sec
+ )
+{
+ int32_t days;
+ int ts[3];
+
+ days = priv_timesplit(ts, sec);
+ jd->hour = (uint8_t)ts[0];
+ jd->minute = (uint8_t)ts[1];
+ jd->second = (uint8_t)ts[2];
+
+ return days;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Take a value of seconds since midnight and split it into hhmmss in a
+ * 'struct tm'.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_daysec_to_tm(
+ struct tm *utm,
+ int32_t sec
+ )
+{
+ int32_t days;
+ int32_t ts[3];
+
+ days = priv_timesplit(ts, sec);
+ utm->tm_hour = ts[0];
+ utm->tm_min = ts[1];
+ utm->tm_sec = ts[2];
+
+ return days;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * take a split representation for day/second-of-day and day offset
+ * and convert it to a 'struct calendar'. The seconds will be normalised
+ * into the range of a day, and the day will be adjusted accordingly.
+ *
+ * returns >0 if the result is in a leap year, 0 if in a regular
+ * year and <0 if the result did not fit into the calendar struct.
+ *---------------------------------------------------------------------
+ */
+int
+ntpcal_daysplit_to_date(
+ struct calendar *jd,
+ const ntpcal_split *ds,
+ int32_t dof
+ )
+{
+ dof += ntpcal_daysec_to_date(jd, ds->lo);
+ return ntpcal_rd_to_date(jd, ds->hi + dof);
+}
+
+/*
+ *---------------------------------------------------------------------
+ * take a split representation for day/second-of-day and day offset
+ * and convert it to a 'struct tm'. The seconds will be normalised
+ * into the range of a day, and the day will be adjusted accordingly.
+ *
+ * returns 1 if the result is in a leap year and zero if in a regular
+ * year.
+ *---------------------------------------------------------------------
+ */
+int
+ntpcal_daysplit_to_tm(
+ struct tm *utm,
+ const ntpcal_split *ds ,
+ int32_t dof
+ )
+{
+ dof += ntpcal_daysec_to_tm(utm, ds->lo);
+
+ return ntpcal_rd_to_tm(utm, ds->hi + dof);
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Take a UN*X time and convert to a calendar structure.
+ *---------------------------------------------------------------------
+ */
+int
+ntpcal_time_to_date(
+ struct calendar *jd,
+ const vint64 *ts
+ )
+{
+ ntpcal_split ds;
+
+ ds = ntpcal_daysplit(ts);
+ ds.hi += ntpcal_daysec_to_date(jd, ds.lo);
+ ds.hi += DAY_UNIX_STARTS;
+
+ return ntpcal_rd_to_date(jd, ds.hi);
+}
+
+
+/*
+ * ==================================================================
+ *
+ * merging composite entities
+ *
+ * ==================================================================
+ */
+
+/*
+ *---------------------------------------------------------------------
+ * Merge a number of days and a number of seconds into seconds,
+ * expressed in 64 bits to avoid overflow.
+ *---------------------------------------------------------------------
+ */
+vint64
+ntpcal_dayjoin(
+ int32_t days,
+ int32_t secs
+ )
+{
+ vint64 res;
+
+#ifdef HAVE_INT64
+
+ res.q_s = days;
+ res.q_s *= SECSPERDAY;
+ res.q_s += secs;
+
+#else
+
+ uint32_t p1, p2;
+ int isneg;
+
+ /*
+ * res = days *86400 + secs, using manual 16/32 bit
+ * multiplications and shifts.
+ */
+ isneg = (days < 0);
+ if (isneg)
+ days = -days;
+
+ /* assemble days * 675 */
+ res.D_s.lo = (days & 0xFFFF) * 675u;
+ res.D_s.hi = 0;
+ p1 = (days >> 16) * 675u;
+ p2 = p1 >> 16;
+ p1 = p1 << 16;
+ M_ADD(res.D_s.hi, res.D_s.lo, p2, p1);
+
+ /* mul by 128, using shift */
+ res.D_s.hi = (res.D_s.hi << 7) | (res.D_s.lo >> 25);
+ res.D_s.lo = (res.D_s.lo << 7);
+
+ /* fix sign */
+ if (isneg)
+ M_NEG(res.D_s.hi, res.D_s.lo);
+
+ /* properly add seconds */
+ p2 = 0;
+ if (secs < 0) {
+ p1 = (uint32_t)-secs;
+ M_NEG(p2, p1);
+ } else {
+ p1 = (uint32_t)secs;
+ }
+ M_ADD(res.D_s.hi, res.D_s.lo, p2, p1);
+
+#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.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_days_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;
+ }
+
+ /*
+ * Calculate days in cycle. years now is a non-negative number,
+ * holding the number of years in the 400-year cycle.
+ */
+ 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 */
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert a number of elapsed month in a year into elapsed days in year.
+ *
+ * The month will be normalized, and 'res.hi' will contain the
+ * excessive years that must be considered when converting the years,
+ * while 'res.lo' will contain the number of elapsed days since start
+ * of the year.
+ *
+ * This code uses the shifted-month-approach to convert month to days,
+ * because then there is no need to have explicit leap year
+ * information. The slight disadvantage is that for most month values
+ * the result is a negative value, and the year excess is one; the
+ * conversion is then simply based on the start of the following year.
+ *---------------------------------------------------------------------
+ */
+ntpcal_split
+ntpcal_days_in_months(
+ int32_t m
+ )
+{
+ 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 10 month for year starting with march */
+ if (res.lo < 2)
+ res.lo += 10;
+ else {
+ res.hi += 1;
+ res.lo -= 2;
+ }
+
+ /* get cummulated days in year with unshift */
+ res.lo = shift_month_table[res.lo] - 306;
+
+ return res;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert ELAPSED years/months/days of gregorian calendar to elapsed
+ * days in Gregorian epoch.
+ *
+ * If you want to convert years and days-of-year, just give a month of
+ * zero.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_edate_to_eradays(
+ int32_t years,
+ int32_t mons,
+ int32_t mdays
+ )
+{
+ ntpcal_split tmp;
+ int32_t res;
+
+ if (mons) {
+ tmp = ntpcal_days_in_months(mons);
+ res = ntpcal_days_in_years(years + tmp.hi) + tmp.lo;
+ } else
+ res = ntpcal_days_in_years(years);
+ res += mdays;
+
+ return res;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert ELAPSED years/months/days of gregorian calendar to elapsed
+ * days in year.
+ *
+ * Note: This will give the true difference to the start of the given year,
+ * even if months & days are off-scale.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_edate_to_yeardays(
+ int32_t years,
+ int32_t mons,
+ int32_t mdays
+ )
+{
+ ntpcal_split tmp;
+
+ if (0 <= mons && mons < 12) {
+ years += 1;
+ mdays += real_month_table[is_leapyear(years)][mons];
+ } else {
+ tmp = ntpcal_days_in_months(mons);
+ mdays += tmp.lo
+ + ntpcal_days_in_years(years + tmp.hi)
+ - ntpcal_days_in_years(years);
+ }
+
+ return mdays;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert elapsed days and the hour/minute/second information into
+ * total seconds.
+ *
+ * If 'isvalid' is not NULL, do a range check on the time specification
+ * and tell if the time input is in the normal range, permitting for a
+ * single leapsecond.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_etime_to_seconds(
+ int32_t hours,
+ int32_t minutes,
+ int32_t seconds
+ )
+{
+ int32_t res;
+
+ res = (hours * MINSPERHR + minutes) * SECSPERMIN + seconds;
+
+ return res;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert the date part of a 'struct tm' (that is, year, month,
+ * day-of-month) into the RD of that day.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_tm_to_rd(
+ const struct tm *utm
+ )
+{
+ return ntpcal_edate_to_eradays(utm->tm_year + 1899,
+ utm->tm_mon,
+ utm->tm_mday - 1) + 1;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert the date part of a 'struct calendar' (that is, year, month,
+ * day-of-month) into the RD of that day.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_date_to_rd(
+ const struct calendar *jd
+ )
+{
+ return ntpcal_edate_to_eradays((int32_t)jd->year - 1,
+ (int32_t)jd->month - 1,
+ (int32_t)jd->monthday - 1) + 1;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * convert a year number to rata die of year start
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_year_to_ystart(
+ int32_t year
+ )
+{
+ return ntpcal_days_in_years(year - 1) + 1;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * For a given RD, get the RD of the associated year start,
+ * that is, the RD of the last January,1st on or before that day.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_rd_to_ystart(
+ int32_t rd
+ )
+{
+ /*
+ * Rather simple exercise: split the day number into elapsed
+ * years and elapsed days, then remove the elapsed days from the
+ * input value. Nice'n sweet...
+ */
+ return rd - ntpcal_split_eradays(rd - 1, NULL).lo;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * For a given RD, get the RD of the associated month start.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_rd_to_mstart(
+ int32_t rd
+ )
+{
+ ntpcal_split split;
+ int leaps;
+
+ split = ntpcal_split_eradays(rd - 1, &leaps);
+ split = ntpcal_split_yeardays(split.lo, leaps);
+
+ return rd - split.lo;
+}
+
+/*
+ *---------------------------------------------------------------------
+ * take a 'struct calendar' and get the seconds-of-day from it.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_date_to_daysec(
+ const struct calendar *jd
+ )
+{
+ return ntpcal_etime_to_seconds(jd->hour, jd->minute,
+ jd->second);
+}
+
+/*
+ *---------------------------------------------------------------------
+ * take a 'struct tm' and get the seconds-of-day from it.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_tm_to_daysec(
+ const struct tm *utm
+ )
+{
+ return ntpcal_etime_to_seconds(utm->tm_hour, utm->tm_min,
+ utm->tm_sec);
+}
+
+/*
+ *---------------------------------------------------------------------
+ * take a 'struct calendar' and convert it to a 'time_t'
+ *---------------------------------------------------------------------
+ */
+time_t
+ntpcal_date_to_time(
+ const struct calendar *jd
+ )
+{
+ vint64 join;
+ int32_t days, secs;
+
+ days = ntpcal_date_to_rd(jd) - DAY_UNIX_STARTS;
+ secs = ntpcal_date_to_daysec(jd);
+ join = ntpcal_dayjoin(days, secs);
+
+ return vint64_to_time(&join);
+}
+
+
+/*
+ * ==================================================================
+ *
+ * extended and unchecked variants of caljulian/caltontp
+ *
+ * ==================================================================
+ */
+int
+ntpcal_ntp64_to_date(
+ struct calendar *jd,
+ const vint64 *ntp
+ )
+{
+ ntpcal_split ds;
+
+ ds = ntpcal_daysplit(ntp);
+ ds.hi += ntpcal_daysec_to_date(jd, ds.lo);
+
+ return ntpcal_rd_to_date(jd, ds.hi + DAY_NTP_STARTS);
+}
+
+int
+ntpcal_ntp_to_date(
+ struct calendar *jd,
+ uint32_t ntp,
+ const time_t *piv
+ )
+{
+ vint64 ntp64;
+
+ /*
+ * Unfold ntp time around current time into NTP domain. Split
+ * into days and seconds, shift days into CE domain and
+ * process the parts.
+ */
+ ntp64 = ntpcal_ntp_to_ntp(ntp, piv);
+ return ntpcal_ntp64_to_date(jd, &ntp64);
+}
+
+
+vint64
+ntpcal_date_to_ntp64(
+ const struct calendar *jd
+ )
+{
+ /*
+ * Convert date to NTP. Ignore yearday, use d/m/y only.
+ */
+ return ntpcal_dayjoin(ntpcal_date_to_rd(jd) - DAY_NTP_STARTS,
+ ntpcal_date_to_daysec(jd));
+}
+
+
+uint32_t
+ntpcal_date_to_ntp(
+ const struct calendar *jd
+ )
+{
+ /*
+ * Get lower half of 64-bit NTP timestamp from date/time.
+ */
+ return ntpcal_date_to_ntp64(jd).d_s.lo;
+}
+
+
+
+/*
+ * ==================================================================
+ *
+ * day-of-week calculations
+ *
+ * ==================================================================
+ */
+/*
+ * Given a RataDie and a day-of-week, calculate a RDN that is reater-than,
+ * greater-or equal, closest, less-or-equal or less-than the given RDN
+ * and denotes the given day-of-week
+ */
+int32_t
+ntpcal_weekday_gt(
+ int32_t rdn,
+ int32_t dow
+ )
+{
+ return ntpcal_periodic_extend(rdn+1, dow, 7);
+}
+
+int32_t
+ntpcal_weekday_ge(
+ int32_t rdn,
+ int32_t dow
+ )
+{
+ return ntpcal_periodic_extend(rdn, dow, 7);
+}
+
+int32_t
+ntpcal_weekday_close(
+ int32_t rdn,
+ int32_t dow
+ )
+{
+ return ntpcal_periodic_extend(rdn-3, dow, 7);
+}
+
+int32_t
+ntpcal_weekday_le(
+ int32_t rdn,
+ int32_t dow
+ )
+{
+ return ntpcal_periodic_extend(rdn, dow, -7);
+}
+
+int32_t
+ntpcal_weekday_lt(
+ int32_t rdn,
+ int32_t dow
+ )
+{
+ return ntpcal_periodic_extend(rdn-1, dow, -7);
+}
+
+/*
+ * ==================================================================
+ *
+ * ISO week-calendar conversions
+ *
+ * The ISO8601 calendar defines a calendar of years, weeks and weekdays.
+ * It is related to the Gregorian calendar, and a ISO year starts at the
+ * Monday closest to Jan,1st of the corresponding Gregorian year. A ISO
+ * calendar year has always 52 or 53 weeks, and like the Grogrian
+ * calendar the ISO8601 calendar repeats itself every 400 years, or
+ * 146097 days, or 20871 weeks.
+ *
+ * While it is possible to write ISO calendar functions based on the
+ * Gregorian calendar functions, the following implementation takes a
+ * different approach, based directly on years and weeks.
+ *
+ * Analysis of the tabulated data shows that it is not possible to
+ * interpolate from years to weeks over a full 400 year range; cyclic
+ * shifts over 400 years do not provide a solution here. But it *is*
+ * possible to interpolate over every single century of the 400-year
+ * cycle. (The centennial leap year rule seems to be the culprit here.)
+ *
+ * It can be shown that a conversion from years to weeks can be done
+ * using a linear transformation of the form
+ *
+ * w = floor( y * a + b )
+ *
+ * where the slope a must hold to
+ *
+ * 52.1780821918 <= a < 52.1791044776
+ *
+ * and b must be chosen according to the selected slope and the number
+ * of the century in a 400-year period.
+ *
+ * The inverse calculation can also be done in this way. Careful scaling
+ * provides an unlimited set of integer coefficients a,k,b that enable
+ * us to write the calulation in the form
+ *
+ * w = (y * a + b ) / k
+ * y = (w * a' + b') / k'
+ *
+ * In this implementation the values of k and k' are chosen to be
+ * smallest possible powers of two, so the division can be implemented
+ * as shifts if the optimiser chooses to do so.
+ *
+ * ==================================================================
+ */
+
+/*
+ * Given a number of elapsed (ISO-)years since the begin of the
+ * christian era, return the number of elapsed weeks corresponding to
+ * the number of years.
+ */
+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.
+ */
+ weeks = (years * 53431 + bctab[cents]) / 1024;
+
+ return cycle * GREGORIAN_CYCLE_WEEKS
+ + cents * 5218 - (cents > 1)
+ + weeks;
+}
+
+/*
+ * Given a number of elapsed weeks since the begin of the christian
+ * era, split this number into the number of elapsed years in res.hi
+ * and the excessive number of weeks in res.lo. (That is, res.lo is
+ * the number of elapsed weeks in the remaining partial year.)
+ */
+ntpcal_split
+isocal_split_eraweeks(
+ int32_t weeks
+ )
+{
+ /*
+ * use: y = (w * 157 + b[c]) / 8192 as interpolation
+ */
+ static const int32_t bctab[4] = { 85, 131, 17, 62 };
+ ntpcal_split res;
+ int32_t cents;
+
+ /*
+ * split off 400-year cycles, using the fact that a 400-year
+ * cycle has 146097 days, which is exactly 20871 weeks.
+ */
+ 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.
+ */
+ 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;
+
+ return res;
+}
+
+/*
+ * Given a second in the NTP time scale and a pivot, expand the NTP
+ * time stamp around the pivot and convert into an ISO calendar time
+ * stamp.
+ */
+int
+isocal_ntp64_to_date(
+ struct isodate *id,
+ const vint64 *ntp
+ )
+{
+ ntpcal_split ds;
+ int32_t ts[3];
+
+ /*
+ * Split NTP time into days and seconds, shift days into CE
+ * domain and process the parts.
+ */
+ ds = ntpcal_daysplit(ntp);
+
+ /* split time part */
+ ds.hi += priv_timesplit(ts, ds.lo);
+ id->hour = (uint8_t)ts[0];
+ 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;
+ }
+ id->weekday = (uint8_t)ds.lo + 1; /* weekday result */
+
+ 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;
+
+ return (ds.hi >= 0 && ds.hi < 0xFFFFU);
+}
+
+int
+isocal_ntp_to_date(
+ struct isodate *id,
+ uint32_t ntp,
+ const time_t *piv
+ )
+{
+ vint64 ntp64;
+
+ /*
+ * Unfold ntp time around current time into NTP domain, then
+ * convert the full time stamp.
+ */
+ ntp64 = ntpcal_ntp_to_ntp(ntp, piv);
+ return isocal_ntp64_to_date(id, &ntp64);
+}
+
+/*
+ * Convert a ISO date spec into a second in the NTP time scale,
+ * properly truncated to 32 bit.
+ */
+vint64
+isocal_date_to_ntp64(
+ const struct isodate *id
+ )
+{
+ int32_t weeks, days, secs;
+
+ weeks = isocal_weeks_in_years((int32_t)id->year - 1)
+ + (int32_t)id->week - 1;
+ days = weeks * 7 + (int32_t)id->weekday;
+ /* days is RDN of ISO date now */
+ secs = ntpcal_etime_to_seconds(id->hour, id->minute, id->second);
+
+ return ntpcal_dayjoin(days - DAY_NTP_STARTS, secs);
+}
+
+uint32_t
+isocal_date_to_ntp(
+ const struct isodate *id
+ )
+{
+ /*
+ * Get lower half of 64-bit NTP timestamp from date/time.
+ */
+ return isocal_date_to_ntp64(id).d_s.lo;
+}
+
+/* -*-EOF-*- */
diff --git a/libntp/ntp_intres.c b/libntp/ntp_intres.c
new file mode 100644
index 0000000..2ac70c1
--- /dev/null
+++ b/libntp/ntp_intres.c
@@ -0,0 +1,1143 @@
+/*
+ * ntp_intres.c - Implements a generic blocking worker child or thread,
+ * initially to provide a nonblocking solution for DNS
+ * name to address lookups available with getaddrinfo().
+ *
+ * This is a new implementation as of 2009 sharing the filename and
+ * very little else with the prior implementation, which used a
+ * temporary file to receive a single set of requests from the parent,
+ * and a NTP mode 7 authenticated request to push back responses.
+ *
+ * A primary goal in rewriting this code was the need to support the
+ * pool configuration directive's requirement to retrieve multiple
+ * addresses resolving a single name, which has previously been
+ * satisfied with blocking resolver calls from the ntpd mainline code.
+ *
+ * A secondary goal is to provide a generic mechanism for other
+ * blocking operations to be delegated to a worker using a common
+ * model for both Unix and Windows ntpd. ntp_worker.c, work_fork.c,
+ * and work_thread.c implement the generic mechanism. This file
+ * implements the two current consumers, getaddrinfo_sometime() and the
+ * presently unused getnameinfo_sometime().
+ *
+ * Both routines deliver results to a callback and manage memory
+ * allocation, meaning there is no freeaddrinfo_sometime().
+ *
+ * The initial implementation for Unix uses a pair of unidirectional
+ * pipes, one each for requests and responses, connecting the forked
+ * blocking child worker with the ntpd mainline. The threaded code
+ * uses arrays of pointers to queue requests and responses.
+ *
+ * The parent drives the process, including scheduling sleeps between
+ * retries.
+ *
+ * Memory is managed differently for a child process, which mallocs
+ * request buffers to read from the pipe into, whereas the threaded
+ * code mallocs a copy of the request to hand off to the worker via
+ * the queueing array. The resulting request buffer is free()d by
+ * platform-independent code. A wrinkle is the request needs to be
+ * available to the requestor during response processing.
+ *
+ * Response memory allocation is also platform-dependent. With a
+ * separate process and pipes, the response is free()d after being
+ * written to the pipe. With threads, the same memory is handed
+ * over and the requestor frees it after processing is completed.
+ *
+ * The code should be generalized to support threads on Unix using
+ * much of the same code used for Windows initially.
+ *
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_workimpl.h"
+
+#ifdef WORKER
+
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+
+/**/
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <arpa/inet.h>
+/**/
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#if !defined(HAVE_RES_INIT) && defined(HAVE___RES_INIT)
+# define HAVE_RES_INIT
+#endif
+
+#if defined(HAVE_RESOLV_H) && defined(HAVE_RES_INIT)
+# ifdef HAVE_ARPA_NAMESER_H
+# include <arpa/nameser.h> /* DNS HEADER struct */
+# endif
+# ifdef HAVE_NETDB_H
+# include <netdb.h>
+# endif
+# include <resolv.h>
+# ifdef HAVE_INT32_ONLY_WITH_DNS
+# define HAVE_INT32
+# endif
+# ifdef HAVE_U_INT32_ONLY_WITH_DNS
+# define HAVE_U_INT32
+# endif
+#endif
+
+#include "ntp.h"
+#include "ntp_debug.h"
+#include "ntp_malloc.h"
+#include "ntp_syslog.h"
+#include "ntp_unixtime.h"
+#include "ntp_intres.h"
+#include "intreswork.h"
+
+
+/*
+ * Following are implementations of getaddrinfo_sometime() and
+ * getnameinfo_sometime(). Each is implemented in three routines:
+ *
+ * getaddrinfo_sometime() getnameinfo_sometime()
+ * blocking_getaddrinfo() blocking_getnameinfo()
+ * getaddrinfo_sometime_complete() getnameinfo_sometime_complete()
+ *
+ * The first runs in the parent and marshalls (or serializes) request
+ * parameters into a request blob which is processed in the child by
+ * the second routine, blocking_*(), which serializes the results into
+ * a response blob unpacked by the third routine, *_complete(), which
+ * calls the callback routine provided with the request and frees
+ * _request_ memory allocated by the first routine. Response memory
+ * is managed by the code which calls the *_complete routines.
+ */
+
+/* === typedefs === */
+typedef struct blocking_gai_req_tag { /* marshalled args */
+ size_t octets;
+ u_int dns_idx;
+ time_t scheduled;
+ time_t earliest;
+ struct addrinfo hints;
+ int retry;
+ gai_sometime_callback callback;
+ void * context;
+ size_t nodesize;
+ size_t servsize;
+} blocking_gai_req;
+
+typedef struct blocking_gai_resp_tag {
+ size_t octets;
+ int retcode;
+ int retry;
+ int gai_errno; /* for EAI_SYSTEM case */
+ int ai_count;
+ /*
+ * Followed by ai_count struct addrinfo and then ai_count
+ * sockaddr_u and finally the canonical name strings.
+ */
+} blocking_gai_resp;
+
+typedef struct blocking_gni_req_tag {
+ size_t octets;
+ u_int dns_idx;
+ time_t scheduled;
+ time_t earliest;
+ int retry;
+ size_t hostoctets;
+ size_t servoctets;
+ int flags;
+ gni_sometime_callback callback;
+ void * context;
+ sockaddr_u socku;
+} blocking_gni_req;
+
+typedef struct blocking_gni_resp_tag {
+ size_t octets;
+ int retcode;
+ int gni_errno; /* for EAI_SYSTEM case */
+ int retry;
+ size_t hostoctets;
+ size_t servoctets;
+ /*
+ * Followed by hostoctets bytes of null-terminated host,
+ * then servoctets bytes of null-terminated service.
+ */
+} blocking_gni_resp;
+
+/* per-DNS-worker state in parent */
+typedef struct dnschild_ctx_tag {
+ u_int index;
+ time_t next_dns_timeslot;
+} dnschild_ctx;
+
+/* per-DNS-worker state in worker */
+typedef struct dnsworker_ctx_tag {
+ blocking_child * c;
+ time_t ignore_scheduled_before;
+#ifdef HAVE_RES_INIT
+ time_t next_res_init;
+#endif
+} dnsworker_ctx;
+
+
+/* === variables === */
+dnschild_ctx ** dnschild_contexts; /* parent */
+u_int dnschild_contexts_alloc;
+dnsworker_ctx ** dnsworker_contexts; /* child */
+u_int dnsworker_contexts_alloc;
+
+#ifdef HAVE_RES_INIT
+static time_t next_res_init;
+#endif
+
+
+/* === forward declarations === */
+static u_int reserve_dnschild_ctx(void);
+static u_int get_dnschild_ctx(void);
+static void alloc_dnsworker_context(u_int);
+/* static void free_dnsworker_context(u_int); */
+static dnsworker_ctx * get_worker_context(blocking_child *, u_int);
+static void scheduled_sleep(time_t, time_t,
+ dnsworker_ctx *);
+static void manage_dns_retry_interval(time_t *, time_t *,
+ int *,
+ time_t *);
+static int should_retry_dns(int, int);
+#ifdef HAVE_RES_INIT
+static void reload_resolv_conf(dnsworker_ctx *);
+#else
+# define reload_resolv_conf(wc) \
+ do { \
+ (void)(wc); \
+ } while (FALSE)
+#endif
+static void getaddrinfo_sometime_complete(blocking_work_req,
+ void *, size_t,
+ void *);
+static void getnameinfo_sometime_complete(blocking_work_req,
+ void *, size_t,
+ void *);
+
+
+/* === functions === */
+/*
+ * getaddrinfo_sometime - uses blocking child to call getaddrinfo then
+ * invokes provided callback completion function.
+ */
+int
+getaddrinfo_sometime(
+ const char * node,
+ const char * service,
+ const struct addrinfo * hints,
+ int retry,
+ gai_sometime_callback callback,
+ void * context
+ )
+{
+ blocking_gai_req * gai_req;
+ u_int idx;
+ dnschild_ctx * child_ctx;
+ size_t req_size;
+ size_t nodesize;
+ size_t servsize;
+ time_t now;
+
+ NTP_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);
+ }
+
+ idx = get_dnschild_ctx();
+ child_ctx = dnschild_contexts[idx];
+
+ nodesize = strlen(node) + 1;
+ servsize = strlen(service) + 1;
+ req_size = sizeof(*gai_req) + nodesize + servsize;
+
+ gai_req = emalloc_zero(req_size);
+
+ gai_req->octets = req_size;
+ gai_req->dns_idx = idx;
+ now = time(NULL);
+ gai_req->scheduled = now;
+ gai_req->earliest = max(now, child_ctx->next_dns_timeslot);
+ child_ctx->next_dns_timeslot = gai_req->earliest;
+ if (hints != NULL)
+ gai_req->hints = *hints;
+ gai_req->retry = retry;
+ gai_req->callback = callback;
+ gai_req->context = context;
+ gai_req->nodesize = nodesize;
+ gai_req->servsize = servsize;
+
+ memcpy((char *)gai_req + sizeof(*gai_req), node, nodesize);
+ memcpy((char *)gai_req + sizeof(*gai_req) + nodesize, service,
+ servsize);
+
+ if (queue_blocking_request(
+ BLOCKING_GETADDRINFO,
+ gai_req,
+ req_size,
+ &getaddrinfo_sometime_complete,
+ gai_req)) {
+
+ msyslog(LOG_ERR, "unable to queue getaddrinfo request");
+ errno = EFAULT;
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+blocking_getaddrinfo(
+ blocking_child * c,
+ blocking_pipe_header * req
+ )
+{
+ blocking_gai_req * gai_req;
+ dnsworker_ctx * worker_ctx;
+ blocking_pipe_header * resp;
+ blocking_gai_resp * gai_resp;
+ char * node;
+ char * service;
+ struct addrinfo * ai_res;
+ struct addrinfo * ai;
+ struct addrinfo * serialized_ai;
+ size_t canons_octets;
+ size_t this_octets;
+ size_t resp_octets;
+ char * cp;
+ time_t time_now;
+
+ gai_req = (void *)((char *)req + sizeof(*req));
+ node = (char *)gai_req + sizeof(*gai_req);
+ service = node + gai_req->nodesize;
+
+ worker_ctx = get_worker_context(c, gai_req->dns_idx);
+ scheduled_sleep(gai_req->scheduled, gai_req->earliest,
+ worker_ctx);
+ reload_resolv_conf(worker_ctx);
+
+ /*
+ * Take a shot at the final size, better to overestimate
+ * at first and then realloc to a smaller size.
+ */
+
+ resp_octets = sizeof(*resp) + sizeof(*gai_resp) +
+ 16 * (sizeof(struct addrinfo) +
+ sizeof(sockaddr_u)) +
+ 256;
+ resp = emalloc_zero(resp_octets);
+ gai_resp = (void *)(resp + 1);
+
+ TRACE(2, ("blocking_getaddrinfo given node %s serv %s fam %d flags %x\n",
+ node, service, gai_req->hints.ai_family,
+ gai_req->hints.ai_flags));
+#ifdef DEBUG
+ if (debug >= 2)
+ fflush(stdout);
+#endif
+ ai_res = NULL;
+ gai_resp->retcode = getaddrinfo(node, service, &gai_req->hints,
+ &ai_res);
+ gai_resp->retry = gai_req->retry;
+#ifdef EAI_SYSTEM
+ if (EAI_SYSTEM == gai_resp->retcode)
+ gai_resp->gai_errno = errno;
+#endif
+ canons_octets = 0;
+
+ if (0 == gai_resp->retcode) {
+ ai = ai_res;
+ while (NULL != ai) {
+ gai_resp->ai_count++;
+ if (ai->ai_canonname)
+ canons_octets += strlen(ai->ai_canonname) + 1;
+ ai = ai->ai_next;
+ }
+ /*
+ * If this query succeeded only after retrying, DNS may have
+ * just become responsive. Ignore previously-scheduled
+ * retry sleeps once for each pending request, similar to
+ * the way scheduled_sleep() does when its worker_sleep()
+ * is interrupted.
+ */
+ if (gai_resp->retry > INITIAL_DNS_RETRY) {
+ time_now = time(NULL);
+ worker_ctx->ignore_scheduled_before = time_now;
+ TRACE(1, ("DNS success after retry, ignoring sleeps scheduled before now (%s)\n",
+ humantime(time_now)));
+ }
+ }
+
+ /*
+ * Our response consists of a header, followed by ai_count
+ * addrinfo structs followed by ai_count sockaddr_storage
+ * structs followed by the canonical names.
+ */
+ gai_resp->octets = sizeof(*gai_resp)
+ + gai_resp->ai_count
+ * (sizeof(gai_req->hints)
+ + sizeof(sockaddr_u))
+ + canons_octets;
+
+ resp_octets = sizeof(*resp) + gai_resp->octets;
+ resp = erealloc(resp, resp_octets);
+ gai_resp = (void *)(resp + 1);
+
+ /* cp serves as our current pointer while serializing */
+ cp = (void *)(gai_resp + 1);
+ canons_octets = 0;
+
+ if (0 == gai_resp->retcode) {
+ ai = ai_res;
+ while (NULL != ai) {
+ memcpy(cp, ai, sizeof(*ai));
+ serialized_ai = (void *)cp;
+ cp += sizeof(*ai);
+
+ /* transform ai_canonname into offset */
+ if (NULL != serialized_ai->ai_canonname) {
+ serialized_ai->ai_canonname = (char *)canons_octets;
+ canons_octets += strlen(ai->ai_canonname) + 1;
+ }
+
+ /* leave fixup of ai_addr pointer for receiver */
+
+ ai = ai->ai_next;
+ }
+
+ ai = ai_res;
+ while (NULL != ai) {
+ NTP_INSIST(ai->ai_addrlen <= sizeof(sockaddr_u));
+ memcpy(cp, ai->ai_addr, ai->ai_addrlen);
+ cp += sizeof(sockaddr_u);
+
+ ai = ai->ai_next;
+ }
+
+ ai = ai_res;
+ while (NULL != ai) {
+ if (NULL != ai->ai_canonname) {
+ this_octets = strlen(ai->ai_canonname) + 1;
+ memcpy(cp, ai->ai_canonname, this_octets);
+ cp += this_octets;
+ }
+
+ ai = ai->ai_next;
+ }
+ freeaddrinfo(ai_res);
+ }
+
+ /*
+ * make sure our walk and earlier calc match
+ */
+ DEBUG_INSIST((size_t)(cp - (char *)resp) == resp_octets);
+
+ if (queue_blocking_response(c, resp, resp_octets, req)) {
+ msyslog(LOG_ERR, "blocking_getaddrinfo can not queue response");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static void
+getaddrinfo_sometime_complete(
+ blocking_work_req rtype,
+ void * context,
+ size_t respsize,
+ void * resp
+ )
+{
+ blocking_gai_req * gai_req;
+ blocking_gai_resp * gai_resp;
+ dnschild_ctx * child_ctx;
+ struct addrinfo * ai;
+ struct addrinfo * next_ai;
+ sockaddr_u * psau;
+ char * node;
+ char * service;
+ char * canon_start;
+ time_t time_now;
+ int again;
+ int af;
+ const char * fam_spec;
+ int i;
+
+ gai_req = context;
+ gai_resp = resp;
+
+ DEBUG_REQUIRE(BLOCKING_GETADDRINFO == rtype);
+ DEBUG_REQUIRE(respsize == gai_resp->octets);
+
+ node = (char *)gai_req + sizeof(*gai_req);
+ service = node + gai_req->nodesize;
+
+ child_ctx = dnschild_contexts[gai_req->dns_idx];
+
+ if (0 == gai_resp->retcode) {
+ /*
+ * If this query succeeded only after retrying, DNS may have
+ * just become responsive.
+ */
+ if (gai_resp->retry > INITIAL_DNS_RETRY) {
+ time_now = time(NULL);
+ child_ctx->next_dns_timeslot = time_now;
+ TRACE(1, ("DNS success after retry, %u next_dns_timeslot reset (%s)\n",
+ gai_req->dns_idx, humantime(time_now)));
+ }
+ } else {
+ again = should_retry_dns(gai_resp->retcode,
+ gai_resp->gai_errno);
+ /*
+ * exponential backoff of DNS retries to 64s
+ */
+ if (gai_req->retry > 0 && again) {
+ /* log the first retry only */
+ if (INITIAL_DNS_RETRY == gai_req->retry)
+ NLOG(NLOG_SYSINFO) {
+ af = gai_req->hints.ai_family;
+ fam_spec = (AF_INET6 == af)
+ ? " (AAAA)"
+ : (AF_INET == af)
+ ? " (A)"
+ : "";
+#ifdef EAI_SYSTEM
+ if (EAI_SYSTEM == gai_resp->retcode) {
+ errno = gai_resp->gai_errno;
+ msyslog(LOG_INFO,
+ "retrying DNS %s%s: EAI_SYSTEM %d: %m",
+ node, fam_spec,
+ gai_resp->gai_errno);
+ } else
+#endif
+ msyslog(LOG_INFO,
+ "retrying DNS %s%s: %s (%d)",
+ node, fam_spec,
+ gai_strerror(gai_resp->retcode),
+ gai_resp->retcode);
+ }
+ manage_dns_retry_interval(&gai_req->scheduled,
+ &gai_req->earliest, &gai_req->retry,
+ &child_ctx->next_dns_timeslot);
+ if (!queue_blocking_request(
+ BLOCKING_GETADDRINFO,
+ gai_req,
+ gai_req->octets,
+ &getaddrinfo_sometime_complete,
+ gai_req))
+ return;
+ else
+ msyslog(LOG_ERR,
+ "unable to retry hostname %s",
+ node);
+ }
+ }
+
+ /*
+ * fixup pointers in returned addrinfo array
+ */
+ ai = (void *)((char *)gai_resp + sizeof(*gai_resp));
+ next_ai = NULL;
+ for (i = gai_resp->ai_count - 1; i >= 0; i--) {
+ ai[i].ai_next = next_ai;
+ next_ai = &ai[i];
+ }
+
+ psau = (void *)((char *)ai + gai_resp->ai_count * sizeof(*ai));
+ canon_start = (char *)psau + gai_resp->ai_count * sizeof(*psau);
+
+ for (i = 0; i < gai_resp->ai_count; i++) {
+ if (NULL != ai[i].ai_addr)
+ ai[i].ai_addr = &psau->sa;
+ psau++;
+ if (NULL != ai[i].ai_canonname)
+ ai[i].ai_canonname += (size_t)canon_start;
+ }
+
+ NTP_ENSURE((char *)psau == canon_start);
+
+ if (!gai_resp->ai_count)
+ ai = NULL;
+
+ (*gai_req->callback)(gai_resp->retcode, gai_resp->gai_errno,
+ gai_req->context, node, service,
+ &gai_req->hints, ai);
+
+ free(gai_req);
+ /* gai_resp is part of block freed by process_blocking_resp() */
+}
+
+
+#ifdef TEST_BLOCKING_WORKER
+void gai_test_callback(int rescode, int gai_errno, void *context, const char *name, const char *service, const struct addrinfo *hints, const struct addrinfo *ai_res)
+{
+ sockaddr_u addr;
+
+ if (rescode) {
+ TRACE(1, ("gai_test_callback context %p error rescode %d %s serv %s\n",
+ context, rescode, name, service));
+ return;
+ }
+ while (!rescode && NULL != ai_res) {
+ ZERO_SOCK(&addr);
+ memcpy(&addr, ai_res->ai_addr, ai_res->ai_addrlen);
+ TRACE(1, ("ctx %p fam %d addr %s canon '%s' type %s at %p ai_addr %p ai_next %p\n",
+ context,
+ AF(&addr),
+ stoa(&addr),
+ (ai_res->ai_canonname)
+ ? ai_res->ai_canonname
+ : "",
+ (SOCK_DGRAM == ai_res->ai_socktype)
+ ? "DGRAM"
+ : (SOCK_STREAM == ai_res->ai_socktype)
+ ? "STREAM"
+ : "(other)",
+ ai_res,
+ ai_res->ai_addr,
+ ai_res->ai_next));
+
+ getnameinfo_sometime((sockaddr_u *)ai_res->ai_addr, 128, 32, 0, gni_test_callback, context);
+
+ ai_res = ai_res->ai_next;
+ }
+}
+#endif /* TEST_BLOCKING_WORKER */
+
+
+int
+getnameinfo_sometime(
+ sockaddr_u * psau,
+ size_t hostoctets,
+ size_t servoctets,
+ int flags,
+ gni_sometime_callback callback,
+ void * context
+ )
+{
+ blocking_gni_req * gni_req;
+ u_int idx;
+ dnschild_ctx * child_ctx;
+ time_t time_now;
+
+ NTP_REQUIRE(hostoctets);
+ NTP_REQUIRE(hostoctets + servoctets < 1024);
+
+ idx = get_dnschild_ctx();
+ child_ctx = dnschild_contexts[idx];
+
+ gni_req = emalloc_zero(sizeof(*gni_req));
+
+ gni_req->octets = sizeof(*gni_req);
+ gni_req->dns_idx = idx;
+ time_now = time(NULL);
+ gni_req->scheduled = time_now;
+ gni_req->earliest = max(time_now, child_ctx->next_dns_timeslot);
+ child_ctx->next_dns_timeslot = gni_req->earliest;
+ memcpy(&gni_req->socku, psau, SOCKLEN(psau));
+ gni_req->hostoctets = hostoctets;
+ gni_req->servoctets = servoctets;
+ gni_req->flags = flags;
+ gni_req->retry = INITIAL_DNS_RETRY;
+ gni_req->callback = callback;
+ gni_req->context = context;
+
+ if (queue_blocking_request(
+ BLOCKING_GETNAMEINFO,
+ gni_req,
+ sizeof(*gni_req),
+ &getnameinfo_sometime_complete,
+ gni_req)) {
+
+ msyslog(LOG_ERR, "unable to queue getnameinfo request");
+ errno = EFAULT;
+ return -1;
+ }
+
+ return 0;
+}
+
+
+int
+blocking_getnameinfo(
+ blocking_child * c,
+ blocking_pipe_header * req
+ )
+{
+ blocking_gni_req * gni_req;
+ dnsworker_ctx * worker_ctx;
+ blocking_pipe_header * resp;
+ blocking_gni_resp * gni_resp;
+ size_t octets;
+ size_t resp_octets;
+ char * host;
+ char * service;
+ char * cp;
+ int rc;
+ time_t time_now;
+
+ gni_req = (void *)((char *)req + sizeof(*req));
+
+ octets = gni_req->hostoctets + gni_req->servoctets;
+
+ /*
+ * Some alloca() implementations are fragile regarding
+ * large allocations. We only need room for the host
+ * and service names.
+ */
+ NTP_REQUIRE(octets < 1024);
+
+#ifndef HAVE_ALLOCA
+ host = emalloc(octets);
+#else
+ host = alloca(octets);
+ if (NULL == host) {
+ msyslog(LOG_ERR,
+ "blocking_getnameinfo unable to allocate %lu octets on stack",
+ (u_long)octets);
+ exit(1);
+ }
+#endif
+ service = host + gni_req->hostoctets;
+
+ worker_ctx = get_worker_context(c, gni_req->dns_idx);
+ scheduled_sleep(gni_req->scheduled, gni_req->earliest,
+ worker_ctx);
+ reload_resolv_conf(worker_ctx);
+
+ /*
+ * Take a shot at the final size, better to overestimate
+ * then realloc to a smaller size.
+ */
+
+ resp_octets = sizeof(*resp) + sizeof(*gni_resp) + octets;
+ resp = emalloc_zero(resp_octets);
+ gni_resp = (void *)((char *)resp + sizeof(*resp));
+
+ TRACE(2, ("blocking_getnameinfo given addr %s flags 0x%x hostlen %lu servlen %lu\n",
+ stoa(&gni_req->socku), gni_req->flags,
+ (u_long)gni_req->hostoctets, (u_long)gni_req->servoctets));
+
+ gni_resp->retcode = getnameinfo(&gni_req->socku.sa,
+ SOCKLEN(&gni_req->socku),
+ host,
+ gni_req->hostoctets,
+ service,
+ gni_req->servoctets,
+ gni_req->flags);
+ gni_resp->retry = gni_req->retry;
+#ifdef EAI_SYSTEM
+ if (EAI_SYSTEM == gni_resp->retcode)
+ gni_resp->gni_errno = errno;
+#endif
+
+ if (0 != gni_resp->retcode) {
+ gni_resp->hostoctets = 0;
+ gni_resp->servoctets = 0;
+ } else {
+ gni_resp->hostoctets = strlen(host) + 1;
+ gni_resp->servoctets = strlen(service) + 1;
+ /*
+ * If this query succeeded only after retrying, DNS may have
+ * just become responsive. Ignore previously-scheduled
+ * retry sleeps once for each pending request, similar to
+ * the way scheduled_sleep() does when its worker_sleep()
+ * is interrupted.
+ */
+ if (gni_req->retry > INITIAL_DNS_RETRY) {
+ time_now = time(NULL);
+ worker_ctx->ignore_scheduled_before = time_now;
+ TRACE(1, ("DNS success after retrying, ignoring sleeps scheduled before now (%s)\n",
+ humantime(time_now)));
+ }
+ }
+ octets = gni_resp->hostoctets + gni_resp->servoctets;
+ /*
+ * Our response consists of a header, followed by the host and
+ * service strings, each null-terminated.
+ */
+ resp_octets = sizeof(*resp) + sizeof(*gni_resp) + octets;
+
+ resp = erealloc(resp, resp_octets);
+ gni_resp = (void *)(resp + 1);
+
+ gni_resp->octets = sizeof(*gni_resp) + octets;
+
+ /* cp serves as our current pointer while serializing */
+ cp = (void *)(gni_resp + 1);
+
+ if (0 == gni_resp->retcode) {
+ memcpy(cp, host, gni_resp->hostoctets);
+ cp += gni_resp->hostoctets;
+ memcpy(cp, service, gni_resp->servoctets);
+ cp += gni_resp->servoctets;
+ }
+
+ NTP_INSIST((size_t)(cp - (char *)resp) == resp_octets);
+ NTP_INSIST(resp_octets - sizeof(*resp) == gni_resp->octets);
+
+ rc = queue_blocking_response(c, resp, resp_octets, req);
+ if (rc)
+ msyslog(LOG_ERR, "blocking_getnameinfo unable to queue response");
+#ifndef HAVE_ALLOCA
+ free(host);
+#endif
+ return rc;
+}
+
+
+static void
+getnameinfo_sometime_complete(
+ blocking_work_req rtype,
+ void * context,
+ size_t respsize,
+ void * resp
+ )
+{
+ blocking_gni_req * gni_req;
+ blocking_gni_resp * gni_resp;
+ dnschild_ctx * child_ctx;
+ char * host;
+ char * service;
+ time_t time_now;
+ int again;
+
+ gni_req = context;
+ gni_resp = resp;
+
+ DEBUG_REQUIRE(BLOCKING_GETNAMEINFO == rtype);
+ DEBUG_REQUIRE(respsize == gni_resp->octets);
+
+ child_ctx = dnschild_contexts[gni_req->dns_idx];
+
+ if (0 == gni_resp->retcode) {
+ /*
+ * If this query succeeded only after retrying, DNS may have
+ * just become responsive.
+ */
+ if (gni_resp->retry > INITIAL_DNS_RETRY) {
+ time_now = time(NULL);
+ child_ctx->next_dns_timeslot = time_now;
+ TRACE(1, ("DNS success after retry, %u next_dns_timeslot reset (%s)\n",
+ gni_req->dns_idx, humantime(time_now)));
+ }
+ } else {
+ again = should_retry_dns(gni_resp->retcode, gni_resp->gni_errno);
+ /*
+ * exponential backoff of DNS retries to 64s
+ */
+ if (gni_req->retry > 0)
+ manage_dns_retry_interval(&gni_req->scheduled,
+ &gni_req->earliest, &gni_req->retry,
+ &child_ctx->next_dns_timeslot);
+
+ if (gni_req->retry > 0 && again) {
+ if (!queue_blocking_request(
+ BLOCKING_GETNAMEINFO,
+ gni_req,
+ gni_req->octets,
+ &getnameinfo_sometime_complete,
+ gni_req))
+ return;
+
+ msyslog(LOG_ERR, "unable to retry reverse lookup of %s", stoa(&gni_req->socku));
+ }
+ }
+
+ if (!gni_resp->hostoctets) {
+ host = NULL;
+ service = NULL;
+ } else {
+ host = (char *)gni_resp + sizeof(*gni_resp);
+ service = (gni_resp->servoctets)
+ ? host + gni_resp->hostoctets
+ : NULL;
+ }
+
+ (*gni_req->callback)(gni_resp->retcode, gni_resp->gni_errno,
+ &gni_req->socku, gni_req->flags, host,
+ service, gni_req->context);
+
+ free(gni_req);
+ /* gni_resp is part of block freed by process_blocking_resp() */
+}
+
+
+#ifdef TEST_BLOCKING_WORKER
+void gni_test_callback(int rescode, int gni_errno, sockaddr_u *psau, int flags, const char *host, const char *service, void *context)
+{
+ if (!rescode)
+ TRACE(1, ("gni_test_callback got host '%s' serv '%s' for addr %s context %p\n",
+ host, service, stoa(psau), context));
+ else
+ TRACE(1, ("gni_test_callback context %p rescode %d gni_errno %d flags 0x%x addr %s\n",
+ context, rescode, gni_errno, flags, stoa(psau)));
+}
+#endif /* TEST_BLOCKING_WORKER */
+
+
+#ifdef HAVE_RES_INIT
+static void
+reload_resolv_conf(
+ dnsworker_ctx * worker_ctx
+ )
+{
+ time_t time_now;
+
+ /*
+ * This is ad-hoc. Reload /etc/resolv.conf once per minute
+ * to pick up on changes from the DHCP client. [Bug 1226]
+ * When using threads for the workers, this needs to happen
+ * only once per minute process-wide.
+ */
+ time_now = time(NULL);
+# ifdef WORK_THREAD
+ worker_ctx->next_res_init = next_res_init;
+# endif
+ if (worker_ctx->next_res_init <= time_now) {
+ if (worker_ctx->next_res_init != 0)
+ res_init();
+ worker_ctx->next_res_init = time_now + 60;
+# ifdef WORK_THREAD
+ next_res_init = worker_ctx->next_res_init;
+# endif
+ }
+}
+#endif /* HAVE_RES_INIT */
+
+
+static u_int
+reserve_dnschild_ctx(void)
+{
+ const size_t ps = sizeof(dnschild_contexts[0]);
+ const size_t cs = sizeof(*dnschild_contexts[0]);
+ u_int c;
+ u_int new_alloc;
+ size_t octets;
+ size_t new_octets;
+
+ c = 0;
+ while (TRUE) {
+ for ( ; c < dnschild_contexts_alloc; c++) {
+ if (NULL == dnschild_contexts[c]) {
+ dnschild_contexts[c] = emalloc_zero(cs);
+
+ return c;
+ }
+ }
+ new_alloc = dnschild_contexts_alloc + 20;
+ new_octets = new_alloc * ps;
+ octets = dnschild_contexts_alloc * ps;
+ dnschild_contexts = erealloc_zero(dnschild_contexts,
+ new_octets, octets);
+ dnschild_contexts_alloc = new_alloc;
+ }
+}
+
+
+static u_int
+get_dnschild_ctx(void)
+{
+ static u_int shared_ctx = UINT_MAX;
+
+ if (worker_per_query)
+ return reserve_dnschild_ctx();
+
+ if (UINT_MAX == shared_ctx)
+ shared_ctx = reserve_dnschild_ctx();
+
+ return shared_ctx;
+}
+
+
+static void
+alloc_dnsworker_context(
+ u_int idx
+ )
+{
+ const size_t worker_context_sz = sizeof(*dnsworker_contexts[0]);
+
+ REQUIRE(NULL == dnsworker_contexts[idx]);
+ dnsworker_contexts[idx] = emalloc_zero(worker_context_sz);
+}
+
+
+static dnsworker_ctx *
+get_worker_context(
+ blocking_child * c,
+ u_int idx
+ )
+{
+ static size_t ps = sizeof(dnsworker_contexts[0]);
+ u_int min_new_alloc;
+ u_int new_alloc;
+ size_t octets;
+ size_t new_octets;
+
+ if (dnsworker_contexts_alloc <= idx) {
+ min_new_alloc = 1 + idx;
+ /* round new_alloc up to nearest multiple of 4 */
+ new_alloc = (min_new_alloc + 4) & ~(4 - 1);
+ new_octets = new_alloc * ps;
+ octets = dnsworker_contexts_alloc * ps;
+ dnsworker_contexts = erealloc_zero(dnsworker_contexts,
+ new_octets, octets);
+ dnsworker_contexts_alloc = new_alloc;
+ }
+
+ if (NULL == dnsworker_contexts[idx])
+ alloc_dnsworker_context(idx);
+ ZERO(*dnsworker_contexts[idx]);
+ dnsworker_contexts[idx]->c = c;
+
+ return dnsworker_contexts[idx];
+}
+
+
+static void
+scheduled_sleep(
+ time_t scheduled,
+ time_t earliest,
+ dnsworker_ctx * worker_ctx
+ )
+{
+ time_t now;
+
+ if (scheduled < worker_ctx->ignore_scheduled_before) {
+ TRACE(1, ("ignoring sleep until %s scheduled at %s (before %s)\n",
+ humantime(earliest), humantime(scheduled),
+ humantime(worker_ctx->ignore_scheduled_before)));
+ return;
+ }
+
+ now = time(NULL);
+
+ if (now < earliest) {
+ TRACE(1, ("sleep until %s scheduled at %s (>= %s)\n",
+ humantime(earliest), humantime(scheduled),
+ humantime(worker_ctx->ignore_scheduled_before)));
+ if (-1 == worker_sleep(worker_ctx->c, earliest - now)) {
+ /* our sleep was interrupted */
+ now = time(NULL);
+ worker_ctx->ignore_scheduled_before = now;
+#ifdef HAVE_RES_INIT
+ worker_ctx->next_res_init = now + 60;
+ next_res_init = worker_ctx->next_res_init;
+ res_init();
+#endif
+ TRACE(1, ("sleep interrupted by daemon, ignoring sleeps scheduled before now (%s)\n",
+ humantime(worker_ctx->ignore_scheduled_before)));
+ }
+ }
+}
+
+
+/*
+ * manage_dns_retry_interval is a helper used by
+ * getaddrinfo_sometime_complete and getnameinfo_sometime_complete
+ * to calculate the new retry interval and schedule the next query.
+ */
+static void
+manage_dns_retry_interval(
+ time_t * pscheduled,
+ time_t * pwhen,
+ int * pretry,
+ time_t * pnext_timeslot
+ )
+{
+ time_t now;
+ time_t when;
+ int retry;
+
+ now = time(NULL);
+ retry = *pretry;
+ when = max(now + retry, *pnext_timeslot);
+ *pnext_timeslot = when;
+ retry = min(64, retry << 1);
+
+ *pscheduled = now;
+ *pwhen = when;
+ *pretry = retry;
+}
+
+/*
+ * should_retry_dns is a helper used by getaddrinfo_sometime_complete
+ * and getnameinfo_sometime_complete which implements ntpd's DNS retry
+ * policy.
+ */
+static int
+should_retry_dns(
+ int rescode,
+ int res_errno
+ )
+{
+ static int eai_again_seen;
+ int again;
+#if defined (EAI_SYSTEM) && defined(DEBUG)
+ char msg[256];
+#endif
+
+ /*
+ * If the resolver failed, see if the failure is
+ * temporary. If so, return success.
+ */
+ again = 0;
+
+ switch (rescode) {
+
+ case EAI_FAIL:
+ again = 1;
+ break;
+
+ case EAI_AGAIN:
+ again = 1;
+ eai_again_seen = 1; /* [Bug 1178] */
+ break;
+
+ case EAI_NONAME:
+#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
+ case EAI_NODATA:
+#endif
+ again = !eai_again_seen; /* [Bug 1178] */
+ break;
+
+#ifdef EAI_SYSTEM
+ case EAI_SYSTEM:
+ /*
+ * EAI_SYSTEM means the real error is in errno. We should be more
+ * discriminating about which errno values require retrying, but
+ * this matches existing behavior.
+ */
+ again = 1;
+# ifdef DEBUG
+ errno_to_str(res_errno, msg, sizeof(msg));
+ TRACE(1, ("intres: EAI_SYSTEM errno %d (%s) means try again, right?\n",
+ res_errno, msg));
+# endif
+ break;
+#endif
+ }
+
+ TRACE(2, ("intres: resolver returned: %s (%d), %sretrying\n",
+ gai_strerror(rescode), rescode, again ? "" : "not "));
+
+ return again;
+}
+
+#else /* !WORKER follows */
+int ntp_intres_nonempty_compilation_unit;
+#endif
diff --git a/libntp/ntp_libopts.c b/libntp/ntp_libopts.c
new file mode 100644
index 0000000..c504f8b
--- /dev/null
+++ b/libntp/ntp_libopts.c
@@ -0,0 +1,58 @@
+/*
+ * ntp_libopts.c
+ *
+ * Common code interfacing with Autogen's libopts command-line option
+ * processing.
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include "ntp_libopts.h"
+#include "ntp_stdlib.h"
+
+extern const char *Version; /* version.c for each program */
+
+
+/*
+ * ntpOptionProcess() was a clone of libopts' optionProcess which
+ * overrode the --version output, appending detail from version.c
+ * which was not available at Autogen time. This is now done via
+ * AutoOpts' version-proc = override in copyright.def, so this
+ * routine is a straightforward wrapper of optionProcess().
+ */
+int
+ntpOptionProcess(
+ tOptions * pOpts,
+ int argc,
+ char ** argv
+ )
+{
+ return optionProcess(pOpts, argc, argv);
+}
+
+
+/*
+ * ntpOptionPrintVersion() replaces the stock optionPrintVersion() via
+ * version-proc = ntpOptionPrintVersion; in copyright.def. It differs
+ * from the stock function by displaying the complete version string,
+ * including compile time which was unknown when Autogen ran.
+ *
+ * Like optionPrintVersion() this function must exit(0) rather than
+ * return.
+ */
+void
+ntpOptionPrintVersion(
+ tOptions * pOpts,
+ tOptDesc * pOD
+ )
+{
+ UNUSED_ARG(pOpts);
+ UNUSED_ARG(pOD);
+
+ printf("%s\n", Version);
+ fflush(stdout);
+ exit(EXIT_SUCCESS);
+}
diff --git a/libntp/ntp_lineedit.c b/libntp/ntp_lineedit.c
new file mode 100644
index 0000000..c5aad31
--- /dev/null
+++ b/libntp/ntp_lineedit.c
@@ -0,0 +1,246 @@
+/*
+ * ntp_lineedit.c - generic interface to various line editing libs
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#if defined(HAVE_READLINE_HISTORY) && \
+ (!defined(HAVE_READLINE_HISTORY_H) || \
+ !defined(HAVE_READLINE_READLINE_H))
+# undef HAVE_READLINE_HISTORY
+#endif
+#if defined(HAVE_READLINE_HISTORY)
+# include <readline/readline.h>
+# include <readline/history.h>
+# define LE_READLINE
+#elif defined(HAVE_HISTEDIT_H)
+# include <histedit.h>
+# define LE_EDITLINE
+#else
+# define LE_NONE
+#endif
+
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include "ntp_lineedit.h"
+
+#define MAXEDITLINE 512
+
+/*
+ * external references
+ */
+
+extern char * progname;
+
+/*
+ * globals, private prototypes
+ */
+
+static int ntp_readline_initted;
+static char * lineedit_prompt;
+
+
+#ifdef LE_EDITLINE
+# ifndef H_SETSIZE
+# define H_SETSIZE H_EVENT
+# endif
+static EditLine * ntp_el;
+static History * ntp_hist;
+static HistEvent hev;
+
+char * ntp_prompt_callback(EditLine *);
+#endif /* LE_EDITLINE */
+
+
+/*
+ * ntp_readline_init - setup, set or reset prompt string
+ */
+int
+ntp_readline_init(
+ const char * prompt
+ )
+{
+ int success;
+
+ success = 1;
+
+ if (prompt) {
+ if (lineedit_prompt)
+ free(lineedit_prompt);
+ lineedit_prompt = estrdup(prompt);
+ }
+
+#ifdef LE_EDITLINE
+ if (NULL == ntp_el) {
+
+# if 4 == EL_INIT_ARGS
+ ntp_el = el_init(progname, stdin, stdout, stderr);
+# else
+ ntp_el = el_init(progname, stdin, stdout);
+# endif
+ if (ntp_el) {
+
+ el_set(ntp_el, EL_PROMPT, ntp_prompt_callback);
+ el_set(ntp_el, EL_EDITOR, "emacs");
+
+ ntp_hist = history_init();
+
+ if (NULL == ntp_hist) {
+
+ mfprintf(stderr, "history_init(): %m\n");
+ fflush(stderr);
+
+ el_end(ntp_el);
+ ntp_el = NULL;
+
+ success = 0;
+
+ } else {
+ ZERO(hev);
+#ifdef H_SETSIZE
+ history(ntp_hist, &hev, H_SETSIZE, 128);
+#endif
+ el_set(ntp_el, EL_HIST, history,
+ ntp_hist);
+ /* use any .editrc */
+ el_source(ntp_el, NULL);
+ }
+ } else
+ success = 0;
+ }
+#endif /* LE_EDITLINE */
+
+ ntp_readline_initted = success;
+
+ return success;
+}
+
+
+/*
+ * ntp_readline_uninit - release resources
+ */
+void
+ntp_readline_uninit(
+ void
+ )
+{
+#ifdef LE_EDITLINE
+ if (ntp_el) {
+ el_end(ntp_el);
+ ntp_el = NULL;
+
+ history_end(ntp_hist);
+ ntp_hist = NULL;
+ }
+#endif /* LE_EDITLINE */
+
+ if (lineedit_prompt) {
+ free(lineedit_prompt);
+ lineedit_prompt = NULL;
+ }
+
+ ntp_readline_initted = 0;
+}
+
+
+/*
+ * ntp_readline - read a line with the line editor available
+ *
+ * The string returned must be released with free()
+ */
+
+char *
+ntp_readline(
+ int * pcount
+ )
+{
+ char * line;
+#ifdef LE_NONE
+ char line_buf[MAXEDITLINE];
+#endif
+#ifdef LE_EDITLINE
+ const char * cline;
+#endif
+
+ if (!ntp_readline_initted)
+ return NULL;
+
+ *pcount = 0;
+
+#ifdef LE_READLINE
+ line = readline(lineedit_prompt ? lineedit_prompt : "");
+ if (NULL != line) {
+ if (*line) {
+ add_history(line);
+ *pcount = strlen(line);
+ } else {
+ free(line);
+ line = NULL;
+ }
+ }
+#endif /* LE_READLINE */
+
+#ifdef LE_EDITLINE
+ cline = el_gets(ntp_el, pcount);
+
+ if (NULL != cline && *cline) {
+ history(ntp_hist, &hev, H_ENTER, cline);
+ *pcount = strlen(cline);
+ line = estrdup(cline);
+ } else
+ line = NULL;
+#endif /* LE_EDITLINE */
+
+#ifdef LE_NONE
+ /* stone hammers */
+ if (lineedit_prompt) {
+# ifdef VMS
+ /*
+ * work around problem mixing
+ * stdout & stderr
+ */
+ fputs("", stdout);
+# endif /* VMS */
+
+ fputs(lineedit_prompt, stderr);
+ fflush(stderr);
+ }
+
+ line = fgets(line_buf, sizeof(line_buf), stdin);
+ if (NULL != line && *line) {
+ *pcount = strlen(line);
+ line = estrdup(line);
+ } else
+ line = NULL;
+
+#endif /* LE_NONE */
+
+
+ if (!line) /* EOF */
+ fputs("\n", stderr);
+
+ return line;
+}
+
+
+#ifdef LE_EDITLINE
+/*
+ * ntp_prompt_callback - return prompt string to el_gets()
+ */
+char *
+ntp_prompt_callback(
+ EditLine *el
+ )
+{
+ UNUSED_ARG(el);
+
+ return lineedit_prompt;
+}
+#endif /* LE_EDITLINE */
+
diff --git a/libntp/ntp_random.c b/libntp/ntp_random.c
new file mode 100644
index 0000000..0ada44f
--- /dev/null
+++ b/libntp/ntp_random.c
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libc/stdlib/random.c,v 1.4.2.2 1999/09/05 11:16:45 peter Exp $
+ *
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
+#endif /* LIBC_SCCS and not lint */
+
+#include "config.h"
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+
+#include <l_stdlib.h>
+#include <ntp_random.h>
+#include <ntp_unixtime.h>
+
+/*
+ * random.c:
+ *
+ * An improved random number generation package. In addition to the standard
+ * rand()/srand() like interface, this package also has a special state info
+ * interface. The initstate() routine is called with a seed, an array of
+ * bytes, and a count of how many bytes are being passed in; this array is
+ * then initialized to contain information for random number generation with
+ * that much state information. Good sizes for the amount of state
+ * information are 32, 64, 128, and 256 bytes. The state can be switched by
+ * calling the setstate() routine with the same array as was initiallized
+ * with initstate(). By default, the package runs with 128 bytes of state
+ * information and generates far better random numbers than a linear
+ * congruential generator. If the amount of state information is less than
+ * 32 bytes, a simple linear congruential R.N.G. is used.
+ *
+ * Internally, the state information is treated as an array of longs; the
+ * zeroeth element of the array is the type of R.N.G. being used (small
+ * integer); the remainder of the array is the state information for the
+ * R.N.G. Thus, 32 bytes of state information will give 7 longs worth of
+ * state information, which will allow a degree seven polynomial. (Note:
+ * the zeroeth word of state information also has some other information
+ * stored in it -- see setstate() for details).
+ *
+ * The random number generation technique is a linear feedback shift register
+ * approach, employing trinomials (since there are fewer terms to sum up that
+ * way). In this approach, the least significant bit of all the numbers in
+ * the state table will act as a linear feedback shift register, and will
+ * have period 2^deg - 1 (where deg is the degree of the polynomial being
+ * used, assuming that the polynomial is irreducible and primitive). The
+ * higher order bits will have longer periods, since their values are also
+ * influenced by pseudo-random carries out of the lower bits. The total
+ * period of the generator is approximately deg*(2**deg - 1); thus doubling
+ * the amount of state information has a vast influence on the period of the
+ * generator. Note: the deg*(2**deg - 1) is an approximation only good for
+ * large deg, when the period of the shift register is the dominant factor.
+ * With deg equal to seven, the period is actually much longer than the
+ * 7*(2**7 - 1) predicted by this formula.
+ *
+ * Modified 28 December 1994 by Jacob S. Rosenberg.
+ * The following changes have been made:
+ * All references to the type u_int have been changed to unsigned long.
+ * All references to type int have been changed to type long. Other
+ * cleanups have been made as well. A warning for both initstate and
+ * setstate has been inserted to the effect that on Sparc platforms
+ * the 'arg_state' variable must be forced to begin on word boundaries.
+ * This can be easily done by casting a long integer array to char *.
+ * The overall logic has been left STRICTLY alone. This software was
+ * tested on both a VAX and Sun SpacsStation with exactly the same
+ * results. The new version and the original give IDENTICAL results.
+ * The new version is somewhat faster than the original. As the
+ * documentation says: "By default, the package runs with 128 bytes of
+ * state information and generates far better random numbers than a linear
+ * congruential generator. If the amount of state information is less than
+ * 32 bytes, a simple linear congruential R.N.G. is used." For a buffer of
+ * 128 bytes, this new version runs about 19 percent faster and for a 16
+ * byte buffer it is about 5 percent faster.
+ */
+
+/*
+ * For each of the currently supported random number generators, we have a
+ * break value on the amount of state information (you need at least this
+ * many bytes of state info to support this random number generator), a degree
+ * for the polynomial (actually a trinomial) that the R.N.G. is based on, and
+ * the separation between the two lower order coefficients of the trinomial.
+ */
+#define TYPE_0 0 /* linear congruential */
+#define BREAK_0 8
+#define DEG_0 0
+#define SEP_0 0
+
+#define TYPE_1 1 /* x**7 + x**3 + 1 */
+#define BREAK_1 32
+#define DEG_1 7
+#define SEP_1 3
+
+#define TYPE_2 2 /* x**15 + x + 1 */
+#define BREAK_2 64
+#define DEG_2 15
+#define SEP_2 1
+
+#define TYPE_3 3 /* x**31 + x**3 + 1 */
+#define BREAK_3 128
+#define DEG_3 31
+#define SEP_3 3
+
+#define TYPE_4 4 /* x**63 + x + 1 */
+#define BREAK_4 256
+#define DEG_4 63
+#define SEP_4 1
+
+#define MAX_TYPES 5 /* max number of types above */
+
+/*
+ * Initially, everything is set up as if from:
+ *
+ * initstate(1, randtbl, 128);
+ *
+ * Note that this initialization takes advantage of the fact that srandom()
+ * advances the front and rear pointers 10*rand_deg times, and hence the
+ * rear pointer which starts at 0 will also end up at zero; thus the zeroeth
+ * element of the state information, which contains info about the current
+ * position of the rear pointer is just
+ *
+ * MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3.
+ */
+
+static unsigned long randtbl[DEG_3 + 1] = {
+ TYPE_3,
+#ifdef USE_WEAK_SEEDING
+/* Historic implementation compatibility */
+/* The random sequences do not vary much with the seed */
+ 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5,
+ 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
+ 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88,
+ 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
+ 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b,
+ 0x27fb47b9,
+#else /* !USE_WEAK_SEEDING */
+ 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05,
+ 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454,
+ 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471,
+ 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1,
+ 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41,
+ 0xf3bec5da
+#endif /* !USE_WEAK_SEEDING */
+};
+
+/*
+ * fptr and rptr are two pointers into the state info, a front and a rear
+ * pointer. These two pointers are always rand_sep places aparts, as they
+ * cycle cyclically through the state information. (Yes, this does mean we
+ * could get away with just one pointer, but the code for random() is more
+ * efficient this way). The pointers are left positioned as they would be
+ * from the call
+ *
+ * initstate(1, randtbl, 128);
+ *
+ * (The position of the rear pointer, rptr, is really 0 (as explained above
+ * in the initialization of randtbl) because the state table pointer is set
+ * to point to randtbl[1] (as explained below).
+ */
+static unsigned long *fptr = &randtbl[SEP_3 + 1];
+static unsigned long *rptr = &randtbl[1];
+
+/*
+ * The following things are the pointer to the state information table, the
+ * type of the current generator, the degree of the current polynomial being
+ * used, and the separation between the two pointers. Note that for efficiency
+ * of random(), we remember the first location of the state information, not
+ * the zeroeth. Hence it is valid to access state[-1], which is used to
+ * store the type of the R.N.G. Also, we remember the last location, since
+ * this is more efficient than indexing every time to find the address of
+ * the last element to see if the front and rear pointers have wrapped.
+ */
+static unsigned long *state = &randtbl[1];
+static long rand_type = TYPE_3;
+static long rand_deg = DEG_3;
+static long rand_sep = SEP_3;
+static unsigned long *end_ptr = &randtbl[DEG_3 + 1];
+
+static inline long good_rand (long);
+
+static inline long
+good_rand (
+ register long x
+ )
+{
+#ifdef USE_WEAK_SEEDING
+/*
+ * Historic implementation compatibility.
+ * The random sequences do not vary much with the seed,
+ * even with overflowing.
+ */
+ return (1103515245 * x + 12345);
+#else /* !USE_WEAK_SEEDING */
+/*
+ * Compute x = (7^5 * x) mod (2^31 - 1)
+ * wihout overflowing 31 bits:
+ * (2^31 - 1) = 127773 * (7^5) + 2836
+ * From "Random number generators: good ones are hard to find",
+ * Park and Miller, Communications of the ACM, vol. 31, no. 10,
+ * October 1988, p. 1195.
+ */
+ register long hi, lo;
+
+ hi = x / 127773;
+ lo = x % 127773;
+ x = 16807 * lo - 2836 * hi;
+ if (x <= 0)
+ x += 0x7fffffff;
+ return (x);
+#endif /* !USE_WEAK_SEEDING */
+}
+
+/*
+ * srandom:
+ *
+ * Initialize the random number generator based on the given seed. If the
+ * type is the trivial no-state-information type, just remember the seed.
+ * Otherwise, initializes state[] based on the given "seed" via a linear
+ * congruential generator. Then, the pointers are set to known locations
+ * that are exactly rand_sep places apart. Lastly, it cycles the state
+ * information a given number of times to get rid of any initial dependencies
+ * introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
+ * for default usage relies on values produced by this routine.
+ */
+void
+ntp_srandom(
+ unsigned long x
+ )
+{
+ long i;
+
+ if (rand_type == TYPE_0) {
+ state[0] = x;
+ } else {
+ state[0] = x;
+ for (i = 1; i < rand_deg; i++)
+ state[i] = good_rand(state[i - 1]);
+ fptr = &state[rand_sep];
+ rptr = &state[0];
+ for (i = 0; i < 10 * rand_deg; i++)
+ x = ntp_random();
+ }
+
+ /* seed the likely faster (and poorer) rand() as well */
+ srand((u_int)x);
+}
+
+/*
+ * srandomdev:
+ *
+ * Many programs choose the seed value in a totally predictable manner.
+ * This often causes problems. We seed the generator using the much more
+ * secure urandom(4) interface. Note that this particular seeding
+ * procedure can generate states which are impossible to reproduce by
+ * calling srandom() with any value, since the succeeding terms in the
+ * state buffer are no longer derived from the LC algorithm applied to
+ * a fixed seed.
+ */
+#ifdef NEED_SRANDOMDEV
+void
+ntp_srandomdev( void )
+{
+ struct timeval tv;
+ unsigned long junk; /* Purposely used uninitialized */
+
+ GETTIMEOFDAY(&tv, NULL);
+ ntp_srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk);
+ return;
+}
+#endif
+
+
+/*
+ * ntp_initstate() and ntp_setstate() are unused in our codebase and
+ * trigger warnings due to casting to a more-strictly-aligned pointer
+ * on alignment-sensitive platforms. #ifdef them away to save noise,
+ * build time, and binary space, but retain the code in case we find a
+ * use.
+ */
+#ifdef COMPILE_UNUSED_FUNCTIONS
+/*
+ * Array versions of the above information to make code run faster --
+ * relies on fact that TYPE_i == i.
+ */
+#define MAX_TYPES 5 /* max number of types above */
+
+static long degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 };
+static long seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 };
+
+/*
+ * initstate:
+ *
+ * Initialize the state information in the given array of n bytes for future
+ * random number generation. Based on the number of bytes we are given, and
+ * the break values for the different R.N.G.'s, we choose the best (largest)
+ * one we can and set things up for it. srandom() is then called to
+ * initialize the state information.
+ *
+ * Note that on return from srandom(), we set state[-1] to be the type
+ * multiplexed with the current value of the rear pointer; this is so
+ * successive calls to initstate() won't lose this information and will be
+ * able to restart with setstate().
+ *
+ * Note: the first thing we do is save the current state, if any, just like
+ * setstate() so that it doesn't matter when initstate is called.
+ *
+ * Returns a pointer to the old state.
+ *
+ * Note: The Sparc platform requires that arg_state begin on a long
+ * word boundary; otherwise a bus error will occur. Even so, lint will
+ * complain about mis-alignment, but you should disregard these messages.
+ */
+char *
+ntp_initstate(
+ unsigned long seed, /* seed for R.N.G. */
+ char *arg_state, /* pointer to state array */
+ long n /* # bytes of state info */
+ )
+{
+ register char *ostate = (char *)(&state[-1]);
+ register long *long_arg_state = (long *) arg_state;
+
+ if (rand_type == TYPE_0)
+ state[-1] = rand_type;
+ else
+ state[-1] = MAX_TYPES * (rptr - state) + rand_type;
+ if (n < BREAK_0) {
+ (void)fprintf(stderr,
+ "random: not enough state (%ld bytes); ignored.\n", n);
+ return(0);
+ }
+ if (n < BREAK_1) {
+ rand_type = TYPE_0;
+ rand_deg = DEG_0;
+ rand_sep = SEP_0;
+ } else if (n < BREAK_2) {
+ rand_type = TYPE_1;
+ rand_deg = DEG_1;
+ rand_sep = SEP_1;
+ } else if (n < BREAK_3) {
+ rand_type = TYPE_2;
+ rand_deg = DEG_2;
+ rand_sep = SEP_2;
+ } else if (n < BREAK_4) {
+ rand_type = TYPE_3;
+ rand_deg = DEG_3;
+ rand_sep = SEP_3;
+ } else {
+ rand_type = TYPE_4;
+ rand_deg = DEG_4;
+ rand_sep = SEP_4;
+ }
+ state = (unsigned long *) (long_arg_state + 1); /* first location */
+ end_ptr = &state[rand_deg]; /* must set end_ptr before srandom */
+ ntp_srandom(seed);
+ if (rand_type == TYPE_0)
+ long_arg_state[0] = rand_type;
+ else
+ long_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type;
+ return(ostate);
+}
+
+/*
+ * setstate:
+ *
+ * Restore the state from the given state array.
+ *
+ * Note: it is important that we also remember the locations of the pointers
+ * in the current state information, and restore the locations of the pointers
+ * from the old state information. This is done by multiplexing the pointer
+ * location into the zeroeth word of the state information.
+ *
+ * Note that due to the order in which things are done, it is OK to call
+ * setstate() with the same state as the current state.
+ *
+ * Returns a pointer to the old state information.
+ *
+ * Note: The Sparc platform requires that arg_state begin on a long
+ * word boundary; otherwise a bus error will occur. Even so, lint will
+ * complain about mis-alignment, but you should disregard these messages.
+ */
+char *
+ntp_setstate(
+ char *arg_state /* pointer to state array */
+ )
+{
+ register unsigned long *new_state = (unsigned long *) arg_state;
+ register long type = new_state[0] % MAX_TYPES;
+ register long rear = new_state[0] / MAX_TYPES;
+ char *ostate = (char *)(&state[-1]);
+
+ if (rand_type == TYPE_0)
+ state[-1] = rand_type;
+ else
+ state[-1] = MAX_TYPES * (rptr - state) + rand_type;
+ switch(type) {
+ case TYPE_0:
+ case TYPE_1:
+ case TYPE_2:
+ case TYPE_3:
+ case TYPE_4:
+ rand_type = type;
+ rand_deg = degrees[type];
+ rand_sep = seps[type];
+ break;
+ default:
+ (void)fprintf(stderr,
+ "random: state info corrupted; not changed.\n");
+ }
+ state = (new_state + 1);
+ if (rand_type != TYPE_0) {
+ rptr = &state[rear];
+ fptr = &state[(rear + rand_sep) % rand_deg];
+ }
+ end_ptr = &state[rand_deg]; /* set end_ptr too */
+ return(ostate);
+}
+#endif /* COMPILE_UNUSED_FUNCTIONS */
+
+
+/*
+ * random:
+ *
+ * If we are using the trivial TYPE_0 R.N.G., just do the old linear
+ * congruential bit. Otherwise, we do our fancy trinomial stuff, which is
+ * the same in all the other cases due to all the global variables that have
+ * been set up. The basic operation is to add the number at the rear pointer
+ * into the one at the front pointer. Then both pointers are advanced to
+ * the next location cyclically in the table. The value returned is the sum
+ * generated, reduced to 31 bits by throwing away the "least random" low bit.
+ *
+ * Note: the code takes advantage of the fact that both the front and
+ * rear pointers can't wrap on the same call by not testing the rear
+ * pointer if the front one has wrapped.
+ *
+ * Returns a 31-bit random number.
+ */
+long
+ntp_random( void )
+{
+ register long i;
+ register unsigned long *f, *r;
+
+ if (rand_type == TYPE_0) {
+ i = state[0];
+ state[0] = i = (good_rand(i)) & 0x7fffffff;
+ } else {
+ /*
+ * Use local variables rather than static variables for speed.
+ */
+ f = fptr; r = rptr;
+ *f += *r;
+ i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */
+ if (++f >= end_ptr) {
+ f = state;
+ ++r;
+ }
+ else if (++r >= end_ptr) {
+ r = state;
+ }
+
+ fptr = f; rptr = r;
+ }
+ return(i);
+}
diff --git a/libntp/ntp_rfc2553.c b/libntp/ntp_rfc2553.c
new file mode 100644
index 0000000..f267999
--- /dev/null
+++ b/libntp/ntp_rfc2553.c
@@ -0,0 +1,576 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1982, 1986, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+/*
+ * Compatability shims with the rfc2553 API to simplify ntp.
+ */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <ctype.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <isc/net.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include "ntp_rfc2553.h"
+
+#include "ntpd.h"
+#include "ntp_malloc.h"
+#include "ntp_string.h"
+#include "ntp_debug.h"
+
+
+/*
+ * copy_addrinfo() - copy a single addrinfo to malloc()'d block.
+ * copy_addrinfo_list() - copy an addrinfo list to malloc()'d block.
+ *
+ * Copies an addrinfo list and its associated data to a contiguous block
+ * of storage from emalloc(). Callback routines invoked via
+ * getaddrinfo_sometime() have access to the resulting addrinfo list
+ * only until they return. This routine provides an easy way to make a
+ * persistent copy. Although the list provided to gai_sometime_callback
+ * routines is similarly contiguous, to keep this code usable in any
+ * context where we might want to duplicate an addrinfo list, it does
+ * not require the input list be contiguous.
+ *
+ * The returned list head pointer is passed to free() to release the
+ * entire list.
+ *
+ * In keeping with the rest of the NTP distribution, sockaddr_u is used
+ * in preference to struct sockaddr_storage, which is a member of the
+ * former union and so compatible.
+ *
+ * The rest of ntp_rfc2553.c is conditioned on ISC_PLATFORM_HAVEIPV6
+ * not being defined, copy_addrinfo_*() are exceptions.
+ */
+struct addrinfo * copy_addrinfo_common(const struct addrinfo *, int
+#ifdef EREALLOC_CALLSITE
+ ,
+ const char *, int
+#endif
+ );
+
+
+struct addrinfo *
+copy_addrinfo_impl(
+ const struct addrinfo * src
+#ifdef EREALLOC_CALLSITE
+ ,
+ const char * caller_file,
+ int caller_line
+#endif
+ )
+{
+ return copy_addrinfo_common(src, TRUE
+#ifdef EREALLOC_CALLSITE
+ ,
+ caller_file, caller_line
+#endif
+ );
+}
+
+
+struct addrinfo *
+copy_addrinfo_list_impl(
+ const struct addrinfo * src
+#ifdef EREALLOC_CALLSITE
+ ,
+ const char * caller_file,
+ int caller_line
+#endif
+ )
+{
+ return copy_addrinfo_common(src, FALSE
+#ifdef EREALLOC_CALLSITE
+ ,
+ caller_file, caller_line
+#endif
+ );
+}
+
+
+struct addrinfo *
+copy_addrinfo_common(
+ const struct addrinfo * src,
+ int just_one
+#ifdef EREALLOC_CALLSITE
+ ,
+ const char * caller_file,
+ int caller_line
+#endif
+ )
+{
+ const struct addrinfo * ai_src;
+ const struct addrinfo * ai_nxt;
+ struct addrinfo * ai_cpy;
+ struct addrinfo * dst;
+ sockaddr_u * psau;
+ char * pcanon;
+ u_int elements;
+ size_t octets;
+ size_t canons_octets;
+ size_t str_octets;
+
+ elements = 0;
+ canons_octets = 0;
+
+ for (ai_src = src; NULL != ai_src; ai_src = ai_nxt) {
+ if (just_one)
+ ai_nxt = NULL;
+ else
+ ai_nxt = ai_src->ai_next;
+ ++elements;
+ if (NULL != ai_src->ai_canonname)
+ canons_octets += 1 + strlen(ai_src->ai_canonname);
+ }
+
+ octets = elements * (sizeof(*ai_cpy) + sizeof(*psau));
+ octets += canons_octets;
+
+ dst = erealloczsite(NULL, octets, 0, TRUE, caller_file,
+ caller_line);
+ ai_cpy = dst;
+ psau = (void *)(ai_cpy + elements);
+ pcanon = (void *)(psau + elements);
+
+ for (ai_src = src; NULL != ai_src; ai_src = ai_nxt) {
+ if (just_one)
+ ai_nxt = NULL;
+ else
+ ai_nxt = ai_src->ai_next;
+ *ai_cpy = *ai_src;
+ REQUIRE(ai_src->ai_addrlen <= sizeof(sockaddr_u));
+ memcpy(psau, ai_src->ai_addr, ai_src->ai_addrlen);
+ ai_cpy->ai_addr = &psau->sa;
+ ++psau;
+ if (NULL != ai_cpy->ai_canonname) {
+ ai_cpy->ai_canonname = pcanon;
+ str_octets = 1 + strlen(ai_src->ai_canonname);
+ memcpy(pcanon, ai_src->ai_canonname, str_octets);
+ pcanon += str_octets;
+ }
+ if (NULL != ai_cpy->ai_next) {
+ if (just_one)
+ ai_cpy->ai_next = NULL;
+ else
+ ai_cpy->ai_next = ai_cpy + 1;
+ }
+ ++ai_cpy;
+ }
+ NTP_ENSURE(pcanon == ((char *)dst + octets));
+
+ return dst;
+}
+
+
+#ifndef ISC_PLATFORM_HAVEIPV6
+
+static char *ai_errlist[] = {
+ "Success",
+ "Address family for hostname not supported", /* EAI_ADDRFAMILY */
+ "Temporary failure in name resolution", /* EAI_AGAIN */
+ "Invalid value for ai_flags", /* EAI_BADFLAGS */
+ "Non-recoverable failure in name resolution", /* EAI_FAIL */
+ "ai_family not supported", /* EAI_FAMILY */
+ "Memory allocation failure", /* EAI_MEMORY */
+ "No address associated with hostname", /* EAI_NODATA */
+ "hostname nor servname provided, or not known", /* EAI_NONAME */
+ "servname not supported for ai_socktype", /* EAI_SERVICE */
+ "ai_socktype not supported", /* EAI_SOCKTYPE */
+ "System error returned in errno", /* EAI_SYSTEM */
+ "Invalid value for hints", /* EAI_BADHINTS */
+ "Resolved protocol is unknown", /* EAI_PROTOCOL */
+ "Unknown error", /* EAI_MAX */
+};
+
+/*
+ * Local declaration
+ */
+int
+DNSlookup_name(
+ const char *name,
+ int ai_family,
+ struct hostent **Addresses
+);
+
+#ifndef SYS_WINNT
+/*
+ * Encapsulate gethostbyname to control the error code
+ */
+int
+DNSlookup_name(
+ const char *name,
+ int ai_family,
+ struct hostent **Addresses
+)
+{
+ *Addresses = gethostbyname(name);
+ return (h_errno);
+}
+#endif
+
+static int do_nodename (const char *nodename, struct addrinfo *ai,
+ const struct addrinfo *hints);
+
+int
+getaddrinfo (const char *nodename, const char *servname,
+ const struct addrinfo *hints, struct addrinfo **res)
+{
+ int rval;
+ struct servent *sp;
+ struct addrinfo *ai = NULL;
+ int port;
+ const char *proto = NULL;
+ int family, socktype, flags, protocol;
+
+
+ /*
+ * If no name is provide just return an error
+ */
+ if (nodename == NULL && servname == NULL)
+ return (EAI_NONAME);
+
+ ai = calloc(sizeof(struct addrinfo), 1);
+ if (ai == NULL)
+ return (EAI_MEMORY);
+
+ /*
+ * Copy default values from hints, if available
+ */
+ if (hints != NULL) {
+ ai->ai_flags = hints->ai_flags;
+ ai->ai_family = hints->ai_family;
+ ai->ai_socktype = hints->ai_socktype;
+ ai->ai_protocol = hints->ai_protocol;
+
+ family = hints->ai_family;
+ socktype = hints->ai_socktype;
+ protocol = hints->ai_protocol;
+ flags = hints->ai_flags;
+
+ switch (family) {
+ case AF_UNSPEC:
+ switch (hints->ai_socktype) {
+ case SOCK_STREAM:
+ proto = "tcp";
+ break;
+ case SOCK_DGRAM:
+ proto = "udp";
+ break;
+ }
+ break;
+ case AF_INET:
+ case AF_INET6:
+ switch (hints->ai_socktype) {
+ case 0:
+ break;
+ case SOCK_STREAM:
+ proto = "tcp";
+ break;
+ case SOCK_DGRAM:
+ proto = "udp";
+ break;
+ case SOCK_RAW:
+ break;
+ default:
+ return (EAI_SOCKTYPE);
+ }
+ break;
+#ifdef AF_LOCAL
+ case AF_LOCAL:
+ switch (hints->ai_socktype) {
+ case 0:
+ break;
+ case SOCK_STREAM:
+ break;
+ case SOCK_DGRAM:
+ break;
+ default:
+ return (EAI_SOCKTYPE);
+ }
+ break;
+#endif
+ default:
+ return (EAI_FAMILY);
+ }
+ } else {
+ protocol = 0;
+ family = 0;
+ socktype = 0;
+ flags = 0;
+ }
+
+ rval = do_nodename(nodename, ai, hints);
+ if (rval != 0) {
+ freeaddrinfo(ai);
+ return (rval);
+ }
+
+ /*
+ * First, look up the service name (port) if it was
+ * requested. If the socket type wasn't specified, then
+ * try and figure it out.
+ */
+ if (servname != NULL) {
+ char *e;
+
+ port = strtol(servname, &e, 10);
+ if (*e == '\0') {
+ if (socktype == 0)
+ return (EAI_SOCKTYPE);
+ if (port < 0 || port > 65535)
+ return (EAI_SERVICE);
+ port = htons((unsigned short) port);
+ } else {
+ sp = getservbyname(servname, proto);
+ if (sp == NULL)
+ return (EAI_SERVICE);
+ port = sp->s_port;
+ if (socktype == 0) {
+ if (strcmp(sp->s_proto, "tcp") == 0)
+ socktype = SOCK_STREAM;
+ else if (strcmp(sp->s_proto, "udp") == 0)
+ socktype = SOCK_DGRAM;
+ }
+ }
+ } else
+ port = 0;
+
+ /*
+ *
+ * Set up the port number
+ */
+ if (ai->ai_family == AF_INET)
+ ((struct sockaddr_in *)ai->ai_addr)->sin_port = (unsigned short) port;
+ else if (ai->ai_family == AF_INET6)
+ ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port = (unsigned short) port;
+ *res = ai;
+ return (0);
+}
+
+void
+freeaddrinfo(struct addrinfo *ai)
+{
+ if (ai->ai_canonname != NULL)
+ {
+ free(ai->ai_canonname);
+ ai->ai_canonname = NULL;
+ }
+ if (ai->ai_addr != NULL)
+ {
+ free(ai->ai_addr);
+ ai->ai_addr = NULL;
+ }
+ free(ai);
+ ai = NULL;
+}
+
+int
+getnameinfo (const struct sockaddr *sa, u_int salen, char *host,
+ size_t hostlen, char *serv, size_t servlen, int flags)
+{
+ struct hostent *hp;
+
+ if (sa->sa_family != AF_INET)
+ return (EAI_FAMILY);
+ hp = gethostbyaddr(
+ (const char *)&((const struct sockaddr_in *)sa)->sin_addr,
+ 4, AF_INET);
+ if (hp == NULL) {
+ if (h_errno == TRY_AGAIN)
+ return (EAI_AGAIN);
+ else
+ return (EAI_FAIL);
+ }
+ if (host != NULL && hostlen > 0)
+ strlcpy(host, hp->h_name, hostlen);
+ return (0);
+}
+
+char *
+gai_strerror(int ecode)
+{
+ if (ecode < 0 || ecode > EAI_MAX)
+ ecode = EAI_MAX;
+ return ai_errlist[ecode];
+}
+
+static int
+do_nodename(
+ const char *nodename,
+ struct addrinfo *ai,
+ const struct addrinfo *hints)
+{
+ struct hostent *hp = NULL;
+ struct sockaddr_in *sockin;
+ struct sockaddr_in6 *sockin6;
+ int errval;
+
+ ai->ai_addr = calloc(sizeof(struct sockaddr_storage), 1);
+ if (ai->ai_addr == NULL)
+ return (EAI_MEMORY);
+
+ /*
+ * For an empty node name just use the wildcard.
+ * NOTE: We need to assume that the address family is
+ * set elsewhere so that we can set the appropriate wildcard
+ */
+ if (nodename == NULL) {
+ ai->ai_addrlen = sizeof(struct sockaddr_storage);
+ if (ai->ai_family == AF_INET)
+ {
+ sockin = (struct sockaddr_in *)ai->ai_addr;
+ sockin->sin_family = (short) ai->ai_family;
+ sockin->sin_addr.s_addr = htonl(INADDR_ANY);
+ }
+ else
+ {
+ sockin6 = (struct sockaddr_in6 *)ai->ai_addr;
+ sockin6->sin6_family = (short) ai->ai_family;
+ /*
+ * we have already zeroed out the address
+ * so we don't actually need to do this
+ * This assignment is causing problems so
+ * we don't do what this would do.
+ sockin6->sin6_addr = in6addr_any;
+ */
+ }
+#ifdef ISC_PLATFORM_HAVESALEN
+ ai->ai_addr->sa_len = SOCKLEN(ai->ai_addr);
+#endif
+
+ return (0);
+ }
+
+ /*
+ * See if we have an IPv6 address
+ */
+ if(strchr(nodename, ':') != NULL) {
+ if (inet_pton(AF_INET6, nodename,
+ &((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr) == 1) {
+ ((struct sockaddr_in6 *)ai->ai_addr)->sin6_family = AF_INET6;
+ ai->ai_family = AF_INET6;
+ ai->ai_addrlen = sizeof(struct sockaddr_in6);
+ return (0);
+ }
+ }
+
+ /*
+ * See if we have an IPv4 address
+ */
+ if (inet_pton(AF_INET, nodename,
+ &((struct sockaddr_in *)ai->ai_addr)->sin_addr) == 1) {
+ ((struct sockaddr *)ai->ai_addr)->sa_family = AF_INET;
+ ai->ai_family = AF_INET;
+ ai->ai_addrlen = sizeof(struct sockaddr_in);
+ return (0);
+ }
+
+ /*
+ * If the numeric host flag is set, don't attempt resolution
+ */
+ if (hints != NULL && (hints->ai_flags & AI_NUMERICHOST))
+ return (EAI_NONAME);
+
+ /*
+ * Look for a name
+ */
+
+ errval = DNSlookup_name(nodename, AF_INET, &hp);
+
+ if (hp == NULL) {
+ if (errval == TRY_AGAIN || errval == EAI_AGAIN)
+ return (EAI_AGAIN);
+ else if (errval == EAI_NONAME) {
+ if (inet_pton(AF_INET, nodename,
+ &((struct sockaddr_in *)ai->ai_addr)->sin_addr) == 1) {
+ ((struct sockaddr *)ai->ai_addr)->sa_family = AF_INET;
+ ai->ai_family = AF_INET;
+ ai->ai_addrlen = sizeof(struct sockaddr_in);
+ return (0);
+ }
+ return (errval);
+ }
+ else
+ {
+ return (errval);
+ }
+ }
+ ai->ai_family = hp->h_addrtype;
+ ai->ai_addrlen = sizeof(struct sockaddr);
+ sockin = (struct sockaddr_in *)ai->ai_addr;
+ memcpy(&sockin->sin_addr, hp->h_addr, hp->h_length);
+ ai->ai_addr->sa_family = hp->h_addrtype;
+#ifdef ISC_PLATFORM_HAVESALEN
+ ai->ai_addr->sa_len = sizeof(struct sockaddr);
+#endif
+ if (hints != NULL && (hints->ai_flags & AI_CANONNAME))
+ ai->ai_canonname = estrdup(hp->h_name);
+ return (0);
+}
+
+#endif /* !ISC_PLATFORM_HAVEIPV6 */
diff --git a/libntp/ntp_worker.c b/libntp/ntp_worker.c
new file mode 100644
index 0000000..bb1cb87
--- /dev/null
+++ b/libntp/ntp_worker.c
@@ -0,0 +1,340 @@
+/*
+ * ntp_worker.c
+ */
+#include <config.h>
+#include "ntp_workimpl.h"
+
+#ifdef WORKER
+
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+
+#include "iosignal.h"
+#include "ntp_stdlib.h"
+#include "ntp_malloc.h"
+#include "ntp_syslog.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_assert.h"
+#include "ntp_unixtime.h"
+#include "intreswork.h"
+
+
+#define CHILD_MAX_IDLE (3 * 60) /* seconds, idle worker limit */
+
+blocking_child ** blocking_children;
+size_t blocking_children_alloc;
+int worker_per_query; /* boolean */
+int intres_req_pending;
+
+
+#ifndef HAVE_IO_COMPLETION_PORT
+/*
+ * pipe_socketpair()
+ *
+ * Provides an AF_UNIX socketpair on systems which have them, otherwise
+ * pair of unidirectional pipes.
+ */
+int
+pipe_socketpair(
+ int caller_fds[2],
+ int * is_pipe
+ )
+{
+ int rc;
+ int fds[2];
+ int called_pipe;
+
+#ifdef HAVE_SOCKETPAIR
+ rc = socketpair(AF_UNIX, SOCK_STREAM, 0, &fds[0]);
+#else
+ rc = -1;
+#endif
+
+ if (-1 == rc) {
+ rc = pipe(&fds[0]);
+ called_pipe = TRUE;
+ } else {
+ called_pipe = FALSE;
+ }
+
+ if (-1 == rc)
+ return rc;
+
+ caller_fds[0] = fds[0];
+ caller_fds[1] = fds[1];
+ if (is_pipe != NULL)
+ *is_pipe = called_pipe;
+
+ return 0;
+}
+
+
+/*
+ * close_all_except()
+ *
+ * Close all file descriptors except the given keep_fd.
+ */
+void
+close_all_except(
+ int keep_fd
+ )
+{
+ int fd;
+
+ for (fd = 0; fd < keep_fd; fd++)
+ close(fd);
+
+ close_all_beyond(keep_fd);
+}
+
+
+/*
+ * close_all_beyond()
+ *
+ * Close all file descriptors after the given keep_fd, which is the
+ * highest fd to keep open.
+ */
+void
+close_all_beyond(
+ int keep_fd
+ )
+{
+# ifdef HAVE_CLOSEFROM
+ closefrom(keep_fd + 1);
+# elif defined(F_CLOSEM)
+ /*
+ * From 'Writing Reliable AIX Daemons,' SG24-4946-00,
+ * by Eric Agar (saves us from doing 32767 system
+ * calls)
+ */
+ if (fcntl(keep_fd + 1, F_CLOSEM, 0) == -1)
+ msyslog(LOG_ERR, "F_CLOSEM(%d): %m", keep_fd + 1);
+# else /* !HAVE_CLOSEFROM && !F_CLOSEM follows */
+ int fd;
+ int max_fd;
+
+ max_fd = GETDTABLESIZE();
+ for (fd = keep_fd + 1; fd < max_fd; fd++)
+ close(fd);
+# endif /* !HAVE_CLOSEFROM && !F_CLOSEM */
+}
+#endif /* HAVE_IO_COMPLETION_PORT */
+
+
+u_int
+available_blocking_child_slot(void)
+{
+ const size_t each = sizeof(blocking_children[0]);
+ u_int slot;
+ size_t prev_alloc;
+ size_t new_alloc;
+ size_t prev_octets;
+ size_t octets;
+
+ for (slot = 0; slot < blocking_children_alloc; slot++) {
+ if (NULL == blocking_children[slot])
+ return slot;
+ if (blocking_children[slot]->reusable) {
+ blocking_children[slot]->reusable = FALSE;
+ return slot;
+ }
+ }
+
+ prev_alloc = blocking_children_alloc;
+ prev_octets = prev_alloc * each;
+ new_alloc = blocking_children_alloc + 4;
+ octets = new_alloc * each;
+ blocking_children = erealloc_zero(blocking_children, octets,
+ prev_octets);
+ blocking_children_alloc = new_alloc;
+
+ return prev_alloc;
+}
+
+
+int
+queue_blocking_request(
+ blocking_work_req rtype,
+ void * req,
+ size_t reqsize,
+ blocking_work_callback done_func,
+ void * context
+ )
+{
+ static u_int intres_slot = UINT_MAX;
+ u_int child_slot;
+ blocking_child * c;
+ blocking_pipe_header req_hdr;
+
+ req_hdr.octets = sizeof(req_hdr) + reqsize;
+ req_hdr.magic_sig = BLOCKING_REQ_MAGIC;
+ req_hdr.rtype = rtype;
+ req_hdr.done_func = done_func;
+ req_hdr.context = context;
+
+ child_slot = UINT_MAX;
+ if (worker_per_query || UINT_MAX == intres_slot ||
+ blocking_children[intres_slot]->reusable)
+ child_slot = available_blocking_child_slot();
+ if (!worker_per_query) {
+ if (UINT_MAX == intres_slot)
+ intres_slot = child_slot;
+ else
+ child_slot = intres_slot;
+ if (0 == intres_req_pending)
+ intres_timeout_req(0);
+ }
+ intres_req_pending++;
+ INSIST(UINT_MAX != child_slot);
+ c = blocking_children[child_slot];
+ if (NULL == c) {
+ c = emalloc_zero(sizeof(*c));
+#ifdef WORK_FORK
+ c->req_read_pipe = -1;
+ c->req_write_pipe = -1;
+#endif
+#ifdef WORK_PIPE
+ c->resp_read_pipe = -1;
+ c->resp_write_pipe = -1;
+#endif
+ blocking_children[child_slot] = c;
+ }
+ req_hdr.child_idx = child_slot;
+
+ return send_blocking_req_internal(c, &req_hdr, req);
+}
+
+
+int queue_blocking_response(
+ blocking_child * c,
+ blocking_pipe_header * resp,
+ size_t respsize,
+ const blocking_pipe_header * req
+ )
+{
+ resp->octets = respsize;
+ resp->magic_sig = BLOCKING_RESP_MAGIC;
+ resp->rtype = req->rtype;
+ resp->context = req->context;
+ resp->done_func = req->done_func;
+
+ return send_blocking_resp_internal(c, resp);
+}
+
+
+void
+process_blocking_resp(
+ blocking_child * c
+ )
+{
+ blocking_pipe_header * resp;
+ void * data;
+
+ /*
+ * On Windows send_blocking_resp_internal() may signal the
+ * blocking_response_ready event multiple times while we're
+ * processing a response, so always consume all available
+ * responses before returning to test the event again.
+ */
+#ifdef WORK_THREAD
+ do {
+#endif
+ resp = receive_blocking_resp_internal(c);
+ if (NULL != resp) {
+ DEBUG_REQUIRE(BLOCKING_RESP_MAGIC ==
+ resp->magic_sig);
+ data = (char *)resp + sizeof(*resp);
+ intres_req_pending--;
+ (*resp->done_func)(resp->rtype, resp->context,
+ resp->octets - sizeof(*resp),
+ data);
+ free(resp);
+ }
+#ifdef WORK_THREAD
+ } while (NULL != resp);
+#endif
+ if (!worker_per_query && 0 == intres_req_pending)
+ intres_timeout_req(CHILD_MAX_IDLE);
+ else if (worker_per_query)
+ req_child_exit(c);
+}
+
+
+/*
+ * blocking_child_common runs as a forked child or a thread
+ */
+int
+blocking_child_common(
+ blocking_child *c
+ )
+{
+ int say_bye;
+ blocking_pipe_header *req;
+
+ say_bye = FALSE;
+ while (!say_bye) {
+ req = receive_blocking_req_internal(c);
+ if (NULL == req) {
+ say_bye = TRUE;
+ break;
+ }
+
+ DEBUG_REQUIRE(BLOCKING_REQ_MAGIC == req->magic_sig);
+
+ switch (req->rtype) {
+ case BLOCKING_GETADDRINFO:
+ if (blocking_getaddrinfo(c, req))
+ say_bye = TRUE;
+ break;
+
+ case BLOCKING_GETNAMEINFO:
+ if (blocking_getnameinfo(c, req))
+ say_bye = TRUE;
+ break;
+
+ default:
+ msyslog(LOG_ERR, "unknown req %d to blocking worker", req->rtype);
+ say_bye = TRUE;
+ }
+
+ free(req);
+ }
+
+ return 0;
+}
+
+
+/*
+ * worker_idle_timer_fired()
+ *
+ * The parent starts this timer when the last pending response has been
+ * received from the child, making it idle, and clears the timer when a
+ * request is dispatched to the child. Once the timer expires, the
+ * child is sent packing.
+ *
+ * This is called when worker_idle_timer is nonzero and less than or
+ * equal to current_time.
+ */
+void
+worker_idle_timer_fired(void)
+{
+ u_int idx;
+ blocking_child * c;
+
+ DEBUG_REQUIRE(0 == intres_req_pending);
+
+ intres_timeout_req(0);
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+ if (NULL == c)
+ continue;
+ req_child_exit(c);
+ }
+}
+
+
+#else /* !WORKER follows */
+int ntp_worker_nonempty_compilation_unit;
+#endif
diff --git a/libntp/numtoa.c b/libntp/numtoa.c
new file mode 100644
index 0000000..5efbe94
--- /dev/null
+++ b/libntp/numtoa.c
@@ -0,0 +1,59 @@
+/*
+ * numtoa - return asciized network numbers store in local array space
+ */
+#include <config.h>
+
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h> /* ntohl */
+#endif
+
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+
+char *
+numtoa(
+ u_int32 num
+ )
+{
+ register u_int32 netnum;
+ register char *buf;
+
+ netnum = ntohl(num);
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH, "%lu.%lu.%lu.%lu",
+ ((u_long)netnum >> 24) & 0xff,
+ ((u_long)netnum >> 16) & 0xff,
+ ((u_long)netnum >> 8) & 0xff,
+ (u_long)netnum & 0xff);
+ return buf;
+}
+
+
+/* Convert a refid & stratum to a string */
+const char *
+refid_str(
+ u_int32 refid,
+ int stratum
+ )
+{
+ char * text;
+ size_t tlen;
+
+ if (stratum > 1)
+ return numtoa(refid);
+
+ LIB_GETBUF(text);
+ text[0] = '.';
+ memcpy(&text[1], &refid, sizeof(refid));
+ text[1 + sizeof(refid)] = '\0';
+ tlen = strlen(text);
+ text[tlen] = '.';
+ text[tlen + 1] = '\0';
+
+ return text;
+}
+
diff --git a/libntp/numtohost.c b/libntp/numtohost.c
new file mode 100644
index 0000000..6b250d6
--- /dev/null
+++ b/libntp/numtohost.c
@@ -0,0 +1,43 @@
+/*
+ * numtohost - convert network number to host name.
+ */
+#include <config.h>
+
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h> /* ntohl */
+#endif
+
+#include "ntp_fp.h"
+#include "ntp_stdlib.h"
+#include "lib_strbuf.h"
+
+#define LOOPBACKNET 0x7f000000
+#define LOOPBACKHOST 0x7f000001
+#define LOOPBACKNETMASK 0xff000000
+
+char *
+numtohost(
+ u_int32 netnum
+ )
+{
+ char *bp;
+ struct hostent *hp;
+
+ /*
+ * This is really gross, but saves lots of hanging looking for
+ * hostnames for the radio clocks. Don't bother looking up
+ * addresses on the loopback network except for the loopback
+ * host itself.
+ */
+ if ((((ntohl(netnum) & LOOPBACKNETMASK) == LOOPBACKNET)
+ && (ntohl(netnum) != LOOPBACKHOST))
+ || ((hp = gethostbyaddr((char *)&netnum, sizeof netnum, AF_INET))
+ == 0))
+ return numtoa(netnum);
+
+ LIB_GETBUF(bp);
+ strlcpy(bp, hp->h_name, LIB_BUFLENGTH);
+
+ return bp;
+}
diff --git a/libntp/octtoint.c b/libntp/octtoint.c
new file mode 100644
index 0000000..d189e40
--- /dev/null
+++ b/libntp/octtoint.c
@@ -0,0 +1,36 @@
+/*
+ * octtoint - convert an ascii string in octal to an unsigned
+ * long, with error checking
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntp_stdlib.h"
+
+int
+octtoint(
+ const char *str,
+ u_long *ival
+ )
+{
+ register u_long u;
+ register const char *cp;
+
+ cp = str;
+
+ if (*cp == '\0')
+ return 0;
+
+ u = 0;
+ while (*cp != '\0') {
+ if (!isdigit((int)*cp) || *cp == '8' || *cp == '9')
+ return 0;
+ if (u >= 0x20000000)
+ return 0; /* overflow */
+ u <<= 3;
+ u += *cp++ - '0'; /* ascii dependent */
+ }
+ *ival = u;
+ return 1;
+}
diff --git a/libntp/prettydate.c b/libntp/prettydate.c
new file mode 100644
index 0000000..f121297
--- /dev/null
+++ b/libntp/prettydate.c
@@ -0,0 +1,231 @@
+/*
+ * prettydate - convert a time stamp to something readable
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h" /* includes <sys/time.h> */
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+#include "ntp_calendar.h"
+
+#if SIZEOF_TIME_T < 4
+# error sizeof(time_t) < 4 -- this will not work!
+#endif
+
+static char *common_prettydate(l_fp *, int);
+
+const char * const months[12] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+const char * const daynames[7] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+/* Helper function to handle possible wraparound of the ntp epoch.
+ *
+ * Works by periodic extension of the ntp time stamp in the UN*X epoch.
+ * If the 'time_t' is 32 bit, use solar cycle warping to get the value
+ * in a suitable range. Also uses solar cycle warping to work around
+ * really buggy implementations of 'gmtime()' / 'localtime()' that
+ * cannot work with a negative time value, that is, times before
+ * 1970-01-01. (MSVCRT...)
+ *
+ * Apart from that we're assuming that the localtime/gmtime library
+ * functions have been updated so that they work...
+ *
+ * An explanation: The julian calendar repeats ever 28 years, because
+ * it's the LCM of 7 and 1461, the week and leap year cycles. This is
+ * called a 'solar cycle'. The gregorian calendar does the same as
+ * long as no centennial year (divisible by 100, but not 400) goes in
+ * the way. So between 1901 and 2099 (inclusive) we can warp time
+ * stamps by 28 years to make them suitable for localtime() and
+ * gmtime() if we have trouble. Of course this will play hubbubb with
+ * the DST zone switches, so we should do it only if necessary; but as
+ * we NEED a proper conversion to dates via gmtime() we should try to
+ * cope with as many idiosyncrasies as possible.
+ *
+ */
+
+/*
+ * solar cycle in unsigned secs and years, and the cycle limits.
+ */
+#define SOLAR_CYCLE_SECS 0x34AADC80UL /* 7*1461*86400*/
+#define SOLAR_CYCLE_YEARS 28
+#define MINFOLD -3
+#define MAXFOLD 3
+
+static struct tm *
+get_struct_tm(
+ const vint64 *stamp,
+ int local)
+{
+ struct tm *tm = NULL;
+ int32 folds = 0;
+ time_t ts;
+
+#ifdef HAVE_INT64
+
+ int64 tl;
+ ts = tl = stamp->q_s;
+
+ /*
+ * If there is chance of truncation, try to fix it. Let the
+ * compiler find out if this can happen at all.
+ */
+ while (ts != tl) { /* truncation? */
+ if (tl < 0) {
+ if (--folds < MINFOLD)
+ return NULL;
+ tl += SOLAR_CYCLE_SECS;
+ } else {
+ if (++folds > MAXFOLD)
+ return NULL;
+ tl -= SOLAR_CYCLE_SECS;
+ }
+ ts = tl; /* next try... */
+ }
+#else
+
+ /*
+ * since we do not have 64-bit scalars, it's not likely we have
+ * 64-bit time_t. Assume 32 bits and properly reduce the value.
+ */
+ u_int32 hi, lo;
+
+ hi = stamp->D_s.hi;
+ lo = stamp->D_s.lo;
+
+ while ((hi && ~hi) || ((hi ^ lo) & 0x80000000u)) {
+ if (M_ISNEG(hi, lo)) {
+ if (--folds < MINFOLD)
+ return NULL;
+ M_ADD(hi, lo, 0, SOLAR_CYCLE_SECS);
+ } else {
+ if (++folds > MAXFOLD)
+ return NULL;
+ M_SUB(hi, lo, 0, SOLAR_CYCLE_SECS);
+ }
+ }
+ ts = (int32)lo;
+
+#endif
+
+ /*
+ * 'ts' should be a suitable value by now. Just go ahead, but
+ * with care:
+ *
+ * There are some pathological implementations of 'gmtime()'
+ * and 'localtime()' out there. No matter if we have 32-bit or
+ * 64-bit 'time_t', try to fix this by solar cycle warping
+ * again...
+ *
+ * At least the MSDN says that the (Microsoft) Windoze
+ * versions of 'gmtime()' and 'localtime()' will bark on time
+ * stamps < 0.
+ */
+ while ((tm = (*(local ? localtime : gmtime))(&ts)) == NULL)
+ if (ts < 0) {
+ if (--folds < MINFOLD)
+ return NULL;
+ ts += SOLAR_CYCLE_SECS;
+ } else if (ts >= SOLAR_CYCLE_SECS) {
+ if (++folds > MAXFOLD)
+ return NULL;
+ ts -= SOLAR_CYCLE_SECS;
+ } else
+ return NULL; /* That's truly pathological! */
+
+ /* 'tm' surely not NULL here! */
+ NTP_INSIST(tm != NULL);
+ if (folds != 0) {
+ tm->tm_year += folds * SOLAR_CYCLE_YEARS;
+ if (tm->tm_year <= 0 || tm->tm_year >= 200)
+ return NULL; /* left warp range... can't help here! */
+ }
+
+ return tm;
+}
+
+static char *
+common_prettydate(
+ l_fp *ts,
+ int local
+ )
+{
+ static const char* pfmt[2] = {
+ "%08lx.%08lx %s, %s %2d %4d %2d:%02d:%02d.%03u",
+ "%08lx.%08lx [%s, %s %2d %4d %2d:%02d:%02d.%03u UTC]"
+ };
+
+ char *bp;
+ struct tm *tm;
+ u_int msec;
+ u_int32 ntps;
+ vint64 sec;
+
+ LIB_GETBUF(bp);
+
+ /* get & fix milliseconds */
+ ntps = ts->l_ui;
+ msec = ts->l_uf / 4294967; /* fract / (2 ** 32 / 1000) */
+ if (msec >= 1000u) {
+ msec -= 1000u;
+ ntps++;
+ }
+ sec = ntpcal_ntp_to_time(ntps, NULL);
+ tm = get_struct_tm(&sec, local);
+ if (!tm) {
+ /*
+ * get a replacement, but always in UTC, using
+ * ntpcal_time_to_date()
+ */
+ struct calendar jd;
+ ntpcal_time_to_date(&jd, &sec);
+ snprintf(bp, LIB_BUFLENGTH, pfmt[local != 0],
+ (u_long)ts->l_ui, (u_long)ts->l_uf,
+ daynames[jd.weekday], months[jd.month-1],
+ jd.monthday, jd.year, jd.hour,
+ jd.minute, jd.second, msec);
+ } else
+ snprintf(bp, LIB_BUFLENGTH, pfmt[0],
+ (u_long)ts->l_ui, (u_long)ts->l_uf,
+ daynames[tm->tm_wday], months[tm->tm_mon],
+ tm->tm_mday, 1900 + tm->tm_year, tm->tm_hour,
+ tm->tm_min, tm->tm_sec, msec);
+ return bp;
+}
+
+
+char *
+prettydate(
+ l_fp *ts
+ )
+{
+ return common_prettydate(ts, 1);
+}
+
+
+char *
+gmprettydate(
+ l_fp *ts
+ )
+{
+ return common_prettydate(ts, 0);
+}
+
+
+struct tm *
+ntp2unix_tm(
+ u_int32 ntp, int local
+ )
+{
+ vint64 vl;
+ vl = ntpcal_ntp_to_time(ntp, NULL);
+ return get_struct_tm(&vl, local);
+}
+
diff --git a/libntp/recvbuff.c b/libntp/recvbuff.c
new file mode 100644
index 0000000..83a9ee1
--- /dev/null
+++ b/libntp/recvbuff.c
@@ -0,0 +1,326 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include "ntp_assert.h"
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+#include "ntp_lists.h"
+#include "recvbuff.h"
+#include "iosignal.h"
+
+
+/*
+ * Memory allocation
+ */
+static u_long volatile full_recvbufs; /* recvbufs on full_recv_fifo */
+static u_long volatile free_recvbufs; /* recvbufs on free_recv_list */
+static u_long volatile total_recvbufs; /* total recvbufs currently in use */
+static u_long volatile lowater_adds; /* number of times we have added memory */
+static u_long volatile buffer_shortfall;/* number of missed free receive buffers
+ between replenishments */
+
+static DECL_FIFO_ANCHOR(recvbuf_t) full_recv_fifo;
+static recvbuf_t * free_recv_list;
+
+#if defined(SYS_WINNT)
+
+/*
+ * For Windows we need to set up a lock to manipulate the
+ * recv buffers to prevent corruption. We keep it lock for as
+ * short a time as possible
+ */
+static CRITICAL_SECTION RecvLock;
+# define LOCK() EnterCriticalSection(&RecvLock)
+# define UNLOCK() LeaveCriticalSection(&RecvLock)
+#else
+# define LOCK() do {} while (FALSE)
+# define UNLOCK() do {} while (FALSE)
+#endif
+
+#ifdef DEBUG
+static void uninit_recvbuff(void);
+#endif
+
+
+u_long
+free_recvbuffs (void)
+{
+ return free_recvbufs;
+}
+
+u_long
+full_recvbuffs (void)
+{
+ return full_recvbufs;
+}
+
+u_long
+total_recvbuffs (void)
+{
+ return total_recvbufs;
+}
+
+u_long
+lowater_additions(void)
+{
+ return lowater_adds;
+}
+
+static inline void
+initialise_buffer(recvbuf_t *buff)
+{
+ ZERO(*buff);
+}
+
+static void
+create_buffers(int nbufs)
+{
+ register recvbuf_t *bufp;
+ int i, abuf;
+
+ abuf = nbufs + buffer_shortfall;
+ buffer_shortfall = 0;
+
+#ifndef DEBUG
+ bufp = emalloc_zero(abuf * sizeof(*bufp));
+#endif
+
+ for (i = 0; i < abuf; i++) {
+#ifdef DEBUG
+ /*
+ * Allocate each buffer individually so they can be
+ * free()d during ntpd shutdown on DEBUG builds to
+ * keep them out of heap leak reports.
+ */
+ bufp = emalloc_zero(sizeof(*bufp));
+#endif
+ LINK_SLIST(free_recv_list, bufp, link);
+ bufp++;
+ free_recvbufs++;
+ total_recvbufs++;
+ }
+ lowater_adds++;
+}
+
+void
+init_recvbuff(int nbufs)
+{
+
+ /*
+ * Init buffer free list and stat counters
+ */
+ free_recvbufs = total_recvbufs = 0;
+ full_recvbufs = lowater_adds = 0;
+
+ create_buffers(nbufs);
+
+#if defined(SYS_WINNT)
+ InitializeCriticalSection(&RecvLock);
+#endif
+
+#ifdef DEBUG
+ atexit(&uninit_recvbuff);
+#endif
+}
+
+
+#ifdef DEBUG
+static void
+uninit_recvbuff(void)
+{
+ recvbuf_t *rbunlinked;
+
+ for (;;) {
+ UNLINK_FIFO(rbunlinked, full_recv_fifo, link);
+ if (rbunlinked == NULL)
+ break;
+ free(rbunlinked);
+ }
+
+ for (;;) {
+ UNLINK_HEAD_SLIST(rbunlinked, free_recv_list, link);
+ if (rbunlinked == NULL)
+ break;
+ free(rbunlinked);
+ }
+}
+#endif /* DEBUG */
+
+
+/*
+ * freerecvbuf - make a single recvbuf available for reuse
+ */
+void
+freerecvbuf(recvbuf_t *rb)
+{
+ if (rb == NULL) {
+ msyslog(LOG_ERR, "freerecvbuff received NULL buffer");
+ return;
+ }
+
+ LOCK();
+ rb->used--;
+ if (rb->used != 0)
+ msyslog(LOG_ERR, "******** freerecvbuff non-zero usage: %d *******", rb->used);
+ LINK_SLIST(free_recv_list, rb, link);
+ free_recvbufs++;
+ UNLOCK();
+}
+
+
+void
+add_full_recv_buffer(recvbuf_t *rb)
+{
+ if (rb == NULL) {
+ msyslog(LOG_ERR, "add_full_recv_buffer received NULL buffer");
+ return;
+ }
+ LOCK();
+ LINK_FIFO(full_recv_fifo, rb, link);
+ full_recvbufs++;
+ UNLOCK();
+}
+
+
+recvbuf_t *
+get_free_recv_buffer(void)
+{
+ recvbuf_t *buffer;
+
+ LOCK();
+ UNLINK_HEAD_SLIST(buffer, free_recv_list, link);
+ if (buffer != NULL) {
+ free_recvbufs--;
+ initialise_buffer(buffer);
+ buffer->used++;
+ } else {
+ buffer_shortfall++;
+ }
+ UNLOCK();
+
+ return buffer;
+}
+
+
+#ifdef HAVE_IO_COMPLETION_PORT
+recvbuf_t *
+get_free_recv_buffer_alloc(void)
+{
+ recvbuf_t *buffer;
+
+ buffer = get_free_recv_buffer();
+ if (NULL == buffer) {
+ create_buffers(RECV_INC);
+ buffer = get_free_recv_buffer();
+ }
+ NTP_ENSURE(buffer != NULL);
+ return (buffer);
+}
+#endif
+
+
+recvbuf_t *
+get_full_recv_buffer(void)
+{
+ recvbuf_t * rbuf;
+
+ LOCK();
+
+#ifdef HAVE_SIGNALED_IO
+ /*
+ * make sure there are free buffers when we
+ * wander off to do lengthy packet processing with
+ * any buffer we grab from the full list.
+ *
+ * fixes malloc() interrupted by SIGIO risk
+ * (Bug 889)
+ */
+ if (NULL == free_recv_list || buffer_shortfall > 0) {
+ /*
+ * try to get us some more buffers
+ */
+ create_buffers(RECV_INC);
+ }
+#endif
+
+ /*
+ * try to grab a full buffer
+ */
+ UNLINK_FIFO(rbuf, full_recv_fifo, link);
+ if (rbuf != NULL)
+ full_recvbufs--;
+ UNLOCK();
+
+ return rbuf;
+}
+
+
+/*
+ * purge_recv_buffers_for_fd() - purges any previously-received input
+ * from a given file descriptor.
+ */
+void
+purge_recv_buffers_for_fd(
+ SOCKET fd
+ )
+{
+ recvbuf_t *rbufp;
+ recvbuf_t *next;
+ recvbuf_t *punlinked;
+
+ LOCK();
+
+ for (rbufp = HEAD_FIFO(full_recv_fifo);
+ rbufp != NULL;
+ rbufp = next) {
+ next = rbufp->link;
+ if (rbufp->fd == fd) {
+ UNLINK_MID_FIFO(punlinked, full_recv_fifo,
+ rbufp, link, recvbuf_t);
+ INSIST(punlinked == rbufp);
+ full_recvbufs--;
+ freerecvbuf(rbufp);
+ }
+ }
+
+ UNLOCK();
+}
+
+
+/*
+ * Checks to see if there are buffers to process
+ */
+isc_boolean_t has_full_recv_buffer(void)
+{
+ if (HEAD_FIFO(full_recv_fifo) != NULL)
+ return (ISC_TRUE);
+ else
+ return (ISC_FALSE);
+}
+
+
+#ifdef NTP_DEBUG_LISTS_H
+void
+check_gen_fifo_consistency(void *fifo)
+{
+ gen_fifo *pf;
+ gen_node *pthis;
+ gen_node **pptail;
+
+ pf = fifo;
+ REQUIRE((NULL == pf->phead && NULL == pf->pptail) ||
+ (NULL != pf->phead && NULL != pf->pptail));
+
+ pptail = &pf->phead;
+ for (pthis = pf->phead;
+ pthis != NULL;
+ pthis = pthis->link)
+ if (NULL != pthis->link)
+ pptail = &pthis->link;
+
+ REQUIRE(NULL == pf->pptail || pptail == pf->pptail);
+}
+#endif /* NTP_DEBUG_LISTS_H */
diff --git a/libntp/refnumtoa.c b/libntp/refnumtoa.c
new file mode 100644
index 0000000..e6ca55a
--- /dev/null
+++ b/libntp/refnumtoa.c
@@ -0,0 +1,36 @@
+/*
+ * refnumtoa - return asciized refclock addresses stored in local array space
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_net.h"
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+
+const char *
+refnumtoa(
+ sockaddr_u *num
+ )
+{
+ u_int32 netnum;
+ char *buf;
+ const char *rclock;
+
+ if (!ISREFCLOCKADR(num))
+ return socktoa(num);
+
+ LIB_GETBUF(buf);
+ netnum = SRCADR(num);
+ rclock = clockname((int)((u_long)netnum >> 8) & 0xff);
+
+ if (rclock != NULL)
+ snprintf(buf, LIB_BUFLENGTH, "%s(%lu)",
+ rclock, (u_long)netnum & 0xff);
+ else
+ snprintf(buf, LIB_BUFLENGTH, "REFCLK(%lu,%lu)",
+ ((u_long)netnum >> 8) & 0xff,
+ (u_long)netnum & 0xff);
+
+ return buf;
+}
diff --git a/libntp/snprintf.c b/libntp/snprintf.c
new file mode 100644
index 0000000..2b6a374
--- /dev/null
+++ b/libntp/snprintf.c
@@ -0,0 +1,2132 @@
+/*
+ * Modified by Dave Hart for integration into NTP 4.2.7 <hart@ntp.org>
+ *
+ * Changed in a backwards-incompatible way to separate HAVE_SNPRINTF
+ * from HW_WANT_RPL_SNPRINTF, etc. for each of the four replaced
+ * functions.
+ *
+ * Changed to honor hw_force_rpl_snprintf=yes, etc. This is used by NTP
+ * to test rpl_snprintf() and rpl_vsnprintf() on platforms which provide
+ * C99-compliant implementations.
+ */
+
+/* $Id: snprintf.c,v 1.9 2008/01/20 14:02:00 holger Exp $ */
+
+/*
+ * Copyright (c) 1995 Patrick Powell.
+ *
+ * This code is based on code written by Patrick Powell <papowell@astart.com>.
+ * It may be used for any purpose as long as this notice remains intact on all
+ * source code distributions.
+ */
+
+/*
+ * Copyright (c) 2008 Holger Weiss.
+ *
+ * This version of the code is maintained by Holger Weiss <holger@jhweiss.de>.
+ * My changes to the code may freely be used, modified and/or redistributed for
+ * any purpose. It would be nice if additions and fixes to this file (including
+ * trivial code cleanups) would be sent back in order to let me include them in
+ * the version available at <http://www.jhweiss.de/software/snprintf.html>.
+ * However, this is not a requirement for using or redistributing (possibly
+ * modified) versions of this file, nor is leaving this notice intact mandatory.
+ */
+
+/*
+ * History
+ *
+ * 2008-01-20 Holger Weiss <holger@jhweiss.de> for C99-snprintf 1.1:
+ *
+ * Fixed the detection of infinite floating point values on IRIX (and
+ * possibly other systems) and applied another few minor cleanups.
+ *
+ * 2008-01-06 Holger Weiss <holger@jhweiss.de> for C99-snprintf 1.0:
+ *
+ * Added a lot of new features, fixed many bugs, and incorporated various
+ * improvements done by Andrew Tridgell <tridge@samba.org>, Russ Allbery
+ * <rra@stanford.edu>, Hrvoje Niksic <hniksic@xemacs.org>, Damien Miller
+ * <djm@mindrot.org>, and others for the Samba, INN, Wget, and OpenSSH
+ * projects. The additions include: support the "e", "E", "g", "G", and
+ * "F" conversion specifiers (and use conversion style "f" or "F" for the
+ * still unsupported "a" and "A" specifiers); support the "hh", "ll", "j",
+ * "t", and "z" length modifiers; support the "#" flag and the (non-C99)
+ * "'" flag; use localeconv(3) (if available) to get both the current
+ * locale's decimal point character and the separator between groups of
+ * digits; fix the handling of various corner cases of field width and
+ * precision specifications; fix various floating point conversion bugs;
+ * handle infinite and NaN floating point values; don't attempt to write to
+ * the output buffer (which may be NULL) if a size of zero was specified;
+ * check for integer overflow of the field width, precision, and return
+ * values and during the floating point conversion; use the OUTCHAR() macro
+ * instead of a function for better performance; provide asprintf(3) and
+ * vasprintf(3) functions; add new test cases. The replacement functions
+ * have been renamed to use an "rpl_" prefix, the function calls in the
+ * main project (and in this file) must be redefined accordingly for each
+ * replacement function which is needed (by using Autoconf or other means).
+ * Various other minor improvements have been applied and the coding style
+ * was cleaned up for consistency.
+ *
+ * 2007-07-23 Holger Weiss <holger@jhweiss.de> for Mutt 1.5.13:
+ *
+ * C99 compliant snprintf(3) and vsnprintf(3) functions return the number
+ * of characters that would have been written to a sufficiently sized
+ * buffer (excluding the '\0'). The original code simply returned the
+ * length of the resulting output string, so that's been fixed.
+ *
+ * 1998-03-05 Michael Elkins <me@mutt.org> for Mutt 0.90.8:
+ *
+ * The original code assumed that both snprintf(3) and vsnprintf(3) were
+ * missing. Some systems only have snprintf(3) but not vsnprintf(3), so
+ * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF.
+ *
+ * 1998-01-27 Thomas Roessler <roessler@does-not-exist.org> for Mutt 0.89i:
+ *
+ * The PGP code was using unsigned hexadecimal formats. Unfortunately,
+ * unsigned formats simply didn't work.
+ *
+ * 1997-10-22 Brandon Long <blong@fiction.net> for Mutt 0.87.1:
+ *
+ * Ok, added some minimal floating point support, which means this probably
+ * requires libm on most operating systems. Don't yet support the exponent
+ * (e,E) and sigfig (g,G). Also, fmtint() was pretty badly broken, it just
+ * wasn't being exercised in ways which showed it, so that's been fixed.
+ * Also, formatted the code to Mutt conventions, and removed dead code left
+ * over from the original. Also, there is now a builtin-test, run with:
+ * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm && ./snprintf
+ *
+ * 2996-09-15 Brandon Long <blong@fiction.net> for Mutt 0.43:
+ *
+ * This was ugly. It is still ugly. I opted out of floating point
+ * numbers, but the formatter understands just about everything from the
+ * normal C string format, at least as far as I can tell from the Solaris
+ * 2.5 printf(3S) man page.
+ */
+
+/*
+ * ToDo
+ *
+ * - Add wide character support.
+ * - Add support for "%a" and "%A" conversions.
+ * - Create test routines which predefine the expected results. Our test cases
+ * usually expose bugs in system implementations rather than in ours :-)
+ */
+
+/*
+ * Usage
+ *
+ * 1) The following preprocessor macros should be defined to 1 if the feature or
+ * file in question is available on the target system (by using Autoconf or
+ * other means), though basic functionality should be available as long as
+ * HAVE_STDARG_H and HAVE_STDLIB_H are defined correctly:
+ *
+ * HW_WANT_RPL_VSNPRINTF
+ * HW_WANT_RPL_SNPRINTF
+ * HW_WANT_RPL_VASPRINTF
+ * HW_WANT_RPL_ASPRINTF
+ * HAVE_VSNPRINTF // define to 1 #if HW_WANT_RPL_VSNPRINTF
+ * HAVE_SNPRINTF // define to 1 #if HW_WANT_RPL_SNPRINTF
+ * HAVE_VASPRINTF // define to 1 #if HW_WANT_RPL_VASPRINTF
+ * HAVE_ASPRINTF // define to 1 #if HW_WANT_RPL_ASPRINTF
+ * HAVE_STDARG_H
+ * HAVE_STDDEF_H
+ * HAVE_STDINT_H
+ * HAVE_STDLIB_H
+ * HAVE_INTTYPES_H
+ * HAVE_LOCALE_H
+ * HAVE_LOCALECONV
+ * HAVE_LCONV_DECIMAL_POINT
+ * HAVE_LCONV_THOUSANDS_SEP
+ * HAVE_LONG_DOUBLE
+ * HAVE_LONG_LONG_INT
+ * HAVE_UNSIGNED_LONG_LONG_INT
+ * HAVE_INTMAX_T
+ * HAVE_UINTMAX_T
+ * HAVE_UINTPTR_T
+ * HAVE_PTRDIFF_T
+ * HAVE_VA_COPY
+ * HAVE___VA_COPY
+ *
+ * 2) The calls to the functions which should be replaced must be redefined
+ * throughout the project files (by using Autoconf or other means):
+ *
+ * #if HW_WANT_RPL_VSNPRINTF
+ * #define vsnprintf rpl_vsnprintf
+ * #endif
+ * #if HW_WANT_RPL_SNPRINTF
+ * #define snprintf rpl_snprintf
+ * #endif
+ * #if HW_WANT_RPL_VASPRINTF
+ * #define vasprintf rpl_vasprintf
+ * #endif
+ * #if HW_WANT_RPL_ASPRINTF
+ * #define asprintf rpl_asprintf
+ * #endif
+ *
+ * 3) The required replacement functions should be declared in some header file
+ * included throughout the project files:
+ *
+ * #if HAVE_CONFIG_H
+ * #include <config.h>
+ * #endif
+ * #if HAVE_STDARG_H
+ * #include <stdarg.h>
+ * #if HW_WANT_RPL_VSNPRINTF
+ * int rpl_vsnprintf(char *, size_t, const char *, va_list);
+ * #endif
+ * #if HW_WANT_RPL_SNPRINTF
+ * int rpl_snprintf(char *, size_t, const char *, ...);
+ * #endif
+ * #if HW_WANT_RPL_VASPRINTF
+ * int rpl_vasprintf(char **, const char *, va_list);
+ * #endif
+ * #if HW_WANT_RPL_ASPRINTF
+ * int rpl_asprintf(char **, const char *, ...);
+ * #endif
+ * #endif
+ *
+ * Autoconf macros for handling step 1 and step 2 are available at
+ * <http://www.jhweiss.de/software/snprintf.html>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#if TEST_SNPRINTF
+#include <math.h> /* For pow(3), NAN, and INFINITY. */
+#include <string.h> /* For strcmp(3). */
+#if defined(__NetBSD__) || \
+ defined(__FreeBSD__) || \
+ defined(__OpenBSD__) || \
+ defined(__NeXT__) || \
+ defined(__bsd__)
+#define OS_BSD 1
+#elif defined(sgi) || defined(__sgi)
+#ifndef __c99
+#define __c99 /* Force C99 mode to get <stdint.h> included on IRIX 6.5.30. */
+#endif /* !defined(__c99) */
+#define OS_IRIX 1
+#define OS_SYSV 1
+#elif defined(__svr4__)
+#define OS_SYSV 1
+#elif defined(__linux__)
+#define OS_LINUX 1
+#endif /* defined(__NetBSD__) || defined(__FreeBSD__) || [...] */
+#if HAVE_CONFIG_H /* Undefine definitions possibly done in config.h. */
+#ifdef HAVE_SNPRINTF
+#undef HAVE_SNPRINTF
+#endif /* defined(HAVE_SNPRINTF) */
+#ifdef HAVE_VSNPRINTF
+#undef HAVE_VSNPRINTF
+#endif /* defined(HAVE_VSNPRINTF) */
+#ifdef HAVE_ASPRINTF
+#undef HAVE_ASPRINTF
+#endif /* defined(HAVE_ASPRINTF) */
+#ifdef HAVE_VASPRINTF
+#undef HAVE_VASPRINTF
+#endif /* defined(HAVE_VASPRINTF) */
+#ifdef snprintf
+#undef snprintf
+#endif /* defined(snprintf) */
+#ifdef vsnprintf
+#undef vsnprintf
+#endif /* defined(vsnprintf) */
+#ifdef asprintf
+#undef asprintf
+#endif /* defined(asprintf) */
+#ifdef vasprintf
+#undef vasprintf
+#endif /* defined(vasprintf) */
+#else /* By default, we assume a modern system for testing. */
+#ifndef HAVE_STDARG_H
+#define HAVE_STDARG_H 1
+#endif /* HAVE_STDARG_H */
+#ifndef HAVE_STDDEF_H
+#define HAVE_STDDEF_H 1
+#endif /* HAVE_STDDEF_H */
+#ifndef HAVE_STDINT_H
+#define HAVE_STDINT_H 1
+#endif /* HAVE_STDINT_H */
+#ifndef HAVE_STDLIB_H
+#define HAVE_STDLIB_H 1
+#endif /* HAVE_STDLIB_H */
+#ifndef HAVE_INTTYPES_H
+#define HAVE_INTTYPES_H 1
+#endif /* HAVE_INTTYPES_H */
+#ifndef HAVE_LOCALE_H
+#define HAVE_LOCALE_H 1
+#endif /* HAVE_LOCALE_H */
+#ifndef HAVE_LOCALECONV
+#define HAVE_LOCALECONV 1
+#endif /* !defined(HAVE_LOCALECONV) */
+#ifndef HAVE_LCONV_DECIMAL_POINT
+#define HAVE_LCONV_DECIMAL_POINT 1
+#endif /* HAVE_LCONV_DECIMAL_POINT */
+#ifndef HAVE_LCONV_THOUSANDS_SEP
+#define HAVE_LCONV_THOUSANDS_SEP 1
+#endif /* HAVE_LCONV_THOUSANDS_SEP */
+#ifndef HAVE_LONG_DOUBLE
+#define HAVE_LONG_DOUBLE 1
+#endif /* !defined(HAVE_LONG_DOUBLE) */
+#ifndef HAVE_LONG_LONG_INT
+#define HAVE_LONG_LONG_INT 1
+#endif /* !defined(HAVE_LONG_LONG_INT) */
+#ifndef HAVE_UNSIGNED_LONG_LONG_INT
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+#endif /* !defined(HAVE_UNSIGNED_LONG_LONG_INT) */
+#ifndef HAVE_INTMAX_T
+#define HAVE_INTMAX_T 1
+#endif /* !defined(HAVE_INTMAX_T) */
+#ifndef HAVE_UINTMAX_T
+#define HAVE_UINTMAX_T 1
+#endif /* !defined(HAVE_UINTMAX_T) */
+#ifndef HAVE_UINTPTR_T
+#define HAVE_UINTPTR_T 1
+#endif /* !defined(HAVE_UINTPTR_T) */
+#ifndef HAVE_PTRDIFF_T
+#define HAVE_PTRDIFF_T 1
+#endif /* !defined(HAVE_PTRDIFF_T) */
+#ifndef HAVE_VA_COPY
+#define HAVE_VA_COPY 1
+#endif /* !defined(HAVE_VA_COPY) */
+#ifndef HAVE___VA_COPY
+#define HAVE___VA_COPY 1
+#endif /* !defined(HAVE___VA_COPY) */
+#endif /* HAVE_CONFIG_H */
+#define snprintf rpl_snprintf
+#define vsnprintf rpl_vsnprintf
+#define asprintf rpl_asprintf
+#define vasprintf rpl_vasprintf
+#endif /* TEST_SNPRINTF */
+
+#if HW_WANT_RPL_SNPRINTF || HW_WANT_RPL_VSNPRINTF || HW_WANT_RPL_ASPRINTF || HW_WANT_RPL_VASPRINTF
+#include <stdio.h> /* For NULL, size_t, vsnprintf(3), and vasprintf(3). */
+#ifdef VA_START
+#undef VA_START
+#endif /* defined(VA_START) */
+#ifdef VA_SHIFT
+#undef VA_SHIFT
+#endif /* defined(VA_SHIFT) */
+#if HAVE_STDARG_H
+#include <stdarg.h>
+#define VA_START(ap, last) va_start(ap, last)
+#define VA_SHIFT(ap, value, type) /* No-op for ANSI C. */
+#else /* Assume <varargs.h> is available. */
+#include <varargs.h>
+#define VA_START(ap, last) va_start(ap) /* "last" is ignored. */
+#define VA_SHIFT(ap, value, type) value = va_arg(ap, type)
+#endif /* HAVE_STDARG_H */
+
+#if HW_WANT_RPL_VASPRINTF
+#if HAVE_STDLIB_H
+#include <stdlib.h> /* For malloc(3). */
+#endif /* HAVE_STDLIB_H */
+#ifdef VA_COPY
+#undef VA_COPY
+#endif /* defined(VA_COPY) */
+#ifdef VA_END_COPY
+#undef VA_END_COPY
+#endif /* defined(VA_END_COPY) */
+#if HAVE_VA_COPY
+#define VA_COPY(dest, src) va_copy(dest, src)
+#define VA_END_COPY(ap) va_end(ap)
+#elif HAVE___VA_COPY
+#define VA_COPY(dest, src) __va_copy(dest, src)
+#define VA_END_COPY(ap) va_end(ap)
+#else
+#define VA_COPY(dest, src) (void)mymemcpy(&dest, &src, sizeof(va_list))
+#define VA_END_COPY(ap) /* No-op. */
+#define NEED_MYMEMCPY 1
+static void *mymemcpy(void *, void *, size_t);
+#endif /* HAVE_VA_COPY */
+#endif /* HW_WANT_RPL_VASPRINTF */
+
+#if HW_WANT_RPL_VSNPRINTF
+#include <errno.h> /* For ERANGE and errno. */
+#include <limits.h> /* For *_MAX. */
+#if HAVE_INTTYPES_H
+#include <inttypes.h> /* For intmax_t (if not defined in <stdint.h>). */
+#endif /* HAVE_INTTYPES_H */
+#if HAVE_LOCALE_H
+#include <locale.h> /* For localeconv(3). */
+#endif /* HAVE_LOCALE_H */
+#if HAVE_STDDEF_H
+#include <stddef.h> /* For ptrdiff_t. */
+#endif /* HAVE_STDDEF_H */
+#if HAVE_STDINT_H
+#include <stdint.h> /* For intmax_t. */
+#endif /* HAVE_STDINT_H */
+
+/* Support for unsigned long long int. We may also need ULLONG_MAX. */
+#ifndef ULONG_MAX /* We may need ULONG_MAX as a fallback. */
+#ifdef UINT_MAX
+#define ULONG_MAX UINT_MAX
+#else
+#define ULONG_MAX INT_MAX
+#endif /* defined(UINT_MAX) */
+#endif /* !defined(ULONG_MAX) */
+#ifdef ULLONG
+#undef ULLONG
+#endif /* defined(ULLONG) */
+#if HAVE_UNSIGNED_LONG_LONG_INT
+#define ULLONG unsigned long long int
+#ifndef ULLONG_MAX
+#define ULLONG_MAX ULONG_MAX
+#endif /* !defined(ULLONG_MAX) */
+#else
+#define ULLONG unsigned long int
+#ifdef ULLONG_MAX
+#undef ULLONG_MAX
+#endif /* defined(ULLONG_MAX) */
+#define ULLONG_MAX ULONG_MAX
+#endif /* HAVE_LONG_LONG_INT */
+
+/* Support for uintmax_t. We also need UINTMAX_MAX. */
+#ifdef UINTMAX_T
+#undef UINTMAX_T
+#endif /* defined(UINTMAX_T) */
+#if HAVE_UINTMAX_T || defined(uintmax_t)
+#define UINTMAX_T uintmax_t
+#ifndef UINTMAX_MAX
+#define UINTMAX_MAX ULLONG_MAX
+#endif /* !defined(UINTMAX_MAX) */
+#else
+#define UINTMAX_T ULLONG
+#ifdef UINTMAX_MAX
+#undef UINTMAX_MAX
+#endif /* defined(UINTMAX_MAX) */
+#define UINTMAX_MAX ULLONG_MAX
+#endif /* HAVE_UINTMAX_T || defined(uintmax_t) */
+
+/* Support for long double. */
+#ifndef LDOUBLE
+#if HAVE_LONG_DOUBLE
+#define LDOUBLE long double
+#else
+#define LDOUBLE double
+#endif /* HAVE_LONG_DOUBLE */
+#endif /* !defined(LDOUBLE) */
+
+/* Support for long long int. */
+#ifndef LLONG
+#if HAVE_LONG_LONG_INT
+#define LLONG long long int
+#else
+#define LLONG long int
+#endif /* HAVE_LONG_LONG_INT */
+#endif /* !defined(LLONG) */
+
+/* Support for intmax_t. */
+#ifndef INTMAX_T
+#if HAVE_INTMAX_T || defined(intmax_t)
+#define INTMAX_T intmax_t
+#else
+#define INTMAX_T LLONG
+#endif /* HAVE_INTMAX_T || defined(intmax_t) */
+#endif /* !defined(INTMAX_T) */
+
+/* Support for uintptr_t. */
+#ifndef UINTPTR_T
+#if HAVE_UINTPTR_T || defined(uintptr_t)
+#define UINTPTR_T uintptr_t
+#else
+#define UINTPTR_T unsigned long int
+#endif /* HAVE_UINTPTR_T || defined(uintptr_t) */
+#endif /* !defined(UINTPTR_T) */
+
+/* Support for ptrdiff_t. */
+#ifndef PTRDIFF_T
+#if HAVE_PTRDIFF_T || defined(ptrdiff_t)
+#define PTRDIFF_T ptrdiff_t
+#else
+#define PTRDIFF_T long int
+#endif /* HAVE_PTRDIFF_T || defined(ptrdiff_t) */
+#endif /* !defined(PTRDIFF_T) */
+
+/*
+ * We need an unsigned integer type corresponding to ptrdiff_t (cf. C99:
+ * 7.19.6.1, 7). However, we'll simply use PTRDIFF_T and convert it to an
+ * unsigned type if necessary. This should work just fine in practice.
+ */
+#ifndef UPTRDIFF_T
+#define UPTRDIFF_T PTRDIFF_T
+#endif /* !defined(UPTRDIFF_T) */
+
+/*
+ * We need a signed integer type corresponding to size_t (cf. C99: 7.19.6.1, 7).
+ * However, we'll simply use size_t and convert it to a signed type if
+ * necessary. This should work just fine in practice.
+ */
+#ifndef SSIZE_T
+#define SSIZE_T size_t
+#endif /* !defined(SSIZE_T) */
+
+/* Either ERANGE or E2BIG should be available everywhere. */
+#ifndef ERANGE
+#define ERANGE E2BIG
+#endif /* !defined(ERANGE) */
+#ifndef EOVERFLOW
+#define EOVERFLOW ERANGE
+#endif /* !defined(EOVERFLOW) */
+
+/*
+ * Buffer size to hold the octal string representation of UINT128_MAX without
+ * nul-termination ("3777777777777777777777777777777777777777777").
+ */
+#ifdef MAX_CONVERT_LENGTH
+#undef MAX_CONVERT_LENGTH
+#endif /* defined(MAX_CONVERT_LENGTH) */
+#define MAX_CONVERT_LENGTH 43
+
+/* Format read states. */
+#define PRINT_S_DEFAULT 0
+#define PRINT_S_FLAGS 1
+#define PRINT_S_WIDTH 2
+#define PRINT_S_DOT 3
+#define PRINT_S_PRECISION 4
+#define PRINT_S_MOD 5
+#define PRINT_S_CONV 6
+
+/* Format flags. */
+#define PRINT_F_MINUS (1 << 0)
+#define PRINT_F_PLUS (1 << 1)
+#define PRINT_F_SPACE (1 << 2)
+#define PRINT_F_NUM (1 << 3)
+#define PRINT_F_ZERO (1 << 4)
+#define PRINT_F_QUOTE (1 << 5)
+#define PRINT_F_UP (1 << 6)
+#define PRINT_F_UNSIGNED (1 << 7)
+#define PRINT_F_TYPE_G (1 << 8)
+#define PRINT_F_TYPE_E (1 << 9)
+
+/* Conversion flags. */
+#define PRINT_C_CHAR 1
+#define PRINT_C_SHORT 2
+#define PRINT_C_LONG 3
+#define PRINT_C_LLONG 4
+#define PRINT_C_LDOUBLE 5
+#define PRINT_C_SIZE 6
+#define PRINT_C_PTRDIFF 7
+#define PRINT_C_INTMAX 8
+
+#ifndef MAX
+#define MAX(x, y) ((x >= y) ? x : y)
+#endif /* !defined(MAX) */
+#ifndef CHARTOINT
+#define CHARTOINT(ch) (ch - '0')
+#endif /* !defined(CHARTOINT) */
+#ifndef ISDIGIT
+#define ISDIGIT(ch) ('0' <= (unsigned char)ch && (unsigned char)ch <= '9')
+#endif /* !defined(ISDIGIT) */
+#ifndef ISNAN
+#define ISNAN(x) (x != x)
+#endif /* !defined(ISNAN) */
+#ifndef ISINF
+#define ISINF(x) (x != 0.0 && x + x == x)
+#endif /* !defined(ISINF) */
+
+#ifdef OUTCHAR
+#undef OUTCHAR
+#endif /* defined(OUTCHAR) */
+#define OUTCHAR(str, len, size, ch) \
+do { \
+ if (len + 1 < size) \
+ str[len] = ch; \
+ (len)++; \
+} while (/* CONSTCOND */ 0)
+
+static void fmtstr(char *, size_t *, size_t, const char *, int, int, int);
+static void fmtint(char *, size_t *, size_t, INTMAX_T, int, int, int, int);
+static void fmtflt(char *, size_t *, size_t, LDOUBLE, int, int, int, int *);
+static void printsep(char *, size_t *, size_t);
+static int getnumsep(int);
+static int getexponent(LDOUBLE);
+static int convert(UINTMAX_T, char *, size_t, int, int);
+static UINTMAX_T cast(LDOUBLE);
+static UINTMAX_T myround(LDOUBLE);
+static LDOUBLE mypow10(int);
+
+int
+rpl_vsnprintf(char *str, size_t size, const char *format, va_list args);
+
+int
+rpl_vsnprintf(char *str, size_t size, const char *format, va_list args)
+{
+ LDOUBLE fvalue;
+ INTMAX_T value;
+ unsigned char cvalue;
+ const char *strvalue;
+ INTMAX_T *intmaxptr;
+ PTRDIFF_T *ptrdiffptr;
+ SSIZE_T *sizeptr;
+ LLONG *llongptr;
+ long int *longptr;
+ int *intptr;
+ short int *shortptr;
+ signed char *charptr;
+ size_t len = 0;
+ int overflow = 0;
+ int base = 0;
+ int cflags = 0;
+ int flags = 0;
+ int width = 0;
+ int precision = -1;
+ int state = PRINT_S_DEFAULT;
+ char ch = *format++;
+
+ /*
+ * C99 says: "If `n' is zero, nothing is written, and `s' may be a null
+ * pointer." (7.19.6.5, 2) We're forgiving and allow a NULL pointer
+ * even if a size larger than zero was specified. At least NetBSD's
+ * snprintf(3) does the same, as well as other versions of this file.
+ * (Though some of these versions will write to a non-NULL buffer even
+ * if a size of zero was specified, which violates the standard.)
+ */
+ if (str == NULL && size != 0)
+ size = 0;
+
+ while (ch != '\0')
+ switch (state) {
+ case PRINT_S_DEFAULT:
+ if (ch == '%')
+ state = PRINT_S_FLAGS;
+ else
+ OUTCHAR(str, len, size, ch);
+ ch = *format++;
+ break;
+ case PRINT_S_FLAGS:
+ switch (ch) {
+ case '-':
+ flags |= PRINT_F_MINUS;
+ ch = *format++;
+ break;
+ case '+':
+ flags |= PRINT_F_PLUS;
+ ch = *format++;
+ break;
+ case ' ':
+ flags |= PRINT_F_SPACE;
+ ch = *format++;
+ break;
+ case '#':
+ flags |= PRINT_F_NUM;
+ ch = *format++;
+ break;
+ case '0':
+ flags |= PRINT_F_ZERO;
+ ch = *format++;
+ break;
+ case '\'': /* SUSv2 flag (not in C99). */
+ flags |= PRINT_F_QUOTE;
+ ch = *format++;
+ break;
+ default:
+ state = PRINT_S_WIDTH;
+ break;
+ }
+ break;
+ case PRINT_S_WIDTH:
+ if (ISDIGIT(ch)) {
+ ch = CHARTOINT(ch);
+ if (width > (INT_MAX - ch) / 10) {
+ overflow = 1;
+ goto out;
+ }
+ width = 10 * width + ch;
+ ch = *format++;
+ } else if (ch == '*') {
+ /*
+ * C99 says: "A negative field width argument is
+ * taken as a `-' flag followed by a positive
+ * field width." (7.19.6.1, 5)
+ */
+ if ((width = va_arg(args, int)) < 0) {
+ flags |= PRINT_F_MINUS;
+ width = -width;
+ }
+ ch = *format++;
+ state = PRINT_S_DOT;
+ } else
+ state = PRINT_S_DOT;
+ break;
+ case PRINT_S_DOT:
+ if (ch == '.') {
+ state = PRINT_S_PRECISION;
+ ch = *format++;
+ } else
+ state = PRINT_S_MOD;
+ break;
+ case PRINT_S_PRECISION:
+ if (precision == -1)
+ precision = 0;
+ if (ISDIGIT(ch)) {
+ ch = CHARTOINT(ch);
+ if (precision > (INT_MAX - ch) / 10) {
+ overflow = 1;
+ goto out;
+ }
+ precision = 10 * precision + ch;
+ ch = *format++;
+ } else if (ch == '*') {
+ /*
+ * C99 says: "A negative precision argument is
+ * taken as if the precision were omitted."
+ * (7.19.6.1, 5)
+ */
+ if ((precision = va_arg(args, int)) < 0)
+ precision = -1;
+ ch = *format++;
+ state = PRINT_S_MOD;
+ } else
+ state = PRINT_S_MOD;
+ break;
+ case PRINT_S_MOD:
+ switch (ch) {
+ case 'h':
+ ch = *format++;
+ if (ch == 'h') { /* It's a char. */
+ ch = *format++;
+ cflags = PRINT_C_CHAR;
+ } else
+ cflags = PRINT_C_SHORT;
+ break;
+ case 'l':
+ ch = *format++;
+ if (ch == 'l') { /* It's a long long. */
+ ch = *format++;
+ cflags = PRINT_C_LLONG;
+ } else
+ cflags = PRINT_C_LONG;
+ break;
+ case 'L':
+ cflags = PRINT_C_LDOUBLE;
+ ch = *format++;
+ break;
+ case 'j':
+ cflags = PRINT_C_INTMAX;
+ ch = *format++;
+ break;
+ case 't':
+ cflags = PRINT_C_PTRDIFF;
+ ch = *format++;
+ break;
+ case 'z':
+ cflags = PRINT_C_SIZE;
+ ch = *format++;
+ break;
+ }
+ state = PRINT_S_CONV;
+ break;
+ case PRINT_S_CONV:
+ switch (ch) {
+ case 'd':
+ /* FALLTHROUGH */
+ case 'i':
+ switch (cflags) {
+ case PRINT_C_CHAR:
+ value = (signed char)va_arg(args, int);
+ break;
+ case PRINT_C_SHORT:
+ value = (short int)va_arg(args, int);
+ break;
+ case PRINT_C_LONG:
+ value = va_arg(args, long int);
+ break;
+ case PRINT_C_LLONG:
+ value = va_arg(args, LLONG);
+ break;
+ case PRINT_C_SIZE:
+ value = va_arg(args, SSIZE_T);
+ break;
+ case PRINT_C_INTMAX:
+ value = va_arg(args, INTMAX_T);
+ break;
+ case PRINT_C_PTRDIFF:
+ value = va_arg(args, PTRDIFF_T);
+ break;
+ default:
+ value = va_arg(args, int);
+ break;
+ }
+ fmtint(str, &len, size, value, 10, width,
+ precision, flags);
+ break;
+ case 'X':
+ flags |= PRINT_F_UP;
+ /* FALLTHROUGH */
+ case 'x':
+ base = 16;
+ /* FALLTHROUGH */
+ case 'o':
+ if (base == 0)
+ base = 8;
+ /* FALLTHROUGH */
+ case 'u':
+ if (base == 0)
+ base = 10;
+ flags |= PRINT_F_UNSIGNED;
+ switch (cflags) {
+ case PRINT_C_CHAR:
+ value = (unsigned char)va_arg(args,
+ unsigned int);
+ break;
+ case PRINT_C_SHORT:
+ value = (unsigned short int)va_arg(args,
+ unsigned int);
+ break;
+ case PRINT_C_LONG:
+ value = va_arg(args, unsigned long int);
+ break;
+ case PRINT_C_LLONG:
+ value = va_arg(args, ULLONG);
+ break;
+ case PRINT_C_SIZE:
+ value = va_arg(args, size_t);
+ break;
+ case PRINT_C_INTMAX:
+ value = va_arg(args, UINTMAX_T);
+ break;
+ case PRINT_C_PTRDIFF:
+ value = va_arg(args, UPTRDIFF_T);
+ break;
+ default:
+ value = va_arg(args, unsigned int);
+ break;
+ }
+ fmtint(str, &len, size, value, base, width,
+ precision, flags);
+ break;
+ case 'A':
+ /* Not yet supported, we'll use "%F". */
+ /* FALLTHROUGH */
+ case 'F':
+ flags |= PRINT_F_UP;
+ /* FALLTHROUGH */
+ case 'a':
+ /* Not yet supported, we'll use "%f". */
+ /* FALLTHROUGH */
+ case 'f':
+ if (cflags == PRINT_C_LDOUBLE)
+ fvalue = va_arg(args, LDOUBLE);
+ else
+ fvalue = va_arg(args, double);
+ fmtflt(str, &len, size, fvalue, width,
+ precision, flags, &overflow);
+ if (overflow)
+ goto out;
+ break;
+ case 'E':
+ flags |= PRINT_F_UP;
+ /* FALLTHROUGH */
+ case 'e':
+ flags |= PRINT_F_TYPE_E;
+ if (cflags == PRINT_C_LDOUBLE)
+ fvalue = va_arg(args, LDOUBLE);
+ else
+ fvalue = va_arg(args, double);
+ fmtflt(str, &len, size, fvalue, width,
+ precision, flags, &overflow);
+ if (overflow)
+ goto out;
+ break;
+ case 'G':
+ flags |= PRINT_F_UP;
+ /* FALLTHROUGH */
+ case 'g':
+ flags |= PRINT_F_TYPE_G;
+ if (cflags == PRINT_C_LDOUBLE)
+ fvalue = va_arg(args, LDOUBLE);
+ else
+ fvalue = va_arg(args, double);
+ /*
+ * If the precision is zero, it is treated as
+ * one (cf. C99: 7.19.6.1, 8).
+ */
+ if (precision == 0)
+ precision = 1;
+ fmtflt(str, &len, size, fvalue, width,
+ precision, flags, &overflow);
+ if (overflow)
+ goto out;
+ break;
+ case 'c':
+ cvalue = va_arg(args, int);
+ OUTCHAR(str, len, size, cvalue);
+ break;
+ case 's':
+ strvalue = va_arg(args, char *);
+ fmtstr(str, &len, size, strvalue, width,
+ precision, flags);
+ break;
+ case 'p':
+ /*
+ * C99 says: "The value of the pointer is
+ * converted to a sequence of printing
+ * characters, in an implementation-defined
+ * manner." (C99: 7.19.6.1, 8)
+ */
+ if ((strvalue = va_arg(args, void *)) == NULL)
+ /*
+ * We use the glibc format. BSD prints
+ * "0x0", SysV "0".
+ */
+ fmtstr(str, &len, size, "(nil)", width,
+ -1, flags);
+ else {
+ /*
+ * We use the BSD/glibc format. SysV
+ * omits the "0x" prefix (which we emit
+ * using the PRINT_F_NUM flag).
+ */
+ flags |= PRINT_F_NUM;
+ flags |= PRINT_F_UNSIGNED;
+ fmtint(str, &len, size,
+ (UINTPTR_T)strvalue, 16, width,
+ precision, flags);
+ }
+ break;
+ case 'n':
+ switch (cflags) {
+ case PRINT_C_CHAR:
+ charptr = va_arg(args, signed char *);
+ *charptr = len;
+ break;
+ case PRINT_C_SHORT:
+ shortptr = va_arg(args, short int *);
+ *shortptr = len;
+ break;
+ case PRINT_C_LONG:
+ longptr = va_arg(args, long int *);
+ *longptr = len;
+ break;
+ case PRINT_C_LLONG:
+ llongptr = va_arg(args, LLONG *);
+ *llongptr = len;
+ break;
+ case PRINT_C_SIZE:
+ /*
+ * C99 says that with the "z" length
+ * modifier, "a following `n' conversion
+ * specifier applies to a pointer to a
+ * signed integer type corresponding to
+ * size_t argument." (7.19.6.1, 7)
+ */
+ sizeptr = va_arg(args, SSIZE_T *);
+ *sizeptr = len;
+ break;
+ case PRINT_C_INTMAX:
+ intmaxptr = va_arg(args, INTMAX_T *);
+ *intmaxptr = len;
+ break;
+ case PRINT_C_PTRDIFF:
+ ptrdiffptr = va_arg(args, PTRDIFF_T *);
+ *ptrdiffptr = len;
+ break;
+ default:
+ intptr = va_arg(args, int *);
+ *intptr = len;
+ break;
+ }
+ break;
+ case '%': /* Print a "%" character verbatim. */
+ OUTCHAR(str, len, size, ch);
+ break;
+ default: /* Skip other characters. */
+ break;
+ }
+ ch = *format++;
+ state = PRINT_S_DEFAULT;
+ base = cflags = flags = width = 0;
+ precision = -1;
+ break;
+ }
+out:
+ if (len < size)
+ str[len] = '\0';
+ else if (size > 0)
+ str[size - 1] = '\0';
+
+ if (overflow || len >= INT_MAX) {
+ errno = overflow ? EOVERFLOW : ERANGE;
+ return -1;
+ }
+ return (int)len;
+}
+
+static void
+fmtstr(char *str, size_t *len, size_t size, const char *value, int width,
+ int precision, int flags)
+{
+ int padlen, strln; /* Amount to pad. */
+ int noprecision = (precision == -1);
+
+ if (value == NULL) /* We're forgiving. */
+ value = "(null)";
+
+ /* If a precision was specified, don't read the string past it. */
+ for (strln = 0; value[strln] != '\0' &&
+ (noprecision || strln < precision); strln++)
+ continue;
+
+ if ((padlen = width - strln) < 0)
+ padlen = 0;
+ if (flags & PRINT_F_MINUS) /* Left justify. */
+ padlen = -padlen;
+
+ while (padlen > 0) { /* Leading spaces. */
+ OUTCHAR(str, *len, size, ' ');
+ padlen--;
+ }
+ while (*value != '\0' && (noprecision || precision-- > 0)) {
+ OUTCHAR(str, *len, size, *value);
+ value++;
+ }
+ while (padlen < 0) { /* Trailing spaces. */
+ OUTCHAR(str, *len, size, ' ');
+ padlen++;
+ }
+}
+
+static void
+fmtint(char *str, size_t *len, size_t size, INTMAX_T value, int base, int width,
+ int precision, int flags)
+{
+ UINTMAX_T uvalue;
+ char iconvert[MAX_CONVERT_LENGTH];
+ char sign = 0;
+ char hexprefix = 0;
+ int spadlen = 0; /* Amount to space pad. */
+ int zpadlen = 0; /* Amount to zero pad. */
+ int pos;
+ int separators = (flags & PRINT_F_QUOTE);
+ int noprecision = (precision == -1);
+
+ if (flags & PRINT_F_UNSIGNED)
+ uvalue = value;
+ else {
+ uvalue = (value >= 0) ? value : -value;
+ if (value < 0)
+ sign = '-';
+ else if (flags & PRINT_F_PLUS) /* Do a sign. */
+ sign = '+';
+ else if (flags & PRINT_F_SPACE)
+ sign = ' ';
+ }
+
+ pos = convert(uvalue, iconvert, sizeof(iconvert), base,
+ flags & PRINT_F_UP);
+
+ if (flags & PRINT_F_NUM && uvalue != 0) {
+ /*
+ * C99 says: "The result is converted to an `alternative form'.
+ * For `o' conversion, it increases the precision, if and only
+ * if necessary, to force the first digit of the result to be a
+ * zero (if the value and precision are both 0, a single 0 is
+ * printed). For `x' (or `X') conversion, a nonzero result has
+ * `0x' (or `0X') prefixed to it." (7.19.6.1, 6)
+ */
+ switch (base) {
+ case 8:
+ if (precision <= pos)
+ precision = pos + 1;
+ break;
+ case 16:
+ hexprefix = (flags & PRINT_F_UP) ? 'X' : 'x';
+ break;
+ }
+ }
+
+ if (separators) /* Get the number of group separators we'll print. */
+ separators = getnumsep(pos);
+
+ zpadlen = precision - pos - separators;
+ spadlen = width /* Minimum field width. */
+ - separators /* Number of separators. */
+ - MAX(precision, pos) /* Number of integer digits. */
+ - ((sign != 0) ? 1 : 0) /* Will we print a sign? */
+ - ((hexprefix != 0) ? 2 : 0); /* Will we print a prefix? */
+
+ if (zpadlen < 0)
+ zpadlen = 0;
+ if (spadlen < 0)
+ spadlen = 0;
+
+ /*
+ * C99 says: "If the `0' and `-' flags both appear, the `0' flag is
+ * ignored. For `d', `i', `o', `u', `x', and `X' conversions, if a
+ * precision is specified, the `0' flag is ignored." (7.19.6.1, 6)
+ */
+ if (flags & PRINT_F_MINUS) /* Left justify. */
+ spadlen = -spadlen;
+ else if (flags & PRINT_F_ZERO && noprecision) {
+ zpadlen += spadlen;
+ spadlen = 0;
+ }
+ while (spadlen > 0) { /* Leading spaces. */
+ OUTCHAR(str, *len, size, ' ');
+ spadlen--;
+ }
+ if (sign != 0) /* Sign. */
+ OUTCHAR(str, *len, size, sign);
+ if (hexprefix != 0) { /* A "0x" or "0X" prefix. */
+ OUTCHAR(str, *len, size, '0');
+ OUTCHAR(str, *len, size, hexprefix);
+ }
+ while (zpadlen > 0) { /* Leading zeros. */
+ OUTCHAR(str, *len, size, '0');
+ zpadlen--;
+ }
+ while (pos > 0) { /* The actual digits. */
+ pos--;
+ OUTCHAR(str, *len, size, iconvert[pos]);
+ if (separators > 0 && pos > 0 && pos % 3 == 0)
+ printsep(str, len, size);
+ }
+ while (spadlen < 0) { /* Trailing spaces. */
+ OUTCHAR(str, *len, size, ' ');
+ spadlen++;
+ }
+}
+
+static void
+fmtflt(char *str, size_t *len, size_t size, LDOUBLE fvalue, int width,
+ int precision, int flags, int *overflow)
+{
+ LDOUBLE ufvalue;
+ UINTMAX_T intpart;
+ UINTMAX_T fracpart;
+ UINTMAX_T mask;
+ const char *infnan = NULL;
+ char iconvert[MAX_CONVERT_LENGTH];
+ char fconvert[MAX_CONVERT_LENGTH];
+ char econvert[4]; /* "e-12" (without nul-termination). */
+ char esign = 0;
+ char sign = 0;
+ int leadfraczeros = 0;
+ int exponent = 0;
+ int emitpoint = 0;
+ int omitzeros = 0;
+ int omitcount = 0;
+ int padlen = 0;
+ int epos = 0;
+ int fpos = 0;
+ int ipos = 0;
+ int separators = (flags & PRINT_F_QUOTE);
+ int estyle = (flags & PRINT_F_TYPE_E);
+#if HAVE_LOCALECONV && HAVE_LCONV_DECIMAL_POINT
+ struct lconv *lc = localeconv();
+#endif /* HAVE_LOCALECONV && HAVE_LCONV_DECIMAL_POINT */
+
+ /*
+ * AIX' man page says the default is 0, but C99 and at least Solaris'
+ * and NetBSD's man pages say the default is 6, and sprintf(3) on AIX
+ * defaults to 6.
+ */
+ if (precision == -1)
+ precision = 6;
+
+ if (fvalue < 0.0)
+ sign = '-';
+ else if (flags & PRINT_F_PLUS) /* Do a sign. */
+ sign = '+';
+ else if (flags & PRINT_F_SPACE)
+ sign = ' ';
+
+ if (ISNAN(fvalue))
+ infnan = (flags & PRINT_F_UP) ? "NAN" : "nan";
+ else if (ISINF(fvalue))
+ infnan = (flags & PRINT_F_UP) ? "INF" : "inf";
+
+ if (infnan != NULL) {
+ if (sign != 0)
+ iconvert[ipos++] = sign;
+ while (*infnan != '\0')
+ iconvert[ipos++] = *infnan++;
+ fmtstr(str, len, size, iconvert, width, ipos, flags);
+ return;
+ }
+
+ /* "%e" (or "%E") or "%g" (or "%G") conversion. */
+ if (flags & PRINT_F_TYPE_E || flags & PRINT_F_TYPE_G) {
+ if (flags & PRINT_F_TYPE_G) {
+ /*
+ * For "%g" (and "%G") conversions, the precision
+ * specifies the number of significant digits, which
+ * includes the digits in the integer part. The
+ * conversion will or will not be using "e-style" (like
+ * "%e" or "%E" conversions) depending on the precision
+ * and on the exponent. However, the exponent can be
+ * affected by rounding the converted value, so we'll
+ * leave this decision for later. Until then, we'll
+ * assume that we're going to do an "e-style" conversion
+ * (in order to get the exponent calculated). For
+ * "e-style", the precision must be decremented by one.
+ */
+ precision--;
+ /*
+ * For "%g" (and "%G") conversions, trailing zeros are
+ * removed from the fractional portion of the result
+ * unless the "#" flag was specified.
+ */
+ if (!(flags & PRINT_F_NUM))
+ omitzeros = 1;
+ }
+ exponent = getexponent(fvalue);
+ estyle = 1;
+ }
+
+again:
+ /*
+ * Sorry, we only support 9, 19, or 38 digits (that is, the number of
+ * digits of the 32-bit, the 64-bit, or the 128-bit UINTMAX_MAX value
+ * minus one) past the decimal point due to our conversion method.
+ */
+ switch (sizeof(UINTMAX_T)) {
+ case 16:
+ if (precision > 38)
+ precision = 38;
+ break;
+ case 8:
+ if (precision > 19)
+ precision = 19;
+ break;
+ default:
+ if (precision > 9)
+ precision = 9;
+ break;
+ }
+
+ ufvalue = (fvalue >= 0.0) ? fvalue : -fvalue;
+ if (estyle) /* We want exactly one integer digit. */
+ ufvalue /= mypow10(exponent);
+
+ if ((intpart = cast(ufvalue)) == UINTMAX_MAX) {
+ *overflow = 1;
+ return;
+ }
+
+ /*
+ * Factor of ten with the number of digits needed for the fractional
+ * part. For example, if the precision is 3, the mask will be 1000.
+ */
+ mask = mypow10(precision);
+ /*
+ * We "cheat" by converting the fractional part to integer by
+ * multiplying by a factor of ten.
+ */
+ if ((fracpart = myround(mask * (ufvalue - intpart))) >= mask) {
+ /*
+ * For example, ufvalue = 2.99962, intpart = 2, and mask = 1000
+ * (because precision = 3). Now, myround(1000 * 0.99962) will
+ * return 1000. So, the integer part must be incremented by one
+ * and the fractional part must be set to zero.
+ */
+ intpart++;
+ fracpart = 0;
+ if (estyle && intpart == 10) {
+ /*
+ * The value was rounded up to ten, but we only want one
+ * integer digit if using "e-style". So, the integer
+ * part must be set to one and the exponent must be
+ * incremented by one.
+ */
+ intpart = 1;
+ exponent++;
+ }
+ }
+
+ /*
+ * Now that we know the real exponent, we can check whether or not to
+ * use "e-style" for "%g" (and "%G") conversions. If we don't need
+ * "e-style", the precision must be adjusted and the integer and
+ * fractional parts must be recalculated from the original value.
+ *
+ * C99 says: "Let P equal the precision if nonzero, 6 if the precision
+ * is omitted, or 1 if the precision is zero. Then, if a conversion
+ * with style `E' would have an exponent of X:
+ *
+ * - if P > X >= -4, the conversion is with style `f' (or `F') and
+ * precision P - (X + 1).
+ *
+ * - otherwise, the conversion is with style `e' (or `E') and precision
+ * P - 1." (7.19.6.1, 8)
+ *
+ * Note that we had decremented the precision by one.
+ */
+ if (flags & PRINT_F_TYPE_G && estyle &&
+ precision + 1 > exponent && exponent >= -4) {
+ precision -= exponent;
+ estyle = 0;
+ goto again;
+ }
+
+ if (estyle) {
+ if (exponent < 0) {
+ exponent = -exponent;
+ esign = '-';
+ } else
+ esign = '+';
+
+ /*
+ * Convert the exponent. The sizeof(econvert) is 4. So, the
+ * econvert buffer can hold e.g. "e+99" and "e-99". We don't
+ * support an exponent which contains more than two digits.
+ * Therefore, the following stores are safe.
+ */
+ epos = convert(exponent, econvert, 2, 10, 0);
+ /*
+ * C99 says: "The exponent always contains at least two digits,
+ * and only as many more digits as necessary to represent the
+ * exponent." (7.19.6.1, 8)
+ */
+ if (epos == 1)
+ econvert[epos++] = '0';
+ econvert[epos++] = esign;
+ econvert[epos++] = (flags & PRINT_F_UP) ? 'E' : 'e';
+ }
+
+ /* Convert the integer part and the fractional part. */
+ ipos = convert(intpart, iconvert, sizeof(iconvert), 10, 0);
+ if (fracpart != 0) /* convert() would return 1 if fracpart == 0. */
+ fpos = convert(fracpart, fconvert, sizeof(fconvert), 10, 0);
+
+ leadfraczeros = precision - fpos;
+
+ if (omitzeros) {
+ if (fpos > 0) /* Omit trailing fractional part zeros. */
+ while (omitcount < fpos && fconvert[omitcount] == '0')
+ omitcount++;
+ else { /* The fractional part is zero, omit it completely. */
+ omitcount = precision;
+ leadfraczeros = 0;
+ }
+ precision -= omitcount;
+ }
+
+ /*
+ * Print a decimal point if either the fractional part is non-zero
+ * and/or the "#" flag was specified.
+ */
+ if (precision > 0 || flags & PRINT_F_NUM)
+ emitpoint = 1;
+ if (separators) /* Get the number of group separators we'll print. */
+ separators = getnumsep(ipos);
+
+ padlen = width /* Minimum field width. */
+ - ipos /* Number of integer digits. */
+ - epos /* Number of exponent characters. */
+ - precision /* Number of fractional digits. */
+ - separators /* Number of group separators. */
+ - (emitpoint ? 1 : 0) /* Will we print a decimal point? */
+ - ((sign != 0) ? 1 : 0); /* Will we print a sign character? */
+
+ if (padlen < 0)
+ padlen = 0;
+
+ /*
+ * C99 says: "If the `0' and `-' flags both appear, the `0' flag is
+ * ignored." (7.19.6.1, 6)
+ */
+ if (flags & PRINT_F_MINUS) /* Left justifty. */
+ padlen = -padlen;
+ else if (flags & PRINT_F_ZERO && padlen > 0) {
+ if (sign != 0) { /* Sign. */
+ OUTCHAR(str, *len, size, sign);
+ sign = 0;
+ }
+ while (padlen > 0) { /* Leading zeros. */
+ OUTCHAR(str, *len, size, '0');
+ padlen--;
+ }
+ }
+ while (padlen > 0) { /* Leading spaces. */
+ OUTCHAR(str, *len, size, ' ');
+ padlen--;
+ }
+ if (sign != 0) /* Sign. */
+ OUTCHAR(str, *len, size, sign);
+ while (ipos > 0) { /* Integer part. */
+ ipos--;
+ OUTCHAR(str, *len, size, iconvert[ipos]);
+ if (separators > 0 && ipos > 0 && ipos % 3 == 0)
+ printsep(str, len, size);
+ }
+ if (emitpoint) { /* Decimal point. */
+#if HAVE_LOCALECONV && HAVE_LCONV_DECIMAL_POINT
+ if (lc->decimal_point != NULL && *lc->decimal_point != '\0')
+ OUTCHAR(str, *len, size, *lc->decimal_point);
+ else /* We'll always print some decimal point character. */
+#endif /* HAVE_LOCALECONV && HAVE_LCONV_DECIMAL_POINT */
+ OUTCHAR(str, *len, size, '.');
+ }
+ while (leadfraczeros > 0) { /* Leading fractional part zeros. */
+ OUTCHAR(str, *len, size, '0');
+ leadfraczeros--;
+ }
+ while (fpos > omitcount) { /* The remaining fractional part. */
+ fpos--;
+ OUTCHAR(str, *len, size, fconvert[fpos]);
+ }
+ while (epos > 0) { /* Exponent. */
+ epos--;
+ OUTCHAR(str, *len, size, econvert[epos]);
+ }
+ while (padlen < 0) { /* Trailing spaces. */
+ OUTCHAR(str, *len, size, ' ');
+ padlen++;
+ }
+}
+
+static void
+printsep(char *str, size_t *len, size_t size)
+{
+#if HAVE_LOCALECONV && HAVE_LCONV_THOUSANDS_SEP
+ struct lconv *lc = localeconv();
+ int i;
+
+ if (lc->thousands_sep != NULL)
+ for (i = 0; lc->thousands_sep[i] != '\0'; i++)
+ OUTCHAR(str, *len, size, lc->thousands_sep[i]);
+ else
+#endif /* HAVE_LOCALECONV && HAVE_LCONV_THOUSANDS_SEP */
+ OUTCHAR(str, *len, size, ',');
+}
+
+static int
+getnumsep(int digits)
+{
+ int separators = (digits - ((digits % 3 == 0) ? 1 : 0)) / 3;
+#if HAVE_LOCALECONV && HAVE_LCONV_THOUSANDS_SEP
+ int strln;
+ struct lconv *lc = localeconv();
+
+ /* We support an arbitrary separator length (including zero). */
+ if (lc->thousands_sep != NULL) {
+ for (strln = 0; lc->thousands_sep[strln] != '\0'; strln++)
+ continue;
+ separators *= strln;
+ }
+#endif /* HAVE_LOCALECONV && HAVE_LCONV_THOUSANDS_SEP */
+ return separators;
+}
+
+static int
+getexponent(LDOUBLE value)
+{
+ LDOUBLE tmp = (value >= 0.0) ? value : -value;
+ int exponent = 0;
+
+ /*
+ * We check for 99 > exponent > -99 in order to work around possible
+ * endless loops which could happen (at least) in the second loop (at
+ * least) if we're called with an infinite value. However, we checked
+ * for infinity before calling this function using our ISINF() macro, so
+ * this might be somewhat paranoid.
+ */
+ while (tmp < 1.0 && tmp > 0.0 && --exponent > -99)
+ tmp *= 10;
+ while (tmp >= 10.0 && ++exponent < 99)
+ tmp /= 10;
+
+ return exponent;
+}
+
+static int
+convert(UINTMAX_T value, char *buf, size_t size, int base, int caps)
+{
+ const char *digits = caps ? "0123456789ABCDEF" : "0123456789abcdef";
+ size_t pos = 0;
+
+ /* We return an unterminated buffer with the digits in reverse order. */
+ do {
+ buf[pos++] = digits[value % base];
+ value /= base;
+ } while (value != 0 && pos < size);
+
+ return (int)pos;
+}
+
+static UINTMAX_T
+cast(LDOUBLE value)
+{
+ UINTMAX_T result;
+
+ /*
+ * We check for ">=" and not for ">" because if UINTMAX_MAX cannot be
+ * represented exactly as an LDOUBLE value (but is less than LDBL_MAX),
+ * it may be increased to the nearest higher representable value for the
+ * comparison (cf. C99: 6.3.1.4, 2). It might then equal the LDOUBLE
+ * value although converting the latter to UINTMAX_T would overflow.
+ */
+ if (value >= UINTMAX_MAX)
+ return UINTMAX_MAX;
+
+ result = value;
+ /*
+ * At least on NetBSD/sparc64 3.0.2 and 4.99.30, casting long double to
+ * an integer type converts e.g. 1.9 to 2 instead of 1 (which violates
+ * the standard). Sigh.
+ */
+ return (result <= value) ? result : result - 1;
+}
+
+static UINTMAX_T
+myround(LDOUBLE value)
+{
+ UINTMAX_T intpart = cast(value);
+
+ return ((value -= intpart) < 0.5) ? intpart : intpart + 1;
+}
+
+static LDOUBLE
+mypow10(int exponent)
+{
+ LDOUBLE result = 1;
+
+ while (exponent > 0) {
+ result *= 10;
+ exponent--;
+ }
+ while (exponent < 0) {
+ result /= 10;
+ exponent++;
+ }
+ return result;
+}
+#endif /* HW_WANT_RPL_VSNPRINTF */
+
+#if HW_WANT_RPL_VASPRINTF
+#if NEED_MYMEMCPY
+void *
+mymemcpy(void *dst, void *src, size_t len)
+{
+ const char *from = src;
+ char *to = dst;
+
+ /* No need for optimization, we use this only to replace va_copy(3). */
+ while (len-- > 0)
+ *to++ = *from++;
+ return dst;
+}
+#endif /* NEED_MYMEMCPY */
+
+int
+rpl_vasprintf(char **ret, const char *format, va_list ap);
+
+int
+rpl_vasprintf(char **ret, const char *format, va_list ap)
+{
+ size_t size;
+ int len;
+ va_list aq;
+
+ VA_COPY(aq, ap);
+ len = vsnprintf(NULL, 0, format, aq);
+ VA_END_COPY(aq);
+ if (len < 0 || (*ret = malloc(size = len + 1)) == NULL)
+ return -1;
+ return vsnprintf(*ret, size, format, ap);
+}
+#endif /* HW_WANT_RPL_VASPRINTF */
+
+#if HW_WANT_RPL_SNPRINTF
+#if HAVE_STDARG_H
+int
+rpl_snprintf(char *str, size_t size, const char *format, ...);
+
+int
+rpl_snprintf(char *str, size_t size, const char *format, ...)
+#else
+int
+rpl_snprintf(va_alist) va_dcl
+#endif /* HAVE_STDARG_H */
+{
+#if !HAVE_STDARG_H
+ char *str;
+ size_t size;
+ char *format;
+#endif /* HAVE_STDARG_H */
+ va_list ap;
+ int len;
+
+ VA_START(ap, format);
+ VA_SHIFT(ap, str, char *);
+ VA_SHIFT(ap, size, size_t);
+ VA_SHIFT(ap, format, const char *);
+ len = vsnprintf(str, size, format, ap);
+ va_end(ap);
+ return len;
+}
+#endif /* HW_WANT_RPL_SNPRINTF */
+
+#if HW_WANT_RPL_ASPRINTF
+#if HAVE_STDARG_H
+int
+rpl_asprintf(char **ret, const char *format, ...);
+
+int
+rpl_asprintf(char **ret, const char *format, ...)
+#else
+int
+rpl_asprintf(va_alist) va_dcl
+#endif /* HAVE_STDARG_H */
+{
+#if !HAVE_STDARG_H
+ char **ret;
+ char *format;
+#endif /* HAVE_STDARG_H */
+ va_list ap;
+ int len;
+
+ VA_START(ap, format);
+ VA_SHIFT(ap, ret, char **);
+ VA_SHIFT(ap, format, const char *);
+ len = vasprintf(ret, format, ap);
+ va_end(ap);
+ return len;
+}
+#endif /* HW_WANT_RPL_ASPRINTF */
+#else /* Dummy declaration to avoid empty translation unit warnings. */
+int main(void);
+#endif /* HW_WANT_RPL_SNPRINTF || HW_WANT_RPL_VSNPRINTF || HW_WANT_RPL_ASPRINTF || [...] */
+
+#if TEST_SNPRINTF
+int
+main(void)
+{
+ const char *float_fmt[] = {
+ /* "%E" and "%e" formats. */
+#if HAVE_LONG_LONG_INT && !OS_BSD && !OS_IRIX
+ "%.16e",
+ "%22.16e",
+ "%022.16e",
+ "%-22.16e",
+ "%#+'022.16e",
+#endif /* HAVE_LONG_LONG_INT && !OS_BSD && !OS_IRIX */
+ "foo|%#+0123.9E|bar",
+ "%-123.9e",
+ "%123.9e",
+ "%+23.9e",
+ "%+05.8e",
+ "%-05.8e",
+ "%05.8e",
+ "%+5.8e",
+ "%-5.8e",
+ "% 5.8e",
+ "%5.8e",
+ "%+4.9e",
+#if !OS_LINUX /* glibc sometimes gets these wrong. */
+ "%+#010.0e",
+ "%#10.1e",
+ "%10.5e",
+ "% 10.5e",
+ "%5.0e",
+ "%5.e",
+ "%#5.0e",
+ "%#5.e",
+ "%3.2e",
+ "%3.1e",
+ "%-1.5e",
+ "%1.5e",
+ "%01.3e",
+ "%1.e",
+ "%.1e",
+ "%#.0e",
+ "%+.0e",
+ "% .0e",
+ "%.0e",
+ "%#.e",
+ "%+.e",
+ "% .e",
+ "%.e",
+ "%4e",
+ "%e",
+ "%E",
+#endif /* !OS_LINUX */
+ /* "%F" and "%f" formats. */
+#if !OS_BSD && !OS_IRIX
+ "% '022f",
+ "%+'022f",
+ "%-'22f",
+ "%'22f",
+#if HAVE_LONG_LONG_INT
+ "%.16f",
+ "%22.16f",
+ "%022.16f",
+ "%-22.16f",
+ "%#+'022.16f",
+#endif /* HAVE_LONG_LONG_INT */
+#endif /* !OS_BSD && !OS_IRIX */
+ "foo|%#+0123.9F|bar",
+ "%-123.9f",
+ "%123.9f",
+ "%+23.9f",
+ "%+#010.0f",
+ "%#10.1f",
+ "%10.5f",
+ "% 10.5f",
+ "%+05.8f",
+ "%-05.8f",
+ "%05.8f",
+ "%+5.8f",
+ "%-5.8f",
+ "% 5.8f",
+ "%5.8f",
+ "%5.0f",
+ "%5.f",
+ "%#5.0f",
+ "%#5.f",
+ "%+4.9f",
+ "%3.2f",
+ "%3.1f",
+ "%-1.5f",
+ "%1.5f",
+ "%01.3f",
+ "%1.f",
+ "%.1f",
+ "%#.0f",
+ "%+.0f",
+ "% .0f",
+ "%.0f",
+ "%#.f",
+ "%+.f",
+ "% .f",
+ "%.f",
+ "%4f",
+ "%f",
+ "%F",
+ /* "%G" and "%g" formats. */
+#if !OS_BSD && !OS_IRIX && !OS_LINUX
+ "% '022g",
+ "%+'022g",
+ "%-'22g",
+ "%'22g",
+#if HAVE_LONG_LONG_INT
+ "%.16g",
+ "%22.16g",
+ "%022.16g",
+ "%-22.16g",
+ "%#+'022.16g",
+#endif /* HAVE_LONG_LONG_INT */
+#endif /* !OS_BSD && !OS_IRIX && !OS_LINUX */
+ "foo|%#+0123.9G|bar",
+ "%-123.9g",
+ "%123.9g",
+ "%+23.9g",
+ "%+05.8g",
+ "%-05.8g",
+ "%05.8g",
+ "%+5.8g",
+ "%-5.8g",
+ "% 5.8g",
+ "%5.8g",
+ "%+4.9g",
+#if !OS_LINUX /* glibc sometimes gets these wrong. */
+ "%+#010.0g",
+ "%#10.1g",
+ "%10.5g",
+ "% 10.5g",
+ "%5.0g",
+ "%5.g",
+ "%#5.0g",
+ "%#5.g",
+ "%3.2g",
+ "%3.1g",
+ "%-1.5g",
+ "%1.5g",
+ "%01.3g",
+ "%1.g",
+ "%.1g",
+ "%#.0g",
+ "%+.0g",
+ "% .0g",
+ "%.0g",
+ "%#.g",
+ "%+.g",
+ "% .g",
+ "%.g",
+ "%4g",
+ "%g",
+ "%G",
+#endif /* !OS_LINUX */
+ NULL
+ };
+ double float_val[] = {
+ -4.136,
+ -134.52,
+ -5.04030201,
+ -3410.01234,
+ -999999.999999,
+ -913450.29876,
+ -913450.2,
+ -91345.2,
+ -9134.2,
+ -913.2,
+ -91.2,
+ -9.2,
+ -9.9,
+ 4.136,
+ 134.52,
+ 5.04030201,
+ 3410.01234,
+ 999999.999999,
+ 913450.29876,
+ 913450.2,
+ 91345.2,
+ 9134.2,
+ 913.2,
+ 91.2,
+ 9.2,
+ 9.9,
+ 9.96,
+ 9.996,
+ 9.9996,
+ 9.99996,
+ 9.999996,
+ 9.9999996,
+ 9.99999996,
+ 0.99999996,
+ 0.99999999,
+ 0.09999999,
+ 0.00999999,
+ 0.00099999,
+ 0.00009999,
+ 0.00000999,
+ 0.00000099,
+ 0.00000009,
+ 0.00000001,
+ 0.0000001,
+ 0.000001,
+ 0.00001,
+ 0.0001,
+ 0.001,
+ 0.01,
+ 0.1,
+ 1.0,
+ 1.5,
+ -1.5,
+ -1.0,
+ -0.1,
+#if !OS_BSD /* BSD sometimes gets these wrong. */
+#ifdef INFINITY
+ INFINITY,
+ -INFINITY,
+#endif /* defined(INFINITY) */
+#ifdef NAN
+ NAN,
+#endif /* defined(NAN) */
+#endif /* !OS_BSD */
+ 0
+ };
+ const char *long_fmt[] = {
+ "foo|%0123ld|bar",
+#if !OS_IRIX
+ "% '0123ld",
+ "%+'0123ld",
+ "%-'123ld",
+ "%'123ld",
+#endif /* !OS_IRiX */
+ "%123.9ld",
+ "% 123.9ld",
+ "%+123.9ld",
+ "%-123.9ld",
+ "%0123ld",
+ "% 0123ld",
+ "%+0123ld",
+ "%-0123ld",
+ "%10.5ld",
+ "% 10.5ld",
+ "%+10.5ld",
+ "%-10.5ld",
+ "%010ld",
+ "% 010ld",
+ "%+010ld",
+ "%-010ld",
+ "%4.2ld",
+ "% 4.2ld",
+ "%+4.2ld",
+ "%-4.2ld",
+ "%04ld",
+ "% 04ld",
+ "%+04ld",
+ "%-04ld",
+ "%5.5ld",
+ "%+22.33ld",
+ "%01.3ld",
+ "%1.5ld",
+ "%-1.5ld",
+ "%44ld",
+ "%4ld",
+ "%4.0ld",
+ "%4.ld",
+ "%.44ld",
+ "%.4ld",
+ "%.0ld",
+ "%.ld",
+ "%ld",
+ NULL
+ };
+ long int long_val[] = {
+#ifdef LONG_MAX
+ LONG_MAX,
+#endif /* LONG_MAX */
+#ifdef LONG_MIN
+ LONG_MIN,
+#endif /* LONG_MIN */
+ -91340,
+ 91340,
+ 341,
+ 134,
+ 0203,
+ -1,
+ 1,
+ 0
+ };
+ const char *ulong_fmt[] = {
+ /* "%u" formats. */
+ "foo|%0123lu|bar",
+#if !OS_IRIX
+ "% '0123lu",
+ "%+'0123lu",
+ "%-'123lu",
+ "%'123lu",
+#endif /* !OS_IRiX */
+ "%123.9lu",
+ "% 123.9lu",
+ "%+123.9lu",
+ "%-123.9lu",
+ "%0123lu",
+ "% 0123lu",
+ "%+0123lu",
+ "%-0123lu",
+ "%5.5lu",
+ "%+22.33lu",
+ "%01.3lu",
+ "%1.5lu",
+ "%-1.5lu",
+ "%44lu",
+ "%lu",
+ /* "%o" formats. */
+ "foo|%#0123lo|bar",
+ "%#123.9lo",
+ "%# 123.9lo",
+ "%#+123.9lo",
+ "%#-123.9lo",
+ "%#0123lo",
+ "%# 0123lo",
+ "%#+0123lo",
+ "%#-0123lo",
+ "%#5.5lo",
+ "%#+22.33lo",
+ "%#01.3lo",
+ "%#1.5lo",
+ "%#-1.5lo",
+ "%#44lo",
+ "%#lo",
+ "%123.9lo",
+ "% 123.9lo",
+ "%+123.9lo",
+ "%-123.9lo",
+ "%0123lo",
+ "% 0123lo",
+ "%+0123lo",
+ "%-0123lo",
+ "%5.5lo",
+ "%+22.33lo",
+ "%01.3lo",
+ "%1.5lo",
+ "%-1.5lo",
+ "%44lo",
+ "%lo",
+ /* "%X" and "%x" formats. */
+ "foo|%#0123lX|bar",
+ "%#123.9lx",
+ "%# 123.9lx",
+ "%#+123.9lx",
+ "%#-123.9lx",
+ "%#0123lx",
+ "%# 0123lx",
+ "%#+0123lx",
+ "%#-0123lx",
+ "%#5.5lx",
+ "%#+22.33lx",
+ "%#01.3lx",
+ "%#1.5lx",
+ "%#-1.5lx",
+ "%#44lx",
+ "%#lx",
+ "%#lX",
+ "%123.9lx",
+ "% 123.9lx",
+ "%+123.9lx",
+ "%-123.9lx",
+ "%0123lx",
+ "% 0123lx",
+ "%+0123lx",
+ "%-0123lx",
+ "%5.5lx",
+ "%+22.33lx",
+ "%01.3lx",
+ "%1.5lx",
+ "%-1.5lx",
+ "%44lx",
+ "%lx",
+ "%lX",
+ NULL
+ };
+ unsigned long int ulong_val[] = {
+#ifdef ULONG_MAX
+ ULONG_MAX,
+#endif /* ULONG_MAX */
+ 91340,
+ 341,
+ 134,
+ 0203,
+ 1,
+ 0
+ };
+ const char *llong_fmt[] = {
+ "foo|%0123lld|bar",
+ "%123.9lld",
+ "% 123.9lld",
+ "%+123.9lld",
+ "%-123.9lld",
+ "%0123lld",
+ "% 0123lld",
+ "%+0123lld",
+ "%-0123lld",
+ "%5.5lld",
+ "%+22.33lld",
+ "%01.3lld",
+ "%1.5lld",
+ "%-1.5lld",
+ "%44lld",
+ "%lld",
+ NULL
+ };
+ LLONG llong_val[] = {
+#ifdef LLONG_MAX
+ LLONG_MAX,
+#endif /* LLONG_MAX */
+#ifdef LLONG_MIN
+ LLONG_MIN,
+#endif /* LLONG_MIN */
+ -91340,
+ 91340,
+ 341,
+ 134,
+ 0203,
+ -1,
+ 1,
+ 0
+ };
+ const char *string_fmt[] = {
+ "foo|%10.10s|bar",
+ "%-10.10s",
+ "%10.10s",
+ "%10.5s",
+ "%5.10s",
+ "%10.1s",
+ "%1.10s",
+ "%10.0s",
+ "%0.10s",
+ "%-42.5s",
+ "%2.s",
+ "%.10s",
+ "%.1s",
+ "%.0s",
+ "%.s",
+ "%4s",
+ "%s",
+ NULL
+ };
+ const char *string_val[] = {
+ "Hello",
+ "Hello, world!",
+ "Sound check: One, two, three.",
+ "This string is a little longer than the other strings.",
+ "1",
+ "",
+ NULL
+ };
+#if !OS_SYSV /* SysV uses a different format than we do. */
+ const char *pointer_fmt[] = {
+ "foo|%p|bar",
+ "%42p",
+ "%p",
+ NULL
+ };
+ const char *pointer_val[] = {
+ *pointer_fmt,
+ *string_fmt,
+ *string_val,
+ NULL
+ };
+#endif /* !OS_SYSV */
+ char buf1[1024], buf2[1024];
+ double value, digits = 9.123456789012345678901234567890123456789;
+ int i, j, r1, r2, failed = 0, num = 0;
+
+/*
+ * Use -DTEST_NILS in order to also test the conversion of nil values. Might
+ * segfault on systems which don't support converting a NULL pointer with "%s"
+ * and lets some test cases fail against BSD and glibc due to bugs in their
+ * implementations.
+ */
+#ifndef TEST_NILS
+#define TEST_NILS 0
+#elif TEST_NILS
+#undef TEST_NILS
+#define TEST_NILS 1
+#endif /* !defined(TEST_NILS) */
+#ifdef TEST
+#undef TEST
+#endif /* defined(TEST) */
+#define TEST(fmt, val) \
+do { \
+ for (i = 0; fmt[i] != NULL; i++) \
+ for (j = 0; j == 0 || val[j - TEST_NILS] != 0; j++) { \
+ r1 = sprintf(buf1, fmt[i], val[j]); \
+ r2 = snprintf(buf2, sizeof(buf2), fmt[i], val[j]); \
+ if (strcmp(buf1, buf2) != 0 || r1 != r2) { \
+ (void)printf("Results don't match, " \
+ "format string: %s\n" \
+ "\t sprintf(3): [%s] (%d)\n" \
+ "\tsnprintf(3): [%s] (%d)\n", \
+ fmt[i], buf1, r1, buf2, r2); \
+ failed++; \
+ } \
+ num++; \
+ } \
+} while (/* CONSTCOND */ 0)
+
+#if HAVE_LOCALE_H
+ (void)setlocale(LC_ALL, "");
+#endif /* HAVE_LOCALE_H */
+
+ (void)puts("Testing our snprintf(3) against your system's sprintf(3).");
+ TEST(float_fmt, float_val);
+ TEST(long_fmt, long_val);
+ TEST(ulong_fmt, ulong_val);
+ TEST(llong_fmt, llong_val);
+ TEST(string_fmt, string_val);
+#if !OS_SYSV /* SysV uses a different format than we do. */
+ TEST(pointer_fmt, pointer_val);
+#endif /* !OS_SYSV */
+ (void)printf("Result: %d out of %d tests failed.\n", failed, num);
+
+ (void)fputs("Checking how many digits we support: ", stdout);
+ for (i = 0; i < 100; i++) {
+ value = pow(10, i) * digits;
+ (void)sprintf(buf1, "%.1f", value);
+ (void)snprintf(buf2, sizeof(buf2), "%.1f", value);
+ if (strcmp(buf1, buf2) != 0) {
+ (void)printf("apparently %d.\n", i);
+ break;
+ }
+ }
+ return (failed == 0) ? 0 : 1;
+}
+#endif /* TEST_SNPRINTF */
+
+/* vim: set joinspaces textwidth=80: */
diff --git a/libntp/socket.c b/libntp/socket.c
new file mode 100644
index 0000000..de678c6
--- /dev/null
+++ b/libntp/socket.c
@@ -0,0 +1,218 @@
+/*
+ * socket.c - low-level socket operations
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include "ntp.h"
+#include "ntp_io.h"
+#include "ntp_net.h"
+#include "ntp_debug.h"
+
+/*
+ * Windows C runtime ioctl() can't deal properly with sockets,
+ * map to ioctlsocket for this source file.
+ */
+#ifdef SYS_WINNT
+#define ioctl(fd, opt, val) ioctlsocket(fd, opt, (u_long *)(val))
+#endif
+
+/*
+ * on Unix systems the stdio library typically
+ * makes use of file descriptors in the lower
+ * integer range. stdio usually will make use
+ * of the file descriptors in the range of
+ * [0..FOPEN_MAX)
+ * in order to keep this range clean, for socket
+ * file descriptors we attempt to move them above
+ * FOPEN_MAX. This is not as easy as it sounds as
+ * FOPEN_MAX changes from implementation to implementation
+ * and may exceed to current file decriptor limits.
+ * We are using following strategy:
+ * - keep a current socket fd boundary initialized with
+ * max(0, min(GETDTABLESIZE() - FD_CHUNK, FOPEN_MAX))
+ * - attempt to move the descriptor to the boundary or
+ * above.
+ * - if that fails and boundary > 0 set boundary
+ * to min(0, socket_fd_boundary - FD_CHUNK)
+ * -> retry
+ * if failure and boundary == 0 return old fd
+ * - on success close old fd return new fd
+ *
+ * effects:
+ * - fds will be moved above the socket fd boundary
+ * if at all possible.
+ * - the socket boundary will be reduced until
+ * allocation is possible or 0 is reached - at this
+ * point the algrithm will be disabled
+ */
+SOCKET
+move_fd(
+ SOCKET fd
+ )
+{
+#if !defined(SYS_WINNT) && defined(F_DUPFD)
+#ifndef FD_CHUNK
+#define FD_CHUNK 10
+#endif
+#ifndef FOPEN_MAX
+#define FOPEN_MAX 20
+#endif
+/*
+ * number of fds we would like to have for
+ * stdio FILE* available.
+ * we can pick a "low" number as our use of
+ * FILE* is limited to log files and temporarily
+ * to data and config files. Except for log files
+ * we don't keep the other FILE* open beyond the
+ * scope of the function that opened it.
+ */
+#ifndef FD_PREFERRED_SOCKBOUNDARY
+#define FD_PREFERRED_SOCKBOUNDARY 48
+#endif
+
+ static SOCKET socket_boundary = -1;
+ SOCKET newfd;
+
+ NTP_REQUIRE((int)fd >= 0);
+
+ /*
+ * check whether boundary has be set up
+ * already
+ */
+ if (socket_boundary == -1) {
+ socket_boundary = max(0, min(GETDTABLESIZE() - FD_CHUNK,
+ min(FOPEN_MAX, FD_PREFERRED_SOCKBOUNDARY)));
+ TRACE(1, ("move_fd: estimated max descriptors: %d, "
+ "initial socket boundary: %d\n",
+ GETDTABLESIZE(), socket_boundary));
+ }
+
+ /*
+ * Leave a space for stdio to work in. potentially moving the
+ * socket_boundary lower until allocation succeeds.
+ */
+ do {
+ if (fd >= 0 && fd < socket_boundary) {
+ /* inside reserved range: attempt to move fd */
+ newfd = fcntl(fd, F_DUPFD, socket_boundary);
+
+ if (newfd != -1) {
+ /* success: drop the old one - return the new one */
+ close(fd);
+ return newfd;
+ }
+ } else {
+ /* outside reserved range: no work - return the original one */
+ return fd;
+ }
+ socket_boundary = max(0, socket_boundary - FD_CHUNK);
+ TRACE(1, ("move_fd: selecting new socket boundary: %d\n",
+ socket_boundary));
+ } while (socket_boundary > 0);
+#else
+ NTP_REQUIRE((int)fd >= 0);
+#endif /* !defined(SYS_WINNT) && defined(F_DUPFD) */
+ return fd;
+}
+
+
+/*
+ * make_socket_nonblocking() - set up descriptor to be non blocking
+ */
+void
+make_socket_nonblocking(
+ SOCKET fd
+ )
+{
+ /*
+ * set non-blocking,
+ */
+
+#ifdef USE_FIONBIO
+ /* in vxWorks we use FIONBIO, but the others are defined for old
+ * systems, so all hell breaks loose if we leave them defined
+ */
+#undef O_NONBLOCK
+#undef FNDELAY
+#undef O_NDELAY
+#endif
+
+#if defined(O_NONBLOCK) /* POSIX */
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
+ msyslog(LOG_ERR,
+ "fcntl(O_NONBLOCK) fails on fd #%d: %m", fd);
+ exit(1);
+ }
+#elif defined(FNDELAY)
+ if (fcntl(fd, F_SETFL, FNDELAY) < 0) {
+ msyslog(LOG_ERR, "fcntl(FNDELAY) fails on fd #%d: %m",
+ fd);
+ exit(1);
+ }
+#elif defined(O_NDELAY) /* generally the same as FNDELAY */
+ if (fcntl(fd, F_SETFL, O_NDELAY) < 0) {
+ msyslog(LOG_ERR, "fcntl(O_NDELAY) fails on fd #%d: %m",
+ fd);
+ exit(1);
+ }
+#elif defined(FIONBIO)
+ {
+ int on = 1;
+
+ if (ioctl(fd, FIONBIO, &on) < 0) {
+ msyslog(LOG_ERR,
+ "ioctl(FIONBIO) fails on fd #%d: %m",
+ fd);
+ exit(1);
+ }
+ }
+#elif defined(FIOSNBIO)
+ if (ioctl(fd, FIOSNBIO, &on) < 0) {
+ msyslog(LOG_ERR,
+ "ioctl(FIOSNBIO) fails on fd #%d: %m", fd);
+ exit(1);
+ }
+#else
+# include "Bletch: Need non-blocking I/O!"
+#endif
+}
+
+#if 0
+
+/* The following subroutines should probably be moved here */
+
+static SOCKET
+open_socket(
+ sockaddr_u * addr,
+ int bcast,
+ int turn_off_reuse,
+ endpt * interf
+ )
+void
+sendpkt(
+ sockaddr_u * dest,
+ struct interface * ep,
+ int ttl,
+ struct pkt * pkt,
+ int len
+ )
+
+static inline int
+read_refclock_packet(SOCKET fd, struct refclockio *rp, l_fp ts)
+
+static inline int
+read_network_packet(
+ SOCKET fd,
+ struct interface * itf,
+ l_fp ts
+ )
+
+void
+kill_asyncio(int startfd)
+
+#endif /* 0 */
diff --git a/libntp/socktoa.c b/libntp/socktoa.c
new file mode 100644
index 0000000..98abe7c
--- /dev/null
+++ b/libntp/socktoa.c
@@ -0,0 +1,170 @@
+/*
+ * socktoa.c socktoa(), sockporttoa(), and sock_hash()
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <stdio.h>
+#include <arpa/inet.h>
+#include <isc/result.h>
+#include <isc/netaddr.h>
+#include <isc/sockaddr.h>
+
+#include "ntp_fp.h"
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+#include "ntp.h"
+
+/*
+ * socktoa - return a numeric host name from a sockaddr_storage structure
+ */
+const char *
+socktoa(
+ const sockaddr_u *sock
+ )
+{
+ int saved_errno;
+ char * res;
+ char * addr;
+ u_long scope;
+
+ saved_errno = socket_errno();
+ LIB_GETBUF(res);
+
+ if (NULL == sock) {
+ strlcpy(res, "(null)", LIB_BUFLENGTH);
+ } else {
+ switch(AF(sock)) {
+
+ case AF_INET:
+ case AF_UNSPEC:
+ inet_ntop(AF_INET, PSOCK_ADDR4(sock), res,
+ LIB_BUFLENGTH);
+ break;
+
+ case AF_INET6:
+ inet_ntop(AF_INET6, PSOCK_ADDR6(sock), res,
+ LIB_BUFLENGTH);
+ scope = SCOPE_VAR(sock);
+ if (0 != scope && !strchr(res, '%')) {
+ addr = res;
+ LIB_GETBUF(res);
+ snprintf(res, LIB_BUFLENGTH, "%s%%%lu",
+ addr, scope);
+ res[LIB_BUFLENGTH - 1] = '\0';
+ }
+ break;
+
+ default:
+ snprintf(res, LIB_BUFLENGTH,
+ "(socktoa unknown family %d)",
+ AF(sock));
+ }
+ }
+ errno = saved_errno;
+
+ return res;
+}
+
+
+const char *
+sockporttoa(
+ const sockaddr_u *sock
+ )
+{
+ int saved_errno;
+ const char * atext;
+ char * buf;
+
+ saved_errno = socket_errno();
+ atext = socktoa(sock);
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH,
+ (IS_IPV6(sock))
+ ? "[%s]:%hu"
+ : "%s:%hu",
+ atext, SRCPORT(sock));
+ errno = saved_errno;
+
+ return buf;
+}
+
+
+/*
+ * sock_hash - hash a sockaddr_u structure
+ */
+u_short
+sock_hash(
+ const sockaddr_u *addr
+ )
+{
+ u_int hashVal;
+ u_int j;
+ size_t len;
+ const u_char *pch;
+
+ hashVal = 0;
+ len = 0;
+
+ /*
+ * We can't just hash the whole thing because there are hidden
+ * fields in sockaddr_in6 that might be filled in by recvfrom(),
+ * so just use the family, port and address.
+ */
+ pch = (const void *)&AF(addr);
+ hashVal = 37 * hashVal + *pch;
+ if (sizeof(AF(addr)) > 1) {
+ pch++;
+ hashVal = 37 * hashVal + *pch;
+ }
+ switch(AF(addr)) {
+ case AF_INET:
+ pch = (const void *)&SOCK_ADDR4(addr);
+ len = sizeof(SOCK_ADDR4(addr));
+ break;
+
+ case AF_INET6:
+ pch = (const void *)&SOCK_ADDR6(addr);
+ len = sizeof(SOCK_ADDR6(addr));
+ break;
+ }
+
+ for (j = 0; j < len ; j++)
+ hashVal = 37 * hashVal + pch[j];
+
+ return (u_short)(hashVal & USHRT_MAX);
+}
+
+
+int
+sockaddr_masktoprefixlen(
+ const sockaddr_u * psa
+ )
+{
+ isc_netaddr_t isc_na;
+ isc_sockaddr_t isc_sa;
+ u_int pfxlen;
+ isc_result_t result;
+ int rc;
+
+ ZERO(isc_sa);
+ memcpy(&isc_sa.type, psa,
+ min(sizeof(isc_sa.type), sizeof(*psa)));
+ isc_netaddr_fromsockaddr(&isc_na, &isc_sa);
+ result = isc_netaddr_masktoprefixlen(&isc_na, &pfxlen);
+ rc = (ISC_R_SUCCESS == result)
+ ? (int)pfxlen
+ : -1;
+
+ return rc;
+}
diff --git a/libntp/socktohost.c b/libntp/socktohost.c
new file mode 100644
index 0000000..c61e571
--- /dev/null
+++ b/libntp/socktohost.c
@@ -0,0 +1,110 @@
+/*
+ * socktoa - return a numeric host name from a sockaddr_storage structure
+ */
+#include <config.h>
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <arpa/inet.h>
+
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+#include "ntp.h"
+#include "ntp_debug.h"
+
+
+const char *
+socktohost(
+ const sockaddr_u *sock
+ )
+{
+ const char svc[] = "ntp";
+ char * pbuf;
+ char * pliar;
+ int gni_flags;
+ struct addrinfo hints;
+ struct addrinfo * alist;
+ struct addrinfo * ai;
+ sockaddr_u addr;
+ size_t octets;
+ int a_info;
+
+ /* reverse the address to purported DNS name */
+ LIB_GETBUF(pbuf);
+ gni_flags = NI_DGRAM | NI_NAMEREQD;
+ if (getnameinfo(&sock->sa, SOCKLEN(sock), pbuf, LIB_BUFLENGTH,
+ NULL, 0, gni_flags))
+ return stoa(sock); /* use address */
+
+ TRACE(1, ("%s reversed to %s\n", stoa(sock), pbuf));
+
+ /*
+ * Resolve the reversed name and make sure the reversed address
+ * is among the results.
+ */
+ ZERO(hints);
+ hints.ai_family = AF(sock);
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = 0;
+ alist = NULL;
+
+ a_info = getaddrinfo(pbuf, svc, &hints, &alist);
+ if (a_info == EAI_NONAME
+#ifdef EAI_NODATA
+ || a_info == EAI_NODATA
+#endif
+ ) {
+ hints.ai_flags = AI_CANONNAME;
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+ a_info = getaddrinfo(pbuf, svc, &hints, &alist);
+ }
+#ifdef AI_ADDRCONFIG
+ /* Some older implementations don't like AI_ADDRCONFIG. */
+ if (a_info == EAI_BADFLAGS) {
+ hints.ai_flags &= ~AI_ADDRCONFIG;
+ a_info = getaddrinfo(pbuf, svc, &hints, &alist);
+ }
+#endif
+ if (a_info)
+ goto forward_fail;
+
+ NTP_INSIST(alist != NULL);
+
+ for (ai = alist; ai != NULL; ai = ai->ai_next) {
+ /*
+ * Make a convenience sockaddr_u copy from ai->ai_addr
+ * because casting from sockaddr * to sockaddr_u * is
+ * risking alignment problems on platforms where
+ * sockaddr_u has stricter alignment than sockaddr,
+ * such as sparc.
+ */
+ ZERO_SOCK(&addr);
+ octets = min(sizeof(addr), ai->ai_addrlen);
+ memcpy(&addr, ai->ai_addr, octets);
+ if (SOCK_EQ(sock, &addr))
+ break;
+ }
+ freeaddrinfo(alist);
+
+ if (ai != NULL)
+ return pbuf; /* forward check passed */
+
+ forward_fail:
+ TRACE(1, ("%s forward check lookup fail: %s\n", pbuf,
+ gai_strerror(a_info)));
+ LIB_GETBUF(pliar);
+ snprintf(pliar, LIB_BUFLENGTH, "%s (%s)", stoa(sock), pbuf);
+
+ return pliar;
+}
diff --git a/libntp/ssl_init.c b/libntp/ssl_init.c
new file mode 100644
index 0000000..7f1e9a0
--- /dev/null
+++ b/libntp/ssl_init.c
@@ -0,0 +1,187 @@
+/*
+ * ssl_init.c Common OpenSSL initialization code for the various
+ * programs which use it.
+ *
+ * Moved from ntpd/ntp_crypto.c crypto_setup()
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <ctype.h>
+#include <ntp.h>
+#include <ntp_debug.h>
+#include <lib_strbuf.h>
+
+#ifdef OPENSSL
+#include "openssl/err.h"
+#include "openssl/evp.h"
+
+void atexit_ssl_cleanup(void);
+
+int ssl_init_done;
+
+void
+ssl_init(void)
+{
+ init_lib();
+
+ if (ssl_init_done)
+ return;
+
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+ atexit(&atexit_ssl_cleanup);
+
+ ssl_init_done = TRUE;
+}
+
+
+void
+atexit_ssl_cleanup(void)
+{
+ if (!ssl_init_done)
+ return;
+
+ ssl_init_done = FALSE;
+ EVP_cleanup();
+ ERR_free_strings();
+}
+
+
+void
+ssl_check_version(void)
+{
+ if ((SSLeay() ^ OPENSSL_VERSION_NUMBER) & ~0xff0L) {
+ msyslog(LOG_WARNING,
+ "OpenSSL version mismatch. Built against %lx, you have %lx",
+ (u_long)OPENSSL_VERSION_NUMBER, SSLeay());
+ fprintf(stderr,
+ "OpenSSL version mismatch. Built against %lx, you have %lx\n",
+ (u_long)OPENSSL_VERSION_NUMBER, SSLeay());
+ }
+
+ INIT_SSL();
+}
+#endif /* OPENSSL */
+
+
+/*
+ * keytype_from_text returns OpenSSL NID for digest by name, and
+ * optionally the associated digest length.
+ *
+ * Used by ntpd authreadkeys(), ntpq and ntpdc keytype()
+ */
+int
+keytype_from_text(
+ const char *text,
+ size_t *pdigest_len
+ )
+{
+ int key_type;
+ u_int digest_len;
+#ifdef OPENSSL
+ const u_long max_digest_len = MAX_MAC_LEN - sizeof(keyid_t);
+ u_char digest[EVP_MAX_MD_SIZE];
+ char * upcased;
+ char * pch;
+ EVP_MD_CTX ctx;
+
+ /*
+ * OpenSSL digest short names are capitalized, so uppercase the
+ * digest name before passing to OBJ_sn2nid(). If it is not
+ * recognized but begins with 'M' use NID_md5 to be consistent
+ * with past behavior.
+ */
+ INIT_SSL();
+ LIB_GETBUF(upcased);
+ strlcpy(upcased, text, LIB_BUFLENGTH);
+ for (pch = upcased; '\0' != *pch; pch++)
+ *pch = (char)toupper(*pch);
+ key_type = OBJ_sn2nid(upcased);
+#else
+ key_type = 0;
+#endif
+
+ if (!key_type && 'm' == tolower(text[0]))
+ key_type = NID_md5;
+
+ if (!key_type)
+ return 0;
+
+ if (NULL != pdigest_len) {
+#ifdef OPENSSL
+ EVP_DigestInit(&ctx, EVP_get_digestbynid(key_type));
+ EVP_DigestFinal(&ctx, digest, &digest_len);
+ if (digest_len > max_digest_len) {
+ fprintf(stderr,
+ "key type %s %u octet digests are too big, max %lu\n",
+ keytype_name(key_type), digest_len,
+ max_digest_len);
+ msyslog(LOG_ERR,
+ "key type %s %u octet digests are too big, max %lu",
+ keytype_name(key_type), digest_len,
+ max_digest_len);
+ return 0;
+ }
+#else
+ digest_len = 16;
+#endif
+ *pdigest_len = digest_len;
+ }
+
+ return key_type;
+}
+
+
+/*
+ * keytype_name returns OpenSSL short name for digest by NID.
+ *
+ * Used by ntpq and ntpdc keytype()
+ */
+const char *
+keytype_name(
+ int nid
+ )
+{
+ static const char unknown_type[] = "(unknown key type)";
+ const char *name;
+
+#ifdef OPENSSL
+ INIT_SSL();
+ name = OBJ_nid2sn(nid);
+ if (NULL == name)
+ name = unknown_type;
+#else /* !OPENSSL follows */
+ if (NID_md5 == nid)
+ name = "MD5";
+ else
+ name = unknown_type;
+#endif
+ return name;
+}
+
+
+/*
+ * Use getpassphrase() if configure.ac detected it, as Suns that
+ * have it truncate the password in getpass() to 8 characters.
+ */
+#ifdef HAVE_GETPASSPHRASE
+# define getpass(str) getpassphrase(str)
+#endif
+
+/*
+ * getpass_keytype() -- shared between ntpq and ntpdc, only vaguely
+ * related to the rest of ssl_init.c.
+ */
+char *
+getpass_keytype(
+ int keytype
+ )
+{
+ char pass_prompt[64 + 11 + 1]; /* 11 for " Password: " */
+
+ snprintf(pass_prompt, sizeof(pass_prompt),
+ "%.64s Password: ", keytype_name(keytype));
+
+ return getpass(pass_prompt);
+}
diff --git a/libntp/statestr.c b/libntp/statestr.c
new file mode 100644
index 0000000..cd98eb3
--- /dev/null
+++ b/libntp/statestr.c
@@ -0,0 +1,501 @@
+/*
+ * pretty printing of status information
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "lib_strbuf.h"
+#include "ntp_refclock.h"
+#include "ntp_control.h"
+#include "ntp_string.h"
+#ifdef KERNEL_PLL
+# include "ntp_syscall.h"
+#endif
+
+
+/*
+ * Structure for turning various constants into a readable string.
+ */
+struct codestring {
+ int code;
+ const char * const string;
+};
+
+/*
+ * Leap status (leap)
+ */
+static const struct codestring leap_codes[] = {
+ { LEAP_NOWARNING, "leap_none" },
+ { LEAP_ADDSECOND, "leap_add_sec" },
+ { LEAP_DELSECOND, "leap_del_sec" },
+ { LEAP_NOTINSYNC, "leap_alarm" },
+ { -1, "leap" }
+};
+
+/*
+ * Clock source status (sync)
+ */
+static const struct codestring sync_codes[] = {
+ { CTL_SST_TS_UNSPEC, "sync_unspec" },
+ { CTL_SST_TS_ATOM, "sync_pps" },
+ { CTL_SST_TS_LF, "sync_lf_radio" },
+ { CTL_SST_TS_HF, "sync_hf_radio" },
+ { CTL_SST_TS_UHF, "sync_uhf_radio" },
+ { CTL_SST_TS_LOCAL, "sync_local" },
+ { CTL_SST_TS_NTP, "sync_ntp" },
+ { CTL_SST_TS_UDPTIME, "sync_other" },
+ { CTL_SST_TS_WRSTWTCH, "sync_wristwatch" },
+ { CTL_SST_TS_TELEPHONE, "sync_telephone" },
+ { -1, "sync" }
+};
+
+/*
+ * Peer selection status (sel)
+ */
+static 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_SYNCCAND, "sel_candidate" },
+ { CTL_PST_SEL_EXCESS, "sel_backup" },
+ { CTL_PST_SEL_SYSPEER, "sel_sys.peer" },
+ { CTL_PST_SEL_PPS, "sel_pps.peer" },
+ { -1, "sel" }
+};
+
+/*
+ * Clock status (clk)
+ */
+static const struct codestring clock_codes[] = {
+ { CTL_CLK_OKAY, "clk_unspec" },
+ { CTL_CLK_NOREPLY, "clk_no_reply" },
+ { CTL_CLK_BADFORMAT, "clk_bad_format" },
+ { CTL_CLK_FAULT, "clk_fault" },
+ { CTL_CLK_PROPAGATION, "clk_bad_signal" },
+ { CTL_CLK_BADDATE, "clk_bad_date" },
+ { CTL_CLK_BADTIME, "clk_bad_time" },
+ { -1, "clk" }
+};
+
+
+#ifdef FLASH_CODES_UNUSED
+/*
+ * Flash bits -- see ntpq.c tstflags & tstflagnames
+ */
+static const struct codestring flash_codes[] = {
+ { TEST1, "pkt_dup" },
+ { TEST2, "pkt_bogus" },
+ { TEST3, "pkt_unsync" },
+ { TEST4, "pkt_denied" },
+ { TEST5, "pkt_auth" },
+ { TEST6, "pkt_stratum" },
+ { TEST7, "pkt_header" },
+ { TEST8, "pkt_autokey" },
+ { TEST9, "pkt_crypto" },
+ { TEST10, "peer_stratum" },
+ { TEST11, "peer_dist" },
+ { TEST12, "peer_loop" },
+ { TEST13, "peer_unreach" },
+ { -1, "flash" }
+};
+#endif
+
+
+/*
+ * System events (sys)
+ */
+static const struct codestring sys_codes[] = {
+ { EVNT_UNSPEC, "unspecified" },
+ { EVNT_NSET, "freq_not_set" },
+ { EVNT_FSET, "freq_set" },
+ { EVNT_SPIK, "spike_detect" },
+ { EVNT_FREQ, "freq_mode" },
+ { EVNT_SYNC, "clock_sync" },
+ { EVNT_SYSRESTART, "restart" },
+ { EVNT_SYSFAULT, "panic_stop" },
+ { EVNT_NOPEER, "no_sys_peer" },
+ { EVNT_ARMED, "leap_armed" },
+ { EVNT_DISARMED, "leap_disarmed" },
+ { EVNT_LEAP, "leap_event" },
+ { EVNT_CLOCKRESET, "clock_step" },
+ { EVNT_KERN, "kern" },
+ { EVNT_TAI, "TAI" },
+ { EVNT_LEAPVAL, "stale_leapsecond_values" },
+ { -1, "" }
+};
+
+/*
+ * Peer events (peer)
+ */
+static const struct codestring peer_codes[] = {
+ { PEVNT_MOBIL & ~PEER_EVENT, "mobilize" },
+ { PEVNT_DEMOBIL & ~PEER_EVENT, "demobilize" },
+ { PEVNT_UNREACH & ~PEER_EVENT, "unreachable" },
+ { PEVNT_REACH & ~PEER_EVENT, "reachable" },
+ { PEVNT_RESTART & ~PEER_EVENT, "restart" },
+ { PEVNT_REPLY & ~PEER_EVENT, "no_reply" },
+ { PEVNT_RATE & ~PEER_EVENT, "rate_exceeded" },
+ { PEVNT_DENY & ~PEER_EVENT, "access_denied" },
+ { PEVNT_ARMED & ~PEER_EVENT, "leap_armed" },
+ { PEVNT_NEWPEER & ~PEER_EVENT, "sys_peer" },
+ { PEVNT_CLOCK & ~PEER_EVENT, "clock_event" },
+ { PEVNT_AUTH & ~PEER_EVENT, "bad_auth" },
+ { PEVNT_POPCORN & ~PEER_EVENT, "popcorn" },
+ { PEVNT_XLEAVE & ~PEER_EVENT, "interleave_mode" },
+ { PEVNT_XERR & ~PEER_EVENT, "interleave_error" },
+ { -1, "" }
+};
+
+/*
+ * Peer status bits
+ */
+static const struct codestring peer_st_bits[] = {
+ { CTL_PST_CONFIG, "conf" },
+ { CTL_PST_AUTHENABLE, "authenb" },
+ { CTL_PST_AUTHENTIC, "auth" },
+ { CTL_PST_REACH, "reach" },
+ { CTL_PST_BCAST, "bcast" },
+ /* not used with getcode(), no terminating entry needed */
+};
+
+/*
+ * Restriction match bits
+ */
+static const struct codestring res_match_bits[] = {
+ { RESM_NTPONLY, "ntpport" },
+ { RESM_INTERFACE, "interface" },
+ { RESM_SOURCE, "source" },
+ /* not used with getcode(), no terminating entry needed */
+};
+
+/*
+ * Restriction access bits
+ */
+static const struct codestring res_access_bits[] = {
+ { RES_IGNORE, "ignore" },
+ { RES_DONTSERVE, "noserve" },
+ { RES_DONTTRUST, "notrust" },
+ { RES_NOQUERY, "noquery" },
+ { RES_NOMODIFY, "nomodify" },
+ { RES_NOPEER, "nopeer" },
+ { RES_NOTRAP, "notrap" },
+ { RES_LPTRAP, "lptrap" },
+ { RES_LIMITED, "limited" },
+ { RES_VERSION, "version" },
+ { RES_KOD, "kod" },
+ { RES_FLAKE, "flake" },
+ /* not used with getcode(), no terminating entry needed */
+};
+
+#ifdef AUTOKEY
+/*
+ * Crypto events (cryp)
+ */
+static const struct codestring crypto_codes[] = {
+ { XEVNT_OK & ~CRPT_EVENT, "success" },
+ { XEVNT_LEN & ~CRPT_EVENT, "bad_field_format_or_length" },
+ { XEVNT_TSP & ~CRPT_EVENT, "bad_timestamp" },
+ { XEVNT_FSP & ~CRPT_EVENT, "bad_filestamp" },
+ { XEVNT_PUB & ~CRPT_EVENT, "bad_or_missing_public_key" },
+ { XEVNT_MD & ~CRPT_EVENT, "unsupported_digest_type" },
+ { XEVNT_KEY & ~CRPT_EVENT, "unsupported_identity_type" },
+ { XEVNT_SGL & ~CRPT_EVENT, "bad_signature_length" },
+ { XEVNT_SIG & ~CRPT_EVENT, "signature_not_verified" },
+ { XEVNT_VFY & ~CRPT_EVENT, "certificate_not_verified" },
+ { XEVNT_PER & ~CRPT_EVENT, "host_certificate_expired" },
+ { XEVNT_CKY & ~CRPT_EVENT, "bad_or_missing_cookie" },
+ { XEVNT_DAT & ~CRPT_EVENT, "bad_or_missing_leapseconds" },
+ { XEVNT_CRT & ~CRPT_EVENT, "bad_or_missing_certificate" },
+ { XEVNT_ID & ~CRPT_EVENT, "bad_or_missing_group key" },
+ { XEVNT_ERR & ~CRPT_EVENT, "protocol_error" },
+ { -1, "" }
+};
+#endif /* AUTOKEY */
+
+#ifdef KERNEL_PLL
+/*
+ * kernel discipline status bits
+ */
+static const struct codestring k_st_bits[] = {
+# ifdef STA_PLL
+ { STA_PLL, "pll" },
+# endif
+# ifdef STA_PPSFREQ
+ { STA_PPSFREQ, "ppsfreq" },
+# endif
+# ifdef STA_PPSTIME
+ { STA_PPSTIME, "ppstime" },
+# endif
+# ifdef STA_FLL
+ { STA_FLL, "fll" },
+# endif
+# ifdef STA_INS
+ { STA_INS, "ins" },
+# endif
+# ifdef STA_DEL
+ { STA_DEL, "del" },
+# endif
+# ifdef STA_UNSYNC
+ { STA_UNSYNC, "unsync" },
+# endif
+# ifdef STA_FREQHOLD
+ { STA_FREQHOLD, "freqhold" },
+# endif
+# ifdef STA_PPSSIGNAL
+ { STA_PPSSIGNAL, "ppssignal" },
+# endif
+# ifdef STA_PPSJITTER
+ { STA_PPSJITTER, "ppsjitter" },
+# endif
+# ifdef STA_PPSWANDER
+ { STA_PPSWANDER, "ppswander" },
+# endif
+# ifdef STA_PPSERROR
+ { STA_PPSERROR, "ppserror" },
+# endif
+# ifdef STA_CLOCKERR
+ { STA_CLOCKERR, "clockerr" },
+# endif
+# ifdef STA_NANO
+ { STA_NANO, "nano" },
+# endif
+# ifdef STA_MODE
+ { STA_MODE, "mode=fll" },
+# endif
+# ifdef STA_CLK
+ { STA_CLK, "src=B" },
+# endif
+ /* not used with getcode(), no terminating entry needed */
+};
+#endif /* KERNEL_PLL */
+
+/* Forwards */
+static const char * getcode(int, const struct codestring *);
+static const char * getevents(int);
+static const char * peer_st_flags(u_char pst);
+
+/*
+ * getcode - return string corresponding to code
+ */
+static const char *
+getcode(
+ int code,
+ const struct codestring * codetab
+ )
+{
+ char * buf;
+
+ while (codetab->code != -1) {
+ if (codetab->code == code)
+ return codetab->string;
+ codetab++;
+ }
+
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH, "%s_%d", codetab->string, code);
+
+ return buf;
+}
+
+/*
+ * getevents - return a descriptive string for the event count
+ */
+static const char *
+getevents(
+ int cnt
+ )
+{
+ char * buf;
+
+ if (cnt == 0)
+ return "no events";
+
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH, "%d event%s", cnt,
+ (1 == cnt)
+ ? ""
+ : "s");
+
+ return buf;
+}
+
+
+/*
+ * decode_bitflags()
+ *
+ * returns a human-readable string with a keyword from tab for each bit
+ * set in bits, separating multiple entries with text of sep2.
+ */
+static const char *
+decode_bitflags(
+ int bits,
+ const char * sep2,
+ const struct codestring * tab,
+ size_t tab_ct
+ )
+{
+ const char * sep;
+ char * buf;
+ char * pch;
+ char * lim;
+ size_t b;
+ int rc;
+ int saved_errno; /* for use in DPRINTF with %m */
+
+ saved_errno = errno;
+ LIB_GETBUF(buf);
+ pch = buf;
+ lim = buf + LIB_BUFLENGTH;
+ sep = "";
+
+ for (b = 0; b < tab_ct; b++) {
+ if (tab[b].code & bits) {
+ rc = snprintf(pch, (lim - pch), "%s%s", sep,
+ tab[b].string);
+ if (rc < 0)
+ goto toosmall;
+ pch += (u_int)rc;
+ if (pch >= lim)
+ goto toosmall;
+ sep = sep2;
+ }
+ }
+
+ return buf;
+
+ toosmall:
+ snprintf(buf, LIB_BUFLENGTH,
+ "decode_bitflags(%s) can't decode 0x%x in %d bytes",
+ (tab == peer_st_bits)
+ ? "peer_st"
+ :
+#ifdef KERNEL_PLL
+ (tab == k_st_bits)
+ ? "kern_st"
+ :
+#endif
+ "",
+ bits, (int)LIB_BUFLENGTH);
+ errno = saved_errno;
+
+ return buf;
+}
+
+
+static const char *
+peer_st_flags(
+ u_char pst
+ )
+{
+ return decode_bitflags(pst, ", ", peer_st_bits,
+ COUNTOF(peer_st_bits));
+}
+
+
+const char *
+res_match_flags(
+ u_short mf
+ )
+{
+ return decode_bitflags(mf, " ", res_match_bits,
+ COUNTOF(res_match_bits));
+}
+
+
+const char *
+res_access_flags(
+ u_short af
+ )
+{
+ return decode_bitflags(af, " ", res_access_bits,
+ COUNTOF(res_access_bits));
+}
+
+
+#ifdef KERNEL_PLL
+const char *
+k_st_flags(
+ u_int32 st
+ )
+{
+ return decode_bitflags(st, " ", k_st_bits, COUNTOF(k_st_bits));
+}
+#endif /* KERNEL_PLL */
+
+
+/*
+ * statustoa - return a descriptive string for a peer status
+ */
+char *
+statustoa(
+ int type,
+ int st
+ )
+{
+ char * cb;
+ char * cc;
+ u_char pst;
+
+ LIB_GETBUF(cb);
+
+ switch (type) {
+
+ case TYPE_SYS:
+ snprintf(cb, LIB_BUFLENGTH, "%s, %s, %s, %s",
+ getcode(CTL_SYS_LI(st), leap_codes),
+ getcode(CTL_SYS_SOURCE(st), sync_codes),
+ getevents(CTL_SYS_NEVNT(st)),
+ getcode(CTL_SYS_EVENT(st), sys_codes));
+ break;
+
+ case TYPE_PEER:
+ pst = (u_char)CTL_PEER_STATVAL(st);
+ snprintf(cb, LIB_BUFLENGTH, "%s, %s, %s",
+ peer_st_flags(pst),
+ getcode(pst & 0x7, select_codes),
+ getevents(CTL_PEER_NEVNT(st)));
+ if (CTL_PEER_EVENT(st) != EVNT_UNSPEC) {
+ cc = cb + strlen(cb);
+ snprintf(cc, LIB_BUFLENGTH - (cc - cb), ", %s",
+ getcode(CTL_PEER_EVENT(st),
+ peer_codes));
+ }
+ break;
+
+ case TYPE_CLOCK:
+ snprintf(cb, LIB_BUFLENGTH, "%s, %s",
+ getevents(CTL_SYS_NEVNT(st)),
+ getcode((st) & 0xf, clock_codes));
+ break;
+ }
+
+ return cb;
+}
+
+const char *
+eventstr(
+ int num
+ )
+{
+ if (num & PEER_EVENT)
+ return (getcode(num & ~PEER_EVENT, peer_codes));
+#ifdef AUTOKEY
+ else if (num & CRPT_EVENT)
+ return (getcode(num & ~CRPT_EVENT, crypto_codes));
+#endif /* AUTOKEY */
+ else
+ return (getcode(num, sys_codes));
+}
+
+const char *
+ceventstr(
+ int num
+ )
+{
+ return getcode(num, clock_codes);
+}
diff --git a/libntp/strdup.c b/libntp/strdup.c
new file mode 100644
index 0000000..f7565a2
--- /dev/null
+++ b/libntp/strdup.c
@@ -0,0 +1,30 @@
+#include <config.h>
+
+#include <string.h>
+#include "ntp_malloc.h"
+
+#ifndef HAVE_STRDUP
+
+char *strdup(const char *s);
+
+char *
+strdup(
+ const char *s
+ )
+{
+ size_t octets;
+ char * cp;
+
+ if (s) {
+ octets = 1 + strlen(s);
+ cp = malloc(octets);
+ if (NULL != cp)
+ memcpy(cp, s, octets);
+ else
+ cp = NULL;
+
+ return(cp);
+}
+#else
+int strdup_c_nonempty_compilation_unit;
+#endif
diff --git a/libntp/strl_obsd.c b/libntp/strl_obsd.c
new file mode 100644
index 0000000..cb8d4f3
--- /dev/null
+++ b/libntp/strl_obsd.c
@@ -0,0 +1,123 @@
+/*
+ * Why use strlcpy()/strlcat() instead of standard strncpy()/strncat()?
+ * To reduce likelihood of bugs and avoid wasteful zero fills. See:
+ * http://www.gratisoft.us/todd/papers/strlcpy.html
+ */
+
+/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <config.h> /* + marks local changes */
+#ifdef HAVE_SYS_TYPES_H /* + */
+#include <sys/types.h>
+#endif /* + */
+#include <string.h>
+
+#include "ntp_stdlib.h" /* + strlcpy, strlcat prototypes */
+
+#ifndef HAVE_STRLCPY /* + */
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+strlcpy(char *dst, const char *src, size_t siz)
+{
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0) {
+ while (--n != 0) {
+ if ((*d++ = *s++) == '\0')
+ break;
+ }
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0) {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return(s - src - 1); /* count does not include NUL */
+}
+#endif /* + */
+
+
+/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* #include <sys/types.h> */ /* + */
+/* #include <string.h> */ /* + */
+
+#ifndef HAVE_STRLCAT /* + */
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+strlcat(char *dst, const char *src, size_t siz)
+{
+ char *d = dst;
+ const char *s = src;
+ size_t n = siz;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
+
+ if (n == 0)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1) {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return(dlen + (s - src)); /* count does not include NUL */
+}
+#endif /* + */
diff --git a/libntp/syssignal.c b/libntp/syssignal.c
new file mode 100644
index 0000000..5e496a9
--- /dev/null
+++ b/libntp/syssignal.c
@@ -0,0 +1,188 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <signal.h>
+
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+
+static ctrl_c_fn ctrl_c_hook;
+#ifndef SYS_WINNT
+RETSIGTYPE sigint_handler(int);
+#else
+BOOL WINAPI console_event_handler(DWORD);
+#endif
+
+
+#ifdef HAVE_SIGACTION
+
+# ifdef SA_RESTART
+# define Z_SA_RESTART SA_RESTART
+# else
+# define Z_SA_RESTART 0
+# endif
+
+void
+signal_no_reset(
+ int sig,
+ void (*func)(int)
+ )
+{
+ int n;
+ struct sigaction vec;
+ struct sigaction ovec;
+
+ ZERO(vec);
+ sigemptyset(&vec.sa_mask);
+ vec.sa_handler = func;
+
+ /* Added for PPS clocks on Solaris 7 which get EINTR errors */
+# ifdef SIGPOLL
+ if (SIGPOLL == sig)
+ vec.sa_flags = Z_SA_RESTART;
+# endif
+# ifdef SIGIO
+ if (SIGIO == sig)
+ vec.sa_flags = Z_SA_RESTART;
+# endif
+
+ do
+ n = sigaction(sig, &vec, &ovec);
+ while (-1 == n && EINTR == errno);
+ if (-1 == n) {
+ perror("sigaction");
+ exit(1);
+ }
+}
+
+#elif HAVE_SIGVEC
+
+void
+signal_no_reset(
+ int sig,
+ RETSIGTYPE (*func)(int)
+ )
+{
+ struct sigvec sv;
+ int n;
+
+ ZERO(sv);
+ sv.sv_handler = func;
+ n = sigvec(sig, &sv, (struct sigvec *)NULL);
+ if (-1 == n) {
+ perror("sigvec");
+ exit(1);
+ }
+}
+
+#elif HAVE_SIGSET
+
+void
+signal_no_reset(
+ int sig,
+ RETSIGTYPE (*func)(int)
+ )
+{
+ int n;
+
+ n = sigset(sig, func);
+ if (-1 == n) {
+ perror("sigset");
+ exit(1);
+ }
+}
+
+#else
+
+/* Beware! This implementation resets the signal to SIG_DFL */
+void
+signal_no_reset(
+ int sig,
+ RETSIGTYPE (*func)(int)
+ )
+{
+#ifndef SIG_ERR
+# define SIG_ERR (-1)
+#endif
+ if (SIG_ERR == signal(sig, func)) {
+ perror("signal");
+ exit(1);
+ }
+}
+
+#endif
+
+#ifndef SYS_WINNT
+/*
+ * POSIX implementation of set_ctrl_c_hook()
+ */
+RETSIGTYPE
+sigint_handler(
+ int signum
+ )
+{
+ UNUSED_ARG(signum);
+ if (ctrl_c_hook != NULL)
+ (*ctrl_c_hook)();
+}
+
+void
+set_ctrl_c_hook(
+ ctrl_c_fn c_hook
+ )
+{
+ RETSIGTYPE (*handler)(int);
+
+ if (NULL == c_hook) {
+ handler = SIG_DFL;
+ ctrl_c_hook = NULL;
+ } else {
+ handler = &sigint_handler;
+ ctrl_c_hook = c_hook;
+ }
+ signal_no_reset(SIGINT, handler);
+}
+#else /* SYS_WINNT follows */
+/*
+ * Windows implementation of set_ctrl_c_hook()
+ */
+BOOL WINAPI
+console_event_handler(
+ DWORD dwCtrlType
+ )
+{
+ BOOL handled;
+
+ if (CTRL_C_EVENT == dwCtrlType && ctrl_c_hook != NULL) {
+ (*ctrl_c_hook)();
+ handled = TRUE;
+ } else {
+ handled = FALSE;
+ }
+
+ return handled;
+}
+void
+set_ctrl_c_hook(
+ ctrl_c_fn c_hook
+ )
+{
+ BOOL install;
+
+ if (NULL == c_hook) {
+ ctrl_c_hook = NULL;
+ install = FALSE;
+ } else {
+ ctrl_c_hook = c_hook;
+ install = TRUE;
+ }
+ if (!SetConsoleCtrlHandler(&console_event_handler, install))
+ msyslog(LOG_ERR, "Can't %s console control handler: %m",
+ (install)
+ ? "add"
+ : "remove");
+}
+#endif /* SYS_WINNT */
diff --git a/libntp/systime.c b/libntp/systime.c
new file mode 100644
index 0000000..f5eabcd
--- /dev/null
+++ b/libntp/systime.c
@@ -0,0 +1,570 @@
+/*
+ * systime -- routines to fiddle a UNIX clock.
+ *
+ * ATTENTION: Get approval from Dave Mills on all changes to this file!
+ *
+ */
+#include <config.h>
+
+#include "ntp.h"
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+#include "ntp_random.h"
+#include "iosignal.h"
+#include "timevalops.h"
+#include "timespecops.h"
+#include "ntp_calendar.h"
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#ifdef HAVE_UTMP_H
+# include <utmp.h>
+#endif /* HAVE_UTMP_H */
+#ifdef HAVE_UTMPX_H
+# include <utmpx.h>
+#endif /* HAVE_UTMPX_H */
+
+
+#ifndef USE_COMPILETIME_PIVOT
+# define USE_COMPILETIME_PIVOT 1
+#endif
+
+/*
+ * These routines (get_systime, step_systime, adj_systime) implement an
+ * interface between the system independent NTP clock and the Unix
+ * system clock in various architectures and operating systems. Time is
+ * a precious quantity in these routines and every effort is made to
+ * minimize errors by unbiased rounding and amortizing adjustment
+ * residues.
+ *
+ * In order to improve the apparent resolution, provide unbiased
+ * rounding and most importantly ensure that the readings cannot be
+ * predicted, the low-order unused portion of the time below the minimum
+ * time to read the clock is filled with an unbiased random fuzz.
+ *
+ * The sys_tick variable specifies the system clock tick interval in
+ * seconds, for stepping clocks, defined as those which return times
+ * less than MINSTEP greater than the previous reading. For systems that
+ * use a high-resolution counter such that each clock reading is always
+ * at least MINSTEP greater than the prior, sys_tick is the time to read
+ * the system clock.
+ *
+ * The sys_fuzz variable measures the minimum time to read the system
+ * clock, regardless of its precision. When reading the system clock
+ * using get_systime() after sys_tick and sys_fuzz have been determined,
+ * ntpd ensures each unprocessed clock reading is no less than sys_fuzz
+ * later than the prior unprocessed reading, and then fuzzes the bits
+ * below sys_fuzz in the timestamp returned, ensuring each of its
+ * resulting readings is strictly later than the previous.
+ *
+ * When slewing the system clock using adj_systime() (with the kernel
+ * loop discipline unavailable or disabled), adjtime() offsets are
+ * quantized to sys_tick, if sys_tick is greater than sys_fuzz, which
+ * is to say if the OS presents a stepping clock. Otherwise, offsets
+ * are quantized to the microsecond resolution of adjtime()'s timeval
+ * input. The remaining correction sys_residual is carried into the
+ * next adjtime() and meanwhile is also factored into get_systime()
+ * readings.
+ */
+double sys_tick = 0; /* tick size or time to read (s) */
+double sys_fuzz = 0; /* min. time to read the clock (s) */
+long sys_fuzz_nsec = 0; /* min. time to read the clock (ns) */
+double measured_tick; /* non-overridable sys_tick (s) */
+double sys_residual = 0; /* adjustment residue (s) */
+int trunc_os_clock; /* sys_tick > measured_tick */
+time_stepped_callback step_callback;
+
+#ifndef SIM
+/* perlinger@ntp.org: As 'get_sysime()' does it's own check for clock
+ * backstepping, this could probably become a local variable in
+ * 'get_systime()' and the cruft associated with communicating via a
+ * static value could be removed after the v4.2.8 release.
+ */
+static int lamport_violated; /* clock was stepped back */
+#endif /* !SIM */
+
+#ifdef DEBUG
+static int systime_init_done;
+# define DONE_SYSTIME_INIT() systime_init_done = TRUE
+#else
+# define DONE_SYSTIME_INIT() do {} while (FALSE)
+#endif
+
+#ifdef HAVE_SIGNALED_IO
+int using_sigio;
+#endif
+
+#ifdef SYS_WINNT
+CRITICAL_SECTION get_systime_cs;
+#endif
+
+
+void
+set_sys_fuzz(
+ double fuzz_val
+ )
+{
+ sys_fuzz = fuzz_val;
+ INSIST(sys_fuzz >= 0);
+ INSIST(sys_fuzz <= 1.0);
+ sys_fuzz_nsec = (long)(sys_fuzz * 1e9 + 0.5);
+}
+
+
+void
+init_systime(void)
+{
+ INIT_GET_SYSTIME_CRITSEC();
+ INIT_WIN_PRECISE_TIME();
+ DONE_SYSTIME_INIT();
+}
+
+
+#ifndef SIM /* ntpsim.c has get_systime() and friends for sim */
+
+static inline void
+get_ostime(
+ struct timespec * tsp
+ )
+{
+ int rc;
+ long ticks;
+
+#if defined(HAVE_CLOCK_GETTIME)
+ rc = clock_gettime(CLOCK_REALTIME, tsp);
+#elif defined(HAVE_GETCLOCK)
+ rc = getclock(TIMEOFDAY, tsp);
+#else
+ struct timeval tv;
+
+ rc = GETTIMEOFDAY(&tv, NULL);
+ tsp->tv_sec = tv.tv_sec;
+ tsp->tv_nsec = tv.tv_usec * 1000;
+#endif
+ if (rc < 0) {
+ msyslog(LOG_ERR, "read system clock failed: %m (%d)",
+ errno);
+ exit(1);
+ }
+
+ if (trunc_os_clock) {
+ ticks = (long)((tsp->tv_nsec * 1e-9) / sys_tick);
+ tsp->tv_nsec = (long)(ticks * 1e9 * sys_tick);
+ }
+}
+
+
+/*
+ * get_systime - return system time in NTP timestamp format.
+ */
+void
+get_systime(
+ l_fp *now /* system time */
+ )
+{
+ static struct timespec ts_last; /* last sampled os time */
+ static struct timespec ts_prev; /* prior os time */
+ static l_fp lfp_prev; /* prior result */
+ static double dfuzz_prev; /* prior fuzz */
+ struct timespec ts; /* seconds and nanoseconds */
+ struct timespec ts_min; /* earliest permissible */
+ struct timespec ts_lam; /* lamport fictional increment */
+ struct timespec ts_prev_log; /* for msyslog only */
+ double dfuzz;
+ double ddelta;
+ l_fp result;
+ l_fp lfpfuzz;
+ l_fp lfpdelta;
+
+ get_ostime(&ts);
+ DEBUG_REQUIRE(systime_init_done);
+ ENTER_GET_SYSTIME_CRITSEC();
+
+ /* First check if here was a Lamport violation, that is, two
+ * successive calls to 'get_ostime()' resulted in negative
+ * time difference. Use a few milliseconds of permissible
+ * tolerance -- being too sharp can hurt here. (This is intented
+ * for the Win32 target, where the HPC interpolation might
+ * introduce small steps backward. It should not be an issue on
+ * systems where get_ostime() results in a true syscall.)
+ */
+ if (cmp_tspec(add_tspec_ns(ts, 50000000), ts_last) < 0)
+ lamport_violated = 1;
+ ts_last = ts;
+
+ /*
+ * After default_get_precision() has set a nonzero sys_fuzz,
+ * ensure every reading of the OS clock advances by at least
+ * sys_fuzz over the prior reading, thereby assuring each
+ * fuzzed result is strictly later than the prior. Limit the
+ * necessary fiction to 1 second.
+ */
+ if (!USING_SIGIO()) {
+ ts_min = add_tspec_ns(ts_prev, sys_fuzz_nsec);
+ if (cmp_tspec(ts, ts_min) < 0) {
+ ts_lam = sub_tspec(ts_min, ts);
+ if (ts_lam.tv_sec > 0 && !lamport_violated) {
+ msyslog(LOG_ERR,
+ "get_systime Lamport advance exceeds one second (%.9f)",
+ ts_lam.tv_sec +
+ 1e-9 * ts_lam.tv_nsec);
+ exit(1);
+ }
+ if (!lamport_violated)
+ ts = ts_min;
+ }
+ ts_prev_log = ts_prev;
+ ts_prev = ts;
+ } else {
+ /*
+ * Quiet "ts_prev_log.tv_sec may be used uninitialized"
+ * warning from x86 gcc 4.5.2.
+ */
+ ZERO(ts_prev_log);
+ }
+
+ /* convert from timespec to l_fp fixed-point */
+ result = tspec_stamp_to_lfp(ts);
+
+ /*
+ * Add in the fuzz.
+ */
+ dfuzz = ntp_random() * 2. / FRAC * sys_fuzz;
+ DTOLFP(dfuzz, &lfpfuzz);
+ L_ADD(&result, &lfpfuzz);
+
+ /*
+ * Ensure result is strictly greater than prior result (ignoring
+ * sys_residual's effect for now) once sys_fuzz has been
+ * determined.
+ */
+ if (!USING_SIGIO()) {
+ if (!L_ISZERO(&lfp_prev) && !lamport_violated) {
+ if (!L_ISGTU(&result, &lfp_prev) &&
+ sys_fuzz > 0.) {
+ msyslog(LOG_ERR, "ts_prev %s ts_min %s",
+ tspectoa(ts_prev_log),
+ tspectoa(ts_min));
+ msyslog(LOG_ERR, "ts %s", tspectoa(ts));
+ msyslog(LOG_ERR, "sys_fuzz %ld nsec, prior fuzz %.9f",
+ sys_fuzz_nsec, dfuzz_prev);
+ msyslog(LOG_ERR, "this fuzz %.9f",
+ dfuzz);
+ lfpdelta = lfp_prev;
+ L_SUB(&lfpdelta, &result);
+ LFPTOD(&lfpdelta, ddelta);
+ msyslog(LOG_ERR,
+ "prev get_systime 0x%x.%08x is %.9f later than 0x%x.%08x",
+ lfp_prev.l_ui, lfp_prev.l_uf,
+ ddelta, result.l_ui, result.l_uf);
+ }
+ }
+ lfp_prev = result;
+ dfuzz_prev = dfuzz;
+ if (lamport_violated)
+ lamport_violated = FALSE;
+ }
+ LEAVE_GET_SYSTIME_CRITSEC();
+ *now = result;
+}
+
+
+/*
+ * adj_systime - adjust system time by the argument.
+ */
+#if !defined SYS_WINNT
+int /* 0 okay, 1 error */
+adj_systime(
+ double now /* adjustment (s) */
+ )
+{
+ struct timeval adjtv; /* new adjustment */
+ struct timeval oadjtv; /* residual adjustment */
+ double quant; /* quantize to multiples of */
+ double dtemp;
+ long ticks;
+ int isneg = 0;
+
+ /*
+ * The Windows port adj_systime() depends on being called each
+ * second even when there's no additional correction, to allow
+ * emulation of adjtime() behavior on top of an API that simply
+ * sets the current rate. This POSIX implementation needs to
+ * ignore invocations with zero correction, otherwise ongoing
+ * EVNT_NSET adjtime() can be aborted by a tiny adjtime()
+ * triggered by sys_residual.
+ */
+ if (0. == now)
+ return TRUE;
+
+ /*
+ * Most Unix adjtime() implementations adjust the system clock
+ * in microsecond quanta, but some adjust in 10-ms quanta. We
+ * carefully round the adjustment to the nearest quantum, then
+ * adjust in quanta and keep the residue for later.
+ */
+ dtemp = now + sys_residual;
+ if (dtemp < 0) {
+ isneg = 1;
+ dtemp = -dtemp;
+ }
+ adjtv.tv_sec = (long)dtemp;
+ dtemp -= adjtv.tv_sec;
+ if (sys_tick > sys_fuzz)
+ quant = sys_tick;
+ else
+ quant = 1e-6;
+ ticks = (long)(dtemp / quant + .5);
+ adjtv.tv_usec = (long)(ticks * quant * 1e6);
+ dtemp -= adjtv.tv_usec / 1e6;
+ sys_residual = dtemp;
+
+ /*
+ * Convert to signed seconds and microseconds for the Unix
+ * adjtime() system call. Note we purposely lose the adjtime()
+ * leftover.
+ */
+ if (isneg) {
+ adjtv.tv_sec = -adjtv.tv_sec;
+ adjtv.tv_usec = -adjtv.tv_usec;
+ sys_residual = -sys_residual;
+ }
+ if (adjtv.tv_sec != 0 || adjtv.tv_usec != 0) {
+ if (adjtime(&adjtv, &oadjtv) < 0) {
+ msyslog(LOG_ERR, "adj_systime: %m");
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+#endif
+
+
+/*
+ * step_systime - step the system clock.
+ */
+
+int
+step_systime(
+ double step
+ )
+{
+ time_t pivot; /* for ntp era unfolding */
+ struct timeval timetv, tvlast, tvdiff;
+ struct timespec timets;
+ struct calendar jd;
+ l_fp fp_ofs, fp_sys; /* offset and target system time in FP */
+
+ /*
+ * Get pivot time for NTP era unfolding. Since we don't step
+ * very often, we can afford to do the whole calculation from
+ * scratch. And we're not in the time-critical path yet.
+ */
+#if SIZEOF_TIME_T > 4
+ /*
+ * This code makes sure the resulting time stamp for the new
+ * system time is in the 2^32 seconds starting at 1970-01-01,
+ * 00:00:00 UTC.
+ */
+ pivot = 0x80000000;
+#if USE_COMPILETIME_PIVOT
+ /*
+ * Add the compile time minus 10 years to get a possible target
+ * area of (compile time - 10 years) to (compile time + 126
+ * years). This should be sufficient for a given binary of
+ * NTPD.
+ */
+ if (ntpcal_get_build_date(&jd)) {
+ jd.year -= 10;
+ pivot += ntpcal_date_to_time(&jd);
+ } else {
+ msyslog(LOG_ERR,
+ "step-systime: assume 1970-01-01 as build date");
+ }
+#else
+ UNUSED_LOCAL(jd);
+#endif /* USE_COMPILETIME_PIVOT */
+#else
+ UNUSED_LOCAL(jd);
+ /* This makes sure the resulting time stamp is on or after
+ * 1969-12-31/23:59:59 UTC and gives us additional two years,
+ * from the change of NTP era in 2036 to the UNIX rollover in
+ * 2038. (Minus one second, but that won't hurt.) We *really*
+ * need a longer 'time_t' after that! Or a different baseline,
+ * but that would cause other serious trouble, too.
+ */
+ pivot = 0x7FFFFFFF;
+#endif
+
+ /* get the complete jump distance as l_fp */
+ DTOLFP(sys_residual, &fp_sys);
+ DTOLFP(step, &fp_ofs);
+ L_ADD(&fp_ofs, &fp_sys);
+
+ /* ---> time-critical path starts ---> */
+
+ /* get the current time as l_fp (without fuzz) and as struct timeval */
+ get_ostime(&timets);
+ fp_sys = tspec_stamp_to_lfp(timets);
+ tvlast.tv_sec = timets.tv_sec;
+ tvlast.tv_usec = (timets.tv_nsec + 500) / 1000;
+
+ /* get the target time as l_fp */
+ L_ADD(&fp_sys, &fp_ofs);
+
+ /* unfold the new system time */
+ timetv = lfp_stamp_to_tval(fp_sys, &pivot);
+
+ /* now set new system time */
+ if (ntp_set_tod(&timetv, NULL) != 0) {
+ msyslog(LOG_ERR, "step-systime: %m");
+ return FALSE;
+ }
+
+ /* <--- time-critical path ended with 'ntp_set_tod()' <--- */
+
+ sys_residual = 0;
+ lamport_violated = (step < 0);
+ if (step_callback)
+ (*step_callback)();
+
+#ifdef NEED_HPUX_ADJTIME
+ /*
+ * CHECKME: is this correct when called by ntpdate?????
+ */
+ _clear_adjtime();
+#endif
+
+ /*
+ * FreeBSD, for example, has:
+ * struct utmp {
+ * char ut_line[UT_LINESIZE];
+ * char ut_name[UT_NAMESIZE];
+ * char ut_host[UT_HOSTSIZE];
+ * long ut_time;
+ * };
+ * and appends line="|", name="date", host="", time for the OLD
+ * and appends line="{", name="date", host="", time for the NEW
+ * to _PATH_WTMP .
+ *
+ * Some OSes have utmp, some have utmpx.
+ */
+
+ /*
+ * Write old and new time entries in utmp and wtmp if step
+ * adjustment is greater than one second.
+ *
+ * This might become even Uglier...
+ */
+ tvdiff = abs_tval(sub_tval(timetv, tvlast));
+ if (tvdiff.tv_sec > 0) {
+#ifdef HAVE_UTMP_H
+ struct utmp ut;
+#endif
+#ifdef HAVE_UTMPX_H
+ struct utmpx utx;
+#endif
+
+#ifdef HAVE_UTMP_H
+ ZERO(ut);
+#endif
+#ifdef HAVE_UTMPX_H
+ ZERO(utx);
+#endif
+
+ /* UTMP */
+
+#ifdef UPDATE_UTMP
+# ifdef HAVE_PUTUTLINE
+# ifndef _PATH_UTMP
+# define _PATH_UTMP UTMP_FILE
+# endif
+ utmpname(_PATH_UTMP);
+ ut.ut_type = OLD_TIME;
+ strlcpy(ut.ut_line, OTIME_MSG, sizeof(ut.ut_line));
+ ut.ut_time = tvlast.tv_sec;
+ setutent();
+ pututline(&ut);
+ ut.ut_type = NEW_TIME;
+ strlcpy(ut.ut_line, NTIME_MSG, sizeof(ut.ut_line));
+ ut.ut_time = timetv.tv_sec;
+ setutent();
+ pututline(&ut);
+ endutent();
+# else /* not HAVE_PUTUTLINE */
+# endif /* not HAVE_PUTUTLINE */
+#endif /* UPDATE_UTMP */
+
+ /* UTMPX */
+
+#ifdef UPDATE_UTMPX
+# ifdef HAVE_PUTUTXLINE
+ utx.ut_type = OLD_TIME;
+ strlcpy(utx.ut_line, OTIME_MSG, sizeof(utx.ut_line));
+ utx.ut_tv = tvlast;
+ setutxent();
+ pututxline(&utx);
+ utx.ut_type = NEW_TIME;
+ strlcpy(utx.ut_line, NTIME_MSG, sizeof(utx.ut_line));
+ utx.ut_tv = timetv;
+ setutxent();
+ pututxline(&utx);
+ endutxent();
+# else /* not HAVE_PUTUTXLINE */
+# endif /* not HAVE_PUTUTXLINE */
+#endif /* UPDATE_UTMPX */
+
+ /* WTMP */
+
+#ifdef UPDATE_WTMP
+# ifdef HAVE_PUTUTLINE
+# ifndef _PATH_WTMP
+# define _PATH_WTMP WTMP_FILE
+# endif
+ utmpname(_PATH_WTMP);
+ ut.ut_type = OLD_TIME;
+ strlcpy(ut.ut_line, OTIME_MSG, sizeof(ut.ut_line));
+ ut.ut_time = tvlast.tv_sec;
+ setutent();
+ pututline(&ut);
+ ut.ut_type = NEW_TIME;
+ strlcpy(ut.ut_line, NTIME_MSG, sizeof(ut.ut_line));
+ ut.ut_time = timetv.tv_sec;
+ setutent();
+ pututline(&ut);
+ endutent();
+# else /* not HAVE_PUTUTLINE */
+# endif /* not HAVE_PUTUTLINE */
+#endif /* UPDATE_WTMP */
+
+ /* WTMPX */
+
+#ifdef UPDATE_WTMPX
+# ifdef HAVE_PUTUTXLINE
+ utx.ut_type = OLD_TIME;
+ utx.ut_tv = tvlast;
+ strlcpy(utx.ut_line, OTIME_MSG, sizeof(utx.ut_line));
+# ifdef HAVE_UPDWTMPX
+ updwtmpx(WTMPX_FILE, &utx);
+# else /* not HAVE_UPDWTMPX */
+# endif /* not HAVE_UPDWTMPX */
+# else /* not HAVE_PUTUTXLINE */
+# endif /* not HAVE_PUTUTXLINE */
+# ifdef HAVE_PUTUTXLINE
+ utx.ut_type = NEW_TIME;
+ utx.ut_tv = timetv;
+ strlcpy(utx.ut_line, NTIME_MSG, sizeof(utx.ut_line));
+# ifdef HAVE_UPDWTMPX
+ updwtmpx(WTMPX_FILE, &utx);
+# else /* not HAVE_UPDWTMPX */
+# endif /* not HAVE_UPDWTMPX */
+# else /* not HAVE_PUTUTXLINE */
+# endif /* not HAVE_PUTUTXLINE */
+#endif /* UPDATE_WTMPX */
+
+ }
+ return TRUE;
+}
+
+#endif /* !SIM */
diff --git a/libntp/systime_s.c b/libntp/systime_s.c
new file mode 100644
index 0000000..8762122
--- /dev/null
+++ b/libntp/systime_s.c
@@ -0,0 +1,2 @@
+#define SIM
+#include "systime.c"
diff --git a/libntp/timetoa.c b/libntp/timetoa.c
new file mode 100644
index 0000000..c04d34e
--- /dev/null
+++ b/libntp/timetoa.c
@@ -0,0 +1,109 @@
+/*
+ * timetoa.c -- time_t related string formatting
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ *
+ * Printing a 'time_t' has a lot of portability pitfalls, due to it's
+ * opaque base type. The only requirement imposed by the standard is
+ * that it must be a numeric type. For all practical purposes it's a
+ * signed int, and 32 bits are common.
+ *
+ * Since the UN*X time epoch will cause a signed integer overflow for
+ * 32-bit signed int in the year 2038, implementations slowly move to
+ * 64bit base types for time_t, even in 32-bit environments.
+ *
+ * As the printf() family has no standardised type specifier for time_t,
+ * guessing the right output format specifier is a bit troublesome and
+ * best done with the help of the preprocessor and "config.h".
+ */
+
+#include "config.h"
+
+#include <math.h>
+#include <stdio.h>
+
+#include "timetoa.h"
+#include "ntp_assert.h"
+#include "lib_strbuf.h"
+
+/*
+ * Formatting to string needs at max 40 bytes (even with 64 bit time_t),
+ * so we check LIB_BUFLENGTH is big enough for our purpose.
+ */
+#if LIB_BUFLENGTH < 40
+# include "GRONK: LIB_BUFLENGTH is not sufficient"
+#endif
+
+/*
+ * general fractional timestamp formatting
+ *
+ * Many pieces of ntpd require a machine with two's complement
+ * representation of signed integers, so we don't go through the whole
+ * rigamarole of creating fully portable code here. But we have to stay
+ * away from signed integer overflow, as this might cause trouble even
+ * with two's complement representation.
+ */
+const char *
+format_time_fraction(
+ time_t secs,
+ long frac,
+ int prec
+ )
+{
+ char * cp;
+ u_int prec_u;
+ u_time secs_u;
+ u_int u;
+ long fraclimit;
+ int notneg; /* flag for non-negative value */
+ const char * fmt;
+ ldiv_t qr;
+
+ DEBUG_REQUIRE(prec != 0);
+
+ LIB_GETBUF(cp);
+ secs_u = (u_time)secs;
+ fmt = "-%" UTIME_FORMAT ".%0*ld";
+
+ /* check if we need signed or unsigned mode */
+ notneg = (prec < 0);
+ prec_u = abs(prec);
+ /* fraclimit = (long)pow(10, prec_u); */
+ for (fraclimit = 10, u = 1; u < prec_u; u++) {
+ DEBUG_INSIST(fraclimit < fraclimit * 10);
+ fraclimit *= 10;
+ }
+
+ /*
+ * Since conversion to string uses lots of divisions anyway,
+ * there's no big extra penalty for normalisation. We do it for
+ * consistency.
+ */
+ if (frac < 0 || frac >= fraclimit) {
+ qr = ldiv(frac, fraclimit);
+ if (qr.rem < 0) {
+ qr.quot--;
+ qr.rem += fraclimit;
+ }
+ secs_u += (time_t)qr.quot;
+ frac = qr.rem;
+ }
+
+ /* Get the absolute value of the split representation time. */
+ notneg = notneg || ((time_t)secs_u >= 0);
+ if (notneg) {
+ fmt++; /* skip '-' */
+ } else {
+ secs_u = ~secs_u;
+ if (0 == frac)
+ secs_u++;
+ else
+ frac = fraclimit - frac;
+ }
+
+ /* finally format the data and return the result */
+ snprintf(cp, LIB_BUFLENGTH, fmt, secs_u, prec_u, frac);
+
+ return cp;
+}
diff --git a/libntp/timevalops.c b/libntp/timevalops.c
new file mode 100644
index 0000000..55f7bb5
--- /dev/null
+++ b/libntp/timevalops.c
@@ -0,0 +1,297 @@
+/*
+ * timevalops.c -- calculations on 'struct timeval' values
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ */
+
+#include <config.h>
+
+#include "timevalops.h"
+
+#ifdef USE_TSF_USEC_TABLES
+/*
+ * Tables to calculate time stamp fractions from usecs. The entries
+ * in these tables are offset into using each of the two low order
+ * bytes plus the next 4 bits in a usec value (from a struct timeval).
+ * These are summed to produce the time stamp fraction.
+ *
+ * Note that these tables are rounded (not truncated) to the nearest
+ * low order bit in the fraction. The timestamp computed should be
+ * +- 1.5 low order bits.
+ */
+
+const u_int32 ustotslo[256] = {
+ 0x00000000, 0x000010c7, 0x0000218e, 0x00003255,
+ 0x0000431c, 0x000053e3, 0x000064aa, 0x00007571,
+ 0x00008638, 0x000096ff, 0x0000a7c6, 0x0000b88d,
+ 0x0000c954, 0x0000da1b, 0x0000eae2, 0x0000fba9,
+ 0x00010c6f, 0x00011d36, 0x00012dfd, 0x00013ec4,
+ 0x00014f8b, 0x00016052, 0x00017119, 0x000181e0,
+ 0x000192a7, 0x0001a36e, 0x0001b435, 0x0001c4fc,
+ 0x0001d5c3, 0x0001e68a, 0x0001f751, 0x00020818,
+ 0x000218df, 0x000229a6, 0x00023a6d, 0x00024b34,
+ 0x00025bfb, 0x00026cc2, 0x00027d89, 0x00028e50,
+ 0x00029f17, 0x0002afde, 0x0002c0a5, 0x0002d16c,
+ 0x0002e233, 0x0002f2fa, 0x000303c0, 0x00031487,
+ 0x0003254e, 0x00033615, 0x000346dc, 0x000357a3,
+ 0x0003686a, 0x00037931, 0x000389f8, 0x00039abf,
+ 0x0003ab86, 0x0003bc4d, 0x0003cd14, 0x0003dddb,
+ 0x0003eea2, 0x0003ff69, 0x00041030, 0x000420f7,
+ 0x000431be, 0x00044285, 0x0004534c, 0x00046413,
+ 0x000474da, 0x000485a1, 0x00049668, 0x0004a72f,
+ 0x0004b7f6, 0x0004c8bd, 0x0004d984, 0x0004ea4b,
+ 0x0004fb12, 0x00050bd8, 0x00051c9f, 0x00052d66,
+ 0x00053e2d, 0x00054ef4, 0x00055fbb, 0x00057082,
+ 0x00058149, 0x00059210, 0x0005a2d7, 0x0005b39e,
+ 0x0005c465, 0x0005d52c, 0x0005e5f3, 0x0005f6ba,
+ 0x00060781, 0x00061848, 0x0006290f, 0x000639d6,
+ 0x00064a9d, 0x00065b64, 0x00066c2b, 0x00067cf2,
+ 0x00068db9, 0x00069e80, 0x0006af47, 0x0006c00e,
+ 0x0006d0d5, 0x0006e19c, 0x0006f263, 0x0007032a,
+ 0x000713f0, 0x000724b7, 0x0007357e, 0x00074645,
+ 0x0007570c, 0x000767d3, 0x0007789a, 0x00078961,
+ 0x00079a28, 0x0007aaef, 0x0007bbb6, 0x0007cc7d,
+ 0x0007dd44, 0x0007ee0b, 0x0007fed2, 0x00080f99,
+ 0x00082060, 0x00083127, 0x000841ee, 0x000852b5,
+ 0x0008637c, 0x00087443, 0x0008850a, 0x000895d1,
+ 0x0008a698, 0x0008b75f, 0x0008c826, 0x0008d8ed,
+ 0x0008e9b4, 0x0008fa7b, 0x00090b41, 0x00091c08,
+ 0x00092ccf, 0x00093d96, 0x00094e5d, 0x00095f24,
+ 0x00096feb, 0x000980b2, 0x00099179, 0x0009a240,
+ 0x0009b307, 0x0009c3ce, 0x0009d495, 0x0009e55c,
+ 0x0009f623, 0x000a06ea, 0x000a17b1, 0x000a2878,
+ 0x000a393f, 0x000a4a06, 0x000a5acd, 0x000a6b94,
+ 0x000a7c5b, 0x000a8d22, 0x000a9de9, 0x000aaeb0,
+ 0x000abf77, 0x000ad03e, 0x000ae105, 0x000af1cc,
+ 0x000b0293, 0x000b1359, 0x000b2420, 0x000b34e7,
+ 0x000b45ae, 0x000b5675, 0x000b673c, 0x000b7803,
+ 0x000b88ca, 0x000b9991, 0x000baa58, 0x000bbb1f,
+ 0x000bcbe6, 0x000bdcad, 0x000bed74, 0x000bfe3b,
+ 0x000c0f02, 0x000c1fc9, 0x000c3090, 0x000c4157,
+ 0x000c521e, 0x000c62e5, 0x000c73ac, 0x000c8473,
+ 0x000c953a, 0x000ca601, 0x000cb6c8, 0x000cc78f,
+ 0x000cd856, 0x000ce91d, 0x000cf9e4, 0x000d0aaa,
+ 0x000d1b71, 0x000d2c38, 0x000d3cff, 0x000d4dc6,
+ 0x000d5e8d, 0x000d6f54, 0x000d801b, 0x000d90e2,
+ 0x000da1a9, 0x000db270, 0x000dc337, 0x000dd3fe,
+ 0x000de4c5, 0x000df58c, 0x000e0653, 0x000e171a,
+ 0x000e27e1, 0x000e38a8, 0x000e496f, 0x000e5a36,
+ 0x000e6afd, 0x000e7bc4, 0x000e8c8b, 0x000e9d52,
+ 0x000eae19, 0x000ebee0, 0x000ecfa7, 0x000ee06e,
+ 0x000ef135, 0x000f01fc, 0x000f12c2, 0x000f2389,
+ 0x000f3450, 0x000f4517, 0x000f55de, 0x000f66a5,
+ 0x000f776c, 0x000f8833, 0x000f98fa, 0x000fa9c1,
+ 0x000fba88, 0x000fcb4f, 0x000fdc16, 0x000fecdd,
+ 0x000ffda4, 0x00100e6b, 0x00101f32, 0x00102ff9,
+ 0x001040c0, 0x00105187, 0x0010624e, 0x00107315,
+ 0x001083dc, 0x001094a3, 0x0010a56a, 0x0010b631
+};
+
+const u_int32 ustotsmid[256] = {
+ 0x00000000, 0x0010c6f8, 0x00218def, 0x003254e7,
+ 0x00431bdf, 0x0053e2d6, 0x0064a9ce, 0x007570c5,
+ 0x008637bd, 0x0096feb5, 0x00a7c5ac, 0x00b88ca4,
+ 0x00c9539c, 0x00da1a93, 0x00eae18b, 0x00fba882,
+ 0x010c6f7a, 0x011d3672, 0x012dfd69, 0x013ec461,
+ 0x014f8b59, 0x01605250, 0x01711948, 0x0181e03f,
+ 0x0192a737, 0x01a36e2f, 0x01b43526, 0x01c4fc1e,
+ 0x01d5c316, 0x01e68a0d, 0x01f75105, 0x020817fc,
+ 0x0218def4, 0x0229a5ec, 0x023a6ce3, 0x024b33db,
+ 0x025bfad3, 0x026cc1ca, 0x027d88c2, 0x028e4fb9,
+ 0x029f16b1, 0x02afdda9, 0x02c0a4a0, 0x02d16b98,
+ 0x02e23290, 0x02f2f987, 0x0303c07f, 0x03148777,
+ 0x03254e6e, 0x03361566, 0x0346dc5d, 0x0357a355,
+ 0x03686a4d, 0x03793144, 0x0389f83c, 0x039abf34,
+ 0x03ab862b, 0x03bc4d23, 0x03cd141a, 0x03dddb12,
+ 0x03eea20a, 0x03ff6901, 0x04102ff9, 0x0420f6f1,
+ 0x0431bde8, 0x044284e0, 0x04534bd7, 0x046412cf,
+ 0x0474d9c7, 0x0485a0be, 0x049667b6, 0x04a72eae,
+ 0x04b7f5a5, 0x04c8bc9d, 0x04d98394, 0x04ea4a8c,
+ 0x04fb1184, 0x050bd87b, 0x051c9f73, 0x052d666b,
+ 0x053e2d62, 0x054ef45a, 0x055fbb51, 0x05708249,
+ 0x05814941, 0x05921038, 0x05a2d730, 0x05b39e28,
+ 0x05c4651f, 0x05d52c17, 0x05e5f30e, 0x05f6ba06,
+ 0x060780fe, 0x061847f5, 0x06290eed, 0x0639d5e5,
+ 0x064a9cdc, 0x065b63d4, 0x066c2acc, 0x067cf1c3,
+ 0x068db8bb, 0x069e7fb2, 0x06af46aa, 0x06c00da2,
+ 0x06d0d499, 0x06e19b91, 0x06f26289, 0x07032980,
+ 0x0713f078, 0x0724b76f, 0x07357e67, 0x0746455f,
+ 0x07570c56, 0x0767d34e, 0x07789a46, 0x0789613d,
+ 0x079a2835, 0x07aaef2c, 0x07bbb624, 0x07cc7d1c,
+ 0x07dd4413, 0x07ee0b0b, 0x07fed203, 0x080f98fa,
+ 0x08205ff2, 0x083126e9, 0x0841ede1, 0x0852b4d9,
+ 0x08637bd0, 0x087442c8, 0x088509c0, 0x0895d0b7,
+ 0x08a697af, 0x08b75ea6, 0x08c8259e, 0x08d8ec96,
+ 0x08e9b38d, 0x08fa7a85, 0x090b417d, 0x091c0874,
+ 0x092ccf6c, 0x093d9664, 0x094e5d5b, 0x095f2453,
+ 0x096feb4a, 0x0980b242, 0x0991793a, 0x09a24031,
+ 0x09b30729, 0x09c3ce21, 0x09d49518, 0x09e55c10,
+ 0x09f62307, 0x0a06e9ff, 0x0a17b0f7, 0x0a2877ee,
+ 0x0a393ee6, 0x0a4a05de, 0x0a5accd5, 0x0a6b93cd,
+ 0x0a7c5ac4, 0x0a8d21bc, 0x0a9de8b4, 0x0aaeafab,
+ 0x0abf76a3, 0x0ad03d9b, 0x0ae10492, 0x0af1cb8a,
+ 0x0b029281, 0x0b135979, 0x0b242071, 0x0b34e768,
+ 0x0b45ae60, 0x0b567558, 0x0b673c4f, 0x0b780347,
+ 0x0b88ca3e, 0x0b999136, 0x0baa582e, 0x0bbb1f25,
+ 0x0bcbe61d, 0x0bdcad15, 0x0bed740c, 0x0bfe3b04,
+ 0x0c0f01fc, 0x0c1fc8f3, 0x0c308feb, 0x0c4156e2,
+ 0x0c521dda, 0x0c62e4d2, 0x0c73abc9, 0x0c8472c1,
+ 0x0c9539b9, 0x0ca600b0, 0x0cb6c7a8, 0x0cc78e9f,
+ 0x0cd85597, 0x0ce91c8f, 0x0cf9e386, 0x0d0aaa7e,
+ 0x0d1b7176, 0x0d2c386d, 0x0d3cff65, 0x0d4dc65c,
+ 0x0d5e8d54, 0x0d6f544c, 0x0d801b43, 0x0d90e23b,
+ 0x0da1a933, 0x0db2702a, 0x0dc33722, 0x0dd3fe19,
+ 0x0de4c511, 0x0df58c09, 0x0e065300, 0x0e1719f8,
+ 0x0e27e0f0, 0x0e38a7e7, 0x0e496edf, 0x0e5a35d6,
+ 0x0e6afcce, 0x0e7bc3c6, 0x0e8c8abd, 0x0e9d51b5,
+ 0x0eae18ad, 0x0ebedfa4, 0x0ecfa69c, 0x0ee06d94,
+ 0x0ef1348b, 0x0f01fb83, 0x0f12c27a, 0x0f238972,
+ 0x0f34506a, 0x0f451761, 0x0f55de59, 0x0f66a551,
+ 0x0f776c48, 0x0f883340, 0x0f98fa37, 0x0fa9c12f,
+ 0x0fba8827, 0x0fcb4f1e, 0x0fdc1616, 0x0fecdd0e,
+ 0x0ffda405, 0x100e6afd, 0x101f31f4, 0x102ff8ec,
+ 0x1040bfe4, 0x105186db, 0x10624dd3, 0x107314cb,
+ 0x1083dbc2, 0x1094a2ba, 0x10a569b1, 0x10b630a9
+};
+
+const u_int32 ustotshi[16] = {
+ 0x00000000, 0x10c6f7a1, 0x218def41, 0x3254e6e2,
+ 0x431bde83, 0x53e2d624, 0x64a9cdc4, 0x7570c565,
+ 0x8637bd06, 0x96feb4a6, 0xa7c5ac47, 0xb88ca3e8,
+ 0xc9539b89, 0xda1a9329, 0xeae18aca, 0xfba8826b
+};
+
+/*
+ * Tables to convert from a time stamp fraction to usecs. Note that
+ * the units of these tables are actually (usec<<3). We carry three
+ * guard bits so that the result can be properly truncated (or rounded)
+ * to be correct to the least significant bit.
+ *
+ * These tables are rounded.
+ */
+
+const u_int32 tstoushi[256] = {
+ 0x000000, 0x007a12, 0x00f424, 0x016e36,
+ 0x01e848, 0x02625a, 0x02dc6c, 0x03567e,
+ 0x03d090, 0x044aa2, 0x04c4b4, 0x053ec6,
+ 0x05b8d8, 0x0632ea, 0x06acfc, 0x07270e,
+ 0x07a120, 0x081b32, 0x089544, 0x090f56,
+ 0x098968, 0x0a037a, 0x0a7d8c, 0x0af79e,
+ 0x0b71b0, 0x0bebc2, 0x0c65d4, 0x0cdfe6,
+ 0x0d59f8, 0x0dd40a, 0x0e4e1c, 0x0ec82e,
+ 0x0f4240, 0x0fbc52, 0x103664, 0x10b076,
+ 0x112a88, 0x11a49a, 0x121eac, 0x1298be,
+ 0x1312d0, 0x138ce2, 0x1406f4, 0x148106,
+ 0x14fb18, 0x15752a, 0x15ef3c, 0x16694e,
+ 0x16e360, 0x175d72, 0x17d784, 0x185196,
+ 0x18cba8, 0x1945ba, 0x19bfcc, 0x1a39de,
+ 0x1ab3f0, 0x1b2e02, 0x1ba814, 0x1c2226,
+ 0x1c9c38, 0x1d164a, 0x1d905c, 0x1e0a6e,
+ 0x1e8480, 0x1efe92, 0x1f78a4, 0x1ff2b6,
+ 0x206cc8, 0x20e6da, 0x2160ec, 0x21dafe,
+ 0x225510, 0x22cf22, 0x234934, 0x23c346,
+ 0x243d58, 0x24b76a, 0x25317c, 0x25ab8e,
+ 0x2625a0, 0x269fb2, 0x2719c4, 0x2793d6,
+ 0x280de8, 0x2887fa, 0x29020c, 0x297c1e,
+ 0x29f630, 0x2a7042, 0x2aea54, 0x2b6466,
+ 0x2bde78, 0x2c588a, 0x2cd29c, 0x2d4cae,
+ 0x2dc6c0, 0x2e40d2, 0x2ebae4, 0x2f34f6,
+ 0x2faf08, 0x30291a, 0x30a32c, 0x311d3e,
+ 0x319750, 0x321162, 0x328b74, 0x330586,
+ 0x337f98, 0x33f9aa, 0x3473bc, 0x34edce,
+ 0x3567e0, 0x35e1f2, 0x365c04, 0x36d616,
+ 0x375028, 0x37ca3a, 0x38444c, 0x38be5e,
+ 0x393870, 0x39b282, 0x3a2c94, 0x3aa6a6,
+ 0x3b20b8, 0x3b9aca, 0x3c14dc, 0x3c8eee,
+ 0x3d0900, 0x3d8312, 0x3dfd24, 0x3e7736,
+ 0x3ef148, 0x3f6b5a, 0x3fe56c, 0x405f7e,
+ 0x40d990, 0x4153a2, 0x41cdb4, 0x4247c6,
+ 0x42c1d8, 0x433bea, 0x43b5fc, 0x44300e,
+ 0x44aa20, 0x452432, 0x459e44, 0x461856,
+ 0x469268, 0x470c7a, 0x47868c, 0x48009e,
+ 0x487ab0, 0x48f4c2, 0x496ed4, 0x49e8e6,
+ 0x4a62f8, 0x4add0a, 0x4b571c, 0x4bd12e,
+ 0x4c4b40, 0x4cc552, 0x4d3f64, 0x4db976,
+ 0x4e3388, 0x4ead9a, 0x4f27ac, 0x4fa1be,
+ 0x501bd0, 0x5095e2, 0x510ff4, 0x518a06,
+ 0x520418, 0x527e2a, 0x52f83c, 0x53724e,
+ 0x53ec60, 0x546672, 0x54e084, 0x555a96,
+ 0x55d4a8, 0x564eba, 0x56c8cc, 0x5742de,
+ 0x57bcf0, 0x583702, 0x58b114, 0x592b26,
+ 0x59a538, 0x5a1f4a, 0x5a995c, 0x5b136e,
+ 0x5b8d80, 0x5c0792, 0x5c81a4, 0x5cfbb6,
+ 0x5d75c8, 0x5defda, 0x5e69ec, 0x5ee3fe,
+ 0x5f5e10, 0x5fd822, 0x605234, 0x60cc46,
+ 0x614658, 0x61c06a, 0x623a7c, 0x62b48e,
+ 0x632ea0, 0x63a8b2, 0x6422c4, 0x649cd6,
+ 0x6516e8, 0x6590fa, 0x660b0c, 0x66851e,
+ 0x66ff30, 0x677942, 0x67f354, 0x686d66,
+ 0x68e778, 0x69618a, 0x69db9c, 0x6a55ae,
+ 0x6acfc0, 0x6b49d2, 0x6bc3e4, 0x6c3df6,
+ 0x6cb808, 0x6d321a, 0x6dac2c, 0x6e263e,
+ 0x6ea050, 0x6f1a62, 0x6f9474, 0x700e86,
+ 0x708898, 0x7102aa, 0x717cbc, 0x71f6ce,
+ 0x7270e0, 0x72eaf2, 0x736504, 0x73df16,
+ 0x745928, 0x74d33a, 0x754d4c, 0x75c75e,
+ 0x764170, 0x76bb82, 0x773594, 0x77afa6,
+ 0x7829b8, 0x78a3ca, 0x791ddc, 0x7997ee
+};
+
+const u_int32 tstousmid[256] = {
+ 0x0000, 0x007a, 0x00f4, 0x016e, 0x01e8, 0x0262, 0x02dc, 0x0356,
+ 0x03d1, 0x044b, 0x04c5, 0x053f, 0x05b9, 0x0633, 0x06ad, 0x0727,
+ 0x07a1, 0x081b, 0x0895, 0x090f, 0x0989, 0x0a03, 0x0a7e, 0x0af8,
+ 0x0b72, 0x0bec, 0x0c66, 0x0ce0, 0x0d5a, 0x0dd4, 0x0e4e, 0x0ec8,
+ 0x0f42, 0x0fbc, 0x1036, 0x10b0, 0x112b, 0x11a5, 0x121f, 0x1299,
+ 0x1313, 0x138d, 0x1407, 0x1481, 0x14fb, 0x1575, 0x15ef, 0x1669,
+ 0x16e3, 0x175d, 0x17d8, 0x1852, 0x18cc, 0x1946, 0x19c0, 0x1a3a,
+ 0x1ab4, 0x1b2e, 0x1ba8, 0x1c22, 0x1c9c, 0x1d16, 0x1d90, 0x1e0a,
+ 0x1e84, 0x1eff, 0x1f79, 0x1ff3, 0x206d, 0x20e7, 0x2161, 0x21db,
+ 0x2255, 0x22cf, 0x2349, 0x23c3, 0x243d, 0x24b7, 0x2531, 0x25ac,
+ 0x2626, 0x26a0, 0x271a, 0x2794, 0x280e, 0x2888, 0x2902, 0x297c,
+ 0x29f6, 0x2a70, 0x2aea, 0x2b64, 0x2bde, 0x2c59, 0x2cd3, 0x2d4d,
+ 0x2dc7, 0x2e41, 0x2ebb, 0x2f35, 0x2faf, 0x3029, 0x30a3, 0x311d,
+ 0x3197, 0x3211, 0x328b, 0x3306, 0x3380, 0x33fa, 0x3474, 0x34ee,
+ 0x3568, 0x35e2, 0x365c, 0x36d6, 0x3750, 0x37ca, 0x3844, 0x38be,
+ 0x3938, 0x39b3, 0x3a2d, 0x3aa7, 0x3b21, 0x3b9b, 0x3c15, 0x3c8f,
+ 0x3d09, 0x3d83, 0x3dfd, 0x3e77, 0x3ef1, 0x3f6b, 0x3fe5, 0x405f,
+ 0x40da, 0x4154, 0x41ce, 0x4248, 0x42c2, 0x433c, 0x43b6, 0x4430,
+ 0x44aa, 0x4524, 0x459e, 0x4618, 0x4692, 0x470c, 0x4787, 0x4801,
+ 0x487b, 0x48f5, 0x496f, 0x49e9, 0x4a63, 0x4add, 0x4b57, 0x4bd1,
+ 0x4c4b, 0x4cc5, 0x4d3f, 0x4db9, 0x4e34, 0x4eae, 0x4f28, 0x4fa2,
+ 0x501c, 0x5096, 0x5110, 0x518a, 0x5204, 0x527e, 0x52f8, 0x5372,
+ 0x53ec, 0x5466, 0x54e1, 0x555b, 0x55d5, 0x564f, 0x56c9, 0x5743,
+ 0x57bd, 0x5837, 0x58b1, 0x592b, 0x59a5, 0x5a1f, 0x5a99, 0x5b13,
+ 0x5b8d, 0x5c08, 0x5c82, 0x5cfc, 0x5d76, 0x5df0, 0x5e6a, 0x5ee4,
+ 0x5f5e, 0x5fd8, 0x6052, 0x60cc, 0x6146, 0x61c0, 0x623a, 0x62b5,
+ 0x632f, 0x63a9, 0x6423, 0x649d, 0x6517, 0x6591, 0x660b, 0x6685,
+ 0x66ff, 0x6779, 0x67f3, 0x686d, 0x68e7, 0x6962, 0x69dc, 0x6a56,
+ 0x6ad0, 0x6b4a, 0x6bc4, 0x6c3e, 0x6cb8, 0x6d32, 0x6dac, 0x6e26,
+ 0x6ea0, 0x6f1a, 0x6f94, 0x700f, 0x7089, 0x7103, 0x717d, 0x71f7,
+ 0x7271, 0x72eb, 0x7365, 0x73df, 0x7459, 0x74d3, 0x754d, 0x75c7,
+ 0x7641, 0x76bc, 0x7736, 0x77b0, 0x782a, 0x78a4, 0x791e, 0x7998
+};
+
+const u_int32 tstouslo[128] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+ 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
+ 0x1f, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
+ 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
+ 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x33, 0x34,
+ 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c,
+ 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44,
+ 0x45, 0x46, 0x47, 0x48, 0x48, 0x49, 0x4a, 0x4b,
+ 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
+ 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b,
+ 0x5c, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62,
+ 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a,
+ 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x71,
+ 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79
+};
+#else /* !USE_TSF_USEC_TABLES follows */
+NONEMPTY_TRANSLATION_UNIT
+#endif /* !USE_TSF_USEC_TABLES */
+/* -*- EOF -*- */
diff --git a/libntp/uglydate.c b/libntp/uglydate.c
new file mode 100644
index 0000000..66b5139
--- /dev/null
+++ b/libntp/uglydate.c
@@ -0,0 +1,51 @@
+/*
+ * uglydate - convert a time stamp to something barely readable
+ * The string returned is 37 characters long.
+ */
+#include <config.h>
+#include <stdio.h>
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "lib_strbuf.h"
+#include "ntp_stdlib.h"
+
+
+char *
+uglydate(
+ l_fp *ts
+ )
+{
+ char *bp;
+ char *timep;
+ struct tm *tm;
+ time_t sec;
+ long msec;
+ int year;
+
+ timep = ulfptoa(ts, 6); /* returns max 17 characters */
+ LIB_GETBUF(bp);
+ sec = ts->l_ui - JAN_1970;
+ msec = ts->l_uf / 4294967; /* fract / (2**32/1000) */
+ tm = gmtime(&sec);
+ if (ts->l_ui == 0) {
+ /*
+ * Probably not a real good thing to do. Oh, well.
+ */
+ year = 0;
+ tm->tm_yday = 0;
+ tm->tm_hour = 0;
+ tm->tm_min = 0;
+ tm->tm_sec = 0;
+ } else {
+ year = tm->tm_year;
+ while (year >= 100)
+ year -= 100;
+ }
+ snprintf(bp, LIB_BUFLENGTH,
+ "%17s %02d:%03d:%02d:%02d:%02d.%03ld", timep, year,
+ tm->tm_yday, tm->tm_hour, tm->tm_min, tm->tm_sec,
+ msec);
+
+ return bp;
+}
diff --git a/libntp/vint64ops.c b/libntp/vint64ops.c
new file mode 100644
index 0000000..5adbebb
--- /dev/null
+++ b/libntp/vint64ops.c
@@ -0,0 +1,284 @@
+/*
+ * vint64ops.c - operations on 'vint64' values
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ * ----------------------------------------------------------------------
+ * This is an attempt to get the vint64 calculations stuff centralised.
+ */
+
+#include <config.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <errno.h>
+
+#include "ntp_types.h"
+#include "ntp_fp.h"
+#include "vint64ops.h"
+
+/* ---------------------------------------------------------------------
+ * GCC is rather sticky with its 'const' attribute. We have to do it more
+ * explicit than with a cast if we want to get rid of a CONST qualifier.
+ * Greetings from the PASCAL world, where casting was only possible via
+ * untagged unions...
+ */
+static inline void*
+noconst(
+ const void* ptr
+ )
+{
+ union {
+ const void * cp;
+ void * vp;
+ } tmp;
+ tmp.cp = ptr;
+ return tmp.vp;
+}
+
+/* -------------------------------------------------------------------------*/
+
+vint64
+strtouv64(
+ const char * begp,
+ char ** endp,
+ int base
+ )
+{
+ vint64 res;
+ u_char digit;
+ int sig, num;
+ const u_char *src;
+
+ num = sig = 0;
+ src = (const u_char*)begp;
+ while (isspace(*src))
+ src++;
+
+ if (*src == '-') {
+ src++;
+ sig = 1;
+ } else if (*src == '+') {
+ src++;
+ }
+
+ if (base == 0) {
+ base = 10;
+ if (*src == '0') {
+ base = 8;
+ if (toupper(*++src) == 'X') {
+ src++;
+ base = 16;
+ }
+ }
+ } else if (base == 16) { /* remove optional leading '0x' or '0X' */
+ if (src[0] == '0' && toupper(src[1]) == 'X')
+ src += 2;
+ } else if (base <= 2 || base > 36) {
+ memset(&res, 0xFF, sizeof(res));
+ errno = ERANGE;
+ return res;
+ }
+
+ memset(&res, 0, sizeof(res));
+ while (*src) {
+ if (isdigit(*src))
+ digit = *src - '0';
+ else if (isupper(*src))
+ digit = *src - 'A' + 10;
+ else if (islower(*src))
+ digit = *src - 'a' + 10;
+ else
+ break;
+ if (digit >= base)
+ break;
+ num = 1;
+#if defined(HAVE_INT64)
+ res.Q_s = res.Q_s * base + digit;
+#else
+ /* res *= base, using 16x16->32 bit
+ * multiplication. Slow but portable.
+ */
+ {
+ uint32_t accu;
+ accu = (uint32_t)res.W_s.ll * base;
+ res.W_s.ll = (uint16_t)accu;
+ accu = (accu >> 16)
+ + (uint32_t)res.W_s.lh * base;
+ res.W_s.lh = (uint16_t)accu;
+ /* the upper bits can be done in one step: */
+ res.D_s.hi = res.D_s.hi * base + (accu >> 16);
+ }
+ M_ADD(res.D_s.hi, res.D_s.lo, 0, digit);
+#endif
+ src++;
+ }
+ if (!num)
+ errno = EINVAL;
+ if (endp)
+ *endp = (char*)noconst(src);
+ if (sig)
+ M_NEG(res.D_s.hi, res.D_s.lo);
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+int
+icmpv64(
+ const vint64 * lhs,
+ const vint64 * rhs
+ )
+{
+ int res;
+
+#if defined(HAVE_INT64)
+ res = (lhs->q_s > rhs->q_s)
+ - (lhs->q_s < rhs->q_s);
+#else
+ res = (lhs->d_s.hi > rhs->d_s.hi)
+ - (lhs->d_s.hi < rhs->d_s.hi);
+ if ( ! res )
+ res = (lhs->D_s.lo > rhs->D_s.lo)
+ - (lhs->D_s.lo < rhs->D_s.lo);
+#endif
+
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+int
+ucmpv64(
+ const vint64 * lhs,
+ const vint64 * rhs
+ )
+{
+ int res;
+
+#if defined(HAVE_INT64)
+ res = (lhs->Q_s > rhs->Q_s)
+ - (lhs->Q_s < rhs->Q_s);
+#else
+ res = (lhs->D_s.hi > rhs->D_s.hi)
+ - (lhs->D_s.hi < rhs->D_s.hi);
+ if ( ! res )
+ res = (lhs->D_s.lo > rhs->D_s.lo)
+ - (lhs->D_s.lo < rhs->D_s.lo);
+#endif
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+vint64
+addv64(
+ const vint64 *lhs,
+ const vint64 *rhs
+ )
+{
+ vint64 res;
+
+#if defined(HAVE_INT64)
+ res.Q_s = lhs->Q_s + rhs->Q_s;
+#else
+ res = *lhs;
+ M_ADD(res.D_s.hi, res.D_s.lo, rhs->D_s.hi, rhs->D_s.lo);
+#endif
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+vint64
+subv64(
+ const vint64 *lhs,
+ const vint64 *rhs
+ )
+{
+ vint64 res;
+
+#if defined(HAVE_INT64)
+ res.Q_s = lhs->Q_s - rhs->Q_s;
+#else
+ res = *lhs;
+ M_SUB(res.D_s.hi, res.D_s.lo, rhs->D_s.hi, rhs->D_s.lo);
+#endif
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+vint64
+addv64i32(
+ const vint64 * lhs,
+ int32_t rhs
+ )
+{
+ vint64 res;
+
+ res = *lhs;
+#if defined(HAVE_INT64)
+ res.q_s += rhs;
+#else
+ M_ADD(res.D_s.hi, res.D_s.lo, -(rhs < 0), rhs);
+#endif
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+vint64
+subv64i32(
+ const vint64 * lhs,
+ int32_t rhs
+ )
+{
+ vint64 res;
+
+ res = *lhs;
+#if defined(HAVE_INT64)
+ res.q_s -= rhs;
+#else
+ M_SUB(res.D_s.hi, res.D_s.lo, -(rhs < 0), rhs);
+#endif
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+vint64
+addv64u32(
+ const vint64 * lhs,
+ uint32_t rhs
+ )
+{
+ vint64 res;
+
+ res = *lhs;
+#if defined(HAVE_INT64)
+ res.Q_s += rhs;
+#else
+ M_ADD(res.D_s.hi, res.D_s.lo, 0, rhs);
+#endif
+ return res;
+}
+
+/* -------------------------------------------------------------------------*/
+
+vint64
+subv64u32(
+ const vint64 * lhs,
+ uint32_t rhs
+ )
+{
+ vint64 res;
+
+ res = *lhs;
+#if defined(HAVE_INT64)
+ res.Q_s -= rhs;
+#else
+ M_SUB(res.D_s.hi, res.D_s.lo, 0, rhs);
+#endif
+ return res;
+}
diff --git a/libntp/work_fork.c b/libntp/work_fork.c
new file mode 100644
index 0000000..10329e7
--- /dev/null
+++ b/libntp/work_fork.c
@@ -0,0 +1,526 @@
+/*
+ * work_fork.c - fork implementation for blocking worker child.
+ */
+#include <config.h>
+#include "ntp_workimpl.h"
+
+#ifdef WORK_FORK
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+
+#include "iosignal.h"
+#include "ntp_stdlib.h"
+#include "ntp_malloc.h"
+#include "ntp_syslog.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_assert.h"
+#include "ntp_unixtime.h"
+#include "ntp_worker.h"
+
+/* === variables === */
+ int worker_process;
+ addremove_io_fd_func addremove_io_fd;
+static volatile int worker_sighup_received;
+
+/* === function prototypes === */
+static void fork_blocking_child(blocking_child *);
+static RETSIGTYPE worker_sighup(int);
+static void send_worker_home_atexit(void);
+static void cleanup_after_child(blocking_child *);
+
+/* === functions === */
+/*
+ * exit_worker()
+ *
+ * On some systems _exit() is preferred to exit() for forked children.
+ * For example, http://netbsd.gw.com/cgi-bin/man-cgi?fork++NetBSD-5.0
+ * recommends _exit() to avoid double-flushing C runtime stream buffers
+ * and also to avoid calling the parent's atexit() routines in the
+ * child. On those systems WORKER_CHILD_EXIT is _exit. Since _exit
+ * bypasses CRT cleanup, fflush() files we know might have output
+ * buffered.
+ */
+void
+exit_worker(
+ int exitcode
+ )
+{
+ if (syslog_file != NULL)
+ fflush(syslog_file);
+ fflush(stdout);
+ fflush(stderr);
+ WORKER_CHILD_EXIT (exitcode); /* space before ( required */
+}
+
+
+static RETSIGTYPE
+worker_sighup(
+ int sig
+ )
+{
+ if (SIGHUP == sig)
+ worker_sighup_received = 1;
+}
+
+
+int
+worker_sleep(
+ blocking_child * c,
+ time_t seconds
+ )
+{
+ u_int sleep_remain;
+
+ sleep_remain = (u_int)seconds;
+ do {
+ if (!worker_sighup_received)
+ sleep_remain = sleep(sleep_remain);
+ if (worker_sighup_received) {
+ TRACE(1, ("worker SIGHUP with %us left to sleep",
+ sleep_remain));
+ worker_sighup_received = 0;
+ return -1;
+ }
+ } while (sleep_remain);
+
+ return 0;
+}
+
+
+void
+interrupt_worker_sleep(void)
+{
+ u_int idx;
+ blocking_child * c;
+ int rc;
+
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+
+ if (NULL == c || c->reusable == TRUE)
+ continue;
+
+ rc = kill(c->pid, SIGHUP);
+ if (rc < 0)
+ msyslog(LOG_ERR,
+ "Unable to signal HUP to wake child pid %d: %m",
+ c->pid);
+ }
+}
+
+
+/*
+ * req_child_exit() runs in the parent.
+ */
+int
+req_child_exit(
+ blocking_child * c
+ )
+{
+ if (-1 != c->req_write_pipe) {
+ close(c->req_write_pipe);
+ c->req_write_pipe = -1;
+ return 0;
+ }
+ return -1;
+}
+
+
+/*
+ * cleanup_after_child() runs in parent.
+ */
+static void
+cleanup_after_child(
+ blocking_child * c
+ )
+{
+ if (-1 != c->req_write_pipe) {
+ close(c->req_write_pipe);
+ c->req_write_pipe = -1;
+ }
+ if (-1 != c->resp_read_pipe) {
+ (*addremove_io_fd)(c->resp_read_pipe, c->ispipe, TRUE);
+ close(c->resp_read_pipe);
+ c->resp_read_pipe = -1;
+ }
+ c->pid = 0;
+ c->resp_read_ctx = NULL;
+ DEBUG_INSIST(-1 == c->req_read_pipe);
+ DEBUG_INSIST(-1 == c->resp_write_pipe);
+ c->reusable = TRUE;
+}
+
+
+static void
+send_worker_home_atexit(void)
+{
+ u_int idx;
+ blocking_child * c;
+
+ if (worker_process)
+ return;
+
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+ if (NULL == c)
+ continue;
+ req_child_exit(c);
+ }
+}
+
+
+int
+send_blocking_req_internal(
+ blocking_child * c,
+ blocking_pipe_header * hdr,
+ void * data
+ )
+{
+ int octets;
+ int rc;
+
+ DEBUG_REQUIRE(hdr != NULL);
+ DEBUG_REQUIRE(data != NULL);
+ DEBUG_REQUIRE(BLOCKING_REQ_MAGIC == hdr->magic_sig);
+
+ if (-1 == c->req_write_pipe) {
+ fork_blocking_child(c);
+ DEBUG_INSIST(-1 != c->req_write_pipe);
+ }
+
+ octets = sizeof(*hdr);
+ rc = write(c->req_write_pipe, hdr, octets);
+
+ if (rc == octets) {
+ octets = hdr->octets - sizeof(*hdr);
+ rc = write(c->req_write_pipe, data, octets);
+
+ if (rc == octets)
+ return 0;
+ }
+
+ if (rc < 0)
+ msyslog(LOG_ERR,
+ "send_blocking_req_internal: pipe write: %m");
+ else
+ msyslog(LOG_ERR,
+ "send_blocking_req_internal: short write %d of %d",
+ rc, octets);
+
+ exit(1); /* otherwise would be return -1 */
+}
+
+
+blocking_pipe_header *
+receive_blocking_req_internal(
+ blocking_child * c
+ )
+{
+ blocking_pipe_header hdr;
+ blocking_pipe_header * req;
+ int rc;
+ long octets;
+
+ DEBUG_REQUIRE(-1 != c->req_read_pipe);
+
+ req = NULL;
+
+ do {
+ rc = read(c->req_read_pipe, &hdr, sizeof(hdr));
+ } while (rc < 0 && EINTR == errno);
+
+ if (rc < 0) {
+ msyslog(LOG_ERR,
+ "receive_blocking_req_internal: pipe read %m");
+ } else if (0 == rc) {
+ TRACE(4, ("parent closed request pipe, child %d terminating\n",
+ c->pid));
+ } else if (rc != sizeof(hdr)) {
+ msyslog(LOG_ERR,
+ "receive_blocking_req_internal: short header read %d of %lu",
+ rc, (u_long)sizeof(hdr));
+ } else {
+ INSIST(sizeof(hdr) < hdr.octets && hdr.octets < 4 * 1024);
+ req = emalloc(hdr.octets);
+ memcpy(req, &hdr, sizeof(*req));
+ octets = hdr.octets - sizeof(hdr);
+ rc = read(c->req_read_pipe, (char *)req + sizeof(*req),
+ octets);
+
+ if (rc < 0)
+ msyslog(LOG_ERR,
+ "receive_blocking_req_internal: pipe data read %m");
+ else if (rc != octets)
+ msyslog(LOG_ERR,
+ "receive_blocking_req_internal: short read %d of %ld",
+ rc, octets);
+ else if (BLOCKING_REQ_MAGIC != req->magic_sig)
+ msyslog(LOG_ERR,
+ "receive_blocking_req_internal: packet header mismatch (0x%x)",
+ req->magic_sig);
+ else
+ return req;
+ }
+
+ if (req != NULL)
+ free(req);
+
+ return NULL;
+}
+
+
+int
+send_blocking_resp_internal(
+ blocking_child * c,
+ blocking_pipe_header * resp
+ )
+{
+ long octets;
+ int rc;
+
+ DEBUG_REQUIRE(-1 != c->resp_write_pipe);
+
+ octets = resp->octets;
+ rc = write(c->resp_write_pipe, resp, octets);
+ free(resp);
+
+ if (octets == rc)
+ return 0;
+
+ if (rc < 0)
+ TRACE(1, ("send_blocking_resp_internal: pipe write %m\n"));
+ else
+ TRACE(1, ("send_blocking_resp_internal: short write %d of %ld\n",
+ rc, octets));
+
+ return -1;
+}
+
+
+blocking_pipe_header *
+receive_blocking_resp_internal(
+ blocking_child * c
+ )
+{
+ blocking_pipe_header hdr;
+ blocking_pipe_header * resp;
+ int rc;
+ long octets;
+
+ DEBUG_REQUIRE(c->resp_read_pipe != -1);
+
+ resp = NULL;
+ rc = read(c->resp_read_pipe, &hdr, sizeof(hdr));
+
+ if (rc < 0) {
+ TRACE(1, ("receive_blocking_resp_internal: pipe read %m\n"));
+ } else if (0 == rc) {
+ /* this is the normal child exited indication */
+ } else if (rc != sizeof(hdr)) {
+ TRACE(1, ("receive_blocking_resp_internal: short header read %d of %lu\n",
+ rc, (u_long)sizeof(hdr)));
+ } else if (BLOCKING_RESP_MAGIC != hdr.magic_sig) {
+ TRACE(1, ("receive_blocking_resp_internal: header mismatch (0x%x)\n",
+ hdr.magic_sig));
+ } else {
+ INSIST(sizeof(hdr) < hdr.octets &&
+ hdr.octets < 16 * 1024);
+ resp = emalloc(hdr.octets);
+ memcpy(resp, &hdr, sizeof(*resp));
+ octets = hdr.octets - sizeof(hdr);
+ rc = read(c->resp_read_pipe,
+ (char *)resp + sizeof(*resp),
+ octets);
+
+ if (rc < 0)
+ TRACE(1, ("receive_blocking_resp_internal: pipe data read %m\n"));
+ else if (rc < octets)
+ TRACE(1, ("receive_blocking_resp_internal: short read %d of %ld\n",
+ rc, octets));
+ else
+ return resp;
+ }
+
+ cleanup_after_child(c);
+
+ if (resp != NULL)
+ free(resp);
+
+ return NULL;
+}
+
+
+#if defined(HAVE_DROPROOT) && defined(WORK_FORK)
+void
+fork_deferred_worker(void)
+{
+ u_int idx;
+ blocking_child * c;
+
+ REQUIRE(droproot && root_dropped);
+
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+ if (NULL == c)
+ continue;
+ if (-1 != c->req_write_pipe && 0 == c->pid)
+ fork_blocking_child(c);
+ }
+}
+#endif
+
+
+static void
+fork_blocking_child(
+ blocking_child * c
+ )
+{
+ static int atexit_installed;
+ static int blocking_pipes[4] = { -1, -1, -1, -1 };
+ int rc;
+ int was_pipe;
+ int is_pipe;
+ int saved_errno;
+ int childpid;
+ int keep_fd;
+ int fd;
+
+ /*
+ * parent and child communicate via a pair of pipes.
+ *
+ * 0 child read request
+ * 1 parent write request
+ * 2 parent read response
+ * 3 child write response
+ */
+ if (-1 == c->req_write_pipe) {
+ rc = pipe_socketpair(&blocking_pipes[0], &was_pipe);
+ if (0 != rc) {
+ saved_errno = errno;
+ } else {
+ rc = pipe_socketpair(&blocking_pipes[2], &is_pipe);
+ if (0 != rc) {
+ saved_errno = errno;
+ close(blocking_pipes[0]);
+ close(blocking_pipes[1]);
+ } else {
+ INSIST(was_pipe == is_pipe);
+ }
+ }
+ if (0 != rc) {
+ errno = saved_errno;
+ msyslog(LOG_ERR, "unable to create worker pipes: %m");
+ exit(1);
+ }
+
+ /*
+ * Move the descriptors the parent will keep open out of the
+ * low descriptors preferred by C runtime buffered FILE *.
+ */
+ c->req_write_pipe = move_fd(blocking_pipes[1]);
+ c->resp_read_pipe = move_fd(blocking_pipes[2]);
+ /*
+ * wake any worker child on orderly shutdown of the
+ * daemon so that it can notice the broken pipes and
+ * go away promptly.
+ */
+ if (!atexit_installed) {
+ atexit(&send_worker_home_atexit);
+ atexit_installed = TRUE;
+ }
+ }
+
+#ifdef HAVE_DROPROOT
+ /* defer the fork until after root is dropped */
+ if (droproot && !root_dropped)
+ return;
+#endif
+ if (syslog_file != NULL)
+ fflush(syslog_file);
+ fflush(stdout);
+ fflush(stderr);
+
+ signal_no_reset(SIGCHLD, SIG_IGN);
+
+ childpid = fork();
+ if (-1 == childpid) {
+ msyslog(LOG_ERR, "unable to fork worker: %m");
+ exit(1);
+ }
+
+ if (childpid) {
+ /* this is the parent */
+ TRACE(1, ("forked worker child (pid %d)\n", childpid));
+ c->pid = childpid;
+ c->ispipe = is_pipe;
+
+ /* close the child's pipe descriptors. */
+ close(blocking_pipes[0]);
+ close(blocking_pipes[3]);
+
+ memset(blocking_pipes, -1, sizeof(blocking_pipes));
+
+ /* wire into I/O loop */
+ (*addremove_io_fd)(c->resp_read_pipe, is_pipe, FALSE);
+
+ return; /* parent returns */
+ }
+
+ /*
+ * The parent gets the child pid as the return value of fork().
+ * The child must work for it.
+ */
+ c->pid = getpid();
+ worker_process = TRUE;
+
+ /*
+ * In the child, close all files except stdin, stdout, stderr,
+ * and the two child ends of the pipes.
+ */
+ DEBUG_INSIST(-1 == c->req_read_pipe);
+ DEBUG_INSIST(-1 == c->resp_write_pipe);
+ c->req_read_pipe = blocking_pipes[0];
+ c->resp_write_pipe = blocking_pipes[3];
+
+ kill_asyncio(0);
+ closelog();
+ if (syslog_file != NULL) {
+ fclose(syslog_file);
+ syslog_file = NULL;
+ syslogit = TRUE;
+ }
+ keep_fd = max(c->req_read_pipe, c->resp_write_pipe);
+ for (fd = 3; fd < keep_fd; fd++)
+ if (fd != c->req_read_pipe &&
+ fd != c->resp_write_pipe)
+ close(fd);
+ close_all_beyond(keep_fd);
+ /*
+ * We get signals from refclock serial I/O on NetBSD in the
+ * worker if we do not reset SIGIO's handler to the default.
+ * It is not conditionalized for NetBSD alone because on
+ * systems where it is not needed, it is harmless, and that
+ * allows us to handle unknown others with NetBSD behavior.
+ * [Bug 1386]
+ */
+#if defined(USE_SIGIO)
+ signal_no_reset(SIGIO, SIG_DFL);
+#elif defined(USE_SIGPOLL)
+ signal_no_reset(SIGPOLL, SIG_DFL);
+#endif
+ signal_no_reset(SIGHUP, worker_sighup);
+ init_logging("ntp_intres", 0, FALSE);
+ setup_logfile(NULL);
+
+ /*
+ * And now back to the portable code
+ */
+ exit_worker(blocking_child_common(c));
+}
+
+
+#else /* !WORK_FORK follows */
+char work_fork_nonempty_compilation_unit;
+#endif
diff --git a/libntp/work_thread.c b/libntp/work_thread.c
new file mode 100644
index 0000000..38d8747
--- /dev/null
+++ b/libntp/work_thread.c
@@ -0,0 +1,726 @@
+/*
+ * work_thread.c - threads implementation for blocking worker child.
+ */
+#include <config.h>
+#include "ntp_workimpl.h"
+
+#ifdef WORK_THREAD
+
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+#ifndef SYS_WINNT
+#include <pthread.h>
+#endif
+
+#include "ntp_stdlib.h"
+#include "ntp_malloc.h"
+#include "ntp_syslog.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_assert.h"
+#include "ntp_unixtime.h"
+#include "timespecops.h"
+#include "ntp_worker.h"
+
+#define CHILD_EXIT_REQ ((blocking_pipe_header *)(intptr_t)-1)
+#define CHILD_GONE_RESP CHILD_EXIT_REQ
+#define WORKITEMS_ALLOC_INC 16
+#define RESPONSES_ALLOC_INC 4
+
+#ifndef THREAD_MINSTACKSIZE
+#define THREAD_MINSTACKSIZE (64U * 1024)
+#endif
+
+#ifndef DEVOLATILE
+#define DEVOLATILE(type, var) ((type)(uintptr_t)(volatile void *)(var))
+#endif
+
+#ifdef SYS_WINNT
+# define thread_exit(c) _endthreadex(c)
+# define tickle_sem SetEvent
+#else
+# define thread_exit(c) pthread_exit((void*)(size_t)(c))
+# define tickle_sem sem_post
+#endif
+
+#ifdef WORK_PIPE
+addremove_io_fd_func addremove_io_fd;
+#else
+addremove_io_semaphore_func addremove_io_semaphore;
+#endif
+
+static void start_blocking_thread(blocking_child *);
+static void start_blocking_thread_internal(blocking_child *);
+static void prepare_child_sems(blocking_child *);
+static int wait_for_sem(sem_ref, struct timespec *);
+static void ensure_workitems_empty_slot(blocking_child *);
+static void ensure_workresp_empty_slot(blocking_child *);
+static int queue_req_pointer(blocking_child *, blocking_pipe_header *);
+static void cleanup_after_child(blocking_child *);
+#ifdef SYS_WINNT
+u_int WINAPI blocking_thread(void *);
+#else
+void * blocking_thread(void *);
+#endif
+#ifndef SYS_WINNT
+static void block_thread_signals(sigset_t *);
+#endif
+
+
+void
+exit_worker(
+ int exitcode
+ )
+{
+ thread_exit(exitcode); /* see #define thread_exit */
+}
+
+
+int
+worker_sleep(
+ blocking_child * c,
+ time_t seconds
+ )
+{
+ struct timespec until;
+ int rc;
+
+# ifdef HAVE_CLOCK_GETTIME
+ if (0 != clock_gettime(CLOCK_REALTIME, &until)) {
+ msyslog(LOG_ERR, "worker_sleep: clock_gettime() failed: %m");
+ return -1;
+ }
+# else
+ if (0 != getclock(TIMEOFDAY, &until)) {
+ msyslog(LOG_ERR, "worker_sleep: getclock() failed: %m");
+ return -1;
+ }
+# endif
+ until.tv_sec += seconds;
+ do {
+ rc = wait_for_sem(c->wake_scheduled_sleep, &until);
+ } while (-1 == rc && EINTR == errno);
+ if (0 == rc)
+ return -1;
+ if (-1 == rc && ETIMEDOUT == errno)
+ return 0;
+ msyslog(LOG_ERR, "worker_sleep: sem_timedwait: %m");
+ return -1;
+}
+
+
+void
+interrupt_worker_sleep(void)
+{
+ u_int idx;
+ blocking_child * c;
+
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+ if (NULL == c || NULL == c->wake_scheduled_sleep)
+ continue;
+ tickle_sem(c->wake_scheduled_sleep);
+ }
+}
+
+
+static void
+ensure_workitems_empty_slot(
+ blocking_child *c
+ )
+{
+ const size_t each = sizeof(blocking_children[0]->workitems[0]);
+ size_t new_alloc;
+ size_t old_octets;
+ size_t new_octets;
+ void * nonvol_workitems;
+
+
+ if (c->workitems != NULL &&
+ NULL == c->workitems[c->next_workitem])
+ return;
+
+ new_alloc = c->workitems_alloc + WORKITEMS_ALLOC_INC;
+ old_octets = c->workitems_alloc * each;
+ new_octets = new_alloc * each;
+ nonvol_workitems = DEVOLATILE(void *, c->workitems);
+ c->workitems = erealloc_zero(nonvol_workitems, new_octets,
+ old_octets);
+ if (0 == c->next_workitem)
+ c->next_workitem = c->workitems_alloc;
+ c->workitems_alloc = new_alloc;
+}
+
+
+static void
+ensure_workresp_empty_slot(
+ blocking_child *c
+ )
+{
+ const size_t each = sizeof(blocking_children[0]->responses[0]);
+ size_t new_alloc;
+ size_t old_octets;
+ size_t new_octets;
+ void * nonvol_responses;
+
+ if (c->responses != NULL &&
+ NULL == c->responses[c->next_response])
+ return;
+
+ new_alloc = c->responses_alloc + RESPONSES_ALLOC_INC;
+ old_octets = c->responses_alloc * each;
+ new_octets = new_alloc * each;
+ nonvol_responses = DEVOLATILE(void *, c->responses);
+ c->responses = erealloc_zero(nonvol_responses, new_octets,
+ old_octets);
+ if (0 == c->next_response)
+ c->next_response = c->responses_alloc;
+ c->responses_alloc = new_alloc;
+}
+
+
+/*
+ * queue_req_pointer() - append a work item or idle exit request to
+ * blocking_workitems[].
+ */
+static int
+queue_req_pointer(
+ blocking_child * c,
+ blocking_pipe_header * hdr
+ )
+{
+ c->workitems[c->next_workitem] = hdr;
+ c->next_workitem = (1 + c->next_workitem) % c->workitems_alloc;
+
+ /*
+ * We only want to signal the wakeup event if the child is
+ * blocking on it, which is indicated by setting the blocking
+ * event. Wait with zero timeout to test.
+ */
+ /* !!!! if (WAIT_OBJECT_0 == WaitForSingleObject(c->child_is_blocking, 0)) */
+ tickle_sem(c->blocking_req_ready);
+
+ return 0;
+}
+
+
+int
+send_blocking_req_internal(
+ blocking_child * c,
+ blocking_pipe_header * hdr,
+ void * data
+ )
+{
+ blocking_pipe_header * threadcopy;
+ size_t payload_octets;
+
+ REQUIRE(hdr != NULL);
+ REQUIRE(data != NULL);
+ DEBUG_REQUIRE(BLOCKING_REQ_MAGIC == hdr->magic_sig);
+
+ if (hdr->octets <= sizeof(*hdr))
+ return 1; /* failure */
+ payload_octets = hdr->octets - sizeof(*hdr);
+
+ ensure_workitems_empty_slot(c);
+ if (NULL == c->thread_ref) {
+ ensure_workresp_empty_slot(c);
+ start_blocking_thread(c);
+ }
+
+ threadcopy = emalloc(hdr->octets);
+ memcpy(threadcopy, hdr, sizeof(*hdr));
+ memcpy((char *)threadcopy + sizeof(*hdr), data, payload_octets);
+
+ return queue_req_pointer(c, threadcopy);
+}
+
+
+blocking_pipe_header *
+receive_blocking_req_internal(
+ blocking_child * c
+ )
+{
+ blocking_pipe_header * req;
+ int rc;
+
+ /*
+ * Child blocks here when idle. SysV semaphores maintain a
+ * count and release from sem_wait() only when it reaches 0.
+ * Windows auto-reset events are simpler, and multiple SetEvent
+ * calls before any thread waits result in a single wakeup.
+ * On Windows, the child drains all workitems each wakeup, while
+ * with SysV semaphores wait_sem() is used before each item.
+ */
+#ifdef SYS_WINNT
+ while (NULL == c->workitems[c->next_workeritem]) {
+ /* !!!! SetEvent(c->child_is_blocking); */
+ rc = wait_for_sem(c->blocking_req_ready, NULL);
+ INSIST(0 == rc);
+ /* !!!! ResetEvent(c->child_is_blocking); */
+ }
+#else
+ do {
+ rc = wait_for_sem(c->blocking_req_ready, NULL);
+ } while (-1 == rc && EINTR == errno);
+ INSIST(0 == rc);
+#endif
+
+ req = c->workitems[c->next_workeritem];
+ INSIST(NULL != req);
+ c->workitems[c->next_workeritem] = NULL;
+ c->next_workeritem = (1 + c->next_workeritem) %
+ c->workitems_alloc;
+
+ if (CHILD_EXIT_REQ == req) { /* idled out */
+ send_blocking_resp_internal(c, CHILD_GONE_RESP);
+ req = NULL;
+ }
+
+ return req;
+}
+
+
+int
+send_blocking_resp_internal(
+ blocking_child * c,
+ blocking_pipe_header * resp
+ )
+{
+ ensure_workresp_empty_slot(c);
+
+ c->responses[c->next_response] = resp;
+ c->next_response = (1 + c->next_response) % c->responses_alloc;
+
+#ifdef WORK_PIPE
+ write(c->resp_write_pipe, "", 1);
+#else
+ tickle_sem(c->blocking_response_ready);
+#endif
+
+ return 0;
+}
+
+
+#ifndef WORK_PIPE
+void
+handle_blocking_resp_sem(
+ void * context
+ )
+{
+ HANDLE ready;
+ blocking_child * c;
+ u_int idx;
+
+ ready = (HANDLE)context;
+ c = NULL;
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+ if (c != NULL && c->thread_ref != NULL &&
+ ready == c->blocking_response_ready)
+ break;
+ }
+ if (idx < blocking_children_alloc)
+ process_blocking_resp(c);
+}
+#endif /* !WORK_PIPE */
+
+
+blocking_pipe_header *
+receive_blocking_resp_internal(
+ blocking_child * c
+ )
+{
+ blocking_pipe_header * removed;
+#ifdef WORK_PIPE
+ int rc;
+ char scratch[32];
+
+ do {
+ rc = read(c->resp_read_pipe, scratch, sizeof(scratch));
+ } while (-1 == rc && EINTR == errno);
+#endif
+ removed = c->responses[c->next_workresp];
+ if (NULL != removed) {
+ c->responses[c->next_workresp] = NULL;
+ c->next_workresp = (1 + c->next_workresp) %
+ c->responses_alloc;
+ DEBUG_ENSURE(CHILD_GONE_RESP == removed ||
+ BLOCKING_RESP_MAGIC == removed->magic_sig);
+ }
+ if (CHILD_GONE_RESP == removed) {
+ cleanup_after_child(c);
+ removed = NULL;
+ }
+
+ return removed;
+}
+
+
+static void
+start_blocking_thread(
+ blocking_child * c
+ )
+{
+
+ DEBUG_INSIST(!c->reusable);
+
+ prepare_child_sems(c);
+ start_blocking_thread_internal(c);
+}
+
+
+static void
+start_blocking_thread_internal(
+ blocking_child * c
+ )
+#ifdef SYS_WINNT
+{
+ thr_ref blocking_child_thread;
+ u_int blocking_thread_id;
+ BOOL resumed;
+
+ (*addremove_io_semaphore)(c->blocking_response_ready, FALSE);
+ blocking_child_thread =
+ (HANDLE)_beginthreadex(
+ NULL,
+ 0,
+ &blocking_thread,
+ c,
+ CREATE_SUSPENDED,
+ &blocking_thread_id);
+
+ if (NULL == blocking_child_thread) {
+ msyslog(LOG_ERR, "start blocking thread failed: %m");
+ exit(-1);
+ }
+ c->thread_id = blocking_thread_id;
+ c->thread_ref = blocking_child_thread;
+ /* remember the thread priority is only within the process class */
+ if (!SetThreadPriority(blocking_child_thread,
+ THREAD_PRIORITY_BELOW_NORMAL))
+ msyslog(LOG_ERR, "Error lowering blocking thread priority: %m");
+
+ resumed = ResumeThread(blocking_child_thread);
+ DEBUG_INSIST(resumed);
+}
+#else /* pthreads start_blocking_thread_internal() follows */
+{
+# ifdef NEED_PTHREAD_INIT
+ static int pthread_init_called;
+# endif
+ pthread_attr_t thr_attr;
+ int rc;
+ int saved_errno;
+ int pipe_ends[2]; /* read then write */
+ int is_pipe;
+ int flags;
+ size_t stacksize;
+ sigset_t saved_sig_mask;
+
+# ifdef NEED_PTHREAD_INIT
+ /*
+ * from lib/isc/unix/app.c:
+ * BSDI 3.1 seg faults in pthread_sigmask() if we don't do this.
+ */
+ if (!pthread_init_called) {
+ pthread_init();
+ pthread_init_called = TRUE;
+ }
+# endif
+
+ rc = pipe_socketpair(&pipe_ends[0], &is_pipe);
+ if (0 != rc) {
+ msyslog(LOG_ERR, "start_blocking_thread: pipe_socketpair() %m");
+ exit(1);
+ }
+ c->resp_read_pipe = move_fd(pipe_ends[0]);
+ c->resp_write_pipe = move_fd(pipe_ends[1]);
+ c->ispipe = is_pipe;
+ flags = fcntl(c->resp_read_pipe, F_GETFL, 0);
+ if (-1 == flags) {
+ msyslog(LOG_ERR, "start_blocking_thread: fcntl(F_GETFL) %m");
+ exit(1);
+ }
+ rc = fcntl(c->resp_read_pipe, F_SETFL, O_NONBLOCK | flags);
+ if (-1 == rc) {
+ msyslog(LOG_ERR,
+ "start_blocking_thread: fcntl(F_SETFL, O_NONBLOCK) %m");
+ exit(1);
+ }
+ (*addremove_io_fd)(c->resp_read_pipe, c->ispipe, FALSE);
+ pthread_attr_init(&thr_attr);
+ pthread_attr_setdetachstate(&thr_attr, PTHREAD_CREATE_DETACHED);
+#if defined(HAVE_PTHREAD_ATTR_GETSTACKSIZE) && \
+ defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+ rc = pthread_attr_getstacksize(&thr_attr, &stacksize);
+ if (-1 == rc) {
+ msyslog(LOG_ERR,
+ "start_blocking_thread: pthread_attr_getstacksize %m");
+ } else if (stacksize < THREAD_MINSTACKSIZE) {
+ rc = pthread_attr_setstacksize(&thr_attr,
+ THREAD_MINSTACKSIZE);
+ if (-1 == rc)
+ msyslog(LOG_ERR,
+ "start_blocking_thread: pthread_attr_setstacksize(0x%lx -> 0x%lx) %m",
+ (u_long)stacksize,
+ (u_long)THREAD_MINSTACKSIZE);
+ }
+#else
+ UNUSED_ARG(stacksize);
+#endif
+#if defined(PTHREAD_SCOPE_SYSTEM) && defined(NEED_PTHREAD_SCOPE_SYSTEM)
+ pthread_attr_setscope(&thr_attr, PTHREAD_SCOPE_SYSTEM);
+#endif
+ c->thread_ref = emalloc_zero(sizeof(*c->thread_ref));
+ block_thread_signals(&saved_sig_mask);
+ rc = pthread_create(c->thread_ref, &thr_attr,
+ &blocking_thread, c);
+ saved_errno = errno;
+ pthread_sigmask(SIG_SETMASK, &saved_sig_mask, NULL);
+ pthread_attr_destroy(&thr_attr);
+ if (0 != rc) {
+ errno = saved_errno;
+ msyslog(LOG_ERR, "pthread_create() blocking child: %m");
+ exit(1);
+ }
+}
+#endif
+
+
+/*
+ * block_thread_signals()
+ *
+ * Temporarily block signals used by ntpd main thread, so that signal
+ * mask inherited by child threads leaves them blocked. Returns prior
+ * active signal mask via pmask, to be restored by the main thread
+ * after pthread_create().
+ */
+#ifndef SYS_WINNT
+void
+block_thread_signals(
+ sigset_t * pmask
+ )
+{
+ sigset_t block;
+
+ sigemptyset(&block);
+# ifdef HAVE_SIGNALED_IO
+# ifdef SIGIO
+ sigaddset(&block, SIGIO);
+# endif
+# ifdef SIGPOLL
+ sigaddset(&block, SIGPOLL);
+# endif
+# endif /* HAVE_SIGNALED_IO */
+ sigaddset(&block, SIGALRM);
+ sigaddset(&block, MOREDEBUGSIG);
+ sigaddset(&block, LESSDEBUGSIG);
+# ifdef SIGDIE1
+ sigaddset(&block, SIGDIE1);
+# endif
+# ifdef SIGDIE2
+ sigaddset(&block, SIGDIE2);
+# endif
+# ifdef SIGDIE3
+ sigaddset(&block, SIGDIE3);
+# endif
+# ifdef SIGDIE4
+ sigaddset(&block, SIGDIE4);
+# endif
+# ifdef SIGBUS
+ sigaddset(&block, SIGBUS);
+# endif
+ sigemptyset(pmask);
+ pthread_sigmask(SIG_BLOCK, &block, pmask);
+}
+#endif /* !SYS_WINNT */
+
+
+/*
+ * prepare_child_sems()
+ *
+ * create sync events (semaphores)
+ * child_is_blocking initially unset
+ * blocking_req_ready initially unset
+ *
+ * Child waits for blocking_req_ready to be set after
+ * setting child_is_blocking. blocking_req_ready and
+ * blocking_response_ready are auto-reset, so wake one
+ * waiter and become unset (unsignalled) in one operation.
+ */
+static void
+prepare_child_sems(
+ blocking_child *c
+ )
+#ifdef SYS_WINNT
+{
+ if (NULL == c->blocking_req_ready) {
+ /* manual reset using ResetEvent() */
+ /* !!!! c->child_is_blocking = CreateEvent(NULL, TRUE, FALSE, NULL); */
+ /* auto reset - one thread released from wait each set */
+ c->blocking_req_ready = CreateEvent(NULL, FALSE, FALSE, NULL);
+ c->blocking_response_ready = CreateEvent(NULL, FALSE, FALSE, NULL);
+ c->wake_scheduled_sleep = CreateEvent(NULL, FALSE, FALSE, NULL);
+ } else {
+ /* !!!! ResetEvent(c->child_is_blocking); */
+ /* ResetEvent(c->blocking_req_ready); */
+ /* ResetEvent(c->blocking_response_ready); */
+ /* ResetEvent(c->wake_scheduled_sleep); */
+ }
+}
+#else /* pthreads prepare_child_sems() follows */
+{
+ size_t octets;
+
+ if (NULL == c->blocking_req_ready) {
+ octets = sizeof(*c->blocking_req_ready);
+ octets += sizeof(*c->wake_scheduled_sleep);
+ /* !!!! octets += sizeof(*c->child_is_blocking); */
+ c->blocking_req_ready = emalloc_zero(octets);;
+ c->wake_scheduled_sleep = 1 + c->blocking_req_ready;
+ /* !!!! c->child_is_blocking = 1 + c->wake_scheduled_sleep; */
+ } else {
+ sem_destroy(c->blocking_req_ready);
+ sem_destroy(c->wake_scheduled_sleep);
+ /* !!!! sem_destroy(c->child_is_blocking); */
+ }
+ sem_init(c->blocking_req_ready, FALSE, 0);
+ sem_init(c->wake_scheduled_sleep, FALSE, 0);
+ /* !!!! sem_init(c->child_is_blocking, FALSE, 0); */
+}
+#endif
+
+
+static int
+wait_for_sem(
+ sem_ref sem,
+ struct timespec * timeout /* wall-clock */
+ )
+#ifdef SYS_WINNT
+{
+ struct timespec now;
+ struct timespec delta;
+ DWORD msec;
+ DWORD rc;
+
+ if (NULL == timeout) {
+ msec = INFINITE;
+ } else {
+ getclock(TIMEOFDAY, &now);
+ delta = sub_tspec(*timeout, now);
+ if (delta.tv_sec < 0) {
+ msec = 0;
+ } else if ((delta.tv_sec + 1) >= (MAXDWORD / 1000)) {
+ msec = INFINITE;
+ } else {
+ msec = 1000 * (DWORD)delta.tv_sec;
+ msec += delta.tv_nsec / (1000 * 1000);
+ }
+ }
+ rc = WaitForSingleObject(sem, msec);
+ if (WAIT_OBJECT_0 == rc)
+ return 0;
+ if (WAIT_TIMEOUT == rc) {
+ errno = ETIMEDOUT;
+ return -1;
+ }
+ msyslog(LOG_ERR, "WaitForSingleObject unexpected 0x%x", rc);
+ errno = EFAULT;
+ return -1;
+}
+#else /* pthreads wait_for_sem() follows */
+{
+ int rc;
+
+ if (NULL == timeout)
+ rc = sem_wait(sem);
+ else
+ rc = sem_timedwait(sem, timeout);
+
+ return rc;
+}
+#endif
+
+
+/*
+ * blocking_thread - thread functions have WINAPI calling convention
+ */
+#ifdef SYS_WINNT
+u_int
+WINAPI
+#else
+void *
+#endif
+blocking_thread(
+ void * ThreadArg
+ )
+{
+ blocking_child *c;
+
+ c = ThreadArg;
+ exit_worker(blocking_child_common(c));
+
+ /* NOTREACHED */
+ return 0;
+}
+
+
+/*
+ * req_child_exit() runs in the parent.
+ */
+int
+req_child_exit(
+ blocking_child *c
+ )
+{
+ return queue_req_pointer(c, CHILD_EXIT_REQ);
+}
+
+
+/*
+ * cleanup_after_child() runs in parent.
+ */
+static void
+cleanup_after_child(
+ blocking_child * c
+ )
+{
+ u_int idx;
+
+ DEBUG_INSIST(!c->reusable);
+#ifdef SYS_WINNT
+ INSIST(CloseHandle(c->thread_ref));
+#else
+ free(c->thread_ref);
+#endif
+ c->thread_ref = NULL;
+ c->thread_id = 0;
+#ifdef WORK_PIPE
+ DEBUG_INSIST(-1 != c->resp_read_pipe);
+ DEBUG_INSIST(-1 != c->resp_write_pipe);
+ (*addremove_io_fd)(c->resp_read_pipe, c->ispipe, TRUE);
+ close(c->resp_write_pipe);
+ close(c->resp_read_pipe);
+ c->resp_write_pipe = -1;
+ c->resp_read_pipe = -1;
+#else
+ DEBUG_INSIST(NULL != c->blocking_response_ready);
+ (*addremove_io_semaphore)(c->blocking_response_ready, TRUE);
+#endif
+ for (idx = 0; idx < c->workitems_alloc; idx++)
+ c->workitems[idx] = NULL;
+ c->next_workitem = 0;
+ c->next_workeritem = 0;
+ for (idx = 0; idx < c->responses_alloc; idx++)
+ c->responses[idx] = NULL;
+ c->next_response = 0;
+ c->next_workresp = 0;
+ c->reusable = TRUE;
+}
+
+
+#else /* !WORK_THREAD follows */
+char work_thread_nonempty_compilation_unit;
+#endif
diff --git a/libntp/ymd2yd.c b/libntp/ymd2yd.c
new file mode 100644
index 0000000..c6b3a0c
--- /dev/null
+++ b/libntp/ymd2yd.c
@@ -0,0 +1,26 @@
+/*
+ * ymd2yd - compute the date in the year from y/m/d
+ *
+ * A thin wrapper around a more general calendar function.
+ */
+
+#include <config.h>
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+
+int
+ymd2yd(
+ int y,
+ int m,
+ int d)
+{
+ /*
+ * convert y/m/d to elapsed calendar units, convert that to
+ * elapsed days since the start of the given year and convert
+ * back to unity-based day in year.
+ *
+ * This does no further error checking, since the underlying
+ * function is assumed to work out how to handle the data.
+ */
+ return ntpcal_edate_to_yeardays(y-1, m-1, d-1) + 1;
+}
diff --git a/libparse/Makefile.am b/libparse/Makefile.am
new file mode 100644
index 0000000..a92db15
--- /dev/null
+++ b/libparse/Makefile.am
@@ -0,0 +1,145 @@
+NULL=
+BUILT_SOURCES =
+CLEANFILES =
+noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@
+EXTRA_LIBRARIES = libparse.a libparse_kernel.a
+EXTRA_PROGRAMS = parsestreams parsesolaris
+noinst_PROGRAMS = @MAKE_PARSEKMODULE@
+
+K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS
+
+# info_trimble.c was mistakenly created in the build directory
+# previously. It is located in $(srcdir) and any updates must
+# end up there.
+
+libparse_a_SOURCES = parse.c \
+ parse_conf.c \
+ clk_meinberg.c \
+ clk_schmid.c \
+ clk_rawdcf.c \
+ clk_trimtsip.c \
+ clk_dcf7000.c \
+ clk_trimtaip.c \
+ clk_rcc8000.c \
+ clk_hopf6021.c \
+ clk_computime.c \
+ clk_wharton.c \
+ clk_varitext.c \
+ clk_sel240x.c \
+ data_mbg.c \
+ info_trimble.c \
+ trim_info.c \
+ binio.c \
+ ieee754io.c \
+ mfp_mul.c \
+ gpstolfp.c \
+ $(NULL)
+
+libparse_kernel_a_SOURCES =
+libparse_kernel_a_LIBADD = \
+ kparse.o \
+ kparse_conf.o \
+ kclk_computime.o \
+ kclk_dcf7000.o \
+ kclk_hopf6021.o \
+ kclk_meinberg.o \
+ kclk_rawdcf.o \
+ kclk_rcc8000.o \
+ kclk_schmid.o \
+ kclk_trimtaip.o \
+ kclk_trimtsip.o \
+ kclk_varitext.o \
+ kclk_wharton.o \
+ kclk_sel240x.o \
+ kbinio.o \
+ kieee754io.o \
+ kmfp_mul.o \
+ kgpstolfp.o \
+ $(NULL)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += -I$(top_srcdir)/kernel
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c
+
+$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
+ sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new
+ sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new
+ mv -f info_trimble.new $@
+
+kieee754io.o: $(srcdir)/ieee754io.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@
+
+kmfp_mul.o: $(srcdir)/mfp_mul.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/mfp_mul.c -o $@
+
+kgpstolfp.o: $(srcdir)/gpstolfp.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/gpstolfp.c -o $@
+
+kbinio.o: $(srcdir)/binio.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/binio.c -o $@
+
+kclk_computime.o: $(srcdir)/clk_computime.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_computime.c -o $@
+
+kclk_dcf7000.o: $(srcdir)/clk_dcf7000.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_dcf7000.c -o $@
+
+kclk_hopf6021.o: $(srcdir)/clk_hopf6021.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_hopf6021.c -o $@
+
+kclk_meinberg.o: $(srcdir)/clk_meinberg.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_meinberg.c -o $@
+
+kclk_rawdcf.o: $(srcdir)/clk_rawdcf.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rawdcf.c -o $@
+
+kclk_rcc8000.o: $(srcdir)/clk_rcc8000.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rcc8000.c -o $@
+
+kclk_schmid.o: $(srcdir)/clk_schmid.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_schmid.c -o $@
+
+kclk_trimtaip.o: $(srcdir)/clk_trimtaip.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtaip.c -o $@
+
+kclk_trimtsip.o: $(srcdir)/clk_trimtsip.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtsip.c -o $@
+
+kclk_varitext.o: $(srcdir)/clk_varitext.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_varitext.c -o $@
+
+kclk_wharton.o: $(srcdir)/clk_wharton.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_wharton.c -o $@
+
+kclk_sel240x.o: $(srcdir)/clk_sel240x.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_sel240x.c -o $@
+
+kparse.o: $(srcdir)/parse.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse.c -o $@
+
+kparse_conf.o: $(srcdir)/parse_conf.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse_conf.c -o $@
+
+parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+ $(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+
+parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+ $(LD) -r -o $@ $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+
+parsesolaris.o: sys/systm.h
+
+sys/systm.h:
+ -mkdir sys
+ sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h
+
+## check-libparse is invoked by ntpd/Makefile.am
+check-libparse: $(noinst_LIBRARIES)
+ @: do-nothing action to avoid default SCCS get
+
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/libparse/Makefile.in b/libparse/Makefile.in
new file mode 100644
index 0000000..0344c96
--- /dev/null
+++ b/libparse/Makefile.in
@@ -0,0 +1,935 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = parsestreams$(EXEEXT) parsesolaris$(EXEEXT)
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/check-libntp.mf
+subdir = libparse
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+am__v_AR_0 = @echo " AR " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+libparse_a_AR = $(AR) $(ARFLAGS)
+libparse_a_LIBADD =
+am__objects_1 =
+am_libparse_a_OBJECTS = parse.$(OBJEXT) parse_conf.$(OBJEXT) \
+ clk_meinberg.$(OBJEXT) clk_schmid.$(OBJEXT) \
+ clk_rawdcf.$(OBJEXT) clk_trimtsip.$(OBJEXT) \
+ clk_dcf7000.$(OBJEXT) clk_trimtaip.$(OBJEXT) \
+ clk_rcc8000.$(OBJEXT) clk_hopf6021.$(OBJEXT) \
+ clk_computime.$(OBJEXT) clk_wharton.$(OBJEXT) \
+ clk_varitext.$(OBJEXT) clk_sel240x.$(OBJEXT) \
+ data_mbg.$(OBJEXT) info_trimble.$(OBJEXT) trim_info.$(OBJEXT) \
+ binio.$(OBJEXT) ieee754io.$(OBJEXT) mfp_mul.$(OBJEXT) \
+ gpstolfp.$(OBJEXT) $(am__objects_1)
+libparse_a_OBJECTS = $(am_libparse_a_OBJECTS)
+libparse_kernel_a_AR = $(AR) $(ARFLAGS)
+am__DEPENDENCIES_1 =
+libparse_kernel_a_DEPENDENCIES = kparse.o kparse_conf.o \
+ kclk_computime.o kclk_dcf7000.o kclk_hopf6021.o \
+ kclk_meinberg.o kclk_rawdcf.o kclk_rcc8000.o kclk_schmid.o \
+ kclk_trimtaip.o kclk_trimtsip.o kclk_varitext.o kclk_wharton.o \
+ kclk_sel240x.o kbinio.o kieee754io.o kmfp_mul.o kgpstolfp.o \
+ $(am__DEPENDENCIES_1)
+am_libparse_kernel_a_OBJECTS =
+libparse_kernel_a_OBJECTS = $(am_libparse_kernel_a_OBJECTS)
+PROGRAMS = $(noinst_PROGRAMS)
+parsesolaris_SOURCES = parsesolaris.c
+parsesolaris_OBJECTS = parsesolaris.$(OBJEXT)
+parsesolaris_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+parsestreams_SOURCES = parsestreams.c
+parsestreams_OBJECTS = parsestreams.$(OBJEXT)
+parsestreams_LDADD = $(LDADD)
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libparse_a_SOURCES) $(libparse_kernel_a_SOURCES) \
+ parsesolaris.c parsestreams.c
+DIST_SOURCES = $(libparse_a_SOURCES) $(libparse_kernel_a_SOURCES) \
+ parsesolaris.c parsestreams.c
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 = check-libntp .deps-ver
+CLEANFILES = check-libntp .deps-ver
+noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@
+EXTRA_LIBRARIES = libparse.a libparse_kernel.a
+noinst_PROGRAMS = @MAKE_PARSEKMODULE@
+K_CFLAGS = -DPARSESTREAM -DNTP_NEED_BOPS
+
+# info_trimble.c was mistakenly created in the build directory
+# previously. It is located in $(srcdir) and any updates must
+# end up there.
+libparse_a_SOURCES = parse.c \
+ parse_conf.c \
+ clk_meinberg.c \
+ clk_schmid.c \
+ clk_rawdcf.c \
+ clk_trimtsip.c \
+ clk_dcf7000.c \
+ clk_trimtaip.c \
+ clk_rcc8000.c \
+ clk_hopf6021.c \
+ clk_computime.c \
+ clk_wharton.c \
+ clk_varitext.c \
+ clk_sel240x.c \
+ data_mbg.c \
+ info_trimble.c \
+ trim_info.c \
+ binio.c \
+ ieee754io.c \
+ mfp_mul.c \
+ gpstolfp.c \
+ $(NULL)
+
+libparse_kernel_a_SOURCES =
+libparse_kernel_a_LIBADD = \
+ kparse.o \
+ kparse_conf.o \
+ kclk_computime.o \
+ kclk_dcf7000.o \
+ kclk_hopf6021.o \
+ kclk_meinberg.o \
+ kclk_rawdcf.o \
+ kclk_rcc8000.o \
+ kclk_schmid.o \
+ kclk_trimtaip.o \
+ kclk_trimtsip.o \
+ kclk_varitext.o \
+ kclk_wharton.o \
+ kclk_sel240x.o \
+ kbinio.o \
+ kieee754io.o \
+ kmfp_mul.o \
+ kgpstolfp.o \
+ $(NULL)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/kernel $(CPPFLAGS_NTP)
+EXTRA_DIST = parsesolaris.c parsestreams.c mkinfo_scmd.sed mkinfo_rcmd.sed info_trimble.c
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/sntp/check-libntp.mf $(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 libparse/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libparse/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libparse.a: $(libparse_a_OBJECTS) $(libparse_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libparse.a
+ $(AM_V_AR)$(libparse_a_AR) libparse.a $(libparse_a_OBJECTS) $(libparse_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libparse.a
+libparse_kernel.a: $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libparse_kernel.a
+ $(AM_V_AR)$(libparse_kernel_a_AR) libparse_kernel.a $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libparse_kernel.a
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+parsesolaris$(EXEEXT): $(parsesolaris_OBJECTS) $(parsesolaris_DEPENDENCIES)
+ @rm -f parsesolaris$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(parsesolaris_OBJECTS) $(parsesolaris_LDADD) $(LIBS)
+parsestreams$(EXEEXT): $(parsestreams_OBJECTS) $(parsestreams_DEPENDENCIES)
+ @rm -f parsestreams$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(parsestreams_OBJECTS) $(parsestreams_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_computime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_dcf7000.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_hopf6021.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_meinberg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rawdcf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_rcc8000.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_schmid.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_sel240x.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtaip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_trimtsip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_varitext.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clk_wharton.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_mbg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpstolfp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ieee754io.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_trimble.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mfp_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_conf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsesolaris.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsestreams.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim_info.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS)
+installdirs:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLIBRARIES clean-noinstPROGRAMS ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+$(srcdir)/info_trimble.c: $(top_srcdir)/include/trimble.h $(srcdir)/Makefile.am $(srcdir)/mkinfo_scmd.sed $(srcdir)/mkinfo_rcmd.sed
+ sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.new
+ sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.new
+ mv -f info_trimble.new $@
+
+kieee754io.o: $(srcdir)/ieee754io.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@
+
+kmfp_mul.o: $(srcdir)/mfp_mul.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/mfp_mul.c -o $@
+
+kgpstolfp.o: $(srcdir)/gpstolfp.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/gpstolfp.c -o $@
+
+kbinio.o: $(srcdir)/binio.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/binio.c -o $@
+
+kclk_computime.o: $(srcdir)/clk_computime.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_computime.c -o $@
+
+kclk_dcf7000.o: $(srcdir)/clk_dcf7000.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_dcf7000.c -o $@
+
+kclk_hopf6021.o: $(srcdir)/clk_hopf6021.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_hopf6021.c -o $@
+
+kclk_meinberg.o: $(srcdir)/clk_meinberg.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_meinberg.c -o $@
+
+kclk_rawdcf.o: $(srcdir)/clk_rawdcf.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rawdcf.c -o $@
+
+kclk_rcc8000.o: $(srcdir)/clk_rcc8000.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_rcc8000.c -o $@
+
+kclk_schmid.o: $(srcdir)/clk_schmid.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_schmid.c -o $@
+
+kclk_trimtaip.o: $(srcdir)/clk_trimtaip.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtaip.c -o $@
+
+kclk_trimtsip.o: $(srcdir)/clk_trimtsip.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_trimtsip.c -o $@
+
+kclk_varitext.o: $(srcdir)/clk_varitext.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_varitext.c -o $@
+
+kclk_wharton.o: $(srcdir)/clk_wharton.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_wharton.c -o $@
+
+kclk_sel240x.o: $(srcdir)/clk_sel240x.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_sel240x.c -o $@
+
+kparse.o: $(srcdir)/parse.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse.c -o $@
+
+kparse_conf.o: $(srcdir)/parse_conf.c
+ $(COMPILE) $(K_CFLAGS) -c $(srcdir)/parse_conf.c -o $@
+
+parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+ $(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+
+parse: $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+ $(LD) -r -o $@ $(parsesolaris_OBJECTS) libparse_kernel.a ../libntp/libntp.a
+
+parsesolaris.o: sys/systm.h
+
+sys/systm.h:
+ -mkdir sys
+ sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h
+
+check-libparse: $(noinst_LIBRARIES)
+ @: do-nothing action to avoid default SCCS get
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/libparse/README b/libparse/README
new file mode 100644
index 0000000..ac77054
--- /dev/null
+++ b/libparse/README
@@ -0,0 +1,96 @@
+PARSE reference clock driver:
+
+This directory contains the files making up the parser for
+the parse refclock driver. For reasonably sane clocks this refclock
+drivers allows a refclock implementation by just providing a
+conversion routine and the appropriate NTP parameters. Refclock
+support can run as low a 3k code with the parse refclock driver.
+
+The modules in here are designed to live in two worlds. In userlevel
+as part of the xntp daemon and in kernel land as part of a STREAMS module
+or, if someone gets to it, as part of a line discipline. Currently only
+SunOS4.x/SunOS5.x STREAMS are supported (volunteers for other vendors like HP?).
+This structure means, that refclock_parse can work with or without kernel
+support. Kernelsupport increases accuracy tremendingly. The current restriction
+of the parse driver is that it only supports SYSV type ttys and that kernel
+support is only available for Suns right now.
+
+Three kernel modules are part of this directory. These work only on
+SunOS (SunOS4 and SunOS5).
+
+ SunOS4 (aka Solaris 1.x):
+ parsestreams.loadable_module.o - standard parse module for SunOS 4
+
+ Both modules can be loaded via modload <modulename>.
+
+ SunOS5 (aka Solaris 2.x):
+ parse - auto loadable streams module
+
+ To install just drop "parse" into /kernel/strmod and
+ start the daemon (SunOS5 will do the rest).
+
+The structure of the parse reference clock driver is as follows:
+
+ ntpd - contains NTP implementation and calls a reference clock
+ 127.127.8.x which is implemented by
+ refclock_parse.c
+ - which contains several refclock decriptions. These are
+ selected by the x part of the refclock address.
+ The lower two bits specify the device to use. Thus the
+ value (x % 4) determines the device to open
+ (/dev/refclock-0 - /dev/refclock-3).
+
+ The kind of clock is selected by the mode parameter. This parameter
+ selects the clock type which deterimines how I/O is done,
+ the tty parameters and the NTP parameters.
+
+ refclock_parse operates on an abstract reference clock
+ that delivers time stamps and stati. Offsets and sychron-
+ isation information is derived from this data and passed
+ on to refclock_receive of xntp which uses that data for
+ syncronisation.
+
+ The abstract reference clock is generated by the parse*
+ routines. They parse the incoming data stream from the
+ clock and convert it to the appropriate time stamps.
+ The data is also mapped int the abstract clock states
+ POWERUP - clock has no valid phase and time code
+ information
+
+ NOSYNC - Time code is not confirmed, phase is probably
+ ok.
+ SYNC - Time code and phase are correct.
+
+ A clock is trusted for a certain time (type parameter) when
+ it leaves the SYNC state. This is derived from the
+ observation that quite a few clocks can still generate good
+ time code information when losing contact to their
+ synchronisation source. When the clock does not reagain
+ synchronisation in that trust period it will be deemed
+ unsynchronised until it regains synchronisation. The same
+ will happen if xntp sees the clock unsynchronised at
+ startup.
+
+ The upper bit of x specifies that all samples delivered
+ from the clock should be used to discipline the NTP
+ loopfilter. For clock with accurate once a second time
+ information this means big improvements for time keeping.
+ A prerequisite for passing on the time stamps to
+ the loopfilter is, that the clock is in synchronised state.
+
+ parse.c These are the general routines to parse the incoming data
+ stream. Usually these routines should not require
+ modification.
+
+ clk_*.c These files hole the conversion code for the time stamps
+ and the description how the time code can be parsed and
+ where the time stamps are to be taken.
+ If you want to add a new clock type this is the file
+ you need to write in addition to mention it in
+ parse_conf.c and setting up the NTP and TTY parameters
+ in refclock_parse.c.
+
+Further information can be found in parse/README.parse and the various source
+files.
+
+Frank Kardel
diff --git a/libparse/binio.c b/libparse/binio.c
new file mode 100644
index 0000000..24aa286
--- /dev/null
+++ b/libparse/binio.c
@@ -0,0 +1,156 @@
+/*
+ * /src/NTP/ntp4-dev/libntp/binio.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * binio.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Jul 20 12:55:33 1997 $
+ *
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+#include "binio.h"
+
+long
+get_lsb_short(
+ unsigned char **bufpp
+ )
+{
+ long retval;
+
+ retval = *((*bufpp)++);
+ retval |= *((*bufpp)++) << 8;
+
+ return (retval & 0x8000) ? (~0xFFFF | retval) : retval;
+}
+
+void
+put_lsb_short(
+ unsigned char **bufpp,
+ long val
+ )
+{
+ *((*bufpp)++) = (unsigned char) (val & 0xFF);
+ *((*bufpp)++) = (unsigned char) ((val >> 8) & 0xFF);
+}
+
+long
+get_lsb_long(
+ unsigned char **bufpp
+ )
+{
+ long retval;
+
+ retval = *((*bufpp)++);
+ retval |= *((*bufpp)++) << 8;
+ retval |= *((*bufpp)++) << 16;
+ retval |= (u_long)*((*bufpp)++) << 24;
+
+ return retval;
+}
+
+void
+put_lsb_long(
+ unsigned char **bufpp,
+ long val
+ )
+{
+ *((*bufpp)++) = (unsigned char)(val & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 8) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 16) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 24) & 0xFF);
+}
+
+long
+get_msb_short(
+ unsigned char **bufpp
+ )
+{
+ long retval;
+
+ retval = *((*bufpp)++) << 8;
+ retval |= *((*bufpp)++);
+
+ return (retval & 0x8000) ? (~0xFFFF | retval) : retval;
+}
+
+void
+put_msb_short(
+ unsigned char **bufpp,
+ long val
+ )
+{
+ *((*bufpp)++) = (unsigned char)((val >> 8) & 0xFF);
+ *((*bufpp)++) = (unsigned char)( val & 0xFF);
+}
+
+long
+get_msb_long(
+ unsigned char **bufpp
+ )
+{
+ long retval;
+
+ retval = (u_long)*((*bufpp)++) << 24;
+ retval |= *((*bufpp)++) << 16;
+ retval |= *((*bufpp)++) << 8;
+ retval |= *((*bufpp)++);
+
+ return retval;
+}
+
+void
+put_msb_long(
+ unsigned char **bufpp,
+ long val
+ )
+{
+ *((*bufpp)++) = (unsigned char)((val >> 24) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 16) & 0xFF);
+ *((*bufpp)++) = (unsigned char)((val >> 8 ) & 0xFF);
+ *((*bufpp)++) = (unsigned char)( val & 0xFF);
+}
+
+/*
+ * binio.c,v
+ * Revision 4.2 1999/02/21 12:17:34 kardel
+ * 4.91f reconcilation
+ *
+ * Revision 4.1 1998/06/28 16:47:50 kardel
+ * added {get,put}_msb_{short,long} functions
+ *
+ * Revision 4.0 1998/04/10 19:46:16 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.1 1998/04/10 19:27:46 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ *
+ * Revision 1.1 1997/10/06 21:05:46 kardel
+ * new parse structure
+ *
+ */
diff --git a/libparse/clk_computime.c b/libparse/clk_computime.c
new file mode 100644
index 0000000..1068576
--- /dev/null
+++ b/libparse/clk_computime.c
@@ -0,0 +1,219 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_COMPUTIME)
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * clk_computime.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * Supports Diem's Computime Radio Clock
+ *
+ * Used the Meinberg clock as a template for Diem's Computime Radio Clock
+ *
+ * adapted by Alois Camenzind <alois.camenzind@ubs.ch>
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+extern int printf (const char *, ...);
+#endif
+
+/*
+ * The Computime receiver sends a datagram in the following format every minute
+ *
+ * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF
+ * Pos 0123456789012345678901 2 3
+ * 0000000000111111111122 2 2
+ * Parse T: : : : : : : rn
+ *
+ * T Startcharacter "T" specifies start of the timestamp
+ * YY Year MM Month 1-12
+ * MD Day of the month
+ * WD Day of week
+ * HH Hour
+ * MM Minute
+ * SS Second
+ * CR Carriage return
+ * LF Linefeed
+ *
+ */
+
+static struct format computime_fmt =
+{
+ {
+ {8, 2}, {5, 2}, {2, 2}, /* day, month, year */
+ {14, 2}, {17, 2}, {20, 2}, /* hour, minute, second */
+ {11, 2}, /* dayofweek, */
+ },
+ (const unsigned char *)"T: : : : : : : \r\n",
+ 0
+};
+
+static u_long cvt_computime (unsigned char *, int, struct format *, clocktime_t *, void *);
+static unsigned long inp_computime (parse_t *, unsigned int, timestamp_t *);
+
+clockformat_t clock_computime =
+{
+ inp_computime, /* Computime input handling */
+ cvt_computime, /* Computime conversion */
+ 0, /* no PPS monitoring */
+ (void *)&computime_fmt, /* conversion configuration */
+ "Diem's Computime Radio Clock", /* Computime Radio Clock */
+ 24, /* string buffer */
+ 0 /* no private data (complete pakets) */
+};
+
+/*
+ * cvt_computime
+ *
+ * convert simple type format
+ */
+static u_long
+cvt_computime(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+
+ if (!Strok(buffer, format->fixed_string)) {
+ return CVT_NONE;
+ } else {
+ if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day,
+ format->field_offsets[O_DAY].length) ||
+ Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month,
+ format->field_offsets[O_MONTH].length) ||
+ Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year,
+ format->field_offsets[O_YEAR].length) ||
+ Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour,
+ format->field_offsets[O_HOUR].length) ||
+ Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute,
+ format->field_offsets[O_MIN].length) ||
+ Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second,
+ format->field_offsets[O_SEC].length)) {
+ return CVT_FAIL | CVT_BADFMT;
+ } else {
+
+ clock_time->flags = 0;
+ clock_time->utcoffset = 0; /* We have UTC time */
+
+ return CVT_OK;
+ }
+ }
+}
+
+/*
+ * inp_computime
+ *
+ * grep data from input stream
+ */
+static u_long
+inp_computime(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("inp_computime(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case 'T':
+ parseprintf(DD_PARSE, ("inp_computime: START seen\n"));
+
+ parseio->parse_index = 1;
+ parseio->parse_data[0] = ch;
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ return PARSE_INP_SKIP;
+
+ case '\n':
+ parseprintf(DD_PARSE, ("inp_computime: END seen\n"));
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+ default:
+ return parse_addchar(parseio, ch);
+ }
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_COMPUTIME) */
+int clk_computime_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_COMPUTIME) */
+
+/*
+ * clk_computime.c,v
+ * Revision 4.10 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.9 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.6 1999/11/28 09:13:49 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.5 1998/06/14 21:09:34 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.4 1998/06/13 12:00:38 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:26 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/06/12 09:13:24 kardel
+ * conditional compile macros fixed
+ * printf prototype
+ *
+ * Revision 4.1 1998/05/24 09:39:51 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:27 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 1.8 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/clk_dcf7000.c b/libparse/clk_dcf7000.c
new file mode 100644
index 0000000..bfd9a74
--- /dev/null
+++ b/libparse/clk_dcf7000.c
@@ -0,0 +1,214 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * clk_dcf7000.c,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * ELV DCF7000 module
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_DCF7000)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+extern int printf (const char *, ...);
+#endif
+
+static struct format dcf7000_fmt =
+{ /* ELV DCF7000 */
+ {
+ { 6, 2}, { 3, 2}, { 0, 2},
+ { 12, 2}, { 15, 2}, { 18, 2},
+ { 9, 2}, { 21, 2},
+ },
+ (const unsigned char *)" - - - - - - - \r",
+ 0
+};
+static u_long cvt_dcf7000 (unsigned char *, int, struct format *, clocktime_t *, void *);
+static unsigned long inp_dcf7000 (parse_t *, unsigned int, timestamp_t *);
+
+clockformat_t clock_dcf7000 =
+{
+ inp_dcf7000, /* DCF7000 input handling */
+ cvt_dcf7000, /* ELV DCF77 conversion */
+ 0, /* no direct PPS monitoring */
+ (void *)&dcf7000_fmt, /* conversion configuration */
+ "ELV DCF7000", /* ELV clock */
+ 24, /* string buffer */
+ 0 /* no private data (complete pakets) */
+};
+
+/*
+ * cvt_dcf7000
+ *
+ * convert dcf7000 type format
+ */
+static u_long
+cvt_dcf7000(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ if (!Strok(buffer, format->fixed_string))
+ {
+ return CVT_NONE;
+ }
+ else
+ {
+ if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day,
+ format->field_offsets[O_DAY].length) ||
+ Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month,
+ format->field_offsets[O_MONTH].length) ||
+ Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year,
+ format->field_offsets[O_YEAR].length) ||
+ Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour,
+ format->field_offsets[O_HOUR].length) ||
+ Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute,
+ format->field_offsets[O_MIN].length) ||
+ Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second,
+ format->field_offsets[O_SEC].length))
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ else
+ {
+ unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset];
+ long flags;
+
+ clock_time->flags = 0;
+ clock_time->usecond = 0;
+
+ if (Stoi(f, &flags, format->field_offsets[O_FLAGS].length))
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ else
+ {
+ if (flags & 0x1)
+ clock_time->utcoffset = -2*60*60;
+ else
+ clock_time->utcoffset = -1*60*60;
+
+ if (flags & 0x2)
+ clock_time->flags |= PARSEB_ANNOUNCE;
+
+ if (flags & 0x4)
+ clock_time->flags |= PARSEB_NOSYNC;
+ }
+ return CVT_OK;
+ }
+ }
+}
+
+/*
+ * inp_dcf700
+ *
+ * grep data from input stream
+ */
+static u_long
+inp_dcf7000(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("inp_dcf7000(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case '\r':
+ parseprintf(DD_PARSE, ("inp_dcf7000: EOL seen\n"));
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+ default:
+ return parse_addchar(parseio, ch);
+ }
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_DCF7000) */
+int clk_dcf7000_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_DCF7000) */
+
+/*
+ * History:
+ *
+ * clk_dcf7000.c,v
+ * Revision 4.10 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.9 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.6 1999/11/28 09:13:49 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.5 1998/06/14 21:09:34 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.4 1998/06/13 12:01:59 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:27 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/06/12 09:13:24 kardel
+ * conditional compile macros fixed
+ * printf prototype
+ *
+ * Revision 4.1 1998/05/24 09:39:51 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:28 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.18 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/clk_hopf6021.c b/libparse/clk_hopf6021.c
new file mode 100644
index 0000000..033d2d2
--- /dev/null
+++ b/libparse/clk_hopf6021.c
@@ -0,0 +1,283 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_hopf6021.c,v 4.10 2004/11/14 15:29:41 kardel RELEASE_20050508_A
+ *
+ * clk_hopf6021.c,v 4.10 2004/11/14 15:29:41 kardel RELEASE_20050508_A
+ *
+ * Radiocode Clocks HOPF Funkuhr 6021 mit serieller Schnittstelle
+ * base code version from 24th Nov 1995 - history at end
+ *
+ * Created by F.Schnekenbuehl <frank@comsys.dofn.de> from clk_rcc8000.c
+ * Nortel DASA Network Systems GmbH, Department: ND250
+ * A Joint venture of Daimler-Benz Aerospace and Nortel
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_HOPF6021)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+#include "ascii.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+extern int printf (const char *, ...);
+#endif
+
+/*
+ * hopf Funkuhr 6021
+ * used with 9600,8N1,
+ * UTC ueber serielle Schnittstelle
+ * Sekundenvorlauf ON
+ * ETX zum Sekundenvorlauf ON
+ * Datenstring 6021
+ * Ausgabe Uhrzeit und Datum
+ * Senden mit Steuerzeichen
+ * Senden sekuendlich
+ */
+
+/*
+ * Type 6021 Serial Output format
+ *
+ * 000000000011111111 / char
+ * 012345678901234567 \ position
+ * sABHHMMSSDDMMYYnre Actual
+ * C4110046231195 Parse
+ * s enr Check
+ *
+ * s = STX (0x02), e = ETX (0x03)
+ * n = NL (0x0A), r = CR (0x0D)
+ *
+ * A B - Status and weekday
+ *
+ * A - Status
+ *
+ * 8 4 2 1
+ * x x x 0 - no announcement
+ * x x x 1 - Summertime - wintertime - summertime announcement
+ * x x 0 x - Wintertime
+ * x x 1 x - Summertime
+ * 0 0 x x - Time/Date invalid
+ * 0 1 x x - Internal clock used
+ * 1 0 x x - Radio clock
+ * 1 1 x x - Radio clock highprecision
+ *
+ * B - 8 4 2 1
+ * 0 x x x - MESZ/MEZ
+ * 1 x x x - UTC
+ * x 0 0 1 - Monday
+ * x 0 1 0 - Tuesday
+ * x 0 1 1 - Wednesday
+ * x 1 0 0 - Thursday
+ * x 1 0 1 - Friday
+ * x 1 1 0 - Saturday
+ * x 1 1 1 - Sunday
+ */
+
+#define HOPF_DSTWARN 0x01 /* DST switch warning */
+#define HOPF_DST 0x02 /* DST in effect */
+
+#define HOPF_MODE 0x0C /* operation mode mask */
+#define HOPF_INVALID 0x00 /* no time code available */
+#define HOPF_INTERNAL 0x04 /* internal clock */
+#define HOPF_RADIO 0x08 /* radio clock */
+#define HOPF_RADIOHP 0x0C /* high precision radio clock */
+
+#define HOPF_UTC 0x08 /* time code in UTC */
+#define HOPF_WMASK 0x07 /* mask for weekday code */
+
+static struct format hopf6021_fmt =
+{
+ {
+ { 9, 2 }, {11, 2}, { 13, 2}, /* Day, Month, Year */
+ { 3, 2 }, { 5, 2}, { 7, 2}, /* Hour, Minute, Second */
+ { 2, 1 }, { 1, 1}, { 0, 0}, /* Weekday, Flags, Zone */
+ /* ... */
+ },
+ (const unsigned char *)"\002 \n\r\003",
+ 0
+};
+
+#define OFFS(x) format->field_offsets[(x)].offset
+#define STOI(x, y) Stoi(&buffer[OFFS(x)], y, format->field_offsets[(x)].length)
+#define hexval(x) (('0' <= (x) && (x) <= '9') ? (x) - '0' : \
+ ('a' <= (x) && (x) <= 'f') ? (x) - 'a' + 10 : \
+ ('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \
+ -1)
+
+static unsigned long cvt_hopf6021 (unsigned char *, int, struct format *, clocktime_t *, void *);
+static unsigned long inp_hopf6021 (parse_t *, unsigned int, timestamp_t *);
+
+clockformat_t clock_hopf6021 =
+{
+ inp_hopf6021, /* HOPF 6021 input handling */
+ cvt_hopf6021, /* Radiocode clock conversion */
+ 0, /* no direct PPS monitoring */
+ (void *)&hopf6021_fmt, /* conversion configuration */
+ "hopf Funkuhr 6021", /* clock format name */
+ 19, /* string buffer */
+ 0 /* private data length, no private data */
+};
+
+static unsigned long
+cvt_hopf6021(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ unsigned char status,weekday;
+
+ if (!Strok(buffer, format->fixed_string))
+ {
+ return CVT_NONE;
+ }
+
+ if ( STOI(O_DAY, &clock_time->day) ||
+ STOI(O_MONTH, &clock_time->month) ||
+ STOI(O_YEAR, &clock_time->year) ||
+ STOI(O_HOUR, &clock_time->hour) ||
+ STOI(O_MIN, &clock_time->minute) ||
+ STOI(O_SEC, &clock_time->second)
+ )
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ clock_time->usecond = 0;
+ clock_time->utcoffset = 0;
+
+ status = hexval(buffer[OFFS(O_FLAGS)]);
+ weekday= hexval(buffer[OFFS(O_WDAY)]);
+
+ if ((status == 0xFF) || (weekday == 0xFF))
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ clock_time->flags = 0;
+
+ if (weekday & HOPF_UTC)
+ {
+ clock_time->flags |= PARSEB_UTC;
+ }
+ else
+ {
+ if (status & HOPF_DST)
+ {
+ clock_time->flags |= PARSEB_DST;
+ clock_time->utcoffset = -2*60*60; /* MET DST */
+ }
+ else
+ {
+ clock_time->utcoffset = -1*60*60; /* MET */
+ }
+ }
+
+ clock_time->flags |= (status & HOPF_DSTWARN) ? PARSEB_ANNOUNCE : 0;
+
+ switch (status & HOPF_MODE)
+ {
+ case HOPF_INVALID: /* Time/Date invalid */
+ clock_time->flags |= PARSEB_POWERUP;
+ break;
+
+ case HOPF_INTERNAL: /* internal clock */
+ clock_time->flags |= PARSEB_NOSYNC;
+ break;
+
+ case HOPF_RADIO: /* Radio clock */
+ case HOPF_RADIOHP: /* Radio clock high precision */
+ break;
+
+ default:
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ return CVT_OK;
+}
+
+/*
+ * inp_hopf6021
+ *
+ * grep data from input stream
+ */
+static u_long
+inp_hopf6021(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("inp_hopf6021(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case ETX:
+ parseprintf(DD_PARSE, ("inp_hopf6021: EOL seen\n"));
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+ default:
+ return parse_addchar(parseio, ch);
+ }
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_HOPF6021) */
+int clk_hopf6021_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_HOPF6021) */
+
+/*
+ * History:
+ *
+ * clk_hopf6021.c,v
+ * Revision 4.10 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.7 1999/11/28 09:13:49 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.6 1998/11/15 20:27:57 kardel
+ * Release 4.0.73e13 reconcilation
+ *
+ * Revision 4.5 1998/06/14 21:09:35 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.4 1998/06/13 12:02:38 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:27 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/06/12 09:13:25 kardel
+ * conditional compile macros fixed
+ * printf prototype
+ *
+ * Revision 4.1 1998/05/24 09:39:52 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:29 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.6 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/clk_meinberg.c b/libparse/clk_meinberg.c
new file mode 100644
index 0000000..bc0ac0e
--- /dev/null
+++ b/libparse/clk_meinberg.c
@@ -0,0 +1,776 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A
+ *
+ * clk_meinberg.c,v 4.12.2.1 2005/09/25 10:22:35 kardel RELEASE_20050925_A
+ *
+ * Meinberg clock support
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_MEINBERG)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "ntp_machine.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+#endif
+
+#include "ntp_stdlib.h"
+
+#include "ntp_stdlib.h"
+
+#include "mbg_gps166.h"
+#include "binio.h"
+#include "ascii.h"
+
+/*
+ * The Meinberg receiver every second sends a datagram of the following form
+ * (Standard Format)
+ *
+ * <STX>D:<dd>.<mm>.<yy>;T:<w>;U:<hh>:<mm>:<ss>;<S><F><D><A><ETX>
+ * pos: 0 00 00 0 00 0 11 111 1 111 12 2 22 2 22 2 2 2 3 3 3
+ * 1 23 45 6 78 9 01 234 5 678 90 1 23 4 56 7 8 9 0 1 2
+ * <STX> = '\002' ASCII start of text
+ * <ETX> = '\003' ASCII end of text
+ * <dd>,<mm>,<yy> = day, month, year(2 digits!!)
+ * <w> = day of week (sunday= 0)
+ * <hh>,<mm>,<ss> = hour, minute, second
+ * <S> = '#' if never synced since powerup for DCF C51
+ * = '#' if not PZF sychronisation available for PZF 535/509
+ * = ' ' if ok
+ * <F> = '*' if time comes from internal quartz
+ * = ' ' if completely synched
+ * <D> = 'S' if daylight saving time is active
+ * = 'U' if time is represented in UTC
+ * = ' ' if no special condition exists
+ * <A> = '!' during the hour preceeding an daylight saving time
+ * start/end change
+ * = 'A' leap second insert warning
+ * = ' ' if no special condition exists
+ *
+ * Extended data format (PZFUERL for PZF type clocks)
+ *
+ * <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <U><S><F><D><A><L><R><ETX>
+ * pos: 0 00 0 00 0 00 11 1 11 11 1 11 2 22 22 2 2 2 2 2 3 3 3
+ * 1 23 4 56 7 89 01 2 34 56 7 89 0 12 34 5 6 7 8 9 0 1 2
+ * <STX> = '\002' ASCII start of text
+ * <ETX> = '\003' ASCII end of text
+ * <dd>,<mm>,<yy> = day, month, year(2 digits!!)
+ * <w> = day of week (sunday= 0)
+ * <hh>,<mm>,<ss> = hour, minute, second
+ * <U> = 'U' UTC time display
+ * <S> = '#' if never synced since powerup else ' ' for DCF C51
+ * '#' if not PZF sychronisation available else ' ' for PZF 535/509
+ * <F> = '*' if time comes from internal quartz else ' '
+ * <D> = 'S' if daylight saving time is active else ' '
+ * <A> = '!' during the hour preceeding an daylight saving time
+ * start/end change
+ * <L> = 'A' LEAP second announcement
+ * <R> = 'R' alternate antenna
+ *
+ * Meinberg GPS166 receiver
+ *
+ * You must get the Uni-Erlangen firmware for the GPS receiver support
+ * to work to full satisfaction !
+ *
+ * <STX><dd>.<mm>.<yy>; <w>; <hh>:<mm>:<ss>; <+/-><00:00>; <U><S><F><D><A><L><R><L>; <position...><ETX>
+ *
+ * 000000000111111111122222222223333333333444444444455555555556666666
+ * 123456789012345678901234567890123456789012345678901234567890123456
+ * \x0209.07.93; 5; 08:48:26; +00:00; #*S!A L; 49.5736N 11.0280E 373m\x03
+ *
+ *
+ * <STX> = '\002' ASCII start of text
+ * <ETX> = '\003' ASCII end of text
+ * <dd>,<mm>,<yy> = day, month, year(2 digits!!)
+ * <w> = day of week (sunday= 0)
+ * <hh>,<mm>,<ss> = hour, minute, second
+ * <+/->,<00:00> = offset to UTC
+ * <S> = '#' if never synced since powerup else ' '
+ * <F> = '*' if position is not confirmed else ' '
+ * <D> = 'S' if daylight saving time is active else ' '
+ * <A> = '!' during the hour preceeding an daylight saving time
+ * start/end change
+ * <L> = 'A' LEAP second announcement
+ * <R> = 'R' alternate antenna (reminiscent of PZF535) usually ' '
+ * <L> = 'L' on 23:59:60
+ *
+ * Binary messages have a lead in for a fixed header of SOH
+ */
+
+/*--------------------------------------------------------------*/
+/* Name: csum() */
+/* */
+/* Purpose: Compute a checksum about a number of bytes */
+/* */
+/* Input: uchar *p address of the first byte */
+/* short n the number of bytes */
+/* */
+/* Output: -- */
+/* */
+/* Ret val: the checksum */
+/*+-------------------------------------------------------------*/
+
+unsigned long
+mbg_csum(
+ unsigned char *p,
+ unsigned int n
+ )
+{
+ unsigned long sum = 0;
+ short i;
+
+ for ( i = 0; i < n; i++ )
+ sum += *p++;
+
+ return( sum );
+} /* csum */
+
+void
+get_mbg_header(
+ unsigned char **bufpp,
+ GPS_MSG_HDR *headerp
+ )
+{
+ headerp->gps_cmd = get_lsb_short(bufpp);
+ headerp->gps_len = get_lsb_short(bufpp);
+ headerp->gps_data_csum = get_lsb_short(bufpp);
+ headerp->gps_hdr_csum = get_lsb_short(bufpp);
+}
+
+static struct format meinberg_fmt[] =
+{
+ {
+ {
+ { 3, 2}, { 6, 2}, { 9, 2},
+ { 18, 2}, { 21, 2}, { 24, 2},
+ { 14, 1}, { 27, 4}, { 29, 1},
+ },
+ (const unsigned char *)"\2D: . . ;T: ;U: . . ; \3",
+ 0
+ },
+ { /* special extended FAU Erlangen extended format */
+ {
+ { 1, 2}, { 4, 2}, { 7, 2},
+ { 14, 2}, { 17, 2}, { 20, 2},
+ { 11, 1}, { 25, 4}, { 27, 1},
+ },
+ (const unsigned char *)"\2 . . ; ; : : ; \3",
+ MBG_EXTENDED
+ },
+ { /* special extended FAU Erlangen GPS format */
+ {
+ { 1, 2}, { 4, 2}, { 7, 2},
+ { 14, 2}, { 17, 2}, { 20, 2},
+ { 11, 1}, { 32, 7}, { 35, 1},
+ { 25, 2}, { 28, 2}, { 24, 1}
+ },
+ (const unsigned char *)"\2 . . ; ; : : ; : ; ; . . ",
+ 0
+ }
+};
+
+static u_long cvt_meinberg (unsigned char *, int, struct format *, clocktime_t *, void *);
+static u_long cvt_mgps (unsigned char *, int, struct format *, clocktime_t *, void *);
+static u_long mbg_input (parse_t *, unsigned int, timestamp_t *);
+static u_long gps_input (parse_t *, unsigned int, timestamp_t *);
+
+struct msg_buf
+{
+ unsigned short len; /* len to fill */
+ unsigned short phase; /* current input phase */
+};
+
+#define MBG_NONE 0 /* no data input */
+#define MBG_HEADER 1 /* receiving header */
+#define MBG_DATA 2 /* receiving data */
+#define MBG_STRING 3 /* receiving standard data message */
+
+clockformat_t clock_meinberg[] =
+{
+ {
+ mbg_input, /* normal input handling */
+ cvt_meinberg, /* Meinberg conversion */
+ pps_one, /* easy PPS monitoring */
+ 0, /* conversion configuration */
+ "Meinberg Standard", /* Meinberg simple format - beware */
+ 32, /* string buffer */
+ 0 /* no private data (complete pakets) */
+ },
+ {
+ mbg_input, /* normal input handling */
+ cvt_meinberg, /* Meinberg conversion */
+ pps_one, /* easy PPS monitoring */
+ 0, /* conversion configuration */
+ "Meinberg Extended", /* Meinberg enhanced format */
+ 32, /* string buffer */
+ 0 /* no private data (complete pakets) */
+ },
+ {
+ gps_input, /* no input handling */
+ cvt_mgps, /* Meinberg GPS166 conversion */
+ pps_one, /* easy PPS monitoring */
+ (void *)&meinberg_fmt[2], /* conversion configuration */
+ "Meinberg GPS Extended", /* Meinberg FAU GPS format */
+ 512, /* string buffer */
+ sizeof(struct msg_buf) /* no private data (complete pakets) */
+ }
+};
+
+/*
+ * cvt_meinberg
+ *
+ * convert simple type format
+ */
+static u_long
+cvt_meinberg(
+ unsigned char *buffer,
+ int size,
+ struct format *unused,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ struct format *format;
+
+ /*
+ * select automagically correct data format
+ */
+ if (Strok(buffer, meinberg_fmt[0].fixed_string))
+ {
+ format = &meinberg_fmt[0];
+ }
+ else
+ {
+ if (Strok(buffer, meinberg_fmt[1].fixed_string))
+ {
+ format = &meinberg_fmt[1];
+ }
+ else
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ }
+
+ /*
+ * collect data
+ */
+ if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day,
+ format->field_offsets[O_DAY].length) ||
+ Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month,
+ format->field_offsets[O_MONTH].length) ||
+ Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year,
+ format->field_offsets[O_YEAR].length) ||
+ Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour,
+ format->field_offsets[O_HOUR].length) ||
+ Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute,
+ format->field_offsets[O_MIN].length) ||
+ Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second,
+ format->field_offsets[O_SEC].length))
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ else
+ {
+ unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset];
+
+ clock_time->usecond = 0;
+ clock_time->flags = PARSEB_S_LEAP;
+
+ if (clock_time->second == 60)
+ clock_time->flags |= PARSEB_LEAPSECOND;
+
+ /*
+ * in the extended timecode format we have also the
+ * indication that the timecode is in UTC
+ * for compatibilty reasons we start at the USUAL
+ * offset (POWERUP flag) and know that the UTC indication
+ * is the character before the powerup flag
+ */
+ if ((format->flags & MBG_EXTENDED) && (f[-1] == 'U'))
+ {
+ /*
+ * timecode is in UTC
+ */
+ clock_time->utcoffset = 0; /* UTC */
+ clock_time->flags |= PARSEB_UTC;
+ }
+ else
+ {
+ /*
+ * only calculate UTC offset if MET/MED is in time code
+ * or we have the old time code format, where we do not
+ * know whether it is UTC time or MET/MED
+ * pray that nobody switches to UTC in the *old* standard time code
+ * ROMS !!!! The new ROMS have 'U' at the ZONE field - good.
+ */
+ switch (buffer[format->field_offsets[O_ZONE].offset])
+ {
+ case ' ':
+ clock_time->utcoffset = -1*60*60; /* MET */
+ break;
+
+ case 'S':
+ clock_time->utcoffset = -2*60*60; /* MED */
+ break;
+
+ case 'U':
+ /*
+ * timecode is in UTC
+ */
+ clock_time->utcoffset = 0; /* UTC */
+ clock_time->flags |= PARSEB_UTC;
+ break;
+
+ default:
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ }
+
+ /*
+ * gather status flags
+ */
+ if (buffer[format->field_offsets[O_ZONE].offset] == 'S')
+ clock_time->flags |= PARSEB_DST;
+
+ if (f[0] == '#')
+ clock_time->flags |= PARSEB_POWERUP;
+
+ if (f[1] == '*')
+ clock_time->flags |= PARSEB_NOSYNC;
+
+ if (f[3] == '!')
+ clock_time->flags |= PARSEB_ANNOUNCE;
+
+ /*
+ * oncoming leap second
+ * 'a' code not confirmed - earth is not
+ * expected to speed up
+ */
+ if (f[3] == 'A')
+ clock_time->flags |= PARSEB_LEAPADD;
+
+ if (f[3] == 'a')
+ clock_time->flags |= PARSEB_LEAPDEL;
+
+
+ if (format->flags & MBG_EXTENDED)
+ {
+ clock_time->flags |= PARSEB_S_ANTENNA;
+
+ /*
+ * DCF77 does not encode the direction -
+ * so we take the current default -
+ * earth slowing down
+ */
+ clock_time->flags &= ~PARSEB_LEAPDEL;
+
+ if (f[4] == 'A')
+ clock_time->flags |= PARSEB_LEAPADD;
+
+ if (f[5] == 'R')
+ clock_time->flags |= PARSEB_ALTERNATE;
+ }
+ return CVT_OK;
+ }
+}
+
+
+/*
+ * mbg_input
+ *
+ * grep data from input stream
+ */
+static u_long
+mbg_input(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("mbg_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case STX:
+ parseprintf(DD_PARSE, ("mbg_input: STX seen\n"));
+
+ parseio->parse_index = 1;
+ parseio->parse_data[0] = ch;
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ return PARSE_INP_SKIP;
+
+ case ETX:
+ parseprintf(DD_PARSE, ("mbg_input: ETX seen\n"));
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+ default:
+ return parse_addchar(parseio, ch);
+ }
+}
+
+
+/*
+ * cvt_mgps
+ *
+ * convert Meinberg GPS format
+ */
+static u_long
+cvt_mgps(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ if (!Strok(buffer, format->fixed_string))
+ {
+ return cvt_meinberg(buffer, size, format, clock_time, local);
+ }
+ else
+ {
+ if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day,
+ format->field_offsets[O_DAY].length) ||
+ Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month,
+ format->field_offsets[O_MONTH].length) ||
+ Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year,
+ format->field_offsets[O_YEAR].length) ||
+ Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour,
+ format->field_offsets[O_HOUR].length) ||
+ Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute,
+ format->field_offsets[O_MIN].length) ||
+ Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second,
+ format->field_offsets[O_SEC].length))
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ else
+ {
+ long h;
+ unsigned char *f = &buffer[format->field_offsets[O_FLAGS].offset];
+
+ clock_time->flags = PARSEB_S_LEAP|PARSEB_S_POSITION;
+
+ clock_time->usecond = 0;
+
+ /*
+ * calculate UTC offset
+ */
+ if (Stoi(&buffer[format->field_offsets[O_UTCHOFFSET].offset], &h,
+ format->field_offsets[O_UTCHOFFSET].length))
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+ else
+ {
+ if (Stoi(&buffer[format->field_offsets[O_UTCMOFFSET].offset], &clock_time->utcoffset,
+ format->field_offsets[O_UTCMOFFSET].length))
+ {
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ clock_time->utcoffset += TIMES60(h);
+ clock_time->utcoffset = TIMES60(clock_time->utcoffset);
+
+ if (buffer[format->field_offsets[O_UTCSOFFSET].offset] != '-')
+ {
+ clock_time->utcoffset = -clock_time->utcoffset;
+ }
+ }
+
+ /*
+ * gather status flags
+ */
+ if (buffer[format->field_offsets[O_ZONE].offset] == 'S')
+ clock_time->flags |= PARSEB_DST;
+
+ if (clock_time->utcoffset == 0)
+ clock_time->flags |= PARSEB_UTC;
+
+ /*
+ * no sv's seen - no time & position
+ */
+ if (f[0] == '#')
+ clock_time->flags |= PARSEB_POWERUP;
+
+ /*
+ * at least one sv seen - time (for last position)
+ */
+ if (f[1] == '*')
+ clock_time->flags |= PARSEB_NOSYNC;
+ else
+ if (!(clock_time->flags & PARSEB_POWERUP))
+ clock_time->flags |= PARSEB_POSITION;
+
+ /*
+ * oncoming zone switch
+ */
+ if (f[3] == '!')
+ clock_time->flags |= PARSEB_ANNOUNCE;
+
+ /*
+ * oncoming leap second
+ * 'a' code not confirmed - earth is not
+ * expected to speed up
+ */
+ if (f[4] == 'A')
+ clock_time->flags |= PARSEB_LEAPADD;
+
+ if (f[4] == 'a')
+ clock_time->flags |= PARSEB_LEAPDEL;
+
+ /*
+ * f[5] == ' '
+ */
+
+ /*
+ * this is the leap second
+ */
+ if ((f[6] == 'L') || (clock_time->second == 60))
+ clock_time->flags |= PARSEB_LEAPSECOND;
+
+ return CVT_OK;
+ }
+ }
+}
+
+/*
+ * gps_input
+ *
+ * grep binary data from input stream
+ */
+static u_long
+gps_input(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ CSUM calc_csum; /* used to compare the incoming csums */
+ GPS_MSG_HDR header;
+ struct msg_buf *msg_buf;
+
+ msg_buf = (struct msg_buf *)parseio->parse_pdata;
+
+ parseprintf(DD_PARSE, ("gps_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ if (!msg_buf)
+ return PARSE_INP_SKIP;
+
+ if ( msg_buf->phase == MBG_NONE )
+ { /* not receiving yet */
+ switch (ch)
+ {
+ case SOH:
+ parseprintf(DD_PARSE, ("gps_input: SOH seen\n"));
+
+ msg_buf->len = sizeof( header ); /* prepare to receive msg header */
+ msg_buf->phase = MBG_HEADER; /* receiving header */
+ break;
+
+ case STX:
+ parseprintf(DD_PARSE, ("gps_input: STX seen\n"));
+
+ msg_buf->len = 0;
+ msg_buf->phase = MBG_STRING; /* prepare to receive ASCII ETX delimited message */
+ parseio->parse_index = 1;
+ parseio->parse_data[0] = ch;
+ break;
+
+ default:
+ return PARSE_INP_SKIP; /* keep searching */
+ }
+
+ parseio->parse_dtime.parse_msglen = 1; /* reset buffer pointer */
+ parseio->parse_dtime.parse_msg[0] = ch; /* fill in first character */
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ return PARSE_INP_SKIP;
+ }
+
+ /* SOH/STX has already been received */
+
+ /* save incoming character in both buffers if needbe */
+ if ((msg_buf->phase == MBG_STRING) &&
+ (parseio->parse_index < parseio->parse_dsize))
+ parseio->parse_data[parseio->parse_index++] = ch;
+
+ parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch;
+
+ if (parseio->parse_dtime.parse_msglen > sizeof(parseio->parse_dtime.parse_msg))
+ {
+ msg_buf->phase = MBG_NONE; /* buffer overflow - discard */
+ parseio->parse_data[parseio->parse_index] = '\0';
+ memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1));
+ parseio->parse_ldsize = parseio->parse_index;
+ return PARSE_INP_DATA;
+ }
+
+ switch (msg_buf->phase)
+ {
+ case MBG_HEADER:
+ case MBG_DATA:
+ msg_buf->len--;
+
+ if ( msg_buf->len ) /* transfer not complete */
+ return PARSE_INP_SKIP;
+
+ parseprintf(DD_PARSE, ("gps_input: %s complete\n", (msg_buf->phase == MBG_DATA) ? "data" : "header"));
+
+ break;
+
+ case MBG_STRING:
+ if ((ch == ETX) || (parseio->parse_index >= parseio->parse_dsize))
+ {
+ msg_buf->phase = MBG_NONE;
+ parseprintf(DD_PARSE, ("gps_input: string complete\n"));
+ parseio->parse_data[parseio->parse_index] = '\0';
+ memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1));
+ parseio->parse_ldsize = parseio->parse_index;
+ parseio->parse_index = 0;
+ return PARSE_INP_TIME;
+ }
+ else
+ {
+ return PARSE_INP_SKIP;
+ }
+ }
+
+ /* cnt == 0, so the header or the whole message is complete */
+
+ if ( msg_buf->phase == MBG_HEADER )
+ { /* header complete now */
+ unsigned char *datap = parseio->parse_dtime.parse_msg + 1;
+
+ get_mbg_header(&datap, &header);
+
+ parseprintf(DD_PARSE, ("gps_input: header: cmd 0x%x, len %d, dcsum 0x%x, hcsum 0x%x\n",
+ (int)header.gps_cmd, (int)header.gps_len, (int)header.gps_data_csum,
+ (int)header.gps_hdr_csum));
+
+
+ calc_csum = mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg + 1, (unsigned short)6 );
+
+ if ( calc_csum != header.gps_hdr_csum )
+ {
+ parseprintf(DD_PARSE, ("gps_input: header checksum mismatch expected 0x%x, got 0x%x\n",
+ (int)calc_csum, (int)mbg_csum( (unsigned char *) parseio->parse_dtime.parse_msg, (unsigned short)6 )));
+
+ msg_buf->phase = MBG_NONE; /* back to hunting mode */
+ return PARSE_INP_DATA; /* invalid header checksum received - pass up for detection */
+ }
+
+ if ((header.gps_len == 0) || /* no data to wait for */
+ (header.gps_len >= (sizeof (parseio->parse_dtime.parse_msg) - sizeof(header) - 1))) /* blows anything we have space for */
+ {
+ msg_buf->phase = MBG_NONE; /* back to hunting mode */
+ return (header.gps_len == 0) ? PARSE_INP_DATA : PARSE_INP_SKIP; /* message complete/throwaway */
+ }
+
+ parseprintf(DD_PARSE, ("gps_input: expecting %d bytes of data message\n", (int)header.gps_len));
+
+ msg_buf->len = header.gps_len;/* save number of bytes to wait for */
+ msg_buf->phase = MBG_DATA; /* flag header already complete */
+ return PARSE_INP_SKIP;
+ }
+
+ parseprintf(DD_PARSE, ("gps_input: message data complete\n"));
+
+ /* Header and data have been received. The header checksum has been */
+ /* checked */
+
+ msg_buf->phase = MBG_NONE; /* back to hunting mode */
+ return PARSE_INP_DATA; /* message complete, must be evaluated */
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_MEINBERG) */
+int clk_meinberg_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_MEINBERG) */
+
+/*
+ * History:
+ *
+ * clk_meinberg.c,v
+ * Revision 4.12.2.1 2005/09/25 10:22:35 kardel
+ * cleanup buffer bounds
+ *
+ * Revision 4.12 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.11 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.8 1999/11/28 09:13:50 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.7 1999/02/21 11:09:14 kardel
+ * cleanup
+ *
+ * Revision 4.6 1998/06/14 21:09:36 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.5 1998/06/13 15:18:54 kardel
+ * fix mem*() to b*() function macro emulation
+ *
+ * Revision 4.4 1998/06/13 12:03:23 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:28 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/05/24 16:14:42 kardel
+ * support current Meinberg standard data formats
+ *
+ * Revision 4.1 1998/05/24 09:39:52 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:29 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.23 - log info deleted 1998/04/11 kardel
+ *
+ */
diff --git a/libparse/clk_rawdcf.c b/libparse/clk_rawdcf.c
new file mode 100644
index 0000000..98848be
--- /dev/null
+++ b/libparse/clk_rawdcf.c
@@ -0,0 +1,658 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A
+ *
+ * clk_rawdcf.c,v 4.18 2006/06/22 18:40:01 kardel RELEASE_20060622_A
+ *
+ * Raw DCF77 pulse clock support
+ *
+ * Copyright (c) 1995-2006 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_RAWDCF)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "parse.h"
+#ifdef PARSESTREAM
+# include <sys/parsestreams.h>
+#endif
+
+#ifndef PARSEKERNEL
+# include "ntp_stdlib.h"
+#endif
+
+/*
+ * DCF77 raw time code
+ *
+ * From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig
+ * und Berlin, Maerz 1989
+ *
+ * Timecode transmission:
+ * AM:
+ * time marks are send every second except for the second before the
+ * next minute mark
+ * time marks consist of a reduction of transmitter power to 25%
+ * of the nominal level
+ * the falling edge is the time indication (on time)
+ * time marks of a 100ms duration constitute a logical 0
+ * time marks of a 200ms duration constitute a logical 1
+ * FM:
+ * see the spec. (basically a (non-)inverted psuedo random phase shift)
+ *
+ * Encoding:
+ * Second Contents
+ * 0 - 10 AM: free, FM: 0
+ * 11 - 14 free
+ * 15 R - alternate antenna
+ * 16 A1 - expect zone change (1 hour before)
+ * 17 - 18 Z1,Z2 - time zone
+ * 0 0 illegal
+ * 0 1 MEZ (MET)
+ * 1 0 MESZ (MED, MET DST)
+ * 1 1 illegal
+ * 19 A2 - expect leap insertion/deletion (1 hour before)
+ * 20 S - start of time code (1)
+ * 21 - 24 M1 - BCD (lsb first) Minutes
+ * 25 - 27 M10 - BCD (lsb first) 10 Minutes
+ * 28 P1 - Minute Parity (even)
+ * 29 - 32 H1 - BCD (lsb first) Hours
+ * 33 - 34 H10 - BCD (lsb first) 10 Hours
+ * 35 P2 - Hour Parity (even)
+ * 36 - 39 D1 - BCD (lsb first) Days
+ * 40 - 41 D10 - BCD (lsb first) 10 Days
+ * 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday)
+ * 45 - 49 MO - BCD (lsb first) Month
+ * 50 MO0 - 10 Months
+ * 51 - 53 Y1 - BCD (lsb first) Years
+ * 54 - 57 Y10 - BCD (lsb first) 10 Years
+ * 58 P3 - Date Parity (even)
+ * 59 - usually missing (minute indication), except for leap insertion
+ */
+
+static u_long pps_rawdcf (parse_t *, int, timestamp_t *);
+static u_long cvt_rawdcf (unsigned char *, int, struct format *, clocktime_t *, void *);
+static u_long inp_rawdcf (parse_t *, unsigned int, timestamp_t *);
+
+typedef struct last_tcode {
+ time_t tcode; /* last converted time code */
+} last_tcode_t;
+
+#define BUFFER_MAX 61
+
+clockformat_t clock_rawdcf =
+{
+ inp_rawdcf, /* DCF77 input handling */
+ cvt_rawdcf, /* raw dcf input conversion */
+ pps_rawdcf, /* examining PPS information */
+ 0, /* no private configuration data */
+ "RAW DCF77 Timecode", /* direct decoding / time synthesis */
+
+ BUFFER_MAX, /* bit buffer */
+ sizeof(last_tcode_t)
+};
+
+static struct dcfparam
+{
+ unsigned char *onebits;
+ unsigned char *zerobits;
+} dcfparameter =
+{
+ (unsigned char *)"###############RADMLS1248124P124812P1248121241248112481248P??", /* 'ONE' representation */
+ (unsigned char *)"--------------------s-------p------p----------------------p__" /* 'ZERO' representation */
+};
+
+static struct rawdcfcode
+{
+ char offset; /* start bit */
+} rawdcfcode[] =
+{
+ { 0 }, { 15 }, { 16 }, { 17 }, { 19 }, { 20 }, { 21 }, { 25 }, { 28 }, { 29 },
+ { 33 }, { 35 }, { 36 }, { 40 }, { 42 }, { 45 }, { 49 }, { 50 }, { 54 }, { 58 }, { 59 }
+};
+
+#define DCF_M 0
+#define DCF_R 1
+#define DCF_A1 2
+#define DCF_Z 3
+#define DCF_A2 4
+#define DCF_S 5
+#define DCF_M1 6
+#define DCF_M10 7
+#define DCF_P1 8
+#define DCF_H1 9
+#define DCF_H10 10
+#define DCF_P2 11
+#define DCF_D1 12
+#define DCF_D10 13
+#define DCF_DW 14
+#define DCF_MO 15
+#define DCF_MO0 16
+#define DCF_Y1 17
+#define DCF_Y10 18
+#define DCF_P3 19
+
+static struct partab
+{
+ char offset; /* start bit of parity field */
+} partab[] =
+{
+ { 21 }, { 29 }, { 36 }, { 59 }
+};
+
+#define DCF_P_P1 0
+#define DCF_P_P2 1
+#define DCF_P_P3 2
+
+#define DCF_Z_MET 0x2
+#define DCF_Z_MED 0x1
+
+static u_long
+ext_bf(
+ unsigned char *buf,
+ int idx,
+ unsigned char *zero
+ )
+{
+ u_long sum = 0;
+ int i, first;
+
+ first = rawdcfcode[idx].offset;
+
+ for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--)
+ {
+ sum <<= 1;
+ sum |= (buf[i] != zero[i]);
+ }
+ return sum;
+}
+
+static unsigned
+pcheck(
+ unsigned char *buf,
+ int idx,
+ unsigned char *zero
+ )
+{
+ int i,last;
+ unsigned psum = 1;
+
+ last = partab[idx+1].offset;
+
+ for (i = partab[idx].offset; i < last; i++)
+ psum ^= (buf[i] != zero[i]);
+
+ return psum;
+}
+
+static u_long
+convert_rawdcf(
+ unsigned char *buffer,
+ int size,
+ struct dcfparam *dcfprm,
+ clocktime_t *clock_time
+ )
+{
+ unsigned char *s = buffer;
+ unsigned char *b = dcfprm->onebits;
+ unsigned char *c = dcfprm->zerobits;
+ int i;
+
+ parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%s\"\n", buffer));
+
+ if (size < 57)
+ {
+#ifndef PARSEKERNEL
+ msyslog(LOG_ERR, "parse: convert_rawdcf: INCOMPLETE DATA - time code only has %d bits", size);
+#endif
+ return CVT_NONE;
+ }
+
+ for (i = 0; i < size; i++)
+ {
+ if ((*s != *b) && (*s != *c))
+ {
+ /*
+ * we only have two types of bytes (ones and zeros)
+ */
+#ifndef PARSEKERNEL
+ msyslog(LOG_ERR, "parse: convert_rawdcf: BAD DATA - no conversion");
+#endif
+ return CVT_NONE;
+ }
+ if (*b) b++;
+ if (*c) c++;
+ s++;
+ }
+
+ /*
+ * check Start and Parity bits
+ */
+ if ((ext_bf(buffer, DCF_S, dcfprm->zerobits) == 1) &&
+ pcheck(buffer, DCF_P_P1, dcfprm->zerobits) &&
+ pcheck(buffer, DCF_P_P2, dcfprm->zerobits) &&
+ pcheck(buffer, DCF_P_P3, dcfprm->zerobits))
+ {
+ /*
+ * buffer OK
+ */
+ parseprintf(DD_RAWDCF,("parse: convert_rawdcf: parity check passed\n"));
+
+ clock_time->flags = PARSEB_S_ANTENNA|PARSEB_S_LEAP;
+ clock_time->utctime= 0;
+ clock_time->usecond= 0;
+ clock_time->second = 0;
+ clock_time->minute = ext_bf(buffer, DCF_M10, dcfprm->zerobits);
+ clock_time->minute = TIMES10(clock_time->minute) + ext_bf(buffer, DCF_M1, dcfprm->zerobits);
+ clock_time->hour = ext_bf(buffer, DCF_H10, dcfprm->zerobits);
+ clock_time->hour = TIMES10(clock_time->hour) + ext_bf(buffer, DCF_H1, dcfprm->zerobits);
+ clock_time->day = ext_bf(buffer, DCF_D10, dcfprm->zerobits);
+ clock_time->day = TIMES10(clock_time->day) + ext_bf(buffer, DCF_D1, dcfprm->zerobits);
+ clock_time->month = ext_bf(buffer, DCF_MO0, dcfprm->zerobits);
+ clock_time->month = TIMES10(clock_time->month) + ext_bf(buffer, DCF_MO, dcfprm->zerobits);
+ clock_time->year = ext_bf(buffer, DCF_Y10, dcfprm->zerobits);
+ clock_time->year = TIMES10(clock_time->year) + ext_bf(buffer, DCF_Y1, dcfprm->zerobits);
+
+ switch (ext_bf(buffer, DCF_Z, dcfprm->zerobits))
+ {
+ case DCF_Z_MET:
+ clock_time->utcoffset = -1*60*60;
+ break;
+
+ case DCF_Z_MED:
+ clock_time->flags |= PARSEB_DST;
+ clock_time->utcoffset = -2*60*60;
+ break;
+
+ default:
+ parseprintf(DD_RAWDCF,("parse: convert_rawdcf: BAD TIME ZONE\n"));
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ if (ext_bf(buffer, DCF_A1, dcfprm->zerobits))
+ clock_time->flags |= PARSEB_ANNOUNCE;
+
+ if (ext_bf(buffer, DCF_A2, dcfprm->zerobits))
+ clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */
+
+ if (ext_bf(buffer, DCF_R, dcfprm->zerobits))
+ clock_time->flags |= PARSEB_ALTERNATE;
+
+ parseprintf(DD_RAWDCF,("parse: convert_rawdcf: TIME CODE OK: %d:%d, %d.%d.%d, flags 0x%lx\n",
+ (int)clock_time->hour, (int)clock_time->minute, (int)clock_time->day, (int)clock_time->month,(int) clock_time->year,
+ (u_long)clock_time->flags));
+ return CVT_OK;
+ }
+ else
+ {
+ /*
+ * bad format - not for us
+ */
+#ifndef PARSEKERNEL
+ msyslog(LOG_ERR, "parse: convert_rawdcf: parity check FAILED for \"%s\"", buffer);
+#endif
+ return CVT_FAIL|CVT_BADFMT;
+ }
+}
+
+/*
+ * raw dcf input routine - needs to fix up 50 baud
+ * characters for 1/0 decision
+ */
+static u_long
+cvt_rawdcf(
+ unsigned char *buffer,
+ int size,
+ struct format *param,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ last_tcode_t *t = (last_tcode_t *)local;
+ unsigned char *s = (unsigned char *)buffer;
+ unsigned char *e = s + size;
+ unsigned char *b = dcfparameter.onebits;
+ unsigned char *c = dcfparameter.zerobits;
+ u_long rtc = CVT_NONE;
+ unsigned int i, lowmax, highmax, cutoff, span;
+#define BITS 9
+ unsigned char histbuf[BITS];
+ /*
+ * the input buffer contains characters with runs of consecutive
+ * bits set. These set bits are an indication of the DCF77 pulse
+ * length. We assume that we receive the pulse at 50 Baud. Thus
+ * a 100ms pulse would generate a 4 bit train (20ms per bit and
+ * start bit)
+ * a 200ms pulse would create all zeroes (and probably a frame error)
+ */
+
+ for (i = 0; i < BITS; i++)
+ {
+ histbuf[i] = 0;
+ }
+
+ cutoff = 0;
+ lowmax = 0;
+
+ while (s < e)
+ {
+ unsigned int ch = *s ^ 0xFF;
+ /*
+ * these lines are left as an excercise to the reader 8-)
+ */
+ if (!((ch+1) & ch) || !*s)
+ {
+
+ for (i = 0; ch; i++)
+ {
+ ch >>= 1;
+ }
+
+ *s = i;
+ histbuf[i]++;
+ cutoff += i;
+ lowmax++;
+ }
+ else
+ {
+ parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: character check for 0x%x@%d FAILED\n", *s, (int)(s - (unsigned char *)buffer)));
+ *s = (unsigned char)~0;
+ rtc = CVT_FAIL|CVT_BADFMT;
+ }
+ s++;
+ }
+
+ if (lowmax)
+ {
+ cutoff /= lowmax;
+ }
+ else
+ {
+ cutoff = 4; /* doesn't really matter - it'll fail anyway, but gives error output */
+ }
+
+ parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: average bit count: %d\n", cutoff));
+
+ lowmax = 0;
+ highmax = 0;
+
+ parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: histogram:"));
+ for (i = 0; i <= cutoff; i++)
+ {
+ lowmax+=histbuf[i] * i;
+ highmax += histbuf[i];
+ parseprintf(DD_RAWDCF,(" %d", histbuf[i]));
+ }
+ parseprintf(DD_RAWDCF, (" <M>"));
+
+ lowmax += highmax / 2;
+
+ if (highmax)
+ {
+ lowmax /= highmax;
+ }
+ else
+ {
+ lowmax = 0;
+ }
+
+ highmax = 0;
+ cutoff = 0;
+
+ for (; i < BITS; i++)
+ {
+ highmax+=histbuf[i] * i;
+ cutoff +=histbuf[i];
+ parseprintf(DD_RAWDCF,(" %d", histbuf[i]));
+ }
+ parseprintf(DD_RAWDCF,("\n"));
+
+ if (cutoff)
+ {
+ highmax /= cutoff;
+ }
+ else
+ {
+ highmax = BITS-1;
+ }
+
+ span = cutoff = lowmax;
+ for (i = lowmax; i <= highmax; i++)
+ {
+ if (histbuf[cutoff] > histbuf[i])
+ {
+ cutoff = i;
+ span = i;
+ }
+ else
+ if (histbuf[cutoff] == histbuf[i])
+ {
+ span = i;
+ }
+ }
+
+ cutoff = (cutoff + span) / 2;
+
+ parseprintf(DD_RAWDCF,("parse: cvt_rawdcf: lower maximum %d, higher maximum %d, cutoff %d\n", lowmax, highmax, cutoff));
+
+ s = (unsigned char *)buffer;
+ while (s < e)
+ {
+ if (*s == (unsigned char)~0)
+ {
+ *s = '?';
+ }
+ else
+ {
+ *s = (*s >= cutoff) ? *b : *c;
+ }
+ s++;
+ if (*b) b++;
+ if (*c) c++;
+ }
+
+ if (rtc == CVT_NONE)
+ {
+ rtc = convert_rawdcf(buffer, size, &dcfparameter, clock_time);
+ if (rtc == CVT_OK)
+ {
+ time_t newtime;
+
+ newtime = parse_to_unixtime(clock_time, &rtc);
+ if ((rtc == CVT_OK) && t)
+ {
+ if ((newtime - t->tcode) == 60) /* guard against multi bit errors */
+ {
+ clock_time->utctime = newtime;
+ }
+ else
+ {
+ rtc = CVT_FAIL|CVT_BADTIME;
+ }
+ t->tcode = newtime;
+ }
+ }
+ }
+
+ return rtc;
+}
+
+/*
+ * pps_rawdcf
+ *
+ * currently a very stupid version - should be extended to decode
+ * also ones and zeros (which is easy)
+ */
+/*ARGSUSED*/
+static u_long
+pps_rawdcf(
+ parse_t *parseio,
+ int status,
+ timestamp_t *ptime
+ )
+{
+ if (!status) /* negative edge for simpler wiring (Rx->DCD) */
+ {
+ parseio->parse_dtime.parse_ptime = *ptime;
+ parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+ }
+
+ return CVT_NONE;
+}
+
+static u_long
+snt_rawdcf(
+ parse_t *parseio,
+ timestamp_t *ptime
+ )
+{
+ if ((parseio->parse_dtime.parse_status & CVT_MASK) == CVT_OK)
+ {
+ parseio->parse_dtime.parse_stime = *ptime;
+
+#ifdef PARSEKERNEL
+ parseio->parse_dtime.parse_time.tv.tv_sec++;
+#else
+ parseio->parse_dtime.parse_time.fp.l_ui++;
+#endif
+
+ parseprintf(DD_RAWDCF,("parse: snt_rawdcf: time stamp synthesized offset %d seconds\n", parseio->parse_index - 1));
+
+ return updatetimeinfo(parseio, parseio->parse_lstate);
+ }
+ return CVT_NONE;
+}
+
+/*
+ * inp_rawdcf
+ *
+ * grab DCF77 data from input stream
+ */
+static u_long
+inp_rawdcf(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ static struct timeval timeout = { 1, 500000 }; /* 1.5 secongs denote second #60 */
+
+ parseprintf(DD_PARSE, ("inp_rawdcf(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+
+ if (parse_timedout(parseio, tstamp, &timeout))
+ {
+ parseprintf(DD_PARSE, ("inp_rawdcf: time out seen\n"));
+
+ (void) parse_end(parseio);
+ (void) parse_addchar(parseio, ch);
+ return PARSE_INP_TIME;
+ }
+ else
+ {
+ unsigned int rtc;
+
+ rtc = parse_addchar(parseio, ch);
+ if (rtc == PARSE_INP_SKIP)
+ {
+ if (snt_rawdcf(parseio, tstamp) == CVT_OK)
+ return PARSE_INP_SYNTH;
+ }
+ return rtc;
+ }
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RAWDCF) */
+int clk_rawdcf_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RAWDCF) */
+
+/*
+ * History:
+ *
+ * clk_rawdcf.c,v
+ * Revision 4.18 2006/06/22 18:40:01 kardel
+ * clean up signedness (gcc 4)
+ *
+ * Revision 4.17 2006/01/22 16:01:55 kardel
+ * update version information
+ *
+ * Revision 4.16 2006/01/22 15:51:22 kardel
+ * generate reasonable timecode output on invalid input
+ *
+ * Revision 4.15 2005/08/06 19:17:06 kardel
+ * clean log output
+ *
+ * Revision 4.14 2005/08/06 17:39:40 kardel
+ * cleanup size handling wrt/ to buffer boundaries
+ *
+ * Revision 4.13 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.12 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.9 1999/12/06 13:42:23 kardel
+ * transfer correctly converted time codes always into tcode
+ *
+ * Revision 4.8 1999/11/28 09:13:50 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.7 1999/04/01 20:07:20 kardel
+ * added checking for minutie increment of timestamps in clk_rawdcf.c
+ *
+ * Revision 4.6 1998/06/14 21:09:37 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.5 1998/06/13 12:04:16 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.4 1998/06/12 15:22:28 kardel
+ * fix prototypes
+ *
+ * Revision 4.3 1998/06/06 18:33:36 kardel
+ * simplified condidional compile expression
+ *
+ * Revision 4.2 1998/05/24 11:04:18 kardel
+ * triggering PPS on negative edge for simpler wiring (Rx->DCD)
+ *
+ * Revision 4.1 1998/05/24 09:39:53 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:30 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.24 log info deleted 1998/04/11 kardel
+ *
+ */
diff --git a/libparse/clk_rcc8000.c b/libparse/clk_rcc8000.c
new file mode 100644
index 0000000..6dca166
--- /dev/null
+++ b/libparse/clk_rcc8000.c
@@ -0,0 +1,198 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A
+ *
+ * clk_rcc8000.c,v 4.9 2004/11/14 15:29:41 kardel RELEASE_20050508_A
+ *
+ * Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support
+ *
+ * Created by R.E.Broughton from clk_trimtaip.c
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_RCC8000)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+extern int printf (const char *, ...);
+#endif
+
+/* Type II Serial Output format
+ *
+ * 0000000000111111111122222222223 / char
+ * 0123456789012345678901234567890 \ posn
+ * HH:MM:SS.XYZ DD/MM/YY DDD W Prn Actual
+ * 33 44 55 666 00 11 22 7 Parse
+ * : : . / / rn Check
+ * "15:50:36.534 30/09/94 273 5 A\x0d\x0a"
+ *
+ * DDD - Day of year number
+ * W - Day of week number (Sunday is 0)
+ * P is the Status. See comment below for details.
+ */
+
+#define O_USEC O_WDAY
+static struct format rcc8000_fmt =
+{ { { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */
+ { 0, 2 }, { 3, 2}, { 6, 2}, /* Hour, Minute, Second */
+ { 9, 3 }, {28, 1}, { 0, 0}, /* uSec, Status (Valid,Reject,BST,Leapyear) */ },
+ (const unsigned char *)" : : . / / \r\n",
+ /*"15:50:36.534 30/09/94 273 5 A\x0d\x0a" */
+ 0
+};
+
+static unsigned long cvt_rcc8000 (unsigned char *, int, struct format *, clocktime_t *, void *);
+static unsigned long inp_rcc8000 (parse_t *, unsigned int, timestamp_t *);
+
+clockformat_t clock_rcc8000 =
+{
+ inp_rcc8000, /* no input handling */
+ cvt_rcc8000, /* Radiocode clock conversion */
+ 0, /* no direct PPS monitoring */
+ (void *)&rcc8000_fmt, /* conversion configuration */
+ "Radiocode RCC8000",
+ 31, /* string buffer */
+ 0 /* no private data */
+};
+
+static unsigned long
+cvt_rcc8000(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ if (!Strok(buffer, format->fixed_string)) return CVT_NONE;
+#define OFFS(x) format->field_offsets[(x)].offset
+#define STOI(x, y) Stoi(&buffer[OFFS(x)], y, format->field_offsets[(x)].length)
+ if ( STOI(O_DAY, &clock_time->day) ||
+ STOI(O_MONTH, &clock_time->month) ||
+ STOI(O_YEAR, &clock_time->year) ||
+ STOI(O_HOUR, &clock_time->hour) ||
+ STOI(O_MIN, &clock_time->minute) ||
+ STOI(O_SEC, &clock_time->second) ||
+ STOI(O_USEC, &clock_time->usecond)
+ ) return CVT_FAIL|CVT_BADFMT;
+ clock_time->usecond *= 1000;
+
+ clock_time->utcoffset = 0;
+
+#define RCCP buffer[28]
+ /*
+ * buffer[28] is the ASCII representation of a hex character ( 0 through F )
+ * The four bits correspond to:
+ * 8 - Valid Time
+ * 4 - Reject Code
+ * 2 - British Summer Time (receiver set to emit GMT all year.)
+ * 1 - Leap year
+ */
+#define RCC8000_VALID 0x8
+#define RCC8000_REJECT 0x4
+#define RCC8000_BST 0x2
+#define RCC8000_LEAPY 0x1
+
+ clock_time->flags = 0;
+
+ if ( (RCCP >= '0' && RCCP <= '9') || (RCCP >= 'A' && RCCP <= 'F') )
+ {
+ register int flag;
+
+ flag = (RCCP >= '0' && RCCP <= '9' ) ? RCCP - '0' : RCCP - 'A' + 10;
+
+ if (!(flag & RCC8000_VALID))
+ clock_time->flags |= PARSEB_POWERUP;
+
+ clock_time->flags |= PARSEB_UTC; /* British special - guess why 8-) */
+
+ /* other flags not used */
+ }
+ return CVT_OK;
+}
+/*
+ * inp_rcc8000
+ *
+ * grep data from input stream
+ */
+static u_long
+inp_rcc8000(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("inp_rcc8000(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case '\n':
+ parseprintf(DD_PARSE, ("inp_rcc8000: EOL seen\n"));
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+
+ default:
+ if (parseio->parse_index == 0) /* take sample at start of message */
+ {
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ }
+ return parse_addchar(parseio, ch);
+ }
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RCC8000) */
+int clk_rcc8000_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_RCC8000) */
+
+/*
+ * History:
+ *
+ * clk_rcc8000.c,v
+ * Revision 4.9 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.6 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.5 1998/06/14 21:09:38 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.4 1998/06/13 12:05:02 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:29 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/06/12 09:13:25 kardel
+ * conditional compile macros fixed
+ * printf prototype
+ *
+ * Revision 4.1 1998/05/24 09:39:53 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:30 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.5 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/clk_schmid.c b/libparse/clk_schmid.c
new file mode 100644
index 0000000..045f0fc
--- /dev/null
+++ b/libparse/clk_schmid.c
@@ -0,0 +1,258 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * clk_schmid.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * Schmid clock support
+ * based on information and testing from Adam W. Feigin et. al (Swisstime iis.ethz.ch)
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_SCHMID)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+extern int printf (const char *, ...);
+#endif
+
+/*
+ * Description courtesy of Adam W. Feigin et. al (Swisstime iis.ethz.ch)
+ *
+ * The command to Schmid's DCF77 clock is a single byte; each bit
+ * allows the user to select some part of the time string, as follows (the
+ * output for the lsb is sent first).
+ *
+ * Bit 0: time in MEZ, 4 bytes *binary, not BCD*; hh.mm.ss.tenths
+ * Bit 1: date 3 bytes *binary, not BCD: dd.mm.yy
+ * Bit 2: week day, 1 byte (unused here)
+ * Bit 3: time zone, 1 byte, 0=MET, 1=MEST. (unused here)
+ * Bit 4: clock status, 1 byte, 0=time invalid,
+ * 1=time from crystal backup,
+ * 3=time from DCF77
+ * Bit 5: transmitter status, 1 byte,
+ * bit 0: backup antenna
+ * bit 1: time zone change within 1h
+ * bit 3,2: TZ 01=MEST, 10=MET
+ * bit 4: leap second will be
+ * added within one hour
+ * bits 5-7: Zero
+ * Bit 6: time in backup mode, units of 5 minutes (unused here)
+ *
+ */
+#define WS_TIME 0x01
+#define WS_SIGNAL 0x02
+
+#define WS_ALTERNATE 0x01
+#define WS_ANNOUNCE 0x02
+#define WS_TZ 0x0c
+#define WS_MET 0x08
+#define WS_MEST 0x04
+#define WS_LEAP 0x10
+
+static u_long cvt_schmid (unsigned char *, int, struct format *, clocktime_t *, void *);
+static unsigned long inp_schmid (parse_t *, unsigned int, timestamp_t *);
+
+clockformat_t clock_schmid =
+{
+ inp_schmid, /* no input handling */
+ cvt_schmid, /* Schmid conversion */
+ 0, /* not direct PPS monitoring */
+ 0, /* conversion configuration */
+ "Schmid", /* Schmid receiver */
+ 12, /* binary data buffer */
+ 0, /* no private data (complete messages) */
+};
+
+
+static u_long
+cvt_schmid(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ if ((size != 11) || (buffer[10] != (unsigned char)'\375'))
+ {
+ return CVT_NONE;
+ }
+ else
+ {
+ if (buffer[0] > 23 || buffer[1] > 59 || buffer[2] > 59 || buffer[3] > 9) /* Time */
+ {
+ return CVT_FAIL|CVT_BADTIME;
+ }
+ else
+ if (buffer[4] < 1 || buffer[4] > 31 || buffer[5] < 1 || buffer[5] > 12
+ || buffer[6] > 99)
+ {
+ return CVT_FAIL|CVT_BADDATE;
+ }
+ else
+ {
+ clock_time->hour = buffer[0];
+ clock_time->minute = buffer[1];
+ clock_time->second = buffer[2];
+ clock_time->usecond = buffer[3] * 100000;
+ clock_time->day = buffer[4];
+ clock_time->month = buffer[5];
+ clock_time->year = buffer[6];
+
+ clock_time->flags = 0;
+
+ switch (buffer[8] & WS_TZ)
+ {
+ case WS_MET:
+ clock_time->utcoffset = -1*60*60;
+ break;
+
+ case WS_MEST:
+ clock_time->utcoffset = -2*60*60;
+ clock_time->flags |= PARSEB_DST;
+ break;
+
+ default:
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ if (!(buffer[7] & WS_TIME))
+ {
+ clock_time->flags |= PARSEB_POWERUP;
+ }
+
+ if (!(buffer[7] & WS_SIGNAL))
+ {
+ clock_time->flags |= PARSEB_NOSYNC;
+ }
+
+ if (buffer[7] & WS_SIGNAL)
+ {
+ if (buffer[8] & WS_ALTERNATE)
+ {
+ clock_time->flags |= PARSEB_ALTERNATE;
+ }
+
+ if (buffer[8] & WS_ANNOUNCE)
+ {
+ clock_time->flags |= PARSEB_ANNOUNCE;
+ }
+
+ if (buffer[8] & WS_LEAP)
+ {
+ clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */
+ }
+ }
+
+ clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_ANTENNA;
+
+ return CVT_OK;
+ }
+ }
+}
+
+/*
+ * inp_schmid
+ *
+ * grep data from input stream
+ */
+static u_long
+inp_schmid(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("inp_schmid(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case 0xFD: /* */
+ parseprintf(DD_PARSE, ("mbg_input: ETX seen\n"));
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+ default:
+ return parse_addchar(parseio, ch);
+ }
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SCHMID) */
+int clk_schmid_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SCHMID) */
+
+/*
+ * History:
+ *
+ * clk_schmid.c,v
+ * Revision 4.9 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.8 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.5 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.4 1998/06/13 12:06:03 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:29 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/06/12 09:13:26 kardel
+ * conditional compile macros fixed
+ * printf prototype
+ *
+ * Revision 4.1 1998/05/24 09:39:53 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:31 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.22 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/clk_sel240x.c b/libparse/clk_sel240x.c
new file mode 100644
index 0000000..a09d347
--- /dev/null
+++ b/libparse/clk_sel240x.c
@@ -0,0 +1,178 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2009,2012 -
+// Schweitzer Engineering Laboratories, Inc. <opensource@selinc.com>
+//////////////////////////////////////////////////////////////////////////////
+
+// Need to have _XOPEN_SOURCE defined for time.h to give the
+// correct strptime signature. As per feature_test_macros(7),
+// define this before including any header files.
+
+// #ifndef _XOPEN_SOURCE
+// #define _XOPEN_SOURCE
+// #endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_SEL240X)
+
+#include "ntp_syslog.h"
+#include "ntp_types.h"
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+#include "ntp_machine.h"
+#include "ntp_stdlib.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+# include <stdio.h>
+#else
+# include "sys/parsestreams.h"
+#endif
+
+#include <time.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// The B8 output has the following format B8 = '\x01YYYY:ddd:hh:mm:ssq\r\n'
+// where q = ' ' locked
+// '.' <1 us
+// '*' <10 us
+// '#' <100 us
+// '?' >100 us
+//
+// Based on this we need to recored the stime when we receive the <SOH>
+// character and end it when we see the \n.
+//
+// The q or quality character indicates satellite lock and sync. For the
+// purposes of NTP we are going to call it valid when we receive anything but
+// a '?'. But we are only going to call it synced when we receive a ' '
+//////////////////////////////////////////////////////////////////////////////
+
+static unsigned long inp_sel240x( parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp);
+static unsigned long cvt_sel240x( unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local );
+
+// Parse clock format structure describing the message above
+static struct format sel240x_fmt =
+{ { { 6, 3 },
+ { 0, 0 },
+ { 1, 4 },
+ { 10, 2 },
+ { 13, 2 },
+ { 16, 2 },
+ { 0, 0 },
+ { 0, 0 },
+ { 0, 0 },
+ { 0, 0 },
+ { 0, 0 },
+ { 0, 0 }
+ },
+ (const unsigned char *)"\x01 : : : : \x0d\x0a",
+ 0
+};
+
+// Structure desctibing the parser
+clockformat_t clock_sel240x =
+{
+ inp_sel240x,
+ cvt_sel240x,
+ pps_one,
+ (void*)&sel240x_fmt,
+ "SEL B8",
+ 25,
+ 0
+};
+
+//////////////////////////////////////////////////////////////////////////////
+static unsigned long
+inp_sel240x( parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned long rc;
+
+ parseprintf( DD_PARSE,
+ ("inp_sel240x(0x%lx, 0x%x, ...)\n",(long)parseio, ch));
+
+ switch( ch )
+ {
+ case '\x01':
+ parseio->parse_index = 1;
+ parseio->parse_data[0] = ch;
+ parseio->parse_dtime.parse_stime = *tstamp;
+ rc = PARSE_INP_SKIP;
+ break;
+ case '\n':
+ if( (rc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP )
+ {
+ rc = parse_end( parseio );
+ }
+ break;
+ default:
+ rc = parse_addchar( parseio, ch );
+ }
+
+ return rc;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+static unsigned long
+cvt_sel240x( unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ unsigned long rc = CVT_NONE;
+
+ if( Strok(buffer, format->fixed_string) )
+ {
+ struct tm ptime;
+ buffer++;
+ buffer = (unsigned char *) strptime(
+ (const char *)buffer, "%Y:%j:%H:%M:%S", &ptime );
+ if( *(buffer+1) != '\x0d' )
+ {
+ rc = CVT_FAIL | CVT_BADFMT;
+ }
+ else
+ {
+ clock_time->day = ptime.tm_mday;
+ clock_time->month = ptime.tm_mon + 1;
+ clock_time->year = ptime.tm_year + 1900;
+ clock_time->hour = ptime.tm_hour;
+ clock_time->minute = ptime.tm_min;
+ clock_time->second = ptime.tm_sec;
+ clock_time->usecond = 0;
+ clock_time->utcoffset = 0;
+ clock_time->flags = PARSEB_UTC;
+
+ if( *buffer == '?' )
+ {
+ clock_time->flags |= PARSEB_POWERUP;
+ }
+ else if( *buffer != ' ' )
+ {
+ clock_time->flags |= PARSEB_NOSYNC;
+ }
+
+ rc = CVT_OK;
+ }
+ }
+
+ return rc;
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SEL240X) */
+int clk_sel240x_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_SEL240X) */
diff --git a/libparse/clk_trimtaip.c b/libparse/clk_trimtaip.c
new file mode 100644
index 0000000..322d0fa
--- /dev/null
+++ b/libparse/clk_trimtaip.c
@@ -0,0 +1,223 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_trimtaip.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * clk_trimtaip.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * Trimble SV6 clock support - several collected codepieces
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_TRIMTAIP)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+extern int printf (const char *, ...);
+#endif
+
+/* 0000000000111111111122222222223333333 / char
+ * 0123456789012345678901234567890123456 \ posn
+ * >RTMhhmmssdddDDMMYYYYoodnnvrrrrr;*xx< Actual
+ * ----33445566600112222BB7__-_____--99- Parse
+ * >RTM 1 ;* <", Check
+ */
+
+#define hexval(x) (('0' <= (x) && (x) <= '9') ? (x) - '0' : \
+ ('a' <= (x) && (x) <= 'f') ? (x) - 'a' + 10 : \
+ ('A' <= (x) && (x) <= 'F') ? (x) - 'A' + 10 : \
+ -1)
+#define O_USEC O_WDAY
+#define O_GPSFIX O_FLAGS
+#define O_CHKSUM O_UTCHOFFSET
+ static struct format trimsv6_fmt =
+{ { { 13, 2 }, {15, 2}, { 17, 4}, /* Day, Month, Year */
+ { 4, 2 }, { 6, 2}, { 8, 2}, /* Hour, Minute, Second */
+ { 10, 3 }, {23, 1}, { 0, 0}, /* uSec, FIXes (WeekDAY, FLAGS, ZONE) */
+ { 34, 2 }, { 0, 0}, { 21, 2}, /* cksum, -, utcS (UTC[HMS]OFFSET) */
+},
+ (const unsigned char *)">RTM 1 ;* <",
+ 0
+};
+
+static unsigned long cvt_trimtaip (unsigned char *, int, struct format *, clocktime_t *, void *);
+static unsigned long inp_trimtaip (parse_t *, unsigned int, timestamp_t *);
+
+clockformat_t clock_trimtaip =
+{
+ inp_trimtaip, /* no input handling */
+ cvt_trimtaip, /* Trimble conversion */
+ pps_one, /* easy PPS monitoring */
+ (void *)&trimsv6_fmt, /* conversion configuration */
+ "Trimble TAIP",
+ 37, /* string buffer */
+ 0 /* no private data */
+};
+
+static unsigned long
+cvt_trimtaip(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ long gpsfix;
+ u_char calc_csum = 0;
+ long recv_csum;
+ int i;
+
+ if (!Strok(buffer, format->fixed_string)) return CVT_NONE;
+#define OFFS(x) format->field_offsets[(x)].offset
+#define STOI(x, y) \
+ Stoi(&buffer[OFFS(x)], y, \
+ format->field_offsets[(x)].length)
+ if ( STOI(O_DAY, &clock_time->day) ||
+ STOI(O_MONTH, &clock_time->month) ||
+ STOI(O_YEAR, &clock_time->year) ||
+ STOI(O_HOUR, &clock_time->hour) ||
+ STOI(O_MIN, &clock_time->minute) ||
+ STOI(O_SEC, &clock_time->second) ||
+ STOI(O_USEC, &clock_time->usecond)||
+ STOI(O_GPSFIX, &gpsfix)
+ ) return CVT_FAIL|CVT_BADFMT;
+
+ clock_time->usecond *= 1000;
+ /* Check that the checksum is right */
+ for (i=OFFS(O_CHKSUM)-1; i >= 0; i--) calc_csum ^= buffer[i];
+ recv_csum = (hexval(buffer[OFFS(O_CHKSUM)]) << 4) |
+ hexval(buffer[OFFS(O_CHKSUM)+1]);
+ if (recv_csum < 0) return CVT_FAIL|CVT_BADTIME;
+ if (((u_char) recv_csum) != calc_csum) return CVT_FAIL|CVT_BADTIME;
+
+ clock_time->utcoffset = 0;
+
+ /* What should flags be set to ? */
+ clock_time->flags = PARSEB_UTC;
+
+ /* if the current GPS fix is 9 (unknown), reject */
+ if (0 > gpsfix || gpsfix > 9) clock_time->flags |= PARSEB_POWERUP;
+
+ return CVT_OK;
+}
+
+/*
+ * inp_trimtaip
+ *
+ * grep data from input stream
+ */
+static u_long
+inp_trimtaip(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("inp_trimtaip(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case '>':
+ parseprintf(DD_PARSE, ("inp_trimptaip: START seen\n"));
+
+ parseio->parse_index = 1;
+ parseio->parse_data[0] = ch;
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ return PARSE_INP_SKIP;
+
+ case '<':
+ parseprintf(DD_PARSE, ("inp_trimtaip: END seen\n"));
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+
+ default:
+ return parse_addchar(parseio, ch);
+ }
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTAIP) */
+int clk_trimtaip_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTAIP) */
+
+/*
+ * History:
+ *
+ * clk_trimtaip.c,v
+ * Revision 4.11 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.10 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.7 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.6 1998/08/16 18:46:27 kardel
+ * (clock_trimtaip =): changed format name
+ *
+ * Revision 4.5 1998/06/14 21:09:38 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.4 1998/06/13 12:06:57 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:29 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/06/12 09:13:26 kardel
+ * conditional compile macros fixed
+ * printf prototype
+ *
+ * Revision 4.1 1998/05/24 09:39:54 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:31 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 1.4 log info deleted 1998/04/11 kardel
+ */
+
diff --git a/libparse/clk_trimtsip.c b/libparse/clk_trimtsip.c
new file mode 100644
index 0000000..743e39c
--- /dev/null
+++ b/libparse/clk_trimtsip.c
@@ -0,0 +1,463 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/libparse/clk_trimtsip.c,v 4.19 2009/11/01 10:47:49 kardel RELEASE_20091101_A
+ *
+ * clk_trimtsip.c,v 4.19 2009/11/01 10:47:49 kardel RELEASE_20091101_A
+ *
+ * Trimble TSIP support
+ * Thanks to Sven Dietrich for providing test hardware
+ *
+ * Copyright (c) 1995-2009 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_TRIMTSIP)
+
+#include "ntp_syslog.h"
+#include "ntp_types.h"
+#include "ntp_fp.h"
+#include "timevalops.h"
+#include "ntp_calendar.h"
+#include "ntp_machine.h"
+#include "ntp_stdlib.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+# include <stdio.h>
+#else
+# include "sys/parsestreams.h"
+#endif
+
+#include "ascii.h"
+#include "binio.h"
+#include "ieee754io.h"
+#include "trimble.h"
+
+/*
+ * Trimble low level TSIP parser / time converter
+ *
+ * The receiver uses a serial message protocol called Trimble Standard
+ * Interface Protocol (it can support others but this driver only supports
+ * TSIP). Messages in this protocol have the following form:
+ *
+ * <DLE><id> ... <data> ... <DLE><ETX>
+ *
+ * Any bytes within the <data> portion of value 10 hex (<DLE>) are doubled
+ * on transmission and compressed back to one on reception. Otherwise
+ * the values of data bytes can be anything. The serial interface is RS-422
+ * asynchronous using 9600 baud, 8 data bits with odd party (**note** 9 bits
+ * in total!), and 1 stop bit. The protocol supports byte, integer, single,
+ * and double datatypes. Integers are two bytes, sent most significant first.
+ * Singles are IEEE754 single precision floating point numbers (4 byte) sent
+ * sign & exponent first. Doubles are IEEE754 double precision floating point
+ * numbers (8 byte) sent sign & exponent first.
+ * The receiver supports a large set of messages, only a very small subset of
+ * which is used here.
+ *
+ * From this module the following are recognised:
+ *
+ * ID Description
+ *
+ * 41 GPS Time
+ * 46 Receiver health
+ * 4F UTC correction data (used to get leap second warnings)
+ *
+ * All others are accepted but ignored for time conversion - they are passed up to higher layers.
+ *
+ */
+
+static offsets_t trim_offsets = { 0, 1, 2, 3, 4, 5, 6, 7 };
+
+struct trimble
+{
+ u_char t_in_pkt; /* first DLE received */
+ u_char t_dle; /* subsequent DLE received */
+ u_short t_week; /* GPS week */
+ u_short t_weekleap; /* GPS week of next/last week */
+ u_short t_dayleap; /* day in week */
+ u_short t_gpsutc; /* GPS - UTC offset */
+ u_short t_gpsutcleap; /* offset at next/last leap */
+ u_char t_operable; /* receiver feels OK */
+ u_char t_mode; /* actual operating mode */
+ u_char t_leap; /* possible leap warning */
+ u_char t_utcknown; /* utc offset known */
+};
+
+#define STATUS_BAD 0 /* BAD or UNINITIALIZED receiver status */
+#define STATUS_UNSAFE 1 /* not enough receivers for full precision */
+#define STATUS_SYNC 2 /* enough information for good operation */
+
+static unsigned long inp_tsip (parse_t *, unsigned int, timestamp_t *);
+static unsigned long cvt_trimtsip (unsigned char *, int, struct format *, clocktime_t *, void *);
+
+struct clockformat clock_trimtsip =
+{
+ inp_tsip, /* Trimble TSIP input handler */
+ cvt_trimtsip, /* Trimble TSIP conversion */
+ pps_one, /* easy PPS monitoring */
+ 0, /* no configuration data */
+ "Trimble TSIP",
+ 400, /* input buffer */
+ sizeof(struct trimble) /* private data */
+};
+
+#define ADDSECOND 0x01
+#define DELSECOND 0x02
+
+static unsigned long
+inp_tsip(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ struct trimble *t = (struct trimble *)parseio->parse_pdata;
+
+ if (!t)
+ return PARSE_INP_SKIP; /* local data not allocated - sigh! */
+
+ if (!t->t_in_pkt && ch != DLE) {
+ /* wait for start of packet */
+ return PARSE_INP_SKIP;
+ }
+
+ if ((parseio->parse_index >= (parseio->parse_dsize - 2)) ||
+ (parseio->parse_dtime.parse_msglen >= (sizeof(parseio->parse_dtime.parse_msg) - 2)))
+ { /* OVERFLOW - DROP! */
+ t->t_in_pkt = t->t_dle = 0;
+ parseio->parse_index = 0;
+ parseio->parse_dtime.parse_msglen = 0;
+ return PARSE_INP_SKIP;
+ }
+
+ switch (ch) {
+ case DLE:
+ if (!t->t_in_pkt) {
+ t->t_dle = 0;
+ t->t_in_pkt = 1;
+ parseio->parse_index = 0;
+ parseio->parse_data[parseio->parse_index++] = ch;
+ parseio->parse_dtime.parse_msglen = 0;
+ parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch;
+ parseio->parse_dtime.parse_stime = *tstamp; /* pick up time stamp at packet start */
+ } else if (t->t_dle) {
+ /* Double DLE -> insert a DLE */
+ t->t_dle = 0;
+ parseio->parse_data[parseio->parse_index++] = DLE;
+ parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = DLE;
+ } else
+ t->t_dle = 1;
+ break;
+
+ case ETX:
+ if (t->t_dle) {
+ /* DLE,ETX -> end of packet */
+ parseio->parse_data[parseio->parse_index++] = DLE;
+ parseio->parse_data[parseio->parse_index] = ch;
+ parseio->parse_ldsize = parseio->parse_index+1;
+ memcpy(parseio->parse_ldata, parseio->parse_data, parseio->parse_ldsize);
+ parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = DLE;
+ parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch;
+ t->t_in_pkt = t->t_dle = 0;
+ return PARSE_INP_TIME|PARSE_INP_DATA;
+ }
+ /*FALLTHROUGH*/
+
+ default: /* collect data */
+ t->t_dle = 0;
+ parseio->parse_data[parseio->parse_index++] = ch;
+ parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] = ch;
+ }
+
+ return PARSE_INP_SKIP;
+}
+
+static int
+getshort(
+ unsigned char *p
+ )
+{
+ return get_msb_short(&p);
+}
+
+/*
+ * cvt_trimtsip
+ *
+ * convert TSIP type format
+ */
+static unsigned long
+cvt_trimtsip(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ register struct trimble *t = (struct trimble *)local; /* get local data space */
+#define mb(_X_) (buffer[2+(_X_)]) /* shortcut for buffer access */
+ register u_char cmd;
+
+ clock_time->flags = 0;
+
+ if (!t) {
+ return CVT_NONE; /* local data not allocated - sigh! */
+ }
+
+ if ((size < 4) ||
+ (buffer[0] != DLE) ||
+ (buffer[size-1] != ETX) ||
+ (buffer[size-2] != DLE))
+ {
+ printf("TRIMBLE BAD packet, size %d:\n", size);
+ return CVT_NONE;
+ }
+ else
+ {
+ unsigned char *bp;
+ cmd = buffer[1];
+
+ switch(cmd)
+ {
+ case CMD_RCURTIME:
+ { /* GPS time */
+ l_fp secs;
+ int week = getshort((unsigned char *)&mb(4));
+ l_fp utcoffset;
+ l_fp gpstime;
+
+ bp = &mb(0);
+ if (fetch_ieee754(&bp, IEEE_SINGLE, &secs, trim_offsets) != IEEE_OK)
+ return CVT_FAIL|CVT_BADFMT;
+
+ if ((secs.l_i <= 0) ||
+ (t->t_utcknown == 0))
+ {
+ clock_time->flags = PARSEB_POWERUP;
+ return CVT_OK;
+ }
+ if (week < 990) {
+ week += 1024;
+ }
+
+ /* time OK */
+
+ /* fetch UTC offset */
+ bp = &mb(6);
+ if (fetch_ieee754(&bp, IEEE_SINGLE, &utcoffset, trim_offsets) != IEEE_OK)
+ return CVT_FAIL|CVT_BADFMT;
+
+ L_SUB(&secs, &utcoffset); /* adjust GPS time to UTC time */
+
+ gpstolfp((unsigned short)week, (unsigned short)0,
+ secs.l_ui, &gpstime);
+
+ gpstime.l_uf = secs.l_uf;
+
+ clock_time->utctime = gpstime.l_ui - JAN_1970;
+
+ TSFTOTVU(gpstime.l_uf, clock_time->usecond);
+
+ if (t->t_leap == ADDSECOND)
+ clock_time->flags |= PARSEB_LEAPADD;
+
+ if (t->t_leap == DELSECOND)
+ clock_time->flags |= PARSEB_LEAPDEL;
+
+ switch (t->t_operable)
+ {
+ case STATUS_SYNC:
+ clock_time->flags &= ~(PARSEB_POWERUP|PARSEB_NOSYNC);
+ break;
+
+ case STATUS_UNSAFE:
+ clock_time->flags |= PARSEB_NOSYNC;
+ break;
+
+ case STATUS_BAD:
+ clock_time->flags |= PARSEB_NOSYNC|PARSEB_POWERUP;
+ break;
+ }
+
+ if (t->t_mode == 0)
+ clock_time->flags |= PARSEB_POSITION;
+
+ clock_time->flags |= PARSEB_S_LEAP|PARSEB_S_POSITION;
+
+ return CVT_OK;
+
+ } /* case 0x41 */
+
+ case CMD_RRECVHEALTH:
+ {
+ /* TRIMBLE health */
+ u_char status = mb(0);
+
+ switch (status)
+ {
+ case 0x00: /* position fixes */
+ t->t_operable = STATUS_SYNC;
+ break;
+
+ case 0x09: /* 1 satellite */
+ case 0x0A: /* 2 satellites */
+ case 0x0B: /* 3 satellites */
+ t->t_operable = STATUS_UNSAFE;
+ break;
+
+ default:
+ t->t_operable = STATUS_BAD;
+ break;
+ }
+ t->t_mode = status;
+ }
+ break;
+
+ case CMD_RUTCPARAM:
+ {
+ l_fp t0t;
+ unsigned char *lbp;
+
+ /* UTC correction data - derive a leap warning */
+ int tls = t->t_gpsutc = getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
+ int tlsf = t->t_gpsutcleap = getshort((unsigned char *)&mb(24)); /* new leap correction */
+
+ t->t_weekleap = getshort((unsigned char *)&mb(20)); /* week no of leap correction */
+ if (t->t_weekleap < 990)
+ t->t_weekleap += 1024;
+
+ t->t_dayleap = getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
+ t->t_week = getshort((unsigned char *)&mb(18)); /* current week no */
+ if (t->t_week < 990)
+ t->t_week += 1024;
+
+ lbp = (unsigned char *)&mb(14); /* last update time */
+ if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK)
+ return CVT_FAIL|CVT_BADFMT;
+
+ t->t_utcknown = t0t.l_ui != 0;
+
+ if ((t->t_utcknown) && /* got UTC information */
+ (tlsf != tls) && /* something will change */
+ ((t->t_weekleap - t->t_week) < 5)) /* and close in the future */
+ {
+ /* generate a leap warning */
+ if (tlsf > tls)
+ t->t_leap = ADDSECOND;
+ else
+ t->t_leap = DELSECOND;
+ }
+ else
+ {
+ t->t_leap = 0;
+ }
+ }
+ break;
+
+ default:
+ /* it's validly formed, but we don't care about it! */
+ break;
+ }
+ }
+ return CVT_SKIP;
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTSIP && !PARSESTREAM) */
+int clk_trimtsip_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_TRIMTSIP && !PARSESTREAM) */
+
+/*
+ * History:
+ *
+ * clk_trimtsip.c,v
+ * Revision 4.19 2009/11/01 10:47:49 kardel
+ * de-P()
+ *
+ * Revision 4.18 2009/11/01 08:46:46 kardel
+ * clarify case FALLTHROUGH
+ *
+ * Revision 4.17 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.16 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.13 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.12 1999/02/28 13:00:08 kardel
+ * *** empty log message ***
+ *
+ * Revision 4.11 1999/02/28 11:47:54 kardel
+ * (struct trimble): new member t_utcknown
+ * (cvt_trimtsip): fixed status monitoring, bad receiver states are
+ * now recognized
+ *
+ * Revision 4.10 1999/02/27 15:57:15 kardel
+ * use mmemcpy instead of bcopy
+ *
+ * Revision 4.9 1999/02/21 12:17:42 kardel
+ * 4.91f reconcilation
+ *
+ * Revision 4.8 1998/11/15 20:27:58 kardel
+ * Release 4.0.73e13 reconcilation
+ *
+ * Revision 4.7 1998/08/16 18:49:20 kardel
+ * (cvt_trimtsip): initial kernel capable version (no more floats)
+ * (clock_trimtsip =): new format name
+ *
+ * Revision 4.6 1998/08/09 22:26:05 kardel
+ * Trimble TSIP support
+ *
+ * Revision 4.5 1998/08/02 10:37:05 kardel
+ * working TSIP parser
+ *
+ * Revision 4.4 1998/06/28 16:50:40 kardel
+ * (getflt): fixed ENDIAN issue
+ * (getdbl): fixed ENDIAN issue
+ * (getint): use get_msb_short()
+ * (cvt_trimtsip): use gpstolfp() for conversion
+ *
+ * Revision 4.3 1998/06/13 12:07:31 kardel
+ * fix SYSV clock name clash
+ *
+ * Revision 4.2 1998/06/12 15:22:30 kardel
+ * fix prototypes
+ *
+ * Revision 4.1 1998/05/24 09:39:54 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:32 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 1.8 loginfo deleted 1998/04/11 kardel
+ */
diff --git a/libparse/clk_varitext.c b/libparse/clk_varitext.c
new file mode 100644
index 0000000..295ce0a
--- /dev/null
+++ b/libparse/clk_varitext.c
@@ -0,0 +1,271 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_VARITEXT)
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_varitext.c,v 1.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * clk_varitext.c,v 1.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * Varitext code variant by A.McConnell 1997/01/19
+ *
+ * Supports Varitext's Radio Clock
+ *
+ * Used the Meinberg/Computime clock as a template for Varitext Radio Clock
+ *
+ * Codebase:
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+# include "ntp_stdlib.h"
+# include <stdio.h>
+#else
+# include "sys/parsestreams.h"
+extern int printf (const char *, ...);
+#endif
+
+static const u_char VT_INITIALISED = 0x01;
+static const u_char VT_SYNCHRONISED = 0x02;
+static const u_char VT_ALARM_STATE = 0x04;
+static const u_char VT_BST = 0x08;
+static const u_char VT_SEASON_CHANGE = 0x10;
+static const u_char VT_LAST_TELEGRAM_OK = 0x20;
+
+/*
+ * The Varitext receiver sends a datagram in the following format every minute
+ *
+ * Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLFSTXXX
+ * Pos 0123456789012345678901 2 3 4567
+ * 0000000000111111111122 2 2 2222
+ * Parse T: : : : : : : \r\n
+ *
+ * T Startcharacter "T" specifies start of the timestamp
+ * YY Year MM Month 1-12
+ * MD Day of the month
+ * WD Day of week
+ * HH Hour
+ * MM Minute
+ * SS Second
+ * CR Carriage return
+ * LF Linefeed
+ * ST Status character
+ * Bit 0 - Set= Initialised; Reset=Time Invalid (DO NOT USE)
+ * Bit 1 - Set= Synchronised; Reset= Unsynchronised
+ * Bit 2 - Set= Alarm state; Reset= No alarm
+ * Bit 3 - Set= BST; Reset= GMT
+ * Bit 4 - Set= Seasonal change in approx hour; Reset= No seasonal change expected
+ * Bit 5 - Set= Last MSF telegram was OK; Reset= Last telegram was in error;
+ * Bit 6 - Always set
+ * Bit 7 - Unused
+ * XXX Checksum calculated using Fletcher's method (ignored for now).
+ */
+
+static struct format varitext_fmt =
+{
+ {
+ {8, 2}, {5, 2}, {2, 2}, /* day, month, year */
+ {14, 2}, {17, 2}, {20, 2}, /* hour, minute, second */
+ {11, 2}, {24, 1} /* dayofweek, status */
+ },
+ (const unsigned char*)"T: : : : : : : \r\n ",
+ 0
+};
+
+static u_long cvt_varitext (unsigned char *, int, struct format *, clocktime_t *, void *);
+static u_long inp_varitext (parse_t *, unsigned int, timestamp_t *);
+
+struct varitext {
+ unsigned char start_found;
+ unsigned char end_found;
+ unsigned char end_count;
+ unsigned char previous_ch;
+ timestamp_t tstamp;
+};
+
+clockformat_t clock_varitext =
+{
+ inp_varitext, /* Because of the strange format we need to parse it ourselves */
+ cvt_varitext, /* Varitext conversion */
+ 0, /* no PPS monitoring */
+ (void *)&varitext_fmt, /* conversion configuration */
+ "Varitext Radio Clock", /* Varitext Radio Clock */
+ 30, /* string buffer */
+ sizeof(struct varitext), /* Private data size required to hold current parse state */
+};
+
+/*
+ * cvt_varitext
+ *
+ * convert simple type format
+ */
+static u_long
+cvt_varitext(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+
+ if (!Strok(buffer, format->fixed_string)) {
+ return CVT_NONE;
+ } else {
+ if (Stoi(&buffer[format->field_offsets[O_DAY].offset], &clock_time->day,
+ format->field_offsets[O_DAY].length) ||
+ Stoi(&buffer[format->field_offsets[O_MONTH].offset], &clock_time->month,
+ format->field_offsets[O_MONTH].length) ||
+ Stoi(&buffer[format->field_offsets[O_YEAR].offset], &clock_time->year,
+ format->field_offsets[O_YEAR].length) ||
+ Stoi(&buffer[format->field_offsets[O_HOUR].offset], &clock_time->hour,
+ format->field_offsets[O_HOUR].length) ||
+ Stoi(&buffer[format->field_offsets[O_MIN].offset], &clock_time->minute,
+ format->field_offsets[O_MIN].length) ||
+ Stoi(&buffer[format->field_offsets[O_SEC].offset], &clock_time->second,
+ format->field_offsets[O_SEC].length)) {
+ return CVT_FAIL | CVT_BADFMT;
+ } else {
+ u_char *f = (u_char*) &buffer[format->field_offsets[O_FLAGS].offset];
+
+ clock_time->flags = 0;
+ clock_time->utcoffset = 0;
+
+ if (((*f) & VT_BST)) /* BST flag is set so set to indicate daylight saving time is active and utc offset */
+ {
+ clock_time->utcoffset = -1*60*60;
+ clock_time->flags |= PARSEB_DST;
+ }
+ /*
+ if (!((*f) & VT_INITIALISED)) Clock not initialised
+ clock_time->flags |= PARSEB_POWERUP;
+
+ if (!((*f) & VT_SYNCHRONISED)) Clock not synchronised
+ clock_time->flags |= PARSEB_NOSYNC;
+
+ if (((*f) & VT_SEASON_CHANGE)) Seasonal change expected in the next hour
+ clock_time->flags |= PARSEB_ANNOUNCE;
+ */
+ return CVT_OK;
+ }
+ }
+}
+
+static u_long
+inp_varitext(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ struct varitext *t = (struct varitext *)parseio->parse_pdata;
+ int rtc;
+
+ parseprintf(DD_PARSE, ("inp_varitext(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ if (!t)
+ return PARSE_INP_SKIP; /* local data not allocated - sigh! */
+
+ if (ch == 'T')
+ t->tstamp = *tstamp;
+
+ if ((t->previous_ch == 'T') && (ch == ':'))
+ {
+ parseprintf(DD_PARSE, ("inp_varitext: START seen\n"));
+
+ parseio->parse_data[0] = 'T';
+ parseio->parse_index=1;
+ parseio->parse_dtime.parse_stime = t->tstamp; /* Time stamp at packet start */
+ t->start_found = 1;
+ t->end_found = 0;
+ t->end_count = 0;
+ }
+
+ if (t->start_found)
+ {
+ if ((rtc = parse_addchar(parseio, ch)) != PARSE_INP_SKIP)
+ {
+ parseprintf(DD_PARSE, ("inp_varitext: ABORTED due to too many characters\n"));
+
+ memset(t, 0, sizeof(struct varitext));
+ return rtc;
+ }
+
+ if (t->end_found)
+ {
+ if (++(t->end_count) == 4) /* Finally found the end of the message */
+ {
+ parseprintf(DD_PARSE, ("inp_varitext: END seen\n"));
+
+ memset(t, 0, sizeof(struct varitext));
+ if ((rtc = parse_addchar(parseio, 0)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+ }
+ }
+
+ if ((t->previous_ch == '\r') && (ch == '\n'))
+ {
+ t->end_found = 1;
+ }
+
+ }
+
+ t->previous_ch = ch;
+
+ return PARSE_INP_SKIP;
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_VARITEXT) */
+int clk_varitext_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_VARITEXT) */
+
+/*
+ * History:
+ *
+ * clk_varitext.c,v
+ * Revision 1.5 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 1.4 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ *
+ * Revision 1.0 1997/06/02 13:16:30 McConnell
+ * File created
+ *
+ */
diff --git a/libparse/clk_wharton.c b/libparse/clk_wharton.c
new file mode 100644
index 0000000..55ab43a
--- /dev/null
+++ b/libparse/clk_wharton.c
@@ -0,0 +1,181 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/clk_wharton.c,v 4.2 2004/11/14 15:29:41 kardel RELEASE_20050508_A
+ *
+ * clk_wharton.c,v 4.2 2004/11/14 15:29:41 kardel RELEASE_20050508_A
+ *
+ * From Philippe De Muyter <phdm@macqel.be>, 1999
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_WHARTON_400A)
+/*
+ * Support for WHARTON 400A Series clock + 404.2 serial interface.
+ *
+ * Copyright (C) 1999, 2000 by Philippe De Muyter <phdm@macqel.be>
+ *
+ * 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.
+ *
+ */
+
+#include "ntp_fp.h"
+#include "ascii.h"
+#include "parse.h"
+
+#ifndef PARSESTREAM
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#else
+#include "sys/parsestreams.h"
+extern void printf (const char *, ...);
+#endif
+
+/*
+ * In private e-mail alastair@wharton.co.uk said :
+ * "If you are going to use the 400A and 404.2 system [for ntp] I recommend
+ * that you set the 400A to output the message every second. The start of
+ * transmission of the first byte of the message is synchronised to the
+ * second edge."
+ * The WHARTON 400A Series is able to send date/time serial messages
+ * in 7 output formats. We use format 1 here because it is the shortest.
+ * For use with this driver, the WHARTON 400A Series clock must be set-up
+ * as follows :
+ * Programmable Selected
+ * Option No Option
+ * BST or CET display 3 9 or 11
+ * No external controller 7 0
+ * Serial Output Format 1 9 1
+ * Baud rate 9600 bps 10 96
+ * Bit length 8 bits 11 8
+ * Parity even 12 E
+ *
+ * WHARTON 400A Series output format 1 is as follows :
+ *
+ * Timestamp STXssmmhhDDMMYYSETX
+ * Pos 0 12345678901234
+ * 0 00000000011111
+ *
+ * STX start transmission (ASCII 0x02)
+ * ETX end transmission (ASCII 0x03)
+ * ss Second expressed in reversed decimal (units then tens)
+ * mm Minute expressed in reversed decimal
+ * hh Hour expressed in reversed decimal
+ * DD Day of month expressed in reversed decimal
+ * MM Month expressed in reversed decimal (January is 1)
+ * YY Year (without century) expressed in reversed decimal
+ * S Status byte : 0x30 +
+ * bit 0 0 = MSF source 1 = DCF source
+ * bit 1 0 = Winter time 1 = Summer time
+ * bit 2 0 = not synchronised 1 = synchronised
+ * bit 3 0 = no early warning 1 = early warning
+ *
+ */
+
+/*
+ * cvt_wharton_400a
+ *
+ * convert simple type format
+ */
+static u_long
+cvt_wharton_400a(
+ unsigned char *buffer,
+ int size,
+ struct format *format,
+ clocktime_t *clock_time,
+ void *local
+ )
+{
+ int i;
+
+ /* The given `size' includes a terminating null-character. */
+ if (size != 15 || buffer[0] != STX || buffer[14] != ETX
+ || buffer[13] < '0' || buffer[13] > ('0' + 0xf))
+ return CVT_NONE;
+ for (i = 1; i < 13; i += 1)
+ if (buffer[i] < '0' || buffer[i] > '9')
+ return CVT_NONE;
+ clock_time->second = (buffer[2] - '0') * 10 + buffer[1] - '0';
+ clock_time->minute = (buffer[4] - '0') * 10 + buffer[3] - '0';
+ clock_time->hour = (buffer[6] - '0') * 10 + buffer[5] - '0';
+ clock_time->day = (buffer[8] - '0') * 10 + buffer[7] - '0';
+ clock_time->month = (buffer[10] - '0') * 10 + buffer[9] - '0';
+ clock_time->year = (buffer[12] - '0') * 10 + buffer[11] - '0';
+ clock_time->usecond = 0;
+ if (buffer[13] & 0x1) /* We have CET time */
+ clock_time->utcoffset = -1*60*60;
+ else /* We have BST time */
+ clock_time->utcoffset = 0;
+ if (buffer[13] & 0x2) {
+ clock_time->flags |= PARSEB_DST;
+ clock_time->utcoffset += -1*60*60;
+ }
+ if (!(buffer[13] & 0x4))
+ clock_time->flags |= PARSEB_NOSYNC;
+ if (buffer[13] & 0x8)
+ clock_time->flags |= PARSEB_ANNOUNCE;
+
+ return CVT_OK;
+}
+
+/*
+ * inp_wharton_400a
+ *
+ * grep data from input stream
+ */
+static u_long
+inp_wharton_400a(
+ parse_t *parseio,
+ unsigned int ch,
+ timestamp_t *tstamp
+ )
+{
+ unsigned int rtc;
+
+ parseprintf(DD_PARSE, ("inp_wharton_400a(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
+
+ switch (ch)
+ {
+ case STX:
+ parseprintf(DD_PARSE, ("inp_wharton_400a: STX seen\n"));
+
+ parseio->parse_index = 1;
+ parseio->parse_data[0] = ch;
+ parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
+ return PARSE_INP_SKIP;
+
+ case ETX:
+ parseprintf(DD_PARSE, ("inp_wharton_400a: ETX seen\n"));
+ if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
+ return parse_end(parseio);
+ else
+ return rtc;
+
+ default:
+ return parse_addchar(parseio, ch);
+ }
+}
+
+clockformat_t clock_wharton_400a =
+{
+ inp_wharton_400a, /* input handling function */
+ cvt_wharton_400a, /* conversion function */
+ 0, /* no PPS monitoring */
+ 0, /* conversion configuration */
+ "WHARTON 400A Series clock Output Format 1", /* String format name */
+ 15, /* string buffer */
+ 0 /* no private data (complete pakets) */
+};
+
+#else /* not (REFCLOCK && CLOCK_PARSE && CLOCK_WHARTON_400A) */
+int clk_wharton_400a_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE && CLOCK_WHARTON_400A) */
+
+/*
+ * clk_wharton.c,v
+ * Revision 4.1 1999/02/28 15:27:24 kardel
+ * wharton clock integration
+ *
+ */
diff --git a/libparse/data_mbg.c b/libparse/data_mbg.c
new file mode 100644
index 0000000..97bef35
--- /dev/null
+++ b/libparse/data_mbg.c
@@ -0,0 +1,539 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/libparse/data_mbg.c,v 4.8 2006/06/22 18:40:01 kardel RELEASE_20060622_A
+ *
+ * data_mbg.c,v 4.8 2006/06/22 18:40:01 kardel RELEASE_20060622_A
+ *
+ * $Created: Sun Jul 20 12:08:14 1997 $
+ *
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+#ifdef PARSESTREAM
+#define NEED_BOPS
+#include "ntp_string.h"
+#else
+#include <stdio.h>
+#endif
+#include "ntp_types.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
+#include "mbg_gps166.h"
+#include "binio.h"
+#include "ieee754io.h"
+
+static void get_mbg_tzname (unsigned char **, char *);
+static void mbg_time_status_str (char **, unsigned int, int);
+
+#if 0 /* no actual floats on Meinberg binary interface */
+static offsets_t mbg_float = { 1, 0, 3, 2, 0, 0, 0, 0 }; /* byte order for meinberg floats */
+#endif
+static offsets_t mbg_double = { 1, 0, 3, 2, 5, 4, 7, 6 }; /* byte order for meinberg doubles */
+static int32 rad2deg_i = 57;
+static u_int32 rad2deg_f = 0x4BB834C7; /* 57.2957795131 == 180/PI */
+
+void
+put_mbg_header(
+ unsigned char **bufpp,
+ GPS_MSG_HDR *headerp
+ )
+{
+ put_lsb_short(bufpp, headerp->gps_cmd);
+ put_lsb_short(bufpp, headerp->gps_len);
+ put_lsb_short(bufpp, headerp->gps_data_csum);
+ put_lsb_short(bufpp, headerp->gps_hdr_csum);
+}
+
+void
+get_mbg_sw_rev(
+ unsigned char **bufpp,
+ SW_REV *sw_revp
+ )
+{
+ sw_revp->code = get_lsb_short(bufpp);
+ memcpy(sw_revp->name, *bufpp, sizeof(sw_revp->name));
+ *bufpp += sizeof(sw_revp->name);
+}
+
+void
+get_mbg_ascii_msg(
+ unsigned char **bufpp,
+ ASCII_MSG *ascii_msgp
+ )
+{
+ ascii_msgp->csum = get_lsb_short(bufpp);
+ ascii_msgp->valid = get_lsb_short(bufpp);
+ memcpy(ascii_msgp->s, *bufpp, sizeof(ascii_msgp->s));
+ *bufpp += sizeof(ascii_msgp->s);
+}
+
+void
+get_mbg_svno(
+ unsigned char **bufpp,
+ SVNO *svnop
+ )
+{
+ *svnop = get_lsb_short(bufpp);
+}
+
+void
+get_mbg_health(
+ unsigned char **bufpp,
+ HEALTH *healthp
+ )
+{
+ *healthp = get_lsb_short(bufpp);
+}
+
+void
+get_mbg_cfg(
+ unsigned char **bufpp,
+ CFG *cfgp
+ )
+{
+ *cfgp = get_lsb_short(bufpp);
+}
+
+void
+get_mbg_tgps(
+ unsigned char **bufpp,
+ T_GPS *tgpsp
+ )
+{
+ tgpsp->wn = get_lsb_short(bufpp);
+ tgpsp->sec = get_lsb_long(bufpp);
+ tgpsp->tick = get_lsb_long(bufpp);
+}
+
+void
+get_mbg_tm(
+ unsigned char **buffpp,
+ TM *tmp
+ )
+{
+ tmp->year = get_lsb_short(buffpp);
+ tmp->month = *(*buffpp)++;
+ tmp->mday = *(*buffpp)++;
+ tmp->yday = get_lsb_short(buffpp);
+ tmp->wday = *(*buffpp)++;
+ tmp->hour = *(*buffpp)++;
+ tmp->minute = *(*buffpp)++;
+ tmp->second = *(*buffpp)++;
+ tmp->frac = get_lsb_long(buffpp);
+ tmp->offs_from_utc = get_lsb_long(buffpp);
+ tmp->status= get_lsb_short(buffpp);
+}
+
+void
+get_mbg_ttm(
+ unsigned char **buffpp,
+ TTM *ttmp
+ )
+{
+ ttmp->channel = get_lsb_short(buffpp);
+ get_mbg_tgps(buffpp, &ttmp->t);
+ get_mbg_tm(buffpp, &ttmp->tm);
+}
+
+void
+get_mbg_synth(
+ unsigned char **buffpp,
+ SYNTH *synthp
+ )
+{
+ synthp->freq = get_lsb_short(buffpp);
+ synthp->range = get_lsb_short(buffpp);
+ synthp->phase = get_lsb_short(buffpp);
+}
+
+static void
+get_mbg_tzname(
+ unsigned char **buffpp,
+ char *tznamep
+ )
+{
+ strlcpy(tznamep, (char *)*buffpp, sizeof(TZ_NAME));
+ *buffpp += sizeof(TZ_NAME);
+}
+
+void
+get_mbg_tzdl(
+ unsigned char **buffpp,
+ TZDL *tzdlp
+ )
+{
+ tzdlp->offs = get_lsb_long(buffpp);
+ tzdlp->offs_dl = get_lsb_long(buffpp);
+ get_mbg_tm(buffpp, &tzdlp->tm_on);
+ get_mbg_tm(buffpp, &tzdlp->tm_off);
+ get_mbg_tzname(buffpp, (char *)tzdlp->name[0]);
+ get_mbg_tzname(buffpp, (char *)tzdlp->name[1]);
+}
+
+void
+get_mbg_antinfo(
+ unsigned char **buffpp,
+ ANT_INFO *antinfop
+ )
+{
+ antinfop->status = get_lsb_short(buffpp);
+ get_mbg_tm(buffpp, &antinfop->tm_disconn);
+ get_mbg_tm(buffpp, &antinfop->tm_reconn);
+ antinfop->delta_t = get_lsb_long(buffpp);
+}
+
+static void
+mbg_time_status_str(
+ char **buffpp,
+ unsigned int status,
+ int size
+ )
+{
+ static struct state
+ {
+ int flag; /* bit flag */
+ const char *string; /* bit name */
+ } states[] =
+ {
+ { TM_UTC, "UTC CORR" },
+ { TM_LOCAL, "LOCAL TIME" },
+ { TM_DL_ANN, "DST WARN" },
+ { TM_DL_ENB, "DST" },
+ { TM_LS_ANN, "LEAP WARN" },
+ { TM_LS_ENB, "LEAP SEC" },
+ { 0, "" }
+ };
+
+ if (status)
+ {
+ char *start, *p;
+ struct state *s;
+
+ start = p = *buffpp;
+
+ for (s = states; s->flag; s++)
+ {
+ if (s->flag & status)
+ {
+ if (p != *buffpp)
+ {
+ strlcpy(p, ", ", size - (p - start));
+ p += 2;
+ }
+ strlcpy(p, s->string, size - (p - start));
+ p += strlen(p);
+ }
+ }
+ *buffpp = p;
+ }
+}
+
+void
+mbg_tm_str(
+ char **buffpp,
+ TM *tmp,
+ int size
+ )
+{
+ char *s = *buffpp;
+
+ snprintf(*buffpp, size, "%04d-%02d-%02d %02d:%02d:%02d.%07ld (%c%02d%02d) ",
+ tmp->year, tmp->month, tmp->mday,
+ tmp->hour, tmp->minute, tmp->second, tmp->frac,
+ (tmp->offs_from_utc < 0) ? '-' : '+',
+ abs(tmp->offs_from_utc) / 3600,
+ (abs(tmp->offs_from_utc) / 60) % 60);
+ *buffpp += strlen(*buffpp);
+
+ mbg_time_status_str(buffpp, tmp->status, size - (*buffpp - s));
+}
+
+void
+mbg_tgps_str(
+ char **buffpp,
+ T_GPS *tgpsp,
+ int size
+ )
+{
+ snprintf(*buffpp, size, "week %d + %ld days + %ld.%07ld sec",
+ tgpsp->wn, tgpsp->sec / 86400,
+ tgpsp->sec % 86400, tgpsp->tick);
+ *buffpp += strlen(*buffpp);
+}
+
+void
+get_mbg_cfgh(
+ unsigned char **buffpp,
+ CFGH *cfghp
+ )
+{
+ int i;
+
+ cfghp->csum = get_lsb_short(buffpp);
+ cfghp->valid = get_lsb_short(buffpp);
+ get_mbg_tgps(buffpp, &cfghp->tot_51);
+ get_mbg_tgps(buffpp, &cfghp->tot_63);
+ get_mbg_tgps(buffpp, &cfghp->t0a);
+
+ for (i = MIN_SVNO; i <= MAX_SVNO; i++)
+ {
+ get_mbg_cfg(buffpp, &cfghp->cfg[i]);
+ }
+
+ for (i = MIN_SVNO; i <= MAX_SVNO; i++)
+ {
+ get_mbg_health(buffpp, &cfghp->health[i]);
+ }
+}
+
+void
+get_mbg_utc(
+ unsigned char **buffpp,
+ UTC *utcp
+ )
+{
+ utcp->csum = get_lsb_short(buffpp);
+ utcp->valid = get_lsb_short(buffpp);
+
+ get_mbg_tgps(buffpp, &utcp->t0t);
+
+ if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A0, mbg_double) != IEEE_OK)
+ {
+ L_CLR(&utcp->A0);
+ }
+
+ if (fetch_ieee754(buffpp, IEEE_DOUBLE, &utcp->A1, mbg_double) != IEEE_OK)
+ {
+ L_CLR(&utcp->A1);
+ }
+
+ utcp->WNlsf = get_lsb_short(buffpp);
+ utcp->DNt = get_lsb_short(buffpp);
+ utcp->delta_tls = *(*buffpp)++;
+ utcp->delta_tlsf = *(*buffpp)++;
+}
+
+void
+get_mbg_lla(
+ unsigned char **buffpp,
+ LLA lla
+ )
+{
+ int i;
+
+ for (i = LAT; i <= ALT; i++)
+ {
+ if (fetch_ieee754(buffpp, IEEE_DOUBLE, &lla[i], mbg_double) != IEEE_OK)
+ {
+ L_CLR(&lla[i]);
+ }
+ else
+ if (i != ALT)
+ { /* convert to degrees (* 180/PI) */
+ mfp_mul(&lla[i].l_i, &lla[i].l_uf, lla[i].l_i, lla[i].l_uf, rad2deg_i, rad2deg_f);
+ }
+ }
+}
+
+void
+get_mbg_xyz(
+ unsigned char **buffpp,
+ XYZ xyz
+ )
+{
+ int i;
+
+ for (i = XP; i <= ZP; i++)
+ {
+ if (fetch_ieee754(buffpp, IEEE_DOUBLE, &xyz[i], mbg_double) != IEEE_OK)
+ {
+ L_CLR(&xyz[i]);
+ }
+ }
+}
+
+static void
+get_mbg_comparam(
+ unsigned char **buffpp,
+ COM_PARM *comparamp
+ )
+{
+ int i;
+
+ comparamp->baud_rate = get_lsb_long(buffpp);
+ for (i = 0; i < sizeof(comparamp->framing); i++)
+ {
+ comparamp->framing[i] = *(*buffpp)++;
+ }
+ comparamp->handshake = get_lsb_short(buffpp);
+}
+
+void
+get_mbg_portparam(
+ unsigned char **buffpp,
+ PORT_PARM *portparamp
+ )
+{
+ int i;
+
+ for (i = 0; i < N_COM; i++)
+ {
+ get_mbg_comparam(buffpp, &portparamp->com[i]);
+ }
+ for (i = 0; i < N_COM; i++)
+ {
+ portparamp->mode[i] = *(*buffpp)++;
+ }
+}
+
+#define FETCH_DOUBLE(src, addr) \
+ if (fetch_ieee754(src, IEEE_DOUBLE, addr, mbg_double) != IEEE_OK) \
+ { \
+ L_CLR(addr); \
+ }
+
+void
+get_mbg_eph(
+ unsigned char ** buffpp,
+ EPH *ephp
+ )
+{
+ ephp->csum = get_lsb_short(buffpp);
+ ephp->valid = get_lsb_short(buffpp);
+
+ ephp->health = get_lsb_short(buffpp);
+ ephp->IODC = get_lsb_short(buffpp);
+ ephp->IODE2 = get_lsb_short(buffpp);
+ ephp->IODE3 = get_lsb_short(buffpp);
+
+ get_mbg_tgps(buffpp, &ephp->tt);
+ get_mbg_tgps(buffpp, &ephp->t0c);
+ get_mbg_tgps(buffpp, &ephp->t0e);
+
+ FETCH_DOUBLE(buffpp, &ephp->sqrt_A);
+ FETCH_DOUBLE(buffpp, &ephp->e);
+ FETCH_DOUBLE(buffpp, &ephp->M0);
+ FETCH_DOUBLE(buffpp, &ephp->omega);
+ FETCH_DOUBLE(buffpp, &ephp->OMEGA0);
+ FETCH_DOUBLE(buffpp, &ephp->OMEGADOT);
+ FETCH_DOUBLE(buffpp, &ephp->deltan);
+ FETCH_DOUBLE(buffpp, &ephp->i0);
+ FETCH_DOUBLE(buffpp, &ephp->idot);
+ FETCH_DOUBLE(buffpp, &ephp->crc);
+ FETCH_DOUBLE(buffpp, &ephp->crs);
+ FETCH_DOUBLE(buffpp, &ephp->cuc);
+ FETCH_DOUBLE(buffpp, &ephp->cus);
+ FETCH_DOUBLE(buffpp, &ephp->cic);
+ FETCH_DOUBLE(buffpp, &ephp->cis);
+
+ FETCH_DOUBLE(buffpp, &ephp->af0);
+ FETCH_DOUBLE(buffpp, &ephp->af1);
+ FETCH_DOUBLE(buffpp, &ephp->af2);
+ FETCH_DOUBLE(buffpp, &ephp->tgd);
+
+ ephp->URA = get_lsb_short(buffpp);
+
+ ephp->L2code = *(*buffpp)++;
+ ephp->L2flag = *(*buffpp)++;
+}
+
+void
+get_mbg_alm(
+ unsigned char **buffpp,
+ ALM *almp
+ )
+{
+ almp->csum = get_lsb_short(buffpp);
+ almp->valid = get_lsb_short(buffpp);
+
+ almp->health = get_lsb_short(buffpp);
+ get_mbg_tgps(buffpp, &almp->t0a);
+
+
+ FETCH_DOUBLE(buffpp, &almp->sqrt_A);
+ FETCH_DOUBLE(buffpp, &almp->e);
+
+ FETCH_DOUBLE(buffpp, &almp->M0);
+ FETCH_DOUBLE(buffpp, &almp->omega);
+ FETCH_DOUBLE(buffpp, &almp->OMEGA0);
+ FETCH_DOUBLE(buffpp, &almp->OMEGADOT);
+ FETCH_DOUBLE(buffpp, &almp->deltai);
+ FETCH_DOUBLE(buffpp, &almp->af0);
+ FETCH_DOUBLE(buffpp, &almp->af1);
+}
+
+void
+get_mbg_iono(
+ unsigned char **buffpp,
+ IONO *ionop
+ )
+{
+ ionop->csum = get_lsb_short(buffpp);
+ ionop->valid = get_lsb_short(buffpp);
+
+ FETCH_DOUBLE(buffpp, &ionop->alpha_0);
+ FETCH_DOUBLE(buffpp, &ionop->alpha_1);
+ FETCH_DOUBLE(buffpp, &ionop->alpha_2);
+ FETCH_DOUBLE(buffpp, &ionop->alpha_3);
+
+ FETCH_DOUBLE(buffpp, &ionop->beta_0);
+ FETCH_DOUBLE(buffpp, &ionop->beta_1);
+ FETCH_DOUBLE(buffpp, &ionop->beta_2);
+ FETCH_DOUBLE(buffpp, &ionop->beta_3);
+}
+
+/*
+ * data_mbg.c,v
+ * Revision 4.8 2006/06/22 18:40:01 kardel
+ * clean up signedness (gcc 4)
+ *
+ * Revision 4.7 2005/10/07 22:11:10 kardel
+ * bounded buffer implementation
+ *
+ * Revision 4.6.2.1 2005/09/25 10:23:06 kardel
+ * support bounded buffers
+ *
+ * Revision 4.6 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.5 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.3 1999/02/21 12:17:42 kardel
+ * 4.91f reconcilation
+ *
+ * Revision 4.2 1998/06/14 21:09:39 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.1 1998/05/24 08:02:06 kardel
+ * trimmed version log
+ *
+ * Revision 4.0 1998/04/10 19:45:33 kardel
+ * Start 4.0 release version numbering
+ */
+
diff --git a/libparse/gpstolfp.c b/libparse/gpstolfp.c
new file mode 100644
index 0000000..5354dd3
--- /dev/null
+++ b/libparse/gpstolfp.c
@@ -0,0 +1,77 @@
+/*
+ * /src/NTP/ntp4-dev/libntp/gpstolfp.c,v 4.8 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * gpstolfp.c,v 4.8 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Jun 28 16:30:38 1998 $
+ *
+ * Copyright (c) 1998-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#include <config.h>
+#include "ntp_fp.h"
+
+#define GPSORIGIN 2524953600UL /* NTP origin - GPS origin in seconds */
+#define SECSPERWEEK (unsigned)(604800) /* seconds per week - GPS tells us about weeks */
+#define GPSWRAP 990 /* assume week count less than this in the previous epoch */
+
+void
+gpstolfp(
+ int weeks,
+ int days,
+ unsigned long seconds,
+ l_fp * lfp
+ )
+{
+ if (weeks < GPSWRAP)
+ {
+ weeks += 1024;
+ }
+
+ lfp->l_ui = weeks * SECSPERWEEK + days * 86400 + seconds + GPSORIGIN; /* convert to NTP time */
+ lfp->l_uf = 0;
+}
+
+/*
+ * History:
+ *
+ * gpstolfp.c,v
+ * Revision 4.8 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.7 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.3 1999/02/28 11:42:44 kardel
+ * (GPSWRAP): update GPS rollover to 990 weeks
+ *
+ * Revision 4.2 1998/07/11 10:05:25 kardel
+ * Release 4.0.73d reconcilation
+ *
+ * Revision 4.1 1998/06/28 16:47:15 kardel
+ * added gpstolfp() function
+ */
diff --git a/libparse/ieee754io.c b/libparse/ieee754io.c
new file mode 100644
index 0000000..61bc853
--- /dev/null
+++ b/libparse/ieee754io.c
@@ -0,0 +1,614 @@
+/*
+ * /src/NTP/ntp4-dev/libntp/ieee754io.c,v 4.12 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * ieee754io.c,v 4.12 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Jul 13 09:12:02 1997 $
+ *
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include "l_stdlib.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
+#include "ieee754io.h"
+
+static unsigned char get_byte (unsigned char *, offsets_t, int *);
+#ifdef __not_yet__
+static void put_byte (unsigned char *, offsets_t, int *, unsigned char);
+#endif
+
+#ifdef LIBDEBUG
+
+#include "lib_strbuf.h"
+
+static char *
+fmt_blong(
+ unsigned long val,
+ int cnt
+ )
+{
+ char *buf, *s;
+ int i = cnt;
+
+ val <<= 32 - cnt;
+ LIB_GETBUF(buf);
+ s = buf;
+
+ while (i--)
+ {
+ if (val & 0x80000000)
+ {
+ *s++ = '1';
+ }
+ else
+ {
+ *s++ = '0';
+ }
+ val <<= 1;
+ }
+ *s = '\0';
+ return buf;
+}
+
+static char *
+fmt_flt(
+ unsigned int sign,
+ unsigned long mh,
+ unsigned long ml,
+ unsigned long ch
+ )
+{
+ char *buf;
+
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH, "%c %s %s %s", sign ? '-' : '+',
+ fmt_blong(ch, 11),
+ fmt_blong(mh, 20),
+ fmt_blong(ml, 32));
+
+ return buf;
+}
+
+static char *
+fmt_hex(
+ unsigned char *bufp,
+ int length
+ )
+{
+ char * buf;
+ char hex[4];
+ int i;
+
+ LIB_GETBUF(buf);
+ buf[0] = '\0';
+ for (i = 0; i < length; i++) {
+ snprintf(hex, sizeof(hex), "%02x", bufp[i]);
+ strlcat(buf, hex, LIB_BUFLENGTH);
+ }
+
+ return buf;
+}
+
+#endif
+
+static unsigned char
+get_byte(
+ unsigned char *bufp,
+ offsets_t offset,
+ int *fieldindex
+ )
+{
+ unsigned char val;
+
+ val = *(bufp + offset[*fieldindex]);
+#ifdef LIBDEBUG
+ if (debug > 4)
+ printf("fetchieee754: getbyte(0x%08x, %d) = 0x%02x\n", (unsigned int)(bufp)+offset[*fieldindex], *fieldindex, val);
+#endif
+ (*fieldindex)++;
+ return val;
+}
+
+#ifdef __not_yet__
+static void
+put_byte(
+ unsigned char *bufp,
+ offsets_t offsets,
+ int *fieldindex,
+ unsigned char val
+ )
+{
+ *(bufp + offsets[*fieldindex]) = val;
+ (*fieldindex)++;
+}
+#endif
+
+/*
+ * make conversions to and from external IEEE754 formats and internal
+ * NTP FP format.
+ */
+int
+fetch_ieee754(
+ unsigned char **buffpp,
+ int size,
+ l_fp *lfpp,
+ offsets_t offsets
+ )
+{
+ unsigned char *bufp = *buffpp;
+ unsigned int sign;
+ unsigned int bias;
+ unsigned int maxexp;
+ int mbits;
+ u_long mantissa_low;
+ u_long mantissa_high;
+ u_long characteristic;
+ long exponent;
+#ifdef LIBDEBUG
+ int length;
+#endif
+ unsigned char val;
+ int fieldindex = 0;
+
+ switch (size)
+ {
+ case IEEE_DOUBLE:
+#ifdef LIBDEBUG
+ length = 8;
+#endif
+ mbits = 52;
+ bias = 1023;
+ maxexp = 2047;
+ break;
+
+ case IEEE_SINGLE:
+#ifdef LIBDEBUG
+ length = 4;
+#endif
+ mbits = 23;
+ bias = 127;
+ maxexp = 255;
+ break;
+
+ default:
+ return IEEE_BADCALL;
+ }
+
+ val = get_byte(bufp, offsets, &fieldindex); /* fetch sign byte & first part of characteristic */
+
+ sign = (val & 0x80) != 0;
+ characteristic = (val & 0x7F);
+
+ val = get_byte(bufp, offsets, &fieldindex); /* fetch rest of characteristic and start of mantissa */
+
+ switch (size)
+ {
+ case IEEE_SINGLE:
+ characteristic <<= 1;
+ characteristic |= (val & 0x80) != 0; /* grab last characteristic bit */
+
+ mantissa_high = 0;
+
+ mantissa_low = (val &0x7F) << 16;
+ mantissa_low |= (u_long)get_byte(bufp, offsets, &fieldindex) << 8;
+ mantissa_low |= get_byte(bufp, offsets, &fieldindex);
+ break;
+
+ case IEEE_DOUBLE:
+ characteristic <<= 4;
+ characteristic |= (val & 0xF0) >> 4; /* grab lower characteristic bits */
+
+ mantissa_high = (val & 0x0F) << 16;
+ mantissa_high |= (u_long)get_byte(bufp, offsets, &fieldindex) << 8;
+ mantissa_high |= get_byte(bufp, offsets, &fieldindex);
+
+ mantissa_low = (u_long)get_byte(bufp, offsets, &fieldindex) << 24;
+ mantissa_low |= (u_long)get_byte(bufp, offsets, &fieldindex) << 16;
+ mantissa_low |= (u_long)get_byte(bufp, offsets, &fieldindex) << 8;
+ mantissa_low |= get_byte(bufp, offsets, &fieldindex);
+ break;
+
+ default:
+ return IEEE_BADCALL;
+ }
+#ifdef LIBDEBUG
+ if (debug > 4)
+ {
+ double d;
+ float f;
+
+ if (size == IEEE_SINGLE)
+ {
+ int i;
+
+ for (i = 0; i < length; i++)
+ {
+ *((unsigned char *)(&f)+i) = *(*buffpp + offsets[i]);
+ }
+ d = f;
+ }
+ else
+ {
+ int i;
+
+ for (i = 0; i < length; i++)
+ {
+ *((unsigned char *)(&d)+i) = *(*buffpp + offsets[i]);
+ }
+ }
+
+ printf("fetchieee754: FP: %s -> %s -> %e(=%s)\n", fmt_hex(*buffpp, length),
+ fmt_flt(sign, mantissa_high, mantissa_low, characteristic),
+ d, fmt_hex((unsigned char *)&d, length));
+ }
+#endif
+
+ *buffpp += fieldindex;
+
+ /*
+ * detect funny numbers
+ */
+ if (characteristic == maxexp)
+ {
+ /*
+ * NaN or Infinity
+ */
+ if (mantissa_low || mantissa_high)
+ {
+ /*
+ * NaN
+ */
+ return IEEE_NAN;
+ }
+ else
+ {
+ /*
+ * +Inf or -Inf
+ */
+ return sign ? IEEE_NEGINFINITY : IEEE_POSINFINITY;
+ }
+ }
+ else
+ {
+ /*
+ * collect real numbers
+ */
+
+ L_CLR(lfpp);
+
+ /*
+ * check for overflows
+ */
+ exponent = characteristic - bias;
+
+ if (exponent > 31) /* sorry - hardcoded */
+ {
+ /*
+ * overflow only in respect to NTP-FP representation
+ */
+ return sign ? IEEE_NEGOVERFLOW : IEEE_POSOVERFLOW;
+ }
+ else
+ {
+ int frac_offset; /* where the fraction starts */
+
+ frac_offset = mbits - exponent;
+
+ if (characteristic == 0)
+ {
+ /*
+ * de-normalized or tiny number - fits only as 0
+ */
+ return IEEE_OK;
+ }
+ else
+ {
+ /*
+ * adjust for implied 1
+ */
+ if (mbits > 31)
+ mantissa_high |= 1 << (mbits - 32);
+ else
+ mantissa_low |= 1 << mbits;
+
+ /*
+ * take mantissa apart - if only all machine would support
+ * 64 bit operations 8-(
+ */
+ if (frac_offset > mbits)
+ {
+ lfpp->l_ui = 0; /* only fractional number */
+ frac_offset -= mbits + 1; /* will now contain right shift count - 1*/
+ if (mbits > 31)
+ {
+ lfpp->l_uf = mantissa_high << (63 - mbits);
+ lfpp->l_uf |= mantissa_low >> (mbits - 33);
+ lfpp->l_uf >>= frac_offset;
+ }
+ else
+ {
+ lfpp->l_uf = mantissa_low >> frac_offset;
+ }
+ }
+ else
+ {
+ if (frac_offset > 32)
+ {
+ /*
+ * must split in high word
+ */
+ lfpp->l_ui = mantissa_high >> (frac_offset - 32);
+ lfpp->l_uf = (mantissa_high & ((1 << (frac_offset - 32)) - 1)) << (64 - frac_offset);
+ lfpp->l_uf |= mantissa_low >> (frac_offset - 32);
+ }
+ else
+ {
+ /*
+ * must split in low word
+ */
+ lfpp->l_ui = mantissa_high << (32 - frac_offset);
+ lfpp->l_ui |= (mantissa_low >> frac_offset) & ((1 << (32 - frac_offset)) - 1);
+ lfpp->l_uf = (mantissa_low & ((1 << frac_offset) - 1)) << (32 - frac_offset);
+ }
+ }
+
+ /*
+ * adjust for sign
+ */
+ if (sign)
+ {
+ L_NEG(lfpp);
+ }
+
+ return IEEE_OK;
+ }
+ }
+ }
+}
+
+int
+put_ieee754(
+ unsigned char **bufpp,
+ int size,
+ l_fp *lfpp,
+ offsets_t offsets
+ )
+{
+ l_fp outlfp;
+#ifdef LIBDEBUG
+ unsigned int sign;
+ unsigned int bias;
+#endif
+/*unsigned int maxexp;*/
+ int mbits;
+ int msb;
+ u_long mantissa_low = 0;
+ u_long mantissa_high = 0;
+#ifdef LIBDEBUG
+ u_long characteristic = 0;
+ long exponent;
+#endif
+/*int length;*/
+ unsigned long mask;
+
+ outlfp = *lfpp;
+
+ switch (size)
+ {
+ case IEEE_DOUBLE:
+ /*length = 8;*/
+ mbits = 52;
+#ifdef LIBDEBUG
+ bias = 1023;
+#endif
+ /*maxexp = 2047;*/
+ break;
+
+ case IEEE_SINGLE:
+ /*length = 4;*/
+ mbits = 23;
+#ifdef LIBDEBUG
+ bias = 127;
+#endif
+ /*maxexp = 255;*/
+ break;
+
+ default:
+ return IEEE_BADCALL;
+ }
+
+ /*
+ * find sign
+ */
+ if (L_ISNEG(&outlfp))
+ {
+ L_NEG(&outlfp);
+#ifdef LIBDEBUG
+ sign = 1;
+#endif
+ }
+ else
+ {
+#ifdef LIBDEBUG
+ sign = 0;
+#endif
+ }
+
+ if (L_ISZERO(&outlfp))
+ {
+#ifdef LIBDEBUG
+ exponent = mantissa_high = mantissa_low = 0; /* true zero */
+#endif
+ }
+ else
+ {
+ /*
+ * find number of significant integer bits
+ */
+ mask = 0x80000000;
+ if (outlfp.l_ui)
+ {
+ msb = 63;
+ while (mask && ((outlfp.l_ui & mask) == 0))
+ {
+ mask >>= 1;
+ msb--;
+ }
+ }
+ else
+ {
+ msb = 31;
+ while (mask && ((outlfp.l_uf & mask) == 0))
+ {
+ mask >>= 1;
+ msb--;
+ }
+ }
+
+ switch (size)
+ {
+ case IEEE_SINGLE:
+ mantissa_high = 0;
+ if (msb >= 32)
+ {
+ mantissa_low = (outlfp.l_ui & ((1 << (msb - 32)) - 1)) << (mbits - (msb - 32));
+ mantissa_low |= outlfp.l_uf >> (mbits - (msb - 32));
+ }
+ else
+ {
+ mantissa_low = (outlfp.l_uf << (mbits - msb)) & ((1 << mbits) - 1);
+ }
+ break;
+
+ case IEEE_DOUBLE:
+ if (msb >= 32)
+ {
+ mantissa_high = (outlfp.l_ui << (mbits - msb)) & ((1 << (mbits - 32)) - 1);
+ mantissa_high |= outlfp.l_uf >> (32 - (mbits - msb));
+ mantissa_low = (outlfp.l_ui & ((1 << (msb - mbits)) - 1)) << (32 - (msb - mbits));
+ mantissa_low |= outlfp.l_uf >> (msb - mbits);
+ }
+ else
+ {
+ mantissa_high = outlfp.l_uf << (mbits - 32 - msb);
+ mantissa_low = outlfp.l_uf << (mbits - 32);
+ }
+ }
+
+#ifdef LIBDEBUG
+ exponent = msb - 32;
+ characteristic = exponent + bias;
+
+ if (debug > 4)
+ printf("FP: %s\n", fmt_flt(sign, mantissa_high, mantissa_low, characteristic));
+#endif
+ }
+ return IEEE_OK;
+}
+
+
+#if defined(DEBUG) && defined(LIBDEBUG)
+int main(
+ int argc,
+ char **argv
+ )
+{
+ static offsets_t native_off = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ double f = 1.0;
+ double *f_p = &f;
+ l_fp fp;
+
+ if (argc == 2)
+ {
+ if (sscanf(argv[1], "%lf", &f) != 1)
+ {
+ printf("cannot convert %s to a float\n", argv[1]);
+ return 1;
+ }
+ }
+
+ printf("double: %s %s\n", fmt_blong(*(unsigned long *)&f, 32), fmt_blong(*(unsigned long *)((char *)(&f)+4), 32));
+ printf("fetch from %f = %d\n", f, fetch_ieee754((void *)&f_p, IEEE_DOUBLE, &fp, native_off));
+ printf("fp [%s %s] = %s\n", fmt_blong(fp.l_ui, 32), fmt_blong(fp.l_uf, 32), mfptoa(fp.l_ui, fp.l_uf, 15));
+ f_p = &f;
+ put_ieee754((void *)&f_p, IEEE_DOUBLE, &fp, native_off);
+
+ return 0;
+}
+
+#endif
+/*
+ * History:
+ *
+ * ieee754io.c,v
+ * Revision 4.12 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.11 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.8 1999/02/21 12:17:36 kardel
+ * 4.91f reconcilation
+ *
+ * Revision 4.7 1999/02/21 11:26:03 kardel
+ * renamed index to fieldindex to avoid index() name clash
+ *
+ * Revision 4.6 1998/11/15 20:27:52 kardel
+ * Release 4.0.73e13 reconcilation
+ *
+ * Revision 4.5 1998/08/16 19:01:51 kardel
+ * debug information only compile for LIBDEBUG case
+ *
+ * Revision 4.4 1998/08/09 09:39:28 kardel
+ * Release 4.0.73e2 reconcilation
+ *
+ * Revision 4.3 1998/06/13 11:56:19 kardel
+ * disabled putbute() for the time being
+ *
+ * Revision 4.2 1998/06/12 15:16:58 kardel
+ * ansi2knr compatibility
+ *
+ * Revision 4.1 1998/05/24 07:59:56 kardel
+ * conditional debug support
+ *
+ * Revision 4.0 1998/04/10 19:46:29 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.1 1998/04/10 19:27:46 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ *
+ * Revision 1.1 1997/10/06 21:05:45 kardel
+ * new parse structure
+ *
+ */
diff --git a/libparse/info_trimble.c b/libparse/info_trimble.c
new file mode 100644
index 0000000..6456e0f
--- /dev/null
+++ b/libparse/info_trimble.c
@@ -0,0 +1,94 @@
+/*
+ * Automatically generated - do not modify
+ */
+
+#include <config.h>
+#include "ntp_types.h"
+#include "ntpd.h"
+#include "trimble.h"
+
+cmd_info_t trimble_scmds[] = {
+ { CMD_CCLROSC, "CMD_CCLROSC", "clear oscillator offset (0x1D)", "", 0 },
+ { CMD_CCLRRST, "CMD_CCLRRST", "clear battery backup and RESET (0x1E)", "", 0 },
+ { CMD_CVERSION, "CMD_CVERSION", "return software version (0x1F)", "", 0 },
+ { CMD_CALMANAC, "CMD_CALMANAC", "almanac (0x20)", "", 0 },
+ { CMD_CCURTIME, "CMD_CCURTIME", "current time (0x21)", "", 0 },
+ { CMD_CMODESEL, "CMD_CMODESEL", "mode select (2-d, 3-D, auto) (0x22)", "", 0 },
+ { CMD_CINITPOS, "CMD_CINITPOS", "initial position (0x23)", "", 0 },
+ { CMD_CRECVPOS, "CMD_CRECVPOS", "receiver position fix mode (0x24)", "", 0 },
+ { CMD_CRESET, "CMD_CRESET", "soft reset & selftest (0x25)", "", 0 },
+ { CMD_CRECVHEALTH, "CMD_CRECVHEALTH", "receiver health (0x26)", "", 0 },
+ { CMD_CSIGNALLV, "CMD_CSIGNALLV", "signal levels (0x27)", "", 0 },
+ { CMD_CMESSAGE, "CMD_CMESSAGE", "GPS system message (0x28)", "", 0 },
+ { CMD_CALMAHEALTH, "CMD_CALMAHEALTH", "almanac healt page (0x29)", "", 0 },
+ { CMD_C2DALTITUDE, "CMD_C2DALTITUDE", "altitude for 2-D mode (0x2A)", "", 0 },
+ { CMD_CINITPOSLLA, "CMD_CINITPOSLLA", "initial position LLA (0x2B)", "", 0 },
+ { CMD_COPERPARAM, "CMD_COPERPARAM", "operating parameters (0x2C)", "", 0 },
+ { CMD_COSCOFFSET, "CMD_COSCOFFSET", "oscillator offset (0x2D)", "", 0 },
+ { CMD_CSETGPSTIME, "CMD_CSETGPSTIME", "set GPS time (0x2E)", "", 0 },
+ { CMD_CUTCPARAM, "CMD_CUTCPARAM", "UTC parameters (0x2F)", "", 0 },
+ { CMD_CACCPOSXYZ, "CMD_CACCPOSXYZ", "accurate initial position (XYZ/ECEF) (0x31)", "", 0 },
+ { CMD_CACCPOS, "CMD_CACCPOS", "accurate initial position (0x32)", "", 0 },
+ { CMD_CANALOGDIG, "CMD_CANALOGDIG", "analog to digital (0x33)", "", 0 },
+ { CMD_CSAT1SAT, "CMD_CSAT1SAT", "satellite for 1-Sat mode (0x34)", "", 0 },
+ { CMD_CIOOPTIONS, "CMD_CIOOPTIONS", "I/O options (0x35)", "", 0 },
+ { CMD_CVELOCAID, "CMD_CVELOCAID", "velocity aiding of acquisition (0x36)", "", 0 },
+ { CMD_CSTATLSTPOS, "CMD_CSTATLSTPOS", "status and values of last pos. and vel. (0x37)", "", 0 },
+ { CMD_CLOADSSATDT, "CMD_CLOADSSATDT", "load satellite system data (0x38)", "", 0 },
+ { CMD_CSATDISABLE, "CMD_CSATDISABLE", "satellite disable (0x39)", "", 0 },
+ { CMD_CLASTRAW, "CMD_CLASTRAW", "last raw measurement (0x3A)", "", 0 },
+ { CMD_CSTATSATEPH, "CMD_CSTATSATEPH", "satellite ephemeris status (0x3B)", "", 0 },
+ { CMD_CSTATTRACK, "CMD_CSTATTRACK", "tracking status (0x3C)", "", 0 },
+ { CMD_CCHANADGPS, "CMD_CCHANADGPS", "configure channel A for differential GPS (0x3D)", "", 0 },
+ { CMD_CADDITFIX, "CMD_CADDITFIX", "additional fix data (0x3E)", "", 0 },
+ { CMD_CDGPSFIXMD, "CMD_CDGPSFIXMD", "set/request differential GPS position fix mode (0x62)", "", 0 },
+ { CMD_CDGPSCORR, "CMD_CDGPSCORR", "differential correction status (0x65)", "", 0 },
+ { CMD_CPOSFILT, "CMD_CPOSFILT", "position filter parameters (0x71)", "", 0 },
+ { CMD_CHEIGHTFILT, "CMD_CHEIGHTFILT", "height filter control (0x73)", "", 0 },
+ { CMD_CHIGH8CNT, "CMD_CHIGH8CNT", "high-8 (best 4) / high-6 (overdetermined) control (0x75)", "", 0 },
+ { CMD_CMAXDGPSCOR, "CMD_CMAXDGPSCOR", "maximum rate of DGPS corrections (0x77)", "", 0 },
+ { CMD_CSUPER, "CMD_CSUPER", "super paket (0x8E)", "", 0 },
+ { 0xFF, "", "" }
+};
+
+
+cmd_info_t trimble_rcmds[] = {
+ { CMD_RDATAA, "CMD_RDATAA", "data channel A configuration (0x3D)", "trimble_channelA", RO },
+ { CMD_RALMANAC, "CMD_RALMANAC", "almanac data for sat (0x40)", "gps_almanac", RO },
+ { CMD_RCURTIME, "CMD_RCURTIME", "GPS time (0x41)", "gps_time", RO },
+ { CMD_RSPOSXYZ, "CMD_RSPOSXYZ", "single precision XYZ position (0x42)", "gps_position(XYZ)", RO|DEF },
+ { CMD_RVELOXYZ, "CMD_RVELOXYZ", "velocity fix (XYZ ECEF) (0x43)", "gps_velocity(XYZ)", RO|DEF },
+ { CMD_RBEST4, "CMD_RBEST4", "best 4 satellite selection (0x44)", "trimble_best4", RO|DEF },
+ { CMD_RVERSION, "CMD_RVERSION", "software version (0x45)", "trimble_version", RO|DEF },
+ { CMD_RRECVHEALTH, "CMD_RRECVHEALTH", "receiver health (0x46)", "trimble_receiver_health", RO|DEF },
+ { CMD_RSIGNALLV, "CMD_RSIGNALLV", "signal levels of all satellites (0x47)", "trimble_signal_levels", RO },
+ { CMD_RMESSAGE, "CMD_RMESSAGE", "GPS system message (0x48)", "gps-message", RO|DEF },
+ { CMD_RALMAHEALTH, "CMD_RALMAHEALTH", "almanac health page for all satellites (0x49)", "gps_almanac_health", RO },
+ { CMD_RSLLAPOS, "CMD_RSLLAPOS", "single LLA position (0x4A)", "gps_position(LLA)", RO|DEF },
+ { CMD_RMACHSTAT, "CMD_RMACHSTAT", "machine code / status (0x4B)", "trimble_status", RO|DEF },
+ { CMD_ROPERPARAM, "CMD_ROPERPARAM", "operating parameters (0x4C)", "trimble_opparam", RO },
+ { CMD_ROSCOFFSET, "CMD_ROSCOFFSET", "oscillator offset (0x4D)", "trimble_oscoffset", RO },
+ { CMD_RSETGPSTIME, "CMD_RSETGPSTIME", "response to set GPS time (0x4E)", "trimble_setgpstime", RO },
+ { CMD_RUTCPARAM, "CMD_RUTCPARAM", "UTC parameters (0x4F)", "gps_utc_correction", RO|DEF },
+ { CMD_RANALOGDIG, "CMD_RANALOGDIG", "analog to digital (0x53)", "trimble_analogdigital", RO },
+ { CMD_RSAT1BIAS, "CMD_RSAT1BIAS", "one-satellite bias & bias rate (0x54)", "trimble_sat1bias", RO },
+ { CMD_RIOOPTIONS, "CMD_RIOOPTIONS", "I/O options (0x55)", "trimble_iooptions", RO },
+ { CMD_RSTATLSTFIX, "CMD_RSTATLSTFIX", "status and values of last pos. and vel. (0x57)", "trimble_status_lastpos", RO },
+ { CMD_RLOADSSATDT, "CMD_RLOADSSATDT", "response to load satellite system data (0x58)", "trimble_loaddata", RO },
+ { CMD_RSATDISABLE, "CMD_RSATDISABLE", "satellite disable (0x59)", "trimble_satdisble", RO },
+ { CMD_RLASTRAW, "CMD_RLASTRAW", "last raw measurement (0x5A)", "trimble_lastraw", RO },
+ { CMD_RSTATSATEPH, "CMD_RSTATSATEPH", "satellite ephemeris status (0x5B)", "trimble_ephstatus", RO },
+ { CMD_RSTATTRACK, "CMD_RSTATTRACK", "tracking status (0x5C)", "trimble_tracking_status", RO|DEF },
+ { CMD_RADDITFIX, "CMD_RADDITFIX", "additional fix data (0x5E)", "trimble_addfix", RO },
+ { CMD_RALLINVIEW, "CMD_RALLINVIEW", "all in view satellite selection (0x6D)", "trimble_satview", RO|DEF },
+ { CMD_RPOSFILT, "CMD_RPOSFILT", "position filter parameters (0x72)", "trimble_posfilt", RO },
+ { CMD_RHEIGHTFILT, "CMD_RHEIGHTFILT", "height filter control (0x74)", "trimble_heightfilt", RO },
+ { CMD_RHIGH8CNT, "CMD_RHIGH8CNT", "high-8 (best 4) / high-6 (overdetermined) control (0x76)", "trimble_high8control", RO },
+ { CMD_RMAXAGE, "CMD_RMAXAGE", "DC MaxAge (0x78)", "trimble_dgpsmaxage", RO },
+ { CMD_RDGPSFIX, "CMD_RDGPSFIX", "differential position fix mode (0x82)", "trimble_dgpsfixmode", RO },
+ { CMD_RDOUBLEXYZ, "CMD_RDOUBLEXYZ", "double precision XYZ (0x83)", "gps_position_ext(XYZ)", RO|DEF },
+ { CMD_RDOUBLELLA, "CMD_RDOUBLELLA", "double precision LLA (0x84)", "gps_position_ext(LLA)", RO|DEF },
+ { CMD_RDGPSSTAT, "CMD_RDGPSSTAT", "differential correction status (0x85)", "trimble_dgpsstatus", RO },
+ { CMD_RSUPER, "CMD_RSUPER", "super paket (0x8F)", "", 0 },
+ { 0xFF, "", "" }
+};
diff --git a/libparse/mfp_mul.c b/libparse/mfp_mul.c
new file mode 100644
index 0000000..43c1e39
--- /dev/null
+++ b/libparse/mfp_mul.c
@@ -0,0 +1,207 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/mfp_mul.c,v 4.9 2005/07/17 20:34:40 kardel RELEASE_20050717_A
+ *
+ * mfp_mul.c,v 4.9 2005/07/17 20:34:40 kardel RELEASE_20050717_A
+ *
+ * $Created: Sat Aug 16 20:35:08 1997 $
+ *
+ * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#include <config.h>
+#include <stdio.h>
+#include "ntp_stdlib.h"
+#include "ntp_types.h"
+#include "ntp_fp.h"
+
+#define LOW_MASK (u_int32)((1<<(FRACTION_PREC/2))-1)
+#define HIGH_MASK (u_int32)(LOW_MASK << (FRACTION_PREC/2))
+
+/*
+ * for those who worry about overflows (possibly triggered by static analysis tools):
+ *
+ * Largest value of a 2^n bit number is 2^n-1.
+ * Thus the result is: (2^n-1)*(2^n-1) = 2^2n - 2^n - 2^n + 1 < 2^2n
+ * Here overflow can not happen for 2 reasons:
+ * 1) the code actually multiplies the absolute values of two signed
+ * 64bit quantities.thus effectively multiplying 2 63bit quantities.
+ * 2) Carry propagation is from low to high, building principle is
+ * addition, so no storage for the 2^2n term from above is needed.
+ */
+
+void
+mfp_mul(
+ int32 *o_i,
+ u_int32 *o_f,
+ int32 a_i,
+ u_int32 a_f,
+ int32 b_i,
+ u_int32 b_f
+ )
+{
+ int32 i, j;
+ u_int32 f;
+ u_long a[4]; /* operand a */
+ u_long b[4]; /* operand b */
+ u_long c[5]; /* result c - 5 items for performance - see below */
+ u_long carry;
+
+ int neg = 0;
+
+ if (a_i < 0) /* examine sign situation */
+ {
+ neg = 1;
+ M_NEG(a_i, a_f);
+ }
+
+ if (b_i < 0) /* examine sign situation */
+ {
+ neg = !neg;
+ M_NEG(b_i, b_f);
+ }
+
+ a[0] = a_f & LOW_MASK; /* prepare a operand */
+ a[1] = (a_f & HIGH_MASK) >> (FRACTION_PREC/2);
+ a[2] = a_i & LOW_MASK;
+ a[3] = (a_i & HIGH_MASK) >> (FRACTION_PREC/2);
+
+ b[0] = b_f & LOW_MASK; /* prepare b operand */
+ b[1] = (b_f & HIGH_MASK) >> (FRACTION_PREC/2);
+ b[2] = b_i & LOW_MASK;
+ b[3] = (b_i & HIGH_MASK) >> (FRACTION_PREC/2);
+
+ c[0] = c[1] = c[2] = c[3] = c[4] = 0;
+
+ for (i = 0; i < 4; i++) /* we do assume 32 * 32 = 64 bit multiplication */
+ for (j = 0; j < 4; j++)
+ {
+ u_long result_low, result_high;
+ int low_index = (i+j)/2; /* formal [0..3] - index for low long word */
+ int mid_index = 1+low_index; /* formal [1..4]! - index for high long word
+ will generate unecessary add of 0 to c[4]
+ but save 15 'if (result_high) expressions' */
+ int high_index = 1+mid_index; /* formal [2..5]! - index for high word overflow
+ - only assigned on overflow (limits range to 2..3) */
+
+ result_low = (u_long)a[i] * (u_long)b[j]; /* partial product */
+
+ if ((i+j) & 1) /* splits across two result registers */
+ {
+ result_high = result_low >> (FRACTION_PREC/2);
+ result_low <<= FRACTION_PREC/2;
+ carry = (unsigned)1<<(FRACTION_PREC/2);
+ }
+ else
+ { /* stays in a result register - except for overflows */
+ result_high = 0;
+ carry = 1;
+ }
+
+ if (((c[low_index] >> 1) + (result_low >> 1) + ((c[low_index] & result_low & carry) != 0)) &
+ (u_int32)((unsigned)1<<(FRACTION_PREC - 1))) {
+ result_high++; /* propagate overflows */
+ }
+
+ c[low_index] += result_low; /* add up partial products */
+
+ if (((c[mid_index] >> 1) + (result_high >> 1) + ((c[mid_index] & result_high & 1) != 0)) &
+ (u_int32)((unsigned)1<<(FRACTION_PREC - 1))) {
+ c[high_index]++; /* propagate overflows of high word sum */
+ }
+
+ c[mid_index] += result_high; /* will add a 0 to c[4] once but saves 15 if conditions */
+ }
+
+#ifdef DEBUG
+ if (debug > 6)
+ printf("mfp_mul: 0x%04lx%04lx%04lx%04lx * 0x%04lx%04lx%04lx%04lx = 0x%08lx%08lx%08lx%08lx\n",
+ a[3], a[2], a[1], a[0], b[3], b[2], b[1], b[0], c[3], c[2], c[1], c[0]);
+#endif
+
+ if (c[3]) /* overflow */
+ {
+ i = ((unsigned)1 << (FRACTION_PREC-1)) - 1;
+ f = ~(unsigned)0;
+ }
+ else
+ { /* take produkt - discarding extra precision */
+ i = c[2];
+ f = c[1];
+ }
+
+ if (neg) /* recover sign */
+ {
+ M_NEG(i, f);
+ }
+
+ *o_i = i;
+ *o_f = f;
+
+#ifdef DEBUG
+ if (debug > 6)
+ printf("mfp_mul: %s * %s => %s\n",
+ mfptoa((u_long)a_i, a_f, 6),
+ mfptoa((u_long)b_i, b_f, 6),
+ mfptoa((u_long)i, f, 6));
+#endif
+}
+
+/*
+ * History:
+ *
+ * mfp_mul.c,v
+ * Revision 4.9 2005/07/17 20:34:40 kardel
+ * correct carry propagation implementation
+ *
+ * Revision 4.8 2005/07/12 16:17:26 kardel
+ * add explanation why we do not write into c[4]
+ *
+ * Revision 4.7 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.6 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.3 1999/02/21 12:17:37 kardel
+ * 4.91f reconcilation
+ *
+ * Revision 4.2 1998/12/20 23:45:28 kardel
+ * fix types and warnings
+ *
+ * Revision 4.1 1998/05/24 07:59:57 kardel
+ * conditional debug support
+ *
+ * Revision 4.0 1998/04/10 19:46:38 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.1 1998/04/10 19:27:47 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ *
+ * Revision 1.1 1997/10/06 21:05:46 kardel
+ * new parse structure
+ *
+ */
diff --git a/libparse/mkinfo_rcmd.sed b/libparse/mkinfo_rcmd.sed
new file mode 100644
index 0000000..5238d5c
--- /dev/null
+++ b/libparse/mkinfo_rcmd.sed
@@ -0,0 +1,8 @@
+1i\
+\
+\
+cmd_info_t trimble_rcmds[] = {
+s!^#define[ \ ][ \ ]*\(CMD_R[^ \ ]*\)[ \ ][ \ ]*\([^ \ ]*\)[ \ ][ \ ]*/\*[ \ ][ \ ]*\(.*\)[ \ ]*:\([^:]*\):\([^:]*\)[ \ ][ \ ]*\*/!\ { \1, "\1", "\3 (\2)", "\4", \5 },!p
+$a\
+\ { 0xFF, "", "" }\
+};
diff --git a/libparse/mkinfo_scmd.sed b/libparse/mkinfo_scmd.sed
new file mode 100644
index 0000000..9c17f39
--- /dev/null
+++ b/libparse/mkinfo_scmd.sed
@@ -0,0 +1,15 @@
+1i\
+/*\
+\ * Automatically generated - do not modify\
+\ */\
+\
+#include <config.h>\
+#include "ntp_types.h"\
+#include "ntpd.h"\
+#include "trimble.h"\
+\
+cmd_info_t trimble_scmds[] = {
+s!^#define[ ][ ]*\(CMD_C[^ ]*\)[ ][ ]*\([^ ]*\)[ ][ ]*/\*[ ][ ]*\(.*\)[ ][ ]*\*/! { \1, "\1", "\3 (\2)", "", 0 },!p
+$a\
+\ { 0xFF, "", "" }\
+};
diff --git a/libparse/parse.c b/libparse/parse.c
new file mode 100644
index 0000000..85e5299
--- /dev/null
+++ b/libparse/parse.c
@@ -0,0 +1,945 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A
+ *
+ * parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A
+ *
+ * Parser module for reference clock
+ *
+ * PARSEKERNEL define switches between two personalities of the module
+ * if PARSEKERNEL is defined this module can be used
+ * as kernel module. In this case the time stamps will be
+ * a struct timeval.
+ * when PARSEKERNEL is not defined NTP time stamps will be used.
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE)
+
+#if !(defined(lint) || defined(__GNUC__))
+static char rcsid[] = "parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A";
+#endif
+
+#include "ntp_fp.h"
+#include "timevalops.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "ntp_machine.h"
+#include "ntp.h" /* (get Y2KFixes definitions) Y2KFixes */
+
+#include "parse.h"
+
+#ifndef PARSESTREAM
+# include <stdio.h>
+#else
+# include "sys/parsestreams.h"
+#endif
+
+extern clockformat_t *clockformats[];
+extern unsigned short nformats;
+
+static u_long timepacket (parse_t *);
+
+/*
+ * strings support usually not in kernel - duplicated, but what the heck
+ */
+static int
+Strlen(
+ register const char *s
+ )
+{
+ register int c;
+
+ c = 0;
+ if (s)
+ {
+ while (*s++)
+ {
+ c++;
+ }
+ }
+ return c;
+}
+
+static int
+Strcmp(
+ register const char *s,
+ register const char *t
+ )
+{
+ register int c = 0;
+
+ if (!s || !t || (s == t))
+ {
+ return 0;
+ }
+
+ while (!(c = *s++ - *t++) && *s && *t)
+ /* empty loop */;
+
+ return c;
+}
+
+int
+parse_timedout(
+ parse_t *parseio,
+ timestamp_t *tstamp,
+ struct timeval *del
+ )
+{
+ struct timeval delta;
+
+#ifdef PARSEKERNEL
+ delta.tv_sec = tstamp->tv.tv_sec - parseio->parse_lastchar.tv.tv_sec;
+ delta.tv_usec = tstamp->tv.tv_usec - parseio->parse_lastchar.tv.tv_usec;
+ if (delta.tv_usec < 0)
+ {
+ delta.tv_sec -= 1;
+ delta.tv_usec += 1000000;
+ }
+#else
+ l_fp delt;
+
+ delt = tstamp->fp;
+ L_SUB(&delt, &parseio->parse_lastchar.fp);
+ TSTOTV(&delt, &delta);
+#endif
+
+ if (timercmp(&delta, del, >))
+ {
+ parseprintf(DD_PARSE, ("parse: timedout: TRUE\n"));
+ return 1;
+ }
+ else
+ {
+ parseprintf(DD_PARSE, ("parse: timedout: FALSE\n"));
+ return 0;
+ }
+}
+
+/*ARGSUSED*/
+int
+parse_ioinit(
+ register parse_t *parseio
+ )
+{
+ parseprintf(DD_PARSE, ("parse_iostart\n"));
+
+ parseio->parse_plen = 0;
+ parseio->parse_pdata = (void *)0;
+
+ parseio->parse_data = 0;
+ parseio->parse_ldata = 0;
+ parseio->parse_dsize = 0;
+
+ parseio->parse_badformat = 0;
+ parseio->parse_ioflags = PARSE_IO_CS7; /* usual unix default */
+ parseio->parse_index = 0;
+ parseio->parse_ldsize = 0;
+
+ return 1;
+}
+
+/*ARGSUSED*/
+void
+parse_ioend(
+ register parse_t *parseio
+ )
+{
+ parseprintf(DD_PARSE, ("parse_ioend\n"));
+
+ if (parseio->parse_pdata)
+ FREE(parseio->parse_pdata, parseio->parse_plen);
+
+ if (parseio->parse_data)
+ FREE(parseio->parse_data, (unsigned)(parseio->parse_dsize * 2 + 2));
+}
+
+unsigned int
+parse_restart(
+ parse_t *parseio,
+ unsigned int ch
+ )
+{
+ unsigned int updated = PARSE_INP_SKIP;
+
+ /*
+ * re-start packet - timeout - overflow - start symbol
+ */
+
+ if (parseio->parse_index)
+ {
+ /*
+ * filled buffer - thus not end character found
+ * do processing now
+ */
+ parseio->parse_data[parseio->parse_index] = '\0';
+ memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1));
+ parseio->parse_ldsize = parseio->parse_index;
+ updated = PARSE_INP_TIME;
+ }
+
+ parseio->parse_index = 1;
+ parseio->parse_data[0] = ch;
+ parseprintf(DD_PARSE, ("parse: parse_restart: buffer start (updated = %x)\n", updated));
+ return updated;
+}
+
+unsigned int
+parse_addchar(
+ parse_t *parseio,
+ unsigned int ch
+ )
+{
+ /*
+ * add to buffer
+ */
+ if (parseio->parse_index < parseio->parse_dsize)
+ {
+ /*
+ * collect into buffer
+ */
+ parseprintf(DD_PARSE, ("parse: parse_addchar: buffer[%d] = 0x%x\n", parseio->parse_index, ch));
+ parseio->parse_data[parseio->parse_index++] = (char)ch;
+ return PARSE_INP_SKIP;
+ }
+ else
+ /*
+ * buffer overflow - attempt to make the best of it
+ */
+ return parse_restart(parseio, ch);
+}
+
+unsigned int
+parse_end(
+ parse_t *parseio
+ )
+{
+ /*
+ * message complete processing
+ */
+ parseio->parse_data[parseio->parse_index] = '\0';
+ memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1));
+ parseio->parse_ldsize = parseio->parse_index;
+ parseio->parse_index = 0;
+ parseprintf(DD_PARSE, ("parse: parse_end: buffer end\n"));
+ return PARSE_INP_TIME;
+}
+
+/*ARGSUSED*/
+int
+parse_ioread(
+ register parse_t *parseio,
+ register unsigned int ch,
+ register timestamp_t *tstamp
+ )
+{
+ register unsigned updated = CVT_NONE;
+ /*
+ * within STREAMS CSx (x < 8) chars still have the upper bits set
+ * so we normalize the characters by masking unecessary bits off.
+ */
+ switch (parseio->parse_ioflags & PARSE_IO_CSIZE)
+ {
+ case PARSE_IO_CS5:
+ ch &= 0x1F;
+ break;
+
+ case PARSE_IO_CS6:
+ ch &= 0x3F;
+ break;
+
+ case PARSE_IO_CS7:
+ ch &= 0x7F;
+ break;
+
+ case PARSE_IO_CS8:
+ ch &= 0xFF;
+ break;
+ }
+
+ parseprintf(DD_PARSE, ("parse_ioread(0x%lx, char=0x%x, ..., ...)\n", (unsigned long)parseio, ch & 0xFF));
+
+ if (!clockformats[parseio->parse_lformat]->convert)
+ {
+ parseprintf(DD_PARSE, ("parse_ioread: input dropped.\n"));
+ return CVT_NONE;
+ }
+
+ if (clockformats[parseio->parse_lformat]->input)
+ {
+ unsigned long input_status;
+
+ input_status = clockformats[parseio->parse_lformat]->input(parseio, ch, tstamp);
+
+ if (input_status & PARSE_INP_SYNTH)
+ {
+ updated = CVT_OK;
+ }
+
+ if (input_status & PARSE_INP_TIME) /* time sample is available */
+ {
+ updated = timepacket(parseio);
+ }
+
+ if (input_status & PARSE_INP_DATA) /* got additional data */
+ {
+ updated |= CVT_ADDITIONAL;
+ }
+ }
+
+
+ /*
+ * remember last character time
+ */
+ parseio->parse_lastchar = *tstamp;
+
+#ifdef DEBUG
+ if ((updated & CVT_MASK) != CVT_NONE)
+ {
+ parseprintf(DD_PARSE, ("parse_ioread: time sample accumulated (status=0x%x)\n", updated));
+ }
+#endif
+
+ parseio->parse_dtime.parse_status = updated;
+
+ return (((updated & CVT_MASK) != CVT_NONE) ||
+ ((updated & CVT_ADDITIONAL) != 0));
+}
+
+/*
+ * parse_iopps
+ *
+ * take status line indication and derive synchronisation information
+ * from it.
+ * It can also be used to decode a serial serial data format (such as the
+ * ONE, ZERO, MINUTE sync data stream from DCF77)
+ */
+/*ARGSUSED*/
+int
+parse_iopps(
+ register parse_t *parseio,
+ register int status,
+ register timestamp_t *ptime
+ )
+{
+ register unsigned updated = CVT_NONE;
+
+ /*
+ * PPS pulse information will only be delivered to ONE clock format
+ * this is either the last successful conversion module with a ppssync
+ * routine, or a fixed format with a ppssync routine
+ */
+ parseprintf(DD_PARSE, ("parse_iopps: STATUS %s\n", (status == SYNC_ONE) ? "ONE" : "ZERO"));
+
+ if (clockformats[parseio->parse_lformat]->syncpps)
+ {
+ updated = clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime);
+ parseprintf(DD_PARSE, ("parse_iopps: updated = 0x%x\n", updated));
+ }
+
+ return (updated & CVT_MASK) != CVT_NONE;
+}
+
+/*
+ * parse_iodone
+ *
+ * clean up internal status for new round
+ */
+/*ARGSUSED*/
+void
+parse_iodone(
+ register parse_t *parseio
+ )
+{
+ /*
+ * we need to clean up certain flags for the next round
+ */
+ parseprintf(DD_PARSE, ("parse_iodone: DONE\n"));
+ parseio->parse_dtime.parse_state = 0; /* no problems with ISRs */
+}
+
+/*---------- conversion implementation --------------------*/
+
+/*
+ * convert a struct clock to UTC since Jan, 1st 1970 0:00 (the UNIX EPOCH)
+ */
+#define days_per_year(x) ((x) % 4 ? 365 : ((x % 400) ? ((x % 100) ? 366 : 365) : 366))
+
+time_t
+parse_to_unixtime(
+ register clocktime_t *clock_time,
+ register u_long *cvtrtc
+ )
+{
+#define SETRTC(_X_) { if (cvtrtc) *cvtrtc = (_X_); }
+ static int days_of_month[] =
+ {
+ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+ };
+ register int i;
+ time_t t;
+
+ if (clock_time->utctime)
+ return clock_time->utctime; /* if the conversion routine gets it right away - why not */
+
+ if ( clock_time->year < YEAR_PIVOT ) /* Y2KFixes [ */
+ clock_time->year += 100; /* convert 20xx%100 to 20xx-1900 */
+ if ( clock_time->year < YEAR_BREAK ) /* expand to full four-digits */
+ clock_time->year += 1900;
+
+ if (clock_time->year < 1970 ) /* Y2KFixes ] */
+ {
+ SETRTC(CVT_FAIL|CVT_BADDATE);
+ return -1;
+ }
+
+ /*
+ * sorry, slow section here - but it's not time critical anyway
+ */
+ t = julian0(clock_time->year) - julian0(1970); /* Y2kFixes */
+ /* month */
+ if (clock_time->month <= 0 || clock_time->month > 12)
+ {
+ SETRTC(CVT_FAIL|CVT_BADDATE);
+ return -1; /* bad month */
+ }
+
+#if 0 /* Y2KFixes */
+ /* adjust leap year */
+ if (clock_time->month < 3 && days_per_year(clock_time->year) == 366)
+ t--;
+#else /* Y2KFixes [ */
+ if ( clock_time->month >= 3 && isleap_4(clock_time->year) )
+ t++; /* add one more if within leap year */
+#endif /* Y2KFixes ] */
+
+ for (i = 1; i < clock_time->month; i++)
+ {
+ t += days_of_month[i];
+ }
+ /* day */
+ if (clock_time->day < 1 || ((clock_time->month == 2 && days_per_year(clock_time->year) == 366) ?
+ clock_time->day > 29 : clock_time->day > days_of_month[clock_time->month]))
+ {
+ SETRTC(CVT_FAIL|CVT_BADDATE);
+ return -1; /* bad day */
+ }
+
+ t += clock_time->day - 1;
+ /* hour */
+ if (clock_time->hour < 0 || clock_time->hour >= 24)
+ {
+ SETRTC(CVT_FAIL|CVT_BADTIME);
+ return -1; /* bad hour */
+ }
+
+ t = TIMES24(t) + clock_time->hour;
+
+ /* min */
+ if (clock_time->minute < 0 || clock_time->minute > 59)
+ {
+ SETRTC(CVT_FAIL|CVT_BADTIME);
+ return -1; /* bad min */
+ }
+
+ t = TIMES60(t) + clock_time->minute;
+ /* sec */
+
+ if (clock_time->second < 0 || clock_time->second > 60) /* allow for LEAPs */
+ {
+ SETRTC(CVT_FAIL|CVT_BADTIME);
+ return -1; /* bad sec */
+ }
+
+ t = TIMES60(t) + clock_time->second;
+
+ t += clock_time->utcoffset; /* warp to UTC */
+
+ /* done */
+
+ clock_time->utctime = t; /* documentray only */
+
+ return t;
+}
+
+/*--------------- format conversion -----------------------------------*/
+
+int
+Stoi(
+ const unsigned char *s,
+ long *zp,
+ int cnt
+ )
+{
+ char unsigned const *b = s;
+ int f,z,v;
+ char unsigned c;
+
+ f=z=v=0;
+
+ while(*s == ' ')
+ s++;
+
+ if (*s == '-')
+ {
+ s++;
+ v = 1;
+ }
+ else
+ if (*s == '+')
+ s++;
+
+ for(;;)
+ {
+ c = *s++;
+ if (c == '\0' || c < '0' || c > '9' || (cnt && ((s-b) > cnt)))
+ {
+ if (f == 0)
+ {
+ return(-1);
+ }
+ if (v)
+ z = -z;
+ *zp = z;
+ return(0);
+ }
+ z = (z << 3) + (z << 1) + ( c - '0' );
+ f=1;
+ }
+}
+
+int
+Strok(
+ const unsigned char *s,
+ const unsigned char *m
+ )
+{
+ if (!s || !m)
+ return 0;
+
+ while(*s && *m)
+ {
+ if ((*m == ' ') ? 1 : (*s == *m))
+ {
+ s++;
+ m++;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ return !*m;
+}
+
+u_long
+updatetimeinfo(
+ register parse_t *parseio,
+ register u_long flags
+ )
+{
+#ifdef PARSEKERNEL
+ {
+ int s = splhigh();
+#endif
+
+ parseio->parse_lstate = parseio->parse_dtime.parse_state | flags | PARSEB_TIMECODE;
+
+ parseio->parse_dtime.parse_state = parseio->parse_lstate;
+
+#ifdef PARSEKERNEL
+ (void)splx((unsigned int)s);
+ }
+#endif
+
+
+#ifdef PARSEKERNEL
+ parseprintf(DD_PARSE, ("updatetimeinfo status=0x%x, time=%x\n", parseio->parse_dtime.parse_state,
+ parseio->parse_dtime.parse_time.tv.tv_sec));
+#else
+ parseprintf(DD_PARSE, ("updatetimeinfo status=0x%lx, time=%x\n", (long)parseio->parse_dtime.parse_state,
+ parseio->parse_dtime.parse_time.fp.l_ui));
+#endif
+
+ return CVT_OK; /* everything fine and dandy... */
+}
+
+
+/*
+ * syn_simple
+ *
+ * handle a sync time stamp
+ */
+/*ARGSUSED*/
+void
+syn_simple(
+ register parse_t *parseio,
+ register timestamp_t *ts,
+ register struct format *format,
+ register u_long why
+ )
+{
+ parseio->parse_dtime.parse_stime = *ts;
+}
+
+/*
+ * pps_simple
+ *
+ * handle a pps time stamp
+ */
+/*ARGSUSED*/
+u_long
+pps_simple(
+ register parse_t *parseio,
+ register int status,
+ register timestamp_t *ptime
+ )
+{
+ parseio->parse_dtime.parse_ptime = *ptime;
+ parseio->parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+
+ return CVT_NONE;
+}
+
+/*
+ * pps_one
+ *
+ * handle a pps time stamp in ONE edge
+ */
+/*ARGSUSED*/
+u_long
+pps_one(
+ register parse_t *parseio,
+ register int status,
+ register timestamp_t *ptime
+ )
+{
+ if (status)
+ return pps_simple(parseio, status, ptime);
+
+ return CVT_NONE;
+}
+
+/*
+ * pps_zero
+ *
+ * handle a pps time stamp in ZERO edge
+ */
+/*ARGSUSED*/
+u_long
+pps_zero(
+ register parse_t *parseio,
+ register int status,
+ register timestamp_t *ptime
+ )
+{
+ if (!status)
+ return pps_simple(parseio, status, ptime);
+
+ return CVT_NONE;
+}
+
+/*
+ * timepacket
+ *
+ * process a data packet
+ */
+static u_long
+timepacket(
+ register parse_t *parseio
+ )
+{
+ register unsigned short format;
+ register time_t t;
+ u_long cvtrtc; /* current conversion result */
+ clocktime_t clock_time;
+
+ memset((char *)&clock_time, 0, sizeof clock_time);
+ format = parseio->parse_lformat;
+
+ if (format == (unsigned short)~0)
+ return CVT_NONE;
+
+ switch ((cvtrtc = clockformats[format]->convert ?
+ clockformats[format]->convert((unsigned char *)parseio->parse_ldata, parseio->parse_ldsize, (struct format *)(clockformats[format]->data), &clock_time, parseio->parse_pdata) :
+ CVT_NONE) & CVT_MASK)
+ {
+ case CVT_FAIL:
+ parseio->parse_badformat++;
+ break;
+
+ case CVT_NONE:
+ /*
+ * too bad - pretend bad format
+ */
+ parseio->parse_badformat++;
+ break;
+
+ case CVT_OK:
+ break;
+
+ case CVT_SKIP:
+ return CVT_NONE;
+
+ default:
+ /* shouldn't happen */
+#ifndef PARSEKERNEL
+ msyslog(LOG_WARNING, "parse: INTERNAL error: bad return code of convert routine \"%s\"", clockformats[format]->name);
+#endif
+ return CVT_FAIL|cvtrtc;
+ }
+
+ if ((t = parse_to_unixtime(&clock_time, &cvtrtc)) == -1)
+ {
+ return CVT_FAIL|cvtrtc;
+ }
+
+ /*
+ * time stamp
+ */
+#ifdef PARSEKERNEL
+ parseio->parse_dtime.parse_time.tv.tv_sec = t;
+ parseio->parse_dtime.parse_time.tv.tv_usec = clock_time.usecond;
+#else
+ parseio->parse_dtime.parse_time.fp.l_ui = t + JAN_1970;
+ TVUTOTSF(clock_time.usecond, parseio->parse_dtime.parse_time.fp.l_uf);
+#endif
+
+ parseio->parse_dtime.parse_format = format;
+
+ return updatetimeinfo(parseio, clock_time.flags);
+}
+
+/*ARGSUSED*/
+int
+parse_timecode(
+ parsectl_t *dct,
+ parse_t *parse
+ )
+{
+ dct->parsegettc.parse_state = parse->parse_lstate;
+ dct->parsegettc.parse_format = parse->parse_lformat;
+ /*
+ * move out current bad packet count
+ * user program is expected to sum these up
+ * this is not a problem, as "parse" module are
+ * exclusive open only
+ */
+ dct->parsegettc.parse_badformat = parse->parse_badformat;
+ parse->parse_badformat = 0;
+
+ if (parse->parse_ldsize <= PARSE_TCMAX)
+ {
+ dct->parsegettc.parse_count = parse->parse_ldsize;
+ memcpy(dct->parsegettc.parse_buffer, parse->parse_ldata, dct->parsegettc.parse_count);
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+/*ARGSUSED*/
+int
+parse_setfmt(
+ parsectl_t *dct,
+ parse_t *parse
+ )
+{
+ if (dct->parseformat.parse_count <= PARSE_TCMAX)
+ {
+ if (dct->parseformat.parse_count)
+ {
+ register unsigned short i;
+
+ for (i = 0; i < nformats; i++)
+ {
+ if (!Strcmp(dct->parseformat.parse_buffer, clockformats[i]->name))
+ {
+ if (parse->parse_pdata)
+ FREE(parse->parse_pdata, parse->parse_plen);
+ parse->parse_pdata = 0;
+
+ parse->parse_plen = clockformats[i]->plen;
+
+ if (parse->parse_plen)
+ {
+ parse->parse_pdata = MALLOC(parse->parse_plen);
+ if (!parse->parse_pdata)
+ {
+ parseprintf(DD_PARSE, ("set format failed: malloc for private data area failed\n"));
+ return 0;
+ }
+ memset((char *)parse->parse_pdata, 0, parse->parse_plen);
+ }
+
+ if (parse->parse_data)
+ FREE(parse->parse_data, (unsigned)(parse->parse_dsize * 2 + 2));
+ parse->parse_ldata = parse->parse_data = 0;
+
+ parse->parse_dsize = clockformats[i]->length;
+
+ if (parse->parse_dsize)
+ {
+ parse->parse_data = (char*)MALLOC((unsigned)(parse->parse_dsize * 2 + 2));
+ if (!parse->parse_data)
+ {
+ if (parse->parse_pdata)
+ FREE(parse->parse_pdata, parse->parse_plen);
+ parse->parse_pdata = 0;
+
+ parseprintf(DD_PARSE, ("init failed: malloc for data area failed\n"));
+ return 0;
+ }
+ }
+
+
+ /*
+ * leave room for '\0'
+ */
+ parse->parse_ldata = parse->parse_data + parse->parse_dsize + 1;
+
+ parse->parse_lformat = i;
+
+ return 1;
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+/*ARGSUSED*/
+int
+parse_getfmt(
+ parsectl_t *dct,
+ parse_t *parse
+ )
+{
+ if (dct->parseformat.parse_format < nformats &&
+ Strlen(clockformats[dct->parseformat.parse_format]->name) <= PARSE_TCMAX)
+ {
+ dct->parseformat.parse_count = Strlen(clockformats[dct->parseformat.parse_format]->name)+1;
+ memcpy(dct->parseformat.parse_buffer, clockformats[dct->parseformat.parse_format]->name, dct->parseformat.parse_count);
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/*ARGSUSED*/
+int
+parse_setcs(
+ parsectl_t *dct,
+ parse_t *parse
+ )
+{
+ parse->parse_ioflags &= ~PARSE_IO_CSIZE;
+ parse->parse_ioflags |= dct->parsesetcs.parse_cs & PARSE_IO_CSIZE;
+ return 1;
+}
+
+#else /* not (REFCLOCK && CLOCK_PARSE) */
+int parse_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE) */
+
+/*
+ * History:
+ *
+ * parse.c,v
+ * Revision 4.20 2005/08/06 17:39:40 kardel
+ * cleanup size handling wrt/ to buffer boundaries
+ *
+ * Revision 4.19 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.18 2004/11/14 16:11:05 kardel
+ * update Id tags
+ *
+ * Revision 4.17 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.14 1999/11/28 09:13:52 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.13 1999/02/28 11:50:20 kardel
+ * (timepacket): removed unecessary code
+ *
+ * Revision 4.12 1999/02/21 12:17:44 kardel
+ * 4.91f reconcilation
+ *
+ * Revision 4.11 1999/02/21 11:09:47 kardel
+ * unified debug output
+ *
+ * Revision 4.10 1998/12/20 23:45:30 kardel
+ * fix types and warnings
+ *
+ * Revision 4.9 1998/08/09 22:26:06 kardel
+ * Trimble TSIP support
+ *
+ * Revision 4.8 1998/06/14 21:09:39 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.7 1998/06/13 15:19:13 kardel
+ * fix mem*() to b*() function macro emulation
+ *
+ * Revision 4.6 1998/06/13 13:24:13 kardel
+ * printf fmt
+ *
+ * Revision 4.5 1998/06/13 13:01:10 kardel
+ * printf fmt
+ *
+ * Revision 4.4 1998/06/13 12:12:10 kardel
+ * bcopy/memcpy cleanup
+ * fix SVSV name clash
+ *
+ * Revision 4.3 1998/06/12 15:22:30 kardel
+ * fix prototypes
+ *
+ * Revision 4.2 1998/06/12 09:13:27 kardel
+ * conditional compile macros fixed
+ * printf prototype
+ *
+ * Revision 4.1 1998/05/24 09:39:55 kardel
+ * implementation of the new IO handling model
+ *
+ * Revision 4.0 1998/04/10 19:45:36 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.46 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/parse_conf.c b/libparse/parse_conf.c
new file mode 100644
index 0000000..b7234dd
--- /dev/null
+++ b/libparse/parse_conf.c
@@ -0,0 +1,182 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * parse_conf.c,v 4.9 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * Parser configuration module for reference clocks
+ *
+ * STREAM define switches between two personalities of the module
+ * if STREAM is defined this module can be used with dcf77sync.c as
+ * a STREAMS kernel module. In this case the time stamps will be
+ * a struct timeval.
+ * when STREAM is not defined NTP time stamps will be used.
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE)
+
+#include "ntp_fp.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+
+#include "parse.h"
+
+#ifdef CLOCK_SCHMID
+extern clockformat_t clock_schmid;
+#endif
+
+#ifdef CLOCK_DCF7000
+extern clockformat_t clock_dcf7000;
+#endif
+
+#ifdef CLOCK_MEINBERG
+extern clockformat_t clock_meinberg[];
+#endif
+
+#ifdef CLOCK_RAWDCF
+extern clockformat_t clock_rawdcf;
+#endif
+
+#ifdef CLOCK_TRIMTAIP
+extern clockformat_t clock_trimtaip;
+#endif
+
+#ifdef CLOCK_TRIMTSIP
+extern clockformat_t clock_trimtsip;
+#endif
+
+#ifdef CLOCK_RCC8000
+extern clockformat_t clock_rcc8000;
+#endif
+
+#ifdef CLOCK_HOPF6021
+extern clockformat_t clock_hopf6021;
+#endif
+
+#ifdef CLOCK_COMPUTIME
+extern clockformat_t clock_computime;
+#endif
+
+#ifdef CLOCK_WHARTON_400A
+extern clockformat_t clock_wharton_400a;
+#endif
+
+#ifdef CLOCK_VARITEXT
+extern clockformat_t clock_varitext;
+#endif
+
+#ifdef CLOCK_SEL240X
+extern clockformat_t clock_sel240x;
+#endif
+
+/*
+ * format definitions
+ */
+clockformat_t *clockformats[] =
+{
+#ifdef CLOCK_MEINBERG
+ &clock_meinberg[0],
+ &clock_meinberg[1],
+ &clock_meinberg[2],
+#endif
+#ifdef CLOCK_DCF7000
+ &clock_dcf7000,
+#endif
+#ifdef CLOCK_SCHMID
+ &clock_schmid,
+#endif
+#ifdef CLOCK_RAWDCF
+ &clock_rawdcf,
+#endif
+#ifdef CLOCK_TRIMTAIP
+ &clock_trimtaip,
+#endif
+#ifdef CLOCK_TRIMTSIP
+ &clock_trimtsip,
+#endif
+#ifdef CLOCK_RCC8000
+ &clock_rcc8000,
+#endif
+#ifdef CLOCK_HOPF6021
+ &clock_hopf6021,
+#endif
+#ifdef CLOCK_COMPUTIME
+ &clock_computime,
+#endif
+#ifdef CLOCK_WHARTON_400A
+ &clock_wharton_400a,
+#endif
+#ifdef CLOCK_VARITEXT
+ &clock_varitext,
+#endif
+#ifdef CLOCK_SEL240X
+ &clock_sel240x,
+#endif
+ 0};
+
+unsigned short nformats = sizeof(clockformats) / sizeof(clockformats[0]) - 1;
+
+#else /* not (REFCLOCK && CLOCK_PARSE) */
+int parse_conf_bs;
+#endif /* not (REFCLOCK && CLOCK_PARSE) */
+
+/*
+ * History:
+ *
+ * parse_conf.c,v
+ * Revision 4.9 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.8 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.5 1999/11/28 09:13:53 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.4 1999/02/28 15:27:25 kardel
+ * wharton clock integration
+ *
+ * Revision 4.3 1998/08/16 18:52:15 kardel
+ * (clockformats): Trimble TSIP driver now also
+ * available for kernel operation
+ *
+ * Revision 4.2 1998/06/12 09:13:48 kardel
+ * conditional compile macros fixed
+ *
+ * Revision 4.1 1998/05/24 09:40:49 kardel
+ * adjustments of log messages
+ *
+ *
+ * from V3 3.24 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/parsesolaris.c b/libparse/parsesolaris.c
new file mode 100644
index 0000000..d3756af
--- /dev/null
+++ b/libparse/parsesolaris.c
@@ -0,0 +1,1202 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * STREAMS module for reference clocks
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#define _KERNEL /* it is a _KERNEL module */
+
+#ifndef lint
+static char rcsid[] = "parsesolaris.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A";
+#endif
+
+#include <config.h>
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/errno.h>
+#include <sys/time.h>
+#include <sys/termios.h>
+#include <sys/stream.h>
+#include <sys/strtty.h>
+#include <sys/stropts.h>
+#include <sys/modctl.h>
+#include <sys/ddi.h>
+#include <sys/sunddi.h>
+#ifdef __GNUC__ /* makes it compile on Solaris 2.6 - acc doesn't like it -- GREAT! */
+#include <stdarg.h>
+#endif
+
+#include "ntp_fp.h"
+#include "parse.h"
+#include <sys/parsestreams.h>
+
+/*--------------- loadable driver section -----------------------------*/
+
+static struct streamtab parseinfo;
+
+static struct fmodsw fmod_templ =
+{
+ "parse", /* module name */
+ &parseinfo, /* module information */
+ D_NEW|D_MP|D_MTQPAIR, /* exclusive for q pair */
+ /* lock ptr */
+};
+
+extern struct mod_ops mod_strmodops;
+
+static struct modlstrmod modlstrmod =
+{
+ &mod_strmodops, /* a STREAMS module */
+ "PARSE - NTP reference", /* name this baby - keep room for revision number */
+ &fmod_templ
+};
+
+static struct modlinkage modlinkage =
+{
+ MODREV_1,
+ {
+ &modlstrmod,
+ NULL
+ }
+};
+
+/*
+ * module management routines
+ */
+/*ARGSUSED*/
+int
+_init(
+ void
+ )
+{
+ static char revision[] = "4.6";
+ char *s, *S;
+ char *t;
+
+#ifndef lint
+ t = rcsid;
+#endif
+
+ /*
+ * copy RCS revision into Drv_name
+ *
+ * are we forcing RCS here to do things it was not built for ?
+ */
+ s = revision;
+ if (*s == '$')
+ {
+ /*
+ * skip "$Revision: "
+ * if present. - not necessary on a -kv co (cvs export)
+ */
+ while (*s && (*s != ' '))
+ {
+ s++;
+ }
+ if (*s == ' ') s++;
+ }
+
+ t = modlstrmod.strmod_linkinfo;
+ while (*t && (*t != ' '))
+ {
+ t++;
+ }
+ if (*t == ' ') t++;
+
+ S = s;
+ while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.')))
+ {
+ S++;
+ }
+
+ if (*s && *t && (S > s))
+ {
+ if (strlen(t) >= (S - s))
+ {
+ strlcpy(t, s, (unsigned)(S - s));
+ }
+ }
+ return (mod_install(&modlinkage));
+}
+
+/*ARGSUSED*/
+int
+_info(
+ struct modinfo *modinfop
+ )
+{
+ return (mod_info(&modlinkage, modinfop));
+}
+
+/*ARGSUSED*/
+int
+_fini(
+ void
+ )
+{
+ if (mod_remove(&modlinkage) != DDI_SUCCESS)
+ {
+ return EBUSY;
+ }
+ else
+ return DDI_SUCCESS;
+}
+
+/*--------------- stream module definition ----------------------------*/
+
+static int parseopen (queue_t *, dev_t *, int, int, cred_t *);
+static int parseclose (queue_t *, int);
+static int parsewput (queue_t *, mblk_t *);
+static int parserput (queue_t *, mblk_t *);
+static int parsersvc (queue_t *);
+
+static struct module_info driverinfo =
+{
+ 0, /* module ID number */
+ fmod_templ.f_name, /* module name - why repeated here ? compat ?*/
+ 0, /* minimum accepted packet size */
+ INFPSZ, /* maximum accepted packet size */
+ 1, /* high water mark - flow control */
+ 0 /* low water mark - flow control */
+};
+
+static struct qinit rinit = /* read queue definition */
+{
+ parserput, /* put procedure */
+ parsersvc, /* service procedure */
+ parseopen, /* open procedure */
+ parseclose, /* close procedure */
+ NULL, /* admin procedure - NOT USED FOR NOW */
+ &driverinfo, /* information structure */
+ NULL /* statistics */
+};
+
+static struct qinit winit = /* write queue definition */
+{
+ parsewput, /* put procedure */
+ NULL, /* service procedure */
+ NULL, /* open procedure */
+ NULL, /* close procedure */
+ NULL, /* admin procedure - NOT USED FOR NOW */
+ &driverinfo, /* information structure */
+ NULL /* statistics */
+};
+
+static struct streamtab parseinfo = /* stream info element for parse driver */
+{
+ &rinit, /* read queue */
+ &winit, /* write queue */
+ NULL, /* read mux */
+ NULL /* write mux */
+};
+
+/*--------------- driver data structures ----------------------------*/
+
+/*
+ * we usually have an inverted signal - but you
+ * can change this to suit your needs
+ */
+int cd_invert = 1; /* invert status of CD line - PPS support via CD input */
+
+#ifdef PARSEDEBUG
+int parsedebug = ~0;
+#else
+int parsedebug = 0;
+#endif
+
+/*--------------- module implementation -----------------------------*/
+
+#define TIMEVAL_USADD(_X_, _US_) do {\
+ (_X_)->tv_usec += (_US_);\
+ if ((_X_)->tv_usec >= 1000000)\
+ {\
+ (_X_)->tv_sec++;\
+ (_X_)->tv_usec -= 1000000;\
+ }\
+ } while (0)
+
+static int init_linemon (queue_t *);
+static void close_linemon (queue_t *, queue_t *);
+
+#define M_PARSE 0x0001
+#define M_NOPARSE 0x0002
+
+void
+ntp_memset(
+ char *a,
+ int x,
+ int c
+ )
+{
+ while (c-- > 0)
+ *a++ = x;
+}
+
+static void
+pprintf(
+ int lev,
+ char *form,
+ ...
+ )
+{
+ va_list ap;
+
+ va_start(ap, form);
+
+ if (lev & parsedebug)
+ vcmn_err(CE_CONT, form, ap);
+
+ va_end(ap);
+}
+
+static int
+setup_stream(
+ queue_t *q,
+ int mode
+ )
+{
+ register mblk_t *mp;
+
+ pprintf(DD_OPEN,"parse: SETUP_STREAM - setting up stream for q=%x\n", q);
+
+ mp = allocb(sizeof(struct stroptions), BPRI_MED);
+ if (mp)
+ {
+ struct stroptions *str = (void *)mp->b_wptr;
+
+ str->so_flags = SO_READOPT|SO_HIWAT|SO_LOWAT|SO_ISNTTY;
+ str->so_readopt = (mode == M_PARSE) ? RMSGD : RNORM;
+ str->so_hiwat = (mode == M_PARSE) ? sizeof(parsetime_t) : 256;
+ str->so_lowat = 0;
+ mp->b_datap->db_type = M_SETOPTS;
+ mp->b_wptr += sizeof(struct stroptions);
+ if (!q)
+ panic("NULL q - strange");
+ putnext(q, mp);
+ return putctl1(WR(q)->q_next, M_CTL, (mode == M_PARSE) ? MC_SERVICEIMM :
+ MC_SERVICEDEF);
+ }
+ else
+ {
+ pprintf(DD_OPEN, "parse: setup_stream - FAILED - no MEMORY for allocb\n");
+ return 0;
+ }
+}
+
+/*ARGSUSED*/
+static int
+parseopen(
+ queue_t *q,
+ dev_t *dev,
+ int flag,
+ int sflag,
+ cred_t *credp
+ )
+{
+ register parsestream_t *parse;
+ static int notice = 0;
+
+ pprintf(DD_OPEN, "parse: OPEN - q=%x\n", q);
+
+ if (sflag != MODOPEN)
+ { /* open only for modules */
+ pprintf(DD_OPEN, "parse: OPEN - FAILED - not MODOPEN\n");
+ return EIO;
+ }
+
+ if (q->q_ptr != (caddr_t)NULL)
+ {
+ pprintf(DD_OPEN, "parse: OPEN - FAILED - EXCLUSIVE ONLY\n");
+ return EBUSY;
+ }
+
+ q->q_ptr = (caddr_t)kmem_alloc(sizeof(parsestream_t), KM_SLEEP);
+ if (q->q_ptr == (caddr_t)0)
+ {
+ return ENOMEM;
+ }
+
+ pprintf(DD_OPEN, "parse: OPEN - parse area q=%x, q->q_ptr=%x\n", q, q->q_ptr);
+ WR(q)->q_ptr = q->q_ptr;
+ pprintf(DD_OPEN, "parse: OPEN - WQ parse area q=%x, q->q_ptr=%x\n", WR(q), WR(q)->q_ptr);
+
+ parse = (parsestream_t *) q->q_ptr;
+ bzero((caddr_t)parse, sizeof(*parse));
+ parse->parse_queue = q;
+ parse->parse_status = PARSE_ENABLE;
+ parse->parse_ppsclockev.tv.tv_sec = 0;
+ parse->parse_ppsclockev.tv.tv_usec = 0;
+ parse->parse_ppsclockev.serial = 0;
+
+ qprocson(q);
+
+ pprintf(DD_OPEN, "parse: OPEN - initializing io subsystem q=%x\n", q);
+
+ if (!parse_ioinit(&parse->parse_io))
+ {
+ /*
+ * ok guys - beat it
+ */
+ qprocsoff(q);
+
+ kmem_free((caddr_t)parse, sizeof(parsestream_t));
+
+ return EIO;
+ }
+
+ pprintf(DD_OPEN, "parse: OPEN - initializing stream q=%x\n", q);
+
+ if (setup_stream(q, M_PARSE))
+ {
+ (void) init_linemon(q); /* hook up PPS ISR routines if possible */
+ pprintf(DD_OPEN, "parse: OPEN - SUCCEEDED\n");
+
+ /*
+ * I know that you know the delete key, but you didn't write this
+ * code, did you ? - So, keep the message in here.
+ */
+ if (!notice)
+ {
+ cmn_err(CE_CONT, "?%s: Copyright (c) 1993-2005, Frank Kardel\n", modlstrmod.strmod_linkinfo);
+ notice = 1;
+ }
+
+ return 0;
+ }
+ else
+ {
+ qprocsoff(q);
+
+ kmem_free((caddr_t)parse, sizeof(parsestream_t));
+
+ return EIO;
+ }
+}
+
+/*ARGSUSED*/
+static int
+parseclose(
+ queue_t *q,
+ int flags
+ )
+{
+ register parsestream_t *parse = (parsestream_t *)q->q_ptr;
+ register unsigned long s;
+
+ pprintf(DD_CLOSE, "parse: CLOSE\n");
+
+ qprocsoff(q);
+
+ s = splhigh();
+
+ if (parse->parse_dqueue)
+ close_linemon(parse->parse_dqueue, q);
+ parse->parse_dqueue = (queue_t *)0;
+
+ (void) splx(s);
+
+ parse_ioend(&parse->parse_io);
+
+ kmem_free((caddr_t)parse, sizeof(parsestream_t));
+
+ q->q_ptr = (caddr_t)NULL;
+ WR(q)->q_ptr = (caddr_t)NULL;
+
+ return 0;
+}
+
+/*
+ * move unrecognized stuff upward
+ */
+static int
+parsersvc(
+ queue_t *q
+ )
+{
+ mblk_t *mp;
+
+ while ((mp = getq(q)))
+ {
+ if (canputnext(q) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ pprintf(DD_RSVC, "parse: RSVC - putnext\n");
+ }
+ else
+ {
+ putbq(q, mp);
+ pprintf(DD_RSVC, "parse: RSVC - flow control wait\n");
+ break;
+ }
+ }
+ return 0;
+}
+
+/*
+ * do ioctls and
+ * send stuff down - dont care about
+ * flow control
+ */
+static int
+parsewput(
+ queue_t *q,
+ mblk_t *mp
+ )
+{
+ register int ok = 1;
+ register mblk_t *datap;
+ register struct iocblk *iocp;
+ parsestream_t *parse = (parsestream_t *)q->q_ptr;
+
+ pprintf(DD_WPUT, "parse: parsewput\n");
+
+ switch (mp->b_datap->db_type)
+ {
+ default:
+ putnext(q, mp);
+ break;
+
+ case M_IOCTL:
+ iocp = (void *)mp->b_rptr;
+ switch (iocp->ioc_cmd)
+ {
+ default:
+ pprintf(DD_WPUT, "parse: parsewput - forward M_IOCTL\n");
+ putnext(q, mp);
+ break;
+
+ case CIOGETEV:
+ /*
+ * taken from Craig Leres ppsclock module (and modified)
+ */
+ datap = allocb(sizeof(struct ppsclockev), BPRI_MED);
+ if (datap == NULL || mp->b_cont)
+ {
+ mp->b_datap->db_type = M_IOCNAK;
+ iocp->ioc_error = (datap == NULL) ? ENOMEM : EINVAL;
+ if (datap != NULL)
+ freeb(datap);
+ qreply(q, mp);
+ break;
+ }
+
+ mp->b_cont = datap;
+ /* (void *) quiets cast alignment warning */
+ *(struct ppsclockev *)(void *)datap->b_wptr = parse->parse_ppsclockev;
+ datap->b_wptr +=
+ sizeof(struct ppsclockev) / sizeof(*datap->b_wptr);
+ mp->b_datap->db_type = M_IOCACK;
+ iocp->ioc_count = sizeof(struct ppsclockev);
+ qreply(q, mp);
+ break;
+
+ case PARSEIOC_ENABLE:
+ case PARSEIOC_DISABLE:
+ {
+ parse->parse_status = (parse->parse_status & (unsigned)~PARSE_ENABLE) |
+ (iocp->ioc_cmd == PARSEIOC_ENABLE) ?
+ PARSE_ENABLE : 0;
+ if (!setup_stream(RD(q), (parse->parse_status & PARSE_ENABLE) ?
+ M_PARSE : M_NOPARSE))
+ {
+ mp->b_datap->db_type = M_IOCNAK;
+ }
+ else
+ {
+ mp->b_datap->db_type = M_IOCACK;
+ }
+ qreply(q, mp);
+ break;
+ }
+
+ case PARSEIOC_TIMECODE:
+ case PARSEIOC_SETFMT:
+ case PARSEIOC_GETFMT:
+ case PARSEIOC_SETCS:
+ if (iocp->ioc_count == sizeof(parsectl_t))
+ {
+ parsectl_t *dct = (void *)mp->b_cont->b_rptr;
+
+ switch (iocp->ioc_cmd)
+ {
+ case PARSEIOC_TIMECODE:
+ pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_TIMECODE\n");
+ ok = parse_timecode(dct, &parse->parse_io);
+ break;
+
+ case PARSEIOC_SETFMT:
+ pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_SETFMT\n");
+ ok = parse_setfmt(dct, &parse->parse_io);
+ break;
+
+ case PARSEIOC_GETFMT:
+ pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_GETFMT\n");
+ ok = parse_getfmt(dct, &parse->parse_io);
+ break;
+
+ case PARSEIOC_SETCS:
+ pprintf(DD_WPUT, "parse: parsewput - PARSEIOC_SETCS\n");
+ ok = parse_setcs(dct, &parse->parse_io);
+ break;
+ }
+ mp->b_datap->db_type = ok ? M_IOCACK : M_IOCNAK;
+ }
+ else
+ {
+ mp->b_datap->db_type = M_IOCNAK;
+ }
+ pprintf(DD_WPUT, "parse: parsewput qreply - %s\n", (mp->b_datap->db_type == M_IOCNAK) ? "M_IOCNAK" : "M_IOCACK");
+ qreply(q, mp);
+ break;
+ }
+ }
+ return 0;
+}
+
+/*
+ * read characters from streams buffers
+ */
+static unsigned long
+rdchar(
+ mblk_t **mp
+ )
+{
+ while (*mp != (mblk_t *)NULL)
+ {
+ if ((*mp)->b_wptr - (*mp)->b_rptr)
+ {
+ return (unsigned long)(*(unsigned char *)((*mp)->b_rptr++));
+ }
+ else
+ {
+ register mblk_t *mmp = *mp;
+
+ *mp = (*mp)->b_cont;
+ freeb(mmp);
+ }
+ }
+ return (unsigned long)~0;
+}
+
+/*
+ * convert incoming data
+ */
+static int
+parserput(
+ queue_t *q,
+ mblk_t *imp
+ )
+{
+ register unsigned char type;
+ mblk_t *mp = imp;
+
+ switch (type = mp->b_datap->db_type)
+ {
+ default:
+ /*
+ * anything we don't know will be put on queue
+ * the service routine will move it to the next one
+ */
+ pprintf(DD_RPUT, "parse: parserput - forward type 0x%x\n", type);
+
+ if (canputnext(q) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ }
+ else
+ putq(q, mp);
+ break;
+
+ case M_BREAK:
+ case M_DATA:
+ {
+ register parsestream_t * parse = (parsestream_t *)q->q_ptr;
+ register mblk_t *nmp;
+ register unsigned long ch;
+ timestamp_t c_time;
+ timespec_t hres_time;
+
+ /*
+ * get time on packet delivery
+ */
+ gethrestime(&hres_time);
+ c_time.tv.tv_sec = hres_time.tv_sec;
+ c_time.tv.tv_usec = hres_time.tv_nsec / 1000;
+
+ if (!(parse->parse_status & PARSE_ENABLE))
+ {
+ pprintf(DD_RPUT, "parse: parserput - parser disabled - forward type 0x%x\n", type);
+ if (canputnext(q) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ }
+ else
+ putq(q, mp);
+ }
+ else
+ {
+ pprintf(DD_RPUT, "parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK");
+ if (type == M_DATA)
+ {
+ /*
+ * parse packet looking for start an end characters
+ */
+ while (mp != (mblk_t *)NULL)
+ {
+ ch = rdchar(&mp);
+ if (ch != ~0 && parse_ioread(&parse->parse_io, (unsigned int)ch, &c_time))
+ {
+ /*
+ * up up and away (hopefully ...)
+ * don't press it if resources are tight or nobody wants it
+ */
+ nmp = (mblk_t *)NULL;
+ if (canputnext(parse->parse_queue) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
+ {
+ bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
+ nmp->b_wptr += sizeof(parsetime_t);
+ putnext(parse->parse_queue, nmp);
+ }
+ else
+ if (nmp) freemsg(nmp);
+ parse_iodone(&parse->parse_io);
+ }
+ }
+ }
+ else
+ {
+ if (parse_ioread(&parse->parse_io, (unsigned int)0, &c_time))
+ {
+ /*
+ * up up and away (hopefully ...)
+ * don't press it if resources are tight or nobody wants it
+ */
+ nmp = (mblk_t *)NULL;
+ if (canputnext(parse->parse_queue) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
+ {
+ bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
+ nmp->b_wptr += sizeof(parsetime_t);
+ putnext(parse->parse_queue, nmp);
+ }
+ else
+ if (nmp) freemsg(nmp);
+ parse_iodone(&parse->parse_io);
+ }
+ freemsg(mp);
+ }
+ break;
+ }
+ }
+
+ /*
+ * CD PPS support for non direct ISR hack
+ */
+ case M_HANGUP:
+ case M_UNHANGUP:
+ {
+ register parsestream_t * parse = (parsestream_t *)q->q_ptr;
+ timestamp_t c_time;
+ timespec_t hres_time;
+ register mblk_t *nmp;
+ register int status = cd_invert ^ (type == M_UNHANGUP);
+
+ gethrestime(&hres_time);
+ c_time.tv.tv_sec = hres_time.tv_sec;
+ c_time.tv.tv_usec = hres_time.tv_nsec / 1000;
+
+ pprintf(DD_RPUT, "parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN");
+
+ if ((parse->parse_status & PARSE_ENABLE) &&
+ parse_iopps(&parse->parse_io, status ? SYNC_ONE : SYNC_ZERO, &c_time))
+ {
+ nmp = (mblk_t *)NULL;
+ if (canputnext(parse->parse_queue) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
+ {
+ bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
+ nmp->b_wptr += sizeof(parsetime_t);
+ putnext(parse->parse_queue, nmp);
+ }
+ else
+ if (nmp) freemsg(nmp);
+ parse_iodone(&parse->parse_io);
+ freemsg(mp);
+ }
+ else
+ if (canputnext(q) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ }
+ else
+ putq(q, mp);
+
+ if (status)
+ {
+ parse->parse_ppsclockev.tv = c_time.tv;
+ ++(parse->parse_ppsclockev.serial);
+ }
+ }
+ }
+ return 0;
+}
+
+static int init_zs_linemon (queue_t *, queue_t *); /* handle line monitor for "zs" driver */
+static void close_zs_linemon (queue_t *, queue_t *);
+
+/*-------------------- CD isr status monitor ---------------*/
+
+static int
+init_linemon(
+ queue_t *q
+ )
+{
+ register queue_t *dq;
+
+ dq = WR(q);
+ /*
+ * we ARE doing very bad things down here (basically stealing ISR
+ * hooks)
+ *
+ * so we chase down the STREAMS stack searching for the driver
+ * and if this is a known driver we insert our ISR routine for
+ * status changes in to the ExternalStatus handling hook
+ */
+ while (dq->q_next)
+ {
+ dq = dq->q_next; /* skip down to driver */
+ }
+
+ /*
+ * find appropriate driver dependent routine
+ */
+ if (dq->q_qinfo && dq->q_qinfo->qi_minfo)
+ {
+ register char *dname = dq->q_qinfo->qi_minfo->mi_idname;
+
+ pprintf(DD_INSTALL, "init_linemon: driver is \"%s\"\n", dname);
+
+#ifdef sun
+ if (dname && !strcmp(dname, "zs"))
+ {
+ return init_zs_linemon(dq, q);
+ }
+ else
+#endif
+ {
+ pprintf(DD_INSTALL, "init_linemon: driver \"%s\" not suitable for CD monitoring\n", dname);
+ return 0;
+ }
+ }
+ pprintf(DD_INSTALL, "init_linemon: cannot find driver\n");
+ return 0;
+}
+
+static void
+close_linemon(
+ queue_t *q,
+ queue_t *my_q
+ )
+{
+ /*
+ * find appropriate driver dependent routine
+ */
+ if (q->q_qinfo && q->q_qinfo->qi_minfo)
+ {
+ register char *dname = q->q_qinfo->qi_minfo->mi_idname;
+
+#ifdef sun
+ if (dname && !strcmp(dname, "zs"))
+ {
+ close_zs_linemon(q, my_q);
+ return;
+ }
+ pprintf(DD_INSTALL, "close_linemon: cannot find driver close routine for \"%s\"\n", dname);
+#endif
+ }
+ pprintf(DD_INSTALL, "close_linemon: cannot find driver name\n");
+}
+
+#ifdef sun
+#include <sys/tty.h>
+#include <sys/zsdev.h>
+#include <sys/ser_async.h>
+#include <sys/ser_zscc.h>
+
+static void zs_xsisr (struct zscom *); /* zs external status interupt handler */
+
+/*
+ * there should be some docs telling how to get to
+ * sz:zs_usec_delay and zs:initzsops()
+ */
+#define zs_usec_delay 5
+
+struct savedzsops
+{
+ struct zsops zsops;
+ struct zsops *oldzsops;
+};
+
+static struct zsops *emergencyzs;
+
+static int
+init_zs_linemon(
+ queue_t *q,
+ queue_t *my_q
+ )
+{
+ register struct zscom *zs;
+ register struct savedzsops *szs;
+ register parsestream_t *parsestream = (parsestream_t *)my_q->q_ptr;
+ /*
+ * we expect the zsaline pointer in the q_data pointer
+ * from there on we insert our on EXTERNAL/STATUS ISR routine
+ * into the interrupt path, before the standard handler
+ */
+ zs = ((struct asyncline *)q->q_ptr)->za_common;
+ if (!zs)
+ {
+ /*
+ * well - not found on startup - just say no (shouldn't happen though)
+ */
+ return 0;
+ }
+ else
+ {
+ /*
+ * we do a direct replacement, in case others fiddle also
+ * if somebody else grabs our hook and we disconnect
+ * we are in DEEP trouble - panic is likely to be next, sorry
+ */
+ szs = (struct savedzsops *) kmem_alloc(sizeof(struct savedzsops), KM_SLEEP);
+
+ if (szs == (struct savedzsops *)0)
+ {
+ pprintf(DD_INSTALL, "init_zs_linemon: CD monitor NOT installed - no memory\n");
+
+ return 0;
+ }
+ else
+ {
+ parsestream->parse_data = (void *)szs;
+
+ mutex_enter(zs->zs_excl);
+
+ parsestream->parse_dqueue = q; /* remember driver */
+
+ szs->zsops = *zs->zs_ops;
+ szs->zsops.zsop_xsint = (void (*) (struct zscom *))zs_xsisr; /* place our bastard */
+ szs->oldzsops = zs->zs_ops;
+ emergencyzs = zs->zs_ops;
+
+ zs->zs_ops = &szs->zsops; /* hook it up */
+ /*
+ * XXX: this is usually done via zsopinit()
+ * - have yet to find a way to call that routine
+ */
+ zs->zs_xsint = (void (*) (struct zscom *))zs_xsisr;
+
+ mutex_exit(zs->zs_excl);
+
+ pprintf(DD_INSTALL, "init_zs_linemon: CD monitor installed\n");
+
+ return 1;
+ }
+ }
+}
+
+/*
+ * unregister our ISR routine - must call under splhigh() (or
+ * whatever block ZS status interrupts)
+ */
+static void
+close_zs_linemon(
+ queue_t *q,
+ queue_t *my_q
+ )
+{
+ register struct zscom *zs;
+ register parsestream_t *parsestream = (parsestream_t *)my_q->q_ptr;
+
+ zs = ((struct asyncline *)q->q_ptr)->za_common;
+ if (!zs)
+ {
+ /*
+ * well - not found on startup - just say no (shouldn't happen though)
+ */
+ return;
+ }
+ else
+ {
+ register struct savedzsops *szs = (struct savedzsops *)parsestream->parse_data;
+
+ mutex_enter(zs->zs_excl);
+
+ zs->zs_ops = szs->oldzsops; /* reset to previous handler functions */
+ /*
+ * XXX: revert xsint (usually done via zsopinit() - have still to find
+ * a way to call that bugger
+ */
+ zs->zs_xsint = zs->zs_ops->zsop_xsint;
+
+ mutex_exit(zs->zs_excl);
+
+ kmem_free((caddr_t)szs, sizeof (struct savedzsops));
+
+ pprintf(DD_INSTALL, "close_zs_linemon: CD monitor deleted\n");
+ return;
+ }
+}
+
+#define ZSRR0_IGNORE (ZSRR0_CD|ZSRR0_SYNC|ZSRR0_CTS)
+
+#define MAXDEPTH 50 /* maximum allowed stream crawl */
+
+/*
+ * take external status interrupt (only CD interests us)
+ */
+static void
+zs_xsisr(
+ struct zscom *zs
+ )
+{
+ register struct asyncline *za = (void *)zs->zs_priv;
+ register queue_t *q;
+ register unsigned char zsstatus;
+ register int loopcheck;
+ register unsigned char cdstate;
+ register const char *dname = "-UNKNOWN-";
+ timespec_t hres_time;
+
+ /*
+ * pick up current state
+ */
+ zsstatus = SCC_READ0();
+
+ if (za->za_rr0 ^ (cdstate = zsstatus & ZSRR0_CD))
+ {
+ timestamp_t cdevent;
+ register int status;
+
+ /*
+ * time stamp
+ */
+ gethrestime(&hres_time);
+ cdevent.tv.tv_sec = hres_time.tv_sec;
+ cdevent.tv.tv_usec = hres_time.tv_nsec / 1000;
+
+ q = za->za_ttycommon.t_readq;
+
+ /*
+ * logical state
+ */
+ status = cd_invert ? cdstate == 0 : cdstate != 0;
+
+ /*
+ * ok - now the hard part - find ourself
+ */
+ loopcheck = MAXDEPTH;
+
+ while (q)
+ {
+ if (q->q_qinfo && q->q_qinfo->qi_minfo)
+ {
+ dname = q->q_qinfo->qi_minfo->mi_idname;
+
+ if (!strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname))
+ {
+ /*
+ * back home - phew (hopping along stream queues might
+ * prove dangerous to your health)
+ */
+
+ if ((((parsestream_t *)q->q_ptr)->parse_status & PARSE_ENABLE) &&
+ parse_iopps(&((parsestream_t *)q->q_ptr)->parse_io, status ? SYNC_ONE : SYNC_ZERO, &cdevent))
+ {
+ /*
+ * XXX - currently we do not pass up the message, as
+ * we should.
+ * for a correct behaviour wee need to block out
+ * processing until parse_iodone has been posted via
+ * a softcall-ed routine which does the message pass-up
+ * right now PPS information relies on input being
+ * received
+ */
+ parse_iodone(&((parsestream_t *)q->q_ptr)->parse_io);
+ }
+
+ if (status)
+ {
+ ((parsestream_t *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv;
+ ++(((parsestream_t *)q->q_ptr)->parse_ppsclockev.serial);
+ }
+
+ pprintf(DD_ISR, "zs_xsisr: CD event %s has been posted for \"%s\"\n", status ? "ONE" : "ZERO", dname);
+ break;
+ }
+ }
+
+ q = q->q_next;
+
+ if (!loopcheck--)
+ {
+ panic("zs_xsisr: STREAMS Queue corrupted - CD event");
+ }
+ }
+
+ if (cdstate) /* fake CARRIER status - XXX currently not coordinated */
+ za->za_flags |= ZAS_CARR_ON;
+ else
+ za->za_flags &= ~ZAS_CARR_ON;
+
+ /*
+ * only pretend that CD and ignored transistion (SYNC,CTS)
+ * have been handled
+ */
+ za->za_rr0 = (za->za_rr0 & ~ZSRR0_IGNORE) | (zsstatus & ZSRR0_IGNORE);
+
+ if (((za->za_rr0 ^ zsstatus) & ~ZSRR0_IGNORE) == 0)
+ {
+ /*
+ * all done - kill status indication and return
+ */
+ SCC_WRITE0(ZSWR0_RESET_STATUS); /* might kill other conditions here */
+ return;
+ }
+ }
+
+ pprintf(DD_ISR, "zs_xsisr: non CD event 0x%x for \"%s\"\n",
+ (za->za_rr0 ^ zsstatus) & ~ZSRR0_CD,dname);
+ /*
+ * we are now gathered here to process some unusual external status
+ * interrupts.
+ * any CD events have also been handled and shouldn't be processed
+ * by the original routine (unless we have a VERY busy port pin)
+ * some initializations are done here, which could have been done before for
+ * both code paths but have been avioded for minimum path length to
+ * the uniq_time routine
+ */
+ dname = (char *) 0;
+ q = za->za_ttycommon.t_readq;
+
+ loopcheck = MAXDEPTH;
+
+ /*
+ * the real thing for everything else ...
+ */
+ while (q)
+ {
+ if (q->q_qinfo && q->q_qinfo->qi_minfo)
+ {
+ dname = q->q_qinfo->qi_minfo->mi_idname;
+ if (!strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname))
+ {
+ register void (*zsisr) (struct zscom *);
+
+ /*
+ * back home - phew (hopping along stream queues might
+ * prove dangerous to your health)
+ */
+ if ((zsisr = ((struct savedzsops *)((parsestream_t *)q->q_ptr)->parse_data)->oldzsops->zsop_xsint))
+ zsisr(zs);
+ else
+ panic("zs_xsisr: unable to locate original ISR");
+
+ pprintf(DD_ISR, "zs_xsisr: non CD event was processed for \"%s\"\n", dname);
+ /*
+ * now back to our program ...
+ */
+ return;
+ }
+ }
+
+ q = q->q_next;
+
+ if (!loopcheck--)
+ {
+ panic("zs_xsisr: STREAMS Queue corrupted - non CD event");
+ }
+ }
+
+ /*
+ * last resort - shouldn't even come here as it indicates
+ * corrupted TTY structures
+ */
+ printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-");
+
+ if (emergencyzs && emergencyzs->zsop_xsint)
+ emergencyzs->zsop_xsint(zs);
+ else
+ panic("zs_xsisr: no emergency ISR handler");
+}
+#endif /* sun */
+
+/*
+ * History:
+ *
+ * parsesolaris.c,v
+ * Revision 4.11 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.10 2004/11/14 16:06:08 kardel
+ * update Id tags
+ *
+ * Revision 4.9 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.6 1998/11/15 21:56:08 kardel
+ * ntp_memset not necessary
+ *
+ * Revision 4.5 1998/11/15 21:23:37 kardel
+ * ntp_memset() replicated in Sun kernel files
+ *
+ * Revision 4.4 1998/06/14 21:09:40 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.3 1998/06/13 12:14:59 kardel
+ * more prototypes
+ * fix name clashes
+ * allow for ansi2knr
+ *
+ * Revision 4.2 1998/06/12 15:23:08 kardel
+ * fix prototypes
+ * adjust for ansi2knr
+ *
+ * Revision 4.1 1998/05/24 09:38:46 kardel
+ * streams initiated iopps calls (M_xHANGUP) are now consistent with the
+ * respective calls from zs_xsisr()
+ * simulation of CARRIER status to avoid unecessary M_xHANGUP messages
+ *
+ * Revision 4.0 1998/04/10 19:45:38 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.28 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/parsestreams.c b/libparse/parsestreams.c
new file mode 100644
index 0000000..3fb4cc3
--- /dev/null
+++ b/libparse/parsestreams.c
@@ -0,0 +1,1367 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * STREAMS module for reference clocks
+ * (SunOS4.x)
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#define KERNEL /* MUST */
+#define VDDRV /* SHOULD */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifndef lint
+static char rcsid[] = "parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A";
+#endif
+
+#ifndef KERNEL
+#include "Bletch: MUST COMPILE WITH KERNEL DEFINE"
+#endif
+
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/buf.h>
+#include <sys/param.h>
+#include <sys/sysmacros.h>
+#include <sys/time.h>
+#include <sundev/mbvar.h>
+#include <sun/autoconf.h>
+#include <sys/stream.h>
+#include <sys/stropts.h>
+#include <sys/dir.h>
+#include <sys/signal.h>
+#include <sys/termios.h>
+#include <sys/termio.h>
+#include <sys/ttold.h>
+#include <sys/user.h>
+#include <sys/tty.h>
+
+#ifdef VDDRV
+#include <sun/vddrv.h>
+#endif
+
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
+/*
+ * just make checking compilers more silent
+ */
+extern int printf (const char *, ...);
+extern int putctl1 (queue_t *, int, int);
+extern int canput (queue_t *);
+extern void putbq (queue_t *, mblk_t *);
+extern void freeb (mblk_t *);
+extern void qreply (queue_t *, mblk_t *);
+extern void freemsg (mblk_t *);
+extern void panic (const char *, ...);
+extern void usec_delay (int);
+
+#include "parse.h"
+#include "sys/parsestreams.h"
+
+/*
+ * use microtime instead of uniqtime if advised to
+ */
+#ifdef MICROTIME
+#define uniqtime microtime
+#endif
+
+#ifdef VDDRV
+static unsigned int parsebusy = 0;
+
+/*--------------- loadable driver section -----------------------------*/
+
+extern struct streamtab parseinfo;
+
+
+#ifdef PPS_SYNC
+static char mnam[] = "PARSEPPS "; /* name this baby - keep room for revision number */
+#else
+static char mnam[] = "PARSE "; /* name this baby - keep room for revision number */
+#endif
+struct vdldrv parsesync_vd =
+{
+ VDMAGIC_PSEUDO, /* nothing like a real driver - a STREAMS module */
+ mnam,
+};
+
+/*
+ * strings support usually not in kernel
+ */
+static int
+Strlen(
+ register const char *s
+ )
+{
+ register int c;
+
+ c = 0;
+ if (s)
+ {
+ while (*s++)
+ {
+ c++;
+ }
+ }
+ return c;
+}
+
+static void
+Strncpy(
+ register char *t,
+ register char *s,
+ register int c
+ )
+{
+ if (s && t)
+ {
+ while ((c-- > 0) && (*t++ = *s++))
+ ;
+ }
+}
+
+static int
+Strcmp(
+ register const char *s,
+ register const char *t
+ )
+{
+ register int c = 0;
+
+ if (!s || !t || (s == t))
+ {
+ return 0;
+ }
+
+ while (!(c = *s++ - *t++) && *s && *t)
+ /* empty loop */;
+
+ return c;
+}
+
+static int
+Strncmp(
+ register char *s,
+ register char *t,
+ register int n
+ )
+{
+ register int c = 0;
+
+ if (!s || !t || (s == t))
+ {
+ return 0;
+ }
+
+ while (n-- && !(c = *s++ - *t++) && *s && *t)
+ /* empty loop */;
+
+ return c;
+}
+
+void
+ntp_memset(
+ char *a,
+ int x,
+ int c
+ )
+{
+ while (c-- > 0)
+ *a++ = x;
+}
+
+/*
+ * driver init routine
+ * since no mechanism gets us into and out of the fmodsw, we have to
+ * do it ourselves
+ */
+/*ARGSUSED*/
+int
+xxxinit(
+ unsigned int fc,
+ struct vddrv *vdp,
+ addr_t vdin,
+ struct vdstat *vds
+ )
+{
+ extern struct fmodsw fmodsw[];
+ extern int fmodcnt;
+
+ struct fmodsw *fm = fmodsw;
+ struct fmodsw *fmend = &fmodsw[fmodcnt];
+ struct fmodsw *ifm = (struct fmodsw *)0;
+ char *mname = parseinfo.st_rdinit->qi_minfo->mi_idname;
+
+ switch (fc)
+ {
+ case VDLOAD:
+ vdp->vdd_vdtab = (struct vdlinkage *)&parsesync_vd;
+ /*
+ * now, jog along fmodsw scanning for an empty slot
+ * and deposit our name there
+ */
+ while (fm <= fmend)
+ {
+ if (!Strncmp(fm->f_name, mname, FMNAMESZ))
+ {
+ printf("vddrinit[%s]: STREAMS module already loaded.\n", mname);
+ return(EBUSY);
+ }
+ else
+ if ((ifm == (struct fmodsw *)0) &&
+ (fm->f_name[0] == '\0') &&
+ (fm->f_str == (struct streamtab *)0))
+ {
+ /*
+ * got one - so move in
+ */
+ ifm = fm;
+ break;
+ }
+ fm++;
+ }
+
+ if (ifm == (struct fmodsw *)0)
+ {
+ printf("vddrinit[%s]: no slot free for STREAMS module\n", mname);
+ return (ENOSPC);
+ }
+ else
+ {
+ static char revision[] = "4.7";
+ char *s, *S, *t;
+
+ s = rcsid; /* NOOP - keep compilers happy */
+
+ Strncpy(ifm->f_name, mname, FMNAMESZ);
+ ifm->f_name[FMNAMESZ] = '\0';
+ ifm->f_str = &parseinfo;
+ /*
+ * copy RCS revision into Drv_name
+ *
+ * are we forcing RCS here to do things it was not built for ?
+ */
+ s = revision;
+ if (*s == '$')
+ {
+ /*
+ * skip "$Revision: "
+ * if present. - not necessary on a -kv co (cvs export)
+ */
+ while (*s && (*s != ' '))
+ {
+ s++;
+ }
+ if (*s == ' ') s++;
+ }
+
+ t = parsesync_vd.Drv_name;
+ while (*t && (*t != ' '))
+ {
+ t++;
+ }
+ if (*t == ' ') t++;
+
+ S = s;
+ while (*S && (((*S >= '0') && (*S <= '9')) || (*S == '.')))
+ {
+ S++;
+ }
+
+ if (*s && *t && (S > s))
+ {
+ if (Strlen(t) >= (S - s))
+ {
+ (void) Strncpy(t, s, S - s);
+ }
+ }
+ return (0);
+ }
+ break;
+
+ case VDUNLOAD:
+ if (parsebusy > 0)
+ {
+ printf("vddrinit[%s]: STREAMS module has still %d instances active.\n", mname, parsebusy);
+ return (EBUSY);
+ }
+ else
+ {
+ while (fm <= fmend)
+ {
+ if (!Strncmp(fm->f_name, mname, FMNAMESZ))
+ {
+ /*
+ * got it - kill entry
+ */
+ fm->f_name[0] = '\0';
+ fm->f_str = (struct streamtab *)0;
+ fm++;
+
+ break;
+ }
+ fm++;
+ }
+ if (fm > fmend)
+ {
+ printf("vddrinit[%s]: cannot find entry for STREAMS module\n", mname);
+ return (ENXIO);
+ }
+ else
+ return (0);
+ }
+
+
+ case VDSTAT:
+ return (0);
+
+ default:
+ return (EIO);
+
+ }
+ return EIO;
+}
+
+#endif
+
+/*--------------- stream module definition ----------------------------*/
+
+static int parseopen (queue_t *, dev_t, int, int);
+static int parseclose (queue_t *, int);
+static int parsewput (queue_t *, mblk_t *);
+static int parserput (queue_t *, mblk_t *);
+static int parsersvc (queue_t *);
+
+static char mn[] = "parse";
+
+static struct module_info driverinfo =
+{
+ 0, /* module ID number */
+ mn, /* module name */
+ 0, /* minimum accepted packet size */
+ INFPSZ, /* maximum accepted packet size */
+ 1, /* high water mark - flow control */
+ 0 /* low water mark - flow control */
+};
+
+static struct qinit rinit = /* read queue definition */
+{
+ parserput, /* put procedure */
+ parsersvc, /* service procedure */
+ parseopen, /* open procedure */
+ parseclose, /* close procedure */
+ NULL, /* admin procedure - NOT USED FOR NOW */
+ &driverinfo, /* information structure */
+ NULL /* statistics */
+};
+
+static struct qinit winit = /* write queue definition */
+{
+ parsewput, /* put procedure */
+ NULL, /* service procedure */
+ NULL, /* open procedure */
+ NULL, /* close procedure */
+ NULL, /* admin procedure - NOT USED FOR NOW */
+ &driverinfo, /* information structure */
+ NULL /* statistics */
+};
+
+struct streamtab parseinfo = /* stream info element for dpr driver */
+{
+ &rinit, /* read queue */
+ &winit, /* write queue */
+ NULL, /* read mux */
+ NULL, /* write mux */
+ NULL /* module auto push */
+};
+
+/*--------------- driver data structures ----------------------------*/
+
+/*
+ * we usually have an inverted signal - but you
+ * can change this to suit your needs
+ */
+int cd_invert = 1; /* invert status of CD line - PPS support via CD input */
+
+int parsedebug = ~0;
+
+extern void uniqtime (struct timeval *);
+
+/*--------------- module implementation -----------------------------*/
+
+#define TIMEVAL_USADD(_X_, _US_) {\
+ (_X_)->tv_usec += (_US_);\
+ if ((_X_)->tv_usec >= 1000000)\
+ {\
+ (_X_)->tv_sec++;\
+ (_X_)->tv_usec -= 1000000;\
+ }\
+ } while (0)
+
+static int init_linemon (queue_t *);
+static void close_linemon (queue_t *, queue_t *);
+
+#define M_PARSE 0x0001
+#define M_NOPARSE 0x0002
+
+static int
+setup_stream(
+ queue_t *q,
+ int mode
+ )
+{
+ mblk_t *mp;
+
+ mp = allocb(sizeof(struct stroptions), BPRI_MED);
+ if (mp)
+ {
+ struct stroptions *str = (struct stroptions *)(void *)mp->b_rptr;
+
+ str->so_flags = SO_READOPT|SO_HIWAT|SO_LOWAT;
+ str->so_readopt = (mode == M_PARSE) ? RMSGD : RNORM;
+ str->so_hiwat = (mode == M_PARSE) ? sizeof(parsetime_t) : 256;
+ str->so_lowat = 0;
+ mp->b_datap->db_type = M_SETOPTS;
+ mp->b_wptr += sizeof(struct stroptions);
+ putnext(q, mp);
+ return putctl1(WR(q)->q_next, M_CTL, (mode == M_PARSE) ? MC_SERVICEIMM :
+ MC_SERVICEDEF);
+ }
+ else
+ {
+ parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n"));
+ return 0;
+ }
+}
+
+/*ARGSUSED*/
+static int
+parseopen(
+ queue_t *q,
+ dev_t dev,
+ int flag,
+ int sflag
+ )
+{
+ register parsestream_t *parse;
+ static int notice = 0;
+
+ parseprintf(DD_OPEN,("parse: OPEN\n"));
+
+ if (sflag != MODOPEN)
+ { /* open only for modules */
+ parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n"));
+ return OPENFAIL;
+ }
+
+ if (q->q_ptr != (caddr_t)NULL)
+ {
+ u.u_error = EBUSY;
+ parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n"));
+ return OPENFAIL;
+ }
+
+#ifdef VDDRV
+ parsebusy++;
+#endif
+
+ q->q_ptr = (caddr_t)kmem_alloc(sizeof(parsestream_t));
+ if (q->q_ptr == (caddr_t)0)
+ {
+ parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n"));
+#ifdef VDDRV
+ parsebusy--;
+#endif
+ return OPENFAIL;
+ }
+ WR(q)->q_ptr = q->q_ptr;
+
+ parse = (parsestream_t *)(void *)q->q_ptr;
+ bzero((caddr_t)parse, sizeof(*parse));
+ parse->parse_queue = q;
+ parse->parse_status = PARSE_ENABLE;
+ parse->parse_ppsclockev.tv.tv_sec = 0;
+ parse->parse_ppsclockev.tv.tv_usec = 0;
+ parse->parse_ppsclockev.serial = 0;
+
+ if (!parse_ioinit(&parse->parse_io))
+ {
+ /*
+ * ok guys - beat it
+ */
+ kmem_free((caddr_t)parse, sizeof(parsestream_t));
+#ifdef VDDRV
+ parsebusy--;
+#endif
+ return OPENFAIL;
+ }
+
+ if (setup_stream(q, M_PARSE))
+ {
+ (void) init_linemon(q); /* hook up PPS ISR routines if possible */
+
+ parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n"));
+
+ /*
+ * I know that you know the delete key, but you didn't write this
+ * code, did you ? - So, keep the message in here.
+ */
+ if (!notice)
+ {
+#ifdef VDDRV
+ printf("%s: Copyright (C) 1991-2005, Frank Kardel\n", parsesync_vd.Drv_name);
+#else
+ printf("%s: Copyright (C) 1991-2005, Frank Kardel\n", "parsestreams.c,v 4.11 2005/04/16 17:32:10 kardel RELEASE_20050508_A");
+#endif
+ notice = 1;
+ }
+
+ return MODOPEN;
+ }
+ else
+ {
+ kmem_free((caddr_t)parse, sizeof(parsestream_t));
+
+#ifdef VDDRV
+ parsebusy--;
+#endif
+ return OPENFAIL;
+ }
+}
+
+/*ARGSUSED*/
+static int
+parseclose(
+ queue_t *q,
+ int flags
+ )
+{
+ register parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr;
+ register unsigned long s;
+
+ parseprintf(DD_CLOSE,("parse: CLOSE\n"));
+
+ s = splhigh();
+
+ if (parse->parse_dqueue)
+ close_linemon(parse->parse_dqueue, q);
+ parse->parse_dqueue = (queue_t *)0;
+
+ (void) splx(s);
+
+ parse_ioend(&parse->parse_io);
+
+ kmem_free((caddr_t)parse, sizeof(parsestream_t));
+
+ q->q_ptr = (caddr_t)NULL;
+ WR(q)->q_ptr = (caddr_t)NULL;
+
+#ifdef VDDRV
+ parsebusy--;
+#endif
+ return 0;
+}
+
+/*
+ * move unrecognized stuff upward
+ */
+static int
+parsersvc(
+ queue_t *q
+ )
+{
+ mblk_t *mp;
+
+ while ((mp = getq(q)))
+ {
+ if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ parseprintf(DD_RSVC,("parse: RSVC - putnext\n"));
+ }
+ else
+ {
+ putbq(q, mp);
+ parseprintf(DD_RSVC,("parse: RSVC - flow control wait\n"));
+ break;
+ }
+ }
+ return 0;
+}
+
+/*
+ * do ioctls and
+ * send stuff down - dont care about
+ * flow control
+ */
+static int
+parsewput(
+ queue_t *q,
+ register mblk_t *mp
+ )
+{
+ register int ok = 1;
+ register mblk_t *datap;
+ register struct iocblk *iocp;
+ parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr;
+
+ parseprintf(DD_WPUT,("parse: parsewput\n"));
+
+ switch (mp->b_datap->db_type)
+ {
+ default:
+ putnext(q, mp);
+ break;
+
+ case M_IOCTL:
+ iocp = (struct iocblk *)(void *)mp->b_rptr;
+ switch (iocp->ioc_cmd)
+ {
+ default:
+ parseprintf(DD_WPUT,("parse: parsewput - forward M_IOCTL\n"));
+ putnext(q, mp);
+ break;
+
+ case CIOGETEV:
+ /*
+ * taken from Craig Leres ppsclock module (and modified)
+ */
+ datap = allocb(sizeof(struct ppsclockev), BPRI_MED);
+ if (datap == NULL || mp->b_cont)
+ {
+ mp->b_datap->db_type = M_IOCNAK;
+ iocp->ioc_error = (datap == NULL) ? ENOMEM : EINVAL;
+ if (datap != NULL)
+ freeb(datap);
+ qreply(q, mp);
+ break;
+ }
+
+ mp->b_cont = datap;
+ *(struct ppsclockev *)(void *)datap->b_wptr = parse->parse_ppsclockev;
+ datap->b_wptr +=
+ sizeof(struct ppsclockev) / sizeof(*datap->b_wptr);
+ mp->b_datap->db_type = M_IOCACK;
+ iocp->ioc_count = sizeof(struct ppsclockev);
+ qreply(q, mp);
+ break;
+
+ case PARSEIOC_ENABLE:
+ case PARSEIOC_DISABLE:
+ {
+ parse->parse_status = (parse->parse_status & (unsigned)~PARSE_ENABLE) |
+ (iocp->ioc_cmd == PARSEIOC_ENABLE) ?
+ PARSE_ENABLE : 0;
+ if (!setup_stream(RD(q), (parse->parse_status & PARSE_ENABLE) ?
+ M_PARSE : M_NOPARSE))
+ {
+ mp->b_datap->db_type = M_IOCNAK;
+ }
+ else
+ {
+ mp->b_datap->db_type = M_IOCACK;
+ }
+ qreply(q, mp);
+ break;
+ }
+
+ case PARSEIOC_TIMECODE:
+ case PARSEIOC_SETFMT:
+ case PARSEIOC_GETFMT:
+ case PARSEIOC_SETCS:
+ if (iocp->ioc_count == sizeof(parsectl_t))
+ {
+ parsectl_t *dct = (parsectl_t *)(void *)mp->b_cont->b_rptr;
+
+ switch (iocp->ioc_cmd)
+ {
+ case PARSEIOC_TIMECODE:
+ parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_TIMECODE\n"));
+ ok = parse_timecode(dct, &parse->parse_io);
+ break;
+
+ case PARSEIOC_SETFMT:
+ parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETFMT\n"));
+ ok = parse_setfmt(dct, &parse->parse_io);
+ break;
+
+ case PARSEIOC_GETFMT:
+ parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_GETFMT\n"));
+ ok = parse_getfmt(dct, &parse->parse_io);
+ break;
+
+ case PARSEIOC_SETCS:
+ parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETCS\n"));
+ ok = parse_setcs(dct, &parse->parse_io);
+ break;
+ }
+ mp->b_datap->db_type = ok ? M_IOCACK : M_IOCNAK;
+ }
+ else
+ {
+ mp->b_datap->db_type = M_IOCNAK;
+ }
+ parseprintf(DD_WPUT,("parse: parsewput qreply - %s\n", (mp->b_datap->db_type == M_IOCNAK) ? "M_IOCNAK" : "M_IOCACK"));
+ qreply(q, mp);
+ break;
+ }
+ }
+ return 0;
+}
+
+/*
+ * read characters from streams buffers
+ */
+static unsigned long
+rdchar(
+ register mblk_t **mp
+ )
+{
+ while (*mp != (mblk_t *)NULL)
+ {
+ if ((*mp)->b_wptr - (*mp)->b_rptr)
+ {
+ return (unsigned long)(*(unsigned char *)((*mp)->b_rptr++));
+ }
+ else
+ {
+ register mblk_t *mmp = *mp;
+
+ *mp = (*mp)->b_cont;
+ freeb(mmp);
+ }
+ }
+ return (unsigned)~0;
+}
+
+/*
+ * convert incoming data
+ */
+static int
+parserput(
+ queue_t *q,
+ mblk_t *mp
+ )
+{
+ unsigned char type;
+
+ switch (type = mp->b_datap->db_type)
+ {
+ default:
+ /*
+ * anything we don't know will be put on queue
+ * the service routine will move it to the next one
+ */
+ parseprintf(DD_RPUT,("parse: parserput - forward type 0x%x\n", type));
+ if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ }
+ else
+ putq(q, mp);
+ break;
+
+ case M_BREAK:
+ case M_DATA:
+ {
+ register parsestream_t * parse = (parsestream_t *)(void *)q->q_ptr;
+ register mblk_t *nmp;
+ register unsigned long ch;
+ timestamp_t ctime;
+
+ /*
+ * get time on packet delivery
+ */
+ uniqtime(&ctime.tv);
+
+ if (!(parse->parse_status & PARSE_ENABLE))
+ {
+ parseprintf(DD_RPUT,("parse: parserput - parser disabled - forward type 0x%x\n", type));
+ if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ }
+ else
+ putq(q, mp);
+ }
+ else
+ {
+ parseprintf(DD_RPUT,("parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK"));
+
+ if (type == M_DATA)
+ {
+ /*
+ * parse packet looking for start an end characters
+ */
+ while (mp != (mblk_t *)NULL)
+ {
+ ch = rdchar(&mp);
+ if (ch != ~0 && parse_ioread(&parse->parse_io, (unsigned int)ch, &ctime))
+ {
+ /*
+ * up up and away (hopefully ...)
+ * don't press it if resources are tight or nobody wants it
+ */
+ nmp = (mblk_t *)NULL;
+ if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
+ {
+ bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
+ nmp->b_wptr += sizeof(parsetime_t);
+ putnext(parse->parse_queue, nmp);
+ }
+ else
+ if (nmp) freemsg(nmp);
+ parse_iodone(&parse->parse_io);
+ }
+ }
+ }
+ else
+ {
+ if (parse_ioread(&parse->parse_io, (unsigned int)0, &ctime))
+ {
+ /*
+ * up up and away (hopefully ...)
+ * don't press it if resources are tight or nobody wants it
+ */
+ nmp = (mblk_t *)NULL;
+ if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
+ {
+ bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
+ nmp->b_wptr += sizeof(parsetime_t);
+ putnext(parse->parse_queue, nmp);
+ }
+ else
+ if (nmp) freemsg(nmp);
+ parse_iodone(&parse->parse_io);
+ }
+ freemsg(mp);
+ }
+ break;
+ }
+ }
+
+ /*
+ * CD PPS support for non direct ISR hack
+ */
+ case M_HANGUP:
+ case M_UNHANGUP:
+ {
+ register parsestream_t * parse = (parsestream_t *)(void *)q->q_ptr;
+ timestamp_t ctime;
+ register mblk_t *nmp;
+ register int status = cd_invert ^ (type == M_UNHANGUP);
+
+ uniqtime(&ctime.tv);
+
+ parseprintf(DD_RPUT,("parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN"));
+
+ if ((parse->parse_status & PARSE_ENABLE) &&
+ parse_iopps(&parse->parse_io, (int)(status ? SYNC_ONE : SYNC_ZERO), &ctime))
+ {
+ nmp = (mblk_t *)NULL;
+ if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
+ {
+ bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
+ nmp->b_wptr += sizeof(parsetime_t);
+ putnext(parse->parse_queue, nmp);
+ }
+ else
+ if (nmp) freemsg(nmp);
+ parse_iodone(&parse->parse_io);
+ freemsg(mp);
+ }
+ else
+ if (canput(q->q_next) || (mp->b_datap->db_type > QPCTL))
+ {
+ putnext(q, mp);
+ }
+ else
+ putq(q, mp);
+
+ if (status)
+ {
+ parse->parse_ppsclockev.tv = ctime.tv;
+ ++(parse->parse_ppsclockev.serial);
+ }
+ }
+ }
+ return 0;
+}
+
+static int init_zs_linemon (queue_t *, queue_t *); /* handle line monitor for "zs" driver */
+static void close_zs_linemon (queue_t *, queue_t *);
+
+/*-------------------- CD isr status monitor ---------------*/
+
+static int
+init_linemon(
+ register queue_t *q
+ )
+{
+ register queue_t *dq;
+
+ dq = WR(q);
+ /*
+ * we ARE doing very bad things down here (basically stealing ISR
+ * hooks)
+ *
+ * so we chase down the STREAMS stack searching for the driver
+ * and if this is a known driver we insert our ISR routine for
+ * status changes in to the ExternalStatus handling hook
+ */
+ while (dq->q_next)
+ {
+ dq = dq->q_next; /* skip down to driver */
+ }
+
+ /*
+ * find appropriate driver dependent routine
+ */
+ if (dq->q_qinfo && dq->q_qinfo->qi_minfo)
+ {
+ register char *dname = dq->q_qinfo->qi_minfo->mi_idname;
+
+ parseprintf(DD_INSTALL, ("init_linemon: driver is \"%s\"\n", dname));
+
+#ifdef sun
+ if (dname && !Strcmp(dname, "zs"))
+ {
+ return init_zs_linemon(dq, q);
+ }
+ else
+#endif
+ {
+ parseprintf(DD_INSTALL, ("init_linemon: driver \"%s\" not suitable for CD monitoring\n", dname));
+ return 0;
+ }
+ }
+ parseprintf(DD_INSTALL, ("init_linemon: cannot find driver\n"));
+ return 0;
+}
+
+static void
+close_linemon(
+ register queue_t *q,
+ register queue_t *my_q
+ )
+{
+ /*
+ * find appropriate driver dependent routine
+ */
+ if (q->q_qinfo && q->q_qinfo->qi_minfo)
+ {
+ register char *dname = q->q_qinfo->qi_minfo->mi_idname;
+
+#ifdef sun
+ if (dname && !Strcmp(dname, "zs"))
+ {
+ close_zs_linemon(q, my_q);
+ return;
+ }
+ parseprintf(DD_INSTALL, ("close_linemon: cannot find driver close routine for \"%s\"\n", dname));
+#endif
+ }
+ parseprintf(DD_INSTALL, ("close_linemon: cannot find driver name\n"));
+}
+
+#ifdef sun
+
+#include <sundev/zsreg.h>
+#include <sundev/zscom.h>
+#include <sundev/zsvar.h>
+
+static unsigned long cdmask = ZSRR0_CD;
+
+struct savedzsops
+{
+ struct zsops zsops;
+ struct zsops *oldzsops;
+};
+
+struct zsops *emergencyzs;
+extern void zsopinit (struct zscom *, struct zsops *);
+static int zs_xsisr (struct zscom *); /* zs external status interupt handler */
+
+static int
+init_zs_linemon(
+ register queue_t *q,
+ register queue_t *my_q
+ )
+{
+ register struct zscom *zs;
+ register struct savedzsops *szs;
+ register parsestream_t *parsestream = (parsestream_t *)(void *)my_q->q_ptr;
+ /*
+ * we expect the zsaline pointer in the q_data pointer
+ * from there on we insert our on EXTERNAL/STATUS ISR routine
+ * into the interrupt path, before the standard handler
+ */
+ zs = ((struct zsaline *)(void *)q->q_ptr)->za_common;
+ if (!zs)
+ {
+ /*
+ * well - not found on startup - just say no (shouldn't happen though)
+ */
+ return 0;
+ }
+ else
+ {
+ unsigned long s;
+
+ /*
+ * we do a direct replacement, in case others fiddle also
+ * if somebody else grabs our hook and we disconnect
+ * we are in DEEP trouble - panic is likely to be next, sorry
+ */
+ szs = (struct savedzsops *)(void *)kmem_alloc(sizeof(struct savedzsops));
+
+ if (szs == (struct savedzsops *)0)
+ {
+ parseprintf(DD_INSTALL, ("init_zs_linemon: CD monitor NOT installed - no memory\n"));
+
+ return 0;
+ }
+ else
+ {
+ parsestream->parse_data = (void *)szs;
+
+ s = splhigh();
+
+ parsestream->parse_dqueue = q; /* remember driver */
+
+ szs->zsops = *zs->zs_ops;
+ szs->zsops.zsop_xsint = zs_xsisr; /* place our bastard */
+ szs->oldzsops = zs->zs_ops;
+ emergencyzs = zs->zs_ops;
+
+ zsopinit(zs, &szs->zsops); /* hook it up */
+
+ (void) splx(s);
+
+ parseprintf(DD_INSTALL, ("init_zs_linemon: CD monitor installed\n"));
+
+ return 1;
+ }
+ }
+}
+
+/*
+ * unregister our ISR routine - must call under splhigh()
+ */
+static void
+close_zs_linemon(
+ register queue_t *q,
+ register queue_t *my_q
+ )
+{
+ register struct zscom *zs;
+ register parsestream_t *parsestream = (parsestream_t *)(void *)my_q->q_ptr;
+
+ zs = ((struct zsaline *)(void *)q->q_ptr)->za_common;
+ if (!zs)
+ {
+ /*
+ * well - not found on startup - just say no (shouldn't happen though)
+ */
+ return;
+ }
+ else
+ {
+ register struct savedzsops *szs = (struct savedzsops *)parsestream->parse_data;
+
+ zsopinit(zs, szs->oldzsops); /* reset to previous handler functions */
+
+ kmem_free((caddr_t)szs, sizeof (struct savedzsops));
+
+ parseprintf(DD_INSTALL, ("close_zs_linemon: CD monitor deleted\n"));
+ return;
+ }
+}
+
+#define MAXDEPTH 50 /* maximum allowed stream crawl */
+
+#ifdef PPS_SYNC
+extern void hardpps (struct timeval *, long);
+#ifdef PPS_NEW
+extern struct timeval timestamp;
+#else
+extern struct timeval pps_time;
+#endif
+#endif
+
+/*
+ * take external status interrupt (only CD interests us)
+ */
+static int
+zs_xsisr(
+ struct zscom *zs
+ )
+{
+ register struct zsaline *za = (struct zsaline *)(void *)zs->zs_priv;
+ register struct zscc_device *zsaddr = zs->zs_addr;
+ register queue_t *q;
+ register unsigned char zsstatus;
+ register int loopcheck;
+ register char *dname;
+#ifdef PPS_SYNC
+ register unsigned int s;
+ register long usec;
+#endif
+
+ /*
+ * pick up current state
+ */
+ zsstatus = zsaddr->zscc_control;
+
+ if ((za->za_rr0 ^ zsstatus) & (cdmask))
+ {
+ timestamp_t cdevent;
+ register int status;
+
+ za->za_rr0 = (za->za_rr0 & ~(cdmask)) | (zsstatus & (cdmask));
+
+#ifdef PPS_SYNC
+ s = splclock();
+#ifdef PPS_NEW
+ usec = timestamp.tv_usec;
+#else
+ usec = pps_time.tv_usec;
+#endif
+#endif
+ /*
+ * time stamp
+ */
+ uniqtime(&cdevent.tv);
+
+#ifdef PPS_SYNC
+ (void)splx(s);
+#endif
+
+ /*
+ * logical state
+ */
+ status = cd_invert ? (zsstatus & cdmask) == 0 : (zsstatus & cdmask) != 0;
+
+#ifdef PPS_SYNC
+ if (status)
+ {
+ usec = cdevent.tv.tv_usec - usec;
+ if (usec < 0)
+ usec += 1000000;
+
+ hardpps(&cdevent.tv, usec);
+ }
+#endif
+
+ q = za->za_ttycommon.t_readq;
+
+ /*
+ * ok - now the hard part - find ourself
+ */
+ loopcheck = MAXDEPTH;
+
+ while (q)
+ {
+ if (q->q_qinfo && q->q_qinfo->qi_minfo)
+ {
+ dname = q->q_qinfo->qi_minfo->mi_idname;
+
+ if (!Strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname))
+ {
+ /*
+ * back home - phew (hopping along stream queues might
+ * prove dangerous to your health)
+ */
+
+ if ((((parsestream_t *)(void *)q->q_ptr)->parse_status & PARSE_ENABLE) &&
+ parse_iopps(&((parsestream_t *)(void *)q->q_ptr)->parse_io, (int)(status ? SYNC_ONE : SYNC_ZERO), &cdevent))
+ {
+ /*
+ * XXX - currently we do not pass up the message, as
+ * we should.
+ * for a correct behaviour wee need to block out
+ * processing until parse_iodone has been posted via
+ * a softcall-ed routine which does the message pass-up
+ * right now PPS information relies on input being
+ * received
+ */
+ parse_iodone(&((parsestream_t *)(void *)q->q_ptr)->parse_io);
+ }
+
+ if (status)
+ {
+ ((parsestream_t *)(void *)q->q_ptr)->parse_ppsclockev.tv = cdevent.tv;
+ ++(((parsestream_t *)(void *)q->q_ptr)->parse_ppsclockev.serial);
+ }
+
+ parseprintf(DD_ISR, ("zs_xsisr: CD event %s has been posted for \"%s\"\n", status ? "ONE" : "ZERO", dname));
+ break;
+ }
+ }
+
+ q = q->q_next;
+
+ if (!loopcheck--)
+ {
+ panic("zs_xsisr: STREAMS Queue corrupted - CD event");
+ }
+ }
+
+ /*
+ * only pretend that CD has been handled
+ */
+ ZSDELAY(2);
+
+ if (!((za->za_rr0 ^ zsstatus) & ~(cdmask)))
+ {
+ /*
+ * all done - kill status indication and return
+ */
+ zsaddr->zscc_control = ZSWR0_RESET_STATUS; /* might kill other conditions here */
+ return 0;
+ }
+ }
+
+ if (zsstatus & cdmask) /* fake CARRIER status */
+ za->za_flags |= ZAS_CARR_ON;
+ else
+ za->za_flags &= ~ZAS_CARR_ON;
+
+ /*
+ * we are now gathered here to process some unusual external status
+ * interrupts.
+ * any CD events have also been handled and shouldn't be processed
+ * by the original routine (unless we have a VERY busy port pin)
+ * some initializations are done here, which could have been done before for
+ * both code paths but have been avoided for minimum path length to
+ * the uniq_time routine
+ */
+ dname = (char *) 0;
+ q = za->za_ttycommon.t_readq;
+
+ loopcheck = MAXDEPTH;
+
+ /*
+ * the real thing for everything else ...
+ */
+ while (q)
+ {
+ if (q->q_qinfo && q->q_qinfo->qi_minfo)
+ {
+ dname = q->q_qinfo->qi_minfo->mi_idname;
+ if (!Strcmp(dname, parseinfo.st_rdinit->qi_minfo->mi_idname))
+ {
+ register int (*zsisr) (struct zscom *);
+
+ /*
+ * back home - phew (hopping along stream queues might
+ * prove dangerous to your health)
+ */
+ if ((zsisr = ((struct savedzsops *)((parsestream_t *)(void *)q->q_ptr)->parse_data)->oldzsops->zsop_xsint))
+ return zsisr(zs);
+ else
+ panic("zs_xsisr: unable to locate original ISR");
+
+ parseprintf(DD_ISR, ("zs_xsisr: non CD event was processed for \"%s\"\n", dname));
+ /*
+ * now back to our program ...
+ */
+ return 0;
+ }
+ }
+
+ q = q->q_next;
+
+ if (!loopcheck--)
+ {
+ panic("zs_xsisr: STREAMS Queue corrupted - non CD event");
+ }
+ }
+
+ /*
+ * last resort - shouldn't even come here as it indicates
+ * corrupted TTY structures
+ */
+ printf("zs_zsisr: looking for \"%s\" - found \"%s\" - taking EMERGENCY path\n", parseinfo.st_rdinit->qi_minfo->mi_idname, dname ? dname : "-NIL-");
+
+ if (emergencyzs && emergencyzs->zsop_xsint)
+ emergencyzs->zsop_xsint(zs);
+ else
+ panic("zs_xsisr: no emergency ISR handler");
+ return 0;
+}
+#endif /* sun */
+
+/*
+ * History:
+ *
+ * parsestreams.c,v
+ * Revision 4.11 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.10 2004/11/14 16:06:08 kardel
+ * update Id tags
+ *
+ * Revision 4.9 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.7 1999/11/28 09:13:53 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.6 1998/12/20 23:45:31 kardel
+ * fix types and warnings
+ *
+ * Revision 4.5 1998/11/15 21:23:38 kardel
+ * ntp_memset() replicated in Sun kernel files
+ *
+ * Revision 4.4 1998/06/13 12:15:59 kardel
+ * superfluous variable removed
+ *
+ * Revision 4.3 1998/06/12 15:23:08 kardel
+ * fix prototypes
+ * adjust for ansi2knr
+ *
+ * Revision 4.2 1998/05/24 18:16:22 kardel
+ * moved copy of shadow status to the beginning
+ *
+ * Revision 4.1 1998/05/24 09:38:47 kardel
+ * streams initiated iopps calls (M_xHANGUP) are now consistent with the
+ * respective calls from zs_xsisr()
+ * simulation of CARRIER status to avoid unecessary M_xHANGUP messages
+ *
+ * Revision 4.0 1998/04/10 19:45:38 kardel
+ * Start 4.0 release version numbering
+ *
+ * from V3 3.37 log info deleted 1998/04/11 kardel
+ */
diff --git a/libparse/trim_info.c b/libparse/trim_info.c
new file mode 100644
index 0000000..619e238
--- /dev/null
+++ b/libparse/trim_info.c
@@ -0,0 +1,70 @@
+/*
+ * /src/NTP/ntp4-dev/libparse/trim_info.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * trim_info.c,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ *
+ * $Created: Sun Aug 2 20:20:34 1998 $
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+#include <config.h>
+#include "ntp_types.h"
+#include "trimble.h"
+
+cmd_info_t *
+trimble_convert(
+ unsigned int cmd,
+ cmd_info_t *tbl
+ )
+{
+ int i;
+
+ for (i = 0; tbl[i].cmd != 0xFF; i++)
+ {
+ if (tbl[i].cmd == cmd)
+ return &tbl[i];
+ }
+ return 0;
+}
+
+/*
+ * trim_info.c,v
+ * Revision 4.5 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.4 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.2 1998/12/20 23:45:31 kardel
+ * fix types and warnings
+ *
+ * Revision 4.1 1998/08/09 22:27:48 kardel
+ * Trimble TSIP support
+ *
+ */
diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am
new file mode 100644
index 0000000..b3af527
--- /dev/null
+++ b/ntpd/Makefile.am
@@ -0,0 +1,438 @@
+NULL=
+
+bin_PROGRAMS= $(NTPD_DB) $(NTPDSIM_DB)
+libexec_PROGRAMS= $(NTPD_DL) $(NTPDSIM_DL)
+sbin_PROGRAMS= $(NTPD_DS) $(NTPDSIM_DS)
+
+noinst_LIBRARIES= libntpd.a
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB.
+LDADD = version.o libntpd.a $(LIBPARSE)
+AM_YFLAGS = -d -t -r all
+
+if SAVECONFIG_ENABLED
+if NTP_CROSSCOMPILE
+CHECK_SAVECONFIG=
+else
+CHECK_SAVECONFIG= check-saveconfig
+endif
+else !SAVECONFIG_ENABLED
+CHECK_SAVECONFIG=
+endif
+
+#
+# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as
+# BSD make) to work around issues specific to compiling
+# ntp_parser.y into ntp_parser.h and ntp_parser.c in a VPATH
+# configuration where we would like (for a change) the output
+# files ntp_parser.[ch] to be placed in the source directory,
+# as opposed to the build directory. This allows a single
+# host of a flock configured with Bison to update ntp_parser.[ch]
+# used by the rest.
+#
+
+if VPATH_HACK
+VPHACK= vphack
+VPHACK_AFTER= vphack_after
+else
+VPHACK=
+VPHACK_AFTER=
+endif
+
+vphack:
+ test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c .
+ test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h .
+
+#
+# ylwrap script which invokes Bison replaces ntp_parser.h
+# symlink with the updated file, when ntp_parser.h changes.
+# vphack_after detects this and copies the updated file to srcdir
+# and re-creates the ntp_parser.h symlink in its place.
+#
+
+vphack_after:
+ test -L ntp_parser.h || ( \
+ mv ntp_parser.h $(srcdir)/ntp_parser.h && \
+ ln -s $(srcdir)/ntp_parser.h . \
+ )
+
+# BUILT_SOURCES which should also be in EXTRA_DIST
+B_S_DIST= \
+ $(srcdir)/ntpd-opts.c \
+ $(srcdir)/ntpd-opts.h \
+ $(NULL)
+
+BUILT_SOURCES= \
+ $(VPHACK) \
+ $(LIBPARSE) \
+ ntp_parser.c \
+ ntp_parser.h \
+ $(VPHACK_AFTER) \
+ $(B_S_DIST) \
+ $(NULL)
+
+man1_MANS=
+man5_MANS= ntp.conf.5 ntp.keys.5
+man8_MANS=
+man_MANS= ntpd.$(NTPD_MS)
+
+# ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the
+# simulator currently uses ntpd-opts.[ch]. This also means there is no
+# longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def.
+
+LDADD_NTPD_COMMON = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS)
+LDADD_NTPD_COMMON += $(LIBM) $(LDADD_NTP) $(LSCF)
+ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_NTPD_COMMON)
+ntpdsim_LDADD = $(LDADD) ../libntp/libntpsim.a $(LDADD_NTPD_COMMON)
+ntpdsim_CPPFLAGS = $(AM_CPPFLAGS) -DSIM
+check_y2k_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_LIBNTP) $(PTHREAD_LIBS)
+## we don't want $(LDADD) in keyword_gen_LDADD
+keyword_gen_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+
+DISTCLEANFILES = \
+ keyword-gen \
+ .version \
+ version.c \
+ config.log \
+ $(man5_MANS) \
+ $(man_MANS) \
+ $(NULL)
+
+CLEANFILES = \
+ check-saveconfig \
+ compsave.conf \
+ k-g-u-submake \
+ $(EXTRA_PROGRAMS) \
+ $(NULL)
+
+EXTRA_DIST = \
+ complete.conf.in \
+ invoke-ntp.conf.menu \
+ invoke-ntp.conf.texi \
+ invoke-ntp.keys.menu \
+ invoke-ntp.keys.texi \
+ invoke-ntpd.menu \
+ invoke-ntpd.texi \
+ keyword-gen-utd \
+ ntp.conf.5man \
+ ntp.conf.5mdoc \
+ ntp.conf.def \
+ ntp.conf.man.in \
+ ntp.conf.mdoc.in \
+ ntp.conf.html \
+ ntp.conf.texi \
+ ntp.keys.5man \
+ ntp.keys.5mdoc \
+ ntp.keys.def \
+ ntp.keys.man.in \
+ ntp.keys.mdoc.in \
+ ntp.keys.html \
+ ntp.keys.texi \
+ ntpd-opts.def \
+ ntpd.1ntpdman \
+ ntpd.1ntpdmdoc \
+ ntpd.man.in \
+ ntpd.mdoc.in \
+ ntpd.html \
+ ntpd.texi \
+ ntpdbase-opts.def \
+ refclock_msfees.c \
+ $(B_S_DIST) \
+ $(NULL)
+
+### Y2Kfixes
+check_PROGRAMS = @MAKE_CHECK_Y2K@
+EXTRA_PROGRAMS = check_y2k keyword-gen ntpd ntpdsim
+
+html_DATA= \
+ $(srcdir)/ntp.conf.html \
+ $(srcdir)/ntp.keys.html \
+ $(srcdir)/ntpd.html \
+ $(NULL)
+
+noinst_DATA = \
+ $(srcdir)/invoke-ntp.conf.menu \
+ $(srcdir)/invoke-ntp.conf.texi \
+ $(srcdir)/invoke-ntp.keys.menu \
+ $(srcdir)/invoke-ntp.keys.texi \
+ $(srcdir)/invoke-ntpd.menu \
+ $(srcdir)/invoke-ntpd.texi \
+ $(srcdir)/ntp.conf.man.in \
+ $(srcdir)/ntp.conf.mdoc.in \
+ $(srcdir)/ntp.keys.man.in \
+ $(srcdir)/ntp.keys.mdoc.in \
+ $(srcdir)/ntpd.man.in \
+ $(srcdir)/ntpd.mdoc.in \
+ $(NULL)
+
+noinst_HEADERS = \
+ declcond.h \
+ ntp_leapsec.h \
+ $(NULL)
+
+install-data-local: install-html
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+check-local: $(MAKE_CHECK_Y2K) $(CHECK_SAVECONFIG)
+ test -z "$(MAKE_CHECK_Y2K)" || ./$(MAKE_CHECK_Y2K)
+
+ntpd_SOURCES = \
+ ntp_config.c \
+ ntp_keyword.h \
+ ntp_io.c \
+ ntp_parser.y \
+ ntp_scanner.c \
+ ntp_scanner.h \
+ ntpd.c \
+ ntpd-opts.c \
+ ntpd-opts.h \
+ $(NULL)
+
+ntpdsim_SOURCES = \
+ $(ntpd_SOURCES) \
+ ntp_prio_q.c \
+ ntpsim.c \
+ $(NULL)
+
+# libntpd_a_SOURCES do not use #ifdef SIM
+
+libntpd_a_SOURCES = \
+ cmd_args.c \
+ jupiter.h \
+ ntp_control.c \
+ ntp_crypto.c \
+ ntp_filegen.c \
+ ntp_leapsec.c \
+ ntp_loopfilter.c \
+ ntp_monitor.c \
+ ntp_peer.c \
+ ntp_proto.c \
+ ntp_refclock.c \
+ ntp_request.c \
+ ntp_restrict.c \
+ ntp_signd.c \
+ ntp_timer.c \
+ ntp_util.c \
+ ppsapi_timepps.h \
+ refclock_acts.c \
+ refclock_arbiter.c \
+ refclock_arc.c \
+ refclock_as2201.c \
+ refclock_atom.c \
+ refclock_bancomm.c \
+ refclock_chronolog.c \
+ refclock_chu.c \
+ refclock_conf.c \
+ refclock_datum.c \
+ refclock_dumbclock.c \
+ refclock_fg.c \
+ refclock_gpsdjson.c \
+ refclock_gpsvme.c \
+ refclock_heath.c \
+ refclock_hopfser.c \
+ refclock_hopfpci.c \
+ refclock_hpgps.c \
+ refclock_irig.c \
+ refclock_jjy.c \
+ refclock_jupiter.c \
+ refclock_leitch.c \
+ refclock_local.c \
+ refclock_mx4200.c \
+ refclock_neoclock4x.c \
+ refclock_nmea.c \
+ refclock_oncore.c \
+ refclock_palisade.c \
+ refclock_palisade.h \
+ refclock_parse.c \
+ refclock_pcf.c \
+ refclock_pst.c \
+ refclock_ripencc.c \
+ refclock_shm.c \
+ refclock_tpro.c \
+ refclock_true.c \
+ refclock_tt560.c \
+ refclock_ulink.c \
+ refclock_wwv.c \
+ refclock_wwvb.c \
+ refclock_zyfer.c \
+ refclock_tsyncpci.c \
+ $(NULL)
+
+k-g-u-submake: keyword-gen
+ ./keyword-gen $(srcdir)/ntp_parser.h > k-g.out
+ @grep -v diff_ignore_line < k-g.out > cmp1
+ @grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2
+ @cmp cmp1 cmp2 > /dev/null || \
+ { mv -f k-g.out $(srcdir)/ntp_keyword.h && \
+ echo 'Generated changed ntp_keyword.h.' ;}
+ @[ ! -f k-g.out ] || \
+ { rm k-g.out && echo 'ntp_keyword.h is up to date.' ;}
+ @rm cmp1 cmp2
+ @echo 'keyword-gen and ntp_keyword.h are up to date.' > $@
+
+$(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h
+ $(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency
+ grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u
+ mv -f k-g-u $@
+
+$(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd
+ @: do-nothing action to avoid default SCCS get
+ @: .h updated if needed by k-g-u-submake rule
+
+$(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) ntpd-opts.def
+
+###
+
+$(srcdir)/ntpd.1ntpdman: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def
+
+$(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdman > $(srcdir)/ntpd.man.in+
+ mv $(srcdir)/ntpd.man.in+ $(srcdir)/ntpd.man.in
+
+###
+
+$(srcdir)/ntpd.1ntpdmdoc: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def
+
+$(srcdir)/ntpd.mdoc.in: $(srcdir)/ntpd.1ntpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdmdoc > $(srcdir)/ntpd.mdoc.in+
+ mv $(srcdir)/ntpd.mdoc.in+ $(srcdir)/ntpd.mdoc.in
+
+###
+
+ntpd.$(NTPD_MS): $(srcdir)/ntpd.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpd.$(NTPD_MS)+:$(srcdir)/ntpd.$(MANTAGFMT).in
+ mv ntpd.$(NTPD_MS)+ ntpd.$(NTPD_MS)
+
+###
+
+$(srcdir)/invoke-ntp.conf.menu: $(srcdir)/invoke-ntp.conf.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp.conf.texi: $(srcdir)/ntp.conf.def $(std_def_list)
+ $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def
+
+$(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list)
+ $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def
+
+$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true )
+
+$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.keys.html ntp.keys.texi || true )
+
+$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpd.html ntpd.texi || true )
+
+###
+
+$(srcdir)/ntp.conf.5man: $(srcdir)/ntp.conf.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def
+
+$(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5man > $(srcdir)/ntp.conf.man.in+
+ mv $(srcdir)/ntp.conf.man.in+ $(srcdir)/ntp.conf.man.in
+
+###
+
+$(srcdir)/ntp.conf.5mdoc: $(srcdir)/ntp.conf.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def
+
+$(srcdir)/ntp.conf.mdoc.in: $(srcdir)/ntp.conf.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5mdoc > $(srcdir)/ntp.conf.mdoc.in+
+ mv $(srcdir)/ntp.conf.mdoc.in+ $(srcdir)/ntp.conf.mdoc.in
+
+###
+
+ntp.conf.5: $(srcdir)/ntp.conf.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp.conf.5+:$(srcdir)/ntp.conf.$(MANTAGFMT).in
+ mv ntp.conf.5+ ntp.conf.5
+
+###
+
+$(srcdir)/ntp.keys.5man: $(srcdir)/ntp.keys.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def
+
+$(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5man > $(srcdir)/ntp.keys.man.in+
+ mv $(srcdir)/ntp.keys.man.in+ $(srcdir)/ntp.keys.man.in
+
+###
+
+$(srcdir)/ntp.keys.5mdoc: $(srcdir)/ntp.keys.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def
+
+$(srcdir)/ntp.keys.mdoc.in: $(srcdir)/ntp.keys.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5mdoc > $(srcdir)/ntp.keys.mdoc.in+
+ mv $(srcdir)/ntp.keys.mdoc.in+ $(srcdir)/ntp.keys.mdoc.in
+
+###
+
+ntp.keys.5: $(srcdir)/ntp.keys.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp.keys.5+:$(srcdir)/ntp.keys.$(MANTAGFMT).in
+ mv ntp.keys.5+ ntp.keys.5
+
+###
+
+$(srcdir)/invoke-ntpd.menu: $(srcdir)/invoke-ntpd.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(PROGRAMS): $(LDADD)
+
+compsave.conf: ntpd complete.conf
+ ./ntpd --configfile complete.conf --saveconfigquit $@
+
+check-saveconfig: complete.conf compsave.conf
+ -diff -u complete.conf compsave.conf
+ cmp complete.conf compsave.conf && echo stamp > $@
+
+../libntp/libntpsim.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntpsim.a
+
+../libparse/libparse.a:
+ cd ../libparse && $(MAKE) $(AM_MAKEFLAGS) check-libparse
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/check-libopts.mf
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/ntpd/Makefile.in b/ntpd/Makefile.in
new file mode 100644
index 0000000..ddb2ad3
--- /dev/null
+++ b/ntpd/Makefile.in
@@ -0,0 +1,1790 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = check_y2k$(EXEEXT) keyword-gen$(EXEEXT) ntpd$(EXEEXT) \
+ ntpdsim$(EXEEXT)
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/complete.conf.in \
+ $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/check-libntp.mf ntp_parser.c ntp_parser.h
+subdir = ntpd
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = complete.conf
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+am__v_AR_0 = @echo " AR " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+libntpd_a_AR = $(AR) $(ARFLAGS)
+libntpd_a_LIBADD =
+am__objects_1 =
+am_libntpd_a_OBJECTS = cmd_args.$(OBJEXT) ntp_control.$(OBJEXT) \
+ ntp_crypto.$(OBJEXT) ntp_filegen.$(OBJEXT) \
+ ntp_leapsec.$(OBJEXT) ntp_loopfilter.$(OBJEXT) \
+ ntp_monitor.$(OBJEXT) ntp_peer.$(OBJEXT) ntp_proto.$(OBJEXT) \
+ ntp_refclock.$(OBJEXT) ntp_request.$(OBJEXT) \
+ ntp_restrict.$(OBJEXT) ntp_signd.$(OBJEXT) ntp_timer.$(OBJEXT) \
+ ntp_util.$(OBJEXT) refclock_acts.$(OBJEXT) \
+ refclock_arbiter.$(OBJEXT) refclock_arc.$(OBJEXT) \
+ refclock_as2201.$(OBJEXT) refclock_atom.$(OBJEXT) \
+ refclock_bancomm.$(OBJEXT) refclock_chronolog.$(OBJEXT) \
+ refclock_chu.$(OBJEXT) refclock_conf.$(OBJEXT) \
+ refclock_datum.$(OBJEXT) refclock_dumbclock.$(OBJEXT) \
+ refclock_fg.$(OBJEXT) refclock_gpsdjson.$(OBJEXT) \
+ refclock_gpsvme.$(OBJEXT) refclock_heath.$(OBJEXT) \
+ refclock_hopfser.$(OBJEXT) refclock_hopfpci.$(OBJEXT) \
+ refclock_hpgps.$(OBJEXT) refclock_irig.$(OBJEXT) \
+ refclock_jjy.$(OBJEXT) refclock_jupiter.$(OBJEXT) \
+ refclock_leitch.$(OBJEXT) refclock_local.$(OBJEXT) \
+ refclock_mx4200.$(OBJEXT) refclock_neoclock4x.$(OBJEXT) \
+ refclock_nmea.$(OBJEXT) refclock_oncore.$(OBJEXT) \
+ refclock_palisade.$(OBJEXT) refclock_parse.$(OBJEXT) \
+ refclock_pcf.$(OBJEXT) refclock_pst.$(OBJEXT) \
+ refclock_ripencc.$(OBJEXT) refclock_shm.$(OBJEXT) \
+ refclock_tpro.$(OBJEXT) refclock_true.$(OBJEXT) \
+ refclock_tt560.$(OBJEXT) refclock_ulink.$(OBJEXT) \
+ refclock_wwv.$(OBJEXT) refclock_wwvb.$(OBJEXT) \
+ refclock_zyfer.$(OBJEXT) refclock_tsyncpci.$(OBJEXT) \
+ $(am__objects_1)
+libntpd_a_OBJECTS = $(am_libntpd_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \
+ "$(DESTDIR)$(htmldir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+check_y2k_SOURCES = check_y2k.c
+check_y2k_OBJECTS = check_y2k.$(OBJEXT)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = version.o libntpd.a $(am__DEPENDENCIES_1)
+check_y2k_DEPENDENCIES = $(am__DEPENDENCIES_2) ../libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+keyword_gen_SOURCES = keyword-gen.c
+keyword_gen_OBJECTS = keyword-gen.$(OBJEXT)
+keyword_gen_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_ntpd_OBJECTS = ntp_config.$(OBJEXT) ntp_io.$(OBJEXT) \
+ ntp_parser.$(OBJEXT) ntp_scanner.$(OBJEXT) ntpd.$(OBJEXT) \
+ ntpd-opts.$(OBJEXT) $(am__objects_1)
+ntpd_OBJECTS = $(am_ntpd_OBJECTS)
+am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ntpd_DEPENDENCIES = $(am__DEPENDENCIES_2) ../libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_3)
+am__objects_2 = ntpdsim-ntp_config.$(OBJEXT) ntpdsim-ntp_io.$(OBJEXT) \
+ ntpdsim-ntp_parser.$(OBJEXT) ntpdsim-ntp_scanner.$(OBJEXT) \
+ ntpdsim-ntpd.$(OBJEXT) ntpdsim-ntpd-opts.$(OBJEXT) \
+ $(am__objects_1)
+am_ntpdsim_OBJECTS = $(am__objects_2) ntpdsim-ntp_prio_q.$(OBJEXT) \
+ ntpdsim-ntpsim.$(OBJEXT) $(am__objects_1)
+ntpdsim_OBJECTS = $(am_ntpdsim_OBJECTS)
+ntpdsim_DEPENDENCIES = $(am__DEPENDENCIES_2) ../libntp/libntpsim.a \
+ $(am__DEPENDENCIES_3)
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
+LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
+AM_V_YACC = $(am__v_YACC_$(V))
+am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
+am__v_YACC_0 = @echo " YACC " $@;
+YLWRAP = $(top_srcdir)/sntp/libevent/build-aux/ylwrap
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libntpd_a_SOURCES) check_y2k.c keyword-gen.c \
+ $(ntpd_SOURCES) $(ntpdsim_SOURCES)
+DIST_SOURCES = $(libntpd_a_SOURCES) check_y2k.c keyword-gen.c \
+ $(ntpd_SOURCES) $(ntpdsim_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+man5dir = $(mandir)/man5
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man5_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+bin_PROGRAMS = $(NTPD_DB) $(NTPDSIM_DB)
+libexec_PROGRAMS = $(NTPD_DL) $(NTPDSIM_DL)
+sbin_PROGRAMS = $(NTPD_DS) $(NTPDSIM_DS)
+noinst_LIBRARIES = libntpd.a
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB.
+LDADD = version.o libntpd.a $(LIBPARSE)
+AM_YFLAGS = -d -t -r all
+@NTP_CROSSCOMPILE_FALSE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG = check-saveconfig
+@NTP_CROSSCOMPILE_TRUE@@SAVECONFIG_ENABLED_TRUE@CHECK_SAVECONFIG =
+@SAVECONFIG_ENABLED_FALSE@CHECK_SAVECONFIG =
+@VPATH_HACK_FALSE@VPHACK =
+
+#
+# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as
+# BSD make) to work around issues specific to compiling
+# ntp_parser.y into ntp_parser.h and ntp_parser.c in a VPATH
+# configuration where we would like (for a change) the output
+# files ntp_parser.[ch] to be placed in the source directory,
+# as opposed to the build directory. This allows a single
+# host of a flock configured with Bison to update ntp_parser.[ch]
+# used by the rest.
+#
+@VPATH_HACK_TRUE@VPHACK = vphack
+@VPATH_HACK_FALSE@VPHACK_AFTER =
+@VPATH_HACK_TRUE@VPHACK_AFTER = vphack_after
+
+# BUILT_SOURCES which should also be in EXTRA_DIST
+B_S_DIST = \
+ $(srcdir)/ntpd-opts.c \
+ $(srcdir)/ntpd-opts.h \
+ $(NULL)
+
+BUILT_SOURCES = $(VPHACK) $(LIBPARSE) ntp_parser.c ntp_parser.h \
+ $(VPHACK_AFTER) $(B_S_DIST) $(NULL) check-libopts check-libntp \
+ .deps-ver
+man1_MANS =
+man5_MANS = ntp.conf.5 ntp.keys.5
+man8_MANS =
+man_MANS = ntpd.$(NTPD_MS)
+
+# ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the
+# simulator currently uses ntpd-opts.[ch]. This also means there is no
+# longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def.
+LDADD_NTPD_COMMON = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS) \
+ $(LIBM) $(LDADD_NTP) $(LSCF)
+ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_NTPD_COMMON)
+ntpdsim_LDADD = $(LDADD) ../libntp/libntpsim.a $(LDADD_NTPD_COMMON)
+ntpdsim_CPPFLAGS = $(AM_CPPFLAGS) -DSIM
+check_y2k_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(LDADD_LIBNTP) $(PTHREAD_LIBS)
+keyword_gen_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+DISTCLEANFILES = \
+ keyword-gen \
+ .version \
+ version.c \
+ config.log \
+ $(man5_MANS) \
+ $(man_MANS) \
+ $(NULL)
+
+CLEANFILES = check-saveconfig compsave.conf k-g-u-submake \
+ $(EXTRA_PROGRAMS) $(NULL) check-libopts check-libntp .deps-ver
+EXTRA_DIST = \
+ complete.conf.in \
+ invoke-ntp.conf.menu \
+ invoke-ntp.conf.texi \
+ invoke-ntp.keys.menu \
+ invoke-ntp.keys.texi \
+ invoke-ntpd.menu \
+ invoke-ntpd.texi \
+ keyword-gen-utd \
+ ntp.conf.5man \
+ ntp.conf.5mdoc \
+ ntp.conf.def \
+ ntp.conf.man.in \
+ ntp.conf.mdoc.in \
+ ntp.conf.html \
+ ntp.conf.texi \
+ ntp.keys.5man \
+ ntp.keys.5mdoc \
+ ntp.keys.def \
+ ntp.keys.man.in \
+ ntp.keys.mdoc.in \
+ ntp.keys.html \
+ ntp.keys.texi \
+ ntpd-opts.def \
+ ntpd.1ntpdman \
+ ntpd.1ntpdmdoc \
+ ntpd.man.in \
+ ntpd.mdoc.in \
+ ntpd.html \
+ ntpd.texi \
+ ntpdbase-opts.def \
+ refclock_msfees.c \
+ $(B_S_DIST) \
+ $(NULL)
+
+
+### Y2Kfixes
+check_PROGRAMS = @MAKE_CHECK_Y2K@
+html_DATA = \
+ $(srcdir)/ntp.conf.html \
+ $(srcdir)/ntp.keys.html \
+ $(srcdir)/ntpd.html \
+ $(NULL)
+
+noinst_DATA = \
+ $(srcdir)/invoke-ntp.conf.menu \
+ $(srcdir)/invoke-ntp.conf.texi \
+ $(srcdir)/invoke-ntp.keys.menu \
+ $(srcdir)/invoke-ntp.keys.texi \
+ $(srcdir)/invoke-ntpd.menu \
+ $(srcdir)/invoke-ntpd.texi \
+ $(srcdir)/ntp.conf.man.in \
+ $(srcdir)/ntp.conf.mdoc.in \
+ $(srcdir)/ntp.keys.man.in \
+ $(srcdir)/ntp.keys.mdoc.in \
+ $(srcdir)/ntpd.man.in \
+ $(srcdir)/ntpd.mdoc.in \
+ $(NULL)
+
+noinst_HEADERS = \
+ declcond.h \
+ ntp_leapsec.h \
+ $(NULL)
+
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+ntpd_SOURCES = \
+ ntp_config.c \
+ ntp_keyword.h \
+ ntp_io.c \
+ ntp_parser.y \
+ ntp_scanner.c \
+ ntp_scanner.h \
+ ntpd.c \
+ ntpd-opts.c \
+ ntpd-opts.h \
+ $(NULL)
+
+ntpdsim_SOURCES = \
+ $(ntpd_SOURCES) \
+ ntp_prio_q.c \
+ ntpsim.c \
+ $(NULL)
+
+
+# libntpd_a_SOURCES do not use #ifdef SIM
+libntpd_a_SOURCES = \
+ cmd_args.c \
+ jupiter.h \
+ ntp_control.c \
+ ntp_crypto.c \
+ ntp_filegen.c \
+ ntp_leapsec.c \
+ ntp_loopfilter.c \
+ ntp_monitor.c \
+ ntp_peer.c \
+ ntp_proto.c \
+ ntp_refclock.c \
+ ntp_request.c \
+ ntp_restrict.c \
+ ntp_signd.c \
+ ntp_timer.c \
+ ntp_util.c \
+ ppsapi_timepps.h \
+ refclock_acts.c \
+ refclock_arbiter.c \
+ refclock_arc.c \
+ refclock_as2201.c \
+ refclock_atom.c \
+ refclock_bancomm.c \
+ refclock_chronolog.c \
+ refclock_chu.c \
+ refclock_conf.c \
+ refclock_datum.c \
+ refclock_dumbclock.c \
+ refclock_fg.c \
+ refclock_gpsdjson.c \
+ refclock_gpsvme.c \
+ refclock_heath.c \
+ refclock_hopfser.c \
+ refclock_hopfpci.c \
+ refclock_hpgps.c \
+ refclock_irig.c \
+ refclock_jjy.c \
+ refclock_jupiter.c \
+ refclock_leitch.c \
+ refclock_local.c \
+ refclock_mx4200.c \
+ refclock_neoclock4x.c \
+ refclock_nmea.c \
+ refclock_oncore.c \
+ refclock_palisade.c \
+ refclock_palisade.h \
+ refclock_parse.c \
+ refclock_pcf.c \
+ refclock_pst.c \
+ refclock_ripencc.c \
+ refclock_shm.c \
+ refclock_tpro.c \
+ refclock_true.c \
+ refclock_tt560.c \
+ refclock_ulink.c \
+ refclock_wwv.c \
+ refclock_wwvb.c \
+ refclock_zyfer.c \
+ refclock_tsyncpci.c \
+ $(NULL)
+
+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 .o .obj .y
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/sntp/check-libntp.mf $(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 ntpd/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ntpd/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+complete.conf: $(top_builddir)/config.status $(srcdir)/complete.conf.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libntpd.a: $(libntpd_a_OBJECTS) $(libntpd_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libntpd.a
+ $(AM_V_AR)$(libntpd_a_AR) libntpd.a $(libntpd_a_OBJECTS) $(libntpd_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libntpd.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+check_y2k$(EXEEXT): $(check_y2k_OBJECTS) $(check_y2k_DEPENDENCIES)
+ @rm -f check_y2k$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_y2k_OBJECTS) $(check_y2k_LDADD) $(LIBS)
+keyword-gen$(EXEEXT): $(keyword_gen_OBJECTS) $(keyword_gen_DEPENDENCIES)
+ @rm -f keyword-gen$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(keyword_gen_OBJECTS) $(keyword_gen_LDADD) $(LIBS)
+ntp_parser.h: ntp_parser.c
+ @if test ! -f $@; then \
+ rm -f ntp_parser.c; \
+ $(MAKE) $(AM_MAKEFLAGS) ntp_parser.c; \
+ else :; fi
+ntpd$(EXEEXT): $(ntpd_OBJECTS) $(ntpd_DEPENDENCIES)
+ @rm -f ntpd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntpd_OBJECTS) $(ntpd_LDADD) $(LIBS)
+ntpdsim$(EXEEXT): $(ntpdsim_OBJECTS) $(ntpdsim_DEPENDENCIES)
+ @rm -f ntpdsim$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntpdsim_OBJECTS) $(ntpdsim_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_y2k.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd_args.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyword-gen.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_config.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_control.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_crypto.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_filegen.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_io.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_leapsec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_loopfilter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_monitor.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_parser.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_peer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_proto.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_refclock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_request.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_restrict.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_scanner.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_signd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_timer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd-opts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_config.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_io.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_parser.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_prio_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntp_scanner.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd-opts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdsim-ntpsim.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_acts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arbiter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_arc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_as2201.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_atom.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_bancomm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chronolog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_chu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_conf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_datum.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_dumbclock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_fg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_gpsdjson.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_gpsvme.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_heath.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfpci.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hopfser.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_hpgps.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_irig.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jjy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_jupiter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_leitch.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_local.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_mx4200.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_neoclock4x.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_nmea.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_oncore.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_palisade.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_parse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pcf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_pst.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ripencc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_shm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tpro.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_true.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tsyncpci.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_tt560.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_ulink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_wwvb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refclock_zyfer.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+ntpdsim-ntp_config.o: ntp_config.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_config.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_config.Tpo -c -o ntpdsim-ntp_config.o `test -f 'ntp_config.c' || echo '$(srcdir)/'`ntp_config.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_config.Tpo $(DEPDIR)/ntpdsim-ntp_config.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_config.c' object='ntpdsim-ntp_config.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_config.o `test -f 'ntp_config.c' || echo '$(srcdir)/'`ntp_config.c
+
+ntpdsim-ntp_config.obj: ntp_config.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_config.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_config.Tpo -c -o ntpdsim-ntp_config.obj `if test -f 'ntp_config.c'; then $(CYGPATH_W) 'ntp_config.c'; else $(CYGPATH_W) '$(srcdir)/ntp_config.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_config.Tpo $(DEPDIR)/ntpdsim-ntp_config.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_config.c' object='ntpdsim-ntp_config.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_config.obj `if test -f 'ntp_config.c'; then $(CYGPATH_W) 'ntp_config.c'; else $(CYGPATH_W) '$(srcdir)/ntp_config.c'; fi`
+
+ntpdsim-ntp_io.o: ntp_io.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_io.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_io.Tpo -c -o ntpdsim-ntp_io.o `test -f 'ntp_io.c' || echo '$(srcdir)/'`ntp_io.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_io.Tpo $(DEPDIR)/ntpdsim-ntp_io.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_io.c' object='ntpdsim-ntp_io.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_io.o `test -f 'ntp_io.c' || echo '$(srcdir)/'`ntp_io.c
+
+ntpdsim-ntp_io.obj: ntp_io.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_io.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_io.Tpo -c -o ntpdsim-ntp_io.obj `if test -f 'ntp_io.c'; then $(CYGPATH_W) 'ntp_io.c'; else $(CYGPATH_W) '$(srcdir)/ntp_io.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_io.Tpo $(DEPDIR)/ntpdsim-ntp_io.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_io.c' object='ntpdsim-ntp_io.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_io.obj `if test -f 'ntp_io.c'; then $(CYGPATH_W) 'ntp_io.c'; else $(CYGPATH_W) '$(srcdir)/ntp_io.c'; fi`
+
+ntpdsim-ntp_parser.o: ntp_parser.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_parser.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_parser.Tpo -c -o ntpdsim-ntp_parser.o `test -f 'ntp_parser.c' || echo '$(srcdir)/'`ntp_parser.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_parser.Tpo $(DEPDIR)/ntpdsim-ntp_parser.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_parser.c' object='ntpdsim-ntp_parser.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_parser.o `test -f 'ntp_parser.c' || echo '$(srcdir)/'`ntp_parser.c
+
+ntpdsim-ntp_parser.obj: ntp_parser.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_parser.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_parser.Tpo -c -o ntpdsim-ntp_parser.obj `if test -f 'ntp_parser.c'; then $(CYGPATH_W) 'ntp_parser.c'; else $(CYGPATH_W) '$(srcdir)/ntp_parser.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_parser.Tpo $(DEPDIR)/ntpdsim-ntp_parser.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_parser.c' object='ntpdsim-ntp_parser.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_parser.obj `if test -f 'ntp_parser.c'; then $(CYGPATH_W) 'ntp_parser.c'; else $(CYGPATH_W) '$(srcdir)/ntp_parser.c'; fi`
+
+ntpdsim-ntp_scanner.o: ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_scanner.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_scanner.Tpo -c -o ntpdsim-ntp_scanner.o `test -f 'ntp_scanner.c' || echo '$(srcdir)/'`ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_scanner.Tpo $(DEPDIR)/ntpdsim-ntp_scanner.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_scanner.c' object='ntpdsim-ntp_scanner.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_scanner.o `test -f 'ntp_scanner.c' || echo '$(srcdir)/'`ntp_scanner.c
+
+ntpdsim-ntp_scanner.obj: ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_scanner.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_scanner.Tpo -c -o ntpdsim-ntp_scanner.obj `if test -f 'ntp_scanner.c'; then $(CYGPATH_W) 'ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/ntp_scanner.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntp_scanner.Tpo $(DEPDIR)/ntpdsim-ntp_scanner.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_scanner.c' object='ntpdsim-ntp_scanner.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_scanner.obj `if test -f 'ntp_scanner.c'; then $(CYGPATH_W) 'ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/ntp_scanner.c'; fi`
+
+ntpdsim-ntpd.o: ntpd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd.Tpo -c -o ntpdsim-ntpd.o `test -f 'ntpd.c' || echo '$(srcdir)/'`ntpd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntpd.Tpo $(DEPDIR)/ntpdsim-ntpd.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntpd.c' object='ntpdsim-ntpd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd.o `test -f 'ntpd.c' || echo '$(srcdir)/'`ntpd.c
+
+ntpdsim-ntpd.obj: ntpd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd.Tpo -c -o ntpdsim-ntpd.obj `if test -f 'ntpd.c'; then $(CYGPATH_W) 'ntpd.c'; else $(CYGPATH_W) '$(srcdir)/ntpd.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntpd.Tpo $(DEPDIR)/ntpdsim-ntpd.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntpd.c' object='ntpdsim-ntpd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd.obj `if test -f 'ntpd.c'; then $(CYGPATH_W) 'ntpd.c'; else $(CYGPATH_W) '$(srcdir)/ntpd.c'; fi`
+
+ntpdsim-ntpd-opts.o: ntpd-opts.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd-opts.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd-opts.Tpo -c -o ntpdsim-ntpd-opts.o `test -f 'ntpd-opts.c' || echo '$(srcdir)/'`ntpd-opts.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntpd-opts.Tpo $(DEPDIR)/ntpdsim-ntpd-opts.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntpd-opts.c' object='ntpdsim-ntpd-opts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd-opts.o `test -f 'ntpd-opts.c' || echo '$(srcdir)/'`ntpd-opts.c
+
+ntpdsim-ntpd-opts.obj: ntpd-opts.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpd-opts.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntpd-opts.Tpo -c -o ntpdsim-ntpd-opts.obj `if test -f 'ntpd-opts.c'; then $(CYGPATH_W) 'ntpd-opts.c'; else $(CYGPATH_W) '$(srcdir)/ntpd-opts.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntpd-opts.Tpo $(DEPDIR)/ntpdsim-ntpd-opts.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntpd-opts.c' object='ntpdsim-ntpd-opts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpd-opts.obj `if test -f 'ntpd-opts.c'; then $(CYGPATH_W) 'ntpd-opts.c'; else $(CYGPATH_W) '$(srcdir)/ntpd-opts.c'; fi`
+
+ntpdsim-ntp_prio_q.o: ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_prio_q.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_prio_q.Tpo -c -o ntpdsim-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)/ntpdsim-ntp_prio_q.Tpo $(DEPDIR)/ntpdsim-ntp_prio_q.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_prio_q.c' object='ntpdsim-ntp_prio_q.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntp_prio_q.o `test -f 'ntp_prio_q.c' || echo '$(srcdir)/'`ntp_prio_q.c
+
+ntpdsim-ntp_prio_q.obj: ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntp_prio_q.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntp_prio_q.Tpo -c -o ntpdsim-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)/ntpdsim-ntp_prio_q.Tpo $(DEPDIR)/ntpdsim-ntp_prio_q.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntp_prio_q.c' object='ntpdsim-ntp_prio_q.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-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`
+
+ntpdsim-ntpsim.o: ntpsim.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpsim.o -MD -MP -MF $(DEPDIR)/ntpdsim-ntpsim.Tpo -c -o ntpdsim-ntpsim.o `test -f 'ntpsim.c' || echo '$(srcdir)/'`ntpsim.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntpsim.Tpo $(DEPDIR)/ntpdsim-ntpsim.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntpsim.c' object='ntpdsim-ntpsim.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpsim.o `test -f 'ntpsim.c' || echo '$(srcdir)/'`ntpsim.c
+
+ntpdsim-ntpsim.obj: ntpsim.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntpdsim-ntpsim.obj -MD -MP -MF $(DEPDIR)/ntpdsim-ntpsim.Tpo -c -o ntpdsim-ntpsim.obj `if test -f 'ntpsim.c'; then $(CYGPATH_W) 'ntpsim.c'; else $(CYGPATH_W) '$(srcdir)/ntpsim.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntpdsim-ntpsim.Tpo $(DEPDIR)/ntpdsim-ntpsim.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ntpsim.c' object='ntpdsim-ntpsim.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ntpdsim_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntpdsim-ntpsim.obj `if test -f 'ntpsim.c'; then $(CYGPATH_W) 'ntpsim.c'; else $(CYGPATH_W) '$(srcdir)/ntpsim.c'; fi`
+
+.y.c:
+ $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man5: $(man5_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)"
+ @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.5[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man5:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.5[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man5dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f ntp_parser.c
+ -rm -f ntp_parser.h
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+ clean-libexecPROGRAMS clean-libtool clean-noinstLIBRARIES \
+ clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man5 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
+
+.MAKE: all check check-am install install-am install-exec-am \
+ install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+ clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+ clean-libexecPROGRAMS clean-libtool clean-noinstLIBRARIES \
+ clean-sbinPROGRAMS ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-data-local install-dvi install-dvi-am install-exec \
+ install-exec-am install-exec-hook install-html install-html-am \
+ install-htmlDATA install-info install-info-am \
+ install-libexecPROGRAMS install-man install-man1 install-man5 \
+ install-man8 install-pdf install-pdf-am install-ps \
+ install-ps-am install-sbinPROGRAMS install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-htmlDATA uninstall-libexecPROGRAMS uninstall-man \
+ uninstall-man1 uninstall-man5 uninstall-man8 \
+ uninstall-sbinPROGRAMS
+
+
+vphack:
+ test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c .
+ test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h .
+
+#
+# ylwrap script which invokes Bison replaces ntp_parser.h
+# symlink with the updated file, when ntp_parser.h changes.
+# vphack_after detects this and copies the updated file to srcdir
+# and re-creates the ntp_parser.h symlink in its place.
+#
+
+vphack_after:
+ test -L ntp_parser.h || ( \
+ mv ntp_parser.h $(srcdir)/ntp_parser.h && \
+ ln -s $(srcdir)/ntp_parser.h . \
+ )
+
+install-data-local: install-html
+
+check-local: $(MAKE_CHECK_Y2K) $(CHECK_SAVECONFIG)
+ test -z "$(MAKE_CHECK_Y2K)" || ./$(MAKE_CHECK_Y2K)
+
+k-g-u-submake: keyword-gen
+ ./keyword-gen $(srcdir)/ntp_parser.h > k-g.out
+ @grep -v diff_ignore_line < k-g.out > cmp1
+ @grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2
+ @cmp cmp1 cmp2 > /dev/null || \
+ { mv -f k-g.out $(srcdir)/ntp_keyword.h && \
+ echo 'Generated changed ntp_keyword.h.' ;}
+ @[ ! -f k-g.out ] || \
+ { rm k-g.out && echo 'ntp_keyword.h is up to date.' ;}
+ @rm cmp1 cmp2
+ @echo 'keyword-gen and ntp_keyword.h are up to date.' > $@
+
+$(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h
+ $(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency
+ grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u
+ mv -f k-g-u $@
+
+$(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd
+ @: do-nothing action to avoid default SCCS get
+ @: .h updated if needed by k-g-u-submake rule
+
+$(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) ntpd-opts.def
+
+###
+
+$(srcdir)/ntpd.1ntpdman: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def
+
+$(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdman > $(srcdir)/ntpd.man.in+
+ mv $(srcdir)/ntpd.man.in+ $(srcdir)/ntpd.man.in
+
+###
+
+$(srcdir)/ntpd.1ntpdmdoc: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def
+
+$(srcdir)/ntpd.mdoc.in: $(srcdir)/ntpd.1ntpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdmdoc > $(srcdir)/ntpd.mdoc.in+
+ mv $(srcdir)/ntpd.mdoc.in+ $(srcdir)/ntpd.mdoc.in
+
+###
+
+ntpd.$(NTPD_MS): $(srcdir)/ntpd.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpd.$(NTPD_MS)+:$(srcdir)/ntpd.$(MANTAGFMT).in
+ mv ntpd.$(NTPD_MS)+ ntpd.$(NTPD_MS)
+
+###
+
+$(srcdir)/invoke-ntp.conf.menu: $(srcdir)/invoke-ntp.conf.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp.conf.texi: $(srcdir)/ntp.conf.def $(std_def_list)
+ $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def
+
+$(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list)
+ $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def
+
+$(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true )
+
+$(srcdir)/ntp.keys.html: $(srcdir)/ntp.keys.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.keys.html ntp.keys.texi || true )
+
+$(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpd.html ntpd.texi || true )
+
+###
+
+$(srcdir)/ntp.conf.5man: $(srcdir)/ntp.conf.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def
+
+$(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5man > $(srcdir)/ntp.conf.man.in+
+ mv $(srcdir)/ntp.conf.man.in+ $(srcdir)/ntp.conf.man.in
+
+###
+
+$(srcdir)/ntp.conf.5mdoc: $(srcdir)/ntp.conf.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def
+
+$(srcdir)/ntp.conf.mdoc.in: $(srcdir)/ntp.conf.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5mdoc > $(srcdir)/ntp.conf.mdoc.in+
+ mv $(srcdir)/ntp.conf.mdoc.in+ $(srcdir)/ntp.conf.mdoc.in
+
+###
+
+ntp.conf.5: $(srcdir)/ntp.conf.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp.conf.5+:$(srcdir)/ntp.conf.$(MANTAGFMT).in
+ mv ntp.conf.5+ ntp.conf.5
+
+###
+
+$(srcdir)/ntp.keys.5man: $(srcdir)/ntp.keys.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def
+
+$(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5man > $(srcdir)/ntp.keys.man.in+
+ mv $(srcdir)/ntp.keys.man.in+ $(srcdir)/ntp.keys.man.in
+
+###
+
+$(srcdir)/ntp.keys.5mdoc: $(srcdir)/ntp.keys.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def
+
+$(srcdir)/ntp.keys.mdoc.in: $(srcdir)/ntp.keys.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5mdoc > $(srcdir)/ntp.keys.mdoc.in+
+ mv $(srcdir)/ntp.keys.mdoc.in+ $(srcdir)/ntp.keys.mdoc.in
+
+###
+
+ntp.keys.5: $(srcdir)/ntp.keys.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp.keys.5+:$(srcdir)/ntp.keys.$(MANTAGFMT).in
+ mv ntp.keys.5+ ntp.keys.5
+
+###
+
+$(srcdir)/invoke-ntpd.menu: $(srcdir)/invoke-ntpd.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(PROGRAMS): $(LDADD)
+
+compsave.conf: ntpd complete.conf
+ ./ntpd --configfile complete.conf --saveconfigquit $@
+
+check-saveconfig: complete.conf compsave.conf
+ -diff -u complete.conf compsave.conf
+ cmp complete.conf compsave.conf && echo stamp > $@
+
+../libntp/libntpsim.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntpsim.a
+
+../libparse/libparse.a:
+ cd ../libparse && $(MAKE) $(AM_MAKEFLAGS) check-libparse
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libopts: ../sntp/libopts/libopts.la
+ @echo stamp > $@
+
+../sntp/libopts/libopts.la:
+ -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/ntpd/check_y2k.c b/ntpd/check_y2k.c
new file mode 100644
index 0000000..12d1a59
--- /dev/null
+++ b/ntpd/check_y2k.c
@@ -0,0 +1,626 @@
+/* check_y2k.c -- test ntp code constructs for Y2K correctness Y2KFixes [*/
+
+ /*
+ Code invoked by `make check`. Not part of ntpd and not to be
+ installed.
+
+ On any code I even wonder about, I've cut and pasted the code
+ here and ran it as a test case just to be sure.
+
+ For code not in "ntpd" proper, we have tried to call most
+ repaired functions from herein to properly test them
+ (something never done before!). This has found several bugs,
+ not normal Y2K bugs, that will strike in Y2K so repair them
+ we did.
+
+ Program exits with 0 on success, 1 on Y2K failure (stdout messages).
+ Exit of 2 indicates internal logic bug detected OR failure of
+ what should be our correct formulas.
+
+ While "make check" should only check logic for source within that
+ specific directory, this check goes outside the scope of the local
+ directory. It's not a perfect world (besides, there is a lot of
+ interdependence here, and it really needs to be tested in
+ a controled order).
+ */
+
+/* { definitions lifted from ntpd.c to allow us to complie with
+ "#include ntp.h". I have not taken the time to reduce the clutter. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntpd.h"
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#include <stdio.h>
+#include <errno.h>
+#ifndef SYS_WINNT
+# if !defined(VMS) /*wjm*/
+# include <sys/param.h>
+# endif /* VMS */
+# if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+# endif /* HAVE_SYS_SIGNAL_H */
+# include <sys/signal.h>
+# ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+# endif /* HAVE_SYS_IOCTL_H */
+# if !defined(VMS) /*wjm*/
+# include <sys/resource.h>
+# endif /* VMS */
+#else
+# include <signal.h>
+# include <process.h>
+# include <io.h>
+# include "../libntp/log.h"
+#endif /* SYS_WINNT */
+#if defined(HAVE_RTPRIO)
+# ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+# endif
+# ifdef HAVE_SYS_LOCK_H
+# include <sys/lock.h>
+# endif
+# include <sys/rtprio.h>
+#else
+# ifdef HAVE_PLOCK
+# ifdef HAVE_SYS_LOCK_H
+# include <sys/lock.h>
+# endif
+# endif
+#endif
+#if defined(HAVE_SCHED_SETSCHEDULER)
+# ifdef HAVE_SCHED_H
+# include <sched.h>
+# else
+# ifdef HAVE_SYS_SCHED_H
+# include <sys/sched.h>
+# endif
+# endif
+#endif
+#if defined(HAVE_SYS_MMAN_H)
+# include <sys/mman.h>
+#endif
+
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#endif
+
+#ifdef SYS_DOMAINOS
+# include <apollo/base.h>
+#endif /* SYS_DOMAINOS */
+
+/* } end definitions lifted from ntpd.c */
+
+#include "ntp_calendar.h"
+#include "parse.h"
+
+#define GoodLeap(Year) (((Year)%4 || (!((Year)%100) && (Year)%400)) ? 0 : 13 )
+
+char const *progname = "check_y2k";
+
+long
+Days ( int Year ) /* return number of days since year "0" */
+{
+ long Return;
+ /* this is a known to be good algorithm */
+ Return = Year * 365; /* first aproximation to the value */
+ if ( Year >= 1 )
+ { /* see notes in libparse/parse.c if you want a PROPER
+ * **generic algorithm. */
+ Return += (Year+3) / 4; /* add in (too many) leap days */
+ Return -= (Year-1) / 100; /* reduce by (too many) centurys */
+ Return += (Year-1) / 400; /* get final answer */
+ }
+
+ return Return;
+}
+
+static int year0 = 1900; /* sarting year for NTP time */
+static int yearend; /* ending year we test for NTP time.
+ * 32-bit systems: through 2036, the
+ **year in which NTP time overflows.
+ * 64-bit systems: a reasonable upper
+ **limit (well, maybe somewhat beyond
+ **reasonable, but well before the
+ **max time, by which time the earth
+ **will be dead.) */
+static time_t Time;
+static struct tm LocalTime;
+
+#define Error(year) if ( (year)>=2036 && LocalTime.tm_year < 110 ) \
+ Warnings++; else Fatals++
+
+int
+main( void )
+{
+ int Fatals;
+ int Warnings;
+ int year;
+
+ Time = time( (time_t *)NULL )
+#ifdef TESTTIMEOFFSET
+ + test_time_offset
+#endif
+ ;
+ LocalTime = *localtime( &Time );
+
+ year = ( sizeof( u_long ) > 4 ) /* save max span using year as temp */
+ ? ( 400 * 3 ) /* three greater gregorian cycles */
+ : ((int)(0x7FFFFFFF / 365.242 / 24/60/60)* 2 ); /*32-bit limit*/
+ /* NOTE: will automacially expand test years on
+ * 64 bit machines.... this may cause some of the
+ * existing ntp logic to fail for years beyond
+ * 2036 (the current 32-bit limit). If all checks
+ * fail ONLY beyond year 2036 you may ignore such
+ * errors, at least for a decade or so. */
+ yearend = year0 + year;
+
+ puts( " internal self check" );
+ { /* verify our own logic used to verify repairs */
+ unsigned long days;
+
+ if ( year0 >= yearend )
+ {
+ fprintf( stdout, "year0=%d NOT LESS THAN yearend=%d (span=%d)\n",
+ (int)year0, (int)yearend, (int)year );
+ exit(2);
+ }
+
+ {
+ int save_year;
+
+ save_year = LocalTime.tm_year; /* save current year */
+
+ year = 1980;
+ LocalTime.tm_year = year - 1900;
+ Fatals = Warnings = 0;
+ Error(year); /* should increment Fatals */
+ if ( Fatals == 0 )
+ {
+ fprintf( stdout,
+ "%4d: %s(%d): FATAL DID NOT INCREMENT (Fatals=%d Warnings=%d)\n",
+ (int)year, __FILE__, __LINE__, (int)Fatals, (int)Warnings );
+ exit(2);
+ }
+
+ year = 2100; /* test year > limit but CURRENT year < limit */
+ Fatals = Warnings = 0;
+ Error(year); /* should increment Fatals */
+ if ( Warnings == 0 )
+ {
+ fprintf( stdout,
+ "%4d: %s(%d): WARNING DID NOT INCREMENT (Fatals=%d Warnings=%d)\n",
+ (int)year, __FILE__, __LINE__, (int)Fatals, (int)Warnings );
+ exit(2);
+ }
+ Fatals = Warnings = 0;
+ LocalTime.tm_year = year - 1900; /* everything > limit */
+ Error(1980); /* should increment Fatals */
+ if ( Fatals == 0 )
+ {
+ fprintf( stdout,
+ "%4d: %s(%d): FATALS DID NOT INCREMENT (Fatals=%d Warnings=%d)\n",
+ (int)year, __FILE__, __LINE__, (int)Fatals, (int)Warnings );
+ exit(2);
+ }
+
+ LocalTime.tm_year = save_year;
+ }
+
+ days = 365+1; /* days in year 0 + 1 more day */
+ for ( year = 1; year <= 2500; year++ )
+ {
+ long Test;
+ Test = Days( year );
+ if ( days != Test )
+ {
+ fprintf( stdout, "%04d: Days() DAY COUNT ERROR: s/b=%ld was=%ld\n",
+ year, (long)days, (long)Test );
+ exit(2); /* would throw off many other tests */
+ }
+
+ Test = julian0(year); /* compare with julian0() macro */
+ if ( days != Test )
+ {
+ fprintf( stdout, "%04d: julian0() DAY COUNT ERROR: s/b=%ld was=%ld\n",
+ year, (long)days, (long)Test );
+ exit(2); /* would throw off many other tests */
+ }
+
+ days += 365;
+ if ( isleap_4(year) ) days++;
+ }
+
+ if ( isleap_4(1999) )
+ {
+ fprintf( stdout, "isleap_4(1999) REPORTED TRUE\n" );
+ exit(2);
+ }
+ if ( !isleap_4(2000) )
+ {
+ fprintf( stdout, "isleap_4(2000) REPORTED FALSE\n" );
+ exit(2);
+ }
+ if ( isleap_4(2001) )
+ {
+ fprintf( stdout, "isleap_4(1999) REPORTED TRUE\n" );
+ exit(2);
+ }
+
+ if ( !isleap_tm(2000-1900) )
+ {
+ fprintf( stdout, "isleap_tm(100) REPORTED FALSE\n" );
+ exit(2);
+ }
+ }
+
+ Fatals = Warnings = 0;
+
+ puts( " include/ntp.h" );
+ { /* test our new isleap_*() #define "functions" */
+
+ for ( year = 1400; year <= 2200; year++ )
+ {
+ int LeapSw;
+ int IsLeapSw;
+
+ LeapSw = GoodLeap(year);
+ IsLeapSw = isleap_4(year);
+
+ if ( !!LeapSw != !!IsLeapSw )
+ {
+ Error(year);
+ fprintf( stdout,
+ " %4d %2d %3d *** ERROR\n", year, LeapSw, IsLeapSw );
+ break;
+ }
+
+ IsLeapSw = isleap_tm(year-1900);
+
+ if ( !!LeapSw != !!IsLeapSw )
+ {
+ Error(year);
+ fprintf( stdout,
+ " %4d %2d %3d *** ERROR\n", year, LeapSw, IsLeapSw );
+ break;
+ }
+ }
+ }
+
+ puts( " include/ntp_calendar.h" );
+ { /* I belive this is good, but just to be sure... */
+
+ /* we are testing this #define */
+#define is_leapyear(y) (y%4 == 0 && !(y%100 == 0 && !(y%400 == 0)))
+
+ for ( year = 1400; year <= 2200; year++ )
+ {
+ int LeapSw;
+
+ LeapSw = GoodLeap(year);
+
+ if ( !(!LeapSw) != !(!is_leapyear(year)) )
+ {
+ Error(year);
+ fprintf( stdout,
+ " %4d %2d *** ERROR\n", year, LeapSw );
+ break;
+ }
+ }
+ }
+
+
+ puts( " libparse/parse.c" );
+ {
+ long Days1970; /* days from 1900 to 1970 */
+
+ struct ParseTime /* womp up a test structure to all cut/paste code */
+ {
+ int year;
+ } Clock_Time, *clock_time;
+
+ clock_time = &Clock_Time;
+
+ /* first test this #define */
+#define days_per_year(x) ((x) % 4 ? 365 : ((x % 400) ? ((x % 100) ? 366 : 365) : 366))
+
+ for ( year = 1400; year <= 2200; year++ )
+ {
+ int LeapSw;
+ int DayCnt;
+
+ LeapSw = GoodLeap(year);
+ DayCnt = (int)days_per_year(year);
+
+ if ( ( LeapSw ? 366 : 365 ) != DayCnt )
+ {
+ Error(year);
+ fprintf( stdout,
+ " days_per_year() %4d %2d %3d *** ERROR\n",
+ year, LeapSw, DayCnt );
+ break;
+ }
+ }
+
+ /* test (what is now julian0) calculations */
+
+ Days1970 = Days( 1970 ); /* get days since 1970 using a known good */
+
+ for ( year = 1970; year < yearend; year++ )
+ {
+ unsigned long t;
+ long DaysYear ;
+
+ clock_time->year = year;
+
+ /* here is the code we are testing, cut and pasted out of the source */
+#if 0 /* old BUGGY code that has Y2K (and many other) failures */
+ /* ghealton: this logic FAILED with great frequency when run
+ * over a period of time, including for year 2000. True, it
+ * had more successes than failures, but that's not really good
+ * enough for critical time distribution software.
+ * It is so awful I wonder if it has had a history of failure
+ * and fixes? */
+ t = (clock_time->year - 1970) * 365;
+ t += (clock_time->year >> 2) - (1970 >> 2);
+ t -= clock_time->year / 100 - 1970 / 100;
+ t += clock_time->year / 400 - 1970 / 400;
+
+ /* (immediate feare of rounding errors on integer
+ * **divisions proved well founded) */
+
+#else
+ /* my replacement, based on Days() above */
+ t = julian0(year) - julian0(1970);
+#endif
+
+ /* compare result in t against trusted calculations */
+ DaysYear = Days( year ); /* get days to this year */
+ if ( t != DaysYear - Days1970 )
+ {
+ Error(year);
+ fprintf( stdout,
+ " %4d 1970=%-8ld %4d=%-8ld %-3ld t=%-8ld *** ERROR ***\n",
+ year, (long)Days1970,
+ year,
+ (long)DaysYear,
+ (long)(DaysYear - Days1970),
+ (long)t );
+ }
+ }
+
+#if 1 /* { */
+ {
+ debug = 1; /* enable debugging */
+ for ( year = 1970; year < yearend; year++ )
+ { /* (limited by theory unix 2038 related bug lives by, but
+ * ends in yearend) */
+ clocktime_t ct;
+ time_t Observed;
+ time_t Expected;
+ u_long Flag;
+ unsigned long t;
+
+ ct.day = 1;
+ ct.month = 1;
+ ct.year = year;
+ ct.hour = ct.minute = ct.second = ct.usecond = 0;
+ ct.utcoffset = 0;
+ ct.utctime = 0;
+ ct.flags = 0;
+
+ Flag = 0;
+ Observed = parse_to_unixtime( &ct, &Flag );
+ if ( ct.year != year )
+ {
+ fprintf( stdout,
+ "%04d: parse_to_unixtime(,%d) CORRUPTED ct.year: was %d\n",
+ (int)year, (int)Flag, (int)ct.year );
+ Error(year);
+ break;
+ }
+ t = julian0(year) - julian0(1970); /* Julian day from 1970 */
+ Expected = t * 24 * 60 * 60;
+ if ( Observed != Expected || Flag )
+ { /* time difference */
+ fprintf( stdout,
+ "%04d: parse_to_unixtime(,%d) FAILURE: was=%lu s/b=%lu (%ld)\n",
+ year, (int)Flag,
+ (unsigned long)Observed, (unsigned long)Expected,
+ ((long)Observed - (long)Expected) );
+ Error(year);
+ break;
+ }
+
+ if ( year >= YEAR_PIVOT+1900 )
+ {
+ /* check year % 100 code we put into parse_to_unixtime() */
+ ct.utctime = 0;
+ ct.year = year % 100;
+ Flag = 0;
+
+ Observed = parse_to_unixtime( &ct, &Flag );
+
+ if ( Observed != Expected || Flag )
+ { /* time difference */
+ fprintf( stdout,
+"%04d: parse_to_unixtime(%d,%d) FAILURE: was=%lu s/b=%lu (%ld)\n",
+ year, (int)ct.year, (int)Flag,
+ (unsigned long)Observed, (unsigned long)Expected,
+ ((long)Observed - (long)Expected) );
+ Error(year);
+ break;
+ }
+
+ /* check year - 1900 code we put into parse_to_unixtime() */
+ ct.utctime = 0;
+ ct.year = year - 1900;
+ Flag = 0;
+
+ Observed = parse_to_unixtime( &ct, &Flag );
+
+ if ( Observed != Expected || Flag )
+ { /* time difference */
+ fprintf( stdout,
+"%04d: parse_to_unixtime(%d,%d) FAILURE: was=%lu s/b=%lu (%ld)\n",
+ year, (int)ct.year, (int)Flag,
+ (unsigned long)Observed, (unsigned long)Expected,
+ ((long)Observed - (long)Expected) );
+ Error(year);
+ break;
+ }
+
+
+ }
+ }
+#endif /* } */
+ }
+ }
+
+ puts( " libntp/caljulian.c" );
+ { /* test caljulian() */
+ struct calendar ot;
+ u_long ntp_time; /* NTP time */
+
+ year = year0; /* calculate the basic year */
+ printf( " starting year %04d\n", (int)year0 );
+ printf( " ending year %04d\n", (int)yearend );
+
+
+ ntp_time = julian0( year0 ); /* NTP starts in 1900-01-01 */
+#if DAY_NTP_STARTS == 693596
+ ntp_time -= 365; /* BIAS required for successful test */
+#endif
+ if ( DAY_NTP_STARTS != ntp_time )
+ {
+ Error(year);
+ fprintf( stdout,
+ "%04d: DAY_NTP_STARTS (%ld) NOT TRUE VALUE OF %ld (%ld)\n",
+ (int)year0,
+ (long)DAY_NTP_STARTS, (long)ntp_time,
+ (long)DAY_NTP_STARTS - (long)ntp_time );
+ }
+
+ for ( ; year < yearend; year++ )
+ {
+
+ /* 01-01 for the current year */
+ ntp_time = Days( year ) - Days( year0 ); /* days into NTP time */
+ ntp_time *= 24 * 60 * 60; /* convert into seconds */
+ caljulian( ntp_time, &ot ); /* convert January 1 */
+ if ( ot.year != year
+ || ot.month != 1
+ || ot.monthday != 1 )
+ {
+ Error(year);
+ fprintf( stdout, "%lu: EXPECTED %04d-01-01: FOUND %04d-%02d-%02d\n",
+ (unsigned long)ntp_time,
+ year,
+ (int)ot.year, (int)ot.month, (int)ot.monthday );
+ break;
+ }
+
+ ntp_time += (31 + 28-1) * ( 24 * 60 * 60 ); /* advance to 02-28 */
+ caljulian( ntp_time, &ot ); /* convert Feb 28 */
+ if ( ot.year != year
+ || ot.month != 2
+ || ot.monthday != 28 )
+ {
+ Error(year);
+ fprintf( stdout, "%lu: EXPECTED %04d-02-28: FOUND %04d-%02d-%02d\n",
+ (unsigned long)ntp_time,
+ year,
+ (int)ot.year, (int)ot.month, (int)ot.monthday );
+ break;
+ }
+
+ {
+ int m; /* expected month */
+ int d; /* expected day */
+
+ m = isleap_4(year) ? 2 : 3;
+ d = isleap_4(year) ? 29 : 1;
+
+ ntp_time += ( 24 * 60 * 60 ); /* advance to the next day */
+ caljulian( ntp_time, &ot ); /* convert this day */
+ if ( ot.year != year
+ || ot.month != m
+ || ot.monthday != d )
+ {
+ Error(year);
+ fprintf( stdout, "%lu: EXPECTED %04d-%02d-%02d: FOUND %04d-%02d-%02d\n",
+ (unsigned long)ntp_time,
+ year, m, d,
+ (int)ot.year, (int)ot.month, (int)ot.monthday );
+ break;
+ }
+
+ }
+ }
+ }
+
+ puts( " libntp/caltontp.c" );
+ { /* test caltontp() */
+ struct calendar ot;
+ u_long ntp_time; /* NTP time */
+
+ year = year0; /* calculate the basic year */
+ printf( " starting year %04d\n", (int)year0 );
+ printf( " ending year %04d\n", (int)yearend );
+
+
+ for ( ; year < yearend; year++ )
+ {
+ u_long ObservedNtp;
+
+ /* 01-01 for the current year */
+ ot.year = year;
+ ot.month = ot.monthday = 1; /* unused, but set anyway JIC */
+ ot.yearday = 1; /* this is the magic value used by caltontp() */
+ ot.hour = ot.minute = ot.second = 0;
+
+ ntp_time = Days( year ) - Days( year0 ); /* days into NTP time */
+ ntp_time *= 24 * 60 * 60; /* convert into seconds */
+ ObservedNtp = caltontp( &ot );
+ if ( ntp_time != ObservedNtp )
+ {
+ Error(year);
+ fprintf( stdout, "%d: EXPECTED %lu: FOUND %lu (%ld)\n",
+ (int)year,
+ (unsigned long)ntp_time, (unsigned long)ObservedNtp ,
+ (long)ntp_time - (long)ObservedNtp );
+
+ break;
+ }
+
+ /* now call caljulian as a type of failsafe supercheck */
+ caljulian( ObservedNtp, &ot ); /* convert January 1 */
+ if ( ot.year != year
+ || ot.month != 1
+ || ot.monthday != 1 )
+ {
+ Error(year);
+ fprintf( stdout, "%lu: caljulian FAILSAFE EXPECTED %04d-01-01: FOUND %04d-%02d-%02d\n",
+ (unsigned long)ObservedNtp,
+ year,
+ (int)ot.year, (int)ot.month, (int)ot.monthday );
+ break;
+ }
+ }
+ }
+
+ if ( Warnings > 0 )
+ fprintf( stdout, "%d WARNINGS\n", Warnings );
+ if ( Fatals > 0 )
+ fprintf( stdout, "%d FATAL ERRORS\n", Fatals );
+ return Fatals ? 1 : 0;
+}
+ /* Y2KFixes ] */
diff --git a/ntpd/cmd_args.c b/ntpd/cmd_args.c
new file mode 100644
index 0000000..045c0a9
--- /dev/null
+++ b/ntpd/cmd_args.c
@@ -0,0 +1,202 @@
+/*
+ * cmd_args.c = command-line argument processing
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_stdlib.h"
+#include "ntp_config.h"
+#include "ntp_cmdargs.h"
+
+#include "ntpd-opts.h"
+
+/*
+ * Definitions of things either imported from or exported to outside
+ */
+extern char const *progname;
+
+#ifdef HAVE_NETINFO
+extern int check_netinfo;
+#endif
+
+
+/*
+ * getCmdOpts - apply most command line options
+ *
+ * A few options are examined earlier in ntpd.c ntpdmain() and
+ * ports/winnt/ntpd/ntservice.c main().
+ */
+void
+getCmdOpts(
+ int argc,
+ char ** argv
+ )
+{
+ extern const char *config_file;
+ int errflg;
+
+ /*
+ * Initialize, initialize
+ */
+ errflg = 0;
+
+ if (ipv4_works && ipv6_works) {
+ if (HAVE_OPT( IPV4 ))
+ ipv6_works = 0;
+ else if (HAVE_OPT( IPV6 ))
+ ipv4_works = 0;
+ } else if (!ipv4_works && !ipv6_works) {
+ msyslog(LOG_ERR, "Neither IPv4 nor IPv6 networking detected, fatal.");
+ exit(1);
+ } else if (HAVE_OPT( IPV4 ) && !ipv4_works)
+ msyslog(LOG_WARNING, "-4/--ipv4 ignored, IPv4 networking not found.");
+ else if (HAVE_OPT( IPV6 ) && !ipv6_works)
+ msyslog(LOG_WARNING, "-6/--ipv6 ignored, IPv6 networking not found.");
+
+ if (HAVE_OPT( AUTHREQ ))
+ proto_config(PROTO_AUTHENTICATE, 1, 0., NULL);
+ else if (HAVE_OPT( AUTHNOREQ ))
+ proto_config(PROTO_AUTHENTICATE, 0, 0., NULL);
+
+ if (HAVE_OPT( BCASTSYNC ))
+ proto_config(PROTO_BROADCLIENT, 1, 0., NULL);
+
+ if (HAVE_OPT( CONFIGFILE )) {
+ config_file = OPT_ARG( CONFIGFILE );
+#ifdef HAVE_NETINFO
+ check_netinfo = 0;
+#endif
+ }
+
+ if (HAVE_OPT( DRIFTFILE ))
+ stats_config(STATS_FREQ_FILE, OPT_ARG( DRIFTFILE ));
+
+ if (HAVE_OPT( PANICGATE ))
+ allow_panic = TRUE;
+
+#ifdef HAVE_DROPROOT
+ if (HAVE_OPT( JAILDIR )) {
+ droproot = 1;
+ chrootdir = OPT_ARG( JAILDIR );
+ }
+#endif
+
+ if (HAVE_OPT( KEYFILE ))
+ getauthkeys(OPT_ARG( KEYFILE ));
+
+ if (HAVE_OPT( PIDFILE ))
+ stats_config(STATS_PID_FILE, OPT_ARG( PIDFILE ));
+
+ if (HAVE_OPT( QUIT ))
+ mode_ntpdate = TRUE;
+
+ if (HAVE_OPT( PROPAGATIONDELAY ))
+ do {
+ double tmp;
+ const char *my_ntp_optarg = OPT_ARG( PROPAGATIONDELAY );
+
+ if (sscanf(my_ntp_optarg, "%lf", &tmp) != 1) {
+ msyslog(LOG_ERR,
+ "command line broadcast delay value %s undecodable",
+ my_ntp_optarg);
+ } else {
+ proto_config(PROTO_BROADDELAY, 0, tmp, NULL);
+ }
+ } while (0);
+
+ if (HAVE_OPT( STATSDIR ))
+ stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ));
+
+ if (HAVE_OPT( TRUSTEDKEY )) {
+ int ct = STACKCT_OPT( TRUSTEDKEY );
+ const char** pp = STACKLST_OPT( TRUSTEDKEY );
+
+ do {
+ u_long tkey;
+ const char* p = *pp++;
+
+ tkey = (int)atol(p);
+ if (tkey == 0 || tkey > NTP_MAXKEY) {
+ msyslog(LOG_ERR,
+ "command line trusted key %s is invalid",
+ p);
+ } else {
+ authtrust(tkey, 1);
+ }
+ } while (--ct > 0);
+ }
+
+#ifdef HAVE_DROPROOT
+ if (HAVE_OPT( USER )) {
+ droproot = 1;
+ user = estrdup(OPT_ARG( USER ));
+ group = strrchr(user, ':');
+ if (group != NULL) {
+ size_t len;
+
+ *group++ = '\0'; /* get rid of the ':' */
+ len = group - user;
+ group = estrdup(group);
+ user = erealloc(user, len);
+ }
+ }
+#endif
+
+ if (HAVE_OPT( VAR )) {
+ int ct;
+ const char ** pp;
+ const char * v_assign;
+
+ ct = STACKCT_OPT( VAR );
+ pp = STACKLST_OPT( VAR );
+
+ do {
+ v_assign = *pp++;
+ set_sys_var(v_assign, strlen(v_assign) + 1, RW);
+ } while (--ct > 0);
+ }
+
+ if (HAVE_OPT( DVAR )) {
+ int ct = STACKCT_OPT( DVAR );
+ const char** pp = STACKLST_OPT( DVAR );
+
+ do {
+ const char* my_ntp_optarg = *pp++;
+
+ set_sys_var(my_ntp_optarg, strlen(my_ntp_optarg)+1,
+ (u_short) (RW | DEF));
+ } while (--ct > 0);
+ }
+
+ if (HAVE_OPT( SLEW ))
+ loop_config(LOOP_MAX, 600);
+
+ if (HAVE_OPT( UPDATEINTERVAL )) {
+ long val = OPT_VALUE_UPDATEINTERVAL;
+
+ if (val >= 0)
+ interface_interval = val;
+ else {
+ fprintf(stderr,
+ "command line interface update interval %ld must not be negative\n",
+ val);
+ msyslog(LOG_ERR,
+ "command line interface update interval %ld must not be negative",
+ val);
+ errflg++;
+ }
+ }
+
+
+ /* save list of servers from cmd line for config_peers() use */
+ if (argc > 0) {
+ cmdline_server_count = argc;
+ cmdline_servers = argv;
+ }
+
+ /* display usage & exit with any option processing errors */
+ if (errflg)
+ optionUsage(&ntpdOptions, 2); /* does not return */
+}
diff --git a/ntpd/complete.conf.in b/ntpd/complete.conf.in
new file mode 100644
index 0000000..a820094
--- /dev/null
+++ b/ntpd/complete.conf.in
@@ -0,0 +1,67 @@
+saveconfigdir "/etc/ntp/conf"
+driftfile "/etc/ntp.drift" 1e-7
+logfile "/var/log/ntp.log"
+leapfile "/etc/ntp.leapseconds"
+nonvolatile 1e-7
+ident "udent"
+logconfig =allall -allinfo -allevents -allstatistics -allstatus +allall -clockinfo -clockevents -clockstatistics -clockstatus +clockall -syncinfo -syncevents -syncstatistics -syncstatus +syncall -sysinfo -sysevents -sysstatistics -sysstatus +sysall
+statsdir "/etc/ntp/stats"
+statistics clockstats cryptostats loopstats peerstats protostats rawstats sysstats timingstats
+filegen clockstats file clockstats type none enable
+filegen cryptostats file cryptostats type pid link disable
+filegen loopstats file loopstats type day nolink enable
+filegen peerstats file peerstats type week enable
+filegen protostats file stats type month enable
+filegen rawstats file rawstats type year nolink enable
+filegen sysstats file sysstats type age enable
+filegen timingstats file timingstats type none disable
+crypto digest md5 host myhostname ident wedent pw cryptopass randfile /.rnd
+revoke 10
+keysdir "/etc/ntp/keys"
+keys "/etc/ntp.keys"
+trustedkey 1 2 3 4 5 6 7 8 9 10 11 12 (14 ... 16) 18 (32768 ... 65534)
+controlkey 12
+requestkey 12
+enable auth ntp monitor stats
+disable bclient calibrate kernel mode7
+tos beacon 3600 ceiling 16 cohort 0 floor 1 maxclock 10 maxdist 1.5 minclock 3 mindist 0.001 minsane 1 orphan 16 orphanwait 300
+rlimit@HAVE_RLIMIT_MEMLOCK@@HAVE_RLIMIT_STACK@
+tinker allan 1500 dispersion 15 freq 0 huffpuff 7200 panic 1000 step 0.128 stepout 900 tick 0.01
+broadcastclient
+server 127.127.1.0 mode 4294967295 prefer true
+fudge 127.127.1.0 time1 0 time2 1.1 stratum 7 refid Abcd
+pool 0.north-america.pool.ntp.org. iburst preempt
+server 1.north-america.pool.ntp.org. iburst
+server -4 2.north-america.pool.ntp.org. minpoll 6 maxpoll 10 iburst
+server -6 ntp.davehart.net. minpoll 6 maxpoll 10 version 5 burst iburst
+peer -6 davehart.broker.freenet6.net. ident "autokey-group" xleave autokey
+peer -4 192.168.192.168 key 1 noselect
+server [fe80::123%1]
+broadcast 192.168.192.255
+manycastclient 224.0.1.1
+manycastclient ff05::101
+manycastserver 224.0.1.1 ff05::101
+multicastclient 224.0.1.1 ff05::101
+mru maxage 64 mindepth 600 initalloc 600 initmem 16 incalloc 99 incmem 4 maxdepth 1024 maxmem 4096
+discard minimum 1 average 3 monitor 3000
+restrict default
+restrict default nomodify limited kod noserve nomrulist
+restrict source
+restrict source nomodify limited kod
+restrict trusted.host.name.example.com. nomodify
+restrict [fe80::1] mask [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]
+restrict 127.0.0.1 mask 255.255.255.255
+restrict ::1
+interface drop ipv6
+interface ignore ipv4
+interface drop wildcard
+interface listen eth0
+interface listen ipv6
+interface listen 192.168.192.0/24
+interface listen 192.168.193.1
+phone "ATDT13034944774" "ATDT12027621594"
+setvar varnondef = "this variable does not have default after the value"
+setvar vanity = "name plate" default
+trap 127.0.0.1 interface 127.0.0.1 port 1234
+trap 127.0.0.2
+reset allpeers auth ctl io mem sys timer
diff --git a/ntpd/declcond.h b/ntpd/declcond.h
new file mode 100644
index 0000000..870e5a7
--- /dev/null
+++ b/ntpd/declcond.h
@@ -0,0 +1,21 @@
+/*
+ * declcond.h - declarations conditionalized for ntpd
+ *
+ * The NTP reference implementation distribution includes two distinct
+ * declcond.h files, one in ntpd/ used only by ntpd, and another in
+ * include/ used by libntp and utilities. This relies on the source
+ * file's directory being ahead of include/ in the include search.
+ *
+ * The ntpd variant of declcond.h declares "debug" only #ifdef DEBUG,
+ * as the --disable-debugging version of ntpd should not reference
+ * "debug". The libntp and utilities variant always declares debug,
+ * as it is used in those codebases even without DEBUG defined.
+ */
+#ifndef DECLCOND_H
+#define DECLCOND_H
+
+#ifdef DEBUG /* uncommented in ntpd/declcond.h */
+extern int debug;
+#endif /* uncommented in ntpd/declcond.h */
+
+#endif /* DECLCOND_H */
diff --git a/ntpd/invoke-ntp.conf.menu b/ntpd/invoke-ntp.conf.menu
new file mode 100644
index 0000000..e5c6ef3
--- /dev/null
+++ b/ntpd/invoke-ntp.conf.menu
@@ -0,0 +1 @@
+* ntp.conf Notes:: Notes about ntp.conf
diff --git a/ntpd/invoke-ntp.conf.texi b/ntpd/invoke-ntp.conf.texi
new file mode 100644
index 0000000..78d3baf
--- /dev/null
+++ b/ntpd/invoke-ntp.conf.texi
@@ -0,0 +1,2634 @@
+@node ntp.conf Notes
+@section Notes about ntp.conf
+@pindex ntp.conf
+@cindex Network Time Protocol (NTP) daemon configuration file format
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:56:50 AM by AutoGen 5.18.5pre4
+# From the definitions ntp.conf.def
+# and the template file agtexi-file.tpl
+@end ignore
+
+
+
+The
+@code{ntp.conf}
+configuration file is read at initial startup by the
+@code{ntpd(1ntpdmdoc)}
+daemon in order to specify the synchronization sources,
+modes and other related information.
+Usually, it is installed in the
+@file{/etc}
+directory,
+but could be installed elsewhere
+(see the daemon's
+@code{-c}
+command line option).
+
+The file format is similar to other
+@sc{unix}
+configuration files.
+Comments begin with a
+@quoteleft{}#@quoteright{}
+character and extend to the end of the line;
+blank lines are ignored.
+Configuration commands consist of an initial keyword
+followed by a list of arguments,
+some of which may be optional, separated by whitespace.
+Commands may not be continued over multiple lines.
+Arguments may be host names,
+host addresses written in numeric, dotted-quad form,
+integers, floating point numbers (when specifying times in seconds)
+and text strings.
+
+The rest of this page describes the configuration and control options.
+The
+"Notes on Configuring NTP and Setting up an NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp})
+contains an extended discussion of these options.
+In addition to the discussion of general
+@ref{Configuration Options},
+there are sections describing the following supported functionality
+and the options used to control it:
+@itemize @bullet
+@item
+@ref{Authentication Support}
+@item
+@ref{Monitoring Support}
+@item
+@ref{Access Control Support}
+@item
+@ref{Automatic NTP Configuration Options}
+@item
+@ref{Reference Clock Support}
+@item
+@ref{Miscellaneous Options}
+@end itemize
+
+Following these is a section describing
+@ref{Miscellaneous Options}.
+While there is a rich set of options available,
+the only required option is one or more
+@code{pool},
+@code{server},
+@code{peer},
+@code{broadcast}
+or
+@code{manycastclient}
+commands.
+@node Configuration Support
+@subsection Configuration Support
+Following is a description of the configuration commands in
+NTPv4.
+These commands have the same basic functions as in NTPv3 and
+in some cases new functions and new arguments.
+There are two
+classes of commands, configuration commands that configure a
+persistent association with a remote server or peer or reference
+clock, and auxiliary commands that specify environmental variables
+that control various related operations.
+@subsubsection Configuration Commands
+The various modes are determined by the command keyword and the
+type of the required IP address.
+Addresses are classed by type as
+(s) a remote server or peer (IPv4 class A, B and C), (b) the
+broadcast address of a local interface, (m) a multicast address (IPv4
+class D), or (r) a reference clock address (127.127.x.x).
+Note that
+only those options applicable to each command are listed below.
+Use
+of options not listed may not be caught as an error, but may result
+in some weird and even destructive behavior.
+
+If the Basic Socket Interface Extensions for IPv6 (RFC-2553)
+is detected, support for the IPv6 address family is generated
+in addition to the default support of the IPv4 address family.
+In a few cases, including the reslist billboard generated
+by ntpdc, IPv6 addresses are automatically generated.
+IPv6 addresses can be identified by the presence of colons
+@quotedblleft{}:@quotedblright{}
+in the address field.
+IPv6 addresses can be used almost everywhere where
+IPv4 addresses can be used,
+with the exception of reference clock addresses,
+which are always IPv4.
+
+Note that in contexts where a host name is expected, a
+@code{-4}
+qualifier preceding
+the host name forces DNS resolution to the IPv4 namespace,
+while a
+@code{-6}
+qualifier forces DNS resolution to the IPv6 namespace.
+See IPv6 references for the
+equivalent classes for that address family.
+@table @asis
+@item @code{pool} @kbd{address} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]}
+@item @code{server} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{burst}]} @code{[@code{iburst}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]}
+@item @code{peer} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]}
+@item @code{broadcast} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{ttl} @kbd{ttl}]}
+@item @code{manycastclient} @kbd{address} @code{[@code{key} @kbd{key} @kbd{|} @code{autokey}]} @code{[@code{version} @kbd{version}]} @code{[@code{prefer}]} @code{[@code{minpoll} @kbd{minpoll}]} @code{[@code{maxpoll} @kbd{maxpoll}]} @code{[@code{ttl} @kbd{ttl}]}
+@end table
+
+These five commands specify the time server name or address to
+be used and the mode in which to operate.
+The
+@kbd{address}
+can be
+either a DNS name or an IP address in dotted-quad notation.
+Additional information on association behavior can be found in the
+"Association Management"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+@table @asis
+@item @code{pool}
+For type s addresses, this command mobilizes a persistent
+client mode association with a number of remote servers.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+@item @code{server}
+For type s and r addresses, this command mobilizes a persistent
+client mode association with the specified remote server or local
+radio clock.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+This command should
+@emph{not}
+be used for type
+b or m addresses.
+@item @code{peer}
+For type s addresses (only), this command mobilizes a
+persistent symmetric-active mode association with the specified
+remote peer.
+In this mode the local clock can be synchronized to
+the remote peer or the remote peer can be synchronized to the local
+clock.
+This is useful in a network of servers where, depending on
+various failure scenarios, either the local or remote peer may be
+the better source of time.
+This command should NOT be used for type
+b, m or r addresses.
+@item @code{broadcast}
+For type b and m addresses (only), this
+command mobilizes a persistent broadcast mode association.
+Multiple
+commands can be used to specify multiple local broadcast interfaces
+(subnets) and/or multiple multicast groups.
+Note that local
+broadcast messages go only to the interface associated with the
+subnet specified, but multicast messages go to all interfaces.
+In broadcast mode the local server sends periodic broadcast
+messages to a client population at the
+@kbd{address}
+specified, which is usually the broadcast address on (one of) the
+local network(s) or a multicast address assigned to NTP.
+The IANA
+has assigned the multicast group address IPv4 224.0.1.1 and
+IPv6 ff05::101 (site local) exclusively to
+NTP, but other nonconflicting addresses can be used to contain the
+messages within administrative boundaries.
+Ordinarily, this
+specification applies only to the local server operating as a
+sender; for operation as a broadcast client, see the
+@code{broadcastclient}
+or
+@code{multicastclient}
+commands
+below.
+@item @code{manycastclient}
+For type m addresses (only), this command mobilizes a
+manycast client mode association for the multicast address
+specified.
+In this case a specific address must be supplied which
+matches the address used on the
+@code{manycastserver}
+command for
+the designated manycast servers.
+The NTP multicast address
+224.0.1.1 assigned by the IANA should NOT be used, unless specific
+means are taken to avoid spraying large areas of the Internet with
+these messages and causing a possibly massive implosion of replies
+at the sender.
+The
+@code{manycastserver}
+command specifies that the local server
+is to operate in client mode with the remote servers that are
+discovered as the result of broadcast/multicast messages.
+The
+client broadcasts a request message to the group address associated
+with the specified
+@kbd{address}
+and specifically enabled
+servers respond to these messages.
+The client selects the servers
+providing the best time and continues as with the
+@code{server}
+command.
+The remaining servers are discarded as if never
+heard.
+@end table
+
+Options:
+@table @asis
+@item @code{autokey}
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the autokey scheme
+described in
+@ref{Authentication Options}.
+@item @code{burst}
+when the server is reachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first and second packets
+can be changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to improve timekeeping quality
+with the
+@code{server}
+command and s addresses.
+@item @code{iburst}
+When the server is unreachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first two packets can be
+changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to speed the initial synchronization
+acquisition with the
+@code{server}
+command and s addresses and when
+@code{ntpd(1ntpdmdoc)}
+is started with the
+@code{-q}
+option.
+@item @code{key} @kbd{key}
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the specified
+@kbd{key}
+identifier with values from 1 to 65534, inclusive.
+The
+default is to include no encryption field.
+@item @code{minpoll} @kbd{minpoll}
+@item @code{maxpoll} @kbd{maxpoll}
+These options specify the minimum and maximum poll intervals
+for NTP messages, as a power of 2 in seconds
+The maximum poll
+interval defaults to 10 (1,024 s), but can be increased by the
+@code{maxpoll}
+option to an upper limit of 17 (36.4 h).
+The
+minimum poll interval defaults to 6 (64 s), but can be decreased by
+the
+@code{minpoll}
+option to a lower limit of 4 (16 s).
+@item @code{noselect}
+Marks the server as unused, except for display purposes.
+The server is discarded by the selection algroithm.
+@item @code{prefer}
+Marks the server as preferred.
+All other things being equal,
+this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp})
+for further information.
+@item @code{ttl} @kbd{ttl}
+This option is used only with broadcast server and manycast
+client modes.
+It specifies the time-to-live
+@kbd{ttl}
+to
+use on broadcast server and multicast server and the maximum
+@kbd{ttl}
+for the expanding ring search with manycast
+client packets.
+Selection of the proper value, which defaults to
+127, is something of a black art and should be coordinated with the
+network administrator.
+@item @code{version} @kbd{version}
+Specifies the version number to be used for outgoing NTP
+packets.
+Versions 1-4 are the choices, with version 4 the
+default.
+@end table
+@subsubsection Auxiliary Commands
+@table @asis
+@item @code{broadcastclient}
+This command enables reception of broadcast server messages to
+any local interface (type b) address.
+Upon receiving a message for
+the first time, the broadcast client measures the nominal server
+propagation delay using a brief client/server exchange with the
+server, then enters the broadcast client mode, in which it
+synchronizes to succeeding broadcast messages.
+Note that, in order
+to avoid accidental or malicious disruption in this mode, both the
+server and client should operate using symmetric-key or public-key
+authentication as described in
+@ref{Authentication Options}.
+@item @code{manycastserver} @kbd{address} @kbd{...}
+This command enables reception of manycast client messages to
+the multicast group address(es) (type m) specified.
+At least one
+address is required, but the NTP multicast address 224.0.1.1
+assigned by the IANA should NOT be used, unless specific means are
+taken to limit the span of the reply and avoid a possibly massive
+implosion at the original sender.
+Note that, in order to avoid
+accidental or malicious disruption in this mode, both the server
+and client should operate using symmetric-key or public-key
+authentication as described in
+@ref{Authentication Options}.
+@item @code{multicastclient} @kbd{address} @kbd{...}
+This command enables reception of multicast server messages to
+the multicast group address(es) (type m) specified.
+Upon receiving
+a message for the first time, the multicast client measures the
+nominal server propagation delay using a brief client/server
+exchange with the server, then enters the broadcast client mode, in
+which it synchronizes to succeeding multicast messages.
+Note that,
+in order to avoid accidental or malicious disruption in this mode,
+both the server and client should operate using symmetric-key or
+public-key authentication as described in
+@ref{Authentication Options}.
+@end table
+@node Authentication Support
+@subsection Authentication Support
+Authentication support allows the NTP client to verify that the
+server is in fact known and trusted and not an intruder intending
+accidentally or on purpose to masquerade as that server.
+The NTPv3
+specification RFC-1305 defines a scheme which provides
+cryptographic authentication of received NTP packets.
+Originally,
+this was done using the Data Encryption Standard (DES) algorithm
+operating in Cipher Block Chaining (CBC) mode, commonly called
+DES-CBC.
+Subsequently, this was replaced by the RSA Message Digest
+5 (MD5) algorithm using a private key, commonly called keyed-MD5.
+Either algorithm computes a message digest, or one-way hash, which
+can be used to verify the server has the correct private key and
+key identifier.
+
+NTPv4 retains the NTPv3 scheme, properly described as symmetric key
+cryptography and, in addition, provides a new Autokey scheme
+based on public key cryptography.
+Public key cryptography is generally considered more secure
+than symmetric key cryptography, since the security is based
+on a private value which is generated by each server and
+never revealed.
+With Autokey all key distribution and
+management functions involve only public values, which
+considerably simplifies key distribution and storage.
+Public key management is based on X.509 certificates,
+which can be provided by commercial services or
+produced by utility programs in the OpenSSL software library
+or the NTPv4 distribution.
+
+While the algorithms for symmetric key cryptography are
+included in the NTPv4 distribution, public key cryptography
+requires the OpenSSL software library to be installed
+before building the NTP distribution.
+Directions for doing that
+are on the Building and Installing the Distribution page.
+
+Authentication is configured separately for each association
+using the
+@code{key}
+or
+@code{autokey}
+subcommand on the
+@code{peer},
+@code{server},
+@code{broadcast}
+and
+@code{manycastclient}
+configuration commands as described in
+@ref{Configuration Options}
+page.
+The authentication
+options described below specify the locations of the key files,
+if other than default, which symmetric keys are trusted
+and the interval between various operations, if other than default.
+
+Authentication is always enabled,
+although ineffective if not configured as
+described below.
+If a NTP packet arrives
+including a message authentication
+code (MAC), it is accepted only if it
+passes all cryptographic checks.
+The
+checks require correct key ID, key value
+and message digest.
+If the packet has
+been modified in any way or replayed
+by an intruder, it will fail one or more
+of these checks and be discarded.
+Furthermore, the Autokey scheme requires a
+preliminary protocol exchange to obtain
+the server certificate, verify its
+credentials and initialize the protocol
+
+The
+@code{auth}
+flag controls whether new associations or
+remote configuration commands require cryptographic authentication.
+This flag can be set or reset by the
+@code{enable}
+and
+@code{disable}
+commands and also by remote
+configuration commands sent by a
+@code{ntpdc(1ntpdcmdoc)}
+program running in
+another machine.
+If this flag is enabled, which is the default
+case, new broadcast client and symmetric passive associations and
+remote configuration commands must be cryptographically
+authenticated using either symmetric key or public key cryptography.
+If this
+flag is disabled, these operations are effective
+even if not cryptographic
+authenticated.
+It should be understood
+that operating with the
+@code{auth}
+flag disabled invites a significant vulnerability
+where a rogue hacker can
+masquerade as a falseticker and seriously
+disrupt system timekeeping.
+It is
+important to note that this flag has no purpose
+other than to allow or disallow
+a new association in response to new broadcast
+and symmetric active messages
+and remote configuration commands and, in particular,
+the flag has no effect on
+the authentication process itself.
+
+An attractive alternative where multicast support is available
+is manycast mode, in which clients periodically troll
+for servers as described in the
+@ref{Automatic NTP Configuration Options}
+page.
+Either symmetric key or public key
+cryptographic authentication can be used in this mode.
+The principle advantage
+of manycast mode is that potential servers need not be
+configured in advance,
+since the client finds them during regular operation,
+and the configuration
+files for all clients can be identical.
+
+The security model and protocol schemes for
+both symmetric key and public key
+cryptography are summarized below;
+further details are in the briefings, papers
+and reports at the NTP project page linked from
+@code{http://www.ntp.org/}.
+@subsubsection Symmetric-Key Cryptography
+The original RFC-1305 specification allows any one of possibly
+65,534 keys, each distinguished by a 32-bit key identifier, to
+authenticate an association.
+The servers and clients involved must
+agree on the key and key identifier to
+authenticate NTP packets.
+Keys and
+related information are specified in a key
+file, usually called
+@file{ntp.keys},
+which must be distributed and stored using
+secure means beyond the scope of the NTP protocol itself.
+Besides the keys used
+for ordinary NTP associations,
+additional keys can be used as passwords for the
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+utility programs.
+
+When
+@code{ntpd(1ntpdmdoc)}
+is first started, it reads the key file specified in the
+@code{keys}
+configuration command and installs the keys
+in the key cache.
+However,
+individual keys must be activated with the
+@code{trusted}
+command before use.
+This
+allows, for instance, the installation of possibly
+several batches of keys and
+then activating or deactivating each batch
+remotely using
+@code{ntpdc(1ntpdcmdoc)}.
+This also provides a revocation capability that can be used
+if a key becomes compromised.
+The
+@code{requestkey}
+command selects the key used as the password for the
+@code{ntpdc(1ntpdcmdoc)}
+utility, while the
+@code{controlkey}
+command selects the key used as the password for the
+@code{ntpq(1ntpqmdoc)}
+utility.
+@subsubsection Public Key Cryptography
+NTPv4 supports the original NTPv3 symmetric key scheme
+described in RFC-1305 and in addition the Autokey protocol,
+which is based on public key cryptography.
+The Autokey Version 2 protocol described on the Autokey Protocol
+page verifies packet integrity using MD5 message digests
+and verifies the source with digital signatures and any of several
+digest/signature schemes.
+Optional identity schemes described on the Identity Schemes
+page and based on cryptographic challenge/response algorithms
+are also available.
+Using all of these schemes provides strong security against
+replay with or without modification, spoofing, masquerade
+and most forms of clogging attacks.
+
+The Autokey protocol has several modes of operation
+corresponding to the various NTP modes supported.
+Most modes use a special cookie which can be
+computed independently by the client and server,
+but encrypted in transmission.
+All modes use in addition a variant of the S-KEY scheme,
+in which a pseudo-random key list is generated and used
+in reverse order.
+These schemes are described along with an executive summary,
+current status, briefing slides and reading list on the
+@ref{Autonomous Authentication}
+page.
+
+The specific cryptographic environment used by Autokey servers
+and clients is determined by a set of files
+and soft links generated by the
+@code{ntp-keygen(1ntpkeygenmdoc)}
+program.
+This includes a required host key file,
+required certificate file and optional sign key file,
+leapsecond file and identity scheme files.
+The
+digest/signature scheme is specified in the X.509 certificate
+along with the matching sign key.
+There are several schemes
+available in the OpenSSL software library, each identified
+by a specific string such as
+@code{md5WithRSAEncryption},
+which stands for the MD5 message digest with RSA
+encryption scheme.
+The current NTP distribution supports
+all the schemes in the OpenSSL library, including
+those based on RSA and DSA digital signatures.
+
+NTP secure groups can be used to define cryptographic compartments
+and security hierarchies.
+It is important that every host
+in the group be able to construct a certificate trail to one
+or more trusted hosts in the same group.
+Each group
+host runs the Autokey protocol to obtain the certificates
+for all hosts along the trail to one or more trusted hosts.
+This requires the configuration file in all hosts to be
+engineered so that, even under anticipated failure conditions,
+the NTP subnet will form such that every group host can find
+a trail to at least one trusted host.
+@subsubsection Naming and Addressing
+It is important to note that Autokey does not use DNS to
+resolve addresses, since DNS can't be completely trusted
+until the name servers have synchronized clocks.
+The cryptographic name used by Autokey to bind the host identity
+credentials and cryptographic values must be independent
+of interface, network and any other naming convention.
+The name appears in the host certificate in either or both
+the subject and issuer fields, so protection against
+DNS compromise is essential.
+
+By convention, the name of an Autokey host is the name returned
+by the Unix
+@code{gethostname(2)}
+system call or equivalent in other systems.
+By the system design
+model, there are no provisions to allow alternate names or aliases.
+However, this is not to say that DNS aliases, different names
+for each interface, etc., are constrained in any way.
+
+It is also important to note that Autokey verifies authenticity
+using the host name, network address and public keys,
+all of which are bound together by the protocol specifically
+to deflect masquerade attacks.
+For this reason Autokey
+includes the source and destinatino IP addresses in message digest
+computations and so the same addresses must be available
+at both the server and client.
+For this reason operation
+with network address translation schemes is not possible.
+This reflects the intended robust security model where government
+and corporate NTP servers are operated outside firewall perimeters.
+@subsubsection Operation
+A specific combination of authentication scheme (none,
+symmetric key, public key) and identity scheme is called
+a cryptotype, although not all combinations are compatible.
+There may be management configurations where the clients,
+servers and peers may not all support the same cryptotypes.
+A secure NTPv4 subnet can be configured in many ways while
+keeping in mind the principles explained above and
+in this section.
+Note however that some cryptotype
+combinations may successfully interoperate with each other,
+but may not represent good security practice.
+
+The cryptotype of an association is determined at the time
+of mobilization, either at configuration time or some time
+later when a message of appropriate cryptotype arrives.
+When mobilized by a
+@code{server}
+or
+@code{peer}
+configuration command and no
+@code{key}
+or
+@code{autokey}
+subcommands are present, the association is not
+authenticated; if the
+@code{key}
+subcommand is present, the association is authenticated
+using the symmetric key ID specified; if the
+@code{autokey}
+subcommand is present, the association is authenticated
+using Autokey.
+
+When multiple identity schemes are supported in the Autokey
+protocol, the first message exchange determines which one is used.
+The client request message contains bits corresponding
+to which schemes it has available.
+The server response message
+contains bits corresponding to which schemes it has available.
+Both server and client match the received bits with their own
+and select a common scheme.
+
+Following the principle that time is a public value,
+a server responds to any client packet that matches
+its cryptotype capabilities.
+Thus, a server receiving
+an unauthenticated packet will respond with an unauthenticated
+packet, while the same server receiving a packet of a cryptotype
+it supports will respond with packets of that cryptotype.
+However, unconfigured broadcast or manycast client
+associations or symmetric passive associations will not be
+mobilized unless the server supports a cryptotype compatible
+with the first packet received.
+By default, unauthenticated associations will not be mobilized
+unless overridden in a decidedly dangerous way.
+
+Some examples may help to reduce confusion.
+Client Alice has no specific cryptotype selected.
+Server Bob has both a symmetric key file and minimal Autokey files.
+Alice's unauthenticated messages arrive at Bob, who replies with
+unauthenticated messages.
+Cathy has a copy of Bob's symmetric
+key file and has selected key ID 4 in messages to Bob.
+Bob verifies the message with his key ID 4.
+If it's the
+same key and the message is verified, Bob sends Cathy a reply
+authenticated with that key.
+If verification fails,
+Bob sends Cathy a thing called a crypto-NAK, which tells her
+something broke.
+She can see the evidence using the
+@code{ntpq(1ntpqmdoc)}
+program.
+
+Denise has rolled her own host key and certificate.
+She also uses one of the identity schemes as Bob.
+She sends the first Autokey message to Bob and they
+both dance the protocol authentication and identity steps.
+If all comes out okay, Denise and Bob continue as described above.
+
+It should be clear from the above that Bob can support
+all the girls at the same time, as long as he has compatible
+authentication and identity credentials.
+Now, Bob can act just like the girls in his own choice of servers;
+he can run multiple configured associations with multiple different
+servers (or the same server, although that might not be useful).
+But, wise security policy might preclude some cryptotype
+combinations; for instance, running an identity scheme
+with one server and no authentication with another might not be wise.
+@subsubsection Key Management
+The cryptographic values used by the Autokey protocol are
+incorporated as a set of files generated by the
+@code{ntp-keygen(1ntpkeygenmdoc)}
+utility program, including symmetric key, host key and
+public certificate files, as well as sign key, identity parameters
+and leapseconds files.
+Alternatively, host and sign keys and
+certificate files can be generated by the OpenSSL utilities
+and certificates can be imported from public certificate
+authorities.
+Note that symmetric keys are necessary for the
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+utility programs.
+The remaining files are necessary only for the
+Autokey protocol.
+
+Certificates imported from OpenSSL or public certificate
+authorities have certian limitations.
+The certificate should be in ASN.1 syntax, X.509 Version 3
+format and encoded in PEM, which is the same format
+used by OpenSSL.
+The overall length of the certificate encoded
+in ASN.1 must not exceed 1024 bytes.
+The subject distinguished
+name field (CN) is the fully qualified name of the host
+on which it is used; the remaining subject fields are ignored.
+The certificate extension fields must not contain either
+a subject key identifier or a issuer key identifier field;
+however, an extended key usage field for a trusted host must
+contain the value
+@code{trustRoot};.
+Other extension fields are ignored.
+@subsubsection Authentication Commands
+@table @asis
+@item @code{autokey} @code{[@kbd{logsec}]}
+Specifies the interval between regenerations of the session key
+list used with the Autokey protocol.
+Note that the size of the key
+list for each association depends on this interval and the current
+poll interval.
+The default value is 12 (4096 s or about 1.1 hours).
+For poll intervals above the specified interval, a session key list
+with a single entry will be regenerated for every message
+sent.
+@item @code{controlkey} @kbd{key}
+Specifies the key identifier to use with the
+@code{ntpq(1ntpqmdoc)}
+utility, which uses the standard
+protocol defined in RFC-1305.
+The
+@kbd{key}
+argument is
+the key identifier for a trusted key, where the value can be in the
+range 1 to 65,534, inclusive.
+@item @code{crypto} @code{[@code{cert} @kbd{file}]} @code{[@code{leap} @kbd{file}]} @code{[@code{randfile} @kbd{file}]} @code{[@code{host} @kbd{file}]} @code{[@code{sign} @kbd{file}]} @code{[@code{gq} @kbd{file}]} @code{[@code{gqpar} @kbd{file}]} @code{[@code{iffpar} @kbd{file}]} @code{[@code{mvpar} @kbd{file}]} @code{[@code{pw} @kbd{password}]}
+This command requires the OpenSSL library.
+It activates public key
+cryptography, selects the message digest and signature
+encryption scheme and loads the required private and public
+values described above.
+If one or more files are left unspecified,
+the default names are used as described above.
+Unless the complete path and name of the file are specified, the
+location of a file is relative to the keys directory specified
+in the
+@code{keysdir}
+command or default
+@file{/usr/local/etc}.
+Following are the subcommands:
+@table @asis
+@item @code{cert} @kbd{file}
+Specifies the location of the required host public certificate file.
+This overrides the link
+@file{ntpkey_cert_}@kbd{hostname}
+in the keys directory.
+@item @code{gqpar} @kbd{file}
+Specifies the location of the optional GQ parameters file.
+This
+overrides the link
+@file{ntpkey_gq_}@kbd{hostname}
+in the keys directory.
+@item @code{host} @kbd{file}
+Specifies the location of the required host key file.
+This overrides
+the link
+@file{ntpkey_key_}@kbd{hostname}
+in the keys directory.
+@item @code{iffpar} @kbd{file}
+Specifies the location of the optional IFF parameters file.This
+overrides the link
+@file{ntpkey_iff_}@kbd{hostname}
+in the keys directory.
+@item @code{leap} @kbd{file}
+Specifies the location of the optional leapsecond file.
+This overrides the link
+@file{ntpkey_leap}
+in the keys directory.
+@item @code{mvpar} @kbd{file}
+Specifies the location of the optional MV parameters file.
+This
+overrides the link
+@file{ntpkey_mv_}@kbd{hostname}
+in the keys directory.
+@item @code{pw} @kbd{password}
+Specifies the password to decrypt files containing private keys and
+identity parameters.
+This is required only if these files have been
+encrypted.
+@item @code{randfile} @kbd{file}
+Specifies the location of the random seed file used by the OpenSSL
+library.
+The defaults are described in the main text above.
+@item @code{sign} @kbd{file}
+Specifies the location of the optional sign key file.
+This overrides
+the link
+@file{ntpkey_sign_}@kbd{hostname}
+in the keys directory.
+If this file is
+not found, the host key is also the sign key.
+@end table
+@item @code{keys} @kbd{keyfile}
+Specifies the complete path and location of the MD5 key file
+containing the keys and key identifiers used by
+@code{ntpd(1ntpdmdoc)},
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+when operating with symmetric key cryptography.
+This is the same operation as the
+@code{-k}
+command line option.
+@item @code{keysdir} @kbd{path}
+This command specifies the default directory path for
+cryptographic keys, parameters and certificates.
+The default is
+@file{/usr/local/etc/}.
+@item @code{requestkey} @kbd{key}
+Specifies the key identifier to use with the
+@code{ntpdc(1ntpdcmdoc)}
+utility program, which uses a
+proprietary protocol specific to this implementation of
+@code{ntpd(1ntpdmdoc)}.
+The
+@kbd{key}
+argument is a key identifier
+for the trusted key, where the value can be in the range 1 to
+65,534, inclusive.
+@item @code{revoke} @kbd{logsec}
+Specifies the interval between re-randomization of certain
+cryptographic values used by the Autokey scheme, as a power of 2 in
+seconds.
+These values need to be updated frequently in order to
+deflect brute-force attacks on the algorithms of the scheme;
+however, updating some values is a relatively expensive operation.
+The default interval is 16 (65,536 s or about 18 hours).
+For poll
+intervals above the specified interval, the values will be updated
+for every message sent.
+@item @code{trustedkey} @kbd{key} @kbd{...}
+Specifies the key identifiers which are trusted for the
+purposes of authenticating peers with symmetric key cryptography,
+as well as keys used by the
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+programs.
+The authentication procedures require that both the local
+and remote servers share the same key and key identifier for this
+purpose, although different keys can be used with different
+servers.
+The
+@kbd{key}
+arguments are 32-bit unsigned
+integers with values from 1 to 65,534.
+@end table
+@subsubsection Error Codes
+The following error codes are reported via the NTP control
+and monitoring protocol trap mechanism.
+@table @asis
+@item 101
+(bad field format or length)
+The packet has invalid version, length or format.
+@item 102
+(bad timestamp)
+The packet timestamp is the same or older than the most recent received.
+This could be due to a replay or a server clock time step.
+@item 103
+(bad filestamp)
+The packet filestamp is the same or older than the most recent received.
+This could be due to a replay or a key file generation error.
+@item 104
+(bad or missing public key)
+The public key is missing, has incorrect format or is an unsupported type.
+@item 105
+(unsupported digest type)
+The server requires an unsupported digest/signature scheme.
+@item 106
+(mismatched digest types)
+Not used.
+@item 107
+(bad signature length)
+The signature length does not match the current public key.
+@item 108
+(signature not verified)
+The message fails the signature check.
+It could be bogus or signed by a
+different private key.
+@item 109
+(certificate not verified)
+The certificate is invalid or signed with the wrong key.
+@item 110
+(certificate not verified)
+The certificate is not yet valid or has expired or the signature could not
+be verified.
+@item 111
+(bad or missing cookie)
+The cookie is missing, corrupted or bogus.
+@item 112
+(bad or missing leapseconds table)
+The leapseconds table is missing, corrupted or bogus.
+@item 113
+(bad or missing certificate)
+The certificate is missing, corrupted or bogus.
+@item 114
+(bad or missing identity)
+The identity key is missing, corrupt or bogus.
+@end table
+@node Monitoring Support
+@subsection Monitoring Support
+@code{ntpd(1ntpdmdoc)}
+includes a comprehensive monitoring facility suitable
+for continuous, long term recording of server and client
+timekeeping performance.
+See the
+@code{statistics}
+command below
+for a listing and example of each type of statistics currently
+supported.
+Statistic files are managed using file generation sets
+and scripts in the
+@file{./scripts}
+directory of this distribution.
+Using
+these facilities and
+@sc{unix}
+@code{cron(8)}
+jobs, the data can be
+automatically summarized and archived for retrospective analysis.
+@subsubsection Monitoring Commands
+@table @asis
+@item @code{statistics} @kbd{name} @kbd{...}
+Enables writing of statistics records.
+Currently, eight kinds of
+@kbd{name}
+statistics are supported.
+@table @asis
+@item @code{clockstats}
+Enables recording of clock driver statistics information.
+Each update
+received from a clock driver appends a line of the following form to
+the file generation set named
+@code{clockstats}:
+@verbatim
+49213 525.624 127.127.4.1 93 226 00:08:29.606 D
+@end verbatim
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the
+clock address in dotted-quad notation.
+The final field shows the last
+timecode received from the clock in decoded ASCII format, where
+meaningful.
+In some clock drivers a good deal of additional information
+can be gathered and displayed as well.
+See information specific to each
+clock for further details.
+@item @code{cryptostats}
+This option requires the OpenSSL cryptographic software library.
+It
+enables recording of cryptographic public key protocol information.
+Each message received by the protocol module appends a line of the
+following form to the file generation set named
+@code{cryptostats}:
+@verbatim
+49213 525.624 127.127.4.1 message
+@end verbatim
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the peer
+address in dotted-quad notation, The final message field includes the
+message type and certain ancillary information.
+See the
+@ref{Authentication Options}
+section for further information.
+@item @code{loopstats}
+Enables recording of loop filter statistics information.
+Each
+update of the local clock outputs a line of the following form to
+the file generation set named
+@code{loopstats}:
+@verbatim
+50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
+@end verbatim
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next five fields
+show time offset (seconds), frequency offset (parts per million -
+PPM), RMS jitter (seconds), Allan deviation (PPM) and clock
+discipline time constant.
+@item @code{peerstats}
+Enables recording of peer statistics information.
+This includes
+statistics records of all peers of a NTP server and of special
+signals, where present and configured.
+Each valid update appends a
+line of the following form to the current element of a file
+generation set named
+@code{peerstats}:
+@verbatim
+48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877 0.000958674
+@end verbatim
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the peer address in dotted-quad notation and status,
+respectively.
+The status field is encoded in hex in the format
+described in Appendix A of the NTP specification RFC 1305.
+The final four fields show the offset,
+delay, dispersion and RMS jitter, all in seconds.
+@item @code{rawstats}
+Enables recording of raw-timestamp statistics information.
+This
+includes statistics records of all peers of a NTP server and of
+special signals, where present and configured.
+Each NTP message
+received from a peer or clock driver appends a line of the
+following form to the file generation set named
+@code{rawstats}:
+@verbatim
+50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
+@end verbatim
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the remote peer or clock address followed by the local address
+in dotted-quad notation.
+The final four fields show the originate,
+receive, transmit and final NTP timestamps in order.
+The timestamp
+values are as received and before processing by the various data
+smoothing and mitigation algorithms.
+@item @code{sysstats}
+Enables recording of ntpd statistics counters on a periodic basis.
+Each
+hour a line of the following form is appended to the file generation
+set named
+@code{sysstats}:
+@verbatim
+50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
+@end verbatim
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The remaining ten fields show
+the statistics counter values accumulated since the last generated
+line.
+@table @asis
+@item Time since restart @code{36000}
+Time in hours since the system was last rebooted.
+@item Packets received @code{81965}
+Total number of packets received.
+@item Packets processed @code{0}
+Number of packets received in response to previous packets sent
+@item Current version @code{9546}
+Number of packets matching the current NTP version.
+@item Previous version @code{56}
+Number of packets matching the previous NTP version.
+@item Bad version @code{71793}
+Number of packets matching neither NTP version.
+@item Access denied @code{512}
+Number of packets denied access for any reason.
+@item Bad length or format @code{540}
+Number of packets with invalid length, format or port number.
+@item Bad authentication @code{10}
+Number of packets not verified as authentic.
+@item Rate exceeded @code{147}
+Number of packets discarded due to rate limitation.
+@end table
+@item @code{statsdir} @kbd{directory_path}
+Indicates the full path of a directory where statistics files
+should be created (see below).
+This keyword allows
+the (otherwise constant)
+@code{filegen}
+filename prefix to be modified for file generation sets, which
+is useful for handling statistics logs.
+@item @code{filegen} @kbd{name} @code{[@code{file} @kbd{filename}]} @code{[@code{type} @kbd{typename}]} @code{[@code{link} | @code{nolink}]} @code{[@code{enable} | @code{disable}]}
+Configures setting of generation file set name.
+Generation
+file sets provide a means for handling files that are
+continuously growing during the lifetime of a server.
+Server statistics are a typical example for such files.
+Generation file sets provide access to a set of files used
+to store the actual data.
+At any time at most one element
+of the set is being written to.
+The type given specifies
+when and how data will be directed to a new element of the set.
+This way, information stored in elements of a file set
+that are currently unused are available for administrational
+operations without the risk of disturbing the operation of ntpd.
+(Most important: they can be removed to free space for new data
+produced.)
+
+Note that this command can be sent from the
+@code{ntpdc(1ntpdcmdoc)}
+program running at a remote location.
+@table @asis
+@item @code{name}
+This is the type of the statistics records, as shown in the
+@code{statistics}
+command.
+@item @code{file} @kbd{filename}
+This is the file name for the statistics records.
+Filenames of set
+members are built from three concatenated elements
+@code{prefix},
+@code{filename}
+and
+@code{suffix}:
+@table @asis
+@item @code{prefix}
+This is a constant filename path.
+It is not subject to
+modifications via the
+@kbd{filegen}
+option.
+It is defined by the
+server, usually specified as a compile-time constant.
+It may,
+however, be configurable for individual file generation sets
+via other commands.
+For example, the prefix used with
+@kbd{loopstats}
+and
+@kbd{peerstats}
+generation can be configured using the
+@kbd{statsdir}
+option explained above.
+@item @code{filename}
+This string is directly concatenated to the prefix mentioned
+above (no intervening
+@quoteleft{}/@quoteright{}).
+This can be modified using
+the file argument to the
+@kbd{filegen}
+statement.
+No
+@file{..}
+elements are
+allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by
+@kbd{prefix}.
+@item @code{suffix}
+This part is reflects individual elements of a file set.
+It is
+generated according to the type of a file set.
+@end table
+@item @code{type} @kbd{typename}
+A file generation set is characterized by its type.
+The following
+types are supported:
+@table @asis
+@item @code{none}
+The file set is actually a single plain file.
+@item @code{pid}
+One element of file set is used per incarnation of a ntpd
+server.
+This type does not perform any changes to file set
+members during runtime, however it provides an easy way of
+separating files belonging to different
+@code{ntpd(1ntpdmdoc)}
+server incarnations.
+The set member filename is built by appending a
+@quoteleft{}.@quoteright{}
+to concatenated
+@kbd{prefix}
+and
+@kbd{filename}
+strings, and
+appending the decimal representation of the process ID of the
+@code{ntpd(1ntpdmdoc)}
+server process.
+@item @code{day}
+One file generation set element is created per day.
+A day is
+defined as the period between 00:00 and 24:00 UTC.
+The file set
+member suffix consists of a
+@quoteleft{}.@quoteright{}
+and a day specification in
+the form
+@code{YYYYMMdd}.
+@code{YYYY}
+is a 4-digit year number (e.g., 1992).
+@code{MM}
+is a two digit month number.
+@code{dd}
+is a two digit day number.
+Thus, all information written at 10 December 1992 would end up
+in a file named
+@kbd{prefix}
+@kbd{filename}.19921210.
+@item @code{week}
+Any file set member contains data related to a certain week of
+a year.
+The term week is defined by computing day-of-year
+modulo 7.
+Elements of such a file generation set are
+distinguished by appending the following suffix to the file set
+filename base: A dot, a 4-digit year number, the letter
+@code{W},
+and a 2-digit week number.
+For example, information from January,
+10th 1992 would end up in a file with suffix
+.No . Ns Ar 1992W1 .
+@item @code{month}
+One generation file set element is generated per month.
+The
+file name suffix consists of a dot, a 4-digit year number, and
+a 2-digit month.
+@item @code{year}
+One generation file element is generated per year.
+The filename
+suffix consists of a dot and a 4 digit year number.
+@item @code{age}
+This type of file generation sets changes to a new element of
+the file set every 24 hours of server operation.
+The filename
+suffix consists of a dot, the letter
+@code{a},
+and an 8-digit number.
+This number is taken to be the number of seconds the server is
+running at the start of the corresponding 24-hour period.
+Information is only written to a file generation by specifying
+@code{enable};
+output is prevented by specifying
+@code{disable}.
+@end table
+@item @code{link} | @code{nolink}
+It is convenient to be able to access the current element of a file
+generation set by a fixed name.
+This feature is enabled by
+specifying
+@code{link}
+and disabled using
+@code{nolink}.
+If link is specified, a
+hard link from the current file set element to a file without
+suffix is created.
+When there is already a file with this name and
+the number of links of this file is one, it is renamed appending a
+dot, the letter
+@code{C},
+and the pid of the ntpd server process.
+When the
+number of links is greater than one, the file is unlinked.
+This
+allows the current file to be accessed by a constant name.
+@item @code{enable} @code{|} @code{disable}
+Enables or disables the recording function.
+@end table
+@end table
+@end table
+@node Access Control Support
+@subsection Access Control Support
+The
+@code{ntpd(1ntpdmdoc)}
+daemon implements a general purpose address/mask based restriction
+list.
+The list contains address/match entries sorted first
+by increasing address values and and then by increasing mask values.
+A match occurs when the bitwise AND of the mask and the packet
+source address is equal to the bitwise AND of the mask and
+address in the list.
+The list is searched in order with the
+last match found defining the restriction flags associated
+with the entry.
+Additional information and examples can be found in the
+"Notes on Configuring NTP and Setting up a NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+
+The restriction facility was implemented in conformance
+with the access policies for the original NSFnet backbone
+time servers.
+Later the facility was expanded to deflect
+cryptographic and clogging attacks.
+While this facility may
+be useful for keeping unwanted or broken or malicious clients
+from congesting innocent servers, it should not be considered
+an alternative to the NTP authentication facilities.
+Source address based restrictions are easily circumvented
+by a determined cracker.
+
+Clients can be denied service because they are explicitly
+included in the restrict list created by the restrict command
+or implicitly as the result of cryptographic or rate limit
+violations.
+Cryptographic violations include certificate
+or identity verification failure; rate limit violations generally
+result from defective NTP implementations that send packets
+at abusive rates.
+Some violations cause denied service
+only for the offending packet, others cause denied service
+for a timed period and others cause the denied service for
+an indefinate period.
+When a client or network is denied access
+for an indefinate period, the only way at present to remove
+the restrictions is by restarting the server.
+@subsubsection The Kiss-of-Death Packet
+Ordinarily, packets denied service are simply dropped with no
+further action except incrementing statistics counters.
+Sometimes a
+more proactive response is needed, such as a server message that
+explicitly requests the client to stop sending and leave a message
+for the system operator.
+A special packet format has been created
+for this purpose called the "kiss-of-death" (KoD) packet.
+KoD packets have the leap bits set unsynchronized and stratum set
+to zero and the reference identifier field set to a four-byte
+ASCII code.
+If the
+@code{noserve}
+or
+@code{notrust}
+flag of the matching restrict list entry is set,
+the code is "DENY"; if the
+@code{limited}
+flag is set and the rate limit
+is exceeded, the code is "RATE".
+Finally, if a cryptographic violation occurs, the code is "CRYP".
+
+A client receiving a KoD performs a set of sanity checks to
+minimize security exposure, then updates the stratum and
+reference identifier peer variables, sets the access
+denied (TEST4) bit in the peer flash variable and sends
+a message to the log.
+As long as the TEST4 bit is set,
+the client will send no further packets to the server.
+The only way at present to recover from this condition is
+to restart the protocol at both the client and server.
+This
+happens automatically at the client when the association times out.
+It will happen at the server only if the server operator cooperates.
+@subsubsection Access Control Commands
+@table @asis
+@item @code{discard} @code{[@code{average} @kbd{avg}]} @code{[@code{minimum} @kbd{min}]} @code{[@code{monitor} @kbd{prob}]}
+Set the parameters of the
+@code{limited}
+facility which protects the server from
+client abuse.
+The
+@code{average}
+subcommand specifies the minimum average packet
+spacing, while the
+@code{minimum}
+subcommand specifies the minimum packet spacing.
+Packets that violate these minima are discarded
+and a kiss-o'-death packet returned if enabled.
+The default
+minimum average and minimum are 5 and 2, respectively.
+The monitor subcommand specifies the probability of discard
+for packets that overflow the rate-control window.
+@item @code{restrict} @code{address} @code{[@code{mask} @kbd{mask}]} @code{[@kbd{flag} @kbd{...}]}
+The
+@kbd{address}
+argument expressed in
+dotted-quad form is the address of a host or network.
+Alternatively, the
+@kbd{address}
+argument can be a valid host DNS name.
+The
+@kbd{mask}
+argument expressed in dotted-quad form defaults to
+@code{255.255.255.255},
+meaning that the
+@kbd{address}
+is treated as the address of an individual host.
+A default entry (address
+@code{0.0.0.0},
+mask
+@code{0.0.0.0})
+is always included and is always the first entry in the list.
+Note that text string
+@code{default},
+with no mask option, may
+be used to indicate the default entry.
+In the current implementation,
+@code{flag}
+always
+restricts access, i.e., an entry with no flags indicates that free
+access to the server is to be given.
+The flags are not orthogonal,
+in that more restrictive flags will often make less restrictive
+ones redundant.
+The flags can generally be classed into two
+categories, those which restrict time service and those which
+restrict informational queries and attempts to do run-time
+reconfiguration of the server.
+One or more of the following flags
+may be specified:
+@table @asis
+@item @code{ignore}
+Deny packets of all kinds, including
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+queries.
+@item @code{kod}
+If this flag is set when an access violation occurs, a kiss-o'-death
+(KoD) packet is sent.
+KoD packets are rate limited to no more than one
+per second.
+If another KoD packet occurs within one second after the
+last one, the packet is dropped.
+@item @code{limited}
+Deny service if the packet spacing violates the lower limits specified
+in the discard command.
+A history of clients is kept using the
+monitoring capability of
+@code{ntpd(1ntpdmdoc)}.
+Thus, monitoring is always active as
+long as there is a restriction entry with the
+@code{limited}
+flag.
+@item @code{lowpriotrap}
+Declare traps set by matching hosts to be low priority.
+The
+number of traps a server can maintain is limited (the current limit
+is 3).
+Traps are usually assigned on a first come, first served
+basis, with later trap requestors being denied service.
+This flag
+modifies the assignment algorithm by allowing low priority traps to
+be overridden by later requests for normal priority traps.
+@item @code{nomodify}
+Deny
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+queries which attempt to modify the state of the
+server (i.e., run time reconfiguration).
+Queries which return
+information are permitted.
+@item @code{noquery}
+Deny
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+queries.
+Time service is not affected.
+@item @code{nopeer}
+Deny packets which would result in mobilizing a new association.
+This
+includes broadcast and symmetric active packets when a configured
+association does not exist.
+It also includes
+@code{pool}
+associations, so if you want to use servers from a
+@code{pool}
+directive and also want to use
+@code{nopeer}
+by default, you'll want a
+@code{restrict source ...} @code{line} @code{as} @code{well} @code{that} @code{does}
+@item not
+include the
+@code{nopeer}
+directive.
+@item @code{noserve}
+Deny all packets except
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+queries.
+@item @code{notrap}
+Decline to provide mode 6 control message trap service to matching
+hosts.
+The trap service is a subsystem of the ntpdq control message
+protocol which is intended for use by remote event logging programs.
+@item @code{notrust}
+Deny service unless the packet is cryptographically authenticated.
+@item @code{ntpport}
+This is actually a match algorithm modifier, rather than a
+restriction flag.
+Its presence causes the restriction entry to be
+matched only if the source port in the packet is the standard NTP
+UDP port (123).
+Both
+@code{ntpport}
+and
+@code{non-ntpport}
+may
+be specified.
+The
+@code{ntpport}
+is considered more specific and
+is sorted later in the list.
+@item @code{version}
+Deny packets that do not match the current NTP version.
+@end table
+
+Default restriction list entries with the flags ignore, interface,
+ntpport, for each of the local host's interface addresses are
+inserted into the table at startup to prevent the server
+from attempting to synchronize to its own time.
+A default entry is also always present, though if it is
+otherwise unconfigured; no flags are associated
+with the default entry (i.e., everything besides your own
+NTP server is unrestricted).
+@end table
+@node Automatic NTP Configuration Options
+@subsection Automatic NTP Configuration Options
+@subsubsection Manycasting
+Manycasting is a automatic discovery and configuration paradigm
+new to NTPv4.
+It is intended as a means for a multicast client
+to troll the nearby network neighborhood to find cooperating
+manycast servers, validate them using cryptographic means
+and evaluate their time values with respect to other servers
+that might be lurking in the vicinity.
+The intended result is that each manycast client mobilizes
+client associations with some number of the "best"
+of the nearby manycast servers, yet automatically reconfigures
+to sustain this number of servers should one or another fail.
+
+Note that the manycasting paradigm does not coincide
+with the anycast paradigm described in RFC-1546,
+which is designed to find a single server from a clique
+of servers providing the same service.
+The manycast paradigm is designed to find a plurality
+of redundant servers satisfying defined optimality criteria.
+
+Manycasting can be used with either symmetric key
+or public key cryptography.
+The public key infrastructure (PKI)
+offers the best protection against compromised keys
+and is generally considered stronger, at least with relatively
+large key sizes.
+It is implemented using the Autokey protocol and
+the OpenSSL cryptographic library available from
+@code{http://www.openssl.org/}.
+The library can also be used with other NTPv4 modes
+as well and is highly recommended, especially for broadcast modes.
+
+A persistent manycast client association is configured
+using the manycastclient command, which is similar to the
+server command but with a multicast (IPv4 class
+@code{D}
+or IPv6 prefix
+@code{FF})
+group address.
+The IANA has designated IPv4 address 224.1.1.1
+and IPv6 address FF05::101 (site local) for NTP.
+When more servers are needed, it broadcasts manycast
+client messages to this address at the minimum feasible rate
+and minimum feasible time-to-live (TTL) hops, depending
+on how many servers have already been found.
+There can be as many manycast client associations
+as different group address, each one serving as a template
+for a future ephemeral unicast client/server association.
+
+Manycast servers configured with the
+@code{manycastserver}
+command listen on the specified group address for manycast
+client messages.
+Note the distinction between manycast client,
+which actively broadcasts messages, and manycast server,
+which passively responds to them.
+If a manycast server is
+in scope of the current TTL and is itself synchronized
+to a valid source and operating at a stratum level equal
+to or lower than the manycast client, it replies to the
+manycast client message with an ordinary unicast server message.
+
+The manycast client receiving this message mobilizes
+an ephemeral client/server association according to the
+matching manycast client template, but only if cryptographically
+authenticated and the server stratum is less than or equal
+to the client stratum.
+Authentication is explicitly required
+and either symmetric key or public key (Autokey) can be used.
+Then, the client polls the server at its unicast address
+in burst mode in order to reliably set the host clock
+and validate the source.
+This normally results
+in a volley of eight client/server at 2-s intervals
+during which both the synchronization and cryptographic
+protocols run concurrently.
+Following the volley,
+the client runs the NTP intersection and clustering
+algorithms, which act to discard all but the "best"
+associations according to stratum and synchronization
+distance.
+The surviving associations then continue
+in ordinary client/server mode.
+
+The manycast client polling strategy is designed to reduce
+as much as possible the volume of manycast client messages
+and the effects of implosion due to near-simultaneous
+arrival of manycast server messages.
+The strategy is determined by the
+@code{manycastclient},
+@code{tos}
+and
+@code{ttl}
+configuration commands.
+The manycast poll interval is
+normally eight times the system poll interval,
+which starts out at the
+@code{minpoll}
+value specified in the
+@code{manycastclient},
+command and, under normal circumstances, increments to the
+@code{maxpolll}
+value specified in this command.
+Initially, the TTL is
+set at the minimum hops specified by the ttl command.
+At each retransmission the TTL is increased until reaching
+the maximum hops specified by this command or a sufficient
+number client associations have been found.
+Further retransmissions use the same TTL.
+
+The quality and reliability of the suite of associations
+discovered by the manycast client is determined by the NTP
+mitigation algorithms and the
+@code{minclock}
+and
+@code{minsane}
+values specified in the
+@code{tos}
+configuration command.
+At least
+@code{minsane}
+candidate servers must be available and the mitigation
+algorithms produce at least
+@code{minclock}
+survivors in order to synchronize the clock.
+Byzantine agreement principles require at least four
+candidates in order to correctly discard a single falseticker.
+For legacy purposes,
+@code{minsane}
+defaults to 1 and
+@code{minclock}
+defaults to 3.
+For manycast service
+@code{minsane}
+should be explicitly set to 4, assuming at least that
+number of servers are available.
+
+If at least
+@code{minclock}
+servers are found, the manycast poll interval is immediately
+set to eight times
+@code{maxpoll}.
+If less than
+@code{minclock}
+servers are found when the TTL has reached the maximum hops,
+the manycast poll interval is doubled.
+For each transmission
+after that, the poll interval is doubled again until
+reaching the maximum of eight times
+@code{maxpoll}.
+Further transmissions use the same poll interval and
+TTL values.
+Note that while all this is going on,
+each client/server association found is operating normally
+it the system poll interval.
+
+Administratively scoped multicast boundaries are normally
+specified by the network router configuration and,
+in the case of IPv6, the link/site scope prefix.
+By default, the increment for TTL hops is 32 starting
+from 31; however, the
+@code{ttl}
+configuration command can be
+used to modify the values to match the scope rules.
+
+It is often useful to narrow the range of acceptable
+servers which can be found by manycast client associations.
+Because manycast servers respond only when the client
+stratum is equal to or greater than the server stratum,
+primary (stratum 1) servers fill find only primary servers
+in TTL range, which is probably the most common objective.
+However, unless configured otherwise, all manycast clients
+in TTL range will eventually find all primary servers
+in TTL range, which is probably not the most common
+objective in large networks.
+The
+@code{tos}
+command can be used to modify this behavior.
+Servers with stratum below
+@code{floor}
+or above
+@code{ceiling}
+specified in the
+@code{tos}
+command are strongly discouraged during the selection
+process; however, these servers may be temporally
+accepted if the number of servers within TTL range is
+less than
+@code{minclock}.
+
+The above actions occur for each manycast client message,
+which repeats at the designated poll interval.
+However, once the ephemeral client association is mobilized,
+subsequent manycast server replies are discarded,
+since that would result in a duplicate association.
+If during a poll interval the number of client associations
+falls below
+@code{minclock},
+all manycast client prototype associations are reset
+to the initial poll interval and TTL hops and operation
+resumes from the beginning.
+It is important to avoid
+frequent manycast client messages, since each one requires
+all manycast servers in TTL range to respond.
+The result could well be an implosion, either minor or major,
+depending on the number of servers in range.
+The recommended value for
+@code{maxpoll}
+is 12 (4,096 s).
+
+It is possible and frequently useful to configure a host
+as both manycast client and manycast server.
+A number of hosts configured this way and sharing a common
+group address will automatically organize themselves
+in an optimum configuration based on stratum and
+synchronization distance.
+For example, consider an NTP
+subnet of two primary servers and a hundred or more
+dependent clients.
+With two exceptions, all servers
+and clients have identical configuration files including both
+@code{multicastclient}
+and
+@code{multicastserver}
+commands using, for instance, multicast group address
+239.1.1.1.
+The only exception is that each primary server
+configuration file must include commands for the primary
+reference source such as a GPS receiver.
+
+The remaining configuration files for all secondary
+servers and clients have the same contents, except for the
+@code{tos}
+command, which is specific for each stratum level.
+For stratum 1 and stratum 2 servers, that command is
+not necessary.
+For stratum 3 and above servers the
+@code{floor}
+value is set to the intended stratum number.
+Thus, all stratum 3 configuration files are identical,
+all stratum 4 files are identical and so forth.
+
+Once operations have stabilized in this scenario,
+the primary servers will find the primary reference source
+and each other, since they both operate at the same
+stratum (1), but not with any secondary server or client,
+since these operate at a higher stratum.
+The secondary
+servers will find the servers at the same stratum level.
+If one of the primary servers loses its GPS receiver,
+it will continue to operate as a client and other clients
+will time out the corresponding association and
+re-associate accordingly.
+
+Some administrators prefer to avoid running
+@code{ntpd(1ntpdmdoc)}
+continuously and run either
+@code{ntpdate(8)}
+or
+@code{ntpd(1ntpdmdoc)}
+@code{-q}
+as a cron job.
+In either case the servers must be
+configured in advance and the program fails if none are
+available when the cron job runs.
+A really slick
+application of manycast is with
+@code{ntpd(1ntpdmdoc)}
+@code{-q}.
+The program wakes up, scans the local landscape looking
+for the usual suspects, selects the best from among
+the rascals, sets the clock and then departs.
+Servers do not have to be configured in advance and
+all clients throughout the network can have the same
+configuration file.
+@subsubsection Manycast Interactions with Autokey
+Each time a manycast client sends a client mode packet
+to a multicast group address, all manycast servers
+in scope generate a reply including the host name
+and status word.
+The manycast clients then run
+the Autokey protocol, which collects and verifies
+all certificates involved.
+Following the burst interval
+all but three survivors are cast off,
+but the certificates remain in the local cache.
+It often happens that several complete signing trails
+from the client to the primary servers are collected in this way.
+
+About once an hour or less often if the poll interval
+exceeds this, the client regenerates the Autokey key list.
+This is in general transparent in client/server mode.
+However, about once per day the server private value
+used to generate cookies is refreshed along with all
+manycast client associations.
+In this case all
+cryptographic values including certificates is refreshed.
+If a new certificate has been generated since
+the last refresh epoch, it will automatically revoke
+all prior certificates that happen to be in the
+certificate cache.
+At the same time, the manycast
+scheme starts all over from the beginning and
+the expanding ring shrinks to the minimum and increments
+from there while collecting all servers in scope.
+@subsubsection Manycast Options
+@table @asis
+@item @code{tos} @code{[@code{ceiling} @kbd{ceiling} | @code{cohort} @code{@{} @code{0} | @code{1} @code{@}} | @code{floor} @kbd{floor} | @code{minclock} @kbd{minclock} | @code{minsane} @kbd{minsane}]}
+This command affects the clock selection and clustering
+algorithms.
+It can be used to select the quality and
+quantity of peers used to synchronize the system clock
+and is most useful in manycast mode.
+The variables operate
+as follows:
+@table @asis
+@item @code{ceiling} @kbd{ceiling}
+Peers with strata above
+@code{ceiling}
+will be discarded if there are at least
+@code{minclock}
+peers remaining.
+This value defaults to 15, but can be changed
+to any number from 1 to 15.
+@item @code{cohort} @code{@{0 | 1@}}
+This is a binary flag which enables (0) or disables (1)
+manycast server replies to manycast clients with the same
+stratum level.
+This is useful to reduce implosions where
+large numbers of clients with the same stratum level
+are present.
+The default is to enable these replies.
+@item @code{floor} @kbd{floor}
+Peers with strata below
+@code{floor}
+will be discarded if there are at least
+@code{minclock}
+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
+associations until no more than
+@code{minclock}
+associations remain.
+This value defaults to 3,
+but can be changed to any number from 1 to the number of
+configured sources.
+@item @code{minsane} @kbd{minsane}
+This is the minimum number of candidates available
+to the clock selection algorithm in order to produce
+one or more truechimers for the clustering algorithm.
+If fewer than this number are available, the clock is
+undisciplined and allowed to run free.
+The default is 1
+for legacy purposes.
+However, according to principles of
+Byzantine agreement,
+@code{minsane}
+should be at least 4 in order to detect and discard
+a single falseticker.
+@end table
+@item @code{ttl} @kbd{hop} @kbd{...}
+This command specifies a list of TTL values in increasing
+order, up to 8 values can be specified.
+In manycast mode these values are used in turn
+in an expanding-ring search.
+The default is eight
+multiples of 32 starting at 31.
+@end table
+@node Reference Clock Support
+@subsection Reference Clock Support
+The NTP Version 4 daemon supports some three dozen different radio,
+satellite and modem reference clocks plus a special pseudo-clock
+used for backup or when no other clock source is available.
+Detailed descriptions of individual device drivers and options can
+be found in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+Additional information can be found in the pages linked
+there, including the
+"Debugging Hints for Reference Clock Drivers"
+and
+"How To Write a Reference Clock Driver"
+pages
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+In addition, support for a PPS
+signal is available as described in the
+"Pulse-per-second (PPS) Signal Interfacing"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+Many
+drivers support special line discipline/streams modules which can
+significantly improve the accuracy using the driver.
+These are
+described in the
+"Line Disciplines and Streams Drivers"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+
+A reference clock will generally (though not always) be a radio
+timecode receiver which is synchronized to a source of standard
+time such as the services offered by the NRC in Canada and NIST and
+USNO in the US.
+The interface between the computer and the timecode
+receiver is device dependent, but is usually a serial port.
+A
+device driver specific to each reference clock must be selected and
+compiled in the distribution; however, most common radio, satellite
+and modem clocks are included by default.
+Note that an attempt to
+configure a reference clock when the driver has not been compiled
+or the hardware port has not been appropriately configured results
+in a scalding remark to the system log file, but is otherwise non
+hazardous.
+
+For the purposes of configuration,
+@code{ntpd(1ntpdmdoc)}
+treats
+reference clocks in a manner analogous to normal NTP peers as much
+as possible.
+Reference clocks are identified by a syntactically
+correct but invalid IP address, in order to distinguish them from
+normal NTP peers.
+Reference clock addresses are of the form
+@code{127.127.}@kbd{t}.@kbd{u},
+where
+@kbd{t}
+is an integer
+denoting the clock type and
+@kbd{u}
+indicates the unit
+number in the range 0-3.
+While it may seem overkill, it is in fact
+sometimes useful to configure multiple reference clocks of the same
+type, in which case the unit numbers must be unique.
+
+The
+@code{server}
+command is used to configure a reference
+clock, where the
+@kbd{address}
+argument in that command
+is the clock address.
+The
+@code{key},
+@code{version}
+and
+@code{ttl}
+options are not used for reference clock support.
+The
+@code{mode}
+option is added for reference clock support, as
+described below.
+The
+@code{prefer}
+option can be useful to
+persuade the server to cherish a reference clock with somewhat more
+enthusiasm than other reference clocks or peers.
+Further
+information on this option can be found in the
+"Mitigation Rules and the prefer Keyword"
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp})
+page.
+The
+@code{minpoll}
+and
+@code{maxpoll}
+options have
+meaning only for selected clock drivers.
+See the individual clock
+driver document pages for additional information.
+
+The
+@code{fudge}
+command is used to provide additional
+information for individual clock drivers and normally follows
+immediately after the
+@code{server}
+command.
+The
+@kbd{address}
+argument specifies the clock address.
+The
+@code{refid}
+and
+@code{stratum}
+options can be used to
+override the defaults for the device.
+There are two optional
+device-dependent time offsets and four flags that can be included
+in the
+@code{fudge}
+command as well.
+
+The stratum number of a reference clock is by default zero.
+Since the
+@code{ntpd(1ntpdmdoc)}
+daemon adds one to the stratum of each
+peer, a primary server ordinarily displays an external stratum of
+one.
+In order to provide engineered backups, it is often useful to
+specify the reference clock stratum as greater than zero.
+The
+@code{stratum}
+option is used for this purpose.
+Also, in cases
+involving both a reference clock and a pulse-per-second (PPS)
+discipline signal, it is useful to specify the reference clock
+identifier as other than the default, depending on the driver.
+The
+@code{refid}
+option is used for this purpose.
+Except where noted,
+these options apply to all clock drivers.
+@subsubsection Reference Clock Commands
+@table @asis
+@item @code{server} @code{127.127.}@kbd{t}.@kbd{u} @code{[@code{prefer}]} @code{[@code{mode} @kbd{int}]} @code{[@code{minpoll} @kbd{int}]} @code{[@code{maxpoll} @kbd{int}]}
+This command can be used to configure reference clocks in
+special ways.
+The options are interpreted as follows:
+@table @asis
+@item @code{prefer}
+Marks the reference clock as preferred.
+All other things being
+equal, this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp})
+for further information.
+@item @code{mode} @kbd{int}
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+@item @code{minpoll} @kbd{int}
+@item @code{maxpoll} @kbd{int}
+These options specify the minimum and maximum polling interval
+for reference clock messages, as a power of 2 in seconds
+For
+most directly connected reference clocks, both
+@code{minpoll}
+and
+@code{maxpoll}
+default to 6 (64 s).
+For modem reference clocks,
+@code{minpoll}
+defaults to 10 (17.1 m) and
+@code{maxpoll}
+defaults to 14 (4.5 h).
+The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
+@end table
+@item @code{fudge} @code{127.127.}@kbd{t}.@kbd{u} @code{[@code{time1} @kbd{sec}]} @code{[@code{time2} @kbd{sec}]} @code{[@code{stratum} @kbd{int}]} @code{[@code{refid} @kbd{string}]} @code{[@code{mode} @kbd{int}]} @code{[@code{flag1} @code{0} @code{|} @code{1}]} @code{[@code{flag2} @code{0} @code{|} @code{1}]} @code{[@code{flag3} @code{0} @code{|} @code{1}]} @code{[@code{flag4} @code{0} @code{|} @code{1}]}
+This command can be used to configure reference clocks in
+special ways.
+It must immediately follow the
+@code{server}
+command which configures the driver.
+Note that the same capability
+is possible at run time using the
+@code{ntpdc(1ntpdcmdoc)}
+program.
+The options are interpreted as
+follows:
+@table @asis
+@item @code{time1} @kbd{sec}
+Specifies a constant to be added to the time offset produced by
+the driver, a fixed-point decimal number in seconds.
+This is used
+as a calibration constant to adjust the nominal time offset of a
+particular clock to agree with an external standard, such as a
+precision PPS signal.
+It also provides a way to correct a
+systematic error or bias due to serial port or operating system
+latencies, different cable lengths or receiver internal delay.
+The
+specified offset is in addition to the propagation delay provided
+by other means, such as internal DIPswitches.
+Where a calibration
+for an individual system and driver is available, an approximate
+correction is noted in the driver documentation pages.
+Note: in order to facilitate calibration when more than one
+radio clock or PPS signal is supported, a special calibration
+feature is available.
+It takes the form of an argument to the
+@code{enable}
+command described in
+@ref{Miscellaneous Options}
+page and operates as described in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+@item @code{time2} @kbd{secs}
+Specifies a fixed-point decimal number in seconds, which is
+interpreted in a driver-dependent way.
+See the descriptions of
+specific drivers in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+@file{/usr/share/doc/ntp}).
+@item @code{stratum} @kbd{int}
+Specifies the stratum number assigned to the driver, an integer
+between 0 and 15.
+This number overrides the default stratum number
+ordinarily assigned by the driver itself, usually zero.
+@item @code{refid} @kbd{string}
+Specifies an ASCII string of from one to four characters which
+defines the reference identifier used by the driver.
+This string
+overrides the default identifier ordinarily assigned by the driver
+itself.
+@item @code{mode} @kbd{int}
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+@item @code{flag1} @code{0} @code{|} @code{1}
+@item @code{flag2} @code{0} @code{|} @code{1}
+@item @code{flag3} @code{0} @code{|} @code{1}
+@item @code{flag4} @code{0} @code{|} @code{1}
+These four flags are used for customizing the clock driver.
+The
+interpretation of these values, and whether they are used at all,
+is a function of the particular clock driver.
+However, by
+convention
+@code{flag4}
+is used to enable recording monitoring
+data to the
+@code{clockstats}
+file configured with the
+@code{filegen}
+command.
+Further information on the
+@code{filegen}
+command can be found in
+@ref{Monitoring Options}.
+@end table
+@end table
+@node Miscellaneous Options
+@subsection Miscellaneous Options
+@table @asis
+@item @code{broadcastdelay} @kbd{seconds}
+The broadcast and multicast modes require a special calibration
+to determine the network delay between the local and remote
+servers.
+Ordinarily, this is done automatically by the initial
+protocol exchanges between the client and server.
+In some cases,
+the calibration procedure may fail due to network or server access
+controls, for example.
+This command specifies the default delay to
+be used under these circumstances.
+Typically (for Ethernet), a
+number between 0.003 and 0.007 seconds is appropriate.
+The default
+when this command is not used is 0.004 seconds.
+@item @code{calldelay} @kbd{delay}
+This option controls the delay in seconds between the first and second
+packets sent in burst or iburst mode to allow additional time for a modem
+or ISDN call to complete.
+@item @code{driftfile} @kbd{driftfile}
+This command specifies the complete path and name of the file used to
+record the frequency of the local clock oscillator.
+This is the same
+operation as the
+@code{-f}
+command line option.
+If the file exists, it is read at
+startup in order to set the initial frequency and then updated once per
+hour with the current frequency computed by the daemon.
+If the file name is
+specified, but the file itself does not exist, the starts with an initial
+frequency of zero and creates the file when writing it for the first time.
+If this command is not given, the daemon will always start with an initial
+frequency of zero.
+
+The file format consists of a single line containing a single
+floating point number, which records the frequency offset measured
+in parts-per-million (PPM).
+The file is updated by first writing
+the current drift value into a temporary file and then renaming
+this file to replace the old version.
+This implies that
+@code{ntpd(1ntpdmdoc)}
+must have write permission for the directory the
+drift file is located in, and that file system links, symbolic or
+otherwise, should be avoided.
+@item @code{enable} @code{[@code{auth} | @code{bclient} | @code{calibrate} | @code{kernel} | @code{mode7} | @code{monitor} | @code{ntp} | @code{stats}]}
+@item @code{disable} @code{[@code{auth} | @code{bclient} | @code{calibrate} | @code{kernel} | @code{mode7} | @code{monitor} | @code{ntp} | @code{stats}]}
+Provides a way to enable or disable various server options.
+Flags not mentioned are unaffected.
+Note that all of these flags
+can be controlled remotely using the
+@code{ntpdc(1ntpdcmdoc)}
+utility program.
+@table @asis
+@item @code{auth}
+Enables the server to synchronize with unconfigured peers only if the
+peer has been correctly authenticated using either public key or
+private key cryptography.
+The default for this flag is
+@code{enable}.
+@item @code{bclient}
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the
+@code{multicastclient}
+command with default
+address.
+The default for this flag is
+@code{disable}.
+@item @code{calibrate}
+Enables the calibrate feature for reference clocks.
+The default for
+this flag is
+@code{disable}.
+@item @code{kernel}
+Enables the kernel time discipline, if available.
+The default for this
+flag is
+@code{enable}
+if support is available, otherwise
+@code{disable}.
+@item @code{mode7}
+Enables processing of NTP mode 7 implementation-specific requests
+which are used by the deprecated
+@code{ntpdc(1ntpdcmdoc)}
+program.
+The default for this flag is disable.
+This flag is excluded from runtime configuration using
+@code{ntpq(1ntpqmdoc)}.
+The
+@code{ntpq(1ntpqmdoc)}
+program provides the same capabilities as
+@code{ntpdc(1ntpdcmdoc)}
+using standard mode 6 requests.
+@item @code{monitor}
+Enables the monitoring facility.
+See the
+@code{ntpdc(1ntpdcmdoc)}
+program
+and the
+@code{monlist}
+command or further information.
+The
+default for this flag is
+@code{enable}.
+@item @code{ntp}
+Enables time and frequency discipline.
+In effect, this switch opens and
+closes the feedback loop, which is useful for testing.
+The default for
+this flag is
+@code{enable}.
+@item @code{stats}
+Enables the statistics facility.
+See the
+@ref{Monitoring Options}
+section for further information.
+The default for this flag is
+@code{disable}.
+@end table
+@item @code{includefile} @kbd{includefile}
+This command allows additional configuration commands
+to be included from a separate file.
+Include files may
+be nested to a depth of five; upon reaching the end of any
+include file, command processing resumes in the previous
+configuration file.
+This option is useful for sites that run
+@code{ntpd(1ntpdmdoc)}
+on multiple hosts, with (mostly) common options (e.g., a
+restriction list).
+@item @code{logconfig} @kbd{configkeyword}
+This command controls the amount and type of output written to
+the system
+@code{syslog(3)}
+facility or the alternate
+@code{logfile}
+log file.
+By default, all output is turned on.
+All
+@kbd{configkeyword}
+keywords can be prefixed with
+@quoteleft{}=@quoteright{},
+@quoteleft{}+@quoteright{}
+and
+@quoteleft{}-@quoteright{},
+where
+@quoteleft{}=@quoteright{}
+sets the
+@code{syslog(3)}
+priority mask,
+@quoteleft{}+@quoteright{}
+adds and
+@quoteleft{}-@quoteright{}
+removes
+messages.
+@code{syslog(3)}
+messages can be controlled in four
+classes
+(@code{clock}, @code{peer}, @code{sys} and @code{sync}).
+Within these classes four types of messages can be
+controlled: informational messages
+(@code{info}),
+event messages
+(@code{events}),
+statistics messages
+(@code{statistics})
+and
+status messages
+(@code{status}).
+
+Configuration keywords are formed by concatenating the message class with
+the event class.
+The
+@code{all}
+prefix can be used instead of a message class.
+A
+message class may also be followed by the
+@code{all}
+keyword to enable/disable all
+messages of the respective message class.Thus, a minimal log configuration
+could look like this:
+@verbatim
+logconfig =syncstatus +sysevents
+@end verbatim
+
+This would just list the synchronizations state of
+@code{ntpd(1ntpdmdoc)}
+and the major system events.
+For a simple reference server, the
+following minimum message configuration could be useful:
+@verbatim
+logconfig =syncall +clockall
+@end verbatim
+
+This configuration will list all clock information and
+synchronization information.
+All other events and messages about
+peers, system events and so on is suppressed.
+@item @code{logfile} @kbd{logfile}
+This command specifies the location of an alternate log file to
+be used instead of the default system
+@code{syslog(3)}
+facility.
+This is the same operation as the -l command line option.
+@item @code{setvar} @kbd{variable} @code{[@code{default}]}
+This command adds an additional system variable.
+These
+variables can be used to distribute additional information such as
+the access policy.
+If the variable of the form
+@code{name}@code{=}@kbd{value}
+is followed by the
+@code{default}
+keyword, the
+variable will be listed as part of the default system variables
+(@code{rv} command)).
+These additional variables serve
+informational purposes only.
+They are not related to the protocol
+other that they can be listed.
+The known protocol variables will
+always override any variables defined via the
+@code{setvar}
+mechanism.
+There are three special variables that contain the names
+of all variable of the same group.
+The
+@code{sys_var_list}
+holds
+the names of all system variables.
+The
+@code{peer_var_list}
+holds
+the names of all peer variables and the
+@code{clock_var_list}
+holds the names of the reference clock variables.
+@item @code{tinker} @code{[@code{allan} @kbd{allan} | @code{dispersion} @kbd{dispersion} | @code{freq} @kbd{freq} | @code{huffpuff} @kbd{huffpuff} | @code{panic} @kbd{panic} | @code{step} @kbd{srep} | @code{stepout} @kbd{stepout}]}
+This command can be used to alter several system variables in
+very exceptional circumstances.
+It should occur in the
+configuration file before any other configuration options.
+The
+default values of these variables have been carefully optimized for
+a wide range of network speeds and reliability expectations.
+In
+general, they interact in intricate ways that are hard to predict
+and some combinations can result in some very nasty behavior.
+Very
+rarely is it necessary to change the default values; but, some
+folks cannot resist twisting the knobs anyway and this command is
+for them.
+Emphasis added: twisters are on their own and can expect
+no help from the support group.
+
+The variables operate as follows:
+@table @asis
+@item @code{allan} @kbd{allan}
+The argument becomes the new value for the minimum Allan
+intercept, which is a parameter of the PLL/FLL clock discipline
+algorithm.
+The value in log2 seconds defaults to 7 (1024 s), which is also the lower
+limit.
+@item @code{dispersion} @kbd{dispersion}
+The argument becomes the new value for the dispersion increase rate,
+normally .000015 s/s.
+@item @code{freq} @kbd{freq}
+The argument becomes the initial value of the frequency offset in
+parts-per-million.
+This overrides the value in the frequency file, if
+present, and avoids the initial training state if it is not.
+@item @code{huffpuff} @kbd{huffpuff}
+The argument becomes the new value for the experimental
+huff-n'-puff filter span, which determines the most recent interval
+the algorithm will search for a minimum delay.
+The lower limit is
+900 s (15 m), but a more reasonable value is 7200 (2 hours).
+There
+is no default, since the filter is not enabled unless this command
+is given.
+@item @code{panic} @kbd{panic}
+The argument is the panic threshold, normally 1000 s.
+If set to zero,
+the panic sanity check is disabled and a clock offset of any value will
+be accepted.
+@item @code{step} @kbd{step}
+The argument is the step threshold, which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if the step threshold is set to zero or greater than the
+default.
+@item @code{stepout} @kbd{stepout}
+The argument is the stepout timeout, which by default is 900 s.
+It can
+be set to any positive number in seconds.
+If set to zero, the stepout
+pulses will not be suppressed.
+@end table
+@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
+when dropping root (the
+@code{-i}
+option).
+The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+@item @code{stacksize} @kbd{N4kPages}
+Specifies the maximum size of the process stack on systems with the
+@item @code{filenum} @kbd{Nfiledescriptors}
+Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
+@code{mlockall()}
+function.
+Defaults to 50 4k pages (200 4k pages in OpenBSD).
+@end table
+@item @code{trap} @kbd{host_address} @code{[@code{port} @kbd{port_number}]} @code{[@code{interface} @kbd{interface_address}]}
+This command configures a trap receiver at the given host
+address and port number for sending messages with the specified
+local interface address.
+If the port number is unspecified, a value
+of 18447 is used.
+If the interface address is not specified, the
+message is sent with a source address of the local interface the
+message is sent through.
+Note that on a multihomed host the
+interface used may vary from time to time with routing changes.
+
+The trap receiver will generally log event messages and other
+information from the server in a log file.
+While such monitor
+programs may also request their own trap dynamically, configuring a
+trap receiver will ensure that no messages are lost when the server
+is started.
+@item @code{hop} @kbd{...}
+This command specifies a list of TTL values in increasing order, up to 8
+values can be specified.
+In manycast mode these values are used in turn in
+an expanding-ring search.
+The default is eight multiples of 32 starting at
+31.
+@end table
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp.conf} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntp.conf Files:: Files
+* ntp.conf See Also:: See Also
+* ntp.conf Bugs:: Bugs
+* ntp.conf Notes:: Notes
+@end menu
+
+@node ntp.conf Files
+@subsection ntp.conf Files
+@table @asis
+@item @file{/etc/ntp.conf}
+the default name of the configuration file
+@item @file{ntp.keys}
+private MD5 keys
+@item @file{ntpkey}
+RSA private key
+@item @file{ntpkey_}@kbd{host}
+RSA public key
+@item @file{ntp_dh}
+Diffie-Hellman agreement parameters
+@end table
+@node ntp.conf See Also
+@subsection ntp.conf See Also
+@code{ntpd(1ntpdmdoc)},
+@code{ntpdc(1ntpdcmdoc)},
+@code{ntpq(1ntpqmdoc)}
+
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+@code{http://www.ntp.org/}.
+A snapshot of this documentation is available in HTML format in
+@file{/usr/share/doc/ntp}.
+@*
+
+@*
+David L. Mills, @emph{Network Time Protocol (Version 4)}, RFC5905
+@node ntp.conf Bugs
+@subsection ntp.conf Bugs
+The syntax checking is not picky; some combinations of
+ridiculous and even hilarious options and modes may not be
+detected.
+
+The
+@file{ntpkey_}@kbd{host}
+files are really digital
+certificates.
+These should be obtained via secure directory
+services when they become universally available.
+@node ntp.conf Notes
+@subsection ntp.conf Notes
+This document was derived from FreeBSD.
diff --git a/ntpd/invoke-ntp.keys.menu b/ntpd/invoke-ntp.keys.menu
new file mode 100644
index 0000000..2185e4b
--- /dev/null
+++ b/ntpd/invoke-ntp.keys.menu
@@ -0,0 +1 @@
+* ntp.keys Notes:: Notes about ntp.keys
diff --git a/ntpd/invoke-ntp.keys.texi b/ntpd/invoke-ntp.keys.texi
new file mode 100644
index 0000000..b79bba8
--- /dev/null
+++ b/ntpd/invoke-ntp.keys.texi
@@ -0,0 +1,125 @@
+@node ntp.keys Notes
+@section Notes about ntp.keys
+@pindex ntp.keys
+@cindex NTP symmetric key file format
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:56:52 AM by AutoGen 5.18.5pre4
+# From the definitions ntp.keys.def
+# and the template file agtexi-file.tpl
+@end ignore
+
+
+
+This document describes the format of an NTP symmetric key file.
+For a description of the use of this type of file, see the
+"Authentication Support"
+section of the
+@code{ntp.conf(5)}
+page.
+
+@code{ntpd(8)}
+reads its keys from a file specified using the
+@code{-k}
+command line option or the
+@code{keys}
+statement in the configuration file.
+While key number 0 is fixed by the NTP standard
+(as 56 zero bits)
+and may not be changed,
+one or more keys numbered between 1 and 65534
+may be arbitrarily set in the keys file.
+
+The key file uses the same comment conventions
+as the configuration file.
+Key entries use a fixed format of the form
+
+@example
+@kbd{keyno} @kbd{type} @kbd{key}
+@end example
+
+where
+@kbd{keyno}
+is a positive integer (between 1 and 65534),
+@kbd{type}
+is the message digest algorithm,
+and
+@kbd{key}
+is the key itself.
+
+The
+@kbd{key}
+may be given in a format
+controlled by the
+@kbd{type}
+field.
+The
+@kbd{type}
+@code{MD5}
+is always supported.
+If
+@code{ntpd}
+was built with the OpenSSL library
+then any digest library supported by that library may be specified.
+However, if compliance with FIPS 140-2 is required the
+@kbd{type}
+must be either
+@code{SHA}
+or
+@code{SHA1}.
+
+What follows are some key types, and corresponding formats:
+
+@table @asis
+@item @code{MD5}
+The key is 1 to 16 printable characters terminated by
+an EOL,
+whitespace,
+or
+a
+@code{#}
+(which is the "start of comment" character).
+
+@item @code{SHA}
+@item @code{SHA1}
+@item @code{RMD160}
+The key is a hex-encoded ASCII string of 40 characters,
+which is truncated as necessary.
+@end table
+
+Note that the keys used by the
+@code{ntpq(8)}
+and
+@code{ntpdc(8)}
+programs are checked against passwords
+requested by the programs and entered by hand,
+so it is generally appropriate to specify these keys in ASCII format.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp.keys} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntp.keys Files:: Files
+* ntp.keys See Also:: See Also
+* ntp.keys Notes:: Notes
+@end menu
+
+@node ntp.keys Files
+@subsection ntp.keys Files
+@table @asis
+@item @file{/etc/ntp.keys}
+the default name of the configuration file
+@end table
+@node ntp.keys See Also
+@subsection ntp.keys See Also
+@code{ntp.conf(5)},
+@code{ntpd(1ntpdmdoc)},
+@code{ntpdate(1ntpdatemdoc)},
+@code{ntpdc(1ntpdcmdoc)},
+@code{sntp(1sntpmdoc)}
+@node ntp.keys Notes
+@subsection ntp.keys Notes
+This document was derived from FreeBSD.
diff --git a/ntpd/invoke-ntpd.menu b/ntpd/invoke-ntpd.menu
new file mode 100644
index 0000000..3425d82
--- /dev/null
+++ b/ntpd/invoke-ntpd.menu
@@ -0,0 +1 @@
+* ntpd Invocation:: Invoking ntpd
diff --git a/ntpd/invoke-ntpd.texi b/ntpd/invoke-ntpd.texi
new file mode 100644
index 0000000..11ccce4
--- /dev/null
+++ b/ntpd/invoke-ntpd.texi
@@ -0,0 +1,702 @@
+@node ntpd Invocation
+@section Invoking ntpd
+@pindex ntpd
+@cindex NTP daemon program
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:56:55 AM by AutoGen 5.18.5pre4
+# From the definitions ntpd-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+The
+@code{ntpd}
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC-5905,
+but also retains compatibility with
+version 3, as defined by RFC-1305, and versions 1
+and 2, as defined by RFC-1059 and RFC-1119, respectively.
+
+The
+@code{ntpd}
+utility does most computations in 64-bit floating point
+arithmetic and does relatively clumsy 64-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+
+Ordinarily,
+@code{ntpd}
+reads the
+@code{ntp.conf(5)}
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+
+If NetInfo support is built into
+@code{ntpd}
+then
+@code{ntpd}
+will attempt to read its configuration from the
+NetInfo if the default
+@code{ntp.conf(5)}
+file cannot be read and no file is
+specified by the
+@code{-c}
+option.
+
+Various internal
+@code{ntpd}
+variables can be displayed and
+configuration options altered while the
+@code{ntpd}
+is running
+using the
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+utility programs.
+
+When
+@code{ntpd}
+starts it looks at the value of
+@code{umask(2)},
+and if zero
+@code{ntpd}
+will set the
+@code{umask(2)}
+to 022.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpd} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpd usage:: ntpd help/usage (@option{--help})
+* ntpd ipv4:: ipv4 option (-4)
+* ntpd ipv6:: ipv6 option (-6)
+* ntpd authreq:: authreq option (-a)
+* ntpd authnoreq:: authnoreq option (-A)
+* ntpd configfile:: configfile option (-c)
+* ntpd driftfile:: driftfile option (-f)
+* ntpd panicgate:: panicgate option (-g)
+* ntpd jaildir:: jaildir option (-i)
+* ntpd interface:: interface option (-I)
+* ntpd keyfile:: keyfile option (-k)
+* ntpd logfile:: logfile option (-l)
+* ntpd novirtualips:: novirtualips option (-L)
+* ntpd modifymmtimer:: modifymmtimer option (-M)
+* ntpd nice:: nice option (-N)
+* ntpd pidfile:: pidfile option (-p)
+* ntpd priority:: priority option (-P)
+* ntpd quit:: quit option (-q)
+* ntpd propagationdelay:: propagationdelay option (-r)
+* ntpd saveconfigquit:: saveconfigquit option
+* ntpd statsdir:: statsdir option (-s)
+* ntpd trustedkey:: trustedkey option (-t)
+* ntpd user:: user option (-u)
+* ntpd updateinterval:: updateinterval option (-U)
+* ntpd wait-sync:: wait-sync option (-w)
+* ntpd slew:: slew option (-x)
+* ntpd usepcc:: usepcc option
+* ntpd pccfreq:: pccfreq option
+* ntpd mdns:: mdns option (-m)
+* ntpd config:: presetting/configuring ntpd
+* ntpd exit status:: exit status
+* ntpd Usage:: Usage
+* ntpd Files:: Files
+* ntpd See Also:: See Also
+* ntpd Bugs:: Bugs
+* ntpd Notes:: Notes
+@end menu
+
+@node ntpd usage
+@subsection ntpd help/usage (@option{--help})
+@cindex ntpd help
+
+This is the automatically generated usage text for ntpd.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpd - NTP daemon program - Ver. 4.2.7p482
+Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
+ [ <server1> ... <serverN> ]
+ Flg Arg Option-Name Description
+ -4 no ipv4 Force IPv4 DNS name resolution
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -a no authreq Require crypto authentication
+ - prohibits the option 'authnoreq'
+ -A no authnoreq Do not require crypto authentication
+ - prohibits the option 'authreq'
+ -b no bcastsync Allow us to sync to broadcast servers
+ -c Str configfile configuration file name
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -f Str driftfile frequency drift file name
+ -g no panicgate Allow the first adjustment to be Big
+ - may appear multiple times
+ -i Str jaildir Jail directory
+ -I Str interface Listen on an interface name or address
+ - may appear multiple times
+ -k Str keyfile path to symmetric keys
+ -l Str logfile path to the log file
+ -L no novirtualips Do not listen to virtual interfaces
+ -n no nofork Do not fork
+ - prohibits the option 'wait-sync'
+ -N no nice Run at high priority
+ -p Str pidfile path to the PID file
+ -P Num priority Process priority
+ -q no quit Set the time and quit
+ - prohibits these options:
+ saveconfigquit
+ wait-sync
+ -r Str propagationdelay Broadcast/propagation delay
+ Str saveconfigquit Save parsed configuration and quit
+ - prohibits these options:
+ quit
+ wait-sync
+ -s Str statsdir Statistics file location
+ -t Str trustedkey Trusted key number
+ - may appear multiple times
+ -u Str user Run as userid (or userid:groupid)
+ -U Num updateinterval interval in seconds between scans for new or dropped interfaces
+ Str var make ARG an ntp variable (RW)
+ - may appear multiple times
+ Str dvar make ARG an ntp variable (RW|DEF)
+ - may appear multiple times
+ -w Num wait-sync Seconds to wait for first clock sync
+ - prohibits these options:
+ nofork
+ quit
+ saveconfigquit
+ -x no slew Slew up to 600 seconds
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - examining environment variables named NTPD_*
+
+Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org>
+@end example
+@exampleindent 4
+
+@node ntpd ipv4
+@subsection ipv4 option (-4)
+@cindex ntpd-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+@node ntpd ipv6
+@subsection ipv6 option (-6)
+@cindex ntpd-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+@node ntpd authreq
+@subsection authreq option (-a)
+@cindex ntpd-authreq
+
+This is the ``require crypto authentication'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+authnoreq.
+@end itemize
+
+Require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is the default.
+@node ntpd authnoreq
+@subsection authnoreq option (-A)
+@cindex ntpd-authnoreq
+
+This is the ``do not require crypto authentication'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+authreq.
+@end itemize
+
+Do not require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is almost never a good idea.
+@node ntpd configfile
+@subsection configfile option (-c)
+@cindex ntpd-configfile
+
+This is the ``configuration file name'' option.
+This option takes a string argument.
+The name and path of the configuration file,
+@file{/etc/ntp.conf}
+by default.
+@node ntpd driftfile
+@subsection driftfile option (-f)
+@cindex ntpd-driftfile
+
+This is the ``frequency drift file name'' option.
+This option takes a string argument.
+The name and path of the frequency file,
+@file{/etc/ntp.drift}
+by default.
+This is the same operation as the
+@code{driftfile} @kbd{driftfile}
+configuration specification in the
+@file{/etc/ntp.conf}
+file.
+@node ntpd panicgate
+@subsection panicgate option (-g)
+@cindex ntpd-panicgate
+
+This is the ``allow the first adjustment to be big'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Normally,
+@code{ntpd}
+exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+@code{ntpd}
+will exit with a message to the system log. This option can be used with the
+@code{-q}
+and
+@code{-x}
+options.
+See the
+@code{tinker}
+configuration file directive for other options.
+@node ntpd jaildir
+@subsection jaildir option (-i)
+@cindex ntpd-jaildir
+
+This is the ``jail directory'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
+@end itemize
+
+Chroot the server to the directory
+@kbd{jaildir}
+.
+This option also implies that the server attempts to drop root privileges at startup.
+You may need to also specify a
+@code{-u}
+option.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+@code{--enable-clockctl}) or Linux (configure with
+@code{--enable-linuxcaps}) or Solaris (configure with @code{--enable-solarisprivs}).
+@node ntpd interface
+@subsection interface option (-I)
+@cindex ntpd-interface
+
+This is the ``listen on an interface name or address'' option.
+This option takes a string argument @file{iface}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Open the network address given, or all the addresses associated with the
+given interface name. This option may appear multiple times. This option
+also implies not opening other addresses, except wildcard and localhost.
+This option is deprecated. Please consider using the configuration file
+@code{interface} command, which is more versatile.
+@node ntpd keyfile
+@subsection keyfile option (-k)
+@cindex ntpd-keyfile
+
+This is the ``path to symmetric keys'' option.
+This option takes a string argument.
+Specify the name and path of the symmetric key file.
+@file{/etc/ntp.keys}
+is the default.
+This is the same operation as the
+@code{keys} @kbd{keyfile}
+configuration file directive.
+@node ntpd logfile
+@subsection logfile option (-l)
+@cindex ntpd-logfile
+
+This is the ``path to the log file'' option.
+This option takes a string argument.
+Specify the name and path of the log file.
+The default is the system log file.
+This is the same operation as the
+@code{logfile} @kbd{logfile}
+configuration file directive.
+@node ntpd novirtualips
+@subsection novirtualips option (-L)
+@cindex ntpd-novirtualips
+
+This is the ``do not listen to virtual interfaces'' option.
+Do not listen to virtual interfaces, defined as those with
+names containing a colon. This option is deprecated. Please
+consider using the configuration file @code{interface} command, which
+is more versatile.
+@node ntpd modifymmtimer
+@subsection modifymmtimer option (-M)
+@cindex ntpd-modifymmtimer
+
+This is the ``modify multimedia timer (windows only)'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SYS_WINNT} during the compilation.
+@end itemize
+
+Set the Windows Multimedia Timer to highest resolution. This
+ensures the resolution does not change while ntpd is running,
+avoiding timekeeping glitches associated with changes.
+@node ntpd nice
+@subsection nice option (-N)
+@cindex ntpd-nice
+
+This is the ``run at high priority'' option.
+To the extent permitted by the operating system, run
+@code{ntpd}
+at the highest priority.
+@node ntpd pidfile
+@subsection pidfile option (-p)
+@cindex ntpd-pidfile
+
+This is the ``path to the pid file'' option.
+This option takes a string argument.
+Specify the name and path of the file used to record
+@code{ntpd}'s
+process ID.
+This is the same operation as the
+@code{pidfile} @kbd{pidfile}
+configuration file directive.
+@node ntpd priority
+@subsection priority option (-P)
+@cindex ntpd-priority
+
+This is the ``process priority'' option.
+This option takes a number argument.
+To the extent permitted by the operating system, run
+@code{ntpd}
+at the specified
+@code{sched_setscheduler(SCHED_FIFO)}
+priority.
+@node ntpd quit
+@subsection quit option (-q)
+@cindex ntpd-quit
+
+This is the ``set the time and quit'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+saveconfigquit, wait-sync.
+@end itemize
+
+@code{ntpd}
+will not daemonize and will exit after the clock is first
+synchronized. This behavior mimics that of the
+@code{ntpdate}
+program, which will soon be replaced with a shell script.
+The
+@code{-g}
+and
+@code{-x}
+options can be used with this option.
+Note: The kernel time discipline is disabled with this option.
+@node ntpd propagationdelay
+@subsection propagationdelay option (-r)
+@cindex ntpd-propagationdelay
+
+This is the ``broadcast/propagation delay'' option.
+This option takes a string argument.
+Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+@node ntpd saveconfigquit
+@subsection saveconfigquit option
+@cindex ntpd-saveconfigquit
+
+This is the ``save parsed configuration and quit'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SAVECONFIG} during the compilation.
+@item
+must not appear in combination with any of the following options:
+quit, wait-sync.
+@end itemize
+
+Cause @code{ntpd} to parse its startup configuration file and save an
+equivalent to the given filename and exit. This option was
+designed for automated testing.
+@node ntpd statsdir
+@subsection statsdir option (-s)
+@cindex ntpd-statsdir
+
+This is the ``statistics file location'' option.
+This option takes a string argument.
+Specify the directory path for files created by the statistics facility.
+This is the same operation as the
+@code{statsdir} @kbd{statsdir}
+configuration file directive.
+@node ntpd trustedkey
+@subsection trustedkey option (-t)
+@cindex ntpd-trustedkey
+
+This is the ``trusted key number'' option.
+This option takes a string argument @file{tkey}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Add the specified key number to the trusted key list.
+@node ntpd user
+@subsection user option (-u)
+@cindex ntpd-user
+
+This is the ``run as userid (or userid:groupid)'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{HAVE_DROPROOT} during the compilation.
+@end itemize
+
+Specify a user, and optionally a group, to switch to.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+@code{--enable-clockctl}) or Linux (configure with
+@code{--enable-linuxcaps}) or Solaris (configure with @code{--enable-solarisprivs}).
+@node ntpd updateinterval
+@subsection updateinterval option (-U)
+@cindex ntpd-updateinterval
+
+This is the ``interval in seconds between scans for new or dropped interfaces'' option.
+This option takes a number argument.
+Give the time in seconds between two scans for new or dropped interfaces.
+For systems with routing socket support the scans will be performed shortly after the interface change
+has been detected by the system.
+Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+@node ntpd wait-sync
+@subsection wait-sync option (-w)
+@cindex ntpd-wait-sync
+
+This is the ``seconds to wait for first clock sync'' option.
+This option takes a number argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{HAVE_WORKING_FORK} during the compilation.
+@item
+must not appear in combination with any of the following options:
+nofork, quit, saveconfigquit.
+@end itemize
+
+If greater than zero, alters @code{ntpd}'s behavior when forking to
+daemonize. Instead of exiting with status 0 immediately after
+the fork, the parent waits up to the specified number of
+seconds for the child to first synchronize the clock. The exit
+status is zero (success) if the clock was synchronized,
+otherwise it is @code{ETIMEDOUT}.
+This provides the option for a script starting @code{ntpd} to easily
+wait for the first set of the clock before proceeding.
+@node ntpd slew
+@subsection slew option (-x)
+@cindex ntpd-slew
+
+This is the ``slew up to 600 seconds'' option.
+Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+This option can be used with the
+@code{-g}
+and
+@code{-q}
+options.
+See the
+@code{tinker}
+configuration file directive for other options.
+Note: The kernel time discipline is disabled with this option.
+@node ntpd usepcc
+@subsection usepcc option
+@cindex ntpd-usepcc
+
+This is the ``use cpu cycle counter (windows only)'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SYS_WINNT} during the compilation.
+@end itemize
+
+Attempt to substitute the CPU counter for @code{QueryPerformanceCounter}.
+The CPU counter and @code{QueryPerformanceCounter} are compared, and if
+they have the same frequency, the CPU counter (RDTSC on x86) is
+used directly, saving the overhead of a system call.
+@node ntpd pccfreq
+@subsection pccfreq option
+@cindex ntpd-pccfreq
+
+This is the ``force cpu cycle counter use (windows only)'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{SYS_WINNT} during the compilation.
+@end itemize
+
+Force substitution the CPU counter for @code{QueryPerformanceCounter}.
+The CPU counter (RDTSC on x86) is used unconditionally with the
+given frequency (in Hz).
+@node ntpd mdns
+@subsection mdns option (-m)
+@cindex ntpd-mdns
+
+This is the ``register with mdns as a ntp server'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{HAVE_DNSREGISTRATION} during the compilation.
+@end itemize
+
+Registers as an NTP server with the local mDNS server which allows
+the server to be discovered via mDNS client lookup.
+
+
+@node ntpd config
+@subsection presetting/configuring ntpd
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from environment variables named @code{NTPD} and @code{NTPD_<OPTION_NAME>}. @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPD} variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version. This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpd exit status
+@subsection ntpd exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
+@node ntpd Usage
+@subsection ntpd Usage
+@node ntpd Files
+@subsection ntpd Files
+@node ntpd See Also
+@subsection ntpd See Also
+@node ntpd Bugs
+@subsection ntpd Bugs
+@node ntpd Notes
+@subsection ntpd Notes
diff --git a/ntpd/jupiter.h b/ntpd/jupiter.h
new file mode 100644
index 0000000..ed80b0c
--- /dev/null
+++ b/ntpd/jupiter.h
@@ -0,0 +1,255 @@
+/* @(#) $Header$ (LBL) */
+
+/*
+ * Rockwell Jupiter GPS receiver definitions
+ *
+ * This is all based on the "Zodiac GPS Receiver Family Designer's
+ * Guide" (dated 12/96)
+ */
+
+#define JUPITER_SYNC 0x81ff /* sync word (book says 0xff81 !?!?) */
+#define JUPITER_ALL 0xffff /* disable all output messages */
+
+/* Output messages (sent by the Jupiter board) */
+#define JUPITER_O_GPOS 1000 /* geodetic position status */
+#define JUPITER_O_EPOS 1001 /* ECEF position status */
+#define JUPITER_O_CHAN 1002 /* channel summary */
+#define JUPITER_O_VIS 1003 /* visible satellites */
+#define JUPITER_O_DGPS 1005 /* differential GPS status */
+#define JUPITER_O_MEAS 1007 /* channel measurement */
+#define JUPITER_O_ID 1011 /* receiver id */
+#define JUPITER_O_USER 1012 /* user-settings output */
+#define JUPITER_O_TEST 1100 /* built-in test results */
+#define JUPITER_O_MARK 1102 /* measurement time mark */
+#define JUPITER_O_PULSE 1108 /* UTC time mark pulse output */
+#define JUPITER_O_PORT 1130 /* serial port com parameters in use */
+#define JUPITER_O_EUP 1135 /* EEPROM update */
+#define JUPITER_O_ESTAT 1136 /* EEPROM status */
+
+/* Input messages (sent to the Jupiter board) */
+#define JUPITER_I_PVTINIT 1200 /* geodetic position and velocity */
+#define JUPITER_I_USER 1210 /* user-defined datum */
+#define JUPITER_I_MAPSEL 1211 /* map datum select */
+#define JUPITER_I_ELEV 1212 /* satellite elevation mask control */
+#define JUPITER_I_CAND 1213 /* satellite candidate select */
+#define JUPITER_I_DGPS 1214 /* differential GPS control */
+#define JUPITER_I_COLD 1216 /* cold start control */
+#define JUPITER_I_VALID 1217 /* solution validity criteria */
+#define JUPITER_I_ALT 1219 /* user-entered altitude input */
+#define JUPITER_I_PLAT 1220 /* application platform control */
+#define JUPITER_I_NAV 1221 /* nav configuration */
+#define JUPITER_I_TEST 1300 /* preform built-in test command */
+#define JUPITER_I_RESTART 1303 /* restart command */
+#define JUPITER_I_PORT 1330 /* serial port com parameters */
+#define JUPITER_I_PROTO 1331 /* message protocol control */
+#define JUPITER_I_RDGPS 1351 /* raw DGPS RTCM SC-104 data */
+
+struct jheader {
+ u_short sync; /* (JUPITER_SYNC) */
+ u_short id; /* message id */
+ u_short len; /* number of data short wordss (w/o cksum) */
+ u_char reqid; /* JUPITER_REQID_MASK bits available as id */
+ u_char flags; /* flags */
+ u_short hsum; /* header cksum */
+};
+
+#define JUPITER_REQID_MASK 0x3f /* bits available as id */
+#define JUPITER_FLAG_NAK 0x01 /* negative acknowledgement */
+#define JUPITER_FLAG_ACK 0x02 /* acknowledgement */
+#define JUPITER_FLAG_REQUEST 0x04 /* request ACK or NAK */
+#define JUPITER_FLAG_QUERY 0x08 /* request one shot output message */
+#define JUPITER_FLAG_LOG 0x20 /* request periodic output message */
+#define JUPITER_FLAG_CONN 0x40 /* enable periodic message */
+#define JUPITER_FLAG_DISC 0x80 /* disable periodic message */
+
+#define JUPITER_H_FLAG_BITS \
+ "\020\1NAK\2ACK\3REQUEST\4QUERY\5MBZ\6LOG\7CONN\10DISC"
+
+/* Log request messages (data payload when using JUPITER_FLAG_LOG) */
+struct jrequest {
+ u_short trigger; /* if 0, trigger on time trigger on
+ update (e.g. new almanac) */
+ u_short interval; /* frequency in seconds */
+ u_short offset; /* offset into minute */
+ u_short dsum; /* checksum */
+};
+
+/* JUPITER_O_GPOS (1000) */
+struct jgpos {
+ u_short stime[2]; /* set time (10 ms ticks) */
+ u_short seq; /* sequence number */
+ u_short sseq; /* sat measurement sequence number */
+ u_short navval; /* navigation soltuion validity */
+ u_short navtype; /* navigation solution type */
+ u_short nmeas; /* # of measurements used in solution */
+ u_short polar; /* if 1 then polar navigation */
+ u_short gweek; /* GPS week number */
+ u_short sweek[2]; /* GPS seconds into week */
+ u_short nsweek[2]; /* GPS nanoseconds into second */
+ u_short utcday; /* 1 to 31 */
+ u_short utcmon; /* 1 to 12 */
+ u_short utcyear; /* 1980 to 2079 */
+ u_short utchour; /* 0 to 23 */
+ u_short utcmin; /* 0 to 59 */
+ u_short utcsec; /* 0 to 59 */
+ u_short utcnsec[2]; /* 0 to 999999999 */
+ u_short lat[2]; /* latitude (radians) */
+ u_short lon[2]; /* longitude (radians) */
+ u_short height[2]; /* height (meters) */
+ u_short gsep; /* geoidal separation */
+ u_short speed[2]; /* ground speed (meters/sec) */
+ u_short course; /* true course (radians) */
+ u_short mvar;
+ u_short climb;
+ u_short mapd;
+ u_short herr[2];
+ u_short verr[2];
+ u_short terr[2];
+ u_short hverr;
+ u_short bias[2];
+ u_short biassd[2];
+ u_short drift[2];
+ u_short driftsd[2];
+ u_short dsum; /* checksum */
+};
+#define JUPITER_O_GPOS_NAV_NOALT 0x01 /* altitude used */
+#define JUPITER_O_GPOS_NAV_NODGPS 0x02 /* no differential GPS */
+#define JUPITER_O_GPOS_NAV_NOSAT 0x04 /* not enough satellites */
+#define JUPITER_O_GPOS_NAV_MAXH 0x08 /* exceeded max EHPE */
+#define JUPITER_O_GPOS_NAV_MAXV 0x10 /* exceeded max EVPE */
+
+/* JUPITER_O_CHAN (1002) */
+struct jchan {
+ u_short stime[2]; /* set time (10 ms ticks) */
+ u_short seq; /* sequence number */
+ u_short sseq; /* sat measurement sequence number */
+ u_short gweek; /* GPS week number */
+ u_short sweek[2]; /* GPS seconds into week */
+ u_short gpsns[2]; /* GPS nanoseconds from epoch */
+ struct jchan2 {
+ u_short flags; /* flags */
+ u_short prn; /* satellite PRN */
+ u_short chan; /* channel number */
+ } sat[12];
+ u_short dsum;
+};
+
+/* JUPITER_O_VIS (1003) */
+struct jvis {
+ u_short stime[2]; /* set time (10 ms ticks) */
+ u_short seq; /* sequence number */
+ u_short gdop; /* best possible GDOP */
+ u_short pdop; /* best possible PDOP */
+ u_short hdop; /* best possible HDOP */
+ u_short vdop; /* best possible VDOP */
+ u_short tdop; /* best possible TDOP */
+ u_short nvis; /* number of visible satellites */
+ struct jvis2 {
+ u_short prn; /* satellite PRN */
+ u_short azi; /* satellite azimuth (radians) */
+ u_short elev; /* satellite elevation (radians) */
+ } sat[12];
+ u_short dsum; /* checksum */
+};
+
+/* JUPITER_O_ID (1011) */
+struct jid {
+ u_short stime[2]; /* set time (10 ms ticks) */
+ u_short seq; /* sequence number */
+ char chans[20]; /* number of channels (ascii) */
+ char vers[20]; /* software version (ascii) */
+ char date[20]; /* software date (ascii) */
+ char opts[20]; /* software options (ascii) */
+ char reserved[20];
+ u_short dsum; /* checksum */
+};
+
+/* JUPITER_O_USER (1012) */
+struct juser {
+ u_short stime[2]; /* set time (10 ms ticks) */
+ u_short seq; /* sequence number */
+ u_short status; /* operatinoal status */
+ u_short coldtmo; /* cold start time-out */
+ u_short dgpstmo; /* DGPS correction time-out*/
+ u_short emask; /* elevation mask */
+ u_short selcand[2]; /* selected candidate */
+ u_short solflags; /* solution validity criteria */
+ u_short nsat; /* number of satellites in track */
+ u_short herr[2]; /* minimum expected horizontal error */
+ u_short verr[2]; /* minimum expected vertical error */
+ u_short platform; /* application platform */
+ u_short dsum; /* checksum */
+};
+
+/* JUPITER_O_PULSE (1108) */
+struct jpulse {
+ u_short stime[2]; /* set time (10 ms ticks) */
+ u_short seq; /* sequence number */
+ u_short reserved[5];
+ u_short sweek[2]; /* GPS seconds into week */
+ short offs; /* GPS to UTC time offset (seconds) */
+ u_short offns[2]; /* GPS to UTC offset (nanoseconds) */
+ u_short flags; /* flags */
+ u_short dsum; /* checksum */
+};
+#define JUPITER_O_PULSE_VALID 0x1 /* time mark validity */
+#define JUPITER_O_PULSE_UTC 0x2 /* GPS/UTC sync */
+
+/* JUPITER_O_EUP (1135) */
+struct jeup {
+ u_short stime[2]; /* set time (10 ms ticks) */
+ u_short seq; /* sequence number */
+ u_char dataid; /* data id */
+ u_char prn; /* satellite PRN */
+ u_short dsum; /* checksum */
+};
+
+/* JUPITER_I_RESTART (1303) */
+struct jrestart {
+ u_short seq; /* sequence number */
+ u_short flags;
+ u_short dsum; /* checksum */
+};
+#define JUPITER_I_RESTART_INVRAM 0x01
+#define JUPITER_I_RESTART_INVEEPROM 0x02
+#define JUPITER_I_RESTART_INVRTC 0x04
+#define JUPITER_I_RESTART_COLD 0x80
+
+/* JUPITER_I_PVTINIT (1200) */
+struct jpvtinit {
+ u_short flags;
+ u_short gweek; /* GPS week number */
+ u_short sweek[2]; /* GPS seconds into week */
+ u_short utcday; /* 1 to 31 */
+ u_short utcmon; /* 1 to 12 */
+ u_short utcyear; /* 1980 to 2079 */
+ u_short utchour; /* 0 to 23 */
+ u_short utcmin; /* 0 to 59 */
+ u_short utcsec; /* 0 to 59 */
+ u_short lat[2]; /* latitude (radians) */
+ u_short lon[2]; /* longitude (radians) */
+ u_short height[2]; /* height (meters) */
+ u_short speed[2]; /* ground speed (meters/sec) */
+ u_short course; /* true course (radians) */
+ u_short climb;
+ u_short dsum;
+};
+#define JUPITER_I_PVTINIT_FORCE 0x01
+#define JUPITER_I_PVTINIT_GPSVAL 0x02
+#define JUPITER_I_PVTINIT_UTCVAL 0x04
+#define JUPITER_I_PVTINIT_POSVAL 0x08
+#define JUPITER_I_PVTINIT_ALTVAL 0x10
+#define JUPITER_I_PVTINIT_SPDVAL 0x12
+#define JUPITER_I_PVTINIT_MAGVAL 0x14
+#define JUPITER_I_PVTINIT_CLIMBVAL 0x18
+
+/* JUPITER_I_PLAT (1220) */
+struct jplat {
+ u_short seq; /* sequence number */
+ u_short platform; /* application platform */
+ u_short dsum;
+};
+#define JUPITER_I_PLAT_DEFAULT 0 /* default dynamics */
+#define JUPITER_I_PLAT_LOW 2 /* pedestrian */
+#define JUPITER_I_PLAT_MED 5 /* land (e.g. automobile) */
+#define JUPITER_I_PLAT_HIGH 6 /* air */
diff --git a/ntpd/keyword-gen-utd b/ntpd/keyword-gen-utd
new file mode 100644
index 0000000..7474a56
--- /dev/null
+++ b/ntpd/keyword-gen-utd
@@ -0,0 +1 @@
+ * Generated 2013-08-04 04:56:14 UTC diff_ignore_line
diff --git a/ntpd/keyword-gen.c b/ntpd/keyword-gen.c
new file mode 100644
index 0000000..d4f7758
--- /dev/null
+++ b/ntpd/keyword-gen.c
@@ -0,0 +1,752 @@
+/*
+ * keyword-gen.c -- generate keyword scanner finite state machine and
+ * keyword_text array.
+ *
+ * This program is run to generate ntp_keyword.h
+ * After making a change here, two output files should be committed at
+ * the same time as keyword-gen.c:
+ * ntp_keyword.h
+ * keyword-gen-utd
+ *
+ * keyword-gen-utd is a sentinel used by Makefile.am to avoid compiling
+ * keyword_gen.c and generating ntp_keyword.h if the input keyword-gen.c
+ * has not changed. This is not solely an optimization, it also breaks
+ * a dependency chain that otherwise would cause programs to be compiled
+ * when running "make dist" or "make distdir". We want these to package
+ * the existing source without building anything but a tarball. See
+ * [Bug 1470].
+ */
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include <ntp_stdlib.h>
+#include <ntp_config.h>
+#include <lib_strbuf.h>
+#include "ntp_scanner.h"
+#include "ntp_parser.h"
+
+
+/* Define a structure to hold a (keyword, token) pair */
+struct key_tok {
+ char * key; /* Keyword */
+ u_short token; /* Associated Token */
+ follby followedby; /* nonzero indicates the next token(s)
+ forced to be string(s) */
+};
+
+struct key_tok ntp_keywords[] = {
+{ "...", T_Ellipsis, FOLLBY_TOKEN },
+{ "allpeers", T_Allpeers, FOLLBY_TOKEN },
+{ "automax", T_Automax, FOLLBY_TOKEN },
+{ "broadcast", T_Broadcast, FOLLBY_STRING },
+{ "broadcastclient", T_Broadcastclient, FOLLBY_TOKEN },
+{ "broadcastdelay", T_Broadcastdelay, FOLLBY_TOKEN },
+{ "ctl", T_Ctl, FOLLBY_TOKEN },
+{ "disable", T_Disable, FOLLBY_TOKEN },
+{ "driftfile", T_Driftfile, FOLLBY_STRING },
+{ "enable", T_Enable, FOLLBY_TOKEN },
+{ "end", T_End, FOLLBY_TOKEN },
+{ "filegen", T_Filegen, FOLLBY_TOKEN },
+{ "fudge", T_Fudge, FOLLBY_STRING },
+{ "io", T_Io, FOLLBY_TOKEN },
+{ "includefile", T_Includefile, FOLLBY_STRING },
+{ "leapfile", T_Leapfile, FOLLBY_STRING },
+{ "logconfig", T_Logconfig, FOLLBY_STRINGS_TO_EOC },
+{ "logfile", T_Logfile, FOLLBY_STRING },
+{ "manycastclient", T_Manycastclient, FOLLBY_STRING },
+{ "manycastserver", T_Manycastserver, FOLLBY_STRINGS_TO_EOC },
+{ "mem", T_Mem, FOLLBY_TOKEN },
+{ "multicastclient", T_Multicastclient, FOLLBY_STRINGS_TO_EOC },
+{ "peer", T_Peer, FOLLBY_STRING },
+{ "phone", T_Phone, FOLLBY_STRINGS_TO_EOC },
+{ "pidfile", T_Pidfile, FOLLBY_STRING },
+{ "pool", T_Pool, FOLLBY_STRING },
+{ "discard", T_Discard, FOLLBY_TOKEN },
+{ "reset", T_Reset, FOLLBY_TOKEN },
+{ "restrict", T_Restrict, FOLLBY_TOKEN },
+{ "rlimit", T_Rlimit, FOLLBY_TOKEN },
+{ "server", T_Server, FOLLBY_STRING },
+{ "setvar", T_Setvar, FOLLBY_STRING },
+{ "statistics", T_Statistics, FOLLBY_TOKEN },
+{ "statsdir", T_Statsdir, FOLLBY_STRING },
+{ "sys", T_Sys, FOLLBY_TOKEN },
+{ "tick", T_Tick, FOLLBY_TOKEN },
+{ "timer", T_Timer, FOLLBY_TOKEN },
+{ "tinker", T_Tinker, FOLLBY_TOKEN },
+{ "tos", T_Tos, FOLLBY_TOKEN },
+{ "trap", T_Trap, FOLLBY_STRING },
+{ "unconfig", T_Unconfig, FOLLBY_STRING },
+{ "unpeer", T_Unpeer, FOLLBY_STRING },
+/* authentication_command */
+{ "controlkey", T_ControlKey, FOLLBY_TOKEN },
+{ "crypto", T_Crypto, FOLLBY_TOKEN },
+{ "keys", T_Keys, FOLLBY_STRING },
+{ "keysdir", T_Keysdir, FOLLBY_STRING },
+{ "ntpsigndsocket", T_NtpSignDsocket, FOLLBY_STRING },
+{ "requestkey", T_Requestkey, FOLLBY_TOKEN },
+{ "revoke", T_Revoke, FOLLBY_TOKEN },
+{ "trustedkey", T_Trustedkey, FOLLBY_TOKEN },
+/* IPv4/IPv6 protocol override flag */
+{ "-4", T_Ipv4_flag, FOLLBY_TOKEN },
+{ "-6", T_Ipv6_flag, FOLLBY_TOKEN },
+/* option */
+{ "autokey", T_Autokey, FOLLBY_TOKEN },
+{ "burst", T_Burst, FOLLBY_TOKEN },
+{ "iburst", T_Iburst, FOLLBY_TOKEN },
+{ "key", T_Key, FOLLBY_TOKEN },
+{ "maxpoll", T_Maxpoll, FOLLBY_TOKEN },
+{ "minpoll", T_Minpoll, FOLLBY_TOKEN },
+{ "mode", T_Mode, FOLLBY_TOKEN },
+{ "noselect", T_Noselect, FOLLBY_TOKEN },
+{ "preempt", T_Preempt, FOLLBY_TOKEN },
+{ "true", T_True, FOLLBY_TOKEN },
+{ "prefer", T_Prefer, FOLLBY_TOKEN },
+{ "ttl", T_Ttl, FOLLBY_TOKEN },
+{ "version", T_Version, FOLLBY_TOKEN },
+{ "xleave", T_Xleave, FOLLBY_TOKEN },
+/* crypto_command */
+{ "host", T_Host, FOLLBY_STRING },
+{ "ident", T_Ident, FOLLBY_STRING },
+{ "pw", T_Pw, FOLLBY_STRING },
+{ "randfile", T_Randfile, FOLLBY_STRING },
+{ "digest", T_Digest, FOLLBY_STRING },
+/*** MONITORING COMMANDS ***/
+/* stat */
+{ "clockstats", T_Clockstats, FOLLBY_TOKEN },
+{ "cryptostats", T_Cryptostats, FOLLBY_TOKEN },
+{ "loopstats", T_Loopstats, FOLLBY_TOKEN },
+{ "peerstats", T_Peerstats, FOLLBY_TOKEN },
+{ "rawstats", T_Rawstats, FOLLBY_TOKEN },
+{ "sysstats", T_Sysstats, FOLLBY_TOKEN },
+{ "protostats", T_Protostats, FOLLBY_TOKEN },
+{ "timingstats", T_Timingstats, FOLLBY_TOKEN },
+/* filegen_option */
+{ "file", T_File, FOLLBY_STRING },
+{ "link", T_Link, FOLLBY_TOKEN },
+{ "nolink", T_Nolink, FOLLBY_TOKEN },
+{ "type", T_Type, FOLLBY_TOKEN },
+/* filegen_type */
+{ "age", T_Age, FOLLBY_TOKEN },
+{ "day", T_Day, FOLLBY_TOKEN },
+{ "month", T_Month, FOLLBY_TOKEN },
+{ "none", T_None, FOLLBY_TOKEN },
+{ "pid", T_Pid, FOLLBY_TOKEN },
+{ "week", T_Week, FOLLBY_TOKEN },
+{ "year", T_Year, FOLLBY_TOKEN },
+/*** ORPHAN MODE COMMANDS ***/
+/* tos_option */
+{ "minclock", T_Minclock, FOLLBY_TOKEN },
+{ "maxclock", T_Maxclock, FOLLBY_TOKEN },
+{ "minsane", T_Minsane, FOLLBY_TOKEN },
+{ "floor", T_Floor, FOLLBY_TOKEN },
+{ "ceiling", T_Ceiling, FOLLBY_TOKEN },
+{ "cohort", T_Cohort, FOLLBY_TOKEN },
+{ "mindist", T_Mindist, FOLLBY_TOKEN },
+{ "maxdist", T_Maxdist, FOLLBY_TOKEN },
+{ "beacon", T_Beacon, FOLLBY_TOKEN },
+{ "orphan", T_Orphan, FOLLBY_TOKEN },
+{ "orphanwait", T_Orphanwait, FOLLBY_TOKEN },
+{ "nonvolatile", T_Nonvolatile, FOLLBY_TOKEN },
+/* access_control_flag */
+{ "default", T_Default, FOLLBY_TOKEN },
+{ "source", T_Source, FOLLBY_TOKEN },
+{ "flake", T_Flake, FOLLBY_TOKEN },
+{ "ignore", T_Ignore, FOLLBY_TOKEN },
+{ "limited", T_Limited, FOLLBY_TOKEN },
+{ "mssntp", T_Mssntp, FOLLBY_TOKEN },
+{ "kod", T_Kod, FOLLBY_TOKEN },
+{ "lowpriotrap", T_Lowpriotrap, FOLLBY_TOKEN },
+{ "mask", T_Mask, FOLLBY_TOKEN },
+{ "nomodify", T_Nomodify, FOLLBY_TOKEN },
+{ "nomrulist", T_Nomrulist, FOLLBY_TOKEN },
+{ "nopeer", T_Nopeer, FOLLBY_TOKEN },
+{ "noquery", T_Noquery, FOLLBY_TOKEN },
+{ "noserve", T_Noserve, FOLLBY_TOKEN },
+{ "notrap", T_Notrap, FOLLBY_TOKEN },
+{ "notrust", T_Notrust, FOLLBY_TOKEN },
+{ "ntpport", T_Ntpport, FOLLBY_TOKEN },
+/* discard_option */
+{ "average", T_Average, FOLLBY_TOKEN },
+{ "minimum", T_Minimum, FOLLBY_TOKEN },
+{ "monitor", T_Monitor, FOLLBY_TOKEN },
+/* mru_option */
+{ "incalloc", T_Incalloc, FOLLBY_TOKEN },
+{ "incmem", T_Incmem, FOLLBY_TOKEN },
+{ "initalloc", T_Initalloc, FOLLBY_TOKEN },
+{ "initmem", T_Initmem, FOLLBY_TOKEN },
+{ "mindepth", T_Mindepth, FOLLBY_TOKEN },
+{ "maxage", T_Maxage, FOLLBY_TOKEN },
+{ "maxdepth", T_Maxdepth, FOLLBY_TOKEN },
+{ "maxmem", T_Maxmem, FOLLBY_TOKEN },
+{ "mru", T_Mru, FOLLBY_TOKEN },
+/* fudge_factor */
+{ "abbrev", T_Abbrev, FOLLBY_STRING },
+{ "flag1", T_Flag1, FOLLBY_TOKEN },
+{ "flag2", T_Flag2, FOLLBY_TOKEN },
+{ "flag3", T_Flag3, FOLLBY_TOKEN },
+{ "flag4", T_Flag4, FOLLBY_TOKEN },
+{ "refid", T_Refid, FOLLBY_STRING },
+{ "stratum", T_Stratum, FOLLBY_TOKEN },
+{ "time1", T_Time1, FOLLBY_TOKEN },
+{ "time2", T_Time2, FOLLBY_TOKEN },
+/* system_option */
+{ "auth", T_Auth, FOLLBY_TOKEN },
+{ "bclient", T_Bclient, FOLLBY_TOKEN },
+{ "calibrate", T_Calibrate, FOLLBY_TOKEN },
+{ "kernel", T_Kernel, FOLLBY_TOKEN },
+{ "ntp", T_Ntp, FOLLBY_TOKEN },
+{ "mode7", T_Mode7, FOLLBY_TOKEN },
+{ "stats", T_Stats, FOLLBY_TOKEN },
+/* rlimit_option */
+{ "memlock", T_Memlock, FOLLBY_TOKEN },
+{ "stacksize", T_Stacksize, FOLLBY_TOKEN },
+{ "filenum", T_Filenum, FOLLBY_TOKEN },
+/* tinker_option */
+{ "step", T_Step, FOLLBY_TOKEN },
+{ "panic", T_Panic, FOLLBY_TOKEN },
+{ "dispersion", T_Dispersion, FOLLBY_TOKEN },
+{ "stepout", T_Stepout, FOLLBY_TOKEN },
+{ "allan", T_Allan, FOLLBY_TOKEN },
+{ "huffpuff", T_Huffpuff, FOLLBY_TOKEN },
+{ "freq", T_Freq, FOLLBY_TOKEN },
+/* miscellaneous_command */
+{ "port", T_Port, FOLLBY_TOKEN },
+{ "interface", T_Interface, FOLLBY_TOKEN },
+{ "saveconfigdir", T_Saveconfigdir, FOLLBY_STRING },
+/* interface_command (ignore and interface already defined) */
+{ "nic", T_Nic, FOLLBY_TOKEN },
+{ "all", T_All, FOLLBY_TOKEN },
+{ "ipv4", T_Ipv4, FOLLBY_TOKEN },
+{ "ipv6", T_Ipv6, FOLLBY_TOKEN },
+{ "wildcard", T_Wildcard, FOLLBY_TOKEN },
+{ "listen", T_Listen, FOLLBY_TOKEN },
+{ "drop", T_Drop, FOLLBY_TOKEN },
+/* simulator commands */
+{ "simulate", T_Simulate, FOLLBY_TOKEN },
+{ "simulation_duration",T_Sim_Duration, FOLLBY_TOKEN },
+{ "beep_delay", T_Beep_Delay, FOLLBY_TOKEN },
+{ "duration", T_Duration, FOLLBY_TOKEN },
+{ "server_offset", T_Server_Offset, FOLLBY_TOKEN },
+{ "freq_offset", T_Freq_Offset, FOLLBY_TOKEN },
+{ "wander", T_Wander, FOLLBY_TOKEN },
+{ "jitter", T_Jitter, FOLLBY_TOKEN },
+{ "prop_delay", T_Prop_Delay, FOLLBY_TOKEN },
+{ "proc_delay", T_Proc_Delay, FOLLBY_TOKEN },
+};
+
+typedef struct big_scan_state_tag {
+ char ch; /* Character this state matches on */
+ char followedby; /* Forces next token(s) to T_String */
+ u_short finishes_token; /* nonzero ID if last keyword char */
+ u_short match_next_s; /* next state to check matching ch */
+ u_short other_next_s; /* next state to check if not ch */
+} big_scan_state;
+
+/*
+ * Note: to increase MAXSTATES beyond 2048, be aware it is currently
+ * crammed into 11 bits in scan_state form. Raising to 4096 would be
+ * relatively easy by storing the followedby value in a separate
+ * array with one entry per token, and shrinking the char value to
+ * 7 bits to free a bit for accepting/non-accepting. More than 4096
+ * states will require expanding scan_state beyond 32 bits each.
+ */
+#define MAXSTATES 2048
+#define MAX_TOK_LEN 63
+
+const char * current_keyword;/* for error reporting */
+big_scan_state sst[MAXSTATES]; /* scanner FSM state entries */
+u_short sst_highwater; /* next entry index to consider */
+char * symb[1024]; /* map token ID to symbolic name */
+
+/* for libntp */
+const char * progname = "keyword-gen";
+
+int main (int, char **);
+static void generate_preamble (void);
+static void generate_fsm (void);
+static void generate_token_text (void);
+static u_short create_keyword_scanner (void);
+static u_short create_scan_states (char *, u_short, follby, u_short);
+int compare_key_tok_id (const void *, const void *);
+int compare_key_tok_text (const void *, const void *);
+void populate_symb (char *);
+const char * symbname (u_short);
+
+
+int main(int argc, char **argv)
+{
+ if (argc < 2) {
+ fprintf(stderr, "Usage:\n%s t_header.h\n", argv[0]);
+ exit(1);
+ }
+ debug = 1;
+
+ populate_symb(argv[1]);
+
+ generate_preamble();
+ generate_token_text();
+ generate_fsm();
+
+ return 0;
+}
+
+
+static void
+generate_preamble(void)
+{
+ time_t now;
+ char timestamp[128];
+ char preamble[] =
+"/*\n"
+" * ntp_keyword.h\n"
+" * \n"
+" * NOTE: edit this file with caution, it is generated by keyword-gen.c\n"
+" *\t Generated %s UTC diff_ignore_line\n"
+" *\n"
+" */\n"
+"#include \"ntp_scanner.h\"\n"
+"#include \"ntp_parser.h\"\n"
+"\n";
+
+ time(&now);
+ if (!strftime(timestamp, sizeof(timestamp),
+ "%Y-%m-%d %H:%M:%S", gmtime(&now)))
+ timestamp[0] = '\0';
+
+ printf(preamble, timestamp);
+}
+
+
+static void
+generate_fsm(void)
+{
+ char rprefix[MAX_TOK_LEN + 1];
+ char prefix[MAX_TOK_LEN + 1];
+ char token_id_comment[16 + MAX_TOK_LEN + 1];
+ size_t prefix_len;
+ char *p;
+ char *r;
+ u_short initial_state;
+ u_short this_state;
+ u_short prev_state;
+ u_short state;
+ u_short i;
+ u_short token;
+
+ /*
+ * Sort ntp_keywords in alphabetical keyword order. This is
+ * not necessary, but minimizes nonfunctional changes in the
+ * generated finite state machine when keywords are modified.
+ */
+ qsort(ntp_keywords, COUNTOF(ntp_keywords),
+ sizeof(ntp_keywords[0]), compare_key_tok_text);
+
+ /*
+ * To save space, reserve the state array entry matching each
+ * token number for its terminal state, so the token identifier
+ * does not need to be stored in each state, but can be
+ * recovered trivially. To mark the entry reserved,
+ * finishes_token is nonzero.
+ */
+
+ for (i = 0; i < COUNTOF(ntp_keywords); i++) {
+ token = ntp_keywords[i].token;
+ if (1 > token || token >= COUNTOF(sst)) {
+ fprintf(stderr,
+ "keyword-gen sst[%u] too small "
+ "for keyword '%s' id %d\n",
+ COUNTOF(sst),
+ ntp_keywords[i].key,
+ token);
+ exit(4);
+ }
+ sst[token].finishes_token = token;
+ }
+
+ initial_state = create_keyword_scanner();
+
+ fprintf(stderr,
+ "%d keywords consumed %d states of %d max.\n",
+ (int)COUNTOF(ntp_keywords),
+ sst_highwater - 1,
+ (int)COUNTOF(sst) - 1);
+
+ printf("#define SCANNER_INIT_S %d\n\n", initial_state);
+
+ printf("const scan_state sst[%d] = {\n"
+ "/*SS_T( ch,\tf-by, match, other ),\t\t\t\t */\n"
+ " 0,\t\t\t\t /* %5d %-17s */\n",
+ sst_highwater,
+ 0, "");
+
+ for (i = 1; i < sst_highwater; i++) {
+
+ /* verify fields will fit */
+ if (sst[i].followedby & ~0x3) {
+ fprintf(stderr,
+ "keyword-gen internal error "
+ "sst[%d].followedby %d too big\n",
+ i, sst[i].followedby);
+ exit(7);
+ }
+
+ if (sst_highwater <= sst[i].match_next_s
+ || sst[i].match_next_s & ~0x7ff) {
+ fprintf(stderr,
+ "keyword-gen internal error "
+ "sst[%d].match_next_s %d too big\n",
+ i, sst[i].match_next_s);
+ exit(8);
+ }
+
+ if (sst_highwater <= sst[i].other_next_s
+ || sst[i].other_next_s & ~0x7ff) {
+ fprintf(stderr,
+ "keyword-gen internal error "
+ "sst[%d].other_next_s %d too big\n",
+ i, sst[i].other_next_s);
+ exit(9);
+ }
+
+ if (sst[i].finishes_token) {
+ snprintf(token_id_comment,
+ sizeof(token_id_comment), "%5d %-17s",
+ i, symbname(sst[i].finishes_token));
+ if (i != sst[i].finishes_token) {
+ fprintf(stderr,
+ "keyword-gen internal error "
+ "entry %d finishes token %d\n",
+ i, sst[i].finishes_token);
+ exit(5);
+ }
+ } else {
+ /*
+ * Determine the keyword prefix that leads to this
+ * state. This is expensive but keyword-gen is run
+ * only when it changes. Distributing keyword-gen-utd
+ * achieves that, which is why it must be committed
+ * at the same time as keyword-gen.c and ntp_keyword.h.
+ *
+ * Scan the state array iteratively looking for a state
+ * which leads to the current one, collecting matching
+ * characters along the way. There is only one such
+ * path back to the starting state given the way our
+ * scanner state machine is built and the practice of
+ * using the spelling of the keyword as its T_* token
+ * identifier, which results in never having two
+ * spellings result in the same T_* value.
+ */
+ prefix_len = 0;
+ prev_state = 0;
+ this_state = i;
+ do {
+ for (state = 1; state < sst_highwater; state++)
+ if (sst[state].other_next_s == this_state) {
+ this_state = state;
+ break;
+ } else if (sst[state].match_next_s == this_state) {
+ this_state = state;
+ rprefix[prefix_len] = sst[state].ch;
+ prefix_len++;
+ break;
+ }
+ } while (this_state != initial_state);
+
+ if (prefix_len) {
+ /* reverse rprefix into prefix */
+ p = prefix + prefix_len;
+ r = rprefix;
+ while (r < rprefix + prefix_len)
+ *--p = *r++;
+ }
+ prefix[prefix_len] = '\0';
+
+ snprintf(token_id_comment,
+ sizeof(token_id_comment), "%5d %-17s",
+ i, (initial_state == i)
+ ? "[initial state]"
+ : prefix);
+ }
+
+ printf(" S_ST( '%c',\t%d, %5u, %5u )%s /* %s */\n",
+ sst[i].ch,
+ sst[i].followedby,
+ sst[i].match_next_s,
+ sst[i].other_next_s,
+ (i + 1 < sst_highwater)
+ ? ","
+ : " ",
+ token_id_comment);
+ }
+
+ printf("};\n\n");
+}
+
+
+/* Define a function to create the states of the scanner. This function
+ * is used by the create_keyword_scanner function below.
+ *
+ * This function takes a suffix of a keyword, the token to be returned on
+ * recognizing the complete keyword, and any pre-existing state that exists
+ * for some other keyword that has the same prefix as the current one.
+ */
+static u_short
+create_scan_states(
+ char * text,
+ u_short token,
+ follby followedby,
+ u_short prev_state
+ )
+{
+ u_short my_state;
+ u_short return_state;
+ u_short prev_char_s;
+ u_short curr_char_s;
+
+ return_state = prev_state;
+ curr_char_s = prev_state;
+ prev_char_s = 0;
+
+ /* Find the correct position to insert the state.
+ * All states should be in alphabetical order
+ */
+ while (curr_char_s && (text[0] < sst[curr_char_s].ch)) {
+ prev_char_s = curr_char_s;
+ curr_char_s = sst[curr_char_s].other_next_s;
+ }
+
+ /*
+ * Check if a previously seen keyword has the same prefix as
+ * the current keyword. If so, simply use the state for that
+ * keyword as my_state, otherwise, allocate a new state.
+ */
+ if (curr_char_s && (text[0] == sst[curr_char_s].ch)) {
+ my_state = curr_char_s;
+ if ('\0' == text[1]) {
+ fprintf(stderr,
+ "Duplicate entries for keyword '%s' in"
+ " keyword_gen.c ntp_keywords[].\n",
+ current_keyword);
+ exit(2);
+ }
+ } else {
+ do
+ my_state = sst_highwater++;
+ while (my_state < COUNTOF(sst)
+ && sst[my_state].finishes_token);
+ if (my_state >= COUNTOF(sst)) {
+ fprintf(stderr,
+ "fatal, keyword scanner state array "
+ "sst[%d] is too small, modify\n"
+ "keyword-gen.c to increase.\n",
+ (int)COUNTOF(sst));
+ exit(3);
+ }
+ /* Store the next character of the keyword */
+ sst[my_state].ch = text[0];
+ sst[my_state].other_next_s = curr_char_s;
+ sst[my_state].followedby = FOLLBY_NON_ACCEPTING;
+
+ if (prev_char_s)
+ sst[prev_char_s].other_next_s = my_state;
+ else
+ return_state = my_state;
+ }
+
+ /* Check if the next character is '\0'.
+ * If yes, we are done with the recognition and this is an accepting
+ * state.
+ * If not, we need to continue scanning
+ */
+ if ('\0' == text[1]) {
+ sst[my_state].finishes_token = (u_short)token;
+ sst[my_state].followedby = (char)followedby;
+
+ if (sst[token].finishes_token != (u_short)token) {
+ fprintf(stderr,
+ "fatal, sst[%d] not reserved for %s.\n",
+ token, symbname(token));
+ exit(6);
+ }
+ /* relocate so token id is sst[] index */
+ if (my_state != token) {
+ sst[token] = sst[my_state];
+ ZERO(sst[my_state]);
+ do
+ sst_highwater--;
+ while (sst[sst_highwater].finishes_token);
+ my_state = token;
+ if (prev_char_s)
+ sst[prev_char_s].other_next_s = my_state;
+ else
+ return_state = my_state;
+ }
+ } else
+ sst[my_state].match_next_s =
+ create_scan_states(
+ &text[1],
+ token,
+ followedby,
+ sst[my_state].match_next_s);
+
+ return return_state;
+}
+
+
+/* Define a function that takes a list of (keyword, token) values and
+ * creates a keywords scanner out of it.
+ */
+
+static u_short
+create_keyword_scanner(void)
+{
+ u_short scanner;
+ u_short i;
+
+ sst_highwater = 1; /* index 0 invalid, unused */
+ scanner = 0;
+
+ for (i = 0; i < COUNTOF(ntp_keywords); i++) {
+ current_keyword = ntp_keywords[i].key;
+ scanner =
+ create_scan_states(
+ ntp_keywords[i].key,
+ ntp_keywords[i].token,
+ ntp_keywords[i].followedby,
+ scanner);
+ }
+
+ return scanner;
+}
+
+
+static void
+generate_token_text(void)
+{
+ u_short lowest_id;
+ u_short highest_id;
+ u_short id_count;
+ u_short id;
+ u_short i;
+
+ /* sort ntp_keywords in token ID order */
+ qsort(ntp_keywords, COUNTOF(ntp_keywords),
+ sizeof(ntp_keywords[0]), compare_key_tok_id);
+
+ lowest_id = ntp_keywords[0].token;
+ highest_id = ntp_keywords[COUNTOF(ntp_keywords) - 1].token;
+ id_count = highest_id - lowest_id + 1;
+
+ printf("#define LOWEST_KEYWORD_ID %d\n\n", lowest_id);
+
+ printf("const char * const keyword_text[%d] = {", id_count);
+
+ id = lowest_id;
+ i = 0;
+ while (i < COUNTOF(ntp_keywords)) {
+ while (id < ntp_keywords[i].token) {
+ printf(",\n\t/* %-5d %5d %20s */\tNULL",
+ id - lowest_id, id, symbname(id));
+ id++;
+ }
+ if (i > 0)
+ printf(",");
+ printf("\n\t/* %-5d %5d %20s */\t\"%s\"",
+ id - lowest_id, id, symbname(id),
+ ntp_keywords[i].key);
+ i++;
+ id++;
+ }
+
+ printf("\n};\n\n");
+}
+
+
+int
+compare_key_tok_id(
+ const void *a1,
+ const void *a2
+ )
+{
+ const struct key_tok *p1 = a1;
+ const struct key_tok *p2 = a2;
+
+ if (p1->token == p2->token)
+ return 0;
+
+ if (p1->token < p2->token)
+ return -1;
+ else
+ return 1;
+}
+
+
+int
+compare_key_tok_text(
+ const void *a1,
+ const void *a2
+ )
+{
+ const struct key_tok *p1 = a1;
+ const struct key_tok *p2 = a2;
+
+ return strcmp(p1->key, p2->key);
+}
+
+
+/*
+ * populate_symb() - populate symb[] lookup array with symbolic token
+ * names such that symb[T_Age] == "T_Age", etc.
+ */
+void
+populate_symb(
+ char *header_file
+ )
+{
+ FILE * yh;
+ char line[2 * MAX_TOK_LEN];
+ char name[2 * MAX_TOK_LEN];
+ int token;
+
+ yh = fopen(header_file, "r");
+ if (NULL == yh) {
+ perror("unable to open yacc/bison header file");
+ exit(4);
+ }
+
+ while (NULL != fgets(line, sizeof(line), yh))
+ if (2 == sscanf(line, "#define %s %d", name, &token)
+ && 'T' == name[0] && '_' == name[1] && token >= 0
+ && token < COUNTOF(symb)) {
+
+ symb[token] = estrdup(name);
+ if (strlen(name) > MAX_TOK_LEN) {
+ fprintf(stderr,
+ "MAX_TOK_LEN %d too small for '%s'\n"
+ "Edit keyword-gen.c to raise.\n",
+ MAX_TOK_LEN, name);
+ exit(10);
+ }
+ }
+ fclose(yh);
+}
+
+
+const char *
+symbname(
+ u_short token
+ )
+{
+ char *name;
+
+ if (token < COUNTOF(symb) && symb[token] != NULL) {
+ name = symb[token];
+ } else {
+ LIB_GETBUF(name);
+ snprintf(name, LIB_BUFLENGTH, "%d", token);
+ }
+
+ return name;
+}
diff --git a/ntpd/ntp.conf.5man b/ntpd/ntp.conf.5man
new file mode 100644
index 0000000..389f23e
--- /dev/null
+++ b/ntpd/ntp.conf.5man
@@ -0,0 +1,3004 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp.conf 5man "02 Dec 2014" "4.2.7p482" "File Formats"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7eaizK/ag-wfaayK)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:37 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.conf.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp.conf\fP
+\- Network Time Protocol (NTP) daemon configuration file format
+.SH SYNOPSIS
+\f\*[B-Font]ntp.conf\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The
+\f\*[B-Font]ntp.conf\fP
+configuration file is read at initial startup by the
+\fCntpd\fR(1ntpdmdoc)\f[]
+daemon in order to specify the synchronization sources,
+modes and other related information.
+Usually, it is installed in the
+\fI/etc\f[]
+directory,
+but could be installed elsewhere
+(see the daemon's
+\f\*[B-Font]\-c\f[]
+command line option).
+.sp \n(Ppu
+.ne 2
+
+The file format is similar to other
+UNIX
+configuration files.
+Comments begin with a
+\[oq]#\[cq]
+character and extend to the end of the line;
+blank lines are ignored.
+Configuration commands consist of an initial keyword
+followed by a list of arguments,
+some of which may be optional, separated by whitespace.
+Commands may not be continued over multiple lines.
+Arguments may be host names,
+host addresses written in numeric, dotted-quad form,
+integers, floating point numbers (when specifying times in seconds)
+and text strings.
+.sp \n(Ppu
+.ne 2
+
+The rest of this page describes the configuration and control options.
+The
+"Notes on Configuring NTP and Setting up an NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+contains an extended discussion of these options.
+In addition to the discussion of general
+\fIConfiguration\f[] \fIOptions\f[],
+there are sections describing the following supported functionality
+and the options used to control it:
+.IP \fB\(bu\fP 2
+\fIAuthentication\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIMonitoring\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIAccess\f[] \fIControl\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIAutomatic\f[] \fINTP\f[] \fIConfiguration\f[] \fIOptions\f[]
+.IP \fB\(bu\fP 2
+\fIReference\f[] \fIClock\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIMiscellaneous\f[] \fIOptions\f[]
+.PP
+.sp \n(Ppu
+.ne 2
+
+Following these is a section describing
+\fIMiscellaneous\f[] \fIOptions\f[].
+While there is a rich set of options available,
+the only required option is one or more
+\f\*[B-Font]pool\f[],
+\f\*[B-Font]server\f[],
+\f\*[B-Font]peer\f[],
+\f\*[B-Font]broadcast\f[]
+or
+\f\*[B-Font]manycastclient\f[]
+commands.
+.SH Configuration Support
+Following is a description of the configuration commands in
+NTPv4.
+These commands have the same basic functions as in NTPv3 and
+in some cases new functions and new arguments.
+There are two
+classes of commands, configuration commands that configure a
+persistent association with a remote server or peer or reference
+clock, and auxiliary commands that specify environmental variables
+that control various related operations.
+.SS Configuration Commands
+The various modes are determined by the command keyword and the
+type of the required IP address.
+Addresses are classed by type as
+(s) a remote server or peer (IPv4 class A, B and C), (b) the
+broadcast address of a local interface, (m) a multicast address (IPv4
+class D), or (r) a reference clock address (127.127.x.x).
+Note that
+only those options applicable to each command are listed below.
+Use
+of options not listed may not be caught as an error, but may result
+in some weird and even destructive behavior.
+.sp \n(Ppu
+.ne 2
+
+If the Basic Socket Interface Extensions for IPv6 (RFC-2553)
+is detected, support for the IPv6 address family is generated
+in addition to the default support of the IPv4 address family.
+In a few cases, including the reslist billboard generated
+by ntpdc, IPv6 addresses are automatically generated.
+IPv6 addresses can be identified by the presence of colons
+\*[Lq]\&:\*[Rq]
+in the address field.
+IPv6 addresses can be used almost everywhere where
+IPv4 addresses can be used,
+with the exception of reference clock addresses,
+which are always IPv4.
+.sp \n(Ppu
+.ne 2
+
+Note that in contexts where a host name is expected, a
+\f\*[B-Font]\-4\f[]
+qualifier preceding
+the host name forces DNS resolution to the IPv4 namespace,
+while a
+\f\*[B-Font]\-6\f[]
+qualifier forces DNS resolution to the IPv6 namespace.
+See IPv6 references for the
+equivalent classes for that address family.
+.TP 7
+.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
+.TP 7
+.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
+.TP 7
+.NOP \f\*[B-Font]peer\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
+.TP 7
+.NOP \f\*[B-Font]broadcast\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]ttl\f[] \f\*[I-Font]ttl\f[]]
+.TP 7
+.NOP \f\*[B-Font]manycastclient\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]ttl\f[] \f\*[I-Font]ttl\f[]]
+.PP
+.sp \n(Ppu
+.ne 2
+
+These five commands specify the time server name or address to
+be used and the mode in which to operate.
+The
+\f\*[I-Font]address\f[]
+can be
+either a DNS name or an IP address in dotted-quad notation.
+Additional information on association behavior can be found in the
+"Association Management"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.TP 7
+.NOP \f\*[B-Font]pool\f[]
+For type s addresses, this command mobilizes a persistent
+client mode association with a number of remote servers.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+.TP 7
+.NOP \f\*[B-Font]server\f[]
+For type s and r addresses, this command mobilizes a persistent
+client mode association with the specified remote server or local
+radio clock.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+This command should
+\fInot\f[]
+be used for type
+b or m addresses.
+.TP 7
+.NOP \f\*[B-Font]peer\f[]
+For type s addresses (only), this command mobilizes a
+persistent symmetric-active mode association with the specified
+remote peer.
+In this mode the local clock can be synchronized to
+the remote peer or the remote peer can be synchronized to the local
+clock.
+This is useful in a network of servers where, depending on
+various failure scenarios, either the local or remote peer may be
+the better source of time.
+This command should NOT be used for type
+b, m or r addresses.
+.TP 7
+.NOP \f\*[B-Font]broadcast\f[]
+For type b and m addresses (only), this
+command mobilizes a persistent broadcast mode association.
+Multiple
+commands can be used to specify multiple local broadcast interfaces
+(subnets) and/or multiple multicast groups.
+Note that local
+broadcast messages go only to the interface associated with the
+subnet specified, but multicast messages go to all interfaces.
+In broadcast mode the local server sends periodic broadcast
+messages to a client population at the
+\f\*[I-Font]address\f[]
+specified, which is usually the broadcast address on (one of) the
+local network(s) or a multicast address assigned to NTP.
+The IANA
+has assigned the multicast group address IPv4 224.0.1.1 and
+IPv6 ff05::101 (site local) exclusively to
+NTP, but other nonconflicting addresses can be used to contain the
+messages within administrative boundaries.
+Ordinarily, this
+specification applies only to the local server operating as a
+sender; for operation as a broadcast client, see the
+\f\*[B-Font]broadcastclient\f[]
+or
+\f\*[B-Font]multicastclient\f[]
+commands
+below.
+.TP 7
+.NOP \f\*[B-Font]manycastclient\f[]
+For type m addresses (only), this command mobilizes a
+manycast client mode association for the multicast address
+specified.
+In this case a specific address must be supplied which
+matches the address used on the
+\f\*[B-Font]manycastserver\f[]
+command for
+the designated manycast servers.
+The NTP multicast address
+224.0.1.1 assigned by the IANA should NOT be used, unless specific
+means are taken to avoid spraying large areas of the Internet with
+these messages and causing a possibly massive implosion of replies
+at the sender.
+The
+\f\*[B-Font]manycastserver\f[]
+command specifies that the local server
+is to operate in client mode with the remote servers that are
+discovered as the result of broadcast/multicast messages.
+The
+client broadcasts a request message to the group address associated
+with the specified
+\f\*[I-Font]address\f[]
+and specifically enabled
+servers respond to these messages.
+The client selects the servers
+providing the best time and continues as with the
+\f\*[B-Font]server\f[]
+command.
+The remaining servers are discarded as if never
+heard.
+.PP
+.sp \n(Ppu
+.ne 2
+
+Options:
+.TP 7
+.NOP \f\*[B-Font]autokey\f[]
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the autokey scheme
+described in
+\fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]burst\f[]
+when the server is reachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first and second packets
+can be changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to improve timekeeping quality
+with the
+\f\*[B-Font]server\f[]
+command and s addresses.
+.TP 7
+.NOP \f\*[B-Font]iburst\f[]
+When the server is unreachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first two packets can be
+changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to speed the initial synchronization
+acquisition with the
+\f\*[B-Font]server\f[]
+command and s addresses and when
+\fCntpd\fR(1ntpdmdoc)\f[]
+is started with the
+\f\*[B-Font]\-q\f[]
+option.
+.TP 7
+.NOP \f\*[B-Font]key\f[] \f\*[I-Font]key\f[]
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the specified
+\f\*[I-Font]key\f[]
+identifier with values from 1 to 65534, inclusive.
+The
+default is to include no encryption field.
+.TP 7
+.NOP \f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]
+.TP 7
+.NOP \f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]
+These options specify the minimum and maximum poll intervals
+for NTP messages, as a power of 2 in seconds
+The maximum poll
+interval defaults to 10 (1,024 s), but can be increased by the
+\f\*[B-Font]maxpoll\f[]
+option to an upper limit of 17 (36.4 h).
+The
+minimum poll interval defaults to 6 (64 s), but can be decreased by
+the
+\f\*[B-Font]minpoll\f[]
+option to a lower limit of 4 (16 s).
+.TP 7
+.NOP \f\*[B-Font]noselect\f[]
+Marks the server as unused, except for display purposes.
+The server is discarded by the selection algroithm.
+.TP 7
+.NOP \f\*[B-Font]prefer\f[]
+Marks the server as preferred.
+All other things being equal,
+this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+for further information.
+.TP 7
+.NOP \f\*[B-Font]ttl\f[] \f\*[I-Font]ttl\f[]
+This option is used only with broadcast server and manycast
+client modes.
+It specifies the time-to-live
+\f\*[I-Font]ttl\f[]
+to
+use on broadcast server and multicast server and the maximum
+\f\*[I-Font]ttl\f[]
+for the expanding ring search with manycast
+client packets.
+Selection of the proper value, which defaults to
+127, is something of a black art and should be coordinated with the
+network administrator.
+.TP 7
+.NOP \f\*[B-Font]version\f[] \f\*[I-Font]version\f[]
+Specifies the version number to be used for outgoing NTP
+packets.
+Versions 1-4 are the choices, with version 4 the
+default.
+.PP
+.SS Auxiliary Commands
+.TP 7
+.NOP \f\*[B-Font]broadcastclient\f[]
+This command enables reception of broadcast server messages to
+any local interface (type b) address.
+Upon receiving a message for
+the first time, the broadcast client measures the nominal server
+propagation delay using a brief client/server exchange with the
+server, then enters the broadcast client mode, in which it
+synchronizes to succeeding broadcast messages.
+Note that, in order
+to avoid accidental or malicious disruption in this mode, both the
+server and client should operate using symmetric-key or public-key
+authentication as described in
+\fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]manycastserver\f[] \f\*[I-Font]address\f[] \f\*[I-Font]...\f[]
+This command enables reception of manycast client messages to
+the multicast group address(es) (type m) specified.
+At least one
+address is required, but the NTP multicast address 224.0.1.1
+assigned by the IANA should NOT be used, unless specific means are
+taken to limit the span of the reply and avoid a possibly massive
+implosion at the original sender.
+Note that, in order to avoid
+accidental or malicious disruption in this mode, both the server
+and client should operate using symmetric-key or public-key
+authentication as described in
+\fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]multicastclient\f[] \f\*[I-Font]address\f[] \f\*[I-Font]...\f[]
+This command enables reception of multicast server messages to
+the multicast group address(es) (type m) specified.
+Upon receiving
+a message for the first time, the multicast client measures the
+nominal server propagation delay using a brief client/server
+exchange with the server, then enters the broadcast client mode, in
+which it synchronizes to succeeding multicast messages.
+Note that,
+in order to avoid accidental or malicious disruption in this mode,
+both the server and client should operate using symmetric-key or
+public-key authentication as described in
+\fIAuthentication\f[] \fIOptions\f[].
+.PP
+.SH Authentication Support
+Authentication support allows the NTP client to verify that the
+server is in fact known and trusted and not an intruder intending
+accidentally or on purpose to masquerade as that server.
+The NTPv3
+specification RFC-1305 defines a scheme which provides
+cryptographic authentication of received NTP packets.
+Originally,
+this was done using the Data Encryption Standard (DES) algorithm
+operating in Cipher Block Chaining (CBC) mode, commonly called
+DES-CBC.
+Subsequently, this was replaced by the RSA Message Digest
+5 (MD5) algorithm using a private key, commonly called keyed-MD5.
+Either algorithm computes a message digest, or one-way hash, which
+can be used to verify the server has the correct private key and
+key identifier.
+.sp \n(Ppu
+.ne 2
+
+NTPv4 retains the NTPv3 scheme, properly described as symmetric key
+cryptography and, in addition, provides a new Autokey scheme
+based on public key cryptography.
+Public key cryptography is generally considered more secure
+than symmetric key cryptography, since the security is based
+on a private value which is generated by each server and
+never revealed.
+With Autokey all key distribution and
+management functions involve only public values, which
+considerably simplifies key distribution and storage.
+Public key management is based on X.509 certificates,
+which can be provided by commercial services or
+produced by utility programs in the OpenSSL software library
+or the NTPv4 distribution.
+.sp \n(Ppu
+.ne 2
+
+While the algorithms for symmetric key cryptography are
+included in the NTPv4 distribution, public key cryptography
+requires the OpenSSL software library to be installed
+before building the NTP distribution.
+Directions for doing that
+are on the Building and Installing the Distribution page.
+.sp \n(Ppu
+.ne 2
+
+Authentication is configured separately for each association
+using the
+\f\*[B-Font]key\f[]
+or
+\f\*[B-Font]autokey\f[]
+subcommand on the
+\f\*[B-Font]peer\f[],
+\f\*[B-Font]server\f[],
+\f\*[B-Font]broadcast\f[]
+and
+\f\*[B-Font]manycastclient\f[]
+configuration commands as described in
+\fIConfiguration\f[] \fIOptions\f[]
+page.
+The authentication
+options described below specify the locations of the key files,
+if other than default, which symmetric keys are trusted
+and the interval between various operations, if other than default.
+.sp \n(Ppu
+.ne 2
+
+Authentication is always enabled,
+although ineffective if not configured as
+described below.
+If a NTP packet arrives
+including a message authentication
+code (MAC), it is accepted only if it
+passes all cryptographic checks.
+The
+checks require correct key ID, key value
+and message digest.
+If the packet has
+been modified in any way or replayed
+by an intruder, it will fail one or more
+of these checks and be discarded.
+Furthermore, the Autokey scheme requires a
+preliminary protocol exchange to obtain
+the server certificate, verify its
+credentials and initialize the protocol
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]auth\f[]
+flag controls whether new associations or
+remote configuration commands require cryptographic authentication.
+This flag can be set or reset by the
+\f\*[B-Font]enable\f[]
+and
+\f\*[B-Font]disable\f[]
+commands and also by remote
+configuration commands sent by a
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+program running in
+another machine.
+If this flag is enabled, which is the default
+case, new broadcast client and symmetric passive associations and
+remote configuration commands must be cryptographically
+authenticated using either symmetric key or public key cryptography.
+If this
+flag is disabled, these operations are effective
+even if not cryptographic
+authenticated.
+It should be understood
+that operating with the
+\f\*[B-Font]auth\f[]
+flag disabled invites a significant vulnerability
+where a rogue hacker can
+masquerade as a falseticker and seriously
+disrupt system timekeeping.
+It is
+important to note that this flag has no purpose
+other than to allow or disallow
+a new association in response to new broadcast
+and symmetric active messages
+and remote configuration commands and, in particular,
+the flag has no effect on
+the authentication process itself.
+.sp \n(Ppu
+.ne 2
+
+An attractive alternative where multicast support is available
+is manycast mode, in which clients periodically troll
+for servers as described in the
+\fIAutomatic\f[] \fINTP\f[] \fIConfiguration\f[] \fIOptions\f[]
+page.
+Either symmetric key or public key
+cryptographic authentication can be used in this mode.
+The principle advantage
+of manycast mode is that potential servers need not be
+configured in advance,
+since the client finds them during regular operation,
+and the configuration
+files for all clients can be identical.
+.sp \n(Ppu
+.ne 2
+
+The security model and protocol schemes for
+both symmetric key and public key
+cryptography are summarized below;
+further details are in the briefings, papers
+and reports at the NTP project page linked from
+\f[C]http://www.ntp.org/\f[].
+.SS Symmetric-Key Cryptography
+The original RFC-1305 specification allows any one of possibly
+65,534 keys, each distinguished by a 32-bit key identifier, to
+authenticate an association.
+The servers and clients involved must
+agree on the key and key identifier to
+authenticate NTP packets.
+Keys and
+related information are specified in a key
+file, usually called
+\fIntp.keys\f[],
+which must be distributed and stored using
+secure means beyond the scope of the NTP protocol itself.
+Besides the keys used
+for ordinary NTP associations,
+additional keys can be used as passwords for the
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utility programs.
+.sp \n(Ppu
+.ne 2
+
+When
+\fCntpd\fR(1ntpdmdoc)\f[]
+is first started, it reads the key file specified in the
+\f\*[B-Font]keys\f[]
+configuration command and installs the keys
+in the key cache.
+However,
+individual keys must be activated with the
+\f\*[B-Font]trusted\f[]
+command before use.
+This
+allows, for instance, the installation of possibly
+several batches of keys and
+then activating or deactivating each batch
+remotely using
+\fCntpdc\fR(1ntpdcmdoc)\f[].
+This also provides a revocation capability that can be used
+if a key becomes compromised.
+The
+\f\*[B-Font]requestkey\f[]
+command selects the key used as the password for the
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utility, while the
+\f\*[B-Font]controlkey\f[]
+command selects the key used as the password for the
+\fCntpq\fR(1ntpqmdoc)\f[]
+utility.
+.SS Public Key Cryptography
+NTPv4 supports the original NTPv3 symmetric key scheme
+described in RFC-1305 and in addition the Autokey protocol,
+which is based on public key cryptography.
+The Autokey Version 2 protocol described on the Autokey Protocol
+page verifies packet integrity using MD5 message digests
+and verifies the source with digital signatures and any of several
+digest/signature schemes.
+Optional identity schemes described on the Identity Schemes
+page and based on cryptographic challenge/response algorithms
+are also available.
+Using all of these schemes provides strong security against
+replay with or without modification, spoofing, masquerade
+and most forms of clogging attacks.
+.\" .Pp
+.\" The cryptographic means necessary for all Autokey operations
+.\" is provided by the OpenSSL software library.
+.\" This library is available from http://www.openssl.org/
+.\" and can be installed using the procedures outlined
+.\" in the Building and Installing the Distribution page.
+.\" Once installed,
+.\" the configure and build
+.\" process automatically detects the library and links
+.\" the library routines required.
+.sp \n(Ppu
+.ne 2
+
+The Autokey protocol has several modes of operation
+corresponding to the various NTP modes supported.
+Most modes use a special cookie which can be
+computed independently by the client and server,
+but encrypted in transmission.
+All modes use in addition a variant of the S-KEY scheme,
+in which a pseudo-random key list is generated and used
+in reverse order.
+These schemes are described along with an executive summary,
+current status, briefing slides and reading list on the
+\fIAutonomous\f[] \fIAuthentication\f[]
+page.
+.sp \n(Ppu
+.ne 2
+
+The specific cryptographic environment used by Autokey servers
+and clients is determined by a set of files
+and soft links generated by the
+\fCntp-keygen\fR(1ntpkeygenmdoc)\f[]
+program.
+This includes a required host key file,
+required certificate file and optional sign key file,
+leapsecond file and identity scheme files.
+The
+digest/signature scheme is specified in the X.509 certificate
+along with the matching sign key.
+There are several schemes
+available in the OpenSSL software library, each identified
+by a specific string such as
+\f\*[B-Font]md5WithRSAEncryption\f[],
+which stands for the MD5 message digest with RSA
+encryption scheme.
+The current NTP distribution supports
+all the schemes in the OpenSSL library, including
+those based on RSA and DSA digital signatures.
+.sp \n(Ppu
+.ne 2
+
+NTP secure groups can be used to define cryptographic compartments
+and security hierarchies.
+It is important that every host
+in the group be able to construct a certificate trail to one
+or more trusted hosts in the same group.
+Each group
+host runs the Autokey protocol to obtain the certificates
+for all hosts along the trail to one or more trusted hosts.
+This requires the configuration file in all hosts to be
+engineered so that, even under anticipated failure conditions,
+the NTP subnet will form such that every group host can find
+a trail to at least one trusted host.
+.SS Naming and Addressing
+It is important to note that Autokey does not use DNS to
+resolve addresses, since DNS can't be completely trusted
+until the name servers have synchronized clocks.
+The cryptographic name used by Autokey to bind the host identity
+credentials and cryptographic values must be independent
+of interface, network and any other naming convention.
+The name appears in the host certificate in either or both
+the subject and issuer fields, so protection against
+DNS compromise is essential.
+.sp \n(Ppu
+.ne 2
+
+By convention, the name of an Autokey host is the name returned
+by the Unix
+\fCgethostname\fR(2)\f[]
+system call or equivalent in other systems.
+By the system design
+model, there are no provisions to allow alternate names or aliases.
+However, this is not to say that DNS aliases, different names
+for each interface, etc., are constrained in any way.
+.sp \n(Ppu
+.ne 2
+
+It is also important to note that Autokey verifies authenticity
+using the host name, network address and public keys,
+all of which are bound together by the protocol specifically
+to deflect masquerade attacks.
+For this reason Autokey
+includes the source and destinatino IP addresses in message digest
+computations and so the same addresses must be available
+at both the server and client.
+For this reason operation
+with network address translation schemes is not possible.
+This reflects the intended robust security model where government
+and corporate NTP servers are operated outside firewall perimeters.
+.SS Operation
+A specific combination of authentication scheme (none,
+symmetric key, public key) and identity scheme is called
+a cryptotype, although not all combinations are compatible.
+There may be management configurations where the clients,
+servers and peers may not all support the same cryptotypes.
+A secure NTPv4 subnet can be configured in many ways while
+keeping in mind the principles explained above and
+in this section.
+Note however that some cryptotype
+combinations may successfully interoperate with each other,
+but may not represent good security practice.
+.sp \n(Ppu
+.ne 2
+
+The cryptotype of an association is determined at the time
+of mobilization, either at configuration time or some time
+later when a message of appropriate cryptotype arrives.
+When mobilized by a
+\f\*[B-Font]server\f[]
+or
+\f\*[B-Font]peer\f[]
+configuration command and no
+\f\*[B-Font]key\f[]
+or
+\f\*[B-Font]autokey\f[]
+subcommands are present, the association is not
+authenticated; if the
+\f\*[B-Font]key\f[]
+subcommand is present, the association is authenticated
+using the symmetric key ID specified; if the
+\f\*[B-Font]autokey\f[]
+subcommand is present, the association is authenticated
+using Autokey.
+.sp \n(Ppu
+.ne 2
+
+When multiple identity schemes are supported in the Autokey
+protocol, the first message exchange determines which one is used.
+The client request message contains bits corresponding
+to which schemes it has available.
+The server response message
+contains bits corresponding to which schemes it has available.
+Both server and client match the received bits with their own
+and select a common scheme.
+.sp \n(Ppu
+.ne 2
+
+Following the principle that time is a public value,
+a server responds to any client packet that matches
+its cryptotype capabilities.
+Thus, a server receiving
+an unauthenticated packet will respond with an unauthenticated
+packet, while the same server receiving a packet of a cryptotype
+it supports will respond with packets of that cryptotype.
+However, unconfigured broadcast or manycast client
+associations or symmetric passive associations will not be
+mobilized unless the server supports a cryptotype compatible
+with the first packet received.
+By default, unauthenticated associations will not be mobilized
+unless overridden in a decidedly dangerous way.
+.sp \n(Ppu
+.ne 2
+
+Some examples may help to reduce confusion.
+Client Alice has no specific cryptotype selected.
+Server Bob has both a symmetric key file and minimal Autokey files.
+Alice's unauthenticated messages arrive at Bob, who replies with
+unauthenticated messages.
+Cathy has a copy of Bob's symmetric
+key file and has selected key ID 4 in messages to Bob.
+Bob verifies the message with his key ID 4.
+If it's the
+same key and the message is verified, Bob sends Cathy a reply
+authenticated with that key.
+If verification fails,
+Bob sends Cathy a thing called a crypto-NAK, which tells her
+something broke.
+She can see the evidence using the
+\fCntpq\fR(1ntpqmdoc)\f[]
+program.
+.sp \n(Ppu
+.ne 2
+
+Denise has rolled her own host key and certificate.
+She also uses one of the identity schemes as Bob.
+She sends the first Autokey message to Bob and they
+both dance the protocol authentication and identity steps.
+If all comes out okay, Denise and Bob continue as described above.
+.sp \n(Ppu
+.ne 2
+
+It should be clear from the above that Bob can support
+all the girls at the same time, as long as he has compatible
+authentication and identity credentials.
+Now, Bob can act just like the girls in his own choice of servers;
+he can run multiple configured associations with multiple different
+servers (or the same server, although that might not be useful).
+But, wise security policy might preclude some cryptotype
+combinations; for instance, running an identity scheme
+with one server and no authentication with another might not be wise.
+.SS Key Management
+The cryptographic values used by the Autokey protocol are
+incorporated as a set of files generated by the
+\fCntp-keygen\fR(1ntpkeygenmdoc)\f[]
+utility program, including symmetric key, host key and
+public certificate files, as well as sign key, identity parameters
+and leapseconds files.
+Alternatively, host and sign keys and
+certificate files can be generated by the OpenSSL utilities
+and certificates can be imported from public certificate
+authorities.
+Note that symmetric keys are necessary for the
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utility programs.
+The remaining files are necessary only for the
+Autokey protocol.
+.sp \n(Ppu
+.ne 2
+
+Certificates imported from OpenSSL or public certificate
+authorities have certian limitations.
+The certificate should be in ASN.1 syntax, X.509 Version 3
+format and encoded in PEM, which is the same format
+used by OpenSSL.
+The overall length of the certificate encoded
+in ASN.1 must not exceed 1024 bytes.
+The subject distinguished
+name field (CN) is the fully qualified name of the host
+on which it is used; the remaining subject fields are ignored.
+The certificate extension fields must not contain either
+a subject key identifier or a issuer key identifier field;
+however, an extended key usage field for a trusted host must
+contain the value
+\f\*[B-Font]trustRoot\f[];.
+Other extension fields are ignored.
+.SS Authentication Commands
+.TP 7
+.NOP \f\*[B-Font]autokey\f[] [\f\*[I-Font]logsec\f[]]
+Specifies the interval between regenerations of the session key
+list used with the Autokey protocol.
+Note that the size of the key
+list for each association depends on this interval and the current
+poll interval.
+The default value is 12 (4096 s or about 1.1 hours).
+For poll intervals above the specified interval, a session key list
+with a single entry will be regenerated for every message
+sent.
+.TP 7
+.NOP \f\*[B-Font]controlkey\f[] \f\*[I-Font]key\f[]
+Specifies the key identifier to use with the
+\fCntpq\fR(1ntpqmdoc)\f[]
+utility, which uses the standard
+protocol defined in RFC-1305.
+The
+\f\*[I-Font]key\f[]
+argument is
+the key identifier for a trusted key, where the value can be in the
+range 1 to 65,534, inclusive.
+.TP 7
+.NOP \f\*[B-Font]crypto\f[] [\f\*[B-Font]cert\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]leap\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]randfile\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]host\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]sign\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gq\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gqpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]iffpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]mvpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]]
+This command requires the OpenSSL library.
+It activates public key
+cryptography, selects the message digest and signature
+encryption scheme and loads the required private and public
+values described above.
+If one or more files are left unspecified,
+the default names are used as described above.
+Unless the complete path and name of the file are specified, the
+location of a file is relative to the keys directory specified
+in the
+\f\*[B-Font]keysdir\f[]
+command or default
+\fI/usr/local/etc\f[].
+Following are the subcommands:
+.RS
+.TP 7
+.NOP \f\*[B-Font]cert\f[] \f\*[I-Font]file\f[]
+Specifies the location of the required host public certificate file.
+This overrides the link
+\fIntpkey_cert_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]gqpar\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional GQ parameters file.
+This
+overrides the link
+\fIntpkey_gq_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]host\f[] \f\*[I-Font]file\f[]
+Specifies the location of the required host key file.
+This overrides
+the link
+\fIntpkey_key_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]iffpar\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional IFF parameters file.This
+overrides the link
+\fIntpkey_iff_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]leap\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional leapsecond file.
+This overrides the link
+\fIntpkey_leap\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]mvpar\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional MV parameters file.
+This
+overrides the link
+\fIntpkey_mv_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]
+Specifies the password to decrypt files containing private keys and
+identity parameters.
+This is required only if these files have been
+encrypted.
+.TP 7
+.NOP \f\*[B-Font]randfile\f[] \f\*[I-Font]file\f[]
+Specifies the location of the random seed file used by the OpenSSL
+library.
+The defaults are described in the main text above.
+.TP 7
+.NOP \f\*[B-Font]sign\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional sign key file.
+This overrides
+the link
+\fIntpkey_sign_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+If this file is
+not found, the host key is also the sign key.
+.RE
+.TP 7
+.NOP \f\*[B-Font]keys\f[] \f\*[I-Font]keyfile\f[]
+Specifies the complete path and location of the MD5 key file
+containing the keys and key identifiers used by
+\fCntpd\fR(1ntpdmdoc)\f[],
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+when operating with symmetric key cryptography.
+This is the same operation as the
+\f\*[B-Font]\-k\f[]
+command line option.
+.TP 7
+.NOP \f\*[B-Font]keysdir\f[] \f\*[I-Font]path\f[]
+This command specifies the default directory path for
+cryptographic keys, parameters and certificates.
+The default is
+\fI/usr/local/etc/\f[].
+.TP 7
+.NOP \f\*[B-Font]requestkey\f[] \f\*[I-Font]key\f[]
+Specifies the key identifier to use with the
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utility program, which uses a
+proprietary protocol specific to this implementation of
+\fCntpd\fR(1ntpdmdoc)\f[].
+The
+\f\*[I-Font]key\f[]
+argument is a key identifier
+for the trusted key, where the value can be in the range 1 to
+65,534, inclusive.
+.TP 7
+.NOP \f\*[B-Font]revoke\f[] \f\*[I-Font]logsec\f[]
+Specifies the interval between re-randomization of certain
+cryptographic values used by the Autokey scheme, as a power of 2 in
+seconds.
+These values need to be updated frequently in order to
+deflect brute-force attacks on the algorithms of the scheme;
+however, updating some values is a relatively expensive operation.
+The default interval is 16 (65,536 s or about 18 hours).
+For poll
+intervals above the specified interval, the values will be updated
+for every message sent.
+.TP 7
+.NOP \f\*[B-Font]trustedkey\f[] \f\*[I-Font]key\f[] \f\*[I-Font]...\f[]
+Specifies the key identifiers which are trusted for the
+purposes of authenticating peers with symmetric key cryptography,
+as well as keys used by the
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+programs.
+The authentication procedures require that both the local
+and remote servers share the same key and key identifier for this
+purpose, although different keys can be used with different
+servers.
+The
+\f\*[I-Font]key\f[]
+arguments are 32-bit unsigned
+integers with values from 1 to 65,534.
+.PP
+.SS Error Codes
+The following error codes are reported via the NTP control
+and monitoring protocol trap mechanism.
+.TP 7
+.NOP 101
+(bad field format or length)
+The packet has invalid version, length or format.
+.TP 7
+.NOP 102
+(bad timestamp)
+The packet timestamp is the same or older than the most recent received.
+This could be due to a replay or a server clock time step.
+.TP 7
+.NOP 103
+(bad filestamp)
+The packet filestamp is the same or older than the most recent received.
+This could be due to a replay or a key file generation error.
+.TP 7
+.NOP 104
+(bad or missing public key)
+The public key is missing, has incorrect format or is an unsupported type.
+.TP 7
+.NOP 105
+(unsupported digest type)
+The server requires an unsupported digest/signature scheme.
+.TP 7
+.NOP 106
+(mismatched digest types)
+Not used.
+.TP 7
+.NOP 107
+(bad signature length)
+The signature length does not match the current public key.
+.TP 7
+.NOP 108
+(signature not verified)
+The message fails the signature check.
+It could be bogus or signed by a
+different private key.
+.TP 7
+.NOP 109
+(certificate not verified)
+The certificate is invalid or signed with the wrong key.
+.TP 7
+.NOP 110
+(certificate not verified)
+The certificate is not yet valid or has expired or the signature could not
+be verified.
+.TP 7
+.NOP 111
+(bad or missing cookie)
+The cookie is missing, corrupted or bogus.
+.TP 7
+.NOP 112
+(bad or missing leapseconds table)
+The leapseconds table is missing, corrupted or bogus.
+.TP 7
+.NOP 113
+(bad or missing certificate)
+The certificate is missing, corrupted or bogus.
+.TP 7
+.NOP 114
+(bad or missing identity)
+The identity key is missing, corrupt or bogus.
+.PP
+.SH Monitoring Support
+\fCntpd\fR(1ntpdmdoc)\f[]
+includes a comprehensive monitoring facility suitable
+for continuous, long term recording of server and client
+timekeeping performance.
+See the
+\f\*[B-Font]statistics\f[]
+command below
+for a listing and example of each type of statistics currently
+supported.
+Statistic files are managed using file generation sets
+and scripts in the
+\fI./scripts\f[]
+directory of this distribution.
+Using
+these facilities and
+UNIX
+\fCcron\fR(8)\f[]
+jobs, the data can be
+automatically summarized and archived for retrospective analysis.
+.SS Monitoring Commands
+.TP 7
+.NOP \f\*[B-Font]statistics\f[] \f\*[I-Font]name\f[] \f\*[I-Font]...\f[]
+Enables writing of statistics records.
+Currently, eight kinds of
+\f\*[I-Font]name\f[]
+statistics are supported.
+.RS
+.TP 7
+.NOP \f\*[B-Font]clockstats\f[]
+Enables recording of clock driver statistics information.
+Each update
+received from a clock driver appends a line of the following form to
+the file generation set named
+\f\*[B-Font]clockstats\f[]:
+.br
+.in +4
+.nf
+49213 525.624 127.127.4.1 93 226 00:08:29.606 D
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the
+clock address in dotted-quad notation.
+The final field shows the last
+timecode received from the clock in decoded ASCII format, where
+meaningful.
+In some clock drivers a good deal of additional information
+can be gathered and displayed as well.
+See information specific to each
+clock for further details.
+.TP 7
+.NOP \f\*[B-Font]cryptostats\f[]
+This option requires the OpenSSL cryptographic software library.
+It
+enables recording of cryptographic public key protocol information.
+Each message received by the protocol module appends a line of the
+following form to the file generation set named
+\f\*[B-Font]cryptostats\f[]:
+.br
+.in +4
+.nf
+49213 525.624 127.127.4.1 message
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the peer
+address in dotted-quad notation, The final message field includes the
+message type and certain ancillary information.
+See the
+\fIAuthentication\f[] \fIOptions\f[]
+section for further information.
+.TP 7
+.NOP \f\*[B-Font]loopstats\f[]
+Enables recording of loop filter statistics information.
+Each
+update of the local clock outputs a line of the following form to
+the file generation set named
+\f\*[B-Font]loopstats\f[]:
+.br
+.in +4
+.nf
+50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next five fields
+show time offset (seconds), frequency offset (parts per million \-
+PPM), RMS jitter (seconds), Allan deviation (PPM) and clock
+discipline time constant.
+.TP 7
+.NOP \f\*[B-Font]peerstats\f[]
+Enables recording of peer statistics information.
+This includes
+statistics records of all peers of a NTP server and of special
+signals, where present and configured.
+Each valid update appends a
+line of the following form to the current element of a file
+generation set named
+\f\*[B-Font]peerstats\f[]:
+.br
+.in +4
+.nf
+48773 10847.650 127.127.4.1 9714 \-0.001605376 0.000000000 0.001424877 0.000958674
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the peer address in dotted-quad notation and status,
+respectively.
+The status field is encoded in hex in the format
+described in Appendix A of the NTP specification RFC 1305.
+The final four fields show the offset,
+delay, dispersion and RMS jitter, all in seconds.
+.TP 7
+.NOP \f\*[B-Font]rawstats\f[]
+Enables recording of raw-timestamp statistics information.
+This
+includes statistics records of all peers of a NTP server and of
+special signals, where present and configured.
+Each NTP message
+received from a peer or clock driver appends a line of the
+following form to the file generation set named
+\f\*[B-Font]rawstats\f[]:
+.br
+.in +4
+.nf
+50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the remote peer or clock address followed by the local address
+in dotted-quad notation.
+The final four fields show the originate,
+receive, transmit and final NTP timestamps in order.
+The timestamp
+values are as received and before processing by the various data
+smoothing and mitigation algorithms.
+.TP 7
+.NOP \f\*[B-Font]sysstats\f[]
+Enables recording of ntpd statistics counters on a periodic basis.
+Each
+hour a line of the following form is appended to the file generation
+set named
+\f\*[B-Font]sysstats\f[]:
+.br
+.in +4
+.nf
+50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The remaining ten fields show
+the statistics counter values accumulated since the last generated
+line.
+.RS
+.TP 7
+.NOP Time since restart \f\*[B-Font]36000\f[]
+Time in hours since the system was last rebooted.
+.TP 7
+.NOP Packets received \f\*[B-Font]81965\f[]
+Total number of packets received.
+.TP 7
+.NOP Packets processed \f\*[B-Font]0\f[]
+Number of packets received in response to previous packets sent
+.TP 7
+.NOP Current version \f\*[B-Font]9546\f[]
+Number of packets matching the current NTP version.
+.TP 7
+.NOP Previous version \f\*[B-Font]56\f[]
+Number of packets matching the previous NTP version.
+.TP 7
+.NOP Bad version \f\*[B-Font]71793\f[]
+Number of packets matching neither NTP version.
+.TP 7
+.NOP Access denied \f\*[B-Font]512\f[]
+Number of packets denied access for any reason.
+.TP 7
+.NOP Bad length or format \f\*[B-Font]540\f[]
+Number of packets with invalid length, format or port number.
+.TP 7
+.NOP Bad authentication \f\*[B-Font]10\f[]
+Number of packets not verified as authentic.
+.TP 7
+.NOP Rate exceeded \f\*[B-Font]147\f[]
+Number of packets discarded due to rate limitation.
+.RE
+.TP 7
+.NOP \f\*[B-Font]statsdir\f[] \f\*[I-Font]directory_path\f[]
+Indicates the full path of a directory where statistics files
+should be created (see below).
+This keyword allows
+the (otherwise constant)
+\f\*[B-Font]filegen\f[]
+filename prefix to be modified for file generation sets, which
+is useful for handling statistics logs.
+.TP 7
+.NOP \f\*[B-Font]filegen\f[] \f\*[I-Font]name\f[] [\f\*[B-Font]file\f[] \f\*[I-Font]filename\f[]] [\f\*[B-Font]type\f[] \f\*[I-Font]typename\f[]] [\f\*[B-Font]link\f[] | \f\*[B-Font]nolink\f[]] [\f\*[B-Font]enable\f[] | \f\*[B-Font]disable\f[]]
+Configures setting of generation file set name.
+Generation
+file sets provide a means for handling files that are
+continuously growing during the lifetime of a server.
+Server statistics are a typical example for such files.
+Generation file sets provide access to a set of files used
+to store the actual data.
+At any time at most one element
+of the set is being written to.
+The type given specifies
+when and how data will be directed to a new element of the set.
+This way, information stored in elements of a file set
+that are currently unused are available for administrational
+operations without the risk of disturbing the operation of ntpd.
+(Most important: they can be removed to free space for new data
+produced.)
+.sp \n(Ppu
+.ne 2
+
+Note that this command can be sent from the
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+program running at a remote location.
+.RS
+.TP 7
+.NOP \f\*[B-Font]name\f[]
+This is the type of the statistics records, as shown in the
+\f\*[B-Font]statistics\f[]
+command.
+.TP 7
+.NOP \f\*[B-Font]file\f[] \f\*[I-Font]filename\f[]
+This is the file name for the statistics records.
+Filenames of set
+members are built from three concatenated elements
+\f\*[B-Font]prefix\f[],
+\f\*[B-Font]filename\f[]
+and
+\f\*[B-Font]suffix\f[]:
+.RS
+.TP 7
+.NOP \f\*[B-Font]prefix\f[]
+This is a constant filename path.
+It is not subject to
+modifications via the
+\f\*[I-Font]filegen\f[]
+option.
+It is defined by the
+server, usually specified as a compile-time constant.
+It may,
+however, be configurable for individual file generation sets
+via other commands.
+For example, the prefix used with
+\f\*[I-Font]loopstats\f[]
+and
+\f\*[I-Font]peerstats\f[]
+generation can be configured using the
+\f\*[I-Font]statsdir\f[]
+option explained above.
+.TP 7
+.NOP \f\*[B-Font]filename\f[]
+This string is directly concatenated to the prefix mentioned
+above (no intervening
+\[oq]/\[cq]).
+This can be modified using
+the file argument to the
+\f\*[I-Font]filegen\f[]
+statement.
+No
+\fI..\f[]
+elements are
+allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by
+\f\*[I-Font]prefix\f[].
+.TP 7
+.NOP \f\*[B-Font]suffix\f[]
+This part is reflects individual elements of a file set.
+It is
+generated according to the type of a file set.
+.RE
+.TP 7
+.NOP \f\*[B-Font]type\f[] \f\*[I-Font]typename\f[]
+A file generation set is characterized by its type.
+The following
+types are supported:
+.RS
+.TP 7
+.NOP \f\*[B-Font]none\f[]
+The file set is actually a single plain file.
+.TP 7
+.NOP \f\*[B-Font]pid\f[]
+One element of file set is used per incarnation of a ntpd
+server.
+This type does not perform any changes to file set
+members during runtime, however it provides an easy way of
+separating files belonging to different
+\fCntpd\fR(1ntpdmdoc)\f[]
+server incarnations.
+The set member filename is built by appending a
+\[oq]\&.\[cq]
+to concatenated
+\f\*[I-Font]prefix\f[]
+and
+\f\*[I-Font]filename\f[]
+strings, and
+appending the decimal representation of the process ID of the
+\fCntpd\fR(1ntpdmdoc)\f[]
+server process.
+.TP 7
+.NOP \f\*[B-Font]day\f[]
+One file generation set element is created per day.
+A day is
+defined as the period between 00:00 and 24:00 UTC.
+The file set
+member suffix consists of a
+\[oq]\&.\[cq]
+and a day specification in
+the form
+\f\*[B-Font]YYYYMMdd\f[].
+\f\*[B-Font]YYYY\f[]
+is a 4-digit year number (e.g., 1992).
+\f\*[B-Font]MM\f[]
+is a two digit month number.
+\f\*[B-Font]dd\f[]
+is a two digit day number.
+Thus, all information written at 10 December 1992 would end up
+in a file named
+\f\*[I-Font]prefix\f[]
+\f\*[I-Font]filename\f[].19921210.
+.TP 7
+.NOP \f\*[B-Font]week\f[]
+Any file set member contains data related to a certain week of
+a year.
+The term week is defined by computing day-of-year
+modulo 7.
+Elements of such a file generation set are
+distinguished by appending the following suffix to the file set
+filename base: A dot, a 4-digit year number, the letter
+\f\*[B-Font]W\f[],
+and a 2-digit week number.
+For example, information from January,
+10th 1992 would end up in a file with suffix
+.NOP. \f\*[I-Font]1992W1\f[].
+.TP 7
+.NOP \f\*[B-Font]month\f[]
+One generation file set element is generated per month.
+The
+file name suffix consists of a dot, a 4-digit year number, and
+a 2-digit month.
+.TP 7
+.NOP \f\*[B-Font]year\f[]
+One generation file element is generated per year.
+The filename
+suffix consists of a dot and a 4 digit year number.
+.TP 7
+.NOP \f\*[B-Font]age\f[]
+This type of file generation sets changes to a new element of
+the file set every 24 hours of server operation.
+The filename
+suffix consists of a dot, the letter
+\f\*[B-Font]a\f[],
+and an 8-digit number.
+This number is taken to be the number of seconds the server is
+running at the start of the corresponding 24-hour period.
+Information is only written to a file generation by specifying
+\f\*[B-Font]enable\f[];
+output is prevented by specifying
+\f\*[B-Font]disable\f[].
+.RE
+.TP 7
+.NOP \f\*[B-Font]link\f[] | \f\*[B-Font]nolink\f[]
+It is convenient to be able to access the current element of a file
+generation set by a fixed name.
+This feature is enabled by
+specifying
+\f\*[B-Font]link\f[]
+and disabled using
+\f\*[B-Font]nolink\f[].
+If link is specified, a
+hard link from the current file set element to a file without
+suffix is created.
+When there is already a file with this name and
+the number of links of this file is one, it is renamed appending a
+dot, the letter
+\f\*[B-Font]C\f[],
+and the pid of the ntpd server process.
+When the
+number of links is greater than one, the file is unlinked.
+This
+allows the current file to be accessed by a constant name.
+.TP 7
+.NOP \f\*[B-Font]enable\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]disable\f[]
+Enables or disables the recording function.
+.RE
+.RE
+.PP
+.SH Access Control Support
+The
+\fCntpd\fR(1ntpdmdoc)\f[]
+daemon implements a general purpose address/mask based restriction
+list.
+The list contains address/match entries sorted first
+by increasing address values and and then by increasing mask values.
+A match occurs when the bitwise AND of the mask and the packet
+source address is equal to the bitwise AND of the mask and
+address in the list.
+The list is searched in order with the
+last match found defining the restriction flags associated
+with the entry.
+Additional information and examples can be found in the
+"Notes on Configuring NTP and Setting up a NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.sp \n(Ppu
+.ne 2
+
+The restriction facility was implemented in conformance
+with the access policies for the original NSFnet backbone
+time servers.
+Later the facility was expanded to deflect
+cryptographic and clogging attacks.
+While this facility may
+be useful for keeping unwanted or broken or malicious clients
+from congesting innocent servers, it should not be considered
+an alternative to the NTP authentication facilities.
+Source address based restrictions are easily circumvented
+by a determined cracker.
+.sp \n(Ppu
+.ne 2
+
+Clients can be denied service because they are explicitly
+included in the restrict list created by the restrict command
+or implicitly as the result of cryptographic or rate limit
+violations.
+Cryptographic violations include certificate
+or identity verification failure; rate limit violations generally
+result from defective NTP implementations that send packets
+at abusive rates.
+Some violations cause denied service
+only for the offending packet, others cause denied service
+for a timed period and others cause the denied service for
+an indefinate period.
+When a client or network is denied access
+for an indefinate period, the only way at present to remove
+the restrictions is by restarting the server.
+.SS The Kiss-of-Death Packet
+Ordinarily, packets denied service are simply dropped with no
+further action except incrementing statistics counters.
+Sometimes a
+more proactive response is needed, such as a server message that
+explicitly requests the client to stop sending and leave a message
+for the system operator.
+A special packet format has been created
+for this purpose called the "kiss-of-death" (KoD) packet.
+KoD packets have the leap bits set unsynchronized and stratum set
+to zero and the reference identifier field set to a four-byte
+ASCII code.
+If the
+\f\*[B-Font]noserve\f[]
+or
+\f\*[B-Font]notrust\f[]
+flag of the matching restrict list entry is set,
+the code is "DENY"; if the
+\f\*[B-Font]limited\f[]
+flag is set and the rate limit
+is exceeded, the code is "RATE".
+Finally, if a cryptographic violation occurs, the code is "CRYP".
+.sp \n(Ppu
+.ne 2
+
+A client receiving a KoD performs a set of sanity checks to
+minimize security exposure, then updates the stratum and
+reference identifier peer variables, sets the access
+denied (TEST4) bit in the peer flash variable and sends
+a message to the log.
+As long as the TEST4 bit is set,
+the client will send no further packets to the server.
+The only way at present to recover from this condition is
+to restart the protocol at both the client and server.
+This
+happens automatically at the client when the association times out.
+It will happen at the server only if the server operator cooperates.
+.SS Access Control Commands
+.TP 7
+.NOP \f\*[B-Font]discard\f[] [\f\*[B-Font]average\f[] \f\*[I-Font]avg\f[]] [\f\*[B-Font]minimum\f[] \f\*[I-Font]min\f[]] [\f\*[B-Font]monitor\f[] \f\*[I-Font]prob\f[]]
+Set the parameters of the
+\f\*[B-Font]limited\f[]
+facility which protects the server from
+client abuse.
+The
+\f\*[B-Font]average\f[]
+subcommand specifies the minimum average packet
+spacing, while the
+\f\*[B-Font]minimum\f[]
+subcommand specifies the minimum packet spacing.
+Packets that violate these minima are discarded
+and a kiss-o'-death packet returned if enabled.
+The default
+minimum average and minimum are 5 and 2, respectively.
+The monitor subcommand specifies the probability of discard
+for packets that overflow the rate-control window.
+.TP 7
+.NOP \f\*[B-Font]restrict\f[] \f\*[B-Font]address\f[] [\f\*[B-Font]mask\f[] \f\*[I-Font]mask\f[]] [\f\*[I-Font]flag\f[] \f\*[I-Font]...\f[]]
+The
+\f\*[I-Font]address\f[]
+argument expressed in
+dotted-quad form is the address of a host or network.
+Alternatively, the
+\f\*[I-Font]address\f[]
+argument can be a valid host DNS name.
+The
+\f\*[I-Font]mask\f[]
+argument expressed in dotted-quad form defaults to
+\f\*[B-Font]255.255.255.255\f[],
+meaning that the
+\f\*[I-Font]address\f[]
+is treated as the address of an individual host.
+A default entry (address
+\f\*[B-Font]0.0.0.0\f[],
+mask
+\f\*[B-Font]0.0.0.0\f[])
+is always included and is always the first entry in the list.
+Note that text string
+\f\*[B-Font]default\f[],
+with no mask option, may
+be used to indicate the default entry.
+In the current implementation,
+\f\*[B-Font]flag\f[]
+always
+restricts access, i.e., an entry with no flags indicates that free
+access to the server is to be given.
+The flags are not orthogonal,
+in that more restrictive flags will often make less restrictive
+ones redundant.
+The flags can generally be classed into two
+categories, those which restrict time service and those which
+restrict informational queries and attempts to do run-time
+reconfiguration of the server.
+One or more of the following flags
+may be specified:
+.RS
+.TP 7
+.NOP \f\*[B-Font]ignore\f[]
+Deny packets of all kinds, including
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+queries.
+.TP 7
+.NOP \f\*[B-Font]kod\f[]
+If this flag is set when an access violation occurs, a kiss-o'-death
+(KoD) packet is sent.
+KoD packets are rate limited to no more than one
+per second.
+If another KoD packet occurs within one second after the
+last one, the packet is dropped.
+.TP 7
+.NOP \f\*[B-Font]limited\f[]
+Deny service if the packet spacing violates the lower limits specified
+in the discard command.
+A history of clients is kept using the
+monitoring capability of
+\fCntpd\fR(1ntpdmdoc)\f[].
+Thus, monitoring is always active as
+long as there is a restriction entry with the
+\f\*[B-Font]limited\f[]
+flag.
+.TP 7
+.NOP \f\*[B-Font]lowpriotrap\f[]
+Declare traps set by matching hosts to be low priority.
+The
+number of traps a server can maintain is limited (the current limit
+is 3).
+Traps are usually assigned on a first come, first served
+basis, with later trap requestors being denied service.
+This flag
+modifies the assignment algorithm by allowing low priority traps to
+be overridden by later requests for normal priority traps.
+.TP 7
+.NOP \f\*[B-Font]nomodify\f[]
+Deny
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+queries which attempt to modify the state of the
+server (i.e., run time reconfiguration).
+Queries which return
+information are permitted.
+.TP 7
+.NOP \f\*[B-Font]noquery\f[]
+Deny
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+queries.
+Time service is not affected.
+.TP 7
+.NOP \f\*[B-Font]nopeer\f[]
+Deny packets which would result in mobilizing a new association.
+This
+includes broadcast and symmetric active packets when a configured
+association does not exist.
+It also includes
+\f\*[B-Font]pool\f[]
+associations, so if you want to use servers from a
+\f\*[B-Font]pool\f[]
+directive and also want to use
+\f\*[B-Font]nopeer\f[]
+by default, you'll want a
+\f\*[B-Font]restrict source ...\f[] \f\*[B-Font]line\f[] \f\*[B-Font]as\f[] \f\*[B-Font]well\f[] \f\*[B-Font]that\f[] \f\*[B-Font]does\f[]
+.TP 7
+.NOP not
+include the
+\f\*[B-Font]nopeer\f[]
+directive.
+.TP 7
+.NOP \f\*[B-Font]noserve\f[]
+Deny all packets except
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+queries.
+.TP 7
+.NOP \f\*[B-Font]notrap\f[]
+Decline to provide mode 6 control message trap service to matching
+hosts.
+The trap service is a subsystem of the ntpdq control message
+protocol which is intended for use by remote event logging programs.
+.TP 7
+.NOP \f\*[B-Font]notrust\f[]
+Deny service unless the packet is cryptographically authenticated.
+.TP 7
+.NOP \f\*[B-Font]ntpport\f[]
+This is actually a match algorithm modifier, rather than a
+restriction flag.
+Its presence causes the restriction entry to be
+matched only if the source port in the packet is the standard NTP
+UDP port (123).
+Both
+\f\*[B-Font]ntpport\f[]
+and
+\f\*[B-Font]non-ntpport\f[]
+may
+be specified.
+The
+\f\*[B-Font]ntpport\f[]
+is considered more specific and
+is sorted later in the list.
+.TP 7
+.NOP \f\*[B-Font]version\f[]
+Deny packets that do not match the current NTP version.
+.RE
+.sp \n(Ppu
+.ne 2
+
+Default restriction list entries with the flags ignore, interface,
+ntpport, for each of the local host's interface addresses are
+inserted into the table at startup to prevent the server
+from attempting to synchronize to its own time.
+A default entry is also always present, though if it is
+otherwise unconfigured; no flags are associated
+with the default entry (i.e., everything besides your own
+NTP server is unrestricted).
+.PP
+.SH Automatic NTP Configuration Options
+.SS Manycasting
+Manycasting is a automatic discovery and configuration paradigm
+new to NTPv4.
+It is intended as a means for a multicast client
+to troll the nearby network neighborhood to find cooperating
+manycast servers, validate them using cryptographic means
+and evaluate their time values with respect to other servers
+that might be lurking in the vicinity.
+The intended result is that each manycast client mobilizes
+client associations with some number of the "best"
+of the nearby manycast servers, yet automatically reconfigures
+to sustain this number of servers should one or another fail.
+.sp \n(Ppu
+.ne 2
+
+Note that the manycasting paradigm does not coincide
+with the anycast paradigm described in RFC-1546,
+which is designed to find a single server from a clique
+of servers providing the same service.
+The manycast paradigm is designed to find a plurality
+of redundant servers satisfying defined optimality criteria.
+.sp \n(Ppu
+.ne 2
+
+Manycasting can be used with either symmetric key
+or public key cryptography.
+The public key infrastructure (PKI)
+offers the best protection against compromised keys
+and is generally considered stronger, at least with relatively
+large key sizes.
+It is implemented using the Autokey protocol and
+the OpenSSL cryptographic library available from
+\f[C]http://www.openssl.org/\f[].
+The library can also be used with other NTPv4 modes
+as well and is highly recommended, especially for broadcast modes.
+.sp \n(Ppu
+.ne 2
+
+A persistent manycast client association is configured
+using the manycastclient command, which is similar to the
+server command but with a multicast (IPv4 class
+\f\*[B-Font]D\f[]
+or IPv6 prefix
+\f\*[B-Font]FF\f[])
+group address.
+The IANA has designated IPv4 address 224.1.1.1
+and IPv6 address FF05::101 (site local) for NTP.
+When more servers are needed, it broadcasts manycast
+client messages to this address at the minimum feasible rate
+and minimum feasible time-to-live (TTL) hops, depending
+on how many servers have already been found.
+There can be as many manycast client associations
+as different group address, each one serving as a template
+for a future ephemeral unicast client/server association.
+.sp \n(Ppu
+.ne 2
+
+Manycast servers configured with the
+\f\*[B-Font]manycastserver\f[]
+command listen on the specified group address for manycast
+client messages.
+Note the distinction between manycast client,
+which actively broadcasts messages, and manycast server,
+which passively responds to them.
+If a manycast server is
+in scope of the current TTL and is itself synchronized
+to a valid source and operating at a stratum level equal
+to or lower than the manycast client, it replies to the
+manycast client message with an ordinary unicast server message.
+.sp \n(Ppu
+.ne 2
+
+The manycast client receiving this message mobilizes
+an ephemeral client/server association according to the
+matching manycast client template, but only if cryptographically
+authenticated and the server stratum is less than or equal
+to the client stratum.
+Authentication is explicitly required
+and either symmetric key or public key (Autokey) can be used.
+Then, the client polls the server at its unicast address
+in burst mode in order to reliably set the host clock
+and validate the source.
+This normally results
+in a volley of eight client/server at 2-s intervals
+during which both the synchronization and cryptographic
+protocols run concurrently.
+Following the volley,
+the client runs the NTP intersection and clustering
+algorithms, which act to discard all but the "best"
+associations according to stratum and synchronization
+distance.
+The surviving associations then continue
+in ordinary client/server mode.
+.sp \n(Ppu
+.ne 2
+
+The manycast client polling strategy is designed to reduce
+as much as possible the volume of manycast client messages
+and the effects of implosion due to near-simultaneous
+arrival of manycast server messages.
+The strategy is determined by the
+\f\*[B-Font]manycastclient\f[],
+\f\*[B-Font]tos\f[]
+and
+\f\*[B-Font]ttl\f[]
+configuration commands.
+The manycast poll interval is
+normally eight times the system poll interval,
+which starts out at the
+\f\*[B-Font]minpoll\f[]
+value specified in the
+\f\*[B-Font]manycastclient\f[],
+command and, under normal circumstances, increments to the
+\f\*[B-Font]maxpolll\f[]
+value specified in this command.
+Initially, the TTL is
+set at the minimum hops specified by the ttl command.
+At each retransmission the TTL is increased until reaching
+the maximum hops specified by this command or a sufficient
+number client associations have been found.
+Further retransmissions use the same TTL.
+.sp \n(Ppu
+.ne 2
+
+The quality and reliability of the suite of associations
+discovered by the manycast client is determined by the NTP
+mitigation algorithms and the
+\f\*[B-Font]minclock\f[]
+and
+\f\*[B-Font]minsane\f[]
+values specified in the
+\f\*[B-Font]tos\f[]
+configuration command.
+At least
+\f\*[B-Font]minsane\f[]
+candidate servers must be available and the mitigation
+algorithms produce at least
+\f\*[B-Font]minclock\f[]
+survivors in order to synchronize the clock.
+Byzantine agreement principles require at least four
+candidates in order to correctly discard a single falseticker.
+For legacy purposes,
+\f\*[B-Font]minsane\f[]
+defaults to 1 and
+\f\*[B-Font]minclock\f[]
+defaults to 3.
+For manycast service
+\f\*[B-Font]minsane\f[]
+should be explicitly set to 4, assuming at least that
+number of servers are available.
+.sp \n(Ppu
+.ne 2
+
+If at least
+\f\*[B-Font]minclock\f[]
+servers are found, the manycast poll interval is immediately
+set to eight times
+\f\*[B-Font]maxpoll\f[].
+If less than
+\f\*[B-Font]minclock\f[]
+servers are found when the TTL has reached the maximum hops,
+the manycast poll interval is doubled.
+For each transmission
+after that, the poll interval is doubled again until
+reaching the maximum of eight times
+\f\*[B-Font]maxpoll\f[].
+Further transmissions use the same poll interval and
+TTL values.
+Note that while all this is going on,
+each client/server association found is operating normally
+it the system poll interval.
+.sp \n(Ppu
+.ne 2
+
+Administratively scoped multicast boundaries are normally
+specified by the network router configuration and,
+in the case of IPv6, the link/site scope prefix.
+By default, the increment for TTL hops is 32 starting
+from 31; however, the
+\f\*[B-Font]ttl\f[]
+configuration command can be
+used to modify the values to match the scope rules.
+.sp \n(Ppu
+.ne 2
+
+It is often useful to narrow the range of acceptable
+servers which can be found by manycast client associations.
+Because manycast servers respond only when the client
+stratum is equal to or greater than the server stratum,
+primary (stratum 1) servers fill find only primary servers
+in TTL range, which is probably the most common objective.
+However, unless configured otherwise, all manycast clients
+in TTL range will eventually find all primary servers
+in TTL range, which is probably not the most common
+objective in large networks.
+The
+\f\*[B-Font]tos\f[]
+command can be used to modify this behavior.
+Servers with stratum below
+\f\*[B-Font]floor\f[]
+or above
+\f\*[B-Font]ceiling\f[]
+specified in the
+\f\*[B-Font]tos\f[]
+command are strongly discouraged during the selection
+process; however, these servers may be temporally
+accepted if the number of servers within TTL range is
+less than
+\f\*[B-Font]minclock\f[].
+.sp \n(Ppu
+.ne 2
+
+The above actions occur for each manycast client message,
+which repeats at the designated poll interval.
+However, once the ephemeral client association is mobilized,
+subsequent manycast server replies are discarded,
+since that would result in a duplicate association.
+If during a poll interval the number of client associations
+falls below
+\f\*[B-Font]minclock\f[],
+all manycast client prototype associations are reset
+to the initial poll interval and TTL hops and operation
+resumes from the beginning.
+It is important to avoid
+frequent manycast client messages, since each one requires
+all manycast servers in TTL range to respond.
+The result could well be an implosion, either minor or major,
+depending on the number of servers in range.
+The recommended value for
+\f\*[B-Font]maxpoll\f[]
+is 12 (4,096 s).
+.sp \n(Ppu
+.ne 2
+
+It is possible and frequently useful to configure a host
+as both manycast client and manycast server.
+A number of hosts configured this way and sharing a common
+group address will automatically organize themselves
+in an optimum configuration based on stratum and
+synchronization distance.
+For example, consider an NTP
+subnet of two primary servers and a hundred or more
+dependent clients.
+With two exceptions, all servers
+and clients have identical configuration files including both
+\f\*[B-Font]multicastclient\f[]
+and
+\f\*[B-Font]multicastserver\f[]
+commands using, for instance, multicast group address
+239.1.1.1.
+The only exception is that each primary server
+configuration file must include commands for the primary
+reference source such as a GPS receiver.
+.sp \n(Ppu
+.ne 2
+
+The remaining configuration files for all secondary
+servers and clients have the same contents, except for the
+\f\*[B-Font]tos\f[]
+command, which is specific for each stratum level.
+For stratum 1 and stratum 2 servers, that command is
+not necessary.
+For stratum 3 and above servers the
+\f\*[B-Font]floor\f[]
+value is set to the intended stratum number.
+Thus, all stratum 3 configuration files are identical,
+all stratum 4 files are identical and so forth.
+.sp \n(Ppu
+.ne 2
+
+Once operations have stabilized in this scenario,
+the primary servers will find the primary reference source
+and each other, since they both operate at the same
+stratum (1), but not with any secondary server or client,
+since these operate at a higher stratum.
+The secondary
+servers will find the servers at the same stratum level.
+If one of the primary servers loses its GPS receiver,
+it will continue to operate as a client and other clients
+will time out the corresponding association and
+re-associate accordingly.
+.sp \n(Ppu
+.ne 2
+
+Some administrators prefer to avoid running
+\fCntpd\fR(1ntpdmdoc)\f[]
+continuously and run either
+\fCntpdate\fR(8)\f[]
+or
+\fCntpd\fR(1ntpdmdoc)\f[]
+\f\*[B-Font]\-q\f[]
+as a cron job.
+In either case the servers must be
+configured in advance and the program fails if none are
+available when the cron job runs.
+A really slick
+application of manycast is with
+\fCntpd\fR(1ntpdmdoc)\f[]
+\f\*[B-Font]\-q\f[].
+The program wakes up, scans the local landscape looking
+for the usual suspects, selects the best from among
+the rascals, sets the clock and then departs.
+Servers do not have to be configured in advance and
+all clients throughout the network can have the same
+configuration file.
+.SS Manycast Interactions with Autokey
+Each time a manycast client sends a client mode packet
+to a multicast group address, all manycast servers
+in scope generate a reply including the host name
+and status word.
+The manycast clients then run
+the Autokey protocol, which collects and verifies
+all certificates involved.
+Following the burst interval
+all but three survivors are cast off,
+but the certificates remain in the local cache.
+It often happens that several complete signing trails
+from the client to the primary servers are collected in this way.
+.sp \n(Ppu
+.ne 2
+
+About once an hour or less often if the poll interval
+exceeds this, the client regenerates the Autokey key list.
+This is in general transparent in client/server mode.
+However, about once per day the server private value
+used to generate cookies is refreshed along with all
+manycast client associations.
+In this case all
+cryptographic values including certificates is refreshed.
+If a new certificate has been generated since
+the last refresh epoch, it will automatically revoke
+all prior certificates that happen to be in the
+certificate cache.
+At the same time, the manycast
+scheme starts all over from the beginning and
+the expanding ring shrinks to the minimum and increments
+from there while collecting all servers in scope.
+.SS Manycast Options
+.TP 7
+.NOP \f\*[B-Font]tos\f[] [\f\*[B-Font]ceiling\f[] \f\*[I-Font]ceiling\f[] | \f\*[B-Font]cohort\f[] { \f\*[B-Font]0\f[] | \f\*[B-Font]1\f[] } | \f\*[B-Font]floor\f[] \f\*[I-Font]floor\f[] | \f\*[B-Font]minclock\f[] \f\*[I-Font]minclock\f[] | \f\*[B-Font]minsane\f[] \f\*[I-Font]minsane\f[]]
+This command affects the clock selection and clustering
+algorithms.
+It can be used to select the quality and
+quantity of peers used to synchronize the system clock
+and is most useful in manycast mode.
+The variables operate
+as follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]ceiling\f[] \f\*[I-Font]ceiling\f[]
+Peers with strata above
+\f\*[B-Font]ceiling\f[]
+will be discarded if there are at least
+\f\*[B-Font]minclock\f[]
+peers remaining.
+This value defaults to 15, but can be changed
+to any number from 1 to 15.
+.TP 7
+.NOP \f\*[B-Font]cohort\f[] {0 | 1 }
+This is a binary flag which enables (0) or disables (1)
+manycast server replies to manycast clients with the same
+stratum level.
+This is useful to reduce implosions where
+large numbers of clients with the same stratum level
+are present.
+The default is to enable these replies.
+.TP 7
+.NOP \f\*[B-Font]floor\f[] \f\*[I-Font]floor\f[]
+Peers with strata below
+\f\*[B-Font]floor\f[]
+will be discarded if there are at least
+\f\*[B-Font]minclock\f[]
+peers remaining.
+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
+associations until no more than
+\f\*[B-Font]minclock\f[]
+associations remain.
+This value defaults to 3,
+but can be changed to any number from 1 to the number of
+configured sources.
+.TP 7
+.NOP \f\*[B-Font]minsane\f[] \f\*[I-Font]minsane\f[]
+This is the minimum number of candidates available
+to the clock selection algorithm in order to produce
+one or more truechimers for the clustering algorithm.
+If fewer than this number are available, the clock is
+undisciplined and allowed to run free.
+The default is 1
+for legacy purposes.
+However, according to principles of
+Byzantine agreement,
+\f\*[B-Font]minsane\f[]
+should be at least 4 in order to detect and discard
+a single falseticker.
+.RE
+.TP 7
+.NOP \f\*[B-Font]ttl\f[] \f\*[I-Font]hop\f[] \f\*[I-Font]...\f[]
+This command specifies a list of TTL values in increasing
+order, up to 8 values can be specified.
+In manycast mode these values are used in turn
+in an expanding-ring search.
+The default is eight
+multiples of 32 starting at 31.
+.PP
+.SH Reference Clock Support
+The NTP Version 4 daemon supports some three dozen different radio,
+satellite and modem reference clocks plus a special pseudo-clock
+used for backup or when no other clock source is available.
+Detailed descriptions of individual device drivers and options can
+be found in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+Additional information can be found in the pages linked
+there, including the
+"Debugging Hints for Reference Clock Drivers"
+and
+"How To Write a Reference Clock Driver"
+pages
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+In addition, support for a PPS
+signal is available as described in the
+"Pulse-per-second (PPS) Signal Interfacing"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+Many
+drivers support special line discipline/streams modules which can
+significantly improve the accuracy using the driver.
+These are
+described in the
+"Line Disciplines and Streams Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.sp \n(Ppu
+.ne 2
+
+A reference clock will generally (though not always) be a radio
+timecode receiver which is synchronized to a source of standard
+time such as the services offered by the NRC in Canada and NIST and
+USNO in the US.
+The interface between the computer and the timecode
+receiver is device dependent, but is usually a serial port.
+A
+device driver specific to each reference clock must be selected and
+compiled in the distribution; however, most common radio, satellite
+and modem clocks are included by default.
+Note that an attempt to
+configure a reference clock when the driver has not been compiled
+or the hardware port has not been appropriately configured results
+in a scalding remark to the system log file, but is otherwise non
+hazardous.
+.sp \n(Ppu
+.ne 2
+
+For the purposes of configuration,
+\fCntpd\fR(1ntpdmdoc)\f[]
+treats
+reference clocks in a manner analogous to normal NTP peers as much
+as possible.
+Reference clocks are identified by a syntactically
+correct but invalid IP address, in order to distinguish them from
+normal NTP peers.
+Reference clock addresses are of the form
+\f[C]127.127.\f[]\f\*[I-Font]t\f[].\f\*[I-Font]u\f[],
+where
+\f\*[I-Font]t\f[]
+is an integer
+denoting the clock type and
+\f\*[I-Font]u\f[]
+indicates the unit
+number in the range 0-3.
+While it may seem overkill, it is in fact
+sometimes useful to configure multiple reference clocks of the same
+type, in which case the unit numbers must be unique.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]server\f[]
+command is used to configure a reference
+clock, where the
+\f\*[I-Font]address\f[]
+argument in that command
+is the clock address.
+The
+\f\*[B-Font]key\f[],
+\f\*[B-Font]version\f[]
+and
+\f\*[B-Font]ttl\f[]
+options are not used for reference clock support.
+The
+\f\*[B-Font]mode\f[]
+option is added for reference clock support, as
+described below.
+The
+\f\*[B-Font]prefer\f[]
+option can be useful to
+persuade the server to cherish a reference clock with somewhat more
+enthusiasm than other reference clocks or peers.
+Further
+information on this option can be found in the
+"Mitigation Rules and the prefer Keyword"
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+page.
+The
+\f\*[B-Font]minpoll\f[]
+and
+\f\*[B-Font]maxpoll\f[]
+options have
+meaning only for selected clock drivers.
+See the individual clock
+driver document pages for additional information.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]fudge\f[]
+command is used to provide additional
+information for individual clock drivers and normally follows
+immediately after the
+\f\*[B-Font]server\f[]
+command.
+The
+\f\*[I-Font]address\f[]
+argument specifies the clock address.
+The
+\f\*[B-Font]refid\f[]
+and
+\f\*[B-Font]stratum\f[]
+options can be used to
+override the defaults for the device.
+There are two optional
+device-dependent time offsets and four flags that can be included
+in the
+\f\*[B-Font]fudge\f[]
+command as well.
+.sp \n(Ppu
+.ne 2
+
+The stratum number of a reference clock is by default zero.
+Since the
+\fCntpd\fR(1ntpdmdoc)\f[]
+daemon adds one to the stratum of each
+peer, a primary server ordinarily displays an external stratum of
+one.
+In order to provide engineered backups, it is often useful to
+specify the reference clock stratum as greater than zero.
+The
+\f\*[B-Font]stratum\f[]
+option is used for this purpose.
+Also, in cases
+involving both a reference clock and a pulse-per-second (PPS)
+discipline signal, it is useful to specify the reference clock
+identifier as other than the default, depending on the driver.
+The
+\f\*[B-Font]refid\f[]
+option is used for this purpose.
+Except where noted,
+these options apply to all clock drivers.
+.SS Reference Clock Commands
+.TP 7
+.NOP \f\*[B-Font]server\f[] \f[C]127.127.\f[]\f\*[I-Font]t\f[].\f\*[I-Font]u\f[] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]int\f[]]
+This command can be used to configure reference clocks in
+special ways.
+The options are interpreted as follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]prefer\f[]
+Marks the reference clock as preferred.
+All other things being
+equal, this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+for further information.
+.TP 7
+.NOP \f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.TP 7
+.NOP \f\*[B-Font]minpoll\f[] \f\*[I-Font]int\f[]
+.TP 7
+.NOP \f\*[B-Font]maxpoll\f[] \f\*[I-Font]int\f[]
+These options specify the minimum and maximum polling interval
+for reference clock messages, as a power of 2 in seconds
+For
+most directly connected reference clocks, both
+\f\*[B-Font]minpoll\f[]
+and
+\f\*[B-Font]maxpoll\f[]
+default to 6 (64 s).
+For modem reference clocks,
+\f\*[B-Font]minpoll\f[]
+defaults to 10 (17.1 m) and
+\f\*[B-Font]maxpoll\f[]
+defaults to 14 (4.5 h).
+The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
+.RE
+.TP 7
+.NOP \f\*[B-Font]fudge\f[] \f[C]127.127.\f[]\f\*[I-Font]t\f[].\f\*[I-Font]u\f[] [\f\*[B-Font]time1\f[] \f\*[I-Font]sec\f[]] [\f\*[B-Font]time2\f[] \f\*[I-Font]sec\f[]] [\f\*[B-Font]stratum\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]refid\f[] \f\*[I-Font]string\f[]] [\f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]flag1\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]] [\f\*[B-Font]flag2\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]] [\f\*[B-Font]flag3\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]] [\f\*[B-Font]flag4\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]]
+This command can be used to configure reference clocks in
+special ways.
+It must immediately follow the
+\f\*[B-Font]server\f[]
+command which configures the driver.
+Note that the same capability
+is possible at run time using the
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+program.
+The options are interpreted as
+follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]time1\f[] \f\*[I-Font]sec\f[]
+Specifies a constant to be added to the time offset produced by
+the driver, a fixed-point decimal number in seconds.
+This is used
+as a calibration constant to adjust the nominal time offset of a
+particular clock to agree with an external standard, such as a
+precision PPS signal.
+It also provides a way to correct a
+systematic error or bias due to serial port or operating system
+latencies, different cable lengths or receiver internal delay.
+The
+specified offset is in addition to the propagation delay provided
+by other means, such as internal DIPswitches.
+Where a calibration
+for an individual system and driver is available, an approximate
+correction is noted in the driver documentation pages.
+Note: in order to facilitate calibration when more than one
+radio clock or PPS signal is supported, a special calibration
+feature is available.
+It takes the form of an argument to the
+\f\*[B-Font]enable\f[]
+command described in
+\fIMiscellaneous\f[] \fIOptions\f[]
+page and operates as described in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.TP 7
+.NOP \f\*[B-Font]time2\f[] \f\*[I-Font]secs\f[]
+Specifies a fixed-point decimal number in seconds, which is
+interpreted in a driver-dependent way.
+See the descriptions of
+specific drivers in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.TP 7
+.NOP \f\*[B-Font]stratum\f[] \f\*[I-Font]int\f[]
+Specifies the stratum number assigned to the driver, an integer
+between 0 and 15.
+This number overrides the default stratum number
+ordinarily assigned by the driver itself, usually zero.
+.TP 7
+.NOP \f\*[B-Font]refid\f[] \f\*[I-Font]string\f[]
+Specifies an ASCII string of from one to four characters which
+defines the reference identifier used by the driver.
+This string
+overrides the default identifier ordinarily assigned by the driver
+itself.
+.TP 7
+.NOP \f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.TP 7
+.NOP \f\*[B-Font]flag1\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+.TP 7
+.NOP \f\*[B-Font]flag2\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+.TP 7
+.NOP \f\*[B-Font]flag3\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+.TP 7
+.NOP \f\*[B-Font]flag4\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+These four flags are used for customizing the clock driver.
+The
+interpretation of these values, and whether they are used at all,
+is a function of the particular clock driver.
+However, by
+convention
+\f\*[B-Font]flag4\f[]
+is used to enable recording monitoring
+data to the
+\f\*[B-Font]clockstats\f[]
+file configured with the
+\f\*[B-Font]filegen\f[]
+command.
+Further information on the
+\f\*[B-Font]filegen\f[]
+command can be found in
+\fIMonitoring\f[] \fIOptions\f[].
+.RE
+.PP
+.SH Miscellaneous Options
+.TP 7
+.NOP \f\*[B-Font]broadcastdelay\f[] \f\*[I-Font]seconds\f[]
+The broadcast and multicast modes require a special calibration
+to determine the network delay between the local and remote
+servers.
+Ordinarily, this is done automatically by the initial
+protocol exchanges between the client and server.
+In some cases,
+the calibration procedure may fail due to network or server access
+controls, for example.
+This command specifies the default delay to
+be used under these circumstances.
+Typically (for Ethernet), a
+number between 0.003 and 0.007 seconds is appropriate.
+The default
+when this command is not used is 0.004 seconds.
+.TP 7
+.NOP \f\*[B-Font]calldelay\f[] \f\*[I-Font]delay\f[]
+This option controls the delay in seconds between the first and second
+packets sent in burst or iburst mode to allow additional time for a modem
+or ISDN call to complete.
+.TP 7
+.NOP \f\*[B-Font]driftfile\f[] \f\*[I-Font]driftfile\f[]
+This command specifies the complete path and name of the file used to
+record the frequency of the local clock oscillator.
+This is the same
+operation as the
+\f\*[B-Font]\-f\f[]
+command line option.
+If the file exists, it is read at
+startup in order to set the initial frequency and then updated once per
+hour with the current frequency computed by the daemon.
+If the file name is
+specified, but the file itself does not exist, the starts with an initial
+frequency of zero and creates the file when writing it for the first time.
+If this command is not given, the daemon will always start with an initial
+frequency of zero.
+.sp \n(Ppu
+.ne 2
+
+The file format consists of a single line containing a single
+floating point number, which records the frequency offset measured
+in parts-per-million (PPM).
+The file is updated by first writing
+the current drift value into a temporary file and then renaming
+this file to replace the old version.
+This implies that
+\fCntpd\fR(1ntpdmdoc)\f[]
+must have write permission for the directory the
+drift file is located in, and that file system links, symbolic or
+otherwise, should be avoided.
+.TP 7
+.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+.TP 7
+.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+Provides a way to enable or disable various server options.
+Flags not mentioned are unaffected.
+Note that all of these flags
+can be controlled remotely using the
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utility program.
+.RS
+.TP 7
+.NOP \f\*[B-Font]auth\f[]
+Enables the server to synchronize with unconfigured peers only if the
+peer has been correctly authenticated using either public key or
+private key cryptography.
+The default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]bclient\f[]
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the
+\f\*[B-Font]multicastclient\f[]
+command with default
+address.
+The default for this flag is
+\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]calibrate\f[]
+Enables the calibrate feature for reference clocks.
+The default for
+this flag is
+\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]kernel\f[]
+Enables the kernel time discipline, if available.
+The default for this
+flag is
+\f\*[B-Font]enable\f[]
+if support is available, otherwise
+\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]mode7\f[]
+Enables processing of NTP mode 7 implementation-specific requests
+which are used by the deprecated
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+program.
+The default for this flag is disable.
+This flag is excluded from runtime configuration using
+\fCntpq\fR(1ntpqmdoc)\f[].
+The
+\fCntpq\fR(1ntpqmdoc)\f[]
+program provides the same capabilities as
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+using standard mode 6 requests.
+.TP 7
+.NOP \f\*[B-Font]monitor\f[]
+Enables the monitoring facility.
+See the
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+program
+and the
+\f\*[B-Font]monlist\f[]
+command or further information.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]ntp\f[]
+Enables time and frequency discipline.
+In effect, this switch opens and
+closes the feedback loop, which is useful for testing.
+The default for
+this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]stats\f[]
+Enables the statistics facility.
+See the
+\fIMonitoring\f[] \fIOptions\f[]
+section for further information.
+The default for this flag is
+\f\*[B-Font]disable\f[].
+.RE
+.TP 7
+.NOP \f\*[B-Font]includefile\f[] \f\*[I-Font]includefile\f[]
+This command allows additional configuration commands
+to be included from a separate file.
+Include files may
+be nested to a depth of five; upon reaching the end of any
+include file, command processing resumes in the previous
+configuration file.
+This option is useful for sites that run
+\fCntpd\fR(1ntpdmdoc)\f[]
+on multiple hosts, with (mostly) common options (e.g., a
+restriction list).
+.TP 7
+.NOP \f\*[B-Font]logconfig\f[] \f\*[I-Font]configkeyword\f[]
+This command controls the amount and type of output written to
+the system
+\fCsyslog\fR(3)\f[]
+facility or the alternate
+\f\*[B-Font]logfile\f[]
+log file.
+By default, all output is turned on.
+All
+\f\*[I-Font]configkeyword\f[]
+keywords can be prefixed with
+\[oq]=\[cq],
+\[oq]+\[cq]
+and
+\[oq]\-\[cq],
+where
+\[oq]=\[cq]
+sets the
+\fCsyslog\fR(3)\f[]
+priority mask,
+\[oq]+\[cq]
+adds and
+\[oq]\-\[cq]
+removes
+messages.
+\fCsyslog\fR(3)\f[]
+messages can be controlled in four
+classes
+(\f\*[B-Font]clock\f[], \f\*[B-Font]peer\f[], \f\*[B-Font]sys\f[] and \f\*[B-Font]sync\f[]).
+Within these classes four types of messages can be
+controlled: informational messages
+(\f\*[B-Font]info\f[]),
+event messages
+(\f\*[B-Font]events\f[]),
+statistics messages
+(\f\*[B-Font]statistics\f[])
+and
+status messages
+(\f\*[B-Font]status\f[]).
+.sp \n(Ppu
+.ne 2
+
+Configuration keywords are formed by concatenating the message class with
+the event class.
+The
+\f\*[B-Font]all\f[]
+prefix can be used instead of a message class.
+A
+message class may also be followed by the
+\f\*[B-Font]all\f[]
+keyword to enable/disable all
+messages of the respective message class.Thus, a minimal log configuration
+could look like this:
+.br
+.in +4
+.nf
+logconfig =syncstatus +sysevents
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+This would just list the synchronizations state of
+\fCntpd\fR(1ntpdmdoc)\f[]
+and the major system events.
+For a simple reference server, the
+following minimum message configuration could be useful:
+.br
+.in +4
+.nf
+logconfig =syncall +clockall
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+This configuration will list all clock information and
+synchronization information.
+All other events and messages about
+peers, system events and so on is suppressed.
+.TP 7
+.NOP \f\*[B-Font]logfile\f[] \f\*[I-Font]logfile\f[]
+This command specifies the location of an alternate log file to
+be used instead of the default system
+\fCsyslog\fR(3)\f[]
+facility.
+This is the same operation as the \-l command line option.
+.TP 7
+.NOP \f\*[B-Font]setvar\f[] \f\*[I-Font]variable\f[] [\f\*[B-Font]default\f[]]
+This command adds an additional system variable.
+These
+variables can be used to distribute additional information such as
+the access policy.
+If the variable of the form
+\fIname\f[]\fI=\f[]\f\*[I-Font]value\f[]
+is followed by the
+\f\*[B-Font]default\f[]
+keyword, the
+variable will be listed as part of the default system variables
+(\fCntpq\fR(1ntpqmdoc)\f[] \f\*[B-Font]rv\f[] command)).
+These additional variables serve
+informational purposes only.
+They are not related to the protocol
+other that they can be listed.
+The known protocol variables will
+always override any variables defined via the
+\f\*[B-Font]setvar\f[]
+mechanism.
+There are three special variables that contain the names
+of all variable of the same group.
+The
+\fIsys_var_list\f[]
+holds
+the names of all system variables.
+The
+\fIpeer_var_list\f[]
+holds
+the names of all peer variables and the
+\fIclock_var_list\f[]
+holds the names of the reference clock variables.
+.TP 7
+.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
+This command can be used to alter several system variables in
+very exceptional circumstances.
+It should occur in the
+configuration file before any other configuration options.
+The
+default values of these variables have been carefully optimized for
+a wide range of network speeds and reliability expectations.
+In
+general, they interact in intricate ways that are hard to predict
+and some combinations can result in some very nasty behavior.
+Very
+rarely is it necessary to change the default values; but, some
+folks cannot resist twisting the knobs anyway and this command is
+for them.
+Emphasis added: twisters are on their own and can expect
+no help from the support group.
+.sp \n(Ppu
+.ne 2
+
+The variables operate as follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[]
+The argument becomes the new value for the minimum Allan
+intercept, which is a parameter of the PLL/FLL clock discipline
+algorithm.
+The value in log2 seconds defaults to 7 (1024 s), which is also the lower
+limit.
+.TP 7
+.NOP \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[]
+The argument becomes the new value for the dispersion increase rate,
+normally .000015 s/s.
+.TP 7
+.NOP \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[]
+The argument becomes the initial value of the frequency offset in
+parts-per-million.
+This overrides the value in the frequency file, if
+present, and avoids the initial training state if it is not.
+.TP 7
+.NOP \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[]
+The argument becomes the new value for the experimental
+huff-n'-puff filter span, which determines the most recent interval
+the algorithm will search for a minimum delay.
+The lower limit is
+900 s (15 m), but a more reasonable value is 7200 (2 hours).
+There
+is no default, since the filter is not enabled unless this command
+is given.
+.TP 7
+.NOP \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[]
+The argument is the panic threshold, normally 1000 s.
+If set to zero,
+the panic sanity check is disabled and a clock offset of any value will
+be accepted.
+.TP 7
+.NOP \f\*[B-Font]step\f[] \f\*[I-Font]step\f[]
+The argument is the step threshold, which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if the step threshold is set to zero or greater than the
+default.
+.TP 7
+.NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]
+The argument is the stepout timeout, which by default is 900 s.
+It can
+be set to any positive number in seconds.
+If set to zero, the stepout
+pulses will not be suppressed.
+.RE
+.TP 7
+.NOP \f\*[B-Font]rlimit\f[] [\f\*[B-Font]memlock\f[] \f\*[I-Font]Nmegabytes\f[] | \f\*[B-Font]stacksize\f[] \f\*[I-Font]N4kPages\f[] \f\*[B-Font]filenum\f[] \f\*[I-Font]Nfiledescriptors\f[]]
+.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
+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.
+.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
+.TP 7
+.NOP \f\*[B-Font]filenum\f[] \f\*[I-Font]Nfiledescriptors\f[]
+Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
+\fBmlockall\fR()\f[]
+function.
+Defaults to 50 4k pages (200 4k pages in OpenBSD).
+.RE
+.TP 7
+.NOP \f\*[B-Font]trap\f[] \f\*[I-Font]host_address\f[] [\f\*[B-Font]port\f[] \f\*[I-Font]port_number\f[]] [\f\*[B-Font]interface\f[] \f\*[I-Font]interface_address\f[]]
+This command configures a trap receiver at the given host
+address and port number for sending messages with the specified
+local interface address.
+If the port number is unspecified, a value
+of 18447 is used.
+If the interface address is not specified, the
+message is sent with a source address of the local interface the
+message is sent through.
+Note that on a multihomed host the
+interface used may vary from time to time with routing changes.
+.sp \n(Ppu
+.ne 2
+
+The trap receiver will generally log event messages and other
+information from the server in a log file.
+While such monitor
+programs may also request their own trap dynamically, configuring a
+trap receiver will ensure that no messages are lost when the server
+is started.
+.TP 7
+.NOP \f\*[B-Font]hop\f[] \f\*[I-Font]...\f[]
+This command specifies a list of TTL values in increasing order, up to 8
+values can be specified.
+In manycast mode these values are used in turn in
+an expanding-ring search.
+The default is eight multiples of 32 starting at
+31.
+.PP
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTP_CONF_<option-name>\fP or \fBNTP_CONF\fP
+.fi
+.ad
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH FILES
+.TP 15
+.NOP \fI/etc/ntp.conf\f[]
+the default name of the configuration file
+.br
+.ns
+.TP 15
+.NOP \fIntp.keys\f[]
+private MD5 keys
+.br
+.ns
+.TP 15
+.NOP \fIntpkey\f[]
+RSA private key
+.br
+.ns
+.TP 15
+.NOP \fIntpkey_\f[]\f\*[I-Font]host\f[]
+RSA public key
+.br
+.ns
+.TP 15
+.NOP \fIntp_dh\f[]
+Diffie-Hellman agreement parameters
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "SEE ALSO"
+\fCntpd\fR(1ntpdmdoc)\f[],
+\fCntpdc\fR(1ntpdcmdoc)\f[],
+\fCntpq\fR(1ntpqmdoc)\f[]
+.sp \n(Ppu
+.ne 2
+
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+\f[C]http://www.ntp.org/\f[].
+A snapshot of this documentation is available in HTML format in
+\fI/usr/share/doc/ntp\f[].
+David L. Mills,
+\fINetwork Time Protocol (Version 4)\fR,
+RFC5905
+.PP
+
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+The syntax checking is not picky; some combinations of
+ridiculous and even hilarious options and modes may not be
+detected.
+.sp \n(Ppu
+.ne 2
+
+The
+\fIntpkey_\f[]\f\*[I-Font]host\f[]
+files are really digital
+certificates.
+These should be obtained via secure directory
+services when they become universally available.
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+This document was derived from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp.conf\fP
+option definitions.
diff --git a/ntpd/ntp.conf.5mdoc b/ntpd/ntp.conf.5mdoc
new file mode 100644
index 0000000..998a274
--- /dev/null
+++ b/ntpd/ntp.conf.5mdoc
@@ -0,0 +1,2808 @@
+.Dd December 2 2014
+.Dt NTP_CONF 5mdoc File Formats
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:58 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.conf.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp.conf
+.Nd Network Time Protocol (NTP) daemon configuration file format
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+The
+.Nm
+configuration file is read at initial startup by the
+.Xr ntpd 1ntpdmdoc
+daemon in order to specify the synchronization sources,
+modes and other related information.
+Usually, it is installed in the
+.Pa /etc
+directory,
+but could be installed elsewhere
+(see the daemon's
+.Fl c
+command line option).
+.Pp
+The file format is similar to other
+.Ux
+configuration files.
+Comments begin with a
+.Ql #
+character and extend to the end of the line;
+blank lines are ignored.
+Configuration commands consist of an initial keyword
+followed by a list of arguments,
+some of which may be optional, separated by whitespace.
+Commands may not be continued over multiple lines.
+Arguments may be host names,
+host addresses written in numeric, dotted\-quad form,
+integers, floating point numbers (when specifying times in seconds)
+and text strings.
+.Pp
+The rest of this page describes the configuration and control options.
+The
+.Qq Notes on Configuring NTP and Setting up an NTP Subnet
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+contains an extended discussion of these options.
+In addition to the discussion of general
+.Sx Configuration Options ,
+there are sections describing the following supported functionality
+and the options used to control it:
+.Bl -bullet -offset indent
+.It
+.Sx Authentication Support
+.It
+.Sx Monitoring Support
+.It
+.Sx Access Control Support
+.It
+.Sx Automatic NTP Configuration Options
+.It
+.Sx Reference Clock Support
+.It
+.Sx Miscellaneous Options
+.El
+.Pp
+Following these is a section describing
+.Sx Miscellaneous Options .
+While there is a rich set of options available,
+the only required option is one or more
+.Ic pool ,
+.Ic server ,
+.Ic peer ,
+.Ic broadcast
+or
+.Ic manycastclient
+commands.
+.Sh Configuration Support
+Following is a description of the configuration commands in
+NTPv4.
+These commands have the same basic functions as in NTPv3 and
+in some cases new functions and new arguments.
+There are two
+classes of commands, configuration commands that configure a
+persistent association with a remote server or peer or reference
+clock, and auxiliary commands that specify environmental variables
+that control various related operations.
+.Ss Configuration Commands
+The various modes are determined by the command keyword and the
+type of the required IP address.
+Addresses are classed by type as
+(s) a remote server or peer (IPv4 class A, B and C), (b) the
+broadcast address of a local interface, (m) a multicast address (IPv4
+class D), or (r) a reference clock address (127.127.x.x).
+Note that
+only those options applicable to each command are listed below.
+Use
+of options not listed may not be caught as an error, but may result
+in some weird and even destructive behavior.
+.Pp
+If the Basic Socket Interface Extensions for IPv6 (RFC\-2553)
+is detected, support for the IPv6 address family is generated
+in addition to the default support of the IPv4 address family.
+In a few cases, including the reslist billboard generated
+by ntpdc, IPv6 addresses are automatically generated.
+IPv6 addresses can be identified by the presence of colons
+.Dq \&:
+in the address field.
+IPv6 addresses can be used almost everywhere where
+IPv4 addresses can be used,
+with the exception of reference clock addresses,
+which are always IPv4.
+.Pp
+Note that in contexts where a host name is expected, a
+.Fl 4
+qualifier preceding
+the host name forces DNS resolution to the IPv4 namespace,
+while a
+.Fl 6
+qualifier forces DNS resolution to the IPv6 namespace.
+See IPv6 references for the
+equivalent classes for that address family.
+.Bl -tag -width indent
+.It Xo Ic pool Ar address
+.Op Cm burst
+.Op Cm iburst
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic server Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm burst
+.Op Cm iburst
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic peer Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic broadcast Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm ttl Ar ttl
+.Xc
+.It Xo Ic manycastclient Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Op Cm ttl Ar ttl
+.Xc
+.El
+.Pp
+These five commands specify the time server name or address to
+be used and the mode in which to operate.
+The
+.Ar address
+can be
+either a DNS name or an IP address in dotted\-quad notation.
+Additional information on association behavior can be found in the
+.Qq Association Management
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Bl -tag -width indent
+.It Ic pool
+For type s addresses, this command mobilizes a persistent
+client mode association with a number of remote servers.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+.It Ic server
+For type s and r addresses, this command mobilizes a persistent
+client mode association with the specified remote server or local
+radio clock.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+This command should
+.Em not
+be used for type
+b or m addresses.
+.It Ic peer
+For type s addresses (only), this command mobilizes a
+persistent symmetric\-active mode association with the specified
+remote peer.
+In this mode the local clock can be synchronized to
+the remote peer or the remote peer can be synchronized to the local
+clock.
+This is useful in a network of servers where, depending on
+various failure scenarios, either the local or remote peer may be
+the better source of time.
+This command should NOT be used for type
+b, m or r addresses.
+.It Ic broadcast
+For type b and m addresses (only), this
+command mobilizes a persistent broadcast mode association.
+Multiple
+commands can be used to specify multiple local broadcast interfaces
+(subnets) and/or multiple multicast groups.
+Note that local
+broadcast messages go only to the interface associated with the
+subnet specified, but multicast messages go to all interfaces.
+In broadcast mode the local server sends periodic broadcast
+messages to a client population at the
+.Ar address
+specified, which is usually the broadcast address on (one of) the
+local network(s) or a multicast address assigned to NTP.
+The IANA
+has assigned the multicast group address IPv4 224.0.1.1 and
+IPv6 ff05::101 (site local) exclusively to
+NTP, but other nonconflicting addresses can be used to contain the
+messages within administrative boundaries.
+Ordinarily, this
+specification applies only to the local server operating as a
+sender; for operation as a broadcast client, see the
+.Ic broadcastclient
+or
+.Ic multicastclient
+commands
+below.
+.It Ic manycastclient
+For type m addresses (only), this command mobilizes a
+manycast client mode association for the multicast address
+specified.
+In this case a specific address must be supplied which
+matches the address used on the
+.Ic manycastserver
+command for
+the designated manycast servers.
+The NTP multicast address
+224.0.1.1 assigned by the IANA should NOT be used, unless specific
+means are taken to avoid spraying large areas of the Internet with
+these messages and causing a possibly massive implosion of replies
+at the sender.
+The
+.Ic manycastserver
+command specifies that the local server
+is to operate in client mode with the remote servers that are
+discovered as the result of broadcast/multicast messages.
+The
+client broadcasts a request message to the group address associated
+with the specified
+.Ar address
+and specifically enabled
+servers respond to these messages.
+The client selects the servers
+providing the best time and continues as with the
+.Ic server
+command.
+The remaining servers are discarded as if never
+heard.
+.El
+.Pp
+Options:
+.Bl -tag -width indent
+.It Cm autokey
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the autokey scheme
+described in
+.Sx Authentication Options .
+.It Cm burst
+when the server is reachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first and second packets
+can be changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to improve timekeeping quality
+with the
+.Ic server
+command and s addresses.
+.It Cm iburst
+When the server is unreachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first two packets can be
+changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to speed the initial synchronization
+acquisition with the
+.Ic server
+command and s addresses and when
+.Xr ntpd 1ntpdmdoc
+is started with the
+.Fl q
+option.
+.It Cm key Ar key
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the specified
+.Ar key
+identifier with values from 1 to 65534, inclusive.
+The
+default is to include no encryption field.
+.It Cm minpoll Ar minpoll
+.It Cm maxpoll Ar maxpoll
+These options specify the minimum and maximum poll intervals
+for NTP messages, as a power of 2 in seconds
+The maximum poll
+interval defaults to 10 (1,024 s), but can be increased by the
+.Cm maxpoll
+option to an upper limit of 17 (36.4 h).
+The
+minimum poll interval defaults to 6 (64 s), but can be decreased by
+the
+.Cm minpoll
+option to a lower limit of 4 (16 s).
+.It Cm noselect
+Marks the server as unused, except for display purposes.
+The server is discarded by the selection algroithm.
+.It Cm prefer
+Marks the server as preferred.
+All other things being equal,
+this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+.Qq Mitigation Rules and the prefer Keyword
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+for further information.
+.It Cm ttl Ar ttl
+This option is used only with broadcast server and manycast
+client modes.
+It specifies the time\-to\-live
+.Ar ttl
+to
+use on broadcast server and multicast server and the maximum
+.Ar ttl
+for the expanding ring search with manycast
+client packets.
+Selection of the proper value, which defaults to
+127, is something of a black art and should be coordinated with the
+network administrator.
+.It Cm version Ar version
+Specifies the version number to be used for outgoing NTP
+packets.
+Versions 1\-4 are the choices, with version 4 the
+default.
+.El
+.Ss Auxiliary Commands
+.Bl -tag -width indent
+.It Ic broadcastclient
+This command enables reception of broadcast server messages to
+any local interface (type b) address.
+Upon receiving a message for
+the first time, the broadcast client measures the nominal server
+propagation delay using a brief client/server exchange with the
+server, then enters the broadcast client mode, in which it
+synchronizes to succeeding broadcast messages.
+Note that, in order
+to avoid accidental or malicious disruption in this mode, both the
+server and client should operate using symmetric\-key or public\-key
+authentication as described in
+.Sx Authentication Options .
+.It Ic manycastserver Ar address ...
+This command enables reception of manycast client messages to
+the multicast group address(es) (type m) specified.
+At least one
+address is required, but the NTP multicast address 224.0.1.1
+assigned by the IANA should NOT be used, unless specific means are
+taken to limit the span of the reply and avoid a possibly massive
+implosion at the original sender.
+Note that, in order to avoid
+accidental or malicious disruption in this mode, both the server
+and client should operate using symmetric\-key or public\-key
+authentication as described in
+.Sx Authentication Options .
+.It Ic multicastclient Ar address ...
+This command enables reception of multicast server messages to
+the multicast group address(es) (type m) specified.
+Upon receiving
+a message for the first time, the multicast client measures the
+nominal server propagation delay using a brief client/server
+exchange with the server, then enters the broadcast client mode, in
+which it synchronizes to succeeding multicast messages.
+Note that,
+in order to avoid accidental or malicious disruption in this mode,
+both the server and client should operate using symmetric\-key or
+public\-key authentication as described in
+.Sx Authentication Options .
+.El
+.Sh Authentication Support
+Authentication support allows the NTP client to verify that the
+server is in fact known and trusted and not an intruder intending
+accidentally or on purpose to masquerade as that server.
+The NTPv3
+specification RFC\-1305 defines a scheme which provides
+cryptographic authentication of received NTP packets.
+Originally,
+this was done using the Data Encryption Standard (DES) algorithm
+operating in Cipher Block Chaining (CBC) mode, commonly called
+DES\-CBC.
+Subsequently, this was replaced by the RSA Message Digest
+5 (MD5) algorithm using a private key, commonly called keyed\-MD5.
+Either algorithm computes a message digest, or one\-way hash, which
+can be used to verify the server has the correct private key and
+key identifier.
+.Pp
+NTPv4 retains the NTPv3 scheme, properly described as symmetric key
+cryptography and, in addition, provides a new Autokey scheme
+based on public key cryptography.
+Public key cryptography is generally considered more secure
+than symmetric key cryptography, since the security is based
+on a private value which is generated by each server and
+never revealed.
+With Autokey all key distribution and
+management functions involve only public values, which
+considerably simplifies key distribution and storage.
+Public key management is based on X.509 certificates,
+which can be provided by commercial services or
+produced by utility programs in the OpenSSL software library
+or the NTPv4 distribution.
+.Pp
+While the algorithms for symmetric key cryptography are
+included in the NTPv4 distribution, public key cryptography
+requires the OpenSSL software library to be installed
+before building the NTP distribution.
+Directions for doing that
+are on the Building and Installing the Distribution page.
+.Pp
+Authentication is configured separately for each association
+using the
+.Cm key
+or
+.Cm autokey
+subcommand on the
+.Ic peer ,
+.Ic server ,
+.Ic broadcast
+and
+.Ic manycastclient
+configuration commands as described in
+.Sx Configuration Options
+page.
+The authentication
+options described below specify the locations of the key files,
+if other than default, which symmetric keys are trusted
+and the interval between various operations, if other than default.
+.Pp
+Authentication is always enabled,
+although ineffective if not configured as
+described below.
+If a NTP packet arrives
+including a message authentication
+code (MAC), it is accepted only if it
+passes all cryptographic checks.
+The
+checks require correct key ID, key value
+and message digest.
+If the packet has
+been modified in any way or replayed
+by an intruder, it will fail one or more
+of these checks and be discarded.
+Furthermore, the Autokey scheme requires a
+preliminary protocol exchange to obtain
+the server certificate, verify its
+credentials and initialize the protocol
+.Pp
+The
+.Cm auth
+flag controls whether new associations or
+remote configuration commands require cryptographic authentication.
+This flag can be set or reset by the
+.Ic enable
+and
+.Ic disable
+commands and also by remote
+configuration commands sent by a
+.Xr ntpdc 1ntpdcmdoc
+program running in
+another machine.
+If this flag is enabled, which is the default
+case, new broadcast client and symmetric passive associations and
+remote configuration commands must be cryptographically
+authenticated using either symmetric key or public key cryptography.
+If this
+flag is disabled, these operations are effective
+even if not cryptographic
+authenticated.
+It should be understood
+that operating with the
+.Ic auth
+flag disabled invites a significant vulnerability
+where a rogue hacker can
+masquerade as a falseticker and seriously
+disrupt system timekeeping.
+It is
+important to note that this flag has no purpose
+other than to allow or disallow
+a new association in response to new broadcast
+and symmetric active messages
+and remote configuration commands and, in particular,
+the flag has no effect on
+the authentication process itself.
+.Pp
+An attractive alternative where multicast support is available
+is manycast mode, in which clients periodically troll
+for servers as described in the
+.Sx Automatic NTP Configuration Options
+page.
+Either symmetric key or public key
+cryptographic authentication can be used in this mode.
+The principle advantage
+of manycast mode is that potential servers need not be
+configured in advance,
+since the client finds them during regular operation,
+and the configuration
+files for all clients can be identical.
+.Pp
+The security model and protocol schemes for
+both symmetric key and public key
+cryptography are summarized below;
+further details are in the briefings, papers
+and reports at the NTP project page linked from
+.Li http://www.ntp.org/ .
+.Ss Symmetric\-Key Cryptography
+The original RFC\-1305 specification allows any one of possibly
+65,534 keys, each distinguished by a 32\-bit key identifier, to
+authenticate an association.
+The servers and clients involved must
+agree on the key and key identifier to
+authenticate NTP packets.
+Keys and
+related information are specified in a key
+file, usually called
+.Pa ntp.keys ,
+which must be distributed and stored using
+secure means beyond the scope of the NTP protocol itself.
+Besides the keys used
+for ordinary NTP associations,
+additional keys can be used as passwords for the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+.Pp
+When
+.Xr ntpd 1ntpdmdoc
+is first started, it reads the key file specified in the
+.Ic keys
+configuration command and installs the keys
+in the key cache.
+However,
+individual keys must be activated with the
+.Ic trusted
+command before use.
+This
+allows, for instance, the installation of possibly
+several batches of keys and
+then activating or deactivating each batch
+remotely using
+.Xr ntpdc 1ntpdcmdoc .
+This also provides a revocation capability that can be used
+if a key becomes compromised.
+The
+.Ic requestkey
+command selects the key used as the password for the
+.Xr ntpdc 1ntpdcmdoc
+utility, while the
+.Ic controlkey
+command selects the key used as the password for the
+.Xr ntpq 1ntpqmdoc
+utility.
+.Ss Public Key Cryptography
+NTPv4 supports the original NTPv3 symmetric key scheme
+described in RFC\-1305 and in addition the Autokey protocol,
+which is based on public key cryptography.
+The Autokey Version 2 protocol described on the Autokey Protocol
+page verifies packet integrity using MD5 message digests
+and verifies the source with digital signatures and any of several
+digest/signature schemes.
+Optional identity schemes described on the Identity Schemes
+page and based on cryptographic challenge/response algorithms
+are also available.
+Using all of these schemes provides strong security against
+replay with or without modification, spoofing, masquerade
+and most forms of clogging attacks.
+.\" .Pp
+.\" The cryptographic means necessary for all Autokey operations
+.\" is provided by the OpenSSL software library.
+.\" This library is available from http://www.openssl.org/
+.\" and can be installed using the procedures outlined
+.\" in the Building and Installing the Distribution page.
+.\" Once installed,
+.\" the configure and build
+.\" process automatically detects the library and links
+.\" the library routines required.
+.Pp
+The Autokey protocol has several modes of operation
+corresponding to the various NTP modes supported.
+Most modes use a special cookie which can be
+computed independently by the client and server,
+but encrypted in transmission.
+All modes use in addition a variant of the S\-KEY scheme,
+in which a pseudo\-random key list is generated and used
+in reverse order.
+These schemes are described along with an executive summary,
+current status, briefing slides and reading list on the
+.Sx Autonomous Authentication
+page.
+.Pp
+The specific cryptographic environment used by Autokey servers
+and clients is determined by a set of files
+and soft links generated by the
+.Xr ntp\-keygen 1ntpkeygenmdoc
+program.
+This includes a required host key file,
+required certificate file and optional sign key file,
+leapsecond file and identity scheme files.
+The
+digest/signature scheme is specified in the X.509 certificate
+along with the matching sign key.
+There are several schemes
+available in the OpenSSL software library, each identified
+by a specific string such as
+.Cm md5WithRSAEncryption ,
+which stands for the MD5 message digest with RSA
+encryption scheme.
+The current NTP distribution supports
+all the schemes in the OpenSSL library, including
+those based on RSA and DSA digital signatures.
+.Pp
+NTP secure groups can be used to define cryptographic compartments
+and security hierarchies.
+It is important that every host
+in the group be able to construct a certificate trail to one
+or more trusted hosts in the same group.
+Each group
+host runs the Autokey protocol to obtain the certificates
+for all hosts along the trail to one or more trusted hosts.
+This requires the configuration file in all hosts to be
+engineered so that, even under anticipated failure conditions,
+the NTP subnet will form such that every group host can find
+a trail to at least one trusted host.
+.Ss Naming and Addressing
+It is important to note that Autokey does not use DNS to
+resolve addresses, since DNS can't be completely trusted
+until the name servers have synchronized clocks.
+The cryptographic name used by Autokey to bind the host identity
+credentials and cryptographic values must be independent
+of interface, network and any other naming convention.
+The name appears in the host certificate in either or both
+the subject and issuer fields, so protection against
+DNS compromise is essential.
+.Pp
+By convention, the name of an Autokey host is the name returned
+by the Unix
+.Xr gethostname 2
+system call or equivalent in other systems.
+By the system design
+model, there are no provisions to allow alternate names or aliases.
+However, this is not to say that DNS aliases, different names
+for each interface, etc., are constrained in any way.
+.Pp
+It is also important to note that Autokey verifies authenticity
+using the host name, network address and public keys,
+all of which are bound together by the protocol specifically
+to deflect masquerade attacks.
+For this reason Autokey
+includes the source and destinatino IP addresses in message digest
+computations and so the same addresses must be available
+at both the server and client.
+For this reason operation
+with network address translation schemes is not possible.
+This reflects the intended robust security model where government
+and corporate NTP servers are operated outside firewall perimeters.
+.Ss Operation
+A specific combination of authentication scheme (none,
+symmetric key, public key) and identity scheme is called
+a cryptotype, although not all combinations are compatible.
+There may be management configurations where the clients,
+servers and peers may not all support the same cryptotypes.
+A secure NTPv4 subnet can be configured in many ways while
+keeping in mind the principles explained above and
+in this section.
+Note however that some cryptotype
+combinations may successfully interoperate with each other,
+but may not represent good security practice.
+.Pp
+The cryptotype of an association is determined at the time
+of mobilization, either at configuration time or some time
+later when a message of appropriate cryptotype arrives.
+When mobilized by a
+.Ic server
+or
+.Ic peer
+configuration command and no
+.Ic key
+or
+.Ic autokey
+subcommands are present, the association is not
+authenticated; if the
+.Ic key
+subcommand is present, the association is authenticated
+using the symmetric key ID specified; if the
+.Ic autokey
+subcommand is present, the association is authenticated
+using Autokey.
+.Pp
+When multiple identity schemes are supported in the Autokey
+protocol, the first message exchange determines which one is used.
+The client request message contains bits corresponding
+to which schemes it has available.
+The server response message
+contains bits corresponding to which schemes it has available.
+Both server and client match the received bits with their own
+and select a common scheme.
+.Pp
+Following the principle that time is a public value,
+a server responds to any client packet that matches
+its cryptotype capabilities.
+Thus, a server receiving
+an unauthenticated packet will respond with an unauthenticated
+packet, while the same server receiving a packet of a cryptotype
+it supports will respond with packets of that cryptotype.
+However, unconfigured broadcast or manycast client
+associations or symmetric passive associations will not be
+mobilized unless the server supports a cryptotype compatible
+with the first packet received.
+By default, unauthenticated associations will not be mobilized
+unless overridden in a decidedly dangerous way.
+.Pp
+Some examples may help to reduce confusion.
+Client Alice has no specific cryptotype selected.
+Server Bob has both a symmetric key file and minimal Autokey files.
+Alice's unauthenticated messages arrive at Bob, who replies with
+unauthenticated messages.
+Cathy has a copy of Bob's symmetric
+key file and has selected key ID 4 in messages to Bob.
+Bob verifies the message with his key ID 4.
+If it's the
+same key and the message is verified, Bob sends Cathy a reply
+authenticated with that key.
+If verification fails,
+Bob sends Cathy a thing called a crypto\-NAK, which tells her
+something broke.
+She can see the evidence using the
+.Xr ntpq 1ntpqmdoc
+program.
+.Pp
+Denise has rolled her own host key and certificate.
+She also uses one of the identity schemes as Bob.
+She sends the first Autokey message to Bob and they
+both dance the protocol authentication and identity steps.
+If all comes out okay, Denise and Bob continue as described above.
+.Pp
+It should be clear from the above that Bob can support
+all the girls at the same time, as long as he has compatible
+authentication and identity credentials.
+Now, Bob can act just like the girls in his own choice of servers;
+he can run multiple configured associations with multiple different
+servers (or the same server, although that might not be useful).
+But, wise security policy might preclude some cryptotype
+combinations; for instance, running an identity scheme
+with one server and no authentication with another might not be wise.
+.Ss Key Management
+The cryptographic values used by the Autokey protocol are
+incorporated as a set of files generated by the
+.Xr ntp\-keygen 1ntpkeygenmdoc
+utility program, including symmetric key, host key and
+public certificate files, as well as sign key, identity parameters
+and leapseconds files.
+Alternatively, host and sign keys and
+certificate files can be generated by the OpenSSL utilities
+and certificates can be imported from public certificate
+authorities.
+Note that symmetric keys are necessary for the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+The remaining files are necessary only for the
+Autokey protocol.
+.Pp
+Certificates imported from OpenSSL or public certificate
+authorities have certian limitations.
+The certificate should be in ASN.1 syntax, X.509 Version 3
+format and encoded in PEM, which is the same format
+used by OpenSSL.
+The overall length of the certificate encoded
+in ASN.1 must not exceed 1024 bytes.
+The subject distinguished
+name field (CN) is the fully qualified name of the host
+on which it is used; the remaining subject fields are ignored.
+The certificate extension fields must not contain either
+a subject key identifier or a issuer key identifier field;
+however, an extended key usage field for a trusted host must
+contain the value
+.Cm trustRoot ; .
+Other extension fields are ignored.
+.Ss Authentication Commands
+.Bl -tag -width indent
+.It Ic autokey Op Ar logsec
+Specifies the interval between regenerations of the session key
+list used with the Autokey protocol.
+Note that the size of the key
+list for each association depends on this interval and the current
+poll interval.
+The default value is 12 (4096 s or about 1.1 hours).
+For poll intervals above the specified interval, a session key list
+with a single entry will be regenerated for every message
+sent.
+.It Ic controlkey Ar key
+Specifies the key identifier to use with the
+.Xr ntpq 1ntpqmdoc
+utility, which uses the standard
+protocol defined in RFC\-1305.
+The
+.Ar key
+argument is
+the key identifier for a trusted key, where the value can be in the
+range 1 to 65,534, inclusive.
+.It Xo Ic crypto
+.Op Cm cert Ar file
+.Op Cm leap Ar file
+.Op Cm randfile Ar file
+.Op Cm host Ar file
+.Op Cm sign Ar file
+.Op Cm gq Ar file
+.Op Cm gqpar Ar file
+.Op Cm iffpar Ar file
+.Op Cm mvpar Ar file
+.Op Cm pw Ar password
+.Xc
+This command requires the OpenSSL library.
+It activates public key
+cryptography, selects the message digest and signature
+encryption scheme and loads the required private and public
+values described above.
+If one or more files are left unspecified,
+the default names are used as described above.
+Unless the complete path and name of the file are specified, the
+location of a file is relative to the keys directory specified
+in the
+.Ic keysdir
+command or default
+.Pa /usr/local/etc .
+Following are the subcommands:
+.Bl -tag -width indent
+.It Cm cert Ar file
+Specifies the location of the required host public certificate file.
+This overrides the link
+.Pa ntpkey_cert_ Ns Ar hostname
+in the keys directory.
+.It Cm gqpar Ar file
+Specifies the location of the optional GQ parameters file.
+This
+overrides the link
+.Pa ntpkey_gq_ Ns Ar hostname
+in the keys directory.
+.It Cm host Ar file
+Specifies the location of the required host key file.
+This overrides
+the link
+.Pa ntpkey_key_ Ns Ar hostname
+in the keys directory.
+.It Cm iffpar Ar file
+Specifies the location of the optional IFF parameters file.This
+overrides the link
+.Pa ntpkey_iff_ Ns Ar hostname
+in the keys directory.
+.It Cm leap Ar file
+Specifies the location of the optional leapsecond file.
+This overrides the link
+.Pa ntpkey_leap
+in the keys directory.
+.It Cm mvpar Ar file
+Specifies the location of the optional MV parameters file.
+This
+overrides the link
+.Pa ntpkey_mv_ Ns Ar hostname
+in the keys directory.
+.It Cm pw Ar password
+Specifies the password to decrypt files containing private keys and
+identity parameters.
+This is required only if these files have been
+encrypted.
+.It Cm randfile Ar file
+Specifies the location of the random seed file used by the OpenSSL
+library.
+The defaults are described in the main text above.
+.It Cm sign Ar file
+Specifies the location of the optional sign key file.
+This overrides
+the link
+.Pa ntpkey_sign_ Ns Ar hostname
+in the keys directory.
+If this file is
+not found, the host key is also the sign key.
+.El
+.It Ic keys Ar keyfile
+Specifies the complete path and location of the MD5 key file
+containing the keys and key identifiers used by
+.Xr ntpd 1ntpdmdoc ,
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+when operating with symmetric key cryptography.
+This is the same operation as the
+.Fl k
+command line option.
+.It Ic keysdir Ar path
+This command specifies the default directory path for
+cryptographic keys, parameters and certificates.
+The default is
+.Pa /usr/local/etc/ .
+.It Ic requestkey Ar key
+Specifies the key identifier to use with the
+.Xr ntpdc 1ntpdcmdoc
+utility program, which uses a
+proprietary protocol specific to this implementation of
+.Xr ntpd 1ntpdmdoc .
+The
+.Ar key
+argument is a key identifier
+for the trusted key, where the value can be in the range 1 to
+65,534, inclusive.
+.It Ic revoke Ar logsec
+Specifies the interval between re\-randomization of certain
+cryptographic values used by the Autokey scheme, as a power of 2 in
+seconds.
+These values need to be updated frequently in order to
+deflect brute\-force attacks on the algorithms of the scheme;
+however, updating some values is a relatively expensive operation.
+The default interval is 16 (65,536 s or about 18 hours).
+For poll
+intervals above the specified interval, the values will be updated
+for every message sent.
+.It Ic trustedkey Ar key ...
+Specifies the key identifiers which are trusted for the
+purposes of authenticating peers with symmetric key cryptography,
+as well as keys used by the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+programs.
+The authentication procedures require that both the local
+and remote servers share the same key and key identifier for this
+purpose, although different keys can be used with different
+servers.
+The
+.Ar key
+arguments are 32\-bit unsigned
+integers with values from 1 to 65,534.
+.El
+.Ss Error Codes
+The following error codes are reported via the NTP control
+and monitoring protocol trap mechanism.
+.Bl -tag -width indent
+.It 101
+.Pq bad field format or length
+The packet has invalid version, length or format.
+.It 102
+.Pq bad timestamp
+The packet timestamp is the same or older than the most recent received.
+This could be due to a replay or a server clock time step.
+.It 103
+.Pq bad filestamp
+The packet filestamp is the same or older than the most recent received.
+This could be due to a replay or a key file generation error.
+.It 104
+.Pq bad or missing public key
+The public key is missing, has incorrect format or is an unsupported type.
+.It 105
+.Pq unsupported digest type
+The server requires an unsupported digest/signature scheme.
+.It 106
+.Pq mismatched digest types
+Not used.
+.It 107
+.Pq bad signature length
+The signature length does not match the current public key.
+.It 108
+.Pq signature not verified
+The message fails the signature check.
+It could be bogus or signed by a
+different private key.
+.It 109
+.Pq certificate not verified
+The certificate is invalid or signed with the wrong key.
+.It 110
+.Pq certificate not verified
+The certificate is not yet valid or has expired or the signature could not
+be verified.
+.It 111
+.Pq bad or missing cookie
+The cookie is missing, corrupted or bogus.
+.It 112
+.Pq bad or missing leapseconds table
+The leapseconds table is missing, corrupted or bogus.
+.It 113
+.Pq bad or missing certificate
+The certificate is missing, corrupted or bogus.
+.It 114
+.Pq bad or missing identity
+The identity key is missing, corrupt or bogus.
+.El
+.Sh Monitoring Support
+.Xr ntpd 1ntpdmdoc
+includes a comprehensive monitoring facility suitable
+for continuous, long term recording of server and client
+timekeeping performance.
+See the
+.Ic statistics
+command below
+for a listing and example of each type of statistics currently
+supported.
+Statistic files are managed using file generation sets
+and scripts in the
+.Pa ./scripts
+directory of this distribution.
+Using
+these facilities and
+.Ux
+.Xr cron 8
+jobs, the data can be
+automatically summarized and archived for retrospective analysis.
+.Ss Monitoring Commands
+.Bl -tag -width indent
+.It Ic statistics Ar name ...
+Enables writing of statistics records.
+Currently, eight kinds of
+.Ar name
+statistics are supported.
+.Bl -tag -width indent
+.It Cm clockstats
+Enables recording of clock driver statistics information.
+Each update
+received from a clock driver appends a line of the following form to
+the file generation set named
+.Cm clockstats :
+.Bd -literal
+49213 525.624 127.127.4.1 93 226 00:08:29.606 D
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the
+clock address in dotted\-quad notation.
+The final field shows the last
+timecode received from the clock in decoded ASCII format, where
+meaningful.
+In some clock drivers a good deal of additional information
+can be gathered and displayed as well.
+See information specific to each
+clock for further details.
+.It Cm cryptostats
+This option requires the OpenSSL cryptographic software library.
+It
+enables recording of cryptographic public key protocol information.
+Each message received by the protocol module appends a line of the
+following form to the file generation set named
+.Cm cryptostats :
+.Bd -literal
+49213 525.624 127.127.4.1 message
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the peer
+address in dotted\-quad notation, The final message field includes the
+message type and certain ancillary information.
+See the
+.Sx Authentication Options
+section for further information.
+.It Cm loopstats
+Enables recording of loop filter statistics information.
+Each
+update of the local clock outputs a line of the following form to
+the file generation set named
+.Cm loopstats :
+.Bd -literal
+50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next five fields
+show time offset (seconds), frequency offset (parts per million \-
+PPM), RMS jitter (seconds), Allan deviation (PPM) and clock
+discipline time constant.
+.It Cm peerstats
+Enables recording of peer statistics information.
+This includes
+statistics records of all peers of a NTP server and of special
+signals, where present and configured.
+Each valid update appends a
+line of the following form to the current element of a file
+generation set named
+.Cm peerstats :
+.Bd -literal
+48773 10847.650 127.127.4.1 9714 \-0.001605376 0.000000000 0.001424877 0.000958674
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the peer address in dotted\-quad notation and status,
+respectively.
+The status field is encoded in hex in the format
+described in Appendix A of the NTP specification RFC 1305.
+The final four fields show the offset,
+delay, dispersion and RMS jitter, all in seconds.
+.It Cm rawstats
+Enables recording of raw\-timestamp statistics information.
+This
+includes statistics records of all peers of a NTP server and of
+special signals, where present and configured.
+Each NTP message
+received from a peer or clock driver appends a line of the
+following form to the file generation set named
+.Cm rawstats :
+.Bd -literal
+50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the remote peer or clock address followed by the local address
+in dotted\-quad notation.
+The final four fields show the originate,
+receive, transmit and final NTP timestamps in order.
+The timestamp
+values are as received and before processing by the various data
+smoothing and mitigation algorithms.
+.It Cm sysstats
+Enables recording of ntpd statistics counters on a periodic basis.
+Each
+hour a line of the following form is appended to the file generation
+set named
+.Cm sysstats :
+.Bd -literal
+50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The remaining ten fields show
+the statistics counter values accumulated since the last generated
+line.
+.Bl -tag -width indent
+.It Time since restart Cm 36000
+Time in hours since the system was last rebooted.
+.It Packets received Cm 81965
+Total number of packets received.
+.It Packets processed Cm 0
+Number of packets received in response to previous packets sent
+.It Current version Cm 9546
+Number of packets matching the current NTP version.
+.It Previous version Cm 56
+Number of packets matching the previous NTP version.
+.It Bad version Cm 71793
+Number of packets matching neither NTP version.
+.It Access denied Cm 512
+Number of packets denied access for any reason.
+.It Bad length or format Cm 540
+Number of packets with invalid length, format or port number.
+.It Bad authentication Cm 10
+Number of packets not verified as authentic.
+.It Rate exceeded Cm 147
+Number of packets discarded due to rate limitation.
+.El
+.It Cm statsdir Ar directory_path
+Indicates the full path of a directory where statistics files
+should be created (see below).
+This keyword allows
+the (otherwise constant)
+.Cm filegen
+filename prefix to be modified for file generation sets, which
+is useful for handling statistics logs.
+.It Cm filegen Ar name Xo
+.Op Cm file Ar filename
+.Op Cm type Ar typename
+.Op Cm link | nolink
+.Op Cm enable | disable
+.Xc
+Configures setting of generation file set name.
+Generation
+file sets provide a means for handling files that are
+continuously growing during the lifetime of a server.
+Server statistics are a typical example for such files.
+Generation file sets provide access to a set of files used
+to store the actual data.
+At any time at most one element
+of the set is being written to.
+The type given specifies
+when and how data will be directed to a new element of the set.
+This way, information stored in elements of a file set
+that are currently unused are available for administrational
+operations without the risk of disturbing the operation of ntpd.
+(Most important: they can be removed to free space for new data
+produced.)
+.Pp
+Note that this command can be sent from the
+.Xr ntpdc 1ntpdcmdoc
+program running at a remote location.
+.Bl -tag -width indent
+.It Cm name
+This is the type of the statistics records, as shown in the
+.Cm statistics
+command.
+.It Cm file Ar filename
+This is the file name for the statistics records.
+Filenames of set
+members are built from three concatenated elements
+.Ar Cm prefix ,
+.Ar Cm filename
+and
+.Ar Cm suffix :
+.Bl -tag -width indent
+.It Cm prefix
+This is a constant filename path.
+It is not subject to
+modifications via the
+.Ar filegen
+option.
+It is defined by the
+server, usually specified as a compile\-time constant.
+It may,
+however, be configurable for individual file generation sets
+via other commands.
+For example, the prefix used with
+.Ar loopstats
+and
+.Ar peerstats
+generation can be configured using the
+.Ar statsdir
+option explained above.
+.It Cm filename
+This string is directly concatenated to the prefix mentioned
+above (no intervening
+.Ql / ) .
+This can be modified using
+the file argument to the
+.Ar filegen
+statement.
+No
+.Pa ..
+elements are
+allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by
+.Ar prefix .
+.It Cm suffix
+This part is reflects individual elements of a file set.
+It is
+generated according to the type of a file set.
+.El
+.It Cm type Ar typename
+A file generation set is characterized by its type.
+The following
+types are supported:
+.Bl -tag -width indent
+.It Cm none
+The file set is actually a single plain file.
+.It Cm pid
+One element of file set is used per incarnation of a ntpd
+server.
+This type does not perform any changes to file set
+members during runtime, however it provides an easy way of
+separating files belonging to different
+.Xr ntpd 1ntpdmdoc
+server incarnations.
+The set member filename is built by appending a
+.Ql \&.
+to concatenated
+.Ar prefix
+and
+.Ar filename
+strings, and
+appending the decimal representation of the process ID of the
+.Xr ntpd 1ntpdmdoc
+server process.
+.It Cm day
+One file generation set element is created per day.
+A day is
+defined as the period between 00:00 and 24:00 UTC.
+The file set
+member suffix consists of a
+.Ql \&.
+and a day specification in
+the form
+.Cm YYYYMMdd .
+.Cm YYYY
+is a 4\-digit year number (e.g., 1992).
+.Cm MM
+is a two digit month number.
+.Cm dd
+is a two digit day number.
+Thus, all information written at 10 December 1992 would end up
+in a file named
+.Ar prefix
+.Ar filename Ns .19921210 .
+.It Cm week
+Any file set member contains data related to a certain week of
+a year.
+The term week is defined by computing day\-of\-year
+modulo 7.
+Elements of such a file generation set are
+distinguished by appending the following suffix to the file set
+filename base: A dot, a 4\-digit year number, the letter
+.Cm W ,
+and a 2\-digit week number.
+For example, information from January,
+10th 1992 would end up in a file with suffix
+.No . Ns Ar 1992W1 .
+.It Cm month
+One generation file set element is generated per month.
+The
+file name suffix consists of a dot, a 4\-digit year number, and
+a 2\-digit month.
+.It Cm year
+One generation file element is generated per year.
+The filename
+suffix consists of a dot and a 4 digit year number.
+.It Cm age
+This type of file generation sets changes to a new element of
+the file set every 24 hours of server operation.
+The filename
+suffix consists of a dot, the letter
+.Cm a ,
+and an 8\-digit number.
+This number is taken to be the number of seconds the server is
+running at the start of the corresponding 24\-hour period.
+Information is only written to a file generation by specifying
+.Cm enable ;
+output is prevented by specifying
+.Cm disable .
+.El
+.It Cm link | nolink
+It is convenient to be able to access the current element of a file
+generation set by a fixed name.
+This feature is enabled by
+specifying
+.Cm link
+and disabled using
+.Cm nolink .
+If link is specified, a
+hard link from the current file set element to a file without
+suffix is created.
+When there is already a file with this name and
+the number of links of this file is one, it is renamed appending a
+dot, the letter
+.Cm C ,
+and the pid of the ntpd server process.
+When the
+number of links is greater than one, the file is unlinked.
+This
+allows the current file to be accessed by a constant name.
+.It Cm enable \&| Cm disable
+Enables or disables the recording function.
+.El
+.El
+.El
+.Sh Access Control Support
+The
+.Xr ntpd 1ntpdmdoc
+daemon implements a general purpose address/mask based restriction
+list.
+The list contains address/match entries sorted first
+by increasing address values and and then by increasing mask values.
+A match occurs when the bitwise AND of the mask and the packet
+source address is equal to the bitwise AND of the mask and
+address in the list.
+The list is searched in order with the
+last match found defining the restriction flags associated
+with the entry.
+Additional information and examples can be found in the
+.Qq Notes on Configuring NTP and Setting up a NTP Subnet
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Pp
+The restriction facility was implemented in conformance
+with the access policies for the original NSFnet backbone
+time servers.
+Later the facility was expanded to deflect
+cryptographic and clogging attacks.
+While this facility may
+be useful for keeping unwanted or broken or malicious clients
+from congesting innocent servers, it should not be considered
+an alternative to the NTP authentication facilities.
+Source address based restrictions are easily circumvented
+by a determined cracker.
+.Pp
+Clients can be denied service because they are explicitly
+included in the restrict list created by the restrict command
+or implicitly as the result of cryptographic or rate limit
+violations.
+Cryptographic violations include certificate
+or identity verification failure; rate limit violations generally
+result from defective NTP implementations that send packets
+at abusive rates.
+Some violations cause denied service
+only for the offending packet, others cause denied service
+for a timed period and others cause the denied service for
+an indefinate period.
+When a client or network is denied access
+for an indefinate period, the only way at present to remove
+the restrictions is by restarting the server.
+.Ss The Kiss\-of\-Death Packet
+Ordinarily, packets denied service are simply dropped with no
+further action except incrementing statistics counters.
+Sometimes a
+more proactive response is needed, such as a server message that
+explicitly requests the client to stop sending and leave a message
+for the system operator.
+A special packet format has been created
+for this purpose called the "kiss\-of\-death" (KoD) packet.
+KoD packets have the leap bits set unsynchronized and stratum set
+to zero and the reference identifier field set to a four\-byte
+ASCII code.
+If the
+.Cm noserve
+or
+.Cm notrust
+flag of the matching restrict list entry is set,
+the code is "DENY"; if the
+.Cm limited
+flag is set and the rate limit
+is exceeded, the code is "RATE".
+Finally, if a cryptographic violation occurs, the code is "CRYP".
+.Pp
+A client receiving a KoD performs a set of sanity checks to
+minimize security exposure, then updates the stratum and
+reference identifier peer variables, sets the access
+denied (TEST4) bit in the peer flash variable and sends
+a message to the log.
+As long as the TEST4 bit is set,
+the client will send no further packets to the server.
+The only way at present to recover from this condition is
+to restart the protocol at both the client and server.
+This
+happens automatically at the client when the association times out.
+It will happen at the server only if the server operator cooperates.
+.Ss Access Control Commands
+.Bl -tag -width indent
+.It Xo Ic discard
+.Op Cm average Ar avg
+.Op Cm minimum Ar min
+.Op Cm monitor Ar prob
+.Xc
+Set the parameters of the
+.Cm limited
+facility which protects the server from
+client abuse.
+The
+.Cm average
+subcommand specifies the minimum average packet
+spacing, while the
+.Cm minimum
+subcommand specifies the minimum packet spacing.
+Packets that violate these minima are discarded
+and a kiss\-o'\-death packet returned if enabled.
+The default
+minimum average and minimum are 5 and 2, respectively.
+The monitor subcommand specifies the probability of discard
+for packets that overflow the rate\-control window.
+.It Xo Ic restrict address
+.Op Cm mask Ar mask
+.Op Ar flag ...
+.Xc
+The
+.Ar address
+argument expressed in
+dotted\-quad form is the address of a host or network.
+Alternatively, the
+.Ar address
+argument can be a valid host DNS name.
+The
+.Ar mask
+argument expressed in dotted\-quad form defaults to
+.Cm 255.255.255.255 ,
+meaning that the
+.Ar address
+is treated as the address of an individual host.
+A default entry (address
+.Cm 0.0.0.0 ,
+mask
+.Cm 0.0.0.0 )
+is always included and is always the first entry in the list.
+Note that text string
+.Cm default ,
+with no mask option, may
+be used to indicate the default entry.
+In the current implementation,
+.Cm flag
+always
+restricts access, i.e., an entry with no flags indicates that free
+access to the server is to be given.
+The flags are not orthogonal,
+in that more restrictive flags will often make less restrictive
+ones redundant.
+The flags can generally be classed into two
+categories, those which restrict time service and those which
+restrict informational queries and attempts to do run\-time
+reconfiguration of the server.
+One or more of the following flags
+may be specified:
+.Bl -tag -width indent
+.It Cm ignore
+Deny packets of all kinds, including
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries.
+.It Cm kod
+If this flag is set when an access violation occurs, a kiss\-o'\-death
+(KoD) packet is sent.
+KoD packets are rate limited to no more than one
+per second.
+If another KoD packet occurs within one second after the
+last one, the packet is dropped.
+.It Cm limited
+Deny service if the packet spacing violates the lower limits specified
+in the discard command.
+A history of clients is kept using the
+monitoring capability of
+.Xr ntpd 1ntpdmdoc .
+Thus, monitoring is always active as
+long as there is a restriction entry with the
+.Cm limited
+flag.
+.It Cm lowpriotrap
+Declare traps set by matching hosts to be low priority.
+The
+number of traps a server can maintain is limited (the current limit
+is 3).
+Traps are usually assigned on a first come, first served
+basis, with later trap requestors being denied service.
+This flag
+modifies the assignment algorithm by allowing low priority traps to
+be overridden by later requests for normal priority traps.
+.It Cm nomodify
+Deny
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries which attempt to modify the state of the
+server (i.e., run time reconfiguration).
+Queries which return
+information are permitted.
+.It Cm noquery
+Deny
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries.
+Time service is not affected.
+.It Cm nopeer
+Deny packets which would result in mobilizing a new association.
+This
+includes broadcast and symmetric active packets when a configured
+association does not exist.
+It also includes
+.Cm pool
+associations, so if you want to use servers from a
+.Cm pool
+directive and also want to use
+.Cm nopeer
+by default, you'll want a
+.Cm "restrict source ..." line as well that does
+.It not
+include the
+.Cm nopeer
+directive.
+.It Cm noserve
+Deny all packets except
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries.
+.It Cm notrap
+Decline to provide mode 6 control message trap service to matching
+hosts.
+The trap service is a subsystem of the ntpdq control message
+protocol which is intended for use by remote event logging programs.
+.It Cm notrust
+Deny service unless the packet is cryptographically authenticated.
+.It Cm ntpport
+This is actually a match algorithm modifier, rather than a
+restriction flag.
+Its presence causes the restriction entry to be
+matched only if the source port in the packet is the standard NTP
+UDP port (123).
+Both
+.Cm ntpport
+and
+.Cm non\-ntpport
+may
+be specified.
+The
+.Cm ntpport
+is considered more specific and
+is sorted later in the list.
+.It Cm version
+Deny packets that do not match the current NTP version.
+.El
+.Pp
+Default restriction list entries with the flags ignore, interface,
+ntpport, for each of the local host's interface addresses are
+inserted into the table at startup to prevent the server
+from attempting to synchronize to its own time.
+A default entry is also always present, though if it is
+otherwise unconfigured; no flags are associated
+with the default entry (i.e., everything besides your own
+NTP server is unrestricted).
+.El
+.Sh Automatic NTP Configuration Options
+.Ss Manycasting
+Manycasting is a automatic discovery and configuration paradigm
+new to NTPv4.
+It is intended as a means for a multicast client
+to troll the nearby network neighborhood to find cooperating
+manycast servers, validate them using cryptographic means
+and evaluate their time values with respect to other servers
+that might be lurking in the vicinity.
+The intended result is that each manycast client mobilizes
+client associations with some number of the "best"
+of the nearby manycast servers, yet automatically reconfigures
+to sustain this number of servers should one or another fail.
+.Pp
+Note that the manycasting paradigm does not coincide
+with the anycast paradigm described in RFC\-1546,
+which is designed to find a single server from a clique
+of servers providing the same service.
+The manycast paradigm is designed to find a plurality
+of redundant servers satisfying defined optimality criteria.
+.Pp
+Manycasting can be used with either symmetric key
+or public key cryptography.
+The public key infrastructure (PKI)
+offers the best protection against compromised keys
+and is generally considered stronger, at least with relatively
+large key sizes.
+It is implemented using the Autokey protocol and
+the OpenSSL cryptographic library available from
+.Li http://www.openssl.org/ .
+The library can also be used with other NTPv4 modes
+as well and is highly recommended, especially for broadcast modes.
+.Pp
+A persistent manycast client association is configured
+using the manycastclient command, which is similar to the
+server command but with a multicast (IPv4 class
+.Cm D
+or IPv6 prefix
+.Cm FF )
+group address.
+The IANA has designated IPv4 address 224.1.1.1
+and IPv6 address FF05::101 (site local) for NTP.
+When more servers are needed, it broadcasts manycast
+client messages to this address at the minimum feasible rate
+and minimum feasible time\-to\-live (TTL) hops, depending
+on how many servers have already been found.
+There can be as many manycast client associations
+as different group address, each one serving as a template
+for a future ephemeral unicast client/server association.
+.Pp
+Manycast servers configured with the
+.Ic manycastserver
+command listen on the specified group address for manycast
+client messages.
+Note the distinction between manycast client,
+which actively broadcasts messages, and manycast server,
+which passively responds to them.
+If a manycast server is
+in scope of the current TTL and is itself synchronized
+to a valid source and operating at a stratum level equal
+to or lower than the manycast client, it replies to the
+manycast client message with an ordinary unicast server message.
+.Pp
+The manycast client receiving this message mobilizes
+an ephemeral client/server association according to the
+matching manycast client template, but only if cryptographically
+authenticated and the server stratum is less than or equal
+to the client stratum.
+Authentication is explicitly required
+and either symmetric key or public key (Autokey) can be used.
+Then, the client polls the server at its unicast address
+in burst mode in order to reliably set the host clock
+and validate the source.
+This normally results
+in a volley of eight client/server at 2\-s intervals
+during which both the synchronization and cryptographic
+protocols run concurrently.
+Following the volley,
+the client runs the NTP intersection and clustering
+algorithms, which act to discard all but the "best"
+associations according to stratum and synchronization
+distance.
+The surviving associations then continue
+in ordinary client/server mode.
+.Pp
+The manycast client polling strategy is designed to reduce
+as much as possible the volume of manycast client messages
+and the effects of implosion due to near\-simultaneous
+arrival of manycast server messages.
+The strategy is determined by the
+.Ic manycastclient ,
+.Ic tos
+and
+.Ic ttl
+configuration commands.
+The manycast poll interval is
+normally eight times the system poll interval,
+which starts out at the
+.Cm minpoll
+value specified in the
+.Ic manycastclient ,
+command and, under normal circumstances, increments to the
+.Cm maxpolll
+value specified in this command.
+Initially, the TTL is
+set at the minimum hops specified by the ttl command.
+At each retransmission the TTL is increased until reaching
+the maximum hops specified by this command or a sufficient
+number client associations have been found.
+Further retransmissions use the same TTL.
+.Pp
+The quality and reliability of the suite of associations
+discovered by the manycast client is determined by the NTP
+mitigation algorithms and the
+.Cm minclock
+and
+.Cm minsane
+values specified in the
+.Ic tos
+configuration command.
+At least
+.Cm minsane
+candidate servers must be available and the mitigation
+algorithms produce at least
+.Cm minclock
+survivors in order to synchronize the clock.
+Byzantine agreement principles require at least four
+candidates in order to correctly discard a single falseticker.
+For legacy purposes,
+.Cm minsane
+defaults to 1 and
+.Cm minclock
+defaults to 3.
+For manycast service
+.Cm minsane
+should be explicitly set to 4, assuming at least that
+number of servers are available.
+.Pp
+If at least
+.Cm minclock
+servers are found, the manycast poll interval is immediately
+set to eight times
+.Cm maxpoll .
+If less than
+.Cm minclock
+servers are found when the TTL has reached the maximum hops,
+the manycast poll interval is doubled.
+For each transmission
+after that, the poll interval is doubled again until
+reaching the maximum of eight times
+.Cm maxpoll .
+Further transmissions use the same poll interval and
+TTL values.
+Note that while all this is going on,
+each client/server association found is operating normally
+it the system poll interval.
+.Pp
+Administratively scoped multicast boundaries are normally
+specified by the network router configuration and,
+in the case of IPv6, the link/site scope prefix.
+By default, the increment for TTL hops is 32 starting
+from 31; however, the
+.Ic ttl
+configuration command can be
+used to modify the values to match the scope rules.
+.Pp
+It is often useful to narrow the range of acceptable
+servers which can be found by manycast client associations.
+Because manycast servers respond only when the client
+stratum is equal to or greater than the server stratum,
+primary (stratum 1) servers fill find only primary servers
+in TTL range, which is probably the most common objective.
+However, unless configured otherwise, all manycast clients
+in TTL range will eventually find all primary servers
+in TTL range, which is probably not the most common
+objective in large networks.
+The
+.Ic tos
+command can be used to modify this behavior.
+Servers with stratum below
+.Cm floor
+or above
+.Cm ceiling
+specified in the
+.Ic tos
+command are strongly discouraged during the selection
+process; however, these servers may be temporally
+accepted if the number of servers within TTL range is
+less than
+.Cm minclock .
+.Pp
+The above actions occur for each manycast client message,
+which repeats at the designated poll interval.
+However, once the ephemeral client association is mobilized,
+subsequent manycast server replies are discarded,
+since that would result in a duplicate association.
+If during a poll interval the number of client associations
+falls below
+.Cm minclock ,
+all manycast client prototype associations are reset
+to the initial poll interval and TTL hops and operation
+resumes from the beginning.
+It is important to avoid
+frequent manycast client messages, since each one requires
+all manycast servers in TTL range to respond.
+The result could well be an implosion, either minor or major,
+depending on the number of servers in range.
+The recommended value for
+.Cm maxpoll
+is 12 (4,096 s).
+.Pp
+It is possible and frequently useful to configure a host
+as both manycast client and manycast server.
+A number of hosts configured this way and sharing a common
+group address will automatically organize themselves
+in an optimum configuration based on stratum and
+synchronization distance.
+For example, consider an NTP
+subnet of two primary servers and a hundred or more
+dependent clients.
+With two exceptions, all servers
+and clients have identical configuration files including both
+.Ic multicastclient
+and
+.Ic multicastserver
+commands using, for instance, multicast group address
+239.1.1.1.
+The only exception is that each primary server
+configuration file must include commands for the primary
+reference source such as a GPS receiver.
+.Pp
+The remaining configuration files for all secondary
+servers and clients have the same contents, except for the
+.Ic tos
+command, which is specific for each stratum level.
+For stratum 1 and stratum 2 servers, that command is
+not necessary.
+For stratum 3 and above servers the
+.Cm floor
+value is set to the intended stratum number.
+Thus, all stratum 3 configuration files are identical,
+all stratum 4 files are identical and so forth.
+.Pp
+Once operations have stabilized in this scenario,
+the primary servers will find the primary reference source
+and each other, since they both operate at the same
+stratum (1), but not with any secondary server or client,
+since these operate at a higher stratum.
+The secondary
+servers will find the servers at the same stratum level.
+If one of the primary servers loses its GPS receiver,
+it will continue to operate as a client and other clients
+will time out the corresponding association and
+re\-associate accordingly.
+.Pp
+Some administrators prefer to avoid running
+.Xr ntpd 1ntpdmdoc
+continuously and run either
+.Xr ntpdate 8
+or
+.Xr ntpd 1ntpdmdoc
+.Fl q
+as a cron job.
+In either case the servers must be
+configured in advance and the program fails if none are
+available when the cron job runs.
+A really slick
+application of manycast is with
+.Xr ntpd 1ntpdmdoc
+.Fl q .
+The program wakes up, scans the local landscape looking
+for the usual suspects, selects the best from among
+the rascals, sets the clock and then departs.
+Servers do not have to be configured in advance and
+all clients throughout the network can have the same
+configuration file.
+.Ss Manycast Interactions with Autokey
+Each time a manycast client sends a client mode packet
+to a multicast group address, all manycast servers
+in scope generate a reply including the host name
+and status word.
+The manycast clients then run
+the Autokey protocol, which collects and verifies
+all certificates involved.
+Following the burst interval
+all but three survivors are cast off,
+but the certificates remain in the local cache.
+It often happens that several complete signing trails
+from the client to the primary servers are collected in this way.
+.Pp
+About once an hour or less often if the poll interval
+exceeds this, the client regenerates the Autokey key list.
+This is in general transparent in client/server mode.
+However, about once per day the server private value
+used to generate cookies is refreshed along with all
+manycast client associations.
+In this case all
+cryptographic values including certificates is refreshed.
+If a new certificate has been generated since
+the last refresh epoch, it will automatically revoke
+all prior certificates that happen to be in the
+certificate cache.
+At the same time, the manycast
+scheme starts all over from the beginning and
+the expanding ring shrinks to the minimum and increments
+from there while collecting all servers in scope.
+.Ss Manycast Options
+.Bl -tag -width indent
+.It Xo Ic tos
+.Oo
+.Cm ceiling Ar ceiling |
+.Cm cohort { 0 | 1 } |
+.Cm floor Ar floor |
+.Cm minclock Ar minclock |
+.Cm minsane Ar minsane
+.Oc
+.Xc
+This command affects the clock selection and clustering
+algorithms.
+It can be used to select the quality and
+quantity of peers used to synchronize the system clock
+and is most useful in manycast mode.
+The variables operate
+as follows:
+.Bl -tag -width indent
+.It Cm ceiling Ar ceiling
+Peers with strata above
+.Cm ceiling
+will be discarded if there are at least
+.Cm minclock
+peers remaining.
+This value defaults to 15, but can be changed
+to any number from 1 to 15.
+.It Cm cohort Bro 0 | 1 Brc
+This is a binary flag which enables (0) or disables (1)
+manycast server replies to manycast clients with the same
+stratum level.
+This is useful to reduce implosions where
+large numbers of clients with the same stratum level
+are present.
+The default is to enable these replies.
+.It Cm floor Ar floor
+Peers with strata below
+.Cm floor
+will be discarded if there are at least
+.Cm minclock
+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
+associations until no more than
+.Cm minclock
+associations remain.
+This value defaults to 3,
+but can be changed to any number from 1 to the number of
+configured sources.
+.It Cm minsane Ar minsane
+This is the minimum number of candidates available
+to the clock selection algorithm in order to produce
+one or more truechimers for the clustering algorithm.
+If fewer than this number are available, the clock is
+undisciplined and allowed to run free.
+The default is 1
+for legacy purposes.
+However, according to principles of
+Byzantine agreement,
+.Cm minsane
+should be at least 4 in order to detect and discard
+a single falseticker.
+.El
+.It Cm ttl Ar hop ...
+This command specifies a list of TTL values in increasing
+order, up to 8 values can be specified.
+In manycast mode these values are used in turn
+in an expanding\-ring search.
+The default is eight
+multiples of 32 starting at 31.
+.El
+.Sh Reference Clock Support
+The NTP Version 4 daemon supports some three dozen different radio,
+satellite and modem reference clocks plus a special pseudo\-clock
+used for backup or when no other clock source is available.
+Detailed descriptions of individual device drivers and options can
+be found in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+Additional information can be found in the pages linked
+there, including the
+.Qq Debugging Hints for Reference Clock Drivers
+and
+.Qq How To Write a Reference Clock Driver
+pages
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+In addition, support for a PPS
+signal is available as described in the
+.Qq Pulse\-per\-second (PPS) Signal Interfacing
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+Many
+drivers support special line discipline/streams modules which can
+significantly improve the accuracy using the driver.
+These are
+described in the
+.Qq Line Disciplines and Streams Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Pp
+A reference clock will generally (though not always) be a radio
+timecode receiver which is synchronized to a source of standard
+time such as the services offered by the NRC in Canada and NIST and
+USNO in the US.
+The interface between the computer and the timecode
+receiver is device dependent, but is usually a serial port.
+A
+device driver specific to each reference clock must be selected and
+compiled in the distribution; however, most common radio, satellite
+and modem clocks are included by default.
+Note that an attempt to
+configure a reference clock when the driver has not been compiled
+or the hardware port has not been appropriately configured results
+in a scalding remark to the system log file, but is otherwise non
+hazardous.
+.Pp
+For the purposes of configuration,
+.Xr ntpd 1ntpdmdoc
+treats
+reference clocks in a manner analogous to normal NTP peers as much
+as possible.
+Reference clocks are identified by a syntactically
+correct but invalid IP address, in order to distinguish them from
+normal NTP peers.
+Reference clock addresses are of the form
+.Sm off
+.Li 127.127. Ar t . Ar u ,
+.Sm on
+where
+.Ar t
+is an integer
+denoting the clock type and
+.Ar u
+indicates the unit
+number in the range 0\-3.
+While it may seem overkill, it is in fact
+sometimes useful to configure multiple reference clocks of the same
+type, in which case the unit numbers must be unique.
+.Pp
+The
+.Ic server
+command is used to configure a reference
+clock, where the
+.Ar address
+argument in that command
+is the clock address.
+The
+.Cm key ,
+.Cm version
+and
+.Cm ttl
+options are not used for reference clock support.
+The
+.Cm mode
+option is added for reference clock support, as
+described below.
+The
+.Cm prefer
+option can be useful to
+persuade the server to cherish a reference clock with somewhat more
+enthusiasm than other reference clocks or peers.
+Further
+information on this option can be found in the
+.Qq Mitigation Rules and the prefer Keyword
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+page.
+The
+.Cm minpoll
+and
+.Cm maxpoll
+options have
+meaning only for selected clock drivers.
+See the individual clock
+driver document pages for additional information.
+.Pp
+The
+.Ic fudge
+command is used to provide additional
+information for individual clock drivers and normally follows
+immediately after the
+.Ic server
+command.
+The
+.Ar address
+argument specifies the clock address.
+The
+.Cm refid
+and
+.Cm stratum
+options can be used to
+override the defaults for the device.
+There are two optional
+device\-dependent time offsets and four flags that can be included
+in the
+.Ic fudge
+command as well.
+.Pp
+The stratum number of a reference clock is by default zero.
+Since the
+.Xr ntpd 1ntpdmdoc
+daemon adds one to the stratum of each
+peer, a primary server ordinarily displays an external stratum of
+one.
+In order to provide engineered backups, it is often useful to
+specify the reference clock stratum as greater than zero.
+The
+.Cm stratum
+option is used for this purpose.
+Also, in cases
+involving both a reference clock and a pulse\-per\-second (PPS)
+discipline signal, it is useful to specify the reference clock
+identifier as other than the default, depending on the driver.
+The
+.Cm refid
+option is used for this purpose.
+Except where noted,
+these options apply to all clock drivers.
+.Ss Reference Clock Commands
+.Bl -tag -width indent
+.It Xo Ic server
+.Sm off
+.Li 127.127. Ar t . Ar u
+.Sm on
+.Op Cm prefer
+.Op Cm mode Ar int
+.Op Cm minpoll Ar int
+.Op Cm maxpoll Ar int
+.Xc
+This command can be used to configure reference clocks in
+special ways.
+The options are interpreted as follows:
+.Bl -tag -width indent
+.It Cm prefer
+Marks the reference clock as preferred.
+All other things being
+equal, this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+.Qq Mitigation Rules and the prefer Keyword
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+for further information.
+.It Cm mode Ar int
+Specifies a mode number which is interpreted in a
+device\-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.It Cm minpoll Ar int
+.It Cm maxpoll Ar int
+These options specify the minimum and maximum polling interval
+for reference clock messages, as a power of 2 in seconds
+For
+most directly connected reference clocks, both
+.Cm minpoll
+and
+.Cm maxpoll
+default to 6 (64 s).
+For modem reference clocks,
+.Cm minpoll
+defaults to 10 (17.1 m) and
+.Cm maxpoll
+defaults to 14 (4.5 h).
+The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
+.El
+.It Xo Ic fudge
+.Sm off
+.Li 127.127. Ar t . Ar u
+.Sm on
+.Op Cm time1 Ar sec
+.Op Cm time2 Ar sec
+.Op Cm stratum Ar int
+.Op Cm refid Ar string
+.Op Cm mode Ar int
+.Op Cm flag1 Cm 0 \&| Cm 1
+.Op Cm flag2 Cm 0 \&| Cm 1
+.Op Cm flag3 Cm 0 \&| Cm 1
+.Op Cm flag4 Cm 0 \&| Cm 1
+.Xc
+This command can be used to configure reference clocks in
+special ways.
+It must immediately follow the
+.Ic server
+command which configures the driver.
+Note that the same capability
+is possible at run time using the
+.Xr ntpdc 1ntpdcmdoc
+program.
+The options are interpreted as
+follows:
+.Bl -tag -width indent
+.It Cm time1 Ar sec
+Specifies a constant to be added to the time offset produced by
+the driver, a fixed\-point decimal number in seconds.
+This is used
+as a calibration constant to adjust the nominal time offset of a
+particular clock to agree with an external standard, such as a
+precision PPS signal.
+It also provides a way to correct a
+systematic error or bias due to serial port or operating system
+latencies, different cable lengths or receiver internal delay.
+The
+specified offset is in addition to the propagation delay provided
+by other means, such as internal DIPswitches.
+Where a calibration
+for an individual system and driver is available, an approximate
+correction is noted in the driver documentation pages.
+Note: in order to facilitate calibration when more than one
+radio clock or PPS signal is supported, a special calibration
+feature is available.
+It takes the form of an argument to the
+.Ic enable
+command described in
+.Sx Miscellaneous Options
+page and operates as described in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.It Cm time2 Ar secs
+Specifies a fixed\-point decimal number in seconds, which is
+interpreted in a driver\-dependent way.
+See the descriptions of
+specific drivers in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.It Cm stratum Ar int
+Specifies the stratum number assigned to the driver, an integer
+between 0 and 15.
+This number overrides the default stratum number
+ordinarily assigned by the driver itself, usually zero.
+.It Cm refid Ar string
+Specifies an ASCII string of from one to four characters which
+defines the reference identifier used by the driver.
+This string
+overrides the default identifier ordinarily assigned by the driver
+itself.
+.It Cm mode Ar int
+Specifies a mode number which is interpreted in a
+device\-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.It Cm flag1 Cm 0 \&| Cm 1
+.It Cm flag2 Cm 0 \&| Cm 1
+.It Cm flag3 Cm 0 \&| Cm 1
+.It Cm flag4 Cm 0 \&| Cm 1
+These four flags are used for customizing the clock driver.
+The
+interpretation of these values, and whether they are used at all,
+is a function of the particular clock driver.
+However, by
+convention
+.Cm flag4
+is used to enable recording monitoring
+data to the
+.Cm clockstats
+file configured with the
+.Ic filegen
+command.
+Further information on the
+.Ic filegen
+command can be found in
+.Sx Monitoring Options .
+.El
+.El
+.Sh Miscellaneous Options
+.Bl -tag -width indent
+.It Ic broadcastdelay Ar seconds
+The broadcast and multicast modes require a special calibration
+to determine the network delay between the local and remote
+servers.
+Ordinarily, this is done automatically by the initial
+protocol exchanges between the client and server.
+In some cases,
+the calibration procedure may fail due to network or server access
+controls, for example.
+This command specifies the default delay to
+be used under these circumstances.
+Typically (for Ethernet), a
+number between 0.003 and 0.007 seconds is appropriate.
+The default
+when this command is not used is 0.004 seconds.
+.It Ic calldelay Ar delay
+This option controls the delay in seconds between the first and second
+packets sent in burst or iburst mode to allow additional time for a modem
+or ISDN call to complete.
+.It Ic driftfile Ar driftfile
+This command specifies the complete path and name of the file used to
+record the frequency of the local clock oscillator.
+This is the same
+operation as the
+.Fl f
+command line option.
+If the file exists, it is read at
+startup in order to set the initial frequency and then updated once per
+hour with the current frequency computed by the daemon.
+If the file name is
+specified, but the file itself does not exist, the starts with an initial
+frequency of zero and creates the file when writing it for the first time.
+If this command is not given, the daemon will always start with an initial
+frequency of zero.
+.Pp
+The file format consists of a single line containing a single
+floating point number, which records the frequency offset measured
+in parts\-per\-million (PPM).
+The file is updated by first writing
+the current drift value into a temporary file and then renaming
+this file to replace the old version.
+This implies that
+.Xr ntpd 1ntpdmdoc
+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 Xo Ic enable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm mode7 | monitor |
+.Cm ntp | Cm stats
+.Oc
+.Xc
+.It Xo Ic disable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm mode7 | monitor |
+.Cm ntp | Cm stats
+.Oc
+.Xc
+Provides a way to enable or disable various server options.
+Flags not mentioned are unaffected.
+Note that all of these flags
+can be controlled remotely using the
+.Xr ntpdc 1ntpdcmdoc
+utility program.
+.Bl -tag -width indent
+.It Cm auth
+Enables the server to synchronize with unconfigured peers only if the
+peer has been correctly authenticated using either public key or
+private key cryptography.
+The default for this flag is
+.Ic enable .
+.It Cm bclient
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the
+.Ic multicastclient
+command with default
+address.
+The default for this flag is
+.Ic disable .
+.It Cm calibrate
+Enables the calibrate feature for reference clocks.
+The default for
+this flag is
+.Ic disable .
+.It Cm kernel
+Enables the kernel time discipline, if available.
+The default for this
+flag is
+.Ic enable
+if support is available, otherwise
+.Ic disable .
+.It Cm mode7
+Enables processing of NTP mode 7 implementation\-specific requests
+which are used by the deprecated
+.Xr ntpdc 1ntpdcmdoc
+program.
+The default for this flag is disable.
+This flag is excluded from runtime configuration using
+.Xr ntpq 1ntpqmdoc .
+The
+.Xr ntpq 1ntpqmdoc
+program provides the same capabilities as
+.Xr ntpdc 1ntpdcmdoc
+using standard mode 6 requests.
+.It Cm monitor
+Enables the monitoring facility.
+See the
+.Xr ntpdc 1ntpdcmdoc
+program
+and the
+.Ic monlist
+command or further information.
+The
+default for this flag is
+.Ic enable .
+.It Cm ntp
+Enables time and frequency discipline.
+In effect, this switch opens and
+closes the feedback loop, which is useful for testing.
+The default for
+this flag is
+.Ic enable .
+.It Cm stats
+Enables the statistics facility.
+See the
+.Sx Monitoring Options
+section for further information.
+The default for this flag is
+.Ic disable .
+.El
+.It Ic includefile Ar includefile
+This command allows additional configuration commands
+to be included from a separate file.
+Include files may
+be nested to a depth of five; upon reaching the end of any
+include file, command processing resumes in the previous
+configuration file.
+This option is useful for sites that run
+.Xr ntpd 1ntpdmdoc
+on multiple hosts, with (mostly) common options (e.g., a
+restriction list).
+.It Ic logconfig Ar configkeyword
+This command controls the amount and type of output written to
+the system
+.Xr syslog 3
+facility or the alternate
+.Ic logfile
+log file.
+By default, all output is turned on.
+All
+.Ar configkeyword
+keywords can be prefixed with
+.Ql = ,
+.Ql +
+and
+.Ql \- ,
+where
+.Ql =
+sets the
+.Xr syslog 3
+priority mask,
+.Ql +
+adds and
+.Ql \-
+removes
+messages.
+.Xr syslog 3
+messages can be controlled in four
+classes
+.Po
+.Cm clock ,
+.Cm peer ,
+.Cm sys
+and
+.Cm sync
+.Pc .
+Within these classes four types of messages can be
+controlled: informational messages
+.Po
+.Cm info
+.Pc ,
+event messages
+.Po
+.Cm events
+.Pc ,
+statistics messages
+.Po
+.Cm statistics
+.Pc
+and
+status messages
+.Po
+.Cm status
+.Pc .
+.Pp
+Configuration keywords are formed by concatenating the message class with
+the event class.
+The
+.Cm all
+prefix can be used instead of a message class.
+A
+message class may also be followed by the
+.Cm all
+keyword to enable/disable all
+messages of the respective message class.Thus, a minimal log configuration
+could look like this:
+.Bd -literal
+logconfig =syncstatus +sysevents
+.Ed
+.Pp
+This would just list the synchronizations state of
+.Xr ntpd 1ntpdmdoc
+and the major system events.
+For a simple reference server, the
+following minimum message configuration could be useful:
+.Bd -literal
+logconfig =syncall +clockall
+.Ed
+.Pp
+This configuration will list all clock information and
+synchronization information.
+All other events and messages about
+peers, system events and so on is suppressed.
+.It Ic logfile Ar logfile
+This command specifies the location of an alternate log file to
+be used instead of the default system
+.Xr syslog 3
+facility.
+This is the same operation as the \-l command line option.
+.It Ic setvar Ar variable Op Cm default
+This command adds an additional system variable.
+These
+variables can be used to distribute additional information such as
+the access policy.
+If the variable of the form
+.Sm off
+.Va name = Ar value
+.Sm on
+is followed by the
+.Cm default
+keyword, the
+variable will be listed as part of the default system variables
+.Po
+.Xr ntpq 1ntpqmdoc
+.Ic rv
+command
+.Pc ) .
+These additional variables serve
+informational purposes only.
+They are not related to the protocol
+other that they can be listed.
+The known protocol variables will
+always override any variables defined via the
+.Ic setvar
+mechanism.
+There are three special variables that contain the names
+of all variable of the same group.
+The
+.Va sys_var_list
+holds
+the names of all system variables.
+The
+.Va peer_var_list
+holds
+the names of all peer variables and the
+.Va clock_var_list
+holds the names of the reference clock variables.
+.It Xo Ic tinker
+.Oo
+.Cm allan Ar allan |
+.Cm dispersion Ar dispersion |
+.Cm freq Ar freq |
+.Cm huffpuff Ar huffpuff |
+.Cm panic Ar panic |
+.Cm step Ar srep |
+.Cm stepout Ar stepout
+.Oc
+.Xc
+This command can be used to alter several system variables in
+very exceptional circumstances.
+It should occur in the
+configuration file before any other configuration options.
+The
+default values of these variables have been carefully optimized for
+a wide range of network speeds and reliability expectations.
+In
+general, they interact in intricate ways that are hard to predict
+and some combinations can result in some very nasty behavior.
+Very
+rarely is it necessary to change the default values; but, some
+folks cannot resist twisting the knobs anyway and this command is
+for them.
+Emphasis added: twisters are on their own and can expect
+no help from the support group.
+.Pp
+The variables operate as follows:
+.Bl -tag -width indent
+.It Cm allan Ar allan
+The argument becomes the new value for the minimum Allan
+intercept, which is a parameter of the PLL/FLL clock discipline
+algorithm.
+The value in log2 seconds defaults to 7 (1024 s), which is also the lower
+limit.
+.It Cm dispersion Ar dispersion
+The argument becomes the new value for the dispersion increase rate,
+normally .000015 s/s.
+.It Cm freq Ar freq
+The argument becomes the initial value of the frequency offset in
+parts\-per\-million.
+This overrides the value in the frequency file, if
+present, and avoids the initial training state if it is not.
+.It Cm huffpuff Ar huffpuff
+The argument becomes the new value for the experimental
+huff\-n'\-puff filter span, which determines the most recent interval
+the algorithm will search for a minimum delay.
+The lower limit is
+900 s (15 m), but a more reasonable value is 7200 (2 hours).
+There
+is no default, since the filter is not enabled unless this command
+is given.
+.It Cm panic Ar panic
+The argument is the panic threshold, normally 1000 s.
+If set to zero,
+the panic sanity check is disabled and a clock offset of any value will
+be accepted.
+.It Cm step Ar step
+The argument is the step threshold, which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if the step threshold is set to zero or greater than the
+default.
+.It Cm stepout Ar stepout
+The argument is the stepout timeout, which by default is 900 s.
+It can
+be set to any positive number in seconds.
+If set to zero, the stepout
+pulses will not be suppressed.
+.El
+.It Xo Ic rlimit
+.Oo
+.Cm memlock Ar Nmegabytes |
+.Cm stacksize Ar N4kPages
+.Cm filenum Ar Nfiledescriptors
+.Oc
+.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
+when dropping root (the
+.Fl i
+option).
+The default is 32 megabytes. Setting this to zero will prevent any attemp to lock 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).
+.El
+.It Xo Ic trap Ar host_address
+.Op Cm port Ar port_number
+.Op Cm interface Ar interface_address
+.Xc
+This command configures a trap receiver at the given host
+address and port number for sending messages with the specified
+local interface address.
+If the port number is unspecified, a value
+of 18447 is used.
+If the interface address is not specified, the
+message is sent with a source address of the local interface the
+message is sent through.
+Note that on a multihomed host the
+interface used may vary from time to time with routing changes.
+.Pp
+The trap receiver will generally log event messages and other
+information from the server in a log file.
+While such monitor
+programs may also request their own trap dynamically, configuring a
+trap receiver will ensure that no messages are lost when the server
+is started.
+.It Cm hop Ar ...
+This command specifies a list of TTL values in increasing order, up to 8
+values can be specified.
+In manycast mode these values are used in turn in
+an expanding\-ring search.
+The default is eight multiples of 32 starting at
+31.
+.El
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTP_CONF_<option\-name>\fP or \fBNTP_CONF\fP
+.fi
+.ad
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh FILES
+.Bl -tag -width /etc/ntp.drift -compact
+.It Pa /etc/ntp.conf
+the default name of the configuration file
+.It Pa ntp.keys
+private MD5 keys
+.It Pa ntpkey
+RSA private key
+.It Pa ntpkey_ Ns Ar host
+RSA public key
+.It Pa ntp_dh
+Diffie\-Hellman agreement parameters
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntpd 1ntpdmdoc ,
+.Xr ntpdc 1ntpdcmdoc ,
+.Xr ntpq 1ntpqmdoc
+.Pp
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+.Li http://www.ntp.org/ .
+A snapshot of this documentation is available in HTML format in
+.Pa /usr/share/doc/ntp .
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 4)
+.%O RFC5905
+.Re
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+The syntax checking is not picky; some combinations of
+ridiculous and even hilarious options and modes may not be
+detected.
+.Pp
+The
+.Pa ntpkey_ Ns Ar host
+files are really digital
+certificates.
+These should be obtained via secure directory
+services when they become universally available.
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+This document was derived from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp.conf\fP
+option definitions.
diff --git a/ntpd/ntp.conf.def b/ntpd/ntp.conf.def
new file mode 100644
index 0000000..5a5af21
--- /dev/null
+++ b/ntpd/ntp.conf.def
@@ -0,0 +1,2795 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include copyright.def
+
+// We want the synopsis to be "/etc/ntp.conf" but we need the prog-name
+// to be ntp.conf - the latter is also how autogen produces the output
+// file name.
+prog-name = "ntp.conf";
+file-path = "/etc/ntp.conf";
+prog-title = "Network Time Protocol (NTP) daemon configuration file format";
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+The
+.Nm
+configuration file is read at initial startup by the
+.Xr ntpd 1ntpdmdoc
+daemon in order to specify the synchronization sources,
+modes and other related information.
+Usually, it is installed in the
+.Pa /etc
+directory,
+but could be installed elsewhere
+(see the daemon's
+.Fl c
+command line option).
+.Pp
+The file format is similar to other
+.Ux
+configuration files.
+Comments begin with a
+.Ql #
+character and extend to the end of the line;
+blank lines are ignored.
+Configuration commands consist of an initial keyword
+followed by a list of arguments,
+some of which may be optional, separated by whitespace.
+Commands may not be continued over multiple lines.
+Arguments may be host names,
+host addresses written in numeric, dotted-quad form,
+integers, floating point numbers (when specifying times in seconds)
+and text strings.
+.Pp
+The rest of this page describes the configuration and control options.
+The
+.Qq Notes on Configuring NTP and Setting up an NTP Subnet
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+contains an extended discussion of these options.
+In addition to the discussion of general
+.Sx Configuration Options ,
+there are sections describing the following supported functionality
+and the options used to control it:
+.Bl -bullet -offset indent
+.It
+.Sx Authentication Support
+.It
+.Sx Monitoring Support
+.It
+.Sx Access Control Support
+.It
+.Sx Automatic NTP Configuration Options
+.It
+.Sx Reference Clock Support
+.It
+.Sx Miscellaneous Options
+.El
+.Pp
+Following these is a section describing
+.Sx Miscellaneous Options .
+While there is a rich set of options available,
+the only required option is one or more
+.Ic pool ,
+.Ic server ,
+.Ic peer ,
+.Ic broadcast
+or
+.Ic manycastclient
+commands.
+.Sh Configuration Support
+Following is a description of the configuration commands in
+NTPv4.
+These commands have the same basic functions as in NTPv3 and
+in some cases new functions and new arguments.
+There are two
+classes of commands, configuration commands that configure a
+persistent association with a remote server or peer or reference
+clock, and auxiliary commands that specify environmental variables
+that control various related operations.
+.Ss Configuration Commands
+The various modes are determined by the command keyword and the
+type of the required IP address.
+Addresses are classed by type as
+(s) a remote server or peer (IPv4 class A, B and C), (b) the
+broadcast address of a local interface, (m) a multicast address (IPv4
+class D), or (r) a reference clock address (127.127.x.x).
+Note that
+only those options applicable to each command are listed below.
+Use
+of options not listed may not be caught as an error, but may result
+in some weird and even destructive behavior.
+.Pp
+If the Basic Socket Interface Extensions for IPv6 (RFC-2553)
+is detected, support for the IPv6 address family is generated
+in addition to the default support of the IPv4 address family.
+In a few cases, including the reslist billboard generated
+by ntpdc, IPv6 addresses are automatically generated.
+IPv6 addresses can be identified by the presence of colons
+.Dq \&:
+in the address field.
+IPv6 addresses can be used almost everywhere where
+IPv4 addresses can be used,
+with the exception of reference clock addresses,
+which are always IPv4.
+.Pp
+Note that in contexts where a host name is expected, a
+.Fl 4
+qualifier preceding
+the host name forces DNS resolution to the IPv4 namespace,
+while a
+.Fl 6
+qualifier forces DNS resolution to the IPv6 namespace.
+See IPv6 references for the
+equivalent classes for that address family.
+.Bl -tag -width indent
+.It Xo Ic pool Ar address
+.Op Cm burst
+.Op Cm iburst
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic server Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm burst
+.Op Cm iburst
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic peer Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic broadcast Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm ttl Ar ttl
+.Xc
+.It Xo Ic manycastclient Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Op Cm ttl Ar ttl
+.Xc
+.El
+.Pp
+These five commands specify the time server name or address to
+be used and the mode in which to operate.
+The
+.Ar address
+can be
+either a DNS name or an IP address in dotted-quad notation.
+Additional information on association behavior can be found in the
+.Qq Association Management
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Bl -tag -width indent
+.It Ic pool
+For type s addresses, this command mobilizes a persistent
+client mode association with a number of remote servers.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+.It Ic server
+For type s and r addresses, this command mobilizes a persistent
+client mode association with the specified remote server or local
+radio clock.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+This command should
+.Em not
+be used for type
+b or m addresses.
+.It Ic peer
+For type s addresses (only), this command mobilizes a
+persistent symmetric-active mode association with the specified
+remote peer.
+In this mode the local clock can be synchronized to
+the remote peer or the remote peer can be synchronized to the local
+clock.
+This is useful in a network of servers where, depending on
+various failure scenarios, either the local or remote peer may be
+the better source of time.
+This command should NOT be used for type
+b, m or r addresses.
+.It Ic broadcast
+For type b and m addresses (only), this
+command mobilizes a persistent broadcast mode association.
+Multiple
+commands can be used to specify multiple local broadcast interfaces
+(subnets) and/or multiple multicast groups.
+Note that local
+broadcast messages go only to the interface associated with the
+subnet specified, but multicast messages go to all interfaces.
+In broadcast mode the local server sends periodic broadcast
+messages to a client population at the
+.Ar address
+specified, which is usually the broadcast address on (one of) the
+local network(s) or a multicast address assigned to NTP.
+The IANA
+has assigned the multicast group address IPv4 224.0.1.1 and
+IPv6 ff05::101 (site local) exclusively to
+NTP, but other nonconflicting addresses can be used to contain the
+messages within administrative boundaries.
+Ordinarily, this
+specification applies only to the local server operating as a
+sender; for operation as a broadcast client, see the
+.Ic broadcastclient
+or
+.Ic multicastclient
+commands
+below.
+.It Ic manycastclient
+For type m addresses (only), this command mobilizes a
+manycast client mode association for the multicast address
+specified.
+In this case a specific address must be supplied which
+matches the address used on the
+.Ic manycastserver
+command for
+the designated manycast servers.
+The NTP multicast address
+224.0.1.1 assigned by the IANA should NOT be used, unless specific
+means are taken to avoid spraying large areas of the Internet with
+these messages and causing a possibly massive implosion of replies
+at the sender.
+The
+.Ic manycastserver
+command specifies that the local server
+is to operate in client mode with the remote servers that are
+discovered as the result of broadcast/multicast messages.
+The
+client broadcasts a request message to the group address associated
+with the specified
+.Ar address
+and specifically enabled
+servers respond to these messages.
+The client selects the servers
+providing the best time and continues as with the
+.Ic server
+command.
+The remaining servers are discarded as if never
+heard.
+.El
+.Pp
+Options:
+.Bl -tag -width indent
+.It Cm autokey
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the autokey scheme
+described in
+.Sx Authentication Options .
+.It Cm burst
+when the server is reachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first and second packets
+can be changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to improve timekeeping quality
+with the
+.Ic server
+command and s addresses.
+.It Cm iburst
+When the server is unreachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first two packets can be
+changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to speed the initial synchronization
+acquisition with the
+.Ic server
+command and s addresses and when
+.Xr ntpd 1ntpdmdoc
+is started with the
+.Fl q
+option.
+.It Cm key Ar key
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the specified
+.Ar key
+identifier with values from 1 to 65534, inclusive.
+The
+default is to include no encryption field.
+.It Cm minpoll Ar minpoll
+.It Cm maxpoll Ar maxpoll
+These options specify the minimum and maximum poll intervals
+for NTP messages, as a power of 2 in seconds
+The maximum poll
+interval defaults to 10 (1,024 s), but can be increased by the
+.Cm maxpoll
+option to an upper limit of 17 (36.4 h).
+The
+minimum poll interval defaults to 6 (64 s), but can be decreased by
+the
+.Cm minpoll
+option to a lower limit of 4 (16 s).
+.It Cm noselect
+Marks the server as unused, except for display purposes.
+The server is discarded by the selection algroithm.
+.It Cm prefer
+Marks the server as preferred.
+All other things being equal,
+this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+.Qq Mitigation Rules and the prefer Keyword
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+for further information.
+.It Cm ttl Ar ttl
+This option is used only with broadcast server and manycast
+client modes.
+It specifies the time-to-live
+.Ar ttl
+to
+use on broadcast server and multicast server and the maximum
+.Ar ttl
+for the expanding ring search with manycast
+client packets.
+Selection of the proper value, which defaults to
+127, is something of a black art and should be coordinated with the
+network administrator.
+.It Cm version Ar version
+Specifies the version number to be used for outgoing NTP
+packets.
+Versions 1-4 are the choices, with version 4 the
+default.
+.El
+.Ss Auxiliary Commands
+.Bl -tag -width indent
+.It Ic broadcastclient
+This command enables reception of broadcast server messages to
+any local interface (type b) address.
+Upon receiving a message for
+the first time, the broadcast client measures the nominal server
+propagation delay using a brief client/server exchange with the
+server, then enters the broadcast client mode, in which it
+synchronizes to succeeding broadcast messages.
+Note that, in order
+to avoid accidental or malicious disruption in this mode, both the
+server and client should operate using symmetric-key or public-key
+authentication as described in
+.Sx Authentication Options .
+.It Ic manycastserver Ar address ...
+This command enables reception of manycast client messages to
+the multicast group address(es) (type m) specified.
+At least one
+address is required, but the NTP multicast address 224.0.1.1
+assigned by the IANA should NOT be used, unless specific means are
+taken to limit the span of the reply and avoid a possibly massive
+implosion at the original sender.
+Note that, in order to avoid
+accidental or malicious disruption in this mode, both the server
+and client should operate using symmetric-key or public-key
+authentication as described in
+.Sx Authentication Options .
+.It Ic multicastclient Ar address ...
+This command enables reception of multicast server messages to
+the multicast group address(es) (type m) specified.
+Upon receiving
+a message for the first time, the multicast client measures the
+nominal server propagation delay using a brief client/server
+exchange with the server, then enters the broadcast client mode, in
+which it synchronizes to succeeding multicast messages.
+Note that,
+in order to avoid accidental or malicious disruption in this mode,
+both the server and client should operate using symmetric-key or
+public-key authentication as described in
+.Sx Authentication Options .
+.El
+.Sh Authentication Support
+Authentication support allows the NTP client to verify that the
+server is in fact known and trusted and not an intruder intending
+accidentally or on purpose to masquerade as that server.
+The NTPv3
+specification RFC-1305 defines a scheme which provides
+cryptographic authentication of received NTP packets.
+Originally,
+this was done using the Data Encryption Standard (DES) algorithm
+operating in Cipher Block Chaining (CBC) mode, commonly called
+DES-CBC.
+Subsequently, this was replaced by the RSA Message Digest
+5 (MD5) algorithm using a private key, commonly called keyed-MD5.
+Either algorithm computes a message digest, or one-way hash, which
+can be used to verify the server has the correct private key and
+key identifier.
+.Pp
+NTPv4 retains the NTPv3 scheme, properly described as symmetric key
+cryptography and, in addition, provides a new Autokey scheme
+based on public key cryptography.
+Public key cryptography is generally considered more secure
+than symmetric key cryptography, since the security is based
+on a private value which is generated by each server and
+never revealed.
+With Autokey all key distribution and
+management functions involve only public values, which
+considerably simplifies key distribution and storage.
+Public key management is based on X.509 certificates,
+which can be provided by commercial services or
+produced by utility programs in the OpenSSL software library
+or the NTPv4 distribution.
+.Pp
+While the algorithms for symmetric key cryptography are
+included in the NTPv4 distribution, public key cryptography
+requires the OpenSSL software library to be installed
+before building the NTP distribution.
+Directions for doing that
+are on the Building and Installing the Distribution page.
+.Pp
+Authentication is configured separately for each association
+using the
+.Cm key
+or
+.Cm autokey
+subcommand on the
+.Ic peer ,
+.Ic server ,
+.Ic broadcast
+and
+.Ic manycastclient
+configuration commands as described in
+.Sx Configuration Options
+page.
+The authentication
+options described below specify the locations of the key files,
+if other than default, which symmetric keys are trusted
+and the interval between various operations, if other than default.
+.Pp
+Authentication is always enabled,
+although ineffective if not configured as
+described below.
+If a NTP packet arrives
+including a message authentication
+code (MAC), it is accepted only if it
+passes all cryptographic checks.
+The
+checks require correct key ID, key value
+and message digest.
+If the packet has
+been modified in any way or replayed
+by an intruder, it will fail one or more
+of these checks and be discarded.
+Furthermore, the Autokey scheme requires a
+preliminary protocol exchange to obtain
+the server certificate, verify its
+credentials and initialize the protocol
+.Pp
+The
+.Cm auth
+flag controls whether new associations or
+remote configuration commands require cryptographic authentication.
+This flag can be set or reset by the
+.Ic enable
+and
+.Ic disable
+commands and also by remote
+configuration commands sent by a
+.Xr ntpdc 1ntpdcmdoc
+program running in
+another machine.
+If this flag is enabled, which is the default
+case, new broadcast client and symmetric passive associations and
+remote configuration commands must be cryptographically
+authenticated using either symmetric key or public key cryptography.
+If this
+flag is disabled, these operations are effective
+even if not cryptographic
+authenticated.
+It should be understood
+that operating with the
+.Ic auth
+flag disabled invites a significant vulnerability
+where a rogue hacker can
+masquerade as a falseticker and seriously
+disrupt system timekeeping.
+It is
+important to note that this flag has no purpose
+other than to allow or disallow
+a new association in response to new broadcast
+and symmetric active messages
+and remote configuration commands and, in particular,
+the flag has no effect on
+the authentication process itself.
+.Pp
+An attractive alternative where multicast support is available
+is manycast mode, in which clients periodically troll
+for servers as described in the
+.Sx Automatic NTP Configuration Options
+page.
+Either symmetric key or public key
+cryptographic authentication can be used in this mode.
+The principle advantage
+of manycast mode is that potential servers need not be
+configured in advance,
+since the client finds them during regular operation,
+and the configuration
+files for all clients can be identical.
+.Pp
+The security model and protocol schemes for
+both symmetric key and public key
+cryptography are summarized below;
+further details are in the briefings, papers
+and reports at the NTP project page linked from
+.Li http://www.ntp.org/ .
+.Ss Symmetric-Key Cryptography
+The original RFC-1305 specification allows any one of possibly
+65,534 keys, each distinguished by a 32-bit key identifier, to
+authenticate an association.
+The servers and clients involved must
+agree on the key and key identifier to
+authenticate NTP packets.
+Keys and
+related information are specified in a key
+file, usually called
+.Pa ntp.keys ,
+which must be distributed and stored using
+secure means beyond the scope of the NTP protocol itself.
+Besides the keys used
+for ordinary NTP associations,
+additional keys can be used as passwords for the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+.Pp
+When
+.Xr ntpd 1ntpdmdoc
+is first started, it reads the key file specified in the
+.Ic keys
+configuration command and installs the keys
+in the key cache.
+However,
+individual keys must be activated with the
+.Ic trusted
+command before use.
+This
+allows, for instance, the installation of possibly
+several batches of keys and
+then activating or deactivating each batch
+remotely using
+.Xr ntpdc 1ntpdcmdoc .
+This also provides a revocation capability that can be used
+if a key becomes compromised.
+The
+.Ic requestkey
+command selects the key used as the password for the
+.Xr ntpdc 1ntpdcmdoc
+utility, while the
+.Ic controlkey
+command selects the key used as the password for the
+.Xr ntpq 1ntpqmdoc
+utility.
+.Ss Public Key Cryptography
+NTPv4 supports the original NTPv3 symmetric key scheme
+described in RFC-1305 and in addition the Autokey protocol,
+which is based on public key cryptography.
+The Autokey Version 2 protocol described on the Autokey Protocol
+page verifies packet integrity using MD5 message digests
+and verifies the source with digital signatures and any of several
+digest/signature schemes.
+Optional identity schemes described on the Identity Schemes
+page and based on cryptographic challenge/response algorithms
+are also available.
+Using all of these schemes provides strong security against
+replay with or without modification, spoofing, masquerade
+and most forms of clogging attacks.
+.\" .Pp
+.\" The cryptographic means necessary for all Autokey operations
+.\" is provided by the OpenSSL software library.
+.\" This library is available from http://www.openssl.org/
+.\" and can be installed using the procedures outlined
+.\" in the Building and Installing the Distribution page.
+.\" Once installed,
+.\" the configure and build
+.\" process automatically detects the library and links
+.\" the library routines required.
+.Pp
+The Autokey protocol has several modes of operation
+corresponding to the various NTP modes supported.
+Most modes use a special cookie which can be
+computed independently by the client and server,
+but encrypted in transmission.
+All modes use in addition a variant of the S-KEY scheme,
+in which a pseudo-random key list is generated and used
+in reverse order.
+These schemes are described along with an executive summary,
+current status, briefing slides and reading list on the
+.Sx Autonomous Authentication
+page.
+.Pp
+The specific cryptographic environment used by Autokey servers
+and clients is determined by a set of files
+and soft links generated by the
+.Xr ntp-keygen 1ntpkeygenmdoc
+program.
+This includes a required host key file,
+required certificate file and optional sign key file,
+leapsecond file and identity scheme files.
+The
+digest/signature scheme is specified in the X.509 certificate
+along with the matching sign key.
+There are several schemes
+available in the OpenSSL software library, each identified
+by a specific string such as
+.Cm md5WithRSAEncryption ,
+which stands for the MD5 message digest with RSA
+encryption scheme.
+The current NTP distribution supports
+all the schemes in the OpenSSL library, including
+those based on RSA and DSA digital signatures.
+.Pp
+NTP secure groups can be used to define cryptographic compartments
+and security hierarchies.
+It is important that every host
+in the group be able to construct a certificate trail to one
+or more trusted hosts in the same group.
+Each group
+host runs the Autokey protocol to obtain the certificates
+for all hosts along the trail to one or more trusted hosts.
+This requires the configuration file in all hosts to be
+engineered so that, even under anticipated failure conditions,
+the NTP subnet will form such that every group host can find
+a trail to at least one trusted host.
+.Ss Naming and Addressing
+It is important to note that Autokey does not use DNS to
+resolve addresses, since DNS can't be completely trusted
+until the name servers have synchronized clocks.
+The cryptographic name used by Autokey to bind the host identity
+credentials and cryptographic values must be independent
+of interface, network and any other naming convention.
+The name appears in the host certificate in either or both
+the subject and issuer fields, so protection against
+DNS compromise is essential.
+.Pp
+By convention, the name of an Autokey host is the name returned
+by the Unix
+.Xr gethostname 2
+system call or equivalent in other systems.
+By the system design
+model, there are no provisions to allow alternate names or aliases.
+However, this is not to say that DNS aliases, different names
+for each interface, etc., are constrained in any way.
+.Pp
+It is also important to note that Autokey verifies authenticity
+using the host name, network address and public keys,
+all of which are bound together by the protocol specifically
+to deflect masquerade attacks.
+For this reason Autokey
+includes the source and destinatino IP addresses in message digest
+computations and so the same addresses must be available
+at both the server and client.
+For this reason operation
+with network address translation schemes is not possible.
+This reflects the intended robust security model where government
+and corporate NTP servers are operated outside firewall perimeters.
+.Ss Operation
+A specific combination of authentication scheme (none,
+symmetric key, public key) and identity scheme is called
+a cryptotype, although not all combinations are compatible.
+There may be management configurations where the clients,
+servers and peers may not all support the same cryptotypes.
+A secure NTPv4 subnet can be configured in many ways while
+keeping in mind the principles explained above and
+in this section.
+Note however that some cryptotype
+combinations may successfully interoperate with each other,
+but may not represent good security practice.
+.Pp
+The cryptotype of an association is determined at the time
+of mobilization, either at configuration time or some time
+later when a message of appropriate cryptotype arrives.
+When mobilized by a
+.Ic server
+or
+.Ic peer
+configuration command and no
+.Ic key
+or
+.Ic autokey
+subcommands are present, the association is not
+authenticated; if the
+.Ic key
+subcommand is present, the association is authenticated
+using the symmetric key ID specified; if the
+.Ic autokey
+subcommand is present, the association is authenticated
+using Autokey.
+.Pp
+When multiple identity schemes are supported in the Autokey
+protocol, the first message exchange determines which one is used.
+The client request message contains bits corresponding
+to which schemes it has available.
+The server response message
+contains bits corresponding to which schemes it has available.
+Both server and client match the received bits with their own
+and select a common scheme.
+.Pp
+Following the principle that time is a public value,
+a server responds to any client packet that matches
+its cryptotype capabilities.
+Thus, a server receiving
+an unauthenticated packet will respond with an unauthenticated
+packet, while the same server receiving a packet of a cryptotype
+it supports will respond with packets of that cryptotype.
+However, unconfigured broadcast or manycast client
+associations or symmetric passive associations will not be
+mobilized unless the server supports a cryptotype compatible
+with the first packet received.
+By default, unauthenticated associations will not be mobilized
+unless overridden in a decidedly dangerous way.
+.Pp
+Some examples may help to reduce confusion.
+Client Alice has no specific cryptotype selected.
+Server Bob has both a symmetric key file and minimal Autokey files.
+Alice's unauthenticated messages arrive at Bob, who replies with
+unauthenticated messages.
+Cathy has a copy of Bob's symmetric
+key file and has selected key ID 4 in messages to Bob.
+Bob verifies the message with his key ID 4.
+If it's the
+same key and the message is verified, Bob sends Cathy a reply
+authenticated with that key.
+If verification fails,
+Bob sends Cathy a thing called a crypto-NAK, which tells her
+something broke.
+She can see the evidence using the
+.Xr ntpq 1ntpqmdoc
+program.
+.Pp
+Denise has rolled her own host key and certificate.
+She also uses one of the identity schemes as Bob.
+She sends the first Autokey message to Bob and they
+both dance the protocol authentication and identity steps.
+If all comes out okay, Denise and Bob continue as described above.
+.Pp
+It should be clear from the above that Bob can support
+all the girls at the same time, as long as he has compatible
+authentication and identity credentials.
+Now, Bob can act just like the girls in his own choice of servers;
+he can run multiple configured associations with multiple different
+servers (or the same server, although that might not be useful).
+But, wise security policy might preclude some cryptotype
+combinations; for instance, running an identity scheme
+with one server and no authentication with another might not be wise.
+.Ss Key Management
+The cryptographic values used by the Autokey protocol are
+incorporated as a set of files generated by the
+.Xr ntp-keygen 1ntpkeygenmdoc
+utility program, including symmetric key, host key and
+public certificate files, as well as sign key, identity parameters
+and leapseconds files.
+Alternatively, host and sign keys and
+certificate files can be generated by the OpenSSL utilities
+and certificates can be imported from public certificate
+authorities.
+Note that symmetric keys are necessary for the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+The remaining files are necessary only for the
+Autokey protocol.
+.Pp
+Certificates imported from OpenSSL or public certificate
+authorities have certian limitations.
+The certificate should be in ASN.1 syntax, X.509 Version 3
+format and encoded in PEM, which is the same format
+used by OpenSSL.
+The overall length of the certificate encoded
+in ASN.1 must not exceed 1024 bytes.
+The subject distinguished
+name field (CN) is the fully qualified name of the host
+on which it is used; the remaining subject fields are ignored.
+The certificate extension fields must not contain either
+a subject key identifier or a issuer key identifier field;
+however, an extended key usage field for a trusted host must
+contain the value
+.Cm trustRoot ; .
+Other extension fields are ignored.
+.Ss Authentication Commands
+.Bl -tag -width indent
+.It Ic autokey Op Ar logsec
+Specifies the interval between regenerations of the session key
+list used with the Autokey protocol.
+Note that the size of the key
+list for each association depends on this interval and the current
+poll interval.
+The default value is 12 (4096 s or about 1.1 hours).
+For poll intervals above the specified interval, a session key list
+with a single entry will be regenerated for every message
+sent.
+.It Ic controlkey Ar key
+Specifies the key identifier to use with the
+.Xr ntpq 1ntpqmdoc
+utility, which uses the standard
+protocol defined in RFC-1305.
+The
+.Ar key
+argument is
+the key identifier for a trusted key, where the value can be in the
+range 1 to 65,534, inclusive.
+.It Xo Ic crypto
+.Op Cm cert Ar file
+.Op Cm leap Ar file
+.Op Cm randfile Ar file
+.Op Cm host Ar file
+.Op Cm sign Ar file
+.Op Cm gq Ar file
+.Op Cm gqpar Ar file
+.Op Cm iffpar Ar file
+.Op Cm mvpar Ar file
+.Op Cm pw Ar password
+.Xc
+This command requires the OpenSSL library.
+It activates public key
+cryptography, selects the message digest and signature
+encryption scheme and loads the required private and public
+values described above.
+If one or more files are left unspecified,
+the default names are used as described above.
+Unless the complete path and name of the file are specified, the
+location of a file is relative to the keys directory specified
+in the
+.Ic keysdir
+command or default
+.Pa /usr/local/etc .
+Following are the subcommands:
+.Bl -tag -width indent
+.It Cm cert Ar file
+Specifies the location of the required host public certificate file.
+This overrides the link
+.Pa ntpkey_cert_ Ns Ar hostname
+in the keys directory.
+.It Cm gqpar Ar file
+Specifies the location of the optional GQ parameters file.
+This
+overrides the link
+.Pa ntpkey_gq_ Ns Ar hostname
+in the keys directory.
+.It Cm host Ar file
+Specifies the location of the required host key file.
+This overrides
+the link
+.Pa ntpkey_key_ Ns Ar hostname
+in the keys directory.
+.It Cm iffpar Ar file
+Specifies the location of the optional IFF parameters file.This
+overrides the link
+.Pa ntpkey_iff_ Ns Ar hostname
+in the keys directory.
+.It Cm leap Ar file
+Specifies the location of the optional leapsecond file.
+This overrides the link
+.Pa ntpkey_leap
+in the keys directory.
+.It Cm mvpar Ar file
+Specifies the location of the optional MV parameters file.
+This
+overrides the link
+.Pa ntpkey_mv_ Ns Ar hostname
+in the keys directory.
+.It Cm pw Ar password
+Specifies the password to decrypt files containing private keys and
+identity parameters.
+This is required only if these files have been
+encrypted.
+.It Cm randfile Ar file
+Specifies the location of the random seed file used by the OpenSSL
+library.
+The defaults are described in the main text above.
+.It Cm sign Ar file
+Specifies the location of the optional sign key file.
+This overrides
+the link
+.Pa ntpkey_sign_ Ns Ar hostname
+in the keys directory.
+If this file is
+not found, the host key is also the sign key.
+.El
+.It Ic keys Ar keyfile
+Specifies the complete path and location of the MD5 key file
+containing the keys and key identifiers used by
+.Xr ntpd 1ntpdmdoc ,
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+when operating with symmetric key cryptography.
+This is the same operation as the
+.Fl k
+command line option.
+.It Ic keysdir Ar path
+This command specifies the default directory path for
+cryptographic keys, parameters and certificates.
+The default is
+.Pa /usr/local/etc/ .
+.It Ic requestkey Ar key
+Specifies the key identifier to use with the
+.Xr ntpdc 1ntpdcmdoc
+utility program, which uses a
+proprietary protocol specific to this implementation of
+.Xr ntpd 1ntpdmdoc .
+The
+.Ar key
+argument is a key identifier
+for the trusted key, where the value can be in the range 1 to
+65,534, inclusive.
+.It Ic revoke Ar logsec
+Specifies the interval between re-randomization of certain
+cryptographic values used by the Autokey scheme, as a power of 2 in
+seconds.
+These values need to be updated frequently in order to
+deflect brute-force attacks on the algorithms of the scheme;
+however, updating some values is a relatively expensive operation.
+The default interval is 16 (65,536 s or about 18 hours).
+For poll
+intervals above the specified interval, the values will be updated
+for every message sent.
+.It Ic trustedkey Ar key ...
+Specifies the key identifiers which are trusted for the
+purposes of authenticating peers with symmetric key cryptography,
+as well as keys used by the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+programs.
+The authentication procedures require that both the local
+and remote servers share the same key and key identifier for this
+purpose, although different keys can be used with different
+servers.
+The
+.Ar key
+arguments are 32-bit unsigned
+integers with values from 1 to 65,534.
+.El
+.Ss Error Codes
+The following error codes are reported via the NTP control
+and monitoring protocol trap mechanism.
+.Bl -tag -width indent
+.It 101
+.Pq bad field format or length
+The packet has invalid version, length or format.
+.It 102
+.Pq bad timestamp
+The packet timestamp is the same or older than the most recent received.
+This could be due to a replay or a server clock time step.
+.It 103
+.Pq bad filestamp
+The packet filestamp is the same or older than the most recent received.
+This could be due to a replay or a key file generation error.
+.It 104
+.Pq bad or missing public key
+The public key is missing, has incorrect format or is an unsupported type.
+.It 105
+.Pq unsupported digest type
+The server requires an unsupported digest/signature scheme.
+.It 106
+.Pq mismatched digest types
+Not used.
+.It 107
+.Pq bad signature length
+The signature length does not match the current public key.
+.It 108
+.Pq signature not verified
+The message fails the signature check.
+It could be bogus or signed by a
+different private key.
+.It 109
+.Pq certificate not verified
+The certificate is invalid or signed with the wrong key.
+.It 110
+.Pq certificate not verified
+The certificate is not yet valid or has expired or the signature could not
+be verified.
+.It 111
+.Pq bad or missing cookie
+The cookie is missing, corrupted or bogus.
+.It 112
+.Pq bad or missing leapseconds table
+The leapseconds table is missing, corrupted or bogus.
+.It 113
+.Pq bad or missing certificate
+The certificate is missing, corrupted or bogus.
+.It 114
+.Pq bad or missing identity
+The identity key is missing, corrupt or bogus.
+.El
+.Sh Monitoring Support
+.Xr ntpd 1ntpdmdoc
+includes a comprehensive monitoring facility suitable
+for continuous, long term recording of server and client
+timekeeping performance.
+See the
+.Ic statistics
+command below
+for a listing and example of each type of statistics currently
+supported.
+Statistic files are managed using file generation sets
+and scripts in the
+.Pa ./scripts
+directory of this distribution.
+Using
+these facilities and
+.Ux
+.Xr cron 8
+jobs, the data can be
+automatically summarized and archived for retrospective analysis.
+.Ss Monitoring Commands
+.Bl -tag -width indent
+.It Ic statistics Ar name ...
+Enables writing of statistics records.
+Currently, eight kinds of
+.Ar name
+statistics are supported.
+.Bl -tag -width indent
+.It Cm clockstats
+Enables recording of clock driver statistics information.
+Each update
+received from a clock driver appends a line of the following form to
+the file generation set named
+.Cm clockstats :
+.Bd -literal
+49213 525.624 127.127.4.1 93 226 00:08:29.606 D
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the
+clock address in dotted-quad notation.
+The final field shows the last
+timecode received from the clock in decoded ASCII format, where
+meaningful.
+In some clock drivers a good deal of additional information
+can be gathered and displayed as well.
+See information specific to each
+clock for further details.
+.It Cm cryptostats
+This option requires the OpenSSL cryptographic software library.
+It
+enables recording of cryptographic public key protocol information.
+Each message received by the protocol module appends a line of the
+following form to the file generation set named
+.Cm cryptostats :
+.Bd -literal
+49213 525.624 127.127.4.1 message
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the peer
+address in dotted-quad notation, The final message field includes the
+message type and certain ancillary information.
+See the
+.Sx Authentication Options
+section for further information.
+.It Cm loopstats
+Enables recording of loop filter statistics information.
+Each
+update of the local clock outputs a line of the following form to
+the file generation set named
+.Cm loopstats :
+.Bd -literal
+50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next five fields
+show time offset (seconds), frequency offset (parts per million -
+PPM), RMS jitter (seconds), Allan deviation (PPM) and clock
+discipline time constant.
+.It Cm peerstats
+Enables recording of peer statistics information.
+This includes
+statistics records of all peers of a NTP server and of special
+signals, where present and configured.
+Each valid update appends a
+line of the following form to the current element of a file
+generation set named
+.Cm peerstats :
+.Bd -literal
+48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877 0.000958674
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the peer address in dotted-quad notation and status,
+respectively.
+The status field is encoded in hex in the format
+described in Appendix A of the NTP specification RFC 1305.
+The final four fields show the offset,
+delay, dispersion and RMS jitter, all in seconds.
+.It Cm rawstats
+Enables recording of raw-timestamp statistics information.
+This
+includes statistics records of all peers of a NTP server and of
+special signals, where present and configured.
+Each NTP message
+received from a peer or clock driver appends a line of the
+following form to the file generation set named
+.Cm rawstats :
+.Bd -literal
+50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the remote peer or clock address followed by the local address
+in dotted-quad notation.
+The final four fields show the originate,
+receive, transmit and final NTP timestamps in order.
+The timestamp
+values are as received and before processing by the various data
+smoothing and mitigation algorithms.
+.It Cm sysstats
+Enables recording of ntpd statistics counters on a periodic basis.
+Each
+hour a line of the following form is appended to the file generation
+set named
+.Cm sysstats :
+.Bd -literal
+50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The remaining ten fields show
+the statistics counter values accumulated since the last generated
+line.
+.Bl -tag -width indent
+.It Time since restart Cm 36000
+Time in hours since the system was last rebooted.
+.It Packets received Cm 81965
+Total number of packets received.
+.It Packets processed Cm 0
+Number of packets received in response to previous packets sent
+.It Current version Cm 9546
+Number of packets matching the current NTP version.
+.It Previous version Cm 56
+Number of packets matching the previous NTP version.
+.It Bad version Cm 71793
+Number of packets matching neither NTP version.
+.It Access denied Cm 512
+Number of packets denied access for any reason.
+.It Bad length or format Cm 540
+Number of packets with invalid length, format or port number.
+.It Bad authentication Cm 10
+Number of packets not verified as authentic.
+.It Rate exceeded Cm 147
+Number of packets discarded due to rate limitation.
+.El
+.It Cm statsdir Ar directory_path
+Indicates the full path of a directory where statistics files
+should be created (see below).
+This keyword allows
+the (otherwise constant)
+.Cm filegen
+filename prefix to be modified for file generation sets, which
+is useful for handling statistics logs.
+.It Cm filegen Ar name Xo
+.Op Cm file Ar filename
+.Op Cm type Ar typename
+.Op Cm link | nolink
+.Op Cm enable | disable
+.Xc
+Configures setting of generation file set name.
+Generation
+file sets provide a means for handling files that are
+continuously growing during the lifetime of a server.
+Server statistics are a typical example for such files.
+Generation file sets provide access to a set of files used
+to store the actual data.
+At any time at most one element
+of the set is being written to.
+The type given specifies
+when and how data will be directed to a new element of the set.
+This way, information stored in elements of a file set
+that are currently unused are available for administrational
+operations without the risk of disturbing the operation of ntpd.
+(Most important: they can be removed to free space for new data
+produced.)
+.Pp
+Note that this command can be sent from the
+.Xr ntpdc 1ntpdcmdoc
+program running at a remote location.
+.Bl -tag -width indent
+.It Cm name
+This is the type of the statistics records, as shown in the
+.Cm statistics
+command.
+.It Cm file Ar filename
+This is the file name for the statistics records.
+Filenames of set
+members are built from three concatenated elements
+.Ar Cm prefix ,
+.Ar Cm filename
+and
+.Ar Cm suffix :
+.Bl -tag -width indent
+.It Cm prefix
+This is a constant filename path.
+It is not subject to
+modifications via the
+.Ar filegen
+option.
+It is defined by the
+server, usually specified as a compile-time constant.
+It may,
+however, be configurable for individual file generation sets
+via other commands.
+For example, the prefix used with
+.Ar loopstats
+and
+.Ar peerstats
+generation can be configured using the
+.Ar statsdir
+option explained above.
+.It Cm filename
+This string is directly concatenated to the prefix mentioned
+above (no intervening
+.Ql / ) .
+This can be modified using
+the file argument to the
+.Ar filegen
+statement.
+No
+.Pa ..
+elements are
+allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by
+.Ar prefix .
+.It Cm suffix
+This part is reflects individual elements of a file set.
+It is
+generated according to the type of a file set.
+.El
+.It Cm type Ar typename
+A file generation set is characterized by its type.
+The following
+types are supported:
+.Bl -tag -width indent
+.It Cm none
+The file set is actually a single plain file.
+.It Cm pid
+One element of file set is used per incarnation of a ntpd
+server.
+This type does not perform any changes to file set
+members during runtime, however it provides an easy way of
+separating files belonging to different
+.Xr ntpd 1ntpdmdoc
+server incarnations.
+The set member filename is built by appending a
+.Ql \&.
+to concatenated
+.Ar prefix
+and
+.Ar filename
+strings, and
+appending the decimal representation of the process ID of the
+.Xr ntpd 1ntpdmdoc
+server process.
+.It Cm day
+One file generation set element is created per day.
+A day is
+defined as the period between 00:00 and 24:00 UTC.
+The file set
+member suffix consists of a
+.Ql \&.
+and a day specification in
+the form
+.Cm YYYYMMdd .
+.Cm YYYY
+is a 4-digit year number (e.g., 1992).
+.Cm MM
+is a two digit month number.
+.Cm dd
+is a two digit day number.
+Thus, all information written at 10 December 1992 would end up
+in a file named
+.Ar prefix
+.Ar filename Ns .19921210 .
+.It Cm week
+Any file set member contains data related to a certain week of
+a year.
+The term week is defined by computing day-of-year
+modulo 7.
+Elements of such a file generation set are
+distinguished by appending the following suffix to the file set
+filename base: A dot, a 4-digit year number, the letter
+.Cm W ,
+and a 2-digit week number.
+For example, information from January,
+10th 1992 would end up in a file with suffix
+.No . Ns Ar 1992W1 .
+.It Cm month
+One generation file set element is generated per month.
+The
+file name suffix consists of a dot, a 4-digit year number, and
+a 2-digit month.
+.It Cm year
+One generation file element is generated per year.
+The filename
+suffix consists of a dot and a 4 digit year number.
+.It Cm age
+This type of file generation sets changes to a new element of
+the file set every 24 hours of server operation.
+The filename
+suffix consists of a dot, the letter
+.Cm a ,
+and an 8-digit number.
+This number is taken to be the number of seconds the server is
+running at the start of the corresponding 24-hour period.
+Information is only written to a file generation by specifying
+.Cm enable ;
+output is prevented by specifying
+.Cm disable .
+.El
+.It Cm link | nolink
+It is convenient to be able to access the current element of a file
+generation set by a fixed name.
+This feature is enabled by
+specifying
+.Cm link
+and disabled using
+.Cm nolink .
+If link is specified, a
+hard link from the current file set element to a file without
+suffix is created.
+When there is already a file with this name and
+the number of links of this file is one, it is renamed appending a
+dot, the letter
+.Cm C ,
+and the pid of the ntpd server process.
+When the
+number of links is greater than one, the file is unlinked.
+This
+allows the current file to be accessed by a constant name.
+.It Cm enable \&| Cm disable
+Enables or disables the recording function.
+.El
+.El
+.El
+.Sh Access Control Support
+The
+.Xr ntpd 1ntpdmdoc
+daemon implements a general purpose address/mask based restriction
+list.
+The list contains address/match entries sorted first
+by increasing address values and and then by increasing mask values.
+A match occurs when the bitwise AND of the mask and the packet
+source address is equal to the bitwise AND of the mask and
+address in the list.
+The list is searched in order with the
+last match found defining the restriction flags associated
+with the entry.
+Additional information and examples can be found in the
+.Qq Notes on Configuring NTP and Setting up a NTP Subnet
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Pp
+The restriction facility was implemented in conformance
+with the access policies for the original NSFnet backbone
+time servers.
+Later the facility was expanded to deflect
+cryptographic and clogging attacks.
+While this facility may
+be useful for keeping unwanted or broken or malicious clients
+from congesting innocent servers, it should not be considered
+an alternative to the NTP authentication facilities.
+Source address based restrictions are easily circumvented
+by a determined cracker.
+.Pp
+Clients can be denied service because they are explicitly
+included in the restrict list created by the restrict command
+or implicitly as the result of cryptographic or rate limit
+violations.
+Cryptographic violations include certificate
+or identity verification failure; rate limit violations generally
+result from defective NTP implementations that send packets
+at abusive rates.
+Some violations cause denied service
+only for the offending packet, others cause denied service
+for a timed period and others cause the denied service for
+an indefinate period.
+When a client or network is denied access
+for an indefinate period, the only way at present to remove
+the restrictions is by restarting the server.
+.Ss The Kiss-of-Death Packet
+Ordinarily, packets denied service are simply dropped with no
+further action except incrementing statistics counters.
+Sometimes a
+more proactive response is needed, such as a server message that
+explicitly requests the client to stop sending and leave a message
+for the system operator.
+A special packet format has been created
+for this purpose called the "kiss-of-death" (KoD) packet.
+KoD packets have the leap bits set unsynchronized and stratum set
+to zero and the reference identifier field set to a four-byte
+ASCII code.
+If the
+.Cm noserve
+or
+.Cm notrust
+flag of the matching restrict list entry is set,
+the code is "DENY"; if the
+.Cm limited
+flag is set and the rate limit
+is exceeded, the code is "RATE".
+Finally, if a cryptographic violation occurs, the code is "CRYP".
+.Pp
+A client receiving a KoD performs a set of sanity checks to
+minimize security exposure, then updates the stratum and
+reference identifier peer variables, sets the access
+denied (TEST4) bit in the peer flash variable and sends
+a message to the log.
+As long as the TEST4 bit is set,
+the client will send no further packets to the server.
+The only way at present to recover from this condition is
+to restart the protocol at both the client and server.
+This
+happens automatically at the client when the association times out.
+It will happen at the server only if the server operator cooperates.
+.Ss Access Control Commands
+.Bl -tag -width indent
+.It Xo Ic discard
+.Op Cm average Ar avg
+.Op Cm minimum Ar min
+.Op Cm monitor Ar prob
+.Xc
+Set the parameters of the
+.Cm limited
+facility which protects the server from
+client abuse.
+The
+.Cm average
+subcommand specifies the minimum average packet
+spacing, while the
+.Cm minimum
+subcommand specifies the minimum packet spacing.
+Packets that violate these minima are discarded
+and a kiss-o'-death packet returned if enabled.
+The default
+minimum average and minimum are 5 and 2, respectively.
+The monitor subcommand specifies the probability of discard
+for packets that overflow the rate-control window.
+.It Xo Ic restrict address
+.Op Cm mask Ar mask
+.Op Ar flag ...
+.Xc
+The
+.Ar address
+argument expressed in
+dotted-quad form is the address of a host or network.
+Alternatively, the
+.Ar address
+argument can be a valid host DNS name.
+The
+.Ar mask
+argument expressed in dotted-quad form defaults to
+.Cm 255.255.255.255 ,
+meaning that the
+.Ar address
+is treated as the address of an individual host.
+A default entry (address
+.Cm 0.0.0.0 ,
+mask
+.Cm 0.0.0.0 )
+is always included and is always the first entry in the list.
+Note that text string
+.Cm default ,
+with no mask option, may
+be used to indicate the default entry.
+In the current implementation,
+.Cm flag
+always
+restricts access, i.e., an entry with no flags indicates that free
+access to the server is to be given.
+The flags are not orthogonal,
+in that more restrictive flags will often make less restrictive
+ones redundant.
+The flags can generally be classed into two
+categories, those which restrict time service and those which
+restrict informational queries and attempts to do run-time
+reconfiguration of the server.
+One or more of the following flags
+may be specified:
+.Bl -tag -width indent
+.It Cm ignore
+Deny packets of all kinds, including
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries.
+.It Cm kod
+If this flag is set when an access violation occurs, a kiss-o'-death
+(KoD) packet is sent.
+KoD packets are rate limited to no more than one
+per second.
+If another KoD packet occurs within one second after the
+last one, the packet is dropped.
+.It Cm limited
+Deny service if the packet spacing violates the lower limits specified
+in the discard command.
+A history of clients is kept using the
+monitoring capability of
+.Xr ntpd 1ntpdmdoc .
+Thus, monitoring is always active as
+long as there is a restriction entry with the
+.Cm limited
+flag.
+.It Cm lowpriotrap
+Declare traps set by matching hosts to be low priority.
+The
+number of traps a server can maintain is limited (the current limit
+is 3).
+Traps are usually assigned on a first come, first served
+basis, with later trap requestors being denied service.
+This flag
+modifies the assignment algorithm by allowing low priority traps to
+be overridden by later requests for normal priority traps.
+.It Cm nomodify
+Deny
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries which attempt to modify the state of the
+server (i.e., run time reconfiguration).
+Queries which return
+information are permitted.
+.It Cm noquery
+Deny
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries.
+Time service is not affected.
+.It Cm nopeer
+Deny packets which would result in mobilizing a new association.
+This
+includes broadcast and symmetric active packets when a configured
+association does not exist.
+It also includes
+.Cm pool
+associations, so if you want to use servers from a
+.Cm pool
+directive and also want to use
+.Cm nopeer
+by default, you'll want a
+.Cm "restrict source ..." line as well that does
+.It not
+include the
+.Cm nopeer
+directive.
+.It Cm noserve
+Deny all packets except
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+queries.
+.It Cm notrap
+Decline to provide mode 6 control message trap service to matching
+hosts.
+The trap service is a subsystem of the ntpdq control message
+protocol which is intended for use by remote event logging programs.
+.It Cm notrust
+Deny service unless the packet is cryptographically authenticated.
+.It Cm ntpport
+This is actually a match algorithm modifier, rather than a
+restriction flag.
+Its presence causes the restriction entry to be
+matched only if the source port in the packet is the standard NTP
+UDP port (123).
+Both
+.Cm ntpport
+and
+.Cm non-ntpport
+may
+be specified.
+The
+.Cm ntpport
+is considered more specific and
+is sorted later in the list.
+.It Cm version
+Deny packets that do not match the current NTP version.
+.El
+.Pp
+Default restriction list entries with the flags ignore, interface,
+ntpport, for each of the local host's interface addresses are
+inserted into the table at startup to prevent the server
+from attempting to synchronize to its own time.
+A default entry is also always present, though if it is
+otherwise unconfigured; no flags are associated
+with the default entry (i.e., everything besides your own
+NTP server is unrestricted).
+.El
+.Sh Automatic NTP Configuration Options
+.Ss Manycasting
+Manycasting is a automatic discovery and configuration paradigm
+new to NTPv4.
+It is intended as a means for a multicast client
+to troll the nearby network neighborhood to find cooperating
+manycast servers, validate them using cryptographic means
+and evaluate their time values with respect to other servers
+that might be lurking in the vicinity.
+The intended result is that each manycast client mobilizes
+client associations with some number of the "best"
+of the nearby manycast servers, yet automatically reconfigures
+to sustain this number of servers should one or another fail.
+.Pp
+Note that the manycasting paradigm does not coincide
+with the anycast paradigm described in RFC-1546,
+which is designed to find a single server from a clique
+of servers providing the same service.
+The manycast paradigm is designed to find a plurality
+of redundant servers satisfying defined optimality criteria.
+.Pp
+Manycasting can be used with either symmetric key
+or public key cryptography.
+The public key infrastructure (PKI)
+offers the best protection against compromised keys
+and is generally considered stronger, at least with relatively
+large key sizes.
+It is implemented using the Autokey protocol and
+the OpenSSL cryptographic library available from
+.Li http://www.openssl.org/ .
+The library can also be used with other NTPv4 modes
+as well and is highly recommended, especially for broadcast modes.
+.Pp
+A persistent manycast client association is configured
+using the manycastclient command, which is similar to the
+server command but with a multicast (IPv4 class
+.Cm D
+or IPv6 prefix
+.Cm FF )
+group address.
+The IANA has designated IPv4 address 224.1.1.1
+and IPv6 address FF05::101 (site local) for NTP.
+When more servers are needed, it broadcasts manycast
+client messages to this address at the minimum feasible rate
+and minimum feasible time-to-live (TTL) hops, depending
+on how many servers have already been found.
+There can be as many manycast client associations
+as different group address, each one serving as a template
+for a future ephemeral unicast client/server association.
+.Pp
+Manycast servers configured with the
+.Ic manycastserver
+command listen on the specified group address for manycast
+client messages.
+Note the distinction between manycast client,
+which actively broadcasts messages, and manycast server,
+which passively responds to them.
+If a manycast server is
+in scope of the current TTL and is itself synchronized
+to a valid source and operating at a stratum level equal
+to or lower than the manycast client, it replies to the
+manycast client message with an ordinary unicast server message.
+.Pp
+The manycast client receiving this message mobilizes
+an ephemeral client/server association according to the
+matching manycast client template, but only if cryptographically
+authenticated and the server stratum is less than or equal
+to the client stratum.
+Authentication is explicitly required
+and either symmetric key or public key (Autokey) can be used.
+Then, the client polls the server at its unicast address
+in burst mode in order to reliably set the host clock
+and validate the source.
+This normally results
+in a volley of eight client/server at 2-s intervals
+during which both the synchronization and cryptographic
+protocols run concurrently.
+Following the volley,
+the client runs the NTP intersection and clustering
+algorithms, which act to discard all but the "best"
+associations according to stratum and synchronization
+distance.
+The surviving associations then continue
+in ordinary client/server mode.
+.Pp
+The manycast client polling strategy is designed to reduce
+as much as possible the volume of manycast client messages
+and the effects of implosion due to near-simultaneous
+arrival of manycast server messages.
+The strategy is determined by the
+.Ic manycastclient ,
+.Ic tos
+and
+.Ic ttl
+configuration commands.
+The manycast poll interval is
+normally eight times the system poll interval,
+which starts out at the
+.Cm minpoll
+value specified in the
+.Ic manycastclient ,
+command and, under normal circumstances, increments to the
+.Cm maxpolll
+value specified in this command.
+Initially, the TTL is
+set at the minimum hops specified by the ttl command.
+At each retransmission the TTL is increased until reaching
+the maximum hops specified by this command or a sufficient
+number client associations have been found.
+Further retransmissions use the same TTL.
+.Pp
+The quality and reliability of the suite of associations
+discovered by the manycast client is determined by the NTP
+mitigation algorithms and the
+.Cm minclock
+and
+.Cm minsane
+values specified in the
+.Ic tos
+configuration command.
+At least
+.Cm minsane
+candidate servers must be available and the mitigation
+algorithms produce at least
+.Cm minclock
+survivors in order to synchronize the clock.
+Byzantine agreement principles require at least four
+candidates in order to correctly discard a single falseticker.
+For legacy purposes,
+.Cm minsane
+defaults to 1 and
+.Cm minclock
+defaults to 3.
+For manycast service
+.Cm minsane
+should be explicitly set to 4, assuming at least that
+number of servers are available.
+.Pp
+If at least
+.Cm minclock
+servers are found, the manycast poll interval is immediately
+set to eight times
+.Cm maxpoll .
+If less than
+.Cm minclock
+servers are found when the TTL has reached the maximum hops,
+the manycast poll interval is doubled.
+For each transmission
+after that, the poll interval is doubled again until
+reaching the maximum of eight times
+.Cm maxpoll .
+Further transmissions use the same poll interval and
+TTL values.
+Note that while all this is going on,
+each client/server association found is operating normally
+it the system poll interval.
+.Pp
+Administratively scoped multicast boundaries are normally
+specified by the network router configuration and,
+in the case of IPv6, the link/site scope prefix.
+By default, the increment for TTL hops is 32 starting
+from 31; however, the
+.Ic ttl
+configuration command can be
+used to modify the values to match the scope rules.
+.Pp
+It is often useful to narrow the range of acceptable
+servers which can be found by manycast client associations.
+Because manycast servers respond only when the client
+stratum is equal to or greater than the server stratum,
+primary (stratum 1) servers fill find only primary servers
+in TTL range, which is probably the most common objective.
+However, unless configured otherwise, all manycast clients
+in TTL range will eventually find all primary servers
+in TTL range, which is probably not the most common
+objective in large networks.
+The
+.Ic tos
+command can be used to modify this behavior.
+Servers with stratum below
+.Cm floor
+or above
+.Cm ceiling
+specified in the
+.Ic tos
+command are strongly discouraged during the selection
+process; however, these servers may be temporally
+accepted if the number of servers within TTL range is
+less than
+.Cm minclock .
+.Pp
+The above actions occur for each manycast client message,
+which repeats at the designated poll interval.
+However, once the ephemeral client association is mobilized,
+subsequent manycast server replies are discarded,
+since that would result in a duplicate association.
+If during a poll interval the number of client associations
+falls below
+.Cm minclock ,
+all manycast client prototype associations are reset
+to the initial poll interval and TTL hops and operation
+resumes from the beginning.
+It is important to avoid
+frequent manycast client messages, since each one requires
+all manycast servers in TTL range to respond.
+The result could well be an implosion, either minor or major,
+depending on the number of servers in range.
+The recommended value for
+.Cm maxpoll
+is 12 (4,096 s).
+.Pp
+It is possible and frequently useful to configure a host
+as both manycast client and manycast server.
+A number of hosts configured this way and sharing a common
+group address will automatically organize themselves
+in an optimum configuration based on stratum and
+synchronization distance.
+For example, consider an NTP
+subnet of two primary servers and a hundred or more
+dependent clients.
+With two exceptions, all servers
+and clients have identical configuration files including both
+.Ic multicastclient
+and
+.Ic multicastserver
+commands using, for instance, multicast group address
+239.1.1.1.
+The only exception is that each primary server
+configuration file must include commands for the primary
+reference source such as a GPS receiver.
+.Pp
+The remaining configuration files for all secondary
+servers and clients have the same contents, except for the
+.Ic tos
+command, which is specific for each stratum level.
+For stratum 1 and stratum 2 servers, that command is
+not necessary.
+For stratum 3 and above servers the
+.Cm floor
+value is set to the intended stratum number.
+Thus, all stratum 3 configuration files are identical,
+all stratum 4 files are identical and so forth.
+.Pp
+Once operations have stabilized in this scenario,
+the primary servers will find the primary reference source
+and each other, since they both operate at the same
+stratum (1), but not with any secondary server or client,
+since these operate at a higher stratum.
+The secondary
+servers will find the servers at the same stratum level.
+If one of the primary servers loses its GPS receiver,
+it will continue to operate as a client and other clients
+will time out the corresponding association and
+re-associate accordingly.
+.Pp
+Some administrators prefer to avoid running
+.Xr ntpd 1ntpdmdoc
+continuously and run either
+.Xr ntpdate 8
+or
+.Xr ntpd 1ntpdmdoc
+.Fl q
+as a cron job.
+In either case the servers must be
+configured in advance and the program fails if none are
+available when the cron job runs.
+A really slick
+application of manycast is with
+.Xr ntpd 1ntpdmdoc
+.Fl q .
+The program wakes up, scans the local landscape looking
+for the usual suspects, selects the best from among
+the rascals, sets the clock and then departs.
+Servers do not have to be configured in advance and
+all clients throughout the network can have the same
+configuration file.
+.Ss Manycast Interactions with Autokey
+Each time a manycast client sends a client mode packet
+to a multicast group address, all manycast servers
+in scope generate a reply including the host name
+and status word.
+The manycast clients then run
+the Autokey protocol, which collects and verifies
+all certificates involved.
+Following the burst interval
+all but three survivors are cast off,
+but the certificates remain in the local cache.
+It often happens that several complete signing trails
+from the client to the primary servers are collected in this way.
+.Pp
+About once an hour or less often if the poll interval
+exceeds this, the client regenerates the Autokey key list.
+This is in general transparent in client/server mode.
+However, about once per day the server private value
+used to generate cookies is refreshed along with all
+manycast client associations.
+In this case all
+cryptographic values including certificates is refreshed.
+If a new certificate has been generated since
+the last refresh epoch, it will automatically revoke
+all prior certificates that happen to be in the
+certificate cache.
+At the same time, the manycast
+scheme starts all over from the beginning and
+the expanding ring shrinks to the minimum and increments
+from there while collecting all servers in scope.
+.Ss Manycast Options
+.Bl -tag -width indent
+.It Xo Ic tos
+.Oo
+.Cm ceiling Ar ceiling |
+.Cm cohort { 0 | 1 } |
+.Cm floor Ar floor |
+.Cm minclock Ar minclock |
+.Cm minsane Ar minsane
+.Oc
+.Xc
+This command affects the clock selection and clustering
+algorithms.
+It can be used to select the quality and
+quantity of peers used to synchronize the system clock
+and is most useful in manycast mode.
+The variables operate
+as follows:
+.Bl -tag -width indent
+.It Cm ceiling Ar ceiling
+Peers with strata above
+.Cm ceiling
+will be discarded if there are at least
+.Cm minclock
+peers remaining.
+This value defaults to 15, but can be changed
+to any number from 1 to 15.
+.It Cm cohort Bro 0 | 1 Brc
+This is a binary flag which enables (0) or disables (1)
+manycast server replies to manycast clients with the same
+stratum level.
+This is useful to reduce implosions where
+large numbers of clients with the same stratum level
+are present.
+The default is to enable these replies.
+.It Cm floor Ar floor
+Peers with strata below
+.Cm floor
+will be discarded if there are at least
+.Cm minclock
+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
+associations until no more than
+.Cm minclock
+associations remain.
+This value defaults to 3,
+but can be changed to any number from 1 to the number of
+configured sources.
+.It Cm minsane Ar minsane
+This is the minimum number of candidates available
+to the clock selection algorithm in order to produce
+one or more truechimers for the clustering algorithm.
+If fewer than this number are available, the clock is
+undisciplined and allowed to run free.
+The default is 1
+for legacy purposes.
+However, according to principles of
+Byzantine agreement,
+.Cm minsane
+should be at least 4 in order to detect and discard
+a single falseticker.
+.El
+.It Cm ttl Ar hop ...
+This command specifies a list of TTL values in increasing
+order, up to 8 values can be specified.
+In manycast mode these values are used in turn
+in an expanding-ring search.
+The default is eight
+multiples of 32 starting at 31.
+.El
+.Sh Reference Clock Support
+The NTP Version 4 daemon supports some three dozen different radio,
+satellite and modem reference clocks plus a special pseudo-clock
+used for backup or when no other clock source is available.
+Detailed descriptions of individual device drivers and options can
+be found in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+Additional information can be found in the pages linked
+there, including the
+.Qq Debugging Hints for Reference Clock Drivers
+and
+.Qq How To Write a Reference Clock Driver
+pages
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+In addition, support for a PPS
+signal is available as described in the
+.Qq Pulse-per-second (PPS) Signal Interfacing
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+Many
+drivers support special line discipline/streams modules which can
+significantly improve the accuracy using the driver.
+These are
+described in the
+.Qq Line Disciplines and Streams Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Pp
+A reference clock will generally (though not always) be a radio
+timecode receiver which is synchronized to a source of standard
+time such as the services offered by the NRC in Canada and NIST and
+USNO in the US.
+The interface between the computer and the timecode
+receiver is device dependent, but is usually a serial port.
+A
+device driver specific to each reference clock must be selected and
+compiled in the distribution; however, most common radio, satellite
+and modem clocks are included by default.
+Note that an attempt to
+configure a reference clock when the driver has not been compiled
+or the hardware port has not been appropriately configured results
+in a scalding remark to the system log file, but is otherwise non
+hazardous.
+.Pp
+For the purposes of configuration,
+.Xr ntpd 1ntpdmdoc
+treats
+reference clocks in a manner analogous to normal NTP peers as much
+as possible.
+Reference clocks are identified by a syntactically
+correct but invalid IP address, in order to distinguish them from
+normal NTP peers.
+Reference clock addresses are of the form
+.Sm off
+.Li 127.127. Ar t . Ar u ,
+.Sm on
+where
+.Ar t
+is an integer
+denoting the clock type and
+.Ar u
+indicates the unit
+number in the range 0-3.
+While it may seem overkill, it is in fact
+sometimes useful to configure multiple reference clocks of the same
+type, in which case the unit numbers must be unique.
+.Pp
+The
+.Ic server
+command is used to configure a reference
+clock, where the
+.Ar address
+argument in that command
+is the clock address.
+The
+.Cm key ,
+.Cm version
+and
+.Cm ttl
+options are not used for reference clock support.
+The
+.Cm mode
+option is added for reference clock support, as
+described below.
+The
+.Cm prefer
+option can be useful to
+persuade the server to cherish a reference clock with somewhat more
+enthusiasm than other reference clocks or peers.
+Further
+information on this option can be found in the
+.Qq Mitigation Rules and the prefer Keyword
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+page.
+The
+.Cm minpoll
+and
+.Cm maxpoll
+options have
+meaning only for selected clock drivers.
+See the individual clock
+driver document pages for additional information.
+.Pp
+The
+.Ic fudge
+command is used to provide additional
+information for individual clock drivers and normally follows
+immediately after the
+.Ic server
+command.
+The
+.Ar address
+argument specifies the clock address.
+The
+.Cm refid
+and
+.Cm stratum
+options can be used to
+override the defaults for the device.
+There are two optional
+device-dependent time offsets and four flags that can be included
+in the
+.Ic fudge
+command as well.
+.Pp
+The stratum number of a reference clock is by default zero.
+Since the
+.Xr ntpd 1ntpdmdoc
+daemon adds one to the stratum of each
+peer, a primary server ordinarily displays an external stratum of
+one.
+In order to provide engineered backups, it is often useful to
+specify the reference clock stratum as greater than zero.
+The
+.Cm stratum
+option is used for this purpose.
+Also, in cases
+involving both a reference clock and a pulse-per-second (PPS)
+discipline signal, it is useful to specify the reference clock
+identifier as other than the default, depending on the driver.
+The
+.Cm refid
+option is used for this purpose.
+Except where noted,
+these options apply to all clock drivers.
+.Ss Reference Clock Commands
+.Bl -tag -width indent
+.It Xo Ic server
+.Sm off
+.Li 127.127. Ar t . Ar u
+.Sm on
+.Op Cm prefer
+.Op Cm mode Ar int
+.Op Cm minpoll Ar int
+.Op Cm maxpoll Ar int
+.Xc
+This command can be used to configure reference clocks in
+special ways.
+The options are interpreted as follows:
+.Bl -tag -width indent
+.It Cm prefer
+Marks the reference clock as preferred.
+All other things being
+equal, this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+.Qq Mitigation Rules and the prefer Keyword
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+for further information.
+.It Cm mode Ar int
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.It Cm minpoll Ar int
+.It Cm maxpoll Ar int
+These options specify the minimum and maximum polling interval
+for reference clock messages, as a power of 2 in seconds
+For
+most directly connected reference clocks, both
+.Cm minpoll
+and
+.Cm maxpoll
+default to 6 (64 s).
+For modem reference clocks,
+.Cm minpoll
+defaults to 10 (17.1 m) and
+.Cm maxpoll
+defaults to 14 (4.5 h).
+The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
+.El
+.It Xo Ic fudge
+.Sm off
+.Li 127.127. Ar t . Ar u
+.Sm on
+.Op Cm time1 Ar sec
+.Op Cm time2 Ar sec
+.Op Cm stratum Ar int
+.Op Cm refid Ar string
+.Op Cm mode Ar int
+.Op Cm flag1 Cm 0 \&| Cm 1
+.Op Cm flag2 Cm 0 \&| Cm 1
+.Op Cm flag3 Cm 0 \&| Cm 1
+.Op Cm flag4 Cm 0 \&| Cm 1
+.Xc
+This command can be used to configure reference clocks in
+special ways.
+It must immediately follow the
+.Ic server
+command which configures the driver.
+Note that the same capability
+is possible at run time using the
+.Xr ntpdc 1ntpdcmdoc
+program.
+The options are interpreted as
+follows:
+.Bl -tag -width indent
+.It Cm time1 Ar sec
+Specifies a constant to be added to the time offset produced by
+the driver, a fixed-point decimal number in seconds.
+This is used
+as a calibration constant to adjust the nominal time offset of a
+particular clock to agree with an external standard, such as a
+precision PPS signal.
+It also provides a way to correct a
+systematic error or bias due to serial port or operating system
+latencies, different cable lengths or receiver internal delay.
+The
+specified offset is in addition to the propagation delay provided
+by other means, such as internal DIPswitches.
+Where a calibration
+for an individual system and driver is available, an approximate
+correction is noted in the driver documentation pages.
+Note: in order to facilitate calibration when more than one
+radio clock or PPS signal is supported, a special calibration
+feature is available.
+It takes the form of an argument to the
+.Ic enable
+command described in
+.Sx Miscellaneous Options
+page and operates as described in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.It Cm time2 Ar secs
+Specifies a fixed-point decimal number in seconds, which is
+interpreted in a driver-dependent way.
+See the descriptions of
+specific drivers in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.It Cm stratum Ar int
+Specifies the stratum number assigned to the driver, an integer
+between 0 and 15.
+This number overrides the default stratum number
+ordinarily assigned by the driver itself, usually zero.
+.It Cm refid Ar string
+Specifies an ASCII string of from one to four characters which
+defines the reference identifier used by the driver.
+This string
+overrides the default identifier ordinarily assigned by the driver
+itself.
+.It Cm mode Ar int
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.It Cm flag1 Cm 0 \&| Cm 1
+.It Cm flag2 Cm 0 \&| Cm 1
+.It Cm flag3 Cm 0 \&| Cm 1
+.It Cm flag4 Cm 0 \&| Cm 1
+These four flags are used for customizing the clock driver.
+The
+interpretation of these values, and whether they are used at all,
+is a function of the particular clock driver.
+However, by
+convention
+.Cm flag4
+is used to enable recording monitoring
+data to the
+.Cm clockstats
+file configured with the
+.Ic filegen
+command.
+Further information on the
+.Ic filegen
+command can be found in
+.Sx Monitoring Options .
+.El
+.El
+.Sh Miscellaneous Options
+.Bl -tag -width indent
+.It Ic broadcastdelay Ar seconds
+The broadcast and multicast modes require a special calibration
+to determine the network delay between the local and remote
+servers.
+Ordinarily, this is done automatically by the initial
+protocol exchanges between the client and server.
+In some cases,
+the calibration procedure may fail due to network or server access
+controls, for example.
+This command specifies the default delay to
+be used under these circumstances.
+Typically (for Ethernet), a
+number between 0.003 and 0.007 seconds is appropriate.
+The default
+when this command is not used is 0.004 seconds.
+.It Ic calldelay Ar delay
+This option controls the delay in seconds between the first and second
+packets sent in burst or iburst mode to allow additional time for a modem
+or ISDN call to complete.
+.It Ic driftfile Ar driftfile
+This command specifies the complete path and name of the file used to
+record the frequency of the local clock oscillator.
+This is the same
+operation as the
+.Fl f
+command line option.
+If the file exists, it is read at
+startup in order to set the initial frequency and then updated once per
+hour with the current frequency computed by the daemon.
+If the file name is
+specified, but the file itself does not exist, the starts with an initial
+frequency of zero and creates the file when writing it for the first time.
+If this command is not given, the daemon will always start with an initial
+frequency of zero.
+.Pp
+The file format consists of a single line containing a single
+floating point number, which records the frequency offset measured
+in parts-per-million (PPM).
+The file is updated by first writing
+the current drift value into a temporary file and then renaming
+this file to replace the old version.
+This implies that
+.Xr ntpd 1ntpdmdoc
+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 Xo Ic enable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm mode7 | monitor |
+.Cm ntp | Cm stats
+.Oc
+.Xc
+.It Xo Ic disable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm mode7 | monitor |
+.Cm ntp | Cm stats
+.Oc
+.Xc
+Provides a way to enable or disable various server options.
+Flags not mentioned are unaffected.
+Note that all of these flags
+can be controlled remotely using the
+.Xr ntpdc 1ntpdcmdoc
+utility program.
+.Bl -tag -width indent
+.It Cm auth
+Enables the server to synchronize with unconfigured peers only if the
+peer has been correctly authenticated using either public key or
+private key cryptography.
+The default for this flag is
+.Ic enable .
+.It Cm bclient
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the
+.Ic multicastclient
+command with default
+address.
+The default for this flag is
+.Ic disable .
+.It Cm calibrate
+Enables the calibrate feature for reference clocks.
+The default for
+this flag is
+.Ic disable .
+.It Cm kernel
+Enables the kernel time discipline, if available.
+The default for this
+flag is
+.Ic enable
+if support is available, otherwise
+.Ic disable .
+.It Cm mode7
+Enables processing of NTP mode 7 implementation-specific requests
+which are used by the deprecated
+.Xr ntpdc 1ntpdcmdoc
+program.
+The default for this flag is disable.
+This flag is excluded from runtime configuration using
+.Xr ntpq 1ntpqmdoc .
+The
+.Xr ntpq 1ntpqmdoc
+program provides the same capabilities as
+.Xr ntpdc 1ntpdcmdoc
+using standard mode 6 requests.
+.It Cm monitor
+Enables the monitoring facility.
+See the
+.Xr ntpdc 1ntpdcmdoc
+program
+and the
+.Ic monlist
+command or further information.
+The
+default for this flag is
+.Ic enable .
+.It Cm ntp
+Enables time and frequency discipline.
+In effect, this switch opens and
+closes the feedback loop, which is useful for testing.
+The default for
+this flag is
+.Ic enable .
+.It Cm stats
+Enables the statistics facility.
+See the
+.Sx Monitoring Options
+section for further information.
+The default for this flag is
+.Ic disable .
+.El
+.It Ic includefile Ar includefile
+This command allows additional configuration commands
+to be included from a separate file.
+Include files may
+be nested to a depth of five; upon reaching the end of any
+include file, command processing resumes in the previous
+configuration file.
+This option is useful for sites that run
+.Xr ntpd 1ntpdmdoc
+on multiple hosts, with (mostly) common options (e.g., a
+restriction list).
+.It Ic logconfig Ar configkeyword
+This command controls the amount and type of output written to
+the system
+.Xr syslog 3
+facility or the alternate
+.Ic logfile
+log file.
+By default, all output is turned on.
+All
+.Ar configkeyword
+keywords can be prefixed with
+.Ql = ,
+.Ql +
+and
+.Ql - ,
+where
+.Ql =
+sets the
+.Xr syslog 3
+priority mask,
+.Ql +
+adds and
+.Ql -
+removes
+messages.
+.Xr syslog 3
+messages can be controlled in four
+classes
+.Po
+.Cm clock ,
+.Cm peer ,
+.Cm sys
+and
+.Cm sync
+.Pc .
+Within these classes four types of messages can be
+controlled: informational messages
+.Po
+.Cm info
+.Pc ,
+event messages
+.Po
+.Cm events
+.Pc ,
+statistics messages
+.Po
+.Cm statistics
+.Pc
+and
+status messages
+.Po
+.Cm status
+.Pc .
+.Pp
+Configuration keywords are formed by concatenating the message class with
+the event class.
+The
+.Cm all
+prefix can be used instead of a message class.
+A
+message class may also be followed by the
+.Cm all
+keyword to enable/disable all
+messages of the respective message class.Thus, a minimal log configuration
+could look like this:
+.Bd -literal
+logconfig =syncstatus +sysevents
+.Ed
+.Pp
+This would just list the synchronizations state of
+.Xr ntpd 1ntpdmdoc
+and the major system events.
+For a simple reference server, the
+following minimum message configuration could be useful:
+.Bd -literal
+logconfig =syncall +clockall
+.Ed
+.Pp
+This configuration will list all clock information and
+synchronization information.
+All other events and messages about
+peers, system events and so on is suppressed.
+.It Ic logfile Ar logfile
+This command specifies the location of an alternate log file to
+be used instead of the default system
+.Xr syslog 3
+facility.
+This is the same operation as the -l command line option.
+.It Ic setvar Ar variable Op Cm default
+This command adds an additional system variable.
+These
+variables can be used to distribute additional information such as
+the access policy.
+If the variable of the form
+.Sm off
+.Va name = Ar value
+.Sm on
+is followed by the
+.Cm default
+keyword, the
+variable will be listed as part of the default system variables
+.Po
+.Xr ntpq 1ntpqmdoc
+.Ic rv
+command
+.Pc ) .
+These additional variables serve
+informational purposes only.
+They are not related to the protocol
+other that they can be listed.
+The known protocol variables will
+always override any variables defined via the
+.Ic setvar
+mechanism.
+There are three special variables that contain the names
+of all variable of the same group.
+The
+.Va sys_var_list
+holds
+the names of all system variables.
+The
+.Va peer_var_list
+holds
+the names of all peer variables and the
+.Va clock_var_list
+holds the names of the reference clock variables.
+.It Xo Ic tinker
+.Oo
+.Cm allan Ar allan |
+.Cm dispersion Ar dispersion |
+.Cm freq Ar freq |
+.Cm huffpuff Ar huffpuff |
+.Cm panic Ar panic |
+.Cm step Ar srep |
+.Cm stepout Ar stepout
+.Oc
+.Xc
+This command can be used to alter several system variables in
+very exceptional circumstances.
+It should occur in the
+configuration file before any other configuration options.
+The
+default values of these variables have been carefully optimized for
+a wide range of network speeds and reliability expectations.
+In
+general, they interact in intricate ways that are hard to predict
+and some combinations can result in some very nasty behavior.
+Very
+rarely is it necessary to change the default values; but, some
+folks cannot resist twisting the knobs anyway and this command is
+for them.
+Emphasis added: twisters are on their own and can expect
+no help from the support group.
+.Pp
+The variables operate as follows:
+.Bl -tag -width indent
+.It Cm allan Ar allan
+The argument becomes the new value for the minimum Allan
+intercept, which is a parameter of the PLL/FLL clock discipline
+algorithm.
+The value in log2 seconds defaults to 7 (1024 s), which is also the lower
+limit.
+.It Cm dispersion Ar dispersion
+The argument becomes the new value for the dispersion increase rate,
+normally .000015 s/s.
+.It Cm freq Ar freq
+The argument becomes the initial value of the frequency offset in
+parts-per-million.
+This overrides the value in the frequency file, if
+present, and avoids the initial training state if it is not.
+.It Cm huffpuff Ar huffpuff
+The argument becomes the new value for the experimental
+huff-n'-puff filter span, which determines the most recent interval
+the algorithm will search for a minimum delay.
+The lower limit is
+900 s (15 m), but a more reasonable value is 7200 (2 hours).
+There
+is no default, since the filter is not enabled unless this command
+is given.
+.It Cm panic Ar panic
+The argument is the panic threshold, normally 1000 s.
+If set to zero,
+the panic sanity check is disabled and a clock offset of any value will
+be accepted.
+.It Cm step Ar step
+The argument is the step threshold, which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if the step threshold is set to zero or greater than the
+default.
+.It Cm stepout Ar stepout
+The argument is the stepout timeout, which by default is 900 s.
+It can
+be set to any positive number in seconds.
+If set to zero, the stepout
+pulses will not be suppressed.
+.El
+.It Xo Ic rlimit
+.Oo
+.Cm memlock Ar Nmegabytes |
+.Cm stacksize Ar N4kPages
+.Cm filenum Ar Nfiledescriptors
+.Oc
+.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
+when dropping root (the
+.Fl i
+option).
+The default is 32 megabytes. Setting this to zero will prevent any attemp to lock 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).
+.El
+.It Xo Ic trap Ar host_address
+.Op Cm port Ar port_number
+.Op Cm interface Ar interface_address
+.Xc
+This command configures a trap receiver at the given host
+address and port number for sending messages with the specified
+local interface address.
+If the port number is unspecified, a value
+of 18447 is used.
+If the interface address is not specified, the
+message is sent with a source address of the local interface the
+message is sent through.
+Note that on a multihomed host the
+interface used may vary from time to time with routing changes.
+.Pp
+The trap receiver will generally log event messages and other
+information from the server in a log file.
+While such monitor
+programs may also request their own trap dynamically, configuring a
+trap receiver will ensure that no messages are lost when the server
+is started.
+.It Cm hop Ar ...
+This command specifies a list of TTL values in increasing order, up to 8
+values can be specified.
+In manycast mode these values are used in turn in
+an expanding-ring search.
+The default is eight multiples of 32 starting at
+31.
+.El
+ _END_PROG_MDOC_DESCRIP;
+};
+
+doc-section = {
+ ds-type = 'FILES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_FILES
+.Bl -tag -width /etc/ntp.drift -compact
+.It Pa /etc/ntp.conf
+the default name of the configuration file
+.It Pa ntp.keys
+private MD5 keys
+.It Pa ntpkey
+RSA private key
+.It Pa ntpkey_ Ns Ar host
+RSA public key
+.It Pa ntp_dh
+Diffie-Hellman agreement parameters
+.El
+ _END_MDOC_FILES;
+};
+
+doc-section = {
+ ds-type = 'SEE ALSO';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_SEE_ALSO
+.Xr ntpd 1ntpdmdoc ,
+.Xr ntpdc 1ntpdcmdoc ,
+.Xr ntpq 1ntpqmdoc
+.Pp
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+.Li http://www.ntp.org/ .
+A snapshot of this documentation is available in HTML format in
+.Pa /usr/share/doc/ntp .
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 4)
+.%O RFC5905
+.Re
+ _END_MDOC_SEE_ALSO;
+};
+
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+The syntax checking is not picky; some combinations of
+ridiculous and even hilarious options and modes may not be
+detected.
+.Pp
+The
+.Pa ntpkey_ Ns Ar host
+files are really digital
+certificates.
+These should be obtained via secure directory
+services when they become universally available.
+ _END_MDOC_BUGS;
+};
+
+doc-section = {
+ ds-type = 'NOTES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_NOTES
+This document was derived from FreeBSD.
+ _END_MDOC_NOTES;
+};
diff --git a/ntpd/ntp.conf.html b/ntpd/ntp.conf.html
new file mode 100644
index 0000000..15632da
--- /dev/null
+++ b/ntpd/ntp.conf.html
@@ -0,0 +1,2625 @@
+<html lang="en">
+<head>
+<title>NTP Configuration File User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="NTP Configuration File User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">NTP Configuration File User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002econf-Description">ntp.conf Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">NTP's Configuration File User Manual</h2>
+
+<p>This document describes the configuration file for the NTP Project's
+<code>ntpd</code> program.
+
+ <p>This document applies to version 4.2.7p482 of <code>ntp.conf</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">NTP's Configuration File User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002econf-Description">ntp.conf Description</a>
+<li><a accesskey="2" href="#ntp_002econf-Notes">ntp.conf Notes</a>
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002econf-Description"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>The behavior of <code>ntpd</code> can be changed by a configuration file,
+by default <code>ntp.conf</code>.
+
+<div class="node">
+<p><hr>
+<a name="ntp_002econf-Notes"></a>
+<br>
+</div>
+
+<h3 class="section">Notes about ntp.conf</h3>
+
+<p><a name="index-ntp_002econf-1"></a><a name="index-Network-Time-Protocol-_0028NTP_0029-daemon-configuration-file-format-2"></a>
+
+ <p>The
+<code>ntp.conf</code>
+configuration file is read at initial startup by the
+<code>ntpd(1ntpdmdoc)</code>
+daemon in order to specify the synchronization sources,
+modes and other related information.
+Usually, it is installed in the
+<span class="file">/etc</span>
+directory,
+but could be installed elsewhere
+(see the daemon's
+<code>-c</code>
+command line option).
+
+ <p>The file format is similar to other
+<span class="sc">unix</span>
+configuration files.
+Comments begin with a
+#
+character and extend to the end of the line;
+blank lines are ignored.
+Configuration commands consist of an initial keyword
+followed by a list of arguments,
+some of which may be optional, separated by whitespace.
+Commands may not be continued over multiple lines.
+Arguments may be host names,
+host addresses written in numeric, dotted-quad form,
+integers, floating point numbers (when specifying times in seconds)
+and text strings.
+
+ <p>The rest of this page describes the configuration and control options.
+The
+"Notes on Configuring NTP and Setting up an NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>)
+contains an extended discussion of these options.
+In addition to the discussion of general
+<a href="#Configuration-Options">Configuration Options</a>,
+there are sections describing the following supported functionality
+and the options used to control it:
+ <ul>
+<li><a href="#Authentication-Support">Authentication Support</a>
+<li><a href="#Monitoring-Support">Monitoring Support</a>
+<li><a href="#Access-Control-Support">Access Control Support</a>
+<li><a href="#Automatic-NTP-Configuration-Options">Automatic NTP Configuration Options</a>
+<li><a href="#Reference-Clock-Support">Reference Clock Support</a>
+<li><a href="#Miscellaneous-Options">Miscellaneous Options</a>
+</ul>
+
+ <p>Following these is a section describing
+<a href="#Miscellaneous-Options">Miscellaneous Options</a>.
+While there is a rich set of options available,
+the only required option is one or more
+<code>pool</code>,
+<code>server</code>,
+<code>peer</code>,
+<code>broadcast</code>
+or
+<code>manycastclient</code>
+commands.
+<div class="node">
+<p><hr>
+<a name="Configuration-Support"></a>
+<br>
+</div>
+
+<h4 class="subsection">Configuration Support</h4>
+
+<p>Following is a description of the configuration commands in
+NTPv4.
+These commands have the same basic functions as in NTPv3 and
+in some cases new functions and new arguments.
+There are two
+classes of commands, configuration commands that configure a
+persistent association with a remote server or peer or reference
+clock, and auxiliary commands that specify environmental variables
+that control various related operations.
+
+<h5 class="subsubsection">Configuration Commands</h5>
+
+<p>The various modes are determined by the command keyword and the
+type of the required IP address.
+Addresses are classed by type as
+(s) a remote server or peer (IPv4 class A, B and C), (b) the
+broadcast address of a local interface, (m) a multicast address (IPv4
+class D), or (r) a reference clock address (127.127.x.x).
+Note that
+only those options applicable to each command are listed below.
+Use
+of options not listed may not be caught as an error, but may result
+in some weird and even destructive behavior.
+
+ <p>If the Basic Socket Interface Extensions for IPv6 (RFC-2553)
+is detected, support for the IPv6 address family is generated
+in addition to the default support of the IPv4 address family.
+In a few cases, including the reslist billboard generated
+by ntpdc, IPv6 addresses are automatically generated.
+IPv6 addresses can be identified by the presence of colons
+:
+in the address field.
+IPv6 addresses can be used almost everywhere where
+IPv4 addresses can be used,
+with the exception of reference clock addresses,
+which are always IPv4.
+
+ <p>Note that in contexts where a host name is expected, a
+<code>-4</code>
+qualifier preceding
+the host name forces DNS resolution to the IPv4 namespace,
+while a
+<code>-6</code>
+qualifier forces DNS resolution to the IPv6 namespace.
+See IPv6 references for the
+equivalent classes for that address family.
+ <dl>
+<dt><code>pool</code> <kbd>address</kbd> <code>[burst]</code> <code>[iburst]</code> <code>[version </code><kbd>version</kbd><code>]</code> <code>[prefer]</code> <code>[minpoll </code><kbd>minpoll</kbd><code>]</code> <code>[maxpoll </code><kbd>maxpoll</kbd><code>]</code><br><dt><code>server</code> <kbd>address</kbd> <code>[key </code><kbd>key</kbd> <kbd>|</kbd><code> autokey]</code> <code>[burst]</code> <code>[iburst]</code> <code>[version </code><kbd>version</kbd><code>]</code> <code>[prefer]</code> <code>[minpoll </code><kbd>minpoll</kbd><code>]</code> <code>[maxpoll </code><kbd>maxpoll</kbd><code>]</code><br><dt><code>peer</code> <kbd>address</kbd> <code>[key </code><kbd>key</kbd> <kbd>|</kbd><code> autokey]</code> <code>[version </code><kbd>version</kbd><code>]</code> <code>[prefer]</code> <code>[minpoll </code><kbd>minpoll</kbd><code>]</code> <code>[maxpoll </code><kbd>maxpoll</kbd><code>]</code><br><dt><code>broadcast</code> <kbd>address</kbd> <code>[key </code><kbd>key</kbd> <kbd>|</kbd><code> autokey]</code> <code>[version </code><kbd>version</kbd><code>]</code> <code>[prefer]</code> <code>[minpoll </code><kbd>minpoll</kbd><code>]</code> <code>[ttl </code><kbd>ttl</kbd><code>]</code><br><dt><code>manycastclient</code> <kbd>address</kbd> <code>[key </code><kbd>key</kbd> <kbd>|</kbd><code> autokey]</code> <code>[version </code><kbd>version</kbd><code>]</code> <code>[prefer]</code> <code>[minpoll </code><kbd>minpoll</kbd><code>]</code> <code>[maxpoll </code><kbd>maxpoll</kbd><code>]</code> <code>[ttl </code><kbd>ttl</kbd><code>]</code><dd></dl>
+
+ <p>These five commands specify the time server name or address to
+be used and the mode in which to operate.
+The
+<kbd>address</kbd>
+can be
+either a DNS name or an IP address in dotted-quad notation.
+Additional information on association behavior can be found in the
+"Association Management"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+ <dl>
+<dt><code>pool</code><dd>For type s addresses, this command mobilizes a persistent
+client mode association with a number of remote servers.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+<br><dt><code>server</code><dd>For type s and r addresses, this command mobilizes a persistent
+client mode association with the specified remote server or local
+radio clock.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+This command should
+<em>not</em>
+be used for type
+b or m addresses.
+<br><dt><code>peer</code><dd>For type s addresses (only), this command mobilizes a
+persistent symmetric-active mode association with the specified
+remote peer.
+In this mode the local clock can be synchronized to
+the remote peer or the remote peer can be synchronized to the local
+clock.
+This is useful in a network of servers where, depending on
+various failure scenarios, either the local or remote peer may be
+the better source of time.
+This command should NOT be used for type
+b, m or r addresses.
+<br><dt><code>broadcast</code><dd>For type b and m addresses (only), this
+command mobilizes a persistent broadcast mode association.
+Multiple
+commands can be used to specify multiple local broadcast interfaces
+(subnets) and/or multiple multicast groups.
+Note that local
+broadcast messages go only to the interface associated with the
+subnet specified, but multicast messages go to all interfaces.
+In broadcast mode the local server sends periodic broadcast
+messages to a client population at the
+<kbd>address</kbd>
+specified, which is usually the broadcast address on (one of) the
+local network(s) or a multicast address assigned to NTP.
+The IANA
+has assigned the multicast group address IPv4 224.0.1.1 and
+IPv6 ff05::101 (site local) exclusively to
+NTP, but other nonconflicting addresses can be used to contain the
+messages within administrative boundaries.
+Ordinarily, this
+specification applies only to the local server operating as a
+sender; for operation as a broadcast client, see the
+<code>broadcastclient</code>
+or
+<code>multicastclient</code>
+commands
+below.
+<br><dt><code>manycastclient</code><dd>For type m addresses (only), this command mobilizes a
+manycast client mode association for the multicast address
+specified.
+In this case a specific address must be supplied which
+matches the address used on the
+<code>manycastserver</code>
+command for
+the designated manycast servers.
+The NTP multicast address
+224.0.1.1 assigned by the IANA should NOT be used, unless specific
+means are taken to avoid spraying large areas of the Internet with
+these messages and causing a possibly massive implosion of replies
+at the sender.
+The
+<code>manycastserver</code>
+command specifies that the local server
+is to operate in client mode with the remote servers that are
+discovered as the result of broadcast/multicast messages.
+The
+client broadcasts a request message to the group address associated
+with the specified
+<kbd>address</kbd>
+and specifically enabled
+servers respond to these messages.
+The client selects the servers
+providing the best time and continues as with the
+<code>server</code>
+command.
+The remaining servers are discarded as if never
+heard.
+</dl>
+
+ <p>Options:
+ <dl>
+<dt><code>autokey</code><dd>All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the autokey scheme
+described in
+<a href="#Authentication-Options">Authentication Options</a>.
+<br><dt><code>burst</code><dd>when the server is reachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first and second packets
+can be changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to improve timekeeping quality
+with the
+<code>server</code>
+command and s addresses.
+<br><dt><code>iburst</code><dd>When the server is unreachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first two packets can be
+changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to speed the initial synchronization
+acquisition with the
+<code>server</code>
+command and s addresses and when
+<code>ntpd(1ntpdmdoc)</code>
+is started with the
+<code>-q</code>
+option.
+<br><dt><code>key</code> <kbd>key</kbd><dd>All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the specified
+<kbd>key</kbd>
+identifier with values from 1 to 65534, inclusive.
+The
+default is to include no encryption field.
+<br><dt><code>minpoll</code> <kbd>minpoll</kbd><br><dt><code>maxpoll</code> <kbd>maxpoll</kbd><dd>These options specify the minimum and maximum poll intervals
+for NTP messages, as a power of 2 in seconds
+The maximum poll
+interval defaults to 10 (1,024 s), but can be increased by the
+<code>maxpoll</code>
+option to an upper limit of 17 (36.4 h).
+The
+minimum poll interval defaults to 6 (64 s), but can be decreased by
+the
+<code>minpoll</code>
+option to a lower limit of 4 (16 s).
+<br><dt><code>noselect</code><dd>Marks the server as unused, except for display purposes.
+The server is discarded by the selection algroithm.
+<br><dt><code>prefer</code><dd>Marks the server as preferred.
+All other things being equal,
+this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>)
+for further information.
+<br><dt><code>ttl</code> <kbd>ttl</kbd><dd>This option is used only with broadcast server and manycast
+client modes.
+It specifies the time-to-live
+<kbd>ttl</kbd>
+to
+use on broadcast server and multicast server and the maximum
+<kbd>ttl</kbd>
+for the expanding ring search with manycast
+client packets.
+Selection of the proper value, which defaults to
+127, is something of a black art and should be coordinated with the
+network administrator.
+<br><dt><code>version</code> <kbd>version</kbd><dd>Specifies the version number to be used for outgoing NTP
+packets.
+Versions 1-4 are the choices, with version 4 the
+default.
+</dl>
+
+<h5 class="subsubsection">Auxiliary Commands</h5>
+
+ <dl>
+<dt><code>broadcastclient</code><dd>This command enables reception of broadcast server messages to
+any local interface (type b) address.
+Upon receiving a message for
+the first time, the broadcast client measures the nominal server
+propagation delay using a brief client/server exchange with the
+server, then enters the broadcast client mode, in which it
+synchronizes to succeeding broadcast messages.
+Note that, in order
+to avoid accidental or malicious disruption in this mode, both the
+server and client should operate using symmetric-key or public-key
+authentication as described in
+<a href="#Authentication-Options">Authentication Options</a>.
+<br><dt><code>manycastserver</code> <kbd>address</kbd> <kbd>...</kbd><dd>This command enables reception of manycast client messages to
+the multicast group address(es) (type m) specified.
+At least one
+address is required, but the NTP multicast address 224.0.1.1
+assigned by the IANA should NOT be used, unless specific means are
+taken to limit the span of the reply and avoid a possibly massive
+implosion at the original sender.
+Note that, in order to avoid
+accidental or malicious disruption in this mode, both the server
+and client should operate using symmetric-key or public-key
+authentication as described in
+<a href="#Authentication-Options">Authentication Options</a>.
+<br><dt><code>multicastclient</code> <kbd>address</kbd> <kbd>...</kbd><dd>This command enables reception of multicast server messages to
+the multicast group address(es) (type m) specified.
+Upon receiving
+a message for the first time, the multicast client measures the
+nominal server propagation delay using a brief client/server
+exchange with the server, then enters the broadcast client mode, in
+which it synchronizes to succeeding multicast messages.
+Note that,
+in order to avoid accidental or malicious disruption in this mode,
+both the server and client should operate using symmetric-key or
+public-key authentication as described in
+<a href="#Authentication-Options">Authentication Options</a>.
+</dl>
+<div class="node">
+<p><hr>
+<a name="Authentication-Support"></a>
+<br>
+</div>
+
+<h4 class="subsection">Authentication Support</h4>
+
+<p>Authentication support allows the NTP client to verify that the
+server is in fact known and trusted and not an intruder intending
+accidentally or on purpose to masquerade as that server.
+The NTPv3
+specification RFC-1305 defines a scheme which provides
+cryptographic authentication of received NTP packets.
+Originally,
+this was done using the Data Encryption Standard (DES) algorithm
+operating in Cipher Block Chaining (CBC) mode, commonly called
+DES-CBC.
+Subsequently, this was replaced by the RSA Message Digest
+5 (MD5) algorithm using a private key, commonly called keyed-MD5.
+Either algorithm computes a message digest, or one-way hash, which
+can be used to verify the server has the correct private key and
+key identifier.
+
+ <p>NTPv4 retains the NTPv3 scheme, properly described as symmetric key
+cryptography and, in addition, provides a new Autokey scheme
+based on public key cryptography.
+Public key cryptography is generally considered more secure
+than symmetric key cryptography, since the security is based
+on a private value which is generated by each server and
+never revealed.
+With Autokey all key distribution and
+management functions involve only public values, which
+considerably simplifies key distribution and storage.
+Public key management is based on X.509 certificates,
+which can be provided by commercial services or
+produced by utility programs in the OpenSSL software library
+or the NTPv4 distribution.
+
+ <p>While the algorithms for symmetric key cryptography are
+included in the NTPv4 distribution, public key cryptography
+requires the OpenSSL software library to be installed
+before building the NTP distribution.
+Directions for doing that
+are on the Building and Installing the Distribution page.
+
+ <p>Authentication is configured separately for each association
+using the
+<code>key</code>
+or
+<code>autokey</code>
+subcommand on the
+<code>peer</code>,
+<code>server</code>,
+<code>broadcast</code>
+and
+<code>manycastclient</code>
+configuration commands as described in
+<a href="#Configuration-Options">Configuration Options</a>
+page.
+The authentication
+options described below specify the locations of the key files,
+if other than default, which symmetric keys are trusted
+and the interval between various operations, if other than default.
+
+ <p>Authentication is always enabled,
+although ineffective if not configured as
+described below.
+If a NTP packet arrives
+including a message authentication
+code (MAC), it is accepted only if it
+passes all cryptographic checks.
+The
+checks require correct key ID, key value
+and message digest.
+If the packet has
+been modified in any way or replayed
+by an intruder, it will fail one or more
+of these checks and be discarded.
+Furthermore, the Autokey scheme requires a
+preliminary protocol exchange to obtain
+the server certificate, verify its
+credentials and initialize the protocol
+
+ <p>The
+<code>auth</code>
+flag controls whether new associations or
+remote configuration commands require cryptographic authentication.
+This flag can be set or reset by the
+<code>enable</code>
+and
+<code>disable</code>
+commands and also by remote
+configuration commands sent by a
+<code>ntpdc(1ntpdcmdoc)</code>
+program running in
+another machine.
+If this flag is enabled, which is the default
+case, new broadcast client and symmetric passive associations and
+remote configuration commands must be cryptographically
+authenticated using either symmetric key or public key cryptography.
+If this
+flag is disabled, these operations are effective
+even if not cryptographic
+authenticated.
+It should be understood
+that operating with the
+<code>auth</code>
+flag disabled invites a significant vulnerability
+where a rogue hacker can
+masquerade as a falseticker and seriously
+disrupt system timekeeping.
+It is
+important to note that this flag has no purpose
+other than to allow or disallow
+a new association in response to new broadcast
+and symmetric active messages
+and remote configuration commands and, in particular,
+the flag has no effect on
+the authentication process itself.
+
+ <p>An attractive alternative where multicast support is available
+is manycast mode, in which clients periodically troll
+for servers as described in the
+<a href="#Automatic-NTP-Configuration-Options">Automatic NTP Configuration Options</a>
+page.
+Either symmetric key or public key
+cryptographic authentication can be used in this mode.
+The principle advantage
+of manycast mode is that potential servers need not be
+configured in advance,
+since the client finds them during regular operation,
+and the configuration
+files for all clients can be identical.
+
+ <p>The security model and protocol schemes for
+both symmetric key and public key
+cryptography are summarized below;
+further details are in the briefings, papers
+and reports at the NTP project page linked from
+<code>http://www.ntp.org/</code>.
+
+<h5 class="subsubsection">Symmetric-Key Cryptography</h5>
+
+<p>The original RFC-1305 specification allows any one of possibly
+65,534 keys, each distinguished by a 32-bit key identifier, to
+authenticate an association.
+The servers and clients involved must
+agree on the key and key identifier to
+authenticate NTP packets.
+Keys and
+related information are specified in a key
+file, usually called
+<span class="file">ntp.keys</span>,
+which must be distributed and stored using
+secure means beyond the scope of the NTP protocol itself.
+Besides the keys used
+for ordinary NTP associations,
+additional keys can be used as passwords for the
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+utility programs.
+
+ <p>When
+<code>ntpd(1ntpdmdoc)</code>
+is first started, it reads the key file specified in the
+<code>keys</code>
+configuration command and installs the keys
+in the key cache.
+However,
+individual keys must be activated with the
+<code>trusted</code>
+command before use.
+This
+allows, for instance, the installation of possibly
+several batches of keys and
+then activating or deactivating each batch
+remotely using
+<code>ntpdc(1ntpdcmdoc)</code>.
+This also provides a revocation capability that can be used
+if a key becomes compromised.
+The
+<code>requestkey</code>
+command selects the key used as the password for the
+<code>ntpdc(1ntpdcmdoc)</code>
+utility, while the
+<code>controlkey</code>
+command selects the key used as the password for the
+<code>ntpq(1ntpqmdoc)</code>
+utility.
+
+<h5 class="subsubsection">Public Key Cryptography</h5>
+
+<p>NTPv4 supports the original NTPv3 symmetric key scheme
+described in RFC-1305 and in addition the Autokey protocol,
+which is based on public key cryptography.
+The Autokey Version 2 protocol described on the Autokey Protocol
+page verifies packet integrity using MD5 message digests
+and verifies the source with digital signatures and any of several
+digest/signature schemes.
+Optional identity schemes described on the Identity Schemes
+page and based on cryptographic challenge/response algorithms
+are also available.
+Using all of these schemes provides strong security against
+replay with or without modification, spoofing, masquerade
+and most forms of clogging attacks.
+
+ <p>The Autokey protocol has several modes of operation
+corresponding to the various NTP modes supported.
+Most modes use a special cookie which can be
+computed independently by the client and server,
+but encrypted in transmission.
+All modes use in addition a variant of the S-KEY scheme,
+in which a pseudo-random key list is generated and used
+in reverse order.
+These schemes are described along with an executive summary,
+current status, briefing slides and reading list on the
+<a href="#Autonomous-Authentication">Autonomous Authentication</a>
+page.
+
+ <p>The specific cryptographic environment used by Autokey servers
+and clients is determined by a set of files
+and soft links generated by the
+<code>ntp-keygen(1ntpkeygenmdoc)</code>
+program.
+This includes a required host key file,
+required certificate file and optional sign key file,
+leapsecond file and identity scheme files.
+The
+digest/signature scheme is specified in the X.509 certificate
+along with the matching sign key.
+There are several schemes
+available in the OpenSSL software library, each identified
+by a specific string such as
+<code>md5WithRSAEncryption</code>,
+which stands for the MD5 message digest with RSA
+encryption scheme.
+The current NTP distribution supports
+all the schemes in the OpenSSL library, including
+those based on RSA and DSA digital signatures.
+
+ <p>NTP secure groups can be used to define cryptographic compartments
+and security hierarchies.
+It is important that every host
+in the group be able to construct a certificate trail to one
+or more trusted hosts in the same group.
+Each group
+host runs the Autokey protocol to obtain the certificates
+for all hosts along the trail to one or more trusted hosts.
+This requires the configuration file in all hosts to be
+engineered so that, even under anticipated failure conditions,
+the NTP subnet will form such that every group host can find
+a trail to at least one trusted host.
+
+<h5 class="subsubsection">Naming and Addressing</h5>
+
+<p>It is important to note that Autokey does not use DNS to
+resolve addresses, since DNS can't be completely trusted
+until the name servers have synchronized clocks.
+The cryptographic name used by Autokey to bind the host identity
+credentials and cryptographic values must be independent
+of interface, network and any other naming convention.
+The name appears in the host certificate in either or both
+the subject and issuer fields, so protection against
+DNS compromise is essential.
+
+ <p>By convention, the name of an Autokey host is the name returned
+by the Unix
+<code>gethostname(2)</code>
+system call or equivalent in other systems.
+By the system design
+model, there are no provisions to allow alternate names or aliases.
+However, this is not to say that DNS aliases, different names
+for each interface, etc., are constrained in any way.
+
+ <p>It is also important to note that Autokey verifies authenticity
+using the host name, network address and public keys,
+all of which are bound together by the protocol specifically
+to deflect masquerade attacks.
+For this reason Autokey
+includes the source and destinatino IP addresses in message digest
+computations and so the same addresses must be available
+at both the server and client.
+For this reason operation
+with network address translation schemes is not possible.
+This reflects the intended robust security model where government
+and corporate NTP servers are operated outside firewall perimeters.
+
+<h5 class="subsubsection">Operation</h5>
+
+<p>A specific combination of authentication scheme (none,
+symmetric key, public key) and identity scheme is called
+a cryptotype, although not all combinations are compatible.
+There may be management configurations where the clients,
+servers and peers may not all support the same cryptotypes.
+A secure NTPv4 subnet can be configured in many ways while
+keeping in mind the principles explained above and
+in this section.
+Note however that some cryptotype
+combinations may successfully interoperate with each other,
+but may not represent good security practice.
+
+ <p>The cryptotype of an association is determined at the time
+of mobilization, either at configuration time or some time
+later when a message of appropriate cryptotype arrives.
+When mobilized by a
+<code>server</code>
+or
+<code>peer</code>
+configuration command and no
+<code>key</code>
+or
+<code>autokey</code>
+subcommands are present, the association is not
+authenticated; if the
+<code>key</code>
+subcommand is present, the association is authenticated
+using the symmetric key ID specified; if the
+<code>autokey</code>
+subcommand is present, the association is authenticated
+using Autokey.
+
+ <p>When multiple identity schemes are supported in the Autokey
+protocol, the first message exchange determines which one is used.
+The client request message contains bits corresponding
+to which schemes it has available.
+The server response message
+contains bits corresponding to which schemes it has available.
+Both server and client match the received bits with their own
+and select a common scheme.
+
+ <p>Following the principle that time is a public value,
+a server responds to any client packet that matches
+its cryptotype capabilities.
+Thus, a server receiving
+an unauthenticated packet will respond with an unauthenticated
+packet, while the same server receiving a packet of a cryptotype
+it supports will respond with packets of that cryptotype.
+However, unconfigured broadcast or manycast client
+associations or symmetric passive associations will not be
+mobilized unless the server supports a cryptotype compatible
+with the first packet received.
+By default, unauthenticated associations will not be mobilized
+unless overridden in a decidedly dangerous way.
+
+ <p>Some examples may help to reduce confusion.
+Client Alice has no specific cryptotype selected.
+Server Bob has both a symmetric key file and minimal Autokey files.
+Alice's unauthenticated messages arrive at Bob, who replies with
+unauthenticated messages.
+Cathy has a copy of Bob's symmetric
+key file and has selected key ID 4 in messages to Bob.
+Bob verifies the message with his key ID 4.
+If it's the
+same key and the message is verified, Bob sends Cathy a reply
+authenticated with that key.
+If verification fails,
+Bob sends Cathy a thing called a crypto-NAK, which tells her
+something broke.
+She can see the evidence using the
+<code>ntpq(1ntpqmdoc)</code>
+program.
+
+ <p>Denise has rolled her own host key and certificate.
+She also uses one of the identity schemes as Bob.
+She sends the first Autokey message to Bob and they
+both dance the protocol authentication and identity steps.
+If all comes out okay, Denise and Bob continue as described above.
+
+ <p>It should be clear from the above that Bob can support
+all the girls at the same time, as long as he has compatible
+authentication and identity credentials.
+Now, Bob can act just like the girls in his own choice of servers;
+he can run multiple configured associations with multiple different
+servers (or the same server, although that might not be useful).
+But, wise security policy might preclude some cryptotype
+combinations; for instance, running an identity scheme
+with one server and no authentication with another might not be wise.
+
+<h5 class="subsubsection">Key Management</h5>
+
+<p>The cryptographic values used by the Autokey protocol are
+incorporated as a set of files generated by the
+<code>ntp-keygen(1ntpkeygenmdoc)</code>
+utility program, including symmetric key, host key and
+public certificate files, as well as sign key, identity parameters
+and leapseconds files.
+Alternatively, host and sign keys and
+certificate files can be generated by the OpenSSL utilities
+and certificates can be imported from public certificate
+authorities.
+Note that symmetric keys are necessary for the
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+utility programs.
+The remaining files are necessary only for the
+Autokey protocol.
+
+ <p>Certificates imported from OpenSSL or public certificate
+authorities have certian limitations.
+The certificate should be in ASN.1 syntax, X.509 Version 3
+format and encoded in PEM, which is the same format
+used by OpenSSL.
+The overall length of the certificate encoded
+in ASN.1 must not exceed 1024 bytes.
+The subject distinguished
+name field (CN) is the fully qualified name of the host
+on which it is used; the remaining subject fields are ignored.
+The certificate extension fields must not contain either
+a subject key identifier or a issuer key identifier field;
+however, an extended key usage field for a trusted host must
+contain the value
+<code>trustRoot</code>;.
+Other extension fields are ignored.
+
+<h5 class="subsubsection">Authentication Commands</h5>
+
+ <dl>
+<dt><code>autokey</code> <code>[</code><kbd>logsec</kbd><code>]</code><dd>Specifies the interval between regenerations of the session key
+list used with the Autokey protocol.
+Note that the size of the key
+list for each association depends on this interval and the current
+poll interval.
+The default value is 12 (4096 s or about 1.1 hours).
+For poll intervals above the specified interval, a session key list
+with a single entry will be regenerated for every message
+sent.
+<br><dt><code>controlkey</code> <kbd>key</kbd><dd>Specifies the key identifier to use with the
+<code>ntpq(1ntpqmdoc)</code>
+utility, which uses the standard
+protocol defined in RFC-1305.
+The
+<kbd>key</kbd>
+argument is
+the key identifier for a trusted key, where the value can be in the
+range 1 to 65,534, inclusive.
+<br><dt><code>crypto</code> <code>[cert </code><kbd>file</kbd><code>]</code> <code>[leap </code><kbd>file</kbd><code>]</code> <code>[randfile </code><kbd>file</kbd><code>]</code> <code>[host </code><kbd>file</kbd><code>]</code> <code>[sign </code><kbd>file</kbd><code>]</code> <code>[gq </code><kbd>file</kbd><code>]</code> <code>[gqpar </code><kbd>file</kbd><code>]</code> <code>[iffpar </code><kbd>file</kbd><code>]</code> <code>[mvpar </code><kbd>file</kbd><code>]</code> <code>[pw </code><kbd>password</kbd><code>]</code><dd>This command requires the OpenSSL library.
+It activates public key
+cryptography, selects the message digest and signature
+encryption scheme and loads the required private and public
+values described above.
+If one or more files are left unspecified,
+the default names are used as described above.
+Unless the complete path and name of the file are specified, the
+location of a file is relative to the keys directory specified
+in the
+<code>keysdir</code>
+command or default
+<span class="file">/usr/local/etc</span>.
+Following are the subcommands:
+ <dl>
+<dt><code>cert</code> <kbd>file</kbd><dd>Specifies the location of the required host public certificate file.
+This overrides the link
+<span class="file">ntpkey_cert_</span><kbd>hostname</kbd>
+in the keys directory.
+<br><dt><code>gqpar</code> <kbd>file</kbd><dd>Specifies the location of the optional GQ parameters file.
+This
+overrides the link
+<span class="file">ntpkey_gq_</span><kbd>hostname</kbd>
+in the keys directory.
+<br><dt><code>host</code> <kbd>file</kbd><dd>Specifies the location of the required host key file.
+This overrides
+the link
+<span class="file">ntpkey_key_</span><kbd>hostname</kbd>
+in the keys directory.
+<br><dt><code>iffpar</code> <kbd>file</kbd><dd>Specifies the location of the optional IFF parameters file.This
+overrides the link
+<span class="file">ntpkey_iff_</span><kbd>hostname</kbd>
+in the keys directory.
+<br><dt><code>leap</code> <kbd>file</kbd><dd>Specifies the location of the optional leapsecond file.
+This overrides the link
+<span class="file">ntpkey_leap</span>
+in the keys directory.
+<br><dt><code>mvpar</code> <kbd>file</kbd><dd>Specifies the location of the optional MV parameters file.
+This
+overrides the link
+<span class="file">ntpkey_mv_</span><kbd>hostname</kbd>
+in the keys directory.
+<br><dt><code>pw</code> <kbd>password</kbd><dd>Specifies the password to decrypt files containing private keys and
+identity parameters.
+This is required only if these files have been
+encrypted.
+<br><dt><code>randfile</code> <kbd>file</kbd><dd>Specifies the location of the random seed file used by the OpenSSL
+library.
+The defaults are described in the main text above.
+<br><dt><code>sign</code> <kbd>file</kbd><dd>Specifies the location of the optional sign key file.
+This overrides
+the link
+<span class="file">ntpkey_sign_</span><kbd>hostname</kbd>
+in the keys directory.
+If this file is
+not found, the host key is also the sign key.
+</dl>
+ <br><dt><code>keys</code> <kbd>keyfile</kbd><dd>Specifies the complete path and location of the MD5 key file
+containing the keys and key identifiers used by
+<code>ntpd(1ntpdmdoc)</code>,
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+when operating with symmetric key cryptography.
+This is the same operation as the
+<code>-k</code>
+command line option.
+<br><dt><code>keysdir</code> <kbd>path</kbd><dd>This command specifies the default directory path for
+cryptographic keys, parameters and certificates.
+The default is
+<span class="file">/usr/local/etc/</span>.
+<br><dt><code>requestkey</code> <kbd>key</kbd><dd>Specifies the key identifier to use with the
+<code>ntpdc(1ntpdcmdoc)</code>
+utility program, which uses a
+proprietary protocol specific to this implementation of
+<code>ntpd(1ntpdmdoc)</code>.
+The
+<kbd>key</kbd>
+argument is a key identifier
+for the trusted key, where the value can be in the range 1 to
+65,534, inclusive.
+<br><dt><code>revoke</code> <kbd>logsec</kbd><dd>Specifies the interval between re-randomization of certain
+cryptographic values used by the Autokey scheme, as a power of 2 in
+seconds.
+These values need to be updated frequently in order to
+deflect brute-force attacks on the algorithms of the scheme;
+however, updating some values is a relatively expensive operation.
+The default interval is 16 (65,536 s or about 18 hours).
+For poll
+intervals above the specified interval, the values will be updated
+for every message sent.
+<br><dt><code>trustedkey</code> <kbd>key</kbd> <kbd>...</kbd><dd>Specifies the key identifiers which are trusted for the
+purposes of authenticating peers with symmetric key cryptography,
+as well as keys used by the
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+programs.
+The authentication procedures require that both the local
+and remote servers share the same key and key identifier for this
+purpose, although different keys can be used with different
+servers.
+The
+<kbd>key</kbd>
+arguments are 32-bit unsigned
+integers with values from 1 to 65,534.
+</dl>
+
+<h5 class="subsubsection">Error Codes</h5>
+
+<p>The following error codes are reported via the NTP control
+and monitoring protocol trap mechanism.
+ <dl>
+<dt>101<dd>(bad field format or length)
+The packet has invalid version, length or format.
+<br><dt>102<dd>(bad timestamp)
+The packet timestamp is the same or older than the most recent received.
+This could be due to a replay or a server clock time step.
+<br><dt>103<dd>(bad filestamp)
+The packet filestamp is the same or older than the most recent received.
+This could be due to a replay or a key file generation error.
+<br><dt>104<dd>(bad or missing public key)
+The public key is missing, has incorrect format or is an unsupported type.
+<br><dt>105<dd>(unsupported digest type)
+The server requires an unsupported digest/signature scheme.
+<br><dt>106<dd>(mismatched digest types)
+Not used.
+<br><dt>107<dd>(bad signature length)
+The signature length does not match the current public key.
+<br><dt>108<dd>(signature not verified)
+The message fails the signature check.
+It could be bogus or signed by a
+different private key.
+<br><dt>109<dd>(certificate not verified)
+The certificate is invalid or signed with the wrong key.
+<br><dt>110<dd>(certificate not verified)
+The certificate is not yet valid or has expired or the signature could not
+be verified.
+<br><dt>111<dd>(bad or missing cookie)
+The cookie is missing, corrupted or bogus.
+<br><dt>112<dd>(bad or missing leapseconds table)
+The leapseconds table is missing, corrupted or bogus.
+<br><dt>113<dd>(bad or missing certificate)
+The certificate is missing, corrupted or bogus.
+<br><dt>114<dd>(bad or missing identity)
+The identity key is missing, corrupt or bogus.
+</dl>
+ <div class="node">
+<p><hr>
+<a name="Monitoring-Support"></a>
+<br>
+</div>
+
+<h4 class="subsection">Monitoring Support</h4>
+
+<p><code>ntpd(1ntpdmdoc)</code>
+includes a comprehensive monitoring facility suitable
+for continuous, long term recording of server and client
+timekeeping performance.
+See the
+<code>statistics</code>
+command below
+for a listing and example of each type of statistics currently
+supported.
+Statistic files are managed using file generation sets
+and scripts in the
+<span class="file">./scripts</span>
+directory of this distribution.
+Using
+these facilities and
+<span class="sc">unix</span>
+<code>cron(8)</code>
+jobs, the data can be
+automatically summarized and archived for retrospective analysis.
+
+<h5 class="subsubsection">Monitoring Commands</h5>
+
+ <dl>
+<dt><code>statistics</code> <kbd>name</kbd> <kbd>...</kbd><dd>Enables writing of statistics records.
+Currently, eight kinds of
+<kbd>name</kbd>
+statistics are supported.
+ <dl>
+<dt><code>clockstats</code><dd>Enables recording of clock driver statistics information.
+Each update
+received from a clock driver appends a line of the following form to
+the file generation set named
+<code>clockstats</code>:
+<pre class="verbatim">
+ 49213 525.624 127.127.4.1 93 226 00:08:29.606 D
+ </pre>
+
+ <p>The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the
+clock address in dotted-quad notation.
+The final field shows the last
+timecode received from the clock in decoded ASCII format, where
+meaningful.
+In some clock drivers a good deal of additional information
+can be gathered and displayed as well.
+See information specific to each
+clock for further details.
+<br><dt><code>cryptostats</code><dd>This option requires the OpenSSL cryptographic software library.
+It
+enables recording of cryptographic public key protocol information.
+Each message received by the protocol module appends a line of the
+following form to the file generation set named
+<code>cryptostats</code>:
+<pre class="verbatim">
+ 49213 525.624 127.127.4.1 message
+ </pre>
+
+ <p>The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the peer
+address in dotted-quad notation, The final message field includes the
+message type and certain ancillary information.
+See the
+<a href="#Authentication-Options">Authentication Options</a>
+section for further information.
+<br><dt><code>loopstats</code><dd>Enables recording of loop filter statistics information.
+Each
+update of the local clock outputs a line of the following form to
+the file generation set named
+<code>loopstats</code>:
+<pre class="verbatim">
+ 50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
+ </pre>
+
+ <p>The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next five fields
+show time offset (seconds), frequency offset (parts per million -
+PPM), RMS jitter (seconds), Allan deviation (PPM) and clock
+discipline time constant.
+<br><dt><code>peerstats</code><dd>Enables recording of peer statistics information.
+This includes
+statistics records of all peers of a NTP server and of special
+signals, where present and configured.
+Each valid update appends a
+line of the following form to the current element of a file
+generation set named
+<code>peerstats</code>:
+<pre class="verbatim">
+ 48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877 0.000958674
+ </pre>
+
+ <p>The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the peer address in dotted-quad notation and status,
+respectively.
+The status field is encoded in hex in the format
+described in Appendix A of the NTP specification RFC 1305.
+The final four fields show the offset,
+delay, dispersion and RMS jitter, all in seconds.
+<br><dt><code>rawstats</code><dd>Enables recording of raw-timestamp statistics information.
+This
+includes statistics records of all peers of a NTP server and of
+special signals, where present and configured.
+Each NTP message
+received from a peer or clock driver appends a line of the
+following form to the file generation set named
+<code>rawstats</code>:
+<pre class="verbatim">
+ 50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
+ </pre>
+
+ <p>The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the remote peer or clock address followed by the local address
+in dotted-quad notation.
+The final four fields show the originate,
+receive, transmit and final NTP timestamps in order.
+The timestamp
+values are as received and before processing by the various data
+smoothing and mitigation algorithms.
+<br><dt><code>sysstats</code><dd>Enables recording of ntpd statistics counters on a periodic basis.
+Each
+hour a line of the following form is appended to the file generation
+set named
+<code>sysstats</code>:
+<pre class="verbatim">
+ 50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
+ </pre>
+
+ <p>The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The remaining ten fields show
+the statistics counter values accumulated since the last generated
+line.
+ <dl>
+<dt>Time since restart <code>36000</code><dd>Time in hours since the system was last rebooted.
+<br><dt>Packets received <code>81965</code><dd>Total number of packets received.
+<br><dt>Packets processed <code>0</code><dd>Number of packets received in response to previous packets sent
+<br><dt>Current version <code>9546</code><dd>Number of packets matching the current NTP version.
+<br><dt>Previous version <code>56</code><dd>Number of packets matching the previous NTP version.
+<br><dt>Bad version <code>71793</code><dd>Number of packets matching neither NTP version.
+<br><dt>Access denied <code>512</code><dd>Number of packets denied access for any reason.
+<br><dt>Bad length or format <code>540</code><dd>Number of packets with invalid length, format or port number.
+<br><dt>Bad authentication <code>10</code><dd>Number of packets not verified as authentic.
+<br><dt>Rate exceeded <code>147</code><dd>Number of packets discarded due to rate limitation.
+</dl>
+ <br><dt><code>statsdir</code> <kbd>directory_path</kbd><dd>Indicates the full path of a directory where statistics files
+should be created (see below).
+This keyword allows
+the (otherwise constant)
+<code>filegen</code>
+filename prefix to be modified for file generation sets, which
+is useful for handling statistics logs.
+<br><dt><code>filegen</code> <kbd>name</kbd> <code>[file </code><kbd>filename</kbd><code>]</code> <code>[type </code><kbd>typename</kbd><code>]</code> <code>[link | nolink]</code> <code>[enable | disable]</code><dd>Configures setting of generation file set name.
+Generation
+file sets provide a means for handling files that are
+continuously growing during the lifetime of a server.
+Server statistics are a typical example for such files.
+Generation file sets provide access to a set of files used
+to store the actual data.
+At any time at most one element
+of the set is being written to.
+The type given specifies
+when and how data will be directed to a new element of the set.
+This way, information stored in elements of a file set
+that are currently unused are available for administrational
+operations without the risk of disturbing the operation of ntpd.
+(Most important: they can be removed to free space for new data
+produced.)
+
+ <p>Note that this command can be sent from the
+<code>ntpdc(1ntpdcmdoc)</code>
+program running at a remote location.
+ <dl>
+<dt><code>name</code><dd>This is the type of the statistics records, as shown in the
+<code>statistics</code>
+command.
+<br><dt><code>file</code> <kbd>filename</kbd><dd>This is the file name for the statistics records.
+Filenames of set
+members are built from three concatenated elements
+<code>prefix</code>,
+<code>filename</code>
+and
+<code>suffix</code>:
+ <dl>
+<dt><code>prefix</code><dd>This is a constant filename path.
+It is not subject to
+modifications via the
+<kbd>filegen</kbd>
+option.
+It is defined by the
+server, usually specified as a compile-time constant.
+It may,
+however, be configurable for individual file generation sets
+via other commands.
+For example, the prefix used with
+<kbd>loopstats</kbd>
+and
+<kbd>peerstats</kbd>
+generation can be configured using the
+<kbd>statsdir</kbd>
+option explained above.
+<br><dt><code>filename</code><dd>This string is directly concatenated to the prefix mentioned
+above (no intervening
+/).
+This can be modified using
+the file argument to the
+<kbd>filegen</kbd>
+statement.
+No
+<span class="file">..</span>
+elements are
+allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by
+<kbd>prefix</kbd>.
+<br><dt><code>suffix</code><dd>This part is reflects individual elements of a file set.
+It is
+generated according to the type of a file set.
+</dl>
+ <br><dt><code>type</code> <kbd>typename</kbd><dd>A file generation set is characterized by its type.
+The following
+types are supported:
+ <dl>
+<dt><code>none</code><dd>The file set is actually a single plain file.
+<br><dt><code>pid</code><dd>One element of file set is used per incarnation of a ntpd
+server.
+This type does not perform any changes to file set
+members during runtime, however it provides an easy way of
+separating files belonging to different
+<code>ntpd(1ntpdmdoc)</code>
+server incarnations.
+The set member filename is built by appending a
+.
+to concatenated
+<kbd>prefix</kbd>
+and
+<kbd>filename</kbd>
+strings, and
+appending the decimal representation of the process ID of the
+<code>ntpd(1ntpdmdoc)</code>
+server process.
+<br><dt><code>day</code><dd>One file generation set element is created per day.
+A day is
+defined as the period between 00:00 and 24:00 UTC.
+The file set
+member suffix consists of a
+.
+and a day specification in
+the form
+<code>YYYYMMdd</code>.
+<code>YYYY</code>
+is a 4-digit year number (e.g., 1992).
+<code>MM</code>
+is a two digit month number.
+<code>dd</code>
+is a two digit day number.
+Thus, all information written at 10 December 1992 would end up
+in a file named
+<kbd>prefix</kbd>
+<kbd>filename</kbd>.19921210.
+<br><dt><code>week</code><dd>Any file set member contains data related to a certain week of
+a year.
+The term week is defined by computing day-of-year
+modulo 7.
+Elements of such a file generation set are
+distinguished by appending the following suffix to the file set
+filename base: A dot, a 4-digit year number, the letter
+<code>W</code>,
+and a 2-digit week number.
+For example, information from January,
+10th 1992 would end up in a file with suffix
+.No . Ns Ar 1992W1 .
+<br><dt><code>month</code><dd>One generation file set element is generated per month.
+The
+file name suffix consists of a dot, a 4-digit year number, and
+a 2-digit month.
+<br><dt><code>year</code><dd>One generation file element is generated per year.
+The filename
+suffix consists of a dot and a 4 digit year number.
+<br><dt><code>age</code><dd>This type of file generation sets changes to a new element of
+the file set every 24 hours of server operation.
+The filename
+suffix consists of a dot, the letter
+<code>a</code>,
+and an 8-digit number.
+This number is taken to be the number of seconds the server is
+running at the start of the corresponding 24-hour period.
+Information is only written to a file generation by specifying
+<code>enable</code>;
+output is prevented by specifying
+<code>disable</code>.
+</dl>
+ <br><dt><code>link</code> | <code>nolink</code><dd>It is convenient to be able to access the current element of a file
+generation set by a fixed name.
+This feature is enabled by
+specifying
+<code>link</code>
+and disabled using
+<code>nolink</code>.
+If link is specified, a
+hard link from the current file set element to a file without
+suffix is created.
+When there is already a file with this name and
+the number of links of this file is one, it is renamed appending a
+dot, the letter
+<code>C</code>,
+and the pid of the ntpd server process.
+When the
+number of links is greater than one, the file is unlinked.
+This
+allows the current file to be accessed by a constant name.
+<br><dt><code>enable</code> <code>|</code> <code>disable</code><dd>Enables or disables the recording function.
+</dl>
+ </dl>
+ </dl>
+<div class="node">
+<p><hr>
+<a name="Access-Control-Support"></a>
+<br>
+</div>
+
+<h4 class="subsection">Access Control Support</h4>
+
+<p>The
+<code>ntpd(1ntpdmdoc)</code>
+daemon implements a general purpose address/mask based restriction
+list.
+The list contains address/match entries sorted first
+by increasing address values and and then by increasing mask values.
+A match occurs when the bitwise AND of the mask and the packet
+source address is equal to the bitwise AND of the mask and
+address in the list.
+The list is searched in order with the
+last match found defining the restriction flags associated
+with the entry.
+Additional information and examples can be found in the
+"Notes on Configuring NTP and Setting up a NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+
+ <p>The restriction facility was implemented in conformance
+with the access policies for the original NSFnet backbone
+time servers.
+Later the facility was expanded to deflect
+cryptographic and clogging attacks.
+While this facility may
+be useful for keeping unwanted or broken or malicious clients
+from congesting innocent servers, it should not be considered
+an alternative to the NTP authentication facilities.
+Source address based restrictions are easily circumvented
+by a determined cracker.
+
+ <p>Clients can be denied service because they are explicitly
+included in the restrict list created by the restrict command
+or implicitly as the result of cryptographic or rate limit
+violations.
+Cryptographic violations include certificate
+or identity verification failure; rate limit violations generally
+result from defective NTP implementations that send packets
+at abusive rates.
+Some violations cause denied service
+only for the offending packet, others cause denied service
+for a timed period and others cause the denied service for
+an indefinate period.
+When a client or network is denied access
+for an indefinate period, the only way at present to remove
+the restrictions is by restarting the server.
+
+<h5 class="subsubsection">The Kiss-of-Death Packet</h5>
+
+<p>Ordinarily, packets denied service are simply dropped with no
+further action except incrementing statistics counters.
+Sometimes a
+more proactive response is needed, such as a server message that
+explicitly requests the client to stop sending and leave a message
+for the system operator.
+A special packet format has been created
+for this purpose called the "kiss-of-death" (KoD) packet.
+KoD packets have the leap bits set unsynchronized and stratum set
+to zero and the reference identifier field set to a four-byte
+ASCII code.
+If the
+<code>noserve</code>
+or
+<code>notrust</code>
+flag of the matching restrict list entry is set,
+the code is "DENY"; if the
+<code>limited</code>
+flag is set and the rate limit
+is exceeded, the code is "RATE".
+Finally, if a cryptographic violation occurs, the code is "CRYP".
+
+ <p>A client receiving a KoD performs a set of sanity checks to
+minimize security exposure, then updates the stratum and
+reference identifier peer variables, sets the access
+denied (TEST4) bit in the peer flash variable and sends
+a message to the log.
+As long as the TEST4 bit is set,
+the client will send no further packets to the server.
+The only way at present to recover from this condition is
+to restart the protocol at both the client and server.
+This
+happens automatically at the client when the association times out.
+It will happen at the server only if the server operator cooperates.
+
+<h5 class="subsubsection">Access Control Commands</h5>
+
+ <dl>
+<dt><code>discard</code> <code>[average </code><kbd>avg</kbd><code>]</code> <code>[minimum </code><kbd>min</kbd><code>]</code> <code>[monitor </code><kbd>prob</kbd><code>]</code><dd>Set the parameters of the
+<code>limited</code>
+facility which protects the server from
+client abuse.
+The
+<code>average</code>
+subcommand specifies the minimum average packet
+spacing, while the
+<code>minimum</code>
+subcommand specifies the minimum packet spacing.
+Packets that violate these minima are discarded
+and a kiss-o'-death packet returned if enabled.
+The default
+minimum average and minimum are 5 and 2, respectively.
+The monitor subcommand specifies the probability of discard
+for packets that overflow the rate-control window.
+<br><dt><code>restrict</code> <code>address</code> <code>[mask </code><kbd>mask</kbd><code>]</code> <code>[</code><kbd>flag</kbd> <kbd>...</kbd><code>]</code><dd>The
+<kbd>address</kbd>
+argument expressed in
+dotted-quad form is the address of a host or network.
+Alternatively, the
+<kbd>address</kbd>
+argument can be a valid host DNS name.
+The
+<kbd>mask</kbd>
+argument expressed in dotted-quad form defaults to
+<code>255.255.255.255</code>,
+meaning that the
+<kbd>address</kbd>
+is treated as the address of an individual host.
+A default entry (address
+<code>0.0.0.0</code>,
+mask
+<code>0.0.0.0</code>)
+is always included and is always the first entry in the list.
+Note that text string
+<code>default</code>,
+with no mask option, may
+be used to indicate the default entry.
+In the current implementation,
+<code>flag</code>
+always
+restricts access, i.e., an entry with no flags indicates that free
+access to the server is to be given.
+The flags are not orthogonal,
+in that more restrictive flags will often make less restrictive
+ones redundant.
+The flags can generally be classed into two
+categories, those which restrict time service and those which
+restrict informational queries and attempts to do run-time
+reconfiguration of the server.
+One or more of the following flags
+may be specified:
+ <dl>
+<dt><code>ignore</code><dd>Deny packets of all kinds, including
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+queries.
+<br><dt><code>kod</code><dd>If this flag is set when an access violation occurs, a kiss-o'-death
+(KoD) packet is sent.
+KoD packets are rate limited to no more than one
+per second.
+If another KoD packet occurs within one second after the
+last one, the packet is dropped.
+<br><dt><code>limited</code><dd>Deny service if the packet spacing violates the lower limits specified
+in the discard command.
+A history of clients is kept using the
+monitoring capability of
+<code>ntpd(1ntpdmdoc)</code>.
+Thus, monitoring is always active as
+long as there is a restriction entry with the
+<code>limited</code>
+flag.
+<br><dt><code>lowpriotrap</code><dd>Declare traps set by matching hosts to be low priority.
+The
+number of traps a server can maintain is limited (the current limit
+is 3).
+Traps are usually assigned on a first come, first served
+basis, with later trap requestors being denied service.
+This flag
+modifies the assignment algorithm by allowing low priority traps to
+be overridden by later requests for normal priority traps.
+<br><dt><code>nomodify</code><dd>Deny
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+queries which attempt to modify the state of the
+server (i.e., run time reconfiguration).
+Queries which return
+information are permitted.
+<br><dt><code>noquery</code><dd>Deny
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+queries.
+Time service is not affected.
+<br><dt><code>nopeer</code><dd>Deny packets which would result in mobilizing a new association.
+This
+includes broadcast and symmetric active packets when a configured
+association does not exist.
+It also includes
+<code>pool</code>
+associations, so if you want to use servers from a
+<code>pool</code>
+directive and also want to use
+<code>nopeer</code>
+by default, you'll want a
+<code>restrict source ...</code> <code>line</code> <code>as</code> <code>well</code> <code>that</code> <code>does</code>
+<br><dt>not<dd>include the
+<code>nopeer</code>
+directive.
+<br><dt><code>noserve</code><dd>Deny all packets except
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+queries.
+<br><dt><code>notrap</code><dd>Decline to provide mode 6 control message trap service to matching
+hosts.
+The trap service is a subsystem of the ntpdq control message
+protocol which is intended for use by remote event logging programs.
+<br><dt><code>notrust</code><dd>Deny service unless the packet is cryptographically authenticated.
+<br><dt><code>ntpport</code><dd>This is actually a match algorithm modifier, rather than a
+restriction flag.
+Its presence causes the restriction entry to be
+matched only if the source port in the packet is the standard NTP
+UDP port (123).
+Both
+<code>ntpport</code>
+and
+<code>non-ntpport</code>
+may
+be specified.
+The
+<code>ntpport</code>
+is considered more specific and
+is sorted later in the list.
+<br><dt><code>version</code><dd>Deny packets that do not match the current NTP version.
+</dl>
+
+ <p>Default restriction list entries with the flags ignore, interface,
+ntpport, for each of the local host's interface addresses are
+inserted into the table at startup to prevent the server
+from attempting to synchronize to its own time.
+A default entry is also always present, though if it is
+otherwise unconfigured; no flags are associated
+with the default entry (i.e., everything besides your own
+NTP server is unrestricted).
+</dl>
+<div class="node">
+<p><hr>
+<a name="Automatic-NTP-Configuration-Options"></a>
+<br>
+</div>
+
+<h4 class="subsection">Automatic NTP Configuration Options</h4>
+
+<h5 class="subsubsection">Manycasting</h5>
+
+<p>Manycasting is a automatic discovery and configuration paradigm
+new to NTPv4.
+It is intended as a means for a multicast client
+to troll the nearby network neighborhood to find cooperating
+manycast servers, validate them using cryptographic means
+and evaluate their time values with respect to other servers
+that might be lurking in the vicinity.
+The intended result is that each manycast client mobilizes
+client associations with some number of the "best"
+of the nearby manycast servers, yet automatically reconfigures
+to sustain this number of servers should one or another fail.
+
+ <p>Note that the manycasting paradigm does not coincide
+with the anycast paradigm described in RFC-1546,
+which is designed to find a single server from a clique
+of servers providing the same service.
+The manycast paradigm is designed to find a plurality
+of redundant servers satisfying defined optimality criteria.
+
+ <p>Manycasting can be used with either symmetric key
+or public key cryptography.
+The public key infrastructure (PKI)
+offers the best protection against compromised keys
+and is generally considered stronger, at least with relatively
+large key sizes.
+It is implemented using the Autokey protocol and
+the OpenSSL cryptographic library available from
+<code>http://www.openssl.org/</code>.
+The library can also be used with other NTPv4 modes
+as well and is highly recommended, especially for broadcast modes.
+
+ <p>A persistent manycast client association is configured
+using the manycastclient command, which is similar to the
+server command but with a multicast (IPv4 class
+<code>D</code>
+or IPv6 prefix
+<code>FF</code>)
+group address.
+The IANA has designated IPv4 address 224.1.1.1
+and IPv6 address FF05::101 (site local) for NTP.
+When more servers are needed, it broadcasts manycast
+client messages to this address at the minimum feasible rate
+and minimum feasible time-to-live (TTL) hops, depending
+on how many servers have already been found.
+There can be as many manycast client associations
+as different group address, each one serving as a template
+for a future ephemeral unicast client/server association.
+
+ <p>Manycast servers configured with the
+<code>manycastserver</code>
+command listen on the specified group address for manycast
+client messages.
+Note the distinction between manycast client,
+which actively broadcasts messages, and manycast server,
+which passively responds to them.
+If a manycast server is
+in scope of the current TTL and is itself synchronized
+to a valid source and operating at a stratum level equal
+to or lower than the manycast client, it replies to the
+manycast client message with an ordinary unicast server message.
+
+ <p>The manycast client receiving this message mobilizes
+an ephemeral client/server association according to the
+matching manycast client template, but only if cryptographically
+authenticated and the server stratum is less than or equal
+to the client stratum.
+Authentication is explicitly required
+and either symmetric key or public key (Autokey) can be used.
+Then, the client polls the server at its unicast address
+in burst mode in order to reliably set the host clock
+and validate the source.
+This normally results
+in a volley of eight client/server at 2-s intervals
+during which both the synchronization and cryptographic
+protocols run concurrently.
+Following the volley,
+the client runs the NTP intersection and clustering
+algorithms, which act to discard all but the "best"
+associations according to stratum and synchronization
+distance.
+The surviving associations then continue
+in ordinary client/server mode.
+
+ <p>The manycast client polling strategy is designed to reduce
+as much as possible the volume of manycast client messages
+and the effects of implosion due to near-simultaneous
+arrival of manycast server messages.
+The strategy is determined by the
+<code>manycastclient</code>,
+<code>tos</code>
+and
+<code>ttl</code>
+configuration commands.
+The manycast poll interval is
+normally eight times the system poll interval,
+which starts out at the
+<code>minpoll</code>
+value specified in the
+<code>manycastclient</code>,
+command and, under normal circumstances, increments to the
+<code>maxpolll</code>
+value specified in this command.
+Initially, the TTL is
+set at the minimum hops specified by the ttl command.
+At each retransmission the TTL is increased until reaching
+the maximum hops specified by this command or a sufficient
+number client associations have been found.
+Further retransmissions use the same TTL.
+
+ <p>The quality and reliability of the suite of associations
+discovered by the manycast client is determined by the NTP
+mitigation algorithms and the
+<code>minclock</code>
+and
+<code>minsane</code>
+values specified in the
+<code>tos</code>
+configuration command.
+At least
+<code>minsane</code>
+candidate servers must be available and the mitigation
+algorithms produce at least
+<code>minclock</code>
+survivors in order to synchronize the clock.
+Byzantine agreement principles require at least four
+candidates in order to correctly discard a single falseticker.
+For legacy purposes,
+<code>minsane</code>
+defaults to 1 and
+<code>minclock</code>
+defaults to 3.
+For manycast service
+<code>minsane</code>
+should be explicitly set to 4, assuming at least that
+number of servers are available.
+
+ <p>If at least
+<code>minclock</code>
+servers are found, the manycast poll interval is immediately
+set to eight times
+<code>maxpoll</code>.
+If less than
+<code>minclock</code>
+servers are found when the TTL has reached the maximum hops,
+the manycast poll interval is doubled.
+For each transmission
+after that, the poll interval is doubled again until
+reaching the maximum of eight times
+<code>maxpoll</code>.
+Further transmissions use the same poll interval and
+TTL values.
+Note that while all this is going on,
+each client/server association found is operating normally
+it the system poll interval.
+
+ <p>Administratively scoped multicast boundaries are normally
+specified by the network router configuration and,
+in the case of IPv6, the link/site scope prefix.
+By default, the increment for TTL hops is 32 starting
+from 31; however, the
+<code>ttl</code>
+configuration command can be
+used to modify the values to match the scope rules.
+
+ <p>It is often useful to narrow the range of acceptable
+servers which can be found by manycast client associations.
+Because manycast servers respond only when the client
+stratum is equal to or greater than the server stratum,
+primary (stratum 1) servers fill find only primary servers
+in TTL range, which is probably the most common objective.
+However, unless configured otherwise, all manycast clients
+in TTL range will eventually find all primary servers
+in TTL range, which is probably not the most common
+objective in large networks.
+The
+<code>tos</code>
+command can be used to modify this behavior.
+Servers with stratum below
+<code>floor</code>
+or above
+<code>ceiling</code>
+specified in the
+<code>tos</code>
+command are strongly discouraged during the selection
+process; however, these servers may be temporally
+accepted if the number of servers within TTL range is
+less than
+<code>minclock</code>.
+
+ <p>The above actions occur for each manycast client message,
+which repeats at the designated poll interval.
+However, once the ephemeral client association is mobilized,
+subsequent manycast server replies are discarded,
+since that would result in a duplicate association.
+If during a poll interval the number of client associations
+falls below
+<code>minclock</code>,
+all manycast client prototype associations are reset
+to the initial poll interval and TTL hops and operation
+resumes from the beginning.
+It is important to avoid
+frequent manycast client messages, since each one requires
+all manycast servers in TTL range to respond.
+The result could well be an implosion, either minor or major,
+depending on the number of servers in range.
+The recommended value for
+<code>maxpoll</code>
+is 12 (4,096 s).
+
+ <p>It is possible and frequently useful to configure a host
+as both manycast client and manycast server.
+A number of hosts configured this way and sharing a common
+group address will automatically organize themselves
+in an optimum configuration based on stratum and
+synchronization distance.
+For example, consider an NTP
+subnet of two primary servers and a hundred or more
+dependent clients.
+With two exceptions, all servers
+and clients have identical configuration files including both
+<code>multicastclient</code>
+and
+<code>multicastserver</code>
+commands using, for instance, multicast group address
+239.1.1.1.
+The only exception is that each primary server
+configuration file must include commands for the primary
+reference source such as a GPS receiver.
+
+ <p>The remaining configuration files for all secondary
+servers and clients have the same contents, except for the
+<code>tos</code>
+command, which is specific for each stratum level.
+For stratum 1 and stratum 2 servers, that command is
+not necessary.
+For stratum 3 and above servers the
+<code>floor</code>
+value is set to the intended stratum number.
+Thus, all stratum 3 configuration files are identical,
+all stratum 4 files are identical and so forth.
+
+ <p>Once operations have stabilized in this scenario,
+the primary servers will find the primary reference source
+and each other, since they both operate at the same
+stratum (1), but not with any secondary server or client,
+since these operate at a higher stratum.
+The secondary
+servers will find the servers at the same stratum level.
+If one of the primary servers loses its GPS receiver,
+it will continue to operate as a client and other clients
+will time out the corresponding association and
+re-associate accordingly.
+
+ <p>Some administrators prefer to avoid running
+<code>ntpd(1ntpdmdoc)</code>
+continuously and run either
+<code>ntpdate(8)</code>
+or
+<code>ntpd(1ntpdmdoc)</code>
+<code>-q</code>
+as a cron job.
+In either case the servers must be
+configured in advance and the program fails if none are
+available when the cron job runs.
+A really slick
+application of manycast is with
+<code>ntpd(1ntpdmdoc)</code>
+<code>-q</code>.
+The program wakes up, scans the local landscape looking
+for the usual suspects, selects the best from among
+the rascals, sets the clock and then departs.
+Servers do not have to be configured in advance and
+all clients throughout the network can have the same
+configuration file.
+
+<h5 class="subsubsection">Manycast Interactions with Autokey</h5>
+
+<p>Each time a manycast client sends a client mode packet
+to a multicast group address, all manycast servers
+in scope generate a reply including the host name
+and status word.
+The manycast clients then run
+the Autokey protocol, which collects and verifies
+all certificates involved.
+Following the burst interval
+all but three survivors are cast off,
+but the certificates remain in the local cache.
+It often happens that several complete signing trails
+from the client to the primary servers are collected in this way.
+
+ <p>About once an hour or less often if the poll interval
+exceeds this, the client regenerates the Autokey key list.
+This is in general transparent in client/server mode.
+However, about once per day the server private value
+used to generate cookies is refreshed along with all
+manycast client associations.
+In this case all
+cryptographic values including certificates is refreshed.
+If a new certificate has been generated since
+the last refresh epoch, it will automatically revoke
+all prior certificates that happen to be in the
+certificate cache.
+At the same time, the manycast
+scheme starts all over from the beginning and
+the expanding ring shrinks to the minimum and increments
+from there while collecting all servers in scope.
+
+<h5 class="subsubsection">Manycast Options</h5>
+
+ <dl>
+<dt><code>tos</code> <code>[ceiling </code><kbd>ceiling</kbd><code> | cohort { 0 | 1 } | floor </code><kbd>floor</kbd><code> | minclock </code><kbd>minclock</kbd><code> | minsane </code><kbd>minsane</kbd><code>]</code><dd>This command affects the clock selection and clustering
+algorithms.
+It can be used to select the quality and
+quantity of peers used to synchronize the system clock
+and is most useful in manycast mode.
+The variables operate
+as follows:
+ <dl>
+<dt><code>ceiling</code> <kbd>ceiling</kbd><dd>Peers with strata above
+<code>ceiling</code>
+will be discarded if there are at least
+<code>minclock</code>
+peers remaining.
+This value defaults to 15, but can be changed
+to any number from 1 to 15.
+<br><dt><code>cohort</code> <code>{0 | 1}</code><dd>This is a binary flag which enables (0) or disables (1)
+manycast server replies to manycast clients with the same
+stratum level.
+This is useful to reduce implosions where
+large numbers of clients with the same stratum level
+are present.
+The default is to enable these replies.
+<br><dt><code>floor</code> <kbd>floor</kbd><dd>Peers with strata below
+<code>floor</code>
+will be discarded if there are at least
+<code>minclock</code>
+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
+associations until no more than
+<code>minclock</code>
+associations remain.
+This value defaults to 3,
+but can be changed to any number from 1 to the number of
+configured sources.
+<br><dt><code>minsane</code> <kbd>minsane</kbd><dd>This is the minimum number of candidates available
+to the clock selection algorithm in order to produce
+one or more truechimers for the clustering algorithm.
+If fewer than this number are available, the clock is
+undisciplined and allowed to run free.
+The default is 1
+for legacy purposes.
+However, according to principles of
+Byzantine agreement,
+<code>minsane</code>
+should be at least 4 in order to detect and discard
+a single falseticker.
+</dl>
+ <br><dt><code>ttl</code> <kbd>hop</kbd> <kbd>...</kbd><dd>This command specifies a list of TTL values in increasing
+order, up to 8 values can be specified.
+In manycast mode these values are used in turn
+in an expanding-ring search.
+The default is eight
+multiples of 32 starting at 31.
+</dl>
+<div class="node">
+<p><hr>
+<a name="Reference-Clock-Support"></a>
+<br>
+</div>
+
+<h4 class="subsection">Reference Clock Support</h4>
+
+<p>The NTP Version 4 daemon supports some three dozen different radio,
+satellite and modem reference clocks plus a special pseudo-clock
+used for backup or when no other clock source is available.
+Detailed descriptions of individual device drivers and options can
+be found in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+Additional information can be found in the pages linked
+there, including the
+"Debugging Hints for Reference Clock Drivers"
+and
+"How To Write a Reference Clock Driver"
+pages
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+In addition, support for a PPS
+signal is available as described in the
+"Pulse-per-second (PPS) Signal Interfacing"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+Many
+drivers support special line discipline/streams modules which can
+significantly improve the accuracy using the driver.
+These are
+described in the
+"Line Disciplines and Streams Drivers"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+
+ <p>A reference clock will generally (though not always) be a radio
+timecode receiver which is synchronized to a source of standard
+time such as the services offered by the NRC in Canada and NIST and
+USNO in the US.
+The interface between the computer and the timecode
+receiver is device dependent, but is usually a serial port.
+A
+device driver specific to each reference clock must be selected and
+compiled in the distribution; however, most common radio, satellite
+and modem clocks are included by default.
+Note that an attempt to
+configure a reference clock when the driver has not been compiled
+or the hardware port has not been appropriately configured results
+in a scalding remark to the system log file, but is otherwise non
+hazardous.
+
+ <p>For the purposes of configuration,
+<code>ntpd(1ntpdmdoc)</code>
+treats
+reference clocks in a manner analogous to normal NTP peers as much
+as possible.
+Reference clocks are identified by a syntactically
+correct but invalid IP address, in order to distinguish them from
+normal NTP peers.
+Reference clock addresses are of the form
+<code>127.127.</code><kbd>t</kbd>.<kbd>u</kbd>,
+where
+<kbd>t</kbd>
+is an integer
+denoting the clock type and
+<kbd>u</kbd>
+indicates the unit
+number in the range 0-3.
+While it may seem overkill, it is in fact
+sometimes useful to configure multiple reference clocks of the same
+type, in which case the unit numbers must be unique.
+
+ <p>The
+<code>server</code>
+command is used to configure a reference
+clock, where the
+<kbd>address</kbd>
+argument in that command
+is the clock address.
+The
+<code>key</code>,
+<code>version</code>
+and
+<code>ttl</code>
+options are not used for reference clock support.
+The
+<code>mode</code>
+option is added for reference clock support, as
+described below.
+The
+<code>prefer</code>
+option can be useful to
+persuade the server to cherish a reference clock with somewhat more
+enthusiasm than other reference clocks or peers.
+Further
+information on this option can be found in the
+"Mitigation Rules and the prefer Keyword"
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>)
+page.
+The
+<code>minpoll</code>
+and
+<code>maxpoll</code>
+options have
+meaning only for selected clock drivers.
+See the individual clock
+driver document pages for additional information.
+
+ <p>The
+<code>fudge</code>
+command is used to provide additional
+information for individual clock drivers and normally follows
+immediately after the
+<code>server</code>
+command.
+The
+<kbd>address</kbd>
+argument specifies the clock address.
+The
+<code>refid</code>
+and
+<code>stratum</code>
+options can be used to
+override the defaults for the device.
+There are two optional
+device-dependent time offsets and four flags that can be included
+in the
+<code>fudge</code>
+command as well.
+
+ <p>The stratum number of a reference clock is by default zero.
+Since the
+<code>ntpd(1ntpdmdoc)</code>
+daemon adds one to the stratum of each
+peer, a primary server ordinarily displays an external stratum of
+one.
+In order to provide engineered backups, it is often useful to
+specify the reference clock stratum as greater than zero.
+The
+<code>stratum</code>
+option is used for this purpose.
+Also, in cases
+involving both a reference clock and a pulse-per-second (PPS)
+discipline signal, it is useful to specify the reference clock
+identifier as other than the default, depending on the driver.
+The
+<code>refid</code>
+option is used for this purpose.
+Except where noted,
+these options apply to all clock drivers.
+
+<h5 class="subsubsection">Reference Clock Commands</h5>
+
+ <dl>
+<dt><code>server</code> <code>127.127.</code><kbd>t</kbd>.<kbd>u</kbd> <code>[prefer]</code> <code>[mode </code><kbd>int</kbd><code>]</code> <code>[minpoll </code><kbd>int</kbd><code>]</code> <code>[maxpoll </code><kbd>int</kbd><code>]</code><dd>This command can be used to configure reference clocks in
+special ways.
+The options are interpreted as follows:
+ <dl>
+<dt><code>prefer</code><dd>Marks the reference clock as preferred.
+All other things being
+equal, this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>)
+for further information.
+<br><dt><code>mode</code> <kbd>int</kbd><dd>Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+<br><dt><code>minpoll</code> <kbd>int</kbd><br><dt><code>maxpoll</code> <kbd>int</kbd><dd>These options specify the minimum and maximum polling interval
+for reference clock messages, as a power of 2 in seconds
+For
+most directly connected reference clocks, both
+<code>minpoll</code>
+and
+<code>maxpoll</code>
+default to 6 (64 s).
+For modem reference clocks,
+<code>minpoll</code>
+defaults to 10 (17.1 m) and
+<code>maxpoll</code>
+defaults to 14 (4.5 h).
+The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
+</dl>
+ <br><dt><code>fudge</code> <code>127.127.</code><kbd>t</kbd>.<kbd>u</kbd> <code>[time1 </code><kbd>sec</kbd><code>]</code> <code>[time2 </code><kbd>sec</kbd><code>]</code> <code>[stratum </code><kbd>int</kbd><code>]</code> <code>[refid </code><kbd>string</kbd><code>]</code> <code>[mode </code><kbd>int</kbd><code>]</code> <code>[flag1 0 | 1]</code> <code>[flag2 0 | 1]</code> <code>[flag3 0 | 1]</code> <code>[flag4 0 | 1]</code><dd>This command can be used to configure reference clocks in
+special ways.
+It must immediately follow the
+<code>server</code>
+command which configures the driver.
+Note that the same capability
+is possible at run time using the
+<code>ntpdc(1ntpdcmdoc)</code>
+program.
+The options are interpreted as
+follows:
+ <dl>
+<dt><code>time1</code> <kbd>sec</kbd><dd>Specifies a constant to be added to the time offset produced by
+the driver, a fixed-point decimal number in seconds.
+This is used
+as a calibration constant to adjust the nominal time offset of a
+particular clock to agree with an external standard, such as a
+precision PPS signal.
+It also provides a way to correct a
+systematic error or bias due to serial port or operating system
+latencies, different cable lengths or receiver internal delay.
+The
+specified offset is in addition to the propagation delay provided
+by other means, such as internal DIPswitches.
+Where a calibration
+for an individual system and driver is available, an approximate
+correction is noted in the driver documentation pages.
+Note: in order to facilitate calibration when more than one
+radio clock or PPS signal is supported, a special calibration
+feature is available.
+It takes the form of an argument to the
+<code>enable</code>
+command described in
+<a href="#Miscellaneous-Options">Miscellaneous Options</a>
+page and operates as described in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+<br><dt><code>time2</code> <kbd>secs</kbd><dd>Specifies a fixed-point decimal number in seconds, which is
+interpreted in a driver-dependent way.
+See the descriptions of
+specific drivers in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+<span class="file">/usr/share/doc/ntp</span>).
+<br><dt><code>stratum</code> <kbd>int</kbd><dd>Specifies the stratum number assigned to the driver, an integer
+between 0 and 15.
+This number overrides the default stratum number
+ordinarily assigned by the driver itself, usually zero.
+<br><dt><code>refid</code> <kbd>string</kbd><dd>Specifies an ASCII string of from one to four characters which
+defines the reference identifier used by the driver.
+This string
+overrides the default identifier ordinarily assigned by the driver
+itself.
+<br><dt><code>mode</code> <kbd>int</kbd><dd>Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+<br><dt><code>flag1</code> <code>0</code> <code>|</code> <code>1</code><br><dt><code>flag2</code> <code>0</code> <code>|</code> <code>1</code><br><dt><code>flag3</code> <code>0</code> <code>|</code> <code>1</code><br><dt><code>flag4</code> <code>0</code> <code>|</code> <code>1</code><dd>These four flags are used for customizing the clock driver.
+The
+interpretation of these values, and whether they are used at all,
+is a function of the particular clock driver.
+However, by
+convention
+<code>flag4</code>
+is used to enable recording monitoring
+data to the
+<code>clockstats</code>
+file configured with the
+<code>filegen</code>
+command.
+Further information on the
+<code>filegen</code>
+command can be found in
+<a href="#Monitoring-Options">Monitoring Options</a>.
+</dl>
+ </dl>
+<div class="node">
+<p><hr>
+<a name="Miscellaneous-Options"></a>
+<br>
+</div>
+
+<h4 class="subsection">Miscellaneous Options</h4>
+
+ <dl>
+<dt><code>broadcastdelay</code> <kbd>seconds</kbd><dd>The broadcast and multicast modes require a special calibration
+to determine the network delay between the local and remote
+servers.
+Ordinarily, this is done automatically by the initial
+protocol exchanges between the client and server.
+In some cases,
+the calibration procedure may fail due to network or server access
+controls, for example.
+This command specifies the default delay to
+be used under these circumstances.
+Typically (for Ethernet), a
+number between 0.003 and 0.007 seconds is appropriate.
+The default
+when this command is not used is 0.004 seconds.
+<br><dt><code>calldelay</code> <kbd>delay</kbd><dd>This option controls the delay in seconds between the first and second
+packets sent in burst or iburst mode to allow additional time for a modem
+or ISDN call to complete.
+<br><dt><code>driftfile</code> <kbd>driftfile</kbd><dd>This command specifies the complete path and name of the file used to
+record the frequency of the local clock oscillator.
+This is the same
+operation as the
+<code>-f</code>
+command line option.
+If the file exists, it is read at
+startup in order to set the initial frequency and then updated once per
+hour with the current frequency computed by the daemon.
+If the file name is
+specified, but the file itself does not exist, the starts with an initial
+frequency of zero and creates the file when writing it for the first time.
+If this command is not given, the daemon will always start with an initial
+frequency of zero.
+
+ <p>The file format consists of a single line containing a single
+floating point number, which records the frequency offset measured
+in parts-per-million (PPM).
+The file is updated by first writing
+the current drift value into a temporary file and then renaming
+this file to replace the old version.
+This implies that
+<code>ntpd(1ntpdmdoc)</code>
+must have write permission for the directory the
+drift file is located in, and that file system links, symbolic or
+otherwise, should be avoided.
+<br><dt><code>enable</code> <code>[auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</code><br><dt><code>disable</code> <code>[auth | bclient | calibrate | kernel | mode7 | monitor | ntp | stats]</code><dd>Provides a way to enable or disable various server options.
+Flags not mentioned are unaffected.
+Note that all of these flags
+can be controlled remotely using the
+<code>ntpdc(1ntpdcmdoc)</code>
+utility program.
+ <dl>
+<dt><code>auth</code><dd>Enables the server to synchronize with unconfigured peers only if the
+peer has been correctly authenticated using either public key or
+private key cryptography.
+The default for this flag is
+<code>enable</code>.
+<br><dt><code>bclient</code><dd>Enables the server to listen for a message from a broadcast or
+multicast server, as in the
+<code>multicastclient</code>
+command with default
+address.
+The default for this flag is
+<code>disable</code>.
+<br><dt><code>calibrate</code><dd>Enables the calibrate feature for reference clocks.
+The default for
+this flag is
+<code>disable</code>.
+<br><dt><code>kernel</code><dd>Enables the kernel time discipline, if available.
+The default for this
+flag is
+<code>enable</code>
+if support is available, otherwise
+<code>disable</code>.
+<br><dt><code>mode7</code><dd>Enables processing of NTP mode 7 implementation-specific requests
+which are used by the deprecated
+<code>ntpdc(1ntpdcmdoc)</code>
+program.
+The default for this flag is disable.
+This flag is excluded from runtime configuration using
+<code>ntpq(1ntpqmdoc)</code>.
+The
+<code>ntpq(1ntpqmdoc)</code>
+program provides the same capabilities as
+<code>ntpdc(1ntpdcmdoc)</code>
+using standard mode 6 requests.
+<br><dt><code>monitor</code><dd>Enables the monitoring facility.
+See the
+<code>ntpdc(1ntpdcmdoc)</code>
+program
+and the
+<code>monlist</code>
+command or further information.
+The
+default for this flag is
+<code>enable</code>.
+<br><dt><code>ntp</code><dd>Enables time and frequency discipline.
+In effect, this switch opens and
+closes the feedback loop, which is useful for testing.
+The default for
+this flag is
+<code>enable</code>.
+<br><dt><code>stats</code><dd>Enables the statistics facility.
+See the
+<a href="#Monitoring-Options">Monitoring Options</a>
+section for further information.
+The default for this flag is
+<code>disable</code>.
+</dl>
+ <br><dt><code>includefile</code> <kbd>includefile</kbd><dd>This command allows additional configuration commands
+to be included from a separate file.
+Include files may
+be nested to a depth of five; upon reaching the end of any
+include file, command processing resumes in the previous
+configuration file.
+This option is useful for sites that run
+<code>ntpd(1ntpdmdoc)</code>
+on multiple hosts, with (mostly) common options (e.g., a
+restriction list).
+<br><dt><code>logconfig</code> <kbd>configkeyword</kbd><dd>This command controls the amount and type of output written to
+the system
+<code>syslog(3)</code>
+facility or the alternate
+<code>logfile</code>
+log file.
+By default, all output is turned on.
+All
+<kbd>configkeyword</kbd>
+keywords can be prefixed with
+=,
++
+and
+-,
+where
+=
+sets the
+<code>syslog(3)</code>
+priority mask,
++
+adds and
+-
+removes
+messages.
+<code>syslog(3)</code>
+messages can be controlled in four
+classes
+(<code>clock</code>, <code>peer</code>, <code>sys</code> and <code>sync</code>).
+Within these classes four types of messages can be
+controlled: informational messages
+(<code>info</code>),
+event messages
+(<code>events</code>),
+statistics messages
+(<code>statistics</code>)
+and
+status messages
+(<code>status</code>).
+
+ <p>Configuration keywords are formed by concatenating the message class with
+the event class.
+The
+<code>all</code>
+prefix can be used instead of a message class.
+A
+message class may also be followed by the
+<code>all</code>
+keyword to enable/disable all
+messages of the respective message class.Thus, a minimal log configuration
+could look like this:
+<pre class="verbatim">
+ logconfig =syncstatus +sysevents
+</pre>
+
+ <p>This would just list the synchronizations state of
+<code>ntpd(1ntpdmdoc)</code>
+and the major system events.
+For a simple reference server, the
+following minimum message configuration could be useful:
+<pre class="verbatim">
+ logconfig =syncall +clockall
+</pre>
+
+ <p>This configuration will list all clock information and
+synchronization information.
+All other events and messages about
+peers, system events and so on is suppressed.
+<br><dt><code>logfile</code> <kbd>logfile</kbd><dd>This command specifies the location of an alternate log file to
+be used instead of the default system
+<code>syslog(3)</code>
+facility.
+This is the same operation as the -l command line option.
+<br><dt><code>setvar</code> <kbd>variable</kbd> <code>[default]</code><dd>This command adds an additional system variable.
+These
+variables can be used to distribute additional information such as
+the access policy.
+If the variable of the form
+<code>name</code><code>=</code><kbd>value</kbd>
+is followed by the
+<code>default</code>
+keyword, the
+variable will be listed as part of the default system variables
+(<code>rv</code> command)).
+These additional variables serve
+informational purposes only.
+They are not related to the protocol
+other that they can be listed.
+The known protocol variables will
+always override any variables defined via the
+<code>setvar</code>
+mechanism.
+There are three special variables that contain the names
+of all variable of the same group.
+The
+<code>sys_var_list</code>
+holds
+the names of all system variables.
+The
+<code>peer_var_list</code>
+holds
+the names of all peer variables and the
+<code>clock_var_list</code>
+holds the names of the reference clock variables.
+<br><dt><code>tinker</code> <code>[allan </code><kbd>allan</kbd><code> | dispersion </code><kbd>dispersion</kbd><code> | freq </code><kbd>freq</kbd><code> | huffpuff </code><kbd>huffpuff</kbd><code> | panic </code><kbd>panic</kbd><code> | step </code><kbd>srep</kbd><code> | stepout </code><kbd>stepout</kbd><code>]</code><dd>This command can be used to alter several system variables in
+very exceptional circumstances.
+It should occur in the
+configuration file before any other configuration options.
+The
+default values of these variables have been carefully optimized for
+a wide range of network speeds and reliability expectations.
+In
+general, they interact in intricate ways that are hard to predict
+and some combinations can result in some very nasty behavior.
+Very
+rarely is it necessary to change the default values; but, some
+folks cannot resist twisting the knobs anyway and this command is
+for them.
+Emphasis added: twisters are on their own and can expect
+no help from the support group.
+
+ <p>The variables operate as follows:
+ <dl>
+<dt><code>allan</code> <kbd>allan</kbd><dd>The argument becomes the new value for the minimum Allan
+intercept, which is a parameter of the PLL/FLL clock discipline
+algorithm.
+The value in log2 seconds defaults to 7 (1024 s), which is also the lower
+limit.
+<br><dt><code>dispersion</code> <kbd>dispersion</kbd><dd>The argument becomes the new value for the dispersion increase rate,
+normally .000015 s/s.
+<br><dt><code>freq</code> <kbd>freq</kbd><dd>The argument becomes the initial value of the frequency offset in
+parts-per-million.
+This overrides the value in the frequency file, if
+present, and avoids the initial training state if it is not.
+<br><dt><code>huffpuff</code> <kbd>huffpuff</kbd><dd>The argument becomes the new value for the experimental
+huff-n'-puff filter span, which determines the most recent interval
+the algorithm will search for a minimum delay.
+The lower limit is
+900 s (15 m), but a more reasonable value is 7200 (2 hours).
+There
+is no default, since the filter is not enabled unless this command
+is given.
+<br><dt><code>panic</code> <kbd>panic</kbd><dd>The argument is the panic threshold, normally 1000 s.
+If set to zero,
+the panic sanity check is disabled and a clock offset of any value will
+be accepted.
+<br><dt><code>step</code> <kbd>step</kbd><dd>The argument is the step threshold, which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if the step threshold is set to zero or greater than the
+default.
+<br><dt><code>stepout</code> <kbd>stepout</kbd><dd>The argument is the stepout timeout, which by default is 900 s.
+It can
+be set to any positive number in seconds.
+If set to zero, the stepout
+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
+when dropping root (the
+<code>-i</code>
+option).
+The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+<br><dt><code>stacksize</code> <kbd>N4kPages</kbd><dd>Specifies the maximum size of the process stack on systems with the
+<br><dt><code>filenum</code> <kbd>Nfiledescriptors</kbd><dd>Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
+<code>mlockall()</code>
+function.
+Defaults to 50 4k pages (200 4k pages in OpenBSD).
+</dl>
+ <br><dt><code>trap</code> <kbd>host_address</kbd> <code>[port </code><kbd>port_number</kbd><code>]</code> <code>[interface </code><kbd>interface_address</kbd><code>]</code><dd>This command configures a trap receiver at the given host
+address and port number for sending messages with the specified
+local interface address.
+If the port number is unspecified, a value
+of 18447 is used.
+If the interface address is not specified, the
+message is sent with a source address of the local interface the
+message is sent through.
+Note that on a multihomed host the
+interface used may vary from time to time with routing changes.
+
+ <p>The trap receiver will generally log event messages and other
+information from the server in a log file.
+While such monitor
+programs may also request their own trap dynamically, configuring a
+trap receiver will ensure that no messages are lost when the server
+is started.
+<br><dt><code>hop</code> <kbd>...</kbd><dd>This command specifies a list of TTL values in increasing order, up to 8
+values can be specified.
+In manycast mode these values are used in turn in
+an expanding-ring search.
+The default is eight multiples of 32 starting at
+31.
+</dl>
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp.conf</code> program.
+This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002econf-Files">ntp.conf Files</a>: Files
+<li><a accesskey="2" href="#ntp_002econf-See-Also">ntp.conf See Also</a>: See Also
+<li><a accesskey="3" href="#ntp_002econf-Bugs">ntp.conf Bugs</a>: Bugs
+<li><a accesskey="4" href="#ntp_002econf-Notes">ntp.conf Notes</a>: Notes
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002econf-Files"></a>
+<br>
+</div>
+
+<h4 class="subsection">ntp.conf Files</h4>
+
+ <dl>
+<dt><span class="file">/etc/ntp.conf</span><dd>the default name of the configuration file
+<br><dt><span class="file">ntp.keys</span><dd>private MD5 keys
+<br><dt><span class="file">ntpkey</span><dd>RSA private key
+<br><dt><span class="file">ntpkey_</span><kbd>host</kbd><dd>RSA public key
+<br><dt><span class="file">ntp_dh</span><dd>Diffie-Hellman agreement parameters
+</dl>
+<div class="node">
+<p><hr>
+<a name="ntp_002econf-See-Also"></a>
+<br>
+</div>
+
+<h4 class="subsection">ntp.conf See Also</h4>
+
+<p><code>ntpd(1ntpdmdoc)</code>,
+<code>ntpdc(1ntpdcmdoc)</code>,
+<code>ntpq(1ntpqmdoc)</code>
+
+ <p>In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+<code>http://www.ntp.org/</code>.
+A snapshot of this documentation is available in HTML format in
+<span class="file">/usr/share/doc/ntp</span>.
+<br>
+
+ <p><br>
+David L. Mills, <em>Network Time Protocol (Version 4)</em>, RFC5905
+<div class="node">
+<p><hr>
+<a name="ntp_002econf-Bugs"></a>
+<br>
+</div>
+
+<h4 class="subsection">ntp.conf Bugs</h4>
+
+<p>The syntax checking is not picky; some combinations of
+ridiculous and even hilarious options and modes may not be
+detected.
+
+ <p>The
+<span class="file">ntpkey_</span><kbd>host</kbd>
+files are really digital
+certificates.
+These should be obtained via secure directory
+services when they become universally available.
+<div class="node">
+<p><hr>
+<a name="ntp_002econf-Notes"></a>
+<br>
+</div>
+
+<h4 class="subsection">ntp.conf Notes</h4>
+
+<p>This document was derived from FreeBSD.
+
+</body></html>
+
diff --git a/ntpd/ntp.conf.man.in b/ntpd/ntp.conf.man.in
new file mode 100644
index 0000000..3261b6c
--- /dev/null
+++ b/ntpd/ntp.conf.man.in
@@ -0,0 +1,3004 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp.conf 5 "02 Dec 2014" "4.2.7p482" "File Formats"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-7eaizK/ag-wfaayK)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:37 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.conf.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp.conf\fP
+\- Network Time Protocol (NTP) daemon configuration file format
+.SH SYNOPSIS
+\f\*[B-Font]ntp.conf\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The
+\f\*[B-Font]ntp.conf\fP
+configuration file is read at initial startup by the
+\fCntpd\fR(@NTPD_MS@)\f[]
+daemon in order to specify the synchronization sources,
+modes and other related information.
+Usually, it is installed in the
+\fI/etc\f[]
+directory,
+but could be installed elsewhere
+(see the daemon's
+\f\*[B-Font]\-c\f[]
+command line option).
+.sp \n(Ppu
+.ne 2
+
+The file format is similar to other
+UNIX
+configuration files.
+Comments begin with a
+\[oq]#\[cq]
+character and extend to the end of the line;
+blank lines are ignored.
+Configuration commands consist of an initial keyword
+followed by a list of arguments,
+some of which may be optional, separated by whitespace.
+Commands may not be continued over multiple lines.
+Arguments may be host names,
+host addresses written in numeric, dotted-quad form,
+integers, floating point numbers (when specifying times in seconds)
+and text strings.
+.sp \n(Ppu
+.ne 2
+
+The rest of this page describes the configuration and control options.
+The
+"Notes on Configuring NTP and Setting up an NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+contains an extended discussion of these options.
+In addition to the discussion of general
+\fIConfiguration\f[] \fIOptions\f[],
+there are sections describing the following supported functionality
+and the options used to control it:
+.IP \fB\(bu\fP 2
+\fIAuthentication\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIMonitoring\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIAccess\f[] \fIControl\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIAutomatic\f[] \fINTP\f[] \fIConfiguration\f[] \fIOptions\f[]
+.IP \fB\(bu\fP 2
+\fIReference\f[] \fIClock\f[] \fISupport\f[]
+.IP \fB\(bu\fP 2
+\fIMiscellaneous\f[] \fIOptions\f[]
+.PP
+.sp \n(Ppu
+.ne 2
+
+Following these is a section describing
+\fIMiscellaneous\f[] \fIOptions\f[].
+While there is a rich set of options available,
+the only required option is one or more
+\f\*[B-Font]pool\f[],
+\f\*[B-Font]server\f[],
+\f\*[B-Font]peer\f[],
+\f\*[B-Font]broadcast\f[]
+or
+\f\*[B-Font]manycastclient\f[]
+commands.
+.SH Configuration Support
+Following is a description of the configuration commands in
+NTPv4.
+These commands have the same basic functions as in NTPv3 and
+in some cases new functions and new arguments.
+There are two
+classes of commands, configuration commands that configure a
+persistent association with a remote server or peer or reference
+clock, and auxiliary commands that specify environmental variables
+that control various related operations.
+.SS Configuration Commands
+The various modes are determined by the command keyword and the
+type of the required IP address.
+Addresses are classed by type as
+(s) a remote server or peer (IPv4 class A, B and C), (b) the
+broadcast address of a local interface, (m) a multicast address (IPv4
+class D), or (r) a reference clock address (127.127.x.x).
+Note that
+only those options applicable to each command are listed below.
+Use
+of options not listed may not be caught as an error, but may result
+in some weird and even destructive behavior.
+.sp \n(Ppu
+.ne 2
+
+If the Basic Socket Interface Extensions for IPv6 (RFC-2553)
+is detected, support for the IPv6 address family is generated
+in addition to the default support of the IPv4 address family.
+In a few cases, including the reslist billboard generated
+by ntpdc, IPv6 addresses are automatically generated.
+IPv6 addresses can be identified by the presence of colons
+\*[Lq]\&:\*[Rq]
+in the address field.
+IPv6 addresses can be used almost everywhere where
+IPv4 addresses can be used,
+with the exception of reference clock addresses,
+which are always IPv4.
+.sp \n(Ppu
+.ne 2
+
+Note that in contexts where a host name is expected, a
+\f\*[B-Font]\-4\f[]
+qualifier preceding
+the host name forces DNS resolution to the IPv4 namespace,
+while a
+\f\*[B-Font]\-6\f[]
+qualifier forces DNS resolution to the IPv6 namespace.
+See IPv6 references for the
+equivalent classes for that address family.
+.TP 7
+.NOP \f\*[B-Font]pool\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
+.TP 7
+.NOP \f\*[B-Font]server\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]burst\f[]] [\f\*[B-Font]iburst\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
+.TP 7
+.NOP \f\*[B-Font]peer\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]]
+.TP 7
+.NOP \f\*[B-Font]broadcast\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]ttl\f[] \f\*[I-Font]ttl\f[]]
+.TP 7
+.NOP \f\*[B-Font]manycastclient\f[] \f\*[I-Font]address\f[] [\f\*[B-Font]key\f[] \f\*[I-Font]key\f[] \f\*[I-Font]\&|\f[] \f\*[B-Font]autokey\f[]] [\f\*[B-Font]version\f[] \f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]] [\f\*[B-Font]ttl\f[] \f\*[I-Font]ttl\f[]]
+.PP
+.sp \n(Ppu
+.ne 2
+
+These five commands specify the time server name or address to
+be used and the mode in which to operate.
+The
+\f\*[I-Font]address\f[]
+can be
+either a DNS name or an IP address in dotted-quad notation.
+Additional information on association behavior can be found in the
+"Association Management"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.TP 7
+.NOP \f\*[B-Font]pool\f[]
+For type s addresses, this command mobilizes a persistent
+client mode association with a number of remote servers.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+.TP 7
+.NOP \f\*[B-Font]server\f[]
+For type s and r addresses, this command mobilizes a persistent
+client mode association with the specified remote server or local
+radio clock.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+This command should
+\fInot\f[]
+be used for type
+b or m addresses.
+.TP 7
+.NOP \f\*[B-Font]peer\f[]
+For type s addresses (only), this command mobilizes a
+persistent symmetric-active mode association with the specified
+remote peer.
+In this mode the local clock can be synchronized to
+the remote peer or the remote peer can be synchronized to the local
+clock.
+This is useful in a network of servers where, depending on
+various failure scenarios, either the local or remote peer may be
+the better source of time.
+This command should NOT be used for type
+b, m or r addresses.
+.TP 7
+.NOP \f\*[B-Font]broadcast\f[]
+For type b and m addresses (only), this
+command mobilizes a persistent broadcast mode association.
+Multiple
+commands can be used to specify multiple local broadcast interfaces
+(subnets) and/or multiple multicast groups.
+Note that local
+broadcast messages go only to the interface associated with the
+subnet specified, but multicast messages go to all interfaces.
+In broadcast mode the local server sends periodic broadcast
+messages to a client population at the
+\f\*[I-Font]address\f[]
+specified, which is usually the broadcast address on (one of) the
+local network(s) or a multicast address assigned to NTP.
+The IANA
+has assigned the multicast group address IPv4 224.0.1.1 and
+IPv6 ff05::101 (site local) exclusively to
+NTP, but other nonconflicting addresses can be used to contain the
+messages within administrative boundaries.
+Ordinarily, this
+specification applies only to the local server operating as a
+sender; for operation as a broadcast client, see the
+\f\*[B-Font]broadcastclient\f[]
+or
+\f\*[B-Font]multicastclient\f[]
+commands
+below.
+.TP 7
+.NOP \f\*[B-Font]manycastclient\f[]
+For type m addresses (only), this command mobilizes a
+manycast client mode association for the multicast address
+specified.
+In this case a specific address must be supplied which
+matches the address used on the
+\f\*[B-Font]manycastserver\f[]
+command for
+the designated manycast servers.
+The NTP multicast address
+224.0.1.1 assigned by the IANA should NOT be used, unless specific
+means are taken to avoid spraying large areas of the Internet with
+these messages and causing a possibly massive implosion of replies
+at the sender.
+The
+\f\*[B-Font]manycastserver\f[]
+command specifies that the local server
+is to operate in client mode with the remote servers that are
+discovered as the result of broadcast/multicast messages.
+The
+client broadcasts a request message to the group address associated
+with the specified
+\f\*[I-Font]address\f[]
+and specifically enabled
+servers respond to these messages.
+The client selects the servers
+providing the best time and continues as with the
+\f\*[B-Font]server\f[]
+command.
+The remaining servers are discarded as if never
+heard.
+.PP
+.sp \n(Ppu
+.ne 2
+
+Options:
+.TP 7
+.NOP \f\*[B-Font]autokey\f[]
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the autokey scheme
+described in
+\fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]burst\f[]
+when the server is reachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first and second packets
+can be changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to improve timekeeping quality
+with the
+\f\*[B-Font]server\f[]
+command and s addresses.
+.TP 7
+.NOP \f\*[B-Font]iburst\f[]
+When the server is unreachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first two packets can be
+changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to speed the initial synchronization
+acquisition with the
+\f\*[B-Font]server\f[]
+command and s addresses and when
+\fCntpd\fR(@NTPD_MS@)\f[]
+is started with the
+\f\*[B-Font]\-q\f[]
+option.
+.TP 7
+.NOP \f\*[B-Font]key\f[] \f\*[I-Font]key\f[]
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the specified
+\f\*[I-Font]key\f[]
+identifier with values from 1 to 65534, inclusive.
+The
+default is to include no encryption field.
+.TP 7
+.NOP \f\*[B-Font]minpoll\f[] \f\*[I-Font]minpoll\f[]
+.TP 7
+.NOP \f\*[B-Font]maxpoll\f[] \f\*[I-Font]maxpoll\f[]
+These options specify the minimum and maximum poll intervals
+for NTP messages, as a power of 2 in seconds
+The maximum poll
+interval defaults to 10 (1,024 s), but can be increased by the
+\f\*[B-Font]maxpoll\f[]
+option to an upper limit of 17 (36.4 h).
+The
+minimum poll interval defaults to 6 (64 s), but can be decreased by
+the
+\f\*[B-Font]minpoll\f[]
+option to a lower limit of 4 (16 s).
+.TP 7
+.NOP \f\*[B-Font]noselect\f[]
+Marks the server as unused, except for display purposes.
+The server is discarded by the selection algroithm.
+.TP 7
+.NOP \f\*[B-Font]prefer\f[]
+Marks the server as preferred.
+All other things being equal,
+this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+for further information.
+.TP 7
+.NOP \f\*[B-Font]ttl\f[] \f\*[I-Font]ttl\f[]
+This option is used only with broadcast server and manycast
+client modes.
+It specifies the time-to-live
+\f\*[I-Font]ttl\f[]
+to
+use on broadcast server and multicast server and the maximum
+\f\*[I-Font]ttl\f[]
+for the expanding ring search with manycast
+client packets.
+Selection of the proper value, which defaults to
+127, is something of a black art and should be coordinated with the
+network administrator.
+.TP 7
+.NOP \f\*[B-Font]version\f[] \f\*[I-Font]version\f[]
+Specifies the version number to be used for outgoing NTP
+packets.
+Versions 1-4 are the choices, with version 4 the
+default.
+.PP
+.SS Auxiliary Commands
+.TP 7
+.NOP \f\*[B-Font]broadcastclient\f[]
+This command enables reception of broadcast server messages to
+any local interface (type b) address.
+Upon receiving a message for
+the first time, the broadcast client measures the nominal server
+propagation delay using a brief client/server exchange with the
+server, then enters the broadcast client mode, in which it
+synchronizes to succeeding broadcast messages.
+Note that, in order
+to avoid accidental or malicious disruption in this mode, both the
+server and client should operate using symmetric-key or public-key
+authentication as described in
+\fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]manycastserver\f[] \f\*[I-Font]address\f[] \f\*[I-Font]...\f[]
+This command enables reception of manycast client messages to
+the multicast group address(es) (type m) specified.
+At least one
+address is required, but the NTP multicast address 224.0.1.1
+assigned by the IANA should NOT be used, unless specific means are
+taken to limit the span of the reply and avoid a possibly massive
+implosion at the original sender.
+Note that, in order to avoid
+accidental or malicious disruption in this mode, both the server
+and client should operate using symmetric-key or public-key
+authentication as described in
+\fIAuthentication\f[] \fIOptions\f[].
+.TP 7
+.NOP \f\*[B-Font]multicastclient\f[] \f\*[I-Font]address\f[] \f\*[I-Font]...\f[]
+This command enables reception of multicast server messages to
+the multicast group address(es) (type m) specified.
+Upon receiving
+a message for the first time, the multicast client measures the
+nominal server propagation delay using a brief client/server
+exchange with the server, then enters the broadcast client mode, in
+which it synchronizes to succeeding multicast messages.
+Note that,
+in order to avoid accidental or malicious disruption in this mode,
+both the server and client should operate using symmetric-key or
+public-key authentication as described in
+\fIAuthentication\f[] \fIOptions\f[].
+.PP
+.SH Authentication Support
+Authentication support allows the NTP client to verify that the
+server is in fact known and trusted and not an intruder intending
+accidentally or on purpose to masquerade as that server.
+The NTPv3
+specification RFC-1305 defines a scheme which provides
+cryptographic authentication of received NTP packets.
+Originally,
+this was done using the Data Encryption Standard (DES) algorithm
+operating in Cipher Block Chaining (CBC) mode, commonly called
+DES-CBC.
+Subsequently, this was replaced by the RSA Message Digest
+5 (MD5) algorithm using a private key, commonly called keyed-MD5.
+Either algorithm computes a message digest, or one-way hash, which
+can be used to verify the server has the correct private key and
+key identifier.
+.sp \n(Ppu
+.ne 2
+
+NTPv4 retains the NTPv3 scheme, properly described as symmetric key
+cryptography and, in addition, provides a new Autokey scheme
+based on public key cryptography.
+Public key cryptography is generally considered more secure
+than symmetric key cryptography, since the security is based
+on a private value which is generated by each server and
+never revealed.
+With Autokey all key distribution and
+management functions involve only public values, which
+considerably simplifies key distribution and storage.
+Public key management is based on X.509 certificates,
+which can be provided by commercial services or
+produced by utility programs in the OpenSSL software library
+or the NTPv4 distribution.
+.sp \n(Ppu
+.ne 2
+
+While the algorithms for symmetric key cryptography are
+included in the NTPv4 distribution, public key cryptography
+requires the OpenSSL software library to be installed
+before building the NTP distribution.
+Directions for doing that
+are on the Building and Installing the Distribution page.
+.sp \n(Ppu
+.ne 2
+
+Authentication is configured separately for each association
+using the
+\f\*[B-Font]key\f[]
+or
+\f\*[B-Font]autokey\f[]
+subcommand on the
+\f\*[B-Font]peer\f[],
+\f\*[B-Font]server\f[],
+\f\*[B-Font]broadcast\f[]
+and
+\f\*[B-Font]manycastclient\f[]
+configuration commands as described in
+\fIConfiguration\f[] \fIOptions\f[]
+page.
+The authentication
+options described below specify the locations of the key files,
+if other than default, which symmetric keys are trusted
+and the interval between various operations, if other than default.
+.sp \n(Ppu
+.ne 2
+
+Authentication is always enabled,
+although ineffective if not configured as
+described below.
+If a NTP packet arrives
+including a message authentication
+code (MAC), it is accepted only if it
+passes all cryptographic checks.
+The
+checks require correct key ID, key value
+and message digest.
+If the packet has
+been modified in any way or replayed
+by an intruder, it will fail one or more
+of these checks and be discarded.
+Furthermore, the Autokey scheme requires a
+preliminary protocol exchange to obtain
+the server certificate, verify its
+credentials and initialize the protocol
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]auth\f[]
+flag controls whether new associations or
+remote configuration commands require cryptographic authentication.
+This flag can be set or reset by the
+\f\*[B-Font]enable\f[]
+and
+\f\*[B-Font]disable\f[]
+commands and also by remote
+configuration commands sent by a
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+program running in
+another machine.
+If this flag is enabled, which is the default
+case, new broadcast client and symmetric passive associations and
+remote configuration commands must be cryptographically
+authenticated using either symmetric key or public key cryptography.
+If this
+flag is disabled, these operations are effective
+even if not cryptographic
+authenticated.
+It should be understood
+that operating with the
+\f\*[B-Font]auth\f[]
+flag disabled invites a significant vulnerability
+where a rogue hacker can
+masquerade as a falseticker and seriously
+disrupt system timekeeping.
+It is
+important to note that this flag has no purpose
+other than to allow or disallow
+a new association in response to new broadcast
+and symmetric active messages
+and remote configuration commands and, in particular,
+the flag has no effect on
+the authentication process itself.
+.sp \n(Ppu
+.ne 2
+
+An attractive alternative where multicast support is available
+is manycast mode, in which clients periodically troll
+for servers as described in the
+\fIAutomatic\f[] \fINTP\f[] \fIConfiguration\f[] \fIOptions\f[]
+page.
+Either symmetric key or public key
+cryptographic authentication can be used in this mode.
+The principle advantage
+of manycast mode is that potential servers need not be
+configured in advance,
+since the client finds them during regular operation,
+and the configuration
+files for all clients can be identical.
+.sp \n(Ppu
+.ne 2
+
+The security model and protocol schemes for
+both symmetric key and public key
+cryptography are summarized below;
+further details are in the briefings, papers
+and reports at the NTP project page linked from
+\f[C]http://www.ntp.org/\f[].
+.SS Symmetric-Key Cryptography
+The original RFC-1305 specification allows any one of possibly
+65,534 keys, each distinguished by a 32-bit key identifier, to
+authenticate an association.
+The servers and clients involved must
+agree on the key and key identifier to
+authenticate NTP packets.
+Keys and
+related information are specified in a key
+file, usually called
+\fIntp.keys\f[],
+which must be distributed and stored using
+secure means beyond the scope of the NTP protocol itself.
+Besides the keys used
+for ordinary NTP associations,
+additional keys can be used as passwords for the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utility programs.
+.sp \n(Ppu
+.ne 2
+
+When
+\fCntpd\fR(@NTPD_MS@)\f[]
+is first started, it reads the key file specified in the
+\f\*[B-Font]keys\f[]
+configuration command and installs the keys
+in the key cache.
+However,
+individual keys must be activated with the
+\f\*[B-Font]trusted\f[]
+command before use.
+This
+allows, for instance, the installation of possibly
+several batches of keys and
+then activating or deactivating each batch
+remotely using
+\fCntpdc\fR(@NTPDC_MS@)\f[].
+This also provides a revocation capability that can be used
+if a key becomes compromised.
+The
+\f\*[B-Font]requestkey\f[]
+command selects the key used as the password for the
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utility, while the
+\f\*[B-Font]controlkey\f[]
+command selects the key used as the password for the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+utility.
+.SS Public Key Cryptography
+NTPv4 supports the original NTPv3 symmetric key scheme
+described in RFC-1305 and in addition the Autokey protocol,
+which is based on public key cryptography.
+The Autokey Version 2 protocol described on the Autokey Protocol
+page verifies packet integrity using MD5 message digests
+and verifies the source with digital signatures and any of several
+digest/signature schemes.
+Optional identity schemes described on the Identity Schemes
+page and based on cryptographic challenge/response algorithms
+are also available.
+Using all of these schemes provides strong security against
+replay with or without modification, spoofing, masquerade
+and most forms of clogging attacks.
+.\" .Pp
+.\" The cryptographic means necessary for all Autokey operations
+.\" is provided by the OpenSSL software library.
+.\" This library is available from http://www.openssl.org/
+.\" and can be installed using the procedures outlined
+.\" in the Building and Installing the Distribution page.
+.\" Once installed,
+.\" the configure and build
+.\" process automatically detects the library and links
+.\" the library routines required.
+.sp \n(Ppu
+.ne 2
+
+The Autokey protocol has several modes of operation
+corresponding to the various NTP modes supported.
+Most modes use a special cookie which can be
+computed independently by the client and server,
+but encrypted in transmission.
+All modes use in addition a variant of the S-KEY scheme,
+in which a pseudo-random key list is generated and used
+in reverse order.
+These schemes are described along with an executive summary,
+current status, briefing slides and reading list on the
+\fIAutonomous\f[] \fIAuthentication\f[]
+page.
+.sp \n(Ppu
+.ne 2
+
+The specific cryptographic environment used by Autokey servers
+and clients is determined by a set of files
+and soft links generated by the
+\fCntp-keygen\fR(1ntpkeygenmdoc)\f[]
+program.
+This includes a required host key file,
+required certificate file and optional sign key file,
+leapsecond file and identity scheme files.
+The
+digest/signature scheme is specified in the X.509 certificate
+along with the matching sign key.
+There are several schemes
+available in the OpenSSL software library, each identified
+by a specific string such as
+\f\*[B-Font]md5WithRSAEncryption\f[],
+which stands for the MD5 message digest with RSA
+encryption scheme.
+The current NTP distribution supports
+all the schemes in the OpenSSL library, including
+those based on RSA and DSA digital signatures.
+.sp \n(Ppu
+.ne 2
+
+NTP secure groups can be used to define cryptographic compartments
+and security hierarchies.
+It is important that every host
+in the group be able to construct a certificate trail to one
+or more trusted hosts in the same group.
+Each group
+host runs the Autokey protocol to obtain the certificates
+for all hosts along the trail to one or more trusted hosts.
+This requires the configuration file in all hosts to be
+engineered so that, even under anticipated failure conditions,
+the NTP subnet will form such that every group host can find
+a trail to at least one trusted host.
+.SS Naming and Addressing
+It is important to note that Autokey does not use DNS to
+resolve addresses, since DNS can't be completely trusted
+until the name servers have synchronized clocks.
+The cryptographic name used by Autokey to bind the host identity
+credentials and cryptographic values must be independent
+of interface, network and any other naming convention.
+The name appears in the host certificate in either or both
+the subject and issuer fields, so protection against
+DNS compromise is essential.
+.sp \n(Ppu
+.ne 2
+
+By convention, the name of an Autokey host is the name returned
+by the Unix
+\fCgethostname\fR(2)\f[]
+system call or equivalent in other systems.
+By the system design
+model, there are no provisions to allow alternate names or aliases.
+However, this is not to say that DNS aliases, different names
+for each interface, etc., are constrained in any way.
+.sp \n(Ppu
+.ne 2
+
+It is also important to note that Autokey verifies authenticity
+using the host name, network address and public keys,
+all of which are bound together by the protocol specifically
+to deflect masquerade attacks.
+For this reason Autokey
+includes the source and destinatino IP addresses in message digest
+computations and so the same addresses must be available
+at both the server and client.
+For this reason operation
+with network address translation schemes is not possible.
+This reflects the intended robust security model where government
+and corporate NTP servers are operated outside firewall perimeters.
+.SS Operation
+A specific combination of authentication scheme (none,
+symmetric key, public key) and identity scheme is called
+a cryptotype, although not all combinations are compatible.
+There may be management configurations where the clients,
+servers and peers may not all support the same cryptotypes.
+A secure NTPv4 subnet can be configured in many ways while
+keeping in mind the principles explained above and
+in this section.
+Note however that some cryptotype
+combinations may successfully interoperate with each other,
+but may not represent good security practice.
+.sp \n(Ppu
+.ne 2
+
+The cryptotype of an association is determined at the time
+of mobilization, either at configuration time or some time
+later when a message of appropriate cryptotype arrives.
+When mobilized by a
+\f\*[B-Font]server\f[]
+or
+\f\*[B-Font]peer\f[]
+configuration command and no
+\f\*[B-Font]key\f[]
+or
+\f\*[B-Font]autokey\f[]
+subcommands are present, the association is not
+authenticated; if the
+\f\*[B-Font]key\f[]
+subcommand is present, the association is authenticated
+using the symmetric key ID specified; if the
+\f\*[B-Font]autokey\f[]
+subcommand is present, the association is authenticated
+using Autokey.
+.sp \n(Ppu
+.ne 2
+
+When multiple identity schemes are supported in the Autokey
+protocol, the first message exchange determines which one is used.
+The client request message contains bits corresponding
+to which schemes it has available.
+The server response message
+contains bits corresponding to which schemes it has available.
+Both server and client match the received bits with their own
+and select a common scheme.
+.sp \n(Ppu
+.ne 2
+
+Following the principle that time is a public value,
+a server responds to any client packet that matches
+its cryptotype capabilities.
+Thus, a server receiving
+an unauthenticated packet will respond with an unauthenticated
+packet, while the same server receiving a packet of a cryptotype
+it supports will respond with packets of that cryptotype.
+However, unconfigured broadcast or manycast client
+associations or symmetric passive associations will not be
+mobilized unless the server supports a cryptotype compatible
+with the first packet received.
+By default, unauthenticated associations will not be mobilized
+unless overridden in a decidedly dangerous way.
+.sp \n(Ppu
+.ne 2
+
+Some examples may help to reduce confusion.
+Client Alice has no specific cryptotype selected.
+Server Bob has both a symmetric key file and minimal Autokey files.
+Alice's unauthenticated messages arrive at Bob, who replies with
+unauthenticated messages.
+Cathy has a copy of Bob's symmetric
+key file and has selected key ID 4 in messages to Bob.
+Bob verifies the message with his key ID 4.
+If it's the
+same key and the message is verified, Bob sends Cathy a reply
+authenticated with that key.
+If verification fails,
+Bob sends Cathy a thing called a crypto-NAK, which tells her
+something broke.
+She can see the evidence using the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+program.
+.sp \n(Ppu
+.ne 2
+
+Denise has rolled her own host key and certificate.
+She also uses one of the identity schemes as Bob.
+She sends the first Autokey message to Bob and they
+both dance the protocol authentication and identity steps.
+If all comes out okay, Denise and Bob continue as described above.
+.sp \n(Ppu
+.ne 2
+
+It should be clear from the above that Bob can support
+all the girls at the same time, as long as he has compatible
+authentication and identity credentials.
+Now, Bob can act just like the girls in his own choice of servers;
+he can run multiple configured associations with multiple different
+servers (or the same server, although that might not be useful).
+But, wise security policy might preclude some cryptotype
+combinations; for instance, running an identity scheme
+with one server and no authentication with another might not be wise.
+.SS Key Management
+The cryptographic values used by the Autokey protocol are
+incorporated as a set of files generated by the
+\fCntp-keygen\fR(1ntpkeygenmdoc)\f[]
+utility program, including symmetric key, host key and
+public certificate files, as well as sign key, identity parameters
+and leapseconds files.
+Alternatively, host and sign keys and
+certificate files can be generated by the OpenSSL utilities
+and certificates can be imported from public certificate
+authorities.
+Note that symmetric keys are necessary for the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utility programs.
+The remaining files are necessary only for the
+Autokey protocol.
+.sp \n(Ppu
+.ne 2
+
+Certificates imported from OpenSSL or public certificate
+authorities have certian limitations.
+The certificate should be in ASN.1 syntax, X.509 Version 3
+format and encoded in PEM, which is the same format
+used by OpenSSL.
+The overall length of the certificate encoded
+in ASN.1 must not exceed 1024 bytes.
+The subject distinguished
+name field (CN) is the fully qualified name of the host
+on which it is used; the remaining subject fields are ignored.
+The certificate extension fields must not contain either
+a subject key identifier or a issuer key identifier field;
+however, an extended key usage field for a trusted host must
+contain the value
+\f\*[B-Font]trustRoot\f[];.
+Other extension fields are ignored.
+.SS Authentication Commands
+.TP 7
+.NOP \f\*[B-Font]autokey\f[] [\f\*[I-Font]logsec\f[]]
+Specifies the interval between regenerations of the session key
+list used with the Autokey protocol.
+Note that the size of the key
+list for each association depends on this interval and the current
+poll interval.
+The default value is 12 (4096 s or about 1.1 hours).
+For poll intervals above the specified interval, a session key list
+with a single entry will be regenerated for every message
+sent.
+.TP 7
+.NOP \f\*[B-Font]controlkey\f[] \f\*[I-Font]key\f[]
+Specifies the key identifier to use with the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+utility, which uses the standard
+protocol defined in RFC-1305.
+The
+\f\*[I-Font]key\f[]
+argument is
+the key identifier for a trusted key, where the value can be in the
+range 1 to 65,534, inclusive.
+.TP 7
+.NOP \f\*[B-Font]crypto\f[] [\f\*[B-Font]cert\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]leap\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]randfile\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]host\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]sign\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gq\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gqpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]iffpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]mvpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]]
+This command requires the OpenSSL library.
+It activates public key
+cryptography, selects the message digest and signature
+encryption scheme and loads the required private and public
+values described above.
+If one or more files are left unspecified,
+the default names are used as described above.
+Unless the complete path and name of the file are specified, the
+location of a file is relative to the keys directory specified
+in the
+\f\*[B-Font]keysdir\f[]
+command or default
+\fI/usr/local/etc\f[].
+Following are the subcommands:
+.RS
+.TP 7
+.NOP \f\*[B-Font]cert\f[] \f\*[I-Font]file\f[]
+Specifies the location of the required host public certificate file.
+This overrides the link
+\fIntpkey_cert_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]gqpar\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional GQ parameters file.
+This
+overrides the link
+\fIntpkey_gq_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]host\f[] \f\*[I-Font]file\f[]
+Specifies the location of the required host key file.
+This overrides
+the link
+\fIntpkey_key_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]iffpar\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional IFF parameters file.This
+overrides the link
+\fIntpkey_iff_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]leap\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional leapsecond file.
+This overrides the link
+\fIntpkey_leap\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]mvpar\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional MV parameters file.
+This
+overrides the link
+\fIntpkey_mv_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+.TP 7
+.NOP \f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]
+Specifies the password to decrypt files containing private keys and
+identity parameters.
+This is required only if these files have been
+encrypted.
+.TP 7
+.NOP \f\*[B-Font]randfile\f[] \f\*[I-Font]file\f[]
+Specifies the location of the random seed file used by the OpenSSL
+library.
+The defaults are described in the main text above.
+.TP 7
+.NOP \f\*[B-Font]sign\f[] \f\*[I-Font]file\f[]
+Specifies the location of the optional sign key file.
+This overrides
+the link
+\fIntpkey_sign_\f[]\f\*[I-Font]hostname\f[]
+in the keys directory.
+If this file is
+not found, the host key is also the sign key.
+.RE
+.TP 7
+.NOP \f\*[B-Font]keys\f[] \f\*[I-Font]keyfile\f[]
+Specifies the complete path and location of the MD5 key file
+containing the keys and key identifiers used by
+\fCntpd\fR(@NTPD_MS@)\f[],
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+when operating with symmetric key cryptography.
+This is the same operation as the
+\f\*[B-Font]\-k\f[]
+command line option.
+.TP 7
+.NOP \f\*[B-Font]keysdir\f[] \f\*[I-Font]path\f[]
+This command specifies the default directory path for
+cryptographic keys, parameters and certificates.
+The default is
+\fI/usr/local/etc/\f[].
+.TP 7
+.NOP \f\*[B-Font]requestkey\f[] \f\*[I-Font]key\f[]
+Specifies the key identifier to use with the
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utility program, which uses a
+proprietary protocol specific to this implementation of
+\fCntpd\fR(@NTPD_MS@)\f[].
+The
+\f\*[I-Font]key\f[]
+argument is a key identifier
+for the trusted key, where the value can be in the range 1 to
+65,534, inclusive.
+.TP 7
+.NOP \f\*[B-Font]revoke\f[] \f\*[I-Font]logsec\f[]
+Specifies the interval between re-randomization of certain
+cryptographic values used by the Autokey scheme, as a power of 2 in
+seconds.
+These values need to be updated frequently in order to
+deflect brute-force attacks on the algorithms of the scheme;
+however, updating some values is a relatively expensive operation.
+The default interval is 16 (65,536 s or about 18 hours).
+For poll
+intervals above the specified interval, the values will be updated
+for every message sent.
+.TP 7
+.NOP \f\*[B-Font]trustedkey\f[] \f\*[I-Font]key\f[] \f\*[I-Font]...\f[]
+Specifies the key identifiers which are trusted for the
+purposes of authenticating peers with symmetric key cryptography,
+as well as keys used by the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+programs.
+The authentication procedures require that both the local
+and remote servers share the same key and key identifier for this
+purpose, although different keys can be used with different
+servers.
+The
+\f\*[I-Font]key\f[]
+arguments are 32-bit unsigned
+integers with values from 1 to 65,534.
+.PP
+.SS Error Codes
+The following error codes are reported via the NTP control
+and monitoring protocol trap mechanism.
+.TP 7
+.NOP 101
+(bad field format or length)
+The packet has invalid version, length or format.
+.TP 7
+.NOP 102
+(bad timestamp)
+The packet timestamp is the same or older than the most recent received.
+This could be due to a replay or a server clock time step.
+.TP 7
+.NOP 103
+(bad filestamp)
+The packet filestamp is the same or older than the most recent received.
+This could be due to a replay or a key file generation error.
+.TP 7
+.NOP 104
+(bad or missing public key)
+The public key is missing, has incorrect format or is an unsupported type.
+.TP 7
+.NOP 105
+(unsupported digest type)
+The server requires an unsupported digest/signature scheme.
+.TP 7
+.NOP 106
+(mismatched digest types)
+Not used.
+.TP 7
+.NOP 107
+(bad signature length)
+The signature length does not match the current public key.
+.TP 7
+.NOP 108
+(signature not verified)
+The message fails the signature check.
+It could be bogus or signed by a
+different private key.
+.TP 7
+.NOP 109
+(certificate not verified)
+The certificate is invalid or signed with the wrong key.
+.TP 7
+.NOP 110
+(certificate not verified)
+The certificate is not yet valid or has expired or the signature could not
+be verified.
+.TP 7
+.NOP 111
+(bad or missing cookie)
+The cookie is missing, corrupted or bogus.
+.TP 7
+.NOP 112
+(bad or missing leapseconds table)
+The leapseconds table is missing, corrupted or bogus.
+.TP 7
+.NOP 113
+(bad or missing certificate)
+The certificate is missing, corrupted or bogus.
+.TP 7
+.NOP 114
+(bad or missing identity)
+The identity key is missing, corrupt or bogus.
+.PP
+.SH Monitoring Support
+\fCntpd\fR(@NTPD_MS@)\f[]
+includes a comprehensive monitoring facility suitable
+for continuous, long term recording of server and client
+timekeeping performance.
+See the
+\f\*[B-Font]statistics\f[]
+command below
+for a listing and example of each type of statistics currently
+supported.
+Statistic files are managed using file generation sets
+and scripts in the
+\fI./scripts\f[]
+directory of this distribution.
+Using
+these facilities and
+UNIX
+\fCcron\fR(8)\f[]
+jobs, the data can be
+automatically summarized and archived for retrospective analysis.
+.SS Monitoring Commands
+.TP 7
+.NOP \f\*[B-Font]statistics\f[] \f\*[I-Font]name\f[] \f\*[I-Font]...\f[]
+Enables writing of statistics records.
+Currently, eight kinds of
+\f\*[I-Font]name\f[]
+statistics are supported.
+.RS
+.TP 7
+.NOP \f\*[B-Font]clockstats\f[]
+Enables recording of clock driver statistics information.
+Each update
+received from a clock driver appends a line of the following form to
+the file generation set named
+\f\*[B-Font]clockstats\f[]:
+.br
+.in +4
+.nf
+49213 525.624 127.127.4.1 93 226 00:08:29.606 D
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the
+clock address in dotted-quad notation.
+The final field shows the last
+timecode received from the clock in decoded ASCII format, where
+meaningful.
+In some clock drivers a good deal of additional information
+can be gathered and displayed as well.
+See information specific to each
+clock for further details.
+.TP 7
+.NOP \f\*[B-Font]cryptostats\f[]
+This option requires the OpenSSL cryptographic software library.
+It
+enables recording of cryptographic public key protocol information.
+Each message received by the protocol module appends a line of the
+following form to the file generation set named
+\f\*[B-Font]cryptostats\f[]:
+.br
+.in +4
+.nf
+49213 525.624 127.127.4.1 message
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the peer
+address in dotted-quad notation, The final message field includes the
+message type and certain ancillary information.
+See the
+\fIAuthentication\f[] \fIOptions\f[]
+section for further information.
+.TP 7
+.NOP \f\*[B-Font]loopstats\f[]
+Enables recording of loop filter statistics information.
+Each
+update of the local clock outputs a line of the following form to
+the file generation set named
+\f\*[B-Font]loopstats\f[]:
+.br
+.in +4
+.nf
+50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next five fields
+show time offset (seconds), frequency offset (parts per million \-
+PPM), RMS jitter (seconds), Allan deviation (PPM) and clock
+discipline time constant.
+.TP 7
+.NOP \f\*[B-Font]peerstats\f[]
+Enables recording of peer statistics information.
+This includes
+statistics records of all peers of a NTP server and of special
+signals, where present and configured.
+Each valid update appends a
+line of the following form to the current element of a file
+generation set named
+\f\*[B-Font]peerstats\f[]:
+.br
+.in +4
+.nf
+48773 10847.650 127.127.4.1 9714 \-0.001605376 0.000000000 0.001424877 0.000958674
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the peer address in dotted-quad notation and status,
+respectively.
+The status field is encoded in hex in the format
+described in Appendix A of the NTP specification RFC 1305.
+The final four fields show the offset,
+delay, dispersion and RMS jitter, all in seconds.
+.TP 7
+.NOP \f\*[B-Font]rawstats\f[]
+Enables recording of raw-timestamp statistics information.
+This
+includes statistics records of all peers of a NTP server and of
+special signals, where present and configured.
+Each NTP message
+received from a peer or clock driver appends a line of the
+following form to the file generation set named
+\f\*[B-Font]rawstats\f[]:
+.br
+.in +4
+.nf
+50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the remote peer or clock address followed by the local address
+in dotted-quad notation.
+The final four fields show the originate,
+receive, transmit and final NTP timestamps in order.
+The timestamp
+values are as received and before processing by the various data
+smoothing and mitigation algorithms.
+.TP 7
+.NOP \f\*[B-Font]sysstats\f[]
+Enables recording of ntpd statistics counters on a periodic basis.
+Each
+hour a line of the following form is appended to the file generation
+set named
+\f\*[B-Font]sysstats\f[]:
+.br
+.in +4
+.nf
+50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The remaining ten fields show
+the statistics counter values accumulated since the last generated
+line.
+.RS
+.TP 7
+.NOP Time since restart \f\*[B-Font]36000\f[]
+Time in hours since the system was last rebooted.
+.TP 7
+.NOP Packets received \f\*[B-Font]81965\f[]
+Total number of packets received.
+.TP 7
+.NOP Packets processed \f\*[B-Font]0\f[]
+Number of packets received in response to previous packets sent
+.TP 7
+.NOP Current version \f\*[B-Font]9546\f[]
+Number of packets matching the current NTP version.
+.TP 7
+.NOP Previous version \f\*[B-Font]56\f[]
+Number of packets matching the previous NTP version.
+.TP 7
+.NOP Bad version \f\*[B-Font]71793\f[]
+Number of packets matching neither NTP version.
+.TP 7
+.NOP Access denied \f\*[B-Font]512\f[]
+Number of packets denied access for any reason.
+.TP 7
+.NOP Bad length or format \f\*[B-Font]540\f[]
+Number of packets with invalid length, format or port number.
+.TP 7
+.NOP Bad authentication \f\*[B-Font]10\f[]
+Number of packets not verified as authentic.
+.TP 7
+.NOP Rate exceeded \f\*[B-Font]147\f[]
+Number of packets discarded due to rate limitation.
+.RE
+.TP 7
+.NOP \f\*[B-Font]statsdir\f[] \f\*[I-Font]directory_path\f[]
+Indicates the full path of a directory where statistics files
+should be created (see below).
+This keyword allows
+the (otherwise constant)
+\f\*[B-Font]filegen\f[]
+filename prefix to be modified for file generation sets, which
+is useful for handling statistics logs.
+.TP 7
+.NOP \f\*[B-Font]filegen\f[] \f\*[I-Font]name\f[] [\f\*[B-Font]file\f[] \f\*[I-Font]filename\f[]] [\f\*[B-Font]type\f[] \f\*[I-Font]typename\f[]] [\f\*[B-Font]link\f[] | \f\*[B-Font]nolink\f[]] [\f\*[B-Font]enable\f[] | \f\*[B-Font]disable\f[]]
+Configures setting of generation file set name.
+Generation
+file sets provide a means for handling files that are
+continuously growing during the lifetime of a server.
+Server statistics are a typical example for such files.
+Generation file sets provide access to a set of files used
+to store the actual data.
+At any time at most one element
+of the set is being written to.
+The type given specifies
+when and how data will be directed to a new element of the set.
+This way, information stored in elements of a file set
+that are currently unused are available for administrational
+operations without the risk of disturbing the operation of ntpd.
+(Most important: they can be removed to free space for new data
+produced.)
+.sp \n(Ppu
+.ne 2
+
+Note that this command can be sent from the
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+program running at a remote location.
+.RS
+.TP 7
+.NOP \f\*[B-Font]name\f[]
+This is the type of the statistics records, as shown in the
+\f\*[B-Font]statistics\f[]
+command.
+.TP 7
+.NOP \f\*[B-Font]file\f[] \f\*[I-Font]filename\f[]
+This is the file name for the statistics records.
+Filenames of set
+members are built from three concatenated elements
+\f\*[B-Font]prefix\f[],
+\f\*[B-Font]filename\f[]
+and
+\f\*[B-Font]suffix\f[]:
+.RS
+.TP 7
+.NOP \f\*[B-Font]prefix\f[]
+This is a constant filename path.
+It is not subject to
+modifications via the
+\f\*[I-Font]filegen\f[]
+option.
+It is defined by the
+server, usually specified as a compile-time constant.
+It may,
+however, be configurable for individual file generation sets
+via other commands.
+For example, the prefix used with
+\f\*[I-Font]loopstats\f[]
+and
+\f\*[I-Font]peerstats\f[]
+generation can be configured using the
+\f\*[I-Font]statsdir\f[]
+option explained above.
+.TP 7
+.NOP \f\*[B-Font]filename\f[]
+This string is directly concatenated to the prefix mentioned
+above (no intervening
+\[oq]/\[cq]).
+This can be modified using
+the file argument to the
+\f\*[I-Font]filegen\f[]
+statement.
+No
+\fI..\f[]
+elements are
+allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by
+\f\*[I-Font]prefix\f[].
+.TP 7
+.NOP \f\*[B-Font]suffix\f[]
+This part is reflects individual elements of a file set.
+It is
+generated according to the type of a file set.
+.RE
+.TP 7
+.NOP \f\*[B-Font]type\f[] \f\*[I-Font]typename\f[]
+A file generation set is characterized by its type.
+The following
+types are supported:
+.RS
+.TP 7
+.NOP \f\*[B-Font]none\f[]
+The file set is actually a single plain file.
+.TP 7
+.NOP \f\*[B-Font]pid\f[]
+One element of file set is used per incarnation of a ntpd
+server.
+This type does not perform any changes to file set
+members during runtime, however it provides an easy way of
+separating files belonging to different
+\fCntpd\fR(@NTPD_MS@)\f[]
+server incarnations.
+The set member filename is built by appending a
+\[oq]\&.\[cq]
+to concatenated
+\f\*[I-Font]prefix\f[]
+and
+\f\*[I-Font]filename\f[]
+strings, and
+appending the decimal representation of the process ID of the
+\fCntpd\fR(@NTPD_MS@)\f[]
+server process.
+.TP 7
+.NOP \f\*[B-Font]day\f[]
+One file generation set element is created per day.
+A day is
+defined as the period between 00:00 and 24:00 UTC.
+The file set
+member suffix consists of a
+\[oq]\&.\[cq]
+and a day specification in
+the form
+\f\*[B-Font]YYYYMMdd\f[].
+\f\*[B-Font]YYYY\f[]
+is a 4-digit year number (e.g., 1992).
+\f\*[B-Font]MM\f[]
+is a two digit month number.
+\f\*[B-Font]dd\f[]
+is a two digit day number.
+Thus, all information written at 10 December 1992 would end up
+in a file named
+\f\*[I-Font]prefix\f[]
+\f\*[I-Font]filename\f[].19921210.
+.TP 7
+.NOP \f\*[B-Font]week\f[]
+Any file set member contains data related to a certain week of
+a year.
+The term week is defined by computing day-of-year
+modulo 7.
+Elements of such a file generation set are
+distinguished by appending the following suffix to the file set
+filename base: A dot, a 4-digit year number, the letter
+\f\*[B-Font]W\f[],
+and a 2-digit week number.
+For example, information from January,
+10th 1992 would end up in a file with suffix
+.NOP. \f\*[I-Font]1992W1\f[].
+.TP 7
+.NOP \f\*[B-Font]month\f[]
+One generation file set element is generated per month.
+The
+file name suffix consists of a dot, a 4-digit year number, and
+a 2-digit month.
+.TP 7
+.NOP \f\*[B-Font]year\f[]
+One generation file element is generated per year.
+The filename
+suffix consists of a dot and a 4 digit year number.
+.TP 7
+.NOP \f\*[B-Font]age\f[]
+This type of file generation sets changes to a new element of
+the file set every 24 hours of server operation.
+The filename
+suffix consists of a dot, the letter
+\f\*[B-Font]a\f[],
+and an 8-digit number.
+This number is taken to be the number of seconds the server is
+running at the start of the corresponding 24-hour period.
+Information is only written to a file generation by specifying
+\f\*[B-Font]enable\f[];
+output is prevented by specifying
+\f\*[B-Font]disable\f[].
+.RE
+.TP 7
+.NOP \f\*[B-Font]link\f[] | \f\*[B-Font]nolink\f[]
+It is convenient to be able to access the current element of a file
+generation set by a fixed name.
+This feature is enabled by
+specifying
+\f\*[B-Font]link\f[]
+and disabled using
+\f\*[B-Font]nolink\f[].
+If link is specified, a
+hard link from the current file set element to a file without
+suffix is created.
+When there is already a file with this name and
+the number of links of this file is one, it is renamed appending a
+dot, the letter
+\f\*[B-Font]C\f[],
+and the pid of the ntpd server process.
+When the
+number of links is greater than one, the file is unlinked.
+This
+allows the current file to be accessed by a constant name.
+.TP 7
+.NOP \f\*[B-Font]enable\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]disable\f[]
+Enables or disables the recording function.
+.RE
+.RE
+.PP
+.SH Access Control Support
+The
+\fCntpd\fR(@NTPD_MS@)\f[]
+daemon implements a general purpose address/mask based restriction
+list.
+The list contains address/match entries sorted first
+by increasing address values and and then by increasing mask values.
+A match occurs when the bitwise AND of the mask and the packet
+source address is equal to the bitwise AND of the mask and
+address in the list.
+The list is searched in order with the
+last match found defining the restriction flags associated
+with the entry.
+Additional information and examples can be found in the
+"Notes on Configuring NTP and Setting up a NTP Subnet"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.sp \n(Ppu
+.ne 2
+
+The restriction facility was implemented in conformance
+with the access policies for the original NSFnet backbone
+time servers.
+Later the facility was expanded to deflect
+cryptographic and clogging attacks.
+While this facility may
+be useful for keeping unwanted or broken or malicious clients
+from congesting innocent servers, it should not be considered
+an alternative to the NTP authentication facilities.
+Source address based restrictions are easily circumvented
+by a determined cracker.
+.sp \n(Ppu
+.ne 2
+
+Clients can be denied service because they are explicitly
+included in the restrict list created by the restrict command
+or implicitly as the result of cryptographic or rate limit
+violations.
+Cryptographic violations include certificate
+or identity verification failure; rate limit violations generally
+result from defective NTP implementations that send packets
+at abusive rates.
+Some violations cause denied service
+only for the offending packet, others cause denied service
+for a timed period and others cause the denied service for
+an indefinate period.
+When a client or network is denied access
+for an indefinate period, the only way at present to remove
+the restrictions is by restarting the server.
+.SS The Kiss-of-Death Packet
+Ordinarily, packets denied service are simply dropped with no
+further action except incrementing statistics counters.
+Sometimes a
+more proactive response is needed, such as a server message that
+explicitly requests the client to stop sending and leave a message
+for the system operator.
+A special packet format has been created
+for this purpose called the "kiss-of-death" (KoD) packet.
+KoD packets have the leap bits set unsynchronized and stratum set
+to zero and the reference identifier field set to a four-byte
+ASCII code.
+If the
+\f\*[B-Font]noserve\f[]
+or
+\f\*[B-Font]notrust\f[]
+flag of the matching restrict list entry is set,
+the code is "DENY"; if the
+\f\*[B-Font]limited\f[]
+flag is set and the rate limit
+is exceeded, the code is "RATE".
+Finally, if a cryptographic violation occurs, the code is "CRYP".
+.sp \n(Ppu
+.ne 2
+
+A client receiving a KoD performs a set of sanity checks to
+minimize security exposure, then updates the stratum and
+reference identifier peer variables, sets the access
+denied (TEST4) bit in the peer flash variable and sends
+a message to the log.
+As long as the TEST4 bit is set,
+the client will send no further packets to the server.
+The only way at present to recover from this condition is
+to restart the protocol at both the client and server.
+This
+happens automatically at the client when the association times out.
+It will happen at the server only if the server operator cooperates.
+.SS Access Control Commands
+.TP 7
+.NOP \f\*[B-Font]discard\f[] [\f\*[B-Font]average\f[] \f\*[I-Font]avg\f[]] [\f\*[B-Font]minimum\f[] \f\*[I-Font]min\f[]] [\f\*[B-Font]monitor\f[] \f\*[I-Font]prob\f[]]
+Set the parameters of the
+\f\*[B-Font]limited\f[]
+facility which protects the server from
+client abuse.
+The
+\f\*[B-Font]average\f[]
+subcommand specifies the minimum average packet
+spacing, while the
+\f\*[B-Font]minimum\f[]
+subcommand specifies the minimum packet spacing.
+Packets that violate these minima are discarded
+and a kiss-o'-death packet returned if enabled.
+The default
+minimum average and minimum are 5 and 2, respectively.
+The monitor subcommand specifies the probability of discard
+for packets that overflow the rate-control window.
+.TP 7
+.NOP \f\*[B-Font]restrict\f[] \f\*[B-Font]address\f[] [\f\*[B-Font]mask\f[] \f\*[I-Font]mask\f[]] [\f\*[I-Font]flag\f[] \f\*[I-Font]...\f[]]
+The
+\f\*[I-Font]address\f[]
+argument expressed in
+dotted-quad form is the address of a host or network.
+Alternatively, the
+\f\*[I-Font]address\f[]
+argument can be a valid host DNS name.
+The
+\f\*[I-Font]mask\f[]
+argument expressed in dotted-quad form defaults to
+\f\*[B-Font]255.255.255.255\f[],
+meaning that the
+\f\*[I-Font]address\f[]
+is treated as the address of an individual host.
+A default entry (address
+\f\*[B-Font]0.0.0.0\f[],
+mask
+\f\*[B-Font]0.0.0.0\f[])
+is always included and is always the first entry in the list.
+Note that text string
+\f\*[B-Font]default\f[],
+with no mask option, may
+be used to indicate the default entry.
+In the current implementation,
+\f\*[B-Font]flag\f[]
+always
+restricts access, i.e., an entry with no flags indicates that free
+access to the server is to be given.
+The flags are not orthogonal,
+in that more restrictive flags will often make less restrictive
+ones redundant.
+The flags can generally be classed into two
+categories, those which restrict time service and those which
+restrict informational queries and attempts to do run-time
+reconfiguration of the server.
+One or more of the following flags
+may be specified:
+.RS
+.TP 7
+.NOP \f\*[B-Font]ignore\f[]
+Deny packets of all kinds, including
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+queries.
+.TP 7
+.NOP \f\*[B-Font]kod\f[]
+If this flag is set when an access violation occurs, a kiss-o'-death
+(KoD) packet is sent.
+KoD packets are rate limited to no more than one
+per second.
+If another KoD packet occurs within one second after the
+last one, the packet is dropped.
+.TP 7
+.NOP \f\*[B-Font]limited\f[]
+Deny service if the packet spacing violates the lower limits specified
+in the discard command.
+A history of clients is kept using the
+monitoring capability of
+\fCntpd\fR(@NTPD_MS@)\f[].
+Thus, monitoring is always active as
+long as there is a restriction entry with the
+\f\*[B-Font]limited\f[]
+flag.
+.TP 7
+.NOP \f\*[B-Font]lowpriotrap\f[]
+Declare traps set by matching hosts to be low priority.
+The
+number of traps a server can maintain is limited (the current limit
+is 3).
+Traps are usually assigned on a first come, first served
+basis, with later trap requestors being denied service.
+This flag
+modifies the assignment algorithm by allowing low priority traps to
+be overridden by later requests for normal priority traps.
+.TP 7
+.NOP \f\*[B-Font]nomodify\f[]
+Deny
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+queries which attempt to modify the state of the
+server (i.e., run time reconfiguration).
+Queries which return
+information are permitted.
+.TP 7
+.NOP \f\*[B-Font]noquery\f[]
+Deny
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+queries.
+Time service is not affected.
+.TP 7
+.NOP \f\*[B-Font]nopeer\f[]
+Deny packets which would result in mobilizing a new association.
+This
+includes broadcast and symmetric active packets when a configured
+association does not exist.
+It also includes
+\f\*[B-Font]pool\f[]
+associations, so if you want to use servers from a
+\f\*[B-Font]pool\f[]
+directive and also want to use
+\f\*[B-Font]nopeer\f[]
+by default, you'll want a
+\f\*[B-Font]restrict source ...\f[] \f\*[B-Font]line\f[] \f\*[B-Font]as\f[] \f\*[B-Font]well\f[] \f\*[B-Font]that\f[] \f\*[B-Font]does\f[]
+.TP 7
+.NOP not
+include the
+\f\*[B-Font]nopeer\f[]
+directive.
+.TP 7
+.NOP \f\*[B-Font]noserve\f[]
+Deny all packets except
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+queries.
+.TP 7
+.NOP \f\*[B-Font]notrap\f[]
+Decline to provide mode 6 control message trap service to matching
+hosts.
+The trap service is a subsystem of the ntpdq control message
+protocol which is intended for use by remote event logging programs.
+.TP 7
+.NOP \f\*[B-Font]notrust\f[]
+Deny service unless the packet is cryptographically authenticated.
+.TP 7
+.NOP \f\*[B-Font]ntpport\f[]
+This is actually a match algorithm modifier, rather than a
+restriction flag.
+Its presence causes the restriction entry to be
+matched only if the source port in the packet is the standard NTP
+UDP port (123).
+Both
+\f\*[B-Font]ntpport\f[]
+and
+\f\*[B-Font]non-ntpport\f[]
+may
+be specified.
+The
+\f\*[B-Font]ntpport\f[]
+is considered more specific and
+is sorted later in the list.
+.TP 7
+.NOP \f\*[B-Font]version\f[]
+Deny packets that do not match the current NTP version.
+.RE
+.sp \n(Ppu
+.ne 2
+
+Default restriction list entries with the flags ignore, interface,
+ntpport, for each of the local host's interface addresses are
+inserted into the table at startup to prevent the server
+from attempting to synchronize to its own time.
+A default entry is also always present, though if it is
+otherwise unconfigured; no flags are associated
+with the default entry (i.e., everything besides your own
+NTP server is unrestricted).
+.PP
+.SH Automatic NTP Configuration Options
+.SS Manycasting
+Manycasting is a automatic discovery and configuration paradigm
+new to NTPv4.
+It is intended as a means for a multicast client
+to troll the nearby network neighborhood to find cooperating
+manycast servers, validate them using cryptographic means
+and evaluate their time values with respect to other servers
+that might be lurking in the vicinity.
+The intended result is that each manycast client mobilizes
+client associations with some number of the "best"
+of the nearby manycast servers, yet automatically reconfigures
+to sustain this number of servers should one or another fail.
+.sp \n(Ppu
+.ne 2
+
+Note that the manycasting paradigm does not coincide
+with the anycast paradigm described in RFC-1546,
+which is designed to find a single server from a clique
+of servers providing the same service.
+The manycast paradigm is designed to find a plurality
+of redundant servers satisfying defined optimality criteria.
+.sp \n(Ppu
+.ne 2
+
+Manycasting can be used with either symmetric key
+or public key cryptography.
+The public key infrastructure (PKI)
+offers the best protection against compromised keys
+and is generally considered stronger, at least with relatively
+large key sizes.
+It is implemented using the Autokey protocol and
+the OpenSSL cryptographic library available from
+\f[C]http://www.openssl.org/\f[].
+The library can also be used with other NTPv4 modes
+as well and is highly recommended, especially for broadcast modes.
+.sp \n(Ppu
+.ne 2
+
+A persistent manycast client association is configured
+using the manycastclient command, which is similar to the
+server command but with a multicast (IPv4 class
+\f\*[B-Font]D\f[]
+or IPv6 prefix
+\f\*[B-Font]FF\f[])
+group address.
+The IANA has designated IPv4 address 224.1.1.1
+and IPv6 address FF05::101 (site local) for NTP.
+When more servers are needed, it broadcasts manycast
+client messages to this address at the minimum feasible rate
+and minimum feasible time-to-live (TTL) hops, depending
+on how many servers have already been found.
+There can be as many manycast client associations
+as different group address, each one serving as a template
+for a future ephemeral unicast client/server association.
+.sp \n(Ppu
+.ne 2
+
+Manycast servers configured with the
+\f\*[B-Font]manycastserver\f[]
+command listen on the specified group address for manycast
+client messages.
+Note the distinction between manycast client,
+which actively broadcasts messages, and manycast server,
+which passively responds to them.
+If a manycast server is
+in scope of the current TTL and is itself synchronized
+to a valid source and operating at a stratum level equal
+to or lower than the manycast client, it replies to the
+manycast client message with an ordinary unicast server message.
+.sp \n(Ppu
+.ne 2
+
+The manycast client receiving this message mobilizes
+an ephemeral client/server association according to the
+matching manycast client template, but only if cryptographically
+authenticated and the server stratum is less than or equal
+to the client stratum.
+Authentication is explicitly required
+and either symmetric key or public key (Autokey) can be used.
+Then, the client polls the server at its unicast address
+in burst mode in order to reliably set the host clock
+and validate the source.
+This normally results
+in a volley of eight client/server at 2-s intervals
+during which both the synchronization and cryptographic
+protocols run concurrently.
+Following the volley,
+the client runs the NTP intersection and clustering
+algorithms, which act to discard all but the "best"
+associations according to stratum and synchronization
+distance.
+The surviving associations then continue
+in ordinary client/server mode.
+.sp \n(Ppu
+.ne 2
+
+The manycast client polling strategy is designed to reduce
+as much as possible the volume of manycast client messages
+and the effects of implosion due to near-simultaneous
+arrival of manycast server messages.
+The strategy is determined by the
+\f\*[B-Font]manycastclient\f[],
+\f\*[B-Font]tos\f[]
+and
+\f\*[B-Font]ttl\f[]
+configuration commands.
+The manycast poll interval is
+normally eight times the system poll interval,
+which starts out at the
+\f\*[B-Font]minpoll\f[]
+value specified in the
+\f\*[B-Font]manycastclient\f[],
+command and, under normal circumstances, increments to the
+\f\*[B-Font]maxpolll\f[]
+value specified in this command.
+Initially, the TTL is
+set at the minimum hops specified by the ttl command.
+At each retransmission the TTL is increased until reaching
+the maximum hops specified by this command or a sufficient
+number client associations have been found.
+Further retransmissions use the same TTL.
+.sp \n(Ppu
+.ne 2
+
+The quality and reliability of the suite of associations
+discovered by the manycast client is determined by the NTP
+mitigation algorithms and the
+\f\*[B-Font]minclock\f[]
+and
+\f\*[B-Font]minsane\f[]
+values specified in the
+\f\*[B-Font]tos\f[]
+configuration command.
+At least
+\f\*[B-Font]minsane\f[]
+candidate servers must be available and the mitigation
+algorithms produce at least
+\f\*[B-Font]minclock\f[]
+survivors in order to synchronize the clock.
+Byzantine agreement principles require at least four
+candidates in order to correctly discard a single falseticker.
+For legacy purposes,
+\f\*[B-Font]minsane\f[]
+defaults to 1 and
+\f\*[B-Font]minclock\f[]
+defaults to 3.
+For manycast service
+\f\*[B-Font]minsane\f[]
+should be explicitly set to 4, assuming at least that
+number of servers are available.
+.sp \n(Ppu
+.ne 2
+
+If at least
+\f\*[B-Font]minclock\f[]
+servers are found, the manycast poll interval is immediately
+set to eight times
+\f\*[B-Font]maxpoll\f[].
+If less than
+\f\*[B-Font]minclock\f[]
+servers are found when the TTL has reached the maximum hops,
+the manycast poll interval is doubled.
+For each transmission
+after that, the poll interval is doubled again until
+reaching the maximum of eight times
+\f\*[B-Font]maxpoll\f[].
+Further transmissions use the same poll interval and
+TTL values.
+Note that while all this is going on,
+each client/server association found is operating normally
+it the system poll interval.
+.sp \n(Ppu
+.ne 2
+
+Administratively scoped multicast boundaries are normally
+specified by the network router configuration and,
+in the case of IPv6, the link/site scope prefix.
+By default, the increment for TTL hops is 32 starting
+from 31; however, the
+\f\*[B-Font]ttl\f[]
+configuration command can be
+used to modify the values to match the scope rules.
+.sp \n(Ppu
+.ne 2
+
+It is often useful to narrow the range of acceptable
+servers which can be found by manycast client associations.
+Because manycast servers respond only when the client
+stratum is equal to or greater than the server stratum,
+primary (stratum 1) servers fill find only primary servers
+in TTL range, which is probably the most common objective.
+However, unless configured otherwise, all manycast clients
+in TTL range will eventually find all primary servers
+in TTL range, which is probably not the most common
+objective in large networks.
+The
+\f\*[B-Font]tos\f[]
+command can be used to modify this behavior.
+Servers with stratum below
+\f\*[B-Font]floor\f[]
+or above
+\f\*[B-Font]ceiling\f[]
+specified in the
+\f\*[B-Font]tos\f[]
+command are strongly discouraged during the selection
+process; however, these servers may be temporally
+accepted if the number of servers within TTL range is
+less than
+\f\*[B-Font]minclock\f[].
+.sp \n(Ppu
+.ne 2
+
+The above actions occur for each manycast client message,
+which repeats at the designated poll interval.
+However, once the ephemeral client association is mobilized,
+subsequent manycast server replies are discarded,
+since that would result in a duplicate association.
+If during a poll interval the number of client associations
+falls below
+\f\*[B-Font]minclock\f[],
+all manycast client prototype associations are reset
+to the initial poll interval and TTL hops and operation
+resumes from the beginning.
+It is important to avoid
+frequent manycast client messages, since each one requires
+all manycast servers in TTL range to respond.
+The result could well be an implosion, either minor or major,
+depending on the number of servers in range.
+The recommended value for
+\f\*[B-Font]maxpoll\f[]
+is 12 (4,096 s).
+.sp \n(Ppu
+.ne 2
+
+It is possible and frequently useful to configure a host
+as both manycast client and manycast server.
+A number of hosts configured this way and sharing a common
+group address will automatically organize themselves
+in an optimum configuration based on stratum and
+synchronization distance.
+For example, consider an NTP
+subnet of two primary servers and a hundred or more
+dependent clients.
+With two exceptions, all servers
+and clients have identical configuration files including both
+\f\*[B-Font]multicastclient\f[]
+and
+\f\*[B-Font]multicastserver\f[]
+commands using, for instance, multicast group address
+239.1.1.1.
+The only exception is that each primary server
+configuration file must include commands for the primary
+reference source such as a GPS receiver.
+.sp \n(Ppu
+.ne 2
+
+The remaining configuration files for all secondary
+servers and clients have the same contents, except for the
+\f\*[B-Font]tos\f[]
+command, which is specific for each stratum level.
+For stratum 1 and stratum 2 servers, that command is
+not necessary.
+For stratum 3 and above servers the
+\f\*[B-Font]floor\f[]
+value is set to the intended stratum number.
+Thus, all stratum 3 configuration files are identical,
+all stratum 4 files are identical and so forth.
+.sp \n(Ppu
+.ne 2
+
+Once operations have stabilized in this scenario,
+the primary servers will find the primary reference source
+and each other, since they both operate at the same
+stratum (1), but not with any secondary server or client,
+since these operate at a higher stratum.
+The secondary
+servers will find the servers at the same stratum level.
+If one of the primary servers loses its GPS receiver,
+it will continue to operate as a client and other clients
+will time out the corresponding association and
+re-associate accordingly.
+.sp \n(Ppu
+.ne 2
+
+Some administrators prefer to avoid running
+\fCntpd\fR(@NTPD_MS@)\f[]
+continuously and run either
+\fCntpdate\fR(8)\f[]
+or
+\fCntpd\fR(@NTPD_MS@)\f[]
+\f\*[B-Font]\-q\f[]
+as a cron job.
+In either case the servers must be
+configured in advance and the program fails if none are
+available when the cron job runs.
+A really slick
+application of manycast is with
+\fCntpd\fR(@NTPD_MS@)\f[]
+\f\*[B-Font]\-q\f[].
+The program wakes up, scans the local landscape looking
+for the usual suspects, selects the best from among
+the rascals, sets the clock and then departs.
+Servers do not have to be configured in advance and
+all clients throughout the network can have the same
+configuration file.
+.SS Manycast Interactions with Autokey
+Each time a manycast client sends a client mode packet
+to a multicast group address, all manycast servers
+in scope generate a reply including the host name
+and status word.
+The manycast clients then run
+the Autokey protocol, which collects and verifies
+all certificates involved.
+Following the burst interval
+all but three survivors are cast off,
+but the certificates remain in the local cache.
+It often happens that several complete signing trails
+from the client to the primary servers are collected in this way.
+.sp \n(Ppu
+.ne 2
+
+About once an hour or less often if the poll interval
+exceeds this, the client regenerates the Autokey key list.
+This is in general transparent in client/server mode.
+However, about once per day the server private value
+used to generate cookies is refreshed along with all
+manycast client associations.
+In this case all
+cryptographic values including certificates is refreshed.
+If a new certificate has been generated since
+the last refresh epoch, it will automatically revoke
+all prior certificates that happen to be in the
+certificate cache.
+At the same time, the manycast
+scheme starts all over from the beginning and
+the expanding ring shrinks to the minimum and increments
+from there while collecting all servers in scope.
+.SS Manycast Options
+.TP 7
+.NOP \f\*[B-Font]tos\f[] [\f\*[B-Font]ceiling\f[] \f\*[I-Font]ceiling\f[] | \f\*[B-Font]cohort\f[] { \f\*[B-Font]0\f[] | \f\*[B-Font]1\f[] } | \f\*[B-Font]floor\f[] \f\*[I-Font]floor\f[] | \f\*[B-Font]minclock\f[] \f\*[I-Font]minclock\f[] | \f\*[B-Font]minsane\f[] \f\*[I-Font]minsane\f[]]
+This command affects the clock selection and clustering
+algorithms.
+It can be used to select the quality and
+quantity of peers used to synchronize the system clock
+and is most useful in manycast mode.
+The variables operate
+as follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]ceiling\f[] \f\*[I-Font]ceiling\f[]
+Peers with strata above
+\f\*[B-Font]ceiling\f[]
+will be discarded if there are at least
+\f\*[B-Font]minclock\f[]
+peers remaining.
+This value defaults to 15, but can be changed
+to any number from 1 to 15.
+.TP 7
+.NOP \f\*[B-Font]cohort\f[] {0 | 1 }
+This is a binary flag which enables (0) or disables (1)
+manycast server replies to manycast clients with the same
+stratum level.
+This is useful to reduce implosions where
+large numbers of clients with the same stratum level
+are present.
+The default is to enable these replies.
+.TP 7
+.NOP \f\*[B-Font]floor\f[] \f\*[I-Font]floor\f[]
+Peers with strata below
+\f\*[B-Font]floor\f[]
+will be discarded if there are at least
+\f\*[B-Font]minclock\f[]
+peers remaining.
+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
+associations until no more than
+\f\*[B-Font]minclock\f[]
+associations remain.
+This value defaults to 3,
+but can be changed to any number from 1 to the number of
+configured sources.
+.TP 7
+.NOP \f\*[B-Font]minsane\f[] \f\*[I-Font]minsane\f[]
+This is the minimum number of candidates available
+to the clock selection algorithm in order to produce
+one or more truechimers for the clustering algorithm.
+If fewer than this number are available, the clock is
+undisciplined and allowed to run free.
+The default is 1
+for legacy purposes.
+However, according to principles of
+Byzantine agreement,
+\f\*[B-Font]minsane\f[]
+should be at least 4 in order to detect and discard
+a single falseticker.
+.RE
+.TP 7
+.NOP \f\*[B-Font]ttl\f[] \f\*[I-Font]hop\f[] \f\*[I-Font]...\f[]
+This command specifies a list of TTL values in increasing
+order, up to 8 values can be specified.
+In manycast mode these values are used in turn
+in an expanding-ring search.
+The default is eight
+multiples of 32 starting at 31.
+.PP
+.SH Reference Clock Support
+The NTP Version 4 daemon supports some three dozen different radio,
+satellite and modem reference clocks plus a special pseudo-clock
+used for backup or when no other clock source is available.
+Detailed descriptions of individual device drivers and options can
+be found in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+Additional information can be found in the pages linked
+there, including the
+"Debugging Hints for Reference Clock Drivers"
+and
+"How To Write a Reference Clock Driver"
+pages
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+In addition, support for a PPS
+signal is available as described in the
+"Pulse-per-second (PPS) Signal Interfacing"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+Many
+drivers support special line discipline/streams modules which can
+significantly improve the accuracy using the driver.
+These are
+described in the
+"Line Disciplines and Streams Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.sp \n(Ppu
+.ne 2
+
+A reference clock will generally (though not always) be a radio
+timecode receiver which is synchronized to a source of standard
+time such as the services offered by the NRC in Canada and NIST and
+USNO in the US.
+The interface between the computer and the timecode
+receiver is device dependent, but is usually a serial port.
+A
+device driver specific to each reference clock must be selected and
+compiled in the distribution; however, most common radio, satellite
+and modem clocks are included by default.
+Note that an attempt to
+configure a reference clock when the driver has not been compiled
+or the hardware port has not been appropriately configured results
+in a scalding remark to the system log file, but is otherwise non
+hazardous.
+.sp \n(Ppu
+.ne 2
+
+For the purposes of configuration,
+\fCntpd\fR(@NTPD_MS@)\f[]
+treats
+reference clocks in a manner analogous to normal NTP peers as much
+as possible.
+Reference clocks are identified by a syntactically
+correct but invalid IP address, in order to distinguish them from
+normal NTP peers.
+Reference clock addresses are of the form
+\f[C]127.127.\f[]\f\*[I-Font]t\f[].\f\*[I-Font]u\f[],
+where
+\f\*[I-Font]t\f[]
+is an integer
+denoting the clock type and
+\f\*[I-Font]u\f[]
+indicates the unit
+number in the range 0-3.
+While it may seem overkill, it is in fact
+sometimes useful to configure multiple reference clocks of the same
+type, in which case the unit numbers must be unique.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]server\f[]
+command is used to configure a reference
+clock, where the
+\f\*[I-Font]address\f[]
+argument in that command
+is the clock address.
+The
+\f\*[B-Font]key\f[],
+\f\*[B-Font]version\f[]
+and
+\f\*[B-Font]ttl\f[]
+options are not used for reference clock support.
+The
+\f\*[B-Font]mode\f[]
+option is added for reference clock support, as
+described below.
+The
+\f\*[B-Font]prefer\f[]
+option can be useful to
+persuade the server to cherish a reference clock with somewhat more
+enthusiasm than other reference clocks or peers.
+Further
+information on this option can be found in the
+"Mitigation Rules and the prefer Keyword"
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+page.
+The
+\f\*[B-Font]minpoll\f[]
+and
+\f\*[B-Font]maxpoll\f[]
+options have
+meaning only for selected clock drivers.
+See the individual clock
+driver document pages for additional information.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]fudge\f[]
+command is used to provide additional
+information for individual clock drivers and normally follows
+immediately after the
+\f\*[B-Font]server\f[]
+command.
+The
+\f\*[I-Font]address\f[]
+argument specifies the clock address.
+The
+\f\*[B-Font]refid\f[]
+and
+\f\*[B-Font]stratum\f[]
+options can be used to
+override the defaults for the device.
+There are two optional
+device-dependent time offsets and four flags that can be included
+in the
+\f\*[B-Font]fudge\f[]
+command as well.
+.sp \n(Ppu
+.ne 2
+
+The stratum number of a reference clock is by default zero.
+Since the
+\fCntpd\fR(@NTPD_MS@)\f[]
+daemon adds one to the stratum of each
+peer, a primary server ordinarily displays an external stratum of
+one.
+In order to provide engineered backups, it is often useful to
+specify the reference clock stratum as greater than zero.
+The
+\f\*[B-Font]stratum\f[]
+option is used for this purpose.
+Also, in cases
+involving both a reference clock and a pulse-per-second (PPS)
+discipline signal, it is useful to specify the reference clock
+identifier as other than the default, depending on the driver.
+The
+\f\*[B-Font]refid\f[]
+option is used for this purpose.
+Except where noted,
+these options apply to all clock drivers.
+.SS Reference Clock Commands
+.TP 7
+.NOP \f\*[B-Font]server\f[] \f[C]127.127.\f[]\f\*[I-Font]t\f[].\f\*[I-Font]u\f[] [\f\*[B-Font]prefer\f[]] [\f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]minpoll\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]maxpoll\f[] \f\*[I-Font]int\f[]]
+This command can be used to configure reference clocks in
+special ways.
+The options are interpreted as follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]prefer\f[]
+Marks the reference clock as preferred.
+All other things being
+equal, this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+"Mitigation Rules and the prefer Keyword"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+for further information.
+.TP 7
+.NOP \f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.TP 7
+.NOP \f\*[B-Font]minpoll\f[] \f\*[I-Font]int\f[]
+.TP 7
+.NOP \f\*[B-Font]maxpoll\f[] \f\*[I-Font]int\f[]
+These options specify the minimum and maximum polling interval
+for reference clock messages, as a power of 2 in seconds
+For
+most directly connected reference clocks, both
+\f\*[B-Font]minpoll\f[]
+and
+\f\*[B-Font]maxpoll\f[]
+default to 6 (64 s).
+For modem reference clocks,
+\f\*[B-Font]minpoll\f[]
+defaults to 10 (17.1 m) and
+\f\*[B-Font]maxpoll\f[]
+defaults to 14 (4.5 h).
+The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
+.RE
+.TP 7
+.NOP \f\*[B-Font]fudge\f[] \f[C]127.127.\f[]\f\*[I-Font]t\f[].\f\*[I-Font]u\f[] [\f\*[B-Font]time1\f[] \f\*[I-Font]sec\f[]] [\f\*[B-Font]time2\f[] \f\*[I-Font]sec\f[]] [\f\*[B-Font]stratum\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]refid\f[] \f\*[I-Font]string\f[]] [\f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]] [\f\*[B-Font]flag1\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]] [\f\*[B-Font]flag2\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]] [\f\*[B-Font]flag3\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]] [\f\*[B-Font]flag4\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]]
+This command can be used to configure reference clocks in
+special ways.
+It must immediately follow the
+\f\*[B-Font]server\f[]
+command which configures the driver.
+Note that the same capability
+is possible at run time using the
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+program.
+The options are interpreted as
+follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]time1\f[] \f\*[I-Font]sec\f[]
+Specifies a constant to be added to the time offset produced by
+the driver, a fixed-point decimal number in seconds.
+This is used
+as a calibration constant to adjust the nominal time offset of a
+particular clock to agree with an external standard, such as a
+precision PPS signal.
+It also provides a way to correct a
+systematic error or bias due to serial port or operating system
+latencies, different cable lengths or receiver internal delay.
+The
+specified offset is in addition to the propagation delay provided
+by other means, such as internal DIPswitches.
+Where a calibration
+for an individual system and driver is available, an approximate
+correction is noted in the driver documentation pages.
+Note: in order to facilitate calibration when more than one
+radio clock or PPS signal is supported, a special calibration
+feature is available.
+It takes the form of an argument to the
+\f\*[B-Font]enable\f[]
+command described in
+\fIMiscellaneous\f[] \fIOptions\f[]
+page and operates as described in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.TP 7
+.NOP \f\*[B-Font]time2\f[] \f\*[I-Font]secs\f[]
+Specifies a fixed-point decimal number in seconds, which is
+interpreted in a driver-dependent way.
+See the descriptions of
+specific drivers in the
+"Reference Clock Drivers"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+.TP 7
+.NOP \f\*[B-Font]stratum\f[] \f\*[I-Font]int\f[]
+Specifies the stratum number assigned to the driver, an integer
+between 0 and 15.
+This number overrides the default stratum number
+ordinarily assigned by the driver itself, usually zero.
+.TP 7
+.NOP \f\*[B-Font]refid\f[] \f\*[I-Font]string\f[]
+Specifies an ASCII string of from one to four characters which
+defines the reference identifier used by the driver.
+This string
+overrides the default identifier ordinarily assigned by the driver
+itself.
+.TP 7
+.NOP \f\*[B-Font]mode\f[] \f\*[I-Font]int\f[]
+Specifies a mode number which is interpreted in a
+device-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.TP 7
+.NOP \f\*[B-Font]flag1\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+.TP 7
+.NOP \f\*[B-Font]flag2\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+.TP 7
+.NOP \f\*[B-Font]flag3\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+.TP 7
+.NOP \f\*[B-Font]flag4\f[] \f\*[B-Font]0\f[] \f\*[B-Font]\&|\f[] \f\*[B-Font]1\f[]
+These four flags are used for customizing the clock driver.
+The
+interpretation of these values, and whether they are used at all,
+is a function of the particular clock driver.
+However, by
+convention
+\f\*[B-Font]flag4\f[]
+is used to enable recording monitoring
+data to the
+\f\*[B-Font]clockstats\f[]
+file configured with the
+\f\*[B-Font]filegen\f[]
+command.
+Further information on the
+\f\*[B-Font]filegen\f[]
+command can be found in
+\fIMonitoring\f[] \fIOptions\f[].
+.RE
+.PP
+.SH Miscellaneous Options
+.TP 7
+.NOP \f\*[B-Font]broadcastdelay\f[] \f\*[I-Font]seconds\f[]
+The broadcast and multicast modes require a special calibration
+to determine the network delay between the local and remote
+servers.
+Ordinarily, this is done automatically by the initial
+protocol exchanges between the client and server.
+In some cases,
+the calibration procedure may fail due to network or server access
+controls, for example.
+This command specifies the default delay to
+be used under these circumstances.
+Typically (for Ethernet), a
+number between 0.003 and 0.007 seconds is appropriate.
+The default
+when this command is not used is 0.004 seconds.
+.TP 7
+.NOP \f\*[B-Font]calldelay\f[] \f\*[I-Font]delay\f[]
+This option controls the delay in seconds between the first and second
+packets sent in burst or iburst mode to allow additional time for a modem
+or ISDN call to complete.
+.TP 7
+.NOP \f\*[B-Font]driftfile\f[] \f\*[I-Font]driftfile\f[]
+This command specifies the complete path and name of the file used to
+record the frequency of the local clock oscillator.
+This is the same
+operation as the
+\f\*[B-Font]\-f\f[]
+command line option.
+If the file exists, it is read at
+startup in order to set the initial frequency and then updated once per
+hour with the current frequency computed by the daemon.
+If the file name is
+specified, but the file itself does not exist, the starts with an initial
+frequency of zero and creates the file when writing it for the first time.
+If this command is not given, the daemon will always start with an initial
+frequency of zero.
+.sp \n(Ppu
+.ne 2
+
+The file format consists of a single line containing a single
+floating point number, which records the frequency offset measured
+in parts-per-million (PPM).
+The file is updated by first writing
+the current drift value into a temporary file and then renaming
+this file to replace the old version.
+This implies that
+\fCntpd\fR(@NTPD_MS@)\f[]
+must have write permission for the directory the
+drift file is located in, and that file system links, symbolic or
+otherwise, should be avoided.
+.TP 7
+.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+.TP 7
+.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]mode7\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]stats\f[]]
+Provides a way to enable or disable various server options.
+Flags not mentioned are unaffected.
+Note that all of these flags
+can be controlled remotely using the
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utility program.
+.RS
+.TP 7
+.NOP \f\*[B-Font]auth\f[]
+Enables the server to synchronize with unconfigured peers only if the
+peer has been correctly authenticated using either public key or
+private key cryptography.
+The default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]bclient\f[]
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the
+\f\*[B-Font]multicastclient\f[]
+command with default
+address.
+The default for this flag is
+\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]calibrate\f[]
+Enables the calibrate feature for reference clocks.
+The default for
+this flag is
+\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]kernel\f[]
+Enables the kernel time discipline, if available.
+The default for this
+flag is
+\f\*[B-Font]enable\f[]
+if support is available, otherwise
+\f\*[B-Font]disable\f[].
+.TP 7
+.NOP \f\*[B-Font]mode7\f[]
+Enables processing of NTP mode 7 implementation-specific requests
+which are used by the deprecated
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+program.
+The default for this flag is disable.
+This flag is excluded from runtime configuration using
+\fCntpq\fR(@NTPQ_MS@)\f[].
+The
+\fCntpq\fR(@NTPQ_MS@)\f[]
+program provides the same capabilities as
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+using standard mode 6 requests.
+.TP 7
+.NOP \f\*[B-Font]monitor\f[]
+Enables the monitoring facility.
+See the
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+program
+and the
+\f\*[B-Font]monlist\f[]
+command or further information.
+The
+default for this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]ntp\f[]
+Enables time and frequency discipline.
+In effect, this switch opens and
+closes the feedback loop, which is useful for testing.
+The default for
+this flag is
+\f\*[B-Font]enable\f[].
+.TP 7
+.NOP \f\*[B-Font]stats\f[]
+Enables the statistics facility.
+See the
+\fIMonitoring\f[] \fIOptions\f[]
+section for further information.
+The default for this flag is
+\f\*[B-Font]disable\f[].
+.RE
+.TP 7
+.NOP \f\*[B-Font]includefile\f[] \f\*[I-Font]includefile\f[]
+This command allows additional configuration commands
+to be included from a separate file.
+Include files may
+be nested to a depth of five; upon reaching the end of any
+include file, command processing resumes in the previous
+configuration file.
+This option is useful for sites that run
+\fCntpd\fR(@NTPD_MS@)\f[]
+on multiple hosts, with (mostly) common options (e.g., a
+restriction list).
+.TP 7
+.NOP \f\*[B-Font]logconfig\f[] \f\*[I-Font]configkeyword\f[]
+This command controls the amount and type of output written to
+the system
+\fCsyslog\fR(3)\f[]
+facility or the alternate
+\f\*[B-Font]logfile\f[]
+log file.
+By default, all output is turned on.
+All
+\f\*[I-Font]configkeyword\f[]
+keywords can be prefixed with
+\[oq]=\[cq],
+\[oq]+\[cq]
+and
+\[oq]\-\[cq],
+where
+\[oq]=\[cq]
+sets the
+\fCsyslog\fR(3)\f[]
+priority mask,
+\[oq]+\[cq]
+adds and
+\[oq]\-\[cq]
+removes
+messages.
+\fCsyslog\fR(3)\f[]
+messages can be controlled in four
+classes
+(\f\*[B-Font]clock\f[], \f\*[B-Font]peer\f[], \f\*[B-Font]sys\f[] and \f\*[B-Font]sync\f[]).
+Within these classes four types of messages can be
+controlled: informational messages
+(\f\*[B-Font]info\f[]),
+event messages
+(\f\*[B-Font]events\f[]),
+statistics messages
+(\f\*[B-Font]statistics\f[])
+and
+status messages
+(\f\*[B-Font]status\f[]).
+.sp \n(Ppu
+.ne 2
+
+Configuration keywords are formed by concatenating the message class with
+the event class.
+The
+\f\*[B-Font]all\f[]
+prefix can be used instead of a message class.
+A
+message class may also be followed by the
+\f\*[B-Font]all\f[]
+keyword to enable/disable all
+messages of the respective message class.Thus, a minimal log configuration
+could look like this:
+.br
+.in +4
+.nf
+logconfig =syncstatus +sysevents
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+This would just list the synchronizations state of
+\fCntpd\fR(@NTPD_MS@)\f[]
+and the major system events.
+For a simple reference server, the
+following minimum message configuration could be useful:
+.br
+.in +4
+.nf
+logconfig =syncall +clockall
+.in -4
+.fi
+.sp \n(Ppu
+.ne 2
+
+This configuration will list all clock information and
+synchronization information.
+All other events and messages about
+peers, system events and so on is suppressed.
+.TP 7
+.NOP \f\*[B-Font]logfile\f[] \f\*[I-Font]logfile\f[]
+This command specifies the location of an alternate log file to
+be used instead of the default system
+\fCsyslog\fR(3)\f[]
+facility.
+This is the same operation as the \-l command line option.
+.TP 7
+.NOP \f\*[B-Font]setvar\f[] \f\*[I-Font]variable\f[] [\f\*[B-Font]default\f[]]
+This command adds an additional system variable.
+These
+variables can be used to distribute additional information such as
+the access policy.
+If the variable of the form
+\fIname\f[]\fI=\f[]\f\*[I-Font]value\f[]
+is followed by the
+\f\*[B-Font]default\f[]
+keyword, the
+variable will be listed as part of the default system variables
+(\fCntpq\fR(@NTPQ_MS@)\f[] \f\*[B-Font]rv\f[] command)).
+These additional variables serve
+informational purposes only.
+They are not related to the protocol
+other that they can be listed.
+The known protocol variables will
+always override any variables defined via the
+\f\*[B-Font]setvar\f[]
+mechanism.
+There are three special variables that contain the names
+of all variable of the same group.
+The
+\fIsys_var_list\f[]
+holds
+the names of all system variables.
+The
+\fIpeer_var_list\f[]
+holds
+the names of all peer variables and the
+\fIclock_var_list\f[]
+holds the names of the reference clock variables.
+.TP 7
+.NOP \f\*[B-Font]tinker\f[] [\f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[] | \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[] | \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[] | \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[] | \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[] | \f\*[B-Font]step\f[] \f\*[I-Font]srep\f[] | \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]]
+This command can be used to alter several system variables in
+very exceptional circumstances.
+It should occur in the
+configuration file before any other configuration options.
+The
+default values of these variables have been carefully optimized for
+a wide range of network speeds and reliability expectations.
+In
+general, they interact in intricate ways that are hard to predict
+and some combinations can result in some very nasty behavior.
+Very
+rarely is it necessary to change the default values; but, some
+folks cannot resist twisting the knobs anyway and this command is
+for them.
+Emphasis added: twisters are on their own and can expect
+no help from the support group.
+.sp \n(Ppu
+.ne 2
+
+The variables operate as follows:
+.RS
+.TP 7
+.NOP \f\*[B-Font]allan\f[] \f\*[I-Font]allan\f[]
+The argument becomes the new value for the minimum Allan
+intercept, which is a parameter of the PLL/FLL clock discipline
+algorithm.
+The value in log2 seconds defaults to 7 (1024 s), which is also the lower
+limit.
+.TP 7
+.NOP \f\*[B-Font]dispersion\f[] \f\*[I-Font]dispersion\f[]
+The argument becomes the new value for the dispersion increase rate,
+normally .000015 s/s.
+.TP 7
+.NOP \f\*[B-Font]freq\f[] \f\*[I-Font]freq\f[]
+The argument becomes the initial value of the frequency offset in
+parts-per-million.
+This overrides the value in the frequency file, if
+present, and avoids the initial training state if it is not.
+.TP 7
+.NOP \f\*[B-Font]huffpuff\f[] \f\*[I-Font]huffpuff\f[]
+The argument becomes the new value for the experimental
+huff-n'-puff filter span, which determines the most recent interval
+the algorithm will search for a minimum delay.
+The lower limit is
+900 s (15 m), but a more reasonable value is 7200 (2 hours).
+There
+is no default, since the filter is not enabled unless this command
+is given.
+.TP 7
+.NOP \f\*[B-Font]panic\f[] \f\*[I-Font]panic\f[]
+The argument is the panic threshold, normally 1000 s.
+If set to zero,
+the panic sanity check is disabled and a clock offset of any value will
+be accepted.
+.TP 7
+.NOP \f\*[B-Font]step\f[] \f\*[I-Font]step\f[]
+The argument is the step threshold, which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if the step threshold is set to zero or greater than the
+default.
+.TP 7
+.NOP \f\*[B-Font]stepout\f[] \f\*[I-Font]stepout\f[]
+The argument is the stepout timeout, which by default is 900 s.
+It can
+be set to any positive number in seconds.
+If set to zero, the stepout
+pulses will not be suppressed.
+.RE
+.TP 7
+.NOP \f\*[B-Font]rlimit\f[] [\f\*[B-Font]memlock\f[] \f\*[I-Font]Nmegabytes\f[] | \f\*[B-Font]stacksize\f[] \f\*[I-Font]N4kPages\f[] \f\*[B-Font]filenum\f[] \f\*[I-Font]Nfiledescriptors\f[]]
+.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
+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.
+.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
+.TP 7
+.NOP \f\*[B-Font]filenum\f[] \f\*[I-Font]Nfiledescriptors\f[]
+Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
+\fBmlockall\fR()\f[]
+function.
+Defaults to 50 4k pages (200 4k pages in OpenBSD).
+.RE
+.TP 7
+.NOP \f\*[B-Font]trap\f[] \f\*[I-Font]host_address\f[] [\f\*[B-Font]port\f[] \f\*[I-Font]port_number\f[]] [\f\*[B-Font]interface\f[] \f\*[I-Font]interface_address\f[]]
+This command configures a trap receiver at the given host
+address and port number for sending messages with the specified
+local interface address.
+If the port number is unspecified, a value
+of 18447 is used.
+If the interface address is not specified, the
+message is sent with a source address of the local interface the
+message is sent through.
+Note that on a multihomed host the
+interface used may vary from time to time with routing changes.
+.sp \n(Ppu
+.ne 2
+
+The trap receiver will generally log event messages and other
+information from the server in a log file.
+While such monitor
+programs may also request their own trap dynamically, configuring a
+trap receiver will ensure that no messages are lost when the server
+is started.
+.TP 7
+.NOP \f\*[B-Font]hop\f[] \f\*[I-Font]...\f[]
+This command specifies a list of TTL values in increasing order, up to 8
+values can be specified.
+In manycast mode these values are used in turn in
+an expanding-ring search.
+The default is eight multiples of 32 starting at
+31.
+.PP
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTP_CONF_<option-name>\fP or \fBNTP_CONF\fP
+.fi
+.ad
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH FILES
+.TP 15
+.NOP \fI/etc/ntp.conf\f[]
+the default name of the configuration file
+.br
+.ns
+.TP 15
+.NOP \fIntp.keys\f[]
+private MD5 keys
+.br
+.ns
+.TP 15
+.NOP \fIntpkey\f[]
+RSA private key
+.br
+.ns
+.TP 15
+.NOP \fIntpkey_\f[]\f\*[I-Font]host\f[]
+RSA public key
+.br
+.ns
+.TP 15
+.NOP \fIntp_dh\f[]
+Diffie-Hellman agreement parameters
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "SEE ALSO"
+\fCntpd\fR(@NTPD_MS@)\f[],
+\fCntpdc\fR(@NTPDC_MS@)\f[],
+\fCntpq\fR(@NTPQ_MS@)\f[]
+.sp \n(Ppu
+.ne 2
+
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+\f[C]http://www.ntp.org/\f[].
+A snapshot of this documentation is available in HTML format in
+\fI/usr/share/doc/ntp\f[].
+David L. Mills,
+\fINetwork Time Protocol (Version 4)\fR,
+RFC5905
+.PP
+
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+The syntax checking is not picky; some combinations of
+ridiculous and even hilarious options and modes may not be
+detected.
+.sp \n(Ppu
+.ne 2
+
+The
+\fIntpkey_\f[]\f\*[I-Font]host\f[]
+files are really digital
+certificates.
+These should be obtained via secure directory
+services when they become universally available.
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+This document was derived from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp.conf\fP
+option definitions.
diff --git a/ntpd/ntp.conf.mdoc.in b/ntpd/ntp.conf.mdoc.in
new file mode 100644
index 0000000..3a236d5
--- /dev/null
+++ b/ntpd/ntp.conf.mdoc.in
@@ -0,0 +1,2808 @@
+.Dd December 2 2014
+.Dt NTP_CONF 5 File Formats
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:58 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.conf.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp.conf
+.Nd Network Time Protocol (NTP) daemon configuration file format
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+The
+.Nm
+configuration file is read at initial startup by the
+.Xr ntpd @NTPD_MS@
+daemon in order to specify the synchronization sources,
+modes and other related information.
+Usually, it is installed in the
+.Pa /etc
+directory,
+but could be installed elsewhere
+(see the daemon's
+.Fl c
+command line option).
+.Pp
+The file format is similar to other
+.Ux
+configuration files.
+Comments begin with a
+.Ql #
+character and extend to the end of the line;
+blank lines are ignored.
+Configuration commands consist of an initial keyword
+followed by a list of arguments,
+some of which may be optional, separated by whitespace.
+Commands may not be continued over multiple lines.
+Arguments may be host names,
+host addresses written in numeric, dotted\-quad form,
+integers, floating point numbers (when specifying times in seconds)
+and text strings.
+.Pp
+The rest of this page describes the configuration and control options.
+The
+.Qq Notes on Configuring NTP and Setting up an NTP Subnet
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+contains an extended discussion of these options.
+In addition to the discussion of general
+.Sx Configuration Options ,
+there are sections describing the following supported functionality
+and the options used to control it:
+.Bl -bullet -offset indent
+.It
+.Sx Authentication Support
+.It
+.Sx Monitoring Support
+.It
+.Sx Access Control Support
+.It
+.Sx Automatic NTP Configuration Options
+.It
+.Sx Reference Clock Support
+.It
+.Sx Miscellaneous Options
+.El
+.Pp
+Following these is a section describing
+.Sx Miscellaneous Options .
+While there is a rich set of options available,
+the only required option is one or more
+.Ic pool ,
+.Ic server ,
+.Ic peer ,
+.Ic broadcast
+or
+.Ic manycastclient
+commands.
+.Sh Configuration Support
+Following is a description of the configuration commands in
+NTPv4.
+These commands have the same basic functions as in NTPv3 and
+in some cases new functions and new arguments.
+There are two
+classes of commands, configuration commands that configure a
+persistent association with a remote server or peer or reference
+clock, and auxiliary commands that specify environmental variables
+that control various related operations.
+.Ss Configuration Commands
+The various modes are determined by the command keyword and the
+type of the required IP address.
+Addresses are classed by type as
+(s) a remote server or peer (IPv4 class A, B and C), (b) the
+broadcast address of a local interface, (m) a multicast address (IPv4
+class D), or (r) a reference clock address (127.127.x.x).
+Note that
+only those options applicable to each command are listed below.
+Use
+of options not listed may not be caught as an error, but may result
+in some weird and even destructive behavior.
+.Pp
+If the Basic Socket Interface Extensions for IPv6 (RFC\-2553)
+is detected, support for the IPv6 address family is generated
+in addition to the default support of the IPv4 address family.
+In a few cases, including the reslist billboard generated
+by ntpdc, IPv6 addresses are automatically generated.
+IPv6 addresses can be identified by the presence of colons
+.Dq \&:
+in the address field.
+IPv6 addresses can be used almost everywhere where
+IPv4 addresses can be used,
+with the exception of reference clock addresses,
+which are always IPv4.
+.Pp
+Note that in contexts where a host name is expected, a
+.Fl 4
+qualifier preceding
+the host name forces DNS resolution to the IPv4 namespace,
+while a
+.Fl 6
+qualifier forces DNS resolution to the IPv6 namespace.
+See IPv6 references for the
+equivalent classes for that address family.
+.Bl -tag -width indent
+.It Xo Ic pool Ar address
+.Op Cm burst
+.Op Cm iburst
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic server Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm burst
+.Op Cm iburst
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic peer Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Xc
+.It Xo Ic broadcast Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm ttl Ar ttl
+.Xc
+.It Xo Ic manycastclient Ar address
+.Op Cm key Ar key \&| Cm autokey
+.Op Cm version Ar version
+.Op Cm prefer
+.Op Cm minpoll Ar minpoll
+.Op Cm maxpoll Ar maxpoll
+.Op Cm ttl Ar ttl
+.Xc
+.El
+.Pp
+These five commands specify the time server name or address to
+be used and the mode in which to operate.
+The
+.Ar address
+can be
+either a DNS name or an IP address in dotted\-quad notation.
+Additional information on association behavior can be found in the
+.Qq Association Management
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Bl -tag -width indent
+.It Ic pool
+For type s addresses, this command mobilizes a persistent
+client mode association with a number of remote servers.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+.It Ic server
+For type s and r addresses, this command mobilizes a persistent
+client mode association with the specified remote server or local
+radio clock.
+In this mode the local clock can synchronized to the
+remote server, but the remote server can never be synchronized to
+the local clock.
+This command should
+.Em not
+be used for type
+b or m addresses.
+.It Ic peer
+For type s addresses (only), this command mobilizes a
+persistent symmetric\-active mode association with the specified
+remote peer.
+In this mode the local clock can be synchronized to
+the remote peer or the remote peer can be synchronized to the local
+clock.
+This is useful in a network of servers where, depending on
+various failure scenarios, either the local or remote peer may be
+the better source of time.
+This command should NOT be used for type
+b, m or r addresses.
+.It Ic broadcast
+For type b and m addresses (only), this
+command mobilizes a persistent broadcast mode association.
+Multiple
+commands can be used to specify multiple local broadcast interfaces
+(subnets) and/or multiple multicast groups.
+Note that local
+broadcast messages go only to the interface associated with the
+subnet specified, but multicast messages go to all interfaces.
+In broadcast mode the local server sends periodic broadcast
+messages to a client population at the
+.Ar address
+specified, which is usually the broadcast address on (one of) the
+local network(s) or a multicast address assigned to NTP.
+The IANA
+has assigned the multicast group address IPv4 224.0.1.1 and
+IPv6 ff05::101 (site local) exclusively to
+NTP, but other nonconflicting addresses can be used to contain the
+messages within administrative boundaries.
+Ordinarily, this
+specification applies only to the local server operating as a
+sender; for operation as a broadcast client, see the
+.Ic broadcastclient
+or
+.Ic multicastclient
+commands
+below.
+.It Ic manycastclient
+For type m addresses (only), this command mobilizes a
+manycast client mode association for the multicast address
+specified.
+In this case a specific address must be supplied which
+matches the address used on the
+.Ic manycastserver
+command for
+the designated manycast servers.
+The NTP multicast address
+224.0.1.1 assigned by the IANA should NOT be used, unless specific
+means are taken to avoid spraying large areas of the Internet with
+these messages and causing a possibly massive implosion of replies
+at the sender.
+The
+.Ic manycastserver
+command specifies that the local server
+is to operate in client mode with the remote servers that are
+discovered as the result of broadcast/multicast messages.
+The
+client broadcasts a request message to the group address associated
+with the specified
+.Ar address
+and specifically enabled
+servers respond to these messages.
+The client selects the servers
+providing the best time and continues as with the
+.Ic server
+command.
+The remaining servers are discarded as if never
+heard.
+.El
+.Pp
+Options:
+.Bl -tag -width indent
+.It Cm autokey
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the autokey scheme
+described in
+.Sx Authentication Options .
+.It Cm burst
+when the server is reachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first and second packets
+can be changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to improve timekeeping quality
+with the
+.Ic server
+command and s addresses.
+.It Cm iburst
+When the server is unreachable, send a burst of eight packets
+instead of the usual one.
+The packet spacing is normally 2 s;
+however, the spacing between the first two packets can be
+changed with the calldelay command to allow
+additional time for a modem or ISDN call to complete.
+This is designed to speed the initial synchronization
+acquisition with the
+.Ic server
+command and s addresses and when
+.Xr ntpd @NTPD_MS@
+is started with the
+.Fl q
+option.
+.It Cm key Ar key
+All packets sent to and received from the server or peer are to
+include authentication fields encrypted using the specified
+.Ar key
+identifier with values from 1 to 65534, inclusive.
+The
+default is to include no encryption field.
+.It Cm minpoll Ar minpoll
+.It Cm maxpoll Ar maxpoll
+These options specify the minimum and maximum poll intervals
+for NTP messages, as a power of 2 in seconds
+The maximum poll
+interval defaults to 10 (1,024 s), but can be increased by the
+.Cm maxpoll
+option to an upper limit of 17 (36.4 h).
+The
+minimum poll interval defaults to 6 (64 s), but can be decreased by
+the
+.Cm minpoll
+option to a lower limit of 4 (16 s).
+.It Cm noselect
+Marks the server as unused, except for display purposes.
+The server is discarded by the selection algroithm.
+.It Cm prefer
+Marks the server as preferred.
+All other things being equal,
+this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+.Qq Mitigation Rules and the prefer Keyword
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+for further information.
+.It Cm ttl Ar ttl
+This option is used only with broadcast server and manycast
+client modes.
+It specifies the time\-to\-live
+.Ar ttl
+to
+use on broadcast server and multicast server and the maximum
+.Ar ttl
+for the expanding ring search with manycast
+client packets.
+Selection of the proper value, which defaults to
+127, is something of a black art and should be coordinated with the
+network administrator.
+.It Cm version Ar version
+Specifies the version number to be used for outgoing NTP
+packets.
+Versions 1\-4 are the choices, with version 4 the
+default.
+.El
+.Ss Auxiliary Commands
+.Bl -tag -width indent
+.It Ic broadcastclient
+This command enables reception of broadcast server messages to
+any local interface (type b) address.
+Upon receiving a message for
+the first time, the broadcast client measures the nominal server
+propagation delay using a brief client/server exchange with the
+server, then enters the broadcast client mode, in which it
+synchronizes to succeeding broadcast messages.
+Note that, in order
+to avoid accidental or malicious disruption in this mode, both the
+server and client should operate using symmetric\-key or public\-key
+authentication as described in
+.Sx Authentication Options .
+.It Ic manycastserver Ar address ...
+This command enables reception of manycast client messages to
+the multicast group address(es) (type m) specified.
+At least one
+address is required, but the NTP multicast address 224.0.1.1
+assigned by the IANA should NOT be used, unless specific means are
+taken to limit the span of the reply and avoid a possibly massive
+implosion at the original sender.
+Note that, in order to avoid
+accidental or malicious disruption in this mode, both the server
+and client should operate using symmetric\-key or public\-key
+authentication as described in
+.Sx Authentication Options .
+.It Ic multicastclient Ar address ...
+This command enables reception of multicast server messages to
+the multicast group address(es) (type m) specified.
+Upon receiving
+a message for the first time, the multicast client measures the
+nominal server propagation delay using a brief client/server
+exchange with the server, then enters the broadcast client mode, in
+which it synchronizes to succeeding multicast messages.
+Note that,
+in order to avoid accidental or malicious disruption in this mode,
+both the server and client should operate using symmetric\-key or
+public\-key authentication as described in
+.Sx Authentication Options .
+.El
+.Sh Authentication Support
+Authentication support allows the NTP client to verify that the
+server is in fact known and trusted and not an intruder intending
+accidentally or on purpose to masquerade as that server.
+The NTPv3
+specification RFC\-1305 defines a scheme which provides
+cryptographic authentication of received NTP packets.
+Originally,
+this was done using the Data Encryption Standard (DES) algorithm
+operating in Cipher Block Chaining (CBC) mode, commonly called
+DES\-CBC.
+Subsequently, this was replaced by the RSA Message Digest
+5 (MD5) algorithm using a private key, commonly called keyed\-MD5.
+Either algorithm computes a message digest, or one\-way hash, which
+can be used to verify the server has the correct private key and
+key identifier.
+.Pp
+NTPv4 retains the NTPv3 scheme, properly described as symmetric key
+cryptography and, in addition, provides a new Autokey scheme
+based on public key cryptography.
+Public key cryptography is generally considered more secure
+than symmetric key cryptography, since the security is based
+on a private value which is generated by each server and
+never revealed.
+With Autokey all key distribution and
+management functions involve only public values, which
+considerably simplifies key distribution and storage.
+Public key management is based on X.509 certificates,
+which can be provided by commercial services or
+produced by utility programs in the OpenSSL software library
+or the NTPv4 distribution.
+.Pp
+While the algorithms for symmetric key cryptography are
+included in the NTPv4 distribution, public key cryptography
+requires the OpenSSL software library to be installed
+before building the NTP distribution.
+Directions for doing that
+are on the Building and Installing the Distribution page.
+.Pp
+Authentication is configured separately for each association
+using the
+.Cm key
+or
+.Cm autokey
+subcommand on the
+.Ic peer ,
+.Ic server ,
+.Ic broadcast
+and
+.Ic manycastclient
+configuration commands as described in
+.Sx Configuration Options
+page.
+The authentication
+options described below specify the locations of the key files,
+if other than default, which symmetric keys are trusted
+and the interval between various operations, if other than default.
+.Pp
+Authentication is always enabled,
+although ineffective if not configured as
+described below.
+If a NTP packet arrives
+including a message authentication
+code (MAC), it is accepted only if it
+passes all cryptographic checks.
+The
+checks require correct key ID, key value
+and message digest.
+If the packet has
+been modified in any way or replayed
+by an intruder, it will fail one or more
+of these checks and be discarded.
+Furthermore, the Autokey scheme requires a
+preliminary protocol exchange to obtain
+the server certificate, verify its
+credentials and initialize the protocol
+.Pp
+The
+.Cm auth
+flag controls whether new associations or
+remote configuration commands require cryptographic authentication.
+This flag can be set or reset by the
+.Ic enable
+and
+.Ic disable
+commands and also by remote
+configuration commands sent by a
+.Xr ntpdc @NTPDC_MS@
+program running in
+another machine.
+If this flag is enabled, which is the default
+case, new broadcast client and symmetric passive associations and
+remote configuration commands must be cryptographically
+authenticated using either symmetric key or public key cryptography.
+If this
+flag is disabled, these operations are effective
+even if not cryptographic
+authenticated.
+It should be understood
+that operating with the
+.Ic auth
+flag disabled invites a significant vulnerability
+where a rogue hacker can
+masquerade as a falseticker and seriously
+disrupt system timekeeping.
+It is
+important to note that this flag has no purpose
+other than to allow or disallow
+a new association in response to new broadcast
+and symmetric active messages
+and remote configuration commands and, in particular,
+the flag has no effect on
+the authentication process itself.
+.Pp
+An attractive alternative where multicast support is available
+is manycast mode, in which clients periodically troll
+for servers as described in the
+.Sx Automatic NTP Configuration Options
+page.
+Either symmetric key or public key
+cryptographic authentication can be used in this mode.
+The principle advantage
+of manycast mode is that potential servers need not be
+configured in advance,
+since the client finds them during regular operation,
+and the configuration
+files for all clients can be identical.
+.Pp
+The security model and protocol schemes for
+both symmetric key and public key
+cryptography are summarized below;
+further details are in the briefings, papers
+and reports at the NTP project page linked from
+.Li http://www.ntp.org/ .
+.Ss Symmetric\-Key Cryptography
+The original RFC\-1305 specification allows any one of possibly
+65,534 keys, each distinguished by a 32\-bit key identifier, to
+authenticate an association.
+The servers and clients involved must
+agree on the key and key identifier to
+authenticate NTP packets.
+Keys and
+related information are specified in a key
+file, usually called
+.Pa ntp.keys ,
+which must be distributed and stored using
+secure means beyond the scope of the NTP protocol itself.
+Besides the keys used
+for ordinary NTP associations,
+additional keys can be used as passwords for the
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+utility programs.
+.Pp
+When
+.Xr ntpd @NTPD_MS@
+is first started, it reads the key file specified in the
+.Ic keys
+configuration command and installs the keys
+in the key cache.
+However,
+individual keys must be activated with the
+.Ic trusted
+command before use.
+This
+allows, for instance, the installation of possibly
+several batches of keys and
+then activating or deactivating each batch
+remotely using
+.Xr ntpdc @NTPDC_MS@ .
+This also provides a revocation capability that can be used
+if a key becomes compromised.
+The
+.Ic requestkey
+command selects the key used as the password for the
+.Xr ntpdc @NTPDC_MS@
+utility, while the
+.Ic controlkey
+command selects the key used as the password for the
+.Xr ntpq @NTPQ_MS@
+utility.
+.Ss Public Key Cryptography
+NTPv4 supports the original NTPv3 symmetric key scheme
+described in RFC\-1305 and in addition the Autokey protocol,
+which is based on public key cryptography.
+The Autokey Version 2 protocol described on the Autokey Protocol
+page verifies packet integrity using MD5 message digests
+and verifies the source with digital signatures and any of several
+digest/signature schemes.
+Optional identity schemes described on the Identity Schemes
+page and based on cryptographic challenge/response algorithms
+are also available.
+Using all of these schemes provides strong security against
+replay with or without modification, spoofing, masquerade
+and most forms of clogging attacks.
+.\" .Pp
+.\" The cryptographic means necessary for all Autokey operations
+.\" is provided by the OpenSSL software library.
+.\" This library is available from http://www.openssl.org/
+.\" and can be installed using the procedures outlined
+.\" in the Building and Installing the Distribution page.
+.\" Once installed,
+.\" the configure and build
+.\" process automatically detects the library and links
+.\" the library routines required.
+.Pp
+The Autokey protocol has several modes of operation
+corresponding to the various NTP modes supported.
+Most modes use a special cookie which can be
+computed independently by the client and server,
+but encrypted in transmission.
+All modes use in addition a variant of the S\-KEY scheme,
+in which a pseudo\-random key list is generated and used
+in reverse order.
+These schemes are described along with an executive summary,
+current status, briefing slides and reading list on the
+.Sx Autonomous Authentication
+page.
+.Pp
+The specific cryptographic environment used by Autokey servers
+and clients is determined by a set of files
+and soft links generated by the
+.Xr ntp\-keygen 1ntpkeygenmdoc
+program.
+This includes a required host key file,
+required certificate file and optional sign key file,
+leapsecond file and identity scheme files.
+The
+digest/signature scheme is specified in the X.509 certificate
+along with the matching sign key.
+There are several schemes
+available in the OpenSSL software library, each identified
+by a specific string such as
+.Cm md5WithRSAEncryption ,
+which stands for the MD5 message digest with RSA
+encryption scheme.
+The current NTP distribution supports
+all the schemes in the OpenSSL library, including
+those based on RSA and DSA digital signatures.
+.Pp
+NTP secure groups can be used to define cryptographic compartments
+and security hierarchies.
+It is important that every host
+in the group be able to construct a certificate trail to one
+or more trusted hosts in the same group.
+Each group
+host runs the Autokey protocol to obtain the certificates
+for all hosts along the trail to one or more trusted hosts.
+This requires the configuration file in all hosts to be
+engineered so that, even under anticipated failure conditions,
+the NTP subnet will form such that every group host can find
+a trail to at least one trusted host.
+.Ss Naming and Addressing
+It is important to note that Autokey does not use DNS to
+resolve addresses, since DNS can't be completely trusted
+until the name servers have synchronized clocks.
+The cryptographic name used by Autokey to bind the host identity
+credentials and cryptographic values must be independent
+of interface, network and any other naming convention.
+The name appears in the host certificate in either or both
+the subject and issuer fields, so protection against
+DNS compromise is essential.
+.Pp
+By convention, the name of an Autokey host is the name returned
+by the Unix
+.Xr gethostname 2
+system call or equivalent in other systems.
+By the system design
+model, there are no provisions to allow alternate names or aliases.
+However, this is not to say that DNS aliases, different names
+for each interface, etc., are constrained in any way.
+.Pp
+It is also important to note that Autokey verifies authenticity
+using the host name, network address and public keys,
+all of which are bound together by the protocol specifically
+to deflect masquerade attacks.
+For this reason Autokey
+includes the source and destinatino IP addresses in message digest
+computations and so the same addresses must be available
+at both the server and client.
+For this reason operation
+with network address translation schemes is not possible.
+This reflects the intended robust security model where government
+and corporate NTP servers are operated outside firewall perimeters.
+.Ss Operation
+A specific combination of authentication scheme (none,
+symmetric key, public key) and identity scheme is called
+a cryptotype, although not all combinations are compatible.
+There may be management configurations where the clients,
+servers and peers may not all support the same cryptotypes.
+A secure NTPv4 subnet can be configured in many ways while
+keeping in mind the principles explained above and
+in this section.
+Note however that some cryptotype
+combinations may successfully interoperate with each other,
+but may not represent good security practice.
+.Pp
+The cryptotype of an association is determined at the time
+of mobilization, either at configuration time or some time
+later when a message of appropriate cryptotype arrives.
+When mobilized by a
+.Ic server
+or
+.Ic peer
+configuration command and no
+.Ic key
+or
+.Ic autokey
+subcommands are present, the association is not
+authenticated; if the
+.Ic key
+subcommand is present, the association is authenticated
+using the symmetric key ID specified; if the
+.Ic autokey
+subcommand is present, the association is authenticated
+using Autokey.
+.Pp
+When multiple identity schemes are supported in the Autokey
+protocol, the first message exchange determines which one is used.
+The client request message contains bits corresponding
+to which schemes it has available.
+The server response message
+contains bits corresponding to which schemes it has available.
+Both server and client match the received bits with their own
+and select a common scheme.
+.Pp
+Following the principle that time is a public value,
+a server responds to any client packet that matches
+its cryptotype capabilities.
+Thus, a server receiving
+an unauthenticated packet will respond with an unauthenticated
+packet, while the same server receiving a packet of a cryptotype
+it supports will respond with packets of that cryptotype.
+However, unconfigured broadcast or manycast client
+associations or symmetric passive associations will not be
+mobilized unless the server supports a cryptotype compatible
+with the first packet received.
+By default, unauthenticated associations will not be mobilized
+unless overridden in a decidedly dangerous way.
+.Pp
+Some examples may help to reduce confusion.
+Client Alice has no specific cryptotype selected.
+Server Bob has both a symmetric key file and minimal Autokey files.
+Alice's unauthenticated messages arrive at Bob, who replies with
+unauthenticated messages.
+Cathy has a copy of Bob's symmetric
+key file and has selected key ID 4 in messages to Bob.
+Bob verifies the message with his key ID 4.
+If it's the
+same key and the message is verified, Bob sends Cathy a reply
+authenticated with that key.
+If verification fails,
+Bob sends Cathy a thing called a crypto\-NAK, which tells her
+something broke.
+She can see the evidence using the
+.Xr ntpq @NTPQ_MS@
+program.
+.Pp
+Denise has rolled her own host key and certificate.
+She also uses one of the identity schemes as Bob.
+She sends the first Autokey message to Bob and they
+both dance the protocol authentication and identity steps.
+If all comes out okay, Denise and Bob continue as described above.
+.Pp
+It should be clear from the above that Bob can support
+all the girls at the same time, as long as he has compatible
+authentication and identity credentials.
+Now, Bob can act just like the girls in his own choice of servers;
+he can run multiple configured associations with multiple different
+servers (or the same server, although that might not be useful).
+But, wise security policy might preclude some cryptotype
+combinations; for instance, running an identity scheme
+with one server and no authentication with another might not be wise.
+.Ss Key Management
+The cryptographic values used by the Autokey protocol are
+incorporated as a set of files generated by the
+.Xr ntp\-keygen 1ntpkeygenmdoc
+utility program, including symmetric key, host key and
+public certificate files, as well as sign key, identity parameters
+and leapseconds files.
+Alternatively, host and sign keys and
+certificate files can be generated by the OpenSSL utilities
+and certificates can be imported from public certificate
+authorities.
+Note that symmetric keys are necessary for the
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+utility programs.
+The remaining files are necessary only for the
+Autokey protocol.
+.Pp
+Certificates imported from OpenSSL or public certificate
+authorities have certian limitations.
+The certificate should be in ASN.1 syntax, X.509 Version 3
+format and encoded in PEM, which is the same format
+used by OpenSSL.
+The overall length of the certificate encoded
+in ASN.1 must not exceed 1024 bytes.
+The subject distinguished
+name field (CN) is the fully qualified name of the host
+on which it is used; the remaining subject fields are ignored.
+The certificate extension fields must not contain either
+a subject key identifier or a issuer key identifier field;
+however, an extended key usage field for a trusted host must
+contain the value
+.Cm trustRoot ; .
+Other extension fields are ignored.
+.Ss Authentication Commands
+.Bl -tag -width indent
+.It Ic autokey Op Ar logsec
+Specifies the interval between regenerations of the session key
+list used with the Autokey protocol.
+Note that the size of the key
+list for each association depends on this interval and the current
+poll interval.
+The default value is 12 (4096 s or about 1.1 hours).
+For poll intervals above the specified interval, a session key list
+with a single entry will be regenerated for every message
+sent.
+.It Ic controlkey Ar key
+Specifies the key identifier to use with the
+.Xr ntpq @NTPQ_MS@
+utility, which uses the standard
+protocol defined in RFC\-1305.
+The
+.Ar key
+argument is
+the key identifier for a trusted key, where the value can be in the
+range 1 to 65,534, inclusive.
+.It Xo Ic crypto
+.Op Cm cert Ar file
+.Op Cm leap Ar file
+.Op Cm randfile Ar file
+.Op Cm host Ar file
+.Op Cm sign Ar file
+.Op Cm gq Ar file
+.Op Cm gqpar Ar file
+.Op Cm iffpar Ar file
+.Op Cm mvpar Ar file
+.Op Cm pw Ar password
+.Xc
+This command requires the OpenSSL library.
+It activates public key
+cryptography, selects the message digest and signature
+encryption scheme and loads the required private and public
+values described above.
+If one or more files are left unspecified,
+the default names are used as described above.
+Unless the complete path and name of the file are specified, the
+location of a file is relative to the keys directory specified
+in the
+.Ic keysdir
+command or default
+.Pa /usr/local/etc .
+Following are the subcommands:
+.Bl -tag -width indent
+.It Cm cert Ar file
+Specifies the location of the required host public certificate file.
+This overrides the link
+.Pa ntpkey_cert_ Ns Ar hostname
+in the keys directory.
+.It Cm gqpar Ar file
+Specifies the location of the optional GQ parameters file.
+This
+overrides the link
+.Pa ntpkey_gq_ Ns Ar hostname
+in the keys directory.
+.It Cm host Ar file
+Specifies the location of the required host key file.
+This overrides
+the link
+.Pa ntpkey_key_ Ns Ar hostname
+in the keys directory.
+.It Cm iffpar Ar file
+Specifies the location of the optional IFF parameters file.This
+overrides the link
+.Pa ntpkey_iff_ Ns Ar hostname
+in the keys directory.
+.It Cm leap Ar file
+Specifies the location of the optional leapsecond file.
+This overrides the link
+.Pa ntpkey_leap
+in the keys directory.
+.It Cm mvpar Ar file
+Specifies the location of the optional MV parameters file.
+This
+overrides the link
+.Pa ntpkey_mv_ Ns Ar hostname
+in the keys directory.
+.It Cm pw Ar password
+Specifies the password to decrypt files containing private keys and
+identity parameters.
+This is required only if these files have been
+encrypted.
+.It Cm randfile Ar file
+Specifies the location of the random seed file used by the OpenSSL
+library.
+The defaults are described in the main text above.
+.It Cm sign Ar file
+Specifies the location of the optional sign key file.
+This overrides
+the link
+.Pa ntpkey_sign_ Ns Ar hostname
+in the keys directory.
+If this file is
+not found, the host key is also the sign key.
+.El
+.It Ic keys Ar keyfile
+Specifies the complete path and location of the MD5 key file
+containing the keys and key identifiers used by
+.Xr ntpd @NTPD_MS@ ,
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+when operating with symmetric key cryptography.
+This is the same operation as the
+.Fl k
+command line option.
+.It Ic keysdir Ar path
+This command specifies the default directory path for
+cryptographic keys, parameters and certificates.
+The default is
+.Pa /usr/local/etc/ .
+.It Ic requestkey Ar key
+Specifies the key identifier to use with the
+.Xr ntpdc @NTPDC_MS@
+utility program, which uses a
+proprietary protocol specific to this implementation of
+.Xr ntpd @NTPD_MS@ .
+The
+.Ar key
+argument is a key identifier
+for the trusted key, where the value can be in the range 1 to
+65,534, inclusive.
+.It Ic revoke Ar logsec
+Specifies the interval between re\-randomization of certain
+cryptographic values used by the Autokey scheme, as a power of 2 in
+seconds.
+These values need to be updated frequently in order to
+deflect brute\-force attacks on the algorithms of the scheme;
+however, updating some values is a relatively expensive operation.
+The default interval is 16 (65,536 s or about 18 hours).
+For poll
+intervals above the specified interval, the values will be updated
+for every message sent.
+.It Ic trustedkey Ar key ...
+Specifies the key identifiers which are trusted for the
+purposes of authenticating peers with symmetric key cryptography,
+as well as keys used by the
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+programs.
+The authentication procedures require that both the local
+and remote servers share the same key and key identifier for this
+purpose, although different keys can be used with different
+servers.
+The
+.Ar key
+arguments are 32\-bit unsigned
+integers with values from 1 to 65,534.
+.El
+.Ss Error Codes
+The following error codes are reported via the NTP control
+and monitoring protocol trap mechanism.
+.Bl -tag -width indent
+.It 101
+.Pq bad field format or length
+The packet has invalid version, length or format.
+.It 102
+.Pq bad timestamp
+The packet timestamp is the same or older than the most recent received.
+This could be due to a replay or a server clock time step.
+.It 103
+.Pq bad filestamp
+The packet filestamp is the same or older than the most recent received.
+This could be due to a replay or a key file generation error.
+.It 104
+.Pq bad or missing public key
+The public key is missing, has incorrect format or is an unsupported type.
+.It 105
+.Pq unsupported digest type
+The server requires an unsupported digest/signature scheme.
+.It 106
+.Pq mismatched digest types
+Not used.
+.It 107
+.Pq bad signature length
+The signature length does not match the current public key.
+.It 108
+.Pq signature not verified
+The message fails the signature check.
+It could be bogus or signed by a
+different private key.
+.It 109
+.Pq certificate not verified
+The certificate is invalid or signed with the wrong key.
+.It 110
+.Pq certificate not verified
+The certificate is not yet valid or has expired or the signature could not
+be verified.
+.It 111
+.Pq bad or missing cookie
+The cookie is missing, corrupted or bogus.
+.It 112
+.Pq bad or missing leapseconds table
+The leapseconds table is missing, corrupted or bogus.
+.It 113
+.Pq bad or missing certificate
+The certificate is missing, corrupted or bogus.
+.It 114
+.Pq bad or missing identity
+The identity key is missing, corrupt or bogus.
+.El
+.Sh Monitoring Support
+.Xr ntpd @NTPD_MS@
+includes a comprehensive monitoring facility suitable
+for continuous, long term recording of server and client
+timekeeping performance.
+See the
+.Ic statistics
+command below
+for a listing and example of each type of statistics currently
+supported.
+Statistic files are managed using file generation sets
+and scripts in the
+.Pa ./scripts
+directory of this distribution.
+Using
+these facilities and
+.Ux
+.Xr cron 8
+jobs, the data can be
+automatically summarized and archived for retrospective analysis.
+.Ss Monitoring Commands
+.Bl -tag -width indent
+.It Ic statistics Ar name ...
+Enables writing of statistics records.
+Currently, eight kinds of
+.Ar name
+statistics are supported.
+.Bl -tag -width indent
+.It Cm clockstats
+Enables recording of clock driver statistics information.
+Each update
+received from a clock driver appends a line of the following form to
+the file generation set named
+.Cm clockstats :
+.Bd -literal
+49213 525.624 127.127.4.1 93 226 00:08:29.606 D
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the
+clock address in dotted\-quad notation.
+The final field shows the last
+timecode received from the clock in decoded ASCII format, where
+meaningful.
+In some clock drivers a good deal of additional information
+can be gathered and displayed as well.
+See information specific to each
+clock for further details.
+.It Cm cryptostats
+This option requires the OpenSSL cryptographic software library.
+It
+enables recording of cryptographic public key protocol information.
+Each message received by the protocol module appends a line of the
+following form to the file generation set named
+.Cm cryptostats :
+.Bd -literal
+49213 525.624 127.127.4.1 message
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The next field shows the peer
+address in dotted\-quad notation, The final message field includes the
+message type and certain ancillary information.
+See the
+.Sx Authentication Options
+section for further information.
+.It Cm loopstats
+Enables recording of loop filter statistics information.
+Each
+update of the local clock outputs a line of the following form to
+the file generation set named
+.Cm loopstats :
+.Bd -literal
+50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next five fields
+show time offset (seconds), frequency offset (parts per million \-
+PPM), RMS jitter (seconds), Allan deviation (PPM) and clock
+discipline time constant.
+.It Cm peerstats
+Enables recording of peer statistics information.
+This includes
+statistics records of all peers of a NTP server and of special
+signals, where present and configured.
+Each valid update appends a
+line of the following form to the current element of a file
+generation set named
+.Cm peerstats :
+.Bd -literal
+48773 10847.650 127.127.4.1 9714 \-0.001605376 0.000000000 0.001424877 0.000958674
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the peer address in dotted\-quad notation and status,
+respectively.
+The status field is encoded in hex in the format
+described in Appendix A of the NTP specification RFC 1305.
+The final four fields show the offset,
+delay, dispersion and RMS jitter, all in seconds.
+.It Cm rawstats
+Enables recording of raw\-timestamp statistics information.
+This
+includes statistics records of all peers of a NTP server and of
+special signals, where present and configured.
+Each NTP message
+received from a peer or clock driver appends a line of the
+following form to the file generation set named
+.Cm rawstats :
+.Bd -literal
+50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and
+time (seconds and fraction past UTC midnight).
+The next two fields
+show the remote peer or clock address followed by the local address
+in dotted\-quad notation.
+The final four fields show the originate,
+receive, transmit and final NTP timestamps in order.
+The timestamp
+values are as received and before processing by the various data
+smoothing and mitigation algorithms.
+.It Cm sysstats
+Enables recording of ntpd statistics counters on a periodic basis.
+Each
+hour a line of the following form is appended to the file generation
+set named
+.Cm sysstats :
+.Bd -literal
+50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147
+.Ed
+.Pp
+The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight).
+The remaining ten fields show
+the statistics counter values accumulated since the last generated
+line.
+.Bl -tag -width indent
+.It Time since restart Cm 36000
+Time in hours since the system was last rebooted.
+.It Packets received Cm 81965
+Total number of packets received.
+.It Packets processed Cm 0
+Number of packets received in response to previous packets sent
+.It Current version Cm 9546
+Number of packets matching the current NTP version.
+.It Previous version Cm 56
+Number of packets matching the previous NTP version.
+.It Bad version Cm 71793
+Number of packets matching neither NTP version.
+.It Access denied Cm 512
+Number of packets denied access for any reason.
+.It Bad length or format Cm 540
+Number of packets with invalid length, format or port number.
+.It Bad authentication Cm 10
+Number of packets not verified as authentic.
+.It Rate exceeded Cm 147
+Number of packets discarded due to rate limitation.
+.El
+.It Cm statsdir Ar directory_path
+Indicates the full path of a directory where statistics files
+should be created (see below).
+This keyword allows
+the (otherwise constant)
+.Cm filegen
+filename prefix to be modified for file generation sets, which
+is useful for handling statistics logs.
+.It Cm filegen Ar name Xo
+.Op Cm file Ar filename
+.Op Cm type Ar typename
+.Op Cm link | nolink
+.Op Cm enable | disable
+.Xc
+Configures setting of generation file set name.
+Generation
+file sets provide a means for handling files that are
+continuously growing during the lifetime of a server.
+Server statistics are a typical example for such files.
+Generation file sets provide access to a set of files used
+to store the actual data.
+At any time at most one element
+of the set is being written to.
+The type given specifies
+when and how data will be directed to a new element of the set.
+This way, information stored in elements of a file set
+that are currently unused are available for administrational
+operations without the risk of disturbing the operation of ntpd.
+(Most important: they can be removed to free space for new data
+produced.)
+.Pp
+Note that this command can be sent from the
+.Xr ntpdc @NTPDC_MS@
+program running at a remote location.
+.Bl -tag -width indent
+.It Cm name
+This is the type of the statistics records, as shown in the
+.Cm statistics
+command.
+.It Cm file Ar filename
+This is the file name for the statistics records.
+Filenames of set
+members are built from three concatenated elements
+.Ar Cm prefix ,
+.Ar Cm filename
+and
+.Ar Cm suffix :
+.Bl -tag -width indent
+.It Cm prefix
+This is a constant filename path.
+It is not subject to
+modifications via the
+.Ar filegen
+option.
+It is defined by the
+server, usually specified as a compile\-time constant.
+It may,
+however, be configurable for individual file generation sets
+via other commands.
+For example, the prefix used with
+.Ar loopstats
+and
+.Ar peerstats
+generation can be configured using the
+.Ar statsdir
+option explained above.
+.It Cm filename
+This string is directly concatenated to the prefix mentioned
+above (no intervening
+.Ql / ) .
+This can be modified using
+the file argument to the
+.Ar filegen
+statement.
+No
+.Pa ..
+elements are
+allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by
+.Ar prefix .
+.It Cm suffix
+This part is reflects individual elements of a file set.
+It is
+generated according to the type of a file set.
+.El
+.It Cm type Ar typename
+A file generation set is characterized by its type.
+The following
+types are supported:
+.Bl -tag -width indent
+.It Cm none
+The file set is actually a single plain file.
+.It Cm pid
+One element of file set is used per incarnation of a ntpd
+server.
+This type does not perform any changes to file set
+members during runtime, however it provides an easy way of
+separating files belonging to different
+.Xr ntpd @NTPD_MS@
+server incarnations.
+The set member filename is built by appending a
+.Ql \&.
+to concatenated
+.Ar prefix
+and
+.Ar filename
+strings, and
+appending the decimal representation of the process ID of the
+.Xr ntpd @NTPD_MS@
+server process.
+.It Cm day
+One file generation set element is created per day.
+A day is
+defined as the period between 00:00 and 24:00 UTC.
+The file set
+member suffix consists of a
+.Ql \&.
+and a day specification in
+the form
+.Cm YYYYMMdd .
+.Cm YYYY
+is a 4\-digit year number (e.g., 1992).
+.Cm MM
+is a two digit month number.
+.Cm dd
+is a two digit day number.
+Thus, all information written at 10 December 1992 would end up
+in a file named
+.Ar prefix
+.Ar filename Ns .19921210 .
+.It Cm week
+Any file set member contains data related to a certain week of
+a year.
+The term week is defined by computing day\-of\-year
+modulo 7.
+Elements of such a file generation set are
+distinguished by appending the following suffix to the file set
+filename base: A dot, a 4\-digit year number, the letter
+.Cm W ,
+and a 2\-digit week number.
+For example, information from January,
+10th 1992 would end up in a file with suffix
+.No . Ns Ar 1992W1 .
+.It Cm month
+One generation file set element is generated per month.
+The
+file name suffix consists of a dot, a 4\-digit year number, and
+a 2\-digit month.
+.It Cm year
+One generation file element is generated per year.
+The filename
+suffix consists of a dot and a 4 digit year number.
+.It Cm age
+This type of file generation sets changes to a new element of
+the file set every 24 hours of server operation.
+The filename
+suffix consists of a dot, the letter
+.Cm a ,
+and an 8\-digit number.
+This number is taken to be the number of seconds the server is
+running at the start of the corresponding 24\-hour period.
+Information is only written to a file generation by specifying
+.Cm enable ;
+output is prevented by specifying
+.Cm disable .
+.El
+.It Cm link | nolink
+It is convenient to be able to access the current element of a file
+generation set by a fixed name.
+This feature is enabled by
+specifying
+.Cm link
+and disabled using
+.Cm nolink .
+If link is specified, a
+hard link from the current file set element to a file without
+suffix is created.
+When there is already a file with this name and
+the number of links of this file is one, it is renamed appending a
+dot, the letter
+.Cm C ,
+and the pid of the ntpd server process.
+When the
+number of links is greater than one, the file is unlinked.
+This
+allows the current file to be accessed by a constant name.
+.It Cm enable \&| Cm disable
+Enables or disables the recording function.
+.El
+.El
+.El
+.Sh Access Control Support
+The
+.Xr ntpd @NTPD_MS@
+daemon implements a general purpose address/mask based restriction
+list.
+The list contains address/match entries sorted first
+by increasing address values and and then by increasing mask values.
+A match occurs when the bitwise AND of the mask and the packet
+source address is equal to the bitwise AND of the mask and
+address in the list.
+The list is searched in order with the
+last match found defining the restriction flags associated
+with the entry.
+Additional information and examples can be found in the
+.Qq Notes on Configuring NTP and Setting up a NTP Subnet
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Pp
+The restriction facility was implemented in conformance
+with the access policies for the original NSFnet backbone
+time servers.
+Later the facility was expanded to deflect
+cryptographic and clogging attacks.
+While this facility may
+be useful for keeping unwanted or broken or malicious clients
+from congesting innocent servers, it should not be considered
+an alternative to the NTP authentication facilities.
+Source address based restrictions are easily circumvented
+by a determined cracker.
+.Pp
+Clients can be denied service because they are explicitly
+included in the restrict list created by the restrict command
+or implicitly as the result of cryptographic or rate limit
+violations.
+Cryptographic violations include certificate
+or identity verification failure; rate limit violations generally
+result from defective NTP implementations that send packets
+at abusive rates.
+Some violations cause denied service
+only for the offending packet, others cause denied service
+for a timed period and others cause the denied service for
+an indefinate period.
+When a client or network is denied access
+for an indefinate period, the only way at present to remove
+the restrictions is by restarting the server.
+.Ss The Kiss\-of\-Death Packet
+Ordinarily, packets denied service are simply dropped with no
+further action except incrementing statistics counters.
+Sometimes a
+more proactive response is needed, such as a server message that
+explicitly requests the client to stop sending and leave a message
+for the system operator.
+A special packet format has been created
+for this purpose called the "kiss\-of\-death" (KoD) packet.
+KoD packets have the leap bits set unsynchronized and stratum set
+to zero and the reference identifier field set to a four\-byte
+ASCII code.
+If the
+.Cm noserve
+or
+.Cm notrust
+flag of the matching restrict list entry is set,
+the code is "DENY"; if the
+.Cm limited
+flag is set and the rate limit
+is exceeded, the code is "RATE".
+Finally, if a cryptographic violation occurs, the code is "CRYP".
+.Pp
+A client receiving a KoD performs a set of sanity checks to
+minimize security exposure, then updates the stratum and
+reference identifier peer variables, sets the access
+denied (TEST4) bit in the peer flash variable and sends
+a message to the log.
+As long as the TEST4 bit is set,
+the client will send no further packets to the server.
+The only way at present to recover from this condition is
+to restart the protocol at both the client and server.
+This
+happens automatically at the client when the association times out.
+It will happen at the server only if the server operator cooperates.
+.Ss Access Control Commands
+.Bl -tag -width indent
+.It Xo Ic discard
+.Op Cm average Ar avg
+.Op Cm minimum Ar min
+.Op Cm monitor Ar prob
+.Xc
+Set the parameters of the
+.Cm limited
+facility which protects the server from
+client abuse.
+The
+.Cm average
+subcommand specifies the minimum average packet
+spacing, while the
+.Cm minimum
+subcommand specifies the minimum packet spacing.
+Packets that violate these minima are discarded
+and a kiss\-o'\-death packet returned if enabled.
+The default
+minimum average and minimum are 5 and 2, respectively.
+The monitor subcommand specifies the probability of discard
+for packets that overflow the rate\-control window.
+.It Xo Ic restrict address
+.Op Cm mask Ar mask
+.Op Ar flag ...
+.Xc
+The
+.Ar address
+argument expressed in
+dotted\-quad form is the address of a host or network.
+Alternatively, the
+.Ar address
+argument can be a valid host DNS name.
+The
+.Ar mask
+argument expressed in dotted\-quad form defaults to
+.Cm 255.255.255.255 ,
+meaning that the
+.Ar address
+is treated as the address of an individual host.
+A default entry (address
+.Cm 0.0.0.0 ,
+mask
+.Cm 0.0.0.0 )
+is always included and is always the first entry in the list.
+Note that text string
+.Cm default ,
+with no mask option, may
+be used to indicate the default entry.
+In the current implementation,
+.Cm flag
+always
+restricts access, i.e., an entry with no flags indicates that free
+access to the server is to be given.
+The flags are not orthogonal,
+in that more restrictive flags will often make less restrictive
+ones redundant.
+The flags can generally be classed into two
+categories, those which restrict time service and those which
+restrict informational queries and attempts to do run\-time
+reconfiguration of the server.
+One or more of the following flags
+may be specified:
+.Bl -tag -width indent
+.It Cm ignore
+Deny packets of all kinds, including
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+queries.
+.It Cm kod
+If this flag is set when an access violation occurs, a kiss\-o'\-death
+(KoD) packet is sent.
+KoD packets are rate limited to no more than one
+per second.
+If another KoD packet occurs within one second after the
+last one, the packet is dropped.
+.It Cm limited
+Deny service if the packet spacing violates the lower limits specified
+in the discard command.
+A history of clients is kept using the
+monitoring capability of
+.Xr ntpd @NTPD_MS@ .
+Thus, monitoring is always active as
+long as there is a restriction entry with the
+.Cm limited
+flag.
+.It Cm lowpriotrap
+Declare traps set by matching hosts to be low priority.
+The
+number of traps a server can maintain is limited (the current limit
+is 3).
+Traps are usually assigned on a first come, first served
+basis, with later trap requestors being denied service.
+This flag
+modifies the assignment algorithm by allowing low priority traps to
+be overridden by later requests for normal priority traps.
+.It Cm nomodify
+Deny
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+queries which attempt to modify the state of the
+server (i.e., run time reconfiguration).
+Queries which return
+information are permitted.
+.It Cm noquery
+Deny
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+queries.
+Time service is not affected.
+.It Cm nopeer
+Deny packets which would result in mobilizing a new association.
+This
+includes broadcast and symmetric active packets when a configured
+association does not exist.
+It also includes
+.Cm pool
+associations, so if you want to use servers from a
+.Cm pool
+directive and also want to use
+.Cm nopeer
+by default, you'll want a
+.Cm "restrict source ..." line as well that does
+.It not
+include the
+.Cm nopeer
+directive.
+.It Cm noserve
+Deny all packets except
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+queries.
+.It Cm notrap
+Decline to provide mode 6 control message trap service to matching
+hosts.
+The trap service is a subsystem of the ntpdq control message
+protocol which is intended for use by remote event logging programs.
+.It Cm notrust
+Deny service unless the packet is cryptographically authenticated.
+.It Cm ntpport
+This is actually a match algorithm modifier, rather than a
+restriction flag.
+Its presence causes the restriction entry to be
+matched only if the source port in the packet is the standard NTP
+UDP port (123).
+Both
+.Cm ntpport
+and
+.Cm non\-ntpport
+may
+be specified.
+The
+.Cm ntpport
+is considered more specific and
+is sorted later in the list.
+.It Cm version
+Deny packets that do not match the current NTP version.
+.El
+.Pp
+Default restriction list entries with the flags ignore, interface,
+ntpport, for each of the local host's interface addresses are
+inserted into the table at startup to prevent the server
+from attempting to synchronize to its own time.
+A default entry is also always present, though if it is
+otherwise unconfigured; no flags are associated
+with the default entry (i.e., everything besides your own
+NTP server is unrestricted).
+.El
+.Sh Automatic NTP Configuration Options
+.Ss Manycasting
+Manycasting is a automatic discovery and configuration paradigm
+new to NTPv4.
+It is intended as a means for a multicast client
+to troll the nearby network neighborhood to find cooperating
+manycast servers, validate them using cryptographic means
+and evaluate their time values with respect to other servers
+that might be lurking in the vicinity.
+The intended result is that each manycast client mobilizes
+client associations with some number of the "best"
+of the nearby manycast servers, yet automatically reconfigures
+to sustain this number of servers should one or another fail.
+.Pp
+Note that the manycasting paradigm does not coincide
+with the anycast paradigm described in RFC\-1546,
+which is designed to find a single server from a clique
+of servers providing the same service.
+The manycast paradigm is designed to find a plurality
+of redundant servers satisfying defined optimality criteria.
+.Pp
+Manycasting can be used with either symmetric key
+or public key cryptography.
+The public key infrastructure (PKI)
+offers the best protection against compromised keys
+and is generally considered stronger, at least with relatively
+large key sizes.
+It is implemented using the Autokey protocol and
+the OpenSSL cryptographic library available from
+.Li http://www.openssl.org/ .
+The library can also be used with other NTPv4 modes
+as well and is highly recommended, especially for broadcast modes.
+.Pp
+A persistent manycast client association is configured
+using the manycastclient command, which is similar to the
+server command but with a multicast (IPv4 class
+.Cm D
+or IPv6 prefix
+.Cm FF )
+group address.
+The IANA has designated IPv4 address 224.1.1.1
+and IPv6 address FF05::101 (site local) for NTP.
+When more servers are needed, it broadcasts manycast
+client messages to this address at the minimum feasible rate
+and minimum feasible time\-to\-live (TTL) hops, depending
+on how many servers have already been found.
+There can be as many manycast client associations
+as different group address, each one serving as a template
+for a future ephemeral unicast client/server association.
+.Pp
+Manycast servers configured with the
+.Ic manycastserver
+command listen on the specified group address for manycast
+client messages.
+Note the distinction between manycast client,
+which actively broadcasts messages, and manycast server,
+which passively responds to them.
+If a manycast server is
+in scope of the current TTL and is itself synchronized
+to a valid source and operating at a stratum level equal
+to or lower than the manycast client, it replies to the
+manycast client message with an ordinary unicast server message.
+.Pp
+The manycast client receiving this message mobilizes
+an ephemeral client/server association according to the
+matching manycast client template, but only if cryptographically
+authenticated and the server stratum is less than or equal
+to the client stratum.
+Authentication is explicitly required
+and either symmetric key or public key (Autokey) can be used.
+Then, the client polls the server at its unicast address
+in burst mode in order to reliably set the host clock
+and validate the source.
+This normally results
+in a volley of eight client/server at 2\-s intervals
+during which both the synchronization and cryptographic
+protocols run concurrently.
+Following the volley,
+the client runs the NTP intersection and clustering
+algorithms, which act to discard all but the "best"
+associations according to stratum and synchronization
+distance.
+The surviving associations then continue
+in ordinary client/server mode.
+.Pp
+The manycast client polling strategy is designed to reduce
+as much as possible the volume of manycast client messages
+and the effects of implosion due to near\-simultaneous
+arrival of manycast server messages.
+The strategy is determined by the
+.Ic manycastclient ,
+.Ic tos
+and
+.Ic ttl
+configuration commands.
+The manycast poll interval is
+normally eight times the system poll interval,
+which starts out at the
+.Cm minpoll
+value specified in the
+.Ic manycastclient ,
+command and, under normal circumstances, increments to the
+.Cm maxpolll
+value specified in this command.
+Initially, the TTL is
+set at the minimum hops specified by the ttl command.
+At each retransmission the TTL is increased until reaching
+the maximum hops specified by this command or a sufficient
+number client associations have been found.
+Further retransmissions use the same TTL.
+.Pp
+The quality and reliability of the suite of associations
+discovered by the manycast client is determined by the NTP
+mitigation algorithms and the
+.Cm minclock
+and
+.Cm minsane
+values specified in the
+.Ic tos
+configuration command.
+At least
+.Cm minsane
+candidate servers must be available and the mitigation
+algorithms produce at least
+.Cm minclock
+survivors in order to synchronize the clock.
+Byzantine agreement principles require at least four
+candidates in order to correctly discard a single falseticker.
+For legacy purposes,
+.Cm minsane
+defaults to 1 and
+.Cm minclock
+defaults to 3.
+For manycast service
+.Cm minsane
+should be explicitly set to 4, assuming at least that
+number of servers are available.
+.Pp
+If at least
+.Cm minclock
+servers are found, the manycast poll interval is immediately
+set to eight times
+.Cm maxpoll .
+If less than
+.Cm minclock
+servers are found when the TTL has reached the maximum hops,
+the manycast poll interval is doubled.
+For each transmission
+after that, the poll interval is doubled again until
+reaching the maximum of eight times
+.Cm maxpoll .
+Further transmissions use the same poll interval and
+TTL values.
+Note that while all this is going on,
+each client/server association found is operating normally
+it the system poll interval.
+.Pp
+Administratively scoped multicast boundaries are normally
+specified by the network router configuration and,
+in the case of IPv6, the link/site scope prefix.
+By default, the increment for TTL hops is 32 starting
+from 31; however, the
+.Ic ttl
+configuration command can be
+used to modify the values to match the scope rules.
+.Pp
+It is often useful to narrow the range of acceptable
+servers which can be found by manycast client associations.
+Because manycast servers respond only when the client
+stratum is equal to or greater than the server stratum,
+primary (stratum 1) servers fill find only primary servers
+in TTL range, which is probably the most common objective.
+However, unless configured otherwise, all manycast clients
+in TTL range will eventually find all primary servers
+in TTL range, which is probably not the most common
+objective in large networks.
+The
+.Ic tos
+command can be used to modify this behavior.
+Servers with stratum below
+.Cm floor
+or above
+.Cm ceiling
+specified in the
+.Ic tos
+command are strongly discouraged during the selection
+process; however, these servers may be temporally
+accepted if the number of servers within TTL range is
+less than
+.Cm minclock .
+.Pp
+The above actions occur for each manycast client message,
+which repeats at the designated poll interval.
+However, once the ephemeral client association is mobilized,
+subsequent manycast server replies are discarded,
+since that would result in a duplicate association.
+If during a poll interval the number of client associations
+falls below
+.Cm minclock ,
+all manycast client prototype associations are reset
+to the initial poll interval and TTL hops and operation
+resumes from the beginning.
+It is important to avoid
+frequent manycast client messages, since each one requires
+all manycast servers in TTL range to respond.
+The result could well be an implosion, either minor or major,
+depending on the number of servers in range.
+The recommended value for
+.Cm maxpoll
+is 12 (4,096 s).
+.Pp
+It is possible and frequently useful to configure a host
+as both manycast client and manycast server.
+A number of hosts configured this way and sharing a common
+group address will automatically organize themselves
+in an optimum configuration based on stratum and
+synchronization distance.
+For example, consider an NTP
+subnet of two primary servers and a hundred or more
+dependent clients.
+With two exceptions, all servers
+and clients have identical configuration files including both
+.Ic multicastclient
+and
+.Ic multicastserver
+commands using, for instance, multicast group address
+239.1.1.1.
+The only exception is that each primary server
+configuration file must include commands for the primary
+reference source such as a GPS receiver.
+.Pp
+The remaining configuration files for all secondary
+servers and clients have the same contents, except for the
+.Ic tos
+command, which is specific for each stratum level.
+For stratum 1 and stratum 2 servers, that command is
+not necessary.
+For stratum 3 and above servers the
+.Cm floor
+value is set to the intended stratum number.
+Thus, all stratum 3 configuration files are identical,
+all stratum 4 files are identical and so forth.
+.Pp
+Once operations have stabilized in this scenario,
+the primary servers will find the primary reference source
+and each other, since they both operate at the same
+stratum (1), but not with any secondary server or client,
+since these operate at a higher stratum.
+The secondary
+servers will find the servers at the same stratum level.
+If one of the primary servers loses its GPS receiver,
+it will continue to operate as a client and other clients
+will time out the corresponding association and
+re\-associate accordingly.
+.Pp
+Some administrators prefer to avoid running
+.Xr ntpd @NTPD_MS@
+continuously and run either
+.Xr ntpdate 8
+or
+.Xr ntpd @NTPD_MS@
+.Fl q
+as a cron job.
+In either case the servers must be
+configured in advance and the program fails if none are
+available when the cron job runs.
+A really slick
+application of manycast is with
+.Xr ntpd @NTPD_MS@
+.Fl q .
+The program wakes up, scans the local landscape looking
+for the usual suspects, selects the best from among
+the rascals, sets the clock and then departs.
+Servers do not have to be configured in advance and
+all clients throughout the network can have the same
+configuration file.
+.Ss Manycast Interactions with Autokey
+Each time a manycast client sends a client mode packet
+to a multicast group address, all manycast servers
+in scope generate a reply including the host name
+and status word.
+The manycast clients then run
+the Autokey protocol, which collects and verifies
+all certificates involved.
+Following the burst interval
+all but three survivors are cast off,
+but the certificates remain in the local cache.
+It often happens that several complete signing trails
+from the client to the primary servers are collected in this way.
+.Pp
+About once an hour or less often if the poll interval
+exceeds this, the client regenerates the Autokey key list.
+This is in general transparent in client/server mode.
+However, about once per day the server private value
+used to generate cookies is refreshed along with all
+manycast client associations.
+In this case all
+cryptographic values including certificates is refreshed.
+If a new certificate has been generated since
+the last refresh epoch, it will automatically revoke
+all prior certificates that happen to be in the
+certificate cache.
+At the same time, the manycast
+scheme starts all over from the beginning and
+the expanding ring shrinks to the minimum and increments
+from there while collecting all servers in scope.
+.Ss Manycast Options
+.Bl -tag -width indent
+.It Xo Ic tos
+.Oo
+.Cm ceiling Ar ceiling |
+.Cm cohort { 0 | 1 } |
+.Cm floor Ar floor |
+.Cm minclock Ar minclock |
+.Cm minsane Ar minsane
+.Oc
+.Xc
+This command affects the clock selection and clustering
+algorithms.
+It can be used to select the quality and
+quantity of peers used to synchronize the system clock
+and is most useful in manycast mode.
+The variables operate
+as follows:
+.Bl -tag -width indent
+.It Cm ceiling Ar ceiling
+Peers with strata above
+.Cm ceiling
+will be discarded if there are at least
+.Cm minclock
+peers remaining.
+This value defaults to 15, but can be changed
+to any number from 1 to 15.
+.It Cm cohort Bro 0 | 1 Brc
+This is a binary flag which enables (0) or disables (1)
+manycast server replies to manycast clients with the same
+stratum level.
+This is useful to reduce implosions where
+large numbers of clients with the same stratum level
+are present.
+The default is to enable these replies.
+.It Cm floor Ar floor
+Peers with strata below
+.Cm floor
+will be discarded if there are at least
+.Cm minclock
+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
+associations until no more than
+.Cm minclock
+associations remain.
+This value defaults to 3,
+but can be changed to any number from 1 to the number of
+configured sources.
+.It Cm minsane Ar minsane
+This is the minimum number of candidates available
+to the clock selection algorithm in order to produce
+one or more truechimers for the clustering algorithm.
+If fewer than this number are available, the clock is
+undisciplined and allowed to run free.
+The default is 1
+for legacy purposes.
+However, according to principles of
+Byzantine agreement,
+.Cm minsane
+should be at least 4 in order to detect and discard
+a single falseticker.
+.El
+.It Cm ttl Ar hop ...
+This command specifies a list of TTL values in increasing
+order, up to 8 values can be specified.
+In manycast mode these values are used in turn
+in an expanding\-ring search.
+The default is eight
+multiples of 32 starting at 31.
+.El
+.Sh Reference Clock Support
+The NTP Version 4 daemon supports some three dozen different radio,
+satellite and modem reference clocks plus a special pseudo\-clock
+used for backup or when no other clock source is available.
+Detailed descriptions of individual device drivers and options can
+be found in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+Additional information can be found in the pages linked
+there, including the
+.Qq Debugging Hints for Reference Clock Drivers
+and
+.Qq How To Write a Reference Clock Driver
+pages
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+In addition, support for a PPS
+signal is available as described in the
+.Qq Pulse\-per\-second (PPS) Signal Interfacing
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+Many
+drivers support special line discipline/streams modules which can
+significantly improve the accuracy using the driver.
+These are
+described in the
+.Qq Line Disciplines and Streams Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.Pp
+A reference clock will generally (though not always) be a radio
+timecode receiver which is synchronized to a source of standard
+time such as the services offered by the NRC in Canada and NIST and
+USNO in the US.
+The interface between the computer and the timecode
+receiver is device dependent, but is usually a serial port.
+A
+device driver specific to each reference clock must be selected and
+compiled in the distribution; however, most common radio, satellite
+and modem clocks are included by default.
+Note that an attempt to
+configure a reference clock when the driver has not been compiled
+or the hardware port has not been appropriately configured results
+in a scalding remark to the system log file, but is otherwise non
+hazardous.
+.Pp
+For the purposes of configuration,
+.Xr ntpd @NTPD_MS@
+treats
+reference clocks in a manner analogous to normal NTP peers as much
+as possible.
+Reference clocks are identified by a syntactically
+correct but invalid IP address, in order to distinguish them from
+normal NTP peers.
+Reference clock addresses are of the form
+.Sm off
+.Li 127.127. Ar t . Ar u ,
+.Sm on
+where
+.Ar t
+is an integer
+denoting the clock type and
+.Ar u
+indicates the unit
+number in the range 0\-3.
+While it may seem overkill, it is in fact
+sometimes useful to configure multiple reference clocks of the same
+type, in which case the unit numbers must be unique.
+.Pp
+The
+.Ic server
+command is used to configure a reference
+clock, where the
+.Ar address
+argument in that command
+is the clock address.
+The
+.Cm key ,
+.Cm version
+and
+.Cm ttl
+options are not used for reference clock support.
+The
+.Cm mode
+option is added for reference clock support, as
+described below.
+The
+.Cm prefer
+option can be useful to
+persuade the server to cherish a reference clock with somewhat more
+enthusiasm than other reference clocks or peers.
+Further
+information on this option can be found in the
+.Qq Mitigation Rules and the prefer Keyword
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+page.
+The
+.Cm minpoll
+and
+.Cm maxpoll
+options have
+meaning only for selected clock drivers.
+See the individual clock
+driver document pages for additional information.
+.Pp
+The
+.Ic fudge
+command is used to provide additional
+information for individual clock drivers and normally follows
+immediately after the
+.Ic server
+command.
+The
+.Ar address
+argument specifies the clock address.
+The
+.Cm refid
+and
+.Cm stratum
+options can be used to
+override the defaults for the device.
+There are two optional
+device\-dependent time offsets and four flags that can be included
+in the
+.Ic fudge
+command as well.
+.Pp
+The stratum number of a reference clock is by default zero.
+Since the
+.Xr ntpd @NTPD_MS@
+daemon adds one to the stratum of each
+peer, a primary server ordinarily displays an external stratum of
+one.
+In order to provide engineered backups, it is often useful to
+specify the reference clock stratum as greater than zero.
+The
+.Cm stratum
+option is used for this purpose.
+Also, in cases
+involving both a reference clock and a pulse\-per\-second (PPS)
+discipline signal, it is useful to specify the reference clock
+identifier as other than the default, depending on the driver.
+The
+.Cm refid
+option is used for this purpose.
+Except where noted,
+these options apply to all clock drivers.
+.Ss Reference Clock Commands
+.Bl -tag -width indent
+.It Xo Ic server
+.Sm off
+.Li 127.127. Ar t . Ar u
+.Sm on
+.Op Cm prefer
+.Op Cm mode Ar int
+.Op Cm minpoll Ar int
+.Op Cm maxpoll Ar int
+.Xc
+This command can be used to configure reference clocks in
+special ways.
+The options are interpreted as follows:
+.Bl -tag -width indent
+.It Cm prefer
+Marks the reference clock as preferred.
+All other things being
+equal, this host will be chosen for synchronization among a set of
+correctly operating hosts.
+See the
+.Qq Mitigation Rules and the prefer Keyword
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+for further information.
+.It Cm mode Ar int
+Specifies a mode number which is interpreted in a
+device\-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.It Cm minpoll Ar int
+.It Cm maxpoll Ar int
+These options specify the minimum and maximum polling interval
+for reference clock messages, as a power of 2 in seconds
+For
+most directly connected reference clocks, both
+.Cm minpoll
+and
+.Cm maxpoll
+default to 6 (64 s).
+For modem reference clocks,
+.Cm minpoll
+defaults to 10 (17.1 m) and
+.Cm maxpoll
+defaults to 14 (4.5 h).
+The allowable range is 4 (16 s) to 17 (36.4 h) inclusive.
+.El
+.It Xo Ic fudge
+.Sm off
+.Li 127.127. Ar t . Ar u
+.Sm on
+.Op Cm time1 Ar sec
+.Op Cm time2 Ar sec
+.Op Cm stratum Ar int
+.Op Cm refid Ar string
+.Op Cm mode Ar int
+.Op Cm flag1 Cm 0 \&| Cm 1
+.Op Cm flag2 Cm 0 \&| Cm 1
+.Op Cm flag3 Cm 0 \&| Cm 1
+.Op Cm flag4 Cm 0 \&| Cm 1
+.Xc
+This command can be used to configure reference clocks in
+special ways.
+It must immediately follow the
+.Ic server
+command which configures the driver.
+Note that the same capability
+is possible at run time using the
+.Xr ntpdc @NTPDC_MS@
+program.
+The options are interpreted as
+follows:
+.Bl -tag -width indent
+.It Cm time1 Ar sec
+Specifies a constant to be added to the time offset produced by
+the driver, a fixed\-point decimal number in seconds.
+This is used
+as a calibration constant to adjust the nominal time offset of a
+particular clock to agree with an external standard, such as a
+precision PPS signal.
+It also provides a way to correct a
+systematic error or bias due to serial port or operating system
+latencies, different cable lengths or receiver internal delay.
+The
+specified offset is in addition to the propagation delay provided
+by other means, such as internal DIPswitches.
+Where a calibration
+for an individual system and driver is available, an approximate
+correction is noted in the driver documentation pages.
+Note: in order to facilitate calibration when more than one
+radio clock or PPS signal is supported, a special calibration
+feature is available.
+It takes the form of an argument to the
+.Ic enable
+command described in
+.Sx Miscellaneous Options
+page and operates as described in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.It Cm time2 Ar secs
+Specifies a fixed\-point decimal number in seconds, which is
+interpreted in a driver\-dependent way.
+See the descriptions of
+specific drivers in the
+.Qq Reference Clock Drivers
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+.It Cm stratum Ar int
+Specifies the stratum number assigned to the driver, an integer
+between 0 and 15.
+This number overrides the default stratum number
+ordinarily assigned by the driver itself, usually zero.
+.It Cm refid Ar string
+Specifies an ASCII string of from one to four characters which
+defines the reference identifier used by the driver.
+This string
+overrides the default identifier ordinarily assigned by the driver
+itself.
+.It Cm mode Ar int
+Specifies a mode number which is interpreted in a
+device\-specific fashion.
+For instance, it selects a dialing
+protocol in the ACTS driver and a device subtype in the
+parse
+drivers.
+.It Cm flag1 Cm 0 \&| Cm 1
+.It Cm flag2 Cm 0 \&| Cm 1
+.It Cm flag3 Cm 0 \&| Cm 1
+.It Cm flag4 Cm 0 \&| Cm 1
+These four flags are used for customizing the clock driver.
+The
+interpretation of these values, and whether they are used at all,
+is a function of the particular clock driver.
+However, by
+convention
+.Cm flag4
+is used to enable recording monitoring
+data to the
+.Cm clockstats
+file configured with the
+.Ic filegen
+command.
+Further information on the
+.Ic filegen
+command can be found in
+.Sx Monitoring Options .
+.El
+.El
+.Sh Miscellaneous Options
+.Bl -tag -width indent
+.It Ic broadcastdelay Ar seconds
+The broadcast and multicast modes require a special calibration
+to determine the network delay between the local and remote
+servers.
+Ordinarily, this is done automatically by the initial
+protocol exchanges between the client and server.
+In some cases,
+the calibration procedure may fail due to network or server access
+controls, for example.
+This command specifies the default delay to
+be used under these circumstances.
+Typically (for Ethernet), a
+number between 0.003 and 0.007 seconds is appropriate.
+The default
+when this command is not used is 0.004 seconds.
+.It Ic calldelay Ar delay
+This option controls the delay in seconds between the first and second
+packets sent in burst or iburst mode to allow additional time for a modem
+or ISDN call to complete.
+.It Ic driftfile Ar driftfile
+This command specifies the complete path and name of the file used to
+record the frequency of the local clock oscillator.
+This is the same
+operation as the
+.Fl f
+command line option.
+If the file exists, it is read at
+startup in order to set the initial frequency and then updated once per
+hour with the current frequency computed by the daemon.
+If the file name is
+specified, but the file itself does not exist, the starts with an initial
+frequency of zero and creates the file when writing it for the first time.
+If this command is not given, the daemon will always start with an initial
+frequency of zero.
+.Pp
+The file format consists of a single line containing a single
+floating point number, which records the frequency offset measured
+in parts\-per\-million (PPM).
+The file is updated by first writing
+the current drift value into a temporary file and then renaming
+this file to replace the old version.
+This implies that
+.Xr ntpd @NTPD_MS@
+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 Xo Ic enable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm mode7 | monitor |
+.Cm ntp | Cm stats
+.Oc
+.Xc
+.It Xo Ic disable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm mode7 | monitor |
+.Cm ntp | Cm stats
+.Oc
+.Xc
+Provides a way to enable or disable various server options.
+Flags not mentioned are unaffected.
+Note that all of these flags
+can be controlled remotely using the
+.Xr ntpdc @NTPDC_MS@
+utility program.
+.Bl -tag -width indent
+.It Cm auth
+Enables the server to synchronize with unconfigured peers only if the
+peer has been correctly authenticated using either public key or
+private key cryptography.
+The default for this flag is
+.Ic enable .
+.It Cm bclient
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the
+.Ic multicastclient
+command with default
+address.
+The default for this flag is
+.Ic disable .
+.It Cm calibrate
+Enables the calibrate feature for reference clocks.
+The default for
+this flag is
+.Ic disable .
+.It Cm kernel
+Enables the kernel time discipline, if available.
+The default for this
+flag is
+.Ic enable
+if support is available, otherwise
+.Ic disable .
+.It Cm mode7
+Enables processing of NTP mode 7 implementation\-specific requests
+which are used by the deprecated
+.Xr ntpdc @NTPDC_MS@
+program.
+The default for this flag is disable.
+This flag is excluded from runtime configuration using
+.Xr ntpq @NTPQ_MS@ .
+The
+.Xr ntpq @NTPQ_MS@
+program provides the same capabilities as
+.Xr ntpdc @NTPDC_MS@
+using standard mode 6 requests.
+.It Cm monitor
+Enables the monitoring facility.
+See the
+.Xr ntpdc @NTPDC_MS@
+program
+and the
+.Ic monlist
+command or further information.
+The
+default for this flag is
+.Ic enable .
+.It Cm ntp
+Enables time and frequency discipline.
+In effect, this switch opens and
+closes the feedback loop, which is useful for testing.
+The default for
+this flag is
+.Ic enable .
+.It Cm stats
+Enables the statistics facility.
+See the
+.Sx Monitoring Options
+section for further information.
+The default for this flag is
+.Ic disable .
+.El
+.It Ic includefile Ar includefile
+This command allows additional configuration commands
+to be included from a separate file.
+Include files may
+be nested to a depth of five; upon reaching the end of any
+include file, command processing resumes in the previous
+configuration file.
+This option is useful for sites that run
+.Xr ntpd @NTPD_MS@
+on multiple hosts, with (mostly) common options (e.g., a
+restriction list).
+.It Ic logconfig Ar configkeyword
+This command controls the amount and type of output written to
+the system
+.Xr syslog 3
+facility or the alternate
+.Ic logfile
+log file.
+By default, all output is turned on.
+All
+.Ar configkeyword
+keywords can be prefixed with
+.Ql = ,
+.Ql +
+and
+.Ql \- ,
+where
+.Ql =
+sets the
+.Xr syslog 3
+priority mask,
+.Ql +
+adds and
+.Ql \-
+removes
+messages.
+.Xr syslog 3
+messages can be controlled in four
+classes
+.Po
+.Cm clock ,
+.Cm peer ,
+.Cm sys
+and
+.Cm sync
+.Pc .
+Within these classes four types of messages can be
+controlled: informational messages
+.Po
+.Cm info
+.Pc ,
+event messages
+.Po
+.Cm events
+.Pc ,
+statistics messages
+.Po
+.Cm statistics
+.Pc
+and
+status messages
+.Po
+.Cm status
+.Pc .
+.Pp
+Configuration keywords are formed by concatenating the message class with
+the event class.
+The
+.Cm all
+prefix can be used instead of a message class.
+A
+message class may also be followed by the
+.Cm all
+keyword to enable/disable all
+messages of the respective message class.Thus, a minimal log configuration
+could look like this:
+.Bd -literal
+logconfig =syncstatus +sysevents
+.Ed
+.Pp
+This would just list the synchronizations state of
+.Xr ntpd @NTPD_MS@
+and the major system events.
+For a simple reference server, the
+following minimum message configuration could be useful:
+.Bd -literal
+logconfig =syncall +clockall
+.Ed
+.Pp
+This configuration will list all clock information and
+synchronization information.
+All other events and messages about
+peers, system events and so on is suppressed.
+.It Ic logfile Ar logfile
+This command specifies the location of an alternate log file to
+be used instead of the default system
+.Xr syslog 3
+facility.
+This is the same operation as the \-l command line option.
+.It Ic setvar Ar variable Op Cm default
+This command adds an additional system variable.
+These
+variables can be used to distribute additional information such as
+the access policy.
+If the variable of the form
+.Sm off
+.Va name = Ar value
+.Sm on
+is followed by the
+.Cm default
+keyword, the
+variable will be listed as part of the default system variables
+.Po
+.Xr ntpq @NTPQ_MS@
+.Ic rv
+command
+.Pc ) .
+These additional variables serve
+informational purposes only.
+They are not related to the protocol
+other that they can be listed.
+The known protocol variables will
+always override any variables defined via the
+.Ic setvar
+mechanism.
+There are three special variables that contain the names
+of all variable of the same group.
+The
+.Va sys_var_list
+holds
+the names of all system variables.
+The
+.Va peer_var_list
+holds
+the names of all peer variables and the
+.Va clock_var_list
+holds the names of the reference clock variables.
+.It Xo Ic tinker
+.Oo
+.Cm allan Ar allan |
+.Cm dispersion Ar dispersion |
+.Cm freq Ar freq |
+.Cm huffpuff Ar huffpuff |
+.Cm panic Ar panic |
+.Cm step Ar srep |
+.Cm stepout Ar stepout
+.Oc
+.Xc
+This command can be used to alter several system variables in
+very exceptional circumstances.
+It should occur in the
+configuration file before any other configuration options.
+The
+default values of these variables have been carefully optimized for
+a wide range of network speeds and reliability expectations.
+In
+general, they interact in intricate ways that are hard to predict
+and some combinations can result in some very nasty behavior.
+Very
+rarely is it necessary to change the default values; but, some
+folks cannot resist twisting the knobs anyway and this command is
+for them.
+Emphasis added: twisters are on their own and can expect
+no help from the support group.
+.Pp
+The variables operate as follows:
+.Bl -tag -width indent
+.It Cm allan Ar allan
+The argument becomes the new value for the minimum Allan
+intercept, which is a parameter of the PLL/FLL clock discipline
+algorithm.
+The value in log2 seconds defaults to 7 (1024 s), which is also the lower
+limit.
+.It Cm dispersion Ar dispersion
+The argument becomes the new value for the dispersion increase rate,
+normally .000015 s/s.
+.It Cm freq Ar freq
+The argument becomes the initial value of the frequency offset in
+parts\-per\-million.
+This overrides the value in the frequency file, if
+present, and avoids the initial training state if it is not.
+.It Cm huffpuff Ar huffpuff
+The argument becomes the new value for the experimental
+huff\-n'\-puff filter span, which determines the most recent interval
+the algorithm will search for a minimum delay.
+The lower limit is
+900 s (15 m), but a more reasonable value is 7200 (2 hours).
+There
+is no default, since the filter is not enabled unless this command
+is given.
+.It Cm panic Ar panic
+The argument is the panic threshold, normally 1000 s.
+If set to zero,
+the panic sanity check is disabled and a clock offset of any value will
+be accepted.
+.It Cm step Ar step
+The argument is the step threshold, which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if the step threshold is set to zero or greater than the
+default.
+.It Cm stepout Ar stepout
+The argument is the stepout timeout, which by default is 900 s.
+It can
+be set to any positive number in seconds.
+If set to zero, the stepout
+pulses will not be suppressed.
+.El
+.It Xo Ic rlimit
+.Oo
+.Cm memlock Ar Nmegabytes |
+.Cm stacksize Ar N4kPages
+.Cm filenum Ar Nfiledescriptors
+.Oc
+.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
+when dropping root (the
+.Fl i
+option).
+The default is 32 megabytes. Setting this to zero will prevent any attemp to lock 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).
+.El
+.It Xo Ic trap Ar host_address
+.Op Cm port Ar port_number
+.Op Cm interface Ar interface_address
+.Xc
+This command configures a trap receiver at the given host
+address and port number for sending messages with the specified
+local interface address.
+If the port number is unspecified, a value
+of 18447 is used.
+If the interface address is not specified, the
+message is sent with a source address of the local interface the
+message is sent through.
+Note that on a multihomed host the
+interface used may vary from time to time with routing changes.
+.Pp
+The trap receiver will generally log event messages and other
+information from the server in a log file.
+While such monitor
+programs may also request their own trap dynamically, configuring a
+trap receiver will ensure that no messages are lost when the server
+is started.
+.It Cm hop Ar ...
+This command specifies a list of TTL values in increasing order, up to 8
+values can be specified.
+In manycast mode these values are used in turn in
+an expanding\-ring search.
+The default is eight multiples of 32 starting at
+31.
+.El
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTP_CONF_<option\-name>\fP or \fBNTP_CONF\fP
+.fi
+.ad
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh FILES
+.Bl -tag -width /etc/ntp.drift -compact
+.It Pa /etc/ntp.conf
+the default name of the configuration file
+.It Pa ntp.keys
+private MD5 keys
+.It Pa ntpkey
+RSA private key
+.It Pa ntpkey_ Ns Ar host
+RSA public key
+.It Pa ntp_dh
+Diffie\-Hellman agreement parameters
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntpd @NTPD_MS@ ,
+.Xr ntpdc @NTPDC_MS@ ,
+.Xr ntpq @NTPQ_MS@
+.Pp
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+.Li http://www.ntp.org/ .
+A snapshot of this documentation is available in HTML format in
+.Pa /usr/share/doc/ntp .
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 4)
+.%O RFC5905
+.Re
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+The syntax checking is not picky; some combinations of
+ridiculous and even hilarious options and modes may not be
+detected.
+.Pp
+The
+.Pa ntpkey_ Ns Ar host
+files are really digital
+certificates.
+These should be obtained via secure directory
+services when they become universally available.
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+This document was derived from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp.conf\fP
+option definitions.
diff --git a/ntpd/ntp.conf.texi b/ntpd/ntp.conf.texi
new file mode 100644
index 0000000..fb1a7ab
--- /dev/null
+++ b/ntpd/ntp.conf.texi
@@ -0,0 +1,49 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntp.conf.info
+@settitle NTP Configuration File User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of the NTP Project's NTP configuration file,
+version @value{VERSION}, @value{UPDATED}.
+@end ifinfo
+
+@direntry
+* ntp.conf: (ntp.conf). NTP's configuration file
+@end direntry
+
+@titlepage
+@title NTP's Configuration File User's Manual
+@subtitle ntp.conf, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntp.conf Description, (dir), (dir)
+@top NTP's Configuration File User Manual
+
+This document describes the configuration file for the NTP Project's
+@code{ntpd} program.
+
+This document applies to version @value{VERSION} of @code{ntp.conf}.
+
+@shortcontents
+
+@menu
+* ntp.conf Description::
+* ntp.conf Notes::
+@end menu
+
+@node ntp.conf Description, , Top, Top
+@comment node-name, next, previous, up
+@section Description
+
+The behavior of @code{ntpd} can be changed by a configuration file,
+by default @code{ntp.conf}.
+
+@include invoke-ntp.conf.texi
diff --git a/ntpd/ntp.keys.5man b/ntpd/ntp.keys.5man
new file mode 100644
index 0000000..52acb7f
--- /dev/null
+++ b/ntpd/ntp.keys.5man
@@ -0,0 +1,173 @@
+.TH ntp.keys 5man "02 Dec 2014" "4.2.7p482" "File Formats"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (ntp.man)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:42 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.keys.def
+.\" and the template file agman-file.tpl
+.Sh NAME
+.Nm ntp.keys
+.Nd NTP symmetric key file format
+
+.\"
+.SH NAME
+ntp.keys \- NTP symmetric key file format configuration file
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.SH SYNOPSIS
+\f\*[B-Font]\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+This document describes the format of an NTP symmetric key file.
+For a description of the use of this type of file, see the
+"Authentication Support"
+section of the
+\fCntp.conf\fR(5)\f[]
+page.
+.sp \n(Ppu
+.ne 2
+
+\fCntpd\fR(8)\f[]
+reads its keys from a file specified using the
+\f\*[B-Font]\-k\f[]
+command line option or the
+\f\*[B-Font]keys\f[]
+statement in the configuration file.
+While key number 0 is fixed by the NTP standard
+(as 56 zero bits)
+and may not be changed,
+one or more keys numbered between 1 and 65534
+may be arbitrarily set in the keys file.
+.sp \n(Ppu
+.ne 2
+
+The key file uses the same comment conventions
+as the configuration file.
+Key entries use a fixed format of the form
+.sp \n(Ppu
+.ne 2
+
+.in +4
+\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
+.in -4
+.sp \n(Ppu
+.ne 2
+
+where
+\f\*[I-Font]keyno\f[]
+is a positive integer (between 1 and 65534),
+\f\*[I-Font]type\f[]
+is the message digest algorithm,
+and
+\f\*[I-Font]key\f[]
+is the key itself.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[I-Font]key\f[]
+may be given in a format
+controlled by the
+\f\*[I-Font]type\f[]
+field.
+The
+\f\*[I-Font]type\f[]
+\f[C]MD5\f[]
+is always supported.
+If
+\f[C]ntpd\f[]
+was built with the OpenSSL library
+then any digest library supported by that library may be specified.
+However, if compliance with FIPS 140-2 is required the
+\f\*[I-Font]type\f[]
+must be either
+\f[C]SHA\f[]
+or
+\f[C]SHA1\f[].
+.sp \n(Ppu
+.ne 2
+
+What follows are some key types, and corresponding formats:
+.sp \n(Ppu
+.ne 2
+
+.TP 7
+.NOP \f[C]MD5\f[]
+The key is 1 to 16 printable characters terminated by
+an EOL,
+whitespace,
+or
+a
+\f[C]#\f[]
+(which is the "start of comment" character).
+.sp \n(Ppu
+.ne 2
+
+.br
+.ns
+.TP 7
+.NOP \f[C]SHA\f[]
+.br
+.ns
+.TP 7
+.NOP \f[C]SHA1\f[]
+.br
+.ns
+.TP 7
+.NOP \f[C]RMD160\f[]
+The key is a hex-encoded ASCII string of 40 characters,
+which is truncated as necessary.
+.PP
+.sp \n(Ppu
+.ne 2
+
+Note that the keys used by the
+\fCntpq\fR(8)\f[]
+and
+\fCntpdc\fR(8)\f[]
+programs are checked against passwords
+requested by the programs and entered by hand,
+so it is generally appropriate to specify these keys in ASCII format.
+.SH FILES
+.TP 14
+.NOP \fI/etc/ntp.keys\f[]
+the default name of the configuration file
+.PP
+.SH "SEE ALSO"
+\fCntp.conf\fR(5)\f[],
+\fCntpd\fR(1ntpdmdoc)\f[],
+\fCntpdate\fR(1ntpdatemdoc)\f[],
+\fCntpdc\fR(1ntpdcmdoc)\f[],
+\fCsntp\fR(1sntpmdoc)\f[]
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+This document was derived from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp.keys\fP
+option definitions.
diff --git a/ntpd/ntp.keys.5mdoc b/ntpd/ntp.keys.5mdoc
new file mode 100644
index 0000000..56ad9c1
--- /dev/null
+++ b/ntpd/ntp.keys.5mdoc
@@ -0,0 +1,158 @@
+.Dd December 2 2014
+.Dt NTP_KEYS 5mdoc File Formats
+.Os SunOS 5.10
+.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:01 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.keys.def
+.\" and the template file agmdoc-file.tpl
+.Sh NAME
+.Nm ntp.keys
+.Nd NTP symmetric key file format
+
+.Sh NAME
+.Nm ntp.keys
+.Nd NTP symmetric key file format
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+This document describes the format of an NTP symmetric key file.
+For a description of the use of this type of file, see the
+.Qq Authentication Support
+section of the
+.Xr ntp.conf 5
+page.
+.Pp
+.Xr ntpd 8
+reads its keys from a file specified using the
+.Fl k
+command line option or the
+.Ic keys
+statement in the configuration file.
+While key number 0 is fixed by the NTP standard
+(as 56 zero bits)
+and may not be changed,
+one or more keys numbered between 1 and 65534
+may be arbitrarily set in the keys file.
+.Pp
+The key file uses the same comment conventions
+as the configuration file.
+Key entries use a fixed format of the form
+.Pp
+.D1 Ar keyno type key
+.Pp
+where
+.Ar keyno
+is a positive integer (between 1 and 65534),
+.Ar type
+is the message digest algorithm,
+and
+.Ar key
+is the key itself.
+.Pp
+The
+.Ar key
+may be given in a format
+controlled by the
+.Ar type
+field.
+The
+.Ar type
+.Li MD5
+is always supported.
+If
+.Li ntpd
+was built with the OpenSSL library
+then any digest library supported by that library may be specified.
+However, if compliance with FIPS 140\-2 is required the
+.Ar type
+must be either
+.Li SHA
+or
+.Li SHA1 .
+.Pp
+What follows are some key types, and corresponding formats:
+.Pp
+.Bl -tag -width RMD160 -compact
+.It Li MD5
+The key is 1 to 16 printable characters terminated by
+an EOL,
+whitespace,
+or
+a
+.Li #
+(which is the "start of comment" character).
+.Pp
+.It Li SHA
+.It Li SHA1
+.It Li RMD160
+The key is a hex\-encoded ASCII string of 40 characters,
+which is truncated as necessary.
+.El
+.Pp
+Note that the keys used by the
+.Xr ntpq 8
+and
+.Xr ntpdc 8
+programs are checked against passwords
+requested by the programs and entered by hand,
+so it is generally appropriate to specify these keys in ASCII format.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTP_KEYS_<option\-name>\fP or \fBNTP_KEYS\fP
+.fi
+.ad
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh FILES
+.Bl -tag -width /etc/ntp.keys -compact
+.It Pa /etc/ntp.keys
+the default name of the configuration file
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntp.conf 5 ,
+.Xr ntpd 1ntpdmdoc ,
+.Xr ntpdate 1ntpdatemdoc ,
+.Xr ntpdc 1ntpdcmdoc ,
+.Xr sntp 1sntpmdoc
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+This document was derived from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp.keys\fP
+option definitions.
diff --git a/ntpd/ntp.keys.def b/ntpd/ntp.keys.def
new file mode 100644
index 0000000..dcb3d55
--- /dev/null
+++ b/ntpd/ntp.keys.def
@@ -0,0 +1,152 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include copyright.def
+#include version.def
+
+// We want the synopsis to be "/etc/ntp.keys" but we need the prog-name
+// to be ntp.keys - the latter is also how autogen produces the output
+// file name.
+prog-name = "ntp.keys";
+file-path = "/etc/ntp.keys";
+prog-title = "NTP symmetric key file format";
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+This document describes the format of an NTP symmetric key file.
+For a description of the use of this type of file, see the
+.Qq Authentication Support
+section of the
+.Xr ntp.conf 5
+page.
+.Pp
+.Xr ntpd 8
+reads its keys from a file specified using the
+.Fl k
+command line option or the
+.Ic keys
+statement in the configuration file.
+While key number 0 is fixed by the NTP standard
+(as 56 zero bits)
+and may not be changed,
+one or more keys numbered between 1 and 65534
+may be arbitrarily set in the keys file.
+.Pp
+The key file uses the same comment conventions
+as the configuration file.
+Key entries use a fixed format of the form
+.Pp
+.D1 Ar keyno type key
+.Pp
+where
+.Ar keyno
+is a positive integer (between 1 and 65534),
+.Ar type
+is the message digest algorithm,
+and
+.Ar key
+is the key itself.
+.Pp
+The
+.Ar key
+may be given in a format
+controlled by the
+.Ar type
+field.
+The
+.Ar type
+.Li MD5
+is always supported.
+If
+.Li ntpd
+was built with the OpenSSL library
+then any digest library supported by that library may be specified.
+However, if compliance with FIPS 140-2 is required the
+.Ar type
+must be either
+.Li SHA
+or
+.Li SHA1 .
+.Pp
+What follows are some key types, and corresponding formats:
+.Pp
+.Bl -tag -width RMD160 -compact
+.It Li MD5
+The key is 1 to 16 printable characters terminated by
+an EOL,
+whitespace,
+or
+a
+.Li #
+(which is the "start of comment" character).
+.Pp
+.It Li SHA
+.It Li SHA1
+.It Li RMD160
+The key is a hex-encoded ASCII string of 40 characters,
+which is truncated as necessary.
+.El
+.Pp
+Note that the keys used by the
+.Xr ntpq 8
+and
+.Xr ntpdc 8
+programs are checked against passwords
+requested by the programs and entered by hand,
+so it is generally appropriate to specify these keys in ASCII format.
+ _END_PROG_MDOC_DESCRIP;
+};
+
+doc-section = {
+ ds-type = 'FILES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_FILES
+.Bl -tag -width /etc/ntp.keys -compact
+.It Pa /etc/ntp.keys
+the default name of the configuration file
+.El
+ _END_MDOC_FILES;
+};
+
+doc-section = {
+ ds-type = 'SEE ALSO';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_SEE_ALSO
+.Xr ntp.conf 5 ,
+.Xr ntpd 1ntpdmdoc ,
+.Xr ntpdate 1ntpdatemdoc ,
+.Xr ntpdc 1ntpdcmdoc ,
+.Xr sntp 1sntpmdoc
+ _END_MDOC_SEE_ALSO;
+};
+
+/*
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+.Xr ntpd 8
+has gotten rather fat.
+While not huge, it has gotten larger than might
+be desirable for an elevated-priority daemon running on a workstation,
+particularly since many of the fancy features which consume the space
+were designed more with a busy primary server, rather than a high
+stratum workstation, in mind.
+ _END_MDOC_BUGS;
+};
+*/
+
+doc-section = {
+ ds-type = 'NOTES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_NOTES
+This document was derived from FreeBSD.
+ _END_MDOC_NOTES;
+};
diff --git a/ntpd/ntp.keys.html b/ntpd/ntp.keys.html
new file mode 100644
index 0000000..ab4b9b7
--- /dev/null
+++ b/ntpd/ntp.keys.html
@@ -0,0 +1,200 @@
+<html lang="en">
+<head>
+<title>NTP Symmetric Key</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="NTP Symmetric Key">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">NTP Symmetric Key</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002ekeys-Description">ntp.keys Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">NTP's Symmetric Key File User Manual</h2>
+
+<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.7p482 of <code>ntp.keys</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">NTP's Symmetric Key File User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002ekeys-Description">ntp.keys Description</a>
+<li><a accesskey="2" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002ekeys-Description"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>The name and location of the symmetric key file for <code>ntpd</code> can
+be specified in a configuration file, by default <code>/etc/ntp.keys</code>.
+
+<div class="node">
+<p><hr>
+<a name="ntp_002ekeys-Notes"></a>
+<br>
+</div>
+
+<h3 class="section">Notes about ntp.keys</h3>
+
+<p><a name="index-ntp_002ekeys-1"></a><a name="index-NTP-symmetric-key-file-format-2"></a>
+
+ <p>This document describes the format of an NTP symmetric key file.
+For a description of the use of this type of file, see the
+"Authentication Support"
+section of the
+<code>ntp.conf(5)</code>
+page.
+
+ <p><code>ntpd(8)</code>
+reads its keys from a file specified using the
+<code>-k</code>
+command line option or the
+<code>keys</code>
+statement in the configuration file.
+While key number 0 is fixed by the NTP standard
+(as 56 zero bits)
+and may not be changed,
+one or more keys numbered between 1 and 65534
+may be arbitrarily set in the keys file.
+
+ <p>The key file uses the same comment conventions
+as the configuration file.
+Key entries use a fixed format of the form
+
+<pre class="example"> <kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd>
+</pre>
+ <p>where
+<kbd>keyno</kbd>
+is a positive integer (between 1 and 65534),
+<kbd>type</kbd>
+is the message digest algorithm,
+and
+<kbd>key</kbd>
+is the key itself.
+
+ <p>The
+<kbd>key</kbd>
+may be given in a format
+controlled by the
+<kbd>type</kbd>
+field.
+The
+<kbd>type</kbd>
+<code>MD5</code>
+is always supported.
+If
+<code>ntpd</code>
+was built with the OpenSSL library
+then any digest library supported by that library may be specified.
+However, if compliance with FIPS 140-2 is required the
+<kbd>type</kbd>
+must be either
+<code>SHA</code>
+or
+<code>SHA1</code>.
+
+ <p>What follows are some key types, and corresponding formats:
+
+ <dl>
+<dt><code>MD5</code><dd>The key is 1 to 16 printable characters terminated by
+an EOL,
+whitespace,
+or
+a
+<code>#</code>
+(which is the "start of comment" character).
+
+ <br><dt><code>SHA</code><br><dt><code>SHA1</code><br><dt><code>RMD160</code><dd>The key is a hex-encoded ASCII string of 40 characters,
+which is truncated as necessary.
+</dl>
+
+ <p>Note that the keys used by the
+<code>ntpq(8)</code>
+and
+<code>ntpdc(8)</code>
+programs are checked against passwords
+requested by the programs and entered by hand,
+so it is generally appropriate to specify these keys in ASCII format.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp.keys</code> program.
+This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002ekeys-Files">ntp.keys Files</a>: Files
+<li><a accesskey="2" href="#ntp_002ekeys-See-Also">ntp.keys See Also</a>: See Also
+<li><a accesskey="3" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>: Notes
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002ekeys-Files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002ekeys-See-Also">ntp.keys See Also</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp.keys Files</h4>
+
+ <dl>
+<dt><span class="file">/etc/ntp.keys</span><dd>the default name of the configuration file
+</dl>
+<div class="node">
+<p><hr>
+<a name="ntp_002ekeys-See-Also"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002ekeys-Files">ntp.keys Files</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp.keys See Also</h4>
+
+<p><code>ntp.conf(5)</code>,
+<code>ntpd(1ntpdmdoc)</code>,
+<code>ntpdate(1ntpdatemdoc)</code>,
+<code>ntpdc(1ntpdcmdoc)</code>,
+<code>sntp(1sntpmdoc)</code>
+<div class="node">
+<p><hr>
+<a name="ntp_002ekeys-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002ekeys-See-Also">ntp.keys See Also</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002ekeys-Notes">ntp.keys Notes</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp.keys Notes</h4>
+
+<p>This document was derived from FreeBSD.
+
+</body></html>
+
diff --git a/ntpd/ntp.keys.man.in b/ntpd/ntp.keys.man.in
new file mode 100644
index 0000000..943b27e
--- /dev/null
+++ b/ntpd/ntp.keys.man.in
@@ -0,0 +1,173 @@
+.TH ntp.keys 5 "02 Dec 2014" "4.2.7p482" "File Formats"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (ntp.man)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:42 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.keys.def
+.\" and the template file agman-file.tpl
+.Sh NAME
+.Nm ntp.keys
+.Nd NTP symmetric key file format
+
+.\"
+.SH NAME
+ntp.keys \- NTP symmetric key file format configuration file
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.SH SYNOPSIS
+\f\*[B-Font]\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+This document describes the format of an NTP symmetric key file.
+For a description of the use of this type of file, see the
+"Authentication Support"
+section of the
+\fCntp.conf\fR(5)\f[]
+page.
+.sp \n(Ppu
+.ne 2
+
+\fCntpd\fR(8)\f[]
+reads its keys from a file specified using the
+\f\*[B-Font]\-k\f[]
+command line option or the
+\f\*[B-Font]keys\f[]
+statement in the configuration file.
+While key number 0 is fixed by the NTP standard
+(as 56 zero bits)
+and may not be changed,
+one or more keys numbered between 1 and 65534
+may be arbitrarily set in the keys file.
+.sp \n(Ppu
+.ne 2
+
+The key file uses the same comment conventions
+as the configuration file.
+Key entries use a fixed format of the form
+.sp \n(Ppu
+.ne 2
+
+.in +4
+\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
+.in -4
+.sp \n(Ppu
+.ne 2
+
+where
+\f\*[I-Font]keyno\f[]
+is a positive integer (between 1 and 65534),
+\f\*[I-Font]type\f[]
+is the message digest algorithm,
+and
+\f\*[I-Font]key\f[]
+is the key itself.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[I-Font]key\f[]
+may be given in a format
+controlled by the
+\f\*[I-Font]type\f[]
+field.
+The
+\f\*[I-Font]type\f[]
+\f[C]MD5\f[]
+is always supported.
+If
+\f[C]ntpd\f[]
+was built with the OpenSSL library
+then any digest library supported by that library may be specified.
+However, if compliance with FIPS 140-2 is required the
+\f\*[I-Font]type\f[]
+must be either
+\f[C]SHA\f[]
+or
+\f[C]SHA1\f[].
+.sp \n(Ppu
+.ne 2
+
+What follows are some key types, and corresponding formats:
+.sp \n(Ppu
+.ne 2
+
+.TP 7
+.NOP \f[C]MD5\f[]
+The key is 1 to 16 printable characters terminated by
+an EOL,
+whitespace,
+or
+a
+\f[C]#\f[]
+(which is the "start of comment" character).
+.sp \n(Ppu
+.ne 2
+
+.br
+.ns
+.TP 7
+.NOP \f[C]SHA\f[]
+.br
+.ns
+.TP 7
+.NOP \f[C]SHA1\f[]
+.br
+.ns
+.TP 7
+.NOP \f[C]RMD160\f[]
+The key is a hex-encoded ASCII string of 40 characters,
+which is truncated as necessary.
+.PP
+.sp \n(Ppu
+.ne 2
+
+Note that the keys used by the
+\fCntpq\fR(8)\f[]
+and
+\fCntpdc\fR(8)\f[]
+programs are checked against passwords
+requested by the programs and entered by hand,
+so it is generally appropriate to specify these keys in ASCII format.
+.SH FILES
+.TP 14
+.NOP \fI/etc/ntp.keys\f[]
+the default name of the configuration file
+.PP
+.SH "SEE ALSO"
+\fCntp.conf\fR(5)\f[],
+\fCntpd\fR(@NTPD_MS@)\f[],
+\fCntpdate\fR(@NTPDATE_MS@)\f[],
+\fCntpdc\fR(@NTPDC_MS@)\f[],
+\fCsntp\fR(@SNTP_MS@)\f[]
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+This document was derived from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp.keys\fP
+option definitions.
diff --git a/ntpd/ntp.keys.mdoc.in b/ntpd/ntp.keys.mdoc.in
new file mode 100644
index 0000000..b2a24e9
--- /dev/null
+++ b/ntpd/ntp.keys.mdoc.in
@@ -0,0 +1,158 @@
+.Dd December 2 2014
+.Dt NTP_KEYS 5 File Formats
+.Os SunOS 5.10
+.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:01 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp.keys.def
+.\" and the template file agmdoc-file.tpl
+.Sh NAME
+.Nm ntp.keys
+.Nd NTP symmetric key file format
+
+.Sh NAME
+.Nm ntp.keys
+.Nd NTP symmetric key file format
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+This document describes the format of an NTP symmetric key file.
+For a description of the use of this type of file, see the
+.Qq Authentication Support
+section of the
+.Xr ntp.conf 5
+page.
+.Pp
+.Xr ntpd 8
+reads its keys from a file specified using the
+.Fl k
+command line option or the
+.Ic keys
+statement in the configuration file.
+While key number 0 is fixed by the NTP standard
+(as 56 zero bits)
+and may not be changed,
+one or more keys numbered between 1 and 65534
+may be arbitrarily set in the keys file.
+.Pp
+The key file uses the same comment conventions
+as the configuration file.
+Key entries use a fixed format of the form
+.Pp
+.D1 Ar keyno type key
+.Pp
+where
+.Ar keyno
+is a positive integer (between 1 and 65534),
+.Ar type
+is the message digest algorithm,
+and
+.Ar key
+is the key itself.
+.Pp
+The
+.Ar key
+may be given in a format
+controlled by the
+.Ar type
+field.
+The
+.Ar type
+.Li MD5
+is always supported.
+If
+.Li ntpd
+was built with the OpenSSL library
+then any digest library supported by that library may be specified.
+However, if compliance with FIPS 140\-2 is required the
+.Ar type
+must be either
+.Li SHA
+or
+.Li SHA1 .
+.Pp
+What follows are some key types, and corresponding formats:
+.Pp
+.Bl -tag -width RMD160 -compact
+.It Li MD5
+The key is 1 to 16 printable characters terminated by
+an EOL,
+whitespace,
+or
+a
+.Li #
+(which is the "start of comment" character).
+.Pp
+.It Li SHA
+.It Li SHA1
+.It Li RMD160
+The key is a hex\-encoded ASCII string of 40 characters,
+which is truncated as necessary.
+.El
+.Pp
+Note that the keys used by the
+.Xr ntpq 8
+and
+.Xr ntpdc 8
+programs are checked against passwords
+requested by the programs and entered by hand,
+so it is generally appropriate to specify these keys in ASCII format.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTP_KEYS_<option\-name>\fP or \fBNTP_KEYS\fP
+.fi
+.ad
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh FILES
+.Bl -tag -width /etc/ntp.keys -compact
+.It Pa /etc/ntp.keys
+the default name of the configuration file
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntp.conf 5 ,
+.Xr ntpd @NTPD_MS@ ,
+.Xr ntpdate @NTPDATE_MS@ ,
+.Xr ntpdc @NTPDC_MS@ ,
+.Xr sntp @SNTP_MS@
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+This document was derived from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp.keys\fP
+option definitions.
diff --git a/ntpd/ntp.keys.texi b/ntpd/ntp.keys.texi
new file mode 100644
index 0000000..1fc7b5c
--- /dev/null
+++ b/ntpd/ntp.keys.texi
@@ -0,0 +1,49 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntp.keys.info
+@settitle NTP Symmetric Key
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the NTP Project's NTP Symmetric Key file,
+version @value{VERSION}, @value{UPDATED}.
+@end ifinfo
+
+@direntry
+* ntp.keys: (ntp.keys). NTP's Symmetric Key file
+@end direntry
+
+@titlepage
+@title NTP's Symmetric Key File User's Manual
+@subtitle ntp.keys, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntp.keys Description, (dir), (dir)
+@top NTP's Symmetric Key File User Manual
+
+This document describes the symmetric key file for the NTP Project's
+@code{ntpd} program.
+
+This document applies to version @value{VERSION} of @code{ntp.keys}.
+
+@shortcontents
+
+@menu
+* ntp.keys Description::
+* ntp.keys Notes::
+@end menu
+
+@node ntp.keys Description, , Top, Top
+@comment node-name, next, previous, up
+@section Description
+
+The name and location of the symmetric key file for @code{ntpd} can
+be specified in a configuration file, by default @code{/etc/ntp.keys}.
+
+@include invoke-ntp.keys.texi
diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c
new file mode 100644
index 0000000..0f48983
--- /dev/null
+++ b/ntpd/ntp_config.c
@@ -0,0 +1,4957 @@
+/* ntp_config.c
+ *
+ * This file contains the ntpd configuration code.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Some parts borrowed from the older ntp_config.c
+ * Copyright (c) 2006
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef HAVE_NETINFO
+# include <netinfo/ni.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#include <signal.h>
+#ifndef SIGCHLD
+# define SIGCHLD SIGCLD
+#endif
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#include <isc/net.h>
+#include <isc/result.h>
+
+#include "ntp.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_refclock.h"
+#include "ntp_filegen.h"
+#include "ntp_stdlib.h"
+#include "lib_strbuf.h"
+#include "ntp_assert.h"
+#include "ntp_random.h"
+/*
+ * [Bug 467]: Some linux headers collide with CONFIG_PHONE and CONFIG_KEYS
+ * so #include these later.
+ */
+#include "ntp_config.h"
+#include "ntp_cmdargs.h"
+#include "ntp_scanner.h"
+#include "ntp_parser.h"
+#include "ntpd-opts.h"
+
+
+/* Bison still(!) does not emit usable prototypes for the calling code */
+int yyparse (struct FILE_INFO *ip_file);
+
+/* 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;
+
+/*
+ * "logconfig" building blocks
+ */
+struct masks {
+ const char * const name;
+ const u_int32 mask;
+};
+
+static struct masks logcfg_class[] = {
+ { "clock", NLOG_OCLOCK },
+ { "peer", NLOG_OPEER },
+ { "sync", NLOG_OSYNC },
+ { "sys", NLOG_OSYS },
+ { NULL, 0 }
+};
+
+/* logcfg_noclass_items[] masks are complete and must not be shifted */
+static struct masks logcfg_noclass_items[] = {
+ { "allall", NLOG_SYSMASK | NLOG_PEERMASK | NLOG_CLOCKMASK | NLOG_SYNCMASK },
+ { "allinfo", NLOG_SYSINFO | NLOG_PEERINFO | NLOG_CLOCKINFO | NLOG_SYNCINFO },
+ { "allevents", NLOG_SYSEVENT | NLOG_PEEREVENT | NLOG_CLOCKEVENT | NLOG_SYNCEVENT },
+ { "allstatus", NLOG_SYSSTATUS | NLOG_PEERSTATUS | NLOG_CLOCKSTATUS | NLOG_SYNCSTATUS },
+ { "allstatistics", NLOG_SYSSTATIST | NLOG_PEERSTATIST | NLOG_CLOCKSTATIST | NLOG_SYNCSTATIST },
+ /* the remainder are misspellings of clockall, peerall, sysall, and syncall. */
+ { "allclock", (NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OCLOCK },
+ { "allpeer", (NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OPEER },
+ { "allsys", (NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OSYS },
+ { "allsync", (NLOG_INFO | NLOG_STATIST | NLOG_EVENT | NLOG_STATUS) << NLOG_OSYNC },
+ { NULL, 0 }
+};
+
+/* logcfg_class_items[] masks are shiftable by NLOG_O* counts */
+static struct masks logcfg_class_items[] = {
+ { "all", NLOG_INFO | NLOG_EVENT | NLOG_STATUS | NLOG_STATIST },
+ { "info", NLOG_INFO },
+ { "events", NLOG_EVENT },
+ { "status", NLOG_STATUS },
+ { "statistics", NLOG_STATIST },
+ { NULL, 0 }
+};
+
+typedef struct peer_resolved_ctx_tag {
+ int flags;
+ int host_mode; /* T_* token identifier */
+ u_short family;
+ keyid_t keyid;
+ u_char hmode; /* MODE_* */
+ u_char version;
+ u_char minpoll;
+ u_char maxpoll;
+ u_int32 ttl;
+ const char * group;
+} peer_resolved_ctx;
+
+/* Limits */
+#define MAXPHONE 10 /* maximum number of phone strings */
+#define MAXPPS 20 /* maximum length of PPS device string */
+
+/*
+ * Miscellaneous macros
+ */
+#define ISEOL(c) ((c) == '#' || (c) == '\n' || (c) == '\0')
+#define ISSPACE(c) ((c) == ' ' || (c) == '\t')
+
+/*
+ * Definitions of things either imported from or exported to outside
+ */
+extern int yydebug; /* ntp_parser.c (.y) */
+int curr_include_level; /* The current include level */
+struct FILE_INFO *fp[MAXINCLUDELEVEL+1];
+config_tree cfgt; /* Parser output stored here */
+struct config_tree_tag *cfg_tree_history; /* History of configs */
+char *sys_phone[MAXPHONE] = {NULL}; /* ACTS phone numbers */
+char default_keysdir[] = NTP_KEYSDIR;
+char *keysdir = default_keysdir; /* crypto keys directory */
+char * saveconfigdir;
+#if defined(HAVE_SCHED_SETSCHEDULER)
+int config_priority_override = 0;
+int config_priority;
+#endif
+
+const char *config_file;
+static char default_ntp_signd_socket[] =
+#ifdef NTP_SIGND_PATH
+ NTP_SIGND_PATH;
+#else
+ "";
+#endif
+char *ntp_signd_socket = default_ntp_signd_socket;
+#ifdef HAVE_NETINFO
+struct netinfo_config_state *config_netinfo = NULL;
+int check_netinfo = 1;
+#endif /* HAVE_NETINFO */
+#ifdef SYS_WINNT
+char *alt_config_file;
+LPTSTR temp;
+char config_file_storage[MAX_PATH];
+char alt_config_file_storage[MAX_PATH];
+#endif /* SYS_WINNT */
+
+#ifdef HAVE_NETINFO
+/*
+ * NetInfo configuration state
+ */
+struct netinfo_config_state {
+ void *domain; /* domain with config */
+ ni_id config_dir; /* ID config dir */
+ int prop_index; /* current property */
+ int val_index; /* current value */
+ char **val_list; /* value list */
+};
+#endif
+
+struct REMOTE_CONFIG_INFO remote_config; /* Remote configuration buffer and
+ pointer info */
+int input_from_file = 1; /* A boolean flag, which when set, indicates that
+ the input is to be taken from the configuration
+ file, instead of the remote-configuration buffer
+ */
+
+int old_config_style = 1; /* A boolean flag, which when set,
+ * indicates that the old configuration
+ * format with a newline at the end of
+ * every command is being used
+ */
+int cryptosw; /* crypto command called */
+
+extern char *stats_drift_file; /* name of the driftfile */
+
+#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
+/*
+ * backwards compatibility flags
+ */
+bc_entry bc_list[] = {
+ { T_Bc_bugXXXX, 1 } /* default enabled */
+};
+
+/*
+ * declare an int pointer for each flag for quick testing without
+ * walking bc_list. If the pointer is consumed by libntp rather
+ * than ntpd, declare it in a libntp source file pointing to storage
+ * initialized with the appropriate value for other libntp clients, and
+ * redirect it to point into bc_list during ntpd startup.
+ */
+int *p_bcXXXX_enabled = &bc_list[0].enabled;
+#endif
+
+/* FUNCTION PROTOTYPES */
+
+static void init_syntax_tree(config_tree *);
+static void apply_enable_disable(attr_val_fifo *q, int enable);
+
+#ifdef FREE_CFG_T
+static void free_auth_node(config_tree *);
+static void free_all_config_trees(void);
+
+static void free_config_access(config_tree *);
+static void free_config_auth(config_tree *);
+static void free_config_fudge(config_tree *);
+static void free_config_logconfig(config_tree *);
+static void free_config_monitor(config_tree *);
+static void free_config_nic_rules(config_tree *);
+static void free_config_other_modes(config_tree *);
+static void free_config_peers(config_tree *);
+static void free_config_phone(config_tree *);
+static void free_config_reset_counters(config_tree *);
+static void free_config_rlimit(config_tree *);
+static void free_config_setvar(config_tree *);
+static void free_config_system_opts(config_tree *);
+static void free_config_tinker(config_tree *);
+static void free_config_tos(config_tree *);
+static void free_config_trap(config_tree *);
+static void free_config_ttl(config_tree *);
+static void free_config_unpeers(config_tree *);
+static void free_config_vars(config_tree *);
+
+#ifdef SIM
+static void free_config_sim(config_tree *);
+#endif
+static void destroy_address_fifo(address_fifo *);
+#define FREE_ADDRESS_FIFO(pf) \
+ do { \
+ destroy_address_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+ void free_all_config_trees(void); /* atexit() */
+static void free_config_tree(config_tree *ptree);
+#endif /* FREE_CFG_T */
+
+static void destroy_restrict_node(restrict_node *my_node);
+static int is_sane_resolved_address(sockaddr_u *peeraddr, int hmode);
+static void save_and_apply_config_tree(void);
+static void destroy_int_fifo(int_fifo *);
+#define FREE_INT_FIFO(pf) \
+ do { \
+ destroy_int_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+static void destroy_string_fifo(string_fifo *);
+#define FREE_STRING_FIFO(pf) \
+ do { \
+ destroy_string_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+static void destroy_attr_val_fifo(attr_val_fifo *);
+#define FREE_ATTR_VAL_FIFO(pf) \
+ do { \
+ destroy_attr_val_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+static void destroy_filegen_fifo(filegen_fifo *);
+#define FREE_FILEGEN_FIFO(pf) \
+ do { \
+ destroy_filegen_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+static void destroy_restrict_fifo(restrict_fifo *);
+#define FREE_RESTRICT_FIFO(pf) \
+ do { \
+ destroy_restrict_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+static void destroy_setvar_fifo(setvar_fifo *);
+#define FREE_SETVAR_FIFO(pf) \
+ do { \
+ destroy_setvar_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+static void destroy_addr_opts_fifo(addr_opts_fifo *);
+#define FREE_ADDR_OPTS_FIFO(pf) \
+ do { \
+ destroy_addr_opts_fifo(pf); \
+ (pf) = NULL; \
+ } while (0)
+
+static void config_logconfig(config_tree *);
+static void config_monitor(config_tree *);
+static void config_rlimit(config_tree *);
+static void config_system_opts(config_tree *);
+static void config_tinker(config_tree *);
+static void config_tos(config_tree *);
+static void config_vars(config_tree *);
+
+#ifdef SIM
+static sockaddr_u *get_next_address(address_node *addr);
+static void config_sim(config_tree *);
+static void config_ntpdsim(config_tree *);
+#else /* !SIM follows */
+static void config_ntpd(config_tree *);
+static void config_other_modes(config_tree *);
+static void config_auth(config_tree *);
+static void config_access(config_tree *);
+static void config_phone(config_tree *);
+static void config_setvar(config_tree *);
+static void config_ttl(config_tree *);
+static void config_trap(config_tree *);
+static void config_fudge(config_tree *);
+static void config_peers(config_tree *);
+static void config_unpeers(config_tree *);
+static void config_nic_rules(config_tree *);
+static void config_reset_counters(config_tree *);
+static u_char get_correct_host_mode(int token);
+static int peerflag_bits(peer_node *);
+#endif /* !SIM */
+
+#ifdef WORKER
+static void peer_name_resolved(int, int, void *, const char *, const char *,
+ const struct addrinfo *,
+ const struct addrinfo *);
+static void unpeer_name_resolved(int, int, void *, const char *, const char *,
+ const struct addrinfo *,
+ const struct addrinfo *);
+static void trap_name_resolved(int, int, void *, const char *, const char *,
+ const struct addrinfo *,
+ const struct addrinfo *);
+#endif
+
+enum gnn_type {
+ t_UNK, /* Unknown */
+ t_REF, /* Refclock */
+ t_MSK /* Network Mask */
+};
+
+static void ntpd_set_tod_using(const char *);
+static char * normal_dtoa(double);
+static u_int32 get_pfxmatch(const char **, struct masks *);
+static u_int32 get_match(const char *, struct masks *);
+static u_int32 get_logmask(const char *);
+#ifndef SIM
+static int getnetnum(const char *num, sockaddr_u *addr, int complain,
+ enum gnn_type a_type);
+#endif
+
+
+/* FUNCTIONS FOR INITIALIZATION
+ * ----------------------------
+ */
+
+#ifdef FREE_CFG_T
+static void
+free_auth_node(
+ config_tree *ptree
+ )
+{
+ if (ptree->auth.keys) {
+ free(ptree->auth.keys);
+ ptree->auth.keys = NULL;
+ }
+
+ if (ptree->auth.keysdir) {
+ free(ptree->auth.keysdir);
+ ptree->auth.keysdir = NULL;
+ }
+
+ if (ptree->auth.ntp_signd_socket) {
+ free(ptree->auth.ntp_signd_socket);
+ ptree->auth.ntp_signd_socket = NULL;
+ }
+}
+#endif /* DEBUG */
+
+
+static void
+init_syntax_tree(
+ config_tree *ptree
+ )
+{
+ ZERO(*ptree);
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_all_config_trees(void)
+{
+ config_tree *ptree;
+ config_tree *pnext;
+
+ ptree = cfg_tree_history;
+
+ while (ptree != NULL) {
+ pnext = ptree->link;
+ free_config_tree(ptree);
+ ptree = pnext;
+ }
+}
+
+
+static void
+free_config_tree(
+ config_tree *ptree
+ )
+{
+#if defined(_MSC_VER) && defined (_DEBUG)
+ _CrtCheckMemory();
+#endif
+
+ if (ptree->source.value.s != NULL)
+ free(ptree->source.value.s);
+
+ free_config_other_modes(ptree);
+ free_config_auth(ptree);
+ free_config_tos(ptree);
+ free_config_monitor(ptree);
+ free_config_access(ptree);
+ free_config_tinker(ptree);
+ free_config_rlimit(ptree);
+ free_config_system_opts(ptree);
+ free_config_logconfig(ptree);
+ free_config_phone(ptree);
+ free_config_setvar(ptree);
+ free_config_ttl(ptree);
+ free_config_trap(ptree);
+ free_config_fudge(ptree);
+ free_config_vars(ptree);
+ free_config_peers(ptree);
+ free_config_unpeers(ptree);
+ free_config_nic_rules(ptree);
+ free_config_reset_counters(ptree);
+#ifdef SIM
+ free_config_sim(ptree);
+#endif
+ free_auth_node(ptree);
+
+ free(ptree);
+
+#if defined(_MSC_VER) && defined (_DEBUG)
+ _CrtCheckMemory();
+#endif
+}
+#endif /* FREE_CFG_T */
+
+
+#ifdef SAVECONFIG
+/* Dump all trees */
+int
+dump_all_config_trees(
+ FILE *df,
+ int comment
+ )
+{
+ config_tree * cfg_ptr;
+ int return_value;
+
+ return_value = 0;
+ for (cfg_ptr = cfg_tree_history;
+ cfg_ptr != NULL;
+ cfg_ptr = cfg_ptr->link)
+ return_value |= dump_config_tree(cfg_ptr, df, comment);
+
+ return return_value;
+}
+
+
+/* The config dumper */
+int
+dump_config_tree(
+ config_tree *ptree,
+ FILE *df,
+ int comment
+ )
+{
+ peer_node *peern;
+ unpeer_node *unpeern;
+ attr_val *atrv;
+ address_node *addr;
+ address_node *peer_addr;
+ address_node *fudge_addr;
+ filegen_node *fgen_node;
+ restrict_node *rest_node;
+ addr_opts_node *addr_opts;
+ setvar_node *setv_node;
+ nic_rule_node *rule_node;
+ int_node *i_n;
+ int_node *flags;
+ int_node *counter_set;
+ string_node *str_node;
+
+ const char *s;
+ char *s1;
+ char *s2;
+ char timestamp[80];
+ int enable;
+
+ DPRINTF(1, ("dump_config_tree(%p)\n", ptree));
+
+ if (comment) {
+ if (!strftime(timestamp, sizeof(timestamp),
+ "%Y-%m-%d %H:%M:%S",
+ localtime(&ptree->timestamp)))
+ timestamp[0] = '\0';
+
+ fprintf(df, "# %s %s %s\n",
+ timestamp,
+ (CONF_SOURCE_NTPQ == ptree->source.attr)
+ ? "ntpq remote config from"
+ : "startup configuration file",
+ ptree->source.value.s);
+ }
+
+ /* For options I didn't find documentation I'll just output its name and the cor. value */
+ atrv = HEAD_PFIFO(ptree->vars);
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ switch (atrv->type) {
+#ifdef DEBUG
+ default:
+ fprintf(df, "\n# dump error:\n"
+ "# unknown vars type %d (%s) for %s\n",
+ atrv->type, token_name(atrv->type),
+ token_name(atrv->attr));
+ break;
+#endif
+ case T_Double:
+ fprintf(df, "%s %s\n", keyword(atrv->attr),
+ normal_dtoa(atrv->value.d));
+ break;
+
+ case T_Integer:
+ fprintf(df, "%s %d\n", keyword(atrv->attr),
+ atrv->value.i);
+ break;
+
+ case T_String:
+ fprintf(df, "%s \"%s\"", keyword(atrv->attr),
+ atrv->value.s);
+ if (T_Driftfile == atrv->attr &&
+ atrv->link != NULL &&
+ T_WanderThreshold == atrv->link->attr) {
+ atrv = atrv->link;
+ fprintf(df, " %s\n",
+ normal_dtoa(atrv->value.d));
+ } else {
+ fprintf(df, "\n");
+ }
+ break;
+ }
+ }
+
+ atrv = HEAD_PFIFO(ptree->logconfig);
+ if (atrv != NULL) {
+ fprintf(df, "logconfig");
+ for ( ; atrv != NULL; atrv = atrv->link)
+ fprintf(df, " %c%s", atrv->attr, atrv->value.s);
+ fprintf(df, "\n");
+ }
+
+ if (ptree->stats_dir)
+ fprintf(df, "statsdir \"%s\"\n", ptree->stats_dir);
+
+ i_n = HEAD_PFIFO(ptree->stats_list);
+ if (i_n != NULL) {
+ fprintf(df, "statistics");
+ for ( ; i_n != NULL; i_n = i_n->link)
+ fprintf(df, " %s", keyword(i_n->i));
+ fprintf(df, "\n");
+ }
+
+ fgen_node = HEAD_PFIFO(ptree->filegen_opts);
+ for ( ; fgen_node != NULL; fgen_node = fgen_node->link) {
+ atrv = HEAD_PFIFO(fgen_node->options);
+ if (atrv != NULL) {
+ fprintf(df, "filegen %s",
+ keyword(fgen_node->filegen_token));
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ switch (atrv->attr) {
+#ifdef DEBUG
+ default:
+ fprintf(df, "\n# dump error:\n"
+ "# unknown filegen option token %s\n"
+ "filegen %s",
+ token_name(atrv->attr),
+ keyword(fgen_node->filegen_token));
+ break;
+#endif
+ case T_File:
+ fprintf(df, " file %s",
+ atrv->value.s);
+ break;
+
+ case T_Type:
+ fprintf(df, " type %s",
+ keyword(atrv->value.i));
+ break;
+
+ case T_Flag:
+ fprintf(df, " %s",
+ keyword(atrv->value.i));
+ break;
+ }
+ }
+ fprintf(df, "\n");
+ }
+ }
+
+ atrv = HEAD_PFIFO(ptree->auth.crypto_cmd_list);
+ if (atrv != NULL) {
+ fprintf(df, "crypto");
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ fprintf(df, " %s %s", keyword(atrv->attr),
+ atrv->value.s);
+ }
+ fprintf(df, "\n");
+ }
+
+ if (ptree->auth.revoke != 0)
+ fprintf(df, "revoke %d\n", ptree->auth.revoke);
+
+ if (ptree->auth.keysdir != NULL)
+ fprintf(df, "keysdir \"%s\"\n", ptree->auth.keysdir);
+
+ if (ptree->auth.keys != NULL)
+ fprintf(df, "keys \"%s\"\n", ptree->auth.keys);
+
+ atrv = HEAD_PFIFO(ptree->auth.trusted_key_list);
+ if (atrv != NULL) {
+ fprintf(df, "trustedkey");
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ if (T_Integer == atrv->type)
+ fprintf(df, " %d", atrv->value.i);
+ else if (T_Intrange == atrv->type)
+ fprintf(df, " (%d ... %d)",
+ atrv->value.r.first,
+ atrv->value.r.last);
+#ifdef DEBUG
+ else
+ fprintf(df, "\n# dump error:\n"
+ "# unknown trustedkey attr type %d\n"
+ "trustedkey", atrv->type);
+#endif
+ }
+ fprintf(df, "\n");
+ }
+
+ if (ptree->auth.control_key)
+ fprintf(df, "controlkey %d\n", ptree->auth.control_key);
+
+ if (ptree->auth.request_key)
+ fprintf(df, "requestkey %d\n", ptree->auth.request_key);
+
+ /* dump enable list, then disable list */
+ for (enable = 1; enable >= 0; enable--) {
+ atrv = (enable)
+ ? HEAD_PFIFO(ptree->enable_opts)
+ : HEAD_PFIFO(ptree->disable_opts);
+ if (atrv != NULL) {
+ fprintf(df, "%s", (enable)
+ ? "enable"
+ : "disable");
+ for ( ; atrv != NULL; atrv = atrv->link)
+ fprintf(df, " %s",
+ keyword(atrv->value.i));
+ fprintf(df, "\n");
+ }
+ }
+
+ atrv = HEAD_PFIFO(ptree->orphan_cmds);
+ if (atrv != NULL) {
+ fprintf(df, "tos");
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ switch (atrv->type) {
+#ifdef DEBUG
+ default:
+ fprintf(df, "\n# dump error:\n"
+ "# unknown tos attr type %d %s\n"
+ "tos", atrv->type,
+ token_name(atrv->type));
+ break;
+#endif
+ case T_Double:
+ fprintf(df, " %s %s",
+ keyword(atrv->attr),
+ normal_dtoa(atrv->value.d));
+ break;
+ }
+ }
+ fprintf(df, "\n");
+ }
+
+ atrv = HEAD_PFIFO(ptree->rlimit);
+ if (atrv != NULL) {
+ fprintf(df, "rlimit");
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ INSIST(T_Integer == atrv->type);
+ fprintf(df, " %s %d", keyword(atrv->attr),
+ atrv->value.i);
+ }
+ fprintf(df, "\n");
+ }
+
+ atrv = HEAD_PFIFO(ptree->tinker);
+ if (atrv != NULL) {
+ fprintf(df, "tinker");
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ INSIST(T_Double == atrv->type);
+ fprintf(df, " %s %s", keyword(atrv->attr),
+ normal_dtoa(atrv->value.d));
+ }
+ fprintf(df, "\n");
+ }
+
+ if (ptree->broadcastclient)
+ fprintf(df, "broadcastclient\n");
+
+ peern = HEAD_PFIFO(ptree->peers);
+ for ( ; peern != NULL; peern = peern->link) {
+ addr = peern->addr;
+ fprintf(df, "%s", keyword(peern->host_mode));
+ switch (addr->type) {
+#ifdef DEBUG
+ default:
+ fprintf(df, "# dump error:\n"
+ "# unknown peer family %d for:\n"
+ "%s", addr->type,
+ keyword(peern->host_mode));
+ break;
+#endif
+ case AF_UNSPEC:
+ break;
+
+ case AF_INET:
+ fprintf(df, " -4");
+ break;
+
+ case AF_INET6:
+ fprintf(df, " -6");
+ break;
+ }
+ fprintf(df, " %s", addr->address);
+
+ if (peern->minpoll != 0)
+ fprintf(df, " minpoll %u", peern->minpoll);
+
+ if (peern->maxpoll != 0)
+ fprintf(df, " maxpoll %u", peern->maxpoll);
+
+ if (peern->ttl != 0) {
+ if (strlen(addr->address) > 8
+ && !memcmp(addr->address, "127.127.", 8))
+ fprintf(df, " mode %u", peern->ttl);
+ else
+ fprintf(df, " ttl %u", peern->ttl);
+ }
+
+ if (peern->peerversion != NTP_VERSION)
+ fprintf(df, " version %u", peern->peerversion);
+
+ if (peern->peerkey != 0)
+ fprintf(df, " key %u", peern->peerkey);
+
+ if (peern->group != NULL)
+ fprintf(df, " ident \"%s\"", peern->group);
+
+ atrv = HEAD_PFIFO(peern->peerflags);
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ INSIST(T_Flag == atrv->attr);
+ INSIST(T_Integer == atrv->type);
+ fprintf(df, " %s", keyword(atrv->value.i));
+ }
+
+ fprintf(df, "\n");
+
+ addr_opts = HEAD_PFIFO(ptree->fudge);
+ for ( ; addr_opts != NULL; addr_opts = addr_opts->link) {
+ peer_addr = peern->addr;
+ fudge_addr = addr_opts->addr;
+
+ s1 = peer_addr->address;
+ s2 = fudge_addr->address;
+
+ if (strcmp(s1, s2))
+ continue;
+
+ fprintf(df, "fudge %s", s1);
+
+ for (atrv = HEAD_PFIFO(addr_opts->options);
+ atrv != NULL;
+ atrv = atrv->link) {
+
+ switch (atrv->type) {
+#ifdef DEBUG
+ default:
+ fprintf(df, "\n# dump error:\n"
+ "# unknown fudge atrv->type %d\n"
+ "fudge %s", atrv->type,
+ s1);
+ break;
+#endif
+ case T_Double:
+ fprintf(df, " %s %s",
+ keyword(atrv->attr),
+ normal_dtoa(atrv->value.d));
+ break;
+
+ case T_Integer:
+ fprintf(df, " %s %d",
+ keyword(atrv->attr),
+ atrv->value.i);
+ break;
+
+ case T_String:
+ fprintf(df, " %s %s",
+ keyword(atrv->attr),
+ atrv->value.s);
+ break;
+ }
+ }
+ fprintf(df, "\n");
+ }
+ }
+
+ addr = HEAD_PFIFO(ptree->manycastserver);
+ if (addr != NULL) {
+ fprintf(df, "manycastserver");
+ for ( ; addr != NULL; addr = addr->link)
+ fprintf(df, " %s", addr->address);
+ fprintf(df, "\n");
+ }
+
+ addr = HEAD_PFIFO(ptree->multicastclient);
+ if (addr != NULL) {
+ fprintf(df, "multicastclient");
+ for ( ; addr != NULL; addr = addr->link)
+ fprintf(df, " %s", addr->address);
+ fprintf(df, "\n");
+ }
+
+
+ for (unpeern = HEAD_PFIFO(ptree->unpeers);
+ unpeern != NULL;
+ unpeern = unpeern->link)
+ fprintf(df, "unpeer %s\n", unpeern->addr->address);
+
+ atrv = HEAD_PFIFO(ptree->mru_opts);
+ if (atrv != NULL) {
+ fprintf(df, "mru");
+ for ( ; atrv != NULL; atrv = atrv->link)
+ fprintf(df, " %s %d", keyword(atrv->attr),
+ atrv->value.i);
+ fprintf(df, "\n");
+ }
+
+ atrv = HEAD_PFIFO(ptree->discard_opts);
+ if (atrv != NULL) {
+ fprintf(df, "discard");
+ for ( ; atrv != NULL; atrv = atrv->link)
+ fprintf(df, " %s %d", keyword(atrv->attr),
+ atrv->value.i);
+ fprintf(df, "\n");
+ }
+
+
+ for (rest_node = HEAD_PFIFO(ptree->restrict_opts);
+ rest_node != NULL;
+ rest_node = rest_node->link) {
+
+ if (NULL == rest_node->addr) {
+ s = "default";
+ flags = HEAD_PFIFO(rest_node->flags);
+ for ( ; flags != NULL; flags = flags->link)
+ if (T_Source == flags->i) {
+ s = "source";
+ break;
+ }
+ } else {
+ s = rest_node->addr->address;
+ }
+ fprintf(df, "restrict %s", s);
+ if (rest_node->mask != NULL)
+ fprintf(df, " mask %s",
+ rest_node->mask->address);
+ flags = HEAD_PFIFO(rest_node->flags);
+ for ( ; flags != NULL; flags = flags->link)
+ if (T_Source != flags->i)
+ fprintf(df, " %s", keyword(flags->i));
+ fprintf(df, "\n");
+ }
+
+ rule_node = HEAD_PFIFO(ptree->nic_rules);
+ for ( ; rule_node != NULL; rule_node = rule_node->link) {
+ fprintf(df, "interface %s %s\n",
+ keyword(rule_node->action),
+ (rule_node->match_class)
+ ? keyword(rule_node->match_class)
+ : rule_node->if_name);
+ }
+
+ str_node = HEAD_PFIFO(ptree->phone);
+ if (str_node != NULL) {
+ fprintf(df, "phone");
+ for ( ; str_node != NULL; str_node = str_node->link)
+ fprintf(df, " \"%s\"", str_node->s);
+ fprintf(df, "\n");
+ }
+
+ setv_node = HEAD_PFIFO(ptree->setvar);
+ for ( ; setv_node != NULL; setv_node = setv_node->link) {
+ s1 = quote_if_needed(setv_node->var);
+ s2 = quote_if_needed(setv_node->val);
+ fprintf(df, "setvar %s = %s", s1, s2);
+ free(s1);
+ free(s2);
+ if (setv_node->isdefault)
+ fprintf(df, " default");
+ fprintf(df, "\n");
+ }
+
+ i_n = HEAD_PFIFO(ptree->ttl);
+ if (i_n != NULL) {
+ fprintf(df, "ttl");
+ for( ; i_n != NULL; i_n = i_n->link)
+ fprintf(df, " %d", i_n->i);
+ fprintf(df, "\n");
+ }
+
+ addr_opts = HEAD_PFIFO(ptree->trap);
+ for ( ; addr_opts != NULL; addr_opts = addr_opts->link) {
+ addr = addr_opts->addr;
+ fprintf(df, "trap %s", addr->address);
+ atrv = HEAD_PFIFO(addr_opts->options);
+ for ( ; atrv != NULL; atrv = atrv->link) {
+ switch (atrv->attr) {
+#ifdef DEBUG
+ default:
+ fprintf(df, "\n# dump error:\n"
+ "# unknown trap token %d\n"
+ "trap %s", atrv->attr,
+ addr->address);
+ break;
+#endif
+ case T_Port:
+ fprintf(df, " port %d", atrv->value.i);
+ break;
+
+ case T_Interface:
+ fprintf(df, " interface %s",
+ atrv->value.s);
+ break;
+ }
+ }
+ fprintf(df, "\n");
+ }
+
+ counter_set = HEAD_PFIFO(ptree->reset_counters);
+ if (counter_set != NULL) {
+ fprintf(df, "reset");
+ for ( ; counter_set != NULL;
+ counter_set = counter_set->link)
+ fprintf(df, " %s", keyword(counter_set->i));
+ fprintf(df, "\n");
+ }
+
+ return 0;
+}
+#endif /* SAVECONFIG */
+
+
+
+/* generic fifo routines for structs linked by 1st member */
+void *
+append_gen_fifo(
+ void *fifo,
+ void *entry
+ )
+{
+ gen_fifo *pf;
+ gen_node *pe;
+
+ pf = fifo;
+ pe = entry;
+ if (NULL == pf)
+ pf = emalloc_zero(sizeof(*pf));
+ else
+ CHECK_FIFO_CONSISTENCY(*pf);
+ if (pe != NULL)
+ LINK_FIFO(*pf, pe, link);
+ CHECK_FIFO_CONSISTENCY(*pf);
+
+ return pf;
+}
+
+
+void *
+concat_gen_fifos(
+ void *first,
+ void *second
+ )
+{
+ gen_fifo *pf1;
+ gen_fifo *pf2;
+
+ pf1 = first;
+ pf2 = second;
+ if (NULL == pf1)
+ return pf2;
+ if (NULL == pf2)
+ return pf1;
+
+ CONCAT_FIFO(*pf1, *pf2, link);
+ free(pf2);
+
+ return pf1;
+}
+
+
+/* FUNCTIONS FOR CREATING NODES ON THE SYNTAX TREE
+ * -----------------------------------------------
+ */
+
+attr_val *
+create_attr_dval(
+ int attr,
+ double value
+ )
+{
+ attr_val *my_val;
+
+ my_val = emalloc_zero(sizeof(*my_val));
+ my_val->attr = attr;
+ my_val->value.d = value;
+ my_val->type = T_Double;
+
+ return my_val;
+}
+
+
+attr_val *
+create_attr_ival(
+ int attr,
+ int value
+ )
+{
+ attr_val *my_val;
+
+ my_val = emalloc_zero(sizeof(*my_val));
+ my_val->attr = attr;
+ my_val->value.i = value;
+ my_val->type = T_Integer;
+
+ return my_val;
+}
+
+
+attr_val *
+create_attr_uval(
+ int attr,
+ u_int value
+ )
+{
+ attr_val *my_val;
+
+ my_val = emalloc_zero(sizeof(*my_val));
+ my_val->attr = attr;
+ my_val->value.u = value;
+ my_val->type = T_U_int;
+
+ return my_val;
+}
+
+
+attr_val *
+create_attr_rangeval(
+ int attr,
+ int first,
+ int last
+ )
+{
+ attr_val *my_val;
+
+ my_val = emalloc_zero(sizeof(*my_val));
+ my_val->attr = attr;
+ my_val->value.r.first = first;
+ my_val->value.r.last = last;
+ my_val->type = T_Intrange;
+
+ return my_val;
+}
+
+
+attr_val *
+create_attr_sval(
+ int attr,
+ char *s
+ )
+{
+ attr_val *my_val;
+
+ my_val = emalloc_zero(sizeof(*my_val));
+ my_val->attr = attr;
+ if (NULL == s) /* free() hates NULL */
+ s = estrdup("");
+ my_val->value.s = s;
+ my_val->type = T_String;
+
+ return my_val;
+}
+
+
+int_node *
+create_int_node(
+ int val
+ )
+{
+ int_node *i_n;
+
+ i_n = emalloc_zero(sizeof(*i_n));
+ i_n->i = val;
+
+ return i_n;
+}
+
+
+string_node *
+create_string_node(
+ char *str
+ )
+{
+ string_node *sn;
+
+ sn = emalloc_zero(sizeof(*sn));
+ sn->s = str;
+
+ return sn;
+}
+
+
+address_node *
+create_address_node(
+ char * addr,
+ int type
+ )
+{
+ address_node *my_node;
+
+ NTP_REQUIRE(NULL != addr);
+ NTP_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;
+
+ return my_node;
+}
+
+
+void
+destroy_address_node(
+ address_node *my_node
+ )
+{
+ if (NULL == my_node)
+ return;
+ NTP_REQUIRE(NULL != my_node->address);
+
+ free(my_node->address);
+ free(my_node);
+}
+
+
+peer_node *
+create_peer_node(
+ int hmode,
+ address_node * addr,
+ attr_val_fifo * options
+ )
+{
+ peer_node *my_node;
+ attr_val *option;
+ int freenode;
+ int errflag = 0;
+
+ my_node = emalloc_zero(sizeof(*my_node));
+
+ /* Initialize node values to default */
+ my_node->peerversion = NTP_VERSION;
+
+ /* Now set the node to the read values */
+ my_node->host_mode = hmode;
+ my_node->addr = addr;
+
+ /*
+ * the options FIFO mixes items that will be saved in the
+ * peer_node as explicit members, such as minpoll, and
+ * those that are moved intact to the peer_node's peerflags
+ * FIFO. The options FIFO is consumed and reclaimed here.
+ */
+
+ if (options != NULL)
+ CHECK_FIFO_CONSISTENCY(*options);
+ while (options != NULL) {
+ UNLINK_FIFO(option, *options, link);
+ if (NULL == option) {
+ free(options);
+ break;
+ }
+
+ freenode = 1;
+ /* Check the kind of option being set */
+ switch (option->attr) {
+
+ case T_Flag:
+ APPEND_G_FIFO(my_node->peerflags, option);
+ freenode = 0;
+ break;
+
+ case T_Minpoll:
+ if (option->value.i < NTP_MINPOLL ||
+ option->value.i > UCHAR_MAX) {
+ msyslog(LOG_INFO,
+ "minpoll: provided value (%d) is out of range [%d-%d])",
+ option->value.i, NTP_MINPOLL,
+ UCHAR_MAX);
+ my_node->minpoll = NTP_MINPOLL;
+ } else {
+ my_node->minpoll =
+ (u_char)option->value.u;
+ }
+ break;
+
+ case T_Maxpoll:
+ if (option->value.i < 0 ||
+ option->value.i > NTP_MAXPOLL) {
+ msyslog(LOG_INFO,
+ "maxpoll: provided value (%d) is out of range [0-%d])",
+ option->value.i, NTP_MAXPOLL);
+ my_node->maxpoll = NTP_MAXPOLL;
+ } else {
+ my_node->maxpoll =
+ (u_char)option->value.u;
+ }
+ break;
+
+ case T_Ttl:
+ if (option->value.u >= MAX_TTL) {
+ msyslog(LOG_ERR, "ttl: invalid argument");
+ errflag = 1;
+ } else {
+ my_node->ttl = (u_char)option->value.u;
+ }
+ break;
+
+ case T_Mode:
+ my_node->ttl = option->value.u;
+ break;
+
+ case T_Key:
+ if (option->value.u >= KEYID_T_MAX) {
+ msyslog(LOG_ERR, "key: invalid argument");
+ errflag = 1;
+ } else {
+ my_node->peerkey =
+ (keyid_t)option->value.u;
+ }
+ break;
+
+ case T_Version:
+ if (option->value.u >= UCHAR_MAX) {
+ msyslog(LOG_ERR, "version: invalid argument");
+ errflag = 1;
+ } else {
+ my_node->peerversion =
+ (u_char)option->value.u;
+ }
+ break;
+
+ case T_Ident:
+ my_node->group = option->value.s;
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "Unknown peer/server option token %s",
+ token_name(option->attr));
+ errflag = 1;
+ }
+ if (freenode)
+ free(option);
+ }
+
+ /* Check if errors were reported. If yes, ignore the node */
+ if (errflag) {
+ free(my_node);
+ my_node = NULL;
+ }
+
+ return my_node;
+}
+
+
+unpeer_node *
+create_unpeer_node(
+ address_node *addr
+ )
+{
+ unpeer_node * my_node;
+ u_int u;
+ char * pch;
+
+ my_node = emalloc_zero(sizeof(*my_node));
+
+ /*
+ * From the parser's perspective an association ID fits into
+ * its generic T_String definition of a name/address "address".
+ * We treat all valid 16-bit numbers as association IDs.
+ */
+ pch = addr->address;
+ while (*pch && isdigit(*pch))
+ pch++;
+
+ if (!*pch
+ && 1 == sscanf(addr->address, "%u", &u)
+ && u <= ASSOCID_MAX) {
+ my_node->assocID = (associd_t)u;
+ destroy_address_node(addr);
+ my_node->addr = NULL;
+ } else {
+ my_node->assocID = 0;
+ my_node->addr = addr;
+ }
+
+ return my_node;
+}
+
+filegen_node *
+create_filegen_node(
+ int filegen_token,
+ attr_val_fifo * options
+ )
+{
+ filegen_node *my_node;
+
+ my_node = emalloc_zero(sizeof(*my_node));
+ my_node->filegen_token = filegen_token;
+ my_node->options = options;
+
+ return my_node;
+}
+
+
+restrict_node *
+create_restrict_node(
+ address_node * addr,
+ address_node * mask,
+ int_fifo * flags,
+ int line_no
+ )
+{
+ restrict_node *my_node;
+
+ my_node = emalloc_zero(sizeof(*my_node));
+ my_node->addr = addr;
+ my_node->mask = mask;
+ my_node->flags = flags;
+ my_node->line_no = line_no;
+
+ return my_node;
+}
+
+
+static void
+destroy_restrict_node(
+ restrict_node *my_node
+ )
+{
+ /* With great care, free all the memory occupied by
+ * the restrict node
+ */
+ destroy_address_node(my_node->addr);
+ destroy_address_node(my_node->mask);
+ destroy_int_fifo(my_node->flags);
+ free(my_node);
+}
+
+
+static void
+destroy_int_fifo(
+ int_fifo * fifo
+ )
+{
+ int_node * i_n;
+
+ if (fifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(i_n, *fifo, link);
+ if (i_n == NULL)
+ break;
+ free(i_n);
+ }
+ free(fifo);
+ }
+}
+
+
+static void
+destroy_string_fifo(
+ string_fifo * fifo
+ )
+{
+ string_node * sn;
+
+ if (fifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(sn, *fifo, link);
+ if (sn == NULL)
+ break;
+ free(sn->s);
+ free(sn);
+ }
+ free(fifo);
+ }
+}
+
+
+static void
+destroy_attr_val_fifo(
+ attr_val_fifo * av_fifo
+ )
+{
+ attr_val * av;
+
+ if (av_fifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(av, *av_fifo, link);
+ if (av == NULL)
+ break;
+ if (T_String == av->type)
+ free(av->value.s);
+ free(av);
+ }
+ free(av_fifo);
+ }
+}
+
+
+static void
+destroy_filegen_fifo(
+ filegen_fifo * fifo
+ )
+{
+ filegen_node * fg;
+
+ if (fifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(fg, *fifo, link);
+ if (fg == NULL)
+ break;
+ destroy_attr_val_fifo(fg->options);
+ free(fg);
+ }
+ free(fifo);
+ }
+}
+
+
+static void
+destroy_restrict_fifo(
+ restrict_fifo * fifo
+ )
+{
+ restrict_node * rn;
+
+ if (fifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(rn, *fifo, link);
+ if (rn == NULL)
+ break;
+ destroy_restrict_node(rn);
+ }
+ free(fifo);
+ }
+}
+
+
+static void
+destroy_setvar_fifo(
+ setvar_fifo * fifo
+ )
+{
+ setvar_node * sv;
+
+ if (fifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(sv, *fifo, link);
+ if (sv == NULL)
+ break;
+ free(sv->var);
+ free(sv->val);
+ free(sv);
+ }
+ free(fifo);
+ }
+}
+
+
+static void
+destroy_addr_opts_fifo(
+ addr_opts_fifo * fifo
+ )
+{
+ addr_opts_node * aon;
+
+ if (fifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(aon, *fifo, link);
+ if (aon == NULL)
+ break;
+ destroy_address_node(aon->addr);
+ destroy_attr_val_fifo(aon->options);
+ free(aon);
+ }
+ free(fifo);
+ }
+}
+
+
+setvar_node *
+create_setvar_node(
+ char * var,
+ char * val,
+ int isdefault
+ )
+{
+ setvar_node * my_node;
+ char * pch;
+
+ /* do not allow = in the variable name */
+ pch = strchr(var, '=');
+ if (NULL != pch)
+ *pch = '\0';
+
+ /* Now store the string into a setvar_node */
+ my_node = emalloc_zero(sizeof(*my_node));
+ my_node->var = var;
+ my_node->val = val;
+ my_node->isdefault = isdefault;
+
+ return my_node;
+}
+
+
+nic_rule_node *
+create_nic_rule_node(
+ int match_class,
+ char *if_name, /* interface name or numeric address */
+ int action
+ )
+{
+ nic_rule_node *my_node;
+
+ NTP_REQUIRE(match_class != 0 || if_name != NULL);
+
+ my_node = emalloc_zero(sizeof(*my_node));
+ my_node->match_class = match_class;
+ my_node->if_name = if_name;
+ my_node->action = action;
+
+ return my_node;
+}
+
+
+addr_opts_node *
+create_addr_opts_node(
+ address_node * addr,
+ attr_val_fifo * options
+ )
+{
+ addr_opts_node *my_node;
+
+ my_node = emalloc_zero(sizeof(*my_node));
+ my_node->addr = addr;
+ my_node->options = options;
+
+ return my_node;
+}
+
+
+#ifdef SIM
+script_info *
+create_sim_script_info(
+ double duration,
+ attr_val_fifo * script_queue
+ )
+{
+ script_info *my_info;
+ attr_val *my_attr_val;
+
+ my_info = emalloc_zero(sizeof(*my_info));
+
+ /* Initialize Script Info with default values*/
+ my_info->duration = duration;
+ my_info->prop_delay = NET_DLY;
+ my_info->proc_delay = PROC_DLY;
+
+ /* Traverse the script_queue and fill out non-default values */
+
+ for (my_attr_val = HEAD_PFIFO(script_queue);
+ my_attr_val != NULL;
+ my_attr_val = my_attr_val->link) {
+
+ /* Set the desired value */
+ switch (my_attr_val->attr) {
+
+ case T_Freq_Offset:
+ my_info->freq_offset = my_attr_val->value.d;
+ break;
+
+ case T_Wander:
+ my_info->wander = my_attr_val->value.d;
+ break;
+
+ case T_Jitter:
+ my_info->jitter = my_attr_val->value.d;
+ break;
+
+ case T_Prop_Delay:
+ my_info->prop_delay = my_attr_val->value.d;
+ break;
+
+ case T_Proc_Delay:
+ my_info->proc_delay = my_attr_val->value.d;
+ break;
+
+ default:
+ msyslog(LOG_ERR, "Unknown script token %d",
+ my_attr_val->attr);
+ }
+ }
+
+ return my_info;
+}
+#endif /* SIM */
+
+
+#ifdef SIM
+static sockaddr_u *
+get_next_address(
+ address_node *addr
+ )
+{
+ const char addr_prefix[] = "192.168.0.";
+ static int curr_addr_num = 1;
+#define ADDR_LENGTH 16 + 1 /* room for 192.168.1.255 */
+ char addr_string[ADDR_LENGTH];
+ sockaddr_u *final_addr;
+ struct addrinfo *ptr;
+ int gai_err;
+
+ final_addr = emalloc(sizeof(*final_addr));
+
+ if (addr->type == T_String) {
+ snprintf(addr_string, sizeof(addr_string), "%s%d",
+ addr_prefix, curr_addr_num++);
+ printf("Selecting ip address %s for hostname %s\n",
+ addr_string, addr->address);
+ gai_err = getaddrinfo(addr_string, "ntp", NULL, &ptr);
+ } else {
+ gai_err = getaddrinfo(addr->address, "ntp", NULL, &ptr);
+ }
+
+ if (gai_err) {
+ fprintf(stderr, "ERROR!! Could not get a new address\n");
+ exit(1);
+ }
+ memcpy(final_addr, ptr->ai_addr, ptr->ai_addrlen);
+ fprintf(stderr, "Successful in setting ip address of simulated server to: %s\n",
+ stoa(final_addr));
+ freeaddrinfo(ptr);
+
+ return final_addr;
+}
+#endif /* SIM */
+
+
+#ifdef SIM
+server_info *
+create_sim_server(
+ address_node * addr,
+ double server_offset,
+ script_info_fifo * script
+ )
+{
+ server_info *my_info;
+
+ my_info = emalloc_zero(sizeof(*my_info));
+ my_info->server_time = server_offset;
+ my_info->addr = get_next_address(addr);
+ my_info->script = script;
+ UNLINK_FIFO(my_info->curr_script, *my_info->script, link);
+
+ return my_info;
+}
+#endif /* SIM */
+
+sim_node *
+create_sim_node(
+ attr_val_fifo * init_opts,
+ server_info_fifo * servers
+ )
+{
+ sim_node *my_node;
+
+ my_node = emalloc(sizeof(*my_node));
+ my_node->init_opts = init_opts;
+ my_node->servers = servers;
+
+ return my_node;
+}
+
+
+
+
+/* FUNCTIONS FOR PERFORMING THE CONFIGURATION
+ * ------------------------------------------
+ */
+
+#ifndef SIM
+static void
+config_other_modes(
+ config_tree * ptree
+ )
+{
+ sockaddr_u addr_sock;
+ address_node * addr_node;
+
+ if (ptree->broadcastclient)
+ proto_config(PROTO_BROADCLIENT, ptree->broadcastclient,
+ 0., NULL);
+
+ addr_node = HEAD_PFIFO(ptree->manycastserver);
+ while (addr_node != NULL) {
+ ZERO_SOCK(&addr_sock);
+ AF(&addr_sock) = addr_node->type;
+ if (1 == getnetnum(addr_node->address, &addr_sock, 1,
+ t_UNK)) {
+ proto_config(PROTO_MULTICAST_ADD,
+ 0, 0., &addr_sock);
+ sys_manycastserver = 1;
+ }
+ addr_node = addr_node->link;
+ }
+
+ /* Configure the multicast clients */
+ addr_node = HEAD_PFIFO(ptree->multicastclient);
+ if (addr_node != NULL) {
+ do {
+ ZERO_SOCK(&addr_sock);
+ AF(&addr_sock) = addr_node->type;
+ if (1 == getnetnum(addr_node->address,
+ &addr_sock, 1, t_UNK)) {
+ proto_config(PROTO_MULTICAST_ADD, 0, 0.,
+ &addr_sock);
+ }
+ addr_node = addr_node->link;
+ } while (addr_node != NULL);
+ proto_config(PROTO_MULTICAST_ADD, 1, 0., NULL);
+ }
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+destroy_address_fifo(
+ address_fifo * pfifo
+ )
+{
+ address_node * addr_node;
+
+ if (pfifo != NULL) {
+ for (;;) {
+ UNLINK_FIFO(addr_node, *pfifo, link);
+ if (addr_node == NULL)
+ break;
+ destroy_address_node(addr_node);
+ }
+ free(pfifo);
+ }
+}
+
+
+static void
+free_config_other_modes(
+ config_tree *ptree
+ )
+{
+ FREE_ADDRESS_FIFO(ptree->manycastserver);
+ FREE_ADDRESS_FIFO(ptree->multicastclient);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_auth(
+ config_tree *ptree
+ )
+{
+ attr_val * my_val;
+ int first;
+ int last;
+ int i;
+ int count;
+#ifdef AUTOKEY
+ int item;
+#endif
+
+ /* Crypto Command */
+#ifdef AUTOKEY
+ item = -1; /* quiet warning */
+ my_val = HEAD_PFIFO(ptree->auth.crypto_cmd_list);
+ for (; my_val != NULL; my_val = my_val->link) {
+ switch (my_val->attr) {
+
+ default:
+ INSIST(0);
+ break;
+
+ case T_Host:
+ item = CRYPTO_CONF_PRIV;
+ break;
+
+ case T_Ident:
+ item = CRYPTO_CONF_IDENT;
+ break;
+
+ case T_Pw:
+ item = CRYPTO_CONF_PW;
+ break;
+
+ case T_Randfile:
+ item = CRYPTO_CONF_RAND;
+ break;
+
+ case T_Digest:
+ item = CRYPTO_CONF_NID;
+ break;
+ }
+ crypto_config(item, my_val->value.s);
+ }
+#endif /* AUTOKEY */
+
+ /* Keysdir Command */
+ if (ptree->auth.keysdir) {
+ if (keysdir != default_keysdir)
+ free(keysdir);
+ keysdir = estrdup(ptree->auth.keysdir);
+ }
+
+
+ /* ntp_signd_socket Command */
+ if (ptree->auth.ntp_signd_socket) {
+ if (ntp_signd_socket != default_ntp_signd_socket)
+ free(ntp_signd_socket);
+ ntp_signd_socket = estrdup(ptree->auth.ntp_signd_socket);
+ }
+
+#ifdef AUTOKEY
+ if (ptree->auth.cryptosw && !cryptosw) {
+ crypto_setup();
+ cryptosw = 1;
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Count the number of trusted keys to preallocate storage and
+ * size the hash table.
+ */
+ count = 0;
+ my_val = HEAD_PFIFO(ptree->auth.trusted_key_list);
+ for (; my_val != NULL; my_val = my_val->link) {
+ if (T_Integer == my_val->type) {
+ first = my_val->value.i;
+ if (first > 1 && first <= NTP_MAXKEY)
+ count++;
+ } else {
+ REQUIRE(T_Intrange == my_val->type);
+ first = my_val->value.r.first;
+ last = my_val->value.r.last;
+ if (!(first > last || first < 1 ||
+ last > NTP_MAXKEY)) {
+ count += 1 + last - first;
+ }
+ }
+ }
+ auth_prealloc_symkeys(count);
+
+ /* Keys Command */
+ if (ptree->auth.keys)
+ getauthkeys(ptree->auth.keys);
+
+ /* Control Key Command */
+ if (ptree->auth.control_key)
+ ctl_auth_keyid = (keyid_t)ptree->auth.control_key;
+
+ /* Requested Key Command */
+ if (ptree->auth.request_key) {
+ DPRINTF(4, ("set info_auth_keyid to %08lx\n",
+ (u_long) ptree->auth.request_key));
+ info_auth_keyid = (keyid_t)ptree->auth.request_key;
+ }
+
+ /* Trusted Key Command */
+ my_val = HEAD_PFIFO(ptree->auth.trusted_key_list);
+ for (; my_val != NULL; my_val = my_val->link) {
+ if (T_Integer == my_val->type) {
+ first = my_val->value.i;
+ if (first >= 1 && first <= NTP_MAXKEY) {
+ authtrust(first, TRUE);
+ } else {
+ msyslog(LOG_NOTICE,
+ "Ignoring invalid trustedkey %d, min 1 max %d.",
+ first, NTP_MAXKEY);
+ }
+ } else {
+ first = my_val->value.r.first;
+ last = my_val->value.r.last;
+ if (first > last || first < 1 ||
+ last > NTP_MAXKEY) {
+ msyslog(LOG_NOTICE,
+ "Ignoring invalid trustedkey range %d ... %d, min 1 max %d.",
+ first, last, NTP_MAXKEY);
+ } else {
+ for (i = first; i <= last; i++) {
+ authtrust(i, TRUE);
+ }
+ }
+ }
+ }
+
+#ifdef AUTOKEY
+ /* crypto revoke command */
+ if (ptree->auth.revoke)
+ sys_revoke = 1UL << ptree->auth.revoke;
+#endif /* AUTOKEY */
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_auth(
+ config_tree *ptree
+ )
+{
+ destroy_attr_val_fifo(ptree->auth.crypto_cmd_list);
+ ptree->auth.crypto_cmd_list = NULL;
+ destroy_attr_val_fifo(ptree->auth.trusted_key_list);
+ ptree->auth.trusted_key_list = NULL;
+}
+#endif /* FREE_CFG_T */
+
+
+static void
+config_tos(
+ config_tree *ptree
+ )
+{
+ attr_val * tos;
+ int item;
+ double val;
+
+ item = -1; /* quiet warning */
+ tos = HEAD_PFIFO(ptree->orphan_cmds);
+ for (; tos != NULL; tos = tos->link) {
+ val = tos->value.d;
+ switch(tos->attr) {
+
+ default:
+ INSIST(0);
+ break;
+
+ case T_Ceiling:
+ if (val > STRATUM_UNSPEC - 1) {
+ msyslog(LOG_WARNING,
+ "Using maximum tos ceiling %d, %g requested",
+ STRATUM_UNSPEC - 1, val);
+ val = STRATUM_UNSPEC - 1;
+ }
+ item = PROTO_CEILING;
+ break;
+
+ case T_Floor:
+ item = PROTO_FLOOR;
+ break;
+
+ case T_Cohort:
+ item = PROTO_COHORT;
+ break;
+
+ case T_Orphan:
+ item = PROTO_ORPHAN;
+ break;
+
+ case T_Orphanwait:
+ item = PROTO_ORPHWAIT;
+ break;
+
+ case T_Mindist:
+ item = PROTO_MINDISP;
+ break;
+
+ case T_Maxdist:
+ item = PROTO_MAXDIST;
+ break;
+
+ case T_Minclock:
+ item = PROTO_MINCLOCK;
+ break;
+
+ case T_Maxclock:
+ item = PROTO_MAXCLOCK;
+ break;
+
+ case T_Minsane:
+ item = PROTO_MINSANE;
+ break;
+
+ case T_Beacon:
+ item = PROTO_BEACON;
+ break;
+ }
+ proto_config(item, 0, val, NULL);
+ }
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_tos(
+ config_tree *ptree
+ )
+{
+ FREE_ATTR_VAL_FIFO(ptree->orphan_cmds);
+}
+#endif /* FREE_CFG_T */
+
+
+static void
+config_monitor(
+ config_tree *ptree
+ )
+{
+ int_node *pfilegen_token;
+ const char *filegen_string;
+ const char *filegen_file;
+ FILEGEN *filegen;
+ filegen_node *my_node;
+ attr_val *my_opts;
+ int filegen_type;
+ int filegen_flag;
+
+ /* Set the statistics directory */
+ if (ptree->stats_dir)
+ stats_config(STATS_STATSDIR, ptree->stats_dir);
+
+ /* NOTE:
+ * Calling filegen_get is brain dead. Doing a string
+ * comparison to find the relavant filegen structure is
+ * expensive.
+ *
+ * Through the parser, we already know which filegen is
+ * being specified. Hence, we should either store a
+ * pointer to the specified structure in the syntax tree
+ * or an index into a filegen array.
+ *
+ * Need to change the filegen code to reflect the above.
+ */
+
+ /* Turn on the specified statistics */
+ pfilegen_token = HEAD_PFIFO(ptree->stats_list);
+ for (; pfilegen_token != NULL; pfilegen_token = pfilegen_token->link) {
+ filegen_string = keyword(pfilegen_token->i);
+ filegen = filegen_get(filegen_string);
+ if (NULL == filegen) {
+ msyslog(LOG_ERR,
+ "stats %s unrecognized",
+ filegen_string);
+ continue;
+ }
+ DPRINTF(4, ("enabling filegen for %s statistics '%s%s'\n",
+ filegen_string, filegen->dir,
+ filegen->fname));
+ filegen_flag = filegen->flag;
+ filegen_flag |= FGEN_FLAG_ENABLED;
+ filegen_config(filegen, statsdir, filegen_string,
+ filegen->type, filegen_flag);
+ }
+
+ /* Configure the statistics with the options */
+ my_node = HEAD_PFIFO(ptree->filegen_opts);
+ for (; my_node != NULL; my_node = my_node->link) {
+ filegen_string = keyword(my_node->filegen_token);
+ filegen = filegen_get(filegen_string);
+ if (NULL == filegen) {
+ msyslog(LOG_ERR,
+ "filegen category '%s' unrecognized",
+ filegen_string);
+ continue;
+ }
+ filegen_file = filegen_string;
+
+ /* Initialize the filegen variables to their pre-configuration states */
+ filegen_flag = filegen->flag;
+ filegen_type = filegen->type;
+
+ /* "filegen ... enabled" is the default (when filegen is used) */
+ filegen_flag |= FGEN_FLAG_ENABLED;
+
+ my_opts = HEAD_PFIFO(my_node->options);
+ for (; my_opts != NULL; my_opts = my_opts->link) {
+ switch (my_opts->attr) {
+
+ case T_File:
+ filegen_file = my_opts->value.s;
+ break;
+
+ case T_Type:
+ switch (my_opts->value.i) {
+
+ default:
+ INSIST(0);
+ break;
+
+ case T_None:
+ filegen_type = FILEGEN_NONE;
+ break;
+
+ case T_Pid:
+ filegen_type = FILEGEN_PID;
+ break;
+
+ case T_Day:
+ filegen_type = FILEGEN_DAY;
+ break;
+
+ case T_Week:
+ filegen_type = FILEGEN_WEEK;
+ break;
+
+ case T_Month:
+ filegen_type = FILEGEN_MONTH;
+ break;
+
+ case T_Year:
+ filegen_type = FILEGEN_YEAR;
+ break;
+
+ case T_Age:
+ filegen_type = FILEGEN_AGE;
+ break;
+ }
+ break;
+
+ case T_Flag:
+ switch (my_opts->value.i) {
+
+ case T_Link:
+ filegen_flag |= FGEN_FLAG_LINK;
+ break;
+
+ case T_Nolink:
+ filegen_flag &= ~FGEN_FLAG_LINK;
+ break;
+
+ case T_Enable:
+ filegen_flag |= FGEN_FLAG_ENABLED;
+ break;
+
+ case T_Disable:
+ filegen_flag &= ~FGEN_FLAG_ENABLED;
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "Unknown filegen flag token %d",
+ my_opts->value.i);
+ exit(1);
+ }
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "Unknown filegen option token %d",
+ my_opts->attr);
+ exit(1);
+ }
+ }
+ filegen_config(filegen, statsdir, filegen_file,
+ filegen_type, filegen_flag);
+ }
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_monitor(
+ config_tree *ptree
+ )
+{
+ if (ptree->stats_dir) {
+ free(ptree->stats_dir);
+ ptree->stats_dir = NULL;
+ }
+
+ FREE_INT_FIFO(ptree->stats_list);
+ FREE_FILEGEN_FIFO(ptree->filegen_opts);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_access(
+ config_tree *ptree
+ )
+{
+ static int warned_signd;
+ attr_val * my_opt;
+ restrict_node * my_node;
+ int_node * curr_flag;
+ sockaddr_u addr;
+ sockaddr_u mask;
+ struct addrinfo hints;
+ struct addrinfo * ai_list;
+ struct addrinfo * pai;
+ int rc;
+ int restrict_default;
+ u_short flags;
+ u_short mflags;
+ int range_err;
+ const char * signd_warning =
+#ifdef HAVE_NTP_SIGND
+ "MS-SNTP signd operations currently block ntpd degrading service to all clients.";
+#else
+ "mssntp restrict bit ignored, this ntpd was configured without --enable-ntp-signd.";
+#endif
+
+ /* Configure the mru options */
+ my_opt = HEAD_PFIFO(ptree->mru_opts);
+ for (; my_opt != NULL; my_opt = my_opt->link) {
+
+ range_err = FALSE;
+
+ switch (my_opt->attr) {
+
+ case T_Incalloc:
+ if (0 <= my_opt->value.i)
+ mru_incalloc = my_opt->value.u;
+ else
+ range_err = TRUE;
+ break;
+
+ case T_Incmem:
+ if (0 <= my_opt->value.i)
+ mru_incalloc = (my_opt->value.u * 1024U)
+ / sizeof(mon_entry);
+ else
+ range_err = TRUE;
+ break;
+
+ case T_Initalloc:
+ if (0 <= my_opt->value.i)
+ mru_initalloc = my_opt->value.u;
+ else
+ range_err = TRUE;
+ break;
+
+ case T_Initmem:
+ if (0 <= my_opt->value.i)
+ mru_initalloc = (my_opt->value.u * 1024U)
+ / sizeof(mon_entry);
+ else
+ range_err = TRUE;
+ break;
+
+ case T_Mindepth:
+ if (0 <= my_opt->value.i)
+ mru_mindepth = my_opt->value.u;
+ else
+ range_err = TRUE;
+ break;
+
+ case T_Maxage:
+ mru_maxage = my_opt->value.i;
+ break;
+
+ case T_Maxdepth:
+ if (0 <= my_opt->value.i)
+ mru_maxdepth = my_opt->value.u;
+ else
+ mru_maxdepth = UINT_MAX;
+ break;
+
+ case T_Maxmem:
+ if (0 <= my_opt->value.i)
+ mru_maxdepth = (my_opt->value.u * 1024U) /
+ sizeof(mon_entry);
+ else
+ mru_maxdepth = UINT_MAX;
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "Unknown mru option %s (%d)",
+ keyword(my_opt->attr), my_opt->attr);
+ exit(1);
+ }
+ if (range_err)
+ msyslog(LOG_ERR,
+ "mru %s %d out of range, ignored.",
+ keyword(my_opt->attr), my_opt->value.i);
+ }
+
+ /* Configure the discard options */
+ my_opt = HEAD_PFIFO(ptree->discard_opts);
+ for (; my_opt != NULL; my_opt = my_opt->link) {
+
+ switch (my_opt->attr) {
+
+ case T_Average:
+ if (0 <= my_opt->value.i &&
+ my_opt->value.i <= UCHAR_MAX)
+ ntp_minpoll = (u_char)my_opt->value.u;
+ else
+ msyslog(LOG_ERR,
+ "discard average %d out of range, ignored.",
+ my_opt->value.i);
+ break;
+
+ case T_Minimum:
+ ntp_minpkt = my_opt->value.i;
+ break;
+
+ case T_Monitor:
+ mon_age = my_opt->value.i;
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "Unknown discard option %s (%d)",
+ keyword(my_opt->attr), my_opt->attr);
+ exit(1);
+ }
+ }
+
+ /* Configure the restrict options */
+ my_node = HEAD_PFIFO(ptree->restrict_opts);
+ for (; my_node != NULL; my_node = my_node->link) {
+ /* Parse the flags */
+ flags = 0;
+ mflags = 0;
+
+ curr_flag = HEAD_PFIFO(my_node->flags);
+ for (; curr_flag != NULL; curr_flag = curr_flag->link) {
+ switch (curr_flag->i) {
+
+ default:
+ INSIST(0);
+ break;
+
+ case T_Ntpport:
+ mflags |= RESM_NTPONLY;
+ break;
+
+ case T_Source:
+ mflags |= RESM_SOURCE;
+ break;
+
+ case T_Flake:
+ flags |= RES_FLAKE;
+ break;
+
+ case T_Ignore:
+ flags |= RES_IGNORE;
+ break;
+
+ case T_Kod:
+ flags |= RES_KOD;
+ break;
+
+ case T_Mssntp:
+ flags |= RES_MSSNTP;
+ break;
+
+ case T_Limited:
+ flags |= RES_LIMITED;
+ break;
+
+ case T_Lowpriotrap:
+ flags |= RES_LPTRAP;
+ break;
+
+ case T_Nomodify:
+ flags |= RES_NOMODIFY;
+ break;
+
+ case T_Nomrulist:
+ flags |= RES_NOMRULIST;
+ break;
+
+ case T_Nopeer:
+ flags |= RES_NOPEER;
+ break;
+
+ case T_Noquery:
+ flags |= RES_NOQUERY;
+ break;
+
+ case T_Noserve:
+ flags |= RES_DONTSERVE;
+ break;
+
+ case T_Notrap:
+ flags |= RES_NOTRAP;
+ break;
+
+ case T_Notrust:
+ flags |= RES_DONTTRUST;
+ break;
+
+ case T_Version:
+ flags |= RES_VERSION;
+ break;
+ }
+ }
+
+ if ((RES_MSSNTP & flags) && !warned_signd) {
+ warned_signd = 1;
+ fprintf(stderr, "%s\n", signd_warning);
+ msyslog(LOG_WARNING, "%s", signd_warning);
+ }
+
+ /* It would be swell if we could identify the line number */
+ if ((RES_KOD & flags) && !(RES_LIMITED & flags)) {
+ char *kod_where = (my_node->addr)
+ ? my_node->addr->address
+ : (mflags & RESM_SOURCE)
+ ? "source"
+ : "default";
+ char *kod_warn = "KOD does nothing without LIMITED.";
+
+ fprintf(stderr, "restrict %s: %s\n", kod_where, kod_warn);
+ msyslog(LOG_WARNING, "restrict %s: %s", kod_where, kod_warn);
+ }
+
+ ZERO_SOCK(&addr);
+ ai_list = NULL;
+ pai = NULL;
+ restrict_default = 0;
+
+ if (NULL == my_node->addr) {
+ ZERO_SOCK(&mask);
+ if (!(RESM_SOURCE & mflags)) {
+ /*
+ * The user specified a default rule
+ * without a -4 / -6 qualifier, add to
+ * both lists
+ */
+ restrict_default = 1;
+ } else {
+ /* apply "restrict source ..." */
+ DPRINTF(1, ("restrict source template mflags %x flags %x\n",
+ mflags, flags));
+ hack_restrict(RESTRICT_FLAGS, NULL,
+ NULL, mflags, flags, 0);
+ continue;
+ }
+ } else {
+ /* Resolve the specified address */
+ AF(&addr) = (u_short)my_node->addr->type;
+
+ if (getnetnum(my_node->addr->address,
+ &addr, 1, t_UNK) != 1) {
+ /*
+ * Attempt a blocking lookup. This
+ * is in violation of the nonblocking
+ * design of ntpd's mainline code. The
+ * alternative of running without the
+ * restriction until the name resolved
+ * seems worse.
+ * Ideally some scheme could be used for
+ * restrict directives in the startup
+ * ntp.conf to delay starting up the
+ * protocol machinery until after all
+ * restrict hosts have been resolved.
+ */
+ ai_list = NULL;
+ ZERO(hints);
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_family = my_node->addr->type;
+ rc = getaddrinfo(my_node->addr->address,
+ "ntp", &hints,
+ &ai_list);
+ if (rc) {
+ msyslog(LOG_ERR,
+ "restrict: ignoring line %d, address/host '%s' unusable.",
+ my_node->line_no,
+ my_node->addr->address);
+ continue;
+ }
+ INSIST(ai_list != NULL);
+ pai = ai_list;
+ INSIST(pai->ai_addr != NULL);
+ INSIST(sizeof(addr) >=
+ pai->ai_addrlen);
+ memcpy(&addr, pai->ai_addr,
+ pai->ai_addrlen);
+ INSIST(AF_INET == AF(&addr) ||
+ AF_INET6 == AF(&addr));
+ }
+
+ SET_HOSTMASK(&mask, AF(&addr));
+
+ /* Resolve the mask */
+ if (my_node->mask) {
+ ZERO_SOCK(&mask);
+ AF(&mask) = my_node->mask->type;
+ if (getnetnum(my_node->mask->address,
+ &mask, 1, t_MSK) != 1) {
+ msyslog(LOG_ERR,
+ "restrict: ignoring line %d, mask '%s' unusable.",
+ my_node->line_no,
+ my_node->mask->address);
+ continue;
+ }
+ }
+ }
+
+ /* Set the flags */
+ if (restrict_default) {
+ AF(&addr) = AF_INET;
+ AF(&mask) = AF_INET;
+ hack_restrict(RESTRICT_FLAGS, &addr,
+ &mask, mflags, flags, 0);
+ AF(&addr) = AF_INET6;
+ AF(&mask) = AF_INET6;
+ }
+
+ do {
+ hack_restrict(RESTRICT_FLAGS, &addr,
+ &mask, mflags, flags, 0);
+ if (pai != NULL &&
+ NULL != (pai = pai->ai_next)) {
+ INSIST(pai->ai_addr != NULL);
+ INSIST(sizeof(addr) >=
+ pai->ai_addrlen);
+ ZERO_SOCK(&addr);
+ memcpy(&addr, pai->ai_addr,
+ pai->ai_addrlen);
+ INSIST(AF_INET == AF(&addr) ||
+ AF_INET6 == AF(&addr));
+ SET_HOSTMASK(&mask, AF(&addr));
+ }
+ } while (pai != NULL);
+
+ if (ai_list != NULL)
+ freeaddrinfo(ai_list);
+ }
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_access(
+ config_tree *ptree
+ )
+{
+ FREE_ATTR_VAL_FIFO(ptree->mru_opts);
+ FREE_ATTR_VAL_FIFO(ptree->discard_opts);
+ FREE_RESTRICT_FIFO(ptree->restrict_opts);
+}
+#endif /* FREE_CFG_T */
+
+
+static void
+config_rlimit(
+ config_tree *ptree
+ )
+{
+ attr_val * rlimit_av;
+
+ rlimit_av = HEAD_PFIFO(ptree->rlimit);
+ for (; rlimit_av != NULL; rlimit_av = rlimit_av->link) {
+ switch (rlimit_av->attr) {
+
+ default:
+ INSIST(0);
+ break;
+
+ case T_Memlock:
+ if (rlimit_av->value.i != 0) {
+#if defined(RLIMIT_MEMLOCK)
+ ntp_rlimit(RLIMIT_MEMLOCK,
+ (rlim_t)(rlimit_av->value.i * 1024 * 1024),
+ 1024 * 1024,
+ "MB");
+#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;
+ }
+ break;
+
+ case T_Stacksize:
+#if defined(RLIMIT_STACK)
+ ntp_rlimit(RLIMIT_STACK,
+ (rlim_t)(rlimit_av->value.i * 4096),
+ 4096,
+ "4k");
+#else
+ /* STDERR as well would be fine... */
+ msyslog(LOG_WARNING, "'rlimit stacksize' specified but is not available on this system.");
+#endif /* RLIMIT_STACK */
+ break;
+
+ case T_Filenum:
+#if defined(RLIMIT_NOFILE)
+ ntp_rlimit(RLIMIT_NOFILE,
+ (rlim_t)(rlimit_av->value.i),
+ 1,
+ "");
+#else
+ /* STDERR as well would be fine... */
+ msyslog(LOG_WARNING, "'rlimit filenum' specified but is not available on this system.");
+#endif /* RLIMIT_NOFILE */
+ break;
+
+ }
+ }
+}
+
+
+static void
+config_tinker(
+ config_tree *ptree
+ )
+{
+ attr_val * tinker;
+ int item;
+
+ item = -1; /* quiet warning */
+ tinker = HEAD_PFIFO(ptree->tinker);
+ for (; tinker != NULL; tinker = tinker->link) {
+ switch (tinker->attr) {
+
+ default:
+ INSIST(0);
+ break;
+
+ case T_Allan:
+ item = LOOP_ALLAN;
+ break;
+
+ case T_Dispersion:
+ item = LOOP_PHI;
+ break;
+
+ case T_Freq:
+ item = LOOP_FREQ;
+ break;
+
+ case T_Huffpuff:
+ item = LOOP_HUFFPUFF;
+ break;
+
+ case T_Panic:
+ item = LOOP_PANIC;
+ break;
+
+ case T_Step:
+ item = LOOP_MAX;
+ break;
+
+ case T_Stepout:
+ item = LOOP_MINSTEP;
+ break;
+
+ case T_Tick:
+ item = LOOP_TICK;
+ break;
+ }
+ loop_config(item, tinker->value.d);
+ }
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_rlimit(
+ config_tree *ptree
+ )
+{
+ FREE_ATTR_VAL_FIFO(ptree->rlimit);
+}
+
+static void
+free_config_tinker(
+ config_tree *ptree
+ )
+{
+ FREE_ATTR_VAL_FIFO(ptree->tinker);
+}
+#endif /* FREE_CFG_T */
+
+
+/*
+ * config_nic_rules - apply interface listen/ignore/drop items
+ */
+#ifndef SIM
+static void
+config_nic_rules(
+ config_tree *ptree
+ )
+{
+ nic_rule_node * curr_node;
+ sockaddr_u addr;
+ nic_rule_match match_type;
+ nic_rule_action action;
+ char * if_name;
+ char * pchSlash;
+ int prefixlen;
+ int addrbits;
+
+ curr_node = HEAD_PFIFO(ptree->nic_rules);
+
+ if (curr_node != NULL
+ && (HAVE_OPT( NOVIRTUALIPS ) || HAVE_OPT( INTERFACE ))) {
+ msyslog(LOG_ERR,
+ "interface/nic rules are not allowed with --interface (-I) or --novirtualips (-L)%s",
+ (input_from_file) ? ", exiting" : "");
+ if (input_from_file)
+ exit(1);
+ else
+ return;
+ }
+
+ for (; curr_node != NULL; curr_node = curr_node->link) {
+ prefixlen = -1;
+ if_name = curr_node->if_name;
+ if (if_name != NULL)
+ if_name = estrdup(if_name);
+
+ switch (curr_node->match_class) {
+
+ default:
+ /*
+ * this assignment quiets a gcc "may be used
+ * uninitialized" warning and is here for no
+ * other reason.
+ */
+ match_type = MATCH_ALL;
+ INSIST(FALSE);
+ break;
+
+ case 0:
+ /*
+ * 0 is out of range for valid token T_...
+ * and in a nic_rules_node indicates the
+ * interface descriptor is either a name or
+ * address, stored in if_name in either case.
+ */
+ INSIST(if_name != NULL);
+ pchSlash = strchr(if_name, '/');
+ if (pchSlash != NULL)
+ *pchSlash = '\0';
+ if (is_ip_address(if_name, AF_UNSPEC, &addr)) {
+ match_type = MATCH_IFADDR;
+ if (pchSlash != NULL
+ && 1 == sscanf(pchSlash + 1, "%d",
+ &prefixlen)) {
+ addrbits = 8 *
+ SIZEOF_INADDR(AF(&addr));
+ prefixlen = max(-1, prefixlen);
+ prefixlen = min(prefixlen,
+ addrbits);
+ }
+ } else {
+ match_type = MATCH_IFNAME;
+ if (pchSlash != NULL)
+ *pchSlash = '/';
+ }
+ break;
+
+ case T_All:
+ match_type = MATCH_ALL;
+ break;
+
+ case T_Ipv4:
+ match_type = MATCH_IPV4;
+ break;
+
+ case T_Ipv6:
+ match_type = MATCH_IPV6;
+ break;
+
+ case T_Wildcard:
+ match_type = MATCH_WILDCARD;
+ break;
+ }
+
+ switch (curr_node->action) {
+
+ default:
+ /*
+ * this assignment quiets a gcc "may be used
+ * uninitialized" warning and is here for no
+ * other reason.
+ */
+ action = ACTION_LISTEN;
+ INSIST(FALSE);
+ break;
+
+ case T_Listen:
+ action = ACTION_LISTEN;
+ break;
+
+ case T_Ignore:
+ action = ACTION_IGNORE;
+ break;
+
+ case T_Drop:
+ action = ACTION_DROP;
+ break;
+ }
+
+ add_nic_rule(match_type, if_name, prefixlen,
+ action);
+ timer_interfacetimeout(current_time + 2);
+ if (if_name != NULL)
+ free(if_name);
+ }
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_nic_rules(
+ config_tree *ptree
+ )
+{
+ nic_rule_node *curr_node;
+
+ if (ptree->nic_rules != NULL) {
+ for (;;) {
+ UNLINK_FIFO(curr_node, *ptree->nic_rules, link);
+ if (NULL == curr_node)
+ break;
+ free(curr_node->if_name);
+ free(curr_node);
+ }
+ free(ptree->nic_rules);
+ ptree->nic_rules = NULL;
+ }
+}
+#endif /* FREE_CFG_T */
+
+
+static void
+apply_enable_disable(
+ attr_val_fifo * fifo,
+ int enable
+ )
+{
+ attr_val *curr_flag;
+ int option;
+#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
+ bc_entry *pentry;
+#endif
+
+ for (curr_flag = HEAD_PFIFO(fifo);
+ curr_flag != NULL;
+ curr_flag = curr_flag->link) {
+
+ option = curr_flag->value.i;
+ switch (option) {
+
+ default:
+ msyslog(LOG_ERR,
+ "can not apply enable/disable token %d, unknown",
+ option);
+ break;
+
+ case T_Auth:
+ proto_config(PROTO_AUTHENTICATE, enable, 0., NULL);
+ break;
+
+ case T_Bclient:
+ proto_config(PROTO_BROADCLIENT, enable, 0., NULL);
+ break;
+
+ case T_Calibrate:
+ proto_config(PROTO_CAL, enable, 0., NULL);
+ break;
+
+ case T_Kernel:
+ proto_config(PROTO_KERNEL, enable, 0., NULL);
+ break;
+
+ case T_Monitor:
+ proto_config(PROTO_MONITOR, enable, 0., NULL);
+ break;
+
+ case T_Ntp:
+ proto_config(PROTO_NTP, enable, 0., NULL);
+ break;
+
+ case T_Mode7:
+ proto_config(PROTO_MODE7, enable, 0., NULL);
+ break;
+
+ case T_Stats:
+ proto_config(PROTO_FILEGEN, enable, 0., NULL);
+ break;
+
+#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
+ case T_Bc_bugXXXX:
+ pentry = bc_list;
+ while (pentry->token) {
+ if (pentry->token == option)
+ break;
+ pentry++;
+ }
+ if (!pentry->token) {
+ msyslog(LOG_ERR,
+ "compat token %d not in bc_list[]",
+ option);
+ continue;
+ }
+ pentry->enabled = enable;
+ break;
+#endif
+ }
+ }
+}
+
+
+static void
+config_system_opts(
+ config_tree *ptree
+ )
+{
+ apply_enable_disable(ptree->enable_opts, 1);
+ apply_enable_disable(ptree->disable_opts, 0);
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_system_opts(
+ config_tree *ptree
+ )
+{
+ FREE_ATTR_VAL_FIFO(ptree->enable_opts);
+ FREE_ATTR_VAL_FIFO(ptree->disable_opts);
+}
+#endif /* FREE_CFG_T */
+
+
+static void
+config_logconfig(
+ config_tree *ptree
+ )
+{
+ attr_val * my_lc;
+
+ my_lc = HEAD_PFIFO(ptree->logconfig);
+ for (; my_lc != NULL; my_lc = my_lc->link) {
+ switch (my_lc->attr) {
+
+ case '+':
+ ntp_syslogmask |= get_logmask(my_lc->value.s);
+ break;
+
+ case '-':
+ ntp_syslogmask &= ~get_logmask(my_lc->value.s);
+ break;
+
+ case '=':
+ ntp_syslogmask = get_logmask(my_lc->value.s);
+ break;
+ default:
+ INSIST(0);
+ break;
+ }
+ }
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_logconfig(
+ config_tree *ptree
+ )
+{
+ FREE_ATTR_VAL_FIFO(ptree->logconfig);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_phone(
+ config_tree *ptree
+ )
+{
+ int i;
+ string_node * sn;
+
+ i = 0;
+ sn = HEAD_PFIFO(ptree->phone);
+ for (; sn != NULL; sn = sn->link) {
+ /* need to leave array entry for NULL terminator */
+ if (i < COUNTOF(sys_phone) - 1) {
+ sys_phone[i++] = estrdup(sn->s);
+ sys_phone[i] = NULL;
+ } else {
+ msyslog(LOG_INFO,
+ "phone: Number of phone entries exceeds %lu. Ignoring phone %s...",
+ (u_long)(COUNTOF(sys_phone) - 1), sn->s);
+ }
+ }
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_phone(
+ config_tree *ptree
+ )
+{
+ FREE_STRING_FIFO(ptree->phone);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_setvar(
+ config_tree *ptree
+ )
+{
+ setvar_node *my_node;
+ size_t varlen, vallen, octets;
+ char * str;
+
+ str = NULL;
+ my_node = HEAD_PFIFO(ptree->setvar);
+ for (; my_node != NULL; my_node = my_node->link) {
+ varlen = strlen(my_node->var);
+ vallen = strlen(my_node->val);
+ octets = varlen + vallen + 1 + 1;
+ str = erealloc(str, octets);
+ snprintf(str, octets, "%s=%s", my_node->var,
+ my_node->val);
+ set_sys_var(str, octets, (my_node->isdefault)
+ ? DEF
+ : 0);
+ }
+ if (str != NULL)
+ free(str);
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_setvar(
+ config_tree *ptree
+ )
+{
+ FREE_SETVAR_FIFO(ptree->setvar);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_ttl(
+ config_tree *ptree
+ )
+{
+ int i = 0;
+ int_node *curr_ttl;
+
+ curr_ttl = HEAD_PFIFO(ptree->ttl);
+ for (; curr_ttl != NULL; curr_ttl = curr_ttl->link) {
+ if (i < COUNTOF(sys_ttl))
+ sys_ttl[i++] = (u_char)curr_ttl->i;
+ else
+ msyslog(LOG_INFO,
+ "ttl: Number of TTL entries exceeds %lu. Ignoring TTL %d...",
+ (u_long)COUNTOF(sys_ttl), curr_ttl->i);
+ }
+ sys_ttlmax = i - 1;
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_ttl(
+ config_tree *ptree
+ )
+{
+ FREE_INT_FIFO(ptree->ttl);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_trap(
+ config_tree *ptree
+ )
+{
+ addr_opts_node *curr_trap;
+ attr_val *curr_opt;
+ sockaddr_u addr_sock;
+ sockaddr_u peeraddr;
+ struct interface *localaddr;
+ struct addrinfo hints;
+ char port_text[8];
+ settrap_parms *pstp;
+ u_short port;
+ int err_flag;
+ int rc;
+
+ /* silence warning about addr_sock potentially uninitialized */
+ AF(&addr_sock) = AF_UNSPEC;
+
+ curr_trap = HEAD_PFIFO(ptree->trap);
+ for (; curr_trap != NULL; curr_trap = curr_trap->link) {
+ err_flag = 0;
+ port = 0;
+ localaddr = NULL;
+
+ curr_opt = HEAD_PFIFO(curr_trap->options);
+ for (; curr_opt != NULL; curr_opt = curr_opt->link) {
+ if (T_Port == curr_opt->attr) {
+ if (curr_opt->value.i < 1
+ || curr_opt->value.i > USHRT_MAX) {
+ msyslog(LOG_ERR,
+ "invalid port number "
+ "%d, trap ignored",
+ curr_opt->value.i);
+ err_flag = 1;
+ }
+ port = (u_short)curr_opt->value.i;
+ }
+ else if (T_Interface == curr_opt->attr) {
+ /* Resolve the interface address */
+ ZERO_SOCK(&addr_sock);
+ if (getnetnum(curr_opt->value.s,
+ &addr_sock, 1, t_UNK) != 1) {
+ err_flag = 1;
+ break;
+ }
+
+ localaddr = findinterface(&addr_sock);
+
+ if (NULL == localaddr) {
+ msyslog(LOG_ERR,
+ "can't find interface with address %s",
+ stoa(&addr_sock));
+ err_flag = 1;
+ }
+ }
+ }
+
+ /* Now process the trap for the specified interface
+ * and port number
+ */
+ if (!err_flag) {
+ if (!port)
+ port = TRAPPORT;
+ ZERO_SOCK(&peeraddr);
+ rc = getnetnum(curr_trap->addr->address,
+ &peeraddr, 1, t_UNK);
+ if (1 != rc) {
+#ifndef WORKER
+ msyslog(LOG_ERR,
+ "trap: unable to use IP address %s.",
+ curr_trap->addr->address);
+#else /* WORKER follows */
+ /*
+ * save context and hand it off
+ * for name resolution.
+ */
+ ZERO(hints);
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_socktype = SOCK_DGRAM;
+ snprintf(port_text, sizeof(port_text),
+ "%u", port);
+ hints.ai_flags = Z_AI_NUMERICSERV;
+ pstp = emalloc_zero(sizeof(*pstp));
+ if (localaddr != NULL) {
+ hints.ai_family = localaddr->family;
+ pstp->ifaddr_nonnull = 1;
+ memcpy(&pstp->ifaddr,
+ &localaddr->sin,
+ sizeof(pstp->ifaddr));
+ }
+ rc = getaddrinfo_sometime(
+ curr_trap->addr->address,
+ port_text, &hints,
+ INITIAL_DNS_RETRY,
+ &trap_name_resolved,
+ pstp);
+ if (!rc)
+ msyslog(LOG_ERR,
+ "config_trap: getaddrinfo_sometime(%s,%s): %m",
+ curr_trap->addr->address,
+ port_text);
+#endif /* WORKER */
+ continue;
+ }
+ /* port is at same location for v4 and v6 */
+ SET_PORT(&peeraddr, port);
+
+ if (NULL == localaddr)
+ localaddr = ANY_INTERFACE_CHOOSE(&peeraddr);
+ else
+ AF(&peeraddr) = AF(&addr_sock);
+
+ if (!ctlsettrap(&peeraddr, localaddr, 0,
+ NTP_VERSION))
+ msyslog(LOG_ERR,
+ "set trap %s -> %s failed.",
+ latoa(localaddr),
+ stoa(&peeraddr));
+ }
+ }
+}
+
+
+/*
+ * trap_name_resolved()
+ *
+ * Callback invoked when config_trap()'s DNS lookup completes.
+ */
+# ifdef WORKER
+static void
+trap_name_resolved(
+ int rescode,
+ int gai_errno,
+ void * context,
+ const char * name,
+ const char * service,
+ const struct addrinfo * hints,
+ const struct addrinfo * res
+ )
+{
+ settrap_parms *pstp;
+ struct interface *localaddr;
+ sockaddr_u peeraddr;
+
+ (void)gai_errno;
+ (void)service;
+ (void)hints;
+ pstp = context;
+ if (rescode) {
+ msyslog(LOG_ERR,
+ "giving up resolving trap host %s: %s (%d)",
+ name, gai_strerror(rescode), rescode);
+ free(pstp);
+ return;
+ }
+ INSIST(sizeof(peeraddr) >= res->ai_addrlen);
+ ZERO(peeraddr);
+ memcpy(&peeraddr, res->ai_addr, res->ai_addrlen);
+ localaddr = NULL;
+ if (pstp->ifaddr_nonnull)
+ localaddr = findinterface(&pstp->ifaddr);
+ if (NULL == localaddr)
+ localaddr = ANY_INTERFACE_CHOOSE(&peeraddr);
+ if (!ctlsettrap(&peeraddr, localaddr, 0, NTP_VERSION))
+ msyslog(LOG_ERR, "set trap %s -> %s failed.",
+ latoa(localaddr), stoa(&peeraddr));
+ free(pstp);
+}
+# endif /* WORKER */
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_trap(
+ config_tree *ptree
+ )
+{
+ FREE_ADDR_OPTS_FIFO(ptree->trap);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_fudge(
+ config_tree *ptree
+ )
+{
+ addr_opts_node *curr_fudge;
+ attr_val *curr_opt;
+ sockaddr_u addr_sock;
+ address_node *addr_node;
+ struct refclockstat clock_stat;
+ int err_flag;
+
+ curr_fudge = HEAD_PFIFO(ptree->fudge);
+ for (; curr_fudge != NULL; curr_fudge = curr_fudge->link) {
+ err_flag = 0;
+
+ /* Get the reference clock address and
+ * ensure that it is sane
+ */
+ addr_node = curr_fudge->addr;
+ ZERO_SOCK(&addr_sock);
+ if (getnetnum(addr_node->address, &addr_sock, 1, t_REF)
+ != 1) {
+ err_flag = 1;
+ msyslog(LOG_ERR,
+ "unrecognized fudge reference clock address %s, line ignored",
+ stoa(&addr_sock));
+ }
+
+ if (!ISREFCLOCKADR(&addr_sock)) {
+ err_flag = 1;
+ msyslog(LOG_ERR,
+ "inappropriate address %s for the fudge command, line ignored",
+ stoa(&addr_sock));
+ }
+
+ /* Parse all the options to the fudge command */
+ ZERO(clock_stat);
+ curr_opt = HEAD_PFIFO(curr_fudge->options);
+ for (; curr_opt != NULL; curr_opt = curr_opt->link) {
+ switch (curr_opt->attr) {
+
+ case T_Time1:
+ clock_stat.haveflags |= CLK_HAVETIME1;
+ clock_stat.fudgetime1 = curr_opt->value.d;
+ break;
+
+ case T_Time2:
+ clock_stat.haveflags |= CLK_HAVETIME2;
+ clock_stat.fudgetime2 = curr_opt->value.d;
+ break;
+
+ case T_Stratum:
+ clock_stat.haveflags |= CLK_HAVEVAL1;
+ clock_stat.fudgeval1 = curr_opt->value.i;
+ break;
+
+ case T_Refid:
+ clock_stat.haveflags |= CLK_HAVEVAL2;
+ clock_stat.fudgeval2 = 0;
+ memcpy(&clock_stat.fudgeval2,
+ curr_opt->value.s,
+ min(strlen(curr_opt->value.s), 4));
+ break;
+
+ case T_Flag1:
+ clock_stat.haveflags |= CLK_HAVEFLAG1;
+ if (curr_opt->value.i)
+ clock_stat.flags |= CLK_FLAG1;
+ else
+ clock_stat.flags &= ~CLK_FLAG1;
+ break;
+
+ case T_Flag2:
+ clock_stat.haveflags |= CLK_HAVEFLAG2;
+ if (curr_opt->value.i)
+ clock_stat.flags |= CLK_FLAG2;
+ else
+ clock_stat.flags &= ~CLK_FLAG2;
+ break;
+
+ case T_Flag3:
+ clock_stat.haveflags |= CLK_HAVEFLAG3;
+ if (curr_opt->value.i)
+ clock_stat.flags |= CLK_FLAG3;
+ else
+ clock_stat.flags &= ~CLK_FLAG3;
+ break;
+
+ case T_Flag4:
+ clock_stat.haveflags |= CLK_HAVEFLAG4;
+ if (curr_opt->value.i)
+ clock_stat.flags |= CLK_FLAG4;
+ else
+ clock_stat.flags &= ~CLK_FLAG4;
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "Unexpected fudge flag %s (%d) for %s",
+ token_name(curr_opt->attr),
+ curr_opt->attr, stoa(&addr_sock));
+ exit(curr_opt->attr ? curr_opt->attr : 1);
+ }
+ }
+# ifdef REFCLOCK
+ if (!err_flag)
+ refclock_control(&addr_sock, &clock_stat, NULL);
+# endif
+ }
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_fudge(
+ config_tree *ptree
+ )
+{
+ FREE_ADDR_OPTS_FIFO(ptree->fudge);
+}
+#endif /* FREE_CFG_T */
+
+
+static void
+config_vars(
+ config_tree *ptree
+ )
+{
+ attr_val *curr_var;
+ int len;
+
+ curr_var = HEAD_PFIFO(ptree->vars);
+ for (; curr_var != NULL; curr_var = curr_var->link) {
+ /* Determine which variable to set and set it */
+ switch (curr_var->attr) {
+
+ case T_Broadcastdelay:
+ proto_config(PROTO_BROADDELAY, 0, curr_var->value.d, NULL);
+ break;
+
+ case T_Tick:
+ loop_config(LOOP_TICK, curr_var->value.d);
+ break;
+
+ case T_Driftfile:
+ if ('\0' == curr_var->value.s[0]) {
+ stats_drift_file = 0;
+ msyslog(LOG_INFO, "config: driftfile disabled");
+ } else
+ stats_config(STATS_FREQ_FILE, curr_var->value.s);
+ break;
+
+ case T_Ident:
+ sys_ident = curr_var->value.s;
+ break;
+
+ case T_WanderThreshold: /* FALLTHROUGH */
+ case T_Nonvolatile:
+ wander_threshold = curr_var->value.d;
+ break;
+
+ case T_Leapfile:
+ stats_config(STATS_LEAP_FILE, curr_var->value.s);
+ break;
+
+ case T_Pidfile:
+ stats_config(STATS_PID_FILE, curr_var->value.s);
+ break;
+
+ case T_Logfile:
+ if (-1 == change_logfile(curr_var->value.s, TRUE))
+ msyslog(LOG_ERR,
+ "Cannot open logfile %s: %m",
+ curr_var->value.s);
+ break;
+
+ case T_Saveconfigdir:
+ if (saveconfigdir != NULL)
+ free(saveconfigdir);
+ len = strlen(curr_var->value.s);
+ if (0 == len) {
+ saveconfigdir = NULL;
+ } else if (DIR_SEP != curr_var->value.s[len - 1]
+#ifdef SYS_WINNT /* slash is also a dir. sep. on Windows */
+ && '/' != curr_var->value.s[len - 1]
+#endif
+ ) {
+ len++;
+ saveconfigdir = emalloc(len + 1);
+ snprintf(saveconfigdir, len + 1,
+ "%s%c",
+ curr_var->value.s,
+ DIR_SEP);
+ } else {
+ saveconfigdir = estrdup(
+ curr_var->value.s);
+ }
+ break;
+
+ case T_Automax:
+#ifdef AUTOKEY
+ sys_automax = curr_var->value.i;
+#endif
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "config_vars(): unexpected token %d",
+ curr_var->attr);
+ }
+ }
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_vars(
+ config_tree *ptree
+ )
+{
+ FREE_ATTR_VAL_FIFO(ptree->vars);
+}
+#endif /* FREE_CFG_T */
+
+
+/* Define a function to check if a resolved address is sane.
+ * If yes, return 1, else return 0;
+ */
+static int
+is_sane_resolved_address(
+ sockaddr_u * peeraddr,
+ int hmode
+ )
+{
+ if (!ISREFCLOCKADR(peeraddr) && ISBADADR(peeraddr)) {
+ msyslog(LOG_ERR,
+ "attempt to configure invalid address %s",
+ stoa(peeraddr));
+ return 0;
+ }
+ /*
+ * Shouldn't be able to specify multicast
+ * address for server/peer!
+ * and unicast address for manycastclient!
+ */
+ if ((T_Server == hmode || T_Peer == hmode || T_Pool == hmode)
+ && IS_MCAST(peeraddr)) {
+ msyslog(LOG_ERR,
+ "attempt to configure invalid address %s",
+ stoa(peeraddr));
+ return 0;
+ }
+ if (T_Manycastclient == hmode && !IS_MCAST(peeraddr)) {
+ msyslog(LOG_ERR,
+ "attempt to configure invalid address %s",
+ stoa(peeraddr));
+ return 0;
+ }
+
+ if (IS_IPV6(peeraddr) && !ipv6_works)
+ return 0;
+
+ /* Ok, all tests succeeded, now we can return 1 */
+ return 1;
+}
+
+
+#ifndef SIM
+static u_char
+get_correct_host_mode(
+ int token
+ )
+{
+ switch (token) {
+
+ case T_Server:
+ case T_Pool:
+ case T_Manycastclient:
+ return MODE_CLIENT;
+
+ case T_Peer:
+ return MODE_ACTIVE;
+
+ case T_Broadcast:
+ return MODE_BROADCAST;
+
+ default:
+ return 0;
+ }
+}
+
+
+/*
+ * peerflag_bits() get config_peers() peerflags value from a
+ * peer_node's queue of flag attr_val entries.
+ */
+static int
+peerflag_bits(
+ peer_node *pn
+ )
+{
+ int peerflags;
+ attr_val *option;
+
+ /* translate peerflags options to bits */
+ peerflags = 0;
+ option = HEAD_PFIFO(pn->peerflags);
+ for (; option != NULL; option = option->link) {
+ switch (option->value.i) {
+
+ default:
+ INSIST(0);
+ break;
+
+ case T_Autokey:
+ peerflags |= FLAG_SKEY;
+ break;
+
+ case T_Burst:
+ peerflags |= FLAG_BURST;
+ break;
+
+ case T_Iburst:
+ peerflags |= FLAG_IBURST;
+ break;
+
+ case T_Noselect:
+ peerflags |= FLAG_NOSELECT;
+ break;
+
+ case T_Preempt:
+ peerflags |= FLAG_PREEMPT;
+ break;
+
+ case T_Prefer:
+ peerflags |= FLAG_PREFER;
+ break;
+
+ case T_True:
+ peerflags |= FLAG_TRUE;
+ break;
+
+ case T_Xleave:
+ peerflags |= FLAG_XLEAVE;
+ break;
+ }
+ }
+
+ return peerflags;
+}
+
+
+static void
+config_peers(
+ config_tree *ptree
+ )
+{
+ sockaddr_u peeraddr;
+ struct addrinfo hints;
+ peer_node * curr_peer;
+ peer_resolved_ctx * ctx;
+ u_char hmode;
+
+ /* add servers named on the command line with iburst implied */
+ for (;
+ cmdline_server_count > 0;
+ cmdline_server_count--, cmdline_servers++) {
+
+ ZERO_SOCK(&peeraddr);
+ /*
+ * If we have a numeric address, we can safely
+ * proceed in the mainline with it. Otherwise, hand
+ * the hostname off to the blocking child.
+ */
+ if (is_ip_address(*cmdline_servers, AF_UNSPEC,
+ &peeraddr)) {
+
+ SET_PORT(&peeraddr, NTP_PORT);
+ if (is_sane_resolved_address(&peeraddr,
+ T_Server))
+ peer_config(
+ &peeraddr,
+ NULL,
+ NULL,
+ MODE_CLIENT,
+ NTP_VERSION,
+ 0,
+ 0,
+ FLAG_IBURST,
+ 0,
+ 0,
+ NULL);
+ } else {
+ /* we have a hostname to resolve */
+# ifdef WORKER
+ ctx = emalloc_zero(sizeof(*ctx));
+ ctx->family = AF_UNSPEC;
+ ctx->host_mode = T_Server;
+ ctx->hmode = MODE_CLIENT;
+ ctx->version = NTP_VERSION;
+ ctx->flags = FLAG_IBURST;
+
+ ZERO(hints);
+ hints.ai_family = (u_short)ctx->family;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+
+ getaddrinfo_sometime(*cmdline_servers,
+ "ntp", &hints,
+ INITIAL_DNS_RETRY,
+ &peer_name_resolved,
+ (void *)ctx);
+# else /* !WORKER follows */
+ msyslog(LOG_ERR,
+ "hostname %s can not be used, please use IP address instead.",
+ curr_peer->addr->address);
+# endif
+ }
+ }
+
+ /* add associations from the configuration file */
+ curr_peer = HEAD_PFIFO(ptree->peers);
+ for (; curr_peer != NULL; curr_peer = curr_peer->link) {
+ ZERO_SOCK(&peeraddr);
+ /* Find the correct host-mode */
+ hmode = get_correct_host_mode(curr_peer->host_mode);
+ INSIST(hmode != 0);
+
+ if (T_Pool == curr_peer->host_mode) {
+ AF(&peeraddr) = curr_peer->addr->type;
+ peer_config(
+ &peeraddr,
+ curr_peer->addr->address,
+ NULL,
+ hmode,
+ curr_peer->peerversion,
+ curr_peer->minpoll,
+ curr_peer->maxpoll,
+ peerflag_bits(curr_peer),
+ curr_peer->ttl,
+ curr_peer->peerkey,
+ curr_peer->group);
+ /*
+ * If we have a numeric address, we can safely
+ * proceed in the mainline with it. Otherwise, hand
+ * the hostname off to the blocking child.
+ */
+ } else if (is_ip_address(curr_peer->addr->address,
+ curr_peer->addr->type, &peeraddr)) {
+
+ SET_PORT(&peeraddr, NTP_PORT);
+ if (is_sane_resolved_address(&peeraddr,
+ curr_peer->host_mode))
+ peer_config(
+ &peeraddr,
+ NULL,
+ NULL,
+ hmode,
+ curr_peer->peerversion,
+ curr_peer->minpoll,
+ curr_peer->maxpoll,
+ peerflag_bits(curr_peer),
+ curr_peer->ttl,
+ curr_peer->peerkey,
+ curr_peer->group);
+ } else {
+ /* we have a hostname to resolve */
+# ifdef WORKER
+ ctx = emalloc_zero(sizeof(*ctx));
+ ctx->family = curr_peer->addr->type;
+ ctx->host_mode = curr_peer->host_mode;
+ ctx->hmode = hmode;
+ ctx->version = curr_peer->peerversion;
+ ctx->minpoll = curr_peer->minpoll;
+ ctx->maxpoll = curr_peer->maxpoll;
+ ctx->flags = peerflag_bits(curr_peer);
+ ctx->ttl = curr_peer->ttl;
+ ctx->keyid = curr_peer->peerkey;
+ ctx->group = curr_peer->group;
+
+ ZERO(hints);
+ hints.ai_family = ctx->family;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+
+ getaddrinfo_sometime(curr_peer->addr->address,
+ "ntp", &hints,
+ INITIAL_DNS_RETRY,
+ &peer_name_resolved, ctx);
+# else /* !WORKER follows */
+ msyslog(LOG_ERR,
+ "hostname %s can not be used, please use IP address instead.",
+ curr_peer->addr->address);
+# endif
+ }
+ }
+}
+#endif /* !SIM */
+
+/*
+ * peer_name_resolved()
+ *
+ * Callback invoked when config_peers()'s DNS lookup completes.
+ */
+#ifdef WORKER
+static void
+peer_name_resolved(
+ int rescode,
+ int gai_errno,
+ void * context,
+ const char * name,
+ const char * service,
+ const struct addrinfo * hints,
+ const struct addrinfo * res
+ )
+{
+ sockaddr_u peeraddr;
+ peer_resolved_ctx * ctx;
+ u_short af;
+ const char * fam_spec;
+
+ (void)gai_errno;
+ (void)service;
+ (void)hints;
+ ctx = context;
+
+ DPRINTF(1, ("peer_name_resolved(%s) rescode %d\n", name, rescode));
+
+ if (rescode) {
+#ifndef IGNORE_DNS_ERRORS
+ free(ctx);
+ msyslog(LOG_ERR,
+ "giving up resolving host %s: %s (%d)",
+ name, gai_strerror(rescode), rescode);
+#else /* IGNORE_DNS_ERRORS follows */
+ getaddrinfo_sometime(name, service, hints,
+ INITIAL_DNS_RETRY,
+ &peer_name_resolved, context);
+#endif
+ return;
+ }
+
+ /* Loop to configure a single association */
+ for (; res != NULL; res = res->ai_next) {
+ memcpy(&peeraddr, res->ai_addr, res->ai_addrlen);
+ if (is_sane_resolved_address(&peeraddr,
+ ctx->host_mode)) {
+ NLOG(NLOG_SYSINFO) {
+ af = ctx->family;
+ fam_spec = (AF_INET6 == af)
+ ? "(AAAA) "
+ : (AF_INET == af)
+ ? "(A) "
+ : "";
+ msyslog(LOG_INFO, "DNS %s %s-> %s",
+ name, fam_spec,
+ stoa(&peeraddr));
+ }
+ peer_config(
+ &peeraddr,
+ NULL,
+ NULL,
+ ctx->hmode,
+ ctx->version,
+ ctx->minpoll,
+ ctx->maxpoll,
+ ctx->flags,
+ ctx->ttl,
+ ctx->keyid,
+ ctx->group);
+ break;
+ }
+ }
+ free(ctx);
+}
+#endif /* WORKER */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_peers(
+ config_tree *ptree
+ )
+{
+ peer_node *curr_peer;
+
+ if (ptree->peers != NULL) {
+ for (;;) {
+ UNLINK_FIFO(curr_peer, *ptree->peers, link);
+ if (NULL == curr_peer)
+ break;
+ destroy_address_node(curr_peer->addr);
+ destroy_attr_val_fifo(curr_peer->peerflags);
+ free(curr_peer);
+ }
+ free(ptree->peers);
+ ptree->peers = NULL;
+ }
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_unpeers(
+ config_tree *ptree
+ )
+{
+ sockaddr_u peeraddr;
+ struct addrinfo hints;
+ unpeer_node * curr_unpeer;
+ struct peer * p;
+ const char * name;
+ int rc;
+
+ curr_unpeer = HEAD_PFIFO(ptree->unpeers);
+ for (; curr_unpeer != NULL; curr_unpeer = curr_unpeer->link) {
+ /*
+ * Either AssocID will be zero, and we unpeer by name/
+ * address addr, or it is nonzero and addr NULL.
+ */
+ if (curr_unpeer->assocID) {
+ p = findpeerbyassoc(curr_unpeer->assocID);
+ if (p != NULL) {
+ msyslog(LOG_NOTICE, "unpeered %s",
+ stoa(&p->srcadr));
+ peer_clear(p, "GONE");
+ unpeer(p);
+ }
+
+ continue;
+ }
+
+ ZERO(peeraddr);
+ AF(&peeraddr) = curr_unpeer->addr->type;
+ name = curr_unpeer->addr->address;
+ rc = getnetnum(name, &peeraddr, 0, t_UNK);
+ /* Do we have a numeric address? */
+ if (rc > 0) {
+ DPRINTF(1, ("unpeer: searching for %s\n",
+ stoa(&peeraddr)));
+ p = findexistingpeer(&peeraddr, NULL, NULL, -1, 0);
+ if (p != NULL) {
+ msyslog(LOG_NOTICE, "unpeered %s",
+ stoa(&peeraddr));
+ peer_clear(p, "GONE");
+ unpeer(p);
+ }
+
+ continue;
+ }
+ /*
+ * It's not a numeric IP address, it's a hostname.
+ * Check for associations with a matching hostname.
+ */
+ for (p = peer_list; p != NULL; p = p->p_link)
+ if (p->hostname != NULL)
+ if (!strcasecmp(p->hostname, name))
+ break;
+ if (p != NULL) {
+ msyslog(LOG_NOTICE, "unpeered %s", name);
+ peer_clear(p, "GONE");
+ unpeer(p);
+ }
+ /* Resolve the hostname to address(es). */
+# ifdef WORKER
+ ZERO(hints);
+ hints.ai_family = curr_unpeer->addr->type;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+ getaddrinfo_sometime(name, "ntp", &hints,
+ INITIAL_DNS_RETRY,
+ &unpeer_name_resolved, NULL);
+# else /* !WORKER follows */
+ msyslog(LOG_ERR,
+ "hostname %s can not be used, please use IP address instead.",
+ name);
+# endif
+ }
+}
+#endif /* !SIM */
+
+
+/*
+ * unpeer_name_resolved()
+ *
+ * Callback invoked when config_unpeers()'s DNS lookup completes.
+ */
+#ifdef WORKER
+static void
+unpeer_name_resolved(
+ int rescode,
+ int gai_errno,
+ void * context,
+ const char * name,
+ const char * service,
+ const struct addrinfo * hints,
+ const struct addrinfo * res
+ )
+{
+ sockaddr_u peeraddr;
+ struct peer * peer;
+ u_short af;
+ const char * fam_spec;
+
+ (void)context;
+ (void)hints;
+ DPRINTF(1, ("unpeer_name_resolved(%s) rescode %d\n", name, rescode));
+
+ if (rescode) {
+ msyslog(LOG_ERR, "giving up resolving unpeer %s: %s (%d)",
+ name, gai_strerror(rescode), rescode);
+ return;
+ }
+ /*
+ * Loop through the addresses found
+ */
+ for (; res != NULL; res = res->ai_next) {
+ INSIST(res->ai_addrlen <= sizeof(peeraddr));
+ memcpy(&peeraddr, res->ai_addr, res->ai_addrlen);
+ DPRINTF(1, ("unpeer: searching for peer %s\n",
+ stoa(&peeraddr)));
+ peer = findexistingpeer(&peeraddr, NULL, NULL, -1, 0);
+ if (peer != NULL) {
+ af = AF(&peeraddr);
+ fam_spec = (AF_INET6 == af)
+ ? "(AAAA) "
+ : (AF_INET == af)
+ ? "(A) "
+ : "";
+ msyslog(LOG_NOTICE, "unpeered %s %s-> %s", name,
+ fam_spec, stoa(&peeraddr));
+ peer_clear(peer, "GONE");
+ unpeer(peer);
+ }
+ }
+}
+#endif /* WORKER */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_unpeers(
+ config_tree *ptree
+ )
+{
+ unpeer_node *curr_unpeer;
+
+ if (ptree->unpeers != NULL) {
+ for (;;) {
+ UNLINK_FIFO(curr_unpeer, *ptree->unpeers, link);
+ if (NULL == curr_unpeer)
+ break;
+ destroy_address_node(curr_unpeer->addr);
+ free(curr_unpeer);
+ }
+ free(ptree->unpeers);
+ }
+}
+#endif /* FREE_CFG_T */
+
+
+#ifndef SIM
+static void
+config_reset_counters(
+ config_tree *ptree
+ )
+{
+ int_node *counter_set;
+
+ for (counter_set = HEAD_PFIFO(ptree->reset_counters);
+ counter_set != NULL;
+ counter_set = counter_set->link) {
+ switch (counter_set->i) {
+ default:
+ DPRINTF(1, ("config_reset_counters %s (%d) invalid\n",
+ keyword(counter_set->i), counter_set->i));
+ break;
+
+ case T_Allpeers:
+ peer_all_reset();
+ break;
+
+ case T_Auth:
+ reset_auth_stats();
+ break;
+
+ case T_Ctl:
+ ctl_clr_stats();
+ break;
+
+ case T_Io:
+ io_clr_stats();
+ break;
+
+ case T_Mem:
+ peer_clr_stats();
+ break;
+
+ case T_Sys:
+ proto_clr_stats();
+ break;
+
+ case T_Timer:
+ timer_clr_stats();
+ break;
+ }
+ }
+}
+#endif /* !SIM */
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_reset_counters(
+ config_tree *ptree
+ )
+{
+ FREE_INT_FIFO(ptree->reset_counters);
+}
+#endif /* FREE_CFG_T */
+
+
+#ifdef SIM
+static void
+config_sim(
+ config_tree *ptree
+ )
+{
+ int i;
+ server_info *serv_info;
+ attr_val *init_stmt;
+ sim_node *sim_n;
+
+ /* Check if a simulate block was found in the configuration code.
+ * If not, return an error and exit
+ */
+ sim_n = HEAD_PFIFO(ptree->sim_details);
+ if (NULL == sim_n) {
+ fprintf(stderr, "ERROR!! I couldn't find a \"simulate\" block for configuring the simulator.\n");
+ fprintf(stderr, "\tCheck your configuration file.\n");
+ exit(1);
+ }
+
+ /* Process the initialization statements
+ * -------------------------------------
+ */
+ init_stmt = HEAD_PFIFO(sim_n->init_opts);
+ for (; init_stmt != NULL; init_stmt = init_stmt->link) {
+ switch(init_stmt->attr) {
+
+ case T_Beep_Delay:
+ simulation.beep_delay = init_stmt->value.d;
+ break;
+
+ case T_Sim_Duration:
+ simulation.end_time = init_stmt->value.d;
+ break;
+
+ default:
+ fprintf(stderr,
+ "Unknown simulator init token %d\n",
+ init_stmt->attr);
+ exit(1);
+ }
+ }
+
+ /* Process the server list
+ * -----------------------
+ */
+ simulation.num_of_servers = 0;
+ serv_info = HEAD_PFIFO(sim_n->servers);
+ for (; serv_info != NULL; serv_info = serv_info->link)
+ simulation.num_of_servers++;
+ simulation.servers = emalloc(simulation.num_of_servers *
+ sizeof(simulation.servers[0]));
+
+ i = 0;
+ serv_info = HEAD_PFIFO(sim_n->servers);
+ for (; serv_info != NULL; serv_info = serv_info->link) {
+ if (NULL == serv_info) {
+ fprintf(stderr, "Simulator server list is corrupt\n");
+ exit(1);
+ } else {
+ simulation.servers[i] = *serv_info;
+ simulation.servers[i].link = NULL;
+ i++;
+ }
+ }
+
+ printf("Creating server associations\n");
+ create_server_associations();
+ fprintf(stderr,"\tServer associations successfully created!!\n");
+}
+
+
+#ifdef FREE_CFG_T
+static void
+free_config_sim(
+ config_tree *ptree
+ )
+{
+ sim_node *sim_n;
+ server_info *serv_n;
+ script_info *script_n;
+
+ if (NULL == ptree->sim_details)
+ return;
+ sim_n = HEAD_PFIFO(ptree->sim_details);
+ free(ptree->sim_details);
+ ptree->sim_details = NULL;
+ if (NULL == sim_n)
+ return;
+
+ FREE_ATTR_VAL_FIFO(sim_n->init_opts);
+ for (;;) {
+ UNLINK_FIFO(serv_n, *sim_n->servers, link);
+ if (NULL == serv_n)
+ break;
+ free(serv_n->curr_script);
+ if (serv_n->script != NULL) {
+ for (;;) {
+ UNLINK_FIFO(script_n, *serv_n->script,
+ link);
+ if (script_n == NULL)
+ break;
+ free(script_n);
+ }
+ free(serv_n->script);
+ }
+ free(serv_n);
+ }
+ free(sim_n);
+}
+#endif /* FREE_CFG_T */
+#endif /* SIM */
+
+
+/* Define two different config functions. One for the daemon and the other for
+ * the simulator. The simulator ignores a lot of the standard ntpd configuration
+ * options
+ */
+#ifndef SIM
+static void
+config_ntpd(
+ config_tree *ptree
+ )
+{
+ config_nic_rules(ptree);
+ io_open_sockets();
+ config_monitor(ptree);
+ config_auth(ptree);
+ config_tos(ptree);
+ config_access(ptree);
+ config_tinker(ptree);
+ config_rlimit(ptree);
+ config_system_opts(ptree);
+ config_logconfig(ptree);
+ config_phone(ptree);
+ config_setvar(ptree);
+ config_ttl(ptree);
+ config_trap(ptree);
+ config_vars(ptree);
+ config_other_modes(ptree);
+ config_peers(ptree);
+ config_unpeers(ptree);
+ config_fudge(ptree);
+ config_reset_counters(ptree);
+
+#ifdef TEST_BLOCKING_WORKER
+ {
+ struct addrinfo hints;
+
+ ZERO(hints);
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
+ getaddrinfo_sometime("www.cnn.com", "ntp", &hints,
+ INITIAL_DNS_RETRY,
+ gai_test_callback, (void *)1);
+ hints.ai_family = AF_INET6;
+ getaddrinfo_sometime("ipv6.google.com", "ntp", &hints,
+ INITIAL_DNS_RETRY,
+ gai_test_callback, (void *)0x600);
+ }
+#endif
+}
+#endif /* !SIM */
+
+
+#ifdef SIM
+static void
+config_ntpdsim(
+ config_tree *ptree
+ )
+{
+ printf("Configuring Simulator...\n");
+ printf("Some ntpd-specific commands in the configuration file will be ignored.\n");
+
+ config_tos(ptree);
+ config_monitor(ptree);
+ config_tinker(ptree);
+ if (0)
+ config_rlimit(ptree); /* not needed for the simulator */
+ config_system_opts(ptree);
+ config_logconfig(ptree);
+ config_vars(ptree);
+ config_sim(ptree);
+}
+#endif /* SIM */
+
+
+/*
+ * config_remotely() - implements ntpd side of ntpq :config
+ */
+void
+config_remotely(
+ sockaddr_u * remote_addr
+ )
+{
+ struct FILE_INFO remote_cuckoo;
+ char origin[128];
+
+ snprintf(origin, sizeof(origin), "remote config from %s",
+ stoa(remote_addr));
+ ZERO(remote_cuckoo);
+ remote_cuckoo.fname = origin;
+ remote_cuckoo.line_no = 1;
+ remote_cuckoo.col_no = 1;
+ input_from_file = 0;
+
+ init_syntax_tree(&cfgt);
+ yyparse(&remote_cuckoo);
+ cfgt.source.attr = CONF_SOURCE_NTPQ;
+ cfgt.timestamp = time(NULL);
+ cfgt.source.value.s = estrdup(stoa(remote_addr));
+
+ DPRINTF(1, ("Finished Parsing!!\n"));
+
+ save_and_apply_config_tree();
+
+ input_from_file = 1;
+}
+
+
+/*
+ * getconfig() - process startup configuration file e.g /etc/ntp.conf
+ */
+void
+getconfig(
+ int argc,
+ char ** argv
+ )
+{
+ char line[256];
+
+#ifdef DEBUG
+ atexit(free_all_config_trees);
+#endif
+#ifndef SYS_WINNT
+ config_file = CONFIG_FILE;
+#else
+ temp = CONFIG_FILE;
+ if (!ExpandEnvironmentStringsA(temp, config_file_storage,
+ sizeof(config_file_storage))) {
+ msyslog(LOG_ERR, "ExpandEnvironmentStrings CONFIG_FILE failed: %m");
+ exit(1);
+ }
+ config_file = config_file_storage;
+
+ temp = ALT_CONFIG_FILE;
+ if (!ExpandEnvironmentStringsA(temp, alt_config_file_storage,
+ sizeof(alt_config_file_storage))) {
+ msyslog(LOG_ERR, "ExpandEnvironmentStrings ALT_CONFIG_FILE failed: %m");
+ exit(1);
+ }
+ alt_config_file = alt_config_file_storage;
+#endif /* SYS_WINNT */
+
+ /*
+ * install a non default variable with this daemon version
+ */
+ snprintf(line, sizeof(line), "daemon_version=\"%s\"", Version);
+ set_sys_var(line, strlen(line) + 1, RO);
+
+ /*
+ * Set up for the first time step to install a variable showing
+ * which syscall is being used to step.
+ */
+ set_tod_using = &ntpd_set_tod_using;
+
+ getCmdOpts(argc, argv);
+ init_syntax_tree(&cfgt);
+ curr_include_level = 0;
+ if (
+ (fp[curr_include_level] = F_OPEN(FindConfig(config_file), "r")) == NULL
+#ifdef HAVE_NETINFO
+ /* If there is no config_file, try NetInfo. */
+ && check_netinfo && !(config_netinfo = get_netinfo_config())
+#endif /* HAVE_NETINFO */
+ ) {
+ msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(config_file));
+#ifndef SYS_WINNT
+ io_open_sockets();
+
+ return;
+#else
+ /* Under WinNT try alternate_config_file name, first NTP.CONF, then NTP.INI */
+
+ if ((fp[curr_include_level] = F_OPEN(FindConfig(alt_config_file), "r")) == NULL) {
+
+ /*
+ * Broadcast clients can sometimes run without
+ * a configuration file.
+ */
+ msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig(alt_config_file));
+ io_open_sockets();
+
+ return;
+ }
+ cfgt.source.value.s = estrdup(alt_config_file);
+#endif /* SYS_WINNT */
+ } else
+ cfgt.source.value.s = estrdup(config_file);
+
+
+ /*** BULK OF THE PARSER ***/
+#ifdef DEBUG
+ yydebug = !!(debug >= 5);
+#endif
+ yyparse(fp[curr_include_level]);
+
+ DPRINTF(1, ("Finished Parsing!!\n"));
+
+ cfgt.source.attr = CONF_SOURCE_FILE;
+ cfgt.timestamp = time(NULL);
+
+ save_and_apply_config_tree();
+
+ while (curr_include_level != -1)
+ FCLOSE(fp[curr_include_level--]);
+
+#ifdef HAVE_NETINFO
+ if (config_netinfo)
+ free_netinfo_config(config_netinfo);
+#endif /* HAVE_NETINFO */
+}
+
+
+void
+save_and_apply_config_tree(void)
+{
+ config_tree *ptree;
+#ifndef SAVECONFIG
+ config_tree *punlinked;
+#endif
+
+ /*
+ * Keep all the configuration trees applied since startup in
+ * a list that can be used to dump the configuration back to
+ * a text file.
+ */
+ ptree = emalloc(sizeof(*ptree));
+ memcpy(ptree, &cfgt, sizeof(*ptree));
+ ZERO(cfgt);
+
+ LINK_TAIL_SLIST(cfg_tree_history, ptree, link, config_tree);
+
+#ifdef SAVECONFIG
+ if (HAVE_OPT( SAVECONFIGQUIT )) {
+ FILE *dumpfile;
+ int err;
+ int dumpfailed;
+
+ dumpfile = fopen(OPT_ARG( SAVECONFIGQUIT ), "w");
+ if (NULL == dumpfile) {
+ err = errno;
+ mfprintf(stderr,
+ "can not create save file %s, error %d %m\n",
+ OPT_ARG(SAVECONFIGQUIT), err);
+ exit(err);
+ }
+
+ dumpfailed = dump_all_config_trees(dumpfile, 0);
+ if (dumpfailed)
+ fprintf(stderr,
+ "--saveconfigquit %s error %d\n",
+ OPT_ARG( SAVECONFIGQUIT ),
+ dumpfailed);
+ else
+ fprintf(stderr,
+ "configuration saved to %s\n",
+ OPT_ARG( SAVECONFIGQUIT ));
+
+ exit(dumpfailed);
+ }
+#endif /* SAVECONFIG */
+
+ /* The actual configuration done depends on whether we are configuring the
+ * simulator or the daemon. Perform a check and call the appropriate
+ * function as needed.
+ */
+
+#ifndef SIM
+ config_ntpd(ptree);
+#else
+ config_ntpdsim(ptree);
+#endif
+
+ /*
+ * With configure --disable-saveconfig, there's no use keeping
+ * the config tree around after application, so free it.
+ */
+#ifndef SAVECONFIG
+ UNLINK_SLIST(punlinked, cfg_tree_history, ptree, link,
+ config_tree);
+ INSIST(punlinked == ptree);
+ free_config_tree(ptree);
+#endif
+}
+
+
+static void
+ntpd_set_tod_using(
+ const char *which
+ )
+{
+ char line[128];
+
+ snprintf(line, sizeof(line), "settimeofday=\"%s\"", which);
+ set_sys_var(line, strlen(line) + 1, RO);
+}
+
+
+static char *
+normal_dtoa(
+ double d
+ )
+{
+ char * buf;
+ char * pch_e;
+ char * pch_nz;
+
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH, "%g", d);
+
+ /* use lowercase 'e', strip any leading zeroes in exponent */
+ pch_e = strchr(buf, 'e');
+ if (NULL == pch_e) {
+ pch_e = strchr(buf, 'E');
+ if (NULL == pch_e)
+ return buf;
+ *pch_e = 'e';
+ }
+ pch_e++;
+ if ('-' == *pch_e)
+ pch_e++;
+ pch_nz = pch_e;
+ while ('0' == *pch_nz)
+ pch_nz++;
+ if (pch_nz == pch_e)
+ return buf;
+ strlcpy(pch_e, pch_nz, LIB_BUFLENGTH - (pch_e - buf));
+
+ return buf;
+}
+
+
+/* FUNCTIONS COPIED FROM THE OLDER ntp_config.c
+ * --------------------------------------------
+ */
+
+
+/*
+ * get_pfxmatch - find value for prefixmatch
+ * and update char * accordingly
+ */
+static u_int32
+get_pfxmatch(
+ const char ** pstr,
+ struct masks * m
+ )
+{
+ while (m->name != NULL) {
+ if (strncmp(*pstr, m->name, strlen(m->name)) == 0) {
+ *pstr += strlen(m->name);
+ return m->mask;
+ } else {
+ m++;
+ }
+ }
+ return 0;
+}
+
+/*
+ * get_match - find logmask value
+ */
+static u_int32
+get_match(
+ const char * str,
+ struct masks * m
+ )
+{
+ while (m->name != NULL) {
+ if (strcmp(str, m->name) == 0)
+ return m->mask;
+ else
+ m++;
+ }
+ return 0;
+}
+
+/*
+ * get_logmask - build bitmask for ntp_syslogmask
+ */
+static u_int32
+get_logmask(
+ const char * str
+ )
+{
+ const char * t;
+ u_int32 offset;
+ u_int32 mask;
+
+ mask = get_match(str, logcfg_noclass_items);
+ if (mask != 0)
+ return mask;
+
+ t = str;
+ offset = get_pfxmatch(&t, logcfg_class);
+ mask = get_match(t, logcfg_class_items);
+
+ if (mask)
+ return mask << offset;
+ else
+ msyslog(LOG_ERR, "logconfig: '%s' not recognized - ignored",
+ str);
+
+ return 0;
+}
+
+
+#ifdef HAVE_NETINFO
+
+/*
+ * get_netinfo_config - find the nearest NetInfo domain with an ntp
+ * configuration and initialize the configuration state.
+ */
+static struct netinfo_config_state *
+get_netinfo_config(void)
+{
+ ni_status status;
+ void *domain;
+ ni_id config_dir;
+ struct netinfo_config_state *config;
+
+ if (ni_open(NULL, ".", &domain) != NI_OK) return NULL;
+
+ while ((status = ni_pathsearch(domain, &config_dir, NETINFO_CONFIG_DIR)) == NI_NODIR) {
+ void *next_domain;
+ if (ni_open(domain, "..", &next_domain) != NI_OK) {
+ ni_free(next_domain);
+ break;
+ }
+ ni_free(domain);
+ domain = next_domain;
+ }
+ if (status != NI_OK) {
+ ni_free(domain);
+ return NULL;
+ }
+
+ config = emalloc(sizeof(*config));
+ config->domain = domain;
+ config->config_dir = config_dir;
+ config->prop_index = 0;
+ config->val_index = 0;
+ config->val_list = NULL;
+
+ return config;
+}
+
+
+/*
+ * free_netinfo_config - release NetInfo configuration state
+ */
+static void
+free_netinfo_config(
+ struct netinfo_config_state *config
+ )
+{
+ ni_free(config->domain);
+ free(config);
+}
+
+
+/*
+ * gettokens_netinfo - return tokens from NetInfo
+ */
+static int
+gettokens_netinfo (
+ struct netinfo_config_state *config,
+ char **tokenlist,
+ int *ntokens
+ )
+{
+ int prop_index = config->prop_index;
+ int val_index = config->val_index;
+ char **val_list = config->val_list;
+
+ /*
+ * Iterate through each keyword and look for a property that matches it.
+ */
+ again:
+ if (!val_list) {
+ for (; prop_index < COUNTOF(keywords); prop_index++)
+ {
+ ni_namelist namelist;
+ struct keyword current_prop = keywords[prop_index];
+ ni_index index;
+
+ /*
+ * For each value associated in the property, we're going to return
+ * a separate line. We squirrel away the values in the config state
+ * so the next time through, we don't need to do this lookup.
+ */
+ NI_INIT(&namelist);
+ if (NI_OK == ni_lookupprop(config->domain,
+ &config->config_dir, current_prop.text,
+ &namelist)) {
+
+ /* Found the property, but it has no values */
+ if (namelist.ni_namelist_len == 0) continue;
+
+ config->val_list =
+ emalloc(sizeof(char*) *
+ (namelist.ni_namelist_len + 1));
+ val_list = config->val_list;
+
+ for (index = 0;
+ index < namelist.ni_namelist_len;
+ index++) {
+ char *value;
+
+ value = namelist.ni_namelist_val[index];
+ val_list[index] = estrdup(value);
+ }
+ val_list[index] = NULL;
+
+ break;
+ }
+ ni_namelist_free(&namelist);
+ }
+ config->prop_index = prop_index;
+ }
+
+ /* No list; we're done here. */
+ if (!val_list)
+ return CONFIG_UNKNOWN;
+
+ /*
+ * We have a list of values for the current property.
+ * Iterate through them and return each in order.
+ */
+ if (val_list[val_index]) {
+ int ntok = 1;
+ int quoted = 0;
+ char *tokens = val_list[val_index];
+
+ msyslog(LOG_INFO, "%s %s", keywords[prop_index].text, val_list[val_index]);
+
+ (const char*)tokenlist[0] = keywords[prop_index].text;
+ for (ntok = 1; ntok < MAXTOKENS; ntok++) {
+ tokenlist[ntok] = tokens;
+ while (!ISEOL(*tokens) && (!ISSPACE(*tokens) || quoted))
+ quoted ^= (*tokens++ == '"');
+
+ if (ISEOL(*tokens)) {
+ *tokens = '\0';
+ break;
+ } else { /* must be space */
+ *tokens++ = '\0';
+ while (ISSPACE(*tokens))
+ tokens++;
+ if (ISEOL(*tokens))
+ break;
+ }
+ }
+
+ if (ntok == MAXTOKENS) {
+ /* HMS: chomp it to lose the EOL? */
+ msyslog(LOG_ERR,
+ "gettokens_netinfo: too many tokens. Ignoring: %s",
+ tokens);
+ } else {
+ *ntokens = ntok + 1;
+ }
+
+ config->val_index++; /* HMS: Should this be in the 'else'? */
+
+ return keywords[prop_index].keytype;
+ }
+
+ /* We're done with the current property. */
+ prop_index = ++config->prop_index;
+
+ /* Free val_list and reset counters. */
+ for (val_index = 0; val_list[val_index]; val_index++)
+ free(val_list[val_index]);
+ free(val_list);
+ val_list = config->val_list = NULL;
+ val_index = config->val_index = 0;
+
+ goto again;
+}
+#endif /* HAVE_NETINFO */
+
+
+/*
+ * getnetnum - return a net number (this is crude, but careful)
+ *
+ * returns 1 for success, and mysteriously, 0 for most failures, and
+ * -1 if the address found is IPv6 and we believe IPv6 isn't working.
+ */
+#ifndef SIM
+static int
+getnetnum(
+ const char *num,
+ sockaddr_u *addr,
+ int complain,
+ enum gnn_type a_type /* ignored */
+ )
+{
+ NTP_REQUIRE(AF_UNSPEC == AF(addr) ||
+ AF_INET == AF(addr) ||
+ AF_INET6 == AF(addr));
+
+ if (!is_ip_address(num, AF(addr), addr))
+ return 0;
+
+ if (IS_IPV6(addr) && !ipv6_works)
+ return -1;
+
+# ifdef ISC_PLATFORM_HAVESALEN
+ addr->sa.sa_len = SIZEOF_SOCKADDR(AF(addr));
+# endif
+ SET_PORT(addr, NTP_PORT);
+
+ DPRINTF(2, ("getnetnum given %s, got %s\n", num, stoa(addr)));
+
+ return 1;
+}
+#endif /* !SIM */
+
+#if defined(HAVE_SETRLIMIT)
+void
+ntp_rlimit(
+ int rl_what,
+ rlim_t rl_value,
+ int rl_scale,
+ char * rl_sstr
+ )
+{
+ struct rlimit rl;
+
+ switch (rl_what) {
+# ifdef RLIMIT_MEMLOCK
+ case RLIMIT_MEMLOCK:
+ /*
+ * The default RLIMIT_MEMLOCK is very low on Linux systems.
+ * Unless we increase this limit malloc calls are likely to
+ * fail if we drop root privilege. To be useful the value
+ * has to be larger than the largest ntpd resident set size.
+ */
+ DPRINTF(2, ("ntp_rlimit: MEMLOCK: %d %s\n",
+ (int)(rl_value / rl_scale), rl_sstr));
+ rl.rlim_cur = rl.rlim_max = rl_value;
+ if (setrlimit(RLIMIT_MEMLOCK, &rl) == -1)
+ msyslog(LOG_ERR, "Cannot set RLIMIT_MEMLOCK: %m");
+ break;
+# endif /* RLIMIT_MEMLOCK */
+
+# ifdef RLIMIT_NOFILE
+ case RLIMIT_NOFILE:
+ /*
+ * For large systems the default file descriptor limit may
+ * not be enough.
+ */
+ DPRINTF(2, ("ntp_rlimit: NOFILE: %d %s\n",
+ (int)(rl_value / rl_scale), rl_sstr));
+ rl.rlim_cur = rl.rlim_max = rl_value;
+ if (setrlimit(RLIMIT_NOFILE, &rl) == -1)
+ msyslog(LOG_ERR, "Cannot set RLIMIT_NOFILE: %m");
+ break;
+# endif /* RLIMIT_NOFILE */
+
+# ifdef RLIMIT_STACK
+ case RLIMIT_STACK:
+ /*
+ * Provide a way to set the stack limit to something
+ * smaller, so that we don't lock a lot of unused
+ * stack memory.
+ */
+ DPRINTF(2, ("ntp_rlimit: STACK: %d %s pages\n",
+ (int)(rl_value / rl_scale), rl_sstr));
+ if (-1 == getrlimit(RLIMIT_STACK, &rl)) {
+ msyslog(LOG_ERR, "getrlimit() failed: %m");
+ } else {
+ if (rl_value > rl.rlim_max) {
+ msyslog(LOG_WARNING,
+ "ntp_rlimit: using maximum allowed stack limit %lu instead of %lu.",
+ (u_long)rl.rlim_max,
+ (u_long)rl_value);
+ rl_value = rl.rlim_max;
+ }
+ if (-1 == setrlimit(RLIMIT_STACK, &rl)) {
+ msyslog(LOG_ERR,
+ "ntp_rlimit: Cannot adjust stack limit: %m");
+ }
+ }
+ break;
+# endif /* RLIMIT_STACK */
+
+ default:
+ INSIST(!"Unexpected setrlimit() case!");
+ break;
+ }
+}
+#endif /* HAVE_SETRLIMIT */
diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c
new file mode 100644
index 0000000..266978e
--- /dev/null
+++ b/ntpd/ntp_control.c
@@ -0,0 +1,4942 @@
+/*
+ * ntp_control.c - respond to mode 6 control messages and send async
+ * traps. Provides service to ntpq and others.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+#include <sys/stat.h>
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#include <arpa/inet.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_control.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+#include "ntp_config.h"
+#include "ntp_crypto.h"
+#include "ntp_assert.h"
+#include "ntp_leapsec.h"
+#include "ntp_md5.h" /* provides OpenSSL digest API */
+#include "lib_strbuf.h"
+#ifdef KERNEL_PLL
+# include "ntp_syscall.h"
+#endif
+
+
+/*
+ * Structure to hold request procedure information
+ */
+
+struct ctl_proc {
+ short control_code; /* defined request code */
+#define NO_REQUEST (-1)
+ u_short flags; /* flags word */
+ /* Only one flag. Authentication required or not. */
+#define NOAUTH 0
+#define AUTH 1
+ void (*handler) (struct recvbuf *, int); /* handle request */
+};
+
+
+/*
+ * Request processing routines
+ */
+static void ctl_error (u_char);
+#ifdef REFCLOCK
+static u_short ctlclkstatus (struct refclockstat *);
+#endif
+static void ctl_flushpkt (u_char);
+static void ctl_putdata (const char *, unsigned int, int);
+static void ctl_putstr (const char *, const char *, size_t);
+static void ctl_putdblf (const char *, const char *, double);
+const char ctl_def_dbl_fmt[] = "%.3f";
+#define ctl_putdbl(tag, d) ctl_putdblf(tag, ctl_def_dbl_fmt, d)
+const char ctl_def_dbl6_fmt[] = "%.6f";
+#define ctl_putdbl6(tag, d) ctl_putdblf(tag, ctl_def_dbl6_fmt, d)
+const char ctl_def_sfp_fmt[] = "%g";
+#define ctl_putsfp(tag, sfp) ctl_putdblf(tag, ctl_def_sfp_fmt, \
+ FPTOD(sfp))
+static void ctl_putuint (const char *, u_long);
+static void ctl_puthex (const char *, u_long);
+static void ctl_putint (const char *, long);
+static void ctl_putts (const char *, l_fp *);
+static void ctl_putadr (const char *, u_int32,
+ sockaddr_u *);
+static void ctl_putrefid (const char *, u_int32);
+static void ctl_putarray (const char *, double *, int);
+static void ctl_putsys (int);
+static void ctl_putpeer (int, struct peer *);
+static void ctl_putfs (const char *, tstamp_t);
+#ifdef REFCLOCK
+static void ctl_putclock (int, struct refclockstat *, int);
+#endif /* REFCLOCK */
+static const struct ctl_var *ctl_getitem(const struct ctl_var *,
+ char **);
+static u_short count_var (const struct ctl_var *);
+static void control_unspec (struct recvbuf *, int);
+static void read_status (struct recvbuf *, int);
+static void read_sysvars (void);
+static void read_peervars (void);
+static void read_variables (struct recvbuf *, int);
+static void write_variables (struct recvbuf *, int);
+static void read_clockstatus(struct recvbuf *, int);
+static void write_clockstatus(struct recvbuf *, int);
+static void set_trap (struct recvbuf *, int);
+static void save_config (struct recvbuf *, int);
+static void configure (struct recvbuf *, int);
+static void send_mru_entry (mon_entry *, int);
+static void send_random_tag_value(int);
+static void read_mru_list (struct recvbuf *, int);
+static void send_ifstats_entry(endpt *, u_int);
+static void read_ifstats (struct recvbuf *);
+static void sockaddrs_from_restrict_u(sockaddr_u *, sockaddr_u *,
+ restrict_u *, int);
+static void send_restrict_entry(restrict_u *, int, u_int);
+static void send_restrict_list(restrict_u *, int, u_int *);
+static void read_addr_restrictions(struct recvbuf *);
+static void read_ordlist (struct recvbuf *, int);
+static u_int32 derive_nonce (sockaddr_u *, u_int32, u_int32);
+static void generate_nonce (struct recvbuf *, char *, size_t);
+static int validate_nonce (const char *, struct recvbuf *);
+static void req_nonce (struct recvbuf *, int);
+static void unset_trap (struct recvbuf *, int);
+static struct ctl_trap *ctlfindtrap(sockaddr_u *,
+ struct interface *);
+
+static const struct ctl_proc control_codes[] = {
+ { CTL_OP_UNSPEC, NOAUTH, control_unspec },
+ { CTL_OP_READSTAT, NOAUTH, read_status },
+ { CTL_OP_READVAR, NOAUTH, read_variables },
+ { CTL_OP_WRITEVAR, AUTH, write_variables },
+ { CTL_OP_READCLOCK, NOAUTH, read_clockstatus },
+ { CTL_OP_WRITECLOCK, NOAUTH, write_clockstatus },
+ { CTL_OP_SETTRAP, NOAUTH, set_trap },
+ { CTL_OP_CONFIGURE, AUTH, configure },
+ { CTL_OP_SAVECONFIG, AUTH, save_config },
+ { CTL_OP_READ_MRU, NOAUTH, read_mru_list },
+ { CTL_OP_READ_ORDLIST_A, AUTH, read_ordlist },
+ { CTL_OP_REQ_NONCE, NOAUTH, req_nonce },
+ { CTL_OP_UNSETTRAP, NOAUTH, unset_trap },
+ { NO_REQUEST, 0, NULL }
+};
+
+/*
+ * System variables we understand
+ */
+#define CS_LEAP 1
+#define CS_STRATUM 2
+#define CS_PRECISION 3
+#define CS_ROOTDELAY 4
+#define CS_ROOTDISPERSION 5
+#define CS_REFID 6
+#define CS_REFTIME 7
+#define CS_POLL 8
+#define CS_PEERID 9
+#define CS_OFFSET 10
+#define CS_DRIFT 11
+#define CS_JITTER 12
+#define CS_ERROR 13
+#define CS_CLOCK 14
+#define CS_PROCESSOR 15
+#define CS_SYSTEM 16
+#define CS_VERSION 17
+#define CS_STABIL 18
+#define CS_VARLIST 19
+#define CS_TAI 20
+#define CS_LEAPTAB 21
+#define CS_LEAPEND 22
+#define CS_RATE 23
+#define CS_MRU_ENABLED 24
+#define CS_MRU_DEPTH 25
+#define CS_MRU_DEEPEST 26
+#define CS_MRU_MINDEPTH 27
+#define CS_MRU_MAXAGE 28
+#define CS_MRU_MAXDEPTH 29
+#define CS_MRU_MEM 30
+#define CS_MRU_MAXMEM 31
+#define CS_SS_UPTIME 32
+#define CS_SS_RESET 33
+#define CS_SS_RECEIVED 34
+#define CS_SS_THISVER 35
+#define CS_SS_OLDVER 36
+#define CS_SS_BADFORMAT 37
+#define CS_SS_BADAUTH 38
+#define CS_SS_DECLINED 39
+#define CS_SS_RESTRICTED 40
+#define CS_SS_LIMITED 41
+#define CS_SS_KODSENT 42
+#define CS_SS_PROCESSED 43
+#define CS_PEERADR 44
+#define CS_PEERMODE 45
+#define CS_BCASTDELAY 46
+#define CS_AUTHDELAY 47
+#define CS_AUTHKEYS 48
+#define CS_AUTHFREEK 49
+#define CS_AUTHKLOOKUPS 50
+#define CS_AUTHKNOTFOUND 51
+#define CS_AUTHKUNCACHED 52
+#define CS_AUTHKEXPIRED 53
+#define CS_AUTHENCRYPTS 54
+#define CS_AUTHDECRYPTS 55
+#define CS_AUTHRESET 56
+#define CS_K_OFFSET 57
+#define CS_K_FREQ 58
+#define CS_K_MAXERR 59
+#define CS_K_ESTERR 60
+#define CS_K_STFLAGS 61
+#define CS_K_TIMECONST 62
+#define CS_K_PRECISION 63
+#define CS_K_FREQTOL 64
+#define CS_K_PPS_FREQ 65
+#define CS_K_PPS_STABIL 66
+#define CS_K_PPS_JITTER 67
+#define CS_K_PPS_CALIBDUR 68
+#define CS_K_PPS_CALIBS 69
+#define CS_K_PPS_CALIBERRS 70
+#define CS_K_PPS_JITEXC 71
+#define CS_K_PPS_STBEXC 72
+#define CS_KERN_FIRST CS_K_OFFSET
+#define CS_KERN_LAST CS_K_PPS_STBEXC
+#define CS_IOSTATS_RESET 73
+#define CS_TOTAL_RBUF 74
+#define CS_FREE_RBUF 75
+#define CS_USED_RBUF 76
+#define CS_RBUF_LOWATER 77
+#define CS_IO_DROPPED 78
+#define CS_IO_IGNORED 79
+#define CS_IO_RECEIVED 80
+#define CS_IO_SENT 81
+#define CS_IO_SENDFAILED 82
+#define CS_IO_WAKEUPS 83
+#define CS_IO_GOODWAKEUPS 84
+#define CS_TIMERSTATS_RESET 85
+#define CS_TIMER_OVERRUNS 86
+#define CS_TIMER_XMTS 87
+#define CS_FUZZ 88
+#define CS_MAX_NOAUTOKEY CS_FUZZ
+#ifdef AUTOKEY
+#define CS_FLAGS (1 + CS_MAX_NOAUTOKEY)
+#define CS_HOST (2 + CS_MAX_NOAUTOKEY)
+#define CS_PUBLIC (3 + CS_MAX_NOAUTOKEY)
+#define CS_CERTIF (4 + CS_MAX_NOAUTOKEY)
+#define CS_SIGNATURE (5 + CS_MAX_NOAUTOKEY)
+#define CS_REVTIME (6 + CS_MAX_NOAUTOKEY)
+#define CS_IDENT (7 + CS_MAX_NOAUTOKEY)
+#define CS_DIGEST (8 + CS_MAX_NOAUTOKEY)
+#define CS_MAXCODE CS_DIGEST
+#else /* !AUTOKEY follows */
+#define CS_MAXCODE CS_MAX_NOAUTOKEY
+#endif /* !AUTOKEY */
+
+/*
+ * Peer variables we understand
+ */
+#define CP_CONFIG 1
+#define CP_AUTHENABLE 2
+#define CP_AUTHENTIC 3
+#define CP_SRCADR 4
+#define CP_SRCPORT 5
+#define CP_DSTADR 6
+#define CP_DSTPORT 7
+#define CP_LEAP 8
+#define CP_HMODE 9
+#define CP_STRATUM 10
+#define CP_PPOLL 11
+#define CP_HPOLL 12
+#define CP_PRECISION 13
+#define CP_ROOTDELAY 14
+#define CP_ROOTDISPERSION 15
+#define CP_REFID 16
+#define CP_REFTIME 17
+#define CP_ORG 18
+#define CP_REC 19
+#define CP_XMT 20
+#define CP_REACH 21
+#define CP_UNREACH 22
+#define CP_TIMER 23
+#define CP_DELAY 24
+#define CP_OFFSET 25
+#define CP_JITTER 26
+#define CP_DISPERSION 27
+#define CP_KEYID 28
+#define CP_FILTDELAY 29
+#define CP_FILTOFFSET 30
+#define CP_PMODE 31
+#define CP_RECEIVED 32
+#define CP_SENT 33
+#define CP_FILTERROR 34
+#define CP_FLASH 35
+#define CP_TTL 36
+#define CP_VARLIST 37
+#define CP_IN 38
+#define CP_OUT 39
+#define CP_RATE 40
+#define CP_BIAS 41
+#define CP_SRCHOST 42
+#define CP_TIMEREC 43
+#define CP_TIMEREACH 44
+#define CP_BADAUTH 45
+#define CP_BOGUSORG 46
+#define CP_OLDPKT 47
+#define CP_SELDISP 48
+#define CP_SELBROKEN 49
+#define CP_CANDIDATE 50
+#define CP_MAX_NOAUTOKEY CP_CANDIDATE
+#ifdef AUTOKEY
+#define CP_FLAGS (1 + CP_MAX_NOAUTOKEY)
+#define CP_HOST (2 + CP_MAX_NOAUTOKEY)
+#define CP_VALID (3 + CP_MAX_NOAUTOKEY)
+#define CP_INITSEQ (4 + CP_MAX_NOAUTOKEY)
+#define CP_INITKEY (5 + CP_MAX_NOAUTOKEY)
+#define CP_INITTSP (6 + CP_MAX_NOAUTOKEY)
+#define CP_SIGNATURE (7 + CP_MAX_NOAUTOKEY)
+#define CP_IDENT (8 + CP_MAX_NOAUTOKEY)
+#define CP_MAXCODE CP_IDENT
+#else /* !AUTOKEY follows */
+#define CP_MAXCODE CP_MAX_NOAUTOKEY
+#endif /* !AUTOKEY */
+
+/*
+ * Clock variables we understand
+ */
+#define CC_TYPE 1
+#define CC_TIMECODE 2
+#define CC_POLL 3
+#define CC_NOREPLY 4
+#define CC_BADFORMAT 5
+#define CC_BADDATA 6
+#define CC_FUDGETIME1 7
+#define CC_FUDGETIME2 8
+#define CC_FUDGEVAL1 9
+#define CC_FUDGEVAL2 10
+#define CC_FLAGS 11
+#define CC_DEVICE 12
+#define CC_VARLIST 13
+#define CC_MAXCODE CC_VARLIST
+
+/*
+ * System variable values. The array can be indexed by the variable
+ * index to find the textual name.
+ */
+static const struct ctl_var sys_var[] = {
+ { 0, PADDING, "" }, /* 0 */
+ { CS_LEAP, RW, "leap" }, /* 1 */
+ { CS_STRATUM, RO, "stratum" }, /* 2 */
+ { CS_PRECISION, RO, "precision" }, /* 3 */
+ { CS_ROOTDELAY, RO, "rootdelay" }, /* 4 */
+ { CS_ROOTDISPERSION, RO, "rootdisp" }, /* 5 */
+ { CS_REFID, RO, "refid" }, /* 6 */
+ { CS_REFTIME, RO, "reftime" }, /* 7 */
+ { CS_POLL, RO, "tc" }, /* 8 */
+ { CS_PEERID, RO, "peer" }, /* 9 */
+ { CS_OFFSET, RO, "offset" }, /* 10 */
+ { CS_DRIFT, RO, "frequency" }, /* 11 */
+ { CS_JITTER, RO, "sys_jitter" }, /* 12 */
+ { CS_ERROR, RO, "clk_jitter" }, /* 13 */
+ { CS_CLOCK, RO, "clock" }, /* 14 */
+ { CS_PROCESSOR, RO, "processor" }, /* 15 */
+ { CS_SYSTEM, RO, "system" }, /* 16 */
+ { CS_VERSION, RO, "version" }, /* 17 */
+ { CS_STABIL, RO, "clk_wander" }, /* 18 */
+ { CS_VARLIST, RO, "sys_var_list" }, /* 19 */
+ { CS_TAI, RO, "tai" }, /* 20 */
+ { CS_LEAPTAB, RO, "leapsec" }, /* 21 */
+ { CS_LEAPEND, RO, "expire" }, /* 22 */
+ { CS_RATE, RO, "mintc" }, /* 23 */
+ { CS_MRU_ENABLED, RO, "mru_enabled" }, /* 24 */
+ { CS_MRU_DEPTH, RO, "mru_depth" }, /* 25 */
+ { CS_MRU_DEEPEST, RO, "mru_deepest" }, /* 26 */
+ { CS_MRU_MINDEPTH, RO, "mru_mindepth" }, /* 27 */
+ { CS_MRU_MAXAGE, RO, "mru_maxage" }, /* 28 */
+ { CS_MRU_MAXDEPTH, RO, "mru_maxdepth" }, /* 29 */
+ { CS_MRU_MEM, RO, "mru_mem" }, /* 30 */
+ { CS_MRU_MAXMEM, RO, "mru_maxmem" }, /* 31 */
+ { CS_SS_UPTIME, RO, "ss_uptime" }, /* 32 */
+ { CS_SS_RESET, RO, "ss_reset" }, /* 33 */
+ { CS_SS_RECEIVED, RO, "ss_received" }, /* 34 */
+ { CS_SS_THISVER, RO, "ss_thisver" }, /* 35 */
+ { CS_SS_OLDVER, RO, "ss_oldver" }, /* 36 */
+ { CS_SS_BADFORMAT, RO, "ss_badformat" }, /* 37 */
+ { CS_SS_BADAUTH, RO, "ss_badauth" }, /* 38 */
+ { CS_SS_DECLINED, RO, "ss_declined" }, /* 39 */
+ { CS_SS_RESTRICTED, RO, "ss_restricted" }, /* 40 */
+ { CS_SS_LIMITED, RO, "ss_limited" }, /* 41 */
+ { CS_SS_KODSENT, RO, "ss_kodsent" }, /* 42 */
+ { CS_SS_PROCESSED, RO, "ss_processed" }, /* 43 */
+ { CS_PEERADR, RO, "peeradr" }, /* 44 */
+ { CS_PEERMODE, RO, "peermode" }, /* 45 */
+ { CS_BCASTDELAY, RO, "bcastdelay" }, /* 46 */
+ { CS_AUTHDELAY, RO, "authdelay" }, /* 47 */
+ { CS_AUTHKEYS, RO, "authkeys" }, /* 48 */
+ { CS_AUTHFREEK, RO, "authfreek" }, /* 49 */
+ { CS_AUTHKLOOKUPS, RO, "authklookups" }, /* 50 */
+ { CS_AUTHKNOTFOUND, RO, "authknotfound" }, /* 51 */
+ { CS_AUTHKUNCACHED, RO, "authkuncached" }, /* 52 */
+ { CS_AUTHKEXPIRED, RO, "authkexpired" }, /* 53 */
+ { CS_AUTHENCRYPTS, RO, "authencrypts" }, /* 54 */
+ { CS_AUTHDECRYPTS, RO, "authdecrypts" }, /* 55 */
+ { CS_AUTHRESET, RO, "authreset" }, /* 56 */
+ { CS_K_OFFSET, RO, "koffset" }, /* 57 */
+ { CS_K_FREQ, RO, "kfreq" }, /* 58 */
+ { CS_K_MAXERR, RO, "kmaxerr" }, /* 59 */
+ { CS_K_ESTERR, RO, "kesterr" }, /* 60 */
+ { CS_K_STFLAGS, RO, "kstflags" }, /* 61 */
+ { CS_K_TIMECONST, RO, "ktimeconst" }, /* 62 */
+ { CS_K_PRECISION, RO, "kprecis" }, /* 63 */
+ { CS_K_FREQTOL, RO, "kfreqtol" }, /* 64 */
+ { CS_K_PPS_FREQ, RO, "kppsfreq" }, /* 65 */
+ { CS_K_PPS_STABIL, RO, "kppsstab" }, /* 66 */
+ { CS_K_PPS_JITTER, RO, "kppsjitter" }, /* 67 */
+ { CS_K_PPS_CALIBDUR, RO, "kppscalibdur" }, /* 68 */
+ { CS_K_PPS_CALIBS, RO, "kppscalibs" }, /* 69 */
+ { CS_K_PPS_CALIBERRS, RO, "kppscaliberrs" }, /* 70 */
+ { CS_K_PPS_JITEXC, RO, "kppsjitexc" }, /* 71 */
+ { CS_K_PPS_STBEXC, RO, "kppsstbexc" }, /* 72 */
+ { CS_IOSTATS_RESET, RO, "iostats_reset" }, /* 73 */
+ { CS_TOTAL_RBUF, RO, "total_rbuf" }, /* 74 */
+ { CS_FREE_RBUF, RO, "free_rbuf" }, /* 75 */
+ { CS_USED_RBUF, RO, "used_rbuf" }, /* 76 */
+ { CS_RBUF_LOWATER, RO, "rbuf_lowater" }, /* 77 */
+ { CS_IO_DROPPED, RO, "io_dropped" }, /* 78 */
+ { CS_IO_IGNORED, RO, "io_ignored" }, /* 79 */
+ { CS_IO_RECEIVED, RO, "io_received" }, /* 80 */
+ { CS_IO_SENT, RO, "io_sent" }, /* 81 */
+ { CS_IO_SENDFAILED, RO, "io_sendfailed" }, /* 82 */
+ { CS_IO_WAKEUPS, RO, "io_wakeups" }, /* 83 */
+ { CS_IO_GOODWAKEUPS, RO, "io_goodwakeups" }, /* 84 */
+ { CS_TIMERSTATS_RESET, RO, "timerstats_reset" },/* 85 */
+ { CS_TIMER_OVERRUNS, RO, "timer_overruns" }, /* 86 */
+ { CS_TIMER_XMTS, RO, "timer_xmts" }, /* 87 */
+ { CS_FUZZ, RO, "fuzz" }, /* 88 */
+#ifdef AUTOKEY
+ { CS_FLAGS, RO, "flags" }, /* 1 + CS_MAX_NOAUTOKEY */
+ { CS_HOST, RO, "host" }, /* 2 + CS_MAX_NOAUTOKEY */
+ { CS_PUBLIC, RO, "update" }, /* 3 + CS_MAX_NOAUTOKEY */
+ { CS_CERTIF, RO, "cert" }, /* 4 + CS_MAX_NOAUTOKEY */
+ { CS_SIGNATURE, RO, "signature" }, /* 5 + CS_MAX_NOAUTOKEY */
+ { CS_REVTIME, RO, "until" }, /* 6 + CS_MAX_NOAUTOKEY */
+ { CS_IDENT, RO, "ident" }, /* 7 + CS_MAX_NOAUTOKEY */
+ { CS_DIGEST, RO, "digest" }, /* 8 + CS_MAX_NOAUTOKEY */
+#endif /* AUTOKEY */
+ { 0, EOV, "" } /* 87/95 */
+};
+
+static struct ctl_var *ext_sys_var = NULL;
+
+/*
+ * System variables we print by default (in fuzzball order,
+ * more-or-less)
+ */
+static const u_char def_sys_var[] = {
+ CS_VERSION,
+ CS_PROCESSOR,
+ CS_SYSTEM,
+ CS_LEAP,
+ CS_STRATUM,
+ CS_PRECISION,
+ CS_ROOTDELAY,
+ CS_ROOTDISPERSION,
+ CS_REFID,
+ CS_REFTIME,
+ CS_CLOCK,
+ CS_PEERID,
+ CS_POLL,
+ CS_RATE,
+ CS_OFFSET,
+ CS_DRIFT,
+ CS_JITTER,
+ CS_ERROR,
+ CS_STABIL,
+ CS_TAI,
+ CS_LEAPTAB,
+ CS_LEAPEND,
+#ifdef AUTOKEY
+ CS_HOST,
+ CS_IDENT,
+ CS_FLAGS,
+ CS_DIGEST,
+ CS_SIGNATURE,
+ CS_PUBLIC,
+ CS_CERTIF,
+#endif /* AUTOKEY */
+ 0
+};
+
+
+/*
+ * Peer variable list
+ */
+static const struct ctl_var peer_var[] = {
+ { 0, PADDING, "" }, /* 0 */
+ { CP_CONFIG, RO, "config" }, /* 1 */
+ { CP_AUTHENABLE, RO, "authenable" }, /* 2 */
+ { CP_AUTHENTIC, RO, "authentic" }, /* 3 */
+ { CP_SRCADR, RO, "srcadr" }, /* 4 */
+ { CP_SRCPORT, RO, "srcport" }, /* 5 */
+ { CP_DSTADR, RO, "dstadr" }, /* 6 */
+ { CP_DSTPORT, RO, "dstport" }, /* 7 */
+ { CP_LEAP, RO, "leap" }, /* 8 */
+ { CP_HMODE, RO, "hmode" }, /* 9 */
+ { CP_STRATUM, RO, "stratum" }, /* 10 */
+ { CP_PPOLL, RO, "ppoll" }, /* 11 */
+ { CP_HPOLL, RO, "hpoll" }, /* 12 */
+ { CP_PRECISION, RO, "precision" }, /* 13 */
+ { CP_ROOTDELAY, RO, "rootdelay" }, /* 14 */
+ { CP_ROOTDISPERSION, RO, "rootdisp" }, /* 15 */
+ { CP_REFID, RO, "refid" }, /* 16 */
+ { CP_REFTIME, RO, "reftime" }, /* 17 */
+ { CP_ORG, RO, "org" }, /* 18 */
+ { CP_REC, RO, "rec" }, /* 19 */
+ { CP_XMT, RO, "xleave" }, /* 20 */
+ { CP_REACH, RO, "reach" }, /* 21 */
+ { CP_UNREACH, RO, "unreach" }, /* 22 */
+ { CP_TIMER, RO, "timer" }, /* 23 */
+ { CP_DELAY, RO, "delay" }, /* 24 */
+ { CP_OFFSET, RO, "offset" }, /* 25 */
+ { CP_JITTER, RO, "jitter" }, /* 26 */
+ { CP_DISPERSION, RO, "dispersion" }, /* 27 */
+ { CP_KEYID, RO, "keyid" }, /* 28 */
+ { CP_FILTDELAY, RO, "filtdelay" }, /* 29 */
+ { CP_FILTOFFSET, RO, "filtoffset" }, /* 30 */
+ { CP_PMODE, RO, "pmode" }, /* 31 */
+ { CP_RECEIVED, RO, "received"}, /* 32 */
+ { CP_SENT, RO, "sent" }, /* 33 */
+ { CP_FILTERROR, RO, "filtdisp" }, /* 34 */
+ { CP_FLASH, RO, "flash" }, /* 35 */
+ { CP_TTL, RO, "ttl" }, /* 36 */
+ { CP_VARLIST, RO, "peer_var_list" }, /* 37 */
+ { CP_IN, RO, "in" }, /* 38 */
+ { CP_OUT, RO, "out" }, /* 39 */
+ { CP_RATE, RO, "headway" }, /* 40 */
+ { CP_BIAS, RO, "bias" }, /* 41 */
+ { CP_SRCHOST, RO, "srchost" }, /* 42 */
+ { CP_TIMEREC, RO, "timerec" }, /* 43 */
+ { CP_TIMEREACH, RO, "timereach" }, /* 44 */
+ { CP_BADAUTH, RO, "badauth" }, /* 45 */
+ { CP_BOGUSORG, RO, "bogusorg" }, /* 46 */
+ { CP_OLDPKT, RO, "oldpkt" }, /* 47 */
+ { CP_SELDISP, RO, "seldisp" }, /* 48 */
+ { CP_SELBROKEN, RO, "selbroken" }, /* 49 */
+ { CP_CANDIDATE, RO, "candidate" }, /* 50 */
+#ifdef AUTOKEY
+ { CP_FLAGS, RO, "flags" }, /* 1 + CP_MAX_NOAUTOKEY */
+ { CP_HOST, RO, "host" }, /* 2 + CP_MAX_NOAUTOKEY */
+ { CP_VALID, RO, "valid" }, /* 3 + CP_MAX_NOAUTOKEY */
+ { CP_INITSEQ, RO, "initsequence" }, /* 4 + CP_MAX_NOAUTOKEY */
+ { CP_INITKEY, RO, "initkey" }, /* 5 + CP_MAX_NOAUTOKEY */
+ { CP_INITTSP, RO, "timestamp" }, /* 6 + CP_MAX_NOAUTOKEY */
+ { CP_SIGNATURE, RO, "signature" }, /* 7 + CP_MAX_NOAUTOKEY */
+ { CP_IDENT, RO, "ident" }, /* 8 + CP_MAX_NOAUTOKEY */
+#endif /* AUTOKEY */
+ { 0, EOV, "" } /* 50/58 */
+};
+
+
+/*
+ * Peer variables we print by default
+ */
+static const u_char def_peer_var[] = {
+ CP_SRCADR,
+ CP_SRCPORT,
+ CP_SRCHOST,
+ CP_DSTADR,
+ CP_DSTPORT,
+ CP_OUT,
+ CP_IN,
+ CP_LEAP,
+ CP_STRATUM,
+ CP_PRECISION,
+ CP_ROOTDELAY,
+ CP_ROOTDISPERSION,
+ CP_REFID,
+ CP_REFTIME,
+ CP_REC,
+ CP_REACH,
+ CP_UNREACH,
+ CP_HMODE,
+ CP_PMODE,
+ CP_HPOLL,
+ CP_PPOLL,
+ CP_RATE,
+ CP_FLASH,
+ CP_KEYID,
+ CP_TTL,
+ CP_OFFSET,
+ CP_DELAY,
+ CP_DISPERSION,
+ CP_JITTER,
+ CP_XMT,
+ CP_BIAS,
+ CP_FILTDELAY,
+ CP_FILTOFFSET,
+ CP_FILTERROR,
+#ifdef AUTOKEY
+ CP_HOST,
+ CP_FLAGS,
+ CP_SIGNATURE,
+ CP_VALID,
+ CP_INITSEQ,
+ CP_IDENT,
+#endif /* AUTOKEY */
+ 0
+};
+
+
+#ifdef REFCLOCK
+/*
+ * Clock variable list
+ */
+static const struct ctl_var clock_var[] = {
+ { 0, PADDING, "" }, /* 0 */
+ { CC_TYPE, RO, "type" }, /* 1 */
+ { CC_TIMECODE, RO, "timecode" }, /* 2 */
+ { CC_POLL, RO, "poll" }, /* 3 */
+ { CC_NOREPLY, RO, "noreply" }, /* 4 */
+ { CC_BADFORMAT, RO, "badformat" }, /* 5 */
+ { CC_BADDATA, RO, "baddata" }, /* 6 */
+ { CC_FUDGETIME1, RO, "fudgetime1" }, /* 7 */
+ { CC_FUDGETIME2, RO, "fudgetime2" }, /* 8 */
+ { CC_FUDGEVAL1, RO, "stratum" }, /* 9 */
+ { CC_FUDGEVAL2, RO, "refid" }, /* 10 */
+ { CC_FLAGS, RO, "flags" }, /* 11 */
+ { CC_DEVICE, RO, "device" }, /* 12 */
+ { CC_VARLIST, RO, "clock_var_list" }, /* 13 */
+ { 0, EOV, "" } /* 14 */
+};
+
+
+/*
+ * Clock variables printed by default
+ */
+static const u_char def_clock_var[] = {
+ CC_DEVICE,
+ CC_TYPE, /* won't be output if device = known */
+ CC_TIMECODE,
+ CC_POLL,
+ CC_NOREPLY,
+ CC_BADFORMAT,
+ CC_BADDATA,
+ CC_FUDGETIME1,
+ CC_FUDGETIME2,
+ CC_FUDGEVAL1,
+ CC_FUDGEVAL2,
+ CC_FLAGS,
+ 0
+};
+#endif
+
+/*
+ * MRU string constants shared by send_mru_entry() and read_mru_list().
+ */
+static const char addr_fmt[] = "addr.%d";
+static const char last_fmt[] = "last.%d";
+
+/*
+ * System and processor definitions.
+ */
+#ifndef HAVE_UNAME
+# ifndef STR_SYSTEM
+# define STR_SYSTEM "UNIX"
+# endif
+# ifndef STR_PROCESSOR
+# define STR_PROCESSOR "unknown"
+# endif
+
+static const char str_system[] = STR_SYSTEM;
+static const char str_processor[] = STR_PROCESSOR;
+#else
+# include <sys/utsname.h>
+static struct utsname utsnamebuf;
+#endif /* HAVE_UNAME */
+
+/*
+ * Trap structures. We only allow a few of these, and send a copy of
+ * each async message to each live one. Traps time out after an hour, it
+ * is up to the trap receipient to keep resetting it to avoid being
+ * timed out.
+ */
+/* ntp_request.c */
+struct ctl_trap ctl_traps[CTL_MAXTRAPS];
+int num_ctl_traps;
+
+/*
+ * Type bits, for ctlsettrap() call.
+ */
+#define TRAP_TYPE_CONFIG 0 /* used by configuration code */
+#define TRAP_TYPE_PRIO 1 /* priority trap */
+#define TRAP_TYPE_NONPRIO 2 /* nonpriority trap */
+
+
+/*
+ * List relating reference clock types to control message time sources.
+ * Index by the reference clock type. This list will only be used iff
+ * the reference clock driver doesn't set peer->sstclktype to something
+ * different than CTL_SST_TS_UNSPEC.
+ */
+#ifdef REFCLOCK
+static const u_char clocktypes[] = {
+ CTL_SST_TS_NTP, /* REFCLK_NONE (0) */
+ CTL_SST_TS_LOCAL, /* REFCLK_LOCALCLOCK (1) */
+ CTL_SST_TS_UHF, /* deprecated REFCLK_GPS_TRAK (2) */
+ CTL_SST_TS_HF, /* REFCLK_WWV_PST (3) */
+ CTL_SST_TS_LF, /* REFCLK_WWVB_SPECTRACOM (4) */
+ CTL_SST_TS_UHF, /* REFCLK_TRUETIME (5) */
+ CTL_SST_TS_UHF, /* REFCLK_IRIG_AUDIO (6) */
+ CTL_SST_TS_HF, /* REFCLK_CHU (7) */
+ CTL_SST_TS_LF, /* REFCLOCK_PARSE (default) (8) */
+ CTL_SST_TS_LF, /* REFCLK_GPS_MX4200 (9) */
+ CTL_SST_TS_UHF, /* REFCLK_GPS_AS2201 (10) */
+ CTL_SST_TS_UHF, /* REFCLK_GPS_ARBITER (11) */
+ CTL_SST_TS_UHF, /* REFCLK_IRIG_TPRO (12) */
+ CTL_SST_TS_ATOM, /* REFCLK_ATOM_LEITCH (13) */
+ CTL_SST_TS_LF, /* deprecated REFCLK_MSF_EES (14) */
+ CTL_SST_TS_NTP, /* not used (15) */
+ CTL_SST_TS_UHF, /* REFCLK_IRIG_BANCOMM (16) */
+ CTL_SST_TS_UHF, /* REFCLK_GPS_DATU (17) */
+ CTL_SST_TS_TELEPHONE, /* REFCLK_NIST_ACTS (18) */
+ CTL_SST_TS_HF, /* REFCLK_WWV_HEATH (19) */
+ CTL_SST_TS_UHF, /* REFCLK_GPS_NMEA (20) */
+ CTL_SST_TS_UHF, /* REFCLK_GPS_VME (21) */
+ CTL_SST_TS_ATOM, /* REFCLK_ATOM_PPS (22) */
+ CTL_SST_TS_NTP, /* not used (23) */
+ CTL_SST_TS_NTP, /* not used (24) */
+ CTL_SST_TS_NTP, /* not used (25) */
+ CTL_SST_TS_UHF, /* REFCLK_GPS_HP (26) */
+ CTL_SST_TS_LF, /* REFCLK_ARCRON_MSF (27) */
+ CTL_SST_TS_UHF, /* REFCLK_SHM (28) */
+ CTL_SST_TS_UHF, /* REFCLK_PALISADE (29) */
+ CTL_SST_TS_UHF, /* REFCLK_ONCORE (30) */
+ CTL_SST_TS_UHF, /* REFCLK_JUPITER (31) */
+ CTL_SST_TS_LF, /* REFCLK_CHRONOLOG (32) */
+ CTL_SST_TS_LF, /* REFCLK_DUMBCLOCK (33) */
+ CTL_SST_TS_LF, /* REFCLK_ULINK (34) */
+ CTL_SST_TS_LF, /* REFCLK_PCF (35) */
+ CTL_SST_TS_HF, /* REFCLK_WWV (36) */
+ CTL_SST_TS_LF, /* REFCLK_FG (37) */
+ CTL_SST_TS_UHF, /* REFCLK_HOPF_SERIAL (38) */
+ CTL_SST_TS_UHF, /* REFCLK_HOPF_PCI (39) */
+ CTL_SST_TS_LF, /* REFCLK_JJY (40) */
+ CTL_SST_TS_UHF, /* REFCLK_TT560 (41) */
+ CTL_SST_TS_UHF, /* REFCLK_ZYFER (42) */
+ CTL_SST_TS_UHF, /* REFCLK_RIPENCC (43) */
+ CTL_SST_TS_UHF, /* REFCLK_NEOCLOCK4X (44) */
+ CTL_SST_TS_UHF, /* REFCLK_TSYNCPCI (45) */
+ CTL_SST_TS_UHF /* REFCLK_GPSDJSON (46) */
+};
+#endif /* REFCLOCK */
+
+
+/*
+ * Keyid used for authenticating write requests.
+ */
+keyid_t ctl_auth_keyid;
+
+/*
+ * We keep track of the last error reported by the system internally
+ */
+static u_char ctl_sys_last_event;
+static u_char ctl_sys_num_events;
+
+
+/*
+ * Statistic counters to keep track of requests and responses.
+ */
+u_long ctltimereset; /* time stats reset */
+u_long numctlreq; /* number of requests we've received */
+u_long numctlbadpkts; /* number of bad control packets */
+u_long numctlresponses; /* number of resp packets sent with data */
+u_long numctlfrags; /* number of fragments sent */
+u_long numctlerrors; /* number of error responses sent */
+u_long numctltooshort; /* number of too short input packets */
+u_long numctlinputresp; /* number of responses on input */
+u_long numctlinputfrag; /* number of fragments on input */
+u_long numctlinputerr; /* number of input pkts with err bit set */
+u_long numctlbadoffset; /* number of input pkts with nonzero offset */
+u_long numctlbadversion; /* number of input pkts with unknown version */
+u_long numctldatatooshort; /* data too short for count */
+u_long numctlbadop; /* bad op code found in packet */
+u_long numasyncmsgs; /* number of async messages we've sent */
+
+/*
+ * Response packet used by these routines. Also some state information
+ * so that we can handle packet formatting within a common set of
+ * subroutines. Note we try to enter data in place whenever possible,
+ * but the need to set the more bit correctly means we occasionally
+ * use the extra buffer and copy.
+ */
+static struct ntp_control rpkt;
+static u_char res_version;
+static u_char res_opcode;
+static associd_t res_associd;
+static u_short res_frags; /* datagrams in this response */
+static int res_offset; /* offset of payload in response */
+static u_char * datapt;
+static u_char * dataend;
+static int datalinelen;
+static int datanotbinflag;
+static sockaddr_u *rmt_addr;
+static struct interface *lcl_inter;
+
+static u_char res_authenticate;
+static u_char res_authokay;
+static keyid_t res_keyid;
+
+#define MAXDATALINELEN (72)
+
+static u_char res_async; /* sending async trap response? */
+
+/*
+ * Pointers for saving state when decoding request packets
+ */
+static char *reqpt;
+static char *reqend;
+
+/*
+ * init_control - initialize request data
+ */
+void
+init_control(void)
+{
+ int i;
+
+#ifdef HAVE_UNAME
+ uname(&utsnamebuf);
+#endif /* HAVE_UNAME */
+
+ ctl_clr_stats();
+
+ ctl_auth_keyid = 0;
+ ctl_sys_last_event = EVNT_UNSPEC;
+ ctl_sys_num_events = 0;
+
+ num_ctl_traps = 0;
+ for (i = 0; i < COUNTOF(ctl_traps); i++)
+ ctl_traps[i].tr_flags = 0;
+}
+
+
+/*
+ * ctl_error - send an error response for the current request
+ */
+static void
+ctl_error(
+ u_char errcode
+ )
+{
+ int maclen;
+
+ numctlerrors++;
+ DPRINTF(3, ("sending control error %u\n", errcode));
+
+ /*
+ * Fill in the fields. We assume rpkt.sequence and rpkt.associd
+ * have already been filled in.
+ */
+ rpkt.r_m_e_op = CTL_RESPONSE | CTL_ERROR |
+ (res_opcode & CTL_OP_MASK);
+ rpkt.status = htons((errcode << 8) & 0xff00);
+ rpkt.count = 0;
+
+ /*
+ * send packet and bump counters
+ */
+ if (res_authenticate && sys_authenticate) {
+ maclen = authencrypt(res_keyid, (u_int32 *)&rpkt,
+ CTL_HEADER_LEN);
+ sendpkt(rmt_addr, lcl_inter, -2, (void *)&rpkt,
+ CTL_HEADER_LEN + maclen);
+ } else
+ sendpkt(rmt_addr, lcl_inter, -3, (void *)&rpkt,
+ CTL_HEADER_LEN);
+}
+
+/*
+ * save_config - Implements ntpq -c "saveconfig <filename>"
+ * Writes current configuration including any runtime
+ * changes by ntpq's :config or config-from-file
+ */
+void
+save_config(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ char reply[128];
+#ifdef SAVECONFIG
+ char filespec[128];
+ char filename[128];
+ char fullpath[512];
+ const char savedconfig_eq[] = "savedconfig=";
+ char savedconfig[sizeof(savedconfig_eq) + sizeof(filename)];
+ time_t now;
+ int fd;
+ FILE *fptr;
+#endif
+
+ if (RES_NOMODIFY & restrict_mask) {
+ snprintf(reply, sizeof(reply),
+ "saveconfig prohibited by restrict ... nomodify");
+ ctl_putdata(reply, strlen(reply), 0);
+ ctl_flushpkt(0);
+ NLOG(NLOG_SYSINFO)
+ msyslog(LOG_NOTICE,
+ "saveconfig from %s rejected due to nomodify restriction",
+ stoa(&rbufp->recv_srcadr));
+ sys_restricted++;
+ return;
+ }
+
+#ifdef SAVECONFIG
+ if (NULL == saveconfigdir) {
+ snprintf(reply, sizeof(reply),
+ "saveconfig prohibited, no saveconfigdir configured");
+ ctl_putdata(reply, strlen(reply), 0);
+ ctl_flushpkt(0);
+ NLOG(NLOG_SYSINFO)
+ msyslog(LOG_NOTICE,
+ "saveconfig from %s rejected, no saveconfigdir",
+ stoa(&rbufp->recv_srcadr));
+ return;
+ }
+
+ if (0 == reqend - reqpt)
+ return;
+
+ strlcpy(filespec, reqpt, sizeof(filespec));
+ time(&now);
+
+ /*
+ * allow timestamping of the saved config filename with
+ * strftime() format such as:
+ * ntpq -c "saveconfig ntp-%Y%m%d-%H%M%S.conf"
+ */
+ if (0 == strftime(filename, sizeof(filename), filespec,
+ localtime(&now)))
+ 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, '/')) {
+ snprintf(reply, sizeof(reply),
+ "saveconfig does not allow directory in filename");
+ ctl_putdata(reply, strlen(reply), 0);
+ ctl_flushpkt(0);
+ msyslog(LOG_NOTICE,
+ "saveconfig with path from %s rejected",
+ stoa(&rbufp->recv_srcadr));
+ return;
+ }
+
+ snprintf(fullpath, sizeof(fullpath), "%s%s",
+ saveconfigdir, filename);
+
+ fd = open(fullpath, O_CREAT | O_TRUNC | O_WRONLY,
+ S_IRUSR | S_IWUSR);
+ if (-1 == fd)
+ fptr = NULL;
+ else
+ fptr = fdopen(fd, "w");
+
+ if (NULL == fptr || -1 == dump_all_config_trees(fptr, 1)) {
+ snprintf(reply, sizeof(reply),
+ "Unable to save configuration to file %s",
+ filename);
+ msyslog(LOG_ERR,
+ "saveconfig %s from %s failed", filename,
+ stoa(&rbufp->recv_srcadr));
+ } else {
+ snprintf(reply, sizeof(reply),
+ "Configuration saved to %s", filename);
+ msyslog(LOG_NOTICE,
+ "Configuration saved to %s (requested by %s)",
+ fullpath, stoa(&rbufp->recv_srcadr));
+ /*
+ * save the output filename in system variable
+ * savedconfig, retrieved with:
+ * ntpq -c "rv 0 savedconfig"
+ */
+ snprintf(savedconfig, sizeof(savedconfig), "%s%s",
+ savedconfig_eq, filename);
+ set_sys_var(savedconfig, strlen(savedconfig) + 1, RO);
+ }
+
+ if (NULL != fptr)
+ fclose(fptr);
+#else /* !SAVECONFIG follows */
+ snprintf(reply, sizeof(reply),
+ "saveconfig unavailable, configured with --disable-saveconfig");
+#endif
+
+ ctl_putdata(reply, strlen(reply), 0);
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * process_control - process an incoming control message
+ */
+void
+process_control(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ struct ntp_control *pkt;
+ int req_count;
+ int req_data;
+ const struct ctl_proc *cc;
+ keyid_t *pkid;
+ int properlen;
+ int maclen;
+
+ DPRINTF(3, ("in process_control()\n"));
+
+ /*
+ * Save the addresses for error responses
+ */
+ numctlreq++;
+ rmt_addr = &rbufp->recv_srcadr;
+ lcl_inter = rbufp->dstadr;
+ pkt = (struct ntp_control *)&rbufp->recv_pkt;
+
+ /*
+ * If the length is less than required for the header, or
+ * it is a response or a fragment, ignore this.
+ */
+ if (rbufp->recv_length < CTL_HEADER_LEN
+ || (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op
+ || pkt->offset != 0) {
+ DPRINTF(1, ("invalid format in control packet\n"));
+ if (rbufp->recv_length < CTL_HEADER_LEN)
+ numctltooshort++;
+ if (CTL_RESPONSE & pkt->r_m_e_op)
+ numctlinputresp++;
+ if (CTL_MORE & pkt->r_m_e_op)
+ numctlinputfrag++;
+ if (CTL_ERROR & pkt->r_m_e_op)
+ numctlinputerr++;
+ if (pkt->offset != 0)
+ numctlbadoffset++;
+ return;
+ }
+ res_version = PKT_VERSION(pkt->li_vn_mode);
+ if (res_version > NTP_VERSION || res_version < NTP_OLDVERSION) {
+ DPRINTF(1, ("unknown version %d in control packet\n",
+ res_version));
+ numctlbadversion++;
+ return;
+ }
+
+ /*
+ * Pull enough data from the packet to make intelligent
+ * responses
+ */
+ rpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap, res_version,
+ MODE_CONTROL);
+ res_opcode = pkt->r_m_e_op;
+ rpkt.sequence = pkt->sequence;
+ rpkt.associd = pkt->associd;
+ rpkt.status = 0;
+ res_frags = 1;
+ res_offset = 0;
+ res_associd = htons(pkt->associd);
+ res_async = FALSE;
+ res_authenticate = FALSE;
+ res_keyid = 0;
+ res_authokay = FALSE;
+ req_count = (int)ntohs(pkt->count);
+ datanotbinflag = FALSE;
+ datalinelen = 0;
+ datapt = rpkt.u.data;
+ dataend = &rpkt.u.data[CTL_MAX_DATA_LEN];
+
+ if ((rbufp->recv_length & 0x3) != 0)
+ DPRINTF(3, ("Control packet length %d unrounded\n",
+ rbufp->recv_length));
+
+ /*
+ * We're set up now. Make sure we've got at least enough
+ * incoming data space to match the count.
+ */
+ req_data = rbufp->recv_length - CTL_HEADER_LEN;
+ if (req_data < req_count || rbufp->recv_length & 0x3) {
+ ctl_error(CERR_BADFMT);
+ numctldatatooshort++;
+ return;
+ }
+
+ properlen = req_count + CTL_HEADER_LEN;
+ /* round up proper len to a 8 octet boundary */
+
+ properlen = (properlen + 7) & ~7;
+ maclen = rbufp->recv_length - properlen;
+ if ((rbufp->recv_length & 3) == 0 &&
+ maclen >= MIN_MAC_LEN && maclen <= MAX_MAC_LEN &&
+ sys_authenticate) {
+ res_authenticate = TRUE;
+ pkid = (void *)((char *)pkt + properlen);
+ res_keyid = ntohl(*pkid);
+ DPRINTF(3, ("recv_len %d, properlen %d, wants auth with keyid %08x, MAC length=%d\n",
+ rbufp->recv_length, properlen, res_keyid,
+ maclen));
+
+ if (!authistrusted(res_keyid))
+ DPRINTF(3, ("invalid keyid %08x\n", res_keyid));
+ else if (authdecrypt(res_keyid, (u_int32 *)pkt,
+ rbufp->recv_length - maclen,
+ maclen)) {
+ res_authokay = TRUE;
+ DPRINTF(3, ("authenticated okay\n"));
+ } else {
+ res_keyid = 0;
+ DPRINTF(3, ("authentication failed\n"));
+ }
+ }
+
+ /*
+ * Set up translate pointers
+ */
+ reqpt = (char *)pkt->u.data;
+ reqend = reqpt + req_count;
+
+ /*
+ * Look for the opcode processor
+ */
+ for (cc = control_codes; cc->control_code != NO_REQUEST; cc++) {
+ if (cc->control_code == res_opcode) {
+ DPRINTF(3, ("opcode %d, found command handler\n",
+ res_opcode));
+ if (cc->flags == AUTH
+ && (!res_authokay
+ || res_keyid != ctl_auth_keyid)) {
+ ctl_error(CERR_PERMISSION);
+ return;
+ }
+ (cc->handler)(rbufp, restrict_mask);
+ return;
+ }
+ }
+
+ /*
+ * Can't find this one, return an error.
+ */
+ numctlbadop++;
+ ctl_error(CERR_BADOP);
+ return;
+}
+
+
+/*
+ * ctlpeerstatus - return a status word for this peer
+ */
+u_short
+ctlpeerstatus(
+ register struct peer *p
+ )
+{
+ u_short status;
+
+ status = p->status;
+ if (FLAG_CONFIG & p->flags)
+ status |= CTL_PST_CONFIG;
+ if (p->keyid)
+ status |= CTL_PST_AUTHENABLE;
+ if (FLAG_AUTHENTIC & p->flags)
+ status |= CTL_PST_AUTHENTIC;
+ if (p->reach)
+ status |= CTL_PST_REACH;
+ if (MDF_TXONLY_MASK & p->cast_flags)
+ status |= CTL_PST_BCAST;
+
+ return CTL_PEER_STATUS(status, p->num_events, p->last_event);
+}
+
+
+/*
+ * ctlclkstatus - return a status word for this clock
+ */
+#ifdef REFCLOCK
+static u_short
+ctlclkstatus(
+ struct refclockstat *pcs
+ )
+{
+ return CTL_PEER_STATUS(0, pcs->lastevent, pcs->currentstatus);
+}
+#endif
+
+
+/*
+ * ctlsysstatus - return the system status word
+ */
+u_short
+ctlsysstatus(void)
+{
+ register u_char this_clock;
+
+ this_clock = CTL_SST_TS_UNSPEC;
+#ifdef REFCLOCK
+ if (sys_peer != NULL) {
+ if (CTL_SST_TS_UNSPEC != sys_peer->sstclktype)
+ this_clock = sys_peer->sstclktype;
+ else if (sys_peer->refclktype < COUNTOF(clocktypes))
+ this_clock = clocktypes[sys_peer->refclktype];
+ }
+#else /* REFCLOCK */
+ if (sys_peer != 0)
+ this_clock = CTL_SST_TS_NTP;
+#endif /* REFCLOCK */
+ return CTL_SYS_STATUS(sys_leap, this_clock, ctl_sys_num_events,
+ ctl_sys_last_event);
+}
+
+
+/*
+ * ctl_flushpkt - write out the current packet and prepare
+ * another if necessary.
+ */
+static void
+ctl_flushpkt(
+ u_char more
+ )
+{
+ int i;
+ int dlen;
+ int sendlen;
+ int maclen;
+ int totlen;
+ keyid_t keyid;
+
+ dlen = datapt - rpkt.u.data;
+ if (!more && datanotbinflag && dlen + 2 < CTL_MAX_DATA_LEN) {
+ /*
+ * Big hack, output a trailing \r\n
+ */
+ *datapt++ = '\r';
+ *datapt++ = '\n';
+ dlen += 2;
+ }
+ sendlen = dlen + CTL_HEADER_LEN;
+
+ /*
+ * Pad to a multiple of 32 bits
+ */
+ while (sendlen & 0x3) {
+ *datapt++ = '\0';
+ sendlen++;
+ }
+
+ /*
+ * Fill in the packet with the current info
+ */
+ rpkt.r_m_e_op = CTL_RESPONSE | more |
+ (res_opcode & CTL_OP_MASK);
+ rpkt.count = htons((u_short)dlen);
+ rpkt.offset = htons((u_short)res_offset);
+ if (res_async) {
+ for (i = 0; i < COUNTOF(ctl_traps); i++) {
+ if (TRAP_INUSE & ctl_traps[i].tr_flags) {
+ rpkt.li_vn_mode =
+ PKT_LI_VN_MODE(
+ sys_leap,
+ ctl_traps[i].tr_version,
+ MODE_CONTROL);
+ rpkt.sequence =
+ htons(ctl_traps[i].tr_sequence);
+ sendpkt(&ctl_traps[i].tr_addr,
+ ctl_traps[i].tr_localaddr, -4,
+ (struct pkt *)&rpkt, sendlen);
+ if (!more)
+ ctl_traps[i].tr_sequence++;
+ numasyncmsgs++;
+ }
+ }
+ } else {
+ if (res_authenticate && sys_authenticate) {
+ totlen = sendlen;
+ /*
+ * If we are going to authenticate, then there
+ * is an additional requirement that the MAC
+ * begin on a 64 bit boundary.
+ */
+ while (totlen & 7) {
+ *datapt++ = '\0';
+ totlen++;
+ }
+ keyid = htonl(res_keyid);
+ memcpy(datapt, &keyid, sizeof(keyid));
+ maclen = authencrypt(res_keyid,
+ (u_int32 *)&rpkt, totlen);
+ sendpkt(rmt_addr, lcl_inter, -5,
+ (struct pkt *)&rpkt, totlen + maclen);
+ } else {
+ sendpkt(rmt_addr, lcl_inter, -6,
+ (struct pkt *)&rpkt, sendlen);
+ }
+ if (more)
+ numctlfrags++;
+ else
+ numctlresponses++;
+ }
+
+ /*
+ * Set us up for another go around.
+ */
+ res_frags++;
+ res_offset += dlen;
+ datapt = rpkt.u.data;
+}
+
+
+/*
+ * ctl_putdata - write data into the packet, fragmenting and starting
+ * another if this one is full.
+ */
+static void
+ctl_putdata(
+ const char *dp,
+ unsigned int dlen,
+ int bin /* set to 1 when data is binary */
+ )
+{
+ int overhead;
+
+ overhead = 0;
+ if (!bin) {
+ datanotbinflag = TRUE;
+ overhead = 3;
+ if (datapt != rpkt.u.data) {
+ *datapt++ = ',';
+ datalinelen++;
+ if ((dlen + datalinelen + 1) >= MAXDATALINELEN) {
+ *datapt++ = '\r';
+ *datapt++ = '\n';
+ datalinelen = 0;
+ } else {
+ *datapt++ = ' ';
+ datalinelen++;
+ }
+ }
+ }
+
+ /*
+ * Save room for trailing junk
+ */
+ if (dlen + overhead + datapt > dataend) {
+ /*
+ * Not enough room in this one, flush it out.
+ */
+ ctl_flushpkt(CTL_MORE);
+ }
+ memcpy(datapt, dp, dlen);
+ datapt += dlen;
+ datalinelen += dlen;
+}
+
+
+/*
+ * ctl_putstr - write a tagged string into the response packet
+ * in the form:
+ *
+ * tag="data"
+ *
+ * len is the data length excluding the NUL terminator,
+ * as in ctl_putstr("var", "value", strlen("value"));
+ */
+static void
+ctl_putstr(
+ const char * tag,
+ const char * data,
+ size_t len
+ )
+{
+ char buffer[512];
+ char *cp;
+ size_t tl;
+
+ tl = strlen(tag);
+ memcpy(buffer, tag, tl);
+ cp = buffer + tl;
+ if (len > 0) {
+ NTP_INSIST(tl + 3 + len <= sizeof(buffer));
+ *cp++ = '=';
+ *cp++ = '"';
+ memcpy(cp, data, len);
+ cp += len;
+ *cp++ = '"';
+ }
+ ctl_putdata(buffer, (u_int)(cp - buffer), 0);
+}
+
+
+/*
+ * ctl_putunqstr - write a tagged string into the response packet
+ * in the form:
+ *
+ * tag=data
+ *
+ * len is the data length excluding the NUL terminator.
+ * data must not contain a comma or whitespace.
+ */
+static void
+ctl_putunqstr(
+ const char * tag,
+ const char * data,
+ size_t len
+ )
+{
+ char buffer[512];
+ char *cp;
+ size_t tl;
+
+ tl = strlen(tag);
+ memcpy(buffer, tag, tl);
+ cp = buffer + tl;
+ if (len > 0) {
+ NTP_INSIST(tl + 1 + len <= sizeof(buffer));
+ *cp++ = '=';
+ memcpy(cp, data, len);
+ cp += len;
+ }
+ ctl_putdata(buffer, (u_int)(cp - buffer), 0);
+}
+
+
+/*
+ * ctl_putdblf - write a tagged, signed double into the response packet
+ */
+static void
+ctl_putdblf(
+ const char * tag,
+ const char * fmt,
+ double d
+ )
+{
+ char *cp;
+ const char *cq;
+ char buffer[200];
+
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+ *cp++ = '=';
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer), fmt, d);
+ cp += strlen(cp);
+ ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
+}
+
+/*
+ * ctl_putuint - write a tagged unsigned integer into the response
+ */
+static void
+ctl_putuint(
+ const char *tag,
+ u_long uval
+ )
+{
+ register char *cp;
+ register const char *cq;
+ char buffer[200];
+
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+
+ *cp++ = '=';
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer), "%lu", uval);
+ cp += strlen(cp);
+ ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
+}
+
+/*
+ * ctl_putfs - write a decoded filestamp into the response
+ */
+static void
+ctl_putfs(
+ const char *tag,
+ tstamp_t uval
+ )
+{
+ register char *cp;
+ register const char *cq;
+ char buffer[200];
+ struct tm *tm = NULL;
+ time_t fstamp;
+
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+
+ *cp++ = '=';
+ fstamp = uval - JAN_1970;
+ tm = gmtime(&fstamp);
+ if (NULL == tm)
+ return;
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer),
+ "%04d%02d%02d%02d%02d", tm->tm_year + 1900,
+ tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min);
+ cp += strlen(cp);
+ ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
+}
+
+
+/*
+ * ctl_puthex - write a tagged unsigned integer, in hex, into the
+ * response
+ */
+static void
+ctl_puthex(
+ const char *tag,
+ u_long uval
+ )
+{
+ register char *cp;
+ register const char *cq;
+ char buffer[200];
+
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+
+ *cp++ = '=';
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%lx", uval);
+ cp += strlen(cp);
+ ctl_putdata(buffer,(unsigned)( cp - buffer ), 0);
+}
+
+
+/*
+ * ctl_putint - write a tagged signed integer into the response
+ */
+static void
+ctl_putint(
+ const char *tag,
+ long ival
+ )
+{
+ register char *cp;
+ register const char *cq;
+ char buffer[200];
+
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+
+ *cp++ = '=';
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer), "%ld", ival);
+ cp += strlen(cp);
+ ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
+}
+
+
+/*
+ * ctl_putts - write a tagged timestamp, in hex, into the response
+ */
+static void
+ctl_putts(
+ const char *tag,
+ l_fp *ts
+ )
+{
+ register char *cp;
+ register const char *cq;
+ char buffer[200];
+
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+
+ *cp++ = '=';
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%08x.%08x",
+ (u_int)ts->l_ui, (u_int)ts->l_uf);
+ cp += strlen(cp);
+ ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
+}
+
+
+/*
+ * ctl_putadr - write an IP address into the response
+ */
+static void
+ctl_putadr(
+ const char *tag,
+ u_int32 addr32,
+ sockaddr_u *addr
+ )
+{
+ register char *cp;
+ register const char *cq;
+ char buffer[200];
+
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+
+ *cp++ = '=';
+ if (NULL == addr)
+ cq = numtoa(addr32);
+ else
+ cq = stoa(addr);
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer), "%s", cq);
+ cp += strlen(cp);
+ ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
+}
+
+
+/*
+ * ctl_putrefid - send a u_int32 refid as printable text
+ */
+static void
+ctl_putrefid(
+ const char * tag,
+ u_int32 refid
+ )
+{
+ char output[16];
+ char * optr;
+ char * oplim;
+ char * iptr;
+ char * iplim;
+ char * past_eq;
+
+ optr = output;
+ oplim = output + sizeof(output);
+ while (optr < oplim && '\0' != *tag)
+ *optr++ = *tag++;
+ if (optr < oplim) {
+ *optr++ = '=';
+ past_eq = optr;
+ }
+ if (!(optr < oplim))
+ return;
+ iptr = (char *)&refid;
+ iplim = iptr + sizeof(refid);
+ for ( ; optr < oplim && iptr < iplim && '\0' != *iptr;
+ iptr++, optr++)
+ if (isprint(*iptr))
+ *optr = *iptr;
+ else
+ *optr = '.';
+ if (!(optr <= oplim))
+ optr = past_eq;
+ ctl_putdata(output, (u_int)(optr - output), FALSE);
+}
+
+
+/*
+ * ctl_putarray - write a tagged eight element double array into the response
+ */
+static void
+ctl_putarray(
+ const char *tag,
+ double *arr,
+ int start
+ )
+{
+ register char *cp;
+ register const char *cq;
+ char buffer[200];
+ int i;
+ cp = buffer;
+ cq = tag;
+ while (*cq != '\0')
+ *cp++ = *cq++;
+ *cp++ = '=';
+ i = start;
+ do {
+ if (i == 0)
+ i = NTP_SHIFT;
+ i--;
+ NTP_INSIST((cp - buffer) < sizeof(buffer));
+ snprintf(cp, sizeof(buffer) - (cp - buffer),
+ " %.2f", arr[i] * 1e3);
+ cp += strlen(cp);
+ } while (i != start);
+ ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
+}
+
+
+/*
+ * ctl_putsys - output a system variable
+ */
+static void
+ctl_putsys(
+ int varid
+ )
+{
+ l_fp tmp;
+ char str[256];
+ u_int u;
+ double kb;
+ double dtemp;
+ const char *ss;
+ size_t len;
+ int firstvarname;
+ const struct ctl_var *k;
+#ifdef AUTOKEY
+ struct cert_info *cp;
+#endif /* AUTOKEY */
+#ifdef KERNEL_PLL
+ static struct timex ntx;
+ static u_long ntp_adjtime_time;
+
+ static const double to_ms =
+# ifdef STA_NANO
+ 1.0e-6; /* nsec to msec */
+# else
+ 1.0e-3; /* usec to msec */
+# endif
+
+ /*
+ * CS_K_* variables depend on up-to-date output of ntp_adjtime()
+ */
+ if (CS_KERN_FIRST <= varid && varid <= CS_KERN_LAST &&
+ current_time != ntp_adjtime_time) {
+ ZERO(ntx);
+ if (ntp_adjtime(&ntx) < 0)
+ msyslog(LOG_ERR, "ntp_adjtime() for mode 6 query failed: %m");
+ else
+ ntp_adjtime_time = current_time;
+ }
+#endif /* KERNEL_PLL */
+
+ switch (varid) {
+
+ case CS_LEAP:
+ ctl_putuint(sys_var[CS_LEAP].text, sys_leap);
+ break;
+
+ case CS_STRATUM:
+ ctl_putuint(sys_var[CS_STRATUM].text, sys_stratum);
+ break;
+
+ case CS_PRECISION:
+ ctl_putint(sys_var[CS_PRECISION].text, sys_precision);
+ break;
+
+ case CS_ROOTDELAY:
+ ctl_putdbl(sys_var[CS_ROOTDELAY].text, sys_rootdelay *
+ 1e3);
+ break;
+
+ case CS_ROOTDISPERSION:
+ ctl_putdbl(sys_var[CS_ROOTDISPERSION].text,
+ sys_rootdisp * 1e3);
+ break;
+
+ case CS_REFID:
+ if (sys_stratum > 1 && sys_stratum < STRATUM_UNSPEC)
+ ctl_putadr(sys_var[varid].text, sys_refid, NULL);
+ else
+ ctl_putrefid(sys_var[varid].text, sys_refid);
+ break;
+
+ case CS_REFTIME:
+ ctl_putts(sys_var[CS_REFTIME].text, &sys_reftime);
+ break;
+
+ case CS_POLL:
+ ctl_putuint(sys_var[CS_POLL].text, sys_poll);
+ break;
+
+ case CS_PEERID:
+ if (sys_peer == NULL)
+ ctl_putuint(sys_var[CS_PEERID].text, 0);
+ else
+ ctl_putuint(sys_var[CS_PEERID].text,
+ sys_peer->associd);
+ break;
+
+ case CS_PEERADR:
+ if (sys_peer != NULL && sys_peer->dstadr != NULL)
+ ss = sptoa(&sys_peer->srcadr);
+ else
+ ss = "0.0.0.0:0";
+ ctl_putunqstr(sys_var[CS_PEERADR].text, ss, strlen(ss));
+ break;
+
+ case CS_PEERMODE:
+ u = (sys_peer != NULL)
+ ? sys_peer->hmode
+ : MODE_UNSPEC;
+ ctl_putuint(sys_var[CS_PEERMODE].text, u);
+ break;
+
+ case CS_OFFSET:
+ ctl_putdbl6(sys_var[CS_OFFSET].text, last_offset * 1e3);
+ break;
+
+ case CS_DRIFT:
+ ctl_putdbl(sys_var[CS_DRIFT].text, drift_comp * 1e6);
+ break;
+
+ case CS_JITTER:
+ ctl_putdbl6(sys_var[CS_JITTER].text, sys_jitter * 1e3);
+ break;
+
+ case CS_ERROR:
+ ctl_putdbl(sys_var[CS_ERROR].text, clock_jitter * 1e3);
+ break;
+
+ case CS_CLOCK:
+ get_systime(&tmp);
+ ctl_putts(sys_var[CS_CLOCK].text, &tmp);
+ break;
+
+ case CS_PROCESSOR:
+#ifndef HAVE_UNAME
+ ctl_putstr(sys_var[CS_PROCESSOR].text, str_processor,
+ sizeof(str_processor) - 1);
+#else
+ ctl_putstr(sys_var[CS_PROCESSOR].text,
+ utsnamebuf.machine, strlen(utsnamebuf.machine));
+#endif /* HAVE_UNAME */
+ break;
+
+ case CS_SYSTEM:
+#ifndef HAVE_UNAME
+ ctl_putstr(sys_var[CS_SYSTEM].text, str_system,
+ sizeof(str_system) - 1);
+#else
+ snprintf(str, sizeof(str), "%s/%s", utsnamebuf.sysname,
+ utsnamebuf.release);
+ ctl_putstr(sys_var[CS_SYSTEM].text, str, strlen(str));
+#endif /* HAVE_UNAME */
+ break;
+
+ case CS_VERSION:
+ ctl_putstr(sys_var[CS_VERSION].text, Version,
+ strlen(Version));
+ break;
+
+ case CS_STABIL:
+ ctl_putdbl(sys_var[CS_STABIL].text, clock_stability *
+ 1e6);
+ break;
+
+ case CS_VARLIST:
+ {
+ char buf[CTL_MAX_DATA_LEN];
+ //buffPointer, firstElementPointer, buffEndPointer
+ register char *buffp, *buffend;
+ register int firstVarName;
+ register const char *ss;
+ register int len;
+ register struct ctl_var *k;
+
+ buffp = buf;
+ buffend = buf + sizeof(buf);
+ if (buffp + strlen(sys_var[CS_VARLIST].text) + 4 > buffend)
+ break; /* really long var name */
+
+ snprintf(buffp, sizeof(buf), "%s=\"",sys_var[CS_VARLIST].text);
+ buffp += strlen(buffp);
+ firstVarName = TRUE;
+ for (k = sys_var; !(k->flags & EOV); k++) {
+ if (k->flags & PADDING)
+ continue;
+ len = strlen(k->text);
+ if (buffp + len + 1 >= buffend)
+ break;
+ if (!firstVarName)
+ *buffp++ = ',';
+ else
+ firstVarName = FALSE;
+ memcpy(buffp, k->text, len);
+ buffp += len;
+ }
+
+ for (k = ext_sys_var; k && !(k->flags & EOV); k++) {
+ if (k->flags & PADDING)
+ continue;
+ if (NULL == k->text)
+ continue;
+ ss = strchr(k->text, '=');
+ if (NULL == ss)
+ len = strlen(k->text);
+ else
+ len = ss - k->text;
+ if (buffp + len + 1 >= buffend)
+ break;
+ if (firstVarName) {
+ *buffp++ = ',';
+ firstVarName = FALSE;
+ }
+ memcpy(buffp, k->text,(unsigned)len);
+ buffp += len;
+ }
+ if (buffp + 2 >= buffend)
+ break;
+
+ *buffp++ = '"';
+ *buffp = '\0';
+
+ ctl_putdata(buf, (unsigned)( buffp - buf ), 0);
+ break;
+ }
+
+ case CS_TAI:
+ if (sys_tai > 0)
+ ctl_putuint(sys_var[CS_TAI].text, sys_tai);
+ break;
+
+ case CS_LEAPTAB:
+ {
+ leap_signature_t lsig;
+ leapsec_getsig(&lsig);
+ if (lsig.ttime > 0)
+ ctl_putfs(sys_var[CS_LEAPTAB].text, lsig.ttime);
+ break;
+ }
+
+ case CS_LEAPEND:
+ {
+ leap_signature_t lsig;
+ leapsec_getsig(&lsig);
+ if (lsig.etime > 0)
+ ctl_putfs(sys_var[CS_LEAPEND].text, lsig.etime);
+ break;
+ }
+
+ case CS_RATE:
+ ctl_putuint(sys_var[CS_RATE].text, ntp_minpoll);
+ break;
+
+ case CS_MRU_ENABLED:
+ ctl_puthex(sys_var[varid].text, mon_enabled);
+ break;
+
+ case CS_MRU_DEPTH:
+ ctl_putuint(sys_var[varid].text, mru_entries);
+ break;
+
+ case CS_MRU_MEM:
+ kb = mru_entries * (sizeof(mon_entry) / 1024.);
+ u = (u_int)kb;
+ if (kb - u >= 0.5)
+ u++;
+ ctl_putuint(sys_var[varid].text, u);
+ break;
+
+ case CS_MRU_DEEPEST:
+ ctl_putuint(sys_var[varid].text, mru_peakentries);
+ break;
+
+ case CS_MRU_MINDEPTH:
+ ctl_putuint(sys_var[varid].text, mru_mindepth);
+ break;
+
+ case CS_MRU_MAXAGE:
+ ctl_putint(sys_var[varid].text, mru_maxage);
+ break;
+
+ case CS_MRU_MAXDEPTH:
+ ctl_putuint(sys_var[varid].text, mru_maxdepth);
+ break;
+
+ case CS_MRU_MAXMEM:
+ kb = mru_maxdepth * (sizeof(mon_entry) / 1024.);
+ u = (u_int)kb;
+ if (kb - u >= 0.5)
+ u++;
+ ctl_putuint(sys_var[varid].text, u);
+ break;
+
+ case CS_SS_UPTIME:
+ ctl_putuint(sys_var[varid].text, current_time);
+ break;
+
+ case CS_SS_RESET:
+ ctl_putuint(sys_var[varid].text,
+ current_time - sys_stattime);
+ break;
+
+ case CS_SS_RECEIVED:
+ ctl_putuint(sys_var[varid].text, sys_received);
+ break;
+
+ case CS_SS_THISVER:
+ ctl_putuint(sys_var[varid].text, sys_newversion);
+ break;
+
+ case CS_SS_OLDVER:
+ ctl_putuint(sys_var[varid].text, sys_oldversion);
+ break;
+
+ case CS_SS_BADFORMAT:
+ ctl_putuint(sys_var[varid].text, sys_badlength);
+ break;
+
+ case CS_SS_BADAUTH:
+ ctl_putuint(sys_var[varid].text, sys_badauth);
+ break;
+
+ case CS_SS_DECLINED:
+ ctl_putuint(sys_var[varid].text, sys_declined);
+ break;
+
+ case CS_SS_RESTRICTED:
+ ctl_putuint(sys_var[varid].text, sys_restricted);
+ break;
+
+ case CS_SS_LIMITED:
+ ctl_putuint(sys_var[varid].text, sys_limitrejected);
+ break;
+
+ case CS_SS_KODSENT:
+ ctl_putuint(sys_var[varid].text, sys_kodsent);
+ break;
+
+ case CS_SS_PROCESSED:
+ ctl_putuint(sys_var[varid].text, sys_processed);
+ break;
+
+ case CS_BCASTDELAY:
+ ctl_putdbl(sys_var[varid].text, sys_bdelay * 1e3);
+ break;
+
+ case CS_AUTHDELAY:
+ LFPTOD(&sys_authdelay, dtemp);
+ ctl_putdbl(sys_var[varid].text, dtemp * 1e3);
+ break;
+
+ case CS_AUTHKEYS:
+ ctl_putuint(sys_var[varid].text, authnumkeys);
+ break;
+
+ case CS_AUTHFREEK:
+ ctl_putuint(sys_var[varid].text, authnumfreekeys);
+ break;
+
+ case CS_AUTHKLOOKUPS:
+ ctl_putuint(sys_var[varid].text, authkeylookups);
+ break;
+
+ case CS_AUTHKNOTFOUND:
+ ctl_putuint(sys_var[varid].text, authkeynotfound);
+ break;
+
+ case CS_AUTHKUNCACHED:
+ ctl_putuint(sys_var[varid].text, authkeyuncached);
+ break;
+
+ case CS_AUTHKEXPIRED:
+ ctl_putuint(sys_var[varid].text, authkeyexpired);
+ break;
+
+ case CS_AUTHENCRYPTS:
+ ctl_putuint(sys_var[varid].text, authencryptions);
+ break;
+
+ case CS_AUTHDECRYPTS:
+ ctl_putuint(sys_var[varid].text, authdecryptions);
+ break;
+
+ case CS_AUTHRESET:
+ ctl_putuint(sys_var[varid].text,
+ current_time - auth_timereset);
+ break;
+
+ /*
+ * CTL_IF_KERNLOOP() puts a zero if the kernel loop is
+ * unavailable, otherwise calls putfunc with args.
+ */
+#ifndef KERNEL_PLL
+# define CTL_IF_KERNLOOP(putfunc, args) \
+ ctl_putint(sys_var[varid].text, 0)
+#else
+# define CTL_IF_KERNLOOP(putfunc, args) \
+ putfunc args
+#endif
+
+ /*
+ * CTL_IF_KERNPPS() puts a zero if either the kernel
+ * loop is unavailable, or kernel hard PPS is not
+ * active, otherwise calls putfunc with args.
+ */
+#ifndef KERNEL_PLL
+# define CTL_IF_KERNPPS(putfunc, args) \
+ ctl_putint(sys_var[varid].text, 0)
+#else
+# define CTL_IF_KERNPPS(putfunc, args) \
+ if (0 == ntx.shift) \
+ ctl_putint(sys_var[varid].text, 0); \
+ else \
+ putfunc args /* no trailing ; */
+#endif
+
+ case CS_K_OFFSET:
+ CTL_IF_KERNLOOP(
+ ctl_putdblf,
+ (sys_var[varid].text, "%g", to_ms * ntx.offset)
+ );
+ break;
+
+ case CS_K_FREQ:
+ CTL_IF_KERNLOOP(
+ ctl_putsfp,
+ (sys_var[varid].text, ntx.freq)
+ );
+ break;
+
+ case CS_K_MAXERR:
+ CTL_IF_KERNLOOP(
+ ctl_putdblf,
+ (sys_var[varid].text, "%.6g",
+ to_ms * ntx.maxerror)
+ );
+ break;
+
+ case CS_K_ESTERR:
+ CTL_IF_KERNLOOP(
+ ctl_putdblf,
+ (sys_var[varid].text, "%.6g",
+ to_ms * ntx.esterror)
+ );
+ break;
+
+ case CS_K_STFLAGS:
+#ifndef KERNEL_PLL
+ ss = "";
+#else
+ ss = k_st_flags(ntx.status);
+#endif
+ ctl_putstr(sys_var[varid].text, ss, strlen(ss));
+ break;
+
+ case CS_K_TIMECONST:
+ CTL_IF_KERNLOOP(
+ ctl_putint,
+ (sys_var[varid].text, ntx.constant)
+ );
+ break;
+
+ case CS_K_PRECISION:
+ CTL_IF_KERNLOOP(
+ ctl_putdblf,
+ (sys_var[varid].text, "%.6g",
+ to_ms * ntx.precision)
+ );
+ break;
+
+ case CS_K_FREQTOL:
+ CTL_IF_KERNLOOP(
+ ctl_putsfp,
+ (sys_var[varid].text, ntx.tolerance)
+ );
+ break;
+
+ case CS_K_PPS_FREQ:
+ CTL_IF_KERNPPS(
+ ctl_putsfp,
+ (sys_var[varid].text, ntx.ppsfreq)
+ );
+ break;
+
+ case CS_K_PPS_STABIL:
+ CTL_IF_KERNPPS(
+ ctl_putsfp,
+ (sys_var[varid].text, ntx.stabil)
+ );
+ break;
+
+ case CS_K_PPS_JITTER:
+ CTL_IF_KERNPPS(
+ ctl_putdbl,
+ (sys_var[varid].text, to_ms * ntx.jitter)
+ );
+ break;
+
+ case CS_K_PPS_CALIBDUR:
+ CTL_IF_KERNPPS(
+ ctl_putint,
+ (sys_var[varid].text, 1 << ntx.shift)
+ );
+ break;
+
+ case CS_K_PPS_CALIBS:
+ CTL_IF_KERNPPS(
+ ctl_putint,
+ (sys_var[varid].text, ntx.calcnt)
+ );
+ break;
+
+ case CS_K_PPS_CALIBERRS:
+ CTL_IF_KERNPPS(
+ ctl_putint,
+ (sys_var[varid].text, ntx.errcnt)
+ );
+ break;
+
+ case CS_K_PPS_JITEXC:
+ CTL_IF_KERNPPS(
+ ctl_putint,
+ (sys_var[varid].text, ntx.jitcnt)
+ );
+ break;
+
+ case CS_K_PPS_STBEXC:
+ CTL_IF_KERNPPS(
+ ctl_putint,
+ (sys_var[varid].text, ntx.stbcnt)
+ );
+ break;
+
+ case CS_IOSTATS_RESET:
+ ctl_putuint(sys_var[varid].text,
+ current_time - io_timereset);
+ break;
+
+ case CS_TOTAL_RBUF:
+ ctl_putuint(sys_var[varid].text, total_recvbuffs());
+ break;
+
+ case CS_FREE_RBUF:
+ ctl_putuint(sys_var[varid].text, free_recvbuffs());
+ break;
+
+ case CS_USED_RBUF:
+ ctl_putuint(sys_var[varid].text, full_recvbuffs());
+ break;
+
+ case CS_RBUF_LOWATER:
+ ctl_putuint(sys_var[varid].text, lowater_additions());
+ break;
+
+ case CS_IO_DROPPED:
+ ctl_putuint(sys_var[varid].text, packets_dropped);
+ break;
+
+ case CS_IO_IGNORED:
+ ctl_putuint(sys_var[varid].text, packets_ignored);
+ break;
+
+ case CS_IO_RECEIVED:
+ ctl_putuint(sys_var[varid].text, packets_received);
+ break;
+
+ case CS_IO_SENT:
+ ctl_putuint(sys_var[varid].text, packets_sent);
+ break;
+
+ case CS_IO_SENDFAILED:
+ ctl_putuint(sys_var[varid].text, packets_notsent);
+ break;
+
+ case CS_IO_WAKEUPS:
+ ctl_putuint(sys_var[varid].text, handler_calls);
+ break;
+
+ case CS_IO_GOODWAKEUPS:
+ ctl_putuint(sys_var[varid].text, handler_pkts);
+ break;
+
+ case CS_TIMERSTATS_RESET:
+ ctl_putuint(sys_var[varid].text,
+ current_time - timer_timereset);
+ break;
+
+ case CS_TIMER_OVERRUNS:
+ ctl_putuint(sys_var[varid].text, alarm_overflow);
+ break;
+
+ case CS_TIMER_XMTS:
+ ctl_putuint(sys_var[varid].text, timer_xmtcalls);
+ break;
+
+ case CS_FUZZ:
+ ctl_putdbl(sys_var[varid].text, sys_fuzz * 1e3);
+ break;
+#ifdef AUTOKEY
+ case CS_FLAGS:
+ if (crypto_flags)
+ ctl_puthex(sys_var[CS_FLAGS].text,
+ crypto_flags);
+ break;
+
+ case CS_DIGEST:
+ if (crypto_flags) {
+ strlcpy(str, OBJ_nid2ln(crypto_nid),
+ COUNTOF(str));
+ ctl_putstr(sys_var[CS_DIGEST].text, str,
+ strlen(str));
+ }
+ break;
+
+ case CS_SIGNATURE:
+ if (crypto_flags) {
+ const EVP_MD *dp;
+
+ dp = EVP_get_digestbynid(crypto_flags >> 16);
+ strlcpy(str, OBJ_nid2ln(EVP_MD_pkey_type(dp)),
+ COUNTOF(str));
+ ctl_putstr(sys_var[CS_SIGNATURE].text, str,
+ strlen(str));
+ }
+ break;
+
+ case CS_HOST:
+ if (hostval.ptr != NULL)
+ ctl_putstr(sys_var[CS_HOST].text, hostval.ptr,
+ strlen(hostval.ptr));
+ break;
+
+ case CS_IDENT:
+ if (sys_ident != NULL)
+ ctl_putstr(sys_var[CS_IDENT].text, sys_ident,
+ strlen(sys_ident));
+ break;
+
+ case CS_CERTIF:
+ for (cp = cinfo; cp != NULL; cp = cp->link) {
+ tstamp_t tstamp;
+
+ snprintf(str, sizeof(str), "%s %s 0x%x",
+ cp->subject, cp->issuer, cp->flags);
+ ctl_putstr(sys_var[CS_CERTIF].text, str,
+ strlen(str));
+ tstamp = caltontp(&(cp->last)); /* XXX too small to hold some values, but that's what ctl_putfs requires */
+ ctl_putfs(sys_var[CS_REVTIME].text, tstamp);
+ }
+ break;
+
+ case CS_PUBLIC:
+ if (hostval.tstamp != 0)
+ ctl_putfs(sys_var[CS_PUBLIC].text,
+ ntohl(hostval.tstamp));
+ break;
+#endif /* AUTOKEY */
+ }
+}
+
+
+/*
+ * ctl_putpeer - output a peer variable
+ */
+static void
+ctl_putpeer(
+ int id,
+ struct peer *p
+ )
+{
+ char buf[CTL_MAX_DATA_LEN];
+ char *s;
+ char *t;
+ char *be;
+ int i;
+ const struct ctl_var *k;
+#ifdef AUTOKEY
+ struct autokey *ap;
+ const EVP_MD *dp;
+ const char *str;
+#endif /* AUTOKEY */
+
+ switch (id) {
+
+ case CP_CONFIG:
+ ctl_putuint(peer_var[id].text,
+ !(FLAG_PREEMPT & p->flags));
+ break;
+
+ case CP_AUTHENABLE:
+ ctl_putuint(peer_var[id].text, !(p->keyid));
+ break;
+
+ case CP_AUTHENTIC:
+ ctl_putuint(peer_var[id].text,
+ !!(FLAG_AUTHENTIC & p->flags));
+ break;
+
+ case CP_SRCADR:
+ ctl_putadr(peer_var[id].text, 0, &p->srcadr);
+ break;
+
+ case CP_SRCPORT:
+ ctl_putuint(peer_var[id].text, SRCPORT(&p->srcadr));
+ break;
+
+ case CP_SRCHOST:
+ if (p->hostname != NULL)
+ ctl_putstr(peer_var[id].text, p->hostname,
+ strlen(p->hostname));
+ break;
+
+ case CP_DSTADR:
+ ctl_putadr(peer_var[id].text, 0,
+ (p->dstadr != NULL)
+ ? &p->dstadr->sin
+ : NULL);
+ break;
+
+ case CP_DSTPORT:
+ ctl_putuint(peer_var[id].text,
+ (p->dstadr != NULL)
+ ? SRCPORT(&p->dstadr->sin)
+ : 0);
+ break;
+
+ case CP_IN:
+ if (p->r21 > 0.)
+ ctl_putdbl(peer_var[id].text, p->r21 / 1e3);
+ break;
+
+ case CP_OUT:
+ if (p->r34 > 0.)
+ ctl_putdbl(peer_var[id].text, p->r34 / 1e3);
+ break;
+
+ case CP_RATE:
+ ctl_putuint(peer_var[id].text, p->throttle);
+ break;
+
+ case CP_LEAP:
+ ctl_putuint(peer_var[id].text, p->leap);
+ break;
+
+ case CP_HMODE:
+ ctl_putuint(peer_var[id].text, p->hmode);
+ break;
+
+ case CP_STRATUM:
+ ctl_putuint(peer_var[id].text, p->stratum);
+ break;
+
+ case CP_PPOLL:
+ ctl_putuint(peer_var[id].text, p->ppoll);
+ break;
+
+ case CP_HPOLL:
+ ctl_putuint(peer_var[id].text, p->hpoll);
+ break;
+
+ case CP_PRECISION:
+ ctl_putint(peer_var[id].text, p->precision);
+ break;
+
+ case CP_ROOTDELAY:
+ ctl_putdbl(peer_var[id].text, p->rootdelay * 1e3);
+ break;
+
+ case CP_ROOTDISPERSION:
+ ctl_putdbl(peer_var[id].text, p->rootdisp * 1e3);
+ break;
+
+ case CP_REFID:
+#ifdef REFCLOCK
+ if (p->flags & FLAG_REFCLOCK) {
+ ctl_putrefid(peer_var[id].text, p->refid);
+ break;
+ }
+#endif
+ if (p->stratum > 1 && p->stratum < STRATUM_UNSPEC)
+ ctl_putadr(peer_var[id].text, p->refid,
+ NULL);
+ else
+ ctl_putrefid(peer_var[id].text, p->refid);
+ break;
+
+ case CP_REFTIME:
+ ctl_putts(peer_var[id].text, &p->reftime);
+ break;
+
+ case CP_ORG:
+ ctl_putts(peer_var[id].text, &p->aorg);
+ break;
+
+ case CP_REC:
+ ctl_putts(peer_var[id].text, &p->dst);
+ break;
+
+ case CP_XMT:
+ if (p->xleave)
+ ctl_putdbl(peer_var[id].text, p->xleave * 1e3);
+ break;
+
+ case CP_BIAS:
+ if (p->bias != 0.)
+ ctl_putdbl(peer_var[id].text, p->bias * 1e3);
+ break;
+
+ case CP_REACH:
+ ctl_puthex(peer_var[id].text, p->reach);
+ break;
+
+ case CP_FLASH:
+ ctl_puthex(peer_var[id].text, p->flash);
+ break;
+
+ case CP_TTL:
+#ifdef REFCLOCK
+ if (p->flags & FLAG_REFCLOCK) {
+ ctl_putuint(peer_var[id].text, p->ttl);
+ break;
+ }
+#endif
+ if (p->ttl > 0 && p->ttl < COUNTOF(sys_ttl))
+ ctl_putint(peer_var[id].text,
+ sys_ttl[p->ttl]);
+ break;
+
+ case CP_UNREACH:
+ ctl_putuint(peer_var[id].text, p->unreach);
+ break;
+
+ case CP_TIMER:
+ ctl_putuint(peer_var[id].text,
+ p->nextdate - current_time);
+ break;
+
+ case CP_DELAY:
+ ctl_putdbl(peer_var[id].text, p->delay * 1e3);
+ break;
+
+ case CP_OFFSET:
+ ctl_putdbl(peer_var[id].text, p->offset * 1e3);
+ break;
+
+ case CP_JITTER:
+ ctl_putdbl(peer_var[id].text, p->jitter * 1e3);
+ break;
+
+ case CP_DISPERSION:
+ ctl_putdbl(peer_var[id].text, p->disp * 1e3);
+ break;
+
+ case CP_KEYID:
+ if (p->keyid > NTP_MAXKEY)
+ ctl_puthex(peer_var[id].text, p->keyid);
+ else
+ ctl_putuint(peer_var[id].text, p->keyid);
+ break;
+
+ case CP_FILTDELAY:
+ ctl_putarray(peer_var[id].text, p->filter_delay,
+ p->filter_nextpt);
+ break;
+
+ case CP_FILTOFFSET:
+ ctl_putarray(peer_var[id].text, p->filter_offset,
+ p->filter_nextpt);
+ break;
+
+ case CP_FILTERROR:
+ ctl_putarray(peer_var[id].text, p->filter_disp,
+ p->filter_nextpt);
+ break;
+
+ case CP_PMODE:
+ ctl_putuint(peer_var[id].text, p->pmode);
+ break;
+
+ case CP_RECEIVED:
+ ctl_putuint(peer_var[id].text, p->received);
+ break;
+
+ case CP_SENT:
+ ctl_putuint(peer_var[id].text, p->sent);
+ break;
+
+ case CP_VARLIST:
+ s = buf;
+ be = buf + sizeof(buf);
+ if (strlen(peer_var[id].text) + 4 > sizeof(buf))
+ break; /* really long var name */
+
+ snprintf(s, sizeof(buf), "%s=\"", peer_var[id].text);
+ s += strlen(s);
+ t = s;
+ for (k = peer_var; !(EOV & k->flags); k++) {
+ if (PADDING & k->flags)
+ continue;
+ i = strlen(k->text);
+ if (s + i + 1 >= be)
+ break;
+ if (s != t)
+ *s++ = ',';
+ memcpy(s, k->text, i);
+ s += i;
+ }
+ if (s + 2 < be) {
+ *s++ = '"';
+ *s = '\0';
+ ctl_putdata(buf, (u_int)(s - buf), 0);
+ }
+ break;
+
+ case CP_TIMEREC:
+ ctl_putuint(peer_var[id].text,
+ current_time - p->timereceived);
+ break;
+
+ case CP_TIMEREACH:
+ ctl_putuint(peer_var[id].text,
+ current_time - p->timereachable);
+ break;
+
+ case CP_BADAUTH:
+ ctl_putuint(peer_var[id].text, p->badauth);
+ break;
+
+ case CP_BOGUSORG:
+ ctl_putuint(peer_var[id].text, p->bogusorg);
+ break;
+
+ case CP_OLDPKT:
+ ctl_putuint(peer_var[id].text, p->oldpkt);
+ break;
+
+ case CP_SELDISP:
+ ctl_putuint(peer_var[id].text, p->seldisptoolarge);
+ break;
+
+ case CP_SELBROKEN:
+ ctl_putuint(peer_var[id].text, p->selbroken);
+ break;
+
+ case CP_CANDIDATE:
+ ctl_putuint(peer_var[id].text, p->status);
+ break;
+#ifdef AUTOKEY
+ case CP_FLAGS:
+ if (p->crypto)
+ ctl_puthex(peer_var[id].text, p->crypto);
+ break;
+
+ case CP_SIGNATURE:
+ if (p->crypto) {
+ dp = EVP_get_digestbynid(p->crypto >> 16);
+ str = OBJ_nid2ln(EVP_MD_pkey_type(dp));
+ ctl_putstr(peer_var[id].text, str, strlen(str));
+ }
+ break;
+
+ case CP_HOST:
+ if (p->subject != NULL)
+ ctl_putstr(peer_var[id].text, p->subject,
+ strlen(p->subject));
+ break;
+
+ case CP_VALID: /* not used */
+ break;
+
+ case CP_INITSEQ:
+ if (NULL == (ap = p->recval.ptr))
+ break;
+
+ ctl_putint(peer_var[CP_INITSEQ].text, ap->seq);
+ ctl_puthex(peer_var[CP_INITKEY].text, ap->key);
+ ctl_putfs(peer_var[CP_INITTSP].text,
+ ntohl(p->recval.tstamp));
+ break;
+
+ case CP_IDENT:
+ if (p->ident != NULL)
+ ctl_putstr(peer_var[id].text, p->ident,
+ strlen(p->ident));
+ break;
+
+
+#endif /* AUTOKEY */
+ }
+}
+
+
+#ifdef REFCLOCK
+/*
+ * ctl_putclock - output clock variables
+ */
+static void
+ctl_putclock(
+ int id,
+ struct refclockstat *pcs,
+ int mustput
+ )
+{
+ char buf[CTL_MAX_DATA_LEN];
+ char *s, *t, *be;
+ const char *ss;
+ int i;
+ const struct ctl_var *k;
+
+ switch (id) {
+
+ case CC_TYPE:
+ if (mustput || pcs->clockdesc == NULL
+ || *(pcs->clockdesc) == '\0') {
+ ctl_putuint(clock_var[id].text, pcs->type);
+ }
+ break;
+ case CC_TIMECODE:
+ ctl_putstr(clock_var[id].text,
+ pcs->p_lastcode,
+ (unsigned)pcs->lencode);
+ break;
+
+ case CC_POLL:
+ ctl_putuint(clock_var[id].text, pcs->polls);
+ break;
+
+ case CC_NOREPLY:
+ ctl_putuint(clock_var[id].text,
+ pcs->noresponse);
+ break;
+
+ case CC_BADFORMAT:
+ ctl_putuint(clock_var[id].text,
+ pcs->badformat);
+ break;
+
+ case CC_BADDATA:
+ ctl_putuint(clock_var[id].text,
+ pcs->baddata);
+ break;
+
+ case CC_FUDGETIME1:
+ if (mustput || (pcs->haveflags & CLK_HAVETIME1))
+ ctl_putdbl(clock_var[id].text,
+ pcs->fudgetime1 * 1e3);
+ break;
+
+ case CC_FUDGETIME2:
+ if (mustput || (pcs->haveflags & CLK_HAVETIME2))
+ ctl_putdbl(clock_var[id].text,
+ pcs->fudgetime2 * 1e3);
+ break;
+
+ case CC_FUDGEVAL1:
+ if (mustput || (pcs->haveflags & CLK_HAVEVAL1))
+ ctl_putint(clock_var[id].text,
+ pcs->fudgeval1);
+ break;
+
+ case CC_FUDGEVAL2:
+ if (mustput || (pcs->haveflags & CLK_HAVEVAL2)) {
+ if (pcs->fudgeval1 > 1)
+ ctl_putadr(clock_var[id].text,
+ pcs->fudgeval2, NULL);
+ else
+ ctl_putrefid(clock_var[id].text,
+ pcs->fudgeval2);
+ }
+ break;
+
+ case CC_FLAGS:
+ ctl_putuint(clock_var[id].text, pcs->flags);
+ break;
+
+ case CC_DEVICE:
+ if (pcs->clockdesc == NULL ||
+ *(pcs->clockdesc) == '\0') {
+ if (mustput)
+ ctl_putstr(clock_var[id].text,
+ "", 0);
+ } else {
+ ctl_putstr(clock_var[id].text,
+ pcs->clockdesc,
+ strlen(pcs->clockdesc));
+ }
+ break;
+
+ case CC_VARLIST:
+ s = buf;
+ be = buf + sizeof(buf);
+ if (strlen(clock_var[CC_VARLIST].text) + 4 >
+ sizeof(buf))
+ break; /* really long var name */
+
+ snprintf(s, sizeof(buf), "%s=\"",
+ clock_var[CC_VARLIST].text);
+ s += strlen(s);
+ t = s;
+
+ for (k = clock_var; !(EOV & k->flags); k++) {
+ if (PADDING & k->flags)
+ continue;
+
+ i = strlen(k->text);
+ if (s + i + 1 >= be)
+ break;
+
+ if (s != t)
+ *s++ = ',';
+ memcpy(s, k->text, i);
+ s += i;
+ }
+
+ for (k = pcs->kv_list; k && !(EOV & k->flags); k++) {
+ if (PADDING & k->flags)
+ continue;
+
+ ss = k->text;
+ if (NULL == ss)
+ continue;
+
+ while (*ss && *ss != '=')
+ ss++;
+ i = ss - k->text;
+ if (s + i + 1 >= be)
+ break;
+
+ if (s != t)
+ *s++ = ',';
+ memcpy(s, k->text, (unsigned)i);
+ s += i;
+ *s = '\0';
+ }
+ if (s + 2 >= be)
+ break;
+
+ *s++ = '"';
+ *s = '\0';
+ ctl_putdata(buf, (unsigned)(s - buf), 0);
+ break;
+ }
+}
+#endif
+
+
+
+/*
+ * ctl_getitem - get the next data item from the incoming packet
+ */
+static const struct ctl_var *
+ctl_getitem(
+ const struct ctl_var *var_list,
+ char **data
+ )
+{
+ static const struct ctl_var eol = { 0, EOV, NULL };
+ static char buf[128];
+ static u_long quiet_until;
+ const struct ctl_var *v;
+ const char *pch;
+ char *cp;
+ char *tp;
+
+ /*
+ * Delete leading commas and white space
+ */
+ while (reqpt < reqend && (*reqpt == ',' ||
+ isspace((unsigned char)*reqpt)))
+ reqpt++;
+ if (reqpt >= reqend)
+ return NULL;
+
+ if (NULL == var_list)
+ return &eol;
+
+ /*
+ * Look for a first character match on the tag. If we find
+ * one, see if it is a full match.
+ */
+ v = var_list;
+ cp = reqpt;
+ for (v = var_list; !(EOV & v->flags); v++) {
+ if (!(PADDING & v->flags) && *cp == *(v->text)) {
+ pch = v->text;
+ while ('\0' != *pch && '=' != *pch && cp < reqend
+ && *cp == *pch) {
+ cp++;
+ pch++;
+ }
+ if ('\0' == *pch || '=' == *pch) {
+ while (cp < reqend && isspace((u_char)*cp))
+ cp++;
+ if (cp == reqend || ',' == *cp) {
+ buf[0] = '\0';
+ *data = buf;
+ if (cp < reqend)
+ cp++;
+ reqpt = cp;
+ return v;
+ }
+ if ('=' == *cp) {
+ cp++;
+ tp = buf;
+ while (cp < reqend && isspace((u_char)*cp))
+ cp++;
+ while (cp < reqend && *cp != ',') {
+ *tp++ = *cp++;
+ if (tp - buf >= sizeof(buf)) {
+ ctl_error(CERR_BADFMT);
+ numctlbadpkts++;
+ NLOG(NLOG_SYSEVENT)
+ if (quiet_until <= current_time) {
+ quiet_until = current_time + 300;
+ msyslog(LOG_WARNING,
+"Possible 'ntpdx' exploit from %s#%u (possibly spoofed)", stoa(rmt_addr), SRCPORT(rmt_addr));
+ }
+ return NULL;
+ }
+ }
+ if (cp < reqend)
+ cp++;
+ *tp-- = '\0';
+ while (tp >= buf && isspace((u_char)*tp))
+ *tp-- = '\0';
+ reqpt = cp;
+ *data = buf;
+ return v;
+ }
+ }
+ cp = reqpt;
+ }
+ }
+ return v;
+}
+
+
+/*
+ * control_unspec - response to an unspecified op-code
+ */
+/*ARGSUSED*/
+static void
+control_unspec(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ struct peer *peer;
+
+ /*
+ * What is an appropriate response to an unspecified op-code?
+ * I return no errors and no data, unless a specified assocation
+ * doesn't exist.
+ */
+ if (res_associd) {
+ peer = findpeerbyassoc(res_associd);
+ if (NULL == peer) {
+ ctl_error(CERR_BADASSOC);
+ return;
+ }
+ rpkt.status = htons(ctlpeerstatus(peer));
+ } else
+ rpkt.status = htons(ctlsysstatus());
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * read_status - return either a list of associd's, or a particular
+ * peer's status.
+ */
+/*ARGSUSED*/
+static void
+read_status(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ struct peer *peer;
+ const u_char *cp;
+ int n;
+ /* a_st holds association ID, status pairs alternating */
+ u_short a_st[CTL_MAX_DATA_LEN / sizeof(u_short)];
+
+#ifdef DEBUG
+ if (debug > 2)
+ printf("read_status: ID %d\n", res_associd);
+#endif
+ /*
+ * Two choices here. If the specified association ID is
+ * zero we return all known assocation ID's. Otherwise
+ * we return a bunch of stuff about the particular peer.
+ */
+ if (res_associd) {
+ peer = findpeerbyassoc(res_associd);
+ if (NULL == peer) {
+ ctl_error(CERR_BADASSOC);
+ return;
+ }
+ rpkt.status = htons(ctlpeerstatus(peer));
+ if (res_authokay)
+ peer->num_events = 0;
+ /*
+ * For now, output everything we know about the
+ * peer. May be more selective later.
+ */
+ for (cp = def_peer_var; *cp != 0; cp++)
+ ctl_putpeer((int)*cp, peer);
+ ctl_flushpkt(0);
+ return;
+ }
+ n = 0;
+ rpkt.status = htons(ctlsysstatus());
+ for (peer = peer_list; peer != NULL; peer = peer->p_link) {
+ a_st[n++] = htons(peer->associd);
+ a_st[n++] = htons(ctlpeerstatus(peer));
+ /* two entries each loop iteration, so n + 1 */
+ if (n + 1 >= COUNTOF(a_st)) {
+ ctl_putdata((void *)a_st, n * sizeof(a_st[0]),
+ 1);
+ n = 0;
+ }
+ }
+ if (n)
+ ctl_putdata((void *)a_st, n * sizeof(a_st[0]), 1);
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * read_peervars - half of read_variables() implementation
+ */
+static void
+read_peervars(void)
+{
+ const struct ctl_var *v;
+ struct peer *peer;
+ const u_char *cp;
+ int i;
+ char * valuep;
+ u_char wants[CP_MAXCODE + 1];
+ u_int gotvar;
+
+ /*
+ * Wants info for a particular peer. See if we know
+ * the guy.
+ */
+ peer = findpeerbyassoc(res_associd);
+ if (NULL == peer) {
+ ctl_error(CERR_BADASSOC);
+ return;
+ }
+ rpkt.status = htons(ctlpeerstatus(peer));
+ if (res_authokay)
+ peer->num_events = 0;
+ ZERO(wants);
+ gotvar = 0;
+ while (NULL != (v = ctl_getitem(peer_var, &valuep))) {
+ if (v->flags & EOV) {
+ ctl_error(CERR_UNKNOWNVAR);
+ return;
+ }
+ NTP_INSIST(v->code < COUNTOF(wants));
+ wants[v->code] = 1;
+ gotvar = 1;
+ }
+ if (gotvar) {
+ for (i = 1; i < COUNTOF(wants); i++)
+ if (wants[i])
+ ctl_putpeer(i, peer);
+ } else
+ for (cp = def_peer_var; *cp != 0; cp++)
+ ctl_putpeer((int)*cp, peer);
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * read_sysvars - half of read_variables() implementation
+ */
+static void
+read_sysvars(void)
+{
+ const struct ctl_var *v;
+ struct ctl_var *kv;
+ u_int n;
+ u_int gotvar;
+ const u_char *cs;
+ char * valuep;
+ const char * pch;
+ u_char *wants;
+ size_t wants_count;
+
+ /*
+ * Wants system variables. Figure out which he wants
+ * and give them to him.
+ */
+ rpkt.status = htons(ctlsysstatus());
+ if (res_authokay)
+ ctl_sys_num_events = 0;
+ wants_count = CS_MAXCODE + 1 + count_var(ext_sys_var);
+ wants = emalloc_zero(wants_count);
+ gotvar = 0;
+ while (NULL != (v = ctl_getitem(sys_var, &valuep))) {
+ if (!(EOV & v->flags)) {
+ NTP_INSIST(v->code < wants_count);
+ wants[v->code] = 1;
+ gotvar = 1;
+ } else {
+ v = ctl_getitem(ext_sys_var, &valuep);
+ NTP_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);
+ wants[n] = 1;
+ gotvar = 1;
+ }
+ }
+ if (gotvar) {
+ for (n = 1; n <= CS_MAXCODE; n++)
+ if (wants[n])
+ ctl_putsys(n);
+ for (n = 0; n + CS_MAXCODE + 1 < wants_count; n++)
+ if (wants[n + CS_MAXCODE + 1]) {
+ pch = ext_sys_var[n].text;
+ ctl_putdata(pch, strlen(pch), 0);
+ }
+ } else {
+ for (cs = def_sys_var; *cs != 0; cs++)
+ ctl_putsys((int)*cs);
+ for (kv = ext_sys_var; kv && !(EOV & kv->flags); kv++)
+ if (DEF & kv->flags)
+ ctl_putdata(kv->text, strlen(kv->text),
+ 0);
+ }
+ free(wants);
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * read_variables - return the variables the caller asks for
+ */
+/*ARGSUSED*/
+static void
+read_variables(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ if (res_associd)
+ read_peervars();
+ else
+ read_sysvars();
+}
+
+
+/*
+ * write_variables - write into variables. We only allow leap bit
+ * writing this way.
+ */
+/*ARGSUSED*/
+static void
+write_variables(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ const struct ctl_var *v;
+ int ext_var;
+ char *valuep;
+ long val;
+ size_t octets;
+ char *vareqv;
+ const char *t;
+ char *tt;
+
+ val = 0;
+ /*
+ * If he's trying to write into a peer tell him no way
+ */
+ if (res_associd != 0) {
+ ctl_error(CERR_PERMISSION);
+ return;
+ }
+
+ /*
+ * Set status
+ */
+ rpkt.status = htons(ctlsysstatus());
+
+ /*
+ * Look through the variables. Dump out at the first sign of
+ * trouble.
+ */
+ while ((v = ctl_getitem(sys_var, &valuep)) != 0) {
+ ext_var = 0;
+ if (v->flags & EOV) {
+ if ((v = ctl_getitem(ext_sys_var, &valuep)) !=
+ 0) {
+ if (v->flags & EOV) {
+ ctl_error(CERR_UNKNOWNVAR);
+ return;
+ }
+ ext_var = 1;
+ } else {
+ break;
+ }
+ }
+ if (!(v->flags & CAN_WRITE)) {
+ ctl_error(CERR_PERMISSION);
+ return;
+ }
+ if (!ext_var && (*valuep == '\0' || !atoint(valuep,
+ &val))) {
+ ctl_error(CERR_BADFMT);
+ return;
+ }
+ if (!ext_var && (val & ~LEAP_NOTINSYNC) != 0) {
+ ctl_error(CERR_BADVALUE);
+ return;
+ }
+
+ if (ext_var) {
+ octets = strlen(v->text) + strlen(valuep) + 2;
+ vareqv = emalloc(octets);
+ tt = vareqv;
+ t = v->text;
+ while (*t && *t != '=')
+ *tt++ = *t++;
+ *tt++ = '=';
+ memcpy(tt, valuep, 1 + strlen(valuep));
+ set_sys_var(vareqv, 1 + strlen(vareqv), v->flags);
+ free(vareqv);
+ } else {
+ ctl_error(CERR_UNSPEC); /* really */
+ return;
+ }
+ }
+
+ /*
+ * If we got anything, do it. xxx nothing to do ***
+ */
+ /*
+ if (leapind != ~0 || leapwarn != ~0) {
+ if (!leap_setleap((int)leapind, (int)leapwarn)) {
+ ctl_error(CERR_PERMISSION);
+ return;
+ }
+ }
+ */
+ ctl_flushpkt(0);
+}
+
+/*
+ * configure() processes ntpq :config/config-from-file, allowing
+ * generic runtime reconfiguration.
+ */
+static void configure(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ size_t data_count;
+ int retval;
+ int replace_nl;
+
+ /* I haven't yet implemented changes to an existing association.
+ * Hence check if the association id is 0
+ */
+ if (res_associd != 0) {
+ ctl_error(CERR_BADVALUE);
+ return;
+ }
+
+ if (RES_NOMODIFY & restrict_mask) {
+ snprintf(remote_config.err_msg,
+ sizeof(remote_config.err_msg),
+ "runtime configuration prohibited by restrict ... nomodify");
+ ctl_putdata(remote_config.err_msg,
+ strlen(remote_config.err_msg), 0);
+ ctl_flushpkt(0);
+ NLOG(NLOG_SYSINFO)
+ msyslog(LOG_NOTICE,
+ "runtime config from %s rejected due to nomodify restriction",
+ stoa(&rbufp->recv_srcadr));
+ sys_restricted++;
+ return;
+ }
+
+ /* Initialize the remote config buffer */
+ data_count = reqend - reqpt;
+ memcpy(remote_config.buffer, reqpt, data_count);
+ if (data_count > 0
+ && '\n' != remote_config.buffer[data_count - 1])
+ remote_config.buffer[data_count++] = '\n';
+ remote_config.buffer[data_count] = '\0';
+ remote_config.pos = 0;
+ remote_config.err_pos = 0;
+ remote_config.no_errors = 0;
+
+ /* do not include terminating newline in log */
+ if (data_count > 0
+ && '\n' == remote_config.buffer[data_count - 1]) {
+ remote_config.buffer[data_count - 1] = '\0';
+ replace_nl = TRUE;
+ } else {
+ replace_nl = FALSE;
+ }
+
+ DPRINTF(1, ("Got Remote Configuration Command: %s\n",
+ remote_config.buffer));
+ msyslog(LOG_NOTICE, "%s config: %s",
+ stoa(&rbufp->recv_srcadr),
+ remote_config.buffer);
+
+ if (replace_nl)
+ remote_config.buffer[data_count - 1] = '\n';
+
+ config_remotely(&rbufp->recv_srcadr);
+
+ /*
+ * Check if errors were reported. If not, output 'Config
+ * Succeeded'. Else output the error count. It would be nice
+ * to output any parser error messages.
+ */
+ if (0 == remote_config.no_errors) {
+ retval = snprintf(remote_config.err_msg,
+ sizeof(remote_config.err_msg),
+ "Config Succeeded");
+ if (retval > 0)
+ remote_config.err_pos += retval;
+ }
+
+ ctl_putdata(remote_config.err_msg, remote_config.err_pos, 0);
+ ctl_flushpkt(0);
+
+ DPRINTF(1, ("Reply: %s\n", remote_config.err_msg));
+
+ if (remote_config.no_errors > 0)
+ msyslog(LOG_NOTICE, "%d error in %s config",
+ remote_config.no_errors,
+ stoa(&rbufp->recv_srcadr));
+}
+
+
+/*
+ * derive_nonce - generate client-address-specific nonce value
+ * associated with a given timestamp.
+ */
+static u_int32 derive_nonce(
+ sockaddr_u * addr,
+ u_int32 ts_i,
+ u_int32 ts_f
+ )
+{
+ static u_int32 salt[4];
+ static u_long last_salt_update;
+ union d_tag {
+ u_char digest[EVP_MAX_MD_SIZE];
+ u_int32 extract;
+ } d;
+ EVP_MD_CTX ctx;
+ u_int len;
+
+ while (!salt[0] || current_time - last_salt_update >= 3600) {
+ salt[0] = ntp_random();
+ salt[1] = ntp_random();
+ salt[2] = ntp_random();
+ salt[3] = ntp_random();
+ last_salt_update = current_time;
+ }
+
+ EVP_DigestInit(&ctx, EVP_get_digestbynid(NID_md5));
+ EVP_DigestUpdate(&ctx, salt, sizeof(salt));
+ EVP_DigestUpdate(&ctx, &ts_i, sizeof(ts_i));
+ EVP_DigestUpdate(&ctx, &ts_f, sizeof(ts_f));
+ if (IS_IPV4(addr))
+ EVP_DigestUpdate(&ctx, &SOCK_ADDR4(addr),
+ sizeof(SOCK_ADDR4(addr)));
+ else
+ EVP_DigestUpdate(&ctx, &SOCK_ADDR6(addr),
+ sizeof(SOCK_ADDR6(addr)));
+ EVP_DigestUpdate(&ctx, &NSRCPORT(addr), sizeof(NSRCPORT(addr)));
+ EVP_DigestUpdate(&ctx, salt, sizeof(salt));
+ EVP_DigestFinal(&ctx, d.digest, &len);
+
+ return d.extract;
+}
+
+
+/*
+ * generate_nonce - generate client-address-specific nonce string.
+ */
+static void generate_nonce(
+ struct recvbuf * rbufp,
+ char * nonce,
+ size_t nonce_octets
+ )
+{
+ u_int32 derived;
+
+ derived = derive_nonce(&rbufp->recv_srcadr,
+ rbufp->recv_time.l_ui,
+ rbufp->recv_time.l_uf);
+ snprintf(nonce, nonce_octets, "%08x%08x%08x",
+ rbufp->recv_time.l_ui, rbufp->recv_time.l_uf, derived);
+}
+
+
+/*
+ * validate_nonce - validate client-address-specific nonce string.
+ *
+ * Returns TRUE if the local calculation of the nonce matches the
+ * client-provided value and the timestamp is recent enough.
+ */
+static int validate_nonce(
+ const char * pnonce,
+ struct recvbuf * rbufp
+ )
+{
+ u_int ts_i;
+ u_int ts_f;
+ l_fp ts;
+ l_fp now_delta;
+ u_int supposed;
+ u_int derived;
+
+ if (3 != sscanf(pnonce, "%08x%08x%08x", &ts_i, &ts_f, &supposed))
+ return FALSE;
+
+ ts.l_ui = (u_int32)ts_i;
+ ts.l_uf = (u_int32)ts_f;
+ derived = derive_nonce(&rbufp->recv_srcadr, ts.l_ui, ts.l_uf);
+ get_systime(&now_delta);
+ L_SUB(&now_delta, &ts);
+
+ return (supposed == derived && now_delta.l_ui < 16);
+}
+
+
+/*
+ * send_random_tag_value - send a randomly-generated three character
+ * tag prefix, a '.', an index, a '=' and a
+ * random integer value.
+ *
+ * To try to force clients to ignore unrecognized tags in mrulist,
+ * reslist, and ifstats responses, the first and last rows are spiced
+ * with randomly-generated tag names with correct .# index. Make it
+ * three characters knowing that none of the currently-used subscripted
+ * tags have that length, avoiding the need to test for
+ * tag collision.
+ */
+static void
+send_random_tag_value(
+ int indx
+ )
+{
+ int noise;
+ char buf[32];
+
+ noise = rand() ^ (rand() << 16);
+ buf[0] = 'a' + noise % 26;
+ noise >>= 5;
+ buf[1] = 'a' + noise % 26;
+ noise >>= 5;
+ buf[2] = 'a' + noise % 26;
+ noise >>= 5;
+ buf[3] = '.';
+ snprintf(&buf[4], sizeof(buf) - 4, "%d", indx);
+ ctl_putuint(buf, noise);
+}
+
+
+/*
+ * Send a MRU list entry in response to a "ntpq -c mrulist" operation.
+ *
+ * To keep clients honest about not depending on the order of values,
+ * and thereby avoid being locked into ugly workarounds to maintain
+ * backward compatibility later as new fields are added to the response,
+ * the order is random.
+ */
+static void
+send_mru_entry(
+ mon_entry * mon,
+ int count
+ )
+{
+ const char first_fmt[] = "first.%d";
+ const char ct_fmt[] = "ct.%d";
+ const char mv_fmt[] = "mv.%d";
+ const char rs_fmt[] = "rs.%d";
+ char tag[32];
+ u_char sent[6]; /* 6 tag=value pairs */
+ u_int32 noise;
+ u_int which;
+ u_int remaining;
+ const char * pch;
+
+ remaining = COUNTOF(sent);
+ ZERO(sent);
+ noise = (u_int32)(rand() ^ (rand() << 16));
+ while (remaining > 0) {
+ which = (noise & 7) % COUNTOF(sent);
+ noise >>= 3;
+ while (sent[which])
+ which = (which + 1) % COUNTOF(sent);
+
+ switch (which) {
+
+ case 0:
+ snprintf(tag, sizeof(tag), addr_fmt, count);
+ pch = sptoa(&mon->rmtadr);
+ ctl_putunqstr(tag, pch, strlen(pch));
+ break;
+
+ case 1:
+ snprintf(tag, sizeof(tag), last_fmt, count);
+ ctl_putts(tag, &mon->last);
+ break;
+
+ case 2:
+ snprintf(tag, sizeof(tag), first_fmt, count);
+ ctl_putts(tag, &mon->first);
+ break;
+
+ case 3:
+ snprintf(tag, sizeof(tag), ct_fmt, count);
+ ctl_putint(tag, mon->count);
+ break;
+
+ case 4:
+ snprintf(tag, sizeof(tag), mv_fmt, count);
+ ctl_putuint(tag, mon->vn_mode);
+ break;
+
+ case 5:
+ snprintf(tag, sizeof(tag), rs_fmt, count);
+ ctl_puthex(tag, mon->flags);
+ break;
+ }
+ sent[which] = TRUE;
+ remaining--;
+ }
+}
+
+
+/*
+ * read_mru_list - supports ntpq's mrulist command.
+ *
+ * The challenge here is to match ntpdc's monlist functionality without
+ * being limited to hundreds of entries returned total, and without
+ * requiring state on the server. If state were required, ntpq's
+ * mrulist command would require authentication.
+ *
+ * The approach was suggested by Ry Jones. A finite and variable number
+ * of entries are retrieved per request, to avoid having responses with
+ * such large numbers of packets that socket buffers are overflowed and
+ * packets lost. The entries are retrieved oldest-first, taking into
+ * account that the MRU list will be changing between each request. We
+ * can expect to see duplicate entries for addresses updated in the MRU
+ * list during the fetch operation. In the end, the client can assemble
+ * a close approximation of the MRU list at the point in time the last
+ * response was sent by ntpd. The only difference is it may be longer,
+ * containing some number of oldest entries which have since been
+ * reclaimed. If necessary, the protocol could be extended to zap those
+ * from the client snapshot at the end, but so far that doesn't seem
+ * useful.
+ *
+ * To accomodate the changing MRU list, the starting point for requests
+ * after the first request is supplied as a series of last seen
+ * timestamps and associated addresses, the newest ones the client has
+ * received. As long as at least one of those entries hasn't been
+ * bumped to the head of the MRU list, ntpd can pick up at that point.
+ * Otherwise, the request is failed and it is up to ntpq to back up and
+ * provide the next newest entry's timestamps and addresses, conceivably
+ * backing up all the way to the starting point.
+ *
+ * input parameters:
+ * nonce= Regurgitated nonce retrieved by the client
+ * previously using CTL_OP_REQ_NONCE, demonstrating
+ * ability to receive traffic sent to its address.
+ * frags= Limit on datagrams (fragments) in response. Used
+ * by newer ntpq versions instead of limit= when
+ * retrieving multiple entries.
+ * limit= Limit on MRU entries returned. One of frags= or
+ * limit= must be provided.
+ * limit=1 is a special case: Instead of fetching
+ * beginning with the supplied starting point's
+ * newer neighbor, fetch the supplied entry, and
+ * in that case the #.last timestamp can be zero.
+ * This enables fetching a single entry by IP
+ * address. When limit is not one and frags= is
+ * provided, the fragment limit controls.
+ * mincount= (decimal) Return entries with count >= mincount.
+ * laddr= Return entries associated with the server's IP
+ * address given. No port specification is needed,
+ * and any supplied is ignored.
+ * resall= 0x-prefixed hex restrict bits which must all be
+ * lit for an MRU entry to be included.
+ * Has precedence over any resany=.
+ * resany= 0x-prefixed hex restrict bits, at least one of
+ * which must be list for an MRU entry to be
+ * included.
+ * last.0= 0x-prefixed hex l_fp timestamp of newest entry
+ * which client previously received.
+ * addr.0= text of newest entry's IP address and port,
+ * IPv6 addresses in bracketed form: [::]:123
+ * last.1= timestamp of 2nd newest entry client has.
+ * addr.1= address of 2nd newest entry.
+ * [...]
+ *
+ * ntpq provides as many last/addr pairs as will fit in a single request
+ * packet, except for the first request in a MRU fetch operation.
+ *
+ * The response begins with a new nonce value to be used for any
+ * followup request. Following the nonce is the next newer entry than
+ * referred to by last.0 and addr.0, if the "0" entry has not been
+ * bumped to the front. If it has, the first entry returned will be the
+ * next entry newer than referred to by last.1 and addr.1, and so on.
+ * If none of the referenced entries remain unchanged, the request fails
+ * and ntpq backs up to the next earlier set of entries to resync.
+ *
+ * Except for the first response, the response begins with confirmation
+ * of the entry that precedes the first additional entry provided:
+ *
+ * last.older= hex l_fp timestamp matching one of the input
+ * .last timestamps, which entry now precedes the
+ * response 0. entry in the MRU list.
+ * addr.older= text of address corresponding to older.last.
+ *
+ * And in any case, a successful response contains sets of values
+ * comprising entries, with the oldest numbered 0 and incrementing from
+ * there:
+ *
+ * addr.# text of IPv4 or IPv6 address and port
+ * last.# hex l_fp timestamp of last receipt
+ * first.# hex l_fp timestamp of first receipt
+ * ct.# count of packets received
+ * mv.# mode and version
+ * rs.# restriction mask (RES_* bits)
+ *
+ * Note the code currently assumes there are no valid three letter
+ * tags sent with each row, and needs to be adjusted if that changes.
+ *
+ * The client should accept the values in any order, and ignore .#
+ * values which it does not understand, to allow a smooth path to
+ * future changes without requiring a new opcode. Clients can rely
+ * on all *.0 values preceding any *.1 values, that is all values for
+ * a given index number are together in the response.
+ *
+ * The end of the response list is noted with one or two tag=value
+ * pairs. Unconditionally:
+ *
+ * now= 0x-prefixed l_fp timestamp at the server marking
+ * the end of the operation.
+ *
+ * If any entries were returned, now= is followed by:
+ *
+ * last.newest= hex l_fp identical to last.# of the prior
+ * entry.
+ */
+static void read_mru_list(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ const char nonce_text[] = "nonce";
+ const char frags_text[] = "frags";
+ const char limit_text[] = "limit";
+ const char mincount_text[] = "mincount";
+ const char resall_text[] = "resall";
+ const char resany_text[] = "resany";
+ const char maxlstint_text[] = "maxlstint";
+ const char laddr_text[] = "laddr";
+ const char resaxx_fmt[] = "0x%hx";
+ u_int limit;
+ u_short frags;
+ u_short resall;
+ u_short resany;
+ int mincount;
+ u_int maxlstint;
+ sockaddr_u laddr;
+ struct interface * lcladr;
+ u_int count;
+ u_int ui;
+ u_int uf;
+ l_fp last[16];
+ sockaddr_u addr[COUNTOF(last)];
+ char buf[128];
+ struct ctl_var * in_parms;
+ const struct ctl_var * v;
+ char * val;
+ const char * pch;
+ char * pnonce;
+ int nonce_valid;
+ int i;
+ int priors;
+ u_short hash;
+ mon_entry * mon;
+ mon_entry * prior_mon;
+ l_fp now;
+
+ if (RES_NOMRULIST & restrict_mask) {
+ ctl_error(CERR_PERMISSION);
+ NLOG(NLOG_SYSINFO)
+ msyslog(LOG_NOTICE,
+ "mrulist from %s rejected due to nomrulist restriction",
+ stoa(&rbufp->recv_srcadr));
+ sys_restricted++;
+ return;
+ }
+ /*
+ * fill in_parms var list with all possible input parameters.
+ */
+ in_parms = NULL;
+ set_var(&in_parms, nonce_text, sizeof(nonce_text), 0);
+ set_var(&in_parms, frags_text, sizeof(frags_text), 0);
+ set_var(&in_parms, limit_text, sizeof(limit_text), 0);
+ set_var(&in_parms, mincount_text, sizeof(mincount_text), 0);
+ set_var(&in_parms, resall_text, sizeof(resall_text), 0);
+ set_var(&in_parms, resany_text, sizeof(resany_text), 0);
+ set_var(&in_parms, maxlstint_text, sizeof(maxlstint_text), 0);
+ set_var(&in_parms, laddr_text, sizeof(laddr_text), 0);
+ for (i = 0; i < COUNTOF(last); i++) {
+ snprintf(buf, sizeof(buf), last_fmt, i);
+ set_var(&in_parms, buf, strlen(buf) + 1, 0);
+ snprintf(buf, sizeof(buf), addr_fmt, i);
+ set_var(&in_parms, buf, strlen(buf) + 1, 0);
+ }
+
+ /* decode input parms */
+ pnonce = NULL;
+ frags = 0;
+ limit = 0;
+ mincount = 0;
+ resall = 0;
+ resany = 0;
+ maxlstint = 0;
+ lcladr = NULL;
+ priors = 0;
+ ZERO(last);
+ ZERO(addr);
+
+ while (NULL != (v = ctl_getitem(in_parms, &val)) &&
+ !(EOV & v->flags)) {
+
+ if (!strcmp(nonce_text, v->text)) {
+ if (NULL != pnonce)
+ free(pnonce);
+ pnonce = estrdup(val);
+ } else if (!strcmp(frags_text, v->text)) {
+ sscanf(val, "%hu", &frags);
+ } else if (!strcmp(limit_text, v->text)) {
+ sscanf(val, "%u", &limit);
+ } else if (!strcmp(mincount_text, v->text)) {
+ if (1 != sscanf(val, "%d", &mincount) ||
+ mincount < 0)
+ mincount = 0;
+ } else if (!strcmp(resall_text, v->text)) {
+ sscanf(val, resaxx_fmt, &resall);
+ } else if (!strcmp(resany_text, v->text)) {
+ sscanf(val, resaxx_fmt, &resany);
+ } else if (!strcmp(maxlstint_text, v->text)) {
+ sscanf(val, "%u", &maxlstint);
+ } else if (!strcmp(laddr_text, v->text)) {
+ if (decodenetnum(val, &laddr))
+ lcladr = getinterface(&laddr, 0);
+ } else if (1 == sscanf(v->text, last_fmt, &i) &&
+ i < COUNTOF(last)) {
+ if (2 == sscanf(val, "0x%08x.%08x", &ui, &uf)) {
+ last[i].l_ui = ui;
+ last[i].l_uf = uf;
+ if (!SOCK_UNSPEC(&addr[i]) &&
+ i == priors)
+ priors++;
+ }
+ } else if (1 == sscanf(v->text, addr_fmt, &i) &&
+ i < COUNTOF(addr)) {
+ if (decodenetnum(val, &addr[i])
+ && last[i].l_ui && last[i].l_uf &&
+ i == priors)
+ priors++;
+ }
+ }
+ free_varlist(in_parms);
+ in_parms = NULL;
+
+ /* return no responses until the nonce is validated */
+ if (NULL == pnonce)
+ return;
+
+ nonce_valid = validate_nonce(pnonce, rbufp);
+ free(pnonce);
+ if (!nonce_valid)
+ return;
+
+ if ((0 == frags && !(0 < limit && limit <= MRU_ROW_LIMIT)) ||
+ frags > MRU_FRAGS_LIMIT) {
+ ctl_error(CERR_BADVALUE);
+ return;
+ }
+
+ /*
+ * If either frags or limit is not given, use the max.
+ */
+ if (0 != frags && 0 == limit)
+ limit = UINT_MAX;
+ else if (0 != limit && 0 == frags)
+ frags = MRU_FRAGS_LIMIT;
+
+ /*
+ * Find the starting point if one was provided.
+ */
+ mon = NULL;
+ for (i = 0; i < priors; i++) {
+ hash = MON_HASH(&addr[i]);
+ for (mon = mon_hash[hash];
+ mon != NULL;
+ mon = mon->hash_next)
+ if (ADDR_PORT_EQ(&mon->rmtadr, &addr[i]))
+ break;
+ if (mon != NULL) {
+ if (L_ISEQU(&mon->last, &last[i]))
+ break;
+ mon = NULL;
+ }
+ }
+
+ /* If a starting point was provided... */
+ if (priors) {
+ /* and none could be found unmodified... */
+ if (NULL == mon) {
+ /* tell ntpq to try again with older entries */
+ ctl_error(CERR_UNKNOWNVAR);
+ return;
+ }
+ /* confirm the prior entry used as starting point */
+ ctl_putts("last.older", &mon->last);
+ pch = sptoa(&mon->rmtadr);
+ ctl_putunqstr("addr.older", pch, strlen(pch));
+
+ /*
+ * Move on to the first entry the client doesn't have,
+ * except in the special case of a limit of one. In
+ * that case return the starting point entry.
+ */
+ if (limit > 1)
+ mon = PREV_DLIST(mon_mru_list, mon, mru);
+ } else { /* start with the oldest */
+ mon = TAIL_DLIST(mon_mru_list, mru);
+ }
+
+ /*
+ * send up to limit= entries in up to frags= datagrams
+ */
+ get_systime(&now);
+ generate_nonce(rbufp, buf, sizeof(buf));
+ ctl_putunqstr("nonce", buf, strlen(buf));
+ prior_mon = NULL;
+ for (count = 0;
+ mon != NULL && res_frags < frags && count < limit;
+ mon = PREV_DLIST(mon_mru_list, mon, mru)) {
+
+ if (mon->count < mincount)
+ continue;
+ if (resall && resall != (resall & mon->flags))
+ continue;
+ if (resany && !(resany & mon->flags))
+ continue;
+ if (maxlstint > 0 && now.l_ui - mon->last.l_ui >
+ maxlstint)
+ continue;
+ if (lcladr != NULL && mon->lcladr != lcladr)
+ continue;
+
+ send_mru_entry(mon, count);
+ if (!count)
+ send_random_tag_value(0);
+ count++;
+ prior_mon = mon;
+ }
+
+ /*
+ * If this batch completes the MRU list, say so explicitly with
+ * a now= l_fp timestamp.
+ */
+ if (NULL == mon) {
+ if (count > 1)
+ send_random_tag_value(count - 1);
+ ctl_putts("now", &now);
+ /* if any entries were returned confirm the last */
+ if (prior_mon != NULL)
+ ctl_putts("last.newest", &prior_mon->last);
+ }
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * Send a ifstats entry in response to a "ntpq -c ifstats" request.
+ *
+ * To keep clients honest about not depending on the order of values,
+ * and thereby avoid being locked into ugly workarounds to maintain
+ * backward compatibility later as new fields are added to the response,
+ * the order is random.
+ */
+static void
+send_ifstats_entry(
+ endpt * la,
+ u_int ifnum
+ )
+{
+ const char addr_fmtu[] = "addr.%u";
+ const char bcast_fmt[] = "bcast.%u";
+ const char en_fmt[] = "en.%u"; /* enabled */
+ const char name_fmt[] = "name.%u";
+ const char flags_fmt[] = "flags.%u";
+ const char tl_fmt[] = "tl.%u"; /* ttl */
+ const char mc_fmt[] = "mc.%u"; /* mcast count */
+ const char rx_fmt[] = "rx.%u";
+ const char tx_fmt[] = "tx.%u";
+ const char txerr_fmt[] = "txerr.%u";
+ const char pc_fmt[] = "pc.%u"; /* peer count */
+ const char up_fmt[] = "up.%u"; /* uptime */
+ char tag[32];
+ u_char sent[IFSTATS_FIELDS]; /* 12 tag=value pairs */
+ int noisebits;
+ u_int32 noise;
+ u_int which;
+ u_int remaining;
+ const char *pch;
+
+ remaining = COUNTOF(sent);
+ ZERO(sent);
+ noise = 0;
+ noisebits = 0;
+ while (remaining > 0) {
+ if (noisebits < 4) {
+ noise = rand() ^ (rand() << 16);
+ noisebits = 31;
+ }
+ which = (noise & 0xf) % COUNTOF(sent);
+ noise >>= 4;
+ noisebits -= 4;
+
+ while (sent[which])
+ which = (which + 1) % COUNTOF(sent);
+
+ switch (which) {
+
+ case 0:
+ snprintf(tag, sizeof(tag), addr_fmtu, ifnum);
+ pch = sptoa(&la->sin);
+ ctl_putunqstr(tag, pch, strlen(pch));
+ break;
+
+ case 1:
+ snprintf(tag, sizeof(tag), bcast_fmt, ifnum);
+ if (INT_BCASTOPEN & la->flags)
+ pch = sptoa(&la->bcast);
+ else
+ pch = "";
+ ctl_putunqstr(tag, pch, strlen(pch));
+ break;
+
+ case 2:
+ snprintf(tag, sizeof(tag), en_fmt, ifnum);
+ ctl_putint(tag, !la->ignore_packets);
+ break;
+
+ case 3:
+ snprintf(tag, sizeof(tag), name_fmt, ifnum);
+ ctl_putstr(tag, la->name, strlen(la->name));
+ break;
+
+ case 4:
+ snprintf(tag, sizeof(tag), flags_fmt, ifnum);
+ ctl_puthex(tag, (u_int)la->flags);
+ break;
+
+ case 5:
+ snprintf(tag, sizeof(tag), tl_fmt, ifnum);
+ ctl_putint(tag, la->last_ttl);
+ break;
+
+ case 6:
+ snprintf(tag, sizeof(tag), mc_fmt, ifnum);
+ ctl_putint(tag, la->num_mcast);
+ break;
+
+ case 7:
+ snprintf(tag, sizeof(tag), rx_fmt, ifnum);
+ ctl_putint(tag, la->received);
+ break;
+
+ case 8:
+ snprintf(tag, sizeof(tag), tx_fmt, ifnum);
+ ctl_putint(tag, la->sent);
+ break;
+
+ case 9:
+ snprintf(tag, sizeof(tag), txerr_fmt, ifnum);
+ ctl_putint(tag, la->notsent);
+ break;
+
+ case 10:
+ snprintf(tag, sizeof(tag), pc_fmt, ifnum);
+ ctl_putuint(tag, la->peercnt);
+ break;
+
+ case 11:
+ snprintf(tag, sizeof(tag), up_fmt, ifnum);
+ ctl_putuint(tag, current_time - la->starttime);
+ break;
+ }
+ sent[which] = TRUE;
+ remaining--;
+ }
+ send_random_tag_value((int)ifnum);
+}
+
+
+/*
+ * read_ifstats - send statistics for each local address, exposed by
+ * ntpq -c ifstats
+ */
+static void
+read_ifstats(
+ struct recvbuf * rbufp
+ )
+{
+ u_int ifidx;
+ endpt * la;
+
+ /*
+ * loop over [0..sys_ifnum] searching ep_list for each
+ * ifnum in turn.
+ */
+ for (ifidx = 0; ifidx < sys_ifnum; ifidx++) {
+ for (la = ep_list; la != NULL; la = la->elink)
+ if (ifidx == la->ifnum)
+ break;
+ if (NULL == la)
+ continue;
+ /* return stats for one local address */
+ send_ifstats_entry(la, ifidx);
+ }
+ ctl_flushpkt(0);
+}
+
+static void
+sockaddrs_from_restrict_u(
+ sockaddr_u * psaA,
+ sockaddr_u * psaM,
+ restrict_u * pres,
+ int ipv6
+ )
+{
+ ZERO(*psaA);
+ ZERO(*psaM);
+ if (!ipv6) {
+ psaA->sa.sa_family = AF_INET;
+ psaA->sa4.sin_addr.s_addr = htonl(pres->u.v4.addr);
+ psaM->sa.sa_family = AF_INET;
+ psaM->sa4.sin_addr.s_addr = htonl(pres->u.v4.mask);
+ } else {
+ psaA->sa.sa_family = AF_INET6;
+ memcpy(&psaA->sa6.sin6_addr, &pres->u.v6.addr,
+ sizeof(psaA->sa6.sin6_addr));
+ psaM->sa.sa_family = AF_INET6;
+ memcpy(&psaM->sa6.sin6_addr, &pres->u.v6.mask,
+ sizeof(psaA->sa6.sin6_addr));
+ }
+}
+
+
+/*
+ * Send a restrict entry in response to a "ntpq -c reslist" request.
+ *
+ * To keep clients honest about not depending on the order of values,
+ * and thereby avoid being locked into ugly workarounds to maintain
+ * backward compatibility later as new fields are added to the response,
+ * the order is random.
+ */
+static void
+send_restrict_entry(
+ restrict_u * pres,
+ int ipv6,
+ u_int idx
+ )
+{
+ const char addr_fmtu[] = "addr.%u";
+ const char mask_fmtu[] = "mask.%u";
+ const char hits_fmt[] = "hits.%u";
+ const char flags_fmt[] = "flags.%u";
+ char tag[32];
+ u_char sent[RESLIST_FIELDS]; /* 4 tag=value pairs */
+ int noisebits;
+ u_int32 noise;
+ u_int which;
+ u_int remaining;
+ sockaddr_u addr;
+ sockaddr_u mask;
+ const char * pch;
+ char * buf;
+ const char * match_str;
+ const char * access_str;
+
+ sockaddrs_from_restrict_u(&addr, &mask, pres, ipv6);
+ remaining = COUNTOF(sent);
+ ZERO(sent);
+ noise = 0;
+ noisebits = 0;
+ while (remaining > 0) {
+ if (noisebits < 2) {
+ noise = rand() ^ (rand() << 16);
+ noisebits = 31;
+ }
+ which = (noise & 0x3) % COUNTOF(sent);
+ noise >>= 2;
+ noisebits -= 2;
+
+ while (sent[which])
+ which = (which + 1) % COUNTOF(sent);
+
+ switch (which) {
+
+ case 0:
+ snprintf(tag, sizeof(tag), addr_fmtu, idx);
+ pch = stoa(&addr);
+ ctl_putunqstr(tag, pch, strlen(pch));
+ break;
+
+ case 1:
+ snprintf(tag, sizeof(tag), mask_fmtu, idx);
+ pch = stoa(&mask);
+ ctl_putunqstr(tag, pch, strlen(pch));
+ break;
+
+ case 2:
+ snprintf(tag, sizeof(tag), hits_fmt, idx);
+ ctl_putuint(tag, pres->count);
+ break;
+
+ case 3:
+ snprintf(tag, sizeof(tag), flags_fmt, idx);
+ match_str = res_match_flags(pres->mflags);
+ access_str = res_access_flags(pres->flags);
+ if ('\0' == match_str[0]) {
+ pch = access_str;
+ } else {
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH, "%s %s",
+ match_str, access_str);
+ pch = buf;
+ }
+ ctl_putunqstr(tag, pch, strlen(pch));
+ break;
+ }
+ sent[which] = TRUE;
+ remaining--;
+ }
+ send_random_tag_value((int)idx);
+}
+
+
+static void
+send_restrict_list(
+ restrict_u * pres,
+ int ipv6,
+ u_int * pidx
+ )
+{
+ for ( ; pres != NULL; pres = pres->link) {
+ send_restrict_entry(pres, ipv6, *pidx);
+ (*pidx)++;
+ }
+}
+
+
+/*
+ * read_addr_restrictions - returns IPv4 and IPv6 access control lists
+ */
+static void
+read_addr_restrictions(
+ struct recvbuf * rbufp
+)
+{
+ u_int idx;
+
+ idx = 0;
+ send_restrict_list(restrictlist4, FALSE, &idx);
+ send_restrict_list(restrictlist6, TRUE, &idx);
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * read_ordlist - CTL_OP_READ_ORDLIST_A for ntpq -c ifstats & reslist
+ */
+static void
+read_ordlist(
+ struct recvbuf * rbufp,
+ int restrict_mask
+ )
+{
+ const char ifstats_s[] = "ifstats";
+ const size_t ifstats_chars = COUNTOF(ifstats_s) - 1;
+ const char addr_rst_s[] = "addr_restrictions";
+ const size_t a_r_chars = COUNTOF(addr_rst_s) - 1;
+ struct ntp_control * cpkt;
+ u_short qdata_octets;
+
+ /*
+ * CTL_OP_READ_ORDLIST_A was first named CTL_OP_READ_IFSTATS and
+ * used only for ntpq -c ifstats. With the addition of reslist
+ * the same opcode was generalized to retrieve ordered lists
+ * which require authentication. The request data is empty or
+ * contains "ifstats" (not null terminated) to retrieve local
+ * addresses and associated stats. It is "addr_restrictions"
+ * to retrieve the IPv4 then IPv6 remote address restrictions,
+ * which are access control lists. Other request data return
+ * CERR_UNKNOWNVAR.
+ */
+ cpkt = (struct ntp_control *)&rbufp->recv_pkt;
+ qdata_octets = ntohs(cpkt->count);
+ if (0 == qdata_octets || (ifstats_chars == qdata_octets &&
+ !memcmp(ifstats_s, cpkt->u.data, ifstats_chars))) {
+ read_ifstats(rbufp);
+ return;
+ }
+ if (a_r_chars == qdata_octets &&
+ !memcmp(addr_rst_s, cpkt->u.data, a_r_chars)) {
+ read_addr_restrictions(rbufp);
+ return;
+ }
+ ctl_error(CERR_UNKNOWNVAR);
+}
+
+
+/*
+ * req_nonce - CTL_OP_REQ_NONCE for ntpq -c mrulist prerequisite.
+ */
+static void req_nonce(
+ struct recvbuf * rbufp,
+ int restrict_mask
+ )
+{
+ char buf[64];
+
+ generate_nonce(rbufp, buf, sizeof(buf));
+ ctl_putunqstr("nonce", buf, strlen(buf));
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * read_clockstatus - return clock radio status
+ */
+/*ARGSUSED*/
+static void
+read_clockstatus(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+#ifndef REFCLOCK
+ /*
+ * If no refclock support, no data to return
+ */
+ ctl_error(CERR_BADASSOC);
+#else
+ const struct ctl_var * v;
+ int i;
+ struct peer * peer;
+ char * valuep;
+ u_char * wants;
+ size_t wants_alloc;
+ int gotvar;
+ const u_char * cc;
+ struct ctl_var * kv;
+ struct refclockstat cs;
+
+ if (res_associd != 0) {
+ peer = findpeerbyassoc(res_associd);
+ } else {
+ /*
+ * Find a clock for this jerk. If the system peer
+ * is a clock use it, else search peer_list for one.
+ */
+ if (sys_peer != NULL && (FLAG_REFCLOCK &
+ sys_peer->flags))
+ peer = sys_peer;
+ else
+ for (peer = peer_list;
+ peer != NULL;
+ peer = peer->p_link)
+ if (FLAG_REFCLOCK & peer->flags)
+ break;
+ }
+ if (NULL == peer || !(FLAG_REFCLOCK & peer->flags)) {
+ ctl_error(CERR_BADASSOC);
+ return;
+ }
+ /*
+ * If we got here we have a peer which is a clock. Get his
+ * status.
+ */
+ cs.kv_list = NULL;
+ refclock_control(&peer->srcadr, NULL, &cs);
+ kv = cs.kv_list;
+ /*
+ * Look for variables in the packet.
+ */
+ rpkt.status = htons(ctlclkstatus(&cs));
+ wants_alloc = CC_MAXCODE + 1 + count_var(kv);
+ wants = emalloc_zero(wants_alloc);
+ gotvar = FALSE;
+ while (NULL != (v = ctl_getitem(clock_var, &valuep))) {
+ if (!(EOV & v->flags)) {
+ wants[v->code] = TRUE;
+ gotvar = TRUE;
+ } else {
+ v = ctl_getitem(kv, &valuep);
+ NTP_INSIST(NULL != v);
+ if (EOV & v->flags) {
+ ctl_error(CERR_UNKNOWNVAR);
+ free(wants);
+ free_varlist(cs.kv_list);
+ return;
+ }
+ wants[CC_MAXCODE + 1 + v->code] = TRUE;
+ gotvar = TRUE;
+ }
+ }
+
+ if (gotvar) {
+ for (i = 1; i <= CC_MAXCODE; i++)
+ if (wants[i])
+ ctl_putclock(i, &cs, TRUE);
+ if (kv != NULL)
+ for (i = 0; !(EOV & kv[i].flags); i++)
+ if (wants[i + CC_MAXCODE + 1])
+ ctl_putdata(kv[i].text,
+ strlen(kv[i].text),
+ FALSE);
+ } else {
+ for (cc = def_clock_var; *cc != 0; cc++)
+ ctl_putclock((int)*cc, &cs, FALSE);
+ for ( ; kv != NULL && !(EOV & kv->flags); kv++)
+ if (DEF & kv->flags)
+ ctl_putdata(kv->text, strlen(kv->text),
+ FALSE);
+ }
+
+ free(wants);
+ free_varlist(cs.kv_list);
+
+ ctl_flushpkt(0);
+#endif
+}
+
+
+/*
+ * write_clockstatus - we don't do this
+ */
+/*ARGSUSED*/
+static void
+write_clockstatus(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ ctl_error(CERR_PERMISSION);
+}
+
+/*
+ * Trap support from here on down. We send async trap messages when the
+ * upper levels report trouble. Traps can by set either by control
+ * messages or by configuration.
+ */
+/*
+ * set_trap - set a trap in response to a control message
+ */
+static void
+set_trap(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ int traptype;
+
+ /*
+ * See if this guy is allowed
+ */
+ if (restrict_mask & RES_NOTRAP) {
+ ctl_error(CERR_PERMISSION);
+ return;
+ }
+
+ /*
+ * Determine his allowed trap type.
+ */
+ traptype = TRAP_TYPE_PRIO;
+ if (restrict_mask & RES_LPTRAP)
+ traptype = TRAP_TYPE_NONPRIO;
+
+ /*
+ * Call ctlsettrap() to do the work. Return
+ * an error if it can't assign the trap.
+ */
+ if (!ctlsettrap(&rbufp->recv_srcadr, rbufp->dstadr, traptype,
+ (int)res_version))
+ ctl_error(CERR_NORESOURCE);
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * unset_trap - unset a trap in response to a control message
+ */
+static void
+unset_trap(
+ struct recvbuf *rbufp,
+ int restrict_mask
+ )
+{
+ int traptype;
+
+ /*
+ * We don't prevent anyone from removing his own trap unless the
+ * trap is configured. Note we also must be aware of the
+ * possibility that restriction flags were changed since this
+ * guy last set his trap. Set the trap type based on this.
+ */
+ traptype = TRAP_TYPE_PRIO;
+ if (restrict_mask & RES_LPTRAP)
+ traptype = TRAP_TYPE_NONPRIO;
+
+ /*
+ * Call ctlclrtrap() to clear this out.
+ */
+ if (!ctlclrtrap(&rbufp->recv_srcadr, rbufp->dstadr, traptype))
+ ctl_error(CERR_BADASSOC);
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * ctlsettrap - called to set a trap
+ */
+int
+ctlsettrap(
+ sockaddr_u *raddr,
+ struct interface *linter,
+ int traptype,
+ int version
+ )
+{
+ size_t n;
+ struct ctl_trap *tp;
+ struct ctl_trap *tptouse;
+
+ /*
+ * See if we can find this trap. If so, we only need update
+ * the flags and the time.
+ */
+ if ((tp = ctlfindtrap(raddr, linter)) != NULL) {
+ switch (traptype) {
+
+ case TRAP_TYPE_CONFIG:
+ tp->tr_flags = TRAP_INUSE|TRAP_CONFIGURED;
+ break;
+
+ case TRAP_TYPE_PRIO:
+ if (tp->tr_flags & TRAP_CONFIGURED)
+ return (1); /* don't change anything */
+ tp->tr_flags = TRAP_INUSE;
+ break;
+
+ case TRAP_TYPE_NONPRIO:
+ if (tp->tr_flags & TRAP_CONFIGURED)
+ return (1); /* don't change anything */
+ tp->tr_flags = TRAP_INUSE|TRAP_NONPRIO;
+ break;
+ }
+ tp->tr_settime = current_time;
+ tp->tr_resets++;
+ return (1);
+ }
+
+ /*
+ * First we heard of this guy. Try to find a trap structure
+ * for him to use, clearing out lesser priority guys if we
+ * have to. Clear out anyone who's expired while we're at it.
+ */
+ tptouse = NULL;
+ for (n = 0; n < COUNTOF(ctl_traps); n++) {
+ tp = &ctl_traps[n];
+ if ((TRAP_INUSE & tp->tr_flags) &&
+ !(TRAP_CONFIGURED & tp->tr_flags) &&
+ ((tp->tr_settime + CTL_TRAPTIME) > current_time)) {
+ tp->tr_flags = 0;
+ num_ctl_traps--;
+ }
+ if (!(TRAP_INUSE & tp->tr_flags)) {
+ tptouse = tp;
+ } else if (!(TRAP_CONFIGURED & tp->tr_flags)) {
+ switch (traptype) {
+
+ case TRAP_TYPE_CONFIG:
+ if (tptouse == NULL) {
+ tptouse = tp;
+ break;
+ }
+ if ((TRAP_NONPRIO & tptouse->tr_flags) &&
+ !(TRAP_NONPRIO & tp->tr_flags))
+ break;
+
+ if (!(TRAP_NONPRIO & tptouse->tr_flags)
+ && (TRAP_NONPRIO & tp->tr_flags)) {
+ tptouse = tp;
+ break;
+ }
+ if (tptouse->tr_origtime <
+ tp->tr_origtime)
+ tptouse = tp;
+ break;
+
+ case TRAP_TYPE_PRIO:
+ if ( TRAP_NONPRIO & tp->tr_flags) {
+ if (tptouse == NULL ||
+ ((TRAP_INUSE &
+ tptouse->tr_flags) &&
+ tptouse->tr_origtime <
+ tp->tr_origtime))
+ tptouse = tp;
+ }
+ break;
+
+ case TRAP_TYPE_NONPRIO:
+ break;
+ }
+ }
+ }
+
+ /*
+ * If we don't have room for him return an error.
+ */
+ if (tptouse == NULL)
+ return (0);
+
+ /*
+ * Set up this structure for him.
+ */
+ tptouse->tr_settime = tptouse->tr_origtime = current_time;
+ tptouse->tr_count = tptouse->tr_resets = 0;
+ tptouse->tr_sequence = 1;
+ tptouse->tr_addr = *raddr;
+ tptouse->tr_localaddr = linter;
+ tptouse->tr_version = (u_char) version;
+ tptouse->tr_flags = TRAP_INUSE;
+ if (traptype == TRAP_TYPE_CONFIG)
+ tptouse->tr_flags |= TRAP_CONFIGURED;
+ else if (traptype == TRAP_TYPE_NONPRIO)
+ tptouse->tr_flags |= TRAP_NONPRIO;
+ num_ctl_traps++;
+ return (1);
+}
+
+
+/*
+ * ctlclrtrap - called to clear a trap
+ */
+int
+ctlclrtrap(
+ sockaddr_u *raddr,
+ struct interface *linter,
+ int traptype
+ )
+{
+ register struct ctl_trap *tp;
+
+ if ((tp = ctlfindtrap(raddr, linter)) == NULL)
+ return (0);
+
+ if (tp->tr_flags & TRAP_CONFIGURED
+ && traptype != TRAP_TYPE_CONFIG)
+ return (0);
+
+ tp->tr_flags = 0;
+ num_ctl_traps--;
+ return (1);
+}
+
+
+/*
+ * ctlfindtrap - find a trap given the remote and local addresses
+ */
+static struct ctl_trap *
+ctlfindtrap(
+ sockaddr_u *raddr,
+ struct interface *linter
+ )
+{
+ size_t n;
+
+ for (n = 0; n < COUNTOF(ctl_traps); n++)
+ if ((ctl_traps[n].tr_flags & TRAP_INUSE)
+ && ADDR_PORT_EQ(raddr, &ctl_traps[n].tr_addr)
+ && (linter == ctl_traps[n].tr_localaddr))
+ return &ctl_traps[n];
+
+ return NULL;
+}
+
+
+/*
+ * report_event - report an event to the trappers
+ */
+void
+report_event(
+ int err, /* error code */
+ struct peer *peer, /* peer structure pointer */
+ const char *str /* protostats string */
+ )
+{
+ char statstr[NTP_MAXSTRLEN];
+ int i;
+ size_t len;
+
+ /*
+ * Report the error to the protostats file, system log and
+ * trappers.
+ */
+ if (peer == NULL) {
+
+ /*
+ * Discard a system report if the number of reports of
+ * the same type exceeds the maximum.
+ */
+ if (ctl_sys_last_event != (u_char)err)
+ ctl_sys_num_events= 0;
+ if (ctl_sys_num_events >= CTL_SYS_MAXEVENTS)
+ return;
+
+ ctl_sys_last_event = (u_char)err;
+ ctl_sys_num_events++;
+ snprintf(statstr, sizeof(statstr),
+ "0.0.0.0 %04x %02x %s",
+ ctlsysstatus(), err, eventstr(err));
+ if (str != NULL) {
+ len = strlen(statstr);
+ snprintf(statstr + len, sizeof(statstr) - len,
+ " %s", str);
+ }
+ NLOG(NLOG_SYSEVENT)
+ msyslog(LOG_INFO, "%s", statstr);
+ } else {
+
+ /*
+ * Discard a peer report if the number of reports of
+ * the same type exceeds the maximum for that peer.
+ */
+ const char * src;
+ u_char errlast;
+
+ errlast = (u_char)err & ~PEER_EVENT;
+ if (peer->last_event == errlast)
+ peer->num_events = 0;
+ if (peer->num_events >= CTL_PEER_MAXEVENTS)
+ return;
+
+ peer->last_event = errlast;
+ peer->num_events++;
+ if (ISREFCLOCKADR(&peer->srcadr))
+ src = refnumtoa(&peer->srcadr);
+ else
+ src = stoa(&peer->srcadr);
+
+ snprintf(statstr, sizeof(statstr),
+ "%s %04x %02x %s", src,
+ ctlpeerstatus(peer), err, eventstr(err));
+ if (str != NULL) {
+ len = strlen(statstr);
+ snprintf(statstr + len, sizeof(statstr) - len,
+ " %s", str);
+ }
+ NLOG(NLOG_PEEREVENT)
+ msyslog(LOG_INFO, "%s", statstr);
+ }
+ record_proto_stats(statstr);
+#if DEBUG
+ if (debug)
+ printf("event at %lu %s\n", current_time, statstr);
+#endif
+
+ /*
+ * If no trappers, return.
+ */
+ if (num_ctl_traps <= 0)
+ return;
+
+ /*
+ * Set up the outgoing packet variables
+ */
+ res_opcode = CTL_OP_ASYNCMSG;
+ res_offset = 0;
+ res_async = TRUE;
+ res_authenticate = FALSE;
+ datapt = rpkt.u.data;
+ dataend = &rpkt.u.data[CTL_MAX_DATA_LEN];
+ if (!(err & PEER_EVENT)) {
+ rpkt.associd = 0;
+ rpkt.status = htons(ctlsysstatus());
+
+ /* Include the core system variables and the list. */
+ for (i = 1; i <= CS_VARLIST; i++)
+ ctl_putsys(i);
+ } else {
+ NTP_INSIST(peer != NULL);
+ rpkt.associd = htons(peer->associd);
+ rpkt.status = htons(ctlpeerstatus(peer));
+
+ /* Dump it all. Later, maybe less. */
+ for (i = 1; i <= CP_MAX_NOAUTOKEY; i++)
+ ctl_putpeer(i, peer);
+#ifdef REFCLOCK
+ /*
+ * for clock exception events: add clock variables to
+ * reflect info on exception
+ */
+ if (err == PEVNT_CLOCK) {
+ struct refclockstat cs;
+ struct ctl_var *kv;
+
+ cs.kv_list = NULL;
+ refclock_control(&peer->srcadr, NULL, &cs);
+
+ ctl_puthex("refclockstatus",
+ ctlclkstatus(&cs));
+
+ for (i = 1; i <= CC_MAXCODE; i++)
+ ctl_putclock(i, &cs, FALSE);
+ for (kv = cs.kv_list;
+ kv != NULL && !(EOV & kv->flags);
+ kv++)
+ if (DEF & kv->flags)
+ ctl_putdata(kv->text,
+ strlen(kv->text),
+ FALSE);
+ free_varlist(cs.kv_list);
+ }
+#endif /* REFCLOCK */
+ }
+
+ /*
+ * We're done, return.
+ */
+ ctl_flushpkt(0);
+}
+
+
+/*
+ * mprintf_event - printf-style varargs variant of report_event()
+ */
+int
+mprintf_event(
+ int evcode, /* event code */
+ struct peer * p, /* may be NULL */
+ const char * fmt, /* msnprintf format */
+ ...
+ )
+{
+ va_list ap;
+ int rc;
+ char msg[512];
+
+ va_start(ap, fmt);
+ rc = mvsnprintf(msg, sizeof(msg), fmt, ap);
+ va_end(ap);
+ report_event(evcode, p, msg);
+
+ return rc;
+}
+
+
+/*
+ * ctl_clr_stats - clear stat counters
+ */
+void
+ctl_clr_stats(void)
+{
+ ctltimereset = current_time;
+ numctlreq = 0;
+ numctlbadpkts = 0;
+ numctlresponses = 0;
+ numctlfrags = 0;
+ numctlerrors = 0;
+ numctlfrags = 0;
+ numctltooshort = 0;
+ numctlinputresp = 0;
+ numctlinputfrag = 0;
+ numctlinputerr = 0;
+ numctlbadoffset = 0;
+ numctlbadversion = 0;
+ numctldatatooshort = 0;
+ numctlbadop = 0;
+ numasyncmsgs = 0;
+}
+
+static u_short
+count_var(
+ const struct ctl_var *k
+ )
+{
+ u_int c;
+
+ if (NULL == k)
+ return 0;
+
+ c = 0;
+ while (!(EOV & (k++)->flags))
+ c++;
+
+ NTP_ENSURE(c <= USHRT_MAX);
+ return (u_short)c;
+}
+
+
+char *
+add_var(
+ struct ctl_var **kv,
+ u_long size,
+ u_short def
+ )
+{
+ u_short c;
+ struct ctl_var *k;
+ char * buf;
+
+ c = count_var(*kv);
+ *kv = erealloc(*kv, (c + 2) * sizeof(**kv));
+ k = *kv;
+ buf = emalloc(size);
+ k[c].code = c;
+ k[c].text = buf;
+ k[c].flags = def;
+ k[c + 1].code = 0;
+ k[c + 1].text = NULL;
+ k[c + 1].flags = EOV;
+
+ return buf;
+}
+
+
+void
+set_var(
+ struct ctl_var **kv,
+ const char *data,
+ u_long size,
+ u_short def
+ )
+{
+ struct ctl_var *k;
+ const char *s;
+ const char *t;
+ char *td;
+
+ if (NULL == data || !size)
+ return;
+
+ k = *kv;
+ if (k != NULL) {
+ while (!(EOV & k->flags)) {
+ if (NULL == k->text) {
+ td = emalloc(size);
+ memcpy(td, data, size);
+ k->text = td;
+ k->flags = def;
+ return;
+ } else {
+ s = data;
+ t = k->text;
+ while (*t != '=' && *s == *t) {
+ s++;
+ t++;
+ }
+ if (*s == *t && ((*t == '=') || !*t)) {
+ td = erealloc(k->text, size);
+ memcpy(td, data, size);
+ k->text = td;
+ k->flags = def;
+ return;
+ }
+ }
+ k++;
+ }
+ }
+ td = add_var(kv, size, def);
+ memcpy(td, data, size);
+}
+
+
+void
+set_sys_var(
+ const char *data,
+ u_long size,
+ u_short def
+ )
+{
+ set_var(&ext_sys_var, data, size, def);
+}
+
+
+/*
+ * get_ext_sys_var() retrieves the value of a user-defined variable or
+ * NULL if the variable has not been setvar'd.
+ */
+const char *
+get_ext_sys_var(const char *tag)
+{
+ struct ctl_var * v;
+ size_t c;
+ const char * val;
+
+ val = NULL;
+ c = strlen(tag);
+ for (v = ext_sys_var; !(EOV & v->flags); v++) {
+ if (NULL != v->text && !memcmp(tag, v->text, c)) {
+ if ('=' == v->text[c]) {
+ val = v->text + c + 1;
+ break;
+ } else if ('\0' == v->text[c]) {
+ val = "";
+ break;
+ }
+ }
+ }
+
+ return val;
+}
+
+
+void
+free_varlist(
+ struct ctl_var *kv
+ )
+{
+ struct ctl_var *k;
+ if (kv) {
+ for (k = kv; !(k->flags & EOV); k++)
+ free((void *)k->text);
+ free((void *)kv);
+ }
+}
diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c
new file mode 100644
index 0000000..e66d5c7
--- /dev/null
+++ b/ntpd/ntp_crypto.c
@@ -0,0 +1,3987 @@
+/*
+ * ntp_crypto.c - NTP version 4 public key routines
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef AUTOKEY
+#include <stdio.h>
+#include <stdlib.h> /* strtoul */
+#include <sys/types.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "ntpd.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "ntp_string.h"
+#include "ntp_random.h"
+#include "ntp_assert.h"
+#include "ntp_calendar.h"
+#include "ntp_leapsec.h"
+
+#include "openssl/asn1_mac.h"
+#include "openssl/bn.h"
+#include "openssl/err.h"
+#include "openssl/evp.h"
+#include "openssl/pem.h"
+#include "openssl/rand.h"
+#include "openssl/x509v3.h"
+
+#ifdef KERNEL_PLL
+#include "ntp_syscall.h"
+#endif /* KERNEL_PLL */
+
+/*
+ * calcomp - compare two calendar structures, ignoring yearday and weekday; like strcmp
+ * No, it's not a plotter. If you don't understand that, you're too young.
+ */
+static int calcomp(struct calendar *pjd1, struct calendar *pjd2)
+{
+ int32_t diff; /* large enough to hold the signed difference between two uint16_t values */
+
+ diff = pjd1->year - pjd2->year;
+ if (diff < 0) return -1; else if (diff > 0) return 1;
+ /* same year; compare months */
+ diff = pjd1->month - pjd2->month;
+ if (diff < 0) return -1; else if (diff > 0) return 1;
+ /* same year and month; compare monthday */
+ diff = pjd1->monthday - pjd2->monthday;
+ if (diff < 0) return -1; else if (diff > 0) return 1;
+ /* same year and month and monthday; compare time */
+ diff = pjd1->hour - pjd2->hour;
+ if (diff < 0) return -1; else if (diff > 0) return 1;
+ diff = pjd1->minute - pjd2->minute;
+ if (diff < 0) return -1; else if (diff > 0) return 1;
+ diff = pjd1->second - pjd2->second;
+ if (diff < 0) return -1; else if (diff > 0) return 1;
+ /* identical */
+ return 0;
+}
+
+/*
+ * Extension field message format
+ *
+ * These are always signed and saved before sending in network byte
+ * order. They must be converted to and from host byte order for
+ * processing.
+ *
+ * +-------+-------+
+ * | op | len | <- extension pointer
+ * +-------+-------+
+ * | associd |
+ * +---------------+
+ * | timestamp | <- value pointer
+ * +---------------+
+ * | filestamp |
+ * +---------------+
+ * | value len |
+ * +---------------+
+ * | |
+ * = value =
+ * | |
+ * +---------------+
+ * | signature len |
+ * +---------------+
+ * | |
+ * = signature =
+ * | |
+ * +---------------+
+ *
+ * The CRYPTO_RESP bit is set to 0 for requests, 1 for responses.
+ * Requests carry the association ID of the receiver; responses carry
+ * the association ID of the sender. Some messages include only the
+ * operation/length and association ID words and so have length 8
+ * octets. Ohers include the value structure and associated value and
+ * signature fields. These messages include the timestamp, filestamp,
+ * value and signature words and so have length at least 24 octets. The
+ * signature and/or value fields can be empty, in which case the
+ * respective length words are zero. An empty value with nonempty
+ * signature is syntactically valid, but semantically questionable.
+ *
+ * The filestamp represents the time when a cryptographic data file such
+ * as a public/private key pair is created. It follows every reference
+ * depending on that file and serves as a means to obsolete earlier data
+ * of the same type. The timestamp represents the time when the
+ * cryptographic data of the message were last signed. Creation of a
+ * cryptographic data file or signing a message can occur only when the
+ * creator or signor is synchronized to an authoritative source and
+ * proventicated to a trusted authority.
+ *
+ * Note there are several conditions required for server trust. First,
+ * the public key on the server certificate must be verified, which can
+ * involve a hike along the certificate trail to a trusted host. Next,
+ * the server trust must be confirmed by one of several identity
+ * schemes. Valid cryptographic values are signed with attached
+ * timestamp and filestamp. Individual packet trust is confirmed
+ * relative to these values by a message digest with keys generated by a
+ * reverse-order pseudorandom hash.
+ *
+ * State decomposition. These flags are lit in the order given. They are
+ * dim only when the association is demobilized.
+ *
+ * CRYPTO_FLAG_ENAB Lit upon acceptance of a CRYPTO_ASSOC message
+ * CRYPTO_FLAG_CERT Lit when a self-digned trusted certificate is
+ * accepted.
+ * CRYPTO_FLAG_VRFY Lit when identity is confirmed.
+ * CRYPTO_FLAG_PROV Lit when the first signature is verified.
+ * CRYPTO_FLAG_COOK Lit when a valid cookie is accepted.
+ * CRYPTO_FLAG_AUTO Lit when valid autokey values are accepted.
+ * CRYPTO_FLAG_SIGN Lit when the server signed certificate is
+ * accepted.
+ * CRYPTO_FLAG_LEAP Lit when the leapsecond values are accepted.
+ */
+/*
+ * Cryptodefines
+ */
+#define TAI_1972 10 /* initial TAI offset (s) */
+#define MAX_LEAP 100 /* max UTC leapseconds (s) */
+#define VALUE_LEN (6 * 4) /* min response field length */
+#define YEAR (60 * 60 * 24 * 365) /* seconds in year */
+
+/*
+ * Global cryptodata in host byte order
+ */
+u_int32 crypto_flags = 0x0; /* status word */
+int crypto_nid = KEY_TYPE_MD5; /* digest nid */
+char *sys_hostname = NULL;
+char *sys_groupname = NULL;
+static char *host_filename = NULL; /* host file name */
+static char *ident_filename = NULL; /* group file name */
+
+/*
+ * Global cryptodata in network byte order
+ */
+struct cert_info *cinfo = NULL; /* certificate info/value cache */
+struct cert_info *cert_host = NULL; /* host certificate */
+struct pkey_info *pkinfo = NULL; /* key info/value cache */
+struct value hostval; /* host value */
+struct value pubkey; /* public key */
+struct value tai_leap; /* leapseconds values */
+struct pkey_info *iffkey_info = NULL; /* IFF keys */
+struct pkey_info *gqkey_info = NULL; /* GQ keys */
+struct pkey_info *mvkey_info = NULL; /* MV keys */
+
+/*
+ * Private cryptodata in host byte order
+ */
+static char *passwd = NULL; /* private key password */
+static EVP_PKEY *host_pkey = NULL; /* host key */
+static EVP_PKEY *sign_pkey = NULL; /* sign key */
+static const EVP_MD *sign_digest = NULL; /* sign digest */
+static u_int sign_siglen; /* sign key length */
+static char *rand_file = NULL; /* random seed file */
+
+/*
+ * Cryptotypes
+ */
+static int crypto_verify (struct exten *, struct value *,
+ struct peer *);
+static int crypto_encrypt (struct exten *, struct value *,
+ keyid_t *);
+static int crypto_alice (struct peer *, struct value *);
+static int crypto_alice2 (struct peer *, struct value *);
+static int crypto_alice3 (struct peer *, struct value *);
+static int crypto_bob (struct exten *, struct value *);
+static int crypto_bob2 (struct exten *, struct value *);
+static int crypto_bob3 (struct exten *, struct value *);
+static int crypto_iff (struct exten *, struct peer *);
+static int crypto_gq (struct exten *, struct peer *);
+static int crypto_mv (struct exten *, struct peer *);
+static int crypto_send (struct exten *, struct value *, int);
+static tstamp_t crypto_time (void);
+static void asn_to_calendar (ASN1_TIME *, struct calendar*);
+static struct cert_info *cert_parse (const u_char *, long, tstamp_t);
+static int cert_sign (struct exten *, struct value *);
+static struct cert_info *cert_install (struct exten *, struct peer *);
+static int cert_hike (struct peer *, struct cert_info *);
+static void cert_free (struct cert_info *);
+static struct pkey_info *crypto_key (char *, char *, sockaddr_u *);
+static void bighash (BIGNUM *, BIGNUM *);
+static struct cert_info *crypto_cert (char *);
+
+#ifdef SYS_WINNT
+int
+readlink(char * link, char * file, int len) {
+ return (-1);
+}
+#endif
+
+/*
+ * session_key - generate session key
+ *
+ * This routine generates a session key from the source address,
+ * destination address, key ID and private value. The value of the
+ * session key is the MD5 hash of these values, while the next key ID is
+ * the first four octets of the hash.
+ *
+ * Returns the next key ID or 0 if there is no destination address.
+ */
+keyid_t
+session_key(
+ sockaddr_u *srcadr, /* source address */
+ sockaddr_u *dstadr, /* destination address */
+ keyid_t keyno, /* key ID */
+ keyid_t private, /* private value */
+ u_long lifetime /* key lifetime */
+ )
+{
+ EVP_MD_CTX ctx; /* message digest context */
+ u_char dgst[EVP_MAX_MD_SIZE]; /* message digest */
+ keyid_t keyid; /* key identifer */
+ u_int32 header[10]; /* data in network byte order */
+ u_int hdlen, len;
+
+ if (!dstadr)
+ return 0;
+
+ /*
+ * Generate the session key and key ID. If the lifetime is
+ * greater than zero, install the key and call it trusted.
+ */
+ hdlen = 0;
+ switch(AF(srcadr)) {
+ case AF_INET:
+ header[0] = NSRCADR(srcadr);
+ header[1] = NSRCADR(dstadr);
+ header[2] = htonl(keyno);
+ header[3] = htonl(private);
+ hdlen = 4 * sizeof(u_int32);
+ break;
+
+ case AF_INET6:
+ memcpy(&header[0], PSOCK_ADDR6(srcadr),
+ sizeof(struct in6_addr));
+ memcpy(&header[4], PSOCK_ADDR6(dstadr),
+ sizeof(struct in6_addr));
+ header[8] = htonl(keyno);
+ header[9] = htonl(private);
+ hdlen = 10 * sizeof(u_int32);
+ break;
+ }
+ EVP_DigestInit(&ctx, EVP_get_digestbynid(crypto_nid));
+ EVP_DigestUpdate(&ctx, (u_char *)header, hdlen);
+ EVP_DigestFinal(&ctx, dgst, &len);
+ memcpy(&keyid, dgst, 4);
+ keyid = ntohl(keyid);
+ if (lifetime != 0) {
+ MD5auth_setkey(keyno, crypto_nid, dgst, len);
+ authtrust(keyno, lifetime);
+ }
+ DPRINTF(2, ("session_key: %s > %s %08x %08x hash %08x life %lu\n",
+ stoa(srcadr), stoa(dstadr), keyno,
+ private, keyid, lifetime));
+
+ return (keyid);
+}
+
+
+/*
+ * make_keylist - generate key list
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ *
+ * This routine constructs a pseudo-random sequence by repeatedly
+ * hashing the session key starting from a given source address,
+ * destination address, private value and the next key ID of the
+ * preceeding session key. The last entry on the list is saved along
+ * with its sequence number and public signature.
+ */
+int
+make_keylist(
+ struct peer *peer, /* peer structure pointer */
+ struct interface *dstadr /* interface */
+ )
+{
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp; /* NTP timestamp */
+ struct autokey *ap; /* autokey pointer */
+ struct value *vp; /* value pointer */
+ keyid_t keyid = 0; /* next key ID */
+ keyid_t cookie; /* private value */
+ long lifetime;
+ u_int len, mpoll;
+ int i;
+
+ if (!dstadr)
+ return XEVNT_ERR;
+
+ /*
+ * Allocate the key list if necessary.
+ */
+ tstamp = crypto_time();
+ if (peer->keylist == NULL)
+ peer->keylist = emalloc(sizeof(keyid_t) *
+ NTP_MAXSESSION);
+
+ /*
+ * Generate an initial key ID which is unique and greater than
+ * NTP_MAXKEY.
+ */
+ while (1) {
+ keyid = ntp_random() & 0xffffffff;
+ if (keyid <= NTP_MAXKEY)
+ continue;
+
+ if (authhavekey(keyid))
+ continue;
+ break;
+ }
+
+ /*
+ * Generate up to NTP_MAXSESSION session keys. Stop if the
+ * next one would not be unique or not a session key ID or if
+ * it would expire before the next poll. The private value
+ * included in the hash is zero if broadcast mode, the peer
+ * cookie if client mode or the host cookie if symmetric modes.
+ */
+ mpoll = 1 << min(peer->ppoll, peer->hpoll);
+ lifetime = min(1U << sys_automax, NTP_MAXSESSION * mpoll);
+ if (peer->hmode == MODE_BROADCAST)
+ cookie = 0;
+ else
+ cookie = peer->pcookie;
+ for (i = 0; i < NTP_MAXSESSION; i++) {
+ peer->keylist[i] = keyid;
+ peer->keynumber = i;
+ keyid = session_key(&dstadr->sin, &peer->srcadr, keyid,
+ cookie, lifetime + mpoll);
+ lifetime -= mpoll;
+ if (auth_havekey(keyid) || keyid <= NTP_MAXKEY ||
+ lifetime < 0 || tstamp == 0)
+ break;
+ }
+
+ /*
+ * Save the last session key ID, sequence number and timestamp,
+ * then sign these values for later retrieval by the clients. Be
+ * careful not to use invalid key media. Use the public values
+ * timestamp as filestamp.
+ */
+ vp = &peer->sndval;
+ if (vp->ptr == NULL)
+ vp->ptr = emalloc(sizeof(struct autokey));
+ ap = (struct autokey *)vp->ptr;
+ ap->seq = htonl(peer->keynumber);
+ ap->key = htonl(keyid);
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = hostval.tstamp;
+ vp->vallen = htonl(sizeof(struct autokey));
+ vp->siglen = 0;
+ if (tstamp != 0) {
+ if (vp->sig == NULL)
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)vp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, sizeof(struct autokey));
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
+ vp->siglen = htonl(sign_siglen);
+ peer->flags |= FLAG_ASSOC;
+ }
+ }
+#ifdef DEBUG
+ if (debug)
+ printf("make_keys: %d %08x %08x ts %u fs %u poll %d\n",
+ peer->keynumber, keyid, cookie, ntohl(vp->tstamp),
+ ntohl(vp->fstamp), peer->hpoll);
+#endif
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_recv - parse extension fields
+ *
+ * This routine is called when the packet has been matched to an
+ * association and passed sanity, format and MAC checks. We believe the
+ * extension field values only if the field has proper format and
+ * length, the timestamp and filestamp are valid and the signature has
+ * valid length and is verified. There are a few cases where some values
+ * are believed even if the signature fails, but only if the proventic
+ * bit is not set.
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ * XEVNT_LEN bad field format or length
+ */
+int
+crypto_recv(
+ struct peer *peer, /* peer structure pointer */
+ struct recvbuf *rbufp /* packet buffer pointer */
+ )
+{
+ const EVP_MD *dp; /* message digest algorithm */
+ u_int32 *pkt; /* receive packet pointer */
+ struct autokey *ap, *bp; /* autokey pointer */
+ struct exten *ep, *fp; /* extension pointers */
+ struct cert_info *xinfo; /* certificate info pointer */
+ int has_mac; /* length of MAC field */
+ int authlen; /* offset of MAC field */
+ associd_t associd; /* association ID */
+ tstamp_t tstamp = 0; /* timestamp */
+ tstamp_t fstamp = 0; /* filestamp */
+ u_int len; /* extension field length */
+ u_int code; /* extension field opcode */
+ u_int vallen = 0; /* value length */
+ X509 *cert; /* X509 certificate */
+ char statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
+ keyid_t cookie; /* crumbles */
+ int hismode; /* packet mode */
+ int rval = XEVNT_OK;
+ const u_char *puch;
+ u_int32 temp32;
+
+ /*
+ * Initialize. Note that the packet has already been checked for
+ * valid format and extension field lengths. First extract the
+ * field length, command code and association ID in host byte
+ * order. These are used with all commands and modes. Then check
+ * the version number, which must be 2, and length, which must
+ * be at least 8 for requests and VALUE_LEN (24) for responses.
+ * Packets that fail either test sink without a trace. The
+ * association ID is saved only if nonzero.
+ */
+ authlen = LEN_PKT_NOMAC;
+ hismode = (int)PKT_MODE((&rbufp->recv_pkt)->li_vn_mode);
+ while ((has_mac = rbufp->recv_length - authlen) > MAX_MAC_LEN) {
+ pkt = (u_int32 *)&rbufp->recv_pkt + authlen / 4;
+ ep = (struct exten *)pkt;
+ code = ntohl(ep->opcode) & 0xffff0000;
+ len = ntohl(ep->opcode) & 0x0000ffff;
+ associd = (associd_t)ntohl(pkt[1]);
+ rval = XEVNT_OK;
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "crypto_recv: flags 0x%x ext offset %d len %u code 0x%x associd %d\n",
+ peer->crypto, authlen, len, code >> 16,
+ associd);
+#endif
+
+ /*
+ * Check version number and field length. If bad,
+ * quietly ignore the packet.
+ */
+ if (((code >> 24) & 0x3f) != CRYPTO_VN || len < 8) {
+ sys_badlength++;
+ code |= CRYPTO_ERROR;
+ }
+
+ if (len >= VALUE_LEN) {
+ tstamp = ntohl(ep->tstamp);
+ fstamp = ntohl(ep->fstamp);
+ vallen = ntohl(ep->vallen);
+ }
+ switch (code) {
+
+ /*
+ * Install status word, host name, signature scheme and
+ * association ID. In OpenSSL the signature algorithm is
+ * bound to the digest algorithm, so the NID completely
+ * defines the signature scheme. Note the request and
+ * response are identical, but neither is validated by
+ * signature. The request is processed here only in
+ * symmetric modes. The server name field might be
+ * useful to implement access controls in future.
+ */
+ case CRYPTO_ASSOC:
+
+ /*
+ * If our state machine is running when this
+ * message arrives, the other fellow might have
+ * restarted. However, this could be an
+ * intruder, so just clamp the poll interval and
+ * find out for ourselves. Otherwise, pass the
+ * extension field to the transmit side.
+ */
+ if (peer->crypto & CRYPTO_FLAG_CERT) {
+ rval = XEVNT_ERR;
+ break;
+ }
+ if (peer->cmmd) {
+ if (peer->assoc != associd) {
+ rval = XEVNT_ERR;
+ break;
+ }
+ }
+ fp = emalloc(len);
+ memcpy(fp, ep, len);
+ fp->associd = htonl(peer->associd);
+ peer->cmmd = fp;
+ /* fall through */
+
+ case CRYPTO_ASSOC | CRYPTO_RESP:
+
+ /*
+ * Discard the message if it has already been
+ * stored or the message has been amputated.
+ */
+ if (peer->crypto) {
+ if (peer->assoc != associd)
+ rval = XEVNT_ERR;
+ break;
+ }
+ if (vallen == 0 || vallen > MAXHOSTNAME ||
+ len < VALUE_LEN + vallen) {
+ rval = XEVNT_LEN;
+ break;
+ }
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "crypto_recv: ident host 0x%x %d server 0x%x %d\n",
+ crypto_flags, peer->associd, fstamp,
+ peer->assoc);
+#endif
+ temp32 = crypto_flags & CRYPTO_FLAG_MASK;
+
+ /*
+ * If the client scheme is PC, the server scheme
+ * must be PC. The public key and identity are
+ * presumed valid, so we skip the certificate
+ * and identity exchanges and move immediately
+ * to the cookie exchange which confirms the
+ * server signature.
+ */
+ if (crypto_flags & CRYPTO_FLAG_PRIV) {
+ if (!(fstamp & CRYPTO_FLAG_PRIV)) {
+ rval = XEVNT_KEY;
+ break;
+ }
+ fstamp |= CRYPTO_FLAG_CERT |
+ CRYPTO_FLAG_VRFY | CRYPTO_FLAG_SIGN;
+
+ /*
+ * It is an error if either peer supports
+ * identity, but the other does not.
+ */
+ } else if (hismode == MODE_ACTIVE || hismode ==
+ MODE_PASSIVE) {
+ if ((temp32 && !(fstamp &
+ CRYPTO_FLAG_MASK)) ||
+ (!temp32 && (fstamp &
+ CRYPTO_FLAG_MASK))) {
+ rval = XEVNT_KEY;
+ break;
+ }
+ }
+
+ /*
+ * Discard the message if the signature digest
+ * NID is not supported.
+ */
+ temp32 = (fstamp >> 16) & 0xffff;
+ dp =
+ (const EVP_MD *)EVP_get_digestbynid(temp32);
+ if (dp == NULL) {
+ rval = XEVNT_MD;
+ break;
+ }
+
+ /*
+ * Save status word, host name and message
+ * digest/signature type. If this is from a
+ * broadcast and the association ID has changed,
+ * request the autokey values.
+ */
+ peer->assoc = associd;
+ if (hismode == MODE_SERVER)
+ fstamp |= CRYPTO_FLAG_AUTO;
+ if (!(fstamp & CRYPTO_FLAG_TAI))
+ fstamp |= CRYPTO_FLAG_LEAP;
+ RAND_bytes((u_char *)&peer->hcookie, 4);
+ peer->crypto = fstamp;
+ peer->digest = dp;
+ if (peer->subject != NULL)
+ free(peer->subject);
+ peer->subject = emalloc(vallen + 1);
+ memcpy(peer->subject, ep->pkt, vallen);
+ peer->subject[vallen] = '\0';
+ if (peer->issuer != NULL)
+ free(peer->issuer);
+ peer->issuer = estrdup(peer->subject);
+ snprintf(statstr, sizeof(statstr),
+ "assoc %d %d host %s %s", peer->associd,
+ peer->assoc, peer->subject,
+ OBJ_nid2ln(temp32));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * Decode X509 certificate in ASN.1 format and extract
+ * the data containing, among other things, subject
+ * name and public key. In the default identification
+ * scheme, the certificate trail is followed to a self
+ * signed trusted certificate.
+ */
+ case CRYPTO_CERT | CRYPTO_RESP:
+
+ /*
+ * Discard the message if empty or invalid.
+ */
+ if (len < VALUE_LEN)
+ break;
+
+ if ((rval = crypto_verify(ep, NULL, peer)) !=
+ XEVNT_OK)
+ break;
+
+ /*
+ * Scan the certificate list to delete old
+ * versions and link the newest version first on
+ * the list. Then, verify the signature. If the
+ * certificate is bad or missing, just ignore
+ * it.
+ */
+ if ((xinfo = cert_install(ep, peer)) == NULL) {
+ rval = XEVNT_CRT;
+ break;
+ }
+ if ((rval = cert_hike(peer, xinfo)) != XEVNT_OK)
+ break;
+
+ /*
+ * We plug in the public key and lifetime from
+ * the first certificate received. However, note
+ * that this certificate might not be signed by
+ * the server, so we can't check the
+ * signature/digest NID.
+ */
+ if (peer->pkey == NULL) {
+ puch = xinfo->cert.ptr;
+ cert = d2i_X509(NULL, &puch,
+ ntohl(xinfo->cert.vallen));
+ peer->pkey = X509_get_pubkey(cert);
+ X509_free(cert);
+ }
+ peer->flash &= ~TEST8;
+ temp32 = xinfo->nid;
+ snprintf(statstr, sizeof(statstr),
+ "cert %s %s 0x%x %s (%u) fs %u",
+ xinfo->subject, xinfo->issuer, xinfo->flags,
+ OBJ_nid2ln(temp32), temp32,
+ ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * Schnorr (IFF) identity scheme. This scheme is
+ * designed for use with shared secret server group keys
+ * and where the certificate may be generated by a third
+ * party. The client sends a challenge to the server,
+ * which performs a calculation and returns the result.
+ * A positive result is possible only if both client and
+ * server contain the same secret group key.
+ */
+ case CRYPTO_IFF | CRYPTO_RESP:
+
+ /*
+ * Discard the message if invalid.
+ */
+ if ((rval = crypto_verify(ep, NULL, peer)) !=
+ XEVNT_OK)
+ break;
+
+ /*
+ * If the challenge matches the response, the
+ * server public key, signature and identity are
+ * all verified at the same time. The server is
+ * declared trusted, so we skip further
+ * certificate exchanges and move immediately to
+ * the cookie exchange.
+ */
+ if ((rval = crypto_iff(ep, peer)) != XEVNT_OK)
+ break;
+
+ peer->crypto |= CRYPTO_FLAG_VRFY;
+ peer->flash &= ~TEST8;
+ snprintf(statstr, sizeof(statstr), "iff %s fs %u",
+ peer->issuer, ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * Guillou-Quisquater (GQ) identity scheme. This scheme
+ * is designed for use with public certificates carrying
+ * the GQ public key in an extension field. The client
+ * sends a challenge to the server, which performs a
+ * calculation and returns the result. A positive result
+ * is possible only if both client and server contain
+ * the same group key and the server has the matching GQ
+ * private key.
+ */
+ case CRYPTO_GQ | CRYPTO_RESP:
+
+ /*
+ * Discard the message if invalid
+ */
+ if ((rval = crypto_verify(ep, NULL, peer)) !=
+ XEVNT_OK)
+ break;
+
+ /*
+ * If the challenge matches the response, the
+ * server public key, signature and identity are
+ * all verified at the same time. The server is
+ * declared trusted, so we skip further
+ * certificate exchanges and move immediately to
+ * the cookie exchange.
+ */
+ if ((rval = crypto_gq(ep, peer)) != XEVNT_OK)
+ break;
+
+ peer->crypto |= CRYPTO_FLAG_VRFY;
+ peer->flash &= ~TEST8;
+ snprintf(statstr, sizeof(statstr), "gq %s fs %u",
+ peer->issuer, ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * Mu-Varadharajan (MV) identity scheme. This scheme is
+ * designed for use with three levels of trust, trusted
+ * host, server and client. The trusted host key is
+ * opaque to servers and clients; the server keys are
+ * opaque to clients and each client key is different.
+ * Client keys can be revoked without requiring new key
+ * generations.
+ */
+ case CRYPTO_MV | CRYPTO_RESP:
+
+ /*
+ * Discard the message if invalid.
+ */
+ if ((rval = crypto_verify(ep, NULL, peer)) !=
+ XEVNT_OK)
+ break;
+
+ /*
+ * If the challenge matches the response, the
+ * server public key, signature and identity are
+ * all verified at the same time. The server is
+ * declared trusted, so we skip further
+ * certificate exchanges and move immediately to
+ * the cookie exchange.
+ */
+ if ((rval = crypto_mv(ep, peer)) != XEVNT_OK)
+ break;
+
+ peer->crypto |= CRYPTO_FLAG_VRFY;
+ peer->flash &= ~TEST8;
+ snprintf(statstr, sizeof(statstr), "mv %s fs %u",
+ peer->issuer, ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+
+ /*
+ * Cookie response in client and symmetric modes. If the
+ * cookie bit is set, the working cookie is the EXOR of
+ * the current and new values.
+ */
+ case CRYPTO_COOK | CRYPTO_RESP:
+
+ /*
+ * Discard the message if invalid or signature
+ * not verified with respect to the cookie
+ * values.
+ */
+ if ((rval = crypto_verify(ep, &peer->cookval,
+ peer)) != XEVNT_OK)
+ break;
+
+ /*
+ * Decrypt the cookie, hunting all the time for
+ * errors.
+ */
+ if (vallen == (u_int)EVP_PKEY_size(host_pkey)) {
+ if (RSA_private_decrypt(vallen,
+ (u_char *)ep->pkt,
+ (u_char *)&temp32,
+ host_pkey->pkey.rsa,
+ RSA_PKCS1_OAEP_PADDING) <= 0) {
+ rval = XEVNT_CKY;
+ break;
+ } else {
+ cookie = ntohl(temp32);
+ }
+ } else {
+ rval = XEVNT_CKY;
+ break;
+ }
+
+ /*
+ * Install cookie values and light the cookie
+ * bit. If this is not broadcast client mode, we
+ * are done here.
+ */
+ key_expire(peer);
+ if (hismode == MODE_ACTIVE || hismode ==
+ MODE_PASSIVE)
+ peer->pcookie = peer->hcookie ^ cookie;
+ else
+ peer->pcookie = cookie;
+ peer->crypto |= CRYPTO_FLAG_COOK;
+ peer->flash &= ~TEST8;
+ snprintf(statstr, sizeof(statstr),
+ "cook %x ts %u fs %u", peer->pcookie,
+ ntohl(ep->tstamp), ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * Install autokey values in broadcast client and
+ * symmetric modes. We have to do this every time the
+ * sever/peer cookie changes or a new keylist is
+ * rolled. Ordinarily, this is automatic as this message
+ * is piggybacked on the first NTP packet sent upon
+ * either of these events. Note that a broadcast client
+ * or symmetric peer can receive this response without a
+ * matching request.
+ */
+ case CRYPTO_AUTO | CRYPTO_RESP:
+
+ /*
+ * Discard the message if invalid or signature
+ * not verified with respect to the receive
+ * autokey values.
+ */
+ if ((rval = crypto_verify(ep, &peer->recval,
+ peer)) != XEVNT_OK)
+ break;
+
+ /*
+ * Discard the message if a broadcast client and
+ * the association ID does not match. This might
+ * happen if a broacast server restarts the
+ * protocol. A protocol restart will occur at
+ * the next ASSOC message.
+ */
+ if ((peer->cast_flags & MDF_BCLNT) &&
+ peer->assoc != associd)
+ break;
+
+ /*
+ * Install autokey values and light the
+ * autokey bit. This is not hard.
+ */
+ if (ep->tstamp == 0)
+ break;
+
+ if (peer->recval.ptr == NULL)
+ peer->recval.ptr =
+ emalloc(sizeof(struct autokey));
+ bp = (struct autokey *)peer->recval.ptr;
+ peer->recval.tstamp = ep->tstamp;
+ peer->recval.fstamp = ep->fstamp;
+ ap = (struct autokey *)ep->pkt;
+ bp->seq = ntohl(ap->seq);
+ bp->key = ntohl(ap->key);
+ peer->pkeyid = bp->key;
+ peer->crypto |= CRYPTO_FLAG_AUTO;
+ peer->flash &= ~TEST8;
+ snprintf(statstr, sizeof(statstr),
+ "auto seq %d key %x ts %u fs %u", bp->seq,
+ bp->key, ntohl(ep->tstamp),
+ ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * X509 certificate sign response. Validate the
+ * certificate signed by the server and install. Later
+ * this can be provided to clients of this server in
+ * lieu of the self signed certificate in order to
+ * validate the public key.
+ */
+ case CRYPTO_SIGN | CRYPTO_RESP:
+
+ /*
+ * Discard the message if invalid.
+ */
+ if ((rval = crypto_verify(ep, NULL, peer)) !=
+ XEVNT_OK)
+ break;
+
+ /*
+ * Scan the certificate list to delete old
+ * versions and link the newest version first on
+ * the list.
+ */
+ if ((xinfo = cert_install(ep, peer)) == NULL) {
+ rval = XEVNT_CRT;
+ break;
+ }
+ peer->crypto |= CRYPTO_FLAG_SIGN;
+ peer->flash &= ~TEST8;
+ temp32 = xinfo->nid;
+ snprintf(statstr, sizeof(statstr),
+ "sign %s %s 0x%x %s (%u) fs %u",
+ xinfo->subject, xinfo->issuer, xinfo->flags,
+ OBJ_nid2ln(temp32), temp32,
+ ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * Install leapseconds values. While the leapsecond
+ * values epoch, TAI offset and values expiration epoch
+ * are retained, only the current TAI offset is provided
+ * via the kernel to other applications.
+ */
+ case CRYPTO_LEAP | CRYPTO_RESP:
+ /*
+ * Discard the message if invalid. We can't
+ * compare the value timestamps here, as they
+ * can be updated by different servers.
+ */
+ if ((rval = crypto_verify(ep, NULL, peer)) !=
+ XEVNT_OK)
+ break;
+
+ /*
+ * If the packet leap values are more recent
+ * than the stored ones, install the new leap
+ * values and recompute the signatures.
+ */
+ if (leapsec_add_fix(ntohl(ep->pkt[0]),
+ ntohl(ep->pkt[1]),
+ ntohl(ep->pkt[2]),
+ NULL))
+ {
+ leap_signature_t lsig;
+
+ leapsec_getsig(&lsig);
+ tai_leap.tstamp = ep->tstamp;
+ tai_leap.fstamp = ep->fstamp;
+ tai_leap.vallen = ep->vallen;
+ crypto_update();
+ mprintf_event(EVNT_TAI, peer,
+ "%d leap %s expire %s", lsig.taiof,
+ fstostr(lsig.ttime),
+ fstostr(lsig.etime));
+ }
+ peer->crypto |= CRYPTO_FLAG_LEAP;
+ peer->flash &= ~TEST8;
+ snprintf(statstr, sizeof(statstr),
+ "leap TAI offset %d at %u expire %u fs %u",
+ ntohl(ep->pkt[0]), ntohl(ep->pkt[1]),
+ ntohl(ep->pkt[2]), ntohl(ep->fstamp));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ break;
+
+ /*
+ * We come here in symmetric modes for miscellaneous
+ * commands that have value fields but are processed on
+ * the transmit side. All we need do here is check for
+ * valid field length. Note that ASSOC is handled
+ * separately.
+ */
+ case CRYPTO_CERT:
+ case CRYPTO_IFF:
+ case CRYPTO_GQ:
+ case CRYPTO_MV:
+ case CRYPTO_COOK:
+ case CRYPTO_SIGN:
+ if (len < VALUE_LEN) {
+ rval = XEVNT_LEN;
+ break;
+ }
+ /* fall through */
+
+ /*
+ * We come here in symmetric modes for requests
+ * requiring a response (above plus AUTO and LEAP) and
+ * for responses. If a request, save the extension field
+ * for later; invalid requests will be caught on the
+ * transmit side. If an error or invalid response,
+ * declare a protocol error.
+ */
+ default:
+ if (code & (CRYPTO_RESP | CRYPTO_ERROR)) {
+ rval = XEVNT_ERR;
+ } else if (peer->cmmd == NULL) {
+ fp = emalloc(len);
+ memcpy(fp, ep, len);
+ peer->cmmd = fp;
+ }
+ }
+
+ /*
+ * The first error found terminates the extension field
+ * scan and we return the laundry to the caller.
+ */
+ if (rval != XEVNT_OK) {
+ snprintf(statstr, sizeof(statstr),
+ "%04x %d %02x %s", htonl(ep->opcode),
+ associd, rval, eventstr(rval));
+ record_crypto_stats(&peer->srcadr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_recv: %s\n", statstr);
+#endif
+ return (rval);
+ }
+ authlen += (len + 3) / 4 * 4;
+ }
+ return (rval);
+}
+
+
+/*
+ * crypto_xmit - construct extension fields
+ *
+ * This routine is called both when an association is configured and
+ * when one is not. The only case where this matters is to retrieve the
+ * autokey information, in which case the caller has to provide the
+ * association ID to match the association.
+ *
+ * Side effect: update the packet offset.
+ *
+ * Errors
+ * XEVNT_OK success
+ * XEVNT_CRT bad or missing certificate
+ * XEVNT_ERR protocol error
+ * XEVNT_LEN bad field format or length
+ * XEVNT_PER host certificate expired
+ */
+int
+crypto_xmit(
+ struct peer *peer, /* peer structure pointer */
+ struct pkt *xpkt, /* transmit packet pointer */
+ struct recvbuf *rbufp, /* receive buffer pointer */
+ int start, /* offset to extension field */
+ struct exten *ep, /* extension pointer */
+ keyid_t cookie /* session cookie */
+ )
+{
+ struct exten *fp; /* extension pointers */
+ struct cert_info *cp, *xp, *yp; /* cert info/value pointer */
+ sockaddr_u *srcadr_sin; /* source address */
+ u_int32 *pkt; /* packet pointer */
+ u_int opcode; /* extension field opcode */
+ char certname[MAXHOSTNAME + 1]; /* subject name buffer */
+ char statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
+ tstamp_t tstamp;
+ struct calendar tscal;
+ u_int vallen;
+ struct value vtemp;
+ associd_t associd;
+ int rval;
+ int len;
+ keyid_t tcookie;
+
+ /*
+ * Generate the requested extension field request code, length
+ * and association ID. If this is a response and the host is not
+ * synchronized, light the error bit and go home.
+ */
+ pkt = (u_int32 *)xpkt + start / 4;
+ fp = (struct exten *)pkt;
+ opcode = ntohl(ep->opcode);
+ if (peer != NULL) {
+ srcadr_sin = &peer->srcadr;
+ if (!(opcode & CRYPTO_RESP))
+ peer->opcode = ep->opcode;
+ } else {
+ srcadr_sin = &rbufp->recv_srcadr;
+ }
+ associd = (associd_t) ntohl(ep->associd);
+ len = 8;
+ fp->opcode = htonl((opcode & 0xffff0000) | len);
+ fp->associd = ep->associd;
+ rval = XEVNT_OK;
+ tstamp = crypto_time();
+ switch (opcode & 0xffff0000) {
+
+ /*
+ * Send association request and response with status word and
+ * host name. Note, this message is not signed and the filestamp
+ * contains only the status word.
+ */
+ case CRYPTO_ASSOC:
+ case CRYPTO_ASSOC | CRYPTO_RESP:
+ len = crypto_send(fp, &hostval, start);
+ fp->fstamp = htonl(crypto_flags);
+ break;
+
+ /*
+ * Send certificate request. Use the values from the extension
+ * field.
+ */
+ case CRYPTO_CERT:
+ memset(&vtemp, 0, sizeof(vtemp));
+ vtemp.tstamp = ep->tstamp;
+ vtemp.fstamp = ep->fstamp;
+ vtemp.vallen = ep->vallen;
+ vtemp.ptr = (u_char *)ep->pkt;
+ len = crypto_send(fp, &vtemp, start);
+ break;
+
+ /*
+ * Send sign request. Use the host certificate, which is self-
+ * signed and may or may not be trusted.
+ */
+ case CRYPTO_SIGN:
+ (void)ntpcal_ntp_to_date(&tscal, tstamp, NULL);
+ if ((calcomp(&tscal, &(cert_host->first)) < 0)
+ || (calcomp(&tscal, &(cert_host->last)) > 0))
+ rval = XEVNT_PER;
+ else
+ len = crypto_send(fp, &cert_host->cert, start);
+ break;
+
+ /*
+ * Send certificate response. Use the name in the extension
+ * field to find the certificate in the cache. If the request
+ * contains no subject name, assume the name of this host. This
+ * is for backwards compatibility. Private certificates are
+ * never sent.
+ *
+ * There may be several certificates matching the request. First
+ * choice is a self-signed trusted certificate; second choice is
+ * any certificate signed by another host. There is no third
+ * choice.
+ */
+ case CRYPTO_CERT | CRYPTO_RESP:
+ vallen = ntohl(ep->vallen);
+ if (vallen == 0 || vallen > MAXHOSTNAME) {
+ rval = XEVNT_LEN;
+ break;
+ }
+
+ /*
+ * Find all public valid certificates with matching
+ * subject. If a self-signed, trusted certificate is
+ * found, use that certificate. If not, use the last non
+ * self-signed certificate.
+ */
+ memcpy(certname, ep->pkt, vallen);
+ certname[vallen] = '\0';
+ xp = yp = NULL;
+ for (cp = cinfo; cp != NULL; cp = cp->link) {
+ if (cp->flags & (CERT_PRIV | CERT_ERROR))
+ continue;
+
+ if (strcmp(certname, cp->subject) != 0)
+ continue;
+
+ if (strcmp(certname, cp->issuer) != 0)
+ yp = cp;
+ else if (cp ->flags & CERT_TRUST)
+ xp = cp;
+ continue;
+ }
+
+ /*
+ * Be careful who you trust. If the certificate is not
+ * found, return an empty response. Note that we dont
+ * enforce lifetimes here.
+ *
+ * The timestamp and filestamp are taken from the
+ * certificate value structure. For all certificates the
+ * timestamp is the latest signature update time. For
+ * host and imported certificates the filestamp is the
+ * creation epoch. For signed certificates the filestamp
+ * is the creation epoch of the trusted certificate at
+ * the root of the certificate trail. In principle, this
+ * allows strong checking for signature masquerade.
+ */
+ if (xp == NULL)
+ xp = yp;
+ if (xp == NULL)
+ break;
+
+ if (tstamp == 0)
+ break;
+
+ len = crypto_send(fp, &xp->cert, start);
+ break;
+
+ /*
+ * Send challenge in Schnorr (IFF) identity scheme.
+ */
+ case CRYPTO_IFF:
+ if (peer == NULL)
+ break; /* hack attack */
+
+ if ((rval = crypto_alice(peer, &vtemp)) == XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Send response in Schnorr (IFF) identity scheme.
+ */
+ case CRYPTO_IFF | CRYPTO_RESP:
+ if ((rval = crypto_bob(ep, &vtemp)) == XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Send challenge in Guillou-Quisquater (GQ) identity scheme.
+ */
+ case CRYPTO_GQ:
+ if (peer == NULL)
+ break; /* hack attack */
+
+ if ((rval = crypto_alice2(peer, &vtemp)) == XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Send response in Guillou-Quisquater (GQ) identity scheme.
+ */
+ case CRYPTO_GQ | CRYPTO_RESP:
+ if ((rval = crypto_bob2(ep, &vtemp)) == XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Send challenge in MV identity scheme.
+ */
+ case CRYPTO_MV:
+ if (peer == NULL)
+ break; /* hack attack */
+
+ if ((rval = crypto_alice3(peer, &vtemp)) == XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Send response in MV identity scheme.
+ */
+ case CRYPTO_MV | CRYPTO_RESP:
+ if ((rval = crypto_bob3(ep, &vtemp)) == XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Send certificate sign response. The integrity of the request
+ * certificate has already been verified on the receive side.
+ * Sign the response using the local server key. Use the
+ * filestamp from the request and use the timestamp as the
+ * current time. Light the error bit if the certificate is
+ * invalid or contains an unverified signature.
+ */
+ case CRYPTO_SIGN | CRYPTO_RESP:
+ if ((rval = cert_sign(ep, &vtemp)) == XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Send public key and signature. Use the values from the public
+ * key.
+ */
+ case CRYPTO_COOK:
+ len = crypto_send(fp, &pubkey, start);
+ break;
+
+ /*
+ * Encrypt and send cookie and signature. Light the error bit if
+ * anything goes wrong.
+ */
+ case CRYPTO_COOK | CRYPTO_RESP:
+ if ((opcode & 0xffff) < VALUE_LEN) {
+ rval = XEVNT_LEN;
+ break;
+ }
+ if (peer == NULL)
+ tcookie = cookie;
+ else
+ tcookie = peer->hcookie;
+ if ((rval = crypto_encrypt(ep, &vtemp, &tcookie)) ==
+ XEVNT_OK) {
+ len = crypto_send(fp, &vtemp, start);
+ value_free(&vtemp);
+ }
+ break;
+
+ /*
+ * Find peer and send autokey data and signature in broadcast
+ * server and symmetric modes. Use the values in the autokey
+ * structure. If no association is found, either the server has
+ * restarted with new associations or some perp has replayed an
+ * old message, in which case light the error bit.
+ */
+ case CRYPTO_AUTO | CRYPTO_RESP:
+ if (peer == NULL) {
+ if ((peer = findpeerbyassoc(associd)) == NULL) {
+ rval = XEVNT_ERR;
+ break;
+ }
+ }
+ peer->flags &= ~FLAG_ASSOC;
+ len = crypto_send(fp, &peer->sndval, start);
+ break;
+
+ /*
+ * Send leapseconds values and signature. Use the values from
+ * the tai structure. If no table has been loaded, just send an
+ * empty request.
+ */
+ case CRYPTO_LEAP | CRYPTO_RESP:
+ len = crypto_send(fp, &tai_leap, start);
+ break;
+
+ /*
+ * Default - Send a valid command for unknown requests; send
+ * an error response for unknown resonses.
+ */
+ default:
+ if (opcode & CRYPTO_RESP)
+ rval = XEVNT_ERR;
+ }
+
+ /*
+ * In case of error, flame the log. If a request, toss the
+ * puppy; if a response, return so the sender can flame, too.
+ */
+ if (rval != XEVNT_OK) {
+ u_int32 uint32;
+
+ uint32 = CRYPTO_ERROR;
+ opcode |= uint32;
+ fp->opcode |= htonl(uint32);
+ snprintf(statstr, sizeof(statstr),
+ "%04x %d %02x %s", opcode, associd, rval,
+ eventstr(rval));
+ record_crypto_stats(srcadr_sin, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_xmit: %s\n", statstr);
+#endif
+ if (!(opcode & CRYPTO_RESP))
+ return (0);
+ }
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "crypto_xmit: flags 0x%x offset %d len %d code 0x%x associd %d\n",
+ crypto_flags, start, len, opcode >> 16, associd);
+#endif
+ return (len);
+}
+
+
+/*
+ * crypto_verify - verify the extension field value and signature
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ * XEVNT_FSP bad filestamp
+ * XEVNT_LEN bad field format or length
+ * XEVNT_PUB bad or missing public key
+ * XEVNT_SGL bad signature length
+ * XEVNT_SIG signature not verified
+ * XEVNT_TSP bad timestamp
+ */
+static int
+crypto_verify(
+ struct exten *ep, /* extension pointer */
+ struct value *vp, /* value pointer */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ EVP_PKEY *pkey; /* server public key */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp, tstamp1 = 0; /* timestamp */
+ tstamp_t fstamp, fstamp1 = 0; /* filestamp */
+ u_int vallen; /* value length */
+ u_int siglen; /* signature length */
+ u_int opcode, len;
+ int i;
+
+ /*
+ * We are extremely parannoyed. We require valid opcode, length,
+ * association ID, timestamp, filestamp, public key, digest,
+ * signature length and signature, where relevant. Note that
+ * preliminary length checks are done in the main loop.
+ */
+ len = ntohl(ep->opcode) & 0x0000ffff;
+ opcode = ntohl(ep->opcode) & 0xffff0000;
+
+ /*
+ * Check for valid value header, association ID and extension
+ * field length. Remember, it is not an error to receive an
+ * unsolicited response; however, the response ID must match
+ * the association ID.
+ */
+ if (opcode & CRYPTO_ERROR)
+ return (XEVNT_ERR);
+
+ if (len < VALUE_LEN)
+ return (XEVNT_LEN);
+
+ if (opcode == (CRYPTO_AUTO | CRYPTO_RESP) && (peer->pmode ==
+ MODE_BROADCAST || (peer->cast_flags & MDF_BCLNT))) {
+ if (ntohl(ep->associd) != peer->assoc)
+ return (XEVNT_ERR);
+ } else {
+ if (ntohl(ep->associd) != peer->associd)
+ return (XEVNT_ERR);
+ }
+
+ /*
+ * We have a valid value header. Check for valid value and
+ * signature field lengths. The extension field length must be
+ * long enough to contain the value header, value and signature.
+ * Note both the value and signature field lengths are rounded
+ * up to the next word (4 octets).
+ */
+ vallen = ntohl(ep->vallen);
+ if (vallen == 0)
+ return (XEVNT_LEN);
+
+ i = (vallen + 3) / 4;
+ siglen = ntohl(ep->pkt[i++]);
+ if (len < VALUE_LEN + ((vallen + 3) / 4) * 4 + ((siglen + 3) /
+ 4) * 4)
+ return (XEVNT_LEN);
+
+ /*
+ * Check for valid timestamp and filestamp. If the timestamp is
+ * zero, the sender is not synchronized and signatures are
+ * not possible. If nonzero the timestamp must not precede the
+ * filestamp. The timestamp and filestamp must not precede the
+ * corresponding values in the value structure, if present.
+ */
+ tstamp = ntohl(ep->tstamp);
+ fstamp = ntohl(ep->fstamp);
+ if (tstamp == 0)
+ return (XEVNT_TSP);
+
+ if (tstamp < fstamp)
+ return (XEVNT_TSP);
+
+ if (vp != NULL) {
+ tstamp1 = ntohl(vp->tstamp);
+ fstamp1 = ntohl(vp->fstamp);
+ if (tstamp1 != 0 && fstamp1 != 0) {
+ if (tstamp < tstamp1)
+ return (XEVNT_TSP);
+
+ if ((tstamp < fstamp1 || fstamp < fstamp1))
+ return (XEVNT_FSP);
+ }
+ }
+
+ /*
+ * At the time the certificate message is validated, the public
+ * key in the message is not available. Thus, don't try to
+ * verify the signature.
+ */
+ if (opcode == (CRYPTO_CERT | CRYPTO_RESP))
+ return (XEVNT_OK);
+
+ /*
+ * Check for valid signature length, public key and digest
+ * algorithm.
+ */
+ if (crypto_flags & peer->crypto & CRYPTO_FLAG_PRIV)
+ pkey = sign_pkey;
+ else
+ pkey = peer->pkey;
+ if (siglen == 0 || pkey == NULL || peer->digest == NULL)
+ return (XEVNT_ERR);
+
+ if (siglen != (u_int)EVP_PKEY_size(pkey))
+ return (XEVNT_SGL);
+
+ /*
+ * Darn, I thought we would never get here. Verify the
+ * signature. If the identity exchange is verified, light the
+ * proventic bit. What a relief.
+ */
+ EVP_VerifyInit(&ctx, peer->digest);
+ EVP_VerifyUpdate(&ctx, (u_char *)&ep->tstamp, vallen + 12);
+ if (EVP_VerifyFinal(&ctx, (u_char *)&ep->pkt[i], siglen,
+ pkey) <= 0)
+ return (XEVNT_SIG);
+
+ if (peer->crypto & CRYPTO_FLAG_VRFY)
+ peer->crypto |= CRYPTO_FLAG_PROV;
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_encrypt - construct encrypted cookie and signature from
+ * extension field and cookie
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_CKY bad or missing cookie
+ * XEVNT_PUB bad or missing public key
+ */
+static int
+crypto_encrypt(
+ struct exten *ep, /* extension pointer */
+ struct value *vp, /* value pointer */
+ keyid_t *cookie /* server cookie */
+ )
+{
+ EVP_PKEY *pkey; /* public key */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp; /* NTP timestamp */
+ u_int32 temp32;
+ u_int len;
+ const u_char *ptr;
+ u_char *puch;
+
+ /*
+ * Extract the public key from the request.
+ */
+ len = ntohl(ep->vallen);
+ ptr = (void *)ep->pkt;
+ pkey = d2i_PublicKey(EVP_PKEY_RSA, NULL, &ptr, len);
+ if (pkey == NULL) {
+ msyslog(LOG_ERR, "crypto_encrypt: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_PUB);
+ }
+
+ /*
+ * Encrypt the cookie, encode in ASN.1 and sign.
+ */
+ memset(vp, 0, sizeof(struct value));
+ tstamp = crypto_time();
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = hostval.tstamp;
+ len = EVP_PKEY_size(pkey);
+ vp->vallen = htonl(len);
+ vp->ptr = emalloc(len);
+ puch = vp->ptr;
+ temp32 = htonl(*cookie);
+ if (RSA_public_encrypt(4, (u_char *)&temp32, puch,
+ pkey->pkey.rsa, RSA_PKCS1_OAEP_PADDING) <= 0) {
+ msyslog(LOG_ERR, "crypto_encrypt: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ free(vp->ptr);
+ EVP_PKEY_free(pkey);
+ return (XEVNT_CKY);
+ }
+ EVP_PKEY_free(pkey);
+ if (tstamp == 0)
+ return (XEVNT_OK);
+
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_ident - construct extension field for identity scheme
+ *
+ * This routine determines which identity scheme is in use and
+ * constructs an extension field for that scheme.
+ *
+ * Returns
+ * CRYTPO_IFF IFF scheme
+ * CRYPTO_GQ GQ scheme
+ * CRYPTO_MV MV scheme
+ * CRYPTO_NULL no available scheme
+ */
+u_int
+crypto_ident(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ char filename[MAXFILENAME];
+ const char * scheme_name;
+ u_int scheme_id;
+
+ /*
+ * We come here after the group trusted host has been found; its
+ * name defines the group name. Search the key cache for all
+ * keys matching the same group name in order IFF, GQ and MV.
+ * Use the first one available.
+ */
+ scheme_name = NULL;
+ if (peer->crypto & CRYPTO_FLAG_IFF) {
+ scheme_name = "iff";
+ scheme_id = CRYPTO_IFF;
+ } else if (peer->crypto & CRYPTO_FLAG_GQ) {
+ scheme_name = "gq";
+ scheme_id = CRYPTO_GQ;
+ } else if (peer->crypto & CRYPTO_FLAG_MV) {
+ scheme_name = "mv";
+ scheme_id = CRYPTO_MV;
+ }
+
+ if (scheme_name != NULL) {
+ snprintf(filename, sizeof(filename), "ntpkey_%spar_%s",
+ scheme_name, peer->ident);
+ peer->ident_pkey = crypto_key(filename, NULL,
+ &peer->srcadr);
+ if (peer->ident_pkey != NULL)
+ return scheme_id;
+ }
+
+ msyslog(LOG_NOTICE,
+ "crypto_ident: no identity parameters found for group %s",
+ peer->ident);
+
+ return CRYPTO_NULL;
+}
+
+
+/*
+ * crypto_args - construct extension field from arguments
+ *
+ * This routine creates an extension field with current timestamps and
+ * specified opcode, association ID and optional string. Note that the
+ * extension field is created here, but freed after the crypto_xmit()
+ * call in the protocol module.
+ *
+ * Returns extension field pointer (no errors)
+ */
+struct exten *
+crypto_args(
+ struct peer *peer, /* peer structure pointer */
+ u_int opcode, /* operation code */
+ associd_t associd, /* association ID */
+ char *str /* argument string */
+ )
+{
+ tstamp_t tstamp; /* NTP timestamp */
+ struct exten *ep; /* extension field pointer */
+ u_int len; /* extension field length */
+
+ tstamp = crypto_time();
+ len = sizeof(struct exten);
+ if (str != NULL)
+ len += strlen(str);
+ ep = emalloc_zero(len);
+ if (opcode == 0)
+ return (ep);
+
+ ep->opcode = htonl(opcode + len);
+ ep->associd = htonl(associd);
+ ep->tstamp = htonl(tstamp);
+ ep->fstamp = hostval.tstamp;
+ ep->vallen = 0;
+ if (str != NULL) {
+ ep->vallen = htonl(strlen(str));
+ memcpy((char *)ep->pkt, str, strlen(str));
+ }
+ return (ep);
+}
+
+
+/*
+ * crypto_send - construct extension field from value components
+ *
+ * The value and signature fields are zero-padded to a word boundary.
+ * Note: it is not polite to send a nonempty signature with zero
+ * timestamp or a nonzero timestamp with an empty signature, but those
+ * rules are not enforced here.
+ */
+int
+crypto_send(
+ struct exten *ep, /* extension field pointer */
+ struct value *vp, /* value pointer */
+ int start /* buffer offset */
+ )
+{
+ u_int len, vallen, siglen, opcode;
+ int i, j;
+
+ /*
+ * Calculate extension field length and check for buffer
+ * overflow. Leave room for the MAC.
+ */
+ len = 16;
+ vallen = ntohl(vp->vallen);
+ len += ((vallen + 3) / 4 + 1) * 4;
+ siglen = ntohl(vp->siglen);
+ len += ((siglen + 3) / 4 + 1) * 4;
+ if (start + len > sizeof(struct pkt) - MAX_MAC_LEN)
+ return (0);
+
+ /*
+ * Copy timestamps.
+ */
+ ep->tstamp = vp->tstamp;
+ ep->fstamp = vp->fstamp;
+ ep->vallen = vp->vallen;
+
+ /*
+ * Copy value. If the data field is empty or zero length,
+ * encode an empty value with length zero.
+ */
+ i = 0;
+ if (vallen > 0 && vp->ptr != NULL) {
+ j = vallen / 4;
+ if (j * 4 < (int)vallen)
+ ep->pkt[i + j++] = 0;
+ memcpy(&ep->pkt[i], vp->ptr, vallen);
+ i += j;
+ }
+
+ /*
+ * Copy signature. If the signature field is empty or zero
+ * length, encode an empty signature with length zero.
+ */
+ ep->pkt[i++] = vp->siglen;
+ if (siglen > 0 && vp->sig != NULL) {
+ j = siglen / 4;
+ if (j * 4 < (int)siglen)
+ ep->pkt[i + j++] = 0;
+ memcpy(&ep->pkt[i], vp->sig, siglen);
+ i += j;
+ }
+ opcode = ntohl(ep->opcode);
+ ep->opcode = htonl((opcode & 0xffff0000) | len);
+ return (len);
+}
+
+
+/*
+ * crypto_update - compute new public value and sign extension fields
+ *
+ * This routine runs periodically, like once a day, and when something
+ * changes. It updates the timestamps on three value structures and one
+ * value structure list, then signs all the structures:
+ *
+ * hostval host name (not signed)
+ * pubkey public key
+ * cinfo certificate info/value list
+ * tai_leap leap values
+ *
+ * Filestamps are proventic data, so this routine runs only when the
+ * host is synchronized to a proventicated source. Thus, the timestamp
+ * is proventic and can be used to deflect clogging attacks.
+ *
+ * Returns void (no errors)
+ */
+void
+crypto_update(void)
+{
+ EVP_MD_CTX ctx; /* message digest context */
+ struct cert_info *cp; /* certificate info/value */
+ char statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
+ u_int32 *ptr;
+ u_int len;
+ leap_signature_t lsig;
+
+ hostval.tstamp = htonl(crypto_time());
+ if (hostval.tstamp == 0)
+ return;
+
+
+ /*
+ * Sign public key and timestamps. The filestamp is derived from
+ * the host key file extension from wherever the file was
+ * generated.
+ */
+ if (pubkey.vallen != 0) {
+ pubkey.tstamp = hostval.tstamp;
+ pubkey.siglen = 0;
+ if (pubkey.sig == NULL)
+ pubkey.sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&pubkey, 12);
+ EVP_SignUpdate(&ctx, pubkey.ptr, ntohl(pubkey.vallen));
+ if (EVP_SignFinal(&ctx, pubkey.sig, &len, sign_pkey))
+ pubkey.siglen = htonl(sign_siglen);
+ }
+
+ /*
+ * Sign certificates and timestamps. The filestamp is derived
+ * from the certificate file extension from wherever the file
+ * was generated. Note we do not throw expired certificates
+ * away; they may have signed younger ones.
+ */
+ for (cp = cinfo; cp != NULL; cp = cp->link) {
+ cp->cert.tstamp = hostval.tstamp;
+ cp->cert.siglen = 0;
+ if (cp->cert.sig == NULL)
+ cp->cert.sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&cp->cert, 12);
+ EVP_SignUpdate(&ctx, cp->cert.ptr,
+ ntohl(cp->cert.vallen));
+ if (EVP_SignFinal(&ctx, cp->cert.sig, &len, sign_pkey))
+ cp->cert.siglen = htonl(sign_siglen);
+ }
+
+ /*
+ * Sign leapseconds values and timestamps. Note it is not an
+ * error to return null values.
+ */
+ tai_leap.tstamp = hostval.tstamp;
+ tai_leap.fstamp = hostval.fstamp;
+ len = 3 * sizeof(u_int32);
+ if (tai_leap.ptr == NULL)
+ tai_leap.ptr = emalloc(len);
+ tai_leap.vallen = htonl(len);
+ ptr = (u_int32 *)tai_leap.ptr;
+ leapsec_getsig(&lsig);
+ ptr[0] = htonl(lsig.taiof);
+ ptr[1] = htonl(lsig.ttime);
+ ptr[2] = htonl(lsig.etime);
+ if (tai_leap.sig == NULL)
+ tai_leap.sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&tai_leap, 12);
+ EVP_SignUpdate(&ctx, tai_leap.ptr, len);
+ if (EVP_SignFinal(&ctx, tai_leap.sig, &len, sign_pkey))
+ tai_leap.siglen = htonl(sign_siglen);
+ if (lsig.ttime > 0)
+ crypto_flags |= CRYPTO_FLAG_TAI;
+ snprintf(statstr, sizeof(statstr), "signature update ts %u",
+ ntohl(hostval.tstamp));
+ record_crypto_stats(NULL, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_update: %s\n", statstr);
+#endif
+}
+
+
+/*
+ * value_free - free value structure components.
+ *
+ * Returns void (no errors)
+ */
+void
+value_free(
+ struct value *vp /* value structure */
+ )
+{
+ if (vp->ptr != NULL)
+ free(vp->ptr);
+ if (vp->sig != NULL)
+ free(vp->sig);
+ memset(vp, 0, sizeof(struct value));
+}
+
+
+/*
+ * crypto_time - returns current NTP time.
+ *
+ * Returns NTP seconds if in synch, 0 otherwise
+ */
+tstamp_t
+crypto_time()
+{
+ l_fp tstamp; /* NTP time */
+
+ L_CLR(&tstamp);
+ if (sys_leap != LEAP_NOTINSYNC)
+ get_systime(&tstamp);
+ return (tstamp.l_ui);
+}
+
+
+/*
+ * asn_to_calendar - convert ASN1_TIME time structure to struct calendar.
+ *
+ */
+static
+void
+asn_to_calendar (
+ ASN1_TIME *asn1time, /* pointer to ASN1_TIME structure */
+ struct calendar *pjd /* pointer to result */
+ )
+{
+ int len; /* length of ASN1_TIME string */
+ char v[24]; /* writable copy of ASN1_TIME string */
+ unsigned long temp; /* result from strtoul */
+
+ /*
+ * Extract time string YYMMDDHHMMSSZ from ASN1 time structure.
+ * Or YYYYMMDDHHMMSSZ.
+ * Note that the YY, MM, DD fields start with one, the HH, MM,
+ * SS fields start with zero and the Z character is ignored.
+ * Also note that two-digit years less than 50 map to years greater than
+ * 100. Dontcha love ASN.1? Better than MIL-188.
+ */
+ len = asn1time->length;
+ NTP_REQUIRE(len < sizeof(v));
+ (void)strncpy(v, (char *)(asn1time->data), len);
+ NTP_REQUIRE(len >= 13);
+ temp = strtoul(v+len-3, NULL, 10);
+ pjd->second = temp;
+ v[len-3] = '\0';
+
+ temp = strtoul(v+len-5, NULL, 10);
+ pjd->minute = temp;
+ v[len-5] = '\0';
+
+ temp = strtoul(v+len-7, NULL, 10);
+ pjd->hour = temp;
+ v[len-7] = '\0';
+
+ temp = strtoul(v+len-9, NULL, 10);
+ pjd->monthday = temp;
+ v[len-9] = '\0';
+
+ temp = strtoul(v+len-11, NULL, 10);
+ pjd->month = temp;
+ v[len-11] = '\0';
+
+ temp = strtoul(v, NULL, 10);
+ /* handle two-digit years */
+ if (temp < 50UL)
+ temp += 100UL;
+ if (temp < 150UL)
+ temp += 1900UL;
+ pjd->year = temp;
+
+ pjd->yearday = pjd->weekday = 0;
+ return;
+}
+
+
+/*
+ * bigdig() - compute a BIGNUM MD5 hash of a BIGNUM number.
+ *
+ * Returns void (no errors)
+ */
+static void
+bighash(
+ BIGNUM *bn, /* BIGNUM * from */
+ BIGNUM *bk /* BIGNUM * to */
+ )
+{
+ EVP_MD_CTX ctx; /* message digest context */
+ u_char dgst[EVP_MAX_MD_SIZE]; /* message digest */
+ u_char *ptr; /* a BIGNUM as binary string */
+ u_int len;
+
+ len = BN_num_bytes(bn);
+ ptr = emalloc(len);
+ BN_bn2bin(bn, ptr);
+ EVP_DigestInit(&ctx, EVP_md5());
+ EVP_DigestUpdate(&ctx, ptr, len);
+ EVP_DigestFinal(&ctx, dgst, &len);
+ BN_bin2bn(dgst, len, bk);
+ free(ptr);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines implement the Schnorr (IFF) identity scheme *
+ * *
+ ***********************************************************************
+ *
+ * The Schnorr (IFF) identity scheme is intended for use when
+ * certificates are generated by some other trusted certificate
+ * authority and the certificate cannot be used to convey public
+ * parameters. There are two kinds of files: encrypted server files that
+ * contain private and public values and nonencrypted client files that
+ * contain only public values. New generations of server files must be
+ * securely transmitted to all servers of the group; client files can be
+ * distributed by any means. The scheme is self contained and
+ * independent of new generations of host keys, sign keys and
+ * certificates.
+ *
+ * The IFF values hide in a DSA cuckoo structure which uses the same
+ * parameters. The values are used by an identity scheme based on DSA
+ * cryptography and described in Stimson p. 285. The p is a 512-bit
+ * prime, g a generator of Zp* and q a 160-bit prime that divides p - 1
+ * and is a qth root of 1 mod p; that is, g^q = 1 mod p. The TA rolls a
+ * private random group key b (0 < b < q) and public key v = g^b, then
+ * sends (p, q, g, b) to the servers and (p, q, g, v) to the clients.
+ * Alice challenges Bob to confirm identity using the protocol described
+ * below.
+ *
+ * How it works
+ *
+ * The scheme goes like this. Both Alice and Bob have the public primes
+ * p, q and generator g. The TA gives private key b to Bob and public
+ * key v to Alice.
+ *
+ * Alice rolls new random challenge r (o < r < q) and sends to Bob in
+ * the IFF request message. Bob rolls new random k (0 < k < q), then
+ * computes y = k + b r mod q and x = g^k mod p and sends (y, hash(x))
+ * to Alice in the response message. Besides making the response
+ * shorter, the hash makes it effectivey impossible for an intruder to
+ * solve for b by observing a number of these messages.
+ *
+ * Alice receives the response and computes g^y v^r mod p. After a bit
+ * of algebra, this simplifies to g^k. If the hash of this result
+ * matches hash(x), Alice knows that Bob has the group key b. The signed
+ * response binds this knowledge to Bob's private key and the public key
+ * previously received in his certificate.
+ *
+ * crypto_alice - construct Alice's challenge in IFF scheme
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ID bad or missing group key
+ * XEVNT_PUB bad or missing public key
+ */
+static int
+crypto_alice(
+ struct peer *peer, /* peer pointer */
+ struct value *vp /* value pointer */
+ )
+{
+ DSA *dsa; /* IFF parameters */
+ BN_CTX *bctx; /* BIGNUM context */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp;
+ u_int len;
+
+ /*
+ * The identity parameters must have correct format and content.
+ */
+ if (peer->ident_pkey == NULL) {
+ msyslog(LOG_NOTICE, "crypto_alice: scheme unavailable");
+ return (XEVNT_ID);
+ }
+
+ if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
+ msyslog(LOG_NOTICE, "crypto_alice: defective key");
+ return (XEVNT_PUB);
+ }
+
+ /*
+ * Roll new random r (0 < r < q).
+ */
+ if (peer->iffval != NULL)
+ BN_free(peer->iffval);
+ peer->iffval = BN_new();
+ len = BN_num_bytes(dsa->q);
+ BN_rand(peer->iffval, len * 8, -1, 1); /* r mod q*/
+ bctx = BN_CTX_new();
+ BN_mod(peer->iffval, peer->iffval, dsa->q, bctx);
+ BN_CTX_free(bctx);
+
+ /*
+ * Sign and send to Bob. The filestamp is from the local file.
+ */
+ memset(vp, 0, sizeof(struct value));
+ tstamp = crypto_time();
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = htonl(peer->ident_pkey->fstamp);
+ vp->vallen = htonl(len);
+ vp->ptr = emalloc(len);
+ BN_bn2bin(peer->iffval, vp->ptr);
+ if (tstamp == 0)
+ return (XEVNT_OK);
+
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_bob - construct Bob's response to Alice's challenge
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ * XEVNT_ID bad or missing group key
+ */
+static int
+crypto_bob(
+ struct exten *ep, /* extension pointer */
+ struct value *vp /* value pointer */
+ )
+{
+ DSA *dsa; /* IFF parameters */
+ DSA_SIG *sdsa; /* DSA signature context fake */
+ BN_CTX *bctx; /* BIGNUM context */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp; /* NTP timestamp */
+ BIGNUM *bn, *bk, *r;
+ u_char *ptr;
+ u_int len;
+
+ /*
+ * If the IFF parameters are not valid, something awful
+ * happened or we are being tormented.
+ */
+ if (iffkey_info == NULL) {
+ msyslog(LOG_NOTICE, "crypto_bob: scheme unavailable");
+ return (XEVNT_ID);
+ }
+ dsa = iffkey_info->pkey->pkey.dsa;
+
+ /*
+ * Extract r from the challenge.
+ */
+ len = ntohl(ep->vallen);
+ if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
+ msyslog(LOG_ERR, "crypto_bob: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_ERR);
+ }
+
+ /*
+ * Bob rolls random k (0 < k < q), computes y = k + b r mod q
+ * and x = g^k mod p, then sends (y, hash(x)) to Alice.
+ */
+ bctx = BN_CTX_new(); bk = BN_new(); bn = BN_new();
+ sdsa = DSA_SIG_new();
+ BN_rand(bk, len * 8, -1, 1); /* k */
+ BN_mod_mul(bn, dsa->priv_key, r, dsa->q, bctx); /* b r mod q */
+ BN_add(bn, bn, bk);
+ BN_mod(bn, bn, dsa->q, bctx); /* k + b r mod q */
+ sdsa->r = BN_dup(bn);
+ BN_mod_exp(bk, dsa->g, bk, dsa->p, bctx); /* g^k mod p */
+ bighash(bk, bk);
+ sdsa->s = BN_dup(bk);
+ BN_CTX_free(bctx);
+ BN_free(r); BN_free(bn); BN_free(bk);
+#ifdef DEBUG
+ if (debug > 1)
+ DSA_print_fp(stdout, dsa, 0);
+#endif
+
+ /*
+ * Encode the values in ASN.1 and sign. The filestamp is from
+ * the local file.
+ */
+ len = i2d_DSA_SIG(sdsa, NULL);
+ if (len == 0) {
+ msyslog(LOG_ERR, "crypto_bob: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ DSA_SIG_free(sdsa);
+ return (XEVNT_ERR);
+ }
+ memset(vp, 0, sizeof(struct value));
+ tstamp = crypto_time();
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = htonl(iffkey_info->fstamp);
+ vp->vallen = htonl(len);
+ ptr = emalloc(len);
+ vp->ptr = ptr;
+ i2d_DSA_SIG(sdsa, &ptr);
+ DSA_SIG_free(sdsa);
+ if (tstamp == 0)
+ return (XEVNT_OK);
+
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_iff - verify Bob's response to Alice's challenge
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_FSP bad filestamp
+ * XEVNT_ID bad or missing group key
+ * XEVNT_PUB bad or missing public key
+ */
+int
+crypto_iff(
+ struct exten *ep, /* extension pointer */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ DSA *dsa; /* IFF parameters */
+ BN_CTX *bctx; /* BIGNUM context */
+ DSA_SIG *sdsa; /* DSA parameters */
+ BIGNUM *bn, *bk;
+ u_int len;
+ const u_char *ptr;
+ int temp;
+
+ /*
+ * If the IFF parameters are not valid or no challenge was sent,
+ * something awful happened or we are being tormented.
+ */
+ if (peer->ident_pkey == NULL) {
+ msyslog(LOG_NOTICE, "crypto_iff: scheme unavailable");
+ return (XEVNT_ID);
+ }
+ if (ntohl(ep->fstamp) != peer->ident_pkey->fstamp) {
+ msyslog(LOG_NOTICE, "crypto_iff: invalid filestamp %u",
+ ntohl(ep->fstamp));
+ return (XEVNT_FSP);
+ }
+ if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
+ msyslog(LOG_NOTICE, "crypto_iff: defective key");
+ return (XEVNT_PUB);
+ }
+ if (peer->iffval == NULL) {
+ msyslog(LOG_NOTICE, "crypto_iff: missing challenge");
+ return (XEVNT_ID);
+ }
+
+ /*
+ * Extract the k + b r and g^k values from the response.
+ */
+ bctx = BN_CTX_new(); bk = BN_new(); bn = BN_new();
+ len = ntohl(ep->vallen);
+ ptr = (u_char *)ep->pkt;
+ if ((sdsa = d2i_DSA_SIG(NULL, &ptr, len)) == NULL) {
+ BN_free(bn); BN_free(bk); BN_CTX_free(bctx);
+ msyslog(LOG_ERR, "crypto_iff: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_ERR);
+ }
+
+ /*
+ * Compute g^(k + b r) g^(q - b)r mod p.
+ */
+ BN_mod_exp(bn, dsa->pub_key, peer->iffval, dsa->p, bctx);
+ BN_mod_exp(bk, dsa->g, sdsa->r, dsa->p, bctx);
+ BN_mod_mul(bn, bn, bk, dsa->p, bctx);
+
+ /*
+ * Verify the hash of the result matches hash(x).
+ */
+ bighash(bn, bn);
+ temp = BN_cmp(bn, sdsa->s);
+ BN_free(bn); BN_free(bk); BN_CTX_free(bctx);
+ BN_free(peer->iffval);
+ peer->iffval = NULL;
+ DSA_SIG_free(sdsa);
+ if (temp == 0)
+ return (XEVNT_OK);
+
+ msyslog(LOG_NOTICE, "crypto_iff: identity not verified");
+ return (XEVNT_ID);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines implement the Guillou-Quisquater (GQ) *
+ * identity scheme *
+ * *
+ ***********************************************************************
+ *
+ * The Guillou-Quisquater (GQ) identity scheme is intended for use when
+ * the certificate can be used to convey public parameters. The scheme
+ * uses a X509v3 certificate extension field do convey the public key of
+ * a private key known only to servers. There are two kinds of files:
+ * encrypted server files that contain private and public values and
+ * nonencrypted client files that contain only public values. New
+ * generations of server files must be securely transmitted to all
+ * servers of the group; client files can be distributed by any means.
+ * The scheme is self contained and independent of new generations of
+ * host keys and sign keys. The scheme is self contained and independent
+ * of new generations of host keys and sign keys.
+ *
+ * The GQ parameters hide in a RSA cuckoo structure which uses the same
+ * parameters. The values are used by an identity scheme based on RSA
+ * cryptography and described in Stimson p. 300 (with errors). The 512-
+ * bit public modulus is n = p q, where p and q are secret large primes.
+ * The TA rolls private random group key b as RSA exponent. These values
+ * are known to all group members.
+ *
+ * When rolling new certificates, a server recomputes the private and
+ * public keys. The private key u is a random roll, while the public key
+ * is the inverse obscured by the group key v = (u^-1)^b. These values
+ * replace the private and public keys normally generated by the RSA
+ * scheme. Alice challenges Bob to confirm identity using the protocol
+ * described below.
+ *
+ * How it works
+ *
+ * The scheme goes like this. Both Alice and Bob have the same modulus n
+ * and some random b as the group key. These values are computed and
+ * distributed in advance via secret means, although only the group key
+ * b is truly secret. Each has a private random private key u and public
+ * key (u^-1)^b, although not necessarily the same ones. Bob and Alice
+ * can regenerate the key pair from time to time without affecting
+ * operations. The public key is conveyed on the certificate in an
+ * extension field; the private key is never revealed.
+ *
+ * Alice rolls new random challenge r and sends to Bob in the GQ
+ * request message. Bob rolls new random k, then computes y = k u^r mod
+ * n and x = k^b mod n and sends (y, hash(x)) to Alice in the response
+ * message. Besides making the response shorter, the hash makes it
+ * effectivey impossible for an intruder to solve for b by observing
+ * a number of these messages.
+ *
+ * Alice receives the response and computes y^b v^r mod n. After a bit
+ * of algebra, this simplifies to k^b. If the hash of this result
+ * matches hash(x), Alice knows that Bob has the group key b. The signed
+ * response binds this knowledge to Bob's private key and the public key
+ * previously received in his certificate.
+ *
+ * crypto_alice2 - construct Alice's challenge in GQ scheme
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ID bad or missing group key
+ * XEVNT_PUB bad or missing public key
+ */
+static int
+crypto_alice2(
+ struct peer *peer, /* peer pointer */
+ struct value *vp /* value pointer */
+ )
+{
+ RSA *rsa; /* GQ parameters */
+ BN_CTX *bctx; /* BIGNUM context */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp;
+ u_int len;
+
+ /*
+ * The identity parameters must have correct format and content.
+ */
+ if (peer->ident_pkey == NULL)
+ return (XEVNT_ID);
+
+ if ((rsa = peer->ident_pkey->pkey->pkey.rsa) == NULL) {
+ msyslog(LOG_NOTICE, "crypto_alice2: defective key");
+ return (XEVNT_PUB);
+ }
+
+ /*
+ * Roll new random r (0 < r < n).
+ */
+ if (peer->iffval != NULL)
+ BN_free(peer->iffval);
+ peer->iffval = BN_new();
+ len = BN_num_bytes(rsa->n);
+ BN_rand(peer->iffval, len * 8, -1, 1); /* r mod n */
+ bctx = BN_CTX_new();
+ BN_mod(peer->iffval, peer->iffval, rsa->n, bctx);
+ BN_CTX_free(bctx);
+
+ /*
+ * Sign and send to Bob. The filestamp is from the local file.
+ */
+ memset(vp, 0, sizeof(struct value));
+ tstamp = crypto_time();
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = htonl(peer->ident_pkey->fstamp);
+ vp->vallen = htonl(len);
+ vp->ptr = emalloc(len);
+ BN_bn2bin(peer->iffval, vp->ptr);
+ if (tstamp == 0)
+ return (XEVNT_OK);
+
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_bob2 - construct Bob's response to Alice's challenge
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ * XEVNT_ID bad or missing group key
+ */
+static int
+crypto_bob2(
+ struct exten *ep, /* extension pointer */
+ struct value *vp /* value pointer */
+ )
+{
+ RSA *rsa; /* GQ parameters */
+ DSA_SIG *sdsa; /* DSA parameters */
+ BN_CTX *bctx; /* BIGNUM context */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp; /* NTP timestamp */
+ BIGNUM *r, *k, *g, *y;
+ u_char *ptr;
+ u_int len;
+ int s_len;
+
+ /*
+ * If the GQ parameters are not valid, something awful
+ * happened or we are being tormented.
+ */
+ if (gqkey_info == NULL) {
+ msyslog(LOG_NOTICE, "crypto_bob2: scheme unavailable");
+ return (XEVNT_ID);
+ }
+ rsa = gqkey_info->pkey->pkey.rsa;
+
+ /*
+ * Extract r from the challenge.
+ */
+ len = ntohl(ep->vallen);
+ if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
+ msyslog(LOG_ERR, "crypto_bob2: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_ERR);
+ }
+
+ /*
+ * Bob rolls random k (0 < k < n), computes y = k u^r mod n and
+ * x = k^b mod n, then sends (y, hash(x)) to Alice.
+ */
+ bctx = BN_CTX_new(); k = BN_new(); g = BN_new(); y = BN_new();
+ sdsa = DSA_SIG_new();
+ BN_rand(k, len * 8, -1, 1); /* k */
+ BN_mod(k, k, rsa->n, bctx);
+ BN_mod_exp(y, rsa->p, r, rsa->n, bctx); /* u^r mod n */
+ BN_mod_mul(y, k, y, rsa->n, bctx); /* k u^r mod n */
+ sdsa->r = BN_dup(y);
+ BN_mod_exp(g, k, rsa->e, rsa->n, bctx); /* k^b mod n */
+ bighash(g, g);
+ sdsa->s = BN_dup(g);
+ BN_CTX_free(bctx);
+ BN_free(r); BN_free(k); BN_free(g); BN_free(y);
+#ifdef DEBUG
+ if (debug > 1)
+ RSA_print_fp(stdout, rsa, 0);
+#endif
+
+ /*
+ * Encode the values in ASN.1 and sign. The filestamp is from
+ * the local file.
+ */
+ len = s_len = i2d_DSA_SIG(sdsa, NULL);
+ if (s_len <= 0) {
+ msyslog(LOG_ERR, "crypto_bob2: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ DSA_SIG_free(sdsa);
+ return (XEVNT_ERR);
+ }
+ memset(vp, 0, sizeof(struct value));
+ tstamp = crypto_time();
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = htonl(gqkey_info->fstamp);
+ vp->vallen = htonl(len);
+ ptr = emalloc(len);
+ vp->ptr = ptr;
+ i2d_DSA_SIG(sdsa, &ptr);
+ DSA_SIG_free(sdsa);
+ if (tstamp == 0)
+ return (XEVNT_OK);
+
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_gq - verify Bob's response to Alice's challenge
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ * XEVNT_FSP bad filestamp
+ * XEVNT_ID bad or missing group keys
+ * XEVNT_PUB bad or missing public key
+ */
+int
+crypto_gq(
+ struct exten *ep, /* extension pointer */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ RSA *rsa; /* GQ parameters */
+ BN_CTX *bctx; /* BIGNUM context */
+ DSA_SIG *sdsa; /* RSA signature context fake */
+ BIGNUM *y, *v;
+ const u_char *ptr;
+ long len;
+ u_int temp;
+
+ /*
+ * If the GQ parameters are not valid or no challenge was sent,
+ * something awful happened or we are being tormented. Note that
+ * the filestamp on the local key file can be greater than on
+ * the remote parameter file if the keys have been refreshed.
+ */
+ if (peer->ident_pkey == NULL) {
+ msyslog(LOG_NOTICE, "crypto_gq: scheme unavailable");
+ return (XEVNT_ID);
+ }
+ if (ntohl(ep->fstamp) < peer->ident_pkey->fstamp) {
+ msyslog(LOG_NOTICE, "crypto_gq: invalid filestamp %u",
+ ntohl(ep->fstamp));
+ return (XEVNT_FSP);
+ }
+ if ((rsa = peer->ident_pkey->pkey->pkey.rsa) == NULL) {
+ msyslog(LOG_NOTICE, "crypto_gq: defective key");
+ return (XEVNT_PUB);
+ }
+ if (peer->iffval == NULL) {
+ msyslog(LOG_NOTICE, "crypto_gq: missing challenge");
+ return (XEVNT_ID);
+ }
+
+ /*
+ * Extract the y = k u^r and hash(x = k^b) values from the
+ * response.
+ */
+ bctx = BN_CTX_new(); y = BN_new(); v = BN_new();
+ len = ntohl(ep->vallen);
+ ptr = (u_char *)ep->pkt;
+ if ((sdsa = d2i_DSA_SIG(NULL, &ptr, len)) == NULL) {
+ BN_CTX_free(bctx); BN_free(y); BN_free(v);
+ msyslog(LOG_ERR, "crypto_gq: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_ERR);
+ }
+
+ /*
+ * Compute v^r y^b mod n.
+ */
+ if (peer->grpkey == NULL) {
+ msyslog(LOG_NOTICE, "crypto_gq: missing group key");
+ return (XEVNT_ID);
+ }
+ BN_mod_exp(v, peer->grpkey, peer->iffval, rsa->n, bctx);
+ /* v^r mod n */
+ BN_mod_exp(y, sdsa->r, rsa->e, rsa->n, bctx); /* y^b mod n */
+ BN_mod_mul(y, v, y, rsa->n, bctx); /* v^r y^b mod n */
+
+ /*
+ * Verify the hash of the result matches hash(x).
+ */
+ bighash(y, y);
+ temp = BN_cmp(y, sdsa->s);
+ BN_CTX_free(bctx); BN_free(y); BN_free(v);
+ BN_free(peer->iffval);
+ peer->iffval = NULL;
+ DSA_SIG_free(sdsa);
+ if (temp == 0)
+ return (XEVNT_OK);
+
+ msyslog(LOG_NOTICE, "crypto_gq: identity not verified");
+ return (XEVNT_ID);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines implement the Mu-Varadharajan (MV) identity *
+ * scheme *
+ * *
+ ***********************************************************************
+ *
+ * The Mu-Varadharajan (MV) cryptosystem was originally intended when
+ * servers broadcast messages to clients, but clients never send
+ * messages to servers. There is one encryption key for the server and a
+ * separate decryption key for each client. It operated something like a
+ * pay-per-view satellite broadcasting system where the session key is
+ * encrypted by the broadcaster and the decryption keys are held in a
+ * tamperproof set-top box.
+ *
+ * The MV parameters and private encryption key hide in a DSA cuckoo
+ * structure which uses the same parameters, but generated in a
+ * different way. The values are used in an encryption scheme similar to
+ * El Gamal cryptography and a polynomial formed from the expansion of
+ * product terms (x - x[j]), as described in Mu, Y., and V.
+ * Varadharajan: Robust and Secure Broadcasting, Proc. Indocrypt 2001,
+ * 223-231. The paper has significant errors and serious omissions.
+ *
+ * Let q be the product of n distinct primes s1[j] (j = 1...n), where
+ * each s1[j] has m significant bits. Let p be a prime p = 2 * q + 1, so
+ * that q and each s1[j] divide p - 1 and p has M = n * m + 1
+ * significant bits. Let g be a generator of Zp; that is, gcd(g, p - 1)
+ * = 1 and g^q = 1 mod p. We do modular arithmetic over Zq and then
+ * project into Zp* as exponents of g. Sometimes we have to compute an
+ * inverse b^-1 of random b in Zq, but for that purpose we require
+ * gcd(b, q) = 1. We expect M to be in the 500-bit range and n
+ * relatively small, like 30. These are the parameters of the scheme and
+ * they are expensive to compute.
+ *
+ * We set up an instance of the scheme as follows. A set of random
+ * values x[j] mod q (j = 1...n), are generated as the zeros of a
+ * polynomial of order n. The product terms (x - x[j]) are expanded to
+ * form coefficients a[i] mod q (i = 0...n) in powers of x. These are
+ * used as exponents of the generator g mod p to generate the private
+ * encryption key A. The pair (gbar, ghat) of public server keys and the
+ * pairs (xbar[j], xhat[j]) (j = 1...n) of private client keys are used
+ * to construct the decryption keys. The devil is in the details.
+ *
+ * This routine generates a private server encryption file including the
+ * private encryption key E and partial decryption keys gbar and ghat.
+ * It then generates public client decryption files including the public
+ * keys xbar[j] and xhat[j] for each client j. The partial decryption
+ * files are used to compute the inverse of E. These values are suitably
+ * blinded so secrets are not revealed.
+ *
+ * The distinguishing characteristic of this scheme is the capability to
+ * revoke keys. Included in the calculation of E, gbar and ghat is the
+ * product s = prod(s1[j]) (j = 1...n) above. If the factor s1[j] is
+ * subsequently removed from the product and E, gbar and ghat
+ * recomputed, the jth client will no longer be able to compute E^-1 and
+ * thus unable to decrypt the messageblock.
+ *
+ * How it works
+ *
+ * The scheme goes like this. Bob has the server values (p, E, q, gbar,
+ * ghat) and Alice has the client values (p, xbar, xhat).
+ *
+ * Alice rolls new random nonce r mod p and sends to Bob in the MV
+ * request message. Bob rolls random nonce k mod q, encrypts y = r E^k
+ * mod p and sends (y, gbar^k, ghat^k) to Alice.
+ *
+ * Alice receives the response and computes the inverse (E^k)^-1 from
+ * the partial decryption keys gbar^k, ghat^k, xbar and xhat. She then
+ * decrypts y and verifies it matches the original r. The signed
+ * response binds this knowledge to Bob's private key and the public key
+ * previously received in his certificate.
+ *
+ * crypto_alice3 - construct Alice's challenge in MV scheme
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ID bad or missing group key
+ * XEVNT_PUB bad or missing public key
+ */
+static int
+crypto_alice3(
+ struct peer *peer, /* peer pointer */
+ struct value *vp /* value pointer */
+ )
+{
+ DSA *dsa; /* MV parameters */
+ BN_CTX *bctx; /* BIGNUM context */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp;
+ u_int len;
+
+ /*
+ * The identity parameters must have correct format and content.
+ */
+ if (peer->ident_pkey == NULL)
+ return (XEVNT_ID);
+
+ if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
+ msyslog(LOG_NOTICE, "crypto_alice3: defective key");
+ return (XEVNT_PUB);
+ }
+
+ /*
+ * Roll new random r (0 < r < q).
+ */
+ if (peer->iffval != NULL)
+ BN_free(peer->iffval);
+ peer->iffval = BN_new();
+ len = BN_num_bytes(dsa->p);
+ BN_rand(peer->iffval, len * 8, -1, 1); /* r mod p */
+ bctx = BN_CTX_new();
+ BN_mod(peer->iffval, peer->iffval, dsa->p, bctx);
+ BN_CTX_free(bctx);
+
+ /*
+ * Sign and send to Bob. The filestamp is from the local file.
+ */
+ memset(vp, 0, sizeof(struct value));
+ tstamp = crypto_time();
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = htonl(peer->ident_pkey->fstamp);
+ vp->vallen = htonl(len);
+ vp->ptr = emalloc(len);
+ BN_bn2bin(peer->iffval, vp->ptr);
+ if (tstamp == 0)
+ return (XEVNT_OK);
+
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_bob3 - construct Bob's response to Alice's challenge
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ */
+static int
+crypto_bob3(
+ struct exten *ep, /* extension pointer */
+ struct value *vp /* value pointer */
+ )
+{
+ DSA *dsa; /* MV parameters */
+ DSA *sdsa; /* DSA signature context fake */
+ BN_CTX *bctx; /* BIGNUM context */
+ EVP_MD_CTX ctx; /* signature context */
+ tstamp_t tstamp; /* NTP timestamp */
+ BIGNUM *r, *k, *u;
+ u_char *ptr;
+ u_int len;
+
+ /*
+ * If the MV parameters are not valid, something awful
+ * happened or we are being tormented.
+ */
+ if (mvkey_info == NULL) {
+ msyslog(LOG_NOTICE, "crypto_bob3: scheme unavailable");
+ return (XEVNT_ID);
+ }
+ dsa = mvkey_info->pkey->pkey.dsa;
+
+ /*
+ * Extract r from the challenge.
+ */
+ len = ntohl(ep->vallen);
+ if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
+ msyslog(LOG_ERR, "crypto_bob3: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_ERR);
+ }
+
+ /*
+ * Bob rolls random k (0 < k < q), making sure it is not a
+ * factor of q. He then computes y = r A^k and sends (y, gbar^k,
+ * and ghat^k) to Alice.
+ */
+ bctx = BN_CTX_new(); k = BN_new(); u = BN_new();
+ sdsa = DSA_new();
+ sdsa->p = BN_new(); sdsa->q = BN_new(); sdsa->g = BN_new();
+ while (1) {
+ BN_rand(k, BN_num_bits(dsa->q), 0, 0);
+ BN_mod(k, k, dsa->q, bctx);
+ BN_gcd(u, k, dsa->q, bctx);
+ if (BN_is_one(u))
+ break;
+ }
+ BN_mod_exp(u, dsa->g, k, dsa->p, bctx); /* A^k r */
+ BN_mod_mul(sdsa->p, u, r, dsa->p, bctx);
+ BN_mod_exp(sdsa->q, dsa->priv_key, k, dsa->p, bctx); /* gbar */
+ BN_mod_exp(sdsa->g, dsa->pub_key, k, dsa->p, bctx); /* ghat */
+ BN_CTX_free(bctx); BN_free(k); BN_free(r); BN_free(u);
+#ifdef DEBUG
+ if (debug > 1)
+ DSA_print_fp(stdout, sdsa, 0);
+#endif
+
+ /*
+ * Encode the values in ASN.1 and sign. The filestamp is from
+ * the local file.
+ */
+ memset(vp, 0, sizeof(struct value));
+ tstamp = crypto_time();
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = htonl(mvkey_info->fstamp);
+ len = i2d_DSAparams(sdsa, NULL);
+ if (len == 0) {
+ msyslog(LOG_ERR, "crypto_bob3: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ DSA_free(sdsa);
+ return (XEVNT_ERR);
+ }
+ vp->vallen = htonl(len);
+ ptr = emalloc(len);
+ vp->ptr = ptr;
+ i2d_DSAparams(sdsa, &ptr);
+ DSA_free(sdsa);
+ if (tstamp == 0)
+ return (XEVNT_OK);
+
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * crypto_mv - verify Bob's response to Alice's challenge
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_ERR protocol error
+ * XEVNT_FSP bad filestamp
+ * XEVNT_ID bad or missing group key
+ * XEVNT_PUB bad or missing public key
+ */
+int
+crypto_mv(
+ struct exten *ep, /* extension pointer */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ DSA *dsa; /* MV parameters */
+ DSA *sdsa; /* DSA parameters */
+ BN_CTX *bctx; /* BIGNUM context */
+ BIGNUM *k, *u, *v;
+ u_int len;
+ const u_char *ptr;
+ int temp;
+
+ /*
+ * If the MV parameters are not valid or no challenge was sent,
+ * something awful happened or we are being tormented.
+ */
+ if (peer->ident_pkey == NULL) {
+ msyslog(LOG_NOTICE, "crypto_mv: scheme unavailable");
+ return (XEVNT_ID);
+ }
+ if (ntohl(ep->fstamp) != peer->ident_pkey->fstamp) {
+ msyslog(LOG_NOTICE, "crypto_mv: invalid filestamp %u",
+ ntohl(ep->fstamp));
+ return (XEVNT_FSP);
+ }
+ if ((dsa = peer->ident_pkey->pkey->pkey.dsa) == NULL) {
+ msyslog(LOG_NOTICE, "crypto_mv: defective key");
+ return (XEVNT_PUB);
+ }
+ if (peer->iffval == NULL) {
+ msyslog(LOG_NOTICE, "crypto_mv: missing challenge");
+ return (XEVNT_ID);
+ }
+
+ /*
+ * Extract the y, gbar and ghat values from the response.
+ */
+ bctx = BN_CTX_new(); k = BN_new(); u = BN_new(); v = BN_new();
+ len = ntohl(ep->vallen);
+ ptr = (u_char *)ep->pkt;
+ if ((sdsa = d2i_DSAparams(NULL, &ptr, len)) == NULL) {
+ msyslog(LOG_ERR, "crypto_mv: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_ERR);
+ }
+
+ /*
+ * Compute (gbar^xhat ghat^xbar) mod p.
+ */
+ BN_mod_exp(u, sdsa->q, dsa->pub_key, dsa->p, bctx);
+ BN_mod_exp(v, sdsa->g, dsa->priv_key, dsa->p, bctx);
+ BN_mod_mul(u, u, v, dsa->p, bctx);
+ BN_mod_mul(u, u, sdsa->p, dsa->p, bctx);
+
+ /*
+ * The result should match r.
+ */
+ temp = BN_cmp(u, peer->iffval);
+ BN_CTX_free(bctx); BN_free(k); BN_free(u); BN_free(v);
+ BN_free(peer->iffval);
+ peer->iffval = NULL;
+ DSA_free(sdsa);
+ if (temp == 0)
+ return (XEVNT_OK);
+
+ msyslog(LOG_NOTICE, "crypto_mv: identity not verified");
+ return (XEVNT_ID);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines are used to manipulate certificates *
+ * *
+ ***********************************************************************
+ */
+/*
+ * cert_sign - sign x509 certificate equest and update value structure.
+ *
+ * The certificate request includes a copy of the host certificate,
+ * which includes the version number, subject name and public key of the
+ * host. The resulting certificate includes these values plus the
+ * serial number, issuer name and valid interval of the server. The
+ * valid interval extends from the current time to the same time one
+ * year hence. This may extend the life of the signed certificate beyond
+ * that of the signer certificate.
+ *
+ * It is convenient to use the NTP seconds of the current time as the
+ * serial number. In the value structure the timestamp is the current
+ * time and the filestamp is taken from the extension field. Note this
+ * routine is called only when the client clock is synchronized to a
+ * proventic source, so timestamp comparisons are valid.
+ *
+ * The host certificate is valid from the time it was generated for a
+ * period of one year. A signed certificate is valid from the time of
+ * signature for a period of one year, but only the host certificate (or
+ * sign certificate if used) is actually used to encrypt and decrypt
+ * signatures. The signature trail is built from the client via the
+ * intermediate servers to the trusted server. Each signature on the
+ * trail must be valid at the time of signature, but it could happen
+ * that a signer certificate expire before the signed certificate, which
+ * remains valid until its expiration.
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_CRT bad or missing certificate
+ * XEVNT_PER host certificate expired
+ * XEVNT_PUB bad or missing public key
+ * XEVNT_VFY certificate not verified
+ */
+static int
+cert_sign(
+ struct exten *ep, /* extension field pointer */
+ struct value *vp /* value pointer */
+ )
+{
+ X509 *req; /* X509 certificate request */
+ X509 *cert; /* X509 certificate */
+ X509_EXTENSION *ext; /* certificate extension */
+ ASN1_INTEGER *serial; /* serial number */
+ X509_NAME *subj; /* distinguished (common) name */
+ EVP_PKEY *pkey; /* public key */
+ EVP_MD_CTX ctx; /* message digest context */
+ tstamp_t tstamp; /* NTP timestamp */
+ struct calendar tscal;
+ u_int len;
+ const u_char *cptr;
+ u_char *ptr;
+ int i, temp;
+
+ /*
+ * Decode ASN.1 objects and construct certificate structure.
+ * Make sure the system clock is synchronized to a proventic
+ * source.
+ */
+ tstamp = crypto_time();
+ if (tstamp == 0)
+ return (XEVNT_TSP);
+
+ cptr = (void *)ep->pkt;
+ if ((req = d2i_X509(NULL, &cptr, ntohl(ep->vallen))) == NULL) {
+ msyslog(LOG_ERR, "cert_sign: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (XEVNT_CRT);
+ }
+ /*
+ * Extract public key and check for errors.
+ */
+ if ((pkey = X509_get_pubkey(req)) == NULL) {
+ msyslog(LOG_ERR, "cert_sign: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ X509_free(req);
+ return (XEVNT_PUB);
+ }
+
+ /*
+ * Generate X509 certificate signed by this server. If this is a
+ * trusted host, the issuer name is the group name; otherwise,
+ * it is the host name. Also copy any extensions that might be
+ * present.
+ */
+ cert = X509_new();
+ X509_set_version(cert, X509_get_version(req));
+ serial = ASN1_INTEGER_new();
+ ASN1_INTEGER_set(serial, tstamp);
+ X509_set_serialNumber(cert, serial);
+ X509_gmtime_adj(X509_get_notBefore(cert), 0L);
+ X509_gmtime_adj(X509_get_notAfter(cert), YEAR);
+ subj = X509_get_issuer_name(cert);
+ X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC,
+ hostval.ptr, strlen(hostval.ptr), -1, 0);
+ subj = X509_get_subject_name(req);
+ X509_set_subject_name(cert, subj);
+ X509_set_pubkey(cert, pkey);
+ temp = X509_get_ext_count(req);
+ for (i = 0; i < temp; i++) {
+ ext = X509_get_ext(req, i);
+ INSIST(X509_add_ext(cert, ext, -1));
+ }
+ X509_free(req);
+
+ /*
+ * Sign and verify the client certificate, but only if the host
+ * certificate has not expired.
+ */
+ (void)ntpcal_ntp_to_date(&tscal, tstamp, NULL);
+ if ((calcomp(&tscal, &(cert_host->first)) < 0)
+ || (calcomp(&tscal, &(cert_host->last)) > 0)) {
+ X509_free(cert);
+ return (XEVNT_PER);
+ }
+ X509_sign(cert, sign_pkey, sign_digest);
+ if (X509_verify(cert, sign_pkey) <= 0) {
+ msyslog(LOG_ERR, "cert_sign: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ X509_free(cert);
+ return (XEVNT_VFY);
+ }
+ len = i2d_X509(cert, NULL);
+
+ /*
+ * Build and sign the value structure. We have to sign it here,
+ * since the response has to be returned right away. This is a
+ * clogging hazard.
+ */
+ memset(vp, 0, sizeof(struct value));
+ vp->tstamp = htonl(tstamp);
+ vp->fstamp = ep->fstamp;
+ vp->vallen = htonl(len);
+ vp->ptr = emalloc(len);
+ ptr = vp->ptr;
+ i2d_X509(cert, &ptr);
+ vp->siglen = 0;
+ if (tstamp != 0) {
+ vp->sig = emalloc(sign_siglen);
+ EVP_SignInit(&ctx, sign_digest);
+ EVP_SignUpdate(&ctx, (u_char *)vp, 12);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey))
+ vp->siglen = htonl(sign_siglen);
+ }
+#ifdef DEBUG
+ if (debug > 1)
+ X509_print_fp(stdout, cert);
+#endif
+ X509_free(cert);
+ return (XEVNT_OK);
+}
+
+
+/*
+ * cert_install - install certificate in certificate cache
+ *
+ * This routine encodes an extension field into a certificate info/value
+ * structure. It searches the certificate list for duplicates and
+ * expunges whichever is older. Finally, it inserts this certificate
+ * first on the list.
+ *
+ * Returns certificate info pointer if valid, NULL if not.
+ */
+struct cert_info *
+cert_install(
+ struct exten *ep, /* cert info/value */
+ struct peer *peer /* peer structure */
+ )
+{
+ struct cert_info *cp, *xp, **zp;
+
+ /*
+ * Parse and validate the signed certificate. If valid,
+ * construct the info/value structure; otherwise, scamper home
+ * empty handed.
+ */
+ if ((cp = cert_parse((u_char *)ep->pkt, (long)ntohl(ep->vallen),
+ (tstamp_t)ntohl(ep->fstamp))) == NULL)
+ return (NULL);
+
+ /*
+ * Scan certificate list looking for another certificate with
+ * the same subject and issuer. If another is found with the
+ * same or older filestamp, unlink it and return the goodies to
+ * the heap. If another is found with a later filestamp, discard
+ * the new one and leave the building with the old one.
+ *
+ * Make a note to study this issue again. An earlier certificate
+ * with a long lifetime might be overtaken by a later
+ * certificate with a short lifetime, thus invalidating the
+ * earlier signature. However, we gotta find a way to leak old
+ * stuff from the cache, so we do it anyway.
+ */
+ zp = &cinfo;
+ for (xp = cinfo; xp != NULL; xp = xp->link) {
+ if (strcmp(cp->subject, xp->subject) == 0 &&
+ strcmp(cp->issuer, xp->issuer) == 0) {
+ if (ntohl(cp->cert.fstamp) <=
+ ntohl(xp->cert.fstamp)) {
+ cert_free(cp);
+ cp = xp;
+ } else {
+ *zp = xp->link;
+ cert_free(xp);
+ xp = NULL;
+ }
+ break;
+ }
+ zp = &xp->link;
+ }
+ if (xp == NULL) {
+ cp->link = cinfo;
+ cinfo = cp;
+ }
+ cp->flags |= CERT_VALID;
+ crypto_update();
+ return (cp);
+}
+
+
+/*
+ * cert_hike - verify the signature using the issuer public key
+ *
+ * Returns
+ * XEVNT_OK success
+ * XEVNT_CRT bad or missing certificate
+ * XEVNT_PER host certificate expired
+ * XEVNT_VFY certificate not verified
+ */
+int
+cert_hike(
+ struct peer *peer, /* peer structure pointer */
+ struct cert_info *yp /* issuer certificate */
+ )
+{
+ struct cert_info *xp; /* subject certificate */
+ X509 *cert; /* X509 certificate */
+ const u_char *ptr;
+
+ /*
+ * Save the issuer on the new certificate, but remember the old
+ * one.
+ */
+ if (peer->issuer != NULL)
+ free(peer->issuer);
+ peer->issuer = estrdup(yp->issuer);
+ xp = peer->xinfo;
+ peer->xinfo = yp;
+
+ /*
+ * If subject Y matches issuer Y, then the certificate trail is
+ * complete. If Y is not trusted, the server certificate has yet
+ * been signed, so keep trying. Otherwise, save the group key
+ * and light the valid bit. If the host certificate is trusted,
+ * do not execute a sign exchange. If no identity scheme is in
+ * use, light the identity and proventic bits.
+ */
+ if (strcmp(yp->subject, yp->issuer) == 0) {
+ if (!(yp->flags & CERT_TRUST))
+ return (XEVNT_OK);
+
+ /*
+ * If the server has an an identity scheme, fetch the
+ * identity credentials. If not, the identity is
+ * verified only by the trusted certificate. The next
+ * signature will set the server proventic.
+ */
+ peer->crypto |= CRYPTO_FLAG_CERT;
+ peer->grpkey = yp->grpkey;
+ if (peer->ident == NULL || !(peer->crypto &
+ CRYPTO_FLAG_MASK))
+ peer->crypto |= CRYPTO_FLAG_VRFY;
+ }
+
+ /*
+ * If X exists, verify signature X using public key Y.
+ */
+ if (xp == NULL)
+ return (XEVNT_OK);
+
+ ptr = (u_char *)xp->cert.ptr;
+ cert = d2i_X509(NULL, &ptr, ntohl(xp->cert.vallen));
+ if (cert == NULL) {
+ xp->flags |= CERT_ERROR;
+ return (XEVNT_CRT);
+ }
+ if (X509_verify(cert, yp->pkey) <= 0) {
+ X509_free(cert);
+ xp->flags |= CERT_ERROR;
+ return (XEVNT_VFY);
+ }
+ X509_free(cert);
+
+ /*
+ * Signature X is valid only if it begins during the
+ * lifetime of Y.
+ */
+ if ((calcomp(&(xp->first), &(yp->first)) < 0)
+ || (calcomp(&(xp->first), &(yp->last)) > 0)) {
+ xp->flags |= CERT_ERROR;
+ return (XEVNT_PER);
+ }
+ xp->flags |= CERT_SIGN;
+ return (XEVNT_OK);
+}
+
+
+/*
+ * cert_parse - parse x509 certificate and create info/value structures.
+ *
+ * The server certificate includes the version number, issuer name,
+ * subject name, public key and valid date interval. If the issuer name
+ * is the same as the subject name, the certificate is self signed and
+ * valid only if the server is configured as trustable. If the names are
+ * different, another issuer has signed the server certificate and
+ * vouched for it. In this case the server certificate is valid if
+ * verified by the issuer public key.
+ *
+ * Returns certificate info/value pointer if valid, NULL if not.
+ */
+struct cert_info * /* certificate information structure */
+cert_parse(
+ const u_char *asn1cert, /* X509 certificate */
+ long len, /* certificate length */
+ tstamp_t fstamp /* filestamp */
+ )
+{
+ X509 *cert; /* X509 certificate */
+ X509_EXTENSION *ext; /* X509v3 extension */
+ struct cert_info *ret; /* certificate info/value */
+ BIO *bp;
+ char pathbuf[MAXFILENAME];
+ const u_char *ptr;
+ char *pch;
+ int temp, cnt, i;
+ struct calendar fscal;
+
+ /*
+ * Decode ASN.1 objects and construct certificate structure.
+ */
+ ptr = asn1cert;
+ if ((cert = d2i_X509(NULL, &ptr, len)) == NULL) {
+ msyslog(LOG_ERR, "cert_parse: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (NULL);
+ }
+#ifdef DEBUG
+ if (debug > 1)
+ X509_print_fp(stdout, cert);
+#endif
+
+ /*
+ * Extract version, subject name and public key.
+ */
+ ret = emalloc_zero(sizeof(*ret));
+ if ((ret->pkey = X509_get_pubkey(cert)) == NULL) {
+ msyslog(LOG_ERR, "cert_parse: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ cert_free(ret);
+ X509_free(cert);
+ return (NULL);
+ }
+ ret->version = X509_get_version(cert);
+ X509_NAME_oneline(X509_get_subject_name(cert), pathbuf,
+ sizeof(pathbuf));
+ pch = strstr(pathbuf, "CN=");
+ if (NULL == pch) {
+ msyslog(LOG_NOTICE, "cert_parse: invalid subject %s",
+ pathbuf);
+ cert_free(ret);
+ X509_free(cert);
+ return (NULL);
+ }
+ ret->subject = estrdup(pch + 3);
+
+ /*
+ * Extract remaining objects. Note that the NTP serial number is
+ * the NTP seconds at the time of signing, but this might not be
+ * the case for other authority. We don't bother to check the
+ * objects at this time, since the real crunch can happen only
+ * when the time is valid but not yet certificated.
+ */
+ ret->nid = OBJ_obj2nid(cert->cert_info->signature->algorithm);
+ ret->digest = (const EVP_MD *)EVP_get_digestbynid(ret->nid);
+ ret->serial =
+ (u_long)ASN1_INTEGER_get(X509_get_serialNumber(cert));
+ X509_NAME_oneline(X509_get_issuer_name(cert), pathbuf,
+ sizeof(pathbuf));
+ if ((pch = strstr(pathbuf, "CN=")) == NULL) {
+ msyslog(LOG_NOTICE, "cert_parse: invalid issuer %s",
+ pathbuf);
+ cert_free(ret);
+ X509_free(cert);
+ return (NULL);
+ }
+ ret->issuer = estrdup(pch + 3);
+ asn_to_calendar(X509_get_notBefore(cert), &(ret->first));
+ asn_to_calendar(X509_get_notAfter(cert), &(ret->last));
+
+ /*
+ * Extract extension fields. These are ad hoc ripoffs of
+ * currently assigned functions and will certainly be changed
+ * before prime time.
+ */
+ cnt = X509_get_ext_count(cert);
+ for (i = 0; i < cnt; i++) {
+ ext = X509_get_ext(cert, i);
+ temp = OBJ_obj2nid(ext->object);
+ switch (temp) {
+
+ /*
+ * If a key_usage field is present, we decode whether
+ * this is a trusted or private certificate. This is
+ * dorky; all we want is to compare NIDs, but OpenSSL
+ * insists on BIO text strings.
+ */
+ case NID_ext_key_usage:
+ bp = BIO_new(BIO_s_mem());
+ X509V3_EXT_print(bp, ext, 0, 0);
+ BIO_gets(bp, pathbuf, sizeof(pathbuf));
+ BIO_free(bp);
+ if (strcmp(pathbuf, "Trust Root") == 0)
+ ret->flags |= CERT_TRUST;
+ else if (strcmp(pathbuf, "Private") == 0)
+ ret->flags |= CERT_PRIV;
+#if DEBUG
+ if (debug)
+ printf("cert_parse: %s: %s\n",
+ OBJ_nid2ln(temp), pathbuf);
+#endif
+ break;
+
+ /*
+ * If a NID_subject_key_identifier field is present, it
+ * contains the GQ public key.
+ */
+ case NID_subject_key_identifier:
+ ret->grpkey = BN_bin2bn(&ext->value->data[2],
+ ext->value->length - 2, NULL);
+ /* fall through */
+#if DEBUG
+ default:
+ if (debug)
+ printf("cert_parse: %s\n",
+ OBJ_nid2ln(temp));
+#endif
+ }
+ }
+ if (strcmp(ret->subject, ret->issuer) == 0) {
+
+ /*
+ * If certificate is self signed, verify signature.
+ */
+ if (X509_verify(cert, ret->pkey) <= 0) {
+ msyslog(LOG_NOTICE,
+ "cert_parse: signature not verified %s",
+ ret->subject);
+ cert_free(ret);
+ X509_free(cert);
+ return (NULL);
+ }
+ } else {
+
+ /*
+ * Check for a certificate loop.
+ */
+ if (strcmp(hostval.ptr, ret->issuer) == 0) {
+ msyslog(LOG_NOTICE,
+ "cert_parse: certificate trail loop %s",
+ ret->subject);
+ cert_free(ret);
+ X509_free(cert);
+ return (NULL);
+ }
+ }
+
+ /*
+ * Verify certificate valid times. Note that certificates cannot
+ * be retroactive.
+ */
+ (void)ntpcal_ntp_to_date(&fscal, fstamp, NULL);
+ if ((calcomp(&(ret->first), &(ret->last)) > 0)
+ || (calcomp(&(ret->first), &fscal) < 0)) {
+ msyslog(LOG_NOTICE,
+ "cert_parse: invalid times %s first %u-%02u-%02uT%02u:%02u:%02u last %u-%02u-%02uT%02u:%02u:%02u fstamp %u-%02u-%02uT%02u:%02u:%02u",
+ ret->subject,
+ ret->first.year, ret->first.month, ret->first.monthday,
+ ret->first.hour, ret->first.minute, ret->first.second,
+ ret->last.year, ret->last.month, ret->last.monthday,
+ ret->last.hour, ret->last.minute, ret->last.second,
+ fscal.year, fscal.month, fscal.monthday,
+ fscal.hour, fscal.minute, fscal.second);
+ cert_free(ret);
+ X509_free(cert);
+ return (NULL);
+ }
+
+ /*
+ * Build the value structure to sign and send later.
+ */
+ ret->cert.fstamp = htonl(fstamp);
+ ret->cert.vallen = htonl(len);
+ ret->cert.ptr = emalloc(len);
+ memcpy(ret->cert.ptr, asn1cert, len);
+ X509_free(cert);
+ return (ret);
+}
+
+
+/*
+ * cert_free - free certificate information structure
+ */
+void
+cert_free(
+ struct cert_info *cinf /* certificate info/value structure */
+ )
+{
+ if (cinf->pkey != NULL)
+ EVP_PKEY_free(cinf->pkey);
+ if (cinf->subject != NULL)
+ free(cinf->subject);
+ if (cinf->issuer != NULL)
+ free(cinf->issuer);
+ if (cinf->grpkey != NULL)
+ BN_free(cinf->grpkey);
+ value_free(&cinf->cert);
+ free(cinf);
+}
+
+
+/*
+ * crypto_key - load cryptographic parameters and keys
+ *
+ * This routine searches the key cache for matching name in the form
+ * ntpkey_<key>_<name>, where <key> is one of host, sign, iff, gq, mv,
+ * and <name> is the host/group name. If not found, it tries to load a
+ * PEM-encoded file of the same name and extracts the filestamp from
+ * the first line of the file name. It returns the key pointer if valid,
+ * NULL if not.
+ */
+static struct pkey_info *
+crypto_key(
+ char *cp, /* file name */
+ char *passwd1, /* password */
+ sockaddr_u *addr /* IP address */
+ )
+{
+ FILE *str; /* file handle */
+ struct pkey_info *pkp; /* generic key */
+ EVP_PKEY *pkey = NULL; /* public/private key */
+ tstamp_t fstamp;
+ char filename[MAXFILENAME]; /* name of key file */
+ char linkname[MAXFILENAME]; /* filestamp buffer) */
+ char statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
+ char *ptr;
+
+ /*
+ * Search the key cache for matching key and name.
+ */
+ for (pkp = pkinfo; pkp != NULL; pkp = pkp->link) {
+ if (strcmp(cp, pkp->name) == 0)
+ return (pkp);
+ }
+
+ /*
+ * Open the key file. If the first character of the file name is
+ * not '/', prepend the keys directory string. If something goes
+ * wrong, abandon ship.
+ */
+ if (*cp == '/')
+ strlcpy(filename, cp, sizeof(filename));
+ else
+ snprintf(filename, sizeof(filename), "%s/%s", keysdir,
+ cp);
+ str = fopen(filename, "r");
+ if (str == NULL)
+ return (NULL);
+
+ /*
+ * Read the filestamp, which is contained in the first line.
+ */
+ if ((ptr = fgets(linkname, sizeof(linkname), str)) == NULL) {
+ msyslog(LOG_ERR, "crypto_key: empty file %s",
+ filename);
+ fclose(str);
+ return (NULL);
+ }
+ if ((ptr = strrchr(ptr, '.')) == NULL) {
+ msyslog(LOG_ERR, "crypto_key: no filestamp %s",
+ filename);
+ fclose(str);
+ return (NULL);
+ }
+ if (sscanf(++ptr, "%u", &fstamp) != 1) {
+ msyslog(LOG_ERR, "crypto_key: invalid filestamp %s",
+ filename);
+ fclose(str);
+ return (NULL);
+ }
+
+ /*
+ * Read and decrypt PEM-encoded private key. If it fails to
+ * decrypt, game over.
+ */
+ pkey = PEM_read_PrivateKey(str, NULL, NULL, passwd1);
+ fclose(str);
+ if (pkey == NULL) {
+ msyslog(LOG_ERR, "crypto_key: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ exit (-1);
+ }
+
+ /*
+ * Make a new entry in the key cache.
+ */
+ pkp = emalloc(sizeof(struct pkey_info));
+ pkp->link = pkinfo;
+ pkinfo = pkp;
+ pkp->pkey = pkey;
+ pkp->name = estrdup(cp);
+ pkp->fstamp = fstamp;
+
+ /*
+ * Leave tracks in the cryptostats.
+ */
+ if ((ptr = strrchr(linkname, '\n')) != NULL)
+ *ptr = '\0';
+ snprintf(statstr, sizeof(statstr), "%s mod %d", &linkname[2],
+ EVP_PKEY_size(pkey) * 8);
+ record_crypto_stats(addr, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_key: %s\n", statstr);
+ if (debug > 1) {
+ if (pkey->type == EVP_PKEY_DSA)
+ DSA_print_fp(stdout, pkey->pkey.dsa, 0);
+ else if (pkey->type == EVP_PKEY_RSA)
+ RSA_print_fp(stdout, pkey->pkey.rsa, 0);
+ }
+#endif
+ return (pkp);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines are used only at initialization time *
+ * *
+ ***********************************************************************
+ */
+/*
+ * crypto_cert - load certificate from file
+ *
+ * This routine loads an X.509 RSA or DSA certificate from a file and
+ * constructs a info/cert value structure for this machine. The
+ * structure includes a filestamp extracted from the file name. Later
+ * the certificate can be sent to another machine on request.
+ *
+ * Returns certificate info/value pointer if valid, NULL if not.
+ */
+static struct cert_info * /* certificate information */
+crypto_cert(
+ char *cp /* file name */
+ )
+{
+ struct cert_info *ret; /* certificate information */
+ FILE *str; /* file handle */
+ char filename[MAXFILENAME]; /* name of certificate file */
+ char linkname[MAXFILENAME]; /* filestamp buffer */
+ char statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
+ tstamp_t fstamp; /* filestamp */
+ long len;
+ char *ptr;
+ char *name, *header;
+ u_char *data;
+
+ /*
+ * Open the certificate file. If the first character of the file
+ * name is not '/', prepend the keys directory string. If
+ * something goes wrong, abandon ship.
+ */
+ if (*cp == '/')
+ strlcpy(filename, cp, sizeof(filename));
+ else
+ snprintf(filename, sizeof(filename), "%s/%s", keysdir,
+ cp);
+ str = fopen(filename, "r");
+ if (str == NULL)
+ return (NULL);
+
+ /*
+ * Read the filestamp, which is contained in the first line.
+ */
+ if ((ptr = fgets(linkname, sizeof(linkname), str)) == NULL) {
+ msyslog(LOG_ERR, "crypto_cert: empty file %s",
+ filename);
+ fclose(str);
+ return (NULL);
+ }
+ if ((ptr = strrchr(ptr, '.')) == NULL) {
+ msyslog(LOG_ERR, "crypto_cert: no filestamp %s",
+ filename);
+ fclose(str);
+ return (NULL);
+ }
+ if (sscanf(++ptr, "%u", &fstamp) != 1) {
+ msyslog(LOG_ERR, "crypto_cert: invalid filestamp %s",
+ filename);
+ fclose(str);
+ return (NULL);
+ }
+
+ /*
+ * Read PEM-encoded certificate and install.
+ */
+ if (!PEM_read(str, &name, &header, &data, &len)) {
+ msyslog(LOG_ERR, "crypto_cert: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ fclose(str);
+ return (NULL);
+ }
+ fclose(str);
+ free(header);
+ if (strcmp(name, "CERTIFICATE") != 0) {
+ msyslog(LOG_NOTICE, "crypto_cert: wrong PEM type %s",
+ name);
+ free(name);
+ free(data);
+ return (NULL);
+ }
+ free(name);
+
+ /*
+ * Parse certificate and generate info/value structure. The
+ * pointer and copy nonsense is due something broken in Solaris.
+ */
+ ret = cert_parse(data, len, fstamp);
+ free(data);
+ if (ret == NULL)
+ return (NULL);
+
+ if ((ptr = strrchr(linkname, '\n')) != NULL)
+ *ptr = '\0';
+ snprintf(statstr, sizeof(statstr), "%s 0x%x len %lu",
+ &linkname[2], ret->flags, len);
+ record_crypto_stats(NULL, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_cert: %s\n", statstr);
+#endif
+ return (ret);
+}
+
+
+/*
+ * crypto_setup - load keys, certificate and identity parameters
+ *
+ * This routine loads the public/private host key and certificate. If
+ * available, it loads the public/private sign key, which defaults to
+ * the host key. The host key must be RSA, but the sign key can be
+ * either RSA or DSA. If a trusted certificate, it loads the identity
+ * parameters. In either case, the public key on the certificate must
+ * agree with the sign key.
+ *
+ * Required but missing files and inconsistent data and errors are
+ * fatal. Allowing configuration to continue would be hazardous and
+ * require really messy error checks.
+ */
+void
+crypto_setup(void)
+{
+ struct pkey_info *pinfo; /* private/public key */
+ char filename[MAXFILENAME]; /* file name buffer */
+ char hostname[MAXFILENAME]; /* host name buffer */
+ char *randfile;
+ char statstr[NTP_MAXSTRLEN]; /* statistics for filegen */
+ l_fp seed; /* crypto PRNG seed as NTP timestamp */
+ u_int len;
+ int bytes;
+ u_char *ptr;
+
+ /*
+ * Check for correct OpenSSL version and avoid initialization in
+ * the case of multiple crypto commands.
+ */
+ if (crypto_flags & CRYPTO_FLAG_ENAB) {
+ msyslog(LOG_NOTICE,
+ "crypto_setup: spurious crypto command");
+ return;
+ }
+ ssl_check_version();
+
+ /*
+ * Load required random seed file and seed the random number
+ * generator. Be default, it is found as .rnd in the user home
+ * directory. The root home directory may be / or /root,
+ * depending on the system. Wiggle the contents a bit and write
+ * it back so the sequence does not repeat when we next restart.
+ */
+ if (!RAND_status()) {
+ if (rand_file == NULL) {
+ RAND_file_name(filename, sizeof(filename));
+ randfile = filename;
+ } else if (*rand_file != '/') {
+ snprintf(filename, sizeof(filename), "%s/%s",
+ keysdir, rand_file);
+ randfile = filename;
+ } else
+ randfile = rand_file;
+
+ if ((bytes = RAND_load_file(randfile, -1)) == 0) {
+ msyslog(LOG_ERR,
+ "crypto_setup: random seed file %s missing",
+ randfile);
+ exit (-1);
+ }
+ get_systime(&seed);
+ RAND_seed(&seed, sizeof(l_fp));
+ RAND_write_file(randfile);
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "crypto_setup: OpenSSL version %lx random seed file %s bytes read %d\n",
+ SSLeay(), randfile, bytes);
+#endif
+ }
+
+ /*
+ * Initialize structures.
+ */
+ gethostname(hostname, sizeof(hostname));
+ if (host_filename != NULL)
+ strlcpy(hostname, host_filename, sizeof(hostname));
+ if (passwd == NULL)
+ passwd = estrdup(hostname);
+ memset(&hostval, 0, sizeof(hostval));
+ memset(&pubkey, 0, sizeof(pubkey));
+ memset(&tai_leap, 0, sizeof(tai_leap));
+
+ /*
+ * Load required host key from file "ntpkey_host_<hostname>". If
+ * no host key file is not found or has invalid password, life
+ * as we know it ends. The host key also becomes the default
+ * sign key.
+ */
+ snprintf(filename, sizeof(filename), "ntpkey_host_%s", hostname);
+ pinfo = crypto_key(filename, passwd, NULL);
+ if (pinfo == NULL) {
+ msyslog(LOG_ERR,
+ "crypto_setup: host key file %s not found or corrupt",
+ filename);
+ exit (-1);
+ }
+ if (pinfo->pkey->type != EVP_PKEY_RSA) {
+ msyslog(LOG_ERR,
+ "crypto_setup: host key is not RSA key type");
+ exit (-1);
+ }
+ host_pkey = pinfo->pkey;
+ sign_pkey = host_pkey;
+ hostval.fstamp = htonl(pinfo->fstamp);
+
+ /*
+ * Construct public key extension field for agreement scheme.
+ */
+ len = i2d_PublicKey(host_pkey, NULL);
+ ptr = emalloc(len);
+ pubkey.ptr = ptr;
+ i2d_PublicKey(host_pkey, &ptr);
+ pubkey.fstamp = hostval.fstamp;
+ pubkey.vallen = htonl(len);
+
+ /*
+ * Load optional sign key from file "ntpkey_sign_<hostname>". If
+ * available, it becomes the sign key.
+ */
+ snprintf(filename, sizeof(filename), "ntpkey_sign_%s", hostname);
+ pinfo = crypto_key(filename, passwd, NULL);
+ if (pinfo != NULL)
+ sign_pkey = pinfo->pkey;
+
+ /*
+ * Load required certificate from file "ntpkey_cert_<hostname>".
+ */
+ snprintf(filename, sizeof(filename), "ntpkey_cert_%s", hostname);
+ cinfo = crypto_cert(filename);
+ if (cinfo == NULL) {
+ msyslog(LOG_ERR,
+ "crypto_setup: certificate file %s not found or corrupt",
+ filename);
+ exit (-1);
+ }
+ cert_host = cinfo;
+ sign_digest = cinfo->digest;
+ sign_siglen = EVP_PKEY_size(sign_pkey);
+ if (cinfo->flags & CERT_PRIV)
+ crypto_flags |= CRYPTO_FLAG_PRIV;
+
+ /*
+ * The certificate must be self-signed.
+ */
+ if (strcmp(cinfo->subject, cinfo->issuer) != 0) {
+ msyslog(LOG_ERR,
+ "crypto_setup: certificate %s is not self-signed",
+ filename);
+ exit (-1);
+ }
+ hostval.ptr = estrdup(cinfo->subject);
+ hostval.vallen = htonl(strlen(cinfo->subject));
+ sys_hostname = hostval.ptr;
+ ptr = (u_char *)strchr(sys_hostname, '@');
+ if (ptr != NULL)
+ sys_groupname = estrdup((char *)++ptr);
+ if (ident_filename != NULL)
+ strlcpy(hostname, ident_filename, sizeof(hostname));
+
+ /*
+ * Load optional IFF parameters from file
+ * "ntpkey_iffkey_<hostname>".
+ */
+ snprintf(filename, sizeof(filename), "ntpkey_iffkey_%s",
+ hostname);
+ iffkey_info = crypto_key(filename, passwd, NULL);
+ if (iffkey_info != NULL)
+ crypto_flags |= CRYPTO_FLAG_IFF;
+
+ /*
+ * Load optional GQ parameters from file
+ * "ntpkey_gqkey_<hostname>".
+ */
+ snprintf(filename, sizeof(filename), "ntpkey_gqkey_%s",
+ hostname);
+ gqkey_info = crypto_key(filename, passwd, NULL);
+ if (gqkey_info != NULL)
+ crypto_flags |= CRYPTO_FLAG_GQ;
+
+ /*
+ * Load optional MV parameters from file
+ * "ntpkey_mvkey_<hostname>".
+ */
+ snprintf(filename, sizeof(filename), "ntpkey_mvkey_%s",
+ hostname);
+ mvkey_info = crypto_key(filename, passwd, NULL);
+ if (mvkey_info != NULL)
+ crypto_flags |= CRYPTO_FLAG_MV;
+
+ /*
+ * We met the enemy and he is us. Now strike up the dance.
+ */
+ crypto_flags |= CRYPTO_FLAG_ENAB | (cinfo->nid << 16);
+ snprintf(statstr, sizeof(statstr), "setup 0x%x host %s %s",
+ crypto_flags, hostname, OBJ_nid2ln(cinfo->nid));
+ record_crypto_stats(NULL, statstr);
+#ifdef DEBUG
+ if (debug)
+ printf("crypto_setup: %s\n", statstr);
+#endif
+}
+
+
+/*
+ * crypto_config - configure data from the crypto command.
+ */
+void
+crypto_config(
+ int item, /* configuration item */
+ char *cp /* item name */
+ )
+{
+ int nid;
+
+#ifdef DEBUG
+ if (debug > 1)
+ printf("crypto_config: item %d %s\n", item, cp);
+#endif
+ switch (item) {
+
+ /*
+ * Set host name (host).
+ */
+ case CRYPTO_CONF_PRIV:
+ if (NULL != host_filename)
+ free(host_filename);
+ host_filename = estrdup(cp);
+ break;
+
+ /*
+ * Set group name (ident).
+ */
+ case CRYPTO_CONF_IDENT:
+ if (NULL != ident_filename)
+ free(ident_filename);
+ ident_filename = estrdup(cp);
+ break;
+
+ /*
+ * Set private key password (pw).
+ */
+ case CRYPTO_CONF_PW:
+ if (NULL != passwd)
+ free(passwd);
+ passwd = estrdup(cp);
+ break;
+
+ /*
+ * Set random seed file name (randfile).
+ */
+ case CRYPTO_CONF_RAND:
+ if (NULL != rand_file)
+ free(rand_file);
+ rand_file = estrdup(cp);
+ break;
+
+ /*
+ * Set message digest NID.
+ */
+ case CRYPTO_CONF_NID:
+ nid = OBJ_sn2nid(cp);
+ if (nid == 0)
+ msyslog(LOG_ERR,
+ "crypto_config: invalid digest name %s", cp);
+ else
+ crypto_nid = nid;
+ break;
+ }
+}
+# else /* !AUTOKEY follows */
+int ntp_crypto_bs_pubkey;
+# endif /* !AUTOKEY */
diff --git a/ntpd/ntp_filegen.c b/ntpd/ntp_filegen.c
new file mode 100644
index 0000000..a1703a9
--- /dev/null
+++ b/ntpd/ntp_filegen.c
@@ -0,0 +1,645 @@
+/*
+ * ntp_filegen.c,v 3.12 1994/01/25 19:06:11 kardel Exp
+ *
+ * implements file generations support for NTP
+ * logfiles and statistic files
+ *
+ *
+ * Copyright (C) 1992, 1996 by Rainer Pruy
+ * Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
+ *
+ * This code may be modified and used freely
+ * provided credits remain intact.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_string.h"
+#include "ntp_calendar.h"
+#include "ntp_filegen.h"
+#include "ntp_stdlib.h"
+
+/*
+ * NTP is intended to run long periods of time without restart.
+ * Thus log and statistic files generated by NTP will grow large.
+ *
+ * this set of routines provides a central interface
+ * to generating files using file generations
+ *
+ * the generation of a file is changed according to file generation type
+ */
+
+
+/*
+ * redefine this if your system dislikes filename suffixes like
+ * X.19910101 or X.1992W50 or ....
+ */
+#define SUFFIX_SEP '.'
+
+static void filegen_open (FILEGEN *, u_int32, const time_t*);
+static int valid_fileref (const char *, const char *);
+static void filegen_init (const char *, const char *, FILEGEN *);
+#ifdef DEBUG
+static void filegen_uninit (FILEGEN *);
+#endif /* DEBUG */
+
+
+/*
+ * filegen_init
+ */
+
+static void
+filegen_init(
+ const char * dir,
+ const char * fname,
+ FILEGEN * fgp
+ )
+{
+ fgp->fp = NULL;
+ fgp->dir = estrdup(dir);
+ fgp->fname = estrdup(fname);
+ fgp->id_lo = 0;
+ fgp->id_hi = 0;
+ fgp->type = FILEGEN_DAY;
+ fgp->flag = FGEN_FLAG_LINK; /* not yet enabled !!*/
+}
+
+
+/*
+ * filegen_uninit - free memory allocated by filegen_init
+ */
+#ifdef DEBUG
+static void
+filegen_uninit(
+ FILEGEN *fgp
+ )
+{
+ free(fgp->dir);
+ free(fgp->fname);
+}
+#endif
+
+
+/*
+ * open a file generation according to the current settings of gen
+ * will also provide a link to basename if requested to do so
+ */
+
+static void
+filegen_open(
+ FILEGEN * gen,
+ u_int32 stamp,
+ const time_t * pivot
+ )
+{
+ char *savename; /* temp store for name collision handling */
+ char *fullname; /* name with any designation extension */
+ char *filename; /* name without designation extension */
+ char *suffix; /* where to print suffix extension */
+ u_int len, suflen;
+ FILE *fp;
+ struct calendar cal;
+ struct isodate iso;
+
+ /* get basic filename in buffer, leave room for extensions */
+ len = strlen(gen->dir) + strlen(gen->fname) + 65;
+ filename = emalloc(len);
+ fullname = emalloc(len);
+ savename = NULL;
+ snprintf(filename, len, "%s%s", gen->dir, gen->fname);
+
+ /* where to place suffix */
+ suflen = strlcpy(fullname, filename, len);
+ suffix = fullname + suflen;
+ suflen = len - suflen;
+
+ /* last octet of fullname set to '\0' for truncation check */
+ fullname[len - 1] = '\0';
+
+ switch (gen->type) {
+
+ default:
+ msyslog(LOG_ERR,
+ "unsupported file generations type %d for "
+ "\"%s\" - reverting to FILEGEN_NONE",
+ gen->type, filename);
+ gen->type = FILEGEN_NONE;
+ break;
+
+ case FILEGEN_NONE:
+ /* no suffix, all set */
+ break;
+
+ case FILEGEN_PID:
+ gen->id_lo = getpid();
+ gen->id_hi = 0;
+ snprintf(suffix, suflen, "%c#%ld",
+ SUFFIX_SEP, gen->id_lo);
+ break;
+
+ case FILEGEN_DAY:
+ /*
+ * You can argue here in favor of using MJD, but I
+ * would assume it to be easier for humans to interpret
+ * dates in a format they are used to in everyday life.
+ */
+ ntpcal_ntp_to_date(&cal, stamp, pivot);
+ snprintf(suffix, suflen, "%c%04d%02d%02d",
+ SUFFIX_SEP, cal.year, cal.month, cal.monthday);
+ cal.hour = cal.minute = cal.second = 0;
+ gen->id_lo = ntpcal_date_to_ntp(&cal);
+ gen->id_hi = (u_int32)(gen->id_lo + SECSPERDAY);
+ break;
+
+ case FILEGEN_WEEK:
+ isocal_ntp_to_date(&iso, stamp, pivot);
+ snprintf(suffix, suflen, "%c%04dw%02d",
+ SUFFIX_SEP, iso.year, iso.week);
+ iso.hour = iso.minute = iso.second = 0;
+ iso.weekday = 1;
+ gen->id_lo = isocal_date_to_ntp(&iso);
+ gen->id_hi = (u_int32)(gen->id_lo + 7 * SECSPERDAY);
+ break;
+
+ case FILEGEN_MONTH:
+ ntpcal_ntp_to_date(&cal, stamp, pivot);
+ snprintf(suffix, suflen, "%c%04d%02d",
+ SUFFIX_SEP, cal.year, cal.month);
+ cal.hour = cal.minute = cal.second = 0;
+ cal.monthday = 1;
+ gen->id_lo = ntpcal_date_to_ntp(&cal);
+ cal.month++;
+ gen->id_hi = ntpcal_date_to_ntp(&cal);
+ break;
+
+ case FILEGEN_YEAR:
+ ntpcal_ntp_to_date(&cal, stamp, pivot);
+ snprintf(suffix, suflen, "%c%04d",
+ SUFFIX_SEP, cal.year);
+ cal.hour = cal.minute = cal.second = 0;
+ cal.month = cal.monthday = 1;
+ gen->id_lo = ntpcal_date_to_ntp(&cal);
+ cal.year++;
+ gen->id_hi = ntpcal_date_to_ntp(&cal);
+ break;
+
+ case FILEGEN_AGE:
+ gen->id_lo = current_time - (current_time % SECSPERDAY);
+ gen->id_hi = gen->id_lo + SECSPERDAY;
+ snprintf(suffix, suflen, "%ca%08ld",
+ SUFFIX_SEP, gen->id_lo);
+ }
+
+ /* check possible truncation */
+ if ('\0' != fullname[len - 1]) {
+ fullname[len - 1] = '\0';
+ msyslog(LOG_ERR, "logfile name truncated: \"%s\"",
+ fullname);
+ }
+
+ if (FILEGEN_NONE != gen->type) {
+ /*
+ * check for existence of a file with name 'basename'
+ * as we disallow such a file
+ * if FGEN_FLAG_LINK is set create a link
+ */
+ struct stat stats;
+ /*
+ * try to resolve name collisions
+ */
+ static u_long conflicts = 0;
+
+#ifndef S_ISREG
+#define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG)
+#endif
+ if (stat(filename, &stats) == 0) {
+ /* Hm, file exists... */
+ if (S_ISREG(stats.st_mode)) {
+ if (stats.st_nlink <= 1) {
+ /*
+ * Oh, it is not linked - try to save it
+ */
+ savename = emalloc(len);
+ snprintf(savename, len,
+ "%s%c%dC%lu",
+ filename, SUFFIX_SEP,
+ (int)getpid(), conflicts++);
+
+ if (rename(filename, savename) != 0)
+ msyslog(LOG_ERR,
+ "couldn't save %s: %m",
+ filename);
+ free(savename);
+ } else {
+ /*
+ * there is at least a second link to
+ * this file.
+ * just remove the conflicting one
+ */
+ if (
+#if !defined(VMS)
+ unlink(filename) != 0
+#else
+ delete(filename) != 0
+#endif
+ )
+ msyslog(LOG_ERR,
+ "couldn't unlink %s: %m",
+ filename);
+ }
+ } else {
+ /*
+ * Ehh? Not a regular file ?? strange !!!!
+ */
+ msyslog(LOG_ERR,
+ "expected regular file for %s "
+ "(found mode 0%lo)",
+ filename,
+ (unsigned long)stats.st_mode);
+ }
+ } else {
+ /*
+ * stat(..) failed, but it is absolutely correct for
+ * 'basename' not to exist
+ */
+ if (ENOENT != errno)
+ msyslog(LOG_ERR, "stat(%s) failed: %m",
+ filename);
+ }
+ }
+
+ /*
+ * now, try to open new file generation...
+ */
+ DPRINTF(4, ("opening filegen (type=%d/stamp=%u) \"%s\"\n",
+ gen->type, stamp, fullname));
+
+ fp = fopen(fullname, "a");
+
+ if (NULL == fp) {
+ /* open failed -- keep previous state
+ *
+ * If the file was open before keep the previous generation.
+ * This will cause output to end up in the 'wrong' file,
+ * but I think this is still better than losing output
+ *
+ * ignore errors due to missing directories
+ */
+
+ if (ENOENT != errno)
+ msyslog(LOG_ERR, "can't open %s: %m", fullname);
+ } else {
+ if (NULL != gen->fp) {
+ fclose(gen->fp);
+ gen->fp = NULL;
+ }
+ gen->fp = fp;
+
+ if (gen->flag & FGEN_FLAG_LINK) {
+ /*
+ * need to link file to basename
+ * have to use hardlink for now as I want to allow
+ * gen->basename spanning directory levels
+ * this would make it more complex to get the correct
+ * fullname for symlink
+ *
+ * Ok, it would just mean taking the part following
+ * the last '/' in the name.... Should add it later....
+ */
+
+ /* Windows NT does not support file links -Greg Schueman 1/18/97 */
+
+#if defined(SYS_WINNT) || defined(SYS_VXWORKS)
+ SetLastError(0); /* On WinNT, don't support FGEN_FLAG_LINK */
+#elif defined(VMS)
+ errno = 0; /* On VMS, don't support FGEN_FLAG_LINK */
+#else /* not (VMS) / VXWORKS / WINNT ; DO THE LINK) */
+ if (link(fullname, filename) != 0)
+ if (EEXIST != errno)
+ msyslog(LOG_ERR,
+ "can't link(%s, %s): %m",
+ fullname, filename);
+#endif /* SYS_WINNT || VXWORKS */
+ } /* flags & FGEN_FLAG_LINK */
+ } /* else fp == NULL */
+
+ free(filename);
+ free(fullname);
+ return;
+}
+
+/*
+ * this function sets up gen->fp to point to the correct
+ * generation of the file for the time specified by 'now'
+ *
+ * 'now' usually is interpreted as second part of a l_fp as is in the cal...
+ * library routines
+ */
+
+void
+filegen_setup(
+ FILEGEN * gen,
+ u_int32 now
+ )
+{
+ int current;
+ time_t pivot;
+
+ if (!(gen->flag & FGEN_FLAG_ENABLED)) {
+ if (NULL != gen->fp) {
+ fclose(gen->fp);
+ gen->fp = NULL;
+ }
+ return;
+ }
+
+ switch (gen->type) {
+
+ default:
+ case FILEGEN_NONE:
+ current = TRUE;
+ break;
+
+ case FILEGEN_PID:
+ current = ((int)gen->id_lo == getpid());
+ break;
+
+ case FILEGEN_AGE:
+ current = (gen->id_lo <= current_time) &&
+ (gen->id_hi > current_time);
+ break;
+
+ case FILEGEN_DAY:
+ case FILEGEN_WEEK:
+ case FILEGEN_MONTH:
+ case FILEGEN_YEAR:
+ current = (gen->id_lo <= now) &&
+ (gen->id_hi > now);
+ break;
+ }
+ /*
+ * try to open file if not yet open
+ * reopen new file generation file on change of generation id
+ */
+ if (NULL == gen->fp || !current) {
+ DPRINTF(1, ("filegen %0x %u\n", gen->type, now));
+ pivot = time(NULL);
+ filegen_open(gen, now, &pivot);
+ }
+}
+
+
+/*
+ * change settings for filegen files
+ */
+void
+filegen_config(
+ FILEGEN * gen,
+ const char * dir,
+ const char * fname,
+ u_int type,
+ u_int flag
+ )
+{
+ int file_existed;
+ l_fp now;
+
+
+ /*
+ * if nothing would be changed...
+ */
+ if (strcmp(dir, gen->dir) == 0 && strcmp(fname, gen->fname) == 0
+ && type == gen->type && flag == gen->flag)
+ return;
+
+ /*
+ * validate parameters
+ */
+ if (!valid_fileref(dir, fname))
+ return;
+
+ if (NULL != gen->fp) {
+ fclose(gen->fp);
+ gen->fp = NULL;
+ file_existed = TRUE;
+ } else {
+ file_existed = FALSE;
+ }
+
+ DPRINTF(3, ("configuring filegen:\n"
+ "\tdir:\t%s -> %s\n"
+ "\tfname:\t%s -> %s\n"
+ "\ttype:\t%d -> %d\n"
+ "\tflag: %x -> %x\n",
+ gen->dir, dir,
+ gen->fname, fname,
+ gen->type, type,
+ gen->flag, flag));
+
+ if (strcmp(gen->dir, dir) != 0) {
+ free(gen->dir);
+ gen->dir = estrdup(dir);
+ }
+
+ if (strcmp(gen->fname, fname) != 0) {
+ free(gen->fname);
+ gen->fname = estrdup(fname);
+ }
+ gen->type = (u_char)type;
+ gen->flag = (u_char)flag;
+
+ /*
+ * make filegen use the new settings
+ * special action is only required when a generation file
+ * is currently open
+ * otherwise the new settings will be used anyway at the next open
+ */
+ if (file_existed) {
+ get_systime(&now);
+ filegen_setup(gen, now.l_ui);
+ }
+}
+
+
+/*
+ * check whether concatenating prefix and basename
+ * yields a legal filename
+ */
+static int
+valid_fileref(
+ const char * dir,
+ const char * fname
+ )
+{
+ /*
+ * dir cannot be changed dynamically
+ * (within the context of filegen)
+ * so just reject basenames containing '..'
+ *
+ * ASSUMPTION:
+ * file system parts 'below' dir may be
+ * specified without infringement of security
+ *
+ * restricting dir to legal values
+ * has to be ensured by other means
+ * (however, it would be possible to perform some checks here...)
+ */
+ const char *p;
+
+ /*
+ * Just to catch, dumb errors opening up the world...
+ */
+ if (NULL == dir || '\0' == dir[0])
+ return FALSE;
+
+ if (NULL == fname)
+ return FALSE;
+
+#ifdef SYS_WINNT
+ /*
+ * Windows treats / equivalent to \, reject any / to ensure
+ * check below for DIR_SEP (\ on windows) are adequate.
+ */
+ if (strchr(fname, '/')) {
+ msyslog(LOG_ERR,
+ "filegen filenames must not contain '/': %s",
+ fname);
+ return FALSE;
+ }
+#endif
+
+ for (p = fname; p != NULL; p = strchr(p, DIR_SEP)) {
+ if ('.' == p[0] && '.' == p[1]
+ && ('\0' == p[2] || DIR_SEP == p[2]))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * filegen registry
+ */
+
+static struct filegen_entry {
+ char * name;
+ FILEGEN * filegen;
+ struct filegen_entry * next;
+} *filegen_registry = NULL;
+
+
+FILEGEN *
+filegen_get(
+ const char * name
+ )
+{
+ struct filegen_entry *f = filegen_registry;
+
+ while (f) {
+ if (f->name == name || strcmp(name, f->name) == 0) {
+ DPRINTF(4, ("filegen_get(%s) = %p\n",
+ name, f->filegen));
+ return f->filegen;
+ }
+ f = f->next;
+ }
+ DPRINTF(4, ("filegen_get(%s) = NULL\n", name));
+ return NULL;
+}
+
+
+void
+filegen_register(
+ const char * dir,
+ const char * name,
+ FILEGEN * filegen
+ )
+{
+ struct filegen_entry **ppfe;
+
+ DPRINTF(4, ("filegen_register(%s, %p)\n", name, filegen));
+
+ filegen_init(dir, name, filegen);
+
+ ppfe = &filegen_registry;
+ while (NULL != *ppfe) {
+ if ((*ppfe)->name == name
+ || !strcmp((*ppfe)->name, name)) {
+
+ DPRINTF(5, ("replacing filegen %p\n",
+ (*ppfe)->filegen));
+
+ (*ppfe)->filegen = filegen;
+ return;
+ }
+ ppfe = &((*ppfe)->next);
+ }
+
+ *ppfe = emalloc(sizeof **ppfe);
+
+ (*ppfe)->next = NULL;
+ (*ppfe)->name = estrdup(name);
+ (*ppfe)->filegen = filegen;
+
+ DPRINTF(6, ("adding new filegen\n"));
+
+ return;
+}
+
+
+/*
+ * filegen_statsdir() - reset each filegen entry's dir to statsdir.
+ */
+void
+filegen_statsdir(void)
+{
+ struct filegen_entry *f;
+
+ for (f = filegen_registry; f != NULL; f = f->next)
+ filegen_config(f->filegen, statsdir, f->filegen->fname,
+ f->filegen->type, f->filegen->flag);
+}
+
+
+/*
+ * filegen_unregister frees memory allocated by filegen_register for
+ * name.
+ */
+#ifdef DEBUG
+void
+filegen_unregister(
+ char *name
+ )
+{
+ struct filegen_entry ** ppfe;
+ struct filegen_entry * pfe;
+ FILEGEN * fg;
+
+ DPRINTF(4, ("filegen_unregister(%s)\n", name));
+
+ ppfe = &filegen_registry;
+
+ while (NULL != *ppfe) {
+ if ((*ppfe)->name == name
+ || !strcmp((*ppfe)->name, name)) {
+ pfe = *ppfe;
+ *ppfe = (*ppfe)->next;
+ fg = pfe->filegen;
+ free(pfe->name);
+ free(pfe);
+ filegen_uninit(fg);
+ break;
+ }
+ ppfe = &((*ppfe)->next);
+ }
+}
+#endif /* DEBUG */
diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c
new file mode 100644
index 0000000..0f335ea
--- /dev/null
+++ b/ntpd/ntp_io.c
@@ -0,0 +1,4688 @@
+/*
+ * ntp_io.c - input/output routines for ntpd. The socket-opening code
+ * was shamelessly stolen from ntpd.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <signal.h>
+#ifdef HAVE_FNMATCH_H
+# include <fnmatch.h>
+# if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE)
+# define FNM_CASEFOLD FNM_IGNORECASE
+# endif
+#endif
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#ifdef HAVE_SYS_SOCKIO_H /* UXPV: SIOC* #defines (Frank Vance <fvance@waii.com>) */
+# include <sys/sockio.h>
+#endif
+#ifdef HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif
+
+#include "ntp_machine.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "iosignal.h"
+#include "ntp_lists.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+#include "ntp_worker.h"
+#include "ntp_request.h"
+#include "ntp_assert.h"
+#include "timevalops.h"
+#include "timespecops.h"
+#include "ntpd-opts.h"
+
+/* Don't include ISC's version of IPv6 variables and structures */
+#define ISC_IPV6_H 1
+#include <isc/mem.h>
+#include <isc/interfaceiter.h>
+#include <isc/netaddr.h>
+#include <isc/result.h>
+#include <isc/sockaddr.h>
+
+#ifdef SIM
+#include "ntpsim.h"
+#endif
+
+#ifdef HAS_ROUTING_SOCKET
+# include <net/route.h>
+# ifdef HAVE_RTNETLINK
+# include <linux/rtnetlink.h>
+# endif
+#endif
+
+
+/*
+ * setsockopt does not always have the same arg declaration
+ * across all platforms. If it's not defined we make it empty
+ */
+
+#ifndef SETSOCKOPT_ARG_CAST
+#define SETSOCKOPT_ARG_CAST
+#endif
+
+extern int listen_to_virtual_ips;
+
+/*
+ * NIC rule entry
+ */
+typedef struct nic_rule_tag nic_rule;
+
+struct nic_rule_tag {
+ nic_rule * next;
+ nic_rule_action action;
+ nic_rule_match match_type;
+ char * if_name;
+ sockaddr_u addr;
+ int prefixlen;
+};
+
+/*
+ * NIC rule listhead. Entries are added at the head so that the first
+ * match in the list is the last matching rule specified.
+ */
+nic_rule *nic_rule_list;
+
+
+#if defined(SO_BINTIME) && defined(SCM_BINTIME) && defined(CMSG_FIRSTHDR)
+# define HAVE_PACKET_TIMESTAMP
+# define HAVE_BINTIME
+# ifdef BINTIME_CTLMSGBUF_SIZE
+# define CMSG_BUFSIZE BINTIME_CTLMSGBUF_SIZE
+# else
+# define CMSG_BUFSIZE 1536 /* moderate default */
+# endif
+#elif defined(SO_TIMESTAMPNS) && defined(SCM_TIMESTAMPNS) && defined(CMSG_FIRSTHDR)
+# define HAVE_PACKET_TIMESTAMP
+# define HAVE_TIMESTAMPNS
+# ifdef TIMESTAMPNS_CTLMSGBUF_SIZE
+# define CMSG_BUFSIZE TIMESTAMPNS_CTLMSGBUF_SIZE
+# else
+# define CMSG_BUFSIZE 1536 /* moderate default */
+# endif
+#elif defined(SO_TIMESTAMP) && defined(SCM_TIMESTAMP) && defined(CMSG_FIRSTHDR)
+# define HAVE_PACKET_TIMESTAMP
+# define HAVE_TIMESTAMP
+# ifdef TIMESTAMP_CTLMSGBUF_SIZE
+# define CMSG_BUFSIZE TIMESTAMP_CTLMSGBUF_SIZE
+# else
+# define CMSG_BUFSIZE 1536 /* moderate default */
+# endif
+#else
+/* fill in for old/other timestamp interfaces */
+#endif
+
+#if defined(SYS_WINNT)
+#include "win32_io.h"
+#include <isc/win32os.h>
+#endif
+
+/*
+ * We do asynchronous input using the SIGIO facility. A number of
+ * recvbuf buffers are preallocated for input. In the signal
+ * handler we poll to see which sockets are ready and read the
+ * packets from them into the recvbuf's along with a time stamp and
+ * an indication of the source host and the interface it was received
+ * through. This allows us to get as accurate receive time stamps
+ * as possible independent of other processing going on.
+ *
+ * We watch the number of recvbufs available to the signal handler
+ * and allocate more when this number drops below the low water
+ * mark. If the signal handler should run out of buffers in the
+ * interim it will drop incoming frames, the idea being that it is
+ * better to drop a packet than to be inaccurate.
+ */
+
+
+/*
+ * Other statistics of possible interest
+ */
+volatile u_long packets_dropped; /* total number of packets dropped on reception */
+volatile u_long packets_ignored; /* packets received on wild card interface */
+volatile u_long packets_received; /* total number of packets received */
+ u_long packets_sent; /* total number of packets sent */
+ u_long packets_notsent; /* total number of packets which couldn't be sent */
+
+volatile u_long handler_calls; /* number of calls to interrupt handler */
+volatile u_long handler_pkts; /* number of pkts received by handler */
+u_long io_timereset; /* time counters were reset */
+
+/*
+ * Interface stuff
+ */
+endpt * any_interface; /* wildcard ipv4 interface */
+endpt * any6_interface; /* wildcard ipv6 interface */
+endpt * loopback_interface; /* loopback ipv4 interface */
+
+isc_boolean_t broadcast_client_enabled; /* is broadcast client enabled */
+u_int sys_ifnum; /* next .ifnum to assign */
+int ninterfaces; /* Total number of interfaces */
+
+int disable_dynamic_updates; /* scan interfaces once only */
+
+#ifdef REFCLOCK
+/*
+ * Refclock stuff. We keep a chain of structures with data concerning
+ * the guys we are doing I/O for.
+ */
+static struct refclockio *refio;
+#endif /* REFCLOCK */
+
+/*
+ * File descriptor masks etc. for call to select
+ * Not needed for I/O Completion Ports or anything outside this file
+ */
+static fd_set activefds;
+static int maxactivefd;
+
+/*
+ * bit alternating value to detect verified interfaces during an update cycle
+ */
+static u_short sys_interphase = 0;
+
+static endpt * new_interface(endpt *);
+static void add_interface(endpt *);
+static int update_interfaces(u_short, interface_receiver_t,
+ void *);
+static void remove_interface(endpt *);
+static endpt * create_interface(u_short, endpt *);
+
+static int is_wildcard_addr (const sockaddr_u *);
+
+/*
+ * Multicast functions
+ */
+static isc_boolean_t addr_ismulticast (sockaddr_u *);
+static isc_boolean_t is_anycast (sockaddr_u *,
+ const char *);
+
+/*
+ * Not all platforms support multicast
+ */
+#ifdef MCAST
+static isc_boolean_t socket_multicast_enable (endpt *, sockaddr_u *);
+static isc_boolean_t socket_multicast_disable(endpt *, sockaddr_u *);
+#endif
+
+#ifdef DEBUG
+static void interface_dump (const endpt *);
+static void sockaddr_dump (const sockaddr_u *);
+static void print_interface (const endpt *, char *, char *);
+#define DPRINT_INTERFACE(level, args) do { if (debug >= (level)) { print_interface args; } } while (0)
+#else
+#define DPRINT_INTERFACE(level, args) do {} while (0)
+#endif
+
+typedef struct vsock vsock_t;
+enum desc_type { FD_TYPE_SOCKET, FD_TYPE_FILE };
+
+struct vsock {
+ vsock_t * link;
+ SOCKET fd;
+ enum desc_type type;
+};
+
+vsock_t *fd_list;
+
+#if !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET)
+/*
+ * async notification processing (e. g. routing sockets)
+ */
+/*
+ * support for receiving data on fd that is not a refclock or a socket
+ * like e. g. routing sockets
+ */
+struct asyncio_reader {
+ struct asyncio_reader *link; /* the list this is being kept in */
+ SOCKET fd; /* fd to be read */
+ void *data; /* possibly local data */
+ void (*receiver)(struct asyncio_reader *); /* input handler */
+};
+
+struct asyncio_reader *asyncio_reader_list;
+
+static void delete_asyncio_reader (struct asyncio_reader *);
+static struct asyncio_reader *new_asyncio_reader (void);
+static void add_asyncio_reader (struct asyncio_reader *, enum desc_type);
+static void remove_asyncio_reader (struct asyncio_reader *);
+
+#endif /* !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET) */
+
+static void init_async_notifications (void);
+
+static int addr_eqprefix (const sockaddr_u *, const sockaddr_u *,
+ int);
+static int addr_samesubnet (const sockaddr_u *, const sockaddr_u *,
+ const sockaddr_u *, const sockaddr_u *);
+static int create_sockets (u_short);
+static SOCKET open_socket (sockaddr_u *, int, int, endpt *);
+static char * fdbits (int, fd_set *);
+static void set_reuseaddr (int);
+static isc_boolean_t socket_broadcast_enable (struct interface *, SOCKET, sockaddr_u *);
+static isc_boolean_t socket_broadcast_disable (struct interface *, sockaddr_u *);
+
+typedef struct remaddr remaddr_t;
+
+struct remaddr {
+ remaddr_t * link;
+ sockaddr_u addr;
+ endpt * ep;
+};
+
+remaddr_t * remoteaddr_list;
+endpt * ep_list; /* complete endpt list */
+endpt * mc4_list; /* IPv4 mcast-capable unicast endpts */
+endpt * mc6_list; /* IPv6 mcast-capable unicast endpts */
+
+static endpt * wildipv4;
+static endpt * wildipv6;
+
+#ifdef SYS_WINNT
+int accept_wildcard_if_for_winnt;
+#else
+const int accept_wildcard_if_for_winnt = FALSE;
+#endif
+
+static void add_fd_to_list (SOCKET, enum desc_type);
+static endpt * find_addr_in_list (sockaddr_u *);
+static endpt * find_flagged_addr_in_list(sockaddr_u *, u_int32);
+static void delete_addr_from_list (sockaddr_u *);
+static void delete_interface_from_list(endpt *);
+static void close_and_delete_fd_from_list(SOCKET);
+static void add_addr_to_list (sockaddr_u *, endpt *);
+static void create_wildcards (u_short);
+static endpt * findlocalinterface (sockaddr_u *, int, int);
+static endpt * findclosestinterface (sockaddr_u *, int);
+#ifdef DEBUG
+static const char * action_text (nic_rule_action);
+#endif
+static nic_rule_action interface_action(char *, sockaddr_u *, u_int32);
+static void convert_isc_if (isc_interface_t *,
+ endpt *, u_short);
+static void calc_addr_distance(sockaddr_u *,
+ const sockaddr_u *,
+ const sockaddr_u *);
+static int cmp_addr_distance(const sockaddr_u *,
+ const sockaddr_u *);
+
+/*
+ * Routines to read the ntp packets
+ */
+#if !defined(HAVE_IO_COMPLETION_PORT)
+static inline int read_network_packet (SOCKET, struct interface *, l_fp);
+static void ntpd_addremove_io_fd (int, int, int);
+static input_handler_t input_handler;
+#ifdef REFCLOCK
+static inline int read_refclock_packet (SOCKET, struct refclockio *, l_fp);
+#endif
+#endif
+
+
+
+#ifndef HAVE_IO_COMPLETION_PORT
+void
+maintain_activefds(
+ int fd,
+ int closing
+ )
+{
+ int i;
+
+ if (fd < 0 || fd >= FD_SETSIZE) {
+ msyslog(LOG_ERR,
+ "Too many sockets in use, FD_SETSIZE %d exceeded by fd %d",
+ FD_SETSIZE, fd);
+ exit(1);
+ }
+
+ if (!closing) {
+ FD_SET(fd, &activefds);
+ maxactivefd = max(fd, maxactivefd);
+ } else {
+ FD_CLR(fd, &activefds);
+ if (maxactivefd && fd == maxactivefd) {
+ for (i = maxactivefd - 1; i >= 0; i--)
+ if (FD_ISSET(i, &activefds)) {
+ maxactivefd = i;
+ break;
+ }
+ NTP_INSIST(fd != maxactivefd);
+ }
+ }
+}
+#endif /* !HAVE_IO_COMPLETION_PORT */
+
+
+#ifdef DEBUG_TIMING
+/*
+ * collect timing information for various processing
+ * paths. currently we only pass them on to the file
+ * for later processing. this could also do histogram
+ * based analysis in other to reduce the load (and skew)
+ * dur to the file output
+ */
+void
+collect_timing(struct recvbuf *rb, const char *tag, int count, l_fp *dts)
+{
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s %d %s %s",
+ (rb != NULL)
+ ? ((rb->dstadr != NULL)
+ ? stoa(&rb->recv_srcadr)
+ : "-REFCLOCK-")
+ : "-",
+ count, lfptoa(dts, 9), tag);
+ record_timing_stats(buf);
+}
+#endif
+
+/*
+ * About dynamic interfaces, sockets, reception and more...
+ *
+ * the code solves following tasks:
+ *
+ * - keep a current list of active interfaces in order
+ * to bind to to the interface address on NTP_PORT so that
+ * all wild and specific bindings for NTP_PORT are taken by ntpd
+ * to avoid other daemons messing with the time or sockets.
+ * - all interfaces keep a list of peers that are referencing
+ * the interface in order to quickly re-assign the peers to
+ * new interface in case an interface is deleted (=> gone from system or
+ * down)
+ * - have a preconfigured socket ready with the right local address
+ * for transmission and reception
+ * - have an address list for all destination addresses used within ntpd
+ * to find the "right" preconfigured socket.
+ * - facilitate updating the internal interface list with respect to
+ * the current kernel state
+ *
+ * special issues:
+ *
+ * - mapping of multicast addresses to the interface affected is not always
+ * one to one - especially on hosts with multiple interfaces
+ * the code here currently allocates a separate interface entry for those
+ * multicast addresses
+ * iff it is able to bind to a *new* socket with the multicast address (flags |= MCASTIF)
+ * in case of failure the multicast address is bound to an existing interface.
+ * - on some systems it is perfectly legal to assign the same address to
+ * multiple interfaces. Therefore this code does not keep a list of interfaces
+ * but a list of interfaces that represent a unique address as determined by the kernel
+ * by the procedure in findlocalinterface. Thus it is perfectly legal to see only
+ * one representative of a group of real interfaces if they share the same address.
+ *
+ * Frank Kardel 20050910
+ */
+
+/*
+ * init_io - initialize I/O module.
+ */
+void
+init_io(void)
+{
+ /* Init buffer free list and stat counters */
+ init_recvbuff(RECV_INIT);
+ /* update interface every 5 minutes as default */
+ interface_interval = 300;
+
+#ifdef WORK_PIPE
+ addremove_io_fd = &ntpd_addremove_io_fd;
+#endif
+
+#ifdef SYS_WINNT
+ init_io_completion_port();
+#endif
+
+#if defined(HAVE_SIGNALED_IO)
+ (void) set_signal(input_handler);
+#endif
+}
+
+
+static void
+ntpd_addremove_io_fd(
+ int fd,
+ int is_pipe,
+ int remove_it
+ )
+{
+ UNUSED_ARG(is_pipe);
+
+#ifdef HAVE_SIGNALED_IO
+ init_socket_sig(fd);
+#endif /* not HAVE_SIGNALED_IO */
+
+ maintain_activefds(fd, remove_it);
+}
+
+
+/*
+ * io_open_sockets - call socket creation routine
+ */
+void
+io_open_sockets(void)
+{
+ static int already_opened;
+
+ if (already_opened || HAVE_OPT( SAVECONFIGQUIT ))
+ return;
+
+ already_opened = 1;
+
+ /*
+ * Create the sockets
+ */
+ BLOCKIO();
+ create_sockets(NTP_PORT);
+ UNBLOCKIO();
+
+ init_async_notifications();
+
+ DPRINTF(3, ("io_open_sockets: maxactivefd %d\n", maxactivefd));
+}
+
+
+#ifdef DEBUG
+/*
+ * function to dump the contents of the interface structure
+ * for debugging use only.
+ */
+void
+interface_dump(const endpt *itf)
+{
+ printf("Dumping interface: %p\n", itf);
+ printf("fd = %d\n", itf->fd);
+ printf("bfd = %d\n", itf->bfd);
+ printf("sin = %s,\n", stoa(&itf->sin));
+ sockaddr_dump(&itf->sin);
+ printf("bcast = %s,\n", stoa(&itf->bcast));
+ sockaddr_dump(&itf->bcast);
+ printf("mask = %s,\n", stoa(&itf->mask));
+ sockaddr_dump(&itf->mask);
+ printf("name = %s\n", itf->name);
+ printf("flags = 0x%08x\n", itf->flags);
+ printf("last_ttl = %d\n", itf->last_ttl);
+ printf("addr_refid = %08x\n", itf->addr_refid);
+ printf("num_mcast = %d\n", itf->num_mcast);
+ printf("received = %ld\n", itf->received);
+ printf("sent = %ld\n", itf->sent);
+ printf("notsent = %ld\n", itf->notsent);
+ printf("ifindex = %u\n", itf->ifindex);
+ printf("peercnt = %u\n", itf->peercnt);
+ printf("phase = %u\n", itf->phase);
+}
+
+/*
+ * sockaddr_dump - hex dump the start of a sockaddr_u
+ */
+static void
+sockaddr_dump(const sockaddr_u *psau)
+{
+ /* Limit the size of the sockaddr_in6 hex dump */
+ const int maxsize = min(32, sizeof(psau->sa6));
+ const u_char * cp;
+ int i;
+
+ /* XXX: Should we limit maxsize based on psau->saX.sin_family? */
+ cp = (const void *)&psau->sa6;
+
+ for(i = 0; i < maxsize; i++) {
+ printf("%02x", *cp++);
+ if (!((i + 1) % 4))
+ printf(" ");
+ }
+ printf("\n");
+}
+
+/*
+ * print_interface - helper to output debug information
+ */
+static void
+print_interface(const endpt *iface, char *pfx, char *sfx)
+{
+ printf("%sinterface #%d: fd=%d, bfd=%d, name=%s, flags=0x%x, ifindex=%u, sin=%s",
+ pfx,
+ iface->ifnum,
+ iface->fd,
+ iface->bfd,
+ iface->name,
+ iface->flags,
+ iface->ifindex,
+ stoa(&iface->sin));
+ if (AF_INET == iface->family) {
+ if (iface->flags & INT_BROADCAST)
+ printf(", bcast=%s", stoa(&iface->bcast));
+ printf(", mask=%s", stoa(&iface->mask));
+ }
+ printf(", %s:%s",
+ (iface->ignore_packets)
+ ? "Disabled"
+ : "Enabled",
+ sfx);
+ if (debug > 4) /* in-depth debugging only */
+ interface_dump(iface);
+}
+#endif
+
+#if !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET)
+/*
+ * create an asyncio_reader structure
+ */
+static struct asyncio_reader *
+new_asyncio_reader(void)
+{
+ struct asyncio_reader *reader;
+
+ reader = emalloc_zero(sizeof(*reader));
+ reader->fd = INVALID_SOCKET;
+
+ return reader;
+}
+
+/*
+ * delete a reader
+ */
+static void
+delete_asyncio_reader(
+ struct asyncio_reader *reader
+ )
+{
+ free(reader);
+}
+
+/*
+ * add asynchio_reader
+ */
+static void
+add_asyncio_reader(
+ struct asyncio_reader * reader,
+ enum desc_type type)
+{
+ LINK_SLIST(asyncio_reader_list, reader, link);
+ add_fd_to_list(reader->fd, type);
+}
+
+/*
+ * remove asynchio_reader
+ */
+static void
+remove_asyncio_reader(
+ struct asyncio_reader *reader
+ )
+{
+ struct asyncio_reader *unlinked;
+
+ UNLINK_SLIST(unlinked, asyncio_reader_list, reader, link,
+ struct asyncio_reader);
+
+ if (reader->fd != INVALID_SOCKET)
+ close_and_delete_fd_from_list(reader->fd);
+
+ reader->fd = INVALID_SOCKET;
+}
+#endif /* !defined(HAVE_IO_COMPLETION_PORT) && defined(HAS_ROUTING_SOCKET) */
+
+
+/* compare two sockaddr prefixes */
+static int
+addr_eqprefix(
+ const sockaddr_u * a,
+ const sockaddr_u * b,
+ int prefixlen
+ )
+{
+ isc_netaddr_t isc_a;
+ isc_netaddr_t isc_b;
+ isc_sockaddr_t isc_sa;
+
+ ZERO(isc_sa);
+ memcpy(&isc_sa.type, a, min(sizeof(isc_sa.type), sizeof(*a)));
+ isc_netaddr_fromsockaddr(&isc_a, &isc_sa);
+
+ ZERO(isc_sa);
+ memcpy(&isc_sa.type, b, min(sizeof(isc_sa.type), sizeof(*b)));
+ isc_netaddr_fromsockaddr(&isc_b, &isc_sa);
+
+ return (int)isc_netaddr_eqprefix(&isc_a, &isc_b,
+ (u_int)prefixlen);
+}
+
+
+static int
+addr_samesubnet(
+ const sockaddr_u * a,
+ const sockaddr_u * a_mask,
+ const sockaddr_u * b,
+ const sockaddr_u * b_mask
+ )
+{
+ const u_int32 * pa;
+ const u_int32 * pa_limit;
+ const u_int32 * pb;
+ const u_int32 * pm;
+ size_t loops;
+
+ NTP_REQUIRE(AF(a) == AF(a_mask));
+ NTP_REQUIRE(AF(b) == AF(b_mask));
+ /*
+ * With address and mask families verified to match, comparing
+ * the masks also validates the address's families match.
+ */
+ if (!SOCK_EQ(a_mask, b_mask))
+ return FALSE;
+
+ if (IS_IPV6(a)) {
+ loops = sizeof(NSRCADR6(a)) / sizeof(*pa);
+ pa = (const void *)&NSRCADR6(a);
+ pb = (const void *)&NSRCADR6(b);
+ pm = (const void *)&NSRCADR6(a_mask);
+ } else {
+ loops = sizeof(NSRCADR(a)) / sizeof(*pa);
+ pa = (const void *)&NSRCADR(a);
+ pb = (const void *)&NSRCADR(b);
+ pm = (const void *)&NSRCADR(a_mask);
+ }
+ for (pa_limit = pa + loops; pa < pa_limit; pa++, pb++, pm++)
+ if ((*pa & *pm) != (*pb & *pm))
+ return FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * Code to tell if we have an IP address
+ * If we have then return the sockaddr structure
+ * and set the return value
+ * see the bind9/getaddresses.c for details
+ */
+int
+is_ip_address(
+ const char * host,
+ u_short af,
+ sockaddr_u * addr
+ )
+{
+ struct in_addr in4;
+ struct in6_addr in6;
+ struct addrinfo hints;
+ struct addrinfo *result;
+ struct sockaddr_in6 *resaddr6;
+ char tmpbuf[128];
+ char *pch;
+
+ NTP_REQUIRE(host != NULL);
+ NTP_REQUIRE(addr != NULL);
+
+ ZERO_SOCK(addr);
+
+ /*
+ * Try IPv4, then IPv6. In order to handle the extended format
+ * for IPv6 scoped addresses (address%scope_ID), we'll use a local
+ * working buffer of 128 bytes. The length is an ad-hoc value, but
+ * should be enough for this purpose; the buffer can contain a string
+ * of at least 80 bytes for scope_ID in addition to any IPv6 numeric
+ * addresses (up to 46 bytes), the delimiter character and the
+ * terminating NULL character.
+ */
+ if (AF_UNSPEC == af || AF_INET == af)
+ if (inet_pton(AF_INET, host, &in4) == 1) {
+ AF(addr) = AF_INET;
+ SET_ADDR4N(addr, in4.s_addr);
+
+ return TRUE;
+ }
+
+ if (AF_UNSPEC == af || AF_INET6 == af)
+ if (sizeof(tmpbuf) > strlen(host)) {
+ if ('[' == host[0]) {
+ strlcpy(tmpbuf, &host[1], sizeof(tmpbuf));
+ pch = strchr(tmpbuf, ']');
+ if (pch != NULL)
+ *pch = '\0';
+ } else {
+ strlcpy(tmpbuf, host, sizeof(tmpbuf));
+ }
+ ZERO(hints);
+ hints.ai_family = AF_INET6;
+ hints.ai_flags |= AI_NUMERICHOST;
+ if (getaddrinfo(tmpbuf, NULL, &hints, &result) == 0) {
+ AF(addr) = AF_INET6;
+ resaddr6 = (struct sockaddr_in6 *)result->ai_addr;
+ SET_ADDR6N(addr, resaddr6->sin6_addr);
+ SET_SCOPE(addr, resaddr6->sin6_scope_id);
+
+ freeaddrinfo(result);
+ return TRUE;
+ }
+ }
+ /*
+ * If we got here it was not an IP address
+ */
+ return FALSE;
+}
+
+
+/*
+ * interface list enumerator - visitor pattern
+ */
+void
+interface_enumerate(
+ interface_receiver_t receiver,
+ void * data
+ )
+{
+ interface_info_t ifi;
+
+ ifi.action = IFS_EXISTS;
+ for (ifi.ep = ep_list; ifi.ep != NULL; ifi.ep = ifi.ep->elink)
+ (*receiver)(data, &ifi);
+}
+
+/*
+ * do standard initialization of interface structure
+ */
+static void
+init_interface(
+ endpt *ep
+ )
+{
+ ZERO(*ep);
+ ep->fd = INVALID_SOCKET;
+ ep->bfd = INVALID_SOCKET;
+ ep->phase = sys_interphase;
+}
+
+
+/*
+ * create new interface structure initialize from
+ * template structure or via standard initialization
+ * function
+ */
+static struct interface *
+new_interface(
+ struct interface *interface
+ )
+{
+ struct interface * iface;
+
+ iface = emalloc(sizeof(*iface));
+
+ if (NULL == interface)
+ init_interface(iface);
+ else /* use the template */
+ memcpy(iface, interface, sizeof(*iface));
+
+ /* count every new instance of an interface in the system */
+ iface->ifnum = sys_ifnum++;
+ iface->starttime = current_time;
+
+ return iface;
+}
+
+
+/*
+ * return interface storage into free memory pool
+ */
+static inline void
+delete_interface(
+ endpt *ep
+ )
+{
+ free(ep);
+}
+
+
+/*
+ * link interface into list of known interfaces
+ */
+static void
+add_interface(
+ endpt * ep
+ )
+{
+ endpt ** pmclisthead;
+ endpt * scan;
+ endpt * scan_next;
+ endpt * unlinked;
+ sockaddr_u * addr;
+ int ep_local;
+ int scan_local;
+ int same_subnet;
+ int ep_univ_iid; /* iface ID from MAC address */
+ int scan_univ_iid; /* see RFC 4291 */
+ int ep_privacy; /* random local iface ID */
+ int scan_privacy; /* see RFC 4941 */
+ int rc;
+
+ /* Calculate the refid */
+ ep->addr_refid = addr2refid(&ep->sin);
+ /* link at tail so ntpdc -c ifstats index increases each row */
+ LINK_TAIL_SLIST(ep_list, ep, elink, endpt);
+ ninterfaces++;
+#ifdef MCAST
+ /* the rest is for enabled multicast-capable addresses only */
+ if (ep->ignore_packets || !(INT_MULTICAST & ep->flags) ||
+ INT_LOOPBACK & ep->flags)
+ return;
+# ifndef INCLUDE_IPV6_MULTICAST_SUPPORT
+ if (AF_INET6 == ep->family)
+ return;
+# endif
+ pmclisthead = (AF_INET == ep->family)
+ ? &mc4_list
+ : &mc6_list;
+
+ if (AF_INET6 == ep->family) {
+ ep_local =
+ IN6_IS_ADDR_LINKLOCAL(PSOCK_ADDR6(&ep->sin)) ||
+ IN6_IS_ADDR_SITELOCAL(PSOCK_ADDR6(&ep->sin));
+ ep_univ_iid = IS_IID_UNIV(&ep->sin);
+ ep_privacy = !!(INT_PRIVACY & ep->flags);
+ } else {
+ ep_local = FALSE;
+ ep_univ_iid = FALSE;
+ ep_privacy = FALSE;
+ }
+ DPRINTF(4, ("add_interface mcast-capable %s%s%s%s\n",
+ stoa(&ep->sin),
+ (ep_local) ? " link/scope-local" : "",
+ (ep_univ_iid) ? " univ-IID" : "",
+ (ep_privacy) ? " privacy" : ""));
+ /*
+ * If we have multiple local addresses on the same network
+ * interface, and some are link- or site-local, do not multicast
+ * out from the link-/site-local addresses by default, to avoid
+ * duplicate manycastclient associations between v6 peers using
+ * link-local and global addresses. link-local can still be
+ * chosen using "nic ignore myv6globalprefix::/64".
+ * Similarly, if we have multiple global addresses from the same
+ * prefix on the same network interface, multicast from one,
+ * preferring EUI-64, then static, then least RFC 4941 privacy
+ * addresses.
+ */
+ for (scan = *pmclisthead; scan != NULL; scan = scan_next) {
+ scan_next = scan->mclink;
+ if (ep->family != scan->family)
+ continue;
+ if (strcmp(ep->name, scan->name))
+ continue;
+ same_subnet = addr_samesubnet(&ep->sin, &ep->mask,
+ &scan->sin, &scan->mask);
+ if (AF_INET6 == ep->family) {
+ addr = &scan->sin;
+ scan_local =
+ IN6_IS_ADDR_LINKLOCAL(PSOCK_ADDR6(addr)) ||
+ IN6_IS_ADDR_SITELOCAL(PSOCK_ADDR6(addr));
+ scan_univ_iid = IS_IID_UNIV(addr);
+ scan_privacy = !!(INT_PRIVACY & scan->flags);
+ } else {
+ scan_local = FALSE;
+ scan_univ_iid = FALSE;
+ scan_privacy = FALSE;
+ }
+ DPRINTF(4, ("add_interface mcast-capable scan %s%s%s%s\n",
+ stoa(&scan->sin),
+ (scan_local) ? " link/scope-local" : "",
+ (scan_univ_iid) ? " univ-IID" : "",
+ (scan_privacy) ? " privacy" : ""));
+ if ((ep_local && !scan_local) || (same_subnet &&
+ ((ep_privacy && !scan_privacy) ||
+ (!ep_univ_iid && scan_univ_iid)))) {
+ DPRINTF(4, ("did not add %s to %s of IPv6 multicast-capable list which already has %s\n",
+ stoa(&ep->sin),
+ (ep_local)
+ ? "tail"
+ : "head",
+ stoa(&scan->sin)));
+ return;
+ }
+ if ((scan_local && !ep_local) || (same_subnet &&
+ ((scan_privacy && !ep_privacy) ||
+ (!scan_univ_iid && ep_univ_iid)))) {
+ UNLINK_SLIST(unlinked, *pmclisthead,
+ scan, mclink, endpt);
+ DPRINTF(4, ("%s %s from IPv6 multicast-capable list to add %s\n",
+ (unlinked != scan)
+ ? "Failed to remove"
+ : "removed",
+ stoa(&scan->sin), stoa(&ep->sin)));
+ }
+ }
+ /*
+ * Add link/site local at the tail of the multicast-
+ * capable unicast interfaces list, so that ntpd will
+ * send from global addresses before link-/site-local
+ * ones.
+ */
+ if (ep_local)
+ LINK_TAIL_SLIST(*pmclisthead, ep, mclink, endpt);
+ else
+ LINK_SLIST(*pmclisthead, ep, mclink);
+ DPRINTF(4, ("added %s to %s of IPv%s multicast-capable unicast local address list\n",
+ stoa(&ep->sin),
+ (ep_local)
+ ? "tail"
+ : "head",
+ (AF_INET == ep->family)
+ ? "4"
+ : "6"));
+
+ if (INVALID_SOCKET == ep->fd)
+ return;
+
+ /*
+ * select the local address from which to send to multicast.
+ */
+ switch (AF(&ep->sin)) {
+
+ case AF_INET :
+ rc = setsockopt(ep->fd, IPPROTO_IP,
+ IP_MULTICAST_IF,
+ (void *)&NSRCADR(&ep->sin),
+ sizeof(NSRCADR(&ep->sin)));
+ if (rc)
+ msyslog(LOG_ERR,
+ "setsockopt IP_MULTICAST_IF %s fails: %m",
+ stoa(&ep->sin));
+ break;
+
+# ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+ case AF_INET6 :
+ rc = setsockopt(ep->fd, IPPROTO_IPV6,
+ IPV6_MULTICAST_IF,
+ (void *)&ep->ifindex,
+ sizeof(ep->ifindex));
+ /* do not complain if bound addr scope is ifindex */
+ if (rc && ep->ifindex != SCOPE(&ep->sin))
+ msyslog(LOG_ERR,
+ "setsockopt IPV6_MULTICAST_IF %u for %s fails: %m",
+ ep->ifindex, stoa(&ep->sin));
+ break;
+# endif
+ }
+#endif /* MCAST */
+}
+
+
+/*
+ * remove interface from known interface list and clean up
+ * associated resources
+ */
+static void
+remove_interface(
+ endpt * ep
+ )
+{
+ endpt * unlinked;
+ endpt ** pmclisthead;
+ sockaddr_u resmask;
+
+ UNLINK_SLIST(unlinked, ep_list, ep, elink, endpt);
+ if (!ep->ignore_packets && INT_MULTICAST & ep->flags) {
+ pmclisthead = (AF_INET == ep->family)
+ ? &mc4_list
+ : &mc6_list;
+ UNLINK_SLIST(unlinked, *pmclisthead, ep, mclink, endpt);
+ DPRINTF(4, ("%s %s IPv%s multicast-capable unicast local address list\n",
+ stoa(&ep->sin),
+ (unlinked != NULL)
+ ? "removed from"
+ : "not found on",
+ (AF_INET == ep->family)
+ ? "4"
+ : "6"));
+ }
+ delete_interface_from_list(ep);
+
+ if (ep->fd != INVALID_SOCKET) {
+ msyslog(LOG_INFO,
+ "Deleting interface #%d %s, %s#%d, interface stats: received=%ld, sent=%ld, dropped=%ld, active_time=%ld secs",
+ ep->ifnum,
+ ep->name,
+ stoa(&ep->sin),
+ SRCPORT(&ep->sin),
+ ep->received,
+ ep->sent,
+ ep->notsent,
+ current_time - ep->starttime);
+ close_and_delete_fd_from_list(ep->fd);
+ ep->fd = INVALID_SOCKET;
+ }
+
+ if (ep->bfd != INVALID_SOCKET) {
+ msyslog(LOG_INFO,
+ "stop listening for broadcasts to %s on interface #%d %s",
+ stoa(&ep->bcast), ep->ifnum, ep->name);
+ close_and_delete_fd_from_list(ep->bfd);
+ ep->bfd = INVALID_SOCKET;
+ ep->flags &= ~INT_BCASTOPEN;
+ }
+
+ ninterfaces--;
+ mon_clearinterface(ep);
+
+ /* remove restrict interface entry */
+ SET_HOSTMASK(&resmask, AF(&ep->sin));
+ hack_restrict(RESTRICT_REMOVEIF, &ep->sin, &resmask,
+ RESM_NTPONLY | RESM_INTERFACE, RES_IGNORE, 0);
+}
+
+
+static void
+log_listen_address(
+ endpt * ep
+ )
+{
+ msyslog(LOG_INFO, "%s on %d %s %s",
+ (ep->ignore_packets)
+ ? "Listen and drop"
+ : "Listen normally",
+ ep->ifnum,
+ ep->name,
+ sptoa(&ep->sin));
+}
+
+
+static void
+create_wildcards(
+ u_short port
+ )
+{
+ int v4wild;
+#ifdef INCLUDE_IPV6_SUPPORT
+ int v6wild;
+#endif
+ sockaddr_u wildaddr;
+ nic_rule_action action;
+ struct interface * wildif;
+
+ /*
+ * silence "potentially uninitialized" warnings from VC9
+ * failing to follow the logic. Ideally action could remain
+ * uninitialized, and the memset be the first statement under
+ * the first if (v4wild).
+ */
+ action = ACTION_LISTEN;
+ ZERO(wildaddr);
+
+#ifdef INCLUDE_IPV6_SUPPORT
+ /*
+ * create pseudo-interface with wildcard IPv6 address
+ */
+ v6wild = ipv6_works;
+ if (v6wild) {
+ /* set wildaddr to the v6 wildcard address :: */
+ ZERO(wildaddr);
+ AF(&wildaddr) = AF_INET6;
+ SET_ADDR6N(&wildaddr, in6addr_any);
+ SET_PORT(&wildaddr, port);
+ SET_SCOPE(&wildaddr, 0);
+
+ /* check for interface/nic rules affecting the wildcard */
+ action = interface_action(NULL, &wildaddr, 0);
+ v6wild = (ACTION_IGNORE != action);
+ }
+ if (v6wild) {
+ wildif = new_interface(NULL);
+
+ strlcpy(wildif->name, "v6wildcard", sizeof(wildif->name));
+ memcpy(&wildif->sin, &wildaddr, sizeof(wildif->sin));
+ wildif->family = AF_INET6;
+ AF(&wildif->mask) = AF_INET6;
+ SET_ONESMASK(&wildif->mask);
+
+ wildif->flags = INT_UP | INT_WILDCARD;
+ wildif->ignore_packets = (ACTION_DROP == action);
+
+ wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);
+
+ if (wildif->fd != INVALID_SOCKET) {
+ wildipv6 = wildif;
+ any6_interface = wildif;
+ add_addr_to_list(&wildif->sin, wildif);
+ add_interface(wildif);
+ log_listen_address(wildif);
+ } else {
+ msyslog(LOG_ERR,
+ "unable to bind to wildcard address %s - another process may be running - EXITING",
+ stoa(&wildif->sin));
+ exit(1);
+ }
+ DPRINT_INTERFACE(2, (wildif, "created ", "\n"));
+ }
+#endif
+
+ /*
+ * create pseudo-interface with wildcard IPv4 address
+ */
+ v4wild = ipv4_works;
+ if (v4wild) {
+ /* set wildaddr to the v4 wildcard address 0.0.0.0 */
+ AF(&wildaddr) = AF_INET;
+ SET_ADDR4N(&wildaddr, INADDR_ANY);
+ SET_PORT(&wildaddr, port);
+
+ /* check for interface/nic rules affecting the wildcard */
+ action = interface_action(NULL, &wildaddr, 0);
+ v4wild = (ACTION_IGNORE != action);
+ }
+ if (v4wild) {
+ wildif = new_interface(NULL);
+
+ strlcpy(wildif->name, "v4wildcard", sizeof(wildif->name));
+ memcpy(&wildif->sin, &wildaddr, sizeof(wildif->sin));
+ wildif->family = AF_INET;
+ AF(&wildif->mask) = AF_INET;
+ SET_ONESMASK(&wildif->mask);
+
+ wildif->flags = INT_BROADCAST | INT_UP | INT_WILDCARD;
+ wildif->ignore_packets = (ACTION_DROP == action);
+#if defined(MCAST)
+ /*
+ * enable multicast reception on the broadcast socket
+ */
+ AF(&wildif->bcast) = AF_INET;
+ SET_ADDR4N(&wildif->bcast, INADDR_ANY);
+ SET_PORT(&wildif->bcast, port);
+#endif /* MCAST */
+ wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);
+
+ if (wildif->fd != INVALID_SOCKET) {
+ wildipv4 = wildif;
+ any_interface = wildif;
+
+ add_addr_to_list(&wildif->sin, wildif);
+ add_interface(wildif);
+ log_listen_address(wildif);
+ } else {
+ msyslog(LOG_ERR,
+ "unable to bind to wildcard address %s - another process may be running - EXITING",
+ stoa(&wildif->sin));
+ exit(1);
+ }
+ DPRINT_INTERFACE(2, (wildif, "created ", "\n"));
+ }
+}
+
+
+/*
+ * add_nic_rule() -- insert a rule entry at the head of nic_rule_list.
+ */
+void
+add_nic_rule(
+ nic_rule_match match_type,
+ const char * if_name, /* interface name or numeric address */
+ int prefixlen,
+ nic_rule_action action
+ )
+{
+ nic_rule * rule;
+ isc_boolean_t is_ip;
+
+ rule = emalloc_zero(sizeof(*rule));
+ rule->match_type = match_type;
+ rule->prefixlen = prefixlen;
+ rule->action = action;
+
+ if (MATCH_IFNAME == match_type) {
+ NTP_REQUIRE(NULL != if_name);
+ rule->if_name = estrdup(if_name);
+ } else if (MATCH_IFADDR == match_type) {
+ NTP_REQUIRE(NULL != if_name);
+ /* set rule->addr */
+ is_ip = is_ip_address(if_name, AF_UNSPEC, &rule->addr);
+ NTP_REQUIRE(is_ip);
+ } else
+ NTP_REQUIRE(NULL == if_name);
+
+ LINK_SLIST(nic_rule_list, rule, next);
+}
+
+
+#ifdef DEBUG
+static const char *
+action_text(
+ nic_rule_action action
+ )
+{
+ const char *t;
+
+ switch (action) {
+
+ default:
+ t = "ERROR"; /* quiet uninit warning */
+ DPRINTF(1, ("fatal: unknown nic_rule_action %d\n",
+ action));
+ NTP_ENSURE(0);
+ break;
+
+ case ACTION_LISTEN:
+ t = "listen";
+ break;
+
+ case ACTION_IGNORE:
+ t = "ignore";
+ break;
+
+ case ACTION_DROP:
+ t = "drop";
+ break;
+ }
+
+ return t;
+}
+#endif /* DEBUG */
+
+
+static nic_rule_action
+interface_action(
+ char * if_name,
+ sockaddr_u * if_addr,
+ u_int32 if_flags
+ )
+{
+ nic_rule * rule;
+ int isloopback;
+ int iswildcard;
+
+ DPRINTF(4, ("interface_action: interface %s ",
+ (if_name != NULL) ? if_name : "wildcard"));
+
+ iswildcard = is_wildcard_addr(if_addr);
+ isloopback = !!(INT_LOOPBACK & if_flags);
+
+ /*
+ * Find any matching NIC rule from --interface / -I or ntp.conf
+ * interface/nic rules.
+ */
+ for (rule = nic_rule_list; rule != NULL; rule = rule->next) {
+
+ switch (rule->match_type) {
+
+ case MATCH_ALL:
+ /* loopback and wildcard excluded from "all" */
+ if (isloopback || iswildcard)
+ break;
+ DPRINTF(4, ("nic all %s\n",
+ action_text(rule->action)));
+ return rule->action;
+
+ case MATCH_IPV4:
+ if (IS_IPV4(if_addr)) {
+ DPRINTF(4, ("nic ipv4 %s\n",
+ action_text(rule->action)));
+ return rule->action;
+ }
+ break;
+
+ case MATCH_IPV6:
+ if (IS_IPV6(if_addr)) {
+ DPRINTF(4, ("nic ipv6 %s\n",
+ action_text(rule->action)));
+ return rule->action;
+ }
+ break;
+
+ case MATCH_WILDCARD:
+ if (iswildcard) {
+ DPRINTF(4, ("nic wildcard %s\n",
+ action_text(rule->action)));
+ return rule->action;
+ }
+ break;
+
+ case MATCH_IFADDR:
+ if (rule->prefixlen != -1) {
+ if (addr_eqprefix(if_addr, &rule->addr,
+ rule->prefixlen)) {
+
+ DPRINTF(4, ("subnet address match - %s\n",
+ action_text(rule->action)));
+ return rule->action;
+ }
+ } else
+ if (SOCK_EQ(if_addr, &rule->addr)) {
+
+ DPRINTF(4, ("address match - %s\n",
+ action_text(rule->action)));
+ return rule->action;
+ }
+ break;
+
+ case MATCH_IFNAME:
+ if (if_name != NULL
+#if defined(HAVE_FNMATCH) && defined(FNM_CASEFOLD)
+ && !fnmatch(rule->if_name, if_name, FNM_CASEFOLD)
+#else
+ && !strcasecmp(if_name, rule->if_name)
+#endif
+ ) {
+
+ DPRINTF(4, ("interface name match - %s\n",
+ action_text(rule->action)));
+ return rule->action;
+ }
+ break;
+ }
+ }
+
+ /*
+ * Unless explicitly disabled such as with "nic ignore ::1"
+ * listen on loopback addresses. Since ntpq and ntpdc query
+ * "localhost" by default, which typically resolves to ::1 and
+ * 127.0.0.1, it's useful to default to listening on both.
+ */
+ if (isloopback) {
+ DPRINTF(4, ("default loopback listen\n"));
+ return ACTION_LISTEN;
+ }
+
+ /*
+ * Treat wildcard addresses specially. If there is no explicit
+ * "nic ... wildcard" or "nic ... 0.0.0.0" or "nic ... ::" rule
+ * default to drop.
+ */
+ if (iswildcard) {
+ DPRINTF(4, ("default wildcard drop\n"));
+ return ACTION_DROP;
+ }
+
+ /*
+ * Check for "virtual IP" (colon in the interface name) after
+ * the rules so that "ntpd --interface eth0:1 -novirtualips"
+ * does indeed listen on eth0:1's addresses.
+ */
+ if (!listen_to_virtual_ips && if_name != NULL
+ && (strchr(if_name, ':') != NULL)) {
+
+ DPRINTF(4, ("virtual ip - ignore\n"));
+ return ACTION_IGNORE;
+ }
+
+ /*
+ * If there are no --interface/-I command-line options and no
+ * interface/nic rules in ntp.conf, the default action is to
+ * listen. In the presence of rules from either, the default
+ * is to ignore. This implements ntpd's traditional listen-
+ * every default with no interface listen configuration, and
+ * ensures a single -I eth0 or "nic listen eth0" means do not
+ * listen on any other addresses.
+ */
+ if (NULL == nic_rule_list) {
+ DPRINTF(4, ("default listen\n"));
+ return ACTION_LISTEN;
+ }
+
+ DPRINTF(4, ("implicit ignore\n"));
+ return ACTION_IGNORE;
+}
+
+
+static void
+convert_isc_if(
+ isc_interface_t *isc_if,
+ endpt *itf,
+ u_short port
+ )
+{
+ const u_char v6loop[16] = {0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1};
+
+ strlcpy(itf->name, isc_if->name, sizeof(itf->name));
+ itf->ifindex = isc_if->ifindex;
+ itf->family = (u_short)isc_if->af;
+ AF(&itf->sin) = itf->family;
+ AF(&itf->mask) = itf->family;
+ AF(&itf->bcast) = itf->family;
+ SET_PORT(&itf->sin, port);
+ SET_PORT(&itf->mask, port);
+ SET_PORT(&itf->bcast, port);
+
+ if (IS_IPV4(&itf->sin)) {
+ NSRCADR(&itf->sin) = isc_if->address.type.in.s_addr;
+ NSRCADR(&itf->mask) = isc_if->netmask.type.in.s_addr;
+
+ if (isc_if->flags & INTERFACE_F_BROADCAST) {
+ itf->flags |= INT_BROADCAST;
+ NSRCADR(&itf->bcast) =
+ isc_if->broadcast.type.in.s_addr;
+ }
+ }
+#ifdef INCLUDE_IPV6_SUPPORT
+ else if (IS_IPV6(&itf->sin)) {
+ SET_ADDR6N(&itf->sin, isc_if->address.type.in6);
+ SET_ADDR6N(&itf->mask, isc_if->netmask.type.in6);
+
+ SET_SCOPE(&itf->sin, isc_if->address.zone);
+ }
+#endif /* INCLUDE_IPV6_SUPPORT */
+
+
+ /* Process the rest of the flags */
+
+ itf->flags |=
+ ((INTERFACE_F_UP & isc_if->flags)
+ ? INT_UP : 0)
+ | ((INTERFACE_F_LOOPBACK & isc_if->flags)
+ ? INT_LOOPBACK : 0)
+ | ((INTERFACE_F_POINTTOPOINT & isc_if->flags)
+ ? INT_PPP : 0)
+ | ((INTERFACE_F_MULTICAST & isc_if->flags)
+ ? INT_MULTICAST : 0)
+ | ((INTERFACE_F_PRIVACY & isc_if->flags)
+ ? INT_PRIVACY : 0)
+ ;
+
+ /*
+ * Clear the loopback flag if the address is not localhost.
+ * http://bugs.ntp.org/1683
+ */
+ if (INT_LOOPBACK & itf->flags) {
+ if (AF_INET == itf->family) {
+ if (127 != (SRCADR(&itf->sin) >> 24))
+ itf->flags &= ~INT_LOOPBACK;
+ } else {
+ if (memcmp(v6loop, NSRCADR6(&itf->sin),
+ sizeof(NSRCADR6(&itf->sin))))
+ itf->flags &= ~INT_LOOPBACK;
+ }
+ }
+}
+
+
+/*
+ * refresh_interface
+ *
+ * some OSes have been observed to keep
+ * cached routes even when more specific routes
+ * become available.
+ * this can be mitigated by re-binding
+ * the socket.
+ */
+static int
+refresh_interface(
+ struct interface * interface
+ )
+{
+#ifdef OS_MISSES_SPECIFIC_ROUTE_UPDATES
+ if (interface->fd != INVALID_SOCKET) {
+ int bcast = (interface->flags & INT_BCASTXMIT) != 0;
+ /* as we forcibly close() the socket remove the
+ broadcast permission indication */
+ if (bcast)
+ socket_broadcast_disable(interface, &interface->sin);
+
+ close_and_delete_fd_from_list(interface->fd);
+
+ /* create new socket picking up a new first hop binding
+ at connect() time */
+ interface->fd = open_socket(&interface->sin,
+ bcast, 0, interface);
+ /*
+ * reset TTL indication so TTL is is set again
+ * next time around
+ */
+ interface->last_ttl = 0;
+ return (interface->fd != INVALID_SOCKET);
+ } else
+ return 0; /* invalid sockets are not refreshable */
+#else /* !OS_MISSES_SPECIFIC_ROUTE_UPDATES */
+ return (interface->fd != INVALID_SOCKET);
+#endif /* !OS_MISSES_SPECIFIC_ROUTE_UPDATES */
+}
+
+/*
+ * interface_update - externally callable update function
+ */
+void
+interface_update(
+ interface_receiver_t receiver,
+ void * data)
+{
+ int new_interface_found;
+
+ if (disable_dynamic_updates)
+ return;
+
+ BLOCKIO();
+ new_interface_found = update_interfaces(NTP_PORT, receiver, data);
+ UNBLOCKIO();
+
+ if (!new_interface_found)
+ return;
+
+#ifdef DEBUG
+ msyslog(LOG_DEBUG, "new interface(s) found: waking up resolver");
+#endif
+ interrupt_worker_sleep();
+}
+
+
+/*
+ * sau_from_netaddr() - convert network address on-wire formats.
+ * Convert from libisc's isc_netaddr_t to NTP's sockaddr_u
+ */
+void
+sau_from_netaddr(
+ sockaddr_u *psau,
+ const isc_netaddr_t *pna
+ )
+{
+ ZERO_SOCK(psau);
+ AF(psau) = (u_short)pna->family;
+ switch (pna->family) {
+
+ case AF_INET:
+ memcpy(&psau->sa4.sin_addr, &pna->type.in,
+ sizeof(psau->sa4.sin_addr));
+ break;
+
+ case AF_INET6:
+ memcpy(&psau->sa6.sin6_addr, &pna->type.in6,
+ sizeof(psau->sa6.sin6_addr));
+ break;
+ }
+}
+
+
+static int
+is_wildcard_addr(
+ const sockaddr_u *psau
+ )
+{
+ if (IS_IPV4(psau) && !NSRCADR(psau))
+ return 1;
+
+#ifdef INCLUDE_IPV6_SUPPORT
+ if (IS_IPV6(psau) && S_ADDR6_EQ(psau, &in6addr_any))
+ return 1;
+#endif
+
+ return 0;
+}
+
+
+#ifdef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
+/*
+ * enable/disable re-use of wildcard address socket
+ */
+static void
+set_wildcard_reuse(
+ u_short family,
+ int on
+ )
+{
+ struct interface *any;
+ SOCKET fd = INVALID_SOCKET;
+
+ any = ANY_INTERFACE_BYFAM(family);
+ if (any != NULL)
+ fd = any->fd;
+
+ if (fd != INVALID_SOCKET) {
+ if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
+ (char *)&on, sizeof(on)))
+ msyslog(LOG_ERR,
+ "set_wildcard_reuse: setsockopt(SO_REUSEADDR, %s) failed: %m",
+ on ? "on" : "off");
+
+ DPRINTF(4, ("set SO_REUSEADDR to %s on %s\n",
+ on ? "on" : "off",
+ stoa(&any->sin)));
+ }
+}
+#endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */
+
+
+static isc_boolean_t
+is_anycast(
+ sockaddr_u *psau,
+ const char *name
+ )
+{
+#if defined(INCLUDE_IPV6_SUPPORT) && defined(SIOCGIFAFLAG_IN6) && \
+ defined(IN6_IFF_ANYCAST)
+ struct in6_ifreq ifr6;
+ int fd;
+ u_int32 flags6;
+
+ if (psau->sa.sa_family != AF_INET6)
+ return ISC_FALSE;
+ if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+ return ISC_FALSE;
+ ZERO(ifr6);
+ memcpy(&ifr6.ifr_addr, &psau->sa6, sizeof(ifr6.ifr_addr));
+ strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name));
+ if (ioctl(fd, SIOCGIFAFLAG_IN6, &ifr6) < 0) {
+ close(fd);
+ return ISC_FALSE;
+ }
+ close(fd);
+ flags6 = ifr6.ifr_ifru.ifru_flags6;
+ if ((flags6 & IN6_IFF_ANYCAST) != 0)
+ return ISC_TRUE;
+#endif /* INCLUDE_IPV6_SUPPORT && SIOCGIFAFLAG_IN6 && IN6_IFF_ANYCAST */
+ return ISC_FALSE;
+}
+
+
+/*
+ * update_interface strategy
+ *
+ * toggle configuration phase
+ *
+ * Phase 1:
+ * forall currently existing interfaces
+ * if address is known:
+ * drop socket - rebind again
+ *
+ * if address is NOT known:
+ * attempt to create a new interface entry
+ *
+ * Phase 2:
+ * forall currently known non MCAST and WILDCARD interfaces
+ * if interface does not match configuration phase (not seen in phase 1):
+ * remove interface from known interface list
+ * forall peers associated with this interface
+ * disconnect peer from this interface
+ *
+ * Phase 3:
+ * attempt to re-assign interfaces to peers
+ *
+ */
+
+static int
+update_interfaces(
+ u_short port,
+ interface_receiver_t receiver,
+ void * data
+ )
+{
+ isc_mem_t * mctx = (void *)-1;
+ interface_info_t ifi;
+ isc_interfaceiter_t * iter;
+ isc_result_t result;
+ isc_interface_t isc_if;
+ int new_interface_found;
+ unsigned int family;
+ endpt enumep;
+ endpt * ep;
+ endpt * next_ep;
+
+ DPRINTF(3, ("update_interfaces(%d)\n", port));
+
+ /*
+ * phase one - scan interfaces
+ * - create those that are not found
+ * - update those that are found
+ */
+
+ new_interface_found = FALSE;
+ iter = NULL;
+ result = isc_interfaceiter_create(mctx, &iter);
+
+ if (result != ISC_R_SUCCESS)
+ return 0;
+
+ /*
+ * Toggle system interface scan phase to find untouched
+ * interfaces to be deleted.
+ */
+ sys_interphase ^= 0x1;
+
+ for (result = isc_interfaceiter_first(iter);
+ ISC_R_SUCCESS == result;
+ result = isc_interfaceiter_next(iter)) {
+
+ result = isc_interfaceiter_current(iter, &isc_if);
+
+ if (result != ISC_R_SUCCESS)
+ break;
+
+ /* See if we have a valid family to use */
+ family = isc_if.address.family;
+ if (AF_INET != family && AF_INET6 != family)
+ continue;
+ if (AF_INET == family && !ipv4_works)
+ continue;
+ if (AF_INET6 == family && !ipv6_works)
+ continue;
+
+ /* create prototype */
+ init_interface(&enumep);
+
+ convert_isc_if(&isc_if, &enumep, port);
+
+ DPRINT_INTERFACE(4, (&enumep, "examining ", "\n"));
+
+ /*
+ * Check if and how we are going to use the interface.
+ */
+ switch (interface_action(enumep.name, &enumep.sin,
+ enumep.flags)) {
+
+ case ACTION_IGNORE:
+ DPRINTF(4, ("ignoring interface %s (%s) - by nic rules\n",
+ enumep.name, stoa(&enumep.sin)));
+ continue;
+
+ case ACTION_LISTEN:
+ DPRINTF(4, ("listen interface %s (%s) - by nic rules\n",
+ enumep.name, stoa(&enumep.sin)));
+ enumep.ignore_packets = ISC_FALSE;
+ break;
+
+ case ACTION_DROP:
+ DPRINTF(4, ("drop on interface %s (%s) - by nic rules\n",
+ enumep.name, stoa(&enumep.sin)));
+ enumep.ignore_packets = ISC_TRUE;
+ break;
+ }
+
+ /* interfaces must be UP to be usable */
+ if (!(enumep.flags & INT_UP)) {
+ DPRINTF(4, ("skipping interface %s (%s) - DOWN\n",
+ enumep.name, stoa(&enumep.sin)));
+ continue;
+ }
+
+ /*
+ * skip any interfaces UP and bound to a wildcard
+ * address - some dhcp clients produce that in the
+ * wild
+ */
+ if (is_wildcard_addr(&enumep.sin))
+ continue;
+
+ if (is_anycast(&enumep.sin, isc_if.name))
+ continue;
+
+ /*
+ * map to local *address* in order to map all duplicate
+ * interfaces to an endpt structure with the appropriate
+ * socket. Our name space is (ip-address), NOT
+ * (interface name, ip-address).
+ */
+ ep = getinterface(&enumep.sin, INT_WILDCARD);
+
+ if (ep != NULL && refresh_interface(ep)) {
+ /*
+ * found existing and up to date interface -
+ * mark present.
+ */
+ if (ep->phase != sys_interphase) {
+ /*
+ * On a new round we reset the name so
+ * the interface name shows up again if
+ * this address is no longer shared.
+ * We reset ignore_packets from the
+ * new prototype to respect any runtime
+ * changes to the nic rules.
+ */
+ strlcpy(ep->name, enumep.name,
+ sizeof(ep->name));
+ ep->ignore_packets =
+ enumep.ignore_packets;
+ } else {
+ /* name collision - rename interface */
+ strlcpy(ep->name, "*multiple*",
+ sizeof(ep->name));
+ }
+
+ DPRINT_INTERFACE(4, (ep, "updating ",
+ " present\n"));
+
+ if (ep->ignore_packets !=
+ enumep.ignore_packets) {
+ /*
+ * We have conflicting configurations
+ * for the interface address. This is
+ * caused by using -I <interfacename>
+ * for an interface that shares its
+ * address with other interfaces. We
+ * can not disambiguate incoming
+ * packets delivered to this socket
+ * without extra syscalls/features.
+ * These are not (commonly) available.
+ * Note this is a more unusual
+ * configuration where several
+ * interfaces share an address but
+ * filtering via interface name is
+ * attempted. We resolve the
+ * configuration conflict by disabling
+ * the processing of received packets.
+ * This leads to no service on the
+ * interface address where the conflict
+ * occurs.
+ */
+ msyslog(LOG_ERR,
+ "WARNING: conflicting enable configuration for interfaces %s and %s for address %s - unsupported configuration - address DISABLED",
+ enumep.name, ep->name,
+ stoa(&enumep.sin));
+
+ ep->ignore_packets = ISC_TRUE;
+ }
+
+ ep->phase = sys_interphase;
+
+ ifi.action = IFS_EXISTS;
+ ifi.ep = ep;
+ if (receiver != NULL)
+ (*receiver)(data, &ifi);
+ } else {
+ /*
+ * This is new or refreshing failed - add to
+ * our interface list. If refreshing failed we
+ * will delete the interface structure in phase
+ * 2 as the interface was not marked current.
+ * We can bind to the address as the refresh
+ * code already closed the offending socket
+ */
+ ep = create_interface(port, &enumep);
+
+ if (ep != NULL) {
+ ifi.action = IFS_CREATED;
+ ifi.ep = ep;
+ if (receiver != NULL)
+ (*receiver)(data, &ifi);
+
+ new_interface_found = TRUE;
+ DPRINT_INTERFACE(3,
+ (ep, "updating ",
+ " new - created\n"));
+ } else {
+ DPRINT_INTERFACE(3,
+ (&enumep, "updating ",
+ " new - creation FAILED"));
+
+ msyslog(LOG_INFO,
+ "failed to init interface for address %s",
+ stoa(&enumep.sin));
+ continue;
+ }
+ }
+ }
+
+ isc_interfaceiter_destroy(&iter);
+
+ /*
+ * phase 2 - delete gone interfaces - reassigning peers to
+ * other interfaces
+ */
+ for (ep = ep_list; ep != NULL; ep = next_ep) {
+ next_ep = ep->elink;
+
+ /*
+ * if phase does not match sys_phase this interface was
+ * not enumerated during the last interface scan - so it
+ * is gone and will be deleted here unless it did not
+ * originate from interface enumeration (INT_WILDCARD,
+ * INT_MCASTIF).
+ */
+ if (((INT_WILDCARD | INT_MCASTIF) & ep->flags) ||
+ ep->phase == sys_interphase)
+ continue;
+
+ DPRINT_INTERFACE(3, (ep, "updating ",
+ "GONE - deleting\n"));
+ remove_interface(ep);
+
+ ifi.action = IFS_DELETED;
+ ifi.ep = ep;
+ if (receiver != NULL)
+ (*receiver)(data, &ifi);
+
+ /* disconnect peers from deleted endpt. */
+ while (ep->peers != NULL)
+ set_peerdstadr(ep->peers, NULL);
+
+ /*
+ * update globals in case we lose
+ * a loopback interface
+ */
+ if (ep == loopback_interface)
+ loopback_interface = NULL;
+
+ delete_interface(ep);
+ }
+
+ /*
+ * phase 3 - re-configure as the world has possibly changed
+ *
+ * never ever make this conditional again - it is needed to track
+ * routing updates. see bug #2506
+ */
+ refresh_all_peerinterfaces();
+
+ if (broadcast_client_enabled)
+ io_setbclient();
+
+ return new_interface_found;
+}
+
+
+/*
+ * create_sockets - create a socket for each interface plus a default
+ * socket for when we don't know where to send
+ */
+static int
+create_sockets(
+ u_short port
+ )
+{
+#ifndef HAVE_IO_COMPLETION_PORT
+ /*
+ * I/O Completion Ports don't care about the select and FD_SET
+ */
+ maxactivefd = 0;
+ FD_ZERO(&activefds);
+#endif
+
+ DPRINTF(2, ("create_sockets(%d)\n", port));
+
+ create_wildcards(port);
+
+ update_interfaces(port, NULL, NULL);
+
+ /*
+ * Now that we have opened all the sockets, turn off the reuse
+ * flag for security.
+ */
+ set_reuseaddr(0);
+
+ DPRINTF(2, ("create_sockets: Total interfaces = %d\n", ninterfaces));
+
+ return ninterfaces;
+}
+
+/*
+ * create_interface - create a new interface for a given prototype
+ * binding the socket.
+ */
+static struct interface *
+create_interface(
+ u_short port,
+ struct interface * protot
+ )
+{
+ sockaddr_u resmask;
+ endpt * iface;
+#if defined(MCAST) && defined(MULTICAST_NONEWSOCKET)
+ remaddr_t * entry;
+ remaddr_t * next_entry;
+#endif
+ DPRINTF(2, ("create_interface(%s#%d)\n", stoa(&protot->sin),
+ port));
+
+ /* build an interface */
+ iface = new_interface(protot);
+
+ /*
+ * create socket
+ */
+ iface->fd = open_socket(&iface->sin, 0, 0, iface);
+
+ if (iface->fd != INVALID_SOCKET)
+ log_listen_address(iface);
+
+ if ((INT_BROADCAST & iface->flags)
+ && iface->bfd != INVALID_SOCKET)
+ msyslog(LOG_INFO, "Listening on broadcast address %s#%d",
+ stoa((&iface->bcast)), port);
+
+ if (INVALID_SOCKET == iface->fd
+ && INVALID_SOCKET == iface->bfd) {
+ msyslog(LOG_ERR, "unable to create socket on %s (%d) for %s#%d",
+ iface->name,
+ iface->ifnum,
+ stoa((&iface->sin)),
+ port);
+ delete_interface(iface);
+ return NULL;
+ }
+
+ /*
+ * Blacklist our own addresses, no use talking to ourself
+ */
+ SET_HOSTMASK(&resmask, AF(&iface->sin));
+ hack_restrict(RESTRICT_FLAGS, &iface->sin, &resmask,
+ RESM_NTPONLY | RESM_INTERFACE, RES_IGNORE, 0);
+
+ /*
+ * set globals with the first found
+ * loopback interface of the appropriate class
+ */
+ if (NULL == loopback_interface && AF_INET == iface->family
+ && (INT_LOOPBACK & iface->flags))
+ loopback_interface = iface;
+
+ /*
+ * put into our interface list
+ */
+ add_addr_to_list(&iface->sin, iface);
+ add_interface(iface);
+
+#if defined(MCAST) && defined(MULTICAST_NONEWSOCKET)
+ /*
+ * Join any previously-configured compatible multicast groups.
+ */
+ if (INT_MULTICAST & iface->flags &&
+ !((INT_LOOPBACK | INT_WILDCARD) & iface->flags) &&
+ !iface->ignore_packets) {
+ for (entry = remoteaddr_list;
+ entry != NULL;
+ entry = next_entry) {
+ next_entry = entry->link;
+ if (AF(&iface->sin) != AF(&entry->addr) ||
+ !IS_MCAST(&entry->addr))
+ continue;
+ if (socket_multicast_enable(iface,
+ &entry->addr))
+ msyslog(LOG_INFO,
+ "Joined %s socket to multicast group %s",
+ stoa(&iface->sin),
+ stoa(&entry->addr));
+ else
+ msyslog(LOG_ERR,
+ "Failed to join %s socket to multicast group %s",
+ stoa(&iface->sin),
+ stoa(&entry->addr));
+ }
+ }
+#endif /* MCAST && MCAST_NONEWSOCKET */
+
+ DPRINT_INTERFACE(2, (iface, "created ", "\n"));
+ return iface;
+}
+
+
+#ifdef SO_EXCLUSIVEADDRUSE
+static void
+set_excladdruse(
+ SOCKET fd
+ )
+{
+ int one = 1;
+ int failed;
+#ifdef SYS_WINNT
+ DWORD err;
+#endif
+
+ failed = setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
+ (char *)&one, sizeof(one));
+
+ if (!failed)
+ return;
+
+#ifdef SYS_WINNT
+ /*
+ * Prior to Windows XP setting SO_EXCLUSIVEADDRUSE can fail with
+ * error WSAINVAL depending on service pack level and whether
+ * the user account is in the Administrators group. Do not
+ * complain if it fails that way on versions prior to XP (5.1).
+ */
+ err = GetLastError();
+
+ if (isc_win32os_versioncheck(5, 1, 0, 0) < 0 /* < 5.1/XP */
+ && WSAEINVAL == err)
+ return;
+
+ SetLastError(err);
+#endif
+ msyslog(LOG_ERR,
+ "setsockopt(%d, SO_EXCLUSIVEADDRUSE, on): %m",
+ (int)fd);
+}
+#endif /* SO_EXCLUSIVEADDRUSE */
+
+
+/*
+ * set_reuseaddr() - set/clear REUSEADDR on all sockets
+ * NB possible hole - should we be doing this on broadcast
+ * fd's also?
+ */
+static void
+set_reuseaddr(
+ int flag
+ )
+{
+#ifndef SO_EXCLUSIVEADDRUSE
+ endpt *ep;
+
+ for (ep = ep_list; ep != NULL; ep = ep->elink) {
+ if (ep->flags & INT_WILDCARD)
+ continue;
+
+ /*
+ * if ep->fd is INVALID_SOCKET, we might have a adapter
+ * configured but not present
+ */
+ DPRINTF(4, ("setting SO_REUSEADDR on %.16s@%s to %s\n",
+ ep->name, stoa(&ep->sin),
+ flag ? "on" : "off"));
+
+ if (ep->fd != INVALID_SOCKET) {
+ if (setsockopt(ep->fd, SOL_SOCKET, SO_REUSEADDR,
+ (char *)&flag, sizeof(flag))) {
+ msyslog(LOG_ERR, "set_reuseaddr: setsockopt(%s, SO_REUSEADDR, %s) failed: %m",
+ stoa(&ep->sin), flag ? "on" : "off");
+ }
+ }
+ }
+#endif /* ! SO_EXCLUSIVEADDRUSE */
+}
+
+/*
+ * This is just a wrapper around an internal function so we can
+ * make other changes as necessary later on
+ */
+void
+enable_broadcast(
+ struct interface * iface,
+ sockaddr_u * baddr
+ )
+{
+#ifdef OPEN_BCAST_SOCKET
+ socket_broadcast_enable(iface, iface->fd, baddr);
+#endif
+}
+
+#ifdef OPEN_BCAST_SOCKET
+/*
+ * Enable a broadcast address to a given socket
+ * The socket is in the ep_list all we need to do is enable
+ * broadcasting. It is not this function's job to select the socket
+ */
+static isc_boolean_t
+socket_broadcast_enable(
+ struct interface * iface,
+ SOCKET fd,
+ sockaddr_u * baddr
+ )
+{
+#ifdef SO_BROADCAST
+ int on = 1;
+
+ if (IS_IPV4(baddr)) {
+ /* if this interface can support broadcast, set SO_BROADCAST */
+ if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST,
+ (char *)&on, sizeof(on)))
+ msyslog(LOG_ERR,
+ "setsockopt(SO_BROADCAST) enable failure on address %s: %m",
+ stoa(baddr));
+ else
+ DPRINTF(2, ("Broadcast enabled on socket %d for address %s\n",
+ fd, stoa(baddr)));
+ }
+ iface->flags |= INT_BCASTXMIT;
+ return ISC_TRUE;
+#else
+ return ISC_FALSE;
+#endif /* SO_BROADCAST */
+}
+
+/*
+ * Remove a broadcast address from a given socket
+ * The socket is in the ep_list all we need to do is disable
+ * broadcasting. It is not this function's job to select the socket
+ */
+static isc_boolean_t
+socket_broadcast_disable(
+ struct interface * iface,
+ sockaddr_u * baddr
+ )
+{
+#ifdef SO_BROADCAST
+ int off = 0; /* This seems to be OK as an int */
+
+ if (IS_IPV4(baddr) && setsockopt(iface->fd, SOL_SOCKET,
+ SO_BROADCAST, (char *)&off, sizeof(off)))
+ msyslog(LOG_ERR,
+ "setsockopt(SO_BROADCAST) disable failure on address %s: %m",
+ stoa(baddr));
+
+ iface->flags &= ~INT_BCASTXMIT;
+ return ISC_TRUE;
+#else
+ return ISC_FALSE;
+#endif /* SO_BROADCAST */
+}
+
+#endif /* OPEN_BCAST_SOCKET */
+
+/*
+ * return the broadcast client flag value
+ */
+isc_boolean_t
+get_broadcastclient_flag(void)
+{
+ return (broadcast_client_enabled);
+}
+/*
+ * Check to see if the address is a multicast address
+ */
+static isc_boolean_t
+addr_ismulticast(
+ sockaddr_u *maddr
+ )
+{
+ isc_boolean_t result;
+
+#ifndef INCLUDE_IPV6_MULTICAST_SUPPORT
+ /*
+ * If we don't have IPV6 support any IPV6 addr is not multicast
+ */
+ if (IS_IPV6(maddr))
+ result = ISC_FALSE;
+ else
+#endif
+ result = IS_MCAST(maddr);
+
+ if (!result)
+ DPRINTF(4, ("address %s is not multicast\n",
+ stoa(maddr)));
+
+ return result;
+}
+
+/*
+ * Multicast servers need to set the appropriate Multicast interface
+ * socket option in order for it to know which interface to use for
+ * send the multicast packet.
+ */
+void
+enable_multicast_if(
+ struct interface * iface,
+ sockaddr_u * maddr
+ )
+{
+#ifdef MCAST
+#ifdef IP_MULTICAST_LOOP
+ TYPEOF_IP_MULTICAST_LOOP off = 0;
+#endif
+#ifdef IPV6_MULTICAST_LOOP
+ u_int off6 = 0;
+#endif
+
+ NTP_REQUIRE(AF(maddr) == AF(&iface->sin));
+
+ switch (AF(&iface->sin)) {
+
+ case AF_INET:
+#ifdef IP_MULTICAST_LOOP
+ /*
+ * Don't send back to itself, but allow failure to set
+ */
+ if (setsockopt(iface->fd, IPPROTO_IP,
+ IP_MULTICAST_LOOP,
+ SETSOCKOPT_ARG_CAST &off,
+ sizeof(off))) {
+
+ msyslog(LOG_ERR,
+ "setsockopt IP_MULTICAST_LOOP failed: %m on socket %d, addr %s for multicast address %s",
+ iface->fd, stoa(&iface->sin),
+ stoa(maddr));
+ }
+#endif
+ break;
+
+ case AF_INET6:
+#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+#ifdef IPV6_MULTICAST_LOOP
+ /*
+ * Don't send back to itself, but allow failure to set
+ */
+ if (setsockopt(iface->fd, IPPROTO_IPV6,
+ IPV6_MULTICAST_LOOP,
+ (char *) &off6, sizeof(off6))) {
+
+ msyslog(LOG_ERR,
+ "setsockopt IPV6_MULTICAST_LOOP failed: %m on socket %d, addr %s for multicast address %s",
+ iface->fd, stoa(&iface->sin),
+ stoa(maddr));
+ }
+#endif
+ break;
+#else
+ return;
+#endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
+ }
+ return;
+#endif
+}
+
+/*
+ * Add a multicast address to a given socket
+ * The socket is in the ep_list all we need to do is enable
+ * multicasting. It is not this function's job to select the socket
+ */
+#if defined(MCAST)
+static isc_boolean_t
+socket_multicast_enable(
+ endpt * iface,
+ sockaddr_u * maddr
+ )
+{
+ struct ip_mreq mreq;
+#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+ struct ipv6_mreq mreq6;
+#endif
+ switch (AF(maddr)) {
+
+ case AF_INET:
+ ZERO(mreq);
+ mreq.imr_multiaddr = SOCK_ADDR4(maddr);
+ mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+ if (setsockopt(iface->fd,
+ IPPROTO_IP,
+ IP_ADD_MEMBERSHIP,
+ (char *)&mreq,
+ sizeof(mreq))) {
+ msyslog(LOG_ERR,
+ "setsockopt IP_ADD_MEMBERSHIP failed: %m on socket %d, addr %s for %x / %x (%s)",
+ iface->fd, stoa(&iface->sin),
+ mreq.imr_multiaddr.s_addr,
+ mreq.imr_interface.s_addr,
+ stoa(maddr));
+ return ISC_FALSE;
+ }
+ DPRINTF(4, ("Added IPv4 multicast membership on socket %d, addr %s for %x / %x (%s)\n",
+ iface->fd, stoa(&iface->sin),
+ mreq.imr_multiaddr.s_addr,
+ mreq.imr_interface.s_addr, stoa(maddr)));
+ break;
+
+ case AF_INET6:
+#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+ /*
+ * Enable reception of multicast packets.
+ * If the address is link-local we can get the
+ * interface index from the scope id. Don't do this
+ * for other types of multicast addresses. For now let
+ * the kernel figure it out.
+ */
+ ZERO(mreq6);
+ mreq6.ipv6mr_multiaddr = SOCK_ADDR6(maddr);
+ mreq6.ipv6mr_interface = iface->ifindex;
+
+ if (setsockopt(iface->fd, IPPROTO_IPV6,
+ IPV6_JOIN_GROUP, (char *)&mreq6,
+ sizeof(mreq6))) {
+ msyslog(LOG_ERR,
+ "setsockopt IPV6_JOIN_GROUP failed: %m on socket %d, addr %s for interface %u (%s)",
+ iface->fd, stoa(&iface->sin),
+ mreq6.ipv6mr_interface, stoa(maddr));
+ return ISC_FALSE;
+ }
+ DPRINTF(4, ("Added IPv6 multicast group on socket %d, addr %s for interface %u (%s)\n",
+ iface->fd, stoa(&iface->sin),
+ mreq6.ipv6mr_interface, stoa(maddr)));
+#else
+ return ISC_FALSE;
+#endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
+ }
+ iface->flags |= INT_MCASTOPEN;
+ iface->num_mcast++;
+
+ return ISC_TRUE;
+}
+#endif /* MCAST */
+
+
+/*
+ * Remove a multicast address from a given socket
+ * The socket is in the ep_list all we need to do is disable
+ * multicasting. It is not this function's job to select the socket
+ */
+#ifdef MCAST
+static isc_boolean_t
+socket_multicast_disable(
+ struct interface * iface,
+ sockaddr_u * maddr
+ )
+{
+#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+ struct ipv6_mreq mreq6;
+#endif
+ struct ip_mreq mreq;
+
+ ZERO(mreq);
+
+ if (find_addr_in_list(maddr) == NULL) {
+ DPRINTF(4, ("socket_multicast_disable(%s): not found\n",
+ stoa(maddr)));
+ return ISC_TRUE;
+ }
+
+ switch (AF(maddr)) {
+
+ case AF_INET:
+ mreq.imr_multiaddr = SOCK_ADDR4(maddr);
+ mreq.imr_interface = SOCK_ADDR4(&iface->sin);
+ if (setsockopt(iface->fd, IPPROTO_IP,
+ IP_DROP_MEMBERSHIP, (char *)&mreq,
+ sizeof(mreq))) {
+
+ msyslog(LOG_ERR,
+ "setsockopt IP_DROP_MEMBERSHIP failed: %m on socket %d, addr %s for %x / %x (%s)",
+ iface->fd, stoa(&iface->sin),
+ SRCADR(maddr), SRCADR(&iface->sin),
+ stoa(maddr));
+ return ISC_FALSE;
+ }
+ break;
+ case AF_INET6:
+#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+ /*
+ * Disable reception of multicast packets
+ * If the address is link-local we can get the
+ * interface index from the scope id. Don't do this
+ * for other types of multicast addresses. For now let
+ * the kernel figure it out.
+ */
+ mreq6.ipv6mr_multiaddr = SOCK_ADDR6(maddr);
+ mreq6.ipv6mr_interface = iface->ifindex;
+
+ if (setsockopt(iface->fd, IPPROTO_IPV6,
+ IPV6_LEAVE_GROUP, (char *)&mreq6,
+ sizeof(mreq6))) {
+
+ msyslog(LOG_ERR,
+ "setsockopt IPV6_LEAVE_GROUP failure: %m on socket %d, addr %s for %d (%s)",
+ iface->fd, stoa(&iface->sin),
+ iface->ifindex, stoa(maddr));
+ return ISC_FALSE;
+ }
+ break;
+#else
+ return ISC_FALSE;
+#endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
+ }
+
+ iface->num_mcast--;
+ if (!iface->num_mcast)
+ iface->flags &= ~INT_MCASTOPEN;
+
+ return ISC_TRUE;
+}
+#endif /* MCAST */
+
+/*
+ * io_setbclient - open the broadcast client sockets
+ */
+void
+io_setbclient(void)
+{
+#ifdef OPEN_BCAST_SOCKET
+ struct interface * interf;
+ int nif;
+
+ nif = 0;
+ set_reuseaddr(1);
+
+ for (interf = ep_list;
+ interf != NULL;
+ interf = interf->elink) {
+
+ if (interf->flags & (INT_WILDCARD | INT_LOOPBACK))
+ continue;
+
+ /* use only allowed addresses */
+ if (interf->ignore_packets)
+ continue;
+
+ /* Need a broadcast-capable interface */
+ if (!(interf->flags & INT_BROADCAST))
+ continue;
+
+ /* Only IPv4 addresses are valid for broadcast */
+ NTP_REQUIRE(IS_IPV4(&interf->sin));
+
+ /* Do we already have the broadcast address open? */
+ if (interf->flags & INT_BCASTOPEN) {
+ /*
+ * account for already open interfaces to avoid
+ * misleading warning below
+ */
+ nif++;
+ continue;
+ }
+
+ /*
+ * Try to open the broadcast address
+ */
+ interf->family = AF_INET;
+ interf->bfd = open_socket(&interf->bcast, 1, 0, interf);
+
+ /*
+ * If we succeeded then we use it otherwise enable
+ * broadcast on the interface address
+ */
+ if (interf->bfd != INVALID_SOCKET) {
+ nif++;
+ interf->flags |= INT_BCASTOPEN;
+ msyslog(LOG_INFO,
+ "Listen for broadcasts to %s on interface #%d %s",
+ stoa(&interf->bcast), interf->ifnum, interf->name);
+ } else {
+ /* silently ignore EADDRINUSE as we probably opened
+ the socket already for an address in the same network */
+ if (errno != EADDRINUSE)
+ msyslog(LOG_INFO,
+ "failed to listen for broadcasts to %s on interface #%d %s",
+ stoa(&interf->bcast), interf->ifnum, interf->name);
+ }
+ }
+ set_reuseaddr(0);
+ if (nif > 0) {
+ broadcast_client_enabled = ISC_TRUE;
+ DPRINTF(1, ("io_setbclient: listening to %d broadcast addresses\n", nif));
+ }
+ else if (!nif) {
+ broadcast_client_enabled = ISC_FALSE;
+ msyslog(LOG_ERR,
+ "Unable to listen for broadcasts, no broadcast interfaces available");
+ }
+#else
+ msyslog(LOG_ERR,
+ "io_setbclient: Broadcast Client disabled by build");
+#endif /* OPEN_BCAST_SOCKET */
+}
+
+/*
+ * io_unsetbclient - close the broadcast client sockets
+ */
+void
+io_unsetbclient(void)
+{
+ endpt *ep;
+
+ for (ep = ep_list; ep != NULL; ep = ep->elink) {
+ if (INT_WILDCARD & ep->flags)
+ continue;
+ if (!(INT_BCASTOPEN & ep->flags))
+ continue;
+
+ if (ep->bfd != INVALID_SOCKET) {
+ /* destroy broadcast listening socket */
+ msyslog(LOG_INFO,
+ "stop listening for broadcasts to %s on interface #%d %s",
+ stoa(&ep->bcast), ep->ifnum, ep->name);
+ close_and_delete_fd_from_list(ep->bfd);
+ ep->bfd = INVALID_SOCKET;
+ ep->flags &= ~INT_BCASTOPEN;
+ }
+ }
+ broadcast_client_enabled = ISC_FALSE;
+}
+
+/*
+ * io_multicast_add() - add multicast group address
+ */
+void
+io_multicast_add(
+ sockaddr_u *addr
+ )
+{
+#ifdef MCAST
+ endpt * ep;
+ endpt * one_ep;
+
+ /*
+ * Check to see if this is a multicast address
+ */
+ if (!addr_ismulticast(addr))
+ return;
+
+ /* If we already have it we can just return */
+ if (NULL != find_flagged_addr_in_list(addr, INT_MCASTOPEN)) {
+ msyslog(LOG_INFO,
+ "Duplicate request found for multicast address %s",
+ stoa(addr));
+ return;
+ }
+
+#ifndef MULTICAST_NONEWSOCKET
+ ep = new_interface(NULL);
+
+ /*
+ * Open a new socket for the multicast address
+ */
+ ep->sin = *addr;
+ SET_PORT(&ep->sin, NTP_PORT);
+ ep->family = AF(&ep->sin);
+ AF(&ep->mask) = ep->family;
+ SET_ONESMASK(&ep->mask);
+
+ set_reuseaddr(1);
+ ep->bfd = INVALID_SOCKET;
+ ep->fd = open_socket(&ep->sin, 0, 0, ep);
+ if (ep->fd != INVALID_SOCKET) {
+ ep->ignore_packets = ISC_FALSE;
+ ep->flags |= INT_MCASTIF;
+
+ strlcpy(ep->name, "multicast", sizeof(ep->name));
+ DPRINT_INTERFACE(2, (ep, "multicast add ", "\n"));
+ add_interface(ep);
+ log_listen_address(ep);
+ } else {
+ /* bind failed, re-use wildcard interface */
+ delete_interface(ep);
+
+ if (IS_IPV4(addr))
+ ep = wildipv4;
+ else if (IS_IPV6(addr))
+ ep = wildipv6;
+ else
+ ep = NULL;
+
+ if (ep != NULL) {
+ /* HACK ! -- stuff in an address */
+ /* because we don't bind addr? DH */
+ ep->bcast = *addr;
+ msyslog(LOG_ERR,
+ "multicast address %s using wildcard interface #%d %s",
+ stoa(addr), ep->ifnum, ep->name);
+ } else {
+ msyslog(LOG_ERR,
+ "No multicast socket available to use for address %s",
+ stoa(addr));
+ return;
+ }
+ }
+ { /* in place of the { following for in #else clause */
+ one_ep = ep;
+#else /* MULTICAST_NONEWSOCKET follows */
+ /*
+ * For the case where we can't use a separate socket (Windows)
+ * join each applicable endpoint socket to the group address.
+ */
+ if (IS_IPV4(addr))
+ one_ep = wildipv4;
+ else
+ one_ep = wildipv6;
+ for (ep = ep_list; ep != NULL; ep = ep->elink) {
+ if (ep->ignore_packets || AF(&ep->sin) != AF(addr) ||
+ !(INT_MULTICAST & ep->flags) ||
+ (INT_LOOPBACK | INT_WILDCARD) & ep->flags)
+ continue;
+ one_ep = ep;
+#endif /* MULTICAST_NONEWSOCKET */
+ if (socket_multicast_enable(ep, addr))
+ msyslog(LOG_INFO,
+ "Joined %s socket to multicast group %s",
+ stoa(&ep->sin),
+ stoa(addr));
+ else
+ msyslog(LOG_ERR,
+ "Failed to join %s socket to multicast group %s",
+ stoa(&ep->sin),
+ stoa(addr));
+ }
+
+ add_addr_to_list(addr, one_ep);
+#else /* !MCAST follows*/
+ msyslog(LOG_ERR,
+ "Can not add multicast address %s: no multicast support",
+ stoa(addr));
+#endif
+ return;
+}
+
+
+/*
+ * io_multicast_del() - delete multicast group address
+ */
+void
+io_multicast_del(
+ sockaddr_u * addr
+ )
+{
+#ifdef MCAST
+ endpt *iface;
+
+ /*
+ * Check to see if this is a multicast address
+ */
+ if (!addr_ismulticast(addr)) {
+ msyslog(LOG_ERR, "invalid multicast address %s",
+ stoa(addr));
+ return;
+ }
+
+ /*
+ * Disable reception of multicast packets
+ */
+ while ((iface = find_flagged_addr_in_list(addr, INT_MCASTOPEN))
+ != NULL)
+ socket_multicast_disable(iface, addr);
+
+ delete_addr_from_list(addr);
+
+#else /* not MCAST */
+ msyslog(LOG_ERR,
+ "Can not delete multicast address %s: no multicast support",
+ stoa(addr));
+#endif /* not MCAST */
+}
+
+
+/*
+ * open_socket - open a socket, returning the file descriptor
+ */
+
+static SOCKET
+open_socket(
+ sockaddr_u * addr,
+ int bcast,
+ int turn_off_reuse,
+ endpt * interf
+ )
+{
+ SOCKET fd;
+ int errval;
+ char scopetext[16];
+ /*
+ * int is OK for REUSEADR per
+ * http://www.kohala.com/start/mcast.api.txt
+ */
+ int on = 1;
+ int off = 0;
+
+#ifndef IPTOS_DSCP_EF
+#define IPTOS_DSCP_EF 0xb8
+#endif
+ int qos = IPTOS_DSCP_EF; /* QoS RFC3246 */
+
+ if (IS_IPV6(addr) && !ipv6_works)
+ return INVALID_SOCKET;
+
+ /* create a datagram (UDP) socket */
+ fd = socket(AF(addr), SOCK_DGRAM, 0);
+ if (INVALID_SOCKET == fd) {
+ errval = socket_errno();
+ msyslog(LOG_ERR,
+ "socket(AF_INET%s, SOCK_DGRAM, 0) failed on address %s: %m",
+ IS_IPV6(addr) ? "6" : "", stoa(addr));
+
+ if (errval == EPROTONOSUPPORT ||
+ errval == EAFNOSUPPORT ||
+ errval == EPFNOSUPPORT)
+ return (INVALID_SOCKET);
+
+ errno = errval;
+ msyslog(LOG_ERR,
+ "unexpected socket() error %m code %d (not EPROTONOSUPPORT nor EAFNOSUPPORT nor EPFNOSUPPORT) - exiting",
+ errno);
+ exit(1);
+ }
+
+#ifdef SYS_WINNT
+ connection_reset_fix(fd, addr);
+#endif
+ /*
+ * Fixup the file descriptor for some systems
+ * See bug #530 for details of the issue.
+ */
+ fd = move_fd(fd);
+
+ /*
+ * set SO_REUSEADDR since we will be binding the same port
+ * number on each interface according to turn_off_reuse.
+ * This is undesirable on Windows versions starting with
+ * Windows XP (numeric version 5.1).
+ */
+#ifdef SYS_WINNT
+ if (isc_win32os_versioncheck(5, 1, 0, 0) < 0) /* before 5.1 */
+#endif
+ if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
+ (char *)((turn_off_reuse)
+ ? &off
+ : &on),
+ sizeof(on))) {
+
+ msyslog(LOG_ERR,
+ "setsockopt SO_REUSEADDR %s fails for address %s: %m",
+ (turn_off_reuse)
+ ? "off"
+ : "on",
+ stoa(addr));
+ closesocket(fd);
+ return INVALID_SOCKET;
+ }
+#ifdef SO_EXCLUSIVEADDRUSE
+ /*
+ * setting SO_EXCLUSIVEADDRUSE on the wildcard we open
+ * first will cause more specific binds to fail.
+ */
+ if (!(interf->flags & INT_WILDCARD))
+ set_excladdruse(fd);
+#endif
+
+ /*
+ * IPv4 specific options go here
+ */
+ if (IS_IPV4(addr)) {
+#if defined(IPPROTO_IP) && defined(IP_TOS)
+ if (setsockopt(fd, IPPROTO_IP, IP_TOS, (char*)&qos,
+ sizeof(qos)))
+ msyslog(LOG_ERR,
+ "setsockopt IP_TOS (%02x) fails on address %s: %m",
+ qos, stoa(addr));
+#endif /* IPPROTO_IP && IP_TOS */
+ if (bcast)
+ socket_broadcast_enable(interf, fd, addr);
+ }
+
+ /*
+ * IPv6 specific options go here
+ */
+ if (IS_IPV6(addr)) {
+#if defined(IPPROTO_IPV6) && defined(IPV6_TCLASS)
+ if (setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, (char*)&qos,
+ sizeof(qos)))
+ msyslog(LOG_ERR,
+ "setsockopt IPV6_TCLASS (%02x) fails on address %s: %m",
+ qos, stoa(addr));
+#endif /* IPPROTO_IPV6 && IPV6_TCLASS */
+#ifdef IPV6_V6ONLY
+ if (isc_net_probe_ipv6only() == ISC_R_SUCCESS
+ && setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY,
+ (char*)&on, sizeof(on)))
+ msyslog(LOG_ERR,
+ "setsockopt IPV6_V6ONLY on fails on address %s: %m",
+ stoa(addr));
+#endif
+#ifdef IPV6_BINDV6ONLY
+ if (setsockopt(fd, IPPROTO_IPV6, IPV6_BINDV6ONLY,
+ (char*)&on, sizeof(on)))
+ msyslog(LOG_ERR,
+ "setsockopt IPV6_BINDV6ONLY on fails on address %s: %m",
+ stoa(addr));
+#endif
+ }
+
+#ifdef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
+ /*
+ * some OSes don't allow binding to more specific
+ * addresses if a wildcard address already bound
+ * to the port and SO_REUSEADDR is not set
+ */
+ if (!is_wildcard_addr(addr))
+ set_wildcard_reuse(AF(addr), 1);
+#endif
+
+ /*
+ * bind the local address.
+ */
+ errval = bind(fd, &addr->sa, SOCKLEN(addr));
+
+#ifdef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
+ if (!is_wildcard_addr(addr))
+ set_wildcard_reuse(AF(addr), 0);
+#endif
+
+ if (errval < 0) {
+ /*
+ * Don't log this under all conditions
+ */
+ if (turn_off_reuse == 0
+#ifdef DEBUG
+ || debug > 1
+#endif
+ ) {
+ if (SCOPE(addr))
+ snprintf(scopetext, sizeof(scopetext),
+ "%%%d", SCOPE(addr));
+ else
+ scopetext[0] = 0;
+
+ msyslog(LOG_ERR,
+ "bind(%d) AF_INET%s %s%s#%d%s flags 0x%x failed: %m",
+ fd, IS_IPV6(addr) ? "6" : "",
+ stoa(addr), scopetext, SRCPORT(addr),
+ IS_MCAST(addr) ? " (multicast)" : "",
+ interf->flags);
+ }
+
+ closesocket(fd);
+
+ return INVALID_SOCKET;
+ }
+
+#ifdef HAVE_TIMESTAMP
+ {
+ if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP,
+ (char*)&on, sizeof(on)))
+ msyslog(LOG_DEBUG,
+ "setsockopt SO_TIMESTAMP on fails on address %s: %m",
+ stoa(addr));
+ else
+ DPRINTF(4, ("setsockopt SO_TIMESTAMP enabled on fd %d address %s\n",
+ fd, stoa(addr)));
+ }
+#endif
+#ifdef HAVE_TIMESTAMPNS
+ {
+ if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPNS,
+ (char*)&on, sizeof(on)))
+ msyslog(LOG_DEBUG,
+ "setsockopt SO_TIMESTAMPNS on fails on address %s: %m",
+ stoa(addr));
+ else
+ DPRINTF(4, ("setsockopt SO_TIMESTAMPNS enabled on fd %d address %s\n",
+ fd, stoa(addr)));
+ }
+#endif
+#ifdef HAVE_BINTIME
+ {
+ if (setsockopt(fd, SOL_SOCKET, SO_BINTIME,
+ (char*)&on, sizeof(on)))
+ msyslog(LOG_DEBUG,
+ "setsockopt SO_BINTIME on fails on address %s: %m",
+ stoa(addr));
+ else
+ DPRINTF(4, ("setsockopt SO_BINTIME enabled on fd %d address %s\n",
+ fd, stoa(addr)));
+ }
+#endif
+
+ DPRINTF(4, ("bind(%d) AF_INET%s, addr %s%%%d#%d, flags 0x%x\n",
+ fd, IS_IPV6(addr) ? "6" : "", stoa(addr),
+ SCOPE(addr), SRCPORT(addr), interf->flags));
+
+ make_socket_nonblocking(fd);
+
+#ifdef HAVE_SIGNALED_IO
+ init_socket_sig(fd);
+#endif /* not HAVE_SIGNALED_IO */
+
+ add_fd_to_list(fd, FD_TYPE_SOCKET);
+
+#if !defined(SYS_WINNT) && !defined(VMS)
+ DPRINTF(4, ("flags for fd %d: 0x%x\n", fd,
+ fcntl(fd, F_GETFL, 0)));
+#endif /* SYS_WINNT || VMS */
+
+#if defined (HAVE_IO_COMPLETION_PORT)
+/*
+ * Add the socket to the completion port
+ */
+ if (io_completion_port_add_socket(fd, interf)) {
+ msyslog(LOG_ERR, "unable to set up io completion port - EXITING");
+ exit(1);
+ }
+#endif
+ return fd;
+}
+
+
+#ifdef SYS_WINNT
+#define sendto(fd, buf, len, flags, dest, destsz) \
+ io_completion_port_sendto(fd, buf, len, (sockaddr_u *)(dest))
+#endif
+
+/* XXX ELIMINATE sendpkt similar in ntpq.c, ntpdc.c, ntp_io.c, ntptrace.c */
+/*
+ * sendpkt - send a packet to the specified destination. Maintain a
+ * send error cache so that only the first consecutive error for a
+ * destination is logged.
+ */
+void
+sendpkt(
+ sockaddr_u * dest,
+ struct interface * ep,
+ int ttl,
+ struct pkt * pkt,
+ int len
+ )
+{
+ endpt * src;
+ int ismcast;
+ int cc;
+ int rc;
+ u_char cttl;
+
+ ismcast = IS_MCAST(dest);
+ if (!ismcast)
+ src = ep;
+ else
+ src = (IS_IPV4(dest))
+ ? mc4_list
+ : mc6_list;
+
+ if (NULL == src) {
+ /*
+ * unbound peer - drop request and wait for better
+ * network conditions
+ */
+ DPRINTF(2, ("%ssendpkt(dst=%s, ttl=%d, len=%d): no interface - IGNORED\n",
+ ismcast ? "\tMCAST\t***** " : "",
+ stoa(dest), ttl, len));
+ return;
+ }
+
+ do {
+ DPRINTF(2, ("%ssendpkt(%d, dst=%s, src=%s, ttl=%d, len=%d)\n",
+ ismcast ? "\tMCAST\t***** " : "", src->fd,
+ stoa(dest), stoa(&src->sin), ttl, len));
+#ifdef MCAST
+ /*
+ * for the moment we use the bcast option to set multicast ttl
+ */
+ if (ismcast && ttl > 0 && ttl != src->last_ttl) {
+ /*
+ * set the multicast ttl for outgoing packets
+ */
+ switch (AF(&src->sin)) {
+
+ case AF_INET :
+ cttl = (u_char)ttl;
+ rc = setsockopt(src->fd, IPPROTO_IP,
+ IP_MULTICAST_TTL,
+ (void *)&cttl,
+ sizeof(cttl));
+ break;
+
+# ifdef INCLUDE_IPV6_SUPPORT
+ case AF_INET6 :
+ rc = setsockopt(src->fd, IPPROTO_IPV6,
+ IPV6_MULTICAST_HOPS,
+ (void *)&ttl,
+ sizeof(ttl));
+ break;
+# endif /* INCLUDE_IPV6_SUPPORT */
+
+ default:
+ rc = 0;
+ }
+
+ if (!rc)
+ src->last_ttl = ttl;
+ else
+ msyslog(LOG_ERR,
+ "setsockopt IP_MULTICAST_TTL/IPV6_MULTICAST_HOPS fails on address %s: %m",
+ stoa(&src->sin));
+ }
+#endif /* MCAST */
+
+#ifdef SIM
+ cc = simulate_server(dest, src, pkt);
+#else
+ cc = sendto(src->fd, (char *)pkt, (u_int)len, 0,
+ &dest->sa, SOCKLEN(dest));
+#endif
+ if (cc == -1) {
+ src->notsent++;
+ packets_notsent++;
+ } else {
+ src->sent++;
+ packets_sent++;
+ }
+ if (ismcast)
+ src = src->mclink;
+ } while (ismcast && src != NULL);
+}
+
+
+#if !defined(HAVE_IO_COMPLETION_PORT)
+/*
+ * fdbits - generate ascii representation of fd_set (FAU debug support)
+ * HFDF format - highest fd first.
+ */
+static char *
+fdbits(
+ int count,
+ fd_set *set
+ )
+{
+ static char buffer[256];
+ char * buf = buffer;
+
+ count = min(count, 255);
+
+ while (count >= 0) {
+ *buf++ = FD_ISSET(count, set) ? '#' : '-';
+ count--;
+ }
+ *buf = '\0';
+
+ return buffer;
+}
+
+
+#ifdef REFCLOCK
+/*
+ * Routine to read the refclock packets for a specific interface
+ * Return the number of bytes read. That way we know if we should
+ * read it again or go on to the next one if no bytes returned
+ */
+static inline int
+read_refclock_packet(
+ SOCKET fd,
+ struct refclockio * rp,
+ l_fp ts
+ )
+{
+ int i;
+ int buflen;
+ int saved_errno;
+ int consumed;
+ struct recvbuf * rb;
+
+ rb = get_free_recv_buffer();
+
+ if (NULL == rb) {
+ /*
+ * No buffer space available - just drop the packet
+ */
+ char buf[RX_BUFF_SIZE];
+
+ buflen = read(fd, buf, sizeof buf);
+ packets_dropped++;
+ return (buflen);
+ }
+
+ i = (rp->datalen == 0
+ || rp->datalen > sizeof(rb->recv_space))
+ ? sizeof(rb->recv_space)
+ : rp->datalen;
+ do {
+ buflen = read(fd, (char *)&rb->recv_space, (u_int)i);
+ } while (buflen < 0 && EINTR == errno);
+
+ if (buflen <= 0) {
+ saved_errno = errno;
+ freerecvbuf(rb);
+ errno = saved_errno;
+ return buflen;
+ }
+
+ /*
+ * Got one. Mark how and when it got here,
+ * put it on the full list and do bookkeeping.
+ */
+ rb->recv_length = buflen;
+ rb->recv_peer = rp->srcclock;
+ rb->dstadr = 0;
+ rb->fd = fd;
+ rb->recv_time = ts;
+ rb->receiver = rp->clock_recv;
+
+ consumed = indicate_refclock_packet(rp, rb);
+ if (!consumed) {
+ rp->recvcount++;
+ packets_received++;
+ }
+
+ return buflen;
+}
+#endif /* REFCLOCK */
+
+
+#ifdef HAVE_PACKET_TIMESTAMP
+/*
+ * extract timestamps from control message buffer
+ */
+static l_fp
+fetch_timestamp(
+ struct recvbuf * rb,
+ struct msghdr * msghdr,
+ l_fp ts
+ )
+{
+ struct cmsghdr * cmsghdr;
+#ifdef HAVE_BINTIME
+ struct bintime * btp;
+#endif
+#ifdef HAVE_TIMESTAMPNS
+ struct timespec * tsp;
+#endif
+#ifdef HAVE_TIMESTAMP
+ struct timeval * tvp;
+#endif
+ unsigned long ticks;
+ double fuzz;
+ l_fp lfpfuzz;
+ l_fp nts;
+#ifdef DEBUG_TIMING
+ l_fp dts;
+#endif
+
+ cmsghdr = CMSG_FIRSTHDR(msghdr);
+ while (cmsghdr != NULL) {
+ switch (cmsghdr->cmsg_type)
+ {
+#ifdef HAVE_BINTIME
+ case SCM_BINTIME:
+#endif /* HAVE_BINTIME */
+#ifdef HAVE_TIMESTAMPNS
+ case SCM_TIMESTAMPNS:
+#endif /* HAVE_TIMESTAMPNS */
+#ifdef HAVE_TIMESTAMP
+ case SCM_TIMESTAMP:
+#endif /* HAVE_TIMESTAMP */
+#if defined(HAVE_BINTIME) || defined (HAVE_TIMESTAMPNS) || defined(HAVE_TIMESTAMP)
+ switch (cmsghdr->cmsg_type)
+ {
+#ifdef HAVE_BINTIME
+ case SCM_BINTIME:
+ btp = (struct bintime *)CMSG_DATA(cmsghdr);
+ /*
+ * bintime documentation is at http://phk.freebsd.dk/pubs/timecounter.pdf
+ */
+ nts.l_i = btp->sec + JAN_1970;
+ nts.l_uf = (u_int32)(btp->frac >> 32);
+ if (sys_tick > measured_tick &&
+ sys_tick > 1e-9) {
+ ticks = (unsigned long)(nts.l_uf / (unsigned long)(sys_tick * FRAC));
+ nts.l_uf = (unsigned long)(ticks * (unsigned long)(sys_tick * FRAC));
+ }
+ DPRINTF(4, ("fetch_timestamp: system bintime network time stamp: %ld.%09lu\n",
+ btp->sec, (unsigned long)((nts.l_uf / FRAC) * 1e9)));
+ break;
+#endif /* HAVE_BINTIME */
+#ifdef HAVE_TIMESTAMPNS
+ case SCM_TIMESTAMPNS:
+ tsp = (struct timespec *)CMSG_DATA(cmsghdr);
+ if (sys_tick > measured_tick &&
+ sys_tick > 1e-9) {
+ ticks = (unsigned long)((tsp->tv_nsec * 1e-9) /
+ sys_tick);
+ tsp->tv_nsec = (long)(ticks * 1e9 *
+ sys_tick);
+ }
+ DPRINTF(4, ("fetch_timestamp: system nsec network time stamp: %ld.%09ld\n",
+ tsp->tv_sec, tsp->tv_nsec));
+ nts = tspec_stamp_to_lfp(*tsp);
+ break;
+#endif /* HAVE_TIMESTAMPNS */
+#ifdef HAVE_TIMESTAMP
+ case SCM_TIMESTAMP:
+ tvp = (struct timeval *)CMSG_DATA(cmsghdr);
+ if (sys_tick > measured_tick &&
+ sys_tick > 1e-6) {
+ ticks = (unsigned long)((tvp->tv_usec * 1e-6) /
+ sys_tick);
+ tvp->tv_usec = (long)(ticks * 1e6 *
+ sys_tick);
+ }
+ DPRINTF(4, ("fetch_timestamp: system usec network time stamp: %ld.%06ld\n",
+ tvp->tv_sec, tvp->tv_usec));
+ nts = tval_stamp_to_lfp(*tvp);
+ break;
+#endif /* HAVE_TIMESTAMP */
+ }
+ fuzz = ntp_random() * 2. / FRAC * sys_fuzz;
+ DTOLFP(fuzz, &lfpfuzz);
+ L_ADD(&nts, &lfpfuzz);
+#ifdef DEBUG_TIMING
+ dts = ts;
+ L_SUB(&dts, &nts);
+ collect_timing(rb, "input processing delay", 1,
+ &dts);
+ DPRINTF(4, ("fetch_timestamp: timestamp delta: %s (incl. fuzz)\n",
+ lfptoa(&dts, 9)));
+#endif /* DEBUG_TIMING */
+ ts = nts; /* network time stamp */
+ break;
+#endif /* HAVE_BINTIME || HAVE_TIMESTAMPNS || HAVE_TIMESTAMP */
+
+ default:
+ DPRINTF(4, ("fetch_timestamp: skipping control message 0x%x\n",
+ cmsghdr->cmsg_type));
+ }
+ cmsghdr = CMSG_NXTHDR(msghdr, cmsghdr);
+ }
+ return ts;
+}
+#endif /* HAVE_PACKET_TIMESTAMP */
+
+
+/*
+ * Routine to read the network NTP packets for a specific interface
+ * Return the number of bytes read. That way we know if we should
+ * read it again or go on to the next one if no bytes returned
+ */
+static inline int
+read_network_packet(
+ SOCKET fd,
+ struct interface * itf,
+ l_fp ts
+ )
+{
+ GETSOCKNAME_SOCKLEN_TYPE fromlen;
+ int buflen;
+ register struct recvbuf *rb;
+#ifdef HAVE_PACKET_TIMESTAMP
+ struct msghdr msghdr;
+ struct iovec iovec;
+ char control[CMSG_BUFSIZE];
+#endif
+
+ /*
+ * Get a buffer and read the frame. If we
+ * haven't got a buffer, or this is received
+ * on a disallowed socket, just dump the
+ * packet.
+ */
+
+ rb = get_free_recv_buffer();
+ if (NULL == rb || itf->ignore_packets) {
+ char buf[RX_BUFF_SIZE];
+ sockaddr_u from;
+
+ if (rb != NULL)
+ freerecvbuf(rb);
+
+ fromlen = sizeof(from);
+ buflen = recvfrom(fd, buf, sizeof(buf), 0,
+ &from.sa, &fromlen);
+ DPRINTF(4, ("%s on (%lu) fd=%d from %s\n",
+ (itf->ignore_packets)
+ ? "ignore"
+ : "drop",
+ free_recvbuffs(), fd, stoa(&from)));
+ if (itf->ignore_packets)
+ packets_ignored++;
+ else
+ packets_dropped++;
+ return (buflen);
+ }
+
+ fromlen = sizeof(rb->recv_srcadr);
+
+#ifndef HAVE_PACKET_TIMESTAMP
+ rb->recv_length = recvfrom(fd, (char *)&rb->recv_space,
+ sizeof(rb->recv_space), 0,
+ &rb->recv_srcadr.sa, &fromlen);
+#else
+ iovec.iov_base = &rb->recv_space;
+ iovec.iov_len = sizeof(rb->recv_space);
+ msghdr.msg_name = &rb->recv_srcadr;
+ msghdr.msg_namelen = fromlen;
+ msghdr.msg_iov = &iovec;
+ msghdr.msg_iovlen = 1;
+ msghdr.msg_control = (void *)&control;
+ msghdr.msg_controllen = sizeof(control);
+ msghdr.msg_flags = 0;
+ rb->recv_length = recvmsg(fd, &msghdr, 0);
+#endif
+
+ buflen = rb->recv_length;
+
+ if (buflen == 0 || (buflen == -1 &&
+ (EWOULDBLOCK == errno
+#ifdef EAGAIN
+ || EAGAIN == errno
+#endif
+ ))) {
+ freerecvbuf(rb);
+ return (buflen);
+ } else if (buflen < 0) {
+ msyslog(LOG_ERR, "recvfrom(%s) fd=%d: %m",
+ stoa(&rb->recv_srcadr), fd);
+ DPRINTF(5, ("read_network_packet: fd=%d dropped (bad recvfrom)\n",
+ fd));
+ freerecvbuf(rb);
+ return (buflen);
+ }
+
+ DPRINTF(3, ("read_network_packet: fd=%d length %d from %s\n",
+ fd, buflen, stoa(&rb->recv_srcadr)));
+
+ /*
+ * Got one. Mark how and when it got here,
+ * put it on the full list and do bookkeeping.
+ */
+ rb->dstadr = itf;
+ rb->fd = fd;
+#ifdef HAVE_PACKET_TIMESTAMP
+ /* pick up a network time stamp if possible */
+ ts = fetch_timestamp(rb, &msghdr, ts);
+#endif
+ rb->recv_time = ts;
+ rb->receiver = receive;
+
+ add_full_recv_buffer(rb);
+
+ itf->received++;
+ packets_received++;
+ return (buflen);
+}
+
+/*
+ * attempt to handle io (select()/signaled IO)
+ */
+void
+io_handler(void)
+{
+# ifndef HAVE_SIGNALED_IO
+ fd_set rdfdes;
+ int nfound;
+
+ /*
+ * Use select() on all on all input fd's for unlimited
+ * time. select() will terminate on SIGALARM or on the
+ * reception of input. Using select() means we can't do
+ * robust signal handling and we get a potential race
+ * between checking for alarms and doing the select().
+ * Mostly harmless, I think.
+ */
+ /*
+ * On VMS, I suspect that select() can't be interrupted
+ * by a "signal" either, so I take the easy way out and
+ * have select() time out after one second.
+ * System clock updates really aren't time-critical,
+ * and - lacking a hardware reference clock - I have
+ * yet to learn about anything else that is.
+ */
+ rdfdes = activefds;
+# if !defined(VMS) && !defined(SYS_VXWORKS)
+ nfound = select(maxactivefd + 1, &rdfdes, NULL,
+ NULL, NULL);
+# else /* VMS, VxWorks */
+ /* make select() wake up after one second */
+ {
+ struct timeval t1;
+
+ t1.tv_sec = 1;
+ t1.tv_usec = 0;
+ nfound = select(maxactivefd + 1,
+ &rdfdes, NULL, NULL,
+ &t1);
+ }
+# endif /* VMS, VxWorks */
+ if (nfound > 0) {
+ l_fp ts;
+
+ get_systime(&ts);
+
+ input_handler(&ts);
+ } else if (nfound == -1 && errno != EINTR) {
+ msyslog(LOG_ERR, "select() error: %m");
+ }
+# ifdef DEBUG
+ else if (debug > 4) {
+ msyslog(LOG_DEBUG, "select(): nfound=%d, error: %m", nfound);
+ } else {
+ DPRINTF(1, ("select() returned %d: %m\n", nfound));
+ }
+# endif /* DEBUG */
+# else /* HAVE_SIGNALED_IO */
+ wait_for_signal();
+# endif /* HAVE_SIGNALED_IO */
+}
+
+/*
+ * input_handler - receive packets asynchronously
+ */
+static void
+input_handler(
+ l_fp * cts
+ )
+{
+ int buflen;
+ int n;
+ u_int idx;
+ int doing;
+ SOCKET fd;
+ blocking_child *c;
+ struct timeval tvzero;
+ l_fp ts; /* Timestamp at BOselect() gob */
+#ifdef DEBUG_TIMING
+ l_fp ts_e; /* Timestamp at EOselect() gob */
+#endif
+ fd_set fds;
+ size_t select_count;
+ endpt * ep;
+#ifdef REFCLOCK
+ struct refclockio *rp;
+ int saved_errno;
+ const char * clk;
+#endif
+#ifdef HAS_ROUTING_SOCKET
+ struct asyncio_reader * asyncio_reader;
+ struct asyncio_reader * next_asyncio_reader;
+#endif
+
+ handler_calls++;
+ select_count = 0;
+
+ /*
+ * If we have something to do, freeze a timestamp.
+ * See below for the other cases (nothing left to do or error)
+ */
+ ts = *cts;
+
+ /*
+ * Do a poll to see who has data
+ */
+
+ fds = activefds;
+ tvzero.tv_sec = tvzero.tv_usec = 0;
+
+ n = select(maxactivefd + 1, &fds, (fd_set *)0, (fd_set *)0,
+ &tvzero);
+
+ /*
+ * If there are no packets waiting just return
+ */
+ if (n < 0) {
+ int err = errno;
+ int j, b, prior;
+ /*
+ * extended FAU debugging output
+ */
+ if (err != EINTR)
+ msyslog(LOG_ERR,
+ "select(%d, %s, 0L, 0L, &0.0) error: %m",
+ maxactivefd + 1,
+ fdbits(maxactivefd, &activefds));
+ if (err != EBADF)
+ goto ih_return;
+ for (j = 0, prior = 0; j <= maxactivefd; j++) {
+ if (FD_ISSET(j, &activefds)) {
+ if (-1 != read(j, &b, 0)) {
+ prior = j;
+ continue;
+ }
+ msyslog(LOG_ERR,
+ "Removing bad file descriptor %d from select set",
+ j);
+ FD_CLR(j, &activefds);
+ if (j == maxactivefd)
+ maxactivefd = prior;
+ }
+ }
+ goto ih_return;
+ }
+ else if (n == 0)
+ goto ih_return;
+
+ ++handler_pkts;
+
+#ifdef REFCLOCK
+ /*
+ * Check out the reference clocks first, if any
+ */
+
+ if (refio != NULL) {
+ for (rp = refio; rp != NULL; rp = rp->next) {
+ fd = rp->fd;
+
+ if (!FD_ISSET(fd, &fds))
+ continue;
+ ++select_count;
+ buflen = read_refclock_packet(fd, rp, ts);
+ /*
+ * The first read must succeed after select()
+ * indicates readability, or we've reached
+ * a permanent EOF. http://bugs.ntp.org/1732
+ * reported ntpd munching CPU after a USB GPS
+ * was unplugged because select was indicating
+ * EOF but ntpd didn't remove the descriptor
+ * from the activefds set.
+ */
+ if (buflen < 0 && EAGAIN != errno) {
+ saved_errno = errno;
+ clk = refnumtoa(&rp->srcclock->srcadr);
+ errno = saved_errno;
+ msyslog(LOG_ERR, "%s read: %m", clk);
+ maintain_activefds(fd, TRUE);
+ } else if (0 == buflen) {
+ clk = refnumtoa(&rp->srcclock->srcadr);
+ msyslog(LOG_ERR, "%s read EOF", clk);
+ maintain_activefds(fd, TRUE);
+ } else {
+ /* drain any remaining refclock input */
+ do {
+ buflen = read_refclock_packet(fd, rp, ts);
+ } while (buflen > 0);
+ }
+ }
+ }
+#endif /* REFCLOCK */
+
+ /*
+ * Loop through the interfaces looking for data to read.
+ */
+ for (ep = ep_list; ep != NULL; ep = ep->elink) {
+ for (doing = 0; doing < 2; doing++) {
+ if (!doing) {
+ fd = ep->fd;
+ } else {
+ if (!(ep->flags & INT_BCASTOPEN))
+ break;
+ fd = ep->bfd;
+ }
+ if (fd < 0)
+ continue;
+ if (FD_ISSET(fd, &fds))
+ do {
+ ++select_count;
+ buflen = read_network_packet(
+ fd, ep, ts);
+ } while (buflen > 0);
+ /* Check more interfaces */
+ }
+ }
+
+#ifdef HAS_ROUTING_SOCKET
+ /*
+ * scan list of asyncio readers - currently only used for routing sockets
+ */
+ asyncio_reader = asyncio_reader_list;
+
+ while (asyncio_reader != NULL) {
+ /* callback may unlink and free asyncio_reader */
+ next_asyncio_reader = asyncio_reader->link;
+ if (FD_ISSET(asyncio_reader->fd, &fds)) {
+ ++select_count;
+ (*asyncio_reader->receiver)(asyncio_reader);
+ }
+ asyncio_reader = next_asyncio_reader;
+ }
+#endif /* HAS_ROUTING_SOCKET */
+
+ /*
+ * Check for a response from a blocking child
+ */
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+ if (NULL == c || -1 == c->resp_read_pipe)
+ continue;
+ if (FD_ISSET(c->resp_read_pipe, &fds)) {
+ select_count++;
+ process_blocking_resp(c);
+ }
+ }
+
+ /*
+ * Done everything from that select.
+ * If nothing to do, just return.
+ * If an error occurred, complain and return.
+ */
+ if (select_count == 0) { /* We really had nothing to do */
+#ifdef DEBUG
+ if (debug)
+ msyslog(LOG_DEBUG, "input_handler: select() returned 0");
+#endif /* DEBUG */
+ goto ih_return;
+ }
+ /* We've done our work */
+#ifdef DEBUG_TIMING
+ get_systime(&ts_e);
+ /*
+ * (ts_e - ts) is the amount of time we spent
+ * processing this gob of file descriptors. Log
+ * it.
+ */
+ L_SUB(&ts_e, &ts);
+ collect_timing(NULL, "input handler", 1, &ts_e);
+ if (debug > 3)
+ msyslog(LOG_DEBUG,
+ "input_handler: Processed a gob of fd's in %s msec",
+ lfptoms(&ts_e, 6));
+#endif /* DEBUG_TIMING */
+ /* We're done... */
+ ih_return:
+ return;
+}
+#endif /* !HAVE_IO_COMPLETION_PORT */
+
+
+/*
+ * find an interface suitable for the src address
+ */
+endpt *
+select_peerinterface(
+ struct peer * peer,
+ sockaddr_u * srcadr,
+ endpt * dstadr
+ )
+{
+ endpt *ep;
+#ifndef SIM
+ endpt *wild;
+
+ wild = ANY_INTERFACE_CHOOSE(srcadr);
+
+ /*
+ * Initialize the peer structure and dance the interface jig.
+ * Reference clocks step the loopback waltz, the others
+ * squaredance around the interface list looking for a buddy. If
+ * the dance peters out, there is always the wildcard interface.
+ * This might happen in some systems and would preclude proper
+ * operation with public key cryptography.
+ */
+ if (ISREFCLOCKADR(srcadr)) {
+ ep = loopback_interface;
+ } else if (peer->cast_flags &
+ (MDF_BCLNT | MDF_ACAST | MDF_MCAST | MDF_BCAST)) {
+ ep = findbcastinter(srcadr);
+ if (ep != NULL)
+ DPRINTF(4, ("Found *-cast interface %s for address %s\n",
+ stoa(&ep->sin), stoa(srcadr)));
+ else
+ DPRINTF(4, ("No *-cast local address found for address %s\n",
+ stoa(srcadr)));
+ } else {
+ ep = dstadr;
+ if (NULL == ep)
+ ep = wild;
+ }
+ /*
+ * If it is a multicast address, findbcastinter() may not find
+ * it. For unicast, we get to find the interface when dstadr is
+ * given to us as the wildcard (ANY_INTERFACE_CHOOSE). Either
+ * way, try a little harder.
+ */
+ if (wild == ep)
+ ep = findinterface(srcadr);
+ /*
+ * we do not bind to the wildcard interfaces for output
+ * as our (network) source address would be undefined and
+ * crypto will not work without knowing the own transmit address
+ */
+ if (ep != NULL && INT_WILDCARD & ep->flags)
+ if (!accept_wildcard_if_for_winnt)
+ ep = NULL;
+#else /* SIM follows */
+ ep = loopback_interface;
+#endif
+
+ return ep;
+}
+
+
+/*
+ * findinterface - find local interface corresponding to address
+ */
+endpt *
+findinterface(
+ sockaddr_u *addr
+ )
+{
+ endpt *iface;
+
+ iface = findlocalinterface(addr, INT_WILDCARD, 0);
+
+ if (NULL == iface) {
+ DPRINTF(4, ("Found no interface for address %s - returning wildcard\n",
+ stoa(addr)));
+
+ iface = ANY_INTERFACE_CHOOSE(addr);
+ } else
+ DPRINTF(4, ("Found interface #%d %s for address %s\n",
+ iface->ifnum, iface->name, stoa(addr)));
+
+ return iface;
+}
+
+/*
+ * findlocalinterface - find local interface corresponding to addr,
+ * which does not have any of flags set. If bast is nonzero, addr is
+ * a broadcast address.
+ *
+ * This code attempts to find the local sending address for an outgoing
+ * address by connecting a new socket to destinationaddress:NTP_PORT
+ * and reading the sockname of the resulting connect.
+ * the complicated sequence simulates the routing table lookup
+ * for to first hop without duplicating any of the routing logic into
+ * ntpd. preferably we would have used an API call - but its not there -
+ * so this is the best we can do here short of duplicating to entire routing
+ * logic in ntpd which would be a silly and really unportable thing to do.
+ *
+ */
+static endpt *
+findlocalinterface(
+ sockaddr_u * addr,
+ int flags,
+ int bcast
+ )
+{
+ GETSOCKNAME_SOCKLEN_TYPE sockaddrlen;
+ endpt * iface;
+ sockaddr_u saddr;
+ SOCKET s;
+ int rtn;
+ int on;
+
+ DPRINTF(4, ("Finding interface for addr %s in list of addresses\n",
+ stoa(addr)));
+
+ s = socket(AF(addr), SOCK_DGRAM, 0);
+ if (INVALID_SOCKET == s)
+ return NULL;
+
+ /*
+ * If we are looking for broadcast interface we need to set this
+ * socket to allow broadcast
+ */
+ if (bcast) {
+ on = 1;
+ if (SOCKET_ERROR == setsockopt(s, SOL_SOCKET,
+ SO_BROADCAST,
+ (char *)&on,
+ sizeof(on))) {
+ closesocket(s);
+ return NULL;
+ }
+ }
+
+ rtn = connect(s, &addr->sa, SOCKLEN(addr));
+ if (SOCKET_ERROR == rtn) {
+ closesocket(s);
+ return NULL;
+ }
+
+ sockaddrlen = sizeof(saddr);
+ rtn = getsockname(s, &saddr.sa, &sockaddrlen);
+ closesocket(s);
+ if (SOCKET_ERROR == rtn)
+ return NULL;
+
+ DPRINTF(4, ("findlocalinterface: kernel maps %s to %s\n",
+ stoa(addr), stoa(&saddr)));
+
+ iface = getinterface(&saddr, flags);
+
+ /*
+ * if we didn't find an exact match on saddr, find the closest
+ * available local address. This handles the case of the
+ * address suggested by the kernel being excluded by nic rules
+ * or the user's -I and -L options to ntpd.
+ * See http://bugs.ntp.org/1184 and http://bugs.ntp.org/1683
+ * for more background.
+ */
+ if (NULL == iface || iface->ignore_packets)
+ iface = findclosestinterface(&saddr,
+ flags | INT_LOOPBACK);
+
+ /* Don't use an interface which will ignore replies */
+ if (iface != NULL && iface->ignore_packets)
+ iface = NULL;
+
+ return iface;
+}
+
+
+/*
+ * findclosestinterface
+ *
+ * If there are -I/--interface or -L/novirtualips command-line options,
+ * or "nic" or "interface" rules in ntp.conf, findlocalinterface() may
+ * find the kernel's preferred local address for a given peer address is
+ * administratively unavailable to ntpd, and punt to this routine's more
+ * expensive search.
+ *
+ * Find the numerically closest local address to the one connect()
+ * suggested. This matches an address on the same subnet first, as
+ * needed by Bug 1184, and provides a consistent choice if there are
+ * multiple feasible local addresses, regardless of the order ntpd
+ * enumerated them.
+ */
+endpt *
+findclosestinterface(
+ sockaddr_u * addr,
+ int flags
+ )
+{
+ endpt * ep;
+ endpt * winner;
+ sockaddr_u addr_dist;
+ sockaddr_u min_dist;
+
+ ZERO_SOCK(&min_dist);
+ winner = NULL;
+
+ for (ep = ep_list; ep != NULL; ep = ep->elink) {
+ if (ep->ignore_packets ||
+ AF(addr) != ep->family ||
+ flags & ep->flags)
+ continue;
+
+ calc_addr_distance(&addr_dist, addr, &ep->sin);
+ if (NULL == winner ||
+ -1 == cmp_addr_distance(&addr_dist, &min_dist)) {
+ min_dist = addr_dist;
+ winner = ep;
+ }
+ }
+ if (NULL == winner)
+ DPRINTF(4, ("findclosestinterface(%s) failed\n",
+ stoa(addr)));
+ else
+ DPRINTF(4, ("findclosestinterface(%s) -> %s\n",
+ stoa(addr), stoa(&winner->sin)));
+
+ return winner;
+}
+
+
+/*
+ * calc_addr_distance - calculate the distance between two addresses,
+ * the absolute value of the difference between
+ * the addresses numerically, stored as an address.
+ */
+static void
+calc_addr_distance(
+ sockaddr_u * dist,
+ const sockaddr_u * a1,
+ const sockaddr_u * a2
+ )
+{
+ u_int32 a1val;
+ u_int32 a2val;
+ u_int32 v4dist;
+ int found_greater;
+ int a1_greater;
+ int i;
+
+ NTP_REQUIRE(AF(a1) == AF(a2));
+
+ ZERO_SOCK(dist);
+ AF(dist) = AF(a1);
+
+ /* v4 can be done a bit simpler */
+ if (IS_IPV4(a1)) {
+ a1val = SRCADR(a1);
+ a2val = SRCADR(a2);
+ v4dist = (a1val > a2val)
+ ? a1val - a2val
+ : a2val - a1val;
+ SET_ADDR4(dist, v4dist);
+
+ return;
+ }
+
+ found_greater = FALSE;
+ a1_greater = FALSE; /* suppress pot. uninit. warning */
+ for (i = 0; i < sizeof(NSRCADR6(a1)); i++) {
+ if (!found_greater &&
+ NSRCADR6(a1)[i] != NSRCADR6(a2)[i]) {
+ found_greater = TRUE;
+ a1_greater = (NSRCADR6(a1)[i] > NSRCADR6(a2)[i]);
+ }
+ if (!found_greater) {
+ NSRCADR6(dist)[i] = 0;
+ } else {
+ if (a1_greater)
+ NSRCADR6(dist)[i] = NSRCADR6(a1)[i] -
+ NSRCADR6(a2)[i];
+ else
+ NSRCADR6(dist)[i] = NSRCADR6(a2)[i] -
+ NSRCADR6(a1)[i];
+ }
+ }
+}
+
+
+/*
+ * cmp_addr_distance - compare two address distances, returning -1, 0,
+ * 1 to indicate their relationship.
+ */
+static int
+cmp_addr_distance(
+ const sockaddr_u * d1,
+ const sockaddr_u * d2
+ )
+{
+ int i;
+
+ NTP_REQUIRE(AF(d1) == AF(d2));
+
+ if (IS_IPV4(d1)) {
+ if (SRCADR(d1) < SRCADR(d2))
+ return -1;
+ else if (SRCADR(d1) == SRCADR(d2))
+ return 0;
+ else
+ return 1;
+ }
+
+ for (i = 0; i < sizeof(NSRCADR6(d1)); i++) {
+ if (NSRCADR6(d1)[i] < NSRCADR6(d2)[i])
+ return -1;
+ else if (NSRCADR6(d1)[i] > NSRCADR6(d2)[i])
+ return 1;
+ }
+
+ return 0;
+}
+
+
+
+/*
+ * fetch an interface structure the matches the
+ * address and has the given flags NOT set
+ */
+endpt *
+getinterface(
+ sockaddr_u * addr,
+ u_int32 flags
+ )
+{
+ endpt *iface;
+
+ iface = find_addr_in_list(addr);
+
+ if (iface != NULL && (iface->flags & flags))
+ iface = NULL;
+
+ return iface;
+}
+
+
+/*
+ * findbcastinter - find broadcast interface corresponding to address
+ */
+endpt *
+findbcastinter(
+ sockaddr_u *addr
+ )
+{
+ endpt * iface;
+
+ iface = NULL;
+#if !defined(MPE) && (defined(SIOCGIFCONF) || defined(SYS_WINNT))
+ DPRINTF(4, ("Finding broadcast/multicast interface for addr %s in list of addresses\n",
+ stoa(addr)));
+
+ iface = findlocalinterface(addr, INT_LOOPBACK | INT_WILDCARD,
+ 1);
+ if (iface != NULL) {
+ DPRINTF(4, ("Easily found bcast-/mcast- interface index #%d %s\n",
+ iface->ifnum, iface->name));
+ return iface;
+ }
+
+ /*
+ * plan B - try to find something reasonable in our lists in
+ * case kernel lookup doesn't help
+ */
+ for (iface = ep_list; iface != NULL; iface = iface->elink) {
+ if (iface->flags & INT_WILDCARD)
+ continue;
+
+ /* Don't bother with ignored interfaces */
+ if (iface->ignore_packets)
+ continue;
+
+ /*
+ * First look if this is the correct family
+ */
+ if(AF(&iface->sin) != AF(addr))
+ continue;
+
+ /* Skip the loopback addresses */
+ if (iface->flags & INT_LOOPBACK)
+ continue;
+
+ /*
+ * If we are looking to match a multicast address and
+ * this interface is one...
+ */
+ if (addr_ismulticast(addr)
+ && (iface->flags & INT_MULTICAST)) {
+#ifdef INCLUDE_IPV6_SUPPORT
+ /*
+ * ...it is the winner unless we're looking for
+ * an interface to use for link-local multicast
+ * and its address is not link-local.
+ */
+ if (IS_IPV6(addr)
+ && IN6_IS_ADDR_MC_LINKLOCAL(PSOCK_ADDR6(addr))
+ && !IN6_IS_ADDR_LINKLOCAL(PSOCK_ADDR6(&iface->sin)))
+ continue;
+#endif
+ break;
+ }
+
+ /*
+ * We match only those interfaces marked as
+ * broadcastable and either the explicit broadcast
+ * address or the network portion of the IP address.
+ * Sloppy.
+ */
+ if (IS_IPV4(addr)) {
+ if (SOCK_EQ(&iface->bcast, addr))
+ break;
+
+ if ((NSRCADR(&iface->sin) & NSRCADR(&iface->mask))
+ == (NSRCADR(addr) & NSRCADR(&iface->mask)))
+ break;
+ }
+#ifdef INCLUDE_IPV6_SUPPORT
+ else if (IS_IPV6(addr)) {
+ if (SOCK_EQ(&iface->bcast, addr))
+ break;
+
+ if (SOCK_EQ(netof(&iface->sin), netof(addr)))
+ break;
+ }
+#endif
+ }
+#endif /* SIOCGIFCONF */
+ if (NULL == iface) {
+ DPRINTF(4, ("No bcast interface found for %s\n",
+ stoa(addr)));
+ iface = ANY_INTERFACE_CHOOSE(addr);
+ } else {
+ DPRINTF(4, ("Found bcast-/mcast- interface index #%d %s\n",
+ iface->ifnum, iface->name));
+ }
+
+ return iface;
+}
+
+
+/*
+ * io_clr_stats - clear I/O module statistics
+ */
+void
+io_clr_stats(void)
+{
+ packets_dropped = 0;
+ packets_ignored = 0;
+ packets_received = 0;
+ packets_sent = 0;
+ packets_notsent = 0;
+
+ handler_calls = 0;
+ handler_pkts = 0;
+ io_timereset = current_time;
+}
+
+
+#ifdef REFCLOCK
+/*
+ * io_addclock - add a reference clock to the list and arrange that we
+ * get SIGIO interrupts from it.
+ */
+int
+io_addclock(
+ struct refclockio *rio
+ )
+{
+ BLOCKIO();
+
+ /*
+ * Stuff the I/O structure in the list and mark the descriptor
+ * in use. There is a harmless (I hope) race condition here.
+ */
+ rio->active = TRUE;
+
+# ifdef HAVE_SIGNALED_IO
+ if (init_clock_sig(rio)) {
+ UNBLOCKIO();
+ return 0;
+ }
+# elif defined(HAVE_IO_COMPLETION_PORT)
+ if (io_completion_port_add_clock_io(rio)) {
+ UNBLOCKIO();
+ return 0;
+ }
+# endif
+
+ /*
+ * enqueue
+ */
+ LINK_SLIST(refio, rio, next);
+
+ /*
+ * register fd
+ */
+ add_fd_to_list(rio->fd, FD_TYPE_FILE);
+
+ UNBLOCKIO();
+ return 1;
+}
+
+
+/*
+ * io_closeclock - close the clock in the I/O structure given
+ */
+void
+io_closeclock(
+ struct refclockio *rio
+ )
+{
+ struct refclockio *unlinked;
+
+ BLOCKIO();
+
+ /*
+ * Remove structure from the list
+ */
+ rio->active = FALSE;
+ UNLINK_SLIST(unlinked, refio, rio, next, struct refclockio);
+ if (NULL != unlinked) {
+ purge_recv_buffers_for_fd(rio->fd);
+ /*
+ * Close the descriptor.
+ */
+ close_and_delete_fd_from_list(rio->fd);
+ }
+ rio->fd = -1;
+
+ UNBLOCKIO();
+}
+#endif /* REFCLOCK */
+
+
+/*
+ * On NT a SOCKET is an unsigned int so we cannot possibly keep it in
+ * an array. So we use one of the ISC_LIST functions to hold the
+ * socket value and use that when we want to enumerate it.
+ *
+ * This routine is called by the forked intres child process to close
+ * all open sockets. On Windows there's no need as intres runs in
+ * the same process as a thread.
+ */
+#ifndef SYS_WINNT
+void
+kill_asyncio(
+ int startfd
+ )
+{
+ BLOCKIO();
+
+ /*
+ * In the child process we do not maintain activefds and
+ * maxactivefd. Zeroing maxactivefd disables code which
+ * maintains it in close_and_delete_fd_from_list().
+ */
+ maxactivefd = 0;
+
+ while (fd_list != NULL)
+ close_and_delete_fd_from_list(fd_list->fd);
+
+ UNBLOCKIO();
+}
+#endif /* !SYS_WINNT */
+
+
+/*
+ * Add and delete functions for the list of open sockets
+ */
+static void
+add_fd_to_list(
+ SOCKET fd,
+ enum desc_type type
+ )
+{
+ vsock_t *lsock = emalloc(sizeof(*lsock));
+
+ lsock->fd = fd;
+ lsock->type = type;
+
+ LINK_SLIST(fd_list, lsock, link);
+ maintain_activefds(fd, 0);
+}
+
+
+static void
+close_and_delete_fd_from_list(
+ SOCKET fd
+ )
+{
+ vsock_t *lsock;
+
+ UNLINK_EXPR_SLIST(lsock, fd_list, fd ==
+ UNLINK_EXPR_SLIST_CURRENT()->fd, link, vsock_t);
+
+ if (NULL == lsock)
+ return;
+
+ switch (lsock->type) {
+
+ case FD_TYPE_SOCKET:
+ closesocket(lsock->fd);
+ break;
+
+ case FD_TYPE_FILE:
+ closeserial(lsock->fd);
+ break;
+
+ default:
+ msyslog(LOG_ERR,
+ "internal error - illegal descriptor type %d - EXITING",
+ (int)lsock->type);
+ exit(1);
+ }
+
+ free(lsock);
+ /*
+ * remove from activefds
+ */
+ maintain_activefds(fd, 1);
+}
+
+
+static void
+add_addr_to_list(
+ sockaddr_u * addr,
+ endpt * ep
+ )
+{
+ remaddr_t *laddr;
+
+#ifdef DEBUG
+ if (find_addr_in_list(addr) == NULL) {
+#endif
+ /* not there yet - add to list */
+ laddr = emalloc(sizeof(*laddr));
+ laddr->addr = *addr;
+ laddr->ep = ep;
+
+ LINK_SLIST(remoteaddr_list, laddr, link);
+
+ DPRINTF(4, ("Added addr %s to list of addresses\n",
+ stoa(addr)));
+#ifdef DEBUG
+ } else
+ DPRINTF(4, ("WARNING: Attempt to add duplicate addr %s to address list\n",
+ stoa(addr)));
+#endif
+}
+
+
+static void
+delete_addr_from_list(
+ sockaddr_u *addr
+ )
+{
+ remaddr_t *unlinked;
+
+ UNLINK_EXPR_SLIST(unlinked, remoteaddr_list, SOCK_EQ(addr,
+ &(UNLINK_EXPR_SLIST_CURRENT()->addr)), link, remaddr_t);
+
+ if (unlinked != NULL) {
+ DPRINTF(4, ("Deleted addr %s from list of addresses\n",
+ stoa(addr)));
+ free(unlinked);
+ }
+}
+
+
+static void
+delete_interface_from_list(
+ endpt *iface
+ )
+{
+ remaddr_t *unlinked;
+
+ for (;;) {
+ UNLINK_EXPR_SLIST(unlinked, remoteaddr_list, iface ==
+ UNLINK_EXPR_SLIST_CURRENT()->ep, link,
+ remaddr_t);
+
+ if (unlinked == NULL)
+ break;
+ DPRINTF(4, ("Deleted addr %s for interface #%d %s from list of addresses\n",
+ stoa(&unlinked->addr), iface->ifnum,
+ iface->name));
+ free(unlinked);
+ }
+}
+
+
+static struct interface *
+find_addr_in_list(
+ sockaddr_u *addr
+ )
+{
+ remaddr_t *entry;
+
+ DPRINTF(4, ("Searching for addr %s in list of addresses - ",
+ stoa(addr)));
+
+ for (entry = remoteaddr_list;
+ entry != NULL;
+ entry = entry->link)
+ if (SOCK_EQ(&entry->addr, addr)) {
+ DPRINTF(4, ("FOUND\n"));
+ return entry->ep;
+ }
+
+ DPRINTF(4, ("NOT FOUND\n"));
+ return NULL;
+}
+
+
+/*
+ * Find the given address with the all given flags set in the list
+ */
+static endpt *
+find_flagged_addr_in_list(
+ sockaddr_u * addr,
+ u_int32 flags
+ )
+{
+ remaddr_t *entry;
+
+ DPRINTF(4, ("Finding addr %s with flags %d in list: ",
+ stoa(addr), flags));
+
+ for (entry = remoteaddr_list;
+ entry != NULL;
+ entry = entry->link)
+
+ if (SOCK_EQ(&entry->addr, addr)
+ && (entry->ep->flags & flags) == flags) {
+
+ DPRINTF(4, ("FOUND\n"));
+ return entry->ep;
+ }
+
+ DPRINTF(4, ("NOT FOUND\n"));
+ return NULL;
+}
+
+
+const char *
+localaddrtoa(
+ endpt *la
+ )
+{
+ return (NULL == la)
+ ? "<null>"
+ : stoa(&la->sin);
+}
+
+
+#ifdef HAS_ROUTING_SOCKET
+# ifndef UPDATE_GRACE
+# define UPDATE_GRACE 2 /* wait UPDATE_GRACE seconds before scanning */
+# endif
+
+static void
+process_routing_msgs(struct asyncio_reader *reader)
+{
+ char buffer[5120];
+ int cnt, msg_type;
+#ifdef HAVE_RTNETLINK
+ struct nlmsghdr *nh;
+#else
+ struct rt_msghdr rtm;
+ char *p;
+#endif
+
+ if (disable_dynamic_updates) {
+ /*
+ * discard ourselves if we are not needed any more
+ * usually happens when running unprivileged
+ */
+ remove_asyncio_reader(reader);
+ delete_asyncio_reader(reader);
+ return;
+ }
+
+ cnt = read(reader->fd, buffer, sizeof(buffer));
+
+ if (cnt < 0) {
+ msyslog(LOG_ERR,
+ "i/o error on routing socket %m - disabling");
+ remove_asyncio_reader(reader);
+ delete_asyncio_reader(reader);
+ return;
+ }
+
+ /*
+ * process routing message
+ */
+#ifdef HAVE_RTNETLINK
+ for (nh = (struct nlmsghdr *)buffer;
+ NLMSG_OK(nh, cnt);
+ nh = NLMSG_NEXT(nh, cnt)) {
+ msg_type = nh->nlmsg_type;
+#else
+ for (p = buffer;
+ (p + sizeof(struct rt_msghdr)) <= (buffer + cnt);
+ p += rtm.rtm_msglen) {
+ memcpy(&rtm, p, sizeof(rtm));
+ if (rtm.rtm_version != RTM_VERSION) {
+ msyslog(LOG_ERR,
+ "version mismatch (got %d - expected %d) on routing socket - disabling",
+ rtm.rtm_version, RTM_VERSION);
+
+ remove_asyncio_reader(reader);
+ delete_asyncio_reader(reader);
+ return;
+ }
+ msg_type = rtm.rtm_type;
+#endif
+ switch (msg_type) {
+#ifdef RTM_NEWADDR
+ case RTM_NEWADDR:
+#endif
+#ifdef RTM_DELADDR
+ case RTM_DELADDR:
+#endif
+#ifdef RTM_ADD
+ case RTM_ADD:
+#endif
+#ifdef RTM_DELETE
+ case RTM_DELETE:
+#endif
+#ifdef RTM_REDIRECT
+ case RTM_REDIRECT:
+#endif
+#ifdef RTM_CHANGE
+ case RTM_CHANGE:
+#endif
+#ifdef RTM_LOSING
+ case RTM_LOSING:
+#endif
+#ifdef RTM_IFINFO
+ case RTM_IFINFO:
+#endif
+#ifdef RTM_IFANNOUNCE
+ case RTM_IFANNOUNCE:
+#endif
+#ifdef RTM_NEWLINK
+ case RTM_NEWLINK:
+#endif
+#ifdef RTM_DELLINK
+ case RTM_DELLINK:
+#endif
+#ifdef RTM_NEWROUTE
+ case RTM_NEWROUTE:
+#endif
+#ifdef RTM_DELROUTE
+ case RTM_DELROUTE:
+#endif
+ /*
+ * we are keen on new and deleted addresses and
+ * if an interface goes up and down or routing
+ * changes
+ */
+ DPRINTF(3, ("routing message op = %d: scheduling interface update\n",
+ msg_type));
+ timer_interfacetimeout(current_time + UPDATE_GRACE);
+ break;
+#ifdef HAVE_RTNETLINK
+ case NLMSG_DONE:
+ /* end of multipart message */
+ return;
+#endif
+ default:
+ /*
+ * the rest doesn't bother us.
+ */
+ DPRINTF(4, ("routing message op = %d: ignored\n",
+ msg_type));
+ break;
+ }
+ }
+}
+
+/*
+ * set up routing notifications
+ */
+static void
+init_async_notifications()
+{
+ struct asyncio_reader *reader;
+#ifdef HAVE_RTNETLINK
+ int fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ struct sockaddr_nl sa;
+#else
+ int fd = socket(PF_ROUTE, SOCK_RAW, 0);
+#endif
+ if (fd < 0) {
+ msyslog(LOG_ERR,
+ "unable to open routing socket (%m) - using polled interface update");
+ return;
+ }
+
+ fd = move_fd(fd);
+#ifdef HAVE_RTNETLINK
+ ZERO(sa);
+ sa.nl_family = PF_NETLINK;
+ sa.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR
+ | RTMGRP_IPV6_IFADDR | RTMGRP_IPV4_ROUTE
+ | RTMGRP_IPV4_MROUTE | RTMGRP_IPV6_ROUTE
+ | RTMGRP_IPV6_MROUTE;
+ if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
+ msyslog(LOG_ERR,
+ "bind failed on routing socket (%m) - using polled interface update");
+ return;
+ }
+#endif
+ make_socket_nonblocking(fd);
+#if defined(HAVE_SIGNALED_IO)
+ init_socket_sig(fd);
+#endif /* HAVE_SIGNALED_IO */
+
+ reader = new_asyncio_reader();
+
+ reader->fd = fd;
+ reader->receiver = process_routing_msgs;
+
+ add_asyncio_reader(reader, FD_TYPE_SOCKET);
+ msyslog(LOG_INFO,
+ "Listening on routing socket on fd #%d for interface updates",
+ fd);
+}
+#else
+/* HAS_ROUTING_SOCKET not defined */
+static void
+init_async_notifications(void)
+{
+}
+#endif
+
diff --git a/ntpd/ntp_keyword.h b/ntpd/ntp_keyword.h
new file mode 100644
index 0000000..8b82ec0
--- /dev/null
+++ b/ntpd/ntp_keyword.h
@@ -0,0 +1,1032 @@
+/*
+ * ntp_keyword.h
+ *
+ * NOTE: edit this file with caution, it is generated by keyword-gen.c
+ * Generated 2013-08-04 04:56:14 UTC diff_ignore_line
+ *
+ */
+#include "ntp_scanner.h"
+#include "ntp_parser.h"
+
+#define LOWEST_KEYWORD_ID 258
+
+const char * const keyword_text[186] = {
+ /* 0 258 T_Abbrev */ "abbrev",
+ /* 1 259 T_Age */ "age",
+ /* 2 260 T_All */ "all",
+ /* 3 261 T_Allan */ "allan",
+ /* 4 262 T_Allpeers */ "allpeers",
+ /* 5 263 T_Auth */ "auth",
+ /* 6 264 T_Autokey */ "autokey",
+ /* 7 265 T_Automax */ "automax",
+ /* 8 266 T_Average */ "average",
+ /* 9 267 T_Bclient */ "bclient",
+ /* 10 268 T_Beacon */ "beacon",
+ /* 11 269 T_Broadcast */ "broadcast",
+ /* 12 270 T_Broadcastclient */ "broadcastclient",
+ /* 13 271 T_Broadcastdelay */ "broadcastdelay",
+ /* 14 272 T_Burst */ "burst",
+ /* 15 273 T_Calibrate */ "calibrate",
+ /* 16 274 T_Ceiling */ "ceiling",
+ /* 17 275 T_Clockstats */ "clockstats",
+ /* 18 276 T_Cohort */ "cohort",
+ /* 19 277 T_ControlKey */ "controlkey",
+ /* 20 278 T_Crypto */ "crypto",
+ /* 21 279 T_Cryptostats */ "cryptostats",
+ /* 22 280 T_Ctl */ "ctl",
+ /* 23 281 T_Day */ "day",
+ /* 24 282 T_Default */ "default",
+ /* 25 283 T_Digest */ "digest",
+ /* 26 284 T_Disable */ "disable",
+ /* 27 285 T_Discard */ "discard",
+ /* 28 286 T_Dispersion */ "dispersion",
+ /* 29 287 T_Double */ NULL,
+ /* 30 288 T_Driftfile */ "driftfile",
+ /* 31 289 T_Drop */ "drop",
+ /* 32 290 T_Ellipsis */ "...",
+ /* 33 291 T_Enable */ "enable",
+ /* 34 292 T_End */ "end",
+ /* 35 293 T_False */ NULL,
+ /* 36 294 T_File */ "file",
+ /* 37 295 T_Filegen */ "filegen",
+ /* 38 296 T_Filenum */ "filenum",
+ /* 39 297 T_Flag1 */ "flag1",
+ /* 40 298 T_Flag2 */ "flag2",
+ /* 41 299 T_Flag3 */ "flag3",
+ /* 42 300 T_Flag4 */ "flag4",
+ /* 43 301 T_Flake */ "flake",
+ /* 44 302 T_Floor */ "floor",
+ /* 45 303 T_Freq */ "freq",
+ /* 46 304 T_Fudge */ "fudge",
+ /* 47 305 T_Host */ "host",
+ /* 48 306 T_Huffpuff */ "huffpuff",
+ /* 49 307 T_Iburst */ "iburst",
+ /* 50 308 T_Ident */ "ident",
+ /* 51 309 T_Ignore */ "ignore",
+ /* 52 310 T_Incalloc */ "incalloc",
+ /* 53 311 T_Incmem */ "incmem",
+ /* 54 312 T_Initalloc */ "initalloc",
+ /* 55 313 T_Initmem */ "initmem",
+ /* 56 314 T_Includefile */ "includefile",
+ /* 57 315 T_Integer */ NULL,
+ /* 58 316 T_Interface */ "interface",
+ /* 59 317 T_Intrange */ NULL,
+ /* 60 318 T_Io */ "io",
+ /* 61 319 T_Ipv4 */ "ipv4",
+ /* 62 320 T_Ipv4_flag */ "-4",
+ /* 63 321 T_Ipv6 */ "ipv6",
+ /* 64 322 T_Ipv6_flag */ "-6",
+ /* 65 323 T_Kernel */ "kernel",
+ /* 66 324 T_Key */ "key",
+ /* 67 325 T_Keys */ "keys",
+ /* 68 326 T_Keysdir */ "keysdir",
+ /* 69 327 T_Kod */ "kod",
+ /* 70 328 T_Mssntp */ "mssntp",
+ /* 71 329 T_Leapfile */ "leapfile",
+ /* 72 330 T_Limited */ "limited",
+ /* 73 331 T_Link */ "link",
+ /* 74 332 T_Listen */ "listen",
+ /* 75 333 T_Logconfig */ "logconfig",
+ /* 76 334 T_Logfile */ "logfile",
+ /* 77 335 T_Loopstats */ "loopstats",
+ /* 78 336 T_Lowpriotrap */ "lowpriotrap",
+ /* 79 337 T_Manycastclient */ "manycastclient",
+ /* 80 338 T_Manycastserver */ "manycastserver",
+ /* 81 339 T_Mask */ "mask",
+ /* 82 340 T_Maxage */ "maxage",
+ /* 83 341 T_Maxclock */ "maxclock",
+ /* 84 342 T_Maxdepth */ "maxdepth",
+ /* 85 343 T_Maxdist */ "maxdist",
+ /* 86 344 T_Maxmem */ "maxmem",
+ /* 87 345 T_Maxpoll */ "maxpoll",
+ /* 88 346 T_Mem */ "mem",
+ /* 89 347 T_Memlock */ "memlock",
+ /* 90 348 T_Minclock */ "minclock",
+ /* 91 349 T_Mindepth */ "mindepth",
+ /* 92 350 T_Mindist */ "mindist",
+ /* 93 351 T_Minimum */ "minimum",
+ /* 94 352 T_Minpoll */ "minpoll",
+ /* 95 353 T_Minsane */ "minsane",
+ /* 96 354 T_Mode */ "mode",
+ /* 97 355 T_Mode7 */ "mode7",
+ /* 98 356 T_Monitor */ "monitor",
+ /* 99 357 T_Month */ "month",
+ /* 100 358 T_Mru */ "mru",
+ /* 101 359 T_Multicastclient */ "multicastclient",
+ /* 102 360 T_Nic */ "nic",
+ /* 103 361 T_Nolink */ "nolink",
+ /* 104 362 T_Nomodify */ "nomodify",
+ /* 105 363 T_Nomrulist */ "nomrulist",
+ /* 106 364 T_None */ "none",
+ /* 107 365 T_Nonvolatile */ "nonvolatile",
+ /* 108 366 T_Nopeer */ "nopeer",
+ /* 109 367 T_Noquery */ "noquery",
+ /* 110 368 T_Noselect */ "noselect",
+ /* 111 369 T_Noserve */ "noserve",
+ /* 112 370 T_Notrap */ "notrap",
+ /* 113 371 T_Notrust */ "notrust",
+ /* 114 372 T_Ntp */ "ntp",
+ /* 115 373 T_Ntpport */ "ntpport",
+ /* 116 374 T_NtpSignDsocket */ "ntpsigndsocket",
+ /* 117 375 T_Orphan */ "orphan",
+ /* 118 376 T_Orphanwait */ "orphanwait",
+ /* 119 377 T_Panic */ "panic",
+ /* 120 378 T_Peer */ "peer",
+ /* 121 379 T_Peerstats */ "peerstats",
+ /* 122 380 T_Phone */ "phone",
+ /* 123 381 T_Pid */ "pid",
+ /* 124 382 T_Pidfile */ "pidfile",
+ /* 125 383 T_Pool */ "pool",
+ /* 126 384 T_Port */ "port",
+ /* 127 385 T_Preempt */ "preempt",
+ /* 128 386 T_Prefer */ "prefer",
+ /* 129 387 T_Protostats */ "protostats",
+ /* 130 388 T_Pw */ "pw",
+ /* 131 389 T_Randfile */ "randfile",
+ /* 132 390 T_Rawstats */ "rawstats",
+ /* 133 391 T_Refid */ "refid",
+ /* 134 392 T_Requestkey */ "requestkey",
+ /* 135 393 T_Reset */ "reset",
+ /* 136 394 T_Restrict */ "restrict",
+ /* 137 395 T_Revoke */ "revoke",
+ /* 138 396 T_Rlimit */ "rlimit",
+ /* 139 397 T_Saveconfigdir */ "saveconfigdir",
+ /* 140 398 T_Server */ "server",
+ /* 141 399 T_Setvar */ "setvar",
+ /* 142 400 T_Source */ "source",
+ /* 143 401 T_Stacksize */ "stacksize",
+ /* 144 402 T_Statistics */ "statistics",
+ /* 145 403 T_Stats */ "stats",
+ /* 146 404 T_Statsdir */ "statsdir",
+ /* 147 405 T_Step */ "step",
+ /* 148 406 T_Stepout */ "stepout",
+ /* 149 407 T_Stratum */ "stratum",
+ /* 150 408 T_String */ NULL,
+ /* 151 409 T_Sys */ "sys",
+ /* 152 410 T_Sysstats */ "sysstats",
+ /* 153 411 T_Tick */ "tick",
+ /* 154 412 T_Time1 */ "time1",
+ /* 155 413 T_Time2 */ "time2",
+ /* 156 414 T_Timer */ "timer",
+ /* 157 415 T_Timingstats */ "timingstats",
+ /* 158 416 T_Tinker */ "tinker",
+ /* 159 417 T_Tos */ "tos",
+ /* 160 418 T_Trap */ "trap",
+ /* 161 419 T_True */ "true",
+ /* 162 420 T_Trustedkey */ "trustedkey",
+ /* 163 421 T_Ttl */ "ttl",
+ /* 164 422 T_Type */ "type",
+ /* 165 423 T_U_int */ NULL,
+ /* 166 424 T_Unconfig */ "unconfig",
+ /* 167 425 T_Unpeer */ "unpeer",
+ /* 168 426 T_Version */ "version",
+ /* 169 427 T_WanderThreshold */ NULL,
+ /* 170 428 T_Week */ "week",
+ /* 171 429 T_Wildcard */ "wildcard",
+ /* 172 430 T_Xleave */ "xleave",
+ /* 173 431 T_Year */ "year",
+ /* 174 432 T_Flag */ NULL,
+ /* 175 433 T_EOC */ NULL,
+ /* 176 434 T_Simulate */ "simulate",
+ /* 177 435 T_Beep_Delay */ "beep_delay",
+ /* 178 436 T_Sim_Duration */ "simulation_duration",
+ /* 179 437 T_Server_Offset */ "server_offset",
+ /* 180 438 T_Duration */ "duration",
+ /* 181 439 T_Freq_Offset */ "freq_offset",
+ /* 182 440 T_Wander */ "wander",
+ /* 183 441 T_Jitter */ "jitter",
+ /* 184 442 T_Prop_Delay */ "prop_delay",
+ /* 185 443 T_Proc_Delay */ "proc_delay"
+};
+
+#define SCANNER_INIT_S 822
+
+const scan_state sst[825] = {
+/*SS_T( ch, f-by, match, other ), */
+ 0, /* 0 */
+ S_ST( '-', 3, 322, 0 ), /* 1 */
+ S_ST( '.', 3, 3, 1 ), /* 2 */
+ S_ST( '.', 3, 290, 0 ), /* 3 . */
+ S_ST( 'a', 3, 23, 2 ), /* 4 */
+ S_ST( 'b', 3, 6, 0 ), /* 5 a */
+ S_ST( 'b', 3, 7, 0 ), /* 6 ab */
+ S_ST( 'r', 3, 8, 0 ), /* 7 abb */
+ S_ST( 'e', 3, 258, 0 ), /* 8 abbr */
+ S_ST( 'g', 3, 259, 5 ), /* 9 a */
+ S_ST( 'l', 3, 260, 9 ), /* 10 a */
+ S_ST( 'a', 3, 261, 0 ), /* 11 all */
+ S_ST( 'p', 3, 13, 11 ), /* 12 all */
+ S_ST( 'e', 3, 14, 0 ), /* 13 allp */
+ S_ST( 'e', 3, 15, 0 ), /* 14 allpe */
+ S_ST( 'r', 3, 262, 0 ), /* 15 allpee */
+ S_ST( 'u', 3, 17, 10 ), /* 16 a */
+ S_ST( 't', 3, 18, 0 ), /* 17 au */
+ S_ST( 'o', 3, 21, 263 ), /* 18 aut */
+ S_ST( 'k', 3, 20, 0 ), /* 19 auto */
+ S_ST( 'e', 3, 264, 0 ), /* 20 autok */
+ S_ST( 'm', 3, 22, 19 ), /* 21 auto */
+ S_ST( 'a', 3, 265, 0 ), /* 22 autom */
+ S_ST( 'v', 3, 24, 16 ), /* 23 a */
+ S_ST( 'e', 3, 25, 0 ), /* 24 av */
+ S_ST( 'r', 3, 26, 0 ), /* 25 ave */
+ S_ST( 'a', 3, 27, 0 ), /* 26 aver */
+ S_ST( 'g', 3, 266, 0 ), /* 27 avera */
+ S_ST( 'b', 3, 61, 4 ), /* 28 */
+ S_ST( 'c', 3, 30, 0 ), /* 29 b */
+ S_ST( 'l', 3, 31, 0 ), /* 30 bc */
+ S_ST( 'i', 3, 32, 0 ), /* 31 bcl */
+ S_ST( 'e', 3, 33, 0 ), /* 32 bcli */
+ S_ST( 'n', 3, 267, 0 ), /* 33 bclie */
+ S_ST( 'e', 3, 38, 29 ), /* 34 b */
+ S_ST( 'a', 3, 36, 0 ), /* 35 be */
+ S_ST( 'c', 3, 37, 0 ), /* 36 bea */
+ S_ST( 'o', 3, 268, 0 ), /* 37 beac */
+ S_ST( 'e', 3, 39, 35 ), /* 38 be */
+ S_ST( 'p', 3, 40, 0 ), /* 39 bee */
+ S_ST( '_', 3, 41, 0 ), /* 40 beep */
+ S_ST( 'd', 3, 42, 0 ), /* 41 beep_ */
+ S_ST( 'e', 3, 43, 0 ), /* 42 beep_d */
+ S_ST( 'l', 3, 44, 0 ), /* 43 beep_de */
+ S_ST( 'a', 3, 435, 0 ), /* 44 beep_del */
+ S_ST( 'r', 3, 46, 34 ), /* 45 b */
+ S_ST( 'o', 3, 47, 0 ), /* 46 br */
+ S_ST( 'a', 3, 48, 0 ), /* 47 bro */
+ S_ST( 'd', 3, 49, 0 ), /* 48 broa */
+ S_ST( 'c', 3, 50, 0 ), /* 49 broad */
+ S_ST( 'a', 3, 51, 0 ), /* 50 broadc */
+ S_ST( 's', 3, 269, 0 ), /* 51 broadca */
+ S_ST( 'c', 3, 53, 0 ), /* 52 broadcast */
+ S_ST( 'l', 3, 54, 0 ), /* 53 broadcastc */
+ S_ST( 'i', 3, 55, 0 ), /* 54 broadcastcl */
+ S_ST( 'e', 3, 56, 0 ), /* 55 broadcastcli */
+ S_ST( 'n', 3, 270, 0 ), /* 56 broadcastclie */
+ S_ST( 'd', 3, 58, 52 ), /* 57 broadcast */
+ S_ST( 'e', 3, 59, 0 ), /* 58 broadcastd */
+ S_ST( 'l', 3, 60, 0 ), /* 59 broadcastde */
+ S_ST( 'a', 3, 271, 0 ), /* 60 broadcastdel */
+ S_ST( 'u', 3, 62, 45 ), /* 61 b */
+ S_ST( 'r', 3, 63, 0 ), /* 62 bu */
+ S_ST( 's', 3, 272, 0 ), /* 63 bur */
+ S_ST( 'c', 3, 104, 28 ), /* 64 */
+ S_ST( 'a', 3, 66, 0 ), /* 65 c */
+ S_ST( 'l', 3, 67, 0 ), /* 66 ca */
+ S_ST( 'i', 3, 68, 0 ), /* 67 cal */
+ S_ST( 'b', 3, 69, 0 ), /* 68 cali */
+ S_ST( 'r', 3, 70, 0 ), /* 69 calib */
+ S_ST( 'a', 3, 71, 0 ), /* 70 calibr */
+ S_ST( 't', 3, 273, 0 ), /* 71 calibra */
+ S_ST( 'e', 3, 73, 65 ), /* 72 c */
+ S_ST( 'i', 3, 74, 0 ), /* 73 ce */
+ S_ST( 'l', 3, 75, 0 ), /* 74 cei */
+ S_ST( 'i', 3, 76, 0 ), /* 75 ceil */
+ S_ST( 'n', 3, 274, 0 ), /* 76 ceili */
+ S_ST( 'l', 3, 78, 72 ), /* 77 c */
+ S_ST( 'o', 3, 79, 0 ), /* 78 cl */
+ S_ST( 'c', 3, 80, 0 ), /* 79 clo */
+ S_ST( 'k', 3, 81, 0 ), /* 80 cloc */
+ S_ST( 's', 3, 82, 0 ), /* 81 clock */
+ S_ST( 't', 3, 83, 0 ), /* 82 clocks */
+ S_ST( 'a', 3, 84, 0 ), /* 83 clockst */
+ S_ST( 't', 3, 275, 0 ), /* 84 clocksta */
+ S_ST( 'o', 3, 89, 77 ), /* 85 c */
+ S_ST( 'h', 3, 87, 0 ), /* 86 co */
+ S_ST( 'o', 3, 88, 0 ), /* 87 coh */
+ S_ST( 'r', 3, 276, 0 ), /* 88 coho */
+ S_ST( 'n', 3, 90, 86 ), /* 89 co */
+ S_ST( 't', 3, 91, 0 ), /* 90 con */
+ S_ST( 'r', 3, 92, 0 ), /* 91 cont */
+ S_ST( 'o', 3, 93, 0 ), /* 92 contr */
+ S_ST( 'l', 3, 94, 0 ), /* 93 contro */
+ S_ST( 'k', 3, 95, 0 ), /* 94 control */
+ S_ST( 'e', 3, 277, 0 ), /* 95 controlk */
+ S_ST( 'r', 3, 97, 85 ), /* 96 c */
+ S_ST( 'y', 3, 98, 0 ), /* 97 cr */
+ S_ST( 'p', 3, 99, 0 ), /* 98 cry */
+ S_ST( 't', 3, 278, 0 ), /* 99 cryp */
+ S_ST( 's', 3, 101, 0 ), /* 100 crypto */
+ S_ST( 't', 3, 102, 0 ), /* 101 cryptos */
+ S_ST( 'a', 3, 103, 0 ), /* 102 cryptost */
+ S_ST( 't', 3, 279, 0 ), /* 103 cryptosta */
+ S_ST( 't', 3, 280, 96 ), /* 104 c */
+ S_ST( 'd', 3, 137, 64 ), /* 105 */
+ S_ST( 'a', 3, 281, 0 ), /* 106 d */
+ S_ST( 'e', 3, 108, 106 ), /* 107 d */
+ S_ST( 'f', 3, 109, 0 ), /* 108 de */
+ S_ST( 'a', 3, 110, 0 ), /* 109 def */
+ S_ST( 'u', 3, 111, 0 ), /* 110 defa */
+ S_ST( 'l', 3, 282, 0 ), /* 111 defau */
+ S_ST( 'i', 3, 116, 107 ), /* 112 d */
+ S_ST( 'g', 3, 114, 0 ), /* 113 di */
+ S_ST( 'e', 3, 115, 0 ), /* 114 dig */
+ S_ST( 's', 3, 283, 0 ), /* 115 dige */
+ S_ST( 's', 3, 123, 113 ), /* 116 di */
+ S_ST( 'a', 3, 118, 0 ), /* 117 dis */
+ S_ST( 'b', 3, 119, 0 ), /* 118 disa */
+ S_ST( 'l', 3, 284, 0 ), /* 119 disab */
+ S_ST( 'c', 3, 121, 117 ), /* 120 dis */
+ S_ST( 'a', 3, 122, 0 ), /* 121 disc */
+ S_ST( 'r', 3, 285, 0 ), /* 122 disca */
+ S_ST( 'p', 3, 124, 120 ), /* 123 dis */
+ S_ST( 'e', 3, 125, 0 ), /* 124 disp */
+ S_ST( 'r', 3, 126, 0 ), /* 125 dispe */
+ S_ST( 's', 3, 127, 0 ), /* 126 disper */
+ S_ST( 'i', 3, 128, 0 ), /* 127 dispers */
+ S_ST( 'o', 3, 286, 0 ), /* 128 dispersi */
+ S_ST( 'r', 3, 136, 112 ), /* 129 d */
+ S_ST( 'i', 3, 131, 0 ), /* 130 dr */
+ S_ST( 'f', 3, 132, 0 ), /* 131 dri */
+ S_ST( 't', 3, 133, 0 ), /* 132 drif */
+ S_ST( 'f', 3, 134, 0 ), /* 133 drift */
+ S_ST( 'i', 3, 135, 0 ), /* 134 driftf */
+ S_ST( 'l', 3, 288, 0 ), /* 135 driftfi */
+ S_ST( 'o', 3, 289, 130 ), /* 136 dr */
+ S_ST( 'u', 3, 138, 129 ), /* 137 d */
+ S_ST( 'r', 3, 139, 0 ), /* 138 du */
+ S_ST( 'a', 3, 140, 0 ), /* 139 dur */
+ S_ST( 't', 3, 141, 0 ), /* 140 dura */
+ S_ST( 'i', 3, 142, 0 ), /* 141 durat */
+ S_ST( 'o', 3, 438, 0 ), /* 142 durati */
+ S_ST( 'e', 3, 144, 105 ), /* 143 */
+ S_ST( 'n', 3, 292, 0 ), /* 144 e */
+ S_ST( 'a', 3, 146, 0 ), /* 145 en */
+ S_ST( 'b', 3, 147, 0 ), /* 146 ena */
+ S_ST( 'l', 3, 291, 0 ), /* 147 enab */
+ S_ST( 'f', 3, 169, 143 ), /* 148 */
+ S_ST( 'i', 3, 150, 0 ), /* 149 f */
+ S_ST( 'l', 3, 294, 0 ), /* 150 fi */
+ S_ST( 'g', 3, 152, 0 ), /* 151 file */
+ S_ST( 'e', 3, 295, 0 ), /* 152 fileg */
+ S_ST( 'n', 3, 154, 151 ), /* 153 file */
+ S_ST( 'u', 3, 296, 0 ), /* 154 filen */
+ S_ST( 'l', 3, 159, 149 ), /* 155 f */
+ S_ST( 'a', 3, 158, 0 ), /* 156 fl */
+ S_ST( 'g', 3, 300, 0 ), /* 157 fla */
+ S_ST( 'k', 3, 301, 157 ), /* 158 fla */
+ S_ST( 'o', 3, 160, 156 ), /* 159 fl */
+ S_ST( 'o', 3, 302, 0 ), /* 160 flo */
+ S_ST( 'r', 3, 162, 155 ), /* 161 f */
+ S_ST( 'e', 3, 303, 0 ), /* 162 fr */
+ S_ST( '_', 3, 164, 0 ), /* 163 freq */
+ S_ST( 'o', 3, 165, 0 ), /* 164 freq_ */
+ S_ST( 'f', 3, 166, 0 ), /* 165 freq_o */
+ S_ST( 'f', 3, 167, 0 ), /* 166 freq_of */
+ S_ST( 's', 3, 168, 0 ), /* 167 freq_off */
+ S_ST( 'e', 3, 439, 0 ), /* 168 freq_offs */
+ S_ST( 'u', 3, 170, 161 ), /* 169 f */
+ S_ST( 'd', 3, 171, 0 ), /* 170 fu */
+ S_ST( 'g', 3, 304, 0 ), /* 171 fud */
+ S_ST( 'h', 3, 175, 148 ), /* 172 */
+ S_ST( 'o', 3, 174, 0 ), /* 173 h */
+ S_ST( 's', 3, 305, 0 ), /* 174 ho */
+ S_ST( 'u', 3, 176, 173 ), /* 175 h */
+ S_ST( 'f', 3, 177, 0 ), /* 176 hu */
+ S_ST( 'f', 3, 178, 0 ), /* 177 huf */
+ S_ST( 'p', 3, 179, 0 ), /* 178 huff */
+ S_ST( 'u', 3, 180, 0 ), /* 179 huffp */
+ S_ST( 'f', 3, 306, 0 ), /* 180 huffpu */
+ S_ST( 'i', 3, 222, 172 ), /* 181 */
+ S_ST( 'b', 3, 183, 0 ), /* 182 i */
+ S_ST( 'u', 3, 184, 0 ), /* 183 ib */
+ S_ST( 'r', 3, 185, 0 ), /* 184 ibu */
+ S_ST( 's', 3, 307, 0 ), /* 185 ibur */
+ S_ST( 'd', 3, 187, 182 ), /* 186 i */
+ S_ST( 'e', 3, 188, 0 ), /* 187 id */
+ S_ST( 'n', 3, 308, 0 ), /* 188 ide */
+ S_ST( 'g', 3, 190, 186 ), /* 189 i */
+ S_ST( 'n', 3, 191, 0 ), /* 190 ig */
+ S_ST( 'o', 3, 192, 0 ), /* 191 ign */
+ S_ST( 'r', 3, 309, 0 ), /* 192 igno */
+ S_ST( 'n', 3, 216, 189 ), /* 193 i */
+ S_ST( 'c', 3, 206, 0 ), /* 194 in */
+ S_ST( 'a', 3, 196, 0 ), /* 195 inc */
+ S_ST( 'l', 3, 197, 0 ), /* 196 inca */
+ S_ST( 'l', 3, 198, 0 ), /* 197 incal */
+ S_ST( 'o', 3, 310, 0 ), /* 198 incall */
+ S_ST( 'l', 3, 200, 195 ), /* 199 inc */
+ S_ST( 'u', 3, 201, 0 ), /* 200 incl */
+ S_ST( 'd', 3, 202, 0 ), /* 201 inclu */
+ S_ST( 'e', 3, 203, 0 ), /* 202 includ */
+ S_ST( 'f', 3, 204, 0 ), /* 203 include */
+ S_ST( 'i', 3, 205, 0 ), /* 204 includef */
+ S_ST( 'l', 3, 314, 0 ), /* 205 includefi */
+ S_ST( 'm', 3, 207, 199 ), /* 206 inc */
+ S_ST( 'e', 3, 311, 0 ), /* 207 incm */
+ S_ST( 'i', 3, 209, 194 ), /* 208 in */
+ S_ST( 't', 3, 214, 0 ), /* 209 ini */
+ S_ST( 'a', 3, 211, 0 ), /* 210 init */
+ S_ST( 'l', 3, 212, 0 ), /* 211 inita */
+ S_ST( 'l', 3, 213, 0 ), /* 212 inital */
+ S_ST( 'o', 3, 312, 0 ), /* 213 initall */
+ S_ST( 'm', 3, 215, 210 ), /* 214 init */
+ S_ST( 'e', 3, 313, 0 ), /* 215 initm */
+ S_ST( 't', 3, 217, 208 ), /* 216 in */
+ S_ST( 'e', 3, 218, 0 ), /* 217 int */
+ S_ST( 'r', 3, 219, 0 ), /* 218 inte */
+ S_ST( 'f', 3, 220, 0 ), /* 219 inter */
+ S_ST( 'a', 3, 221, 0 ), /* 220 interf */
+ S_ST( 'c', 3, 316, 0 ), /* 221 interfa */
+ S_ST( 'p', 3, 223, 318 ), /* 222 i */
+ S_ST( 'v', 3, 321, 0 ), /* 223 ip */
+ S_ST( 'j', 3, 225, 181 ), /* 224 */
+ S_ST( 'i', 3, 226, 0 ), /* 225 j */
+ S_ST( 't', 3, 227, 0 ), /* 226 ji */
+ S_ST( 't', 3, 228, 0 ), /* 227 jit */
+ S_ST( 'e', 3, 441, 0 ), /* 228 jitt */
+ S_ST( 'k', 3, 236, 224 ), /* 229 */
+ S_ST( 'e', 3, 324, 0 ), /* 230 k */
+ S_ST( 'r', 3, 232, 0 ), /* 231 ke */
+ S_ST( 'n', 3, 233, 0 ), /* 232 ker */
+ S_ST( 'e', 3, 323, 0 ), /* 233 kern */
+ S_ST( 'd', 3, 235, 0 ), /* 234 keys */
+ S_ST( 'i', 3, 326, 0 ), /* 235 keysd */
+ S_ST( 'o', 3, 327, 230 ), /* 236 k */
+ S_ST( 'l', 3, 253, 229 ), /* 237 */
+ S_ST( 'e', 3, 239, 0 ), /* 238 l */
+ S_ST( 'a', 3, 240, 0 ), /* 239 le */
+ S_ST( 'p', 3, 241, 0 ), /* 240 lea */
+ S_ST( 'f', 3, 242, 0 ), /* 241 leap */
+ S_ST( 'i', 3, 243, 0 ), /* 242 leapf */
+ S_ST( 'l', 3, 329, 0 ), /* 243 leapfi */
+ S_ST( 'i', 3, 250, 238 ), /* 244 l */
+ S_ST( 'm', 3, 246, 0 ), /* 245 li */
+ S_ST( 'i', 3, 247, 0 ), /* 246 lim */
+ S_ST( 't', 3, 248, 0 ), /* 247 limi */
+ S_ST( 'e', 3, 330, 0 ), /* 248 limit */
+ S_ST( 'n', 3, 331, 245 ), /* 249 li */
+ S_ST( 's', 3, 251, 249 ), /* 250 li */
+ S_ST( 't', 3, 252, 0 ), /* 251 lis */
+ S_ST( 'e', 3, 332, 0 ), /* 252 list */
+ S_ST( 'o', 3, 446, 244 ), /* 253 l */
+ S_ST( 'g', 3, 315, 0 ), /* 254 lo */
+ S_ST( 'c', 3, 256, 0 ), /* 255 log */
+ S_ST( 'o', 3, 257, 0 ), /* 256 logc */
+ S_ST( 'n', 3, 287, 0 ), /* 257 logco */
+ S_ST( 'v', 1, 0, 0 ), /* 258 T_Abbrev */
+ S_ST( 'e', 0, 0, 0 ), /* 259 T_Age */
+ S_ST( 'l', 0, 12, 0 ), /* 260 T_All */
+ S_ST( 'n', 0, 0, 0 ), /* 261 T_Allan */
+ S_ST( 's', 0, 0, 0 ), /* 262 T_Allpeers */
+ S_ST( 'h', 0, 0, 0 ), /* 263 T_Auth */
+ S_ST( 'y', 0, 0, 0 ), /* 264 T_Autokey */
+ S_ST( 'x', 0, 0, 0 ), /* 265 T_Automax */
+ S_ST( 'e', 0, 0, 0 ), /* 266 T_Average */
+ S_ST( 't', 0, 0, 0 ), /* 267 T_Bclient */
+ S_ST( 'n', 0, 0, 0 ), /* 268 T_Beacon */
+ S_ST( 't', 1, 57, 0 ), /* 269 T_Broadcast */
+ S_ST( 't', 0, 0, 0 ), /* 270 T_Broadcastclient */
+ S_ST( 'y', 0, 0, 0 ), /* 271 T_Broadcastdelay */
+ S_ST( 't', 0, 0, 0 ), /* 272 T_Burst */
+ S_ST( 'e', 0, 0, 0 ), /* 273 T_Calibrate */
+ S_ST( 'g', 0, 0, 0 ), /* 274 T_Ceiling */
+ S_ST( 's', 0, 0, 0 ), /* 275 T_Clockstats */
+ S_ST( 't', 0, 0, 0 ), /* 276 T_Cohort */
+ S_ST( 'y', 0, 0, 0 ), /* 277 T_ControlKey */
+ S_ST( 'o', 0, 100, 0 ), /* 278 T_Crypto */
+ S_ST( 's', 0, 0, 0 ), /* 279 T_Cryptostats */
+ S_ST( 'l', 0, 0, 0 ), /* 280 T_Ctl */
+ S_ST( 'y', 0, 0, 0 ), /* 281 T_Day */
+ S_ST( 't', 0, 0, 0 ), /* 282 T_Default */
+ S_ST( 't', 1, 0, 0 ), /* 283 T_Digest */
+ S_ST( 'e', 0, 0, 0 ), /* 284 T_Disable */
+ S_ST( 'd', 0, 0, 0 ), /* 285 T_Discard */
+ S_ST( 'n', 0, 0, 0 ), /* 286 T_Dispersion */
+ S_ST( 'f', 3, 293, 0 ), /* 287 logcon */
+ S_ST( 'e', 1, 0, 0 ), /* 288 T_Driftfile */
+ S_ST( 'p', 0, 0, 0 ), /* 289 T_Drop */
+ S_ST( '.', 0, 0, 0 ), /* 290 T_Ellipsis */
+ S_ST( 'e', 0, 0, 0 ), /* 291 T_Enable */
+ S_ST( 'd', 0, 0, 145 ), /* 292 T_End */
+ S_ST( 'i', 3, 333, 0 ), /* 293 logconf */
+ S_ST( 'e', 1, 153, 0 ), /* 294 T_File */
+ S_ST( 'n', 0, 0, 0 ), /* 295 T_Filegen */
+ S_ST( 'm', 0, 0, 0 ), /* 296 T_Filenum */
+ S_ST( '1', 0, 0, 0 ), /* 297 T_Flag1 */
+ S_ST( '2', 0, 0, 297 ), /* 298 T_Flag2 */
+ S_ST( '3', 0, 0, 298 ), /* 299 T_Flag3 */
+ S_ST( '4', 0, 0, 299 ), /* 300 T_Flag4 */
+ S_ST( 'e', 0, 0, 0 ), /* 301 T_Flake */
+ S_ST( 'r', 0, 0, 0 ), /* 302 T_Floor */
+ S_ST( 'q', 0, 163, 0 ), /* 303 T_Freq */
+ S_ST( 'e', 1, 0, 0 ), /* 304 T_Fudge */
+ S_ST( 't', 1, 0, 0 ), /* 305 T_Host */
+ S_ST( 'f', 0, 0, 0 ), /* 306 T_Huffpuff */
+ S_ST( 't', 0, 0, 0 ), /* 307 T_Iburst */
+ S_ST( 't', 1, 0, 0 ), /* 308 T_Ident */
+ S_ST( 'e', 0, 0, 0 ), /* 309 T_Ignore */
+ S_ST( 'c', 0, 0, 0 ), /* 310 T_Incalloc */
+ S_ST( 'm', 0, 0, 0 ), /* 311 T_Incmem */
+ S_ST( 'c', 0, 0, 0 ), /* 312 T_Initalloc */
+ S_ST( 'm', 0, 0, 0 ), /* 313 T_Initmem */
+ S_ST( 'e', 1, 0, 0 ), /* 314 T_Includefile */
+ S_ST( 'f', 3, 317, 255 ), /* 315 log */
+ S_ST( 'e', 0, 0, 0 ), /* 316 T_Interface */
+ S_ST( 'i', 3, 408, 0 ), /* 317 logf */
+ S_ST( 'o', 0, 0, 193 ), /* 318 T_Io */
+ S_ST( '4', 0, 0, 0 ), /* 319 T_Ipv4 */
+ S_ST( '4', 0, 0, 0 ), /* 320 T_Ipv4_flag */
+ S_ST( '6', 0, 0, 319 ), /* 321 T_Ipv6 */
+ S_ST( '6', 0, 0, 320 ), /* 322 T_Ipv6_flag */
+ S_ST( 'l', 0, 0, 0 ), /* 323 T_Kernel */
+ S_ST( 'y', 0, 325, 231 ), /* 324 T_Key */
+ S_ST( 's', 1, 234, 0 ), /* 325 T_Keys */
+ S_ST( 'r', 1, 0, 0 ), /* 326 T_Keysdir */
+ S_ST( 'd', 0, 0, 0 ), /* 327 T_Kod */
+ S_ST( 'p', 0, 0, 0 ), /* 328 T_Mssntp */
+ S_ST( 'e', 1, 0, 0 ), /* 329 T_Leapfile */
+ S_ST( 'd', 0, 0, 0 ), /* 330 T_Limited */
+ S_ST( 'k', 0, 0, 0 ), /* 331 T_Link */
+ S_ST( 'n', 0, 0, 0 ), /* 332 T_Listen */
+ S_ST( 'g', 2, 0, 0 ), /* 333 T_Logconfig */
+ S_ST( 'e', 1, 0, 0 ), /* 334 T_Logfile */
+ S_ST( 's', 0, 0, 0 ), /* 335 T_Loopstats */
+ S_ST( 'p', 0, 0, 0 ), /* 336 T_Lowpriotrap */
+ S_ST( 't', 1, 0, 0 ), /* 337 T_Manycastclient */
+ S_ST( 'r', 2, 0, 0 ), /* 338 T_Manycastserver */
+ S_ST( 'k', 0, 0, 0 ), /* 339 T_Mask */
+ S_ST( 'e', 0, 0, 0 ), /* 340 T_Maxage */
+ S_ST( 'k', 0, 0, 0 ), /* 341 T_Maxclock */
+ S_ST( 'h', 0, 0, 0 ), /* 342 T_Maxdepth */
+ S_ST( 't', 0, 0, 0 ), /* 343 T_Maxdist */
+ S_ST( 'm', 0, 0, 0 ), /* 344 T_Maxmem */
+ S_ST( 'l', 0, 0, 0 ), /* 345 T_Maxpoll */
+ S_ST( 'm', 0, 492, 0 ), /* 346 T_Mem */
+ S_ST( 'k', 0, 0, 0 ), /* 347 T_Memlock */
+ S_ST( 'k', 0, 0, 0 ), /* 348 T_Minclock */
+ S_ST( 'h', 0, 0, 0 ), /* 349 T_Mindepth */
+ S_ST( 't', 0, 0, 0 ), /* 350 T_Mindist */
+ S_ST( 'm', 0, 0, 0 ), /* 351 T_Minimum */
+ S_ST( 'l', 0, 0, 0 ), /* 352 T_Minpoll */
+ S_ST( 'e', 0, 0, 0 ), /* 353 T_Minsane */
+ S_ST( 'e', 0, 355, 0 ), /* 354 T_Mode */
+ S_ST( '7', 0, 0, 0 ), /* 355 T_Mode7 */
+ S_ST( 'r', 0, 0, 0 ), /* 356 T_Monitor */
+ S_ST( 'h', 0, 0, 0 ), /* 357 T_Month */
+ S_ST( 'u', 0, 0, 0 ), /* 358 T_Mru */
+ S_ST( 't', 2, 0, 0 ), /* 359 T_Multicastclient */
+ S_ST( 'c', 0, 0, 0 ), /* 360 T_Nic */
+ S_ST( 'k', 0, 0, 0 ), /* 361 T_Nolink */
+ S_ST( 'y', 0, 0, 0 ), /* 362 T_Nomodify */
+ S_ST( 't', 0, 0, 0 ), /* 363 T_Nomrulist */
+ S_ST( 'e', 0, 0, 0 ), /* 364 T_None */
+ S_ST( 'e', 0, 0, 0 ), /* 365 T_Nonvolatile */
+ S_ST( 'r', 0, 0, 0 ), /* 366 T_Nopeer */
+ S_ST( 'y', 0, 0, 0 ), /* 367 T_Noquery */
+ S_ST( 't', 0, 0, 0 ), /* 368 T_Noselect */
+ S_ST( 'e', 0, 0, 0 ), /* 369 T_Noserve */
+ S_ST( 'p', 0, 0, 0 ), /* 370 T_Notrap */
+ S_ST( 't', 0, 0, 0 ), /* 371 T_Notrust */
+ S_ST( 'p', 0, 588, 0 ), /* 372 T_Ntp */
+ S_ST( 't', 0, 0, 0 ), /* 373 T_Ntpport */
+ S_ST( 't', 1, 0, 0 ), /* 374 T_NtpSignDsocket */
+ S_ST( 'n', 0, 603, 0 ), /* 375 T_Orphan */
+ S_ST( 't', 0, 0, 0 ), /* 376 T_Orphanwait */
+ S_ST( 'c', 0, 0, 0 ), /* 377 T_Panic */
+ S_ST( 'r', 1, 612, 0 ), /* 378 T_Peer */
+ S_ST( 's', 0, 0, 0 ), /* 379 T_Peerstats */
+ S_ST( 'e', 2, 0, 0 ), /* 380 T_Phone */
+ S_ST( 'd', 0, 620, 0 ), /* 381 T_Pid */
+ S_ST( 'e', 1, 0, 0 ), /* 382 T_Pidfile */
+ S_ST( 'l', 1, 0, 0 ), /* 383 T_Pool */
+ S_ST( 't', 0, 0, 0 ), /* 384 T_Port */
+ S_ST( 't', 0, 0, 0 ), /* 385 T_Preempt */
+ S_ST( 'r', 0, 0, 0 ), /* 386 T_Prefer */
+ S_ST( 's', 0, 0, 0 ), /* 387 T_Protostats */
+ S_ST( 'w', 1, 0, 626 ), /* 388 T_Pw */
+ S_ST( 'e', 1, 0, 0 ), /* 389 T_Randfile */
+ S_ST( 's', 0, 0, 0 ), /* 390 T_Rawstats */
+ S_ST( 'd', 1, 0, 0 ), /* 391 T_Refid */
+ S_ST( 'y', 0, 0, 0 ), /* 392 T_Requestkey */
+ S_ST( 't', 0, 0, 0 ), /* 393 T_Reset */
+ S_ST( 't', 0, 0, 0 ), /* 394 T_Restrict */
+ S_ST( 'e', 0, 0, 0 ), /* 395 T_Revoke */
+ S_ST( 't', 0, 0, 0 ), /* 396 T_Rlimit */
+ S_ST( 'r', 1, 0, 0 ), /* 397 T_Saveconfigdir */
+ S_ST( 'r', 1, 703, 0 ), /* 398 T_Server */
+ S_ST( 'r', 1, 0, 0 ), /* 399 T_Setvar */
+ S_ST( 'e', 0, 0, 0 ), /* 400 T_Source */
+ S_ST( 'e', 0, 0, 0 ), /* 401 T_Stacksize */
+ S_ST( 's', 0, 0, 0 ), /* 402 T_Statistics */
+ S_ST( 's', 0, 746, 741 ), /* 403 T_Stats */
+ S_ST( 'r', 1, 0, 0 ), /* 404 T_Statsdir */
+ S_ST( 'p', 0, 749, 0 ), /* 405 T_Step */
+ S_ST( 't', 0, 0, 0 ), /* 406 T_Stepout */
+ S_ST( 'm', 0, 0, 0 ), /* 407 T_Stratum */
+ S_ST( 'l', 3, 334, 0 ), /* 408 logfi */
+ S_ST( 's', 0, 756, 0 ), /* 409 T_Sys */
+ S_ST( 's', 0, 0, 0 ), /* 410 T_Sysstats */
+ S_ST( 'k', 0, 0, 0 ), /* 411 T_Tick */
+ S_ST( '1', 0, 0, 0 ), /* 412 T_Time1 */
+ S_ST( '2', 0, 0, 412 ), /* 413 T_Time2 */
+ S_ST( 'r', 0, 0, 413 ), /* 414 T_Timer */
+ S_ST( 's', 0, 0, 0 ), /* 415 T_Timingstats */
+ S_ST( 'r', 0, 0, 0 ), /* 416 T_Tinker */
+ S_ST( 's', 0, 0, 0 ), /* 417 T_Tos */
+ S_ST( 'p', 1, 0, 0 ), /* 418 T_Trap */
+ S_ST( 'e', 0, 0, 0 ), /* 419 T_True */
+ S_ST( 'y', 0, 0, 0 ), /* 420 T_Trustedkey */
+ S_ST( 'l', 0, 0, 0 ), /* 421 T_Ttl */
+ S_ST( 'e', 0, 0, 0 ), /* 422 T_Type */
+ S_ST( 'o', 3, 427, 254 ), /* 423 lo */
+ S_ST( 'g', 1, 0, 0 ), /* 424 T_Unconfig */
+ S_ST( 'r', 1, 0, 0 ), /* 425 T_Unpeer */
+ S_ST( 'n', 0, 0, 0 ), /* 426 T_Version */
+ S_ST( 'p', 3, 432, 0 ), /* 427 loo */
+ S_ST( 'k', 0, 0, 0 ), /* 428 T_Week */
+ S_ST( 'd', 0, 0, 0 ), /* 429 T_Wildcard */
+ S_ST( 'e', 0, 0, 0 ), /* 430 T_Xleave */
+ S_ST( 'r', 0, 0, 0 ), /* 431 T_Year */
+ S_ST( 's', 3, 433, 0 ), /* 432 loop */
+ S_ST( 't', 3, 444, 0 ), /* 433 loops */
+ S_ST( 'e', 0, 0, 0 ), /* 434 T_Simulate */
+ S_ST( 'y', 0, 0, 0 ), /* 435 T_Beep_Delay */
+ S_ST( 'n', 0, 0, 0 ), /* 436 T_Sim_Duration */
+ S_ST( 't', 0, 0, 0 ), /* 437 T_Server_Offset */
+ S_ST( 'n', 0, 0, 0 ), /* 438 T_Duration */
+ S_ST( 't', 0, 0, 0 ), /* 439 T_Freq_Offset */
+ S_ST( 'r', 0, 0, 0 ), /* 440 T_Wander */
+ S_ST( 'r', 0, 0, 0 ), /* 441 T_Jitter */
+ S_ST( 'y', 0, 0, 0 ), /* 442 T_Prop_Delay */
+ S_ST( 'y', 0, 0, 0 ), /* 443 T_Proc_Delay */
+ S_ST( 'a', 3, 445, 0 ), /* 444 loopst */
+ S_ST( 't', 3, 335, 0 ), /* 445 loopsta */
+ S_ST( 'w', 3, 447, 423 ), /* 446 lo */
+ S_ST( 'p', 3, 448, 0 ), /* 447 low */
+ S_ST( 'r', 3, 449, 0 ), /* 448 lowp */
+ S_ST( 'i', 3, 450, 0 ), /* 449 lowpr */
+ S_ST( 'o', 3, 451, 0 ), /* 450 lowpri */
+ S_ST( 't', 3, 452, 0 ), /* 451 lowprio */
+ S_ST( 'r', 3, 453, 0 ), /* 452 lowpriot */
+ S_ST( 'a', 3, 336, 0 ), /* 453 lowpriotr */
+ S_ST( 'm', 3, 528, 237 ), /* 454 */
+ S_ST( 'a', 3, 473, 0 ), /* 455 m */
+ S_ST( 'n', 3, 457, 0 ), /* 456 ma */
+ S_ST( 'y', 3, 458, 0 ), /* 457 man */
+ S_ST( 'c', 3, 459, 0 ), /* 458 many */
+ S_ST( 'a', 3, 460, 0 ), /* 459 manyc */
+ S_ST( 's', 3, 461, 0 ), /* 460 manyca */
+ S_ST( 't', 3, 467, 0 ), /* 461 manycas */
+ S_ST( 'c', 3, 463, 0 ), /* 462 manycast */
+ S_ST( 'l', 3, 464, 0 ), /* 463 manycastc */
+ S_ST( 'i', 3, 465, 0 ), /* 464 manycastcl */
+ S_ST( 'e', 3, 466, 0 ), /* 465 manycastcli */
+ S_ST( 'n', 3, 337, 0 ), /* 466 manycastclie */
+ S_ST( 's', 3, 468, 462 ), /* 467 manycast */
+ S_ST( 'e', 3, 469, 0 ), /* 468 manycasts */
+ S_ST( 'r', 3, 470, 0 ), /* 469 manycastse */
+ S_ST( 'v', 3, 471, 0 ), /* 470 manycastser */
+ S_ST( 'e', 3, 338, 0 ), /* 471 manycastserv */
+ S_ST( 's', 3, 339, 456 ), /* 472 ma */
+ S_ST( 'x', 3, 488, 472 ), /* 473 ma */
+ S_ST( 'a', 3, 475, 0 ), /* 474 max */
+ S_ST( 'g', 3, 340, 0 ), /* 475 maxa */
+ S_ST( 'c', 3, 477, 474 ), /* 476 max */
+ S_ST( 'l', 3, 478, 0 ), /* 477 maxc */
+ S_ST( 'o', 3, 479, 0 ), /* 478 maxcl */
+ S_ST( 'c', 3, 341, 0 ), /* 479 maxclo */
+ S_ST( 'd', 3, 484, 476 ), /* 480 max */
+ S_ST( 'e', 3, 482, 0 ), /* 481 maxd */
+ S_ST( 'p', 3, 483, 0 ), /* 482 maxde */
+ S_ST( 't', 3, 342, 0 ), /* 483 maxdep */
+ S_ST( 'i', 3, 485, 481 ), /* 484 maxd */
+ S_ST( 's', 3, 343, 0 ), /* 485 maxdi */
+ S_ST( 'm', 3, 487, 480 ), /* 486 max */
+ S_ST( 'e', 3, 344, 0 ), /* 487 maxm */
+ S_ST( 'p', 3, 489, 486 ), /* 488 max */
+ S_ST( 'o', 3, 490, 0 ), /* 489 maxp */
+ S_ST( 'l', 3, 345, 0 ), /* 490 maxpo */
+ S_ST( 'e', 3, 346, 455 ), /* 491 m */
+ S_ST( 'l', 3, 493, 0 ), /* 492 mem */
+ S_ST( 'o', 3, 494, 0 ), /* 493 meml */
+ S_ST( 'c', 3, 347, 0 ), /* 494 memlo */
+ S_ST( 'i', 3, 496, 491 ), /* 495 m */
+ S_ST( 'n', 3, 513, 0 ), /* 496 mi */
+ S_ST( 'c', 3, 498, 0 ), /* 497 min */
+ S_ST( 'l', 3, 499, 0 ), /* 498 minc */
+ S_ST( 'o', 3, 500, 0 ), /* 499 mincl */
+ S_ST( 'c', 3, 348, 0 ), /* 500 minclo */
+ S_ST( 'd', 3, 505, 497 ), /* 501 min */
+ S_ST( 'e', 3, 503, 0 ), /* 502 mind */
+ S_ST( 'p', 3, 504, 0 ), /* 503 minde */
+ S_ST( 't', 3, 349, 0 ), /* 504 mindep */
+ S_ST( 'i', 3, 506, 502 ), /* 505 mind */
+ S_ST( 's', 3, 350, 0 ), /* 506 mindi */
+ S_ST( 'i', 3, 508, 501 ), /* 507 min */
+ S_ST( 'm', 3, 509, 0 ), /* 508 mini */
+ S_ST( 'u', 3, 351, 0 ), /* 509 minim */
+ S_ST( 'p', 3, 511, 507 ), /* 510 min */
+ S_ST( 'o', 3, 512, 0 ), /* 511 minp */
+ S_ST( 'l', 3, 352, 0 ), /* 512 minpo */
+ S_ST( 's', 3, 514, 510 ), /* 513 min */
+ S_ST( 'a', 3, 515, 0 ), /* 514 mins */
+ S_ST( 'n', 3, 353, 0 ), /* 515 minsa */
+ S_ST( 'o', 3, 518, 495 ), /* 516 m */
+ S_ST( 'd', 3, 354, 0 ), /* 517 mo */
+ S_ST( 'n', 3, 522, 517 ), /* 518 mo */
+ S_ST( 'i', 3, 520, 0 ), /* 519 mon */
+ S_ST( 't', 3, 521, 0 ), /* 520 moni */
+ S_ST( 'o', 3, 356, 0 ), /* 521 monit */
+ S_ST( 't', 3, 357, 519 ), /* 522 mon */
+ S_ST( 'r', 3, 358, 516 ), /* 523 m */
+ S_ST( 's', 3, 525, 523 ), /* 524 m */
+ S_ST( 's', 3, 526, 0 ), /* 525 ms */
+ S_ST( 'n', 3, 527, 0 ), /* 526 mss */
+ S_ST( 't', 3, 328, 0 ), /* 527 mssn */
+ S_ST( 'u', 3, 529, 524 ), /* 528 m */
+ S_ST( 'l', 3, 530, 0 ), /* 529 mu */
+ S_ST( 't', 3, 531, 0 ), /* 530 mul */
+ S_ST( 'i', 3, 532, 0 ), /* 531 mult */
+ S_ST( 'c', 3, 533, 0 ), /* 532 multi */
+ S_ST( 'a', 3, 534, 0 ), /* 533 multic */
+ S_ST( 's', 3, 535, 0 ), /* 534 multica */
+ S_ST( 't', 3, 536, 0 ), /* 535 multicas */
+ S_ST( 'c', 3, 537, 0 ), /* 536 multicast */
+ S_ST( 'l', 3, 538, 0 ), /* 537 multicastc */
+ S_ST( 'i', 3, 539, 0 ), /* 538 multicastcl */
+ S_ST( 'e', 3, 540, 0 ), /* 539 multicastcli */
+ S_ST( 'n', 3, 359, 0 ), /* 540 multicastclie */
+ S_ST( 'n', 3, 584, 454 ), /* 541 */
+ S_ST( 'i', 3, 360, 0 ), /* 542 n */
+ S_ST( 'o', 3, 579, 542 ), /* 543 n */
+ S_ST( 'l', 3, 545, 0 ), /* 544 no */
+ S_ST( 'i', 3, 546, 0 ), /* 545 nol */
+ S_ST( 'n', 3, 361, 0 ), /* 546 noli */
+ S_ST( 'm', 3, 552, 544 ), /* 547 no */
+ S_ST( 'o', 3, 549, 0 ), /* 548 nom */
+ S_ST( 'd', 3, 550, 0 ), /* 549 nomo */
+ S_ST( 'i', 3, 551, 0 ), /* 550 nomod */
+ S_ST( 'f', 3, 362, 0 ), /* 551 nomodi */
+ S_ST( 'r', 3, 553, 548 ), /* 552 nom */
+ S_ST( 'u', 3, 554, 0 ), /* 553 nomr */
+ S_ST( 'l', 3, 555, 0 ), /* 554 nomru */
+ S_ST( 'i', 3, 556, 0 ), /* 555 nomrul */
+ S_ST( 's', 3, 363, 0 ), /* 556 nomruli */
+ S_ST( 'n', 3, 558, 547 ), /* 557 no */
+ S_ST( 'v', 3, 559, 364 ), /* 558 non */
+ S_ST( 'o', 3, 560, 0 ), /* 559 nonv */
+ S_ST( 'l', 3, 561, 0 ), /* 560 nonvo */
+ S_ST( 'a', 3, 562, 0 ), /* 561 nonvol */
+ S_ST( 't', 3, 563, 0 ), /* 562 nonvola */
+ S_ST( 'i', 3, 564, 0 ), /* 563 nonvolat */
+ S_ST( 'l', 3, 365, 0 ), /* 564 nonvolati */
+ S_ST( 'p', 3, 566, 557 ), /* 565 no */
+ S_ST( 'e', 3, 567, 0 ), /* 566 nop */
+ S_ST( 'e', 3, 366, 0 ), /* 567 nope */
+ S_ST( 'q', 3, 569, 565 ), /* 568 no */
+ S_ST( 'u', 3, 570, 0 ), /* 569 noq */
+ S_ST( 'e', 3, 571, 0 ), /* 570 noqu */
+ S_ST( 'r', 3, 367, 0 ), /* 571 noque */
+ S_ST( 's', 3, 573, 568 ), /* 572 no */
+ S_ST( 'e', 3, 577, 0 ), /* 573 nos */
+ S_ST( 'l', 3, 575, 0 ), /* 574 nose */
+ S_ST( 'e', 3, 576, 0 ), /* 575 nosel */
+ S_ST( 'c', 3, 368, 0 ), /* 576 nosele */
+ S_ST( 'r', 3, 578, 574 ), /* 577 nose */
+ S_ST( 'v', 3, 369, 0 ), /* 578 noser */
+ S_ST( 't', 3, 580, 572 ), /* 579 no */
+ S_ST( 'r', 3, 582, 0 ), /* 580 not */
+ S_ST( 'a', 3, 370, 0 ), /* 581 notr */
+ S_ST( 'u', 3, 583, 581 ), /* 582 notr */
+ S_ST( 's', 3, 371, 0 ), /* 583 notru */
+ S_ST( 't', 3, 372, 543 ), /* 584 n */
+ S_ST( 'p', 3, 586, 0 ), /* 585 ntp */
+ S_ST( 'o', 3, 587, 0 ), /* 586 ntpp */
+ S_ST( 'r', 3, 373, 0 ), /* 587 ntppo */
+ S_ST( 's', 3, 589, 585 ), /* 588 ntp */
+ S_ST( 'i', 3, 590, 0 ), /* 589 ntps */
+ S_ST( 'g', 3, 591, 0 ), /* 590 ntpsi */
+ S_ST( 'n', 3, 592, 0 ), /* 591 ntpsig */
+ S_ST( 'd', 3, 593, 0 ), /* 592 ntpsign */
+ S_ST( 's', 3, 594, 0 ), /* 593 ntpsignd */
+ S_ST( 'o', 3, 595, 0 ), /* 594 ntpsignds */
+ S_ST( 'c', 3, 596, 0 ), /* 595 ntpsigndso */
+ S_ST( 'k', 3, 597, 0 ), /* 596 ntpsigndsoc */
+ S_ST( 'e', 3, 374, 0 ), /* 597 ntpsigndsock */
+ S_ST( 'o', 3, 599, 541 ), /* 598 */
+ S_ST( 'r', 3, 600, 0 ), /* 599 o */
+ S_ST( 'p', 3, 601, 0 ), /* 600 or */
+ S_ST( 'h', 3, 602, 0 ), /* 601 orp */
+ S_ST( 'a', 3, 375, 0 ), /* 602 orph */
+ S_ST( 'w', 3, 604, 0 ), /* 603 orphan */
+ S_ST( 'a', 3, 605, 0 ), /* 604 orphanw */
+ S_ST( 'i', 3, 376, 0 ), /* 605 orphanwa */
+ S_ST( 'p', 3, 388, 598 ), /* 606 */
+ S_ST( 'a', 3, 608, 0 ), /* 607 p */
+ S_ST( 'n', 3, 609, 0 ), /* 608 pa */
+ S_ST( 'i', 3, 377, 0 ), /* 609 pan */
+ S_ST( 'e', 3, 611, 607 ), /* 610 p */
+ S_ST( 'e', 3, 378, 0 ), /* 611 pe */
+ S_ST( 's', 3, 613, 0 ), /* 612 peer */
+ S_ST( 't', 3, 614, 0 ), /* 613 peers */
+ S_ST( 'a', 3, 615, 0 ), /* 614 peerst */
+ S_ST( 't', 3, 379, 0 ), /* 615 peersta */
+ S_ST( 'h', 3, 617, 610 ), /* 616 p */
+ S_ST( 'o', 3, 618, 0 ), /* 617 ph */
+ S_ST( 'n', 3, 380, 0 ), /* 618 pho */
+ S_ST( 'i', 3, 381, 616 ), /* 619 p */
+ S_ST( 'f', 3, 621, 0 ), /* 620 pid */
+ S_ST( 'i', 3, 622, 0 ), /* 621 pidf */
+ S_ST( 'l', 3, 382, 0 ), /* 622 pidfi */
+ S_ST( 'o', 3, 625, 619 ), /* 623 p */
+ S_ST( 'o', 3, 383, 0 ), /* 624 po */
+ S_ST( 'r', 3, 384, 624 ), /* 625 po */
+ S_ST( 'r', 3, 633, 623 ), /* 626 p */
+ S_ST( 'e', 3, 631, 0 ), /* 627 pr */
+ S_ST( 'e', 3, 629, 0 ), /* 628 pre */
+ S_ST( 'm', 3, 630, 0 ), /* 629 pree */
+ S_ST( 'p', 3, 385, 0 ), /* 630 preem */
+ S_ST( 'f', 3, 632, 628 ), /* 631 pre */
+ S_ST( 'e', 3, 386, 0 ), /* 632 pref */
+ S_ST( 'o', 3, 646, 627 ), /* 633 pr */
+ S_ST( 'c', 3, 635, 0 ), /* 634 pro */
+ S_ST( '_', 3, 636, 0 ), /* 635 proc */
+ S_ST( 'd', 3, 637, 0 ), /* 636 proc_ */
+ S_ST( 'e', 3, 638, 0 ), /* 637 proc_d */
+ S_ST( 'l', 3, 639, 0 ), /* 638 proc_de */
+ S_ST( 'a', 3, 443, 0 ), /* 639 proc_del */
+ S_ST( 'p', 3, 641, 634 ), /* 640 pro */
+ S_ST( '_', 3, 642, 0 ), /* 641 prop */
+ S_ST( 'd', 3, 643, 0 ), /* 642 prop_ */
+ S_ST( 'e', 3, 644, 0 ), /* 643 prop_d */
+ S_ST( 'l', 3, 645, 0 ), /* 644 prop_de */
+ S_ST( 'a', 3, 442, 0 ), /* 645 prop_del */
+ S_ST( 't', 3, 647, 640 ), /* 646 pro */
+ S_ST( 'o', 3, 648, 0 ), /* 647 prot */
+ S_ST( 's', 3, 649, 0 ), /* 648 proto */
+ S_ST( 't', 3, 650, 0 ), /* 649 protos */
+ S_ST( 'a', 3, 651, 0 ), /* 650 protost */
+ S_ST( 't', 3, 387, 0 ), /* 651 protosta */
+ S_ST( 'r', 3, 683, 606 ), /* 652 */
+ S_ST( 'a', 3, 659, 0 ), /* 653 r */
+ S_ST( 'n', 3, 655, 0 ), /* 654 ra */
+ S_ST( 'd', 3, 656, 0 ), /* 655 ran */
+ S_ST( 'f', 3, 657, 0 ), /* 656 rand */
+ S_ST( 'i', 3, 658, 0 ), /* 657 randf */
+ S_ST( 'l', 3, 389, 0 ), /* 658 randfi */
+ S_ST( 'w', 3, 660, 654 ), /* 659 ra */
+ S_ST( 's', 3, 661, 0 ), /* 660 raw */
+ S_ST( 't', 3, 662, 0 ), /* 661 raws */
+ S_ST( 'a', 3, 663, 0 ), /* 662 rawst */
+ S_ST( 't', 3, 390, 0 ), /* 663 rawsta */
+ S_ST( 'e', 3, 680, 653 ), /* 664 r */
+ S_ST( 'f', 3, 666, 0 ), /* 665 re */
+ S_ST( 'i', 3, 391, 0 ), /* 666 ref */
+ S_ST( 'q', 3, 668, 665 ), /* 667 re */
+ S_ST( 'u', 3, 669, 0 ), /* 668 req */
+ S_ST( 'e', 3, 670, 0 ), /* 669 requ */
+ S_ST( 's', 3, 671, 0 ), /* 670 reque */
+ S_ST( 't', 3, 672, 0 ), /* 671 reques */
+ S_ST( 'k', 3, 673, 0 ), /* 672 request */
+ S_ST( 'e', 3, 392, 0 ), /* 673 requestk */
+ S_ST( 's', 3, 676, 667 ), /* 674 re */
+ S_ST( 'e', 3, 393, 0 ), /* 675 res */
+ S_ST( 't', 3, 677, 675 ), /* 676 res */
+ S_ST( 'r', 3, 678, 0 ), /* 677 rest */
+ S_ST( 'i', 3, 679, 0 ), /* 678 restr */
+ S_ST( 'c', 3, 394, 0 ), /* 679 restri */
+ S_ST( 'v', 3, 681, 674 ), /* 680 re */
+ S_ST( 'o', 3, 682, 0 ), /* 681 rev */
+ S_ST( 'k', 3, 395, 0 ), /* 682 revo */
+ S_ST( 'l', 3, 684, 664 ), /* 683 r */
+ S_ST( 'i', 3, 685, 0 ), /* 684 rl */
+ S_ST( 'm', 3, 686, 0 ), /* 685 rli */
+ S_ST( 'i', 3, 396, 0 ), /* 686 rlim */
+ S_ST( 's', 3, 755, 652 ), /* 687 */
+ S_ST( 'a', 3, 689, 0 ), /* 688 s */
+ S_ST( 'v', 3, 690, 0 ), /* 689 sa */
+ S_ST( 'e', 3, 691, 0 ), /* 690 sav */
+ S_ST( 'c', 3, 692, 0 ), /* 691 save */
+ S_ST( 'o', 3, 693, 0 ), /* 692 savec */
+ S_ST( 'n', 3, 694, 0 ), /* 693 saveco */
+ S_ST( 'f', 3, 695, 0 ), /* 694 savecon */
+ S_ST( 'i', 3, 696, 0 ), /* 695 saveconf */
+ S_ST( 'g', 3, 697, 0 ), /* 696 saveconfi */
+ S_ST( 'd', 3, 698, 0 ), /* 697 saveconfig */
+ S_ST( 'i', 3, 397, 0 ), /* 698 saveconfigd */
+ S_ST( 'e', 3, 709, 688 ), /* 699 s */
+ S_ST( 'r', 3, 701, 0 ), /* 700 se */
+ S_ST( 'v', 3, 702, 0 ), /* 701 ser */
+ S_ST( 'e', 3, 398, 0 ), /* 702 serv */
+ S_ST( '_', 3, 704, 0 ), /* 703 server */
+ S_ST( 'o', 3, 705, 0 ), /* 704 server_ */
+ S_ST( 'f', 3, 706, 0 ), /* 705 server_o */
+ S_ST( 'f', 3, 707, 0 ), /* 706 server_of */
+ S_ST( 's', 3, 708, 0 ), /* 707 server_off */
+ S_ST( 'e', 3, 437, 0 ), /* 708 server_offs */
+ S_ST( 't', 3, 710, 700 ), /* 709 se */
+ S_ST( 'v', 3, 711, 0 ), /* 710 set */
+ S_ST( 'a', 3, 399, 0 ), /* 711 setv */
+ S_ST( 'i', 3, 713, 699 ), /* 712 s */
+ S_ST( 'm', 3, 714, 0 ), /* 713 si */
+ S_ST( 'u', 3, 715, 0 ), /* 714 sim */
+ S_ST( 'l', 3, 716, 0 ), /* 715 simu */
+ S_ST( 'a', 3, 717, 0 ), /* 716 simul */
+ S_ST( 't', 3, 718, 0 ), /* 717 simula */
+ S_ST( 'i', 3, 719, 434 ), /* 718 simulat */
+ S_ST( 'o', 3, 720, 0 ), /* 719 simulati */
+ S_ST( 'n', 3, 721, 0 ), /* 720 simulatio */
+ S_ST( '_', 3, 722, 0 ), /* 721 simulation */
+ S_ST( 'd', 3, 723, 0 ), /* 722 simulation_ */
+ S_ST( 'u', 3, 724, 0 ), /* 723 simulation_d */
+ S_ST( 'r', 3, 725, 0 ), /* 724 simulation_du */
+ S_ST( 'a', 3, 726, 0 ), /* 725 simulation_dur */
+ S_ST( 't', 3, 727, 0 ), /* 726 simulation_dura */
+ S_ST( 'i', 3, 728, 0 ), /* 727 simulation_durat */
+ S_ST( 'o', 3, 436, 0 ), /* 728 simulation_durati */
+ S_ST( 'o', 3, 730, 712 ), /* 729 s */
+ S_ST( 'u', 3, 731, 0 ), /* 730 so */
+ S_ST( 'r', 3, 732, 0 ), /* 731 sou */
+ S_ST( 'c', 3, 400, 0 ), /* 732 sour */
+ S_ST( 't', 3, 751, 729 ), /* 733 s */
+ S_ST( 'a', 3, 740, 0 ), /* 734 st */
+ S_ST( 'c', 3, 736, 0 ), /* 735 sta */
+ S_ST( 'k', 3, 737, 0 ), /* 736 stac */
+ S_ST( 's', 3, 738, 0 ), /* 737 stack */
+ S_ST( 'i', 3, 739, 0 ), /* 738 stacks */
+ S_ST( 'z', 3, 401, 0 ), /* 739 stacksi */
+ S_ST( 't', 3, 403, 735 ), /* 740 sta */
+ S_ST( 'i', 3, 742, 0 ), /* 741 stat */
+ S_ST( 's', 3, 743, 0 ), /* 742 stati */
+ S_ST( 't', 3, 744, 0 ), /* 743 statis */
+ S_ST( 'i', 3, 745, 0 ), /* 744 statist */
+ S_ST( 'c', 3, 402, 0 ), /* 745 statisti */
+ S_ST( 'd', 3, 747, 0 ), /* 746 stats */
+ S_ST( 'i', 3, 404, 0 ), /* 747 statsd */
+ S_ST( 'e', 3, 405, 734 ), /* 748 st */
+ S_ST( 'o', 3, 750, 0 ), /* 749 step */
+ S_ST( 'u', 3, 406, 0 ), /* 750 stepo */
+ S_ST( 'r', 3, 752, 748 ), /* 751 st */
+ S_ST( 'a', 3, 753, 0 ), /* 752 str */
+ S_ST( 't', 3, 754, 0 ), /* 753 stra */
+ S_ST( 'u', 3, 407, 0 ), /* 754 strat */
+ S_ST( 'y', 3, 409, 733 ), /* 755 s */
+ S_ST( 's', 3, 757, 0 ), /* 756 sys */
+ S_ST( 't', 3, 758, 0 ), /* 757 syss */
+ S_ST( 'a', 3, 759, 0 ), /* 758 sysst */
+ S_ST( 't', 3, 410, 0 ), /* 759 syssta */
+ S_ST( 't', 3, 786, 687 ), /* 760 */
+ S_ST( 'i', 3, 772, 0 ), /* 761 t */
+ S_ST( 'c', 3, 411, 0 ), /* 762 ti */
+ S_ST( 'm', 3, 765, 762 ), /* 763 ti */
+ S_ST( 'e', 3, 414, 0 ), /* 764 tim */
+ S_ST( 'i', 3, 766, 764 ), /* 765 tim */
+ S_ST( 'n', 3, 767, 0 ), /* 766 timi */
+ S_ST( 'g', 3, 768, 0 ), /* 767 timin */
+ S_ST( 's', 3, 769, 0 ), /* 768 timing */
+ S_ST( 't', 3, 770, 0 ), /* 769 timings */
+ S_ST( 'a', 3, 771, 0 ), /* 770 timingst */
+ S_ST( 't', 3, 415, 0 ), /* 771 timingsta */
+ S_ST( 'n', 3, 773, 763 ), /* 772 ti */
+ S_ST( 'k', 3, 774, 0 ), /* 773 tin */
+ S_ST( 'e', 3, 416, 0 ), /* 774 tink */
+ S_ST( 'o', 3, 417, 761 ), /* 775 t */
+ S_ST( 'r', 3, 778, 775 ), /* 776 t */
+ S_ST( 'a', 3, 418, 0 ), /* 777 tr */
+ S_ST( 'u', 3, 779, 777 ), /* 778 tr */
+ S_ST( 's', 3, 780, 419 ), /* 779 tru */
+ S_ST( 't', 3, 781, 0 ), /* 780 trus */
+ S_ST( 'e', 3, 782, 0 ), /* 781 trust */
+ S_ST( 'd', 3, 783, 0 ), /* 782 truste */
+ S_ST( 'k', 3, 784, 0 ), /* 783 trusted */
+ S_ST( 'e', 3, 420, 0 ), /* 784 trustedk */
+ S_ST( 't', 3, 421, 776 ), /* 785 t */
+ S_ST( 'y', 3, 787, 785 ), /* 786 t */
+ S_ST( 'p', 3, 422, 0 ), /* 787 ty */
+ S_ST( 'u', 3, 789, 760 ), /* 788 */
+ S_ST( 'n', 3, 795, 0 ), /* 789 u */
+ S_ST( 'c', 3, 791, 0 ), /* 790 un */
+ S_ST( 'o', 3, 792, 0 ), /* 791 unc */
+ S_ST( 'n', 3, 793, 0 ), /* 792 unco */
+ S_ST( 'f', 3, 794, 0 ), /* 793 uncon */
+ S_ST( 'i', 3, 424, 0 ), /* 794 unconf */
+ S_ST( 'p', 3, 796, 790 ), /* 795 un */
+ S_ST( 'e', 3, 797, 0 ), /* 796 unp */
+ S_ST( 'e', 3, 425, 0 ), /* 797 unpe */
+ S_ST( 'v', 3, 799, 788 ), /* 798 */
+ S_ST( 'e', 3, 800, 0 ), /* 799 v */
+ S_ST( 'r', 3, 801, 0 ), /* 800 ve */
+ S_ST( 's', 3, 802, 0 ), /* 801 ver */
+ S_ST( 'i', 3, 803, 0 ), /* 802 vers */
+ S_ST( 'o', 3, 426, 0 ), /* 803 versi */
+ S_ST( 'w', 3, 811, 798 ), /* 804 */
+ S_ST( 'a', 3, 806, 0 ), /* 805 w */
+ S_ST( 'n', 3, 807, 0 ), /* 806 wa */
+ S_ST( 'd', 3, 808, 0 ), /* 807 wan */
+ S_ST( 'e', 3, 440, 0 ), /* 808 wand */
+ S_ST( 'e', 3, 810, 805 ), /* 809 w */
+ S_ST( 'e', 3, 428, 0 ), /* 810 we */
+ S_ST( 'i', 3, 812, 809 ), /* 811 w */
+ S_ST( 'l', 3, 813, 0 ), /* 812 wi */
+ S_ST( 'd', 3, 814, 0 ), /* 813 wil */
+ S_ST( 'c', 3, 815, 0 ), /* 814 wild */
+ S_ST( 'a', 3, 816, 0 ), /* 815 wildc */
+ S_ST( 'r', 3, 429, 0 ), /* 816 wildca */
+ S_ST( 'x', 3, 818, 804 ), /* 817 */
+ S_ST( 'l', 3, 819, 0 ), /* 818 x */
+ S_ST( 'e', 3, 820, 0 ), /* 819 xl */
+ S_ST( 'a', 3, 821, 0 ), /* 820 xle */
+ S_ST( 'v', 3, 430, 0 ), /* 821 xlea */
+ S_ST( 'y', 3, 823, 817 ), /* 822 [initial state] */
+ S_ST( 'e', 3, 824, 0 ), /* 823 y */
+ S_ST( 'a', 3, 431, 0 ) /* 824 ye */
+};
+
diff --git a/ntpd/ntp_leapsec.c b/ntpd/ntp_leapsec.c
new file mode 100644
index 0000000..14b8cd9
--- /dev/null
+++ b/ntpd/ntp_leapsec.c
@@ -0,0 +1,1009 @@
+/*
+ * ntp_leapsec.c - leap second processing for NTPD
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ * ----------------------------------------------------------------------
+ * This is an attempt to get the leap second handling into a dedicated
+ * module to make the somewhat convoluted logic testable.
+ */
+
+#include <config.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <ctype.h>
+
+#include "ntp_types.h"
+#include "ntp_fp.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "ntp_leapsec.h"
+#include "ntp.h"
+#include "vint64ops.h"
+#include "lib_strbuf.h"
+
+#include "isc/sha1.h"
+
+static const char * const logPrefix = "leapsecond file";
+
+/* ---------------------------------------------------------------------
+ * GCC is rather sticky with its 'const' attribute. We have to do it more
+ * explicit than with a cast if we want to get rid of a CONST qualifier.
+ * Greetings from the PASCAL world, where casting was only possible via
+ * untagged unions...
+ */
+static inline void*
+noconst(
+ const void* ptr
+ )
+{
+ union {
+ const void * cp;
+ void * vp;
+ } tmp;
+ tmp.cp = ptr;
+ return tmp.vp;
+}
+
+/* ---------------------------------------------------------------------
+ * Our internal data structure
+ */
+#define MAX_HIST 10 /* history of leap seconds */
+
+struct leap_info {
+ vint64 ttime; /* transition time (after the step, ntp scale) */
+ uint32_t stime; /* schedule limit (a month before transition) */
+ int16_t taiof; /* TAI offset on and after the transition */
+ uint8_t dynls; /* dynamic: inserted on peer/clock request */
+};
+typedef struct leap_info leap_info_t;
+
+struct leap_head {
+ vint64 update; /* time of information update */
+ vint64 expire; /* table expiration time */
+ uint16_t size; /* number of infos in table */
+ int16_t base_tai; /* total leaps before first entry */
+ int16_t this_tai; /* current TAI offset */
+ int16_t next_tai; /* TAI offset after 'when' */
+ vint64 dtime; /* due time (current era end) */
+ vint64 ttime; /* nominal transition time (next era start) */
+ vint64 stime; /* schedule time (when we take notice) */
+ vint64 ebase; /* base time of this leap era */
+ uint8_t dynls; /* next leap is dynamic (by peer request) */
+};
+typedef struct leap_head leap_head_t;
+
+struct leap_table {
+ leap_signature_t lsig;
+ leap_head_t head;
+ leap_info_t info[MAX_HIST];
+};
+
+/* Where we store our tables */
+static leap_table_t _ltab[2], *_lptr;
+static int/*BOOL*/ _electric;
+
+/* Forward decls of local helpers */
+static int add_range(leap_table_t*, const leap_info_t*);
+static char * get_line(leapsec_reader, void*, char*, size_t);
+static char * skipws(const char*);
+static int parsefail(const char * cp, const char * ep);
+static void reload_limits(leap_table_t*, const vint64*);
+static int betweenu32(uint32_t, uint32_t, uint32_t);
+static void reset_times(leap_table_t*);
+static int leapsec_add(leap_table_t*, const vint64*, int);
+static int leapsec_raw(leap_table_t*, const vint64 *, int, int);
+static char * lstostr(const vint64 * ts);
+
+/* =====================================================================
+ * Get & Set the current leap table
+ */
+
+/* ------------------------------------------------------------------ */
+leap_table_t *
+leapsec_get_table(
+ int alternate)
+{
+ leap_table_t *p1, *p2;
+
+ p1 = _lptr;
+ p1 = &_ltab[p1 == &_ltab[1]];
+ p2 = &_ltab[p1 == &_ltab[0]];
+ if (alternate) {
+ memcpy(p2, p1, sizeof(leap_table_t));
+ p1 = p2;
+ }
+
+ return p1;
+}
+
+/* ------------------------------------------------------------------ */
+int/*BOOL*/
+leapsec_set_table(
+ leap_table_t * pt)
+{
+ if (pt == &_ltab[0] || pt == &_ltab[1])
+ _lptr = pt;
+ return _lptr == pt;
+}
+
+/* ------------------------------------------------------------------ */
+int/*BOOL*/
+leapsec_electric(
+ int/*BOOL*/ on)
+{
+ int res = _electric;
+ if (on < 0)
+ return res;
+
+ _electric = (on != 0);
+ if (_electric == res)
+ return res;
+
+ if (_lptr == &_ltab[0] || _lptr == &_ltab[1])
+ reset_times(_lptr);
+
+ return res;
+}
+
+/* =====================================================================
+ * API functions that operate on tables
+ */
+
+/* ---------------------------------------------------------------------
+ * Clear all leap second data. Use it for init & cleanup
+ */
+void
+leapsec_clear(
+ leap_table_t * pt)
+{
+ memset(&pt->lsig, 0, sizeof(pt->lsig));
+ memset(&pt->head, 0, sizeof(pt->head));
+ reset_times(pt);
+}
+
+/* ---------------------------------------------------------------------
+ * Load a leap second file and check expiration on the go
+ */
+int/*BOOL*/
+leapsec_load(
+ leap_table_t * pt ,
+ leapsec_reader func,
+ void * farg,
+ int use_build_limit)
+{
+ char *cp, *ep, linebuf[50];
+ vint64 ttime, limit;
+ long taiof;
+ struct calendar build;
+
+ leapsec_clear(pt);
+ if (use_build_limit && ntpcal_get_build_date(&build))
+ limit = ntpcal_date_to_ntp64(&build);
+ else
+ memset(&limit, 0, sizeof(limit));
+
+ while (get_line(func, farg, linebuf, sizeof(linebuf))) {
+ cp = linebuf;
+ if (*cp == '#') {
+ cp++;
+ if (*cp == '@') {
+ cp = skipws(cp+1);
+ pt->head.expire = strtouv64(cp, &ep, 10);
+ if (parsefail(cp, ep))
+ goto fail_read;
+ pt->lsig.etime = pt->head.expire.D_s.lo;
+ } else if (*cp == '$') {
+ cp = skipws(cp+1);
+ pt->head.update = strtouv64(cp, &ep, 10);
+ if (parsefail(cp, ep))
+ goto fail_read;
+ }
+ } else if (isdigit((u_char)*cp)) {
+ ttime = strtouv64(cp, &ep, 10);
+ if (parsefail(cp, ep))
+ goto fail_read;
+ cp = skipws(ep);
+ taiof = strtol(cp, &ep, 10);
+ if ( parsefail(cp, ep)
+ || taiof > SHRT_MAX || taiof < SHRT_MIN)
+ goto fail_read;
+ if (ucmpv64(&ttime, &limit) >= 0) {
+ if (!leapsec_raw(pt, &ttime,
+ taiof, FALSE))
+ goto fail_insn;
+ } else {
+ pt->head.base_tai = (int16_t)taiof;
+ }
+ pt->lsig.ttime = ttime.D_s.lo;
+ pt->lsig.taiof = (int16_t)taiof;
+ }
+ }
+ return TRUE;
+
+fail_read:
+ errno = EILSEQ;
+fail_insn:
+ leapsec_clear(pt);
+ return FALSE;
+}
+
+/* ---------------------------------------------------------------------
+ * Dump a table in human-readable format. Use 'fprintf' and a FILE
+ * pointer if you want to get it printed into a stream.
+ */
+void
+leapsec_dump(
+ const leap_table_t * pt ,
+ leapsec_dumper func,
+ void * farg)
+{
+ int idx;
+ vint64 ts;
+ struct calendar atb, ttb;
+
+ ntpcal_ntp64_to_date(&ttb, &pt->head.expire);
+ (*func)(farg, "leap table (%u entries) expires at %04u-%02u-%02u:\n",
+ pt->head.size,
+ ttb.year, ttb.month, ttb.monthday);
+ idx = pt->head.size;
+ while (idx-- != 0) {
+ ts = pt->info[idx].ttime;
+ ntpcal_ntp64_to_date(&ttb, &ts);
+ ts = subv64u32(&ts, pt->info[idx].stime);
+ ntpcal_ntp64_to_date(&atb, &ts);
+
+ (*func)(farg, "%04u-%02u-%02u [%c] (%04u-%02u-%02u) - %d\n",
+ ttb.year, ttb.month, ttb.monthday,
+ "-*"[pt->info[idx].dynls != 0],
+ atb.year, atb.month, atb.monthday,
+ pt->info[idx].taiof);
+ }
+}
+
+/* =====================================================================
+ * usecase driven API functions
+ */
+
+int/*BOOL*/
+leapsec_query(
+ leap_result_t * qr ,
+ uint32_t ts32 ,
+ const time_t * pivot)
+{
+ leap_table_t * pt;
+ vint64 ts64, last, next;
+ uint32_t due32;
+ int fired;
+
+ /* preset things we use later on... */
+ fired = FALSE;
+ ts64 = ntpcal_ntp_to_ntp(ts32, pivot);
+ pt = leapsec_get_table(FALSE);
+ memset(qr, 0, sizeof(leap_result_t));
+
+ if (ucmpv64(&ts64, &pt->head.ebase) < 0) {
+ /* Most likely after leap frame reset. Could also be a
+ * backstep of the system clock. Anyway, get the new
+ * leap era frame.
+ */
+ reload_limits(pt, &ts64);
+ } else if (ucmpv64(&ts64, &pt->head.dtime) >= 0) {
+ /* Boundary crossed in forward direction. This might
+ * indicate a leap transition, so we prepare for that
+ * case.
+ *
+ * Some operations below are actually NOPs in electric
+ * mode, but having only one code path that works for
+ * both modes is easier to maintain.
+ */
+ last = pt->head.ttime;
+ qr->warped = (int16_t)(last.D_s.lo -
+ pt->head.dtime.D_s.lo);
+ next = addv64i32(&ts64, qr->warped);
+ reload_limits(pt, &next);
+ fired = ucmpv64(&pt->head.ebase, &last) == 0;
+ if (fired) {
+ ts64 = next;
+ ts32 = next.D_s.lo;
+ } else {
+ qr->warped = 0;
+ }
+ }
+
+ qr->tai_offs = pt->head.this_tai;
+
+ /* If before the next scheduling alert, we're done. */
+ if (ucmpv64(&ts64, &pt->head.stime) < 0)
+ return fired;
+
+ /* now start to collect the remaing data */
+ due32 = pt->head.dtime.D_s.lo;
+
+ qr->tai_diff = pt->head.next_tai - pt->head.this_tai;
+ qr->ttime = pt->head.ttime;
+ qr->ddist = due32 - ts32;
+ qr->dynamic = pt->head.dynls;
+ qr->proximity = LSPROX_SCHEDULE;
+
+ /* if not in the last day before transition, we're done. */
+ if (!betweenu32(due32 - SECSPERDAY, ts32, due32))
+ return fired;
+
+ qr->proximity = LSPROX_ANNOUNCE;
+ if (!betweenu32(due32 - 10, ts32, due32))
+ return fired;
+
+ /* The last 10s before the transition. Prepare for action! */
+ qr->proximity = LSPROX_ALERT;
+ return fired;
+}
+
+/* ------------------------------------------------------------------ */
+int/*BOOL*/
+leapsec_frame(
+ leap_result_t *qr)
+{
+ const leap_table_t * pt;
+
+ memset(qr, 0, sizeof(leap_result_t));
+ pt = leapsec_get_table(FALSE);
+ if (ucmpv64(&pt->head.ttime, &pt->head.stime) <= 0)
+ return FALSE;
+
+ qr->tai_offs = pt->head.this_tai;
+ qr->tai_diff = pt->head.next_tai - pt->head.this_tai;
+ qr->ttime = pt->head.ttime;
+ qr->dynamic = pt->head.dynls;
+
+ return TRUE;
+}
+
+/* ------------------------------------------------------------------ */
+/* Reset the current leap frame */
+void
+leapsec_reset_frame(void)
+{
+ reset_times(leapsec_get_table(FALSE));
+}
+
+/* ------------------------------------------------------------------ */
+/* load a file from a FILE pointer. Note: If hcheck is true, load
+ * only after successful signature check. The stream must be seekable
+ * or this will fail.
+ */
+int/*BOOL*/
+leapsec_load_stream(
+ FILE * ifp ,
+ const char * fname,
+ int/*BOOL*/ logall)
+{
+ leap_table_t *pt;
+ int rcheck;
+
+ if (NULL == fname)
+ fname = "<unknown>";
+
+ rcheck = leapsec_validate((leapsec_reader)getc, ifp);
+ if (logall)
+ switch (rcheck)
+ {
+ case LSVALID_GOODHASH:
+ msyslog(LOG_NOTICE, "%s ('%s'): good hash signature",
+ logPrefix, fname);
+ break;
+
+ case LSVALID_NOHASH:
+ msyslog(LOG_ERR, "%s ('%s'): no hash signature",
+ logPrefix, fname);
+ break;
+ case LSVALID_BADHASH:
+ msyslog(LOG_ERR, "%s ('%s'): signature mismatch",
+ logPrefix, fname);
+ break;
+ case LSVALID_BADFORMAT:
+ msyslog(LOG_ERR, "%s ('%s'): malformed hash signature",
+ logPrefix, fname);
+ break;
+ default:
+ msyslog(LOG_ERR, "%s ('%s'): unknown error code %d",
+ logPrefix, fname, rcheck);
+ break;
+ }
+ if (rcheck < 0)
+ return FALSE;
+
+ rewind(ifp);
+ pt = leapsec_get_table(TRUE);
+ if (!leapsec_load(pt, (leapsec_reader)getc, ifp, TRUE)) {
+ switch (errno) {
+ case EINVAL:
+ msyslog(LOG_ERR, "%s ('%s'): bad transition time",
+ logPrefix, fname);
+ break;
+ case ERANGE:
+ msyslog(LOG_ERR, "%s ('%s'): times not ascending",
+ logPrefix, fname);
+ break;
+ default:
+ msyslog(LOG_ERR, "%s ('%s'): parsing error",
+ logPrefix, fname);
+ break;
+ }
+ return FALSE;
+ }
+
+ if (pt->head.size)
+ msyslog(LOG_NOTICE, "%s ('%s'): loaded, expire=%s last=%s ofs=%d",
+ logPrefix, fname, lstostr(&pt->head.expire),
+ lstostr(&pt->info[0].ttime), pt->info[0].taiof);
+ else
+ msyslog(LOG_NOTICE,
+ "%s ('%s'): loaded, expire=%s ofs=%d (no entries after build date)",
+ logPrefix, fname, lstostr(&pt->head.expire),
+ pt->head.base_tai);
+
+ return leapsec_set_table(pt);
+}
+
+/* ------------------------------------------------------------------ */
+int/*BOOL*/
+leapsec_load_file(
+ const char * fname,
+ struct stat * sb_old,
+ int/*BOOL*/ force,
+ int/*BOOL*/ logall)
+{
+ FILE * fp;
+ struct stat sb_new;
+ int rc;
+
+ /* just do nothing if there is no leap file */
+ if ( !(fname && *fname) )
+ return FALSE;
+
+ /* try to stat the leapfile */
+ if (0 != stat(fname, &sb_new)) {
+ if (logall)
+ msyslog(LOG_ERR, "%s ('%s'): stat failed: %m",
+ logPrefix, fname);
+ return FALSE;
+ }
+
+ /* silently skip to postcheck if no new file found */
+ if (NULL != sb_old) {
+ if (!force
+ && sb_old->st_mtime == sb_new.st_mtime
+ && sb_old->st_ctime == sb_new.st_ctime
+ )
+ return FALSE;
+ *sb_old = sb_new;
+ }
+
+ /* try to open the leap file, complain if that fails
+ *
+ * [perlinger@ntp.org]
+ * coverity raises a TOCTOU (time-of-check/time-of-use) issue
+ * here, which is not entirely helpful: While there is indeed a
+ * possible race condition between the 'stat()' call above and
+ * the 'fopen)' call below, I intentionally want to omit the
+ * overhead of opening the file and calling 'fstat()', because
+ * in most cases the file would have be to closed anyway without
+ * reading the contents. I chose to disable the coverity
+ * warning instead.
+ *
+ * So unless someone comes up with a reasonable argument why
+ * this could be a real issue, I'll just try to silence coverity
+ * on that topic.
+ */
+ /* coverity[toctou] */
+ if ((fp = fopen(fname, "r")) == NULL) {
+ if (logall)
+ msyslog(LOG_ERR,
+ "%s ('%s'): open failed: %m",
+ logPrefix, fname);
+ return FALSE;
+ }
+
+ rc = leapsec_load_stream(fp, fname, logall);
+ fclose(fp);
+ return rc;
+}
+
+/* ------------------------------------------------------------------ */
+void
+leapsec_getsig(
+ leap_signature_t * psig)
+{
+ const leap_table_t * pt;
+
+ pt = leapsec_get_table(FALSE);
+ memcpy(psig, &pt->lsig, sizeof(leap_signature_t));
+}
+
+/* ------------------------------------------------------------------ */
+int/*BOOL*/
+leapsec_expired(
+ uint32_t when,
+ const time_t * tpiv)
+{
+ const leap_table_t * pt;
+ vint64 limit;
+
+ pt = leapsec_get_table(FALSE);
+ limit = ntpcal_ntp_to_ntp(when, tpiv);
+ return ucmpv64(&limit, &pt->head.expire) >= 0;
+}
+
+/* ------------------------------------------------------------------ */
+int32_t
+leapsec_daystolive(
+ uint32_t when,
+ const time_t * tpiv)
+{
+ const leap_table_t * pt;
+ vint64 limit;
+
+ pt = leapsec_get_table(FALSE);
+ limit = ntpcal_ntp_to_ntp(when, tpiv);
+ limit = subv64(&pt->head.expire, &limit);
+ return ntpcal_daysplit(&limit).hi;
+}
+
+/* ------------------------------------------------------------------ */
+int/*BOOL*/
+leapsec_add_fix(
+ int total,
+ uint32_t ttime,
+ uint32_t etime,
+ const time_t * pivot)
+{
+ time_t tpiv;
+ leap_table_t * pt;
+ vint64 tt64, et64;
+
+ if (pivot == NULL) {
+ time(&tpiv);
+ pivot = &tpiv;
+ }
+
+ et64 = ntpcal_ntp_to_ntp(etime, pivot);
+ tt64 = ntpcal_ntp_to_ntp(ttime, pivot);
+ pt = leapsec_get_table(TRUE);
+
+ if ( ucmpv64(&et64, &pt->head.expire) <= 0
+ || !leapsec_raw(pt, &tt64, total, FALSE) )
+ return FALSE;
+
+ pt->lsig.etime = etime;
+ pt->lsig.ttime = ttime;
+ pt->lsig.taiof = (int16_t)total;
+
+ pt->head.expire = et64;
+
+ return leapsec_set_table(pt);
+}
+
+/* ------------------------------------------------------------------ */
+int/*BOOL*/
+leapsec_add_dyn(
+ int insert,
+ uint32_t ntpnow,
+ const time_t * pivot )
+{
+ leap_table_t * pt;
+ vint64 now64;
+
+ pt = leapsec_get_table(TRUE);
+ now64 = ntpcal_ntp_to_ntp(ntpnow, pivot);
+ return ( leapsec_add(pt, &now64, (insert != 0))
+ && leapsec_set_table(pt));
+}
+
+/* =====================================================================
+ * internal helpers
+ */
+
+/* [internal] Reset / init the time window in the leap processor to
+ * force reload on next query. Since a leap transition cannot take place
+ * at an odd second, the value chosen avoids spurious leap transition
+ * triggers. Making all three times equal forces a reload. Using the
+ * maximum value for unsigned 64 bits makes finding the next leap frame
+ * a bit easier.
+ */
+static void
+reset_times(
+ leap_table_t * pt)
+{
+ memset(&pt->head.ebase, 0xFF, sizeof(vint64));
+ pt->head.stime = pt->head.ebase;
+ pt->head.ttime = pt->head.ebase;
+ pt->head.dtime = pt->head.ebase;
+}
+
+/* [internal] Add raw data to the table, removing old entries on the
+ * fly. This cannot fail currently.
+ */
+static int/*BOOL*/
+add_range(
+ leap_table_t * pt,
+ const leap_info_t * pi)
+{
+ /* If the table is full, make room by throwing out the oldest
+ * entry. But remember the accumulated leap seconds!
+ */
+ if (pt->head.size >= MAX_HIST) {
+ pt->head.size = MAX_HIST - 1;
+ pt->head.base_tai = pt->info[pt->head.size].taiof;
+ }
+
+ /* make room in lower end and insert item */
+ memmove(pt->info+1, pt->info, pt->head.size*sizeof(*pt->info));
+ pt->info[0] = *pi;
+ pt->head.size++;
+
+ /* invalidate the cached limit data -- we might have news ;-)
+ *
+ * This blocks a spurious transition detection. OTOH, if you add
+ * a value after the last query before a leap transition was
+ * expected to occur, this transition trigger is lost. But we
+ * can probably live with that.
+ */
+ reset_times(pt);
+ return TRUE;
+}
+
+/* [internal] given a reader function, read characters into a buffer
+ * until either EOL or EOF is reached. Makes sure that the buffer is
+ * always NUL terminated, but silently truncates excessive data. The
+ * EOL-marker ('\n') is *not* stored in the buffer.
+ *
+ * Returns the pointer to the buffer, unless EOF was reached when trying
+ * to read the first character of a line.
+ */
+static char *
+get_line(
+ leapsec_reader func,
+ void * farg,
+ char * buff,
+ size_t size)
+{
+ int ch;
+ char *ptr;
+
+ /* if we cannot even store the delimiter, declare failure */
+ if (buff == NULL || size == 0)
+ return NULL;
+
+ ptr = buff;
+ while (EOF != (ch = (*func)(farg)) && '\n' != ch)
+ if (size > 1) {
+ size--;
+ *ptr++ = (char)ch;
+ }
+ /* discard trailing whitespace */
+ while (ptr != buff && isspace((u_char)ptr[-1]))
+ ptr--;
+ *ptr = '\0';
+ return (ptr == buff && ch == EOF) ? NULL : buff;
+}
+
+/* [internal] skips whitespace characters from a character buffer. */
+static char *
+skipws(
+ const char *ptr)
+{
+ while (isspace((u_char)*ptr))
+ ptr++;
+ return (char*)noconst(ptr);
+}
+
+/* [internal] check if a strtoXYZ ended at EOL or whistespace and
+ * converted something at all. Return TRUE if something went wrong.
+ */
+static int/*BOOL*/
+parsefail(
+ const char * cp,
+ const char * ep)
+{
+ return (cp == ep)
+ || (*ep && *ep != '#' && !isspace((u_char)*ep));
+}
+
+/* [internal] reload the table limits around the given time stamp. This
+ * is where the real work is done when it comes to table lookup and
+ * evaluation. Some care has been taken to have correct code for dealing
+ * with boundary conditions and empty tables.
+ *
+ * In electric mode, transition and trip time are the same. In dumb
+ * mode, the difference of the TAI offsets must be taken into account
+ * and trip time and transition time become different. The difference
+ * becomes the warping distance when the trip time is reached.
+ */
+static void
+reload_limits(
+ leap_table_t * pt,
+ const vint64 * ts)
+{
+ int idx;
+
+ /* Get full time and search the true lower bound. Use a
+ * simple loop here, since the number of entries does
+ * not warrant a binary search. This also works for an empty
+ * table, so there is no shortcut for that case.
+ */
+ for (idx = 0; idx != pt->head.size; idx++)
+ if (ucmpv64(ts, &pt->info[idx].ttime) >= 0)
+ break;
+
+ /* get time limits with proper bound conditions. Note that the
+ * bounds of the table will be observed even if the table is
+ * empty -- no undefined condition must arise from this code.
+ */
+ if (idx >= pt->head.size) {
+ memset(&pt->head.ebase, 0x00, sizeof(vint64));
+ pt->head.this_tai = pt->head.base_tai;
+ } else {
+ pt->head.ebase = pt->info[idx].ttime;
+ pt->head.this_tai = pt->info[idx].taiof;
+ }
+ if (--idx >= 0) {
+ pt->head.next_tai = pt->info[idx].taiof;
+ pt->head.dynls = pt->info[idx].dynls;
+ pt->head.ttime = pt->info[idx].ttime;
+
+ if (_electric)
+ pt->head.dtime = pt->head.ttime;
+ else
+ pt->head.dtime = addv64i32(
+ &pt->head.ttime,
+ pt->head.next_tai - pt->head.this_tai);
+
+ pt->head.stime = subv64u32(
+ &pt->head.ttime, pt->info[idx].stime);
+
+ } else {
+ memset(&pt->head.ttime, 0xFF, sizeof(vint64));
+ pt->head.stime = pt->head.ttime;
+ pt->head.dtime = pt->head.ttime;
+ pt->head.next_tai = pt->head.this_tai;
+ pt->head.dynls = 0;
+ }
+}
+
+/* [internal] Take a time stamp and create a leap second frame for
+ * it. This will schedule a leap second for the beginning of the next
+ * month, midnight UTC. The 'insert' argument tells if a leap second is
+ * added (!=0) or removed (==0). We do not handle multiple inserts
+ * (yet?)
+ *
+ * Returns 1 if the insert worked, 0 otherwise. (It's not possible to
+ * insert a leap second into the current history -- only appending
+ * towards the future is allowed!)
+ */
+static int/*BOOL*/
+leapsec_add(
+ leap_table_t* pt ,
+ const vint64 * now64 ,
+ int insert)
+{
+ vint64 ttime, stime;
+ struct calendar fts;
+ leap_info_t li;
+
+ /* Check against the table expiration and the lates available
+ * leap entry. Do not permit inserts, only appends, and only if
+ * the extend the table beyond the expiration!
+ */
+ if ( ucmpv64(now64, &pt->head.expire) < 0
+ || (pt->head.size && ucmpv64(now64, &pt->info[0].ttime) <= 0)) {
+ errno = ERANGE;
+ return FALSE;
+ }
+
+ ntpcal_ntp64_to_date(&fts, now64);
+ /* To guard against dangling leap flags: do not accept leap
+ * second request on the 1st hour of the 1st day of the month.
+ */
+ if (fts.monthday == 1 && fts.hour == 0) {
+ errno = EINVAL;
+ return FALSE;
+ }
+
+ /* Ok, do the remaining calculations */
+ fts.monthday = 1;
+ fts.hour = 0;
+ fts.minute = 0;
+ fts.second = 0;
+ stime = ntpcal_date_to_ntp64(&fts);
+ fts.month++;
+ ttime = ntpcal_date_to_ntp64(&fts);
+
+ li.ttime = ttime;
+ li.stime = ttime.D_s.lo - stime.D_s.lo;
+ li.taiof = (pt->head.size ? pt->info[0].taiof : pt->head.base_tai)
+ + (insert ? 1 : -1);
+ li.dynls = 1;
+ return add_range(pt, &li);
+}
+
+/* [internal] Given a time stamp for a leap insertion (the exact begin
+ * of the new leap era), create new leap frame and put it into the
+ * table. This is the work horse for reading a leap file and getting a
+ * leap second update via authenticated network packet.
+ */
+int/*BOOL*/
+leapsec_raw(
+ leap_table_t * pt,
+ const vint64 * ttime,
+ int taiof,
+ int dynls)
+{
+ vint64 stime;
+ struct calendar fts;
+ leap_info_t li;
+
+ /* Check that we only extend the table. Paranoia rulez! */
+ if (pt->head.size && ucmpv64(ttime, &pt->info[0].ttime) <= 0) {
+ errno = ERANGE;
+ return FALSE;
+ }
+
+ ntpcal_ntp64_to_date(&fts, ttime);
+ /* If this does not match the exact month start, bail out. */
+ if (fts.monthday != 1 || fts.hour || fts.minute || fts.second) {
+ errno = EINVAL;
+ return FALSE;
+ }
+ fts.month--; /* was in range 1..12, no overflow here! */
+ stime = ntpcal_date_to_ntp64(&fts);
+ li.ttime = *ttime;
+ li.stime = ttime->D_s.lo - stime.D_s.lo;
+ li.taiof = (int16_t)taiof;
+ li.dynls = (dynls != 0);
+ return add_range(pt, &li);
+}
+
+/* [internal] Do a wrap-around save range inclusion check.
+ * Returns TRUE if x in [lo,hi[ (intervall open on right side) with full
+ * handling of an overflow / wrap-around.
+ */
+static int/*BOOL*/
+betweenu32(
+ uint32_t lo,
+ uint32_t x,
+ uint32_t hi)
+{
+ int rc;
+
+ if (lo <= hi)
+ rc = (lo <= x) && (x < hi);
+ else
+ rc = (lo <= x) || (x < hi);
+ return rc;
+}
+
+/* =====================================================================
+ * validation stuff
+ */
+
+typedef struct {
+ unsigned char hv[ISC_SHA1_DIGESTLENGTH];
+} sha1_digest;
+
+/* [internal] parse a digest line to get the hash signature
+ * The NIST code creating the hash writes them out as 5 hex integers
+ * without leading zeros. This makes reading them back as hex-encoded
+ * BLOB impossible, because there might be less than 40 hex digits.
+ *
+ * The solution is to read the values back as integers, and then do the
+ * byte twiddle necessary to get it into an array of 20 chars. The
+ * drawback is that it permits any acceptable number syntax provided by
+ * 'scanf()' and 'strtoul()', including optional signs and '0x'
+ * prefixes.
+ */
+static int/*BOOL*/
+do_leap_hash(
+ sha1_digest * mac,
+ char const * cp )
+{
+ int wi, di, num, len;
+ unsigned long tmp[5];
+
+ memset(mac, 0, sizeof(*mac));
+ num = sscanf(cp, " %lx %lx %lx %lx %lx%n",
+ &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4],
+ &len);
+ if (num != 5 || cp[len] > ' ')
+ return FALSE;
+
+ /* now do the byte twiddle */
+ for (wi=0; wi < 5; ++wi)
+ for (di=3; di >= 0; --di) {
+ mac->hv[wi*4 + di] = (unsigned char)tmp[wi];
+ tmp[wi] >>= 8;
+ }
+ return TRUE;
+}
+
+/* [internal] add the digits of a data line to the hash, stopping at the
+ * next hash ('#') character.
+ */
+static void
+do_hash_data(
+ isc_sha1_t * mdctx,
+ char const * cp )
+{
+ unsigned char text[32]; // must be power of two!
+ unsigned int tlen = 0;
+ unsigned char ch;
+
+ while ('\0' != (ch = *cp++) && '#' != ch)
+ if (isdigit(ch)) {
+ text[tlen++] = ch;
+ tlen &= (sizeof(text)-1);
+ if (0 == tlen)
+ isc_sha1_update(
+ mdctx, text, sizeof(text));
+ }
+
+ if (0 < tlen)
+ isc_sha1_update(mdctx, text, tlen);
+}
+
+/* given a reader and a reader arg, calculate and validate the the hash
+ * signature of a NIST leap second file.
+ */
+int
+leapsec_validate(
+ leapsec_reader func,
+ void * farg)
+{
+ isc_sha1_t mdctx;
+ sha1_digest rdig, ldig; /* remote / local digests */
+ char line[50];
+ int hlseen = -1;
+
+ isc_sha1_init(&mdctx);
+ while (get_line(func, farg, line, sizeof(line))) {
+ if (!strncmp(line, "#h", 2))
+ hlseen = do_leap_hash(&rdig, line+2);
+ else if (!strncmp(line, "#@", 2))
+ do_hash_data(&mdctx, line+2);
+ else if (!strncmp(line, "#$", 2))
+ do_hash_data(&mdctx, line+2);
+ else if (isdigit(line[0]))
+ do_hash_data(&mdctx, line);
+ }
+ isc_sha1_final(&mdctx, ldig.hv);
+ isc_sha1_invalidate(&mdctx);
+
+ if (0 > hlseen)
+ return LSVALID_NOHASH;
+ if (0 == hlseen)
+ return LSVALID_BADFORMAT;
+ if (0 != memcmp(&rdig, &ldig, sizeof(sha1_digest)))
+ return LSVALID_BADHASH;
+ return LSVALID_GOODHASH;
+}
+
+/*
+ * lstostr - prettyprint NTP seconds
+ */
+static char * lstostr(
+ const vint64 * ts)
+{
+ char * buf;
+ struct calendar tm;
+
+ LIB_GETBUF(buf);
+ ntpcal_ntp64_to_date(&tm, ts);
+ snprintf(buf, LIB_BUFLENGTH, "%04d-%02d-%02dT%02d:%02dZ",
+ tm.year, tm.month, tm.monthday,
+ tm.hour, tm.minute);
+ return buf;
+}
+
+
+
+/* -*- that's all folks! -*- */
diff --git a/ntpd/ntp_leapsec.h b/ntpd/ntp_leapsec.h
new file mode 100644
index 0000000..75edcc4
--- /dev/null
+++ b/ntpd/ntp_leapsec.h
@@ -0,0 +1,218 @@
+/*
+ * ntp_leapsec.h - leap second processing for NTPD
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ * ----------------------------------------------------------------------
+ * This is an attempt to get the leap second handling into a dedicated
+ * module to make the somewhat convoluted logic testable.
+ */
+
+#ifndef NTP_LEAPSEC_H
+#define NTP_LEAPSEC_H
+
+struct stat;
+
+
+/* function pointer types. Note that 'fprintf' and 'getc' can be casted
+ * to the dumper resp. reader type, provided the auxiliary argument is a
+ * valid FILE pointer in hat case.
+ */
+typedef void (*leapsec_dumper)(void*, const char *fmt, ...);
+typedef int (*leapsec_reader)(void*);
+
+struct leap_table;
+typedef struct leap_table leap_table_t;
+
+/* Validate a stream containing a leap second file in the NIST / NTPD
+ * format that can also be loaded via 'leapsec_load()'. This uses
+ * the SHA1 hash and preprocessing as described in the NIST leapsecond
+ * file.
+ */
+#define LSVALID_GOODHASH 1 /* valid signature */
+#define LSVALID_NOHASH 0 /* no signature in file */
+#define LSVALID_BADHASH -1 /* signature mismatch */
+#define LSVALID_BADFORMAT -2 /* signature not parseable */
+
+extern int leapsec_validate(leapsec_reader, void*);
+
+
+/* Set/get electric mode
+ * Electric mode is defined as the operation mode where the system clock
+ * automagically manages the leap second, so we don't have to care about
+ * stepping the clock. (This should be the case with most systems,
+ * including the current implementation of the Win32 timekeeping.)
+ *
+ * The consequence of electric mode is that we do not 'see' the leap
+ * second, and no client actions are needed when crossing the leap era
+ * boundary. In manual (aka non-electric) mode the clock will simply
+ * step forward untill *we* (that is, this module) tells the client app
+ * to step at the right time. This needs a slightly different type of
+ * processing, so switching between those two modes should not be done
+ * too close to a leap second. The transition might be lost in that
+ * case. (The limit is actual 2 sec before transition.)
+ *
+ * OTOH, this is a system characteristic, so it's expected to be set
+ * properly somewhere after system start and retain the value.
+ *
+ * Simply querying the state or setting it to the same value as before
+ * does not have any unwanted side effects. You can query by giving a
+ * negative value for the switch.
+ */
+extern int/*BOOL*/ leapsec_electric(int/*BOOL*/ on);
+
+
+/* Query result for a leap second schedule
+ * 'ttime' is the transition point in full time scale, but only if
+ * 'tai_diff' is not zero. Nominal UTC time when the next leap
+ * era starts.
+ * 'ddist' is the distance to the transition, in clock seconds.
+ * This is the distance to the due time, which is different
+ * from the transition time if the mode is non-electric.
+ * Only valid if 'tai_diff' is not zero.
+ * 'tai_offs' is the CURRENT distance from clock (UTC) to TAI. Always valid.
+ * 'tai_diff' is the change in TAI offset after the next leap
+ * transition. Zero if nothing is pending or too far ahead.
+ * 'warped' is set only once, when the the leap second occurred between
+ * two queries. Always zero in electric mode. If non-zero,
+ * immediately step the clock.
+ * 'proximity' is a proximity warning. See definitions below. This is
+ * more useful than an absolute difference to the leap second.
+ * 'dynamic' != 0 if entry was requested by clock/peer
+ */
+struct leap_result {
+ vint64 ttime;
+ uint32_t ddist;
+ int16_t tai_offs;
+ int16_t tai_diff;
+ int16_t warped;
+ uint8_t proximity;
+ uint8_t dynamic;
+};
+typedef struct leap_result leap_result_t;
+
+struct leap_signature {
+ uint32_t etime; /* expiration time */
+ uint32_t ttime; /* transition time */
+ int16_t taiof; /* total offset to TAI */
+};
+typedef struct leap_signature leap_signature_t;
+
+
+#define LSPROX_NOWARN 0 /* clear radar screen */
+#define LSPROX_SCHEDULE 1 /* less than 1 month to target*/
+#define LSPROX_ANNOUNCE 2 /* less than 1 day to target */
+#define LSPROX_ALERT 3 /* less than 10 sec to target */
+
+/* Get the current or alternate table pointer. Getting the alternate
+ * pointer will automatically copy the primary table, so it can be
+ * subsequently modified.
+ */
+extern leap_table_t *leapsec_get_table(int alternate);
+
+/* Set the current leap table. Accepts only return values from
+ * 'leapsec_get_table()', so it's hard to do something wrong. Returns
+ * TRUE if the current table is the requested one.
+ */
+extern int/*BOOL*/ leapsec_set_table(leap_table_t *);
+
+/* Clear all leap second data. Use it for init & cleanup */
+extern void leapsec_clear(leap_table_t*);
+
+/* Load a leap second file. If 'blimit' is set, do not store (but
+ * register with their TAI offset) leap entries before the build date.
+ * Update the leap signature data on the fly.
+ */
+extern int/*BOOL*/ leapsec_load(leap_table_t*, leapsec_reader,
+ void*, int blimit);
+
+/* Dump the current leap table in readable format, using the provided
+ * dump formatter function.
+ */
+extern void leapsec_dump(const leap_table_t*, leapsec_dumper func, void *farg);
+
+/* Read a leap second file from stream. This is a convenience wrapper
+ * around the generic load function, 'leapsec_load()'.
+ */
+extern int/*BOOL*/ leapsec_load_stream(FILE * fp, const char * fname,
+ int/*BOOL*/logall);
+
+/* Read a leap second file from file. It checks that the file exists and
+ * (if 'force' is not applied) the ctime/mtime has changed since the
+ * last load. If the file has to be loaded, either due to 'force' or
+ * changed time stamps, the 'stat()' results of the file are stored in
+ * '*sb' for the next cycle. Returns TRUE on successful load, FALSE
+ * otherwise. Uses 'leapsec_load_stream()' internally.
+ */
+extern int/*BOOL*/ leapsec_load_file(const char * fname, struct stat * sb,
+ int/*BOOL*/force, int/*BOOL*/logall);
+
+/* Get the current leap data signature. This consists of the last
+ * ransition, the table expiration, and the total TAI difference at the
+ * last transition. This is valid even if the leap transition itself was
+ * culled due to the build date limit.
+ */
+extern void leapsec_getsig(leap_signature_t * psig);
+
+/* Check if the leap table is expired at the given time.
+ */
+extern int/*BOOL*/ leapsec_expired(uint32_t when, const time_t * pivot);
+
+/* Get the distance to expiration in days.
+ * Returns negative values if expired, zero if there are less than 24hrs
+ * left, and positive numbers otherwise.
+ */
+extern int32_t leapsec_daystolive(uint32_t when, const time_t * pivot);
+
+/* Reset the current leap frame, so the next query will do proper table
+ * lookup from fresh. Suppresses a possible leap era transition detection
+ * for the next query.
+ */
+extern void leapsec_reset_frame(void);
+
+/* Given a transition time, the TAI offset valid after that and an
+ * expiration time, try to establish a system leap transition. Only
+ * works if the existing table is extended. On success, updates the
+ * signature data.
+ */
+extern int/*BOOL*/ leapsec_add_fix(int offset, uint32_t ttime, uint32_t etime,
+ const time_t * pivot);
+
+/* Take a time stamp and create a leap second frame for it. This will
+ * schedule a leap second for the beginning of the next month, midnight
+ * UTC. The 'insert' argument tells if a leap second is added (!=0) or
+ * removed (==0). We do not handle multiple inserts (yet?)
+ *
+ * Returns 1 if the insert worked, 0 otherwise. (It's not possible to
+ * insert a leap second into the current history -- only appending
+ * towards the future is allowed!)
+ *
+ * 'ntp_now' is subject to era unfolding. The entry is marked
+ * dynamic. The leap signature is NOT updated.
+ */
+extern int/*BOOL*/ leapsec_add_dyn(int/*BOOL*/ insert, uint32_t ntp_now,
+ const time_t * pivot);
+
+/* Take a time stamp and get the associated leap information. The time
+ * stamp is subject to era unfolding around the pivot or the current
+ * system time if pivot is NULL. Sets the information in '*qr' and
+ * returns TRUE if a leap second era boundary was crossed between the
+ * last and the current query. In that case, qr->warped contains the
+ * required clock stepping, which is always zero in electric mode.
+ */
+extern int/*BOOL*/ leapsec_query(leap_result_t *qr, uint32_t ntpts,
+ const time_t * pivot);
+
+/* Get the current leap frame info. Returns TRUE if the result contains
+ * useable data, FALSE if there is currently no leap second frame.
+ * This merely replicates some results from a previous query, but since
+ * it does not check the current time, only the following entries are
+ * meaningful:
+ * qr->ttime;
+ * qr->tai_offs;
+ * qr->tai_diff;
+ * qr->dynamic;
+ */
+extern int/*BOOL*/ leapsec_frame(leap_result_t *qr);
+
+#endif /* !defined(NTP_LEAPSEC_H) */
diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c
new file mode 100644
index 0000000..87db726
--- /dev/null
+++ b/ntpd/ntp_loopfilter.c
@@ -0,0 +1,1224 @@
+/*
+ * ntp_loopfilter.c - implements the NTP loop filter algorithm
+ *
+ * ATTENTION: Get approval from Dave Mills on all changes to this file!
+ *
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include <signal.h>
+#include <setjmp.h>
+
+#ifdef KERNEL_PLL
+#include "ntp_syscall.h"
+#endif /* KERNEL_PLL */
+
+/*
+ * This is an implementation of the clock discipline algorithm described
+ * in UDel TR 97-4-3, as amended. It operates as an adaptive parameter,
+ * hybrid phase/frequency-lock loop. A number of sanity checks are
+ * included to protect against timewarps, timespikes and general mayhem.
+ * All units are in s and s/s, unless noted otherwise.
+ */
+#define CLOCK_MAX .128 /* default step threshold (s) */
+#define CLOCK_MINSTEP 300. /* default stepout threshold (s) */
+#define CLOCK_PANIC 1000. /* default panic threshold (s) */
+#define CLOCK_PHI 15e-6 /* max frequency error (s/s) */
+#define CLOCK_PLL 16. /* PLL loop gain (log2) */
+#define CLOCK_AVG 8. /* parameter averaging constant */
+#define CLOCK_FLL .25 /* FLL loop gain */
+#define CLOCK_FLOOR .0005 /* startup offset floor (s) */
+#define CLOCK_ALLAN 11 /* Allan intercept (log2 s) */
+#define CLOCK_LIMIT 30 /* poll-adjust threshold */
+#define CLOCK_PGATE 4. /* poll-adjust gate */
+#define PPS_MAXAGE 120 /* kernel pps signal timeout (s) */
+#define FREQTOD(x) ((x) / 65536e6) /* NTP to double */
+#define DTOFREQ(x) ((int32)((x) * 65536e6)) /* double to NTP */
+
+/*
+ * Clock discipline state machine. This is used to control the
+ * synchronization behavior during initialization and following a
+ * timewarp.
+ *
+ * State < step > step Comments
+ * ========================================================
+ * NSET FREQ step, FREQ freq not set
+ *
+ * FSET SYNC step, SYNC freq set
+ *
+ * FREQ if (mu < 900) if (mu < 900) set freq direct
+ * ignore ignore
+ * else else
+ * freq, SYNC freq, step, SYNC
+ *
+ * SYNC SYNC SPIK, ignore adjust phase/freq
+ *
+ * SPIK SYNC if (mu < 900) adjust phase/freq
+ * ignore
+ * step, SYNC
+ */
+/*
+ * Kernel PLL/PPS state machine. This is used with the kernel PLL
+ * modifications described in the documentation.
+ *
+ * If kernel support for the ntp_adjtime() system call is available, the
+ * ntp_control flag is set. The ntp_enable and kern_enable flags can be
+ * set at configuration time or run time using ntpdc. If ntp_enable is
+ * false, the discipline loop is unlocked and no corrections of any kind
+ * are made. If both ntp_control and kern_enable are set, the kernel
+ * support is used as described above; if false, the kernel is bypassed
+ * entirely and the daemon discipline used instead.
+ *
+ * There have been three versions of the kernel discipline code. The
+ * first (microkernel) now in Solaris discipilnes the microseconds. The
+ * second and third (nanokernel) disciplines the clock in nanoseconds.
+ * These versions are identifed if the symbol STA_PLL is present in the
+ * header file /usr/include/sys/timex.h. The third and current version
+ * includes TAI offset and is identified by the symbol NTP_API with
+ * value 4.
+ *
+ * Each PPS time/frequency discipline can be enabled by the atom driver
+ * or another driver. If enabled, the STA_PPSTIME and STA_FREQ bits are
+ * set in the kernel status word; otherwise, these bits are cleared.
+ * These bits are also cleard if the kernel reports an error.
+ *
+ * If an external clock is present, the clock driver sets STA_CLK in the
+ * status word. When the local clock driver sees this bit, it updates
+ * via this routine, which then calls ntp_adjtime() with the STA_PLL bit
+ * set to zero, in which case the system clock is not adjusted. This is
+ * also a signal for the external clock driver to discipline the system
+ * clock. Unless specified otherwise, all times are in seconds.
+ */
+/*
+ * Program variables that can be tinkered.
+ */
+double clock_max = CLOCK_MAX; /* step threshold */
+double clock_minstep = CLOCK_MINSTEP; /* stepout threshold */
+double clock_panic = CLOCK_PANIC; /* panic threshold */
+double clock_phi = CLOCK_PHI; /* dispersion rate (s/s) */
+u_char allan_xpt = CLOCK_ALLAN; /* Allan intercept (log2 s) */
+
+/*
+ * Program variables
+ */
+static double clock_offset; /* offset */
+double clock_jitter; /* offset jitter */
+double drift_comp; /* frequency (s/s) */
+static double init_drift_comp; /* initial frequency (PPM) */
+double clock_stability; /* frequency stability (wander) (s/s) */
+double clock_codec; /* audio codec frequency (samples/s) */
+static u_long clock_epoch; /* last update */
+u_int sys_tai; /* TAI offset from UTC */
+static int loop_started; /* TRUE after LOOP_DRIFTINIT */
+static void rstclock (int, double); /* transition function */
+static double direct_freq(double); /* direct set frequency */
+static void set_freq(double); /* set frequency */
+#ifndef PATH_MAX
+# define PATH_MAX MAX_PATH
+#endif
+static char relative_path[PATH_MAX + 1]; /* relative path per recursive make */
+static char *this_file = NULL;
+
+#ifdef KERNEL_PLL
+static struct timex ntv; /* ntp_adjtime() parameters */
+int pll_status; /* last kernel status bits */
+#if defined(STA_NANO) && NTP_API == 4
+static u_int loop_tai; /* last TAI offset */
+#endif /* STA_NANO */
+static void start_kern_loop(void);
+static void stop_kern_loop(void);
+#endif /* KERNEL_PLL */
+
+/*
+ * Clock state machine control flags
+ */
+int ntp_enable = TRUE; /* clock discipline enabled */
+int pll_control; /* kernel support available */
+int kern_enable = TRUE; /* kernel support enabled */
+int hardpps_enable; /* kernel PPS discipline enabled */
+int ext_enable; /* external clock enabled */
+int pps_stratum; /* pps stratum */
+int allow_panic = FALSE; /* allow panic correction */
+int mode_ntpdate = FALSE; /* exit on first clock set */
+int freq_cnt; /* initial frequency clamp */
+int freq_set; /* initial set frequency switch */
+
+/*
+ * Clock state machine variables
+ */
+int state = 0; /* clock discipline state */
+u_char sys_poll; /* time constant/poll (log2 s) */
+int tc_counter; /* jiggle counter */
+double last_offset; /* last offset (s) */
+
+/*
+ * Huff-n'-puff filter variables
+ */
+static double *sys_huffpuff; /* huff-n'-puff filter */
+static int sys_hufflen; /* huff-n'-puff filter stages */
+static int sys_huffptr; /* huff-n'-puff filter pointer */
+static double sys_mindly; /* huff-n'-puff filter min delay */
+
+#if defined(KERNEL_PLL)
+/* Emacs cc-mode goes nuts if we split the next line... */
+#define MOD_BITS (MOD_OFFSET | MOD_MAXERROR | MOD_ESTERROR | \
+ MOD_STATUS | MOD_TIMECONST)
+#ifdef SIGSYS
+static void pll_trap (int); /* configuration trap */
+static struct sigaction sigsys; /* current sigaction status */
+static struct sigaction newsigsys; /* new sigaction status */
+static sigjmp_buf env; /* environment var. for pll_trap() */
+#endif /* SIGSYS */
+#endif /* KERNEL_PLL */
+
+/*
+ * file_name - return pointer to non-relative portion of this C file pathname
+ */
+static char *file_name(void)
+{
+ if (this_file == NULL) {
+ (void)strncpy(relative_path, __FILE__, PATH_MAX);
+ for (this_file=relative_path; *this_file && ! isalnum(*this_file); this_file++) ;
+ }
+ return this_file;
+}
+
+/*
+ * init_loopfilter - initialize loop filter data
+ */
+void
+init_loopfilter(void)
+{
+ /*
+ * Initialize state variables.
+ */
+ sys_poll = ntp_minpoll;
+ clock_jitter = LOGTOD(sys_precision);
+ freq_cnt = (int)clock_minstep;
+}
+
+#ifdef KERNEL_PLL
+/*
+ * ntp_adjtime_error_handler - process errors from ntp_adjtime
+ */
+static void
+ntp_adjtime_error_handler(
+ const char *caller, /* name of calling function */
+ struct timex *ptimex, /* pointer to struct timex */
+ int ret, /* return value from ntp_adjtime */
+ int saved_errno, /* value of errno when ntp_adjtime returned */
+ int pps_call, /* ntp_adjtime call was PPS-related */
+ int tai_call, /* ntp_adjtime call was TAI-related */
+ int line /* line number of ntp_adjtime call */
+ )
+{
+ switch (ret) {
+ case -1:
+ switch (saved_errno) {
+ case EFAULT:
+ msyslog(LOG_ERR, "%s: %s line %d: invalid struct timex pointer: 0x%lx",
+ caller, file_name(), line,
+ (long)((void *)ptimex)
+ );
+ break;
+ case EINVAL:
+ msyslog(LOG_ERR, "%s: %s line %d: invalid struct timex \"constant\" element value: %ld",
+ caller, file_name(), line,
+ (long)(ptimex->constant)
+ );
+ break;
+ case EPERM:
+ if (tai_call) {
+ errno = saved_errno;
+ msyslog(LOG_ERR,
+ "%s: ntp_adjtime(TAI) failed: %m",
+ caller);
+ }
+ errno = saved_errno;
+ msyslog(LOG_ERR, "%s: %s line %d: ntp_adjtime: %m",
+ caller, file_name(), line
+ );
+ break;
+ default:
+ msyslog(LOG_NOTICE, "%s: %s line %d: unhandled errno value %d after failed ntp_adjtime call",
+ caller, file_name(), line,
+ saved_errno
+ );
+ break;
+ }
+ break;
+#ifdef TIME_OK
+ case TIME_OK: /* 0 no leap second warning */
+ /* OK means OK */
+ break;
+#endif
+#ifdef TIME_INS
+ case TIME_INS: /* 1 positive leap second warning */
+ msyslog(LOG_INFO, "%s: %s line %d: kernel reports positive leap second warning state",
+ caller, file_name(), line
+ );
+ break;
+#endif
+#ifdef TIME_DEL
+ case TIME_DEL: /* 2 negative leap second warning */
+ msyslog(LOG_INFO, "%s: %s line %d: kernel reports negative leap second warning state",
+ caller, file_name(), line
+ );
+ break;
+#endif
+#ifdef TIME_OOP
+ case TIME_OOP: /* 3 leap second in progress */
+ msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second in progress",
+ caller, file_name(), line
+ );
+ break;
+#endif
+#ifdef TIME_WAIT
+ case TIME_WAIT: /* 4 leap second has occured */
+ msyslog(LOG_INFO, "%s: %s line %d: kernel reports leap second has occured",
+ caller, file_name(), line
+ );
+ break;
+#endif
+#ifdef TIME_ERROR
+ case TIME_ERROR: /* loss of synchronization */
+ if (pps_call && !(ptimex->status & STA_PPSSIGNAL))
+ report_event(EVNT_KERN, NULL,
+ "PPS no signal");
+ errno = saved_errno;
+ DPRINTF(1, ("kernel loop status (%s) %d %m\n",
+ k_st_flags(ptimex->status), errno));
+ break;
+#endif
+ default:
+ msyslog(LOG_NOTICE, "%s: %s line %d: unhandled return value %d from ntp_adjtime in %s at line %d",
+ caller, file_name(), line,
+ ret,
+ __func__, __LINE__
+ );
+ break;
+ }
+ return;
+}
+#endif
+
+/*
+ * local_clock - the NTP logical clock loop filter.
+ *
+ * Return codes:
+ * -1 update ignored: exceeds panic threshold
+ * 0 update ignored: popcorn or exceeds step threshold
+ * 1 clock was slewed
+ * 2 clock was stepped
+ *
+ * LOCKCLOCK: The only thing this routine does is set the
+ * sys_rootdisp variable equal to the peer dispersion.
+ */
+int
+local_clock(
+ struct peer *peer, /* synch source peer structure */
+ double fp_offset /* clock offset (s) */
+ )
+{
+ int rval; /* return code */
+ int osys_poll; /* old system poll */
+ int ntp_adj_ret; /* returned by ntp_adjtime */
+ double mu; /* interval since last update */
+ double clock_frequency; /* clock frequency */
+ double dtemp, etemp; /* double temps */
+ char tbuf[80]; /* report buffer */
+
+ /*
+ * If the loop is opened or the NIST LOCKCLOCK is in use,
+ * monitor and record the offsets anyway in order to determine
+ * the open-loop response and then go home.
+ */
+#ifdef LOCKCLOCK
+ {
+#else
+ if (!ntp_enable) {
+#endif /* LOCKCLOCK */
+ record_loop_stats(fp_offset, drift_comp, clock_jitter,
+ clock_stability, sys_poll);
+ return (0);
+ }
+
+#ifndef LOCKCLOCK
+ /*
+ * If the clock is way off, panic is declared. The clock_panic
+ * defaults to 1000 s; if set to zero, the panic will never
+ * occur. The allow_panic defaults to FALSE, so the first panic
+ * will exit. It can be set TRUE by a command line option, in
+ * which case the clock will be set anyway and time marches on.
+ * But, allow_panic will be set FALSE when the update is less
+ * than the step threshold; so, subsequent panics will exit.
+ */
+ if (fabs(fp_offset) > clock_panic && clock_panic > 0 &&
+ !allow_panic) {
+ snprintf(tbuf, sizeof(tbuf),
+ "%+.0f s; set clock manually within %.0f s.",
+ fp_offset, clock_panic);
+ report_event(EVNT_SYSFAULT, NULL, tbuf);
+ return (-1);
+ }
+
+ /*
+ * This section simulates ntpdate. If the offset exceeds the
+ * step threshold (128 ms), step the clock to that time and
+ * exit. Otherwise, slew the clock to that time and exit. Note
+ * that the slew will persist and eventually complete beyond the
+ * life of this program. Note that while ntpdate is active, the
+ * terminal does not detach, so the termination message prints
+ * directly to the terminal.
+ */
+ if (mode_ntpdate) {
+ if (fabs(fp_offset) > clock_max && clock_max > 0) {
+ step_systime(fp_offset);
+ msyslog(LOG_NOTICE, "ntpd: time set %+.6f s",
+ fp_offset);
+ printf("ntpd: time set %+.6fs\n", fp_offset);
+ } else {
+ adj_systime(fp_offset);
+ msyslog(LOG_NOTICE, "ntpd: time slew %+.6f s",
+ fp_offset);
+ printf("ntpd: time slew %+.6fs\n", fp_offset);
+ }
+ record_loop_stats(fp_offset, drift_comp, clock_jitter,
+ clock_stability, sys_poll);
+ exit (0);
+ }
+
+ /*
+ * The huff-n'-puff filter finds the lowest delay in the recent
+ * interval. This is used to correct the offset by one-half the
+ * difference between the sample delay and minimum delay. This
+ * is most effective if the delays are highly assymetric and
+ * clockhopping is avoided and the clock frequency wander is
+ * relatively small.
+ */
+ if (sys_huffpuff != NULL) {
+ if (peer->delay < sys_huffpuff[sys_huffptr])
+ sys_huffpuff[sys_huffptr] = peer->delay;
+ if (peer->delay < sys_mindly)
+ sys_mindly = peer->delay;
+ if (fp_offset > 0)
+ dtemp = -(peer->delay - sys_mindly) / 2;
+ else
+ dtemp = (peer->delay - sys_mindly) / 2;
+ fp_offset += dtemp;
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "local_clock: size %d mindly %.6f huffpuff %.6f\n",
+ sys_hufflen, sys_mindly, dtemp);
+#endif
+ }
+
+ /*
+ * Clock state machine transition function which defines how the
+ * system reacts to large phase and frequency excursion. There
+ * are two main regimes: when the offset exceeds the step
+ * threshold (128 ms) and when it does not. Under certain
+ * conditions updates are suspended until the stepout theshold
+ * (900 s) is exceeded. See the documentation on how these
+ * thresholds interact with commands and command line options.
+ *
+ * Note the kernel is disabled if step is disabled or greater
+ * than 0.5 s or in ntpdate mode.
+ */
+ osys_poll = sys_poll;
+ if (sys_poll < peer->minpoll)
+ sys_poll = peer->minpoll;
+ if (sys_poll > peer->maxpoll)
+ sys_poll = peer->maxpoll;
+ mu = current_time - clock_epoch;
+ clock_frequency = drift_comp;
+ rval = 1;
+ if (fabs(fp_offset) > clock_max && clock_max > 0) {
+ switch (state) {
+
+ /*
+ * In SYNC state we ignore the first outlyer and switch
+ * to SPIK state.
+ */
+ case EVNT_SYNC:
+ snprintf(tbuf, sizeof(tbuf), "%+.6f s",
+ fp_offset);
+ report_event(EVNT_SPIK, NULL, tbuf);
+ state = EVNT_SPIK;
+ return (0);
+
+ /*
+ * In FREQ state we ignore outlyers and inlyers. At the
+ * first outlyer after the stepout threshold, compute
+ * the apparent frequency correction and step the phase.
+ */
+ case EVNT_FREQ:
+ if (mu < clock_minstep)
+ return (0);
+
+ clock_frequency = direct_freq(fp_offset);
+
+ /* fall through to EVNT_SPIK */
+
+ /*
+ * In SPIK state we ignore succeeding outlyers until
+ * either an inlyer is found or the stepout threshold is
+ * exceeded.
+ */
+ case EVNT_SPIK:
+ if (mu < clock_minstep)
+ return (0);
+
+ /* fall through to default */
+
+ /*
+ * We get here by default in NSET and FSET states and
+ * from above in FREQ or SPIK states.
+ *
+ * In NSET state an initial frequency correction is not
+ * available, usually because the frequency file has not
+ * yet been written. Since the time is outside the step
+ * threshold, the clock is stepped. The frequency will
+ * be set directly following the stepout interval.
+ *
+ * In FSET state the initial frequency has been set from
+ * the frequency file. Since the time is outside the
+ * step threshold, the clock is stepped immediately,
+ * rather than after the stepout interval. Guys get
+ * nervous if it takes 15 minutes to set the clock for
+ * the first time.
+ *
+ * In FREQ and SPIK states the stepout threshold has
+ * expired and the phase is still above the step
+ * threshold. Note that a single spike greater than the
+ * step threshold is always suppressed, even with a
+ * long time constant.
+ */
+ default:
+ snprintf(tbuf, sizeof(tbuf), "%+.6f s",
+ fp_offset);
+ report_event(EVNT_CLOCKRESET, NULL, tbuf);
+ step_systime(fp_offset);
+ reinit_timer();
+ tc_counter = 0;
+ clock_jitter = LOGTOD(sys_precision);
+ rval = 2;
+ if (state == EVNT_NSET) {
+ rstclock(EVNT_FREQ, 0);
+ return (rval);
+ }
+ break;
+ }
+ rstclock(EVNT_SYNC, 0);
+ } else {
+
+ /*
+ * The offset is less than the step threshold. Calculate
+ * the jitter as the exponentially weighted offset
+ * differences.
+ */
+ etemp = SQUARE(clock_jitter);
+ dtemp = SQUARE(max(fabs(fp_offset - last_offset),
+ LOGTOD(sys_precision)));
+ clock_jitter = SQRT(etemp + (dtemp - etemp) /
+ CLOCK_AVG);
+ switch (state) {
+
+ /*
+ * In NSET state this is the first update received and
+ * the frequency has not been initialized. Adjust the
+ * phase, but do not adjust the frequency until after
+ * the stepout threshold.
+ */
+ case EVNT_NSET:
+ adj_systime(fp_offset);
+ rstclock(EVNT_FREQ, fp_offset);
+ break;
+
+ /*
+ * In FREQ state ignore updates until the stepout
+ * threshold. After that, compute the new frequency, but
+ * do not adjust the frequency until the holdoff counter
+ * decrements to zero.
+ */
+ case EVNT_FREQ:
+ if (mu < clock_minstep)
+ return (0);
+
+ clock_frequency = direct_freq(fp_offset);
+ /* fall through */
+
+ /*
+ * We get here by default in FSET, SPIK and SYNC states.
+ * Here compute the frequency update due to PLL and FLL
+ * contributions. Note, we avoid frequency discipline at
+ * startup until the initial transient has subsided.
+ */
+ default:
+ allow_panic = FALSE;
+ if (freq_cnt == 0) {
+
+ /*
+ * The FLL and PLL frequency gain constants
+ * depend on the time constant and Allan
+ * intercept. The PLL is always used, but
+ * becomes ineffective above the Allan intercept
+ * where the FLL becomes effective.
+ */
+ if (sys_poll >= allan_xpt)
+ clock_frequency += (fp_offset -
+ clock_offset) / max(ULOGTOD(sys_poll),
+ mu) * CLOCK_FLL;
+
+ /*
+ * The PLL frequency gain (numerator) depends on
+ * the minimum of the update interval and Allan
+ * intercept. This reduces the PLL gain when the
+ * FLL becomes effective.
+ */
+ etemp = min(ULOGTOD(allan_xpt), mu);
+ dtemp = 4 * CLOCK_PLL * ULOGTOD(sys_poll);
+ clock_frequency += fp_offset * etemp / (dtemp *
+ dtemp);
+ }
+ rstclock(EVNT_SYNC, fp_offset);
+ if (fabs(fp_offset) < CLOCK_FLOOR)
+ freq_cnt = 0;
+ break;
+ }
+ }
+
+#ifdef KERNEL_PLL
+ /*
+ * This code segment works when clock adjustments are made using
+ * precision time kernel support and the ntp_adjtime() system
+ * call. This support is available in Solaris 2.6 and later,
+ * Digital Unix 4.0 and later, FreeBSD, Linux and specially
+ * modified kernels for HP-UX 9 and Ultrix 4. In the case of the
+ * DECstation 5000/240 and Alpha AXP, additional kernel
+ * modifications provide a true microsecond clock and nanosecond
+ * clock, respectively.
+ *
+ * Important note: The kernel discipline is used only if the
+ * step threshold is less than 0.5 s, as anything higher can
+ * lead to overflow problems. This might occur if some misguided
+ * lad set the step threshold to something ridiculous.
+ */
+ if (pll_control && kern_enable && freq_cnt == 0) {
+
+ /*
+ * We initialize the structure for the ntp_adjtime()
+ * system call. We have to convert everything to
+ * microseconds or nanoseconds first. Do not update the
+ * system variables if the ext_enable flag is set. In
+ * this case, the external clock driver will update the
+ * variables, which will be read later by the local
+ * clock driver. Afterwards, remember the time and
+ * frequency offsets for jitter and stability values and
+ * to update the frequency file.
+ */
+ ZERO(ntv);
+ if (ext_enable) {
+ ntv.modes = MOD_STATUS;
+ } else {
+#ifdef STA_NANO
+ ntv.modes = MOD_BITS | MOD_NANO;
+#else /* STA_NANO */
+ ntv.modes = MOD_BITS;
+#endif /* STA_NANO */
+ if (clock_offset < 0)
+ dtemp = -.5;
+ else
+ dtemp = .5;
+#ifdef STA_NANO
+ ntv.offset = (int32)(clock_offset * 1e9 +
+ dtemp);
+ ntv.constant = sys_poll;
+#else /* STA_NANO */
+ ntv.offset = (int32)(clock_offset * 1e6 +
+ dtemp);
+ ntv.constant = sys_poll - 4;
+#endif /* STA_NANO */
+ if (ntv.constant < 0)
+ ntv.constant = 0;
+
+ ntv.esterror = (u_int32)(clock_jitter * 1e6);
+ ntv.maxerror = (u_int32)((sys_rootdelay / 2 +
+ sys_rootdisp) * 1e6);
+ ntv.status = STA_PLL;
+
+ /*
+ * Enable/disable the PPS if requested.
+ */
+ if (hardpps_enable) {
+ if (!(pll_status & STA_PPSTIME))
+ report_event(EVNT_KERN,
+ NULL, "PPS enabled");
+ ntv.status |= STA_PPSTIME | STA_PPSFREQ;
+ } else {
+ if (pll_status & STA_PPSTIME)
+ report_event(EVNT_KERN,
+ NULL, "PPS disabled");
+ ntv.status &= ~(STA_PPSTIME |
+ STA_PPSFREQ);
+ }
+ if (sys_leap == LEAP_ADDSECOND)
+ ntv.status |= STA_INS;
+ else if (sys_leap == LEAP_DELSECOND)
+ ntv.status |= STA_DEL;
+ }
+
+ /*
+ * Pass the stuff to the kernel. If it squeals, turn off
+ * the pps. In any case, fetch the kernel offset,
+ * frequency and jitter.
+ */
+ if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
+ ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, hardpps_enable, 0, __LINE__ - 1);
+ }
+ pll_status = ntv.status;
+#ifdef STA_NANO
+ clock_offset = ntv.offset / 1e9;
+#else /* STA_NANO */
+ clock_offset = ntv.offset / 1e6;
+#endif /* STA_NANO */
+ clock_frequency = FREQTOD(ntv.freq);
+
+ /*
+ * If the kernel PPS is lit, monitor its performance.
+ */
+ if (ntv.status & STA_PPSTIME) {
+#ifdef STA_NANO
+ clock_jitter = ntv.jitter / 1e9;
+#else /* STA_NANO */
+ clock_jitter = ntv.jitter / 1e6;
+#endif /* STA_NANO */
+ }
+
+#if defined(STA_NANO) && NTP_API == 4
+ /*
+ * If the TAI changes, update the kernel TAI.
+ */
+ if (loop_tai != sys_tai) {
+ loop_tai = sys_tai;
+ ntv.modes = MOD_TAI;
+ ntv.constant = sys_tai;
+ if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
+ ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, 0, 1, __LINE__ - 1);
+ }
+ }
+#endif /* STA_NANO */
+ }
+#endif /* KERNEL_PLL */
+
+ /*
+ * Clamp the frequency within the tolerance range and calculate
+ * the frequency difference since the last update.
+ */
+ if (fabs(clock_frequency) > NTP_MAXFREQ)
+ msyslog(LOG_NOTICE,
+ "frequency error %.0f PPM exceeds tolerance %.0f PPM",
+ clock_frequency * 1e6, NTP_MAXFREQ * 1e6);
+ dtemp = SQUARE(clock_frequency - drift_comp);
+ if (clock_frequency > NTP_MAXFREQ)
+ drift_comp = NTP_MAXFREQ;
+ else if (clock_frequency < -NTP_MAXFREQ)
+ drift_comp = -NTP_MAXFREQ;
+ else
+ drift_comp = clock_frequency;
+
+ /*
+ * Calculate the wander as the exponentially weighted RMS
+ * frequency differences. Record the change for the frequency
+ * file update.
+ */
+ etemp = SQUARE(clock_stability);
+ clock_stability = SQRT(etemp + (dtemp - etemp) / CLOCK_AVG);
+
+ /*
+ * Here we adjust the time constant by comparing the current
+ * offset with the clock jitter. If the offset is less than the
+ * clock jitter times a constant, then the averaging interval is
+ * increased, otherwise it is decreased. A bit of hysteresis
+ * helps calm the dance. Works best using burst mode. Don't
+ * fiddle with the poll during the startup clamp period.
+ */
+ if (freq_cnt > 0) {
+ tc_counter = 0;
+ } else if (fabs(clock_offset) < CLOCK_PGATE * clock_jitter) {
+ tc_counter += sys_poll;
+ if (tc_counter > CLOCK_LIMIT) {
+ tc_counter = CLOCK_LIMIT;
+ if (sys_poll < peer->maxpoll) {
+ tc_counter = 0;
+ sys_poll++;
+ }
+ }
+ } else {
+ tc_counter -= sys_poll << 1;
+ if (tc_counter < -CLOCK_LIMIT) {
+ tc_counter = -CLOCK_LIMIT;
+ if (sys_poll > peer->minpoll) {
+ tc_counter = 0;
+ sys_poll--;
+ }
+ }
+ }
+
+ /*
+ * If the time constant has changed, update the poll variables.
+ */
+ if (osys_poll != sys_poll)
+ poll_update(peer, sys_poll);
+
+ /*
+ * Yibbidy, yibbbidy, yibbidy; that'h all folks.
+ */
+ record_loop_stats(clock_offset, drift_comp, clock_jitter,
+ clock_stability, sys_poll);
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "local_clock: offset %.9f jit %.9f freq %.3f stab %.3f poll %d\n",
+ clock_offset, clock_jitter, drift_comp * 1e6,
+ clock_stability * 1e6, sys_poll);
+#endif /* DEBUG */
+ return (rval);
+#endif /* LOCKCLOCK */
+}
+
+
+/*
+ * adj_host_clock - Called once every second to update the local clock.
+ *
+ * LOCKCLOCK: The only thing this routine does is increment the
+ * sys_rootdisp variable.
+ */
+void
+adj_host_clock(
+ void
+ )
+{
+ double offset_adj;
+ double freq_adj;
+
+ /*
+ * Update the dispersion since the last update. In contrast to
+ * NTPv3, NTPv4 does not declare unsynchronized after one day,
+ * since the dispersion check serves this function. Also,
+ * since the poll interval can exceed one day, the old test
+ * would be counterproductive. During the startup clamp period, the
+ * time constant is clamped at 2.
+ */
+ sys_rootdisp += clock_phi;
+#ifndef LOCKCLOCK
+ if (!ntp_enable || mode_ntpdate)
+ return;
+ /*
+ * Determine the phase adjustment. The gain factor (denominator)
+ * increases with poll interval, so is dominated by the FLL
+ * above the Allan intercept. Note the reduced time constant at
+ * startup.
+ */
+ if (state != EVNT_SYNC) {
+ offset_adj = 0.;
+ } else if (freq_cnt > 0) {
+ offset_adj = clock_offset / (CLOCK_PLL * ULOGTOD(1));
+ freq_cnt--;
+#ifdef KERNEL_PLL
+ } else if (pll_control && kern_enable) {
+ offset_adj = 0.;
+#endif /* KERNEL_PLL */
+ } else {
+ offset_adj = clock_offset / (CLOCK_PLL * ULOGTOD(sys_poll));
+ }
+
+ /*
+ * If the kernel discipline is enabled the frequency correction
+ * drift_comp has already been engaged via ntp_adjtime() in
+ * set_freq(). Otherwise it is a component of the adj_systime()
+ * offset.
+ */
+#ifdef KERNEL_PLL
+ if (pll_control && kern_enable)
+ freq_adj = 0.;
+ else
+#endif /* KERNEL_PLL */
+ freq_adj = drift_comp;
+
+ /* Bound absolute value of total adjustment to NTP_MAXFREQ. */
+ if (offset_adj + freq_adj > NTP_MAXFREQ)
+ offset_adj = NTP_MAXFREQ - freq_adj;
+ else if (offset_adj + freq_adj < -NTP_MAXFREQ)
+ offset_adj = -NTP_MAXFREQ - freq_adj;
+
+ clock_offset -= offset_adj;
+ /*
+ * Windows port adj_systime() must be called each second,
+ * even if the argument is zero, to ease emulation of
+ * adjtime() using Windows' slew API which controls the rate
+ * but does not automatically stop slewing when an offset
+ * has decayed to zero.
+ */
+ adj_systime(offset_adj + freq_adj);
+#endif /* LOCKCLOCK */
+}
+
+
+/*
+ * Clock state machine. Enter new state and set state variables.
+ */
+static void
+rstclock(
+ int trans, /* new state */
+ double offset /* new offset */
+ )
+{
+#ifdef DEBUG
+ if (debug > 1)
+ printf("local_clock: mu %lu state %d poll %d count %d\n",
+ current_time - clock_epoch, trans, sys_poll,
+ tc_counter);
+#endif
+ if (trans != state && trans != EVNT_FSET)
+ report_event(trans, NULL, NULL);
+ state = trans;
+ last_offset = clock_offset = offset;
+ clock_epoch = current_time;
+}
+
+
+/*
+ * calc_freq - calculate frequency directly
+ *
+ * This is very carefully done. When the offset is first computed at the
+ * first update, a residual frequency component results. Subsequently,
+ * updates are suppresed until the end of the measurement interval while
+ * the offset is amortized. At the end of the interval the frequency is
+ * calculated from the current offset, residual offset, length of the
+ * interval and residual frequency component. At the same time the
+ * frequenchy file is armed for update at the next hourly stats.
+ */
+static double
+direct_freq(
+ double fp_offset
+ )
+{
+ set_freq(fp_offset / (current_time - clock_epoch));
+
+ return drift_comp;
+}
+
+
+/*
+ * set_freq - set clock frequency correction
+ *
+ * Used to step the frequency correction at startup, possibly again once
+ * the frequency is measured (that is, transitioning from EVNT_NSET to
+ * EVNT_FSET), and finally to switch between daemon and kernel loop
+ * discipline at runtime.
+ *
+ * When the kernel loop discipline is available but the daemon loop is
+ * in use, the kernel frequency correction is disabled (set to 0) to
+ * ensure drift_comp is applied by only one of the loops.
+ */
+static void
+set_freq(
+ double freq /* frequency update */
+ )
+{
+ const char * loop_desc;
+ int ntp_adj_ret;
+
+ drift_comp = freq;
+ loop_desc = "ntpd";
+#ifdef KERNEL_PLL
+ if (pll_control) {
+ ZERO(ntv);
+ ntv.modes = MOD_FREQUENCY;
+ if (kern_enable) {
+ loop_desc = "kernel";
+ ntv.freq = DTOFREQ(drift_comp);
+ }
+ if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
+ ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, 0, 0, __LINE__ - 1);
+ }
+ }
+#endif /* KERNEL_PLL */
+ mprintf_event(EVNT_FSET, NULL, "%s %.3f PPM", loop_desc,
+ drift_comp * 1e6);
+}
+
+
+#ifdef KERNEL_PLL
+static void
+start_kern_loop(void)
+{
+ static int atexit_done;
+ int ntp_adj_ret;
+
+ pll_control = TRUE;
+ ZERO(ntv);
+ ntv.modes = MOD_BITS;
+ ntv.status = STA_PLL;
+ ntv.maxerror = MAXDISPERSE;
+ ntv.esterror = MAXDISPERSE;
+ ntv.constant = sys_poll; /* why is it that here constant is unconditionally set to sys_poll, whereas elsewhere is is modified depending on nanosecond vs. microsecond kernel? */
+#ifdef SIGSYS
+ /*
+ * Use sigsetjmp() to save state and then call ntp_adjtime(); if
+ * it fails, then pll_trap() will set pll_control FALSE before
+ * returning control using siglogjmp().
+ */
+ newsigsys.sa_handler = pll_trap;
+ newsigsys.sa_flags = 0;
+ if (sigaction(SIGSYS, &newsigsys, &sigsys)) {
+ msyslog(LOG_ERR, "sigaction() trap SIGSYS: %m");
+ pll_control = FALSE;
+ } else {
+ if (sigsetjmp(env, 1) == 0) {
+ if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
+ ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, 0, 0, __LINE__ - 1);
+ }
+ }
+ if (sigaction(SIGSYS, &sigsys, NULL)) {
+ msyslog(LOG_ERR,
+ "sigaction() restore SIGSYS: %m");
+ pll_control = FALSE;
+ }
+ }
+#else /* SIGSYS */
+ if ((ntp_adj_ret = ntp_adjtime(&ntv)) != 0) {
+ ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, 0, 0, __LINE__ - 1);
+ }
+#endif /* SIGSYS */
+
+ /*
+ * Save the result status and light up an external clock
+ * if available.
+ */
+ pll_status = ntv.status;
+ if (pll_control) {
+ if (!atexit_done) {
+ atexit_done = TRUE;
+ atexit(&stop_kern_loop);
+ }
+#ifdef STA_NANO
+ if (pll_status & STA_CLK)
+ ext_enable = TRUE;
+#endif /* STA_NANO */
+ report_event(EVNT_KERN, NULL,
+ "kernel time sync enabled");
+ }
+}
+#endif /* KERNEL_PLL */
+
+
+#ifdef KERNEL_PLL
+static void
+stop_kern_loop(void)
+{
+ if (pll_control && kern_enable)
+ report_event(EVNT_KERN, NULL,
+ "kernel time sync disabled");
+}
+#endif /* KERNEL_PLL */
+
+
+/*
+ * select_loop() - choose kernel or daemon loop discipline.
+ */
+void
+select_loop(
+ int use_kern_loop
+ )
+{
+ if (kern_enable == use_kern_loop)
+ return;
+#ifdef KERNEL_PLL
+ if (pll_control && !use_kern_loop)
+ stop_kern_loop();
+#endif
+ kern_enable = use_kern_loop;
+#ifdef KERNEL_PLL
+ if (pll_control && use_kern_loop)
+ start_kern_loop();
+#endif
+ /*
+ * If this loop selection change occurs after initial startup,
+ * call set_freq() to switch the frequency compensation to or
+ * from the kernel loop.
+ */
+#ifdef KERNEL_PLL
+ if (pll_control && loop_started)
+ set_freq(drift_comp);
+#endif
+}
+
+
+/*
+ * huff-n'-puff filter
+ */
+void
+huffpuff(void)
+{
+ int i;
+
+ if (sys_huffpuff == NULL)
+ return;
+
+ sys_huffptr = (sys_huffptr + 1) % sys_hufflen;
+ sys_huffpuff[sys_huffptr] = 1e9;
+ sys_mindly = 1e9;
+ for (i = 0; i < sys_hufflen; i++) {
+ if (sys_huffpuff[i] < sys_mindly)
+ sys_mindly = sys_huffpuff[i];
+ }
+}
+
+
+/*
+ * loop_config - configure the loop filter
+ *
+ * LOCKCLOCK: The LOOP_DRIFTINIT and LOOP_DRIFTCOMP cases are no-ops.
+ */
+void
+loop_config(
+ int item,
+ double freq
+ )
+{
+ int i;
+ double ftemp;
+
+#ifdef DEBUG
+ if (debug > 1)
+ printf("loop_config: item %d freq %f\n", item, freq);
+#endif
+ switch (item) {
+
+ /*
+ * We first assume the kernel supports the ntp_adjtime()
+ * syscall. If that syscall works, initialize the kernel time
+ * variables. Otherwise, continue leaving no harm behind.
+ */
+ case LOOP_DRIFTINIT:
+#ifndef LOCKCLOCK
+#ifdef KERNEL_PLL
+ if (mode_ntpdate)
+ break;
+
+ start_kern_loop();
+#endif /* KERNEL_PLL */
+
+ /*
+ * Initialize frequency if given; otherwise, begin frequency
+ * calibration phase.
+ */
+ ftemp = init_drift_comp / 1e6;
+ if (ftemp > NTP_MAXFREQ)
+ ftemp = NTP_MAXFREQ;
+ else if (ftemp < -NTP_MAXFREQ)
+ ftemp = -NTP_MAXFREQ;
+ set_freq(ftemp);
+ if (freq_set)
+ rstclock(EVNT_FSET, 0);
+ else
+ rstclock(EVNT_NSET, 0);
+ loop_started = TRUE;
+#endif /* LOCKCLOCK */
+ break;
+
+ case LOOP_KERN_CLEAR:
+ break;
+
+ /*
+ * Tinker command variables for Ulrich Windl. Very dangerous.
+ */
+ case LOOP_ALLAN: /* Allan intercept (log2) (allan) */
+ allan_xpt = (u_char)freq;
+ break;
+
+ case LOOP_CODEC: /* audio codec frequency (codec) */
+ clock_codec = freq / 1e6;
+ break;
+
+ case LOOP_PHI: /* dispersion threshold (dispersion) */
+ clock_phi = freq / 1e6;
+ break;
+
+ case LOOP_FREQ: /* initial frequency (freq) */
+ init_drift_comp = freq;
+ freq_set++;
+ break;
+
+ case LOOP_HUFFPUFF: /* huff-n'-puff length (huffpuff) */
+ if (freq < HUFFPUFF)
+ freq = HUFFPUFF;
+ sys_hufflen = (int)(freq / HUFFPUFF);
+ sys_huffpuff = emalloc(sizeof(sys_huffpuff[0]) *
+ sys_hufflen);
+ for (i = 0; i < sys_hufflen; i++)
+ sys_huffpuff[i] = 1e9;
+ sys_mindly = 1e9;
+ break;
+
+ case LOOP_PANIC: /* panic threshold (panic) */
+ clock_panic = freq;
+ break;
+
+ case LOOP_MAX: /* step threshold (step) */
+ clock_max = freq;
+ if (clock_max == 0 || clock_max > 0.5)
+ select_loop(FALSE);
+ break;
+
+ case LOOP_MINSTEP: /* stepout threshold (stepout) */
+ if (freq < CLOCK_MINSTEP)
+ clock_minstep = CLOCK_MINSTEP;
+ else
+ clock_minstep = freq;
+ break;
+
+ case LOOP_TICK: /* tick increment (tick) */
+ set_sys_tick_precision(freq);
+ break;
+
+ case LOOP_LEAP: /* not used, fall through */
+ default:
+ msyslog(LOG_NOTICE,
+ "loop_config: unsupported option %d", item);
+ }
+}
+
+
+#if defined(KERNEL_PLL) && defined(SIGSYS)
+/*
+ * _trap - trap processor for undefined syscalls
+ *
+ * This nugget is called by the kernel when the SYS_ntp_adjtime()
+ * syscall bombs because the silly thing has not been implemented in
+ * the kernel. In this case the phase-lock loop is emulated by
+ * the stock adjtime() syscall and a lot of indelicate abuse.
+ */
+static RETSIGTYPE
+pll_trap(
+ int arg
+ )
+{
+ pll_control = FALSE;
+ siglongjmp(env, 1);
+}
+#endif /* KERNEL_PLL && SIGSYS */
diff --git a/ntpd/ntp_monitor.c b/ntpd/ntp_monitor.c
new file mode 100644
index 0000000..1214e1d
--- /dev/null
+++ b/ntpd/ntp_monitor.c
@@ -0,0 +1,496 @@
+/*
+ * ntp_monitor - monitor ntpd statistics
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_if.h"
+#include "ntp_lists.h"
+#include "ntp_stdlib.h"
+#include <ntp_random.h>
+
+#include <stdio.h>
+#include <signal.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
+/*
+ * Record statistics based on source address, mode and version. The
+ * receive procedure calls us with the incoming rbufp before it does
+ * anything else. While at it, implement rate controls for inbound
+ * traffic.
+ *
+ * Each entry is doubly linked into two lists, a hash table and a most-
+ * recently-used (MRU) list. When a packet arrives it is looked up in
+ * the hash table. If found, the statistics are updated and the entry
+ * relinked at the head of the MRU list. If not found, a new entry is
+ * allocated, initialized and linked into both the hash table and at the
+ * head of the MRU list.
+ *
+ * Memory is usually allocated by grabbing a big chunk of new memory and
+ * cutting it up into littler pieces. The exception to this when we hit
+ * the memory limit. Then we free memory by grabbing entries off the
+ * tail for the MRU list, unlinking from the hash table, and
+ * reinitializing.
+ *
+ * INC_MONLIST is the default allocation granularity in entries.
+ * INIT_MONLIST is the default initial allocation in entries.
+ */
+#ifdef MONMEMINC /* old name */
+# define INC_MONLIST MONMEMINC
+#elif !defined(INC_MONLIST)
+# define INC_MONLIST (4 * 1024 / sizeof(mon_entry))
+#endif
+#ifndef INIT_MONLIST
+# define INIT_MONLIST (4 * 1024 / sizeof(mon_entry))
+#endif
+#ifndef MRU_MAXDEPTH_DEF
+# define MRU_MAXDEPTH_DEF (1024 * 1024 / sizeof(mon_entry))
+#endif
+
+/*
+ * Hashing stuff
+ */
+u_char mon_hash_bits;
+
+/*
+ * Pointers to the hash table and the MRU list. Memory for the hash
+ * table is allocated only if monitoring is enabled.
+ */
+mon_entry ** mon_hash; /* MRU hash table */
+mon_entry mon_mru_list; /* mru listhead */
+
+/*
+ * List of free structures structures, and counters of in-use and total
+ * structures. The free structures are linked with the hash_next field.
+ */
+static mon_entry *mon_free; /* free list or null if none */
+ u_int mru_alloc; /* mru list + free list count */
+ u_int mru_entries; /* mru list count */
+ u_int mru_peakentries; /* highest mru_entries seen */
+ u_int mru_initalloc = INIT_MONLIST;/* entries to preallocate */
+ u_int mru_incalloc = INC_MONLIST;/* allocation batch factor */
+static u_int mon_mem_increments; /* times called malloc() */
+
+/*
+ * Parameters of the RES_LIMITED restriction option. We define headway
+ * as the idle time between packets. A packet is discarded if the
+ * headway is less than the minimum, as well as if the average headway
+ * is less than eight times the increment.
+ */
+int ntp_minpkt = NTP_MINPKT; /* minimum (log 2 s) */
+u_char ntp_minpoll = NTP_MINPOLL; /* increment (log 2 s) */
+
+/*
+ * Initialization state. We may be monitoring, we may not. If
+ * we aren't, we may not even have allocated any memory yet.
+ */
+ u_int mon_enabled; /* enable switch */
+ u_int mru_mindepth = 600; /* preempt above this */
+ int mru_maxage = 64; /* for entries older than */
+ u_int mru_maxdepth = /* MRU count hard limit */
+ MRU_MAXDEPTH_DEF;
+ int mon_age = 3000; /* preemption limit */
+
+static void mon_getmoremem(void);
+static void remove_from_hash(mon_entry *);
+static inline void mon_free_entry(mon_entry *);
+static inline void mon_reclaim_entry(mon_entry *);
+
+
+/*
+ * init_mon - initialize monitoring global data
+ */
+void
+init_mon(void)
+{
+ /*
+ * Don't do much of anything here. We don't allocate memory
+ * until mon_start().
+ */
+ mon_enabled = MON_OFF;
+ INIT_DLIST(mon_mru_list, mru);
+}
+
+
+/*
+ * remove_from_hash - removes an entry from the address hash table and
+ * decrements mru_entries.
+ */
+static void
+remove_from_hash(
+ mon_entry *mon
+ )
+{
+ u_int hash;
+ mon_entry *punlinked;
+
+ mru_entries--;
+ hash = MON_HASH(&mon->rmtadr);
+ UNLINK_SLIST(punlinked, mon_hash[hash], mon, hash_next,
+ mon_entry);
+ NTP_ENSURE(punlinked == mon);
+}
+
+
+static inline void
+mon_free_entry(
+ mon_entry *m
+ )
+{
+ ZERO(*m);
+ LINK_SLIST(mon_free, m, hash_next);
+}
+
+
+/*
+ * mon_reclaim_entry - Remove an entry from the MRU list and from the
+ * hash array, then zero-initialize it. Indirectly
+ * decrements mru_entries.
+
+ * The entry is prepared to be reused. Before return, in
+ * remove_from_hash(), mru_entries is decremented. It is the caller's
+ * responsibility to increment it again.
+ */
+static inline void
+mon_reclaim_entry(
+ mon_entry *m
+ )
+{
+ DEBUG_INSIST(NULL != m);
+
+ UNLINK_DLIST(m, mru);
+ remove_from_hash(m);
+ ZERO(*m);
+}
+
+
+/*
+ * mon_getmoremem - get more memory and put it on the free list
+ */
+static void
+mon_getmoremem(void)
+{
+ mon_entry *chunk;
+ u_int entries;
+
+ entries = (0 == mon_mem_increments)
+ ? mru_initalloc
+ : mru_incalloc;
+
+ if (entries) {
+ chunk = emalloc(entries * sizeof(*chunk));
+ mru_alloc += entries;
+ for (chunk += entries; entries; entries--)
+ mon_free_entry(--chunk);
+
+ mon_mem_increments++;
+ }
+}
+
+
+/*
+ * mon_start - start up the monitoring software
+ */
+void
+mon_start(
+ int mode
+ )
+{
+ size_t octets;
+ u_int min_hash_slots;
+
+ if (MON_OFF == mode) /* MON_OFF is 0 */
+ return;
+ if (mon_enabled) {
+ mon_enabled |= mode;
+ return;
+ }
+ if (0 == mon_mem_increments)
+ mon_getmoremem();
+ /*
+ * Select the MRU hash table size to limit the average count
+ * per bucket at capacity (mru_maxdepth) to 8, if possible
+ * given our hash is limited to 16 bits.
+ */
+ min_hash_slots = (mru_maxdepth / 8) + 1;
+ mon_hash_bits = 0;
+ while (min_hash_slots >>= 1)
+ mon_hash_bits++;
+ mon_hash_bits = max(4, mon_hash_bits);
+ mon_hash_bits = min(16, mon_hash_bits);
+ octets = sizeof(*mon_hash) * MON_HASH_SIZE;
+ mon_hash = erealloc_zero(mon_hash, octets, 0);
+
+ mon_enabled = mode;
+}
+
+
+/*
+ * mon_stop - stop the monitoring software
+ */
+void
+mon_stop(
+ int mode
+ )
+{
+ mon_entry *mon;
+
+ if (MON_OFF == mon_enabled)
+ return;
+ if ((mon_enabled & mode) == 0 || mode == MON_OFF)
+ return;
+
+ mon_enabled &= ~mode;
+ if (mon_enabled != MON_OFF)
+ return;
+
+ /*
+ * Move everything on the MRU list to the free list quickly,
+ * without bothering to remove each from either the MRU list or
+ * the hash table.
+ */
+ ITER_DLIST_BEGIN(mon_mru_list, mon, mru, mon_entry)
+ mon_free_entry(mon);
+ ITER_DLIST_END()
+
+ /* empty the MRU list and hash table. */
+ mru_entries = 0;
+ INIT_DLIST(mon_mru_list, mru);
+ zero_mem(mon_hash, sizeof(*mon_hash) * MON_HASH_SIZE);
+}
+
+
+/*
+ * mon_clearinterface -- remove mru entries referring to a local address
+ * which is going away.
+ */
+void
+mon_clearinterface(
+ endpt *lcladr
+ )
+{
+ mon_entry *mon;
+
+ /* iterate mon over mon_mru_list */
+ ITER_DLIST_BEGIN(mon_mru_list, mon, mru, mon_entry)
+ if (mon->lcladr == lcladr) {
+ /* remove from mru list */
+ UNLINK_DLIST(mon, mru);
+ /* remove from hash list, adjust mru_entries */
+ remove_from_hash(mon);
+ /* put on free list */
+ mon_free_entry(mon);
+ }
+ ITER_DLIST_END()
+}
+
+
+/*
+ * ntp_monitor - record stats about this packet
+ *
+ * Returns supplied restriction flags, with RES_LIMITED and RES_KOD
+ * cleared unless the packet should not be responded to normally
+ * (RES_LIMITED) and possibly should trigger a KoD response (RES_KOD).
+ * The returned flags are saved in the MRU entry, so that it reflects
+ * whether the last packet from that source triggered rate limiting,
+ * and if so, possible KoD response. This implies you can not tell
+ * whether a given address is eligible for rate limiting/KoD from the
+ * monlist restrict bits, only whether or not the last packet triggered
+ * such responses. ntpdc -c reslist lets you see whether RES_LIMITED
+ * or RES_KOD is lit for a particular address before ntp_monitor()'s
+ * typical dousing.
+ */
+u_short
+ntp_monitor(
+ struct recvbuf *rbufp,
+ u_short flags
+ )
+{
+ l_fp interval_fp;
+ struct pkt * pkt;
+ mon_entry * mon;
+ mon_entry * oldest;
+ int oldest_age;
+ u_int hash;
+ u_short restrict_mask;
+ u_char mode;
+ u_char version;
+ int interval;
+ int head; /* headway increment */
+ int leak; /* new headway */
+ int limit; /* average threshold */
+
+ if (mon_enabled == MON_OFF)
+ return ~(RES_LIMITED | RES_KOD) & flags;
+
+ pkt = &rbufp->recv_pkt;
+ hash = MON_HASH(&rbufp->recv_srcadr);
+ mode = PKT_MODE(pkt->li_vn_mode);
+ version = PKT_VERSION(pkt->li_vn_mode);
+ mon = mon_hash[hash];
+
+ /*
+ * We keep track of all traffic for a given IP in one entry,
+ * otherwise cron'ed ntpdate or similar evades RES_LIMITED.
+ */
+
+ for (; mon != NULL; mon = mon->hash_next)
+ if (SOCK_EQ(&mon->rmtadr, &rbufp->recv_srcadr))
+ break;
+
+ if (mon != NULL) {
+ interval_fp = rbufp->recv_time;
+ L_SUB(&interval_fp, &mon->last);
+ /* add one-half second to round up */
+ L_ADDUF(&interval_fp, 0x80000000);
+ interval = interval_fp.l_i;
+ mon->last = rbufp->recv_time;
+ NSRCPORT(&mon->rmtadr) = NSRCPORT(&rbufp->recv_srcadr);
+ mon->count++;
+ restrict_mask = flags;
+ mon->vn_mode = VN_MODE(version, mode);
+
+ /* Shuffle to the head of the MRU list. */
+ UNLINK_DLIST(mon, mru);
+ LINK_DLIST(mon_mru_list, mon, mru);
+
+ /*
+ * At this point the most recent arrival is first in the
+ * MRU list. Decrease the counter by the headway, but
+ * not less than zero.
+ */
+ mon->leak -= interval;
+ mon->leak = max(0, mon->leak);
+ head = 1 << ntp_minpoll;
+ leak = mon->leak + head;
+ limit = NTP_SHIFT * head;
+
+ DPRINTF(2, ("MRU: interval %d headway %d limit %d\n",
+ interval, leak, limit));
+
+ /*
+ * If the minimum and average thresholds are not
+ * exceeded, douse the RES_LIMITED and RES_KOD bits and
+ * increase the counter by the headway increment. Note
+ * that we give a 1-s grace for the minimum threshold
+ * and a 2-s grace for the headway increment. If one or
+ * both thresholds are exceeded and the old counter is
+ * less than the average threshold, set the counter to
+ * the average threshold plus the increment and leave
+ * the RES_LIMITED and RES_KOD bits lit. Otherwise,
+ * leave the counter alone and douse the RES_KOD bit.
+ * This rate-limits the KoDs to no less than the average
+ * headway.
+ */
+ if (interval + 1 >= ntp_minpkt && leak < limit) {
+ mon->leak = leak - 2;
+ restrict_mask &= ~(RES_LIMITED | RES_KOD);
+ } else if (mon->leak < limit)
+ mon->leak = limit + head;
+ else
+ restrict_mask &= ~RES_KOD;
+
+ mon->flags = restrict_mask;
+
+ return mon->flags;
+ }
+
+ /*
+ * If we got here, this is the first we've heard of this
+ * guy. Get him some memory, either from the free list
+ * or from the tail of the MRU list.
+ *
+ * The following ntp.conf "mru" knobs come into play determining
+ * the depth (or count) of the MRU list:
+ * - mru_mindepth ("mru mindepth") is a floor beneath which
+ * entries are kept without regard to their age. The
+ * default is 600 which matches the longtime implementation
+ * limit on the total number of entries.
+ * - mru_maxage ("mru maxage") is a ceiling on the age in
+ * seconds of entries. Entries older than this are
+ * reclaimed once mon_mindepth is exceeded. 64s default.
+ * Note that entries older than this can easily survive
+ * as they are reclaimed only as needed.
+ * - mru_maxdepth ("mru maxdepth") is a hard limit on the
+ * number of entries.
+ * - "mru maxmem" sets mru_maxdepth to the number of entries
+ * which fit in the given number of kilobytes. The default is
+ * 1024, or 1 megabyte.
+ * - mru_initalloc ("mru initalloc" sets the count of the
+ * initial allocation of MRU entries.
+ * - "mru initmem" sets mru_initalloc in units of kilobytes.
+ * The default is 4.
+ * - mru_incalloc ("mru incalloc" sets the number of entries to
+ * allocate on-demand each time the free list is empty.
+ * - "mru incmem" sets mru_incalloc in units of kilobytes.
+ * The default is 4.
+ * Whichever of "mru maxmem" or "mru maxdepth" occurs last in
+ * ntp.conf controls. Similarly for "mru initalloc" and "mru
+ * initmem", and for "mru incalloc" and "mru incmem".
+ */
+ if (mru_entries < mru_mindepth) {
+ if (NULL == mon_free)
+ mon_getmoremem();
+ UNLINK_HEAD_SLIST(mon, mon_free, hash_next);
+ } else {
+ oldest = TAIL_DLIST(mon_mru_list, mru);
+ oldest_age = 0; /* silence uninit warning */
+ if (oldest != NULL) {
+ interval_fp = rbufp->recv_time;
+ L_SUB(&interval_fp, &oldest->last);
+ /* add one-half second to round up */
+ L_ADDUF(&interval_fp, 0x80000000);
+ oldest_age = interval_fp.l_i;
+ }
+ /* note -1 is legal for mru_maxage (disables) */
+ if (oldest != NULL && mru_maxage < oldest_age) {
+ mon_reclaim_entry(oldest);
+ mon = oldest;
+ } else if (mon_free != NULL || mru_alloc <
+ mru_maxdepth) {
+ if (NULL == mon_free)
+ mon_getmoremem();
+ UNLINK_HEAD_SLIST(mon, mon_free, hash_next);
+ /* Preempt from the MRU list if old enough. */
+ } else if (ntp_random() / (2. * FRAC) >
+ (double)oldest_age / mon_age) {
+ return ~(RES_LIMITED | RES_KOD) & flags;
+ } else {
+ mon_reclaim_entry(oldest);
+ mon = oldest;
+ }
+ }
+
+ /*
+ * Got one, initialize it
+ */
+ mru_entries++;
+ mru_peakentries = max(mru_peakentries, mru_entries);
+ mon->last = rbufp->recv_time;
+ mon->first = mon->last;
+ mon->count = 1;
+ mon->flags = ~(RES_LIMITED | RES_KOD) & flags;
+ mon->leak = 0;
+ memcpy(&mon->rmtadr, &rbufp->recv_srcadr, sizeof(mon->rmtadr));
+ mon->vn_mode = VN_MODE(version, mode);
+ mon->lcladr = rbufp->dstadr;
+ mon->cast_flags = (u_char)(((rbufp->dstadr->flags &
+ INT_MCASTOPEN) && rbufp->fd == mon->lcladr->fd) ? MDF_MCAST
+ : rbufp->fd == mon->lcladr->bfd ? MDF_BCAST : MDF_UCAST);
+
+ /*
+ * Drop him into front of the hash table. Also put him on top of
+ * the MRU list.
+ */
+ LINK_SLIST(mon_hash[hash], mon, hash_next);
+ LINK_DLIST(mon_mru_list, mon, mru);
+
+ return mon->flags;
+}
+
+
diff --git a/ntpd/ntp_parser.c b/ntpd/ntp_parser.c
new file mode 100644
index 0000000..b3f4e4f
--- /dev/null
+++ b/ntpd/ntp_parser.c
@@ -0,0 +1,3612 @@
+/* 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.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Bison version. */
+#define YYBISON_VERSION "3.0.2"
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 0
+
+/* Push parsers. */
+#define YYPUSH 0
+
+/* Pull parsers. */
+#define YYPULL 1
+
+
+
+
+/* Copy the first part of user declarations. */
+#line 14 "ntp_parser.y" /* yacc.c:339 */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+ #include "ntp.h"
+ #include "ntpd.h"
+ #include "ntp_machine.h"
+ #include "ntp_stdlib.h"
+ #include "ntp_filegen.h"
+ #include "ntp_scanner.h"
+ #include "ntp_config.h"
+ #include "ntp_crypto.h"
+
+ #include "ntpsim.h" /* HMS: Do we really want this all the time? */
+ /* SK: It might be a good idea to always
+ include the simulator code. That way
+ someone can use the same configuration file
+ for both the simulator and the daemon
+ */
+
+ #define YYMALLOC emalloc
+ #define YYFREE free
+ #define YYERROR_VERBOSE
+ #define YYMAXDEPTH 1000 /* stop the madness sooner */
+ void yyerror(struct FILE_INFO *ip_file, const char *msg);
+
+ #ifdef SIM
+ # define ONLY_SIM(a) (a)
+ #else
+ # define ONLY_SIM(a) NULL
+ #endif
+
+#line 100 "../../ntpd/ntp_parser.c" /* yacc.c:339 */
+
+# ifndef YY_NULLPTR
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* In a future release of Bison, this section will be replaced
+ by #include "y.tab.h". */
+#ifndef YY_YY_Y_TAB_H_INCLUDED
+# define YY_YY_Y_TAB_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ 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_Ellipsis = 290,
+ T_Enable = 291,
+ T_End = 292,
+ T_False = 293,
+ T_File = 294,
+ T_Filegen = 295,
+ T_Filenum = 296,
+ T_Flag1 = 297,
+ T_Flag2 = 298,
+ T_Flag3 = 299,
+ T_Flag4 = 300,
+ T_Flake = 301,
+ T_Floor = 302,
+ T_Freq = 303,
+ T_Fudge = 304,
+ T_Host = 305,
+ T_Huffpuff = 306,
+ T_Iburst = 307,
+ T_Ident = 308,
+ T_Ignore = 309,
+ T_Incalloc = 310,
+ T_Incmem = 311,
+ T_Initalloc = 312,
+ T_Initmem = 313,
+ T_Includefile = 314,
+ T_Integer = 315,
+ T_Interface = 316,
+ T_Intrange = 317,
+ T_Io = 318,
+ T_Ipv4 = 319,
+ T_Ipv4_flag = 320,
+ T_Ipv6 = 321,
+ T_Ipv6_flag = 322,
+ T_Kernel = 323,
+ T_Key = 324,
+ T_Keys = 325,
+ T_Keysdir = 326,
+ T_Kod = 327,
+ T_Mssntp = 328,
+ T_Leapfile = 329,
+ T_Limited = 330,
+ T_Link = 331,
+ T_Listen = 332,
+ T_Logconfig = 333,
+ T_Logfile = 334,
+ T_Loopstats = 335,
+ T_Lowpriotrap = 336,
+ T_Manycastclient = 337,
+ T_Manycastserver = 338,
+ T_Mask = 339,
+ T_Maxage = 340,
+ T_Maxclock = 341,
+ T_Maxdepth = 342,
+ T_Maxdist = 343,
+ T_Maxmem = 344,
+ T_Maxpoll = 345,
+ T_Mem = 346,
+ T_Memlock = 347,
+ T_Minclock = 348,
+ T_Mindepth = 349,
+ T_Mindist = 350,
+ T_Minimum = 351,
+ T_Minpoll = 352,
+ T_Minsane = 353,
+ T_Mode = 354,
+ T_Mode7 = 355,
+ T_Monitor = 356,
+ T_Month = 357,
+ T_Mru = 358,
+ T_Multicastclient = 359,
+ T_Nic = 360,
+ T_Nolink = 361,
+ T_Nomodify = 362,
+ T_Nomrulist = 363,
+ T_None = 364,
+ T_Nonvolatile = 365,
+ T_Nopeer = 366,
+ T_Noquery = 367,
+ T_Noselect = 368,
+ T_Noserve = 369,
+ T_Notrap = 370,
+ T_Notrust = 371,
+ T_Ntp = 372,
+ T_Ntpport = 373,
+ T_NtpSignDsocket = 374,
+ T_Orphan = 375,
+ T_Orphanwait = 376,
+ T_Panic = 377,
+ T_Peer = 378,
+ T_Peerstats = 379,
+ T_Phone = 380,
+ T_Pid = 381,
+ T_Pidfile = 382,
+ T_Pool = 383,
+ T_Port = 384,
+ T_Preempt = 385,
+ T_Prefer = 386,
+ T_Protostats = 387,
+ T_Pw = 388,
+ T_Randfile = 389,
+ T_Rawstats = 390,
+ T_Refid = 391,
+ T_Requestkey = 392,
+ T_Reset = 393,
+ T_Restrict = 394,
+ T_Revoke = 395,
+ T_Rlimit = 396,
+ T_Saveconfigdir = 397,
+ T_Server = 398,
+ T_Setvar = 399,
+ T_Source = 400,
+ T_Stacksize = 401,
+ T_Statistics = 402,
+ T_Stats = 403,
+ T_Statsdir = 404,
+ T_Step = 405,
+ T_Stepout = 406,
+ T_Stratum = 407,
+ T_String = 408,
+ T_Sys = 409,
+ T_Sysstats = 410,
+ T_Tick = 411,
+ T_Time1 = 412,
+ T_Time2 = 413,
+ T_Timer = 414,
+ T_Timingstats = 415,
+ T_Tinker = 416,
+ T_Tos = 417,
+ T_Trap = 418,
+ T_True = 419,
+ T_Trustedkey = 420,
+ T_Ttl = 421,
+ T_Type = 422,
+ T_U_int = 423,
+ T_Unconfig = 424,
+ T_Unpeer = 425,
+ T_Version = 426,
+ T_WanderThreshold = 427,
+ T_Week = 428,
+ T_Wildcard = 429,
+ T_Xleave = 430,
+ T_Year = 431,
+ T_Flag = 432,
+ T_EOC = 433,
+ T_Simulate = 434,
+ T_Beep_Delay = 435,
+ T_Sim_Duration = 436,
+ T_Server_Offset = 437,
+ T_Duration = 438,
+ T_Freq_Offset = 439,
+ T_Wander = 440,
+ T_Jitter = 441,
+ T_Prop_Delay = 442,
+ T_Proc_Delay = 443
+ };
+#endif
+/* Tokens. */
+#define T_Abbrev 258
+#define T_Age 259
+#define T_All 260
+#define T_Allan 261
+#define T_Allpeers 262
+#define T_Auth 263
+#define T_Autokey 264
+#define T_Automax 265
+#define T_Average 266
+#define T_Bclient 267
+#define T_Beacon 268
+#define T_Broadcast 269
+#define T_Broadcastclient 270
+#define T_Broadcastdelay 271
+#define T_Burst 272
+#define T_Calibrate 273
+#define T_Ceiling 274
+#define T_Clockstats 275
+#define T_Cohort 276
+#define T_ControlKey 277
+#define T_Crypto 278
+#define T_Cryptostats 279
+#define T_Ctl 280
+#define T_Day 281
+#define T_Default 282
+#define T_Digest 283
+#define T_Disable 284
+#define T_Discard 285
+#define T_Dispersion 286
+#define T_Double 287
+#define T_Driftfile 288
+#define T_Drop 289
+#define T_Ellipsis 290
+#define T_Enable 291
+#define T_End 292
+#define T_False 293
+#define T_File 294
+#define T_Filegen 295
+#define T_Filenum 296
+#define T_Flag1 297
+#define T_Flag2 298
+#define T_Flag3 299
+#define T_Flag4 300
+#define T_Flake 301
+#define T_Floor 302
+#define T_Freq 303
+#define T_Fudge 304
+#define T_Host 305
+#define T_Huffpuff 306
+#define T_Iburst 307
+#define T_Ident 308
+#define T_Ignore 309
+#define T_Incalloc 310
+#define T_Incmem 311
+#define T_Initalloc 312
+#define T_Initmem 313
+#define T_Includefile 314
+#define T_Integer 315
+#define T_Interface 316
+#define T_Intrange 317
+#define T_Io 318
+#define T_Ipv4 319
+#define T_Ipv4_flag 320
+#define T_Ipv6 321
+#define T_Ipv6_flag 322
+#define T_Kernel 323
+#define T_Key 324
+#define T_Keys 325
+#define T_Keysdir 326
+#define T_Kod 327
+#define T_Mssntp 328
+#define T_Leapfile 329
+#define T_Limited 330
+#define T_Link 331
+#define T_Listen 332
+#define T_Logconfig 333
+#define T_Logfile 334
+#define T_Loopstats 335
+#define T_Lowpriotrap 336
+#define T_Manycastclient 337
+#define T_Manycastserver 338
+#define T_Mask 339
+#define T_Maxage 340
+#define T_Maxclock 341
+#define T_Maxdepth 342
+#define T_Maxdist 343
+#define T_Maxmem 344
+#define T_Maxpoll 345
+#define T_Mem 346
+#define T_Memlock 347
+#define T_Minclock 348
+#define T_Mindepth 349
+#define T_Mindist 350
+#define T_Minimum 351
+#define T_Minpoll 352
+#define T_Minsane 353
+#define T_Mode 354
+#define T_Mode7 355
+#define T_Monitor 356
+#define T_Month 357
+#define T_Mru 358
+#define T_Multicastclient 359
+#define T_Nic 360
+#define T_Nolink 361
+#define T_Nomodify 362
+#define T_Nomrulist 363
+#define T_None 364
+#define T_Nonvolatile 365
+#define T_Nopeer 366
+#define T_Noquery 367
+#define T_Noselect 368
+#define T_Noserve 369
+#define T_Notrap 370
+#define T_Notrust 371
+#define T_Ntp 372
+#define T_Ntpport 373
+#define T_NtpSignDsocket 374
+#define T_Orphan 375
+#define T_Orphanwait 376
+#define T_Panic 377
+#define T_Peer 378
+#define T_Peerstats 379
+#define T_Phone 380
+#define T_Pid 381
+#define T_Pidfile 382
+#define T_Pool 383
+#define T_Port 384
+#define T_Preempt 385
+#define T_Prefer 386
+#define T_Protostats 387
+#define T_Pw 388
+#define T_Randfile 389
+#define T_Rawstats 390
+#define T_Refid 391
+#define T_Requestkey 392
+#define T_Reset 393
+#define T_Restrict 394
+#define T_Revoke 395
+#define T_Rlimit 396
+#define T_Saveconfigdir 397
+#define T_Server 398
+#define T_Setvar 399
+#define T_Source 400
+#define T_Stacksize 401
+#define T_Statistics 402
+#define T_Stats 403
+#define T_Statsdir 404
+#define T_Step 405
+#define T_Stepout 406
+#define T_Stratum 407
+#define T_String 408
+#define T_Sys 409
+#define T_Sysstats 410
+#define T_Tick 411
+#define T_Time1 412
+#define T_Time2 413
+#define T_Timer 414
+#define T_Timingstats 415
+#define T_Tinker 416
+#define T_Tos 417
+#define T_Trap 418
+#define T_True 419
+#define T_Trustedkey 420
+#define T_Ttl 421
+#define T_Type 422
+#define T_U_int 423
+#define T_Unconfig 424
+#define T_Unpeer 425
+#define T_Version 426
+#define T_WanderThreshold 427
+#define T_Week 428
+#define T_Wildcard 429
+#define T_Xleave 430
+#define T_Year 431
+#define T_Flag 432
+#define T_EOC 433
+#define T_Simulate 434
+#define T_Beep_Delay 435
+#define T_Sim_Duration 436
+#define T_Server_Offset 437
+#define T_Duration 438
+#define T_Freq_Offset 439
+#define T_Wander 440
+#define T_Jitter 441
+#define T_Prop_Delay 442
+#define T_Proc_Delay 443
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+#line 54 "ntp_parser.y" /* yacc.c:355 */
+
+ char * String;
+ double Double;
+ int Integer;
+ unsigned U_int;
+ gen_fifo * Generic_fifo;
+ attr_val * Attr_val;
+ attr_val_fifo * Attr_val_fifo;
+ int_fifo * Int_fifo;
+ string_fifo * String_fifo;
+ address_node * Address_node;
+ address_fifo * Address_fifo;
+ setvar_node * Set_var;
+ server_info * Sim_server;
+ server_info_fifo * Sim_server_fifo;
+ script_info * Sim_script;
+ script_info_fifo * Sim_script_fifo;
+
+#line 535 "../../ntpd/ntp_parser.c" /* yacc.c:355 */
+};
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+extern YYSTYPE yylval;
+
+int yyparse (struct FILE_INFO *ip_file);
+
+#endif /* !YY_YY_Y_TAB_H_INCLUDED */
+
+/* Copy the second part of user declarations. */
+
+#line 550 "../../ntpd/ntp_parser.c" /* yacc.c:358 */
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#else
+typedef signed char yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+#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
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(E) ((void) (E))
+#else
+# define YYUSE(E) /* empty */
+#endif
+
+#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
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#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. */
+
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
+# else
+# define YYSTACK_ALLOC alloca
+# 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
+# define EXIT_SUCCESS 0
+# endif
+# endif
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* 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
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+# endif
+# else
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# 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
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
+
+# define YYCOPY_NEEDED 1
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 203
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 653
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 194
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 104
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 307
+/* YYNSTATES -- Number of states. */
+#define YYNSTATES 411
+
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 443
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* 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,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 190, 191, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 189, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 192, 2, 193, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
+ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
+ 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
+ 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
+ 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
+ 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
+ 185, 186, 187, 188
+};
+
+#if YYDEBUG
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+static const yytype_uint16 yyrline[] =
+{
+ 0, 363, 363, 367, 368, 369, 383, 384, 385, 386,
+ 387, 388, 389, 390, 391, 392, 393, 394, 395, 396,
+ 404, 414, 415, 416, 417, 418, 422, 423, 428, 433,
+ 435, 441, 442, 450, 451, 452, 456, 461, 462, 463,
+ 464, 465, 466, 467, 468, 472, 474, 479, 480, 481,
+ 482, 483, 484, 488, 493, 502, 512, 513, 523, 525,
+ 527, 538, 545, 547, 552, 554, 556, 558, 560, 569,
+ 575, 576, 584, 586, 598, 599, 600, 601, 602, 611,
+ 616, 621, 629, 631, 633, 638, 639, 640, 641, 642,
+ 643, 647, 648, 649, 650, 659, 661, 670, 680, 685,
+ 693, 694, 695, 696, 697, 698, 699, 700, 705, 706,
+ 714, 724, 733, 748, 753, 754, 758, 759, 763, 764,
+ 765, 766, 767, 768, 769, 778, 782, 786, 794, 802,
+ 810, 825, 840, 853, 854, 862, 863, 864, 865, 866,
+ 867, 868, 869, 870, 871, 872, 873, 874, 875, 876,
+ 880, 885, 893, 898, 899, 900, 904, 909, 917, 922,
+ 923, 924, 925, 926, 927, 928, 929, 937, 947, 952,
+ 960, 962, 964, 966, 968, 973, 974, 978, 979, 980,
+ 981, 989, 994, 999, 1007, 1012, 1013, 1014, 1023, 1025,
+ 1030, 1035, 1043, 1045, 1062, 1063, 1064, 1065, 1066, 1067,
+ 1071, 1072, 1080, 1085, 1090, 1098, 1103, 1104, 1105, 1106,
+ 1107, 1108, 1109, 1110, 1119, 1120, 1121, 1128, 1135, 1151,
+ 1170, 1175, 1177, 1179, 1181, 1183, 1190, 1195, 1196, 1197,
+ 1201, 1202, 1203, 1207, 1208, 1212, 1219, 1229, 1238, 1243,
+ 1245, 1250, 1251, 1259, 1261, 1269, 1274, 1282, 1307, 1314,
+ 1324, 1325, 1329, 1330, 1331, 1332, 1336, 1337, 1338, 1342,
+ 1347, 1352, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1376,
+ 1381, 1389, 1394, 1402, 1404, 1408, 1413, 1418, 1426, 1431,
+ 1439, 1448, 1449, 1453, 1454, 1463, 1481, 1485, 1490, 1498,
+ 1503, 1504, 1508, 1513, 1521, 1526, 1531, 1536, 1541, 1549,
+ 1554, 1559, 1567, 1572, 1573, 1574, 1575, 1576
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || 1
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "T_Abbrev", "T_Age", "T_All", "T_Allan",
+ "T_Allpeers", "T_Auth", "T_Autokey", "T_Automax", "T_Average",
+ "T_Bclient", "T_Beacon", "T_Broadcast", "T_Broadcastclient",
+ "T_Broadcastdelay", "T_Burst", "T_Calibrate", "T_Ceiling",
+ "T_Clockstats", "T_Cohort", "T_ControlKey", "T_Crypto", "T_Cryptostats",
+ "T_Ctl", "T_Day", "T_Default", "T_Digest", "T_Disable", "T_Discard",
+ "T_Dispersion", "T_Double", "T_Driftfile", "T_Drop", "T_Ellipsis",
+ "T_Enable", "T_End", "T_False", "T_File", "T_Filegen", "T_Filenum",
+ "T_Flag1", "T_Flag2", "T_Flag3", "T_Flag4", "T_Flake", "T_Floor",
+ "T_Freq", "T_Fudge", "T_Host", "T_Huffpuff", "T_Iburst", "T_Ident",
+ "T_Ignore", "T_Incalloc", "T_Incmem", "T_Initalloc", "T_Initmem",
+ "T_Includefile", "T_Integer", "T_Interface", "T_Intrange", "T_Io",
+ "T_Ipv4", "T_Ipv4_flag", "T_Ipv6", "T_Ipv6_flag", "T_Kernel", "T_Key",
+ "T_Keys", "T_Keysdir", "T_Kod", "T_Mssntp", "T_Leapfile", "T_Limited",
+ "T_Link", "T_Listen", "T_Logconfig", "T_Logfile", "T_Loopstats",
+ "T_Lowpriotrap", "T_Manycastclient", "T_Manycastserver", "T_Mask",
+ "T_Maxage", "T_Maxclock", "T_Maxdepth", "T_Maxdist", "T_Maxmem",
+ "T_Maxpoll", "T_Mem", "T_Memlock", "T_Minclock", "T_Mindepth",
+ "T_Mindist", "T_Minimum", "T_Minpoll", "T_Minsane", "T_Mode", "T_Mode7",
+ "T_Monitor", "T_Month", "T_Mru", "T_Multicastclient", "T_Nic",
+ "T_Nolink", "T_Nomodify", "T_Nomrulist", "T_None", "T_Nonvolatile",
+ "T_Nopeer", "T_Noquery", "T_Noselect", "T_Noserve", "T_Notrap",
+ "T_Notrust", "T_Ntp", "T_Ntpport", "T_NtpSignDsocket", "T_Orphan",
+ "T_Orphanwait", "T_Panic", "T_Peer", "T_Peerstats", "T_Phone", "T_Pid",
+ "T_Pidfile", "T_Pool", "T_Port", "T_Preempt", "T_Prefer", "T_Protostats",
+ "T_Pw", "T_Randfile", "T_Rawstats", "T_Refid", "T_Requestkey", "T_Reset",
+ "T_Restrict", "T_Revoke", "T_Rlimit", "T_Saveconfigdir", "T_Server",
+ "T_Setvar", "T_Source", "T_Stacksize", "T_Statistics", "T_Stats",
+ "T_Statsdir", "T_Step", "T_Stepout", "T_Stratum", "T_String", "T_Sys",
+ "T_Sysstats", "T_Tick", "T_Time1", "T_Time2", "T_Timer", "T_Timingstats",
+ "T_Tinker", "T_Tos", "T_Trap", "T_True", "T_Trustedkey", "T_Ttl",
+ "T_Type", "T_U_int", "T_Unconfig", "T_Unpeer", "T_Version",
+ "T_WanderThreshold", "T_Week", "T_Wildcard", "T_Xleave", "T_Year",
+ "T_Flag", "T_EOC", "T_Simulate", "T_Beep_Delay", "T_Sim_Duration",
+ "T_Server_Offset", "T_Duration", "T_Freq_Offset", "T_Wander", "T_Jitter",
+ "T_Prop_Delay", "T_Proc_Delay", "'='", "'('", "')'", "'{'", "'}'",
+ "$accept", "configuration", "command_list", "command", "server_command",
+ "client_type", "address", "ip_address", "address_fam", "option_list",
+ "option", "option_flag", "option_flag_keyword", "option_int",
+ "option_int_keyword", "option_str", "option_str_keyword",
+ "unpeer_command", "unpeer_keyword", "other_mode_command",
+ "authentication_command", "crypto_command_list", "crypto_command",
+ "crypto_str_keyword", "orphan_mode_command", "tos_option_list",
+ "tos_option", "tos_option_int_keyword", "tos_option_dbl_keyword",
+ "monitoring_command", "stats_list", "stat", "filegen_option_list",
+ "filegen_option", "link_nolink", "enable_disable", "filegen_type",
+ "access_control_command", "ac_flag_list", "access_control_flag",
+ "discard_option_list", "discard_option", "discard_option_keyword",
+ "mru_option_list", "mru_option", "mru_option_keyword", "fudge_command",
+ "fudge_factor_list", "fudge_factor", "fudge_factor_dbl_keyword",
+ "fudge_factor_bool_keyword", "rlimit_command", "rlimit_option_list",
+ "rlimit_option", "rlimit_option_keyword", "system_option_command",
+ "system_option_list", "system_option", "system_option_flag_keyword",
+ "system_option_local_flag_keyword", "tinker_command",
+ "tinker_option_list", "tinker_option", "tinker_option_keyword",
+ "miscellaneous_command", "misc_cmd_dbl_keyword", "misc_cmd_str_keyword",
+ "misc_cmd_str_lcl_keyword", "drift_parm", "variable_assign",
+ "t_default_or_zero", "trap_option_list", "trap_option",
+ "log_config_list", "log_config_command", "interface_command",
+ "interface_nic", "nic_rule_class", "nic_rule_action", "reset_command",
+ "counter_set_list", "counter_set_keyword", "integer_list",
+ "integer_list_range", "integer_list_range_elt", "integer_range",
+ "string_list", "address_list", "boolean", "number", "simulate_command",
+ "sim_conf_start", "sim_init_statement_list", "sim_init_statement",
+ "sim_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_NULLPTR
+};
+#endif
+
+# ifdef YYPRINT
+/* 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,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
+ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
+ 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
+ 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
+ 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
+ 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
+ 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
+ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
+ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
+ 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
+ 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
+ 415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
+ 425, 426, 427, 428, 429, 430, 431, 432, 433, 434,
+ 435, 436, 437, 438, 439, 440, 441, 442, 443, 61,
+ 40, 41, 123, 125
+};
+# endif
+
+#define YYPACT_NINF -178
+
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-178)))
+
+#define YYTABLE_NINF -7
+
+#define yytable_value_is_error(Yytable_value) \
+ 0
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+static const yytype_int16 yypact[] =
+{
+ 26, -153, -30, -178, -178, -178, -28, -178, 166, 18,
+ -109, 166, -178, 200, -47, -178, -102, -178, -96, -93,
+ -178, -89, -178, -178, -47, 330, -47, -178, -178, -85,
+ -178, -76, -178, -178, 20, -2, 45, 22, -22, -178,
+ -178, -67, 200, -65, -178, 107, 520, -63, -53, 35,
+ -178, -178, -178, 46, 203, -94, -178, -47, -178, -47,
+ -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+ -21, -55, -54, -178, 4, -178, -178, -77, -178, -178,
+ -178, 158, -178, -178, -178, -178, -178, -178, -178, -178,
+ 166, -178, -178, -178, -178, -178, -178, 18, -178, 47,
+ 84, -178, 166, -178, -178, -178, -178, -178, -178, -178,
+ -178, -178, -178, -178, -178, 49, -178, -33, 361, -178,
+ -178, -178, -89, -178, -178, -47, -178, -178, -178, -178,
+ -178, -178, -178, -178, 330, -178, 58, -47, -178, -178,
+ -31, -178, -178, -178, -178, -178, -178, -178, -178, -2,
+ -178, -178, 94, 98, -178, -178, 43, -178, -178, -178,
+ -178, -22, -178, 68, -57, -178, 200, -178, -178, -178,
+ -178, -178, -178, -178, -178, -178, -178, 107, -178, -21,
+ -178, -178, -25, -178, -178, -178, -178, -178, -178, -178,
+ -178, 520, -178, 75, -21, -178, -178, 86, -53, -178,
+ -178, -178, 87, -178, -19, -178, -178, -178, -178, -178,
+ -178, -178, -178, -178, -178, -178, 3, -107, -178, -178,
+ -178, -178, -178, 88, -178, 7, -178, -178, -178, -178,
+ -5, 8, -178, -178, -178, -178, 23, 111, -178, -178,
+ 49, -178, -21, -25, -178, -178, -178, -178, -178, -178,
+ -178, -178, 482, -178, -178, 482, 482, -63, -178, -178,
+ 28, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+ -178, -46, 144, -178, -178, -178, 416, -178, -178, -178,
+ -178, -178, -178, -178, -178, -127, 5, 10, -178, -178,
+ -178, -178, 40, -178, -178, 24, -178, -178, -178, -178,
+ -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+ -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+ -178, 482, 482, -178, 167, -63, 142, -178, 143, -178,
+ -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+ -178, -178, -178, -178, -178, -178, -178, -178, -51, -178,
+ 57, 27, 34, -117, -178, 29, -178, -21, -178, -178,
+ -178, -178, -178, -178, -178, -178, -178, 482, -178, -178,
+ -178, -178, 32, -178, -178, -178, -47, -178, -178, -178,
+ 33, -178, -178, -178, 38, 52, -21, 39, -146, -178,
+ 59, -21, -178, -178, -178, 50, -44, -178, -178, -178,
+ -178, -178, 60, 63, 41, -178, 71, -178, -21, -178,
+ -178
+};
+
+ /* 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, 227, 0, 70, 0, 0,
+ 237, 0, 220, 0, 0, 230, 0, 250, 0, 0,
+ 231, 0, 233, 25, 0, 0, 0, 251, 228, 0,
+ 23, 0, 232, 22, 0, 0, 0, 0, 0, 234,
+ 21, 0, 0, 0, 229, 0, 0, 0, 0, 0,
+ 56, 57, 286, 0, 2, 0, 7, 0, 8, 0,
+ 9, 10, 13, 11, 12, 14, 15, 16, 17, 18,
+ 0, 0, 0, 214, 0, 215, 19, 0, 5, 61,
+ 62, 63, 194, 195, 196, 197, 200, 198, 199, 201,
+ 189, 191, 192, 193, 153, 154, 155, 125, 151, 0,
+ 235, 221, 188, 100, 101, 102, 103, 107, 104, 105,
+ 106, 108, 29, 30, 28, 0, 26, 0, 6, 64,
+ 65, 247, 222, 246, 279, 59, 159, 160, 161, 162,
+ 163, 164, 165, 166, 126, 157, 0, 60, 69, 277,
+ 223, 66, 262, 263, 264, 265, 266, 267, 268, 259,
+ 261, 133, 29, 30, 133, 133, 26, 67, 187, 185,
+ 186, 181, 183, 0, 0, 224, 95, 99, 96, 206,
+ 207, 208, 209, 210, 211, 212, 213, 202, 204, 0,
+ 90, 85, 0, 86, 94, 92, 93, 91, 89, 87,
+ 88, 79, 81, 0, 0, 241, 273, 0, 68, 272,
+ 274, 270, 226, 1, 0, 4, 31, 55, 284, 283,
+ 216, 217, 218, 258, 257, 256, 0, 0, 78, 74,
+ 75, 76, 77, 0, 71, 0, 190, 150, 152, 236,
+ 97, 0, 177, 178, 179, 180, 0, 0, 175, 176,
+ 167, 169, 0, 0, 27, 219, 245, 278, 156, 158,
+ 276, 260, 129, 133, 133, 132, 127, 0, 182, 184,
+ 0, 98, 203, 205, 282, 280, 281, 84, 80, 82,
+ 83, 225, 0, 271, 269, 3, 20, 252, 253, 254,
+ 249, 255, 248, 290, 291, 0, 0, 0, 73, 72,
+ 117, 116, 0, 114, 115, 0, 109, 112, 113, 173,
+ 174, 172, 168, 170, 171, 135, 136, 137, 138, 139,
+ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 134, 130, 131, 133, 240, 0, 0, 242, 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, 293, 0, 288, 0, 110, 124,
+ 120, 122, 118, 119, 121, 123, 111, 128, 239, 238,
+ 244, 243, 0, 45, 46, 53, 0, 287, 285, 292,
+ 0, 289, 275, 296, 0, 0, 0, 0, 0, 298,
+ 0, 0, 294, 297, 295, 0, 0, 303, 304, 305,
+ 306, 307, 0, 0, 0, 299, 0, 301, 0, 300,
+ 302
+};
+
+ /* YYPGOTO[NTERM-NUM]. */
+static const yytype_int16 yypgoto[] =
+{
+ -178, -178, -178, -40, -178, -178, -14, -35, -178, -178,
+ -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+ -178, -178, -178, -178, -178, -178, 64, -178, -178, -178,
+ -178, -32, -178, -178, -178, -178, -178, -178, -151, -178,
+ -178, 141, -178, -178, 116, -178, -178, -178, 11, -178,
+ -178, -178, -178, 93, -178, -178, 248, -69, -178, -178,
+ -178, -178, 83, -178, -178, -178, -178, -178, -178, -178,
+ -178, -178, -178, -178, 139, -178, -178, -178, -178, -178,
+ -178, 119, -178, -178, 67, -178, -178, 243, 36, -177,
+ -178, -178, -178, -15, -178, -178, -82, -178, -178, -178,
+ -116, -178, -126, -178
+};
+
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int16 yydefgoto[] =
+{
+ -1, 53, 54, 55, 56, 57, 124, 116, 117, 276,
+ 344, 345, 346, 347, 348, 349, 350, 58, 59, 60,
+ 61, 81, 224, 225, 62, 191, 192, 193, 194, 63,
+ 166, 111, 230, 296, 297, 298, 366, 64, 252, 320,
+ 97, 98, 99, 134, 135, 136, 65, 240, 241, 242,
+ 243, 66, 161, 162, 163, 67, 90, 91, 92, 93,
+ 68, 177, 178, 179, 69, 70, 71, 72, 101, 165,
+ 369, 271, 327, 122, 123, 73, 74, 282, 216, 75,
+ 149, 150, 202, 198, 199, 200, 140, 125, 267, 210,
+ 76, 77, 285, 286, 287, 353, 354, 385, 355, 388,
+ 389, 402, 403, 404
+};
+
+ /* 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[] =
+{
+ 115, 156, 263, 255, 256, 142, 143, 196, 277, 373,
+ 167, 208, 195, 264, 204, 325, 351, 270, 112, 158,
+ 113, 226, 155, 144, 290, 78, 351, 1, 359, 94,
+ 79, 291, 80, 226, 292, 265, 2, 387, 213, 209,
+ 3, 4, 5, 206, 100, 207, 203, 392, 6, 7,
+ 360, 118, 231, 283, 284, 8, 9, 119, 214, 10,
+ 120, 145, 11, 12, 121, 303, 13, 278, 138, 279,
+ 159, 293, 151, 283, 284, 14, 378, 139, 245, 15,
+ 141, 215, 157, 326, 205, 16, 164, 17, 168, 146,
+ 114, 232, 233, 234, 235, 201, 18, 19, 211, 212,
+ 20, 294, 321, 322, 21, 22, 114, 228, 23, 24,
+ 152, 247, 153, 169, 95, 217, 229, 374, 249, 96,
+ 244, 253, 250, 247, 160, 254, 361, 257, 259, 25,
+ 26, 27, 260, 362, 261, 269, 28, 197, 170, 266,
+ 397, 398, 399, 400, 401, 29, 272, 274, 288, 30,
+ 363, 31, 147, 32, 33, 171, 280, 148, 172, 275,
+ 289, 299, 295, 34, 35, 36, 37, 38, 39, 40,
+ 41, 301, 367, 42, 82, 43, 300, 281, 83, 328,
+ 381, 324, 44, 356, 84, 236, 218, 45, 46, 47,
+ 154, 48, 49, 358, 368, 50, 51, 364, 114, 357,
+ 365, 237, 371, 372, -6, 52, 238, 239, 219, 390,
+ 375, 220, 377, 2, 395, 384, 376, 3, 4, 5,
+ 103, 380, 323, 382, 104, 6, 7, 386, 391, 173,
+ 408, 410, 8, 9, 85, 387, 10, 394, 227, 11,
+ 12, 407, 396, 13, 397, 398, 399, 400, 401, 409,
+ 248, 302, 14, 405, 258, 268, 15, 174, 175, 102,
+ 262, 246, 16, 176, 17, 273, 86, 87, 251, 137,
+ 352, 379, 393, 18, 19, 0, 406, 20, 0, 304,
+ 105, 21, 22, 88, 0, 23, 24, 0, 0, 0,
+ 370, 221, 222, 0, 0, 0, 0, 0, 223, 0,
+ 0, 0, 0, 0, 0, 0, 25, 26, 27, 0,
+ 0, 0, 0, 28, 89, 0, 0, 0, 0, 0,
+ 0, 0, 29, 0, 106, 0, 30, 0, 31, 0,
+ 32, 33, 107, 0, 0, 108, 0, 0, 0, 0,
+ 34, 35, 36, 37, 38, 39, 40, 41, 0, 0,
+ 42, 0, 43, 0, 0, 109, 0, 0, 0, 44,
+ 110, 0, 383, 0, 45, 46, 47, 0, 48, 49,
+ 0, 2, 50, 51, 0, 3, 4, 5, 0, 0,
+ 0, -6, 52, 6, 7, 126, 127, 128, 129, 0,
+ 8, 9, 0, 0, 10, 0, 0, 11, 12, 0,
+ 0, 13, 0, 0, 0, 0, 0, 0, 0, 0,
+ 14, 0, 0, 0, 15, 130, 0, 131, 0, 132,
+ 16, 0, 17, 0, 133, 329, 0, 0, 0, 0,
+ 0, 18, 19, 330, 0, 20, 0, 0, 0, 21,
+ 22, 0, 0, 23, 24, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 25, 26, 27, 0, 331, 332,
+ 0, 28, 0, 0, 0, 0, 0, 0, 0, 0,
+ 29, 0, 0, 0, 30, 333, 31, 0, 32, 33,
+ 0, 0, 0, 0, 0, 0, 0, 0, 34, 35,
+ 36, 37, 38, 39, 40, 41, 334, 0, 42, 0,
+ 43, 0, 0, 335, 0, 336, 0, 44, 0, 0,
+ 0, 0, 45, 46, 47, 0, 48, 49, 305, 337,
+ 50, 51, 0, 180, 0, 0, 306, 0, 0, 181,
+ 52, 182, 0, 0, 0, 0, 338, 339, 0, 0,
+ 0, 0, 0, 0, 307, 308, 0, 309, 0, 0,
+ 0, 0, 0, 310, 0, 0, 0, 183, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 340, 0, 341, 0, 0, 0, 0, 342, 0, 311,
+ 312, 343, 0, 313, 314, 0, 315, 316, 317, 0,
+ 318, 0, 0, 0, 0, 0, 184, 0, 185, 0,
+ 0, 0, 0, 186, 0, 187, 0, 0, 188, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 189, 190, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 319
+};
+
+static const yytype_int16 yycheck[] =
+{
+ 14, 36, 179, 154, 155, 7, 8, 60, 5, 60,
+ 42, 32, 47, 38, 54, 61, 143, 194, 65, 41,
+ 67, 90, 36, 25, 29, 178, 143, 1, 4, 11,
+ 60, 36, 60, 102, 39, 60, 10, 183, 34, 60,
+ 14, 15, 16, 57, 153, 59, 0, 193, 22, 23,
+ 26, 153, 3, 180, 181, 29, 30, 153, 54, 33,
+ 153, 63, 36, 37, 153, 242, 40, 64, 153, 66,
+ 92, 76, 27, 180, 181, 49, 193, 153, 118, 53,
+ 60, 77, 60, 129, 178, 59, 153, 61, 153, 91,
+ 153, 42, 43, 44, 45, 60, 70, 71, 153, 153,
+ 74, 106, 253, 254, 78, 79, 153, 60, 82, 83,
+ 65, 125, 67, 6, 96, 192, 32, 168, 60, 101,
+ 153, 27, 153, 137, 146, 27, 102, 84, 60, 103,
+ 104, 105, 189, 109, 166, 60, 110, 190, 31, 164,
+ 184, 185, 186, 187, 188, 119, 60, 60, 60, 123,
+ 126, 125, 154, 127, 128, 48, 153, 159, 51, 178,
+ 153, 153, 167, 137, 138, 139, 140, 141, 142, 143,
+ 144, 60, 323, 147, 8, 149, 153, 174, 12, 35,
+ 357, 153, 156, 178, 18, 136, 28, 161, 162, 163,
+ 145, 165, 166, 153, 27, 169, 170, 173, 153, 189,
+ 176, 152, 60, 60, 178, 179, 157, 158, 50, 386,
+ 153, 53, 178, 10, 391, 182, 189, 14, 15, 16,
+ 20, 192, 257, 191, 24, 22, 23, 189, 189, 122,
+ 189, 408, 29, 30, 68, 183, 33, 178, 97, 36,
+ 37, 178, 192, 40, 184, 185, 186, 187, 188, 178,
+ 134, 240, 49, 193, 161, 191, 53, 150, 151, 11,
+ 177, 122, 59, 156, 61, 198, 100, 101, 149, 26,
+ 285, 353, 388, 70, 71, -1, 402, 74, -1, 243,
+ 80, 78, 79, 117, -1, 82, 83, -1, -1, -1,
+ 325, 133, 134, -1, -1, -1, -1, -1, 140, -1,
+ -1, -1, -1, -1, -1, -1, 103, 104, 105, -1,
+ -1, -1, -1, 110, 148, -1, -1, -1, -1, -1,
+ -1, -1, 119, -1, 124, -1, 123, -1, 125, -1,
+ 127, 128, 132, -1, -1, 135, -1, -1, -1, -1,
+ 137, 138, 139, 140, 141, 142, 143, 144, -1, -1,
+ 147, -1, 149, -1, -1, 155, -1, -1, -1, 156,
+ 160, -1, 376, -1, 161, 162, 163, -1, 165, 166,
+ -1, 10, 169, 170, -1, 14, 15, 16, -1, -1,
+ -1, 178, 179, 22, 23, 55, 56, 57, 58, -1,
+ 29, 30, -1, -1, 33, -1, -1, 36, 37, -1,
+ -1, 40, -1, -1, -1, -1, -1, -1, -1, -1,
+ 49, -1, -1, -1, 53, 85, -1, 87, -1, 89,
+ 59, -1, 61, -1, 94, 9, -1, -1, -1, -1,
+ -1, 70, 71, 17, -1, 74, -1, -1, -1, 78,
+ 79, -1, -1, 82, 83, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 103, 104, 105, -1, 52, 53,
+ -1, 110, -1, -1, -1, -1, -1, -1, -1, -1,
+ 119, -1, -1, -1, 123, 69, 125, -1, 127, 128,
+ -1, -1, -1, -1, -1, -1, -1, -1, 137, 138,
+ 139, 140, 141, 142, 143, 144, 90, -1, 147, -1,
+ 149, -1, -1, 97, -1, 99, -1, 156, -1, -1,
+ -1, -1, 161, 162, 163, -1, 165, 166, 46, 113,
+ 169, 170, -1, 13, -1, -1, 54, -1, -1, 19,
+ 179, 21, -1, -1, -1, -1, 130, 131, -1, -1,
+ -1, -1, -1, -1, 72, 73, -1, 75, -1, -1,
+ -1, -1, -1, 81, -1, -1, -1, 47, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 164, -1, 166, -1, -1, -1, -1, 171, -1, 107,
+ 108, 175, -1, 111, 112, -1, 114, 115, 116, -1,
+ 118, -1, -1, -1, -1, -1, 86, -1, 88, -1,
+ -1, -1, -1, 93, -1, 95, -1, -1, 98, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 120, 121, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 171
+};
+
+ /* 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,
+ 33, 36, 37, 40, 49, 53, 59, 61, 70, 71,
+ 74, 78, 79, 82, 83, 103, 104, 105, 110, 119,
+ 123, 125, 127, 128, 137, 138, 139, 140, 141, 142,
+ 143, 144, 147, 149, 156, 161, 162, 163, 165, 166,
+ 169, 170, 179, 195, 196, 197, 198, 199, 211, 212,
+ 213, 214, 218, 223, 231, 240, 245, 249, 254, 258,
+ 259, 260, 261, 269, 270, 273, 284, 285, 178, 60,
+ 60, 215, 8, 12, 18, 68, 100, 101, 117, 148,
+ 250, 251, 252, 253, 11, 96, 101, 234, 235, 236,
+ 153, 262, 250, 20, 24, 80, 124, 132, 135, 155,
+ 160, 225, 65, 67, 153, 200, 201, 202, 153, 153,
+ 153, 153, 267, 268, 200, 281, 55, 56, 57, 58,
+ 85, 87, 89, 94, 237, 238, 239, 281, 153, 153,
+ 280, 60, 7, 8, 25, 63, 91, 154, 159, 274,
+ 275, 27, 65, 67, 145, 200, 201, 60, 41, 92,
+ 146, 246, 247, 248, 153, 263, 224, 225, 153, 6,
+ 31, 48, 51, 122, 150, 151, 156, 255, 256, 257,
+ 13, 19, 21, 47, 86, 88, 93, 95, 98, 120,
+ 121, 219, 220, 221, 222, 201, 60, 190, 277, 278,
+ 279, 60, 276, 0, 197, 178, 200, 200, 32, 60,
+ 283, 153, 153, 34, 54, 77, 272, 192, 28, 50,
+ 53, 133, 134, 140, 216, 217, 251, 235, 60, 32,
+ 226, 3, 42, 43, 44, 45, 136, 152, 157, 158,
+ 241, 242, 243, 244, 153, 197, 268, 200, 238, 60,
+ 153, 275, 232, 27, 27, 232, 232, 84, 247, 60,
+ 189, 225, 256, 283, 38, 60, 164, 282, 220, 60,
+ 283, 265, 60, 278, 60, 178, 203, 5, 64, 66,
+ 153, 174, 271, 180, 181, 286, 287, 288, 60, 153,
+ 29, 36, 39, 76, 106, 167, 227, 228, 229, 153,
+ 153, 60, 242, 283, 282, 46, 54, 72, 73, 75,
+ 81, 107, 108, 111, 112, 114, 115, 116, 118, 171,
+ 233, 232, 232, 201, 153, 61, 129, 266, 35, 9,
+ 17, 52, 53, 69, 90, 97, 99, 113, 130, 131,
+ 164, 166, 171, 175, 204, 205, 206, 207, 208, 209,
+ 210, 143, 287, 289, 290, 292, 178, 189, 153, 4,
+ 26, 102, 109, 126, 173, 176, 230, 232, 27, 264,
+ 201, 60, 60, 60, 168, 153, 189, 178, 193, 290,
+ 192, 283, 191, 200, 182, 291, 189, 183, 293, 294,
+ 283, 189, 193, 294, 178, 283, 192, 184, 185, 186,
+ 187, 188, 295, 296, 297, 193, 296, 178, 189, 178,
+ 283
+};
+
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint16 yyr1[] =
+{
+ 0, 194, 195, 196, 196, 196, 197, 197, 197, 197,
+ 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
+ 198, 199, 199, 199, 199, 199, 200, 200, 201, 202,
+ 202, 203, 203, 204, 204, 204, 205, 206, 206, 206,
+ 206, 206, 206, 206, 206, 207, 207, 208, 208, 208,
+ 208, 208, 208, 209, 210, 211, 212, 212, 213, 213,
+ 213, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 215, 215, 216, 216, 217, 217, 217, 217, 217, 218,
+ 219, 219, 220, 220, 220, 221, 221, 221, 221, 221,
+ 221, 222, 222, 222, 222, 223, 223, 223, 224, 224,
+ 225, 225, 225, 225, 225, 225, 225, 225, 226, 226,
+ 227, 227, 227, 227, 228, 228, 229, 229, 230, 230,
+ 230, 230, 230, 230, 230, 231, 231, 231, 231, 231,
+ 231, 231, 231, 232, 232, 233, 233, 233, 233, 233,
+ 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
+ 234, 234, 235, 236, 236, 236, 237, 237, 238, 239,
+ 239, 239, 239, 239, 239, 239, 239, 240, 241, 241,
+ 242, 242, 242, 242, 242, 243, 243, 244, 244, 244,
+ 244, 245, 246, 246, 247, 248, 248, 248, 249, 249,
+ 250, 250, 251, 251, 252, 252, 252, 252, 252, 252,
+ 253, 253, 254, 255, 255, 256, 257, 257, 257, 257,
+ 257, 257, 257, 257, 258, 258, 258, 258, 258, 258,
+ 258, 258, 258, 258, 258, 258, 258, 259, 259, 259,
+ 260, 260, 260, 261, 261, 262, 262, 262, 263, 264,
+ 264, 265, 265, 266, 266, 267, 267, 268, 269, 269,
+ 270, 270, 271, 271, 271, 271, 272, 272, 272, 273,
+ 274, 274, 275, 275, 275, 275, 275, 275, 275, 276,
+ 276, 277, 277, 278, 278, 279, 280, 280, 281, 281,
+ 282, 282, 282, 283, 283, 284, 285, 286, 286, 287,
+ 288, 288, 289, 289, 290, 291, 292, 293, 293, 294,
+ 295, 295, 296, 297, 297, 297, 297, 297
+};
+
+ /* 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,
+ 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, 2, 2, 2, 3,
+ 1, 2, 2, 2, 2, 3, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 2, 0, 4, 1,
+ 0, 0, 2, 2, 2, 2, 1, 1, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 2, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 1, 2, 1, 1, 1, 5, 2, 1, 2, 1,
+ 1, 1, 1, 1, 1, 5, 1, 3, 2, 3,
+ 1, 1, 2, 1, 5, 4, 3, 2, 1, 6,
+ 3, 2, 3, 1, 1, 1, 1, 1
+};
+
+
+#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)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (ip_file, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+while (0)
+
+/* Error token number */
+#define YYTERROR 1
+#define YYERRCODE 256
+
+
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value, ip_file); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
+
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct FILE_INFO *ip_file)
+{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
+ YYUSE (ip_file);
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+ YYUSE (yytype);
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct FILE_INFO *ip_file)
+{
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, ip_file);
+ YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
+
+static void
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
+ YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+static void
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, struct FILE_INFO *ip_file)
+{
+ unsigned long int yylno = yyrline[yyrule];
+ int yynrhs = yyr2[yyrule];
+ int yyi;
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr,
+ yystos[yyssp[yyi + 1 - yynrhs]],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ , ip_file);
+ YYFPRINTF (stderr, "\n");
+ }
+}
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, Rule, ip_file); \
+} while (0)
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+yystrlen (const char *yystr)
+{
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
+ continue;
+ return yylen;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+{
+ char *yyd = yydest;
+ const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+ quotes and backslashes, so that it's suitable for yyerror. The
+ heuristic is that double-quoting is unnecessary unless the string
+ contains an apostrophe, a comma, or backslash (other than
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ if (! yyres)
+ return yystrlen (yystr);
+
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int 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_NULLPTR;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - 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
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
+ {
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
+
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
+
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
+ }
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
+}
+#endif /* YYERROR_VERBOSE */
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct FILE_INFO *ip_file)
+{
+ YYUSE (yyvaluep);
+ YYUSE (ip_file);
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+}
+
+
+
+
+/* The lookahead symbol. */
+int yychar;
+
+/* The semantic value of the lookahead symbol. */
+YYSTYPE yylval;
+/* Number of syntax errors so far. */
+int yynerrs;
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+int
+yyparse (struct FILE_INFO *ip_file)
+{
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+
+ /* The stacks and their tools:
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
+
+ Refer to the stacks through separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
+
+ YYSIZE_T yystacksize;
+
+ int yyn;
+ int yyresult;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken = 0;
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
+
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
+ yystacksize = YYINITDEPTH;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. So pushing a state here evens the stacks. */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+# else
+ /* Extend the stack our own way. */
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyexhaustedlab;
+ yystacksize *= 2;
+ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+ /* Do appropriate processing given the current state. Read a
+ lookahead token if we need one and don't already have one. */
+
+ /* First try to decide what to do without reference to lookahead token. */
+ yyn = yypact[yystate];
+ if (yypact_value_is_default (yyn))
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = yylex (ip_file);
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ /* Shift the lookahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
+
+ yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ '$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 5:
+#line 370 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ /* I will need to incorporate much more fine grained
+ * error messages. The following should suffice for
+ * the time being.
+ */
+ msyslog(LOG_ERR,
+ "syntax error in %s line %d, column %d",
+ ip_file->fname,
+ ip_file->err_line_no,
+ ip_file->err_col_no);
+ }
+#line 2093 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 20:
+#line 405 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ peer_node *my_node;
+
+ my_node = create_peer_node((yyvsp[-2].Integer), (yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
+ APPEND_G_FIFO(cfgt.peers, my_node);
+ }
+#line 2104 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 27:
+#line 424 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Address_node) = create_address_node((yyvsp[0].String), (yyvsp[-1].Integer)); }
+#line 2110 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 28:
+#line 429 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Address_node) = create_address_node((yyvsp[0].String), AF_UNSPEC); }
+#line 2116 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 29:
+#line 434 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Integer) = AF_INET; }
+#line 2122 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 30:
+#line 436 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Integer) = AF_INET6; }
+#line 2128 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 31:
+#line 441 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val_fifo) = NULL; }
+#line 2134 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 32:
+#line 443 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2143 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 36:
+#line 457 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
+#line 2149 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 45:
+#line 473 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2155 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 46:
+#line 475 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_uval((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2161 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 53:
+#line 489 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2167 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 55:
+#line 503 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ unpeer_node *my_node;
+
+ my_node = create_unpeer_node((yyvsp[0].Address_node));
+ if (my_node)
+ APPEND_G_FIFO(cfgt.unpeers, my_node);
+ }
+#line 2179 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 58:
+#line 524 "ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.broadcastclient = 1; }
+#line 2185 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 59:
+#line 526 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[0].Address_fifo)); }
+#line 2191 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 60:
+#line 528 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[0].Address_fifo)); }
+#line 2197 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 61:
+#line 539 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ attr_val *atrv;
+
+ atrv = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
+ APPEND_G_FIFO(cfgt.vars, atrv);
+ }
+#line 2208 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 62:
+#line 546 "ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.control_key = (yyvsp[0].Integer); }
+#line 2214 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 63:
+#line 548 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ cfgt.auth.cryptosw++;
+ CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[0].Attr_val_fifo));
+ }
+#line 2223 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 64:
+#line 553 "ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.keys = (yyvsp[0].String); }
+#line 2229 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 65:
+#line 555 "ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.keysdir = (yyvsp[0].String); }
+#line 2235 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 66:
+#line 557 "ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.request_key = (yyvsp[0].Integer); }
+#line 2241 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 67:
+#line 559 "ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.revoke = (yyvsp[0].Integer); }
+#line 2247 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 68:
+#line 561 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ 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 2260 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 69:
+#line 570 "ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.ntp_signd_socket = (yyvsp[0].String); }
+#line 2266 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 70:
+#line 575 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val_fifo) = NULL; }
+#line 2272 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 71:
+#line 577 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2281 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 72:
+#line 585 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2287 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 73:
+#line 587 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val) = NULL;
+ 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 2300 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 79:
+#line 612 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[0].Attr_val_fifo)); }
+#line 2306 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 80:
+#line 617 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2315 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 81:
+#line 622 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2324 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 82:
+#line 630 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
+#line 2330 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 83:
+#line 632 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
+#line 2336 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 84:
+#line 634 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
+#line 2342 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 95:
+#line 660 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[0].Int_fifo)); }
+#line 2348 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 96:
+#line 662 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ if (input_from_file) {
+ cfgt.stats_dir = (yyvsp[0].String);
+ } else {
+ YYFREE((yyvsp[0].String));
+ yyerror(ip_file, "statsdir remote configuration ignored");
+ }
+ }
+#line 2361 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 97:
+#line 671 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ filegen_node *fgn;
+
+ fgn = create_filegen_node((yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo));
+ APPEND_G_FIFO(cfgt.filegen_opts, fgn);
+ }
+#line 2372 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 98:
+#line 681 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ }
+#line 2381 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 99:
+#line 686 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Int_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ }
+#line 2390 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 108:
+#line 705 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val_fifo) = NULL; }
+#line 2396 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 109:
+#line 707 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2405 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 110:
+#line 715 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ if (input_from_file) {
+ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
+ } else {
+ (yyval.Attr_val) = NULL;
+ YYFREE((yyvsp[0].String));
+ yyerror(ip_file, "filegen file remote config ignored");
+ }
+ }
+#line 2419 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 111:
+#line 725 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ if (input_from_file) {
+ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
+ } else {
+ (yyval.Attr_val) = NULL;
+ yyerror(ip_file, "filegen type remote config ignored");
+ }
+ }
+#line 2432 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 112:
+#line 734 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ const char *err;
+
+ if (input_from_file) {
+ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer));
+ } else {
+ (yyval.Attr_val) = NULL;
+ if (T_Link == (yyvsp[0].Integer))
+ err = "filegen link remote config ignored";
+ else
+ err = "filegen nolink remote config ignored";
+ yyerror(ip_file, err);
+ }
+ }
+#line 2451 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 113:
+#line 749 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
+#line 2457 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 125:
+#line 779 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[0].Attr_val_fifo));
+ }
+#line 2465 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 126:
+#line 783 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[0].Attr_val_fifo));
+ }
+#line 2473 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 127:
+#line 787 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node((yyvsp[-1].Address_node), NULL, (yyvsp[0].Int_fifo),
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+#line 2485 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 128:
+#line 795 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node((yyvsp[-3].Address_node), (yyvsp[-1].Address_node), (yyvsp[0].Int_fifo),
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+#line 2497 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 129:
+#line 803 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node(NULL, NULL, (yyvsp[0].Int_fifo),
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+#line 2509 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 130:
+#line 811 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node(
+ create_address_node(
+ estrdup("0.0.0.0"),
+ AF_INET),
+ create_address_node(
+ estrdup("0.0.0.0"),
+ AF_INET),
+ (yyvsp[0].Int_fifo),
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+#line 2528 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 131:
+#line 826 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node(
+ create_address_node(
+ estrdup("::"),
+ AF_INET6),
+ create_address_node(
+ estrdup("::"),
+ AF_INET6),
+ (yyvsp[0].Int_fifo),
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+#line 2547 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 132:
+#line 841 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ restrict_node * rn;
+
+ APPEND_G_FIFO((yyvsp[0].Int_fifo), create_int_node((yyvsp[-1].Integer)));
+ rn = create_restrict_node(
+ NULL, NULL, (yyvsp[0].Int_fifo), ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+#line 2560 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 133:
+#line 853 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Int_fifo) = NULL; }
+#line 2566 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 134:
+#line 855 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ }
+#line 2575 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 150:
+#line 881 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2584 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 151:
+#line 886 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2593 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 152:
+#line 894 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2599 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 156:
+#line 905 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2608 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 157:
+#line 910 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2617 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 158:
+#line 918 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2623 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 167:
+#line 938 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ addr_opts_node *aon;
+
+ aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
+ APPEND_G_FIFO(cfgt.fudge, aon);
+ }
+#line 2634 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 168:
+#line 948 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2643 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 169:
+#line 953 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2652 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 170:
+#line 961 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
+#line 2658 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 171:
+#line 963 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2664 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 172:
+#line 965 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2670 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 173:
+#line 967 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2676 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 174:
+#line 969 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2682 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 181:
+#line 990 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[0].Attr_val_fifo)); }
+#line 2688 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 182:
+#line 995 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2697 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 183:
+#line 1000 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2706 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 184:
+#line 1008 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2712 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 188:
+#line 1024 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[0].Attr_val_fifo)); }
+#line 2718 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 189:
+#line 1026 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[0].Attr_val_fifo)); }
+#line 2724 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 190:
+#line 1031 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2733 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 191:
+#line 1036 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2742 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 192:
+#line 1044 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
+#line 2748 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 193:
+#line 1046 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ if (input_from_file) {
+ (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[0].Integer)));
+ yyerror(ip_file, err_str);
+ }
+ }
+#line 2766 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 202:
+#line 1081 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[0].Attr_val_fifo)); }
+#line 2772 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 203:
+#line 1086 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2781 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 204:
+#line 1091 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2790 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 205:
+#line 1099 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
+#line 2796 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 216:
+#line 1122 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ attr_val *av;
+
+ av = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double));
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+#line 2807 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 217:
+#line 1129 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ attr_val *av;
+
+ av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+#line 2818 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 218:
+#line 1136 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ char error_text[64];
+ attr_val *av;
+
+ if (input_from_file) {
+ av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
+ APPEND_G_FIFO(cfgt.vars, av);
+ } else {
+ YYFREE((yyvsp[0].String));
+ snprintf(error_text, sizeof(error_text),
+ "%s remote config ignored",
+ keyword((yyvsp[-1].Integer)));
+ yyerror(ip_file, error_text);
+ }
+ }
+#line 2838 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 219:
+#line 1152 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ if (!input_from_file) {
+ yyerror(ip_file, "remote includefile ignored");
+ break;
+ }
+ if (curr_include_level >= MAXINCLUDELEVEL) {
+ fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
+ msyslog(LOG_ERR, "getconfig: Maximum include file level exceeded.");
+ } else {
+ fp[curr_include_level + 1] = F_OPEN(FindConfig((yyvsp[-1].String)), "r");
+ if (fp[curr_include_level + 1] == NULL) {
+ fprintf(stderr, "getconfig: Couldn't open <%s>\n", FindConfig((yyvsp[-1].String)));
+ msyslog(LOG_ERR, "getconfig: Couldn't open <%s>", FindConfig((yyvsp[-1].String)));
+ } else {
+ ip_file = fp[++curr_include_level];
+ }
+ }
+ }
+#line 2861 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 220:
+#line 1171 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ while (curr_include_level != -1)
+ FCLOSE(fp[curr_include_level--]);
+ }
+#line 2870 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 221:
+#line 1176 "ntp_parser.y" /* yacc.c:1646 */
+ { /* see drift_parm below for actions */ }
+#line 2876 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 222:
+#line 1178 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[0].Attr_val_fifo)); }
+#line 2882 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 223:
+#line 1180 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[0].String_fifo)); }
+#line 2888 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 224:
+#line 1182 "ntp_parser.y" /* yacc.c:1646 */
+ { APPEND_G_FIFO(cfgt.setvar, (yyvsp[0].Set_var)); }
+#line 2894 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 225:
+#line 1184 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ addr_opts_node *aon;
+
+ aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
+ APPEND_G_FIFO(cfgt.trap, aon);
+ }
+#line 2905 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 226:
+#line 1191 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[0].Attr_val_fifo)); }
+#line 2911 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 235:
+#line 1213 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ attr_val *av;
+
+ av = create_attr_sval(T_Driftfile, (yyvsp[0].String));
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+#line 2922 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 236:
+#line 1220 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ 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);
+ }
+#line 2935 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 237:
+#line 1229 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ attr_val *av;
+
+ av = create_attr_sval(T_Driftfile, "");
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+#line 2946 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 238:
+#line 1239 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Set_var) = create_setvar_node((yyvsp[-3].String), (yyvsp[-1].String), (yyvsp[0].Integer)); }
+#line 2952 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 240:
+#line 1245 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Integer) = 0; }
+#line 2958 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 241:
+#line 1250 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val_fifo) = NULL; }
+#line 2964 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 242:
+#line 1252 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2973 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 243:
+#line 1260 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2979 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 244:
+#line 1262 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), estrdup((yyvsp[0].Address_node)->address));
+ destroy_address_node((yyvsp[0].Address_node));
+ }
+#line 2988 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 245:
+#line 1270 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 2997 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 246:
+#line 1275 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 3006 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 247:
+#line 1283 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ char prefix;
+ char * type;
+
+ switch ((yyvsp[0].String)[0]) {
+
+ case '+':
+ case '-':
+ case '=':
+ prefix = (yyvsp[0].String)[0];
+ type = (yyvsp[0].String) + 1;
+ break;
+
+ default:
+ prefix = '=';
+ type = (yyvsp[0].String);
+ }
+
+ (yyval.Attr_val) = create_attr_sval(prefix, estrdup(type));
+ YYFREE((yyvsp[0].String));
+ }
+#line 3032 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 248:
+#line 1308 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ nic_rule_node *nrn;
+
+ nrn = create_nic_rule_node((yyvsp[0].Integer), NULL, (yyvsp[-1].Integer));
+ APPEND_G_FIFO(cfgt.nic_rules, nrn);
+ }
+#line 3043 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 249:
+#line 1315 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ nic_rule_node *nrn;
+
+ nrn = create_nic_rule_node(0, (yyvsp[0].String), (yyvsp[-1].Integer));
+ APPEND_G_FIFO(cfgt.nic_rules, nrn);
+ }
+#line 3054 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 259:
+#line 1343 "ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[0].Int_fifo)); }
+#line 3060 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 260:
+#line 1348 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ }
+#line 3069 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 261:
+#line 1353 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Int_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
+ }
+#line 3078 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 269:
+#line 1377 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
+ }
+#line 3087 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 270:
+#line 1382 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
+ }
+#line 3096 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 271:
+#line 1390 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 3105 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 272:
+#line 1395 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
+ }
+#line 3114 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 273:
+#line 1403 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[0].Integer)); }
+#line 3120 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 275:
+#line 1409 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); }
+#line 3126 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 276:
+#line 1414 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.String_fifo) = (yyvsp[-1].String_fifo);
+ APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
+ }
+#line 3135 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 277:
+#line 1419 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.String_fifo) = NULL;
+ APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
+ }
+#line 3144 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 278:
+#line 1427 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Address_fifo) = (yyvsp[-1].Address_fifo);
+ APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
+ }
+#line 3153 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 279:
+#line 1432 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Address_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
+ }
+#line 3162 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 280:
+#line 1440 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ if ((yyvsp[0].Integer) != 0 && (yyvsp[0].Integer) != 1) {
+ yyerror(ip_file, "Integer value is not boolean (0 or 1). Assuming 1");
+ (yyval.Integer) = 1;
+ } else {
+ (yyval.Integer) = (yyvsp[0].Integer);
+ }
+ }
+#line 3175 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 281:
+#line 1448 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Integer) = 1; }
+#line 3181 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 282:
+#line 1449 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Integer) = 0; }
+#line 3187 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 283:
+#line 1453 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Double) = (double)(yyvsp[0].Integer); }
+#line 3193 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 285:
+#line 1464 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ sim_node *sn;
+
+ 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 3207 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 286:
+#line 1481 "ntp_parser.y" /* yacc.c:1646 */
+ { old_config_style = 0; }
+#line 3213 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 287:
+#line 1486 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ }
+#line 3222 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 288:
+#line 1491 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ }
+#line 3231 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 289:
+#line 1499 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
+#line 3237 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 292:
+#line 1509 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Sim_server_fifo) = (yyvsp[-1].Sim_server_fifo);
+ APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
+ }
+#line 3246 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 293:
+#line 1514 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Sim_server_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
+ }
+#line 3255 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 294:
+#line 1522 "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 3261 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 295:
+#line 1527 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Double) = (yyvsp[-1].Double); }
+#line 3267 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 296:
+#line 1532 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Address_node) = (yyvsp[0].Address_node); }
+#line 3273 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 297:
+#line 1537 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Sim_script_fifo) = (yyvsp[-1].Sim_script_fifo);
+ APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
+ }
+#line 3282 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 298:
+#line 1542 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Sim_script_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
+ }
+#line 3291 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 299:
+#line 1550 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[-3].Double), (yyvsp[-1].Attr_val_fifo))); }
+#line 3297 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 300:
+#line 1555 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ }
+#line 3306 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 301:
+#line 1560 "ntp_parser.y" /* yacc.c:1646 */
+ {
+ (yyval.Attr_val_fifo) = NULL;
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
+ }
+#line 3315 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+ case 302:
+#line 1568 "ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
+#line 3321 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ break;
+
+
+#line 3325 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ default: break;
+ }
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+ /* Now 'shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
+yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if ! YYERROR_VERBOSE
+ yyerror (ip_file, YY_("syntax error"));
+#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
+ {
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (ip_file, yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
+ }
+# undef YYSYNTAX_ERROR
+#endif
+ }
+
+
+
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ if (yychar <= YYEOF)
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
+ else
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval, ip_file);
+ yychar = YYEMPTY;
+ }
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
+ goto yyerrorlab;
+
+ /* Do not reclaim the symbols of the rule whose action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+yyerrlab1:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (!yypact_value_is_default (yyn))
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
+
+
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp, ip_file);
+ YYPOPSTACK (1);
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
+ }
+
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#if !defined yyoverflow || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here. |
+`-------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (ip_file, YY_("memory exhausted"));
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+ if (yychar != YYEMPTY)
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, ip_file);
+ }
+ /* 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, ip_file);
+ YYPOPSTACK (1);
+ }
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ return yyresult;
+}
+#line 1579 "ntp_parser.y" /* yacc.c:1906 */
+
+
+void
+yyerror(
+ struct FILE_INFO *ip_file,
+ const char *msg
+ )
+{
+ int retval;
+
+ ip_file->err_line_no = ip_file->prev_token_line_no;
+ ip_file->err_col_no = ip_file->prev_token_col_no;
+
+ msyslog(LOG_ERR,
+ "line %d column %d %s",
+ ip_file->err_line_no,
+ ip_file->err_col_no,
+ msg);
+ if (!input_from_file) {
+ /* Save the error message in the correct buffer */
+ retval = snprintf(remote_config.err_msg + remote_config.err_pos,
+ MAXLINE - remote_config.err_pos,
+ "column %d %s",
+ ip_file->err_col_no, msg);
+
+ /* Increment the value of err_pos */
+ if (retval > 0)
+ remote_config.err_pos += retval;
+
+ /* Increment the number of errors */
+ ++remote_config.no_errors;
+ }
+}
+
+
+/*
+ * token_name - convert T_ token integers to text
+ * example: token_name(T_Server) returns "T_Server"
+ */
+const char *
+token_name(
+ int token
+ )
+{
+ return yytname[YYTRANSLATE(token)];
+}
+
+
+/* Initial Testing function -- ignore */
+#if 0
+int main(int argc, char *argv[])
+{
+ ip_file = FOPEN(argv[1], "r");
+ if (!ip_file)
+ fprintf(stderr, "ERROR!! Could not open file: %s\n", argv[1]);
+ yyparse();
+ return 0;
+}
+#endif
+
diff --git a/ntpd/ntp_parser.h b/ntpd/ntp_parser.h
new file mode 100644
index 0000000..c830157
--- /dev/null
+++ b/ntpd/ntp_parser.h
@@ -0,0 +1,459 @@
+/* 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.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+#ifndef YY_YY_______NTPD_NTP_PARSER_H_INCLUDED
+# define YY_YY_______NTPD_NTP_PARSER_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ 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_Ellipsis = 290,
+ T_Enable = 291,
+ T_End = 292,
+ T_False = 293,
+ T_File = 294,
+ T_Filegen = 295,
+ T_Filenum = 296,
+ T_Flag1 = 297,
+ T_Flag2 = 298,
+ T_Flag3 = 299,
+ T_Flag4 = 300,
+ T_Flake = 301,
+ T_Floor = 302,
+ T_Freq = 303,
+ T_Fudge = 304,
+ T_Host = 305,
+ T_Huffpuff = 306,
+ T_Iburst = 307,
+ T_Ident = 308,
+ T_Ignore = 309,
+ T_Incalloc = 310,
+ T_Incmem = 311,
+ T_Initalloc = 312,
+ T_Initmem = 313,
+ T_Includefile = 314,
+ T_Integer = 315,
+ T_Interface = 316,
+ T_Intrange = 317,
+ T_Io = 318,
+ T_Ipv4 = 319,
+ T_Ipv4_flag = 320,
+ T_Ipv6 = 321,
+ T_Ipv6_flag = 322,
+ T_Kernel = 323,
+ T_Key = 324,
+ T_Keys = 325,
+ T_Keysdir = 326,
+ T_Kod = 327,
+ T_Mssntp = 328,
+ T_Leapfile = 329,
+ T_Limited = 330,
+ T_Link = 331,
+ T_Listen = 332,
+ T_Logconfig = 333,
+ T_Logfile = 334,
+ T_Loopstats = 335,
+ T_Lowpriotrap = 336,
+ T_Manycastclient = 337,
+ T_Manycastserver = 338,
+ T_Mask = 339,
+ T_Maxage = 340,
+ T_Maxclock = 341,
+ T_Maxdepth = 342,
+ T_Maxdist = 343,
+ T_Maxmem = 344,
+ T_Maxpoll = 345,
+ T_Mem = 346,
+ T_Memlock = 347,
+ T_Minclock = 348,
+ T_Mindepth = 349,
+ T_Mindist = 350,
+ T_Minimum = 351,
+ T_Minpoll = 352,
+ T_Minsane = 353,
+ T_Mode = 354,
+ T_Mode7 = 355,
+ T_Monitor = 356,
+ T_Month = 357,
+ T_Mru = 358,
+ T_Multicastclient = 359,
+ T_Nic = 360,
+ T_Nolink = 361,
+ T_Nomodify = 362,
+ T_Nomrulist = 363,
+ T_None = 364,
+ T_Nonvolatile = 365,
+ T_Nopeer = 366,
+ T_Noquery = 367,
+ T_Noselect = 368,
+ T_Noserve = 369,
+ T_Notrap = 370,
+ T_Notrust = 371,
+ T_Ntp = 372,
+ T_Ntpport = 373,
+ T_NtpSignDsocket = 374,
+ T_Orphan = 375,
+ T_Orphanwait = 376,
+ T_Panic = 377,
+ T_Peer = 378,
+ T_Peerstats = 379,
+ T_Phone = 380,
+ T_Pid = 381,
+ T_Pidfile = 382,
+ T_Pool = 383,
+ T_Port = 384,
+ T_Preempt = 385,
+ T_Prefer = 386,
+ T_Protostats = 387,
+ T_Pw = 388,
+ T_Randfile = 389,
+ T_Rawstats = 390,
+ T_Refid = 391,
+ T_Requestkey = 392,
+ T_Reset = 393,
+ T_Restrict = 394,
+ T_Revoke = 395,
+ T_Rlimit = 396,
+ T_Saveconfigdir = 397,
+ T_Server = 398,
+ T_Setvar = 399,
+ T_Source = 400,
+ T_Stacksize = 401,
+ T_Statistics = 402,
+ T_Stats = 403,
+ T_Statsdir = 404,
+ T_Step = 405,
+ T_Stepout = 406,
+ T_Stratum = 407,
+ T_String = 408,
+ T_Sys = 409,
+ T_Sysstats = 410,
+ T_Tick = 411,
+ T_Time1 = 412,
+ T_Time2 = 413,
+ T_Timer = 414,
+ T_Timingstats = 415,
+ T_Tinker = 416,
+ T_Tos = 417,
+ T_Trap = 418,
+ T_True = 419,
+ T_Trustedkey = 420,
+ T_Ttl = 421,
+ T_Type = 422,
+ T_U_int = 423,
+ T_Unconfig = 424,
+ T_Unpeer = 425,
+ T_Version = 426,
+ T_WanderThreshold = 427,
+ T_Week = 428,
+ T_Wildcard = 429,
+ T_Xleave = 430,
+ T_Year = 431,
+ T_Flag = 432,
+ T_EOC = 433,
+ T_Simulate = 434,
+ T_Beep_Delay = 435,
+ T_Sim_Duration = 436,
+ T_Server_Offset = 437,
+ T_Duration = 438,
+ T_Freq_Offset = 439,
+ T_Wander = 440,
+ T_Jitter = 441,
+ T_Prop_Delay = 442,
+ T_Proc_Delay = 443
+ };
+#endif
+/* Tokens. */
+#define T_Abbrev 258
+#define T_Age 259
+#define T_All 260
+#define T_Allan 261
+#define T_Allpeers 262
+#define T_Auth 263
+#define T_Autokey 264
+#define T_Automax 265
+#define T_Average 266
+#define T_Bclient 267
+#define T_Beacon 268
+#define T_Broadcast 269
+#define T_Broadcastclient 270
+#define T_Broadcastdelay 271
+#define T_Burst 272
+#define T_Calibrate 273
+#define T_Ceiling 274
+#define T_Clockstats 275
+#define T_Cohort 276
+#define T_ControlKey 277
+#define T_Crypto 278
+#define T_Cryptostats 279
+#define T_Ctl 280
+#define T_Day 281
+#define T_Default 282
+#define T_Digest 283
+#define T_Disable 284
+#define T_Discard 285
+#define T_Dispersion 286
+#define T_Double 287
+#define T_Driftfile 288
+#define T_Drop 289
+#define T_Ellipsis 290
+#define T_Enable 291
+#define T_End 292
+#define T_False 293
+#define T_File 294
+#define T_Filegen 295
+#define T_Filenum 296
+#define T_Flag1 297
+#define T_Flag2 298
+#define T_Flag3 299
+#define T_Flag4 300
+#define T_Flake 301
+#define T_Floor 302
+#define T_Freq 303
+#define T_Fudge 304
+#define T_Host 305
+#define T_Huffpuff 306
+#define T_Iburst 307
+#define T_Ident 308
+#define T_Ignore 309
+#define T_Incalloc 310
+#define T_Incmem 311
+#define T_Initalloc 312
+#define T_Initmem 313
+#define T_Includefile 314
+#define T_Integer 315
+#define T_Interface 316
+#define T_Intrange 317
+#define T_Io 318
+#define T_Ipv4 319
+#define T_Ipv4_flag 320
+#define T_Ipv6 321
+#define T_Ipv6_flag 322
+#define T_Kernel 323
+#define T_Key 324
+#define T_Keys 325
+#define T_Keysdir 326
+#define T_Kod 327
+#define T_Mssntp 328
+#define T_Leapfile 329
+#define T_Limited 330
+#define T_Link 331
+#define T_Listen 332
+#define T_Logconfig 333
+#define T_Logfile 334
+#define T_Loopstats 335
+#define T_Lowpriotrap 336
+#define T_Manycastclient 337
+#define T_Manycastserver 338
+#define T_Mask 339
+#define T_Maxage 340
+#define T_Maxclock 341
+#define T_Maxdepth 342
+#define T_Maxdist 343
+#define T_Maxmem 344
+#define T_Maxpoll 345
+#define T_Mem 346
+#define T_Memlock 347
+#define T_Minclock 348
+#define T_Mindepth 349
+#define T_Mindist 350
+#define T_Minimum 351
+#define T_Minpoll 352
+#define T_Minsane 353
+#define T_Mode 354
+#define T_Mode7 355
+#define T_Monitor 356
+#define T_Month 357
+#define T_Mru 358
+#define T_Multicastclient 359
+#define T_Nic 360
+#define T_Nolink 361
+#define T_Nomodify 362
+#define T_Nomrulist 363
+#define T_None 364
+#define T_Nonvolatile 365
+#define T_Nopeer 366
+#define T_Noquery 367
+#define T_Noselect 368
+#define T_Noserve 369
+#define T_Notrap 370
+#define T_Notrust 371
+#define T_Ntp 372
+#define T_Ntpport 373
+#define T_NtpSignDsocket 374
+#define T_Orphan 375
+#define T_Orphanwait 376
+#define T_Panic 377
+#define T_Peer 378
+#define T_Peerstats 379
+#define T_Phone 380
+#define T_Pid 381
+#define T_Pidfile 382
+#define T_Pool 383
+#define T_Port 384
+#define T_Preempt 385
+#define T_Prefer 386
+#define T_Protostats 387
+#define T_Pw 388
+#define T_Randfile 389
+#define T_Rawstats 390
+#define T_Refid 391
+#define T_Requestkey 392
+#define T_Reset 393
+#define T_Restrict 394
+#define T_Revoke 395
+#define T_Rlimit 396
+#define T_Saveconfigdir 397
+#define T_Server 398
+#define T_Setvar 399
+#define T_Source 400
+#define T_Stacksize 401
+#define T_Statistics 402
+#define T_Stats 403
+#define T_Statsdir 404
+#define T_Step 405
+#define T_Stepout 406
+#define T_Stratum 407
+#define T_String 408
+#define T_Sys 409
+#define T_Sysstats 410
+#define T_Tick 411
+#define T_Time1 412
+#define T_Time2 413
+#define T_Timer 414
+#define T_Timingstats 415
+#define T_Tinker 416
+#define T_Tos 417
+#define T_Trap 418
+#define T_True 419
+#define T_Trustedkey 420
+#define T_Ttl 421
+#define T_Type 422
+#define T_U_int 423
+#define T_Unconfig 424
+#define T_Unpeer 425
+#define T_Version 426
+#define T_WanderThreshold 427
+#define T_Week 428
+#define T_Wildcard 429
+#define T_Xleave 430
+#define T_Year 431
+#define T_Flag 432
+#define T_EOC 433
+#define T_Simulate 434
+#define T_Beep_Delay 435
+#define T_Sim_Duration 436
+#define T_Server_Offset 437
+#define T_Duration 438
+#define T_Freq_Offset 439
+#define T_Wander 440
+#define T_Jitter 441
+#define T_Prop_Delay 442
+#define T_Proc_Delay 443
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+#line 54 "ntp_parser.y" /* yacc.c:1909 */
+
+ char * String;
+ double Double;
+ int Integer;
+ unsigned U_int;
+ gen_fifo * Generic_fifo;
+ attr_val * Attr_val;
+ attr_val_fifo * Attr_val_fifo;
+ int_fifo * Int_fifo;
+ string_fifo * String_fifo;
+ address_node * Address_node;
+ address_fifo * Address_fifo;
+ setvar_node * Set_var;
+ server_info * Sim_server;
+ server_info_fifo * Sim_server_fifo;
+ script_info * Sim_script;
+ script_info_fifo * Sim_script_fifo;
+
+#line 449 "../../ntpd/ntp_parser.h" /* yacc.c:1909 */
+};
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+extern YYSTYPE yylval;
+
+int yyparse (struct FILE_INFO *ip_file);
+
+#endif /* !YY_YY_______NTPD_NTP_PARSER_H_INCLUDED */
diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y
new file mode 100644
index 0000000..e75bffe
--- /dev/null
+++ b/ntpd/ntp_parser.y
@@ -0,0 +1,1638 @@
+/* ntp_parser.y
+ *
+ * The parser for the NTP configuration file.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Copyright (c) 2006
+ */
+
+%parse-param {struct FILE_INFO *ip_file}
+%lex-param {struct FILE_INFO *ip_file}
+
+%{
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+ #include "ntp.h"
+ #include "ntpd.h"
+ #include "ntp_machine.h"
+ #include "ntp_stdlib.h"
+ #include "ntp_filegen.h"
+ #include "ntp_scanner.h"
+ #include "ntp_config.h"
+ #include "ntp_crypto.h"
+
+ #include "ntpsim.h" /* HMS: Do we really want this all the time? */
+ /* SK: It might be a good idea to always
+ include the simulator code. That way
+ someone can use the same configuration file
+ for both the simulator and the daemon
+ */
+
+ #define YYMALLOC emalloc
+ #define YYFREE free
+ #define YYERROR_VERBOSE
+ #define YYMAXDEPTH 1000 /* stop the madness sooner */
+ void yyerror(struct FILE_INFO *ip_file, const char *msg);
+
+ #ifdef SIM
+ # define ONLY_SIM(a) (a)
+ #else
+ # define ONLY_SIM(a) NULL
+ #endif
+%}
+
+/*
+ * Enable generation of token names array even without YYDEBUG.
+ * We access via token_name() defined below.
+ */
+%token-table
+
+%union {
+ char * String;
+ double Double;
+ int Integer;
+ unsigned U_int;
+ gen_fifo * Generic_fifo;
+ attr_val * Attr_val;
+ attr_val_fifo * Attr_val_fifo;
+ int_fifo * Int_fifo;
+ string_fifo * String_fifo;
+ address_node * Address_node;
+ address_fifo * Address_fifo;
+ setvar_node * Set_var;
+ server_info * Sim_server;
+ server_info_fifo * Sim_server_fifo;
+ script_info * Sim_script;
+ script_info_fifo * Sim_script_fifo;
+}
+
+/* TERMINALS (do not appear left of colon) */
+%token <Integer> T_Abbrev
+%token <Integer> T_Age
+%token <Integer> T_All
+%token <Integer> T_Allan
+%token <Integer> T_Allpeers
+%token <Integer> T_Auth
+%token <Integer> T_Autokey
+%token <Integer> T_Automax
+%token <Integer> T_Average
+%token <Integer> T_Bclient
+%token <Integer> T_Beacon
+%token <Integer> T_Broadcast
+%token <Integer> T_Broadcastclient
+%token <Integer> T_Broadcastdelay
+%token <Integer> T_Burst
+%token <Integer> T_Calibrate
+%token <Integer> T_Ceiling
+%token <Integer> T_Clockstats
+%token <Integer> T_Cohort
+%token <Integer> T_ControlKey
+%token <Integer> T_Crypto
+%token <Integer> T_Cryptostats
+%token <Integer> T_Ctl
+%token <Integer> T_Day
+%token <Integer> T_Default
+%token <Integer> T_Digest
+%token <Integer> T_Disable
+%token <Integer> T_Discard
+%token <Integer> T_Dispersion
+%token <Double> T_Double /* not a token */
+%token <Integer> T_Driftfile
+%token <Integer> T_Drop
+%token <Integer> T_Ellipsis /* "..." not "ellipsis" */
+%token <Integer> T_Enable
+%token <Integer> T_End
+%token <Integer> T_False
+%token <Integer> T_File
+%token <Integer> T_Filegen
+%token <Integer> T_Filenum
+%token <Integer> T_Flag1
+%token <Integer> T_Flag2
+%token <Integer> T_Flag3
+%token <Integer> T_Flag4
+%token <Integer> T_Flake
+%token <Integer> T_Floor
+%token <Integer> T_Freq
+%token <Integer> T_Fudge
+%token <Integer> T_Host
+%token <Integer> T_Huffpuff
+%token <Integer> T_Iburst
+%token <Integer> T_Ident
+%token <Integer> T_Ignore
+%token <Integer> T_Incalloc
+%token <Integer> T_Incmem
+%token <Integer> T_Initalloc
+%token <Integer> T_Initmem
+%token <Integer> T_Includefile
+%token <Integer> T_Integer /* not a token */
+%token <Integer> T_Interface
+%token <Integer> T_Intrange /* not a token */
+%token <Integer> T_Io
+%token <Integer> T_Ipv4
+%token <Integer> T_Ipv4_flag
+%token <Integer> T_Ipv6
+%token <Integer> T_Ipv6_flag
+%token <Integer> T_Kernel
+%token <Integer> T_Key
+%token <Integer> T_Keys
+%token <Integer> T_Keysdir
+%token <Integer> T_Kod
+%token <Integer> T_Mssntp
+%token <Integer> T_Leapfile
+%token <Integer> T_Limited
+%token <Integer> T_Link
+%token <Integer> T_Listen
+%token <Integer> T_Logconfig
+%token <Integer> T_Logfile
+%token <Integer> T_Loopstats
+%token <Integer> T_Lowpriotrap
+%token <Integer> T_Manycastclient
+%token <Integer> T_Manycastserver
+%token <Integer> T_Mask
+%token <Integer> T_Maxage
+%token <Integer> T_Maxclock
+%token <Integer> T_Maxdepth
+%token <Integer> T_Maxdist
+%token <Integer> T_Maxmem
+%token <Integer> T_Maxpoll
+%token <Integer> T_Mem
+%token <Integer> T_Memlock
+%token <Integer> T_Minclock
+%token <Integer> T_Mindepth
+%token <Integer> T_Mindist
+%token <Integer> T_Minimum
+%token <Integer> T_Minpoll
+%token <Integer> T_Minsane
+%token <Integer> T_Mode
+%token <Integer> T_Mode7
+%token <Integer> T_Monitor
+%token <Integer> T_Month
+%token <Integer> T_Mru
+%token <Integer> T_Multicastclient
+%token <Integer> T_Nic
+%token <Integer> T_Nolink
+%token <Integer> T_Nomodify
+%token <Integer> T_Nomrulist
+%token <Integer> T_None
+%token <Integer> T_Nonvolatile
+%token <Integer> T_Nopeer
+%token <Integer> T_Noquery
+%token <Integer> T_Noselect
+%token <Integer> T_Noserve
+%token <Integer> T_Notrap
+%token <Integer> T_Notrust
+%token <Integer> T_Ntp
+%token <Integer> T_Ntpport
+%token <Integer> T_NtpSignDsocket
+%token <Integer> T_Orphan
+%token <Integer> T_Orphanwait
+%token <Integer> T_Panic
+%token <Integer> T_Peer
+%token <Integer> T_Peerstats
+%token <Integer> T_Phone
+%token <Integer> T_Pid
+%token <Integer> T_Pidfile
+%token <Integer> T_Pool
+%token <Integer> T_Port
+%token <Integer> T_Preempt
+%token <Integer> T_Prefer
+%token <Integer> T_Protostats
+%token <Integer> T_Pw
+%token <Integer> T_Randfile
+%token <Integer> T_Rawstats
+%token <Integer> T_Refid
+%token <Integer> T_Requestkey
+%token <Integer> T_Reset
+%token <Integer> T_Restrict
+%token <Integer> T_Revoke
+%token <Integer> T_Rlimit
+%token <Integer> T_Saveconfigdir
+%token <Integer> T_Server
+%token <Integer> T_Setvar
+%token <Integer> T_Source
+%token <Integer> T_Stacksize
+%token <Integer> T_Statistics
+%token <Integer> T_Stats
+%token <Integer> T_Statsdir
+%token <Integer> T_Step
+%token <Integer> T_Stepout
+%token <Integer> T_Stratum
+%token <String> T_String /* not a token */
+%token <Integer> T_Sys
+%token <Integer> T_Sysstats
+%token <Integer> T_Tick
+%token <Integer> T_Time1
+%token <Integer> T_Time2
+%token <Integer> T_Timer
+%token <Integer> T_Timingstats
+%token <Integer> T_Tinker
+%token <Integer> T_Tos
+%token <Integer> T_Trap
+%token <Integer> T_True
+%token <Integer> T_Trustedkey
+%token <Integer> T_Ttl
+%token <Integer> T_Type
+%token <Integer> T_U_int /* Not a token */
+%token <Integer> T_Unconfig
+%token <Integer> T_Unpeer
+%token <Integer> T_Version
+%token <Integer> T_WanderThreshold /* Not a token */
+%token <Integer> T_Week
+%token <Integer> T_Wildcard
+%token <Integer> T_Xleave
+%token <Integer> T_Year
+%token <Integer> T_Flag /* Not a token */
+%token <Integer> T_EOC
+
+
+/* NTP Simulator Tokens */
+%token <Integer> T_Simulate
+%token <Integer> T_Beep_Delay
+%token <Integer> T_Sim_Duration
+%token <Integer> T_Server_Offset
+%token <Integer> T_Duration
+%token <Integer> T_Freq_Offset
+%token <Integer> T_Wander
+%token <Integer> T_Jitter
+%token <Integer> T_Prop_Delay
+%token <Integer> T_Proc_Delay
+
+
+
+/*** NON-TERMINALS ***/
+%type <Integer> access_control_flag
+%type <Int_fifo> ac_flag_list
+%type <Address_node> address
+%type <Integer> address_fam
+%type <Address_fifo> address_list
+%type <Integer> boolean
+%type <Integer> client_type
+%type <Integer> counter_set_keyword
+%type <Int_fifo> counter_set_list
+%type <Attr_val> crypto_command
+%type <Attr_val_fifo> crypto_command_list
+%type <Integer> crypto_str_keyword
+%type <Attr_val> discard_option
+%type <Integer> discard_option_keyword
+%type <Attr_val_fifo> discard_option_list
+%type <Integer> enable_disable
+%type <Attr_val> filegen_option
+%type <Attr_val_fifo> filegen_option_list
+%type <Integer> filegen_type
+%type <Attr_val> fudge_factor
+%type <Integer> fudge_factor_bool_keyword
+%type <Integer> fudge_factor_dbl_keyword
+%type <Attr_val_fifo> fudge_factor_list
+%type <Attr_val_fifo> integer_list
+%type <Attr_val_fifo> integer_list_range
+%type <Attr_val> integer_list_range_elt
+%type <Attr_val> integer_range
+%type <Integer> nic_rule_action
+%type <Integer> interface_command
+%type <Integer> interface_nic
+%type <Address_node> ip_address
+%type <Integer> link_nolink
+%type <Attr_val> log_config_command
+%type <Attr_val_fifo> log_config_list
+%type <Integer> misc_cmd_dbl_keyword
+%type <Integer> misc_cmd_str_keyword
+%type <Integer> misc_cmd_str_lcl_keyword
+%type <Attr_val> mru_option
+%type <Integer> mru_option_keyword
+%type <Attr_val_fifo> mru_option_list
+%type <Integer> nic_rule_class
+%type <Double> number
+%type <Attr_val> option
+%type <Attr_val> option_flag
+%type <Integer> option_flag_keyword
+%type <Attr_val_fifo> option_list
+%type <Attr_val> option_int
+%type <Integer> option_int_keyword
+%type <Attr_val> option_str
+%type <Integer> option_str_keyword
+%type <Integer> reset_command
+%type <Integer> rlimit_option_keyword
+%type <Attr_val> rlimit_option
+%type <Attr_val_fifo> rlimit_option_list
+%type <Integer> stat
+%type <Int_fifo> stats_list
+%type <String_fifo> string_list
+%type <Attr_val> system_option
+%type <Integer> system_option_flag_keyword
+%type <Integer> system_option_local_flag_keyword
+%type <Attr_val_fifo> system_option_list
+%type <Integer> t_default_or_zero
+%type <Integer> tinker_option_keyword
+%type <Attr_val> tinker_option
+%type <Attr_val_fifo> tinker_option_list
+%type <Attr_val> tos_option
+%type <Integer> tos_option_dbl_keyword
+%type <Integer> tos_option_int_keyword
+%type <Attr_val_fifo> tos_option_list
+%type <Attr_val> trap_option
+%type <Attr_val_fifo> trap_option_list
+%type <Integer> unpeer_keyword
+%type <Set_var> variable_assign
+
+/* NTP Simulator non-terminals */
+%type <Attr_val> sim_init_statement
+%type <Attr_val_fifo> sim_init_statement_list
+%type <Integer> sim_init_keyword
+%type <Sim_server_fifo> sim_server_list
+%type <Sim_server> sim_server
+%type <Double> sim_server_offset
+%type <Address_node> sim_server_name
+%type <Sim_script> sim_act
+%type <Sim_script_fifo> sim_act_list
+%type <Integer> sim_act_keyword
+%type <Attr_val_fifo> sim_act_stmt_list
+%type <Attr_val> sim_act_stmt
+
+%%
+
+/* ntp.conf
+ * Configuration File Grammar
+ * --------------------------
+ */
+
+configuration
+ : command_list
+ ;
+
+command_list
+ : command_list command T_EOC
+ | command T_EOC
+ | error T_EOC
+ {
+ /* I will need to incorporate much more fine grained
+ * error messages. The following should suffice for
+ * the time being.
+ */
+ msyslog(LOG_ERR,
+ "syntax error in %s line %d, column %d",
+ ip_file->fname,
+ ip_file->err_line_no,
+ ip_file->err_col_no);
+ }
+ ;
+
+command : /* NULL STATEMENT */
+ | server_command
+ | unpeer_command
+ | other_mode_command
+ | authentication_command
+ | monitoring_command
+ | access_control_command
+ | orphan_mode_command
+ | fudge_command
+ | rlimit_command
+ | system_option_command
+ | tinker_command
+ | miscellaneous_command
+ | simulate_command
+ ;
+
+/* Server Commands
+ * ---------------
+ */
+
+server_command
+ : client_type address option_list
+ {
+ peer_node *my_node;
+
+ my_node = create_peer_node($1, $2, $3);
+ APPEND_G_FIFO(cfgt.peers, my_node);
+ }
+ ;
+
+client_type
+ : T_Server
+ | T_Pool
+ | T_Peer
+ | T_Broadcast
+ | T_Manycastclient
+ ;
+
+address
+ : ip_address
+ | address_fam T_String
+ { $$ = create_address_node($2, $1); }
+ ;
+
+ip_address
+ : T_String
+ { $$ = create_address_node($1, AF_UNSPEC); }
+ ;
+
+address_fam
+ : T_Ipv4_flag
+ { $$ = AF_INET; }
+ | T_Ipv6_flag
+ { $$ = AF_INET6; }
+ ;
+
+option_list
+ : /* empty list */
+ { $$ = NULL; }
+ | option_list option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ ;
+
+option
+ : option_flag
+ | option_int
+ | option_str
+ ;
+
+option_flag
+ : option_flag_keyword
+ { $$ = create_attr_ival(T_Flag, $1); }
+ ;
+
+option_flag_keyword
+ : T_Autokey
+ | T_Burst
+ | T_Iburst
+ | T_Noselect
+ | T_Preempt
+ | T_Prefer
+ | T_True
+ | T_Xleave
+ ;
+
+option_int
+ : option_int_keyword T_Integer
+ { $$ = create_attr_ival($1, $2); }
+ | option_int_keyword T_U_int
+ { $$ = create_attr_uval($1, $2); }
+ ;
+
+option_int_keyword
+ : T_Key
+ | T_Minpoll
+ | T_Maxpoll
+ | T_Ttl
+ | T_Mode
+ | T_Version
+ ;
+
+option_str
+ : option_str_keyword T_String
+ { $$ = create_attr_sval($1, $2); }
+ ;
+
+option_str_keyword
+ : T_Ident
+ ;
+
+
+/* unpeer commands
+ * ---------------
+ */
+
+unpeer_command
+ : unpeer_keyword address
+ {
+ unpeer_node *my_node;
+
+ my_node = create_unpeer_node($2);
+ if (my_node)
+ APPEND_G_FIFO(cfgt.unpeers, my_node);
+ }
+ ;
+unpeer_keyword
+ : T_Unconfig
+ | T_Unpeer
+ ;
+
+
+/* Other Modes
+ * (broadcastclient manycastserver multicastclient)
+ * ------------------------------------------------
+ */
+
+other_mode_command
+ : T_Broadcastclient
+ { cfgt.broadcastclient = 1; }
+ | T_Manycastserver address_list
+ { CONCAT_G_FIFOS(cfgt.manycastserver, $2); }
+ | T_Multicastclient address_list
+ { CONCAT_G_FIFOS(cfgt.multicastclient, $2); }
+ ;
+
+
+
+/* Authentication Commands
+ * -----------------------
+ */
+
+authentication_command
+ : T_Automax T_Integer
+ {
+ attr_val *atrv;
+
+ atrv = create_attr_ival($1, $2);
+ APPEND_G_FIFO(cfgt.vars, atrv);
+ }
+ | T_ControlKey T_Integer
+ { cfgt.auth.control_key = $2; }
+ | T_Crypto crypto_command_list
+ {
+ cfgt.auth.cryptosw++;
+ CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, $2);
+ }
+ | T_Keys T_String
+ { cfgt.auth.keys = $2; }
+ | T_Keysdir T_String
+ { cfgt.auth.keysdir = $2; }
+ | T_Requestkey T_Integer
+ { cfgt.auth.request_key = $2; }
+ | T_Revoke T_Integer
+ { cfgt.auth.revoke = $2; }
+ | T_Trustedkey integer_list_range
+ {
+ cfgt.auth.trusted_key_list = $2;
+
+ // if (!cfgt.auth.trusted_key_list)
+ // cfgt.auth.trusted_key_list = $2;
+ // else
+ // LINK_SLIST(cfgt.auth.trusted_key_list, $2, link);
+ }
+ | T_NtpSignDsocket T_String
+ { cfgt.auth.ntp_signd_socket = $2; }
+ ;
+
+crypto_command_list
+ : /* empty list */
+ { $$ = NULL; }
+ | crypto_command_list crypto_command
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ ;
+
+crypto_command
+ : crypto_str_keyword T_String
+ { $$ = create_attr_sval($1, $2); }
+ | T_Revoke T_Integer
+ {
+ $$ = NULL;
+ cfgt.auth.revoke = $2;
+ msyslog(LOG_WARNING,
+ "'crypto revoke %d' is deprecated, "
+ "please use 'revoke %d' instead.",
+ cfgt.auth.revoke, cfgt.auth.revoke);
+ }
+ ;
+
+crypto_str_keyword
+ : T_Host
+ | T_Ident
+ | T_Pw
+ | T_Randfile
+ | T_Digest
+ ;
+
+
+/* Orphan Mode Commands
+ * --------------------
+ */
+
+orphan_mode_command
+ : T_Tos tos_option_list
+ { CONCAT_G_FIFOS(cfgt.orphan_cmds, $2); }
+ ;
+
+tos_option_list
+ : tos_option_list tos_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | tos_option
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+tos_option
+ : tos_option_int_keyword T_Integer
+ { $$ = create_attr_dval($1, (double)$2); }
+ | tos_option_dbl_keyword number
+ { $$ = create_attr_dval($1, $2); }
+ | T_Cohort boolean
+ { $$ = create_attr_dval($1, (double)$2); }
+ ;
+
+tos_option_int_keyword
+ : T_Ceiling
+ | T_Floor
+ | T_Orphan
+ | T_Orphanwait
+ | T_Minsane
+ | T_Beacon
+ ;
+
+tos_option_dbl_keyword
+ : T_Mindist
+ | T_Maxdist
+ | T_Minclock
+ | T_Maxclock
+ ;
+
+
+/* Monitoring Commands
+ * -------------------
+ */
+
+monitoring_command
+ : T_Statistics stats_list
+ { CONCAT_G_FIFOS(cfgt.stats_list, $2); }
+ | T_Statsdir T_String
+ {
+ if (input_from_file) {
+ cfgt.stats_dir = $2;
+ } else {
+ YYFREE($2);
+ yyerror(ip_file, "statsdir remote configuration ignored");
+ }
+ }
+ | T_Filegen stat filegen_option_list
+ {
+ filegen_node *fgn;
+
+ fgn = create_filegen_node($2, $3);
+ APPEND_G_FIFO(cfgt.filegen_opts, fgn);
+ }
+ ;
+
+stats_list
+ : stats_list stat
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, create_int_node($2));
+ }
+ | stat
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, create_int_node($1));
+ }
+ ;
+
+stat
+ : T_Clockstats
+ | T_Cryptostats
+ | T_Loopstats
+ | T_Peerstats
+ | T_Rawstats
+ | T_Sysstats
+ | T_Timingstats
+ | T_Protostats
+ ;
+
+filegen_option_list
+ : /* empty list */
+ { $$ = NULL; }
+ | filegen_option_list filegen_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ ;
+
+filegen_option
+ : T_File T_String
+ {
+ if (input_from_file) {
+ $$ = create_attr_sval($1, $2);
+ } else {
+ $$ = NULL;
+ YYFREE($2);
+ yyerror(ip_file, "filegen file remote config ignored");
+ }
+ }
+ | T_Type filegen_type
+ {
+ if (input_from_file) {
+ $$ = create_attr_ival($1, $2);
+ } else {
+ $$ = NULL;
+ yyerror(ip_file, "filegen type remote config ignored");
+ }
+ }
+ | link_nolink
+ {
+ const char *err;
+
+ if (input_from_file) {
+ $$ = create_attr_ival(T_Flag, $1);
+ } else {
+ $$ = NULL;
+ if (T_Link == $1)
+ err = "filegen link remote config ignored";
+ else
+ err = "filegen nolink remote config ignored";
+ yyerror(ip_file, err);
+ }
+ }
+ | enable_disable
+ { $$ = create_attr_ival(T_Flag, $1); }
+ ;
+
+link_nolink
+ : T_Link
+ | T_Nolink
+ ;
+
+enable_disable
+ : T_Enable
+ | T_Disable
+ ;
+
+filegen_type
+ : T_None
+ | T_Pid
+ | T_Day
+ | T_Week
+ | T_Month
+ | T_Year
+ | T_Age
+ ;
+
+
+/* Access Control Commands
+ * -----------------------
+ */
+
+access_control_command
+ : T_Discard discard_option_list
+ {
+ CONCAT_G_FIFOS(cfgt.discard_opts, $2);
+ }
+ | T_Mru mru_option_list
+ {
+ CONCAT_G_FIFOS(cfgt.mru_opts, $2);
+ }
+ | T_Restrict address ac_flag_list
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node($2, NULL, $3,
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+ | T_Restrict ip_address T_Mask ip_address ac_flag_list
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node($2, $4, $5,
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+ | T_Restrict T_Default ac_flag_list
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node(NULL, NULL, $3,
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+ | T_Restrict T_Ipv4_flag T_Default ac_flag_list
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node(
+ create_address_node(
+ estrdup("0.0.0.0"),
+ AF_INET),
+ create_address_node(
+ estrdup("0.0.0.0"),
+ AF_INET),
+ $4,
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+ | T_Restrict T_Ipv6_flag T_Default ac_flag_list
+ {
+ restrict_node *rn;
+
+ rn = create_restrict_node(
+ create_address_node(
+ estrdup("::"),
+ AF_INET6),
+ create_address_node(
+ estrdup("::"),
+ AF_INET6),
+ $4,
+ ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+ | T_Restrict T_Source ac_flag_list
+ {
+ restrict_node * rn;
+
+ APPEND_G_FIFO($3, create_int_node($2));
+ rn = create_restrict_node(
+ NULL, NULL, $3, ip_file->line_no);
+ APPEND_G_FIFO(cfgt.restrict_opts, rn);
+ }
+ ;
+
+ac_flag_list
+ : /* empty list is allowed */
+ { $$ = NULL; }
+ | ac_flag_list access_control_flag
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, create_int_node($2));
+ }
+ ;
+
+access_control_flag
+ : T_Flake
+ | T_Ignore
+ | T_Kod
+ | T_Mssntp
+ | T_Limited
+ | T_Lowpriotrap
+ | T_Nomodify
+ | T_Nomrulist
+ | T_Nopeer
+ | T_Noquery
+ | T_Noserve
+ | T_Notrap
+ | T_Notrust
+ | T_Ntpport
+ | T_Version
+ ;
+
+discard_option_list
+ : discard_option_list discard_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | discard_option
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+discard_option
+ : discard_option_keyword T_Integer
+ { $$ = create_attr_ival($1, $2); }
+ ;
+
+discard_option_keyword
+ : T_Average
+ | T_Minimum
+ | T_Monitor
+ ;
+
+mru_option_list
+ : mru_option_list mru_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | mru_option
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+mru_option
+ : mru_option_keyword T_Integer
+ { $$ = create_attr_ival($1, $2); }
+ ;
+
+mru_option_keyword
+ : T_Incalloc
+ | T_Incmem
+ | T_Initalloc
+ | T_Initmem
+ | T_Maxage
+ | T_Maxdepth
+ | T_Maxmem
+ | T_Mindepth
+ ;
+
+/* Fudge Commands
+ * --------------
+ */
+
+fudge_command
+ : T_Fudge address fudge_factor_list
+ {
+ addr_opts_node *aon;
+
+ aon = create_addr_opts_node($2, $3);
+ APPEND_G_FIFO(cfgt.fudge, aon);
+ }
+ ;
+
+fudge_factor_list
+ : fudge_factor_list fudge_factor
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | fudge_factor
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+fudge_factor
+ : fudge_factor_dbl_keyword number
+ { $$ = create_attr_dval($1, $2); }
+ | fudge_factor_bool_keyword boolean
+ { $$ = create_attr_ival($1, $2); }
+ | T_Stratum T_Integer
+ { $$ = create_attr_ival($1, $2); }
+ | T_Abbrev T_String
+ { $$ = create_attr_sval($1, $2); }
+ | T_Refid T_String
+ { $$ = create_attr_sval($1, $2); }
+ ;
+
+fudge_factor_dbl_keyword
+ : T_Time1
+ | T_Time2
+ ;
+
+fudge_factor_bool_keyword
+ : T_Flag1
+ | T_Flag2
+ | T_Flag3
+ | T_Flag4
+ ;
+
+/* rlimit Commands
+ * ---------------
+ */
+
+rlimit_command
+ : T_Rlimit rlimit_option_list
+ { CONCAT_G_FIFOS(cfgt.rlimit, $2); }
+ ;
+
+rlimit_option_list
+ : rlimit_option_list rlimit_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | rlimit_option
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+rlimit_option
+ : rlimit_option_keyword T_Integer
+ { $$ = create_attr_ival($1, $2); }
+ ;
+
+rlimit_option_keyword
+ : T_Memlock
+ | T_Stacksize
+ | T_Filenum
+ ;
+
+
+/* Command for System Options
+ * --------------------------
+ */
+
+system_option_command
+ : T_Enable system_option_list
+ { CONCAT_G_FIFOS(cfgt.enable_opts, $2); }
+ | T_Disable system_option_list
+ { CONCAT_G_FIFOS(cfgt.disable_opts, $2); }
+ ;
+
+system_option_list
+ : system_option_list system_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | system_option
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+system_option
+ : system_option_flag_keyword
+ { $$ = create_attr_ival(T_Flag, $1); }
+ | system_option_local_flag_keyword
+ {
+ if (input_from_file) {
+ $$ = create_attr_ival(T_Flag, $1);
+ } else {
+ char err_str[128];
+
+ $$ = NULL;
+ snprintf(err_str, sizeof(err_str),
+ "enable/disable %s remote configuration ignored",
+ keyword($1));
+ yyerror(ip_file, err_str);
+ }
+ }
+ ;
+
+system_option_flag_keyword
+ : T_Auth
+ | T_Bclient
+ | T_Calibrate
+ | T_Kernel
+ | T_Monitor
+ | T_Ntp
+ ;
+
+system_option_local_flag_keyword
+ : T_Mode7
+ | T_Stats
+ ;
+
+/* Tinker Commands
+ * ---------------
+ */
+
+tinker_command
+ : T_Tinker tinker_option_list
+ { CONCAT_G_FIFOS(cfgt.tinker, $2); }
+ ;
+
+tinker_option_list
+ : tinker_option_list tinker_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | tinker_option
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+tinker_option
+ : tinker_option_keyword number
+ { $$ = create_attr_dval($1, $2); }
+ ;
+
+tinker_option_keyword
+ : T_Allan
+ | T_Dispersion
+ | T_Freq
+ | T_Huffpuff
+ | T_Panic
+ | T_Step
+ | T_Stepout
+ | T_Tick
+ ;
+
+
+/* Miscellaneous Commands
+ * ----------------------
+ */
+
+miscellaneous_command
+ : interface_command
+ | reset_command
+ | misc_cmd_dbl_keyword number
+ {
+ attr_val *av;
+
+ av = create_attr_dval($1, $2);
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+ | misc_cmd_str_keyword T_String
+ {
+ attr_val *av;
+
+ av = create_attr_sval($1, $2);
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+ | misc_cmd_str_lcl_keyword T_String
+ {
+ char error_text[64];
+ attr_val *av;
+
+ if (input_from_file) {
+ av = create_attr_sval($1, $2);
+ APPEND_G_FIFO(cfgt.vars, av);
+ } else {
+ YYFREE($2);
+ snprintf(error_text, sizeof(error_text),
+ "%s remote config ignored",
+ keyword($1));
+ yyerror(ip_file, error_text);
+ }
+ }
+ | T_Includefile T_String command
+ {
+ if (!input_from_file) {
+ yyerror(ip_file, "remote includefile ignored");
+ break;
+ }
+ if (curr_include_level >= MAXINCLUDELEVEL) {
+ fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
+ msyslog(LOG_ERR, "getconfig: Maximum include file level exceeded.");
+ } else {
+ fp[curr_include_level + 1] = F_OPEN(FindConfig($2), "r");
+ if (fp[curr_include_level + 1] == NULL) {
+ fprintf(stderr, "getconfig: Couldn't open <%s>\n", FindConfig($2));
+ msyslog(LOG_ERR, "getconfig: Couldn't open <%s>", FindConfig($2));
+ } else {
+ ip_file = fp[++curr_include_level];
+ }
+ }
+ }
+ | T_End
+ {
+ while (curr_include_level != -1)
+ FCLOSE(fp[curr_include_level--]);
+ }
+ | T_Driftfile drift_parm
+ { /* see drift_parm below for actions */ }
+ | T_Logconfig log_config_list
+ { CONCAT_G_FIFOS(cfgt.logconfig, $2); }
+ | T_Phone string_list
+ { CONCAT_G_FIFOS(cfgt.phone, $2); }
+ | T_Setvar variable_assign
+ { APPEND_G_FIFO(cfgt.setvar, $2); }
+ | T_Trap ip_address trap_option_list
+ {
+ addr_opts_node *aon;
+
+ aon = create_addr_opts_node($2, $3);
+ APPEND_G_FIFO(cfgt.trap, aon);
+ }
+ | T_Ttl integer_list
+ { CONCAT_G_FIFOS(cfgt.ttl, $2); }
+ ;
+
+misc_cmd_dbl_keyword
+ : T_Broadcastdelay
+ | T_Nonvolatile
+ | T_Tick
+ ;
+
+misc_cmd_str_keyword
+ : T_Ident
+ | T_Leapfile
+ | T_Pidfile
+ ;
+
+misc_cmd_str_lcl_keyword
+ : T_Logfile
+ | T_Saveconfigdir
+ ;
+
+drift_parm
+ : T_String
+ {
+ attr_val *av;
+
+ av = create_attr_sval(T_Driftfile, $1);
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+ | T_String T_Double
+ {
+ attr_val *av;
+
+ av = create_attr_sval(T_Driftfile, $1);
+ APPEND_G_FIFO(cfgt.vars, av);
+ av = create_attr_dval(T_WanderThreshold, $2);
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+ | /* Null driftfile, indicated by empty string "" */
+ {
+ attr_val *av;
+
+ av = create_attr_sval(T_Driftfile, "");
+ APPEND_G_FIFO(cfgt.vars, av);
+ }
+ ;
+
+variable_assign
+ : T_String '=' T_String t_default_or_zero
+ { $$ = create_setvar_node($1, $3, $4); }
+ ;
+
+t_default_or_zero
+ : T_Default
+ | /* empty, no "default" modifier */
+ { $$ = 0; }
+ ;
+
+trap_option_list
+ : /* empty list */
+ { $$ = NULL; }
+ | trap_option_list trap_option
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ ;
+
+trap_option
+ : T_Port T_Integer
+ { $$ = create_attr_ival($1, $2); }
+ | T_Interface ip_address
+ {
+ $$ = create_attr_sval($1, estrdup($2->address));
+ destroy_address_node($2);
+ }
+ ;
+
+log_config_list
+ : log_config_list log_config_command
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | log_config_command
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+log_config_command
+ : T_String
+ {
+ char prefix;
+ char * type;
+
+ switch ($1[0]) {
+
+ case '+':
+ case '-':
+ case '=':
+ prefix = $1[0];
+ type = $1 + 1;
+ break;
+
+ default:
+ prefix = '=';
+ type = $1;
+ }
+
+ $$ = create_attr_sval(prefix, estrdup(type));
+ YYFREE($1);
+ }
+ ;
+
+interface_command
+ : interface_nic nic_rule_action nic_rule_class
+ {
+ nic_rule_node *nrn;
+
+ nrn = create_nic_rule_node($3, NULL, $2);
+ APPEND_G_FIFO(cfgt.nic_rules, nrn);
+ }
+ | interface_nic nic_rule_action T_String
+ {
+ nic_rule_node *nrn;
+
+ nrn = create_nic_rule_node(0, $3, $2);
+ APPEND_G_FIFO(cfgt.nic_rules, nrn);
+ }
+ ;
+
+interface_nic
+ : T_Interface
+ | T_Nic
+ ;
+
+nic_rule_class
+ : T_All
+ | T_Ipv4
+ | T_Ipv6
+ | T_Wildcard
+ ;
+
+nic_rule_action
+ : T_Listen
+ | T_Ignore
+ | T_Drop
+ ;
+
+reset_command
+ : T_Reset counter_set_list
+ { CONCAT_G_FIFOS(cfgt.reset_counters, $2); }
+ ;
+
+counter_set_list
+ : counter_set_list counter_set_keyword
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, create_int_node($2));
+ }
+ | counter_set_keyword
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, create_int_node($1));
+ }
+ ;
+
+counter_set_keyword
+ : T_Allpeers
+ | T_Auth
+ | T_Ctl
+ | T_Io
+ | T_Mem
+ | T_Sys
+ | T_Timer
+ ;
+
+
+
+/* Miscellaneous Rules
+ * -------------------
+ */
+
+integer_list
+ : integer_list T_Integer
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, create_int_node($2));
+ }
+ | T_Integer
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, create_int_node($1));
+ }
+ ;
+
+integer_list_range
+ : integer_list_range integer_list_range_elt
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | integer_list_range_elt
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+integer_list_range_elt
+ : T_Integer
+ { $$ = create_attr_ival('i', $1); }
+ | integer_range
+ ;
+
+integer_range
+ : '(' T_Integer T_Ellipsis T_Integer ')'
+ { $$ = create_attr_rangeval('-', $2, $4); }
+ ;
+
+string_list
+ : string_list T_String
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, create_string_node($2));
+ }
+ | T_String
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, create_string_node($1));
+ }
+ ;
+
+address_list
+ : address_list address
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | address
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+boolean
+ : T_Integer
+ {
+ if ($1 != 0 && $1 != 1) {
+ yyerror(ip_file, "Integer value is not boolean (0 or 1). Assuming 1");
+ $$ = 1;
+ } else {
+ $$ = $1;
+ }
+ }
+ | T_True { $$ = 1; }
+ | T_False { $$ = 0; }
+ ;
+
+number
+ : T_Integer { $$ = (double)$1; }
+ | T_Double
+ ;
+
+
+/* Simulator Configuration Commands
+ * --------------------------------
+ */
+
+simulate_command
+ : sim_conf_start '{' sim_init_statement_list sim_server_list '}'
+ {
+ sim_node *sn;
+
+ sn = create_sim_node($3, $4);
+ APPEND_G_FIFO(cfgt.sim_details, sn);
+
+ /* Revert from ; to \n for end-of-command */
+ old_config_style = 1;
+ }
+ ;
+
+/* The following is a terrible hack to get the configuration file to
+ * treat newlines as whitespace characters within the simulation.
+ * This is needed because newlines are significant in the rest of the
+ * configuration file.
+ */
+sim_conf_start
+ : T_Simulate { old_config_style = 0; }
+ ;
+
+sim_init_statement_list
+ : sim_init_statement_list sim_init_statement T_EOC
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | sim_init_statement T_EOC
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+sim_init_statement
+ : sim_init_keyword '=' number
+ { $$ = create_attr_dval($1, $3); }
+ ;
+
+sim_init_keyword
+ : T_Beep_Delay
+ | T_Sim_Duration
+ ;
+
+sim_server_list
+ : sim_server_list sim_server
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | sim_server
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+sim_server
+ : sim_server_name '{' sim_server_offset sim_act_list '}'
+ { $$ = ONLY_SIM(create_sim_server($1, $3, $4)); }
+ ;
+
+sim_server_offset
+ : T_Server_Offset '=' number T_EOC
+ { $$ = $3; }
+ ;
+
+sim_server_name
+ : T_Server '=' address
+ { $$ = $3; }
+ ;
+
+sim_act_list
+ : sim_act_list sim_act
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | sim_act
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+sim_act
+ : T_Duration '=' number '{' sim_act_stmt_list '}'
+ { $$ = ONLY_SIM(create_sim_script_info($3, $5)); }
+ ;
+
+sim_act_stmt_list
+ : sim_act_stmt_list sim_act_stmt T_EOC
+ {
+ $$ = $1;
+ APPEND_G_FIFO($$, $2);
+ }
+ | sim_act_stmt T_EOC
+ {
+ $$ = NULL;
+ APPEND_G_FIFO($$, $1);
+ }
+ ;
+
+sim_act_stmt
+ : sim_act_keyword '=' number
+ { $$ = create_attr_dval($1, $3); }
+ ;
+
+sim_act_keyword
+ : T_Freq_Offset
+ | T_Wander
+ | T_Jitter
+ | T_Prop_Delay
+ | T_Proc_Delay
+ ;
+
+%%
+
+void
+yyerror(
+ struct FILE_INFO *ip_file,
+ const char *msg
+ )
+{
+ int retval;
+
+ ip_file->err_line_no = ip_file->prev_token_line_no;
+ ip_file->err_col_no = ip_file->prev_token_col_no;
+
+ msyslog(LOG_ERR,
+ "line %d column %d %s",
+ ip_file->err_line_no,
+ ip_file->err_col_no,
+ msg);
+ if (!input_from_file) {
+ /* Save the error message in the correct buffer */
+ retval = snprintf(remote_config.err_msg + remote_config.err_pos,
+ MAXLINE - remote_config.err_pos,
+ "column %d %s",
+ ip_file->err_col_no, msg);
+
+ /* Increment the value of err_pos */
+ if (retval > 0)
+ remote_config.err_pos += retval;
+
+ /* Increment the number of errors */
+ ++remote_config.no_errors;
+ }
+}
+
+
+/*
+ * token_name - convert T_ token integers to text
+ * example: token_name(T_Server) returns "T_Server"
+ */
+const char *
+token_name(
+ int token
+ )
+{
+ return yytname[YYTRANSLATE(token)];
+}
+
+
+/* Initial Testing function -- ignore */
+#if 0
+int main(int argc, char *argv[])
+{
+ ip_file = FOPEN(argv[1], "r");
+ if (!ip_file)
+ fprintf(stderr, "ERROR!! Could not open file: %s\n", argv[1]);
+ yyparse();
+ return 0;
+}
+#endif
+
diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c
new file mode 100644
index 0000000..495ee30
--- /dev/null
+++ b/ntpd/ntp_peer.c
@@ -0,0 +1,1038 @@
+/*
+ * ntp_peer.c - management of data maintained for peer associations
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#include "ntpd.h"
+#include "ntp_lists.h"
+#include "ntp_stdlib.h"
+#include "ntp_control.h"
+#include <ntp_random.h>
+
+/*
+ * Table of valid association combinations
+ * ---------------------------------------
+ *
+ * packet->mode
+ * peer->mode | UNSPEC ACTIVE PASSIVE CLIENT SERVER BCAST
+ * ---------- | ---------------------------------------------
+ * NO_PEER | e 1 0 1 1 1
+ * ACTIVE | e 1 1 0 0 0
+ * PASSIVE | e 1 e 0 0 0
+ * CLIENT | e 0 0 0 1 0
+ * SERVER | e 0 0 0 0 0
+ * BCAST | e 0 0 0 0 0
+ * BCLIENT | e 0 0 0 e 1
+ *
+ * One point to note here: a packet in BCAST mode can potentially match
+ * a peer in CLIENT mode, but we that is a special case and we check for
+ * that early in the decision process. This avoids having to keep track
+ * of what kind of associations are possible etc... We actually
+ * circumvent that problem by requiring that the first b(m)roadcast
+ * received after the change back to BCLIENT mode sets the clock.
+ */
+#define AM_MODES 7 /* number of rows and columns */
+#define NO_PEER 0 /* action when no peer is found */
+
+int AM[AM_MODES][AM_MODES] = {
+/* packet->mode */
+/* peer { UNSPEC, ACTIVE, PASSIVE, CLIENT, SERVER, BCAST } */
+/* mode */
+/*NONE*/{ AM_ERR, AM_NEWPASS, AM_NOMATCH, AM_FXMIT, AM_MANYCAST, AM_NEWBCL},
+
+/*A*/ { AM_ERR, AM_PROCPKT, AM_PROCPKT, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH},
+
+/*P*/ { AM_ERR, AM_PROCPKT, AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH},
+
+/*C*/ { AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_PROCPKT, AM_NOMATCH},
+
+/*S*/ { AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH},
+
+/*BCST*/{ AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH},
+
+/*BCL*/ { AM_ERR, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_NOMATCH, AM_PROCPKT},
+};
+
+#define MATCH_ASSOC(x, y) AM[(x)][(y)]
+
+/*
+ * These routines manage the allocation of memory to peer structures
+ * and the maintenance of three data structures involving all peers:
+ *
+ * - peer_list is a single list with all peers, suitable for scanning
+ * operations over all peers.
+ * - peer_adr_hash is an array of lists indexed by hashed peer address.
+ * - peer_aid_hash is an array of lists indexed by hashed associd.
+ *
+ * They also maintain a free list of peer structures, peer_free.
+ *
+ * The three main entry points are findpeer(), which looks for matching
+ * peer structures in the peer list, newpeer(), which allocates a new
+ * peer structure and adds it to the list, and unpeer(), which
+ * demobilizes the association and deallocates the structure.
+ */
+/*
+ * Peer hash tables
+ */
+struct peer *peer_hash[NTP_HASH_SIZE]; /* peer hash table */
+int peer_hash_count[NTP_HASH_SIZE]; /* peers in each bucket */
+struct peer *assoc_hash[NTP_HASH_SIZE]; /* association ID hash table */
+int assoc_hash_count[NTP_HASH_SIZE];/* peers in each bucket */
+struct peer *peer_list; /* peer structures list */
+static struct peer *peer_free; /* peer structures free list */
+int peer_free_count; /* count of free structures */
+
+/*
+ * Association ID. We initialize this value randomly, then assign a new
+ * value every time an association is mobilized.
+ */
+static associd_t current_association_ID; /* association ID */
+
+/*
+ * Memory allocation watermarks.
+ */
+#define INIT_PEER_ALLOC 8 /* static preallocation */
+#define INC_PEER_ALLOC 4 /* add N more when empty */
+
+/*
+ * Miscellaneous statistic counters which may be queried.
+ */
+u_long peer_timereset; /* time stat counters zeroed */
+u_long findpeer_calls; /* calls to findpeer */
+u_long assocpeer_calls; /* calls to findpeerbyassoc */
+u_long peer_allocations; /* allocations from free list */
+u_long peer_demobilizations; /* structs freed to free list */
+int total_peer_structs; /* peer structs */
+int peer_associations; /* mobilized associations */
+int peer_preempt; /* preemptable associations */
+static struct peer init_peer_alloc[INIT_PEER_ALLOC]; /* init alloc */
+
+static struct peer * findexistingpeer_name(const char *, u_short,
+ struct peer *, int);
+static struct peer * findexistingpeer_addr(sockaddr_u *,
+ struct peer *, int,
+ u_char);
+static void free_peer(struct peer *, int);
+static void getmorepeermem(void);
+static int score(struct peer *);
+
+
+/*
+ * init_peer - initialize peer data structures and counters
+ *
+ * N.B. We use the random number routine in here. It had better be
+ * initialized prior to getting here.
+ */
+void
+init_peer(void)
+{
+ int i;
+
+ /*
+ * Initialize peer free list from static allocation.
+ */
+ for (i = COUNTOF(init_peer_alloc) - 1; i >= 0; i--)
+ LINK_SLIST(peer_free, &init_peer_alloc[i], p_link);
+ total_peer_structs = COUNTOF(init_peer_alloc);
+ peer_free_count = COUNTOF(init_peer_alloc);
+
+ /*
+ * Initialize our first association ID
+ */
+ do
+ current_association_ID = ntp_random() & ASSOCID_MAX;
+ while (!current_association_ID);
+}
+
+
+/*
+ * getmorepeermem - add more peer structures to the free list
+ */
+static void
+getmorepeermem(void)
+{
+ int i;
+ struct peer *peers;
+
+ peers = emalloc_zero(INC_PEER_ALLOC * sizeof(*peers));
+
+ for (i = INC_PEER_ALLOC - 1; i >= 0; i--)
+ LINK_SLIST(peer_free, &peers[i], p_link);
+
+ total_peer_structs += INC_PEER_ALLOC;
+ peer_free_count += INC_PEER_ALLOC;
+}
+
+
+static struct peer *
+findexistingpeer_name(
+ const char * hostname,
+ u_short hname_fam,
+ struct peer * start_peer,
+ int mode
+ )
+{
+ struct peer *p;
+
+ if (NULL == start_peer)
+ p = peer_list;
+ else
+ p = start_peer->p_link;
+ for (; p != NULL; p = p->p_link)
+ if (p->hostname != NULL
+ && (-1 == mode || p->hmode == mode)
+ && (AF_UNSPEC == hname_fam
+ || AF_UNSPEC == AF(&p->srcadr)
+ || hname_fam == AF(&p->srcadr))
+ && !strcasecmp(p->hostname, hostname))
+ break;
+ return p;
+}
+
+
+static
+struct peer *
+findexistingpeer_addr(
+ sockaddr_u * addr,
+ struct peer * start_peer,
+ int mode,
+ u_char cast_flags
+ )
+{
+ struct peer *peer;
+
+ DPRINTF(2, ("findexistingpeer_addr(%s, %s, %d, 0x%x)\n",
+ sptoa(addr),
+ (start_peer)
+ ? sptoa(&start_peer->srcadr)
+ : "NULL",
+ mode, (u_int)cast_flags));
+
+ /*
+ * start_peer is included so we can locate instances of the
+ * same peer through different interfaces in the hash table.
+ * Without MDF_BCLNT, a match requires the same mode and remote
+ * address. MDF_BCLNT associations start out as MODE_CLIENT
+ * if broadcastdelay is not specified, and switch to
+ * MODE_BCLIENT after estimating the one-way delay. Duplicate
+ * associations are expanded in definition to match any other
+ * MDF_BCLNT with the same srcadr (remote, unicast address).
+ */
+ if (NULL == start_peer)
+ peer = peer_hash[NTP_HASH_ADDR(addr)];
+ else
+ peer = start_peer->adr_link;
+
+ while (peer != NULL) {
+ DPRINTF(3, ("%s %s %d %d 0x%x 0x%x ", sptoa(addr),
+ sptoa(&peer->srcadr), mode, peer->hmode,
+ (u_int)cast_flags, (u_int)peer->cast_flags));
+ if ((-1 == mode || peer->hmode == mode ||
+ ((MDF_BCLNT & peer->cast_flags) &&
+ (MDF_BCLNT & cast_flags))) &&
+ ADDR_PORT_EQ(addr, &peer->srcadr)) {
+ DPRINTF(3, ("found.\n"));
+ break;
+ }
+ DPRINTF(3, ("\n"));
+ peer = peer->adr_link;
+ }
+
+ return peer;
+}
+
+
+/*
+ * findexistingpeer - search by address and return a pointer to a peer.
+ */
+struct peer *
+findexistingpeer(
+ sockaddr_u * addr,
+ const char * hostname,
+ struct peer * start_peer,
+ int mode,
+ u_char cast_flags
+ )
+{
+ if (hostname != NULL)
+ return findexistingpeer_name(hostname, AF(addr),
+ start_peer, mode);
+ else
+ return findexistingpeer_addr(addr, start_peer, mode,
+ cast_flags);
+}
+
+
+/*
+ * findpeer - find and return a peer match for a received datagram in
+ * the peer_hash table.
+ */
+struct peer *
+findpeer(
+ struct recvbuf *rbufp,
+ int pkt_mode,
+ int * action
+ )
+{
+ struct peer * p;
+ sockaddr_u * srcadr;
+ u_int hash;
+ struct pkt * pkt;
+ l_fp pkt_org;
+
+ findpeer_calls++;
+ srcadr = &rbufp->recv_srcadr;
+ hash = NTP_HASH_ADDR(srcadr);
+ for (p = peer_hash[hash]; p != NULL; p = p->adr_link) {
+ if (ADDR_PORT_EQ(srcadr, &p->srcadr)) {
+
+ /*
+ * if the association matching rules determine
+ * that this is not a valid combination, then
+ * look for the next valid peer association.
+ */
+ *action = MATCH_ASSOC(p->hmode, pkt_mode);
+
+ /*
+ * A response to our manycastclient solicitation
+ * might be misassociated with an ephemeral peer
+ * already spun for the server. If the packet's
+ * org timestamp doesn't match the peer's, check
+ * if it matches the ACST prototype peer's. If
+ * so it is a redundant solicitation response,
+ * return AM_ERR to discard it. [Bug 1762]
+ */
+ if (MODE_SERVER == pkt_mode &&
+ AM_PROCPKT == *action) {
+ pkt = &rbufp->recv_pkt;
+ NTOHL_FP(&pkt->org, &pkt_org);
+ if (!L_ISEQU(&p->aorg, &pkt_org) &&
+ findmanycastpeer(rbufp))
+ *action = AM_ERR;
+ }
+
+ /*
+ * if an error was returned, exit back right
+ * here.
+ */
+ if (*action == AM_ERR)
+ return NULL;
+
+ /*
+ * if a match is found, we stop our search.
+ */
+ if (*action != AM_NOMATCH)
+ break;
+ }
+ }
+
+ /*
+ * If no matching association is found
+ */
+ if (NULL == p) {
+ *action = MATCH_ASSOC(NO_PEER, pkt_mode);
+ } else if (p->dstadr != rbufp->dstadr) {
+ set_peerdstadr(p, rbufp->dstadr);
+ if (p->dstadr == rbufp->dstadr) {
+ DPRINTF(1, ("Changed %s local address to match response\n",
+ stoa(&p->srcadr)));
+ return findpeer(rbufp, pkt_mode, action);
+ }
+ }
+ return p;
+}
+
+/*
+ * findpeerbyassoc - find and return a peer using his association ID
+ */
+struct peer *
+findpeerbyassoc(
+ associd_t assoc
+ )
+{
+ struct peer *p;
+ u_int hash;
+
+ assocpeer_calls++;
+ hash = assoc & NTP_HASH_MASK;
+ for (p = assoc_hash[hash]; p != NULL; p = p->aid_link)
+ if (assoc == p->associd)
+ break;
+ return p;
+}
+
+
+/*
+ * clear_all - flush all time values for all associations
+ */
+void
+clear_all(void)
+{
+ struct peer *p;
+
+ /*
+ * This routine is called when the clock is stepped, and so all
+ * previously saved time values are untrusted.
+ */
+ for (p = peer_list; p != NULL; p = p->p_link)
+ if (!(MDF_TXONLY_MASK & p->cast_flags))
+ peer_clear(p, "STEP");
+
+ DPRINTF(1, ("clear_all: at %lu\n", current_time));
+}
+
+
+/*
+ * score_all() - determine if an association can be demobilized
+ */
+int
+score_all(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct peer *speer;
+ int temp, tamp;
+ int x;
+
+ /*
+ * This routine finds the minimum score for all preemptible
+ * associations and returns > 0 if the association can be
+ * demobilized.
+ */
+ tamp = score(peer);
+ temp = 100;
+ for (speer = peer_list; speer != NULL; speer = speer->p_link)
+ if (speer->flags & FLAG_PREEMPT) {
+ x = score(speer);
+ if (x < temp)
+ temp = x;
+ }
+ DPRINTF(1, ("score_all: at %lu score %d min %d\n",
+ current_time, tamp, temp));
+
+ if (tamp != temp)
+ temp = 0;
+
+ return temp;
+}
+
+
+/*
+ * score() - calculate preemption score
+ */
+static int
+score(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ int temp;
+
+ /*
+ * This routine calculates the premption score from the peer
+ * error bits and status. Increasing values are more cherished.
+ */
+ temp = 0;
+ if (!(peer->flash & TEST10))
+ temp++; /* 1 good synch and stratum */
+ if (!(peer->flash & TEST13))
+ temp++; /* 2 reachable */
+ if (!(peer->flash & TEST12))
+ temp++; /* 3 no loop */
+ if (!(peer->flash & TEST11))
+ temp++; /* 4 good distance */
+ if (peer->status >= CTL_PST_SEL_SELCAND)
+ temp++; /* 5 in the hunt */
+ if (peer->status != CTL_PST_SEL_EXCESS)
+ temp++; /* 6 not spare tire */
+ return (temp); /* selection status */
+}
+
+
+/*
+ * free_peer - internal routine to free memory referred to by a struct
+ * peer and return it to the peer free list. If unlink is
+ * nonzero, unlink from the various lists.
+ */
+static void
+free_peer(
+ struct peer * p,
+ int unlink_peer
+ )
+{
+ struct peer * unlinked;
+ int hash;
+
+ if (unlink_peer) {
+ hash = NTP_HASH_ADDR(&p->srcadr);
+ peer_hash_count[hash]--;
+
+ UNLINK_SLIST(unlinked, peer_hash[hash], p, adr_link,
+ struct peer);
+ if (NULL == unlinked) {
+ peer_hash_count[hash]++;
+ msyslog(LOG_ERR, "peer %s not in address table!",
+ stoa(&p->srcadr));
+ }
+
+ /*
+ * Remove him from the association hash as well.
+ */
+ hash = p->associd & NTP_HASH_MASK;
+ assoc_hash_count[hash]--;
+
+ UNLINK_SLIST(unlinked, assoc_hash[hash], p, aid_link,
+ struct peer);
+ if (NULL == unlinked) {
+ assoc_hash_count[hash]++;
+ msyslog(LOG_ERR,
+ "peer %s not in association ID table!",
+ stoa(&p->srcadr));
+ }
+
+ /* Remove him from the overall list. */
+ UNLINK_SLIST(unlinked, peer_list, p, p_link,
+ struct peer);
+ if (NULL == unlinked)
+ msyslog(LOG_ERR, "%s not in peer list!",
+ stoa(&p->srcadr));
+ }
+
+ if (p->hostname != NULL)
+ free(p->hostname);
+
+ if (p->ident != NULL)
+ free(p->ident);
+
+ if (p->addrs != NULL)
+ free(p->addrs); /* from copy_addrinfo_list() */
+
+ /* Add his corporeal form to peer free list */
+ ZERO(*p);
+ LINK_SLIST(peer_free, p, p_link);
+ peer_free_count++;
+}
+
+
+/*
+ * unpeer - remove peer structure from hash table and free structure
+ */
+void
+unpeer(
+ struct peer *peer
+ )
+{
+ mprintf_event(PEVNT_DEMOBIL, peer, "assoc %u", peer->associd);
+ restrict_source(&peer->srcadr, 1, 0);
+ set_peerdstadr(peer, NULL);
+ peer_demobilizations++;
+ peer_associations--;
+ if (FLAG_PREEMPT & peer->flags)
+ peer_preempt--;
+#ifdef REFCLOCK
+ /*
+ * If this peer is actually a clock, shut it down first
+ */
+ if (FLAG_REFCLOCK & peer->flags)
+ refclock_unpeer(peer);
+#endif
+
+ free_peer(peer, TRUE);
+}
+
+
+/*
+ * peer_config - configure a new association
+ */
+struct peer *
+peer_config(
+ sockaddr_u * srcadr,
+ const char * hostname,
+ endpt * dstadr,
+ u_char hmode,
+ u_char version,
+ u_char minpoll,
+ u_char maxpoll,
+ u_int flags,
+ u_int32 ttl,
+ keyid_t key,
+ const char * ident /* autokey group */
+ )
+{
+ u_char cast_flags;
+
+ /*
+ * We do a dirty little jig to figure the cast flags. This is
+ * probably not the best place to do this, at least until the
+ * configure code is rebuilt. Note only one flag can be set.
+ */
+ switch (hmode) {
+ case MODE_BROADCAST:
+ if (IS_MCAST(srcadr))
+ cast_flags = MDF_MCAST;
+ else
+ cast_flags = MDF_BCAST;
+ break;
+
+ case MODE_CLIENT:
+ if (hostname != NULL && SOCK_UNSPEC(srcadr))
+ cast_flags = MDF_POOL;
+ else if (IS_MCAST(srcadr))
+ cast_flags = MDF_ACAST;
+ else
+ cast_flags = MDF_UCAST;
+ break;
+
+ default:
+ cast_flags = MDF_UCAST;
+ }
+
+ /*
+ * Mobilize the association and initialize its variables. If
+ * emulating ntpdate, force iburst. For pool and manycastclient
+ * strip FLAG_PREEMPT as the prototype associations are not
+ * themselves preemptible, though the resulting associations
+ * are.
+ */
+ flags |= FLAG_CONFIG;
+ if (mode_ntpdate)
+ flags |= FLAG_IBURST;
+ if ((MDF_ACAST | MDF_POOL) & cast_flags)
+ flags &= ~FLAG_PREEMPT;
+ return newpeer(srcadr, hostname, dstadr, hmode, version,
+ minpoll, maxpoll, flags, cast_flags, ttl, key, ident);
+}
+
+/*
+ * setup peer dstadr field keeping it in sync with the interface
+ * structures
+ */
+void
+set_peerdstadr(
+ struct peer * p,
+ endpt * dstadr
+ )
+{
+ struct peer * unlinked;
+
+ if (p->dstadr == dstadr)
+ return;
+
+ /*
+ * Don't accept updates to a separate multicast receive-only
+ * endpt while a BCLNT peer is running its unicast protocol.
+ */
+ if (dstadr != NULL && (FLAG_BC_VOL & p->flags) &&
+ (INT_MCASTIF & dstadr->flags) && MODE_CLIENT == p->hmode) {
+ return;
+ }
+ if (p->dstadr != NULL) {
+ p->dstadr->peercnt--;
+ UNLINK_SLIST(unlinked, p->dstadr->peers, p, ilink,
+ struct peer);
+ msyslog(LOG_INFO, "%s local addr %s -> %s",
+ stoa(&p->srcadr), latoa(p->dstadr),
+ latoa(dstadr));
+ }
+ p->dstadr = dstadr;
+ if (dstadr != NULL) {
+ LINK_SLIST(dstadr->peers, p, ilink);
+ dstadr->peercnt++;
+ }
+}
+
+/*
+ * attempt to re-rebind interface if necessary
+ */
+static void
+peer_refresh_interface(
+ struct peer *p
+ )
+{
+ endpt * niface;
+ endpt * piface;
+
+ niface = select_peerinterface(p, &p->srcadr, NULL);
+
+ DPRINTF(4, (
+ "peer_refresh_interface: %s->%s mode %d vers %d poll %d %d flags 0x%x 0x%x ttl %u key %08x: new interface: ",
+ p->dstadr == NULL ? "<null>" :
+ stoa(&p->dstadr->sin), stoa(&p->srcadr), p->hmode,
+ p->version, p->minpoll, p->maxpoll, p->flags, p->cast_flags,
+ p->ttl, p->keyid));
+ if (niface != NULL) {
+ DPRINTF(4, (
+ "fd=%d, bfd=%d, name=%.16s, flags=0x%x, ifindex=%u, sin=%s",
+ niface->fd, niface->bfd, niface->name,
+ niface->flags, niface->ifindex,
+ stoa(&niface->sin)));
+ if (niface->flags & INT_BROADCAST)
+ DPRINTF(4, (", bcast=%s",
+ stoa(&niface->bcast)));
+ DPRINTF(4, (", mask=%s\n", stoa(&niface->mask)));
+ } else {
+ DPRINTF(4, ("<NONE>\n"));
+ }
+
+ piface = p->dstadr;
+ set_peerdstadr(p, niface);
+ if (p->dstadr != NULL) {
+ /*
+ * clear crypto if we change the local address
+ */
+ if (p->dstadr != piface && !(MDF_ACAST & p->cast_flags)
+ && MODE_BROADCAST != p->pmode)
+ peer_clear(p, "XFAC");
+
+ /*
+ * Broadcast needs the socket enabled for broadcast
+ */
+ if (MDF_BCAST & p->cast_flags)
+ enable_broadcast(p->dstadr, &p->srcadr);
+
+ /*
+ * Multicast needs the socket interface enabled for
+ * multicast
+ */
+ if (MDF_MCAST & p->cast_flags)
+ enable_multicast_if(p->dstadr, &p->srcadr);
+ }
+}
+
+
+/*
+ * refresh_all_peerinterfaces - see that all interface bindings are up
+ * to date
+ */
+void
+refresh_all_peerinterfaces(void)
+{
+ struct peer *p;
+
+ /*
+ * this is called when the interface list has changed
+ * give all peers a chance to find a better interface
+ */
+ for (p = peer_list; p != NULL; p = p->p_link)
+ peer_refresh_interface(p);
+}
+
+
+/*
+ * newpeer - initialize a new peer association
+ */
+struct peer *
+newpeer(
+ sockaddr_u * srcadr,
+ const char * hostname,
+ endpt * dstadr,
+ u_char hmode,
+ u_char version,
+ u_char minpoll,
+ u_char maxpoll,
+ u_int flags,
+ u_char cast_flags,
+ u_int32 ttl,
+ keyid_t key,
+ const char * ident
+ )
+{
+ struct peer * peer;
+ u_int hash;
+
+#ifdef AUTOKEY
+ /*
+ * If Autokey is requested but not configured, complain loudly.
+ */
+ if (!crypto_flags) {
+ if (key > NTP_MAXKEY) {
+ return (NULL);
+
+ } else if (flags & FLAG_SKEY) {
+ msyslog(LOG_ERR, "Autokey not configured");
+ return (NULL);
+ }
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * For now only pool associations have a hostname.
+ */
+ NTP_INSIST(NULL == hostname || (MDF_POOL & cast_flags));
+
+ /*
+ * First search from the beginning for an association with given
+ * remote address and mode. If an interface is given, search
+ * from there to find the association which matches that
+ * destination. If the given interface is "any", track down the
+ * actual interface, because that's what gets put into the peer
+ * structure.
+ */
+ if (dstadr != NULL) {
+ peer = findexistingpeer(srcadr, hostname, NULL, hmode,
+ cast_flags);
+ while (peer != NULL) {
+ if (peer->dstadr == dstadr ||
+ ((MDF_BCLNT & cast_flags) &&
+ (MDF_BCLNT & peer->cast_flags)))
+ break;
+
+ if (dstadr == ANY_INTERFACE_CHOOSE(srcadr) &&
+ peer->dstadr == findinterface(srcadr))
+ break;
+
+ peer = findexistingpeer(srcadr, hostname, peer,
+ hmode, cast_flags);
+ }
+ } else {
+ /* no endpt address given */
+ peer = findexistingpeer(srcadr, hostname, NULL, hmode,
+ cast_flags);
+ }
+
+ /*
+ * If a peer is found, this would be a duplicate and we don't
+ * allow that. This avoids duplicate ephemeral (broadcast/
+ * multicast) and preemptible (manycast and pool) client
+ * associations.
+ */
+ if (peer != NULL) {
+ DPRINTF(2, ("newpeer(%s) found existing association\n",
+ (hostname)
+ ? hostname
+ : stoa(srcadr)));
+ return NULL;
+ }
+
+ /*
+ * Allocate a new peer structure. Some dirt here, since some of
+ * the initialization requires knowlege of our system state.
+ */
+ if (peer_free_count == 0)
+ getmorepeermem();
+ UNLINK_HEAD_SLIST(peer, peer_free, p_link);
+ peer_free_count--;
+ peer_associations++;
+ if (FLAG_PREEMPT & flags)
+ peer_preempt++;
+
+ /*
+ * Assign an association ID and increment the system variable.
+ */
+ peer->associd = current_association_ID;
+ if (++current_association_ID == 0)
+ ++current_association_ID;
+
+ peer->srcadr = *srcadr;
+ if (hostname != NULL)
+ peer->hostname = estrdup(hostname);
+ peer->hmode = hmode;
+ peer->version = version;
+ peer->flags = flags;
+ peer->cast_flags = cast_flags;
+ set_peerdstadr(peer,
+ select_peerinterface(peer, srcadr, dstadr));
+
+ /*
+ * It is an error to set minpoll less than NTP_MINPOLL or to
+ * set maxpoll greater than NTP_MAXPOLL. However, minpoll is
+ * clamped not greater than NTP_MAXPOLL and maxpoll is clamped
+ * not less than NTP_MINPOLL without complaint. Finally,
+ * minpoll is clamped not greater than maxpoll.
+ */
+ if (minpoll == 0)
+ peer->minpoll = NTP_MINDPOLL;
+ else
+ peer->minpoll = min(minpoll, NTP_MAXPOLL);
+ if (maxpoll == 0)
+ peer->maxpoll = NTP_MAXDPOLL;
+ else
+ peer->maxpoll = max(maxpoll, NTP_MINPOLL);
+ if (peer->minpoll > peer->maxpoll)
+ peer->minpoll = peer->maxpoll;
+
+ if (peer->dstadr != NULL)
+ DPRINTF(3, ("newpeer(%s): using fd %d and our addr %s\n",
+ stoa(srcadr), peer->dstadr->fd,
+ stoa(&peer->dstadr->sin)));
+ else
+ DPRINTF(3, ("newpeer(%s): local interface currently not bound\n",
+ stoa(srcadr)));
+
+ /*
+ * Broadcast needs the socket enabled for broadcast
+ */
+ if ((MDF_BCAST & cast_flags) && peer->dstadr != NULL)
+ enable_broadcast(peer->dstadr, srcadr);
+
+ /*
+ * Multicast needs the socket interface enabled for multicast
+ */
+ if ((MDF_MCAST & cast_flags) && peer->dstadr != NULL)
+ enable_multicast_if(peer->dstadr, srcadr);
+
+#ifdef AUTOKEY
+ if (key > NTP_MAXKEY)
+ peer->flags |= FLAG_SKEY;
+#endif /* AUTOKEY */
+ peer->ttl = ttl;
+ peer->keyid = key;
+ if (ident != NULL)
+ peer->ident = estrdup(ident);
+ peer->precision = sys_precision;
+ peer->hpoll = peer->minpoll;
+ if (cast_flags & MDF_ACAST)
+ peer_clear(peer, "ACST");
+ else if (cast_flags & MDF_POOL)
+ peer_clear(peer, "POOL");
+ else if (cast_flags & MDF_MCAST)
+ peer_clear(peer, "MCST");
+ else if (cast_flags & MDF_BCAST)
+ peer_clear(peer, "BCST");
+ else
+ peer_clear(peer, "INIT");
+ if (mode_ntpdate)
+ peer_ntpdate++;
+
+ /*
+ * Note time on statistics timers.
+ */
+ peer->timereset = current_time;
+ peer->timereachable = current_time;
+ peer->timereceived = current_time;
+
+ if (ISREFCLOCKADR(&peer->srcadr)) {
+#ifdef REFCLOCK
+ /*
+ * We let the reference clock support do clock
+ * dependent initialization. This includes setting
+ * the peer timer, since the clock may have requirements
+ * for this.
+ */
+ if (maxpoll == 0)
+ peer->maxpoll = peer->minpoll;
+ if (!refclock_newpeer(peer)) {
+ /*
+ * Dump it, something screwed up
+ */
+ set_peerdstadr(peer, NULL);
+ free_peer(peer, 0);
+ return NULL;
+ }
+#else /* REFCLOCK */
+ msyslog(LOG_ERR, "refclock %s isn't supported. ntpd was compiled without refclock support.",
+ stoa(&peer->srcadr));
+ set_peerdstadr(peer, NULL);
+ free_peer(peer, 0);
+ return NULL;
+#endif /* REFCLOCK */
+ }
+
+ /*
+ * Put the new peer in the hash tables.
+ */
+ hash = NTP_HASH_ADDR(&peer->srcadr);
+ LINK_SLIST(peer_hash[hash], peer, adr_link);
+ peer_hash_count[hash]++;
+ hash = peer->associd & NTP_HASH_MASK;
+ LINK_SLIST(assoc_hash[hash], peer, aid_link);
+ assoc_hash_count[hash]++;
+ LINK_SLIST(peer_list, peer, p_link);
+
+ restrict_source(&peer->srcadr, 0, 0);
+ mprintf_event(PEVNT_MOBIL, peer, "assoc %d", peer->associd);
+ DPRINTF(1, ("newpeer: %s->%s mode %u vers %u poll %u %u flags 0x%x 0x%x ttl %u key %08x\n",
+ latoa(peer->dstadr), stoa(&peer->srcadr), peer->hmode,
+ peer->version, peer->minpoll, peer->maxpoll, peer->flags,
+ peer->cast_flags, peer->ttl, peer->keyid));
+ return peer;
+}
+
+
+/*
+ * peer_clr_stats - clear peer module statistics counters
+ */
+void
+peer_clr_stats(void)
+{
+ findpeer_calls = 0;
+ assocpeer_calls = 0;
+ peer_allocations = 0;
+ peer_demobilizations = 0;
+ peer_timereset = current_time;
+}
+
+
+/*
+ * peer_reset - reset statistics counters
+ */
+void
+peer_reset(
+ struct peer *peer
+ )
+{
+ if (peer == NULL)
+ return;
+
+ peer->timereset = current_time;
+ peer->sent = 0;
+ peer->received = 0;
+ peer->processed = 0;
+ peer->badauth = 0;
+ peer->bogusorg = 0;
+ peer->oldpkt = 0;
+ peer->seldisptoolarge = 0;
+ peer->selbroken = 0;
+}
+
+
+/*
+ * peer_all_reset - reset all peer statistics counters
+ */
+void
+peer_all_reset(void)
+{
+ struct peer *peer;
+
+ for (peer = peer_list; peer != NULL; peer = peer->p_link)
+ peer_reset(peer);
+}
+
+
+/*
+ * findmanycastpeer - find and return a manycastclient or pool
+ * association matching a received response.
+ */
+struct peer *
+findmanycastpeer(
+ struct recvbuf *rbufp /* receive buffer pointer */
+ )
+{
+ struct peer *peer;
+ struct pkt *pkt;
+ l_fp p_org;
+
+ /*
+ * This routine is called upon arrival of a server-mode response
+ * to a manycastclient multicast solicitation, or to a pool
+ * server unicast solicitation. Search the peer list for a
+ * manycastclient association where the last transmit timestamp
+ * matches the response packet's originate timestamp. There can
+ * be multiple manycastclient associations, or multiple pool
+ * solicitation assocations, so this assumes the transmit
+ * timestamps are unique for such.
+ */
+ pkt = &rbufp->recv_pkt;
+ for (peer = peer_list; peer != NULL; peer = peer->p_link)
+ if (MDF_SOLICIT_MASK & peer->cast_flags) {
+ NTOHL_FP(&pkt->org, &p_org);
+ if (L_ISEQU(&p_org, &peer->aorg))
+ break;
+ }
+
+ return peer;
+}
diff --git a/ntpd/ntp_prio_q.c b/ntpd/ntp_prio_q.c
new file mode 100644
index 0000000..703673b
--- /dev/null
+++ b/ntpd/ntp_prio_q.c
@@ -0,0 +1,238 @@
+/* ntp_prio_q.c
+ *
+ * This file contains the priority queue implementation used by the
+ * discrete event simulator.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Copyright (c) 2006
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ntp_stdlib.h>
+#include <ntp_prio_q.h>
+
+/* Priority Queue
+ * --------------
+ * Define a priority queue in which the relative priority of the elements
+ * is determined by a function 'get_order' which is supplied to the
+ * priority_queue
+ */
+queue *debug_create_priority_queue(
+ q_order_func get_order
+#ifdef _CRTDBG_MAP_ALLOC
+ , const char * sourcefile
+ , int line_num
+#endif
+ )
+{
+ queue *my_queue;
+
+#ifndef _CRTDBG_MAP_ALLOC
+ my_queue = emalloc(sizeof(queue));
+#else
+ /* preserve original callsite __FILE__ and __LINE__ for leak report */
+ my_queue = debug_erealloc(NULL, sizeof(queue), sourcefile, line_num);
+#endif
+ my_queue->get_order = get_order;
+ my_queue->front = NULL;
+ my_queue->no_of_elements = 0;
+
+ return my_queue;
+}
+
+
+/* Define a function to "destroy" a priority queue, freeing-up
+ * all the allocated resources in the process
+ */
+
+void destroy_queue(
+ queue *my_queue
+ )
+{
+ node *temp = NULL;
+
+ /* Empty out the queue elements if they are not already empty */
+ while (my_queue->front != NULL) {
+ temp = my_queue->front;
+ my_queue->front = my_queue->front->node_next;
+ free(temp);
+ }
+
+ /* Now free the queue */
+ free(my_queue);
+}
+
+
+/* Define a function to allocate memory for one element
+ * of the queue. The allocated memory consists of size
+ * bytes plus the number of bytes needed for bookkeeping
+ */
+
+void *debug_get_node(
+ size_t size
+#ifdef _CRTDBG_MAP_ALLOC
+ , const char * sourcefile
+ , int line_num
+#endif
+ )
+{
+ node *new_node;
+
+#ifndef _CRTDBG_MAP_ALLOC
+ new_node = emalloc(sizeof(*new_node) + size);
+#else
+ new_node = debug_erealloc(NULL, sizeof(*new_node) + size,
+ sourcefile, line_num);
+#endif
+ new_node->node_next = NULL;
+
+ return new_node + 1;
+}
+
+/* Define a function to free the allocated memory for a queue node */
+void free_node(
+ void *my_node
+ )
+{
+ node *old_node = my_node;
+
+ free(old_node - 1);
+}
+
+
+void *
+next_node(
+ void *pv
+ )
+{
+ node *pn;
+
+ pn = pv;
+ pn--;
+
+ if (pn->node_next == NULL)
+ return NULL;
+
+ return pn->node_next + 1;
+}
+
+
+/* Define a function to check if the queue is empty. */
+int empty(
+ queue *my_queue
+ )
+{
+ return (!my_queue || !my_queue->front);
+}
+
+
+void *
+queue_head(
+ queue *q
+ )
+{
+ if (NULL == q || NULL == q->front)
+ return NULL;
+
+ return q->front + 1;
+}
+
+
+/* Define a function to add an element to the priority queue.
+ * The element is added according to its priority -
+ * relative priority is given by the get_order function
+ */
+queue *enqueue(
+ queue * my_queue,
+ void * my_node
+ )
+{
+ node *new_node = (node *)my_node - 1;
+ node *i = NULL;
+ node *j = my_queue->front;
+
+ while (j != NULL &&
+ (*my_queue->get_order)(new_node + 1, j + 1) > 0) {
+ i = j;
+ j = j->node_next;
+ }
+
+ if (i == NULL) { /* Insert at beginning of the queue */
+ new_node->node_next = my_queue->front;
+ my_queue->front = new_node;
+ } else { /* Insert Elsewhere, including the end */
+ new_node->node_next = i->node_next;
+ i->node_next = new_node;
+ }
+
+ ++my_queue->no_of_elements;
+ return my_queue;
+}
+
+
+/* Define a function to dequeue the first element from the priority
+ * queue and return it
+ */
+void *dequeue(
+ queue *my_queue
+ )
+{
+ node *my_node = my_queue->front;
+
+ if (my_node != NULL) {
+ my_queue->front = my_node->node_next;
+ --my_queue->no_of_elements;
+ return my_node + 1;
+ } else
+ return NULL;
+}
+
+
+/* Define a function that returns the number of elements in the
+ * priority queue
+ */
+int get_no_of_elements(
+ queue *my_queue
+ )
+{
+ return my_queue->no_of_elements;
+}
+
+
+/* Define a function to append a queue onto another.
+ * Note: there is a faster way (O(1) as opposed to O(n))
+ * to do this for simple (FIFO) queues, but we can't rely on
+ * that for priority queues. (Given the current representation)
+ *
+ * I don't anticipate this to be a problem. If it does turn
+ * out to be a bottleneck, I will consider replacing the
+ * current implementation with a binomial or fibonacci heap.
+ */
+void append_queue(
+ queue *q1,
+ queue *q2
+ )
+{
+ while (!empty(q2))
+ enqueue(q1, dequeue(q2));
+ destroy_queue(q2);
+}
+
+
+/* FIFO Queue
+ * ----------
+ * Use the priority queue to create a traditional FIFO queue.
+ * The only extra function needed is the create_queue
+ */
+
+/* C is not Lisp and does not allow anonymous lambda functions :-(.
+ * So define a get_fifo_order function here
+ */
+int get_fifo_order(const void *el1, const void *el2)
+{
+ return 1;
+}
diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c
new file mode 100644
index 0000000..2f7543f
--- /dev/null
+++ b/ntpd/ntp_proto.c
@@ -0,0 +1,4168 @@
+/*
+ * ntp_proto.c - NTP version 4 protocol machinery
+ *
+ * ATTENTION: Get approval from Dave Mills on all changes to this file!
+ *
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "ntp_control.h"
+#include "ntp_string.h"
+#include "ntp_leapsec.h"
+
+#include <stdio.h>
+#ifdef HAVE_LIBSCF_H
+#include <libscf.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/*
+ * This macro defines the authentication state. If x is 1 authentication
+ * is required; othewise it is optional.
+ */
+#define AUTH(x, y) ((x) ? (y) == AUTH_OK : (y) == AUTH_OK || \
+ (y) == AUTH_NONE)
+
+#define AUTH_NONE 0 /* authentication not required */
+#define AUTH_OK 1 /* authentication OK */
+#define AUTH_ERROR 2 /* authentication error */
+#define AUTH_CRYPTO 3 /* crypto_NAK */
+
+/*
+ * traffic shaping parameters
+ */
+#define NTP_IBURST 6 /* packets in iburst */
+#define RESP_DELAY 1 /* refclock burst delay (s) */
+
+/*
+ * pool soliciting restriction duration (s)
+ */
+#define POOL_SOLICIT_WINDOW 8
+
+/*
+ * peer_select groups statistics for a peer used by clock_select() and
+ * clock_cluster().
+ */
+typedef struct peer_select_tag {
+ struct peer * peer;
+ double synch; /* sync distance */
+ double error; /* jitter */
+ double seljit; /* selection jitter */
+} peer_select;
+
+/*
+ * System variables are declared here. Unless specified otherwise, all
+ * times are in seconds.
+ */
+u_char sys_leap; /* system leap indicator */
+u_char sys_stratum; /* system stratum */
+s_char sys_precision; /* local clock precision (log2 s) */
+double sys_rootdelay; /* roundtrip delay to primary source */
+double sys_rootdisp; /* dispersion to primary source */
+u_int32 sys_refid; /* reference id (network byte order) */
+l_fp sys_reftime; /* last update time */
+struct peer *sys_peer; /* current peer */
+
+/*
+ * Rate controls. Leaky buckets are used to throttle the packet
+ * transmission rates in order to protect busy servers such as at NIST
+ * and USNO. There is a counter for each association and another for KoD
+ * packets. The association counter decrements each second, but not
+ * below zero. Each time a packet is sent the counter is incremented by
+ * a configurable value representing the average interval between
+ * packets. A packet is delayed as long as the counter is greater than
+ * zero. Note this does not affect the time value computations.
+ */
+/*
+ * Nonspecified system state variables
+ */
+int sys_bclient; /* broadcast client enable */
+double sys_bdelay; /* broadcast client default delay */
+int sys_authenticate; /* requre authentication for config */
+l_fp sys_authdelay; /* authentication delay */
+double sys_offset; /* current local clock offset */
+double sys_mindisp = MINDISPERSE; /* minimum distance (s) */
+double sys_maxdist = MAXDISTANCE; /* selection threshold */
+double sys_jitter; /* system jitter */
+u_long sys_epoch; /* last clock update time */
+static double sys_clockhop; /* clockhop threshold */
+static int leap_vote_ins; /* leap consensus for insert */
+static int leap_vote_del; /* leap consensus for delete */
+keyid_t sys_private; /* private value for session seed */
+int sys_manycastserver; /* respond to manycast client pkts */
+int ntp_mode7; /* respond to ntpdc (mode7) */
+int peer_ntpdate; /* active peers in ntpdate mode */
+int sys_survivors; /* truest of the truechimers */
+char *sys_ident = NULL; /* identity scheme */
+
+/*
+ * TOS and multicast mapping stuff
+ */
+int sys_floor = 0; /* cluster stratum floor */
+int sys_ceiling = STRATUM_UNSPEC - 1; /* cluster stratum ceiling */
+int sys_minsane = 1; /* minimum candidates */
+int sys_minclock = NTP_MINCLOCK; /* minimum candidates */
+int sys_maxclock = NTP_MAXCLOCK; /* maximum candidates */
+int sys_cohort = 0; /* cohort switch */
+int sys_orphan = STRATUM_UNSPEC + 1; /* orphan stratum */
+int sys_orphwait = NTP_ORPHWAIT; /* orphan wait */
+int sys_beacon = BEACON; /* manycast beacon interval */
+int sys_ttlmax; /* max ttl mapping vector index */
+u_char sys_ttl[MAX_TTL]; /* ttl mapping vector */
+
+/*
+ * Statistics counters - first the good, then the bad
+ */
+u_long sys_stattime; /* elapsed time */
+u_long sys_received; /* packets received */
+u_long sys_processed; /* packets for this host */
+u_long sys_newversion; /* current version */
+u_long sys_oldversion; /* old version */
+u_long sys_restricted; /* access denied */
+u_long sys_badlength; /* bad length or format */
+u_long sys_badauth; /* bad authentication */
+u_long sys_declined; /* declined */
+u_long sys_limitrejected; /* rate exceeded */
+u_long sys_kodsent; /* KoD sent */
+
+static double root_distance (struct peer *);
+static void clock_combine (peer_select *, int, int);
+static void peer_xmit (struct peer *);
+static void fast_xmit (struct recvbuf *, int, keyid_t, int);
+static void pool_xmit (struct peer *);
+static void clock_update (struct peer *);
+static void measure_precision(void);
+static double measure_tick_fuzz(void);
+static int local_refid (struct peer *);
+static int peer_unfit (struct peer *);
+#ifdef AUTOKEY
+static int group_test (char *, char *);
+#endif /* AUTOKEY */
+#ifdef WORKER
+void pool_name_resolved (int, int, void *, const char *,
+ const char *, const struct addrinfo *,
+ const struct addrinfo *);
+#endif /* WORKER */
+
+
+/*
+ * transmit - transmit procedure called by poll timeout
+ */
+void
+transmit(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ u_char hpoll;
+
+ /*
+ * The polling state machine. There are two kinds of machines,
+ * those that never expect a reply (broadcast and manycast
+ * server modes) and those that do (all other modes). The dance
+ * is intricate...
+ */
+ hpoll = peer->hpoll;
+
+ /*
+ * In broadcast mode the poll interval is never changed from
+ * minpoll.
+ */
+ if (peer->cast_flags & (MDF_BCAST | MDF_MCAST)) {
+ peer->outdate = current_time;
+ if (sys_leap != LEAP_NOTINSYNC)
+ peer_xmit(peer);
+ poll_update(peer, hpoll);
+ return;
+ }
+
+ /*
+ * In manycast mode we start with unity ttl. The ttl is
+ * increased by one for each poll until either sys_maxclock
+ * servers have been found or the maximum ttl is reached. When
+ * sys_maxclock servers are found we stop polling until one or
+ * more servers have timed out or until less than sys_minclock
+ * associations turn up. In this case additional better servers
+ * are dragged in and preempt the existing ones. Once every
+ * sys_beacon seconds we are to transmit unconditionally, but
+ * this code is not quite right -- peer->unreach counts polls
+ * and is being compared with sys_beacon, so the beacons happen
+ * every sys_beacon polls.
+ */
+ if (peer->cast_flags & MDF_ACAST) {
+ peer->outdate = current_time;
+ if (peer->unreach > sys_beacon) {
+ peer->unreach = 0;
+ peer->ttl = 0;
+ peer_xmit(peer);
+ } else if (sys_survivors < sys_minclock ||
+ peer_associations < sys_maxclock) {
+ if (peer->ttl < (u_int32)sys_ttlmax)
+ peer->ttl++;
+ peer_xmit(peer);
+ }
+ peer->unreach++;
+ poll_update(peer, hpoll);
+ return;
+ }
+
+ /*
+ * Pool associations transmit unicast solicitations when there
+ * are less than a hard limit of 2 * sys_maxclock associations,
+ * and either less than sys_minclock survivors or less than
+ * sys_maxclock associations. The hard limit prevents unbounded
+ * growth in associations if the system clock or network quality
+ * result in survivor count dipping below sys_minclock often.
+ * This was observed testing with pool, where sys_maxclock == 12
+ * resulted in 60 associations without the hard limit. A
+ * similar hard limit on manycastclient ephemeral associations
+ * may be appropriate.
+ */
+ if (peer->cast_flags & MDF_POOL) {
+ peer->outdate = current_time;
+ if ((peer_associations <= 2 * sys_maxclock) &&
+ (peer_associations < sys_maxclock ||
+ sys_survivors < sys_minclock))
+ pool_xmit(peer);
+ poll_update(peer, hpoll);
+ return;
+ }
+
+ /*
+ * In unicast modes the dance is much more intricate. It is
+ * designed to back off whenever possible to minimize network
+ * traffic.
+ */
+ if (peer->burst == 0) {
+ u_char oreach;
+
+ /*
+ * Update the reachability status. If not heard for
+ * three consecutive polls, stuff infinity in the clock
+ * filter.
+ */
+ oreach = peer->reach;
+ peer->outdate = current_time;
+ peer->unreach++;
+ peer->reach <<= 1;
+ if (!peer->reach) {
+
+ /*
+ * Here the peer is unreachable. If it was
+ * previously reachable raise a trap. Send a
+ * burst if enabled.
+ */
+ clock_filter(peer, 0., 0., MAXDISPERSE);
+ if (oreach) {
+ peer_unfit(peer);
+ report_event(PEVNT_UNREACH, peer, NULL);
+ }
+ if ((peer->flags & FLAG_IBURST) &&
+ peer->retry == 0)
+ peer->retry = NTP_RETRY;
+ } else {
+
+ /*
+ * Here the peer is reachable. Send a burst if
+ * enabled and the peer is fit. Reset unreach
+ * for persistent and ephemeral associations.
+ * Unreach is also reset for survivors in
+ * clock_select().
+ */
+ hpoll = sys_poll;
+ if (!(peer->flags & FLAG_PREEMPT))
+ peer->unreach = 0;
+ if ((peer->flags & FLAG_BURST) && peer->retry ==
+ 0 && !peer_unfit(peer))
+ peer->retry = NTP_RETRY;
+ }
+
+ /*
+ * Watch for timeout. If ephemeral, toss the rascal;
+ * otherwise, bump the poll interval. Note the
+ * poll_update() routine will clamp it to maxpoll.
+ * If preemptible and we have more peers than maxclock,
+ * and this peer has the minimum score of preemptibles,
+ * demobilize.
+ */
+ if (peer->unreach >= NTP_UNREACH) {
+ hpoll++;
+ /* ephemeral: no FLAG_CONFIG nor FLAG_PREEMPT */
+ if (!(peer->flags & (FLAG_CONFIG | FLAG_PREEMPT))) {
+ report_event(PEVNT_RESTART, peer, "timeout");
+ peer_clear(peer, "TIME");
+ unpeer(peer);
+ return;
+ }
+ if ((peer->flags & FLAG_PREEMPT) &&
+ (peer_associations > sys_maxclock) &&
+ score_all(peer)) {
+ report_event(PEVNT_RESTART, peer, "timeout");
+ peer_clear(peer, "TIME");
+ unpeer(peer);
+ return;
+ }
+ }
+ } else {
+ peer->burst--;
+ if (peer->burst == 0) {
+
+ /*
+ * If ntpdate mode and the clock has not been
+ * set and all peers have completed the burst,
+ * we declare a successful failure.
+ */
+ if (mode_ntpdate) {
+ peer_ntpdate--;
+ if (peer_ntpdate == 0) {
+ msyslog(LOG_NOTICE,
+ "ntpd: no servers found");
+ if (!msyslog_term)
+ printf(
+ "ntpd: no servers found\n");
+ exit (0);
+ }
+ }
+ }
+ }
+ if (peer->retry > 0)
+ peer->retry--;
+
+ /*
+ * Do not transmit if in broadcast client mode.
+ */
+ if (peer->hmode != MODE_BCLIENT)
+ peer_xmit(peer);
+ poll_update(peer, hpoll);
+}
+
+
+/*
+ * receive - receive procedure called for each packet received
+ */
+void
+receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct peer *peer; /* peer structure pointer */
+ register struct pkt *pkt; /* receive packet pointer */
+ u_char hisversion; /* packet version */
+ u_char hisleap; /* packet leap indicator */
+ u_char hismode; /* packet mode */
+ u_char hisstratum; /* packet stratum */
+ u_short restrict_mask; /* restrict bits */
+ int has_mac; /* length of MAC field */
+ int authlen; /* offset of MAC field */
+ int is_authentic = 0; /* cryptosum ok */
+ int retcode = AM_NOMATCH; /* match code */
+ keyid_t skeyid = 0; /* key IDs */
+ u_int32 opcode = 0; /* extension field opcode */
+ sockaddr_u *dstadr_sin; /* active runway */
+ struct peer *peer2; /* aux peer structure pointer */
+ endpt * match_ep; /* newpeer() local address */
+ l_fp p_org; /* origin timestamp */
+ l_fp p_rec; /* receive timestamp */
+ l_fp p_xmt; /* transmit timestamp */
+#ifdef AUTOKEY
+ char hostname[NTP_MAXSTRLEN + 1];
+ char *groupname = NULL;
+ struct autokey *ap; /* autokey structure pointer */
+ int rval; /* cookie snatcher */
+ keyid_t pkeyid = 0, tkeyid = 0; /* key IDs */
+#endif /* AUTOKEY */
+#ifdef HAVE_NTP_SIGND
+ static unsigned char zero_key[16];
+#endif /* HAVE_NTP_SIGND */
+
+ /*
+ * Monitor the packet and get restrictions. Note that the packet
+ * length for control and private mode packets must be checked
+ * by the service routines. Some restrictions have to be handled
+ * later in order to generate a kiss-o'-death packet.
+ */
+ /*
+ * Bogus port check is before anything, since it probably
+ * reveals a clogging attack.
+ */
+ sys_received++;
+ if (0 == SRCPORT(&rbufp->recv_srcadr)) {
+ sys_badlength++;
+ return; /* bogus port */
+ }
+ restrict_mask = restrictions(&rbufp->recv_srcadr);
+ DPRINTF(2, ("receive: at %ld %s<-%s flags %x restrict %03x\n",
+ current_time, stoa(&rbufp->dstadr->sin),
+ stoa(&rbufp->recv_srcadr),
+ rbufp->dstadr->flags, restrict_mask));
+ pkt = &rbufp->recv_pkt;
+ hisversion = PKT_VERSION(pkt->li_vn_mode);
+ hisleap = PKT_LEAP(pkt->li_vn_mode);
+ hismode = (int)PKT_MODE(pkt->li_vn_mode);
+ hisstratum = PKT_TO_STRATUM(pkt->stratum);
+ if (restrict_mask & RES_IGNORE) {
+ sys_restricted++;
+ return; /* ignore everything */
+ }
+ if (hismode == MODE_PRIVATE) {
+ if (!ntp_mode7 || (restrict_mask & RES_NOQUERY)) {
+ sys_restricted++;
+ return; /* no query private */
+ }
+ process_private(rbufp, ((restrict_mask &
+ RES_NOMODIFY) == 0));
+ return;
+ }
+ if (hismode == MODE_CONTROL) {
+ if (restrict_mask & RES_NOQUERY) {
+ sys_restricted++;
+ return; /* no query control */
+ }
+ process_control(rbufp, restrict_mask);
+ return;
+ }
+ if (restrict_mask & RES_DONTSERVE) {
+ sys_restricted++;
+ return; /* no time serve */
+ }
+
+ /*
+ * This is for testing. If restricted drop ten percent of
+ * surviving packets.
+ */
+ if (restrict_mask & RES_FLAKE) {
+ if ((double)ntp_random() / 0x7fffffff < .1) {
+ sys_restricted++;
+ return; /* no flakeway */
+ }
+ }
+
+ /*
+ * Version check must be after the query packets, since they
+ * intentionally use an early version.
+ */
+ if (hisversion == NTP_VERSION) {
+ sys_newversion++; /* new version */
+ } else if (!(restrict_mask & RES_VERSION) && hisversion >=
+ NTP_OLDVERSION) {
+ sys_oldversion++; /* previous version */
+ } else {
+ sys_badlength++;
+ return; /* old version */
+ }
+
+ /*
+ * Figure out his mode and validate the packet. This has some
+ * legacy raunch that probably should be removed. In very early
+ * NTP versions mode 0 was equivalent to what later versions
+ * would interpret as client mode.
+ */
+ if (hismode == MODE_UNSPEC) {
+ if (hisversion == NTP_OLDVERSION) {
+ hismode = MODE_CLIENT;
+ } else {
+ sys_badlength++;
+ return; /* invalid mode */
+ }
+ }
+
+ /*
+ * Parse the extension field if present. We figure out whether
+ * an extension field is present by measuring the MAC size. If
+ * the number of words following the packet header is 0, no MAC
+ * is present and the packet is not authenticated. If 1, the
+ * packet is a crypto-NAK; if 3, the packet is authenticated
+ * with DES; if 5, the packet is authenticated with MD5; if 6,
+ * the packet is authenticated with SHA. If 2 or * 4, the packet
+ * is a runt and discarded forthwith. If greater than 6, an
+ * extension field is present, so we subtract the length of the
+ * field and go around again.
+ */
+ authlen = LEN_PKT_NOMAC;
+ has_mac = rbufp->recv_length - authlen;
+ while (has_mac != 0) {
+ u_int32 len;
+#ifdef AUTOKEY
+ u_int32 hostlen;
+ struct exten *ep;
+#endif /*AUTOKEY */
+
+ if (has_mac % 4 != 0 || has_mac < MIN_MAC_LEN) {
+ sys_badlength++;
+ return; /* bad length */
+ }
+ if (has_mac <= MAX_MAC_LEN) {
+ skeyid = ntohl(((u_int32 *)pkt)[authlen / 4]);
+ break;
+
+ } else {
+ opcode = ntohl(((u_int32 *)pkt)[authlen / 4]);
+ len = opcode & 0xffff;
+ if (len % 4 != 0 || len < 4 || (int)len +
+ authlen > rbufp->recv_length) {
+ sys_badlength++;
+ return; /* bad length */
+ }
+#ifdef AUTOKEY
+ /*
+ * Extract calling group name for later. If
+ * sys_groupname is non-NULL, there must be
+ * a group name provided to elicit a response.
+ */
+ 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)) {
+ sys_badlength++;
+ return; /* bad length */
+ }
+ memcpy(hostname, &ep->pkt, hostlen);
+ hostname[hostlen] = '\0';
+ groupname = strchr(hostname, '@');
+ if (groupname == NULL) {
+ sys_declined++;
+ return;
+ }
+ groupname++;
+ }
+#endif /* AUTOKEY */
+ authlen += len;
+ has_mac -= len;
+ }
+ }
+
+ /*
+ * If authentication required, a MAC must be present.
+ */
+ if (restrict_mask & RES_DONTTRUST && has_mac == 0) {
+ sys_restricted++;
+ return; /* access denied */
+ }
+
+ /*
+ * Update the MRU list and finger the cloggers. It can be a
+ * little expensive, so turn it off for production use.
+ * RES_LIMITED and RES_KOD will be cleared in the returned
+ * restrict_mask unless one or both actions are warranted.
+ */
+ 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 (MODE_SERVER == hismode)
+ DPRINTF(1, ("Possibly self-induced rate limiting of MODE_SERVER from %s\n",
+ stoa(&rbufp->recv_srcadr)));
+ return; /* rate exceeded */
+ }
+ if (hismode == MODE_CLIENT)
+ fast_xmit(rbufp, MODE_SERVER, skeyid,
+ restrict_mask);
+ else
+ fast_xmit(rbufp, MODE_ACTIVE, skeyid,
+ restrict_mask);
+ return; /* rate exceeded */
+ }
+ restrict_mask &= ~RES_KOD;
+
+ /*
+ * We have tossed out as many buggy packets as possible early in
+ * the game to reduce the exposure to a clogging attack. Now we
+ * have to burn some cycles to find the association and
+ * authenticate the packet if required. Note that we burn only
+ * digest cycles, again to reduce exposure. There may be no
+ * matching association and that's okay.
+ *
+ * More on the autokey mambo. Normally the local interface is
+ * found when the association was mobilized with respect to a
+ * designated remote address. We assume packets arriving from
+ * the remote address arrive via this interface and the local
+ * address used to construct the autokey is the unicast address
+ * of the interface. However, if the sender is a broadcaster,
+ * the interface broadcast address is used instead.
+ * Notwithstanding this technobabble, if the sender is a
+ * multicaster, the broadcast address is null, so we use the
+ * unicast address anyway. Don't ask.
+ */
+ peer = findpeer(rbufp, hismode, &retcode);
+ dstadr_sin = &rbufp->dstadr->sin;
+ NTOHL_FP(&pkt->org, &p_org);
+ NTOHL_FP(&pkt->rec, &p_rec);
+ NTOHL_FP(&pkt->xmt, &p_xmt);
+
+ /*
+ * Authentication is conditioned by three switches:
+ *
+ * NOPEER (RES_NOPEER) do not mobilize an association unless
+ * authenticated
+ * NOTRUST (RES_DONTTRUST) do not allow access unless
+ * authenticated (implies NOPEER)
+ * enable (sys_authenticate) master NOPEER switch, by default
+ * on
+ *
+ * The NOPEER and NOTRUST can be specified on a per-client basis
+ * using the restrict command. The enable switch if on implies
+ * NOPEER for all clients. There are four outcomes:
+ *
+ * NONE The packet has no MAC.
+ * OK the packet has a MAC and authentication succeeds
+ * ERROR the packet has a MAC and authentication fails
+ * CRYPTO crypto-NAK. The MAC has four octets only.
+ *
+ * Note: The AUTH(x, y) macro is used to filter outcomes. If x
+ * is zero, acceptable outcomes of y are NONE and OK. If x is
+ * one, the only acceptable outcome of y is OK.
+ */
+
+ if (has_mac == 0) {
+ restrict_mask &= ~RES_MSSNTP;
+ is_authentic = AUTH_NONE; /* not required */
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "receive: at %ld %s<-%s mode %d len %d\n",
+ current_time, stoa(dstadr_sin),
+ stoa(&rbufp->recv_srcadr), hismode,
+ authlen);
+#endif
+ } else if (has_mac == 4) {
+ restrict_mask &= ~RES_MSSNTP;
+ is_authentic = AUTH_CRYPTO; /* crypto-NAK */
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "receive: at %ld %s<-%s mode %d keyid %08x len %d auth %d\n",
+ current_time, stoa(dstadr_sin),
+ stoa(&rbufp->recv_srcadr), hismode, skeyid,
+ authlen + has_mac, is_authentic);
+#endif
+
+#ifdef HAVE_NTP_SIGND
+ /*
+ * If the signature is 20 bytes long, the last 16 of
+ * which are zero, then this is a Microsoft client
+ * wanting AD-style authentication of the server's
+ * reply.
+ *
+ * This is described in Microsoft's WSPP docs, in MS-SNTP:
+ * http://msdn.microsoft.com/en-us/library/cc212930.aspx
+ */
+ } else if (has_mac == MAX_MD5_LEN && (restrict_mask & RES_MSSNTP) &&
+ (retcode == AM_FXMIT || retcode == AM_NEWPASS) &&
+ (memcmp(zero_key, (char *)pkt + authlen + 4, MAX_MD5_LEN - 4) ==
+ 0)) {
+ is_authentic = AUTH_NONE;
+#endif /* HAVE_NTP_SIGND */
+
+ } else {
+ restrict_mask &= ~RES_MSSNTP;
+#ifdef AUTOKEY
+ /*
+ * For autokey modes, generate the session key
+ * and install in the key cache. Use the socket
+ * broadcast or unicast address as appropriate.
+ */
+ if (crypto_flags && skeyid > NTP_MAXKEY) {
+
+ /*
+ * More on the autokey dance (AKD). A cookie is
+ * constructed from public and private values.
+ * For broadcast packets, the cookie is public
+ * (zero). For packets that match no
+ * association, the cookie is hashed from the
+ * addresses and private value. For server
+ * packets, the cookie was previously obtained
+ * from the server. For symmetric modes, the
+ * cookie was previously constructed using an
+ * agreement protocol; however, should PKI be
+ * unavailable, we construct a fake agreement as
+ * the EXOR of the peer and host cookies.
+ *
+ * hismode ephemeral persistent
+ * =======================================
+ * active 0 cookie#
+ * passive 0% cookie#
+ * client sys cookie 0%
+ * server 0% sys cookie
+ * broadcast 0 0
+ *
+ * # if unsync, 0
+ * % can't happen
+ */
+ if (has_mac < MAX_MD5_LEN) {
+ sys_badauth++;
+ return;
+ }
+ if (hismode == MODE_BROADCAST) {
+
+ /*
+ * For broadcaster, use the interface
+ * broadcast address when available;
+ * otherwise, use the unicast address
+ * found when the association was
+ * mobilized. However, if this is from
+ * the wildcard interface, game over.
+ */
+ if (crypto_flags && rbufp->dstadr ==
+ ANY_INTERFACE_CHOOSE(&rbufp->recv_srcadr)) {
+ sys_restricted++;
+ return; /* no wildcard */
+ }
+ pkeyid = 0;
+ if (!SOCK_UNSPEC(&rbufp->dstadr->bcast))
+ dstadr_sin =
+ &rbufp->dstadr->bcast;
+ } else if (peer == NULL) {
+ pkeyid = session_key(
+ &rbufp->recv_srcadr, dstadr_sin, 0,
+ sys_private, 0);
+ } else {
+ pkeyid = peer->pcookie;
+ }
+
+ /*
+ * The session key includes both the public
+ * values and cookie. In case of an extension
+ * field, the cookie used for authentication
+ * purposes is zero. Note the hash is saved for
+ * use later in the autokey mambo.
+ */
+ if (authlen > LEN_PKT_NOMAC && pkeyid != 0) {
+ session_key(&rbufp->recv_srcadr,
+ dstadr_sin, skeyid, 0, 2);
+ tkeyid = session_key(
+ &rbufp->recv_srcadr, dstadr_sin,
+ skeyid, pkeyid, 0);
+ } else {
+ tkeyid = session_key(
+ &rbufp->recv_srcadr, dstadr_sin,
+ skeyid, pkeyid, 2);
+ }
+
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Compute the cryptosum. Note a clogging attack may
+ * succeed in bloating the key cache. If an autokey,
+ * purge it immediately, since we won't be needing it
+ * again. If the packet is authentic, it can mobilize an
+ * association. Note that there is no key zero.
+ */
+ if (!authdecrypt(skeyid, (u_int32 *)pkt, authlen,
+ has_mac))
+ is_authentic = AUTH_ERROR;
+ else
+ is_authentic = AUTH_OK;
+#ifdef AUTOKEY
+ if (crypto_flags && skeyid > NTP_MAXKEY)
+ authtrust(skeyid, 0);
+#endif /* AUTOKEY */
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "receive: at %ld %s<-%s mode %d keyid %08x len %d auth %d\n",
+ current_time, stoa(dstadr_sin),
+ stoa(&rbufp->recv_srcadr), hismode, skeyid,
+ authlen + has_mac, is_authentic);
+#endif
+ }
+
+ /*
+ * The association matching rules are implemented by a set of
+ * routines and an association table. A packet matching an
+ * association is processed by the peer process for that
+ * association. If there are no errors, an ephemeral association
+ * is mobilized: a broadcast packet mobilizes a broadcast client
+ * aassociation; a manycast server packet mobilizes a manycast
+ * client association; a symmetric active packet mobilizes a
+ * symmetric passive association.
+ */
+ switch (retcode) {
+
+ /*
+ * This is a client mode packet not matching any association. If
+ * an ordinary client, simply toss a server mode packet back
+ * over the fence. If a manycast client, we have to work a
+ * little harder.
+ */
+ case AM_FXMIT:
+
+ /*
+ * If authentication OK, send a server reply; otherwise,
+ * send a crypto-NAK.
+ */
+ if (!(rbufp->dstadr->flags & INT_MCASTOPEN)) {
+ if (AUTH(restrict_mask & RES_DONTTRUST,
+ is_authentic)) {
+ fast_xmit(rbufp, MODE_SERVER, skeyid,
+ restrict_mask);
+ } else if (is_authentic == AUTH_ERROR) {
+ fast_xmit(rbufp, MODE_SERVER, 0,
+ restrict_mask);
+ sys_badauth++;
+ } else {
+ sys_restricted++;
+ }
+ return; /* hooray */
+ }
+
+ /*
+ * This must be manycast. Do not respond if not
+ * configured as a manycast server.
+ */
+ if (!sys_manycastserver) {
+ sys_restricted++;
+ return; /* not enabled */
+ }
+
+#ifdef AUTOKEY
+ /*
+ * Do not respond if not the same group.
+ */
+ if (group_test(groupname, NULL)) {
+ sys_declined++;
+ return;
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Do not respond if we are not synchronized or our
+ * stratum is greater than the manycaster or the
+ * manycaster has already synchronized to us.
+ */
+ if (sys_leap == LEAP_NOTINSYNC || sys_stratum >=
+ hisstratum || (!sys_cohort && sys_stratum ==
+ hisstratum + 1) || rbufp->dstadr->addr_refid ==
+ pkt->refid) {
+ sys_declined++;
+ return; /* no help */
+ }
+
+ /*
+ * Respond only if authentication succeeds. Don't do a
+ * crypto-NAK, as that would not be useful.
+ */
+ if (AUTH(restrict_mask & RES_DONTTRUST, is_authentic))
+ fast_xmit(rbufp, MODE_SERVER, skeyid,
+ restrict_mask);
+ return; /* hooray */
+
+ /*
+ * This is a server mode packet returned in response to a client
+ * mode packet sent to a multicast group address (for
+ * manycastclient) or to a unicast address (for pool). The
+ * origin timestamp is a good nonce to reliably associate the
+ * reply with what was sent. If there is no match, that's
+ * curious and could be an intruder attempting to clog, so we
+ * just ignore it.
+ *
+ * If the packet is authentic and the manycastclient or pool
+ * association is found, we mobilize a client association and
+ * copy pertinent variables from the manycastclient or pool
+ * association to the new client association. If not, just
+ * ignore the packet.
+ *
+ * There is an implosion hazard at the manycast client, since
+ * the manycast servers send the server packet immediately. If
+ * the guy is already here, don't fire up a duplicate.
+ */
+ case AM_MANYCAST:
+
+#ifdef AUTOKEY
+ /*
+ * Do not respond if not the same group.
+ */
+ if (group_test(groupname, NULL)) {
+ sys_declined++;
+ return;
+ }
+#endif /* AUTOKEY */
+ if ((peer2 = findmanycastpeer(rbufp)) == NULL) {
+ sys_restricted++;
+ return; /* not enabled */
+ }
+ if (!AUTH((!(peer2->cast_flags & MDF_POOL) &&
+ sys_authenticate) | (restrict_mask & (RES_NOPEER |
+ RES_DONTTRUST)), is_authentic)) {
+ sys_restricted++;
+ return; /* access denied */
+ }
+
+ /*
+ * Do not respond if unsynchronized or stratum is below
+ * the floor or at or above the ceiling.
+ */
+ if (hisleap == LEAP_NOTINSYNC || hisstratum <
+ sys_floor || hisstratum >= sys_ceiling) {
+ sys_declined++;
+ return; /* no help */
+ }
+ peer = newpeer(&rbufp->recv_srcadr, NULL, rbufp->dstadr,
+ MODE_CLIENT, hisversion, peer2->minpoll,
+ peer2->maxpoll, FLAG_PREEMPT |
+ (FLAG_IBURST & peer2->flags), MDF_UCAST |
+ MDF_UCLNT, 0, skeyid, sys_ident);
+ if (NULL == peer) {
+ sys_declined++;
+ return; /* ignore duplicate */
+ }
+
+ /*
+ * After each ephemeral pool association is spun,
+ * accelerate the next poll for the pool solicitor so
+ * the pool will fill promptly.
+ */
+ if (peer2->cast_flags & MDF_POOL)
+ peer2->nextdate = current_time + 1;
+
+ /*
+ * Further processing of the solicitation response would
+ * simply detect its origin timestamp as bogus for the
+ * brand-new association (it matches the prototype
+ * association) and tinker with peer->nextdate delaying
+ * first sync.
+ */
+ return; /* solicitation response handled */
+
+ /*
+ * This is the first packet received from a broadcast server. If
+ * the packet is authentic and we are enabled as broadcast
+ * client, mobilize a broadcast client association. We don't
+ * kiss any frogs here.
+ */
+ case AM_NEWBCL:
+
+#ifdef AUTOKEY
+ /*
+ * Do not respond if not the same group.
+ */
+ if (group_test(groupname, sys_ident)) {
+ sys_declined++;
+ return;
+ }
+#endif /* AUTOKEY */
+ if (sys_bclient == 0) {
+ sys_restricted++;
+ return; /* not enabled */
+ }
+ if (!AUTH(sys_authenticate | (restrict_mask &
+ (RES_NOPEER | RES_DONTTRUST)), is_authentic)) {
+ sys_restricted++;
+ return; /* access denied */
+ }
+
+ /*
+ * Do not respond if unsynchronized or stratum is below
+ * the floor or at or above the ceiling.
+ */
+ if (hisleap == LEAP_NOTINSYNC || hisstratum <
+ sys_floor || hisstratum >= sys_ceiling) {
+ sys_declined++;
+ return; /* no help */
+ }
+
+#ifdef AUTOKEY
+ /*
+ * 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)) {
+ sys_declined++;
+ return; /* protocol error */
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Broadcasts received via a multicast address may
+ * arrive after a unicast volley has begun
+ * with the same remote address. newpeer() will not
+ * find duplicate associations on other local endpoints
+ * if a non-NULL endpoint is supplied. multicastclient
+ * ephemeral associations are unique across all local
+ * endpoints.
+ */
+ if (!(INT_MCASTOPEN & rbufp->dstadr->flags))
+ match_ep = rbufp->dstadr;
+ else
+ match_ep = NULL;
+
+ /*
+ * Determine whether to execute the initial volley.
+ */
+ if (sys_bdelay != 0) {
+#ifdef AUTOKEY
+ /*
+ * If a two-way exchange is not possible,
+ * neither is Autokey.
+ */
+ if (crypto_flags && skeyid > NTP_MAXKEY) {
+ sys_restricted++;
+ return; /* no autokey */
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Do not execute the volley. Start out in
+ * broadcast client mode.
+ */
+ peer = newpeer(&rbufp->recv_srcadr, NULL,
+ match_ep, MODE_BCLIENT, hisversion,
+ pkt->ppoll, pkt->ppoll, FLAG_PREEMPT,
+ MDF_BCLNT, 0, skeyid, sys_ident);
+ if (NULL == peer) {
+ sys_restricted++;
+ return; /* ignore duplicate */
+
+ } else {
+ peer->delay = sys_bdelay;
+ }
+ break;
+ }
+
+ /*
+ * Execute the initial volley in order to calibrate the
+ * propagation delay and run the Autokey protocol.
+ *
+ * Note that the minpoll is taken from the broadcast
+ * packet, normally 6 (64 s) and that the poll interval
+ * is fixed at this value.
+ */
+ peer = newpeer(&rbufp->recv_srcadr, NULL, match_ep,
+ MODE_CLIENT, hisversion, pkt->ppoll, pkt->ppoll,
+ FLAG_BC_VOL | FLAG_IBURST | FLAG_PREEMPT, MDF_BCLNT,
+ 0, skeyid, sys_ident);
+ if (NULL == peer) {
+ sys_restricted++;
+ return; /* ignore duplicate */
+ }
+#ifdef AUTOKEY
+ if (skeyid > NTP_MAXKEY)
+ crypto_recv(peer, rbufp);
+#endif /* AUTOKEY */
+
+ return; /* hooray */
+
+ /*
+ * This is the first packet received from a symmetric active
+ * peer. If the packet is authentic and the first he sent,
+ * mobilize a passive association. If not, kiss the frog.
+ */
+ case AM_NEWPASS:
+
+#ifdef AUTOKEY
+ /*
+ * Do not respond if not the same group.
+ */
+ if (group_test(groupname, sys_ident)) {
+ sys_declined++;
+ return;
+ }
+#endif /* AUTOKEY */
+ if (!AUTH(sys_authenticate | (restrict_mask &
+ (RES_NOPEER | RES_DONTTRUST)), is_authentic)) {
+
+ /*
+ * If authenticated but cannot mobilize an
+ * association, send a symmetric passive
+ * response without mobilizing an association.
+ * This is for drat broken Windows clients. See
+ * Microsoft KB 875424 for preferred workaround.
+ */
+ if (AUTH(restrict_mask & RES_DONTTRUST,
+ is_authentic)) {
+ fast_xmit(rbufp, MODE_PASSIVE, skeyid,
+ restrict_mask);
+ return; /* hooray */
+ }
+ if (is_authentic == AUTH_ERROR) {
+ fast_xmit(rbufp, MODE_ACTIVE, 0,
+ restrict_mask);
+ sys_restricted++;
+ }
+ }
+
+ /*
+ * Do not respond if synchronized and if stratum is
+ * below the floor or at or above the ceiling. Note,
+ * this allows an unsynchronized peer to synchronize to
+ * us. It would be very strange if he did and then was
+ * nipped, but that could only happen if we were
+ * operating at the top end of the range. It also means
+ * 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)) {
+ sys_declined++;
+ return; /* no help */
+ }
+
+ /*
+ * The message is correctly authenticated and allowed.
+ * Mobilize a symmetric passive association.
+ */
+ if ((peer = newpeer(&rbufp->recv_srcadr, NULL,
+ rbufp->dstadr, MODE_PASSIVE, hisversion, pkt->ppoll,
+ NTP_MAXDPOLL, 0, MDF_UCAST, 0, skeyid,
+ sys_ident)) == NULL) {
+ sys_declined++;
+ return; /* ignore duplicate */
+ }
+ break;
+
+
+ /*
+ * Process regular packet. Nothing special.
+ */
+ case AM_PROCPKT:
+
+#ifdef AUTOKEY
+ /*
+ * Do not respond if not the same group.
+ */
+ if (group_test(groupname, peer->ident)) {
+ sys_declined++;
+ return;
+ }
+#endif /* AUTOKEY */
+ break;
+
+ /*
+ * A passive packet matches a passive association. This is
+ * usually the result of reconfiguring a client on the fly. As
+ * this association might be legitimate and this packet an
+ * attempt to deny service, just ignore it.
+ */
+ case AM_ERR:
+ sys_declined++;
+ return;
+
+ /*
+ * For everything else there is the bit bucket.
+ */
+ default:
+ sys_declined++;
+ return;
+ }
+
+#ifdef AUTOKEY
+ /*
+ * If the association is configured for Autokey, the packet must
+ * have a public key ID; if not, the packet must have a
+ * symmetric key ID.
+ */
+ if (is_authentic != AUTH_CRYPTO && (((peer->flags &
+ FLAG_SKEY) && skeyid <= NTP_MAXKEY) || (!(peer->flags &
+ FLAG_SKEY) && skeyid > NTP_MAXKEY))) {
+ sys_badauth++;
+ return;
+ }
+#endif /* AUTOKEY */
+ peer->received++;
+ peer->flash &= ~PKT_TEST_MASK;
+ if (peer->flags & FLAG_XBOGUS) {
+ peer->flags &= ~FLAG_XBOGUS;
+ peer->flash |= TEST3;
+ }
+
+ /*
+ * Next comes a rigorous schedule of timestamp checking. If the
+ * transmit timestamp is zero, the server has not initialized in
+ * interleaved modes or is horribly broken.
+ */
+ if (L_ISZERO(&p_xmt)) {
+ peer->flash |= TEST3; /* unsynch */
+
+ /*
+ * If the transmit timestamp duplicates a previous one, the
+ * packet is a replay. This prevents the bad guys from replaying
+ * the most recent packet, authenticated or not.
+ */
+ } else if (L_ISEQU(&peer->xmt, &p_xmt)) {
+ peer->flash |= TEST1; /* duplicate */
+ peer->oldpkt++;
+ return;
+
+ /*
+ * If this is a broadcast mode packet, skip further checking. If
+ * an initial volley, bail out now and let the client do its
+ * stuff. If the origin timestamp is nonzero, this is an
+ * interleaved broadcast. so restart the protocol.
+ */
+ } else if (hismode == MODE_BROADCAST) {
+ if (!L_ISZERO(&p_org) && !(peer->flags & FLAG_XB)) {
+ peer->flags |= FLAG_XB;
+ peer->aorg = p_xmt;
+ peer->borg = rbufp->recv_time;
+ report_event(PEVNT_XLEAVE, peer, NULL);
+ return;
+ }
+
+ /*
+ * Check for bogus packet in basic mode. If found, switch to
+ * interleaved mode and resynchronize, but only after confirming
+ * the packet is not bogus in symmetric interleaved mode.
+ */
+ } else if (peer->flip == 0) {
+ if (!L_ISEQU(&p_org, &peer->aorg)) {
+ peer->bogusorg++;
+ peer->flash |= TEST2; /* bogus */
+ if (!L_ISZERO(&peer->dst) && L_ISEQU(&p_org,
+ &peer->dst)) {
+ peer->flip = 1;
+ report_event(PEVNT_XLEAVE, peer, NULL);
+ }
+ } else {
+ L_CLR(&peer->aorg);
+ }
+
+ /*
+ * Check for valid nonzero timestamp fields.
+ */
+ } else if (L_ISZERO(&p_org) || L_ISZERO(&p_rec) ||
+ L_ISZERO(&peer->dst)) {
+ peer->flash |= TEST3; /* unsynch */
+
+ /*
+ * Check for bogus packet in interleaved symmetric mode. This
+ * can happen if a packet is lost, duplicated or crossed. If
+ * found, flip and resynchronize.
+ */
+ } else if (!L_ISZERO(&peer->dst) && !L_ISEQU(&p_org,
+ &peer->dst)) {
+ peer->bogusorg++;
+ peer->flags |= FLAG_XBOGUS;
+ peer->flash |= TEST2; /* bogus */
+ }
+
+ /*
+ * Update the state variables.
+ */
+ if (peer->flip == 0) {
+ if (hismode != MODE_BROADCAST)
+ peer->rec = p_xmt;
+ peer->dst = rbufp->recv_time;
+ }
+ peer->xmt = p_xmt;
+
+ /*
+ * If this is a crypto_NAK, the server cannot authenticate a
+ * client packet. The server might have just changed keys. Clear
+ * the association and restart the protocol.
+ */
+ if (is_authentic == AUTH_CRYPTO) {
+ report_event(PEVNT_AUTH, peer, "crypto_NAK");
+ peer->flash |= TEST5; /* bad auth */
+ peer->badauth++;
+ if (peer->flags & FLAG_PREEMPT) {
+ unpeer(peer);
+ return;
+ }
+#ifdef AUTOKEY
+ if (peer->crypto)
+ peer_clear(peer, "AUTH");
+#endif /* AUTOKEY */
+ return;
+
+ /*
+ * If the digest fails, the client cannot authenticate a server
+ * reply to a client packet previously sent. The loopback check
+ * is designed to avoid a bait-and-switch attack, which was
+ * possible in past versions. If symmetric modes, return a
+ * crypto-NAK. The peer should restart the protocol.
+ */
+ } else if (!AUTH(has_mac || (restrict_mask & RES_DONTTRUST),
+ is_authentic)) {
+ report_event(PEVNT_AUTH, peer, "digest");
+ peer->flash |= TEST5; /* bad auth */
+ peer->badauth++;
+ if (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE)
+ fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
+ if (peer->flags & FLAG_PREEMPT) {
+ unpeer(peer);
+ return;
+ }
+#ifdef AUTOKEY
+ if (peer->crypto)
+ peer_clear(peer, "AUTH");
+#endif /* AUTOKEY */
+ return;
+ }
+
+ /*
+ * Set the peer ppoll to the maximum of the packet ppoll and the
+ * peer minpoll. If a kiss-o'-death, set the peer minpoll to
+ * this maximum and advance the headway to give the sender some
+ * headroom. Very intricate.
+ */
+ peer->ppoll = max(peer->minpoll, pkt->ppoll);
+ if (hismode == MODE_SERVER && hisleap == LEAP_NOTINSYNC &&
+ hisstratum == STRATUM_UNSPEC && memcmp(&pkt->refid,
+ "RATE", 4) == 0) {
+ peer->selbroken++;
+ report_event(PEVNT_RATE, peer, NULL);
+ if (pkt->ppoll > peer->minpoll)
+ peer->minpoll = peer->ppoll;
+ peer->burst = peer->retry = 0;
+ peer->throttle = (NTP_SHIFT + 1) * (1 << peer->minpoll);
+ poll_update(peer, pkt->ppoll);
+ return; /* kiss-o'-death */
+ }
+
+ /*
+ * That was hard and I am sweaty, but the packet is squeaky
+ * clean. Get on with real work.
+ */
+ peer->timereceived = current_time;
+ if (is_authentic == AUTH_OK)
+ peer->flags |= FLAG_AUTHENTIC;
+ else
+ peer->flags &= ~FLAG_AUTHENTIC;
+
+#ifdef AUTOKEY
+ /*
+ * More autokey dance. The rules of the cha-cha are as follows:
+ *
+ * 1. If there is no key or the key is not auto, do nothing.
+ *
+ * 2. If this packet is in response to the one just previously
+ * sent or from a broadcast server, do the extension fields.
+ * Otherwise, assume bogosity and bail out.
+ *
+ * 3. If an extension field contains a verified signature, it is
+ * self-authenticated and we sit the dance.
+ *
+ * 4. If this is a server reply, check only to see that the
+ * transmitted key ID matches the received key ID.
+ *
+ * 5. Check to see that one or more hashes of the current key ID
+ * matches the previous key ID or ultimate original key ID
+ * obtained from the broadcaster or symmetric peer. If no
+ * match, sit the dance and call for new autokey values.
+ *
+ * In case of crypto error, fire the orchestra, stop dancing and
+ * restart the protocol.
+ */
+ if (peer->flags & FLAG_SKEY) {
+ /*
+ * Decrement remaining autokey hashes. This isn't
+ * perfect if a packet is lost, but results in no harm.
+ */
+ ap = (struct autokey *)peer->recval.ptr;
+ if (ap != NULL) {
+ if (ap->seq > 0)
+ ap->seq--;
+ }
+ peer->flash |= TEST8;
+ rval = crypto_recv(peer, rbufp);
+ if (rval == XEVNT_OK) {
+ peer->unreach = 0;
+ } else {
+ if (rval == XEVNT_ERR) {
+ report_event(PEVNT_RESTART, peer,
+ "crypto error");
+ peer_clear(peer, "CRYP");
+ peer->flash |= TEST9; /* bad crypt */
+ if (peer->flags & FLAG_PREEMPT)
+ unpeer(peer);
+ }
+ return;
+ }
+
+ /*
+ * If server mode, verify the receive key ID matches
+ * the transmit key ID.
+ */
+ if (hismode == MODE_SERVER) {
+ if (skeyid == peer->keyid)
+ peer->flash &= ~TEST8;
+
+ /*
+ * If an extension field is present, verify only that it
+ * has been correctly signed. We don't need a sequence
+ * check here, but the sequence continues.
+ */
+ } else if (!(peer->flash & TEST8)) {
+ peer->pkeyid = skeyid;
+
+ /*
+ * Now the fun part. Here, skeyid is the current ID in
+ * the packet, pkeyid is the ID in the last packet and
+ * tkeyid is the hash of skeyid. If the autokey values
+ * have not been received, this is an automatic error.
+ * If so, check that the tkeyid matches pkeyid. If not,
+ * hash tkeyid and try again. If the number of hashes
+ * exceeds the number remaining in the sequence, declare
+ * a successful failure and refresh the autokey values.
+ */
+ } else if (ap != NULL) {
+ int i;
+
+ for (i = 0; ; i++) {
+ if (tkeyid == peer->pkeyid ||
+ tkeyid == ap->key) {
+ peer->flash &= ~TEST8;
+ peer->pkeyid = skeyid;
+ ap->seq -= i;
+ break;
+ }
+ if (i > ap->seq) {
+ peer->crypto &=
+ ~CRYPTO_FLAG_AUTO;
+ break;
+ }
+ tkeyid = session_key(
+ &rbufp->recv_srcadr, dstadr_sin,
+ tkeyid, pkeyid, 0);
+ }
+ if (peer->flash & TEST8)
+ report_event(PEVNT_AUTH, peer, "keylist");
+ }
+ if (!(peer->crypto & CRYPTO_FLAG_PROV)) /* test 9 */
+ peer->flash |= TEST8; /* bad autokey */
+
+ /*
+ * The maximum lifetime of the protocol is about one
+ * week before restarting the Autokey protocol to
+ * refresh certificates and leapseconds values.
+ */
+ if (current_time > peer->refresh) {
+ report_event(PEVNT_RESTART, peer,
+ "crypto refresh");
+ peer_clear(peer, "TIME");
+ return;
+ }
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * The dance is complete and the flash bits have been lit. Toss
+ * the packet over the fence for processing, which may light up
+ * more flashers.
+ */
+ process_packet(peer, pkt, rbufp->recv_length);
+
+ /*
+ * In interleaved mode update the state variables. Also adjust the
+ * transmit phase to avoid crossover.
+ */
+ if (peer->flip != 0) {
+ peer->rec = p_rec;
+ peer->dst = rbufp->recv_time;
+ if (peer->nextdate - current_time < (1U << min(peer->ppoll,
+ peer->hpoll)) / 2)
+ peer->nextdate++;
+ else
+ peer->nextdate--;
+ }
+}
+
+
+/*
+ * process_packet - Packet Procedure, a la Section 3.4.4 of the
+ * specification. Or almost, at least. If we're in here we have a
+ * reasonable expectation that we will be having a long term
+ * relationship with this host.
+ */
+void
+process_packet(
+ register struct peer *peer,
+ register struct pkt *pkt,
+ u_int len
+ )
+{
+ double t34, t21;
+ double p_offset, p_del, p_disp;
+ l_fp p_rec, p_xmt, p_org, p_reftime, ci;
+ u_char pmode, pleap, pversion, pstratum;
+ char statstr[NTP_MAXSTRLEN];
+#ifdef ASSYM
+ int itemp;
+ double etemp, ftemp, td;
+#endif /* ASSYM */
+
+ sys_processed++;
+ peer->processed++;
+ p_del = FPTOD(NTOHS_FP(pkt->rootdelay));
+ p_offset = 0;
+ p_disp = FPTOD(NTOHS_FP(pkt->rootdisp));
+ NTOHL_FP(&pkt->reftime, &p_reftime);
+ NTOHL_FP(&pkt->org, &p_org);
+ NTOHL_FP(&pkt->rec, &p_rec);
+ NTOHL_FP(&pkt->xmt, &p_xmt);
+ pmode = PKT_MODE(pkt->li_vn_mode);
+ pleap = PKT_LEAP(pkt->li_vn_mode);
+ pversion = PKT_VERSION(pkt->li_vn_mode);
+ pstratum = PKT_TO_STRATUM(pkt->stratum);
+
+ /*
+ * Capture the header values in the client/peer association..
+ */
+ record_raw_stats(&peer->srcadr, peer->dstadr ?
+ &peer->dstadr->sin : NULL,
+ &p_org, &p_rec, &p_xmt, &peer->dst,
+ pleap, pversion, pmode, pstratum, pkt->ppoll, pkt->precision,
+ p_del, p_disp, pkt->refid);
+ peer->leap = pleap;
+ peer->stratum = min(pstratum, STRATUM_UNSPEC);
+ peer->pmode = pmode;
+ peer->precision = pkt->precision;
+ peer->rootdelay = p_del;
+ peer->rootdisp = p_disp;
+ peer->refid = pkt->refid; /* network byte order */
+ peer->reftime = p_reftime;
+
+ /*
+ * First, if either burst mode is armed, enable the burst.
+ * Compute the headway for the next packet and delay if
+ * necessary to avoid exceeding the threshold.
+ */
+ if (peer->retry > 0) {
+ peer->retry = 0;
+ if (peer->reach)
+ peer->burst = min(1 << (peer->hpoll -
+ peer->minpoll), NTP_SHIFT) - 1;
+ else
+ peer->burst = NTP_IBURST - 1;
+ if (peer->burst > 0)
+ peer->nextdate = current_time;
+ }
+ poll_update(peer, peer->hpoll);
+
+ /*
+ * Verify the server is synchronized; that is, the leap bits,
+ * stratum and root distance are valid.
+ */
+ if (pleap == LEAP_NOTINSYNC || /* test 6 */
+ pstratum < sys_floor || pstratum >= sys_ceiling)
+ peer->flash |= TEST6; /* bad synch or strat */
+ if (p_del / 2 + p_disp >= MAXDISPERSE) /* test 7 */
+ peer->flash |= TEST7; /* bad header */
+
+ /*
+ * If any tests fail at this point, the packet is discarded.
+ * Note that some flashers may have already been set in the
+ * receive() routine.
+ */
+ if (peer->flash & PKT_TEST_MASK) {
+ peer->seldisptoolarge++;
+#ifdef DEBUG
+ if (debug)
+ printf("packet: flash header %04x\n",
+ peer->flash);
+#endif
+ return;
+ }
+
+ /*
+ * If the peer was previously unreachable, raise a trap. In any
+ * case, mark it reachable.
+ */
+ if (!peer->reach) {
+ report_event(PEVNT_REACH, peer, NULL);
+ peer->timereachable = current_time;
+ }
+ peer->reach |= 1;
+
+ /*
+ * For a client/server association, calculate the clock offset,
+ * roundtrip delay and dispersion. The equations are reordered
+ * from the spec for more efficient use of temporaries. For a
+ * broadcast association, offset the last measurement by the
+ * computed delay during the client/server volley. Note the
+ * computation of dispersion includes the system precision plus
+ * that due to the frequency error since the origin time.
+ *
+ * It is very important to respect the hazards of overflow. The
+ * only permitted operation on raw timestamps is subtraction,
+ * where the result is a signed quantity spanning from 68 years
+ * in the past to 68 years in the future. To avoid loss of
+ * precision, these calculations are done using 64-bit integer
+ * arithmetic. However, the offset and delay calculations are
+ * sums and differences of these first-order differences, which
+ * if done using 64-bit integer arithmetic, would be valid over
+ * only half that span. Since the typical first-order
+ * differences are usually very small, they are converted to 64-
+ * bit doubles and all remaining calculations done in floating-
+ * double arithmetic. This preserves the accuracy while
+ * retaining the 68-year span.
+ *
+ * There are three interleaving schemes, basic, interleaved
+ * symmetric and interleaved broadcast. The timestamps are
+ * idioscyncratically different. See the onwire briefing/white
+ * paper at www.eecis.udel.edu/~mills for details.
+ *
+ * Interleaved symmetric mode
+ * t1 = peer->aorg/borg, t2 = peer->rec, t3 = p_xmt,
+ * t4 = peer->dst
+ */
+ if (peer->flip != 0) {
+ ci = p_xmt; /* t3 - t4 */
+ L_SUB(&ci, &peer->dst);
+ LFPTOD(&ci, t34);
+ ci = p_rec; /* t2 - t1 */
+ if (peer->flip > 0)
+ L_SUB(&ci, &peer->borg);
+ else
+ L_SUB(&ci, &peer->aorg);
+ LFPTOD(&ci, t21);
+ p_del = t21 - t34;
+ p_offset = (t21 + t34) / 2.;
+ if (p_del < 0 || p_del > 1.) {
+ snprintf(statstr, sizeof(statstr),
+ "t21 %.6f t34 %.6f", t21, t34);
+ report_event(PEVNT_XERR, peer, statstr);
+ return;
+ }
+
+ /*
+ * Broadcast modes
+ */
+ } else if (peer->pmode == MODE_BROADCAST) {
+
+ /*
+ * Interleaved broadcast mode. Use interleaved timestamps.
+ * t1 = peer->borg, t2 = p_org, t3 = p_org, t4 = aorg
+ */
+ if (peer->flags & FLAG_XB) {
+ ci = p_org; /* delay */
+ L_SUB(&ci, &peer->aorg);
+ LFPTOD(&ci, t34);
+ ci = p_org; /* t2 - t1 */
+ L_SUB(&ci, &peer->borg);
+ LFPTOD(&ci, t21);
+ peer->aorg = p_xmt;
+ peer->borg = peer->dst;
+ if (t34 < 0 || t34 > 1.) {
+ snprintf(statstr, sizeof(statstr),
+ "offset %.6f delay %.6f", t21, t34);
+ report_event(PEVNT_XERR, peer, statstr);
+ return;
+ }
+ p_offset = t21;
+ peer->xleave = t34;
+
+ /*
+ * Basic broadcast - use direct timestamps.
+ * t3 = p_xmt, t4 = peer->dst
+ */
+ } else {
+ ci = p_xmt; /* t3 - t4 */
+ L_SUB(&ci, &peer->dst);
+ LFPTOD(&ci, t34);
+ p_offset = t34;
+ }
+
+ /*
+ * When calibration is complete and the clock is
+ * synchronized, the bias is calculated as the difference
+ * between the unicast timestamp and the broadcast
+ * timestamp. This works for both basic and interleaved
+ * modes.
+ */
+ if (FLAG_BC_VOL & peer->flags) {
+ peer->flags &= ~FLAG_BC_VOL;
+ peer->delay = fabs(peer->offset - p_offset) * 2;
+ }
+ p_del = peer->delay;
+ p_offset += p_del / 2;
+
+
+ /*
+ * Basic mode, otherwise known as the old fashioned way.
+ *
+ * t1 = p_org, t2 = p_rec, t3 = p_xmt, t4 = peer->dst
+ */
+ } else {
+ ci = p_xmt; /* t3 - t4 */
+ L_SUB(&ci, &peer->dst);
+ LFPTOD(&ci, t34);
+ ci = p_rec; /* t2 - t1 */
+ L_SUB(&ci, &p_org);
+ LFPTOD(&ci, t21);
+ p_del = fabs(t21 - t34);
+ p_offset = (t21 + t34) / 2.;
+ }
+ p_del = max(p_del, LOGTOD(sys_precision));
+ p_disp = LOGTOD(sys_precision) + LOGTOD(peer->precision) +
+ clock_phi * p_del;
+
+#if ASSYM
+ /*
+ * This code calculates the outbound and inbound data rates by
+ * measuring the differences between timestamps at different
+ * packet lengths. This is helpful in cases of large asymmetric
+ * delays commonly experienced on deep space communication
+ * links.
+ */
+ if (peer->t21_last > 0 && peer->t34_bytes > 0) {
+ itemp = peer->t21_bytes - peer->t21_last;
+ if (itemp > 25) {
+ etemp = t21 - peer->t21;
+ if (fabs(etemp) > 1e-6) {
+ ftemp = itemp / etemp;
+ if (ftemp > 1000.)
+ peer->r21 = ftemp;
+ }
+ }
+ itemp = len - peer->t34_bytes;
+ if (itemp > 25) {
+ etemp = -t34 - peer->t34;
+ if (fabs(etemp) > 1e-6) {
+ ftemp = itemp / etemp;
+ if (ftemp > 1000.)
+ peer->r34 = ftemp;
+ }
+ }
+ }
+
+ /*
+ * The following section compensates for different data rates on
+ * the outbound (d21) and inbound (t34) directions. To do this,
+ * it finds t such that r21 * t - r34 * (d - t) = 0, where d is
+ * the roundtrip delay. Then it calculates the correction as a
+ * fraction of d.
+ */
+ peer->t21 = t21;
+ peer->t21_last = peer->t21_bytes;
+ peer->t34 = -t34;
+ peer->t34_bytes = len;
+#ifdef DEBUG
+ if (debug > 1)
+ printf("packet: t21 %.9lf %d t34 %.9lf %d\n", peer->t21,
+ peer->t21_bytes, peer->t34, peer->t34_bytes);
+#endif
+ if (peer->r21 > 0 && peer->r34 > 0 && p_del > 0) {
+ if (peer->pmode != MODE_BROADCAST)
+ td = (peer->r34 / (peer->r21 + peer->r34) -
+ .5) * p_del;
+ else
+ td = 0;
+
+ /*
+ * Unfortunately, in many cases the errors are
+ * unacceptable, so for the present the rates are not
+ * used. In future, we might find conditions where the
+ * calculations are useful, so this should be considered
+ * a work in progress.
+ */
+ t21 -= td;
+ t34 -= td;
+#ifdef DEBUG
+ if (debug > 1)
+ printf("packet: del %.6lf r21 %.1lf r34 %.1lf %.6lf\n",
+ p_del, peer->r21 / 1e3, peer->r34 / 1e3,
+ td);
+#endif
+ }
+#endif /* ASSYM */
+
+ /*
+ * That was awesome. Now hand off to the clock filter.
+ */
+ clock_filter(peer, p_offset + peer->bias, p_del, p_disp);
+
+ /*
+ * If we are in broadcast calibrate mode, return to broadcast
+ * client mode when the client is fit and the autokey dance is
+ * complete.
+ */
+ if ((FLAG_BC_VOL & peer->flags) && MODE_CLIENT == peer->hmode &&
+ !(TEST11 & peer_unfit(peer))) { /* distance exceeded */
+#ifdef AUTOKEY
+ if (peer->flags & FLAG_SKEY) {
+ if (!(~peer->crypto & CRYPTO_FLAG_ALL))
+ peer->hmode = MODE_BCLIENT;
+ } else {
+ peer->hmode = MODE_BCLIENT;
+ }
+#else /* !AUTOKEY follows */
+ peer->hmode = MODE_BCLIENT;
+#endif /* !AUTOKEY */
+ }
+}
+
+
+/*
+ * clock_update - Called at system process update intervals.
+ */
+static void
+clock_update(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ double dtemp;
+ l_fp now;
+#ifdef HAVE_LIBSCF_H
+ char *fmri;
+#endif /* HAVE_LIBSCF_H */
+
+ /*
+ * Update the system state variables. We do this very carefully,
+ * as the poll interval might need to be clamped differently.
+ */
+ sys_peer = peer;
+ sys_epoch = peer->epoch;
+ if (sys_poll < peer->minpoll)
+ sys_poll = peer->minpoll;
+ if (sys_poll > peer->maxpoll)
+ sys_poll = peer->maxpoll;
+ poll_update(peer, sys_poll);
+ sys_stratum = min(peer->stratum + 1, STRATUM_UNSPEC);
+ if (peer->stratum == STRATUM_REFCLOCK ||
+ peer->stratum == STRATUM_UNSPEC)
+ sys_refid = peer->refid;
+ else
+ sys_refid = addr2refid(&peer->srcadr);
+ /*
+ * Root Dispersion (E) is defined (in RFC 5905) as:
+ *
+ * E = p.epsilon_r + p.epsilon + p.psi + PHI*(s.t - p.t) + |THETA|
+ *
+ * where:
+ * p.epsilon_r is the PollProc's root dispersion
+ * p.epsilon is the PollProc's dispersion
+ * p.psi is the PollProc's jitter
+ * THETA is the combined offset
+ *
+ * NB: Think Hard about where these numbers come from and
+ * what they mean. When did peer->update happen? Has anything
+ * interesting happened since then? What values are the most
+ * defensible? Why?
+ *
+ * DLM thinks this equation is probably the best of all worse choices.
+ */
+ dtemp = peer->rootdisp
+ + peer->disp
+ + sys_jitter
+ + clock_phi * (current_time - peer->update)
+ + fabs(sys_offset);
+
+ if (dtemp > sys_mindisp)
+ sys_rootdisp = dtemp;
+ else
+ sys_rootdisp = sys_mindisp;
+ sys_rootdelay = peer->delay + peer->rootdelay;
+ sys_reftime = peer->dst;
+
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "clock_update: at %lu sample %lu associd %d\n",
+ current_time, peer->epoch, peer->associd);
+#endif
+
+ /*
+ * Comes now the moment of truth. Crank the clock discipline and
+ * see what comes out.
+ */
+ switch (local_clock(peer, sys_offset)) {
+
+ /*
+ * Clock exceeds panic threshold. Life as we know it ends.
+ */
+ case -1:
+#ifdef HAVE_LIBSCF_H
+ /*
+ * For Solaris enter the maintenance mode.
+ */
+ if ((fmri = getenv("SMF_FMRI")) != NULL) {
+ if (smf_maintain_instance(fmri, 0) < 0) {
+ printf("smf_maintain_instance: %s\n",
+ scf_strerror(scf_error()));
+ exit(1);
+ }
+ /*
+ * Sleep until SMF kills us.
+ */
+ for (;;)
+ pause();
+ }
+#endif /* HAVE_LIBSCF_H */
+ exit (-1);
+ /* not reached */
+
+ /*
+ * Clock was stepped. Flush all time values of all peers.
+ */
+ case 2:
+ clear_all();
+ sys_leap = LEAP_NOTINSYNC;
+ sys_stratum = STRATUM_UNSPEC;
+ memcpy(&sys_refid, "STEP", 4);
+ sys_rootdelay = 0;
+ sys_rootdisp = 0;
+ L_CLR(&sys_reftime);
+ sys_jitter = LOGTOD(sys_precision);
+ leapsec_reset_frame();
+ break;
+
+ /*
+ * Clock was slewed. Handle the leapsecond stuff.
+ */
+ case 1:
+
+ /*
+ * If this is the first time the clock is set, reset the
+ * leap bits. If crypto, the timer will goose the setup
+ * process.
+ */
+ if (sys_leap == LEAP_NOTINSYNC) {
+ sys_leap = LEAP_NOWARNING;
+#ifdef AUTOKEY
+ if (crypto_flags)
+ crypto_update();
+#endif /* AUTOKEY */
+ /*
+ * If our parent process is waiting for the
+ * first clock sync, send them home satisfied.
+ */
+#ifdef HAVE_WORKING_FORK
+ if (waitsync_fd_to_close != -1) {
+ close(waitsync_fd_to_close);
+ waitsync_fd_to_close = -1;
+ DPRINTF(1, ("notified parent --wait-sync is done\n"));
+ }
+#endif /* HAVE_WORKING_FORK */
+
+ }
+
+ /*
+ * If there is no leap second pending and the number of
+ * survivor leap bits is greater than half the number of
+ * survivors, try to schedule a leap for the end of the
+ * current month. (This only works if no leap second for
+ * that range is in the table, so doing this more than
+ * once is mostly harmless.)
+ */
+ if (leapsec == LSPROX_NOWARN) {
+ 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
+ && leap_vote_del > sys_survivors / 2) {
+ get_systime(&now);
+ leapsec_add_dyn(FALSE, now.l_ui, NULL);
+ }
+ }
+ break;
+
+ /*
+ * Popcorn spike or step threshold exceeded. Pretend it never
+ * happened.
+ */
+ default:
+ break;
+ }
+}
+
+
+/*
+ * poll_update - update peer poll interval
+ */
+void
+poll_update(
+ struct peer *peer, /* peer structure pointer */
+ u_char mpoll
+ )
+{
+ u_long next, utemp;
+ u_char hpoll;
+
+ /*
+ * This routine figures out when the next poll should be sent.
+ * That turns out to be wickedly complicated. One problem is
+ * that sometimes the time for the next poll is in the past when
+ * the poll interval is reduced. We watch out for races here
+ * between the receive process and the poll process.
+ *
+ * Clamp the poll interval between minpoll and maxpoll.
+ */
+ hpoll = max(min(peer->maxpoll, mpoll), peer->minpoll);
+
+#ifdef AUTOKEY
+ /*
+ * If during the crypto protocol the poll interval has changed,
+ * the lifetimes in the key list are probably bogus. Purge the
+ * the key list and regenerate it later.
+ */
+ if ((peer->flags & FLAG_SKEY) && hpoll != peer->hpoll)
+ key_expire(peer);
+#endif /* AUTOKEY */
+ peer->hpoll = hpoll;
+
+ /*
+ * There are three variables important for poll scheduling, the
+ * current time (current_time), next scheduled time (nextdate)
+ * and the earliest time (utemp). The earliest time is 2 s
+ * seconds, but could be more due to rate management. When
+ * sending in a burst, use the earliest time. When not in a
+ * burst but with a reply pending, send at the earliest time
+ * unless the next scheduled time has not advanced. This can
+ * only happen if multiple replies are pending in the same
+ * response interval. Otherwise, send at the later of the next
+ * scheduled time and the earliest time.
+ *
+ * Now we figure out if there is an override. If a burst is in
+ * progress and we get called from the receive process, just
+ * slink away. If called from the poll process, delay 1 s for a
+ * reference clock, otherwise 2 s.
+ */
+ utemp = current_time + max(peer->throttle - (NTP_SHIFT - 1) *
+ (1 << peer->minpoll), ntp_minpkt);
+ if (peer->burst > 0) {
+ if (peer->nextdate > current_time)
+ return;
+#ifdef REFCLOCK
+ else if (peer->flags & FLAG_REFCLOCK)
+ peer->nextdate = current_time + RESP_DELAY;
+#endif /* REFCLOCK */
+ else
+ peer->nextdate = utemp;
+
+#ifdef AUTOKEY
+ /*
+ * If a burst is not in progress and a crypto response message
+ * is pending, delay 2 s, but only if this is a new interval.
+ */
+ } else if (peer->cmmd != NULL) {
+ if (peer->nextdate > current_time) {
+ if (peer->nextdate + ntp_minpkt != utemp)
+ peer->nextdate = utemp;
+ } else {
+ peer->nextdate = utemp;
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * The ordinary case. If a retry, use minpoll; if unreachable,
+ * use host poll; otherwise, use the minimum of host and peer
+ * polls; In other words, oversampling is okay but
+ * understampling is evil. Use the maximum of this value and the
+ * headway. If the average headway is greater than the headway
+ * threshold, increase the headway by the minimum interval.
+ */
+ } else {
+ if (peer->retry > 0)
+ hpoll = peer->minpoll;
+ else if (!(peer->reach))
+ hpoll = peer->hpoll;
+ else
+ hpoll = min(peer->ppoll, peer->hpoll);
+#ifdef REFCLOCK
+ if (peer->flags & FLAG_REFCLOCK)
+ next = 1 << hpoll;
+ else
+#endif /* REFCLOCK */
+ next = ((0x1000UL | (ntp_random() & 0x0ff)) <<
+ hpoll) >> 12;
+ next += peer->outdate;
+ if (next > utemp)
+ peer->nextdate = next;
+ else
+ peer->nextdate = utemp;
+ if (peer->throttle > (1 << peer->minpoll))
+ peer->nextdate += ntp_minpkt;
+ }
+ DPRINTF(2, ("poll_update: at %lu %s poll %d burst %d retry %d head %d early %lu next %lu\n",
+ current_time, ntoa(&peer->srcadr), peer->hpoll,
+ peer->burst, peer->retry, peer->throttle,
+ utemp - current_time, peer->nextdate -
+ current_time));
+}
+
+
+/*
+ * peer_clear - clear peer filter registers. See Section 3.4.8 of the
+ * spec.
+ */
+void
+peer_clear(
+ struct peer *peer, /* peer structure */
+ char *ident /* tally lights */
+ )
+{
+ u_char u;
+
+#ifdef AUTOKEY
+ /*
+ * If cryptographic credentials have been acquired, toss them to
+ * Valhalla. Note that autokeys are ephemeral, in that they are
+ * tossed immediately upon use. Therefore, the keylist can be
+ * purged anytime without needing to preserve random keys. Note
+ * that, if the peer is purged, the cryptographic variables are
+ * purged, too. This makes it much harder to sneak in some
+ * unauthenticated data in the clock filter.
+ */
+ key_expire(peer);
+ if (peer->iffval != NULL)
+ BN_free(peer->iffval);
+ value_free(&peer->cookval);
+ value_free(&peer->recval);
+ value_free(&peer->encrypt);
+ value_free(&peer->sndval);
+ if (peer->cmmd != NULL)
+ free(peer->cmmd);
+ if (peer->subject != NULL)
+ free(peer->subject);
+ if (peer->issuer != NULL)
+ free(peer->issuer);
+#endif /* AUTOKEY */
+
+ /*
+ * Clear all values, including the optional crypto values above.
+ */
+ memset(CLEAR_TO_ZERO(peer), 0, LEN_CLEAR_TO_ZERO(peer));
+ peer->ppoll = peer->maxpoll;
+ peer->hpoll = peer->minpoll;
+ peer->disp = MAXDISPERSE;
+ peer->flash = peer_unfit(peer);
+ peer->jitter = LOGTOD(sys_precision);
+
+ /*
+ * If interleave mode, initialize the alternate origin switch.
+ */
+ if (peer->flags & FLAG_XLEAVE)
+ peer->flip = 1;
+ for (u = 0; u < NTP_SHIFT; u++) {
+ peer->filter_order[u] = u;
+ peer->filter_disp[u] = MAXDISPERSE;
+ }
+#ifdef REFCLOCK
+ if (!(peer->flags & FLAG_REFCLOCK)) {
+#endif
+ peer->leap = LEAP_NOTINSYNC;
+ peer->stratum = STRATUM_UNSPEC;
+ memcpy(&peer->refid, ident, 4);
+#ifdef REFCLOCK
+ }
+#endif
+
+ /*
+ * During initialization use the association count to spread out
+ * the polls at one-second intervals. Passive associations'
+ * first poll is delayed by the "discard minimum" to avoid rate
+ * limiting. Other post-startup new or cleared associations
+ * randomize the first poll over the minimum poll interval to
+ * avoid implosion.
+ */
+ peer->nextdate = peer->update = peer->outdate = current_time;
+ if (initializing) {
+ peer->nextdate += peer_associations;
+ } else if (MODE_PASSIVE == peer->hmode) {
+ peer->nextdate += ntp_minpkt;
+ } else {
+ peer->nextdate += ntp_random() % peer->minpoll;
+ }
+#ifdef AUTOKEY
+ peer->refresh = current_time + (1 << NTP_REFRESH);
+#endif /* AUTOKEY */
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "peer_clear: at %ld next %ld associd %d refid %s\n",
+ current_time, peer->nextdate, peer->associd,
+ ident);
+#endif
+}
+
+
+/*
+ * clock_filter - add incoming clock sample to filter register and run
+ * the filter procedure to find the best sample.
+ */
+void
+clock_filter(
+ struct peer *peer, /* peer structure pointer */
+ double sample_offset, /* clock offset */
+ double sample_delay, /* roundtrip delay */
+ double sample_disp /* dispersion */
+ )
+{
+ double dst[NTP_SHIFT]; /* distance vector */
+ int ord[NTP_SHIFT]; /* index vector */
+ int i, j, k, m;
+ double dtemp, etemp;
+ char tbuf[80];
+
+ /*
+ * A sample consists of the offset, delay, dispersion and epoch
+ * of arrival. The offset and delay are determined by the on-
+ * wire protocol. The dispersion grows from the last outbound
+ * packet to the arrival of this one increased by the sum of the
+ * peer precision and the system precision as required by the
+ * error budget. First, shift the new arrival into the shift
+ * register discarding the oldest one.
+ */
+ j = peer->filter_nextpt;
+ peer->filter_offset[j] = sample_offset;
+ peer->filter_delay[j] = sample_delay;
+ peer->filter_disp[j] = sample_disp;
+ peer->filter_epoch[j] = current_time;
+ j = (j + 1) % NTP_SHIFT;
+ peer->filter_nextpt = j;
+
+ /*
+ * Update dispersions since the last update and at the same
+ * time initialize the distance and index lists. Since samples
+ * become increasingly uncorrelated beyond the Allan intercept,
+ * only under exceptional cases will an older sample be used.
+ * Therefore, the distance list uses a compound metric. If the
+ * dispersion is greater than the maximum dispersion, clamp the
+ * distance at that value. If the time since the last update is
+ * less than the Allan intercept use the delay; otherwise, use
+ * the sum of the delay and dispersion.
+ */
+ dtemp = clock_phi * (current_time - peer->update);
+ peer->update = current_time;
+ for (i = NTP_SHIFT - 1; i >= 0; i--) {
+ if (i != 0)
+ peer->filter_disp[j] += dtemp;
+ if (peer->filter_disp[j] >= MAXDISPERSE) {
+ peer->filter_disp[j] = MAXDISPERSE;
+ dst[i] = MAXDISPERSE;
+ } else if (peer->update - peer->filter_epoch[j] >
+ (u_long)ULOGTOD(allan_xpt)) {
+ dst[i] = peer->filter_delay[j] +
+ peer->filter_disp[j];
+ } else {
+ dst[i] = peer->filter_delay[j];
+ }
+ ord[i] = j;
+ j = (j + 1) % NTP_SHIFT;
+ }
+
+ /*
+ * If the clock has stabilized, sort the samples by distance.
+ */
+ if (freq_cnt == 0) {
+ for (i = 1; i < NTP_SHIFT; i++) {
+ for (j = 0; j < i; j++) {
+ if (dst[j] > dst[i]) {
+ k = ord[j];
+ ord[j] = ord[i];
+ ord[i] = k;
+ etemp = dst[j];
+ dst[j] = dst[i];
+ dst[i] = etemp;
+ }
+ }
+ }
+ }
+
+ /*
+ * Copy the index list to the association structure so ntpq
+ * can see it later. Prune the distance list to leave only
+ * samples less than the maximum dispersion, which disfavors
+ * uncorrelated samples older than the Allan intercept. To
+ * further improve the jitter estimate, of the remainder leave
+ * only samples less than the maximum distance, but keep at
+ * least two samples for jitter calculation.
+ */
+ m = 0;
+ for (i = 0; i < NTP_SHIFT; i++) {
+ peer->filter_order[i] = (u_char) ord[i];
+ if (dst[i] >= MAXDISPERSE || (m >= 2 && dst[i] >=
+ sys_maxdist))
+ continue;
+ m++;
+ }
+
+ /*
+ * Compute the dispersion and jitter. The dispersion is weighted
+ * exponentially by NTP_FWEIGHT (0.5) so it is normalized close
+ * to 1.0. The jitter is the RMS differences relative to the
+ * lowest delay sample.
+ */
+ peer->disp = peer->jitter = 0;
+ k = ord[0];
+ for (i = NTP_SHIFT - 1; i >= 0; i--) {
+ j = ord[i];
+ peer->disp = NTP_FWEIGHT * (peer->disp +
+ peer->filter_disp[j]);
+ if (i < m)
+ peer->jitter += DIFF(peer->filter_offset[j],
+ peer->filter_offset[k]);
+ }
+
+ /*
+ * If no acceptable samples remain in the shift register,
+ * quietly tiptoe home leaving only the dispersion. Otherwise,
+ * save the offset, delay and jitter. Note the jitter must not
+ * be less than the precision.
+ */
+ if (m == 0) {
+ clock_select();
+ return;
+ }
+ etemp = fabs(peer->offset - peer->filter_offset[k]);
+ peer->offset = peer->filter_offset[k];
+ peer->delay = peer->filter_delay[k];
+ if (m > 1)
+ peer->jitter /= m - 1;
+ peer->jitter = max(SQRT(peer->jitter), LOGTOD(sys_precision));
+
+ /*
+ * If the the new sample and the current sample are both valid
+ * and the difference between their offsets exceeds CLOCK_SGATE
+ * (3) times the jitter and the interval between them is less
+ * than twice the host poll interval, consider the new sample
+ * a popcorn spike and ignore it.
+ */
+ if (peer->disp < sys_maxdist && peer->filter_disp[k] <
+ sys_maxdist && etemp > CLOCK_SGATE * peer->jitter &&
+ peer->filter_epoch[k] - peer->epoch < 2. *
+ ULOGTOD(peer->hpoll)) {
+ snprintf(tbuf, sizeof(tbuf), "%.6f s", etemp);
+ report_event(PEVNT_POPCORN, peer, tbuf);
+ return;
+ }
+
+ /*
+ * A new minimum sample is useful only if it is later than the
+ * last one used. In this design the maximum lifetime of any
+ * sample is not greater than eight times the poll interval, so
+ * the maximum interval between minimum samples is eight
+ * packets.
+ */
+ if (peer->filter_epoch[k] <= peer->epoch) {
+#if DEBUG
+ if (debug > 1)
+ printf("clock_filter: old sample %lu\n", current_time -
+ peer->filter_epoch[k]);
+#endif
+ return;
+ }
+ peer->epoch = peer->filter_epoch[k];
+
+ /*
+ * The mitigated sample statistics are saved for later
+ * processing. If not synchronized or not in a burst, tickle the
+ * clock select algorithm.
+ */
+ record_peer_stats(&peer->srcadr, ctlpeerstatus(peer),
+ peer->offset, peer->delay, peer->disp, peer->jitter);
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "clock_filter: n %d off %.6f del %.6f dsp %.6f jit %.6f\n",
+ m, peer->offset, peer->delay, peer->disp,
+ peer->jitter);
+#endif
+ if (peer->burst == 0 || sys_leap == LEAP_NOTINSYNC)
+ clock_select();
+}
+
+
+/*
+ * clock_select - find the pick-of-the-litter clock
+ *
+ * LOCKCLOCK: (1) If the local clock is the prefer peer, it will always
+ * be enabled, even if declared falseticker, (2) only the prefer peer
+ * can be selected as the system peer, (3) if the external source is
+ * down, the system leap bits are set to 11 and the stratum set to
+ * infinity.
+ */
+void
+clock_select(void)
+{
+ struct peer *peer;
+ int i, j, k, n;
+ int nlist, nl2;
+ int allow, osurv;
+ int speer;
+ double d, e, f, g;
+ double high, low;
+ double speermet;
+ double orphmet = 2.0 * U_INT32_MAX; /* 2x is greater than */
+ struct endpoint endp;
+ struct peer *osys_peer;
+ struct peer *sys_prefer = NULL; /* prefer peer */
+ struct peer *typesystem = NULL;
+ struct peer *typeorphan = NULL;
+#ifdef REFCLOCK
+ struct peer *typeacts = NULL;
+ struct peer *typelocal = NULL;
+ struct peer *typepps = NULL;
+#endif /* REFCLOCK */
+ static struct endpoint *endpoint = NULL;
+ static int *indx = NULL;
+ static peer_select *peers = NULL;
+ static u_int endpoint_size = 0;
+ static u_int peers_size = 0;
+ static u_int indx_size = 0;
+ size_t octets;
+
+ /*
+ * Initialize and create endpoint, index and peer lists big
+ * enough to handle all associations.
+ */
+ osys_peer = sys_peer;
+ osurv = sys_survivors;
+ sys_survivors = 0;
+#ifdef LOCKCLOCK
+ sys_leap = LEAP_NOTINSYNC;
+ sys_stratum = STRATUM_UNSPEC;
+ memcpy(&sys_refid, "DOWN", 4);
+#endif /* LOCKCLOCK */
+
+ /*
+ * Allocate dynamic space depending on the number of
+ * associations.
+ */
+ nlist = 1;
+ for (peer = peer_list; peer != NULL; peer = peer->p_link)
+ nlist++;
+ endpoint_size = ALIGNED_SIZE(nlist * 2 * sizeof(*endpoint));
+ peers_size = ALIGNED_SIZE(nlist * sizeof(*peers));
+ indx_size = ALIGNED_SIZE(nlist * 2 * sizeof(*indx));
+ octets = endpoint_size + peers_size + indx_size;
+ endpoint = erealloc(endpoint, octets);
+ peers = INC_ALIGNED_PTR(endpoint, endpoint_size);
+ indx = INC_ALIGNED_PTR(peers, peers_size);
+
+ /*
+ * Initially, we populate the island with all the rifraff peers
+ * that happen to be lying around. Those with seriously
+ * defective clocks are immediately booted off the island. Then,
+ * the falsetickers are culled and put to sea. The truechimers
+ * remaining are subject to repeated rounds where the most
+ * unpopular at each round is kicked off. When the population
+ * has dwindled to sys_minclock, the survivors split a million
+ * bucks and collectively crank the chimes.
+ */
+ nlist = nl2 = 0; /* none yet */
+ for (peer = peer_list; peer != NULL; peer = peer->p_link) {
+ peer->new_status = CTL_PST_SEL_REJECT;
+
+ /*
+ * Leave the island immediately if the peer is
+ * unfit to synchronize.
+ */
+ if (peer_unfit(peer))
+ continue;
+
+ /*
+ * If this peer is an orphan parent, elect the
+ * one with the lowest metric defined as the
+ * IPv4 address or the first 64 bits of the
+ * hashed IPv6 address. To ensure convergence
+ * on the same selected orphan, consider as
+ * well that this system may have the lowest
+ * metric and be the orphan parent. If this
+ * system wins, sys_peer will be NULL to trigger
+ * orphan mode in timer().
+ */
+ if (peer->stratum == sys_orphan) {
+ u_int32 localmet;
+ u_int32 peermet;
+
+ if (peer->dstadr != NULL)
+ localmet = ntohl(peer->dstadr->addr_refid);
+ else
+ localmet = U_INT32_MAX;
+ peermet = ntohl(addr2refid(&peer->srcadr));
+ if (peermet < localmet && peermet < orphmet) {
+ typeorphan = peer;
+ orphmet = peermet;
+ }
+ continue;
+ }
+
+ /*
+ * If this peer could have the orphan parent
+ * as a synchronization ancestor, exclude it
+ * from selection to avoid forming a
+ * synchronization loop within the orphan mesh,
+ * triggering stratum climb to infinity
+ * instability. Peers at stratum higher than
+ * the orphan stratum could have the orphan
+ * parent in ancestry so are excluded.
+ * See http://bugs.ntp.org/2050
+ */
+ if (peer->stratum > sys_orphan)
+ continue;
+#ifdef REFCLOCK
+ /*
+ * The following are special cases. We deal
+ * with them later.
+ */
+ if (!(peer->flags & FLAG_PREFER)) {
+ switch (peer->refclktype) {
+ case REFCLK_LOCALCLOCK:
+ if (current_time > orphwait &&
+ typelocal == NULL)
+ typelocal = peer;
+ continue;
+
+ case REFCLK_ACTS:
+ if (current_time > orphwait &&
+ typeacts == NULL)
+ typeacts = peer;
+ continue;
+ }
+ }
+#endif /* REFCLOCK */
+
+ /*
+ * If we get this far, the peer can stay on the
+ * island, but does not yet have the immunity
+ * idol.
+ */
+ peer->new_status = CTL_PST_SEL_SANE;
+ f = root_distance(peer);
+ peers[nlist].peer = peer;
+ peers[nlist].error = peer->jitter;
+ peers[nlist].synch = f;
+ nlist++;
+
+ /*
+ * Insert each interval endpoint on the unsorted
+ * endpoint[] list.
+ */
+ e = peer->offset;
+ endpoint[nl2].type = -1; /* lower end */
+ endpoint[nl2].val = e - f;
+ nl2++;
+ endpoint[nl2].type = 1; /* upper end */
+ endpoint[nl2].val = e + f;
+ nl2++;
+ }
+ /*
+ * Construct sorted indx[] of endpoint[] indexes ordered by
+ * offset.
+ */
+ for (i = 0; i < nl2; i++)
+ indx[i] = i;
+ for (i = 0; i < nl2; i++) {
+ endp = endpoint[indx[i]];
+ e = endp.val;
+ k = i;
+ for (j = i + 1; j < nl2; j++) {
+ endp = endpoint[indx[j]];
+ if (endp.val < e) {
+ e = endp.val;
+ k = j;
+ }
+ }
+ if (k != i) {
+ j = indx[k];
+ indx[k] = indx[i];
+ indx[i] = j;
+ }
+ }
+ for (i = 0; i < nl2; i++)
+ DPRINTF(3, ("select: endpoint %2d %.6f\n",
+ endpoint[indx[i]].type, endpoint[indx[i]].val));
+
+ /*
+ * This is the actual algorithm that cleaves the truechimers
+ * from the falsetickers. The original algorithm was described
+ * in Keith Marzullo's dissertation, but has been modified for
+ * better accuracy.
+ *
+ * Briefly put, we first assume there are no falsetickers, then
+ * scan the candidate list first from the low end upwards and
+ * then from the high end downwards. The scans stop when the
+ * number of intersections equals the number of candidates less
+ * the number of falsetickers. If this doesn't happen for a
+ * given number of falsetickers, we bump the number of
+ * falsetickers and try again. If the number of falsetickers
+ * becomes equal to or greater than half the number of
+ * candidates, the Albanians have won the Byzantine wars and
+ * correct synchronization is not possible.
+ *
+ * Here, nlist is the number of candidates and allow is the
+ * number of falsetickers. Upon exit, the truechimers are the
+ * survivors with offsets not less than low and not greater than
+ * high. There may be none of them.
+ */
+ low = 1e9;
+ high = -1e9;
+ for (allow = 0; 2 * allow < nlist; allow++) {
+
+ /*
+ * Bound the interval (low, high) as the smallest
+ * interval containing points from the most sources.
+ */
+ n = 0;
+ for (i = 0; i < nl2; i++) {
+ low = endpoint[indx[i]].val;
+ n -= endpoint[indx[i]].type;
+ if (n >= nlist - allow)
+ break;
+ }
+ n = 0;
+ for (j = nl2 - 1; j >= 0; j--) {
+ high = endpoint[indx[j]].val;
+ n += endpoint[indx[j]].type;
+ if (n >= nlist - allow)
+ break;
+ }
+
+ /*
+ * If an interval containing truechimers is found, stop.
+ * If not, increase the number of falsetickers and go
+ * around again.
+ */
+ if (high > low)
+ break;
+ }
+
+ /*
+ * Clustering algorithm. Whittle candidate list of falsetickers,
+ * who leave the island immediately. The TRUE peer is always a
+ * truechimer. We must leave at least one peer to collect the
+ * million bucks.
+ *
+ * We assert the correct time is contained in the interval, but
+ * the best offset estimate for the interval might not be
+ * contained in the interval. For this purpose, a truechimer is
+ * defined as the midpoint of an interval that overlaps the
+ * intersection interval.
+ */
+ j = 0;
+ for (i = 0; i < nlist; i++) {
+ double h;
+
+ peer = peers[i].peer;
+ h = peers[i].synch;
+ if ((high <= low || peer->offset + h < low ||
+ peer->offset - h > high) && !(peer->flags & FLAG_TRUE))
+ continue;
+
+#ifdef REFCLOCK
+ /*
+ * Eligible PPS peers must survive the intersection
+ * algorithm. Use the first one found, but don't
+ * include any of them in the cluster population.
+ */
+ if (peer->flags & FLAG_PPS) {
+ if (typepps == NULL)
+ typepps = peer;
+ continue;
+ }
+#endif /* REFCLOCK */
+
+ if (j != i)
+ peers[j] = peers[i];
+ j++;
+ }
+ nlist = j;
+
+ /*
+ * If no survivors remain at this point, check if the modem
+ * driver, local driver or orphan parent in that order. If so,
+ * nominate the first one found as the only survivor.
+ * Otherwise, give up and leave the island to the rats.
+ */
+ if (nlist == 0) {
+ peers[0].error = 0;
+ peers[0].synch = sys_mindisp;
+#ifdef REFCLOCK
+ if (typeacts != NULL) {
+ peers[0].peer = typeacts;
+ nlist = 1;
+ } else if (typelocal != NULL) {
+ peers[0].peer = typelocal;
+ nlist = 1;
+ } else
+#endif /* REFCLOCK */
+ if (typeorphan != NULL) {
+ peers[0].peer = typeorphan;
+ nlist = 1;
+ }
+ }
+
+ /*
+ * Mark the candidates at this point as truechimers.
+ */
+ for (i = 0; i < nlist; i++) {
+ peers[i].peer->new_status = CTL_PST_SEL_SELCAND;
+ DPRINTF(2, ("select: survivor %s %f\n",
+ stoa(&peers[i].peer->srcadr), peers[i].synch));
+ }
+
+ /*
+ * Now, vote outlyers off the island by select jitter weighted
+ * by root distance. Continue voting as long as there are more
+ * than sys_minclock survivors and the select jitter of the peer
+ * with the worst metric is greater than the minimum peer
+ * jitter. Stop if we are about to discard a TRUE or PREFER
+ * peer, who of course have the immunity idol.
+ */
+ while (1) {
+ d = 1e9;
+ e = -1e9;
+ g = 0;
+ k = 0;
+ for (i = 0; i < nlist; i++) {
+ if (peers[i].error < d)
+ d = peers[i].error;
+ peers[i].seljit = 0;
+ if (nlist > 1) {
+ f = 0;
+ for (j = 0; j < nlist; j++)
+ f += DIFF(peers[j].peer->offset,
+ peers[i].peer->offset);
+ peers[i].seljit = SQRT(f / (nlist - 1));
+ }
+ if (peers[i].seljit * peers[i].synch > e) {
+ g = peers[i].seljit;
+ e = peers[i].seljit * peers[i].synch;
+ k = i;
+ }
+ }
+ g = max(g, LOGTOD(sys_precision));
+ 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",
+ ntoa(&peers[k].peer->srcadr), g, d));
+ if (nlist > sys_maxclock)
+ peers[k].peer->new_status = CTL_PST_SEL_EXCESS;
+ for (j = k + 1; j < nlist; j++)
+ peers[j - 1] = peers[j];
+ nlist--;
+ }
+
+ /*
+ * What remains is a list usually not greater than sys_minclock
+ * peers. Note that unsynchronized peers cannot survive this
+ * far. Count and mark these survivors.
+ *
+ * While at it, count the number of leap warning bits found.
+ * This will be used later to vote the system leap warning bit.
+ * If a leap warning bit is found on a reference clock, the vote
+ * is always won.
+ *
+ * Choose the system peer using a hybrid metric composed of the
+ * selection jitter scaled by the root distance augmented by
+ * stratum scaled by sys_mindisp (.001 by default). The goal of
+ * the small stratum factor is to avoid clockhop between a
+ * reference clock and a network peer which has a refclock and
+ * is using an older ntpd, which does not floor sys_rootdisp at
+ * sys_mindisp.
+ *
+ * In contrast, ntpd 4.2.6 and earlier used stratum primarily
+ * in selecting the system peer, using a weight of 1 second of
+ * additional root distance per stratum. This heavy bias is no
+ * longer appropriate, as the scaled root distance provides a
+ * more rational metric carrying the cumulative error budget.
+ */
+ e = 1e9;
+ speer = 0;
+ leap_vote_ins = 0;
+ leap_vote_del = 0;
+ for (i = 0; i < nlist; i++) {
+ peer = peers[i].peer;
+ peer->unreach = 0;
+ peer->new_status = CTL_PST_SEL_SYNCCAND;
+ sys_survivors++;
+ if (peer->leap == LEAP_ADDSECOND) {
+ if (peer->flags & FLAG_REFCLOCK)
+ leap_vote_ins = nlist;
+ else if (leap_vote_ins < nlist)
+ leap_vote_ins++;
+ }
+ if (peer->leap == LEAP_DELSECOND) {
+ if (peer->flags & FLAG_REFCLOCK)
+ leap_vote_del = nlist;
+ else if (leap_vote_del < nlist)
+ leap_vote_del++;
+ }
+ if (peer->flags & FLAG_PREFER)
+ sys_prefer = peer;
+ speermet = peers[i].seljit * peers[i].synch +
+ peer->stratum * sys_mindisp;
+ if (speermet < e) {
+ e = speermet;
+ speer = i;
+ }
+ }
+
+ /*
+ * Unless there are at least sys_misane survivors, leave the
+ * building dark. Otherwise, do a clockhop dance. Ordinarily,
+ * use the selected survivor speer. However, if the current
+ * system peer is not speer, stay with the current system peer
+ * as long as it doesn't get too old or too ugly.
+ */
+ if (nlist > 0 && nlist >= sys_minsane) {
+ double x;
+
+ typesystem = peers[speer].peer;
+ if (osys_peer == NULL || osys_peer == typesystem) {
+ sys_clockhop = 0;
+ } else if ((x = fabs(typesystem->offset -
+ osys_peer->offset)) < sys_mindisp) {
+ if (sys_clockhop == 0)
+ sys_clockhop = sys_mindisp;
+ else
+ sys_clockhop *= .5;
+ DPRINTF(1, ("select: clockhop %d %.6f %.6f\n",
+ j, x, sys_clockhop));
+ if (fabs(x) < sys_clockhop)
+ typesystem = osys_peer;
+ else
+ sys_clockhop = 0;
+ } else {
+ sys_clockhop = 0;
+ }
+ }
+
+ /*
+ * Mitigation rules of the game. We have the pick of the
+ * litter in typesystem if any survivors are left. If
+ * there is a prefer peer, use its offset and jitter.
+ * Otherwise, use the combined offset and jitter of all kitters.
+ */
+ if (typesystem != NULL) {
+ if (sys_prefer == NULL) {
+ typesystem->new_status = CTL_PST_SEL_SYSPEER;
+ clock_combine(peers, sys_survivors, speer);
+ } else {
+ typesystem = sys_prefer;
+ sys_clockhop = 0;
+ typesystem->new_status = CTL_PST_SEL_SYSPEER;
+ sys_offset = typesystem->offset;
+ sys_jitter = typesystem->jitter;
+ }
+ DPRINTF(1, ("select: combine offset %.9f jitter %.9f\n",
+ sys_offset, sys_jitter));
+ }
+#ifdef REFCLOCK
+ /*
+ * If a PPS driver is lit and the combined offset is less than
+ * 0.4 s, select the driver as the PPS peer and use its offset
+ * and jitter. However, if this is the atom driver, use it only
+ * if there is a prefer peer or there are no survivors and none
+ * are required.
+ */
+ if (typepps != NULL && fabs(sys_offset) < 0.4 &&
+ (typepps->refclktype != REFCLK_ATOM_PPS ||
+ (typepps->refclktype == REFCLK_ATOM_PPS && (sys_prefer !=
+ NULL || (typesystem == NULL && sys_minsane == 0))))) {
+ typesystem = typepps;
+ sys_clockhop = 0;
+ typesystem->new_status = CTL_PST_SEL_PPS;
+ sys_offset = typesystem->offset;
+ sys_jitter = typesystem->jitter;
+ DPRINTF(1, ("select: pps offset %.9f jitter %.9f\n",
+ sys_offset, sys_jitter));
+ }
+#endif /* REFCLOCK */
+
+ /*
+ * If there are no survivors at this point, there is no
+ * system peer. If so and this is an old update, keep the
+ * current statistics, but do not update the clock.
+ */
+ if (typesystem == NULL) {
+ if (osys_peer != NULL) {
+ if (sys_orphwait > 0)
+ orphwait = current_time + sys_orphwait;
+ report_event(EVNT_NOPEER, NULL, NULL);
+ }
+ sys_peer = NULL;
+ for (peer = peer_list; peer != NULL; peer = peer->p_link)
+ peer->status = peer->new_status;
+ return;
+ }
+
+ /*
+ * Do not use old data, as this may mess up the clock discipline
+ * stability.
+ */
+ if (typesystem->epoch <= sys_epoch)
+ return;
+
+ /*
+ * We have found the alpha male. Wind the clock.
+ */
+ if (osys_peer != typesystem)
+ report_event(PEVNT_NEWPEER, typesystem, NULL);
+ for (peer = peer_list; peer != NULL; peer = peer->p_link)
+ peer->status = peer->new_status;
+ clock_update(typesystem);
+}
+
+
+static void
+clock_combine(
+ peer_select * peers, /* survivor list */
+ int npeers, /* number of survivors */
+ int syspeer /* index of sys.peer */
+ )
+{
+ int i;
+ double x, y, z, w;
+
+ y = z = w = 0;
+ for (i = 0; i < npeers; i++) {
+ x = 1. / peers[i].synch;
+ y += x;
+ z += x * peers[i].peer->offset;
+ w += x * DIFF(peers[i].peer->offset,
+ peers[syspeer].peer->offset);
+ }
+ sys_offset = z / y;
+ sys_jitter = SQRT(w / y + SQUARE(peers[syspeer].seljit));
+}
+
+
+/*
+ * root_distance - compute synchronization distance from peer to root
+ */
+static double
+root_distance(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ double dtemp;
+
+ /*
+ * Root Distance (LAMBDA) is defined as:
+ * (delta + DELTA)/2 + epsilon + EPSILON + phi
+ *
+ * where:
+ * delta is the round-trip delay
+ * DELTA is the root delay
+ * epsilon is the remote server precision + local precision
+ * + (15 usec each second)
+ * EPSILON is the root dispersion
+ * phi is the peer jitter statistic
+ *
+ * NB: Think hard about why we are using these values, and what
+ * the alternatives are, and the various pros/cons.
+ *
+ * DLM thinks these are probably the best choices from any of the
+ * other worse choices.
+ */
+ dtemp = (peer->delay + peer->rootdelay) / 2
+ + LOGTOD(peer->precision)
+ + LOGTOD(sys_precision)
+ + clock_phi * (current_time - peer->update)
+ + peer->rootdisp
+ + peer->jitter;
+ /*
+ * Careful squeak here. The value returned must be greater than
+ * the minimum root dispersion in order to avoid clockhop with
+ * highly precise reference clocks. Note that the root distance
+ * cannot exceed the sys_maxdist, as this is the cutoff by the
+ * selection algorithm.
+ */
+ if (dtemp < sys_mindisp)
+ dtemp = sys_mindisp;
+ return (dtemp);
+}
+
+
+/*
+ * peer_xmit - send packet for persistent association.
+ */
+static void
+peer_xmit(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct pkt xpkt; /* transmit packet */
+ int sendlen, authlen;
+ keyid_t xkeyid = 0; /* transmit key ID */
+ l_fp xmt_tx, xmt_ty;
+
+ if (!peer->dstadr) /* drop peers without interface */
+ return;
+
+ xpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap, peer->version,
+ peer->hmode);
+ xpkt.stratum = STRATUM_TO_PKT(sys_stratum);
+ xpkt.ppoll = peer->hpoll;
+ xpkt.precision = sys_precision;
+ xpkt.refid = sys_refid;
+ xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay));
+ xpkt.rootdisp = HTONS_FP(DTOUFP(sys_rootdisp));
+ HTONL_FP(&sys_reftime, &xpkt.reftime);
+ HTONL_FP(&peer->rec, &xpkt.org);
+ HTONL_FP(&peer->dst, &xpkt.rec);
+
+ /*
+ * If the received packet contains a MAC, the transmitted packet
+ * is authenticated and contains a MAC. If not, the transmitted
+ * packet is not authenticated.
+ *
+ * It is most important when autokey is in use that the local
+ * interface IP address be known before the first packet is
+ * sent. Otherwise, it is not possible to compute a correct MAC
+ * the recipient will accept. Thus, the I/O semantics have to do
+ * a little more work. In particular, the wildcard interface
+ * might not be usable.
+ */
+ sendlen = LEN_PKT_NOMAC;
+#ifdef AUTOKEY
+ if (!(peer->flags & FLAG_SKEY) && peer->keyid == 0) {
+#else /* !AUTOKEY follows */
+ if (peer->keyid == 0) {
+#endif /* !AUTOKEY */
+
+ /*
+ * Transmit a-priori timestamps
+ */
+ get_systime(&xmt_tx);
+ if (peer->flip == 0) { /* basic mode */
+ peer->aorg = xmt_tx;
+ HTONL_FP(&xmt_tx, &xpkt.xmt);
+ } else { /* interleaved modes */
+ if (peer->hmode == MODE_BROADCAST) { /* bcst */
+ HTONL_FP(&xmt_tx, &xpkt.xmt);
+ if (peer->flip > 0)
+ HTONL_FP(&peer->borg,
+ &xpkt.org);
+ else
+ HTONL_FP(&peer->aorg,
+ &xpkt.org);
+ } else { /* symmetric */
+ if (peer->flip > 0)
+ HTONL_FP(&peer->borg,
+ &xpkt.xmt);
+ else
+ HTONL_FP(&peer->aorg,
+ &xpkt.xmt);
+ }
+ }
+ peer->t21_bytes = sendlen;
+ sendpkt(&peer->srcadr, peer->dstadr, sys_ttl[peer->ttl],
+ &xpkt, sendlen);
+ peer->sent++;
+ peer->throttle += (1 << peer->minpoll) - 2;
+
+ /*
+ * Capture a-posteriori timestamps
+ */
+ get_systime(&xmt_ty);
+ if (peer->flip != 0) { /* interleaved modes */
+ if (peer->flip > 0)
+ peer->aorg = xmt_ty;
+ else
+ peer->borg = xmt_ty;
+ peer->flip = -peer->flip;
+ }
+ L_SUB(&xmt_ty, &xmt_tx);
+ LFPTOD(&xmt_ty, peer->xleave);
+#ifdef DEBUG
+ if (debug)
+ printf("transmit: at %ld %s->%s mode %d len %d\n",
+ current_time, peer->dstadr ?
+ stoa(&peer->dstadr->sin) : "-",
+ stoa(&peer->srcadr), peer->hmode, sendlen);
+#endif
+ return;
+ }
+
+ /*
+ * Authentication is enabled, so the transmitted packet must be
+ * authenticated. If autokey is enabled, fuss with the various
+ * modes; otherwise, symmetric key cryptography is used.
+ */
+#ifdef AUTOKEY
+ if (peer->flags & FLAG_SKEY) {
+ struct exten *exten; /* extension field */
+
+ /*
+ * The Public Key Dance (PKD): Cryptographic credentials
+ * are contained in extension fields, each including a
+ * 4-octet length/code word followed by a 4-octet
+ * association ID and optional additional data. Optional
+ * data includes a 4-octet data length field followed by
+ * the data itself. Request messages are sent from a
+ * configured association; response messages can be sent
+ * from a configured association or can take the fast
+ * path without ever matching an association. Response
+ * messages have the same code as the request, but have
+ * a response bit and possibly an error bit set. In this
+ * implementation, a message may contain no more than
+ * one command and one or more responses.
+ *
+ * Cryptographic session keys include both a public and
+ * a private componet. Request and response messages
+ * using extension fields are always sent with the
+ * private component set to zero. Packets without
+ * extension fields indlude the private component when
+ * the session key is generated.
+ */
+ while (1) {
+
+ /*
+ * Allocate and initialize a keylist if not
+ * already done. Then, use the list in inverse
+ * order, discarding keys once used. Keep the
+ * latest key around until the next one, so
+ * clients can use client/server packets to
+ * compute propagation delay.
+ *
+ * Note that once a key is used from the list,
+ * it is retained in the key cache until the
+ * next key is used. This is to allow a client
+ * to retrieve the encrypted session key
+ * identifier to verify authenticity.
+ *
+ * If for some reason a key is no longer in the
+ * key cache, a birthday has happened or the key
+ * has expired, so the pseudo-random sequence is
+ * broken. In that case, purge the keylist and
+ * regenerate it.
+ */
+ if (peer->keynumber == 0)
+ make_keylist(peer, peer->dstadr);
+ else
+ peer->keynumber--;
+ xkeyid = peer->keylist[peer->keynumber];
+ if (authistrusted(xkeyid))
+ break;
+ else
+ key_expire(peer);
+ }
+ peer->keyid = xkeyid;
+ exten = NULL;
+ switch (peer->hmode) {
+
+ /*
+ * In broadcast server mode the autokey values are
+ * required by the broadcast clients. Push them when a
+ * new keylist is generated; otherwise, push the
+ * association message so the client can request them at
+ * other times.
+ */
+ case MODE_BROADCAST:
+ if (peer->flags & FLAG_ASSOC)
+ exten = crypto_args(peer, CRYPTO_AUTO |
+ CRYPTO_RESP, peer->associd, NULL);
+ else
+ exten = crypto_args(peer, CRYPTO_ASSOC |
+ CRYPTO_RESP, peer->associd, NULL);
+ break;
+
+ /*
+ * In symmetric modes the parameter, certificate,
+ * identity, cookie and autokey exchanges are
+ * required. The leapsecond exchange is optional. But, a
+ * peer will not believe the other peer until the other
+ * peer has synchronized, so the certificate exchange
+ * might loop until then. If a peer finds a broken
+ * autokey sequence, it uses the autokey exchange to
+ * retrieve the autokey values. In any case, if a new
+ * keylist is generated, the autokey values are pushed.
+ */
+ case MODE_ACTIVE:
+ case MODE_PASSIVE:
+
+ /*
+ * Parameter, certificate and identity.
+ */
+ if (!peer->crypto)
+ exten = crypto_args(peer, CRYPTO_ASSOC,
+ peer->associd, hostval.ptr);
+ else if (!(peer->crypto & CRYPTO_FLAG_CERT))
+ exten = crypto_args(peer, CRYPTO_CERT,
+ peer->associd, peer->issuer);
+ else if (!(peer->crypto & CRYPTO_FLAG_VRFY))
+ exten = crypto_args(peer,
+ crypto_ident(peer), peer->associd,
+ NULL);
+
+ /*
+ * Cookie and autokey. We request the cookie
+ * only when the this peer and the other peer
+ * are synchronized. But, this peer needs the
+ * autokey values when the cookie is zero. Any
+ * time we regenerate the key list, we offer the
+ * autokey values without being asked. If for
+ * some reason either peer finds a broken
+ * autokey sequence, the autokey exchange is
+ * used to retrieve the autokey values.
+ */
+ else if (sys_leap != LEAP_NOTINSYNC &&
+ peer->leap != LEAP_NOTINSYNC &&
+ !(peer->crypto & CRYPTO_FLAG_COOK))
+ exten = crypto_args(peer, CRYPTO_COOK,
+ peer->associd, NULL);
+ else if (!(peer->crypto & CRYPTO_FLAG_AUTO))
+ exten = crypto_args(peer, CRYPTO_AUTO,
+ peer->associd, NULL);
+ else if (peer->flags & FLAG_ASSOC &&
+ peer->crypto & CRYPTO_FLAG_SIGN)
+ exten = crypto_args(peer, CRYPTO_AUTO |
+ CRYPTO_RESP, peer->assoc, NULL);
+
+ /*
+ * Wait for clock sync, then sign the
+ * certificate and retrieve the leapsecond
+ * values.
+ */
+ else if (sys_leap == LEAP_NOTINSYNC)
+ break;
+
+ else if (!(peer->crypto & CRYPTO_FLAG_SIGN))
+ exten = crypto_args(peer, CRYPTO_SIGN,
+ peer->associd, hostval.ptr);
+ else if (!(peer->crypto & CRYPTO_FLAG_LEAP))
+ exten = crypto_args(peer, CRYPTO_LEAP,
+ peer->associd, NULL);
+ break;
+
+ /*
+ * In client mode the parameter, certificate, identity,
+ * cookie and sign exchanges are required. The
+ * leapsecond exchange is optional. If broadcast client
+ * mode the same exchanges are required, except that the
+ * autokey exchange is substitutes for the cookie
+ * exchange, since the cookie is always zero. If the
+ * broadcast client finds a broken autokey sequence, it
+ * uses the autokey exchange to retrieve the autokey
+ * values.
+ */
+ case MODE_CLIENT:
+
+ /*
+ * Parameter, certificate and identity.
+ */
+ if (!peer->crypto)
+ exten = crypto_args(peer, CRYPTO_ASSOC,
+ peer->associd, hostval.ptr);
+ else if (!(peer->crypto & CRYPTO_FLAG_CERT))
+ exten = crypto_args(peer, CRYPTO_CERT,
+ peer->associd, peer->issuer);
+ else if (!(peer->crypto & CRYPTO_FLAG_VRFY))
+ exten = crypto_args(peer,
+ crypto_ident(peer), peer->associd,
+ NULL);
+
+ /*
+ * Cookie and autokey. These are requests, but
+ * we use the peer association ID with autokey
+ * rather than our own.
+ */
+ else if (!(peer->crypto & CRYPTO_FLAG_COOK))
+ exten = crypto_args(peer, CRYPTO_COOK,
+ peer->associd, NULL);
+ else if (!(peer->crypto & CRYPTO_FLAG_AUTO))
+ exten = crypto_args(peer, CRYPTO_AUTO,
+ peer->assoc, NULL);
+
+ /*
+ * Wait for clock sync, then sign the
+ * certificate and retrieve the leapsecond
+ * values.
+ */
+ else if (sys_leap == LEAP_NOTINSYNC)
+ break;
+
+ else if (!(peer->crypto & CRYPTO_FLAG_SIGN))
+ exten = crypto_args(peer, CRYPTO_SIGN,
+ peer->associd, hostval.ptr);
+ else if (!(peer->crypto & CRYPTO_FLAG_LEAP))
+ exten = crypto_args(peer, CRYPTO_LEAP,
+ peer->associd, NULL);
+ break;
+ }
+
+ /*
+ * Add a queued extension field if present. This is
+ * always a request message, so the reply ID is already
+ * in the message. If an error occurs, the error bit is
+ * lit in the response.
+ */
+ if (peer->cmmd != NULL) {
+ u_int32 temp32;
+
+ temp32 = CRYPTO_RESP;
+ peer->cmmd->opcode |= htonl(temp32);
+ sendlen += crypto_xmit(peer, &xpkt, NULL,
+ sendlen, peer->cmmd, 0);
+ free(peer->cmmd);
+ peer->cmmd = NULL;
+ }
+
+ /*
+ * Add an extension field created above. All but the
+ * autokey response message are request messages.
+ */
+ if (exten != NULL) {
+ if (exten->opcode != 0)
+ sendlen += crypto_xmit(peer, &xpkt,
+ NULL, sendlen, exten, 0);
+ free(exten);
+ }
+
+ /*
+ * Calculate the next session key. Since extension
+ * fields are present, the cookie value is zero.
+ */
+ if (sendlen > LEN_PKT_NOMAC) {
+ session_key(&peer->dstadr->sin, &peer->srcadr,
+ xkeyid, 0, 2);
+ }
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Transmit a-priori timestamps
+ */
+ get_systime(&xmt_tx);
+ if (peer->flip == 0) { /* basic mode */
+ peer->aorg = xmt_tx;
+ HTONL_FP(&xmt_tx, &xpkt.xmt);
+ } else { /* interleaved modes */
+ if (peer->hmode == MODE_BROADCAST) { /* bcst */
+ HTONL_FP(&xmt_tx, &xpkt.xmt);
+ if (peer->flip > 0)
+ HTONL_FP(&peer->borg, &xpkt.org);
+ else
+ HTONL_FP(&peer->aorg, &xpkt.org);
+ } else { /* symmetric */
+ if (peer->flip > 0)
+ HTONL_FP(&peer->borg, &xpkt.xmt);
+ else
+ HTONL_FP(&peer->aorg, &xpkt.xmt);
+ }
+ }
+ xkeyid = peer->keyid;
+ authlen = authencrypt(xkeyid, (u_int32 *)&xpkt, sendlen);
+ if (authlen == 0) {
+ report_event(PEVNT_AUTH, peer, "no key");
+ peer->flash |= TEST5; /* auth error */
+ peer->badauth++;
+ return;
+ }
+ sendlen += authlen;
+#ifdef AUTOKEY
+ if (xkeyid > NTP_MAXKEY)
+ authtrust(xkeyid, 0);
+#endif /* AUTOKEY */
+ if (sendlen > sizeof(xpkt)) {
+ msyslog(LOG_ERR, "proto: buffer overflow %u", sendlen);
+ exit (-1);
+ }
+ peer->t21_bytes = sendlen;
+ sendpkt(&peer->srcadr, peer->dstadr, sys_ttl[peer->ttl], &xpkt,
+ sendlen);
+ peer->sent++;
+ peer->throttle += (1 << peer->minpoll) - 2;
+
+ /*
+ * Capture a-posteriori timestamps
+ */
+ get_systime(&xmt_ty);
+ if (peer->flip != 0) { /* interleaved modes */
+ if (peer->flip > 0)
+ peer->aorg = xmt_ty;
+ else
+ peer->borg = xmt_ty;
+ peer->flip = -peer->flip;
+ }
+ L_SUB(&xmt_ty, &xmt_tx);
+ LFPTOD(&xmt_ty, peer->xleave);
+#ifdef AUTOKEY
+#ifdef DEBUG
+ if (debug)
+ printf("transmit: at %ld %s->%s mode %d keyid %08x len %d index %d\n",
+ current_time, latoa(peer->dstadr),
+ ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen,
+ peer->keynumber);
+#endif
+#else /* !AUTOKEY follows */
+#ifdef DEBUG
+ if (debug)
+ printf("transmit: at %ld %s->%s mode %d keyid %08x len %d\n",
+ current_time, peer->dstadr ?
+ ntoa(&peer->dstadr->sin) : "-",
+ ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen);
+#endif
+#endif /* !AUTOKEY */
+}
+
+
+/*
+ * fast_xmit - Send packet for nonpersistent association. Note that
+ * neither the source or destination can be a broadcast address.
+ */
+static void
+fast_xmit(
+ struct recvbuf *rbufp, /* receive packet pointer */
+ int xmode, /* receive mode */
+ keyid_t xkeyid, /* transmit key ID */
+ int flags /* restrict mask */
+ )
+{
+ struct pkt xpkt; /* transmit packet structure */
+ struct pkt *rpkt; /* receive packet structure */
+ l_fp xmt_tx, xmt_ty;
+ int sendlen;
+#ifdef AUTOKEY
+ u_int32 temp32;
+#endif
+
+ /*
+ * Initialize transmit packet header fields from the receive
+ * buffer provided. We leave the fields intact as received, but
+ * set the peer poll at the maximum of the receive peer poll and
+ * the system minimum poll (ntp_minpoll). This is for KoD rate
+ * control and not strictly specification compliant, but doesn't
+ * break anything.
+ *
+ * If the gazinta was from a multicast address, the gazoutta
+ * must go out another way.
+ */
+ rpkt = &rbufp->recv_pkt;
+ if (rbufp->dstadr->flags & INT_MCASTOPEN)
+ rbufp->dstadr = findinterface(&rbufp->recv_srcadr);
+
+ /*
+ * If this is a kiss-o'-death (KoD) packet, show leap
+ * unsynchronized, stratum zero, reference ID the four-character
+ * kiss code and system root delay. Note we don't reveal the
+ * local time, so these packets can't be used for
+ * synchronization.
+ */
+ if (flags & RES_KOD) {
+ sys_kodsent++;
+ xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
+ PKT_VERSION(rpkt->li_vn_mode), xmode);
+ xpkt.stratum = STRATUM_PKT_UNSPEC;
+ xpkt.ppoll = max(rpkt->ppoll, ntp_minpoll);
+ xpkt.precision = rpkt->precision;
+ memcpy(&xpkt.refid, "RATE", 4);
+ xpkt.rootdelay = rpkt->rootdelay;
+ xpkt.rootdisp = rpkt->rootdisp;
+ xpkt.reftime = rpkt->reftime;
+ xpkt.org = rpkt->xmt;
+ xpkt.rec = rpkt->xmt;
+ xpkt.xmt = rpkt->xmt;
+
+ /*
+ * This is a normal packet. Use the system variables.
+ */
+ } else {
+ xpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap,
+ PKT_VERSION(rpkt->li_vn_mode), xmode);
+ xpkt.stratum = STRATUM_TO_PKT(sys_stratum);
+ xpkt.ppoll = max(rpkt->ppoll, ntp_minpoll);
+ xpkt.precision = sys_precision;
+ xpkt.refid = sys_refid;
+ xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay));
+ xpkt.rootdisp = HTONS_FP(DTOUFP(sys_rootdisp));
+ HTONL_FP(&sys_reftime, &xpkt.reftime);
+ xpkt.org = rpkt->xmt;
+ HTONL_FP(&rbufp->recv_time, &xpkt.rec);
+ get_systime(&xmt_tx);
+ HTONL_FP(&xmt_tx, &xpkt.xmt);
+ }
+
+#ifdef HAVE_NTP_SIGND
+ if (flags & RES_MSSNTP) {
+ send_via_ntp_signd(rbufp, xmode, xkeyid, flags, &xpkt);
+ return;
+ }
+#endif /* HAVE_NTP_SIGND */
+
+ /*
+ * If the received packet contains a MAC, the transmitted packet
+ * is authenticated and contains a MAC. If not, the transmitted
+ * packet is not authenticated.
+ */
+ sendlen = LEN_PKT_NOMAC;
+ if (rbufp->recv_length == sendlen) {
+ sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, 0, &xpkt,
+ sendlen);
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "transmit: at %ld %s->%s mode %d len %d\n",
+ current_time, stoa(&rbufp->dstadr->sin),
+ stoa(&rbufp->recv_srcadr), xmode, sendlen);
+#endif
+ return;
+ }
+
+ /*
+ * The received packet contains a MAC, so the transmitted packet
+ * must be authenticated. For symmetric key cryptography, use
+ * the predefined and trusted symmetric keys to generate the
+ * cryptosum. For autokey cryptography, use the server private
+ * value to generate the cookie, which is unique for every
+ * source-destination-key ID combination.
+ */
+#ifdef AUTOKEY
+ if (xkeyid > NTP_MAXKEY) {
+ keyid_t cookie;
+
+ /*
+ * The only way to get here is a reply to a legitimate
+ * client request message, so the mode must be
+ * MODE_SERVER. If an extension field is present, there
+ * can be only one and that must be a command. Do what
+ * needs, but with private value of zero so the poor
+ * jerk can decode it. If no extension field is present,
+ * use the cookie to generate the session key.
+ */
+ cookie = session_key(&rbufp->recv_srcadr,
+ &rbufp->dstadr->sin, 0, sys_private, 0);
+ if (rbufp->recv_length > sendlen + (int)MAX_MAC_LEN) {
+ session_key(&rbufp->dstadr->sin,
+ &rbufp->recv_srcadr, xkeyid, 0, 2);
+ temp32 = CRYPTO_RESP;
+ rpkt->exten[0] |= htonl(temp32);
+ sendlen += crypto_xmit(NULL, &xpkt, rbufp,
+ sendlen, (struct exten *)rpkt->exten,
+ cookie);
+ } else {
+ session_key(&rbufp->dstadr->sin,
+ &rbufp->recv_srcadr, xkeyid, cookie, 2);
+ }
+ }
+#endif /* AUTOKEY */
+ get_systime(&xmt_tx);
+ sendlen += authencrypt(xkeyid, (u_int32 *)&xpkt, sendlen);
+#ifdef AUTOKEY
+ if (xkeyid > NTP_MAXKEY)
+ authtrust(xkeyid, 0);
+#endif /* AUTOKEY */
+ sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, 0, &xpkt, sendlen);
+ get_systime(&xmt_ty);
+ L_SUB(&xmt_ty, &xmt_tx);
+ sys_authdelay = xmt_ty;
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "transmit: at %ld %s->%s mode %d keyid %08x len %d\n",
+ current_time, ntoa(&rbufp->dstadr->sin),
+ ntoa(&rbufp->recv_srcadr), xmode, xkeyid, sendlen);
+#endif
+}
+
+
+/*
+ * pool_xmit - resolve hostname or send unicast solicitation for pool.
+ */
+static void
+pool_xmit(
+ struct peer *pool /* pool solicitor association */
+ )
+{
+#ifdef WORKER
+ struct pkt xpkt; /* transmit packet structure */
+ struct addrinfo hints;
+ int rc;
+ struct interface * lcladr;
+ sockaddr_u * rmtadr;
+ int restrict_mask;
+ struct peer * p;
+ l_fp xmt_tx;
+
+ if (NULL == pool->ai) {
+ if (pool->addrs != NULL) {
+ /* free() is used with copy_addrinfo_list() */
+ free(pool->addrs);
+ pool->addrs = NULL;
+ }
+ ZERO(hints);
+ hints.ai_family = AF(&pool->srcadr);
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+ /* ignore getaddrinfo_sometime() errors, we will retry */
+ rc = getaddrinfo_sometime(
+ pool->hostname,
+ "ntp",
+ &hints,
+ 0, /* no retry */
+ &pool_name_resolved,
+ (void *)(u_int)pool->associd);
+ if (!rc)
+ DPRINTF(1, ("pool DNS lookup %s started\n",
+ pool->hostname));
+ else
+ msyslog(LOG_ERR,
+ "unable to start pool DNS %s %m",
+ pool->hostname);
+ return;
+ }
+
+ do {
+ /* copy_addrinfo_list ai_addr points to a sockaddr_u */
+ rmtadr = (sockaddr_u *)(void *)pool->ai->ai_addr;
+ pool->ai = pool->ai->ai_next;
+ p = findexistingpeer(rmtadr, NULL, NULL, MODE_CLIENT, 0);
+ } while (p != NULL && pool->ai != NULL);
+ if (p != NULL)
+ return; /* out of addresses, re-query DNS next poll */
+ restrict_mask = restrictions(rmtadr);
+ if (RES_FLAGS & restrict_mask)
+ restrict_source(rmtadr, 0,
+ current_time + POOL_SOLICIT_WINDOW + 1);
+ lcladr = findinterface(rmtadr);
+ memset(&xpkt, 0, sizeof(xpkt));
+ xpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap, pool->version,
+ MODE_CLIENT);
+ xpkt.stratum = STRATUM_TO_PKT(sys_stratum);
+ xpkt.ppoll = pool->hpoll;
+ xpkt.precision = sys_precision;
+ xpkt.refid = sys_refid;
+ xpkt.rootdelay = HTONS_FP(DTOFP(sys_rootdelay));
+ xpkt.rootdisp = HTONS_FP(DTOUFP(sys_rootdisp));
+ HTONL_FP(&sys_reftime, &xpkt.reftime);
+ get_systime(&xmt_tx);
+ pool->aorg = xmt_tx;
+ HTONL_FP(&xmt_tx, &xpkt.xmt);
+ sendpkt(rmtadr, lcladr, sys_ttl[pool->ttl], &xpkt,
+ LEN_PKT_NOMAC);
+ pool->sent++;
+ pool->throttle += (1 << pool->minpoll) - 2;
+#ifdef DEBUG
+ if (debug)
+ printf("transmit: at %ld %s->%s pool\n",
+ current_time, latoa(lcladr), stoa(rmtadr));
+#endif
+ msyslog(LOG_INFO, "Soliciting pool server %s", stoa(rmtadr));
+#endif /* WORKER */
+}
+
+
+#ifdef AUTOKEY
+ /*
+ * group_test - test if this is the same group
+ *
+ * host assoc return action
+ * none none 0 mobilize *
+ * none group 0 mobilize *
+ * group none 0 mobilize *
+ * group group 1 mobilize
+ * group different 1 ignore
+ * * ignore if notrust
+ */
+int group_test(
+ char *grp,
+ char *ident
+ )
+{
+ if (grp == NULL)
+ return (0);
+
+ if (strcmp(grp, sys_groupname) == 0)
+ return (0);
+
+ if (ident == NULL)
+ return (1);
+
+ if (strcmp(grp, ident) == 0)
+ return (0);
+
+ return (1);
+}
+#endif /* AUTOKEY */
+
+#ifdef WORKER
+void
+pool_name_resolved(
+ int rescode,
+ int gai_errno,
+ void * context,
+ const char * name,
+ const char * service,
+ const struct addrinfo * hints,
+ const struct addrinfo * res
+ )
+{
+ struct peer * pool; /* pool solicitor association */
+ associd_t assoc;
+
+ if (rescode) {
+ msyslog(LOG_ERR,
+ "error resolving pool %s: %s (%d)",
+ name, gai_strerror(rescode), rescode);
+ return;
+ }
+
+ assoc = (associd_t)(u_int)context;
+ pool = findpeerbyassoc(assoc);
+ if (NULL == pool) {
+ msyslog(LOG_ERR,
+ "Could not find assoc %u for pool DNS %s",
+ assoc, name);
+ return;
+ }
+ DPRINTF(1, ("pool DNS %s completed\n", name));
+ pool->addrs = copy_addrinfo_list(res);
+ pool->ai = pool->addrs;
+ pool_xmit(pool);
+
+}
+#endif /* WORKER */
+
+
+#ifdef AUTOKEY
+/*
+ * key_expire - purge the key list
+ */
+void
+key_expire(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ int i;
+
+ if (peer->keylist != NULL) {
+ for (i = 0; i <= peer->keynumber; i++)
+ authtrust(peer->keylist[i], 0);
+ free(peer->keylist);
+ peer->keylist = NULL;
+ }
+ value_free(&peer->sndval);
+ peer->keynumber = 0;
+ peer->flags &= ~FLAG_ASSOC;
+#ifdef DEBUG
+ if (debug)
+ printf("key_expire: at %lu associd %d\n", current_time,
+ peer->associd);
+#endif
+}
+#endif /* AUTOKEY */
+
+
+/*
+ * local_refid(peer) - check peer refid to avoid selecting peers
+ * currently synced to this ntpd.
+ */
+static int
+local_refid(
+ struct peer * p
+ )
+{
+ endpt * unicast_ep;
+
+ if (p->dstadr != NULL && !(INT_MCASTIF & p->dstadr->flags))
+ unicast_ep = p->dstadr;
+ else
+ unicast_ep = findinterface(&p->srcadr);
+
+ if (unicast_ep != NULL && p->refid == unicast_ep->addr_refid)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+
+/*
+ * Determine if the peer is unfit for synchronization
+ *
+ * A peer is unfit for synchronization if
+ * > TEST10 bad leap or stratum below floor or at or above ceiling
+ * > TEST11 root distance exceeded for remote peer
+ * > TEST12 a direct or indirect synchronization loop would form
+ * > TEST13 unreachable or noselect
+ */
+int /* FALSE if fit, TRUE if unfit */
+peer_unfit(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ int rval = 0;
+
+ /*
+ * A stratum error occurs if (1) the server has never been
+ * synchronized, (2) the server stratum is below the floor or
+ * greater than or equal to the ceiling.
+ */
+ if (peer->leap == LEAP_NOTINSYNC || peer->stratum < sys_floor ||
+ peer->stratum >= sys_ceiling)
+ rval |= TEST10; /* bad synch or stratum */
+
+ /*
+ * A distance error for a remote peer occurs if the root
+ * distance is greater than or equal to the distance threshold
+ * plus the increment due to one host poll interval.
+ */
+ if (!(peer->flags & FLAG_REFCLOCK) && root_distance(peer) >=
+ sys_maxdist + clock_phi * ULOGTOD(peer->hpoll))
+ rval |= TEST11; /* distance exceeded */
+
+ /*
+ * A loop error occurs if the remote peer is synchronized to the
+ * local peer or if the remote peer is synchronized to the same
+ * server as the local peer but only if the remote peer is
+ * neither a reference clock nor an orphan.
+ */
+ if (peer->stratum > 1 && local_refid(peer))
+ rval |= TEST12; /* synchronization loop */
+
+ /*
+ * An unreachable error occurs if the server is unreachable or
+ * the noselect bit is set.
+ */
+ if (!peer->reach || (peer->flags & FLAG_NOSELECT))
+ rval |= TEST13; /* unreachable */
+
+ peer->flash &= ~PEER_TEST_MASK;
+ peer->flash |= rval;
+ return (rval);
+}
+
+
+/*
+ * Find the precision of this particular machine
+ */
+#define MINSTEP 20e-9 /* minimum clock increment (s) */
+#define MAXSTEP 1 /* maximum clock increment (s) */
+#define MINCHANGES 12 /* minimum number of step samples */
+#define MAXLOOPS ((int)(1. / MINSTEP)) /* avoid infinite loop */
+
+/*
+ * This routine measures the system precision defined as the minimum of
+ * a sequence of differences between successive readings of the system
+ * clock. However, if a difference is less than MINSTEP, the clock has
+ * been read more than once during a clock tick and the difference is
+ * ignored. We set MINSTEP greater than zero in case something happens
+ * like a cache miss, and to tolerate underlying system clocks which
+ * ensure each reading is strictly greater than prior readings while
+ * using an underlying stepping (not interpolated) clock.
+ *
+ * sys_tick and sys_precision represent the time to read the clock for
+ * systems with high-precision clocks, and the tick interval or step
+ * size for lower-precision stepping clocks.
+ *
+ * This routine also measures the time to read the clock on stepping
+ * system clocks by counting the number of readings between changes of
+ * the underlying clock. With either type of clock, the minimum time
+ * to read the clock is saved as sys_fuzz, and used to ensure the
+ * get_systime() readings always increase and are fuzzed below sys_fuzz.
+ */
+void
+measure_precision(void)
+{
+ /*
+ * With sys_fuzz set to zero, get_systime() fuzzing of low bits
+ * is effectively disabled. trunc_os_clock is FALSE to disable
+ * get_ostime() simulation of a low-precision system clock.
+ */
+ set_sys_fuzz(0.);
+ trunc_os_clock = FALSE;
+ measured_tick = measure_tick_fuzz();
+ set_sys_tick_precision(measured_tick);
+ msyslog(LOG_INFO, "proto: precision = %.3f usec (%d)",
+ sys_tick * 1e6, sys_precision);
+ if (sys_fuzz < sys_tick) {
+ msyslog(LOG_NOTICE, "proto: fuzz beneath %.3f usec",
+ sys_fuzz * 1e6);
+ }
+}
+
+
+/*
+ * measure_tick_fuzz()
+ *
+ * measures the minimum time to read the clock (stored in sys_fuzz)
+ * and returns the tick, the larger of the minimum increment observed
+ * between successive clock readings and the time to read the clock.
+ */
+double
+measure_tick_fuzz(void)
+{
+ l_fp minstep; /* MINSTEP as l_fp */
+ l_fp val; /* current seconds fraction */
+ l_fp last; /* last seconds fraction */
+ l_fp ldiff; /* val - last */
+ double tick; /* computed tick value */
+ double diff;
+ long repeats;
+ long max_repeats;
+ int changes;
+ int i; /* log2 precision */
+
+ tick = MAXSTEP;
+ max_repeats = 0;
+ repeats = 0;
+ changes = 0;
+ DTOLFP(MINSTEP, &minstep);
+ get_systime(&last);
+ for (i = 0; i < MAXLOOPS && changes < MINCHANGES; i++) {
+ get_systime(&val);
+ ldiff = val;
+ L_SUB(&ldiff, &last);
+ last = val;
+ if (L_ISGT(&ldiff, &minstep)) {
+ max_repeats = max(repeats, max_repeats);
+ repeats = 0;
+ changes++;
+ LFPTOD(&ldiff, diff);
+ tick = min(diff, tick);
+ } else {
+ repeats++;
+ }
+ }
+ if (changes < MINCHANGES) {
+ msyslog(LOG_ERR, "Fatal error: precision could not be measured (MINSTEP too large?)");
+ exit(1);
+ }
+
+ if (0 == max_repeats) {
+ set_sys_fuzz(tick);
+ } else {
+ set_sys_fuzz(tick / max_repeats);
+ }
+
+ return tick;
+}
+
+
+void
+set_sys_tick_precision(
+ double tick
+ )
+{
+ int i;
+
+ if (tick > 1.) {
+ msyslog(LOG_ERR,
+ "unsupported tick %.3f > 1s ignored", tick);
+ return;
+ }
+ if (tick < measured_tick) {
+ msyslog(LOG_ERR,
+ "proto: tick %.3f less than measured tick %.3f, ignored",
+ tick, measured_tick);
+ return;
+ } else if (tick > measured_tick) {
+ trunc_os_clock = TRUE;
+ msyslog(LOG_NOTICE,
+ "proto: truncating system clock to multiples of %.9f",
+ tick);
+ }
+ sys_tick = tick;
+
+ /*
+ * Find the nearest power of two.
+ */
+ for (i = 0; tick <= 1; i--)
+ tick *= 2;
+ if (tick - 1 > 1 - tick / 2)
+ i++;
+
+ sys_precision = (s_char)i;
+}
+
+
+/*
+ * init_proto - initialize the protocol module's data
+ */
+void
+init_proto(void)
+{
+ l_fp dummy;
+ int i;
+
+ /*
+ * Fill in the sys_* stuff. Default is don't listen to
+ * broadcasting, require authentication.
+ */
+ sys_leap = LEAP_NOTINSYNC;
+ sys_stratum = STRATUM_UNSPEC;
+ memcpy(&sys_refid, "INIT", 4);
+ sys_peer = NULL;
+ sys_rootdelay = 0;
+ sys_rootdisp = 0;
+ L_CLR(&sys_reftime);
+ sys_jitter = 0;
+ measure_precision();
+ get_systime(&dummy);
+ sys_survivors = 0;
+ sys_manycastserver = 0;
+ sys_bclient = 0;
+ sys_bdelay = 0;
+ sys_authenticate = 1;
+ sys_stattime = current_time;
+ orphwait = current_time + sys_orphwait;
+ proto_clr_stats();
+ for (i = 0; i < MAX_TTL; i++) {
+ sys_ttl[i] = (u_char)((i * 256) / MAX_TTL);
+ sys_ttlmax = i;
+ }
+ hardpps_enable = 0;
+ stats_control = 1;
+}
+
+
+/*
+ * proto_config - configure the protocol module
+ */
+void
+proto_config(
+ int item,
+ u_long value,
+ double dvalue,
+ sockaddr_u *svalue
+ )
+{
+ /*
+ * Figure out what he wants to change, then do it
+ */
+ DPRINTF(2, ("proto_config: code %d value %lu dvalue %lf\n",
+ item, value, dvalue));
+
+ switch (item) {
+
+ /*
+ * enable and disable commands - arguments are Boolean.
+ */
+ case PROTO_AUTHENTICATE: /* authentication (auth) */
+ sys_authenticate = value;
+ break;
+
+ case PROTO_BROADCLIENT: /* broadcast client (bclient) */
+ sys_bclient = (int)value;
+ if (sys_bclient == 0)
+ io_unsetbclient();
+ else
+ io_setbclient();
+ break;
+
+#ifdef REFCLOCK
+ case PROTO_CAL: /* refclock calibrate (calibrate) */
+ cal_enable = value;
+ break;
+#endif /* REFCLOCK */
+
+ case PROTO_KERNEL: /* kernel discipline (kernel) */
+ select_loop(value);
+ break;
+
+ case PROTO_MONITOR: /* monitoring (monitor) */
+ if (value)
+ mon_start(MON_ON);
+ else
+ mon_stop(MON_ON);
+ break;
+
+ case PROTO_NTP: /* NTP discipline (ntp) */
+ ntp_enable = value;
+ break;
+
+ case PROTO_MODE7: /* mode7 management (ntpdc) */
+ ntp_mode7 = value;
+ break;
+
+ case PROTO_PPS: /* PPS discipline (pps) */
+ hardpps_enable = value;
+ break;
+
+ case PROTO_FILEGEN: /* statistics (stats) */
+ stats_control = value;
+ break;
+
+ /*
+ * tos command - arguments are double, sometimes cast to int
+ */
+ case PROTO_BEACON: /* manycast beacon (beacon) */
+ sys_beacon = (int)dvalue;
+ break;
+
+ case PROTO_BROADDELAY: /* default broadcast delay (bdelay) */
+ sys_bdelay = dvalue;
+ break;
+
+ case PROTO_CEILING: /* stratum ceiling (ceiling) */
+ sys_ceiling = (int)dvalue;
+ break;
+
+ case PROTO_COHORT: /* cohort switch (cohort) */
+ sys_cohort = (int)dvalue;
+ break;
+
+ case PROTO_FLOOR: /* stratum floor (floor) */
+ sys_floor = (int)dvalue;
+ break;
+
+ case PROTO_MAXCLOCK: /* maximum candidates (maxclock) */
+ sys_maxclock = (int)dvalue;
+ break;
+
+ case PROTO_MAXDIST: /* select threshold (maxdist) */
+ sys_maxdist = dvalue;
+ break;
+
+ case PROTO_CALLDELAY: /* modem call delay (mdelay) */
+ break; /* NOT USED */
+
+ case PROTO_MINCLOCK: /* minimum candidates (minclock) */
+ sys_minclock = (int)dvalue;
+ break;
+
+ case PROTO_MINDISP: /* minimum distance (mindist) */
+ sys_mindisp = dvalue;
+ break;
+
+ case PROTO_MINSANE: /* minimum survivors (minsane) */
+ sys_minsane = (int)dvalue;
+ break;
+
+ case PROTO_ORPHAN: /* orphan stratum (orphan) */
+ sys_orphan = (int)dvalue;
+ break;
+
+ case PROTO_ORPHWAIT: /* orphan wait (orphwait) */
+ orphwait -= sys_orphwait;
+ sys_orphwait = (int)dvalue;
+ orphwait += sys_orphwait;
+ break;
+
+ /*
+ * Miscellaneous commands
+ */
+ case PROTO_MULTICAST_ADD: /* add group address */
+ if (svalue != NULL)
+ io_multicast_add(svalue);
+ sys_bclient = 1;
+ break;
+
+ case PROTO_MULTICAST_DEL: /* delete group address */
+ if (svalue != NULL)
+ io_multicast_del(svalue);
+ break;
+
+ default:
+ msyslog(LOG_NOTICE,
+ "proto: unsupported option %d", item);
+ }
+}
+
+
+/*
+ * proto_clr_stats - clear protocol stat counters
+ */
+void
+proto_clr_stats(void)
+{
+ sys_stattime = current_time;
+ sys_received = 0;
+ sys_processed = 0;
+ sys_newversion = 0;
+ sys_oldversion = 0;
+ sys_declined = 0;
+ sys_restricted = 0;
+ sys_badlength = 0;
+ sys_badauth = 0;
+ sys_limitrejected = 0;
+ sys_kodsent = 0;
+}
diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c
new file mode 100644
index 0000000..f0e9b9e
--- /dev/null
+++ b/ntpd/ntp_refclock.c
@@ -0,0 +1,1332 @@
+/*
+ * ntp_refclock - processing support for reference clocks
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_tty.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+
+#include <stdio.h>
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#ifdef REFCLOCK
+
+#ifdef KERNEL_PLL
+#include "ntp_syscall.h"
+#endif /* KERNEL_PLL */
+
+#ifdef HAVE_PPSAPI
+#include "ppsapi_timepps.h"
+#include "refclock_atom.h"
+#endif /* HAVE_PPSAPI */
+
+/*
+ * Reference clock support is provided here by maintaining the fiction
+ * that the clock is actually a peer. As no packets are exchanged with
+ * a reference clock, however, we replace the transmit, receive and
+ * packet procedures with separate code to simulate them. Routines
+ * refclock_transmit() and refclock_receive() maintain the peer
+ * variables in a state analogous to an actual peer and pass reference
+ * clock data on through the filters. Routines refclock_peer() and
+ * refclock_unpeer() are called to initialize and terminate reference
+ * clock associations. A set of utility routines is included to open
+ * serial devices, process sample data, and to perform various debugging
+ * functions.
+ *
+ * The main interface used by these routines is the refclockproc
+ * structure, which contains for most drivers the decimal equivalants
+ * of the year, day, month, hour, second and millisecond/microsecond
+ * decoded from the ASCII timecode. Additional information includes
+ * the receive timestamp, exception report, statistics tallies, etc.
+ * In addition, there may be a driver-specific unit structure used for
+ * local control of the device.
+ *
+ * The support routines are passed a pointer to the peer structure,
+ * which is used for all peer-specific processing and contains a
+ * pointer to the refclockproc structure, which in turn contains a
+ * pointer to the unit structure, if used. The peer structure is
+ * identified by an interface address in the dotted quad form
+ * 127.127.t.u, where t is the clock type and u the unit.
+ */
+#define FUDGEFAC .1 /* fudge correction factor */
+#define LF 0x0a /* ASCII LF */
+
+int cal_enable; /* enable refclock calibrate */
+
+/*
+ * Forward declarations
+ */
+static int refclock_cmpl_fp (const void *, const void *);
+static int refclock_sample (struct refclockproc *);
+static int refclock_ioctl(int, u_int);
+
+
+/*
+ * refclock_report - note the occurance of an event
+ *
+ * This routine presently just remembers the report and logs it, but
+ * does nothing heroic for the trap handler. It tries to be a good
+ * citizen and bothers the system log only if things change.
+ */
+void
+refclock_report(
+ struct peer *peer,
+ int code
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ if (pp == NULL)
+ return;
+
+ switch (code) {
+
+ case CEVNT_TIMEOUT:
+ pp->noreply++;
+ break;
+
+ case CEVNT_BADREPLY:
+ pp->badformat++;
+ break;
+
+ case CEVNT_FAULT:
+ break;
+
+ case CEVNT_BADDATE:
+ case CEVNT_BADTIME:
+ pp->baddata++;
+ break;
+
+ default:
+ /* ignore others */
+ break;
+ }
+ if (pp->lastevent < 15)
+ pp->lastevent++;
+ if (pp->currentstatus != code) {
+ pp->currentstatus = (u_char)code;
+ report_event(PEVNT_CLOCK, peer, ceventstr(code));
+ }
+}
+
+
+/*
+ * init_refclock - initialize the reference clock drivers
+ *
+ * This routine calls each of the drivers in turn to initialize internal
+ * variables, if necessary. Most drivers have nothing to say at this
+ * point.
+ */
+void
+init_refclock(void)
+{
+ int i;
+
+ for (i = 0; i < (int)num_refclock_conf; i++)
+ if (refclock_conf[i]->clock_init != noentry)
+ (refclock_conf[i]->clock_init)();
+}
+
+
+/*
+ * refclock_newpeer - initialize and start a reference clock
+ *
+ * This routine allocates and initializes the interface structure which
+ * supports a reference clock in the form of an ordinary NTP peer. A
+ * driver-specific support routine completes the initialization, if
+ * used. Default peer variables which identify the clock and establish
+ * its reference ID and stratum are set here. It returns one if success
+ * and zero if the clock address is invalid or already running,
+ * insufficient resources are available or the driver declares a bum
+ * rap.
+ */
+int
+refclock_newpeer(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ u_char clktype;
+ int unit;
+
+ /*
+ * Check for valid clock address. If already running, shut it
+ * down first.
+ */
+ if (!ISREFCLOCKADR(&peer->srcadr)) {
+ msyslog(LOG_ERR,
+ "refclock_newpeer: clock address %s invalid",
+ stoa(&peer->srcadr));
+ return (0);
+ }
+ clktype = (u_char)REFCLOCKTYPE(&peer->srcadr);
+ unit = REFCLOCKUNIT(&peer->srcadr);
+ if (clktype >= num_refclock_conf ||
+ refclock_conf[clktype]->clock_start == noentry) {
+ msyslog(LOG_ERR,
+ "refclock_newpeer: clock type %d invalid\n",
+ clktype);
+ return (0);
+ }
+
+ /*
+ * Allocate and initialize interface structure
+ */
+ pp = emalloc_zero(sizeof(*pp));
+ peer->procptr = pp;
+
+ /*
+ * Initialize structures
+ */
+ peer->refclktype = clktype;
+ peer->refclkunit = (u_char)unit;
+ peer->flags |= FLAG_REFCLOCK;
+ peer->leap = LEAP_NOTINSYNC;
+ peer->stratum = STRATUM_REFCLOCK;
+ peer->ppoll = peer->maxpoll;
+ pp->type = clktype;
+ pp->conf = refclock_conf[clktype];
+ pp->timestarted = current_time;
+ pp->io.fd = -1;
+
+ /*
+ * Set peer.pmode based on the hmode. For appearances only.
+ */
+ switch (peer->hmode) {
+ case MODE_ACTIVE:
+ peer->pmode = MODE_PASSIVE;
+ break;
+
+ default:
+ peer->pmode = MODE_SERVER;
+ break;
+ }
+
+ /*
+ * Do driver dependent initialization. The above defaults
+ * can be wiggled, then finish up for consistency.
+ */
+ if (!((refclock_conf[clktype]->clock_start)(unit, peer))) {
+ refclock_unpeer(peer);
+ return (0);
+ }
+ peer->refid = pp->refid;
+ return (1);
+}
+
+
+/*
+ * refclock_unpeer - shut down a clock
+ */
+void
+refclock_unpeer(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ u_char clktype;
+ int unit;
+
+ /*
+ * Wiggle the driver to release its resources, then give back
+ * the interface structure.
+ */
+ if (NULL == peer->procptr)
+ return;
+
+ clktype = peer->refclktype;
+ unit = peer->refclkunit;
+ if (refclock_conf[clktype]->clock_shutdown != noentry)
+ (refclock_conf[clktype]->clock_shutdown)(unit, peer);
+ free(peer->procptr);
+ peer->procptr = NULL;
+}
+
+
+/*
+ * refclock_timer - called once per second for housekeeping.
+ */
+void
+refclock_timer(
+ struct peer *p
+ )
+{
+ struct refclockproc * pp;
+ int unit;
+
+ unit = p->refclkunit;
+ pp = p->procptr;
+ if (pp->conf->clock_timer != noentry)
+ (*pp->conf->clock_timer)(unit, p);
+ if (pp->action != NULL && pp->nextaction <= current_time)
+ (*pp->action)(p);
+}
+
+
+/*
+ * refclock_transmit - simulate the transmit procedure
+ *
+ * This routine implements the NTP transmit procedure for a reference
+ * clock. This provides a mechanism to call the driver at the NTP poll
+ * interval, as well as provides a reachability mechanism to detect a
+ * broken radio or other madness.
+ */
+void
+refclock_transmit(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ u_char clktype;
+ int unit;
+
+ clktype = peer->refclktype;
+ unit = peer->refclkunit;
+ peer->sent++;
+ get_systime(&peer->xmt);
+
+ /*
+ * This is a ripoff of the peer transmit routine, but
+ * specialized for reference clocks. We do a little less
+ * protocol here and call the driver-specific transmit routine.
+ */
+ if (peer->burst == 0) {
+ u_char oreach;
+#ifdef DEBUG
+ if (debug)
+ printf("refclock_transmit: at %ld %s\n",
+ current_time, stoa(&(peer->srcadr)));
+#endif
+
+ /*
+ * Update reachability and poll variables like the
+ * network code.
+ */
+ oreach = peer->reach & 0xfe;
+ peer->reach <<= 1;
+ if (!(peer->reach & 0x0f))
+ clock_filter(peer, 0., 0., MAXDISPERSE);
+ peer->outdate = current_time;
+ if (!peer->reach) {
+ if (oreach) {
+ report_event(PEVNT_UNREACH, peer, NULL);
+ peer->timereachable = current_time;
+ }
+ } else {
+ if (peer->flags & FLAG_BURST)
+ peer->burst = NSTAGE;
+ }
+ } else {
+ peer->burst--;
+ }
+ if (refclock_conf[clktype]->clock_poll != noentry)
+ (refclock_conf[clktype]->clock_poll)(unit, peer);
+ poll_update(peer, peer->hpoll);
+}
+
+
+/*
+ * Compare two doubles - used with qsort()
+ */
+static int
+refclock_cmpl_fp(
+ const void *p1,
+ const void *p2
+ )
+{
+ const double *dp1 = (const double *)p1;
+ const double *dp2 = (const double *)p2;
+
+ if (*dp1 < *dp2)
+ return -1;
+ if (*dp1 > *dp2)
+ return 1;
+ return 0;
+}
+
+
+/*
+ * refclock_process_offset - update median filter
+ *
+ * This routine uses the given offset and timestamps to construct a new
+ * entry in the median filter circular buffer. Samples that overflow the
+ * filter are quietly discarded.
+ */
+void
+refclock_process_offset(
+ struct refclockproc *pp, /* refclock structure pointer */
+ l_fp lasttim, /* last timecode timestamp */
+ l_fp lastrec, /* last receive timestamp */
+ double fudge
+ )
+{
+ l_fp lftemp;
+ double doffset;
+
+ pp->lastrec = lastrec;
+ lftemp = lasttim;
+ L_SUB(&lftemp, &lastrec);
+ LFPTOD(&lftemp, doffset);
+ SAMPLE(doffset + fudge);
+}
+
+
+/*
+ * refclock_process - process a sample from the clock
+ * refclock_process_f - refclock_process with other than time1 fudge
+ *
+ * This routine converts the timecode in the form days, hours, minutes,
+ * seconds and milliseconds/microseconds to internal timestamp format,
+ * then constructs a new entry in the median filter circular buffer.
+ * Return success (1) if the data are correct and consistent with the
+ * converntional calendar.
+ *
+ * Important for PPS users: Normally, the pp->lastrec is set to the
+ * system time when the on-time character is received and the pp->year,
+ * ..., pp->second decoded and the seconds fraction pp->nsec in
+ * nanoseconds). When a PPS offset is available, pp->nsec is forced to
+ * zero and the fraction for pp->lastrec is set to the PPS offset.
+ */
+int
+refclock_process_f(
+ struct refclockproc *pp, /* refclock structure pointer */
+ double fudge
+ )
+{
+ l_fp offset, ltemp;
+
+ /*
+ * Compute the timecode timestamp from the days, hours, minutes,
+ * seconds and milliseconds/microseconds of the timecode. Use
+ * clocktime() for the aggregate seconds and the msec/usec for
+ * the fraction, when present. Note that this code relies on the
+ * filesystem time for the years and does not use the years of
+ * the timecode.
+ */
+ if (!clocktime(pp->day, pp->hour, pp->minute, pp->second, GMT,
+ pp->lastrec.l_ui, &pp->yearstart, &offset.l_ui))
+ return (0);
+
+ offset.l_uf = 0;
+ DTOLFP(pp->nsec / 1e9, &ltemp);
+ L_ADD(&offset, &ltemp);
+ refclock_process_offset(pp, offset, pp->lastrec, fudge);
+ return (1);
+}
+
+
+int
+refclock_process(
+ struct refclockproc *pp /* refclock structure pointer */
+)
+{
+ return refclock_process_f(pp, pp->fudgetime1);
+}
+
+
+/*
+ * refclock_sample - process a pile of samples from the clock
+ *
+ * This routine implements a recursive median filter to suppress spikes
+ * in the data, as well as determine a performance statistic. It
+ * calculates the mean offset and RMS jitter. A time adjustment
+ * fudgetime1 can be added to the final offset to compensate for various
+ * systematic errors. The routine returns the number of samples
+ * processed, which could be zero.
+ */
+static int
+refclock_sample(
+ struct refclockproc *pp /* refclock structure pointer */
+ )
+{
+ size_t i, j, k, m, n;
+ double off[MAXSTAGE];
+ double offset;
+
+ /*
+ * Copy the raw offsets and sort into ascending order. Don't do
+ * anything if the buffer is empty.
+ */
+ n = 0;
+ while (pp->codeproc != pp->coderecv) {
+ pp->codeproc = (pp->codeproc + 1) % MAXSTAGE;
+ off[n] = pp->filter[pp->codeproc];
+ n++;
+ }
+ if (n == 0)
+ return (0);
+
+ if (n > 1)
+ qsort(off, n, sizeof(off[0]), refclock_cmpl_fp);
+
+ /*
+ * Reject the furthest from the median of the samples until
+ * approximately 60 percent of the samples remain.
+ */
+ i = 0; j = n;
+ m = n - (n * 4) / 10;
+ while ((j - i) > m) {
+ offset = off[(j + i) / 2];
+ if (off[j - 1] - offset < offset - off[i])
+ i++; /* reject low end */
+ else
+ j--; /* reject high end */
+ }
+
+ /*
+ * Determine the offset and jitter.
+ */
+ pp->offset = 0;
+ pp->jitter = 0;
+ for (k = i; k < j; k++) {
+ pp->offset += off[k];
+ if (k > i)
+ pp->jitter += SQUARE(off[k] - off[k - 1]);
+ }
+ pp->offset /= m;
+ pp->jitter = max(SQRT(pp->jitter / m), LOGTOD(sys_precision));
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "refclock_sample: n %d offset %.6f disp %.6f jitter %.6f\n",
+ (int)n, pp->offset, pp->disp, pp->jitter);
+#endif
+ return (int)n;
+}
+
+
+/*
+ * refclock_receive - simulate the receive and packet procedures
+ *
+ * This routine simulates the NTP receive and packet procedures for a
+ * reference clock. This provides a mechanism in which the ordinary NTP
+ * filter, selection and combining algorithms can be used to suppress
+ * misbehaving radios and to mitigate between them when more than one is
+ * available for backup.
+ */
+void
+refclock_receive(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+
+#ifdef DEBUG
+ if (debug)
+ printf("refclock_receive: at %lu %s\n",
+ current_time, stoa(&peer->srcadr));
+#endif
+
+ /*
+ * Do a little sanity dance and update the peer structure. Groom
+ * the median filter samples and give the data to the clock
+ * filter.
+ */
+ pp = peer->procptr;
+ peer->leap = pp->leap;
+ if (peer->leap == LEAP_NOTINSYNC)
+ return;
+
+ peer->received++;
+ peer->timereceived = current_time;
+ if (!peer->reach) {
+ report_event(PEVNT_REACH, peer, NULL);
+ peer->timereachable = current_time;
+ }
+ peer->reach |= 1;
+ peer->reftime = pp->lastref;
+ peer->aorg = pp->lastrec;
+ peer->rootdisp = pp->disp;
+ get_systime(&peer->dst);
+ if (!refclock_sample(pp))
+ return;
+
+ clock_filter(peer, pp->offset, 0., pp->jitter);
+ if (cal_enable && fabs(last_offset) < sys_mindisp && sys_peer !=
+ NULL) {
+ if (sys_peer->refclktype == REFCLK_ATOM_PPS &&
+ peer->refclktype != REFCLK_ATOM_PPS)
+ pp->fudgetime1 -= pp->offset * FUDGEFAC;
+ }
+}
+
+
+/*
+ * refclock_gtlin - groom next input line and extract timestamp
+ *
+ * This routine processes the timecode received from the clock and
+ * strips the parity bit and control characters. It returns the number
+ * of characters in the line followed by a NULL character ('\0'), which
+ * is not included in the count. In case of an empty line, the previous
+ * line is preserved.
+ */
+int
+refclock_gtlin(
+ struct recvbuf *rbufp, /* receive buffer pointer */
+ char *lineptr, /* current line pointer */
+ int bmax, /* remaining characters in line */
+ l_fp *tsptr /* pointer to timestamp returned */
+ )
+{
+ const char *sp, *spend;
+ char *dp, *dpend;
+ int dlen;
+
+ if (bmax <= 0)
+ return (0);
+
+ dp = lineptr;
+ dpend = dp + bmax - 1; /* leave room for NUL pad */
+ sp = (const char *)rbufp->recv_buffer;
+ spend = sp + rbufp->recv_length;
+
+ while (sp != spend && dp != dpend) {
+ char c;
+
+ c = *sp++ & 0x7f;
+ if (c >= 0x20 && c < 0x7f)
+ *dp++ = c;
+ }
+ /* Get length of data written to the destination buffer. If
+ * zero, do *not* place a NUL byte to preserve the previous
+ * buffer content.
+ */
+ dlen = dp - lineptr;
+ if (dlen)
+ *dp = '\0';
+ *tsptr = rbufp->recv_time;
+ DPRINTF(2, ("refclock_gtlin: fd %d time %s timecode %d %s\n",
+ rbufp->fd, ulfptoa(&rbufp->recv_time, 6), dlen,
+ (dlen != 0)
+ ? lineptr
+ : ""));
+ return (dlen);
+}
+
+
+/*
+ * refclock_gtraw - get next line/chunk of data
+ *
+ * This routine returns the raw data received from the clock in both
+ * canonical or raw modes. The terminal interface routines map CR to LF.
+ * In canonical mode this results in two lines, one containing data
+ * followed by LF and another containing only LF. In raw mode the
+ * interface routines can deliver arbitraty chunks of data from one
+ * character to a maximum specified by the calling routine. In either
+ * mode the routine returns the number of characters in the line
+ * followed by a NULL character ('\0'), which is not included in the
+ * count.
+ *
+ * *tsptr receives a copy of the buffer timestamp.
+ */
+int
+refclock_gtraw(
+ struct recvbuf *rbufp, /* receive buffer pointer */
+ char *lineptr, /* current line pointer */
+ int bmax, /* remaining characters in line */
+ l_fp *tsptr /* pointer to timestamp returned */
+ )
+{
+ if (bmax <= 0)
+ return (0);
+ bmax -= 1; /* leave room for trailing NUL */
+ if (bmax > rbufp->recv_length)
+ bmax = rbufp->recv_length;
+ memcpy(lineptr, rbufp->recv_buffer, bmax);
+ lineptr[bmax] = '\0';
+
+ *tsptr = rbufp->recv_time;
+ DPRINTF(2, ("refclock_gtraw: fd %d time %s timecode %d %s\n",
+ rbufp->fd, ulfptoa(&rbufp->recv_time, 6), bmax,
+ lineptr));
+ return (bmax);
+}
+
+
+/*
+ * indicate_refclock_packet()
+ *
+ * Passes a fragment of refclock input read from the device to the
+ * driver direct input routine, which may consume it (batch it for
+ * queuing once a logical unit is assembled). If it is not so
+ * consumed, queue it for the driver's receive entrypoint.
+ *
+ * The return value is TRUE if the data has been consumed as a fragment
+ * and should not be counted as a received packet.
+ */
+int
+indicate_refclock_packet(
+ struct refclockio * rio,
+ struct recvbuf * rb
+ )
+{
+ /* Does this refclock use direct input routine? */
+ if (rio->io_input != NULL && (*rio->io_input)(rb) == 0) {
+ /*
+ * data was consumed - nothing to pass up
+ * into block input machine
+ */
+ freerecvbuf(rb);
+
+ return TRUE;
+ }
+ add_full_recv_buffer(rb);
+
+ return FALSE;
+}
+
+
+/*
+ * process_refclock_packet()
+ *
+ * Used for deferred processing of 'io_input' on systems where threading
+ * is used (notably Windows). This is acting as a trampoline to make the
+ * real calls to the refclock functions.
+ */
+#ifdef HAVE_IO_COMPLETION_PORT
+void
+process_refclock_packet(
+ struct recvbuf * rb
+ )
+{
+ struct refclockio * rio;
+
+ /* get the refclockio structure from the receive buffer */
+ rio = &rb->recv_peer->procptr->io;
+
+ /* call 'clock_recv' if either there is no input function or the
+ * raw input function tells us to feed the packet to the
+ * receiver.
+ */
+ if (rio->io_input == NULL || (*rio->io_input)(rb) != 0) {
+ rio->recvcount++;
+ packets_received++;
+ handler_pkts++;
+ (*rio->clock_recv)(rb);
+ }
+}
+#endif /* HAVE_IO_COMPLETION_PORT */
+
+
+/*
+ * The following code does not apply to WINNT & VMS ...
+ */
+#if !defined(SYS_VXWORKS) && !defined(SYS_WINNT)
+#if defined(HAVE_TERMIOS) || defined(HAVE_SYSV_TTYS) || defined(HAVE_BSD_TTYS)
+
+/*
+ * refclock_open - open serial port for reference clock
+ *
+ * This routine opens a serial port for I/O and sets default options. It
+ * returns the file descriptor if successful, or logs an error and
+ * returns -1.
+ */
+int
+refclock_open(
+ char *dev, /* device name pointer */
+ u_int speed, /* serial port speed (code) */
+ u_int lflags /* line discipline flags */
+ )
+{
+ int fd;
+ int omode;
+#ifdef O_NONBLOCK
+ char trash[128]; /* litter bin for old input data */
+#endif
+
+ /*
+ * Open serial port and set default options
+ */
+ omode = O_RDWR;
+#ifdef O_NONBLOCK
+ omode |= O_NONBLOCK;
+#endif
+#ifdef O_NOCTTY
+ omode |= O_NOCTTY;
+#endif
+
+ fd = open(dev, omode, 0777);
+ /* refclock_open() long returned 0 on failure, avoid it. */
+ if (0 == fd) {
+ fd = dup(0);
+ SAVE_ERRNO(
+ close(0);
+ )
+ }
+ if (fd < 0) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR, "refclock_open %s: %m", dev);
+ )
+ return -1;
+ }
+ if (!refclock_setup(fd, speed, lflags)) {
+ close(fd);
+ return -1;
+ }
+ if (!refclock_ioctl(fd, lflags)) {
+ close(fd);
+ return -1;
+ }
+#ifdef O_NONBLOCK
+ /*
+ * We want to make sure there is no pending trash in the input
+ * buffer. Since we have non-blocking IO available, this is a
+ * good moment to read and dump all available outdated stuff
+ * that might have become toxic for the driver.
+ */
+ while (read(fd, trash, sizeof(trash)) > 0 || errno == EINTR)
+ /*NOP*/;
+#endif
+ return fd;
+}
+
+
+/*
+ * refclock_setup - initialize terminal interface structure
+ */
+int
+refclock_setup(
+ int fd, /* file descriptor */
+ u_int speed, /* serial port speed (code) */
+ u_int lflags /* line discipline flags */
+ )
+{
+ int i;
+ TTY ttyb, *ttyp;
+
+ /*
+ * By default, the serial line port is initialized in canonical
+ * (line-oriented) mode at specified line speed, 8 bits and no
+ * parity. LF ends the line and CR is mapped to LF. The break,
+ * erase and kill functions are disabled. There is a different
+ * section for each terminal interface, as selected at compile
+ * time. The flag bits can be used to set raw mode and echo.
+ */
+ ttyp = &ttyb;
+#ifdef HAVE_TERMIOS
+
+ /*
+ * POSIX serial line parameters (termios interface)
+ */
+ if (tcgetattr(fd, ttyp) < 0) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR,
+ "refclock_setup fd %d tcgetattr: %m",
+ fd);
+ )
+ return FALSE;
+ }
+
+ /*
+ * Set canonical mode and local connection; set specified speed,
+ * 8 bits and no parity; map CR to NL; ignore break.
+ */
+ if (speed) {
+ u_int ltemp = 0;
+
+ ttyp->c_iflag = IGNBRK | IGNPAR | ICRNL;
+ ttyp->c_oflag = 0;
+ ttyp->c_cflag = CS8 | CLOCAL | CREAD;
+ if (lflags & LDISC_7O1) {
+ /* HP Z3801A needs 7-bit, odd parity */
+ ttyp->c_cflag = CS7 | PARENB | PARODD | CLOCAL | CREAD;
+ }
+ cfsetispeed(&ttyb, speed);
+ cfsetospeed(&ttyb, speed);
+ for (i = 0; i < NCCS; ++i)
+ ttyp->c_cc[i] = '\0';
+
+#if defined(TIOCMGET) && !defined(SCO5_CLOCK)
+
+ /*
+ * If we have modem control, check to see if modem leads
+ * are active; if so, set remote connection. This is
+ * necessary for the kernel pps mods to work.
+ */
+ if (ioctl(fd, TIOCMGET, (char *)&ltemp) < 0)
+ msyslog(LOG_ERR,
+ "refclock_setup fd %d TIOCMGET: %m", fd);
+#ifdef DEBUG
+ if (debug)
+ printf("refclock_setup fd %d modem status: 0x%x\n",
+ fd, ltemp);
+#endif
+ if (ltemp & TIOCM_DSR && lflags & LDISC_REMOTE)
+ ttyp->c_cflag &= ~CLOCAL;
+#endif /* TIOCMGET */
+ }
+
+ /*
+ * Set raw and echo modes. These can be changed on-fly.
+ */
+ ttyp->c_lflag = ICANON;
+ if (lflags & LDISC_RAW) {
+ ttyp->c_lflag = 0;
+ ttyp->c_iflag = 0;
+ ttyp->c_cc[VMIN] = 1;
+ }
+ if (lflags & LDISC_ECHO)
+ ttyp->c_lflag |= ECHO;
+ if (tcsetattr(fd, TCSANOW, ttyp) < 0) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR,
+ "refclock_setup fd %d TCSANOW: %m",
+ fd);
+ )
+ return FALSE;
+ }
+
+ /*
+ * flush input and output buffers to discard any outdated stuff
+ * that might have become toxic for the driver. Failing to do so
+ * is logged, but we keep our fingers crossed otherwise.
+ */
+ if (tcflush(fd, TCIOFLUSH) < 0)
+ msyslog(LOG_ERR, "refclock_setup fd %d tcflush(): %m",
+ fd);
+#endif /* HAVE_TERMIOS */
+
+#ifdef HAVE_SYSV_TTYS
+
+ /*
+ * System V serial line parameters (termio interface)
+ *
+ */
+ if (ioctl(fd, TCGETA, ttyp) < 0) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR,
+ "refclock_setup fd %d TCGETA: %m",
+ fd);
+ )
+ return FALSE;
+ }
+
+ /*
+ * Set canonical mode and local connection; set specified speed,
+ * 8 bits and no parity; map CR to NL; ignore break.
+ */
+ if (speed) {
+ u_int ltemp = 0;
+
+ ttyp->c_iflag = IGNBRK | IGNPAR | ICRNL;
+ ttyp->c_oflag = 0;
+ ttyp->c_cflag = speed | CS8 | CLOCAL | CREAD;
+ for (i = 0; i < NCCS; ++i)
+ ttyp->c_cc[i] = '\0';
+
+#if defined(TIOCMGET) && !defined(SCO5_CLOCK)
+
+ /*
+ * If we have modem control, check to see if modem leads
+ * are active; if so, set remote connection. This is
+ * necessary for the kernel pps mods to work.
+ */
+ if (ioctl(fd, TIOCMGET, (char *)&ltemp) < 0)
+ msyslog(LOG_ERR,
+ "refclock_setup fd %d TIOCMGET: %m", fd);
+#ifdef DEBUG
+ if (debug)
+ printf("refclock_setup fd %d modem status: %x\n",
+ fd, ltemp);
+#endif
+ if (ltemp & TIOCM_DSR)
+ ttyp->c_cflag &= ~CLOCAL;
+#endif /* TIOCMGET */
+ }
+
+ /*
+ * Set raw and echo modes. These can be changed on-fly.
+ */
+ ttyp->c_lflag = ICANON;
+ if (lflags & LDISC_RAW) {
+ ttyp->c_lflag = 0;
+ ttyp->c_iflag = 0;
+ ttyp->c_cc[VMIN] = 1;
+ }
+ if (ioctl(fd, TCSETA, ttyp) < 0) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR,
+ "refclock_setup fd %d TCSETA: %m", fd);
+ )
+ return FALSE;
+ }
+#endif /* HAVE_SYSV_TTYS */
+
+#ifdef HAVE_BSD_TTYS
+
+ /*
+ * 4.3bsd serial line parameters (sgttyb interface)
+ */
+ if (ioctl(fd, TIOCGETP, (char *)ttyp) < 0) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR,
+ "refclock_setup fd %d TIOCGETP: %m",
+ fd);
+ )
+ return FALSE;
+ }
+ if (speed)
+ ttyp->sg_ispeed = ttyp->sg_ospeed = speed;
+ ttyp->sg_flags = EVENP | ODDP | CRMOD;
+ if (ioctl(fd, TIOCSETP, (char *)ttyp) < 0) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR, "refclock_setup TIOCSETP: %m");
+ )
+ return FALSE;
+ }
+#endif /* HAVE_BSD_TTYS */
+ return(1);
+}
+#endif /* HAVE_TERMIOS || HAVE_SYSV_TTYS || HAVE_BSD_TTYS */
+
+
+/*
+ * refclock_ioctl - set serial port control functions
+ *
+ * This routine attempts to hide the internal, system-specific details
+ * of serial ports. It can handle POSIX (termios), SYSV (termio) and BSD
+ * (sgtty) interfaces with varying degrees of success. The routine sets
+ * up optional features such as tty_clk. The routine returns TRUE if
+ * successful.
+ */
+int
+refclock_ioctl(
+ int fd, /* file descriptor */
+ u_int lflags /* line discipline flags */
+ )
+{
+ /*
+ * simply return TRUE if no UNIX line discipline is supported
+ */
+ DPRINTF(1, ("refclock_ioctl: fd %d flags 0x%x\n", fd, lflags));
+
+ return TRUE;
+}
+#endif /* !defined(SYS_VXWORKS) && !defined(SYS_WINNT) */
+
+
+/*
+ * refclock_control - set and/or return clock values
+ *
+ * This routine is used mainly for debugging. It returns designated
+ * values from the interface structure that can be displayed using
+ * ntpdc and the clockstat command. It can also be used to initialize
+ * configuration variables, such as fudgetimes, fudgevalues, reference
+ * ID and stratum.
+ */
+void
+refclock_control(
+ sockaddr_u *srcadr,
+ const struct refclockstat *in,
+ struct refclockstat *out
+ )
+{
+ struct peer *peer;
+ struct refclockproc *pp;
+ u_char clktype;
+ int unit;
+
+ /*
+ * Check for valid address and running peer
+ */
+ if (!ISREFCLOCKADR(srcadr))
+ return;
+
+ clktype = (u_char)REFCLOCKTYPE(srcadr);
+ unit = REFCLOCKUNIT(srcadr);
+
+ peer = findexistingpeer(srcadr, NULL, NULL, -1, 0);
+
+ if (NULL == peer)
+ return;
+
+ NTP_INSIST(peer->procptr != NULL);
+ pp = peer->procptr;
+
+ /*
+ * Initialize requested data
+ */
+ if (in != NULL) {
+ if (in->haveflags & CLK_HAVETIME1)
+ pp->fudgetime1 = in->fudgetime1;
+ if (in->haveflags & CLK_HAVETIME2)
+ pp->fudgetime2 = in->fudgetime2;
+ if (in->haveflags & CLK_HAVEVAL1)
+ peer->stratum = pp->stratum = (u_char)in->fudgeval1;
+ if (in->haveflags & CLK_HAVEVAL2)
+ peer->refid = pp->refid = in->fudgeval2;
+ if (in->haveflags & CLK_HAVEFLAG1) {
+ pp->sloppyclockflag &= ~CLK_FLAG1;
+ pp->sloppyclockflag |= in->flags & CLK_FLAG1;
+ }
+ if (in->haveflags & CLK_HAVEFLAG2) {
+ pp->sloppyclockflag &= ~CLK_FLAG2;
+ pp->sloppyclockflag |= in->flags & CLK_FLAG2;
+ }
+ if (in->haveflags & CLK_HAVEFLAG3) {
+ pp->sloppyclockflag &= ~CLK_FLAG3;
+ pp->sloppyclockflag |= in->flags & CLK_FLAG3;
+ }
+ if (in->haveflags & CLK_HAVEFLAG4) {
+ pp->sloppyclockflag &= ~CLK_FLAG4;
+ pp->sloppyclockflag |= in->flags & CLK_FLAG4;
+ }
+ }
+
+ /*
+ * Readback requested data
+ */
+ if (out != NULL) {
+ out->fudgeval1 = pp->stratum;
+ out->fudgeval2 = pp->refid;
+ out->haveflags = CLK_HAVEVAL1 | CLK_HAVEVAL2;
+ out->fudgetime1 = pp->fudgetime1;
+ if (0.0 != out->fudgetime1)
+ out->haveflags |= CLK_HAVETIME1;
+ out->fudgetime2 = pp->fudgetime2;
+ if (0.0 != out->fudgetime2)
+ out->haveflags |= CLK_HAVETIME2;
+ out->flags = (u_char) pp->sloppyclockflag;
+ if (CLK_FLAG1 & out->flags)
+ out->haveflags |= CLK_HAVEFLAG1;
+ if (CLK_FLAG2 & out->flags)
+ out->haveflags |= CLK_HAVEFLAG2;
+ if (CLK_FLAG3 & out->flags)
+ out->haveflags |= CLK_HAVEFLAG3;
+ if (CLK_FLAG4 & out->flags)
+ out->haveflags |= CLK_HAVEFLAG4;
+
+ out->timereset = current_time - pp->timestarted;
+ out->polls = pp->polls;
+ out->noresponse = pp->noreply;
+ out->badformat = pp->badformat;
+ out->baddata = pp->baddata;
+
+ out->lastevent = pp->lastevent;
+ out->currentstatus = pp->currentstatus;
+ out->type = pp->type;
+ out->clockdesc = pp->clockdesc;
+ out->lencode = (u_short)pp->lencode;
+ out->p_lastcode = pp->a_lastcode;
+ }
+
+ /*
+ * Give the stuff to the clock
+ */
+ if (refclock_conf[clktype]->clock_control != noentry)
+ (refclock_conf[clktype]->clock_control)(unit, in, out, peer);
+}
+
+
+/*
+ * refclock_buginfo - return debugging info
+ *
+ * This routine is used mainly for debugging. It returns designated
+ * values from the interface structure that can be displayed using
+ * ntpdc and the clkbug command.
+ */
+void
+refclock_buginfo(
+ sockaddr_u *srcadr, /* clock address */
+ struct refclockbug *bug /* output structure */
+ )
+{
+ struct peer *peer;
+ struct refclockproc *pp;
+ int clktype;
+ int unit;
+ unsigned u;
+
+ /*
+ * Check for valid address and peer structure
+ */
+ if (!ISREFCLOCKADR(srcadr))
+ return;
+
+ clktype = (u_char) REFCLOCKTYPE(srcadr);
+ unit = REFCLOCKUNIT(srcadr);
+
+ peer = findexistingpeer(srcadr, NULL, NULL, -1, 0);
+
+ if (NULL == peer || NULL == peer->procptr)
+ return;
+
+ pp = peer->procptr;
+
+ /*
+ * Copy structure values
+ */
+ bug->nvalues = 8;
+ bug->svalues = 0x0000003f;
+ bug->values[0] = pp->year;
+ bug->values[1] = pp->day;
+ bug->values[2] = pp->hour;
+ bug->values[3] = pp->minute;
+ bug->values[4] = pp->second;
+ bug->values[5] = pp->nsec;
+ bug->values[6] = pp->yearstart;
+ bug->values[7] = pp->coderecv;
+ bug->stimes = 0xfffffffc;
+ bug->times[0] = pp->lastref;
+ bug->times[1] = pp->lastrec;
+ for (u = 2; u < bug->ntimes; u++)
+ DTOLFP(pp->filter[u - 2], &bug->times[u]);
+
+ /*
+ * Give the stuff to the clock
+ */
+ if (refclock_conf[clktype]->clock_buginfo != noentry)
+ (refclock_conf[clktype]->clock_buginfo)(unit, bug, peer);
+}
+
+
+#ifdef HAVE_PPSAPI
+/*
+ * refclock_ppsapi - initialize/update ppsapi
+ *
+ * This routine is called after the fudge command to open the PPSAPI
+ * interface for later parameter setting after the fudge command.
+ */
+int
+refclock_ppsapi(
+ int fddev, /* fd device */
+ struct refclock_atom *ap /* atom structure pointer */
+ )
+{
+ if (ap->handle == 0) {
+ if (time_pps_create(fddev, &ap->handle) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_ppsapi: time_pps_create: %m");
+ return (0);
+ }
+ }
+ return (1);
+}
+
+
+/*
+ * refclock_params - set ppsapi parameters
+ *
+ * This routine is called to set the PPSAPI parameters after the fudge
+ * command.
+ */
+int
+refclock_params(
+ int mode, /* mode bits */
+ struct refclock_atom *ap /* atom structure pointer */
+ )
+{
+ ZERO(ap->pps_params);
+ ap->pps_params.api_version = PPS_API_VERS_1;
+
+ /*
+ * Solaris serial ports provide PPS pulse capture only on the
+ * assert edge. FreeBSD serial ports provide capture on the
+ * clear edge, while FreeBSD parallel ports provide capture
+ * on the assert edge. Your mileage may vary.
+ */
+ if (mode & CLK_FLAG2)
+ ap->pps_params.mode = PPS_TSFMT_TSPEC | PPS_CAPTURECLEAR;
+ else
+ ap->pps_params.mode = PPS_TSFMT_TSPEC | PPS_CAPTUREASSERT;
+ if (time_pps_setparams(ap->handle, &ap->pps_params) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_params: time_pps_setparams: %m");
+ return (0);
+ }
+
+ /*
+ * If flag3 is lit, select the kernel PPS if we can.
+ */
+ if (mode & CLK_FLAG3) {
+ if (time_pps_kcbind(ap->handle, PPS_KC_HARDPPS,
+ ap->pps_params.mode & ~PPS_TSFMT_TSPEC,
+ PPS_TSFMT_TSPEC) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_params: time_pps_kcbind: %m");
+ return (0);
+ }
+ hardpps_enable = 1;
+ }
+ return (1);
+}
+
+
+/*
+ * refclock_pps - called once per second
+ *
+ * This routine is called once per second. It snatches the PPS
+ * timestamp from the kernel and saves the sign-extended fraction in
+ * a circular buffer for processing at the next poll event.
+ */
+int
+refclock_pps(
+ struct peer *peer, /* peer structure pointer */
+ struct refclock_atom *ap, /* atom structure pointer */
+ int mode /* mode bits */
+ )
+{
+ struct refclockproc *pp;
+ pps_info_t pps_info;
+ struct timespec timeout;
+ double dtemp;
+
+ /*
+ * We require the clock to be synchronized before setting the
+ * parameters. When the parameters have been set, fetch the
+ * most recent PPS timestamp.
+ */
+ pp = peer->procptr;
+ if (ap->handle == 0)
+ return (0);
+
+ if (ap->pps_params.mode == 0 && sys_leap != LEAP_NOTINSYNC) {
+ if (refclock_params(pp->sloppyclockflag, ap) < 1)
+ return (0);
+ }
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+ ZERO(pps_info);
+ if (time_pps_fetch(ap->handle, PPS_TSFMT_TSPEC, &pps_info,
+ &timeout) < 0) {
+ refclock_report(peer, CEVNT_FAULT);
+ return (0);
+ }
+ timeout = ap->ts;
+ if (ap->pps_params.mode & PPS_CAPTUREASSERT)
+ ap->ts = pps_info.assert_timestamp;
+ else if (ap->pps_params.mode & PPS_CAPTURECLEAR)
+ ap->ts = pps_info.clear_timestamp;
+ else
+ return (0);
+
+ if (0 == memcmp(&timeout, &ap->ts, sizeof(timeout)))
+ return (0);
+
+ /*
+ * Convert to signed fraction offset and stuff in median filter.
+ */
+ pp->lastrec.l_ui = (u_int32)ap->ts.tv_sec + JAN_1970;
+ dtemp = ap->ts.tv_nsec / 1e9;
+ pp->lastrec.l_uf = (u_int32)(dtemp * FRAC);
+ if (dtemp > .5)
+ dtemp -= 1.;
+ SAMPLE(-dtemp + pp->fudgetime1);
+#ifdef DEBUG
+ if (debug > 1)
+ printf("refclock_pps: %lu %f %f\n", current_time,
+ dtemp, pp->fudgetime1);
+#endif
+ return (1);
+}
+#endif /* HAVE_PPSAPI */
+#endif /* REFCLOCK */
diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c
new file mode 100644
index 0000000..157304b
--- /dev/null
+++ b/ntpd/ntp_request.c
@@ -0,0 +1,2670 @@
+/*
+ * ntp_request.c - respond to information requests
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_request.h"
+#include "ntp_control.h"
+#include "ntp_refclock.h"
+#include "ntp_if.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+
+#include <stdio.h>
+#include <stddef.h>
+#include <signal.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <arpa/inet.h>
+
+#include "recvbuff.h"
+
+#ifdef KERNEL_PLL
+#include "ntp_syscall.h"
+#endif /* KERNEL_PLL */
+
+/*
+ * Structure to hold request procedure information
+ */
+#define NOAUTH 0
+#define AUTH 1
+
+#define NO_REQUEST (-1)
+/*
+ * Because we now have v6 addresses in the messages, we need to compensate
+ * for the larger size. Therefore, we introduce the alternate size to
+ * keep us friendly with older implementations. A little ugly.
+ */
+static int client_v6_capable = 0; /* the client can handle longer messages */
+
+#define v6sizeof(type) (client_v6_capable ? sizeof(type) : v4sizeof(type))
+
+struct req_proc {
+ short request_code; /* defined request code */
+ short needs_auth; /* true when authentication needed */
+ short sizeofitem; /* size of request data item (older size)*/
+ short v6_sizeofitem; /* size of request data item (new size)*/
+ void (*handler) (sockaddr_u *, endpt *,
+ struct req_pkt *); /* routine to handle request */
+};
+
+/*
+ * Universal request codes
+ */
+static const struct req_proc univ_codes[] = {
+ { NO_REQUEST, NOAUTH, 0, 0 }
+};
+
+static void req_ack (sockaddr_u *, endpt *, struct req_pkt *, int);
+static void * prepare_pkt (sockaddr_u *, endpt *,
+ struct req_pkt *, size_t);
+static void * more_pkt (void);
+static void flush_pkt (void);
+static void list_peers (sockaddr_u *, endpt *, struct req_pkt *);
+static void list_peers_sum (sockaddr_u *, endpt *, struct req_pkt *);
+static void peer_info (sockaddr_u *, endpt *, struct req_pkt *);
+static void peer_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void sys_info (sockaddr_u *, endpt *, struct req_pkt *);
+static void sys_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void mem_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void io_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void timer_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void loop_info (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_conf (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_unconf (sockaddr_u *, endpt *, struct req_pkt *);
+static void set_sys_flag (sockaddr_u *, endpt *, struct req_pkt *);
+static void clr_sys_flag (sockaddr_u *, endpt *, struct req_pkt *);
+static void setclr_flags (sockaddr_u *, endpt *, struct req_pkt *, u_long);
+static void list_restrict4 (restrict_u *, struct info_restrict **);
+static void list_restrict6 (restrict_u *, struct info_restrict **);
+static void list_restrict (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_resaddflags (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_ressubflags (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_unrestrict (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_restrict (sockaddr_u *, endpt *, struct req_pkt *, int);
+static void mon_getlist (sockaddr_u *, endpt *, struct req_pkt *);
+static void reset_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void reset_peer (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_key_reread (sockaddr_u *, endpt *, struct req_pkt *);
+static void trust_key (sockaddr_u *, endpt *, struct req_pkt *);
+static void untrust_key (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_trustkey (sockaddr_u *, endpt *, struct req_pkt *, u_long);
+static void get_auth_info (sockaddr_u *, endpt *, struct req_pkt *);
+static void req_get_traps (sockaddr_u *, endpt *, struct req_pkt *);
+static void req_set_trap (sockaddr_u *, endpt *, struct req_pkt *);
+static void req_clr_trap (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_setclr_trap (sockaddr_u *, endpt *, struct req_pkt *, int);
+static void set_request_keyid (sockaddr_u *, endpt *, struct req_pkt *);
+static void set_control_keyid (sockaddr_u *, endpt *, struct req_pkt *);
+static void get_ctl_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void get_if_stats (sockaddr_u *, endpt *, struct req_pkt *);
+static void do_if_reload (sockaddr_u *, endpt *, struct req_pkt *);
+#ifdef KERNEL_PLL
+static void get_kernel_info (sockaddr_u *, endpt *, struct req_pkt *);
+#endif /* KERNEL_PLL */
+#ifdef REFCLOCK
+static void get_clock_info (sockaddr_u *, endpt *, struct req_pkt *);
+static void set_clock_fudge (sockaddr_u *, endpt *, struct req_pkt *);
+#endif /* REFCLOCK */
+#ifdef REFCLOCK
+static void get_clkbug_info (sockaddr_u *, endpt *, struct req_pkt *);
+#endif /* REFCLOCK */
+
+/*
+ * ntpd request codes
+ */
+static const struct req_proc ntp_codes[] = {
+ { REQ_PEER_LIST, NOAUTH, 0, 0, list_peers },
+ { REQ_PEER_LIST_SUM, NOAUTH, 0, 0, list_peers_sum },
+ { REQ_PEER_INFO, NOAUTH, v4sizeof(struct info_peer_list),
+ sizeof(struct info_peer_list), peer_info},
+ { REQ_PEER_STATS, NOAUTH, v4sizeof(struct info_peer_list),
+ sizeof(struct info_peer_list), peer_stats},
+ { REQ_SYS_INFO, NOAUTH, 0, 0, sys_info },
+ { REQ_SYS_STATS, NOAUTH, 0, 0, sys_stats },
+ { REQ_IO_STATS, NOAUTH, 0, 0, io_stats },
+ { REQ_MEM_STATS, NOAUTH, 0, 0, mem_stats },
+ { REQ_LOOP_INFO, NOAUTH, 0, 0, loop_info },
+ { REQ_TIMER_STATS, NOAUTH, 0, 0, timer_stats },
+ { REQ_CONFIG, AUTH, v4sizeof(struct conf_peer),
+ sizeof(struct conf_peer), do_conf },
+ { REQ_UNCONFIG, AUTH, v4sizeof(struct conf_unpeer),
+ sizeof(struct conf_unpeer), do_unconf },
+ { REQ_SET_SYS_FLAG, AUTH, sizeof(struct conf_sys_flags),
+ sizeof(struct conf_sys_flags), set_sys_flag },
+ { REQ_CLR_SYS_FLAG, AUTH, sizeof(struct conf_sys_flags),
+ sizeof(struct conf_sys_flags), clr_sys_flag },
+ { REQ_GET_RESTRICT, NOAUTH, 0, 0, list_restrict },
+ { REQ_RESADDFLAGS, AUTH, v4sizeof(struct conf_restrict),
+ sizeof(struct conf_restrict), do_resaddflags },
+ { REQ_RESSUBFLAGS, AUTH, v4sizeof(struct conf_restrict),
+ sizeof(struct conf_restrict), do_ressubflags },
+ { REQ_UNRESTRICT, AUTH, v4sizeof(struct conf_restrict),
+ sizeof(struct conf_restrict), do_unrestrict },
+ { REQ_MON_GETLIST, NOAUTH, 0, 0, mon_getlist },
+ { REQ_MON_GETLIST_1, NOAUTH, 0, 0, mon_getlist },
+ { REQ_RESET_STATS, AUTH, sizeof(struct reset_flags), 0, reset_stats },
+ { REQ_RESET_PEER, AUTH, v4sizeof(struct conf_unpeer),
+ sizeof(struct conf_unpeer), reset_peer },
+ { REQ_REREAD_KEYS, AUTH, 0, 0, do_key_reread },
+ { REQ_TRUSTKEY, AUTH, sizeof(u_long), sizeof(u_long), trust_key },
+ { REQ_UNTRUSTKEY, AUTH, sizeof(u_long), sizeof(u_long), untrust_key },
+ { REQ_AUTHINFO, NOAUTH, 0, 0, get_auth_info },
+ { REQ_TRAPS, NOAUTH, 0, 0, req_get_traps },
+ { REQ_ADD_TRAP, AUTH, v4sizeof(struct conf_trap),
+ sizeof(struct conf_trap), req_set_trap },
+ { REQ_CLR_TRAP, AUTH, v4sizeof(struct conf_trap),
+ sizeof(struct conf_trap), req_clr_trap },
+ { REQ_REQUEST_KEY, AUTH, sizeof(u_long), sizeof(u_long),
+ set_request_keyid },
+ { REQ_CONTROL_KEY, AUTH, sizeof(u_long), sizeof(u_long),
+ set_control_keyid },
+ { REQ_GET_CTLSTATS, NOAUTH, 0, 0, get_ctl_stats },
+#ifdef KERNEL_PLL
+ { REQ_GET_KERNEL, NOAUTH, 0, 0, get_kernel_info },
+#endif
+#ifdef REFCLOCK
+ { REQ_GET_CLOCKINFO, NOAUTH, sizeof(u_int32), sizeof(u_int32),
+ get_clock_info },
+ { REQ_SET_CLKFUDGE, AUTH, sizeof(struct conf_fudge),
+ sizeof(struct conf_fudge), set_clock_fudge },
+ { REQ_GET_CLKBUGINFO, NOAUTH, sizeof(u_int32), sizeof(u_int32),
+ get_clkbug_info },
+#endif
+ { REQ_IF_STATS, AUTH, 0, 0, get_if_stats },
+ { REQ_IF_RELOAD, AUTH, 0, 0, do_if_reload },
+
+ { NO_REQUEST, NOAUTH, 0, 0, 0 }
+};
+
+
+/*
+ * Authentication keyid used to authenticate requests. Zero means we
+ * don't allow writing anything.
+ */
+keyid_t info_auth_keyid;
+
+/*
+ * Statistic counters to keep track of requests and responses.
+ */
+u_long numrequests; /* number of requests we've received */
+u_long numresppkts; /* number of resp packets sent with data */
+
+/*
+ * lazy way to count errors, indexed by the error code
+ */
+u_long errorcounter[MAX_INFO_ERR + 1];
+
+/*
+ * A hack. To keep the authentication module clear of ntp-ism's, we
+ * include a time reset variable for its stats here.
+ */
+u_long auth_timereset;
+
+/*
+ * Response packet used by these routines. Also some state information
+ * so that we can handle packet formatting within a common set of
+ * subroutines. Note we try to enter data in place whenever possible,
+ * but the need to set the more bit correctly means we occasionally
+ * use the extra buffer and copy.
+ */
+static struct resp_pkt rpkt;
+static int reqver;
+static int seqno;
+static int nitems;
+static int itemsize;
+static int databytes;
+static char exbuf[RESP_DATA_SIZE];
+static int usingexbuf;
+static sockaddr_u *toaddr;
+static endpt *frominter;
+
+/*
+ * init_request - initialize request data
+ */
+void
+init_request (void)
+{
+ int i;
+
+ numrequests = 0;
+ numresppkts = 0;
+ auth_timereset = 0;
+ info_auth_keyid = 0; /* by default, can't do this */
+
+ for (i = 0; i < sizeof(errorcounter)/sizeof(errorcounter[0]); i++)
+ errorcounter[i] = 0;
+}
+
+
+/*
+ * req_ack - acknowledge request with no data
+ */
+static void
+req_ack(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt,
+ int errcode
+ )
+{
+ /*
+ * fill in the fields
+ */
+ rpkt.rm_vn_mode = RM_VN_MODE(RESP_BIT, 0, reqver);
+ rpkt.auth_seq = AUTH_SEQ(0, 0);
+ rpkt.implementation = inpkt->implementation;
+ rpkt.request = inpkt->request;
+ rpkt.err_nitems = ERR_NITEMS(errcode, 0);
+ rpkt.mbz_itemsize = MBZ_ITEMSIZE(0);
+
+ /*
+ * send packet and bump counters
+ */
+ sendpkt(srcadr, inter, -1, (struct pkt *)&rpkt, RESP_HEADER_SIZE);
+ errorcounter[errcode]++;
+}
+
+
+/*
+ * prepare_pkt - prepare response packet for transmission, return pointer
+ * to storage for data item.
+ */
+static void *
+prepare_pkt(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *pkt,
+ size_t structsize
+ )
+{
+ DPRINTF(4, ("request: preparing pkt\n"));
+
+ /*
+ * Fill in the implementation, request and itemsize fields
+ * since these won't change.
+ */
+ rpkt.implementation = pkt->implementation;
+ rpkt.request = pkt->request;
+ rpkt.mbz_itemsize = MBZ_ITEMSIZE(structsize);
+
+ /*
+ * Compute the static data needed to carry on.
+ */
+ toaddr = srcadr;
+ frominter = inter;
+ seqno = 0;
+ nitems = 0;
+ itemsize = structsize;
+ databytes = 0;
+ usingexbuf = 0;
+
+ /*
+ * return the beginning of the packet buffer.
+ */
+ return &rpkt.u;
+}
+
+
+/*
+ * more_pkt - return a data pointer for a new item.
+ */
+static void *
+more_pkt(void)
+{
+ /*
+ * If we were using the extra buffer, send the packet.
+ */
+ if (usingexbuf) {
+ DPRINTF(3, ("request: sending pkt\n"));
+ rpkt.rm_vn_mode = RM_VN_MODE(RESP_BIT, MORE_BIT, reqver);
+ rpkt.auth_seq = AUTH_SEQ(0, seqno);
+ rpkt.err_nitems = htons((u_short)nitems);
+ sendpkt(toaddr, frominter, -1, (struct pkt *)&rpkt,
+ RESP_HEADER_SIZE + databytes);
+ numresppkts++;
+
+ /*
+ * Copy data out of exbuf into the packet.
+ */
+ memcpy(&rpkt.u.data[0], exbuf, (unsigned)itemsize);
+ seqno++;
+ databytes = 0;
+ nitems = 0;
+ usingexbuf = 0;
+ }
+
+ databytes += itemsize;
+ nitems++;
+ if (databytes + itemsize <= RESP_DATA_SIZE) {
+ DPRINTF(4, ("request: giving him more data\n"));
+ /*
+ * More room in packet. Give him the
+ * next address.
+ */
+ return &rpkt.u.data[databytes];
+ } else {
+ /*
+ * No room in packet. Give him the extra
+ * buffer unless this was the last in the sequence.
+ */
+ DPRINTF(4, ("request: into extra buffer\n"));
+ if (seqno == MAXSEQ)
+ return NULL;
+ else {
+ usingexbuf = 1;
+ return exbuf;
+ }
+ }
+}
+
+
+/*
+ * flush_pkt - we're done, return remaining information.
+ */
+static void
+flush_pkt(void)
+{
+ DPRINTF(3, ("request: flushing packet, %d items\n", nitems));
+ /*
+ * Must send the last packet. If nothing in here and nothing
+ * has been sent, send an error saying no data to be found.
+ */
+ if (seqno == 0 && nitems == 0)
+ req_ack(toaddr, frominter, (struct req_pkt *)&rpkt,
+ INFO_ERR_NODATA);
+ else {
+ rpkt.rm_vn_mode = RM_VN_MODE(RESP_BIT, 0, reqver);
+ rpkt.auth_seq = AUTH_SEQ(0, seqno);
+ rpkt.err_nitems = htons((u_short)nitems);
+ sendpkt(toaddr, frominter, -1, (struct pkt *)&rpkt,
+ RESP_HEADER_SIZE+databytes);
+ numresppkts++;
+ }
+}
+
+
+
+/*
+ * Given a buffer, return the packet mode
+ */
+int
+get_packet_mode(struct recvbuf *rbufp)
+{
+ struct req_pkt *inpkt = (struct req_pkt *)&rbufp->recv_pkt;
+ return (INFO_MODE(inpkt->rm_vn_mode));
+}
+
+
+/*
+ * process_private - process private mode (7) packets
+ */
+void
+process_private(
+ struct recvbuf *rbufp,
+ int mod_okay
+ )
+{
+ static u_long quiet_until;
+ struct req_pkt *inpkt;
+ struct req_pkt_tail *tailinpkt;
+ sockaddr_u *srcadr;
+ endpt *inter;
+ const struct req_proc *proc;
+ int ec;
+ short temp_size;
+ l_fp ftmp;
+ double dtemp;
+ size_t recv_len;
+ size_t noslop_len;
+ size_t mac_len;
+
+ /*
+ * Initialize pointers, for convenience
+ */
+ recv_len = rbufp->recv_length;
+ inpkt = (struct req_pkt *)&rbufp->recv_pkt;
+ srcadr = &rbufp->recv_srcadr;
+ inter = rbufp->dstadr;
+
+ DPRINTF(3, ("process_private: impl %d req %d\n",
+ inpkt->implementation, inpkt->request));
+
+ /*
+ * Do some sanity checks on the packet. Return a format
+ * error if it fails.
+ */
+ ec = 0;
+ if ( (++ec, ISRESPONSE(inpkt->rm_vn_mode))
+ || (++ec, ISMORE(inpkt->rm_vn_mode))
+ || (++ec, INFO_VERSION(inpkt->rm_vn_mode) > NTP_VERSION)
+ || (++ec, INFO_VERSION(inpkt->rm_vn_mode) < NTP_OLDVERSION)
+ || (++ec, INFO_SEQ(inpkt->auth_seq) != 0)
+ || (++ec, INFO_ERR(inpkt->err_nitems) != 0)
+ || (++ec, INFO_MBZ(inpkt->mbz_itemsize) != 0)
+ || (++ec, rbufp->recv_length < REQ_LEN_HDR)
+ ) {
+ NLOG(NLOG_SYSEVENT)
+ if (current_time >= quiet_until) {
+ msyslog(LOG_ERR,
+ "process_private: drop test %d"
+ " failed, pkt from %s",
+ ec, stoa(srcadr));
+ quiet_until = current_time + 60;
+ }
+ return;
+ }
+
+ reqver = INFO_VERSION(inpkt->rm_vn_mode);
+
+ /*
+ * Get the appropriate procedure list to search.
+ */
+ if (inpkt->implementation == IMPL_UNIV)
+ proc = univ_codes;
+ else if ((inpkt->implementation == IMPL_XNTPD) ||
+ (inpkt->implementation == IMPL_XNTPD_OLD))
+ proc = ntp_codes;
+ else {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_IMPL);
+ return;
+ }
+
+ /*
+ * Search the list for the request codes. If it isn't one
+ * we know, return an error.
+ */
+ while (proc->request_code != NO_REQUEST) {
+ if (proc->request_code == (short) inpkt->request)
+ break;
+ proc++;
+ }
+ if (proc->request_code == NO_REQUEST) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_REQ);
+ return;
+ }
+
+ DPRINTF(4, ("found request in tables\n"));
+
+ /*
+ * If we need data, check to see if we have some. If we
+ * don't, check to see that there is none (picky, picky).
+ */
+
+ /* This part is a bit tricky, we want to be sure that the size
+ * returned is either the old or the new size. We also can find
+ * out if the client can accept both types of messages this way.
+ *
+ * Handle the exception of REQ_CONFIG. It can have two data sizes.
+ */
+ temp_size = INFO_ITEMSIZE(inpkt->mbz_itemsize);
+ if ((temp_size != proc->sizeofitem &&
+ temp_size != proc->v6_sizeofitem) &&
+ !(inpkt->implementation == IMPL_XNTPD &&
+ inpkt->request == REQ_CONFIG &&
+ temp_size == sizeof(struct old_conf_peer))) {
+ DPRINTF(3, ("process_private: wrong item size, received %d, should be %d or %d\n",
+ temp_size, proc->sizeofitem, proc->v6_sizeofitem));
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+ if ((proc->sizeofitem != 0) &&
+ ((size_t)(temp_size * INFO_NITEMS(inpkt->err_nitems)) >
+ (recv_len - REQ_LEN_HDR))) {
+ DPRINTF(3, ("process_private: not enough data\n"));
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ switch (inpkt->implementation) {
+ case IMPL_XNTPD:
+ client_v6_capable = 1;
+ break;
+ case IMPL_XNTPD_OLD:
+ client_v6_capable = 0;
+ break;
+ default:
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ /*
+ * If we need to authenticate, do so. Note that an
+ * authenticatable packet must include a mac field, must
+ * have used key info_auth_keyid and must have included
+ * a time stamp in the appropriate field. The time stamp
+ * must be within INFO_TS_MAXSKEW of the receive
+ * time stamp.
+ */
+ if (proc->needs_auth && sys_authenticate) {
+
+ if (recv_len < (REQ_LEN_HDR +
+ (INFO_ITEMSIZE(inpkt->mbz_itemsize) *
+ INFO_NITEMS(inpkt->err_nitems)) +
+ REQ_TAIL_MIN)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ /*
+ * For 16-octet digests, regardless of itemsize and
+ * nitems, authenticated requests are a fixed size
+ * with the timestamp, key ID, and digest located
+ * at the end of the packet. Because the key ID
+ * determining the digest size precedes the digest,
+ * for larger digests the fixed size request scheme
+ * is abandoned and the timestamp, key ID, and digest
+ * are located relative to the start of the packet,
+ * with the digest size determined by the packet size.
+ */
+ noslop_len = REQ_LEN_HDR
+ + INFO_ITEMSIZE(inpkt->mbz_itemsize) *
+ INFO_NITEMS(inpkt->err_nitems)
+ + sizeof(inpkt->tstamp);
+ /* 32-bit alignment */
+ noslop_len = (noslop_len + 3) & ~3;
+ if (recv_len > (noslop_len + MAX_MAC_LEN))
+ mac_len = 20;
+ else
+ mac_len = recv_len - noslop_len;
+
+ tailinpkt = (void *)((char *)inpkt + recv_len -
+ (mac_len + sizeof(inpkt->tstamp)));
+
+ /*
+ * If this guy is restricted from doing this, don't let
+ * him. If the wrong key was used, or packet doesn't
+ * have mac, return.
+ */
+ if (!INFO_IS_AUTH(inpkt->auth_seq) || !info_auth_keyid
+ || ntohl(tailinpkt->keyid) != info_auth_keyid) {
+ DPRINTF(5, ("failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n",
+ INFO_IS_AUTH(inpkt->auth_seq),
+ info_auth_keyid,
+ ntohl(tailinpkt->keyid), (u_long)mac_len));
+#ifdef DEBUG
+ msyslog(LOG_DEBUG,
+ "process_private: failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n",
+ INFO_IS_AUTH(inpkt->auth_seq),
+ info_auth_keyid,
+ ntohl(tailinpkt->keyid), (u_long)mac_len);
+#endif
+ req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
+ return;
+ }
+ if (recv_len > REQ_LEN_NOMAC + MAX_MAC_LEN) {
+ DPRINTF(5, ("bad pkt length %lu\n",
+ (u_long)recv_len));
+ msyslog(LOG_ERR,
+ "process_private: bad pkt length %lu",
+ (u_long)recv_len);
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+ if (!mod_okay || !authhavekey(info_auth_keyid)) {
+ DPRINTF(5, ("failed auth mod_okay %d\n",
+ mod_okay));
+#ifdef DEBUG
+ msyslog(LOG_DEBUG,
+ "process_private: failed auth mod_okay %d\n",
+ mod_okay);
+#endif
+ if (!mod_okay) {
+ sys_restricted++;
+ }
+ req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
+ return;
+ }
+
+ /*
+ * calculate absolute time difference between xmit time stamp
+ * and receive time stamp. If too large, too bad.
+ */
+ NTOHL_FP(&tailinpkt->tstamp, &ftmp);
+ L_SUB(&ftmp, &rbufp->recv_time);
+ LFPTOD(&ftmp, dtemp);
+ if (fabs(dtemp) > INFO_TS_MAXSKEW) {
+ /*
+ * He's a loser. Tell him.
+ */
+ DPRINTF(5, ("xmit/rcv timestamp delta %g > INFO_TS_MAXSKEW %g\n",
+ dtemp, INFO_TS_MAXSKEW));
+ req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
+ return;
+ }
+
+ /*
+ * So far so good. See if decryption works out okay.
+ */
+ if (!authdecrypt(info_auth_keyid, (u_int32 *)inpkt,
+ recv_len - mac_len, mac_len)) {
+ DPRINTF(5, ("authdecrypt failed\n"));
+ req_ack(srcadr, inter, inpkt, INFO_ERR_AUTH);
+ return;
+ }
+ }
+
+ DPRINTF(3, ("process_private: all okay, into handler\n"));
+ /*
+ * Packet is okay. Call the handler to send him data.
+ */
+ (proc->handler)(srcadr, inter, inpkt);
+}
+
+
+/*
+ * list_peers - send a list of the peers
+ */
+static void
+list_peers(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct info_peer_list *ip;
+ struct peer *pp;
+ int skip = 0;
+
+ ip = (struct info_peer_list *)prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_peer_list));
+ for (pp = peer_list; pp != NULL && ip != NULL; pp = pp->p_link) {
+ if (IS_IPV6(&pp->srcadr)) {
+ if (client_v6_capable) {
+ ip->addr6 = SOCK_ADDR6(&pp->srcadr);
+ ip->v6_flag = 1;
+ skip = 0;
+ } else {
+ skip = 1;
+ break;
+ }
+ } else {
+ ip->addr = NSRCADR(&pp->srcadr);
+ if (client_v6_capable)
+ ip->v6_flag = 0;
+ skip = 0;
+ }
+
+ if (!skip) {
+ ip->port = NSRCPORT(&pp->srcadr);
+ ip->hmode = pp->hmode;
+ ip->flags = 0;
+ if (pp->flags & FLAG_CONFIG)
+ ip->flags |= INFO_FLAG_CONFIG;
+ if (pp == sys_peer)
+ ip->flags |= INFO_FLAG_SYSPEER;
+ if (pp->status == CTL_PST_SEL_SYNCCAND)
+ ip->flags |= INFO_FLAG_SEL_CANDIDATE;
+ if (pp->status >= CTL_PST_SEL_SYSPEER)
+ ip->flags |= INFO_FLAG_SHORTLIST;
+ ip = (struct info_peer_list *)more_pkt();
+ }
+ } /* for pp */
+
+ flush_pkt();
+}
+
+
+/*
+ * list_peers_sum - return extended peer list
+ */
+static void
+list_peers_sum(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_peer_summary *ips;
+ register struct peer *pp;
+ l_fp ltmp;
+ register int skip;
+
+ DPRINTF(3, ("wants peer list summary\n"));
+
+ ips = (struct info_peer_summary *)prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_peer_summary));
+ for (pp = peer_list; pp != NULL && ips != NULL; pp = pp->p_link) {
+ DPRINTF(4, ("sum: got one\n"));
+ /*
+ * Be careful here not to return v6 peers when we
+ * want only v4.
+ */
+ if (IS_IPV6(&pp->srcadr)) {
+ if (client_v6_capable) {
+ ips->srcadr6 = SOCK_ADDR6(&pp->srcadr);
+ ips->v6_flag = 1;
+ if (pp->dstadr)
+ ips->dstadr6 = SOCK_ADDR6(&pp->dstadr->sin);
+ else
+ ZERO(ips->dstadr6);
+ skip = 0;
+ } else {
+ skip = 1;
+ break;
+ }
+ } else {
+ ips->srcadr = NSRCADR(&pp->srcadr);
+ if (client_v6_capable)
+ ips->v6_flag = 0;
+
+ if (pp->dstadr) {
+ if (!pp->processed)
+ ips->dstadr = NSRCADR(&pp->dstadr->sin);
+ else {
+ if (MDF_BCAST == pp->cast_flags)
+ ips->dstadr = NSRCADR(&pp->dstadr->bcast);
+ else if (pp->cast_flags) {
+ ips->dstadr = NSRCADR(&pp->dstadr->sin);
+ if (!ips->dstadr)
+ ips->dstadr = NSRCADR(&pp->dstadr->bcast);
+ }
+ }
+ } else
+ ips->dstadr = 0;
+
+ skip = 0;
+ }
+
+ if (!skip) {
+ ips->srcport = NSRCPORT(&pp->srcadr);
+ ips->stratum = pp->stratum;
+ ips->hpoll = pp->hpoll;
+ ips->ppoll = pp->ppoll;
+ ips->reach = pp->reach;
+ ips->flags = 0;
+ if (pp == sys_peer)
+ ips->flags |= INFO_FLAG_SYSPEER;
+ if (pp->flags & FLAG_CONFIG)
+ ips->flags |= INFO_FLAG_CONFIG;
+ if (pp->flags & FLAG_REFCLOCK)
+ ips->flags |= INFO_FLAG_REFCLOCK;
+ if (pp->flags & FLAG_PREFER)
+ ips->flags |= INFO_FLAG_PREFER;
+ if (pp->flags & FLAG_BURST)
+ ips->flags |= INFO_FLAG_BURST;
+ if (pp->status == CTL_PST_SEL_SYNCCAND)
+ ips->flags |= INFO_FLAG_SEL_CANDIDATE;
+ if (pp->status >= CTL_PST_SEL_SYSPEER)
+ ips->flags |= INFO_FLAG_SHORTLIST;
+ ips->hmode = pp->hmode;
+ ips->delay = HTONS_FP(DTOFP(pp->delay));
+ DTOLFP(pp->offset, &ltmp);
+ HTONL_FP(&ltmp, &ips->offset);
+ ips->dispersion = HTONS_FP(DTOUFP(SQRT(pp->disp)));
+ }
+ ips = (struct info_peer_summary *)more_pkt();
+ } /* for pp */
+
+ flush_pkt();
+}
+
+
+/*
+ * peer_info - send information for one or more peers
+ */
+static void
+peer_info (
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ u_short items;
+ size_t item_sz;
+ char * datap;
+ struct info_peer_list ipl;
+ struct peer * pp;
+ struct info_peer * ip;
+ int i;
+ int j;
+ sockaddr_u addr;
+ l_fp ltmp;
+
+ items = INFO_NITEMS(inpkt->err_nitems);
+ item_sz = INFO_ITEMSIZE(inpkt->mbz_itemsize);
+ datap = inpkt->u.data;
+ if (item_sz != sizeof(ipl)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+ ip = prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_peer));
+ while (items-- > 0 && ip != NULL) {
+ ZERO(ipl);
+ memcpy(&ipl, datap, item_sz);
+ ZERO_SOCK(&addr);
+ NSRCPORT(&addr) = ipl.port;
+ if (client_v6_capable && ipl.v6_flag) {
+ AF(&addr) = AF_INET6;
+ SOCK_ADDR6(&addr) = ipl.addr6;
+ } else {
+ AF(&addr) = AF_INET;
+ NSRCADR(&addr) = ipl.addr;
+ }
+#ifdef ISC_PLATFORM_HAVESALEN
+ addr.sa.sa_len = SOCKLEN(&addr);
+#endif
+ datap += item_sz;
+
+ pp = findexistingpeer(&addr, NULL, NULL, -1, 0);
+ if (NULL == pp)
+ continue;
+ if (IS_IPV6(srcadr)) {
+ if (pp->dstadr)
+ ip->dstadr6 =
+ (MDF_BCAST == pp->cast_flags)
+ ? SOCK_ADDR6(&pp->dstadr->bcast)
+ : SOCK_ADDR6(&pp->dstadr->sin);
+ else
+ ZERO(ip->dstadr6);
+
+ ip->srcadr6 = SOCK_ADDR6(&pp->srcadr);
+ ip->v6_flag = 1;
+ } else {
+ if (pp->dstadr) {
+ if (!pp->processed)
+ ip->dstadr = NSRCADR(&pp->dstadr->sin);
+ else {
+ if (MDF_BCAST == pp->cast_flags)
+ ip->dstadr = NSRCADR(&pp->dstadr->bcast);
+ else if (pp->cast_flags) {
+ ip->dstadr = NSRCADR(&pp->dstadr->sin);
+ if (!ip->dstadr)
+ ip->dstadr = NSRCADR(&pp->dstadr->bcast);
+ }
+ }
+ } else
+ ip->dstadr = 0;
+
+ ip->srcadr = NSRCADR(&pp->srcadr);
+ if (client_v6_capable)
+ ip->v6_flag = 0;
+ }
+ ip->srcport = NSRCPORT(&pp->srcadr);
+ ip->flags = 0;
+ if (pp == sys_peer)
+ ip->flags |= INFO_FLAG_SYSPEER;
+ if (pp->flags & FLAG_CONFIG)
+ ip->flags |= INFO_FLAG_CONFIG;
+ if (pp->flags & FLAG_REFCLOCK)
+ ip->flags |= INFO_FLAG_REFCLOCK;
+ if (pp->flags & FLAG_PREFER)
+ ip->flags |= INFO_FLAG_PREFER;
+ if (pp->flags & FLAG_BURST)
+ ip->flags |= INFO_FLAG_BURST;
+ if (pp->status == CTL_PST_SEL_SYNCCAND)
+ ip->flags |= INFO_FLAG_SEL_CANDIDATE;
+ if (pp->status >= CTL_PST_SEL_SYSPEER)
+ ip->flags |= INFO_FLAG_SHORTLIST;
+ ip->leap = pp->leap;
+ ip->hmode = pp->hmode;
+ ip->keyid = pp->keyid;
+ ip->stratum = pp->stratum;
+ ip->ppoll = pp->ppoll;
+ ip->hpoll = pp->hpoll;
+ ip->precision = pp->precision;
+ ip->version = pp->version;
+ ip->reach = pp->reach;
+ ip->unreach = (u_char)pp->unreach;
+ ip->flash = (u_char)pp->flash;
+ ip->flash2 = (u_short)pp->flash;
+ ip->estbdelay = HTONS_FP(DTOFP(pp->delay));
+ ip->ttl = (u_char)pp->ttl;
+ ip->associd = htons(pp->associd);
+ ip->rootdelay = HTONS_FP(DTOUFP(pp->rootdelay));
+ ip->rootdispersion = HTONS_FP(DTOUFP(pp->rootdisp));
+ ip->refid = pp->refid;
+ HTONL_FP(&pp->reftime, &ip->reftime);
+ HTONL_FP(&pp->aorg, &ip->org);
+ HTONL_FP(&pp->rec, &ip->rec);
+ HTONL_FP(&pp->xmt, &ip->xmt);
+ j = pp->filter_nextpt - 1;
+ for (i = 0; i < NTP_SHIFT; i++, j--) {
+ if (j < 0)
+ j = NTP_SHIFT-1;
+ ip->filtdelay[i] = HTONS_FP(DTOFP(pp->filter_delay[j]));
+ DTOLFP(pp->filter_offset[j], &ltmp);
+ HTONL_FP(&ltmp, &ip->filtoffset[i]);
+ ip->order[i] = (u_char)((pp->filter_nextpt +
+ NTP_SHIFT - 1) -
+ pp->filter_order[i]);
+ if (ip->order[i] >= NTP_SHIFT)
+ ip->order[i] -= NTP_SHIFT;
+ }
+ DTOLFP(pp->offset, &ltmp);
+ HTONL_FP(&ltmp, &ip->offset);
+ ip->delay = HTONS_FP(DTOFP(pp->delay));
+ ip->dispersion = HTONS_FP(DTOUFP(SQRT(pp->disp)));
+ ip->selectdisp = HTONS_FP(DTOUFP(SQRT(pp->jitter)));
+ ip = more_pkt();
+ }
+ flush_pkt();
+}
+
+
+/*
+ * peer_stats - send statistics for one or more peers
+ */
+static void
+peer_stats (
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ u_short items;
+ size_t item_sz;
+ char * datap;
+ struct info_peer_list ipl;
+ struct peer * pp;
+ struct info_peer_stats *ip;
+ sockaddr_u addr;
+
+ DPRINTF(1, ("peer_stats: called\n"));
+ items = INFO_NITEMS(inpkt->err_nitems);
+ item_sz = INFO_ITEMSIZE(inpkt->mbz_itemsize);
+ datap = inpkt->u.data;
+ if (item_sz > sizeof(ipl)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+ ip = prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_peer_stats));
+ while (items-- > 0 && ip != NULL) {
+ ZERO(ipl);
+ memcpy(&ipl, datap, item_sz);
+ ZERO(addr);
+ NSRCPORT(&addr) = ipl.port;
+ if (client_v6_capable && ipl.v6_flag) {
+ AF(&addr) = AF_INET6;
+ SOCK_ADDR6(&addr) = ipl.addr6;
+ } else {
+ AF(&addr) = AF_INET;
+ NSRCADR(&addr) = ipl.addr;
+ }
+#ifdef ISC_PLATFORM_HAVESALEN
+ addr.sa.sa_len = SOCKLEN(&addr);
+#endif
+ DPRINTF(1, ("peer_stats: looking for %s, %d, %d\n",
+ stoa(&addr), ipl.port, NSRCPORT(&addr)));
+
+ datap += item_sz;
+
+ pp = findexistingpeer(&addr, NULL, NULL, -1, 0);
+ if (NULL == pp)
+ continue;
+
+ DPRINTF(1, ("peer_stats: found %s\n", stoa(&addr)));
+
+ if (IS_IPV4(&pp->srcadr)) {
+ if (pp->dstadr) {
+ if (!pp->processed)
+ ip->dstadr = NSRCADR(&pp->dstadr->sin);
+ else {
+ if (MDF_BCAST == pp->cast_flags)
+ ip->dstadr = NSRCADR(&pp->dstadr->bcast);
+ else if (pp->cast_flags) {
+ ip->dstadr = NSRCADR(&pp->dstadr->sin);
+ if (!ip->dstadr)
+ ip->dstadr = NSRCADR(&pp->dstadr->bcast);
+ }
+ }
+ } else
+ ip->dstadr = 0;
+
+ ip->srcadr = NSRCADR(&pp->srcadr);
+ if (client_v6_capable)
+ ip->v6_flag = 0;
+ } else {
+ if (pp->dstadr)
+ ip->dstadr6 =
+ (MDF_BCAST == pp->cast_flags)
+ ? SOCK_ADDR6(&pp->dstadr->bcast)
+ : SOCK_ADDR6(&pp->dstadr->sin);
+ else
+ ZERO(ip->dstadr6);
+
+ ip->srcadr6 = SOCK_ADDR6(&pp->srcadr);
+ ip->v6_flag = 1;
+ }
+ ip->srcport = NSRCPORT(&pp->srcadr);
+ ip->flags = 0;
+ if (pp == sys_peer)
+ ip->flags |= INFO_FLAG_SYSPEER;
+ if (pp->flags & FLAG_CONFIG)
+ ip->flags |= INFO_FLAG_CONFIG;
+ if (pp->flags & FLAG_REFCLOCK)
+ ip->flags |= INFO_FLAG_REFCLOCK;
+ if (pp->flags & FLAG_PREFER)
+ ip->flags |= INFO_FLAG_PREFER;
+ if (pp->flags & FLAG_BURST)
+ ip->flags |= INFO_FLAG_BURST;
+ if (pp->flags & FLAG_IBURST)
+ ip->flags |= INFO_FLAG_IBURST;
+ if (pp->status == CTL_PST_SEL_SYNCCAND)
+ ip->flags |= INFO_FLAG_SEL_CANDIDATE;
+ if (pp->status >= CTL_PST_SEL_SYSPEER)
+ ip->flags |= INFO_FLAG_SHORTLIST;
+ ip->flags = htons(ip->flags);
+ ip->timereceived = htonl((u_int32)(current_time - pp->timereceived));
+ ip->timetosend = htonl(pp->nextdate - current_time);
+ ip->timereachable = htonl((u_int32)(current_time - pp->timereachable));
+ ip->sent = htonl((u_int32)(pp->sent));
+ ip->processed = htonl((u_int32)(pp->processed));
+ ip->badauth = htonl((u_int32)(pp->badauth));
+ ip->bogusorg = htonl((u_int32)(pp->bogusorg));
+ ip->oldpkt = htonl((u_int32)(pp->oldpkt));
+ ip->seldisp = htonl((u_int32)(pp->seldisptoolarge));
+ ip->selbroken = htonl((u_int32)(pp->selbroken));
+ ip->candidate = pp->status;
+ ip = (struct info_peer_stats *)more_pkt();
+ }
+ flush_pkt();
+}
+
+
+/*
+ * sys_info - return system info
+ */
+static void
+sys_info(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_sys *is;
+
+ is = (struct info_sys *)prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_sys));
+
+ if (sys_peer) {
+ if (IS_IPV4(&sys_peer->srcadr)) {
+ is->peer = NSRCADR(&sys_peer->srcadr);
+ if (client_v6_capable)
+ is->v6_flag = 0;
+ } else if (client_v6_capable) {
+ is->peer6 = SOCK_ADDR6(&sys_peer->srcadr);
+ is->v6_flag = 1;
+ }
+ is->peer_mode = sys_peer->hmode;
+ } else {
+ is->peer = 0;
+ if (client_v6_capable) {
+ is->v6_flag = 0;
+ }
+ is->peer_mode = 0;
+ }
+
+ is->leap = sys_leap;
+ is->stratum = sys_stratum;
+ is->precision = sys_precision;
+ is->rootdelay = htonl(DTOFP(sys_rootdelay));
+ is->rootdispersion = htonl(DTOUFP(sys_rootdisp));
+ is->frequency = htonl(DTOFP(sys_jitter));
+ is->stability = htonl(DTOUFP(clock_stability * 1e6));
+ is->refid = sys_refid;
+ HTONL_FP(&sys_reftime, &is->reftime);
+
+ is->poll = sys_poll;
+
+ is->flags = 0;
+ if (sys_authenticate)
+ is->flags |= INFO_FLAG_AUTHENTICATE;
+ if (sys_bclient)
+ is->flags |= INFO_FLAG_BCLIENT;
+#ifdef REFCLOCK
+ if (cal_enable)
+ is->flags |= INFO_FLAG_CAL;
+#endif /* REFCLOCK */
+ if (kern_enable)
+ is->flags |= INFO_FLAG_KERNEL;
+ if (mon_enabled != MON_OFF)
+ is->flags |= INFO_FLAG_MONITOR;
+ if (ntp_enable)
+ is->flags |= INFO_FLAG_NTP;
+ if (hardpps_enable)
+ is->flags |= INFO_FLAG_PPS_SYNC;
+ if (stats_control)
+ is->flags |= INFO_FLAG_FILEGEN;
+ is->bdelay = HTONS_FP(DTOFP(sys_bdelay));
+ HTONL_UF(sys_authdelay.l_uf, &is->authdelay);
+ (void) more_pkt();
+ flush_pkt();
+}
+
+
+/*
+ * sys_stats - return system statistics
+ */
+static void
+sys_stats(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_sys_stats *ss;
+
+ ss = (struct info_sys_stats *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_sys_stats));
+ ss->timeup = htonl((u_int32)current_time);
+ ss->timereset = htonl((u_int32)(current_time - sys_stattime));
+ ss->denied = htonl((u_int32)sys_restricted);
+ ss->oldversionpkt = htonl((u_int32)sys_oldversion);
+ ss->newversionpkt = htonl((u_int32)sys_newversion);
+ ss->unknownversion = htonl((u_int32)sys_declined);
+ ss->badlength = htonl((u_int32)sys_badlength);
+ ss->processed = htonl((u_int32)sys_processed);
+ ss->badauth = htonl((u_int32)sys_badauth);
+ ss->limitrejected = htonl((u_int32)sys_limitrejected);
+ ss->received = htonl((u_int32)sys_received);
+ (void) more_pkt();
+ flush_pkt();
+}
+
+
+/*
+ * mem_stats - return memory statistics
+ */
+static void
+mem_stats(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_mem_stats *ms;
+ register int i;
+
+ ms = (struct info_mem_stats *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_mem_stats));
+
+ ms->timereset = htonl((u_int32)(current_time - peer_timereset));
+ ms->totalpeermem = htons((u_short)total_peer_structs);
+ ms->freepeermem = htons((u_short)peer_free_count);
+ ms->findpeer_calls = htonl((u_int32)findpeer_calls);
+ ms->allocations = htonl((u_int32)peer_allocations);
+ ms->demobilizations = htonl((u_int32)peer_demobilizations);
+
+ for (i = 0; i < NTP_HASH_SIZE; i++)
+ ms->hashcount[i] = (u_char)
+ max((u_int)peer_hash_count[i], UCHAR_MAX);
+
+ more_pkt();
+ flush_pkt();
+}
+
+
+/*
+ * io_stats - return io statistics
+ */
+static void
+io_stats(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct info_io_stats *io;
+
+ io = (struct info_io_stats *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_io_stats));
+
+ io->timereset = htonl((u_int32)(current_time - io_timereset));
+ io->totalrecvbufs = htons((u_short) total_recvbuffs());
+ io->freerecvbufs = htons((u_short) free_recvbuffs());
+ io->fullrecvbufs = htons((u_short) full_recvbuffs());
+ io->lowwater = htons((u_short) lowater_additions());
+ io->dropped = htonl((u_int32)packets_dropped);
+ io->ignored = htonl((u_int32)packets_ignored);
+ io->received = htonl((u_int32)packets_received);
+ io->sent = htonl((u_int32)packets_sent);
+ io->notsent = htonl((u_int32)packets_notsent);
+ io->interrupts = htonl((u_int32)handler_calls);
+ io->int_received = htonl((u_int32)handler_pkts);
+
+ (void) more_pkt();
+ flush_pkt();
+}
+
+
+/*
+ * timer_stats - return timer statistics
+ */
+static void
+timer_stats(
+ sockaddr_u * srcadr,
+ endpt * inter,
+ struct req_pkt * inpkt
+ )
+{
+ struct info_timer_stats * ts;
+ u_long sincereset;
+
+ ts = (struct info_timer_stats *)prepare_pkt(srcadr, inter,
+ inpkt, sizeof(*ts));
+
+ sincereset = current_time - timer_timereset;
+ ts->timereset = htonl((u_int32)sincereset);
+ ts->alarms = ts->timereset;
+ ts->overflows = htonl((u_int32)alarm_overflow);
+ ts->xmtcalls = htonl((u_int32)timer_xmtcalls);
+
+ (void) more_pkt();
+ flush_pkt();
+}
+
+
+/*
+ * loop_info - return the current state of the loop filter
+ */
+static void
+loop_info(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct info_loop *li;
+ l_fp ltmp;
+
+ li = (struct info_loop *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_loop));
+
+ DTOLFP(last_offset, &ltmp);
+ HTONL_FP(&ltmp, &li->last_offset);
+ DTOLFP(drift_comp * 1e6, &ltmp);
+ HTONL_FP(&ltmp, &li->drift_comp);
+ li->compliance = htonl((u_int32)(tc_counter));
+ li->watchdog_timer = htonl((u_int32)(current_time - sys_epoch));
+
+ more_pkt();
+ flush_pkt();
+}
+
+
+/*
+ * do_conf - add a peer to the configuration list
+ */
+static void
+do_conf(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ u_short items;
+ size_t item_sz;
+ u_int fl;
+ char * datap;
+ struct conf_peer temp_cp;
+ sockaddr_u peeraddr;
+
+ /*
+ * Do a check of everything to see that it looks
+ * okay. If not, complain about it. Note we are
+ * very picky here.
+ */
+ items = INFO_NITEMS(inpkt->err_nitems);
+ item_sz = INFO_ITEMSIZE(inpkt->mbz_itemsize);
+ datap = inpkt->u.data;
+ if (item_sz > sizeof(temp_cp)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ while (items-- > 0) {
+ ZERO(temp_cp);
+ memcpy(&temp_cp, datap, item_sz);
+ ZERO_SOCK(&peeraddr);
+
+ fl = 0;
+ if (temp_cp.flags & CONF_FLAG_PREFER)
+ fl |= FLAG_PREFER;
+ if (temp_cp.flags & CONF_FLAG_BURST)
+ fl |= FLAG_BURST;
+ if (temp_cp.flags & CONF_FLAG_IBURST)
+ fl |= FLAG_IBURST;
+#ifdef AUTOKEY
+ if (temp_cp.flags & CONF_FLAG_SKEY)
+ fl |= FLAG_SKEY;
+#endif /* AUTOKEY */
+ if (client_v6_capable && temp_cp.v6_flag) {
+ AF(&peeraddr) = AF_INET6;
+ SOCK_ADDR6(&peeraddr) = temp_cp.peeraddr6;
+ } else {
+ AF(&peeraddr) = AF_INET;
+ NSRCADR(&peeraddr) = temp_cp.peeraddr;
+ /*
+ * Make sure the address is valid
+ */
+ if (!ISREFCLOCKADR(&peeraddr) &&
+ ISBADADR(&peeraddr)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ }
+ NSRCPORT(&peeraddr) = htons(NTP_PORT);
+#ifdef ISC_PLATFORM_HAVESALEN
+ peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
+#endif
+
+ /* XXX W2DO? minpoll/maxpoll arguments ??? */
+ if (peer_config(&peeraddr, NULL, NULL,
+ temp_cp.hmode, temp_cp.version, temp_cp.minpoll,
+ temp_cp.maxpoll, fl, temp_cp.ttl, temp_cp.keyid,
+ NULL) == 0) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ datap += item_sz;
+ }
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+/*
+ * do_unconf - remove a peer from the configuration list
+ */
+static void
+do_unconf(
+ sockaddr_u * srcadr,
+ endpt * inter,
+ struct req_pkt *inpkt
+ )
+{
+ u_short items;
+ size_t item_sz;
+ char * datap;
+ struct conf_unpeer temp_cp;
+ struct peer * p;
+ sockaddr_u peeraddr;
+ int bad;
+ int found;
+
+ /*
+ * This is a bit unstructured, but I like to be careful.
+ * We check to see that every peer exists and is actually
+ * configured. If so, we remove them. If not, we return
+ * an error.
+ */
+ items = INFO_NITEMS(inpkt->err_nitems);
+ item_sz = INFO_ITEMSIZE(inpkt->mbz_itemsize);
+ datap = inpkt->u.data;
+ if (item_sz > sizeof(temp_cp)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ bad = FALSE;
+ while (items-- > 0 && !bad) {
+ ZERO(temp_cp);
+ memcpy(&temp_cp, datap, item_sz);
+ ZERO_SOCK(&peeraddr);
+ if (client_v6_capable && temp_cp.v6_flag) {
+ AF(&peeraddr) = AF_INET6;
+ SOCK_ADDR6(&peeraddr) = temp_cp.peeraddr6;
+ } else {
+ AF(&peeraddr) = AF_INET;
+ NSRCADR(&peeraddr) = temp_cp.peeraddr;
+ }
+ SET_PORT(&peeraddr, NTP_PORT);
+#ifdef ISC_PLATFORM_HAVESALEN
+ peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
+#endif
+ found = FALSE;
+ p = NULL;
+
+ DPRINTF(1, ("searching for %s\n", stoa(&peeraddr)));
+
+ while (!found) {
+ p = findexistingpeer(&peeraddr, NULL, p, -1, 0);
+ if (NULL == p)
+ break;
+ if (FLAG_CONFIG & p->flags)
+ found = TRUE;
+ }
+ if (!found)
+ bad = TRUE;
+
+ datap += item_sz;
+ }
+
+ if (bad) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ /*
+ * Now do it in earnest.
+ */
+
+ items = INFO_NITEMS(inpkt->err_nitems);
+ datap = inpkt->u.data;
+
+ while (items-- > 0) {
+ ZERO(temp_cp);
+ memcpy(&temp_cp, datap, item_sz);
+ ZERO(peeraddr);
+ if (client_v6_capable && temp_cp.v6_flag) {
+ AF(&peeraddr) = AF_INET6;
+ SOCK_ADDR6(&peeraddr) = temp_cp.peeraddr6;
+ } else {
+ AF(&peeraddr) = AF_INET;
+ NSRCADR(&peeraddr) = temp_cp.peeraddr;
+ }
+ SET_PORT(&peeraddr, NTP_PORT);
+#ifdef ISC_PLATFORM_HAVESALEN
+ peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
+#endif
+ found = FALSE;
+ p = NULL;
+
+ while (!found) {
+ p = findexistingpeer(&peeraddr, NULL, p, -1, 0);
+ if (NULL == p)
+ break;
+ if (FLAG_CONFIG & p->flags)
+ found = TRUE;
+ }
+ INSIST(found);
+ INSIST(NULL != p);
+
+ peer_clear(p, "GONE");
+ unpeer(p);
+
+ datap += item_sz;
+ }
+
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+/*
+ * set_sys_flag - set system flags
+ */
+static void
+set_sys_flag(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ setclr_flags(srcadr, inter, inpkt, 1);
+}
+
+
+/*
+ * clr_sys_flag - clear system flags
+ */
+static void
+clr_sys_flag(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ setclr_flags(srcadr, inter, inpkt, 0);
+}
+
+
+/*
+ * setclr_flags - do the grunge work of flag setting/clearing
+ */
+static void
+setclr_flags(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt,
+ u_long set
+ )
+{
+ struct conf_sys_flags *sf;
+ u_int32 flags;
+
+ if (INFO_NITEMS(inpkt->err_nitems) > 1) {
+ msyslog(LOG_ERR, "setclr_flags: err_nitems > 1");
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ sf = (struct conf_sys_flags *)&inpkt->u;
+ flags = ntohl(sf->flags);
+
+ if (flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_PPS |
+ SYS_FLAG_NTP | SYS_FLAG_KERNEL | SYS_FLAG_MONITOR |
+ SYS_FLAG_FILEGEN | SYS_FLAG_AUTH | SYS_FLAG_CAL)) {
+ msyslog(LOG_ERR, "setclr_flags: extra flags: %#x",
+ flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_PPS |
+ SYS_FLAG_NTP | SYS_FLAG_KERNEL |
+ SYS_FLAG_MONITOR | SYS_FLAG_FILEGEN |
+ SYS_FLAG_AUTH | SYS_FLAG_CAL));
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ if (flags & SYS_FLAG_BCLIENT)
+ proto_config(PROTO_BROADCLIENT, set, 0., NULL);
+ if (flags & SYS_FLAG_PPS)
+ proto_config(PROTO_PPS, set, 0., NULL);
+ if (flags & SYS_FLAG_NTP)
+ proto_config(PROTO_NTP, set, 0., NULL);
+ if (flags & SYS_FLAG_KERNEL)
+ proto_config(PROTO_KERNEL, set, 0., NULL);
+ if (flags & SYS_FLAG_MONITOR)
+ proto_config(PROTO_MONITOR, set, 0., NULL);
+ if (flags & SYS_FLAG_FILEGEN)
+ proto_config(PROTO_FILEGEN, set, 0., NULL);
+ if (flags & SYS_FLAG_AUTH)
+ proto_config(PROTO_AUTHENTICATE, set, 0., NULL);
+ if (flags & SYS_FLAG_CAL)
+ proto_config(PROTO_CAL, set, 0., NULL);
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+/*
+ * list_restrict4 - recursive helper for list_restrict dumps IPv4
+ * restriction list in reverse order.
+ */
+static void
+list_restrict4(
+ restrict_u * res,
+ struct info_restrict ** ppir
+ )
+{
+ struct info_restrict * pir;
+
+ if (res->link != NULL)
+ list_restrict4(res->link, ppir);
+
+ pir = *ppir;
+ pir->addr = htonl(res->u.v4.addr);
+ if (client_v6_capable)
+ pir->v6_flag = 0;
+ pir->mask = htonl(res->u.v4.mask);
+ pir->count = htonl(res->count);
+ pir->flags = htons(res->flags);
+ pir->mflags = htons(res->mflags);
+ *ppir = (struct info_restrict *)more_pkt();
+}
+
+
+/*
+ * list_restrict6 - recursive helper for list_restrict dumps IPv6
+ * restriction list in reverse order.
+ */
+static void
+list_restrict6(
+ restrict_u * res,
+ struct info_restrict ** ppir
+ )
+{
+ struct info_restrict * pir;
+
+ if (res->link != NULL)
+ list_restrict6(res->link, ppir);
+
+ pir = *ppir;
+ pir->addr6 = res->u.v6.addr;
+ pir->mask6 = res->u.v6.mask;
+ pir->v6_flag = 1;
+ pir->count = htonl(res->count);
+ pir->flags = htons(res->flags);
+ pir->mflags = htons(res->mflags);
+ *ppir = (struct info_restrict *)more_pkt();
+}
+
+
+/*
+ * list_restrict - return the restrict list
+ */
+static void
+list_restrict(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct info_restrict *ir;
+
+ DPRINTF(3, ("wants restrict list summary\n"));
+
+ ir = (struct info_restrict *)prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_restrict));
+
+ /*
+ * The restriction lists are kept sorted in the reverse order
+ * than they were originally. To preserve the output semantics,
+ * dump each list in reverse order. A recursive helper function
+ * achieves that.
+ */
+ list_restrict4(restrictlist4, &ir);
+ if (client_v6_capable)
+ list_restrict6(restrictlist6, &ir);
+ flush_pkt();
+}
+
+
+/*
+ * do_resaddflags - add flags to a restrict entry (or create one)
+ */
+static void
+do_resaddflags(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ do_restrict(srcadr, inter, inpkt, RESTRICT_FLAGS);
+}
+
+
+
+/*
+ * do_ressubflags - remove flags from a restrict entry
+ */
+static void
+do_ressubflags(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ do_restrict(srcadr, inter, inpkt, RESTRICT_UNFLAG);
+}
+
+
+/*
+ * do_unrestrict - remove a restrict entry from the list
+ */
+static void
+do_unrestrict(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ do_restrict(srcadr, inter, inpkt, RESTRICT_REMOVE);
+}
+
+
+/*
+ * do_restrict - do the dirty stuff of dealing with restrictions
+ */
+static void
+do_restrict(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt,
+ int op
+ )
+{
+ char * datap;
+ struct conf_restrict cr;
+ u_short items;
+ size_t item_sz;
+ sockaddr_u matchaddr;
+ sockaddr_u matchmask;
+ int bad;
+
+ /*
+ * Do a check of the flags to make sure that only
+ * the NTPPORT flag is set, if any. If not, complain
+ * about it. Note we are very picky here.
+ */
+ items = INFO_NITEMS(inpkt->err_nitems);
+ item_sz = INFO_ITEMSIZE(inpkt->mbz_itemsize);
+ datap = inpkt->u.data;
+ if (item_sz > sizeof(cr)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ bad = FALSE;
+ while (items-- > 0 && !bad) {
+ memcpy(&cr, datap, item_sz);
+ cr.flags = ntohs(cr.flags);
+ cr.mflags = ntohs(cr.mflags);
+ if (~RESM_NTPONLY & cr.mflags)
+ bad |= 1;
+ if (~RES_ALLFLAGS & cr.flags)
+ bad |= 2;
+ if (INADDR_ANY != cr.mask) {
+ if (client_v6_capable && cr.v6_flag) {
+ if (IN6_IS_ADDR_UNSPECIFIED(&cr.addr6))
+ bad |= 4;
+ } else {
+ if (INADDR_ANY == cr.addr)
+ bad |= 8;
+ }
+ }
+ datap += item_sz;
+ }
+
+ if (bad) {
+ msyslog(LOG_ERR, "do_restrict: bad = %#x", bad);
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ /*
+ * Looks okay, try it out
+ */
+ ZERO_SOCK(&matchaddr);
+ ZERO_SOCK(&matchmask);
+ datap = inpkt->u.data;
+
+ while (items-- > 0) {
+ memcpy(&cr, datap, item_sz);
+ cr.flags = ntohs(cr.flags);
+ cr.mflags = ntohs(cr.mflags);
+ if (client_v6_capable && cr.v6_flag) {
+ AF(&matchaddr) = AF_INET6;
+ AF(&matchmask) = AF_INET6;
+ SOCK_ADDR6(&matchaddr) = cr.addr6;
+ SOCK_ADDR6(&matchmask) = cr.mask6;
+ } else {
+ AF(&matchaddr) = AF_INET;
+ AF(&matchmask) = AF_INET;
+ NSRCADR(&matchaddr) = cr.addr;
+ NSRCADR(&matchmask) = cr.mask;
+ }
+ hack_restrict(op, &matchaddr, &matchmask, cr.mflags,
+ cr.flags, 0);
+ datap += item_sz;
+ }
+
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+/*
+ * mon_getlist - return monitor data
+ */
+static void
+mon_getlist(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+}
+
+
+/*
+ * Module entry points and the flags they correspond with
+ */
+struct reset_entry {
+ int flag; /* flag this corresponds to */
+ void (*handler)(void); /* routine to handle request */
+};
+
+struct reset_entry reset_entries[] = {
+ { RESET_FLAG_ALLPEERS, peer_all_reset },
+ { RESET_FLAG_IO, io_clr_stats },
+ { RESET_FLAG_SYS, proto_clr_stats },
+ { RESET_FLAG_MEM, peer_clr_stats },
+ { RESET_FLAG_TIMER, timer_clr_stats },
+ { RESET_FLAG_AUTH, reset_auth_stats },
+ { RESET_FLAG_CTL, ctl_clr_stats },
+ { 0, 0 }
+};
+
+/*
+ * reset_stats - reset statistic counters here and there
+ */
+static void
+reset_stats(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct reset_flags *rflags;
+ u_long flags;
+ struct reset_entry *rent;
+
+ if (INFO_NITEMS(inpkt->err_nitems) > 1) {
+ msyslog(LOG_ERR, "reset_stats: err_nitems > 1");
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ rflags = (struct reset_flags *)&inpkt->u;
+ flags = ntohl(rflags->flags);
+
+ if (flags & ~RESET_ALLFLAGS) {
+ msyslog(LOG_ERR, "reset_stats: reset leaves %#lx",
+ flags & ~RESET_ALLFLAGS);
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ for (rent = reset_entries; rent->flag != 0; rent++) {
+ if (flags & rent->flag)
+ (*rent->handler)();
+ }
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+/*
+ * reset_peer - clear a peer's statistics
+ */
+static void
+reset_peer(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ u_short items;
+ size_t item_sz;
+ char * datap;
+ struct conf_unpeer cp;
+ struct peer * p;
+ sockaddr_u peeraddr;
+ int bad;
+
+ /*
+ * We check first to see that every peer exists. If not,
+ * we return an error.
+ */
+
+ items = INFO_NITEMS(inpkt->err_nitems);
+ item_sz = INFO_ITEMSIZE(inpkt->mbz_itemsize);
+ datap = inpkt->u.data;
+ if (item_sz > sizeof(cp)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ bad = FALSE;
+ while (items-- > 0 && !bad) {
+ ZERO(cp);
+ memcpy(&cp, datap, item_sz);
+ ZERO_SOCK(&peeraddr);
+ if (client_v6_capable && cp.v6_flag) {
+ AF(&peeraddr) = AF_INET6;
+ SOCK_ADDR6(&peeraddr) = cp.peeraddr6;
+ } else {
+ AF(&peeraddr) = AF_INET;
+ NSRCADR(&peeraddr) = cp.peeraddr;
+ }
+
+#ifdef ISC_PLATFORM_HAVESALEN
+ peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
+#endif
+ p = findexistingpeer(&peeraddr, NULL, NULL, -1, 0);
+ if (NULL == p)
+ bad++;
+ datap += item_sz;
+ }
+
+ if (bad) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ /*
+ * Now do it in earnest.
+ */
+
+ datap = inpkt->u.data;
+ while (items-- > 0) {
+ ZERO(cp);
+ memcpy(&cp, datap, item_sz);
+ ZERO_SOCK(&peeraddr);
+ if (client_v6_capable && cp.v6_flag) {
+ AF(&peeraddr) = AF_INET6;
+ SOCK_ADDR6(&peeraddr) = cp.peeraddr6;
+ } else {
+ AF(&peeraddr) = AF_INET;
+ NSRCADR(&peeraddr) = cp.peeraddr;
+ }
+ SET_PORT(&peeraddr, 123);
+#ifdef ISC_PLATFORM_HAVESALEN
+ peeraddr.sa.sa_len = SOCKLEN(&peeraddr);
+#endif
+ p = findexistingpeer(&peeraddr, NULL, NULL, -1, 0);
+ while (p != NULL) {
+ peer_reset(p);
+ p = findexistingpeer(&peeraddr, NULL, p, -1, 0);
+ }
+ datap += item_sz;
+ }
+
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+/*
+ * do_key_reread - reread the encryption key file
+ */
+static void
+do_key_reread(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ rereadkeys();
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+/*
+ * trust_key - make one or more keys trusted
+ */
+static void
+trust_key(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ do_trustkey(srcadr, inter, inpkt, 1);
+}
+
+
+/*
+ * untrust_key - make one or more keys untrusted
+ */
+static void
+untrust_key(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ do_trustkey(srcadr, inter, inpkt, 0);
+}
+
+
+/*
+ * do_trustkey - make keys either trustable or untrustable
+ */
+static void
+do_trustkey(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt,
+ u_long trust
+ )
+{
+ register u_long *kp;
+ register int items;
+
+ items = INFO_NITEMS(inpkt->err_nitems);
+ kp = (u_long *)&inpkt->u;
+ while (items-- > 0) {
+ authtrust(*kp, trust);
+ kp++;
+ }
+
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+/*
+ * get_auth_info - return some stats concerning the authentication module
+ */
+static void
+get_auth_info(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_auth *ia;
+
+ ia = (struct info_auth *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_auth));
+
+ ia->numkeys = htonl((u_int32)authnumkeys);
+ ia->numfreekeys = htonl((u_int32)authnumfreekeys);
+ ia->keylookups = htonl((u_int32)authkeylookups);
+ ia->keynotfound = htonl((u_int32)authkeynotfound);
+ ia->encryptions = htonl((u_int32)authencryptions);
+ ia->decryptions = htonl((u_int32)authdecryptions);
+ ia->keyuncached = htonl((u_int32)authkeyuncached);
+ ia->expired = htonl((u_int32)authkeyexpired);
+ ia->timereset = htonl((u_int32)(current_time - auth_timereset));
+
+ (void) more_pkt();
+ flush_pkt();
+}
+
+
+
+/*
+ * reset_auth_stats - reset the authentication stat counters. Done here
+ * to keep ntp-isms out of the authentication module
+ */
+void
+reset_auth_stats(void)
+{
+ authkeylookups = 0;
+ authkeynotfound = 0;
+ authencryptions = 0;
+ authdecryptions = 0;
+ authkeyuncached = 0;
+ auth_timereset = current_time;
+}
+
+
+/*
+ * req_get_traps - return information about current trap holders
+ */
+static void
+req_get_traps(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct info_trap *it;
+ struct ctl_trap *tr;
+ int i;
+
+ if (num_ctl_traps == 0) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ it = (struct info_trap *)prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_trap));
+
+ for (i = 0, tr = ctl_traps; i < COUNTOF(ctl_traps); i++, tr++) {
+ if (tr->tr_flags & TRAP_INUSE) {
+ if (IS_IPV4(&tr->tr_addr)) {
+ if (tr->tr_localaddr == any_interface)
+ it->local_address = 0;
+ else
+ it->local_address
+ = NSRCADR(&tr->tr_localaddr->sin);
+ it->trap_address = NSRCADR(&tr->tr_addr);
+ if (client_v6_capable)
+ it->v6_flag = 0;
+ } else {
+ if (!client_v6_capable)
+ continue;
+ it->local_address6
+ = SOCK_ADDR6(&tr->tr_localaddr->sin);
+ it->trap_address6 = SOCK_ADDR6(&tr->tr_addr);
+ it->v6_flag = 1;
+ }
+ it->trap_port = NSRCPORT(&tr->tr_addr);
+ it->sequence = htons(tr->tr_sequence);
+ it->settime = htonl((u_int32)(current_time - tr->tr_settime));
+ it->origtime = htonl((u_int32)(current_time - tr->tr_origtime));
+ it->resets = htonl((u_int32)tr->tr_resets);
+ it->flags = htonl((u_int32)tr->tr_flags);
+ it = (struct info_trap *)more_pkt();
+ }
+ }
+ flush_pkt();
+}
+
+
+/*
+ * req_set_trap - configure a trap
+ */
+static void
+req_set_trap(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ do_setclr_trap(srcadr, inter, inpkt, 1);
+}
+
+
+
+/*
+ * req_clr_trap - unconfigure a trap
+ */
+static void
+req_clr_trap(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ do_setclr_trap(srcadr, inter, inpkt, 0);
+}
+
+
+
+/*
+ * do_setclr_trap - do the grunge work of (un)configuring a trap
+ */
+static void
+do_setclr_trap(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt,
+ int set
+ )
+{
+ register struct conf_trap *ct;
+ register endpt *linter;
+ int res;
+ sockaddr_u laddr;
+
+ /*
+ * Prepare sockaddr
+ */
+ ZERO_SOCK(&laddr);
+ AF(&laddr) = AF(srcadr);
+ SET_PORT(&laddr, NTP_PORT);
+
+ /*
+ * Restrict ourselves to one item only. This eliminates
+ * the error reporting problem.
+ */
+ if (INFO_NITEMS(inpkt->err_nitems) > 1) {
+ msyslog(LOG_ERR, "do_setclr_trap: err_nitems > 1");
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+ ct = (struct conf_trap *)&inpkt->u;
+
+ /*
+ * Look for the local interface. If none, use the default.
+ */
+ if (ct->local_address == 0) {
+ linter = any_interface;
+ } else {
+ if (IS_IPV4(&laddr))
+ NSRCADR(&laddr) = ct->local_address;
+ else
+ SOCK_ADDR6(&laddr) = ct->local_address6;
+ linter = findinterface(&laddr);
+ if (NULL == linter) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+ }
+
+ if (IS_IPV4(&laddr))
+ NSRCADR(&laddr) = ct->trap_address;
+ else
+ SOCK_ADDR6(&laddr) = ct->trap_address6;
+ if (ct->trap_port)
+ NSRCPORT(&laddr) = ct->trap_port;
+ else
+ SET_PORT(&laddr, TRAPPORT);
+
+ if (set) {
+ res = ctlsettrap(&laddr, linter, 0,
+ INFO_VERSION(inpkt->rm_vn_mode));
+ } else {
+ res = ctlclrtrap(&laddr, linter, 0);
+ }
+
+ if (!res) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ } else {
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+ }
+ return;
+}
+
+
+
+/*
+ * set_request_keyid - set the keyid used to authenticate requests
+ */
+static void
+set_request_keyid(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ keyid_t *pkeyid;
+
+ /*
+ * Restrict ourselves to one item only.
+ */
+ if (INFO_NITEMS(inpkt->err_nitems) > 1) {
+ msyslog(LOG_ERR, "set_request_keyid: err_nitems > 1");
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ pkeyid = (keyid_t *)&inpkt->u;
+ info_auth_keyid = ntohl(*pkeyid);
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+
+/*
+ * set_control_keyid - set the keyid used to authenticate requests
+ */
+static void
+set_control_keyid(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ keyid_t *pkeyid;
+
+ /*
+ * Restrict ourselves to one item only.
+ */
+ if (INFO_NITEMS(inpkt->err_nitems) > 1) {
+ msyslog(LOG_ERR, "set_control_keyid: err_nitems > 1");
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ pkeyid = (keyid_t *)&inpkt->u;
+ ctl_auth_keyid = ntohl(*pkeyid);
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+
+
+
+/*
+ * get_ctl_stats - return some stats concerning the control message module
+ */
+static void
+get_ctl_stats(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_control *ic;
+
+ ic = (struct info_control *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_control));
+
+ ic->ctltimereset = htonl((u_int32)(current_time - ctltimereset));
+ ic->numctlreq = htonl((u_int32)numctlreq);
+ ic->numctlbadpkts = htonl((u_int32)numctlbadpkts);
+ ic->numctlresponses = htonl((u_int32)numctlresponses);
+ ic->numctlfrags = htonl((u_int32)numctlfrags);
+ ic->numctlerrors = htonl((u_int32)numctlerrors);
+ ic->numctltooshort = htonl((u_int32)numctltooshort);
+ ic->numctlinputresp = htonl((u_int32)numctlinputresp);
+ ic->numctlinputfrag = htonl((u_int32)numctlinputfrag);
+ ic->numctlinputerr = htonl((u_int32)numctlinputerr);
+ ic->numctlbadoffset = htonl((u_int32)numctlbadoffset);
+ ic->numctlbadversion = htonl((u_int32)numctlbadversion);
+ ic->numctldatatooshort = htonl((u_int32)numctldatatooshort);
+ ic->numctlbadop = htonl((u_int32)numctlbadop);
+ ic->numasyncmsgs = htonl((u_int32)numasyncmsgs);
+
+ (void) more_pkt();
+ flush_pkt();
+}
+
+
+#ifdef KERNEL_PLL
+/*
+ * get_kernel_info - get kernel pll/pps information
+ */
+static void
+get_kernel_info(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_kernel *ik;
+ struct timex ntx;
+
+ if (!pll_control) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ ZERO(ntx);
+ if (ntp_adjtime(&ntx) < 0)
+ msyslog(LOG_ERR, "get_kernel_info: ntp_adjtime() failed: %m");
+ ik = (struct info_kernel *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_kernel));
+
+ /*
+ * pll variables
+ */
+ ik->offset = htonl((u_int32)ntx.offset);
+ ik->freq = htonl((u_int32)ntx.freq);
+ ik->maxerror = htonl((u_int32)ntx.maxerror);
+ ik->esterror = htonl((u_int32)ntx.esterror);
+ ik->status = htons(ntx.status);
+ ik->constant = htonl((u_int32)ntx.constant);
+ ik->precision = htonl((u_int32)ntx.precision);
+ ik->tolerance = htonl((u_int32)ntx.tolerance);
+
+ /*
+ * pps variables
+ */
+ ik->ppsfreq = htonl((u_int32)ntx.ppsfreq);
+ ik->jitter = htonl((u_int32)ntx.jitter);
+ ik->shift = htons(ntx.shift);
+ ik->stabil = htonl((u_int32)ntx.stabil);
+ ik->jitcnt = htonl((u_int32)ntx.jitcnt);
+ ik->calcnt = htonl((u_int32)ntx.calcnt);
+ ik->errcnt = htonl((u_int32)ntx.errcnt);
+ ik->stbcnt = htonl((u_int32)ntx.stbcnt);
+
+ (void) more_pkt();
+ flush_pkt();
+}
+#endif /* KERNEL_PLL */
+
+
+#ifdef REFCLOCK
+/*
+ * get_clock_info - get info about a clock
+ */
+static void
+get_clock_info(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct info_clock *ic;
+ register u_int32 *clkaddr;
+ register int items;
+ struct refclockstat clock_stat;
+ sockaddr_u addr;
+ l_fp ltmp;
+
+ ZERO_SOCK(&addr);
+ AF(&addr) = AF_INET;
+#ifdef ISC_PLATFORM_HAVESALEN
+ addr.sa.sa_len = SOCKLEN(&addr);
+#endif
+ SET_PORT(&addr, NTP_PORT);
+ items = INFO_NITEMS(inpkt->err_nitems);
+ clkaddr = &inpkt->u.u32[0];
+
+ ic = (struct info_clock *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_clock));
+
+ while (items-- > 0) {
+ NSRCADR(&addr) = *clkaddr++;
+ if (!ISREFCLOCKADR(&addr) || NULL ==
+ findexistingpeer(&addr, NULL, NULL, -1, 0)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ clock_stat.kv_list = (struct ctl_var *)0;
+
+ refclock_control(&addr, NULL, &clock_stat);
+
+ ic->clockadr = NSRCADR(&addr);
+ ic->type = clock_stat.type;
+ ic->flags = clock_stat.flags;
+ ic->lastevent = clock_stat.lastevent;
+ ic->currentstatus = clock_stat.currentstatus;
+ ic->polls = htonl((u_int32)clock_stat.polls);
+ ic->noresponse = htonl((u_int32)clock_stat.noresponse);
+ ic->badformat = htonl((u_int32)clock_stat.badformat);
+ ic->baddata = htonl((u_int32)clock_stat.baddata);
+ ic->timestarted = htonl((u_int32)clock_stat.timereset);
+ DTOLFP(clock_stat.fudgetime1, &ltmp);
+ HTONL_FP(&ltmp, &ic->fudgetime1);
+ DTOLFP(clock_stat.fudgetime2, &ltmp);
+ HTONL_FP(&ltmp, &ic->fudgetime2);
+ ic->fudgeval1 = htonl((u_int32)clock_stat.fudgeval1);
+ ic->fudgeval2 = htonl(clock_stat.fudgeval2);
+
+ free_varlist(clock_stat.kv_list);
+
+ ic = (struct info_clock *)more_pkt();
+ }
+ flush_pkt();
+}
+
+
+
+/*
+ * set_clock_fudge - get a clock's fudge factors
+ */
+static void
+set_clock_fudge(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register struct conf_fudge *cf;
+ register int items;
+ struct refclockstat clock_stat;
+ sockaddr_u addr;
+ l_fp ltmp;
+
+ ZERO(addr);
+ ZERO(clock_stat);
+ items = INFO_NITEMS(inpkt->err_nitems);
+ cf = (struct conf_fudge *)&inpkt->u;
+
+ while (items-- > 0) {
+ AF(&addr) = AF_INET;
+ NSRCADR(&addr) = cf->clockadr;
+#ifdef ISC_PLATFORM_HAVESALEN
+ addr.sa.sa_len = SOCKLEN(&addr);
+#endif
+ SET_PORT(&addr, NTP_PORT);
+ if (!ISREFCLOCKADR(&addr) || NULL ==
+ findexistingpeer(&addr, NULL, NULL, -1, 0)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ switch(ntohl(cf->which)) {
+ case FUDGE_TIME1:
+ NTOHL_FP(&cf->fudgetime, &ltmp);
+ LFPTOD(&ltmp, clock_stat.fudgetime1);
+ clock_stat.haveflags = CLK_HAVETIME1;
+ break;
+ case FUDGE_TIME2:
+ NTOHL_FP(&cf->fudgetime, &ltmp);
+ LFPTOD(&ltmp, clock_stat.fudgetime2);
+ clock_stat.haveflags = CLK_HAVETIME2;
+ break;
+ case FUDGE_VAL1:
+ clock_stat.fudgeval1 = ntohl(cf->fudgeval_flags);
+ clock_stat.haveflags = CLK_HAVEVAL1;
+ break;
+ case FUDGE_VAL2:
+ clock_stat.fudgeval2 = ntohl(cf->fudgeval_flags);
+ clock_stat.haveflags = CLK_HAVEVAL2;
+ break;
+ case FUDGE_FLAGS:
+ clock_stat.flags = (u_char) (ntohl(cf->fudgeval_flags) & 0xf);
+ clock_stat.haveflags =
+ (CLK_HAVEFLAG1|CLK_HAVEFLAG2|CLK_HAVEFLAG3|CLK_HAVEFLAG4);
+ break;
+ default:
+ msyslog(LOG_ERR, "set_clock_fudge: default!");
+ req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
+ return;
+ }
+
+ refclock_control(&addr, &clock_stat, (struct refclockstat *)0);
+ }
+
+ req_ack(srcadr, inter, inpkt, INFO_OKAY);
+}
+#endif
+
+#ifdef REFCLOCK
+/*
+ * get_clkbug_info - get debugging info about a clock
+ */
+static void
+get_clkbug_info(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ register int i;
+ register struct info_clkbug *ic;
+ register u_int32 *clkaddr;
+ register int items;
+ struct refclockbug bug;
+ sockaddr_u addr;
+
+ ZERO_SOCK(&addr);
+ AF(&addr) = AF_INET;
+#ifdef ISC_PLATFORM_HAVESALEN
+ addr.sa.sa_len = SOCKLEN(&addr);
+#endif
+ SET_PORT(&addr, NTP_PORT);
+ items = INFO_NITEMS(inpkt->err_nitems);
+ clkaddr = (u_int32 *)&inpkt->u;
+
+ ic = (struct info_clkbug *)prepare_pkt(srcadr, inter, inpkt,
+ sizeof(struct info_clkbug));
+
+ while (items-- > 0) {
+ NSRCADR(&addr) = *clkaddr++;
+ if (!ISREFCLOCKADR(&addr) || NULL ==
+ findexistingpeer(&addr, NULL, NULL, -1, 0)) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ ZERO(bug);
+ refclock_buginfo(&addr, &bug);
+ if (bug.nvalues == 0 && bug.ntimes == 0) {
+ req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
+ return;
+ }
+
+ ic->clockadr = NSRCADR(&addr);
+ i = bug.nvalues;
+ if (i > NUMCBUGVALUES)
+ i = NUMCBUGVALUES;
+ ic->nvalues = (u_char)i;
+ ic->svalues = htons((u_short) (bug.svalues & ((1<<i)-1)));
+ while (--i >= 0)
+ ic->values[i] = htonl(bug.values[i]);
+
+ i = bug.ntimes;
+ if (i > NUMCBUGTIMES)
+ i = NUMCBUGTIMES;
+ ic->ntimes = (u_char)i;
+ ic->stimes = htonl(bug.stimes);
+ while (--i >= 0) {
+ HTONL_FP(&bug.times[i], &ic->times[i]);
+ }
+
+ ic = (struct info_clkbug *)more_pkt();
+ }
+ flush_pkt();
+}
+#endif
+
+/*
+ * receiver of interface structures
+ */
+static void
+fill_info_if_stats(void *data, interface_info_t *interface_info)
+{
+ struct info_if_stats **ifsp = (struct info_if_stats **)data;
+ struct info_if_stats *ifs = *ifsp;
+ endpt *ep = interface_info->ep;
+
+ ZERO(*ifs);
+
+ if (IS_IPV6(&ep->sin)) {
+ if (!client_v6_capable) {
+ return;
+ }
+ ifs->v6_flag = 1;
+ ifs->unaddr.addr6 = SOCK_ADDR6(&ep->sin);
+ ifs->unbcast.addr6 = SOCK_ADDR6(&ep->bcast);
+ ifs->unmask.addr6 = SOCK_ADDR6(&ep->mask);
+ } else {
+ ifs->v6_flag = 0;
+ ifs->unaddr.addr = SOCK_ADDR4(&ep->sin);
+ ifs->unbcast.addr = SOCK_ADDR4(&ep->bcast);
+ ifs->unmask.addr = SOCK_ADDR4(&ep->mask);
+ }
+ ifs->v6_flag = htonl(ifs->v6_flag);
+ strlcpy(ifs->name, ep->name, sizeof(ifs->name));
+ ifs->family = htons(ep->family);
+ ifs->flags = htonl(ep->flags);
+ ifs->last_ttl = htonl(ep->last_ttl);
+ ifs->num_mcast = htonl(ep->num_mcast);
+ ifs->received = htonl(ep->received);
+ ifs->sent = htonl(ep->sent);
+ ifs->notsent = htonl(ep->notsent);
+ ifs->ifindex = htonl(ep->ifindex);
+ /* scope no longer in endpt, in in6_addr typically */
+ ifs->scopeid = ifs->ifindex;
+ ifs->ifnum = htonl(ep->ifnum);
+ ifs->uptime = htonl(current_time - ep->starttime);
+ ifs->ignore_packets = ep->ignore_packets;
+ ifs->peercnt = htonl(ep->peercnt);
+ ifs->action = interface_info->action;
+
+ *ifsp = (struct info_if_stats *)more_pkt();
+}
+
+/*
+ * get_if_stats - get interface statistics
+ */
+static void
+get_if_stats(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct info_if_stats *ifs;
+
+ DPRINTF(3, ("wants interface statistics\n"));
+
+ ifs = (struct info_if_stats *)prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_if_stats));
+
+ interface_enumerate(fill_info_if_stats, &ifs);
+
+ flush_pkt();
+}
+
+static void
+do_if_reload(
+ sockaddr_u *srcadr,
+ endpt *inter,
+ struct req_pkt *inpkt
+ )
+{
+ struct info_if_stats *ifs;
+
+ DPRINTF(3, ("wants interface reload\n"));
+
+ ifs = (struct info_if_stats *)prepare_pkt(srcadr, inter, inpkt,
+ v6sizeof(struct info_if_stats));
+
+ interface_update(fill_info_if_stats, &ifs);
+
+ flush_pkt();
+}
+
diff --git a/ntpd/ntp_restrict.c b/ntpd/ntp_restrict.c
new file mode 100644
index 0000000..6e75667
--- /dev/null
+++ b/ntpd/ntp_restrict.c
@@ -0,0 +1,669 @@
+/*
+ * ntp_restrict.c - determine host restrictions
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#include "ntpd.h"
+#include "ntp_if.h"
+#include "ntp_lists.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+
+/*
+ * This code keeps a simple address-and-mask list of hosts we want
+ * to place restrictions on (or remove them from). The restrictions
+ * are implemented as a set of flags which tell you what the host
+ * can't do. There is a subroutine entry to return the flags. The
+ * list is kept sorted to reduce the average number of comparisons
+ * and make sure you get the set of restrictions most specific to
+ * the address.
+ *
+ * The algorithm is that, when looking up a host, it is first assumed
+ * that the default set of restrictions will apply. It then searches
+ * down through the list. Whenever it finds a match it adopts the
+ * match's flags instead. When you hit the point where the sorted
+ * address is greater than the target, you return with the last set of
+ * flags you found. Because of the ordering of the list, the most
+ * specific match will provide the final set of flags.
+ *
+ * This was originally intended to restrict you from sync'ing to your
+ * own broadcasts when you are doing that, by restricting yourself from
+ * your own interfaces. It was also thought it would sometimes be useful
+ * to keep a misbehaving host or two from abusing your primary clock. It
+ * has been expanded, however, to suit the needs of those with more
+ * restrictive access policies.
+ */
+/*
+ * We will use two lists, one for IPv4 addresses and one for IPv6
+ * addresses. This is not protocol-independant but for now I can't
+ * find a way to respect this. We'll check this later... JFB 07/2001
+ */
+#define MASK_IPV6_ADDR(dst, src, msk) \
+ do { \
+ int idx; \
+ for (idx = 0; idx < COUNTOF((dst)->s6_addr); idx++) { \
+ (dst)->s6_addr[idx] = (src)->s6_addr[idx] \
+ & (msk)->s6_addr[idx]; \
+ } \
+ } while (0)
+
+/*
+ * We allocate INC_RESLIST{4|6} entries to the free list whenever empty.
+ * Auto-tune these to be just less than 1KB (leaving at least 16 bytes
+ * for allocator overhead).
+ */
+#define INC_RESLIST4 ((1024 - 16) / V4_SIZEOF_RESTRICT_U)
+#define INC_RESLIST6 ((1024 - 16) / V6_SIZEOF_RESTRICT_U)
+
+/*
+ * The restriction list
+ */
+restrict_u *restrictlist4;
+restrict_u *restrictlist6;
+static int restrictcount; /* count in the restrict lists */
+
+/*
+ * The free list and associated counters. Also some uninteresting
+ * stat counters.
+ */
+static restrict_u *resfree4; /* available entries (free list) */
+static restrict_u *resfree6;
+
+static u_long res_calls;
+static u_long res_found;
+static u_long res_not_found;
+
+/*
+ * Count number of restriction entries referring to RES_LIMITED, to
+ * control implicit activation/deactivation of the MRU monlist.
+ */
+static u_long res_limited_refcnt;
+
+/*
+ * Our default entries.
+ */
+static restrict_u restrict_def4;
+static restrict_u restrict_def6;
+
+/*
+ * "restrict source ..." enabled knob and restriction bits.
+ */
+static int restrict_source_enabled;
+static u_short restrict_source_flags;
+static u_short restrict_source_mflags;
+
+/*
+ * private functions
+ */
+static restrict_u * alloc_res4(void);
+static restrict_u * alloc_res6(void);
+static void free_res(restrict_u *, int);
+static void inc_res_limited(void);
+static void dec_res_limited(void);
+static restrict_u * match_restrict4_addr(u_int32, u_short);
+static restrict_u * match_restrict6_addr(const struct in6_addr *,
+ u_short);
+static restrict_u * match_restrict_entry(const restrict_u *, int);
+static int res_sorts_before4(restrict_u *, restrict_u *);
+static int res_sorts_before6(restrict_u *, restrict_u *);
+
+
+/*
+ * init_restrict - initialize the restriction data structures
+ */
+void
+init_restrict(void)
+{
+ /*
+ * The restriction lists begin with a default entry with address
+ * and mask 0, which will match any entry. The lists are kept
+ * sorted by descending address followed by descending mask:
+ *
+ * address mask
+ * 192.168.0.0 255.255.255.0 kod limited noquery nopeer
+ * 192.168.0.0 255.255.0.0 kod limited
+ * 0.0.0.0 0.0.0.0 kod limited noquery
+ *
+ * The first entry which matches an address is used. With the
+ * example restrictions above, 192.168.0.0/24 matches the first
+ * entry, the rest of 192.168.0.0/16 matches the second, and
+ * everything else matches the third (default).
+ *
+ * Note this achieves the same result a little more efficiently
+ * than the documented behavior, which is to keep the lists
+ * sorted by ascending address followed by ascending mask, with
+ * the _last_ matching entry used.
+ *
+ * An additional wrinkle is we may have multiple entries with
+ * the same address and mask but differing match flags (mflags).
+ * At present there is only one, RESM_NTPONLY. Entries with
+ * RESM_NTPONLY are sorted earlier so they take precedence over
+ * any otherwise similar entry without. Again, this is the same
+ * behavior as but reversed implementation compared to the docs.
+ *
+ */
+ LINK_SLIST(restrictlist4, &restrict_def4, link);
+ LINK_SLIST(restrictlist6, &restrict_def6, link);
+ restrictcount = 2;
+}
+
+
+static restrict_u *
+alloc_res4(void)
+{
+ const size_t cb = V4_SIZEOF_RESTRICT_U;
+ const size_t count = INC_RESLIST4;
+ restrict_u * rl;
+ restrict_u * res;
+ int i;
+
+ UNLINK_HEAD_SLIST(res, resfree4, link);
+ if (res != NULL)
+ return res;
+
+ rl = emalloc_zero(count * cb);
+ /* link all but the first onto free list */
+ res = (void *)((char *)rl + (count - 1) * cb);
+ for (i = count - 1; i > 0; i--) {
+ LINK_SLIST(resfree4, res, link);
+ res = (void *)((char *)res - cb);
+ }
+ NTP_INSIST(rl == res);
+ /* allocate the first */
+ return res;
+}
+
+
+static restrict_u *
+alloc_res6(void)
+{
+ const size_t cb = V6_SIZEOF_RESTRICT_U;
+ const size_t count = INC_RESLIST6;
+ restrict_u * rl;
+ restrict_u * res;
+ int i;
+
+ UNLINK_HEAD_SLIST(res, resfree6, link);
+ if (res != NULL)
+ return res;
+
+ rl = emalloc_zero(count * cb);
+ /* link all but the first onto free list */
+ res = (void *)((char *)rl + (count - 1) * cb);
+ for (i = count - 1; i > 0; i--) {
+ LINK_SLIST(resfree6, res, link);
+ res = (void *)((char *)res - cb);
+ }
+ NTP_INSIST(rl == res);
+ /* allocate the first */
+ return res;
+}
+
+
+static void
+free_res(
+ restrict_u * res,
+ int v6
+ )
+{
+ restrict_u ** plisthead;
+ restrict_u * unlinked;
+
+ restrictcount--;
+ if (RES_LIMITED & res->flags)
+ dec_res_limited();
+
+ if (v6)
+ plisthead = &restrictlist6;
+ else
+ plisthead = &restrictlist4;
+ UNLINK_SLIST(unlinked, *plisthead, res, link, restrict_u);
+ NTP_INSIST(unlinked == res);
+
+ if (v6) {
+ zero_mem(res, V6_SIZEOF_RESTRICT_U);
+ plisthead = &resfree6;
+ } else {
+ zero_mem(res, V4_SIZEOF_RESTRICT_U);
+ plisthead = &resfree4;
+ }
+ LINK_SLIST(*plisthead, res, link);
+}
+
+
+static void
+inc_res_limited(void)
+{
+ if (!res_limited_refcnt)
+ mon_start(MON_RES);
+ res_limited_refcnt++;
+}
+
+
+static void
+dec_res_limited(void)
+{
+ res_limited_refcnt--;
+ if (!res_limited_refcnt)
+ mon_stop(MON_RES);
+}
+
+
+static restrict_u *
+match_restrict4_addr(
+ u_int32 addr,
+ u_short port
+ )
+{
+ const int v6 = 0;
+ restrict_u * res;
+ restrict_u * next;
+
+ for (res = restrictlist4; res != NULL; res = next) {
+ next = res->link;
+ if (res->expire &&
+ res->expire <= current_time)
+ free_res(res, v6);
+ if (res->u.v4.addr == (addr & res->u.v4.mask)
+ && (!(RESM_NTPONLY & res->mflags)
+ || NTP_PORT == port))
+ break;
+ }
+ return res;
+}
+
+
+static restrict_u *
+match_restrict6_addr(
+ const struct in6_addr * addr,
+ u_short port
+ )
+{
+ const int v6 = 1;
+ restrict_u * res;
+ restrict_u * next;
+ struct in6_addr masked;
+
+ for (res = restrictlist6; res != NULL; res = next) {
+ next = res->link;
+ NTP_INSIST(next != res);
+ if (res->expire &&
+ res->expire <= current_time)
+ free_res(res, v6);
+ MASK_IPV6_ADDR(&masked, addr, &res->u.v6.mask);
+ if (ADDR6_EQ(&masked, &res->u.v6.addr)
+ && (!(RESM_NTPONLY & res->mflags)
+ || NTP_PORT == port))
+ break;
+ }
+ return res;
+}
+
+
+/*
+ * match_restrict_entry - find an exact match on a restrict list.
+ *
+ * Exact match is addr, mask, and mflags all equal.
+ * In order to use more common code for IPv4 and IPv6, this routine
+ * requires the caller to populate a restrict_u with mflags and either
+ * the v4 or v6 address and mask as appropriate. Other fields in the
+ * input restrict_u are ignored.
+ */
+static restrict_u *
+match_restrict_entry(
+ const restrict_u * pmatch,
+ int v6
+ )
+{
+ restrict_u *res;
+ restrict_u *rlist;
+ size_t cb;
+
+ if (v6) {
+ rlist = restrictlist6;
+ cb = sizeof(pmatch->u.v6);
+ } else {
+ rlist = restrictlist4;
+ cb = sizeof(pmatch->u.v4);
+ }
+
+ for (res = rlist; res != NULL; res = res->link)
+ if (res->mflags == pmatch->mflags &&
+ !memcmp(&res->u, &pmatch->u, cb))
+ break;
+ return res;
+}
+
+
+/*
+ * res_sorts_before4 - compare two restrict4 entries
+ *
+ * Returns nonzero if r1 sorts before r2. We sort by descending
+ * address, then descending mask, then descending mflags, so sorting
+ * before means having a higher value.
+ */
+static int
+res_sorts_before4(
+ restrict_u *r1,
+ restrict_u *r2
+ )
+{
+ int r1_before_r2;
+
+ if (r1->u.v4.addr > r2->u.v4.addr)
+ r1_before_r2 = 1;
+ else if (r1->u.v4.addr < r2->u.v4.addr)
+ r1_before_r2 = 0;
+ else if (r1->u.v4.mask > r2->u.v4.mask)
+ r1_before_r2 = 1;
+ else if (r1->u.v4.mask < r2->u.v4.mask)
+ r1_before_r2 = 0;
+ else if (r1->mflags > r2->mflags)
+ r1_before_r2 = 1;
+ else
+ r1_before_r2 = 0;
+
+ return r1_before_r2;
+}
+
+
+/*
+ * res_sorts_before6 - compare two restrict6 entries
+ *
+ * Returns nonzero if r1 sorts before r2. We sort by descending
+ * address, then descending mask, then descending mflags, so sorting
+ * before means having a higher value.
+ */
+static int
+res_sorts_before6(
+ restrict_u *r1,
+ restrict_u *r2
+ )
+{
+ int r1_before_r2;
+ int cmp;
+
+ cmp = ADDR6_CMP(&r1->u.v6.addr, &r2->u.v6.addr);
+ if (cmp > 0) /* r1->addr > r2->addr */
+ r1_before_r2 = 1;
+ else if (cmp < 0) /* r2->addr > r1->addr */
+ r1_before_r2 = 0;
+ else {
+ cmp = ADDR6_CMP(&r1->u.v6.mask, &r2->u.v6.mask);
+ if (cmp > 0) /* r1->mask > r2->mask*/
+ r1_before_r2 = 1;
+ else if (cmp < 0) /* r2->mask > r1->mask */
+ r1_before_r2 = 0;
+ else if (r1->mflags > r2->mflags)
+ r1_before_r2 = 1;
+ else
+ r1_before_r2 = 0;
+ }
+
+ return r1_before_r2;
+}
+
+
+/*
+ * restrictions - return restrictions for this host
+ */
+u_short
+restrictions(
+ sockaddr_u *srcadr
+ )
+{
+ restrict_u *match;
+ struct in6_addr *pin6;
+ u_short flags;
+
+ res_calls++;
+ flags = 0;
+ /* IPv4 source address */
+ if (IS_IPV4(srcadr)) {
+ /*
+ * Ignore any packets with a multicast source address
+ * (this should be done early in the receive process,
+ * not later!)
+ */
+ if (IN_CLASSD(SRCADR(srcadr)))
+ return (int)RES_IGNORE;
+
+ match = match_restrict4_addr(SRCADR(srcadr),
+ SRCPORT(srcadr));
+ match->count++;
+ /*
+ * res_not_found counts only use of the final default
+ * entry, not any "restrict default ntpport ...", which
+ * would be just before the final default.
+ */
+ if (&restrict_def4 == match)
+ res_not_found++;
+ else
+ res_found++;
+ flags = match->flags;
+ }
+
+ /* IPv6 source address */
+ if (IS_IPV6(srcadr)) {
+ pin6 = PSOCK_ADDR6(srcadr);
+
+ /*
+ * Ignore any packets with a multicast source address
+ * (this should be done early in the receive process,
+ * not later!)
+ */
+ if (IN6_IS_ADDR_MULTICAST(pin6))
+ return (int)RES_IGNORE;
+
+ match = match_restrict6_addr(pin6, SRCPORT(srcadr));
+ match->count++;
+ if (&restrict_def6 == match)
+ res_not_found++;
+ else
+ res_found++;
+ flags = match->flags;
+ }
+ return (flags);
+}
+
+
+/*
+ * hack_restrict - add/subtract/manipulate entries on the restrict list
+ */
+void
+hack_restrict(
+ int op,
+ sockaddr_u * resaddr,
+ sockaddr_u * resmask,
+ u_short mflags,
+ u_short flags,
+ u_long expire
+ )
+{
+ int v6;
+ restrict_u match;
+ restrict_u * res;
+ restrict_u ** plisthead;
+
+ DPRINTF(1, ("restrict: op %d addr %s mask %s mflags %08x flags %08x\n",
+ op, stoa(resaddr), stoa(resmask), mflags, flags));
+
+ if (NULL == resaddr) {
+ NTP_REQUIRE(NULL == resmask);
+ NTP_REQUIRE(RESTRICT_FLAGS == op);
+ restrict_source_flags = flags;
+ restrict_source_mflags = mflags;
+ restrict_source_enabled = 1;
+ return;
+ }
+
+ ZERO(match);
+ /* silence VC9 potentially uninit warnings */
+ res = NULL;
+ v6 = 0;
+
+ if (IS_IPV4(resaddr)) {
+ v6 = 0;
+ /*
+ * Get address and mask in host byte order for easy
+ * comparison as u_int32
+ */
+ match.u.v4.addr = SRCADR(resaddr);
+ match.u.v4.mask = SRCADR(resmask);
+ match.u.v4.addr &= match.u.v4.mask;
+
+ } else if (IS_IPV6(resaddr)) {
+ v6 = 1;
+ /*
+ * Get address and mask in network byte order for easy
+ * comparison as byte sequences (e.g. memcmp())
+ */
+ match.u.v6.mask = SOCK_ADDR6(resmask);
+ MASK_IPV6_ADDR(&match.u.v6.addr, PSOCK_ADDR6(resaddr),
+ &match.u.v6.mask);
+
+ } else /* not IPv4 nor IPv6 */
+ NTP_REQUIRE(0);
+
+ match.flags = flags;
+ match.mflags = mflags;
+ match.expire = expire;
+ res = match_restrict_entry(&match, v6);
+
+ switch (op) {
+
+ case RESTRICT_FLAGS:
+ /*
+ * Here we add bits to the flags. If this is a
+ * new restriction add it.
+ */
+ if (NULL == res) {
+ if (v6) {
+ res = alloc_res6();
+ memcpy(res, &match,
+ V6_SIZEOF_RESTRICT_U);
+ plisthead = &restrictlist6;
+ } else {
+ res = alloc_res4();
+ memcpy(res, &match,
+ V4_SIZEOF_RESTRICT_U);
+ plisthead = &restrictlist4;
+ }
+ LINK_SORT_SLIST(
+ *plisthead, res,
+ (v6)
+ ? res_sorts_before6(res, L_S_S_CUR())
+ : res_sorts_before4(res, L_S_S_CUR()),
+ link, restrict_u);
+ restrictcount++;
+ if (RES_LIMITED & flags)
+ inc_res_limited();
+ } else {
+ if ((RES_LIMITED & flags) &&
+ !(RES_LIMITED & res->flags))
+ inc_res_limited();
+ res->flags |= flags;
+ }
+ break;
+
+ case RESTRICT_UNFLAG:
+ /*
+ * Remove some bits from the flags. If we didn't
+ * find this one, just return.
+ */
+ if (res != NULL) {
+ if ((RES_LIMITED & res->flags)
+ && (RES_LIMITED & flags))
+ dec_res_limited();
+ res->flags &= ~flags;
+ }
+ break;
+
+ case RESTRICT_REMOVE:
+ case RESTRICT_REMOVEIF:
+ /*
+ * Remove an entry from the table entirely if we
+ * found one. Don't remove the default entry and
+ * don't remove an interface entry.
+ */
+ if (res != NULL
+ && (RESTRICT_REMOVEIF == op
+ || !(RESM_INTERFACE & res->mflags))
+ && res != &restrict_def4
+ && res != &restrict_def6)
+ free_res(res, v6);
+ break;
+
+ default: /* unknown op */
+ NTP_INSIST(0);
+ break;
+ }
+
+}
+
+
+/*
+ * restrict_source - maintains dynamic "restrict source ..." entries as
+ * peers come and go.
+ */
+void
+restrict_source(
+ sockaddr_u * addr,
+ int farewell, /* 0 to add, 1 to remove */
+ u_long expire /* 0 is infinite, valid until */
+ )
+{
+ sockaddr_u onesmask;
+ restrict_u * res;
+ int found_specific;
+
+ if (!restrict_source_enabled || SOCK_UNSPEC(addr) ||
+ IS_MCAST(addr) || ISREFCLOCKADR(addr))
+ return;
+
+ NTP_REQUIRE(AF_INET == AF(addr) || AF_INET6 == AF(addr));
+
+ SET_HOSTMASK(&onesmask, AF(addr));
+ if (farewell) {
+ hack_restrict(RESTRICT_REMOVE, addr, &onesmask,
+ 0, 0, 0);
+ DPRINTF(1, ("restrict_source: %s removed", stoa(addr)));
+ return;
+ }
+
+ /*
+ * If there is a specific entry for this address, hands
+ * off, as it is condidered more specific than "restrict
+ * server ...".
+ * However, if the specific entry found is a fleeting one
+ * added by pool_xmit() before soliciting, replace it
+ * immediately regardless of the expire value to make way
+ * for the more persistent entry.
+ */
+ if (IS_IPV4(addr)) {
+ res = match_restrict4_addr(SRCADR(addr), SRCPORT(addr));
+ found_specific = (SRCADR(&onesmask) == res->u.v4.mask);
+ } else {
+ res = match_restrict6_addr(&SOCK_ADDR6(addr),
+ SRCPORT(addr));
+ found_specific = ADDR6_EQ(&res->u.v6.mask,
+ &SOCK_ADDR6(&onesmask));
+ }
+ if (!expire && found_specific && res->expire) {
+ found_specific = 0;
+ free_res(res, IS_IPV6(addr));
+ }
+ if (found_specific)
+ return;
+
+ hack_restrict(RESTRICT_FLAGS, addr, &onesmask,
+ restrict_source_mflags, restrict_source_flags,
+ expire);
+ DPRINTF(1, ("restrict_source: %s host restriction added\n",
+ stoa(addr)));
+}
diff --git a/ntpd/ntp_scanner.c b/ntpd/ntp_scanner.c
new file mode 100644
index 0000000..3e09856
--- /dev/null
+++ b/ntpd/ntp_scanner.c
@@ -0,0 +1,755 @@
+
+/* ntp_scanner.c
+ *
+ * The source code for a simple lexical analyzer.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Copyright (c) 2006
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#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"
+
+/* ntp_keyword.h declares finite state machine and token text */
+#include "ntp_keyword.h"
+
+
+
+/* SCANNER GLOBAL VARIABLES
+ * ------------------------
+ */
+
+#define MAX_LEXEME (1024 + 1) /* The maximum size of a lexeme */
+char yytext[MAX_LEXEME]; /* Buffer for storing the input text/lexeme */
+u_int32 conf_file_sum; /* Simple sum of characters read */
+
+
+
+
+/* CONSTANTS
+ * ---------
+ */
+
+
+/* SCANNER GLOBAL VARIABLES
+ * ------------------------
+ */
+const char special_chars[] = "{}(),;|=";
+
+
+/* FUNCTIONS
+ * ---------
+ */
+
+static int is_keyword(char *lexeme, follby *pfollowedby);
+
+
+/*
+ * keyword() - Return the keyword associated with token T_ identifier.
+ * See also token_name() for the string-ized T_ identifier.
+ * Example: keyword(T_Server) returns "server"
+ * token_name(T_Server) returns "T_Server"
+ */
+const char *
+keyword(
+ int token
+ )
+{
+ int i;
+ const char *text;
+
+ i = token - LOWEST_KEYWORD_ID;
+
+ if (i >= 0 && i < COUNTOF(keyword_text))
+ text = keyword_text[i];
+ else
+ text = NULL;
+
+ return (text != NULL)
+ ? text
+ : "(keyword not found)";
+}
+
+
+/* FILE INTERFACE
+ * --------------
+ * We define a couple of wrapper functions around the standard C fgetc
+ * and ungetc functions in order to include positional bookkeeping
+ */
+
+struct FILE_INFO *
+F_OPEN(
+ const char *path,
+ const char *mode
+ )
+{
+ struct FILE_INFO *my_info;
+
+ my_info = emalloc(sizeof *my_info);
+
+ my_info->line_no = 1;
+ my_info->col_no = 0;
+ my_info->prev_line_col_no = 0;
+ my_info->prev_token_col_no = 0;
+ my_info->fname = path;
+
+ my_info->fd = fopen(path, mode);
+ if (NULL == my_info->fd) {
+ free(my_info);
+ return NULL;
+ }
+ return my_info;
+}
+
+int
+FGETC(
+ struct FILE_INFO *stream
+ )
+{
+ int ch;
+
+ do
+ ch = fgetc(stream->fd);
+ while (EOF != ch && (CHAR_MIN > ch || ch > CHAR_MAX));
+
+ if (EOF != ch) {
+ if (input_from_file)
+ conf_file_sum += (u_char)ch;
+ ++stream->col_no;
+ if (ch == '\n') {
+ stream->prev_line_col_no = stream->col_no;
+ ++stream->line_no;
+ stream->col_no = 1;
+ }
+ }
+
+ return ch;
+}
+
+/* BUGS: 1. Function will fail on more than one line of pushback
+ * 2. No error checking is done to see if ungetc fails
+ * SK: I don't think its worth fixing these bugs for our purposes ;-)
+ */
+int
+UNGETC(
+ int ch,
+ struct FILE_INFO *stream
+ )
+{
+ if (input_from_file)
+ conf_file_sum -= (u_char)ch;
+ if (ch == '\n') {
+ stream->col_no = stream->prev_line_col_no;
+ stream->prev_line_col_no = -1;
+ --stream->line_no;
+ }
+ --stream->col_no;
+ return ungetc(ch, stream->fd);
+}
+
+int
+FCLOSE(
+ struct FILE_INFO *stream
+ )
+{
+ int ret_val = fclose(stream->fd);
+
+ if (!ret_val)
+ free(stream);
+ return ret_val;
+}
+
+/* STREAM INTERFACE
+ * ----------------
+ * Provide a wrapper for the stream functions so that the
+ * stream can either read from a file or from a character
+ * array.
+ * NOTE: This is not very efficient for reading from character
+ * arrays, but needed to allow remote configuration where the
+ * configuration command is provided through ntpq.
+ *
+ * The behavior of there two functions is determined by the
+ * input_from_file flag.
+ */
+
+static int
+get_next_char(
+ struct FILE_INFO *ip_file
+ )
+{
+ char ch;
+
+ if (input_from_file)
+ return FGETC(ip_file);
+ else {
+ if (remote_config.buffer[remote_config.pos] == '\0')
+ return EOF;
+ else {
+ ip_file->col_no++;
+ ch = remote_config.buffer[remote_config.pos++];
+ if (ch == '\n') {
+ ip_file->prev_line_col_no = ip_file->col_no;
+ ++ip_file->line_no;
+ ip_file->col_no = 1;
+ }
+ return ch;
+ }
+ }
+}
+
+static void
+push_back_char(
+ struct FILE_INFO *ip_file,
+ int ch
+ )
+{
+ if (input_from_file)
+ UNGETC(ch, ip_file);
+ else {
+ if (ch == '\n') {
+ ip_file->col_no = ip_file->prev_line_col_no;
+ ip_file->prev_line_col_no = -1;
+ --ip_file->line_no;
+ }
+ --ip_file->col_no;
+
+ remote_config.pos--;
+ }
+}
+
+
+
+/* STATE MACHINES
+ * --------------
+ */
+
+/* Keywords */
+static int
+is_keyword(
+ char *lexeme,
+ follby *pfollowedby
+ )
+{
+ follby fb;
+ int curr_s; /* current state index */
+ int token;
+ int i;
+
+ curr_s = SCANNER_INIT_S;
+ token = 0;
+
+ for (i = 0; lexeme[i]; i++) {
+ while (curr_s && (lexeme[i] != SS_CH(sst[curr_s])))
+ curr_s = SS_OTHER_N(sst[curr_s]);
+
+ if (curr_s && (lexeme[i] == SS_CH(sst[curr_s]))) {
+ if ('\0' == lexeme[i + 1]
+ && FOLLBY_NON_ACCEPTING
+ != SS_FB(sst[curr_s])) {
+ fb = SS_FB(sst[curr_s]);
+ *pfollowedby = fb;
+ token = curr_s;
+ break;
+ }
+ curr_s = SS_MATCH_N(sst[curr_s]);
+ } else
+ break;
+ }
+
+ return token;
+}
+
+
+/* Integer */
+static int
+is_integer(
+ char *lexeme
+ )
+{
+ int i;
+ int is_neg;
+ u_int u_val;
+
+ i = 0;
+
+ /* Allow a leading minus sign */
+ if (lexeme[i] == '-') {
+ i++;
+ is_neg = TRUE;
+ } else {
+ is_neg = FALSE;
+ }
+
+ /* Check that all the remaining characters are digits */
+ for (; lexeme[i] != '\0'; i++) {
+ if (!isdigit(lexeme[i]))
+ return FALSE;
+ }
+
+ if (is_neg)
+ return TRUE;
+
+ /* Reject numbers that fit in unsigned but not in signed int */
+ if (1 == sscanf(lexeme, "%u", &u_val))
+ return (u_val <= INT_MAX);
+ else
+ return FALSE;
+}
+
+
+/* U_int -- assumes is_integer() has returned FALSE */
+static int
+is_u_int(
+ char *lexeme
+ )
+{
+ int i;
+ int is_hex;
+
+ i = 0;
+ if ('0' == lexeme[i] && 'x' == tolower(lexeme[i + 1])) {
+ i += 2;
+ is_hex = TRUE;
+ } else {
+ is_hex = FALSE;
+ }
+
+ /* Check that all the remaining characters are digits */
+ for (; lexeme[i] != '\0'; i++) {
+ if (is_hex && !isxdigit(lexeme[i]))
+ return FALSE;
+ if (!is_hex && !isdigit(lexeme[i]))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/* Double */
+static int
+is_double(
+ char *lexeme
+ )
+{
+ u_int num_digits = 0; /* Number of digits read */
+ u_int i;
+
+ i = 0;
+
+ /* Check for an optional '+' or '-' */
+ if ('+' == lexeme[i] || '-' == lexeme[i])
+ i++;
+
+ /* Read the integer part */
+ for (; lexeme[i] && isdigit(lexeme[i]); i++)
+ num_digits++;
+
+ /* Check for the optional decimal point */
+ if ('.' == lexeme[i]) {
+ i++;
+ /* Check for any digits after the decimal point */
+ for (; lexeme[i] && isdigit(lexeme[i]); i++)
+ num_digits++;
+ }
+
+ /*
+ * The number of digits in both the decimal part and the
+ * fraction part must not be zero at this point
+ */
+ if (!num_digits)
+ return 0;
+
+ /* Check if we are done */
+ if (!lexeme[i])
+ return 1;
+
+ /* There is still more input, read the exponent */
+ if ('e' == tolower(lexeme[i]))
+ i++;
+ else
+ return 0;
+
+ /* Read an optional Sign */
+ if ('+' == lexeme[i] || '-' == lexeme[i])
+ i++;
+
+ /* Now read the exponent part */
+ while (lexeme[i] && isdigit(lexeme[i]))
+ i++;
+
+ /* Check if we are done */
+ if (!lexeme[i])
+ return 1;
+ else
+ return 0;
+}
+
+
+/* is_special() - Test whether a character is a token */
+static inline int
+is_special(
+ int ch
+ )
+{
+ return strchr(special_chars, ch) != NULL;
+}
+
+
+static int
+is_EOC(
+ int ch
+ )
+{
+ if ((old_config_style && (ch == '\n')) ||
+ (!old_config_style && (ch == ';')))
+ return 1;
+ return 0;
+}
+
+
+char *
+quote_if_needed(char *str)
+{
+ char *ret;
+ size_t len;
+ size_t octets;
+
+ len = strlen(str);
+ octets = len + 2 + 1;
+ ret = emalloc(octets);
+ if ('"' != str[0]
+ && (strcspn(str, special_chars) < len
+ || strchr(str, ' ') != NULL)) {
+ snprintf(ret, octets, "\"%s\"", str);
+ } else
+ strlcpy(ret, str, octets);
+
+ return ret;
+}
+
+
+static int
+create_string_token(
+ char *lexeme
+ )
+{
+ char *pch;
+
+ /*
+ * ignore end of line whitespace
+ */
+ pch = lexeme;
+ while (*pch && isspace(*pch))
+ pch++;
+
+ if (!*pch) {
+ yylval.Integer = T_EOC;
+ return yylval.Integer;
+ }
+
+ yylval.String = estrdup(lexeme);
+ return T_String;
+}
+
+
+/*
+ * yylex() - function that does the actual scanning.
+ * Bison expects this function to be called yylex and for it to take no
+ * input and return an int.
+ * Conceptually yylex "returns" yylval as well as the actual return
+ * value representing the token or type.
+ */
+int
+yylex(
+ struct FILE_INFO *ip_file
+ )
+{
+ static follby followedby = FOLLBY_TOKEN;
+ int i;
+ int instring;
+ int yylval_was_set;
+ int converted;
+ int token; /* The return value */
+ int ch;
+
+ if (input_from_file)
+ ip_file = fp[curr_include_level];
+ instring = FALSE;
+ yylval_was_set = FALSE;
+
+ do {
+ /* Ignore whitespace at the beginning */
+ while (EOF != (ch = get_next_char(ip_file)) &&
+ isspace(ch) &&
+ !is_EOC(ch))
+ ; /* Null Statement */
+
+ if (EOF == ch) {
+
+ if (!input_from_file || !curr_include_level)
+ return 0;
+
+ FCLOSE(fp[curr_include_level]);
+ ip_file = fp[--curr_include_level];
+ token = T_EOC;
+ goto normal_return;
+
+ } else if (is_EOC(ch)) {
+
+ /* end FOLLBY_STRINGS_TO_EOC effect */
+ followedby = FOLLBY_TOKEN;
+ token = T_EOC;
+ goto normal_return;
+
+ } else if (is_special(ch) && FOLLBY_TOKEN == followedby) {
+ /* special chars are their own token values */
+ token = ch;
+ /*
+ * '=' outside simulator configuration implies
+ * a single string following as in:
+ * setvar Owner = "The Boss" default
+ */
+ if ('=' == ch && old_config_style)
+ followedby = FOLLBY_STRING;
+ yytext[0] = (char)ch;
+ yytext[1] = '\0';
+ goto normal_return;
+ } else
+ push_back_char(ip_file, ch);
+
+ /* save the position of start of the token */
+ ip_file->prev_token_line_no = ip_file->line_no;
+ ip_file->prev_token_col_no = ip_file->col_no;
+
+ /* Read in the lexeme */
+ i = 0;
+ while (EOF != (ch = get_next_char(ip_file))) {
+
+ yytext[i] = (char)ch;
+
+ /* Break on whitespace or a special character */
+ if (isspace(ch) || is_EOC(ch)
+ || '"' == ch
+ || (FOLLBY_TOKEN == followedby
+ && is_special(ch)))
+ break;
+
+ /* Read the rest of the line on reading a start
+ of comment character */
+ if ('#' == ch) {
+ while (EOF != (ch = get_next_char(ip_file))
+ && '\n' != ch)
+ ; /* Null Statement */
+ break;
+ }
+
+ i++;
+ if (i >= COUNTOF(yytext))
+ goto lex_too_long;
+ }
+ /* Pick up all of the string inside between " marks, to
+ * end of line. If we make it to EOL without a
+ * terminating " assume it for them.
+ *
+ * XXX - HMS: I'm not sure we want to assume the closing "
+ */
+ if ('"' == ch) {
+ instring = TRUE;
+ while (EOF != (ch = get_next_char(ip_file)) &&
+ ch != '"' && ch != '\n') {
+ yytext[i++] = (char)ch;
+ if (i >= COUNTOF(yytext))
+ goto lex_too_long;
+ }
+ /*
+ * yytext[i] will be pushed back as not part of
+ * this lexeme, but any closing quote should
+ * not be pushed back, so we read another char.
+ */
+ if ('"' == ch)
+ ch = get_next_char(ip_file);
+ }
+ /* Pushback the last character read that is not a part
+ * of this lexeme.
+ * If the last character read was an EOF, pushback a
+ * newline character. This is to prevent a parse error
+ * when there is no newline at the end of a file.
+ */
+ if (EOF == ch)
+ push_back_char(ip_file, '\n');
+ else
+ push_back_char(ip_file, ch);
+ yytext[i] = '\0';
+ } while (i == 0);
+
+ /* Now return the desired token */
+
+ /* First make sure that the parser is *not* expecting a string
+ * as the next token (based on the previous token that was
+ * returned) and that we haven't read a string.
+ */
+
+ if (followedby == FOLLBY_TOKEN && !instring) {
+ token = is_keyword(yytext, &followedby);
+ if (token) {
+ /*
+ * T_Server is exceptional as it forces the
+ * following token to be a string in the
+ * non-simulator parts of the configuration,
+ * but in the simulator configuration section,
+ * "server" is followed by "=" which must be
+ * recognized as a token not a string.
+ */
+ if (T_Server == token && !old_config_style)
+ followedby = FOLLBY_TOKEN;
+ goto normal_return;
+ } else if (is_integer(yytext)) {
+ yylval_was_set = TRUE;
+ errno = 0;
+ if ((yylval.Integer = strtol(yytext, NULL, 10)) == 0
+ && ((errno == EINVAL) || (errno == ERANGE))) {
+ msyslog(LOG_ERR,
+ "Integer cannot be represented: %s",
+ yytext);
+ if (input_from_file) {
+ exit(1);
+ } else {
+ /* force end of parsing */
+ yylval.Integer = 0;
+ return 0;
+ }
+ }
+ token = T_Integer;
+ goto normal_return;
+ } else if (is_u_int(yytext)) {
+ yylval_was_set = TRUE;
+ if ('0' == yytext[0] &&
+ 'x' == tolower(yytext[1]))
+ converted = sscanf(&yytext[2], "%x",
+ &yylval.U_int);
+ else
+ converted = sscanf(yytext, "%u",
+ &yylval.U_int);
+ if (1 != converted) {
+ msyslog(LOG_ERR,
+ "U_int cannot be represented: %s",
+ yytext);
+ if (input_from_file) {
+ exit(1);
+ } else {
+ /* force end of parsing */
+ yylval.Integer = 0;
+ return 0;
+ }
+ }
+ token = T_U_int;
+ goto normal_return;
+ } else if (is_double(yytext)) {
+ yylval_was_set = TRUE;
+ errno = 0;
+ if ((yylval.Double = atof(yytext)) == 0 && errno == ERANGE) {
+ msyslog(LOG_ERR,
+ "Double too large to represent: %s",
+ yytext);
+ exit(1);
+ } else {
+ token = T_Double;
+ goto normal_return;
+ }
+ } else {
+ /* Default: Everything is a string */
+ yylval_was_set = TRUE;
+ token = create_string_token(yytext);
+ goto normal_return;
+ }
+ }
+
+ /*
+ * Either followedby is not FOLLBY_TOKEN or this lexeme is part
+ * of a string. Hence, we need to return T_String.
+ *
+ * _Except_ we might have a -4 or -6 flag on a an association
+ * configuration line (server, peer, pool, etc.).
+ *
+ * This is a terrible hack, but the grammar is ambiguous so we
+ * don't have a choice. [SK]
+ *
+ * The ambiguity is in the keyword scanner, not ntp_parser.y.
+ * We do not require server addresses be quoted in ntp.conf,
+ * complicating the scanner's job. To avoid trying (and
+ * failing) to match an IP address or DNS name to a keyword,
+ * the association keywords use FOLLBY_STRING in the keyword
+ * table, which tells the scanner to force the next token to be
+ * a T_String, so it does not try to match a keyword but rather
+ * expects a string when -4/-6 modifiers to server, peer, etc.
+ * are encountered.
+ * restrict -4 and restrict -6 parsing works correctly without
+ * this hack, as restrict uses FOLLBY_TOKEN. [DH]
+ */
+ if ('-' == yytext[0]) {
+ if ('4' == yytext[1]) {
+ token = T_Ipv4_flag;
+ goto normal_return;
+ } else if ('6' == yytext[1]) {
+ token = T_Ipv6_flag;
+ goto normal_return;
+ }
+ }
+
+ instring = FALSE;
+ if (FOLLBY_STRING == followedby)
+ followedby = FOLLBY_TOKEN;
+
+ yylval_was_set = TRUE;
+ token = create_string_token(yytext);
+
+normal_return:
+ if (T_EOC == token)
+ DPRINTF(4,("\t<end of command>\n"));
+ else
+ DPRINTF(4, ("yylex: lexeme '%s' -> %s\n", yytext,
+ token_name(token)));
+
+ if (!yylval_was_set)
+ yylval.Integer = token;
+
+ return token;
+
+lex_too_long:
+ yytext[min(sizeof(yytext) - 1, 50)] = 0;
+ msyslog(LOG_ERR,
+ "configuration item on line %d longer than limit of %lu, began with '%s'",
+ ip_file->line_no, (u_long)min(sizeof(yytext) - 1, 50),
+ yytext);
+
+ /*
+ * If we hit the length limit reading the startup configuration
+ * file, abort.
+ */
+ if (input_from_file)
+ exit(sizeof(yytext) - 1);
+
+ /*
+ * If it's runtime configuration via ntpq :config treat it as
+ * if the configuration text ended before the too-long lexeme,
+ * hostname, or string.
+ */
+ yylval.Integer = 0;
+ return 0;
+}
diff --git a/ntpd/ntp_scanner.h b/ntpd/ntp_scanner.h
new file mode 100644
index 0000000..6797637
--- /dev/null
+++ b/ntpd/ntp_scanner.h
@@ -0,0 +1,130 @@
+/* ntp_scanner.h
+ *
+ * The header file for a simple lexical analyzer.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Copyright (c) 2006
+ */
+
+#ifndef NTP_SCANNER_H
+#define NTP_SCANNER_H
+
+#include "ntp_config.h"
+
+/*
+ * ntp.conf syntax is slightly irregular in that some tokens such as
+ * hostnames do not require quoting even if they might otherwise be
+ * recognized as T_ terminal tokens. This hand-crafted lexical scanner
+ * uses a "followed by" value associated with each keyword to indicate
+ * normal scanning of the next token, forced scanning of the next token
+ * alone as a T_String, or forced scanning of all tokens to the end of
+ * the command as T_String.
+ * In the past the identifiers for this functionality ended in _ARG:
+ *
+ * NO_ARG -> FOLLBY_TOKEN
+ * SINGLE_ARG -> FOLLBY_STRING
+ * MULTIPLE_ARG -> FOLLBY_STRINGS_TO_EOC
+ *
+ * Note that some tokens use FOLLBY_TOKEN even though they sometimes
+ * are followed by strings. FOLLBY_STRING is used only when needed to
+ * avoid the keyword scanner matching a token where a string is needed.
+ *
+ * FOLLBY_NON_ACCEPT is an overloading of this field to distinguish
+ * non-accepting states (where the state number does not match a T_
+ * value).
+ */
+typedef enum {
+ FOLLBY_TOKEN = 0,
+ FOLLBY_STRING,
+ FOLLBY_STRINGS_TO_EOC,
+ FOLLBY_NON_ACCEPTING
+} follby;
+
+#define MAXLINE 1024 /* maximum length of line */
+#define MAXINCLUDELEVEL 5 /* maximum include file levels */
+
+/* STRUCTURES
+ * ----------
+ */
+
+/*
+ * Define a structure to hold the FSA for the keywords.
+ * The structure is actually a trie.
+ *
+ * To save space, a single u_int32 encodes four fields, and a fifth
+ * (the token completed for terminal states) is implied by the index of
+ * the rule within the scan state array, taking advantage of the fact
+ * there are more scan states than the highest T_ token number.
+ *
+ * The lowest 8 bits hold the character the state matches on.
+ * Bits 8 and 9 hold the followedby value (0 - 3). For non-accepting
+ * states (which do not match a completed token) the followedby
+ * value 3 (FOLLBY_NONACCEPTING) denotes that fact. For accepting
+ * states, values 0 - 2 control whether the scanner forces the
+ * following token(s) to strings.
+ * Bits 10 through 20 hold the next state to check not matching
+ * this state's character.
+ * Bits 21 through 31 hold the next state to check matching the char.
+ */
+
+#define S_ST(ch, fb, match_n, other_n) ( \
+ (u_char)((ch) & 0xff) | \
+ ((u_int32)(fb) << 8) | \
+ ((u_int32)(match_n) << 10) | \
+ ((u_int32)(other_n) << 21) \
+)
+
+#define SS_CH(ss) ((char)(u_char)((ss) & 0xff))
+#define SS_FB(ss) (((u_int)(ss) >> 8) & 0x3)
+#define SS_MATCH_N(ss) (((u_int)(ss) >> 10) & 0x7ff)
+#define SS_OTHER_N(ss) (((u_int)(ss) >> 21) & 0x7ff)
+
+typedef u_int32 scan_state;
+
+
+/* Structure to hold a filename, file pointer and positional info */
+struct FILE_INFO {
+ const char * fname; /* Path to the file */
+ FILE * fd; /* File Descriptor */
+ int line_no; /* Line Number */
+ int col_no; /* Column Number */
+ int prev_line_col_no; /* Col No on the
+ previous line when a
+ '\n' was seen */
+ int prev_token_line_no; /* Line at start of
+ token */
+ int prev_token_col_no; /* Col No at start of
+ token */
+ int err_line_no;
+ int err_col_no;
+};
+
+
+/* SCANNER GLOBAL VARIABLES
+ * ------------------------
+ */
+extern config_tree cfgt; /* Parser output stored here */
+extern int curr_include_level; /* The current include level */
+
+/* VARIOUS EXTERNAL DECLARATIONS
+ * -----------------------------
+ */
+extern int old_config_style;
+extern int input_from_file;
+extern struct FILE_INFO *fp[];
+
+/* VARIOUS SUBROUTINE DECLARATIONS
+ * -------------------------------
+ */
+extern const char *keyword(int token);
+extern char *quote_if_needed(char *str);
+int yylex(struct FILE_INFO *);
+
+struct FILE_INFO *F_OPEN(const char *path, const char *mode);
+int FGETC(struct FILE_INFO *stream);
+int UNGETC(int ch, struct FILE_INFO *stream);
+int FCLOSE(struct FILE_INFO *stream);
+
+#endif /* NTP_SCANNER_H */
diff --git a/ntpd/ntp_signd.c b/ntpd/ntp_signd.c
new file mode 100644
index 0000000..2ba11d0
--- /dev/null
+++ b/ntpd/ntp_signd.c
@@ -0,0 +1,239 @@
+/* Copyright 2008, Red Hat, Inc.
+ Copyright 2008, Andrew Tridgell.
+ Licenced under the same terms as NTP itself.
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_NTP_SIGND
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "ntp_control.h"
+#include "ntp_string.h"
+
+#include <stdio.h>
+#include <stddef.h>
+#ifdef HAVE_LIBSCF_H
+#include <libscf.h>
+#include <unistd.h>
+#endif /* HAVE_LIBSCF_H */
+
+#include <sys/un.h>
+
+/* socket routines by tridge - from junkcode.samba.org */
+
+/*
+ connect to a unix domain socket
+*/
+static int
+ux_socket_connect(const char *name)
+{
+ int fd;
+ struct sockaddr_un addr;
+ if (!name) {
+ return -1;
+ }
+
+ ZERO(addr);
+ addr.sun_family = AF_UNIX;
+ strlcpy(addr.sun_path, name, sizeof(addr.sun_path));
+
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd == -1) {
+ return -1;
+ }
+
+ if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
+ close(fd);
+ return -1;
+ }
+
+ return fd;
+}
+
+
+/*
+ keep writing until its all sent
+*/
+static int
+write_all(int fd, const void *buf, size_t len)
+{
+ size_t total = 0;
+ while (len) {
+ int n = write(fd, buf, len);
+ if (n <= 0) return total;
+ buf = n + (char *)buf;
+ len -= n;
+ total += n;
+ }
+ return total;
+}
+
+/*
+ keep reading until its all read
+*/
+static int
+read_all(int fd, void *buf, size_t len)
+{
+ size_t total = 0;
+ while (len) {
+ int n = read(fd, buf, len);
+ if (n <= 0) return total;
+ buf = n + (char *)buf;
+ len -= n;
+ total += n;
+ }
+ return total;
+}
+
+/*
+ send a packet in length prefix format
+*/
+static int
+send_packet(int fd, const char *buf, uint32_t len)
+{
+ uint32_t net_len = htonl(len);
+ if (write_all(fd, &net_len, sizeof(net_len)) != sizeof(net_len)) return -1;
+ if (write_all(fd, buf, len) != len) return -1;
+ return 0;
+}
+
+/*
+ receive a packet in length prefix format
+*/
+static int
+recv_packet(int fd, char **buf, uint32_t *len)
+{
+ if (read_all(fd, len, sizeof(*len)) != sizeof(*len)) return -1;
+ *len = ntohl(*len);
+ (*buf) = emalloc(*len);
+ if (read_all(fd, *buf, *len) != *len) {
+ free(*buf);
+ return -1;
+ }
+ return 0;
+}
+
+void
+send_via_ntp_signd(
+ struct recvbuf *rbufp, /* receive packet pointer */
+ int xmode,
+ keyid_t xkeyid,
+ int flags,
+ struct pkt *xpkt
+ )
+{
+
+ /* We are here because it was detected that the client
+ * sent an all-zero signature, and we therefore know
+ * it's windows trying to talk to an AD server
+ *
+ * Because we don't want to dive into Samba's secrets
+ * database just to find the long-term kerberos key
+ * that is re-used as the NTP key, we instead hand the
+ * packet over to Samba to sign, and return to us.
+ *
+ * The signing method Samba will use is described by
+ * Microsoft in MS-SNTP, found here:
+ * http://msdn.microsoft.com/en-us/library/cc212930.aspx
+ */
+
+ int fd, sendlen;
+ struct samba_key_in {
+ uint32_t version;
+ uint32_t op;
+ uint32_t packet_id;
+ uint32_t key_id_le;
+ struct pkt pkt;
+ } samba_pkt;
+
+ struct samba_key_out {
+ uint32_t version;
+ uint32_t op;
+ uint32_t packet_id;
+ struct pkt pkt;
+ } samba_reply;
+
+ char full_socket[256];
+
+ char *reply = NULL;
+ uint32_t reply_len;
+
+ ZERO(samba_pkt);
+ samba_pkt.op = 0; /* Sign message */
+ /* This will be echoed into the reply - a different
+ * impelementation might want multiple packets
+ * awaiting signing */
+
+ samba_pkt.packet_id = 1;
+
+ /* Swap the byte order back - it's actually little
+ * endian on the wire, but it was read above as
+ * network byte order */
+ samba_pkt.key_id_le = htonl(xkeyid);
+ samba_pkt.pkt = *xpkt;
+
+ snprintf(full_socket, sizeof(full_socket), "%s/socket", ntp_signd_socket);
+
+ fd = ux_socket_connect(full_socket);
+ /* Only continue with this if we can talk to Samba */
+ if (fd != -1) {
+ /* Send old packet to Samba, expect response */
+ /* Packet to Samba is quite simple:
+ All values BIG endian except key ID as noted
+ [packet size as BE] - 4 bytes
+ [protocol version (0)] - 4 bytes
+ [packet ID] - 4 bytes
+ [operation (sign message=0)] - 4 bytes
+ [key id] - LITTLE endian (as on wire) - 4 bytes
+ [message to sign] - as marshalled, without signature
+ */
+
+ if (send_packet(fd, (char *)&samba_pkt, offsetof(struct samba_key_in, pkt) + LEN_PKT_NOMAC) != 0) {
+ /* Huh? could not talk to Samba... */
+ close(fd);
+ return;
+ }
+
+ if (recv_packet(fd, &reply, &reply_len) != 0) {
+ if (reply) {
+ free(reply);
+ }
+ close(fd);
+ return;
+ }
+ /* Return packet is also simple:
+ [packet size] - network byte order - 4 bytes
+ [protocol version (0)] network byte order - - 4 bytes
+ [operation (signed success=3, failure=4)] network byte order - - 4 byte
+ (optional) [signed message] - as provided before, with signature appended
+ */
+
+ if (reply_len <= sizeof(samba_reply)) {
+ memcpy(&samba_reply, reply, reply_len);
+ if (ntohl(samba_reply.op) == 3 && reply_len > offsetof(struct samba_key_out, pkt)) {
+ sendlen = reply_len - offsetof(struct samba_key_out, pkt);
+ xpkt = &samba_reply.pkt;
+ sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, 0, xpkt, sendlen);
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "transmit ntp_signd packet: at %ld %s->%s mode %d keyid %08x len %d\n",
+ current_time, ntoa(&rbufp->dstadr->sin),
+ ntoa(&rbufp->recv_srcadr), xmode, xkeyid, sendlen);
+#endif
+ }
+ }
+
+ if (reply) {
+ free(reply);
+ }
+ close(fd);
+
+ }
+}
+#endif
diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c
new file mode 100644
index 0000000..958c8db
--- /dev/null
+++ b/ntpd/ntp_timer.c
@@ -0,0 +1,570 @@
+/*
+ * ntp_timer.c - event timer support routines
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_machine.h"
+#include "ntpd.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "ntp_leapsec.h"
+
+#if defined(HAVE_IO_COMPLETION_PORT)
+# include "ntp_iocompletionport.h"
+# include "ntp_timer.h"
+#endif
+
+#include <stdio.h>
+#include <signal.h>
+#ifdef HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef KERNEL_PLL
+#include "ntp_syscall.h"
+#endif /* KERNEL_PLL */
+
+#ifdef AUTOKEY
+#include <openssl/rand.h>
+#endif /* AUTOKEY */
+
+
+/* TC_ERR represents the timer_create() error return value. */
+#ifdef SYS_VXWORKS
+#define TC_ERR ERROR
+#else
+#define TC_ERR (-1)
+#endif
+
+static void check_leapsec(u_int32, const time_t*, int/*BOOL*/);
+
+/*
+ * These routines provide support for the event timer. The timer is
+ * implemented by an interrupt routine which sets a flag once every
+ * second, and a timer routine which is called when the mainline code
+ * gets around to seeing the flag. The timer routine dispatches the
+ * clock adjustment code if its time has come, then searches the timer
+ * queue for expiries which are dispatched to the transmit procedure.
+ * Finally, we call the hourly procedure to do cleanup and print a
+ * message.
+ */
+volatile int interface_interval; /* init_io() sets def. 300s */
+
+/*
+ * Alarm flag. The mainline code imports this.
+ */
+volatile int alarm_flag;
+
+/*
+ * The counters and timeouts
+ */
+static u_long interface_timer; /* interface update timer */
+static u_long adjust_timer; /* second timer */
+static u_long stats_timer; /* stats timer */
+static u_long leapf_timer; /* Report leapfile problems once/day */
+static u_long huffpuff_timer; /* huff-n'-puff timer */
+static u_long worker_idle_timer;/* next check for idle intres */
+u_long leapsec; /* seconds to next leap (proximity class) */
+int leapdif; /* TAI difference step at next leap second*/
+u_long orphwait; /* orphan wait time */
+#ifdef AUTOKEY
+static u_long revoke_timer; /* keys revoke timer */
+static u_long keys_timer; /* session key timer */
+u_long sys_revoke = KEY_REVOKE; /* keys revoke timeout (log2 s) */
+u_long sys_automax = NTP_AUTOMAX; /* key list timeout (log2 s) */
+#endif /* AUTOKEY */
+
+/*
+ * Statistics counter for the interested.
+ */
+volatile u_long alarm_overflow;
+
+u_long current_time; /* seconds since startup */
+
+/*
+ * Stats. Number of overflows and number of calls to transmit().
+ */
+u_long timer_timereset;
+u_long timer_overflows;
+u_long timer_xmtcalls;
+
+#if defined(VMS)
+static int vmstimer[2]; /* time for next timer AST */
+static int vmsinc[2]; /* timer increment */
+#endif /* VMS */
+
+#ifdef SYS_WINNT
+HANDLE WaitableTimerHandle;
+#else
+static RETSIGTYPE alarming (int);
+#endif /* SYS_WINNT */
+
+#if !defined(VMS)
+# if !defined SYS_WINNT || defined(SYS_CYGWIN32)
+# ifdef HAVE_TIMER_CREATE
+static timer_t timer_id;
+typedef struct itimerspec intervaltimer;
+# define itv_frac tv_nsec
+# else
+typedef struct itimerval intervaltimer;
+# define itv_frac tv_usec
+# endif
+intervaltimer itimer;
+# endif
+#endif
+
+#if !defined(SYS_WINNT) && !defined(VMS)
+void set_timer_or_die(const intervaltimer *);
+#endif
+
+
+#if !defined(SYS_WINNT) && !defined(VMS)
+void
+set_timer_or_die(
+ const intervaltimer * ptimer
+ )
+{
+ const char * setfunc;
+ int rc;
+
+# ifdef HAVE_TIMER_CREATE
+ setfunc = "timer_settime";
+ rc = timer_settime(timer_id, 0, &itimer, NULL);
+# else
+ setfunc = "setitimer";
+ rc = setitimer(ITIMER_REAL, &itimer, NULL);
+# endif
+ if (-1 == rc) {
+ msyslog(LOG_ERR, "interval timer %s failed, %m",
+ setfunc);
+ exit(1);
+ }
+}
+#endif /* !SYS_WINNT && !VMS */
+
+
+/*
+ * reinit_timer - reinitialize interval timer after a clock step.
+ */
+void
+reinit_timer(void)
+{
+#if !defined(SYS_WINNT) && !defined(VMS)
+ ZERO(itimer);
+# ifdef HAVE_TIMER_CREATE
+ timer_gettime(timer_id, &itimer);
+# else
+ getitimer(ITIMER_REAL, &itimer);
+# endif
+ if (itimer.it_value.tv_sec < 0 ||
+ itimer.it_value.tv_sec > (1 << EVENT_TIMEOUT))
+ itimer.it_value.tv_sec = (1 << EVENT_TIMEOUT);
+ if (itimer.it_value.itv_frac < 0)
+ itimer.it_value.itv_frac = 0;
+ if (0 == itimer.it_value.tv_sec &&
+ 0 == itimer.it_value.itv_frac)
+ itimer.it_value.tv_sec = (1 << EVENT_TIMEOUT);
+ itimer.it_interval.tv_sec = (1 << EVENT_TIMEOUT);
+ itimer.it_interval.itv_frac = 0;
+ set_timer_or_die(&itimer);
+# endif /* VMS */
+}
+
+
+/*
+ * init_timer - initialize the timer data structures
+ */
+void
+init_timer(void)
+{
+ /*
+ * Initialize...
+ */
+ alarm_flag = FALSE;
+ alarm_overflow = 0;
+ adjust_timer = 1;
+ stats_timer = SECSPERHR;
+ leapf_timer = SECSPERDAY;
+ huffpuff_timer = 0;
+ interface_timer = 0;
+ current_time = 0;
+ timer_overflows = 0;
+ timer_xmtcalls = 0;
+ timer_timereset = 0;
+
+#ifndef SYS_WINNT
+ /*
+ * Set up the alarm interrupt. The first comes 2**EVENT_TIMEOUT
+ * seconds from now and they continue on every 2**EVENT_TIMEOUT
+ * seconds.
+ */
+# ifndef VMS
+# ifdef HAVE_TIMER_CREATE
+ if (TC_ERR == timer_create(CLOCK_REALTIME, NULL, &timer_id)) {
+ msyslog(LOG_ERR, "timer_create failed, %m");
+ exit(1);
+ }
+# endif
+ signal_no_reset(SIGALRM, alarming);
+ itimer.it_interval.tv_sec =
+ itimer.it_value.tv_sec = (1 << EVENT_TIMEOUT);
+ itimer.it_interval.itv_frac = itimer.it_value.itv_frac = 0;
+ set_timer_or_die(&itimer);
+# else /* VMS follows */
+ vmsinc[0] = 10000000; /* 1 sec */
+ vmsinc[1] = 0;
+ lib$emul(&(1<<EVENT_TIMEOUT), &vmsinc, &0, &vmsinc);
+
+ sys$gettim(&vmstimer); /* that's "now" as abstime */
+
+ lib$addx(&vmsinc, &vmstimer, &vmstimer);
+ sys$setimr(0, &vmstimer, alarming, alarming, 0);
+# endif /* VMS */
+#else /* SYS_WINNT follows */
+ /*
+ * Set up timer interrupts for every 2**EVENT_TIMEOUT seconds
+ * Under Windows/NT,
+ */
+
+ WaitableTimerHandle = CreateWaitableTimer(NULL, FALSE, NULL);
+ if (WaitableTimerHandle == NULL) {
+ msyslog(LOG_ERR, "CreateWaitableTimer failed: %m");
+ exit(1);
+ }
+ else {
+ DWORD Period;
+ LARGE_INTEGER DueTime;
+ BOOL rc;
+
+ Period = (1 << EVENT_TIMEOUT) * 1000;
+ DueTime.QuadPart = Period * 10000i64;
+ rc = SetWaitableTimer(WaitableTimerHandle, &DueTime,
+ Period, NULL, NULL, FALSE);
+ if (!rc) {
+ msyslog(LOG_ERR, "SetWaitableTimer failed: %m");
+ exit(1);
+ }
+ }
+
+#endif /* SYS_WINNT */
+}
+
+
+/*
+ * intres_timeout_req(s) is invoked in the parent to schedule an idle
+ * timeout to fire in s seconds, if not reset earlier by a call to
+ * intres_timeout_req(0), which clears any pending timeout. When the
+ * timeout expires, worker_idle_timer_fired() is invoked (again, in the
+ * parent).
+ *
+ * sntp and ntpd each provide implementations adapted to their timers.
+ */
+void
+intres_timeout_req(
+ u_int seconds /* 0 cancels */
+ )
+{
+ if (0 == seconds) {
+ worker_idle_timer = 0;
+ return;
+ }
+ worker_idle_timer = current_time + seconds;
+}
+
+
+/*
+ * timer - event timer
+ */
+void
+timer(void)
+{
+ struct peer * p;
+ struct peer * next_peer;
+ l_fp now;
+ time_t tnow;
+
+ /*
+ * The basic timerevent is one second. This is used to adjust the
+ * system clock in time and frequency, implement the kiss-o'-death
+ * function and the association polling function.
+ */
+ current_time++;
+ if (adjust_timer <= current_time) {
+ adjust_timer += 1;
+ adj_host_clock();
+#ifdef REFCLOCK
+ for (p = peer_list; p != NULL; p = next_peer) {
+ next_peer = p->p_link;
+ if (FLAG_REFCLOCK & p->flags)
+ refclock_timer(p);
+ }
+#endif /* REFCLOCK */
+ }
+
+ /*
+ * Now dispatch any peers whose event timer has expired. Be
+ * careful here, since the peer structure might go away as the
+ * result of the call.
+ */
+ for (p = peer_list; p != NULL; p = next_peer) {
+ next_peer = p->p_link;
+
+ /*
+ * Restrain the non-burst packet rate not more
+ * than one packet every 16 seconds. This is
+ * usually tripped using iburst and minpoll of
+ * 128 s or less.
+ */
+ if (p->throttle > 0)
+ p->throttle--;
+ if (p->nextdate <= current_time) {
+#ifdef REFCLOCK
+ if (FLAG_REFCLOCK & p->flags)
+ refclock_transmit(p);
+ else
+#endif /* REFCLOCK */
+ transmit(p);
+ }
+ }
+
+ /*
+ * Orphan mode is active when enabled and when no servers less
+ * than the orphan stratum are available. A server with no other
+ * synchronization source is an orphan. It shows offset zero and
+ * reference ID the loopback address.
+ */
+ if (sys_orphan < STRATUM_UNSPEC && sys_peer == NULL &&
+ current_time > orphwait) {
+ if (sys_leap == LEAP_NOTINSYNC) {
+ sys_leap = LEAP_NOWARNING;
+#ifdef AUTOKEY
+ if (crypto_flags)
+ crypto_update();
+#endif /* AUTOKEY */
+ }
+ sys_stratum = (u_char)sys_orphan;
+ if (sys_stratum > 1)
+ sys_refid = htonl(LOOPBACKADR);
+ else
+ memcpy(&sys_refid, "LOOP", 4);
+ sys_offset = 0;
+ sys_rootdelay = 0;
+ sys_rootdisp = 0;
+ }
+
+ get_systime(&now);
+ time(&tnow);
+
+ /*
+ * Leapseconds. Get time and defer to worker if either something
+ * is imminent or every 8th second.
+ */
+ if (leapsec > LSPROX_NOWARN || 0 == (current_time & 7))
+ check_leapsec(now.l_ui, &tnow,
+ (sys_leap == LEAP_NOTINSYNC));
+ if (sys_leap != LEAP_NOTINSYNC) {
+ if (leapsec >= LSPROX_ANNOUNCE && leapdif) {
+ if (leapdif > 0)
+ sys_leap = LEAP_ADDSECOND;
+ else
+ sys_leap = LEAP_DELSECOND;
+ } else {
+ sys_leap = LEAP_NOWARNING;
+ }
+ }
+
+ /*
+ * Update huff-n'-puff filter.
+ */
+ if (huffpuff_timer <= current_time) {
+ huffpuff_timer += HUFFPUFF;
+ huffpuff();
+ }
+
+#ifdef AUTOKEY
+ /*
+ * Garbage collect expired keys.
+ */
+ if (keys_timer <= current_time) {
+ keys_timer += 1 << sys_automax;
+ auth_agekeys();
+ }
+
+ /*
+ * Generate new private value. This causes all associations
+ * to regenerate cookies.
+ */
+ if (revoke_timer && revoke_timer <= current_time) {
+ revoke_timer += 1 << sys_revoke;
+ RAND_bytes((u_char *)&sys_private, 4);
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Interface update timer
+ */
+ if (interface_interval && interface_timer <= current_time) {
+ timer_interfacetimeout(current_time +
+ interface_interval);
+ DPRINTF(2, ("timer: interface update\n"));
+ interface_update(NULL, NULL);
+ }
+
+ if (worker_idle_timer && worker_idle_timer <= current_time)
+ worker_idle_timer_fired();
+
+ /*
+ * Finally, write hourly stats and do the hourly
+ * and daily leapfile checks.
+ */
+ if (stats_timer <= current_time) {
+ stats_timer += SECSPERHR;
+ write_stats();
+ if (leapf_timer <= current_time) {
+ leapf_timer += SECSPERDAY;
+ check_leap_file(TRUE, now.l_ui, &tnow);
+ } else {
+ check_leap_file(FALSE, now.l_ui, &tnow);
+ }
+ }
+}
+
+
+#ifndef SYS_WINNT
+/*
+ * alarming - tell the world we've been alarmed
+ */
+static RETSIGTYPE
+alarming(
+ int sig
+ )
+{
+# ifdef DEBUG
+ const char *msg = "alarming: initializing TRUE\n";
+# endif
+
+ if (!initializing) {
+ if (alarm_flag) {
+ alarm_overflow++;
+# ifdef DEBUG
+ msg = "alarming: overflow\n";
+# endif
+ } else {
+# ifndef VMS
+ alarm_flag++;
+# else
+ /* VMS AST routine, increment is no good */
+ alarm_flag = 1;
+# endif
+# ifdef DEBUG
+ msg = "alarming: normal\n";
+# endif
+ }
+ }
+# ifdef VMS
+ lib$addx(&vmsinc, &vmstimer, &vmstimer);
+ sys$setimr(0, &vmstimer, alarming, alarming, 0);
+# endif
+# ifdef DEBUG
+ if (debug >= 4)
+ write(1, msg, strlen(msg));
+# endif
+}
+#endif /* SYS_WINNT */
+
+
+void
+timer_interfacetimeout(u_long timeout)
+{
+ interface_timer = timeout;
+}
+
+
+/*
+ * timer_clr_stats - clear timer module stat counters
+ */
+void
+timer_clr_stats(void)
+{
+ timer_overflows = 0;
+ timer_xmtcalls = 0;
+ timer_timereset = current_time;
+}
+
+static void
+check_leapsec(
+ u_int32 now ,
+ const time_t * tpiv ,
+ int/*BOOL*/ reset)
+{
+ leap_result_t lsdata;
+ u_int32 lsprox;
+
+#ifndef SYS_WINNT /* WinNT port has its own leap second handling */
+# ifdef KERNEL_PLL
+ leapsec_electric(pll_control && kern_enable);
+# else
+ leapsec_electric(0);
+# endif
+#endif
+ if (reset) {
+ lsprox = LSPROX_NOWARN;
+ leapsec_reset_frame();
+ memset(&lsdata, 0, sizeof(lsdata));
+ } else if (leapsec_query(&lsdata, now, tpiv)) {
+ /* Full hit. Eventually step the clock, but always
+ * announce the leap event has happened.
+ */
+ if (lsdata.warped < 0) {
+ step_systime(lsdata.warped);
+ msyslog(LOG_NOTICE, "Inserting positive leap second.");
+ } else if (lsdata.warped > 0) {
+ step_systime(lsdata.warped);
+ msyslog(LOG_NOTICE, "Inserting negative leap second.");
+ }
+ report_event(EVNT_LEAP, NULL, NULL);
+ lsprox = LSPROX_NOWARN;
+ leapsec = LSPROX_NOWARN;
+ sys_tai = lsdata.tai_offs;
+ } else {
+ lsprox = lsdata.proximity;
+ sys_tai = lsdata.tai_offs;
+ }
+
+ /* We guard against panic alarming during the red alert phase.
+ * Strange and evil things might happen if we go from stone cold
+ * to piping hot in one step. If things are already that wobbly,
+ * we let the normal clock correction take over, even if a jump
+ * is involved.
+ * Also make sure the alarming events are edge-triggered, that is,
+ * ceated only when the threshold is crossed.
+ */
+ if ( (leapsec > 0 || lsprox < LSPROX_ALERT)
+ && leapsec < lsprox ) {
+ if ( leapsec < LSPROX_SCHEDULE
+ && lsprox >= LSPROX_SCHEDULE) {
+ if (lsdata.dynamic)
+ report_event(PEVNT_ARMED, sys_peer, NULL);
+ else
+ report_event(EVNT_ARMED, NULL, NULL);
+ }
+ leapsec = lsprox;
+ }
+ if (leapsec > lsprox) {
+ if ( leapsec >= LSPROX_SCHEDULE
+ && lsprox < LSPROX_SCHEDULE) {
+ report_event(EVNT_DISARMED, NULL, NULL);
+ }
+ leapsec = lsprox;
+ }
+
+ if (leapsec >= LSPROX_SCHEDULE)
+ leapdif = lsdata.tai_diff;
+ else
+ leapdif = 0;
+}
diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c
new file mode 100644
index 0000000..a7da52b
--- /dev/null
+++ b/ntpd/ntp_util.c
@@ -0,0 +1,1031 @@
+/*
+ * ntp_util.c - stuff I didn't have any other place for
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_unixtime.h"
+#include "ntp_filegen.h"
+#include "ntp_if.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+#include "ntp_calendar.h"
+#include "ntp_leapsec.h"
+#include "lib_strbuf.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <sys/stat.h>
+
+#ifdef HAVE_IEEEFP_H
+# include <ieeefp.h>
+#endif
+#ifdef HAVE_MATH_H
+# include <math.h>
+#endif
+
+#if defined(VMS)
+# include <descrip.h>
+#endif /* VMS */
+
+/*
+ * Defines used by the leapseconds stuff
+ */
+#define MAX_TAI 100 /* max TAI offset (s) */
+#define L_DAY 86400UL /* seconds per day */
+#define L_YEAR (L_DAY * 365) /* days per year */
+#define L_LYEAR (L_YEAR + L_DAY) /* days per leap year */
+#define L_4YEAR (L_LYEAR + 3 * L_YEAR) /* days per leap cycle */
+#define L_CENT (L_4YEAR * 25) /* days per century */
+
+/*
+ * This contains odds and ends, including the hourly stats, various
+ * configuration items, leapseconds stuff, etc.
+ */
+/*
+ * File names
+ */
+static char *key_file_name; /* keys file name */
+static char *leapfile_name; /* leapseconds file name */
+static struct stat leapfile_stat; /* leapseconds file stat() buffer */
+static int /*BOOL*/have_leapfile = FALSE;
+char *stats_drift_file; /* frequency file name */
+static char *stats_temp_file; /* temp frequency file name */
+static double wander_resid; /* last frequency update */
+double wander_threshold = 1e-7; /* initial frequency threshold */
+
+/*
+ * Statistics file stuff
+ */
+#ifndef NTP_VAR
+# ifndef SYS_WINNT
+# define NTP_VAR "/var/NTP/" /* NOTE the trailing '/' */
+# else
+# define NTP_VAR "c:\\var\\ntp\\" /* NOTE the trailing '\\' */
+# endif /* SYS_WINNT */
+#endif
+
+
+char statsdir[MAXFILENAME] = NTP_VAR;
+static FILEGEN peerstats;
+static FILEGEN loopstats;
+static FILEGEN clockstats;
+static FILEGEN rawstats;
+static FILEGEN sysstats;
+static FILEGEN protostats;
+static FILEGEN cryptostats;
+static FILEGEN timingstats;
+
+/*
+ * This controls whether stats are written to the fileset. Provided
+ * so that ntpdc can turn off stats when the file system fills up.
+ */
+int stats_control;
+
+/*
+ * Last frequency written to file.
+ */
+static double prev_drift_comp; /* last frequency update */
+
+/*
+ * Function prototypes
+ */
+static void record_sys_stats(void);
+ void ntpd_time_stepped(void);
+static void check_leap_expiration(int, uint32_t, const time_t*);
+
+/*
+ * Prototypes
+ */
+#ifdef DEBUG
+void uninit_util(void);
+#endif
+
+/*
+ * uninit_util - free memory allocated by init_util
+ */
+#ifdef DEBUG
+void
+uninit_util(void)
+{
+#if defined(_MSC_VER) && defined (_DEBUG)
+ _CrtCheckMemory();
+#endif
+ if (stats_drift_file) {
+ free(stats_drift_file);
+ free(stats_temp_file);
+ stats_drift_file = NULL;
+ stats_temp_file = NULL;
+ }
+ if (key_file_name) {
+ free(key_file_name);
+ key_file_name = NULL;
+ }
+ filegen_unregister("peerstats");
+ filegen_unregister("loopstats");
+ filegen_unregister("clockstats");
+ filegen_unregister("rawstats");
+ filegen_unregister("sysstats");
+ filegen_unregister("protostats");
+#ifdef AUTOKEY
+ filegen_unregister("cryptostats");
+#endif /* AUTOKEY */
+#ifdef DEBUG_TIMING
+ filegen_unregister("timingstats");
+#endif /* DEBUG_TIMING */
+
+#if defined(_MSC_VER) && defined (_DEBUG)
+ _CrtCheckMemory();
+#endif
+}
+#endif /* DEBUG */
+
+
+/*
+ * init_util - initialize the util module of ntpd
+ */
+void
+init_util(void)
+{
+ filegen_register(statsdir, "peerstats", &peerstats);
+ filegen_register(statsdir, "loopstats", &loopstats);
+ filegen_register(statsdir, "clockstats", &clockstats);
+ filegen_register(statsdir, "rawstats", &rawstats);
+ filegen_register(statsdir, "sysstats", &sysstats);
+ filegen_register(statsdir, "protostats", &protostats);
+ filegen_register(statsdir, "cryptostats", &cryptostats);
+ filegen_register(statsdir, "timingstats", &timingstats);
+ /*
+ * register with libntp ntp_set_tod() to call us back
+ * when time is stepped.
+ */
+ step_callback = &ntpd_time_stepped;
+#ifdef DEBUG
+ atexit(&uninit_util);
+#endif /* DEBUG */
+}
+
+
+/*
+ * hourly_stats - print some interesting stats
+ */
+void
+write_stats(void)
+{
+ FILE *fp;
+#ifdef DOSYNCTODR
+ struct timeval tv;
+#if !defined(VMS)
+ int prio_set;
+#endif
+#ifdef HAVE_GETCLOCK
+ struct timespec ts;
+#endif
+ int o_prio;
+
+ /*
+ * Sometimes having a Sun can be a drag.
+ *
+ * The kernel variable dosynctodr controls whether the system's
+ * soft clock is kept in sync with the battery clock. If it
+ * is zero, then the soft clock is not synced, and the battery
+ * clock is simply left to rot. That means that when the system
+ * reboots, the battery clock (which has probably gone wacky)
+ * sets the soft clock. That means ntpd starts off with a very
+ * confused idea of what time it is. It then takes a large
+ * amount of time to figure out just how wacky the battery clock
+ * has made things drift, etc, etc. The solution is to make the
+ * battery clock sync up to system time. The way to do THAT is
+ * to simply set the time of day to the current time of day, but
+ * as quickly as possible. This may, or may not be a sensible
+ * thing to do.
+ *
+ * CAVEAT: settimeofday() steps the sun clock by about 800 us,
+ * so setting DOSYNCTODR seems a bad idea in the
+ * case of us resolution
+ */
+
+#if !defined(VMS)
+ /*
+ * (prr) getpriority returns -1 on error, but -1 is also a valid
+ * return value (!), so instead we have to zero errno before the
+ * call and check it for non-zero afterwards.
+ */
+ errno = 0;
+ prio_set = 0;
+ o_prio = getpriority(PRIO_PROCESS,0); /* Save setting */
+
+ /*
+ * (prr) if getpriority succeeded, call setpriority to raise
+ * scheduling priority as high as possible. If that succeeds
+ * as well, set the prio_set flag so we remember to reset
+ * priority to its previous value below. Note that on Solaris
+ * 2.6 (and beyond?), both getpriority and setpriority will fail
+ * with ESRCH, because sched_setscheduler (called from main) put
+ * us in the real-time scheduling class which setpriority
+ * doesn't know about. Being in the real-time class is better
+ * than anything setpriority can do, anyhow, so this error is
+ * silently ignored.
+ */
+ if ((errno == 0) && (setpriority(PRIO_PROCESS,0,-20) == 0))
+ prio_set = 1; /* overdrive */
+#endif /* VMS */
+#ifdef HAVE_GETCLOCK
+ (void) getclock(TIMEOFDAY, &ts);
+ tv.tv_sec = ts.tv_sec;
+ tv.tv_usec = ts.tv_nsec / 1000;
+#else /* not HAVE_GETCLOCK */
+ GETTIMEOFDAY(&tv,(struct timezone *)NULL);
+#endif /* not HAVE_GETCLOCK */
+ if (ntp_set_tod(&tv,(struct timezone *)NULL) != 0)
+ msyslog(LOG_ERR, "can't sync battery time: %m");
+#if !defined(VMS)
+ if (prio_set)
+ setpriority(PRIO_PROCESS, 0, o_prio); /* downshift */
+#endif /* VMS */
+#endif /* DOSYNCTODR */
+ record_sys_stats();
+ if (stats_drift_file != 0) {
+
+ /*
+ * When the frequency file is written, initialize the
+ * prev_drift_comp and wander_resid. Thereafter,
+ * reduce the wander_resid by half each hour. When
+ * the difference between the prev_drift_comp and
+ * drift_comp is less than the wander_resid, update
+ * the frequncy file. This minimizes the file writes to
+ * nonvolaile storage.
+ */
+#ifdef DEBUG
+ if (debug)
+ printf("write_stats: frequency %.6lf thresh %.6lf, freq %.6lf\n",
+ (prev_drift_comp - drift_comp) * 1e6, wander_resid *
+ 1e6, drift_comp * 1e6);
+#endif
+ if (fabs(prev_drift_comp - drift_comp) < wander_resid) {
+ wander_resid *= 0.5;
+ return;
+ }
+ prev_drift_comp = drift_comp;
+ wander_resid = wander_threshold;
+ if ((fp = fopen(stats_temp_file, "w")) == NULL) {
+ msyslog(LOG_ERR, "frequency file %s: %m",
+ stats_temp_file);
+ return;
+ }
+ fprintf(fp, "%.3f\n", drift_comp * 1e6);
+ (void)fclose(fp);
+ /* atomic */
+#ifdef SYS_WINNT
+ if (_unlink(stats_drift_file)) /* rename semantics differ under NT */
+ msyslog(LOG_WARNING,
+ "Unable to remove prior drift file %s, %m",
+ stats_drift_file);
+#endif /* SYS_WINNT */
+
+#ifndef NO_RENAME
+ if (rename(stats_temp_file, stats_drift_file))
+ msyslog(LOG_WARNING,
+ "Unable to rename temp drift file %s to %s, %m",
+ stats_temp_file, stats_drift_file);
+#else
+ /* we have no rename NFS of ftp in use */
+ if ((fp = fopen(stats_drift_file, "w")) ==
+ NULL) {
+ msyslog(LOG_ERR,
+ "frequency file %s: %m",
+ stats_drift_file);
+ return;
+ }
+#endif
+
+#if defined(VMS)
+ /* PURGE */
+ {
+ $DESCRIPTOR(oldvers,";-1");
+ struct dsc$descriptor driftdsc = {
+ strlen(stats_drift_file), 0, 0,
+ stats_drift_file };
+ while(lib$delete_file(&oldvers,
+ &driftdsc) & 1);
+ }
+#endif
+ }
+}
+
+
+/*
+ * stats_config - configure the stats operation
+ */
+void
+stats_config(
+ int item,
+ const char *invalue /* only one type so far */
+ )
+{
+ FILE *fp;
+ const char *value;
+ int len;
+ double old_drift;
+ l_fp now;
+ time_t ttnow;
+#ifndef VMS
+ const char temp_ext[] = ".TEMP";
+#else
+ const char temp_ext[] = "-TEMP";
+#endif
+
+ /*
+ * Expand environment strings under Windows NT, since the
+ * command interpreter doesn't do this, the program must.
+ */
+#ifdef SYS_WINNT
+ char newvalue[MAX_PATH], parameter[MAX_PATH];
+
+ if (!ExpandEnvironmentStrings(invalue, newvalue, MAX_PATH)) {
+ switch (item) {
+ case STATS_FREQ_FILE:
+ strlcpy(parameter, "STATS_FREQ_FILE",
+ sizeof(parameter));
+ break;
+
+ case STATS_LEAP_FILE:
+ strlcpy(parameter, "STATS_LEAP_FILE",
+ sizeof(parameter));
+ break;
+
+ case STATS_STATSDIR:
+ strlcpy(parameter, "STATS_STATSDIR",
+ sizeof(parameter));
+ break;
+
+ case STATS_PID_FILE:
+ strlcpy(parameter, "STATS_PID_FILE",
+ sizeof(parameter));
+ break;
+
+ default:
+ strlcpy(parameter, "UNKNOWN",
+ sizeof(parameter));
+ break;
+ }
+ value = invalue;
+ msyslog(LOG_ERR,
+ "ExpandEnvironmentStrings(%s) failed: %m\n",
+ parameter);
+ } else {
+ value = newvalue;
+ }
+#else
+ value = invalue;
+#endif /* SYS_WINNT */
+
+ switch (item) {
+
+ /*
+ * Open and read frequency file.
+ */
+ case STATS_FREQ_FILE:
+ if (!value || (len = strlen(value)) == 0)
+ break;
+
+ stats_drift_file = erealloc(stats_drift_file, len + 1);
+ stats_temp_file = erealloc(stats_temp_file,
+ len + sizeof(".TEMP"));
+ memcpy(stats_drift_file, value, (size_t)(len+1));
+ memcpy(stats_temp_file, value, (size_t)len);
+ memcpy(stats_temp_file + len, temp_ext, sizeof(temp_ext));
+
+ /*
+ * Open drift file and read frequency. If the file is
+ * missing or contains errors, tell the loop to reset.
+ */
+ if ((fp = fopen(stats_drift_file, "r")) == NULL)
+ break;
+
+ if (fscanf(fp, "%lf", &old_drift) != 1) {
+ msyslog(LOG_ERR,
+ "format error frequency file %s",
+ stats_drift_file);
+ fclose(fp);
+ break;
+
+ }
+ fclose(fp);
+ loop_config(LOOP_FREQ, old_drift);
+ prev_drift_comp = drift_comp;
+ break;
+
+ /*
+ * Specify statistics directory.
+ */
+ case STATS_STATSDIR:
+
+ /* - 1 since value may be missing the DIR_SEP. */
+ if (strlen(value) >= sizeof(statsdir) - 1) {
+ msyslog(LOG_ERR,
+ "statsdir too long (>%d, sigh)",
+ (int)sizeof(statsdir) - 2);
+ } else {
+ int add_dir_sep;
+ int value_l;
+
+ /* Add a DIR_SEP unless we already have one. */
+ value_l = strlen(value);
+ if (0 == value_l)
+ add_dir_sep = FALSE;
+ else
+ add_dir_sep = (DIR_SEP !=
+ value[value_l - 1]);
+
+ if (add_dir_sep)
+ snprintf(statsdir, sizeof(statsdir),
+ "%s%c", value, DIR_SEP);
+ else
+ snprintf(statsdir, sizeof(statsdir),
+ "%s", value);
+ filegen_statsdir();
+ }
+ break;
+
+ /*
+ * Open pid file.
+ */
+ case STATS_PID_FILE:
+ if ((fp = fopen(value, "w")) == NULL) {
+ msyslog(LOG_ERR, "pid file %s: %m",
+ value);
+ break;
+ }
+ fprintf(fp, "%d", (int)getpid());
+ fclose(fp);
+ break;
+
+ /*
+ * Read leapseconds file.
+ *
+ * Note: Currently a leap file without SHA1 signature is
+ * accepted, but if there is a signature line, the signature
+ * must be valid or the file is rejected.
+ */
+ case STATS_LEAP_FILE:
+ if (!value || (len = strlen(value)) == 0)
+ break;
+
+ leapfile_name = erealloc(leapfile_name, len + 1);
+ memcpy(leapfile_name, value, len + 1);
+
+ if (leapsec_load_file(
+ leapfile_name, &leapfile_stat, TRUE, TRUE))
+ {
+ leap_signature_t lsig;
+
+ get_systime(&now);
+ time(&ttnow);
+ leapsec_getsig(&lsig);
+ mprintf_event(EVNT_TAI, NULL,
+ "%d leap %s %s %s",
+ lsig.taiof,
+ fstostr(lsig.ttime),
+ leapsec_expired(now.l_ui, NULL)
+ ? "expired"
+ : "expires",
+ fstostr(lsig.etime));
+
+ have_leapfile = TRUE;
+
+ /* force an immediate daily expiration check of
+ * the leap seconds table
+ */
+ check_leap_expiration(TRUE, now.l_ui, &ttnow);
+ }
+ break;
+
+ default:
+ /* oh well */
+ break;
+ }
+}
+
+
+/*
+ * record_peer_stats - write peer statistics to file
+ *
+ * file format:
+ * day (MJD)
+ * time (s past UTC midnight)
+ * IP address
+ * status word (hex)
+ * offset
+ * delay
+ * dispersion
+ * jitter
+*/
+void
+record_peer_stats(
+ sockaddr_u *addr,
+ int status,
+ double offset, /* offset */
+ double delay, /* delay */
+ double dispersion, /* dispersion */
+ double jitter /* jitter */
+ )
+{
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&peerstats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (peerstats.fp != NULL) {
+ fprintf(peerstats.fp,
+ "%lu %s %s %x %.9f %.9f %.9f %.9f\n", day,
+ ulfptoa(&now, 3), stoa(addr), status, offset,
+ delay, dispersion, jitter);
+ fflush(peerstats.fp);
+ }
+}
+
+
+/*
+ * record_loop_stats - write loop filter statistics to file
+ *
+ * file format:
+ * day (MJD)
+ * time (s past midnight)
+ * offset
+ * frequency (PPM)
+ * jitter
+ * wnder (PPM)
+ * time constant (log2)
+ */
+void
+record_loop_stats(
+ double offset, /* offset */
+ double freq, /* frequency (PPM) */
+ double jitter, /* jitter */
+ double wander, /* wander (PPM) */
+ int spoll
+ )
+{
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&loopstats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (loopstats.fp != NULL) {
+ fprintf(loopstats.fp, "%lu %s %.9f %.3f %.9f %.6f %d\n",
+ day, ulfptoa(&now, 3), offset, freq * 1e6, jitter,
+ wander * 1e6, spoll);
+ fflush(loopstats.fp);
+ }
+}
+
+
+/*
+ * record_clock_stats - write clock statistics to file
+ *
+ * file format:
+ * day (MJD)
+ * time (s past midnight)
+ * IP address
+ * text message
+ */
+void
+record_clock_stats(
+ sockaddr_u *addr,
+ const char *text /* timecode string */
+ )
+{
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&clockstats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (clockstats.fp != NULL) {
+ fprintf(clockstats.fp, "%lu %s %s %s\n", day,
+ ulfptoa(&now, 3), stoa(addr), text);
+ fflush(clockstats.fp);
+ }
+}
+
+
+/*
+ * mprintf_clock_stats - write clock statistics to file with
+ * msnprintf-style formatting.
+ */
+int
+mprintf_clock_stats(
+ sockaddr_u *addr,
+ const char *fmt,
+ ...
+ )
+{
+ va_list ap;
+ int rc;
+ char msg[512];
+
+ va_start(ap, fmt);
+ rc = mvsnprintf(msg, sizeof(msg), fmt, ap);
+ va_end(ap);
+ if (stats_control)
+ record_clock_stats(addr, msg);
+
+ return rc;
+}
+
+/*
+ * record_raw_stats - write raw timestamps to file
+ *
+ * file format
+ * day (MJD)
+ * time (s past midnight)
+ * peer ip address
+ * IP address
+ * t1 t2 t3 t4 timestamps
+ */
+void
+record_raw_stats(
+ sockaddr_u *srcadr,
+ sockaddr_u *dstadr,
+ l_fp *t1, /* originate timestamp */
+ l_fp *t2, /* receive timestamp */
+ l_fp *t3, /* transmit timestamp */
+ l_fp *t4, /* destination timestamp */
+ int leap,
+ int version,
+ int mode,
+ int stratum,
+ int poll,
+ int precision,
+ double root_delay, /* seconds */
+ double root_dispersion,/* seconds */
+ u_int32 refid
+ )
+{
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&rawstats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (rawstats.fp != NULL) {
+ fprintf(rawstats.fp, "%lu %s %s %s %s %s %s %s %d %d %d %d %d %d %.6f %.6f %s\n",
+ day, ulfptoa(&now, 3),
+ stoa(srcadr), dstadr ? stoa(dstadr) : "-",
+ ulfptoa(t1, 9), ulfptoa(t2, 9),
+ ulfptoa(t3, 9), ulfptoa(t4, 9),
+ leap, version, mode, stratum, poll, precision,
+ root_delay, root_dispersion, refid_str(refid, stratum));
+ fflush(rawstats.fp);
+ }
+}
+
+
+/*
+ * record_sys_stats - write system statistics to file
+ *
+ * file format
+ * day (MJD)
+ * time (s past midnight)
+ * time since reset
+ * packets recieved
+ * packets for this host
+ * current version
+ * old version
+ * access denied
+ * bad length or format
+ * bad authentication
+ * declined
+ * rate exceeded
+ * KoD sent
+ */
+void
+record_sys_stats(void)
+{
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&sysstats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (sysstats.fp != NULL) {
+ fprintf(sysstats.fp,
+ "%lu %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+ day, ulfptoa(&now, 3), current_time - sys_stattime,
+ sys_received, sys_processed, sys_newversion,
+ sys_oldversion, sys_restricted, sys_badlength,
+ sys_badauth, sys_declined, sys_limitrejected,
+ sys_kodsent);
+ fflush(sysstats.fp);
+ proto_clr_stats();
+ }
+}
+
+
+/*
+ * record_proto_stats - write system statistics to file
+ *
+ * file format
+ * day (MJD)
+ * time (s past midnight)
+ * text message
+ */
+void
+record_proto_stats(
+ char *str /* text string */
+ )
+{
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&protostats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (protostats.fp != NULL) {
+ fprintf(protostats.fp, "%lu %s %s\n", day,
+ ulfptoa(&now, 3), str);
+ fflush(protostats.fp);
+ }
+}
+
+
+#ifdef AUTOKEY
+/*
+ * record_crypto_stats - write crypto statistics to file
+ *
+ * file format:
+ * day (mjd)
+ * time (s past midnight)
+ * peer ip address
+ * text message
+ */
+void
+record_crypto_stats(
+ sockaddr_u *addr,
+ const char *text /* text message */
+ )
+{
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&cryptostats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (cryptostats.fp != NULL) {
+ if (addr == NULL)
+ fprintf(cryptostats.fp, "%lu %s 0.0.0.0 %s\n",
+ day, ulfptoa(&now, 3), text);
+ else
+ fprintf(cryptostats.fp, "%lu %s %s %s\n",
+ day, ulfptoa(&now, 3), stoa(addr), text);
+ fflush(cryptostats.fp);
+ }
+}
+#endif /* AUTOKEY */
+
+
+#ifdef DEBUG_TIMING
+/*
+ * record_timing_stats - write timing statistics to file
+ *
+ * file format:
+ * day (mjd)
+ * time (s past midnight)
+ * text message
+ */
+void
+record_timing_stats(
+ const char *text /* text message */
+ )
+{
+ static unsigned int flshcnt;
+ l_fp now;
+ u_long day;
+
+ if (!stats_control)
+ return;
+
+ get_systime(&now);
+ filegen_setup(&timingstats, now.l_ui);
+ day = now.l_ui / 86400 + MJD_1900;
+ now.l_ui %= 86400;
+ if (timingstats.fp != NULL) {
+ fprintf(timingstats.fp, "%lu %s %s\n", day, lfptoa(&now,
+ 3), text);
+ if (++flshcnt % 100 == 0)
+ fflush(timingstats.fp);
+ }
+}
+#endif
+
+
+/*
+ * check_leap_file - See if the leapseconds file has been updated.
+ *
+ * Returns: n/a
+ *
+ * Note: This loads a new leapfile on the fly. Currently a leap file
+ * without SHA1 signature is accepted, but if there is a signature line,
+ * the signature must be valid or the file is rejected.
+ */
+void
+check_leap_file(
+ int is_daily_check,
+ uint32_t ntptime ,
+ const time_t *systime
+ )
+{
+ /* just do nothing if there is no leap file */
+ if ( ! (leapfile_name && *leapfile_name))
+ return;
+
+ /* try to load leapfile, force it if no leapfile loaded yet */
+ if (leapsec_load_file(
+ leapfile_name, &leapfile_stat,
+ !have_leapfile, is_daily_check))
+ have_leapfile = TRUE;
+ else if (!have_leapfile)
+ return;
+
+ check_leap_expiration(is_daily_check, ntptime, systime);
+}
+
+/*
+ * check expiration of a loaded leap table
+ */
+static void
+check_leap_expiration(
+ int is_daily_check,
+ uint32_t ntptime ,
+ const time_t *systime
+ )
+{
+ static const char * const logPrefix = "leapsecond file";
+ int rc;
+
+ /* test the expiration of the leap data and log with proper
+ * level and frequency (once/hour or once/day, depending on the
+ * state.
+ */
+ rc = leapsec_daystolive(ntptime, systime);
+ if (rc == 0) {
+ msyslog(LOG_WARNING,
+ "%s ('%s'): will expire in less than one day",
+ logPrefix, leapfile_name);
+ } else if (is_daily_check && rc < 28) {
+ if (rc < 0)
+ msyslog(LOG_ERR,
+ "%s ('%s'): expired less than %d day%s ago",
+ logPrefix, leapfile_name, -rc, (rc == -1 ? "" : "s"));
+ else
+ msyslog(LOG_WARNING,
+ "%s ('%s'): will expire in less than %d days",
+ logPrefix, leapfile_name, 1+rc);
+ }
+}
+
+
+/*
+ * getauthkeys - read the authentication keys from the specified file
+ */
+void
+getauthkeys(
+ const char *keyfile
+ )
+{
+ int len;
+
+ len = strlen(keyfile);
+ if (!len)
+ return;
+
+#ifndef SYS_WINNT
+ key_file_name = erealloc(key_file_name, len + 1);
+ memcpy(key_file_name, keyfile, len + 1);
+#else
+ key_file_name = erealloc(key_file_name, _MAX_PATH);
+ if (len + 1 > _MAX_PATH)
+ return;
+ if (!ExpandEnvironmentStrings(keyfile, key_file_name,
+ _MAX_PATH)) {
+ msyslog(LOG_ERR,
+ "ExpandEnvironmentStrings(KEY_FILE) failed: %m");
+ strlcpy(key_file_name, keyfile, _MAX_PATH);
+ }
+ key_file_name = erealloc(key_file_name,
+ 1 + strlen(key_file_name));
+#endif /* SYS_WINNT */
+
+ authreadkeys(key_file_name);
+}
+
+
+/*
+ * rereadkeys - read the authentication key file over again.
+ */
+void
+rereadkeys(void)
+{
+ if (NULL != key_file_name)
+ authreadkeys(key_file_name);
+}
+
+
+#if notyet
+/*
+ * ntp_exit - document explicitly that ntpd has exited
+ */
+void
+ntp_exit(int retval)
+{
+ msyslog(LOG_ERR, "EXITING with return code %d", retval);
+ exit(retval);
+}
+#endif
+
+/*
+ * fstostr - prettyprint NTP seconds
+ */
+char * fstostr(
+ time_t ntp_stamp
+ )
+{
+ char * buf;
+ struct calendar tm;
+
+ LIB_GETBUF(buf);
+ if (ntpcal_ntp_to_date(&tm, (u_int32)ntp_stamp, NULL) < 0)
+ snprintf(buf, LIB_BUFLENGTH, "ntpcal_ntp_to_date: %ld: range error",
+ (long)ntp_stamp);
+ else
+ snprintf(buf, LIB_BUFLENGTH, "%04d%02d%02d%02d%02d",
+ tm.year, tm.month, tm.monthday,
+ tm.hour, tm.minute);
+ return buf;
+}
+
+
+/*
+ * ntpd_time_stepped is called back by step_systime(), allowing ntpd
+ * to do any one-time processing necessitated by the step.
+ */
+void
+ntpd_time_stepped(void)
+{
+ u_int saved_mon_enabled;
+
+ /*
+ * flush the monitor MRU list which contains l_fp timestamps
+ * which should not be compared across the step.
+ */
+ if (MON_OFF != mon_enabled) {
+ saved_mon_enabled = mon_enabled;
+ mon_stop(MON_OFF);
+ mon_start(saved_mon_enabled);
+ }
+
+ /* inform interpolating Windows code to allow time to go back */
+#ifdef SYS_WINNT
+ win_time_stepped();
+#endif
+}
diff --git a/ntpd/ntpd-opts.c b/ntpd/ntpd-opts.c
new file mode 100644
index 0000000..4c298c5
--- /dev/null
+++ b/ntpd/ntpd-opts.c
@@ -0,0 +1,1952 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:54:08 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpd-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpd author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpd program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+
+#ifndef __doxygen__
+#define OPTION_CODE_COMPILE 1
+#include "ntpd-opts.h"
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern FILE * option_usage_fp;
+#define zCopyright (ntpd_opt_strs+0)
+#define zLicenseDescrip (ntpd_opt_strs+314)
+
+/*
+ * global included definitions
+ */
+#ifdef __windows
+ extern int atoi(const char *);
+#else
+# include <stdlib.h>
+#endif
+
+#ifdef __windows
+ extern int atoi(const char*);
+#else
+# include <stdlib.h>
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/**
+ * static const strings for ntpd options
+ */
+static char const ntpd_opt_strs[3011] =
+/* 0 */ "ntpd 4.2.7p482\n"
+ "Copyright (C) 1970-2014 The University of Delaware, 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"
+ "can be seen at:\n"
+ " <http://ntp.org/license>\n"
+ " <http://opensource.org/licenses/ntp-license.php>\n\0"
+/* 314 */ "Permission to use, copy, modify, and distribute this software and its\n"
+ "documentation for any purpose with or without fee is hereby granted,\n"
+ "provided that the above copyright notice appears in all copies and that\n"
+ "both the copyright notice and this permission notice appear in supporting\n"
+ "documentation, and that the name The University of Delaware not be used in\n"
+ "advertising or publicity pertaining to distribution of the software without\n"
+ "specific, written prior permission. The University of Delaware makes no\n"
+ "representations about the suitability this software for any purpose. It is\n"
+ "provided \"as is\" without express or implied warranty.\n\0"
+/* 954 */ "Force IPv4 DNS name resolution\0"
+/* 985 */ "IPV4\0"
+/* 990 */ "ipv4\0"
+/* 995 */ "Force IPv6 DNS name resolution\0"
+/* 1026 */ "IPV6\0"
+/* 1031 */ "ipv6\0"
+/* 1036 */ "Require crypto authentication\0"
+/* 1066 */ "AUTHREQ\0"
+/* 1074 */ "authreq\0"
+/* 1082 */ "Do not require crypto authentication\0"
+/* 1119 */ "AUTHNOREQ\0"
+/* 1129 */ "authnoreq\0"
+/* 1139 */ "Allow us to sync to broadcast servers\0"
+/* 1177 */ "BCASTSYNC\0"
+/* 1187 */ "bcastsync\0"
+/* 1197 */ "configuration file name\0"
+/* 1221 */ "CONFIGFILE\0"
+/* 1232 */ "configfile\0"
+/* 1243 */ "Increase debug verbosity level\0"
+/* 1274 */ "DEBUG_LEVEL\0"
+/* 1286 */ "debug-level\0"
+/* 1298 */ "Set the debug verbosity level\0"
+/* 1328 */ "SET_DEBUG_LEVEL\0"
+/* 1344 */ "set-debug-level\0"
+/* 1360 */ "frequency drift file name\0"
+/* 1386 */ "DRIFTFILE\0"
+/* 1396 */ "driftfile\0"
+/* 1406 */ "Allow the first adjustment to be Big\0"
+/* 1443 */ "PANICGATE\0"
+/* 1453 */ "panicgate\0"
+/* 1463 */ "Jail directory\0"
+/* 1478 */ "JAILDIR\0"
+/* 1486 */ "jaildir\0"
+/* 1494 */ "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs\0"
+/* 1573 */ "Listen on an interface name or address\0"
+/* 1612 */ "INTERFACE\0"
+/* 1622 */ "interface\0"
+/* 1632 */ "path to symmetric keys\0"
+/* 1655 */ "KEYFILE\0"
+/* 1663 */ "keyfile\0"
+/* 1671 */ "path to the log file\0"
+/* 1692 */ "LOGFILE\0"
+/* 1700 */ "logfile\0"
+/* 1708 */ "Do not listen to virtual interfaces\0"
+/* 1744 */ "NOVIRTUALIPS\0"
+/* 1757 */ "novirtualips\0"
+/* 1770 */ "Modify Multimedia Timer (Windows only)\0"
+/* 1809 */ "MODIFYMMTIMER\0"
+/* 1823 */ "modifymmtimer\0"
+/* 1837 */ "Do not fork\0"
+/* 1849 */ "NOFORK\0"
+/* 1856 */ "nofork\0"
+/* 1863 */ "Run at high priority\0"
+/* 1884 */ "NICE\0"
+/* 1889 */ "nice\0"
+/* 1894 */ "path to the PID file\0"
+/* 1915 */ "PIDFILE\0"
+/* 1923 */ "pidfile\0"
+/* 1931 */ "Process priority\0"
+/* 1948 */ "PRIORITY\0"
+/* 1957 */ "priority\0"
+/* 1966 */ "Set the time and quit\0"
+/* 1988 */ "QUIT\0"
+/* 1993 */ "quit\0"
+/* 1998 */ "Broadcast/propagation delay\0"
+/* 2026 */ "PROPAGATIONDELAY\0"
+/* 2043 */ "propagationdelay\0"
+/* 2060 */ "Save parsed configuration and quit\0"
+/* 2095 */ "SAVECONFIGQUIT\0"
+/* 2110 */ "saveconfigquit\0"
+/* 2125 */ "Statistics file location\0"
+/* 2150 */ "STATSDIR\0"
+/* 2159 */ "statsdir\0"
+/* 2168 */ "Trusted key number\0"
+/* 2187 */ "TRUSTEDKEY\0"
+/* 2198 */ "trustedkey\0"
+/* 2209 */ "Run as userid (or userid:groupid)\0"
+/* 2243 */ "USER\0"
+/* 2248 */ "user\0"
+/* 2253 */ "interval in seconds between scans for new or dropped interfaces\0"
+/* 2317 */ "UPDATEINTERVAL\0"
+/* 2332 */ "updateinterval\0"
+/* 2347 */ "make ARG an ntp variable (RW)\0"
+/* 2377 */ "VAR\0"
+/* 2381 */ "var\0"
+/* 2385 */ "make ARG an ntp variable (RW|DEF)\0"
+/* 2419 */ "DVAR\0"
+/* 2424 */ "dvar\0"
+/* 2429 */ "Seconds to wait for first clock sync\0"
+/* 2466 */ "WAIT_SYNC\0"
+/* 2476 */ "wait-sync\0"
+/* 2486 */ "Slew up to 600 seconds\0"
+/* 2509 */ "SLEW\0"
+/* 2514 */ "slew\0"
+/* 2519 */ "Use CPU cycle counter (Windows only)\0"
+/* 2556 */ "USEPCC\0"
+/* 2563 */ "usepcc\0"
+/* 2570 */ "Force CPU cycle counter use (Windows only)\0"
+/* 2613 */ "PCCFREQ\0"
+/* 2621 */ "pccfreq\0"
+/* 2629 */ "Register with mDNS as a NTP server\0"
+/* 2664 */ "MDNS\0"
+/* 2669 */ "mdns\0"
+/* 2674 */ "display extended usage information and exit\0"
+/* 2718 */ "help\0"
+/* 2723 */ "extended usage information passed thru pager\0"
+/* 2768 */ "more-help\0"
+/* 2778 */ "output version information and exit\0"
+/* 2814 */ "version\0"
+/* 2822 */ "NTPD\0"
+/* 2827 */ "ntpd - NTP daemon program - Ver. 4.2.7p482\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
+ "\t\t[ <server1> ... <serverN> ]\n\0"
+/* 2960 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 2994 */ "\n\0"
+/* 2996 */ "ntpd 4.2.7p482";
+
+/**
+ * ipv4 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv4 option */
+#define IPV4_DESC (ntpd_opt_strs+954)
+/** Upper-cased name for the ipv4 option */
+#define IPV4_NAME (ntpd_opt_strs+985)
+/** Name string for the ipv4 option */
+#define IPV4_name (ntpd_opt_strs+990)
+/** Other options that appear in conjunction with the ipv4 option */
+static int const aIpv4CantList[] = {
+ INDEX_OPT_IPV6, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv4 option */
+#define IPV4_FLAGS (OPTST_DISABLED)
+
+/**
+ * ipv6 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv6 option */
+#define IPV6_DESC (ntpd_opt_strs+995)
+/** Upper-cased name for the ipv6 option */
+#define IPV6_NAME (ntpd_opt_strs+1026)
+/** Name string for the ipv6 option */
+#define IPV6_name (ntpd_opt_strs+1031)
+/** Other options that appear in conjunction with the ipv6 option */
+static int const aIpv6CantList[] = {
+ INDEX_OPT_IPV4, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv6 option */
+#define IPV6_FLAGS (OPTST_DISABLED)
+
+/**
+ * authreq option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the authreq option */
+#define AUTHREQ_DESC (ntpd_opt_strs+1036)
+/** Upper-cased name for the authreq option */
+#define AUTHREQ_NAME (ntpd_opt_strs+1066)
+/** Name string for the authreq option */
+#define AUTHREQ_name (ntpd_opt_strs+1074)
+/** Other options that appear in conjunction with the authreq option */
+static int const aAuthreqCantList[] = {
+ INDEX_OPT_AUTHNOREQ, NO_EQUIVALENT };
+/** Compiled in flag settings for the authreq option */
+#define AUTHREQ_FLAGS (OPTST_DISABLED)
+
+/**
+ * authnoreq option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the authnoreq option */
+#define AUTHNOREQ_DESC (ntpd_opt_strs+1082)
+/** Upper-cased name for the authnoreq option */
+#define AUTHNOREQ_NAME (ntpd_opt_strs+1119)
+/** Name string for the authnoreq option */
+#define AUTHNOREQ_name (ntpd_opt_strs+1129)
+/** Other options that appear in conjunction with the authnoreq option */
+static int const aAuthnoreqCantList[] = {
+ INDEX_OPT_AUTHREQ, NO_EQUIVALENT };
+/** Compiled in flag settings for the authnoreq option */
+#define AUTHNOREQ_FLAGS (OPTST_DISABLED)
+
+/**
+ * bcastsync option description:
+ */
+/** Descriptive text for the bcastsync option */
+#define BCASTSYNC_DESC (ntpd_opt_strs+1139)
+/** Upper-cased name for the bcastsync option */
+#define BCASTSYNC_NAME (ntpd_opt_strs+1177)
+/** Name string for the bcastsync option */
+#define BCASTSYNC_name (ntpd_opt_strs+1187)
+/** Compiled in flag settings for the bcastsync option */
+#define BCASTSYNC_FLAGS (OPTST_DISABLED)
+
+/**
+ * configfile option description:
+ */
+/** Descriptive text for the configfile option */
+#define CONFIGFILE_DESC (ntpd_opt_strs+1197)
+/** Upper-cased name for the configfile option */
+#define CONFIGFILE_NAME (ntpd_opt_strs+1221)
+/** Name string for the configfile option */
+#define CONFIGFILE_name (ntpd_opt_strs+1232)
+/** Compiled in flag settings for the configfile option */
+#define CONFIGFILE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * debug-level option description:
+ */
+/** Descriptive text for the debug-level option */
+#define DEBUG_LEVEL_DESC (ntpd_opt_strs+1243)
+/** Upper-cased name for the debug-level option */
+#define DEBUG_LEVEL_NAME (ntpd_opt_strs+1274)
+/** Name string for the debug-level option */
+#define DEBUG_LEVEL_name (ntpd_opt_strs+1286)
+/** Compiled in flag settings for the debug-level option */
+#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
+
+/**
+ * set-debug-level option description:
+ */
+/** Descriptive text for the set-debug-level option */
+#define SET_DEBUG_LEVEL_DESC (ntpd_opt_strs+1298)
+/** Upper-cased name for the set-debug-level option */
+#define SET_DEBUG_LEVEL_NAME (ntpd_opt_strs+1328)
+/** Name string for the set-debug-level option */
+#define SET_DEBUG_LEVEL_name (ntpd_opt_strs+1344)
+/** Compiled in flag settings for the set-debug-level option */
+#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * driftfile option description:
+ */
+/** Descriptive text for the driftfile option */
+#define DRIFTFILE_DESC (ntpd_opt_strs+1360)
+/** Upper-cased name for the driftfile option */
+#define DRIFTFILE_NAME (ntpd_opt_strs+1386)
+/** Name string for the driftfile option */
+#define DRIFTFILE_name (ntpd_opt_strs+1396)
+/** Compiled in flag settings for the driftfile option */
+#define DRIFTFILE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * panicgate option description:
+ */
+/** Descriptive text for the panicgate option */
+#define PANICGATE_DESC (ntpd_opt_strs+1406)
+/** Upper-cased name for the panicgate option */
+#define PANICGATE_NAME (ntpd_opt_strs+1443)
+/** Name string for the panicgate option */
+#define PANICGATE_name (ntpd_opt_strs+1453)
+/** Compiled in flag settings for the panicgate option */
+#define PANICGATE_FLAGS (OPTST_DISABLED)
+
+/**
+ * jaildir option description:
+ */
+#ifdef HAVE_DROPROOT
+/** Descriptive text for the jaildir option */
+#define JAILDIR_DESC (ntpd_opt_strs+1463)
+/** Upper-cased name for the jaildir option */
+#define JAILDIR_NAME (ntpd_opt_strs+1478)
+/** Name string for the jaildir option */
+#define JAILDIR_name (ntpd_opt_strs+1486)
+/** Compiled in flag settings for the jaildir option */
+#define JAILDIR_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable jaildir */
+#define JAILDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define JAILDIR_NAME NULL
+/** Descriptive text for the jaildir option */
+#define JAILDIR_DESC (ntpd_opt_strs+1494)
+#define JAILDIR_name (ntpd_opt_strs+1486)
+#endif /* HAVE_DROPROOT */
+
+/**
+ * interface option description:
+ */
+/** Descriptive text for the interface option */
+#define INTERFACE_DESC (ntpd_opt_strs+1573)
+/** Upper-cased name for the interface option */
+#define INTERFACE_NAME (ntpd_opt_strs+1612)
+/** Name string for the interface option */
+#define INTERFACE_name (ntpd_opt_strs+1622)
+/** Compiled in flag settings for the interface option */
+#define INTERFACE_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * keyfile option description:
+ */
+/** Descriptive text for the keyfile option */
+#define KEYFILE_DESC (ntpd_opt_strs+1632)
+/** Upper-cased name for the keyfile option */
+#define KEYFILE_NAME (ntpd_opt_strs+1655)
+/** Name string for the keyfile option */
+#define KEYFILE_name (ntpd_opt_strs+1663)
+/** Compiled in flag settings for the keyfile option */
+#define KEYFILE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * logfile option description:
+ */
+/** Descriptive text for the logfile option */
+#define LOGFILE_DESC (ntpd_opt_strs+1671)
+/** Upper-cased name for the logfile option */
+#define LOGFILE_NAME (ntpd_opt_strs+1692)
+/** Name string for the logfile option */
+#define LOGFILE_name (ntpd_opt_strs+1700)
+/** Compiled in flag settings for the logfile option */
+#define LOGFILE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * novirtualips option description:
+ */
+/** Descriptive text for the novirtualips option */
+#define NOVIRTUALIPS_DESC (ntpd_opt_strs+1708)
+/** Upper-cased name for the novirtualips option */
+#define NOVIRTUALIPS_NAME (ntpd_opt_strs+1744)
+/** Name string for the novirtualips option */
+#define NOVIRTUALIPS_name (ntpd_opt_strs+1757)
+/** Compiled in flag settings for the novirtualips option */
+#define NOVIRTUALIPS_FLAGS (OPTST_DISABLED)
+
+/**
+ * modifymmtimer option description:
+ */
+#ifdef SYS_WINNT
+/** Descriptive text for the modifymmtimer option */
+#define MODIFYMMTIMER_DESC (ntpd_opt_strs+1770)
+/** Upper-cased name for the modifymmtimer option */
+#define MODIFYMMTIMER_NAME (ntpd_opt_strs+1809)
+/** Name string for the modifymmtimer option */
+#define MODIFYMMTIMER_name (ntpd_opt_strs+1823)
+/** Compiled in flag settings for the modifymmtimer option */
+#define MODIFYMMTIMER_FLAGS (OPTST_DISABLED)
+
+#else /* disable modifymmtimer */
+#define MODIFYMMTIMER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define MODIFYMMTIMER_NAME NULL
+#define MODIFYMMTIMER_DESC NULL
+#define MODIFYMMTIMER_name NULL
+#endif /* SYS_WINNT */
+
+/**
+ * nofork option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the nofork option */
+#define NOFORK_DESC (ntpd_opt_strs+1837)
+/** Upper-cased name for the nofork option */
+#define NOFORK_NAME (ntpd_opt_strs+1849)
+/** Name string for the nofork option */
+#define NOFORK_name (ntpd_opt_strs+1856)
+/** Other options that appear in conjunction with the nofork option */
+static int const aNoforkCantList[] = {
+ INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
+/** Compiled in flag settings for the nofork option */
+#define NOFORK_FLAGS (OPTST_DISABLED)
+
+/**
+ * nice option description:
+ */
+/** Descriptive text for the nice option */
+#define NICE_DESC (ntpd_opt_strs+1863)
+/** Upper-cased name for the nice option */
+#define NICE_NAME (ntpd_opt_strs+1884)
+/** Name string for the nice option */
+#define NICE_name (ntpd_opt_strs+1889)
+/** Compiled in flag settings for the nice option */
+#define NICE_FLAGS (OPTST_DISABLED)
+
+/**
+ * pidfile option description:
+ */
+/** Descriptive text for the pidfile option */
+#define PIDFILE_DESC (ntpd_opt_strs+1894)
+/** Upper-cased name for the pidfile option */
+#define PIDFILE_NAME (ntpd_opt_strs+1915)
+/** Name string for the pidfile option */
+#define PIDFILE_name (ntpd_opt_strs+1923)
+/** Compiled in flag settings for the pidfile option */
+#define PIDFILE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * priority option description:
+ */
+/** Descriptive text for the priority option */
+#define PRIORITY_DESC (ntpd_opt_strs+1931)
+/** Upper-cased name for the priority option */
+#define PRIORITY_NAME (ntpd_opt_strs+1948)
+/** Name string for the priority option */
+#define PRIORITY_name (ntpd_opt_strs+1957)
+/** Compiled in flag settings for the priority option */
+#define PRIORITY_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * quit option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the quit option */
+#define QUIT_DESC (ntpd_opt_strs+1966)
+/** Upper-cased name for the quit option */
+#define QUIT_NAME (ntpd_opt_strs+1988)
+/** Name string for the quit option */
+#define QUIT_name (ntpd_opt_strs+1993)
+/** Other options that appear in conjunction with the quit option */
+static int const aQuitCantList[] = {
+ INDEX_OPT_SAVECONFIGQUIT,
+ INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
+/** Compiled in flag settings for the quit option */
+#define QUIT_FLAGS (OPTST_DISABLED)
+
+/**
+ * propagationdelay option description:
+ */
+/** Descriptive text for the propagationdelay option */
+#define PROPAGATIONDELAY_DESC (ntpd_opt_strs+1998)
+/** Upper-cased name for the propagationdelay option */
+#define PROPAGATIONDELAY_NAME (ntpd_opt_strs+2026)
+/** Name string for the propagationdelay option */
+#define PROPAGATIONDELAY_name (ntpd_opt_strs+2043)
+/** Compiled in flag settings for the propagationdelay option */
+#define PROPAGATIONDELAY_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * saveconfigquit option description with
+ * "Must also have options" and "Incompatible options":
+ */
+#ifdef SAVECONFIG
+/** Descriptive text for the saveconfigquit option */
+#define SAVECONFIGQUIT_DESC (ntpd_opt_strs+2060)
+/** Upper-cased name for the saveconfigquit option */
+#define SAVECONFIGQUIT_NAME (ntpd_opt_strs+2095)
+/** Name string for the saveconfigquit option */
+#define SAVECONFIGQUIT_name (ntpd_opt_strs+2110)
+/** Other options that appear in conjunction with the saveconfigquit option */
+static int const aSaveconfigquitCantList[] = {
+ INDEX_OPT_QUIT,
+ INDEX_OPT_WAIT_SYNC, NO_EQUIVALENT };
+/** Compiled in flag settings for the saveconfigquit option */
+#define SAVECONFIGQUIT_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable saveconfigquit */
+#define SAVECONFIGQUIT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define aSaveconfigquitCantList NULL
+#define SAVECONFIGQUIT_NAME NULL
+#define SAVECONFIGQUIT_DESC NULL
+#define SAVECONFIGQUIT_name NULL
+#endif /* SAVECONFIG */
+
+/**
+ * statsdir option description:
+ */
+/** Descriptive text for the statsdir option */
+#define STATSDIR_DESC (ntpd_opt_strs+2125)
+/** Upper-cased name for the statsdir option */
+#define STATSDIR_NAME (ntpd_opt_strs+2150)
+/** Name string for the statsdir option */
+#define STATSDIR_name (ntpd_opt_strs+2159)
+/** Compiled in flag settings for the statsdir option */
+#define STATSDIR_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * trustedkey option description:
+ */
+/** Descriptive text for the trustedkey option */
+#define TRUSTEDKEY_DESC (ntpd_opt_strs+2168)
+/** Upper-cased name for the trustedkey option */
+#define TRUSTEDKEY_NAME (ntpd_opt_strs+2187)
+/** Name string for the trustedkey option */
+#define TRUSTEDKEY_name (ntpd_opt_strs+2198)
+/** Compiled in flag settings for the trustedkey option */
+#define TRUSTEDKEY_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * user option description:
+ */
+#ifdef HAVE_DROPROOT
+/** Descriptive text for the user option */
+#define USER_DESC (ntpd_opt_strs+2209)
+/** Upper-cased name for the user option */
+#define USER_NAME (ntpd_opt_strs+2243)
+/** Name string for the user option */
+#define USER_name (ntpd_opt_strs+2248)
+/** Compiled in flag settings for the user option */
+#define USER_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable user */
+#define USER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define USER_NAME NULL
+/** Descriptive text for the user option */
+#define USER_DESC (ntpd_opt_strs+1494)
+#define USER_name (ntpd_opt_strs+2248)
+#endif /* HAVE_DROPROOT */
+
+/**
+ * updateinterval option description:
+ */
+/** Descriptive text for the updateinterval option */
+#define UPDATEINTERVAL_DESC (ntpd_opt_strs+2253)
+/** Upper-cased name for the updateinterval option */
+#define UPDATEINTERVAL_NAME (ntpd_opt_strs+2317)
+/** Name string for the updateinterval option */
+#define UPDATEINTERVAL_name (ntpd_opt_strs+2332)
+/** Compiled in flag settings for the updateinterval option */
+#define UPDATEINTERVAL_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * var option description:
+ */
+/** Descriptive text for the var option */
+#define VAR_DESC (ntpd_opt_strs+2347)
+/** Upper-cased name for the var option */
+#define VAR_NAME (ntpd_opt_strs+2377)
+/** Name string for the var option */
+#define VAR_name (ntpd_opt_strs+2381)
+/** Compiled in flag settings for the var option */
+#define VAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * dvar option description:
+ */
+/** Descriptive text for the dvar option */
+#define DVAR_DESC (ntpd_opt_strs+2385)
+/** Upper-cased name for the dvar option */
+#define DVAR_NAME (ntpd_opt_strs+2419)
+/** Name string for the dvar option */
+#define DVAR_name (ntpd_opt_strs+2424)
+/** Compiled in flag settings for the dvar option */
+#define DVAR_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * wait-sync option description with
+ * "Must also have options" and "Incompatible options":
+ */
+#ifdef HAVE_WORKING_FORK
+/** Descriptive text for the wait-sync option */
+#define WAIT_SYNC_DESC (ntpd_opt_strs+2429)
+/** Upper-cased name for the wait-sync option */
+#define WAIT_SYNC_NAME (ntpd_opt_strs+2466)
+/** Name string for the wait-sync option */
+#define WAIT_SYNC_name (ntpd_opt_strs+2476)
+/** Other options that appear in conjunction with the wait-sync option */
+static int const aWait_SyncCantList[] = {
+ INDEX_OPT_NOFORK,
+ INDEX_OPT_QUIT,
+ INDEX_OPT_SAVECONFIGQUIT, NO_EQUIVALENT };
+/** Compiled in flag settings for the wait-sync option */
+#define WAIT_SYNC_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+#else /* disable wait-sync */
+#define WAIT_SYNC_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define aWait_SyncCantList NULL
+#define WAIT_SYNC_NAME NULL
+#define WAIT_SYNC_DESC NULL
+#define WAIT_SYNC_name NULL
+#endif /* HAVE_WORKING_FORK */
+
+/**
+ * slew option description:
+ */
+/** Descriptive text for the slew option */
+#define SLEW_DESC (ntpd_opt_strs+2486)
+/** Upper-cased name for the slew option */
+#define SLEW_NAME (ntpd_opt_strs+2509)
+/** Name string for the slew option */
+#define SLEW_name (ntpd_opt_strs+2514)
+/** Compiled in flag settings for the slew option */
+#define SLEW_FLAGS (OPTST_DISABLED)
+
+/**
+ * usepcc option description:
+ */
+#ifdef SYS_WINNT
+/** Descriptive text for the usepcc option */
+#define USEPCC_DESC (ntpd_opt_strs+2519)
+/** Upper-cased name for the usepcc option */
+#define USEPCC_NAME (ntpd_opt_strs+2556)
+/** Name string for the usepcc option */
+#define USEPCC_name (ntpd_opt_strs+2563)
+/** Compiled in flag settings for the usepcc option */
+#define USEPCC_FLAGS (OPTST_DISABLED)
+
+#else /* disable usepcc */
+#define USEPCC_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define USEPCC_NAME NULL
+#define USEPCC_DESC NULL
+#define USEPCC_name NULL
+#endif /* SYS_WINNT */
+
+/**
+ * pccfreq option description:
+ */
+#ifdef SYS_WINNT
+/** Descriptive text for the pccfreq option */
+#define PCCFREQ_DESC (ntpd_opt_strs+2570)
+/** Upper-cased name for the pccfreq option */
+#define PCCFREQ_NAME (ntpd_opt_strs+2613)
+/** Name string for the pccfreq option */
+#define PCCFREQ_name (ntpd_opt_strs+2621)
+/** Compiled in flag settings for the pccfreq option */
+#define PCCFREQ_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable pccfreq */
+#define PCCFREQ_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define PCCFREQ_NAME NULL
+#define PCCFREQ_DESC NULL
+#define PCCFREQ_name NULL
+#endif /* SYS_WINNT */
+
+/**
+ * mdns option description:
+ */
+#ifdef HAVE_DNSREGISTRATION
+/** Descriptive text for the mdns option */
+#define MDNS_DESC (ntpd_opt_strs+2629)
+/** Upper-cased name for the mdns option */
+#define MDNS_NAME (ntpd_opt_strs+2664)
+/** Name string for the mdns option */
+#define MDNS_name (ntpd_opt_strs+2669)
+/** Compiled in flag settings for the mdns option */
+#define MDNS_FLAGS (OPTST_DISABLED)
+
+#else /* disable mdns */
+#define MDNS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define MDNS_NAME NULL
+#define MDNS_DESC NULL
+#define MDNS_name NULL
+#endif /* HAVE_DNSREGISTRATION */
+
+/*
+ * Help/More_Help/Version option descriptions:
+ */
+#define HELP_DESC (ntpd_opt_strs+2674)
+#define HELP_name (ntpd_opt_strs+2718)
+#ifdef HAVE_WORKING_FORK
+#define MORE_HELP_DESC (ntpd_opt_strs+2723)
+#define MORE_HELP_name (ntpd_opt_strs+2768)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+#define MORE_HELP_DESC HELP_DESC
+#define MORE_HELP_name HELP_name
+#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#endif
+#ifdef NO_OPTIONAL_OPT_ARGS
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
+#endif
+#define VER_DESC (ntpd_opt_strs+2778)
+#define VER_name (ntpd_opt_strs+2814)
+/**
+ * Declare option callback procedures
+ */
+extern tOptProc
+ ntpOptionPrintVersion, optionBooleanVal, optionNestedVal,
+ optionNumericVal, optionPagedUsage, optionResetOpt,
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVendorOption;
+static tOptProc
+ doOptDebug_Level, doUsageOpt;
+#define VER_PROC ntpOptionPrintVersion
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the ntpd Option Descriptions.
+ * This is an array of OPTION_CT entries, one for each
+ * option that the ntpd program responds to.
+ */
+static tOptDesc optDesc[OPTION_CT] = {
+ { /* entry idx, value */ 0, VALUE_OPT_IPV4,
+ /* equiv idx, value */ 0, VALUE_OPT_IPV4,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV4_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv4 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv4CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 1, VALUE_OPT_IPV6,
+ /* equiv idx, value */ 1, VALUE_OPT_IPV6,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV6_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv6 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv6CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 2, VALUE_OPT_AUTHREQ,
+ /* equiv idx, value */ 2, VALUE_OPT_AUTHREQ,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ AUTHREQ_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --authreq */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aAuthreqCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ AUTHREQ_DESC, AUTHREQ_NAME, AUTHREQ_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 3, VALUE_OPT_AUTHNOREQ,
+ /* equiv idx, value */ 3, VALUE_OPT_AUTHNOREQ,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ AUTHNOREQ_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --authnoreq */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aAuthnoreqCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ AUTHNOREQ_DESC, AUTHNOREQ_NAME, AUTHNOREQ_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 4, VALUE_OPT_BCASTSYNC,
+ /* equiv idx, value */ 4, VALUE_OPT_BCASTSYNC,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ BCASTSYNC_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --bcastsync */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ BCASTSYNC_DESC, BCASTSYNC_NAME, BCASTSYNC_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 5, VALUE_OPT_CONFIGFILE,
+ /* equiv idx, value */ 5, VALUE_OPT_CONFIGFILE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ CONFIGFILE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --configfile */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ CONFIGFILE_DESC, CONFIGFILE_NAME, CONFIGFILE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
+ /* equiv idx, value */ 6, VALUE_OPT_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptDebug_Level,
+ /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equiv idx, value */ 7, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --set-debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 8, VALUE_OPT_DRIFTFILE,
+ /* equiv idx, value */ 8, VALUE_OPT_DRIFTFILE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ DRIFTFILE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --driftfile */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ DRIFTFILE_DESC, DRIFTFILE_NAME, DRIFTFILE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 9, VALUE_OPT_PANICGATE,
+ /* equiv idx, value */ 9, VALUE_OPT_PANICGATE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ PANICGATE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --panicgate */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ PANICGATE_DESC, PANICGATE_NAME, PANICGATE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 10, VALUE_OPT_JAILDIR,
+ /* equiv idx, value */ 10, VALUE_OPT_JAILDIR,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ JAILDIR_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --jaildir */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ JAILDIR_DESC, JAILDIR_NAME, JAILDIR_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 11, VALUE_OPT_INTERFACE,
+ /* equiv idx, value */ 11, VALUE_OPT_INTERFACE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ INTERFACE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --interface */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ INTERFACE_DESC, INTERFACE_NAME, INTERFACE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
+ /* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ KEYFILE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --keyfile */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 13, VALUE_OPT_LOGFILE,
+ /* equiv idx, value */ 13, VALUE_OPT_LOGFILE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ LOGFILE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --logfile */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
+ /* equiv idx, value */ 14, VALUE_OPT_NOVIRTUALIPS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ NOVIRTUALIPS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --novirtualips */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ NOVIRTUALIPS_DESC, NOVIRTUALIPS_NAME, NOVIRTUALIPS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
+ /* equiv idx, value */ 15, VALUE_OPT_MODIFYMMTIMER,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MODIFYMMTIMER_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --modifymmtimer */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ MODIFYMMTIMER_DESC, MODIFYMMTIMER_NAME, MODIFYMMTIMER_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 16, VALUE_OPT_NOFORK,
+ /* equiv idx, value */ 16, VALUE_OPT_NOFORK,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ NOFORK_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --nofork */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aNoforkCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 17, VALUE_OPT_NICE,
+ /* equiv idx, value */ 17, VALUE_OPT_NICE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ NICE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --nice */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ NICE_DESC, NICE_NAME, NICE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 18, VALUE_OPT_PIDFILE,
+ /* equiv idx, value */ 18, VALUE_OPT_PIDFILE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PIDFILE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --pidfile */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ PIDFILE_DESC, PIDFILE_NAME, PIDFILE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 19, VALUE_OPT_PRIORITY,
+ /* equiv idx, value */ 19, VALUE_OPT_PRIORITY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PRIORITY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --priority */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 20, VALUE_OPT_QUIT,
+ /* equiv idx, value */ 20, VALUE_OPT_QUIT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ QUIT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --quit */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aQuitCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ QUIT_DESC, QUIT_NAME, QUIT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
+ /* equiv idx, value */ 21, VALUE_OPT_PROPAGATIONDELAY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PROPAGATIONDELAY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --propagationdelay */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ PROPAGATIONDELAY_DESC, PROPAGATIONDELAY_NAME, PROPAGATIONDELAY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
+ /* equiv idx, value */ 22, VALUE_OPT_SAVECONFIGQUIT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SAVECONFIGQUIT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --saveconfigquit */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aSaveconfigquitCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SAVECONFIGQUIT_DESC, SAVECONFIGQUIT_NAME, SAVECONFIGQUIT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 23, VALUE_OPT_STATSDIR,
+ /* equiv idx, value */ 23, VALUE_OPT_STATSDIR,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ STATSDIR_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --statsdir */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ STATSDIR_DESC, STATSDIR_NAME, STATSDIR_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
+ /* equiv idx, value */ 24, VALUE_OPT_TRUSTEDKEY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ TRUSTEDKEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --trustedkey */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ TRUSTEDKEY_DESC, TRUSTEDKEY_NAME, TRUSTEDKEY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 25, VALUE_OPT_USER,
+ /* equiv idx, value */ 25, VALUE_OPT_USER,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ USER_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --user */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ USER_DESC, USER_NAME, USER_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
+ /* equiv idx, value */ 26, VALUE_OPT_UPDATEINTERVAL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ UPDATEINTERVAL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --updateinterval */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ UPDATEINTERVAL_DESC, UPDATEINTERVAL_NAME, UPDATEINTERVAL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 27, VALUE_OPT_VAR,
+ /* equiv idx, value */ 27, VALUE_OPT_VAR,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ VAR_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --var */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ VAR_DESC, VAR_NAME, VAR_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 28, VALUE_OPT_DVAR,
+ /* equiv idx, value */ 28, VALUE_OPT_DVAR,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ DVAR_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --dvar */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ DVAR_DESC, DVAR_NAME, DVAR_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 29, VALUE_OPT_WAIT_SYNC,
+ /* equiv idx, value */ 29, VALUE_OPT_WAIT_SYNC,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ WAIT_SYNC_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --wait-sync */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aWait_SyncCantList,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ WAIT_SYNC_DESC, WAIT_SYNC_NAME, WAIT_SYNC_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 30, VALUE_OPT_SLEW,
+ /* equiv idx, value */ 30, VALUE_OPT_SLEW,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SLEW_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --slew */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 31, VALUE_OPT_USEPCC,
+ /* equiv idx, value */ 31, VALUE_OPT_USEPCC,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ USEPCC_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --usepcc */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ USEPCC_DESC, USEPCC_NAME, USEPCC_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 32, VALUE_OPT_PCCFREQ,
+ /* equiv idx, value */ 32, VALUE_OPT_PCCFREQ,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PCCFREQ_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --pccfreq */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ PCCFREQ_DESC, PCCFREQ_NAME, PCCFREQ_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 33, VALUE_OPT_MDNS,
+ /* equiv idx, value */ 33, VALUE_OPT_MDNS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MDNS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --mdns */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ MDNS_DESC, MDNS_NAME, MDNS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ VER_PROC,
+ /* desc, NAME, name */ VER_DESC, NULL, VER_name,
+ /* disablement strs */ NULL, NULL },
+
+
+
+ { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doUsageOpt,
+ /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionPagedUsage,
+ /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
+ /* disablement strs */ NULL, NULL }
+};
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of ntpd. */
+#define zPROGNAME (ntpd_opt_strs+2822)
+/** Reference to the title line for ntpd usage. */
+#define zUsageTitle (ntpd_opt_strs+2827)
+/** There is no ntpd configuration file. */
+#define zRcName NULL
+/** There are no directories to search for ntpd config files. */
+#define apzHomeList NULL
+/** The ntpd program bug email address. */
+#define zBugsAddr (ntpd_opt_strs+2960)
+/** Clarification/explanation of what ntpd does. */
+#define zExplain (ntpd_opt_strs+2994)
+/** Extra detail explaining what ntpd does. */
+#define zDetail (NULL)
+/** The full version string for ntpd. */
+#define zFullVersion (ntpd_opt_strs+2996)
+/* extracted from optcode.tlib near line 364 */
+
+#if defined(ENABLE_NLS)
+# define OPTPROC_BASE OPTPROC_TRANSLATE
+ static tOptionXlateProc translate_option_strings;
+#else
+# define OPTPROC_BASE OPTPROC_NONE
+# define translate_option_strings NULL
+#endif /* ENABLE_NLS */
+
+#define ntpd_full_usage (NULL)
+#define ntpd_short_usage (NULL)
+
+#endif /* not defined __doxygen__ */
+
+/*
+ * Create the static procedure(s) declared above.
+ */
+/**
+ * The callout function that invokes the optionUsage function.
+ *
+ * @param[in] opts the AutoOpts option description structure
+ * @param[in] od the descriptor for the "help" (usage) option.
+ * @noreturn
+ */
+static void
+doUsageOpt(tOptions * opts, tOptDesc * od)
+{
+ int ex_code;
+ ex_code = NTPD_EXIT_SUCCESS;
+ optionUsage(&ntpdOptions, ex_code);
+ /* NOTREACHED */
+ exit(1);
+ (void)opts;
+ (void)od;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the debug-level option.
+ *
+ * @param[in] pOptions the ntpd options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ /*
+ * Be sure the flag-code[0] handles special values for the options pointer
+ * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
+ * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
+ * reset its state.
+ */
+ /* extracted from debug-opt.def, line 15 */
+OPT_VALUE_SET_DEBUG_LEVEL++;
+ (void)pOptDesc;
+ (void)pOptions;
+}
+/* extracted from optmain.tlib near line 1245 */
+
+/**
+ * The directory containing the data associated with ntpd.
+ */
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+/**
+ * Information about the person or institution that packaged ntpd
+ * for the current distribution.
+ */
+#ifndef WITH_PACKAGER
+# define ntpd_packager_info NULL
+#else
+/** Packager information for ntpd. */
+static char const ntpd_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpd bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+#ifndef __doxygen__
+
+#endif /* __doxygen__ */
+/**
+ * The option definitions for ntpd. The one structure that
+ * binds them all.
+ */
+tOptions ntpdOptions = {
+ OPTIONS_STRUCT_VERSION,
+ 0, NULL, /* original argc + argv */
+ ( OPTPROC_BASE
+ + OPTPROC_ERRSTOP
+ + OPTPROC_SHORTOPT
+ + OPTPROC_LONGOPT
+ + OPTPROC_NO_REQ_OPT
+ + OPTPROC_ENVIRON
+ + OPTPROC_MISUSE ),
+ 0, NULL, /* current option index, current option */
+ NULL, NULL, zPROGNAME,
+ zRcName, zCopyright, zLicenseDescrip,
+ zFullVersion, apzHomeList, zUsageTitle,
+ zExplain, zDetail, optDesc,
+ zBugsAddr, /* address to send bugs to */
+ NULL, NULL, /* extensions/saved state */
+ optionUsage, /* usage procedure */
+ translate_option_strings, /* translation procedure */
+ /*
+ * Indexes to special options
+ */
+ { INDEX_OPT_MORE_HELP, /* more-help option index */
+ NO_EQUIVALENT, /* save option index */
+ NO_EQUIVALENT, /* '-#' option index */
+ NO_EQUIVALENT /* index of default opt */
+ },
+ 37 /* full option count */, 34 /* user option count */,
+ ntpd_full_usage, ntpd_short_usage,
+ NULL, NULL,
+ PKGDATADIR, ntpd_packager_info
+};
+
+#if ENABLE_NLS
+/**
+ * This code is designed to translate translatable option text for the
+ * ntpd program. These translations happen upon entry
+ * to optionProcess().
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#ifdef HAVE_DCGETTEXT
+# include <gettext.h>
+#endif
+#include <autoopts/usage-txt.h>
+
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
+
+/**
+ * AutoGen specific wrapper function for gettext. It relies on the macro _()
+ * to convert from English to the target language, then strdup-duplicates the
+ * result string. It tries the "libopts" domain first, then whatever has been
+ * set via the \a textdomain(3) call.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
+AO_gettext(char const * pz)
+{
+ char * res;
+ if (pz == NULL)
+ return NULL;
+#ifdef HAVE_DCGETTEXT
+ /*
+ * While processing the option_xlateable_txt data, try to use the
+ * "libopts" domain. Once we switch to the option descriptor data,
+ * do *not* use that domain.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ res = dgettext("libopts", pz);
+ if (res == pz)
+ res = (char *)(void *)_(pz);
+ } else
+ res = (char *)(void *)_(pz);
+#else
+ res = (char *)(void *)_(pz);
+#endif
+ if (res == pz)
+ return res;
+ res = strdup(res);
+ if (res == NULL) {
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(NTPD_EXIT_FAILURE);
+ }
+ return res;
+}
+
+/**
+ * All the pointers we use are marked "* const", but they are stored in
+ * writable memory. Coerce the mutability and set the pointer.
+ */
+static void coerce_it(void ** s) { *s = AO_gettext(*s);
+}
+
+/**
+ * Translate all the translatable strings in the ntpdOptions
+ * structure defined above. This is done only once.
+ */
+static void
+translate_option_strings(void)
+{
+ tOptions * const opts = &ntpdOptions;
+
+ /*
+ * Guard against re-translation. It won't work. The strings will have
+ * been changed by the first pass through this code. One shot only.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ /*
+ * Do the translations. The first pointer follows the field count
+ * field. The field count field is the size of a pointer.
+ */
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
+
+ do {
+ ppz++; /* skip over field_ct */
+ *ppz = AO_gettext(*ppz);
+ } while (--ix > 0);
+ /* prevent re-translation and disable "libopts" domain lookup */
+ option_xlateable_txt.field_ct = 0;
+
+ coerce_it((void*)&(opts->pzCopyright));
+ coerce_it((void*)&(opts->pzCopyNotice));
+ coerce_it((void*)&(opts->pzFullVersion));
+ coerce_it((void*)&(opts->pzUsageTitle));
+ coerce_it((void*)&(opts->pzExplain));
+ coerce_it((void*)&(opts->pzDetail));
+ {
+ tOptDesc * od = opts->pOptDesc;
+ for (ix = opts->optCt; ix > 0; ix--, od++)
+ coerce_it((void*)&(od->pzText));
+ }
+ }
+}
+#endif /* ENABLE_NLS */
+
+#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
+/** I18N function strictly for xgettext. Do not compile. */
+static void bogus_function(void) {
+ /* TRANSLATORS:
+
+ The following dummy function was crated solely so that xgettext can
+ extract the correct strings. These strings are actually referenced
+ by a field name in the ntpdOptions structure noted in the
+ comments below. The literal text is defined in ntpd_opt_strs.
+
+ NOTE: the strings below are segmented with respect to the source string
+ ntpd_opt_strs. The strings above are handed off for translation
+ at run time a paragraph at a time. Consequently, they are presented here
+ for translation a paragraph at a time.
+
+ ALSO: often the description for an option will reference another option
+ by name. These are set off with apostrophe quotes (I hope). Do not
+ translate option names.
+ */
+ /* referenced via ntpdOptions.pzCopyright */
+ puts(_("ntpd 4.2.7p482\n\
+Copyright (C) 1970-2014 The University of Delaware, 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\
+can be seen at:\n"));
+ puts(_(" <http://ntp.org/license>\n\
+ <http://opensource.org/licenses/ntp-license.php>\n"));
+
+ /* referenced via ntpdOptions.pzCopyNotice */
+ puts(_("Permission to use, copy, modify, and distribute this software and its\n\
+documentation for any purpose with or without fee is hereby granted,\n\
+provided that the above copyright notice appears in all copies and that\n\
+both the copyright notice and this permission notice appear in supporting\n\
+documentation, and that the name The University of Delaware not be used in\n\
+advertising or publicity pertaining to distribution of the software without\n\
+specific, written prior permission. The University of Delaware makes no\n\
+representations about the suitability this software for any purpose. It is\n\
+provided \"as is\" without express or implied warranty.\n"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Force IPv4 DNS name resolution"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Force IPv6 DNS name resolution"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Require crypto authentication"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Do not require crypto authentication"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Allow us to sync to broadcast servers"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("configuration file name"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Increase debug verbosity level"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Set the debug verbosity level"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("frequency drift file name"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Allow the first adjustment to be Big"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Jail directory"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Listen on an interface name or address"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("path to symmetric keys"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("path to the log file"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Do not listen to virtual interfaces"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Modify Multimedia Timer (Windows only)"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Do not fork"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Run at high priority"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("path to the PID file"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Process priority"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Set the time and quit"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Broadcast/propagation delay"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Save parsed configuration and quit"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Statistics file location"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Trusted key number"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Run as userid (or userid:groupid)"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("interval in seconds between scans for new or dropped interfaces"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("make ARG an ntp variable (RW)"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("make ARG an ntp variable (RW|DEF)"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Seconds to wait for first clock sync"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Slew up to 600 seconds"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Use CPU cycle counter (Windows only)"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Force CPU cycle counter use (Windows only)"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("Register with mDNS as a NTP server"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("display extended usage information and exit"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("extended usage information passed thru pager"));
+
+ /* referenced via ntpdOptions.pOptDesc->pzText */
+ puts(_("output version information and exit"));
+
+ /* referenced via ntpdOptions.pzUsageTitle */
+ puts(_("ntpd - NTP daemon program - Ver. 4.2.7p482\n\
+Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
+\t\t[ <server1> ... <serverN> ]\n"));
+
+ /* referenced via ntpdOptions.pzExplain */
+ puts(_("\n"));
+
+ /* referenced via ntpdOptions.pzFullVersion */
+ puts(_("ntpd 4.2.7p482"));
+
+ /* referenced via ntpdOptions.pzFullUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+
+ /* referenced via ntpdOptions.pzShortUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 86 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 84 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 88 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* uncompilable code */
+#ifdef __cplusplus
+}
+#endif
+/* ntpd-opts.c ends here */
diff --git a/ntpd/ntpd-opts.def b/ntpd/ntpd-opts.def
new file mode 100644
index 0000000..dee484d
--- /dev/null
+++ b/ntpd/ntpd-opts.def
@@ -0,0 +1,611 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include copyright.def
+
+prog-name = "ntpd";
+prog-title = "NTP daemon program";
+argument = "[ <server1> ... <serverN> ]";
+
+#include ntpdbase-opts.def
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+The
+.Nm
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC-5905,
+but also retains compatibility with
+version 3, as defined by RFC-1305, and versions 1
+and 2, as defined by RFC-1059 and RFC-1119, respectively.
+.Pp
+The
+.Nm
+utility does most computations in 64-bit floating point
+arithmetic and does relatively clumsy 64-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+.Pp
+Ordinarily,
+.Nm
+reads the
+.Xr ntp.conf 5
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+.Pp
+If NetInfo support is built into
+.Nm ,
+then
+.Nm
+will attempt to read its configuration from the
+NetInfo if the default
+.Xr ntp.conf 5
+file cannot be read and no file is
+specified by the
+.Fl c
+option.
+.Pp
+Various internal
+.Nm
+variables can be displayed and
+configuration options altered while the
+.Nm
+is running
+using the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+.Pp
+When
+.Nm
+starts it looks at the value of
+.Xr umask 2 ,
+and if zero
+.Nm
+will set the
+.Xr umask 2
+to 022.
+ _END_PROG_MDOC_DESCRIP;
+};
+
+doc-section = {
+ ds-type = 'USAGE';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_USAGE
+.Ss "How NTP Operates"
+The
+.Nm
+utility operates by exchanging messages with
+one or more configured servers over a range of designated poll intervals.
+When
+started, whether for the first or subsequent times, the program
+requires several exchanges from the majority of these servers so
+the signal processing and mitigation algorithms can accumulate and
+groom the data and set the clock.
+In order to protect the network
+from bursts, the initial poll interval for each server is delayed
+an interval randomized over a few seconds.
+At the default initial poll
+interval of 64s, several minutes can elapse before the clock is
+set.
+This initial delay to set the clock
+can be safely and dramatically reduced using the
+.Cm iburst
+keyword with the
+.Ic server
+configuration
+command, as described in
+.Xr ntp.conf 5 .
+.Pp
+Most operating systems and hardware of today incorporate a
+time-of-year (TOY) chip to maintain the time during periods when
+the power is off.
+When the machine is booted, the chip is used to
+initialize the operating system time.
+After the machine has
+synchronized to a NTP server, the operating system corrects the
+chip from time to time.
+In the default case, if
+.Nm
+detects that the time on the host
+is more than 1000s from the server time,
+.Nm
+assumes something must be terribly wrong and the only
+reliable action is for the operator to intervene and set the clock
+by hand.
+(Reasons for this include there is no TOY chip,
+or its battery is dead, or that the TOY chip is just of poor quality.)
+This causes
+.Nm
+to exit with a panic message to
+the system log.
+The
+.Fl g
+option overrides this check and the
+clock will be set to the server time regardless of the chip time
+(up to 68 years in the past or future \(em
+this is a limitation of the NTPv4 protocol).
+However, and to protect against broken hardware, such as when the
+CMOS battery fails or the clock counter becomes defective, once the
+clock has been set an error greater than 1000s will cause
+.Nm
+to exit anyway.
+.Pp
+Under ordinary conditions,
+.Nm
+adjusts the clock in
+small steps so that the timescale is effectively continuous and
+without discontinuities.
+Under conditions of extreme network
+congestion, the roundtrip delay jitter can exceed three seconds and
+the synchronization distance, which is equal to one-half the
+roundtrip delay plus error budget terms, can become very large.
+The
+.Nm
+algorithms discard sample offsets exceeding 128 ms,
+unless the interval during which no sample offset is less than 128
+ms exceeds 900s.
+The first sample after that, no matter what the
+offset, steps the clock to the indicated time.
+In practice this
+reduces the false alarm rate where the clock is stepped in error to
+a vanishingly low incidence.
+.Pp
+As the result of this behavior, once the clock has been set it
+very rarely strays more than 128 ms even under extreme cases of
+network path congestion and jitter.
+Sometimes, in particular when
+.Nm
+is first started without a valid drift file
+on a system with a large intrinsic drift
+the error might grow to exceed 128 ms,
+which would cause the clock to be set backwards
+if the local clock time is more than 128 s
+in the future relative to the server.
+In some applications, this behavior may be unacceptable.
+There are several solutions, however.
+If the
+.Fl x
+option is included on the command line, the clock will
+never be stepped and only slew corrections will be used.
+But this choice comes with a cost that
+should be carefully explored before deciding to use
+the
+.Fl x
+option.
+The maximum slew rate possible is limited
+to 500 parts-per-million (PPM) as a consequence of the correctness
+principles on which the NTP protocol and algorithm design are
+based.
+As a result, the local clock can take a long time to
+converge to an acceptable offset, about 2,000 s for each second the
+clock is outside the acceptable range.
+During this interval the
+local clock will not be consistent with any other network clock and
+the system cannot be used for distributed applications that require
+correctly synchronized network time.
+.Pp
+In spite of the above precautions, sometimes when large
+frequency errors are present the resulting time offsets stray
+outside the 128-ms range and an eventual step or slew time
+correction is required.
+If following such a correction the
+frequency error is so large that the first sample is outside the
+acceptable range,
+.Nm
+enters the same state as when the
+.Pa ntp.drift
+file is not present.
+The intent of this behavior
+is to quickly correct the frequency and restore operation to the
+normal tracking mode.
+In the most extreme cases
+(the host
+.Cm time.ien.it
+comes to mind), there may be occasional
+step/slew corrections and subsequent frequency corrections.
+It
+helps in these cases to use the
+.Cm burst
+keyword when
+configuring the server, but
+ONLY
+when you have permission to do so from the owner of the target host.
+.Pp
+Finally,
+in the past many startup scripts would run
+.Xr ntpdate 1ntpdatemdoc
+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.
+If you are following the instructions in
+.Sx "Starting NTP (Best Current Practice)"
+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 .
+.Pp
+There is a way to start
+.Xr ntpd 1ntpdmdoc
+that often addresses all of the problems mentioned above.
+.Ss "Starting NTP (Best Current Practice)"
+First, use the
+.Cm iburst
+option on your
+.Cm server
+entries.
+.Pp
+If you can also keep a good
+.Pa ntp.drift
+file then
+.Xr ntpd 1ntpdmdoc
+will effectively "warm-start" and your system's clock will
+be stable in under 11 seconds' time.
+.Pp
+As soon as possible in the startup sequence, start
+.Xr ntpd 1ntpdmdoc
+with at least the
+.Fl g
+and perhaps the
+.Fl N
+options.
+Then,
+start the rest of your "normal" processes.
+This will give
+.Xr ntpd 1ntpdmdoc
+as much time as possible to get the system's clock synchronized and stable.
+.Pp
+Finally,
+if you have processes like
+.Cm dovecot
+or database servers
+that require
+monotonically-increasing time,
+run
+.Xr ntp-wait 1ntp-waitmdoc
+as late as possible in the boot sequence
+(perhaps with the
+.Fl v
+flag)
+and after
+.Xr ntp-wait 1ntp-waitmdoc
+exits successfully
+it is as safe as it will ever be to start any process that require
+stable time.
+.Ss "Frequency Discipline"
+The
+.Nm
+behavior at startup depends on whether the
+frequency file, usually
+.Pa ntp.drift ,
+exists.
+This file
+contains the latest estimate of clock frequency error.
+When the
+.Nm
+is started and the file does not exist, the
+.Nm
+enters a special mode designed to quickly adapt to
+the particular system clock oscillator time and frequency error.
+This takes approximately 15 minutes, after which the time and
+frequency are set to nominal values and the
+.Nm
+enters
+normal mode, where the time and frequency are continuously tracked
+relative to the server.
+After one hour the frequency file is
+created and the current frequency offset written to it.
+When the
+.Nm
+is started and the file does exist, the
+.Nm
+frequency is initialized from the file and enters normal mode
+immediately.
+After that the current frequency offset is written to
+the file at hourly intervals.
+.Ss "Operating Modes"
+The
+.Nm
+utility can operate in any of several modes, including
+symmetric active/passive, client/server broadcast/multicast and
+manycast, as described in the
+.Qq Association Management
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+It normally operates continuously while
+monitoring for small changes in frequency and trimming the clock
+for the ultimate precision.
+However, it can operate in a one-time
+mode where the time is set from an external server and frequency is
+set from a previously recorded frequency file.
+A
+broadcast/multicast or manycast client can discover remote servers,
+compute server-client propagation delay correction factors and
+configure itself automatically.
+This makes it possible to deploy a
+fleet of workstations without specifying configuration details
+specific to the local environment.
+.Pp
+By default,
+.Nm
+runs in continuous mode where each of
+possibly several external servers is polled at intervals determined
+by an intricate state machine.
+The state machine measures the
+incidental roundtrip delay jitter and oscillator frequency wander
+and determines the best poll interval using a heuristic algorithm.
+Ordinarily, and in most operating environments, the state machine
+will start with 64s intervals and eventually increase in steps to
+1024s.
+A small amount of random variation is introduced in order to
+avoid bunching at the servers.
+In addition, should a server become
+unreachable for some time, the poll interval is increased in steps
+to 1024s in order to reduce network overhead.
+.Pp
+In some cases it may not be practical for
+.Nm
+to run continuously.
+A common workaround has been to run the
+.Xr ntpdate 1ntpdatemdoc
+or
+.Xr sntp 1sntpmdoc
+programs from a
+.Xr cron 8
+job at designated
+times.
+However, these programs do not have the crafted signal
+processing, error checking or mitigation algorithms of
+.Nm .
+The
+.Fl q
+option is intended for this purpose.
+Setting this option will cause
+.Nm
+to exit just after
+setting the clock for the first time.
+The procedure for initially
+setting the clock is the same as in continuous mode; most
+applications will probably want to specify the
+.Cm iburst
+keyword with the
+.Ic server
+configuration command.
+With this
+keyword a volley of messages are exchanged to groom the data and
+the clock is set in about 10 s.
+If nothing is heard after a
+couple of minutes, the daemon times out and exits.
+After a suitable
+period of mourning, the
+.Xr ntpdate 1ntpdatemdoc
+program will be
+retired.
+.Pp
+When kernel support is available to discipline the clock
+frequency, which is the case for stock Solaris, Tru64, Linux and
+.Fx ,
+a useful feature is available to discipline the clock
+frequency.
+First,
+.Nm
+is run in continuous mode with
+selected servers in order to measure and record the intrinsic clock
+frequency offset in the frequency file.
+It may take some hours for
+the frequency and offset to settle down.
+Then the
+.Nm
+is
+stopped and run in one-time mode as required.
+At each startup, the
+frequency is read from the file and initializes the kernel
+frequency.
+.Ss "Poll Interval Control"
+This version of NTP includes an intricate state machine to
+reduce the network load while maintaining a quality of
+synchronization consistent with the observed jitter and wander.
+There are a number of ways to tailor the operation in order enhance
+accuracy by reducing the interval or to reduce network overhead by
+increasing it.
+However, the user is advised to carefully consider
+the consequences of changing the poll adjustment range from the
+default minimum of 64 s to the default maximum of 1,024 s.
+The
+default minimum can be changed with the
+.Ic tinker
+.Cm minpoll
+command to a value not less than 16 s.
+This value is used for all
+configured associations, unless overridden by the
+.Cm minpoll
+option on the configuration command.
+Note that most device drivers
+will not operate properly if the poll interval is less than 64 s
+and that the broadcast server and manycast client associations will
+also use the default, unless overridden.
+.Pp
+In some cases involving dial up or toll services, it may be
+useful to increase the minimum interval to a few tens of minutes
+and maximum interval to a day or so.
+Under normal operation
+conditions, once the clock discipline loop has stabilized the
+interval will be increased in steps from the minimum to the
+maximum.
+However, this assumes the intrinsic clock frequency error
+is small enough for the discipline loop correct it.
+The capture
+range of the loop is 500 PPM at an interval of 64s decreasing by a
+factor of two for each doubling of interval.
+At a minimum of 1,024
+s, for example, the capture range is only 31 PPM.
+If the intrinsic
+error is greater than this, the drift file
+.Pa ntp.drift
+will
+have to be specially tailored to reduce the residual error below
+this limit.
+Once this is done, the drift file is automatically
+updated once per hour and is available to initialize the frequency
+on subsequent daemon restarts.
+.Ss "The huff-n'-puff Filter"
+In scenarios where a considerable amount of data are to be
+downloaded or uploaded over telephone modems, timekeeping quality
+can be seriously degraded.
+This occurs because the differential
+delays on the two directions of transmission can be quite large.
+In
+many cases the apparent time errors are so large as to exceed the
+step threshold and a step correction can occur during and after the
+data transfer is in progress.
+.Pp
+The huff-n'-puff filter is designed to correct the apparent time
+offset in these cases.
+It depends on knowledge of the propagation
+delay when no other traffic is present.
+In common scenarios this
+occurs during other than work hours.
+The filter maintains a shift
+register that remembers the minimum delay over the most recent
+interval measured usually in hours.
+Under conditions of severe
+delay, the filter corrects the apparent offset using the sign of
+the offset and the difference between the apparent delay and
+minimum delay.
+The name of the filter reflects the negative (huff)
+and positive (puff) correction, which depends on the sign of the
+offset.
+.Pp
+The filter is activated by the
+.Ic tinker
+command and
+.Cm huffpuff
+keyword, as described in
+.Xr ntp.conf 5 .
+ _END_MDOC_USAGE;
+};
+
+doc-section = {
+ ds-type = 'FILES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_FILES
+.Bl -tag -width /etc/ntp.drift -compact
+.It Pa /etc/ntp.conf
+the default name of the configuration file
+.It Pa /etc/ntp.drift
+the default name of the drift file
+.It Pa /etc/ntp.keys
+the default name of the key file
+.El
+ _END_MDOC_FILES;
+};
+
+doc-section = {
+ ds-type = 'SEE ALSO';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_SEE_ALSO
+.Xr ntp.conf 5 ,
+.Xr ntpdate 1ntpdatemdoc ,
+.Xr ntpdc 1ntpdcmdoc ,
+.Xr ntpq 1ntpqmdoc ,
+.Xr sntp 1sntpmdoc
+.Pp
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+.Li http://www.ntp.org/ .
+A snapshot of this documentation is available in HTML format in
+.Pa /usr/share/doc/ntp .
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 1)
+.%O RFC1059
+.Re
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 2)
+.%O RFC1119
+.Re
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 3)
+.%O RFC1305
+.Re
+.Rs
+.%A David L. Mills
+.%A J. Martin, Ed.
+.%A J. Burbank
+.%A W. Kasch
+.%T Network Time Protocol Version 4: Protocol and Algorithms Specification
+.%O RFC5905
+.Re
+.Rs
+.%A David L. Mills
+.%A B. Haberman, Ed.
+.%T Network Time Protocol Version 4: Autokey Specification
+.%O RFC5906
+.Re
+.Rs
+.%A H. Gerstung
+.%A C. Elliott
+.%A B. Haberman, Ed.
+.%T Definitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)
+.%O RFC5907
+.Re
+.Rs
+.%A R. Gayraud
+.%A B. Lourdelet
+.%T Network Time Protocol (NTP) Server Option for DHCPv6
+.%O RFC5908
+.Re
+ _END_MDOC_SEE_ALSO;
+};
+
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+The
+.Nm
+utility has gotten rather fat.
+While not huge, it has gotten
+larger than might be desirable for an elevated-priority
+.Nm
+running on a workstation, particularly since many of
+the fancy features which consume the space were designed more with
+a busy primary server, rather than a high stratum workstation in
+mind.
+ _END_MDOC_BUGS;
+};
+
+doc-section = {
+ ds-type = 'NOTES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_NOTES
+Portions of this document came from FreeBSD.
+ _END_MDOC_NOTES;
+};
diff --git a/ntpd/ntpd-opts.h b/ntpd/ntpd-opts.h
new file mode 100644
index 0000000..7a33779
--- /dev/null
+++ b/ntpd/ntpd-opts.h
@@ -0,0 +1,458 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:54:07 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpd-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpd author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpd program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+/**
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the ntpd program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_NTPD_OPTS_H_GUARD
+#define AUTOOPTS_NTPD_OPTS_H_GUARD 1
+#include "config.h"
+#include <autoopts/options.h>
+
+/**
+ * Ensure that the library used for compiling this generated header is at
+ * least as new as the version current when the header template was released
+ * (not counting patch version increments). Also ensure that the oldest
+ * tolerable version is at least as old as what was current when the header
+ * template was released.
+ */
+#define AO_TEMPLATE_VERSION 167936
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+ Choke Me.
+#endif
+
+/**
+ * Enumeration of each option type for ntpd
+ */
+typedef enum {
+ INDEX_OPT_IPV4 = 0,
+ INDEX_OPT_IPV6 = 1,
+ INDEX_OPT_AUTHREQ = 2,
+ INDEX_OPT_AUTHNOREQ = 3,
+ INDEX_OPT_BCASTSYNC = 4,
+ INDEX_OPT_CONFIGFILE = 5,
+ INDEX_OPT_DEBUG_LEVEL = 6,
+ INDEX_OPT_SET_DEBUG_LEVEL = 7,
+ INDEX_OPT_DRIFTFILE = 8,
+ INDEX_OPT_PANICGATE = 9,
+ INDEX_OPT_JAILDIR = 10,
+ INDEX_OPT_INTERFACE = 11,
+ INDEX_OPT_KEYFILE = 12,
+ INDEX_OPT_LOGFILE = 13,
+ INDEX_OPT_NOVIRTUALIPS = 14,
+ INDEX_OPT_MODIFYMMTIMER = 15,
+ INDEX_OPT_NOFORK = 16,
+ INDEX_OPT_NICE = 17,
+ INDEX_OPT_PIDFILE = 18,
+ INDEX_OPT_PRIORITY = 19,
+ INDEX_OPT_QUIT = 20,
+ INDEX_OPT_PROPAGATIONDELAY = 21,
+ INDEX_OPT_SAVECONFIGQUIT = 22,
+ INDEX_OPT_STATSDIR = 23,
+ INDEX_OPT_TRUSTEDKEY = 24,
+ INDEX_OPT_USER = 25,
+ INDEX_OPT_UPDATEINTERVAL = 26,
+ INDEX_OPT_VAR = 27,
+ INDEX_OPT_DVAR = 28,
+ INDEX_OPT_WAIT_SYNC = 29,
+ INDEX_OPT_SLEW = 30,
+ INDEX_OPT_USEPCC = 31,
+ INDEX_OPT_PCCFREQ = 32,
+ INDEX_OPT_MDNS = 33,
+ INDEX_OPT_VERSION = 34,
+ INDEX_OPT_HELP = 35,
+ INDEX_OPT_MORE_HELP = 36
+} teOptIndex;
+/** count of all options for ntpd */
+#define OPTION_CT 37
+/** ntpd version */
+#define NTPD_VERSION "4.2.7p482"
+/** Full ntpd version text */
+#define NTPD_FULL_VERSION "ntpd 4.2.7p482"
+
+/**
+ * Interface defines for all options. Replace "n" with the UPPER_CASED
+ * option name (as in the teOptIndex enumeration above).
+ * e.g. HAVE_OPT(IPV4)
+ */
+#define DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n])
+/** 'true' if an option has been specified in any way */
+#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
+/** The string argument to an option. The argument type must be \"string\". */
+#define OPT_ARG(n) (DESC(n).optArg.argString)
+/** Mask the option state revealing how an option was specified.
+ * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
+ * \a OPTST_DEFINED, \a OPTST_RESET or zero.
+ */
+#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
+/** Count of option's occurrances *on the command line*. */
+#define COUNT_OPT(n) (DESC(n).optOccCt)
+/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
+#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
+/** 'true' if \a HAVE_OPT would yield 'false'. */
+#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
+/** 'true' if OPTST_DISABLED bit not set. */
+#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
+/** number of stacked option arguments.
+ * Valid only for stacked option arguments. */
+#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
+/** stacked argument vector.
+ * Valid only for stacked option arguments. */
+#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
+/** Reset an option. */
+#define CLEAR_OPT(n) STMTS( \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ DESC(n).fOptState |= OPTST_DISABLED; \
+ DESC(n).optCookie = NULL )
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Enumeration of ntpd exit codes
+ */
+typedef enum {
+ NTPD_EXIT_SUCCESS = 0,
+ NTPD_EXIT_FAILURE = 1,
+ NTPD_EXIT_USAGE_ERROR = 64,
+ NTPD_EXIT_LIBOPTS_FAILURE = 70
+} ntpd_exit_code_t;
+/** @} */
+/**
+ * Make sure there are no #define name conflicts with the option names
+ */
+#ifndef NO_OPTION_NAME_WARNINGS
+# ifdef IPV4
+# warning undefining IPV4 due to option name conflict
+# undef IPV4
+# endif
+# ifdef IPV6
+# warning undefining IPV6 due to option name conflict
+# undef IPV6
+# endif
+# ifdef AUTHREQ
+# warning undefining AUTHREQ due to option name conflict
+# undef AUTHREQ
+# endif
+# ifdef AUTHNOREQ
+# warning undefining AUTHNOREQ due to option name conflict
+# undef AUTHNOREQ
+# endif
+# ifdef BCASTSYNC
+# warning undefining BCASTSYNC due to option name conflict
+# undef BCASTSYNC
+# endif
+# ifdef CONFIGFILE
+# warning undefining CONFIGFILE due to option name conflict
+# undef CONFIGFILE
+# endif
+# ifdef DEBUG_LEVEL
+# warning undefining DEBUG_LEVEL due to option name conflict
+# undef DEBUG_LEVEL
+# endif
+# ifdef SET_DEBUG_LEVEL
+# warning undefining SET_DEBUG_LEVEL due to option name conflict
+# undef SET_DEBUG_LEVEL
+# endif
+# ifdef DRIFTFILE
+# warning undefining DRIFTFILE due to option name conflict
+# undef DRIFTFILE
+# endif
+# ifdef PANICGATE
+# warning undefining PANICGATE due to option name conflict
+# undef PANICGATE
+# endif
+# ifdef JAILDIR
+# warning undefining JAILDIR due to option name conflict
+# undef JAILDIR
+# endif
+# ifdef INTERFACE
+# warning undefining INTERFACE due to option name conflict
+# undef INTERFACE
+# endif
+# ifdef KEYFILE
+# warning undefining KEYFILE due to option name conflict
+# undef KEYFILE
+# endif
+# ifdef LOGFILE
+# warning undefining LOGFILE due to option name conflict
+# undef LOGFILE
+# endif
+# ifdef NOVIRTUALIPS
+# warning undefining NOVIRTUALIPS due to option name conflict
+# undef NOVIRTUALIPS
+# endif
+# ifdef MODIFYMMTIMER
+# warning undefining MODIFYMMTIMER due to option name conflict
+# undef MODIFYMMTIMER
+# endif
+# ifdef NOFORK
+# warning undefining NOFORK due to option name conflict
+# undef NOFORK
+# endif
+# ifdef NICE
+# warning undefining NICE due to option name conflict
+# undef NICE
+# endif
+# ifdef PIDFILE
+# warning undefining PIDFILE due to option name conflict
+# undef PIDFILE
+# endif
+# ifdef PRIORITY
+# warning undefining PRIORITY due to option name conflict
+# undef PRIORITY
+# endif
+# ifdef QUIT
+# warning undefining QUIT due to option name conflict
+# undef QUIT
+# endif
+# ifdef PROPAGATIONDELAY
+# warning undefining PROPAGATIONDELAY due to option name conflict
+# undef PROPAGATIONDELAY
+# endif
+# ifdef SAVECONFIGQUIT
+# warning undefining SAVECONFIGQUIT due to option name conflict
+# undef SAVECONFIGQUIT
+# endif
+# ifdef STATSDIR
+# warning undefining STATSDIR due to option name conflict
+# undef STATSDIR
+# endif
+# ifdef TRUSTEDKEY
+# warning undefining TRUSTEDKEY due to option name conflict
+# undef TRUSTEDKEY
+# endif
+# ifdef USER
+# warning undefining USER due to option name conflict
+# undef USER
+# endif
+# ifdef UPDATEINTERVAL
+# warning undefining UPDATEINTERVAL due to option name conflict
+# undef UPDATEINTERVAL
+# endif
+# ifdef VAR
+# warning undefining VAR due to option name conflict
+# undef VAR
+# endif
+# ifdef DVAR
+# warning undefining DVAR due to option name conflict
+# undef DVAR
+# endif
+# ifdef WAIT_SYNC
+# warning undefining WAIT_SYNC due to option name conflict
+# undef WAIT_SYNC
+# endif
+# ifdef SLEW
+# warning undefining SLEW due to option name conflict
+# undef SLEW
+# endif
+# ifdef USEPCC
+# warning undefining USEPCC due to option name conflict
+# undef USEPCC
+# endif
+# ifdef PCCFREQ
+# warning undefining PCCFREQ due to option name conflict
+# undef PCCFREQ
+# endif
+# ifdef MDNS
+# warning undefining MDNS due to option name conflict
+# undef MDNS
+# endif
+#else /* NO_OPTION_NAME_WARNINGS */
+# undef IPV4
+# undef IPV6
+# undef AUTHREQ
+# undef AUTHNOREQ
+# undef BCASTSYNC
+# undef CONFIGFILE
+# undef DEBUG_LEVEL
+# undef SET_DEBUG_LEVEL
+# undef DRIFTFILE
+# undef PANICGATE
+# undef JAILDIR
+# undef INTERFACE
+# undef KEYFILE
+# undef LOGFILE
+# undef NOVIRTUALIPS
+# undef MODIFYMMTIMER
+# undef NOFORK
+# undef NICE
+# undef PIDFILE
+# undef PRIORITY
+# undef QUIT
+# undef PROPAGATIONDELAY
+# undef SAVECONFIGQUIT
+# undef STATSDIR
+# undef TRUSTEDKEY
+# undef USER
+# undef UPDATEINTERVAL
+# undef VAR
+# undef DVAR
+# undef WAIT_SYNC
+# undef SLEW
+# undef USEPCC
+# undef PCCFREQ
+# undef MDNS
+#endif /* NO_OPTION_NAME_WARNINGS */
+
+/**
+ * Interface defines for specific options.
+ * @{
+ */
+#define VALUE_OPT_IPV4 '4'
+#define VALUE_OPT_IPV6 '6'
+#define VALUE_OPT_AUTHREQ 'a'
+#define VALUE_OPT_AUTHNOREQ 'A'
+#define VALUE_OPT_BCASTSYNC 'b'
+#define VALUE_OPT_CONFIGFILE 'c'
+#define VALUE_OPT_DEBUG_LEVEL 'd'
+#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
+
+#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
+#define VALUE_OPT_DRIFTFILE 'f'
+#define VALUE_OPT_PANICGATE 'g'
+#define VALUE_OPT_JAILDIR 'i'
+#define VALUE_OPT_INTERFACE 'I'
+#define VALUE_OPT_KEYFILE 'k'
+#define VALUE_OPT_LOGFILE 'l'
+#define VALUE_OPT_NOVIRTUALIPS 'L'
+#define VALUE_OPT_MODIFYMMTIMER 'M'
+#define VALUE_OPT_NOFORK 'n'
+#define VALUE_OPT_NICE 'N'
+#define VALUE_OPT_PIDFILE 'p'
+#define VALUE_OPT_PRIORITY 'P'
+
+#define OPT_VALUE_PRIORITY (DESC(PRIORITY).optArg.argInt)
+#define VALUE_OPT_QUIT 'q'
+#define VALUE_OPT_PROPAGATIONDELAY 'r'
+#define VALUE_OPT_SAVECONFIGQUIT 0x1001
+#define VALUE_OPT_STATSDIR 's'
+#define VALUE_OPT_TRUSTEDKEY 't'
+#define VALUE_OPT_USER 'u'
+#define VALUE_OPT_UPDATEINTERVAL 'U'
+
+#define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
+#define VALUE_OPT_VAR 0x1002
+#define VALUE_OPT_DVAR 0x1003
+#define VALUE_OPT_WAIT_SYNC 'w'
+#ifdef HAVE_WORKING_FORK
+#define OPT_VALUE_WAIT_SYNC (DESC(WAIT_SYNC).optArg.argInt)
+#endif /* HAVE_WORKING_FORK */
+#define VALUE_OPT_SLEW 'x'
+#define VALUE_OPT_USEPCC 0x1004
+#define VALUE_OPT_PCCFREQ 0x1005
+#define VALUE_OPT_MDNS 'm'
+/** option flag (value) for help-value option */
+#define VALUE_OPT_HELP '?'
+/** option flag (value) for more-help-value option */
+#define VALUE_OPT_MORE_HELP '!'
+/** option flag (value) for version-value option */
+#define VALUE_OPT_VERSION 0x1006
+/*
+ * Interface defines not associated with particular options
+ */
+#define ERRSKIP_OPTERR STMTS(ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(ntpdOptions.fOptSet |= OPTPROC_ERRSTOP)
+#define RESTART_OPT(n) STMTS( \
+ ntpdOptions.curOptIdx = (n); \
+ ntpdOptions.pzCurOpt = NULL )
+#define START_OPT RESTART_OPT(1)
+#define USAGE(c) (*ntpdOptions.pUsageProc)(&ntpdOptions, c)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* * * * * *
+ *
+ * Declare the ntpd option descriptor.
+ */
+extern tOptions ntpdOptions;
+
+#if defined(ENABLE_NLS)
+# ifndef _
+# include <stdio.h>
+# ifndef HAVE_GETTEXT
+ extern char * gettext(char const *);
+# else
+# include <libintl.h>
+# endif
+
+# ifndef ATTRIBUTE_FORMAT_ARG
+# define ATTRIBUTE_FORMAT_ARG(_a)
+# endif
+
+static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
+static inline char* aoGetsText(char const* pz) {
+ if (pz == NULL) return NULL;
+ return (char*)gettext(pz);
+}
+# define _(s) aoGetsText(s)
+# endif /* _() */
+
+# define OPT_NO_XLAT_CFG_NAMES STMTS(ntpdOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT_CFG;)
+# define OPT_NO_XLAT_OPT_NAMES STMTS(ntpdOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
+
+# define OPT_XLAT_CFG_NAMES STMTS(ntpdOptions.fOptSet &= \
+ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
+# define OPT_XLAT_OPT_NAMES STMTS(ntpdOptions.fOptSet &= \
+ ~OPTPROC_NXLAT_OPT;)
+
+#else /* ENABLE_NLS */
+# define OPT_NO_XLAT_CFG_NAMES
+# define OPT_NO_XLAT_OPT_NAMES
+
+# define OPT_XLAT_CFG_NAMES
+# define OPT_XLAT_OPT_NAMES
+
+# ifndef _
+# define _(_s) _s
+# endif
+#endif /* ENABLE_NLS */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
+
+/* ntpd-opts.h ends here */
diff --git a/ntpd/ntpd.1ntpdman b/ntpd/ntpd.1ntpdman
new file mode 100644
index 0000000..810e071
--- /dev/null
+++ b/ntpd/ntpd.1ntpdman
@@ -0,0 +1,987 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpd 1ntpdman "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-AtaWSL/ag-MtaORL)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:46 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpd-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpd\fP
+\- NTP daemon program
+.SH SYNOPSIS
+\f\*[B-Font]ntpd\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ <server1> ... <serverN> ]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The
+\f\*[B-Font]ntpd\fP
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC-5905,
+but also retains compatibility with
+version 3, as defined by RFC-1305, and versions 1
+and 2, as defined by RFC-1059 and RFC-1119, respectively.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]ntpd\fP
+utility does most computations in 64-bit floating point
+arithmetic and does relatively clumsy 64-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily,
+\f\*[B-Font]ntpd\fP
+reads the
+\fCntp.conf\fR(5)\f[]
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+.sp \n(Ppu
+.ne 2
+
+If NetInfo support is built into
+\f\*[B-Font]ntpd\fP,
+then
+\f\*[B-Font]ntpd\fP
+will attempt to read its configuration from the
+NetInfo if the default
+\fCntp.conf\fR(5)\f[]
+file cannot be read and no file is
+specified by the
+\f\*[B-Font]\-c\f[]
+option.
+.sp \n(Ppu
+.ne 2
+
+Various internal
+\f\*[B-Font]ntpd\fP
+variables can be displayed and
+configuration options altered while the
+\f\*[B-Font]ntpd\fP
+is running
+using the
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utility programs.
+.sp \n(Ppu
+.ne 2
+
+When
+\f\*[B-Font]ntpd\fP
+starts it looks at the value of
+\fCumask\fR(2)\f[],
+and if zero
+\f\*[B-Font]ntpd\fP
+will set the
+\fCumask\fR(2)\f[]
+to 022.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-a\f[], \f\*[B-Font]\-\-authreq\f[]
+Require crypto authentication.
+This option must not appear in combination with any of the following options:
+authnoreq.
+.sp
+Require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is the default.
+.TP
+.NOP \f\*[B-Font]\-A\f[], \f\*[B-Font]\-\-authnoreq\f[]
+Do not require crypto authentication.
+This option must not appear in combination with any of the following options:
+authreq.
+.sp
+Do not require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is almost never a good idea.
+.TP
+.NOP \f\*[B-Font]\-b\f[], \f\*[B-Font]\-\-bcastsync\f[]
+Allow us to sync to broadcast servers.
+.sp
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-configfile\f[]=\f\*[I-Font]string\f[]
+configuration file name.
+.sp
+The name and path of the configuration file,
+\fI/etc/ntp.conf\fP
+by default.
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-f\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-driftfile\f[]=\f\*[I-Font]string\f[]
+frequency drift file name.
+.sp
+The name and path of the frequency file,
+\fI/etc/ntp.drift\fP
+by default.
+This is the same operation as the
+\fBdriftfile\fP \fIdriftfile\fP
+configuration specification in the
+\fI/etc/ntp.conf\fP
+file.
+.TP
+.NOP \f\*[B-Font]\-g\f[], \f\*[B-Font]\-\-panicgate\f[]
+Allow the first adjustment to be Big.
+This option may appear an unlimited number of times.
+.sp
+Normally,
+\fBntpd\fP
+exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+\fBntpd\fP
+will exit with a message to the system log. This option can be used with the
+\fB-q\fP
+and
+\fB-x\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+.TP
+.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[]
+Jail directory.
+.sp
+Chroot the server to the directory
+\fIjaildir\fP
+.
+This option also implies that the server attempts to drop root privileges at startup.
+You may need to also specify a
+\fB-u\fP
+option.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB--enable-clockctl\fP) or Linux (configure with
+\fB--enable-linuxcaps\fP) or Solaris (configure with \fB--enable-solarisprivs\fP).
+.TP
+.NOP \f\*[B-Font]\-I\f[] \f\*[I-Font]iface\f[], \f\*[B-Font]\-\-interface\f[]=\f\*[I-Font]iface\f[]
+Listen on an interface name or address.
+This option may appear an unlimited number of times.
+.sp
+Open the network address given, or all the addresses associated with the
+given interface name. This option may appear multiple times. This option
+also implies not opening other addresses, except wildcard and localhost.
+This option is deprecated. Please consider using the configuration file
+\fBinterface\fP command, which is more versatile.
+.TP
+.NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]string\f[]
+path to symmetric keys.
+.sp
+Specify the name and path of the symmetric key file.
+\fI/etc/ntp.keys\fP
+is the default.
+This is the same operation as the
+\fBkeys\fP \fIkeyfile\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]string\f[]
+path to the log file.
+.sp
+Specify the name and path of the log file.
+The default is the system log file.
+This is the same operation as the
+\fBlogfile\fP \fIlogfile\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-L\f[], \f\*[B-Font]\-\-novirtualips\f[]
+Do not listen to virtual interfaces.
+.sp
+Do not listen to virtual interfaces, defined as those with
+names containing a colon. This option is deprecated. Please
+consider using the configuration file \fBinterface\fP command, which
+is more versatile.
+.TP
+.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-modifymmtimer\f[]
+Modify Multimedia Timer (Windows only).
+.sp
+Set the Windows Multimedia Timer to highest resolution. This
+ensures the resolution does not change while ntpd is running,
+avoiding timekeeping glitches associated with changes.
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-nofork\f[]
+Do not fork.
+This option must not appear in combination with any of the following options:
+wait-sync.
+.sp
+.TP
+.NOP \f\*[B-Font]\-N\f[], \f\*[B-Font]\-\-nice\f[]
+Run at high priority.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the highest priority.
+.TP
+.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-pidfile\f[]=\f\*[I-Font]string\f[]
+path to the PID file.
+.sp
+Specify the name and path of the file used to record
+\fBntpd\fP's
+process ID.
+This is the same operation as the
+\fBpidfile\fP \fIpidfile\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-P\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-priority\f[]=\f\*[I-Font]number\f[]
+Process priority.
+This option takes an integer number as its argument.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the specified
+\fBsched_setscheduler(SCHED_FIFO)\fP
+priority.
+.TP
+.NOP \f\*[B-Font]\-q\f[], \f\*[B-Font]\-\-quit\f[]
+Set the time and quit.
+This option must not appear in combination with any of the following options:
+saveconfigquit, wait-sync.
+.sp
+\fBntpd\fP
+will not daemonize and will exit after the clock is first
+synchronized. This behavior mimics that of the
+\fBntpdate\fP
+program, which will soon be replaced with a shell script.
+The
+\fB-g\fP
+and
+\fB-x\fP
+options can be used with this option.
+Note: The kernel time discipline is disabled with this option.
+.TP
+.NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-propagationdelay\f[]=\f\*[I-Font]string\f[]
+Broadcast/propagation delay.
+.sp
+Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+.TP
+.NOP \f\*[B-Font]\-\-saveconfigquit\f[]=\f\*[I-Font]string\f[]
+Save parsed configuration and quit.
+This option must not appear in combination with any of the following options:
+quit, wait-sync.
+.sp
+Cause \fBntpd\fP to parse its startup configuration file and save an
+equivalent to the given filename and exit. This option was
+designed for automated testing.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-statsdir\f[]=\f\*[I-Font]string\f[]
+Statistics file location.
+.sp
+Specify the directory path for files created by the statistics facility.
+This is the same operation as the
+\fBstatsdir\fP \fIstatsdir\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]tkey\f[], \f\*[B-Font]\-\-trustedkey\f[]=\f\*[I-Font]tkey\f[]
+Trusted key number.
+This option may appear an unlimited number of times.
+.sp
+Add the specified key number to the trusted key list.
+.TP
+.NOP \f\*[B-Font]\-u\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-user\f[]=\f\*[I-Font]string\f[]
+Run as userid (or userid:groupid).
+.sp
+Specify a user, and optionally a group, to switch to.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB--enable-clockctl\fP) or Linux (configure with
+\fB--enable-linuxcaps\fP) or Solaris (configure with \fB--enable-solarisprivs\fP).
+.TP
+.NOP \f\*[B-Font]\-U\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-updateinterval\f[]=\f\*[I-Font]number\f[]
+interval in seconds between scans for new or dropped interfaces.
+This option takes an integer number as its argument.
+.sp
+Give the time in seconds between two scans for new or dropped interfaces.
+For systems with routing socket support the scans will be performed shortly after the interface change
+has been detected by the system.
+Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+.TP
+.NOP \f\*[B-Font]\-\-var\f[]=\f\*[I-Font]nvar\f[]
+make ARG an ntp variable (RW).
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-dvar\f[]=\f\*[I-Font]ndvar\f[]
+make ARG an ntp variable (RW|DEF).
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-w\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-wait\-sync\f[]=\f\*[I-Font]number\f[]
+Seconds to wait for first clock sync.
+This option must not appear in combination with any of the following options:
+nofork, quit, saveconfigquit.
+This option takes an integer number as its argument.
+.sp
+If greater than zero, alters \fBntpd\fP's behavior when forking to
+daemonize. Instead of exiting with status 0 immediately after
+the fork, the parent waits up to the specified number of
+seconds for the child to first synchronize the clock. The exit
+status is zero (success) if the clock was synchronized,
+otherwise it is \fBETIMEDOUT\fP.
+This provides the option for a script starting \fBntpd\fP to easily
+wait for the first set of the clock before proceeding.
+.TP
+.NOP \f\*[B-Font]\-x\f[], \f\*[B-Font]\-\-slew\f[]
+Slew up to 600 seconds.
+.sp
+Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+This option can be used with the
+\fB-g\fP
+and
+\fB-q\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+Note: The kernel time discipline is disabled with this option.
+.TP
+.NOP \f\*[B-Font]\-\-usepcc\f[]
+Use CPU cycle counter (Windows only).
+.sp
+Attempt to substitute the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter and \fBQueryPerformanceCounter\fP are compared, and if
+they have the same frequency, the CPU counter (RDTSC on x86) is
+used directly, saving the overhead of a system call.
+.TP
+.NOP \f\*[B-Font]\-\-pccfreq\f[]=\f\*[I-Font]string\f[]
+Force CPU cycle counter use (Windows only).
+.sp
+Force substitution the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter (RDTSC on x86) is used unconditionally with the
+given frequency (in Hz).
+.TP
+.NOP \f\*[B-Font]\-m\f[], \f\*[B-Font]\-\-mdns\f[]
+Register with mDNS as a NTP server.
+.sp
+Registers as an NTP server with the local mDNS server which allows
+the server to be discovered via mDNS client lookup.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTPD_<option-name>\fP or \fBNTPD\fP
+.fi
+.ad
+.SH USAGE
+.SS "How NTP Operates"
+The
+\f\*[B-Font]ntpd\fP
+utility operates by exchanging messages with
+one or more configured servers over a range of designated poll intervals.
+When
+started, whether for the first or subsequent times, the program
+requires several exchanges from the majority of these servers so
+the signal processing and mitigation algorithms can accumulate and
+groom the data and set the clock.
+In order to protect the network
+from bursts, the initial poll interval for each server is delayed
+an interval randomized over a few seconds.
+At the default initial poll
+interval of 64s, several minutes can elapse before the clock is
+set.
+This initial delay to set the clock
+can be safely and dramatically reduced using the
+\f\*[B-Font]iburst\f[]
+keyword with the
+\f\*[B-Font]server\f[]
+configuration
+command, as described in
+\fCntp.conf\fR(5)\f[].
+.sp \n(Ppu
+.ne 2
+
+Most operating systems and hardware of today incorporate a
+time-of-year (TOY) chip to maintain the time during periods when
+the power is off.
+When the machine is booted, the chip is used to
+initialize the operating system time.
+After the machine has
+synchronized to a NTP server, the operating system corrects the
+chip from time to time.
+In the default case, if
+\f\*[B-Font]ntpd\fP
+detects that the time on the host
+is more than 1000s from the server time,
+\f\*[B-Font]ntpd\fP
+assumes something must be terribly wrong and the only
+reliable action is for the operator to intervene and set the clock
+by hand.
+(Reasons for this include there is no TOY chip,
+or its battery is dead, or that the TOY chip is just of poor quality.)
+This causes
+\f\*[B-Font]ntpd\fP
+to exit with a panic message to
+the system log.
+The
+\f\*[B-Font]\-g\f[]
+option overrides this check and the
+clock will be set to the server time regardless of the chip time
+(up to 68 years in the past or future \(em
+this is a limitation of the NTPv4 protocol).
+However, and to protect against broken hardware, such as when the
+CMOS battery fails or the clock counter becomes defective, once the
+clock has been set an error greater than 1000s will cause
+\f\*[B-Font]ntpd\fP
+to exit anyway.
+.sp \n(Ppu
+.ne 2
+
+Under ordinary conditions,
+\f\*[B-Font]ntpd\fP
+adjusts the clock in
+small steps so that the timescale is effectively continuous and
+without discontinuities.
+Under conditions of extreme network
+congestion, the roundtrip delay jitter can exceed three seconds and
+the synchronization distance, which is equal to one-half the
+roundtrip delay plus error budget terms, can become very large.
+The
+\f\*[B-Font]ntpd\fP
+algorithms discard sample offsets exceeding 128 ms,
+unless the interval during which no sample offset is less than 128
+ms exceeds 900s.
+The first sample after that, no matter what the
+offset, steps the clock to the indicated time.
+In practice this
+reduces the false alarm rate where the clock is stepped in error to
+a vanishingly low incidence.
+.sp \n(Ppu
+.ne 2
+
+As the result of this behavior, once the clock has been set it
+very rarely strays more than 128 ms even under extreme cases of
+network path congestion and jitter.
+Sometimes, in particular when
+\f\*[B-Font]ntpd\fP
+is first started without a valid drift file
+on a system with a large intrinsic drift
+the error might grow to exceed 128 ms,
+which would cause the clock to be set backwards
+if the local clock time is more than 128 s
+in the future relative to the server.
+In some applications, this behavior may be unacceptable.
+There are several solutions, however.
+If the
+\f\*[B-Font]\-x\f[]
+option is included on the command line, the clock will
+never be stepped and only slew corrections will be used.
+But this choice comes with a cost that
+should be carefully explored before deciding to use
+the
+\f\*[B-Font]\-x\f[]
+option.
+The maximum slew rate possible is limited
+to 500 parts-per-million (PPM) as a consequence of the correctness
+principles on which the NTP protocol and algorithm design are
+based.
+As a result, the local clock can take a long time to
+converge to an acceptable offset, about 2,000 s for each second the
+clock is outside the acceptable range.
+During this interval the
+local clock will not be consistent with any other network clock and
+the system cannot be used for distributed applications that require
+correctly synchronized network time.
+.sp \n(Ppu
+.ne 2
+
+In spite of the above precautions, sometimes when large
+frequency errors are present the resulting time offsets stray
+outside the 128-ms range and an eventual step or slew time
+correction is required.
+If following such a correction the
+frequency error is so large that the first sample is outside the
+acceptable range,
+\f\*[B-Font]ntpd\fP
+enters the same state as when the
+\fIntp.drift\f[]
+file is not present.
+The intent of this behavior
+is to quickly correct the frequency and restore operation to the
+normal tracking mode.
+In the most extreme cases
+(the host
+\f\*[B-Font]time.ien.it\f[]
+comes to mind), there may be occasional
+step/slew corrections and subsequent frequency corrections.
+It
+helps in these cases to use the
+\f\*[B-Font]burst\f[]
+keyword when
+configuring the server, but
+ONLY
+when you have permission to do so from the owner of the target host.
+.sp \n(Ppu
+.ne 2
+
+Finally,
+in the past many startup scripts would run
+\fCntpdate\fR(1ntpdatemdoc)\f[]
+to get the system clock close to correct before starting
+\fCntpd\fR(1ntpdmdoc)\f[],
+but this was never more than a mediocre hack and is no longer needed.
+If you are following the instructions in
+\fIStarting NTP (Best Current Practice)\f[]
+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\fR(1sntpmdoc)\f[].
+.sp \n(Ppu
+.ne 2
+
+There is a way to start
+\fCntpd\fR(1ntpdmdoc)\f[]
+that often addresses all of the problems mentioned above.
+.SS "Starting NTP (Best Current Practice)"
+First, use the
+\f\*[B-Font]iburst\f[]
+option on your
+\f\*[B-Font]server\f[]
+entries.
+.sp \n(Ppu
+.ne 2
+
+If you can also keep a good
+\fIntp.drift\f[]
+file then
+\fCntpd\fR(1ntpdmdoc)\f[]
+will effectively "warm-start" and your system's clock will
+be stable in under 11 seconds' time.
+.sp \n(Ppu
+.ne 2
+
+As soon as possible in the startup sequence, start
+\fCntpd\fR(1ntpdmdoc)\f[]
+with at least the
+\f\*[B-Font]\-g\f[]
+and perhaps the
+\f\*[B-Font]\-N\f[]
+options.
+Then,
+start the rest of your "normal" processes.
+This will give
+\fCntpd\fR(1ntpdmdoc)\f[]
+as much time as possible to get the system's clock synchronized and stable.
+.sp \n(Ppu
+.ne 2
+
+Finally,
+if you have processes like
+\f\*[B-Font]dovecot\f[]
+or database servers
+that require
+monotonically-increasing time,
+run
+\fCntp-wait\fR(1ntp-waitmdoc)\f[]
+as late as possible in the boot sequence
+(perhaps with the
+\f\*[B-Font]\-v\f[]
+flag)
+and after
+\fCntp-wait\fR(1ntp-waitmdoc)\f[]
+exits successfully
+it is as safe as it will ever be to start any process that require
+stable time.
+.SS "Frequency Discipline"
+The
+\f\*[B-Font]ntpd\fP
+behavior at startup depends on whether the
+frequency file, usually
+\fIntp.drift\f[],
+exists.
+This file
+contains the latest estimate of clock frequency error.
+When the
+\f\*[B-Font]ntpd\fP
+is started and the file does not exist, the
+\f\*[B-Font]ntpd\fP
+enters a special mode designed to quickly adapt to
+the particular system clock oscillator time and frequency error.
+This takes approximately 15 minutes, after which the time and
+frequency are set to nominal values and the
+\f\*[B-Font]ntpd\fP
+enters
+normal mode, where the time and frequency are continuously tracked
+relative to the server.
+After one hour the frequency file is
+created and the current frequency offset written to it.
+When the
+\f\*[B-Font]ntpd\fP
+is started and the file does exist, the
+\f\*[B-Font]ntpd\fP
+frequency is initialized from the file and enters normal mode
+immediately.
+After that the current frequency offset is written to
+the file at hourly intervals.
+.SS "Operating Modes"
+The
+\f\*[B-Font]ntpd\fP
+utility can operate in any of several modes, including
+symmetric active/passive, client/server broadcast/multicast and
+manycast, as described in the
+"Association Management"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+It normally operates continuously while
+monitoring for small changes in frequency and trimming the clock
+for the ultimate precision.
+However, it can operate in a one-time
+mode where the time is set from an external server and frequency is
+set from a previously recorded frequency file.
+A
+broadcast/multicast or manycast client can discover remote servers,
+compute server-client propagation delay correction factors and
+configure itself automatically.
+This makes it possible to deploy a
+fleet of workstations without specifying configuration details
+specific to the local environment.
+.sp \n(Ppu
+.ne 2
+
+By default,
+\f\*[B-Font]ntpd\fP
+runs in continuous mode where each of
+possibly several external servers is polled at intervals determined
+by an intricate state machine.
+The state machine measures the
+incidental roundtrip delay jitter and oscillator frequency wander
+and determines the best poll interval using a heuristic algorithm.
+Ordinarily, and in most operating environments, the state machine
+will start with 64s intervals and eventually increase in steps to
+1024s.
+A small amount of random variation is introduced in order to
+avoid bunching at the servers.
+In addition, should a server become
+unreachable for some time, the poll interval is increased in steps
+to 1024s in order to reduce network overhead.
+.sp \n(Ppu
+.ne 2
+
+In some cases it may not be practical for
+\f\*[B-Font]ntpd\fP
+to run continuously.
+A common workaround has been to run the
+\fCntpdate\fR(1ntpdatemdoc)\f[]
+or
+\fCsntp\fR(1sntpmdoc)\f[]
+programs from a
+\fCcron\fR(8)\f[]
+job at designated
+times.
+However, these programs do not have the crafted signal
+processing, error checking or mitigation algorithms of
+\f\*[B-Font]ntpd\fP.
+The
+\f\*[B-Font]\-q\f[]
+option is intended for this purpose.
+Setting this option will cause
+\f\*[B-Font]ntpd\fP
+to exit just after
+setting the clock for the first time.
+The procedure for initially
+setting the clock is the same as in continuous mode; most
+applications will probably want to specify the
+\f\*[B-Font]iburst\f[]
+keyword with the
+\f\*[B-Font]server\f[]
+configuration command.
+With this
+keyword a volley of messages are exchanged to groom the data and
+the clock is set in about 10 s.
+If nothing is heard after a
+couple of minutes, the daemon times out and exits.
+After a suitable
+period of mourning, the
+\fCntpdate\fR(1ntpdatemdoc)\f[]
+program will be
+retired.
+.sp \n(Ppu
+.ne 2
+
+When kernel support is available to discipline the clock
+frequency, which is the case for stock Solaris, Tru64, Linux and
+FreeBSD,
+a useful feature is available to discipline the clock
+frequency.
+First,
+\f\*[B-Font]ntpd\fP
+is run in continuous mode with
+selected servers in order to measure and record the intrinsic clock
+frequency offset in the frequency file.
+It may take some hours for
+the frequency and offset to settle down.
+Then the
+\f\*[B-Font]ntpd\fP
+is
+stopped and run in one-time mode as required.
+At each startup, the
+frequency is read from the file and initializes the kernel
+frequency.
+.SS "Poll Interval Control"
+This version of NTP includes an intricate state machine to
+reduce the network load while maintaining a quality of
+synchronization consistent with the observed jitter and wander.
+There are a number of ways to tailor the operation in order enhance
+accuracy by reducing the interval or to reduce network overhead by
+increasing it.
+However, the user is advised to carefully consider
+the consequences of changing the poll adjustment range from the
+default minimum of 64 s to the default maximum of 1,024 s.
+The
+default minimum can be changed with the
+\f\*[B-Font]tinker\f[]
+\f\*[B-Font]minpoll\f[]
+command to a value not less than 16 s.
+This value is used for all
+configured associations, unless overridden by the
+\f\*[B-Font]minpoll\f[]
+option on the configuration command.
+Note that most device drivers
+will not operate properly if the poll interval is less than 64 s
+and that the broadcast server and manycast client associations will
+also use the default, unless overridden.
+.sp \n(Ppu
+.ne 2
+
+In some cases involving dial up or toll services, it may be
+useful to increase the minimum interval to a few tens of minutes
+and maximum interval to a day or so.
+Under normal operation
+conditions, once the clock discipline loop has stabilized the
+interval will be increased in steps from the minimum to the
+maximum.
+However, this assumes the intrinsic clock frequency error
+is small enough for the discipline loop correct it.
+The capture
+range of the loop is 500 PPM at an interval of 64s decreasing by a
+factor of two for each doubling of interval.
+At a minimum of 1,024
+s, for example, the capture range is only 31 PPM.
+If the intrinsic
+error is greater than this, the drift file
+\fIntp.drift\f[]
+will
+have to be specially tailored to reduce the residual error below
+this limit.
+Once this is done, the drift file is automatically
+updated once per hour and is available to initialize the frequency
+on subsequent daemon restarts.
+.SS "The huff-n'-puff Filter"
+In scenarios where a considerable amount of data are to be
+downloaded or uploaded over telephone modems, timekeeping quality
+can be seriously degraded.
+This occurs because the differential
+delays on the two directions of transmission can be quite large.
+In
+many cases the apparent time errors are so large as to exceed the
+step threshold and a step correction can occur during and after the
+data transfer is in progress.
+.sp \n(Ppu
+.ne 2
+
+The huff-n'-puff filter is designed to correct the apparent time
+offset in these cases.
+It depends on knowledge of the propagation
+delay when no other traffic is present.
+In common scenarios this
+occurs during other than work hours.
+The filter maintains a shift
+register that remembers the minimum delay over the most recent
+interval measured usually in hours.
+Under conditions of severe
+delay, the filter corrects the apparent offset using the sign of
+the offset and the difference between the apparent delay and
+minimum delay.
+The name of the filter reflects the negative (huff)
+and positive (puff) correction, which depends on the sign of the
+offset.
+.sp \n(Ppu
+.ne 2
+
+The filter is activated by the
+\f\*[B-Font]tinker\f[]
+command and
+\f\*[B-Font]huffpuff\f[]
+keyword, as described in
+\fCntp.conf\fR(5)\f[].
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH FILES
+.TP 15
+.NOP \fI/etc/ntp.conf\f[]
+the default name of the configuration file
+.br
+.ns
+.TP 15
+.NOP \fI/etc/ntp.drift\f[]
+the default name of the drift file
+.br
+.ns
+.TP 15
+.NOP \fI/etc/ntp.keys\f[]
+the default name of the key file
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "SEE ALSO"
+\fCntp.conf\fR(5)\f[],
+\fCntpdate\fR(1ntpdatemdoc)\f[],
+\fCntpdc\fR(1ntpdcmdoc)\f[],
+\fCntpq\fR(1ntpqmdoc)\f[],
+\fCsntp\fR(1sntpmdoc)\f[]
+.sp \n(Ppu
+.ne 2
+
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+\f[C]http://www.ntp.org/\f[].
+A snapshot of this documentation is available in HTML format in
+\fI/usr/share/doc/ntp\f[].
+David L. Mills,
+\fINetwork Time Protocol (Version 1)\fR,
+RFC1059
+.PP
+
+David L. Mills,
+\fINetwork Time Protocol (Version 2)\fR,
+RFC1119
+.PP
+
+David L. Mills,
+\fINetwork Time Protocol (Version 3)\fR,
+RFC1305
+.PP
+
+David L. Mills and J. Martin, Ed. and J. Burbank and W. Kasch,
+\fINetwork Time Protocol Version 4: Protocol and Algorithms Specification\fR,
+RFC5905
+.PP
+
+David L. Mills and B. Haberman, Ed.,
+\fINetwork Time Protocol Version 4: Autokey Specification\fR,
+RFC5906
+.PP
+
+H. Gerstung and C. Elliott and B. Haberman, Ed.,
+\fIDefinitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)\fR,
+RFC5907
+.PP
+
+R. Gayraud and B. Lourdelet,
+\fINetwork Time Protocol (NTP) Server Option for DHCPv6\fR,
+RFC5908
+.PP
+
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+The
+\f\*[B-Font]ntpd\fP
+utility has gotten rather fat.
+While not huge, it has gotten
+larger than might be desirable for an elevated-priority
+\f\*[B-Font]ntpd\fP
+running on a workstation, particularly since many of
+the fancy features which consume the space were designed more with
+a busy primary server, rather than a high stratum workstation in
+mind.
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+Portions of this document came from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntpd\fP
+option definitions.
diff --git a/ntpd/ntpd.1ntpdmdoc b/ntpd/ntpd.1ntpdmdoc
new file mode 100644
index 0000000..5b02dd1
--- /dev/null
+++ b/ntpd/ntpd.1ntpdmdoc
@@ -0,0 +1,891 @@
+.Dd December 2 2014
+.Dt NTPD 1ntpdmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:03 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpd-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpd
+.Nd NTP daemon program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ <server1> ... <serverN> ]
+.Pp
+.Sh DESCRIPTION
+The
+.Nm
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC\-5905,
+but also retains compatibility with
+version 3, as defined by RFC\-1305, and versions 1
+and 2, as defined by RFC\-1059 and RFC\-1119, respectively.
+.Pp
+The
+.Nm
+utility does most computations in 64\-bit floating point
+arithmetic and does relatively clumsy 64\-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+.Pp
+Ordinarily,
+.Nm
+reads the
+.Xr ntp.conf 5
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+.Pp
+If NetInfo support is built into
+.Nm ,
+then
+.Nm
+will attempt to read its configuration from the
+NetInfo if the default
+.Xr ntp.conf 5
+file cannot be read and no file is
+specified by the
+.Fl c
+option.
+.Pp
+Various internal
+.Nm
+variables can be displayed and
+configuration options altered while the
+.Nm
+is running
+using the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+.Pp
+When
+.Nm
+starts it looks at the value of
+.Xr umask 2 ,
+and if zero
+.Nm
+will set the
+.Xr umask 2
+to 022.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.It Fl a , Fl \-authreq
+Require crypto authentication.
+This option must not appear in combination with any of the following options:
+authnoreq.
+.sp
+Require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is the default.
+.It Fl A , Fl \-authnoreq
+Do not require crypto authentication.
+This option must not appear in combination with any of the following options:
+authreq.
+.sp
+Do not require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is almost never a good idea.
+.It Fl b , Fl \-bcastsync
+Allow us to sync to broadcast servers.
+.sp
+.It Fl c Ar string , Fl \-configfile Ns = Ns Ar string
+configuration file name.
+.sp
+The name and path of the configuration file,
+\fI/etc/ntp.conf\fP
+by default.
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl f Ar string , Fl \-driftfile Ns = Ns Ar string
+frequency drift file name.
+.sp
+The name and path of the frequency file,
+\fI/etc/ntp.drift\fP
+by default.
+This is the same operation as the
+\fBdriftfile\fP \fIdriftfile\fP
+configuration specification in the
+\fI/etc/ntp.conf\fP
+file.
+.It Fl g , Fl \-panicgate
+Allow the first adjustment to be Big.
+This option may appear an unlimited number of times.
+.sp
+Normally,
+\fBntpd\fP
+exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+\fBntpd\fP
+will exit with a message to the system log. This option can be used with the
+\fB\-q\fP
+and
+\fB\-x\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+.It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string
+Jail directory.
+.sp
+Chroot the server to the directory
+\fIjaildir\fP
+.
+This option also implies that the server attempts to drop root privileges at startup.
+You may need to also specify a
+\fB\-u\fP
+option.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB\-\-enable\-clockctl\fP) or Linux (configure with
+\fB\-\-enable\-linuxcaps\fP) or Solaris (configure with \fB\-\-enable\-solarisprivs\fP).
+.It Fl I Ar iface , Fl \-interface Ns = Ns Ar iface
+Listen on an interface name or address.
+This option may appear an unlimited number of times.
+.sp
+Open the network address given, or all the addresses associated with the
+given interface name. This option may appear multiple times. This option
+also implies not opening other addresses, except wildcard and localhost.
+This option is deprecated. Please consider using the configuration file
+\fBinterface\fP command, which is more versatile.
+.It Fl k Ar string , Fl \-keyfile Ns = Ns Ar string
+path to symmetric keys.
+.sp
+Specify the name and path of the symmetric key file.
+\fI/etc/ntp.keys\fP
+is the default.
+This is the same operation as the
+\fBkeys\fP \fIkeyfile\fP
+configuration file directive.
+.It Fl l Ar string , Fl \-logfile Ns = Ns Ar string
+path to the log file.
+.sp
+Specify the name and path of the log file.
+The default is the system log file.
+This is the same operation as the
+\fBlogfile\fP \fIlogfile\fP
+configuration file directive.
+.It Fl L , Fl \-novirtualips
+Do not listen to virtual interfaces.
+.sp
+Do not listen to virtual interfaces, defined as those with
+names containing a colon. This option is deprecated. Please
+consider using the configuration file \fBinterface\fP command, which
+is more versatile.
+.It Fl M , Fl \-modifymmtimer
+Modify Multimedia Timer (Windows only).
+.sp
+Set the Windows Multimedia Timer to highest resolution. This
+ensures the resolution does not change while ntpd is running,
+avoiding timekeeping glitches associated with changes.
+.It Fl n , Fl \-nofork
+Do not fork.
+This option must not appear in combination with any of the following options:
+wait\-sync.
+.sp
+.It Fl N , Fl \-nice
+Run at high priority.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the highest priority.
+.It Fl p Ar string , Fl \-pidfile Ns = Ns Ar string
+path to the PID file.
+.sp
+Specify the name and path of the file used to record
+\fBntpd\fP's
+process ID.
+This is the same operation as the
+\fBpidfile\fP \fIpidfile\fP
+configuration file directive.
+.It Fl P Ar number , Fl \-priority Ns = Ns Ar number
+Process priority.
+This option takes an integer number as its argument.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the specified
+\fBsched_setscheduler(SCHED_FIFO)\fP
+priority.
+.It Fl q , Fl \-quit
+Set the time and quit.
+This option must not appear in combination with any of the following options:
+saveconfigquit, wait\-sync.
+.sp
+\fBntpd\fP
+will not daemonize and will exit after the clock is first
+synchronized. This behavior mimics that of the
+\fBntpdate\fP
+program, which will soon be replaced with a shell script.
+The
+\fB\-g\fP
+and
+\fB\-x\fP
+options can be used with this option.
+Note: The kernel time discipline is disabled with this option.
+.It Fl r Ar string , Fl \-propagationdelay Ns = Ns Ar string
+Broadcast/propagation delay.
+.sp
+Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+.It Fl \-saveconfigquit Ns = Ns Ar string
+Save parsed configuration and quit.
+This option must not appear in combination with any of the following options:
+quit, wait\-sync.
+.sp
+Cause \fBntpd\fP to parse its startup configuration file and save an
+equivalent to the given filename and exit. This option was
+designed for automated testing.
+.It Fl s Ar string , Fl \-statsdir Ns = Ns Ar string
+Statistics file location.
+.sp
+Specify the directory path for files created by the statistics facility.
+This is the same operation as the
+\fBstatsdir\fP \fIstatsdir\fP
+configuration file directive.
+.It Fl t Ar tkey , Fl \-trustedkey Ns = Ns Ar tkey
+Trusted key number.
+This option may appear an unlimited number of times.
+.sp
+Add the specified key number to the trusted key list.
+.It Fl u Ar string , Fl \-user Ns = Ns Ar string
+Run as userid (or userid:groupid).
+.sp
+Specify a user, and optionally a group, to switch to.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB\-\-enable\-clockctl\fP) or Linux (configure with
+\fB\-\-enable\-linuxcaps\fP) or Solaris (configure with \fB\-\-enable\-solarisprivs\fP).
+.It Fl U Ar number , Fl \-updateinterval Ns = Ns Ar number
+interval in seconds between scans for new or dropped interfaces.
+This option takes an integer number as its argument.
+.sp
+Give the time in seconds between two scans for new or dropped interfaces.
+For systems with routing socket support the scans will be performed shortly after the interface change
+has been detected by the system.
+Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+.It Fl \-var Ns = Ns Ar nvar
+make ARG an ntp variable (RW).
+This option may appear an unlimited number of times.
+.sp
+.It Fl \-dvar Ns = Ns Ar ndvar
+make ARG an ntp variable (RW|DEF).
+This option may appear an unlimited number of times.
+.sp
+.It Fl w Ar number , Fl \-wait\-sync Ns = Ns Ar number
+Seconds to wait for first clock sync.
+This option must not appear in combination with any of the following options:
+nofork, quit, saveconfigquit.
+This option takes an integer number as its argument.
+.sp
+If greater than zero, alters \fBntpd\fP's behavior when forking to
+daemonize. Instead of exiting with status 0 immediately after
+the fork, the parent waits up to the specified number of
+seconds for the child to first synchronize the clock. The exit
+status is zero (success) if the clock was synchronized,
+otherwise it is \fBETIMEDOUT\fP.
+This provides the option for a script starting \fBntpd\fP to easily
+wait for the first set of the clock before proceeding.
+.It Fl x , Fl \-slew
+Slew up to 600 seconds.
+.sp
+Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+This option can be used with the
+\fB\-g\fP
+and
+\fB\-q\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+Note: The kernel time discipline is disabled with this option.
+.It Fl \-usepcc
+Use CPU cycle counter (Windows only).
+.sp
+Attempt to substitute the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter and \fBQueryPerformanceCounter\fP are compared, and if
+they have the same frequency, the CPU counter (RDTSC on x86) is
+used directly, saving the overhead of a system call.
+.It Fl \-pccfreq Ns = Ns Ar string
+Force CPU cycle counter use (Windows only).
+.sp
+Force substitution the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter (RDTSC on x86) is used unconditionally with the
+given frequency (in Hz).
+.It Fl m , Fl \-mdns
+Register with mDNS as a NTP server.
+.sp
+Registers as an NTP server with the local mDNS server which allows
+the server to be discovered via mDNS client lookup.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTPD_<option\-name>\fP or \fBNTPD\fP
+.fi
+.ad
+.Sh USAGE
+.Ss "How NTP Operates"
+The
+.Nm
+utility operates by exchanging messages with
+one or more configured servers over a range of designated poll intervals.
+When
+started, whether for the first or subsequent times, the program
+requires several exchanges from the majority of these servers so
+the signal processing and mitigation algorithms can accumulate and
+groom the data and set the clock.
+In order to protect the network
+from bursts, the initial poll interval for each server is delayed
+an interval randomized over a few seconds.
+At the default initial poll
+interval of 64s, several minutes can elapse before the clock is
+set.
+This initial delay to set the clock
+can be safely and dramatically reduced using the
+.Cm iburst
+keyword with the
+.Ic server
+configuration
+command, as described in
+.Xr ntp.conf 5 .
+.Pp
+Most operating systems and hardware of today incorporate a
+time\-of\-year (TOY) chip to maintain the time during periods when
+the power is off.
+When the machine is booted, the chip is used to
+initialize the operating system time.
+After the machine has
+synchronized to a NTP server, the operating system corrects the
+chip from time to time.
+In the default case, if
+.Nm
+detects that the time on the host
+is more than 1000s from the server time,
+.Nm
+assumes something must be terribly wrong and the only
+reliable action is for the operator to intervene and set the clock
+by hand.
+(Reasons for this include there is no TOY chip,
+or its battery is dead, or that the TOY chip is just of poor quality.)
+This causes
+.Nm
+to exit with a panic message to
+the system log.
+The
+.Fl g
+option overrides this check and the
+clock will be set to the server time regardless of the chip time
+(up to 68 years in the past or future \(em
+this is a limitation of the NTPv4 protocol).
+However, and to protect against broken hardware, such as when the
+CMOS battery fails or the clock counter becomes defective, once the
+clock has been set an error greater than 1000s will cause
+.Nm
+to exit anyway.
+.Pp
+Under ordinary conditions,
+.Nm
+adjusts the clock in
+small steps so that the timescale is effectively continuous and
+without discontinuities.
+Under conditions of extreme network
+congestion, the roundtrip delay jitter can exceed three seconds and
+the synchronization distance, which is equal to one\-half the
+roundtrip delay plus error budget terms, can become very large.
+The
+.Nm
+algorithms discard sample offsets exceeding 128 ms,
+unless the interval during which no sample offset is less than 128
+ms exceeds 900s.
+The first sample after that, no matter what the
+offset, steps the clock to the indicated time.
+In practice this
+reduces the false alarm rate where the clock is stepped in error to
+a vanishingly low incidence.
+.Pp
+As the result of this behavior, once the clock has been set it
+very rarely strays more than 128 ms even under extreme cases of
+network path congestion and jitter.
+Sometimes, in particular when
+.Nm
+is first started without a valid drift file
+on a system with a large intrinsic drift
+the error might grow to exceed 128 ms,
+which would cause the clock to be set backwards
+if the local clock time is more than 128 s
+in the future relative to the server.
+In some applications, this behavior may be unacceptable.
+There are several solutions, however.
+If the
+.Fl x
+option is included on the command line, the clock will
+never be stepped and only slew corrections will be used.
+But this choice comes with a cost that
+should be carefully explored before deciding to use
+the
+.Fl x
+option.
+The maximum slew rate possible is limited
+to 500 parts\-per\-million (PPM) as a consequence of the correctness
+principles on which the NTP protocol and algorithm design are
+based.
+As a result, the local clock can take a long time to
+converge to an acceptable offset, about 2,000 s for each second the
+clock is outside the acceptable range.
+During this interval the
+local clock will not be consistent with any other network clock and
+the system cannot be used for distributed applications that require
+correctly synchronized network time.
+.Pp
+In spite of the above precautions, sometimes when large
+frequency errors are present the resulting time offsets stray
+outside the 128\-ms range and an eventual step or slew time
+correction is required.
+If following such a correction the
+frequency error is so large that the first sample is outside the
+acceptable range,
+.Nm
+enters the same state as when the
+.Pa ntp.drift
+file is not present.
+The intent of this behavior
+is to quickly correct the frequency and restore operation to the
+normal tracking mode.
+In the most extreme cases
+(the host
+.Cm time.ien.it
+comes to mind), there may be occasional
+step/slew corrections and subsequent frequency corrections.
+It
+helps in these cases to use the
+.Cm burst
+keyword when
+configuring the server, but
+ONLY
+when you have permission to do so from the owner of the target host.
+.Pp
+Finally,
+in the past many startup scripts would run
+.Xr ntpdate 1ntpdatemdoc
+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.
+If you are following the instructions in
+.Sx "Starting NTP (Best Current Practice)"
+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 .
+.Pp
+There is a way to start
+.Xr ntpd 1ntpdmdoc
+that often addresses all of the problems mentioned above.
+.Ss "Starting NTP (Best Current Practice)"
+First, use the
+.Cm iburst
+option on your
+.Cm server
+entries.
+.Pp
+If you can also keep a good
+.Pa ntp.drift
+file then
+.Xr ntpd 1ntpdmdoc
+will effectively "warm\-start" and your system's clock will
+be stable in under 11 seconds' time.
+.Pp
+As soon as possible in the startup sequence, start
+.Xr ntpd 1ntpdmdoc
+with at least the
+.Fl g
+and perhaps the
+.Fl N
+options.
+Then,
+start the rest of your "normal" processes.
+This will give
+.Xr ntpd 1ntpdmdoc
+as much time as possible to get the system's clock synchronized and stable.
+.Pp
+Finally,
+if you have processes like
+.Cm dovecot
+or database servers
+that require
+monotonically\-increasing time,
+run
+.Xr ntp\-wait 1ntp\-waitmdoc
+as late as possible in the boot sequence
+(perhaps with the
+.Fl v
+flag)
+and after
+.Xr ntp\-wait 1ntp\-waitmdoc
+exits successfully
+it is as safe as it will ever be to start any process that require
+stable time.
+.Ss "Frequency Discipline"
+The
+.Nm
+behavior at startup depends on whether the
+frequency file, usually
+.Pa ntp.drift ,
+exists.
+This file
+contains the latest estimate of clock frequency error.
+When the
+.Nm
+is started and the file does not exist, the
+.Nm
+enters a special mode designed to quickly adapt to
+the particular system clock oscillator time and frequency error.
+This takes approximately 15 minutes, after which the time and
+frequency are set to nominal values and the
+.Nm
+enters
+normal mode, where the time and frequency are continuously tracked
+relative to the server.
+After one hour the frequency file is
+created and the current frequency offset written to it.
+When the
+.Nm
+is started and the file does exist, the
+.Nm
+frequency is initialized from the file and enters normal mode
+immediately.
+After that the current frequency offset is written to
+the file at hourly intervals.
+.Ss "Operating Modes"
+The
+.Nm
+utility can operate in any of several modes, including
+symmetric active/passive, client/server broadcast/multicast and
+manycast, as described in the
+.Qq Association Management
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+It normally operates continuously while
+monitoring for small changes in frequency and trimming the clock
+for the ultimate precision.
+However, it can operate in a one\-time
+mode where the time is set from an external server and frequency is
+set from a previously recorded frequency file.
+A
+broadcast/multicast or manycast client can discover remote servers,
+compute server\-client propagation delay correction factors and
+configure itself automatically.
+This makes it possible to deploy a
+fleet of workstations without specifying configuration details
+specific to the local environment.
+.Pp
+By default,
+.Nm
+runs in continuous mode where each of
+possibly several external servers is polled at intervals determined
+by an intricate state machine.
+The state machine measures the
+incidental roundtrip delay jitter and oscillator frequency wander
+and determines the best poll interval using a heuristic algorithm.
+Ordinarily, and in most operating environments, the state machine
+will start with 64s intervals and eventually increase in steps to
+1024s.
+A small amount of random variation is introduced in order to
+avoid bunching at the servers.
+In addition, should a server become
+unreachable for some time, the poll interval is increased in steps
+to 1024s in order to reduce network overhead.
+.Pp
+In some cases it may not be practical for
+.Nm
+to run continuously.
+A common workaround has been to run the
+.Xr ntpdate 1ntpdatemdoc
+or
+.Xr sntp 1sntpmdoc
+programs from a
+.Xr cron 8
+job at designated
+times.
+However, these programs do not have the crafted signal
+processing, error checking or mitigation algorithms of
+.Nm .
+The
+.Fl q
+option is intended for this purpose.
+Setting this option will cause
+.Nm
+to exit just after
+setting the clock for the first time.
+The procedure for initially
+setting the clock is the same as in continuous mode; most
+applications will probably want to specify the
+.Cm iburst
+keyword with the
+.Ic server
+configuration command.
+With this
+keyword a volley of messages are exchanged to groom the data and
+the clock is set in about 10 s.
+If nothing is heard after a
+couple of minutes, the daemon times out and exits.
+After a suitable
+period of mourning, the
+.Xr ntpdate 1ntpdatemdoc
+program will be
+retired.
+.Pp
+When kernel support is available to discipline the clock
+frequency, which is the case for stock Solaris, Tru64, Linux and
+.Fx ,
+a useful feature is available to discipline the clock
+frequency.
+First,
+.Nm
+is run in continuous mode with
+selected servers in order to measure and record the intrinsic clock
+frequency offset in the frequency file.
+It may take some hours for
+the frequency and offset to settle down.
+Then the
+.Nm
+is
+stopped and run in one\-time mode as required.
+At each startup, the
+frequency is read from the file and initializes the kernel
+frequency.
+.Ss "Poll Interval Control"
+This version of NTP includes an intricate state machine to
+reduce the network load while maintaining a quality of
+synchronization consistent with the observed jitter and wander.
+There are a number of ways to tailor the operation in order enhance
+accuracy by reducing the interval or to reduce network overhead by
+increasing it.
+However, the user is advised to carefully consider
+the consequences of changing the poll adjustment range from the
+default minimum of 64 s to the default maximum of 1,024 s.
+The
+default minimum can be changed with the
+.Ic tinker
+.Cm minpoll
+command to a value not less than 16 s.
+This value is used for all
+configured associations, unless overridden by the
+.Cm minpoll
+option on the configuration command.
+Note that most device drivers
+will not operate properly if the poll interval is less than 64 s
+and that the broadcast server and manycast client associations will
+also use the default, unless overridden.
+.Pp
+In some cases involving dial up or toll services, it may be
+useful to increase the minimum interval to a few tens of minutes
+and maximum interval to a day or so.
+Under normal operation
+conditions, once the clock discipline loop has stabilized the
+interval will be increased in steps from the minimum to the
+maximum.
+However, this assumes the intrinsic clock frequency error
+is small enough for the discipline loop correct it.
+The capture
+range of the loop is 500 PPM at an interval of 64s decreasing by a
+factor of two for each doubling of interval.
+At a minimum of 1,024
+s, for example, the capture range is only 31 PPM.
+If the intrinsic
+error is greater than this, the drift file
+.Pa ntp.drift
+will
+have to be specially tailored to reduce the residual error below
+this limit.
+Once this is done, the drift file is automatically
+updated once per hour and is available to initialize the frequency
+on subsequent daemon restarts.
+.Ss "The huff\-n'\-puff Filter"
+In scenarios where a considerable amount of data are to be
+downloaded or uploaded over telephone modems, timekeeping quality
+can be seriously degraded.
+This occurs because the differential
+delays on the two directions of transmission can be quite large.
+In
+many cases the apparent time errors are so large as to exceed the
+step threshold and a step correction can occur during and after the
+data transfer is in progress.
+.Pp
+The huff\-n'\-puff filter is designed to correct the apparent time
+offset in these cases.
+It depends on knowledge of the propagation
+delay when no other traffic is present.
+In common scenarios this
+occurs during other than work hours.
+The filter maintains a shift
+register that remembers the minimum delay over the most recent
+interval measured usually in hours.
+Under conditions of severe
+delay, the filter corrects the apparent offset using the sign of
+the offset and the difference between the apparent delay and
+minimum delay.
+The name of the filter reflects the negative (huff)
+and positive (puff) correction, which depends on the sign of the
+offset.
+.Pp
+The filter is activated by the
+.Ic tinker
+command and
+.Cm huffpuff
+keyword, as described in
+.Xr ntp.conf 5 .
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh FILES
+.Bl -tag -width /etc/ntp.drift -compact
+.It Pa /etc/ntp.conf
+the default name of the configuration file
+.It Pa /etc/ntp.drift
+the default name of the drift file
+.It Pa /etc/ntp.keys
+the default name of the key file
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntp.conf 5 ,
+.Xr ntpdate 1ntpdatemdoc ,
+.Xr ntpdc 1ntpdcmdoc ,
+.Xr ntpq 1ntpqmdoc ,
+.Xr sntp 1sntpmdoc
+.Pp
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+.Li http://www.ntp.org/ .
+A snapshot of this documentation is available in HTML format in
+.Pa /usr/share/doc/ntp .
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 1)
+.%O RFC1059
+.Re
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 2)
+.%O RFC1119
+.Re
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 3)
+.%O RFC1305
+.Re
+.Rs
+.%A David L. Mills
+.%A J. Martin, Ed.
+.%A J. Burbank
+.%A W. Kasch
+.%T Network Time Protocol Version 4: Protocol and Algorithms Specification
+.%O RFC5905
+.Re
+.Rs
+.%A David L. Mills
+.%A B. Haberman, Ed.
+.%T Network Time Protocol Version 4: Autokey Specification
+.%O RFC5906
+.Re
+.Rs
+.%A H. Gerstung
+.%A C. Elliott
+.%A B. Haberman, Ed.
+.%T Definitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)
+.%O RFC5907
+.Re
+.Rs
+.%A R. Gayraud
+.%A B. Lourdelet
+.%T Network Time Protocol (NTP) Server Option for DHCPv6
+.%O RFC5908
+.Re
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+The
+.Nm
+utility has gotten rather fat.
+While not huge, it has gotten
+larger than might be desirable for an elevated\-priority
+.Nm
+running on a workstation, particularly since many of
+the fancy features which consume the space were designed more with
+a busy primary server, rather than a high stratum workstation in
+mind.
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+Portions of this document came from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntpd\fP
+option definitions.
diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c
new file mode 100644
index 0000000..ef1baa7
--- /dev/null
+++ b/ntpd/ntpd.c
@@ -0,0 +1,1478 @@
+/*
+ * ntpd.c - main program for the fixed point NTP daemon
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_machine.h"
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_stdlib.h"
+#include <ntp_random.h>
+
+#include "ntp_config.h"
+#include "ntp_syslog.h"
+#include "ntp_assert.h"
+#include "isc/error.h"
+#include "isc/strerror.h"
+#include "isc/formatcheck.h"
+#include "iosignal.h"
+
+#ifdef SIM
+# include "ntpsim.h"
+#endif
+
+#include "ntp_libopts.h"
+#include "ntpd-opts.h"
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#else
+# include <signal.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+#if defined(HAVE_RTPRIO)
+# ifdef HAVE_SYS_LOCK_H
+# include <sys/lock.h>
+# endif
+# include <sys/rtprio.h>
+#else
+# ifdef HAVE_PLOCK
+# ifdef HAVE_SYS_LOCK_H
+# include <sys/lock.h>
+# endif
+# endif
+#endif
+#if defined(HAVE_SCHED_SETSCHEDULER)
+# ifdef HAVE_SCHED_H
+# include <sched.h>
+# else
+# ifdef HAVE_SYS_SCHED_H
+# include <sys/sched.h>
+# endif
+# endif
+#endif
+#if defined(HAVE_SYS_MMAN_H)
+# include <sys/mman.h>
+#endif
+
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#endif
+
+#ifdef SYS_DOMAINOS
+# include <apollo/base.h>
+#endif /* SYS_DOMAINOS */
+
+
+#include "recvbuff.h"
+#include "ntp_cmdargs.h"
+
+#if 0 /* HMS: I don't think we need this. 961223 */
+#ifdef LOCK_PROCESS
+# ifdef SYS_SOLARIS
+# include <sys/mman.h>
+# else
+# include <sys/lock.h>
+# endif
+#endif
+#endif
+
+#ifdef _AIX
+# include <ulimit.h>
+#endif /* _AIX */
+
+#ifdef SCO5_CLOCK
+# include <sys/ci/ciioctl.h>
+#endif
+
+#ifdef HAVE_DROPROOT
+# include <ctype.h>
+# include <grp.h>
+# include <pwd.h>
+#ifdef HAVE_LINUX_CAPABILITIES
+# include <sys/capability.h>
+# include <sys/prctl.h>
+#endif /* HAVE_LINUX_CAPABILITIES */
+#if defined(HAVE_PRIV_H) && defined(HAVE_SOLARIS_PRIVS)
+# include <priv.h>
+#endif /* HAVE_PRIV_H */
+#endif /* HAVE_DROPROOT */
+
+#if defined (LIBSECCOMP) && (KERN_SECCOMP)
+/* # include <sys/types.h> */
+# include <sys/resource.h>
+# include <seccomp.h>
+#endif /* LIBSECCOMP and KERN_SECCOMP */
+
+#ifdef HAVE_DNSREGISTRATION
+# include <dns_sd.h>
+DNSServiceRef mdns;
+#endif
+
+#ifdef HAVE_SETPGRP_0
+# define ntp_setpgrp(x, y) setpgrp()
+#else
+# define ntp_setpgrp(x, y) setpgrp(x, y)
+#endif
+
+#ifdef HAVE_SOLARIS_PRIVS
+# define LOWPRIVS "basic,sys_time,net_privaddr,proc_setid,!proc_info,!proc_session,!proc_exec"
+static priv_set_t *lowprivs = NULL;
+static priv_set_t *highprivs = NULL;
+#endif /* HAVE_SOLARIS_PRIVS */
+/*
+ * Scheduling priority we run at
+ */
+#define NTPD_PRIO (-12)
+
+int priority_done = 2; /* 0 - Set priority */
+ /* 1 - priority is OK where it is */
+ /* 2 - Don't set priority */
+ /* 1 and 2 are pretty much the same */
+
+int listen_to_virtual_ips = TRUE;
+
+/*
+ * No-fork flag. If set, we do not become a background daemon.
+ */
+int nofork; /* Fork by default */
+
+#ifdef HAVE_DNSREGISTRATION
+/*
+ * mDNS registration flag. If set, we attempt to register with the mDNS system, but only
+ * after we have synched the first time. If the attempt fails, then try again once per
+ * minute for up to 5 times. After all, we may be starting before mDNS.
+ */
+int mdnsreg = FALSE;
+int mdnstries = 5;
+#endif /* HAVE_DNSREGISTRATION */
+
+#ifdef HAVE_DROPROOT
+int droproot;
+int root_dropped;
+char *user; /* User to switch to */
+char *group; /* group to switch to */
+const char *chrootdir; /* directory to chroot to */
+int sw_uid;
+int sw_gid;
+char *endp;
+struct group *gr;
+struct passwd *pw;
+#endif /* HAVE_DROPROOT */
+
+#ifdef HAVE_WORKING_FORK
+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;
+
+char const *progname;
+
+int was_alarmed;
+
+#ifdef DECL_SYSCALL
+/*
+ * We put this here, since the argument profile is syscall-specific
+ */
+extern int syscall (int, ...);
+#endif /* DECL_SYSCALL */
+
+
+#if !defined(SIM) && defined(SIGDIE1)
+static RETSIGTYPE finish (int);
+#endif
+
+#if !defined(SIM) && defined(HAVE_WORKING_FORK)
+static int wait_child_sync_if (int, long);
+#endif
+
+#if !defined(SIM) && !defined(SYS_WINNT)
+# ifdef DEBUG
+static RETSIGTYPE moredebug (int);
+static RETSIGTYPE lessdebug (int);
+# else /* !DEBUG follows */
+static RETSIGTYPE no_debug (int);
+# endif /* !DEBUG */
+#endif /* !SIM && !SYS_WINNT */
+
+int saved_argc;
+char ** saved_argv;
+
+#ifndef SIM
+int ntpdmain (int, char **);
+static void set_process_priority (void);
+static void assertion_failed (const char *, int,
+ isc_assertiontype_t,
+ const char *)
+ __attribute__ ((__noreturn__));
+static void library_fatal_error (const char *, int,
+ const char *, va_list)
+ ISC_FORMAT_PRINTF(3, 0);
+static void library_unexpected_error(const char *, int,
+ const char *, va_list)
+ ISC_FORMAT_PRINTF(3, 0);
+#endif /* !SIM */
+
+
+
+
+void
+parse_cmdline_opts(
+ int * pargc,
+ char ***pargv
+ )
+{
+ static int parsed;
+ static int optct;
+
+ if (!parsed)
+ optct = ntpOptionProcess(&ntpdOptions, *pargc, *pargv);
+
+ parsed = 1;
+
+ *pargc -= optct;
+ *pargv += optct;
+}
+
+
+#ifdef SIM
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ progname = argv[0];
+ parse_cmdline_opts(&argc, &argv);
+#ifdef DEBUG
+ debug = OPT_VALUE_SET_DEBUG_LEVEL;
+ DPRINTF(1, ("%s\n", Version));
+#endif
+
+ return ntpsim(argc, argv);
+}
+#else /* !SIM follows */
+#ifdef NO_MAIN_ALLOWED
+CALL(ntpd,"ntpd",ntpdmain);
+#else /* !NO_MAIN_ALLOWED follows */
+#ifndef SYS_WINNT
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ return ntpdmain(argc, argv);
+}
+#endif /* !SYS_WINNT */
+#endif /* !NO_MAIN_ALLOWED */
+#endif /* !SIM */
+
+#ifdef _AIX
+/*
+ * OK. AIX is different than solaris in how it implements plock().
+ * If you do NOT adjust the stack limit, you will get the MAXIMUM
+ * stack size allocated and PINNED with you program. To check the
+ * value, use ulimit -a.
+ *
+ * To fix this, we create an automatic variable and set our stack limit
+ * to that PLUS 32KB of extra space (we need some headroom).
+ *
+ * This subroutine gets the stack address.
+ *
+ * Grover Davidson and Matt Ladendorf
+ *
+ */
+static char *
+get_aix_stack(void)
+{
+ char ch;
+ return (&ch);
+}
+
+/*
+ * Signal handler for SIGDANGER.
+ */
+static void
+catch_danger(int signo)
+{
+ msyslog(LOG_INFO, "ntpd: setpgid(): %m");
+ /* Make the system believe we'll free something, but don't do it! */
+ return;
+}
+#endif /* _AIX */
+
+/*
+ * Set the process priority
+ */
+#ifndef SIM
+static void
+set_process_priority(void)
+{
+
+# ifdef DEBUG
+ if (debug > 1)
+ msyslog(LOG_DEBUG, "set_process_priority: %s: priority_done is <%d>",
+ ((priority_done)
+ ? "Leave priority alone"
+ : "Attempt to set priority"
+ ),
+ priority_done);
+# endif /* DEBUG */
+
+# if defined(HAVE_SCHED_SETSCHEDULER)
+ if (!priority_done) {
+ extern int config_priority_override, config_priority;
+ int pmax, pmin;
+ struct sched_param sched;
+
+ pmax = sched_get_priority_max(SCHED_FIFO);
+ sched.sched_priority = pmax;
+ if ( config_priority_override ) {
+ pmin = sched_get_priority_min(SCHED_FIFO);
+ if ( config_priority > pmax )
+ sched.sched_priority = pmax;
+ else if ( config_priority < pmin )
+ sched.sched_priority = pmin;
+ else
+ sched.sched_priority = config_priority;
+ }
+ if ( sched_setscheduler(0, SCHED_FIFO, &sched) == -1 )
+ msyslog(LOG_ERR, "sched_setscheduler(): %m");
+ else
+ ++priority_done;
+ }
+# endif /* HAVE_SCHED_SETSCHEDULER */
+# ifdef HAVE_RTPRIO
+# ifdef RTP_SET
+ if (!priority_done) {
+ struct rtprio srtp;
+
+ srtp.type = RTP_PRIO_REALTIME; /* was: RTP_PRIO_NORMAL */
+ srtp.prio = 0; /* 0 (hi) -> RTP_PRIO_MAX (31,lo) */
+
+ if (rtprio(RTP_SET, getpid(), &srtp) < 0)
+ msyslog(LOG_ERR, "rtprio() error: %m");
+ else
+ ++priority_done;
+ }
+# else /* !RTP_SET follows */
+ if (!priority_done) {
+ if (rtprio(0, 120) < 0)
+ msyslog(LOG_ERR, "rtprio() error: %m");
+ else
+ ++priority_done;
+ }
+# endif /* !RTP_SET */
+# endif /* HAVE_RTPRIO */
+# if defined(NTPD_PRIO) && NTPD_PRIO != 0
+# ifdef HAVE_ATT_NICE
+ if (!priority_done) {
+ errno = 0;
+ if (-1 == nice (NTPD_PRIO) && errno != 0)
+ msyslog(LOG_ERR, "nice() error: %m");
+ else
+ ++priority_done;
+ }
+# endif /* HAVE_ATT_NICE */
+# ifdef HAVE_BSD_NICE
+ if (!priority_done) {
+ if (-1 == setpriority(PRIO_PROCESS, 0, NTPD_PRIO))
+ msyslog(LOG_ERR, "setpriority() error: %m");
+ else
+ ++priority_done;
+ }
+# endif /* HAVE_BSD_NICE */
+# endif /* NTPD_PRIO && NTPD_PRIO != 0 */
+ if (!priority_done)
+ msyslog(LOG_ERR, "set_process_priority: No way found to improve our priority");
+}
+#endif /* !SIM */
+
+
+/*
+ * Main program. Initialize us, disconnect us from the tty if necessary,
+ * and loop waiting for I/O and/or timer expiries.
+ */
+#ifndef SIM
+int
+ntpdmain(
+ int argc,
+ char *argv[]
+ )
+{
+ l_fp now;
+ struct recvbuf *rbuf;
+ const char * logfilename;
+# ifdef HAVE_UMASK
+ mode_t uv;
+# endif
+# if defined(HAVE_GETUID) && !defined(MPE) /* MPE lacks the concept of root */
+ uid_t uid;
+# endif
+# if defined(HAVE_WORKING_FORK)
+ long wait_sync = 0;
+ int pipe_fds[2];
+ int rc;
+ int exit_code;
+# ifdef _AIX
+ struct sigaction sa;
+# endif
+# if !defined(HAVE_SETSID) && !defined (HAVE_SETPGID) && defined(TIOCNOTTY)
+ int fid;
+# endif
+# endif /* HAVE_WORKING_FORK*/
+# ifdef SCO5_CLOCK
+ int fd;
+ int zero;
+# endif
+
+# ifdef HAVE_UMASK
+ uv = umask(0);
+ if (uv)
+ umask(uv);
+ else
+ umask(022);
+# endif
+ saved_argc = argc;
+ saved_argv = argv;
+ progname = argv[0];
+ initializing = TRUE; /* mark that we are initializing */
+ parse_cmdline_opts(&argc, &argv);
+# ifdef DEBUG
+ debug = OPT_VALUE_SET_DEBUG_LEVEL;
+# ifdef HAVE_SETLINEBUF
+ setlinebuf(stdout);
+# endif
+# endif
+
+ if (HAVE_OPT(NOFORK) || HAVE_OPT(QUIT)
+# ifdef DEBUG
+ || debug
+# endif
+ || HAVE_OPT(SAVECONFIGQUIT))
+ nofork = TRUE;
+
+ init_logging(progname, NLOG_SYNCMASK, TRUE);
+ /* honor -l/--logfile option to log to a file */
+ if (HAVE_OPT(LOGFILE)) {
+ logfilename = OPT_ARG(LOGFILE);
+ syslogit = FALSE;
+ change_logfile(logfilename, FALSE);
+ } else {
+ logfilename = NULL;
+ if (nofork)
+ msyslog_term = TRUE;
+ if (HAVE_OPT(SAVECONFIGQUIT))
+ syslogit = FALSE;
+ }
+ msyslog(LOG_NOTICE, "%s: Starting", Version);
+
+ {
+ int i;
+ char buf[1024]; /* Secret knowledge of msyslog buf length */
+ char *cp = buf;
+
+ /* Note that every arg has an initial space character */
+ snprintf(cp, sizeof(buf), "Command line:");
+ cp += strlen(cp);
+
+ for (i = 0; i < saved_argc ; ++i) {
+ snprintf(cp, sizeof(buf) - (cp - buf),
+ " %s", saved_argv[i]);
+ cp += strlen(cp);
+ }
+ msyslog(LOG_INFO, "%s", buf);
+ }
+
+ /*
+ * Install trap handlers to log errors and assertion failures.
+ * Default handlers print to stderr which doesn't work if detached.
+ */
+ isc_assertion_setcallback(assertion_failed);
+ isc_error_setfatal(library_fatal_error);
+ isc_error_setunexpected(library_unexpected_error);
+
+ /* MPE lacks the concept of root */
+# if defined(HAVE_GETUID) && !defined(MPE)
+ uid = getuid();
+ if (uid && !HAVE_OPT( SAVECONFIGQUIT )) {
+ msyslog_term = TRUE;
+ msyslog(LOG_ERR,
+ "must be run as root, not uid %ld", (long)uid);
+ exit(1);
+ }
+# endif
+
+/*
+ * Enable the Multi-Media Timer for Windows?
+ */
+# ifdef SYS_WINNT
+ if (HAVE_OPT( MODIFYMMTIMER ))
+ set_mm_timer(MM_TIMER_HIRES);
+# endif
+
+#ifdef HAVE_DNSREGISTRATION
+/*
+ * Enable mDNS registrations?
+ */
+ if (HAVE_OPT( MDNS )) {
+ mdnsreg = TRUE;
+ }
+#endif /* HAVE_DNSREGISTRATION */
+
+ if (HAVE_OPT( NOVIRTUALIPS ))
+ listen_to_virtual_ips = 0;
+
+ /*
+ * --interface, listen on specified interfaces
+ */
+ if (HAVE_OPT( INTERFACE )) {
+ int ifacect = STACKCT_OPT( INTERFACE );
+ const char** ifaces = STACKLST_OPT( INTERFACE );
+ sockaddr_u addr;
+
+ while (ifacect-- > 0) {
+ add_nic_rule(
+ is_ip_address(*ifaces, AF_UNSPEC, &addr)
+ ? MATCH_IFADDR
+ : MATCH_IFNAME,
+ *ifaces, -1, ACTION_LISTEN);
+ ifaces++;
+ }
+ }
+
+ if (HAVE_OPT( NICE ))
+ priority_done = 0;
+
+# ifdef HAVE_SCHED_SETSCHEDULER
+ if (HAVE_OPT( PRIORITY )) {
+ config_priority = OPT_VALUE_PRIORITY;
+ config_priority_override = 1;
+ priority_done = 0;
+ }
+# endif
+
+# ifdef HAVE_WORKING_FORK
+ do { /* 'loop' once */
+ if (!HAVE_OPT( WAIT_SYNC ))
+ break;
+ wait_sync = OPT_VALUE_WAIT_SYNC;
+ if (wait_sync <= 0) {
+ wait_sync = 0;
+ break;
+ }
+ /* -w requires a fork() even with debug > 0 */
+ nofork = FALSE;
+ if (pipe(pipe_fds)) {
+ exit_code = (errno) ? errno : -1;
+ msyslog(LOG_ERR,
+ "Pipe creation failed for --wait-sync: %m");
+ exit(exit_code);
+ }
+ waitsync_fd_to_close = pipe_fds[1];
+ } while (0); /* 'loop' once */
+# endif /* HAVE_WORKING_FORK */
+
+ init_lib();
+# ifdef SYS_WINNT
+ /*
+ * Start interpolation thread, must occur before first
+ * get_systime()
+ */
+ init_winnt_time();
+# endif
+ /*
+ * Initialize random generator and public key pair
+ */
+ get_systime(&now);
+
+ ntp_srandom((int)(now.l_i * now.l_uf));
+
+ /*
+ * Detach us from the terminal. May need an #ifndef GIZMO.
+ */
+ if (!nofork) {
+
+# ifdef HAVE_WORKING_FORK
+ rc = fork();
+ if (-1 == rc) {
+ exit_code = (errno) ? errno : -1;
+ msyslog(LOG_ERR, "fork: %m");
+ exit(exit_code);
+ }
+ if (rc > 0) {
+ /* parent */
+ exit_code = wait_child_sync_if(pipe_fds[0],
+ wait_sync);
+ exit(exit_code);
+ }
+
+ /*
+ * child/daemon
+ * close all open files excepting waitsync_fd_to_close.
+ * msyslog() unreliable until after init_logging().
+ */
+ closelog();
+ if (syslog_file != NULL) {
+ fclose(syslog_file);
+ syslog_file = NULL;
+ syslogit = TRUE;
+ }
+ close_all_except(waitsync_fd_to_close);
+ INSIST(0 == open("/dev/null", 0) && 1 == dup2(0, 1) \
+ && 2 == dup2(0, 2));
+
+ init_logging(progname, 0, TRUE);
+ /* we lost our logfile (if any) daemonizing */
+ setup_logfile(logfilename);
+
+# ifdef SYS_DOMAINOS
+ {
+ uid_$t puid;
+ status_$t st;
+
+ proc2_$who_am_i(&puid);
+ proc2_$make_server(&puid, &st);
+ }
+# endif /* SYS_DOMAINOS */
+# ifdef HAVE_SETSID
+ if (setsid() == (pid_t)-1)
+ msyslog(LOG_ERR, "setsid(): %m");
+# elif defined(HAVE_SETPGID)
+ if (setpgid(0, 0) == -1)
+ msyslog(LOG_ERR, "setpgid(): %m");
+# else /* !HAVE_SETSID && !HAVE_SETPGID follows */
+# ifdef TIOCNOTTY
+ fid = open("/dev/tty", 2);
+ if (fid >= 0) {
+ ioctl(fid, (u_long)TIOCNOTTY, NULL);
+ close(fid);
+ }
+# endif /* TIOCNOTTY */
+ ntp_setpgrp(0, getpid());
+# endif /* !HAVE_SETSID && !HAVE_SETPGID */
+# ifdef _AIX
+ /* Don't get killed by low-on-memory signal. */
+ sa.sa_handler = catch_danger;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_RESTART;
+ sigaction(SIGDANGER, &sa, NULL);
+# endif /* _AIX */
+# endif /* HAVE_WORKING_FORK */
+ }
+
+# ifdef SCO5_CLOCK
+ /*
+ * SCO OpenServer's system clock offers much more precise timekeeping
+ * on the base CPU than the other CPUs (for multiprocessor systems),
+ * so we must lock to the base CPU.
+ */
+ fd = open("/dev/at1", O_RDONLY);
+ if (fd >= 0) {
+ zero = 0;
+ if (ioctl(fd, ACPU_LOCK, &zero) < 0)
+ msyslog(LOG_ERR, "cannot lock to base CPU: %m");
+ close(fd);
+ }
+# endif
+
+ /* Setup stack size in preparation for locking pages in memory. */
+# if defined(HAVE_MLOCKALL)
+# ifdef HAVE_SETRLIMIT
+ ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
+# ifdef RLIMIT_MEMLOCK
+ /*
+ * The default RLIMIT_MEMLOCK is very low on Linux systems.
+ * Unless we increase this limit malloc calls are likely to
+ * fail if we drop root privilege. To be useful the value
+ * has to be larger than the largest ntpd resident set size.
+ */
+ ntp_rlimit(RLIMIT_MEMLOCK, DFLT_RLIMIT_MEMLOCK * 1024 * 1024, 1024 * 1024, "MB");
+# endif /* RLIMIT_MEMLOCK */
+# endif /* HAVE_SETRLIMIT */
+# else /* !HAVE_MLOCKALL follows */
+# ifdef HAVE_PLOCK
+# ifdef PROCLOCK
+# ifdef _AIX
+ /*
+ * set the stack limit for AIX for plock().
+ * see get_aix_stack() for more info.
+ */
+ if (ulimit(SET_STACKLIM, (get_aix_stack() - 8 * 4096)) < 0)
+ msyslog(LOG_ERR,
+ "Cannot adjust stack limit for plock: %m");
+# endif /* _AIX */
+# endif /* PROCLOCK */
+# endif /* HAVE_PLOCK */
+# endif /* !HAVE_MLOCKALL */
+
+ /*
+ * Set up signals we pay attention to locally.
+ */
+# ifdef SIGDIE1
+ signal_no_reset(SIGDIE1, finish);
+ signal_no_reset(SIGDIE2, finish);
+ signal_no_reset(SIGDIE3, finish);
+ signal_no_reset(SIGDIE4, finish);
+# endif
+# ifdef SIGBUS
+ signal_no_reset(SIGBUS, finish);
+# endif
+
+# if !defined(SYS_WINNT) && !defined(VMS)
+# ifdef DEBUG
+ (void) signal_no_reset(MOREDEBUGSIG, moredebug);
+ (void) signal_no_reset(LESSDEBUGSIG, lessdebug);
+# else
+ (void) signal_no_reset(MOREDEBUGSIG, no_debug);
+ (void) signal_no_reset(LESSDEBUGSIG, no_debug);
+# endif /* DEBUG */
+# endif /* !SYS_WINNT && !VMS */
+
+ /*
+ * Set up signals we should never pay attention to.
+ */
+# ifdef SIGPIPE
+ signal_no_reset(SIGPIPE, SIG_IGN);
+# endif
+
+ /*
+ * Call the init_ routines to initialize the data structures.
+ *
+ * Exactly what command-line options are we expecting here?
+ */
+ INIT_SSL();
+ init_auth();
+ init_util();
+ init_restrict();
+ init_mon();
+ init_timer();
+ init_request();
+ init_control();
+ init_peer();
+# ifdef REFCLOCK
+ init_refclock();
+# endif
+ set_process_priority();
+ init_proto(); /* Call at high priority */
+ init_io();
+ init_loopfilter();
+ mon_start(MON_ON); /* monitor on by default now */
+ /* turn off in config if unwanted */
+
+ /*
+ * Get the configuration. This is done in a separate module
+ * since this will definitely be different for the gizmo board.
+ */
+ getconfig(argc, argv);
+
+ if (do_memlock) {
+# if defined(HAVE_MLOCKALL)
+ /*
+ * lock the process into memory
+ */
+ if (!HAVE_OPT(SAVECONFIGQUIT) &&
+ 0 != mlockall(MCL_CURRENT|MCL_FUTURE))
+ msyslog(LOG_ERR, "mlockall(): %m");
+# else /* !HAVE_MLOCKALL follows */
+# ifdef HAVE_PLOCK
+# ifdef PROCLOCK
+ /*
+ * lock the process into memory
+ */
+ if (!HAVE_OPT(SAVECONFIGQUIT) && 0 != plock(PROCLOCK))
+ msyslog(LOG_ERR, "plock(PROCLOCK): %m");
+# else /* !PROCLOCK follows */
+# ifdef TXTLOCK
+ /*
+ * Lock text into ram
+ */
+ if (!HAVE_OPT(SAVECONFIGQUIT) && 0 != plock(TXTLOCK))
+ msyslog(LOG_ERR, "plock(TXTLOCK) error: %m");
+# else /* !TXTLOCK follows */
+ msyslog(LOG_ERR, "plock() - don't know what to lock!");
+# endif /* !TXTLOCK */
+# endif /* !PROCLOCK */
+# endif /* HAVE_PLOCK */
+# endif /* !HAVE_MLOCKALL */
+ }
+
+ loop_config(LOOP_DRIFTINIT, 0);
+ report_event(EVNT_SYSRESTART, NULL, NULL);
+ initializing = FALSE;
+
+# ifdef HAVE_DROPROOT
+ if (droproot) {
+ /* Drop super-user privileges and chroot now if the OS supports this */
+
+# ifdef HAVE_LINUX_CAPABILITIES
+ /* set flag: keep privileges accross setuid() call (we only really need cap_sys_time): */
+ if (prctl( PR_SET_KEEPCAPS, 1L, 0L, 0L, 0L ) == -1) {
+ msyslog( LOG_ERR, "prctl( PR_SET_KEEPCAPS, 1L ) failed: %m" );
+ exit(-1);
+ }
+# elif HAVE_SOLARIS_PRIVS
+ /* Nothing to do here */
+# else
+ /* we need a user to switch to */
+ if (user == NULL) {
+ msyslog(LOG_ERR, "Need user name to drop root privileges (see -u flag!)" );
+ exit(-1);
+ }
+# endif /* HAVE_LINUX_CAPABILITIES || HAVE_SOLARIS_PRIVS */
+
+ if (user != NULL) {
+ if (isdigit((unsigned char)*user)) {
+ sw_uid = (uid_t)strtoul(user, &endp, 0);
+ if (*endp != '\0')
+ goto getuser;
+
+ if ((pw = getpwuid(sw_uid)) != NULL) {
+ free(user);
+ user = estrdup(pw->pw_name);
+ sw_gid = pw->pw_gid;
+ } else {
+ errno = 0;
+ msyslog(LOG_ERR, "Cannot find user ID %s", user);
+ exit (-1);
+ }
+
+ } else {
+getuser:
+ errno = 0;
+ if ((pw = getpwnam(user)) != NULL) {
+ sw_uid = pw->pw_uid;
+ sw_gid = pw->pw_gid;
+ } else {
+ if (errno)
+ msyslog(LOG_ERR, "getpwnam(%s) failed: %m", user);
+ else
+ msyslog(LOG_ERR, "Cannot find user `%s'", user);
+ exit (-1);
+ }
+ }
+ }
+ if (group != NULL) {
+ if (isdigit((unsigned char)*group)) {
+ sw_gid = (gid_t)strtoul(group, &endp, 0);
+ if (*endp != '\0')
+ goto getgroup;
+ } else {
+getgroup:
+ if ((gr = getgrnam(group)) != NULL) {
+ sw_gid = gr->gr_gid;
+ } else {
+ errno = 0;
+ msyslog(LOG_ERR, "Cannot find group `%s'", group);
+ exit (-1);
+ }
+ }
+ }
+
+ if (chrootdir ) {
+ /* make sure cwd is inside the jail: */
+ if (chdir(chrootdir)) {
+ msyslog(LOG_ERR, "Cannot chdir() to `%s': %m", chrootdir);
+ exit (-1);
+ }
+ if (chroot(chrootdir)) {
+ msyslog(LOG_ERR, "Cannot chroot() to `%s': %m", chrootdir);
+ exit (-1);
+ }
+ if (chdir("/")) {
+ msyslog(LOG_ERR, "Cannot chdir() to`root after chroot(): %m");
+ exit (-1);
+ }
+ }
+# ifdef HAVE_SOLARIS_PRIVS
+ if ((lowprivs = priv_str_to_set(LOWPRIVS, ",", NULL)) == NULL) {
+ msyslog(LOG_ERR, "priv_str_to_set() failed:%m");
+ exit(-1);
+ }
+ if ((highprivs = priv_allocset()) == NULL) {
+ msyslog(LOG_ERR, "priv_allocset() failed:%m");
+ exit(-1);
+ }
+ (void) getppriv(PRIV_PERMITTED, highprivs);
+ (void) priv_intersect(highprivs, lowprivs);
+ if (setppriv(PRIV_SET, PRIV_PERMITTED, lowprivs) == -1) {
+ msyslog(LOG_ERR, "setppriv() failed:%m");
+ exit(-1);
+ }
+# endif /* HAVE_SOLARIS_PRIVS */
+ if (user && initgroups(user, sw_gid)) {
+ msyslog(LOG_ERR, "Cannot initgroups() to user `%s': %m", user);
+ exit (-1);
+ }
+ if (group && setgid(sw_gid)) {
+ msyslog(LOG_ERR, "Cannot setgid() to group `%s': %m", group);
+ exit (-1);
+ }
+ if (group && setegid(sw_gid)) {
+ msyslog(LOG_ERR, "Cannot setegid() to group `%s': %m", group);
+ exit (-1);
+ }
+ if (user && setuid(sw_uid)) {
+ msyslog(LOG_ERR, "Cannot setuid() to user `%s': %m", user);
+ exit (-1);
+ }
+ if (user && seteuid(sw_uid)) {
+ msyslog(LOG_ERR, "Cannot seteuid() to user `%s': %m", user);
+ exit (-1);
+ }
+
+# if !defined(HAVE_LINUX_CAPABILITIES) && !defined(HAVE_SOLARIS_PRIVS)
+ /*
+ * for now assume that the privilege to bind to privileged ports
+ * is associated with running with uid 0 - should be refined on
+ * ports that allow binding to NTP_PORT with uid != 0
+ */
+ disable_dynamic_updates |= (sw_uid != 0); /* also notifies routing message listener */
+# endif /* !HAVE_LINUX_CAPABILITIES && !HAVE_SOLARIS_PRIVS */
+
+ if (disable_dynamic_updates && interface_interval) {
+ interface_interval = 0;
+ msyslog(LOG_INFO, "running as non-root disables dynamic interface tracking");
+ }
+
+# ifdef HAVE_LINUX_CAPABILITIES
+ {
+ /*
+ * We may be running under non-root uid now, but we still hold full root privileges!
+ * We drop all of them, except for the crucial one or two: cap_sys_time and
+ * cap_net_bind_service if doing dynamic interface tracking.
+ */
+ cap_t caps;
+ char *captext;
+
+ captext = (0 != interface_interval)
+ ? "cap_sys_time,cap_net_bind_service=pe"
+ : "cap_sys_time=pe";
+ caps = cap_from_text(captext);
+ if (!caps) {
+ msyslog(LOG_ERR,
+ "cap_from_text(%s) failed: %m",
+ captext);
+ exit(-1);
+ }
+ if (-1 == cap_set_proc(caps)) {
+ msyslog(LOG_ERR,
+ "cap_set_proc() failed to drop root privs: %m");
+ exit(-1);
+ }
+ cap_free(caps);
+ }
+# endif /* HAVE_LINUX_CAPABILITIES */
+# ifdef HAVE_SOLARIS_PRIVS
+ if (priv_delset(lowprivs, "proc_setid") == -1) {
+ msyslog(LOG_ERR, "priv_delset() failed:%m");
+ exit(-1);
+ }
+ if (setppriv(PRIV_SET, PRIV_PERMITTED, lowprivs) == -1) {
+ msyslog(LOG_ERR, "setppriv() failed:%m");
+ exit(-1);
+ }
+ priv_freeset(lowprivs);
+ priv_freeset(highprivs);
+# endif /* HAVE_SOLARIS_PRIVS */
+ root_dropped = TRUE;
+ fork_deferred_worker();
+ } /* if (droproot) */
+# endif /* HAVE_DROPROOT */
+
+/* libssecomp sandboxing */
+#if defined (LIBSECCOMP) && (KERN_SECCOMP)
+ scmp_filter_ctx ctx;
+
+ if ((ctx = seccomp_init(SCMP_ACT_KILL)) < 0)
+ msyslog(LOG_ERR, "%s: seccomp_init(SCMP_ACT_KILL) failed: %m", __func__);
+ else {
+ msyslog(LOG_DEBUG, "%s: seccomp_init(SCMP_ACT_KILL) succeeded", __func__);
+ }
+
+#ifdef __x86_64__
+int scmp_sc[] = {
+ SCMP_SYS(adjtimex),
+ SCMP_SYS(bind),
+ SCMP_SYS(brk),
+ SCMP_SYS(chdir),
+ SCMP_SYS(clock_gettime),
+ SCMP_SYS(clock_settime),
+ SCMP_SYS(close),
+ SCMP_SYS(connect),
+ SCMP_SYS(exit_group),
+ SCMP_SYS(fstat),
+ SCMP_SYS(fsync),
+ SCMP_SYS(futex),
+ SCMP_SYS(getitimer),
+ SCMP_SYS(getsockname),
+ SCMP_SYS(ioctl),
+ SCMP_SYS(lseek),
+ SCMP_SYS(madvise),
+ SCMP_SYS(mmap),
+ SCMP_SYS(munmap),
+ SCMP_SYS(open),
+ SCMP_SYS(poll),
+ SCMP_SYS(read),
+ SCMP_SYS(recvmsg),
+ SCMP_SYS(rename),
+ SCMP_SYS(rt_sigaction),
+ SCMP_SYS(rt_sigprocmask),
+ SCMP_SYS(rt_sigreturn),
+ SCMP_SYS(select),
+ SCMP_SYS(sendto),
+ SCMP_SYS(setitimer),
+ SCMP_SYS(setsid),
+ SCMP_SYS(socket),
+ SCMP_SYS(stat),
+ SCMP_SYS(time),
+ SCMP_SYS(write),
+};
+#endif
+#ifdef __i386__
+int scmp_sc[] = {
+ SCMP_SYS(_newselect),
+ SCMP_SYS(adjtimex),
+ SCMP_SYS(brk),
+ SCMP_SYS(chdir),
+ SCMP_SYS(clock_gettime),
+ SCMP_SYS(clock_settime),
+ SCMP_SYS(close),
+ SCMP_SYS(exit_group),
+ SCMP_SYS(fsync),
+ SCMP_SYS(futex),
+ SCMP_SYS(getitimer),
+ SCMP_SYS(madvise),
+ SCMP_SYS(mmap),
+ SCMP_SYS(mmap2),
+ SCMP_SYS(munmap),
+ SCMP_SYS(open),
+ SCMP_SYS(poll),
+ SCMP_SYS(read),
+ SCMP_SYS(rename),
+ SCMP_SYS(rt_sigaction),
+ SCMP_SYS(rt_sigprocmask),
+ SCMP_SYS(select),
+ SCMP_SYS(setitimer),
+ SCMP_SYS(setsid),
+ SCMP_SYS(sigprocmask),
+ SCMP_SYS(sigreturn),
+ SCMP_SYS(socketcall),
+ SCMP_SYS(stat64),
+ SCMP_SYS(time),
+ SCMP_SYS(write),
+};
+#endif
+ {
+ int i;
+
+ for (i = 0; i < COUNTOF(scmp_sc); i++) {
+ if (seccomp_rule_add(ctx,
+ SCMP_ACT_ALLOW, scmp_sc[i], 0) < 0) {
+ msyslog(LOG_ERR,
+ "%s: seccomp_rule_add() failed: %m",
+ __func__);
+ }
+ }
+ }
+
+ if (seccomp_load(ctx) < 0)
+ msyslog(LOG_ERR, "%s: seccomp_load() failed: %m",
+ __func__);
+ else {
+ msyslog(LOG_DEBUG, "%s: seccomp_load() succeeded", __func__);
+ }
+#endif /* LIBSECCOMP and KERN_SECCOMP */
+
+# ifdef HAVE_IO_COMPLETION_PORT
+
+ for (;;) {
+ GetReceivedBuffers();
+# else /* normal I/O */
+
+ BLOCK_IO_AND_ALARM();
+ was_alarmed = FALSE;
+
+ for (;;) {
+ if (alarm_flag) { /* alarmed? */
+ was_alarmed = TRUE;
+ alarm_flag = FALSE;
+ }
+
+ if (!was_alarmed && !has_full_recv_buffer()) {
+ /*
+ * Nothing to do. Wait for something.
+ */
+ io_handler();
+ }
+
+ if (alarm_flag) { /* alarmed? */
+ was_alarmed = TRUE;
+ alarm_flag = FALSE;
+ }
+
+ if (was_alarmed) {
+ UNBLOCK_IO_AND_ALARM();
+ /*
+ * Out here, signals are unblocked. Call timer routine
+ * to process expiry.
+ */
+ timer();
+ was_alarmed = FALSE;
+ BLOCK_IO_AND_ALARM();
+ }
+
+# endif /* !HAVE_IO_COMPLETION_PORT */
+
+# ifdef DEBUG_TIMING
+ {
+ l_fp pts;
+ l_fp tsa, tsb;
+ int bufcount = 0;
+
+ get_systime(&pts);
+ tsa = pts;
+# endif
+ rbuf = get_full_recv_buffer();
+ while (rbuf != NULL) {
+ if (alarm_flag) {
+ was_alarmed = TRUE;
+ alarm_flag = FALSE;
+ }
+ UNBLOCK_IO_AND_ALARM();
+
+ if (was_alarmed) {
+ /* avoid timer starvation during lengthy I/O handling */
+ timer();
+ was_alarmed = FALSE;
+ }
+
+ /*
+ * Call the data procedure to handle each received
+ * packet.
+ */
+ if (rbuf->receiver != NULL) {
+# ifdef DEBUG_TIMING
+ l_fp dts = pts;
+
+ L_SUB(&dts, &rbuf->recv_time);
+ DPRINTF(2, ("processing timestamp delta %s (with prec. fuzz)\n", lfptoa(&dts, 9)));
+ collect_timing(rbuf, "buffer processing delay", 1, &dts);
+ bufcount++;
+# endif
+ (*rbuf->receiver)(rbuf);
+ } else {
+ msyslog(LOG_ERR, "fatal: receive buffer callback NULL");
+ abort();
+ }
+
+ BLOCK_IO_AND_ALARM();
+ freerecvbuf(rbuf);
+ rbuf = get_full_recv_buffer();
+ }
+# ifdef DEBUG_TIMING
+ get_systime(&tsb);
+ L_SUB(&tsb, &tsa);
+ if (bufcount) {
+ collect_timing(NULL, "processing", bufcount, &tsb);
+ DPRINTF(2, ("processing time for %d buffers %s\n", bufcount, lfptoa(&tsb, 9)));
+ }
+ }
+# endif
+
+ /*
+ * Go around again
+ */
+
+# ifdef HAVE_DNSREGISTRATION
+ if (mdnsreg && (current_time - mdnsreg ) > 60 && mdnstries && sys_leap != LEAP_NOTINSYNC) {
+ mdnsreg = current_time;
+ msyslog(LOG_INFO, "Attempting to register mDNS");
+ if ( DNSServiceRegister (&mdns, 0, 0, NULL, "_ntp._udp", NULL, NULL,
+ htons(NTP_PORT), 0, NULL, NULL, NULL) != kDNSServiceErr_NoError ) {
+ if (!--mdnstries) {
+ msyslog(LOG_ERR, "Unable to register mDNS, giving up.");
+ } else {
+ msyslog(LOG_INFO, "Unable to register mDNS, will try later.");
+ }
+ } else {
+ msyslog(LOG_INFO, "mDNS service registered.");
+ mdnsreg = FALSE;
+ }
+ }
+# endif /* HAVE_DNSREGISTRATION */
+
+ }
+ UNBLOCK_IO_AND_ALARM();
+ return 1;
+}
+#endif /* !SIM */
+
+
+#if !defined(SIM) && defined(SIGDIE1)
+/*
+ * finish - exit gracefully
+ */
+static RETSIGTYPE
+finish(
+ int sig
+ )
+{
+ const char *sig_desc;
+
+ sig_desc = NULL;
+#ifdef HAVE_STRSIGNAL
+ sig_desc = strsignal(sig);
+#endif
+ if (sig_desc == NULL)
+ sig_desc = "";
+ msyslog(LOG_NOTICE, "%s exiting on signal %d (%s)", progname,
+ sig, sig_desc);
+ /* See Bug 2513 and Bug 2522 re the unlink of PIDFILE */
+# ifdef HAVE_DNSREGISTRATION
+ if (mdns != NULL)
+ DNSServiceRefDeallocate(mdns);
+# endif
+ exit(0);
+}
+#endif /* !SIM && SIGDIE1 */
+
+
+#ifndef SIM
+/*
+ * wait_child_sync_if - implements parent side of -w/--wait-sync
+ */
+# ifdef HAVE_WORKING_FORK
+static int
+wait_child_sync_if(
+ int pipe_read_fd,
+ long wait_sync
+ )
+{
+ int rc;
+ int exit_code;
+ time_t wait_end_time;
+ time_t cur_time;
+ time_t wait_rem;
+ fd_set readset;
+ struct timeval wtimeout;
+
+ if (0 == wait_sync)
+ return 0;
+
+ /* waitsync_fd_to_close used solely by child */
+ close(waitsync_fd_to_close);
+ wait_end_time = time(NULL) + wait_sync;
+ do {
+ cur_time = time(NULL);
+ wait_rem = (wait_end_time > cur_time)
+ ? (wait_end_time - cur_time)
+ : 0;
+ wtimeout.tv_sec = wait_rem;
+ wtimeout.tv_usec = 0;
+ FD_ZERO(&readset);
+ FD_SET(pipe_read_fd, &readset);
+ rc = select(pipe_read_fd + 1, &readset, NULL, NULL,
+ &wtimeout);
+ if (-1 == rc) {
+ if (EINTR == errno)
+ continue;
+ exit_code = (errno) ? errno : -1;
+ msyslog(LOG_ERR,
+ "--wait-sync select failed: %m");
+ return exit_code;
+ }
+ if (0 == rc) {
+ /*
+ * select() indicated a timeout, but in case
+ * its timeouts are affected by a step of the
+ * system clock, select() again with a zero
+ * timeout to confirm.
+ */
+ FD_ZERO(&readset);
+ FD_SET(pipe_read_fd, &readset);
+ wtimeout.tv_sec = 0;
+ wtimeout.tv_usec = 0;
+ rc = select(pipe_read_fd + 1, &readset, NULL,
+ NULL, &wtimeout);
+ if (0 == rc) /* select() timeout */
+ break;
+ else /* readable */
+ return 0;
+ } else /* readable */
+ return 0;
+ } while (wait_rem > 0);
+
+ fprintf(stderr, "%s: -w/--wait-sync %ld timed out.\n",
+ progname, wait_sync);
+ return ETIMEDOUT;
+}
+# endif /* HAVE_WORKING_FORK */
+
+
+/*
+ * assertion_failed - Redirect assertion failures to msyslog().
+ */
+static void
+assertion_failed(
+ const char *file,
+ int line,
+ isc_assertiontype_t type,
+ const char *cond
+ )
+{
+ isc_assertion_setcallback(NULL); /* Avoid recursion */
+
+ msyslog(LOG_ERR, "%s:%d: %s(%s) failed",
+ file, line, isc_assertion_typetotext(type), cond);
+ msyslog(LOG_ERR, "exiting (due to assertion failure)");
+
+#if defined(DEBUG) && defined(SYS_WINNT)
+ if (debug)
+ DebugBreak();
+#endif
+
+ abort();
+}
+
+
+/*
+ * library_fatal_error - Handle fatal errors from our libraries.
+ */
+static void
+library_fatal_error(
+ const char *file,
+ int line,
+ const char *format,
+ va_list args
+ )
+{
+ char errbuf[256];
+
+ isc_error_setfatal(NULL); /* Avoid recursion */
+
+ msyslog(LOG_ERR, "%s:%d: fatal error:", file, line);
+ vsnprintf(errbuf, sizeof(errbuf), format, args);
+ msyslog(LOG_ERR, "%s", errbuf);
+ msyslog(LOG_ERR, "exiting (due to fatal error in library)");
+
+#if defined(DEBUG) && defined(SYS_WINNT)
+ if (debug)
+ DebugBreak();
+#endif
+
+ abort();
+}
+
+
+/*
+ * library_unexpected_error - Handle non fatal errors from our libraries.
+ */
+# define MAX_UNEXPECTED_ERRORS 100
+int unexpected_error_cnt = 0;
+static void
+library_unexpected_error(
+ const char *file,
+ int line,
+ const char *format,
+ va_list args
+ )
+{
+ char errbuf[256];
+
+ if (unexpected_error_cnt >= MAX_UNEXPECTED_ERRORS)
+ return; /* avoid clutter in log */
+
+ msyslog(LOG_ERR, "%s:%d: unexpected error:", file, line);
+ vsnprintf(errbuf, sizeof(errbuf), format, args);
+ msyslog(LOG_ERR, "%s", errbuf);
+
+ if (++unexpected_error_cnt == MAX_UNEXPECTED_ERRORS)
+ msyslog(LOG_ERR, "Too many errors. Shutting up.");
+
+}
+#endif /* !SIM */
+
+#if !defined(SIM) && !defined(SYS_WINNT)
+# ifdef DEBUG
+
+/*
+ * moredebug - increase debugging verbosity
+ */
+static RETSIGTYPE
+moredebug(
+ int sig
+ )
+{
+ int saved_errno = errno;
+
+ if (debug < 255)
+ {
+ debug++;
+ msyslog(LOG_DEBUG, "debug raised to %d", debug);
+ }
+ errno = saved_errno;
+}
+
+
+/*
+ * lessdebug - decrease debugging verbosity
+ */
+static RETSIGTYPE
+lessdebug(
+ int sig
+ )
+{
+ int saved_errno = errno;
+
+ if (debug > 0)
+ {
+ debug--;
+ msyslog(LOG_DEBUG, "debug lowered to %d", debug);
+ }
+ errno = saved_errno;
+}
+
+# else /* !DEBUG follows */
+
+
+/*
+ * no_debug - We don't do the debug here.
+ */
+static RETSIGTYPE
+no_debug(
+ int sig
+ )
+{
+ int saved_errno = errno;
+
+ msyslog(LOG_DEBUG, "ntpd not compiled for debugging (signal %d)", sig);
+ errno = saved_errno;
+}
+# endif /* !DEBUG */
+#endif /* !SIM && !SYS_WINNT */
diff --git a/ntpd/ntpd.html b/ntpd/ntpd.html
new file mode 100644
index 0000000..25b6caa
--- /dev/null
+++ b/ntpd/ntpd.html
@@ -0,0 +1,995 @@
+<html lang="en">
+<head>
+<title>ntpd: Network Time Protocol (NTP) Daemon User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="ntpd: Network Time Protocol (NTP) Daemon User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">ntpd: Network Time Protocol (NTP) Daemon User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Description">ntpd Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">ntpd: Network Time Protocol (NTP) Daemon User Manual</h2>
+
+<p>The <code>ntpd</code> program is an operating system daemon that synchronizes the
+system clock to remote NTP time servers or local reference clocks.
+It is a complete implementation of NTP version 4 defined by RFC-5905, but
+also retains compatible with version 3 defined by RFC-1305 and versions
+1 and 2, defined by RFC-1059 and RFC-1119, respectively.
+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.7p482 of <code>ntpd</code>.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description
+<li><a accesskey="2" href="#ntpd-Invocation">ntpd Invocation</a>: Invoking ntpd
+<li><a accesskey="3" href="#Usage">Usage</a>: Usage
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpd-Description"></a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>The <code>ntpd</code> program ordinarily requires
+a configuration file described at <a href="#ntp_002econf">ntp.conf</a>.
+This configuration file contains configuration commands described on
+the pages listed above.
+However a client can discover remote servers and configure them
+automatically.
+This makes it possible to deploy a fleet of workstations without
+specifying configuration details specific to the local environment.
+
+ <p>The <code>ntpd</code> program normally operates continuously while adjusting the
+system time and frequency, but in some cases this might not be
+practical.
+With the <code>-q</code> option <code>ntpd</code> operates as in continuous mode, but
+exits just after setting the clock for the first time.
+Most applications will probably want to specify the <code>iburst</code>
+option with the <code>server</code> command.
+With this option an initial volley of messages is exchanged to
+groom the data and set the clock in about ten seconds' time.
+If nothing is heard after a few minutes' time,
+the daemon times out and exits without setting the clock.
+
+<div class="node">
+<p><hr>
+<a name="ntpd-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">Invoking ntpd</h3>
+
+<p><a name="index-ntpd-1"></a><a name="index-NTP-daemon-program-2"></a>
+
+ <p>The
+<code>ntpd</code>
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC-5905,
+but also retains compatibility with
+version 3, as defined by RFC-1305, and versions 1
+and 2, as defined by RFC-1059 and RFC-1119, respectively.
+
+ <p>The
+<code>ntpd</code>
+utility does most computations in 64-bit floating point
+arithmetic and does relatively clumsy 64-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+
+ <p>Ordinarily,
+<code>ntpd</code>
+reads the
+<code>ntp.conf(5)</code>
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+
+ <p>If NetInfo support is built into
+<code>ntpd</code>
+then
+<code>ntpd</code>
+will attempt to read its configuration from the
+NetInfo if the default
+<code>ntp.conf(5)</code>
+file cannot be read and no file is
+specified by the
+<code>-c</code>
+option.
+
+ <p>Various internal
+<code>ntpd</code>
+variables can be displayed and
+configuration options altered while the
+<code>ntpd</code>
+is running
+using the
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+utility programs.
+
+ <p>When
+<code>ntpd</code>
+starts it looks at the value of
+<code>umask(2)</code>,
+and if zero
+<code>ntpd</code>
+will set the
+<code>umask(2)</code>
+to 022.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpd</code> program.
+This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpd-usage">ntpd usage</a>: ntpd help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntpd-ipv4">ntpd ipv4</a>: ipv4 option (-4)
+<li><a accesskey="3" href="#ntpd-ipv6">ntpd ipv6</a>: ipv6 option (-6)
+<li><a accesskey="4" href="#ntpd-authreq">ntpd authreq</a>: authreq option (-a)
+<li><a accesskey="5" href="#ntpd-authnoreq">ntpd authnoreq</a>: authnoreq option (-A)
+<li><a accesskey="6" href="#ntpd-configfile">ntpd configfile</a>: configfile option (-c)
+<li><a accesskey="7" href="#ntpd-driftfile">ntpd driftfile</a>: driftfile option (-f)
+<li><a accesskey="8" href="#ntpd-panicgate">ntpd panicgate</a>: panicgate option (-g)
+<li><a accesskey="9" href="#ntpd-jaildir">ntpd jaildir</a>: jaildir option (-i)
+<li><a href="#ntpd-interface">ntpd interface</a>: interface option (-I)
+<li><a href="#ntpd-keyfile">ntpd keyfile</a>: keyfile option (-k)
+<li><a href="#ntpd-logfile">ntpd logfile</a>: logfile option (-l)
+<li><a href="#ntpd-novirtualips">ntpd novirtualips</a>: novirtualips option (-L)
+<li><a href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>: modifymmtimer option (-M)
+<li><a href="#ntpd-nice">ntpd nice</a>: nice option (-N)
+<li><a href="#ntpd-pidfile">ntpd pidfile</a>: pidfile option (-p)
+<li><a href="#ntpd-priority">ntpd priority</a>: priority option (-P)
+<li><a href="#ntpd-quit">ntpd quit</a>: quit option (-q)
+<li><a href="#ntpd-propagationdelay">ntpd propagationdelay</a>: propagationdelay option (-r)
+<li><a href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>: saveconfigquit option
+<li><a href="#ntpd-statsdir">ntpd statsdir</a>: statsdir option (-s)
+<li><a href="#ntpd-trustedkey">ntpd trustedkey</a>: trustedkey option (-t)
+<li><a href="#ntpd-user">ntpd user</a>: user option (-u)
+<li><a href="#ntpd-updateinterval">ntpd updateinterval</a>: updateinterval option (-U)
+<li><a href="#ntpd-wait_002dsync">ntpd wait-sync</a>: wait-sync option (-w)
+<li><a href="#ntpd-slew">ntpd slew</a>: slew option (-x)
+<li><a href="#ntpd-usepcc">ntpd usepcc</a>: usepcc option
+<li><a href="#ntpd-pccfreq">ntpd pccfreq</a>: pccfreq option
+<li><a href="#ntpd-mdns">ntpd mdns</a>: mdns option (-m)
+<li><a href="#ntpd-config">ntpd config</a>: presetting/configuring ntpd
+<li><a href="#ntpd-exit-status">ntpd exit status</a>: exit status
+<li><a href="#ntpd-Usage">ntpd Usage</a>: Usage
+<li><a href="#ntpd-Files">ntpd Files</a>: Files
+<li><a href="#ntpd-See-Also">ntpd See Also</a>: See Also
+<li><a href="#ntpd-Bugs">ntpd Bugs</a>: Bugs
+<li><a href="#ntpd-Notes">ntpd Notes</a>: Notes
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpd-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-ipv4">ntpd ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpd help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntpd-help-3"></a>
+This is the automatically generated usage text for ntpd.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntpd - NTP daemon program - Ver. 4.2.7p481
+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
+ -4 no ipv4 Force IPv4 DNS name resolution
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -a no authreq Require crypto authentication
+ - prohibits the option 'authnoreq'
+ -A no authnoreq Do not require crypto authentication
+ - prohibits the option 'authreq'
+ -b no bcastsync Allow us to sync to broadcast servers
+ -c Str configfile configuration file name
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -f Str driftfile frequency drift file name
+ -g no panicgate Allow the first adjustment to be Big
+ - may appear multiple times
+ -i Str jaildir Jail directory
+ -I Str interface Listen on an interface name or address
+ - may appear multiple times
+ -k Str keyfile path to symmetric keys
+ -l Str logfile path to the log file
+ -L no novirtualips Do not listen to virtual interfaces
+ -n no nofork Do not fork
+ - prohibits the option 'wait-sync'
+ -N no nice Run at high priority
+ -p Str pidfile path to the PID file
+ -P Num priority Process priority
+ -q no quit Set the time and quit
+ - prohibits these options:
+ saveconfigquit
+ wait-sync
+ -r Str propagationdelay Broadcast/propagation delay
+ Str saveconfigquit Save parsed configuration and quit
+ - prohibits these options:
+ quit
+ wait-sync
+ -s Str statsdir Statistics file location
+ -t Str trustedkey Trusted key number
+ - may appear multiple times
+ -u Str user Run as userid (or userid:groupid)
+ -U Num updateinterval interval in seconds between scans for new or dropped interfaces
+ Str var make ARG an ntp variable (RW)
+ - may appear multiple times
+ Str dvar make ARG an ntp variable (RW|DEF)
+ - may appear multiple times
+ -w Num wait-sync Seconds to wait for first clock sync
+ - prohibits these options:
+ nofork
+ quit
+ saveconfigquit
+ -x no slew Slew up to 600 seconds
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - examining environment variables named NTPD_*
+
+Please send bug reports to: &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntpd-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-ipv6">ntpd ipv6</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usage">ntpd usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv4 option (-4)</h4>
+
+<p><a name="index-ntpd_002dipv4-4"></a>
+This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv6.
+</ul>
+
+ <p>Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+<div class="node">
+<p><hr>
+<a name="ntpd-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authreq">ntpd authreq</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv4">ntpd ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv6 option (-6)</h4>
+
+<p><a name="index-ntpd_002dipv6-5"></a>
+This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv4.
+</ul>
+
+ <p>Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+<div class="node">
+<p><hr>
+<a name="ntpd-authreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authnoreq">ntpd authnoreq</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv6">ntpd ipv6</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">authreq option (-a)</h4>
+
+<p><a name="index-ntpd_002dauthreq-6"></a>
+This is the &ldquo;require crypto authentication&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+authnoreq.
+</ul>
+
+ <p>Require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is the default.
+<div class="node">
+<p><hr>
+<a name="ntpd-authnoreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-configfile">ntpd configfile</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authreq">ntpd authreq</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">authnoreq option (-A)</h4>
+
+<p><a name="index-ntpd_002dauthnoreq-7"></a>
+This is the &ldquo;do not require crypto authentication&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+authreq.
+</ul>
+
+ <p>Do not require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is almost never a good idea.
+<div class="node">
+<p><hr>
+<a name="ntpd-configfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-driftfile">ntpd driftfile</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authnoreq">ntpd authnoreq</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">configfile option (-c)</h4>
+
+<p><a name="index-ntpd_002dconfigfile-8"></a>
+This is the &ldquo;configuration file name&rdquo; option.
+This option takes a string argument.
+The name and path of the configuration file,
+<span class="file">/etc/ntp.conf</span>
+by default.
+<div class="node">
+<p><hr>
+<a name="ntpd-driftfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-panicgate">ntpd panicgate</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-configfile">ntpd configfile</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">driftfile option (-f)</h4>
+
+<p><a name="index-ntpd_002ddriftfile-9"></a>
+This is the &ldquo;frequency drift file name&rdquo; option.
+This option takes a string argument.
+The name and path of the frequency file,
+<span class="file">/etc/ntp.drift</span>
+by default.
+This is the same operation as the
+<code>driftfile</code> <kbd>driftfile</kbd>
+configuration specification in the
+<span class="file">/etc/ntp.conf</span>
+file.
+<div class="node">
+<p><hr>
+<a name="ntpd-panicgate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">panicgate option (-g)</h4>
+
+<p><a name="index-ntpd_002dpanicgate-10"></a>
+This is the &ldquo;allow the first adjustment to be big&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>Normally,
+<code>ntpd</code>
+exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+<code>ntpd</code>
+will exit with a message to the system log. This option can be used with the
+<code>-q</code>
+and
+<code>-x</code>
+options.
+See the
+<code>tinker</code>
+configuration file directive for other options.
+<div class="node">
+<p><hr>
+<a name="ntpd-jaildir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">jaildir option (-i)</h4>
+
+<p><a name="index-ntpd_002djaildir-11"></a>
+This is the &ldquo;jail directory&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
+</ul>
+
+ <p>Chroot the server to the directory
+<kbd>jaildir</kbd>
+.
+This option also implies that the server attempts to drop root privileges at startup.
+You may need to also specify a
+<code>-u</code>
+option.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+<code>--enable-clockctl</code>) or Linux (configure with
+<code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
+<div class="node">
+<p><hr>
+<a name="ntpd-interface"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-keyfile">ntpd keyfile</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-jaildir">ntpd jaildir</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">interface option (-I)</h4>
+
+<p><a name="index-ntpd_002dinterface-12"></a>
+This is the &ldquo;listen on an interface name or address&rdquo; option.
+This option takes a string argument <span class="file">iface</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>Open the network address given, or all the addresses associated with the
+given interface name. This option may appear multiple times. This option
+also implies not opening other addresses, except wildcard and localhost.
+This option is deprecated. Please consider using the configuration file
+<code>interface</code> command, which is more versatile.
+<div class="node">
+<p><hr>
+<a name="ntpd-keyfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-logfile">ntpd logfile</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-interface">ntpd interface</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">keyfile option (-k)</h4>
+
+<p><a name="index-ntpd_002dkeyfile-13"></a>
+This is the &ldquo;path to symmetric keys&rdquo; option.
+This option takes a string argument.
+Specify the name and path of the symmetric key file.
+<span class="file">/etc/ntp.keys</span>
+is the default.
+This is the same operation as the
+<code>keys</code> <kbd>keyfile</kbd>
+configuration file directive.
+<div class="node">
+<p><hr>
+<a name="ntpd-logfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-novirtualips">ntpd novirtualips</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-keyfile">ntpd keyfile</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">logfile option (-l)</h4>
+
+<p><a name="index-ntpd_002dlogfile-14"></a>
+This is the &ldquo;path to the log file&rdquo; option.
+This option takes a string argument.
+Specify the name and path of the log file.
+The default is the system log file.
+This is the same operation as the
+<code>logfile</code> <kbd>logfile</kbd>
+configuration file directive.
+<div class="node">
+<p><hr>
+<a name="ntpd-novirtualips"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-logfile">ntpd logfile</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">novirtualips option (-L)</h4>
+
+<p><a name="index-ntpd_002dnovirtualips-15"></a>
+This is the &ldquo;do not listen to virtual interfaces&rdquo; option.
+Do not listen to virtual interfaces, defined as those with
+names containing a colon. This option is deprecated. Please
+consider using the configuration file <code>interface</code> command, which
+is more versatile.
+<div class="node">
+<p><hr>
+<a name="ntpd-modifymmtimer"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-nice">ntpd nice</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-novirtualips">ntpd novirtualips</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">modifymmtimer option (-M)</h4>
+
+<p><a name="index-ntpd_002dmodifymmtimer-16"></a>
+This is the &ldquo;modify multimedia timer (windows only)&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
+</ul>
+
+ <p>Set the Windows Multimedia Timer to highest resolution. This
+ensures the resolution does not change while ntpd is running,
+avoiding timekeeping glitches associated with changes.
+<div class="node">
+<p><hr>
+<a name="ntpd-nice"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pidfile">ntpd pidfile</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">nice option (-N)</h4>
+
+<p><a name="index-ntpd_002dnice-17"></a>
+This is the &ldquo;run at high priority&rdquo; option.
+To the extent permitted by the operating system, run
+<code>ntpd</code>
+at the highest priority.
+<div class="node">
+<p><hr>
+<a name="ntpd-pidfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-priority">ntpd priority</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-nice">ntpd nice</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">pidfile option (-p)</h4>
+
+<p><a name="index-ntpd_002dpidfile-18"></a>
+This is the &ldquo;path to the pid file&rdquo; option.
+This option takes a string argument.
+Specify the name and path of the file used to record
+<code>ntpd</code>'s
+process ID.
+This is the same operation as the
+<code>pidfile</code> <kbd>pidfile</kbd>
+configuration file directive.
+<div class="node">
+<p><hr>
+<a name="ntpd-priority"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-quit">ntpd quit</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pidfile">ntpd pidfile</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">priority option (-P)</h4>
+
+<p><a name="index-ntpd_002dpriority-19"></a>
+This is the &ldquo;process priority&rdquo; option.
+This option takes a number argument.
+To the extent permitted by the operating system, run
+<code>ntpd</code>
+at the specified
+<code>sched_setscheduler(SCHED_FIFO)</code>
+priority.
+<div class="node">
+<p><hr>
+<a name="ntpd-quit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-priority">ntpd priority</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">quit option (-q)</h4>
+
+<p><a name="index-ntpd_002dquit-20"></a>
+This is the &ldquo;set the time and quit&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+saveconfigquit, wait-sync.
+</ul>
+
+ <p><code>ntpd</code>
+will not daemonize and will exit after the clock is first
+synchronized. This behavior mimics that of the
+<code>ntpdate</code>
+program, which will soon be replaced with a shell script.
+The
+<code>-g</code>
+and
+<code>-x</code>
+options can be used with this option.
+Note: The kernel time discipline is disabled with this option.
+<div class="node">
+<p><hr>
+<a name="ntpd-propagationdelay"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-quit">ntpd quit</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">propagationdelay option (-r)</h4>
+
+<p><a name="index-ntpd_002dpropagationdelay-21"></a>
+This is the &ldquo;broadcast/propagation delay&rdquo; option.
+This option takes a string argument.
+Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+<div class="node">
+<p><hr>
+<a name="ntpd-saveconfigquit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-statsdir">ntpd statsdir</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">saveconfigquit option</h4>
+
+<p><a name="index-ntpd_002dsaveconfigquit-22"></a>
+This is the &ldquo;save parsed configuration and quit&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>SAVECONFIG</code> during the compilation.
+<li>must not appear in combination with any of the following options:
+quit, wait-sync.
+</ul>
+
+ <p>Cause <code>ntpd</code> to parse its startup configuration file and save an
+equivalent to the given filename and exit. This option was
+designed for automated testing.
+<div class="node">
+<p><hr>
+<a name="ntpd-statsdir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-trustedkey">ntpd trustedkey</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">statsdir option (-s)</h4>
+
+<p><a name="index-ntpd_002dstatsdir-23"></a>
+This is the &ldquo;statistics file location&rdquo; option.
+This option takes a string argument.
+Specify the directory path for files created by the statistics facility.
+This is the same operation as the
+<code>statsdir</code> <kbd>statsdir</kbd>
+configuration file directive.
+<div class="node">
+<p><hr>
+<a name="ntpd-trustedkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-user">ntpd user</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-statsdir">ntpd statsdir</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">trustedkey option (-t)</h4>
+
+<p><a name="index-ntpd_002dtrustedkey-24"></a>
+This is the &ldquo;trusted key number&rdquo; option.
+This option takes a string argument <span class="file">tkey</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>Add the specified key number to the trusted key list.
+<div class="node">
+<p><hr>
+<a name="ntpd-user"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-updateinterval">ntpd updateinterval</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-trustedkey">ntpd trustedkey</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">user option (-u)</h4>
+
+<p><a name="index-ntpd_002duser-25"></a>
+This is the &ldquo;run as userid (or userid:groupid)&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
+</ul>
+
+ <p>Specify a user, and optionally a group, to switch to.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+<code>--enable-clockctl</code>) or Linux (configure with
+<code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
+<div class="node">
+<p><hr>
+<a name="ntpd-updateinterval"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-user">ntpd user</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">updateinterval option (-U)</h4>
+
+<p><a name="index-ntpd_002dupdateinterval-26"></a>
+This is the &ldquo;interval in seconds between scans for new or dropped interfaces&rdquo; option.
+This option takes a number argument.
+Give the time in seconds between two scans for new or dropped interfaces.
+For systems with routing socket support the scans will be performed shortly after the interface change
+has been detected by the system.
+Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+<div class="node">
+<p><hr>
+<a name="ntpd-wait_002dsync"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-slew">ntpd slew</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-updateinterval">ntpd updateinterval</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">wait-sync option (-w)</h4>
+
+<p><a name="index-ntpd_002dwait_002dsync-27"></a>
+This is the &ldquo;seconds to wait for first clock sync&rdquo; option.
+This option takes a number argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>HAVE_WORKING_FORK</code> during the compilation.
+<li>must not appear in combination with any of the following options:
+nofork, quit, saveconfigquit.
+</ul>
+
+ <p>If greater than zero, alters <code>ntpd</code>'s behavior when forking to
+daemonize. Instead of exiting with status 0 immediately after
+the fork, the parent waits up to the specified number of
+seconds for the child to first synchronize the clock. The exit
+status is zero (success) if the clock was synchronized,
+otherwise it is <code>ETIMEDOUT</code>.
+This provides the option for a script starting <code>ntpd</code> to easily
+wait for the first set of the clock before proceeding.
+<div class="node">
+<p><hr>
+<a name="ntpd-slew"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-usepcc">ntpd usepcc</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">slew option (-x)</h4>
+
+<p><a name="index-ntpd_002dslew-28"></a>
+This is the &ldquo;slew up to 600 seconds&rdquo; option.
+Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+This option can be used with the
+<code>-g</code>
+and
+<code>-q</code>
+options.
+See the
+<code>tinker</code>
+configuration file directive for other options.
+Note: The kernel time discipline is disabled with this option.
+<div class="node">
+<p><hr>
+<a name="ntpd-usepcc"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pccfreq">ntpd pccfreq</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-slew">ntpd slew</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">usepcc option</h4>
+
+<p><a name="index-ntpd_002dusepcc-29"></a>
+This is the &ldquo;use cpu cycle counter (windows only)&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
+</ul>
+
+ <p>Attempt to substitute the CPU counter for <code>QueryPerformanceCounter</code>.
+The CPU counter and <code>QueryPerformanceCounter</code> are compared, and if
+they have the same frequency, the CPU counter (RDTSC on x86) is
+used directly, saving the overhead of a system call.
+<div class="node">
+<p><hr>
+<a name="ntpd-pccfreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-mdns">ntpd mdns</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usepcc">ntpd usepcc</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">pccfreq option</h4>
+
+<p><a name="index-ntpd_002dpccfreq-30"></a>
+This is the &ldquo;force cpu cycle counter use (windows only)&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
+</ul>
+
+ <p>Force substitution the CPU counter for <code>QueryPerformanceCounter</code>.
+The CPU counter (RDTSC on x86) is used unconditionally with the
+given frequency (in Hz).
+<div class="node">
+<p><hr>
+<a name="ntpd-mdns"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-config">ntpd config</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pccfreq">ntpd pccfreq</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">mdns option (-m)</h4>
+
+<p><a name="index-ntpd_002dmdns-31"></a>
+This is the &ldquo;register with mdns as a ntp server&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>HAVE_DNSREGISTRATION</code> during the compilation.
+</ul>
+
+ <p>Registers as an NTP server with the local mDNS server which allows
+the server to be discovered via mDNS client lookup.
+
+<div class="node">
+<p><hr>
+<a name="ntpd-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-exit-status">ntpd exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-mdns">ntpd mdns</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">presetting/configuring ntpd</h4>
+
+<p>Any option that is not marked as <i>not presettable</i> may be preset by
+loading values from environment variables named <code>NTPD</code> and <code>NTPD_&lt;OPTION_NAME&gt;</code>. <code>&lt;OPTION_NAME&gt;</code> must be one of
+the options listed above in upper case and segmented with underscores.
+The <code>NTPD</code> variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+ <p>The command line options relating to configuration and/or usage help are:
+
+<h5 class="subsubheading">version (-)</h5>
+
+<p>Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+ <dl>
+<dt><span class="samp">version</span><dd>Only print the version. This is the default.
+<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
+<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
+</dl>
+
+<div class="node">
+<p><hr>
+<a name="ntpd-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Usage">ntpd Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-config">ntpd config</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpd exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+ <div class="node">
+<p><hr>
+<a name="ntpd-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Files">ntpd Files</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-exit-status">ntpd exit status</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpd Usage</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntpd-Files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-See-Also">ntpd See Also</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Usage">ntpd Usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpd Files</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntpd-See-Also"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Bugs">ntpd Bugs</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Files">ntpd Files</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpd See Also</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntpd-Bugs"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Notes">ntpd Notes</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-See-Also">ntpd See Also</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpd Bugs</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntpd-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Bugs">ntpd Bugs</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpd Notes</h4>
+
+<div class="node">
+<p><hr>
+<a name="Usage"></a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Usage</h3>
+
diff --git a/ntpd/ntpd.man.in b/ntpd/ntpd.man.in
new file mode 100644
index 0000000..a6824ca
--- /dev/null
+++ b/ntpd/ntpd.man.in
@@ -0,0 +1,987 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpd @NTPD_MS@ "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-AtaWSL/ag-MtaORL)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:56:46 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpd-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpd\fP
+\- NTP daemon program
+.SH SYNOPSIS
+\f\*[B-Font]ntpd\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ <server1> ... <serverN> ]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The
+\f\*[B-Font]ntpd\fP
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC-5905,
+but also retains compatibility with
+version 3, as defined by RFC-1305, and versions 1
+and 2, as defined by RFC-1059 and RFC-1119, respectively.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]ntpd\fP
+utility does most computations in 64-bit floating point
+arithmetic and does relatively clumsy 64-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily,
+\f\*[B-Font]ntpd\fP
+reads the
+\fCntp.conf\fR(5)\f[]
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+.sp \n(Ppu
+.ne 2
+
+If NetInfo support is built into
+\f\*[B-Font]ntpd\fP,
+then
+\f\*[B-Font]ntpd\fP
+will attempt to read its configuration from the
+NetInfo if the default
+\fCntp.conf\fR(5)\f[]
+file cannot be read and no file is
+specified by the
+\f\*[B-Font]\-c\f[]
+option.
+.sp \n(Ppu
+.ne 2
+
+Various internal
+\f\*[B-Font]ntpd\fP
+variables can be displayed and
+configuration options altered while the
+\f\*[B-Font]ntpd\fP
+is running
+using the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utility programs.
+.sp \n(Ppu
+.ne 2
+
+When
+\f\*[B-Font]ntpd\fP
+starts it looks at the value of
+\fCumask\fR(2)\f[],
+and if zero
+\f\*[B-Font]ntpd\fP
+will set the
+\fCumask\fR(2)\f[]
+to 022.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-a\f[], \f\*[B-Font]\-\-authreq\f[]
+Require crypto authentication.
+This option must not appear in combination with any of the following options:
+authnoreq.
+.sp
+Require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is the default.
+.TP
+.NOP \f\*[B-Font]\-A\f[], \f\*[B-Font]\-\-authnoreq\f[]
+Do not require crypto authentication.
+This option must not appear in combination with any of the following options:
+authreq.
+.sp
+Do not require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is almost never a good idea.
+.TP
+.NOP \f\*[B-Font]\-b\f[], \f\*[B-Font]\-\-bcastsync\f[]
+Allow us to sync to broadcast servers.
+.sp
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-configfile\f[]=\f\*[I-Font]string\f[]
+configuration file name.
+.sp
+The name and path of the configuration file,
+\fI/etc/ntp.conf\fP
+by default.
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-f\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-driftfile\f[]=\f\*[I-Font]string\f[]
+frequency drift file name.
+.sp
+The name and path of the frequency file,
+\fI/etc/ntp.drift\fP
+by default.
+This is the same operation as the
+\fBdriftfile\fP \fIdriftfile\fP
+configuration specification in the
+\fI/etc/ntp.conf\fP
+file.
+.TP
+.NOP \f\*[B-Font]\-g\f[], \f\*[B-Font]\-\-panicgate\f[]
+Allow the first adjustment to be Big.
+This option may appear an unlimited number of times.
+.sp
+Normally,
+\fBntpd\fP
+exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+\fBntpd\fP
+will exit with a message to the system log. This option can be used with the
+\fB-q\fP
+and
+\fB-x\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+.TP
+.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-jaildir\f[]=\f\*[I-Font]string\f[]
+Jail directory.
+.sp
+Chroot the server to the directory
+\fIjaildir\fP
+.
+This option also implies that the server attempts to drop root privileges at startup.
+You may need to also specify a
+\fB-u\fP
+option.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB--enable-clockctl\fP) or Linux (configure with
+\fB--enable-linuxcaps\fP) or Solaris (configure with \fB--enable-solarisprivs\fP).
+.TP
+.NOP \f\*[B-Font]\-I\f[] \f\*[I-Font]iface\f[], \f\*[B-Font]\-\-interface\f[]=\f\*[I-Font]iface\f[]
+Listen on an interface name or address.
+This option may appear an unlimited number of times.
+.sp
+Open the network address given, or all the addresses associated with the
+given interface name. This option may appear multiple times. This option
+also implies not opening other addresses, except wildcard and localhost.
+This option is deprecated. Please consider using the configuration file
+\fBinterface\fP command, which is more versatile.
+.TP
+.NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]string\f[]
+path to symmetric keys.
+.sp
+Specify the name and path of the symmetric key file.
+\fI/etc/ntp.keys\fP
+is the default.
+This is the same operation as the
+\fBkeys\fP \fIkeyfile\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]string\f[]
+path to the log file.
+.sp
+Specify the name and path of the log file.
+The default is the system log file.
+This is the same operation as the
+\fBlogfile\fP \fIlogfile\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-L\f[], \f\*[B-Font]\-\-novirtualips\f[]
+Do not listen to virtual interfaces.
+.sp
+Do not listen to virtual interfaces, defined as those with
+names containing a colon. This option is deprecated. Please
+consider using the configuration file \fBinterface\fP command, which
+is more versatile.
+.TP
+.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-modifymmtimer\f[]
+Modify Multimedia Timer (Windows only).
+.sp
+Set the Windows Multimedia Timer to highest resolution. This
+ensures the resolution does not change while ntpd is running,
+avoiding timekeeping glitches associated with changes.
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-nofork\f[]
+Do not fork.
+This option must not appear in combination with any of the following options:
+wait-sync.
+.sp
+.TP
+.NOP \f\*[B-Font]\-N\f[], \f\*[B-Font]\-\-nice\f[]
+Run at high priority.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the highest priority.
+.TP
+.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-pidfile\f[]=\f\*[I-Font]string\f[]
+path to the PID file.
+.sp
+Specify the name and path of the file used to record
+\fBntpd\fP's
+process ID.
+This is the same operation as the
+\fBpidfile\fP \fIpidfile\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-P\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-priority\f[]=\f\*[I-Font]number\f[]
+Process priority.
+This option takes an integer number as its argument.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the specified
+\fBsched_setscheduler(SCHED_FIFO)\fP
+priority.
+.TP
+.NOP \f\*[B-Font]\-q\f[], \f\*[B-Font]\-\-quit\f[]
+Set the time and quit.
+This option must not appear in combination with any of the following options:
+saveconfigquit, wait-sync.
+.sp
+\fBntpd\fP
+will not daemonize and will exit after the clock is first
+synchronized. This behavior mimics that of the
+\fBntpdate\fP
+program, which will soon be replaced with a shell script.
+The
+\fB-g\fP
+and
+\fB-x\fP
+options can be used with this option.
+Note: The kernel time discipline is disabled with this option.
+.TP
+.NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-propagationdelay\f[]=\f\*[I-Font]string\f[]
+Broadcast/propagation delay.
+.sp
+Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+.TP
+.NOP \f\*[B-Font]\-\-saveconfigquit\f[]=\f\*[I-Font]string\f[]
+Save parsed configuration and quit.
+This option must not appear in combination with any of the following options:
+quit, wait-sync.
+.sp
+Cause \fBntpd\fP to parse its startup configuration file and save an
+equivalent to the given filename and exit. This option was
+designed for automated testing.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-statsdir\f[]=\f\*[I-Font]string\f[]
+Statistics file location.
+.sp
+Specify the directory path for files created by the statistics facility.
+This is the same operation as the
+\fBstatsdir\fP \fIstatsdir\fP
+configuration file directive.
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]tkey\f[], \f\*[B-Font]\-\-trustedkey\f[]=\f\*[I-Font]tkey\f[]
+Trusted key number.
+This option may appear an unlimited number of times.
+.sp
+Add the specified key number to the trusted key list.
+.TP
+.NOP \f\*[B-Font]\-u\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-user\f[]=\f\*[I-Font]string\f[]
+Run as userid (or userid:groupid).
+.sp
+Specify a user, and optionally a group, to switch to.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB--enable-clockctl\fP) or Linux (configure with
+\fB--enable-linuxcaps\fP) or Solaris (configure with \fB--enable-solarisprivs\fP).
+.TP
+.NOP \f\*[B-Font]\-U\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-updateinterval\f[]=\f\*[I-Font]number\f[]
+interval in seconds between scans for new or dropped interfaces.
+This option takes an integer number as its argument.
+.sp
+Give the time in seconds between two scans for new or dropped interfaces.
+For systems with routing socket support the scans will be performed shortly after the interface change
+has been detected by the system.
+Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+.TP
+.NOP \f\*[B-Font]\-\-var\f[]=\f\*[I-Font]nvar\f[]
+make ARG an ntp variable (RW).
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-dvar\f[]=\f\*[I-Font]ndvar\f[]
+make ARG an ntp variable (RW|DEF).
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-w\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-wait\-sync\f[]=\f\*[I-Font]number\f[]
+Seconds to wait for first clock sync.
+This option must not appear in combination with any of the following options:
+nofork, quit, saveconfigquit.
+This option takes an integer number as its argument.
+.sp
+If greater than zero, alters \fBntpd\fP's behavior when forking to
+daemonize. Instead of exiting with status 0 immediately after
+the fork, the parent waits up to the specified number of
+seconds for the child to first synchronize the clock. The exit
+status is zero (success) if the clock was synchronized,
+otherwise it is \fBETIMEDOUT\fP.
+This provides the option for a script starting \fBntpd\fP to easily
+wait for the first set of the clock before proceeding.
+.TP
+.NOP \f\*[B-Font]\-x\f[], \f\*[B-Font]\-\-slew\f[]
+Slew up to 600 seconds.
+.sp
+Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+This option can be used with the
+\fB-g\fP
+and
+\fB-q\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+Note: The kernel time discipline is disabled with this option.
+.TP
+.NOP \f\*[B-Font]\-\-usepcc\f[]
+Use CPU cycle counter (Windows only).
+.sp
+Attempt to substitute the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter and \fBQueryPerformanceCounter\fP are compared, and if
+they have the same frequency, the CPU counter (RDTSC on x86) is
+used directly, saving the overhead of a system call.
+.TP
+.NOP \f\*[B-Font]\-\-pccfreq\f[]=\f\*[I-Font]string\f[]
+Force CPU cycle counter use (Windows only).
+.sp
+Force substitution the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter (RDTSC on x86) is used unconditionally with the
+given frequency (in Hz).
+.TP
+.NOP \f\*[B-Font]\-m\f[], \f\*[B-Font]\-\-mdns\f[]
+Register with mDNS as a NTP server.
+.sp
+Registers as an NTP server with the local mDNS server which allows
+the server to be discovered via mDNS client lookup.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTPD_<option-name>\fP or \fBNTPD\fP
+.fi
+.ad
+.SH USAGE
+.SS "How NTP Operates"
+The
+\f\*[B-Font]ntpd\fP
+utility operates by exchanging messages with
+one or more configured servers over a range of designated poll intervals.
+When
+started, whether for the first or subsequent times, the program
+requires several exchanges from the majority of these servers so
+the signal processing and mitigation algorithms can accumulate and
+groom the data and set the clock.
+In order to protect the network
+from bursts, the initial poll interval for each server is delayed
+an interval randomized over a few seconds.
+At the default initial poll
+interval of 64s, several minutes can elapse before the clock is
+set.
+This initial delay to set the clock
+can be safely and dramatically reduced using the
+\f\*[B-Font]iburst\f[]
+keyword with the
+\f\*[B-Font]server\f[]
+configuration
+command, as described in
+\fCntp.conf\fR(5)\f[].
+.sp \n(Ppu
+.ne 2
+
+Most operating systems and hardware of today incorporate a
+time-of-year (TOY) chip to maintain the time during periods when
+the power is off.
+When the machine is booted, the chip is used to
+initialize the operating system time.
+After the machine has
+synchronized to a NTP server, the operating system corrects the
+chip from time to time.
+In the default case, if
+\f\*[B-Font]ntpd\fP
+detects that the time on the host
+is more than 1000s from the server time,
+\f\*[B-Font]ntpd\fP
+assumes something must be terribly wrong and the only
+reliable action is for the operator to intervene and set the clock
+by hand.
+(Reasons for this include there is no TOY chip,
+or its battery is dead, or that the TOY chip is just of poor quality.)
+This causes
+\f\*[B-Font]ntpd\fP
+to exit with a panic message to
+the system log.
+The
+\f\*[B-Font]\-g\f[]
+option overrides this check and the
+clock will be set to the server time regardless of the chip time
+(up to 68 years in the past or future \(em
+this is a limitation of the NTPv4 protocol).
+However, and to protect against broken hardware, such as when the
+CMOS battery fails or the clock counter becomes defective, once the
+clock has been set an error greater than 1000s will cause
+\f\*[B-Font]ntpd\fP
+to exit anyway.
+.sp \n(Ppu
+.ne 2
+
+Under ordinary conditions,
+\f\*[B-Font]ntpd\fP
+adjusts the clock in
+small steps so that the timescale is effectively continuous and
+without discontinuities.
+Under conditions of extreme network
+congestion, the roundtrip delay jitter can exceed three seconds and
+the synchronization distance, which is equal to one-half the
+roundtrip delay plus error budget terms, can become very large.
+The
+\f\*[B-Font]ntpd\fP
+algorithms discard sample offsets exceeding 128 ms,
+unless the interval during which no sample offset is less than 128
+ms exceeds 900s.
+The first sample after that, no matter what the
+offset, steps the clock to the indicated time.
+In practice this
+reduces the false alarm rate where the clock is stepped in error to
+a vanishingly low incidence.
+.sp \n(Ppu
+.ne 2
+
+As the result of this behavior, once the clock has been set it
+very rarely strays more than 128 ms even under extreme cases of
+network path congestion and jitter.
+Sometimes, in particular when
+\f\*[B-Font]ntpd\fP
+is first started without a valid drift file
+on a system with a large intrinsic drift
+the error might grow to exceed 128 ms,
+which would cause the clock to be set backwards
+if the local clock time is more than 128 s
+in the future relative to the server.
+In some applications, this behavior may be unacceptable.
+There are several solutions, however.
+If the
+\f\*[B-Font]\-x\f[]
+option is included on the command line, the clock will
+never be stepped and only slew corrections will be used.
+But this choice comes with a cost that
+should be carefully explored before deciding to use
+the
+\f\*[B-Font]\-x\f[]
+option.
+The maximum slew rate possible is limited
+to 500 parts-per-million (PPM) as a consequence of the correctness
+principles on which the NTP protocol and algorithm design are
+based.
+As a result, the local clock can take a long time to
+converge to an acceptable offset, about 2,000 s for each second the
+clock is outside the acceptable range.
+During this interval the
+local clock will not be consistent with any other network clock and
+the system cannot be used for distributed applications that require
+correctly synchronized network time.
+.sp \n(Ppu
+.ne 2
+
+In spite of the above precautions, sometimes when large
+frequency errors are present the resulting time offsets stray
+outside the 128-ms range and an eventual step or slew time
+correction is required.
+If following such a correction the
+frequency error is so large that the first sample is outside the
+acceptable range,
+\f\*[B-Font]ntpd\fP
+enters the same state as when the
+\fIntp.drift\f[]
+file is not present.
+The intent of this behavior
+is to quickly correct the frequency and restore operation to the
+normal tracking mode.
+In the most extreme cases
+(the host
+\f\*[B-Font]time.ien.it\f[]
+comes to mind), there may be occasional
+step/slew corrections and subsequent frequency corrections.
+It
+helps in these cases to use the
+\f\*[B-Font]burst\f[]
+keyword when
+configuring the server, but
+ONLY
+when you have permission to do so from the owner of the target host.
+.sp \n(Ppu
+.ne 2
+
+Finally,
+in the past many startup scripts would run
+\fCntpdate\fR(@NTPDATE_MS@)\f[]
+to get the system clock close to correct before starting
+\fCntpd\fR(@NTPD_MS@)\f[],
+but this was never more than a mediocre hack and is no longer needed.
+If you are following the instructions in
+\fIStarting NTP (Best Current Practice)\f[]
+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\fR(@SNTP_MS@)\f[].
+.sp \n(Ppu
+.ne 2
+
+There is a way to start
+\fCntpd\fR(@NTPD_MS@)\f[]
+that often addresses all of the problems mentioned above.
+.SS "Starting NTP (Best Current Practice)"
+First, use the
+\f\*[B-Font]iburst\f[]
+option on your
+\f\*[B-Font]server\f[]
+entries.
+.sp \n(Ppu
+.ne 2
+
+If you can also keep a good
+\fIntp.drift\f[]
+file then
+\fCntpd\fR(@NTPD_MS@)\f[]
+will effectively "warm-start" and your system's clock will
+be stable in under 11 seconds' time.
+.sp \n(Ppu
+.ne 2
+
+As soon as possible in the startup sequence, start
+\fCntpd\fR(@NTPD_MS@)\f[]
+with at least the
+\f\*[B-Font]\-g\f[]
+and perhaps the
+\f\*[B-Font]\-N\f[]
+options.
+Then,
+start the rest of your "normal" processes.
+This will give
+\fCntpd\fR(@NTPD_MS@)\f[]
+as much time as possible to get the system's clock synchronized and stable.
+.sp \n(Ppu
+.ne 2
+
+Finally,
+if you have processes like
+\f\*[B-Font]dovecot\f[]
+or database servers
+that require
+monotonically-increasing time,
+run
+\fCntp-wait\fR(@NTP_WAIT_MS@)\f[]
+as late as possible in the boot sequence
+(perhaps with the
+\f\*[B-Font]\-v\f[]
+flag)
+and after
+\fCntp-wait\fR(@NTP_WAIT_MS@)\f[]
+exits successfully
+it is as safe as it will ever be to start any process that require
+stable time.
+.SS "Frequency Discipline"
+The
+\f\*[B-Font]ntpd\fP
+behavior at startup depends on whether the
+frequency file, usually
+\fIntp.drift\f[],
+exists.
+This file
+contains the latest estimate of clock frequency error.
+When the
+\f\*[B-Font]ntpd\fP
+is started and the file does not exist, the
+\f\*[B-Font]ntpd\fP
+enters a special mode designed to quickly adapt to
+the particular system clock oscillator time and frequency error.
+This takes approximately 15 minutes, after which the time and
+frequency are set to nominal values and the
+\f\*[B-Font]ntpd\fP
+enters
+normal mode, where the time and frequency are continuously tracked
+relative to the server.
+After one hour the frequency file is
+created and the current frequency offset written to it.
+When the
+\f\*[B-Font]ntpd\fP
+is started and the file does exist, the
+\f\*[B-Font]ntpd\fP
+frequency is initialized from the file and enters normal mode
+immediately.
+After that the current frequency offset is written to
+the file at hourly intervals.
+.SS "Operating Modes"
+The
+\f\*[B-Font]ntpd\fP
+utility can operate in any of several modes, including
+symmetric active/passive, client/server broadcast/multicast and
+manycast, as described in the
+"Association Management"
+page
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[]).
+It normally operates continuously while
+monitoring for small changes in frequency and trimming the clock
+for the ultimate precision.
+However, it can operate in a one-time
+mode where the time is set from an external server and frequency is
+set from a previously recorded frequency file.
+A
+broadcast/multicast or manycast client can discover remote servers,
+compute server-client propagation delay correction factors and
+configure itself automatically.
+This makes it possible to deploy a
+fleet of workstations without specifying configuration details
+specific to the local environment.
+.sp \n(Ppu
+.ne 2
+
+By default,
+\f\*[B-Font]ntpd\fP
+runs in continuous mode where each of
+possibly several external servers is polled at intervals determined
+by an intricate state machine.
+The state machine measures the
+incidental roundtrip delay jitter and oscillator frequency wander
+and determines the best poll interval using a heuristic algorithm.
+Ordinarily, and in most operating environments, the state machine
+will start with 64s intervals and eventually increase in steps to
+1024s.
+A small amount of random variation is introduced in order to
+avoid bunching at the servers.
+In addition, should a server become
+unreachable for some time, the poll interval is increased in steps
+to 1024s in order to reduce network overhead.
+.sp \n(Ppu
+.ne 2
+
+In some cases it may not be practical for
+\f\*[B-Font]ntpd\fP
+to run continuously.
+A common workaround has been to run the
+\fCntpdate\fR(@NTPDATE_MS@)\f[]
+or
+\fCsntp\fR(@SNTP_MS@)\f[]
+programs from a
+\fCcron\fR(8)\f[]
+job at designated
+times.
+However, these programs do not have the crafted signal
+processing, error checking or mitigation algorithms of
+\f\*[B-Font]ntpd\fP.
+The
+\f\*[B-Font]\-q\f[]
+option is intended for this purpose.
+Setting this option will cause
+\f\*[B-Font]ntpd\fP
+to exit just after
+setting the clock for the first time.
+The procedure for initially
+setting the clock is the same as in continuous mode; most
+applications will probably want to specify the
+\f\*[B-Font]iburst\f[]
+keyword with the
+\f\*[B-Font]server\f[]
+configuration command.
+With this
+keyword a volley of messages are exchanged to groom the data and
+the clock is set in about 10 s.
+If nothing is heard after a
+couple of minutes, the daemon times out and exits.
+After a suitable
+period of mourning, the
+\fCntpdate\fR(@NTPDATE_MS@)\f[]
+program will be
+retired.
+.sp \n(Ppu
+.ne 2
+
+When kernel support is available to discipline the clock
+frequency, which is the case for stock Solaris, Tru64, Linux and
+FreeBSD,
+a useful feature is available to discipline the clock
+frequency.
+First,
+\f\*[B-Font]ntpd\fP
+is run in continuous mode with
+selected servers in order to measure and record the intrinsic clock
+frequency offset in the frequency file.
+It may take some hours for
+the frequency and offset to settle down.
+Then the
+\f\*[B-Font]ntpd\fP
+is
+stopped and run in one-time mode as required.
+At each startup, the
+frequency is read from the file and initializes the kernel
+frequency.
+.SS "Poll Interval Control"
+This version of NTP includes an intricate state machine to
+reduce the network load while maintaining a quality of
+synchronization consistent with the observed jitter and wander.
+There are a number of ways to tailor the operation in order enhance
+accuracy by reducing the interval or to reduce network overhead by
+increasing it.
+However, the user is advised to carefully consider
+the consequences of changing the poll adjustment range from the
+default minimum of 64 s to the default maximum of 1,024 s.
+The
+default minimum can be changed with the
+\f\*[B-Font]tinker\f[]
+\f\*[B-Font]minpoll\f[]
+command to a value not less than 16 s.
+This value is used for all
+configured associations, unless overridden by the
+\f\*[B-Font]minpoll\f[]
+option on the configuration command.
+Note that most device drivers
+will not operate properly if the poll interval is less than 64 s
+and that the broadcast server and manycast client associations will
+also use the default, unless overridden.
+.sp \n(Ppu
+.ne 2
+
+In some cases involving dial up or toll services, it may be
+useful to increase the minimum interval to a few tens of minutes
+and maximum interval to a day or so.
+Under normal operation
+conditions, once the clock discipline loop has stabilized the
+interval will be increased in steps from the minimum to the
+maximum.
+However, this assumes the intrinsic clock frequency error
+is small enough for the discipline loop correct it.
+The capture
+range of the loop is 500 PPM at an interval of 64s decreasing by a
+factor of two for each doubling of interval.
+At a minimum of 1,024
+s, for example, the capture range is only 31 PPM.
+If the intrinsic
+error is greater than this, the drift file
+\fIntp.drift\f[]
+will
+have to be specially tailored to reduce the residual error below
+this limit.
+Once this is done, the drift file is automatically
+updated once per hour and is available to initialize the frequency
+on subsequent daemon restarts.
+.SS "The huff-n'-puff Filter"
+In scenarios where a considerable amount of data are to be
+downloaded or uploaded over telephone modems, timekeeping quality
+can be seriously degraded.
+This occurs because the differential
+delays on the two directions of transmission can be quite large.
+In
+many cases the apparent time errors are so large as to exceed the
+step threshold and a step correction can occur during and after the
+data transfer is in progress.
+.sp \n(Ppu
+.ne 2
+
+The huff-n'-puff filter is designed to correct the apparent time
+offset in these cases.
+It depends on knowledge of the propagation
+delay when no other traffic is present.
+In common scenarios this
+occurs during other than work hours.
+The filter maintains a shift
+register that remembers the minimum delay over the most recent
+interval measured usually in hours.
+Under conditions of severe
+delay, the filter corrects the apparent offset using the sign of
+the offset and the difference between the apparent delay and
+minimum delay.
+The name of the filter reflects the negative (huff)
+and positive (puff) correction, which depends on the sign of the
+offset.
+.sp \n(Ppu
+.ne 2
+
+The filter is activated by the
+\f\*[B-Font]tinker\f[]
+command and
+\f\*[B-Font]huffpuff\f[]
+keyword, as described in
+\fCntp.conf\fR(5)\f[].
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH FILES
+.TP 15
+.NOP \fI/etc/ntp.conf\f[]
+the default name of the configuration file
+.br
+.ns
+.TP 15
+.NOP \fI/etc/ntp.drift\f[]
+the default name of the drift file
+.br
+.ns
+.TP 15
+.NOP \fI/etc/ntp.keys\f[]
+the default name of the key file
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "SEE ALSO"
+\fCntp.conf\fR(5)\f[],
+\fCntpdate\fR(@NTPDATE_MS@)\f[],
+\fCntpdc\fR(@NTPDC_MS@)\f[],
+\fCntpq\fR(@NTPQ_MS@)\f[],
+\fCsntp\fR(@SNTP_MS@)\f[]
+.sp \n(Ppu
+.ne 2
+
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+\f[C]http://www.ntp.org/\f[].
+A snapshot of this documentation is available in HTML format in
+\fI/usr/share/doc/ntp\f[].
+David L. Mills,
+\fINetwork Time Protocol (Version 1)\fR,
+RFC1059
+.PP
+
+David L. Mills,
+\fINetwork Time Protocol (Version 2)\fR,
+RFC1119
+.PP
+
+David L. Mills,
+\fINetwork Time Protocol (Version 3)\fR,
+RFC1305
+.PP
+
+David L. Mills and J. Martin, Ed. and J. Burbank and W. Kasch,
+\fINetwork Time Protocol Version 4: Protocol and Algorithms Specification\fR,
+RFC5905
+.PP
+
+David L. Mills and B. Haberman, Ed.,
+\fINetwork Time Protocol Version 4: Autokey Specification\fR,
+RFC5906
+.PP
+
+H. Gerstung and C. Elliott and B. Haberman, Ed.,
+\fIDefinitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)\fR,
+RFC5907
+.PP
+
+R. Gayraud and B. Lourdelet,
+\fINetwork Time Protocol (NTP) Server Option for DHCPv6\fR,
+RFC5908
+.PP
+
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+The
+\f\*[B-Font]ntpd\fP
+utility has gotten rather fat.
+While not huge, it has gotten
+larger than might be desirable for an elevated-priority
+\f\*[B-Font]ntpd\fP
+running on a workstation, particularly since many of
+the fancy features which consume the space were designed more with
+a busy primary server, rather than a high stratum workstation in
+mind.
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+Portions of this document came from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntpd\fP
+option definitions.
diff --git a/ntpd/ntpd.mdoc.in b/ntpd/ntpd.mdoc.in
new file mode 100644
index 0000000..1c06102
--- /dev/null
+++ b/ntpd/ntpd.mdoc.in
@@ -0,0 +1,891 @@
+.Dd December 2 2014
+.Dt NTPD @NTPD_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:03 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpd-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpd
+.Nd NTP daemon program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ <server1> ... <serverN> ]
+.Pp
+.Sh DESCRIPTION
+The
+.Nm
+utility is an operating system daemon which sets
+and maintains the system time of day in synchronism with Internet
+standard time servers.
+It is a complete implementation of the
+Network Time Protocol (NTP) version 4, as defined by RFC\-5905,
+but also retains compatibility with
+version 3, as defined by RFC\-1305, and versions 1
+and 2, as defined by RFC\-1059 and RFC\-1119, respectively.
+.Pp
+The
+.Nm
+utility does most computations in 64\-bit floating point
+arithmetic and does relatively clumsy 64\-bit fixed point operations
+only when necessary to preserve the ultimate precision, about 232
+picoseconds.
+While the ultimate precision is not achievable with
+ordinary workstations and networks of today, it may be required
+with future gigahertz CPU clocks and gigabit LANs.
+.Pp
+Ordinarily,
+.Nm
+reads the
+.Xr ntp.conf 5
+configuration file at startup time in order to determine the
+synchronization sources and operating modes.
+It is also possible to
+specify a working, although limited, configuration entirely on the
+command line, obviating the need for a configuration file.
+This may
+be particularly useful when the local host is to be configured as a
+broadcast/multicast client, with all peers being determined by
+listening to broadcasts at run time.
+.Pp
+If NetInfo support is built into
+.Nm ,
+then
+.Nm
+will attempt to read its configuration from the
+NetInfo if the default
+.Xr ntp.conf 5
+file cannot be read and no file is
+specified by the
+.Fl c
+option.
+.Pp
+Various internal
+.Nm
+variables can be displayed and
+configuration options altered while the
+.Nm
+is running
+using the
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+utility programs.
+.Pp
+When
+.Nm
+starts it looks at the value of
+.Xr umask 2 ,
+and if zero
+.Nm
+will set the
+.Xr umask 2
+to 022.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.It Fl a , Fl \-authreq
+Require crypto authentication.
+This option must not appear in combination with any of the following options:
+authnoreq.
+.sp
+Require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is the default.
+.It Fl A , Fl \-authnoreq
+Do not require crypto authentication.
+This option must not appear in combination with any of the following options:
+authreq.
+.sp
+Do not require cryptographic authentication for broadcast client,
+multicast client and symmetric passive associations.
+This is almost never a good idea.
+.It Fl b , Fl \-bcastsync
+Allow us to sync to broadcast servers.
+.sp
+.It Fl c Ar string , Fl \-configfile Ns = Ns Ar string
+configuration file name.
+.sp
+The name and path of the configuration file,
+\fI/etc/ntp.conf\fP
+by default.
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl f Ar string , Fl \-driftfile Ns = Ns Ar string
+frequency drift file name.
+.sp
+The name and path of the frequency file,
+\fI/etc/ntp.drift\fP
+by default.
+This is the same operation as the
+\fBdriftfile\fP \fIdriftfile\fP
+configuration specification in the
+\fI/etc/ntp.conf\fP
+file.
+.It Fl g , Fl \-panicgate
+Allow the first adjustment to be Big.
+This option may appear an unlimited number of times.
+.sp
+Normally,
+\fBntpd\fP
+exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+\fBntpd\fP
+will exit with a message to the system log. This option can be used with the
+\fB\-q\fP
+and
+\fB\-x\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+.It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string
+Jail directory.
+.sp
+Chroot the server to the directory
+\fIjaildir\fP
+.
+This option also implies that the server attempts to drop root privileges at startup.
+You may need to also specify a
+\fB\-u\fP
+option.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB\-\-enable\-clockctl\fP) or Linux (configure with
+\fB\-\-enable\-linuxcaps\fP) or Solaris (configure with \fB\-\-enable\-solarisprivs\fP).
+.It Fl I Ar iface , Fl \-interface Ns = Ns Ar iface
+Listen on an interface name or address.
+This option may appear an unlimited number of times.
+.sp
+Open the network address given, or all the addresses associated with the
+given interface name. This option may appear multiple times. This option
+also implies not opening other addresses, except wildcard and localhost.
+This option is deprecated. Please consider using the configuration file
+\fBinterface\fP command, which is more versatile.
+.It Fl k Ar string , Fl \-keyfile Ns = Ns Ar string
+path to symmetric keys.
+.sp
+Specify the name and path of the symmetric key file.
+\fI/etc/ntp.keys\fP
+is the default.
+This is the same operation as the
+\fBkeys\fP \fIkeyfile\fP
+configuration file directive.
+.It Fl l Ar string , Fl \-logfile Ns = Ns Ar string
+path to the log file.
+.sp
+Specify the name and path of the log file.
+The default is the system log file.
+This is the same operation as the
+\fBlogfile\fP \fIlogfile\fP
+configuration file directive.
+.It Fl L , Fl \-novirtualips
+Do not listen to virtual interfaces.
+.sp
+Do not listen to virtual interfaces, defined as those with
+names containing a colon. This option is deprecated. Please
+consider using the configuration file \fBinterface\fP command, which
+is more versatile.
+.It Fl M , Fl \-modifymmtimer
+Modify Multimedia Timer (Windows only).
+.sp
+Set the Windows Multimedia Timer to highest resolution. This
+ensures the resolution does not change while ntpd is running,
+avoiding timekeeping glitches associated with changes.
+.It Fl n , Fl \-nofork
+Do not fork.
+This option must not appear in combination with any of the following options:
+wait\-sync.
+.sp
+.It Fl N , Fl \-nice
+Run at high priority.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the highest priority.
+.It Fl p Ar string , Fl \-pidfile Ns = Ns Ar string
+path to the PID file.
+.sp
+Specify the name and path of the file used to record
+\fBntpd\fP's
+process ID.
+This is the same operation as the
+\fBpidfile\fP \fIpidfile\fP
+configuration file directive.
+.It Fl P Ar number , Fl \-priority Ns = Ns Ar number
+Process priority.
+This option takes an integer number as its argument.
+.sp
+To the extent permitted by the operating system, run
+\fBntpd\fP
+at the specified
+\fBsched_setscheduler(SCHED_FIFO)\fP
+priority.
+.It Fl q , Fl \-quit
+Set the time and quit.
+This option must not appear in combination with any of the following options:
+saveconfigquit, wait\-sync.
+.sp
+\fBntpd\fP
+will not daemonize and will exit after the clock is first
+synchronized. This behavior mimics that of the
+\fBntpdate\fP
+program, which will soon be replaced with a shell script.
+The
+\fB\-g\fP
+and
+\fB\-x\fP
+options can be used with this option.
+Note: The kernel time discipline is disabled with this option.
+.It Fl r Ar string , Fl \-propagationdelay Ns = Ns Ar string
+Broadcast/propagation delay.
+.sp
+Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+.It Fl \-saveconfigquit Ns = Ns Ar string
+Save parsed configuration and quit.
+This option must not appear in combination with any of the following options:
+quit, wait\-sync.
+.sp
+Cause \fBntpd\fP to parse its startup configuration file and save an
+equivalent to the given filename and exit. This option was
+designed for automated testing.
+.It Fl s Ar string , Fl \-statsdir Ns = Ns Ar string
+Statistics file location.
+.sp
+Specify the directory path for files created by the statistics facility.
+This is the same operation as the
+\fBstatsdir\fP \fIstatsdir\fP
+configuration file directive.
+.It Fl t Ar tkey , Fl \-trustedkey Ns = Ns Ar tkey
+Trusted key number.
+This option may appear an unlimited number of times.
+.sp
+Add the specified key number to the trusted key list.
+.It Fl u Ar string , Fl \-user Ns = Ns Ar string
+Run as userid (or userid:groupid).
+.sp
+Specify a user, and optionally a group, to switch to.
+This option is only available if the OS supports adjusting the clock
+without full root privileges.
+This option is supported under NetBSD (configure with
+\fB\-\-enable\-clockctl\fP) or Linux (configure with
+\fB\-\-enable\-linuxcaps\fP) or Solaris (configure with \fB\-\-enable\-solarisprivs\fP).
+.It Fl U Ar number , Fl \-updateinterval Ns = Ns Ar number
+interval in seconds between scans for new or dropped interfaces.
+This option takes an integer number as its argument.
+.sp
+Give the time in seconds between two scans for new or dropped interfaces.
+For systems with routing socket support the scans will be performed shortly after the interface change
+has been detected by the system.
+Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+.It Fl \-var Ns = Ns Ar nvar
+make ARG an ntp variable (RW).
+This option may appear an unlimited number of times.
+.sp
+.It Fl \-dvar Ns = Ns Ar ndvar
+make ARG an ntp variable (RW|DEF).
+This option may appear an unlimited number of times.
+.sp
+.It Fl w Ar number , Fl \-wait\-sync Ns = Ns Ar number
+Seconds to wait for first clock sync.
+This option must not appear in combination with any of the following options:
+nofork, quit, saveconfigquit.
+This option takes an integer number as its argument.
+.sp
+If greater than zero, alters \fBntpd\fP's behavior when forking to
+daemonize. Instead of exiting with status 0 immediately after
+the fork, the parent waits up to the specified number of
+seconds for the child to first synchronize the clock. The exit
+status is zero (success) if the clock was synchronized,
+otherwise it is \fBETIMEDOUT\fP.
+This provides the option for a script starting \fBntpd\fP to easily
+wait for the first set of the clock before proceeding.
+.It Fl x , Fl \-slew
+Slew up to 600 seconds.
+.sp
+Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+This option can be used with the
+\fB\-g\fP
+and
+\fB\-q\fP
+options.
+See the
+\fBtinker\fP
+configuration file directive for other options.
+Note: The kernel time discipline is disabled with this option.
+.It Fl \-usepcc
+Use CPU cycle counter (Windows only).
+.sp
+Attempt to substitute the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter and \fBQueryPerformanceCounter\fP are compared, and if
+they have the same frequency, the CPU counter (RDTSC on x86) is
+used directly, saving the overhead of a system call.
+.It Fl \-pccfreq Ns = Ns Ar string
+Force CPU cycle counter use (Windows only).
+.sp
+Force substitution the CPU counter for \fBQueryPerformanceCounter\fP.
+The CPU counter (RDTSC on x86) is used unconditionally with the
+given frequency (in Hz).
+.It Fl m , Fl \-mdns
+Register with mDNS as a NTP server.
+.sp
+Registers as an NTP server with the local mDNS server which allows
+the server to be discovered via mDNS client lookup.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from environment variables named:
+.nf
+ \fBNTPD_<option\-name>\fP or \fBNTPD\fP
+.fi
+.ad
+.Sh USAGE
+.Ss "How NTP Operates"
+The
+.Nm
+utility operates by exchanging messages with
+one or more configured servers over a range of designated poll intervals.
+When
+started, whether for the first or subsequent times, the program
+requires several exchanges from the majority of these servers so
+the signal processing and mitigation algorithms can accumulate and
+groom the data and set the clock.
+In order to protect the network
+from bursts, the initial poll interval for each server is delayed
+an interval randomized over a few seconds.
+At the default initial poll
+interval of 64s, several minutes can elapse before the clock is
+set.
+This initial delay to set the clock
+can be safely and dramatically reduced using the
+.Cm iburst
+keyword with the
+.Ic server
+configuration
+command, as described in
+.Xr ntp.conf 5 .
+.Pp
+Most operating systems and hardware of today incorporate a
+time\-of\-year (TOY) chip to maintain the time during periods when
+the power is off.
+When the machine is booted, the chip is used to
+initialize the operating system time.
+After the machine has
+synchronized to a NTP server, the operating system corrects the
+chip from time to time.
+In the default case, if
+.Nm
+detects that the time on the host
+is more than 1000s from the server time,
+.Nm
+assumes something must be terribly wrong and the only
+reliable action is for the operator to intervene and set the clock
+by hand.
+(Reasons for this include there is no TOY chip,
+or its battery is dead, or that the TOY chip is just of poor quality.)
+This causes
+.Nm
+to exit with a panic message to
+the system log.
+The
+.Fl g
+option overrides this check and the
+clock will be set to the server time regardless of the chip time
+(up to 68 years in the past or future \(em
+this is a limitation of the NTPv4 protocol).
+However, and to protect against broken hardware, such as when the
+CMOS battery fails or the clock counter becomes defective, once the
+clock has been set an error greater than 1000s will cause
+.Nm
+to exit anyway.
+.Pp
+Under ordinary conditions,
+.Nm
+adjusts the clock in
+small steps so that the timescale is effectively continuous and
+without discontinuities.
+Under conditions of extreme network
+congestion, the roundtrip delay jitter can exceed three seconds and
+the synchronization distance, which is equal to one\-half the
+roundtrip delay plus error budget terms, can become very large.
+The
+.Nm
+algorithms discard sample offsets exceeding 128 ms,
+unless the interval during which no sample offset is less than 128
+ms exceeds 900s.
+The first sample after that, no matter what the
+offset, steps the clock to the indicated time.
+In practice this
+reduces the false alarm rate where the clock is stepped in error to
+a vanishingly low incidence.
+.Pp
+As the result of this behavior, once the clock has been set it
+very rarely strays more than 128 ms even under extreme cases of
+network path congestion and jitter.
+Sometimes, in particular when
+.Nm
+is first started without a valid drift file
+on a system with a large intrinsic drift
+the error might grow to exceed 128 ms,
+which would cause the clock to be set backwards
+if the local clock time is more than 128 s
+in the future relative to the server.
+In some applications, this behavior may be unacceptable.
+There are several solutions, however.
+If the
+.Fl x
+option is included on the command line, the clock will
+never be stepped and only slew corrections will be used.
+But this choice comes with a cost that
+should be carefully explored before deciding to use
+the
+.Fl x
+option.
+The maximum slew rate possible is limited
+to 500 parts\-per\-million (PPM) as a consequence of the correctness
+principles on which the NTP protocol and algorithm design are
+based.
+As a result, the local clock can take a long time to
+converge to an acceptable offset, about 2,000 s for each second the
+clock is outside the acceptable range.
+During this interval the
+local clock will not be consistent with any other network clock and
+the system cannot be used for distributed applications that require
+correctly synchronized network time.
+.Pp
+In spite of the above precautions, sometimes when large
+frequency errors are present the resulting time offsets stray
+outside the 128\-ms range and an eventual step or slew time
+correction is required.
+If following such a correction the
+frequency error is so large that the first sample is outside the
+acceptable range,
+.Nm
+enters the same state as when the
+.Pa ntp.drift
+file is not present.
+The intent of this behavior
+is to quickly correct the frequency and restore operation to the
+normal tracking mode.
+In the most extreme cases
+(the host
+.Cm time.ien.it
+comes to mind), there may be occasional
+step/slew corrections and subsequent frequency corrections.
+It
+helps in these cases to use the
+.Cm burst
+keyword when
+configuring the server, but
+ONLY
+when you have permission to do so from the owner of the target host.
+.Pp
+Finally,
+in the past many startup scripts would run
+.Xr ntpdate @NTPDATE_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.
+If you are following the instructions in
+.Sx "Starting NTP (Best Current Practice)"
+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@ .
+.Pp
+There is a way to start
+.Xr ntpd @NTPD_MS@
+that often addresses all of the problems mentioned above.
+.Ss "Starting NTP (Best Current Practice)"
+First, use the
+.Cm iburst
+option on your
+.Cm server
+entries.
+.Pp
+If you can also keep a good
+.Pa ntp.drift
+file then
+.Xr ntpd @NTPD_MS@
+will effectively "warm\-start" and your system's clock will
+be stable in under 11 seconds' time.
+.Pp
+As soon as possible in the startup sequence, start
+.Xr ntpd @NTPD_MS@
+with at least the
+.Fl g
+and perhaps the
+.Fl N
+options.
+Then,
+start the rest of your "normal" processes.
+This will give
+.Xr ntpd @NTPD_MS@
+as much time as possible to get the system's clock synchronized and stable.
+.Pp
+Finally,
+if you have processes like
+.Cm dovecot
+or database servers
+that require
+monotonically\-increasing time,
+run
+.Xr ntp\-wait 1ntp\-waitmdoc
+as late as possible in the boot sequence
+(perhaps with the
+.Fl v
+flag)
+and after
+.Xr ntp\-wait 1ntp\-waitmdoc
+exits successfully
+it is as safe as it will ever be to start any process that require
+stable time.
+.Ss "Frequency Discipline"
+The
+.Nm
+behavior at startup depends on whether the
+frequency file, usually
+.Pa ntp.drift ,
+exists.
+This file
+contains the latest estimate of clock frequency error.
+When the
+.Nm
+is started and the file does not exist, the
+.Nm
+enters a special mode designed to quickly adapt to
+the particular system clock oscillator time and frequency error.
+This takes approximately 15 minutes, after which the time and
+frequency are set to nominal values and the
+.Nm
+enters
+normal mode, where the time and frequency are continuously tracked
+relative to the server.
+After one hour the frequency file is
+created and the current frequency offset written to it.
+When the
+.Nm
+is started and the file does exist, the
+.Nm
+frequency is initialized from the file and enters normal mode
+immediately.
+After that the current frequency offset is written to
+the file at hourly intervals.
+.Ss "Operating Modes"
+The
+.Nm
+utility can operate in any of several modes, including
+symmetric active/passive, client/server broadcast/multicast and
+manycast, as described in the
+.Qq Association Management
+page
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp ) .
+It normally operates continuously while
+monitoring for small changes in frequency and trimming the clock
+for the ultimate precision.
+However, it can operate in a one\-time
+mode where the time is set from an external server and frequency is
+set from a previously recorded frequency file.
+A
+broadcast/multicast or manycast client can discover remote servers,
+compute server\-client propagation delay correction factors and
+configure itself automatically.
+This makes it possible to deploy a
+fleet of workstations without specifying configuration details
+specific to the local environment.
+.Pp
+By default,
+.Nm
+runs in continuous mode where each of
+possibly several external servers is polled at intervals determined
+by an intricate state machine.
+The state machine measures the
+incidental roundtrip delay jitter and oscillator frequency wander
+and determines the best poll interval using a heuristic algorithm.
+Ordinarily, and in most operating environments, the state machine
+will start with 64s intervals and eventually increase in steps to
+1024s.
+A small amount of random variation is introduced in order to
+avoid bunching at the servers.
+In addition, should a server become
+unreachable for some time, the poll interval is increased in steps
+to 1024s in order to reduce network overhead.
+.Pp
+In some cases it may not be practical for
+.Nm
+to run continuously.
+A common workaround has been to run the
+.Xr ntpdate @NTPDATE_MS@
+or
+.Xr sntp @SNTP_MS@
+programs from a
+.Xr cron 8
+job at designated
+times.
+However, these programs do not have the crafted signal
+processing, error checking or mitigation algorithms of
+.Nm .
+The
+.Fl q
+option is intended for this purpose.
+Setting this option will cause
+.Nm
+to exit just after
+setting the clock for the first time.
+The procedure for initially
+setting the clock is the same as in continuous mode; most
+applications will probably want to specify the
+.Cm iburst
+keyword with the
+.Ic server
+configuration command.
+With this
+keyword a volley of messages are exchanged to groom the data and
+the clock is set in about 10 s.
+If nothing is heard after a
+couple of minutes, the daemon times out and exits.
+After a suitable
+period of mourning, the
+.Xr ntpdate @NTPDATE_MS@
+program will be
+retired.
+.Pp
+When kernel support is available to discipline the clock
+frequency, which is the case for stock Solaris, Tru64, Linux and
+.Fx ,
+a useful feature is available to discipline the clock
+frequency.
+First,
+.Nm
+is run in continuous mode with
+selected servers in order to measure and record the intrinsic clock
+frequency offset in the frequency file.
+It may take some hours for
+the frequency and offset to settle down.
+Then the
+.Nm
+is
+stopped and run in one\-time mode as required.
+At each startup, the
+frequency is read from the file and initializes the kernel
+frequency.
+.Ss "Poll Interval Control"
+This version of NTP includes an intricate state machine to
+reduce the network load while maintaining a quality of
+synchronization consistent with the observed jitter and wander.
+There are a number of ways to tailor the operation in order enhance
+accuracy by reducing the interval or to reduce network overhead by
+increasing it.
+However, the user is advised to carefully consider
+the consequences of changing the poll adjustment range from the
+default minimum of 64 s to the default maximum of 1,024 s.
+The
+default minimum can be changed with the
+.Ic tinker
+.Cm minpoll
+command to a value not less than 16 s.
+This value is used for all
+configured associations, unless overridden by the
+.Cm minpoll
+option on the configuration command.
+Note that most device drivers
+will not operate properly if the poll interval is less than 64 s
+and that the broadcast server and manycast client associations will
+also use the default, unless overridden.
+.Pp
+In some cases involving dial up or toll services, it may be
+useful to increase the minimum interval to a few tens of minutes
+and maximum interval to a day or so.
+Under normal operation
+conditions, once the clock discipline loop has stabilized the
+interval will be increased in steps from the minimum to the
+maximum.
+However, this assumes the intrinsic clock frequency error
+is small enough for the discipline loop correct it.
+The capture
+range of the loop is 500 PPM at an interval of 64s decreasing by a
+factor of two for each doubling of interval.
+At a minimum of 1,024
+s, for example, the capture range is only 31 PPM.
+If the intrinsic
+error is greater than this, the drift file
+.Pa ntp.drift
+will
+have to be specially tailored to reduce the residual error below
+this limit.
+Once this is done, the drift file is automatically
+updated once per hour and is available to initialize the frequency
+on subsequent daemon restarts.
+.Ss "The huff\-n'\-puff Filter"
+In scenarios where a considerable amount of data are to be
+downloaded or uploaded over telephone modems, timekeeping quality
+can be seriously degraded.
+This occurs because the differential
+delays on the two directions of transmission can be quite large.
+In
+many cases the apparent time errors are so large as to exceed the
+step threshold and a step correction can occur during and after the
+data transfer is in progress.
+.Pp
+The huff\-n'\-puff filter is designed to correct the apparent time
+offset in these cases.
+It depends on knowledge of the propagation
+delay when no other traffic is present.
+In common scenarios this
+occurs during other than work hours.
+The filter maintains a shift
+register that remembers the minimum delay over the most recent
+interval measured usually in hours.
+Under conditions of severe
+delay, the filter corrects the apparent offset using the sign of
+the offset and the difference between the apparent delay and
+minimum delay.
+The name of the filter reflects the negative (huff)
+and positive (puff) correction, which depends on the sign of the
+offset.
+.Pp
+The filter is activated by the
+.Ic tinker
+command and
+.Cm huffpuff
+keyword, as described in
+.Xr ntp.conf 5 .
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh FILES
+.Bl -tag -width /etc/ntp.drift -compact
+.It Pa /etc/ntp.conf
+the default name of the configuration file
+.It Pa /etc/ntp.drift
+the default name of the drift file
+.It Pa /etc/ntp.keys
+the default name of the key file
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntp.conf 5 ,
+.Xr ntpdate @NTPDATE_MS@ ,
+.Xr ntpdc @NTPDC_MS@ ,
+.Xr ntpq @NTPQ_MS@ ,
+.Xr sntp @SNTP_MS@
+.Pp
+In addition to the manual pages provided,
+comprehensive documentation is available on the world wide web
+at
+.Li http://www.ntp.org/ .
+A snapshot of this documentation is available in HTML format in
+.Pa /usr/share/doc/ntp .
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 1)
+.%O RFC1059
+.Re
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 2)
+.%O RFC1119
+.Re
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 3)
+.%O RFC1305
+.Re
+.Rs
+.%A David L. Mills
+.%A J. Martin, Ed.
+.%A J. Burbank
+.%A W. Kasch
+.%T Network Time Protocol Version 4: Protocol and Algorithms Specification
+.%O RFC5905
+.Re
+.Rs
+.%A David L. Mills
+.%A B. Haberman, Ed.
+.%T Network Time Protocol Version 4: Autokey Specification
+.%O RFC5906
+.Re
+.Rs
+.%A H. Gerstung
+.%A C. Elliott
+.%A B. Haberman, Ed.
+.%T Definitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)
+.%O RFC5907
+.Re
+.Rs
+.%A R. Gayraud
+.%A B. Lourdelet
+.%T Network Time Protocol (NTP) Server Option for DHCPv6
+.%O RFC5908
+.Re
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+The
+.Nm
+utility has gotten rather fat.
+While not huge, it has gotten
+larger than might be desirable for an elevated\-priority
+.Nm
+running on a workstation, particularly since many of
+the fancy features which consume the space were designed more with
+a busy primary server, rather than a high stratum workstation in
+mind.
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+Portions of this document came from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntpd\fP
+option definitions.
diff --git a/ntpd/ntpd.texi b/ntpd/ntpd.texi
new file mode 100644
index 0000000..0ac091b
--- /dev/null
+++ b/ntpd/ntpd.texi
@@ -0,0 +1,113 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntpd.info
+@settitle ntpd: Network Time Protocol (NTP) Daemon User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of the NTP Project's ntpd, a program for
+controlling ntpd.
+@end ifinfo
+
+@direntry
+* ntpd: (ntpd). NTP Daemon program
+@end direntry
+
+@titlepage
+@title ntpd: Network Time Protocol (NTP) Daemon User's Manual
+@subtitle ntpd, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntpd Description, (dir), (dir)
+@top ntpd: Network Time Protocol (NTP) Daemon User Manual
+
+The @code{ntpd} program is an operating system daemon that synchronizes the
+system clock to remote NTP time servers or local reference clocks.
+It is a complete implementation of NTP version 4 defined by RFC-5905, but
+also retains compatible with version 3 defined by RFC-1305 and versions
+1 and 2, defined by RFC-1059 and RFC-1119, respectively.
+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.
+
+This document applies to version @value{VERSION} of @code{ntpd}.
+
+@shortcontents
+
+@menu
+* ntpd Description:: Description
+* ntpd Invocation:: Invoking ntpd
+* Usage:: Usage
+@end menu
+
+@node ntpd Description
+@comment node-name, next, previous, up
+@section Description
+
+The @code{ntpd} program ordinarily requires
+a configuration file described at @ref{ntp.conf}.
+This configuration file contains configuration commands described on
+the pages listed above.
+However a client can discover remote servers and configure them
+automatically.
+This makes it possible to deploy a fleet of workstations without
+specifying configuration details specific to the local environment.
+
+The @code{ntpd} program normally operates continuously while adjusting the
+system time and frequency, but in some cases this might not be
+practical.
+With the @code{-q} option @code{ntpd} operates as in continuous mode, but
+exits just after setting the clock for the first time.
+Most applications will probably want to specify the @code{iburst}
+option with the @code{server} command.
+With this option an initial volley of messages is exchanged to
+groom the data and set the clock in about ten seconds' time.
+If nothing is heard after a few minutes' time,
+the daemon times out and exits without setting the clock.
+
+@include invoke-ntpd.texi
+
+@node Usage
+@comment node-name, next, previous, up
+@section Usage
+
+@multitable @columnfractions .23 .23 .05 .15
+@headitem What @tab Default @tab Flag @tab Option
+@item configuration file
+@tab @code{/etc/ntp.conf}
+@tab @code{-c}
+@tab @code{conffile}
+@item frequency file
+@tab none
+@tab @code{-f}
+@tab @code{driftfile}
+@item leapseconds file
+@tab none
+@tab
+@tab @code{leapfile}
+@item process ID file
+@tab none
+@tab @code{-p}
+@tab @code{pidfile}
+@item log file
+@tab system log
+@tab @code{-l}
+@tab @code{logfile}
+@item include file
+@tab none
+@tab none
+@tab @code{includefile}
+@item statistics path
+@tab @code{/var/NTP}
+@tab @code{-s}
+@tab @code{statsdir}
+@item keys path
+@tab @code{/usr/local/etc}
+@tab @code{-k}
+@tab @code{keysdir}
diff --git a/ntpd/ntpdbase-opts.def b/ntpd/ntpdbase-opts.def
new file mode 100644
index 0000000..110504e
--- /dev/null
+++ b/ntpd/ntpdbase-opts.def
@@ -0,0 +1,463 @@
+#include autogen-version.def
+
+include = <<- _EOF_
+ #ifdef __windows
+ extern int atoi(const char *);
+ #else
+ # include <stdlib.h>
+ #endif
+ _EOF_;
+
+flag = {
+ name = ipv4;
+ value = 4;
+ flags-cant = ipv6;
+ descrip = "Force IPv4 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv4 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = ipv6;
+ value = 6;
+ flags-cant = ipv4;
+ descrip = "Force IPv6 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv6 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = authreq;
+ value = a;
+ descrip = "Require crypto authentication";
+ flags-cant = authnoreq;
+ doc = <<- _EndOfDoc_
+ Require cryptographic authentication for broadcast client,
+ multicast client and symmetric passive associations.
+ This is the default.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = authnoreq;
+ value = A;
+ descrip = "Do not require crypto authentication";
+ flags-cant = authreq;
+ doc = <<- _EndOfDoc_
+ Do not require cryptographic authentication for broadcast client,
+ multicast client and symmetric passive associations.
+ This is almost never a good idea.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = bcastsync;
+ value = b;
+ descrip = "Allow us to sync to broadcast servers";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = configfile;
+ value = c;
+ arg-type = string;
+ descrip = "configuration file name";
+ doc = <<- _EndOfDoc_
+ The name and path of the configuration file,
+ @file{/etc/ntp.conf}
+ by default.
+ _EndOfDoc_;
+};
+
+#include debug-opt.def
+
+flag = {
+ name = driftfile;
+ value = f;
+ arg-type = string;
+ descrip = "frequency drift file name";
+ doc = <<- _EndOfDoc_
+ The name and path of the frequency file,
+ @file{/etc/ntp.drift}
+ by default.
+ This is the same operation as the
+ @code{driftfile} @kbd{driftfile}
+ configuration specification in the
+ @file{/etc/ntp.conf}
+ file.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = panicgate;
+ value = g;
+ max = NOLIMIT;
+ descrip = "Allow the first adjustment to be Big";
+ doc = <<- _EndOfDoc_
+ Normally,
+ @code{ntpd}
+ exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
+ @code{ntpd}
+ will exit with a message to the system log. This option can be used with the
+ @code{-q}
+ and
+ @code{-x}
+ options.
+ See the
+ @code{tinker}
+ configuration file directive for other options.
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = HAVE_DROPROOT;
+ name = jaildir;
+ value = i;
+ arg-type = string;
+ descrip = "Jail directory";
+ omitted-usage = "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs";
+ doc = <<- _EndOfDoc_
+ Chroot the server to the directory
+ @kbd{jaildir}
+ .
+ This option also implies that the server attempts to drop root privileges at startup.
+ You may need to also specify a
+ @code{-u}
+ option.
+ This option is only available if the OS supports adjusting the clock
+ without full root privileges.
+ This option is supported under NetBSD (configure with
+ @code{--enable-clockctl}) or Linux (configure with
+ @code{--enable-linuxcaps}) or Solaris (configure with @code{--enable-solarisprivs}).
+ _EndOfDoc_;
+};
+
+flag = {
+ name = interface;
+ value = I;
+ arg-type = string;
+ descrip = "Listen on an interface name or address";
+ max = NOLIMIT;
+ arg-name = iface;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ Open the network address given, or all the addresses associated with the
+ given interface name. This option may appear multiple times. This option
+ also implies not opening other addresses, except wildcard and localhost.
+ This option is deprecated. Please consider using the configuration file
+ @code{interface} command, which is more versatile.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = keyfile;
+ value = k;
+ arg-type = string;
+ descrip = "path to symmetric keys";
+ doc = <<- _EndOfDoc_
+ Specify the name and path of the symmetric key file.
+ @file{/etc/ntp.keys}
+ is the default.
+ This is the same operation as the
+ @code{keys} @kbd{keyfile}
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = logfile;
+ value = l;
+ arg-type = string;
+ descrip = "path to the log file";
+ doc = <<- _EndOfDoc_
+ Specify the name and path of the log file.
+ The default is the system log file.
+ This is the same operation as the
+ @code{logfile} @kbd{logfile}
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = novirtualips;
+ value = L;
+ descrip = "Do not listen to virtual interfaces";
+ doc = <<- _EndOfDoc_
+ Do not listen to virtual interfaces, defined as those with
+ names containing a colon. This option is deprecated. Please
+ consider using the configuration file @code{interface} command, which
+ is more versatile.
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = SYS_WINNT;
+ name = modifymmtimer;
+ value = M;
+ descrip = "Modify Multimedia Timer (Windows only)";
+ doc = <<- _EndOfDoc_
+ Set the Windows Multimedia Timer to highest resolution. This
+ ensures the resolution does not change while ntpd is running,
+ avoiding timekeeping glitches associated with changes.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = nofork;
+ value = n;
+ flags-cant = wait-sync;
+ descrip = "Do not fork";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = nice;
+ value = N;
+ descrip = "Run at high priority";
+ doc = <<- _EndOfDoc_
+ To the extent permitted by the operating system, run
+ @code{ntpd}
+ at the highest priority.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = pidfile;
+ value = p;
+ arg-type = string;
+ descrip = "path to the PID file";
+ doc = <<- _EndOfDoc_
+ Specify the name and path of the file used to record
+ @code{ntpd}'s
+ process ID.
+ This is the same operation as the
+ @code{pidfile} @kbd{pidfile}
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = priority;
+ value = P;
+ arg-type = number;
+ descrip = "Process priority";
+ doc = <<- _EndOfDoc_
+ To the extent permitted by the operating system, run
+ @code{ntpd}
+ at the specified
+ @code{sched_setscheduler(SCHED_FIFO)}
+ priority.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = quit;
+ value = q;
+ flags-cant = saveconfigquit;
+ flags-cant = wait-sync;
+ descrip = "Set the time and quit";
+ doc = <<- _EndOfDoc_
+ @code{ntpd}
+ will not daemonize and will exit after the clock is first
+ synchronized. This behavior mimics that of the
+ @code{ntpdate}
+ program, which will soon be replaced with a shell script.
+ The
+ @code{-g}
+ and
+ @code{-x}
+ options can be used with this option.
+ Note: The kernel time discipline is disabled with this option.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = propagationdelay;
+ value = r;
+ arg-type = string;
+ descrip = "Broadcast/propagation delay";
+ doc = <<- _EndOfDoc_
+ Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = SAVECONFIG;
+ name = saveconfigquit;
+ arg-type = string;
+ flags-cant = quit;
+ flags-cant = wait-sync;
+ descrip = "Save parsed configuration and quit";
+ doc = <<- _EndOfDoc_
+ Cause @code{ntpd} to parse its startup configuration file and save an
+ equivalent to the given filename and exit. This option was
+ designed for automated testing.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = statsdir;
+ value = s;
+ arg-type = string;
+ descrip = "Statistics file location";
+ doc = <<- _EndOfDoc_
+ Specify the directory path for files created by the statistics facility.
+ This is the same operation as the
+ @code{statsdir} @kbd{statsdir}
+ configuration file directive.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = trustedkey;
+ value = t;
+ arg-type = string;
+ descrip = "Trusted key number";
+ max = NOLIMIT;
+ arg-name = tkey;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ Add the specified key number to the trusted key list.
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = HAVE_DROPROOT;
+ name = user;
+ value = u;
+ arg-type = string;
+ descrip = "Run as userid (or userid:groupid)";
+ omitted-usage = "built without --enable-clockctl or --enable-linuxcaps or --enable-solarisprivs";
+ doc = <<- _EndOfDoc_
+ Specify a user, and optionally a group, to switch to.
+ This option is only available if the OS supports adjusting the clock
+ without full root privileges.
+ This option is supported under NetBSD (configure with
+ @code{--enable-clockctl}) or Linux (configure with
+ @code{--enable-linuxcaps}) or Solaris (configure with @code{--enable-solarisprivs}).
+ _EndOfDoc_;
+};
+
+flag = {
+ name = updateinterval;
+ value = U;
+ arg-type = number;
+ descrip = "interval in seconds between scans for new or dropped interfaces";
+ doc = <<- _EndOfDoc_
+ Give the time in seconds between two scans for new or dropped interfaces.
+ For systems with routing socket support the scans will be performed shortly after the interface change
+ has been detected by the system.
+ Use 0 to disable scanning. 60 seconds is the minimum time between scans.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = var;
+/* value = v; Bug 817 */
+ arg-type = string;
+ descrip = "make ARG an ntp variable (RW)";
+ max = NOLIMIT;
+ arg-name = nvar;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = dvar;
+/* value = V; Bug 817 */
+ arg-type = string;
+ descrip = "make ARG an ntp variable (RW|DEF)";
+ max = NOLIMIT;
+ arg-name = ndvar;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = HAVE_WORKING_FORK;
+ name = wait-sync;
+ value = w;
+ arg-type = number;
+ flags-cant = nofork;
+ flags-cant = quit;
+ flags-cant = saveconfigquit;
+ descrip = "Seconds to wait for first clock sync";
+ doc = <<- _EndOfDoc_
+ If greater than zero, alters @code{ntpd}'s behavior when forking to
+ daemonize. Instead of exiting with status 0 immediately after
+ the fork, the parent waits up to the specified number of
+ seconds for the child to first synchronize the clock. The exit
+ status is zero (success) if the clock was synchronized,
+ otherwise it is @code{ETIMEDOUT}.
+ This provides the option for a script starting @code{ntpd} to easily
+ wait for the first set of the clock before proceeding.
+ _EndOfDoc_;
+/*
+** XXX: is it "first set" or is it more? If it's only "first set" then
+** that's not the same as SYNC.
+*/
+};
+
+flag = {
+ name = slew;
+ value = x;
+ descrip = "Slew up to 600 seconds";
+ doc = <<- _EndOfDoc_
+ Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
+ This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
+ Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
+ Thus, an adjustment as much as 600 s will take almost 14 days to complete.
+ This option can be used with the
+ @code{-g}
+ and
+ @code{-q}
+ options.
+ See the
+ @code{tinker}
+ configuration file directive for other options.
+ Note: The kernel time discipline is disabled with this option.
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = SYS_WINNT;
+ name = usepcc;
+ descrip = "Use CPU cycle counter (Windows only)";
+ doc = <<- _EndOfDoc_
+ Attempt to substitute the CPU counter for @code{QueryPerformanceCounter}.
+ The CPU counter and @code{QueryPerformanceCounter} are compared, and if
+ they have the same frequency, the CPU counter (RDTSC on x86) is
+ used directly, saving the overhead of a system call.
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = SYS_WINNT;
+ name = pccfreq;
+ arg-type = string;
+ descrip = "Force CPU cycle counter use (Windows only)";
+ doc = <<- _EndOfDoc_
+ Force substitution the CPU counter for @code{QueryPerformanceCounter}.
+ The CPU counter (RDTSC on x86) is used unconditionally with the
+ given frequency (in Hz).
+ _EndOfDoc_;
+};
+
+flag = {
+ ifdef = HAVE_DNSREGISTRATION;
+ name = mdns;
+ value = m;
+ descrip = "Register with mDNS as a NTP server";
+ doc = <<- _EndOfDoc_
+ Registers as an NTP server with the local mDNS server which allows
+ the server to be discovered via mDNS client lookup.
+ _EndOfDoc_;
+};
diff --git a/ntpd/ntpsim.c b/ntpd/ntpsim.c
new file mode 100644
index 0000000..b7c3218
--- /dev/null
+++ b/ntpd/ntpsim.c
@@ -0,0 +1,657 @@
+/* ntpdsim.c
+ *
+ * The source code for the ntp discrete event simulator.
+ *
+ * Written By: Sachin Kamboj
+ * University of Delaware
+ * Newark, DE 19711
+ * Copyright (c) 2006
+ * (Some code shamelessly based on the original NTP discrete event simulator)
+ */
+
+#include <config.h>
+#ifdef SIM
+#include "ntpd.h"
+#include "ntp_config.h"
+
+/* forward prototypes */
+int determine_event_ordering(const Event *e1, const Event *e2);
+int determine_recv_buf_ordering(const struct recvbuf *b1,
+ const struct recvbuf *b2);
+void create_server_associations(void);
+void init_sim_io(void);
+
+/* Global Variable Definitions */
+sim_info simulation; /* Simulation Control Variables */
+local_clock_info simclock; /* Local Clock Variables */
+queue *event_queue; /* Event Queue */
+queue *recv_queue; /* Receive Queue */
+static double sys_residual = 0; /* adjustment residue (s) */
+
+void (*event_ptr[]) (Event *) = {
+ sim_event_beep, sim_update_clocks, sim_event_timer, sim_event_recv_packet
+}; /* Function pointer to the events */
+
+
+/*
+ * Define a function to compare two events to determine which one occurs
+ * first.
+ */
+int
+determine_event_ordering(
+ const Event *e1,
+ const Event *e2
+ )
+{
+ return (e1->time - e2->time);
+}
+
+
+/*
+ * Define a function to compare two received packets to determine which
+ * one is received first.
+ */
+int
+determine_recv_buf_ordering(
+ const struct recvbuf *b1,
+ const struct recvbuf *b2
+ )
+{
+ double recv_time1;
+ double recv_time2;
+
+ /* Simply convert the time received to double and subtract */
+ LFPTOD(&b1->recv_time, recv_time1);
+ LFPTOD(&b2->recv_time, recv_time2);
+
+ return (int)(recv_time1 - recv_time2);
+}
+
+
+/* Define a function to create the server associations */
+void create_server_associations(void)
+{
+ int i;
+
+ for (i = 0; i < simulation.num_of_servers; ++i) {
+ printf("%s\n", stoa(simulation.servers[i].addr));
+ if (peer_config(simulation.servers[i].addr,
+ NULL,
+ loopback_interface,
+ MODE_CLIENT,
+ NTP_VERSION,
+ NTP_MINDPOLL,
+ NTP_MAXDPOLL,
+ 0, /* peerflags */
+ 0, /* ttl */
+ 0, /* peerkey */
+ NULL /* group ident */) == 0) {
+ fprintf(stderr,
+ "ERROR!! Could not create association for: %s\n",
+ stoa(simulation.servers[i].addr));
+ }
+ }
+}
+
+
+/* Main Simulator Code */
+
+int
+ntpsim(
+ int argc,
+ char * argv[]
+ )
+{
+ Event * curr_event;
+ struct timeval seed;
+
+ /* Initialize the local Clock */
+ simclock.local_time = 0;
+ simclock.adj = 0;
+ simclock.slew = 500e-6;
+
+ /* Initialize the simulation */
+ simulation.num_of_servers = 0;
+ simulation.beep_delay = BEEP_DLY;
+ simulation.sim_time = 0;
+ simulation.end_time = SIM_TIME;
+
+ /* Initialize ntp modules */
+ initializing = TRUE;
+ msyslog_term = TRUE;
+ init_sim_io();
+ init_auth();
+ init_util();
+ init_restrict();
+ init_mon();
+ init_timer();
+ init_lib();
+ init_request();
+ init_control();
+ init_peer();
+ init_proto();
+ init_loopfilter();
+ mon_start(MON_OFF);
+
+ /* Call getconfig to parse the configuration file */
+ getconfig(argc, argv);
+ loop_config(LOOP_DRIFTINIT, 0);
+ initializing = FALSE;
+
+ /*
+ * Watch out here, we want the real time, not the silly stuff.
+ */
+ gettimeofday(&seed, NULL);
+ ntp_srandom(seed.tv_usec);
+
+ /* Initialize the event queue */
+ event_queue = create_priority_queue((q_order_func)
+ determine_event_ordering);
+
+ /* Initialize the receive queue */
+ recv_queue = create_priority_queue((q_order_func)
+ determine_recv_buf_ordering);
+
+ /* Push a beep and a timer on the event queue */
+ enqueue(event_queue, event(0, BEEP));
+ enqueue(event_queue, event(simulation.sim_time + 1.0, TIMER));
+
+ /*
+ * Pop the queue until nothing is left or time is exceeded
+ */
+ /* maxtime = simulation.sim_time + simulation.end_time;*/
+ while (simulation.sim_time <= simulation.end_time &&
+ (!empty(event_queue))) {
+ curr_event = dequeue(event_queue);
+ /* Update all the clocks to the time on the event */
+ sim_update_clocks(curr_event);
+
+ /* Execute the function associated with the event */
+ (*event_ptr[curr_event->function])(curr_event);
+ free_node(curr_event);
+ }
+ printf("sys_received: %lu\n", sys_received);
+ printf("sys_badlength: %lu\n", sys_badlength);
+ printf("sys_declined: %lu\n", sys_declined);
+ printf("sys_restricted: %lu\n", sys_restricted);
+ printf("sys_newversion: %lu\n", sys_newversion);
+ printf("sys_oldversion: %lu\n", sys_oldversion);
+ printf("sys_limitrejected: %lu\n", sys_limitrejected);
+ printf("sys_badauth: %lu\n", sys_badauth);
+
+ return (0);
+}
+
+
+void
+init_sim_io(void)
+{
+ loopback_interface = emalloc_zero(sizeof(*loopback_interface));
+ ep_list = loopback_interface;
+ strlcpy(loopback_interface->name, "IPv4loop",
+ sizeof(loopback_interface->name));
+ loopback_interface->flags = INT_UP | INT_LOOPBACK;
+ loopback_interface->fd = -1;
+ loopback_interface->bfd = -1;
+ loopback_interface->ifnum = 1;
+ loopback_interface->family = AF_INET;
+ AF(&loopback_interface->sin) = AF_INET;
+ SET_ADDR4(&loopback_interface->sin, LOOPBACKADR);
+ SET_PORT(&loopback_interface->sin, NTP_PORT);
+ AF(&loopback_interface->mask) = AF_INET;
+ SET_ADDR4(&loopback_interface->mask, LOOPNETMASK);
+}
+
+
+/* Define a function to create an return an Event */
+
+Event *event(double t, funcTkn f)
+{
+ Event *e;
+
+ if ((e = get_node(sizeof(*e))) == NULL)
+ abortsim("get_node failed in event");
+ e->time = t;
+ e->function = f;
+ return (e);
+}
+
+/* NTP SIMULATION FUNCTIONS */
+
+/* Define a function for processing a timer interrupt.
+ * On every timer interrupt, call the NTP timer to send packets and process
+ * the clock and then call the receive function to receive packets.
+ */
+void sim_event_timer(Event *e)
+{
+ struct recvbuf *rbuf;
+
+ /* Call the NTP timer.
+ * This will be responsible for actually "sending the packets."
+ * Since this is a simulation, the packets sent over the network
+ * will be processed by the simulate_server routine below.
+ */
+ timer();
+
+ /* Process received buffers */
+ while (!empty(recv_queue)) {
+ rbuf = (struct recvbuf *)dequeue(recv_queue);
+ (*rbuf->receiver)(rbuf);
+ free_node(rbuf);
+ }
+
+ /* Arm the next timer interrupt. */
+ enqueue(event_queue,
+ event(simulation.sim_time + (1 << EVENT_TIMEOUT), TIMER));
+}
+
+
+
+/* Define a function to simulate a server.
+ * This function processes the sent packet according to the server script,
+ * creates a reply packet and pushes the reply packet onto the event queue
+ */
+int simulate_server(
+ sockaddr_u *serv_addr, /* Address of the server */
+ endpt * inter, /* Interface on which the reply should
+ be inserted */
+ struct pkt *rpkt /* Packet sent to the server that
+ needs to be processed. */
+ )
+{
+ struct pkt xpkt; /* Packet to be transmitted back
+ to the client */
+ struct recvbuf rbuf; /* Buffer for the received packet */
+ Event *e; /* Packet receive event */
+ server_info *server; /* Pointer to the server being simulated */
+ script_info *curr_script; /* Current script being processed */
+ int i;
+ double d1, d2, d3; /* Delays while the packet is enroute */
+ double t1, t2, t3, t4; /* The four timestamps in the packet */
+ l_fp lfp_host; /* host-order l_fp */
+
+ ZERO(xpkt);
+ ZERO(rbuf);
+
+ /* Search for the server with the desired address */
+ server = NULL;
+ for (i = 0; i < simulation.num_of_servers; ++i) {
+ if (memcmp(simulation.servers[i].addr, serv_addr,
+ sizeof(*serv_addr)) == 0) {
+ server = &simulation.servers[i];
+ break;
+ }
+ }
+
+ fprintf(stderr, "Received packet from %s on %s\n",
+ stoa(serv_addr), latoa(inter));
+ if (server == NULL)
+ abortsim("Server with specified address not found!!!");
+
+ /* Get the current script for the server */
+ curr_script = server->curr_script;
+
+ /* Create a server reply packet.
+ * Masquerade the reply as a stratum-1 server with a GPS clock
+ */
+ xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, NTP_VERSION,
+ MODE_SERVER);
+ xpkt.stratum = STRATUM_TO_PKT(((u_char)1));
+ memcpy(&xpkt.refid, "GPS", 4);
+ xpkt.ppoll = rpkt->ppoll;
+ xpkt.precision = rpkt->precision;
+ xpkt.rootdelay = 0;
+ xpkt.rootdisp = 0;
+
+ /* TIMESTAMP CALCULATIONS
+ t1 t4
+ \ /
+ d1 \ / d3
+ \ /
+ t2 ----------------- t3
+ d2
+ */
+ /* Compute the delays */
+ d1 = poisson(curr_script->prop_delay, curr_script->jitter);
+ d2 = poisson(curr_script->proc_delay, 0);
+ d3 = poisson(curr_script->prop_delay, curr_script->jitter);
+
+ /* Note: In the transmitted packet:
+ * 1. t1 and t4 are times in the client according to the local clock.
+ * 2. t2 and t3 are server times according to the simulated server.
+ * Compute t1, t2, t3 and t4
+ * Note: This function is called at time t1.
+ */
+
+ NTOHL_FP(&rpkt->xmt, &lfp_host);
+ LFPTOD(&lfp_host, t1);
+ t2 = server->server_time + d1;
+ t3 = server->server_time + d1 + d2;
+ t4 = t1 + d1 + d2 + d3;
+
+ /* Save the timestamps */
+ xpkt.org = rpkt->xmt;
+ DTOLFP(t2, &lfp_host);
+ HTONL_FP(&lfp_host, &xpkt.rec);
+ DTOLFP(t3, &lfp_host);
+ HTONL_FP(&lfp_host, &xpkt.xmt);
+ xpkt.reftime = xpkt.xmt;
+
+ /*
+ * Ok, we are done with the packet. Now initialize the receive
+ * buffer for the packet.
+ */
+ rbuf.used = 1;
+ rbuf.receiver = &receive; /* callback to process the packet */
+ rbuf.recv_length = LEN_PKT_NOMAC;
+ rbuf.recv_pkt = xpkt;
+ rbuf.dstadr = inter;
+ rbuf.fd = inter->fd;
+ memcpy(&rbuf.srcadr, serv_addr, sizeof(rbuf.srcadr));
+ memcpy(&rbuf.recv_srcadr, serv_addr, sizeof(rbuf.recv_srcadr));
+
+ /*
+ * Create a packet event and insert it onto the event_queue at the
+ * arrival time (t4) of the packet at the client
+ */
+ e = event(t4, PACKET);
+ e->rcv_buf = rbuf;
+ enqueue(event_queue, e);
+
+ /*
+ * Check if the time of the script has expired. If yes, delete it.
+ */
+ if (curr_script->duration > simulation.sim_time &&
+ NULL == HEAD_PFIFO(server->script)) {
+ printf("Hello\n");
+ /*
+ * For some reason freeing up the curr_script memory kills the
+ * simulation. Further debugging is needed to determine why.
+ * free(curr_script);
+ */
+ UNLINK_FIFO(curr_script, *server->script, link);
+ }
+
+ return (0);
+}
+
+
+/* Define a function to update all the clocks
+ * Most of the code is modified from the systime.c file by Prof. Mills
+ */
+
+void sim_update_clocks(Event *e)
+{
+ double time_gap;
+ double adj;
+ int i;
+
+ /* Compute the time between the last update event and this update */
+ time_gap = e->time - simulation.sim_time;
+
+ if (time_gap < 0)
+ printf("WARNING: e->time %.6g comes before sim_time %.6g (gap %+.6g)\n",
+ e->time, simulation.sim_time, time_gap);
+
+ /* Advance the client clock */
+ if (e->time + time_gap < simclock.local_time)
+ printf("WARNING: e->time + gap %.6g comes before local_time %.6g\n",
+ e->time + time_gap, simclock.local_time);
+ simclock.local_time = e->time + time_gap;
+
+ /* Advance the simulation time */
+ simulation.sim_time = e->time;
+
+ /* Advance the server clocks adjusted for systematic and random frequency
+ * errors. The random error is a random walk computed as the
+ * integral of samples from a Gaussian distribution.
+ */
+ for (i = 0; i < simulation.num_of_servers; ++i) {
+ simulation.servers[i].curr_script->freq_offset +=
+ gauss(0, time_gap * simulation.servers[i].curr_script->wander);
+
+ simulation.servers[i].server_time += time_gap *
+ (1 + simulation.servers[i].curr_script->freq_offset);
+ }
+
+ /* Perform the adjtime() function. If the adjustment completed
+ * in the previous interval, amortize the entire amount; if not,
+ * carry the leftover to the next interval.
+ */
+
+ adj = time_gap * simclock.slew;
+ if (adj < fabs(simclock.adj)) {
+ if (simclock.adj < 0) {
+ simclock.adj += adj;
+ simclock.local_time -= adj;
+ } else {
+ simclock.adj -= adj;
+ simclock.local_time += adj;
+ }
+ } else {
+ simclock.local_time += simclock.adj;
+ simclock.adj = 0;
+ }
+}
+
+
+/* Define a function that processes a receive packet event.
+ * This function simply inserts the packet received onto the receive queue
+ */
+
+void sim_event_recv_packet(Event *e)
+{
+ struct recvbuf *rbuf;
+
+ /* Allocate a receive buffer and copy the packet to it */
+ if ((rbuf = get_node(sizeof(*rbuf))) == NULL)
+ abortsim("get_node failed in sim_event_recv_packet");
+ memcpy(rbuf, &e->rcv_buf, sizeof(*rbuf));
+
+ /* Store the local time in the received packet */
+ DTOLFP(simclock.local_time, &rbuf->recv_time);
+
+ /* Insert the packet received onto the receive queue */
+ enqueue(recv_queue, rbuf);
+}
+
+
+
+/* Define a function to output simulation statistics on a beep event
+ */
+
+/*** TODO: Need to decide on how to output for multiple servers ***/
+void sim_event_beep(Event *e)
+{
+#if 0
+ static int first_time = 1;
+ char *dash = "-----------------";
+#endif
+
+ fprintf(stderr, "BEEP!!!\n");
+ enqueue(event_queue, event(e->time + simulation.beep_delay, BEEP));
+#if 0
+ if(simulation.beep_delay > 0) {
+ if (first_time) {
+ printf("\t%4c T %4c\t%4c T+ERR %3c\t%5cT+ERR+NTP\n",
+ ' ', ' ', ' ', ' ',' ');
+ printf("\t%s\t%s\t%s\n", dash, dash, dash);
+ first_time = 0;
+
+ printf("\t%16.6f\t%16.6f\t%16.6f\n",
+ n->time, n->clk_time, n->ntp_time);
+ return;
+ }
+ printf("\t%16.6f\t%16.6f\t%16.6f\n",
+ simclock.local_time,
+ n->time, n->clk_time, n->ntp_time);
+#endif
+
+}
+
+
+/* Define a function to abort the simulation on an error and spit out an
+ * error message
+ */
+
+void abortsim(char *errmsg)
+{
+ perror(errmsg);
+ exit(1);
+}
+
+
+
+/* CODE ORIGINALLY IN libntp/systime.c
+ * -----------------------------------
+ * This code was a part of the original NTP simulator and originally
+ * had its home in the libntp/systime.c file.
+ *
+ * It has been shamelessly moved to here and has been modified for the
+ * purposes of the current simulator.
+ */
+
+
+/*
+ * get_systime - return the system time in NTP timestamp format
+ */
+void
+get_systime(
+ l_fp *now /* current system time in l_fp */ )
+{
+ /*
+ * To fool the code that determines the local clock precision,
+ * we advance the clock a minimum of 200 nanoseconds on every
+ * clock read. This is appropriate for a typical modern machine
+ * with nanosecond clocks. Note we make no attempt here to
+ * simulate reading error, since the error is so small. This may
+ * change when the need comes to implement picosecond clocks.
+ */
+ if (simclock.local_time == simclock.last_read_time)
+ simclock.local_time += 200e-9;
+
+ simclock.last_read_time = simclock.local_time;
+ DTOLFP(simclock.local_time, now);
+/* OLD Code
+ if (ntp_node.ntp_time == ntp_node.last_time)
+ ntp_node.ntp_time += 200e-9;
+ ntp_node.last_time = ntp_node.ntp_time;
+ DTOLFP(ntp_node.ntp_time, now);
+*/
+}
+
+
+/*
+ * adj_systime - advance or retard the system clock exactly like the
+ * real thng.
+ */
+int /* always succeeds */
+adj_systime(
+ double now /* time adjustment (s) */
+ )
+{
+ struct timeval adjtv; /* new adjustment */
+ double dtemp;
+ long ticks;
+ int isneg = 0;
+
+ /*
+ * Most Unix adjtime() implementations adjust the system clock
+ * in microsecond quanta, but some adjust in 10-ms quanta. We
+ * carefully round the adjustment to the nearest quantum, then
+ * adjust in quanta and keep the residue for later.
+ */
+ dtemp = now + sys_residual;
+ if (dtemp < 0) {
+ isneg = 1;
+ dtemp = -dtemp;
+ }
+ adjtv.tv_sec = (long)dtemp;
+ dtemp -= adjtv.tv_sec;
+ ticks = (long)(dtemp / sys_tick + .5);
+ adjtv.tv_usec = (long)(ticks * sys_tick * 1e6);
+ dtemp -= adjtv.tv_usec / 1e6;
+ sys_residual = dtemp;
+
+ /*
+ * Convert to signed seconds and microseconds for the Unix
+ * adjtime() system call. Note we purposely lose the adjtime()
+ * leftover.
+ */
+ if (isneg) {
+ adjtv.tv_sec = -adjtv.tv_sec;
+ adjtv.tv_usec = -adjtv.tv_usec;
+ sys_residual = -sys_residual;
+ }
+ simclock.adj = now;
+/* ntp_node.adj = now; */
+ return (1);
+}
+
+
+/*
+ * step_systime - step the system clock. We are religious here.
+ */
+int /* always succeeds */
+step_systime(
+ double now /* step adjustment (s) */
+ )
+{
+#ifdef DEBUG
+ if (debug)
+ printf("step_systime: time %.6f adj %.6f\n",
+ simclock.local_time, now);
+#endif
+ simclock.local_time += now;
+ return (1);
+}
+
+/*
+ * gauss() - returns samples from a gaussion distribution
+ */
+double /* Gaussian sample */
+gauss(
+ double m, /* sample mean */
+ double s /* sample standard deviation (sigma) */
+ )
+{
+ double q1, q2;
+
+ /*
+ * Roll a sample from a Gaussian distribution with mean m and
+ * standard deviation s. For m = 0, s = 1, mean(y) = 0,
+ * std(y) = 1.
+ */
+ if (s == 0)
+ return (m);
+ while ((q1 = drand48()) == 0)
+ /* empty statement */;
+ q2 = drand48();
+ return (m + s * sqrt(-2. * log(q1)) * cos(2. * PI * q2));
+}
+
+
+/*
+ * poisson() - returns samples from a network delay distribution
+ */
+double /* delay sample (s) */
+poisson(
+ double m, /* fixed propagation delay (s) */
+ double s /* exponential parameter (mu) */
+ )
+{
+ double q1;
+
+ /*
+ * Roll a sample from a composite distribution with propagation
+ * delay m and exponential distribution time with parameter s.
+ * For m = 0, s = 1, mean(y) = std(y) = 1.
+ */
+ if (s == 0)
+ return (m);
+ while ((q1 = drand48()) == 0)
+ /* empty statement */;
+ return (m - s * log(q1 * s));
+}
+
+#endif
diff --git a/ntpd/ppsapi_timepps.h b/ntpd/ppsapi_timepps.h
new file mode 100644
index 0000000..8adaf62
--- /dev/null
+++ b/ntpd/ppsapi_timepps.h
@@ -0,0 +1,26 @@
+/* ppsapi_timepps.h */
+
+/*
+ * This logic first tries to get the timepps.h file from a standard
+ * location, and then from our include/ subdirectory.
+ */
+
+#ifdef HAVE_TIMEPPS_H
+# include <timepps.h>
+#else
+# ifdef HAVE_SYS_TIMEPPS_H
+# include <sys/timepps.h>
+# else
+# ifdef HAVE_CIOGETEV
+# include "timepps-SunOS.h"
+# else
+# ifdef HAVE_TIOCGPPSEV
+# include "timepps-Solaris.h"
+# else
+# ifdef TIOCDCDTIMESTAMP
+# include "timepps-SCO.h"
+# endif
+# endif
+# endif
+# endif
+#endif
diff --git a/ntpd/refclock_acts.c b/ntpd/refclock_acts.c
new file mode 100644
index 0000000..36322fd
--- /dev/null
+++ b/ntpd/refclock_acts.c
@@ -0,0 +1,911 @@
+/*
+ * refclock_acts - clock driver for the NIST/USNO/PTB/NPL Computer Time
+ * Services
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_ACTS)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+#include "ntp_control.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#ifdef SYS_WINNT
+#undef write /* ports/winnt/include/config.h: #define write _write */
+extern int async_write(int, const void *, unsigned int);
+#define write(fd, data, octets) async_write(fd, data, octets)
+#endif
+
+/*
+ * This driver supports the US (NIST, USNO) and European (PTB, NPL,
+ * etc.) modem time services, as well as Spectracom GPS and WWVB
+ * receivers connected via a modem. The driver periodically dials a
+ * number from a telephone list, receives the timecode data and
+ * calculates the local clock correction. It is designed primarily for
+ * use as backup when neither a radio clock nor connectivity to Internet
+ * time servers is available.
+ *
+ * This driver requires a modem with a Hayes-compatible command set and
+ * control over the modem data terminal ready (DTR) control line. The
+ * modem setup string is hard-coded in the driver and may require
+ * changes for nonstandard modems or special circumstances.
+ *
+ * When enabled, the calling program dials the first number in the
+ * phones file. If that call fails, it dials the second number and
+ * so on. The phone number is specified by the Hayes ATDT prefix
+ * followed by the number itself, including the long-distance prefix
+ * and delay code, if necessary. The calling program is enabled
+ * when (a) fudge flag1 is set by ntpdc, (b) at each poll interval
+ * when no other synchronization sources are present, and (c) at each
+ * poll interval whether or not other synchronization sources are
+ * present. The calling program disconnects if (a) the called party
+ * is busy or does not answer, (b) the called party disconnects
+ * before a sufficient nuimber of timecodes have been received.
+ *
+ * The driver is transparent to each of the modem time services and
+ * Spectracom radios. It selects the parsing algorithm depending on the
+ * message length. There is some hazard should the message be corrupted.
+ * However, the data format is checked carefully and only if all checks
+ * succeed is the message accepted. Corrupted lines are discarded
+ * without complaint.
+ *
+ * Fudge controls
+ *
+ * flag1 force a call in manual mode
+ * flag2 enable port locking (not verified)
+ * flag3 not used
+ * flag4 not used
+ *
+ * time1 offset adjustment (s)
+ *
+ * Ordinarily, the serial port is connected to a modem and the phones
+ * list is defined. If no phones list is defined, the port can be
+ * connected directly to a device or another computer. In this case the
+ * driver will send a single character 'T' at each poll event. If
+ * fudge flag2 is enabled, port locking allows the modem to be shared
+ * when not in use by this driver.
+ */
+/*
+ * National Institute of Science and Technology (NIST)
+ *
+ * Phone: (303) 494-4774 (Boulder, CO); (808) 335-4721 (Hawaii)
+ *
+ * Data Format
+ *
+ * National Institute of Standards and Technology
+ * Telephone Time Service, Generator 3B
+ * Enter question mark "?" for HELP
+ * D L D
+ * MJD YR MO DA H M S ST S UT1 msADV <OTM>
+ * 47999 90-04-18 21:39:15 50 0 +.1 045.0 UTC(NIST) *<CR><LF>
+ * ...
+ *
+ * MJD, DST, DUT1 and UTC are not used by this driver. The "*" or "#" is
+ * the on-time markers echoed by the driver and used by NIST to measure
+ * and correct for the propagation delay. Note: the ACTS timecode has
+ * recently been changed to eliminate the * on-time indicator. The
+ * reason for this and the long term implications are not clear.
+ *
+ * US Naval Observatory (USNO)
+ *
+ * Phone: (202) 762-1594 (Washington, DC); (719) 567-6742 (Boulder, CO)
+ *
+ * Data Format (two lines, repeating at one-second intervals)
+ *
+ * jjjjj nnn hhmmss UTC<CR><LF>
+ * *<CR><LF>
+ *
+ * jjjjj modified Julian day number (not used)
+ * nnn day of year
+ * hhmmss second of day
+ * * on-time marker for previous timecode
+ * ...
+ *
+ * USNO does not correct for the propagation delay. A fudge time1 of
+ * about .06 s is advisable.
+ *
+ * European Services (PTB, NPL, etc.)
+ *
+ * PTB: +49 531 512038 (Germany)
+ * NPL: 0906 851 6333 (UK only)
+ *
+ * Data format (see the documentation for phone numbers and formats.)
+ *
+ * 1995-01-23 20:58:51 MEZ 10402303260219950123195849740+40000500<CR><LF>
+ *
+ * Spectracom GPS and WWVB Receivers
+ *
+ * If a modem is connected to a Spectracom receiver, this driver will
+ * call it up and retrieve the time in one of two formats. As this
+ * driver does not send anything, the radio will have to either be
+ * configured in continuous mode or be polled by another local driver.
+ */
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/acts%d" /* device name and unit */
+#define SPEED232 B19200 /* uart speed (19200 bps) */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define LOCKFILE "/var/spool/lock/LCK..cua%d"
+#define DESCRIPTION "Automated Computer Time Service" /* WRU */
+#define REFID "NONE" /* default reference ID */
+#define MSGCNT 20 /* max message count */
+#define MAXPHONE 10 /* max number of phone numbers */
+
+/*
+ * Calling program modes (mode)
+ */
+#define MODE_BACKUP 0 /* backup mode */
+#define MODE_AUTO 1 /* automatic mode */
+#define MODE_MANUAL 2 /* manual mode */
+
+/*
+ * Service identifiers (message length)
+ */
+#define REFACTS "NIST" /* NIST reference ID */
+#define LENACTS 50 /* NIST format A */
+#define REFUSNO "USNO" /* USNO reference ID */
+#define LENUSNO 20 /* USNO */
+#define REFPTB "PTB\0" /* PTB/NPL reference ID */
+#define LENPTB 78 /* PTB/NPL format */
+#define REFWWVB "WWVB" /* WWVB reference ID */
+#define LENWWVB0 22 /* WWVB format 0 */
+#define LENWWVB2 24 /* WWVB format 2 */
+#define LF 0x0a /* ASCII LF */
+
+/*
+ * Modem setup strings. These may have to be changed for
+ * some modems.
+ *
+ * AT command prefix
+ * B1 US answer tone
+ * &C0 disable carrier detect
+ * &D2 hang up and return to command mode on DTR transition
+ * E0 modem command echo disabled
+ * L1 set modem speaker volume to low level
+ * M1 speaker enabled until carrier detect
+ * Q0 return result codes
+ * V1 return result codes as English words
+ * Y1 enable long-space disconnect
+ */
+const char def_modem_setup[] = "ATB1&C0&D2E0L1M1Q0V1Y1";
+const char *modem_setup = def_modem_setup;
+
+/*
+ * Timeouts (all in seconds)
+ */
+#define SETUP 3 /* setup timeout */
+#define REDIAL 30 /* redial timeout */
+#define ANSWER 60 /* answer timeout */
+#define TIMECODE 60 /* message timeout */
+#define MAXCODE 20 /* max timecodes */
+
+/*
+ * State machine codes
+ */
+typedef enum {
+ S_IDLE, /* wait for poll */
+ S_SETUP, /* send modem setup */
+ S_CONNECT, /* wait for answer */
+ S_MSG /* wait for timecode */
+} teModemState;
+
+/*
+ * Unit control structure
+ */
+struct actsunit {
+ int unit; /* unit number */
+ int state; /* the first one was Delaware */
+ int timer; /* timeout counter */
+ int retry; /* retry index */
+ int msgcnt; /* count of messages received */
+ l_fp tstamp; /* on-time timestamp */
+ char *bufptr; /* next incoming char stored here */
+ char buf[BMAX]; /* bufptr roams within buf[] */
+};
+
+/*
+ * Function prototypes
+ */
+static int acts_start (int, struct peer *);
+static void acts_shutdown (int, struct peer *);
+static void acts_receive (struct recvbuf *);
+static void acts_message (struct peer *, const char *);
+static void acts_timecode (struct peer *, const char *);
+static void acts_poll (int, struct peer *);
+static void acts_timeout (struct peer *, teModemState);
+static void acts_timer (int, struct peer *);
+static void acts_close (struct peer *);
+
+/*
+ * Transfer vector (conditional structure name)
+ */
+struct refclock refclock_acts = {
+ acts_start, /* start up driver */
+ acts_shutdown, /* shut down driver */
+ acts_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* not used */
+ noentry, /* not used */
+ acts_timer /* housekeeping timer */
+};
+
+/*
+ * Initialize data for processing
+ */
+static int
+acts_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+ const char *setup;
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(struct actsunit));
+ up->unit = unit;
+ pp = peer->procptr;
+ pp->unitptr = up;
+ pp->io.clock_recv = acts_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = -1;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, REFID, 4);
+ peer->sstclktype = CTL_SST_TS_TELEPHONE;
+ up->bufptr = up->buf;
+ if (def_modem_setup == modem_setup) {
+ setup = get_ext_sys_var("modemsetup");
+ if (setup != NULL)
+ modem_setup = estrdup(setup);
+ }
+
+ return (1);
+}
+
+
+/*
+ * acts_shutdown - shut down the clock
+ */
+static void
+acts_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * Warning: do this only when a call is not in progress.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ acts_close(peer);
+ free(up);
+}
+
+
+/*
+ * acts_receive - receive data from the serial interface
+ */
+static void
+acts_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ char tbuf[sizeof(up->buf)];
+ char * tptr;
+ int octets;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp. Note
+ * we are in raw mode and victim of whatever the terminal
+ * interface kicks up; so, we have to reassemble messages from
+ * arbitrary fragments. Capture the timecode at the beginning of
+ * the message and at the '*' and '#' on-time characters.
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ octets = sizeof(up->buf) - (up->bufptr - up->buf);
+ refclock_gtraw(rbufp, tbuf, octets, &pp->lastrec);
+ for (tptr = tbuf; *tptr != '\0'; tptr++) {
+ if (*tptr == LF) {
+ if (up->bufptr == up->buf) {
+ up->tstamp = pp->lastrec;
+ continue;
+ } else {
+ *up->bufptr = '\0';
+ up->bufptr = up->buf;
+ acts_message(peer, up->buf);
+ }
+ } else if (!iscntrl(*tptr)) {
+ *up->bufptr++ = *tptr;
+ if (*tptr == '*' || *tptr == '#') {
+ up->tstamp = pp->lastrec;
+ if (write(pp->io.fd, tptr, 1) < 0)
+ msyslog(LOG_ERR, "acts: write echo fails %m");
+ }
+ }
+ }
+}
+
+
+/*
+ * acts_message - process message
+ */
+void
+acts_message(
+ struct peer *peer,
+ const char *msg
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+ char tbuf[BMAX];
+ int dtr = TIOCM_DTR;
+
+ DPRINTF(1, ("acts: %d %s\n", (int)strlen(msg), msg));
+
+ /*
+ * What to do depends on the state and the first token in the
+ * message.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Extract the first token in the line.
+ */
+ strlcpy(tbuf, msg, sizeof(tbuf));
+ strtok(tbuf, " ");
+ switch (up->state) {
+
+ /*
+ * We are waiting for the OK response to the modem setup
+ * command. When this happens, dial the number followed.
+ * If anything other than OK is received, just ignore it
+ * and wait for timeoue.
+ */
+ case S_SETUP:
+ if (strcmp(tbuf, "OK") != 0) {
+ /*
+ * We disable echo with MODEM_SETUP's E0 but
+ * if the modem was previously E1, we will
+ * see MODEM_SETUP echoed before the OK/ERROR.
+ * Ignore it.
+ */
+ if (!strcmp(tbuf, modem_setup))
+ return;
+ break;
+ }
+
+ mprintf_event(PEVNT_CLOCK, peer, "DIAL #%d %s",
+ up->retry, sys_phone[up->retry]);
+ if (ioctl(pp->io.fd, TIOCMBIS, &dtr) < 0)
+ msyslog(LOG_ERR, "acts: ioctl(TIOCMBIS) failed: %m");
+ if (write(pp->io.fd, sys_phone[up->retry],
+ strlen(sys_phone[up->retry])) < 0)
+ msyslog(LOG_ERR, "acts: write DIAL fails %m");
+ write(pp->io.fd, "\r", 1);
+ up->retry++;
+ up->state = S_CONNECT;
+ up->timer = ANSWER;
+ return;
+
+ /*
+ * We are waiting for the CONNECT response to the dial
+ * command. When this happens, listen for timecodes. If
+ * somthing other than CONNECT is received, like BUSY
+ * or NO CARRIER, abort the call.
+ */
+ case S_CONNECT:
+ if (strcmp(tbuf, "CONNECT") != 0)
+ break;
+
+ report_event(PEVNT_CLOCK, peer, msg);
+ up->state = S_MSG;
+ up->timer = TIMECODE;
+ return;
+
+ /*
+ * We are waiting for a timecode response. Pass it to
+ * the parser. If NO CARRIER is received, save the
+ * messages and abort the call.
+ */
+ case S_MSG:
+ if (strcmp(tbuf, "NO") == 0)
+ report_event(PEVNT_CLOCK, peer, msg);
+ if (up->msgcnt < MAXCODE)
+ acts_timecode(peer, msg);
+ else
+ acts_timeout(peer, S_MSG);
+ return;
+ }
+
+ /*
+ * Other response. Tell us about it.
+ */
+ report_event(PEVNT_CLOCK, peer, msg);
+ acts_close(peer);
+}
+
+
+/*
+ * acts_timeout - called on timeout
+ */
+static void
+acts_timeout(
+ struct peer *peer,
+ teModemState dstate
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+ int fd;
+ int rc;
+ char device[20];
+ char lockfile[128], pidbuf[8];
+
+ /*
+ * The state machine is driven by messages from the modem,
+ * when first started and at timeout.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ switch (dstate) {
+
+ /*
+ * System poll event. Lock the modem port, open the device
+ * and send the setup command.
+ */
+ case S_IDLE:
+ if (-1 != pp->io.fd)
+ return; /* port is already open */
+
+ /*
+ * Lock the modem port. If busy, retry later. Note: if
+ * something fails between here and the close, the lock
+ * file may not be removed.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG2) {
+ snprintf(lockfile, sizeof(lockfile), LOCKFILE,
+ up->unit);
+ fd = open(lockfile, O_WRONLY | O_CREAT | O_EXCL,
+ 0644);
+ if (fd < 0) {
+ report_event(PEVNT_CLOCK, peer, "acts: port busy");
+ return;
+ }
+ snprintf(pidbuf, sizeof(pidbuf), "%d\n",
+ (u_int)getpid());
+ if (write(fd, pidbuf, strlen(pidbuf)) < 0)
+ msyslog(LOG_ERR, "acts: write lock fails %m");
+ close(fd);
+ }
+
+ /*
+ * Open the device in raw mode and link the I/O.
+ */
+ snprintf(device, sizeof(device), DEVICE,
+ up->unit);
+ fd = refclock_open(device, SPEED232, LDISC_ACTS |
+ LDISC_RAW | LDISC_REMOTE);
+ if (fd <= 0) {
+ msyslog(LOG_ERR, "acts: open fails %m");
+ return;
+ }
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ msyslog(LOG_ERR, "acts: addclock fails");
+ close(fd);
+ pp->io.fd = -1;
+ return;
+ }
+ up->msgcnt = 0;
+ up->bufptr = up->buf;
+
+ /*
+ * If the port is directly connected to the device, skip
+ * the modem business and send 'T' for Spectrabum.
+ */
+ if (sys_phone[up->retry] == NULL) {
+ if (write(pp->io.fd, "T", 1) < 0)
+ msyslog(LOG_ERR, "acts: write T fails %m");
+ up->state = S_MSG;
+ up->timer = TIMECODE;
+ return;
+ }
+
+ /*
+ * Initialize the modem. This works with Hayes-
+ * compatible modems.
+ */
+ mprintf_event(PEVNT_CLOCK, peer, "SETUP %s",
+ modem_setup);
+ rc = write(pp->io.fd, modem_setup, strlen(modem_setup));
+ if (rc < 0)
+ msyslog(LOG_ERR, "acts: write SETUP fails %m");
+ write(pp->io.fd, "\r", 1);
+ up->state = S_SETUP;
+ up->timer = SETUP;
+ return;
+
+ /*
+ * In SETUP state the modem did not respond OK to setup string.
+ */
+ case S_SETUP:
+ report_event(PEVNT_CLOCK, peer, "no modem");
+ break;
+
+ /*
+ * In CONNECT state the call did not complete. Abort the call.
+ */
+ case S_CONNECT:
+ report_event(PEVNT_CLOCK, peer, "no answer");
+ break;
+
+ /*
+ * In MSG states no further timecodes are expected. If any
+ * timecodes have arrived, update the clock. In any case,
+ * terminate the call.
+ */
+ case S_MSG:
+ if (up->msgcnt == 0) {
+ report_event(PEVNT_CLOCK, peer, "no timecodes");
+ } else {
+ pp->lastref = pp->lastrec;
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ refclock_receive(peer);
+ }
+ break;
+ }
+ acts_close(peer);
+}
+
+
+/*
+ * acts_close - close and prepare for next call.
+ *
+ * In ClOSE state no further protocol actions are required
+ * other than to close and release the device and prepare to
+ * dial the next number if necessary.
+ */
+void
+acts_close(
+ struct peer *peer
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+ char lockfile[128];
+ int dtr;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (pp->io.fd != -1) {
+ report_event(PEVNT_CLOCK, peer, "close");
+ dtr = TIOCM_DTR;
+ if (ioctl(pp->io.fd, TIOCMBIC, &dtr) < 0)
+ msyslog(LOG_ERR, "acts: ioctl(TIOCMBIC) failed: %m");
+ io_closeclock(&pp->io);
+ pp->io.fd = -1;
+ }
+ if (pp->sloppyclockflag & CLK_FLAG2) {
+ snprintf(lockfile, sizeof(lockfile),
+ LOCKFILE, up->unit);
+ unlink(lockfile);
+ }
+ if (up->msgcnt == 0 && up->retry > 0) {
+ if (sys_phone[up->retry] != NULL) {
+ up->state = S_IDLE;
+ up->timer = REDIAL;
+ return;
+ }
+ }
+ up->state = S_IDLE;
+ up->timer = 0;
+}
+
+
+/*
+ * acts_poll - called by the transmit routine
+ */
+static void
+acts_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * This routine is called at every system poll. All it does is
+ * set flag1 under certain conditions. The real work is done by
+ * the timeout routine and state machine.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ switch (peer->ttl) {
+
+ /*
+ * In manual mode the calling program is activated by the ntpdc
+ * program using the enable flag (fudge flag1), either manually
+ * or by a cron job.
+ */
+ case MODE_MANUAL:
+ return;
+
+ /*
+ * In automatic mode the calling program runs continuously at
+ * intervals determined by the poll event or specified timeout.
+ */
+ case MODE_AUTO:
+ break;
+
+ /*
+ * In backup mode the calling program runs continuously as long
+ * as either no peers are available or this peer is selected.
+ */
+ case MODE_BACKUP:
+ if (!(sys_peer == NULL || sys_peer == peer))
+ return;
+
+ break;
+ }
+ pp->polls++;
+ if (S_IDLE == up->state) {
+ up->retry = 0;
+ acts_timeout(peer, S_IDLE);
+ }
+}
+
+
+/*
+ * acts_timer - called at one-second intervals
+ */
+static void
+acts_timer(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * This routine implments a timeout which runs for a programmed
+ * interval. The counter is initialized by the state machine and
+ * counts down to zero. Upon reaching zero, the state machine is
+ * called. If flag1 is set while timer is zero, force a call.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->timer == 0) {
+ if (pp->sloppyclockflag & CLK_FLAG1) {
+ pp->sloppyclockflag &= ~CLK_FLAG1;
+ acts_timeout(peer, S_IDLE);
+ }
+ } else {
+ up->timer--;
+ if (up->timer == 0)
+ acts_timeout(peer, up->state);
+ }
+}
+
+/*
+ * acts_timecode - identify the service and parse the timecode message
+ */
+void
+acts_timecode(
+ struct peer * peer, /* peer structure pointer */
+ const char * str /* timecode string */
+ )
+{
+ struct actsunit *up;
+ struct refclockproc *pp;
+ int day; /* day of the month */
+ int month; /* month of the year */
+ u_long mjd; /* Modified Julian Day */
+ double dut1; /* DUT adjustment */
+
+ u_int dst; /* ACTS daylight/standard time */
+ u_int leap; /* ACTS leap indicator */
+ double msADV; /* ACTS transmit advance (ms) */
+ char utc[10]; /* ACTS timescale */
+ char flag; /* ACTS on-time character (* or #) */
+
+ char synchar; /* WWVB synchronized indicator */
+ char qualchar; /* WWVB quality indicator */
+ char leapchar; /* WWVB leap indicator */
+ char dstchar; /* WWVB daylight/savings indicator */
+ int tz; /* WWVB timezone */
+
+ int leapmonth; /* PTB/NPL month of leap */
+ char leapdir; /* PTB/NPL leap direction */
+
+ /*
+ * The parser selects the modem format based on the message
+ * length. Since the data are checked carefully, occasional
+ * errors due noise are forgivable.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ pp->nsec = 0;
+ switch (strlen(str)) {
+
+ /*
+ * For USNO format on-time character '*', which is on a line by
+ * itself. Be sure a timecode has been received.
+ */
+ case 1:
+ if (*str == '*' && up->msgcnt > 0)
+ break;
+
+ return;
+
+ /*
+ * ACTS format A: "jjjjj yy-mm-dd hh:mm:ss ds l uuu aaaaa
+ * UTC(NIST) *".
+ */
+ case LENACTS:
+ if (sscanf(str,
+ "%5ld %2d-%2d-%2d %2d:%2d:%2d %2d %1d %3lf %5lf %9s %c",
+ &mjd, &pp->year, &month, &day, &pp->hour,
+ &pp->minute, &pp->second, &dst, &leap, &dut1,
+ &msADV, utc, &flag) != 13) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ pp->day = ymd2yd(pp->year, month, day);
+ pp->leap = LEAP_NOWARNING;
+ if (leap == 1)
+ pp->leap = LEAP_ADDSECOND;
+ else if (leap == 2)
+ pp->leap = LEAP_DELSECOND;
+ memcpy(&pp->refid, REFACTS, 4);
+ up->msgcnt++;
+ if (flag != '#' && up->msgcnt < 10)
+ return;
+
+ break;
+
+ /*
+ * USNO format: "jjjjj nnn hhmmss UTC"
+ */
+ case LENUSNO:
+ if (sscanf(str, "%5ld %3d %2d%2d%2d %3s",
+ &mjd, &pp->day, &pp->hour, &pp->minute,
+ &pp->second, utc) != 6) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Wait for the on-time character, which follows in a
+ * separate message. There is no provision for leap
+ * warning.
+ */
+ pp->leap = LEAP_NOWARNING;
+ memcpy(&pp->refid, REFUSNO, 4);
+ up->msgcnt++;
+ break;
+
+ /*
+ * PTB/NPL format: "yyyy-mm-dd hh:mm:ss MEZ"
+ */
+ case LENPTB:
+ if (sscanf(str,
+ "%*4d-%*2d-%*2d %*2d:%*2d:%2d %*5c%*12c%4d%2d%2d%2d%2d%5ld%2lf%c%2d%3lf%*15c%c",
+ &pp->second, &pp->year, &month, &day, &pp->hour,
+ &pp->minute, &mjd, &dut1, &leapdir, &leapmonth,
+ &msADV, &flag) != 12) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ pp->leap = LEAP_NOWARNING;
+ if (leapmonth == month) {
+ if (leapdir == '+')
+ pp->leap = LEAP_ADDSECOND;
+ else if (leapdir == '-')
+ pp->leap = LEAP_DELSECOND;
+ }
+ pp->day = ymd2yd(pp->year, month, day);
+ memcpy(&pp->refid, REFPTB, 4);
+ up->msgcnt++;
+ break;
+
+
+ /*
+ * WWVB format 0: "I ddd hh:mm:ss DTZ=nn"
+ */
+ case LENWWVB0:
+ if (sscanf(str, "%c %3d %2d:%2d:%2d %cTZ=%2d",
+ &synchar, &pp->day, &pp->hour, &pp->minute,
+ &pp->second, &dstchar, &tz) != 7) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ pp->leap = LEAP_NOWARNING;
+ if (synchar != ' ')
+ pp->leap = LEAP_NOTINSYNC;
+ memcpy(&pp->refid, REFWWVB, 4);
+ up->msgcnt++;
+ break;
+
+ /*
+ * WWVB format 2: "IQyy ddd hh:mm:ss.mmm LD"
+ */
+ case LENWWVB2:
+ if (sscanf(str, "%c%c%2d %3d %2d:%2d:%2d.%3ld%c%c%c",
+ &synchar, &qualchar, &pp->year, &pp->day,
+ &pp->hour, &pp->minute, &pp->second, &pp->nsec,
+ &dstchar, &leapchar, &dstchar) != 11) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ pp->nsec *= 1000000;
+ pp->leap = LEAP_NOWARNING;
+ if (synchar != ' ')
+ pp->leap = LEAP_NOTINSYNC;
+ else if (leapchar == 'L')
+ pp->leap = LEAP_ADDSECOND;
+ memcpy(&pp->refid, REFWWVB, 4);
+ up->msgcnt++;
+ break;
+
+ /*
+ * None of the above. Just forget about it and wait for the next
+ * message or timeout.
+ */
+ default:
+ return;
+ }
+
+ /*
+ * We have a valid timecode. The fudge time1 value is added to
+ * each sample by the main line routines. Note that in current
+ * telephone networks the propatation time can be different for
+ * each call and can reach 200 ms for some calls.
+ */
+ peer->refid = pp->refid;
+ pp->lastrec = up->tstamp;
+ if (up->msgcnt == 0)
+ return;
+
+ strlcpy(pp->a_lastcode, str, sizeof(pp->a_lastcode));
+ pp->lencode = strlen(pp->a_lastcode);
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+}
+#else
+int refclock_acts_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_arbiter.c b/ntpd/refclock_arbiter.c
new file mode 100644
index 0000000..738be50
--- /dev/null
+++ b/ntpd/refclock_arbiter.c
@@ -0,0 +1,479 @@
+/*
+ * refclock_arbiter - clock driver for Arbiter 1088A/B Satellite
+ * Controlled Clock
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_ARBITER)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#ifdef SYS_WINNT
+extern int async_write(int, const void *, unsigned int);
+#undef write
+#define write(fd, data, octets) async_write(fd, data, octets)
+#endif
+
+/*
+ * This driver supports the Arbiter 1088A/B Satellite Controlled Clock.
+ * The claimed accuracy of this clock is 100 ns relative to the PPS
+ * output when receiving four or more satellites.
+ *
+ * The receiver should be configured before starting the NTP daemon, in
+ * order to establish reliable position and operating conditions. It
+ * does not initiate surveying or hold mode. For use with NTP, the
+ * daylight savings time feature should be disables (D0 command) and the
+ * broadcast mode set to operate in UTC (BU command).
+ *
+ * The timecode format supported by this driver is selected by the poll
+ * sequence "B5", which initiates a line in the following format to be
+ * repeated once per second until turned off by the "B0" poll sequence.
+ *
+ * Format B5 (24 ASCII printing characters):
+ *
+ * <cr><lf>i yy ddd hh:mm:ss.000bbb
+ *
+ * on-time = <cr>
+ * i = synchronization flag (' ' = locked, '?' = unlocked)
+ * yy = year of century
+ * ddd = day of year
+ * hh:mm:ss = hours, minutes, seconds
+ * .000 = fraction of second (not used)
+ * bbb = tailing spaces for fill
+ *
+ * The alarm condition is indicated by a '?' at i, which indicates the
+ * receiver is not synchronized. In normal operation, a line consisting
+ * of the timecode followed by the time quality character (TQ) followed
+ * by the receiver status string (SR) is written to the clockstats file.
+ * The time quality character is encoded in IEEE P1344 standard:
+ *
+ * Format TQ (IEEE P1344 estimated worst-case time quality)
+ *
+ * 0 clock locked, maximum accuracy
+ * F clock failure, time not reliable
+ * 4 clock unlocked, accuracy < 1 us
+ * 5 clock unlocked, accuracy < 10 us
+ * 6 clock unlocked, accuracy < 100 us
+ * 7 clock unlocked, accuracy < 1 ms
+ * 8 clock unlocked, accuracy < 10 ms
+ * 9 clock unlocked, accuracy < 100 ms
+ * A clock unlocked, accuracy < 1 s
+ * B clock unlocked, accuracy < 10 s
+ *
+ * The status string is encoded as follows:
+ *
+ * Format SR (25 ASCII printing characters)
+ *
+ * V=vv S=ss T=t P=pdop E=ee
+ *
+ * vv = satellites visible
+ * ss = relative signal strength
+ * t = satellites tracked
+ * pdop = position dilution of precision (meters)
+ * ee = hardware errors
+ *
+ * If flag4 is set, an additional line consisting of the receiver
+ * latitude (LA), longitude (LO), elevation (LH) (meters), and data
+ * buffer (DB) is written to this file. If channel B is enabled for
+ * deviation mode and connected to a 1-PPS signal, the last two numbers
+ * on the line are the deviation and standard deviation averaged over
+ * the last 15 seconds.
+ *
+ * PPS calibration fudge time1 .001240
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/gps%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "GPS " /* reference ID */
+#define DESCRIPTION "Arbiter 1088A/B GPS Receiver" /* WRU */
+#define LENARB 24 /* format B5 timecode length */
+#define MAXSTA 40 /* max length of status string */
+#define MAXPOS 80 /* max length of position string */
+
+#ifdef PRE_NTP420
+#define MODE ttlmax
+#else
+#define MODE ttl
+#endif
+
+#define COMMAND_HALT_BCAST ( (peer->MODE % 2) ? "O0" : "B0" )
+#define COMMAND_START_BCAST ( (peer->MODE % 2) ? "O5" : "B5" )
+
+/*
+ * ARB unit control structure
+ */
+struct arbunit {
+ l_fp laststamp; /* last receive timestamp */
+ int tcswitch; /* timecode switch/counter */
+ char qualchar; /* IEEE P1344 quality (TQ command) */
+ char status[MAXSTA]; /* receiver status (SR command) */
+ char latlon[MAXPOS]; /* receiver position (lat/lon/alt) */
+};
+
+/*
+ * Function prototypes
+ */
+static int arb_start (int, struct peer *);
+static void arb_shutdown (int, struct peer *);
+static void arb_receive (struct recvbuf *);
+static void arb_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_arbiter = {
+ arb_start, /* start up driver */
+ arb_shutdown, /* shut down driver */
+ arb_poll, /* transmit poll message */
+ noentry, /* not used (old arb_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old arb_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * arb_start - open the devices and initialize data for processing
+ */
+static int
+arb_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct arbunit *up;
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_CLK);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = arb_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ if (peer->MODE > 1) {
+ msyslog(LOG_NOTICE, "ARBITER: Invalid mode %d", peer->MODE);
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+#ifdef DEBUG
+ if(debug) { printf("arbiter: mode = %d.\n", peer->MODE); }
+#endif
+ write(pp->io.fd, COMMAND_HALT_BCAST, 2);
+ return (1);
+}
+
+
+/*
+ * arb_shutdown - shut down the clock
+ */
+static void
+arb_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct arbunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * arb_receive - receive data from the serial interface
+ */
+static void
+arb_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct arbunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ l_fp trtmp;
+ int temp;
+ u_char syncchar; /* synch indicator */
+ char tbuf[BMAX]; /* temp buffer */
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ temp = refclock_gtlin(rbufp, tbuf, sizeof(tbuf), &trtmp);
+
+ /*
+ * Note we get a buffer and timestamp for both a <cr> and <lf>,
+ * but only the <cr> timestamp is retained. The program first
+ * sends a TQ and expects the echo followed by the time quality
+ * character. It then sends a B5 starting the timecode broadcast
+ * and expects the echo followed some time later by the on-time
+ * character <cr> and then the <lf> beginning the timecode
+ * itself. Finally, at the <cr> beginning the next timecode at
+ * the next second, the program sends a B0 shutting down the
+ * timecode broadcast.
+ *
+ * If flag4 is set, the program snatches the latitude, longitude
+ * and elevation and writes it to the clockstats file.
+ */
+ if (temp == 0)
+ return;
+
+ pp->lastrec = up->laststamp;
+ up->laststamp = trtmp;
+ if (temp < 3)
+ return;
+
+ if (up->tcswitch == 0) {
+
+ /*
+ * Collect statistics. If nothing is recogized, just
+ * ignore; sometimes the clock doesn't stop spewing
+ * timecodes for awhile after the B0 command.
+ *
+ * If flag4 is not set, send TQ, SR, B5. If flag4 is
+ * sset, send TQ, SR, LA, LO, LH, DB, B5. When the
+ * median filter is full, send B0.
+ */
+ if (!strncmp(tbuf, "TQ", 2)) {
+ up->qualchar = tbuf[2];
+ write(pp->io.fd, "SR", 2);
+ return;
+
+ } else if (!strncmp(tbuf, "SR", 2)) {
+ strlcpy(up->status, tbuf + 2,
+ sizeof(up->status));
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ write(pp->io.fd, "LA", 2);
+ else
+ write(pp->io.fd, COMMAND_START_BCAST, 2);
+ return;
+
+ } else if (!strncmp(tbuf, "LA", 2)) {
+ strlcpy(up->latlon, tbuf + 2, sizeof(up->latlon));
+ write(pp->io.fd, "LO", 2);
+ return;
+
+ } else if (!strncmp(tbuf, "LO", 2)) {
+ strlcat(up->latlon, " ", sizeof(up->latlon));
+ strlcat(up->latlon, tbuf + 2, sizeof(up->latlon));
+ write(pp->io.fd, "LH", 2);
+ return;
+
+ } else if (!strncmp(tbuf, "LH", 2)) {
+ strlcat(up->latlon, " ", sizeof(up->latlon));
+ strlcat(up->latlon, tbuf + 2, sizeof(up->latlon));
+ write(pp->io.fd, "DB", 2);
+ return;
+
+ } else if (!strncmp(tbuf, "DB", 2)) {
+ strlcat(up->latlon, " ", sizeof(up->latlon));
+ strlcat(up->latlon, tbuf + 2, sizeof(up->latlon));
+ record_clock_stats(&peer->srcadr, up->latlon);
+#ifdef DEBUG
+ if (debug)
+ printf("arbiter: %s\n", up->latlon);
+#endif
+ write(pp->io.fd, COMMAND_START_BCAST, 2);
+ }
+ }
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has valid length, but not in
+ * proper format, we declare bad format and exit. If the
+ * timecode has invalid length, which sometimes occurs when the
+ * B0 amputates the broadcast, we just quietly steal away. Note
+ * that the time quality character and receiver status string is
+ * tacked on the end for clockstats display.
+ */
+ up->tcswitch++;
+ if (up->tcswitch <= 1 || temp < LENARB)
+ return;
+
+ /*
+ * Timecode format B5: "i yy ddd hh:mm:ss.000 "
+ */
+ strlcpy(pp->a_lastcode, tbuf, sizeof(pp->a_lastcode));
+ pp->a_lastcode[LENARB - 2] = up->qualchar;
+ strlcat(pp->a_lastcode, up->status, sizeof(pp->a_lastcode));
+ pp->lencode = strlen(pp->a_lastcode);
+ syncchar = ' ';
+ if (sscanf(pp->a_lastcode, "%c%2d %3d %2d:%2d:%2d",
+ &syncchar, &pp->year, &pp->day, &pp->hour,
+ &pp->minute, &pp->second) != 6) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ write(pp->io.fd, COMMAND_HALT_BCAST, 2);
+ return;
+ }
+
+ /*
+ * We decode the clock dispersion from the time quality
+ * character.
+ */
+ switch (up->qualchar) {
+
+ case '0': /* locked, max accuracy */
+ pp->disp = 1e-7;
+ pp->lastref = pp->lastrec;
+ break;
+
+ case '4': /* unlock accuracy < 1 us */
+ pp->disp = 1e-6;
+ break;
+
+ case '5': /* unlock accuracy < 10 us */
+ pp->disp = 1e-5;
+ break;
+
+ case '6': /* unlock accuracy < 100 us */
+ pp->disp = 1e-4;
+ break;
+
+ case '7': /* unlock accuracy < 1 ms */
+ pp->disp = .001;
+ break;
+
+ case '8': /* unlock accuracy < 10 ms */
+ pp->disp = .01;
+ break;
+
+ case '9': /* unlock accuracy < 100 ms */
+ pp->disp = .1;
+ break;
+
+ case 'A': /* unlock accuracy < 1 s */
+ pp->disp = 1;
+ break;
+
+ case 'B': /* unlock accuracy < 10 s */
+ pp->disp = 10;
+ break;
+
+ case 'F': /* clock failure */
+ pp->disp = MAXDISPERSE;
+ refclock_report(peer, CEVNT_FAULT);
+ write(pp->io.fd, COMMAND_HALT_BCAST, 2);
+ return;
+
+ default:
+ pp->disp = MAXDISPERSE;
+ refclock_report(peer, CEVNT_BADREPLY);
+ write(pp->io.fd, COMMAND_HALT_BCAST, 2);
+ return;
+ }
+ if (syncchar != ' ')
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+ if (!refclock_process(pp))
+ refclock_report(peer, CEVNT_BADTIME);
+ else if (peer->disp > MAXDISTANCE)
+ refclock_receive(peer);
+
+ /* if (up->tcswitch >= MAXSTAGE) { */
+ write(pp->io.fd, COMMAND_HALT_BCAST, 2);
+ /* } */
+}
+
+
+/*
+ * arb_poll - called by the transmit procedure
+ */
+static void
+arb_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct arbunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * Time to poll the clock. The Arbiter clock responds to a "B5"
+ * by returning a timecode in the format specified above.
+ * Transmission occurs once per second, unless turned off by a
+ * "B0". Note there is no checking on state, since this may not
+ * be the only customer reading the clock. Only one customer
+ * need poll the clock; all others just listen in.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ pp->polls++;
+ up->tcswitch = 0;
+ if (write(pp->io.fd, "TQ", 2) != 2)
+ refclock_report(peer, CEVNT_FAULT);
+
+ /*
+ * Process median filter samples. If none received, declare a
+ * timeout and keep going.
+ */
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("arbiter: timecode %d %s\n",
+ pp->lencode, pp->a_lastcode);
+#endif
+}
+
+#else
+int refclock_arbiter_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_arc.c b/ntpd/refclock_arc.c
new file mode 100644
index 0000000..b2c063e
--- /dev/null
+++ b/ntpd/refclock_arc.c
@@ -0,0 +1,1587 @@
+/*
+ * refclock_arc - clock driver for ARCRON MSF/DCF/WWVB receivers
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_ARCRON_MSF)
+
+static const char arc_version[] = { "V1.3 2003/02/21" };
+
+/* define PRE_NTP420 for compatibility to previous versions of NTP (at least
+ to 4.1.0 */
+#undef PRE_NTP420
+
+#ifndef ARCRON_NOT_KEEN
+#define ARCRON_KEEN 1 /* Be keen, and trusting of the clock, if defined. */
+#endif
+
+#ifndef ARCRON_NOT_MULTIPLE_SAMPLES
+#define ARCRON_MULTIPLE_SAMPLES 1 /* Use all timestamp bytes as samples. */
+#endif
+
+#ifndef ARCRON_NOT_LEAPSECOND_KEEN
+#ifndef ARCRON_LEAPSECOND_KEEN
+#undef ARCRON_LEAPSECOND_KEEN /* Respond quickly to leap seconds: doesn't work yet. */
+#endif
+#endif
+
+/*
+Code by Derek Mulcahy, <derek@toybox.demon.co.uk>, 1997.
+Modifications by Damon Hart-Davis, <d@hd.org>, 1997.
+Modifications by Paul Alfille, <palfille@partners.org>, 2003.
+Modifications by Christopher Price, <cprice@cs-home.com>, 2003.
+Modifications by Nigel Roles <nigel@9fs.org>, 2003.
+
+
+THIS CODE IS SUPPLIED AS IS, WITH NO WARRANTY OF ANY KIND. USE AT
+YOUR OWN RISK.
+
+Orginally developed and used with ntp3-5.85 by Derek Mulcahy.
+
+Built against ntp3-5.90 on Solaris 2.5 using gcc 2.7.2.
+
+This code may be freely copied and used and incorporated in other
+systems providing the disclaimer and notice of authorship are
+reproduced.
+
+-------------------------------------------------------------------------------
+
+Nigel's notes:
+
+1) Called tcgetattr() before modifying, so that fields correctly initialised
+ for all operating systems
+
+2) Altered parsing of timestamp line so that it copes with fields which are
+ not always ASCII digits (e.g. status field when battery low)
+
+-------------------------------------------------------------------------------
+
+Christopher's notes:
+
+MAJOR CHANGES SINCE V1.2
+========================
+ 1) Applied patch by Andrey Bray <abuse@madhouse.demon.co.uk>
+ 2001-02-17 comp.protocols.time.ntp
+
+ 2) Added WWVB support via clock mode command, localtime/UTC time configured
+ via flag1=(0=UTC, 1=localtime)
+
+ 3) Added ignore resync request via flag2=(0=resync, 1=ignore resync)
+
+ 4) Added simplified conversion from localtime to UTC with dst/bst translation
+
+ 5) Added average signal quality poll
+
+ 6) Fixed a badformat error when no code is available due to stripping
+ \n & \r's
+
+ 7) Fixed a badformat error when clearing lencode & memset a_lastcode in poll
+ routine
+
+ 8) Lots of code cleanup, including standardized DEBUG macros and removal
+ of unused code
+
+-------------------------------------------------------------------------------
+
+Author's original note:
+
+I enclose my ntp driver for the Galleon Systems Arc MSF receiver.
+
+It works (after a fashion) on both Solaris-1 and Solaris-2.
+
+I am currently using ntp3-5.85. I have been running the code for
+about 7 months without any problems. Even coped with the change to BST!
+
+I had to do some funky things to read from the clock because it uses the
+power from the receive lines to drive the transmit lines. This makes the
+code look a bit stupid but it works. I also had to put in some delays to
+allow for the turnaround time from receive to transmit. These delays
+are between characters when requesting a time stamp so that shouldn't affect
+the results too drastically.
+
+...
+
+The bottom line is that it works but could easily be improved. You are
+free to do what you will with the code. I haven't been able to determine
+how good the clock is. I think that this requires a known good clock
+to compare it against.
+
+-------------------------------------------------------------------------------
+
+Damon's notes for adjustments:
+
+MAJOR CHANGES SINCE V1.0
+========================
+ 1) Removal of pollcnt variable that made the clock go permanently
+ off-line once two time polls failed to gain responses.
+
+ 2) Avoiding (at least on Solaris-2) terminal becoming the controlling
+ terminal of the process when we do a low-level open().
+
+ 3) Additional logic (conditional on ARCRON_LEAPSECOND_KEEN being
+ defined) to try to resync quickly after a potential leap-second
+ insertion or deletion.
+
+ 4) Code significantly slimmer at run-time than V1.0.
+
+
+GENERAL
+=======
+
+ 1) The C preprocessor symbol to have the clock built has been changed
+ from ARC to ARCRON_MSF to CLOCK_ARCRON_MSF to minimise the
+ possiblity of clashes with other symbols in the future.
+
+ 2) PRECISION should be -4/-5 (63ms/31ms) for the following reasons:
+
+ a) The ARC documentation claims the internal clock is (only)
+ accurate to about 20ms relative to Rugby (plus there must be
+ noticable drift and delay in the ms range due to transmission
+ delays and changing atmospheric effects). This clock is not
+ designed for ms accuracy as NTP has spoilt us all to expect.
+
+ b) The clock oscillator looks like a simple uncompensated quartz
+ crystal of the sort used in digital watches (ie 32768Hz) which
+ can have large temperature coefficients and drifts; it is not
+ clear if this oscillator is properly disciplined to the MSF
+ transmission, but as the default is to resync only once per
+ *day*, we can imagine that it is not, and is free-running. We
+ can minimise drift by resyncing more often (at the cost of
+ reduced battery life), but drift/wander may still be
+ significant.
+
+ c) Note that the bit time of 3.3ms adds to the potential error in
+ the the clock timestamp, since the bit clock of the serial link
+ may effectively be free-running with respect to the host clock
+ and the MSF clock. Actually, the error is probably 1/16th of
+ the above, since the input data is probably sampled at at least
+ 16x the bit rate.
+
+ By keeping the clock marked as not very precise, it will have a
+ fairly large dispersion, and thus will tend to be used as a
+ `backup' time source and sanity checker, which this clock is
+ probably ideal for. For an isolated network without other time
+ sources, this clock can probably be expected to provide *much*
+ better than 1s accuracy, which will be fine.
+
+ By default, PRECISION is set to -4, but experience, especially at a
+ particular geographic location with a particular clock, may allow
+ this to be altered to -5. (Note that skews of +/- 10ms are to be
+ expected from the clock from time-to-time.) This improvement of
+ reported precision can be instigated by setting flag3 to 1, though
+ the PRECISION will revert to the normal value while the clock
+ signal quality is unknown whatever the flag3 setting.
+
+ IN ANY CASE, BE SURE TO SET AN APPROPRIATE FUDGE FACTOR TO REMOVE
+ ANY RESIDUAL SKEW, eg:
+
+ server 127.127.27.0 # ARCRON MSF radio clock unit 0.
+ # Fudge timestamps by about 20ms.
+ fudge 127.127.27.0 time1 0.020
+
+ You will need to observe your system's behaviour, assuming you have
+ some other NTP source to compare it with, to work out what the
+ fudge factor should be. For my Sun SS1 running SunOS 4.1.3_U1 with
+ my MSF clock with my distance from the MSF transmitter, +20ms
+ seemed about right, after some observation.
+
+ 3) REFID has been made "MSFa" to reflect the MSF time source and the
+ ARCRON receiver.
+
+ 4) DEFAULT_RESYNC_TIME is the time in seconds (by default) before
+ forcing a resync since the last attempt. This is picked to give a
+ little less than an hour between resyncs and to try to avoid
+ clashing with any regular event at a regular time-past-the-hour
+ which might cause systematic errors.
+
+ The INITIAL_RESYNC_DELAY is to avoid bothering the clock and
+ running down its batteries unnecesarily if ntpd is going to crash
+ or be killed or reconfigured quickly. If ARCRON_KEEN is defined
+ then this period is long enough for (with normal polling rates)
+ enough time samples to have been taken to allow ntpd to sync to
+ the clock before the interruption for the clock to resync to MSF.
+ This avoids ntpd syncing to another peer first and then
+ almost immediately hopping to the MSF clock.
+
+ The RETRY_RESYNC_TIME is used before rescheduling a resync after a
+ resync failed to reveal a statisfatory signal quality (too low or
+ unknown).
+
+ 5) The clock seems quite jittery, so I have increased the
+ median-filter size from the typical (previous) value of 3. I
+ discard up to half the results in the filter. It looks like maybe
+ 1 sample in 10 or so (maybe less) is a spike, so allow the median
+ filter to discard at least 10% of its entries or 1 entry, whichever
+ is greater.
+
+ 6) Sleeping *before* each character sent to the unit to allow required
+ inter-character time but without introducting jitter and delay in
+ handling the response if possible.
+
+ 7) If the flag ARCRON_KEEN is defined, take time samples whenever
+ possible, even while resyncing, etc. We rely, in this case, on the
+ clock always giving us a reasonable time or else telling us in the
+ status byte at the end of the timestamp that it failed to sync to
+ MSF---thus we should never end up syncing to completely the wrong
+ time.
+
+ 8) If the flag ARCRON_OWN_FILTER is defined, use own versions of
+ refclock median-filter routines to get round small bug in 3-5.90
+ code which does not return the median offset. XXX Removed this
+ bit due NTP Version 4 upgrade - dlm.
+
+ 9) We would appear to have a year-2000 problem with this clock since
+ it returns only the two least-significant digits of the year. But
+ ntpd ignores the year and uses the local-system year instead, so
+ this is in fact not a problem. Nevertheless, we attempt to do a
+ sensible thing with the dates, wrapping them into a 100-year
+ window.
+
+ 10)Logs stats information that can be used by Derek's Tcl/Tk utility
+ to show the status of the clock.
+
+ 11)The clock documentation insists that the number of bits per
+ character to be sent to the clock, and sent by it, is 11, including
+ one start bit and two stop bits. The data format is either 7+even
+ or 8+none.
+
+
+TO-DO LIST
+==========
+
+ * Eliminate use of scanf(), and maybe sprintf().
+
+ * Allow user setting of resync interval to trade battery life for
+ accuracy; maybe could be done via fudge factor or unit number.
+
+ * Possibly note the time since the last resync of the MSF clock to
+ MSF as the age of the last reference timestamp, ie trust the
+ clock's oscillator not very much...
+
+ * Add very slow auto-adjustment up to a value of +/- time2 to correct
+ for long-term errors in the clock value (time2 defaults to 0 so the
+ correction would be disabled by default).
+
+ * Consider trying to use the tty_clk/ppsclock support.
+
+ * Possibly use average or maximum signal quality reported during
+ resync, rather than just the last one, which may be atypical.
+
+*/
+
+
+/* Notes for HKW Elektronik GmBH Radio clock driver */
+/* Author Lyndon David, Sentinet Ltd, Feb 1997 */
+/* These notes seem also to apply usefully to the ARCRON clock. */
+
+/* The HKW clock module is a radio receiver tuned into the Rugby */
+/* MSF time signal tranmitted on 60 kHz. The clock module connects */
+/* to the computer via a serial line and transmits the time encoded */
+/* in 15 bytes at 300 baud 7 bits two stop bits even parity */
+
+/* Clock communications, from the datasheet */
+/* All characters sent to the clock are echoed back to the controlling */
+/* device. */
+/* Transmit time/date information */
+/* syntax ASCII o<cr> */
+/* Character o may be replaced if neccesary by a character whose code */
+/* contains the lowest four bits f(hex) eg */
+/* syntax binary: xxxx1111 00001101 */
+
+/* DHD note:
+You have to wait for character echo + 10ms before sending next character.
+*/
+
+/* The clock replies to this command with a sequence of 15 characters */
+/* which contain the complete time and a final <cr> making 16 characters */
+/* in total. */
+/* The RC computer clock will not reply immediately to this command because */
+/* the start bit edge of the first reply character marks the beginning of */
+/* the second. So the RC Computer Clock will reply to this command at the */
+/* start of the next second */
+/* The characters have the following meaning */
+/* 1. hours tens */
+/* 2. hours units */
+/* 3. minutes tens */
+/* 4. minutes units */
+/* 5. seconds tens */
+/* 6. seconds units */
+/* 7. day of week 1-monday 7-sunday */
+/* 8. day of month tens */
+/* 9. day of month units */
+/* 10. month tens */
+/* 11. month units */
+/* 12. year tens */
+/* 13. year units */
+/* 14. BST/UTC status */
+/* bit 7 parity */
+/* bit 6 always 0 */
+/* bit 5 always 1 */
+/* bit 4 always 1 */
+/* bit 3 always 0 */
+/* bit 2 =1 if UTC is in effect, complementary to the BST bit */
+/* bit 1 =1 if BST is in effect, according to the BST bit */
+/* bit 0 BST/UTC change impending bit=1 in case of change impending */
+/* 15. status */
+/* bit 7 parity */
+/* bit 6 always 0 */
+/* bit 5 always 1 */
+/* bit 4 always 1 */
+/* bit 3 =1 if low battery is detected */
+/* bit 2 =1 if the very last reception attempt failed and a valid */
+/* time information already exists (bit0=1) */
+/* =0 if the last reception attempt was successful */
+/* bit 1 =1 if at least one reception since 2:30 am was successful */
+/* =0 if no reception attempt since 2:30 am was successful */
+/* bit 0 =1 if the RC Computer Clock contains valid time information */
+/* This bit is zero after reset and one after the first */
+/* successful reception attempt */
+
+/* DHD note:
+Also note g<cr> command which confirms that a resync is in progress, and
+if so what signal quality (0--5) is available.
+Also note h<cr> command which starts a resync to MSF signal.
+*/
+
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#if defined(HAVE_BSD_TTYS)
+#include <sgtty.h>
+#endif /* HAVE_BSD_TTYS */
+
+#if defined(HAVE_SYSV_TTYS)
+#include <termio.h>
+#endif /* HAVE_SYSV_TTYS */
+
+#if defined(HAVE_TERMIOS)
+#include <termios.h>
+#endif
+
+/*
+ * This driver supports the ARCRON MSF/DCF/WWVB Radio Controlled Clock
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/arc%d" /* Device name and unit. */
+#define SPEED B300 /* UART speed (300 baud) */
+#define PRECISION (-4) /* Precision (~63 ms). */
+#define HIGHPRECISION (-5) /* If things are going well... */
+#define REFID "MSFa" /* Reference ID. */
+#define REFID_MSF "MSF" /* Reference ID. */
+#define REFID_DCF77 "DCF" /* Reference ID. */
+#define REFID_WWVB "WWVB" /* Reference ID. */
+#define DESCRIPTION "ARCRON MSF/DCF/WWVB Receiver"
+
+#ifdef PRE_NTP420
+#define MODE ttlmax
+#else
+#define MODE ttl
+#endif
+
+#define LENARC 16 /* Format `o' timecode length. */
+
+#define BITSPERCHAR 11 /* Bits per character. */
+#define BITTIME 0x0DA740E /* Time for 1 bit at 300bps. */
+#define CHARTIME10 0x8888888 /* Time for 10-bit char at 300bps. */
+#define CHARTIME11 0x962FC96 /* Time for 11-bit char at 300bps. */
+#define CHARTIME /* Time for char at 300bps. */ \
+( (BITSPERCHAR == 11) ? CHARTIME11 : ( (BITSPERCHAR == 10) ? CHARTIME10 : \
+ (BITSPERCHAR * BITTIME) ) )
+
+ /* Allow for UART to accept char half-way through final stop bit. */
+#define INITIALOFFSET ((u_int32)(-BITTIME/2))
+
+ /*
+ charoffsets[x] is the time after the start of the second that byte
+ x (with the first byte being byte 1) is received by the UART,
+ assuming that the initial edge of the start bit of the first byte
+ is on-time. The values are represented as the fractional part of
+ an l_fp.
+
+ We store enough values to have the offset of each byte including
+ the trailing \r, on the assumption that the bytes follow one
+ another without gaps.
+ */
+ static const u_int32 charoffsets[LENARC+1] = {
+#if BITSPERCHAR == 11 /* Usual case. */
+ /* Offsets computed as accurately as possible... */
+ 0,
+ INITIALOFFSET + 0x0962fc96, /* 1 chars, 11 bits */
+ INITIALOFFSET + 0x12c5f92c, /* 2 chars, 22 bits */
+ INITIALOFFSET + 0x1c28f5c3, /* 3 chars, 33 bits */
+ INITIALOFFSET + 0x258bf259, /* 4 chars, 44 bits */
+ INITIALOFFSET + 0x2eeeeeef, /* 5 chars, 55 bits */
+ INITIALOFFSET + 0x3851eb85, /* 6 chars, 66 bits */
+ INITIALOFFSET + 0x41b4e81b, /* 7 chars, 77 bits */
+ INITIALOFFSET + 0x4b17e4b1, /* 8 chars, 88 bits */
+ INITIALOFFSET + 0x547ae148, /* 9 chars, 99 bits */
+ INITIALOFFSET + 0x5dddddde, /* 10 chars, 110 bits */
+ INITIALOFFSET + 0x6740da74, /* 11 chars, 121 bits */
+ INITIALOFFSET + 0x70a3d70a, /* 12 chars, 132 bits */
+ INITIALOFFSET + 0x7a06d3a0, /* 13 chars, 143 bits */
+ INITIALOFFSET + 0x8369d037, /* 14 chars, 154 bits */
+ INITIALOFFSET + 0x8ccccccd, /* 15 chars, 165 bits */
+ INITIALOFFSET + 0x962fc963 /* 16 chars, 176 bits */
+#else
+ /* Offsets computed with a small rounding error... */
+ 0,
+ INITIALOFFSET + 1 * CHARTIME,
+ INITIALOFFSET + 2 * CHARTIME,
+ INITIALOFFSET + 3 * CHARTIME,
+ INITIALOFFSET + 4 * CHARTIME,
+ INITIALOFFSET + 5 * CHARTIME,
+ INITIALOFFSET + 6 * CHARTIME,
+ INITIALOFFSET + 7 * CHARTIME,
+ INITIALOFFSET + 8 * CHARTIME,
+ INITIALOFFSET + 9 * CHARTIME,
+ INITIALOFFSET + 10 * CHARTIME,
+ INITIALOFFSET + 11 * CHARTIME,
+ INITIALOFFSET + 12 * CHARTIME,
+ INITIALOFFSET + 13 * CHARTIME,
+ INITIALOFFSET + 14 * CHARTIME,
+ INITIALOFFSET + 15 * CHARTIME,
+ INITIALOFFSET + 16 * CHARTIME
+#endif
+ };
+
+#define DEFAULT_RESYNC_TIME (57*60) /* Gap between resync attempts (s). */
+#define RETRY_RESYNC_TIME (27*60) /* Gap to emergency resync attempt. */
+#ifdef ARCRON_KEEN
+#define INITIAL_RESYNC_DELAY 500 /* Delay before first resync. */
+#else
+#define INITIAL_RESYNC_DELAY 50 /* Delay before first resync. */
+#endif
+
+ static const int moff[12] =
+{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+/* Flags for a raw open() of the clock serial device. */
+#ifdef O_NOCTTY /* Good, we can avoid tty becoming controlling tty. */
+#define OPEN_FLAGS (O_RDWR | O_NOCTTY)
+#else /* Oh well, it may not matter... */
+#define OPEN_FLAGS (O_RDWR)
+#endif
+
+
+/* Length of queue of command bytes to be sent. */
+#define CMDQUEUELEN 4 /* Enough for two cmds + each \r. */
+/* Queue tick time; interval in seconds between chars taken off queue. */
+/* Must be >= 2 to allow o\r response to come back uninterrupted. */
+#define QUEUETICK 2 /* Allow o\r reply to finish. */
+
+/*
+ * ARC unit control structure
+ */
+struct arcunit {
+ l_fp lastrec; /* Time tag for the receive time (system). */
+ int status; /* Clock status. */
+
+ int quality; /* Quality of reception 0--5 for unit. */
+ /* We may also use the values -1 or 6 internally. */
+ u_long quality_stamp; /* Next time to reset quality average. */
+
+ u_long next_resync; /* Next resync time (s) compared to current_time. */
+ int resyncing; /* Resync in progress if true. */
+
+ /* In the outgoing queue, cmdqueue[0] is next to be sent. */
+ char cmdqueue[CMDQUEUELEN+1]; /* Queue of outgoing commands + \0. */
+
+ u_long saved_flags; /* Saved fudge flags. */
+};
+
+#ifdef ARCRON_LEAPSECOND_KEEN
+/* The flag `possible_leap' is set non-zero when any MSF unit
+ thinks a leap-second may have happened.
+
+ Set whenever we receive a valid time sample in the first hour of
+ the first day of the first/seventh months.
+
+ Outside the special hour this value is unconditionally set
+ to zero by the receive routine.
+
+ On finding itself in this timeslot, as long as the value is
+ non-negative, the receive routine sets it to a positive value to
+ indicate a resync to MSF should be performed.
+
+ In the poll routine, if this value is positive and we are not
+ already resyncing (eg from a sync that started just before
+ midnight), start resyncing and set this value negative to
+ indicate that a leap-triggered resync has been started. Having
+ set this negative prevents the receive routine setting it
+ positive and thus prevents multiple resyncs during the witching
+ hour.
+ */
+static int possible_leap = 0; /* No resync required by default. */
+#endif
+
+#if 0
+static void dummy_event_handler (struct peer *);
+static void arc_event_handler (struct peer *);
+#endif /* 0 */
+
+#define QUALITY_UNKNOWN -1 /* Indicates unknown clock quality. */
+#define MIN_CLOCK_QUALITY 0 /* Min quality clock will return. */
+#define MIN_CLOCK_QUALITY_OK 3 /* Min quality for OK reception. */
+#define MAX_CLOCK_QUALITY 5 /* Max quality clock will return. */
+
+/*
+ * Function prototypes
+ */
+static int arc_start (int, struct peer *);
+static void arc_shutdown (int, struct peer *);
+static void arc_receive (struct recvbuf *);
+static void arc_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_arc = {
+ arc_start, /* start up driver */
+ arc_shutdown, /* shut down driver */
+ arc_poll, /* transmit poll message */
+ noentry, /* not used (old arc_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old arc_buginfo) */
+ NOFLAGS /* not used */
+};
+
+/* Queue us up for the next tick. */
+#define ENQUEUE(up) \
+ do { \
+ peer->procptr->nextaction = current_time + QUEUETICK; \
+ } while(0)
+
+/* Placeholder event handler---does nothing safely---soaks up loose tick. */
+static void
+dummy_event_handler(
+ struct peer *peer
+ )
+{
+#ifdef DEBUG
+ if(debug) { printf("arc: dummy_event_handler() called.\n"); }
+#endif
+}
+
+/*
+Normal event handler.
+
+Take first character off queue and send to clock if not a null.
+
+Shift characters down and put a null on the end.
+
+We assume that there is no parallelism so no race condition, but even
+if there is nothing bad will happen except that we might send some bad
+data to the clock once in a while.
+*/
+static void
+arc_event_handler(
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp = peer->procptr;
+ register struct arcunit *up = pp->unitptr;
+ int i;
+ char c;
+#ifdef DEBUG
+ if(debug > 2) { printf("arc: arc_event_handler() called.\n"); }
+#endif
+
+ c = up->cmdqueue[0]; /* Next char to be sent. */
+ /* Shift down characters, shifting trailing \0 in at end. */
+ for(i = 0; i < CMDQUEUELEN; ++i)
+ { up->cmdqueue[i] = up->cmdqueue[i+1]; }
+
+ /* Don't send '\0' characters. */
+ if(c != '\0') {
+ if(write(pp->io.fd, &c, 1) != 1) {
+ msyslog(LOG_NOTICE, "ARCRON: write to fd %d failed", pp->io.fd);
+ }
+#ifdef DEBUG
+ else if(debug) { printf("arc: sent `%2.2x', fd %d.\n", c, pp->io.fd); }
+#endif
+ }
+
+ ENQUEUE(up);
+}
+
+/*
+ * arc_start - open the devices and initialize data for processing
+ */
+static int
+arc_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct arcunit *up;
+ struct refclockproc *pp;
+ int temp_fd;
+ int fd;
+ char device[20];
+#ifdef HAVE_TERMIOS
+ struct termios arg;
+#endif
+
+ msyslog(LOG_NOTICE, "MSF_ARCRON %s: opening unit %d",
+ arc_version, unit);
+ DPRINTF(1, ("arc: %s: attempt to open unit %d.\n", arc_version,
+ unit));
+
+ /*
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ temp_fd = refclock_open(device, SPEED, LDISC_CLK);
+ if (temp_fd <= 0)
+ return 0;
+ DPRINTF(1, ("arc: unit %d using tty_open().\n", unit));
+ fd = tty_open(device, OPEN_FLAGS, 0777);
+ if (fd < 0) {
+ msyslog(LOG_ERR, "MSF_ARCRON(%d): failed second open(%s, 0777): %m.",
+ unit, device);
+ close(temp_fd);
+ return 0;
+ }
+ close(temp_fd);
+ temp_fd = -1;
+
+#ifndef SYS_WINNT
+ if (-1 == fcntl(fd, F_SETFL, 0)) /* clear the descriptor flags */
+ msyslog(LOG_ERR, "MSF_ARCRON(%d): fcntl(F_SETFL, 0): %m.",
+ unit);
+
+#endif
+ DPRINTF(1, ("arc: opened RS232 port with file descriptor %d.\n", fd));
+
+#ifdef HAVE_TERMIOS
+
+ if (tcgetattr(fd, &arg) < 0) {
+ msyslog(LOG_ERR, "MSF_ARCRON(%d): tcgetattr(%s): %m.",
+ unit, device);
+ close(fd);
+ return 0;
+ }
+
+ arg.c_iflag = IGNBRK | ISTRIP;
+ arg.c_oflag = 0;
+ arg.c_cflag = B300 | CS8 | CREAD | CLOCAL | CSTOPB;
+ arg.c_lflag = 0;
+ arg.c_cc[VMIN] = 1;
+ arg.c_cc[VTIME] = 0;
+
+ if (tcsetattr(fd, TCSANOW, &arg) < 0) {
+ msyslog(LOG_ERR, "MSF_ARCRON(%d): tcsetattr(%s): %m.",
+ unit, device);
+ close(fd);
+ return 0;
+ }
+
+#else
+
+ msyslog(LOG_ERR, "ARCRON: termios required by this driver");
+ (void)close(fd);
+
+ return 0;
+
+#endif
+
+ /* Set structure to all zeros... */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = arc_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return(0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ peer->stratum = 2; /* Default to stratum 2 not 0. */
+ pp->clockdesc = DESCRIPTION;
+ if (peer->MODE > 3) {
+ msyslog(LOG_NOTICE, "ARCRON: Invalid mode %d", peer->MODE);
+ return 0;
+ }
+#ifdef DEBUG
+ if(debug) { printf("arc: mode = %d.\n", peer->MODE); }
+#endif
+ switch (peer->MODE) {
+ case 1:
+ memcpy((char *)&pp->refid, REFID_MSF, 4);
+ break;
+ case 2:
+ memcpy((char *)&pp->refid, REFID_DCF77, 4);
+ break;
+ case 3:
+ memcpy((char *)&pp->refid, REFID_WWVB, 4);
+ break;
+ default:
+ memcpy((char *)&pp->refid, REFID, 4);
+ break;
+ }
+ /* Spread out resyncs so that they should remain separated. */
+ up->next_resync = current_time + INITIAL_RESYNC_DELAY + (67*unit)%1009;
+
+#if 0 /* Not needed because of zeroing of arcunit structure... */
+ up->resyncing = 0; /* Not resyncing yet. */
+ up->saved_flags = 0; /* Default is all flags off. */
+ /* Clear send buffer out... */
+ {
+ int i;
+ for(i = CMDQUEUELEN; i >= 0; --i) { up->cmdqueue[i] = '\0'; }
+ }
+#endif
+
+#ifdef ARCRON_KEEN
+ up->quality = QUALITY_UNKNOWN; /* Trust the clock immediately. */
+#else
+ up->quality = MIN_CLOCK_QUALITY;/* Don't trust the clock yet. */
+#endif
+
+ peer->procptr->action = arc_event_handler;
+
+ ENQUEUE(up);
+
+ return(1);
+}
+
+
+/*
+ * arc_shutdown - shut down the clock
+ */
+static void
+arc_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct arcunit *up;
+ struct refclockproc *pp;
+
+ peer->procptr->action = dummy_event_handler;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+/*
+Compute space left in output buffer.
+*/
+static int
+space_left(
+ register struct arcunit *up
+ )
+{
+ int spaceleft;
+
+ /* Compute space left in buffer after any pending output. */
+ for(spaceleft = 0; spaceleft < CMDQUEUELEN; ++spaceleft)
+ { if(up->cmdqueue[CMDQUEUELEN - 1 - spaceleft] != '\0') { break; } }
+ return(spaceleft);
+}
+
+/*
+Send command by copying into command buffer as far forward as possible,
+after any pending output.
+
+Indicate an error by returning 0 if there is not space for the command.
+*/
+static int
+send_slow(
+ register struct arcunit *up,
+ int fd,
+ const char *s
+ )
+{
+ int sl = strlen(s);
+ int spaceleft = space_left(up);
+
+#ifdef DEBUG
+ if(debug > 1) { printf("arc: spaceleft = %d.\n", spaceleft); }
+#endif
+ if(spaceleft < sl) { /* Should not normally happen... */
+#ifdef DEBUG
+ msyslog(LOG_NOTICE, "ARCRON: send-buffer overrun (%d/%d)",
+ sl, spaceleft);
+#endif
+ return(0); /* FAILED! */
+ }
+
+ /* Copy in the command to be sent. */
+ while(*s && spaceleft > 0) { up->cmdqueue[CMDQUEUELEN - spaceleft--] = *s++; }
+
+ return(1);
+}
+
+
+static int
+get2(char *p, int *val)
+{
+ if (!isdigit((int)p[0]) || !isdigit((int)p[1])) return 0;
+ *val = (p[0] - '0') * 10 + p[1] - '0';
+ return 1;
+}
+
+static int
+get1(char *p, int *val)
+{
+ if (!isdigit((int)p[0])) return 0;
+ *val = p[0] - '0';
+ return 1;
+}
+
+/* Macro indicating action we will take for different quality values. */
+#define quality_action(q) \
+(((q) == QUALITY_UNKNOWN) ? "UNKNOWN, will use clock anyway" : \
+ (((q) < MIN_CLOCK_QUALITY_OK) ? "TOO POOR, will not use clock" : \
+ "OK, will use clock"))
+
+/*
+ * arc_receive - receive data from the serial interface
+ */
+static void
+arc_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct arcunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ char c;
+ int i, n, wday, month, flags, status;
+ int arc_last_offset;
+ static int quality_average = 0;
+ static int quality_sum = 0;
+ static int quality_polls = 0;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+
+ /*
+ If the command buffer is empty, and we are resyncing, insert a
+ g\r quality request into it to poll for signal quality again.
+ */
+ if((up->resyncing) && (space_left(up) == CMDQUEUELEN)) {
+#ifdef DEBUG
+ if(debug > 1) { printf("arc: inserting signal-quality poll.\n"); }
+#endif
+ send_slow(up, pp->io.fd, "g\r");
+ }
+
+ /*
+ The `arc_last_offset' is the offset in lastcode[] of the last byte
+ received, and which we assume actually received the input
+ timestamp.
+
+ (When we get round to using tty_clk and it is available, we
+ assume that we will receive the whole timecode with the
+ trailing \r, and that that \r will be timestamped. But this
+ assumption also works if receive the characters one-by-one.)
+ */
+ arc_last_offset = pp->lencode+rbufp->recv_length - 1;
+
+ /*
+ We catch a timestamp iff:
+
+ * The command code is `o' for a timestamp.
+
+ * If ARCRON_MULTIPLE_SAMPLES is undefined then we must have
+ exactly char in the buffer (the command code) so that we
+ only sample the first character of the timecode as our
+ `on-time' character.
+
+ * The first character in the buffer is not the echoed `\r'
+ from the `o` command (so if we are to timestamp an `\r' it
+ must not be first in the receive buffer with lencode==1.
+ (Even if we had other characters following it, we probably
+ would have a premature timestamp on the '\r'.)
+
+ * We have received at least one character (I cannot imagine
+ how it could be otherwise, but anyway...).
+ */
+ c = rbufp->recv_buffer[0];
+ if((pp->a_lastcode[0] == 'o') &&
+#ifndef ARCRON_MULTIPLE_SAMPLES
+ (pp->lencode == 1) &&
+#endif
+ ((pp->lencode != 1) || (c != '\r')) &&
+ (arc_last_offset >= 1)) {
+ /* Note that the timestamp should be corrected if >1 char rcvd. */
+ l_fp timestamp;
+ timestamp = rbufp->recv_time;
+#ifdef DEBUG
+ if(debug) { /* Show \r as `R', other non-printing char as `?'. */
+ printf("arc: stamp -->%c<-- (%d chars rcvd)\n",
+ ((c == '\r') ? 'R' : (isgraph((int)c) ? c : '?')),
+ rbufp->recv_length);
+ }
+#endif
+
+ /*
+ Now correct timestamp by offset of last byte received---we
+ subtract from the receive time the delay implied by the
+ extra characters received.
+
+ Reject the input if the resulting code is too long, but
+ allow for the trailing \r, normally not used but a good
+ handle for tty_clk or somesuch kernel timestamper.
+ */
+ if(arc_last_offset > LENARC) {
+#ifdef DEBUG
+ if(debug) {
+ printf("arc: input code too long (%d cf %d); rejected.\n",
+ arc_last_offset, LENARC);
+ }
+#endif
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ L_SUBUF(&timestamp, charoffsets[arc_last_offset]);
+#ifdef DEBUG
+ if(debug > 1) {
+ printf(
+ "arc: %s%d char(s) rcvd, the last for lastcode[%d]; -%sms offset applied.\n",
+ ((rbufp->recv_length > 1) ? "*** " : ""),
+ rbufp->recv_length,
+ arc_last_offset,
+ mfptoms((unsigned long)0,
+ charoffsets[arc_last_offset],
+ 1));
+ }
+#endif
+
+#ifdef ARCRON_MULTIPLE_SAMPLES
+ /*
+ If taking multiple samples, capture the current adjusted
+ sample iff:
+
+ * No timestamp has yet been captured (it is zero), OR
+
+ * This adjusted timestamp is earlier than the one already
+ captured, on the grounds that this one suffered less
+ delay in being delivered to us and is more accurate.
+
+ */
+ if(L_ISZERO(&(up->lastrec)) ||
+ L_ISGEQ(&(up->lastrec), &timestamp))
+#endif
+ {
+#ifdef DEBUG
+ if(debug > 1) {
+ printf("arc: system timestamp captured.\n");
+#ifdef ARCRON_MULTIPLE_SAMPLES
+ if(!L_ISZERO(&(up->lastrec))) {
+ l_fp diff;
+ diff = up->lastrec;
+ L_SUB(&diff, &timestamp);
+ printf("arc: adjusted timestamp by -%sms.\n",
+ mfptoms(diff.l_ui, diff.l_uf, 3));
+ }
+#endif
+ }
+#endif
+ up->lastrec = timestamp;
+ }
+
+ }
+
+ /* Just in case we still have lots of rubbish in the buffer... */
+ /* ...and to avoid the same timestamp being reused by mistake, */
+ /* eg on receipt of the \r coming in on its own after the */
+ /* timecode. */
+ if(pp->lencode >= LENARC) {
+#ifdef DEBUG
+ if(debug && (rbufp->recv_buffer[0] != '\r'))
+ { printf("arc: rubbish in pp->a_lastcode[].\n"); }
+#endif
+ pp->lencode = 0;
+ return;
+ }
+
+ /* Append input to code buffer, avoiding overflow. */
+ for(i = 0; i < rbufp->recv_length; i++) {
+ if(pp->lencode >= LENARC) { break; } /* Avoid overflow... */
+ c = rbufp->recv_buffer[i];
+
+ /* Drop trailing '\r's and drop `h' command echo totally. */
+ if(c != '\r' && c != 'h') { pp->a_lastcode[pp->lencode++] = c; }
+
+ /*
+ If we've just put an `o' in the lastcode[0], clear the
+ timestamp in anticipation of a timecode arriving soon.
+
+ We would expect to get to process this before any of the
+ timecode arrives.
+ */
+ if((c == 'o') && (pp->lencode == 1)) {
+ L_CLR(&(up->lastrec));
+#ifdef DEBUG
+ if(debug > 1) { printf("arc: clearing timestamp.\n"); }
+#endif
+ }
+ }
+ if (pp->lencode == 0) return;
+
+ /* Handle a quality message. */
+ if(pp->a_lastcode[0] == 'g') {
+ int r, q;
+
+ if(pp->lencode < 3) { return; } /* Need more data... */
+ r = (pp->a_lastcode[1] & 0x7f); /* Strip parity. */
+ q = (pp->a_lastcode[2] & 0x7f); /* Strip parity. */
+ if(((q & 0x70) != 0x30) || ((q & 0xf) > MAX_CLOCK_QUALITY) ||
+ ((r & 0x70) != 0x30)) {
+ /* Badly formatted response. */
+#ifdef DEBUG
+ if(debug) { printf("arc: bad `g' response %2x %2x.\n", r, q); }
+#endif
+ return;
+ }
+ if(r == '3') { /* Only use quality value whilst sync in progress. */
+ if (up->quality_stamp < current_time) {
+ struct calendar cal;
+ l_fp new_stamp;
+
+ get_systime (&new_stamp);
+ caljulian (new_stamp.l_ui, &cal);
+ up->quality_stamp =
+ current_time + 60 - cal.second + 5;
+ quality_sum = 0;
+ quality_polls = 0;
+ }
+ quality_sum += (q & 0xf);
+ quality_polls++;
+ quality_average = (quality_sum / quality_polls);
+#ifdef DEBUG
+ if(debug) { printf("arc: signal quality %d (%d).\n", quality_average, (q & 0xf)); }
+#endif
+ } else if( /* (r == '2') && */ up->resyncing) {
+ up->quality = quality_average;
+#ifdef DEBUG
+ if(debug)
+ {
+ printf("arc: sync finished, signal quality %d: %s\n",
+ up->quality,
+ quality_action(up->quality));
+ }
+#endif
+ msyslog(LOG_NOTICE,
+ "ARCRON: sync finished, signal quality %d: %s",
+ up->quality,
+ quality_action(up->quality));
+ up->resyncing = 0; /* Resync is over. */
+ quality_average = 0;
+ quality_sum = 0;
+ quality_polls = 0;
+
+#ifdef ARCRON_KEEN
+ /* Clock quality dubious; resync earlier than usual. */
+ if((up->quality == QUALITY_UNKNOWN) ||
+ (up->quality < MIN_CLOCK_QUALITY_OK))
+ { up->next_resync = current_time + RETRY_RESYNC_TIME; }
+#endif
+ }
+ pp->lencode = 0;
+ return;
+ }
+
+ /* Stop now if this is not a timecode message. */
+ if(pp->a_lastcode[0] != 'o') {
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /* If we don't have enough data, wait for more... */
+ if(pp->lencode < LENARC) { return; }
+
+
+ /* WE HAVE NOW COLLECTED ONE TIMESTAMP (phew)... */
+#ifdef DEBUG
+ if(debug > 1) { printf("arc: NOW HAVE TIMESTAMP...\n"); }
+#endif
+
+ /* But check that we actually captured a system timestamp on it. */
+ if(L_ISZERO(&(up->lastrec))) {
+#ifdef DEBUG
+ if(debug) { printf("arc: FAILED TO GET SYSTEM TIMESTAMP\n"); }
+#endif
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ /*
+ Append a mark of the clock's received signal quality for the
+ benefit of Derek Mulcahy's Tcl/Tk utility (we map the `unknown'
+ quality value to `6' for his s/w) and terminate the string for
+ sure. This should not go off the buffer end.
+ */
+ pp->a_lastcode[pp->lencode] = ((up->quality == QUALITY_UNKNOWN) ?
+ '6' : ('0' + up->quality));
+ pp->a_lastcode[pp->lencode + 1] = '\0'; /* Terminate for printf(). */
+
+#ifdef PRE_NTP420
+ /* We don't use the micro-/milli- second part... */
+ pp->usec = 0;
+ pp->msec = 0;
+#else
+ /* We don't use the nano-second part... */
+ pp->nsec = 0;
+#endif
+ /* Validate format and numbers. */
+ if (pp->a_lastcode[0] != 'o'
+ || !get2(pp->a_lastcode + 1, &pp->hour)
+ || !get2(pp->a_lastcode + 3, &pp->minute)
+ || !get2(pp->a_lastcode + 5, &pp->second)
+ || !get1(pp->a_lastcode + 7, &wday)
+ || !get2(pp->a_lastcode + 8, &pp->day)
+ || !get2(pp->a_lastcode + 10, &month)
+ || !get2(pp->a_lastcode + 12, &pp->year)) {
+#ifdef DEBUG
+ /* Would expect to have caught major problems already... */
+ if(debug) { printf("arc: badly formatted data.\n"); }
+#endif
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ flags = pp->a_lastcode[14];
+ status = pp->a_lastcode[15];
+#ifdef DEBUG
+ if(debug) { printf("arc: status 0x%.2x flags 0x%.2x\n", flags, status); }
+#endif
+ n = 9;
+
+ /*
+ Validate received values at least enough to prevent internal
+ array-bounds problems, etc.
+ */
+ if((pp->hour < 0) || (pp->hour > 23) ||
+ (pp->minute < 0) || (pp->minute > 59) ||
+ (pp->second < 0) || (pp->second > 60) /*Allow for leap seconds.*/ ||
+ (wday < 1) || (wday > 7) ||
+ (pp->day < 1) || (pp->day > 31) ||
+ (month < 1) || (month > 12) ||
+ (pp->year < 0) || (pp->year > 99)) {
+ /* Data out of range. */
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+
+ if(peer->MODE == 0) { /* compatiblity to original version */
+ int bst = flags;
+ /* Check that BST/UTC bits are the complement of one another. */
+ if(!(bst & 2) == !(bst & 4)) {
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ }
+ if(status & 0x8) { msyslog(LOG_NOTICE, "ARCRON: battery low"); }
+
+ /* Year-2000 alert! */
+ /* Attempt to wrap 2-digit date into sensible window. */
+ if(pp->year < YEAR_PIVOT) { pp->year += 100; } /* Y2KFixes */
+ pp->year += 1900; /* use full four-digit year */ /* Y2KFixes */
+ /*
+ Attempt to do the right thing by screaming that the code will
+ soon break when we get to the end of its useful life. What a
+ hero I am... PLEASE FIX LEAP-YEAR AND WRAP CODE IN 209X!
+ */
+ if(pp->year >= YEAR_PIVOT+2000-2 ) { /* Y2KFixes */
+ /*This should get attention B^> */
+ msyslog(LOG_NOTICE,
+ "ARCRON: fix me! EITHER YOUR DATE IS BADLY WRONG or else I will break soon!");
+ }
+#ifdef DEBUG
+ if(debug) {
+ printf("arc: n=%d %02d:%02d:%02d %02d/%02d/%04d %1d %1d\n",
+ n,
+ pp->hour, pp->minute, pp->second,
+ pp->day, month, pp->year, flags, status);
+ }
+#endif
+
+ /*
+ The status value tested for is not strictly supported by the
+ clock spec since the value of bit 2 (0x4) is claimed to be
+ undefined for MSF, yet does seem to indicate if the last resync
+ was successful or not.
+ */
+ pp->leap = LEAP_NOWARNING;
+ status &= 0x7;
+ if(status == 0x3) {
+ if(status != up->status)
+ { msyslog(LOG_NOTICE, "ARCRON: signal acquired"); }
+ } else {
+ if(status != up->status) {
+ msyslog(LOG_NOTICE, "ARCRON: signal lost");
+ pp->leap = LEAP_NOTINSYNC; /* MSF clock is free-running. */
+ up->status = status;
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+ }
+ up->status = status;
+
+ if (peer->MODE == 0) { /* compatiblity to original version */
+ int bst = flags;
+
+ pp->day += moff[month - 1];
+
+ if(isleap_4(pp->year) && month > 2) { pp->day++; }/* Y2KFixes */
+
+ /* Convert to UTC if required */
+ if(bst & 2) {
+ pp->hour--;
+ if (pp->hour < 0) {
+ pp->hour = 23;
+ pp->day--;
+ /* If we try to wrap round the year
+ * (BST on 1st Jan), reject.*/
+ if(pp->day < 0) {
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ }
+ }
+ }
+
+ if(peer->MODE > 0) {
+ if(pp->sloppyclockflag & CLK_FLAG1) {
+ struct tm local;
+ struct tm *gmtp;
+ time_t unixtime;
+
+ /*
+ * Convert to GMT for sites that distribute localtime.
+ * This means we have to do Y2K conversion on the
+ * 2-digit year; otherwise, we get the time wrong.
+ */
+
+ memset(&local, 0, sizeof(local));
+
+ local.tm_year = pp->year-1900;
+ local.tm_mon = month-1;
+ local.tm_mday = pp->day;
+ local.tm_hour = pp->hour;
+ local.tm_min = pp->minute;
+ local.tm_sec = pp->second;
+ switch (peer->MODE) {
+ case 1:
+ local.tm_isdst = (flags & 2);
+ break;
+ case 2:
+ local.tm_isdst = (flags & 2);
+ break;
+ case 3:
+ switch (flags & 3) {
+ case 0: /* It is unclear exactly when the
+ Arcron changes from DST->ST and
+ ST->DST. Testing has shown this
+ to be irregular. For the time
+ being, let the OS decide. */
+ local.tm_isdst = 0;
+#ifdef DEBUG
+ if (debug)
+ printf ("arc: DST = 00 (0)\n");
+#endif
+ break;
+ case 1: /* dst->st time */
+ local.tm_isdst = -1;
+#ifdef DEBUG
+ if (debug)
+ printf ("arc: DST = 01 (1)\n");
+#endif
+ break;
+ case 2: /* st->dst time */
+ local.tm_isdst = -1;
+#ifdef DEBUG
+ if (debug)
+ printf ("arc: DST = 10 (2)\n");
+#endif
+ break;
+ case 3: /* dst time */
+ local.tm_isdst = 1;
+#ifdef DEBUG
+ if (debug)
+ printf ("arc: DST = 11 (3)\n");
+#endif
+ break;
+ }
+ break;
+ default:
+ msyslog(LOG_NOTICE, "ARCRON: Invalid mode %d",
+ peer->MODE);
+ return;
+ break;
+ }
+ unixtime = mktime (&local);
+ if ((gmtp = gmtime (&unixtime)) == NULL)
+ {
+ pp->lencode = 0;
+ refclock_report (peer, CEVNT_FAULT);
+ return;
+ }
+ pp->year = gmtp->tm_year+1900;
+ month = gmtp->tm_mon+1;
+ pp->day = ymd2yd(pp->year,month,gmtp->tm_mday);
+ /* pp->day = gmtp->tm_yday; */
+ pp->hour = gmtp->tm_hour;
+ pp->minute = gmtp->tm_min;
+ pp->second = gmtp->tm_sec;
+#ifdef DEBUG
+ if (debug)
+ {
+ printf ("arc: time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
+ pp->year,month,gmtp->tm_mday,pp->hour,pp->minute,
+ pp->second);
+ }
+#endif
+ } else
+ {
+ /*
+ * For more rational sites distributing UTC
+ */
+ pp->day = ymd2yd(pp->year,month,pp->day);
+ }
+ }
+
+ if (peer->MODE == 0) { /* compatiblity to original version */
+ /* If clock signal quality is
+ * unknown, revert to default PRECISION...*/
+ if(up->quality == QUALITY_UNKNOWN) {
+ peer->precision = PRECISION;
+ } else { /* ...else improve precision if flag3 is set... */
+ peer->precision = ((pp->sloppyclockflag & CLK_FLAG3) ?
+ HIGHPRECISION : PRECISION);
+ }
+ } else {
+ if ((status == 0x3) && (pp->sloppyclockflag & CLK_FLAG2)) {
+ peer->precision = ((pp->sloppyclockflag & CLK_FLAG3) ?
+ HIGHPRECISION : PRECISION);
+ } else if (up->quality == QUALITY_UNKNOWN) {
+ peer->precision = PRECISION;
+ } else {
+ peer->precision = ((pp->sloppyclockflag & CLK_FLAG3) ?
+ HIGHPRECISION : PRECISION);
+ }
+ }
+
+ /* Notice and log any change (eg from initial defaults) for flags. */
+ if(up->saved_flags != pp->sloppyclockflag) {
+#ifdef DEBUG
+ msyslog(LOG_NOTICE, "ARCRON: flags enabled: %s%s%s%s",
+ ((pp->sloppyclockflag & CLK_FLAG1) ? "1" : "."),
+ ((pp->sloppyclockflag & CLK_FLAG2) ? "2" : "."),
+ ((pp->sloppyclockflag & CLK_FLAG3) ? "3" : "."),
+ ((pp->sloppyclockflag & CLK_FLAG4) ? "4" : "."));
+ /* Note effects of flags changing... */
+ if(debug) {
+ printf("arc: PRECISION = %d.\n", peer->precision);
+ }
+#endif
+ up->saved_flags = pp->sloppyclockflag;
+ }
+
+ /* Note time of last believable timestamp. */
+ pp->lastrec = up->lastrec;
+
+#ifdef ARCRON_LEAPSECOND_KEEN
+ /* Find out if a leap-second might just have happened...
+ (ie is this the first hour of the first day of Jan or Jul?)
+ */
+ if((pp->hour == 0) &&
+ (pp->day == 1) &&
+ ((month == 1) || (month == 7))) {
+ if(possible_leap >= 0) {
+ /* A leap may have happened, and no resync has started yet...*/
+ possible_leap = 1;
+ }
+ } else {
+ /* Definitely not leap-second territory... */
+ possible_leap = 0;
+ }
+#endif
+
+ if (!refclock_process(pp)) {
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ refclock_receive(peer);
+}
+
+
+/* request_time() sends a time request to the clock with given peer. */
+/* This automatically reports a fault if necessary. */
+/* No data should be sent after this until arc_poll() returns. */
+static void request_time (int, struct peer *);
+static void
+request_time(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp = peer->procptr;
+ register struct arcunit *up = pp->unitptr;
+#ifdef DEBUG
+ if(debug) { printf("arc: unit %d: requesting time.\n", unit); }
+#endif
+ if (!send_slow(up, pp->io.fd, "o\r")) {
+#ifdef DEBUG
+ if (debug) {
+ printf("arc: unit %d: problem sending", unit);
+ }
+#endif
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+ pp->polls++;
+}
+
+/*
+ * arc_poll - called by the transmit procedure
+ */
+static void
+arc_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct arcunit *up;
+ struct refclockproc *pp;
+ int resync_needed; /* Should we start a resync? */
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+#if 0
+ pp->lencode = 0;
+ memset(pp->a_lastcode, 0, sizeof(pp->a_lastcode));
+#endif
+
+#if 0
+ /* Flush input. */
+ tcflush(pp->io.fd, TCIFLUSH);
+#endif
+
+ /* Resync if our next scheduled resync time is here or has passed. */
+ resync_needed = ( !(pp->sloppyclockflag & CLK_FLAG2) &&
+ (up->next_resync <= current_time) );
+
+#ifdef ARCRON_LEAPSECOND_KEEN
+ /*
+ Try to catch a potential leap-second insertion or deletion quickly.
+
+ In addition to the normal NTP fun of clocks that don't report
+ leap-seconds spooking their hosts, this clock does not even
+ sample the radio sugnal the whole time, so may miss a
+ leap-second insertion or deletion for up to a whole sample
+ time.
+
+ To try to minimise this effect, if in the first few minutes of
+ the day immediately following a leap-second-insertion point
+ (ie in the first hour of the first day of the first and sixth
+ months), and if the last resync was in the previous day, and a
+ resync is not already in progress, resync the clock
+ immediately.
+
+ */
+ if((possible_leap > 0) && /* Must be 00:XX 01/0{1,7}/XXXX. */
+ (!up->resyncing)) { /* No resync in progress yet. */
+ resync_needed = 1;
+ possible_leap = -1; /* Prevent multiple resyncs. */
+ msyslog(LOG_NOTICE,"ARCRON: unit %d: checking for leap second",unit);
+ }
+#endif
+
+ /* Do a resync if required... */
+ if(resync_needed) {
+ /* First, reset quality value to `unknown' so we can detect */
+ /* when a quality message has been responded to by this */
+ /* being set to some other value. */
+ up->quality = QUALITY_UNKNOWN;
+
+ /* Note that we are resyncing... */
+ up->resyncing = 1;
+
+ /* Now actually send the resync command and an immediate poll. */
+#ifdef DEBUG
+ if(debug) { printf("arc: sending resync command (h\\r).\n"); }
+#endif
+ msyslog(LOG_NOTICE, "ARCRON: unit %d: sending resync command", unit);
+ send_slow(up, pp->io.fd, "h\r");
+
+ /* Schedule our next resync... */
+ up->next_resync = current_time + DEFAULT_RESYNC_TIME;
+
+ /* Drop through to request time if appropriate. */
+ }
+
+ /* If clock quality is too poor to trust, indicate a fault. */
+ /* If quality is QUALITY_UNKNOWN and ARCRON_KEEN is defined,*/
+ /* we'll cross our fingers and just hope that the thing */
+ /* synced so quickly we did not catch it---we'll */
+ /* double-check the clock is OK elsewhere. */
+ if(
+#ifdef ARCRON_KEEN
+ (up->quality != QUALITY_UNKNOWN) &&
+#else
+ (up->quality == QUALITY_UNKNOWN) ||
+#endif
+ (up->quality < MIN_CLOCK_QUALITY_OK)) {
+#ifdef DEBUG
+ if(debug) {
+ printf("arc: clock quality %d too poor.\n", up->quality);
+ }
+#endif
+ pp->lencode = 0;
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+ /* This is the normal case: request a timestamp. */
+ request_time(unit, peer);
+}
+
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif
diff --git a/ntpd/refclock_as2201.c b/ntpd/refclock_as2201.c
new file mode 100644
index 0000000..1acf9b2
--- /dev/null
+++ b/ntpd/refclock_as2201.c
@@ -0,0 +1,388 @@
+/*
+ * refclock_as2201 - clock driver for the Austron 2201A GPS
+ * Timing Receiver
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_AS2201)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+/*
+ * This driver supports the Austron 2200A/2201A GPS Receiver with
+ * Buffered RS-232-C Interface Module. Note that the original 2200/2201
+ * receivers will not work reliably with this driver, since the older
+ * design cannot accept input commands at any reasonable data rate.
+ *
+ * The program sends a "*toc\r" to the radio and expects a response of
+ * the form "yy:ddd:hh:mm:ss.mmm\r" where yy = year of century, ddd =
+ * day of year, hh:mm:ss = second of day and mmm = millisecond of
+ * second. Then, it sends statistics commands to the radio and expects
+ * a multi-line reply showing the corresponding statistics or other
+ * selected data. Statistics commands are sent in order as determined by
+ * a vector of commands; these might have to be changed with different
+ * radio options. If flag4 of the fudge configuration command is set to
+ * 1, the statistics data are written to the clockstats file for later
+ * processing.
+ *
+ * In order for this code to work, the radio must be placed in non-
+ * interactive mode using the "off" command and with a single <cr>
+ * response using the "term cr" command. The setting of the "echo"
+ * and "df" commands does not matter. The radio should select UTC
+ * timescale using the "ts utc" command.
+ *
+ * There are two modes of operation for this driver. The first with
+ * default configuration is used with stock kernels and serial-line
+ * drivers and works with almost any machine. In this mode the driver
+ * assumes the radio captures a timestamp upon receipt of the "*" that
+ * begins the driver query. Accuracies in this mode are in the order of
+ * a millisecond or two and the receiver can be connected to only one
+ * host.
+ *
+ * The second mode of operation can be used for SunOS kernels that have
+ * been modified with the ppsclock streams module included in this
+ * distribution. The mode is enabled if flag3 of the fudge configuration
+ * command has been set to 1. In this mode a precise timestamp is
+ * available using a gadget box and 1-pps signal from the receiver. This
+ * improves the accuracy to the order of a few tens of microseconds. In
+ * addition, the serial output and 1-pps signal can be bussed to more
+ * than one hosts, but only one of them should be connected to the
+ * radio input data line.
+ */
+
+/*
+ * GPS Definitions
+ */
+#define SMAX 200 /* statistics buffer length */
+#define DEVICE "/dev/gps%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "GPS\0" /* reference ID */
+#define DESCRIPTION "Austron 2201A GPS Receiver" /* WRU */
+
+#define LENTOC 19 /* yy:ddd:hh:mm:ss.mmm timecode lngth */
+
+/*
+ * AS2201 unit control structure.
+ */
+struct as2201unit {
+ char *lastptr; /* statistics buffer pointer */
+ char stats[SMAX]; /* statistics buffer */
+ int linect; /* count of lines remaining */
+ int index; /* current statistics command */
+};
+
+/*
+ * Radio commands to extract statitistics
+ *
+ * A command consists of an ASCII string terminated by a <cr> (\r). The
+ * command list consist of a sequence of commands terminated by a null
+ * string ("\0"). One command from the list is sent immediately
+ * following each received timecode (*toc\r command) and the ASCII
+ * strings received from the radio are saved along with the timecode in
+ * the clockstats file. Subsequent commands are sent at each timecode,
+ * with the last one in the list followed by the first one. The data
+ * received from the radio consist of ASCII strings, each terminated by
+ * a <cr> (\r) character. The number of strings for each command is
+ * specified as the first line of output as an ASCII-encode number. Note
+ * that the ETF command requires the Input Buffer Module and the LORAN
+ * commands require the LORAN Assist Module. However, if these modules
+ * are not installed, the radio and this driver will continue to operate
+ * successfuly, but no data will be captured for these commands.
+ */
+static char stat_command[][30] = {
+ "ITF\r", /* internal time/frequency */
+ "ETF\r", /* external time/frequency */
+ "LORAN ENSEMBLE\r", /* GPS/LORAN ensemble statistics */
+ "LORAN TDATA\r", /* LORAN signal data */
+ "ID;OPT;VER\r", /* model; options; software version */
+
+ "ITF\r", /* internal time/frequency */
+ "ETF\r", /* external time/frequency */
+ "LORAN ENSEMBLE\r", /* GPS/LORAN ensemble statistics */
+ "TRSTAT\r", /* satellite tracking status */
+ "POS;PPS;PPSOFF\r", /* position, pps source, offsets */
+
+ "ITF\r", /* internal time/frequency */
+ "ETF\r", /* external time/frequency */
+ "LORAN ENSEMBLE\r", /* GPS/LORAN ensemble statistics */
+ "LORAN TDATA\r", /* LORAN signal data */
+ "UTC\r", /* UTC leap info */
+
+ "ITF\r", /* internal time/frequency */
+ "ETF\r", /* external time/frequency */
+ "LORAN ENSEMBLE\r", /* GPS/LORAN ensemble statistics */
+ "TRSTAT\r", /* satellite tracking status */
+ "OSC;ET;TEMP\r", /* osc type; tune volts; oven temp */
+ "\0" /* end of table */
+};
+
+/*
+ * Function prototypes
+ */
+static int as2201_start (int, struct peer *);
+static void as2201_shutdown (int, struct peer *);
+static void as2201_receive (struct recvbuf *);
+static void as2201_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_as2201 = {
+ as2201_start, /* start up driver */
+ as2201_shutdown, /* shut down driver */
+ as2201_poll, /* transmit poll message */
+ noentry, /* not used (old as2201_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old as2201_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * as2201_start - open the devices and initialize data for processing
+ */
+static int
+as2201_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct as2201unit *up;
+ struct refclockproc *pp;
+ int fd;
+ char gpsdev[20];
+
+ /*
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
+ fd = refclock_open(gpsdev, SPEED232, LDISC_CLK);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = as2201_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ up->lastptr = up->stats;
+ up->index = 0;
+ return (1);
+}
+
+
+/*
+ * as2201_shutdown - shut down the clock
+ */
+static void
+as2201_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct as2201unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * as2201__receive - receive data from the serial interface
+ */
+static void
+as2201_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct as2201unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ l_fp trtmp;
+ size_t octets;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp.
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);
+#ifdef DEBUG
+ if (debug)
+ printf("gps: timecode %d %d %s\n",
+ up->linect, pp->lencode, pp->a_lastcode);
+#endif
+ if (pp->lencode == 0)
+ return;
+
+ /*
+ * If linect is greater than zero, we must be in the middle of a
+ * statistics operation, so simply tack the received data at the
+ * end of the statistics string. If not, we could either have
+ * just received the timecode itself or a decimal number
+ * indicating the number of following lines of the statistics
+ * reply. In the former case, write the accumulated statistics
+ * data to the clockstats file and continue onward to process
+ * the timecode; in the later case, save the number of lines and
+ * quietly return.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ pp->lastrec = trtmp;
+ if (up->linect > 0) {
+ up->linect--;
+ if ((int)(up->lastptr - up->stats + pp->lencode) > SMAX - 2)
+ return;
+ *up->lastptr++ = ' ';
+ memcpy(up->lastptr, pp->a_lastcode, 1 + pp->lencode);
+ up->lastptr += pp->lencode;
+ return;
+ } else {
+ if (pp->lencode == 1) {
+ up->linect = atoi(pp->a_lastcode);
+ return;
+ } else {
+ record_clock_stats(&peer->srcadr, up->stats);
+#ifdef DEBUG
+ if (debug)
+ printf("gps: stat %s\n", up->stats);
+#endif
+ }
+ }
+ up->lastptr = up->stats;
+ *up->lastptr = '\0';
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has invalid length or is not in
+ * proper format, we declare bad format and exit.
+ */
+ if (pp->lencode < LENTOC) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Timecode format: "yy:ddd:hh:mm:ss.mmm"
+ */
+ if (sscanf(pp->a_lastcode, "%2d:%3d:%2d:%2d:%2d.%3ld", &pp->year,
+ &pp->day, &pp->hour, &pp->minute, &pp->second, &pp->nsec)
+ != 6) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ pp->nsec *= 1000000;
+
+ /*
+ * Test for synchronization (this is a temporary crock).
+ */
+ if (pp->a_lastcode[2] != ':')
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+ /*
+ * If CLK_FLAG4 is set, initialize the statistics buffer and
+ * send the next command. If not, simply write the timecode to
+ * the clockstats file.
+ */
+ if ((int)(up->lastptr - up->stats + pp->lencode) > SMAX - 2)
+ return;
+ memcpy(up->lastptr, pp->a_lastcode, pp->lencode);
+ up->lastptr += pp->lencode;
+ if (pp->sloppyclockflag & CLK_FLAG4) {
+ octets = strlen(stat_command[up->index]);
+ if ((int)(up->lastptr - up->stats + 1 + octets) > SMAX - 2)
+ return;
+ *up->lastptr++ = ' ';
+ memcpy(up->lastptr, stat_command[up->index], octets);
+ up->lastptr += octets - 1;
+ *up->lastptr = '\0';
+ (void)write(pp->io.fd, stat_command[up->index],
+ strlen(stat_command[up->index]));
+ up->index++;
+ if (*stat_command[up->index] == '\0')
+ up->index = 0;
+ }
+}
+
+
+/*
+ * as2201_poll - called by the transmit procedure
+ *
+ * We go to great pains to avoid changing state here, since there may be
+ * more than one eavesdropper receiving the same timecode.
+ */
+static void
+as2201_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+
+ /*
+ * Send a "\r*toc\r" to get things going. We go to great pains
+ * to avoid changing state, since there may be more than one
+ * eavesdropper watching the radio.
+ */
+ pp = peer->procptr;
+ if (write(pp->io.fd, "\r*toc\r", 6) != 6) {
+ refclock_report(peer, CEVNT_FAULT);
+ } else {
+ pp->polls++;
+ if (!(pp->sloppyclockflag & CLK_FLAG2))
+ get_systime(&pp->lastrec);
+ }
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ refclock_receive(peer);
+}
+
+#else
+int refclock_as2201_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_atom.c b/ntpd/refclock_atom.c
new file mode 100644
index 0000000..b3c0d6b
--- /dev/null
+++ b/ntpd/refclock_atom.c
@@ -0,0 +1,239 @@
+/*
+ * refclock_atom - clock driver for 1-pps signals
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+/*
+ * This driver requires the PPSAPI interface (RFC 2783)
+ */
+#if defined(REFCLOCK) && defined(CLOCK_ATOM) && defined(HAVE_PPSAPI)
+#include "ppsapi_timepps.h"
+#include "refclock_atom.h"
+
+/*
+ * This driver furnishes an interface for pulse-per-second (PPS) signals
+ * produced by a cesium clock, timing receiver or related equipment. It
+ * can be used to remove accumulated jitter over a congested link and
+ * retime a server before redistributing the time to clients. It can
+ *also be used as a holdover should all other synchronization sources
+ * beconme unreachable.
+ *
+ * Before this driver becomes active, the local clock must be set to
+ * within +-0.4 s by another means, such as a radio clock or NTP
+ * itself. There are two ways to connect the PPS signal, normally at TTL
+ * levels, to the computer. One is to shift to EIA levels and connect to
+ * pin 8 (DCD) of a serial port. This requires a level converter and
+ * may require a one-shot flipflop to lengthen the pulse. The other is
+ * to connect the PPS signal directly to pin 10 (ACK) of a PC paralell
+ * port. These methods are architecture dependent.
+ *
+ * This driver requires the Pulse-per-Second API for Unix-like Operating
+ * Systems, Version 1.0, RFC-2783 (PPSAPI). Implementations are
+ * available for FreeBSD, Linux, SunOS, Solaris and Tru64. However, at
+ * present only the Tru64 implementation provides the full generality of
+ * the API with multiple PPS drivers and multiple handles per driver. If
+ * the PPSAPI is normally implemented in the /usr/include/sys/timepps.h
+ * header file and kernel support specific to each operating system.
+ *
+ * This driver normally uses the PLL/FLL clock discipline implemented in
+ * the ntpd code. Ordinarily, this is the most accurate means, as the
+ * median filter in the driver interface is much larger than in the
+ * kernel. However, if the systemic clock frequency error is large (tens
+ * to hundreds of PPM), it's better to used the kernel support, if
+ * available.
+ *
+ * This deriver is subject to the mitigation rules described in the
+ * "mitigation rulse and the prefer peer" page. However, there is an
+ * important difference. If this driver becomes the PPS driver according
+ * to these rules, it is acrive only if (a) a prefer peer other than
+ * this driver is among the survivors or (b) there are no survivors and
+ * the minsane option of the tos command is zero. This is intended to
+ * support space missions where updates from other spacecraft are
+ * infrequent, but a reliable PPS signal, such as from an Ultra Stable
+ * Oscillator (USO) is available.
+ *
+ * Fudge Factors
+ *
+ * The PPS timestamp is captured on the rising (assert) edge if flag2 is
+ * dim (default) and on the falling (clear) edge if lit. If flag3 is dim
+ * (default), the kernel PPS support is disabled; if lit it is enabled.
+ * If flag4 is lit, each timesampt is copied to the clockstats file for
+ * later analysis. This can be useful when constructing Allan deviation
+ * plots. The time1 parameter can be used to compensate for
+ * miscellaneous device driver and OS delays.
+ */
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/pps%d" /* device name and unit */
+#define PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "PPS\0" /* reference ID */
+#define DESCRIPTION "PPS Clock Discipline" /* WRU */
+
+/*
+ * PPS unit control structure
+ */
+struct ppsunit {
+ struct refclock_atom atom; /* atom structure pointer */
+ int fddev; /* file descriptor */
+};
+
+/*
+ * Function prototypes
+ */
+static int atom_start (int, struct peer *);
+static void atom_shutdown (int, struct peer *);
+static void atom_poll (int, struct peer *);
+static void atom_timer (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_atom = {
+ atom_start, /* start up driver */
+ atom_shutdown, /* shut down driver */
+ atom_poll, /* transmit poll message */
+ noentry, /* control (not used) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* buginfo (not used) */
+ atom_timer, /* called once per second */
+};
+
+
+/*
+ * atom_start - initialize data for processing
+ */
+static int
+atom_start(
+ int unit, /* unit number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct ppsunit *up;
+ char device[80];
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ pp = peer->procptr;
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ pp->stratum = STRATUM_UNSPEC;
+ memcpy((char *)&pp->refid, REFID, 4);
+ up = emalloc(sizeof(struct ppsunit));
+ memset(up, 0, sizeof(struct ppsunit));
+ pp->unitptr = up;
+
+ /*
+ * Open PPS device. This can be any serial or parallel port and
+ * not necessarily the port used for the associated radio.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ up->fddev = tty_open(device, O_RDWR, 0777);
+ if (up->fddev <= 0) {
+ msyslog(LOG_ERR,
+ "refclock_atom: %s: %m", device);
+ return (0);
+ }
+
+ /*
+ * Light up the PPSAPI interface.
+ */
+ return (refclock_ppsapi(up->fddev, &up->atom));
+}
+
+
+/*
+ * atom_shutdown - shut down the clock
+ */
+static void
+atom_shutdown(
+ int unit, /* unit number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct ppsunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->fddev > 0)
+ close(up->fddev);
+ free(up);
+}
+
+/*
+ * atom_timer - called once per second
+ */
+void
+atom_timer(
+ int unit, /* unit pointer (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct ppsunit *up;
+ struct refclockproc *pp;
+ char tbuf[80];
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (refclock_pps(peer, &up->atom, pp->sloppyclockflag) <= 0)
+ return;
+
+ peer->flags |= FLAG_PPS;
+
+ /*
+ * If flag4 is lit, record each second offset to clockstats.
+ * That's so we can make awesome Allan deviation plots.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG4) {
+ snprintf(tbuf, sizeof(tbuf), "%.9f",
+ pp->filter[pp->coderecv]);
+ record_clock_stats(&peer->srcadr, tbuf);
+ }
+}
+
+
+/*
+ * atom_poll - called by the transmit procedure
+ */
+static void
+atom_poll(
+ int unit, /* unit number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+
+ /*
+ * Don't wiggle the clock until some other driver has numbered
+ * the seconds.
+ */
+ if (sys_leap == LEAP_NOTINSYNC)
+ return;
+
+ pp = peer->procptr;
+ pp->polls++;
+ if (pp->codeproc == pp->coderecv) {
+ peer->flags &= ~FLAG_PPS;
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+}
+#else
+int refclock_atom_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_bancomm.c b/ntpd/refclock_bancomm.c
new file mode 100644
index 0000000..49922e3
--- /dev/null
+++ b/ntpd/refclock_bancomm.c
@@ -0,0 +1,548 @@
+/* refclock_bancomm.c - clock driver for the Datum/Bancomm bc635VME
+ * Time and Frequency Processor. It requires the BANCOMM bc635VME/
+ * bc350VXI Time and Frequency Processor Module Driver for SunOS4.x
+ * and SunOS5.x UNIX Systems. It has been tested on a UltraSparc
+ * IIi-cEngine running Solaris 2.6.
+ *
+ * Author(s): Ganesh Ramasivan & Gary Cliff, Computing Devices Canada,
+ * Ottawa, Canada
+ *
+ * Date: July 1999
+ *
+ * Note(s): The refclock type has been defined as 16.
+ *
+ * This program has been modelled after the Bancomm driver
+ * originally written by R. Schmidt of Time Service, U.S.
+ * Naval Observatory for a HP-UX machine. Since the original
+ * authors no longer plan to maintain this code, all
+ * references to the HP-UX vme2 driver subsystem bave been
+ * removed. Functions vme_report_event(), vme_receive(),
+ * vme_control() and vme_buginfo() have been deleted because
+ * they are no longer being used.
+ *
+ * 04/28/2005 Rob Neal
+ * Modified to add support for Symmetricom bc637PCI-U Time &
+ * Frequency Processor.
+ * 2/21/2007 Ali Ghorashi
+ * Modified to add support for Symmetricom bc637PCI-U Time &
+ * Frequency Processor on Solaris.
+ * Tested on Solaris 10 with a bc635 card.
+ *
+ * Card bus type (VME/VXI or PCI) and environment are specified via the
+ * "mode" keyword on the server command in ntp.conf.
+ * server 127.127.16.u prefer mode M
+ * where u is the id (usually 0) of the entry in /dev (/dev/stfp0)
+ *
+ * and M is one of the following modes:
+ * 1 : FreeBSD PCI 635/637.
+ * 2 : Linux or Windows PCI 635/637.
+ * 3 : Solaris PCI 635/637
+ * not specified, or other number:
+ * : Assumed to be VME/VXI legacy Bancomm card on Solaris.
+ * Linux and Windows platforms require Symmetricoms' proprietary driver
+ * for the TFP card.
+ * Solaris requires Symmetricom's driver and its header file (freely distributed) to
+ * be installed and running.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_BANC)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <syslog.h>
+#include <ctype.h>
+
+struct btfp_time /* Structure for reading 5 time words */
+ /* in one ioctl(2) operation. */
+{
+ unsigned short btfp_time[5]; /* Time words 0,1,2,3, and 4. (16bit)*/
+};
+/* SunOS5 ioctl commands definitions.*/
+#define BTFPIOC ( 'b'<< 8 )
+#define IOCIO( l, n ) ( BTFPIOC | n )
+#define IOCIOR( l, n, s ) ( BTFPIOC | n )
+#define IOCIORN( l, n, s ) ( BTFPIOC | n )
+#define IOCIOWN( l, n, s ) ( BTFPIOC | n )
+
+/***** Simple ioctl commands *****/
+#define RUNLOCK IOCIOR(b, 19, int ) /* Release Capture Lockout */
+#define RCR0 IOCIOR(b, 22, int ) /* Read control register zero.*/
+#define WCR0 IOCIOWN(b, 23, int) /* Write control register zero*/
+/***** Compound ioctl commands *****/
+
+/* Read all 5 time words in one call. */
+#define READTIME IOCIORN(b, 32, sizeof( struct btfp_time ))
+
+#if defined(__FreeBSD__)
+#undef READTIME
+#define READTIME _IOR('u', 5, struct btfp_time )
+#endif
+
+/* Solaris specific section */
+struct stfp_tm {
+ int32_t tm_sec;
+ int32_t tm_min;
+ int32_t tm_hour;
+ int32_t tm_mday;
+ int32_t tm_mon;
+ int32_t tm_year;
+ int32_t tm_wday;
+ int32_t tm_yday;
+ int32_t tm_isdst;
+};
+
+struct stfp_time {
+ struct stfp_tm tm;
+ int32_t usec; /* usec 0 - 999999 */
+ int32_t hnsec; /* hnsec 0 - 9 (hundreds of nsecs) */
+ int32_t status;
+};
+
+#define SELTIMEFORMAT 2
+# define TIME_DECIMAL 0
+# define TIME_BINARY 1
+
+#if defined(__sun__)
+#undef READTIME
+#define READTIME 9
+#endif /** __sun___ **/
+/* end solaris specific section */
+
+struct vmedate { /* structure returned by get_vmetime.c */
+ unsigned short year;
+ unsigned short day;
+ unsigned short hr;
+ unsigned short mn;
+ unsigned short sec;
+ long frac;
+ unsigned short status;
+};
+
+typedef void *SYMMT_PCI_HANDLE;
+
+/*
+ * VME interface parameters.
+ */
+#define VMEPRECISION (-21) /* precision assumed (1 us) */
+#define USNOREFID "BTFP" /* or whatever */
+#define VMEREFID "BTFP" /* reference id */
+#define VMEDESCRIPTION "Bancomm bc635 TFP" /* who we are */
+#define VMEHSREFID 0x7f7f1000 /* 127.127.16.00 refid hi strata */
+/* clock type 16 is used here */
+#define GMT 0 /* hour offset from Greenwich */
+
+/*
+ * Imported from ntp_timer module
+ */
+extern u_long current_time; /* current time(s) */
+
+/*
+ * VME unit control structure.
+ * Changes made to vmeunit structure. Most members are now available in the
+ * new refclockproc structure in ntp_refclock.h - 07/99 - Ganesh Ramasivan
+ */
+struct vmeunit {
+ struct vmedate vmedata; /* data returned from vme read */
+ u_long lasttime; /* last time clock heard from */
+};
+
+/*
+ * Function prototypes
+ */
+static int vme_start (int, struct peer *);
+static void vme_shutdown (int, struct peer *);
+static void vme_receive (struct recvbuf *);
+static void vme_poll (int unit, struct peer *);
+struct vmedate *get_datumtime(struct vmedate *);
+void tvme_fill(struct vmedate *, uint32_t btm[2]);
+void stfp_time2tvme(struct vmedate *time_vme, struct stfp_time *stfp);
+inline const char *DEVICE_NAME(int n);
+
+
+/*
+ * Define the bc*() functions as weak so we can compile/link without them.
+ * Only clients with the card will have the proprietary vendor device driver
+ * and interface library needed for use on Linux/Windows platforms.
+ */
+extern uint32_t __attribute__ ((weak)) bcReadBinTime(SYMMT_PCI_HANDLE, uint32_t *, uint32_t*, uint8_t*);
+extern SYMMT_PCI_HANDLE __attribute__ ((weak)) bcStartPci(void);
+extern void __attribute__ ((weak)) bcStopPci(SYMMT_PCI_HANDLE);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_bancomm = {
+ vme_start, /* start up driver */
+ vme_shutdown, /* shut down driver */
+ vme_poll, /* transmit poll message */
+ noentry, /* not used (old vme_control) */
+ noentry, /* initialize driver */
+ noentry, /* not used (old vme_buginfo) */
+ NOFLAGS /* not used */
+};
+
+int fd_vme; /* file descriptor for ioctls */
+int regvalue;
+int tfp_type; /* mode selector, indicate platform and driver interface */
+SYMMT_PCI_HANDLE stfp_handle;
+
+/**
+ * this macro returns the device name based on
+ * the platform we are running on and the device number
+ */
+#if defined(__sun__)
+inline const char *DEVICE_NAME(int n) {static char s[20]={0}; snprintf(s,19,"/dev/stfp%d",n);return s;}
+#else
+inline const char* DEVICE_NAME(int n) {static char s[20]={0}; snprintf(s,19,"/dev/btfp%d",n);return s;}
+#endif /**__sun__**/
+
+/*
+ * vme_start - open the VME device and initialize data for processing
+ */
+static int
+vme_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct vmeunit *vme;
+ struct refclockproc *pp;
+ int dummy;
+ char vmedev[20];
+
+ tfp_type = (int)(peer->ttl);
+ switch (tfp_type) {
+ case 1:
+ case 3:
+ break;
+ case 2:
+ stfp_handle = bcStartPci(); /* init the card in lin/win */
+ break;
+ default:
+ break;
+ }
+ /*
+ * Open VME device
+ */
+#ifdef DEBUG
+
+ printf("Opening DATUM DEVICE %s\n",DEVICE_NAME(peer->refclkunit));
+#endif
+ if ( (fd_vme = open(DEVICE_NAME(peer->refclkunit), O_RDWR)) < 0) {
+ msyslog(LOG_ERR, "vme_start: failed open of %s: %m", vmedev);
+ return (0);
+ }
+ else {
+ switch (tfp_type) {
+ case 1: break;
+ case 2: break;
+ case 3:break;
+ default:
+ /* Release capture lockout in case it was set before. */
+ if( ioctl( fd_vme, RUNLOCK, &dummy ) )
+ msyslog(LOG_ERR, "vme_start: RUNLOCK failed %m");
+
+ regvalue = 0; /* More esoteric stuff to do... */
+ if( ioctl( fd_vme, WCR0, &regvalue ) )
+ msyslog(LOG_ERR, "vme_start: WCR0 failed %m");
+ break;
+ }
+ }
+
+ /*
+ * Allocate unit structure
+ */
+ vme = emalloc_zero(sizeof(struct vmeunit));
+
+
+ /*
+ * Set up the structures
+ */
+ pp = peer->procptr;
+ pp->unitptr = vme;
+ pp->timestarted = current_time;
+
+ pp->io.clock_recv = vme_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd_vme;
+ /* shouldn't there be an io_addclock() call? */
+
+ /*
+ * All done. Initialize a few random peer variables, then
+ * return success. Note that root delay and root dispersion are
+ * always zero for this clock.
+ */
+ peer->precision = VMEPRECISION;
+ memcpy(&pp->refid, USNOREFID,4);
+ return (1);
+}
+
+
+/*
+ * vme_shutdown - shut down a VME clock
+ */
+static void
+vme_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct vmeunit *vme;
+ struct refclockproc *pp;
+
+ /*
+ * Tell the I/O module to turn us off. We're history.
+ */
+ pp = peer->procptr;
+ vme = pp->unitptr;
+ io_closeclock(&pp->io);
+ pp->unitptr = NULL;
+ if (NULL != vme)
+ free(vme);
+ if (tfp_type == 2)
+ bcStopPci(stfp_handle);
+}
+
+
+/*
+ * vme_receive - receive data from the VME device.
+ *
+ * Note: This interface would be interrupt-driven. We don't use that
+ * now, but include a dummy routine for possible future adventures.
+ */
+static void
+vme_receive(
+ struct recvbuf *rbufp
+ )
+{
+}
+
+
+/*
+ * vme_poll - called by the transmit procedure
+ */
+static void
+vme_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct vmedate *tptr;
+ struct vmeunit *vme;
+ struct refclockproc *pp;
+ time_t tloc;
+ struct tm *tadr;
+
+ pp = peer->procptr;
+ vme = pp->unitptr; /* Here is the structure */
+
+ tptr = &vme->vmedata;
+ if ((tptr = get_datumtime(tptr)) == NULL ) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ get_systime(&pp->lastrec);
+ pp->polls++;
+ vme->lasttime = current_time;
+
+ /*
+ * Get VME time and convert to timestamp format.
+ * The year must come from the system clock.
+ */
+
+ time(&tloc);
+ tadr = gmtime(&tloc);
+ tptr->year = (unsigned short)(tadr->tm_year + 1900);
+
+ snprintf(pp->a_lastcode,
+ sizeof(pp->a_lastcode),
+ "%3.3d %2.2d:%2.2d:%2.2d.%.6ld %1d",
+ tptr->day,
+ tptr->hr,
+ tptr->mn,
+ tptr->sec,
+ tptr->frac,
+ tptr->status);
+
+ pp->lencode = (u_short) strlen(pp->a_lastcode);
+
+ pp->day = tptr->day;
+ pp->hour = tptr->hr;
+ pp->minute = tptr->mn;
+ pp->second = tptr->sec;
+ pp->nsec = tptr->frac;
+
+#ifdef DEBUG
+ if (debug)
+ printf("pp: %3d %02d:%02d:%02d.%06ld %1x\n",
+ pp->day, pp->hour, pp->minute, pp->second,
+ pp->nsec, tptr->status);
+#endif
+ if (tptr->status ) { /* Status 0 is locked to ref., 1 is not */
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Now, compute the reference time value. Use the heavy
+ * machinery for the seconds and the millisecond field for the
+ * fraction when present. If an error in conversion to internal
+ * format is found, the program declares bad data and exits.
+ * Note that this code does not yet know how to do the years and
+ * relies on the clock-calendar chip for sanity.
+ */
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+}
+
+struct vmedate *
+get_datumtime(struct vmedate *time_vme)
+{
+ char cbuf[7];
+ struct btfp_time vts;
+ uint32_t btm[2];
+ uint8_t dmy;
+ struct stfp_time stfpm;
+
+ if (time_vme == NULL)
+ time_vme = emalloc(sizeof(*time_vme));
+
+ switch (tfp_type) {
+ case 1: /* BSD, PCI, 2 32bit time words */
+ if (ioctl(fd_vme, READTIME, &btm)) {
+ msyslog(LOG_ERR, "get_bc63x error: %m");
+ return(NULL);
+ }
+ tvme_fill(time_vme, btm);
+ break;
+
+ case 2: /* Linux/Windows, PCI, 2 32bit time words */
+ if (bcReadBinTime(stfp_handle, &btm[1], &btm[0], &dmy) == 0) {
+ msyslog(LOG_ERR, "get_datumtime error: %m");
+ return(NULL);
+ }
+ tvme_fill(time_vme, btm);
+ break;
+
+ case 3: /** solaris **/
+ memset(&stfpm,0,sizeof(stfpm));
+
+ /* we need the time in decimal format */
+ /* Here we rudely assume that we are the only user of the driver.
+ * Other programs will have to set their own time format before reading
+ * the time.
+ */
+ if(ioctl (fd_vme, SELTIMEFORMAT, TIME_DECIMAL)){
+ msyslog(LOG_ERR, "Could not set time format");
+ return (NULL);
+ }
+ /* read the time */
+ if (ioctl(fd_vme, READTIME, &stfpm)) {
+ msyslog(LOG_ERR, "ioctl error: %m");
+ return(NULL);
+ }
+ stfp_time2tvme(time_vme, &stfpm);
+ break;
+
+ default: /* legacy bancomm card */
+
+ if (ioctl(fd_vme, READTIME, &vts)) {
+ msyslog(LOG_ERR,
+ "get_datumtime error: %m");
+ return(NULL);
+ }
+ /* Get day */
+ snprintf(cbuf, sizeof(cbuf), "%3.3x",
+ ((vts.btfp_time[ 0 ] & 0x000f) << 8) +
+ ((vts.btfp_time[ 1 ] & 0xff00) >> 8));
+ time_vme->day = (unsigned short)atoi(cbuf);
+
+ /* Get hour */
+ snprintf(cbuf, sizeof(cbuf), "%2.2x",
+ vts.btfp_time[ 1 ] & 0x00ff);
+ time_vme->hr = (unsigned short)atoi(cbuf);
+
+ /* Get minutes */
+ snprintf(cbuf, sizeof(cbuf), "%2.2x",
+ (vts.btfp_time[ 2 ] & 0xff00) >> 8);
+ time_vme->mn = (unsigned short)atoi(cbuf);
+
+ /* Get seconds */
+ snprintf(cbuf, sizeof(cbuf), "%2.2x",
+ vts.btfp_time[ 2 ] & 0x00ff);
+ time_vme->sec = (unsigned short)atoi(cbuf);
+
+ /* Get microseconds. Yes, we ignore the 0.1 microsecond digit so
+ we can use the TVTOTSF function later on...*/
+
+ snprintf(cbuf, sizeof(cbuf), "%4.4x%2.2x",
+ vts.btfp_time[ 3 ],
+ vts.btfp_time[ 4 ] >> 8);
+ time_vme->frac = (u_long) atoi(cbuf);
+
+ /* Get status bit */
+ time_vme->status = (vts.btfp_time[0] & 0x0010) >> 4;
+
+ break;
+ }
+
+ if (time_vme->status)
+ return ((void *)NULL);
+ else
+ return (time_vme);
+}
+/* Assign values to time_vme struct. Mostly for readability */
+void
+tvme_fill(struct vmedate *time_vme, uint32_t btm[2])
+{
+ struct tm maj;
+ uint32_t dmaj, dmin;
+
+ dmaj = btm[1]; /* syntax sugar */
+ dmin = btm[0];
+
+ gmtime_r(&dmaj, &maj);
+ time_vme->day = maj.tm_yday+1;
+ time_vme->hr = maj.tm_hour;
+ time_vme->mn = maj.tm_min;
+ time_vme->sec = maj.tm_sec;
+ time_vme->frac = (dmin & 0x000fffff) * 1000;
+ time_vme->frac += ((dmin & 0x00f00000) >> 20) * 100;
+ time_vme->status = (dmin & 0x01000000) >> 24;
+ return;
+}
+
+
+/* Assign values to time_vme struct. Mostly for readability */
+void
+stfp_time2tvme(struct vmedate *time_vme, struct stfp_time *stfp)
+{
+
+ time_vme->day = stfp->tm.tm_yday+1;
+ time_vme->hr = stfp->tm.tm_hour;
+ time_vme->mn = stfp->tm.tm_min;
+ time_vme->sec = stfp->tm.tm_sec;
+ time_vme->frac = stfp->usec*1000;
+ time_vme->frac += stfp->hnsec * 100;
+ time_vme->status = stfp->status;
+ return;
+}
+#else
+int refclock_bancomm_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_chronolog.c b/ntpd/refclock_chronolog.c
new file mode 100644
index 0000000..ee54b43
--- /dev/null
+++ b/ntpd/refclock_chronolog.c
@@ -0,0 +1,343 @@
+/*
+ * refclock_chronolog - clock driver for Chronolog K-series WWVB receiver.
+ */
+
+/*
+ * Must interpolate back to local time. Very annoying.
+ */
+#define GET_LOCALTIME
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_CHRONOLOG)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+/*
+ * This driver supports the Chronolog K-series WWVB receiver.
+ *
+ * Input format:
+ *
+ * Y YY/MM/DD<cr><lf>
+ * Z hh:mm:ss<cr><lf>
+ *
+ * YY/MM/DD -- what you'd expect. This arrives a few seconds before the
+ * timestamp.
+ * hh:mm:ss -- what you'd expect. We take time on the <cr>.
+ *
+ * Our Chronolog writes time out at 2400 bps 8/N/1, but it can be configured
+ * otherwise. The clock seems to appear every 60 seconds, which doesn't make
+ * for good statistics collection.
+ *
+ * The original source of this module was the WWVB module.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/chronolog%d" /* device name and unit */
+#define SPEED232 B2400 /* uart speed (2400 baud) */
+#define PRECISION (-13) /* precision assumed (about 100 us) */
+#define REFID "chronolog" /* reference ID */
+#define DESCRIPTION "Chrono-log K" /* WRU */
+
+#define MONLIN 15 /* number of monitoring lines */
+
+/*
+ * Chrono-log unit control structure
+ */
+struct chronolog_unit {
+ u_char tcswitch; /* timecode switch */
+ l_fp laststamp; /* last receive timestamp */
+ u_char lasthour; /* last hour (for monitor) */
+ int year; /* Y2K-adjusted year */
+ int day; /* day-of-month */
+ int month; /* month-of-year */
+};
+
+/*
+ * Function prototypes
+ */
+static int chronolog_start (int, struct peer *);
+static void chronolog_shutdown (int, struct peer *);
+static void chronolog_receive (struct recvbuf *);
+static void chronolog_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_chronolog = {
+ chronolog_start, /* start up driver */
+ chronolog_shutdown, /* shut down driver */
+ chronolog_poll, /* poll the driver -- a nice fabrication */
+ noentry, /* not used */
+ noentry, /* not used */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * chronolog_start - open the devices and initialize data for processing
+ */
+static int
+chronolog_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct chronolog_unit *up;
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open serial port. Don't bother with CLK line discipline, since
+ * it's not available.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+#ifdef DEBUG
+ if (debug)
+ printf ("starting Chronolog with device %s\n",device);
+#endif
+ fd = refclock_open(device, SPEED232, 0);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->unitptr = up;
+ pp->io.clock_recv = chronolog_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ pp->unitptr = NULL;
+ return (0);
+ }
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ return (1);
+}
+
+
+/*
+ * chronolog_shutdown - shut down the clock
+ */
+static void
+chronolog_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct chronolog_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * chronolog_receive - receive data from the serial interface
+ */
+static void
+chronolog_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct chronolog_unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ l_fp trtmp; /* arrival timestamp */
+ int hours; /* hour-of-day */
+ int minutes; /* minutes-past-the-hour */
+ int seconds; /* seconds */
+ int temp; /* int temp */
+ int got_good; /* got a good time flag */
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);
+
+ if (temp == 0) {
+ if (up->tcswitch == 0) {
+ up->tcswitch = 1;
+ up->laststamp = trtmp;
+ } else
+ up->tcswitch = 0;
+ return;
+ }
+ pp->lencode = temp;
+ pp->lastrec = up->laststamp;
+ up->laststamp = trtmp;
+ up->tcswitch = 1;
+
+#ifdef DEBUG
+ if (debug)
+ printf("chronolog: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif
+
+ /*
+ * We get down to business. Check the timecode format and decode
+ * its contents. This code uses the first character to see whether
+ * we're looking at a date or a time. We store data data across
+ * calls since it is transmitted a few seconds ahead of the
+ * timestamp.
+ */
+ got_good=0;
+ if (sscanf(pp->a_lastcode, "Y %d/%d/%d", &up->year,&up->month,&up->day))
+ {
+ /*
+ * Y2K convert the 2-digit year
+ */
+ up->year = up->year >= 69 ? up->year : up->year + 100;
+ return;
+ }
+ if (sscanf(pp->a_lastcode,"Z %02d:%02d:%02d",
+ &hours,&minutes,&seconds) == 3)
+ {
+#ifdef GET_LOCALTIME
+ struct tm local;
+ struct tm *gmtp;
+ time_t unixtime;
+ int adjyear;
+ int adjmon;
+
+ /*
+ * Convert to GMT for sites that distribute localtime. This
+ * means we have to do Y2K conversion on the 2-digit year;
+ * otherwise, we get the time wrong.
+ */
+
+ memset(&local, 0, sizeof(local));
+
+ local.tm_year = up->year;
+ local.tm_mon = up->month-1;
+ local.tm_mday = up->day;
+ local.tm_hour = hours;
+ local.tm_min = minutes;
+ local.tm_sec = seconds;
+ local.tm_isdst = -1;
+
+ unixtime = mktime (&local);
+ if ((gmtp = gmtime (&unixtime)) == NULL)
+ {
+ refclock_report (peer, CEVNT_FAULT);
+ return;
+ }
+ adjyear = gmtp->tm_year+1900;
+ adjmon = gmtp->tm_mon+1;
+ pp->day = ymd2yd (adjyear, adjmon, gmtp->tm_mday);
+ pp->hour = gmtp->tm_hour;
+ pp->minute = gmtp->tm_min;
+ pp->second = gmtp->tm_sec;
+#ifdef DEBUG
+ if (debug)
+ printf ("time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
+ adjyear,adjmon,gmtp->tm_mday,pp->hour,pp->minute,
+ pp->second);
+#endif
+
+#else
+ /*
+ * For more rational sites distributing UTC
+ */
+ pp->day = ymd2yd(year+1900,month,day);
+ pp->hour = hours;
+ pp->minute = minutes;
+ pp->second = seconds;
+
+#endif
+ got_good=1;
+ }
+
+ if (!got_good)
+ return;
+
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ up->lasthour = (u_char)pp->hour;
+}
+
+
+/*
+ * chronolog_poll - called by the transmit procedure
+ */
+static void
+chronolog_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ /*
+ * Time to poll the clock. The Chrono-log clock is supposed to
+ * respond to a 'T' by returning a timecode in the format(s)
+ * specified above. Ours does (can?) not, but this seems to be
+ * an installation-specific problem. This code is dyked out,
+ * but may be re-enabled if anyone ever finds a Chrono-log that
+ * actually listens to this command.
+ */
+#if 0
+ register struct chronolog_unit *up;
+ struct refclockproc *pp;
+ char pollchar;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (peer->burst == 0 && peer->reach == 0)
+ refclock_report(peer, CEVNT_TIMEOUT);
+ if (up->linect > 0)
+ pollchar = 'R';
+ else
+ pollchar = 'T';
+ if (write(pp->io.fd, &pollchar, 1) != 1)
+ refclock_report(peer, CEVNT_FAULT);
+ else
+ pp->polls++;
+#endif
+}
+
+#else
+int refclock_chronolog_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_chu.c b/ntpd/refclock_chu.c
new file mode 100644
index 0000000..9c7093d
--- /dev/null
+++ b/ntpd/refclock_chu.c
@@ -0,0 +1,1683 @@
+/*
+ * refclock_chu - clock driver for Canadian CHU time/frequency station
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_CHU)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+
+#ifdef HAVE_AUDIO
+#include "audio.h"
+#endif /* HAVE_AUDIO */
+
+#define ICOM 1 /* undefine to suppress ICOM code */
+
+#ifdef ICOM
+#include "icom.h"
+#endif /* ICOM */
+/*
+ * Audio CHU demodulator/decoder
+ *
+ * This driver synchronizes the computer time using data encoded in
+ * radio transmissions from Canadian time/frequency station CHU in
+ * Ottawa, Ontario. Transmissions are made continuously on 3330 kHz,
+ * 7850 kHz and 14670 kHz in upper sideband, compatible AM mode. An
+ * ordinary shortwave receiver can be tuned manually to one of these
+ * frequencies or, in the case of ICOM receivers, the receiver can be
+ * tuned automatically as propagation conditions change throughout the
+ * day and season.
+ *
+ * The driver requires an audio codec or sound card with sampling rate 8
+ * kHz and mu-law companding. This is the same standard as used by the
+ * telephone industry and is supported by most hardware and operating
+ * systems, including Solaris, SunOS, FreeBSD, NetBSD and Linux. In this
+ * implementation, only one audio driver and codec can be supported on a
+ * single machine.
+ *
+ * The driver can be compiled to use a Bell 103 compatible modem or
+ * modem chip to receive the radio signal and demodulate the data.
+ * Alternatively, the driver can be compiled to use the audio codec of
+ * the workstation or another with compatible audio drivers. In the
+ * latter case, the driver implements the modem using DSP routines, so
+ * the radio can be connected directly to either the microphone on line
+ * input port. In either case, the driver decodes the data using a
+ * maximum-likelihood technique which exploits the considerable degree
+ * of redundancy available to maximize accuracy and minimize errors.
+ *
+ * The CHU time broadcast includes an audio signal compatible with the
+ * Bell 103 modem standard (mark = 2225 Hz, space = 2025 Hz). The signal
+ * consists of nine, ten-character bursts transmitted at 300 bps between
+ * seconds 31 and 39 of each minute. Each character consists of eight
+ * data bits plus one start bit and two stop bits to encode two hex
+ * digits. The burst data consist of five characters (ten hex digits)
+ * followed by a repeat of these characters. In format A, the characters
+ * are repeated in the same polarity; in format B, the characters are
+ * repeated in the opposite polarity.
+ *
+ * Format A bursts are sent at seconds 32 through 39 of the minute in
+ * hex digits (nibble swapped)
+ *
+ * 6dddhhmmss6dddhhmmss
+ *
+ * The first ten digits encode a frame marker (6) followed by the day
+ * (ddd), hour (hh in UTC), minute (mm) and the second (ss). Since
+ * format A bursts are sent during the third decade of seconds the tens
+ * digit of ss is always 3. The driver uses this to determine correct
+ * burst synchronization. These digits are then repeated with the same
+ * polarity.
+ *
+ * Format B bursts are sent at second 31 of the minute in hex digits
+ *
+ * xdyyyyttaaxdyyyyttaa
+ *
+ * The first ten digits encode a code (x described below) followed by
+ * the DUT1 (d in deciseconds), Gregorian year (yyyy), difference TAI -
+ * UTC (tt) and daylight time indicator (aa) peculiar to Canada. These
+ * digits are then repeated with inverted polarity.
+ *
+ * The x is coded
+ *
+ * 1 Sign of DUT (0 = +)
+ * 2 Leap second warning. One second will be added.
+ * 4 Leap second warning. One second will be subtracted.
+ * 8 Even parity bit for this nibble.
+ *
+ * By design, the last stop bit of the last character in the burst
+ * coincides with 0.5 second. Since characters have 11 bits and are
+ * transmitted at 300 bps, the last stop bit of the first character
+ * coincides with 0.5 - 9 * 11/300 = 0.170 second. Depending on the
+ * UART, character interrupts can vary somewhere between the end of bit
+ * 9 and end of bit 11. These eccentricities can be corrected along with
+ * the radio propagation delay using fudge time 1.
+ *
+ * Debugging aids
+ *
+ * The timecode format used for debugging and data recording includes
+ * data helpful in diagnosing problems with the radio signal and serial
+ * connections. With debugging enabled (-d on the ntpd command line),
+ * the driver produces one line for each burst in two formats
+ * corresponding to format A and B.Each line begins with the format code
+ * chuA or chuB followed by the status code and signal level (0-9999).
+ * The remainder of the line is as follows.
+ *
+ * Following is format A:
+ *
+ * n b f s m code
+ *
+ * where n is the number of characters in the burst (0-10), b the burst
+ * distance (0-40), f the field alignment (-1, 0, 1), s the
+ * synchronization distance (0-16), m the burst number (2-9) and code
+ * the burst characters as received. Note that the hex digits in each
+ * character are reversed, so the burst
+ *
+ * 10 38 0 16 9 06851292930685129293
+ *
+ * is interpreted as containing 10 characters with burst distance 38,
+ * field alignment 0, synchronization distance 16 and burst number 9.
+ * The nibble-swapped timecode shows day 58, hour 21, minute 29 and
+ * second 39.
+ *
+ * Following is format B:
+ *
+ * n b s code
+ *
+ * where n is the number of characters in the burst (0-10), b the burst
+ * distance (0-40), s the synchronization distance (0-40) and code the
+ * burst characters as received. Note that the hex digits in each
+ * character are reversed and the last ten digits inverted, so the burst
+ *
+ * 10 40 1091891300ef6e76ec
+ *
+ * is interpreted as containing 10 characters with burst distance 40.
+ * The nibble-swapped timecode shows DUT1 +0.1 second, year 1998 and TAI
+ * - UTC 31 seconds.
+ *
+ * Each line is preceeded by the code chuA or chuB, as appropriate. If
+ * the audio driver is compiled, the current gain (0-255) and relative
+ * signal level (0-9999) follow the code. The receiver volume control
+ * should be set so that the gain is somewhere near the middle of the
+ * range 0-255, which results in a signal level near 1000.
+ *
+ * In addition to the above, the reference timecode is updated and
+ * written to the clockstats file and debug score after the last burst
+ * received in the minute. The format is
+ *
+ * sq yyyy ddd hh:mm:ss l s dd t agc ident m b
+ *
+ * s '?' before first synchronized and ' ' after that
+ * q status code (see below)
+ * yyyy year
+ * ddd day of year
+ * hh:mm:ss time of day
+ * l leap second indicator (space, L or D)
+ * dst Canadian daylight code (opaque)
+ * t number of minutes since last synchronized
+ * agc audio gain (0 - 255)
+ * ident identifier (CHU0 3330 kHz, CHU1 7850 kHz, CHU2 14670 kHz)
+ * m signal metric (0 - 100)
+ * b number of timecodes for the previous minute (0 - 59)
+ *
+ * Fudge factors
+ *
+ * For accuracies better than the low millisceconds, fudge time1 can be
+ * set to the radio propagation delay from CHU to the receiver. This can
+ * be done conviently using the minimuf program.
+ *
+ * Fudge flag4 causes the dubugging output described above to be
+ * recorded in the clockstats file. When the audio driver is compiled,
+ * fudge flag2 selects the audio input port, where 0 is the mike port
+ * (default) and 1 is the line-in port. It does not seem useful to
+ * select the compact disc player port. Fudge flag3 enables audio
+ * monitoring of the input signal. For this purpose, the monitor gain is
+ * set to a default value.
+ *
+ * The audio codec code is normally compiled in the driver if the
+ * architecture supports it (HAVE_AUDIO defined), but is used only if
+ * the link /dev/chu_audio is defined and valid. The serial port code is
+ * always compiled in the driver, but is used only if the autdio codec
+ * is not available and the link /dev/chu%d is defined and valid.
+ *
+ * The ICOM code is normally compiled in the driver if selected (ICOM
+ * defined), but is used only if the link /dev/icom%d is defined and
+ * valid and the mode keyword on the server configuration command
+ * specifies a nonzero mode (ICOM ID select code). The C-IV speed is
+ * 9600 bps if the high order 0x80 bit of the mode is zero and 1200 bps
+ * if one. The C-IV trace is turned on if the debug level is greater
+ * than one.
+ *
+ * Alarm codes
+ *
+ * CEVNT_BADTIME invalid date or time
+ * CEVNT_PROP propagation failure - no stations heard
+ */
+/*
+ * Interface definitions
+ */
+#define SPEED232 B300 /* uart speed (300 baud) */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define REFID "CHU" /* reference ID */
+#define DEVICE "/dev/chu%d" /* device name and unit */
+#define SPEED232 B300 /* UART speed (300 baud) */
+#ifdef ICOM
+#define TUNE .001 /* offset for narrow filter (MHz) */
+#define DWELL 5 /* minutes in a dwell */
+#define NCHAN 3 /* number of channels */
+#define ISTAGE 3 /* number of integrator stages */
+#endif /* ICOM */
+
+#ifdef HAVE_AUDIO
+/*
+ * Audio demodulator definitions
+ */
+#define SECOND 8000 /* nominal sample rate (Hz) */
+#define BAUD 300 /* modulation rate (bps) */
+#define OFFSET 128 /* companded sample offset */
+#define SIZE 256 /* decompanding table size */
+#define MAXAMP 6000. /* maximum signal level */
+#define MAXCLP 100 /* max clips above reference per s */
+#define SPAN 800. /* min envelope span */
+#define LIMIT 1000. /* soft limiter threshold */
+#define AGAIN 6. /* baseband gain */
+#define LAG 10 /* discriminator lag */
+#define DEVICE_AUDIO "/dev/audio" /* device name */
+#define DESCRIPTION "CHU Audio/Modem Receiver" /* WRU */
+#define AUDIO_BUFSIZ 240 /* audio buffer size (30 ms) */
+#else
+#define DESCRIPTION "CHU Modem Receiver" /* WRU */
+#endif /* HAVE_AUDIO */
+
+/*
+ * Decoder definitions
+ */
+#define CHAR (11. / 300.) /* character time (s) */
+#define BURST 11 /* max characters per burst */
+#define MINCHARS 9 /* min characters per burst */
+#define MINDIST 28 /* min burst distance (of 40) */
+#define MINSYNC 8 /* min sync distance (of 16) */
+#define MINSTAMP 20 /* min timestamps (of 60) */
+#define MINMETRIC 50 /* min channel metric (of 160) */
+
+/*
+ * The on-time synchronization point for the driver is the last stop bit
+ * of the first character 170 ms. The modem delay is 0.8 ms, while the
+ * receiver delay is approxmately 4.7 ms at 2125 Hz. The fudge value 1.3
+ * ms due to the codec and other causes was determined by calibrating to
+ * a PPS signal from a GPS receiver. The additional propagation delay
+ * specific to each receiver location can be programmed in the fudge
+ * time1.
+ *
+ * The resulting offsets with a 2.4-GHz P4 running FreeBSD 6.1 are
+ * generally within 0.5 ms short term with 0.3 ms jitter. The long-term
+ * offsets vary up to 0.3 ms due to ionospheric layer height variations.
+ * The processor load due to the driver is 0.4 percent.
+ */
+#define PDELAY ((170 + .8 + 4.7 + 1.3) / 1000) /* system delay (s) */
+
+/*
+ * Status bits (status)
+ */
+#define RUNT 0x0001 /* runt burst */
+#define NOISE 0x0002 /* noise burst */
+#define BFRAME 0x0004 /* invalid format B frame sync */
+#define BFORMAT 0x0008 /* invalid format B data */
+#define AFRAME 0x0010 /* invalid format A frame sync */
+#define AFORMAT 0x0020 /* invalid format A data */
+#define DECODE 0x0040 /* invalid data decode */
+#define STAMP 0x0080 /* too few timestamps */
+#define AVALID 0x0100 /* valid A frame */
+#define BVALID 0x0200 /* valid B frame */
+#define INSYNC 0x0400 /* clock synchronized */
+#define METRIC 0x0800 /* one or more stations heard */
+
+/*
+ * Alarm status bits (alarm)
+ *
+ * These alarms are set at the end of a minute in which at least one
+ * burst was received. SYNERR is raised if the AFRAME or BFRAME status
+ * bits are set during the minute, FMTERR is raised if the AFORMAT or
+ * BFORMAT status bits are set, DECERR is raised if the DECODE status
+ * bit is set and TSPERR is raised if the STAMP status bit is set.
+ */
+#define SYNERR 0x01 /* frame sync error */
+#define FMTERR 0x02 /* data format error */
+#define DECERR 0x04 /* data decoding error */
+#define TSPERR 0x08 /* insufficient data */
+
+#ifdef HAVE_AUDIO
+/*
+ * Maximum-likelihood UART structure. There are eight of these
+ * corresponding to the number of phases.
+ */
+struct surv {
+ l_fp cstamp; /* last bit timestamp */
+ double shift[12]; /* sample shift register */
+ double span; /* shift register envelope span */
+ double dist; /* sample distance */
+ int uart; /* decoded character */
+};
+#endif /* HAVE_AUDIO */
+
+#ifdef ICOM
+/*
+ * CHU station structure. There are three of these corresponding to the
+ * three frequencies.
+ */
+struct xmtr {
+ double integ[ISTAGE]; /* circular integrator */
+ double metric; /* integrator sum */
+ int iptr; /* integrator pointer */
+ int probe; /* dwells since last probe */
+};
+#endif /* ICOM */
+
+/*
+ * CHU unit control structure
+ */
+struct chuunit {
+ u_char decode[20][16]; /* maximum-likelihood decoding matrix */
+ l_fp cstamp[BURST]; /* character timestamps */
+ l_fp tstamp[MAXSTAGE]; /* timestamp samples */
+ l_fp timestamp; /* current buffer timestamp */
+ l_fp laststamp; /* last buffer timestamp */
+ l_fp charstamp; /* character time as a l_fp */
+ int second; /* counts the seconds of the minute */
+ int errflg; /* error flags */
+ int status; /* status bits */
+ char ident[5]; /* station ID and channel */
+#ifdef ICOM
+ int fd_icom; /* ICOM file descriptor */
+ int chan; /* radio channel */
+ int dwell; /* dwell cycle */
+ struct xmtr xmtr[NCHAN]; /* station metric */
+#endif /* ICOM */
+
+ /*
+ * Character burst variables
+ */
+ int cbuf[BURST]; /* character buffer */
+ int ntstamp; /* number of timestamp samples */
+ int ndx; /* buffer start index */
+ int prevsec; /* previous burst second */
+ int burdist; /* burst distance */
+ int syndist; /* sync distance */
+ int burstcnt; /* format A bursts this minute */
+ double maxsignal; /* signal level (modem only) */
+ int gain; /* codec gain (modem only) */
+
+ /*
+ * Format particulars
+ */
+ int leap; /* leap/dut code */
+ int dut; /* UTC1 correction */
+ int tai; /* TAI - UTC correction */
+ int dst; /* Canadian DST code */
+
+#ifdef HAVE_AUDIO
+ /*
+ * Audio codec variables
+ */
+ int fd_audio; /* audio port file descriptor */
+ double comp[SIZE]; /* decompanding table */
+ int port; /* codec port */
+ int mongain; /* codec monitor gain */
+ int clipcnt; /* sample clip count */
+ int seccnt; /* second interval counter */
+
+ /*
+ * Modem variables
+ */
+ l_fp tick; /* audio sample increment */
+ double bpf[9]; /* IIR bandpass filter */
+ double disc[LAG]; /* discriminator shift register */
+ double lpf[27]; /* FIR lowpass filter */
+ double monitor; /* audio monitor */
+ int discptr; /* discriminator pointer */
+
+ /*
+ * Maximum-likelihood UART variables
+ */
+ double baud; /* baud interval */
+ struct surv surv[8]; /* UART survivor structures */
+ int decptr; /* decode pointer */
+ int decpha; /* decode phase */
+ int dbrk; /* holdoff counter */
+#endif /* HAVE_AUDIO */
+};
+
+/*
+ * Function prototypes
+ */
+static int chu_start (int, struct peer *);
+static void chu_shutdown (int, struct peer *);
+static void chu_receive (struct recvbuf *);
+static void chu_second (int, struct peer *);
+static void chu_poll (int, struct peer *);
+
+/*
+ * More function prototypes
+ */
+static void chu_decode (struct peer *, int, l_fp);
+static void chu_burst (struct peer *);
+static void chu_clear (struct peer *);
+static void chu_a (struct peer *, int);
+static void chu_b (struct peer *, int);
+static int chu_dist (int, int);
+static double chu_major (struct peer *);
+#ifdef HAVE_AUDIO
+static void chu_uart (struct surv *, double);
+static void chu_rf (struct peer *, double);
+static void chu_gain (struct peer *);
+static void chu_audio_receive (struct recvbuf *rbufp);
+#endif /* HAVE_AUDIO */
+#ifdef ICOM
+static int chu_newchan (struct peer *, double);
+#endif /* ICOM */
+static void chu_serial_receive (struct recvbuf *rbufp);
+
+/*
+ * Global variables
+ */
+static char hexchar[] = "0123456789abcdef_*=";
+
+#ifdef ICOM
+/*
+ * Note the tuned frequencies are 1 kHz higher than the carrier. CHU
+ * transmits on USB with carrier so we can use AM and the narrow SSB
+ * filter.
+ */
+static double qsy[NCHAN] = {3.330, 7.850, 14.670}; /* freq (MHz) */
+#endif /* ICOM */
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_chu = {
+ chu_start, /* start up driver */
+ chu_shutdown, /* shut down driver */
+ chu_poll, /* transmit poll message */
+ noentry, /* not used (old chu_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old chu_buginfo) */
+ chu_second /* housekeeping timer */
+};
+
+
+/*
+ * chu_start - open the devices and initialize data for processing
+ */
+static int
+chu_start(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct chuunit *up;
+ struct refclockproc *pp;
+ char device[20]; /* device name */
+ int fd; /* file descriptor */
+#ifdef ICOM
+ int temp;
+#endif /* ICOM */
+#ifdef HAVE_AUDIO
+ int fd_audio; /* audio port file descriptor */
+ int i; /* index */
+ double step; /* codec adjustment */
+
+ /*
+ * Open audio device. Don't complain if not there.
+ */
+ fd_audio = audio_init(DEVICE_AUDIO, AUDIO_BUFSIZ, unit);
+
+#ifdef DEBUG
+ if (fd_audio >= 0 && debug)
+ audio_show();
+#endif
+
+ /*
+ * If audio is unavailable, Open serial port in raw mode.
+ */
+ if (fd_audio >= 0) {
+ fd = fd_audio;
+ } else {
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_RAW);
+ }
+#else /* HAVE_AUDIO */
+
+ /*
+ * Open serial port in raw mode.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_RAW);
+#endif /* HAVE_AUDIO */
+
+ if (fd < 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->unitptr = up;
+ pp->io.clock_recv = chu_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ pp->unitptr = NULL;
+ return (0);
+ }
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ strlcpy(up->ident, "CHU", sizeof(up->ident));
+ memcpy(&pp->refid, up->ident, 4);
+ DTOLFP(CHAR, &up->charstamp);
+#ifdef HAVE_AUDIO
+
+ /*
+ * The companded samples are encoded sign-magnitude. The table
+ * contains all the 256 values in the interest of speed. We do
+ * this even if the audio codec is not available. C'est la lazy.
+ */
+ up->fd_audio = fd_audio;
+ up->gain = 127;
+ up->comp[0] = up->comp[OFFSET] = 0.;
+ up->comp[1] = 1; up->comp[OFFSET + 1] = -1.;
+ up->comp[2] = 3; up->comp[OFFSET + 2] = -3.;
+ step = 2.;
+ for (i = 3; i < OFFSET; i++) {
+ up->comp[i] = up->comp[i - 1] + step;
+ up->comp[OFFSET + i] = -up->comp[i];
+ if (i % 16 == 0)
+ step *= 2.;
+ }
+ DTOLFP(1. / SECOND, &up->tick);
+#endif /* HAVE_AUDIO */
+#ifdef ICOM
+ temp = 0;
+#ifdef DEBUG
+ if (debug > 1)
+ temp = P_TRACE;
+#endif
+ if (peer->ttl > 0) {
+ if (peer->ttl & 0x80)
+ up->fd_icom = icom_init("/dev/icom", B1200,
+ temp);
+ else
+ up->fd_icom = icom_init("/dev/icom", B9600,
+ temp);
+ }
+ if (up->fd_icom > 0) {
+ if (chu_newchan(peer, 0) != 0) {
+ msyslog(LOG_NOTICE, "icom: radio not found");
+ close(up->fd_icom);
+ up->fd_icom = 0;
+ } else {
+ msyslog(LOG_NOTICE, "icom: autotune enabled");
+ }
+ }
+#endif /* ICOM */
+ return (1);
+}
+
+
+/*
+ * chu_shutdown - shut down the clock
+ */
+static void
+chu_shutdown(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct chuunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up == NULL)
+ return;
+
+ io_closeclock(&pp->io);
+#ifdef ICOM
+ if (up->fd_icom > 0)
+ close(up->fd_icom);
+#endif /* ICOM */
+ free(up);
+}
+
+
+/*
+ * chu_receive - receive data from the audio or serial device
+ */
+static void
+chu_receive(
+ struct recvbuf *rbufp /* receive buffer structure pointer */
+ )
+{
+#ifdef HAVE_AUDIO
+ struct chuunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * If the audio codec is warmed up, the buffer contains codec
+ * samples which need to be demodulated and decoded into CHU
+ * characters using the software UART. Otherwise, the buffer
+ * contains CHU characters from the serial port, so the software
+ * UART is bypassed. In this case the CPU will probably run a
+ * few degrees cooler.
+ */
+ if (up->fd_audio > 0)
+ chu_audio_receive(rbufp);
+ else
+ chu_serial_receive(rbufp);
+#else
+ chu_serial_receive(rbufp);
+#endif /* HAVE_AUDIO */
+}
+
+
+#ifdef HAVE_AUDIO
+/*
+ * chu_audio_receive - receive data from the audio device
+ */
+static void
+chu_audio_receive(
+ struct recvbuf *rbufp /* receive buffer structure pointer */
+ )
+{
+ struct chuunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ double sample; /* codec sample */
+ u_char *dpt; /* buffer pointer */
+ int bufcnt; /* buffer counter */
+ l_fp ltemp; /* l_fp temp */
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Main loop - read until there ain't no more. Note codec
+ * samples are bit-inverted.
+ */
+ DTOLFP((double)rbufp->recv_length / SECOND, &ltemp);
+ L_SUB(&rbufp->recv_time, &ltemp);
+ up->timestamp = rbufp->recv_time;
+ dpt = rbufp->recv_buffer;
+ for (bufcnt = 0; bufcnt < rbufp->recv_length; bufcnt++) {
+ sample = up->comp[~*dpt++ & 0xff];
+
+ /*
+ * Clip noise spikes greater than MAXAMP. If no clips,
+ * increase the gain a tad; if the clips are too high,
+ * decrease a tad.
+ */
+ if (sample > MAXAMP) {
+ sample = MAXAMP;
+ up->clipcnt++;
+ } else if (sample < -MAXAMP) {
+ sample = -MAXAMP;
+ up->clipcnt++;
+ }
+ chu_rf(peer, sample);
+ L_ADD(&up->timestamp, &up->tick);
+
+ /*
+ * Once each second ride gain.
+ */
+ up->seccnt = (up->seccnt + 1) % SECOND;
+ if (up->seccnt == 0) {
+ chu_gain(peer);
+ }
+ }
+
+ /*
+ * Set the input port and monitor gain for the next buffer.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ up->port = 2;
+ else
+ up->port = 1;
+ if (pp->sloppyclockflag & CLK_FLAG3)
+ up->mongain = MONGAIN;
+ else
+ up->mongain = 0;
+}
+
+
+/*
+ * chu_rf - filter and demodulate the FSK signal
+ *
+ * This routine implements a 300-baud Bell 103 modem with mark 2225 Hz
+ * and space 2025 Hz. It uses a bandpass filter followed by a soft
+ * limiter, FM discriminator and lowpass filter. A maximum-likelihood
+ * decoder samples the baseband signal at eight times the baud rate and
+ * detects the start bit of each character.
+ *
+ * The filters are built for speed, which explains the rather clumsy
+ * code. Hopefully, the compiler will efficiently implement the move-
+ * and-muiltiply-and-add operations.
+ */
+static void
+chu_rf(
+ struct peer *peer, /* peer structure pointer */
+ double sample /* analog sample */
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+ struct surv *sp;
+
+ /*
+ * Local variables
+ */
+ double signal; /* bandpass signal */
+ double limit; /* limiter signal */
+ double disc; /* discriminator signal */
+ double lpf; /* lowpass signal */
+ double dist; /* UART signal distance */
+ int i, j;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Bandpass filter. 4th-order elliptic, 500-Hz bandpass centered
+ * at 2125 Hz. Passband ripple 0.3 dB, stopband ripple 50 dB,
+ * phase delay 0.24 ms.
+ */
+ signal = (up->bpf[8] = up->bpf[7]) * 5.844676e-01;
+ signal += (up->bpf[7] = up->bpf[6]) * 4.884860e-01;
+ signal += (up->bpf[6] = up->bpf[5]) * 2.704384e+00;
+ signal += (up->bpf[5] = up->bpf[4]) * 1.645032e+00;
+ signal += (up->bpf[4] = up->bpf[3]) * 4.644557e+00;
+ signal += (up->bpf[3] = up->bpf[2]) * 1.879165e+00;
+ signal += (up->bpf[2] = up->bpf[1]) * 3.522634e+00;
+ signal += (up->bpf[1] = up->bpf[0]) * 7.315738e-01;
+ up->bpf[0] = sample - signal;
+ signal = up->bpf[0] * 6.176213e-03
+ + up->bpf[1] * 3.156599e-03
+ + up->bpf[2] * 7.567487e-03
+ + up->bpf[3] * 4.344580e-03
+ + up->bpf[4] * 1.190128e-02
+ + up->bpf[5] * 4.344580e-03
+ + up->bpf[6] * 7.567487e-03
+ + up->bpf[7] * 3.156599e-03
+ + up->bpf[8] * 6.176213e-03;
+
+ up->monitor = signal / 4.; /* note monitor after filter */
+
+ /*
+ * Soft limiter/discriminator. The 11-sample discriminator lag
+ * interval corresponds to three cycles of 2125 Hz, which
+ * requires the sample frequency to be 2125 * 11 / 3 = 7791.7
+ * Hz. The discriminator output varies +-0.5 interval for input
+ * frequency 2025-2225 Hz. However, we don't get to sample at
+ * this frequency, so the discriminator output is biased. Life
+ * at 8000 Hz sucks.
+ */
+ limit = signal;
+ if (limit > LIMIT)
+ limit = LIMIT;
+ else if (limit < -LIMIT)
+ limit = -LIMIT;
+ disc = up->disc[up->discptr] * -limit;
+ up->disc[up->discptr] = limit;
+ up->discptr = (up->discptr + 1 ) % LAG;
+ if (disc >= 0)
+ disc = SQRT(disc);
+ else
+ disc = -SQRT(-disc);
+
+ /*
+ * Lowpass filter. Raised cosine FIR, Ts = 1 / 300, beta = 0.1.
+ */
+ lpf = (up->lpf[26] = up->lpf[25]) * 2.538771e-02;
+ lpf += (up->lpf[25] = up->lpf[24]) * 1.084671e-01;
+ lpf += (up->lpf[24] = up->lpf[23]) * 2.003159e-01;
+ lpf += (up->lpf[23] = up->lpf[22]) * 2.985303e-01;
+ lpf += (up->lpf[22] = up->lpf[21]) * 4.003697e-01;
+ lpf += (up->lpf[21] = up->lpf[20]) * 5.028552e-01;
+ lpf += (up->lpf[20] = up->lpf[19]) * 6.028795e-01;
+ lpf += (up->lpf[19] = up->lpf[18]) * 6.973249e-01;
+ lpf += (up->lpf[18] = up->lpf[17]) * 7.831828e-01;
+ lpf += (up->lpf[17] = up->lpf[16]) * 8.576717e-01;
+ lpf += (up->lpf[16] = up->lpf[15]) * 9.183463e-01;
+ lpf += (up->lpf[15] = up->lpf[14]) * 9.631951e-01;
+ lpf += (up->lpf[14] = up->lpf[13]) * 9.907208e-01;
+ lpf += (up->lpf[13] = up->lpf[12]) * 1.000000e+00;
+ lpf += (up->lpf[12] = up->lpf[11]) * 9.907208e-01;
+ lpf += (up->lpf[11] = up->lpf[10]) * 9.631951e-01;
+ lpf += (up->lpf[10] = up->lpf[9]) * 9.183463e-01;
+ lpf += (up->lpf[9] = up->lpf[8]) * 8.576717e-01;
+ lpf += (up->lpf[8] = up->lpf[7]) * 7.831828e-01;
+ lpf += (up->lpf[7] = up->lpf[6]) * 6.973249e-01;
+ lpf += (up->lpf[6] = up->lpf[5]) * 6.028795e-01;
+ lpf += (up->lpf[5] = up->lpf[4]) * 5.028552e-01;
+ lpf += (up->lpf[4] = up->lpf[3]) * 4.003697e-01;
+ lpf += (up->lpf[3] = up->lpf[2]) * 2.985303e-01;
+ lpf += (up->lpf[2] = up->lpf[1]) * 2.003159e-01;
+ lpf += (up->lpf[1] = up->lpf[0]) * 1.084671e-01;
+ lpf += up->lpf[0] = disc * 2.538771e-02;
+
+ /*
+ * Maximum-likelihood decoder. The UART updates each of the
+ * eight survivors and determines the span, slice level and
+ * tentative decoded character. Valid 11-bit characters are
+ * framed so that bit 10 and bit 11 (stop bits) are mark and bit
+ * 1 (start bit) is space. When a valid character is found, the
+ * survivor with maximum distance determines the final decoded
+ * character.
+ */
+ up->baud += 1. / SECOND;
+ if (up->baud > 1. / (BAUD * 8.)) {
+ up->baud -= 1. / (BAUD * 8.);
+ up->decptr = (up->decptr + 1) % 8;
+ sp = &up->surv[up->decptr];
+ sp->cstamp = up->timestamp;
+ chu_uart(sp, -lpf * AGAIN);
+ if (up->dbrk > 0) {
+ up->dbrk--;
+ if (up->dbrk > 0)
+ return;
+
+ up->decpha = up->decptr;
+ }
+ if (up->decptr != up->decpha)
+ return;
+
+ dist = 0;
+ j = -1;
+ for (i = 0; i < 8; i++) {
+
+ /*
+ * The timestamp is taken at the last bit, so
+ * for correct decoding we reqire sufficient
+ * span and correct start bit and two stop bits.
+ */
+ if ((up->surv[i].uart & 0x601) != 0x600 ||
+ up->surv[i].span < SPAN)
+ continue;
+
+ if (up->surv[i].dist > dist) {
+ dist = up->surv[i].dist;
+ j = i;
+ }
+ }
+ if (j < 0)
+ return;
+
+ /*
+ * Process the character, then blank the decoder until
+ * the end of the next character.This sets the decoding
+ * phase of the entire burst from the phase of the first
+ * character.
+ */
+ up->maxsignal = up->surv[j].span;
+ chu_decode(peer, (up->surv[j].uart >> 1) & 0xff,
+ up->surv[j].cstamp);
+ up->dbrk = 88;
+ }
+}
+
+
+/*
+ * chu_uart - maximum-likelihood UART
+ *
+ * This routine updates a shift register holding the last 11 envelope
+ * samples. It then computes the slice level and span over these samples
+ * and determines the tentative data bits and distance. The calling
+ * program selects over the last eight survivors the one with maximum
+ * distance to determine the decoded character.
+ */
+static void
+chu_uart(
+ struct surv *sp, /* survivor structure pointer */
+ double sample /* baseband signal */
+ )
+{
+ double es_max, es_min; /* max/min envelope */
+ double slice; /* slice level */
+ double dist; /* distance */
+ double dtemp;
+ int i;
+
+ /*
+ * Save the sample and shift right. At the same time, measure
+ * the maximum and minimum over all eleven samples.
+ */
+ es_max = -1e6;
+ es_min = 1e6;
+ sp->shift[0] = sample;
+ for (i = 11; i > 0; i--) {
+ sp->shift[i] = sp->shift[i - 1];
+ if (sp->shift[i] > es_max)
+ es_max = sp->shift[i];
+ if (sp->shift[i] < es_min)
+ es_min = sp->shift[i];
+ }
+
+ /*
+ * Determine the span as the maximum less the minimum and the
+ * slice level as the minimum plus a fraction of the span. Note
+ * the slight bias toward mark to correct for the modem tendency
+ * to make more mark than space errors. Compute the distance on
+ * the assumption the last two bits must be mark, the first
+ * space and the rest either mark or space.
+ */
+ sp->span = es_max - es_min;
+ slice = es_min + .45 * sp->span;
+ dist = 0;
+ sp->uart = 0;
+ for (i = 1; i < 12; i++) {
+ sp->uart <<= 1;
+ dtemp = sp->shift[i];
+ if (dtemp > slice)
+ sp->uart |= 0x1;
+ if (i == 1 || i == 2) {
+ dist += dtemp - es_min;
+ } else if (i == 11) {
+ dist += es_max - dtemp;
+ } else {
+ if (dtemp > slice)
+ dist += dtemp - es_min;
+ else
+ dist += es_max - dtemp;
+ }
+ }
+ sp->dist = dist / (11 * sp->span);
+}
+#endif /* HAVE_AUDIO */
+
+
+/*
+ * chu_serial_receive - receive data from the serial device
+ */
+static void
+chu_serial_receive(
+ struct recvbuf *rbufp /* receive buffer structure pointer */
+ )
+{
+ struct chuunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ u_char *dpt; /* receive buffer pointer */
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ dpt = (u_char *)&rbufp->recv_space;
+ chu_decode(peer, *dpt, rbufp->recv_time);
+}
+
+
+/*
+ * chu_decode - decode the character data
+ */
+static void
+chu_decode(
+ struct peer *peer, /* peer structure pointer */
+ int hexhex, /* data character */
+ l_fp cstamp /* data character timestamp */
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+
+ l_fp tstmp; /* timestamp temp */
+ double dtemp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * If the interval since the last character is greater than the
+ * longest burst, process the last burst and start a new one. If
+ * the interval is less than this but greater than two
+ * characters, consider this a noise burst and reject it.
+ */
+ tstmp = up->timestamp;
+ if (L_ISZERO(&up->laststamp))
+ up->laststamp = up->timestamp;
+ L_SUB(&tstmp, &up->laststamp);
+ up->laststamp = up->timestamp;
+ LFPTOD(&tstmp, dtemp);
+ if (dtemp > BURST * CHAR) {
+ chu_burst(peer);
+ up->ndx = 0;
+ } else if (dtemp > 2.5 * CHAR) {
+ up->ndx = 0;
+ }
+
+ /*
+ * Append the character to the current burst and append the
+ * character timestamp to the timestamp list.
+ */
+ if (up->ndx < BURST) {
+ up->cbuf[up->ndx] = hexhex & 0xff;
+ up->cstamp[up->ndx] = cstamp;
+ up->ndx++;
+
+ }
+}
+
+
+/*
+ * chu_burst - search for valid burst format
+ */
+static void
+chu_burst(
+ struct peer *peer
+ )
+{
+ struct chuunit *up;
+ struct refclockproc *pp;
+
+ int i;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Correlate a block of five characters with the next block of
+ * five characters. The burst distance is defined as the number
+ * of bits that match in the two blocks for format A and that
+ * match the inverse for format B.
+ */
+ if (up->ndx < MINCHARS) {
+ up->status |= RUNT;
+ return;
+ }
+ up->burdist = 0;
+ for (i = 0; i < 5 && i < up->ndx - 5; i++)
+ up->burdist += chu_dist(up->cbuf[i], up->cbuf[i + 5]);
+
+ /*
+ * If the burst distance is at least MINDIST, this must be a
+ * format A burst; if the value is not greater than -MINDIST, it
+ * must be a format B burst. If the B burst is perfect, we
+ * believe it; otherwise, it is a noise burst and of no use to
+ * anybody.
+ */
+ if (up->burdist >= MINDIST) {
+ chu_a(peer, up->ndx);
+ } else if (up->burdist <= -MINDIST) {
+ chu_b(peer, up->ndx);
+ } else {
+ up->status |= NOISE;
+ return;
+ }
+
+ /*
+ * If this is a valid burst, wait a guard time of ten seconds to
+ * allow for more bursts, then arm the poll update routine to
+ * process the minute. Don't do this if this is called from the
+ * timer interrupt routine.
+ */
+ if (peer->outdate != current_time)
+ peer->nextdate = current_time + 10;
+}
+
+
+/*
+ * chu_b - decode format B burst
+ */
+static void
+chu_b(
+ struct peer *peer,
+ int nchar
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+
+ u_char code[11]; /* decoded timecode */
+ char tbuf[80]; /* trace buffer */
+ char * p;
+ size_t chars;
+ size_t cb;
+ int i;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * In a format B burst, a character is considered valid only if
+ * the first occurence matches the last occurence. The burst is
+ * considered valid only if all characters are valid; that is,
+ * only if the distance is 40. Note that once a valid frame has
+ * been found errors are ignored.
+ */
+ snprintf(tbuf, sizeof(tbuf), "chuB %04x %4.0f %2d %2d ",
+ up->status, up->maxsignal, nchar, -up->burdist);
+ cb = sizeof(tbuf);
+ p = tbuf;
+ for (i = 0; i < nchar; i++) {
+ chars = strlen(p);
+ if (cb < chars + 1) {
+ msyslog(LOG_ERR, "chu_b() fatal out buffer");
+ exit(1);
+ }
+ cb -= chars;
+ p += chars;
+ snprintf(p, cb, "%02x", up->cbuf[i]);
+ }
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif
+ if (up->burdist > -40) {
+ up->status |= BFRAME;
+ return;
+ }
+
+ /*
+ * Convert the burst data to internal format. Don't bother with
+ * the timestamps.
+ */
+ for (i = 0; i < 5; i++) {
+ code[2 * i] = hexchar[up->cbuf[i] & 0xf];
+ code[2 * i + 1] = hexchar[(up->cbuf[i] >>
+ 4) & 0xf];
+ }
+ if (sscanf((char *)code, "%1x%1d%4d%2d%2x", &up->leap, &up->dut,
+ &pp->year, &up->tai, &up->dst) != 5) {
+ up->status |= BFORMAT;
+ return;
+ }
+ up->status |= BVALID;
+ if (up->leap & 0x8)
+ up->dut = -up->dut;
+}
+
+
+/*
+ * chu_a - decode format A burst
+ */
+static void
+chu_a(
+ struct peer *peer,
+ int nchar
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+
+ char tbuf[80]; /* trace buffer */
+ char * p;
+ size_t chars;
+ size_t cb;
+ l_fp offset; /* timestamp offset */
+ int val; /* distance */
+ int temp;
+ int i, j, k;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Determine correct burst phase. There are three cases
+ * corresponding to in-phase, one character early or one
+ * character late. These cases are distinguished by the position
+ * of the framing digits 0x6 at positions 0 and 5 and 0x3 at
+ * positions 4 and 9. The correct phase is when the distance
+ * relative to the framing digits is maximum. The burst is valid
+ * only if the maximum distance is at least MINSYNC.
+ */
+ up->syndist = k = 0;
+ val = -16;
+ for (i = -1; i < 2; i++) {
+ temp = up->cbuf[i + 4] & 0xf;
+ if (i >= 0)
+ temp |= (up->cbuf[i] & 0xf) << 4;
+ val = chu_dist(temp, 0x63);
+ temp = (up->cbuf[i + 5] & 0xf) << 4;
+ if (i + 9 < nchar)
+ temp |= up->cbuf[i + 9] & 0xf;
+ val += chu_dist(temp, 0x63);
+ if (val > up->syndist) {
+ up->syndist = val;
+ k = i;
+ }
+ }
+
+ /*
+ * Extract the second number; it must be in the range 2 through
+ * 9 and the two repititions must be the same.
+ */
+ temp = (up->cbuf[k + 4] >> 4) & 0xf;
+ if (temp < 2 || temp > 9 || k + 9 >= nchar || temp !=
+ ((up->cbuf[k + 9] >> 4) & 0xf))
+ temp = 0;
+ snprintf(tbuf, sizeof(tbuf),
+ "chuA %04x %4.0f %2d %2d %2d %2d %1d ", up->status,
+ up->maxsignal, nchar, up->burdist, k, up->syndist,
+ temp);
+ cb = sizeof(tbuf);
+ p = tbuf;
+ for (i = 0; i < nchar; i++) {
+ chars = strlen(p);
+ if (cb < chars + 1) {
+ msyslog(LOG_ERR, "chu_a() fatal out buffer");
+ exit(1);
+ }
+ cb -= chars;
+ p += chars;
+ snprintf(p, cb, "%02x", up->cbuf[i]);
+ }
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif
+ if (up->syndist < MINSYNC) {
+ up->status |= AFRAME;
+ return;
+ }
+
+ /*
+ * A valid burst requires the first seconds number to match the
+ * last seconds number. If so, the burst timestamps are
+ * corrected to the current minute and saved for later
+ * processing. In addition, the seconds decode is advanced from
+ * the previous burst to the current one.
+ */
+ if (temp == 0) {
+ up->status |= AFORMAT;
+ } else {
+ up->status |= AVALID;
+ up->second = pp->second = 30 + temp;
+ offset.l_ui = 30 + temp;
+ offset.l_uf = 0;
+ i = 0;
+ if (k < 0)
+ offset = up->charstamp;
+ else if (k > 0)
+ i = 1;
+ for (; i < nchar && i < k + 10; i++) {
+ up->tstamp[up->ntstamp] = up->cstamp[i];
+ L_SUB(&up->tstamp[up->ntstamp], &offset);
+ L_ADD(&offset, &up->charstamp);
+ if (up->ntstamp < MAXSTAGE - 1)
+ up->ntstamp++;
+ }
+ while (temp > up->prevsec) {
+ for (j = 15; j > 0; j--) {
+ up->decode[9][j] = up->decode[9][j - 1];
+ up->decode[19][j] =
+ up->decode[19][j - 1];
+ }
+ up->decode[9][j] = up->decode[19][j] = 0;
+ up->prevsec++;
+ }
+ }
+
+ /*
+ * Stash the data in the decoding matrix.
+ */
+ i = -(2 * k);
+ for (j = 0; j < nchar; j++) {
+ if (i < 0 || i > 18) {
+ i += 2;
+ continue;
+ }
+ up->decode[i][up->cbuf[j] & 0xf]++;
+ i++;
+ up->decode[i][(up->cbuf[j] >> 4) & 0xf]++;
+ i++;
+ }
+ up->burstcnt++;
+}
+
+
+/*
+ * chu_poll - called by the transmit procedure
+ */
+static void
+chu_poll(
+ int unit,
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ pp->polls++;
+}
+
+
+/*
+ * chu_second - process minute data
+ */
+static void
+chu_second(
+ int unit,
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+ l_fp offset;
+ char synchar, qual, leapchar;
+ int minset, i;
+ double dtemp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * This routine is called once per minute to process the
+ * accumulated burst data. We do a bit of fancy footwork so that
+ * this doesn't run while burst data are being accumulated.
+ */
+ up->second = (up->second + 1) % 60;
+ if (up->second != 0)
+ return;
+
+ /*
+ * Process the last burst, if still in the burst buffer.
+ * If the minute contains a valid B frame with sufficient A
+ * frame metric, it is considered valid. However, the timecode
+ * is sent to clockstats even if invalid.
+ */
+ chu_burst(peer);
+ minset = ((current_time - peer->update) + 30) / 60;
+ dtemp = chu_major(peer);
+ qual = 0;
+ if (up->status & (BFRAME | AFRAME))
+ qual |= SYNERR;
+ if (up->status & (BFORMAT | AFORMAT))
+ qual |= FMTERR;
+ if (up->status & DECODE)
+ qual |= DECERR;
+ if (up->status & STAMP)
+ qual |= TSPERR;
+ if (up->status & BVALID && dtemp >= MINMETRIC)
+ up->status |= INSYNC;
+ synchar = leapchar = ' ';
+ if (!(up->status & INSYNC)) {
+ pp->leap = LEAP_NOTINSYNC;
+ synchar = '?';
+ } else if (up->leap & 0x2) {
+ pp->leap = LEAP_ADDSECOND;
+ leapchar = 'L';
+ } else if (up->leap & 0x4) {
+ pp->leap = LEAP_DELSECOND;
+ leapchar = 'l';
+ } else {
+ pp->leap = LEAP_NOWARNING;
+ }
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%c%1X %04d %03d %02d:%02d:%02d %c%x %+d %d %d %s %.0f %d",
+ synchar, qual, pp->year, pp->day, pp->hour, pp->minute,
+ pp->second, leapchar, up->dst, up->dut, minset, up->gain,
+ up->ident, dtemp, up->ntstamp);
+ pp->lencode = strlen(pp->a_lastcode);
+
+ /*
+ * If in sync and the signal metric is above threshold, the
+ * timecode is ipso fatso valid and can be selected to
+ * discipline the clock.
+ */
+ if (up->status & INSYNC && !(up->status & (DECODE | STAMP)) &&
+ dtemp > MINMETRIC) {
+ if (!clocktime(pp->day, pp->hour, pp->minute, 0, GMT,
+ up->tstamp[0].l_ui, &pp->yearstart, &offset.l_ui)) {
+ up->errflg = CEVNT_BADTIME;
+ } else {
+ offset.l_uf = 0;
+ for (i = 0; i < up->ntstamp; i++)
+ refclock_process_offset(pp, offset,
+ up->tstamp[i], PDELAY +
+ pp->fudgetime1);
+ pp->lastref = up->timestamp;
+ refclock_receive(peer);
+ }
+ }
+ if (dtemp > 0)
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("chu: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif
+#ifdef ICOM
+ chu_newchan(peer, dtemp);
+#endif /* ICOM */
+ chu_clear(peer);
+ if (up->errflg)
+ refclock_report(peer, up->errflg);
+ up->errflg = 0;
+}
+
+
+/*
+ * chu_major - majority decoder
+ */
+static double
+chu_major(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+
+ u_char code[11]; /* decoded timecode */
+ int metric; /* distance metric */
+ int val1; /* maximum distance */
+ int synchar; /* stray cat */
+ int temp;
+ int i, j, k;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Majority decoder. Each burst encodes two replications at each
+ * digit position in the timecode. Each row of the decoding
+ * matrix encodes the number of occurences of each digit found
+ * at the corresponding position. The maximum over all
+ * occurrences at each position is the distance for this
+ * position and the corresponding digit is the maximum-
+ * likelihood candidate. If the distance is not more than half
+ * the total number of occurences, a majority has not been found
+ * and the data are discarded. The decoding distance is defined
+ * as the sum of the distances over the first nine digits. The
+ * tenth digit varies over the seconds, so we don't count it.
+ */
+ metric = 0;
+ for (i = 0; i < 9; i++) {
+ val1 = 0;
+ k = 0;
+ for (j = 0; j < 16; j++) {
+ temp = up->decode[i][j] + up->decode[i + 10][j];
+ if (temp > val1) {
+ val1 = temp;
+ k = j;
+ }
+ }
+ if (val1 <= up->burstcnt)
+ up->status |= DECODE;
+ metric += val1;
+ code[i] = hexchar[k];
+ }
+
+ /*
+ * Compute the timecode timestamp from the days, hours and
+ * minutes of the timecode. Use clocktime() for the aggregate
+ * minutes and the minute offset computed from the burst
+ * seconds. Note that this code relies on the filesystem time
+ * for the years and does not use the years of the timecode.
+ */
+ if (sscanf((char *)code, "%1x%3d%2d%2d", &synchar, &pp->day,
+ &pp->hour, &pp->minute) != 4)
+ up->status |= DECODE;
+ if (up->ntstamp < MINSTAMP)
+ up->status |= STAMP;
+ return (metric);
+}
+
+
+/*
+ * chu_clear - clear decoding matrix
+ */
+static void
+chu_clear(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+ int i, j;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Clear stuff for the minute.
+ */
+ up->ndx = up->prevsec = 0;
+ up->burstcnt = up->ntstamp = 0;
+ up->status &= INSYNC | METRIC;
+ for (i = 0; i < 20; i++) {
+ for (j = 0; j < 16; j++)
+ up->decode[i][j] = 0;
+ }
+}
+
+#ifdef ICOM
+/*
+ * chu_newchan - called once per minute to find the best channel;
+ * returns zero on success, nonzero if ICOM error.
+ */
+static int
+chu_newchan(
+ struct peer *peer,
+ double met
+ )
+{
+ struct chuunit *up;
+ struct refclockproc *pp;
+ struct xmtr *sp;
+ int rval;
+ double metric;
+ int i;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * The radio can be tuned to three channels: 0 (3330 kHz), 1
+ * (7850 kHz) and 2 (14670 kHz). There are five one-minute
+ * dwells in each cycle. During the first dwell the radio is
+ * tuned to one of the three channels to measure the channel
+ * metric. The channel is selected as the one least recently
+ * measured. During the remaining four dwells the radio is tuned
+ * to the channel with the highest channel metric.
+ */
+ if (up->fd_icom <= 0)
+ return (0);
+
+ /*
+ * Update the current channel metric and age of all channels.
+ * Scan all channels for the highest metric.
+ */
+ sp = &up->xmtr[up->chan];
+ sp->metric -= sp->integ[sp->iptr];
+ sp->integ[sp->iptr] = met;
+ sp->metric += sp->integ[sp->iptr];
+ sp->probe = 0;
+ sp->iptr = (sp->iptr + 1) % ISTAGE;
+ metric = 0;
+ for (i = 0; i < NCHAN; i++) {
+ up->xmtr[i].probe++;
+ if (up->xmtr[i].metric > metric) {
+ up->status |= METRIC;
+ metric = up->xmtr[i].metric;
+ up->chan = i;
+ }
+ }
+
+ /*
+ * Start the next dwell. If the first dwell or no stations have
+ * been heard, continue round-robin scan.
+ */
+ up->dwell = (up->dwell + 1) % DWELL;
+ if (up->dwell == 0 || metric == 0) {
+ rval = 0;
+ for (i = 0; i < NCHAN; i++) {
+ if (up->xmtr[i].probe > rval) {
+ rval = up->xmtr[i].probe;
+ up->chan = i;
+ }
+ }
+ }
+
+ /* Retune the radio at each dwell in case somebody nudges the
+ * tuning knob.
+ */
+ rval = icom_freq(up->fd_icom, peer->ttl & 0x7f, qsy[up->chan] +
+ TUNE);
+ snprintf(up->ident, sizeof(up->ident), "CHU%d", up->chan);
+ memcpy(&pp->refid, up->ident, 4);
+ memcpy(&peer->refid, up->ident, 4);
+ if (metric == 0 && up->status & METRIC) {
+ up->status &= ~METRIC;
+ refclock_report(peer, CEVNT_PROP);
+ }
+ return (rval);
+}
+#endif /* ICOM */
+
+
+/*
+ * chu_dist - determine the distance of two octet arguments
+ */
+static int
+chu_dist(
+ int x, /* an octet of bits */
+ int y /* another octet of bits */
+ )
+{
+ int val; /* bit count */
+ int temp;
+ int i;
+
+ /*
+ * The distance is determined as the weight of the exclusive OR
+ * of the two arguments. The weight is determined by the number
+ * of one bits in the result. Each one bit increases the weight,
+ * while each zero bit decreases it.
+ */
+ temp = x ^ y;
+ val = 0;
+ for (i = 0; i < 8; i++) {
+ if ((temp & 0x1) == 0)
+ val++;
+ else
+ val--;
+ temp >>= 1;
+ }
+ return (val);
+}
+
+
+#ifdef HAVE_AUDIO
+/*
+ * chu_gain - adjust codec gain
+ *
+ * This routine is called at the end of each second. During the second
+ * the number of signal clips above the MAXAMP threshold (6000). If
+ * there are no clips, the gain is bumped up; if there are more than
+ * MAXCLP clips (100), it is bumped down. The decoder is relatively
+ * insensitive to amplitude, so this crudity works just peachy. The
+ * routine also jiggles the input port and selectively mutes the
+ */
+static void
+chu_gain(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Apparently, the codec uses only the high order bits of the
+ * gain control field. Thus, it may take awhile for changes to
+ * wiggle the hardware bits.
+ */
+ if (up->clipcnt == 0) {
+ up->gain += 4;
+ if (up->gain > MAXGAIN)
+ up->gain = MAXGAIN;
+ } else if (up->clipcnt > MAXCLP) {
+ up->gain -= 4;
+ if (up->gain < 0)
+ up->gain = 0;
+ }
+ audio_gain(up->gain, up->mongain, up->port);
+ up->clipcnt = 0;
+}
+#endif /* HAVE_AUDIO */
+
+
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_conf.c b/ntpd/refclock_conf.c
new file mode 100644
index 0000000..30cc632
--- /dev/null
+++ b/ntpd/refclock_conf.c
@@ -0,0 +1,326 @@
+/*
+ * refclock_conf.c - reference clock configuration
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#include "ntpd.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+#ifdef REFCLOCK
+
+static struct refclock refclock_none = {
+ noentry, noentry, noentry, noentry, noentry, noentry, NOFLAGS
+};
+
+#ifdef CLOCK_LOCAL
+extern struct refclock refclock_local;
+#else
+#define refclock_local refclock_none
+#endif
+
+#ifdef CLOCK_PST
+extern struct refclock refclock_pst;
+#else
+#define refclock_pst refclock_none
+#endif
+
+#ifdef CLOCK_CHU
+extern struct refclock refclock_chu;
+#else
+#define refclock_chu refclock_none
+#endif
+
+#ifdef CLOCK_WWV
+extern struct refclock refclock_wwv;
+#else
+#define refclock_wwv refclock_none
+#endif
+
+#ifdef CLOCK_SPECTRACOM
+extern struct refclock refclock_wwvb;
+#else
+#define refclock_wwvb refclock_none
+#endif
+
+#ifdef CLOCK_PARSE
+extern struct refclock refclock_parse;
+#else
+#define refclock_parse refclock_none
+#endif
+
+#if defined(CLOCK_MX4200) && defined(HAVE_PPSAPI)
+extern struct refclock refclock_mx4200;
+#else
+#define refclock_mx4200 refclock_none
+#endif
+
+#ifdef CLOCK_AS2201
+extern struct refclock refclock_as2201;
+#else
+#define refclock_as2201 refclock_none
+#endif
+
+#ifdef CLOCK_ARBITER
+extern struct refclock refclock_arbiter;
+#else
+#define refclock_arbiter refclock_none
+#endif
+
+#ifdef CLOCK_TPRO
+extern struct refclock refclock_tpro;
+#else
+#define refclock_tpro refclock_none
+#endif
+
+#ifdef CLOCK_LEITCH
+extern struct refclock refclock_leitch;
+#else
+#define refclock_leitch refclock_none
+#endif
+
+#ifdef CLOCK_IRIG
+extern struct refclock refclock_irig;
+#else
+#define refclock_irig refclock_none
+#endif
+
+#if 0 && defined(CLOCK_MSFEES) && defined(PPS)
+extern struct refclock refclock_msfees;
+#else
+#define refclock_msfees refclock_none
+#endif
+
+#ifdef CLOCK_BANC
+extern struct refclock refclock_bancomm;
+#else
+#define refclock_bancomm refclock_none
+#endif
+
+#ifdef CLOCK_TRUETIME
+extern struct refclock refclock_true;
+#else
+#define refclock_true refclock_none
+#endif
+
+#ifdef CLOCK_DATUM
+extern struct refclock refclock_datum;
+#else
+#define refclock_datum refclock_none
+#endif
+
+#ifdef CLOCK_ACTS
+extern struct refclock refclock_acts;
+#else
+#define refclock_acts refclock_none
+#endif
+
+#ifdef CLOCK_HEATH
+extern struct refclock refclock_heath;
+#else
+#define refclock_heath refclock_none
+#endif
+
+#ifdef CLOCK_NMEA
+extern struct refclock refclock_nmea;
+#else
+#define refclock_nmea refclock_none
+#endif
+
+#if defined (CLOCK_ATOM) && defined(HAVE_PPSAPI)
+extern struct refclock refclock_atom;
+#else
+#define refclock_atom refclock_none
+#endif
+
+#ifdef CLOCK_HPGPS
+extern struct refclock refclock_hpgps;
+#else
+#define refclock_hpgps refclock_none
+#endif
+
+#ifdef CLOCK_GPSVME
+extern struct refclock refclock_gpsvme;
+#else
+#define refclock_gpsvme refclock_none
+#endif
+
+#ifdef CLOCK_ARCRON_MSF
+extern struct refclock refclock_arc;
+#else
+#define refclock_arc refclock_none
+#endif
+
+#ifdef CLOCK_SHM
+extern struct refclock refclock_shm;
+#else
+#define refclock_shm refclock_none
+#endif
+
+#ifdef CLOCK_PALISADE
+extern struct refclock refclock_palisade;
+#else
+#define refclock_palisade refclock_none
+#endif
+
+#if defined(CLOCK_ONCORE)
+extern struct refclock refclock_oncore;
+#else
+#define refclock_oncore refclock_none
+#endif
+
+#if defined(CLOCK_JUPITER) && defined(HAVE_PPSAPI)
+extern struct refclock refclock_jupiter;
+#else
+#define refclock_jupiter refclock_none
+#endif
+
+#if defined(CLOCK_CHRONOLOG)
+extern struct refclock refclock_chronolog;
+#else
+#define refclock_chronolog refclock_none
+#endif
+
+#if defined(CLOCK_DUMBCLOCK)
+extern struct refclock refclock_dumbclock;
+#else
+#define refclock_dumbclock refclock_none
+#endif
+
+#ifdef CLOCK_ULINK
+extern struct refclock refclock_ulink;
+#else
+#define refclock_ulink refclock_none
+#endif
+
+#ifdef CLOCK_PCF
+extern struct refclock refclock_pcf;
+#else
+#define refclock_pcf refclock_none
+#endif
+
+#ifdef CLOCK_FG
+extern struct refclock refclock_fg;
+#else
+#define refclock_fg refclock_none
+#endif
+
+#ifdef CLOCK_HOPF_SERIAL
+extern struct refclock refclock_hopfser;
+#else
+#define refclock_hopfser refclock_none
+#endif
+
+#ifdef CLOCK_HOPF_PCI
+extern struct refclock refclock_hopfpci;
+#else
+#define refclock_hopfpci refclock_none
+#endif
+
+#ifdef CLOCK_JJY
+extern struct refclock refclock_jjy;
+#else
+#define refclock_jjy refclock_none
+#endif
+
+#ifdef CLOCK_TT560
+extern struct refclock refclock_tt560;
+#else
+#define refclock_tt560 refclock_none
+#endif
+
+#ifdef CLOCK_ZYFER
+extern struct refclock refclock_zyfer;
+#else
+#define refclock_zyfer refclock_none
+#endif
+
+#ifdef CLOCK_RIPENCC
+extern struct refclock refclock_ripencc;
+#else
+#define refclock_ripencc refclock_none
+#endif
+
+#ifdef CLOCK_NEOCLOCK4X
+extern struct refclock refclock_neoclock4x;
+#else
+#define refclock_neoclock4x refclock_none
+#endif
+
+#ifdef CLOCK_TSYNCPCI
+extern struct refclock refclock_tsyncpci;
+#else
+#define refclock_tsyncpci refclock_none
+#endif
+
+#if defined(CLOCK_GPSDJSON) && !defined(SYS_WINNT)
+extern struct refclock refclock_gpsdjson;
+#else
+#define refclock_gpsdjson refclock_none
+#endif
+/*
+ * Order is clock_start(), clock_shutdown(), clock_poll(),
+ * clock_control(), clock_init(), clock_buginfo, clock_flags;
+ *
+ * Types are defined in ntp.h. The index must match this.
+ */
+struct refclock * const refclock_conf[] = {
+ &refclock_none, /* 0 REFCLK_NONE */
+ &refclock_local, /* 1 REFCLK_LOCAL */
+ &refclock_none, /* 2 deprecated: REFCLK_GPS_TRAK */
+ &refclock_pst, /* 3 REFCLK_WWV_PST */
+ &refclock_wwvb, /* 4 REFCLK_SPECTRACOM */
+ &refclock_true, /* 5 REFCLK_TRUETIME */
+ &refclock_irig, /* 6 REFCLK_IRIG_AUDIO */
+ &refclock_chu, /* 7 REFCLK_CHU_AUDIO */
+ &refclock_parse, /* 8 REFCLK_PARSE */
+ &refclock_mx4200, /* 9 REFCLK_GPS_MX4200 */
+ &refclock_as2201, /* 10 REFCLK_GPS_AS2201 */
+ &refclock_arbiter, /* 11 REFCLK_GPS_ARBITER */
+ &refclock_tpro, /* 12 REFCLK_IRIG_TPRO */
+ &refclock_leitch, /* 13 REFCLK_ATOM_LEITCH */
+ &refclock_none, /* 14 deprecated: REFCLK_MSF_EES */
+ &refclock_none, /* 15 not used */
+ &refclock_bancomm, /* 16 REFCLK_IRIG_BANCOMM */
+ &refclock_datum, /* 17 REFCLK_GPS_DATUM */
+ &refclock_acts, /* 18 REFCLK_ACTS */
+ &refclock_heath, /* 19 REFCLK_WWV_HEATH */
+ &refclock_nmea, /* 20 REFCLK_GPS_NMEA */
+ &refclock_gpsvme, /* 21 REFCLK_GPS_VME */
+ &refclock_atom, /* 22 REFCLK_ATOM_PPS */
+ &refclock_none, /* 23 not used */
+ &refclock_none, /* 24 not used */
+ &refclock_none, /* 25 not used */
+ &refclock_hpgps, /* 26 REFCLK_GPS_HP */
+ &refclock_arc, /* 27 REFCLK_ARCRON_MSF */
+ &refclock_shm, /* 28 REFCLK_SHM */
+ &refclock_palisade, /* 29 REFCLK_PALISADE */
+ &refclock_oncore, /* 30 REFCLK_ONCORE */
+ &refclock_jupiter, /* 31 REFCLK_GPS_JUPITER */
+ &refclock_chronolog, /* 32 REFCLK_CHRONOLOG */
+ &refclock_dumbclock, /* 33 REFCLK_DUMBCLOCK */
+ &refclock_ulink, /* 34 REFCLOCK_ULINK */
+ &refclock_pcf, /* 35 REFCLOCK_PCF */
+ &refclock_wwv, /* 36 REFCLOCK_WWV_AUDIO */
+ &refclock_fg, /* 37 REFCLOCK_FG */
+ &refclock_hopfser, /* 38 REFCLK_HOPF_SERIAL */
+ &refclock_hopfpci, /* 39 REFCLK_HOPF_PCI */
+ &refclock_jjy, /* 40 REFCLK_JJY */
+ &refclock_tt560, /* 41 REFCLK_TT560 */
+ &refclock_zyfer, /* 42 REFCLK_ZYFER */
+ &refclock_ripencc, /* 43 REFCLK_RIPENCC */
+ &refclock_neoclock4x, /* 44 REFCLK_NEOCLOCK4X */
+ &refclock_tsyncpci, /* 45 REFCLK_TSYNCPCI */
+ &refclock_gpsdjson /* 46 REFCLK_GPSDJSON */
+};
+
+u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);
+
+#else
+int refclock_conf_bs;
+#endif
diff --git a/ntpd/refclock_datum.c b/ntpd/refclock_datum.c
new file mode 100644
index 0000000..95f13a8
--- /dev/null
+++ b/ntpd/refclock_datum.c
@@ -0,0 +1,782 @@
+/*
+** refclock_datum - clock driver for the Datum Programmable Time Server
+**
+** Important note: This driver assumes that you have termios. If you have
+** a system that does not have termios, you will have to modify this driver.
+**
+** Sorry, I have only tested this driver on SUN and HP platforms.
+*/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_DATUM)
+
+/*
+** Include Files
+*/
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_tty.h"
+#include "ntp_refclock.h"
+#include "timevalops.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#if defined(STREAM)
+#include <stropts.h>
+#endif /* STREAM */
+
+#include "ntp_stdlib.h"
+
+/*
+** This driver supports the Datum Programmable Time System (PTS) clock.
+** The clock works in very straight forward manner. When it receives a
+** time code request (e.g., the ascii string "//k/mn"), it responds with
+** a seven byte BCD time code. This clock only responds with a
+** time code after it first receives the "//k/mn" message. It does not
+** periodically send time codes back at some rate once it is started.
+** the returned time code can be broken down into the following fields.
+**
+** _______________________________
+** Bit Index | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+** ===============================
+** byte 0: | - - - - | H D |
+** ===============================
+** byte 1: | T D | U D |
+** ===============================
+** byte 2: | - - | T H | U H |
+** ===============================
+** byte 3: | - | T M | U M |
+** ===============================
+** byte 4: | - | T S | U S |
+** ===============================
+** byte 5: | t S | h S |
+** ===============================
+** byte 6: | m S | - - - - |
+** ===============================
+**
+** In the table above:
+**
+** "-" means don't care
+** "H D", "T D", and "U D" means Hundreds, Tens, and Units of Days
+** "T H", and "UH" means Tens and Units of Hours
+** "T M", and "U M" means Tens and Units of Minutes
+** "T S", and "U S" means Tens and Units of Seconds
+** "t S", "h S", and "m S" means tenths, hundredths, and thousandths
+** of seconds
+**
+** The Datum PTS communicates throught the RS232 port on your machine.
+** Right now, it assumes that you have termios. This driver has been tested
+** on SUN and HP workstations. The Datum PTS supports various IRIG and
+** NASA input codes. This driver assumes that the name of the device is
+** /dev/datum. You will need to make a soft link to your RS232 device or
+** create a new driver to use this refclock.
+*/
+
+/*
+** Datum PTS defines
+*/
+
+/*
+** Note that if GMT is defined, then the Datum PTS must use Greenwich
+** time. Otherwise, this driver allows the Datum PTS to use the current
+** wall clock for its time. It determines the time zone offset by minimizing
+** the error after trying several time zone offsets. If the Datum PTS
+** time is Greenwich time and GMT is not defined, everything should still
+** work since the time zone will be found to be 0. What this really means
+** is that your system time (at least to start with) must be within the
+** correct time by less than +- 30 minutes. The default is for GMT to not
+** defined. If you really want to force GMT without the funny +- 30 minute
+** stuff then you must define (uncomment) GMT below.
+*/
+
+/*
+#define GMT
+#define DEBUG_DATUM_PTC
+#define LOG_TIME_ERRORS
+*/
+
+
+#define PRECISION (-10) /* precision assumed 1/1024 ms */
+#define REFID "DATM" /* reference id */
+#define DATUM_DISPERSION 0 /* fixed dispersion = 0 ms */
+#define DATUM_MAX_ERROR 0.100 /* limits on sigma squared */
+#define DATUM_DEV "/dev/datum" /* device name */
+
+#define DATUM_MAX_ERROR2 (DATUM_MAX_ERROR*DATUM_MAX_ERROR)
+
+/*
+** The Datum PTS structure
+*/
+
+/*
+** I don't use a fixed array of MAXUNITS like everyone else just because
+** I don't like to program that way. Sorry if this bothers anyone. I assume
+** that you can use any id for your unit and I will search for it in a
+** dynamic array of units until I find it. I was worried that users might
+** enter a bad id in their configuration file (larger than MAXUNITS) and
+** besides, it is just cleaner not to have to assume that you have a fixed
+** number of anything in a program.
+*/
+
+struct datum_pts_unit {
+ struct peer *peer; /* peer used by ntp */
+ int PTS_fd; /* file descriptor for PTS */
+ u_int unit; /* id for unit */
+ u_long timestarted; /* time started */
+ l_fp lastrec; /* time tag for the receive time (system) */
+ l_fp lastref; /* reference time (Datum time) */
+ u_long yearstart; /* the year that this clock started */
+ int coderecv; /* number of time codes received */
+ int day; /* day */
+ int hour; /* hour */
+ int minute; /* minutes */
+ int second; /* seconds */
+ int msec; /* miliseconds */
+ int usec; /* miliseconds */
+ u_char leap; /* funny leap character code */
+ char retbuf[8]; /* returned time from the datum pts */
+ char nbytes; /* number of bytes received from datum pts */
+ double sigma2; /* average squared error (roughly) */
+ int tzoff; /* time zone offest from GMT */
+};
+
+/*
+** PTS static constant variables for internal use
+*/
+
+static char TIME_REQUEST[6]; /* request message sent to datum for time */
+static int nunits; /* number of active units */
+
+/*
+** Callback function prototypes that ntpd needs to know about.
+*/
+
+static int datum_pts_start (int, struct peer *);
+static void datum_pts_shutdown (int, struct peer *);
+static void datum_pts_poll (int, struct peer *);
+static void datum_pts_control (int, const struct refclockstat *,
+ struct refclockstat *, struct peer *);
+static void datum_pts_init (void);
+static void datum_pts_buginfo (int, struct refclockbug *, struct peer *);
+
+/*
+** This is the call back function structure that ntpd actually uses for
+** this refclock.
+*/
+
+struct refclock refclock_datum = {
+ datum_pts_start, /* start up a new Datum refclock */
+ datum_pts_shutdown, /* shutdown a Datum refclock */
+ datum_pts_poll, /* sends out the time request */
+ datum_pts_control, /* not used */
+ datum_pts_init, /* initialization (called first) */
+ datum_pts_buginfo, /* not used */
+ NOFLAGS /* we are not setting any special flags */
+};
+
+/*
+** The datum_pts_receive callback function is handled differently from the
+** rest. It is passed to the ntpd io data structure. Basically, every
+** 64 seconds, the datum_pts_poll() routine is called. It sends out the time
+** request message to the Datum Programmable Time System. Then, ntpd
+** waits on a select() call to receive data back. The datum_pts_receive()
+** function is called as data comes back. We expect a seven byte time
+** code to be returned but the datum_pts_receive() function may only get
+** a few bytes passed to it at a time. In other words, this routine may
+** get called by the io stuff in ntpd a few times before we get all seven
+** bytes. Once the last byte is received, we process it and then pass the
+** new time measurement to ntpd for updating the system time. For now,
+** there is no 3 state filtering done on the time measurements. The
+** jitter may be a little high but at least for its current use, it is not
+** a problem. We have tried to keep things as simple as possible. This
+** clock should not jitter more than 1 or 2 mseconds at the most once
+** things settle down. It is important to get the right drift calibrated
+** in the ntpd.drift file as well as getting the right tick set up right
+** using tickadj for SUNs. Tickadj is not used for the HP but you need to
+** remember to bring up the adjtime daemon because HP does not support
+** the adjtime() call.
+*/
+
+static void datum_pts_receive (struct recvbuf *);
+
+/*......................................................................*/
+/* datum_pts_start - start up the datum PTS. This means open the */
+/* RS232 device and set up the data structure for my unit. */
+/*......................................................................*/
+
+static int
+datum_pts_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct datum_pts_unit *datum_pts;
+ int fd;
+#ifdef HAVE_TERMIOS
+ int rc;
+ struct termios arg;
+#endif
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Starting Datum PTS unit %d\n", unit);
+#endif
+
+ /*
+ ** Open the Datum PTS device
+ */
+ fd = open(DATUM_DEV, O_RDWR);
+
+ if (fd < 0) {
+ msyslog(LOG_ERR, "Datum_PTS: open(\"%s\", O_RDWR) failed: %m", DATUM_DEV);
+ return 0;
+ }
+
+ /*
+ ** Create the memory for the new unit
+ */
+ datum_pts = emalloc_zero(sizeof(*datum_pts));
+ datum_pts->unit = unit; /* set my unit id */
+ datum_pts->yearstart = 0; /* initialize the yearstart to 0 */
+ datum_pts->sigma2 = 0.0; /* initialize the sigma2 to 0 */
+
+ datum_pts->PTS_fd = fd;
+
+ if (-1 == fcntl(datum_pts->PTS_fd, F_SETFL, 0)) /* clear the descriptor flags */
+ msyslog(LOG_ERR, "MSF_ARCRON(%d): fcntl(F_SETFL, 0): %m.",
+ unit);
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Opening RS232 port with file descriptor %d\n",
+ datum_pts->PTS_fd);
+#endif
+
+ /*
+ ** Set up the RS232 terminal device information. Note that we assume that
+ ** we have termios. This code has only been tested on SUNs and HPs. If your
+ ** machine does not have termios this driver cannot be initialized. You can change this
+ ** if you want by editing this source. Please give the changes back to the
+ ** ntp folks so that it can become part of their regular distribution.
+ */
+
+ memset(&arg, 0, sizeof(arg));
+
+ arg.c_iflag = IGNBRK;
+ arg.c_oflag = 0;
+ arg.c_cflag = B9600 | CS8 | CREAD | PARENB | CLOCAL;
+ arg.c_lflag = 0;
+ arg.c_cc[VMIN] = 0; /* start timeout timer right away (not used) */
+ arg.c_cc[VTIME] = 30; /* 3 second timout on reads (not used) */
+
+ rc = tcsetattr(datum_pts->PTS_fd, TCSANOW, &arg);
+ if (rc < 0) {
+ msyslog(LOG_ERR, "Datum_PTS: tcsetattr(\"%s\") failed: %m", DATUM_DEV);
+ close(datum_pts->PTS_fd);
+ free(datum_pts);
+ return 0;
+ }
+
+ /*
+ ** Initialize the ntpd IO structure
+ */
+
+ datum_pts->peer = peer;
+ pp = peer->procptr;
+ pp->io.clock_recv = datum_pts_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = datum_pts->PTS_fd;
+
+ if (!io_addclock(&pp->io)) {
+ pp->io.fd = -1;
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Problem adding clock\n");
+#endif
+
+ msyslog(LOG_ERR, "Datum_PTS: Problem adding clock");
+ close(datum_pts->PTS_fd);
+ free(datum_pts);
+
+ return 0;
+ }
+ peer->procptr->unitptr = datum_pts;
+
+ /*
+ ** Now add one to the number of units and return a successful code
+ */
+
+ nunits++;
+ return 1;
+
+}
+
+
+/*......................................................................*/
+/* datum_pts_shutdown - this routine shuts doen the device and */
+/* removes the memory for the unit. */
+/*......................................................................*/
+
+static void
+datum_pts_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct datum_pts_unit *datum_pts;
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Shutdown Datum PTS\n");
+#endif
+
+ msyslog(LOG_ERR, "Datum_PTS: Shutdown Datum PTS");
+
+ /*
+ ** We found the unit so close the file descriptor and free up the memory used
+ ** by the structure.
+ */
+ pp = peer->procptr;
+ datum_pts = pp->unitptr;
+ if (NULL != datum_pts) {
+ io_closeclock(&pp->io);
+ free(datum_pts);
+ }
+}
+
+
+/*......................................................................*/
+/* datum_pts_poll - this routine sends out the time request to the */
+/* Datum PTS device. The time will be passed back in the */
+/* datum_pts_receive() routine. */
+/*......................................................................*/
+
+static void
+datum_pts_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ int error_code;
+ struct datum_pts_unit *datum_pts;
+
+ datum_pts = peer->procptr->unitptr;
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Poll Datum PTS\n");
+#endif
+
+ /*
+ ** Find the right unit and send out a time request once it is found.
+ */
+ error_code = write(datum_pts->PTS_fd, TIME_REQUEST, 6);
+ if (error_code != 6)
+ perror("TIME_REQUEST");
+ datum_pts->nbytes = 0;
+}
+
+
+/*......................................................................*/
+/* datum_pts_control - not used */
+/*......................................................................*/
+
+static void
+datum_pts_control(
+ int unit,
+ const struct refclockstat *in,
+ struct refclockstat *out,
+ struct peer *peer
+ )
+{
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Control Datum PTS\n");
+#endif
+
+}
+
+
+/*......................................................................*/
+/* datum_pts_init - initializes things for all possible Datum */
+/* time code generators that might be used. In practice, this is */
+/* only called once at the beginning before anything else is */
+/* called. */
+/*......................................................................*/
+
+static void
+datum_pts_init(void)
+{
+
+ /* */
+ /*...... open up the log file if we are debugging ......................*/
+ /* */
+
+ /*
+ ** Open up the log file if we are debugging. For now, send data out to the
+ ** screen (stdout).
+ */
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Init Datum PTS\n");
+#endif
+
+ /*
+ ** Initialize the time request command string. This is the only message
+ ** that we ever have to send to the Datum PTS (although others are defined).
+ */
+
+ memcpy(TIME_REQUEST, "//k/mn",6);
+
+ /*
+ ** Initialize the number of units to 0 and set the dynamic array of units to
+ ** NULL since there are no units defined yet.
+ */
+
+ nunits = 0;
+
+}
+
+
+/*......................................................................*/
+/* datum_pts_buginfo - not used */
+/*......................................................................*/
+
+static void
+datum_pts_buginfo(
+ int unit,
+ register struct refclockbug *bug,
+ register struct peer *peer
+ )
+{
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Buginfo Datum PTS\n");
+#endif
+
+}
+
+
+/*......................................................................*/
+/* datum_pts_receive - receive the time buffer that was read in */
+/* by the ntpd io handling routines. When 7 bytes have been */
+/* received (it may take several tries before all 7 bytes are */
+/* received), then the time code must be unpacked and sent to */
+/* the ntpd clock_receive() routine which causes the systems */
+/* clock to be updated (several layers down). */
+/*......................................................................*/
+
+static void
+datum_pts_receive(
+ struct recvbuf *rbufp
+ )
+{
+ int i;
+ l_fp tstmp;
+ struct peer *p;
+ struct datum_pts_unit *datum_pts;
+ char *dpt;
+ int dpend;
+ int tzoff;
+ int timerr;
+ double ftimerr, abserr;
+#ifdef DEBUG_DATUM_PTC
+ double dispersion;
+#endif
+ int goodtime;
+ /*double doffset;*/
+
+ /*
+ ** Get the time code (maybe partial) message out of the rbufp buffer.
+ */
+
+ p = rbufp->recv_peer;
+ datum_pts = p->procptr->unitptr;
+ dpt = (char *)&rbufp->recv_space;
+ dpend = rbufp->recv_length;
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Receive Datum PTS: %d bytes\n", dpend);
+#endif
+
+ /* */
+ /*...... save the ntp system time when the first byte is received ......*/
+ /* */
+
+ /*
+ ** Save the ntp system time when the first byte is received. Note that
+ ** because it may take several calls to this routine before all seven
+ ** bytes of our return message are finally received by the io handlers in
+ ** ntpd, we really do want to use the time tag when the first byte is
+ ** received to reduce the jitter.
+ */
+
+ if (datum_pts->nbytes == 0) {
+ datum_pts->lastrec = rbufp->recv_time;
+ }
+
+ /*
+ ** Increment our count to the number of bytes received so far. Return if we
+ ** haven't gotten all seven bytes yet.
+ */
+
+ for (i=0; i<dpend; i++) {
+ datum_pts->retbuf[datum_pts->nbytes+i] = dpt[i];
+ }
+
+ datum_pts->nbytes += dpend;
+
+ if (datum_pts->nbytes != 7) {
+ return;
+ }
+
+ /*
+ ** Convert the seven bytes received in our time buffer to day, hour, minute,
+ ** second, and msecond values. The usec value is not used for anything
+ ** currently. It is just the fractional part of the time stored in units
+ ** of microseconds.
+ */
+
+ datum_pts->day = 100*(datum_pts->retbuf[0] & 0x0f) +
+ 10*((datum_pts->retbuf[1] & 0xf0)>>4) +
+ (datum_pts->retbuf[1] & 0x0f);
+
+ datum_pts->hour = 10*((datum_pts->retbuf[2] & 0x30)>>4) +
+ (datum_pts->retbuf[2] & 0x0f);
+
+ datum_pts->minute = 10*((datum_pts->retbuf[3] & 0x70)>>4) +
+ (datum_pts->retbuf[3] & 0x0f);
+
+ datum_pts->second = 10*((datum_pts->retbuf[4] & 0x70)>>4) +
+ (datum_pts->retbuf[4] & 0x0f);
+
+ datum_pts->msec = 100*((datum_pts->retbuf[5] & 0xf0) >> 4) +
+ 10*(datum_pts->retbuf[5] & 0x0f) +
+ ((datum_pts->retbuf[6] & 0xf0)>>4);
+
+ datum_pts->usec = 1000*datum_pts->msec;
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("day %d, hour %d, minute %d, second %d, msec %d\n",
+ datum_pts->day,
+ datum_pts->hour,
+ datum_pts->minute,
+ datum_pts->second,
+ datum_pts->msec);
+#endif
+
+ /*
+ ** Get the GMT time zone offset. Note that GMT should be zero if the Datum
+ ** reference time is using GMT as its time base. Otherwise we have to
+ ** determine the offset if the Datum PTS is using time of day as its time
+ ** base.
+ */
+
+ goodtime = 0; /* We are not sure about the time and offset yet */
+
+#ifdef GMT
+
+ /*
+ ** This is the case where the Datum PTS is using GMT so there is no time
+ ** zone offset.
+ */
+
+ tzoff = 0; /* set time zone offset to 0 */
+
+#else
+
+ /*
+ ** This is the case where the Datum PTS is using regular time of day for its
+ ** time so we must compute the time zone offset. The way we do it is kind of
+ ** funny but it works. We loop through different time zones (0 to 24) and
+ ** pick the one that gives the smallest error (+- one half hour). The time
+ ** zone offset is stored in the datum_pts structure for future use. Normally,
+ ** the clocktime() routine is only called once (unless the time zone offset
+ ** changes due to daylight savings) since the goodtime flag is set when a
+ ** good time is found (with a good offset). Note that even if the Datum
+ ** PTS is using GMT, this mechanism will still work since it should come up
+ ** with a value for tzoff = 0 (assuming that your system clock is within
+ ** a half hour of the Datum time (even with time zone differences).
+ */
+
+ for (tzoff=0; tzoff<24; tzoff++) {
+ if (clocktime( datum_pts->day,
+ datum_pts->hour,
+ datum_pts->minute,
+ datum_pts->second,
+ (tzoff + datum_pts->tzoff) % 24,
+ datum_pts->lastrec.l_ui,
+ &datum_pts->yearstart,
+ &datum_pts->lastref.l_ui) ) {
+
+ datum_pts->lastref.l_uf = 0;
+ error = datum_pts->lastref.l_ui - datum_pts->lastrec.l_ui;
+
+#ifdef DEBUG_DATUM_PTC
+ printf("Time Zone (clocktime method) = %d, error = %d\n", tzoff, error);
+#endif
+
+ if ((error < 1799) && (error > -1799)) {
+ tzoff = (tzoff + datum_pts->tzoff) % 24;
+ datum_pts->tzoff = tzoff;
+ goodtime = 1;
+
+#ifdef DEBUG_DATUM_PTC
+ printf("Time Zone found (clocktime method) = %d\n",tzoff);
+#endif
+
+ break;
+ }
+
+ }
+ }
+
+#endif
+
+ /*
+ ** Make sure that we have a good time from the Datum PTS. Clocktime() also
+ ** sets yearstart and lastref.l_ui. We will have to set astref.l_uf (i.e.,
+ ** the fraction of a second) stuff later.
+ */
+
+ if (!goodtime) {
+
+ if (!clocktime( datum_pts->day,
+ datum_pts->hour,
+ datum_pts->minute,
+ datum_pts->second,
+ tzoff,
+ datum_pts->lastrec.l_ui,
+ &datum_pts->yearstart,
+ &datum_pts->lastref.l_ui) ) {
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ {
+ printf("Error: bad clocktime\n");
+ printf("GMT %d, lastrec %d, yearstart %d, lastref %d\n",
+ tzoff,
+ datum_pts->lastrec.l_ui,
+ datum_pts->yearstart,
+ datum_pts->lastref.l_ui);
+ }
+#endif
+
+ msyslog(LOG_ERR, "Datum_PTS: Bad clocktime");
+
+ return;
+
+ }else{
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Good clocktime\n");
+#endif
+
+ }
+
+ }
+
+ /*
+ ** We have datum_pts->lastref.l_ui set (which is the integer part of the
+ ** time. Now set the microseconds field.
+ */
+
+ TVUTOTSF(datum_pts->usec, datum_pts->lastref.l_uf);
+
+ /*
+ ** Compute the time correction as the difference between the reference
+ ** time (i.e., the Datum time) minus the receive time (system time).
+ */
+
+ tstmp = datum_pts->lastref; /* tstmp is the datum ntp time */
+ L_SUB(&tstmp, &datum_pts->lastrec); /* tstmp is now the correction */
+ datum_pts->coderecv++; /* increment a counter */
+
+#ifdef DEBUG_DATUM_PTC
+ dispersion = DATUM_DISPERSION; /* set the dispersion to 0 */
+ ftimerr = dispersion;
+ ftimerr /= (1024.0 * 64.0);
+ if (debug)
+ printf("dispersion = %d, %f\n", dispersion, ftimerr);
+#endif
+
+ /*
+ ** Pass the new time to ntpd through the refclock_receive function. Note
+ ** that we are not trying to make any corrections due to the time it takes
+ ** for the Datum PTS to send the message back. I am (erroneously) assuming
+ ** that the time for the Datum PTS to send the time back to us is negligable.
+ ** I suspect that this time delay may be as much as 15 ms or so (but probably
+ ** less). For our needs at JPL, this kind of error is ok so it is not
+ ** necessary to use fudge factors in the ntp.conf file. Maybe later we will.
+ */
+ /*LFPTOD(&tstmp, doffset);*/
+ datum_pts->lastref = datum_pts->lastrec;
+ refclock_receive(datum_pts->peer);
+
+ /*
+ ** Compute sigma squared (not used currently). Maybe later, this could be
+ ** used for the dispersion estimate. The problem is that ntpd does not link
+ ** in the math library so sqrt() is not available. Anyway, this is useful
+ ** for debugging. Maybe later I will just use absolute values for the time
+ ** error to come up with my dispersion estimate. Anyway, for now my dispersion
+ ** is set to 0.
+ */
+
+ timerr = tstmp.l_ui<<20;
+ timerr |= (tstmp.l_uf>>12) & 0x000fffff;
+ ftimerr = timerr;
+ ftimerr /= 1024*1024;
+ abserr = ftimerr;
+ if (ftimerr < 0.0) abserr = -ftimerr;
+
+ if (datum_pts->sigma2 == 0.0) {
+ if (abserr < DATUM_MAX_ERROR) {
+ datum_pts->sigma2 = abserr*abserr;
+ }else{
+ datum_pts->sigma2 = DATUM_MAX_ERROR2;
+ }
+ }else{
+ if (abserr < DATUM_MAX_ERROR) {
+ datum_pts->sigma2 = 0.95*datum_pts->sigma2 + 0.05*abserr*abserr;
+ }else{
+ datum_pts->sigma2 = 0.95*datum_pts->sigma2 + 0.05*DATUM_MAX_ERROR2;
+ }
+ }
+
+#ifdef DEBUG_DATUM_PTC
+ if (debug)
+ printf("Time error = %f seconds\n", ftimerr);
+#endif
+
+#if defined(DEBUG_DATUM_PTC) || defined(LOG_TIME_ERRORS)
+ if (debug)
+ printf("PTS: day %d, hour %d, minute %d, second %d, msec %d, Time Error %f\n",
+ datum_pts->day,
+ datum_pts->hour,
+ datum_pts->minute,
+ datum_pts->second,
+ datum_pts->msec,
+ ftimerr);
+#endif
+
+}
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_dumbclock.c b/ntpd/refclock_dumbclock.c
new file mode 100644
index 0000000..89f0f47
--- /dev/null
+++ b/ntpd/refclock_dumbclock.c
@@ -0,0 +1,383 @@
+/*
+ * refclock_dumbclock - clock driver for a unknown time distribution system
+ * that only provides hh:mm:ss (in local time, yet!).
+ */
+
+/*
+ * Must interpolate back to local time. Very annoying.
+ */
+#define GET_LOCALTIME
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_DUMBCLOCK)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#ifdef SYS_WINNT
+extern int async_write(int, const void *, unsigned int);
+#undef write
+#define write(fd, data, octets) async_write(fd, data, octets)
+#endif
+
+/*
+ * This driver supports a generic dumb clock that only outputs hh:mm:ss,
+ * in local time, no less.
+ *
+ * Input format:
+ *
+ * hh:mm:ss <cr>
+ *
+ * hh:mm:ss -- what you'd expect, with a 24 hour clock. (Heck, that's the only
+ * way it could get stupider.) We take time on the <cr>.
+ *
+ * The original source of this module was the WWVB module.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/dumbclock%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define PRECISION (-13) /* precision assumed (about 100 us) */
+#define REFID "dumbclock" /* reference ID */
+#define DESCRIPTION "Dumb clock" /* WRU */
+
+
+/*
+ * Insanity check. Since the time is local, we need to make sure that during midnight
+ * transitions, we can convert back to Unix time. If the conversion results in some number
+ * worse than this number of seconds away, assume the next day and retry.
+ */
+#define INSANE_SECONDS 3600
+
+/*
+ * Dumb clock control structure
+ */
+struct dumbclock_unit {
+ u_char tcswitch; /* timecode switch */
+ l_fp laststamp; /* last receive timestamp */
+ u_char lasthour; /* last hour (for monitor) */
+ u_char linect; /* count ignored lines (for monitor */
+ struct tm ymd; /* struct tm for y/m/d only */
+};
+
+/*
+ * Function prototypes
+ */
+static int dumbclock_start (int, struct peer *);
+static void dumbclock_shutdown (int, struct peer *);
+static void dumbclock_receive (struct recvbuf *);
+#if 0
+static void dumbclock_poll (int, struct peer *);
+#endif
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_dumbclock = {
+ dumbclock_start, /* start up driver */
+ dumbclock_shutdown, /* shut down driver */
+ noentry, /* poll the driver -- a nice fabrication */
+ noentry, /* not used */
+ noentry, /* not used */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * dumbclock_start - open the devices and initialize data for processing
+ */
+static int
+dumbclock_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct dumbclock_unit *up;
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+ struct tm *tm_time_p;
+ time_t now;
+
+ /*
+ * Open serial port. Don't bother with CLK line discipline, since
+ * it's not available.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+#ifdef DEBUG
+ if (debug)
+ printf ("starting Dumbclock with device %s\n",device);
+#endif
+ fd = refclock_open(device, SPEED232, 0);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->unitptr = up;
+ pp->io.clock_recv = dumbclock_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ pp->unitptr = NULL;
+ return (0);
+ }
+
+
+ time(&now);
+#ifdef GET_LOCALTIME
+ tm_time_p = localtime(&now);
+#else
+ tm_time_p = gmtime(&now);
+#endif
+ if (tm_time_p)
+ up->ymd = *tm_time_p;
+ else
+ return 0;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ return (1);
+}
+
+
+/*
+ * dumbclock_shutdown - shut down the clock
+ */
+static void
+dumbclock_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct dumbclock_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * dumbclock_receive - receive data from the serial interface
+ */
+static void
+dumbclock_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct dumbclock_unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ l_fp trtmp; /* arrival timestamp */
+ int hours; /* hour-of-day */
+ int minutes; /* minutes-past-the-hour */
+ int seconds; /* seconds */
+ int temp; /* int temp */
+ int got_good; /* got a good time flag */
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);
+
+ if (temp == 0) {
+ if (up->tcswitch == 0) {
+ up->tcswitch = 1;
+ up->laststamp = trtmp;
+ } else
+ up->tcswitch = 0;
+ return;
+ }
+ pp->lencode = (u_short)temp;
+ pp->lastrec = up->laststamp;
+ up->laststamp = trtmp;
+ up->tcswitch = 1;
+
+#ifdef DEBUG
+ if (debug)
+ printf("dumbclock: timecode %d %s\n",
+ pp->lencode, pp->a_lastcode);
+#endif
+
+ /*
+ * We get down to business. Check the timecode format...
+ */
+ got_good=0;
+ if (sscanf(pp->a_lastcode,"%02d:%02d:%02d",
+ &hours,&minutes,&seconds) == 3)
+ {
+ struct tm *gmtp;
+ struct tm *lt_p;
+ time_t asserted_time; /* the SPM time based on the composite time+date */
+ struct tm asserted_tm; /* the struct tm of the same */
+ int adjyear;
+ int adjmon;
+ time_t reality_delta;
+ time_t now;
+
+
+ /*
+ * Convert to GMT for sites that distribute localtime. This
+ * means we have to figure out what day it is. Easier said
+ * than done...
+ */
+
+ memset(&asserted_tm, 0, sizeof(asserted_tm));
+
+ asserted_tm.tm_year = up->ymd.tm_year;
+ asserted_tm.tm_mon = up->ymd.tm_mon;
+ asserted_tm.tm_mday = up->ymd.tm_mday;
+ asserted_tm.tm_hour = hours;
+ asserted_tm.tm_min = minutes;
+ asserted_tm.tm_sec = seconds;
+ asserted_tm.tm_isdst = -1;
+
+#ifdef GET_LOCALTIME
+ asserted_time = mktime (&asserted_tm);
+ time(&now);
+#else
+#include "GMT unsupported for dumbclock!"
+#endif
+ reality_delta = asserted_time - now;
+
+ /*
+ * We assume that if the time is grossly wrong, it's because we got the
+ * year/month/day wrong.
+ */
+ if (reality_delta > INSANE_SECONDS)
+ {
+ asserted_time -= SECSPERDAY; /* local clock behind real time */
+ }
+ else if (-reality_delta > INSANE_SECONDS)
+ {
+ asserted_time += SECSPERDAY; /* local clock ahead of real time */
+ }
+ lt_p = localtime(&asserted_time);
+ if (lt_p)
+ {
+ up->ymd = *lt_p;
+ }
+ else
+ {
+ refclock_report (peer, CEVNT_FAULT);
+ return;
+ }
+
+ if ((gmtp = gmtime (&asserted_time)) == NULL)
+ {
+ refclock_report (peer, CEVNT_FAULT);
+ return;
+ }
+ adjyear = gmtp->tm_year+1900;
+ adjmon = gmtp->tm_mon+1;
+ pp->day = ymd2yd (adjyear, adjmon, gmtp->tm_mday);
+ pp->hour = gmtp->tm_hour;
+ pp->minute = gmtp->tm_min;
+ pp->second = gmtp->tm_sec;
+#ifdef DEBUG
+ if (debug)
+ printf ("time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
+ adjyear,adjmon,gmtp->tm_mday,pp->hour,pp->minute,
+ pp->second);
+#endif
+
+ got_good=1;
+ }
+
+ if (!got_good)
+ {
+ if (up->linect > 0)
+ up->linect--;
+ else
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ up->lasthour = (u_char)pp->hour;
+}
+
+#if 0
+/*
+ * dumbclock_poll - called by the transmit procedure
+ */
+static void
+dumbclock_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct dumbclock_unit *up;
+ struct refclockproc *pp;
+ char pollchar;
+
+ /*
+ * Time to poll the clock. The Chrono-log clock is supposed to
+ * respond to a 'T' by returning a timecode in the format(s)
+ * specified above. Ours does (can?) not, but this seems to be
+ * an installation-specific problem. This code is dyked out,
+ * but may be re-enabled if anyone ever finds a Chrono-log that
+ * actually listens to this command.
+ */
+#if 0
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (peer->reach == 0)
+ refclock_report(peer, CEVNT_TIMEOUT);
+ if (up->linect > 0)
+ pollchar = 'R';
+ else
+ pollchar = 'T';
+ if (write(pp->io.fd, &pollchar, 1) != 1)
+ refclock_report(peer, CEVNT_FAULT);
+ else
+ pp->polls++;
+#endif
+}
+#endif
+
+#else
+int refclock_dumbclock_bs;
+#endif /* defined(REFCLOCK) && defined(CLOCK_DUMBCLOCK) */
diff --git a/ntpd/refclock_fg.c b/ntpd/refclock_fg.c
new file mode 100644
index 0000000..d5915da
--- /dev/null
+++ b/ntpd/refclock_fg.c
@@ -0,0 +1,335 @@
+/*
+ * refclock_fg - clock driver for the Forum Graphic GPS datating station
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_FG)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+/*
+ * This driver supports the Forum Graphic GPS dating station.
+ * More information about FG GPS is available on http://www.forumgraphic.com
+ * Contact das@amt.ru for any question about this driver.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/fgclock%d"
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define REFID "GPS"
+#define DESCRIPTION "Forum Graphic GPS dating station"
+#define LENFG 26 /* timecode length */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+
+/*
+ * Function prototypes
+ */
+static int fg_init (int);
+static int fg_start (int, struct peer *);
+static void fg_shutdown (int, struct peer *);
+static void fg_poll (int, struct peer *);
+static void fg_receive (struct recvbuf *);
+
+/*
+ * Forum Graphic unit control structure
+ */
+
+struct fgunit {
+ int pollnum; /* Use peer.poll instead? */
+ int status; /* Hug to check status information on GPS */
+ int y2kwarn; /* Y2K bug */
+};
+
+/*
+ * Queries definition
+ */
+static char fginit[] = { 0x10, 0x48, 0x10, 0x0D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static char fgdate[] = { 0x10, 0x44, 0x10, 0x0D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_fg = {
+ fg_start, /* start up driver */
+ fg_shutdown, /* shut down driver */
+ fg_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+/*
+ * fg_init - Initialization of FG GPS.
+ */
+
+static int
+fg_init(
+ int fd
+ )
+{
+ if (write(fd, fginit, LENFG) != LENFG)
+ return 0;
+
+ return 1;
+}
+
+/*
+ * fg_start - open the device and initialize data for processing
+ */
+static int
+fg_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct fgunit *up;
+ int fd;
+ char device[20];
+
+
+ /*
+ * Open device file for reading.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+
+ DPRINTF(1, ("starting FG with device %s\n",device));
+
+ fd = refclock_open(device, SPEED232, LDISC_CLK);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+
+ up = emalloc(sizeof(struct fgunit));
+ memset(up, 0, sizeof(struct fgunit));
+ pp = peer->procptr;
+ pp->unitptr = up;
+ pp->io.clock_recv = fg_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ return 0;
+ }
+
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, REFID, 3);
+ up->pollnum = 0;
+
+ /*
+ * Setup dating station to use GPS receiver.
+ * GPS receiver should work before this operation.
+ */
+ if(!fg_init(pp->io.fd))
+ refclock_report(peer, CEVNT_FAULT);
+
+ return (1);
+}
+
+
+/*
+ * fg_shutdown - shut down the clock
+ */
+static void
+fg_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct fgunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (pp->io.fd != -1)
+ io_closeclock(&pp->io);
+ if (up != NULL)
+ free(up);
+}
+
+
+/*
+ * fg_poll - called by the transmit procedure
+ */
+static void
+fg_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+
+ /*
+ * Time to poll the clock. The FG clock responds to a
+ * "<DLE>D<DLE><CR>" by returning a timecode in the format specified
+ * above. If nothing is heard from the clock for two polls,
+ * declare a timeout and keep going.
+ */
+
+ if (write(pp->io.fd, fgdate, LENFG) != LENFG)
+ refclock_report(peer, CEVNT_FAULT);
+ else
+ pp->polls++;
+
+ /*
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ */
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+ return;
+
+}
+
+/*
+ * fg_receive - receive data from the serial interface
+ */
+static void
+fg_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct refclockproc *pp;
+ struct fgunit *up;
+ struct peer *peer;
+ char *bpt;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ * We can't use gtlin function because we need bynary data in buf */
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Below hug to implement receiving of status information
+ */
+ if(!up->pollnum) {
+ up->pollnum++;
+ return;
+ }
+
+
+ if (rbufp->recv_length < (LENFG - 2)) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return; /* The reply is invalid discard it. */
+ }
+
+ /* Below I trying to find a correct reply in buffer.
+ * Sometime GPS reply located in the beginnig of buffer,
+ * sometime you can find it with some offset.
+ */
+
+ bpt = (char *)rbufp->recv_space.X_recv_buffer;
+ while (*bpt != '\x10')
+ bpt++;
+
+#define BP2(x) ( bpt[x] & 15 )
+#define BP1(x) (( bpt[x] & 240 ) >> 4)
+
+ pp->year = BP1(2) * 10 + BP2(2);
+
+ if (pp->year == 94) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ if (!fg_init(pp->io.fd))
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ /* GPS is just powered up. The date is invalid -
+ discarding it. Initilize GPS one more time */
+ /* Sorry - this driver will broken in 2094 ;) */
+ }
+
+ if (pp->year < 99)
+ pp->year += 100;
+
+ pp->year += 1900;
+ pp->day = 100 * BP2(3) + 10 * BP1(4) + BP2(4);
+
+/*
+ After Jan, 10 2000 Forum Graphic GPS receiver had a very strange
+ benahour. It doubles day number for an hours in replys after 10:10:10 UTC
+ and doubles min every hour at HH:10:ss for a minute.
+ Hope it is a problem of my unit only and not a Y2K problem of FG GPS.
+ Below small code to avoid such situation.
+*/
+ if (up->y2kwarn > 10)
+ pp->hour = BP1(6)*10 + BP2(6);
+ else
+ pp->hour = BP1(5)*10 + BP2(5);
+
+ if ((up->y2kwarn > 10) && (pp->hour == 10)) {
+ pp->minute = BP1(7)*10 + BP2(7);
+ pp->second = BP1(8)*10 + BP2(8);
+ pp->nsec = (BP1(9)*10 + BP2(9)) * 1000000;
+ pp->nsec += BP1(10) * 1000;
+ } else {
+ pp->hour = BP1(5)*10 + BP2(5);
+ pp->minute = BP1(6)*10 + BP2(6);
+ pp->second = BP1(7)*10 + BP2(7);
+ pp->nsec = (BP1(8)*10 + BP2(8)) * 1000000;
+ pp->nsec += BP1(9) * 1000;
+ }
+
+ if ((pp->hour == 10) && (pp->minute == 10)) {
+ up->y2kwarn++;
+ }
+
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%d %d %d %d %d", pp->year, pp->day, pp->hour,
+ pp->minute, pp->second);
+ pp->lencode = strlen(pp->a_lastcode);
+ /*get_systime(&pp->lastrec);*/
+
+#ifdef DEBUG
+ if (debug)
+ printf("fg: time is %04d/%03d %02d:%02d:%02d UTC\n",
+ pp->year, pp->day, pp->hour, pp->minute, pp->second);
+#endif
+ pp->disp = (10e-6);
+ pp->lastrec = rbufp->recv_time; /* Is it better than get_systime()? */
+ /* pp->leap = LEAP_NOWARNING; */
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+
+ if (!refclock_process(pp))
+ refclock_report(peer, CEVNT_BADTIME);
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ return;
+}
+
+
+#else
+int refclock_fg_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_gpsdjson.c b/ntpd/refclock_gpsdjson.c
new file mode 100644
index 0000000..6150982
--- /dev/null
+++ b/ntpd/refclock_gpsdjson.c
@@ -0,0 +1,1341 @@
+/*
+ * refclock_gpsdjson.c - clock driver as GPSD JSON client
+ * Juergen Perlinger (perlinger@ntp.org)
+ * Feb 11, 2014 for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ *
+ * Heavily inspired by refclock_nmea.c
+ *
+ * Note: This will currently NOT work with Windows due to some
+ * limitations:
+ *
+ * - There is no GPSD for Windows. (There is an unofficial port to
+ * cygwin, but Windows is not officially supported.)
+ *
+ * - To work properly, this driver needs PPS and TPV sentences from
+ * GPSD. I don't see how the cygwin port should deal with that.
+ *
+ * - The device name matching must be done in a different way for
+ * Windows. (Can be done with COMxx matching, as done for NMEA.)
+ *
+ * Apart from those minor hickups, once GPSD has been fully ported to
+ * Windows, there's no reason why this should not work there ;-)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_GPSDJSON) && !defined(SYS_WINNT)
+
+/* =====================================================================
+ * get the little JSMN library directly into our guts
+ */
+#include "../libjsmn/jsmn.c"
+
+/* =====================================================================
+ * header stuff we need
+ */
+
+#include <netdb.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <netinet/tcp.h>
+
+#if defined(HAVE_SYS_POLL_H)
+# include <sys/poll.h>
+#elif defined(HAVE_SYS_SLECET_H)
+# include <sys/select.h>
+#else
+# error need poll() or select()
+#endif
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "timespecops.h"
+
+#define PRECISION (-9) /* precision assumed (about 2 ms) */
+#define PPS_PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "GPSD" /* reference id */
+#define DESCRIPTION "GPSD JSON client clock" /* who we are */
+
+#define MAX_PDU_LEN 1600
+#define TICKOVER_LOW 10
+#define TICKOVER_HIGH 120
+#define LOGTHROTTLE 3600
+
+#define PPS_MAXCOUNT 30
+#define PPS_HIWAT 20
+#define PPS_LOWAT 10
+
+#ifndef BOOL
+# define BOOL int
+#endif
+#ifndef TRUE
+# define TRUE 1
+#endif
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+/* some local typedefs : The NTPD formatting style cries for short type
+ * names, and we provide them locally. Note:the suffix '_t' is reserved
+ * for the standard; I use a capital T instead.
+ */
+typedef struct peer peerT;
+typedef struct refclockproc clockprocT;
+typedef struct addrinfo addrinfoT;
+
+/* =====================================================================
+ * We use the same device name scheme as does the NMEA driver; since
+ * GPSD supports the same links, we can select devices by a fixed name.
+ */
+static const char * s_dev_stem = "/dev/gps";
+
+/* =====================================================================
+ * forward declarations for transfer vector and the vector itself
+ */
+
+static void gpsd_init (void);
+static int gpsd_start (int, peerT *);
+static void gpsd_shutdown (int, peerT *);
+static void gpsd_receive (struct recvbuf *);
+static void gpsd_poll (int, peerT *);
+static void gpsd_control (int, const struct refclockstat *,
+ struct refclockstat *, peerT *);
+static void gpsd_timer (int, peerT *);
+static void gpsd_clockstats (int, peerT *);
+
+static int myasprintf(char**, char const*, ...);
+
+struct refclock refclock_gpsdjson = {
+ gpsd_start, /* start up driver */
+ gpsd_shutdown, /* shut down driver */
+ gpsd_poll, /* transmit poll message */
+ gpsd_control, /* fudge control */
+ gpsd_init, /* initialize driver */
+ noentry, /* buginfo */
+ gpsd_timer /* called once per second */
+};
+
+/* =====================================================================
+ * our local clock unit and data
+ */
+typedef struct gpsd_unit {
+ int unit;
+ /* current line protocol version */
+ uint16_t proto_major;
+ uint16_t proto_minor;
+
+ /* PPS time stamps */
+ l_fp pps_local; /* when we received the PPS message */
+ l_fp pps_stamp; /* related reference time */
+ l_fp pps_recvt; /* when GPSD detected the pulse */
+
+ /* TPV (GPS data) time stamps */
+ l_fp tpv_local; /* when we received the TPV message */
+ l_fp tpv_stamp; /* effective GPS time stamp */
+ l_fp tpv_recvt; /* when GPSD got the fix */
+
+ /* fudge values for correction, mirrored as 'l_fp' */
+ l_fp pps_fudge;
+ l_fp tpv_fudge;
+
+ /* Flags to indicate available data */
+ int fl_tpv : 1; /* valid TPV seen (have time) */
+ int fl_pps : 1; /* valid pulse seen */
+ int fl_vers : 1; /* have protocol version */
+ int fl_watch : 1; /* watch reply seen */
+ int fl_nsec : 1; /* have nanosec PPS info */
+
+ /* admin stuff for sockets and device selection */
+ int fdt; /* current connecting socket */
+ addrinfoT * addr; /* next address to try */
+ u_int tickover; /* timeout countdown */
+ u_int tickpres; /* timeout preset */
+ u_int ppscount; /* PPS mode up/down count */
+ char * device; /* device name of unit */
+
+ /* tallies for the various events */
+ u_int tc_good; /* good samples received */
+ u_int tc_btime; /* bad time stamps */
+ u_int tc_bdate; /* bad date strings */
+ u_int tc_breply; /* bad replies */
+ u_int tc_recv; /* received known records */
+
+ /* log bloat throttle */
+ u_int logthrottle;/* seconds to next log slot */
+
+ /* record assemby buffer and saved length */
+ int buflen;
+ char buffer[MAX_PDU_LEN];
+} gpsd_unitT;
+
+/* =====================================================================
+ * static local helpers forward decls
+ */
+static void gpsd_init_socket(peerT * const peer);
+static void gpsd_test_socket(peerT * const peer);
+static void gpsd_stop_socket(peerT * const peer);
+
+static void gpsd_parse(peerT * const peer,
+ const l_fp * const rtime);
+static BOOL convert_ascii_time(l_fp * fp, const char * gps_time);
+static void save_ltc(clockprocT * const pp, const char * const tc);
+static int syslogok(clockprocT * const pp, gpsd_unitT * const up);
+
+/* =====================================================================
+ * local / static stuff
+ */
+
+/* The logon string is actually the ?WATCH command of GPSD, using JSON
+ * data and selecting the GPS device name we created from our unit
+ * number. [Note: This is a format string!]
+ */
+static const char * s_logon =
+ "?WATCH={\"enable\":true,\"json\":true,\"device\":\"%s\"};\r\n";
+
+/* We keep a static list of network addresses for 'localhost:gpsd', and
+ * we try to connect to them in round-robin fashion.
+ */
+static addrinfoT * s_gpsd_addr;
+
+/* =====================================================================
+ * log throttling
+ */
+static int/*BOOL*/
+syslogok(
+ clockprocT * const pp,
+ gpsd_unitT * const up)
+{
+ int res = (0 != (pp->sloppyclockflag & CLK_FLAG3))
+ || (0 == up->logthrottle )
+ || (LOGTHROTTLE == up->logthrottle );
+ if (res)
+ up->logthrottle = LOGTHROTTLE;
+ return res;
+}
+
+/* =====================================================================
+ * the clock functions
+ */
+
+/* ---------------------------------------------------------------------
+ * Init: This currently just gets the socket address for the GPS daemon
+ */
+static void
+gpsd_init(void)
+{
+ addrinfoT hints;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_protocol = IPPROTO_TCP;
+ hints.ai_socktype = SOCK_STREAM;
+
+ /* just take the first configured address of localhost... */
+ if (getaddrinfo("localhost", "gpsd", &hints, &s_gpsd_addr))
+ s_gpsd_addr = NULL;
+}
+
+/* ---------------------------------------------------------------------
+ * Start: allocate a unit pointer and set up the runtime data
+ */
+
+static int
+gpsd_start(
+ int unit,
+ peerT * peer)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = emalloc_zero(sizeof(*up));
+
+ struct stat sb;
+
+ /* initialize the unit structure */
+ up->fdt = -1;
+ up->addr = s_gpsd_addr;
+ up->tickpres = TICKOVER_LOW;
+
+ /* setup refclock processing */
+ up->unit = unit;
+ pp->unitptr = (caddr_t)up;
+ pp->io.fd = -1;
+ pp->io.clock_recv = gpsd_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->a_lastcode[0] = '\0';
+ pp->lencode = 0;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, REFID, 4);
+
+ /* Initialize miscellaneous variables */
+ peer->precision = PRECISION;
+
+ /* Create the device name and check for a Character Device. It's
+ * assumed that GPSD was started with the same link, so the
+ * names match. (If this is not practicable, we will have to
+ * read the symlink, if any, so we can get the true device
+ * file.)
+ */
+ if (-1 == myasprintf(&up->device, "%s%u", s_dev_stem, unit)) {
+ msyslog(LOG_ERR, "%s clock device name too long",
+ refnumtoa(&peer->srcadr));
+ goto dev_fail;
+ }
+ if (-1 == stat(up->device, &sb) || !S_ISCHR(sb.st_mode)) {
+ msyslog(LOG_ERR, "%s: '%s' is not a character device",
+ refnumtoa(&peer->srcadr), up->device);
+ goto dev_fail;
+ }
+ LOGIF(CLOCKINFO,
+ (LOG_NOTICE, "%s: startup, device is '%s'",
+ refnumtoa(&peer->srcadr), up->device));
+ return TRUE;
+
+dev_fail:
+ /* On failure, remove all UNIT ressources and declare defeat. */
+
+ INSIST (up);
+ free(up->device);
+ free(up);
+
+ pp->unitptr = (caddr_t)NULL;
+ return FALSE;
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_shutdown(
+ int unit,
+ peerT * peer)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ UNUSED_ARG(unit);
+
+ if (up) {
+ free(up->device);
+ free(up);
+ }
+ pp->unitptr = (caddr_t)NULL;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ pp->io.fd = -1;
+ LOGIF(CLOCKINFO,
+ (LOG_NOTICE, "%s: shutdown", refnumtoa(&peer->srcadr)));
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_receive(
+ struct recvbuf * rbufp)
+{
+ /* declare & init control structure ptrs */
+ peerT * const peer = rbufp->recv_peer;
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ const char *psrc, *esrc;
+ char *pdst, *edst, ch;
+
+ /* Since we're getting a raw stream data, we must assemble lines
+ * in our receive buffer. We can't use neither 'refclock_gtraw'
+ * not 'refclock_gtlin' here... We process chars until we reach
+ * an EoL (that is, line feed) but we truncate the message if it
+ * does not fit the buffer. GPSD might truncate messages, too,
+ * so dealing with truncated buffers is necessary anyway.
+ */
+ psrc = (const char*)rbufp->recv_buffer;
+ esrc = psrc + rbufp->recv_length;
+
+ pdst = up->buffer + up->buflen;
+ edst = pdst + sizeof(up->buffer) - 1; /* for trailing NUL */
+
+ while (psrc != esrc) {
+ ch = *psrc++;
+ if (ch == '\n') {
+ /* trim trailing whitespace & terminate buffer */
+ while (pdst != up->buffer && pdst[-1] <= ' ')
+ --pdst;
+ *pdst = '\0';
+ /* process data and reset buffer */
+ gpsd_parse(peer, &rbufp->recv_time);
+ pdst = up->buffer;
+ } else if (pdst != edst) {
+ /* add next char, ignoring leading whitespace */
+ if (ch > ' ' || pdst != up->buffer)
+ *pdst++ = ch;
+ }
+ }
+ up->buflen = pdst - up->buffer;
+ up->tickover = TICKOVER_LOW;
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_poll(
+ int unit,
+ peerT * peer)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+ u_int tc_max;
+
+ ++pp->polls;
+
+ /* find the dominant error */
+ tc_max = max(up->tc_btime, up->tc_bdate);
+ tc_max = max(tc_max, up->tc_breply);
+
+ if (pp->coderecv != pp->codeproc) {
+ /* all is well */
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ } else {
+ /* not working properly, admit to it */
+ peer->flags &= ~FLAG_PPS;
+ peer->precision = PRECISION;
+
+ if (-1 == pp->io.fd) {
+ /* not connected to GPSD: clearly not working! */
+ refclock_report(peer, CEVNT_FAULT);
+ } else if (tc_max == up->tc_breply) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ } else if (tc_max == up->tc_btime) {
+ refclock_report(peer, CEVNT_BADTIME);
+ } else if (tc_max == up->tc_bdate) {
+ refclock_report(peer, CEVNT_BADDATE);
+ } else {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ }
+ }
+
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ gpsd_clockstats(unit, peer);
+
+ /* clear tallies for next round */
+ up->tc_good = up->tc_btime = up->tc_bdate =
+ up->tc_breply = up->tc_recv = 0;
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_control(
+ int unit,
+ const struct refclockstat * in_st,
+ struct refclockstat * out_st,
+ peerT * peer )
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ /* save preprocessed fudge times */
+ DTOLFP(pp->fudgetime1, &up->pps_fudge);
+ DTOLFP(pp->fudgetime2, &up->tpv_fudge);
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_timer(
+ int unit,
+ peerT * peer)
+{
+ static const char query[] = "?VERSION;";
+
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+ int rc;
+
+ /* This is used for timeout handling. Nothing that needs
+ * sub-second precison happens here, so receive/connect/retry
+ * timeouts are simply handled by a count down, and then we
+ * decide what to do by the socket values.
+ *
+ * Note that the timer stays at zero here, unless some of the
+ * functions set it to another value.
+ */
+ if (up->logthrottle)
+ --up->logthrottle;
+ if (up->tickover)
+ --up->tickover;
+ switch (up->tickover) {
+ case 4:
+ /* try to get a live signal
+ * If the device is not yet present, we will most likely
+ * get an error. We put out a new version request,
+ * because the reply will initiate a new watch request
+ * cycle.
+ */
+ if (-1 != pp->io.fd) {
+ if ( ! up->fl_watch) {
+ DPRINTF(2, ("GPSD_JSON(%d): timer livecheck: '%s'\n",
+ up->unit, query));
+ rc = write(pp->io.fd,
+ query, sizeof(query));
+ (void)rc;
+ }
+ } else if (-1 != up->fdt) {
+ gpsd_test_socket(peer);
+ }
+ break;
+
+ case 0:
+ if (-1 != pp->io.fd)
+ gpsd_stop_socket(peer);
+ else if (-1 != up->fdt)
+ gpsd_test_socket(peer);
+ else if (NULL != s_gpsd_addr)
+ gpsd_init_socket(peer);
+ break;
+
+ default:
+ if (-1 == pp->io.fd && -1 != up->fdt)
+ gpsd_test_socket(peer);
+ }
+
+ if (up->ppscount > PPS_HIWAT && !(peer->flags & FLAG_PPS))
+ peer->flags |= FLAG_PPS;
+ if (up->ppscount < PPS_LOWAT && (peer->flags & FLAG_PPS))
+ peer->flags &= ~FLAG_PPS;
+}
+
+/* =====================================================================
+ * JSON parsing stuff
+ */
+
+#define JSMN_MAXTOK 100
+#define INVALID_TOKEN (-1)
+
+typedef struct json_ctx {
+ char * buf;
+ int ntok;
+ jsmntok_t tok[JSMN_MAXTOK];
+} json_ctx;
+
+typedef int tok_ref;
+
+#ifdef HAVE_LONG_LONG
+typedef long long json_int;
+ #define JSON_STRING_TO_INT strtoll
+#else
+typedef long json_int;
+ #define JSON_STRING_TO_INT strtol
+#endif
+
+/* ------------------------------------------------------------------ */
+
+static tok_ref
+json_token_skip(
+ const json_ctx * ctx,
+ tok_ref tid)
+{
+ int len;
+ len = ctx->tok[tid].size;
+ for (++tid; len; --len)
+ if (tid < ctx->ntok)
+ tid = json_token_skip(ctx, tid);
+ else
+ break;
+ if (tid > ctx->ntok)
+ tid = ctx->ntok;
+ return tid;
+}
+
+/* ------------------------------------------------------------------ */
+
+static int
+json_object_lookup(
+ const json_ctx * ctx,
+ tok_ref tid,
+ const char * key)
+{
+ int len;
+
+ if (tid >= ctx->ntok || ctx->tok[tid].type != JSMN_OBJECT)
+ return INVALID_TOKEN;
+ len = ctx->ntok - tid - 1;
+ if (len > ctx->tok[tid].size)
+ len = ctx->tok[tid].size;
+ for (tid += 1; len > 1; len-=2) {
+ if (ctx->tok[tid].type != JSMN_STRING)
+ continue; /* hmmm... that's an error, strictly speaking */
+ if (!strcmp(key, ctx->buf + ctx->tok[tid].start))
+ return tid + 1;
+ tid = json_token_skip(ctx, tid + 1);
+ }
+ return INVALID_TOKEN;
+}
+
+/* ------------------------------------------------------------------ */
+
+#if 0 /* currently unused */
+static const char*
+json_object_lookup_string(
+ const json_ctx * ctx,
+ tok_ref tid,
+ const char * key)
+{
+ tok_ref val_ref;
+ val_ref = json_object_lookup(ctx, tid, key);
+ if (INVALID_TOKEN == val_ref ||
+ JSMN_STRING != ctx->tok[val_ref].type )
+ goto cvt_error;
+ return ctx->buf + ctx->tok[val_ref].start;
+
+ cvt_error:
+ errno = EINVAL;
+ return NULL;
+}
+#endif
+
+static const char*
+json_object_lookup_string_default(
+ const json_ctx * ctx,
+ tok_ref tid,
+ const char * key,
+ const char * def)
+{
+ tok_ref val_ref;
+ val_ref = json_object_lookup(ctx, tid, key);
+ if (INVALID_TOKEN == val_ref ||
+ JSMN_STRING != ctx->tok[val_ref].type )
+ return def;
+ return ctx->buf + ctx->tok[val_ref].start;
+}
+
+/* ------------------------------------------------------------------ */
+
+static json_int
+json_object_lookup_int(
+ const json_ctx * ctx,
+ tok_ref tid,
+ const char * key)
+{
+ json_int ret;
+ tok_ref val_ref;
+ char * ep;
+
+ val_ref = json_object_lookup(ctx, tid, key);
+ if (INVALID_TOKEN == val_ref ||
+ JSMN_PRIMITIVE != ctx->tok[val_ref].type )
+ goto cvt_error;
+ ret = JSON_STRING_TO_INT(
+ ctx->buf + ctx->tok[val_ref].start, &ep, 10);
+ if (*ep)
+ goto cvt_error;
+ return ret;
+
+ cvt_error:
+ errno = EINVAL;
+ return 0;
+}
+
+static json_int
+json_object_lookup_int_default(
+ const json_ctx * ctx,
+ tok_ref tid,
+ const char * key,
+ json_int def)
+{
+ json_int retv;
+ int esave;
+
+ esave = errno;
+ errno = 0;
+ retv = json_object_lookup_int(ctx, tid, key);
+ if (0 != errno)
+ retv = def;
+ errno = esave;
+ return retv;
+}
+
+/* ------------------------------------------------------------------ */
+
+static double
+json_object_lookup_float(
+ const json_ctx * ctx,
+ tok_ref tid,
+ const char * key)
+{
+ double ret;
+ tok_ref val_ref;
+ char * ep;
+
+ val_ref = json_object_lookup(ctx, tid, key);
+ if (INVALID_TOKEN == val_ref ||
+ JSMN_PRIMITIVE != ctx->tok[val_ref].type )
+ goto cvt_error;
+ ret = strtod(ctx->buf + ctx->tok[val_ref].start, &ep);
+ if (*ep)
+ goto cvt_error;
+ return ret;
+
+ cvt_error:
+ errno = EINVAL;
+ return 0.0;
+}
+
+static double
+json_object_lookup_float_default(
+ const json_ctx * ctx,
+ tok_ref tid,
+ const char * key,
+ double def)
+{
+ double retv;
+ int esave;
+
+ esave = errno;
+ errno = 0;
+ retv = json_object_lookup_float(ctx, tid, key);
+ if (0 != errno)
+ retv = def;
+ errno = esave;
+ return retv;
+}
+
+/* ------------------------------------------------------------------ */
+
+static BOOL
+json_parse_record(
+ json_ctx * ctx,
+ char * buf)
+{
+ jsmn_parser jsm;
+ int idx, rc;
+
+ jsmn_init(&jsm);
+ rc = jsmn_parse(&jsm, buf, ctx->tok, JSMN_MAXTOK);
+ ctx->buf = buf;
+ ctx->ntok = jsm.toknext;
+
+ /* Make all tokens NUL terminated by overwriting the
+ * terminator symbol
+ */
+ for (idx = 0; idx < jsm.toknext; ++idx)
+ if (ctx->tok[idx].end > ctx->tok[idx].start)
+ ctx->buf[ctx->tok[idx].end] = '\0';
+
+ if (JSMN_ERROR_PART != rc &&
+ JSMN_ERROR_NOMEM != rc &&
+ JSMN_SUCCESS != rc )
+ return FALSE; /* not parseable - bail out */
+
+ if (0 >= jsm.toknext || JSMN_OBJECT != ctx->tok[0].type)
+ return FALSE; /* not object or no data!?! */
+
+ return TRUE;
+}
+
+
+/* =====================================================================
+ * static local helpers
+ */
+
+/* ------------------------------------------------------------------ */
+/* Process a WATCH record
+ *
+ * Currently this is only used to recognise that the device is present
+ * and that we're listed subscribers.
+ */
+static void
+process_watch(
+ peerT * const peer ,
+ json_ctx * const jctx ,
+ const l_fp * const rtime)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ up->fl_watch = -1;
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+process_version(
+ peerT * const peer ,
+ json_ctx * const jctx ,
+ const l_fp * const rtime)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ int len;
+ char * buf;
+ const char *revision;
+ const char *release;
+
+ /* get protocol version number */
+ revision = json_object_lookup_string_default(
+ jctx, 0, "rev", "(unknown)");
+ release = json_object_lookup_string_default(
+ jctx, 0, "release", "(unknown)");
+ errno = 0;
+ up->proto_major = (uint16_t)json_object_lookup_int(
+ jctx, 0, "proto_major");
+ up->proto_minor = (uint16_t)json_object_lookup_int(
+ jctx, 0, "proto_minor");
+ if (0 == errno) {
+ up->fl_vers = -1;
+ if (syslogok(pp, up))
+ msyslog(LOG_INFO,
+ "%s: GPSD revision=%s release=%s protocol=%u.%u",
+ refnumtoa(&peer->srcadr),
+ revision, release,
+ up->proto_major, up->proto_minor);
+ }
+
+ /* With the 3.9 GPSD protocol, '*_musec' vanished and was
+ * replace by '*_nsec'. Dispatch properly.
+ */
+ if ( up->proto_major > 3 ||
+ (up->proto_major == 3 && up->proto_minor >= 9))
+ up->fl_nsec = -1;
+ else
+ up->fl_nsec = 0;
+
+ /*TODO: validate protocol version! */
+
+ /* request watch for our GPS device
+ * Reuse the input buffer, which is no longer needed in the
+ * current cycle. Also assume that we can write the watch
+ * request in one sweep into the socket; since we do not do
+ * output otherwise, this should always work. (Unless the
+ * TCP/IP window size gets lower than the length of the
+ * request. We handle that when it happens.)
+ */
+ snprintf(up->buffer, sizeof(up->buffer),
+ s_logon, up->device);
+ buf = up->buffer;
+ len = strlen(buf);
+ if (len != write(pp->io.fd, buf, len)) {
+ /*Note: if the server fails to read our request, the
+ * resulting data timeout will take care of the
+ * connection!
+ */
+ if (syslogok(pp, up))
+ msyslog(LOG_ERR,
+ "%s: failed to write watch request (%m)",
+ refnumtoa(&peer->srcadr));
+ }
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+process_tpv(
+ peerT * const peer ,
+ json_ctx * const jctx ,
+ const l_fp * const rtime)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ const char * gps_time;
+ int gps_mode;
+ double ept, epp, epx, epy, epv;
+ int log2;
+
+ gps_mode = (int)json_object_lookup_int_default(
+ jctx, 0, "mode", 0);
+
+ gps_time = json_object_lookup_string_default(
+ jctx, 0, "time", NULL);
+
+ if (gps_mode < 1 || NULL == gps_time) {
+ /* receiver has no fix; tell about and avoid stale data */
+ up->tc_breply += 1;
+ up->fl_tpv = 0;
+ up->fl_pps = 0;
+ return;
+ }
+
+ /* save last time code to clock data */
+ save_ltc(pp, gps_time);
+
+ /* convert clock and set resulting ref time */
+ if (convert_ascii_time(&up->tpv_stamp, gps_time)) {
+ DPRINTF(2, ("GPSD_JSON(%d): process_tpv, stamp='%s', recvt='%s' mode=%u\n",
+ up->unit,
+ gmprettydate(&up->tpv_stamp),
+ gmprettydate(&up->tpv_recvt),
+ gps_mode));
+
+ up->tpv_local = *rtime;
+ up->tpv_recvt = *rtime;/*TODO: hack until we get it remote from GPSD */
+ L_SUB(&up->tpv_recvt, &up->tpv_fudge);
+ up->fl_tpv = -1;
+ } else {
+ up->tc_btime += 1;
+ up->fl_tpv = 0;
+ }
+
+ /* Set the precision from the GPSD data
+ *
+ * Since EPT has some issues, we use EPT and a home-brewed error
+ * estimation base on a sphere derived from EPX/Y/V and the
+ * speed of light. Use the better one of those two.
+ */
+ ept = json_object_lookup_float_default(jctx, 0, "ept", 1.0);
+ epx = json_object_lookup_float_default(jctx, 0, "epx", 1000.0);
+ epy = json_object_lookup_float_default(jctx, 0, "epy", 1000.0);
+ if (1 == gps_mode) {
+ /* 2d-fix: extend bounding rectangle to cuboid */
+ epv = max(epx, epy);
+ } else {
+ /* 3d-fix: get bounding cuboid */
+ epv = json_object_lookup_float_default(
+ jctx, 0, "epv", 1000.0);
+ }
+
+ /* get diameter of enclosing sphere of bounding cuboid as spatial
+ * error, then divide spatial error by speed of light to get
+ * another time error estimate. Add extra 100 meters as
+ * optimistic lower bound. Then use the better one of the two
+ * estimations.
+ */
+ epp = 2.0 * sqrt(epx*epx + epy*epy + epv*epv);
+ epp = (epp + 100.0) / 299792458.0;
+
+ ept = min(ept, epp );
+ ept = min(ept, 0.5 );
+ ept = max(ept, 1.0-9);
+ ept = frexp(ept, &log2);
+
+ peer->precision = log2;
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+process_pps(
+ peerT * const peer ,
+ json_ctx * const jctx ,
+ const l_fp * const rtime)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ struct timespec ts;
+
+ errno = 0;
+ ts.tv_sec = (time_t)json_object_lookup_int(
+ jctx, 0, "clock_sec");
+ if (up->fl_nsec)
+ ts.tv_nsec = json_object_lookup_int(
+ jctx, 0, "clock_nsec");
+ else
+ ts.tv_nsec = json_object_lookup_int(
+ jctx, 0, "clock_musec") * 1000;
+
+ if (0 != errno)
+ goto fail;
+
+ up->pps_local = *rtime;
+ /* get fudged receive time */
+ up->pps_recvt = tspec_stamp_to_lfp(ts);
+ L_SUB(&up->pps_recvt, &up->pps_fudge);
+
+ /* map to next full second as reference time stamp */
+ up->pps_stamp = up->pps_recvt;
+ L_ADDUF(&up->pps_stamp, 0x80000000u);
+ up->pps_stamp.l_uf = 0;
+
+ pp->lastrec = up->pps_stamp;
+
+ DPRINTF(2, ("GPSD_JSON(%d): process_pps, stamp='%s', recvt='%s'\n",
+ up->unit,
+ gmprettydate(&up->pps_stamp),
+ gmprettydate(&up->pps_recvt)));
+
+ /* When we have a time pulse, clear the TPV flag: the
+ * PPS is only valid for the >NEXT< TPV value!
+ */
+ up->fl_pps = -1;
+ up->fl_tpv = 0;
+ return;
+
+ fail:
+ DPRINTF(2, ("GPSD_JSON(%d): process_pps FAILED, nsec=%d stamp='%s', recvt='%s'\n",
+ up->unit, up->fl_nsec,
+ gmprettydate(&up->pps_stamp),
+ gmprettydate(&up->pps_recvt)));
+ up->tc_breply += 1;
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_parse(
+ peerT * const peer ,
+ const l_fp * const rtime)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ json_ctx jctx;
+ const char * clsid;
+ l_fp tmpfp;
+
+ DPRINTF(2, ("GPSD_JSON(%d): gpsd_parse: time %s '%s'\n",
+ up->unit, ulfptoa(rtime, 6), up->buffer));
+
+ /* See if we can grab anything potentially useful */
+ if (!json_parse_record(&jctx, up->buffer))
+ return;
+
+ /* Now dispatch over the objects we know */
+ clsid = json_object_lookup_string_default(
+ &jctx, 0, "class", "-bad-repy-");
+
+ up->tc_recv += 1;
+ if (!strcmp("VERSION", clsid))
+ process_version(peer, &jctx, rtime);
+ else if (!strcmp("TPV", clsid))
+ process_tpv(peer, &jctx, rtime);
+ else if (!strcmp("PPS", clsid))
+ process_pps(peer, &jctx, rtime);
+ else if (!strcmp("WATCH", clsid))
+ process_watch(peer, &jctx, rtime);
+ else
+ return; /* nothing we know about... */
+
+ /* now aggregate TPV and PPS -- no PPS? just use TPV...*/
+ if (up->fl_tpv) {
+ /* TODO: also check remote receive time stamps */
+ tmpfp = up->tpv_local;
+ L_SUB(&tmpfp, &up->pps_local);
+
+ if (up->fl_pps && 0 == tmpfp.l_ui) {
+ refclock_process_offset(
+ pp, up->tpv_stamp, up->pps_recvt, 0.0);
+ if (up->ppscount < PPS_MAXCOUNT)
+ up->ppscount += 1;
+ } else {
+ refclock_process_offset(
+ pp, up->tpv_stamp, up->tpv_recvt, 0.0);
+ if (up->ppscount > 0)
+ up->ppscount -= 1;
+ }
+ up->fl_pps = 0;
+ up->fl_tpv = 0;
+ up->tc_good += 1;
+ }
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_stop_socket(
+ peerT * const peer)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ pp->io.fd = -1;
+ if (syslogok(pp, up))
+ msyslog(LOG_INFO,
+ "%s: closing socket to GPSD",
+ refnumtoa(&peer->srcadr));
+ up->tickover = up->tickpres;
+ up->tickpres = min(up->tickpres + 5, TICKOVER_HIGH);
+ up->fl_vers = 0;
+ up->fl_tpv = 0;
+ up->fl_pps = 0;
+ up->fl_watch = 0;
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_init_socket(
+ peerT * const peer)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+ addrinfoT * ai;
+ int rc;
+ int ov;
+
+ /* draw next address to try */
+ if (NULL == up->addr)
+ up->addr = s_gpsd_addr;
+ ai = up->addr;
+ up->addr = ai->ai_next;
+
+ /* try to create a matching socket */
+ up->fdt = socket(
+ ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ if (-1 == up->fdt) {
+ if (syslogok(pp, up))
+ msyslog(LOG_ERR,
+ "%s: cannot create GPSD socket: %m",
+ refnumtoa(&peer->srcadr));
+ goto no_socket;
+ }
+
+ /* make sure the socket is non-blocking */
+ rc = fcntl(up->fdt, F_SETFL, O_NONBLOCK, 1);
+ if (-1 == rc) {
+ if (syslogok(pp, up))
+ msyslog(LOG_ERR,
+ "%s: cannot set GPSD socket to non-blocking: %m",
+ refnumtoa(&peer->srcadr));
+ goto no_socket;
+ }
+ /* disable nagling */
+ ov = 1;
+ rc = setsockopt(up->fdt, IPPROTO_TCP, TCP_NODELAY,
+ (char*)&ov, sizeof(ov));
+ if (-1 == rc) {
+ if (syslogok(pp, up))
+ msyslog(LOG_INFO,
+ "%s: cannot disable TCP nagle: %m",
+ refnumtoa(&peer->srcadr));
+ }
+
+ /* start a non-blocking connect */
+ rc = connect(up->fdt, ai->ai_addr, ai->ai_addrlen);
+ if (-1 == rc && errno != EINPROGRESS) {
+ if (syslogok(pp, up))
+ msyslog(LOG_ERR,
+ "%s: cannot connect GPSD socket: %m",
+ refnumtoa(&peer->srcadr));
+ goto no_socket;
+ }
+
+ return;
+
+ no_socket:
+ if (-1 != up->fdt)
+ close(up->fdt);
+ up->fdt = -1;
+ up->tickover = up->tickpres;
+ up->tickpres = min(up->tickpres + 5, TICKOVER_HIGH);
+}
+
+/* ------------------------------------------------------------------ */
+
+static void
+gpsd_test_socket(
+ peerT * const peer)
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ int ec, rc;
+ socklen_t lc;
+
+ /* Check if the non-blocking connect was finished by testing the
+ * socket for writeability. Use the 'poll()' API if available
+ * and 'select()' otherwise.
+ */
+ DPRINTF(2, ("GPSD_JSON(%d): check connect, fd=%d\n",
+ up->unit, up->fdt));
+
+#if defined(HAVE_SYS_POLL_H)
+ {
+ struct pollfd pfd;
+
+ pfd.events = POLLOUT;
+ pfd.fd = up->fdt;
+ rc = poll(&pfd, 1, 0);
+ if (1 != rc || !(pfd.revents & POLLOUT))
+ return;
+ }
+#elif defined(HAVE_SYS_SELECT_H)
+ {
+ struct timeval tout;
+ fd_set wset;
+
+ memset(&tout, 0, sizeof(tout));
+ FD_ZERO(&wset);
+ FD_SET(up->fdt, &wset);
+ rc = select(up->fdt+1, NULL, &wset, NULL, &tout);
+ if (0 == rc || !(FD_ISSET(up->fdt, &wset)))
+ return;
+ }
+#else
+# error Blooper! That should have been found earlier!
+#endif
+
+ /* next timeout is a full one... */
+ up->tickover = TICKOVER_LOW;
+
+ /* check for socket error */
+ ec = 0;
+ lc = sizeof(ec);
+ rc = getsockopt(up->fdt, SOL_SOCKET, SO_ERROR, &ec, &lc);
+ DPRINTF(1, ("GPSD_JSON(%d): connect finshed, fd=%d, ec=%d(%s)\n",
+ up->unit, up->fdt, ec, strerror(ec)));
+ if (-1 == rc || 0 != ec) {
+ errno = ec;
+ if (syslogok(pp, up))
+ msyslog(LOG_ERR,
+ "%s: (async)cannot connect GPSD socket: %m",
+ refnumtoa(&peer->srcadr));
+ goto no_socket;
+ }
+ /* swap socket FDs, and make sure the clock was added */
+ pp->io.fd = up->fdt;
+ up->fdt = -1;
+ if (0 == io_addclock(&pp->io)) {
+ if (syslogok(pp, up))
+ msyslog(LOG_ERR,
+ "%s: failed to register with I/O engine",
+ refnumtoa(&peer->srcadr));
+ goto no_socket;
+ }
+ return;
+
+ no_socket:
+ if (-1 != up->fdt)
+ close(up->fdt);
+ up->fdt = -1;
+ up->tickover = up->tickpres;
+ up->tickpres = min(up->tickpres + 5, TICKOVER_HIGH);
+}
+
+/* =====================================================================
+ * helper stuff
+ */
+
+/*
+ * shm_clockstats - dump and reset counters
+ */
+static void
+gpsd_clockstats(
+ int unit,
+ peerT * const peer
+ )
+{
+ clockprocT * const pp = peer->procptr;
+ gpsd_unitT * const up = (gpsd_unitT *)pp->unitptr;
+
+ char logbuf[128];
+ unsigned int llen;
+
+ /* if snprintf() returns a negative values on errors (some older
+ * ones do) make sure we are NUL terminated. Using an unsigned
+ * result does the trick.
+ */
+ llen = snprintf(logbuf, sizeof(logbuf),
+ "good=%-3u badtime=%-3u baddate=%-3u badreply=%-3u recv=%-3u",
+ up->tc_good, up->tc_btime, up->tc_bdate,
+ up->tc_breply, up->tc_recv);
+ logbuf[min(llen, sizeof(logbuf)-1)] = '\0';
+ record_clock_stats(&peer->srcadr, logbuf);
+}
+
+/* -------------------------------------------------------------------
+ * Convert a GPSD timestam (ISO8601 Format) to an l_fp
+ */
+static BOOL
+convert_ascii_time(
+ l_fp * fp ,
+ const char * gps_time)
+{
+ char *ep;
+ struct tm gd;
+ struct timespec ts;
+ long dw;
+
+ /* Use 'strptime' to take the brunt of the work, then parse
+ * the fractional part manually, starting with a digit weight of
+ * 10^8 nanoseconds.
+ */
+ ts.tv_nsec = 0;
+ ep = strptime(gps_time, "%Y-%m-%dT%H:%M:%S", &gd);
+ if (*ep == '.') {
+ dw = 100000000;
+ while (isdigit(*++ep)) {
+ ts.tv_nsec += (*ep - '0') * dw;
+ dw /= 10;
+ }
+ }
+ if (ep[0] != 'Z' || ep[1] != '\0')
+ return FALSE;
+
+ /* now convert the whole thing into a 'l_fp' */
+ ts.tv_sec = (ntpcal_tm_to_rd(&gd) - DAY_NTP_STARTS) * SECSPERDAY
+ + ntpcal_tm_to_daysec(&gd);
+ *fp = tspec_intv_to_lfp(ts);
+
+ return TRUE;
+}
+
+/* -------------------------------------------------------------------
+ * Save the last timecode string, making sure it's properly truncated
+ * if necessary and NUL terminated in any case.
+ */
+static void
+save_ltc(
+ clockprocT * const pp,
+ const char * const tc)
+{
+ size_t len;
+
+ len = (tc) ? strlen(tc) : 0;
+ if (len >= sizeof(pp->a_lastcode))
+ len = sizeof(pp->a_lastcode) - 1;
+ pp->lencode = (u_short)len;
+ memcpy(pp->a_lastcode, tc, len);
+ pp->a_lastcode[len] = '\0';
+}
+
+/*
+ * -------------------------------------------------------------------
+ * asprintf replacement... it's not available everywhere...
+ */
+static int
+myasprintf(
+ char ** spp,
+ char const * fmt,
+ ... )
+{
+ size_t alen, plen;
+
+ alen = 32;
+ *spp = NULL;
+ do {
+ va_list va;
+
+ alen += alen;
+ free(*spp);
+ *spp = (char*)malloc(alen);
+ if (NULL == *spp)
+ return -1;
+
+ va_start(va, fmt);
+ plen = (size_t)vsnprintf(*spp, alen, fmt, va);
+ va_end(va);
+ } while (plen >= alen);
+
+ return (int)plen;
+}
+
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif /* REFCLOCK && CLOCK_GPSDJSON */
diff --git a/ntpd/refclock_gpsvme.c b/ntpd/refclock_gpsvme.c
new file mode 100644
index 0000000..66ccc9a
--- /dev/null
+++ b/ntpd/refclock_gpsvme.c
@@ -0,0 +1,253 @@
+/* refclock_psc.c: clock driver for Brandywine PCI-SyncClock32/HP-UX 11.X */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#if defined(REFCLOCK) && defined(CLOCK_GPSVME)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#ifdef __hpux
+#include <sys/rtprio.h> /* may already be included above */
+#include <sys/lock.h> /* NEEDED for PROCLOCK */
+#endif /* __hpux */
+
+#ifdef __linux__
+#include <sys/ioctl.h> /* for _IOR, ioctl */
+#endif /* __linux__ */
+
+enum { /* constants */
+ BUFSIZE = 32,
+ PSC_SYNC_OK = 0x40, /* Sync status bit */
+ DP_LEAPSEC_DAY10DAY1 = 0x82, /* DP RAM address */
+ DP_LEAPSEC_DAY1000DAY100 = 0x83,
+ DELAY = 1,
+ NUNIT = 2 /* max UNITS */
+};
+
+/* clock card registers */
+struct psc_regs {
+ uint32_t low_time; /* card base + 0x00 */
+ uint32_t high_time; /* card base + 0x04 */
+ uint32_t ext_low_time; /* card base + 0x08 */
+ uint32_t ext_high_time; /* card base + 0x0C */
+ uint8_t device_status; /* card base + 0x10 */
+ uint8_t device_control; /* card base + 0x11 */
+ uint8_t reserved0; /* card base + 0x12 */
+ uint8_t ext_100ns; /* card base + 0x13 */
+ uint8_t match_usec; /* card base + 0x14 */
+ uint8_t match_msec; /* card base + 0x15 */
+ uint8_t reserved1; /* card base + 0x16 */
+ uint8_t reserved2; /* card base + 0x17 */
+ uint8_t reserved3; /* card base + 0x18 */
+ uint8_t reserved4; /* card base + 0x19 */
+ uint8_t dp_ram_addr; /* card base + 0x1A */
+ uint8_t reserved5; /* card base + 0x1B */
+ uint8_t reserved6; /* card base + 0x1C */
+ uint8_t reserved7; /* card base + 0x1D */
+ uint8_t dp_ram_data; /* card base + 0x1E */
+ uint8_t reserved8; /* card base + 0x1F */
+} *volatile regp[NUNIT];
+
+#define PSC_REGS _IOR('K', 0, long) /* ioctl argument */
+
+/* Macros to swap byte order and convert BCD to binary */
+#define SWAP(val) ( ((val) >> 24) | (((val) & 0x00ff0000) >> 8) | \
+(((val) & 0x0000ff00) << 8) | (((val) & 0x000000ff) << 24) )
+#define BCD2INT2(val) ( ((val) >> 4 & 0x0f)*10 + ((val) & 0x0f) )
+#define BCD2INT3(val) ( ((val) >> 8 & 0x0f)*100 + ((val) >> 4 & 0x0f)*10 + \
+((val) & 0x0f) )
+
+/* PSC interface definitions */
+#define PRECISION (-20) /* precision assumed (1 us) */
+#define REFID "USNO" /* reference ID */
+#define DESCRIPTION "Brandywine PCI-SyncClock32"
+#define DEVICE "/dev/refclock%1d" /* device file */
+
+/* clock unit control structure */
+struct psc_unit {
+ short unit; /* NTP refclock unit number */
+ short last_hour; /* last hour (monitor leap sec) */
+ int msg_flag[2]; /* count error messages */
+};
+int fd[NUNIT]; /* file descriptor */
+
+/* Local function prototypes */
+static int psc_start(int, struct peer *);
+static void psc_shutdown(int, struct peer *);
+static void psc_poll(int, struct peer *);
+static void check_leap_sec(struct refclockproc *, int);
+
+/* Transfer vector */
+struct refclock refclock_gpsvme = {
+ psc_start, psc_shutdown, psc_poll, noentry, noentry, noentry, NOFLAGS
+};
+
+/* psc_start: open device and initialize data for processing */
+static int
+psc_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ char buf[BUFSIZE];
+ struct refclockproc *pp;
+ struct psc_unit *up = emalloc(sizeof *up);
+
+ if (unit < 0 || unit > 1) { /* support units 0 and 1 */
+ msyslog(LOG_ERR, "psc_start: bad unit: %d", unit);
+ return 0;
+ }
+
+ memset(up, '\0', sizeof *up);
+
+ snprintf(buf, sizeof(buf), DEVICE, unit); /* dev file name */
+ fd[unit] = open(buf, O_RDONLY); /* open device file */
+ if (fd[unit] < 0) {
+ msyslog(LOG_ERR, "psc_start: unit: %d, open failed. %m", unit);
+ return 0;
+ }
+
+ /* get the address of the mapped regs */
+ if (ioctl(fd[unit], PSC_REGS, &regp[unit]) < 0) {
+ msyslog(LOG_ERR, "psc_start: unit: %d, ioctl failed. %m", unit);
+ return 0;
+ }
+
+ /* initialize peer variables */
+ pp = peer->procptr;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = -1;
+ pp->unitptr = up;
+ get_systime(&pp->lastrec);
+ memcpy(&pp->refid, REFID, 4);
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ up->unit = unit;
+#ifdef __hpux
+ rtprio(0,120); /* set real time priority */
+ plock(PROCLOCK); /* lock process in memory */
+#endif /* __hpux */
+ return 1;
+}
+
+/* psc_shutdown: shut down the clock */
+static void
+psc_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ if (NULL != peer->procptr->unitptr)
+ free(peer->procptr->unitptr);
+ if (fd[unit] > 0)
+ close(fd[unit]);
+}
+
+/* psc_poll: read, decode, and record device time */
+static void
+psc_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp = peer->procptr;
+ struct psc_unit *up;
+ unsigned tlo, thi;
+ unsigned char status;
+
+ up = (struct psc_unit *) pp->unitptr;
+ tlo = regp[unit]->low_time; /* latch and read first 4 bytes */
+ thi = regp[unit]->high_time; /* read 4 higher order bytes */
+ status = regp[unit]->device_status; /* read device status byte */
+
+ if (!(status & PSC_SYNC_OK)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ if (!up->msg_flag[unit]) { /* write once to system log */
+ msyslog(LOG_WARNING,
+ "SYNCHRONIZATION LOST on unit %1d, status %02x\n",
+ unit, status);
+ up->msg_flag[unit] = 1;
+ }
+ return;
+ }
+
+ get_systime(&pp->lastrec);
+ pp->polls++;
+
+ tlo = SWAP(tlo); /* little to big endian swap on */
+ thi = SWAP(thi); /* copy of data */
+ /* convert the BCD time to broken down time used by refclockproc */
+ pp->day = BCD2INT3((thi & 0x0FFF0000) >> 16);
+ pp->hour = BCD2INT2((thi & 0x0000FF00) >> 8);
+ pp->minute = BCD2INT2(thi & 0x000000FF);
+ pp->second = BCD2INT2(tlo >> 24);
+ /* ntp_process() in ntp_refclock.c appears to use usec as fraction of
+ second in microseconds if usec is nonzero. */
+ pp->nsec = 1000000*BCD2INT3((tlo & 0x00FFF000) >> 12) +
+ BCD2INT3(tlo & 0x00000FFF);
+
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%3.3d %2.2d:%2.2d:%2.2d.%09ld %02x %08x %08x", pp->day,
+ pp->hour, pp->minute, pp->second, pp->nsec, status, thi,
+ tlo);
+ pp->lencode = strlen(pp->a_lastcode);
+
+ /* compute the timecode timestamp */
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ /* simulate the NTP receive and packet procedures */
+ refclock_receive(peer);
+ /* write clock statistics to file */
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+ /* With the first timecode beginning the day, check for a GPS
+ leap second notification. */
+ if (pp->hour < up->last_hour) {
+ check_leap_sec(pp, unit);
+ up->msg_flag[0] = up->msg_flag[1] = 0; /* reset flags */
+ }
+ up->last_hour = pp->hour;
+}
+
+/* check_leap_sec: read the Dual Port RAM leap second day registers. The
+ onboard GPS receiver should write the hundreds digit of day of year in
+ DP_LeapSec_Day1000Day100 and the tens and ones digits in
+ DP_LeapSec_Day10Day1. If these values are nonzero and today, we have
+ a leap second pending, so we set the pp->leap flag to LEAP_ADDSECOND.
+ If the BCD data are zero or a date other than today, set pp->leap to
+ LEAP_NOWARNING. */
+static void
+check_leap_sec(struct refclockproc *pp, int unit)
+{
+ unsigned char dhi, dlo;
+ int leap_day;
+
+ regp[unit]->dp_ram_addr = DP_LEAPSEC_DAY10DAY1;
+ usleep(DELAY);
+ dlo = regp[unit]->dp_ram_data;
+ regp[unit]->dp_ram_addr = DP_LEAPSEC_DAY1000DAY100;
+ usleep(DELAY);
+ dhi = regp[unit]->dp_ram_data;
+ leap_day = BCD2INT2(dlo) + 100*(dhi & 0x0F);
+
+ pp->leap = LEAP_NOWARNING; /* default */
+ if (leap_day && leap_day == pp->day) {
+ pp->leap = LEAP_ADDSECOND; /* leap second today */
+ msyslog(LOG_ERR, "LEAP_ADDSECOND flag set, day %d (%x %x).",
+ leap_day, dhi, dlo);
+ }
+}
+
+#else
+int refclock_gpsvme_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_heath.c b/ntpd/refclock_heath.c
new file mode 100644
index 0000000..435d8f6
--- /dev/null
+++ b/ntpd/refclock_heath.c
@@ -0,0 +1,450 @@
+/*
+ * refclock_heath - clock driver for Heath GC-1000
+ * (but no longer the GC-1001 Model II, which apparently never worked)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_HEATH)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif /* not HAVE_SYS_IOCTL_H */
+
+/*
+ * This driver supports the Heath GC-1000 Most Accurate Clock, with
+ * RS232C Output Accessory. This is a WWV/WWVH receiver somewhat less
+ * robust than other supported receivers. Its claimed accuracy is 100 ms
+ * when actually synchronized to the broadcast signal, but this doesn't
+ * happen even most of the time, due to propagation conditions, ambient
+ * noise sources, etc. When not synchronized, the accuracy is at the
+ * whim of the internal clock oscillator, which can wander into the
+ * sunset without warning. Since the indicated precision is 100 ms,
+ * expect a host synchronized only to this thing to wander to and fro,
+ * occasionally being rudely stepped when the offset exceeds the default
+ * clock_max of 128 ms.
+ *
+ * There were two GC-1000 versions supported by this driver. The original
+ * GC-1000 with RS-232 output first appeared in 1983, but dissapeared
+ * from the market a few years later. The GC-1001 II with RS-232 output
+ * first appeared circa 1990, but apparently is no longer manufactured.
+ * The two models differ considerably, both in interface and commands.
+ * The GC-1000 has a pseudo-bipolar timecode output triggered by a RTS
+ * transition. The timecode includes both the day of year and time of
+ * day. The GC-1001 II has a true bipolar output and a complement of
+ * single character commands. The timecode includes only the time of
+ * day.
+ *
+ * The GC-1001 II was apparently never tested and, based on a Coverity
+ * scan, apparently never worked [Bug 689]. Related code has been disabled.
+ *
+ * GC-1000
+ *
+ * The internal DIPswitches should be set to operate in MANUAL mode. The
+ * external DIPswitches should be set to GMT and 24-hour format.
+ *
+ * In MANUAL mode the clock responds to a rising edge of the request to
+ * send (RTS) modem control line by sending the timecode. Therefore, it
+ * is necessary that the operating system implement the TIOCMBIC and
+ * TIOCMBIS ioctl system calls and TIOCM_RTS control bit. Present
+ * restrictions require the use of a POSIX-compatible programming
+ * interface, although other interfaces may work as well.
+ *
+ * A simple hardware modification to the clock can be made which
+ * prevents the clock hearing the request to send (RTS) if the HI SPEC
+ * lamp is out. Route the HISPEC signal to the tone decoder board pin
+ * 19, from the display, pin 19. Isolate pin 19 of the decoder board
+ * first, but maintain connection with pin 10. Also isolate pin 38 of
+ * the CPU on the tone board, and use half an added 7400 to gate the
+ * original signal to pin 38 with that from pin 19.
+ *
+ * The clock message consists of 23 ASCII printing characters in the
+ * following format:
+ *
+ * hh:mm:ss.f AM dd/mm/yr<cr>
+ *
+ * hh:mm:ss.f = hours, minutes, seconds
+ * f = deciseconds ('?' when out of spec)
+ * AM/PM/bb = blank in 24-hour mode
+ * dd/mm/yr = day, month, year
+ *
+ * The alarm condition is indicated by '?', rather than a digit, at f.
+ * Note that 0?:??:??.? is displayed before synchronization is first
+ * established and hh:mm:ss.? once synchronization is established and
+ * then lost again for about a day.
+ *
+ * GC-1001 II
+ *
+ * Commands consist of a single letter and are case sensitive. When
+ * enterred in lower case, a description of the action performed is
+ * displayed. When enterred in upper case the action is performed.
+ * Following is a summary of descriptions as displayed by the clock:
+ *
+ * The clock responds with a command The 'A' command returns an ASCII
+ * local time string: HH:MM:SS.T xx<CR>, where
+ *
+ * HH = hours
+ * MM = minutes
+ * SS = seconds
+ * T = tenths-of-seconds
+ * xx = 'AM', 'PM', or ' '
+ * <CR> = carriage return
+ *
+ * The 'D' command returns 24 pairs of bytes containing the variable
+ * divisor value at the end of each of the previous 24 hours. This
+ * allows the timebase trimming process to be observed. UTC hour 00 is
+ * always returned first. The first byte of each pair is the high byte
+ * of (variable divisor * 16); the second byte is the low byte of
+ * (variable divisor * 16). For example, the byte pair 3C 10 would be
+ * returned for a divisor of 03C1 hex (961 decimal).
+ *
+ * The 'I' command returns: | TH | TL | ER | DH | DL | U1 | I1 | I2 | ,
+ * where
+ *
+ * TH = minutes since timebase last trimmed (high byte)
+ * TL = minutes since timebase last trimmed (low byte)
+ * ER = last accumulated error in 1.25 ms increments
+ * DH = high byte of (current variable divisor * 16)
+ * DL = low byte of (current variable divisor * 16)
+ * U1 = UT1 offset (/.1 s): | + | 4 | 2 | 1 | 0 | 0 | 0 | 0 |
+ * I1 = information byte 1: | W | C | D | I | U | T | Z | 1 | ,
+ * where
+ *
+ * W = set by WWV(H)
+ * C = CAPTURE LED on
+ * D = TRIM DN LED on
+ * I = HI SPEC LED on
+ * U = TRIM UP LED on
+ * T = DST switch on
+ * Z = UTC switch on
+ * 1 = UT1 switch on
+ *
+ * I2 = information byte 2: | 8 | 8 | 4 | 2 | 1 | D | d | S | ,
+ * where
+ *
+ * 8, 8, 4, 2, 1 = TIME ZONE switch settings
+ * D = DST bit (#55) in last-received frame
+ * d = DST bit (#2) in last-received frame
+ * S = clock is in simulation mode
+ *
+ * The 'P' command returns 24 bytes containing the number of frames
+ * received without error during UTC hours 00 through 23, providing an
+ * indication of hourly propagation. These bytes are updated each hour
+ * to reflect the previous 24 hour period. UTC hour 00 is always
+ * returned first.
+ *
+ * The 'T' command returns the UTC time: | HH | MM | SS | T0 | , where
+ * HH = tens-of-hours and hours (packed BCD)
+ * MM = tens-of-minutes and minutes (packed BCD)
+ * SS = tens-of-seconds and seconds (packed BCD)
+ * T = tenths-of-seconds (BCD)
+ *
+ * Fudge Factors
+ *
+ * A fudge time1 value of .04 s appears to center the clock offset
+ * residuals. The fudge time2 parameter is the local time offset east of
+ * Greenwich, which depends on DST. Sorry about that, but the clock
+ * gives no hint on what the DIPswitches say.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/heath%d" /* device name and unit */
+#define PRECISION (-4) /* precision assumed (about 100 ms) */
+#define REFID "WWV\0" /* reference ID */
+#define DESCRIPTION "Heath GC-1000 Most Accurate Clock" /* WRU */
+
+#define LENHEATH1 23 /* min timecode length */
+#if 0 /* BUG 689 */
+#define LENHEATH2 13 /* min timecode length */
+#endif
+
+/*
+ * Tables to compute the ddd of year form icky dd/mm timecode. Viva la
+ * leap.
+ */
+static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+/*
+ * Baud rate table. The GC-1000 supports 1200, 2400 and 4800; the
+ * GC-1001 II supports only 9600.
+ */
+static int speed[] = {B1200, B2400, B4800, B9600};
+
+/*
+ * Function prototypes
+ */
+static int heath_start (int, struct peer *);
+static void heath_shutdown (int, struct peer *);
+static void heath_receive (struct recvbuf *);
+static void heath_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_heath = {
+ heath_start, /* start up driver */
+ heath_shutdown, /* shut down driver */
+ heath_poll, /* transmit poll message */
+ noentry, /* not used (old heath_control) */
+ noentry, /* initialize driver */
+ noentry, /* not used (old heath_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * heath_start - open the devices and initialize data for processing
+ */
+static int
+heath_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open serial port
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, speed[peer->ttl & 0x3],
+ LDISC_REMOTE);
+ if (fd <= 0)
+ return (0);
+ pp = peer->procptr;
+ pp->io.clock_recv = heath_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ return (0);
+ }
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, REFID, 4);
+ return (1);
+}
+
+
+/*
+ * heath_shutdown - shut down the clock
+ */
+static void
+heath_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+}
+
+
+/*
+ * heath_receive - receive data from the serial interface
+ */
+static void
+heath_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct refclockproc *pp;
+ struct peer *peer;
+ l_fp trtmp;
+ int month, day;
+ int i;
+ char dsec, a[5];
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX,
+ &trtmp);
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has invalid length or is not in
+ * proper format, we declare bad format and exit.
+ */
+ switch (pp->lencode) {
+
+ /*
+ * GC-1000 timecode format: "hh:mm:ss.f AM mm/dd/yy"
+ * GC-1001 II timecode format: "hh:mm:ss.f "
+ */
+ case LENHEATH1:
+ if (sscanf(pp->a_lastcode,
+ "%2d:%2d:%2d.%c%5c%2d/%2d/%2d", &pp->hour,
+ &pp->minute, &pp->second, &dsec, a, &month, &day,
+ &pp->year) != 8) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ break;
+
+#if 0 /* BUG 689 */
+ /*
+ * GC-1001 II timecode format: "hh:mm:ss.f "
+ */
+ case LENHEATH2:
+ if (sscanf(pp->a_lastcode, "%2d:%2d:%2d.%c", &pp->hour,
+ &pp->minute, &pp->second, &dsec) != 4) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ } else {
+ struct tm *tm_time_p;
+ time_t now;
+
+ time(&now); /* we should grab 'now' earlier */
+ tm_time_p = gmtime(&now);
+ /*
+ * There is a window of time around midnight
+ * where this will Do The Wrong Thing.
+ */
+ if (tm_time_p) {
+ month = tm_time_p->tm_mon + 1;
+ day = tm_time_p->tm_mday;
+ } else {
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+ }
+ break;
+#endif
+
+ default:
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * We determine the day of the year from the DIPswitches. This
+ * should be fixed, since somebody might forget to set them.
+ * Someday this hazard will be fixed by a fiendish scheme that
+ * looks at the timecode and year the radio shows, then computes
+ * the residue of the seconds mod the seconds in a leap cycle.
+ * If in the third year of that cycle and the third and later
+ * months of that year, add one to the day. Then, correct the
+ * timecode accordingly. Icky pooh. This bit of nonsense could
+ * be avoided if the engineers had been required to write a
+ * device driver before finalizing the timecode format.
+ */
+ if (month < 1 || month > 12 || day < 1) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ if (pp->year % 4) {
+ if (day > day1tab[month - 1]) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ for (i = 0; i < month - 1; i++)
+ day += day1tab[i];
+ } else {
+ if (day > day2tab[month - 1]) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ for (i = 0; i < month - 1; i++)
+ day += day2tab[i];
+ }
+ pp->day = day;
+
+ /*
+ * Determine synchronization and last update
+ */
+ if (!isdigit((int)dsec))
+ pp->leap = LEAP_NOTINSYNC;
+ else {
+ pp->nsec = (dsec - '0') * 100000000;
+ pp->leap = LEAP_NOWARNING;
+ }
+ if (!refclock_process(pp))
+ refclock_report(peer, CEVNT_BADTIME);
+}
+
+
+/*
+ * heath_poll - called by the transmit procedure
+ */
+static void
+heath_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ int bits = TIOCM_RTS;
+
+ /*
+ * At each poll we check for timeout and toggle the RTS modem
+ * control line, then take a timestamp. Presumably, this is the
+ * event the radio captures to generate the timecode.
+ * Apparently, the radio takes about a second to make up its
+ * mind to send a timecode, so the receive timestamp is
+ * worthless.
+ */
+ pp = peer->procptr;
+
+ /*
+ * We toggle the RTS modem control lead (GC-1000) and sent a T
+ * (GC-1001 II) to kick a timecode loose from the radio. This
+ * code works only for POSIX and SYSV interfaces. With bsd you
+ * are on your own. We take a timestamp between the up and down
+ * edges to lengthen the pulse, which should be about 50 usec on
+ * a Sun IPC. With hotshot CPUs, the pulse might get too short.
+ * Later.
+ *
+ * Bug 689: Even though we no longer support the GC-1001 II,
+ * I'm leaving the 'T' write in for timing purposes.
+ */
+ if (ioctl(pp->io.fd, TIOCMBIC, (char *)&bits) < 0)
+ refclock_report(peer, CEVNT_FAULT);
+ get_systime(&pp->lastrec);
+ if (write(pp->io.fd, "T", 1) != 1)
+ refclock_report(peer, CEVNT_FAULT);
+ ioctl(pp->io.fd, TIOCMBIS, (char *)&bits);
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("heath: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif
+ pp->polls++;
+}
+
+#else
+int refclock_heath_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_hopfpci.c b/ntpd/refclock_hopfpci.c
new file mode 100644
index 0000000..95bcab9
--- /dev/null
+++ b/ntpd/refclock_hopfpci.c
@@ -0,0 +1,258 @@
+/*
+ * refclock_hopfpci.c
+ *
+ * - clock driver for hopf 6039 PCI board (GPS or DCF77)
+ * Bernd Altmeier altmeier@atlsoft.de
+ *
+ * latest source and further information can be found at:
+ * http://www.ATLSoft.de/ntp
+ *
+ * In order to run this driver you have to install and test
+ * the PCI-board driver for your system first.
+ *
+ * On Linux/UNIX
+ *
+ * The driver attempts to open the device /dev/hopf6039 .
+ * The device entry will be made by the installation process of
+ * the kernel module for the PCI-bus board. The driver sources
+ * belongs to the delivery equipment of the PCI-board.
+ *
+ * On Windows NT/2000
+ *
+ * The driver attempts to open the device by calling the function
+ * "OpenHopfDevice()". This function will be installed by the
+ * Device Driver for the PCI-bus board. The driver belongs to the
+ * delivery equipment of the PCI-board.
+ *
+ *
+ * Start 21.03.2000 Revision: 01.20
+ * changes 22.12.2000 Revision: 01.40 flag1 = 1 sync even if Quarz
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_HOPF_PCI)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#undef fileno
+#include <ctype.h>
+#undef fileno
+
+#ifndef SYS_WINNT
+# include <sys/ipc.h>
+# include <sys/ioctl.h>
+# include <assert.h>
+# include <unistd.h>
+# include <stdio.h>
+# include "hopf6039.h"
+#else
+# include "hopf_PCI_io.h"
+#endif
+
+/*
+ * hopfpci interface definitions
+ */
+#define PRECISION (-10) /* precision assumed (1 ms) */
+#define REFID "hopf" /* reference ID */
+#define DESCRIPTION "hopf Elektronik PCI radio board"
+
+#define NSAMPLES 3 /* stages of median filter */
+#ifndef SYS_WINNT
+# define DEVICE "/dev/hopf6039" /* device name inode*/
+#else
+# define DEVICE "hopf6039" /* device name WinNT */
+#endif
+
+#define LEWAPWAR 0x20 /* leap second warning bit */
+
+#define HOPF_OPMODE 0xC0 /* operation mode mask */
+#define HOPF_INVALID 0x00 /* no time code available */
+#define HOPF_INTERNAL 0x40 /* internal clock */
+#define HOPF_RADIO 0x80 /* radio clock */
+#define HOPF_RADIOHP 0xC0 /* high precision radio clock */
+
+
+/*
+ * hopfclock unit control structure.
+ */
+struct hopfclock_unit {
+ short unit; /* NTP refclock unit number */
+ char leap_status; /* leap second flag */
+};
+int fd; /* file descr. */
+
+/*
+ * Function prototypes
+ */
+static int hopfpci_start (int, struct peer *);
+static void hopfpci_shutdown (int, struct peer *);
+static void hopfpci_poll (int unit, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_hopfpci = {
+ hopfpci_start, /* start up driver */
+ hopfpci_shutdown, /* shut down driver */
+ hopfpci_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+/*
+ * hopfpci_start - attach to hopf PCI board 6039
+ */
+static int
+hopfpci_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct hopfclock_unit *up;
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+
+#ifndef SYS_WINNT
+
+ fd = open(DEVICE,O_RDWR); /* try to open hopf clock device */
+
+#else
+ if (!OpenHopfDevice()) {
+ msyslog(LOG_ERR, "Start: %s unit: %d failed!", DEVICE, unit);
+ free(up);
+ return (0);
+ }
+#endif
+
+ pp = peer->procptr;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = INVALID_SOCKET;
+ pp->unitptr = up;
+
+ get_systime(&pp->lastrec);
+
+ /*
+ * Initialize miscellaneous peer variables
+ */
+ memcpy((char *)&pp->refid, REFID, 4);
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ up->leap_status = 0;
+ up->unit = (short) unit;
+ return (1);
+}
+
+
+/*
+ * hopfpci_shutdown - shut down the clock
+ */
+static void
+hopfpci_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+
+#ifndef SYS_WINNT
+ close(fd);
+#else
+ CloseHopfDevice();
+#endif
+ if (NULL != peer->procptr->unitptr)
+ free(peer->procptr->unitptr);
+}
+
+
+/*
+ * hopfpci_poll - called by the transmit procedure
+ */
+static void
+hopfpci_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ HOPFTIME m_time;
+
+ pp = peer->procptr;
+
+#ifndef SYS_WINNT
+ if (ioctl(fd, HOPF_CLOCK_GET_UTC, &m_time) < 0)
+ msyslog(LOG_ERR, "HOPF_P(%d): HOPF_CLOCK_GET_UTC: %m",
+ unit);
+#else
+ GetHopfSystemTime(&m_time);
+#endif
+ pp->polls++;
+
+ pp->day = ymd2yd(m_time.wYear,m_time.wMonth,m_time.wDay);
+ pp->hour = m_time.wHour;
+ pp->minute = m_time.wMinute;
+ pp->second = m_time.wSecond;
+ pp->nsec = m_time.wMilliseconds * 1000000;
+ if (m_time.wStatus & LEWAPWAR)
+ pp->leap = LEAP_ADDSECOND;
+ else
+ pp->leap = LEAP_NOWARNING;
+
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "ST: %02X T: %02d:%02d:%02d.%03ld D: %02d.%02d.%04d",
+ m_time.wStatus, pp->hour, pp->minute, pp->second,
+ pp->nsec / 1000000, m_time.wDay, m_time.wMonth,
+ m_time.wYear);
+ pp->lencode = (u_short)strlen(pp->a_lastcode);
+
+ get_systime(&pp->lastrec);
+
+ /*
+ * If clock has no valid status then report error and exit
+ */
+ if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INVALID) { /* time ok? */
+ refclock_report(peer, CEVNT_BADTIME);
+ pp->leap = LEAP_NOTINSYNC;
+ return;
+ }
+
+ /*
+ * Test if time is running on internal quarz
+ * if CLK_FLAG1 is set, sychronize even if no radio operation
+ */
+
+ if ((m_time.wStatus & HOPF_OPMODE) == HOPF_INTERNAL){
+ if ((pp->sloppyclockflag & CLK_FLAG1) == 0) {
+ refclock_report(peer, CEVNT_BADTIME);
+ pp->leap = LEAP_NOTINSYNC;
+ return;
+ }
+ }
+
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ return;
+}
+
+#else
+int refclock_hopfpci_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_hopfser.c b/ntpd/refclock_hopfser.c
new file mode 100644
index 0000000..dae8b37
--- /dev/null
+++ b/ntpd/refclock_hopfser.c
@@ -0,0 +1,372 @@
+/*
+ *
+ * refclock_hopfser.c
+ * - clock driver for hopf serial boards (GPS or DCF77)
+ *
+ * Date: 30.03.2000 Revision: 01.10
+ *
+ * latest source and further information can be found at:
+ * http://www.ATLSoft.de/ntp
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(REFCLOCK) && (defined(CLOCK_HOPF_SERIAL))
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_control.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#if defined HAVE_SYS_MODEM_H
+# include <sys/modem.h>
+# ifndef __QNXNTO__
+# define TIOCMSET MCSETA
+# define TIOCMGET MCGETA
+# define TIOCM_RTS MRTS
+# endif
+#endif
+
+#ifdef HAVE_TERMIOS_H
+# ifdef TERMIOS_NEEDS__SVID3
+# define _SVID3
+# endif
+# include <termios.h>
+# ifdef TERMIOS_NEEDS__SVID3
+# undef _SVID3
+# endif
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
+#ifdef SYS_WINNT
+extern int async_write(int, const void *, unsigned int);
+#undef write
+#define write(fd, data, octets) async_write(fd, data, octets)
+#endif
+
+/*
+ * clock definitions
+ */
+#define DESCRIPTION "hopf Elektronik serial clock" /* Long name */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define REFID "hopf\0" /* reference ID */
+/*
+ * I/O definitions
+ */
+#define DEVICE "/dev/hopfclock%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+
+
+#define STX 0x02
+#define ETX 0x03
+#define CR 0x0c
+#define LF 0x0a
+
+/* parse states */
+#define REC_QUEUE_EMPTY 0
+#define REC_QUEUE_FULL 1
+
+#define HOPF_OPMODE 0x0C /* operation mode mask */
+#define HOPF_INVALID 0x00 /* no time code available */
+#define HOPF_INTERNAL 0x04 /* internal clock */
+#define HOPF_RADIO 0x08 /* radio clock */
+#define HOPF_RADIOHP 0x0C /* high precision radio clock */
+
+/*
+ * hopfclock unit control structure.
+ */
+struct hopfclock_unit {
+ l_fp laststamp; /* last receive timestamp */
+ short unit; /* NTP refclock unit number */
+ u_long polled; /* flag to detect noreplies */
+ char leap_status; /* leap second flag */
+ int rpt_next;
+};
+
+/*
+ * Function prototypes
+ */
+
+static int hopfserial_start (int, struct peer *);
+static void hopfserial_shutdown (int, struct peer *);
+static void hopfserial_receive (struct recvbuf *);
+static void hopfserial_poll (int, struct peer *);
+/* static void hopfserial_io (struct recvbuf *); */
+/*
+ * Transfer vector
+ */
+struct refclock refclock_hopfser = {
+ hopfserial_start, /* start up driver */
+ hopfserial_shutdown, /* shut down driver */
+ hopfserial_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+/*
+ * hopfserial_start - open the devices and initialize data for processing
+ */
+static int
+hopfserial_start (
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct hopfclock_unit *up;
+ struct refclockproc *pp;
+ int fd;
+ char gpsdev[20];
+
+ snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
+
+ /* LDISC_STD, LDISC_RAW
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ fd = refclock_open(gpsdev, SPEED232, LDISC_CLK);
+ if (fd <= 0) {
+#ifdef DEBUG
+ printf("hopfSerialClock(%d) start: open %s failed\n", unit, gpsdev);
+#endif
+ return 0;
+ }
+
+ msyslog(LOG_NOTICE, "hopfSerialClock(%d) fd: %d dev: %s", unit, fd,
+ gpsdev);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->unitptr = up;
+ pp->io.clock_recv = hopfserial_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+#ifdef DEBUG
+ printf("hopfSerialClock(%d) io_addclock\n", unit);
+#endif
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ pp->unitptr = NULL;
+ return (0);
+ }
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ pp->clockdesc = DESCRIPTION;
+ peer->precision = PRECISION;
+ memcpy((char *)&pp->refid, REFID, 4);
+
+ up->leap_status = 0;
+ up->unit = (short) unit;
+
+ return (1);
+}
+
+
+/*
+ * hopfserial_shutdown - shut down the clock
+ */
+static void
+hopfserial_shutdown (
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct hopfclock_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+
+/*
+ * hopfserial_receive - receive data from the serial interface
+ */
+
+static void
+hopfserial_receive (
+ struct recvbuf *rbufp
+ )
+{
+ struct hopfclock_unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ int synch; /* synchhronization indicator */
+ int DoW; /* Day of Week */
+
+ int day, month; /* ddd conversion */
+ int converted;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp.
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (up->rpt_next == 0 )
+ return;
+
+ up->rpt_next = 0; /* wait until next poll interval occur */
+
+ pp->lencode = (u_short)refclock_gtlin(rbufp, pp->a_lastcode,
+ sizeof(pp->a_lastcode),
+ &pp->lastrec);
+ if (pp->lencode == 0)
+ return;
+
+ converted = sscanf(pp->a_lastcode,
+#if 1
+ "%1x%1x%2d%2d%2d%2d%2d%2d", /* ...cr,lf */
+#else
+ "%*c%1x%1x%2d%2d%2d%2d%2d%2d", /* stx...cr,lf,etx */
+#endif
+ &synch,
+ &DoW,
+ &pp->hour,
+ &pp->minute,
+ &pp->second,
+ &day,
+ &month,
+ &pp->year);
+
+
+ /*
+ Validate received values at least enough to prevent internal
+ array-bounds problems, etc.
+ */
+ if ((8 != converted) || (pp->hour < 0) || (pp->hour > 23) ||
+ (pp->minute < 0) || (pp->minute > 59) || (pp->second < 0) ||
+ (pp->second > 60) /*Allow for leap seconds.*/ ||
+ (day < 1) || (day > 31) ||
+ (month < 1) || (month > 12) ||
+ (pp->year < 0) || (pp->year > 99)) {
+ /* Data out of range. */
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ /*
+ some preparations
+ */
+ pp->day = ymd2yd(pp->year,month,day);
+ pp->leap=0;
+
+ /* Year-2000 check! */
+ /* wrap 2-digit date into 4-digit */
+
+ if(pp->year < YEAR_PIVOT) { pp->year += 100; } /* < 98 */
+ pp->year += 1900;
+
+ /* preparation for timecode ntpq rl command ! */
+
+#if 0
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "STATUS: %1X%1X, DATE: %02d.%02d.%04d TIME: %02d:%02d:%02d",
+ synch,
+ DoW,
+ day,
+ month,
+ pp->year,
+ pp->hour,
+ pp->minute,
+ pp->second);
+
+ pp->lencode = strlen(pp->a_lastcode);
+ if ((synch && 0xc) == 0 ){ /* time ok? */
+ refclock_report(peer, CEVNT_BADTIME);
+ pp->leap = LEAP_NOTINSYNC;
+ return;
+ }
+#endif
+ /*
+ * If clock has no valid status then report error and exit
+ */
+ if ((synch & HOPF_OPMODE) == HOPF_INVALID ){ /* time ok? */
+ refclock_report(peer, CEVNT_BADTIME);
+ pp->leap = LEAP_NOTINSYNC;
+ return;
+ }
+
+ /*
+ * Test if time is running on internal quarz
+ * if CLK_FLAG1 is set, sychronize even if no radio operation
+ */
+
+ if ((synch & HOPF_OPMODE) == HOPF_INTERNAL){
+ if ((pp->sloppyclockflag & CLK_FLAG1) == 0) {
+ refclock_report(peer, CEVNT_BADTIME);
+ pp->leap = LEAP_NOTINSYNC;
+ return;
+ }
+ }
+
+
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+
+#if 0
+ msyslog(LOG_ERR, " D:%x D:%d D:%d",synch,pp->minute,pp->second);
+#endif
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+ return;
+}
+
+
+/*
+ * hopfserial_poll - called by the transmit procedure
+ *
+ */
+static void
+hopfserial_poll (
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct hopfclock_unit *up;
+ struct refclockproc *pp;
+ pp = peer->procptr;
+
+ up = pp->unitptr;
+
+ pp->polls++;
+ up->rpt_next = 1;
+
+#if 0
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#endif
+
+ return;
+}
+
+#else
+int refclock_hopfser_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_hpgps.c b/ntpd/refclock_hpgps.c
new file mode 100644
index 0000000..1d26d25
--- /dev/null
+++ b/ntpd/refclock_hpgps.c
@@ -0,0 +1,623 @@
+/*
+ * refclock_hpgps - clock driver for HP 58503A GPS receiver
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_HPGPS)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+/* Version 0.1 April 1, 1995
+ * 0.2 April 25, 1995
+ * tolerant of missing timecode response prompt and sends
+ * clear status if prompt indicates error;
+ * can use either local time or UTC from receiver;
+ * can get receiver status screen via flag4
+ *
+ * WARNING!: This driver is UNDER CONSTRUCTION
+ * Everything in here should be treated with suspicion.
+ * If it looks wrong, it probably is.
+ *
+ * Comments and/or questions to: Dave Vitanye
+ * Hewlett Packard Company
+ * dave@scd.hp.com
+ * (408) 553-2856
+ *
+ * Thanks to the author of the PST driver, which was the starting point for
+ * this one.
+ *
+ * This driver supports the HP 58503A Time and Frequency Reference Receiver.
+ * This receiver uses HP SmartClock (TM) to implement an Enhanced GPS receiver.
+ * The receiver accuracy when locked to GPS in normal operation is better
+ * than 1 usec. The accuracy when operating in holdover is typically better
+ * than 10 usec. per day.
+ *
+ * The same driver also handles the HP Z3801A which is available surplus
+ * from the cell phone industry. It's popular with hams.
+ * It needs a different line setup: 19200 baud, 7 data bits, odd parity
+ * That is selected by adding "mode 1" to the server line in ntp.conf
+ * HP Z3801A code from Jeff Mock added by Hal Murray, Sep 2005
+ *
+ *
+ * The receiver should be operated with factory default settings.
+ * Initial driver operation: expects the receiver to be already locked
+ * to GPS, configured and able to output timecode format 2 messages.
+ *
+ * The driver uses the poll sequence :PTIME:TCODE? to get a response from
+ * the receiver. The receiver responds with a timecode string of ASCII
+ * printing characters, followed by a <cr><lf>, followed by a prompt string
+ * issued by the receiver, in the following format:
+ * T#yyyymmddhhmmssMFLRVcc<cr><lf>scpi >
+ *
+ * The driver processes the response at the <cr> and <lf>, so what the
+ * driver sees is the prompt from the previous poll, followed by this
+ * timecode. The prompt from the current poll is (usually) left unread until
+ * the next poll. So (except on the very first poll) the driver sees this:
+ *
+ * scpi > T#yyyymmddhhmmssMFLRVcc<cr><lf>
+ *
+ * The T is the on-time character, at 980 msec. before the next 1PPS edge.
+ * The # is the timecode format type. We look for format 2.
+ * Without any of the CLK or PPS stuff, then, the receiver buffer timestamp
+ * at the <cr> is 24 characters later, which is about 25 msec. at 9600 bps,
+ * so the first approximation for fudge time1 is nominally -0.955 seconds.
+ * This number probably needs adjusting for each machine / OS type, so far:
+ * -0.955000 on an HP 9000 Model 712/80 HP-UX 9.05
+ * -0.953175 on an HP 9000 Model 370 HP-UX 9.10
+ *
+ * This receiver also provides a 1PPS signal, but I haven't figured out
+ * how to deal with any of the CLK or PPS stuff yet. Stay tuned.
+ *
+ */
+
+/*
+ * Fudge Factors
+ *
+ * Fudge time1 is used to accomodate the timecode serial interface adjustment.
+ * Fudge flag4 can be set to request a receiver status screen summary, which
+ * is recorded in the clockstats file.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/hpgps%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define SPEED232Z B19200 /* uart speed (19200 baud) */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define REFID "GPS\0" /* reference ID */
+#define DESCRIPTION "HP 58503A GPS Time and Frequency Reference Receiver"
+
+#define SMAX 23*80+1 /* for :SYSTEM:PRINT? status screen response */
+
+#define MTZONE 2 /* number of fields in timezone reply */
+#define MTCODET2 12 /* number of fields in timecode format T2 */
+#define NTCODET2 21 /* number of chars to checksum in format T2 */
+
+/*
+ * Tables to compute the day of year from yyyymmdd timecode.
+ * Viva la leap.
+ */
+static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+/*
+ * Unit control structure
+ */
+struct hpgpsunit {
+ int pollcnt; /* poll message counter */
+ int tzhour; /* timezone offset, hours */
+ int tzminute; /* timezone offset, minutes */
+ int linecnt; /* set for expected multiple line responses */
+ char *lastptr; /* pointer to receiver response data */
+ char statscrn[SMAX]; /* receiver status screen buffer */
+};
+
+/*
+ * Function prototypes
+ */
+static int hpgps_start (int, struct peer *);
+static void hpgps_shutdown (int, struct peer *);
+static void hpgps_receive (struct recvbuf *);
+static void hpgps_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_hpgps = {
+ hpgps_start, /* start up driver */
+ hpgps_shutdown, /* shut down driver */
+ hpgps_poll, /* transmit poll message */
+ noentry, /* not used (old hpgps_control) */
+ noentry, /* initialize driver */
+ noentry, /* not used (old hpgps_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * hpgps_start - open the devices and initialize data for processing
+ */
+static int
+hpgps_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct hpgpsunit *up;
+ struct refclockproc *pp;
+ int fd;
+ int ldisc;
+ char device[20];
+
+ /*
+ * Open serial port. Use CLK line discipline, if available.
+ * Default is HP 58503A, mode arg selects HP Z3801A
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ ldisc = LDISC_CLK;
+ /* mode parameter to server config line shares ttl slot */
+ if (1 == peer->ttl)
+ ldisc |= LDISC_7O1;
+ fd = refclock_open(device, SPEED232Z, ldisc);
+ if (fd <= 0)
+ return (0);
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = hpgps_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ up->tzhour = 0;
+ up->tzminute = 0;
+
+ *up->statscrn = '\0';
+ up->lastptr = up->statscrn;
+ up->pollcnt = 2;
+
+ /*
+ * Get the identifier string, which is logged but otherwise ignored,
+ * and get the local timezone information
+ */
+ up->linecnt = 1;
+ if (write(pp->io.fd, "*IDN?\r:PTIME:TZONE?\r", 20) != 20)
+ refclock_report(peer, CEVNT_FAULT);
+
+ return (1);
+}
+
+
+/*
+ * hpgps_shutdown - shut down the clock
+ */
+static void
+hpgps_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct hpgpsunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * hpgps_receive - receive data from the serial interface
+ */
+static void
+hpgps_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct hpgpsunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ l_fp trtmp;
+ char tcodechar1; /* identifies timecode format */
+ char tcodechar2; /* identifies timecode format */
+ char timequal; /* time figure of merit: 0-9 */
+ char freqqual; /* frequency figure of merit: 0-3 */
+ char leapchar; /* leapsecond: + or 0 or - */
+ char servchar; /* request for service: 0 = no, 1 = yes */
+ char syncchar; /* time info is invalid: 0 = no, 1 = yes */
+ short expectedsm; /* expected timecode byte checksum */
+ short tcodechksm; /* computed timecode byte checksum */
+ int i,m,n;
+ int month, day, lastday;
+ char *tcp; /* timecode pointer (skips over the prompt) */
+ char prompt[BMAX]; /* prompt in response from receiver */
+
+ /*
+ * Initialize pointers and read the receiver response
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ *pp->a_lastcode = '\0';
+ pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);
+
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: lencode: %d timecode:%s\n",
+ pp->lencode, pp->a_lastcode);
+#endif
+
+ /*
+ * If there's no characters in the reply, we can quit now
+ */
+ if (pp->lencode == 0)
+ return;
+
+ /*
+ * If linecnt is greater than zero, we are getting information only,
+ * such as the receiver identification string or the receiver status
+ * screen, so put the receiver response at the end of the status
+ * screen buffer. When we have the last line, write the buffer to
+ * the clockstats file and return without further processing.
+ *
+ * If linecnt is zero, we are expecting either the timezone
+ * or a timecode. At this point, also write the response
+ * to the clockstats file, and go on to process the prompt (if any),
+ * timezone, or timecode and timestamp.
+ */
+
+
+ if (up->linecnt-- > 0) {
+ if ((int)(pp->lencode + 2) <= (SMAX - (up->lastptr - up->statscrn))) {
+ *up->lastptr++ = '\n';
+ memcpy(up->lastptr, pp->a_lastcode, pp->lencode);
+ up->lastptr += pp->lencode;
+ }
+ if (up->linecnt == 0)
+ record_clock_stats(&peer->srcadr, up->statscrn);
+
+ return;
+ }
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ pp->lastrec = trtmp;
+
+ up->lastptr = up->statscrn;
+ *up->lastptr = '\0';
+ up->pollcnt = 2;
+
+ /*
+ * We get down to business: get a prompt if one is there, issue
+ * a clear status command if it contains an error indication.
+ * Next, check for either the timezone reply or the timecode reply
+ * and decode it. If we don't recognize the reply, or don't get the
+ * proper number of decoded fields, or get an out of range timezone,
+ * or if the timecode checksum is bad, then we declare bad format
+ * and exit.
+ *
+ * Timezone format (including nominal prompt):
+ * scpi > -H,-M<cr><lf>
+ *
+ * Timecode format (including nominal prompt):
+ * scpi > T2yyyymmddhhmmssMFLRVcc<cr><lf>
+ *
+ */
+
+ strlcpy(prompt, pp->a_lastcode, sizeof(prompt));
+ tcp = strrchr(pp->a_lastcode,'>');
+ if (tcp == NULL)
+ tcp = pp->a_lastcode;
+ else
+ tcp++;
+ prompt[tcp - pp->a_lastcode] = '\0';
+ while ((*tcp == ' ') || (*tcp == '\t')) tcp++;
+
+ /*
+ * deal with an error indication in the prompt here
+ */
+ if (strrchr(prompt,'E') > strrchr(prompt,'s')){
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: error indicated in prompt: %s\n", prompt);
+#endif
+ if (write(pp->io.fd, "*CLS\r\r", 6) != 6)
+ refclock_report(peer, CEVNT_FAULT);
+ }
+
+ /*
+ * make sure we got a timezone or timecode format and
+ * then process accordingly
+ */
+ m = sscanf(tcp,"%c%c", &tcodechar1, &tcodechar2);
+
+ if (m != 2){
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: no format indicator\n");
+#endif
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ switch (tcodechar1) {
+
+ case '+':
+ case '-':
+ m = sscanf(tcp,"%d,%d", &up->tzhour, &up->tzminute);
+ if (m != MTZONE) {
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: only %d fields recognized in timezone\n", m);
+#endif
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ if ((up->tzhour < -12) || (up->tzhour > 13) ||
+ (up->tzminute < -59) || (up->tzminute > 59)){
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: timezone %d, %d out of range\n",
+ up->tzhour, up->tzminute);
+#endif
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ return;
+
+ case 'T':
+ break;
+
+ default:
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: unrecognized reply format %c%c\n",
+ tcodechar1, tcodechar2);
+#endif
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ } /* end of tcodechar1 switch */
+
+
+ switch (tcodechar2) {
+
+ case '2':
+ m = sscanf(tcp,"%*c%*c%4d%2d%2d%2d%2d%2d%c%c%c%c%c%2hx",
+ &pp->year, &month, &day, &pp->hour, &pp->minute, &pp->second,
+ &timequal, &freqqual, &leapchar, &servchar, &syncchar,
+ &expectedsm);
+ n = NTCODET2;
+
+ if (m != MTCODET2){
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: only %d fields recognized in timecode\n", m);
+#endif
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ break;
+
+ default:
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: unrecognized timecode format %c%c\n",
+ tcodechar1, tcodechar2);
+#endif
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ } /* end of tcodechar2 format switch */
+
+ /*
+ * Compute and verify the checksum.
+ * Characters are summed starting at tcodechar1, ending at just
+ * before the expected checksum. Bail out if incorrect.
+ */
+ tcodechksm = 0;
+ while (n-- > 0) tcodechksm += *tcp++;
+ tcodechksm &= 0x00ff;
+
+ if (tcodechksm != expectedsm) {
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: checksum %2hX doesn't match %2hX expected\n",
+ tcodechksm, expectedsm);
+#endif
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Compute the day of year from the yyyymmdd format.
+ */
+ if (month < 1 || month > 12 || day < 1) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+ if ( ! isleap_4(pp->year) ) { /* Y2KFixes */
+ /* not a leap year */
+ if (day > day1tab[month - 1]) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ for (i = 0; i < month - 1; i++) day += day1tab[i];
+ lastday = 365;
+ } else {
+ /* a leap year */
+ if (day > day2tab[month - 1]) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ for (i = 0; i < month - 1; i++) day += day2tab[i];
+ lastday = 366;
+ }
+
+ /*
+ * Deal with the timezone offset here. The receiver timecode is in
+ * local time = UTC + :PTIME:TZONE, so SUBTRACT the timezone values.
+ * For example, Pacific Standard Time is -8 hours , 0 minutes.
+ * Deal with the underflows and overflows.
+ */
+ pp->minute -= up->tzminute;
+ pp->hour -= up->tzhour;
+
+ if (pp->minute < 0) {
+ pp->minute += 60;
+ pp->hour--;
+ }
+ if (pp->minute > 59) {
+ pp->minute -= 60;
+ pp->hour++;
+ }
+ if (pp->hour < 0) {
+ pp->hour += 24;
+ day--;
+ if (day < 1) {
+ pp->year--;
+ if ( isleap_4(pp->year) ) /* Y2KFixes */
+ day = 366;
+ else
+ day = 365;
+ }
+ }
+
+ if (pp->hour > 23) {
+ pp->hour -= 24;
+ day++;
+ if (day > lastday) {
+ pp->year++;
+ day = 1;
+ }
+ }
+
+ pp->day = day;
+
+ /*
+ * Decode the MFLRV indicators.
+ * NEED TO FIGURE OUT how to deal with the request for service,
+ * time quality, and frequency quality indicators some day.
+ */
+ if (syncchar != '0') {
+ pp->leap = LEAP_NOTINSYNC;
+ }
+ else {
+ pp->leap = LEAP_NOWARNING;
+ switch (leapchar) {
+
+ case '0':
+ break;
+
+ /* See http://bugs.ntp.org/1090
+ * Ignore leap announcements unless June or December.
+ * Better would be to use :GPSTime? to find the month,
+ * but that seems too likely to introduce other bugs.
+ */
+ case '+':
+ if ((month==6) || (month==12))
+ pp->leap = LEAP_ADDSECOND;
+ break;
+
+ case '-':
+ if ((month==6) || (month==12))
+ pp->leap = LEAP_DELSECOND;
+ break;
+
+ default:
+#ifdef DEBUG
+ if (debug)
+ printf("hpgps: unrecognized leap indicator: %c\n",
+ leapchar);
+#endif
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ } /* end of leapchar switch */
+ }
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * reference clock offset and dispersion. We use lastrec as both
+ * the reference time and receive time in order to avoid being
+ * cute, like setting the reference time later than the receive
+ * time, which may cause a paranoid protocol module to chuck out
+ * the data.
+ */
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+
+ /*
+ * If CLK_FLAG4 is set, ask for the status screen response.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG4){
+ up->linecnt = 22;
+ if (write(pp->io.fd, ":SYSTEM:PRINT?\r", 15) != 15)
+ refclock_report(peer, CEVNT_FAULT);
+ }
+}
+
+
+/*
+ * hpgps_poll - called by the transmit procedure
+ */
+static void
+hpgps_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct hpgpsunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * Time to poll the clock. The HP 58503A responds to a
+ * ":PTIME:TCODE?" by returning a timecode in the format specified
+ * above. If nothing is heard from the clock for two polls,
+ * declare a timeout and keep going.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->pollcnt == 0)
+ refclock_report(peer, CEVNT_TIMEOUT);
+ else
+ up->pollcnt--;
+ if (write(pp->io.fd, ":PTIME:TCODE?\r", 14) != 14) {
+ refclock_report(peer, CEVNT_FAULT);
+ }
+ else
+ pp->polls++;
+}
+
+#else
+int refclock_hpgps_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_irig.c b/ntpd/refclock_irig.c
new file mode 100644
index 0000000..46c01fb
--- /dev/null
+++ b/ntpd/refclock_irig.c
@@ -0,0 +1,1045 @@
+/*
+ * refclock_irig - audio IRIG-B/E demodulator/decoder
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_IRIG)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#include "audio.h"
+
+/*
+ * Audio IRIG-B/E demodulator/decoder
+ *
+ * This driver synchronizes the computer time using data encoded in
+ * IRIG-B/E signals commonly produced by GPS receivers and other timing
+ * devices. The IRIG signal is an amplitude-modulated carrier with
+ * pulse-width modulated data bits. For IRIG-B, the carrier frequency is
+ * 1000 Hz and bit rate 100 b/s; for IRIG-E, the carrier frequenchy is
+ * 100 Hz and bit rate 10 b/s. The driver automatically recognizes which
+ & format is in use.
+ *
+ * The driver requires an audio codec or sound card with sampling rate 8
+ * kHz and mu-law companding. This is the same standard as used by the
+ * telephone industry and is supported by most hardware and operating
+ * systems, including Solaris, SunOS, FreeBSD, NetBSD and Linux. In this
+ * implementation, only one audio driver and codec can be supported on a
+ * single machine.
+ *
+ * The program processes 8000-Hz mu-law companded samples using separate
+ * signal filters for IRIG-B and IRIG-E, a comb filter, envelope
+ * detector and automatic threshold corrector. Cycle crossings relative
+ * to the corrected slice level determine the width of each pulse and
+ * its value - zero, one or position identifier.
+ *
+ * The data encode 20 BCD digits which determine the second, minute,
+ * hour and day of the year and sometimes the year and synchronization
+ * condition. The comb filter exponentially averages the corresponding
+ * samples of successive baud intervals in order to reliably identify
+ * the reference carrier cycle. A type-II phase-lock loop (PLL) performs
+ * additional integration and interpolation to accurately determine the
+ * zero crossing of that cycle, which determines the reference
+ * timestamp. A pulse-width discriminator demodulates the data pulses,
+ * which are then encoded as the BCD digits of the timecode.
+ *
+ * The timecode and reference timestamp are updated once each second
+ * with IRIG-B (ten seconds with IRIG-E) and local clock offset samples
+ * saved for later processing. At poll intervals of 64 s, the saved
+ * samples are processed by a trimmed-mean filter and used to update the
+ * system clock.
+ *
+ * An automatic gain control feature provides protection against
+ * overdriven or underdriven input signal amplitudes. It is designed to
+ * maintain adequate demodulator signal amplitude while avoiding
+ * occasional noise spikes. In order to assure reliable capture, the
+ * decompanded input signal amplitude must be greater than 100 units and
+ * the codec sample frequency error less than 250 PPM (.025 percent).
+ *
+ * Monitor Data
+ *
+ * The timecode format used for debugging and data recording includes
+ * data helpful in diagnosing problems with the IRIG signal and codec
+ * connections. The driver produces one line for each timecode in the
+ * following format:
+ *
+ * 00 00 98 23 19:26:52 2782 143 0.694 10 0.3 66.5 3094572411.00027
+ *
+ * If clockstats is enabled, the most recent line is written to the
+ * clockstats file every 64 s. If verbose recording is enabled (fudge
+ * flag 4) each line is written as generated.
+ *
+ * The first field containes the error flags in hex, where the hex bits
+ * are interpreted as below. This is followed by the year of century,
+ * day of year and time of day. Note that the time of day is for the
+ * previous minute, not the current time. The status indicator and year
+ * are not produced by some IRIG devices and appear as zeros. Following
+ * these fields are the carrier amplitude (0-3000), codec gain (0-255),
+ * modulation index (0-1), time constant (4-10), carrier phase error
+ * +-.5) and carrier frequency error (PPM). The last field is the on-
+ * time timestamp in NTP format.
+ *
+ * The error flags are defined as follows in hex:
+ *
+ * x01 Low signal. The carrier amplitude is less than 100 units. This
+ * is usually the result of no signal or wrong input port.
+ * x02 Frequency error. The codec frequency error is greater than 250
+ * PPM. This may be due to wrong signal format or (rarely)
+ * defective codec.
+ * x04 Modulation error. The IRIG modulation index is less than 0.5.
+ * This is usually the result of an overdriven codec, wrong signal
+ * format or wrong input port.
+ * x08 Frame synch error. The decoder frame does not match the IRIG
+ * frame. This is usually the result of an overdriven codec, wrong
+ * signal format or noisy IRIG signal. It may also be the result of
+ * an IRIG signature check which indicates a failure of the IRIG
+ * signal synchronization source.
+ * x10 Data bit error. The data bit length is out of tolerance. This is
+ * usually the result of an overdriven codec, wrong signal format
+ * or noisy IRIG signal.
+ * x20 Seconds numbering discrepancy. The decoder second does not match
+ * the IRIG second. This is usually the result of an overdriven
+ * codec, wrong signal format or noisy IRIG signal.
+ * x40 Codec error (overrun). The machine is not fast enough to keep up
+ * with the codec.
+ * x80 Device status error (Spectracom).
+ *
+ *
+ * Once upon a time, an UltrSPARC 30 and Solaris 2.7 kept the clock
+ * within a few tens of microseconds relative to the IRIG-B signal.
+ * Accuracy with IRIG-E was about ten times worse. Unfortunately, Sun
+ * broke the 2.7 audio driver in 2.8, which has a 10-ms sawtooth
+ * modulation.
+ *
+ * Unlike other drivers, which can have multiple instantiations, this
+ * one supports only one. It does not seem likely that more than one
+ * audio codec would be useful in a single machine. More than one would
+ * probably chew up too much CPU time anyway.
+ *
+ * Fudge factors
+ *
+ * Fudge flag4 causes the dubugging output described above to be
+ * recorded in the clockstats file. Fudge flag2 selects the audio input
+ * port, where 0 is the mike port (default) and 1 is the line-in port.
+ * It does not seem useful to select the compact disc player port. Fudge
+ * flag3 enables audio monitoring of the input signal. For this purpose,
+ * the monitor gain is set t a default value. Fudgetime2 is used as a
+ * frequency vernier for broken codec sample frequency.
+ *
+ * Alarm codes
+ *
+ * CEVNT_BADTIME invalid date or time
+ * CEVNT_TIMEOUT no IRIG data since last poll
+ */
+/*
+ * Interface definitions
+ */
+#define DEVICE_AUDIO "/dev/audio" /* audio device name */
+#define PRECISION (-17) /* precision assumed (about 10 us) */
+#define REFID "IRIG" /* reference ID */
+#define DESCRIPTION "Generic IRIG Audio Driver" /* WRU */
+#define AUDIO_BUFSIZ 320 /* audio buffer size (40 ms) */
+#define SECOND 8000 /* nominal sample rate (Hz) */
+#define BAUD 80 /* samples per baud interval */
+#define OFFSET 128 /* companded sample offset */
+#define SIZE 256 /* decompanding table size */
+#define CYCLE 8 /* samples per bit */
+#define SUBFLD 10 /* bits per frame */
+#define FIELD 100 /* bits per second */
+#define MINTC 2 /* min PLL time constant */
+#define MAXTC 10 /* max PLL time constant max */
+#define MAXAMP 3000. /* maximum signal amplitude */
+#define MINAMP 2000. /* minimum signal amplitude */
+#define DRPOUT 100. /* dropout signal amplitude */
+#define MODMIN 0.5 /* minimum modulation index */
+#define MAXFREQ (250e-6 * SECOND) /* freq tolerance (.025%) */
+
+/*
+ * The on-time synchronization point is the positive-going zero crossing
+ * of the first cycle of the second. The IIR baseband filter phase delay
+ * is 1.03 ms for IRIG-B and 3.47 ms for IRIG-E. The fudge value 2.68 ms
+ * due to the codec and other causes was determined by calibrating to a
+ * PPS signal from a GPS receiver.
+ *
+ * The results with a 2.4-GHz P4 running FreeBSD 6.1 are generally
+ * within .02 ms short-term with .02 ms jitter. The processor load due
+ * to the driver is 0.51 percent.
+ */
+#define IRIG_B ((1.03 + 2.68) / 1000) /* IRIG-B system delay (s) */
+#define IRIG_E ((3.47 + 2.68) / 1000) /* IRIG-E system delay (s) */
+
+/*
+ * Data bit definitions
+ */
+#define BIT0 0 /* zero */
+#define BIT1 1 /* one */
+#define BITP 2 /* position identifier */
+
+/*
+ * Error flags
+ */
+#define IRIG_ERR_AMP 0x01 /* low carrier amplitude */
+#define IRIG_ERR_FREQ 0x02 /* frequency tolerance exceeded */
+#define IRIG_ERR_MOD 0x04 /* low modulation index */
+#define IRIG_ERR_SYNCH 0x08 /* frame synch error */
+#define IRIG_ERR_DECODE 0x10 /* frame decoding error */
+#define IRIG_ERR_CHECK 0x20 /* second numbering discrepancy */
+#define IRIG_ERR_ERROR 0x40 /* codec error (overrun) */
+#define IRIG_ERR_SIGERR 0x80 /* IRIG status error (Spectracom) */
+
+static char hexchar[] = "0123456789abcdef";
+
+/*
+ * IRIG unit control structure
+ */
+struct irigunit {
+ u_char timecode[2 * SUBFLD + 1]; /* timecode string */
+ l_fp timestamp; /* audio sample timestamp */
+ l_fp tick; /* audio sample increment */
+ l_fp refstamp; /* reference timestamp */
+ l_fp chrstamp; /* baud timestamp */
+ l_fp prvstamp; /* previous baud timestamp */
+ double integ[BAUD]; /* baud integrator */
+ double phase, freq; /* logical clock phase and frequency */
+ double zxing; /* phase detector integrator */
+ double yxing; /* cycle phase */
+ double exing; /* envelope phase */
+ double modndx; /* modulation index */
+ double irig_b; /* IRIG-B signal amplitude */
+ double irig_e; /* IRIG-E signal amplitude */
+ int errflg; /* error flags */
+ /*
+ * Audio codec variables
+ */
+ double comp[SIZE]; /* decompanding table */
+ double signal; /* peak signal for AGC */
+ int port; /* codec port */
+ int gain; /* codec gain */
+ int mongain; /* codec monitor gain */
+ int seccnt; /* second interval counter */
+
+ /*
+ * RF variables
+ */
+ double bpf[9]; /* IRIG-B filter shift register */
+ double lpf[5]; /* IRIG-E filter shift register */
+ double envmin, envmax; /* envelope min and max */
+ double slice; /* envelope slice level */
+ double intmin, intmax; /* integrated envelope min and max */
+ double maxsignal; /* integrated peak amplitude */
+ double noise; /* integrated noise amplitude */
+ double lastenv[CYCLE]; /* last cycle amplitudes */
+ double lastint[CYCLE]; /* last integrated cycle amplitudes */
+ double lastsig; /* last carrier sample */
+ double fdelay; /* filter delay */
+ int decim; /* sample decimation factor */
+ int envphase; /* envelope phase */
+ int envptr; /* envelope phase pointer */
+ int envsw; /* envelope state */
+ int envxing; /* envelope slice crossing */
+ int tc; /* time constant */
+ int tcount; /* time constant counter */
+ int badcnt; /* decimation interval counter */
+
+ /*
+ * Decoder variables
+ */
+ int pulse; /* cycle counter */
+ int cycles; /* carrier cycles */
+ int dcycles; /* data cycles */
+ int lastbit; /* last code element */
+ int second; /* previous second */
+ int bitcnt; /* bit count in frame */
+ int frmcnt; /* bit count in second */
+ int xptr; /* timecode pointer */
+ int bits; /* demodulated bits */
+};
+
+/*
+ * Function prototypes
+ */
+static int irig_start (int, struct peer *);
+static void irig_shutdown (int, struct peer *);
+static void irig_receive (struct recvbuf *);
+static void irig_poll (int, struct peer *);
+
+/*
+ * More function prototypes
+ */
+static void irig_base (struct peer *, double);
+static void irig_rf (struct peer *, double);
+static void irig_baud (struct peer *, int);
+static void irig_decode (struct peer *, int);
+static void irig_gain (struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_irig = {
+ irig_start, /* start up driver */
+ irig_shutdown, /* shut down driver */
+ irig_poll, /* transmit poll message */
+ noentry, /* not used (old irig_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old irig_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * irig_start - open the devices and initialize data for processing
+ */
+static int
+irig_start(
+ int unit, /* instance number (used for PCM) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ /*
+ * Local variables
+ */
+ int fd; /* file descriptor */
+ int i; /* index */
+ double step; /* codec adjustment */
+
+ /*
+ * Open audio device
+ */
+ fd = audio_init(DEVICE_AUDIO, AUDIO_BUFSIZ, unit);
+ if (fd < 0)
+ return (0);
+#ifdef DEBUG
+ if (debug)
+ audio_show();
+#endif
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = irig_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ up->tc = MINTC;
+ up->decim = 1;
+ up->gain = 127;
+
+ /*
+ * The companded samples are encoded sign-magnitude. The table
+ * contains all the 256 values in the interest of speed.
+ */
+ up->comp[0] = up->comp[OFFSET] = 0.;
+ up->comp[1] = 1; up->comp[OFFSET + 1] = -1.;
+ up->comp[2] = 3; up->comp[OFFSET + 2] = -3.;
+ step = 2.;
+ for (i = 3; i < OFFSET; i++) {
+ up->comp[i] = up->comp[i - 1] + step;
+ up->comp[OFFSET + i] = -up->comp[i];
+ if (i % 16 == 0)
+ step *= 2.;
+ }
+ DTOLFP(1. / SECOND, &up->tick);
+ return (1);
+}
+
+
+/*
+ * irig_shutdown - shut down the clock
+ */
+static void
+irig_shutdown(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * irig_receive - receive data from the audio device
+ *
+ * This routine reads input samples and adjusts the logical clock to
+ * track the irig clock by dropping or duplicating codec samples.
+ */
+static void
+irig_receive(
+ struct recvbuf *rbufp /* receive buffer structure pointer */
+ )
+{
+ struct peer *peer;
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ /*
+ * Local variables
+ */
+ double sample; /* codec sample */
+ u_char *dpt; /* buffer pointer */
+ int bufcnt; /* buffer counter */
+ l_fp ltemp; /* l_fp temp */
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Main loop - read until there ain't no more. Note codec
+ * samples are bit-inverted.
+ */
+ DTOLFP((double)rbufp->recv_length / SECOND, &ltemp);
+ L_SUB(&rbufp->recv_time, &ltemp);
+ up->timestamp = rbufp->recv_time;
+ dpt = rbufp->recv_buffer;
+ for (bufcnt = 0; bufcnt < rbufp->recv_length; bufcnt++) {
+ sample = up->comp[~*dpt++ & 0xff];
+
+ /*
+ * Variable frequency oscillator. The codec oscillator
+ * runs at the nominal rate of 8000 samples per second,
+ * or 125 us per sample. A frequency change of one unit
+ * results in either duplicating or deleting one sample
+ * per second, which results in a frequency change of
+ * 125 PPM.
+ */
+ up->phase += (up->freq + clock_codec) / SECOND;
+ up->phase += pp->fudgetime2 / 1e6;
+ if (up->phase >= .5) {
+ up->phase -= 1.;
+ } else if (up->phase < -.5) {
+ up->phase += 1.;
+ irig_rf(peer, sample);
+ irig_rf(peer, sample);
+ } else {
+ irig_rf(peer, sample);
+ }
+ L_ADD(&up->timestamp, &up->tick);
+ sample = fabs(sample);
+ if (sample > up->signal)
+ up->signal = sample;
+ up->signal += (sample - up->signal) /
+ 1000;
+
+ /*
+ * Once each second, determine the IRIG format and gain.
+ */
+ up->seccnt = (up->seccnt + 1) % SECOND;
+ if (up->seccnt == 0) {
+ if (up->irig_b > up->irig_e) {
+ up->decim = 1;
+ up->fdelay = IRIG_B;
+ } else {
+ up->decim = 10;
+ up->fdelay = IRIG_E;
+ }
+ up->irig_b = up->irig_e = 0;
+ irig_gain(peer);
+
+ }
+ }
+
+ /*
+ * Set the input port and monitor gain for the next buffer.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ up->port = 2;
+ else
+ up->port = 1;
+ if (pp->sloppyclockflag & CLK_FLAG3)
+ up->mongain = MONGAIN;
+ else
+ up->mongain = 0;
+}
+
+
+/*
+ * irig_rf - RF processing
+ *
+ * This routine filters the RF signal using a bandass filter for IRIG-B
+ * and a lowpass filter for IRIG-E. In case of IRIG-E, the samples are
+ * decimated by a factor of ten. Note that the codec filters function as
+ * roofing filters to attenuate both the high and low ends of the
+ * passband. IIR filter coefficients were determined using Matlab Signal
+ * Processing Toolkit.
+ */
+static void
+irig_rf(
+ struct peer *peer, /* peer structure pointer */
+ double sample /* current signal sample */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ /*
+ * Local variables
+ */
+ double irig_b, irig_e; /* irig filter outputs */
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * IRIG-B filter. Matlab 4th-order IIR elliptic, 800-1200 Hz
+ * bandpass, 0.3 dB passband ripple, -50 dB stopband ripple,
+ * phase delay 1.03 ms.
+ */
+ irig_b = (up->bpf[8] = up->bpf[7]) * 6.505491e-001;
+ irig_b += (up->bpf[7] = up->bpf[6]) * -3.875180e+000;
+ irig_b += (up->bpf[6] = up->bpf[5]) * 1.151180e+001;
+ irig_b += (up->bpf[5] = up->bpf[4]) * -2.141264e+001;
+ irig_b += (up->bpf[4] = up->bpf[3]) * 2.712837e+001;
+ irig_b += (up->bpf[3] = up->bpf[2]) * -2.384486e+001;
+ irig_b += (up->bpf[2] = up->bpf[1]) * 1.427663e+001;
+ irig_b += (up->bpf[1] = up->bpf[0]) * -5.352734e+000;
+ up->bpf[0] = sample - irig_b;
+ irig_b = up->bpf[0] * 4.952157e-003
+ + up->bpf[1] * -2.055878e-002
+ + up->bpf[2] * 4.401413e-002
+ + up->bpf[3] * -6.558851e-002
+ + up->bpf[4] * 7.462108e-002
+ + up->bpf[5] * -6.558851e-002
+ + up->bpf[6] * 4.401413e-002
+ + up->bpf[7] * -2.055878e-002
+ + up->bpf[8] * 4.952157e-003;
+ up->irig_b += irig_b * irig_b;
+
+ /*
+ * IRIG-E filter. Matlab 4th-order IIR elliptic, 130-Hz lowpass,
+ * 0.3 dB passband ripple, -50 dB stopband ripple, phase delay
+ * 3.47 ms.
+ */
+ irig_e = (up->lpf[4] = up->lpf[3]) * 8.694604e-001;
+ irig_e += (up->lpf[3] = up->lpf[2]) * -3.589893e+000;
+ irig_e += (up->lpf[2] = up->lpf[1]) * 5.570154e+000;
+ irig_e += (up->lpf[1] = up->lpf[0]) * -3.849667e+000;
+ up->lpf[0] = sample - irig_e;
+ irig_e = up->lpf[0] * 3.215696e-003
+ + up->lpf[1] * -1.174951e-002
+ + up->lpf[2] * 1.712074e-002
+ + up->lpf[3] * -1.174951e-002
+ + up->lpf[4] * 3.215696e-003;
+ up->irig_e += irig_e * irig_e;
+
+ /*
+ * Decimate by a factor of either 1 (IRIG-B) or 10 (IRIG-E).
+ */
+ up->badcnt = (up->badcnt + 1) % up->decim;
+ if (up->badcnt == 0) {
+ if (up->decim == 1)
+ irig_base(peer, irig_b);
+ else
+ irig_base(peer, irig_e);
+ }
+}
+
+/*
+ * irig_base - baseband processing
+ *
+ * This routine processes the baseband signal and demodulates the AM
+ * carrier using a synchronous detector. It then synchronizes to the
+ * data frame at the baud rate and decodes the width-modulated data
+ * pulses.
+ */
+static void
+irig_base(
+ struct peer *peer, /* peer structure pointer */
+ double sample /* current signal sample */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ /*
+ * Local variables
+ */
+ double lope; /* integrator output */
+ double env; /* envelope detector output */
+ double dtemp;
+ int carphase; /* carrier phase */
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Synchronous baud integrator. Corresponding samples of current
+ * and past baud intervals are integrated to refine the envelope
+ * amplitude and phase estimate. We keep one cycle (1 ms) of the
+ * raw data and one baud (10 ms) of the integrated data.
+ */
+ up->envphase = (up->envphase + 1) % BAUD;
+ up->integ[up->envphase] += (sample - up->integ[up->envphase]) /
+ (5 * up->tc);
+ lope = up->integ[up->envphase];
+ carphase = up->envphase % CYCLE;
+ up->lastenv[carphase] = sample;
+ up->lastint[carphase] = lope;
+
+ /*
+ * Phase detector. Find the negative-going zero crossing
+ * relative to sample 4 in the 8-sample sycle. A phase change of
+ * 360 degrees produces an output change of one unit.
+ */
+ if (up->lastsig > 0 && lope <= 0)
+ up->zxing += (double)(carphase - 4) / CYCLE;
+ up->lastsig = lope;
+
+ /*
+ * End of the baud. Update signal/noise estimates and PLL
+ * phase, frequency and time constant.
+ */
+ if (up->envphase == 0) {
+ up->maxsignal = up->intmax; up->noise = up->intmin;
+ up->intmin = 1e6; up->intmax = -1e6;
+ if (up->maxsignal < DRPOUT)
+ up->errflg |= IRIG_ERR_AMP;
+ if (up->maxsignal > 0)
+ up->modndx = (up->maxsignal - up->noise) /
+ up->maxsignal;
+ else
+ up->modndx = 0;
+ if (up->modndx < MODMIN)
+ up->errflg |= IRIG_ERR_MOD;
+ if (up->errflg & (IRIG_ERR_AMP | IRIG_ERR_FREQ |
+ IRIG_ERR_MOD | IRIG_ERR_SYNCH)) {
+ up->tc = MINTC;
+ up->tcount = 0;
+ }
+
+ /*
+ * Update PLL phase and frequency. The PLL time constant
+ * is set initially to stabilize the frequency within a
+ * minute or two, then increases to the maximum. The
+ * frequency is clamped so that the PLL capture range
+ * cannot be exceeded.
+ */
+ dtemp = up->zxing * up->decim / BAUD;
+ up->yxing = dtemp;
+ up->zxing = 0.;
+ up->phase += dtemp / up->tc;
+ up->freq += dtemp / (4. * up->tc * up->tc);
+ if (up->freq > MAXFREQ) {
+ up->freq = MAXFREQ;
+ up->errflg |= IRIG_ERR_FREQ;
+ } else if (up->freq < -MAXFREQ) {
+ up->freq = -MAXFREQ;
+ up->errflg |= IRIG_ERR_FREQ;
+ }
+ }
+
+ /*
+ * Synchronous demodulator. There are eight samples in the cycle
+ * and ten cycles in the baud. Since the PLL has aligned the
+ * negative-going zero crossing at sample 4, the maximum
+ * amplitude is at sample 2 and minimum at sample 6. The
+ * beginning of the data pulse is determined from the integrated
+ * samples, while the end of the pulse is determined from the
+ * raw samples. The raw data bits are demodulated relative to
+ * the slice level and left-shifted in the decoding register.
+ */
+ if (carphase != 7)
+ return;
+
+ lope = (up->lastint[2] - up->lastint[6]) / 2.;
+ if (lope > up->intmax)
+ up->intmax = lope;
+ if (lope < up->intmin)
+ up->intmin = lope;
+
+ /*
+ * Pulse code demodulator and reference timestamp. The decoder
+ * looks for a sequence of ten bits; the first two bits must be
+ * one, the last two bits must be zero. Frame synch is asserted
+ * when three correct frames have been found.
+ */
+ up->pulse = (up->pulse + 1) % 10;
+ up->cycles <<= 1;
+ if (lope >= (up->maxsignal + up->noise) / 2.)
+ up->cycles |= 1;
+ if ((up->cycles & 0x303c0f03) == 0x300c0300) {
+ if (up->pulse != 0)
+ up->errflg |= IRIG_ERR_SYNCH;
+ up->pulse = 0;
+ }
+
+ /*
+ * Assemble the baud and max/min to get the slice level for the
+ * next baud. The slice level is based on the maximum over the
+ * first two bits and the minimum over the last two bits, with
+ * the slice level halfway between the maximum and minimum.
+ */
+ env = (up->lastenv[2] - up->lastenv[6]) / 2.;
+ up->dcycles <<= 1;
+ if (env >= up->slice)
+ up->dcycles |= 1;
+ switch(up->pulse) {
+
+ case 0:
+ irig_baud(peer, up->dcycles);
+ if (env < up->envmin)
+ up->envmin = env;
+ up->slice = (up->envmax + up->envmin) / 2;
+ up->envmin = 1e6; up->envmax = -1e6;
+ break;
+
+ case 1:
+ up->envmax = env;
+ break;
+
+ case 2:
+ if (env > up->envmax)
+ up->envmax = env;
+ break;
+
+ case 9:
+ up->envmin = env;
+ break;
+ }
+}
+
+/*
+ * irig_baud - update the PLL and decode the pulse-width signal
+ */
+static void
+irig_baud(
+ struct peer *peer, /* peer structure pointer */
+ int bits /* decoded bits */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+ double dtemp;
+ l_fp ltemp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * The PLL time constant starts out small, in order to
+ * sustain a frequency tolerance of 250 PPM. It
+ * gradually increases as the loop settles down. Note
+ * that small wiggles are not believed, unless they
+ * persist for lots of samples.
+ */
+ up->exing = -up->yxing;
+ if (fabs(up->envxing - up->envphase) <= 1) {
+ up->tcount++;
+ if (up->tcount > 20 * up->tc) {
+ up->tc++;
+ if (up->tc > MAXTC)
+ up->tc = MAXTC;
+ up->tcount = 0;
+ up->envxing = up->envphase;
+ } else {
+ up->exing -= up->envxing - up->envphase;
+ }
+ } else {
+ up->tcount = 0;
+ up->envxing = up->envphase;
+ }
+
+ /*
+ * Strike the baud timestamp as the positive zero crossing of
+ * the first bit, accounting for the codec delay and filter
+ * delay.
+ */
+ up->prvstamp = up->chrstamp;
+ dtemp = up->decim * (up->exing / SECOND) + up->fdelay;
+ DTOLFP(dtemp, &ltemp);
+ up->chrstamp = up->timestamp;
+ L_SUB(&up->chrstamp, &ltemp);
+
+ /*
+ * The data bits are collected in ten-bit bauds. The first two
+ * bits are not used. The resulting patterns represent runs of
+ * 0-1 bits (0), 2-4 bits (1) and 5-7 bits (PI). The remaining
+ * 8-bit run represents a soft error and is treated as 0.
+ */
+ switch (up->dcycles & 0xff) {
+
+ case 0x00: /* 0-1 bits (0) */
+ case 0x80:
+ irig_decode(peer, BIT0);
+ break;
+
+ case 0xc0: /* 2-4 bits (1) */
+ case 0xe0:
+ case 0xf0:
+ irig_decode(peer, BIT1);
+ break;
+
+ case 0xf8: /* (5-7 bits (PI) */
+ case 0xfc:
+ case 0xfe:
+ irig_decode(peer, BITP);
+ break;
+
+ default: /* 8 bits (error) */
+ irig_decode(peer, BIT0);
+ up->errflg |= IRIG_ERR_DECODE;
+ }
+}
+
+
+/*
+ * irig_decode - decode the data
+ *
+ * This routine assembles bauds into digits, digits into frames and
+ * frames into the timecode fields. Bits can have values of zero, one
+ * or position identifier. There are four bits per digit, ten digits per
+ * frame and ten frames per second.
+ */
+static void
+irig_decode(
+ struct peer *peer, /* peer structure pointer */
+ int bit /* data bit (0, 1 or 2) */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ /*
+ * Local variables
+ */
+ int syncdig; /* sync digit (Spectracom) */
+ char sbs[6 + 1]; /* binary seconds since 0h */
+ char spare[2 + 1]; /* mulligan digits */
+ int temp;
+
+ syncdig = 0;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Assemble frame bits.
+ */
+ up->bits >>= 1;
+ if (bit == BIT1) {
+ up->bits |= 0x200;
+ } else if (bit == BITP && up->lastbit == BITP) {
+
+ /*
+ * Frame sync - two adjacent position identifiers, which
+ * mark the beginning of the second. The reference time
+ * is the beginning of the second position identifier,
+ * so copy the character timestamp to the reference
+ * timestamp.
+ */
+ if (up->frmcnt != 1)
+ up->errflg |= IRIG_ERR_SYNCH;
+ up->frmcnt = 1;
+ up->refstamp = up->prvstamp;
+ }
+ up->lastbit = bit;
+ if (up->frmcnt % SUBFLD == 0) {
+
+ /*
+ * End of frame. Encode two hexadecimal digits in
+ * little-endian timecode field. Note frame 1 is shifted
+ * right one bit to account for the marker PI.
+ */
+ temp = up->bits;
+ if (up->frmcnt == 10)
+ temp >>= 1;
+ if (up->xptr >= 2) {
+ up->timecode[--up->xptr] = hexchar[temp & 0xf];
+ up->timecode[--up->xptr] = hexchar[(temp >> 5) &
+ 0xf];
+ }
+ if (up->frmcnt == 0) {
+
+ /*
+ * End of second. Decode the timecode and wind
+ * the clock. Not all IRIG generators have the
+ * year; if so, it is nonzero after year 2000.
+ * Not all have the hardware status bit; if so,
+ * it is lit when the source is okay and dim
+ * when bad. We watch this only if the year is
+ * nonzero. Not all are configured for signature
+ * control. If so, all BCD digits are set to
+ * zero if the source is bad. In this case the
+ * refclock_process() will reject the timecode
+ * as invalid.
+ */
+ up->xptr = 2 * SUBFLD;
+ if (sscanf((char *)up->timecode,
+ "%6s%2d%1d%2s%3d%2d%2d%2d", sbs, &pp->year,
+ &syncdig, spare, &pp->day, &pp->hour,
+ &pp->minute, &pp->second) != 8)
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+ up->second = (up->second + up->decim) % 60;
+
+ /*
+ * Raise an alarm if the day field is zero,
+ * which happens when signature control is
+ * enabled and the device has lost
+ * synchronization. Raise an alarm if the year
+ * field is nonzero and the sync indicator is
+ * zero, which happens when a Spectracom radio
+ * has lost synchronization. Raise an alarm if
+ * the expected second does not agree with the
+ * decoded second, which happens with a garbled
+ * IRIG signal. We are very particular.
+ */
+ if (pp->day == 0 || (pp->year != 0 && syncdig ==
+ 0))
+ up->errflg |= IRIG_ERR_SIGERR;
+ if (pp->second != up->second)
+ up->errflg |= IRIG_ERR_CHECK;
+ up->second = pp->second;
+
+ /*
+ * Wind the clock only if there are no errors
+ * and the time constant has reached the
+ * maximum.
+ */
+ if (up->errflg == 0 && up->tc == MAXTC) {
+ pp->lastref = pp->lastrec;
+ pp->lastrec = up->refstamp;
+ if (!refclock_process(pp))
+ refclock_report(peer,
+ CEVNT_BADTIME);
+ }
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%02x %02d %03d %02d:%02d:%02d %4.0f %3d %6.3f %2d %6.2f %6.1f %s",
+ up->errflg, pp->year, pp->day,
+ pp->hour, pp->minute, pp->second,
+ up->maxsignal, up->gain, up->modndx,
+ up->tc, up->exing * 1e6 / SECOND, up->freq *
+ 1e6 / SECOND, ulfptoa(&pp->lastrec, 6));
+ pp->lencode = strlen(pp->a_lastcode);
+ up->errflg = 0;
+ if (pp->sloppyclockflag & CLK_FLAG4) {
+ record_clock_stats(&peer->srcadr,
+ pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("irig %s\n",
+ pp->a_lastcode);
+#endif /* DEBUG */
+ }
+ }
+ }
+ up->frmcnt = (up->frmcnt + 1) % FIELD;
+}
+
+
+/*
+ * irig_poll - called by the transmit procedure
+ *
+ * This routine sweeps up the timecode updates since the last poll. For
+ * IRIG-B there should be at least 60 updates; for IRIG-E there should
+ * be at least 6. If nothing is heard, a timeout event is declared.
+ */
+static void
+irig_poll(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+
+ }
+ refclock_receive(peer);
+ if (!(pp->sloppyclockflag & CLK_FLAG4)) {
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("irig %s\n", pp->a_lastcode);
+#endif /* DEBUG */
+ }
+ pp->polls++;
+
+}
+
+
+/*
+ * irig_gain - adjust codec gain
+ *
+ * This routine is called at the end of each second. It uses the AGC to
+ * bradket the maximum signal level between MINAMP and MAXAMP to avoid
+ * hunting. The routine also jiggles the input port and selectively
+ * mutes the monitor.
+ */
+static void
+irig_gain(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct irigunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Apparently, the codec uses only the high order bits of the
+ * gain control field. Thus, it may take awhile for changes to
+ * wiggle the hardware bits.
+ */
+ if (up->maxsignal < MINAMP) {
+ up->gain += 4;
+ if (up->gain > MAXGAIN)
+ up->gain = MAXGAIN;
+ } else if (up->maxsignal > MAXAMP) {
+ up->gain -= 4;
+ if (up->gain < 0)
+ up->gain = 0;
+ }
+ audio_gain(up->gain, up->mongain, up->port);
+}
+
+
+#else
+int refclock_irig_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_jjy.c b/ntpd/refclock_jjy.c
new file mode 100644
index 0000000..d8ec6b7
--- /dev/null
+++ b/ntpd/refclock_jjy.c
@@ -0,0 +1,1743 @@
+/*
+ * refclock_jjy - clock driver for JJY receivers
+ */
+
+/**********************************************************************/
+/* */
+/* Copyright (C) 2001-2011, Takao Abe. All rights reserved. */
+/* */
+/* Permission to use, copy, modify, and distribute this software */
+/* and its documentation for any purpose is hereby granted */
+/* without fee, provided that the following conditions are met: */
+/* */
+/* One retains the entire copyright notice properly, and both the */
+/* copyright notice and this license. in the documentation and/or */
+/* other materials provided with the distribution. */
+/* */
+/* This software and the name of the author must not be used to */
+/* endorse or promote products derived from this software without */
+/* prior written permission. */
+/* */
+/* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESSED OR IMPLIED */
+/* WARRANTIES OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, THE */
+/* IMPLIED WARRANTIES OF MERCHANTABLILITY AND FITNESS FOR A */
+/* PARTICULAR PURPOSE. */
+/* IN NO EVENT SHALL THE AUTHOR TAKAO ABE BE LIABLE FOR ANY DIRECT, */
+/* INDIRECT, GENERAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
+/* ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
+/* GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS */
+/* INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */
+/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ( INCLUDING */
+/* NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF */
+/* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+/* */
+/* This driver is developed in my private time, and is opened as */
+/* voluntary contributions for the NTP. */
+/* The manufacturer of the JJY receiver has not participated in */
+/* a development of this driver. */
+/* The manufacturer does not warrant anything about this driver, */
+/* and is not liable for anything about this driver. */
+/* */
+/**********************************************************************/
+/* */
+/* Author Takao Abe */
+/* Email takao_abe@xurb.jp */
+/* Homepage http://www.bea.hi-ho.ne.jp/abetakao/ */
+/* */
+/* The email address abetakao@bea.hi-ho.ne.jp is never read */
+/* from 2010, because a few filtering rule are provided by the */
+/* "hi-ho.ne.jp", and lots of spam mail are reached. */
+/* New email address for supporting the refclock_jjy is */
+/* takao_abe@xurb.jp */
+/* */
+/**********************************************************************/
+/* */
+/* History */
+/* */
+/* 2001/07/15 */
+/* [New] Support the Tristate Ltd. JJY receiver */
+/* */
+/* 2001/08/04 */
+/* [Change] Log to clockstats even if bad reply */
+/* [Fix] PRECISION = (-3) (about 100 ms) */
+/* [Add] Support the C-DEX Co.Ltd. JJY receiver */
+/* */
+/* 2001/12/04 */
+/* [Fix] C-DEX JST2000 ( fukusima@goto.info.waseda.ac.jp ) */
+/* */
+/* 2002/07/12 */
+/* [Fix] Portability for FreeBSD ( patched by the user ) */
+/* */
+/* 2004/10/31 */
+/* [Change] Command send timing for the Tristate Ltd. JJY receiver */
+/* JJY-01 ( Firmware version 2.01 ) */
+/* Thanks to Andy Taki for testing under FreeBSD */
+/* */
+/* 2004/11/28 */
+/* [Add] Support the Echo Keisokuki LT-2000 receiver */
+/* */
+/* 2006/11/04 */
+/* [Fix] C-DEX JST2000 */
+/* Thanks to Hideo Kuramatsu for the patch */
+/* */
+/* 2009/04/05 */
+/* [Add] Support the CITIZEN T.I.C JJY-200 receiver */
+/* */
+/* 2010/11/20 */
+/* [Change] Bug 1618 ( Harmless ) */
+/* Code clean up ( Remove unreachable codes ) in */
+/* jjy_start() */
+/* [Change] Change clockstats format of the Tristate JJY01/02 */
+/* Issues more command to get the status of the receiver */
+/* when "fudge 127.127.40.X flag1 1" is specified */
+/* ( DATE,STIM -> DCST,STUS,DATE,STIM ) */
+/* */
+/* 2011/04/30 */
+/* [Add] Support the Tristate Ltd. TS-GPSclock-01 */
+/* */
+/**********************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_JJY)
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <sys/time.h>
+#include <time.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_tty.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+/**********************************************************************/
+/* */
+/* The Tristate Ltd. JJY receiver JJY01 */
+/* */
+/* Command Response Remarks */
+/* ------------ ---------------------- --------------------- */
+/* dcst<CR><LF> VALID|INVALID<CR><LF> */
+/* stus<CR><LF> ADJUSTED|UNADJUSTED<CR><LF> */
+/* date<CR><LF> YYYY/MM/DD XXX<CR><LF> */
+/* time<CR><LF> HH:MM:SS<CR><LF> Not used by this driver */
+/* stim<CR><LF> HH:MM:SS<CR><LF> Reply at just second */
+/* */
+/* During synchronization after a receiver is turned on, */
+/* It replies the past time from 2000/01/01 00:00:00. */
+/* The function "refclock_process" checks the time and tells */
+/* as an insanity time. */
+/* */
+/**********************************************************************/
+/* */
+/* The C-DEX Co. Ltd. JJY receiver JST2000 */
+/* */
+/* Command Response Remarks */
+/* ------------ ---------------------- --------------------- */
+/* <ENQ>1J<ETX> <STX>JYYMMDD HHMMSSS<ETX> */
+/* */
+/**********************************************************************/
+/* */
+/* The Echo Keisokuki Co. Ltd. JJY receiver LT2000 */
+/* */
+/* Command Response Remarks */
+/* ------------ ---------------------- --------------------- */
+/* # Mode 1 (Request&Send) */
+/* T YYMMDDWHHMMSS<BCC1><BCC2><CR> */
+/* C Mode 2 (Continuous) */
+/* YYMMDDWHHMMSS<ST1><ST2><ST3><ST4><CR> */
+/* <SUB> Second signal */
+/* */
+/**********************************************************************/
+/* */
+/* The CITIZEN T.I.C CO., LTD. JJY receiver JJY200 */
+/* */
+/* Command Response Remarks */
+/* ------------ ---------------------- --------------------- */
+/* 'XX YY/MM/DD W HH:MM:SS<CR> */
+/* XX: OK|NG|ER */
+/* W: 0(Monday)-6(Sunday) */
+/* */
+/**********************************************************************/
+/* */
+/* The Tristate Ltd. GPS clock TS-GPSCLOCK-01 */
+/* */
+/* This clock has NMEA mode and command/respose mode. */
+/* When this jjy driver are used, set to command/respose mode */
+/* of this clock by the onboard switch SW4, and make sure the */
+/* LED-Y is tured on. */
+/* Other than this JJY driver, the refclock driver type 20, */
+/* generic NMEA driver, works with the NMEA mode of this clock. */
+/* */
+/* Command Response Remarks */
+/* ------------ ---------------------- --------------------- */
+/* stus<CR><LF> *R|*G|*U|+U<CR><LF> */
+/* date<CR><LF> YY/MM/DD<CR><LF> */
+/* time<CR><LF> HH:MM:SS<CR><LF> */
+/* */
+/**********************************************************************/
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/jjy%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define SPEED232_TRISTATE_JJY01 B9600 /* UART speed (9600 baud) */
+#define SPEED232_CDEX_JST2000 B9600 /* UART speed (9600 baud) */
+#define SPEED232_ECHOKEISOKUKI_LT2000 B9600 /* UART speed (9600 baud) */
+#define SPEED232_CITIZENTIC_JJY200 B4800 /* UART speed (4800 baud) */
+#define SPEED232_TRISTATE_GPSCLOCK01 B38400 /* USB speed (38400 baud) */
+#define REFID "JJY" /* reference ID */
+#define DESCRIPTION "JJY Receiver"
+#define PRECISION (-3) /* precision assumed (about 100 ms) */
+
+/*
+ * JJY unit control structure
+ */
+struct jjyunit {
+ char unittype ; /* UNITTYPE_XXXXXXXXXX */
+ short operationmode ; /* Echo Keisokuki LT-2000 : 1 or 2 */
+ short version ;
+ short linediscipline ; /* LDISC_CLK or LDISC_RAW */
+ char bPollFlag ; /* Set by jjy_pool and Reset by jjy_receive */
+ int linecount ;
+ int lineerror ;
+ int year, month, day, hour, minute, second, msecond ;
+/* LDISC_RAW only */
+#define MAX_LINECOUNT 8
+#define MAX_RAWBUF 64
+ int lineexpect ;
+ int charexpect [ MAX_LINECOUNT ] ;
+ int charcount ;
+ char rawbuf [ MAX_RAWBUF ] ;
+};
+
+#define UNITTYPE_TRISTATE_JJY01 1
+#define UNITTYPE_CDEX_JST2000 2
+#define UNITTYPE_ECHOKEISOKUKI_LT2000 3
+#define UNITTYPE_CITIZENTIC_JJY200 4
+#define UNITTYPE_TRISTATE_GPSCLOCK01 5
+
+/*
+ * Function prototypes
+ */
+
+static int jjy_start (int, struct peer *);
+static void jjy_shutdown (int, struct peer *);
+
+static void jjy_poll (int, struct peer *);
+static void jjy_poll_tristate_jjy01 (int, struct peer *);
+static void jjy_poll_cdex_jst2000 (int, struct peer *);
+static void jjy_poll_echokeisokuki_lt2000 (int, struct peer *);
+static void jjy_poll_citizentic_jjy200 (int, struct peer *);
+static void jjy_poll_tristate_gpsclock01 (int, struct peer *);
+
+static void jjy_receive (struct recvbuf *);
+static int jjy_receive_tristate_jjy01 (struct recvbuf *);
+static int jjy_receive_cdex_jst2000 (struct recvbuf *);
+static int jjy_receive_echokeisokuki_lt2000 (struct recvbuf *);
+static int jjy_receive_citizentic_jjy200 (struct recvbuf *);
+static int jjy_receive_tristate_gpsclock01 (struct recvbuf *);
+
+static void printableString ( char*, int, char*, int ) ;
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_jjy = {
+ jjy_start, /* start up driver */
+ jjy_shutdown, /* shutdown driver */
+ jjy_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* not used */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+/*
+ * Start up driver return code
+ */
+#define RC_START_SUCCESS 1
+#define RC_START_ERROR 0
+
+/*
+ * Local constants definition
+ */
+
+#define MAX_LOGTEXT 64
+
+/*
+ * Tristate JJY01/JJY02 constants definition
+ */
+
+#define TS_JJY01_COMMAND_NUMBER_DATE 1
+#define TS_JJY01_COMMAND_NUMBER_TIME 2
+#define TS_JJY01_COMMAND_NUMBER_STIM 3
+#define TS_JJY01_COMMAND_NUMBER_STUS 4
+#define TS_JJY01_COMMAND_NUMBER_DCST 5
+
+#define TS_JJY01_REPLY_DATE "yyyy/mm/dd www\r\n"
+#define TS_JJY01_REPLY_STIM "hh:mm:ss\r\n"
+#define TS_JJY01_REPLY_STUS_YES "adjusted\r\n"
+#define TS_JJY01_REPLY_STUS_NO "unadjusted\r\n"
+#define TS_JJY01_REPLY_DCST_VALID "valid\r\n"
+#define TS_JJY01_REPLY_DCST_INVALID "invalid\r\n"
+
+#define TS_JJY01_REPLY_LENGTH_DATE 14 /* Length without <CR><LF> */
+#define TS_JJY01_REPLY_LENGTH_STIM 8 /* Length without <CR><LF> */
+#define TS_JJY01_REPLY_LENGTH_STUS_YES 8 /* Length without <CR><LF> */
+#define TS_JJY01_REPLY_LENGTH_STUS_NO 10 /* Length without <CR><LF> */
+#define TS_JJY01_REPLY_LENGTH_DCST_VALID 5 /* Length without <CR><LF> */
+#define TS_JJY01_REPLY_LENGTH_DCST_INVALID 7 /* Length without <CR><LF> */
+
+static struct
+{
+ char commandNumber ;
+ char *commandLog ;
+ char *command ;
+ int commandLength ;
+} tristate_jjy01_command_sequence[] =
+{
+ /* dcst<CR><LF> -> VALID<CR><LF> or INVALID<CR><LF> */
+ { TS_JJY01_COMMAND_NUMBER_DCST, "dcst", "dcst\r\n", 6 },
+ /* stus<CR><LF> -> ADJUSTED<CR><LF> or UNADJUSTED<CR><LF> */
+ { TS_JJY01_COMMAND_NUMBER_STUS, "stus", "stus\r\n", 6 },
+ /* date<CR><LF> -> YYYY/MM/DD WWW<CR><LF> */
+ { TS_JJY01_COMMAND_NUMBER_DATE, "date", "date\r\n", 6 },
+ /* stim<CR><LF> -> HH:MM:SS<CR><LF> */
+ { TS_JJY01_COMMAND_NUMBER_STIM, "stim", "stim\r\n", 6 },
+ /* End of command */
+ { 0, NULL, NULL, 0 }
+} ;
+
+/*
+ * Tristate TS-GPSCLOCK01 constants definition
+ */
+
+#define TS_GPSCLOCK01_COMMAND_NUMBER_DATE 1
+#define TS_GPSCLOCK01_COMMAND_NUMBER_TIME 2
+#define TS_GPSCLOCK01_COMMAND_NUMBER_STUS 4
+
+#define TS_GPSCLOCK01_REPLY_DATE "yyyy/mm/dd\r\n"
+#define TS_GPSCLOCK01_REPLY_TIME "hh:mm:ss\r\n"
+#define TS_GPSCLOCK01_REPLY_STUS_RTC "*R\r\n"
+#define TS_GPSCLOCK01_REPLY_STUS_GPS "*G\r\n"
+#define TS_GPSCLOCK01_REPLY_STUS_UTC "*U\r\n"
+#define TS_GPSCLOCK01_REPLY_STUS_PPS "+U\r\n"
+
+#define TS_GPSCLOCK01_REPLY_LENGTH_DATE 10 /* Length without <CR><LF> */
+#define TS_GPSCLOCK01_REPLY_LENGTH_TIME 8 /* Length without <CR><LF> */
+#define TS_GPSCLOCK01_REPLY_LENGTH_STUS 2 /* Length without <CR><LF> */
+
+static struct
+{
+ char commandNumber ;
+ char *commandLog ;
+ char *command ;
+ int commandLength ;
+} tristate_gpsclock01_command_sequence[] =
+{
+ /* stus<CR><LF> -> *R<CR><LF> or *G<CR><LF> or *U<CR><LF> or +U<CR><LF> */
+ { TS_GPSCLOCK01_COMMAND_NUMBER_STUS, "stus", "stus\r\n", 6 },
+ /* date<CR><LF> -> YYYY/MM/DD WWW<CR><LF> */
+ { TS_GPSCLOCK01_COMMAND_NUMBER_DATE, "date", "date\r\n", 6 },
+ /* time<CR><LF> -> HH:MM:SS<CR><LF> */
+ { TS_GPSCLOCK01_COMMAND_NUMBER_TIME, "time", "time\r\n", 6 },
+ /* End of command */
+ { 0, NULL, NULL, 0 }
+} ;
+
+/**************************************************************************************************/
+/* jjy_start - open the devices and initialize data for processing */
+/**************************************************************************************************/
+static int
+jjy_start ( int unit, struct peer *peer )
+{
+
+ struct jjyunit *up ;
+ struct refclockproc *pp ;
+ int fd ;
+ char *pDeviceName ;
+ short iDiscipline ;
+ int iSpeed232 ;
+
+ char sLogText [ MAX_LOGTEXT ] , sDevText [ MAX_LOGTEXT ] ;
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "jjy_start (refclock_jjy.c) : %s mode=%d ", ntoa(&peer->srcadr), peer->ttl ) ;
+ printf ( DEVICE, unit ) ;
+ printf ( "\n" ) ;
+ }
+#endif
+ snprintf ( sDevText, sizeof(sDevText), DEVICE, unit ) ;
+ snprintf ( sLogText, sizeof(sLogText), "*Initialze* %s mode=%d", sDevText, peer->ttl ) ;
+ record_clock_stats ( &peer->srcadr, sLogText ) ;
+
+ /*
+ * Open serial port
+ */
+ pDeviceName = emalloc ( strlen(DEVICE) + 10 );
+ snprintf ( pDeviceName, strlen(DEVICE) + 10, DEVICE, unit ) ;
+
+ /*
+ * peer->ttl is a mode number specified by "127.127.40.X mode N" in the ntp.conf
+ */
+ switch ( peer->ttl ) {
+ case 0 :
+ case 1 :
+ iDiscipline = LDISC_CLK ;
+ iSpeed232 = SPEED232_TRISTATE_JJY01 ;
+ break ;
+ case 2 :
+ iDiscipline = LDISC_RAW ;
+ iSpeed232 = SPEED232_CDEX_JST2000 ;
+ break ;
+ case 3 :
+ iDiscipline = LDISC_CLK ;
+ iSpeed232 = SPEED232_ECHOKEISOKUKI_LT2000 ;
+ break ;
+ case 4 :
+ iDiscipline = LDISC_CLK ;
+ iSpeed232 = SPEED232_CITIZENTIC_JJY200 ;
+ break ;
+ case 5 :
+ iDiscipline = LDISC_CLK ;
+ iSpeed232 = SPEED232_TRISTATE_GPSCLOCK01 ;
+ break ;
+ default :
+ msyslog ( LOG_ERR, "JJY receiver [ %s mode %d ] : Unsupported mode",
+ ntoa(&peer->srcadr), peer->ttl ) ;
+ free ( (void*) pDeviceName ) ;
+ return RC_START_ERROR ;
+ }
+
+ fd = refclock_open ( pDeviceName, iSpeed232, iDiscipline ) ;
+ if ( fd <= 0 ) {
+ free ( (void*) pDeviceName ) ;
+ return RC_START_ERROR ;
+ }
+ free ( (void*) pDeviceName ) ;
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc (sizeof(*up));
+ memset ( up, 0, sizeof(*up) ) ;
+ up->linediscipline = iDiscipline ;
+
+ /*
+ * peer->ttl is a mode number specified by "127.127.40.X mode N" in the ntp.conf
+ */
+ switch ( peer->ttl ) {
+ case 0 :
+ /*
+ * The mode 0 is a default clock type at this time.
+ * But this will be change to auto-detect mode in the future.
+ */
+ case 1 :
+ up->unittype = UNITTYPE_TRISTATE_JJY01 ;
+ up->version = 100 ;
+ /* 2010/11/20 */
+ /* Command sequence is defined by the struct tristate_jjy01_command_sequence, */
+ /* and the following 3 lines are not used in the mode LDISC_CLK. */
+ /* up->lineexpect = 2 ; */
+ /* up->charexpect[0] = 14 ; */ /* YYYY/MM/DD WWW<CR><LF> */
+ /* up->charexpect[1] = 8 ; */ /* HH:MM:SS<CR><LF> */
+ break ;
+ case 2 :
+ up->unittype = UNITTYPE_CDEX_JST2000 ;
+ up->lineexpect = 1 ;
+ up->charexpect[0] = 15 ; /* <STX>JYYMMDD HHMMSSS<ETX> */
+ break ;
+ case 3 :
+ up->unittype = UNITTYPE_ECHOKEISOKUKI_LT2000 ;
+ up->operationmode = 2 ; /* Mode 2 : Continuous mode */
+ up->lineexpect = 1 ;
+ switch ( up->operationmode ) {
+ case 1 :
+ up->charexpect[0] = 15 ; /* YYMMDDWHHMMSS<BCC1><BCC2><CR> */
+ break ;
+ case 2 :
+ up->charexpect[0] = 17 ; /* YYMMDDWHHMMSS<ST1><ST2><ST3><ST4><CR> */
+ break ;
+ }
+ break ;
+ case 4 :
+ up->unittype = UNITTYPE_CITIZENTIC_JJY200 ;
+ up->lineexpect = 1 ;
+ up->charexpect[0] = 23 ; /* 'XX YY/MM/DD W HH:MM:SS<CR> */
+ break ;
+ case 5 :
+ up->unittype = UNITTYPE_TRISTATE_GPSCLOCK01 ;
+ break ;
+
+ /* 2010/11/20 */
+ /* The "default:" section of this switch block is never executed, */
+ /* because the former switch block traps the same "default:" case. */
+ /* This "default:" section codes are removed to avoid spending time */
+ /* in the future looking, though the codes are functionally harmless. */
+
+ }
+
+ pp = peer->procptr ;
+ pp->unitptr = up ;
+ pp->io.clock_recv = jjy_receive ;
+ pp->io.srcclock = peer ;
+ pp->io.datalen = 0 ;
+ pp->io.fd = fd ;
+ if ( ! io_addclock(&pp->io) ) {
+ close ( fd ) ;
+ pp->io.fd = -1 ;
+ free ( up ) ;
+ pp->unitptr = NULL ;
+ return RC_START_ERROR ;
+ }
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION ;
+ pp->clockdesc = DESCRIPTION ;
+ memcpy ( (char*)&pp->refid, REFID, strlen(REFID) ) ;
+
+ return RC_START_SUCCESS ;
+
+}
+
+
+/**************************************************************************************************/
+/* jjy_shutdown - shutdown the clock */
+/**************************************************************************************************/
+static void
+jjy_shutdown ( int unit, struct peer *peer )
+{
+
+ struct jjyunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr ;
+ up = pp->unitptr ;
+ if ( -1 != pp->io.fd )
+ io_closeclock ( &pp->io ) ;
+ if ( NULL != up )
+ free ( up ) ;
+
+}
+
+
+/**************************************************************************************************/
+/* jjy_receive - receive data from the serial interface */
+/**************************************************************************************************/
+static void
+jjy_receive ( struct recvbuf *rbufp )
+{
+
+ struct jjyunit *up ;
+ struct refclockproc *pp ;
+ struct peer *peer;
+
+ l_fp tRecvTimestamp; /* arrival timestamp */
+ int rc ;
+ char sLogText [ MAX_LOGTEXT ] ;
+ int i, bCntrlChar ;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer ;
+ pp = peer->procptr ;
+ up = pp->unitptr ;
+
+ /*
+ * Get next input line
+ */
+ pp->lencode = refclock_gtlin ( rbufp, pp->a_lastcode, BMAX, &tRecvTimestamp ) ;
+
+ if ( up->linediscipline == LDISC_RAW ) {
+ /*
+ * The reply with <STX> and <ETX> may give a blank line
+ */
+ if ( pp->lencode == 0 && up->charcount == 0 ) return ;
+ /*
+ * Copy received charaters to temporary buffer
+ */
+ for ( i = 0 ;
+ i < pp->lencode && up->charcount < MAX_RAWBUF - 2 ;
+ i ++ , up->charcount ++ ) {
+ up->rawbuf[up->charcount] = pp->a_lastcode[i] ;
+ }
+ while ( up->charcount > 0 && up->rawbuf[0] < ' ' ) {
+ for ( i = 0 ; i < up->charcount - 1 ; i ++ )
+ up->rawbuf[i] = up->rawbuf[i+1] ;
+ up->charcount -- ;
+ }
+ bCntrlChar = 0 ;
+ for ( i = 0 ; i < up->charcount ; i ++ ) {
+ if ( up->rawbuf[i] < ' ' ) {
+ bCntrlChar = 1 ;
+ break ;
+ }
+ }
+ if ( pp->lencode > 0 && up->linecount < up->lineexpect ) {
+ if ( bCntrlChar == 0 &&
+ up->charcount < up->charexpect[up->linecount] )
+ return ;
+ }
+ up->rawbuf[up->charcount] = 0 ;
+ } else {
+ /*
+ * The reply with <CR><LF> gives a blank line
+ */
+ if ( pp->lencode == 0 ) return ;
+ }
+ /*
+ * We get down to business
+ */
+
+#ifdef DEBUG
+ if ( debug ) {
+ if ( up->linediscipline == LDISC_RAW ) {
+ printableString( sLogText, MAX_LOGTEXT, up->rawbuf, up->charcount ) ;
+ } else {
+ printableString( sLogText, MAX_LOGTEXT, pp->a_lastcode, pp->lencode ) ;
+ }
+ printf ( "jjy_receive (refclock_jjy.c) : [%s]\n", sLogText ) ;
+ }
+#endif
+
+ pp->lastrec = tRecvTimestamp ;
+
+ up->linecount ++ ;
+
+ if ( up->lineerror != 0 ) return ;
+
+ switch ( up->unittype ) {
+
+ case UNITTYPE_TRISTATE_JJY01 :
+ rc = jjy_receive_tristate_jjy01 ( rbufp ) ;
+ break ;
+
+ case UNITTYPE_CDEX_JST2000 :
+ rc = jjy_receive_cdex_jst2000 ( rbufp ) ;
+ break ;
+
+ case UNITTYPE_ECHOKEISOKUKI_LT2000 :
+ rc = jjy_receive_echokeisokuki_lt2000 ( rbufp ) ;
+ break ;
+
+ case UNITTYPE_CITIZENTIC_JJY200 :
+ rc = jjy_receive_citizentic_jjy200 ( rbufp ) ;
+ break ;
+
+ case UNITTYPE_TRISTATE_GPSCLOCK01 :
+ rc = jjy_receive_tristate_gpsclock01 ( rbufp ) ;
+ break ;
+
+ default :
+ rc = 0 ;
+ break ;
+
+ }
+
+ if ( up->linediscipline == LDISC_RAW ) {
+ if ( up->linecount <= up->lineexpect &&
+ up->charcount > up->charexpect[up->linecount-1] ) {
+ for ( i = 0 ;
+ i < up->charcount - up->charexpect[up->linecount-1] ;
+ i ++ ) {
+ up->rawbuf[i] = up->rawbuf[i+up->charexpect[up->linecount-1]] ;
+ }
+ up->charcount -= up->charexpect[up->linecount-1] ;
+ } else {
+ up->charcount = 0 ;
+ }
+ }
+
+ if ( rc == 0 ) {
+ return ;
+ }
+
+ up->bPollFlag = 0 ;
+
+ if ( up->lineerror != 0 ) {
+ refclock_report ( peer, CEVNT_BADREPLY ) ;
+ strlcpy ( sLogText, "BAD REPLY [",
+ sizeof( sLogText ) ) ;
+ if ( up->linediscipline == LDISC_RAW ) {
+ strlcat ( sLogText, up->rawbuf,
+ sizeof( sLogText ) ) ;
+ } else {
+ strlcat ( sLogText, pp->a_lastcode,
+ sizeof( sLogText ) ) ;
+ }
+ sLogText[MAX_LOGTEXT-1] = 0 ;
+ if ( strlen ( sLogText ) < MAX_LOGTEXT - 2 )
+ strlcat ( sLogText, "]",
+ sizeof( sLogText ) ) ;
+ record_clock_stats ( &peer->srcadr, sLogText ) ;
+ return ;
+ }
+
+ pp->year = up->year ;
+ pp->day = ymd2yd ( up->year, up->month, up->day ) ;
+ pp->hour = up->hour ;
+ pp->minute = up->minute ;
+ pp->second = up->second ;
+ pp->nsec = up->msecond * 1000000;
+
+ /*
+ * JST to UTC
+ */
+ pp->hour -= 9 ;
+ if ( pp->hour < 0 ) {
+ pp->hour += 24 ;
+ pp->day -- ;
+ if ( pp->day < 1 ) {
+ pp->year -- ;
+ pp->day = ymd2yd ( pp->year, 12, 31 ) ;
+ }
+ }
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "jjy_receive (refclock_jjy.c) : %04d/%02d/%02d %02d:%02d:%02d.%1d JST ",
+ up->year, up->month, up->day, up->hour,
+ up->minute, up->second, up->msecond/100 ) ;
+ printf ( "( %04d/%03d %02d:%02d:%02d.%1d UTC )\n",
+ pp->year, pp->day, pp->hour, pp->minute,
+ pp->second, (int)(pp->nsec/100000000) ) ;
+ }
+#endif
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+
+ snprintf ( sLogText, sizeof(sLogText),
+ "%04d/%02d/%02d %02d:%02d:%02d.%1d JST",
+ up->year, up->month, up->day,
+ up->hour, up->minute, up->second, up->msecond/100 ) ;
+ record_clock_stats ( &peer->srcadr, sLogText ) ;
+
+ if ( ! refclock_process ( pp ) ) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return ;
+ }
+
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+
+}
+
+/**************************************************************************************************/
+
+static int
+jjy_receive_tristate_jjy01 ( struct recvbuf *rbufp )
+{
+#ifdef DEBUG
+ static char *sFunctionName = "jjy_receive_tristate_jjy01" ;
+#endif
+
+ struct jjyunit *up ;
+ struct refclockproc *pp ;
+ struct peer *peer;
+
+ char *pBuf ;
+ int iLen ;
+ int rc ;
+
+ int bOverMidnight = 0 ;
+
+ char sLogText [ MAX_LOGTEXT ], sReplyText [ MAX_LOGTEXT ] ;
+
+ char *pCmd ;
+ int iCmdLen ;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer ;
+ pp = peer->procptr ;
+ up = pp->unitptr ;
+
+ if ( up->linediscipline == LDISC_RAW ) {
+ pBuf = up->rawbuf ;
+ iLen = up->charcount ;
+ } else {
+ pBuf = pp->a_lastcode ;
+ iLen = pp->lencode ;
+ }
+
+ switch ( tristate_jjy01_command_sequence[up->linecount-1].commandNumber ) {
+
+ case TS_JJY01_COMMAND_NUMBER_DATE : /* YYYY/MM/DD WWW */
+
+ if ( iLen != TS_JJY01_REPLY_LENGTH_DATE ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ rc = sscanf ( pBuf, "%4d/%2d/%2d", &up->year,
+ &up->month, &up->day ) ;
+ if ( rc != 3 || up->year < 2000 || up->month < 1 ||
+ up->month > 12 || up->day < 1 || up->day > 31 ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ /*** Start of modification on 2004/10/31 ***/
+ /*
+ * Following codes are moved from the function jjy_poll_tristate_jjy01 in this source.
+ * The Tristate JJY-01 ( Firmware version 1.01 ) accepts "time" and "stim" commands without any delay.
+ * But the JJY-01 ( Firmware version 2.01 ) does not accept these commands continuously,
+ * so this driver issues the second command "stim" after the reply of the first command "date".
+ */
+
+ /*** 2010/11/20 ***/
+ /*
+ * Codes of a next command issue are moved to the end of this function.
+ */
+
+ /*** End of modification ***/
+
+ break ;
+
+ case TS_JJY01_COMMAND_NUMBER_TIME : /* HH:MM:SS */
+ case TS_JJY01_COMMAND_NUMBER_STIM : /* HH:MM:SS */
+
+ if ( iLen != TS_JJY01_REPLY_LENGTH_STIM ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ rc = sscanf ( pBuf, "%2d:%2d:%2d", &up->hour,
+ &up->minute, &up->second ) ;
+ if ( rc != 3 || up->hour > 23 || up->minute > 59 ||
+ up->second > 60 ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ up->msecond = 0 ;
+ if ( up->hour == 0 && up->minute == 0 && up->second <= 2 ) {
+ /*
+ * The command "date" and "time" ( or "stim" ) were sent to the JJY receiver separately,
+ * and the JJY receiver replies a date and time separately.
+ * Just after midnight transitions, we ignore this time.
+ */
+ bOverMidnight = 1 ;
+ }
+ break ;
+
+ case TS_JJY01_COMMAND_NUMBER_STUS :
+
+ if ( ( iLen == TS_JJY01_REPLY_LENGTH_STUS_YES
+ && strncmp( pBuf, TS_JJY01_REPLY_STUS_YES,
+ TS_JJY01_REPLY_LENGTH_STUS_YES ) == 0 )
+ || ( iLen == TS_JJY01_REPLY_LENGTH_STUS_NO
+ && strncmp( pBuf, TS_JJY01_REPLY_STUS_NO,
+ TS_JJY01_REPLY_LENGTH_STUS_NO ) == 0 ) ) {
+ /* Good */
+ } else {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ break ;
+
+ case TS_JJY01_COMMAND_NUMBER_DCST :
+
+ if ( ( iLen == TS_JJY01_REPLY_LENGTH_DCST_VALID
+ && strncmp( pBuf, TS_JJY01_REPLY_DCST_VALID,
+ TS_JJY01_REPLY_LENGTH_DCST_VALID ) == 0 )
+ || ( iLen == TS_JJY01_REPLY_LENGTH_DCST_INVALID
+ && strncmp( pBuf, TS_JJY01_REPLY_DCST_INVALID,
+ TS_JJY01_REPLY_LENGTH_DCST_INVALID ) == 0 ) ) {
+ /* Good */
+ } else {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ break ;
+
+ default : /* Unexpected reply */
+
+ up->lineerror = 1 ;
+ break ;
+
+ }
+
+ /* Clockstats Log */
+
+ printableString( sReplyText, sizeof(sReplyText), pBuf, iLen ) ;
+ snprintf ( sLogText, sizeof(sLogText), "%d: %s -> %c: %s",
+ up->linecount,
+ tristate_jjy01_command_sequence[up->linecount-1].commandLog,
+ ( up->lineerror == 0 )
+ ? ( ( bOverMidnight == 0 )
+ ? 'O'
+ : 'S' )
+ : 'X',
+ sReplyText ) ;
+ record_clock_stats ( &peer->srcadr, sLogText ) ;
+
+ /* Check before issue next command */
+
+ if ( up->lineerror != 0 ) {
+ /* Do not issue next command */
+ return 0 ;
+ }
+
+ if ( bOverMidnight != 0 ) {
+ /* Do not issue next command */
+ return 0 ;
+ }
+
+ if ( tristate_jjy01_command_sequence[up->linecount].command == NULL ) {
+ /* Command sequence completed */
+ return 1 ;
+ }
+
+ /* Issue next command */
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : send '%s'\n",
+ sFunctionName, tristate_jjy01_command_sequence[up->linecount].commandLog ) ;
+ }
+#endif
+
+ pCmd = tristate_jjy01_command_sequence[up->linecount].command ;
+ iCmdLen = tristate_jjy01_command_sequence[up->linecount].commandLength ;
+ if ( write ( pp->io.fd, pCmd, iCmdLen ) != iCmdLen ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+ return 0 ;
+
+}
+
+/**************************************************************************************************/
+
+static int
+jjy_receive_cdex_jst2000 ( struct recvbuf *rbufp )
+{
+#ifdef DEBUG
+ static char *sFunctionName = "jjy_receive_cdex_jst2000" ;
+#endif
+
+ struct jjyunit *up ;
+ struct refclockproc *pp ;
+ struct peer *peer;
+
+ char *pBuf ;
+ int iLen ;
+ int rc ;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer ;
+ pp = peer->procptr ;
+ up = pp->unitptr ;
+
+ if ( up->linediscipline == LDISC_RAW ) {
+ pBuf = up->rawbuf ;
+ iLen = up->charcount ;
+ } else {
+ pBuf = pp->a_lastcode ;
+ iLen = pp->lencode ;
+ }
+
+ switch ( up->linecount ) {
+
+ case 1 : /* JYYMMDD HHMMSSS */
+
+ if ( iLen != 15 ) {
+#ifdef DEBUG
+ if ( debug >= 2 ) {
+ printf ( "%s (refclock_jjy.c) : Reply length error ( iLen=%d )\n",
+ sFunctionName, iLen ) ;
+ }
+#endif
+ up->lineerror = 1 ;
+ break ;
+ }
+ rc = sscanf ( pBuf, "J%2d%2d%2d%*1d%2d%2d%2d%1d",
+ &up->year, &up->month, &up->day,
+ &up->hour, &up->minute, &up->second,
+ &up->msecond ) ;
+ if ( rc != 7 || up->month < 1 || up->month > 12 ||
+ up->day < 1 || up->day > 31 || up->hour > 23 ||
+ up->minute > 59 || up->second > 60 ) {
+#ifdef DEBUG
+ if ( debug >= 2 ) {
+ printf ( "%s (refclock_jjy.c) : Time error (rc=%d) [ %02d %02d %02d * %02d %02d %02d.%1d ]\n",
+ sFunctionName, rc, up->year,
+ up->month, up->day, up->hour,
+ up->minute, up->second,
+ up->msecond ) ;
+ }
+#endif
+ up->lineerror = 1 ;
+ break ;
+ }
+ up->year += 2000 ;
+ up->msecond *= 100 ;
+ break ;
+
+ default : /* Unexpected reply */
+
+ up->lineerror = 1 ;
+ break ;
+
+ }
+
+ return 1 ;
+
+}
+
+/**************************************************************************************************/
+
+static int
+jjy_receive_echokeisokuki_lt2000 ( struct recvbuf *rbufp )
+{
+#ifdef DEBUG
+ static char *sFunctionName = "jjy_receive_echokeisokuki_lt2000" ;
+#endif
+
+ struct jjyunit *up ;
+ struct refclockproc *pp ;
+ struct peer *peer;
+
+ char *pBuf ;
+ int iLen ;
+ int rc ;
+ int i, ibcc, ibcc1, ibcc2 ;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer ;
+ pp = peer->procptr ;
+ up = pp->unitptr ;
+
+ if ( up->linediscipline == LDISC_RAW ) {
+ pBuf = up->rawbuf ;
+ iLen = up->charcount ;
+ } else {
+ pBuf = pp->a_lastcode ;
+ iLen = pp->lencode ;
+ }
+
+ switch ( up->linecount ) {
+
+ case 1 : /* YYMMDDWHHMMSS<BCC1><BCC2> or YYMMDDWHHMMSS<ST1><ST2><ST3><ST4> */
+
+ if ( ( up->operationmode == 1 && iLen != 15 ) ||
+ ( up->operationmode == 2 && iLen != 17 ) ) {
+#ifdef DEBUG
+ if ( debug >= 2 ) {
+ printf ( "%s (refclock_jjy.c) : Reply length error ( iLen=%d )\n",
+ sFunctionName, iLen ) ;
+ }
+#endif
+ if ( up->operationmode == 1 ) {
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : send '#'\n", sFunctionName ) ;
+ }
+#endif
+ if ( write ( pp->io.fd, "#",1 ) != 1 ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+ }
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ if ( up->operationmode == 1 ) {
+
+ for ( i = ibcc = 0 ; i < 13 ; i ++ )
+ ibcc ^= pBuf[i] ;
+ ibcc1 = 0x30 | ( ( ibcc >> 4 ) & 0xF ) ;
+ ibcc2 = 0x30 | ( ( ibcc ) & 0xF ) ;
+ if ( pBuf[13] != ibcc1 || pBuf[14] != ibcc2 ) {
+#ifdef DEBUG
+ if ( debug >= 2 ) {
+ printf ( "%s (refclock_jjy.c) : BCC error ( Recv=%02X,%02X / Calc=%02X,%02X)\n",
+ sFunctionName,
+ pBuf[13] & 0xFF,
+ pBuf[14] & 0xFF,
+ ibcc1, ibcc2 ) ;
+ }
+#endif
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ }
+
+ rc = sscanf ( pBuf, "%2d%2d%2d%*1d%2d%2d%2d",
+ &up->year, &up->month, &up->day,
+ &up->hour, &up->minute, &up->second ) ;
+ if ( rc != 6 || up->month < 1 || up->month > 12 ||
+ up->day < 1 || up->day > 31 || up->hour > 23 ||
+ up->minute > 59 || up->second > 60 ) {
+#ifdef DEBUG
+ if ( debug >= 2 ) {
+ printf ( "%s (refclock_jjy.c) : Time error (rc=%d) [ %02d %02d %02d * %02d %02d %02d ]\n",
+ sFunctionName, rc, up->year,
+ up->month, up->day, up->hour,
+ up->minute, up->second ) ;
+ }
+#endif
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ up->year += 2000 ;
+
+ if ( up->operationmode == 2 ) {
+
+ /* A time stamp comes on every 0.5 seccond in the mode 2 of the LT-2000. */
+ up->msecond = 500 ;
+ pp->second -- ;
+ if ( pp->second < 0 ) {
+ pp->second = 59 ;
+ pp->minute -- ;
+ if ( pp->minute < 0 ) {
+ pp->minute = 59 ;
+ pp->hour -- ;
+ if ( pp->hour < 0 ) {
+ pp->hour = 23 ;
+ pp->day -- ;
+ if ( pp->day < 1 ) {
+ pp->year -- ;
+ pp->day = ymd2yd ( pp->year, 12, 31 ) ;
+ }
+ }
+ }
+ }
+
+ /* Switch from mode 2 to mode 1 in order to restraint of useless time stamp. */
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : send '#'\n",
+ sFunctionName ) ;
+ }
+#endif
+ if ( write ( pp->io.fd, "#",1 ) != 1 ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+ }
+
+ break ;
+
+ default : /* Unexpected reply */
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : send '#'\n",
+ sFunctionName ) ;
+ }
+#endif
+ if ( write ( pp->io.fd, "#",1 ) != 1 ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+ up->lineerror = 1 ;
+ break ;
+
+ }
+
+ return 1 ;
+
+}
+
+/**************************************************************************************************/
+
+static int
+jjy_receive_citizentic_jjy200 ( struct recvbuf *rbufp )
+{
+#ifdef DEBUG
+ static char *sFunctionName = "jjy_receive_citizentic_jjy200" ;
+#endif
+
+ struct jjyunit *up ;
+ struct refclockproc *pp ;
+ struct peer *peer;
+
+ char *pBuf ;
+ int iLen ;
+ int rc ;
+ char cApostrophe, sStatus[3] ;
+ int iWeekday ;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer ;
+ pp = peer->procptr ;
+ up = pp->unitptr ;
+
+ if ( up->linediscipline == LDISC_RAW ) {
+ pBuf = up->rawbuf ;
+ iLen = up->charcount ;
+ } else {
+ pBuf = pp->a_lastcode ;
+ iLen = pp->lencode ;
+ }
+
+ /*
+ * JJY-200 sends a timestamp every second.
+ * So, a timestamp is ignored unless it is right after polled.
+ */
+ if ( ! up->bPollFlag )
+ return 0 ;
+
+ switch ( up->linecount ) {
+
+ case 1 : /* 'XX YY/MM/DD W HH:MM:SS<CR> */
+
+ if ( iLen != 23 ) {
+#ifdef DEBUG
+ if ( debug >= 2 ) {
+ printf ( "%s (refclock_jjy.c) : Reply length error ( iLen=%d )\n",
+ sFunctionName, iLen ) ;
+ }
+#endif
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ rc = sscanf ( pBuf, "%c%2s %2d/%2d/%2d %1d %2d:%2d:%2d",
+ &cApostrophe, sStatus, &up->year,
+ &up->month, &up->day, &iWeekday,
+ &up->hour, &up->minute, &up->second ) ;
+ sStatus[2] = 0 ;
+ if ( rc != 9 || cApostrophe != '\'' ||
+ strcmp( sStatus, "OK" ) != 0 || up->month < 1 ||
+ up->month > 12 || up->day < 1 || up->day > 31 ||
+ iWeekday > 6 || up->hour > 23 || up->minute > 59 ||
+ up->second > 60 ) {
+#ifdef DEBUG
+ if ( debug >= 2 ) {
+ printf ( "%s (refclock_jjy.c) : Time error (rc=%d) [ %c %2s %02d %02d %02d %d %02d %02d %02d ]\n",
+ sFunctionName, rc, cApostrophe,
+ sStatus, up->year, up->month,
+ up->day, iWeekday, up->hour,
+ up->minute, up->second ) ;
+ }
+#endif
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ up->year += 2000 ;
+ up->msecond = 0 ;
+
+ break ;
+
+ default : /* Unexpected reply */
+
+ up->lineerror = 1 ;
+ break ;
+
+ }
+
+ return 1 ;
+
+}
+
+/**************************************************************************************************/
+
+static int
+jjy_receive_tristate_gpsclock01 ( struct recvbuf *rbufp )
+{
+#ifdef DEBUG
+ static char *sFunctionName = "jjy_receive_tristate_gpsclock01" ;
+#endif
+
+ struct jjyunit *up ;
+ struct refclockproc *pp ;
+ struct peer *peer;
+
+ char *pBuf ;
+ int iLen ;
+ int rc ;
+
+ int bOverMidnight = 0 ;
+
+ char sLogText [ MAX_LOGTEXT ], sReplyText [ MAX_LOGTEXT ] ;
+
+ char *pCmd ;
+ int iCmdLen ;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer ;
+ pp = peer->procptr ;
+ up = pp->unitptr ;
+
+ if ( up->linediscipline == LDISC_RAW ) {
+ pBuf = up->rawbuf ;
+ iLen = up->charcount ;
+ } else {
+ pBuf = pp->a_lastcode ;
+ iLen = pp->lencode ;
+ }
+
+ /*
+ * Ignore NMEA data stream
+ */
+ if ( iLen > 5
+ && ( strncmp( pBuf, "$GP", 3 ) == 0 || strncmp( pBuf, "$PFEC", 5 ) == 0 ) ) {
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : Skip NMEA stream [%s]\n",
+ sFunctionName, pBuf ) ;
+ }
+#endif
+ return 0 ;
+ }
+
+ /*
+ * Skip command prompt '$Cmd>' from the TS-GPSclock-01
+ */
+ if ( iLen == 5 && strncmp( pBuf, "$Cmd>", 5 ) == 0 ) {
+ return 0 ;
+ } else if ( iLen > 5 && strncmp( pBuf, "$Cmd>", 5 ) == 0 ) {
+ pBuf += 5 ;
+ iLen -= 5 ;
+ }
+
+ /*
+ * Ignore NMEA data stream after command prompt
+ */
+ if ( iLen > 5
+ && ( strncmp( pBuf, "$GP", 3 ) == 0 || strncmp( pBuf, "$PFEC", 5 ) == 0 ) ) {
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : Skip NMEA stream [%s]\n",
+ sFunctionName, pBuf ) ;
+ }
+#endif
+ return 0 ;
+ }
+
+ switch ( tristate_gpsclock01_command_sequence[up->linecount-1].commandNumber ) {
+
+ case TS_GPSCLOCK01_COMMAND_NUMBER_DATE : /* YYYY/MM/DD */
+
+ if ( iLen != TS_GPSCLOCK01_REPLY_LENGTH_DATE ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ rc = sscanf ( pBuf, "%4d/%2d/%2d", &up->year, &up->month, &up->day ) ;
+ if ( rc != 3 || up->year < 2000 || up->month < 1 || up->month > 12 ||
+ up->day < 1 || up->day > 31 ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ break ;
+
+ case TS_GPSCLOCK01_COMMAND_NUMBER_TIME : /* HH:MM:SS */
+
+ if ( iLen != TS_GPSCLOCK01_REPLY_LENGTH_TIME ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ rc = sscanf ( pBuf, "%2d:%2d:%2d", &up->hour, &up->minute, &up->second ) ;
+ if ( rc != 3 || up->hour > 23 || up->minute > 59 || up->second > 60 ) {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ up->msecond = 0 ;
+
+ if ( up->hour == 0 && up->minute == 0 && up->second <= 2 ) {
+ /*
+ * The command "date" and "time" were sent to the JJY receiver separately,
+ * and the JJY receiver replies a date and time separately.
+ * Just after midnight transitions, we ignore this time.
+ */
+ bOverMidnight = 1 ;
+ }
+
+ break ;
+
+ case TS_GPSCLOCK01_COMMAND_NUMBER_STUS :
+
+ if ( iLen == TS_GPSCLOCK01_REPLY_LENGTH_STUS
+ && ( strncmp( pBuf, TS_GPSCLOCK01_REPLY_STUS_RTC, TS_GPSCLOCK01_REPLY_LENGTH_STUS ) == 0
+ || strncmp( pBuf, TS_GPSCLOCK01_REPLY_STUS_GPS, TS_GPSCLOCK01_REPLY_LENGTH_STUS ) == 0
+ || strncmp( pBuf, TS_GPSCLOCK01_REPLY_STUS_UTC, TS_GPSCLOCK01_REPLY_LENGTH_STUS ) == 0
+ || strncmp( pBuf, TS_GPSCLOCK01_REPLY_STUS_PPS, TS_GPSCLOCK01_REPLY_LENGTH_STUS ) == 0 ) ) {
+ /* Good */
+ } else {
+ up->lineerror = 1 ;
+ break ;
+ }
+
+ break ;
+
+ default : /* Unexpected reply */
+
+ up->lineerror = 1 ;
+ break ;
+
+ }
+
+ /* Clockstats Log */
+
+ printableString( sReplyText, sizeof(sReplyText), pBuf, iLen ) ;
+ snprintf ( sLogText, sizeof(sLogText), "%d: %s -> %c: %s",
+ up->linecount,
+ tristate_gpsclock01_command_sequence[up->linecount-1].commandLog,
+ ( up->lineerror == 0 )
+ ? ( ( bOverMidnight == 0 )
+ ? 'O'
+ : 'S' )
+ : 'X',
+ sReplyText ) ;
+ record_clock_stats ( &peer->srcadr, sLogText ) ;
+
+ /* Check before issue next command */
+
+ if ( up->lineerror != 0 ) {
+ /* Do not issue next command */
+ return 0 ;
+ }
+
+ if ( bOverMidnight != 0 ) {
+ /* Do not issue next command */
+ return 0 ;
+ }
+
+ if ( tristate_gpsclock01_command_sequence[up->linecount].command == NULL ) {
+ /* Command sequence completed */
+ return 1 ;
+ }
+
+ /* Issue next command */
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : send '%s'\n",
+ sFunctionName, tristate_gpsclock01_command_sequence[up->linecount].commandLog ) ;
+ }
+#endif
+
+ pCmd = tristate_gpsclock01_command_sequence[up->linecount].command ;
+ iCmdLen = tristate_gpsclock01_command_sequence[up->linecount].commandLength ;
+ if ( write ( pp->io.fd, pCmd, iCmdLen ) != iCmdLen ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+ return 0 ;
+
+}
+
+/**************************************************************************************************/
+/* jjy_poll - called by the transmit procedure */
+/**************************************************************************************************/
+static void
+jjy_poll ( int unit, struct peer *peer )
+{
+
+ struct jjyunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr ;
+
+ if ( pp->polls > 0 && up->linecount == 0 ) {
+ /*
+ * No reply for last command
+ */
+ refclock_report ( peer, CEVNT_TIMEOUT ) ;
+ }
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "jjy_poll (refclock_jjy.c) : %ld\n", pp->polls ) ;
+ }
+#endif
+
+ pp->polls ++ ;
+
+ up->bPollFlag = 1 ;
+ up->linecount = 0 ;
+ up->lineerror = 0 ;
+ up->charcount = 0 ;
+
+ switch ( up->unittype ) {
+
+ case UNITTYPE_TRISTATE_JJY01 :
+ jjy_poll_tristate_jjy01 ( unit, peer ) ;
+ break ;
+
+ case UNITTYPE_CDEX_JST2000 :
+ jjy_poll_cdex_jst2000 ( unit, peer ) ;
+ break ;
+
+ case UNITTYPE_ECHOKEISOKUKI_LT2000 :
+ jjy_poll_echokeisokuki_lt2000 ( unit, peer ) ;
+ break ;
+
+ case UNITTYPE_CITIZENTIC_JJY200 :
+ jjy_poll_citizentic_jjy200 ( unit, peer ) ;
+ break ;
+
+ case UNITTYPE_TRISTATE_GPSCLOCK01 :
+ jjy_poll_tristate_gpsclock01 ( unit, peer ) ;
+ break ;
+
+ default :
+ break ;
+
+ }
+
+}
+
+/**************************************************************************************************/
+
+static void
+jjy_poll_tristate_jjy01 ( int unit, struct peer *peer )
+{
+#ifdef DEBUG
+ static char *sFunctionName = "jjy_poll_tristate_jjy01" ;
+#endif
+
+ struct jjyunit *up;
+ struct refclockproc *pp;
+
+ char *pCmd ;
+ int iCmdLen ;
+
+ pp = peer->procptr;
+ up = pp->unitptr ;
+
+ if ( ( pp->sloppyclockflag & CLK_FLAG1 ) == 0 ) {
+ up->linecount = 2 ;
+ }
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : flag1=%X CLK_FLAG1=%X up->linecount=%d\n",
+ sFunctionName, pp->sloppyclockflag, CLK_FLAG1,
+ up->linecount ) ;
+ }
+#endif
+
+ /*
+ * Send a first command
+ */
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : send '%s'\n",
+ sFunctionName,
+ tristate_jjy01_command_sequence[up->linecount].commandLog ) ;
+ }
+#endif
+
+ pCmd = tristate_jjy01_command_sequence[up->linecount].command ;
+ iCmdLen = tristate_jjy01_command_sequence[up->linecount].commandLength ;
+ if ( write ( pp->io.fd, pCmd, iCmdLen ) != iCmdLen ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+}
+
+/**************************************************************************************************/
+
+static void
+jjy_poll_cdex_jst2000 ( int unit, struct peer *peer )
+{
+
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+
+ /*
+ * Send "<ENQ>1J<ETX>" command
+ */
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "jjy_poll_cdex_jst2000 (refclock_jjy.c) : send '<ENQ>1J<ETX>'\n" ) ;
+ }
+#endif
+
+ if ( write ( pp->io.fd, "\0051J\003", 4 ) != 4 ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+}
+
+/**************************************************************************************************/
+
+static void
+jjy_poll_echokeisokuki_lt2000 ( int unit, struct peer *peer )
+{
+
+ struct jjyunit *up;
+ struct refclockproc *pp;
+
+ char sCmd[2] ;
+
+ pp = peer->procptr;
+ up = pp->unitptr ;
+
+ /*
+ * Send "T" or "C" command
+ */
+
+ switch ( up->operationmode ) {
+ case 1 : sCmd[0] = 'T' ; break ;
+ case 2 : sCmd[0] = 'C' ; break ;
+ }
+ sCmd[1] = 0 ;
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "jjy_poll_echokeisokuki_lt2000 (refclock_jjy.c) : send '%s'\n", sCmd ) ;
+ }
+#endif
+
+ if ( write ( pp->io.fd, sCmd, 1 ) != 1 ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+}
+
+/**************************************************************************************************/
+
+static void
+jjy_poll_citizentic_jjy200 ( int unit, struct peer *peer )
+{
+
+ /* Do nothing ( up->bPollFlag is set by the jjy_poll ) */
+
+}
+
+/**************************************************************************************************/
+
+static void
+jjy_poll_tristate_gpsclock01 ( int unit, struct peer *peer )
+{
+#ifdef DEBUG
+ static char *sFunctionName = "jjy_poll_tristate_gpsclock01" ;
+#endif
+
+ struct jjyunit *up;
+ struct refclockproc *pp;
+
+ char *pCmd ;
+ int iCmdLen ;
+
+ pp = peer->procptr;
+ up = pp->unitptr ;
+
+ if ( ( pp->sloppyclockflag & CLK_FLAG1 ) == 0 ) {
+ up->linecount = 1 ;
+ }
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : flag1=%X CLK_FLAG1=%X up->linecount=%d\n",
+ sFunctionName, pp->sloppyclockflag, CLK_FLAG1,
+ up->linecount ) ;
+ }
+#endif
+
+ /*
+ * Send a first command
+ */
+
+#ifdef DEBUG
+ if ( debug ) {
+ printf ( "%s (refclock_jjy.c) : send '%s'\n",
+ sFunctionName,
+ tristate_gpsclock01_command_sequence[up->linecount].commandLog ) ;
+ }
+#endif
+
+ pCmd = tristate_gpsclock01_command_sequence[up->linecount].command ;
+ iCmdLen = tristate_gpsclock01_command_sequence[up->linecount].commandLength ;
+ if ( write ( pp->io.fd, pCmd, iCmdLen ) != iCmdLen ) {
+ refclock_report ( peer, CEVNT_FAULT ) ;
+ }
+
+}
+
+/**************************************************************************************************/
+
+static void
+printableString ( char *sOutput, int iOutputLen, char *sInput, int iInputLen )
+{
+ char *printableControlChar[] = {
+ "<NUL>", "<SOH>", "<STX>", "<ETX>",
+ "<EOT>", "<ENQ>", "<ACK>", "<BEL>",
+ "<BS>" , "<HT>" , "<LF>" , "<VT>" ,
+ "<FF>" , "<CR>" , "<SO>" , "<SI>" ,
+ "<DLE>", "<DC1>", "<DC2>", "<DC3>",
+ "<DC4>", "<NAK>", "<SYN>", "<ETB>",
+ "<CAN>", "<EM>" , "<SUB>", "<ESC>",
+ "<FS>" , "<GS>" , "<RS>" , "<US>" ,
+ " " } ;
+ size_t InputLen;
+ size_t OutputLen;
+ size_t i;
+ size_t j;
+ size_t n;
+
+ InputLen = (size_t)iInputLen;
+ OutputLen = (size_t)iOutputLen;
+ for ( i = j = 0 ; i < InputLen && j < OutputLen ; i ++ ) {
+ if ( isprint( sInput[i] ) ) {
+ n = 1 ;
+ if ( j + 1 >= OutputLen )
+ break ;
+ sOutput[j] = sInput[i] ;
+ } else if ( ( sInput[i] & 0xFF ) <
+ COUNTOF(printableControlChar) ) {
+ n = strlen( printableControlChar[sInput[i] & 0xFF] ) ;
+ if ( j + n + 1 >= OutputLen )
+ break ;
+ strlcpy( sOutput + j,
+ printableControlChar[sInput[i] & 0xFF],
+ OutputLen - j ) ;
+ } else {
+ n = 5 ;
+ if ( j + n + 1 >= OutputLen )
+ break ;
+ snprintf( sOutput + j, OutputLen - j, "<x%X>",
+ sInput[i] & 0xFF ) ;
+ }
+ j += n ;
+ }
+
+ sOutput[min(j, iOutputLen - 1)] = '\0' ;
+
+}
+
+/**************************************************************************************************/
+
+#else
+int refclock_jjy_bs ;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_jupiter.c b/ntpd/refclock_jupiter.c
new file mode 100644
index 0000000..377fc56
--- /dev/null
+++ b/ntpd/refclock_jupiter.c
@@ -0,0 +1,1121 @@
+/*
+ * Copyright (c) 1997, 1998, 2003
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Lawrence Berkeley Laboratory.
+ * 4. The name of the University may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_JUPITER) && defined(HAVE_PPSAPI)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "jupiter.h"
+
+#ifdef HAVE_PPSAPI
+# include "ppsapi_timepps.h"
+#endif
+
+#ifdef WORDS_BIGENDIAN
+#define getshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
+#define putshort(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
+#else
+#define getshort(s) ((u_short)(s))
+#define putshort(s) ((u_short)(s))
+#endif
+
+/*
+ * This driver supports the Rockwell Jupiter GPS Receiver board
+ * adapted to precision timing applications. It requires the
+ * ppsclock line discipline or streams module described in the
+ * Line Disciplines and Streams Drivers page. It also requires a
+ * gadget box and 1-PPS level converter, such as described in the
+ * Pulse-per-second (PPS) Signal Interfacing page.
+ *
+ * It may work (with minor modifications) with other Rockwell GPS
+ * receivers such as the CityTracker.
+ */
+
+/*
+ * GPS Definitions
+ */
+#define DEVICE "/dev/gps%d" /* device name and unit */
+#define SPEED232 B9600 /* baud */
+
+/*
+ * Radio interface parameters
+ */
+#define PRECISION (-18) /* precision assumed (about 4 us) */
+#define REFID "GPS\0" /* reference id */
+#define DESCRIPTION "Rockwell Jupiter GPS Receiver" /* who we are */
+#define DEFFUDGETIME 0 /* default fudge time (ms) */
+
+/* Unix timestamp for the GPS epoch: January 6, 1980 */
+#define GPS_EPOCH 315964800
+
+/* Double short to unsigned int */
+#define DS2UI(p) ((getshort((p)[1]) << 16) | getshort((p)[0]))
+
+/* Double short to signed int */
+#define DS2I(p) ((getshort((p)[1]) << 16) | getshort((p)[0]))
+
+/* One week's worth of seconds */
+#define WEEKSECS (7 * 24 * 60 * 60)
+
+/*
+ * Jupiter unit control structure.
+ */
+struct instance {
+ struct peer *peer; /* peer */
+ u_int pollcnt; /* poll message counter */
+ u_int polled; /* Hand in a time sample? */
+#ifdef HAVE_PPSAPI
+ pps_params_t pps_params; /* pps parameters */
+ pps_info_t pps_info; /* last pps data */
+ pps_handle_t pps_handle; /* pps handle */
+ u_int assert; /* pps edge to use */
+ u_int hardpps; /* enable kernel mode */
+ struct timespec ts; /* last timestamp */
+#endif
+ l_fp limit;
+ u_int gpos_gweek; /* Current GPOS GPS week number */
+ u_int gpos_sweek; /* Current GPOS GPS seconds into week */
+ u_int gweek; /* current GPS week number */
+ u_int32 lastsweek; /* last seconds into GPS week */
+ time_t timecode; /* current ntp timecode */
+ u_int32 stime; /* used to detect firmware bug */
+ int wantid; /* don't reconfig on channel id msg */
+ u_int moving; /* mobile platform? */
+ u_char sloppyclockflag; /* fudge flags */
+ u_short sbuf[512]; /* local input buffer */
+ int ssize; /* space used in sbuf */
+};
+
+/*
+ * Function prototypes
+ */
+static void jupiter_canmsg (struct instance *, u_int);
+static u_short jupiter_cksum (u_short *, u_int);
+static int jupiter_config (struct instance *);
+static void jupiter_debug (struct peer *, const char *,
+ const char *, ...)
+ __attribute__ ((format (printf, 3, 4)));
+static char * jupiter_parse_t (struct instance *, u_short *);
+static char * jupiter_parse_gpos (struct instance *, u_short *);
+static void jupiter_platform (struct instance *, u_int);
+static void jupiter_poll (int, struct peer *);
+static void jupiter_control (int, const struct refclockstat *,
+ struct refclockstat *, struct peer *);
+#ifdef HAVE_PPSAPI
+static int jupiter_ppsapi (struct instance *);
+static int jupiter_pps (struct instance *);
+#endif /* HAVE_PPSAPI */
+static int jupiter_recv (struct instance *);
+static void jupiter_receive (struct recvbuf *rbufp);
+static void jupiter_reqmsg (struct instance *, u_int, u_int);
+static void jupiter_reqonemsg(struct instance *, u_int);
+static char * jupiter_send (struct instance *, struct jheader *);
+static void jupiter_shutdown(int, struct peer *);
+static int jupiter_start (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_jupiter = {
+ jupiter_start, /* start up driver */
+ jupiter_shutdown, /* shut down driver */
+ jupiter_poll, /* transmit poll message */
+ jupiter_control, /* (clock control) */
+ noentry, /* (clock init) */
+ noentry, /* (clock buginfo) */
+ NOFLAGS /* not used */
+};
+
+/*
+ * jupiter_start - open the devices and initialize data for processing
+ */
+static int
+jupiter_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct instance *instance;
+ int fd;
+ char gpsdev[20];
+
+ /*
+ * Open serial port
+ */
+ snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
+ fd = refclock_open(gpsdev, SPEED232, LDISC_RAW);
+ if (fd <= 0) {
+ jupiter_debug(peer, "jupiter_start", "open %s: %m",
+ gpsdev);
+ return (0);
+ }
+
+ /* Allocate unit structure */
+ instance = emalloc_zero(sizeof(*instance));
+ instance->peer = peer;
+ pp = peer->procptr;
+ pp->io.clock_recv = jupiter_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(instance);
+ return (0);
+ }
+ pp->unitptr = instance;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+
+#ifdef HAVE_PPSAPI
+ instance->assert = 1;
+ instance->hardpps = 0;
+ /*
+ * Start the PPSAPI interface if it is there. Default to use
+ * the assert edge and do not enable the kernel hardpps.
+ */
+ if (time_pps_create(fd, &instance->pps_handle) < 0) {
+ instance->pps_handle = 0;
+ msyslog(LOG_ERR,
+ "refclock_jupiter: time_pps_create failed: %m");
+ }
+ else if (!jupiter_ppsapi(instance))
+ goto clean_up;
+#endif /* HAVE_PPSAPI */
+
+ /* Ensure the receiver is properly configured */
+ if (!jupiter_config(instance))
+ goto clean_up;
+
+ return (1);
+
+clean_up:
+ jupiter_shutdown(unit, peer);
+ pp->unitptr = 0;
+ return (0);
+}
+
+/*
+ * jupiter_shutdown - shut down the clock
+ */
+static void
+jupiter_shutdown(int unit, struct peer *peer)
+{
+ struct instance *instance;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ instance = pp->unitptr;
+ if (!instance)
+ return;
+
+#ifdef HAVE_PPSAPI
+ if (instance->pps_handle) {
+ time_pps_destroy(instance->pps_handle);
+ instance->pps_handle = 0;
+ }
+#endif /* HAVE_PPSAPI */
+
+ if (pp->io.fd != -1)
+ io_closeclock(&pp->io);
+ free(instance);
+}
+
+/*
+ * jupiter_config - Configure the receiver
+ */
+static int
+jupiter_config(struct instance *instance)
+{
+ jupiter_debug(instance->peer, "jupiter_config", "init receiver");
+
+ /*
+ * Initialize the unit variables
+ */
+ instance->sloppyclockflag = instance->peer->procptr->sloppyclockflag;
+ instance->moving = !!(instance->sloppyclockflag & CLK_FLAG2);
+ if (instance->moving)
+ jupiter_debug(instance->peer, "jupiter_config",
+ "mobile platform");
+
+ instance->pollcnt = 2;
+ instance->polled = 0;
+ instance->gpos_gweek = 0;
+ instance->gpos_sweek = 0;
+ instance->gweek = 0;
+ instance->lastsweek = 2 * WEEKSECS;
+ instance->timecode = 0;
+ instance->stime = 0;
+ instance->ssize = 0;
+
+ /* Stop outputting all messages */
+ jupiter_canmsg(instance, JUPITER_ALL);
+
+ /* Request the receiver id so we can syslog the firmware version */
+ jupiter_reqonemsg(instance, JUPITER_O_ID);
+
+ /* Flag that this the id was requested (so we don't get called again) */
+ instance->wantid = 1;
+
+ /* Request perodic time mark pulse messages */
+ jupiter_reqmsg(instance, JUPITER_O_PULSE, 1);
+
+ /* Request perodic geodetic position status */
+ jupiter_reqmsg(instance, JUPITER_O_GPOS, 1);
+
+ /* Set application platform type */
+ if (instance->moving)
+ jupiter_platform(instance, JUPITER_I_PLAT_MED);
+ else
+ jupiter_platform(instance, JUPITER_I_PLAT_LOW);
+
+ return (1);
+}
+
+#ifdef HAVE_PPSAPI
+/*
+ * Initialize PPSAPI
+ */
+int
+jupiter_ppsapi(
+ struct instance *instance /* unit structure pointer */
+ )
+{
+ int capability;
+
+ if (time_pps_getcap(instance->pps_handle, &capability) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_jupiter: time_pps_getcap failed: %m");
+ return (0);
+ }
+ memset(&instance->pps_params, 0, sizeof(pps_params_t));
+ if (!instance->assert)
+ instance->pps_params.mode = capability & PPS_CAPTURECLEAR;
+ else
+ instance->pps_params.mode = capability & PPS_CAPTUREASSERT;
+ if (!(instance->pps_params.mode & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR))) {
+ msyslog(LOG_ERR,
+ "refclock_jupiter: invalid capture edge %d",
+ instance->assert);
+ return (0);
+ }
+ instance->pps_params.mode |= PPS_TSFMT_TSPEC;
+ if (time_pps_setparams(instance->pps_handle, &instance->pps_params) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_jupiter: time_pps_setparams failed: %m");
+ return (0);
+ }
+ if (instance->hardpps) {
+ if (time_pps_kcbind(instance->pps_handle, PPS_KC_HARDPPS,
+ instance->pps_params.mode & ~PPS_TSFMT_TSPEC,
+ PPS_TSFMT_TSPEC) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_jupiter: time_pps_kcbind failed: %m");
+ return (0);
+ }
+ hardpps_enable = 1;
+ }
+/* instance->peer->precision = PPS_PRECISION; */
+
+#if DEBUG
+ if (debug) {
+ time_pps_getparams(instance->pps_handle, &instance->pps_params);
+ jupiter_debug(instance->peer, "refclock_jupiter",
+ "pps capability 0x%x version %d mode 0x%x kern %d",
+ capability, instance->pps_params.api_version,
+ instance->pps_params.mode, instance->hardpps);
+ }
+#endif
+
+ return (1);
+}
+
+/*
+ * Get PPSAPI timestamps.
+ *
+ * Return 0 on failure and 1 on success.
+ */
+static int
+jupiter_pps(struct instance *instance)
+{
+ pps_info_t pps_info;
+ struct timespec timeout, ts;
+ double dtemp;
+ l_fp tstmp;
+
+ /*
+ * Convert the timespec nanoseconds field to ntp l_fp units.
+ */
+ if (instance->pps_handle == 0)
+ return 1;
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+ memcpy(&pps_info, &instance->pps_info, sizeof(pps_info_t));
+ if (time_pps_fetch(instance->pps_handle, PPS_TSFMT_TSPEC, &instance->pps_info,
+ &timeout) < 0)
+ return 1;
+ if (instance->pps_params.mode & PPS_CAPTUREASSERT) {
+ if (pps_info.assert_sequence ==
+ instance->pps_info.assert_sequence)
+ return 1;
+ ts = instance->pps_info.assert_timestamp;
+ } else if (instance->pps_params.mode & PPS_CAPTURECLEAR) {
+ if (pps_info.clear_sequence ==
+ instance->pps_info.clear_sequence)
+ return 1;
+ ts = instance->pps_info.clear_timestamp;
+ } else {
+ return 1;
+ }
+ if ((instance->ts.tv_sec == ts.tv_sec) && (instance->ts.tv_nsec == ts.tv_nsec))
+ return 1;
+ instance->ts = ts;
+
+ tstmp.l_ui = (u_int32)ts.tv_sec + JAN_1970;
+ dtemp = ts.tv_nsec * FRAC / 1e9;
+ tstmp.l_uf = (u_int32)dtemp;
+ instance->peer->procptr->lastrec = tstmp;
+ return 0;
+}
+#endif /* HAVE_PPSAPI */
+
+/*
+ * jupiter_poll - jupiter watchdog routine
+ */
+static void
+jupiter_poll(int unit, struct peer *peer)
+{
+ struct instance *instance;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ instance = pp->unitptr;
+
+ /*
+ * You don't need to poll this clock. It puts out timecodes
+ * once per second. If asked for a timestamp, take note.
+ * The next time a timecode comes in, it will be fed back.
+ */
+
+ /*
+ * If we haven't had a response in a while, reset the receiver.
+ */
+ if (instance->pollcnt > 0) {
+ instance->pollcnt--;
+ } else {
+ refclock_report(peer, CEVNT_TIMEOUT);
+
+ /* Request the receiver id to trigger a reconfig */
+ jupiter_reqonemsg(instance, JUPITER_O_ID);
+ instance->wantid = 0;
+ }
+
+ /*
+ * polled every 64 seconds. Ask jupiter_receive to hand in
+ * a timestamp.
+ */
+ instance->polled = 1;
+ pp->polls++;
+}
+
+/*
+ * jupiter_control - fudge control
+ */
+static void
+jupiter_control(
+ int unit, /* unit (not used) */
+ const struct refclockstat *in, /* input parameters (not used) */
+ struct refclockstat *out, /* output parameters (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct instance *instance;
+ u_char sloppyclockflag;
+
+ pp = peer->procptr;
+ instance = pp->unitptr;
+
+ DTOLFP(pp->fudgetime2, &instance->limit);
+ /* Force positive value. */
+ if (L_ISNEG(&instance->limit))
+ L_NEG(&instance->limit);
+
+#ifdef HAVE_PPSAPI
+ instance->assert = !(pp->sloppyclockflag & CLK_FLAG3);
+ jupiter_ppsapi(instance);
+#endif /* HAVE_PPSAPI */
+
+ sloppyclockflag = instance->sloppyclockflag;
+ instance->sloppyclockflag = pp->sloppyclockflag;
+ if ((instance->sloppyclockflag & CLK_FLAG2) !=
+ (sloppyclockflag & CLK_FLAG2)) {
+ jupiter_debug(peer,
+ "jupiter_control",
+ "mode switch: reset receiver");
+ jupiter_config(instance);
+ return;
+ }
+}
+
+/*
+ * jupiter_receive - receive gps data
+ * Gag me!
+ */
+static void
+jupiter_receive(struct recvbuf *rbufp)
+{
+ int bpcnt, cc, size, ppsret;
+ time_t last_timecode;
+ u_int32 laststime;
+ char *cp;
+ u_char *bp;
+ u_short *sp;
+ struct jid *ip;
+ struct jheader *hp;
+ struct peer *peer;
+ struct refclockproc *pp;
+ struct instance *instance;
+ l_fp tstamp;
+
+ /* Initialize pointers and read the timecode and timestamp */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ instance = pp->unitptr;
+
+ bp = (u_char *)rbufp->recv_buffer;
+ bpcnt = rbufp->recv_length;
+
+ /* This shouldn't happen */
+ if (bpcnt > (int)sizeof(instance->sbuf) - instance->ssize)
+ bpcnt = sizeof(instance->sbuf) - instance->ssize;
+
+ /* Append to input buffer */
+ memcpy((u_char *)instance->sbuf + instance->ssize, bp, bpcnt);
+ instance->ssize += bpcnt;
+
+ /* While there's at least a header and we parse an intact message */
+ while (instance->ssize > sizeof(*hp) && (cc = jupiter_recv(instance)) > 0) {
+ instance->pollcnt = 2;
+
+ tstamp = rbufp->recv_time;
+ hp = (struct jheader *)instance->sbuf;
+ sp = (u_short *)(hp + 1);
+ size = cc - sizeof(*hp);
+ switch (getshort(hp->id)) {
+
+ case JUPITER_O_PULSE:
+ if (size != sizeof(struct jpulse)) {
+ jupiter_debug(peer,
+ "jupiter_receive", "pulse: len %d != %u",
+ size, (int)sizeof(struct jpulse));
+ refclock_report(peer, CEVNT_BADREPLY);
+ break;
+ }
+
+ /*
+ * There appears to be a firmware bug related
+ * to the pulse message; in addition to the one
+ * per second messages, we get an extra pulse
+ * message once an hour (on the anniversary of
+ * the cold start). It seems to come 200 ms
+ * after the one requested. So if we've seen a
+ * pulse message in the last 210 ms, we skip
+ * this one.
+ */
+ laststime = instance->stime;
+ instance->stime = DS2UI(((struct jpulse *)sp)->stime);
+ if (laststime != 0 && instance->stime - laststime <= 21) {
+ jupiter_debug(peer, "jupiter_receive",
+ "avoided firmware bug (stime %.2f, laststime %.2f)",
+ (double)instance->stime * 0.01, (double)laststime * 0.01);
+ break;
+ }
+
+ /* Retrieve pps timestamp */
+ ppsret = jupiter_pps(instance);
+
+ /*
+ * Add one second if msg received early
+ * (i.e. before limit, a.k.a. fudgetime2) in
+ * the second.
+ */
+ L_SUB(&tstamp, &pp->lastrec);
+ if (!L_ISGEQ(&tstamp, &instance->limit))
+ ++pp->lastrec.l_ui;
+
+ /* Parse timecode (even when there's no pps) */
+ last_timecode = instance->timecode;
+ if ((cp = jupiter_parse_t(instance, sp)) != NULL) {
+ jupiter_debug(peer,
+ "jupiter_receive", "pulse: %s", cp);
+ break;
+ }
+
+ /* Bail if we didn't get a pps timestamp */
+ if (ppsret)
+ break;
+
+ /* Bail if we don't have the last timecode yet */
+ if (last_timecode == 0)
+ break;
+
+ /* Add the new sample to a median filter */
+ tstamp.l_ui = JAN_1970 + (u_int32)last_timecode;
+ tstamp.l_uf = 0;
+
+ refclock_process_offset(pp, tstamp, pp->lastrec, pp->fudgetime1);
+
+ /*
+ * The clock will blurt a timecode every second
+ * but we only want one when polled. If we
+ * havn't been polled, bail out.
+ */
+ if (!instance->polled)
+ break;
+ instance->polled = 0;
+
+ /*
+ * It's a live one! Remember this time.
+ */
+
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+
+ /*
+ * If we get here - what we got from the clock is
+ * OK, so say so
+ */
+ refclock_report(peer, CEVNT_NOMINAL);
+
+ /*
+ * We have succeeded in answering the poll.
+ * Turn off the flag and return
+ */
+ instance->polled = 0;
+ break;
+
+ case JUPITER_O_GPOS:
+ if (size != sizeof(struct jgpos)) {
+ jupiter_debug(peer,
+ "jupiter_receive", "gpos: len %d != %u",
+ size, (int)sizeof(struct jgpos));
+ refclock_report(peer, CEVNT_BADREPLY);
+ break;
+ }
+
+ if ((cp = jupiter_parse_gpos(instance, sp)) != NULL) {
+ jupiter_debug(peer,
+ "jupiter_receive", "gpos: %s", cp);
+ break;
+ }
+ break;
+
+ case JUPITER_O_ID:
+ if (size != sizeof(struct jid)) {
+ jupiter_debug(peer,
+ "jupiter_receive", "id: len %d != %u",
+ size, (int)sizeof(struct jid));
+ refclock_report(peer, CEVNT_BADREPLY);
+ break;
+ }
+ /*
+ * If we got this message because the Jupiter
+ * just powered instance, it needs to be reconfigured.
+ */
+ ip = (struct jid *)sp;
+ jupiter_debug(peer,
+ "jupiter_receive", "%s chan ver %s, %s (%s)",
+ ip->chans, ip->vers, ip->date, ip->opts);
+ msyslog(LOG_DEBUG,
+ "jupiter_receive: %s chan ver %s, %s (%s)",
+ ip->chans, ip->vers, ip->date, ip->opts);
+ if (instance->wantid)
+ instance->wantid = 0;
+ else {
+ jupiter_debug(peer,
+ "jupiter_receive", "reset receiver");
+ jupiter_config(instance);
+ /*
+ * Restore since jupiter_config() just
+ * zeroed it
+ */
+ instance->ssize = cc;
+ }
+ break;
+
+ default:
+ jupiter_debug(peer,
+ "jupiter_receive", "unknown message id %d",
+ getshort(hp->id));
+ break;
+ }
+ instance->ssize -= cc;
+ if (instance->ssize < 0) {
+ fprintf(stderr, "jupiter_recv: negative ssize!\n");
+ abort();
+ } else if (instance->ssize > 0)
+ memcpy(instance->sbuf, (u_char *)instance->sbuf + cc, instance->ssize);
+ }
+}
+
+static char *
+jupiter_parse_t(struct instance *instance, u_short *sp)
+{
+ struct tm *tm;
+ char *cp;
+ struct jpulse *jp;
+ u_int32 sweek;
+ time_t last_timecode;
+ u_short flags;
+
+ jp = (struct jpulse *)sp;
+
+ /* The timecode is presented as seconds into the current GPS week */
+ sweek = DS2UI(jp->sweek) % WEEKSECS;
+
+ /*
+ * If we don't know the current GPS week, calculate it from the
+ * current time. (It's too bad they didn't include this
+ * important value in the pulse message). We'd like to pick it
+ * up from one of the other messages like gpos or chan but they
+ * don't appear to be synchronous with time keeping and changes
+ * too soon (something like 10 seconds before the new GPS
+ * week).
+ *
+ * If we already know the current GPS week, increment it when
+ * we wrap into a new week.
+ */
+ if (instance->gweek == 0) {
+ if (!instance->gpos_gweek) {
+ return ("jupiter_parse_t: Unknown gweek");
+ }
+
+ instance->gweek = instance->gpos_gweek;
+
+ /*
+ * Fix warps. GPOS has GPS time and PULSE has UTC.
+ * Plus, GPOS need not be completely in synch with
+ * the PPS signal.
+ */
+ if (instance->gpos_sweek >= sweek) {
+ if ((instance->gpos_sweek - sweek) > WEEKSECS / 2)
+ ++instance->gweek;
+ }
+ else {
+ if ((sweek - instance->gpos_sweek) > WEEKSECS / 2)
+ --instance->gweek;
+ }
+ }
+ else if (sweek == 0 && instance->lastsweek == WEEKSECS - 1) {
+ ++instance->gweek;
+ jupiter_debug(instance->peer,
+ "jupiter_parse_t", "NEW gps week %u", instance->gweek);
+ }
+
+ /*
+ * See if the sweek stayed the same (this happens when there is
+ * no pps pulse).
+ *
+ * Otherwise, look for time warps:
+ *
+ * - we have stored at least one lastsweek and
+ * - the sweek didn't increase by one and
+ * - we didn't wrap to a new GPS week
+ *
+ * Then we warped.
+ */
+ if (instance->lastsweek == sweek)
+ jupiter_debug(instance->peer,
+ "jupiter_parse_t", "gps sweek not incrementing (%d)",
+ sweek);
+ else if (instance->lastsweek != 2 * WEEKSECS &&
+ instance->lastsweek + 1 != sweek &&
+ !(sweek == 0 && instance->lastsweek == WEEKSECS - 1))
+ jupiter_debug(instance->peer,
+ "jupiter_parse_t", "gps sweek jumped (was %d, now %d)",
+ instance->lastsweek, sweek);
+ instance->lastsweek = sweek;
+
+ /* This timecode describes next pulse */
+ last_timecode = instance->timecode;
+ instance->timecode =
+ GPS_EPOCH + (instance->gweek * WEEKSECS) + sweek;
+
+ if (last_timecode == 0)
+ /* XXX debugging */
+ jupiter_debug(instance->peer,
+ "jupiter_parse_t", "UTC <none> (gweek/sweek %u/%u)",
+ instance->gweek, sweek);
+ else {
+ /* XXX debugging */
+ tm = gmtime(&last_timecode);
+ cp = asctime(tm);
+
+ jupiter_debug(instance->peer,
+ "jupiter_parse_t", "UTC %.24s (gweek/sweek %u/%u)",
+ cp, instance->gweek, sweek);
+
+ /* Billboard last_timecode (which is now the current time) */
+ instance->peer->procptr->year = tm->tm_year + 1900;
+ instance->peer->procptr->day = tm->tm_yday + 1;
+ instance->peer->procptr->hour = tm->tm_hour;
+ instance->peer->procptr->minute = tm->tm_min;
+ instance->peer->procptr->second = tm->tm_sec;
+ }
+
+ flags = getshort(jp->flags);
+
+ /* Toss if not designated "valid" by the gps */
+ if ((flags & JUPITER_O_PULSE_VALID) == 0) {
+ refclock_report(instance->peer, CEVNT_BADTIME);
+ return ("time mark not valid");
+ }
+
+ /* We better be sync'ed to UTC... */
+ if ((flags & JUPITER_O_PULSE_UTC) == 0) {
+ refclock_report(instance->peer, CEVNT_BADTIME);
+ return ("time mark not sync'ed to UTC");
+ }
+
+ return (NULL);
+}
+
+static char *
+jupiter_parse_gpos(struct instance *instance, u_short *sp)
+{
+ struct jgpos *jg;
+ time_t t;
+ struct tm *tm;
+ char *cp;
+
+ jg = (struct jgpos *)sp;
+
+ if (jg->navval != 0) {
+ /*
+ * Solution not valid. Use caution and refuse
+ * to determine GPS week from this message.
+ */
+ instance->gpos_gweek = 0;
+ instance->gpos_sweek = 0;
+ return ("Navigation solution not valid");
+ }
+
+ instance->gpos_gweek = jg->gweek;
+ instance->gpos_sweek = DS2UI(jg->sweek);
+ while(instance->gpos_sweek >= WEEKSECS) {
+ instance->gpos_sweek -= WEEKSECS;
+ ++instance->gpos_gweek;
+ }
+ instance->gweek = 0;
+
+ t = GPS_EPOCH + (instance->gpos_gweek * WEEKSECS) + instance->gpos_sweek;
+ tm = gmtime(&t);
+ cp = asctime(tm);
+
+ jupiter_debug(instance->peer,
+ "jupiter_parse_g", "GPS %.24s (gweek/sweek %u/%u)",
+ cp, instance->gpos_gweek, instance->gpos_sweek);
+ return (NULL);
+}
+
+/*
+ * jupiter_debug - print debug messages
+ */
+static void
+jupiter_debug(
+ struct peer * peer,
+ const char * function,
+ const char * fmt,
+ ...
+ )
+{
+ char buffer[200];
+ va_list ap;
+
+ va_start(ap, fmt);
+ /*
+ * Print debug message to stdout
+ * In the future, we may want to get get more creative...
+ */
+ mvsnprintf(buffer, sizeof(buffer), fmt, ap);
+ record_clock_stats(&peer->srcadr, buffer);
+#ifdef DEBUG
+ if (debug) {
+ printf("%s: %s\n", function, buffer);
+ fflush(stdout);
+ }
+#endif
+
+ va_end(ap);
+}
+
+/* Checksum and transmit a message to the Jupiter */
+static char *
+jupiter_send(struct instance *instance, struct jheader *hp)
+{
+ u_int len, size;
+ int cc;
+ u_short *sp;
+ static char errstr[132];
+
+ size = sizeof(*hp);
+ hp->hsum = putshort(jupiter_cksum((u_short *)hp,
+ (size / sizeof(u_short)) - 1));
+ len = getshort(hp->len);
+ if (len > 0) {
+ sp = (u_short *)(hp + 1);
+ sp[len] = putshort(jupiter_cksum(sp, len));
+ size += (len + 1) * sizeof(u_short);
+ }
+
+ if ((cc = write(instance->peer->procptr->io.fd, (char *)hp, size)) < 0) {
+ msnprintf(errstr, sizeof(errstr), "write: %m");
+ return (errstr);
+ } else if (cc != (int)size) {
+ snprintf(errstr, sizeof(errstr), "short write (%d != %u)", cc, size);
+ return (errstr);
+ }
+ return (NULL);
+}
+
+/* Request periodic message output */
+static struct {
+ struct jheader jheader;
+ struct jrequest jrequest;
+} reqmsg = {
+ { putshort(JUPITER_SYNC), 0,
+ putshort((sizeof(struct jrequest) / sizeof(u_short)) - 1),
+ 0, JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK |
+ JUPITER_FLAG_CONN | JUPITER_FLAG_LOG, 0 },
+ { 0, 0, 0, 0 }
+};
+
+/* An interval of zero means to output on trigger */
+static void
+jupiter_reqmsg(struct instance *instance, u_int id,
+ u_int interval)
+{
+ struct jheader *hp;
+ struct jrequest *rp;
+ char *cp;
+
+ hp = &reqmsg.jheader;
+ hp->id = putshort(id);
+ rp = &reqmsg.jrequest;
+ rp->trigger = putshort(interval == 0);
+ rp->interval = putshort(interval);
+ if ((cp = jupiter_send(instance, hp)) != NULL)
+ jupiter_debug(instance->peer, "jupiter_reqmsg", "%u: %s", id, cp);
+}
+
+/* Cancel periodic message output */
+static struct jheader canmsg = {
+ putshort(JUPITER_SYNC), 0, 0, 0,
+ JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK | JUPITER_FLAG_DISC,
+ 0
+};
+
+static void
+jupiter_canmsg(struct instance *instance, u_int id)
+{
+ struct jheader *hp;
+ char *cp;
+
+ hp = &canmsg;
+ hp->id = putshort(id);
+ if ((cp = jupiter_send(instance, hp)) != NULL)
+ jupiter_debug(instance->peer, "jupiter_canmsg", "%u: %s", id, cp);
+}
+
+/* Request a single message output */
+static struct jheader reqonemsg = {
+ putshort(JUPITER_SYNC), 0, 0, 0,
+ JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK | JUPITER_FLAG_QUERY,
+ 0
+};
+
+static void
+jupiter_reqonemsg(struct instance *instance, u_int id)
+{
+ struct jheader *hp;
+ char *cp;
+
+ hp = &reqonemsg;
+ hp->id = putshort(id);
+ if ((cp = jupiter_send(instance, hp)) != NULL)
+ jupiter_debug(instance->peer, "jupiter_reqonemsg", "%u: %s", id, cp);
+}
+
+/* Set the platform dynamics */
+static struct {
+ struct jheader jheader;
+ struct jplat jplat;
+} platmsg = {
+ { putshort(JUPITER_SYNC), putshort(JUPITER_I_PLAT),
+ putshort((sizeof(struct jplat) / sizeof(u_short)) - 1), 0,
+ JUPITER_FLAG_REQUEST | JUPITER_FLAG_NAK, 0 },
+ { 0, 0, 0 }
+};
+
+static void
+jupiter_platform(struct instance *instance, u_int platform)
+{
+ struct jheader *hp;
+ struct jplat *pp;
+ char *cp;
+
+ hp = &platmsg.jheader;
+ pp = &platmsg.jplat;
+ pp->platform = putshort(platform);
+ if ((cp = jupiter_send(instance, hp)) != NULL)
+ jupiter_debug(instance->peer, "jupiter_platform", "%u: %s", platform, cp);
+}
+
+/* Checksum "len" shorts */
+static u_short
+jupiter_cksum(u_short *sp, u_int len)
+{
+ u_short sum, x;
+
+ sum = 0;
+ while (len-- > 0) {
+ x = *sp++;
+ sum += getshort(x);
+ }
+ return (~sum + 1);
+}
+
+/* Return the size of the next message (or zero if we don't have it all yet) */
+static int
+jupiter_recv(struct instance *instance)
+{
+ int n, len, size, cc;
+ struct jheader *hp;
+ u_char *bp;
+ u_short *sp;
+
+ /* Must have at least a header's worth */
+ cc = sizeof(*hp);
+ size = instance->ssize;
+ if (size < cc)
+ return (0);
+
+ /* Search for the sync short if missing */
+ sp = instance->sbuf;
+ hp = (struct jheader *)sp;
+ if (getshort(hp->sync) != JUPITER_SYNC) {
+ /* Wasn't at the front, sync up */
+ jupiter_debug(instance->peer, "jupiter_recv", "syncing");
+ bp = (u_char *)sp;
+ n = size;
+ while (n >= 2) {
+ if (bp[0] != (JUPITER_SYNC & 0xff)) {
+ /*
+ jupiter_debug(instance->peer, "{0x%x}", bp[0]);
+ */
+ ++bp;
+ --n;
+ continue;
+ }
+ if (bp[1] == ((JUPITER_SYNC >> 8) & 0xff))
+ break;
+ /*
+ jupiter_debug(instance->peer, "{0x%x 0x%x}", bp[0], bp[1]);
+ */
+ bp += 2;
+ n -= 2;
+ }
+ /*
+ jupiter_debug(instance->peer, "\n");
+ */
+ /* Shuffle data to front of input buffer */
+ if (n > 0)
+ memcpy(sp, bp, n);
+ size = n;
+ instance->ssize = size;
+ if (size < cc || hp->sync != JUPITER_SYNC)
+ return (0);
+ }
+
+ if (jupiter_cksum(sp, (cc / sizeof(u_short) - 1)) !=
+ getshort(hp->hsum)) {
+ jupiter_debug(instance->peer, "jupiter_recv", "bad header checksum!");
+ /* This is drastic but checksum errors should be rare */
+ instance->ssize = 0;
+ return (0);
+ }
+
+ /* Check for a payload */
+ len = getshort(hp->len);
+ if (len > 0) {
+ n = (len + 1) * sizeof(u_short);
+ /* Not enough data yet */
+ if (size < cc + n)
+ return (0);
+
+ /* Check payload checksum */
+ sp = (u_short *)(hp + 1);
+ if (jupiter_cksum(sp, len) != getshort(sp[len])) {
+ jupiter_debug(instance->peer,
+ "jupiter_recv", "bad payload checksum!");
+ /* This is drastic but checksum errors should be rare */
+ instance->ssize = 0;
+ return (0);
+ }
+ cc += n;
+ }
+ return (cc);
+}
+
+#else /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */
+int refclock_jupiter_bs;
+#endif /* not (REFCLOCK && CLOCK_JUPITER && HAVE_PPSAPI) */
diff --git a/ntpd/refclock_leitch.c b/ntpd/refclock_leitch.c
new file mode 100644
index 0000000..69ffdc5
--- /dev/null
+++ b/ntpd/refclock_leitch.c
@@ -0,0 +1,600 @@
+/*
+ * refclock_leitch - clock driver for the Leitch CSD-5300 Master Clock
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_LEITCH)
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "timevalops.h"
+#include "ntp_stdlib.h"
+
+
+/*
+ * Driver for Leitch CSD-5300 Master Clock System
+ *
+ * COMMANDS:
+ * DATE: D <CR>
+ * TIME: T <CR>
+ * STATUS: S <CR>
+ * LOOP: L <CR>
+ *
+ * FORMAT:
+ * DATE: YYMMDD<CR>
+ * TIME: <CR>/HHMMSS <CR>/HHMMSS <CR>/HHMMSS <CR>/
+ * second bondaried on the stop bit of the <CR>
+ * second boundaries at '/' above.
+ * STATUS: G (good), D (diag fail), T (time not provided) or
+ * P (last phone update failed)
+ */
+#define PRECISION (-20) /* 1x10-8 */
+#define MAXUNITS 1 /* max number of LEITCH units */
+#define LEITCHREFID "ATOM" /* reference id */
+#define LEITCH_DESCRIPTION "Leitch: CSD 5300 Master Clock System Driver"
+#define LEITCH232 "/dev/leitch%d" /* name of radio device */
+#define SPEED232 B300 /* uart speed (300 baud) */
+#ifdef DEBUG
+#define leitch_send(A,M) \
+if (debug) fprintf(stderr,"write leitch %s\n",M); \
+if ((write(A->leitchio.fd,M,sizeof(M)) < 0)) {\
+ if (debug) \
+ fprintf(stderr, "leitch_send: unit %d send failed\n", A->unit); \
+ else \
+ msyslog(LOG_ERR, "leitch_send: unit %d send failed %m",A->unit);}
+#else
+#define leitch_send(A,M) \
+if ((write(A->leitchio.fd,M,sizeof(M)) < 0)) {\
+ msyslog(LOG_ERR, "leitch_send: unit %d send failed %m",A->unit);}
+#endif
+
+#define STATE_IDLE 0
+#define STATE_DATE 1
+#define STATE_TIME1 2
+#define STATE_TIME2 3
+#define STATE_TIME3 4
+
+/*
+ * LEITCH unit control structure
+ */
+struct leitchunit {
+ struct peer *peer;
+ struct refclockio leitchio;
+ u_char unit;
+ short year;
+ short yearday;
+ short month;
+ short day;
+ short hour;
+ short second;
+ short minute;
+ short state;
+ u_short fudge1;
+ l_fp reftime1;
+ l_fp reftime2;
+ l_fp reftime3;
+ l_fp codetime1;
+ l_fp codetime2;
+ l_fp codetime3;
+ u_long yearstart;
+};
+
+/*
+ * Function prototypes
+ */
+static void leitch_init (void);
+static int leitch_start (int, struct peer *);
+static void leitch_shutdown (int, struct peer *);
+static void leitch_poll (int, struct peer *);
+static void leitch_control (int, const struct refclockstat *, struct refclockstat *, struct peer *);
+#define leitch_buginfo noentry
+static void leitch_receive (struct recvbuf *);
+static void leitch_process (struct leitchunit *);
+#if 0
+static void leitch_timeout (struct peer *);
+#endif
+static int leitch_get_date (struct recvbuf *, struct leitchunit *);
+static int leitch_get_time (struct recvbuf *, struct leitchunit *, int);
+static int days_per_year (int);
+
+static struct leitchunit leitchunits[MAXUNITS];
+static u_char unitinuse[MAXUNITS];
+static u_char stratumtouse[MAXUNITS];
+static u_int32 refid[MAXUNITS];
+
+static char days_in_month [] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_leitch = {
+ leitch_start, leitch_shutdown, leitch_poll,
+ leitch_control, leitch_init, leitch_buginfo, NOFLAGS
+};
+
+/*
+ * leitch_init - initialize internal leitch driver data
+ */
+static void
+leitch_init(void)
+{
+ int i;
+
+ memset((char*)leitchunits, 0, sizeof(leitchunits));
+ memset((char*)unitinuse, 0, sizeof(unitinuse));
+ for (i = 0; i < MAXUNITS; i++)
+ memcpy((char *)&refid[i], LEITCHREFID, 4);
+}
+
+/*
+ * leitch_shutdown - shut down a LEITCH clock
+ */
+static void
+leitch_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct leitchunit *leitch;
+
+ if (unit >= MAXUNITS) {
+ return;
+ }
+ leitch = &leitchunits[unit];
+ if (-1 != leitch->leitchio.fd)
+ io_closeclock(&leitch->leitchio);
+#ifdef DEBUG
+ if (debug)
+ fprintf(stderr, "leitch_shutdown()\n");
+#endif
+}
+
+/*
+ * leitch_poll - called by the transmit procedure
+ */
+static void
+leitch_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct leitchunit *leitch;
+
+ /* start the state machine rolling */
+
+#ifdef DEBUG
+ if (debug)
+ fprintf(stderr, "leitch_poll()\n");
+#endif
+ if (unit >= MAXUNITS) {
+ /* XXXX syslog it */
+ return;
+ }
+
+ leitch = &leitchunits[unit];
+
+ if (leitch->state != STATE_IDLE) {
+ /* reset and wait for next poll */
+ /* XXXX syslog it */
+ leitch->state = STATE_IDLE;
+ } else {
+ leitch_send(leitch,"D\r");
+ leitch->state = STATE_DATE;
+ }
+}
+
+static void
+leitch_control(
+ int unit,
+ const struct refclockstat *in,
+ struct refclockstat *out,
+ struct peer *passed_peer
+ )
+{
+ if (unit >= MAXUNITS) {
+ msyslog(LOG_ERR,
+ "leitch_control: unit %d invalid", unit);
+ return;
+ }
+
+ if (in) {
+ if (in->haveflags & CLK_HAVEVAL1)
+ stratumtouse[unit] = (u_char)(in->fudgeval1);
+ if (in->haveflags & CLK_HAVEVAL2)
+ refid[unit] = in->fudgeval2;
+ if (unitinuse[unit]) {
+ struct peer *peer;
+
+ peer = (&leitchunits[unit])->peer;
+ peer->stratum = stratumtouse[unit];
+ peer->refid = refid[unit];
+ }
+ }
+
+ if (out) {
+ memset((char *)out, 0, sizeof (struct refclockstat));
+ out->type = REFCLK_ATOM_LEITCH;
+ out->haveflags = CLK_HAVEVAL1 | CLK_HAVEVAL2;
+ out->fudgeval1 = (int32)stratumtouse[unit];
+ out->fudgeval2 = refid[unit];
+ out->p_lastcode = "";
+ out->clockdesc = LEITCH_DESCRIPTION;
+ }
+}
+
+/*
+ * leitch_start - open the LEITCH devices and initialize data for processing
+ */
+static int
+leitch_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct leitchunit *leitch;
+ int fd232;
+ char leitchdev[20];
+
+ /*
+ * Check configuration info.
+ */
+ if (unit >= MAXUNITS) {
+ msyslog(LOG_ERR, "leitch_start: unit %d invalid", unit);
+ return (0);
+ }
+
+ if (unitinuse[unit]) {
+ msyslog(LOG_ERR, "leitch_start: unit %d in use", unit);
+ return (0);
+ }
+
+ /*
+ * Open serial port.
+ */
+ snprintf(leitchdev, sizeof(leitchdev), LEITCH232, unit);
+ fd232 = open(leitchdev, O_RDWR, 0777);
+ if (fd232 == -1) {
+ msyslog(LOG_ERR,
+ "leitch_start: open of %s: %m", leitchdev);
+ return (0);
+ }
+
+ leitch = &leitchunits[unit];
+ memset(leitch, 0, sizeof(*leitch));
+
+#if defined(HAVE_SYSV_TTYS)
+ /*
+ * System V serial line parameters (termio interface)
+ *
+ */
+ { struct termio ttyb;
+ if (ioctl(fd232, TCGETA, &ttyb) < 0) {
+ msyslog(LOG_ERR,
+ "leitch_start: ioctl(%s, TCGETA): %m", leitchdev);
+ goto screwed;
+ }
+ ttyb.c_iflag = IGNBRK|IGNPAR|ICRNL;
+ ttyb.c_oflag = 0;
+ ttyb.c_cflag = SPEED232|CS8|CLOCAL|CREAD;
+ ttyb.c_lflag = ICANON;
+ ttyb.c_cc[VERASE] = ttyb.c_cc[VKILL] = '\0';
+ if (ioctl(fd232, TCSETA, &ttyb) < 0) {
+ msyslog(LOG_ERR,
+ "leitch_start: ioctl(%s, TCSETA): %m", leitchdev);
+ goto screwed;
+ }
+ }
+#endif /* HAVE_SYSV_TTYS */
+#if defined(HAVE_TERMIOS)
+ /*
+ * POSIX serial line parameters (termios interface)
+ */
+ { struct termios ttyb, *ttyp;
+
+ ttyp = &ttyb;
+ if (tcgetattr(fd232, ttyp) < 0) {
+ msyslog(LOG_ERR,
+ "leitch_start: tcgetattr(%s): %m", leitchdev);
+ goto screwed;
+ }
+ ttyp->c_iflag = IGNBRK|IGNPAR|ICRNL;
+ ttyp->c_oflag = 0;
+ ttyp->c_cflag = SPEED232|CS8|CLOCAL|CREAD;
+ ttyp->c_lflag = ICANON;
+ ttyp->c_cc[VERASE] = ttyp->c_cc[VKILL] = '\0';
+ if (tcsetattr(fd232, TCSANOW, ttyp) < 0) {
+ msyslog(LOG_ERR,
+ "leitch_start: tcsetattr(%s): %m", leitchdev);
+ goto screwed;
+ }
+ if (tcflush(fd232, TCIOFLUSH) < 0) {
+ msyslog(LOG_ERR,
+ "leitch_start: tcflush(%s): %m", leitchdev);
+ goto screwed;
+ }
+ }
+#endif /* HAVE_TERMIOS */
+#if defined(HAVE_BSD_TTYS)
+ /*
+ * 4.3bsd serial line parameters (sgttyb interface)
+ */
+ {
+ struct sgttyb ttyb;
+
+ if (ioctl(fd232, TIOCGETP, &ttyb) < 0) {
+ msyslog(LOG_ERR,
+ "leitch_start: ioctl(%s, TIOCGETP): %m", leitchdev);
+ goto screwed;
+ }
+ ttyb.sg_ispeed = ttyb.sg_ospeed = SPEED232;
+ ttyb.sg_erase = ttyb.sg_kill = '\0';
+ ttyb.sg_flags = EVENP|ODDP|CRMOD;
+ if (ioctl(fd232, TIOCSETP, &ttyb) < 0) {
+ msyslog(LOG_ERR,
+ "leitch_start: ioctl(%s, TIOCSETP): %m", leitchdev);
+ goto screwed;
+ }
+ }
+#endif /* HAVE_BSD_TTYS */
+
+ /*
+ * Set up the structures
+ */
+ leitch->peer = peer;
+ leitch->unit = unit;
+ leitch->state = STATE_IDLE;
+ leitch->fudge1 = 15; /* 15ms */
+
+ leitch->leitchio.clock_recv = leitch_receive;
+ leitch->leitchio.srcclock = peer;
+ leitch->leitchio.datalen = 0;
+ leitch->leitchio.fd = fd232;
+ if (!io_addclock(&leitch->leitchio)) {
+ leitch->leitchio.fd = -1;
+ goto screwed;
+ }
+
+ /*
+ * All done. Initialize a few random peer variables, then
+ * return success.
+ */
+ peer->precision = PRECISION;
+ peer->stratum = stratumtouse[unit];
+ peer->refid = refid[unit];
+ unitinuse[unit] = 1;
+ return(1);
+
+ /*
+ * Something broke; abandon ship.
+ */
+ screwed:
+ close(fd232);
+ return(0);
+}
+
+/*
+ * leitch_receive - receive data from the serial interface on a leitch
+ * clock
+ */
+static void
+leitch_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct leitchunit *leitch = rbufp->recv_peer->procptr->unitptr;
+
+#ifdef DEBUG
+ if (debug)
+ fprintf(stderr, "leitch_recieve(%*.*s)\n",
+ rbufp->recv_length, rbufp->recv_length,
+ rbufp->recv_buffer);
+#endif
+ if (rbufp->recv_length != 7)
+ return; /* The date is return with a trailing newline,
+ discard it. */
+
+ switch (leitch->state) {
+ case STATE_IDLE: /* unexpected, discard and resync */
+ return;
+ case STATE_DATE:
+ if (!leitch_get_date(rbufp,leitch)) {
+ leitch->state = STATE_IDLE;
+ break;
+ }
+ leitch_send(leitch,"T\r");
+#ifdef DEBUG
+ if (debug)
+ fprintf(stderr, "%u\n",leitch->yearday);
+#endif
+ leitch->state = STATE_TIME1;
+ break;
+ case STATE_TIME1:
+ if (!leitch_get_time(rbufp,leitch,1)) {
+ }
+ if (!clocktime(leitch->yearday,leitch->hour,leitch->minute,
+ leitch->second, 1, rbufp->recv_time.l_ui,
+ &leitch->yearstart, &leitch->reftime1.l_ui)) {
+ leitch->state = STATE_IDLE;
+ break;
+ }
+ leitch->reftime1.l_uf = 0;
+#ifdef DEBUG
+ if (debug)
+ fprintf(stderr, "%lu\n", (u_long)leitch->reftime1.l_ui);
+#endif
+ MSUTOTSF(leitch->fudge1, leitch->reftime1.l_uf);
+ leitch->codetime1 = rbufp->recv_time;
+ leitch->state = STATE_TIME2;
+ break;
+ case STATE_TIME2:
+ if (!leitch_get_time(rbufp,leitch,2)) {
+ }
+ if (!clocktime(leitch->yearday,leitch->hour,leitch->minute,
+ leitch->second, 1, rbufp->recv_time.l_ui,
+ &leitch->yearstart, &leitch->reftime2.l_ui)) {
+ leitch->state = STATE_IDLE;
+ break;
+ }
+#ifdef DEBUG
+ if (debug)
+ fprintf(stderr, "%lu\n", (u_long)leitch->reftime2.l_ui);
+#endif
+ MSUTOTSF(leitch->fudge1, leitch->reftime2.l_uf);
+ leitch->codetime2 = rbufp->recv_time;
+ leitch->state = STATE_TIME3;
+ break;
+ case STATE_TIME3:
+ if (!leitch_get_time(rbufp,leitch,3)) {
+ }
+ if (!clocktime(leitch->yearday,leitch->hour,leitch->minute,
+ leitch->second, GMT, rbufp->recv_time.l_ui,
+ &leitch->yearstart, &leitch->reftime3.l_ui)) {
+ leitch->state = STATE_IDLE;
+ break;
+ }
+#ifdef DEBUG
+ if (debug)
+ fprintf(stderr, "%lu\n", (u_long)leitch->reftime3.l_ui);
+#endif
+ MSUTOTSF(leitch->fudge1, leitch->reftime3.l_uf);
+ leitch->codetime3 = rbufp->recv_time;
+ leitch_process(leitch);
+ leitch->state = STATE_IDLE;
+ break;
+ default:
+ msyslog(LOG_ERR,
+ "leitech_receive: invalid state %d unit %d",
+ leitch->state, leitch->unit);
+ }
+}
+
+/*
+ * leitch_process - process a pile of samples from the clock
+ *
+ * This routine uses a three-stage median filter to calculate offset and
+ * dispersion. reduce jitter. The dispersion is calculated as the span
+ * of the filter (max - min), unless the quality character (format 2) is
+ * non-blank, in which case the dispersion is calculated on the basis of
+ * the inherent tolerance of the internal radio oscillator, which is
+ * +-2e-5 according to the radio specifications.
+ */
+static void
+leitch_process(
+ struct leitchunit *leitch
+ )
+{
+ l_fp off;
+ l_fp tmp_fp;
+ /*double doffset;*/
+
+ off = leitch->reftime1;
+ L_SUB(&off,&leitch->codetime1);
+ tmp_fp = leitch->reftime2;
+ L_SUB(&tmp_fp,&leitch->codetime2);
+ if (L_ISGEQ(&off,&tmp_fp))
+ off = tmp_fp;
+ tmp_fp = leitch->reftime3;
+ L_SUB(&tmp_fp,&leitch->codetime3);
+
+ if (L_ISGEQ(&off,&tmp_fp))
+ off = tmp_fp;
+ /*LFPTOD(&off, doffset);*/
+ refclock_receive(leitch->peer);
+}
+
+/*
+ * days_per_year
+ */
+static int
+days_per_year(
+ int year
+ )
+{
+ if (year%4) { /* not a potential leap year */
+ return (365);
+ } else {
+ if (year % 100) { /* is a leap year */
+ return (366);
+ } else {
+ if (year % 400) {
+ return (365);
+ } else {
+ return (366);
+ }
+ }
+ }
+}
+
+static int
+leitch_get_date(
+ struct recvbuf *rbufp,
+ struct leitchunit *leitch
+ )
+{
+ int i;
+
+ if (rbufp->recv_length < 6)
+ return(0);
+#undef BAD /* confict: defined as (-1) in AIX sys/param.h */
+#define BAD(A) (rbufp->recv_buffer[A] < '0') || (rbufp->recv_buffer[A] > '9')
+ if (BAD(0)||BAD(1)||BAD(2)||BAD(3)||BAD(4)||BAD(5))
+ return(0);
+#define ATOB(A) ((rbufp->recv_buffer[A])-'0')
+ leitch->year = ATOB(0)*10 + ATOB(1);
+ leitch->month = ATOB(2)*10 + ATOB(3);
+ leitch->day = ATOB(4)*10 + ATOB(5);
+
+ /* sanity checks */
+ if (leitch->month > 12)
+ return(0);
+ if (leitch->day > days_in_month[leitch->month-1])
+ return(0);
+
+ /* calculate yearday */
+ i = 0;
+ leitch->yearday = leitch->day;
+
+ while ( i < (leitch->month-1) )
+ leitch->yearday += days_in_month[i++];
+
+ if ((days_per_year((leitch->year>90?1900:2000)+leitch->year)==365) &&
+ leitch->month > 2)
+ leitch->yearday--;
+
+ return(1);
+}
+
+/*
+ * leitch_get_time
+ */
+static int
+leitch_get_time(
+ struct recvbuf *rbufp,
+ struct leitchunit *leitch,
+ int which
+ )
+{
+ if (BAD(0)||BAD(1)||BAD(2)||BAD(3)||BAD(4)||BAD(5))
+ return(0);
+ leitch->hour = ATOB(0)*10 +ATOB(1);
+ leitch->minute = ATOB(2)*10 +ATOB(3);
+ leitch->second = ATOB(4)*10 +ATOB(5);
+
+ if ((leitch->hour > 23) || (leitch->minute > 60) ||
+ (leitch->second > 60))
+ return(0);
+ return(1);
+}
+
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_local.c b/ntpd/refclock_local.c
new file mode 100644
index 0000000..d1b2871
--- /dev/null
+++ b/ntpd/refclock_local.c
@@ -0,0 +1,230 @@
+
+/*
+ * refclock_local - local pseudo-clock driver
+ *
+ * wjm 17-aug-1995: add a hook for special treatment of VMS_LOCALUNIT
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef REFCLOCK
+
+#include "ntpd.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#ifdef KERNEL_PLL
+#include "ntp_syscall.h"
+#endif
+
+/*
+ * This is a hack to allow a machine to use its own system clock as a
+ * reference clock, i.e., to free-run using no outside clock discipline
+ * source. Note that the clock selection algorithm will not select this
+ * driver unless all other sources of synchronization have been lost.
+ * This is useful if you want to use NTP in an isolated environment
+ * with no radio clock or NIST modem available. Pick a machine that you
+ * figure has a good clock oscillator and configure it with this
+ * driver. Set the clock using the best means available, like
+ * eyeball-and-wristwatch. Then, point all the other machines at this
+ * one or use broadcast (not multicast) mode to distribute time.
+ *
+ * Another application for this driver is if you want to use a
+ * particular server's clock as the clock of last resort when all other
+ * normal synchronization sources have gone away. This is especially
+ * useful if that server has an ovenized oscillator. However, the
+ * preferred was to do this is using orphan mode. See the documentation.
+ *
+ * A third application for this driver is when an external discipline
+ * source is available, such as the NIST "lockclock" program, which
+ * synchronizes the local clock via a telephone modem and the NIST
+ * Automated Computer Time Service (ACTS), or the Digital Time
+ * Synchronization Service (DTSS), which runs on DCE machines. In this
+ * case the stratum should be set at zero, indicating a bona fide
+ * stratum-1 source. Exercise some caution with this, since there is no
+ * easy way to telegraph via NTP that something might be wrong in the
+ * discipline source itself. In the case of DTSS, the local clock can
+ * have a rather large jitter, depending on the interval between
+ * corrections and the intrinsic frequency error of the clock
+ * oscillator. In extreme cases, this can cause clients to exceed the
+ * 128-ms slew window and drop off the NTP subnet.
+ *
+ * Fudge Factors
+ *
+ * If fudge flag1 is lit, the leap second bit is set in the peer
+ * status word. It should be set early in the day of a leap second
+ * event and set dark on the day after the event.
+ *
+ * Note the fudge time1 and time2 have been deprecated. The fudge time1
+ * was intended to apply a bias offset. This can be done using the Unix
+ * date command. The fudge time2 was intended to apply a bias frequency.
+ * This can be done using the frequency file and/or the freq
+ * configuration command.
+ */
+/*
+ * Local interface definitions
+ */
+#define PRECISION (-7) /* about 10 ms precision */
+#define DESCRIPTION "Undisciplined local clock" /* WRU */
+#define STRATUM 5 /* default stratum */
+#define DISPERSION .01 /* default dispersion (10 ms) */
+
+/*
+ * Imported from the timer module
+ */
+extern u_long current_time;
+
+/*
+ * Imported from ntp_proto
+ */
+extern s_char sys_precision;
+
+/*
+ * Function prototypes
+ */
+static int local_start (int, struct peer *);
+static void local_poll (int, struct peer *);
+
+/*
+ * Local variables
+ */
+static u_long poll_time; /* last time polled */
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_local = {
+ local_start, /* start up driver */
+ noentry, /* shut down driver (not used) */
+ local_poll, /* transmit poll message */
+ noentry, /* not used (old lcl_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old lcl_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * local_start - start up the clock
+ */
+static int
+local_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = sys_precision;
+ pp->leap = LEAP_NOTINSYNC;
+ peer->stratum = STRATUM;
+ pp->stratum = STRATUM;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, "LOCL", 4);
+ poll_time = current_time;
+ return (1);
+}
+
+
+/*
+ * local_poll - called by the transmit procedure
+ *
+ * LOCKCLOCK: If the kernel supports the nanokernel or microkernel
+ * system calls, the leap bits are extracted from the kernel. If there
+ * is a kernel error or the kernel leap bits are set to 11, the NTP leap
+ * bits are set to 11 and the stratum is set to infinity. Otherwise, the
+ * NTP leap bits are set to the kernel leap bits and the stratum is set
+ * as fudged. This behavior does not faithfully follow the
+ * specification, but is probably more appropriate in a multiple-server
+ * national laboratory network.
+ */
+static void
+local_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+#if defined(KERNEL_PLL) && defined(LOCKCLOCK)
+ struct timex ntv;
+#endif /* KERNEL_PLL LOCKCLOCK */
+ struct refclockproc *pp;
+
+ /*
+ * Do no evil unless the house is dark or lit with our own lamp.
+ */
+ if (!(sys_peer == NULL || sys_peer == peer))
+ return;
+
+#if defined(VMS) && defined(VMS_LOCALUNIT)
+ if (unit == VMS_LOCALUNIT) {
+ extern void vms_local_poll(struct peer *);
+
+ vms_local_poll(peer);
+ return;
+ }
+#endif /* VMS && VMS_LOCALUNIT */
+
+ pp = peer->procptr;
+ pp->polls++;
+
+ /*
+ * Ramble through the usual filtering and grooming code, which
+ * is essentially a no-op and included mostly for pretty
+ * billboards. We allow a one-time time adjustment using fudge
+ * time1 (s) and a continuous frequency adjustment using fudge
+ * time 2 (ppm).
+ */
+ poll_time = current_time;
+ refclock_process_offset(pp, pp->lastrec, pp->lastrec, 0);
+
+ /*
+ * If another process is disciplining the system clock, we set
+ * the leap bits and quality indicators from the kernel.
+ */
+#if defined(KERNEL_PLL) && defined(LOCKCLOCK)
+ memset(&ntv, 0, sizeof ntv);
+ switch (ntp_adjtime(&ntv)) {
+ case TIME_OK:
+ pp->leap = LEAP_NOWARNING;
+ peer->stratum = pp->stratum;
+ break;
+
+ case TIME_INS:
+ pp->leap = LEAP_ADDSECOND;
+ peer->stratum = pp->stratum;
+ break;
+
+ case TIME_DEL:
+ pp->leap = LEAP_DELSECOND;
+ peer->stratum = pp->stratum;
+ break;
+
+ default:
+ pp->leap = LEAP_NOTINSYNC;
+ peer->stratum = STRATUM_UNSPEC;
+ }
+ pp->disp = 0;
+ pp->jitter = 0;
+#else /* KERNEL_PLL LOCKCLOCK */
+ if (pp->sloppyclockflag & CLK_FLAG1)
+ pp->leap = LEAP_ADDSECOND;
+ else
+ pp->leap = LEAP_NOWARNING;
+ pp->disp = DISPERSION;
+ pp->jitter = 0;
+#endif /* KERNEL_PLL LOCKCLOCK */
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+}
+#else
+int refclock_local_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_msfees.c b/ntpd/refclock_msfees.c
new file mode 100644
index 0000000..8399c96
--- /dev/null
+++ b/ntpd/refclock_msfees.c
@@ -0,0 +1,1450 @@
+/* refclock_ees - clock driver for the EES M201 receiver */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_MSFEES) && defined(PPS)
+
+/* Currently REQUIRES STREAM and PPSCD. CLK and CBREAK modes
+ * were removed as the code was overly hairy, they weren't in use
+ * (hence probably didn't work). Still in RCS file at cl.cam.ac.uk
+ */
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "timevalops.h"
+
+#include <ctype.h>
+#if defined(HAVE_BSD_TTYS)
+#include <sgtty.h>
+#endif /* HAVE_BSD_TTYS */
+#if defined(HAVE_SYSV_TTYS)
+#include <termio.h>
+#endif /* HAVE_SYSV_TTYS */
+#if defined(HAVE_TERMIOS)
+#include <termios.h>
+#endif
+#if defined(STREAM)
+#include <stropts.h>
+#endif
+
+#ifdef HAVE_SYS_TERMIOS_H
+# include <sys/termios.h>
+#endif
+#ifdef HAVE_SYS_PPSCLOCK_H
+# include <sys/ppsclock.h>
+#endif
+
+#include "ntp_stdlib.h"
+
+int dbg = 0;
+/*
+ fudgefactor = fudgetime1;
+ os_delay = fudgetime2;
+ offset_fudge = os_delay + fudgefactor + inherent_delay;
+ stratumtouse = fudgeval1 & 0xf
+ dbg = fudgeval2;
+ sloppyclockflag = flags & CLK_FLAG1;
+ 1 log smoothing summary when processing sample
+ 4 dump the buffer from the clock
+ 8 EIOGETKD the last n uS time stamps
+ if (flags & CLK_FLAG2 && unitinuse) ees->leaphold = 0;
+ ees->dump_vals = flags & CLK_FLAG3;
+ ees->usealldata = flags & CLK_FLAG4;
+
+
+ bug->values[0] = (ees->lasttime) ? current_time - ees->lasttime : 0;
+ bug->values[1] = (ees->clocklastgood)?current_time-ees->clocklastgood:0;
+ bug->values[2] = (u_long)ees->status;
+ bug->values[3] = (u_long)ees->lastevent;
+ bug->values[4] = (u_long)ees->reason;
+ bug->values[5] = (u_long)ees->nsamples;
+ bug->values[6] = (u_long)ees->codestate;
+ bug->values[7] = (u_long)ees->day;
+ bug->values[8] = (u_long)ees->hour;
+ bug->values[9] = (u_long)ees->minute;
+ bug->values[10] = (u_long)ees->second;
+ bug->values[11] = (u_long)ees->tz;
+ bug->values[12] = ees->yearstart;
+ bug->values[13] = (ees->leaphold > current_time) ?
+ ees->leaphold - current_time : 0;
+ bug->values[14] = inherent_delay[unit].l_uf;
+ bug->values[15] = offset_fudge[unit].l_uf;
+
+ bug->times[0] = ees->reftime;
+ bug->times[1] = ees->arrvtime;
+ bug->times[2] = ees->lastsampletime;
+ bug->times[3] = ees->offset;
+ bug->times[4] = ees->lowoffset;
+ bug->times[5] = ees->highoffset;
+ bug->times[6] = inherent_delay[unit];
+ bug->times[8] = os_delay[unit];
+ bug->times[7] = fudgefactor[unit];
+ bug->times[9] = offset_fudge[unit];
+ bug->times[10]= ees->yearstart, 0;
+ */
+
+/* This should support the use of an EES M201 receiver with RS232
+ * output (modified to transmit time once per second).
+ *
+ * For the format of the message sent by the clock, see the EESM_
+ * definitions below.
+ *
+ * It appears to run free for an integral number of minutes, until the error
+ * reaches 4mS, at which point it steps at second = 01.
+ * It appears that sometimes it steps 4mS (say at 7 min interval),
+ * then the next minute it decides that it was an error, so steps back.
+ * On the next minute it steps forward again :-(
+ * This is typically 16.5uS/S then 3975uS at the 4min re-sync,
+ * or 9.5uS/S then 3990.5uS at a 7min re-sync,
+ * at which point it may lose the "00" second time stamp.
+ * I assume that the most accurate time is just AFTER the re-sync.
+ * Hence remember the last cycle interval,
+ *
+ * Can run in any one of:
+ *
+ * PPSCD PPS signal sets CD which interupts, and grabs the current TOD
+ * (sun) *in the interupt code*, so as to avoid problems with
+ * the STREAMS scheduling.
+ *
+ * It appears that it goes 16.5 uS slow each second, then every 4 mins it
+ * generates no "00" second tick, and gains 3975 uS. Ho Hum ! (93/2/7)
+ */
+
+/* Definitions */
+#ifndef MAXUNITS
+#define MAXUNITS 4 /* maximum number of EES units permitted */
+#endif
+
+#ifndef EES232
+#define EES232 "/dev/ees%d" /* Device to open to read the data */
+#endif
+
+/* Other constant stuff */
+#ifndef EESPRECISION
+#define EESPRECISION (-10) /* what the heck - 2**-10 = 1ms */
+#endif
+#ifndef EESREFID
+#define EESREFID "MSF\0" /* String to identify the clock */
+#endif
+#ifndef EESHSREFID
+#define EESHSREFID (0x7f7f0000 | ((REFCLK_MSF_EES) << 8)) /* Numeric refid */
+#endif
+
+/* Description of clock */
+#define EESDESCRIPTION "EES M201 MSF Receiver"
+
+/* Speed we run the clock port at. If this is changed the UARTDELAY
+ * value should be recomputed to suit.
+ */
+#ifndef SPEED232
+#define SPEED232 B9600 /* 9600 baud */
+#endif
+
+/* What is the inherent delay for this mode of working, i.e. when is the
+ * data time stamped.
+ */
+#define SAFETY_SHIFT 10 /* Split the shift to avoid overflow */
+#define BITS_TO_L_FP(bits, baud) \
+(((((bits)*2 +1) << (FRACTION_PREC-SAFETY_SHIFT)) / (2*baud)) << SAFETY_SHIFT)
+#define INH_DELAY_CBREAK BITS_TO_L_FP(119, 9600)
+#define INH_DELAY_PPS BITS_TO_L_FP( 0, 9600)
+
+#ifndef STREAM_PP1
+#define STREAM_PP1 "ppsclocd\0<-- patch space for module name1 -->"
+#endif
+#ifndef STREAM_PP2
+#define STREAM_PP2 "ppsclock\0<-- patch space for module name2 -->"
+#endif
+
+ /* Offsets of the bytes of the serial line code. The clock gives
+ * local time with a GMT/BST indication. The EESM_ definitions
+ * give offsets into ees->lastcode.
+ */
+#define EESM_CSEC 0 /* centiseconds - always zero in our clock */
+#define EESM_SEC 1 /* seconds in BCD */
+#define EESM_MIN 2 /* minutes in BCD */
+#define EESM_HOUR 3 /* hours in BCD */
+#define EESM_DAYWK 4 /* day of week (Sun = 0 etc) */
+#define EESM_DAY 5 /* day of month in BCD */
+#define EESM_MON 6 /* month in BCD */
+#define EESM_YEAR 7 /* year MOD 100 in BCD */
+#define EESM_LEAP 8 /* 0x0f if leap year, otherwise zero */
+#define EESM_BST 9 /* 0x03 if BST, 0x00 if GMT */
+#define EESM_MSFOK 10 /* 0x3f if radio good, otherwise zero */
+ /* followed by a frame alignment byte (0xff) /
+ / which is not put into the lastcode buffer*/
+
+/* Length of the serial time code, in characters. The first length
+ * is less the frame alignment byte.
+ */
+#define LENEESPRT (EESM_MSFOK+1)
+#define LENEESCODE (LENEESPRT+1)
+
+ /* Code state. */
+#define EESCS_WAIT 0 /* waiting for start of timecode */
+#define EESCS_GOTSOME 1 /* have an incomplete time code buffered */
+
+ /* Default fudge factor and character to receive */
+#define DEFFUDGETIME 0 /* Default user supplied fudge factor */
+#ifndef DEFOSTIME
+#define DEFOSTIME 0 /* Default OS delay -- passed by Make ? */
+#endif
+#define DEFINHTIME INH_DELAY_PPS /* inherent delay due to sample point*/
+
+ /* Limits on things. Reduce the number of samples to SAMPLEREDUCE by median
+ * elimination. If we're running with an accurate clock, chose the BESTSAMPLE
+ * as the estimated offset, otherwise average the remainder.
+ */
+#define FULLSHIFT 6 /* NCODES root 2 */
+#define NCODES (1<< FULLSHIFT) /* 64 */
+#define REDUCESHIFT (FULLSHIFT -1) /* SAMPLEREDUCE root 2 */
+
+ /* Towards the high ( Why ?) end of half */
+#define BESTSAMPLE ((samplereduce * 3) /4) /* 24 */
+
+ /* Leap hold time. After a leap second the clock will no longer be
+ * reliable until it resynchronizes. Hope 40 minutes is enough. */
+#define EESLEAPHOLD (40 * 60)
+
+#define EES_STEP_F (1 << 24) /* the receiver steps in units of about 4ms */
+#define EES_STEP_F_GRACE (EES_STEP_F/8) /*Allow for slop of 1/8 which is .5ms*/
+#define EES_STEP_NOTE (1 << 21)/* Log any unexpected jumps, say .5 ms .... */
+#define EES_STEP_NOTES 50 /* Only do a limited number */
+#define MAX_STEP 16 /* Max number of steps to remember */
+
+ /* debug is a bit mask of debugging that is wanted */
+#define DB_SYSLOG_SMPLI 0x0001
+#define DB_SYSLOG_SMPLE 0x0002
+#define DB_SYSLOG_SMTHI 0x0004
+#define DB_SYSLOG_NSMTHE 0x0008
+#define DB_SYSLOG_NSMTHI 0x0010
+#define DB_SYSLOG_SMTHE 0x0020
+#define DB_PRINT_EV 0x0040
+#define DB_PRINT_CDT 0x0080
+#define DB_PRINT_CDTC 0x0100
+#define DB_SYSLOG_KEEPD 0x0800
+#define DB_SYSLOG_KEEPE 0x1000
+#define DB_LOG_DELTAS 0x2000
+#define DB_PRINT_DELTAS 0x4000
+#define DB_LOG_AWAITMORE 0x8000
+#define DB_LOG_SAMPLES 0x10000
+#define DB_NO_PPS 0x20000
+#define DB_INC_PPS 0x40000
+#define DB_DUMP_DELTAS 0x80000
+
+ struct eesunit { /* EES unit control structure. */
+ struct peer *peer; /* associated peer structure */
+ struct refclockio io; /* given to the I/O handler */
+ l_fp reftime; /* reference time */
+ l_fp lastsampletime; /* time as in txt from last EES msg */
+ l_fp arrvtime; /* Time at which pkt arrived */
+ l_fp codeoffsets[NCODES]; /* the time of arrival of 232 codes */
+ l_fp offset; /* chosen offset (for clkbug) */
+ l_fp lowoffset; /* lowest sample offset (for clkbug) */
+ l_fp highoffset; /* highest " " (for clkbug) */
+ char lastcode[LENEESCODE+6]; /* last time code we received */
+ u_long lasttime; /* last time clock heard from */
+ u_long clocklastgood; /* last time good radio seen */
+ u_char lencode; /* length of code in buffer */
+ u_char nsamples; /* number of samples we've collected */
+ u_char codestate; /* state of 232 code reception */
+ u_char unit; /* unit number for this guy */
+ u_char status; /* clock status */
+ u_char lastevent; /* last clock event */
+ u_char reason; /* reason for last abort */
+ u_char hour; /* hour of day */
+ u_char minute; /* minute of hour */
+ u_char second; /* seconds of minute */
+ char tz; /* timezone from clock */
+ u_char ttytype; /* method used */
+ u_char dump_vals; /* Should clock values be dumped */
+ u_char usealldata; /* Use ALL samples */
+ u_short day; /* day of year from last code */
+ u_long yearstart; /* start of current year */
+ u_long leaphold; /* time of leap hold expiry */
+ u_long badformat; /* number of bad format codes */
+ u_long baddata; /* number of invalid time codes */
+ u_long timestarted; /* time we started this */
+ long last_pps_no; /* The serial # of the last PPS */
+ char fix_pending; /* Is a "sync to time" pending ? */
+ /* Fine tuning - compensate for 4 mS ramping .... */
+ l_fp last_l; /* last time stamp */
+ u_char last_steps[MAX_STEP]; /* Most recent n steps */
+ int best_av_step; /* Best guess at average step */
+ char best_av_step_count; /* # of steps over used above */
+ char this_step; /* Current pos in buffer */
+ int last_step_late; /* How late the last step was (0-59) */
+ long jump_fsecs; /* # of fractions of a sec last jump */
+ u_long last_step; /* time of last step */
+ int last_step_secs; /* Number of seconds in last step */
+ int using_ramp; /* 1 -> noemal, -1 -> over stepped */
+ };
+#define last_sec last_l.l_ui
+#define last_sfsec last_l.l_f
+#define this_uisec ((ees->arrvtime).l_ui)
+#define this_sfsec ((ees->arrvtime).l_f)
+#define msec(x) ((x) / (1<<22))
+#define LAST_STEPS (sizeof ees->last_steps / sizeof ees->last_steps[0])
+#define subms(x) ((((((x < 0) ? (-(x)) : (x)) % (1<<22))/2) * 625) / (1<<(22 -5)))
+
+/* Bitmask for what methods to try to use -- currently only PPS enabled */
+#define T_CBREAK 1
+#define T_PPS 8
+/* macros to test above */
+#define is_cbreak(x) ((x)->ttytype & T_CBREAK)
+#define is_pps(x) ((x)->ttytype & T_PPS)
+#define is_any(x) ((x)->ttytype)
+
+#define CODEREASON 20 /* reason codes */
+
+/* Data space for the unit structures. Note that we allocate these on
+ * the fly, but never give them back. */
+static struct eesunit *eesunits[MAXUNITS];
+static u_char unitinuse[MAXUNITS];
+
+/* Keep the fudge factors separately so they can be set even
+ * when no clock is configured. */
+static l_fp inherent_delay[MAXUNITS]; /* when time stamp is taken */
+static l_fp fudgefactor[MAXUNITS]; /* fudgetime1 */
+static l_fp os_delay[MAXUNITS]; /* fudgetime2 */
+static l_fp offset_fudge[MAXUNITS]; /* Sum of above */
+static u_char stratumtouse[MAXUNITS];
+static u_char sloppyclockflag[MAXUNITS];
+
+static int deltas[60];
+
+static l_fp acceptable_slop; /* = { 0, 1 << (FRACTION_PREC -2) }; */
+static l_fp onesec; /* = { 1, 0 }; */
+
+#ifndef DUMP_BUF_SIZE /* Size of buffer to be used by dump_buf */
+#define DUMP_BUF_SIZE 10112
+#endif
+
+/* ees_reset - reset the count back to zero */
+#define ees_reset(ees) (ees)->nsamples = 0; \
+(ees)->codestate = EESCS_WAIT
+
+/* ees_event - record and report an event */
+#define ees_event(ees, evcode) if ((ees)->status != (u_char)(evcode)) \
+ees_report_event((ees), (evcode))
+
+ /* Find the precision of the system clock by reading it */
+#define USECS 1000000
+#define MINSTEP 5 /* some systems increment uS on each call */
+#define MAXLOOPS (USECS/9)
+
+/*
+ * Function prototypes
+ */
+
+static int msfees_start P((int unit, struct peer *peer));
+static void msfees_shutdown P((int unit, struct peer *peer));
+static void msfees_poll P((int unit, struct peer *peer));
+static void msfees_init P((void));
+static void dump_buf P((l_fp *coffs, int from, int to, char *text));
+static void ees_report_event P((struct eesunit *ees, int code));
+static void ees_receive P((struct recvbuf *rbufp));
+static void ees_process P((struct eesunit *ees));
+static int offcompare P((const void *va, const void *vb));
+
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_msfees = {
+ msfees_start, /* start up driver */
+ msfees_shutdown, /* shut down driver */
+ msfees_poll, /* transmit poll message */
+ noentry, /* not used */
+ msfees_init, /* initialize driver */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+
+static void
+dump_buf(
+ l_fp *coffs,
+ int from,
+ int to,
+ char *text
+ )
+{
+ char buff[DUMP_BUF_SIZE + 80];
+ int i;
+ register char *ptr = buff;
+
+ snprintf(buff, sizeof(buff), text);
+ for (i = from; i < to; i++) {
+ ptr += strlen(ptr);
+ if ((ptr - buff) > DUMP_BUF_SIZE) {
+ msyslog(LOG_DEBUG, "D: %s", buff);
+ ptr = buff;
+ }
+ snprintf(ptr, sizeof(buff) - (ptr - buff),
+ " %06d", ((int)coffs[i].l_f) / 4295);
+ }
+ msyslog(LOG_DEBUG, "D: %s", buff);
+}
+
+/* msfees_init - initialize internal ees driver data */
+static void
+msfees_init(void)
+{
+ register int i;
+ /* Just zero the data arrays */
+ memset((char *)eesunits, 0, sizeof eesunits);
+ memset((char *)unitinuse, 0, sizeof unitinuse);
+
+ acceptable_slop.l_ui = 0;
+ acceptable_slop.l_uf = 1 << (FRACTION_PREC -2);
+
+ onesec.l_ui = 1;
+ onesec.l_uf = 0;
+
+ /* Initialize fudge factors to default. */
+ for (i = 0; i < MAXUNITS; i++) {
+ fudgefactor[i].l_ui = 0;
+ fudgefactor[i].l_uf = DEFFUDGETIME;
+ os_delay[i].l_ui = 0;
+ os_delay[i].l_uf = DEFOSTIME;
+ inherent_delay[i].l_ui = 0;
+ inherent_delay[i].l_uf = DEFINHTIME;
+ offset_fudge[i] = os_delay[i];
+ L_ADD(&offset_fudge[i], &fudgefactor[i]);
+ L_ADD(&offset_fudge[i], &inherent_delay[i]);
+ stratumtouse[i] = 0;
+ sloppyclockflag[i] = 0;
+ }
+}
+
+
+/* msfees_start - open the EES devices and initialize data for processing */
+static int
+msfees_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct eesunit *ees;
+ register int i;
+ int fd232 = -1;
+ char eesdev[20];
+ struct termios ttyb, *ttyp;
+ struct refclockproc *pp;
+ pp = peer->procptr;
+
+ if (unit >= MAXUNITS) {
+ msyslog(LOG_ERR, "ees clock: unit number %d invalid (max %d)",
+ unit, MAXUNITS-1);
+ return 0;
+ }
+ if (unitinuse[unit]) {
+ msyslog(LOG_ERR, "ees clock: unit number %d in use", unit);
+ return 0;
+ }
+
+ /* Unit okay, attempt to open the devices. We do them both at
+ * once to make sure we can */
+ snprintf(eesdev, sizeof(eesdev), EES232, unit);
+
+ fd232 = open(eesdev, O_RDWR, 0777);
+ if (fd232 == -1) {
+ msyslog(LOG_ERR, "ees clock: open of %s failed: %m", eesdev);
+ return 0;
+ }
+
+#ifdef TIOCEXCL
+ /* Set for exclusive use */
+ if (ioctl(fd232, TIOCEXCL, (char *)0) < 0) {
+ msyslog(LOG_ERR, "ees clock: ioctl(%s, TIOCEXCL): %m", eesdev);
+ goto screwed;
+ }
+#endif
+
+ /* STRIPPED DOWN VERSION: Only PPS CD is supported at the moment */
+
+ /* Set port characteristics. If we don't have a STREAMS module or
+ * a clock line discipline, cooked mode is just usable, even though it
+ * strips the top bit. The only EES byte which uses the top
+ * bit is the year, and we don't use that anyway. If we do
+ * have the line discipline, we choose raw mode, and the
+ * line discipline code will block up the messages.
+ */
+
+ /* STIPPED DOWN VERSION: Only PPS CD is supported at the moment */
+
+ ttyp = &ttyb;
+ if (tcgetattr(fd232, ttyp) < 0) {
+ msyslog(LOG_ERR, "msfees_start: tcgetattr(%s): %m", eesdev);
+ goto screwed;
+ }
+
+ ttyp->c_iflag = IGNBRK|IGNPAR|ICRNL;
+ ttyp->c_cflag = SPEED232|CS8|CLOCAL|CREAD;
+ ttyp->c_oflag = 0;
+ ttyp->c_lflag = ICANON;
+ ttyp->c_cc[VERASE] = ttyp->c_cc[VKILL] = '\0';
+ if (tcsetattr(fd232, TCSANOW, ttyp) < 0) {
+ msyslog(LOG_ERR, "msfees_start: tcsetattr(%s): %m", eesdev);
+ goto screwed;
+ }
+
+ if (tcflush(fd232, TCIOFLUSH) < 0) {
+ msyslog(LOG_ERR, "msfees_start: tcflush(%s): %m", eesdev);
+ goto screwed;
+ }
+
+ inherent_delay[unit].l_uf = INH_DELAY_PPS;
+
+ /* offset fudge (how *late* the timestamp is) = fudge + os delays */
+ offset_fudge[unit] = os_delay[unit];
+ L_ADD(&offset_fudge[unit], &fudgefactor[unit]);
+ L_ADD(&offset_fudge[unit], &inherent_delay[unit]);
+
+ /* Looks like this might succeed. Find memory for the structure.
+ * Look to see if there are any unused ones, if not we malloc() one.
+ */
+ if (eesunits[unit] != 0) /* The one we want is okay */
+ ees = eesunits[unit];
+ else {
+ /* Look for an unused, but allocated struct */
+ for (i = 0; i < MAXUNITS; i++) {
+ if (!unitinuse[i] && eesunits[i] != 0)
+ break;
+ }
+
+ if (i < MAXUNITS) { /* Reclaim this one */
+ ees = eesunits[i];
+ eesunits[i] = 0;
+ } /* no spare -- make a new one */
+ else ees = (struct eesunit *) emalloc(sizeof(struct eesunit));
+ }
+ memset((char *)ees, 0, sizeof(struct eesunit));
+ eesunits[unit] = ees;
+
+ /* Set up the structures */
+ ees->peer = peer;
+ ees->unit = (u_char)unit;
+ ees->timestarted= current_time;
+ ees->ttytype = 0;
+ ees->io.clock_recv= ees_receive;
+ ees->io.srcclock= peer;
+ ees->io.datalen = 0;
+ ees->io.fd = fd232;
+
+ /* Okay. Push one of the two (linked into the kernel, or dynamically
+ * loaded) STREAMS module, and give it to the I/O code to start
+ * receiving stuff.
+ */
+
+#ifdef STREAM
+ {
+ int rc1;
+ /* Pop any existing onews first ... */
+ while (ioctl(fd232, I_POP, 0 ) >= 0) ;
+
+ /* Now try pushing either of the possible modules */
+ if ((rc1=ioctl(fd232, I_PUSH, STREAM_PP1)) < 0 &&
+ ioctl(fd232, I_PUSH, STREAM_PP2) < 0) {
+ msyslog(LOG_ERR,
+ "ees clock: Push of `%s' and `%s' to %s failed %m",
+ STREAM_PP1, STREAM_PP2, eesdev);
+ goto screwed;
+ }
+ else {
+ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO, "I: ees clock: PUSHed %s on %s",
+ (rc1 >= 0) ? STREAM_PP1 : STREAM_PP2, eesdev);
+ ees->ttytype |= T_PPS;
+ }
+ }
+#endif /* STREAM */
+
+ /* Add the clock */
+ if (!io_addclock(&ees->io)) {
+ /* Oh shit. Just close and return. */
+ msyslog(LOG_ERR, "ees clock: io_addclock(%s): %m", eesdev);
+ goto screwed;
+ }
+
+
+ /* All done. Initialize a few random peer variables, then
+ * return success. */
+ peer->precision = sys_precision;
+ peer->stratum = stratumtouse[unit];
+ if (stratumtouse[unit] <= 1) {
+ memcpy((char *)&pp->refid, EESREFID, 4);
+ if (unit > 0 && unit < 10)
+ ((char *)&pp->refid)[3] = '0' + unit;
+ } else {
+ peer->refid = htonl(EESHSREFID);
+ }
+ unitinuse[unit] = 1;
+ pp->unitptr = &eesunits[unit];
+ pp->clockdesc = EESDESCRIPTION;
+ msyslog(LOG_ERR, "ees clock: %s OK on %d", eesdev, unit);
+ return (1);
+
+ screwed:
+ if (fd232 != -1)
+ (void) close(fd232);
+ return (0);
+}
+
+
+/* msfees_shutdown - shut down a EES clock */
+static void
+msfees_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct eesunit *ees;
+
+ if (unit >= MAXUNITS) {
+ msyslog(LOG_ERR,
+ "ees clock: INTERNAL ERROR, unit number %d invalid (max %d)",
+ unit, MAXUNITS);
+ return;
+ }
+ if (!unitinuse[unit]) {
+ msyslog(LOG_ERR,
+ "ees clock: INTERNAL ERROR, unit number %d not in use", unit);
+ return;
+ }
+
+ /* Tell the I/O module to turn us off. We're history. */
+ ees = eesunits[unit];
+ io_closeclock(&ees->io);
+ unitinuse[unit] = 0;
+}
+
+
+/* ees_report_event - note the occurance of an event */
+static void
+ees_report_event(
+ struct eesunit *ees,
+ int code
+ )
+{
+ if (ees->status != (u_char)code) {
+ ees->status = (u_char)code;
+ if (code != CEVNT_NOMINAL)
+ ees->lastevent = (u_char)code;
+ /* Should report event to trap handler in here.
+ * Soon...
+ */
+ }
+}
+
+
+/* ees_receive - receive data from the serial interface on an EES clock */
+static void
+ees_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register int n_sample;
+ register int day;
+ register struct eesunit *ees;
+ register u_char *dpt; /* Data PoinTeR: move along ... */
+ register u_char *dpend; /* Points just *after* last data char */
+ register char *cp;
+ l_fp tmp;
+ int call_pps_sample = 0;
+ l_fp pps_arrvstamp;
+ int sincelast;
+ int pps_step = 0;
+ int suspect_4ms_step = 0;
+ struct ppsclockev ppsclockev;
+ long *ptr = (long *) &ppsclockev;
+ int rc;
+ int request;
+#ifdef HAVE_CIOGETEV
+ request = CIOGETEV;
+#endif
+#ifdef HAVE_TIOCGPPSEV
+ request = TIOCGPPSEV;
+#endif
+
+ /* Get the clock this applies to and a pointer to the data */
+ ees = (struct eesunit *)rbufp->recv_peer->procptr->unitptr;
+ dpt = (u_char *)&rbufp->recv_space;
+ dpend = dpt + rbufp->recv_length;
+ if ((dbg & DB_LOG_AWAITMORE) && (rbufp->recv_length != LENEESCODE))
+ printf("[%d] ", rbufp->recv_length);
+
+ /* Check out our state and process appropriately */
+ switch (ees->codestate) {
+ case EESCS_WAIT:
+ /* Set an initial guess at the timestamp as the recv time.
+ * If just running in CBREAK mode, we can't improve this.
+ * If we have the CLOCK Line Discipline, PPSCD, or sime such,
+ * then we will do better later ....
+ */
+ ees->arrvtime = rbufp->recv_time;
+ ees->codestate = EESCS_GOTSOME;
+ ees->lencode = 0;
+ /*FALLSTHROUGH*/
+
+ case EESCS_GOTSOME:
+ cp = &(ees->lastcode[ees->lencode]);
+
+ /* Gobble the bytes until the final (possibly stripped) 0xff */
+ while (dpt < dpend && (*dpt & 0x7f) != 0x7f) {
+ *cp++ = (char)*dpt++;
+ ees->lencode++;
+ /* Oh dear -- too many bytes .. */
+ if (ees->lencode > LENEESPRT) {
+ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO,
+ "I: ees clock: %d + %d > %d [%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x]",
+ ees->lencode, dpend - dpt, LENEESPRT,
+#define D(x) (ees->lastcode[x])
+ D(0), D(1), D(2), D(3), D(4), D(5), D(6),
+ D(7), D(8), D(9), D(10), D(11), D(12));
+#undef D
+ ees->badformat++;
+ ees->reason = CODEREASON + 1;
+ ees_event(ees, CEVNT_BADREPLY);
+ ees_reset(ees);
+ return;
+ }
+ }
+ /* Gave up because it was end of the buffer, rather than ff */
+ if (dpt == dpend) {
+ /* Incomplete. Wait for more. */
+ if (dbg & DB_LOG_AWAITMORE)
+ msyslog(LOG_INFO,
+ "I: ees clock %d: %p == %p: await more",
+ ees->unit, dpt, dpend);
+ return;
+ }
+
+ /* This shouldn't happen ... ! */
+ if ((*dpt & 0x7f) != 0x7f) {
+ msyslog(LOG_INFO, "I: ees clock: %0x & 0x7f != 0x7f", *dpt);
+ ees->badformat++;
+ ees->reason = CODEREASON + 2;
+ ees_event(ees, CEVNT_BADREPLY);
+ ees_reset(ees);
+ return;
+ }
+
+ /* Skip the 0xff */
+ dpt++;
+
+ /* Finally, got a complete buffer. Mainline code will
+ * continue on. */
+ cp = ees->lastcode;
+ break;
+
+ default:
+ msyslog(LOG_ERR, "ees clock: INTERNAL ERROR: %d state %d",
+ ees->unit, ees->codestate);
+ ees->reason = CODEREASON + 5;
+ ees_event(ees, CEVNT_FAULT);
+ ees_reset(ees);
+ return;
+ }
+
+ /* Boy! After all that crap, the lastcode buffer now contains
+ * something we hope will be a valid time code. Do length
+ * checks and sanity checks on constant data.
+ */
+ ees->codestate = EESCS_WAIT;
+ ees->lasttime = current_time;
+ if (ees->lencode != LENEESPRT) {
+ ees->badformat++;
+ ees->reason = CODEREASON + 6;
+ ees_event(ees, CEVNT_BADREPLY);
+ ees_reset(ees);
+ return;
+ }
+
+ cp = ees->lastcode;
+
+ /* Check that centisecond is zero */
+ if (cp[EESM_CSEC] != 0) {
+ ees->baddata++;
+ ees->reason = CODEREASON + 7;
+ ees_event(ees, CEVNT_BADREPLY);
+ ees_reset(ees);
+ return;
+ }
+
+ /* Check flag formats */
+ if (cp[EESM_LEAP] != 0 && cp[EESM_LEAP] != 0x0f) {
+ ees->badformat++;
+ ees->reason = CODEREASON + 8;
+ ees_event(ees, CEVNT_BADREPLY);
+ ees_reset(ees);
+ return;
+ }
+
+ if (cp[EESM_BST] != 0 && cp[EESM_BST] != 0x03) {
+ ees->badformat++;
+ ees->reason = CODEREASON + 9;
+ ees_event(ees, CEVNT_BADREPLY);
+ ees_reset(ees);
+ return;
+ }
+
+ if (cp[EESM_MSFOK] != 0 && cp[EESM_MSFOK] != 0x3f) {
+ ees->badformat++;
+ ees->reason = CODEREASON + 10;
+ ees_event(ees, CEVNT_BADREPLY);
+ ees_reset(ees);
+ return;
+ }
+
+ /* So far, so good. Compute day, hours, minutes, seconds,
+ * time zone. Do range checks on these.
+ */
+
+#define bcdunpack(val) ( (((val)>>4) & 0x0f) * 10 + ((val) & 0x0f) )
+#define istrue(x) ((x)?1:0)
+
+ ees->second = bcdunpack(cp[EESM_SEC]); /* second */
+ ees->minute = bcdunpack(cp[EESM_MIN]); /* minute */
+ ees->hour = bcdunpack(cp[EESM_HOUR]); /* hour */
+
+ day = bcdunpack(cp[EESM_DAY]); /* day of month */
+
+ switch (bcdunpack(cp[EESM_MON])) { /* month */
+
+ /* Add in lengths of all previous months. Add one more
+ if it is a leap year and after February.
+ */
+ case 12: day += NOV; /*FALLSTHROUGH*/
+ case 11: day += OCT; /*FALLSTHROUGH*/
+ case 10: day += SEP; /*FALLSTHROUGH*/
+ case 9: day += AUG; /*FALLSTHROUGH*/
+ case 8: day += JUL; /*FALLSTHROUGH*/
+ case 7: day += JUN; /*FALLSTHROUGH*/
+ case 6: day += MAY; /*FALLSTHROUGH*/
+ case 5: day += APR; /*FALLSTHROUGH*/
+ case 4: day += MAR; /*FALLSTHROUGH*/
+ case 3: day += FEB;
+ if (istrue(cp[EESM_LEAP])) day++; /*FALLSTHROUGH*/
+ case 2: day += JAN; /*FALLSTHROUGH*/
+ case 1: break;
+ default: ees->baddata++;
+ ees->reason = CODEREASON + 11;
+ ees_event(ees, CEVNT_BADDATE);
+ ees_reset(ees);
+ return;
+ }
+
+ ees->day = day;
+
+ /* Get timezone. The clocktime routine wants the number
+ * of hours to add to the delivered time to get UT.
+ * Currently -1 if BST flag set, 0 otherwise. This
+ * is the place to tweak things if double summer time
+ * ever happens.
+ */
+ ees->tz = istrue(cp[EESM_BST]) ? -1 : 0;
+
+ if (ees->day > 366 || ees->day < 1 ||
+ ees->hour > 23 || ees->minute > 59 || ees->second > 59) {
+ ees->baddata++;
+ ees->reason = CODEREASON + 12;
+ ees_event(ees, CEVNT_BADDATE);
+ ees_reset(ees);
+ return;
+ }
+
+ n_sample = ees->nsamples;
+
+ /* Now, compute the reference time value: text -> tmp.l_ui */
+ if (!clocktime(ees->day, ees->hour, ees->minute, ees->second,
+ ees->tz, rbufp->recv_time.l_ui, &ees->yearstart,
+ &tmp.l_ui)) {
+ ees->baddata++;
+ ees->reason = CODEREASON + 13;
+ ees_event(ees, CEVNT_BADDATE);
+ ees_reset(ees);
+ return;
+ }
+ tmp.l_uf = 0;
+
+ /* DON'T use ees->arrvtime -- it may be < reftime */
+ ees->lastsampletime = tmp;
+
+ /* If we are synchronised to the radio, update the reference time.
+ * Also keep a note of when clock was last good.
+ */
+ if (istrue(cp[EESM_MSFOK])) {
+ ees->reftime = tmp;
+ ees->clocklastgood = current_time;
+ }
+
+
+ /* Compute the offset. For the fractional part of the
+ * offset we use the expected delay for the message.
+ */
+ ees->codeoffsets[n_sample].l_ui = tmp.l_ui;
+ ees->codeoffsets[n_sample].l_uf = 0;
+
+ /* Number of seconds since the last step */
+ sincelast = this_uisec - ees->last_step;
+
+ memset((char *) &ppsclockev, 0, sizeof ppsclockev);
+
+ rc = ioctl(ees->io.fd, request, (char *) &ppsclockev);
+ if (dbg & DB_PRINT_EV) fprintf(stderr,
+ "[%x] CIOGETEV u%d %d (%x %d) gave %d (%d): %08lx %08lx %ld\n",
+ DB_PRINT_EV, ees->unit, ees->io.fd, request, is_pps(ees),
+ rc, errno, ptr[0], ptr[1], ptr[2]);
+
+ /* If we managed to get the time of arrival, process the info */
+ if (rc >= 0) {
+ int conv = -1;
+ pps_step = ppsclockev.serial - ees->last_pps_no;
+
+ /* Possible that PPS triggered, but text message didn't */
+ if (pps_step == 2) msyslog(LOG_ERR, "pps step = 2 @ %02d", ees->second);
+ if (pps_step == 2 && ees->second == 1) suspect_4ms_step |= 1;
+ if (pps_step == 2 && ees->second == 2) suspect_4ms_step |= 4;
+
+ /* allow for single loss of PPS only */
+ if (pps_step != 1 && pps_step != 2)
+ fprintf(stderr, "PPS step: %d too far off %ld (%d)\n",
+ ppsclockev.serial, ees->last_pps_no, pps_step);
+ else {
+ pps_arrvstamp = tval_stamp_to_lfp(ppsclockev.tv);
+ /* if ((ABS(time difference) - 0.25) < 0)
+ * then believe it ...
+ */
+ l_fp diff;
+ diff = pps_arrvstamp;
+ conv = 0;
+ L_SUB(&diff, &ees->arrvtime);
+ if (dbg & DB_PRINT_CDT)
+ printf("[%x] Have %lx.%08lx and %lx.%08lx -> %lx.%08lx @ %s",
+ DB_PRINT_CDT, (long)ees->arrvtime.l_ui, (long)ees->arrvtime.l_uf,
+ (long)pps_arrvstamp.l_ui, (long)pps_arrvstamp.l_uf,
+ (long)diff.l_ui, (long)diff.l_uf,
+ ctime(&(ppsclockev.tv.tv_sec)));
+ if (L_ISNEG(&diff)) M_NEG(diff.l_ui, diff.l_uf);
+ L_SUB(&diff, &acceptable_slop);
+ if (L_ISNEG(&diff)) { /* AOK -- pps_sample */
+ ees->arrvtime = pps_arrvstamp;
+ conv++;
+ call_pps_sample++;
+ }
+ /* Some loss of some signals around sec = 1 */
+ else if (ees->second == 1) {
+ diff = pps_arrvstamp;
+ L_ADD(&diff, &onesec);
+ L_SUB(&diff, &ees->arrvtime);
+ if (L_ISNEG(&diff)) M_NEG(diff.l_ui, diff.l_uf);
+ L_SUB(&diff, &acceptable_slop);
+ msyslog(LOG_ERR, "Have sec==1 slip %ds a=%08x-p=%08x -> %x.%08x (u=%d) %s",
+ pps_arrvstamp.l_ui - ees->arrvtime.l_ui,
+ pps_arrvstamp.l_uf,
+ ees->arrvtime.l_uf,
+ diff.l_ui, diff.l_uf,
+ (int)ppsclockev.tv.tv_usec,
+ ctime(&(ppsclockev.tv.tv_sec)));
+ if (L_ISNEG(&diff)) { /* AOK -- pps_sample */
+ suspect_4ms_step |= 2;
+ ees->arrvtime = pps_arrvstamp;
+ L_ADD(&ees->arrvtime, &onesec);
+ conv++;
+ call_pps_sample++;
+ }
+ }
+ }
+ ees->last_pps_no = ppsclockev.serial;
+ if (dbg & DB_PRINT_CDTC)
+ printf(
+ "[%x] %08lx %08lx %d u%d (%d %d)\n",
+ DB_PRINT_CDTC, (long)pps_arrvstamp.l_ui,
+ (long)pps_arrvstamp.l_uf, conv, ees->unit,
+ call_pps_sample, pps_step);
+ }
+
+ /* See if there has been a 4ms jump at a minute boundry */
+ { l_fp delta;
+#define delta_isec delta.l_ui
+#define delta_ssec delta.l_i
+#define delta_sfsec delta.l_f
+ long delta_f_abs;
+
+ delta.l_i = ees->arrvtime.l_i;
+ delta.l_f = ees->arrvtime.l_f;
+
+ L_SUB(&delta, &ees->last_l);
+ delta_f_abs = delta_sfsec;
+ if (delta_f_abs < 0) delta_f_abs = -delta_f_abs;
+
+ /* Dump the deltas each minute */
+ if (dbg & DB_DUMP_DELTAS)
+ {
+ if (/*0 <= ees->second && */
+ ees->second < COUNTOF(deltas))
+ deltas[ees->second] = delta_sfsec;
+ /* Dump on second 1, as second 0 sometimes missed */
+ if (ees->second == 1) {
+ char text[16 * COUNTOF(deltas)];
+ char *cptr=text;
+ int i;
+ for (i = 0; i < COUNTOF(deltas); i++) {
+ snprintf(cptr, sizeof(text) / COUNTOF(deltas),
+ " %d.%04d", msec(deltas[i]),
+ subms(deltas[i]));
+ cptr += strlen(cptr);
+ }
+ msyslog(LOG_ERR, "Deltas: %d.%04d<->%d.%04d: %s",
+ msec(EES_STEP_F - EES_STEP_F_GRACE), subms(EES_STEP_F - EES_STEP_F_GRACE),
+ msec(EES_STEP_F + EES_STEP_F_GRACE), subms(EES_STEP_F + EES_STEP_F_GRACE),
+ text+1);
+ for (i=0; i<((sizeof deltas) / (sizeof deltas[0])); i++) deltas[i] = 0;
+ }
+ }
+
+ /* Lets see if we have a 4 mS step at a minute boundaary */
+ if ( ((EES_STEP_F - EES_STEP_F_GRACE) < delta_f_abs) &&
+ (delta_f_abs < (EES_STEP_F + EES_STEP_F_GRACE)) &&
+ (ees->second == 0 || ees->second == 1 || ees->second == 2) &&
+ (sincelast < 0 || sincelast > 122)
+ ) { /* 4ms jump at min boundry */
+ int old_sincelast;
+ int count=0;
+ int sum = 0;
+ /* Yes -- so compute the ramp time */
+ if (ees->last_step == 0) sincelast = 0;
+ old_sincelast = sincelast;
+
+ /* First time in, just set "ees->last_step" */
+ if(ees->last_step) {
+ int other_step = 0;
+ int third_step = 0;
+ int this_step = (sincelast + (60 /2)) / 60;
+ int p_step = ees->this_step;
+ int p;
+ ees->last_steps[p_step] = this_step;
+ p= p_step;
+ p_step++;
+ if (p_step >= LAST_STEPS) p_step = 0;
+ ees->this_step = p_step;
+ /* Find the "average" interval */
+ while (p != p_step) {
+ int this = ees->last_steps[p];
+ if (this == 0) break;
+ if (this != this_step) {
+ if (other_step == 0 && (
+ this== (this_step +2) ||
+ this== (this_step -2) ||
+ this== (this_step +1) ||
+ this== (this_step -1)))
+ other_step = this;
+ if (other_step != this) {
+ int idelta = (this_step - other_step);
+ if (idelta < 0) idelta = - idelta;
+ if (third_step == 0 && (
+ (idelta == 1) ? (
+ this == (other_step +1) ||
+ this == (other_step -1) ||
+ this == (this_step +1) ||
+ this == (this_step -1))
+ :
+ (
+ this == (this_step + other_step)/2
+ )
+ )) third_step = this;
+ if (third_step != this) break;
+ }
+ }
+ sum += this;
+ p--;
+ if (p < 0) p += LAST_STEPS;
+ count++;
+ }
+ msyslog(LOG_ERR, "MSF%d: %d: This=%d (%d), other=%d/%d, sum=%d, count=%d, pps_step=%d, suspect=%x", ees->unit, p, ees->last_steps[p], this_step, other_step, third_step, sum, count, pps_step, suspect_4ms_step);
+ if (count != 0) sum = ((sum * 60) + (count /2)) / count;
+#define SV(x) (ees->last_steps[(x + p_step) % LAST_STEPS])
+ msyslog(LOG_ERR, "MSF%d: %x steps %d: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
+ ees->unit, suspect_4ms_step, p_step, SV(0), SV(1), SV(2), SV(3), SV(4), SV(5), SV(6),
+ SV(7), SV(8), SV(9), SV(10), SV(11), SV(12), SV(13), SV(14), SV(15));
+ printf("MSF%d: steps %d: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
+ ees->unit, p_step, SV(0), SV(1), SV(2), SV(3), SV(4), SV(5), SV(6),
+ SV(7), SV(8), SV(9), SV(10), SV(11), SV(12), SV(13), SV(14), SV(15));
+#undef SV
+ ees->jump_fsecs = delta_sfsec;
+ ees->using_ramp = 1;
+ if (sincelast > 170)
+ ees->last_step_late += sincelast - ((sum) ? sum : ees->last_step_secs);
+ else ees->last_step_late = 30;
+ if (ees->last_step_late < -60 || ees->last_step_late > 120) ees->last_step_late = 30;
+ if (ees->last_step_late < 0) ees->last_step_late = 0;
+ if (ees->last_step_late >= 60) ees->last_step_late = 59;
+ sincelast = 0;
+ }
+ else { /* First time in -- just save info */
+ ees->last_step_late = 30;
+ ees->jump_fsecs = delta_sfsec;
+ ees->using_ramp = 1;
+ sum = 4 * 60;
+ }
+ ees->last_step = this_uisec;
+ printf("MSF%d: d=%3ld.%04ld@%d :%d:%d:$%d:%d:%d\n",
+ ees->unit, (long)msec(delta_sfsec), (long)subms(delta_sfsec),
+ ees->second, old_sincelast, ees->last_step_late, count, sum,
+ ees->last_step_secs);
+ msyslog(LOG_ERR, "MSF%d: d=%3d.%04d@%d :%d:%d:%d:%d:%d",
+ ees->unit, msec(delta_sfsec), subms(delta_sfsec), ees->second,
+ old_sincelast, ees->last_step_late, count, sum, ees->last_step_secs);
+ if (sum) ees->last_step_secs = sum;
+ }
+ /* OK, so not a 4ms step at a minute boundry */
+ else {
+ if (suspect_4ms_step) msyslog(LOG_ERR,
+ "MSF%d: suspect = %x, but delta of %d.%04d [%d.%04d<%d.%04d<%d.%04d: %d %d]",
+ ees->unit, suspect_4ms_step, msec(delta_sfsec), subms(delta_sfsec),
+ msec(EES_STEP_F - EES_STEP_F_GRACE),
+ subms(EES_STEP_F - EES_STEP_F_GRACE),
+ (int)msec(delta_f_abs),
+ (int)subms(delta_f_abs),
+ msec(EES_STEP_F + EES_STEP_F_GRACE),
+ subms(EES_STEP_F + EES_STEP_F_GRACE),
+ ees->second,
+ sincelast);
+ if ((delta_f_abs > EES_STEP_NOTE) && ees->last_l.l_i) {
+ static int ees_step_notes = EES_STEP_NOTES;
+ if (ees_step_notes > 0) {
+ ees_step_notes--;
+ printf("MSF%d: D=%3ld.%04ld@%02d :%d%s\n",
+ ees->unit, (long)msec(delta_sfsec), (long)subms(delta_sfsec),
+ ees->second, sincelast, ees_step_notes ? "" : " -- NO MORE !");
+ msyslog(LOG_ERR, "MSF%d: D=%3d.%04d@%02d :%d%s",
+ ees->unit, msec(delta_sfsec), subms(delta_sfsec), ees->second, (ees->last_step) ? sincelast : -1, ees_step_notes ? "" : " -- NO MORE !");
+ }
+ }
+ }
+ }
+ ees->last_l = ees->arrvtime;
+
+ /* IF we have found that it's ramping
+ * && it's within twice the expected ramp period
+ * && there is a non zero step size (avoid /0 !)
+ * THEN we twiddle things
+ */
+ if (ees->using_ramp &&
+ sincelast < (ees->last_step_secs)*2 &&
+ ees->last_step_secs)
+ { long sec_of_ramp = sincelast + ees->last_step_late;
+ long fsecs;
+ l_fp inc;
+
+ /* Ramp time may vary, so may ramp for longer than last time */
+ if (sec_of_ramp > (ees->last_step_secs + 120))
+ sec_of_ramp = ees->last_step_secs;
+
+ /* sec_of_ramp * ees->jump_fsecs may overflow 2**32 */
+ fsecs = sec_of_ramp * (ees->jump_fsecs / ees->last_step_secs);
+
+ if (dbg & DB_LOG_DELTAS) msyslog(LOG_ERR,
+ "[%x] MSF%d: %3ld/%03d -> d=%11ld (%d|%ld)",
+ DB_LOG_DELTAS,
+ ees->unit, sec_of_ramp, ees->last_step_secs, fsecs,
+ pps_arrvstamp.l_f, pps_arrvstamp.l_f + fsecs);
+ if (dbg & DB_PRINT_DELTAS) printf(
+ "MSF%d: %3ld/%03d -> d=%11ld (%ld|%ld)\n",
+ ees->unit, sec_of_ramp, ees->last_step_secs, fsecs,
+ (long)pps_arrvstamp.l_f, pps_arrvstamp.l_f + fsecs);
+
+ /* Must sign extend the result */
+ inc.l_i = (fsecs < 0) ? -1 : 0;
+ inc.l_f = fsecs;
+ if (dbg & DB_INC_PPS)
+ { L_SUB(&pps_arrvstamp, &inc);
+ L_SUB(&ees->arrvtime, &inc);
+ }
+ else
+ { L_ADD(&pps_arrvstamp, &inc);
+ L_ADD(&ees->arrvtime, &inc);
+ }
+ }
+ else {
+ if (dbg & DB_LOG_DELTAS) msyslog(LOG_ERR,
+ "[%x] MSF%d: ees->using_ramp=%d, sincelast=%x / %x, ees->last_step_secs=%x",
+ DB_LOG_DELTAS,
+ ees->unit, ees->using_ramp,
+ sincelast,
+ (ees->last_step_secs)*2,
+ ees->last_step_secs);
+ if (dbg & DB_PRINT_DELTAS) printf(
+ "[%x] MSF%d: ees->using_ramp=%d, sincelast=%x / %x, ees->last_step_secs=%x\n",
+ DB_LOG_DELTAS,
+ ees->unit, ees->using_ramp,
+ sincelast,
+ (ees->last_step_secs)*2,
+ ees->last_step_secs);
+ }
+
+ L_SUB(&ees->arrvtime, &offset_fudge[ees->unit]);
+ L_SUB(&pps_arrvstamp, &offset_fudge[ees->unit]);
+
+ if (call_pps_sample && !(dbg & DB_NO_PPS)) {
+ /* Sigh -- it expects its args negated */
+ L_NEG(&pps_arrvstamp);
+ /*
+ * I had to disable this here, since it appears there is no pointer to the
+ * peer structure.
+ *
+ (void) pps_sample(peer, &pps_arrvstamp);
+ */
+ }
+
+ /* Subtract off the local clock time stamp */
+ L_SUB(&ees->codeoffsets[n_sample], &ees->arrvtime);
+ if (dbg & DB_LOG_SAMPLES) msyslog(LOG_ERR,
+ "MSF%d: [%x] %d (ees: %d %d) (pps: %d %d)%s",
+ ees->unit, DB_LOG_DELTAS, n_sample,
+ ees->codeoffsets[n_sample].l_f,
+ ees->codeoffsets[n_sample].l_f / 4295,
+ pps_arrvstamp.l_f,
+ pps_arrvstamp.l_f /4295,
+ (dbg & DB_NO_PPS) ? " [no PPS]" : "");
+
+ if (ees->nsamples++ == NCODES-1) ees_process(ees);
+
+ /* Done! */
+}
+
+
+/* offcompare - auxiliary comparison routine for offset sort */
+
+static int
+offcompare(
+ const void *va,
+ const void *vb
+ )
+{
+ const l_fp *a = (const l_fp *)va;
+ const l_fp *b = (const l_fp *)vb;
+ return(L_ISGEQ(a, b) ? (L_ISEQU(a, b) ? 0 : 1) : -1);
+}
+
+
+/* ees_process - process a pile of samples from the clock */
+static void
+ees_process(
+ struct eesunit *ees
+ )
+{
+ static int last_samples = -1;
+ register int i, j;
+ register int noff;
+ register l_fp *coffs = ees->codeoffsets;
+ l_fp offset, tmp;
+ double dispersion; /* ++++ */
+ int lostsync, isinsync;
+ int samples = ees->nsamples;
+ int samplelog = 0; /* keep "gcc -Wall" happy ! */
+ int samplereduce = (samples + 1) / 2;
+ double doffset;
+
+ /* Reset things to zero so we don't have to worry later */
+ ees_reset(ees);
+
+ if (sloppyclockflag[ees->unit]) {
+ samplelog = (samples < 2) ? 0 :
+ (samples < 5) ? 1 :
+ (samples < 9) ? 2 :
+ (samples < 17) ? 3 :
+ (samples < 33) ? 4 : 5;
+ samplereduce = (1 << samplelog);
+ }
+
+ if (samples != last_samples &&
+ ((samples != (last_samples-1)) || samples < 3)) {
+ msyslog(LOG_ERR, "Samples=%d (%d), samplereduce=%d ....",
+ samples, last_samples, samplereduce);
+ last_samples = samples;
+ }
+ if (samples < 1) return;
+
+ /* If requested, dump the raw data we have in the buffer */
+ if (ees->dump_vals)
+ dump_buf(coffs, 0, samples, "Raw data is:");
+
+ /* Sort the offsets, trim off the extremes, then choose one. */
+ qsort(coffs, (size_t)samples, sizeof(coffs[0]), offcompare);
+
+ noff = samples;
+ i = 0;
+ while ((noff - i) > samplereduce) {
+ /* Trim off the sample which is further away
+ * from the median. We work this out by doubling
+ * the median, subtracting off the end samples, and
+ * looking at the sign of the answer, using the
+ * identity (c-b)-(b-a) == 2*b-a-c
+ */
+ tmp = coffs[(noff + i)/2];
+ L_ADD(&tmp, &tmp);
+ L_SUB(&tmp, &coffs[i]);
+ L_SUB(&tmp, &coffs[noff-1]);
+ if (L_ISNEG(&tmp)) noff--; else i++;
+ }
+
+ /* If requested, dump the reduce data we have in the buffer */
+ if (ees->dump_vals) dump_buf(coffs, i, noff, "Reduced to:");
+
+ /* What we do next depends on the setting of the sloppy clock flag.
+ * If it is on, average the remainder to derive our estimate.
+ * Otherwise, just pick a representative value from the remaining stuff
+ */
+ if (sloppyclockflag[ees->unit]) {
+ offset.l_ui = offset.l_uf = 0;
+ for (j = i; j < noff; j++)
+ L_ADD(&offset, &coffs[j]);
+ for (j = samplelog; j > 0; j--)
+ L_RSHIFTU(&offset);
+ }
+ else offset = coffs[i+BESTSAMPLE];
+
+ /* Compute the dispersion as the difference between the
+ * lowest and highest offsets that remain in the
+ * consideration list.
+ *
+ * It looks like MOST clocks have MOD (max error), so halve it !
+ */
+ tmp = coffs[noff-1];
+ L_SUB(&tmp, &coffs[i]);
+#define FRACT_SEC(n) ((1 << 30) / (n/2))
+ dispersion = LFPTOFP(&tmp) / 2; /* ++++ */
+ if (dbg & (DB_SYSLOG_SMPLI | DB_SYSLOG_SMPLE)) msyslog(
+ (dbg & DB_SYSLOG_SMPLE) ? LOG_ERR : LOG_INFO,
+ "I: [%x] Offset=%06d (%d), disp=%f%s [%d], %d %d=%d %d:%d %d=%d %d",
+ dbg & (DB_SYSLOG_SMPLI | DB_SYSLOG_SMPLE),
+ offset.l_f / 4295, offset.l_f,
+ (dispersion * 1526) / 100,
+ (sloppyclockflag[ees->unit]) ? " by averaging" : "",
+ FRACT_SEC(10) / 4295,
+ (coffs[0].l_f) / 4295,
+ i,
+ (coffs[i].l_f) / 4295,
+ (coffs[samples/2].l_f) / 4295,
+ (coffs[i+BESTSAMPLE].l_f) / 4295,
+ noff-1,
+ (coffs[noff-1].l_f) / 4295,
+ (coffs[samples-1].l_f) / 4295);
+
+ /* Are we playing silly wotsits ?
+ * If we are using all data, see if there is a "small" delta,
+ * and if so, blurr this with 3/4 of the delta from the last value
+ */
+ if (ees->usealldata && ees->offset.l_uf) {
+ long diff = (long) (ees->offset.l_uf - offset.l_uf);
+
+ /* is the delta small enough ? */
+ if ((- FRACT_SEC(100)) < diff && diff < FRACT_SEC(100)) {
+ int samd = (64 * 4) / samples;
+ long new;
+ if (samd < 2) samd = 2;
+ new = offset.l_uf + ((diff * (samd -1)) / samd);
+
+ /* Sign change -> need to fix up int part */
+ if ((new & 0x80000000) !=
+ (((long) offset.l_uf) & 0x80000000))
+ { NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO, "I: %lx != %lx (%lx %lx), so add %d",
+ new & 0x80000000,
+ ((long) offset.l_uf) & 0x80000000,
+ new, (long) offset.l_uf,
+ (new < 0) ? -1 : 1);
+ offset.l_ui += (new < 0) ? -1 : 1;
+ }
+ dispersion /= 4;
+ if (dbg & (DB_SYSLOG_SMTHI | DB_SYSLOG_SMTHE)) msyslog(
+ (dbg & DB_SYSLOG_SMTHE) ? LOG_ERR : LOG_INFO,
+ "I: [%x] Smooth data: %ld -> %ld, dispersion now %f",
+ dbg & (DB_SYSLOG_SMTHI | DB_SYSLOG_SMTHE),
+ ((long) offset.l_uf) / 4295, new / 4295,
+ (dispersion * 1526) / 100);
+ offset.l_uf = (unsigned long) new;
+ }
+ else if (dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE)) msyslog(
+ (dbg & DB_SYSLOG_NSMTHE) ? LOG_ERR : LOG_INFO,
+ "[%x] No smooth as delta not %d < %ld < %d",
+ dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE),
+ - FRACT_SEC(100), diff, FRACT_SEC(100));
+ }
+ else if (dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE)) msyslog(
+ (dbg & DB_SYSLOG_NSMTHE) ? LOG_ERR : LOG_INFO,
+ "I: [%x] No smooth as flag=%x and old=%x=%d (%d:%d)",
+ dbg & (DB_SYSLOG_NSMTHI | DB_SYSLOG_NSMTHE),
+ ees->usealldata, ees->offset.l_f, ees->offset.l_uf,
+ offset.l_f, ees->offset.l_f - offset.l_f);
+
+ /* Collect offset info for debugging info */
+ ees->offset = offset;
+ ees->lowoffset = coffs[i];
+ ees->highoffset = coffs[noff-1];
+
+ /* Determine synchronization status. Can be unsync'd either
+ * by a report from the clock or by a leap hold.
+ *
+ * Loss of the radio signal for a short time does not cause
+ * us to go unsynchronised, since the receiver keeps quite
+ * good time on its own. The spec says 20ms in 4 hours; the
+ * observed drift in our clock (Cambridge) is about a second
+ * a day, but even that keeps us within the inherent tolerance
+ * of the clock for about 15 minutes. Observation shows that
+ * the typical "short" outage is 3 minutes, so to allow us
+ * to ride out those, we will give it 5 minutes.
+ */
+ lostsync = current_time - ees->clocklastgood > 300 ? 1 : 0;
+ isinsync = (lostsync || ees->leaphold > current_time) ? 0 : 1;
+
+ /* Done. Use time of last good, synchronised code as the
+ * reference time, and lastsampletime as the receive time.
+ */
+ if (ees->fix_pending) {
+ msyslog(LOG_ERR, "MSF%d: fix_pending=%d -> jump %x.%08x",
+ ees->fix_pending, ees->unit, offset.l_i, offset.l_f);
+ ees->fix_pending = 0;
+ }
+ LFPTOD(&offset, doffset);
+ refclock_receive(ees->peer);
+ ees_event(ees, lostsync ? CEVNT_PROP : CEVNT_NOMINAL);
+}
+
+/* msfees_poll - called by the transmit procedure */
+static void
+msfees_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ if (unit >= MAXUNITS) {
+ msyslog(LOG_ERR, "ees clock poll: INTERNAL: unit %d invalid",
+ unit);
+ return;
+ }
+ if (!unitinuse[unit]) {
+ msyslog(LOG_ERR, "ees clock poll: INTERNAL: unit %d unused",
+ unit);
+ return;
+ }
+
+ ees_process(eesunits[unit]);
+
+ if ((current_time - eesunits[unit]->lasttime) > 150)
+ ees_event(eesunits[unit], CEVNT_FAULT);
+}
+
+
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_mx4200.c b/ntpd/refclock_mx4200.c
new file mode 100644
index 0000000..c942229
--- /dev/null
+++ b/ntpd/refclock_mx4200.c
@@ -0,0 +1,1631 @@
+/*
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66.
+ *
+ * Copyright (c) 1992 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Lawrence Berkeley Laboratory.
+ * 4. The name of the University may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Modified: Marc Brett <marc.brett@westgeo.com> Sept, 1999.
+ *
+ * 1. Added support for alternate PPS schemes, with code mostly
+ * copied from the Oncore driver (Thanks, Poul-Henning Kamp).
+ * This code runs on SunOS 4.1.3 with ppsclock-1.6a1 and Solaris 7.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_MX4200) && defined(HAVE_PPSAPI)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "mx4200.h"
+
+#ifdef HAVE_SYS_TERMIOS_H
+# include <sys/termios.h>
+#endif
+#ifdef HAVE_SYS_PPSCLOCK_H
+# include <sys/ppsclock.h>
+#endif
+
+#ifndef HAVE_STRUCT_PPSCLOCKEV
+struct ppsclockev {
+# ifdef HAVE_STRUCT_TIMESPEC
+ struct timespec tv;
+# else
+ struct timeval tv;
+# endif
+ u_int serial;
+};
+#endif /* ! HAVE_STRUCT_PPSCLOCKEV */
+
+#ifdef HAVE_PPSAPI
+# include "ppsapi_timepps.h"
+#endif /* HAVE_PPSAPI */
+
+/*
+ * This driver supports the Magnavox Model MX 4200 GPS Receiver
+ * adapted to precision timing applications. It requires the
+ * ppsclock line discipline or streams module described in the
+ * Line Disciplines and Streams Drivers page. It also requires a
+ * gadget box and 1-PPS level converter, such as described in the
+ * Pulse-per-second (PPS) Signal Interfacing page.
+ *
+ * It's likely that other compatible Magnavox receivers such as the
+ * MX 4200D, MX 9212, MX 9012R, MX 9112 will be supported by this code.
+ */
+
+/*
+ * Check this every time you edit the code!
+ */
+#define YEAR_LAST_MODIFIED 2000
+
+/*
+ * GPS Definitions
+ */
+#define DEVICE "/dev/gps%d" /* device name and unit */
+#define SPEED232 B4800 /* baud */
+
+/*
+ * Radio interface parameters
+ */
+#define PRECISION (-18) /* precision assumed (about 4 us) */
+#define REFID "GPS\0" /* reference id */
+#define DESCRIPTION "Magnavox MX4200 GPS Receiver" /* who we are */
+#define DEFFUDGETIME 0 /* default fudge time (ms) */
+
+#define SLEEPTIME 32 /* seconds to wait for reconfig to complete */
+
+/*
+ * Position Averaging.
+ */
+#define INTERVAL 1 /* Interval between position measurements (s) */
+#define AVGING_TIME 24 /* Number of hours to average */
+#define NOT_INITIALIZED -9999. /* initial pivot longitude */
+
+/*
+ * MX4200 unit control structure.
+ */
+struct mx4200unit {
+ u_int pollcnt; /* poll message counter */
+ u_int polled; /* Hand in a time sample? */
+ u_int lastserial; /* last pps serial number */
+ struct ppsclockev ppsev; /* PPS control structure */
+ double avg_lat; /* average latitude */
+ double avg_lon; /* average longitude */
+ double avg_alt; /* average height */
+ double central_meridian; /* central meridian */
+ double N_fixes; /* Number of position measurements */
+ int last_leap; /* leap second warning */
+ u_int moving; /* mobile platform? */
+ u_long sloppyclockflag; /* fudge flags */
+ u_int known; /* position known yet? */
+ u_long clamp_time; /* when to stop postion averaging */
+ u_long log_time; /* when to print receiver status */
+ pps_handle_t pps_h;
+ pps_params_t pps_p;
+ pps_info_t pps_i;
+};
+
+static char pmvxg[] = "PMVXG";
+
+/* XXX should be somewhere else */
+#ifdef __GNUC__
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+#ifndef __attribute__
+#define __attribute__(args)
+#endif /* __attribute__ */
+#endif /* __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) */
+#else
+#ifndef __attribute__
+#define __attribute__(args)
+#endif /* __attribute__ */
+#endif /* __GNUC__ */
+/* XXX end */
+
+/*
+ * Function prototypes
+ */
+static int mx4200_start (int, struct peer *);
+static void mx4200_shutdown (int, struct peer *);
+static void mx4200_receive (struct recvbuf *);
+static void mx4200_poll (int, struct peer *);
+
+static char * mx4200_parse_t (struct peer *);
+static char * mx4200_parse_p (struct peer *);
+static char * mx4200_parse_s (struct peer *);
+int mx4200_cmpl_fp (const void *, const void *);
+static int mx4200_config (struct peer *);
+static void mx4200_ref (struct peer *);
+static void mx4200_send (struct peer *, char *, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static u_char mx4200_cksum (char *, int);
+static int mx4200_jday (int, int, int);
+static void mx4200_debug (struct peer *, char *, ...)
+ __attribute__ ((format (printf, 2, 3)));
+static int mx4200_pps (struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_mx4200 = {
+ mx4200_start, /* start up driver */
+ mx4200_shutdown, /* shut down driver */
+ mx4200_poll, /* transmit poll message */
+ noentry, /* not used (old mx4200_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old mx4200_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+
+/*
+ * mx4200_start - open the devices and initialize data for processing
+ */
+static int
+mx4200_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct mx4200unit *up;
+ struct refclockproc *pp;
+ int fd;
+ char gpsdev[20];
+
+ /*
+ * Open serial port
+ */
+ snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
+ fd = refclock_open(gpsdev, SPEED232, LDISC_PPS);
+ if (fd <= 0)
+ return 0;
+
+ /*
+ * Allocate unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = mx4200_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+
+ /* Ensure the receiver is properly configured */
+ return mx4200_config(peer);
+}
+
+
+/*
+ * mx4200_shutdown - shut down the clock
+ */
+static void
+mx4200_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct mx4200unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * mx4200_config - Configure the receiver
+ */
+static int
+mx4200_config(
+ struct peer *peer
+ )
+{
+ char tr_mode;
+ int add_mode;
+ register struct mx4200unit *up;
+ struct refclockproc *pp;
+ int mode;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Initialize the unit variables
+ *
+ * STRANGE BEHAVIOUR WARNING: The fudge flags are not available
+ * at the time mx4200_start is called. These are set later,
+ * and so the code must be prepared to handle changing flags.
+ */
+ up->sloppyclockflag = pp->sloppyclockflag;
+ if (pp->sloppyclockflag & CLK_FLAG2) {
+ up->moving = 1; /* Receiver on mobile platform */
+ msyslog(LOG_DEBUG, "mx4200_config: mobile platform");
+ } else {
+ up->moving = 0; /* Static Installation */
+ }
+ up->pollcnt = 2;
+ up->polled = 0;
+ up->known = 0;
+ up->avg_lat = 0.0;
+ up->avg_lon = 0.0;
+ up->avg_alt = 0.0;
+ up->central_meridian = NOT_INITIALIZED;
+ up->N_fixes = 0.0;
+ up->last_leap = 0; /* LEAP_NOWARNING */
+ up->clamp_time = current_time + (AVGING_TIME * 60 * 60);
+ up->log_time = current_time + SLEEPTIME;
+
+ if (time_pps_create(pp->io.fd, &up->pps_h) < 0) {
+ perror("time_pps_create");
+ msyslog(LOG_ERR,
+ "mx4200_config: time_pps_create failed: %m");
+ return (0);
+ }
+ if (time_pps_getcap(up->pps_h, &mode) < 0) {
+ msyslog(LOG_ERR,
+ "mx4200_config: time_pps_getcap failed: %m");
+ return (0);
+ }
+
+ if (time_pps_getparams(up->pps_h, &up->pps_p) < 0) {
+ msyslog(LOG_ERR,
+ "mx4200_config: time_pps_getparams failed: %m");
+ return (0);
+ }
+
+ /* nb. only turn things on, if someone else has turned something
+ * on before we get here, leave it alone!
+ */
+
+ up->pps_p.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
+ up->pps_p.mode &= mode; /* only set what is legal */
+
+ if (time_pps_setparams(up->pps_h, &up->pps_p) < 0) {
+ perror("time_pps_setparams");
+ msyslog(LOG_ERR,
+ "mx4200_config: time_pps_setparams failed: %m");
+ exit(1);
+ }
+
+ if (time_pps_kcbind(up->pps_h, PPS_KC_HARDPPS, PPS_CAPTUREASSERT,
+ PPS_TSFMT_TSPEC) < 0) {
+ perror("time_pps_kcbind");
+ msyslog(LOG_ERR,
+ "mx4200_config: time_pps_kcbind failed: %m");
+ exit(1);
+ }
+
+
+ /*
+ * "007" Control Port Configuration
+ * Zero the output list (do it twice to flush possible junk)
+ */
+ mx4200_send(peer, "%s,%03d,,%d,,,,,,", pmvxg,
+ PMVXG_S_PORTCONF,
+ /* control port output block Label */
+ 1); /* clear current output control list (1=yes) */
+ /* add/delete sentences from list */
+ /* must be null */
+ /* sentence output rate (sec) */
+ /* precision for position output */
+ /* nmea version for cga & gll output */
+ /* pass-through control */
+ mx4200_send(peer, "%s,%03d,,%d,,,,,,", pmvxg,
+ PMVXG_S_PORTCONF, 1);
+
+ /*
+ * Request software configuration so we can syslog the firmware version
+ */
+ mx4200_send(peer, "%s,%03d", "CDGPQ", PMVXG_D_SOFTCONF);
+
+ /*
+ * "001" Initialization/Mode Control, Part A
+ * Where ARE we?
+ */
+ mx4200_send(peer, "%s,%03d,,,,,,,,,,", pmvxg,
+ PMVXG_S_INITMODEA);
+ /* day of month */
+ /* month of year */
+ /* year */
+ /* gmt */
+ /* latitude DDMM.MMMM */
+ /* north/south */
+ /* longitude DDDMM.MMMM */
+ /* east/west */
+ /* height */
+ /* Altitude Reference 1=MSL */
+
+ /*
+ * "001" Initialization/Mode Control, Part B
+ * Start off in 2d/3d coast mode, holding altitude to last known
+ * value if only 3 satellites available.
+ */
+ mx4200_send(peer, "%s,%03d,%d,,%.1f,%.1f,%d,%d,%d,%c,%d",
+ pmvxg, PMVXG_S_INITMODEB,
+ 3, /* 2d/3d coast */
+ /* reserved */
+ 0.1, /* hor accel fact as per Steve (m/s**2) */
+ 0.1, /* ver accel fact as per Steve (m/s**2) */
+ 10, /* vdop */
+ 10, /* hdop limit as per Steve */
+ 5, /* elevation limit as per Steve (deg) */
+ 'U', /* time output mode (UTC) */
+ 0); /* local time offset from gmt (HHHMM) */
+
+ /*
+ * "023" Time Recovery Configuration
+ * Get UTC time from a stationary receiver.
+ * (Set field 1 'D' == dynamic if we are on a moving platform).
+ * (Set field 1 'S' == static if we are not moving).
+ * (Set field 1 'K' == known position if we can initialize lat/lon/alt).
+ */
+
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ up->moving = 1; /* Receiver on mobile platform */
+ else
+ up->moving = 0; /* Static Installation */
+
+ up->pollcnt = 2;
+ if (up->moving) {
+ /* dynamic: solve for pos, alt, time, while moving */
+ tr_mode = 'D';
+ } else {
+ /* static: solve for pos, alt, time, while stationary */
+ tr_mode = 'S';
+ }
+ mx4200_send(peer, "%s,%03d,%c,%c,%c,%d,%d,%d,", pmvxg,
+ PMVXG_S_TRECOVCONF,
+ tr_mode, /* time recovery mode (see above ) */
+ 'U', /* synchronize to UTC */
+ 'A', /* always output a time pulse */
+ 500, /* max time error in ns */
+ 0, /* user bias in ns */
+ 1); /* output "830" sentences to control port */
+ /* Multi-satellite mode */
+
+ /*
+ * Output position information (to calculate fixed installation
+ * location) only if we are not moving
+ */
+ if (up->moving) {
+ add_mode = 2; /* delete from list */
+ } else {
+ add_mode = 1; /* add to list */
+ }
+
+
+ /*
+ * "007" Control Port Configuration
+ * Output "021" position, height, velocity reports
+ */
+ mx4200_send(peer, "%s,%03d,%03d,%d,%d,,%d,,,", pmvxg,
+ PMVXG_S_PORTCONF,
+ PMVXG_D_PHV, /* control port output block Label */
+ 0, /* clear current output control list (0=no) */
+ add_mode, /* add/delete sentences from list (1=add, 2=del) */
+ /* must be null */
+ INTERVAL); /* sentence output rate (sec) */
+ /* precision for position output */
+ /* nmea version for cga & gll output */
+ /* pass-through control */
+
+ return (1);
+}
+
+/*
+ * mx4200_ref - Reconfigure unit as a reference station at a known position.
+ */
+static void
+mx4200_ref(
+ struct peer *peer
+ )
+{
+ register struct mx4200unit *up;
+ struct refclockproc *pp;
+ double minute, lat, lon, alt;
+ char lats[16], lons[16];
+ char nsc, ewc;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /* Should never happen! */
+ if (up->moving) return;
+
+ /*
+ * Set up to output status information in the near future
+ */
+ up->log_time = current_time + SLEEPTIME;
+
+ /*
+ * "007" Control Port Configuration
+ * Stop outputting "021" position, height, velocity reports
+ */
+ mx4200_send(peer, "%s,%03d,%03d,%d,%d,,,,,", pmvxg,
+ PMVXG_S_PORTCONF,
+ PMVXG_D_PHV, /* control port output block Label */
+ 0, /* clear current output control list (0=no) */
+ 2); /* add/delete sentences from list (2=delete) */
+ /* must be null */
+ /* sentence output rate (sec) */
+ /* precision for position output */
+ /* nmea version for cga & gll output */
+ /* pass-through control */
+
+ /*
+ * "001" Initialization/Mode Control, Part B
+ * Put receiver in fully-constrained 2d nav mode
+ */
+ mx4200_send(peer, "%s,%03d,%d,,%.1f,%.1f,%d,%d,%d,%c,%d",
+ pmvxg, PMVXG_S_INITMODEB,
+ 2, /* 2d nav */
+ /* reserved */
+ 0.1, /* hor accel fact as per Steve (m/s**2) */
+ 0.1, /* ver accel fact as per Steve (m/s**2) */
+ 10, /* vdop */
+ 10, /* hdop limit as per Steve */
+ 5, /* elevation limit as per Steve (deg) */
+ 'U', /* time output mode (UTC) */
+ 0); /* local time offset from gmt (HHHMM) */
+
+ /*
+ * "023" Time Recovery Configuration
+ * Get UTC time from a stationary receiver. Solve for time only.
+ * This should improve the time resolution dramatically.
+ */
+ mx4200_send(peer, "%s,%03d,%c,%c,%c,%d,%d,%d,", pmvxg,
+ PMVXG_S_TRECOVCONF,
+ 'K', /* known position: solve for time only */
+ 'U', /* synchronize to UTC */
+ 'A', /* always output a time pulse */
+ 500, /* max time error in ns */
+ 0, /* user bias in ns */
+ 1); /* output "830" sentences to control port */
+ /* Multi-satellite mode */
+
+ /*
+ * "000" Initialization/Mode Control - Part A
+ * Fix to our averaged position.
+ */
+ if (up->central_meridian != NOT_INITIALIZED) {
+ up->avg_lon += up->central_meridian;
+ if (up->avg_lon < -180.0) up->avg_lon += 360.0;
+ if (up->avg_lon > 180.0) up->avg_lon -= 360.0;
+ }
+
+ if (up->avg_lat >= 0.0) {
+ lat = up->avg_lat;
+ nsc = 'N';
+ } else {
+ lat = up->avg_lat * (-1.0);
+ nsc = 'S';
+ }
+ if (up->avg_lon >= 0.0) {
+ lon = up->avg_lon;
+ ewc = 'E';
+ } else {
+ lon = up->avg_lon * (-1.0);
+ ewc = 'W';
+ }
+ alt = up->avg_alt;
+ minute = (lat - (double)(int)lat) * 60.0;
+ snprintf(lats, sizeof(lats), "%02d%02.4f", (int)lat, minute);
+ minute = (lon - (double)(int)lon) * 60.0;
+ snprintf(lons, sizeof(lons), "%03d%02.4f", (int)lon, minute);
+
+ mx4200_send(peer, "%s,%03d,,,,,%s,%c,%s,%c,%.2f,%d", pmvxg,
+ PMVXG_S_INITMODEA,
+ /* day of month */
+ /* month of year */
+ /* year */
+ /* gmt */
+ lats, /* latitude DDMM.MMMM */
+ nsc, /* north/south */
+ lons, /* longitude DDDMM.MMMM */
+ ewc, /* east/west */
+ alt, /* Altitude */
+ 1); /* Altitude Reference (0=WGS84 ellipsoid, 1=MSL geoid)*/
+
+ msyslog(LOG_DEBUG,
+ "mx4200: reconfig to fixed location: %s %c, %s %c, %.2f m",
+ lats, nsc, lons, ewc, alt );
+
+}
+
+/*
+ * mx4200_poll - mx4200 watchdog routine
+ */
+static void
+mx4200_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct mx4200unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * You don't need to poll this clock. It puts out timecodes
+ * once per second. If asked for a timestamp, take note.
+ * The next time a timecode comes in, it will be fed back.
+ */
+
+ /*
+ * If we haven't had a response in a while, reset the receiver.
+ */
+ if (up->pollcnt > 0) {
+ up->pollcnt--;
+ } else {
+ refclock_report(peer, CEVNT_TIMEOUT);
+
+ /*
+ * Request a "000" status message which should trigger a
+ * reconfig
+ */
+ mx4200_send(peer, "%s,%03d",
+ "CDGPQ", /* query from CDU to GPS */
+ PMVXG_D_STATUS); /* label of desired sentence */
+ }
+
+ /*
+ * polled every 64 seconds. Ask mx4200_receive to hand in
+ * a timestamp.
+ */
+ up->polled = 1;
+ pp->polls++;
+
+ /*
+ * Output receiver status information.
+ */
+ if ((up->log_time > 0) && (current_time > up->log_time)) {
+ up->log_time = 0;
+ /*
+ * Output the following messages once, for debugging.
+ * "004" Mode Data
+ * "523" Time Recovery Parameters
+ */
+ mx4200_send(peer, "%s,%03d", "CDGPQ", PMVXG_D_MODEDATA);
+ mx4200_send(peer, "%s,%03d", "CDGPQ", PMVXG_D_TRECOVUSEAGE);
+ }
+}
+
+static char char2hex[] = "0123456789ABCDEF";
+
+/*
+ * mx4200_receive - receive gps data
+ */
+static void
+mx4200_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct mx4200unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ char *cp;
+ int sentence_type;
+ u_char ck;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp.
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * If operating mode has been changed, then reinitialize the receiver
+ * before doing anything else.
+ */
+ if ((pp->sloppyclockflag & CLK_FLAG2) !=
+ (up->sloppyclockflag & CLK_FLAG2)) {
+ up->sloppyclockflag = pp->sloppyclockflag;
+ mx4200_debug(peer,
+ "mx4200_receive: mode switch: reset receiver\n");
+ mx4200_config(peer);
+ return;
+ }
+ up->sloppyclockflag = pp->sloppyclockflag;
+
+ /*
+ * Read clock output. Automatically handles STREAMS, CLKLDISC.
+ */
+ pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec);
+
+ /*
+ * There is a case where <cr><lf> generates 2 timestamps.
+ */
+ if (pp->lencode == 0)
+ return;
+
+ up->pollcnt = 2;
+ pp->a_lastcode[pp->lencode] = '\0';
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ mx4200_debug(peer, "mx4200_receive: %d %s\n",
+ pp->lencode, pp->a_lastcode);
+
+ /*
+ * The structure of the control port sentences is based on the
+ * NMEA-0183 Standard for interfacing Marine Electronics
+ * Navigation Devices (Version 1.5)
+ *
+ * $PMVXG,XXX, ....................*CK<cr><lf>
+ *
+ * $ Sentence Start Identifier (reserved char)
+ * (Start-of-Sentence Identifier)
+ * P Special ID (Proprietary)
+ * MVX Originator ID (Magnavox)
+ * G Interface ID (GPS)
+ * , Field Delimiters (reserved char)
+ * XXX Sentence Type
+ * ...... Data
+ * * Checksum Field Delimiter (reserved char)
+ * CK Checksum
+ * <cr><lf> Carriage-Return/Line Feed (reserved chars)
+ * (End-of-Sentence Identifier)
+ *
+ * Reject if any important landmarks are missing.
+ */
+ cp = pp->a_lastcode + pp->lencode - 3;
+ if (cp < pp->a_lastcode || *pp->a_lastcode != '$' || cp[0] != '*' ) {
+ mx4200_debug(peer, "mx4200_receive: bad format\n");
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Check and discard the checksum
+ */
+ ck = mx4200_cksum(&pp->a_lastcode[1], pp->lencode - 4);
+ if (char2hex[ck >> 4] != cp[1] || char2hex[ck & 0xf] != cp[2]) {
+ mx4200_debug(peer, "mx4200_receive: bad checksum\n");
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ *cp = '\0';
+
+ /*
+ * Get the sentence type.
+ */
+ sentence_type = 0;
+ if ((cp = strchr(pp->a_lastcode, ',')) == NULL) {
+ mx4200_debug(peer, "mx4200_receive: no sentence\n");
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ cp++;
+ sentence_type = strtol(cp, &cp, 10);
+
+ /*
+ * Process the sentence according to its type.
+ */
+ switch (sentence_type) {
+
+ /*
+ * "000" Status message
+ */
+ case PMVXG_D_STATUS:
+ /*
+ * XXX
+ * Since we configure the receiver to not give us status
+ * messages and since the receiver outputs status messages by
+ * default after being reset to factory defaults when sent the
+ * "$PMVXG,018,C\r\n" message, any status message we get
+ * indicates the reciever needs to be initialized; thus, it is
+ * not necessary to decode the status message.
+ */
+ if ((cp = mx4200_parse_s(peer)) != NULL) {
+ mx4200_debug(peer,
+ "mx4200_receive: status: %s\n", cp);
+ }
+ mx4200_debug(peer, "mx4200_receive: reset receiver\n");
+ mx4200_config(peer);
+ break;
+
+ /*
+ * "021" Position, Height, Velocity message,
+ * if we are still averaging our position
+ */
+ case PMVXG_D_PHV:
+ if (!up->known) {
+ /*
+ * Parse the message, calculating our averaged position.
+ */
+ if ((cp = mx4200_parse_p(peer)) != NULL) {
+ mx4200_debug(peer, "mx4200_receive: pos: %s\n", cp);
+ return;
+ }
+ mx4200_debug(peer,
+ "mx4200_receive: position avg %f %.9f %.9f %.4f\n",
+ up->N_fixes, up->avg_lat, up->avg_lon, up->avg_alt);
+ /*
+ * Reinitialize as a reference station
+ * if position is well known.
+ */
+ if (current_time > up->clamp_time) {
+ up->known++;
+ mx4200_debug(peer, "mx4200_receive: reconfiguring!\n");
+ mx4200_ref(peer);
+ }
+ }
+ break;
+
+ /*
+ * Print to the syslog:
+ * "004" Mode Data
+ * "030" Software Configuration
+ * "523" Time Recovery Parameters Currently in Use
+ */
+ case PMVXG_D_MODEDATA:
+ case PMVXG_D_SOFTCONF:
+ case PMVXG_D_TRECOVUSEAGE:
+
+ if ((cp = mx4200_parse_s(peer)) != NULL) {
+ mx4200_debug(peer,
+ "mx4200_receive: multi-record: %s\n", cp);
+ }
+ break;
+
+ /*
+ * "830" Time Recovery Results message
+ */
+ case PMVXG_D_TRECOVOUT:
+
+ /*
+ * Capture the last PPS signal.
+ * Precision timestamp is returned in pp->lastrec
+ */
+ if (0 != mx4200_pps(peer)) {
+ mx4200_debug(peer, "mx4200_receive: pps failure\n");
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+
+
+ /*
+ * Parse the time recovery message, and keep the info
+ * to print the pretty billboards.
+ */
+ if ((cp = mx4200_parse_t(peer)) != NULL) {
+ mx4200_debug(peer, "mx4200_receive: time: %s\n", cp);
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Add the new sample to a median filter.
+ */
+ if (!refclock_process(pp)) {
+ mx4200_debug(peer,"mx4200_receive: offset: %.6f\n",
+ pp->offset);
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+ /*
+ * The clock will blurt a timecode every second but we only
+ * want one when polled. If we havn't been polled, bail out.
+ */
+ if (!up->polled)
+ return;
+
+ /*
+ * Return offset and dispersion to control module. We use
+ * lastrec as both the reference time and receive time in
+ * order to avoid being cute, like setting the reference time
+ * later than the receive time, which may cause a paranoid
+ * protocol module to chuck out the data.
+ */
+ mx4200_debug(peer, "mx4200_receive: process time: ");
+ mx4200_debug(peer, "%4d-%03d %02d:%02d:%02d at %s, %.6f\n",
+ pp->year, pp->day, pp->hour, pp->minute, pp->second,
+ prettydate(&pp->lastrec), pp->offset);
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+
+ /*
+ * We have succeeded in answering the poll.
+ * Turn off the flag and return
+ */
+ up->polled = 0;
+ break;
+
+ /*
+ * Ignore all other sentence types
+ */
+ default:
+ break;
+
+ } /* switch (sentence_type) */
+
+ return;
+}
+
+
+/*
+ * Parse a mx4200 time recovery message. Returns a string if error.
+ *
+ * A typical message looks like this. Checksum has already been stripped.
+ *
+ * $PMVXG,830,T,YYYY,MM,DD,HH:MM:SS,U,S,FFFFFF,PPPPP,BBBBBB,LL
+ *
+ * Field Field Contents
+ * ----- --------------
+ * Block Label: $PMVXG
+ * Sentence Type: 830=Time Recovery Results
+ * This sentence is output approximately 1 second
+ * preceding the 1PPS output. It indicates the
+ * exact time of the next pulse, whether or not the
+ * time mark will be valid (based on operator-specified
+ * error tolerance), the time to which the pulse is
+ * synchronized, the receiver operating mode,
+ * and the time error of the *last* 1PPS output.
+ * 1 char Time Mark Valid: T=Valid, F=Not Valid
+ * 2 int Year: 1993-
+ * 3 int Month of Year: 1-12
+ * 4 int Day of Month: 1-31
+ * 5 int Time of Day: HH:MM:SS
+ * 6 char Time Synchronization: U=UTC, G=GPS
+ * 7 char Time Recovery Mode: D=Dynamic, S=Static,
+ * K=Known Position, N=No Time Recovery
+ * 8 int Oscillator Offset: The filter's estimate of the oscillator
+ * frequency error, in parts per billion (ppb).
+ * 9 int Time Mark Error: The computed error of the *last* pulse
+ * output, in nanoseconds.
+ * 10 int User Time Bias: Operator specified bias, in nanoseconds
+ * 11 int Leap Second Flag: Indicates that a leap second will
+ * occur. This value is usually zero, except during
+ * the week prior to the leap second occurrence, when
+ * this value will be set to +1 or -1. A value of
+ * +1 indicates that GPS time will be 1 second
+ * further ahead of UTC time.
+ *
+ */
+static char *
+mx4200_parse_t(
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct mx4200unit *up;
+ char time_mark_valid, time_sync, op_mode;
+ int sentence_type, valid;
+ int year, day_of_year, month, day_of_month;
+ int hour, minute, second, leapsec_warn;
+ int oscillator_offset, time_mark_error, time_bias;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ leapsec_warn = 0; /* Not all receivers output leap second warnings (!) */
+ sscanf(pp->a_lastcode,
+ "$PMVXG,%d,%c,%d,%d,%d,%d:%d:%d,%c,%c,%d,%d,%d,%d",
+ &sentence_type, &time_mark_valid, &year, &month, &day_of_month,
+ &hour, &minute, &second, &time_sync, &op_mode,
+ &oscillator_offset, &time_mark_error, &time_bias, &leapsec_warn);
+
+ if (sentence_type != PMVXG_D_TRECOVOUT)
+ return ("wrong rec-type");
+
+ switch (time_mark_valid) {
+ case 'T':
+ valid = 1;
+ break;
+ case 'F':
+ valid = 0;
+ break;
+ default:
+ return ("bad pulse-valid");
+ }
+
+ switch (time_sync) {
+ case 'G':
+ return ("synchronized to GPS; should be UTC");
+ case 'U':
+ break; /* UTC -> ok */
+ default:
+ return ("not synchronized to UTC");
+ }
+
+ /*
+ * Check for insane time (allow for possible leap seconds)
+ */
+ if (second > 60 || minute > 59 || hour > 23 ||
+ second < 0 || minute < 0 || hour < 0) {
+ mx4200_debug(peer,
+ "mx4200_parse_t: bad time %02d:%02d:%02d",
+ hour, minute, second);
+ if (leapsec_warn != 0)
+ mx4200_debug(peer, " (leap %+d\n)", leapsec_warn);
+ mx4200_debug(peer, "\n");
+ refclock_report(peer, CEVNT_BADTIME);
+ return ("bad time");
+ }
+ if ( second == 60 ) {
+ msyslog(LOG_DEBUG,
+ "mx4200: leap second! %02d:%02d:%02d",
+ hour, minute, second);
+ }
+
+ /*
+ * Check for insane date
+ * (Certainly can't be any year before this code was last altered!)
+ */
+ if (day_of_month > 31 || month > 12 ||
+ day_of_month < 1 || month < 1 || year < YEAR_LAST_MODIFIED) {
+ mx4200_debug(peer,
+ "mx4200_parse_t: bad date (%4d-%02d-%02d)\n",
+ year, month, day_of_month);
+ refclock_report(peer, CEVNT_BADDATE);
+ return ("bad date");
+ }
+
+ /*
+ * Silly Hack for MX4200:
+ * ASCII message is for *next* 1PPS signal, but we have the
+ * timestamp for the *last* 1PPS signal. So we have to subtract
+ * a second. Discard if we are on a month boundary to avoid
+ * possible leap seconds and leap days.
+ */
+ second--;
+ if (second < 0) {
+ second = 59;
+ minute--;
+ if (minute < 0) {
+ minute = 59;
+ hour--;
+ if (hour < 0) {
+ hour = 23;
+ day_of_month--;
+ if (day_of_month < 1) {
+ return ("sorry, month boundary");
+ }
+ }
+ }
+ }
+
+ /*
+ * Calculate Julian date
+ */
+ if (!(day_of_year = mx4200_jday(year, month, day_of_month))) {
+ mx4200_debug(peer,
+ "mx4200_parse_t: bad julian date %d (%4d-%02d-%02d)\n",
+ day_of_year, year, month, day_of_month);
+ refclock_report(peer, CEVNT_BADDATE);
+ return("invalid julian date");
+ }
+
+ /*
+ * Setup leap second indicator
+ */
+ switch (leapsec_warn) {
+ case 0:
+ pp->leap = LEAP_NOWARNING;
+ break;
+ case 1:
+ pp->leap = LEAP_ADDSECOND;
+ break;
+ case -1:
+ pp->leap = LEAP_DELSECOND;
+ break;
+ default:
+ pp->leap = LEAP_NOTINSYNC;
+ }
+
+ /*
+ * Any change to the leap second warning status?
+ */
+ if (leapsec_warn != up->last_leap ) {
+ msyslog(LOG_DEBUG,
+ "mx4200: leap second warning: %d to %d (%d)",
+ up->last_leap, leapsec_warn, pp->leap);
+ }
+ up->last_leap = leapsec_warn;
+
+ /*
+ * Copy time data for billboard monitoring.
+ */
+
+ pp->year = year;
+ pp->day = day_of_year;
+ pp->hour = hour;
+ pp->minute = minute;
+ pp->second = second;
+
+ /*
+ * Toss if sentence is marked invalid
+ */
+ if (!valid || pp->leap == LEAP_NOTINSYNC) {
+ mx4200_debug(peer, "mx4200_parse_t: time mark not valid\n");
+ refclock_report(peer, CEVNT_BADTIME);
+ return ("pulse invalid");
+ }
+
+ return (NULL);
+}
+
+/*
+ * Calculate the checksum
+ */
+static u_char
+mx4200_cksum(
+ register char *cp,
+ register int n
+ )
+{
+ register u_char ck;
+
+ for (ck = 0; n-- > 0; cp++)
+ ck ^= *cp;
+ return (ck);
+}
+
+/*
+ * Tables to compute the day of year. Viva la leap.
+ */
+static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+/*
+ * Calculate the the Julian Day
+ */
+static int
+mx4200_jday(
+ int year,
+ int month,
+ int day_of_month
+ )
+{
+ register int day, i;
+ int leap_year;
+
+ /*
+ * Is this a leap year ?
+ */
+ if (year % 4) {
+ leap_year = 0; /* FALSE */
+ } else {
+ if (year % 100) {
+ leap_year = 1; /* TRUE */
+ } else {
+ if (year % 400) {
+ leap_year = 0; /* FALSE */
+ } else {
+ leap_year = 1; /* TRUE */
+ }
+ }
+ }
+
+ /*
+ * Calculate the Julian Date
+ */
+ day = day_of_month;
+
+ if (leap_year) {
+ /* a leap year */
+ if (day > day2tab[month - 1]) {
+ return (0);
+ }
+ for (i = 0; i < month - 1; i++)
+ day += day2tab[i];
+ } else {
+ /* not a leap year */
+ if (day > day1tab[month - 1]) {
+ return (0);
+ }
+ for (i = 0; i < month - 1; i++)
+ day += day1tab[i];
+ }
+ return (day);
+}
+
+/*
+ * Parse a mx4200 position/height/velocity sentence.
+ *
+ * A typical message looks like this. Checksum has already been stripped.
+ *
+ * $PMVXG,021,SSSSSS.SS,DDMM.MMMM,N,DDDMM.MMMM,E,HHHHH.H,GGGG.G,EEEE.E,WWWW.W,MM
+ *
+ * Field Field Contents
+ * ----- --------------
+ * Block Label: $PMVXG
+ * Sentence Type: 021=Position, Height Velocity Data
+ * This sentence gives the receiver position, height,
+ * navigation mode, and velocity north/east.
+ * *This sentence is intended for post-analysis
+ * applications.*
+ * 1 float UTC measurement time (seconds into week)
+ * 2 float WGS-84 Lattitude (degrees, minutes)
+ * 3 char N=North, S=South
+ * 4 float WGS-84 Longitude (degrees, minutes)
+ * 5 char E=East, W=West
+ * 6 float Altitude (meters above mean sea level)
+ * 7 float Geoidal height (meters)
+ * 8 float East velocity (m/sec)
+ * 9 float West Velocity (m/sec)
+ * 10 int Navigation Mode
+ * Mode if navigating:
+ * 1 = Position from remote device
+ * 2 = 2-D position
+ * 3 = 3-D position
+ * 4 = 2-D differential position
+ * 5 = 3-D differential position
+ * 6 = Static
+ * 8 = Position known -- reference station
+ * 9 = Position known -- Navigator
+ * Mode if not navigating:
+ * 51 = Too few satellites
+ * 52 = DOPs too large
+ * 53 = Position STD too large
+ * 54 = Velocity STD too large
+ * 55 = Too many iterations for velocity
+ * 56 = Too many iterations for position
+ * 57 = 3 sat startup failed
+ * 58 = Command abort
+ */
+static char *
+mx4200_parse_p(
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct mx4200unit *up;
+ int sentence_type, mode;
+ double mtime, lat, lon, alt, geoid, vele, veln;
+ char north_south, east_west;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /* Should never happen! */
+ if (up->moving) return ("mobile platform - no pos!");
+
+ sscanf ( pp->a_lastcode,
+ "$PMVXG,%d,%lf,%lf,%c,%lf,%c,%lf,%lf,%lf,%lf,%d",
+ &sentence_type, &mtime, &lat, &north_south, &lon, &east_west,
+ &alt, &geoid, &vele, &veln, &mode);
+
+ /* Sentence type */
+ if (sentence_type != PMVXG_D_PHV)
+ return ("wrong rec-type");
+
+ /*
+ * return if not navigating
+ */
+ if (mode > 10)
+ return ("not navigating");
+ if (mode != 3 && mode != 5)
+ return ("not navigating in 3D");
+
+ /* Latitude (always +ve) and convert DDMM.MMMM to decimal */
+ if (lat < 0.0) return ("negative latitude");
+ if (lat > 9000.0) lat = 9000.0;
+ lat *= 0.01;
+ lat = ((int)lat) + (((lat - (int)lat)) * 1.6666666666666666);
+
+ /* North/South */
+ switch (north_south) {
+ case 'N':
+ break;
+ case 'S':
+ lat *= -1.0;
+ break;
+ default:
+ return ("invalid north/south indicator");
+ }
+
+ /* Longitude (always +ve) and convert DDDMM.MMMM to decimal */
+ if (lon < 0.0) return ("negative longitude");
+ if (lon > 180.0) lon = 180.0;
+ lon *= 0.01;
+ lon = ((int)lon) + (((lon - (int)lon)) * 1.6666666666666666);
+
+ /* East/West */
+ switch (east_west) {
+ case 'E':
+ break;
+ case 'W':
+ lon *= -1.0;
+ break;
+ default:
+ return ("invalid east/west indicator");
+ }
+
+ /*
+ * Normalize longitude to near 0 degrees.
+ * Assume all data are clustered around first reading.
+ */
+ if (up->central_meridian == NOT_INITIALIZED) {
+ up->central_meridian = lon;
+ mx4200_debug(peer,
+ "mx4200_receive: central meridian = %.9f \n",
+ up->central_meridian);
+ }
+ lon -= up->central_meridian;
+ if (lon < -180.0) lon += 360.0;
+ if (lon > 180.0) lon -= 360.0;
+
+ /*
+ * Calculate running averages
+ */
+
+ up->avg_lon = (up->N_fixes * up->avg_lon) + lon;
+ up->avg_lat = (up->N_fixes * up->avg_lat) + lat;
+ up->avg_alt = (up->N_fixes * up->avg_alt) + alt;
+
+ up->N_fixes += 1.0;
+
+ up->avg_lon /= up->N_fixes;
+ up->avg_lat /= up->N_fixes;
+ up->avg_alt /= up->N_fixes;
+
+ mx4200_debug(peer,
+ "mx4200_receive: position rdg %.0f: %.9f %.9f %.4f (CM=%.9f)\n",
+ up->N_fixes, lat, lon, alt, up->central_meridian);
+
+ return (NULL);
+}
+
+/*
+ * Parse a mx4200 Status sentence
+ * Parse a mx4200 Mode Data sentence
+ * Parse a mx4200 Software Configuration sentence
+ * Parse a mx4200 Time Recovery Parameters Currently in Use sentence
+ * (used only for logging raw strings)
+ *
+ * A typical message looks like this. Checksum has already been stripped.
+ *
+ * $PMVXG,000,XXX,XX,X,HHMM,X
+ *
+ * Field Field Contents
+ * ----- --------------
+ * Block Label: $PMVXG
+ * Sentence Type: 000=Status.
+ * Returns status of the receiver to the controller.
+ * 1 Current Receiver Status:
+ * ACQ = Satellite re-acquisition
+ * ALT = Constellation selection
+ * COR = Providing corrections (for reference stations only)
+ * IAC = Initial acquisition
+ * IDL = Idle, no satellites
+ * NAV = Navigation
+ * STS = Search the Sky (no almanac available)
+ * TRK = Tracking
+ * 2 Number of satellites that should be visible
+ * 3 Number of satellites being tracked
+ * 4 Time since last navigation status if not currently navigating
+ * (hours, minutes)
+ * 5 Initialization status:
+ * 0 = Waiting for initialization parameters
+ * 1 = Initialization completed
+ *
+ * A typical message looks like this. Checksum has already been stripped.
+ *
+ * $PMVXG,004,C,R,D,H.HH,V.VV,TT,HHHH,VVVV,T
+ *
+ * Field Field Contents
+ * ----- --------------
+ * Block Label: $PMVXG
+ * Sentence Type: 004=Software Configuration.
+ * Defines the navigation mode and criteria for
+ * acceptable navigation for the receiver.
+ * 1 Constrain Altitude Mode:
+ * 0 = Auto. Constrain altitude (2-D solution) and use
+ * manual altitude input when 3 sats avalable. Do
+ * not constrain altitude (3-D solution) when 4 sats
+ * available.
+ * 1 = Always constrain altitude (2-D solution).
+ * 2 = Never constrain altitude (3-D solution).
+ * 3 = Coast. Constrain altitude (2-D solution) and use
+ * last GPS altitude calculation when 3 sats avalable.
+ * Do not constrain altitude (3-D solution) when 4 sats
+ * available.
+ * 2 Altitude Reference: (always 0 for MX4200)
+ * 0 = Ellipsoid
+ * 1 = Geoid (MSL)
+ * 3 Differential Navigation Control:
+ * 0 = Disabled
+ * 1 = Enabled
+ * 4 Horizontal Acceleration Constant (m/sec**2)
+ * 5 Vertical Acceleration Constant (m/sec**2) (0 for MX4200)
+ * 6 Tracking Elevation Limit (degrees)
+ * 7 HDOP Limit
+ * 8 VDOP Limit
+ * 9 Time Output Mode:
+ * U = UTC
+ * L = Local time
+ * 10 Local Time Offset (minutes) (absent on MX4200)
+ *
+ * A typical message looks like this. Checksum has already been stripped.
+ *
+ * $PMVXG,030,NNNN,FFF
+ *
+ * Field Field Contents
+ * ----- --------------
+ * Block Label: $PMVXG
+ * Sentence Type: 030=Software Configuration.
+ * This sentence contains the navigation processor
+ * and baseband firmware version numbers.
+ * 1 Nav Processor Version Number
+ * 2 Baseband Firmware Version Number
+ *
+ * A typical message looks like this. Checksum has already been stripped.
+ *
+ * $PMVXG,523,M,S,M,EEEE,BBBBBB,C,R
+ *
+ * Field Field Contents
+ * ----- --------------
+ * Block Label: $PMVXG
+ * Sentence Type: 523=Time Recovery Parameters Currently in Use.
+ * This sentence contains the configuration of the
+ * time recovery feature of the receiver.
+ * 1 Time Recovery Mode:
+ * D = Dynamic; solve for position and time while moving
+ * S = Static; solve for position and time while stationary
+ * K = Known position input, solve for time only
+ * N = No time recovery
+ * 2 Time Synchronization:
+ * U = UTC time
+ * G = GPS time
+ * 3 Time Mark Mode:
+ * A = Always output a time pulse
+ * V = Only output time pulse if time is valid (as determined
+ * by Maximum Time Error)
+ * 4 Maximum Time Error - the maximum error (in nanoseconds) for
+ * which a time mark will be considered valid.
+ * 5 User Time Bias - external bias in nanoseconds
+ * 6 Time Message Control:
+ * 0 = Do not output the time recovery message
+ * 1 = Output the time recovery message (record 830) to
+ * Control port
+ * 2 = Output the time recovery message (record 830) to
+ * Equipment port
+ * 7 Reserved
+ * 8 Position Known PRN (absent on MX 4200)
+ *
+ */
+static char *
+mx4200_parse_s(
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct mx4200unit *up;
+ int sentence_type;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ sscanf ( pp->a_lastcode, "$PMVXG,%d", &sentence_type);
+
+ /* Sentence type */
+ switch (sentence_type) {
+
+ case PMVXG_D_STATUS:
+ msyslog(LOG_DEBUG,
+ "mx4200: status: %s", pp->a_lastcode);
+ break;
+ case PMVXG_D_MODEDATA:
+ msyslog(LOG_DEBUG,
+ "mx4200: mode data: %s", pp->a_lastcode);
+ break;
+ case PMVXG_D_SOFTCONF:
+ msyslog(LOG_DEBUG,
+ "mx4200: firmware configuration: %s", pp->a_lastcode);
+ break;
+ case PMVXG_D_TRECOVUSEAGE:
+ msyslog(LOG_DEBUG,
+ "mx4200: time recovery parms: %s", pp->a_lastcode);
+ break;
+ default:
+ return ("wrong rec-type");
+ }
+
+ return (NULL);
+}
+
+/*
+ * Process a PPS signal, placing a timestamp in pp->lastrec.
+ */
+static int
+mx4200_pps(
+ struct peer *peer
+ )
+{
+ int temp_serial;
+ struct refclockproc *pp;
+ struct mx4200unit *up;
+
+ struct timespec timeout;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Grab the timestamp of the PPS signal.
+ */
+ temp_serial = up->pps_i.assert_sequence;
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+ if (time_pps_fetch(up->pps_h, PPS_TSFMT_TSPEC, &(up->pps_i),
+ &timeout) < 0) {
+ mx4200_debug(peer,
+ "mx4200_pps: time_pps_fetch: serial=%lu, %m\n",
+ (unsigned long)up->pps_i.assert_sequence);
+ refclock_report(peer, CEVNT_FAULT);
+ return(1);
+ }
+ if (temp_serial == up->pps_i.assert_sequence) {
+ mx4200_debug(peer,
+ "mx4200_pps: assert_sequence serial not incrementing: %lu\n",
+ (unsigned long)up->pps_i.assert_sequence);
+ refclock_report(peer, CEVNT_FAULT);
+ return(1);
+ }
+ /*
+ * Check pps serial number against last one
+ */
+ if (up->lastserial + 1 != up->pps_i.assert_sequence &&
+ up->lastserial != 0) {
+ if (up->pps_i.assert_sequence == up->lastserial) {
+ mx4200_debug(peer, "mx4200_pps: no new pps event\n");
+ } else {
+ mx4200_debug(peer, "mx4200_pps: missed %lu pps events\n",
+ up->pps_i.assert_sequence - up->lastserial - 1UL);
+ }
+ refclock_report(peer, CEVNT_FAULT);
+ }
+ up->lastserial = up->pps_i.assert_sequence;
+
+ /*
+ * Return the timestamp in pp->lastrec
+ */
+
+ pp->lastrec.l_ui = up->pps_i.assert_timestamp.tv_sec +
+ (u_int32) JAN_1970;
+ pp->lastrec.l_uf = ((double)(up->pps_i.assert_timestamp.tv_nsec) *
+ 4.2949672960) + 0.5;
+
+ return(0);
+}
+
+/*
+ * mx4200_debug - print debug messages
+ */
+static void
+mx4200_debug(struct peer *peer, char *fmt, ...)
+{
+#ifdef DEBUG
+ va_list ap;
+ struct refclockproc *pp;
+ struct mx4200unit *up;
+
+ if (debug) {
+ va_start(ap, fmt);
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Print debug message to stdout
+ * In the future, we may want to get get more creative...
+ */
+ mvprintf(fmt, ap);
+
+ va_end(ap);
+ }
+#endif
+}
+
+/*
+ * Send a character string to the receiver. Checksum is appended here.
+ */
+#if defined(__STDC__)
+static void
+mx4200_send(struct peer *peer, char *fmt, ...)
+#else
+static void
+mx4200_send(peer, fmt, va_alist)
+ struct peer *peer;
+ char *fmt;
+ va_dcl
+#endif /* __STDC__ */
+{
+ struct refclockproc *pp;
+ struct mx4200unit *up;
+
+ register char *cp;
+ register int n, m;
+ va_list ap;
+ char buf[1024];
+ u_char ck;
+
+#if defined(__STDC__)
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif /* __STDC__ */
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ cp = buf;
+ *cp++ = '$';
+ n = VSNPRINTF((cp, sizeof(buf) - 1, fmt, ap));
+ ck = mx4200_cksum(cp, n);
+ cp += n;
+ ++n;
+ n += SNPRINTF((cp, sizeof(buf) - n - 5, "*%02X\r\n", ck));
+
+ m = write(pp->io.fd, buf, (unsigned)n);
+ if (m < 0)
+ msyslog(LOG_ERR, "mx4200_send: write: %m (%s)", buf);
+ mx4200_debug(peer, "mx4200_send: %d %s\n", m, buf);
+ va_end(ap);
+}
+
+#else
+int refclock_mx4200_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_neoclock4x.c b/ntpd/refclock_neoclock4x.c
new file mode 100644
index 0000000..a0067e9
--- /dev/null
+++ b/ntpd/refclock_neoclock4x.c
@@ -0,0 +1,1124 @@
+/*
+ *
+ * Refclock_neoclock4x.c
+ * - NeoClock4X driver for DCF77 or FIA Timecode
+ *
+ * Date: 2009-12-04 v1.16
+ *
+ * see http://www.linum.com/redir/jump/id=neoclock4x&action=redir
+ * for details about the NeoClock4X device
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(REFCLOCK) && (defined(CLOCK_NEOCLOCK4X))
+
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_control.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#if defined HAVE_SYS_MODEM_H
+# include <sys/modem.h>
+# ifndef __QNXNTO__
+# define TIOCMSET MCSETA
+# define TIOCMGET MCGETA
+# define TIOCM_RTS MRTS
+# endif
+#endif
+
+#ifdef HAVE_TERMIOS_H
+# ifdef TERMIOS_NEEDS__SVID3
+# define _SVID3
+# endif
+# include <termios.h>
+# ifdef TERMIOS_NEEDS__SVID3
+# undef _SVID3
+# endif
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
+/*
+ * NTP version 4.20 change the pp->msec field to pp->nsec.
+ * To allow to support older ntp versions with this sourcefile
+ * you can define NTP_PRE_420 to allow this driver to compile
+ * with ntp version back to 4.1.2.
+ *
+ */
+#if 0
+#define NTP_PRE_420
+#endif
+
+/*
+ * If you want the driver for whatever reason to not use
+ * the TX line to send anything to your NeoClock4X
+ * device you must tell the NTP refclock driver which
+ * firmware you NeoClock4X device uses.
+ *
+ * If you want to enable this feature change the "#if 0"
+ * line to "#if 1" and make sure that the defined firmware
+ * matches the firmware off your NeoClock4X receiver!
+ *
+ */
+
+#if 0
+#define NEOCLOCK4X_FIRMWARE NEOCLOCK4X_FIRMWARE_VERSION_A
+#endif
+
+/* at this time only firmware version A is known */
+#define NEOCLOCK4X_FIRMWARE_VERSION_A 'A'
+
+#define NEOCLOCK4X_TIMECODELEN 37
+
+#define NEOCLOCK4X_OFFSET_SERIAL 3
+#define NEOCLOCK4X_OFFSET_RADIOSIGNAL 9
+#define NEOCLOCK4X_OFFSET_DAY 12
+#define NEOCLOCK4X_OFFSET_MONTH 14
+#define NEOCLOCK4X_OFFSET_YEAR 16
+#define NEOCLOCK4X_OFFSET_HOUR 18
+#define NEOCLOCK4X_OFFSET_MINUTE 20
+#define NEOCLOCK4X_OFFSET_SECOND 22
+#define NEOCLOCK4X_OFFSET_HSEC 24
+#define NEOCLOCK4X_OFFSET_DOW 26
+#define NEOCLOCK4X_OFFSET_TIMESOURCE 28
+#define NEOCLOCK4X_OFFSET_DSTSTATUS 29
+#define NEOCLOCK4X_OFFSET_QUARZSTATUS 30
+#define NEOCLOCK4X_OFFSET_ANTENNA1 31
+#define NEOCLOCK4X_OFFSET_ANTENNA2 33
+#define NEOCLOCK4X_OFFSET_CRC 35
+
+#define NEOCLOCK4X_DRIVER_VERSION "1.16 (2009-12-04)"
+
+#define NSEC_TO_MILLI 1000000
+
+struct neoclock4x_unit {
+ l_fp laststamp; /* last receive timestamp */
+ short unit; /* NTP refclock unit number */
+ u_long polled; /* flag to detect noreplies */
+ char leap_status; /* leap second flag */
+ int recvnow;
+
+ char firmware[80];
+ char firmwaretag;
+ char serial[7];
+ char radiosignal[4];
+ char timesource;
+ char dststatus;
+ char quarzstatus;
+ int antenna1;
+ int antenna2;
+ int utc_year;
+ int utc_month;
+ int utc_day;
+ int utc_hour;
+ int utc_minute;
+ int utc_second;
+ int utc_msec;
+};
+
+static int neoclock4x_start (int, struct peer *);
+static void neoclock4x_shutdown (int, struct peer *);
+static void neoclock4x_receive (struct recvbuf *);
+static void neoclock4x_poll (int, struct peer *);
+static void neoclock4x_control (int, const struct refclockstat *, struct refclockstat *, struct peer *);
+
+static int neol_atoi_len (const char str[], int *, int);
+static int neol_hexatoi_len (const char str[], int *, int);
+static void neol_jdn_to_ymd (unsigned long, int *, int *, int *);
+static void neol_localtime (unsigned long, int* , int*, int*, int*, int*, int*);
+static unsigned long neol_mktime (int, int, int, int, int, int);
+#if !defined(NEOCLOCK4X_FIRMWARE)
+static int neol_query_firmware (int, int, char *, int);
+static int neol_check_firmware (int, const char*, char *);
+#endif
+
+struct refclock refclock_neoclock4x = {
+ neoclock4x_start, /* start up driver */
+ neoclock4x_shutdown, /* shut down driver */
+ neoclock4x_poll, /* transmit poll message */
+ neoclock4x_control,
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+static int
+neoclock4x_start(int unit,
+ struct peer *peer)
+{
+ struct neoclock4x_unit *up;
+ struct refclockproc *pp;
+ int fd;
+ char dev[20];
+ int sl232;
+#if defined(HAVE_TERMIOS)
+ struct termios termsettings;
+#endif
+#if !defined(NEOCLOCK4X_FIRMWARE)
+ int tries;
+#endif
+
+ (void) snprintf(dev, sizeof(dev)-1, "/dev/neoclock4x-%d", unit);
+
+ /* LDISC_STD, LDISC_RAW
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ fd = refclock_open(dev, B2400, LDISC_STD);
+ if(fd <= 0)
+ {
+ return (0);
+ }
+
+#if defined(HAVE_TERMIOS)
+
+#if 1
+ if(tcgetattr(fd, &termsettings) < 0)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): (tcgetattr) can't query serial port settings: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+
+ /* 2400 Baud 8N2 */
+ termsettings.c_iflag = IGNBRK | IGNPAR | ICRNL;
+ termsettings.c_oflag = 0;
+ termsettings.c_cflag = CS8 | CSTOPB | CLOCAL | CREAD;
+ (void)cfsetispeed(&termsettings, (u_int)B2400);
+ (void)cfsetospeed(&termsettings, (u_int)B2400);
+
+ if(tcsetattr(fd, TCSANOW, &termsettings) < 0)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): (tcsetattr) can't set serial port 2400 8N2: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+
+#else
+ if(tcgetattr(fd, &termsettings) < 0)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): (tcgetattr) can't query serial port settings: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+
+ /* 2400 Baud 8N2 */
+ termsettings.c_cflag &= ~PARENB;
+ termsettings.c_cflag |= CSTOPB;
+ termsettings.c_cflag &= ~CSIZE;
+ termsettings.c_cflag |= CS8;
+
+ if(tcsetattr(fd, TCSANOW, &termsettings) < 0)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): (tcsetattr) can't set serial port 2400 8N2: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+#endif
+
+#elif defined(HAVE_SYSV_TTYS)
+ if(ioctl(fd, TCGETA, &termsettings) < 0)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): (TCGETA) can't query serial port settings: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+
+ /* 2400 Baud 8N2 */
+ termsettings.c_cflag &= ~PARENB;
+ termsettings.c_cflag |= CSTOPB;
+ termsettings.c_cflag &= ~CSIZE;
+ termsettings.c_cflag |= CS8;
+
+ if(ioctl(fd, TCSETA, &termsettings) < 0)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): (TSGETA) can't set serial port 2400 8N2: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+#else
+ msyslog(LOG_EMERG, "NeoClock4X(%d): don't know how to set port to 2400 8N2 with this OS!", unit);
+ (void) close(fd);
+ return (0);
+#endif
+
+#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
+ /* turn on RTS, and DTR for power supply */
+ /* NeoClock4x is powered from serial line */
+ if(ioctl(fd, TIOCMGET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): can't query RTS/DTR state: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+#ifdef TIOCM_RTS
+ sl232 = sl232 | TIOCM_DTR | TIOCM_RTS; /* turn on RTS, and DTR for power supply */
+#else
+ sl232 = sl232 | CIOCM_DTR | CIOCM_RTS; /* turn on RTS, and DTR for power supply */
+#endif
+ if(ioctl(fd, TIOCMSET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): can't set RTS/DTR to power neoclock4x: %m", unit);
+ (void) close(fd);
+ return (0);
+ }
+#else
+ msyslog(LOG_EMERG, "NeoClock4X(%d): don't know how to set DTR/RTS to power NeoClock4X with this OS!",
+ unit);
+ (void) close(fd);
+ return (0);
+#endif
+
+ up = (struct neoclock4x_unit *) emalloc(sizeof(struct neoclock4x_unit));
+ if(!(up))
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): can't allocate memory for: %m",unit);
+ (void) close(fd);
+ return (0);
+ }
+
+ memset((char *)up, 0, sizeof(struct neoclock4x_unit));
+ pp = peer->procptr;
+ pp->clockdesc = "NeoClock4X";
+ pp->unitptr = up;
+ pp->io.clock_recv = neoclock4x_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ /*
+ * no fudge time is given by user!
+ * use 169.583333 ms to compensate the serial line delay
+ * formula is:
+ * 2400 Baud / 11 bit = 218.18 charaters per second
+ * (NeoClock4X timecode len)
+ */
+ pp->fudgetime1 = (NEOCLOCK4X_TIMECODELEN * 11) / 2400.0;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = -10;
+ memcpy((char *)&pp->refid, "neol", 4);
+
+ up->leap_status = 0;
+ up->unit = unit;
+ strlcpy(up->firmware, "?", sizeof(up->firmware));
+ up->firmwaretag = '?';
+ strlcpy(up->serial, "?", sizeof(up->serial));
+ strlcpy(up->radiosignal, "?", sizeof(up->radiosignal));
+ up->timesource = '?';
+ up->dststatus = '?';
+ up->quarzstatus = '?';
+ up->antenna1 = -1;
+ up->antenna2 = -1;
+ up->utc_year = 0;
+ up->utc_month = 0;
+ up->utc_day = 0;
+ up->utc_hour = 0;
+ up->utc_minute = 0;
+ up->utc_second = 0;
+ up->utc_msec = 0;
+
+#if defined(NEOCLOCK4X_FIRMWARE)
+#if NEOCLOCK4X_FIRMWARE == NEOCLOCK4X_FIRMWARE_VERSION_A
+ strlcpy(up->firmware, "(c) 2002 NEOL S.A. FRANCE / L0.01 NDF:A:* (compile time)",
+ sizeof(up->firmware));
+ up->firmwaretag = 'A';
+#else
+ msyslog(LOG_EMERG, "NeoClock4X(%d): unknown firmware defined at compile time for NeoClock4X",
+ unit);
+ (void) close(fd);
+ pp->io.fd = -1;
+ free(pp->unitptr);
+ pp->unitptr = NULL;
+ return (0);
+#endif
+#else
+ for(tries=0; tries < 5; tries++)
+ {
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO, "NeoClock4X(%d): checking NeoClock4X firmware version (%d/5)", unit, tries);
+ /* wait 3 seconds for receiver to power up */
+ sleep(3);
+ if(neol_query_firmware(pp->io.fd, up->unit, up->firmware, sizeof(up->firmware)))
+ {
+ break;
+ }
+ }
+
+ /* can I handle this firmware version? */
+ if(!neol_check_firmware(up->unit, up->firmware, &up->firmwaretag))
+ {
+ (void) close(fd);
+ pp->io.fd = -1;
+ free(pp->unitptr);
+ pp->unitptr = NULL;
+ return (0);
+ }
+#endif
+
+ if(!io_addclock(&pp->io))
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): error add peer to ntpd: %m", unit);
+ (void) close(fd);
+ pp->io.fd = -1;
+ free(pp->unitptr);
+ pp->unitptr = NULL;
+ return (0);
+ }
+
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO, "NeoClock4X(%d): receiver setup successful done", unit);
+
+ return (1);
+}
+
+static void
+neoclock4x_shutdown(int unit,
+ struct peer *peer)
+{
+ struct neoclock4x_unit *up;
+ struct refclockproc *pp;
+ int sl232;
+
+ if(NULL != peer)
+ {
+ pp = peer->procptr;
+ if(pp != NULL)
+ {
+ up = pp->unitptr;
+ if(up != NULL)
+ {
+ if(-1 != pp->io.fd)
+ {
+#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
+ /* turn on RTS, and DTR for power supply */
+ /* NeoClock4x is powered from serial line */
+ if(ioctl(pp->io.fd, TIOCMGET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): can't query RTS/DTR state: %m",
+ unit);
+ }
+#ifdef TIOCM_RTS
+ /* turn on RTS, and DTR for power supply */
+ sl232 &= ~(TIOCM_DTR | TIOCM_RTS);
+#else
+ /* turn on RTS, and DTR for power supply */
+ sl232 &= ~(CIOCM_DTR | CIOCM_RTS);
+#endif
+ if(ioctl(pp->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): can't set RTS/DTR to power neoclock4x: %m",
+ unit);
+ }
+#endif
+ io_closeclock(&pp->io);
+ }
+ free(up);
+ pp->unitptr = NULL;
+ }
+ }
+ }
+
+ msyslog(LOG_ERR, "NeoClock4X(%d): shutdown", unit);
+
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO, "NeoClock4X(%d): receiver shutdown done", unit);
+}
+
+static void
+neoclock4x_receive(struct recvbuf *rbufp)
+{
+ struct neoclock4x_unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ unsigned long calc_utc;
+ int day;
+ int month; /* ddd conversion */
+ int c;
+ int dsec;
+ unsigned char calc_chksum;
+ int recv_chksum;
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /* wait till poll interval is reached */
+ if(0 == up->recvnow)
+ return;
+
+ /* reset poll interval flag */
+ up->recvnow = 0;
+
+ /* read last received timecode */
+ pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &pp->lastrec);
+ pp->leap = LEAP_NOWARNING;
+
+ if(NEOCLOCK4X_TIMECODELEN != pp->lencode)
+ {
+ NLOG(NLOG_CLOCKEVENT)
+ msyslog(LOG_WARNING, "NeoClock4X(%d): received data has invalid length, expected %d bytes, received %d bytes: %s",
+ up->unit, NEOCLOCK4X_TIMECODELEN, pp->lencode, pp->a_lastcode);
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_CRC], &recv_chksum, 2);
+
+ /* calculate checksum */
+ calc_chksum = 0;
+ for(c=0; c < NEOCLOCK4X_OFFSET_CRC; c++)
+ {
+ calc_chksum += pp->a_lastcode[c];
+ }
+ if(recv_chksum != calc_chksum)
+ {
+ NLOG(NLOG_CLOCKEVENT)
+ msyslog(LOG_WARNING, "NeoClock4X(%d): received data has invalid chksum: %s",
+ up->unit, pp->a_lastcode);
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /* Allow synchronization even is quartz clock is
+ * never initialized.
+ * WARNING: This is dangerous!
+ */
+ up->quarzstatus = pp->a_lastcode[NEOCLOCK4X_OFFSET_QUARZSTATUS];
+ if(0==(pp->sloppyclockflag & CLK_FLAG2))
+ {
+ if('I' != up->quarzstatus)
+ {
+ NLOG(NLOG_CLOCKEVENT)
+ msyslog(LOG_NOTICE, "NeoClock4X(%d): quartz clock is not initialized: %s",
+ up->unit, pp->a_lastcode);
+ pp->leap = LEAP_NOTINSYNC;
+ refclock_report(peer, CEVNT_BADDATE);
+ return;
+ }
+ }
+ if('I' != up->quarzstatus)
+ {
+ NLOG(NLOG_CLOCKEVENT)
+ msyslog(LOG_NOTICE, "NeoClock4X(%d): using uninitialized quartz clock for time synchronization: %s",
+ up->unit, pp->a_lastcode);
+ }
+
+ /*
+ * If NeoClock4X is not synchronized to a radio clock
+ * check if we're allowed to synchronize with the quartz
+ * clock.
+ */
+ up->timesource = pp->a_lastcode[NEOCLOCK4X_OFFSET_TIMESOURCE];
+ if(0==(pp->sloppyclockflag & CLK_FLAG2))
+ {
+ if('A' != up->timesource)
+ {
+ /* not allowed to sync with quartz clock */
+ if(0==(pp->sloppyclockflag & CLK_FLAG1))
+ {
+ refclock_report(peer, CEVNT_BADTIME);
+ pp->leap = LEAP_NOTINSYNC;
+ return;
+ }
+ }
+ }
+
+ /* this should only used when first install is done */
+ if(pp->sloppyclockflag & CLK_FLAG4)
+ {
+ msyslog(LOG_DEBUG, "NeoClock4X(%d): received data: %s",
+ up->unit, pp->a_lastcode);
+ }
+
+ /* 123456789012345678901234567890123456789012345 */
+ /* S/N123456DCF1004021010001202ASX1213CR\r\n */
+
+ neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_YEAR], &pp->year, 2);
+ neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_MONTH], &month, 2);
+ neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_DAY], &day, 2);
+ neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_HOUR], &pp->hour, 2);
+ neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_MINUTE], &pp->minute, 2);
+ neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_SECOND], &pp->second, 2);
+ neol_atoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_HSEC], &dsec, 2);
+#if defined(NTP_PRE_420)
+ pp->msec = dsec * 10; /* convert 1/100s from neoclock to real miliseconds */
+#else
+ pp->nsec = dsec * 10 * NSEC_TO_MILLI; /* convert 1/100s from neoclock to nanoseconds */
+#endif
+
+ memcpy(up->radiosignal, &pp->a_lastcode[NEOCLOCK4X_OFFSET_RADIOSIGNAL], 3);
+ up->radiosignal[3] = 0;
+ memcpy(up->serial, &pp->a_lastcode[NEOCLOCK4X_OFFSET_SERIAL], 6);
+ up->serial[6] = 0;
+ up->dststatus = pp->a_lastcode[NEOCLOCK4X_OFFSET_DSTSTATUS];
+ neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_ANTENNA1], &up->antenna1, 2);
+ neol_hexatoi_len(&pp->a_lastcode[NEOCLOCK4X_OFFSET_ANTENNA2], &up->antenna2, 2);
+
+ /*
+ Validate received values at least enough to prevent internal
+ array-bounds problems, etc.
+ */
+ if((pp->hour < 0) || (pp->hour > 23) ||
+ (pp->minute < 0) || (pp->minute > 59) ||
+ (pp->second < 0) || (pp->second > 60) /*Allow for leap seconds.*/ ||
+ (day < 1) || (day > 31) ||
+ (month < 1) || (month > 12) ||
+ (pp->year < 0) || (pp->year > 99)) {
+ /* Data out of range. */
+ NLOG(NLOG_CLOCKEVENT)
+ msyslog(LOG_WARNING, "NeoClock4X(%d): date/time out of range: %s",
+ up->unit, pp->a_lastcode);
+ refclock_report(peer, CEVNT_BADDATE);
+ return;
+ }
+
+ /* Year-2000 check not needed anymore. Same problem
+ * will arise at 2099 but what should we do...?
+ *
+ * wrap 2-digit date into 4-digit
+ *
+ * if(pp->year < YEAR_PIVOT)
+ * {
+ * pp->year += 100;
+ * }
+ */
+ pp->year += 2000;
+
+ /* adjust NeoClock4X local time to UTC */
+ calc_utc = neol_mktime(pp->year, month, day, pp->hour, pp->minute, pp->second);
+ calc_utc -= 3600;
+ /* adjust NeoClock4X daylight saving time if needed */
+ if('S' == up->dststatus)
+ calc_utc -= 3600;
+ neol_localtime(calc_utc, &pp->year, &month, &day, &pp->hour, &pp->minute, &pp->second);
+
+ /*
+ some preparations
+ */
+ pp->day = ymd2yd(pp->year, month, day);
+ pp->leap = 0;
+
+ if(pp->sloppyclockflag & CLK_FLAG4)
+ {
+ msyslog(LOG_DEBUG, "NeoClock4X(%d): calculated UTC date/time: %04d-%02d-%02d %02d:%02d:%02d.%03ld",
+ up->unit,
+ pp->year, month, day,
+ pp->hour, pp->minute, pp->second,
+#if defined(NTP_PRE_420)
+ pp->msec
+#else
+ pp->nsec/NSEC_TO_MILLI
+#endif
+ );
+ }
+
+ up->utc_year = pp->year;
+ up->utc_month = month;
+ up->utc_day = day;
+ up->utc_hour = pp->hour;
+ up->utc_minute = pp->minute;
+ up->utc_second = pp->second;
+#if defined(NTP_PRE_420)
+ up->utc_msec = pp->msec;
+#else
+ up->utc_msec = pp->nsec/NSEC_TO_MILLI;
+#endif
+
+ if(!refclock_process(pp))
+ {
+ NLOG(NLOG_CLOCKEVENT)
+ msyslog(LOG_WARNING, "NeoClock4X(%d): refclock_process failed!", up->unit);
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+ refclock_receive(peer);
+
+ /* report good status */
+ refclock_report(peer, CEVNT_NOMINAL);
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+}
+
+static void
+neoclock4x_poll(int unit,
+ struct peer *peer)
+{
+ struct neoclock4x_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ pp->polls++;
+ up->recvnow = 1;
+}
+
+static void
+neoclock4x_control(int unit,
+ const struct refclockstat *in,
+ struct refclockstat *out,
+ struct peer *peer)
+{
+ struct neoclock4x_unit *up;
+ struct refclockproc *pp;
+
+ if(NULL == peer)
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
+ return;
+ }
+
+ pp = peer->procptr;
+ if(NULL == pp)
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
+ return;
+ }
+
+ up = pp->unitptr;
+ if(NULL == up)
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): control: unit invalid/inactive", unit);
+ return;
+ }
+
+ if(NULL != in)
+ {
+ /* check to see if a user supplied time offset is given */
+ if(in->haveflags & CLK_HAVETIME1)
+ {
+ pp->fudgetime1 = in->fudgetime1;
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_NOTICE, "NeoClock4X(%d): using fudgetime1 with %0.5fs from ntp.conf.",
+ unit, pp->fudgetime1);
+ }
+
+ /* notify */
+ if(pp->sloppyclockflag & CLK_FLAG1)
+ {
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_NOTICE, "NeoClock4X(%d): quartz clock is used to synchronize time if radio clock has no reception.", unit);
+ }
+ else
+ {
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_NOTICE, "NeoClock4X(%d): time is only adjusted with radio signal reception.", unit);
+ }
+ }
+
+ if(NULL != out)
+ {
+ char *tt;
+ char tmpbuf[80];
+
+ out->kv_list = (struct ctl_var *)0;
+ out->type = REFCLK_NEOCLOCK4X;
+
+ snprintf(tmpbuf, sizeof(tmpbuf)-1,
+ "%04d-%02d-%02d %02d:%02d:%02d.%03d",
+ up->utc_year, up->utc_month, up->utc_day,
+ up->utc_hour, up->utc_minute, up->utc_second,
+ up->utc_msec);
+ tt = add_var(&out->kv_list, sizeof(tmpbuf)-1, RO|DEF);
+ snprintf(tt, sizeof(tmpbuf)-1, "calc_utc=\"%s\"", tmpbuf);
+
+ tt = add_var(&out->kv_list, 40, RO|DEF);
+ snprintf(tt, 39, "radiosignal=\"%s\"", up->radiosignal);
+ tt = add_var(&out->kv_list, 40, RO|DEF);
+ snprintf(tt, 39, "antenna1=\"%d\"", up->antenna1);
+ tt = add_var(&out->kv_list, 40, RO|DEF);
+ snprintf(tt, 39, "antenna2=\"%d\"", up->antenna2);
+ tt = add_var(&out->kv_list, 40, RO|DEF);
+ if('A' == up->timesource)
+ snprintf(tt, 39, "timesource=\"radio\"");
+ else if('C' == up->timesource)
+ snprintf(tt, 39, "timesource=\"quartz\"");
+ else
+ snprintf(tt, 39, "timesource=\"unknown\"");
+ tt = add_var(&out->kv_list, 40, RO|DEF);
+ if('I' == up->quarzstatus)
+ snprintf(tt, 39, "quartzstatus=\"synchronized\"");
+ else if('X' == up->quarzstatus)
+ snprintf(tt, 39, "quartzstatus=\"not synchronized\"");
+ else
+ snprintf(tt, 39, "quartzstatus=\"unknown\"");
+ tt = add_var(&out->kv_list, 40, RO|DEF);
+ if('S' == up->dststatus)
+ snprintf(tt, 39, "dststatus=\"summer\"");
+ else if('W' == up->dststatus)
+ snprintf(tt, 39, "dststatus=\"winter\"");
+ else
+ snprintf(tt, 39, "dststatus=\"unknown\"");
+ tt = add_var(&out->kv_list, 80, RO|DEF);
+ snprintf(tt, 79, "firmware=\"%s\"", up->firmware);
+ tt = add_var(&out->kv_list, 40, RO|DEF);
+ snprintf(tt, 39, "firmwaretag=\"%c\"", up->firmwaretag);
+ tt = add_var(&out->kv_list, 80, RO|DEF);
+ snprintf(tt, 79, "driver version=\"%s\"", NEOCLOCK4X_DRIVER_VERSION);
+ tt = add_var(&out->kv_list, 80, RO|DEF);
+ snprintf(tt, 79, "serialnumber=\"%s\"", up->serial);
+ }
+}
+
+static int
+neol_hexatoi_len(const char str[],
+ int *result,
+ int maxlen)
+{
+ int hexdigit;
+ int i;
+ int n = 0;
+
+ for(i=0; isxdigit((int)str[i]) && i < maxlen; i++)
+ {
+ hexdigit = isdigit((int)str[i]) ? toupper(str[i]) - '0' : toupper(str[i]) - 'A' + 10;
+ n = 16 * n + hexdigit;
+ }
+ *result = n;
+ return (n);
+}
+
+static int
+neol_atoi_len(const char str[],
+ int *result,
+ int maxlen)
+{
+ int digit;
+ int i;
+ int n = 0;
+
+ for(i=0; isdigit((int)str[i]) && i < maxlen; i++)
+ {
+ digit = str[i] - '0';
+ n = 10 * n + digit;
+ }
+ *result = n;
+ return (n);
+}
+
+/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
+ * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
+ * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
+ *
+ * [For the Julian calendar (which was used in Russia before 1917,
+ * Britain & colonies before 1752, anywhere else before 1582,
+ * and is still in use by some communities) leave out the
+ * -year/100+year/400 terms, and add 10.]
+ *
+ * This algorithm was first published by Gauss (I think).
+ *
+ * WARNING: this function will overflow on 2106-02-07 06:28:16 on
+ * machines were long is 32-bit! (However, as time_t is signed, we
+ * will already get problems at other places on 2038-01-19 03:14:08)
+ */
+static unsigned long
+neol_mktime(int year,
+ int mon,
+ int day,
+ int hour,
+ int min,
+ int sec)
+{
+ if (0 >= (int) (mon -= 2)) { /* 1..12 . 11,12,1..10 */
+ mon += 12; /* Puts Feb last since it has leap day */
+ year -= 1;
+ }
+ return (((
+ (unsigned long)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
+ year*365 - 719499
+ )*24 + hour /* now have hours */
+ )*60 + min /* now have minutes */
+ )*60 + sec; /* finally seconds */
+}
+
+static void
+neol_localtime(unsigned long utc,
+ int* year,
+ int* month,
+ int* day,
+ int* hour,
+ int* min,
+ int* sec)
+{
+ *sec = utc % 60;
+ utc /= 60;
+ *min = utc % 60;
+ utc /= 60;
+ *hour = utc % 24;
+ utc /= 24;
+
+ /* JDN Date 1/1/1970 */
+ neol_jdn_to_ymd(utc + 2440588L, year, month, day);
+}
+
+static void
+neol_jdn_to_ymd(unsigned long jdn,
+ int *yy,
+ int *mm,
+ int *dd)
+{
+ unsigned long x, z, m, d, y;
+ unsigned long daysPer400Years = 146097UL;
+ unsigned long fudgedDaysPer4000Years = 1460970UL + 31UL;
+
+ x = jdn + 68569UL;
+ z = 4UL * x / daysPer400Years;
+ x = x - (daysPer400Years * z + 3UL) / 4UL;
+ y = 4000UL * (x + 1) / fudgedDaysPer4000Years;
+ x = x - 1461UL * y / 4UL + 31UL;
+ m = 80UL * x / 2447UL;
+ d = x - 2447UL * m / 80UL;
+ x = m / 11UL;
+ m = m + 2UL - 12UL * x;
+ y = 100UL * (z - 49UL) + y + x;
+
+ *yy = (int)y;
+ *mm = (int)m;
+ *dd = (int)d;
+}
+
+#if !defined(NEOCLOCK4X_FIRMWARE)
+static int
+neol_query_firmware(int fd,
+ int unit,
+ char *firmware,
+ int maxlen)
+{
+ char tmpbuf[256];
+ int len;
+ int lastsearch;
+ unsigned char c;
+ int last_c_was_crlf;
+ int last_crlf_conv_len;
+ int init;
+ int read_errors;
+ int flag = 0;
+ int chars_read;
+
+ /* wait a little bit */
+ sleep(1);
+ if(-1 != write(fd, "V", 1))
+ {
+ /* wait a little bit */
+ sleep(1);
+ memset(tmpbuf, 0x00, sizeof(tmpbuf));
+
+ len = 0;
+ lastsearch = 0;
+ last_c_was_crlf = 0;
+ last_crlf_conv_len = 0;
+ init = 1;
+ read_errors = 0;
+ chars_read = 0;
+ for(;;)
+ {
+ if(read_errors > 5)
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): can't read firmware version (timeout)", unit);
+ strlcpy(tmpbuf, "unknown due to timeout", sizeof(tmpbuf));
+ break;
+ }
+ if(chars_read > 500)
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): can't read firmware version (garbage)", unit);
+ strlcpy(tmpbuf, "unknown due to garbage input", sizeof(tmpbuf));
+ break;
+ }
+ if(-1 == read(fd, &c, 1))
+ {
+ if(EAGAIN != errno)
+ {
+ msyslog(LOG_DEBUG, "NeoClock4x(%d): read: %m", unit);
+ read_errors++;
+ }
+ else
+ {
+ sleep(1);
+ }
+ continue;
+ }
+ else
+ {
+ chars_read++;
+ }
+
+ if(init)
+ {
+ if(0xA9 != c) /* wait for (c) char in input stream */
+ continue;
+
+ strlcpy(tmpbuf, "(c)", sizeof(tmpbuf));
+ len = 3;
+ init = 0;
+ continue;
+ }
+
+#if 0
+ msyslog(LOG_NOTICE, "NeoClock4X(%d): firmware %c = %02Xh", unit, c, c);
+#endif
+
+ if(0x0A == c || 0x0D == c)
+ {
+ if(last_c_was_crlf)
+ {
+ char *ptr;
+ ptr = strstr(&tmpbuf[lastsearch], "S/N");
+ if(NULL != ptr)
+ {
+ tmpbuf[last_crlf_conv_len] = 0;
+ flag = 1;
+ break;
+ }
+ /* convert \n to / */
+ last_crlf_conv_len = len;
+ tmpbuf[len++] = ' ';
+ tmpbuf[len++] = '/';
+ tmpbuf[len++] = ' ';
+ lastsearch = len;
+ }
+ last_c_was_crlf = 1;
+ }
+ else
+ {
+ last_c_was_crlf = 0;
+ if(0x00 != c)
+ tmpbuf[len++] = (char) c;
+ }
+ tmpbuf[len] = '\0';
+ if(len > sizeof(tmpbuf)-5)
+ break;
+ }
+ }
+ else
+ {
+ msyslog(LOG_ERR, "NeoClock4X(%d): can't query firmware version", unit);
+ strlcpy(tmpbuf, "unknown error", sizeof(tmpbuf));
+ }
+ if (strlcpy(firmware, tmpbuf, maxlen) >= maxlen)
+ strlcpy(firmware, "buffer too small", maxlen);
+
+ if(flag)
+ {
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO, "NeoClock4X(%d): firmware version: %s", unit, firmware);
+
+ if(strstr(firmware, "/R2"))
+ {
+ msyslog(LOG_INFO, "NeoClock4X(%d): Your NeoClock4X uses the new R2 firmware release. Please note the changed LED behaviour.", unit);
+ }
+
+ }
+
+ return (flag);
+}
+
+static int
+neol_check_firmware(int unit,
+ const char *firmware,
+ char *firmwaretag)
+{
+ char *ptr;
+
+ *firmwaretag = '?';
+ ptr = strstr(firmware, "NDF:");
+ if(NULL != ptr)
+ {
+ if((strlen(firmware) - strlen(ptr)) >= 7)
+ {
+ if(':' == *(ptr+5) && '*' == *(ptr+6))
+ *firmwaretag = *(ptr+4);
+ }
+ }
+
+ if('A' != *firmwaretag)
+ {
+ msyslog(LOG_CRIT, "NeoClock4X(%d): firmware version \"%c\" not supported with this driver version!", unit, *firmwaretag);
+ return (0);
+ }
+
+ return (1);
+}
+#endif
+
+#else
+int refclock_neoclock4x_bs;
+#endif /* REFCLOCK */
+
+/*
+ * History:
+ * refclock_neoclock4x.c
+ *
+ * 2002/04/27 cjh
+ * Revision 1.0 first release
+ *
+ * 2002/07/15 cjh
+ * preparing for bitkeeper reposity
+ *
+ * 2002/09/09 cjh
+ * Revision 1.1
+ * - don't assume sprintf returns an int anymore
+ * - change the way the firmware version is read
+ * - some customers would like to put a device called
+ * data diode to the NeoClock4X device to disable
+ * the write line. We need to now the firmware
+ * version even in this case. We made a compile time
+ * definition in this case. The code was previously
+ * only available on request.
+ *
+ * 2003/01/08 cjh
+ * Revision 1.11
+ * - changing xprinf to xnprinf to avoid buffer overflows
+ * - change some logic
+ * - fixed memory leaks if drivers can't initialize
+ *
+ * 2003/01/10 cjh
+ * Revision 1.12
+ * - replaced ldiv
+ * - add code to support FreeBSD
+ *
+ * 2003/07/07 cjh
+ * Revision 1.13
+ * - fix reporting of clock status
+ * changes. previously a bad clock
+ * status was never reset.
+ *
+ * 2004/04/07 cjh
+ * Revision 1.14
+ * - open serial port in a way
+ * AIX and some other OS can
+ * handle much better
+ *
+ * 2006/01/11 cjh
+ * Revision 1.15
+ * - remove some unsued #ifdefs
+ * - fix nsec calculation, closes #499
+ *
+ * 2009/12/04 cjh
+ * Revision 1.16
+ * - change license to ntp COPYRIGHT notice. This should allow Debian
+ * to add this refclock driver in further releases.
+ * - detect R2 hardware
+ *
+ */
+
+
+
+
+
+
diff --git a/ntpd/refclock_nmea.c b/ntpd/refclock_nmea.c
new file mode 100644
index 0000000..58867f4
--- /dev/null
+++ b/ntpd/refclock_nmea.c
@@ -0,0 +1,1956 @@
+/*
+ * refclock_nmea.c - clock driver for an NMEA GPS CLOCK
+ * Michael Petry Jun 20, 1994
+ * based on refclock_heathn.c
+ *
+ * Updated to add support for Accord GPS Clock
+ * Venu Gopal Dec 05, 2007
+ * neo.venu@gmail.com, venugopal_d@pgad.gov.in
+ *
+ * Updated to process 'time1' fudge factor
+ * Venu Gopal May 05, 2008
+ *
+ * Converted to common PPSAPI code, separate PPS fudge time1
+ * from serial timecode fudge time2.
+ * Dave Hart July 1, 2009
+ * hart@ntp.org, davehart@davehart.com
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_NMEA)
+
+#define NMEA_WRITE_SUPPORT 0 /* no write support at the moment */
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "timespecops.h"
+
+#ifdef HAVE_PPSAPI
+# include "ppsapi_timepps.h"
+# include "refclock_atom.h"
+#endif /* HAVE_PPSAPI */
+
+
+/*
+ * This driver supports NMEA-compatible GPS receivers
+ *
+ * Prototype was refclock_trak.c, Thanks a lot.
+ *
+ * The receiver used spits out the NMEA sentences for boat navigation.
+ * And you thought it was an information superhighway. Try a raging river
+ * filled with rapids and whirlpools that rip away your data and warp time.
+ *
+ * If HAVE_PPSAPI is defined code to use the PPSAPI will be compiled in.
+ * On startup if initialization of the PPSAPI fails, it will fall back
+ * to the "normal" timestamps.
+ *
+ * The PPSAPI part of the driver understands fudge flag2 and flag3. If
+ * flag2 is set, it will use the clear edge of the pulse. If flag3 is
+ * set, kernel hardpps is enabled.
+ *
+ * GPS sentences other than RMC (the default) may be enabled by setting
+ * the relevent bits of 'mode' in the server configuration line
+ * server 127.127.20.x mode X
+ *
+ * bit 0 - enables RMC (1)
+ * bit 1 - enables GGA (2)
+ * bit 2 - enables GLL (4)
+ * bit 3 - enables ZDA (8) - Standard Time & Date
+ * bit 3 - enables ZDG (8) - Accord GPS Clock's custom sentence with GPS time
+ * very close to standard ZDA
+ *
+ * Multiple sentences may be selected except when ZDG/ZDA is selected.
+ *
+ * bit 4/5/6 - selects the baudrate for serial port :
+ * 0 for 4800 (default)
+ * 1 for 9600
+ * 2 for 19200
+ * 3 for 38400
+ * 4 for 57600
+ * 5 for 115200
+ */
+#define NMEA_MESSAGE_MASK 0x0000FF0FU
+#define NMEA_BAUDRATE_MASK 0x00000070U
+#define NMEA_BAUDRATE_SHIFT 4
+
+#define NMEA_DELAYMEAS_MASK 0x80
+#define NMEA_EXTLOG_MASK 0x00010000U
+#define NMEA_DATETRUST_MASK 0x02000000U
+
+#define NMEA_PROTO_IDLEN 5 /* tag name must be at least 5 chars */
+#define NMEA_PROTO_MINLEN 6 /* min chars in sentence, excluding CS */
+#define NMEA_PROTO_MAXLEN 80 /* max chars in sentence, excluding CS */
+#define NMEA_PROTO_FIELDS 32 /* not official; limit on fields per record */
+
+/*
+ * We check the timecode format and decode its contents. We only care
+ * about a few of them, the most important being the $GPRMC format:
+ *
+ * $GPRMC,hhmmss,a,fddmm.xx,n,dddmmm.xx,w,zz.z,yyy.,ddmmyy,dd,v*CC
+ *
+ * mode (0,1,2,3) selects sentence ANY/ALL, RMC, GGA, GLL, ZDA
+ * $GPGLL,3513.8385,S,14900.7851,E,232420.594,A*21
+ * $GPGGA,232420.59,3513.8385,S,14900.7851,E,1,05,3.4,00519,M,,,,*3F
+ * $GPRMC,232418.19,A,3513.8386,S,14900.7853,E,00.0,000.0,121199,12.,E*77
+ *
+ * Defining GPZDA to support Standard Time & Date
+ * sentence. The sentence has the following format
+ *
+ * $--ZDA,HHMMSS.SS,DD,MM,YYYY,TH,TM,*CS<CR><LF>
+ *
+ * Apart from the familiar fields,
+ * 'TH' Time zone Hours
+ * 'TM' Time zone Minutes
+ *
+ * Defining GPZDG to support Accord GPS Clock's custom NMEA
+ * sentence. The sentence has the following format
+ *
+ * $GPZDG,HHMMSS.S,DD,MM,YYYY,AA.BB,V*CS<CR><LF>
+ *
+ * It contains the GPS timestamp valid for next PPS pulse.
+ * Apart from the familiar fields,
+ * 'AA.BB' denotes the signal strength( should be < 05.00 )
+ * 'V' denotes the GPS sync status :
+ * '0' indicates INVALID time,
+ * '1' indicates accuracy of +/-20 ms
+ * '2' indicates accuracy of +/-100 ns
+ *
+ * Defining PGRMF for Garmin GPS Fix Data
+ * $PGRMF,WN,WS,DATE,TIME,LS,LAT,LAT_DIR,LON,LON_DIR,MODE,FIX,SPD,DIR,PDOP,TDOP
+ * WN -- GPS week number (weeks since 1980-01-06, mod 1024)
+ * WS -- GPS seconds in week
+ * LS -- GPS leap seconds, accumulated ( UTC + LS == GPS )
+ * FIX -- Fix type: 0=nofix, 1=2D, 2=3D
+ * DATE/TIME are standard date/time strings in UTC time scale
+ *
+ * The GPS time can be used to get the full century for the truncated
+ * date spec.
+ */
+
+/*
+ * Definitions
+ */
+#define DEVICE "/dev/gps%d" /* GPS serial device */
+#define PPSDEV "/dev/gpspps%d" /* PPSAPI device override */
+#define SPEED232 B4800 /* uart speed (4800 bps) */
+#define PRECISION (-9) /* precision assumed (about 2 ms) */
+#define PPS_PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "GPS\0" /* reference id */
+#define DESCRIPTION "NMEA GPS Clock" /* who we are */
+#ifndef O_NOCTTY
+#define M_NOCTTY 0
+#else
+#define M_NOCTTY O_NOCTTY
+#endif
+#ifndef O_NONBLOCK
+#define M_NONBLOCK 0
+#else
+#define M_NONBLOCK O_NONBLOCK
+#endif
+#define PPSOPENMODE (O_RDWR | M_NOCTTY | M_NONBLOCK)
+
+/* NMEA sentence array indexes for those we use */
+#define NMEA_GPRMC 0 /* recommended min. nav. */
+#define NMEA_GPGGA 1 /* fix and quality */
+#define NMEA_GPGLL 2 /* geo. lat/long */
+#define NMEA_GPZDA 3 /* date/time */
+/*
+ * $GPZDG is a proprietary sentence that violates the spec, by not
+ * using $P and an assigned company identifier to prefix the sentence
+ * identifier. When used with this driver, the system needs to be
+ * isolated from other NTP networks, as it operates in GPS time, not
+ * UTC as is much more common. GPS time is >15 seconds different from
+ * UTC due to not respecting leap seconds since 1970 or so. Other
+ * than the different timebase, $GPZDG is similar to $GPZDA.
+ */
+#define NMEA_GPZDG 4
+#define NMEA_PGRMF 5
+#define NMEA_ARRAY_SIZE (NMEA_PGRMF + 1)
+
+/*
+ * Sentence selection mode bits
+ */
+#define USE_GPRMC 0x00000001u
+#define USE_GPGGA 0x00000002u
+#define USE_GPGLL 0x00000004u
+#define USE_GPZDA 0x00000008u
+#define USE_PGRMF 0x00000100u
+
+/* mapping from sentence index to controlling mode bit */
+static const u_int32 sentence_mode[NMEA_ARRAY_SIZE] =
+{
+ USE_GPRMC,
+ USE_GPGGA,
+ USE_GPGLL,
+ USE_GPZDA,
+ USE_GPZDA,
+ USE_PGRMF
+};
+
+/* date formats we support */
+enum date_fmt {
+ DATE_1_DDMMYY, /* use 1 field with 2-digit year */
+ DATE_3_DDMMYYYY /* use 3 fields with 4-digit year */
+};
+
+/* results for 'field_init()'
+ *
+ * Note: If a checksum is present, the checksum test must pass OK or the
+ * sentence is tagged invalid.
+ */
+#define CHECK_EMPTY -1 /* no data */
+#define CHECK_INVALID 0 /* not a valid NMEA sentence */
+#define CHECK_VALID 1 /* valid but without checksum */
+#define CHECK_CSVALID 2 /* valid with checksum OK */
+
+/*
+ * Unit control structure
+ */
+typedef struct {
+#ifdef HAVE_PPSAPI
+ struct refclock_atom atom; /* PPSAPI structure */
+ int ppsapi_fd; /* fd used with PPSAPI */
+ u_char ppsapi_tried; /* attempt PPSAPI once */
+ u_char ppsapi_lit; /* time_pps_create() worked */
+ u_char ppsapi_gate; /* system is on PPS */
+#endif /* HAVE_PPSAPI */
+ u_char gps_time; /* use GPS time, not UTC */
+ u_short century_cache; /* cached current century */
+ l_fp last_reftime; /* last processed reference stamp */
+ short epoch_warp; /* last epoch warp, for logging */
+ /* tally stats, reset each poll cycle */
+ struct
+ {
+ u_int total;
+ u_int accepted;
+ u_int rejected; /* GPS said not enough signal */
+ u_int malformed; /* Bad checksum, invalid date or time */
+ u_int filtered; /* mode bits, not GPZDG, same second */
+ u_int pps_used;
+ }
+ tally;
+ /* per sentence checksum seen flag */
+ u_char cksum_type[NMEA_ARRAY_SIZE];
+} nmea_unit;
+
+/*
+ * helper for faster field access
+ */
+typedef struct {
+ char *base; /* buffer base */
+ char *cptr; /* current field ptr */
+ int blen; /* buffer length */
+ int cidx; /* current field index */
+} nmea_data;
+
+/*
+ * NMEA gps week/time information
+ * This record contains the number of weeks since 1980-01-06 modulo
+ * 1024, the seconds elapsed since start of the week, and the number of
+ * leap seconds that are the difference between GPS and UTC time scale.
+ */
+typedef struct {
+ u_int32 wt_time; /* seconds since weekstart */
+ u_short wt_week; /* week number */
+ short wt_leap; /* leap seconds */
+} gps_weektm;
+
+/*
+ * The GPS week time scale starts on Sunday, 1980-01-06. We need the
+ * rata die number of this day.
+ */
+#ifndef DAY_GPS_STARTS
+#define DAY_GPS_STARTS 722820
+#endif
+
+/*
+ * Function prototypes
+ */
+static void nmea_init (void);
+static int nmea_start (int, struct peer *);
+static void nmea_shutdown (int, struct peer *);
+static void nmea_receive (struct recvbuf *);
+static void nmea_poll (int, struct peer *);
+#ifdef HAVE_PPSAPI
+static void nmea_control (int, const struct refclockstat *,
+ struct refclockstat *, struct peer *);
+#define NMEA_CONTROL nmea_control
+#else
+#define NMEA_CONTROL noentry
+#endif /* HAVE_PPSAPI */
+static void nmea_timer (int, struct peer *);
+
+/* parsing helpers */
+static int field_init (nmea_data * data, char * cp, int len);
+static char * field_parse (nmea_data * data, int fn);
+static void field_wipe (nmea_data * data, ...);
+static u_char parse_qual (nmea_data * data, int idx,
+ char tag, int inv);
+static int parse_time (struct calendar * jd, long * nsec,
+ nmea_data *, int idx);
+static int parse_date (struct calendar *jd, nmea_data*,
+ int idx, enum date_fmt fmt);
+static int parse_weekdata (gps_weektm *, nmea_data *,
+ int weekidx, int timeidx, int leapidx);
+/* calendar / date helpers */
+static int unfold_day (struct calendar * jd, u_int32 rec_ui);
+static int unfold_century (struct calendar * jd, u_int32 rec_ui);
+static int gpsfix_century (struct calendar * jd, const gps_weektm * wd,
+ u_short * ccentury);
+static l_fp eval_gps_time (struct peer * peer, const struct calendar * gpst,
+ const struct timespec * gpso, const l_fp * recv);
+
+static int nmead_open (const char * device);
+static void save_ltc (struct refclockproc * const, const char * const,
+ size_t);
+
+/*
+ * If we want the driver to ouput sentences, too: re-enable the send
+ * support functions by defining NMEA_WRITE_SUPPORT to non-zero...
+ */
+#if NMEA_WRITE_SUPPORT
+
+static void gps_send(int, const char *, struct peer *);
+# ifdef SYS_WINNT
+# undef write /* ports/winnt/include/config.h: #define write _write */
+extern int async_write(int, const void *, unsigned int);
+# define write(fd, data, octets) async_write(fd, data, octets)
+# endif /* SYS_WINNT */
+
+#endif /* NMEA_WRITE_SUPPORT */
+
+static int32_t g_gpsMinBase;
+static int32_t g_gpsMinYear;
+
+/*
+ * -------------------------------------------------------------------
+ * Transfer vector
+ * -------------------------------------------------------------------
+ */
+struct refclock refclock_nmea = {
+ nmea_start, /* start up driver */
+ nmea_shutdown, /* shut down driver */
+ nmea_poll, /* transmit poll message */
+ NMEA_CONTROL, /* fudge control */
+ nmea_init, /* initialize driver */
+ noentry, /* buginfo */
+ nmea_timer /* called once per second */
+};
+
+/*
+ * -------------------------------------------------------------------
+ * nmea_init - initialise data
+ *
+ * calculates a few runtime constants that cannot be made compile time
+ * constants.
+ * -------------------------------------------------------------------
+ */
+static void
+nmea_init(void)
+{
+ struct calendar date;
+
+ /* - calculate min. base value for GPS epoch & century unfolding
+ * This assumes that the build system was roughly in sync with
+ * the world, and that really synchronising to a time before the
+ * program was created would be unsafe or insane. If the build
+ * date cannot be stablished, at least use the start of GPS
+ * (1980-01-06) as minimum, because GPS can surely NOT
+ * synchronise beyond it's own big bang. We add a little safety
+ * margin for the fuzziness of the build date, which is in an
+ * undefined time zone. */
+ if (ntpcal_get_build_date(&date))
+ g_gpsMinBase = ntpcal_date_to_rd(&date) - 2;
+ else
+ g_gpsMinBase = 0;
+
+ if (g_gpsMinBase < DAY_GPS_STARTS)
+ g_gpsMinBase = DAY_GPS_STARTS;
+
+ ntpcal_rd_to_date(&date, g_gpsMinBase);
+ g_gpsMinYear = date.year;
+ g_gpsMinBase -= DAY_NTP_STARTS;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * nmea_start - open the GPS devices and initialize data for processing
+ *
+ * return 0 on error, 1 on success. Even on error the peer structures
+ * must be in a state that permits 'nmea_shutdown()' to clean up all
+ * resources, because it will be called immediately to do so.
+ * -------------------------------------------------------------------
+ */
+static int
+nmea_start(
+ int unit,
+ struct peer * peer
+ )
+{
+ struct refclockproc * const pp = peer->procptr;
+ nmea_unit * const up = emalloc_zero(sizeof(*up));
+ char device[20];
+ size_t devlen;
+ u_int32 rate;
+ int baudrate;
+ char * baudtext;
+
+
+ /* Get baudrate choice from mode byte bits 4/5/6 */
+ rate = (peer->ttl & NMEA_BAUDRATE_MASK) >> NMEA_BAUDRATE_SHIFT;
+
+ switch (rate) {
+ case 0:
+ baudrate = SPEED232;
+ baudtext = "4800";
+ break;
+ case 1:
+ baudrate = B9600;
+ baudtext = "9600";
+ break;
+ case 2:
+ baudrate = B19200;
+ baudtext = "19200";
+ break;
+ case 3:
+ baudrate = B38400;
+ baudtext = "38400";
+ break;
+#ifdef B57600
+ case 4:
+ baudrate = B57600;
+ baudtext = "57600";
+ break;
+#endif
+#ifdef B115200
+ case 5:
+ baudrate = B115200;
+ baudtext = "115200";
+ break;
+#endif
+ default:
+ baudrate = SPEED232;
+ baudtext = "4800 (fallback)";
+ break;
+ }
+
+ /* Allocate and initialize unit structure */
+ pp->unitptr = (caddr_t)up;
+ pp->io.fd = -1;
+ pp->io.clock_recv = nmea_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ /* force change detection on first valid message */
+ memset(&up->last_reftime, 0xFF, sizeof(up->last_reftime));
+ /* force checksum on GPRMC, see below */
+ up->cksum_type[NMEA_GPRMC] = CHECK_CSVALID;
+#ifdef HAVE_PPSAPI
+ up->ppsapi_fd = -1;
+#endif
+ ZERO(up->tally);
+
+ /* Initialize miscellaneous variables */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, REFID, 4);
+
+ /* Open serial port. Use CLK line discipline, if available. */
+ devlen = snprintf(device, sizeof(device), DEVICE, unit);
+ if (devlen >= sizeof(device)) {
+ msyslog(LOG_ERR, "%s clock device name too long",
+ refnumtoa(&peer->srcadr));
+ return FALSE; /* buffer overflow */
+ }
+ pp->io.fd = refclock_open(device, baudrate, LDISC_CLK);
+ if (0 >= pp->io.fd) {
+ pp->io.fd = nmead_open(device);
+ if (-1 == pp->io.fd)
+ return FALSE;
+ }
+ LOGIF(CLOCKINFO, (LOG_NOTICE, "%s serial %s open at %s bps",
+ refnumtoa(&peer->srcadr), device, baudtext));
+
+ /* succeed if this clock can be added */
+ return io_addclock(&pp->io) != 0;
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * nmea_shutdown - shut down a GPS clock
+ *
+ * NOTE this routine is called after nmea_start() returns failure,
+ * as well as during a normal shutdown due to ntpq :config unpeer.
+ * -------------------------------------------------------------------
+ */
+static void
+nmea_shutdown(
+ int unit,
+ struct peer * peer
+ )
+{
+ struct refclockproc * const pp = peer->procptr;
+ nmea_unit * const up = (nmea_unit *)pp->unitptr;
+
+ UNUSED_ARG(unit);
+
+ if (up != NULL) {
+#ifdef HAVE_PPSAPI
+ if (up->ppsapi_lit)
+ time_pps_destroy(up->atom.handle);
+ if (up->ppsapi_tried && up->ppsapi_fd != pp->io.fd)
+ close(up->ppsapi_fd);
+#endif
+ free(up);
+ }
+ pp->unitptr = (caddr_t)NULL;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ pp->io.fd = -1;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * nmea_control - configure fudge params
+ * -------------------------------------------------------------------
+ */
+#ifdef HAVE_PPSAPI
+static void
+nmea_control(
+ int unit,
+ const struct refclockstat * in_st,
+ struct refclockstat * out_st,
+ struct peer * peer
+ )
+{
+ struct refclockproc * const pp = peer->procptr;
+ nmea_unit * const up = (nmea_unit *)pp->unitptr;
+
+ char device[32];
+ size_t devlen;
+
+ UNUSED_ARG(in_st);
+ UNUSED_ARG(out_st);
+
+ /*
+ * PPS control
+ *
+ * If /dev/gpspps$UNIT can be opened that will be used for
+ * PPSAPI. Otherwise, the GPS serial device /dev/gps$UNIT
+ * already opened is used for PPSAPI as well. (This might not
+ * work, in which case the PPS API remains unavailable...)
+ */
+
+ /* Light up the PPSAPI interface if not yet attempted. */
+ if ((CLK_FLAG1 & pp->sloppyclockflag) && !up->ppsapi_tried) {
+ up->ppsapi_tried = TRUE;
+ devlen = snprintf(device, sizeof(device), PPSDEV, unit);
+ if (devlen < sizeof(device)) {
+ up->ppsapi_fd = open(device, PPSOPENMODE,
+ S_IRUSR | S_IWUSR);
+ } else {
+ up->ppsapi_fd = -1;
+ msyslog(LOG_ERR, "%s PPS device name too long",
+ refnumtoa(&peer->srcadr));
+ }
+ if (-1 == up->ppsapi_fd)
+ up->ppsapi_fd = pp->io.fd;
+ if (refclock_ppsapi(up->ppsapi_fd, &up->atom)) {
+ /* use the PPS API for our own purposes now. */
+ up->ppsapi_lit = refclock_params(
+ pp->sloppyclockflag, &up->atom);
+ if (!up->ppsapi_lit) {
+ /* failed to configure, drop PPS unit */
+ time_pps_destroy(up->atom.handle);
+ msyslog(LOG_WARNING,
+ "%s set PPSAPI params fails",
+ refnumtoa(&peer->srcadr));
+ }
+ /* note: the PPS I/O handle remains valid until
+ * flag1 is cleared or the clock is shut down.
+ */
+ } else {
+ msyslog(LOG_WARNING,
+ "%s flag1 1 but PPSAPI fails",
+ refnumtoa(&peer->srcadr));
+ }
+ }
+
+ /* shut down PPS API if activated */
+ if (!(CLK_FLAG1 & pp->sloppyclockflag) && up->ppsapi_tried) {
+ /* shutdown PPS API */
+ if (up->ppsapi_lit)
+ time_pps_destroy(up->atom.handle);
+ up->atom.handle = 0;
+ /* close/drop PPS fd */
+ if (up->ppsapi_fd != pp->io.fd)
+ close(up->ppsapi_fd);
+ up->ppsapi_fd = -1;
+
+ /* clear markers and peer items */
+ up->ppsapi_gate = FALSE;
+ up->ppsapi_lit = FALSE;
+ up->ppsapi_tried = FALSE;
+
+ peer->flags &= ~FLAG_PPS;
+ peer->precision = PRECISION;
+ }
+}
+#endif /* HAVE_PPSAPI */
+
+/*
+ * -------------------------------------------------------------------
+ * nmea_timer - called once per second
+ * this only polls (older?) Oncore devices now
+ *
+ * Usually 'nmea_receive()' can get a timestamp every second, but at
+ * least one Motorola unit needs prompting each time. Doing so in
+ * 'nmea_poll()' gives only one sample per poll cycle, which actually
+ * defeats the purpose of the median filter. Polling once per second
+ * seems a much better idea.
+ * -------------------------------------------------------------------
+ */
+static void
+nmea_timer(
+ int unit,
+ struct peer * peer
+ )
+{
+#if NMEA_WRITE_SUPPORT
+
+ struct refclockproc * const pp = peer->procptr;
+
+ UNUSED_ARG(unit);
+
+ if (-1 != pp->io.fd) /* any mode bits to evaluate here? */
+ gps_send(pp->io.fd, "$PMOTG,RMC,0000*1D\r\n", peer);
+#else
+
+ UNUSED_ARG(unit);
+ UNUSED_ARG(peer);
+
+#endif /* NMEA_WRITE_SUPPORT */
+}
+
+#ifdef HAVE_PPSAPI
+/*
+ * -------------------------------------------------------------------
+ * refclock_ppsrelate(...) -- correlate with PPS edge
+ *
+ * This function is used to correlate a receive time stamp and a
+ * reference time with a PPS edge time stamp. It applies the necessary
+ * fudges (fudge1 for PPS, fudge2 for receive time) and then tries to
+ * move the receive time stamp to the corresponding edge. This can warp
+ * into future, if a transmission delay of more than 500ms is not
+ * compensated with a corresponding fudge time2 value, because then the
+ * next PPS edge is nearer than the last. (Similiar to what the PPS ATOM
+ * driver does, but we deal with full time stamps here, not just phase
+ * shift information.) Likewise, a negative fudge time2 value must be
+ * used if the reference time stamp correlates with the *following* PPS
+ * pulse.
+ *
+ * Note that the receive time fudge value only needs to move the receive
+ * stamp near a PPS edge but that close proximity is not required;
+ * +/-100ms precision should be enough. But since the fudge value will
+ * probably also be used to compensate the transmission delay when no
+ * PPS edge can be related to the time stamp, it's best to get it as
+ * close as possible.
+ *
+ * It should also be noted that the typical use case is matching to the
+ * preceeding edge, as most units relate their sentences to the current
+ * second.
+ *
+ * The function returns PPS_RELATE_NONE (0) if no PPS edge correlation
+ * can be fixed; PPS_RELATE_EDGE (1) when a PPS edge could be fixed, but
+ * the distance to the reference time stamp is too big (exceeds
+ * +/-400ms) and the ATOM driver PLL cannot be used to fix the phase;
+ * and PPS_RELATE_PHASE (2) when the ATOM driver PLL code can be used.
+ *
+ * On output, the receive time stamp is replaced with the corresponding
+ * PPS edge time if a fix could be made; the PPS fudge is updated to
+ * reflect the proper fudge time to apply. (This implies that
+ * 'refclock_process_offset()' must be used!)
+ * -------------------------------------------------------------------
+ */
+#define PPS_RELATE_NONE 0 /* no pps correlation possible */
+#define PPS_RELATE_EDGE 1 /* recv time fixed, no phase lock */
+#define PPS_RELATE_PHASE 2 /* recv time fixed, phase lock ok */
+
+static int
+refclock_ppsrelate(
+ const struct refclockproc * pp , /* for sanity */
+ const struct refclock_atom * ap , /* for PPS io */
+ const l_fp * reftime ,
+ l_fp * rd_stamp, /* i/o read stamp */
+ double pp_fudge, /* pps fudge */
+ double * rd_fudge /* i/o read fudge */
+ )
+{
+ pps_info_t pps_info;
+ struct timespec timeout;
+ l_fp pp_stamp, pp_delta;
+ double delta, idelta;
+
+ if (pp->leap == LEAP_NOTINSYNC)
+ return PPS_RELATE_NONE; /* clock is insane, no chance */
+
+ ZERO(timeout);
+ ZERO(pps_info);
+ if (time_pps_fetch(ap->handle, PPS_TSFMT_TSPEC,
+ &pps_info, &timeout) < 0)
+ return PPS_RELATE_NONE; /* can't get time stamps */
+
+ /* get last active PPS edge before receive */
+ if (ap->pps_params.mode & PPS_CAPTUREASSERT)
+ timeout = pps_info.assert_timestamp;
+ else if (ap->pps_params.mode & PPS_CAPTURECLEAR)
+ timeout = pps_info.clear_timestamp;
+ else
+ return PPS_RELATE_NONE; /* WHICH edge, please?!? */
+
+ /* get delta between receive time and PPS time */
+ pp_stamp = tspec_stamp_to_lfp(timeout);
+ pp_delta = *rd_stamp;
+ L_SUB(&pp_delta, &pp_stamp);
+ LFPTOD(&pp_delta, delta);
+ delta += pp_fudge - *rd_fudge;
+ if (fabs(delta) > 1.5)
+ return PPS_RELATE_NONE; /* PPS timeout control */
+
+ /* eventually warp edges, check phase */
+ idelta = floor(delta + 0.5);
+ pp_fudge -= idelta;
+ delta -= idelta;
+ if (fabs(delta) > 0.45)
+ return PPS_RELATE_NONE; /* dead band control */
+
+ /* we actually have a PPS edge to relate with! */
+ *rd_stamp = pp_stamp;
+ *rd_fudge = pp_fudge;
+
+ /* if whole system out-of-sync, do not try to PLL */
+ if (sys_leap == LEAP_NOTINSYNC)
+ return PPS_RELATE_EDGE; /* cannot PLL with atom code */
+
+ /* check against reftime if ATOM PLL can be used */
+ pp_delta = *reftime;
+ L_SUB(&pp_delta, &pp_stamp);
+ LFPTOD(&pp_delta, delta);
+ delta += pp_fudge;
+ if (fabs(delta) > 0.45)
+ return PPS_RELATE_EDGE; /* cannot PLL with atom code */
+
+ /* all checks passed, gets an AAA rating here! */
+ return PPS_RELATE_PHASE; /* can PLL with atom code */
+}
+#endif /* HAVE_PPSAPI */
+
+/*
+ * -------------------------------------------------------------------
+ * nmea_receive - receive data from the serial interface
+ *
+ * This is the workhorse for NMEA data evaluation:
+ *
+ * + it checks all NMEA data, and rejects sentences that are not valid
+ * NMEA sentences
+ * + it checks whether a sentence is known and to be used
+ * + it parses the time and date data from the NMEA data string and
+ * augments the missing bits. (century in dat, whole date, ...)
+ * + it rejects data that is not from the first accepted sentence in a
+ * burst
+ * + it eventually replaces the receive time with the PPS edge time.
+ * + it feeds the data to the internal processing stages.
+ * -------------------------------------------------------------------
+ */
+static void
+nmea_receive(
+ struct recvbuf * rbufp
+ )
+{
+ /* declare & init control structure ptrs */
+ struct peer * const peer = rbufp->recv_peer;
+ struct refclockproc * const pp = peer->procptr;
+ nmea_unit * const up = (nmea_unit*)pp->unitptr;
+
+ /* Use these variables to hold data until we decide its worth keeping */
+ nmea_data rdata;
+ char rd_lastcode[BMAX];
+ l_fp rd_timestamp, rd_reftime;
+ int rd_lencode;
+ double rd_fudge;
+
+ /* working stuff */
+ struct calendar date; /* to keep & convert the time stamp */
+ struct timespec tofs; /* offset to full-second reftime */
+ gps_weektm gpsw; /* week time storage */
+ /* results of sentence/date/time parsing */
+ u_char sentence; /* sentence tag */
+ int checkres;
+ char * cp;
+ int rc_date;
+ int rc_time;
+
+ /* make sure data has defined pristine state */
+ ZERO(tofs);
+ ZERO(date);
+ ZERO(gpsw);
+ sentence = 0;
+ rc_date = 0;
+ rc_time = 0;
+ /*
+ * Read the timecode and timestamp, then initialise field
+ * processing. The <CR><LF> at the NMEA line end is translated
+ * to <LF><LF> by the terminal input routines on most systems,
+ * and this gives us one spurious empty read per record which we
+ * better ignore silently.
+ */
+ rd_lencode = refclock_gtlin(rbufp, rd_lastcode,
+ sizeof(rd_lastcode), &rd_timestamp);
+ checkres = field_init(&rdata, rd_lastcode, rd_lencode);
+ switch (checkres) {
+
+ case CHECK_INVALID:
+ DPRINTF(1, ("%s invalid data: '%s'\n",
+ refnumtoa(&peer->srcadr), rd_lastcode));
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+
+ case CHECK_EMPTY:
+ return;
+
+ default:
+ DPRINTF(1, ("%s gpsread: %d '%s'\n",
+ refnumtoa(&peer->srcadr), rd_lencode,
+ rd_lastcode));
+ break;
+ }
+ up->tally.total++;
+
+ /*
+ * --> below this point we have a valid NMEA sentence <--
+ *
+ * Check sentence name. Skip first 2 chars (talker ID) in most
+ * cases, to allow for $GLGGA and $GPGGA etc. Since the name
+ * field has at least 5 chars we can simply shift the field
+ * start.
+ */
+ cp = field_parse(&rdata, 0);
+ if (strncmp(cp + 2, "RMC,", 4) == 0)
+ sentence = NMEA_GPRMC;
+ else if (strncmp(cp + 2, "GGA,", 4) == 0)
+ sentence = NMEA_GPGGA;
+ else if (strncmp(cp + 2, "GLL,", 4) == 0)
+ sentence = NMEA_GPGLL;
+ else if (strncmp(cp + 2, "ZDA,", 4) == 0)
+ sentence = NMEA_GPZDA;
+ else if (strncmp(cp + 2, "ZDG,", 4) == 0)
+ sentence = NMEA_GPZDG;
+ else if (strncmp(cp, "PGRMF,", 6) == 0)
+ sentence = NMEA_PGRMF;
+ else
+ return; /* not something we know about */
+
+ /* Eventually output delay measurement now. */
+ if (peer->ttl & NMEA_DELAYMEAS_MASK) {
+ mprintf_clock_stats(&peer->srcadr, "delay %0.6f %.*s",
+ ldexp(rd_timestamp.l_uf, -32),
+ (int)(strchr(rd_lastcode, ',') - rd_lastcode),
+ rd_lastcode);
+ }
+
+ /* See if I want to process this message type */
+ if ((peer->ttl & NMEA_MESSAGE_MASK) &&
+ !(peer->ttl & sentence_mode[sentence])) {
+ up->tally.filtered++;
+ return;
+ }
+
+ /*
+ * make sure it came in clean
+ *
+ * Apparently, older NMEA specifications (which are expensive)
+ * did not require the checksum for all sentences. $GPMRC is
+ * the only one so far identified which has always been required
+ * to include a checksum.
+ *
+ * Today, most NMEA GPS receivers checksum every sentence. To
+ * preserve its error-detection capabilities with modern GPSes
+ * while allowing operation without checksums on all but $GPMRC,
+ * we keep track of whether we've ever seen a valid checksum on
+ * a given sentence, and if so, reject future instances without
+ * checksum. ('up->cksum_type[NMEA_GPRMC]' is set in
+ * 'nmea_start()' to enforce checksums for $GPRMC right from the
+ * start.)
+ */
+ if (up->cksum_type[sentence] <= (u_char)checkres) {
+ up->cksum_type[sentence] = (u_char)checkres;
+ } else {
+ DPRINTF(1, ("%s checksum missing: '%s'\n",
+ refnumtoa(&peer->srcadr), rd_lastcode));
+ refclock_report(peer, CEVNT_BADREPLY);
+ up->tally.malformed++;
+ return;
+ }
+
+ /*
+ * $GPZDG provides GPS time not UTC, and the two mix poorly.
+ * Once have processed a $GPZDG, do not process any further UTC
+ * sentences (all but $GPZDG currently).
+ */
+ if (up->gps_time && NMEA_GPZDG != sentence) {
+ up->tally.filtered++;
+ return;
+ }
+
+ DPRINTF(1, ("%s processing %d bytes, timecode '%s'\n",
+ refnumtoa(&peer->srcadr), rd_lencode, rd_lastcode));
+
+ /*
+ * Grab fields depending on clock string type and possibly wipe
+ * sensitive data from the last timecode.
+ */
+ switch (sentence) {
+
+ case NMEA_GPRMC:
+ /* Check quality byte, fetch data & time */
+ rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1);
+ pp->leap = parse_qual(&rdata, 2, 'A', 0);
+ rc_date = parse_date(&date, &rdata, 9, DATE_1_DDMMYY)
+ && unfold_century(&date, rd_timestamp.l_ui);
+ if (CLK_FLAG4 & pp->sloppyclockflag)
+ field_wipe(&rdata, 3, 4, 5, 6, -1);
+ break;
+
+ case NMEA_GPGGA:
+ /* Check quality byte, fetch time only */
+ rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1);
+ pp->leap = parse_qual(&rdata, 6, '0', 1);
+ rc_date = unfold_day(&date, rd_timestamp.l_ui);
+ if (CLK_FLAG4 & pp->sloppyclockflag)
+ field_wipe(&rdata, 2, 4, -1);
+ break;
+
+ case NMEA_GPGLL:
+ /* Check quality byte, fetch time only */
+ rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 5);
+ pp->leap = parse_qual(&rdata, 6, 'A', 0);
+ rc_date = unfold_day(&date, rd_timestamp.l_ui);
+ if (CLK_FLAG4 & pp->sloppyclockflag)
+ field_wipe(&rdata, 1, 3, -1);
+ break;
+
+ case NMEA_GPZDA:
+ /* No quality. Assume best, fetch time & full date */
+ pp->leap = LEAP_NOWARNING;
+ rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1);
+ rc_date = parse_date(&date, &rdata, 2, DATE_3_DDMMYYYY);
+ break;
+
+ case NMEA_GPZDG:
+ /* Check quality byte, fetch time & full date */
+ rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 1);
+ rc_date = parse_date(&date, &rdata, 2, DATE_3_DDMMYYYY);
+ pp->leap = parse_qual(&rdata, 4, '0', 1);
+ tofs.tv_sec = -1; /* GPZDG is following second */
+ break;
+
+ case NMEA_PGRMF:
+ /* get date, time, qualifier and GPS weektime. We need
+ * date and time-of-day for the century fix, so we read
+ * them first.
+ */
+ rc_date = parse_weekdata(&gpsw, &rdata, 1, 2, 5)
+ && parse_date(&date, &rdata, 3, DATE_1_DDMMYY);
+ rc_time = parse_time(&date, &tofs.tv_nsec, &rdata, 4);
+ pp->leap = parse_qual(&rdata, 11, '0', 1);
+ rc_date = rc_date
+ && gpsfix_century(&date, &gpsw, &up->century_cache);
+ if (CLK_FLAG4 & pp->sloppyclockflag)
+ field_wipe(&rdata, 6, 8, -1);
+ break;
+
+ default:
+ INVARIANT(0); /* Coverity 97123 */
+ return;
+ }
+
+ /* Check sanity of time-of-day. */
+ if (rc_time == 0) { /* no time or conversion error? */
+ checkres = CEVNT_BADTIME;
+ up->tally.malformed++;
+ }
+ /* Check sanity of date. */
+ else if (rc_date == 0) {/* no date or conversion error? */
+ checkres = CEVNT_BADDATE;
+ up->tally.malformed++;
+ }
+ /* check clock sanity; [bug 2143] */
+ else if (pp->leap == LEAP_NOTINSYNC) { /* no good status? */
+ checkres = CEVNT_BADREPLY;
+ up->tally.rejected++;
+ }
+ else
+ checkres = -1;
+
+ if (checkres != -1) {
+ save_ltc(pp, rd_lastcode, rd_lencode);
+ refclock_report(peer, checkres);
+ return;
+ }
+
+ DPRINTF(1, ("%s effective timecode: %04u-%02u-%02u %02d:%02d:%02d\n",
+ refnumtoa(&peer->srcadr),
+ date.year, date.month, date.monthday,
+ date.hour, date.minute, date.second));
+
+ /* Check if we must enter GPS time mode; log so if we do */
+ if (!up->gps_time && (sentence == NMEA_GPZDG)) {
+ msyslog(LOG_INFO, "%s using GPS time as if it were UTC",
+ refnumtoa(&peer->srcadr));
+ up->gps_time = 1;
+ }
+
+ /*
+ * Get the reference time stamp from the calendar buffer.
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp, but only if the PPS is not in control.
+ * Discard sentence if reference time did not change.
+ */
+ rd_reftime = eval_gps_time(peer, &date, &tofs, &rd_timestamp);
+ if (L_ISEQU(&up->last_reftime, &rd_reftime)) {
+ /* Do not touch pp->a_lastcode on purpose! */
+ up->tally.filtered++;
+ return;
+ }
+ up->last_reftime = rd_reftime;
+ rd_fudge = pp->fudgetime2;
+
+ DPRINTF(1, ("%s using '%s'\n",
+ refnumtoa(&peer->srcadr), rd_lastcode));
+
+ /* Data will be accepted. Update stats & log data. */
+ up->tally.accepted++;
+ save_ltc(pp, rd_lastcode, rd_lencode);
+ pp->lastrec = rd_timestamp;
+
+#ifdef HAVE_PPSAPI
+ /*
+ * If we have PPS running, we try to associate the sentence
+ * with the last active edge of the PPS signal.
+ */
+ if (up->ppsapi_lit)
+ switch (refclock_ppsrelate(
+ pp, &up->atom, &rd_reftime, &rd_timestamp,
+ pp->fudgetime1, &rd_fudge))
+ {
+ case PPS_RELATE_PHASE:
+ up->ppsapi_gate = TRUE;
+ peer->precision = PPS_PRECISION;
+ peer->flags |= FLAG_PPS;
+ DPRINTF(2, ("%s PPS_RELATE_PHASE\n",
+ refnumtoa(&peer->srcadr)));
+ up->tally.pps_used++;
+ break;
+
+ case PPS_RELATE_EDGE:
+ up->ppsapi_gate = TRUE;
+ peer->precision = PPS_PRECISION;
+ DPRINTF(2, ("%s PPS_RELATE_EDGE\n",
+ refnumtoa(&peer->srcadr)));
+ break;
+
+ case PPS_RELATE_NONE:
+ default:
+ /*
+ * Resetting precision and PPS flag is done in
+ * 'nmea_poll', since it might be a glitch. But
+ * at the end of the poll cycle we know...
+ */
+ DPRINTF(2, ("%s PPS_RELATE_NONE\n",
+ refnumtoa(&peer->srcadr)));
+ break;
+ }
+#endif /* HAVE_PPSAPI */
+
+ refclock_process_offset(pp, rd_reftime, rd_timestamp, rd_fudge);
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * nmea_poll - called by the transmit procedure
+ *
+ * Does the necessary bookkeeping stuff to keep the reported state of
+ * the clock in sync with reality.
+ *
+ * We go to great pains to avoid changing state here, since there may
+ * be more than one eavesdropper receiving the same timecode.
+ * -------------------------------------------------------------------
+ */
+static void
+nmea_poll(
+ int unit,
+ struct peer * peer
+ )
+{
+ struct refclockproc * const pp = peer->procptr;
+ nmea_unit * const up = (nmea_unit *)pp->unitptr;
+
+ /*
+ * Process median filter samples. If none received, declare a
+ * timeout and keep going.
+ */
+#ifdef HAVE_PPSAPI
+ /*
+ * If we don't have PPS pulses and time stamps, turn PPS down
+ * for now.
+ */
+ if (!up->ppsapi_gate) {
+ peer->flags &= ~FLAG_PPS;
+ peer->precision = PRECISION;
+ } else {
+ up->ppsapi_gate = FALSE;
+ }
+#endif /* HAVE_PPSAPI */
+
+ /*
+ * If the median filter is empty, claim a timeout. Else process
+ * the input data and keep the stats going.
+ */
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ } else {
+ pp->polls++;
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ }
+
+ /*
+ * If extended logging is required, write the tally stats to the
+ * clockstats file; otherwise just do a normal clock stats
+ * record. Clear the tally stats anyway.
+ */
+ if (peer->ttl & NMEA_EXTLOG_MASK) {
+ /* Log & reset counters with extended logging */
+ char *nmea = pp->a_lastcode;
+ if (*nmea == '\0') nmea = "(none)";
+ mprintf_clock_stats(
+ &peer->srcadr, "%s %u %u %u %u %u %u",
+ nmea,
+ up->tally.total, up->tally.accepted,
+ up->tally.rejected, up->tally.malformed,
+ up->tally.filtered, up->tally.pps_used);
+ } else {
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ }
+ ZERO(up->tally);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Save the last timecode string, making sure it's properly truncated
+ * if necessary and NUL terminated in any case.
+ */
+static void
+save_ltc(
+ struct refclockproc * const pp,
+ const char * const tc,
+ size_t len
+ )
+{
+ if (len >= sizeof(pp->a_lastcode))
+ len = sizeof(pp->a_lastcode) - 1;
+ pp->lencode = (u_short)len;
+ memcpy(pp->a_lastcode, tc, len);
+ pp->a_lastcode[len] = '\0';
+}
+
+
+#if NMEA_WRITE_SUPPORT
+/*
+ * -------------------------------------------------------------------
+ * gps_send(fd, cmd, peer) Sends a command to the GPS receiver.
+ * as in gps_send(fd, "rqts,u", peer);
+ *
+ * If 'cmd' starts with a '$' it is assumed that this command is in raw
+ * format, that is, starts with '$', ends with '<cr><lf>' and that any
+ * checksum is correctly provided; the command will be send 'as is' in
+ * that case. Otherwise the function will create the necessary frame
+ * (start char, chksum, final CRLF) on the fly.
+ *
+ * We don't currently send any data, but would like to send RTCM SC104
+ * messages for differential positioning. It should also give us better
+ * time. Without a PPS output, we're Just fooling ourselves because of
+ * the serial code paths
+ * -------------------------------------------------------------------
+ */
+static void
+gps_send(
+ int fd,
+ const char * cmd,
+ struct peer * peer
+ )
+{
+ /* $...*xy<CR><LF><NUL> add 7 */
+ char buf[NMEA_PROTO_MAXLEN + 7];
+ int len;
+ u_char dcs;
+ const u_char *beg, *end;
+
+ if (*cmd != '$') {
+ /* get checksum and length */
+ beg = end = (const u_char*)cmd;
+ dcs = 0;
+ while (*end >= ' ' && *end != '*')
+ dcs ^= *end++;
+ len = end - beg;
+ /* format into output buffer with overflow check */
+ len = snprintf(buf, sizeof(buf), "$%.*s*%02X\r\n",
+ len, beg, dcs);
+ if ((size_t)len >= sizeof(buf)) {
+ DPRINTF(1, ("%s gps_send: buffer overflow for command '%s'\n",
+ refnumtoa(&peer->srcadr), cmd));
+ return; /* game over player 1 */
+ }
+ cmd = buf;
+ } else {
+ len = strlen(cmd);
+ }
+
+ DPRINTF(1, ("%s gps_send: '%.*s'\n", refnumtoa(&peer->srcadr),
+ len - 2, cmd));
+
+ /* send out the whole stuff */
+ if (write(fd, cmd, len) == -1)
+ refclock_report(peer, CEVNT_FAULT);
+}
+#endif /* NMEA_WRITE_SUPPORT */
+
+/*
+ * -------------------------------------------------------------------
+ * helpers for faster field splitting
+ * -------------------------------------------------------------------
+ *
+ * set up a field record, check syntax and verify checksum
+ *
+ * format is $XXXXX,1,2,3,4*ML
+ *
+ * 8-bit XOR of characters between $ and * noninclusive is transmitted
+ * in last two chars M and L holding most and least significant nibbles
+ * in hex representation such as:
+ *
+ * $GPGLL,5057.970,N,00146.110,E,142451,A*27
+ * $GPVTG,089.0,T,,,15.2,N,,*7F
+ *
+ * Some other constraints:
+ * + The field name must at least 5 upcase characters or digits and must
+ * start with a character.
+ * + The checksum (if present) must be uppercase hex digits.
+ * + The length of a sentence is limited to 80 characters (not including
+ * the final CR/LF nor the checksum, but including the leading '$')
+ *
+ * Return values:
+ * + CHECK_INVALID
+ * The data does not form a valid NMEA sentence or a checksum error
+ * occurred.
+ * + CHECK_VALID
+ * The data is a valid NMEA sentence but contains no checksum.
+ * + CHECK_CSVALID
+ * The data is a valid NMEA sentence and passed the checksum test.
+ * -------------------------------------------------------------------
+ */
+static int
+field_init(
+ nmea_data * data, /* context structure */
+ char * cptr, /* start of raw data */
+ int dlen /* data len, not counting trailing NUL */
+ )
+{
+ u_char cs_l; /* checksum local computed */
+ u_char cs_r; /* checksum remote given */
+ char * eptr; /* buffer end end pointer */
+ char tmp; /* char buffer */
+
+ cs_l = 0;
+ cs_r = 0;
+ /* some basic input constraints */
+ if (dlen < 0)
+ dlen = 0;
+ eptr = cptr + dlen;
+ *eptr = '\0';
+
+ /* load data context */
+ data->base = cptr;
+ data->cptr = cptr;
+ data->cidx = 0;
+ data->blen = dlen;
+
+ /* syntax check follows here. check allowed character
+ * sequences, updating the local computed checksum as we go.
+ *
+ * regex equiv: '^\$[A-Z][A-Z0-9]{4,}[^*]*(\*[0-9A-F]{2})?$'
+ */
+
+ /* -*- start character: '^\$' */
+ if (*cptr == '\0')
+ return CHECK_EMPTY;
+ if (*cptr++ != '$')
+ return CHECK_INVALID;
+
+ /* -*- advance context beyond start character */
+ data->base++;
+ data->cptr++;
+ data->blen--;
+
+ /* -*- field name: '[A-Z][A-Z0-9]{4,},' */
+ if (*cptr < 'A' || *cptr > 'Z')
+ return CHECK_INVALID;
+ cs_l ^= *cptr++;
+ while ((*cptr >= 'A' && *cptr <= 'Z') ||
+ (*cptr >= '0' && *cptr <= '9') )
+ cs_l ^= *cptr++;
+ if (*cptr != ',' || (cptr - data->base) < NMEA_PROTO_IDLEN)
+ return CHECK_INVALID;
+ cs_l ^= *cptr++;
+
+ /* -*- data: '[^*]*' */
+ while (*cptr && *cptr != '*')
+ cs_l ^= *cptr++;
+
+ /* -*- checksum field: (\*[0-9A-F]{2})?$ */
+ if (*cptr == '\0')
+ return CHECK_VALID;
+ if (*cptr != '*' || cptr != eptr - 3 ||
+ (cptr - data->base) >= NMEA_PROTO_MAXLEN)
+ return CHECK_INVALID;
+
+ for (cptr++; (tmp = *cptr) != '\0'; cptr++) {
+ if (tmp >= '0' && tmp <= '9')
+ cs_r = (cs_r << 4) + (tmp - '0');
+ else if (tmp >= 'A' && tmp <= 'F')
+ cs_r = (cs_r << 4) + (tmp - 'A' + 10);
+ else
+ break;
+ }
+
+ /* -*- make sure we are at end of string and csum matches */
+ if (cptr != eptr || cs_l != cs_r)
+ return CHECK_INVALID;
+
+ return CHECK_CSVALID;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * fetch a data field by index, zero being the name field. If this
+ * function is called repeatedly with increasing indices, the total load
+ * is O(n), n being the length of the string; if it is called with
+ * decreasing indices, the total load is O(n^2). Try not to go backwards
+ * too often.
+ * -------------------------------------------------------------------
+ */
+static char *
+field_parse(
+ nmea_data * data,
+ int fn
+ )
+{
+ char tmp;
+
+ if (fn < data->cidx) {
+ data->cidx = 0;
+ data->cptr = data->base;
+ }
+ while ((fn > data->cidx) && (tmp = *data->cptr) != '\0') {
+ data->cidx += (tmp == ',');
+ data->cptr++;
+ }
+ return data->cptr;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Wipe (that is, overwrite with '_') data fields and the checksum in
+ * the last timecode. The list of field indices is given as integers
+ * in a varargs list, preferrably in ascending order, in any case
+ * terminated by a negative field index.
+ *
+ * A maximum number of 8 fields can be overwritten at once to guard
+ * against runaway (that is, unterminated) argument lists.
+ *
+ * This function affects what a remote user can see with
+ *
+ * ntpq -c clockvar <server>
+ *
+ * Note that this also removes the wiped fields from any clockstats
+ * log. Some NTP operators monitor their NMEA GPS using the change in
+ * location in clockstats over time as as a proxy for the quality of
+ * GPS reception and thereby time reported.
+ * -------------------------------------------------------------------
+ */
+static void
+field_wipe(
+ nmea_data * data,
+ ...
+ )
+{
+ va_list va; /* vararg index list */
+ int fcnt; /* safeguard against runaway arglist */
+ int fidx; /* field to nuke, or -1 for checksum */
+ char * cp; /* overwrite destination */
+
+ fcnt = 8;
+ cp = NULL;
+ va_start(va, data);
+ do {
+ fidx = va_arg(va, int);
+ if (fidx >= 0 && fidx <= NMEA_PROTO_FIELDS) {
+ cp = field_parse(data, fidx);
+ } else {
+ cp = data->base + data->blen;
+ if (data->blen >= 3 && cp[-3] == '*')
+ cp -= 2;
+ }
+ for ( ; '\0' != *cp && '*' != *cp && ',' != *cp; cp++)
+ if ('.' != *cp)
+ *cp = '_';
+ } while (fcnt-- && fidx >= 0);
+ va_end(va);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * PARSING HELPERS
+ * -------------------------------------------------------------------
+ *
+ * Check sync status
+ *
+ * If the character at the data field start matches the tag value,
+ * return LEAP_NOWARNING and LEAP_NOTINSYNC otherwise. If the 'inverted'
+ * flag is given, just the opposite value is returned. If there is no
+ * data field (*cp points to the NUL byte) the result is LEAP_NOTINSYNC.
+ * -------------------------------------------------------------------
+ */
+static u_char
+parse_qual(
+ nmea_data * rd,
+ int idx,
+ char tag,
+ int inv
+ )
+{
+ static const u_char table[2] =
+ { LEAP_NOTINSYNC, LEAP_NOWARNING };
+ char * dp;
+
+ dp = field_parse(rd, idx);
+
+ return table[ *dp && ((*dp == tag) == !inv) ];
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Parse a time stamp in HHMMSS[.sss] format with error checking.
+ *
+ * returns 1 on success, 0 on failure
+ * -------------------------------------------------------------------
+ */
+static int
+parse_time(
+ struct calendar * jd, /* result calendar pointer */
+ long * ns, /* storage for nsec fraction */
+ nmea_data * rd,
+ int idx
+ )
+{
+ static const unsigned long weight[4] = {
+ 0, 100000000, 10000000, 1000000
+ };
+
+ int rc;
+ u_int h;
+ u_int m;
+ u_int s;
+ int p1;
+ int p2;
+ u_long f;
+ char * dp;
+
+ dp = field_parse(rd, idx);
+ rc = sscanf(dp, "%2u%2u%2u%n.%3lu%n", &h, &m, &s, &p1, &f, &p2);
+ if (rc < 3 || p1 != 6) {
+ DPRINTF(1, ("nmea: invalid time code: '%.6s'\n", dp));
+ return FALSE;
+ }
+
+ /* value sanity check */
+ if (h > 23 || m > 59 || s > 60) {
+ DPRINTF(1, ("nmea: invalid time spec %02u:%02u:%02u\n",
+ h, m, s));
+ return FALSE;
+ }
+
+ jd->hour = (u_char)h;
+ jd->minute = (u_char)m;
+ jd->second = (u_char)s;
+ /* if we have a fraction, scale it up to nanoseconds. */
+ if (rc == 4)
+ *ns = f * weight[p2 - p1 - 1];
+ else
+ *ns = 0;
+
+ return TRUE;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Parse a date string from an NMEA sentence. This could either be a
+ * partial date in DDMMYY format in one field, or DD,MM,YYYY full date
+ * spec spanning three fields. This function does some extensive error
+ * checking to make sure the date string was consistent.
+ *
+ * returns 1 on success, 0 on failure
+ * -------------------------------------------------------------------
+ */
+static int
+parse_date(
+ struct calendar * jd, /* result pointer */
+ nmea_data * rd,
+ int idx,
+ enum date_fmt fmt
+ )
+{
+ int rc;
+ u_int y;
+ u_int m;
+ u_int d;
+ int p;
+ char * dp;
+
+ dp = field_parse(rd, idx);
+ switch (fmt) {
+
+ case DATE_1_DDMMYY:
+ rc = sscanf(dp, "%2u%2u%2u%n", &d, &m, &y, &p);
+ if (rc != 3 || p != 6) {
+ DPRINTF(1, ("nmea: invalid date code: '%.6s'\n",
+ dp));
+ return FALSE;
+ }
+ break;
+
+ case DATE_3_DDMMYYYY:
+ rc = sscanf(dp, "%2u,%2u,%4u%n", &d, &m, &y, &p);
+ if (rc != 3 || p != 10) {
+ DPRINTF(1, ("nmea: invalid date code: '%.10s'\n",
+ dp));
+ return FALSE;
+ }
+ break;
+
+ default:
+ DPRINTF(1, ("nmea: invalid parse format: %d\n", fmt));
+ return FALSE;
+ }
+
+ /* value sanity check */
+ if (d < 1 || d > 31 || m < 1 || m > 12) {
+ DPRINTF(1, ("nmea: invalid date spec (YMD) %04u:%02u:%02u\n",
+ y, m, d));
+ return FALSE;
+ }
+
+ /* store results */
+ jd->monthday = (u_char)d;
+ jd->month = (u_char)m;
+ jd->year = (u_short)y;
+
+ return TRUE;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Parse GPS week time info from an NMEA sentence. This info contains
+ * the GPS week number, the GPS time-of-week and the leap seconds GPS
+ * to UTC.
+ *
+ * returns 1 on success, 0 on failure
+ * -------------------------------------------------------------------
+ */
+static int
+parse_weekdata(
+ gps_weektm * wd,
+ nmea_data * rd,
+ int weekidx,
+ int timeidx,
+ int leapidx
+ )
+{
+ u_long secs;
+ int fcnt;
+
+ /* parse fields and count success */
+ fcnt = sscanf(field_parse(rd, weekidx), "%hu", &wd->wt_week);
+ fcnt += sscanf(field_parse(rd, timeidx), "%lu", &secs);
+ fcnt += sscanf(field_parse(rd, leapidx), "%hd", &wd->wt_leap);
+ if (fcnt != 3 || wd->wt_week >= 1024 || secs >= 7*SECSPERDAY) {
+ DPRINTF(1, ("nmea: parse_weekdata: invalid weektime spec\n"));
+ return FALSE;
+ }
+ wd->wt_time = (u_int32)secs;
+
+ return TRUE;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * funny calendar-oriented stuff -- perhaps a bit hard to grok.
+ * -------------------------------------------------------------------
+ *
+ * Unfold a time-of-day (seconds since midnight) around the current
+ * system time in a manner that guarantees an absolute difference of
+ * less than 12hrs.
+ *
+ * This function is used for NMEA sentences that contain no date
+ * information. This requires the system clock to be in +/-12hrs
+ * around the true time, or the clock will synchronize the system 1day
+ * off if not augmented with a time sources that also provide the
+ * necessary date information.
+ *
+ * The function updates the calendar structure it also uses as
+ * input to fetch the time from.
+ *
+ * returns 1 on success, 0 on failure
+ * -------------------------------------------------------------------
+ */
+static int
+unfold_day(
+ struct calendar * jd,
+ u_int32 rec_ui
+ )
+{
+ vint64 rec_qw;
+ ntpcal_split rec_ds;
+
+ /*
+ * basically this is the peridiodic extension of the receive
+ * time - 12hrs to the time-of-day with a period of 1 day.
+ * But we would have to execute this in 64bit arithmetic, and we
+ * cannot assume we can do this; therefore this is done
+ * in split representation.
+ */
+ rec_qw = ntpcal_ntp_to_ntp(rec_ui - SECSPERDAY/2, NULL);
+ rec_ds = ntpcal_daysplit(&rec_qw);
+ rec_ds.lo = ntpcal_periodic_extend(rec_ds.lo,
+ ntpcal_date_to_daysec(jd),
+ SECSPERDAY);
+ rec_ds.hi += ntpcal_daysec_to_date(jd, rec_ds.lo);
+ return (ntpcal_rd_to_date(jd, rec_ds.hi + DAY_NTP_STARTS) >= 0);
+}
+
+/*
+ * -------------------------------------------------------------------
+ * A 2-digit year is expanded into full year spec around the year found
+ * in 'jd->year'. This should be in +79/-19 years around the system time,
+ * or the result will be off by 100 years. The assymetric behaviour was
+ * chosen to enable inital sync for systems that do not have a
+ * battery-backup clock and start with a date that is typically years in
+ * the past.
+ *
+ * Since the GPS epoch starts at 1980-01-06, the resulting year will be
+ * not be before 1980 in any case.
+ *
+ * returns 1 on success, 0 on failure
+ * -------------------------------------------------------------------
+ */
+static int
+unfold_century(
+ struct calendar * jd,
+ u_int32 rec_ui
+ )
+{
+ struct calendar rec;
+ int32 baseyear;
+
+ ntpcal_ntp_to_date(&rec, rec_ui, NULL);
+ baseyear = rec.year - 20;
+ if (baseyear < g_gpsMinYear)
+ baseyear = g_gpsMinYear;
+ jd->year = (u_short)ntpcal_periodic_extend(baseyear, jd->year,
+ 100);
+
+ return ((baseyear <= jd->year) && (baseyear + 100 > jd->year));
+}
+
+/*
+ * -------------------------------------------------------------------
+ * A 2-digit year is expanded into a full year spec by correlation with
+ * a GPS week number and the current leap second count.
+ *
+ * The GPS week time scale counts weeks since Sunday, 1980-01-06, modulo
+ * 1024 and seconds since start of the week. The GPS time scale is based
+ * on international atomic time (TAI), so the leap second difference to
+ * UTC is also needed for a proper conversion.
+ *
+ * A brute-force analysis (that is, test for every date) shows that a
+ * wrong assignment of the century can not happen between the years 1900
+ * to 2399 when comparing the week signatures for different
+ * centuries. (I *think* that will not happen for 400*1024 years, but I
+ * have no valid proof. -*-perlinger@ntp.org-*-)
+ *
+ * This function is bound to to work between years 1980 and 2399
+ * (inclusive), which should suffice for now ;-)
+ *
+ * Note: This function needs a full date&time spec on input due to the
+ * necessary leap second corrections!
+ *
+ * returns 1 on success, 0 on failure
+ * -------------------------------------------------------------------
+ */
+static int
+gpsfix_century(
+ struct calendar * jd,
+ const gps_weektm * wd,
+ u_short * century
+ )
+{
+ int32 days;
+ int32 doff;
+ u_short week;
+ u_short year;
+ int loop;
+
+ /* Get day offset. Assumes that the input time is in range and
+ * that the leap seconds do not shift more than +/-1 day.
+ */
+ doff = ntpcal_date_to_daysec(jd) + wd->wt_leap;
+ doff = (doff >= SECSPERDAY) - (doff < 0);
+
+ /*
+ * Loop over centuries to get a match, starting with the last
+ * successful one. (Or with the 19th century if the cached value
+ * is out of range...)
+ */
+ year = jd->year % 100;
+ for (loop = 5; loop > 0; loop--,(*century)++) {
+ if (*century < 19 || *century >= 24)
+ *century = 19;
+ /* Get days and week in GPS epoch */
+ jd->year = year + *century * 100;
+ days = ntpcal_date_to_rd(jd) - DAY_GPS_STARTS + doff;
+ week = (days / 7) % 1024;
+ if (days >= 0 && wd->wt_week == week)
+ return TRUE; /* matched... */
+ }
+
+ jd->year = year;
+ return FALSE; /* match failed... */
+}
+
+/*
+ * -------------------------------------------------------------------
+ * And now the final execise: Considering the fact that many (most?)
+ * GPS receivers cannot handle a GPS epoch wrap well, we try to
+ * compensate for that problem by unwrapping a GPS epoch around the
+ * receive stamp. Another execise in periodic unfolding, of course,
+ * but with enough points to take care of.
+ *
+ * Note: The integral part of 'tofs' is intended to handle small(!)
+ * systematic offsets, as -1 for handling $GPZDG, which gives the
+ * following second. (sigh...) The absolute value shall be less than a
+ * day (86400 seconds).
+ * -------------------------------------------------------------------
+ */
+static l_fp
+eval_gps_time(
+ struct peer * peer, /* for logging etc */
+ const struct calendar * gpst, /* GPS time stamp */
+ const struct timespec * tofs, /* GPS frac second & offset */
+ const l_fp * recv /* receive time stamp */
+ )
+{
+ struct refclockproc * const pp = peer->procptr;
+ nmea_unit * const up = (nmea_unit *)pp->unitptr;
+
+ l_fp retv;
+
+ /* components of calculation */
+ int32_t rcv_sec, rcv_day; /* receive ToD and day */
+ int32_t gps_sec, gps_day; /* GPS ToD and day in NTP epoch */
+ int32_t adj_day, weeks; /* adjusted GPS day and week shift */
+
+ /* some temporaries to shuffle data */
+ vint64 vi64;
+ ntpcal_split rs64;
+
+ /* evaluate time stamp from receiver. */
+ gps_sec = ntpcal_date_to_daysec(gpst);
+ gps_day = ntpcal_date_to_rd(gpst) - DAY_NTP_STARTS;
+
+ /* merge in fractional offset */
+ retv = tspec_intv_to_lfp(*tofs);
+ gps_sec += retv.l_i;
+
+ /* If we fully trust the GPS receiver, just combine days and
+ * seconds and be done. */
+ if (peer->ttl & NMEA_DATETRUST_MASK) {
+ retv.l_ui = ntpcal_dayjoin(gps_day, gps_sec).D_s.lo;
+ return retv;
+ }
+
+ /* So we do not trust the GPS receiver to deliver a correct date
+ * due to the GPS epoch changes. We map the date from the
+ * receiver into the +/-512 week interval around the receive
+ * time in that case. This would be a tad easier with 64bit
+ * calculations, but again, we restrict the code to 32bit ops
+ * when possible. */
+
+ /* - make sure the GPS fractional day is normalised
+ * Applying the offset value might have put us slightly over the
+ * edge of the allowed range for seconds-of-day. Doing a full
+ * division with floor correction is overkill here; a simple
+ * addition or subtraction step is sufficient. Using WHILE loops
+ * gives the right result even if the offset exceeds one day,
+ * which is NOT what it's intented for! */
+ while (gps_sec >= SECSPERDAY) {
+ gps_sec -= SECSPERDAY;
+ gps_day += 1;
+ }
+ while (gps_sec < 0) {
+ gps_sec += SECSPERDAY;
+ gps_day -= 1;
+ }
+
+ /* - get unfold base: day of full recv time - 512 weeks */
+ vi64 = ntpcal_ntp_to_ntp(recv->l_ui, NULL);
+ rs64 = ntpcal_daysplit(&vi64);
+ rcv_sec = rs64.lo;
+ rcv_day = rs64.hi - 512 * 7;
+
+ /* - take the fractional days into account
+ * If the fractional day of the GPS time is smaller than the
+ * fractional day of the receive time, we shift the base day for
+ * the unfold by 1. */
+ if ( gps_sec < rcv_sec
+ || (gps_sec == rcv_sec && retv.l_uf < recv->l_uf))
+ rcv_day += 1;
+
+ /* - don't warp ahead of GPS invention! */
+ if (rcv_day < g_gpsMinBase)
+ rcv_day = g_gpsMinBase;
+
+ /* - let the magic happen: */
+ adj_day = ntpcal_periodic_extend(rcv_day, gps_day, 1024*7);
+
+ /* - check if we should log a GPS epoch warp */
+ weeks = (adj_day - gps_day) / 7;
+ if (weeks != up->epoch_warp) {
+ up->epoch_warp = weeks;
+ LOGIF(CLOCKINFO, (LOG_INFO,
+ "%s Changed GPS epoch warp to %d weeks",
+ refnumtoa(&peer->srcadr), weeks));
+ }
+
+ /* - build result and be done */
+ retv.l_ui = ntpcal_dayjoin(adj_day, gps_sec).D_s.lo;
+ return retv;
+}
+
+/*
+ * ===================================================================
+ *
+ * NMEAD support
+ *
+ * original nmead support added by Jon Miner (cp_n18@yahoo.com)
+ *
+ * See http://home.hiwaay.net/~taylorc/gps/nmea-server/
+ * for information about nmead
+ *
+ * To use this, you need to create a link from /dev/gpsX to
+ * the server:port where nmead is running. Something like this:
+ *
+ * ln -s server:port /dev/gps1
+ *
+ * Split into separate function by Juergen Perlinger
+ * (perlinger-at-ntp-dot-org)
+ *
+ * ===================================================================
+ */
+static int
+nmead_open(
+ const char * device
+ )
+{
+ int fd = -1; /* result file descriptor */
+
+#ifdef HAVE_READLINK
+ char host[80]; /* link target buffer */
+ char * port; /* port name or number */
+ int rc; /* result code (several)*/
+ int sh; /* socket handle */
+ struct addrinfo ai_hint; /* resolution hint */
+ struct addrinfo *ai_list; /* resolution result */
+ struct addrinfo *ai; /* result scan ptr */
+
+ fd = -1;
+
+ /* try to read as link, make sure no overflow occurs */
+ rc = readlink(device, host, sizeof(host));
+ if ((size_t)rc >= sizeof(host))
+ return fd; /* error / overflow / truncation */
+ host[rc] = '\0'; /* readlink does not place NUL */
+
+ /* get port */
+ port = strchr(host, ':');
+ if (!port)
+ return fd; /* not 'host:port' syntax ? */
+ *port++ = '\0'; /* put in separator */
+
+ /* get address infos and try to open socket
+ *
+ * This getaddrinfo() is naughty in ntpd's nonblocking main
+ * thread, but you have to go out of your wary to use this code
+ * and typically the blocking is at startup where its impact is
+ * reduced. The same holds for the 'connect()', as it is
+ * blocking, too...
+ */
+ ZERO(ai_hint);
+ ai_hint.ai_protocol = IPPROTO_TCP;
+ ai_hint.ai_socktype = SOCK_STREAM;
+ if (getaddrinfo(host, port, &ai_hint, &ai_list))
+ return fd;
+
+ for (ai = ai_list; ai && (fd == -1); ai = ai->ai_next) {
+ sh = socket(ai->ai_family, ai->ai_socktype,
+ ai->ai_protocol);
+ if (INVALID_SOCKET == sh)
+ continue;
+ rc = connect(sh, ai->ai_addr, ai->ai_addrlen);
+ if (-1 != rc)
+ fd = sh;
+ else
+ close(sh);
+ }
+ freeaddrinfo(ai_list);
+#else
+ fd = -1;
+#endif
+
+ return fd;
+}
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif /* REFCLOCK && CLOCK_NMEA */
diff --git a/ntpd/refclock_oncore.c b/ntpd/refclock_oncore.c
new file mode 100644
index 0000000..3bc60bf
--- /dev/null
+++ b/ntpd/refclock_oncore.c
@@ -0,0 +1,4083 @@
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ *
+ * refclock_oncore.c
+ *
+ * Driver for some of the various the Motorola Oncore GPS receivers.
+ * should work with Basic, PVT6, VP, UT, UT+, GT, GT+, SL, M12, M12+T
+ * The receivers with TRAIM (VP, UT, UT+, M12+T), will be more accurate
+ * than the others.
+ * The receivers without position hold (GT, GT+) will be less accurate.
+ *
+ * Tested with:
+ *
+ * (UT) (VP)
+ * COPYRIGHT 1991-1997 MOTOROLA INC. COPYRIGHT 1991-1996 MOTOROLA INC.
+ * SFTW P/N # 98-P36848P SFTW P/N # 98-P36830P
+ * SOFTWARE VER # 2 SOFTWARE VER # 8
+ * SOFTWARE REV # 2 SOFTWARE REV # 8
+ * SOFTWARE DATE APR 24 1998 SOFTWARE DATE 06 Aug 1996
+ * MODEL # R1121N1114 MODEL # B4121P1155
+ * HWDR P/N # 1 HDWR P/N # _
+ * SERIAL # R0010A SERIAL # SSG0226478
+ * MANUFACTUR DATE 6H07 MANUFACTUR DATE 7E02
+ * OPTIONS LIST IB
+ *
+ * (Basic) (M12)
+ * COPYRIGHT 1991-1994 MOTOROLA INC. COPYRIGHT 1991-2000 MOTOROLA INC.
+ * SFTW P/N # 98-P39949M SFTW P/N # 61-G10002A
+ * SOFTWARE VER # 5 SOFTWARE VER # 1
+ * SOFTWARE REV # 0 SOFTWARE REV # 3
+ * SOFTWARE DATE 20 JAN 1994 SOFTWARE DATE Mar 13 2000
+ * MODEL # A11121P116 MODEL # P143T12NR1
+ * HDWR P/N # _ HWDR P/N # 1
+ * SERIAL # SSG0049809 SERIAL # P003UD
+ * MANUFACTUR DATE 417AMA199 MANUFACTUR DATE 0C27
+ * OPTIONS LIST AB
+ *
+ * (M12+T) (M12+T later version)
+ * COPYRIGHT 1991-2002 MOTOROLA INC. COPYRIGHT 1991-2003 MOTOROLA INC.
+ * SFTW P/N # 61-G10268A SFTW P/N # 61-G10268A
+ * SOFTWARE VER # 2 SOFTWARE VER # 2
+ * SOFTWARE REV # 0 SOFTWARE REV # 1
+ * SOFTWARE DATE AUG 14 2002 SOFTWARE DATE APR 16 2003
+ * MODEL # P283T12T11 MODEL # P273T12T12
+ * HWDR P/N # 2 HWDR P/N # 2
+ * SERIAL # P04DC2 SERIAL # P05Z7Z
+ * MANUFACTUR DATE 2J17 MANUFACTUR DATE 3G15
+ *
+ * --------------------------------------------------------------------------
+ * Reg Clemens (June 2009)
+ * BUG[1220] OK, big patch, but mostly done mechanically. Change direct calls to write
+ * to clockstats to a call to oncore_log, which now calls the old routine plus msyslog.
+ * Have to set the LOG_LEVELS of the calls for msyslog, and this was done by hand. New
+ * routine oncore_log.
+ * --------------------------------------------------------------------------
+ * Reg Clemens (June 2009)
+ * BUG[1218] The comment on where the oncore driver gets its input file does not
+ * agree with the code. Change the comment.
+ * --------------------------------------------------------------------------
+ * Reg Clemens (June 2009)
+ * change exit statements to return(0) in main program. I had assumed that if the
+ * PPS driver did not start for some reason, we shuould stop NTPD itelf. Others
+ * disagree. We now give an ERR log message and stop this driver.
+ * --------------------------------------------------------------------------
+ * Reg Clemens (June 2009)
+ * A bytes available message for the input subsystem (Debug message).
+ * --------------------------------------------------------------------------
+ * Reg Clemens (Nov 2008)
+ * This code adds a message for TRAIM messages. Users often worry about the
+ * driver not starting up, and it is often because of signal strength being low.
+ * Low signal strength will give TRAIM messages.
+ * --------------------------------------------------------------------------
+ * Reg Clemens (Nov 2008)
+ * Add waiting on Almanac Message.
+ * --------------------------------------------------------------------------
+ * Reg Clemens (Nov 2008)
+ * Add back in @@Bl code to do the @@Bj/@@Gj that is in later ONCOREs
+ * LEAP SECONDS: All of the ONCORE receivers, VP -> M12T have the @@Bj command
+ * that says 'Leap Pending'. As documented it only becomes true in the month
+ * before the leap second is to be applied, but in practice at least some of
+ * the receivers turn this indicator on as soon as the message is posted, which
+ * can be 6months early. As such, we use the Bj command to turn on the
+ * instance->pp->leap indicator but only run this test in December and June for
+ * updates on 1Jan and 1July.
+ *
+ * The @@Gj command exists in later ONCOREs, and it gives the exact date
+ * and size of the Leap Update. It can be emulated in the VP using the @@Bl
+ * command which reads the raw Satellite Broadcast Messages.
+ * We use these two commands to print informative messages in the clockstats
+ * file once per day as soon as the message appears on the satellites.
+ * --------------------------------------------------------------------------
+ * Reg Clemens (Feb 2006)
+ * Fix some gcc4 compiler complaints
+ * Fix possible segfault in oncore_init_shmem
+ * change all (possible) fprintf(stderr, to record_clock_stats
+ * Apply patch from Russell J. Yount <rjy@cmu.edu> Fixed (new) MT12+T UTC not correct
+ * immediately after new Almanac Read.
+ * Apply patch for new PPS implementation by Rodolfo Giometti <giometti@linux.it>
+ * now code can use old Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> or
+ * the new one. Compiles depending on timepps.h seen.
+ * --------------------------------------------------------------------------
+ * Luis Batanero Guerrero <luisba@rao.es> (Dec 2005) Patch for leap seconds
+ * (the oncore driver was setting the wrong ntpd variable)
+ * --------------------------------------------------------------------------
+ * Reg.Clemens (Mar 2004)
+ * Support for interfaces other than PPSAPI removed, for Solaris, SunOS,
+ * SCO, you now need to use one of the timepps.h files in the root dir.
+ * this driver will 'grab' it for you if you dont have one in /usr/include
+ * --------------------------------------------------------------------------
+ * This code uses the two devices
+ * /dev/oncore.serial.n
+ * /dev/oncore.pps.n
+ * which may be linked to the same device.
+ * and can read initialization data from the file
+ * /etc/ntp.oncoreN, /etc/ntp.oncore.N, or /etc/ntp.oncore, where
+ * n or N are the unit number, viz 127.127.30.N.
+ * --------------------------------------------------------------------------
+ * Reg.Clemens <reg@dwf.com> Sep98.
+ * Original code written for FreeBSD.
+ * With these mods it works on FreeBSD, SunOS, Solaris and Linux
+ * (SunOS 4.1.3 + ppsclock)
+ * (Solaris7 + MU4)
+ * (RedHat 5.1 2.0.35 + PPSKit, 2.1.126 + or later).
+ *
+ * Lat,Long,Ht, cable-delay, offset, and the ReceiverID (along with the
+ * state machine state) are printed to CLOCKSTATS if that file is enabled
+ * in /etc/ntp.conf.
+ *
+ * --------------------------------------------------------------------------
+ *
+ * According to the ONCORE manual (TRM0003, Rev 3.2, June 1998, page 3.13)
+ * doing an average of 10000 valid 2D and 3D fixes is what the automatic
+ * site survey mode does. Looking at the output from the receiver
+ * it seems like it is only using 3D fixes.
+ * When we do it ourselves, take 10000 3D fixes.
+ */
+
+#define POS_HOLD_AVERAGE 10000 /* nb, 10000s ~= 2h45m */
+
+/*
+ * ONCORE_SHMEM_STATUS will create a mmap(2)'ed file named according to a
+ * "STATUS" line in the oncore config file, which contains the most recent
+ * copy of all types of messages we recognize. This file can be mmap(2)'ed
+ * by monitoring and statistics programs.
+ *
+ * See separate HTML documentation for this option.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_ONCORE)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#ifdef ONCORE_SHMEM_STATUS
+# ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED ((u_char *) -1)
+# endif /* MAP_FAILED */
+# endif /* HAVE_SYS_MMAN_H */
+#endif /* ONCORE_SHMEM_STATUS */
+
+#ifdef HAVE_PPSAPI
+# include "ppsapi_timepps.h"
+#endif
+
+struct Bl {
+ int dt_ls;
+ int dt_lsf;
+ int WN;
+ int DN;
+ int WN_lsf;
+ int DN_lsf;
+ int wn_flg;
+ int lsf_flg;
+ int Bl_day;
+} Bl;
+
+enum receive_state {
+ ONCORE_NO_IDEA,
+ ONCORE_CHECK_ID,
+ ONCORE_CHECK_CHAN,
+ ONCORE_HAVE_CHAN,
+ ONCORE_RESET_SENT,
+ ONCORE_TEST_SENT,
+ ONCORE_INIT,
+ ONCORE_ALMANAC,
+ ONCORE_RUN
+};
+
+enum site_survey_state {
+ ONCORE_SS_UNKNOWN,
+ ONCORE_SS_TESTING,
+ ONCORE_SS_HW,
+ ONCORE_SS_SW,
+ ONCORE_SS_DONE
+};
+
+enum antenna_state {
+ ONCORE_ANTENNA_UNKNOWN = -1,
+ ONCORE_ANTENNA_OK = 0,
+ ONCORE_ANTENNA_OC = 1,
+ ONCORE_ANTENNA_UC = 2,
+ ONCORE_ANTENNA_NV = 3
+};
+
+/* Model Name, derived from the @@Cj message.
+ * Used to initialize some variables.
+ */
+
+enum oncore_model {
+ ONCORE_BASIC,
+ ONCORE_PVT6,
+ ONCORE_VP,
+ ONCORE_UT,
+ ONCORE_UTPLUS,
+ ONCORE_GT,
+ ONCORE_GTPLUS,
+ ONCORE_SL,
+ ONCORE_M12,
+ ONCORE_UNKNOWN
+};
+
+/* the bits that describe these properties are in the same place
+ * on the VP/UT, but have moved on the M12. As such we extract
+ * them, and use them from this struct.
+ *
+ */
+
+struct RSM {
+ u_char posn0D;
+ u_char posn2D;
+ u_char posn3D;
+ u_char bad_almanac;
+ u_char bad_fix;
+};
+
+/* It is possible to test the VP/UT each cycle (@@Ea or equivalent) to
+ * see what mode it is in. The bits on the M12 are multiplexed with
+ * other messages, so we have to 'keep' the last known mode here.
+ */
+
+enum posn_mode {
+ MODE_UNKNOWN,
+ MODE_0D,
+ MODE_2D,
+ MODE_3D
+};
+
+struct instance {
+ int unit; /* 127.127.30.unit */
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ int ttyfd; /* TTY file descriptor */
+ int ppsfd; /* PPS file descriptor */
+ int shmemfd; /* Status shm descriptor */
+ pps_handle_t pps_h;
+ pps_params_t pps_p;
+ enum receive_state o_state; /* Receive state */
+ enum posn_mode mode; /* 0D, 2D, 3D */
+ enum site_survey_state site_survey; /* Site Survey state */
+ enum antenna_state ant_state; /* antenna state */
+
+ int Bj_day;
+
+ u_long delay; /* ns */
+ long offset; /* ns */
+
+ u_char *shmem;
+ char *shmem_fname;
+ u_int shmem_Cb;
+ u_int shmem_Ba;
+ u_int shmem_Ea;
+ u_int shmem_Ha;
+ u_char shmem_reset;
+ u_char shmem_Posn;
+ u_char shmem_bad_Ea;
+ u_char almanac_from_shmem;
+
+ double ss_lat;
+ double ss_long;
+ double ss_ht;
+ double dH;
+ int ss_count;
+ u_char posn_set;
+
+ enum oncore_model model;
+ u_int version;
+ u_int revision;
+
+ u_char chan; /* 6 for PVT6 or BASIC, 8 for UT/VP, 12 for m12, 0 if unknown */
+ s_char traim; /* do we have traim? yes UT/VP, M12+T, no BASIC, GT, M12, -1 unknown, 0 no, +1 yes */
+ /* the following 7 are all timing counters */
+ u_char traim_delay; /* seconds counter, waiting for reply */
+ u_char count; /* cycles thru Ea before starting */
+ u_char count1; /* cycles thru Ea after SS_TESTING, waiting for SS_HW */
+ u_char count2; /* cycles thru Ea after count, to check for @@Ea */
+ u_char count3; /* cycles thru Ea checking for # channels */
+ u_char count4; /* cycles thru leap after Gj to issue Bj */
+ u_char count5; /* cycles thru get_timestamp waiting for valid UTC correction */
+ u_char count5_set; /* only set count5 once */
+ u_char counta; /* count for waiting on almanac message */
+ u_char pollcnt;
+ u_char timeout; /* count to retry Cj after Fa self-test */
+ u_char max_len; /* max length message seen by oncore_log, for debugging */
+ u_char max_count; /* count for message statistics */
+
+ struct RSM rsm; /* bits extracted from Receiver Status Msg in @@Ea */
+ struct Bl Bl; /* Satellite Broadcast Data Message */
+ u_char printed;
+ u_char polled;
+ u_long ev_serial;
+ int Rcvptr;
+ u_char Rcvbuf[500];
+ u_char BEHa[160]; /* Ba, Ea or Ha */
+ u_char BEHn[80]; /* Bn , En , or Hn */
+ u_char Cj[300];
+ u_char Ag; /* Satellite mask angle */
+ u_char saw_At;
+ u_char saw_Ay;
+ u_char saw_Az;
+ s_char saw_Bj;
+ s_char saw_Gj;
+ u_char have_dH;
+ u_char init_type;
+ s_char saw_tooth;
+ s_char chan_in; /* chan number from INPUT, will always use it */
+ u_char chan_id; /* chan number determined from part number */
+ u_char chan_ck; /* chan number determined by sending commands to hardware */
+ s_char traim_in; /* TRAIM from INPUT, will always use ON/OFF specified */
+ s_char traim_id; /* TRAIM determined from part number */
+ u_char traim_ck; /* TRAIM determined by sending commands to hardware */
+ u_char once; /* one pass code at top of BaEaHa */
+ s_char assert;
+ u_char hardpps;
+ s_char pps_control; /* PPS control, M12 only */
+ s_char pps_control_msg_seen;
+};
+
+#define rcvbuf instance->Rcvbuf
+#define rcvptr instance->Rcvptr
+
+static int oncore_start (int, struct peer *);
+static void oncore_poll (int, struct peer *);
+static void oncore_shutdown (int, struct peer *);
+static void oncore_consume (struct instance *);
+static void oncore_read_config (struct instance *);
+static void oncore_receive (struct recvbuf *);
+static int oncore_ppsapi (struct instance *);
+static void oncore_get_timestamp (struct instance *, long, long);
+static void oncore_init_shmem (struct instance *);
+
+static void oncore_antenna_report (struct instance *, enum antenna_state);
+static void oncore_chan_test (struct instance *);
+static void oncore_check_almanac (struct instance *);
+static void oncore_check_antenna (struct instance *);
+static void oncore_check_leap_sec (struct instance *);
+static int oncore_checksum_ok (u_char *, int);
+static void oncore_compute_dH (struct instance *);
+static void oncore_load_almanac (struct instance *);
+static void oncore_log (struct instance *, int, const char *);
+static int oncore_log_f (struct instance *, int, const char *, ...)
+ NTP_PRINTF(3, 4);
+static void oncore_print_Cb (struct instance *, u_char *);
+/* static void oncore_print_array (u_char *, int); */
+static void oncore_print_posn (struct instance *);
+static void oncore_sendmsg (struct instance *, u_char *, size_t);
+static void oncore_set_posn (struct instance *);
+static void oncore_set_traim (struct instance *);
+static void oncore_shmem_get_3D (struct instance *);
+static void oncore_ss (struct instance *);
+static int oncore_wait_almanac (struct instance *);
+
+static void oncore_msg_any (struct instance *, u_char *, size_t, int);
+static void oncore_msg_Adef (struct instance *, u_char *, size_t);
+static void oncore_msg_Ag (struct instance *, u_char *, size_t);
+static void oncore_msg_As (struct instance *, u_char *, size_t);
+static void oncore_msg_At (struct instance *, u_char *, size_t);
+static void oncore_msg_Ay (struct instance *, u_char *, size_t);
+static void oncore_msg_Az (struct instance *, u_char *, size_t);
+static void oncore_msg_BaEaHa (struct instance *, u_char *, size_t);
+static void oncore_msg_Bd (struct instance *, u_char *, size_t);
+static void oncore_msg_Bj (struct instance *, u_char *, size_t);
+static void oncore_msg_Bl (struct instance *, u_char *, size_t);
+static void oncore_msg_BnEnHn (struct instance *, u_char *, size_t);
+static void oncore_msg_CaFaIa (struct instance *, u_char *, size_t);
+static void oncore_msg_Cb (struct instance *, u_char *, size_t);
+static void oncore_msg_Cf (struct instance *, u_char *, size_t);
+static void oncore_msg_Cj (struct instance *, u_char *, size_t);
+static void oncore_msg_Cj_id (struct instance *, u_char *, size_t);
+static void oncore_msg_Cj_init (struct instance *, u_char *, size_t);
+static void oncore_msg_Ga (struct instance *, u_char *, size_t);
+static void oncore_msg_Gb (struct instance *, u_char *, size_t);
+static void oncore_msg_Gc (struct instance *, u_char *, size_t);
+static void oncore_msg_Gj (struct instance *, u_char *, size_t);
+static void oncore_msg_Sz (struct instance *, u_char *, size_t);
+
+struct refclock refclock_oncore = {
+ oncore_start, /* start up driver */
+ oncore_shutdown, /* shut down driver */
+ oncore_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* not used */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+/*
+ * Understanding the next bit here is not easy unless you have a manual
+ * for the the various Oncore Models.
+ */
+
+static struct msg_desc {
+ const char flag[3];
+ const int len;
+ void (*handler) (struct instance *, u_char *, size_t);
+ const char *fmt;
+ int shmem;
+} oncore_messages[] = {
+ /* Ea and En first since they're most common */
+ { "Ea", 76, oncore_msg_BaEaHa, "mdyyhmsffffaaaaoooohhhhmmmmvvhhddtntimsdimsdimsdimsdimsdimsdimsdimsdsC" },
+ { "Ba", 68, oncore_msg_BaEaHa, "mdyyhmsffffaaaaoooohhhhmmmmvvhhddtntimsdimsdimsdimsdimsdimsdsC" },
+ { "Ha", 154, oncore_msg_BaEaHa, "mdyyhmsffffaaaaoooohhhhmmmmaaaaoooohhhhmmmmVVvvhhddntimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddimsiddssrrccooooTTushmvvvvvvC" },
+ { "Bn", 59, oncore_msg_BnEnHn, "otaapxxxxxxxxxxpysreensffffsffffsffffsffffsffffsffffC" },
+ { "En", 69, oncore_msg_BnEnHn, "otaapxxxxxxxxxxpysreensffffsffffsffffsffffsffffsffffsffffsffffC" },
+ { "Hn", 78, oncore_msg_BnEnHn, "" },
+ { "Ab", 10, 0, "" },
+ { "Ac", 11, 0, "" },
+ { "Ad", 11, oncore_msg_Adef, "" },
+ { "Ae", 11, oncore_msg_Adef, "" },
+ { "Af", 15, oncore_msg_Adef, "" },
+ { "Ag", 8, oncore_msg_Ag, "" }, /* Satellite mask angle */
+ { "As", 20, oncore_msg_As, "" },
+ { "At", 8, oncore_msg_At, "" },
+ { "Au", 12, 0, "" },
+ { "Av", 8, 0, "" },
+ { "Aw", 8, 0, "" },
+ { "Ay", 11, oncore_msg_Ay, "" },
+ { "Az", 11, oncore_msg_Az, "" },
+ { "AB", 8, 0, "" },
+ { "Bb", 92, 0, "" },
+ { "Bd", 23, oncore_msg_Bd, "" },
+ { "Bj", 8, oncore_msg_Bj, "" },
+ { "Bl", 41, oncore_msg_Bl, "" },
+ { "Ca", 9, oncore_msg_CaFaIa, "" },
+ { "Cb", 33, oncore_msg_Cb, "" },
+ { "Cf", 7, oncore_msg_Cf, "" },
+ { "Cg", 8, 0, "" },
+ { "Ch", 9, 0, "" },
+ { "Cj", 294, oncore_msg_Cj, "" },
+ { "Ek", 71, 0, "" },
+ { "Fa", 9, oncore_msg_CaFaIa, "" },
+ { "Ga", 20, oncore_msg_Ga, "" },
+ { "Gb", 17, oncore_msg_Gb, "" },
+ { "Gc", 8, oncore_msg_Gc, "" },
+ { "Gd", 8, 0, "" },
+ { "Ge", 8, 0, "" },
+ { "Gj", 21, oncore_msg_Gj, "" },
+ { "Ia", 10, oncore_msg_CaFaIa, "" },
+ { "Sz", 8, oncore_msg_Sz, "" },
+ { {0}, 7, 0, "" }
+};
+
+
+static u_char oncore_cmd_Aa[] = { 'A', 'a', 0, 0, 0 }; /* 6/8 Time of Day */
+static u_char oncore_cmd_Ab[] = { 'A', 'b', 0, 0, 0 }; /* 6/8 GMT Correction */
+static u_char oncore_cmd_AB[] = { 'A', 'B', 4 }; /* VP Application Type: Static */
+static u_char oncore_cmd_Ac[] = { 'A', 'c', 0, 0, 0, 0 }; /* 6/8 Date */
+static u_char oncore_cmd_Ad[] = { 'A', 'd', 0,0,0,0 }; /* 6/8 Latitude */
+static u_char oncore_cmd_Ae[] = { 'A', 'e', 0,0,0,0 }; /* 6/8 Longitude */
+static u_char oncore_cmd_Af[] = { 'A', 'f', 0,0,0,0, 0 }; /* 6/8 Height */
+static u_char oncore_cmd_Ag[] = { 'A', 'g', 0 }; /* 6/8/12 Satellite Mask Angle */
+static u_char oncore_cmd_Agx[] = { 'A', 'g', 0xff }; /* 6/8/12 Satellite Mask Angle: read */
+static u_char oncore_cmd_As[] = { 'A', 's', 0,0,0,0, 0,0,0,0, 0,0,0,0, 0 }; /* 6/8/12 Posn Hold Parameters */
+static u_char oncore_cmd_Asx[] = { 'A', 's', 0x7f,0xff,0xff,0xff, /* 6/8/12 Posn Hold Readback */
+ 0x7f,0xff,0xff,0xff, /* on UT+ this doesnt work with 0xff */
+ 0x7f,0xff,0xff,0xff, 0xff }; /* but does work with 0x7f (sigh). */
+static u_char oncore_cmd_At0[] = { 'A', 't', 0 }; /* 6/8 Posn Hold: off */
+static u_char oncore_cmd_At1[] = { 'A', 't', 1 }; /* 6/8 Posn Hold: on */
+static u_char oncore_cmd_At2[] = { 'A', 't', 2 }; /* 6/8 Posn Hold: Start Site Survey */
+static u_char oncore_cmd_Atx[] = { 'A', 't', 0xff }; /* 6/8 Posn Hold: Read Back */
+static u_char oncore_cmd_Au[] = { 'A', 'u', 0,0,0,0, 0 }; /* GT/M12 Altitude Hold Ht. */
+static u_char oncore_cmd_Av0[] = { 'A', 'v', 0 }; /* VP/GT Altitude Hold: off */
+static u_char oncore_cmd_Av1[] = { 'A', 'v', 1 }; /* VP/GT Altitude Hold: on */
+static u_char oncore_cmd_Aw[] = { 'A', 'w', 1 }; /* 6/8/12 UTC/GPS time selection */
+static u_char oncore_cmd_Ay[] = { 'A', 'y', 0, 0, 0, 0 }; /* Timing 1PPS time offset: set */
+static u_char oncore_cmd_Ayx[] = { 'A', 'y', 0xff, 0xff, 0xff, 0xff }; /* Timing 1PPS time offset: Read */
+static u_char oncore_cmd_Az[] = { 'A', 'z', 0, 0, 0, 0 }; /* 6/8UT/12 1PPS Cable Delay: set */
+static u_char oncore_cmd_Azx[] = { 'A', 'z', 0xff, 0xff, 0xff, 0xff }; /* 6/8UT/12 1PPS Cable Delay: Read */
+static u_char oncore_cmd_Ba0[] = { 'B', 'a', 0 }; /* 6 Position/Data/Status: off */
+static u_char oncore_cmd_Ba[] = { 'B', 'a', 1 }; /* 6 Position/Data/Status: on */
+static u_char oncore_cmd_Bb[] = { 'B', 'b', 1 }; /* 6/8/12 Visible Satellites */
+static u_char oncore_cmd_Bd[] = { 'B', 'd', 1 }; /* 6/8/12? Almanac Status Msg. */
+static u_char oncore_cmd_Be[] = { 'B', 'e', 1 }; /* 6/8/12 Request Almanac Data */
+static u_char oncore_cmd_Bj[] = { 'B', 'j', 0 }; /* 6/8 Leap Second Pending */
+static u_char oncore_cmd_Bl[] = { 'B', 'l', 1 }; /* VP Satellite Broadcast Data Msg */
+static u_char oncore_cmd_Bn0[] = { 'B', 'n', 0, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 6 TRAIM setup/status: msg off, traim on */
+static u_char oncore_cmd_Bn[] = { 'B', 'n', 1, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 6 TRAIM setup/status: msg on, traim on */
+static u_char oncore_cmd_Bnx[] = { 'B', 'n', 0, 0, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 6 TRAIM setup/status: msg off, traim off */
+static u_char oncore_cmd_Ca[] = { 'C', 'a' }; /* 6 Self Test */
+static u_char oncore_cmd_Cf[] = { 'C', 'f' }; /* 6/8/12 Set to Defaults */
+static u_char oncore_cmd_Cg[] = { 'C', 'g', 1 }; /* VP Posn Fix/Idle Mode */
+static u_char oncore_cmd_Cj[] = { 'C', 'j' }; /* 6/8/12 Receiver ID */
+static u_char oncore_cmd_Ea0[] = { 'E', 'a', 0 }; /* 8 Position/Data/Status: off */
+static u_char oncore_cmd_Ea[] = { 'E', 'a', 1 }; /* 8 Position/Data/Status: on */
+static u_char oncore_cmd_Ek[] = { 'E', 'k', 0 }; /* just turn off */ /* 8 Posn/Status/Data - extension */
+static u_char oncore_cmd_En0[] = { 'E', 'n', 0, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 8/GT TRAIM setup/status: msg off, traim on */
+static u_char oncore_cmd_En[] = { 'E', 'n', 1, 1, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 8/GT TRAIM setup/status: msg on, traim on */
+static u_char oncore_cmd_Enx[] = { 'E', 'n', 0, 0, 0,10, 2, 0,0,0, 0,0,0,0,0,0,0 }; /* 8/GT TRAIM setup/status: msg off, traim off */
+static u_char oncore_cmd_Fa[] = { 'F', 'a' }; /* 8 Self Test */
+static u_char oncore_cmd_Ga[] = { 'G', 'a', 0,0,0,0, 0,0,0,0, 0,0,0,0, 0 }; /* 12 Position Set */
+static u_char oncore_cmd_Gax[] = { 'G', 'a', 0xff, 0xff, 0xff, 0xff, /* 12 Position Set: Read */
+ 0xff, 0xff, 0xff, 0xff, /* */
+ 0xff, 0xff, 0xff, 0xff, 0xff }; /* */
+static u_char oncore_cmd_Gb[] = { 'G', 'b', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* 12 set Date/Time */
+static u_char oncore_cmd_Gc[] = { 'G', 'c', 0 }; /* 12 PPS Control: Off, On, 1+satellite,TRAIM */
+static u_char oncore_cmd_Gd0[] = { 'G', 'd', 0 }; /* 12 Position Control: 3D (no hold) */
+static u_char oncore_cmd_Gd1[] = { 'G', 'd', 1 }; /* 12 Position Control: 0D (3D hold) */
+static u_char oncore_cmd_Gd2[] = { 'G', 'd', 2 }; /* 12 Position Control: 2D (Alt Hold) */
+static u_char oncore_cmd_Gd3[] = { 'G', 'd', 3 }; /* 12 Position Coltrol: Start Site Survey */
+static u_char oncore_cmd_Ge0[] = { 'G', 'e', 0 }; /* M12+T TRAIM: off */
+static u_char oncore_cmd_Ge[] = { 'G', 'e', 1 }; /* M12+T TRAIM: on */
+static u_char oncore_cmd_Gj[] = { 'G', 'j' }; /* 8?/12 Leap Second Pending */
+static u_char oncore_cmd_Ha0[] = { 'H', 'a', 0 }; /* 12 Position/Data/Status: off */
+static u_char oncore_cmd_Ha[] = { 'H', 'a', 1 }; /* 12 Position/Data/Status: on */
+static u_char oncore_cmd_Hn0[] = { 'H', 'n', 0 }; /* 12 TRAIM Status: off */
+static u_char oncore_cmd_Hn[] = { 'H', 'n', 1 }; /* 12 TRAIM Status: on */
+static u_char oncore_cmd_Ia[] = { 'I', 'a' }; /* 12 Self Test */
+
+/* it appears that as of 1997/1998, the UT had As,At, but not Au,Av
+ * the GT had Au,Av, but not As,At
+ * This was as of v2.0 of both firmware sets. possibly 1.3 for UT.
+ * Bj in UT at v1.3
+ * dont see Bd in UT/GT thru 1999
+ * Gj in UT as of 3.0, 1999 , Bj as of 1.3
+ */
+
+#define DEVICE1 "/dev/oncore.serial.%d" /* name of serial device */
+#define DEVICE2 "/dev/oncore.pps.%d" /* name of pps device */
+
+#define SPEED B9600 /* Oncore Binary speed (9600 bps) */
+
+/*
+ * Assemble and disassemble 32bit signed quantities from a buffer.
+ *
+ */
+
+ /* to buffer, int w, u_char *buf */
+#define w32_buf(buf,w) { u_int i_tmp; \
+ i_tmp = (w<0) ? (~(-w)+1) : (w); \
+ (buf)[0] = (i_tmp >> 24) & 0xff; \
+ (buf)[1] = (i_tmp >> 16) & 0xff; \
+ (buf)[2] = (i_tmp >> 8) & 0xff; \
+ (buf)[3] = (i_tmp ) & 0xff; \
+ }
+
+#define w32(buf) (((buf)[0]&0xff) << 24 | \
+ ((buf)[1]&0xff) << 16 | \
+ ((buf)[2]&0xff) << 8 | \
+ ((buf)[3]&0xff) )
+
+ /* from buffer, char *buf, result to an int */
+#define buf_w32(buf) (((buf)[0]&0200) ? (-(~w32(buf)+1)) : w32(buf))
+
+
+/*
+ * oncore_start - initialize data for processing
+ */
+
+static int
+oncore_start(
+ int unit,
+ struct peer *peer
+ )
+{
+#define STRING_LEN 32
+ register struct instance *instance;
+ struct refclockproc *pp;
+ int fd1, fd2;
+ char device1[STRING_LEN], device2[STRING_LEN];
+#ifndef SYS_WINNT
+ struct stat stat1, stat2;
+#endif
+
+ /* create instance structure for this unit */
+
+ instance = emalloc(sizeof(*instance));
+ memset(instance, 0, sizeof(*instance));
+
+ /* initialize miscellaneous variables */
+
+ pp = peer->procptr;
+ instance->pp = pp;
+ instance->unit = unit;
+ instance->peer = peer;
+ instance->assert = 1;
+ instance->once = 1;
+
+ instance->Bj_day = -1;
+ instance->traim = -1;
+ instance->traim_in = -1;
+ instance->chan_in = -1;
+ instance->pps_control = -1; /* PPS control, M12 only */
+ instance->pps_control_msg_seen = -1; /* Have seen response to Gc msg */
+ instance->model = ONCORE_UNKNOWN;
+ instance->mode = MODE_UNKNOWN;
+ instance->site_survey = ONCORE_SS_UNKNOWN;
+ instance->Ag = 0xff; /* Satellite mask angle, unset by user */
+ instance->ant_state = ONCORE_ANTENNA_UNKNOWN;
+
+ peer->flags &= ~FLAG_PPS; /* PPS not active yet */
+ peer->precision = -26;
+ peer->minpoll = 4;
+ peer->maxpoll = 4;
+ pp->clockdesc = "Motorola Oncore GPS Receiver";
+ memcpy((char *)&pp->refid, "GPS\0", (size_t) 4);
+
+ oncore_log(instance, LOG_NOTICE, "ONCORE DRIVER -- CONFIGURING");
+ instance->o_state = ONCORE_NO_IDEA;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_NO_IDEA");
+
+ /* Now open files.
+ * This is a bit complicated, a we dont want to open the same file twice
+ * (its a problem on some OS), and device2 may not exist for the new PPS
+ */
+
+ (void)snprintf(device1, sizeof(device1), DEVICE1, unit);
+ (void)snprintf(device2, sizeof(device2), DEVICE2, unit);
+
+ /* OPEN DEVICES */
+ /* opening different devices for fd1 and fd2 presents no problems */
+ /* opening the SAME device twice, seems to be OS dependent.
+ (a) on Linux (no streams) no problem
+ (b) on SunOS (and possibly Solaris, untested), (streams)
+ never see the line discipline.
+ Since things ALWAYS work if we only open the device once, we check
+ to see if the two devices are in fact the same, then proceed to
+ do one open or two.
+
+ For use with linuxPPS we assume that the N_TTY file has been opened
+ and that the line discipline has been changed to N_PPS by another
+ program (say ppsldisc) so that the two files expected by the oncore
+ driver can be opened.
+
+ Note that the linuxPPS N_PPS file is just like a N_TTY, so we can do
+ the stat below without error even though the file has already had its
+ line discipline changed by another process.
+
+ The Windows port of ntpd arranges to return duplicate handles for
+ multiple opens of the same serial device, and doesn't have inodes
+ for serial handles, so we just open both on Windows.
+ */
+#ifndef SYS_WINNT
+ if (stat(device1, &stat1)) {
+ oncore_log_f(instance, LOG_ERR, "Can't stat fd1 (%s)",
+ device1);
+ return(0); /* exit, no file, can't start driver */
+ }
+
+ if (stat(device2, &stat2)) {
+ stat2.st_dev = stat2.st_ino = -2;
+ oncore_log_f(instance, LOG_ERR, "Can't stat fd2 (%s) %d %m",
+ device2, errno);
+ }
+#endif /* !SYS_WINNT */
+
+ fd1 = refclock_open(device1, SPEED, LDISC_RAW);
+ if (fd1 <= 0) {
+ oncore_log_f(instance, LOG_ERR, "Can't open fd1 (%s)",
+ device1);
+ return(0); /* exit, can't open file, can't start driver */
+ }
+
+ /* for LINUX the PPS device is the result of a line discipline.
+ It seems simplest to let an external program create the appropriate
+ /dev/pps<n> file, and only check (carefully) for its existance here
+ */
+
+#ifndef SYS_WINNT
+ if ((stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino)) /* same device here */
+ fd2 = fd1;
+ else
+#endif /* !SYS_WINNT */
+ { /* different devices here */
+ if ((fd2=tty_open(device2, O_RDWR, 0777)) < 0) {
+ oncore_log_f(instance, LOG_ERR,
+ "Can't open fd2 (%s)", device2);
+ return(0); /* exit, can't open PPS file, can't start driver */
+ }
+ }
+
+ /* open ppsapi source */
+
+ if (time_pps_create(fd2, &instance->pps_h) < 0) {
+ oncore_log(instance, LOG_ERR, "exit, PPSAPI not found in kernel");
+ return(0); /* exit, don't find PPSAPI in kernel */
+ }
+
+ /* continue initialization */
+
+ instance->ttyfd = fd1;
+ instance->ppsfd = fd2;
+
+ /* go read any input data in /etc/ntp.oncoreX or /etc/ntp/oncore.X */
+
+ oncore_read_config(instance);
+
+ if (!oncore_ppsapi(instance))
+ return(0);
+
+ pp->io.clock_recv = oncore_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd1;
+ if (!io_addclock(&pp->io)) {
+ oncore_log(instance, LOG_ERR, "can't do io_addclock");
+ close(fd1);
+ pp->io.fd = -1;
+ free(instance);
+ return (0);
+ }
+ pp->unitptr = instance;
+
+#ifdef ONCORE_SHMEM_STATUS
+ /*
+ * Before starting ONCORE, lets setup SHMEM
+ * This will include merging an old SHMEM into the new one if
+ * an old one is found.
+ */
+
+ oncore_init_shmem(instance);
+#endif
+
+ /*
+ * This will return the Model of the Oncore receiver.
+ * and start the Initialization loop in oncore_msg_Cj.
+ */
+
+ instance->o_state = ONCORE_CHECK_ID;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_CHECK_ID");
+
+ instance->timeout = 4;
+ oncore_sendmsg(instance, oncore_cmd_Cg, sizeof(oncore_cmd_Cg)); /* Set Posn Fix mode (not Idle (VP)) */
+ oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
+
+ instance->pollcnt = 2;
+ return (1);
+}
+
+
+/*
+ * oncore_shutdown - shut down the clock
+ */
+
+static void
+oncore_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct instance *instance;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ instance = pp->unitptr;
+
+ if (pp->io.fd != -1)
+ io_closeclock(&pp->io);
+
+ if (instance != NULL) {
+ time_pps_destroy (instance->pps_h);
+
+ close(instance->ttyfd);
+
+ if ((instance->ppsfd != -1) && (instance->ppsfd != instance->ttyfd))
+ close(instance->ppsfd);
+
+ if (instance->shmemfd)
+ close(instance->shmemfd);
+
+ free(instance);
+ }
+}
+
+
+
+/*
+ * oncore_poll - called by the transmit procedure
+ */
+
+static void
+oncore_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct instance *instance;
+
+ instance = peer->procptr->unitptr;
+ if (instance->timeout) {
+ instance->timeout--;
+ if (instance->timeout == 0) {
+ oncore_log(instance, LOG_ERR,
+ "Oncore: No response from @@Cj, shutting down driver");
+ oncore_shutdown(unit, peer);
+ } else {
+ oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
+ oncore_log(instance, LOG_WARNING, "Oncore: Resend @@Cj");
+ }
+ return;
+ }
+
+ if (!instance->pollcnt)
+ refclock_report(peer, CEVNT_TIMEOUT);
+ else
+ instance->pollcnt--;
+ peer->procptr->polls++;
+ instance->polled = 1;
+}
+
+
+
+/*
+ * Initialize PPSAPI
+ */
+
+static int
+oncore_ppsapi(
+ struct instance *instance
+ )
+{
+ int cap, mode, mode1;
+ char *cp;
+
+ if (time_pps_getcap(instance->pps_h, &cap) < 0) {
+ oncore_log_f(instance, LOG_ERR, "time_pps_getcap failed: %m");
+ return (0);
+ }
+
+ if (time_pps_getparams(instance->pps_h, &instance->pps_p) < 0) {
+ oncore_log_f(instance, LOG_ERR, "time_pps_getparams failed: %m");
+ return (0);
+ }
+
+ /* nb. only turn things on, if someone else has turned something
+ * on before we get here, leave it alone!
+ */
+
+ if (instance->assert) {
+ cp = "Assert";
+ mode = PPS_CAPTUREASSERT;
+ mode1 = PPS_OFFSETASSERT;
+ } else {
+ cp = "Clear";
+ mode = PPS_CAPTURECLEAR;
+ mode1 = PPS_OFFSETCLEAR;
+ }
+ oncore_log_f(instance, LOG_INFO, "Initializing timing to %s.",
+ cp);
+
+ if (!(mode & cap)) {
+ oncore_log_f(instance, LOG_ERR,
+ "Can't set timing to %s, exiting...", cp);
+ return(0);
+ }
+
+ if (!(mode1 & cap)) {
+ oncore_log_f(instance, LOG_NOTICE,
+ "Can't set %s, this will increase jitter.",
+ cp);
+ mode1 = 0;
+ }
+
+ /* only set what is legal */
+
+ instance->pps_p.mode = (mode | mode1 | PPS_TSFMT_TSPEC) & cap;
+
+ if (time_pps_setparams(instance->pps_h, &instance->pps_p) < 0) {
+ oncore_log_f(instance, LOG_ERR, "ONCORE: time_pps_setparams fails %m");
+ return(0); /* exit, can't do time_pps_setparans on PPS file */
+ }
+
+ /* If HARDPPS is on, we tell kernel */
+
+ if (instance->hardpps) {
+ int i;
+
+ oncore_log(instance, LOG_INFO, "HARDPPS Set.");
+
+ if (instance->assert)
+ i = PPS_CAPTUREASSERT;
+ else
+ i = PPS_CAPTURECLEAR;
+
+ /* we know that 'i' is legal from above */
+
+ if (time_pps_kcbind(instance->pps_h, PPS_KC_HARDPPS, i,
+ PPS_TSFMT_TSPEC) < 0) {
+ oncore_log_f(instance, LOG_ERR, "time_pps_kcbind failed: %m");
+ oncore_log(instance, LOG_ERR, "HARDPPS failed, abort...");
+ return (0);
+ }
+
+ hardpps_enable = 1;
+ }
+ return(1);
+}
+
+
+
+#ifdef ONCORE_SHMEM_STATUS
+static void
+oncore_init_shmem(
+ struct instance *instance
+ )
+{
+ int i, l, n, fd, shmem_old_size, n1;
+ u_char *cp, *cp1, *buf, *shmem_old;
+ struct msg_desc *mp;
+ struct stat sbuf;
+ size_t shmem_length;
+
+ /*
+ * The first thing we do is see if there is an instance->shmem_fname file (still)
+ * out there from a previous run. If so, we copy it in and use it to initialize
+ * shmem (so we won't lose our almanac if we need it).
+ */
+
+ shmem_old = 0;
+ shmem_old_size = 0;
+ if ((fd = open(instance->shmem_fname, O_RDONLY)) < 0)
+ oncore_log(instance, LOG_WARNING, "ONCORE: Can't open SHMEM file");
+ else {
+ fstat(fd, &sbuf);
+ shmem_old_size = sbuf.st_size;
+ if (shmem_old_size != 0) {
+ shmem_old = emalloc((unsigned) sbuf.st_size);
+ read(fd, shmem_old, shmem_old_size);
+ }
+ close(fd);
+ }
+
+ /* OK, we now create the NEW SHMEM. */
+
+ if ((instance->shmemfd = open(instance->shmem_fname, O_RDWR|O_CREAT|O_TRUNC, 0644)) < 0) {
+ oncore_log(instance, LOG_WARNING, "ONCORE: Can't open shmem");
+ if (shmem_old)
+ free(shmem_old);
+
+ return;
+ }
+
+ /* see how big it needs to be */
+
+ n = 1;
+ for (mp=oncore_messages; mp->flag[0]; mp++) {
+ mp->shmem = n;
+ /* Allocate space for multiplexed almanac, and 0D/2D/3D @@Ea records */
+ if (!strcmp(mp->flag, "Cb")) {
+ instance->shmem_Cb = n;
+ n += (mp->len + 3) * 34;
+ }
+ if (!strcmp(mp->flag, "Ba")) {
+ instance->shmem_Ba = n;
+ n += (mp->len + 3) * 3;
+ }
+ if (!strcmp(mp->flag, "Ea")) {
+ instance->shmem_Ea = n;
+ n += (mp->len + 3) * 3;
+ }
+ if (!strcmp(mp->flag, "Ha")) {
+ instance->shmem_Ha = n;
+ n += (mp->len + 3) * 3;
+ }
+ n += (mp->len + 3);
+ }
+ shmem_length = n + 2;
+
+ buf = emalloc(shmem_length);
+ memset(buf, 0, shmem_length);
+
+ /* next build the new SHMEM buffer in memory */
+
+ for (mp=oncore_messages; mp->flag[0]; mp++) {
+ l = mp->shmem;
+ buf[l + 0] = mp->len >> 8;
+ buf[l + 1] = mp->len & 0xff;
+ buf[l + 2] = 0;
+ buf[l + 3] = '@';
+ buf[l + 4] = '@';
+ buf[l + 5] = mp->flag[0];
+ buf[l + 6] = mp->flag[1];
+ if (!strcmp(mp->flag, "Cb") || !strcmp(mp->flag, "Ba") || !strcmp(mp->flag, "Ea") || !strcmp(mp->flag, "Ha")) {
+ if (!strcmp(mp->flag, "Cb"))
+ n = 35;
+ else
+ n = 4;
+ for (i=1; i<n; i++) {
+ buf[l + i * (mp->len+3) + 0] = mp->len >> 8;
+ buf[l + i * (mp->len+3) + 1] = mp->len & 0xff;
+ buf[l + i * (mp->len+3) + 2] = 0;
+ buf[l + i * (mp->len+3) + 3] = '@';
+ buf[l + i * (mp->len+3) + 4] = '@';
+ buf[l + i * (mp->len+3) + 5] = mp->flag[0];
+ buf[l + i * (mp->len+3) + 6] = mp->flag[1];
+ }
+ }
+ }
+
+ /* we now walk thru the two buffers (shmem_old and buf, soon to become shmem)
+ * copying the data in shmem_old to buf.
+ * When we are done we write it out and free both buffers.
+ * If the structure sizes dont agree, I will not copy.
+ * This could be due to an addition/deletion or a problem with the disk file.
+ */
+
+ if (shmem_old) {
+ if (shmem_old_size == shmem_length) {
+ for (cp=buf+4, cp1=shmem_old+4; (n = 256*(*(cp-3)) + *(cp-2)); cp+=(n+3), cp1+=(n+3)) {
+ n1 = 256*(*(cp1-3)) + *(cp1-2);
+ if (n == 0 || n1 != n || strncmp((char *) cp, (char *) cp1, 4))
+ break;
+
+ memcpy(cp, cp1, (size_t) n);
+ }
+ }
+ free(shmem_old);
+ }
+
+ i = write(instance->shmemfd, buf, shmem_length);
+ free(buf);
+
+ if (i != shmem_length) {
+ oncore_log(instance, LOG_ERR, "ONCORE: error writing shmem");
+ close(instance->shmemfd);
+ return;
+ }
+
+ instance->shmem = (u_char *) mmap(0, shmem_length,
+ PROT_READ | PROT_WRITE,
+#ifdef MAP_HASSEMAPHORE
+ MAP_HASSEMAPHORE |
+#endif
+ MAP_SHARED, instance->shmemfd, (off_t)0);
+
+ if (instance->shmem == (u_char *)MAP_FAILED) {
+ instance->shmem = 0;
+ close(instance->shmemfd);
+ return;
+ }
+
+ oncore_log_f(instance, LOG_NOTICE,
+ "SHMEM (size = %ld) is CONFIGURED and available as %s",
+ (u_long) shmem_length, instance->shmem_fname);
+}
+#endif /* ONCORE_SHMEM_STATUS */
+
+
+
+/*
+ * Read Input file if it exists.
+ */
+
+static void
+oncore_read_config(
+ struct instance *instance
+ )
+{
+/*
+ * First we try to open the configuration file
+ * /etc/ntp.oncore.N
+ * where N is the unit number viz 127.127.30.N.
+ * If we don't find it we try
+ * /etc/ntp.oncoreN
+ * and then
+ * /etc/ntp.oncore
+ *
+ * If we don't find any then we don't have the cable delay or PPS offset
+ * and we choose MODE (4) below.
+ *
+ * Five Choices for MODE
+ * (0) ONCORE is preinitialized, don't do anything to change it.
+ * nb, DON'T set 0D mode, DON'T set Delay, position...
+ * (1) NO RESET, Read Position, delays from data file, lock it in, go to 0D mode.
+ * (2) NO RESET, Read Delays from data file, do SITE SURVEY to get position,
+ * lock this in, go to 0D mode.
+ * (3) HARD RESET, Read Position, delays from data file, lock it in, go to 0D mode.
+ * (4) HARD RESET, Read Delays from data file, do SITE SURVEY to get position,
+ * lock this in, go to 0D mode.
+ * NB. If a POSITION is specified in the config file with mode=(2,4) [SITE SURVEY]
+ * then this position is set as the INITIAL position of the ONCORE.
+ * This can reduce the time to first fix.
+ * -------------------------------------------------------------------------------
+ * Note that an Oncore UT without a battery backup retains NO information if it is
+ * power cycled, with a Battery Backup it remembers the almanac, etc.
+ * For an Oncore VP, there is an eeprom that will contain this data, along with the
+ * option of Battery Backup.
+ * So a UT without Battery Backup is equivalent to doing a HARD RESET on each
+ * power cycle, since there is nowhere to store the data.
+ * -------------------------------------------------------------------------------
+ *
+ * If we open one or the other of the files, we read it looking for
+ * MODE, LAT, LON, (HT, HTGPS, HTMSL), DELAY, OFFSET, ASSERT, CLEAR, HARDPPS,
+ * STATUS, POSN3D, POSN2D, CHAN, TRAIM
+ * then initialize using method MODE. For Mode = (1,3) all of (LAT, LON, HT) must
+ * be present or mode reverts to (2,4).
+ *
+ * Read input file.
+ *
+ * # is comment to end of line
+ * = allowed between 1st and 2nd fields.
+ *
+ * Expect to see one line with 'MODE' as first field, followed by an integer
+ * in the range 0-4 (default = 4).
+ *
+ * Expect to see two lines with 'LONG', 'LAT' followed by 1-3 fields.
+ * All numbers are floating point.
+ * DDD.ddd
+ * DDD MMM.mmm
+ * DDD MMM SSS.sss
+ *
+ * Expect to see one line with 'HT' as first field,
+ * followed by 1-2 fields. First is a number, the second is 'FT' or 'M'
+ * for feet or meters. HT is the height above the GPS ellipsoid.
+ * If the receiver reports height in both GPS and MSL, then we will report
+ * the difference GPS-MSL on the clockstats file.
+ *
+ * There is an optional line, starting with DELAY, followed
+ * by 1 or two fields. The first is a number (a time) the second is
+ * 'MS', 'US' or 'NS' for miliseconds, microseconds or nanoseconds.
+ * DELAY is cable delay, typically a few tens of ns.
+ *
+ * There is an optional line, starting with OFFSET, followed
+ * by 1 or two fields. The first is a number (a time) the second is
+ * 'MS', 'US' or 'NS' for miliseconds, microseconds or nanoseconds.
+ * OFFSET is the offset of the PPS pulse from 0. (only fully implemented
+ * with the PPSAPI, we need to be able to tell the Kernel about this
+ * offset if the Kernel PLL is in use, but can only do this presently
+ * when using the PPSAPI interface. If not using the Kernel PLL,
+ * then there is no problem.
+ *
+ * There is an optional line, with either ASSERT or CLEAR on it, which
+ * determine which transition of the PPS signal is used for timing by the
+ * PPSAPI. If neither is present, then ASSERT is assumed.
+ * ASSERT/CLEAR can also be set with FLAG2 of the ntp.conf input.
+ * For Flag2, ASSERT=0, and hence is default.
+ *
+ * There is an optional line, with HARDPPS on it. Including this line causes
+ * the PPS signal to control the kernel PLL.
+ * HARDPPS can also be set with FLAG3 of the ntp.conf input.
+ * For Flag3, 0 is disabled, and the default.
+ *
+ * There are three options that have to do with using the shared memory option.
+ * First, to enable the option there must be a SHMEM line with a file name.
+ * The file name is the file associated with the shared memory.
+ *
+ * In shared memory, there is one 'record' for each returned variable.
+ * For the @@Ea data there are three 'records' containing position data.
+ * There will always be data in the record corresponding to the '0D' @@Ea record,
+ * and the user has a choice of filling the '3D' record by specifying POSN3D,
+ * or the '2D' record by specifying POSN2D. In either case the '2D' or '3D'
+ * record is filled once every 15s.
+ *
+ * Two additional variables that can be set are CHAN and TRAIM. These should be
+ * set correctly by the code examining the @@Cj record, but we bring them out here
+ * to allow the user to override either the # of channels, or the existence of TRAIM.
+ * CHAN expects to be followed by in integer: 6, 8, or 12. TRAIM expects to be
+ * followed by YES or NO.
+ *
+ * There is an optional line with MASK on it followed by one integer field in the
+ * range 0 to 89. This sets the satellite mask angle and will determine the minimum
+ * elevation angle for satellites to be tracked by the receiver. The default value
+ * is 10 deg for the VP and 0 deg for all other receivers.
+ *
+ * There is an optional line with PPSCONTROL on it (only valid for M12 or M12+T
+ * receivers, the option is read, but ignored for all others)
+ * and it is followed by:
+ * ON Turn PPS on. This is the default and the default for other
+ * oncore receivers. The PPS is on even if not tracking
+ * any satellites.
+ * SATELLITE Turns PPS on if tracking at least 1 satellite, else off.
+ * TRAIM Turns PPS on or off controlled by TRAIM.
+ * The OFF option is NOT implemented, since the Oncore driver will not work
+ * without the PPS signal.
+ *
+ * So acceptable input would be
+ * # these are my coordinates (RWC)
+ * LON -106 34.610
+ * LAT 35 08.999
+ * HT 1589 # could equally well say HT 5215 FT
+ * DELAY 60 ns
+ */
+
+ FILE *fd;
+ char *cp, *cc, *ca, line[100], units[2], device[64], **cpp;
+ char *dirs[] = { "/etc/ntp", "/etc", 0 };
+ int i, sign, lat_flg, long_flg, ht_flg, mode, mask;
+ double f1, f2, f3;
+
+ fd = NULL; /* just to shutup gcc complaint */
+ for (cpp=dirs; *cpp; cpp++) {
+ cp = *cpp;
+ snprintf(device, sizeof(device), "%s/ntp.oncore.%d",
+ cp, instance->unit); /* try "ntp.oncore.0 */
+ if ((fd=fopen(device, "r")))
+ break;
+ snprintf(device, sizeof(device), "%s/ntp.oncore%d",
+ cp, instance->unit); /* try "ntp.oncore0" */
+ if ((fd=fopen(device, "r")))
+ break;
+ snprintf(device, sizeof(device), "%s/ntp.oncore", cp);
+ if ((fd=fopen(device, "r"))) /* last try "ntp.oncore" */
+ break;
+ }
+
+ if (!fd) { /* no inputfile, default to the works ... */
+ instance->init_type = 4;
+ return;
+ }
+
+ mode = mask = 0;
+ lat_flg = long_flg = ht_flg = 0;
+ while (fgets(line, 100, fd)) {
+
+ /* Remove comments */
+ if ((cp = strchr(line, '#')))
+ *cp = '\0';
+
+ /* Remove trailing space */
+ for (i = strlen(line);
+ i > 0 && isascii((int)line[i - 1]) && isspace((int)line[i - 1]);
+ )
+ line[--i] = '\0';
+
+ /* Remove leading space */
+ for (cc = line; *cc && isascii((int)*cc) && isspace((int)*cc); cc++)
+ continue;
+
+ /* Stop if nothing left */
+ if (!*cc)
+ continue;
+
+ /* Uppercase the command and find the arg */
+ for (ca = cc; *ca; ca++) {
+ if (isascii((int)*ca)) {
+ if (islower((int)*ca)) {
+ *ca = toupper(*ca);
+ } else if (isspace((int)*ca) || (*ca == '='))
+ break;
+ }
+ }
+
+ /* Remove space (and possible =) leading the arg */
+ for (; *ca && isascii((int)*ca) && (isspace((int)*ca) || (*ca == '=')); ca++)
+ continue;
+
+ if (!strncmp(cc, "STATUS", (size_t) 6) || !strncmp(cc, "SHMEM", (size_t) 5)) {
+ instance->shmem_fname = estrdup(ca);
+ continue;
+ }
+
+ /* Uppercase argument as well */
+ for (cp = ca; *cp; cp++)
+ if (isascii((int)*cp) && islower((int)*cp))
+ *cp = toupper(*cp);
+
+ if (!strncmp(cc, "LAT", (size_t) 3)) {
+ f1 = f2 = f3 = 0;
+ sscanf(ca, "%lf %lf %lf", &f1, &f2, &f3);
+ sign = 1;
+ if (f1 < 0) {
+ f1 = -f1;
+ sign = -1;
+ }
+ instance->ss_lat = sign*1000*(fabs(f3) + 60*(fabs(f2) + 60*f1)); /*miliseconds*/
+ lat_flg++;
+ } else if (!strncmp(cc, "LON", (size_t) 3)) {
+ f1 = f2 = f3 = 0;
+ sscanf(ca, "%lf %lf %lf", &f1, &f2, &f3);
+ sign = 1;
+ if (f1 < 0) {
+ f1 = -f1;
+ sign = -1;
+ }
+ instance->ss_long = sign*1000*(fabs(f3) + 60*(fabs(f2) + 60*f1)); /*miliseconds*/
+ long_flg++;
+ } else if (!strncmp(cc, "HT", (size_t) 2)) {
+ f1 = 0;
+ units[0] = '\0';
+ sscanf(ca, "%lf %1s", &f1, units);
+ if (units[0] == 'F')
+ f1 = 0.3048 * f1;
+ instance->ss_ht = 100 * f1; /* cm */
+ ht_flg++;
+ } else if (!strncmp(cc, "DELAY", (size_t) 5)) {
+ f1 = 0;
+ units[0] = '\0';
+ sscanf(ca, "%lf %1s", &f1, units);
+ if (units[0] == 'N')
+ ;
+ else if (units[0] == 'U')
+ f1 = 1000 * f1;
+ else if (units[0] == 'M')
+ f1 = 1000000 * f1;
+ else
+ f1 = 1000000000 * f1;
+ if (f1 < 0 || f1 > 1.e9)
+ f1 = 0;
+ if (f1 < 0 || f1 > 999999)
+ oncore_log_f(instance, LOG_WARNING,
+ "PPS Cable delay of %fns out of Range, ignored",
+ f1);
+ else
+ instance->delay = f1; /* delay in ns */
+ } else if (!strncmp(cc, "OFFSET", (size_t) 6)) {
+ f1 = 0;
+ units[0] = '\0';
+ sscanf(ca, "%lf %1s", &f1, units);
+ if (units[0] == 'N')
+ ;
+ else if (units[0] == 'U')
+ f1 = 1000 * f1;
+ else if (units[0] == 'M')
+ f1 = 1000000 * f1;
+ else
+ f1 = 1000000000 * f1;
+ if (f1 < 0 || f1 > 1.e9)
+ f1 = 0;
+ if (f1 < 0 || f1 > 999999999.)
+ oncore_log_f(instance, LOG_WARNING,
+ "PPS Offset of %fns out of Range, ignored",
+ f1);
+ else
+ instance->offset = f1; /* offset in ns */
+ } else if (!strncmp(cc, "MODE", (size_t) 4)) {
+ sscanf(ca, "%d", &mode);
+ if (mode < 0 || mode > 4)
+ mode = 4;
+ } else if (!strncmp(cc, "ASSERT", (size_t) 6)) {
+ instance->assert = 1;
+ } else if (!strncmp(cc, "CLEAR", (size_t) 5)) {
+ instance->assert = 0;
+ } else if (!strncmp(cc, "HARDPPS", (size_t) 7)) {
+ instance->hardpps = 1;
+ } else if (!strncmp(cc, "POSN2D", (size_t) 6)) {
+ instance->shmem_Posn = 2;
+ } else if (!strncmp(cc, "POSN3D", (size_t) 6)) {
+ instance->shmem_Posn = 3;
+ } else if (!strncmp(cc, "CHAN", (size_t) 4)) {
+ sscanf(ca, "%d", &i);
+ if ((i == 6) || (i == 8) || (i == 12))
+ instance->chan_in = i;
+ } else if (!strncmp(cc, "TRAIM", (size_t) 5)) {
+ instance->traim_in = 1; /* so TRAIM alone is YES */
+ if (!strcmp(ca, "NO") || !strcmp(ca, "OFF")) /* Yes/No, On/Off */
+ instance->traim_in = 0;
+ } else if (!strncmp(cc, "MASK", (size_t) 4)) {
+ sscanf(ca, "%d", &mask);
+ if (mask > -1 && mask < 90)
+ instance->Ag = mask; /* Satellite mask angle */
+ } else if (!strncmp(cc,"PPSCONTROL",10)) { /* pps control M12 only */
+ if (!strcmp(ca,"ON") || !strcmp(ca, "CONTINUOUS")) {
+ instance->pps_control = 1; /* PPS always on */
+ } else if (!strcmp(ca,"SATELLITE")) {
+ instance->pps_control = 2; /* PPS on when satellite is available */
+ } else if (!strcmp(ca,"TRAIM")) {
+ instance->pps_control = 3; /* PPS on when TRAIM status is OK */
+ } else {
+ oncore_log_f(instance, LOG_WARNING,
+ "Unknown value \"%s\" for PPSCONTROL, ignored",
+ cc);
+ }
+ }
+ }
+ fclose(fd);
+
+ /*
+ * OK, have read all of data file, and extracted the good stuff.
+ * If lat/long/ht specified they ALL must be specified for mode = (1,3).
+ */
+
+ instance->posn_set = 1;
+ if (!( lat_flg && long_flg && ht_flg )) {
+ oncore_log_f(instance, LOG_WARNING,
+ "ONCORE: incomplete data on %s", device);
+ instance->posn_set = 0;
+ if (mode == 1 || mode == 3) {
+ oncore_log_f(instance, LOG_WARNING,
+ "Input Mode = %d, but no/incomplete position, mode set to %d",
+ mode, mode+1);
+ mode++;
+ }
+ }
+ instance->init_type = mode;
+
+ oncore_log_f(instance, LOG_INFO, "Input mode = %d", mode);
+}
+
+
+
+/*
+ * move data from NTP to buffer (toss the extra in the unlikely case it won't fit)
+ */
+
+static void
+oncore_receive(
+ struct recvbuf *rbufp
+ )
+{
+ size_t i;
+ u_char *p;
+ struct peer *peer;
+ struct instance *instance;
+
+ peer = rbufp->recv_peer;
+ instance = peer->procptr->unitptr;
+ p = (u_char *) &rbufp->recv_space;
+
+#ifdef ONCORE_VERBOSE_RECEIVE
+ if (debug > 4) {
+ int i;
+ char Msg[120], Msg2[10];
+
+ oncore_log_f(instance, LOG_DEBUG,
+ ">>> %d bytes available",
+ rbufp->recv_length);
+ strlcpy(Msg, ">>>", sizeof(Msg));
+ for (i = 0; i < rbufp->recv_length; i++) {
+ snprintf(Msg2, sizeof(Msg2), "%02x ", p[i]);
+ strlcat(Msg, Msg2, sizeof(Msg));
+ }
+ oncore_log(instance, LOG_DEBUG, Msg);
+
+ strlcpy(Msg, ">>>", sizeof(Msg));
+ for (i = 0; i < rbufp->recv_length; i++) {
+ snprintf(Msg2, sizeof(Msg2), "%03o ", p[i]);
+ strlcat(Msg, Msg2, sizeof(Msg));
+ }
+ oncore_log(instance, LOG_DEBUG, Msg);
+ }
+#endif
+
+ i = rbufp->recv_length;
+ if (rcvbuf+rcvptr+i > &rcvbuf[sizeof rcvbuf])
+ i = sizeof(rcvbuf) - rcvptr; /* and some char will be lost */
+ memcpy(rcvbuf+rcvptr, p, i);
+ rcvptr += i;
+ oncore_consume(instance);
+}
+
+
+
+/*
+ * Deal with any complete messages
+ */
+
+static void
+oncore_consume(
+ struct instance *instance
+ )
+{
+ int i, m;
+ unsigned l;
+
+ while (rcvptr >= 7) {
+ if (rcvbuf[0] != '@' || rcvbuf[1] != '@') {
+ /* We're not in sync, lets try to get there */
+ for (i=1; i < rcvptr-1; i++)
+ if (rcvbuf[i] == '@' && rcvbuf[i+1] == '@')
+ break;
+#ifdef ONCORE_VERBOSE_CONSUME
+ if (debug > 4)
+ oncore_log_f(instance, LOG_DEBUG,
+ ">>> skipping %d chars",
+ i);
+#endif
+ if (i != rcvptr)
+ memcpy(rcvbuf, rcvbuf+i, (size_t)(rcvptr-i));
+ rcvptr -= i;
+ continue;
+ }
+
+ /* Ok, we have a header now */
+ l = sizeof(oncore_messages)/sizeof(oncore_messages[0]) -1;
+ for(m=0; m<l; m++)
+ if (!strncmp(oncore_messages[m].flag, (char *)(rcvbuf+2), (size_t) 2))
+ break;
+ if (m == l) {
+#ifdef ONCORE_VERBOSE_CONSUME
+ if (debug > 4)
+ oncore_log_f(instance, LOG_DEBUG,
+ ">>> Unknown MSG, skipping 4 (%c%c)",
+ rcvbuf[2], rcvbuf[3]);
+#endif
+ memcpy(rcvbuf, rcvbuf+4, (size_t) 4);
+ rcvptr -= 4;
+ continue;
+ }
+
+ l = oncore_messages[m].len;
+#ifdef ONCORE_VERBOSE_CONSUME
+ if (debug > 3)
+ oncore_log_f(instance, LOG_DEBUG,
+ "GOT: %c%c %d of %d entry %d",
+ instance->unit, rcvbuf[2],
+ rcvbuf[3], rcvptr, l, m);
+#endif
+ /* Got the entire message ? */
+
+ if (rcvptr < l)
+ return;
+
+ /* are we at the end of message? should be <Cksum><CR><LF> */
+
+ if (rcvbuf[l-2] != '\r' || rcvbuf[l-1] != '\n') {
+#ifdef ONCORE_VERBOSE_CONSUME
+ if (debug)
+ oncore_log(instance, LOG_DEBUG, "NO <CR><LF> at end of message");
+#endif
+ } else { /* check the CheckSum */
+ if (oncore_checksum_ok(rcvbuf, l)) {
+ if (instance->shmem != NULL) {
+ instance->shmem[oncore_messages[m].shmem + 2]++;
+ memcpy(instance->shmem + oncore_messages[m].shmem + 3,
+ rcvbuf, (size_t) l);
+ }
+ oncore_msg_any(instance, rcvbuf, (size_t) (l-3), m);
+ if (oncore_messages[m].handler)
+ oncore_messages[m].handler(instance, rcvbuf, (size_t) (l-3));
+ }
+#ifdef ONCORE_VERBOSE_CONSUME
+ else if (debug) {
+ char Msg[120], Msg2[10];
+
+ oncore_log(instance, LOG_ERR, "Checksum mismatch!");
+ snprintf(Msg, sizeof(Msg), "@@%c%c ", rcvbuf[2], rcvbuf[3]);
+ for (i = 4; i < l; i++) {
+ snprintf(Msg2, sizeof(Msg2),
+ "%03o ", rcvbuf[i]);
+ strlcat(Msg, Msg2, sizeof(Msg));
+ }
+ oncore_log(instance, LOG_DEBUG, Msg);
+ }
+#endif
+ }
+
+ if (l != rcvptr)
+ memcpy(rcvbuf, rcvbuf+l, (size_t) (rcvptr-l));
+ rcvptr -= l;
+ }
+}
+
+
+
+static void
+oncore_get_timestamp(
+ struct instance *instance,
+ long dt1, /* tick offset THIS time step */
+ long dt2 /* tick offset NEXT time step */
+ )
+{
+ int Rsm;
+ u_long j;
+ l_fp ts, ts_tmp;
+ double dmy;
+#ifdef HAVE_STRUCT_TIMESPEC
+ struct timespec *tsp = 0;
+#else
+ struct timeval *tsp = 0;
+#endif
+ int current_mode;
+ pps_params_t current_params;
+ struct timespec timeout;
+ struct peer *peer;
+ pps_info_t pps_i;
+ char Msg[160];
+
+ peer = instance->peer;
+
+#if 1
+ /* If we are in SiteSurvey mode, then we are in 3D mode, and we fall thru.
+ * If we have Finished the SiteSurvey, then we fall thru for the 14/15
+ * times we get here in 0D mode (the 1/15 is in 3D for SHMEM).
+ * This gives good time, which gets better when the SS is done.
+ */
+
+ if ((instance->site_survey == ONCORE_SS_DONE) && (instance->mode != MODE_0D)) {
+#else
+ /* old check, only fall thru for SS_DONE and 0D mode, 2h45m wait for ticks */
+
+ if ((instance->site_survey != ONCORE_SS_DONE) || (instance->mode != MODE_0D)) {
+#endif
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ /* Don't do anything without an almanac to define the GPS->UTC delta */
+
+ if (instance->rsm.bad_almanac) {
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ /* Once the Almanac is valid, the M12+T does not produce valid UTC
+ * immediately.
+ * Wait for UTC offset decode valid, then wait one message more
+ * so we are not off by 13 seconds after reset.
+ */
+
+ if (instance->count5) {
+ instance->count5--;
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ j = instance->ev_serial;
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+ if (time_pps_fetch(instance->pps_h, PPS_TSFMT_TSPEC, &pps_i,
+ &timeout) < 0) {
+ oncore_log_f(instance, LOG_ERR,
+ "time_pps_fetch failed %m");
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ if (instance->assert) {
+ tsp = &pps_i.assert_timestamp;
+
+#ifdef ONCORE_VERBOSE_GET_TIMESTAMP
+ if (debug > 2) {
+ u_long i;
+
+ i = (u_long) pps_i.assert_sequence;
+# ifdef HAVE_STRUCT_TIMESPEC
+ oncore_log_f(instance, LOG_DEBUG,
+ "serial/j (%lu, %lu) %ld.%09ld", i,
+ j, (long)tsp->tv_sec,
+ (long)tsp->tv_nsec);
+# else
+ oncore_log_f(instance, LOG_DEBUG,
+ "serial/j (%lu, %lu) %ld.%06ld", i,
+ j, (long)tsp->tv_sec,
+ (long)tsp->tv_usec);
+# endif
+ }
+#endif
+
+ if (pps_i.assert_sequence == j) {
+ oncore_log(instance, LOG_NOTICE, "ONCORE: oncore_get_timestamp, error serial pps");
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ instance->ev_serial = pps_i.assert_sequence;
+ } else {
+ tsp = &pps_i.clear_timestamp;
+
+#if 0
+ if (debug > 2) {
+ u_long i;
+
+ i = (u_long) pps_i.clear_sequence;
+# ifdef HAVE_STRUCT_TIMESPEC
+ oncore_log_f(instance, LOG_DEBUG,
+ "serial/j (%lu, %lu) %ld.%09ld", i,
+ j, (long)tsp->tv_sec,
+ (long)tsp->tv_nsec);
+# else
+ oncore_log_f(instance, LOG_DEBUG,
+ "serial/j (%lu, %lu) %ld.%06ld", i,
+ j, (long)tsp->tv_sec,
+ (long)tsp->tv_usec);
+# endif
+ }
+#endif
+
+ if (pps_i.clear_sequence == j) {
+ oncore_log(instance, LOG_ERR, "oncore_get_timestamp, error serial pps");
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+ instance->ev_serial = pps_i.clear_sequence;
+ }
+
+ /* convert timespec -> ntp l_fp */
+
+ dmy = tsp->tv_nsec;
+ dmy /= 1e9;
+ ts.l_uf = dmy * 4294967296.0;
+ ts.l_ui = tsp->tv_sec;
+
+#if 0
+ alternate code for previous 4 lines is
+ dmy = 1.0e-9*tsp->tv_nsec; /* fractional part */
+ DTOLFP(dmy, &ts);
+ dmy = tsp->tv_sec; /* integer part */
+ DTOLFP(dmy, &ts_tmp);
+ L_ADD(&ts, &ts_tmp);
+ or more simply
+ dmy = 1.0e-9*tsp->tv_nsec; /* fractional part */
+ DTOLFP(dmy, &ts);
+ ts.l_ui = tsp->tv_sec;
+#endif /* 0 */
+
+ /* now have timestamp in ts */
+ /* add in saw_tooth and offset, these will be ZERO if no TRAIM */
+ /* they will be IGNORED if the PPSAPI cant do PPS_OFFSET/ASSERT/CLEAR */
+ /* we just try to add them in and dont test for that here */
+
+ /* saw_tooth not really necessary if using TIMEVAL */
+ /* since its only precise to us, but do it anyway. */
+
+ /* offset in ns, and is positive (late), we subtract */
+ /* to put the PPS time transition back where it belongs */
+
+ /* must hand the offset for the NEXT sec off to the Kernel to do */
+ /* the addition, so that the Kernel PLL sees the offset too */
+
+ if (instance->assert)
+ instance->pps_p.assert_offset.tv_nsec = -dt2;
+ else
+ instance->pps_p.clear_offset.tv_nsec = -dt2;
+
+ /* The following code is necessary, and not just a time_pps_setparams,
+ * using the saved instance->pps_p, since some other process on the
+ * machine may have diddled with the mode bits (say adding something
+ * that it needs). We take what is there and ADD what we need.
+ * [[ The results from the time_pps_getcap is unlikely to change so
+ * we could probably just save it, but I choose to do the call ]]
+ * Unfortunately, there is only ONE set of mode bits in the kernel per
+ * interface, and not one set for each open handle.
+ *
+ * There is still a race condition here where we might mess up someone
+ * elses mode, but if he is being careful too, he should survive.
+ */
+
+ if (time_pps_getcap(instance->pps_h, &current_mode) < 0) {
+ oncore_log_f(instance, LOG_ERR,
+ "time_pps_getcap failed: %m");
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ if (time_pps_getparams(instance->pps_h, &current_params) < 0) {
+ oncore_log_f(instance, LOG_ERR,
+ "time_pps_getparams failed: %m");
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ /* or current and mine */
+ current_params.mode |= instance->pps_p.mode;
+ /* but only set whats legal */
+ current_params.mode &= current_mode;
+
+ current_params.assert_offset.tv_sec = 0;
+ current_params.assert_offset.tv_nsec = -dt2;
+ current_params.clear_offset.tv_sec = 0;
+ current_params.clear_offset.tv_nsec = -dt2;
+
+ if (time_pps_setparams(instance->pps_h, &current_params))
+ oncore_log(instance, LOG_ERR, "ONCORE: Error doing time_pps_setparams");
+
+ /* have time from UNIX origin, convert to NTP origin. */
+
+ ts.l_ui += JAN_1970;
+ instance->pp->lastrec = ts;
+
+ /* print out information about this timestamp (long line) */
+
+ ts_tmp = ts;
+ ts_tmp.l_ui = 0; /* zero integer part */
+ LFPTOD(&ts_tmp, dmy); /* convert fractional part to a double */
+ j = 1.0e9*dmy; /* then to integer ns */
+
+ Rsm = 0;
+ if (instance->chan == 6)
+ Rsm = instance->BEHa[64];
+ else if (instance->chan == 8)
+ Rsm = instance->BEHa[72];
+ else if (instance->chan == 12)
+ Rsm = ((instance->BEHa[129]<<8) | instance->BEHa[130]);
+
+ if (instance->chan == 6 || instance->chan == 8) {
+ char f1[5], f2[5], f3[5], f4[5];
+ if (instance->traim) {
+ snprintf(f1, sizeof(f1), "%d",
+ instance->BEHn[21]);
+ snprintf(f2, sizeof(f2), "%d",
+ instance->BEHn[22]);
+ snprintf(f3, sizeof(f3), "%2d",
+ instance->BEHn[23] * 256 +
+ instance->BEHn[24]);
+ snprintf(f4, sizeof(f4), "%3d",
+ (s_char)instance->BEHn[25]);
+ } else {
+ strlcpy(f1, "x", sizeof(f1));
+ strlcpy(f2, "x", sizeof(f2));
+ strlcpy(f3, "xx", sizeof(f3));
+ strlcpy(f4, "xxx", sizeof(f4));
+ }
+ snprintf(Msg, sizeof(Msg), /* MAX length 128, currently at 127 */
+ "%u.%09lu %d %d %2d %2d %2d %2ld rstat %02x dop %4.1f nsat %2d,%d traim %d,%s,%s sigma %s neg-sawtooth %s sat %d%d%d%d%d%d%d%d",
+ ts.l_ui, j,
+ instance->pp->year, instance->pp->day,
+ instance->pp->hour, instance->pp->minute, instance->pp->second,
+ (long) tsp->tv_sec % 60,
+ Rsm, 0.1*(256*instance->BEHa[35]+instance->BEHa[36]),
+ /*rsat dop */
+ instance->BEHa[38], instance->BEHa[39], instance->traim, f1, f2,
+ /* nsat visible, nsat tracked, traim,traim,traim */
+ f3, f4,
+ /* sigma neg-sawtooth */
+ /*sat*/ instance->BEHa[41], instance->BEHa[45], instance->BEHa[49], instance->BEHa[53],
+ instance->BEHa[57], instance->BEHa[61], instance->BEHa[65], instance->BEHa[69]
+ ); /* will be 0 for 6 chan */
+ } else if (instance->chan == 12) {
+ char f1[5], f2[5], f3[5], f4[5];
+ if (instance->traim) {
+ snprintf(f1, sizeof(f1), "%d",
+ instance->BEHn[6]);
+ snprintf(f2, sizeof(f2), "%d",
+ instance->BEHn[7]);
+ snprintf(f3, sizeof(f3), "%d",
+ instance->BEHn[12] * 256 +
+ instance->BEHn[13]);
+ snprintf(f4, sizeof(f4), "%3d",
+ (s_char)instance->BEHn[14]);
+ } else {
+ strlcpy(f1, "x", sizeof(f1));
+ strlcpy(f2, "x", sizeof(f2));
+ strlcpy(f3, "xx", sizeof(f3));
+ strlcpy(f4, "xxx", sizeof(f4));
+ }
+ snprintf(Msg, sizeof(Msg),
+ "%u.%09lu %d %d %2d %2d %2d %2ld rstat %02x dop %4.1f nsat %2d,%d traim %d,%s,%s sigma %s neg-sawtooth %s sat %d%d%d%d%d%d%d%d%d%d%d%d",
+ ts.l_ui, j,
+ instance->pp->year, instance->pp->day,
+ instance->pp->hour, instance->pp->minute, instance->pp->second,
+ (long) tsp->tv_sec % 60,
+ Rsm, 0.1*(256*instance->BEHa[53]+instance->BEHa[54]),
+ /*rsat dop */
+ instance->BEHa[55], instance->BEHa[56], instance->traim, f1, f2,
+ /* nsat visible, nsat tracked traim,traim,traim */
+ f3, f4,
+ /* sigma neg-sawtooth */
+ /*sat*/ instance->BEHa[58], instance->BEHa[64], instance->BEHa[70], instance->BEHa[76],
+ instance->BEHa[82], instance->BEHa[88], instance->BEHa[94], instance->BEHa[100],
+ instance->BEHa[106], instance->BEHa[112], instance->BEHa[118], instance->BEHa[124]
+ );
+ }
+
+ /* and some things I dont understand (magic ntp things) */
+
+ if (!refclock_process(instance->pp)) {
+ refclock_report(instance->peer, CEVNT_BADTIME);
+ peer->flags &= ~FLAG_PPS; /* problem - clear PPS FLAG */
+ return;
+ }
+
+ oncore_log(instance, LOG_INFO, Msg); /* this is long message above */
+ instance->pollcnt = 2;
+
+ if (instance->polled) {
+ instance->polled = 0;
+ /* instance->pp->dispersion = instance->pp->skew = 0; */
+ instance->pp->lastref = instance->pp->lastrec;
+ refclock_receive(instance->peer);
+ }
+ peer->flags |= FLAG_PPS;
+}
+
+
+/*************** oncore_msg_XX routines start here *******************/
+
+
+/*
+ * print Oncore response message.
+ */
+
+static void
+oncore_msg_any(
+ struct instance *instance,
+ u_char *buf,
+ size_t len,
+ int idx
+ )
+{
+#ifdef ONCORE_VERBOSE_MSG_ANY
+ int i;
+ const char *fmt = oncore_messages[idx].fmt;
+ const char *p;
+ char *q;
+ char *qlim;
+#ifdef HAVE_GETCLOCK
+ struct timespec ts;
+#endif
+ struct timeval tv;
+ char Msg[120], Msg2[10];
+
+ if (debug > 3) {
+# ifdef HAVE_GETCLOCK
+ (void) getclock(TIMEOFDAY, &ts);
+ tv.tv_sec = ts.tv_sec;
+ tv.tv_usec = ts.tv_nsec / 1000;
+# else
+ GETTIMEOFDAY(&tv, 0);
+# endif
+ oncore_log(instance, LOG_DEBUG, "%ld.%06ld",
+ (long)tv.tv_sec, (long)tv.tv_usec);
+
+ if (!*fmt) {
+ snprintf(Msg, sizeof(Msg), ">>@@%c%c ", buf[2],
+ buf[3]);
+ for(i = 2; i < len && i < 2400 ; i++) {
+ snprintf(Msg2, sizeof(Msg2), "%02x",
+ buf[i]);
+ strlcat(Msg, Msg2, sizeof(Msg));
+ }
+ oncore_log(instance, LOG_DEBUG, Msg);
+ return;
+ } else {
+ strlcpy(Msg, "##", sizeof(Msg));
+ qlim = Msg + sizeof(Msg) - 3;
+ for (p = fmt, q = Msg + 2; q < qlim && *p; ) {
+ *q++ = *p++;
+ *q++ = '_';
+ }
+ *q = '\0';
+ oncore_log(instance, LOG_DEBUG, Msg);
+ snprintf(Msg, sizeof(Msg), "%c%c", buf[2],
+ buf[3]);
+ i = 4;
+ for (p = fmt; *p; p++) {
+ snprintf(Msg2, "%02x", buf[i++]);
+ strlcat(Msg, Msg2, sizeof(Msg));
+ }
+ oncore_log(instance, LOG_DEBUG, Msg);
+ }
+ }
+#endif
+}
+
+
+
+/* Latitude, Longitude, Height */
+
+static void
+oncore_msg_Adef(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+}
+
+
+
+/* Mask Angle */
+
+static void
+oncore_msg_Ag(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ char *cp;
+
+ cp = "set to";
+ if (instance->o_state == ONCORE_RUN)
+ cp = "is";
+
+ instance->Ag = buf[4];
+ oncore_log_f(instance, LOG_INFO,
+ "Satellite mask angle %s %d degrees", cp,
+ (int)instance->Ag);
+}
+
+
+
+/*
+ * get Position hold position
+ */
+
+static void
+oncore_msg_As(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ instance->ss_lat = buf_w32(&buf[4]);
+ instance->ss_long = buf_w32(&buf[8]);
+ instance->ss_ht = buf_w32(&buf[12]);
+
+ /* Print out Position */
+ oncore_print_posn(instance);
+}
+
+
+
+/*
+ * Try to use Oncore UT+ Auto Survey Feature
+ * If its not there (VP), set flag to do it ourselves.
+ */
+
+static void
+oncore_msg_At(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ instance->saw_At = 1;
+ if (instance->site_survey == ONCORE_SS_TESTING) {
+ if (buf[4] == 2) {
+ oncore_log(instance, LOG_NOTICE,
+ "Initiating hardware 3D site survey");
+
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_HW");
+ instance->site_survey = ONCORE_SS_HW;
+ }
+ }
+}
+
+
+
+/*
+ * get PPS Offset
+ * Nb. @@Ay is not supported for early UT (no plus) model
+ */
+
+static void
+oncore_msg_Ay(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ if (instance->saw_Ay)
+ return;
+
+ instance->saw_Ay = 1;
+
+ instance->offset = buf_w32(&buf[4]);
+
+ oncore_log_f(instance, LOG_INFO, "PPS Offset is set to %ld ns",
+ instance->offset);
+}
+
+
+
+/*
+ * get Cable Delay
+ */
+
+static void
+oncore_msg_Az(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ if (instance->saw_Az)
+ return;
+
+ instance->saw_Az = 1;
+
+ instance->delay = buf_w32(&buf[4]);
+
+ oncore_log_f(instance, LOG_INFO, "Cable delay is set to %ld ns",
+ instance->delay);
+}
+
+
+
+/* Ba, Ea and Ha come here, these contain Position */
+
+static void
+oncore_msg_BaEaHa(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ const char *cp;
+ int mode;
+
+ /* OK, we are close to the RUN state now.
+ * But we have a few more items to initialize first.
+ *
+ * At the beginning of this routine there are several 'timers'.
+ * We enter this routine 1/sec, and since the upper levels of NTP have usurped
+ * the use of timers, we use the 1/sec entry to do things that
+ * we would normally do with timers...
+ */
+
+ if (instance->o_state == ONCORE_CHECK_CHAN) { /* here while checking for the # chan */
+ if (buf[2] == 'B') { /* 6chan */
+ if (instance->chan_ck < 6) instance->chan_ck = 6;
+ } else if (buf[2] == 'E') { /* 8chan */
+ if (instance->chan_ck < 8) instance->chan_ck = 8;
+ } else if (buf[2] == 'H') { /* 12chan */
+ if (instance->chan_ck < 12) instance->chan_ck = 12;
+ }
+
+ if (instance->count3++ < 5)
+ return;
+
+ instance->count3 = 0;
+
+ if (instance->chan_in != -1) /* set in Input */
+ instance->chan = instance->chan_in;
+ else /* set from test */
+ instance->chan = instance->chan_ck;
+
+ oncore_log_f(instance, LOG_INFO, "Input says chan = %d",
+ instance->chan_in);
+ oncore_log_f(instance, LOG_INFO, "Model # says chan = %d",
+ instance->chan_id);
+ oncore_log_f(instance, LOG_INFO, "Testing says chan = %d",
+ instance->chan_ck);
+ oncore_log_f(instance, LOG_INFO, "Using chan = %d",
+ instance->chan);
+
+ instance->o_state = ONCORE_HAVE_CHAN;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_HAVE_CHAN");
+
+ instance->timeout = 4;
+ oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
+ return;
+ }
+
+ if (instance->o_state != ONCORE_ALMANAC && instance->o_state != ONCORE_RUN)
+ return;
+
+ /* PAUSE 5sec - make sure results are stable, before using position */
+
+ if (instance->count) {
+ if (instance->count++ < 5)
+ return;
+ instance->count = 0;
+ }
+
+ memcpy(instance->BEHa, buf, (size_t) (len+3)); /* Ba, Ea or Ha */
+
+ /* check if we saw a response to Gc (M12 or M12+T */
+
+ if (instance->pps_control_msg_seen != -2) {
+ if ((instance->pps_control_msg_seen == -1) && (instance->pps_control != -1)) {
+ oncore_log(instance, LOG_INFO, "PPSCONTROL set, but not implemented (not M12)");
+ }
+ instance->pps_control_msg_seen = -2;
+ }
+
+ /* check the antenna (did it get unplugged) and almanac (is it ready) for changes. */
+
+ oncore_check_almanac(instance);
+ oncore_check_antenna(instance);
+
+ /* If we are in Almanac mode, waiting for Almanac, we can't do anything till we have it */
+ /* When we have an almanac, we will start the Bn/En/@@Hn messages */
+
+ if (instance->o_state == ONCORE_ALMANAC)
+ if (oncore_wait_almanac(instance))
+ return;
+
+ /* do some things once when we get this far in BaEaHa */
+
+ if (instance->once) {
+ instance->once = 0;
+ instance->count2 = 1;
+
+ /* Have we seen an @@At (position hold) command response */
+ /* if not, message out */
+
+ if (instance->chan != 12 && !instance->saw_At) {
+ oncore_log(instance, LOG_NOTICE,
+ "Not Good, no @@At command (no Position Hold), must be a GT/GT+");
+ oncore_sendmsg(instance, oncore_cmd_Av1, sizeof(oncore_cmd_Av1));
+ }
+
+ /* have an Almanac, can start the SiteSurvey
+ * (actually only need to get past the almanac_load where we diddle with At
+ * command,- we can't change it after we start the HW_SS below
+ */
+
+ mode = instance->init_type;
+ switch (mode) {
+ case 0: /* NO initialization, don't change anything */
+ case 1: /* Use given Position */
+ case 3:
+ instance->site_survey = ONCORE_SS_DONE;
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_DONE");
+ break;
+
+ case 2:
+ case 4: /* Site Survey */
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_TESTING");
+ instance->site_survey = ONCORE_SS_TESTING;
+ instance->count1 = 1;
+ if (instance->chan == 12)
+ oncore_sendmsg(instance, oncore_cmd_Gd3, sizeof(oncore_cmd_Gd3)); /* M12+T */
+ else
+ oncore_sendmsg(instance, oncore_cmd_At2, sizeof(oncore_cmd_At2)); /* not GT, arg not VP */
+ break;
+ }
+
+ /* Read back PPS Offset for Output */
+ /* Nb. This will fail silently for early UT (no plus) and M12 models */
+
+ oncore_sendmsg(instance, oncore_cmd_Ayx, sizeof(oncore_cmd_Ayx));
+
+ /* Read back Cable Delay for Output */
+
+ oncore_sendmsg(instance, oncore_cmd_Azx, sizeof(oncore_cmd_Azx));
+
+ /* Read back Satellite Mask Angle for Output */
+
+ oncore_sendmsg(instance, oncore_cmd_Agx, sizeof(oncore_cmd_Agx));
+ }
+
+
+ /* Unfortunately, the Gd3 command returns '3' for the M12 v1.3 firmware where it is
+ * out-of-range and it should return 0-2. (v1.3 can't do a HW Site Survey)
+ * We must do the Gd3, and then wait a cycle or two for things to settle,
+ * then check Ha[130]&0x10 to see if a SS is in progress.
+ * We will set SW if HW has not been set after an appropriate delay.
+ */
+
+ if (instance->site_survey == ONCORE_SS_TESTING) {
+ if (instance->chan == 12) {
+ if (instance->count1) {
+ if (instance->count1++ > 5 || instance->BEHa[130]&0x10) {
+ instance->count1 = 0;
+ if (instance->BEHa[130]&0x10) {
+ oncore_log(instance, LOG_NOTICE,
+ "Initiating hardware 3D site survey");
+
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_HW");
+ instance->site_survey = ONCORE_SS_HW;
+ } else {
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_SW");
+ instance->site_survey = ONCORE_SS_SW;
+ }
+ }
+ }
+ } else {
+ if (instance->count1) {
+ if (instance->count1++ > 5) {
+ instance->count1 = 0;
+ /*
+ * For instance->site_survey to still be ONCORE_SS_TESTING, then after a 5sec
+ * wait after the @@At2/@@Gd3 command we have not changed the state to
+ * ONCORE_SS_HW. If the Hardware is capable of doing a Site Survey, then
+ * the variable would have been changed by now.
+ * There are three possibilities:
+ * 6/8chan
+ * (a) We did not get a response to the @@At0 or @@At2 commands,
+ * and it must be a GT/GT+/SL with no position hold mode.
+ * We will have to do it ourselves.
+ * (b) We saw the @@At0, @@At2 commands, but @@At2 failed,
+ * must be a VP or older UT which doesn't have Site Survey mode.
+ * We will have to do it ourselves.
+ * 12chan
+ * (c) We saw the @@Gd command, and saw H[13]*0x10
+ * We will have to do it ourselves (done above)
+ */
+
+ oncore_log_f(instance, LOG_INFO,
+ "Initiating software 3D site survey (%d samples)",
+ POS_HOLD_AVERAGE);
+
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_SW");
+ instance->site_survey = ONCORE_SS_SW;
+
+ instance->ss_lat = instance->ss_long = instance->ss_ht = 0;
+ if (instance->chan == 12)
+ oncore_sendmsg(instance, oncore_cmd_Gd0, sizeof(oncore_cmd_Gd0)); /* disable */
+ else {
+ oncore_sendmsg(instance, oncore_cmd_At0, sizeof(oncore_cmd_At0)); /* disable */
+ oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0)); /* disable */
+ }
+ }
+ }
+ }
+ }
+
+ /* check the mode we are in 0/2/3D */
+
+ if (instance->chan == 6) {
+ if (instance->BEHa[64]&0x8)
+ instance->mode = MODE_0D;
+ else if (instance->BEHa[64]&0x10)
+ instance->mode = MODE_2D;
+ else if (instance->BEHa[64]&0x20)
+ instance->mode = MODE_3D;
+ } else if (instance->chan == 8) {
+ if (instance->BEHa[72]&0x8)
+ instance->mode = MODE_0D;
+ else if (instance->BEHa[72]&0x10)
+ instance->mode = MODE_2D;
+ else if (instance->BEHa[72]&0x20)
+ instance->mode = MODE_3D;
+ } else if (instance->chan == 12) {
+ int bits;
+
+ bits = (instance->BEHa[129]>>5) & 0x7; /* actually Ha */
+ if (bits == 0x4)
+ instance->mode = MODE_0D;
+ else if (bits == 0x6)
+ instance->mode = MODE_2D;
+ else if (bits == 0x7)
+ instance->mode = MODE_3D;
+ }
+
+ /* copy the record to the (extra) location in SHMEM */
+
+ if (instance->shmem) {
+ int i;
+ u_char *smp; /* pointer to start of shared mem for Ba/Ea/Ha */
+
+ switch(instance->chan) {
+ case 6: smp = &instance->shmem[instance->shmem_Ba]; break;
+ case 8: smp = &instance->shmem[instance->shmem_Ea]; break;
+ case 12: smp = &instance->shmem[instance->shmem_Ha]; break;
+ default: smp = (u_char *) NULL; break;
+ }
+
+ switch (instance->mode) {
+ case MODE_0D: i = 1; break; /* 0D, Position Hold */
+ case MODE_2D: i = 2; break; /* 2D, Altitude Hold */
+ case MODE_3D: i = 3; break; /* 3D fix */
+ default: i = 0; break;
+ }
+
+ if (i && smp != NULL) {
+ i *= (len+6);
+ smp[i + 2]++;
+ memcpy(&smp[i+3], buf, (size_t) (len+3));
+ }
+ }
+
+ /*
+ * check if traim timer active
+ * if it hasn't been cleared, then @@Bn/@@En/@@Hn did not respond
+ */
+
+ if (instance->traim_delay) {
+ if (instance->traim_delay++ > 5) {
+ instance->traim = 0;
+ instance->traim_delay = 0;
+ cp = "ONCORE: Did not detect TRAIM response, TRAIM = OFF";
+ oncore_log(instance, LOG_INFO, cp);
+
+ oncore_set_traim(instance);
+ } else
+ return;
+
+ }
+
+ /* by now should have a @@Ba/@@Ea/@@Ha with good data in it */
+
+ if (!instance->have_dH && !instance->traim_delay)
+ oncore_compute_dH(instance);
+
+ /*
+ * must be ONCORE_RUN if we are here.
+ * Have # chan and TRAIM by now.
+ */
+
+ instance->pp->year = buf[6]*256+buf[7];
+ instance->pp->day = ymd2yd(buf[6]*256+buf[7], buf[4], buf[5]);
+ instance->pp->hour = buf[8];
+ instance->pp->minute = buf[9];
+ instance->pp->second = buf[10];
+
+ /*
+ * Are we doing a Hardware or Software Site Survey?
+ */
+
+ if (instance->site_survey == ONCORE_SS_HW || instance->site_survey == ONCORE_SS_SW)
+ oncore_ss(instance);
+
+ /* see if we ever saw a response from the @@Ayx above */
+
+ if (instance->count2) {
+ if (instance->count2++ > 5) { /* this delay to check on @@Ay command */
+ instance->count2 = 0;
+
+ /* Have we seen an Ay (1PPS time offset) command response */
+ /* if not, and non-zero offset, zero the offset, and send message */
+
+ if (!instance->saw_Ay && instance->offset) {
+ oncore_log(instance, LOG_INFO, "No @@Ay command, PPS OFFSET ignored");
+ instance->offset = 0;
+ }
+ }
+ }
+
+ /*
+ * Check the leap second status once per day.
+ */
+
+ oncore_check_leap_sec(instance);
+
+ /*
+ * if SHMEM active, every 15s, steal one 'tick' to get 2D or 3D posn.
+ */
+
+ if (instance->shmem && !instance->shmem_bad_Ea && instance->shmem_Posn && (instance->site_survey == ONCORE_SS_DONE))
+ oncore_shmem_get_3D(instance);
+
+ if (!instance->traim) /* NO traim, no BnEnHn, go get tick */
+ oncore_get_timestamp(instance, instance->offset, instance->offset);
+}
+
+
+
+/* Almanac Status */
+
+static void
+oncore_msg_Bd(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ oncore_log_f(instance, LOG_NOTICE,
+ "Bd: Almanac %s, week = %d, t = %d, %d SVs: %x",
+ ((buf[4]) ? "LOADED" : "(NONE)"), buf[5], buf[6],
+ buf[7], w32(&buf[8]));
+}
+
+
+
+/* get leap-second warning message */
+
+/*
+ * @@Bj does NOT behave as documented in current Oncore firmware.
+ * It turns on the LEAP indicator when the data is set, and does not,
+ * as documented, wait until the beginning of the month when the
+ * leap second will occur.
+ * Since this firmware bug will never be fixed in all the outstanding Oncore receivers
+ * @@Bj is only called in June/December.
+ */
+
+static void
+oncore_msg_Bj(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ const char *cp;
+
+ instance->saw_Bj = 1;
+
+ switch(buf[4]) {
+ case 1:
+ instance->pp->leap = LEAP_ADDSECOND;
+ cp = "Set pp.leap to LEAP_ADDSECOND";
+ break;
+ case 2:
+ instance->pp->leap = LEAP_DELSECOND;
+ cp = "Set pp.leap to LEAP_DELSECOND";
+ break;
+ case 0:
+ default:
+ instance->pp->leap = LEAP_NOWARNING;
+ cp = "Set pp.leap to LEAP_NOWARNING";
+ break;
+ }
+ oncore_log(instance, LOG_NOTICE, cp);
+}
+
+
+
+static void
+oncore_msg_Bl(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ int chan, id, subframe, valid, page, i, j, tow;
+ int day_now, day_lsf;
+ char *cp;
+ enum {
+ WARN_NOT_YET,
+ WARN_0,
+ WARN_PLUS,
+ WARN_MINUS
+ } warn;
+
+ day_now = day_lsf = 0;
+ cp = NULL; /* keep gcc happy */
+
+ chan = buf[4] & 0377;
+ id = buf[5] & 0377;
+ subframe = buf[6] & 017;
+ valid = (buf[6] >> 4) & 017;
+ page = buf[7];
+
+ if ((!instance->Bl.lsf_flg && !instance->Bl.wn_flg) && (subframe == 4 && page == 18 && valid == 10)) {
+ instance->Bl.dt_ls = buf[32];
+ instance->Bl.WN_lsf = buf[33];
+ instance->Bl.DN_lsf = buf[34];
+ instance->Bl.dt_lsf = buf[35];
+ instance->Bl.lsf_flg++;
+ }
+ if ((instance->Bl.lsf_flg && !instance->Bl.wn_flg) && (subframe == 1 && valid == 10)) {
+ i = (buf[7+7]<<8) + buf[7+8];
+ instance->Bl.WN = i >> 6;
+ tow = (buf[7+4]<<16) + (buf[7+5]<<8) + buf[7+6];
+ tow >>= 7;
+ tow = tow & 0377777;
+ tow <<= 2;
+ instance->Bl.DN = tow/57600L + 1;
+ instance->Bl.wn_flg++;
+ }
+ if (instance->Bl.wn_flg && instance->Bl.lsf_flg) {
+ instance->Bl.wn_flg = instance->Bl.lsf_flg = 0;
+ oncore_cmd_Bl[2] = 0;
+ oncore_sendmsg(instance, oncore_cmd_Bl, sizeof oncore_cmd_Bl);
+ oncore_cmd_Bl[2] = 1;
+
+ i = instance->Bl.WN&01400;
+ instance->Bl.WN_lsf |= i;
+
+ /* have everything I need, doit */
+
+ i = (instance->Bl.WN_lsf - instance->Bl.WN);
+ if (i < 0)
+ i += 1024;
+ day_now = instance->Bl.DN;
+ day_lsf = 7*i + instance->Bl.DN_lsf;
+
+ /* ignore if in past or more than a month in future */
+
+ warn = WARN_NOT_YET;
+ if (day_lsf >= day_now && day_lsf - day_now < 32) {
+ /* if < 28d, doit, if 28-31, ck day-of-month < 20 (not at end of prev month) */
+ if (day_lsf - day_now < 28 || instance->BEHa[5] < 20) {
+ i = instance->Bl.dt_lsf - instance->Bl.dt_ls;
+ switch (i) {
+ case -1:
+ warn = WARN_MINUS;
+ break;
+ case 0:
+ warn = WARN_0;
+ break;
+ case 1:
+ warn = WARN_PLUS;
+ break;
+ }
+ }
+ }
+
+ switch (warn) {
+ case WARN_0:
+ case WARN_NOT_YET:
+ instance->peer->leap = LEAP_NOWARNING;
+ cp = "Set peer.leap to LEAP_NOWARNING";
+ break;
+ case WARN_MINUS:
+ instance->peer->leap = LEAP_DELSECOND;
+ cp = "Set peer.leap to LEAP_DELSECOND";
+ break;
+ case WARN_PLUS:
+ instance->peer->leap = LEAP_ADDSECOND;
+ cp = "Set peer.leap to LEAP_ADDSECOND";
+ break;
+ }
+ oncore_log(instance, LOG_NOTICE, cp);
+
+ i = instance->Bl.dt_lsf-instance->Bl.dt_ls;
+ if (i) {
+ j = (i >= 0) ? i : -i; /* abs(i) */
+ oncore_log_f(instance, LOG_NOTICE,
+ "see Leap_Second (%c%d) in %d days",
+ ((i >= 0) ? '+' : '-'), j,
+ day_lsf-day_now);
+ }
+ }
+
+/*
+ * Reg only wants the following output for "deeper" driver debugging.
+ * See Bug 2142 and Bug 1866
+ */
+#if 0
+ oncore_log_f(instance, LOG_DEBUG,
+ "dt_ls = %d dt_lsf = %d WN = %d DN = %d WN_lsf = %d DNlsf = %d wn_flg = %d lsf_flg = %d Bl_day = %d",
+ instance->Bl.dt_ls, instance->Bl.dt_lsf,
+ instance->Bl.WN, instance->Bl.DN,
+ instance->Bl.WN_lsf, instance->Bl.DN_lsf,
+ instance->Bl.wn_flg, instance->Bl.lsf_flg,
+ instance->Bl.Bl_day);
+#endif
+}
+
+
+static void
+oncore_msg_BnEnHn(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ long dt1, dt2;
+
+ if (instance->o_state != ONCORE_RUN)
+ return;
+
+ if (instance->traim_delay) { /* flag that @@Bn/@@En/Hn returned */
+ instance->traim_ck = 1;
+ instance->traim_delay = 0;
+ oncore_log(instance, LOG_NOTICE, "ONCORE: Detected TRAIM, TRAIM = ON");
+
+ oncore_set_traim(instance);
+ }
+
+ memcpy(instance->BEHn, buf, (size_t) len); /* Bn or En or Hn */
+
+ if (!instance->traim) /* BnEnHn will be turned off in any case */
+ return;
+
+ /* If Time RAIM doesn't like it, don't trust it */
+
+ if (buf[2] == 'H') {
+ if (instance->BEHn[6]) { /* bad TRAIM */
+ oncore_log(instance, LOG_WARNING, "BAD TRAIM");
+ return;
+ }
+
+ dt1 = instance->saw_tooth + instance->offset; /* dt this time step */
+ instance->saw_tooth = (s_char) instance->BEHn[14]; /* update for next time Hn[14] */
+ dt2 = instance->saw_tooth + instance->offset; /* dt next time step */
+ } else {
+ if (instance->BEHn[21]) /* bad TRAIM */
+ return;
+
+ dt1 = instance->saw_tooth + instance->offset; /* dt this time step */
+ instance->saw_tooth = (s_char) instance->BEHn[25]; /* update for next time Bn[25], En[25] */
+ dt2 = instance->saw_tooth + instance->offset; /* dt next time step */
+ }
+
+ oncore_get_timestamp(instance, dt1, dt2);
+}
+
+
+
+/* Here for @@Ca, @@Fa and @@Ia messages */
+
+/* These are Self test Commands for 6, 8, and 12 chan receivers.
+ * There are good reasons NOT to do a @@Ca, @@Fa or @@Ia command with the ONCORE.
+ * It was found that under some circumstances the following
+ * command would fail if issued immediately after the return from the
+ * @@Fa, but a 2sec delay seemed to fix things. Since simply calling
+ * sleep(2) is wasteful, and may cause trouble for some OS's, repeating
+ * itimer, we set a flag, and test it at the next POLL. If it hasn't
+ * been cleared, we reissue the @@Cj that is issued below.
+ * Note that we do a @@Cj at the beginning, and again here.
+ * The first is to get the info, the 2nd is just used as a safe command
+ * after the @@Fa for all Oncores (and it was in this posn in the
+ * original code).
+ */
+
+static void
+oncore_msg_CaFaIa(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ int i;
+
+ if (instance->o_state == ONCORE_TEST_SENT) {
+ enum antenna_state antenna;
+
+ instance->timeout = 0;
+
+#if ONCORE_VERBOSE_SELF_TEST
+ if (debug > 2) {
+ if (buf[2] == 'I')
+ oncore_log_f(instance, LOG_DEBUG,
+ ">>@@%ca %x %x %x", buf[2],
+ buf[4], buf[5], buf[6]);
+ else
+ oncore_log_f(instance, LOG_DEBUG,
+ ">>@@%ca %x %x", buf[2],
+ buf[4], buf[5]);
+ }
+#endif
+
+ antenna = (buf[4] & 0xc0) >> 6;
+ buf[4] &= ~0xc0;
+
+ i = buf[4] || buf[5];
+ if (buf[2] == 'I') i = i || buf[6];
+ if (i) {
+ if (buf[2] == 'I')
+ oncore_log_f(instance, LOG_ERR,
+ "self test failed: result %02x %02x %02x",
+ buf[4], buf[5], buf[6]);
+ else
+ oncore_log_f(instance, LOG_ERR,
+ "self test failed: result %02x %02x",
+ buf[4], buf[5]);
+
+ oncore_log(instance, LOG_ERR,
+ "ONCORE: self test failed, shutting down driver");
+
+ refclock_report(instance->peer, CEVNT_FAULT);
+ oncore_shutdown(instance->unit, instance->peer);
+ return;
+ }
+
+ /* report the current antenna state */
+
+ oncore_antenna_report(instance, antenna);
+
+ instance->o_state = ONCORE_INIT;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_INIT");
+
+ instance->timeout = 4;
+ oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
+ }
+}
+
+
+
+/*
+ * Demultiplex the almanac into shmem
+ */
+
+static void
+oncore_msg_Cb(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ int i;
+
+ if (instance->shmem == NULL)
+ return;
+
+ if (buf[4] == 5 && buf[5] > 0 && buf[5] < 26)
+ i = buf[5];
+ else if (buf[4] == 4 && buf[5] <= 5)
+ i = buf[5] + 24;
+ else if (buf[4] == 4 && buf[5] <= 10)
+ i = buf[5] + 23;
+ else if (buf[4] == 4 && buf[5] == 25)
+ i = 34;
+ else {
+ oncore_log(instance, LOG_NOTICE, "Cb: Response is NO ALMANAC");
+ return;
+ }
+
+ i *= 36;
+ instance->shmem[instance->shmem_Cb + i + 2]++;
+ memcpy(instance->shmem + instance->shmem_Cb + i + 3, buf, (size_t) (len + 3));
+
+#ifdef ONCORE_VERBOSE_MSG_CB
+ oncore_log_f(instance, LOG_DEBUG, "See Cb [%d,%d]", buf[4],
+ buf[5]);
+#endif
+}
+
+
+
+/*
+ * Set to Factory Defaults (Reasonable for UT w/ no Battery Backup
+ * not so for VP (eeprom) or any unit with a battery
+ */
+
+static void
+oncore_msg_Cf(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ if (instance->o_state == ONCORE_RESET_SENT) {
+ oncore_sendmsg(instance, oncore_cmd_Cg, sizeof(oncore_cmd_Cg)); /* Return to Posn Fix mode */
+ /* Reset set VP to IDLE */
+ instance->o_state = ONCORE_TEST_SENT;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_TEST_SENT");
+
+ oncore_sendmsg(instance, oncore_cmd_Cj, sizeof(oncore_cmd_Cj));
+ }
+}
+
+
+
+/*
+ * This is the Grand Central Station for the Preliminary Initialization.
+ * Once done here we move on to oncore_msg_BaEaHa for final Initialization and Running.
+ *
+ * We do an @@Cj whenever we need a safe command for all Oncores.
+ * The @@Cj gets us back here where we can switch to the next phase of setup.
+ *
+ * o Once at the very beginning (in start) to get the Model number.
+ * This info is printed, but no longer used.
+ * o Again after we have determined the number of Channels in the receiver.
+ * o And once later after we have done a reset and test, (which may hang),
+ * as we are about to initialize the Oncore and start it running.
+ * o We have one routine below for each case.
+ */
+
+static void
+oncore_msg_Cj(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ int mode;
+
+ memcpy(instance->Cj, buf, len);
+
+ instance->timeout = 0;
+ if (instance->o_state == ONCORE_CHECK_ID) {
+ oncore_msg_Cj_id(instance, buf, len);
+ oncore_chan_test(instance);
+ } else if (instance->o_state == ONCORE_HAVE_CHAN) {
+ mode = instance->init_type;
+ if (mode == 3 || mode == 4) { /* Cf will return here to check for TEST */
+ instance->o_state = ONCORE_RESET_SENT;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_RESET_SENT");
+ oncore_sendmsg(instance, oncore_cmd_Cf, sizeof(oncore_cmd_Cf));
+ } else {
+ instance->o_state = ONCORE_TEST_SENT;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_TEST_SENT");
+ }
+ }
+
+ if (instance->o_state == ONCORE_TEST_SENT) {
+ if (instance->chan == 6)
+ oncore_sendmsg(instance, oncore_cmd_Ca, sizeof(oncore_cmd_Ca));
+ else if (instance->chan == 8)
+ oncore_sendmsg(instance, oncore_cmd_Fa, sizeof(oncore_cmd_Fa));
+ else if (instance->chan == 12)
+ oncore_sendmsg(instance, oncore_cmd_Ia, sizeof(oncore_cmd_Ia));
+ } else if (instance->o_state == ONCORE_INIT)
+ oncore_msg_Cj_init(instance, buf, len);
+}
+
+
+
+/* The information on determining a Oncore 'Model', viz VP, UT, etc, from
+ * the Model Number comes from "Richard M. Hambly" <rick@cnssys.com>
+ * and from Motorola. Until recently Rick was the only source of
+ * this information as Motorola didn't give the information out.
+ *
+ * Determine the Type from the Model #, this determines #chan and if TRAIM is
+ * available.
+ *
+ * The Information from this routine is NO LONGER USED.
+ * The RESULTS are PRINTED, BUT NOT USED, and the routine COULD BE DELETED
+ */
+
+static void
+oncore_msg_Cj_id(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ char *cp, *cp1, *cp2, Model[21];
+
+ /* Write Receiver ID message to clockstats file */
+
+ instance->Cj[294] = '\0';
+ for (cp=(char *)instance->Cj; cp< (char *) &instance->Cj[294]; ) {
+ cp1 = strchr(cp, '\r');
+ if (!cp1)
+ cp1 = (char *)&instance->Cj[294];
+ *cp1 = '\0';
+ oncore_log(instance, LOG_NOTICE, cp);
+ *cp1 = '\r';
+ cp = cp1+2;
+ }
+
+ /* next, the Firmware Version and Revision numbers */
+
+ instance->version = atoi((char *) &instance->Cj[83]);
+ instance->revision = atoi((char *) &instance->Cj[111]);
+
+ /* from model number decide which Oncore this is,
+ and then the number of channels */
+
+ for (cp= (char *) &instance->Cj[160]; *cp == ' '; cp++) /* start right after 'Model #' */
+ ;
+ cp1 = cp;
+ cp2 = Model;
+ for (; !isspace((int)*cp) && cp-cp1 < 20; cp++, cp2++)
+ *cp2 = *cp;
+ *cp2 = '\0';
+
+ cp = 0;
+ if (!strncmp(Model, "PVT6", (size_t) 4)) {
+ cp = "PVT6";
+ instance->model = ONCORE_PVT6;
+ } else if (Model[0] == 'A') {
+ cp = "Basic";
+ instance->model = ONCORE_BASIC;
+ } else if (Model[0] == 'B' || !strncmp(Model, "T8", (size_t) 2)) {
+ cp = "VP";
+ instance->model = ONCORE_VP;
+ } else if (Model[0] == 'P') {
+ cp = "M12";
+ instance->model = ONCORE_M12;
+ } else if (Model[0] == 'R' || Model[0] == 'D' || Model[0] == 'S') {
+ if (Model[5] == 'N') {
+ cp = "GT";
+ instance->model = ONCORE_GT;
+ } else if ((Model[1] == '3' || Model[1] == '4') && Model[5] == 'G') {
+ cp = "GT+";
+ instance->model = ONCORE_GTPLUS;
+ } else if ((Model[1] == '5' && Model[5] == 'U') || (Model[1] == '1' && Model[5] == 'A')) {
+ cp = "UT";
+ instance->model = ONCORE_UT;
+ } else if (Model[1] == '5' && Model[5] == 'G') {
+ cp = "UT+";
+ instance->model = ONCORE_UTPLUS;
+ } else if (Model[1] == '6' && Model[5] == 'G') {
+ cp = "SL";
+ instance->model = ONCORE_SL;
+ } else {
+ cp = "Unknown";
+ instance->model = ONCORE_UNKNOWN;
+ }
+ } else {
+ cp = "Unknown";
+ instance->model = ONCORE_UNKNOWN;
+ }
+
+ /* use MODEL to set CHAN and TRAIM and possibly zero SHMEM */
+
+ oncore_log_f(instance, LOG_INFO,
+ "This looks like an Oncore %s with version %d.%d firmware.",
+ cp, instance->version, instance->revision);
+
+ instance->chan_id = 8; /* default */
+ if (instance->model == ONCORE_BASIC || instance->model == ONCORE_PVT6)
+ instance->chan_id = 6;
+ else if (instance->model == ONCORE_VP || instance->model == ONCORE_UT || instance->model == ONCORE_UTPLUS)
+ instance->chan_id = 8;
+ else if (instance->model == ONCORE_M12)
+ instance->chan_id = 12;
+
+ instance->traim_id = 0; /* default */
+ if (instance->model == ONCORE_BASIC || instance->model == ONCORE_PVT6)
+ instance->traim_id = 0;
+ else if (instance->model == ONCORE_VP || instance->model == ONCORE_UT || instance->model == ONCORE_UTPLUS)
+ instance->traim_id = 1;
+ else if (instance->model == ONCORE_M12)
+ instance->traim_id = -1;
+
+ oncore_log_f(instance, LOG_INFO, "Channels = %d, TRAIM = %s",
+ instance->chan_id,
+ ((instance->traim_id < 0)
+ ? "UNKNOWN"
+ : (instance->traim_id > 0)
+ ? "ON"
+ : "OFF"));
+}
+
+
+
+/* OK, know type of Oncore, have possibly reset it, and have tested it.
+ * We know the number of channels.
+ * We will determine whether we have TRAIM before we actually start.
+ * Now initialize.
+ */
+
+static void
+oncore_msg_Cj_init(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ u_char Cmd[20];
+ int mode;
+
+
+ /* The M12 with 1.3 or 2.0 Firmware, loses track of all Satellites and has to
+ * start again if we go from 0D -> 3D, then loses them again when we
+ * go from 3D -> 0D. We do this to get a @@Ea message for SHMEM.
+ * For NOW we will turn this aspect of filling SHMEM off for the M12
+ */
+
+ if (instance->chan == 12) {
+ instance->shmem_bad_Ea = 1;
+ oncore_log_f(instance, LOG_NOTICE,
+ "*** SHMEM partially enabled for ONCORE M12 s/w v%d.%d ***",
+ instance->version, instance->revision);
+ }
+
+ oncore_sendmsg(instance, oncore_cmd_Cg, sizeof(oncore_cmd_Cg)); /* Return to Posn Fix mode */
+ oncore_sendmsg(instance, oncore_cmd_Bb, sizeof(oncore_cmd_Bb)); /* turn on for shmem (6/8/12) */
+ oncore_sendmsg(instance, oncore_cmd_Ek, sizeof(oncore_cmd_Ek)); /* turn off (VP) */
+ oncore_sendmsg(instance, oncore_cmd_Aw, sizeof(oncore_cmd_Aw)); /* UTC time (6/8/12) */
+ oncore_sendmsg(instance, oncore_cmd_AB, sizeof(oncore_cmd_AB)); /* Appl type static (VP) */
+ oncore_sendmsg(instance, oncore_cmd_Be, sizeof(oncore_cmd_Be)); /* Tell us the Almanac for shmem (6/8/12) */
+ oncore_sendmsg(instance, oncore_cmd_Bd, sizeof(oncore_cmd_Bd)); /* Tell us when Almanac changes */
+
+ mode = instance->init_type;
+
+ /* If there is Position input in the Config file
+ * and mode = (1,3) set it as posn hold posn, goto 0D mode.
+ * or mode = (2,4) set it as INITIAL position, and do Site Survey.
+ */
+
+ if (instance->posn_set) {
+ oncore_log(instance, LOG_INFO, "Setting Posn from input data");
+ oncore_set_posn(instance); /* this should print posn indirectly thru the As cmd */
+ } else /* must issue an @@At here to check on 6/8 Position Hold, set_posn would have */
+ if (instance->chan != 12)
+ oncore_sendmsg(instance, oncore_cmd_Atx, sizeof(oncore_cmd_Atx));
+
+ if (mode != 0) {
+ /* cable delay in ns */
+ memcpy(Cmd, oncore_cmd_Az, (size_t) sizeof(oncore_cmd_Az));
+ w32_buf(&Cmd[-2+4], instance->delay);
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Az)); /* 6,8,12 */
+
+ /* PPS offset in ns */
+ memcpy(Cmd, oncore_cmd_Ay, (size_t) sizeof(oncore_cmd_Ay)); /* some have it, some don't */
+ w32_buf(&Cmd[-2+4], instance->offset); /* will check for hw response */
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Ay));
+
+ /* Satellite mask angle */
+
+ if (instance->Ag != 0xff) { /* will have 0xff in it if not set by user */
+ memcpy(Cmd, oncore_cmd_Ag, (size_t) sizeof(oncore_cmd_Ag));
+ Cmd[-2+4] = instance->Ag;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Ag));
+ }
+ }
+
+ /* 6, 8 12 chan - Position/Status/Data Output Message, 1/s
+ * now we're really running
+ * these were ALL started in the chan test,
+ * However, if we had mode=3,4 then commands got turned off, so we turn
+ * them on again here just in case
+ */
+
+ if (instance->chan == 6) { /* start 6chan, kill 8,12chan commands, possibly testing VP in 6chan mode */
+ oncore_sendmsg(instance, oncore_cmd_Ea0, sizeof(oncore_cmd_Ea0));
+ oncore_sendmsg(instance, oncore_cmd_En0, sizeof(oncore_cmd_En0));
+ oncore_sendmsg(instance, oncore_cmd_Ha0, sizeof(oncore_cmd_Ha0));
+ oncore_sendmsg(instance, oncore_cmd_Hn0, sizeof(oncore_cmd_Hn0));
+ oncore_sendmsg(instance, oncore_cmd_Ba, sizeof(oncore_cmd_Ba ));
+ } else if (instance->chan == 8) { /* start 8chan, kill 6,12chan commands */
+ oncore_sendmsg(instance, oncore_cmd_Ba0, sizeof(oncore_cmd_Ba0));
+ oncore_sendmsg(instance, oncore_cmd_Bn0, sizeof(oncore_cmd_Bn0));
+ oncore_sendmsg(instance, oncore_cmd_Ha0, sizeof(oncore_cmd_Ha0));
+ oncore_sendmsg(instance, oncore_cmd_Hn0, sizeof(oncore_cmd_Hn0));
+ oncore_sendmsg(instance, oncore_cmd_Ea, sizeof(oncore_cmd_Ea ));
+ } else if (instance->chan == 12){ /* start 12chan, kill 6,12chan commands */
+ oncore_sendmsg(instance, oncore_cmd_Ba0, sizeof(oncore_cmd_Ba0));
+ oncore_sendmsg(instance, oncore_cmd_Bn0, sizeof(oncore_cmd_Bn0));
+ oncore_sendmsg(instance, oncore_cmd_Ea0, sizeof(oncore_cmd_Ea0));
+ oncore_sendmsg(instance, oncore_cmd_En0, sizeof(oncore_cmd_En0));
+ oncore_sendmsg(instance, oncore_cmd_Ha, sizeof(oncore_cmd_Ha ));
+ oncore_cmd_Gc[2] = (instance->pps_control < 0) ? 1 : instance->pps_control;
+ oncore_sendmsg(instance, oncore_cmd_Gc, sizeof(oncore_cmd_Gc)); /* PPS off/continuous/Tracking 1+sat/TRAIM */
+ }
+
+ instance->count = 1;
+ instance->o_state = ONCORE_ALMANAC;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_ALMANAC");
+}
+
+
+
+/* 12chan position */
+
+static void
+oncore_msg_Ga(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ long lat, lon, ht;
+ double Lat, Lon, Ht;
+
+
+ lat = buf_w32(&buf[4]);
+ lon = buf_w32(&buf[8]);
+ ht = buf_w32(&buf[12]); /* GPS ellipsoid */
+
+ Lat = lat;
+ Lon = lon;
+ Ht = ht;
+
+ Lat /= 3600000;
+ Lon /= 3600000;
+ Ht /= 100;
+
+ oncore_log_f(instance, LOG_NOTICE,
+ "Ga Posn Lat = %.7f, Lon = %.7f, Ht = %.2f", Lat,
+ Lon, Ht);
+
+ instance->ss_lat = lat;
+ instance->ss_long = lon;
+ instance->ss_ht = ht;
+
+ oncore_print_posn(instance);
+}
+
+
+
+/* 12 chan time/date */
+
+static void
+oncore_msg_Gb(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ char * gmts;
+ int mo, d, y, h, m, s, gmth, gmtm;
+
+ mo = buf[4];
+ d = buf[5];
+ y = 256*buf[6]+buf[7];
+
+ h = buf[8];
+ m = buf[9];
+ s = buf[10];
+
+ gmts = ((buf[11] == 0) ? "+" : "-");
+ gmth = buf[12];
+ gmtm = buf[13];
+
+ oncore_log_f(instance, LOG_NOTICE,
+ "Date/Time set to: %d%s%d %2d:%02d:%02d GMT (GMT offset is %s%02d:%02d)",
+ d, months[mo-1], y, h, m, s, gmts, gmth, gmtm);
+}
+
+
+
+/* Response to PPS Control message (M12 and M12+T only ) */
+
+static void
+oncore_msg_Gc(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ char *tbl[] = {"OFF", "ON", "SATELLITE", "TRAIM" };
+
+ instance->pps_control_msg_seen = 1;
+ oncore_log_f(instance, LOG_INFO, "PPS Control set to %s",
+ tbl[buf[4]]);
+}
+
+
+
+/* Leap Second for M12, gives all info from satellite message */
+/* also in UT v3.0 */
+
+static void
+oncore_msg_Gj(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ static const char * insrem[2] = {
+ "removed",
+ "inserted"
+ };
+
+ int dt;
+ char *cp;
+
+ instance->saw_Gj = 1; /* flag, saw_Gj, dont need to try Bj in check_leap */
+
+ /* print the message to verify whats there */
+
+ dt = buf[5] - buf[4];
+
+ oncore_log_f(instance, LOG_INFO,
+ "Leap Sec Msg: %d %d %d %d %d %d %d %d %d %d",
+ buf[4], buf[5], 256 * buf[6] + buf[7], buf[8],
+ buf[9], buf[10],
+ (buf[14] + 256 *
+ (buf[13] + 256 * (buf[12] + 256 * buf[11]))),
+ buf[15], buf[16], buf[17]);
+
+ /* There seems to be eternal confusion about when a leap second
+ * takes place. It's the second *before* the new TAI offset
+ * becomes effective. But since the ONCORE receiver tells us
+ * just that, we would have to do some time/date calculations to
+ * get the actual leap second -- that is, the one that is
+ * deleted or inserted.
+ *
+ * Going through all this for a simple log is probably overkill,
+ * so for fixing bug#1050 the message output is changed to
+ * reflect the fact that it tells the second after the leap
+ * second.
+ */
+ if (dt)
+ oncore_log_f(instance, LOG_NOTICE,
+ "Leap second %s (%d) before %04u-%02u-%02u/%02u:%02u:%02u",
+ insrem[(dt > 0)], dt,
+ 256u * buf[6] + buf[7], buf[8], buf[9],
+ buf[15], buf[16], buf[17]);
+
+ /* Only raise warning within a month of the leap second */
+
+ instance->pp->leap = LEAP_NOWARNING;
+ cp = "Set pp.leap to LEAP_NOWARNING";
+
+ if (buf[6] == instance->BEHa[6] && buf[7] == instance->BEHa[7] && /* year */
+ buf[8] == instance->BEHa[4]) { /* month */
+ if (dt) {
+ if (dt < 0) {
+ instance->pp->leap = LEAP_DELSECOND;
+ cp = "Set pp.leap to LEAP_DELSECOND";
+ } else {
+ instance->pp->leap = LEAP_ADDSECOND;
+ cp = "Set pp.leap to LEAP_ADDSECOND";
+ }
+ }
+ }
+ oncore_log(instance, LOG_INFO, cp);
+}
+
+
+
+/* Power on failure */
+
+static void
+oncore_msg_Sz(
+ struct instance *instance,
+ u_char *buf,
+ size_t len
+ )
+{
+ if (instance && instance->peer) {
+ oncore_log(instance, LOG_ERR, "Oncore: System Failure at Power On");
+ oncore_shutdown(instance->unit, instance->peer);
+ }
+}
+
+/************** Small Subroutines ***************/
+
+
+static void
+oncore_antenna_report(
+ struct instance *instance,
+ enum antenna_state new_state)
+{
+ char *cp;
+
+ if (instance->ant_state == new_state)
+ return;
+
+ switch (new_state) {
+ case ONCORE_ANTENNA_OK: cp = "GPS antenna: OK"; break;
+ case ONCORE_ANTENNA_OC: cp = "GPS antenna: short (overcurrent)"; break;
+ case ONCORE_ANTENNA_UC: cp = "GPS antenna: open (not connected)"; break;
+ case ONCORE_ANTENNA_NV: cp = "GPS antenna: short (no voltage)"; break;
+ default: cp = "GPS antenna: ?"; break;
+ }
+
+ instance->ant_state = new_state;
+ oncore_log(instance, LOG_NOTICE, cp);
+}
+
+
+
+static void
+oncore_chan_test(
+ struct instance *instance
+ )
+{
+ /* subroutine oncore_Cj_id has determined the number of channels from the
+ * model number of the attached oncore. This is not always correct since
+ * the oncore could have non-standard firmware. Here we check (independently) by
+ * trying a 6, 8, and 12 chan command, and see which responds.
+ * Caution: more than one CAN respond.
+ *
+ * This #chan is used by the code rather than that calculated from the model number.
+ */
+
+ instance->o_state = ONCORE_CHECK_CHAN;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_CHECK_CHAN");
+
+ instance->count3 = 1;
+ oncore_sendmsg(instance, oncore_cmd_Ba, sizeof(oncore_cmd_Ba));
+ oncore_sendmsg(instance, oncore_cmd_Ea, sizeof(oncore_cmd_Ea));
+ oncore_sendmsg(instance, oncore_cmd_Ha, sizeof(oncore_cmd_Ha));
+}
+
+
+
+/* check for a GOOD Almanac, have we got one yet? */
+
+static void
+oncore_check_almanac(
+ struct instance *instance
+ )
+{
+ if (instance->chan == 6) {
+ instance->rsm.bad_almanac = instance->BEHa[64]&0x1;
+ instance->rsm.bad_fix = instance->BEHa[64]&0x52;
+ } else if (instance->chan == 8) {
+ instance->rsm.bad_almanac = instance->BEHa[72]&0x1;
+ instance->rsm.bad_fix = instance->BEHa[72]&0x52;
+ } else if (instance->chan == 12) {
+ int bits1, bits2, bits3;
+
+ bits1 = (instance->BEHa[129]>>5) & 0x7; /* actually Ha */
+ bits2 = instance->BEHa[130];
+ instance->rsm.bad_almanac = (bits2 & 0x80);
+ instance->rsm.bad_fix = (bits2 & 0x8) || (bits1 == 0x2);
+ /* too few sat Bad Geom */
+
+ bits3 = instance->BEHa[141]; /* UTC parameters */
+ if (!instance->count5_set && (bits3 & 0xC0)) {
+ instance->count5 = 4; /* was 2 [Bug 1766] */
+ instance->count5_set = 1;
+ }
+#ifdef ONCORE_VERBOSE_CHECK_ALMANAC
+ oncore_log_f(instance, LOG_DEBUG,
+ "DEBUG BITS: (%x %x), (%x %x %x), %x %x %x %x %x",
+ instance->BEHa[129], instance->BEHa[130],
+ bits1, bits2, bits3,
+ instance->mode == MODE_0D,
+ instance->mode == MODE_2D,
+ instance->mode == MODE_3D,
+ instance->rsm.bad_almanac,
+ instance->rsm.bad_fix);
+ }
+#endif
+ }
+}
+
+
+
+/* check the antenna for changes (did it get unplugged?) */
+
+static void
+oncore_check_antenna(
+ struct instance *instance
+ )
+{
+ enum antenna_state antenna; /* antenna state */
+
+ antenna = instance->ant_state;
+ if (instance->chan == 12)
+ antenna = (instance->BEHa[130] & 0x6 ) >> 1;
+ else
+ antenna = (instance->BEHa[37] & 0xc0) >> 6; /* prob unset 6, set GT, UT unset VP */
+
+ oncore_antenna_report (instance, antenna);
+}
+
+
+
+/*
+ * Check the leap second status once per day.
+ *
+ * Note that the ONCORE firmware for the Bj command is wrong at
+ * least in the VP.
+ * It starts advertising a LEAP SECOND as soon as the GPS satellite
+ * data message (page 18, subframe 4) is updated to a date in the
+ * future, and does not wait for the month that it will occur.
+ * The event will usually be advertised several months in advance.
+ * Since there is a one bit flag, there is no way to tell if it is
+ * this month, or when...
+ *
+ * As such, we have the workaround below, of only checking for leap
+ * seconds with the Bj command in June/December.
+ *
+ * The Gj command gives more information, and we can tell in which
+ * month to apply the correction.
+ *
+ * Note that with the VP we COULD read the raw data message, and
+ * interpret it ourselves, but since this is specific to this receiver
+ * only, and the above workaround is adequate, we don't bother.
+ */
+
+static void
+oncore_check_leap_sec(
+ struct instance *instance
+ )
+{
+ oncore_cmd_Bl[2] = 1; /* just to be sure */
+ if (instance->Bj_day != instance->BEHa[5]) { /* do this 1/day */
+ instance->Bj_day = instance->BEHa[5];
+
+ if (instance->saw_Gj < 0) { /* -1 DONT have Gj use Bj */
+ if ((instance->BEHa[4] == 6) || (instance->BEHa[4] == 12))
+ oncore_sendmsg(instance, oncore_cmd_Bj, sizeof(oncore_cmd_Bj));
+ oncore_sendmsg(instance, oncore_cmd_Bl, sizeof(oncore_cmd_Bl));
+ return;
+ }
+
+ if (instance->saw_Gj == 0) /* 0 is dont know if we have Gj */
+ instance->count4 = 1;
+
+ oncore_sendmsg(instance, oncore_cmd_Gj, sizeof(oncore_cmd_Gj));
+ return;
+ }
+
+ /* Gj works for some 6/8 chan UT and the M12 */
+ /* if no response from Gj in 5 sec, we try Bj */
+ /* which isnt implemented in all the GT/UT either */
+
+ if (instance->count4) { /* delay, waiting for Gj response */
+ if (instance->saw_Gj == 1)
+ instance->count4 = 0;
+ else if (instance->count4++ > 5) { /* delay, waiting for Gj response */
+ instance->saw_Gj = -1; /* didnt see it, will use Bj */
+ instance->count4 = 0;
+ if ((instance->BEHa[4] == 6) || (instance->BEHa[4] == 12)) {
+ oncore_sendmsg(instance, oncore_cmd_Bj, sizeof(oncore_cmd_Bj));
+ oncore_sendmsg(instance, oncore_cmd_Bl, sizeof(oncore_cmd_Bl));
+ }
+ }
+ }
+}
+
+
+
+/* check the message checksum,
+ * buf points to START of message ( @@ )
+ * len is length WITH CR/LF.
+ */
+
+static int
+oncore_checksum_ok(
+ u_char *buf,
+ int len
+ )
+{
+ int i, j;
+
+ j = 0;
+ for (i = 2; i < len-3; i++)
+ j ^= buf[i];
+
+ return(j == buf[len-3]);
+}
+
+
+
+static void
+oncore_compute_dH(
+ struct instance *instance
+ )
+{
+ int GPS, MSL;
+
+ /* Here calculate dH = GPS - MSL for output message */
+ /* also set Altitude Hold mode if GT */
+
+ instance->have_dH = 1;
+ if (instance->chan == 12) {
+ GPS = buf_w32(&instance->BEHa[39]);
+ MSL = buf_w32(&instance->BEHa[43]);
+ } else {
+ GPS = buf_w32(&instance->BEHa[23]);
+ MSL = buf_w32(&instance->BEHa[27]);
+ }
+ instance->dH = GPS - MSL;
+ instance->dH /= 100.;
+
+ /* if MSL is not set, the calculation is meaningless */
+
+ if (MSL) /* not set ! */
+ oncore_log_f(instance, LOG_INFO,
+ "dH = (GPS - MSL) = %.2fm", instance->dH);
+}
+
+
+
+/*
+ * try loading Almanac from shmem (where it was copied from shmem_old
+ */
+
+static void
+oncore_load_almanac(
+ struct instance *instance
+ )
+{
+ u_char *cp, Cmd[20];
+ int n;
+ struct timeval tv;
+ struct tm *tm;
+
+ if (!instance->shmem)
+ return;
+
+#ifndef ONCORE_VERBOSE_LOAD_ALMANAC
+ for (cp = instance->shmem + 4; (n = 256 * (*(cp-3)) + *(cp-2));
+ cp += (n + 3)) {
+ if (!strncmp((char *) cp, "@@Cb", 4) &&
+ oncore_checksum_ok(cp, 33) &&
+ (*(cp+4) == 4 || *(cp+4) == 5)) {
+ write(instance->ttyfd, cp, n);
+ oncore_print_Cb(instance, cp);
+ }
+ }
+#else /* ONCORE_VERBOSE_LOAD_ALMANAC follows */
+ for (cp = instance->shmem + 4; (n = 256 * (*(cp-3)) + *(cp-2));
+ cp += (n+3)) {
+ oncore_log_f(instance, LOG_DEBUG, "See %c%c%c%c %d",
+ *(cp), *(cp+1), *(cp+2), *(cp+3), *(cp+4));
+
+ if (!strncmp(cp, "@@Cb", 4)) {
+ oncore_print_Cb(instance, cp);
+ if (oncore_checksum_ok(cp, 33)) {
+ if (*(cp+4) == 4 || *(cp+4) == 5) {
+ oncore_log(instance, LOG_DEBUG, "GOOD SF");
+ write(instance->ttyfd, cp, n);
+ } else
+ oncore_log(instance, LOG_DEBUG, "BAD SF");
+ } else
+ oncore_log(instance, LOG_DEBUG, "BAD CHECKSUM");
+ }
+ }
+#endif
+
+ /* Must load position and time or the Almanac doesn't do us any good */
+
+ if (!instance->posn_set) { /* if we input a posn use it, else from SHMEM */
+ oncore_log(instance, LOG_NOTICE, "Loading Posn from SHMEM");
+ for (cp=instance->shmem+4; (n = 256*(*(cp-3)) + *(cp-2)); cp+=(n+3)) {
+ if ((instance->chan == 6 && (!strncmp((char *) cp, "@@Ba", 4) && oncore_checksum_ok(cp, 68))) ||
+ (instance->chan == 8 && (!strncmp((char *) cp, "@@Ea", 4) && oncore_checksum_ok(cp, 76))) ||
+ (instance->chan == 12 && (!strncmp((char *) cp, "@@Ha", 4) && oncore_checksum_ok(cp, 154)))) {
+ int ii, jj, kk;
+
+ instance->posn_set = 1;
+ ii = buf_w32(cp + 15);
+ jj = buf_w32(cp + 19);
+ kk = buf_w32(cp + 23);
+#ifdef ONCORE_VERBOSE_LOAD_ALMANAC
+ oncore_log_f(instance, LOG_DEBUG,
+ "SHMEM posn = %ld (%d, %d, %d)",
+ (long)(cp-instance->shmem),
+ ii, jj, kk);
+#endif
+ if (ii != 0 || jj != 0 || kk != 0) { /* phk asked for this test */
+ instance->ss_lat = ii;
+ instance->ss_long = jj;
+ instance->ss_ht = kk;
+ }
+ }
+ }
+ }
+ oncore_set_posn(instance);
+
+ /* and set time to time from Computer clock */
+
+ GETTIMEOFDAY(&tv, 0);
+ tm = gmtime((const time_t *) &tv.tv_sec);
+
+#ifdef ONCORE_VERBOSE_LOAD_ALMANAC
+ oncore_log_f(instance, LOG_DEBUG, "DATE %d %d %d, %d %d %d",
+ 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+#endif
+ if (instance->chan == 12) {
+ memcpy(Cmd, oncore_cmd_Gb, (size_t) sizeof(oncore_cmd_Gb));
+ Cmd[-2+4] = tm->tm_mon + 1;
+ Cmd[-2+5] = tm->tm_mday;
+ Cmd[-2+6] = (1900+tm->tm_year)/256;
+ Cmd[-2+7] = (1900+tm->tm_year)%256;
+ Cmd[-2+8] = tm->tm_hour;
+ Cmd[-2+9] = tm->tm_min;
+ Cmd[-2+10] = tm->tm_sec;
+ Cmd[-2+11] = 0;
+ Cmd[-2+12] = 0;
+ Cmd[-2+13] = 0;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Gb));
+ } else {
+ /* First set GMT offset to zero */
+
+ oncore_sendmsg(instance, oncore_cmd_Ab, sizeof(oncore_cmd_Ab));
+
+ memcpy(Cmd, oncore_cmd_Ac, (size_t) sizeof(oncore_cmd_Ac));
+ Cmd[-2+4] = tm->tm_mon + 1;
+ Cmd[-2+5] = tm->tm_mday;
+ Cmd[-2+6] = (1900+tm->tm_year)/256;
+ Cmd[-2+7] = (1900+tm->tm_year)%256;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Ac));
+
+ memcpy(Cmd, oncore_cmd_Aa, (size_t) sizeof(oncore_cmd_Aa));
+ Cmd[-2+4] = tm->tm_hour;
+ Cmd[-2+5] = tm->tm_min;
+ Cmd[-2+6] = tm->tm_sec;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Aa));
+ }
+
+ oncore_log(instance, LOG_INFO, "Setting Posn and Time after Loading Almanac");
+}
+
+
+
+/* Almanac data input */
+
+static void
+oncore_print_Cb(
+ struct instance *instance,
+ u_char *cp
+ )
+{
+#ifdef ONCORE_VERBOSE_CB
+ int ii;
+ char Msg[160], Msg2[10];
+
+ oncore_log_f(instance, LOG_DEBUG, "DEBUG: See: %c%c%c%c", *(cp),
+ *(cp+1), *(cp+2), *(cp+3));
+
+ snprintf(Msg, sizeof(Msg), "DEBUG: Cb: [%d,%d]", *(cp+4),
+ *(cp+5));
+ for (ii = 0; ii < 33; ii++) {
+ snprintf(Msg2, sizeof(Msg2), " %d", *(cp+ii));
+ strlcat(Msg, Msg2, sizeof(Msg));
+ }
+ oncore_log(instance, LOG_DEBUG, Msg);
+
+ oncore_log_f(instance, LOG_DEBUG, "Debug: Cb: [%d,%d]", *(cp+4),
+ *(cp+5));
+#endif
+}
+
+
+#if 0
+static void
+oncore_print_array(
+ u_char *cp,
+ int n
+ )
+{
+ int jj, i, j, nn;
+
+ nn = 0;
+ printf("\nTOP\n");
+ jj = n/16;
+ for (j=0; j<jj; j++) {
+ printf("%4d: ", nn);
+ nn += 16;
+ for (i=0; i<16; i++)
+ printf(" %o", *cp++);
+ printf("\n");
+ }
+}
+#endif
+
+
+static void
+oncore_print_posn(
+ struct instance *instance
+ )
+{
+ char ew, ns;
+ double xd, xm, xs, yd, ym, ys, hm, hft;
+ int idx, idy, is, imx, imy;
+ long lat, lon;
+
+ oncore_log(instance, LOG_INFO, "Posn:");
+ ew = 'E';
+ lon = instance->ss_long;
+ if (lon < 0) {
+ ew = 'W';
+ lon = -lon;
+ }
+
+ ns = 'N';
+ lat = instance->ss_lat;
+ if (lat < 0) {
+ ns = 'S';
+ lat = -lat;
+ }
+
+ hm = instance->ss_ht/100.;
+ hft= hm/0.3048;
+
+ xd = lat/3600000.; /* lat, lon in int msec arc, ht in cm. */
+ yd = lon/3600000.;
+ oncore_log_f(instance, LOG_INFO,
+ "Lat = %c %11.7fdeg, Long = %c %11.7fdeg, Alt = %5.2fm (%5.2fft) GPS",
+ ns, xd, ew, yd, hm, hft);
+
+ idx = xd;
+ idy = yd;
+ imx = lat%3600000;
+ imy = lon%3600000;
+ xm = imx/60000.;
+ ym = imy/60000.;
+ oncore_log_f(instance, LOG_INFO,
+ "Lat = %c %3ddeg %7.4fm, Long = %c %3ddeg %8.5fm, Alt = %7.2fm (%7.2fft) GPS",
+ ns, idx, xm, ew, idy, ym, hm, hft);
+
+ imx = xm;
+ imy = ym;
+ is = lat%60000;
+ xs = is/1000.;
+ is = lon%60000;
+ ys = is/1000.;
+ oncore_log_f(instance, LOG_INFO,
+ "Lat = %c %3ddeg %2dm %5.2fs, Long = %c %3ddeg %2dm %5.2fs, Alt = %7.2fm (%7.2fft) GPS",
+ ns, idx, imx, xs, ew, idy, imy, ys, hm, hft);
+}
+
+
+
+/*
+ * write message to Oncore.
+ */
+
+static void
+oncore_sendmsg(
+ struct instance *instance,
+ u_char *ptr,
+ size_t len
+ )
+{
+ int fd;
+ u_char cs = 0;
+
+ fd = instance->ttyfd;
+#ifdef ONCORE_VERBOSE_SENDMSG
+ if (debug > 4) {
+ oncore_log_f(instance, LOG_DEBUG, "ONCORE: Send @@%c%c %d",
+ ptr[0], ptr[1], (int)len);
+ }
+#endif
+ write(fd, "@@", (size_t) 2);
+ write(fd, ptr, len);
+ while (len--)
+ cs ^= *ptr++;
+ write(fd, &cs, (size_t) 1);
+ write(fd, "\r\n", (size_t) 2);
+}
+
+
+
+static void
+oncore_set_posn(
+ struct instance *instance
+ )
+{
+ int mode;
+ u_char Cmd[20];
+
+ /* Turn OFF position hold, it needs to be off to set position (for some units),
+ will get set ON in @@Ea later */
+
+ if (instance->chan == 12)
+ oncore_sendmsg(instance, oncore_cmd_Gd0, sizeof(oncore_cmd_Gd0)); /* (12) */
+ else {
+ oncore_sendmsg(instance, oncore_cmd_At0, sizeof(oncore_cmd_At0)); /* (6/8) */
+ oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0)); /* (6/8) */
+ }
+
+ mode = instance->init_type;
+
+ if (mode != 0) { /* first set posn hold position */
+ memcpy(Cmd, oncore_cmd_As, (size_t) sizeof(oncore_cmd_As)); /* don't modify static variables */
+ w32_buf(&Cmd[-2+4], (int) instance->ss_lat);
+ w32_buf(&Cmd[-2+8], (int) instance->ss_long);
+ w32_buf(&Cmd[-2+12], (int) instance->ss_ht);
+ Cmd[-2+16] = 0;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_As)); /* posn hold 3D posn (6/8/12) */
+
+ memcpy(Cmd, oncore_cmd_Au, (size_t) sizeof(oncore_cmd_Au));
+ w32_buf(&Cmd[-2+4], (int) instance->ss_ht);
+ Cmd[-2+8] = 0;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Au)); /* altitude hold (6/8/12 not UT, M12T) */
+
+ /* next set current position */
+
+ if (instance->chan == 12) {
+ memcpy(Cmd, oncore_cmd_Ga, (size_t) sizeof(oncore_cmd_Ga));
+ w32_buf(&Cmd[-2+4], (int) instance->ss_lat);
+ w32_buf(&Cmd[-2+8], (int) instance->ss_long);
+ w32_buf(&Cmd[-2+12],(int) instance->ss_ht);
+ Cmd[-2+16] = 0;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Ga)); /* 3d posn (12) */
+ } else {
+ memcpy(Cmd, oncore_cmd_Ad, (size_t) sizeof(oncore_cmd_Ad));
+ w32_buf(&Cmd[-2+4], (int) instance->ss_lat);
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Ad)); /* lat (6/8) */
+
+ memcpy(Cmd, oncore_cmd_Ae, (size_t) sizeof(oncore_cmd_Ae));
+ w32_buf(&Cmd[-2+4], (int) instance->ss_long);
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Ae)); /* long (6/8) */
+
+ memcpy(Cmd, oncore_cmd_Af, (size_t) sizeof(oncore_cmd_Af));
+ w32_buf(&Cmd[-2+4], (int) instance->ss_ht);
+ Cmd[-2+8] = 0;
+ oncore_sendmsg(instance, Cmd, sizeof(oncore_cmd_Af)); /* ht (6/8) */
+ }
+
+ /* Finally, turn on position hold */
+
+ if (instance->chan == 12)
+ oncore_sendmsg(instance, oncore_cmd_Gd1, sizeof(oncore_cmd_Gd1));
+ else
+ oncore_sendmsg(instance, oncore_cmd_At1, sizeof(oncore_cmd_At1));
+ }
+}
+
+
+
+static void
+oncore_set_traim(
+ struct instance *instance
+ )
+{
+ if (instance->traim_in != -1) /* set in Input */
+ instance->traim = instance->traim_in;
+ else
+ instance->traim = instance->traim_ck;
+
+ oncore_log_f(instance, LOG_INFO, "Input says TRAIM = %d",
+ instance->traim_in);
+ oncore_log_f(instance, LOG_INFO, "Model # says TRAIM = %d",
+ instance->traim_id);
+ oncore_log_f(instance, LOG_INFO, "Testing says TRAIM = %d",
+ instance->traim_ck);
+ oncore_log_f(instance, LOG_INFO, "Using TRAIM = %d",
+ instance->traim);
+
+ if (instance->traim_ck == 1 && instance->traim == 0) {
+ /* if it should be off, and I turned it on during testing,
+ then turn it off again */
+ if (instance->chan == 6)
+ oncore_sendmsg(instance, oncore_cmd_Bnx, sizeof(oncore_cmd_Bnx));
+ else if (instance->chan == 8)
+ oncore_sendmsg(instance, oncore_cmd_Enx, sizeof(oncore_cmd_Enx));
+ else /* chan == 12 */
+ oncore_sendmsg(instance, oncore_cmd_Ge0, sizeof(oncore_cmd_Ge0));
+ oncore_sendmsg(instance, oncore_cmd_Hn0, sizeof(oncore_cmd_Hn0));
+ }
+}
+
+
+
+/*
+ * if SHMEM active, every 15s, steal one 'tick' to get 2D or 3D posn.
+ */
+
+static void
+oncore_shmem_get_3D(
+ struct instance *instance
+ )
+{
+ if (instance->pp->second%15 == 3) { /* start the sequence */ /* by changing mode */
+ instance->shmem_reset = 1;
+ if (instance->chan == 12) {
+ if (instance->shmem_Posn == 2)
+ oncore_sendmsg(instance, oncore_cmd_Gd2, sizeof(oncore_cmd_Gd2)); /* 2D */
+ else
+ oncore_sendmsg(instance, oncore_cmd_Gd0, sizeof(oncore_cmd_Gd0)); /* 3D */
+ } else {
+ if (instance->saw_At) { /* out of 0D -> 3D mode */
+ oncore_sendmsg(instance, oncore_cmd_At0, sizeof(oncore_cmd_At0));
+ if (instance->shmem_Posn == 2) /* 3D -> 2D mode */
+ oncore_sendmsg(instance, oncore_cmd_Av1, sizeof(oncore_cmd_Av1));
+ } else
+ oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0));
+ }
+ } else if (instance->shmem_reset || (instance->mode != MODE_0D)) {
+ instance->shmem_reset = 0;
+ if (instance->chan == 12)
+ oncore_sendmsg(instance, oncore_cmd_Gd1, sizeof(oncore_cmd_Gd1)); /* 0D */
+ else {
+ if (instance->saw_At) {
+ if (instance->mode == MODE_2D) /* 2D -> 3D or 0D mode */
+ oncore_sendmsg(instance, oncore_cmd_Av0, sizeof(oncore_cmd_Av0));
+ oncore_sendmsg(instance, oncore_cmd_At1, sizeof(oncore_cmd_At1)); /* to 0D mode */
+ } else
+ oncore_sendmsg(instance, oncore_cmd_Av1, sizeof(oncore_cmd_Av1));
+ }
+ }
+}
+
+
+
+/*
+ * Here we do the Software SiteSurvey.
+ * We have to average our own position for the Position Hold Mode
+ * We use Heights from the GPS ellipsoid.
+ * We check for the END of either HW or SW SiteSurvey.
+ */
+
+static void
+oncore_ss(
+ struct instance *instance
+ )
+{
+ double lat, lon, ht;
+
+
+ if (instance->site_survey == ONCORE_SS_HW) {
+ /*
+ * Check to see if Hardware SiteSurvey has Finished.
+ */
+
+ if ((instance->chan == 8 && !(instance->BEHa[37] & 0x20)) ||
+ (instance->chan == 12 && !(instance->BEHa[130] & 0x10))) {
+ oncore_log(instance, LOG_INFO, "Now in 0D mode");
+
+ if (instance->chan == 12)
+ oncore_sendmsg(instance, oncore_cmd_Gax, sizeof(oncore_cmd_Gax));
+ else
+ oncore_sendmsg(instance, oncore_cmd_Asx, sizeof(oncore_cmd_Asx));
+
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_DONE");
+ instance->site_survey = ONCORE_SS_DONE;
+ }
+ } else {
+ /*
+ * Must be a Software Site Survey.
+ */
+
+ if (instance->rsm.bad_fix) /* Not if poor geometry or less than 3 sats */
+ return;
+
+ if (instance->mode != MODE_3D) /* Use only 3D Fixes */
+ return;
+
+ instance->ss_lat += buf_w32(&instance->BEHa[15]);
+ instance->ss_long += buf_w32(&instance->BEHa[19]);
+ instance->ss_ht += buf_w32(&instance->BEHa[23]); /* GPS ellipsoid */
+ instance->ss_count++;
+
+ if (instance->ss_count != POS_HOLD_AVERAGE)
+ return;
+
+ instance->ss_lat /= POS_HOLD_AVERAGE;
+ instance->ss_long /= POS_HOLD_AVERAGE;
+ instance->ss_ht /= POS_HOLD_AVERAGE;
+
+ oncore_log_f(instance, LOG_NOTICE,
+ "Surveyed posn: lat %.3f (mas) long %.3f (mas) ht %.3f (cm)",
+ instance->ss_lat, instance->ss_long,
+ instance->ss_ht);
+ lat = instance->ss_lat/3600000.;
+ lon = instance->ss_long/3600000.;
+ ht = instance->ss_ht/100;
+ oncore_log_f(instance, LOG_NOTICE,
+ "Surveyed posn: lat %.7f (deg) long %.7f (deg) ht %.2f (m)",
+ lat, lon, ht);
+
+ oncore_set_posn(instance);
+
+ oncore_log(instance, LOG_INFO, "Now in 0D mode");
+
+ oncore_log(instance, LOG_NOTICE, "SSstate = ONCORE_SS_DONE");
+ instance->site_survey = ONCORE_SS_DONE;
+ }
+}
+
+
+
+static int
+oncore_wait_almanac(
+ struct instance *instance
+ )
+{
+ if (instance->rsm.bad_almanac) {
+ instance->counta++;
+ if (instance->counta%5 == 0)
+ oncore_log(instance, LOG_INFO, "Waiting for Almanac");
+
+ /*
+ * If we get here (first time) then we don't have an almanac in memory.
+ * Check if we have a SHMEM, and if so try to load whatever is there.
+ */
+
+ if (!instance->almanac_from_shmem) {
+ instance->almanac_from_shmem = 1;
+ oncore_load_almanac(instance);
+ }
+ return(1);
+ } else { /* Here we have the Almanac, we will be starting the @@Bn/@@En/@@Hn
+ commands, and can finally check for TRAIM. Again, we set a delay
+ (5sec) and wait for things to settle down */
+
+ if (instance->chan == 6)
+ oncore_sendmsg(instance, oncore_cmd_Bn, sizeof(oncore_cmd_Bn));
+ else if (instance->chan == 8)
+ oncore_sendmsg(instance, oncore_cmd_En, sizeof(oncore_cmd_En));
+ else if (instance->chan == 12) {
+ oncore_sendmsg(instance, oncore_cmd_Gc, sizeof(oncore_cmd_Gc)); /* 1PPS on, continuous */
+ oncore_sendmsg(instance, oncore_cmd_Ge, sizeof(oncore_cmd_Ge)); /* TRAIM on */
+ oncore_sendmsg(instance, oncore_cmd_Hn, sizeof(oncore_cmd_Hn)); /* TRAIM status 1/s */
+ }
+ instance->traim_delay = 1;
+
+ oncore_log(instance, LOG_NOTICE, "Have now loaded an ALMANAC");
+
+ instance->o_state = ONCORE_RUN;
+ oncore_log(instance, LOG_NOTICE, "state = ONCORE_RUN");
+ }
+ return(0);
+}
+
+
+
+static void
+oncore_log (
+ struct instance *instance,
+ int log_level,
+ const char *msg
+ )
+{
+ msyslog(log_level, "ONCORE[%d]: %s", instance->unit, msg);
+ mprintf_clock_stats(&instance->peer->srcadr, "ONCORE[%d]: %s",
+ instance->unit, msg);
+}
+
+
+static int
+oncore_log_f(
+ struct instance * instance,
+ int log_level,
+ const char * fmt,
+ ...
+ )
+{
+ va_list ap;
+ int rc;
+ char msg[512];
+
+ va_start(ap, fmt);
+ rc = mvsnprintf(msg, sizeof(msg), fmt, ap);
+ va_end(ap);
+ oncore_log(instance, log_level, msg);
+
+#ifdef ONCORE_VERBOSE_ONCORE_LOG
+ instance->max_len = max(strlen(msg), instance->max_len);
+ instance->max_count++;
+ if (instance->max_count % 100 == 0)
+ oncore_log_f(instance, LOG_INFO,
+ "Max Message Length so far is %d",
+ instance->max_len);
+#endif
+ return rc;
+}
+
+#else
+int refclock_oncore_bs;
+#endif /* REFCLOCK && CLOCK_ONCORE */
diff --git a/ntpd/refclock_palisade.c b/ntpd/refclock_palisade.c
new file mode 100644
index 0000000..2b396d8
--- /dev/null
+++ b/ntpd/refclock_palisade.c
@@ -0,0 +1,1253 @@
+/*
+ * This software was developed by the Software and Component Technologies
+ * group of Trimble Navigation, Ltd.
+ *
+ * Copyright (c) 1997, 1998, 1999, 2000 Trimble Navigation Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Trimble Navigation, Ltd.
+ * 4. The name of Trimble Navigation Ltd. may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TRIMBLE NAVIGATION LTD. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL TRIMBLE NAVIGATION LTD. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * refclock_palisade - clock driver for the Trimble Palisade GPS
+ * timing receiver
+ *
+ * For detailed information on this program, please refer to the html
+ * Refclock 29 page accompanying the NTP distribution.
+ *
+ * for questions / bugs / comments, contact:
+ * sven_dietrich@trimble.com
+ *
+ * Sven-Thorsten Dietrich
+ * 645 North Mary Avenue
+ * Post Office Box 3642
+ * Sunnyvale, CA 94088-3642
+ *
+ * Version 2.45; July 14, 1999
+ *
+ *
+ *
+ * 31/03/06: Added support for Thunderbolt GPS Disciplined Clock.
+ * Contact: Fernando Pablo Hauscarriaga
+ * E-mail: fernandoph@iar.unlp.edu.ar
+ * Home page: www.iar.unlp.edu.ar/~fernandoph
+ * Instituto Argentino de Radioastronomia
+ * www.iar.unlp.edu.ar
+ *
+ * 14/01/07: Conditinal compilation for Thunderbolt support no longer needed
+ * now we use mode 2 for decode thunderbolt packets.
+ * Fernando P. Hauscarriaga
+ *
+ * 30/08/09: Added support for Trimble Acutime Gold Receiver.
+ * Fernando P. Hauscarriaga (fernandoph@iar.unlp.edu.ar)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PALISADE)
+
+#ifdef SYS_WINNT
+extern int async_write(int, const void *, unsigned int);
+#undef write
+#define write(fd, data, octets) async_write(fd, data, octets)
+#endif
+
+#include "refclock_palisade.h"
+/* Table to get from month to day of the year */
+const int days_of_year [12] = {
+ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
+};
+
+#ifdef DEBUG
+const char * Tracking_Status[15][15] = {
+ { "Doing Fixes\0" }, { "Good 1SV\0" }, { "Approx. 1SV\0" },
+ {"Need Time\0" }, { "Need INIT\0" }, { "PDOP too High\0" },
+ { "Bad 1SV\0" }, { "0SV Usable\0" }, { "1SV Usable\0" },
+ { "2SV Usable\0" }, { "3SV Usable\0" }, { "No Integrity\0" },
+ { "Diff Corr\0" }, { "Overdet Clock\0" }, { "Invalid\0" } };
+#endif
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_palisade = {
+ palisade_start, /* start up driver */
+ palisade_shutdown, /* shut down driver */
+ palisade_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+int day_of_year (char *dt);
+
+/* Extract the clock type from the mode setting */
+#define CLK_TYPE(x) ((int)(((x)->ttl) & 0x7F))
+
+/* Supported clock types */
+#define CLK_TRIMBLE 0 /* Trimble Palisade */
+#define CLK_PRAECIS 1 /* Endrun Technologies Praecis */
+#define CLK_THUNDERBOLT 2 /* Trimble Thunderbolt GPS Receiver */
+#define CLK_ACUTIME 3 /* Trimble Acutime Gold */
+#define CLK_ACUTIMEB 4 /* Trimble Actutime Gold Port B */
+
+int praecis_msg;
+static void praecis_parse(struct recvbuf *rbufp, struct peer *peer);
+
+/* These routines are for sending packets to the Thunderbolt receiver
+ * They are taken from Markus Prosch
+ */
+
+#ifdef PALISADE_SENDCMD_RESURRECTED
+/*
+ * sendcmd - Build data packet for sending
+ */
+static void
+sendcmd (
+ struct packettx *buffer,
+ int c
+ )
+{
+ *buffer->data = DLE;
+ *(buffer->data + 1) = (unsigned char)c;
+ buffer->size = 2;
+}
+#endif /* PALISADE_SENDCMD_RESURRECTED */
+
+/*
+ * sendsupercmd - Build super data packet for sending
+ */
+static void
+sendsupercmd (
+ struct packettx *buffer,
+ int c1,
+ int c2
+ )
+{
+ *buffer->data = DLE;
+ *(buffer->data + 1) = (unsigned char)c1;
+ *(buffer->data + 2) = (unsigned char)c2;
+ buffer->size = 3;
+}
+
+/*
+ * sendbyte -
+ */
+static void
+sendbyte (
+ struct packettx *buffer,
+ int b
+ )
+{
+ if (b == DLE)
+ *(buffer->data+buffer->size++) = DLE;
+ *(buffer->data+buffer->size++) = (unsigned char)b;
+}
+
+/*
+ * sendint -
+ */
+static void
+sendint (
+ struct packettx *buffer,
+ int a
+ )
+{
+ sendbyte(buffer, (unsigned char)((a>>8) & 0xff));
+ sendbyte(buffer, (unsigned char)(a & 0xff));
+}
+
+/*
+ * sendetx - Send packet or super packet to the device
+ */
+static int
+sendetx (
+ struct packettx *buffer,
+ int fd
+ )
+{
+ int result;
+
+ *(buffer->data+buffer->size++) = DLE;
+ *(buffer->data+buffer->size++) = ETX;
+ result = write(fd, buffer->data, (unsigned long)buffer->size);
+
+ if (result != -1)
+ return (result);
+ else
+ return (-1);
+}
+
+/*
+ * init_thunderbolt - Prepares Thunderbolt receiver to be used with
+ * NTP (also taken from Markus Prosch).
+ */
+static void
+init_thunderbolt (
+ int fd
+ )
+{
+ struct packettx tx;
+
+ tx.size = 0;
+ tx.data = (u_char *) malloc(100);
+
+ /* set UTC time */
+ sendsupercmd (&tx, 0x8E, 0xA2);
+ sendbyte (&tx, 0x3);
+ sendetx (&tx, fd);
+
+ /* activate packets 0x8F-AB and 0x8F-AC */
+ sendsupercmd (&tx, 0x8F, 0xA5);
+ sendint (&tx, 0x5);
+ sendetx (&tx, fd);
+
+ free(tx.data);
+}
+
+/*
+ * init_acutime - Prepares Acutime Receiver to be used with NTP
+ */
+static void
+init_acutime (
+ int fd
+ )
+{
+ /* Disable all outputs, Enable Event-Polling on PortA so
+ we can ask for time packets */
+ struct packettx tx;
+
+ tx.size = 0;
+ tx.data = (u_char *) malloc(100);
+
+ sendsupercmd(&tx, 0x8E, 0xA5);
+ sendbyte(&tx, 0x02);
+ sendbyte(&tx, 0x00);
+ sendbyte(&tx, 0x00);
+ sendbyte(&tx, 0x00);
+ sendetx(&tx, fd);
+
+ free(tx.data);
+}
+
+/*
+ * palisade_start - open the devices and initialize data for processing
+ */
+static int
+palisade_start (
+ int unit,
+ struct peer *peer
+ )
+{
+ struct palisade_unit *up;
+ struct refclockproc *pp;
+ int fd;
+ char gpsdev[20];
+ struct termios tio;
+
+ snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
+
+ /*
+ * Open serial port.
+ */
+ fd = refclock_open(gpsdev, SPEED232, LDISC_RAW);
+ if (fd <= 0) {
+#ifdef DEBUG
+ printf("Palisade(%d) start: open %s failed\n", unit, gpsdev);
+#endif
+ return 0;
+ }
+
+ msyslog(LOG_NOTICE, "Palisade(%d) fd: %d dev: %s", unit, fd,
+ gpsdev);
+
+ if (tcgetattr(fd, &tio) < 0) {
+ msyslog(LOG_ERR,
+ "Palisade(%d) tcgetattr(fd, &tio): %m",unit);
+#ifdef DEBUG
+ printf("Palisade(%d) tcgetattr(fd, &tio)\n",unit);
+#endif
+ close(fd);
+ return (0);
+ }
+
+ tio.c_cflag |= (PARENB|PARODD);
+ tio.c_iflag &= ~ICRNL;
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+
+ up->type = CLK_TYPE(peer);
+ switch (up->type) {
+ case CLK_TRIMBLE:
+ /* Normal mode, do nothing */
+ break;
+ case CLK_PRAECIS:
+ msyslog(LOG_NOTICE, "Palisade(%d) Praecis mode enabled"
+ ,unit);
+ break;
+ case CLK_THUNDERBOLT:
+ msyslog(LOG_NOTICE, "Palisade(%d) Thunderbolt mode enabled"
+ ,unit);
+ tio.c_cflag = (CS8|CLOCAL|CREAD);
+ break;
+ case CLK_ACUTIME:
+ msyslog(LOG_NOTICE, "Palisade(%d) Acutime Gold mode enabled"
+ ,unit);
+ break;
+ default:
+ msyslog(LOG_NOTICE, "Palisade(%d) mode unknown",unit);
+ break;
+ }
+ if (tcsetattr(fd, TCSANOW, &tio) == -1) {
+ msyslog(LOG_ERR, "Palisade(%d) tcsetattr(fd, &tio): %m",unit);
+#ifdef DEBUG
+ printf("Palisade(%d) tcsetattr(fd, &tio)\n",unit);
+#endif
+ close(fd);
+ free(up);
+ return 0;
+ }
+
+ pp = peer->procptr;
+ pp->io.clock_recv = palisade_io;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+#ifdef DEBUG
+ printf("Palisade(%d) io_addclock\n",unit);
+#endif
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ pp->unitptr = up;
+ pp->clockdesc = DESCRIPTION;
+
+ peer->precision = PRECISION;
+ peer->sstclktype = CTL_SST_TS_UHF;
+ peer->minpoll = TRMB_MINPOLL;
+ peer->maxpoll = TRMB_MAXPOLL;
+ memcpy((char *)&pp->refid, REFID, 4);
+
+ up->leap_status = 0;
+ up->unit = (short) unit;
+ up->rpt_status = TSIP_PARSED_EMPTY;
+ up->rpt_cnt = 0;
+
+ if (up->type == CLK_THUNDERBOLT)
+ init_thunderbolt(fd);
+ if (up->type == CLK_ACUTIME)
+ init_acutime(fd);
+
+ return 1;
+}
+
+
+/*
+ * palisade_shutdown - shut down the clock
+ */
+static void
+palisade_shutdown (
+ int unit,
+ struct peer *peer
+ )
+{
+ struct palisade_unit *up;
+ struct refclockproc *pp;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+
+/*
+ * unpack_date - get day and year from date
+ */
+int
+day_of_year (
+ char * dt
+ )
+{
+ int day, mon, year;
+
+ mon = dt[1];
+ /* Check month is inside array bounds */
+ if ((mon < 1) || (mon > 12))
+ return -1;
+
+ day = dt[0] + days_of_year[mon - 1];
+ year = getint((u_char *) (dt + 2));
+
+ if ( !(year % 4) && ((year % 100) ||
+ (!(year % 100) && !(year%400)))
+ &&(mon > 2))
+ day ++; /* leap year and March or later */
+
+ return day;
+}
+
+
+/*
+ * TSIP_decode - decode the TSIP data packets
+ */
+int
+TSIP_decode (
+ struct peer *peer
+ )
+{
+ int st;
+ long secint;
+ double secs;
+ double secfrac;
+ unsigned short event = 0;
+
+ struct palisade_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Check the time packet, decode its contents.
+ * If the timecode has invalid length or is not in
+ * proper format, declare bad format and exit.
+ */
+
+ if ((up->type != CLK_THUNDERBOLT) & (up->type != CLK_ACUTIME)){
+ if ((up->rpt_buf[0] == (char) 0x41) ||
+ (up->rpt_buf[0] == (char) 0x46) ||
+ (up->rpt_buf[0] == (char) 0x54) ||
+ (up->rpt_buf[0] == (char) 0x4B) ||
+ (up->rpt_buf[0] == (char) 0x6D)) {
+
+ /* standard time packet - GPS time and GPS week number */
+#ifdef DEBUG
+ printf("Palisade Port B packets detected. Connect to Port A\n");
+#endif
+
+ return 0;
+ }
+ }
+
+ /*
+ * We cast both to u_char to as 0x8f uses the sign bit on a char
+ */
+ if ((u_char) up->rpt_buf[0] == (u_char) 0x8f) {
+ /*
+ * Superpackets
+ */
+ event = (unsigned short) (getint((u_char *) &mb(1)) & 0xffff);
+ if (!((pp->sloppyclockflag & CLK_FLAG2) || event))
+ /* Ignore Packet */
+ return 0;
+
+ switch (mb(0) & 0xff) {
+ int GPS_UTC_Offset;
+ long tow;
+
+ case PACKET_8F0B:
+
+ if (up->polled <= 0)
+ return 0;
+
+ if (up->rpt_cnt != LENCODE_8F0B) /* check length */
+ break;
+
+#ifdef DEBUG
+ if (debug > 1) {
+ int ts;
+ double lat, lon, alt;
+ lat = getdbl((u_char *) &mb(42)) * R2D;
+ lon = getdbl((u_char *) &mb(50)) * R2D;
+ alt = getdbl((u_char *) &mb(58));
+
+ printf("TSIP_decode: unit %d: Latitude: %03.4f Longitude: %03.4f Alt: %05.2f m\n",
+ up->unit, lat,lon,alt);
+ printf("TSIP_decode: unit %d: Sats:",
+ up->unit);
+ for (st = 66, ts = 0; st <= 73; st++)
+ if (mb(st)) {
+ if (mb(st) > 0) ts++;
+ printf(" %02d", mb(st));
+ }
+ printf(" : Tracking %d\n", ts);
+ }
+#endif
+
+ GPS_UTC_Offset = getint((u_char *) &mb(16));
+ if (GPS_UTC_Offset == 0) { /* Check UTC offset */
+#ifdef DEBUG
+ printf("TSIP_decode: UTC Offset Unknown\n");
+#endif
+ break;
+ }
+
+ secs = getdbl((u_char *) &mb(3));
+ secint = (long) secs;
+ secfrac = secs - secint; /* 0.0 <= secfrac < 1.0 */
+
+ pp->nsec = (long) (secfrac * 1000000000);
+
+ secint %= 86400; /* Only care about today */
+ pp->hour = secint / 3600;
+ secint %= 3600;
+ pp->minute = secint / 60;
+ secint %= 60;
+ pp->second = secint % 60;
+
+ if ((pp->day = day_of_year(&mb(11))) < 0) break;
+
+ pp->year = getint((u_char *) &mb(13));
+
+#ifdef DEBUG
+ if (debug > 1)
+ printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%09ld %02d/%02d/%04d UTC %02d\n",
+ up->unit, mb(0) & 0xff, event, pp->hour, pp->minute,
+ pp->second, pp->nsec, mb(12), mb(11), pp->year, GPS_UTC_Offset);
+#endif
+ /* Only use this packet when no
+ * 8F-AD's are being received
+ */
+
+ if (up->leap_status) {
+ up->leap_status = 0;
+ return 0;
+ }
+
+ return 2;
+ break;
+
+ case PACKET_NTP:
+ /* Palisade-NTP Packet */
+
+ if (up->rpt_cnt != LENCODE_NTP) /* check length */
+ break;
+
+ up->leap_status = mb(19);
+
+ if (up->polled <= 0)
+ return 0;
+
+ /* Check Tracking Status */
+ st = mb(18);
+ if (st < 0 || st > 14)
+ st = 14;
+ if ((st >= 2 && st <= 7) || st == 11 || st == 12) {
+#ifdef DEBUG
+ printf("TSIP_decode: Not Tracking Sats : %s\n",
+ *Tracking_Status[st]);
+#endif
+ refclock_report(peer, CEVNT_BADTIME);
+ up->polled = -1;
+ return 0;
+ break;
+ }
+
+ if (up->leap_status & PALISADE_LEAP_PENDING) {
+ if (up->leap_status & PALISADE_UTC_TIME)
+ pp->leap = LEAP_ADDSECOND;
+ else
+ pp->leap = LEAP_DELSECOND;
+ }
+ else if (up->leap_status)
+ pp->leap = LEAP_NOWARNING;
+
+ else { /* UTC flag is not set:
+ * Receiver may have been reset, and lost
+ * its UTC almanac data */
+ pp->leap = LEAP_NOTINSYNC;
+#ifdef DEBUG
+ printf("TSIP_decode: UTC Almanac unavailable: %d\n",
+ mb(19));
+#endif
+ refclock_report(peer, CEVNT_BADTIME);
+ up->polled = -1;
+ return 0;
+ }
+
+ pp->nsec = (long) (getdbl((u_char *) &mb(3))
+ * 1000000000);
+
+ if ((pp->day = day_of_year(&mb(14))) < 0)
+ break;
+ pp->year = getint((u_char *) &mb(16));
+ pp->hour = mb(11);
+ pp->minute = mb(12);
+ pp->second = mb(13);
+
+#ifdef DEBUG
+ if (debug > 1)
+ printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%09ld %02d/%02d/%04d UTC %02x %s\n",
+ up->unit, mb(0) & 0xff, event, pp->hour, pp->minute,
+ pp->second, pp->nsec, mb(15), mb(14), pp->year,
+ mb(19), *Tracking_Status[st]);
+#endif
+ return 1;
+ break;
+
+ case PACKET_8FAC:
+ if (up->polled <= 0)
+ return 0;
+
+ if (up->rpt_cnt != LENCODE_8FAC)/* check length */
+ break;
+
+#ifdef DEBUG
+ if (debug > 1) {
+ double lat, lon, alt;
+ lat = getdbl((u_char *) &mb(36)) * R2D;
+ lon = getdbl((u_char *) &mb(44)) * R2D;
+ alt = getdbl((u_char *) &mb(52));
+
+ printf("TSIP_decode: unit %d: Latitude: %03.4f Longitude: %03.4f Alt: %05.2f m\n",
+ up->unit, lat,lon,alt);
+ printf("TSIP_decode: unit %d\n", up->unit);
+ }
+#endif
+ if (getint((u_char *) &mb(10)) & 0x80)
+ pp->leap = LEAP_ADDSECOND; /* we ASSUME addsecond */
+ else
+ pp->leap = LEAP_NOWARNING;
+
+#ifdef DEBUG
+ if (debug > 1)
+ printf("TSIP_decode: unit %d: 0x%02x leap %d\n",
+ up->unit, mb(0) & 0xff, pp->leap);
+ if (debug > 1) {
+ printf("Receiver MODE: 0x%02X\n", (u_char)mb(1));
+ if (mb(1) == 0x00)
+ printf(" AUTOMATIC\n");
+ if (mb(1) == 0x01)
+ printf(" SINGLE SATELLITE\n");
+ if (mb(1) == 0x03)
+ printf(" HORIZONTAL(2D)\n");
+ if (mb(1) == 0x04)
+ printf(" FULL POSITION(3D)\n");
+ if (mb(1) == 0x05)
+ printf(" DGPR REFERENCE\n");
+ if (mb(1) == 0x06)
+ printf(" CLOCK HOLD(2D)\n");
+ if (mb(1) == 0x07)
+ printf(" OVERDETERMINED CLOCK\n");
+
+ printf("\n** Disciplining MODE 0x%02X:\n", (u_char)mb(2));
+ if (mb(2) == 0x00)
+ printf(" NORMAL\n");
+ if (mb(2) == 0x01)
+ printf(" POWER-UP\n");
+ if (mb(2) == 0x02)
+ printf(" AUTO HOLDOVER\n");
+ if (mb(2) == 0x03)
+ printf(" MANUAL HOLDOVER\n");
+ if (mb(2) == 0x04)
+ printf(" RECOVERY\n");
+ if (mb(2) == 0x06)
+ printf(" DISCIPLINING DISABLED\n");
+ }
+#endif
+ return 0;
+ break;
+
+ case PACKET_8FAB:
+ /* Thunderbolt Primary Timing Packet */
+
+ if (up->rpt_cnt != LENCODE_8FAB) /* check length */
+ break;
+
+ if (up->polled <= 0)
+ return 0;
+
+ GPS_UTC_Offset = getint((u_char *) &mb(7));
+
+ if (GPS_UTC_Offset == 0){ /* Check UTC Offset */
+#ifdef DEBUG
+ printf("TSIP_decode: UTC Offset Unknown\n");
+#endif
+ break;
+ }
+
+
+ if ((mb(9) & 0x1d) == 0x0) {
+ /* if we know the GPS time and the UTC offset,
+ we expect UTC timing information !!! */
+
+ pp->leap = LEAP_NOTINSYNC;
+ refclock_report(peer, CEVNT_BADTIME);
+ up->polled = -1;
+ return 0;
+ }
+
+ pp->nsec = 0;
+#ifdef DEBUG
+ printf("\nTiming Flags are:\n");
+ printf("Timing flag value is: 0x%X\n", mb(9));
+ if ((mb(9) & 0x01) != 0)
+ printf (" Getting UTC time\n");
+ else
+ printf (" Getting GPS time\n");
+ if ((mb(9) & 0x02) != 0)
+ printf (" PPS is from UTC\n");
+ else
+ printf (" PPS is from GPS\n");
+ if ((mb(9) & 0x04) != 0)
+ printf (" Time is not Set\n");
+ else
+ printf (" Time is Set\n");
+ if ((mb(9) & 0x08) != 0)
+ printf(" I dont have UTC info\n");
+ else
+ printf (" I have UTC info\n");
+ if ((mb(9) & 0x10) != 0)
+ printf (" Time is from USER\n\n");
+ else
+ printf (" Time is from GPS\n\n");
+#endif
+
+ if ((pp->day = day_of_year(&mb(13))) < 0)
+ break;
+ tow = getlong((u_char *) &mb(1));
+#ifdef DEBUG
+ if (debug > 1) {
+ printf("pp->day: %d\n", pp->day);
+ printf("TOW: %ld\n", tow);
+ printf("DAY: %d\n", mb(13));
+ }
+#endif
+ pp->year = getint((u_char *) &mb(15));
+ pp->hour = mb(12);
+ pp->minute = mb(11);
+ pp->second = mb(10);
+
+
+#ifdef DEBUG
+ if (debug > 1)
+ printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%09ld %02d/%02d/%04d ",up->unit, mb(0) & 0xff, event, pp->hour, pp->minute, pp->second, pp->nsec, mb(14), mb(13), pp->year);
+#endif
+ return 1;
+ break;
+
+ default:
+ /* Ignore Packet */
+ return 0;
+ } /* switch */
+ } /* if 8F packets */
+
+ else if (up->rpt_buf[0] == (u_char)0x42) {
+ printf("0x42\n");
+ return 0;
+ }
+ else if (up->rpt_buf[0] == (u_char)0x43) {
+ printf("0x43\n");
+ return 0;
+ }
+ else if ((up->rpt_buf[0] == PACKET_41) & (up->type == CLK_THUNDERBOLT)){
+ printf("Undocumented 0x41 packet on Thunderbolt\n");
+ return 0;
+ }
+ else if ((up->rpt_buf[0] == PACKET_41A) & (up->type == CLK_ACUTIME)) {
+#ifdef DEBUG
+ printf("GPS TOW: %ld\n", (long)getlong((u_char *) &mb(0)));
+ printf("GPS WN: %d\n", getint((u_char *) &mb(4)));
+ printf("GPS UTC-GPS Offser: %ld\n", (long)getlong((u_char *) &mb(6)));
+#endif
+ return 0;
+ }
+
+ /* Health Status for Acutime Receiver */
+ else if ((up->rpt_buf[0] == PACKET_46) & (up->type == CLK_ACUTIME)) {
+#ifdef DEBUG
+ if (debug > 1)
+ /* Status Codes */
+ switch (mb(0)) {
+ case 0x00:
+ printf ("Doing Position Fixes\n");
+ break;
+ case 0x01:
+ printf ("Do no have GPS time yet\n");
+ break;
+ case 0x03:
+ printf ("PDOP is too high\n");
+ break;
+ case 0x08:
+ printf ("No usable satellites\n");
+ break;
+ case 0x09:
+ printf ("Only 1 usable satellite\n");
+ break;
+ case 0x0A:
+ printf ("Only 2 usable satellites\n");
+ break;
+ case 0x0B:
+ printf ("Only 3 usable satellites\n");
+ break;
+ case 0x0C:
+ printf("The Chosen satellite is unusable\n");
+ break;
+ }
+#endif
+ /* Error Codes */
+ if (mb(1) != 0) {
+
+ refclock_report(peer, CEVNT_BADTIME);
+ up->polled = -1;
+#ifdef DEBUG
+ if (debug > 1) {
+ if (mb(1) & 0x01)
+ printf ("Signal Processor Error, reset unit.\n");
+ if (mb(1) & 0x02)
+ printf ("Alignment error, channel or chip 1, reset unit.\n");
+ if (mb(1) & 0x03)
+ printf ("Alignment error, channel or chip 2, reset unit.\n");
+ if (mb(1) & 0x04)
+ printf ("Antenna feed line fault (open or short)\n");
+ if (mb(1) & 0x05)
+ printf ("Excessive reference frequency error, refer to packet 0x2D and packet 0x4D documentation for further information\n");
+ }
+#endif
+
+ return 0;
+ }
+ }
+ else if (up->rpt_buf[0] == 0x54)
+ return 0;
+
+ else if (up->rpt_buf[0] == PACKET_6D) {
+#ifdef DEBUG
+ int sats;
+
+ if ((mb(0) & 0x01) && (mb(0) & 0x02))
+ printf("2d Fix Dimension\n");
+ if (mb(0) & 0x04)
+ printf("3d Fix Dimension\n");
+
+ if (mb(0) & 0x08)
+ printf("Fix Mode is MANUAL\n");
+ else
+ printf("Fix Mode is AUTO\n");
+
+ sats = mb(0) & 0xF0;
+ sats = sats >> 4;
+ printf("Tracking %d Satellites\n", sats);
+#endif
+ return 0;
+ } /* else if not super packet */
+ refclock_report(peer, CEVNT_BADREPLY);
+ up->polled = -1;
+#ifdef DEBUG
+ printf("TSIP_decode: unit %d: bad packet %02x-%02x event %d len %d\n",
+ up->unit, up->rpt_buf[0] & 0xff, mb(0) & 0xff,
+ event, up->rpt_cnt);
+#endif
+ return 0;
+}
+
+/*
+ * palisade__receive - receive data from the serial interface
+ */
+
+static void
+palisade_receive (
+ struct peer * peer
+ )
+{
+ struct palisade_unit *up;
+ struct refclockproc *pp;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (! TSIP_decode(peer)) return;
+
+ if (up->polled <= 0)
+ return; /* no poll pending, already received or timeout */
+
+ up->polled = 0; /* Poll reply received */
+ pp->lencode = 0; /* clear time code */
+#ifdef DEBUG
+ if (debug)
+ printf(
+ "palisade_receive: unit %d: %4d %03d %02d:%02d:%02d.%09ld\n",
+ up->unit, pp->year, pp->day, pp->hour, pp->minute,
+ pp->second, pp->nsec);
+#endif
+
+ /*
+ * Process the sample
+ * Generate timecode: YYYY DoY HH:MM:SS.microsec
+ * report and process
+ */
+
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%4d %03d %02d:%02d:%02d.%09ld",
+ pp->year, pp->day,
+ pp->hour,pp->minute, pp->second, pp->nsec);
+ pp->lencode = 24;
+
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+
+#ifdef DEBUG
+ printf("palisade_receive: unit %d: refclock_process failed!\n",
+ up->unit);
+#endif
+ return;
+ }
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+#ifdef DEBUG
+ if (debug)
+ printf("palisade_receive: unit %d: %s\n",
+ up->unit, prettydate(&pp->lastrec));
+#endif
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+}
+
+
+/*
+ * palisade_poll - called by the transmit procedure
+ *
+ */
+static void
+palisade_poll (
+ int unit,
+ struct peer *peer
+ )
+{
+ struct palisade_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ pp->polls++;
+ if (up->polled > 0) /* last reply never arrived or error */
+ refclock_report(peer, CEVNT_TIMEOUT);
+
+ up->polled = 2; /* synchronous packet + 1 event */
+
+#ifdef DEBUG
+ if (debug)
+ printf("palisade_poll: unit %d: polling %s\n", unit,
+ (pp->sloppyclockflag & CLK_FLAG2) ?
+ "synchronous packet" : "event");
+#endif
+
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ return; /* using synchronous packet input */
+
+ if(up->type == CLK_PRAECIS) {
+ if(write(peer->procptr->io.fd,"SPSTAT\r\n",8) < 0)
+ msyslog(LOG_ERR, "Palisade(%d) write: %m:",unit);
+ else {
+ praecis_msg = 1;
+ return;
+ }
+ }
+
+ if (HW_poll(pp) < 0)
+ refclock_report(peer, CEVNT_FAULT);
+}
+
+static void
+praecis_parse (
+ struct recvbuf *rbufp,
+ struct peer *peer
+ )
+{
+ static char buf[100];
+ static int p = 0;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+
+ memcpy(buf+p,rbufp->recv_space.X_recv_buffer, rbufp->recv_length);
+ p += rbufp->recv_length;
+
+ if(buf[p-2] == '\r' && buf[p-1] == '\n') {
+ buf[p-2] = '\0';
+ record_clock_stats(&peer->srcadr, buf);
+
+ p = 0;
+ praecis_msg = 0;
+
+ if (HW_poll(pp) < 0)
+ refclock_report(peer, CEVNT_FAULT);
+
+ }
+}
+
+static void
+palisade_io (
+ struct recvbuf *rbufp
+ )
+{
+ /*
+ * Initialize pointers and read the timecode and timestamp.
+ */
+ struct palisade_unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ char * c, * d;
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if(up->type == CLK_PRAECIS) {
+ if(praecis_msg) {
+ praecis_parse(rbufp,peer);
+ return;
+ }
+ }
+
+ c = (char *) &rbufp->recv_space;
+ d = c + rbufp->recv_length;
+
+ while (c != d) {
+
+ /* Build time packet */
+ switch (up->rpt_status) {
+
+ case TSIP_PARSED_DLE_1:
+ switch (*c)
+ {
+ case 0:
+ case DLE:
+ case ETX:
+ up->rpt_status = TSIP_PARSED_EMPTY;
+ break;
+
+ default:
+ up->rpt_status = TSIP_PARSED_DATA;
+ /* save packet ID */
+ up->rpt_buf[0] = *c;
+ break;
+ }
+ break;
+
+ case TSIP_PARSED_DATA:
+ if (*c == DLE)
+ up->rpt_status = TSIP_PARSED_DLE_2;
+ else
+ mb(up->rpt_cnt++) = *c;
+ break;
+
+ case TSIP_PARSED_DLE_2:
+ if (*c == DLE) {
+ up->rpt_status = TSIP_PARSED_DATA;
+ mb(up->rpt_cnt++) =
+ *c;
+ }
+ else if (*c == ETX)
+ up->rpt_status = TSIP_PARSED_FULL;
+ else {
+ /* error: start new report packet */
+ up->rpt_status = TSIP_PARSED_DLE_1;
+ up->rpt_buf[0] = *c;
+ }
+ break;
+
+ case TSIP_PARSED_FULL:
+ case TSIP_PARSED_EMPTY:
+ default:
+ if ( *c != DLE)
+ up->rpt_status = TSIP_PARSED_EMPTY;
+ else
+ up->rpt_status = TSIP_PARSED_DLE_1;
+ break;
+ }
+
+ c++;
+
+ if (up->rpt_status == TSIP_PARSED_DLE_1) {
+ up->rpt_cnt = 0;
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ /* stamp it */
+ get_systime(&pp->lastrec);
+ }
+ else if (up->rpt_status == TSIP_PARSED_EMPTY)
+ up->rpt_cnt = 0;
+
+ else if (up->rpt_cnt > BMAX)
+ up->rpt_status =TSIP_PARSED_EMPTY;
+
+ if (up->rpt_status == TSIP_PARSED_FULL)
+ palisade_receive(peer);
+
+ } /* while chars in buffer */
+}
+
+
+/*
+ * Trigger the Palisade's event input, which is driven off the RTS
+ *
+ * Take a system time stamp to match the GPS time stamp.
+ *
+ */
+long
+HW_poll (
+ struct refclockproc * pp /* pointer to unit structure */
+ )
+{
+ int x; /* state before & after RTS set */
+ struct palisade_unit *up;
+
+ up = pp->unitptr;
+
+ /* read the current status, so we put things back right */
+ if (ioctl(pp->io.fd, TIOCMGET, &x) < 0) {
+ DPRINTF(1, ("Palisade HW_poll: unit %d: GET %m\n",
+ up->unit));
+ msyslog(LOG_ERR, "Palisade(%d) HW_poll: ioctl(fd,GET): %m",
+ up->unit);
+ return -1;
+ }
+
+ x |= TIOCM_RTS; /* turn on RTS */
+
+ /* Edge trigger */
+ if (up->type == CLK_ACUTIME)
+ write (pp->io.fd, "", 1);
+
+ if (ioctl(pp->io.fd, TIOCMSET, &x) < 0) {
+#ifdef DEBUG
+ if (debug)
+ printf("Palisade HW_poll: unit %d: SET \n", up->unit);
+#endif
+ msyslog(LOG_ERR,
+ "Palisade(%d) HW_poll: ioctl(fd, SET, RTS_on): %m",
+ up->unit);
+ return -1;
+ }
+
+ x &= ~TIOCM_RTS; /* turn off RTS */
+
+ /* poll timestamp */
+ get_systime(&pp->lastrec);
+
+ if (ioctl(pp->io.fd, TIOCMSET, &x) == -1) {
+#ifdef DEBUG
+ if (debug)
+ printf("Palisade HW_poll: unit %d: UNSET \n", up->unit);
+#endif
+ msyslog(LOG_ERR,
+ "Palisade(%d) HW_poll: ioctl(fd, UNSET, RTS_off): %m",
+ up->unit);
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * copy/swap a big-endian palisade double into a host double
+ */
+static double
+getdbl (
+ u_char *bp
+ )
+{
+#ifdef WORDS_BIGENDIAN
+ double out;
+
+ memcpy(&out, bp, sizeof(out));
+ return out;
+#else
+ union {
+ u_char ch[8];
+ u_int32 u32[2];
+ } ui;
+
+ union {
+ double out;
+ u_int32 u32[2];
+ } uo;
+
+ memcpy(ui.ch, bp, sizeof(ui.ch));
+ /* least-significant 32 bits of double from swapped bp[4] to bp[7] */
+ uo.u32[0] = ntohl(ui.u32[1]);
+ /* most-significant 32 bits from swapped bp[0] to bp[3] */
+ uo.u32[1] = ntohl(ui.u32[0]);
+
+ return uo.out;
+#endif
+}
+
+/*
+ * copy/swap a big-endian palisade short into a host short
+ */
+static short
+getint (
+ u_char *bp
+ )
+{
+ u_short us;
+
+ memcpy(&us, bp, sizeof(us));
+ return (short)ntohs(us);
+}
+
+/*
+ * copy/swap a big-endian palisade 32-bit int into a host 32-bit int
+ */
+static int32
+getlong(
+ u_char *bp
+ )
+{
+ u_int32 u32;
+
+ memcpy(&u32, bp, sizeof(u32));
+ return (int32)(u_int32)ntohl(u32);
+}
+
+#else /* REFCLOCK && CLOCK_PALISADE*/
+int refclock_palisade_c_notempty;
+#endif
diff --git a/ntpd/refclock_palisade.h b/ntpd/refclock_palisade.h
new file mode 100644
index 0000000..4f1ab26
--- /dev/null
+++ b/ntpd/refclock_palisade.h
@@ -0,0 +1,201 @@
+/*
+ * This software was developed by the Software and Component Technologies
+ * group of Trimble Navigation, Ltd.
+ *
+ * Copyright (c) 1997, 1998, 1999, 2000 Trimble Navigation Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Trimble Navigation, Ltd.
+ * 4. The name of Trimble Navigation Ltd. may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TRIMBLE NAVIGATION LTD. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL TRIMBLE NAVIGATION LTD. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * refclock_palisade - clock driver for the Trimble Palisade GPS
+ * timing receiver
+ *
+ * For detailed information on this program, please refer to the html
+ * Refclock 29 page accompanying the NTP distribution.
+ *
+ * for questions / bugs / comments, contact:
+ * sven_dietrich@trimble.com
+ *
+ * Sven-Thorsten Dietrich
+ * 645 North Mary Avenue
+ * Post Office Box 3642
+ * Sunnyvale, CA 94088-3642
+ *
+ */
+
+#ifndef REFCLOCK_PALISADE_H
+#define REFCLOCK_PALISADE_H
+
+#if defined HAVE_SYS_MODEM_H
+#include <sys/modem.h>
+#ifndef __QNXNTO__
+#define TIOCMSET MCSETA
+#define TIOCMGET MCGETA
+#define TIOCM_RTS MRTS
+#endif
+#endif
+
+#ifdef HAVE_TERMIOS_H
+# ifdef TERMIOS_NEEDS__SVID3
+# define _SVID3
+# endif
+# include <termios.h>
+# include <sys/stat.h>
+# ifdef TERMIOS_NEEDS__SVID3
+# undef _SVID3
+# endif
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_control.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+/*
+ * GPS Definitions
+ */
+#define DESCRIPTION "Trimble Palisade GPS" /* Long name */
+#define PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "GPS\0" /* reference ID */
+#define TRMB_MINPOLL 4 /* 16 seconds */
+#define TRMB_MAXPOLL 5 /* 32 seconds */
+
+/*
+ * I/O Definitions
+ */
+#define DEVICE "/dev/palisade%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+
+/*
+ * TSIP Report Definitions
+ */
+#define LENCODE_8F0B 74 /* Length of TSIP 8F-0B Packet & header */
+#define LENCODE_NTP 22 /* Length of Palisade NTP Packet */
+
+#define LENCODE_8FAC 68 /* Length of Thunderbolt 8F-AC Position Packet*/
+#define LENCODE_8FAB 17 /* Length of Thunderbolt Primary Timing Packet*/
+
+/* Allowed Sub-Packet ID's */
+#define PACKET_8F0B 0x0B
+#define PACKET_NTP 0xAD
+
+/* Thunderbolt Packets */
+#define PACKET_8FAC 0xAC /* Supplementary Thunderbolt Time Packet */
+#define PACKET_8FAB 0xAB /* Primary Thunderbolt Time Packet */
+#define PACKET_6D 0x6D /* Supplementary Thunderbolt Tracking Stats */
+#define PACKET_41 0x41 /* Thunderbolt I dont know what this packet is, it's not documented on my manual*/
+
+/* Acutime Packets */
+#define PACKET_41A 0x41 /* GPS time */
+#define PACKET_46 0x46 /* Receiver Health */
+
+#define DLE 0x10
+#define ETX 0x03
+
+/* parse states */
+#define TSIP_PARSED_EMPTY 0
+#define TSIP_PARSED_FULL 1
+#define TSIP_PARSED_DLE_1 2
+#define TSIP_PARSED_DATA 3
+#define TSIP_PARSED_DLE_2 4
+
+/*
+ * Leap-Insert and Leap-Delete are encoded as follows:
+ * PALISADE_UTC_TIME set and PALISADE_LEAP_PENDING set: INSERT leap
+ */
+
+#define PALISADE_LEAP_INPROGRESS 0x08 /* This is the leap flag */
+#define PALISADE_LEAP_WARNING 0x04 /* GPS Leap Warning (see ICD-200) */
+#define PALISADE_LEAP_PENDING 0x02 /* Leap Pending (24 hours) */
+#define PALISADE_UTC_TIME 0x01 /* UTC time available */
+
+#define mb(_X_) (up->rpt_buf[(_X_ + 1)]) /* shortcut for buffer access */
+
+/* Conversion Definitions */
+#define GPS_PI (3.1415926535898)
+#define R2D (180.0/GPS_PI)
+
+/*
+ * Structure for build data packets for send (thunderbolt uses it only)
+ * taken from Markus Prosch
+ */
+struct packettx
+{
+ short size;
+ u_char *data;
+};
+
+/*
+ * Palisade unit control structure.
+ */
+struct palisade_unit {
+ short unit; /* NTP refclock unit number */
+ int polled; /* flag to detect noreplies */
+ char leap_status; /* leap second flag */
+ char rpt_status; /* TSIP Parser State */
+ short rpt_cnt; /* TSIP packet length so far */
+ char rpt_buf[BMAX]; /* packet assembly buffer */
+ int type; /* Clock mode type */
+};
+
+/*
+ * Function prototypes
+ */
+
+static int palisade_start (int, struct peer *);
+static void palisade_shutdown (int, struct peer *);
+static void palisade_receive (struct peer *);
+static void palisade_poll (int, struct peer *);
+static void palisade_io (struct recvbuf *);
+int palisade_configure (int, struct peer *);
+int TSIP_decode (struct peer *);
+long HW_poll (struct refclockproc *);
+static double getdbl (u_char *);
+static short getint (u_char *);
+static int32 getlong (u_char *);
+
+
+#ifdef PALISADE_SENDCMD_RESURRECTED
+static void sendcmd (struct packettx *buffer, int c);
+#endif
+static void sendsupercmd (struct packettx *buffer, int c1, int c2);
+static void sendbyte (struct packettx *buffer, int b);
+static void sendint (struct packettx *buffer, int a);
+static int sendetx (struct packettx *buffer, int fd);
+static void init_thunderbolt (int fd);
+static void init_acutime (int fd);
+
+#endif /* REFCLOCK_PALISADE_H */
diff --git a/ntpd/refclock_parse.c b/ntpd/refclock_parse.c
new file mode 100644
index 0000000..052ec3a
--- /dev/null
+++ b/ntpd/refclock_parse.c
@@ -0,0 +1,6204 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
+ *
+ * refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
+ *
+ * generic reference clock driver for several DCF/GPS/MSF/... receivers
+ *
+ * PPS notes:
+ * On systems that support PPSAPI (RFC2783) PPSAPI is the
+ * preferred interface.
+ *
+ * Optionally make use of a STREAMS module for input processing where
+ * available and configured. This STREAMS module reduces the time
+ * stamp latency for serial and PPS events.
+ * Currently the STREAMS module is only available for Suns running
+ * SunOS 4.x and SunOS5.x.
+ *
+ * Copyright (c) 1995-2009 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_PARSE)
+
+/*
+ * This driver currently provides the support for
+ * - Meinberg receiver DCF77 PZF 535 (TCXO version) (DCF)
+ * - Meinberg receiver DCF77 PZF 535 (OCXO version) (DCF)
+ * - Meinberg receiver DCF77 PZF 509 (DCF)
+ * - Meinberg receiver DCF77 AM receivers (e.g. C51) (DCF)
+ * - IGEL CLOCK (DCF)
+ * - ELV DCF7000 (DCF)
+ * - Schmid clock (DCF)
+ * - Conrad DCF77 receiver module (DCF)
+ * - FAU DCF77 NTP receiver (TimeBrick) (DCF)
+ * - WHARTON 400A Series clock (DCF)
+ *
+ * - Meinberg GPS166/GPS167 (GPS)
+ * - Trimble (TSIP and TAIP protocol) (GPS)
+ *
+ * - RCC8000 MSF Receiver (MSF)
+ * - VARITEXT clock (MSF)
+ */
+
+/*
+ * Meinberg receivers are usually connected via a
+ * 9600 baud serial line
+ *
+ * The Meinberg GPS receivers also have a special NTP time stamp
+ * format. The firmware release is Uni-Erlangen.
+ *
+ * Meinberg generic receiver setup:
+ * output time code every second
+ * Baud rate 9600 7E2S
+ *
+ * Meinberg GPS16x setup:
+ * output time code every second
+ * Baudrate 19200 8N1
+ *
+ * This software supports the standard data formats used
+ * in Meinberg receivers.
+ *
+ * Special software versions are only sensible for the
+ * GPS 16x family of receivers.
+ *
+ * Meinberg can be reached via: http://www.meinberg.de/
+ */
+
+#include "ntpd.h"
+#include "ntp_refclock.h"
+#include "timevalops.h" /* includes <sys/time.h> */
+#include "ntp_control.h"
+#include "ntp_string.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#ifndef TM_IN_SYS_TIME
+# include <time.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if !defined(STREAM) && !defined(HAVE_SYSV_TTYS) && !defined(HAVE_BSD_TTYS) && !defined(HAVE_TERMIOS)
+# include "Bletch: Define one of {STREAM,HAVE_SYSV_TTYS,HAVE_TERMIOS}"
+#endif
+
+#ifdef STREAM
+# include <sys/stream.h>
+# include <sys/stropts.h>
+#endif
+
+#ifdef HAVE_TERMIOS
+# include <termios.h>
+# define TTY_GETATTR(_FD_, _ARG_) tcgetattr((_FD_), (_ARG_))
+# define TTY_SETATTR(_FD_, _ARG_) tcsetattr((_FD_), TCSANOW, (_ARG_))
+# undef HAVE_SYSV_TTYS
+#endif
+
+#ifdef HAVE_SYSV_TTYS
+# define TTY_GETATTR(_FD_, _ARG_) ioctl((_FD_), TCGETA, (_ARG_))
+# define TTY_SETATTR(_FD_, _ARG_) ioctl((_FD_), TCSETAW, (_ARG_))
+#endif
+
+#ifdef HAVE_BSD_TTYS
+/* #error CURRENTLY NO BSD TTY SUPPORT */
+# include "Bletch: BSD TTY not currently supported"
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_PPSAPI
+# include "ppsapi_timepps.h"
+# include "refclock_atom.h"
+#endif
+
+#ifdef PPS
+# ifdef HAVE_SYS_PPSCLOCK_H
+# include <sys/ppsclock.h>
+# endif
+# ifdef HAVE_TIO_SERIAL_STUFF
+# include <linux/serial.h>
+# endif
+#endif
+
+#define BUFFER_SIZE(_BUF, _PTR) ((_BUF) + sizeof(_BUF) - (_PTR))
+#define BUFFER_SIZES(_BUF, _PTR, _SZ) ((_BUF) + (_SZ) - (_PTR))
+
+/*
+ * document type of PPS interfacing - copy of ifdef mechanism in local_input()
+ */
+#undef PPS_METHOD
+
+#ifdef HAVE_PPSAPI
+#define PPS_METHOD "PPS API"
+#else
+#ifdef TIOCDCDTIMESTAMP
+#define PPS_METHOD "TIOCDCDTIMESTAMP"
+#else /* TIOCDCDTIMESTAMP */
+#if defined(HAVE_STRUCT_PPSCLOCKEV) && (defined(HAVE_CIOGETEV) || defined(HAVE_TIOCGPPSEV))
+#ifdef HAVE_CIOGETEV
+#define PPS_METHOD "CIOGETEV"
+#endif
+#ifdef HAVE_TIOCGPPSEV
+#define PPS_METHOD "TIOCGPPSEV"
+#endif
+#endif
+#endif /* TIOCDCDTIMESTAMP */
+#endif /* HAVE_PPSAPI */
+
+#include "ntp_io.h"
+#include "ntp_stdlib.h"
+
+#include "parse.h"
+#include "mbg_gps166.h"
+#include "trimble.h"
+#include "binio.h"
+#include "ascii.h"
+#include "ieee754io.h"
+#include "recvbuff.h"
+
+static char rcsid[] = "refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A+POWERUPTRUST";
+
+/**===========================================================================
+ ** external interface to ntp mechanism
+ **/
+
+static int parse_start (int, struct peer *);
+static void parse_shutdown (int, struct peer *);
+static void parse_poll (int, struct peer *);
+static void parse_control (int, const struct refclockstat *, struct refclockstat *, struct peer *);
+
+struct refclock refclock_parse = {
+ parse_start,
+ parse_shutdown,
+ parse_poll,
+ parse_control,
+ noentry,
+ noentry,
+ NOFLAGS
+};
+
+/*
+ * Definitions
+ */
+#define MAXUNITS 4 /* maximum number of "PARSE" units permitted */
+#define PARSEDEVICE "/dev/refclock-%d" /* device to open %d is unit number */
+#define PARSEPPSDEVICE "/dev/refclockpps-%d" /* optional pps device to open %d is unit number */
+
+#undef ABS
+#define ABS(_X_) (((_X_) < 0) ? -(_X_) : (_X_))
+
+#define PARSE_HARDPPS_DISABLE 0
+#define PARSE_HARDPPS_ENABLE 1
+
+/**===========================================================================
+ ** function vector for dynamically binding io handling mechanism
+ **/
+
+struct parseunit; /* to keep inquiring minds happy */
+
+typedef struct bind
+{
+ const char *bd_description; /* name of type of binding */
+ int (*bd_init) (struct parseunit *); /* initialize */
+ void (*bd_end) (struct parseunit *); /* end */
+ int (*bd_setcs) (struct parseunit *, parsectl_t *); /* set character size */
+ int (*bd_disable) (struct parseunit *); /* disable */
+ int (*bd_enable) (struct parseunit *); /* enable */
+ int (*bd_getfmt) (struct parseunit *, parsectl_t *); /* get format */
+ int (*bd_setfmt) (struct parseunit *, parsectl_t *); /* setfmt */
+ int (*bd_timecode) (struct parseunit *, parsectl_t *); /* get time code */
+ void (*bd_receive) (struct recvbuf *); /* receive operation */
+ int (*bd_io_input) (struct recvbuf *); /* input operation */
+} bind_t;
+
+#define PARSE_END(_X_) (*(_X_)->binding->bd_end)(_X_)
+#define PARSE_SETCS(_X_, _CS_) (*(_X_)->binding->bd_setcs)(_X_, _CS_)
+#define PARSE_ENABLE(_X_) (*(_X_)->binding->bd_enable)(_X_)
+#define PARSE_DISABLE(_X_) (*(_X_)->binding->bd_disable)(_X_)
+#define PARSE_GETFMT(_X_, _DCT_) (*(_X_)->binding->bd_getfmt)(_X_, _DCT_)
+#define PARSE_SETFMT(_X_, _DCT_) (*(_X_)->binding->bd_setfmt)(_X_, _DCT_)
+#define PARSE_GETTIMECODE(_X_, _DCT_) (*(_X_)->binding->bd_timecode)(_X_, _DCT_)
+
+/*
+ * special handling flags
+ */
+#define PARSE_F_PPSONSECOND 0x00000001 /* PPS pulses are on second */
+#define PARSE_F_POWERUPTRUST 0x00000100 /* POWERUP state ist trusted for */
+ /* trusttime after SYNC was seen */
+/**===========================================================================
+ ** error message regression handling
+ **
+ ** there are quite a few errors that can occur in rapid succession such as
+ ** noisy input data or no data at all. in order to reduce the amount of
+ ** syslog messages in such case, we are using a backoff algorithm. We limit
+ ** the number of error messages of a certain class to 1 per time unit. if a
+ ** configurable number of messages is displayed that way, we move on to the
+ ** next time unit / count for that class. a count of messages that have been
+ ** suppressed is held and displayed whenever a corresponding message is
+ ** displayed. the time units for a message class will also be displayed.
+ ** whenever an error condition clears we reset the error message state,
+ ** thus we would still generate much output on pathological conditions
+ ** where the system oscillates between OK and NOT OK states. coping
+ ** with that condition is currently considered too complicated.
+ **/
+
+#define ERR_ALL (unsigned)~0 /* "all" errors */
+#define ERR_BADDATA (unsigned)0 /* unusable input data/conversion errors */
+#define ERR_NODATA (unsigned)1 /* no input data */
+#define ERR_BADIO (unsigned)2 /* read/write/select errors */
+#define ERR_BADSTATUS (unsigned)3 /* unsync states */
+#define ERR_BADEVENT (unsigned)4 /* non nominal events */
+#define ERR_INTERNAL (unsigned)5 /* internal error */
+#define ERR_CNT (unsigned)(ERR_INTERNAL+1)
+
+#define ERR(_X_) if (list_err(parse, (_X_)))
+
+struct errorregression
+{
+ u_long err_count; /* number of repititions per class */
+ u_long err_delay; /* minimum delay between messages */
+};
+
+static struct errorregression
+err_baddata[] = /* error messages for bad input data */
+{
+ { 1, 0 }, /* output first message immediately */
+ { 5, 60 }, /* output next five messages in 60 second intervals */
+ { 3, 3600 }, /* output next 3 messages in hour intervals */
+ { 0, 12*3600 } /* repeat messages only every 12 hours */
+};
+
+static struct errorregression
+err_nodata[] = /* error messages for missing input data */
+{
+ { 1, 0 }, /* output first message immediately */
+ { 5, 60 }, /* output next five messages in 60 second intervals */
+ { 3, 3600 }, /* output next 3 messages in hour intervals */
+ { 0, 12*3600 } /* repeat messages only every 12 hours */
+};
+
+static struct errorregression
+err_badstatus[] = /* unsynchronized state messages */
+{
+ { 1, 0 }, /* output first message immediately */
+ { 5, 60 }, /* output next five messages in 60 second intervals */
+ { 3, 3600 }, /* output next 3 messages in hour intervals */
+ { 0, 12*3600 } /* repeat messages only every 12 hours */
+};
+
+static struct errorregression
+err_badio[] = /* io failures (bad reads, selects, ...) */
+{
+ { 1, 0 }, /* output first message immediately */
+ { 5, 60 }, /* output next five messages in 60 second intervals */
+ { 5, 3600 }, /* output next 3 messages in hour intervals */
+ { 0, 12*3600 } /* repeat messages only every 12 hours */
+};
+
+static struct errorregression
+err_badevent[] = /* non nominal events */
+{
+ { 20, 0 }, /* output first message immediately */
+ { 6, 60 }, /* output next five messages in 60 second intervals */
+ { 5, 3600 }, /* output next 3 messages in hour intervals */
+ { 0, 12*3600 } /* repeat messages only every 12 hours */
+};
+
+static struct errorregression
+err_internal[] = /* really bad things - basically coding/OS errors */
+{
+ { 0, 0 }, /* output all messages immediately */
+};
+
+static struct errorregression *
+err_tbl[] =
+{
+ err_baddata,
+ err_nodata,
+ err_badio,
+ err_badstatus,
+ err_badevent,
+ err_internal
+};
+
+struct errorinfo
+{
+ u_long err_started; /* begin time (ntp) of error condition */
+ u_long err_last; /* last time (ntp) error occurred */
+ u_long err_cnt; /* number of error repititions */
+ u_long err_suppressed; /* number of suppressed messages */
+ struct errorregression *err_stage; /* current error stage */
+};
+
+/**===========================================================================
+ ** refclock instance data
+ **/
+
+struct parseunit
+{
+ /*
+ * NTP management
+ */
+ struct peer *peer; /* backlink to peer structure - refclock inactive if 0 */
+ struct refclockproc *generic; /* backlink to refclockproc structure */
+
+ /*
+ * PARSE io
+ */
+ bind_t *binding; /* io handling binding */
+
+ /*
+ * parse state
+ */
+ parse_t parseio; /* io handling structure (user level parsing) */
+
+ /*
+ * type specific parameters
+ */
+ struct parse_clockinfo *parse_type; /* link to clock description */
+
+ /*
+ * clock state handling/reporting
+ */
+ u_char flags; /* flags (leap_control) */
+ u_long lastchange; /* time (ntp) when last state change accured */
+ u_long statetime[CEVNT_MAX+1]; /* accumulated time of clock states */
+ u_long pollneeddata; /* current_time(!=0) for receive sample expected in PPS mode */
+ u_short lastformat; /* last format used */
+ u_long lastsync; /* time (ntp) when clock was last seen fully synchronized */
+ u_long maxunsync; /* max time in seconds a receiver is trusted after loosing synchronisation */
+ double ppsphaseadjust; /* phase adjustment of PPS time stamp */
+ u_long lastmissed; /* time (ntp) when poll didn't get data (powerup heuristic) */
+ u_long ppsserial; /* magic cookie for ppsclock serials (avoids stale ppsclock data) */
+ int ppsfd; /* fd to ise for PPS io */
+#ifdef HAVE_PPSAPI
+ int hardppsstate; /* current hard pps state */
+ struct refclock_atom atom; /* PPSAPI structure */
+#endif
+ parsetime_t timedata; /* last (parse module) data */
+ void *localdata; /* optional local, receiver-specific data */
+ unsigned long localstate; /* private local state */
+ struct errorinfo errors[ERR_CNT]; /* error state table for suppressing excessive error messages */
+ struct ctl_var *kv; /* additional pseudo variables */
+ u_long laststatistic; /* time when staticstics where output */
+};
+
+
+/**===========================================================================
+ ** Clockinfo section all parameter for specific clock types
+ ** includes NTP parameters, TTY parameters and IO handling parameters
+ **/
+
+static void poll_dpoll (struct parseunit *);
+static void poll_poll (struct peer *);
+static int poll_init (struct parseunit *);
+
+typedef struct poll_info
+{
+ u_long rate; /* poll rate - once every "rate" seconds - 0 off */
+ const char *string; /* string to send for polling */
+ u_long count; /* number of characters in string */
+} poll_info_t;
+
+#define NO_CL_FLAGS 0
+#define NO_POLL 0
+#define NO_INIT 0
+#define NO_END 0
+#define NO_EVENT 0
+#define NO_LCLDATA 0
+#define NO_MESSAGE 0
+#define NO_PPSDELAY 0
+
+#define DCF_ID "DCF" /* generic DCF */
+#define DCF_A_ID "DCFa" /* AM demodulation */
+#define DCF_P_ID "DCFp" /* psuedo random phase shift */
+#define GPS_ID "GPS" /* GPS receiver */
+
+#define NOCLOCK_ROOTDELAY 0.0
+#define NOCLOCK_BASEDELAY 0.0
+#define NOCLOCK_DESCRIPTION 0
+#define NOCLOCK_MAXUNSYNC 0
+#define NOCLOCK_CFLAG 0
+#define NOCLOCK_IFLAG 0
+#define NOCLOCK_OFLAG 0
+#define NOCLOCK_LFLAG 0
+#define NOCLOCK_ID "TILT"
+#define NOCLOCK_POLL NO_POLL
+#define NOCLOCK_INIT NO_INIT
+#define NOCLOCK_END NO_END
+#define NOCLOCK_DATA NO_LCLDATA
+#define NOCLOCK_FORMAT ""
+#define NOCLOCK_TYPE CTL_SST_TS_UNSPEC
+#define NOCLOCK_SAMPLES 0
+#define NOCLOCK_KEEP 0
+
+#define DCF_TYPE CTL_SST_TS_LF
+#define GPS_TYPE CTL_SST_TS_UHF
+
+/*
+ * receiver specific constants
+ */
+#define MBG_SPEED (B9600)
+#define MBG_CFLAG (CS7|PARENB|CREAD|CLOCAL|HUPCL|CSTOPB)
+#define MBG_IFLAG (IGNBRK|IGNPAR|ISTRIP)
+#define MBG_OFLAG 0
+#define MBG_LFLAG 0
+#define MBG_FLAGS PARSE_F_PPSONSECOND
+
+/*
+ * Meinberg DCF77 receivers
+ */
+#define DCFUA31_ROOTDELAY 0.0 /* 0 */
+#define DCFUA31_BASEDELAY 0.010 /* 10.7421875ms: 10 ms (+/- 3 ms) */
+#define DCFUA31_DESCRIPTION "Meinberg DCF77 C51 or compatible"
+#define DCFUA31_MAXUNSYNC 60*30 /* only trust clock for 1/2 hour */
+#define DCFUA31_SPEED MBG_SPEED
+#define DCFUA31_CFLAG MBG_CFLAG
+#define DCFUA31_IFLAG MBG_IFLAG
+#define DCFUA31_OFLAG MBG_OFLAG
+#define DCFUA31_LFLAG MBG_LFLAG
+#define DCFUA31_SAMPLES 5
+#define DCFUA31_KEEP 3
+#define DCFUA31_FORMAT "Meinberg Standard"
+
+/*
+ * Meinberg DCF PZF535/TCXO (FM/PZF) receiver
+ */
+#define DCFPZF535_ROOTDELAY 0.0
+#define DCFPZF535_BASEDELAY 0.001968 /* 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */
+#define DCFPZF535_DESCRIPTION "Meinberg DCF PZF 535/509 / TCXO"
+#define DCFPZF535_MAXUNSYNC 60*60*12 /* only trust clock for 12 hours
+ * @ 5e-8df/f we have accumulated
+ * at most 2.16 ms (thus we move to
+ * NTP synchronisation */
+#define DCFPZF535_SPEED MBG_SPEED
+#define DCFPZF535_CFLAG MBG_CFLAG
+#define DCFPZF535_IFLAG MBG_IFLAG
+#define DCFPZF535_OFLAG MBG_OFLAG
+#define DCFPZF535_LFLAG MBG_LFLAG
+#define DCFPZF535_SAMPLES 5
+#define DCFPZF535_KEEP 3
+#define DCFPZF535_FORMAT "Meinberg Standard"
+
+/*
+ * Meinberg DCF PZF535/OCXO receiver
+ */
+#define DCFPZF535OCXO_ROOTDELAY 0.0
+#define DCFPZF535OCXO_BASEDELAY 0.001968 /* 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */
+#define DCFPZF535OCXO_DESCRIPTION "Meinberg DCF PZF 535/509 / OCXO"
+#define DCFPZF535OCXO_MAXUNSYNC 60*60*96 /* only trust clock for 4 days
+ * @ 5e-9df/f we have accumulated
+ * at most an error of 1.73 ms
+ * (thus we move to NTP synchronisation) */
+#define DCFPZF535OCXO_SPEED MBG_SPEED
+#define DCFPZF535OCXO_CFLAG MBG_CFLAG
+#define DCFPZF535OCXO_IFLAG MBG_IFLAG
+#define DCFPZF535OCXO_OFLAG MBG_OFLAG
+#define DCFPZF535OCXO_LFLAG MBG_LFLAG
+#define DCFPZF535OCXO_SAMPLES 5
+#define DCFPZF535OCXO_KEEP 3
+#define DCFPZF535OCXO_FORMAT "Meinberg Standard"
+
+/*
+ * Meinberg GPS16X receiver
+ */
+static void gps16x_message (struct parseunit *, parsetime_t *);
+static int gps16x_poll_init (struct parseunit *);
+
+#define GPS16X_ROOTDELAY 0.0 /* nothing here */
+#define GPS16X_BASEDELAY 0.001968 /* XXX to be fixed ! 1.968ms +- 104us (oscilloscope) - relative to start (end of STX) */
+#define GPS16X_DESCRIPTION "Meinberg GPS16x receiver"
+#define GPS16X_MAXUNSYNC 60*60*96 /* only trust clock for 4 days
+ * @ 5e-9df/f we have accumulated
+ * at most an error of 1.73 ms
+ * (thus we move to NTP synchronisation) */
+#define GPS16X_SPEED B19200
+#define GPS16X_CFLAG (CS8|CREAD|CLOCAL|HUPCL)
+#define GPS16X_IFLAG (IGNBRK|IGNPAR)
+#define GPS16X_OFLAG MBG_OFLAG
+#define GPS16X_LFLAG MBG_LFLAG
+#define GPS16X_POLLRATE 6
+#define GPS16X_POLLCMD ""
+#define GPS16X_CMDSIZE 0
+
+static poll_info_t gps16x_pollinfo = { GPS16X_POLLRATE, GPS16X_POLLCMD, GPS16X_CMDSIZE };
+
+#define GPS16X_INIT gps16x_poll_init
+#define GPS16X_POLL 0
+#define GPS16X_END 0
+#define GPS16X_DATA ((void *)(&gps16x_pollinfo))
+#define GPS16X_MESSAGE gps16x_message
+#define GPS16X_ID GPS_ID
+#define GPS16X_FORMAT "Meinberg GPS Extended"
+#define GPS16X_SAMPLES 5
+#define GPS16X_KEEP 3
+
+/*
+ * ELV DCF7000 Wallclock-Receiver/Switching Clock (Kit)
+ *
+ * This is really not the hottest clock - but before you have nothing ...
+ */
+#define DCF7000_ROOTDELAY 0.0 /* 0 */
+#define DCF7000_BASEDELAY 0.405 /* slow blow */
+#define DCF7000_DESCRIPTION "ELV DCF7000"
+#define DCF7000_MAXUNSYNC (60*5) /* sorry - but it just was not build as a clock */
+#define DCF7000_SPEED (B9600)
+#define DCF7000_CFLAG (CS8|CREAD|PARENB|PARODD|CLOCAL|HUPCL)
+#define DCF7000_IFLAG (IGNBRK)
+#define DCF7000_OFLAG 0
+#define DCF7000_LFLAG 0
+#define DCF7000_SAMPLES 5
+#define DCF7000_KEEP 3
+#define DCF7000_FORMAT "ELV DCF7000"
+
+/*
+ * Schmid DCF Receiver Kit
+ *
+ * When the WSDCF clock is operating optimally we want the primary clock
+ * distance to come out at 300 ms. Thus, peer.distance in the WSDCF peer
+ * structure is set to 290 ms and we compute delays which are at least
+ * 10 ms long. The following are 290 ms and 10 ms expressed in u_fp format
+ */
+#define WS_POLLRATE 1 /* every second - watch interdependency with poll routine */
+#define WS_POLLCMD "\163"
+#define WS_CMDSIZE 1
+
+static poll_info_t wsdcf_pollinfo = { WS_POLLRATE, WS_POLLCMD, WS_CMDSIZE };
+
+#define WSDCF_INIT poll_init
+#define WSDCF_POLL poll_dpoll
+#define WSDCF_END 0
+#define WSDCF_DATA ((void *)(&wsdcf_pollinfo))
+#define WSDCF_ROOTDELAY 0.0 /* 0 */
+#define WSDCF_BASEDELAY 0.010 /* ~ 10ms */
+#define WSDCF_DESCRIPTION "WS/DCF Receiver"
+#define WSDCF_FORMAT "Schmid"
+#define WSDCF_MAXUNSYNC (60*60) /* assume this beast hold at 1 h better than 2 ms XXX-must verify */
+#define WSDCF_SPEED (B1200)
+#define WSDCF_CFLAG (CS8|CREAD|CLOCAL)
+#define WSDCF_IFLAG 0
+#define WSDCF_OFLAG 0
+#define WSDCF_LFLAG 0
+#define WSDCF_SAMPLES 5
+#define WSDCF_KEEP 3
+
+/*
+ * RAW DCF77 - input of DCF marks via RS232 - many variants
+ */
+#define RAWDCF_FLAGS 0
+#define RAWDCF_ROOTDELAY 0.0 /* 0 */
+#define RAWDCF_BASEDELAY 0.258
+#define RAWDCF_FORMAT "RAW DCF77 Timecode"
+#define RAWDCF_MAXUNSYNC (0) /* sorry - its a true receiver - no signal - no time */
+#define RAWDCF_SPEED (B50)
+#ifdef NO_PARENB_IGNPAR /* Was: defined(SYS_IRIX4) || defined(SYS_IRIX5) */
+/* somehow doesn't grok PARENB & IGNPAR (mj) */
+# define RAWDCF_CFLAG (CS8|CREAD|CLOCAL)
+#else
+# define RAWDCF_CFLAG (CS8|CREAD|CLOCAL|PARENB)
+#endif
+#ifdef RAWDCF_NO_IGNPAR /* Was: defined(SYS_LINUX) && defined(CLOCK_RAWDCF) */
+# define RAWDCF_IFLAG 0
+#else
+# define RAWDCF_IFLAG (IGNPAR)
+#endif
+#define RAWDCF_OFLAG 0
+#define RAWDCF_LFLAG 0
+#define RAWDCF_SAMPLES 20
+#define RAWDCF_KEEP 12
+#define RAWDCF_INIT 0
+
+/*
+ * RAW DCF variants
+ */
+/*
+ * Conrad receiver
+ *
+ * simplest (cheapest) DCF clock - e. g. DCF77 receiver by Conrad
+ * (~40DM - roughly $30 ) followed by a level converter for RS232
+ */
+#define CONRAD_BASEDELAY 0.292 /* Conrad receiver @ 50 Baud on a Sun */
+#define CONRAD_DESCRIPTION "RAW DCF77 CODE (Conrad DCF77 receiver module)"
+
+/* Gude Analog- und Digitalsystem GmbH 'Expert mouseCLOCK USB v2.0' */
+#define GUDE_EMC_USB_V20_SPEED (B4800)
+#define GUDE_EMC_USB_V20_BASEDELAY 0.425 /* USB serial<->USB converter FTDI232R */
+#define GUDE_EMC_USB_V20_DESCRIPTION "RAW DCF77 CODE (Expert mouseCLOCK USB v2.0)"
+
+/*
+ * TimeBrick receiver
+ */
+#define TIMEBRICK_BASEDELAY 0.210 /* TimeBrick @ 50 Baud on a Sun */
+#define TIMEBRICK_DESCRIPTION "RAW DCF77 CODE (TimeBrick)"
+
+/*
+ * IGEL:clock receiver
+ */
+#define IGELCLOCK_BASEDELAY 0.258 /* IGEL:clock receiver */
+#define IGELCLOCK_DESCRIPTION "RAW DCF77 CODE (IGEL:clock)"
+#define IGELCLOCK_SPEED (B1200)
+#define IGELCLOCK_CFLAG (CS8|CREAD|HUPCL|CLOCAL)
+
+/*
+ * RAWDCF receivers that need to be powered from DTR
+ * (like Expert mouse clock)
+ */
+static int rawdcf_init_1 (struct parseunit *);
+#define RAWDCFDTRSET_DESCRIPTION "RAW DCF77 CODE (DTR SET/RTS CLR)"
+#define RAWDCFDTRSET75_DESCRIPTION "RAW DCF77 CODE (DTR SET/RTS CLR @ 75 baud)"
+#define RAWDCFDTRSET_INIT rawdcf_init_1
+
+/*
+ * RAWDCF receivers that need to be powered from
+ * DTR CLR and RTS SET
+ */
+static int rawdcf_init_2 (struct parseunit *);
+#define RAWDCFDTRCLRRTSSET_DESCRIPTION "RAW DCF77 CODE (DTR CLR/RTS SET)"
+#define RAWDCFDTRCLRRTSSET75_DESCRIPTION "RAW DCF77 CODE (DTR CLR/RTS SET @ 75 baud)"
+#define RAWDCFDTRCLRRTSSET_INIT rawdcf_init_2
+
+/*
+ * Trimble GPS receivers (TAIP and TSIP protocols)
+ */
+#ifndef TRIM_POLLRATE
+#define TRIM_POLLRATE 0 /* only true direct polling */
+#endif
+
+#define TRIM_TAIPPOLLCMD ">SRM;FR_FLAG=F;EC_FLAG=F<>QTM<"
+#define TRIM_TAIPCMDSIZE (sizeof(TRIM_TAIPPOLLCMD)-1)
+
+static poll_info_t trimbletaip_pollinfo = { TRIM_POLLRATE, TRIM_TAIPPOLLCMD, TRIM_TAIPCMDSIZE };
+static int trimbletaip_init (struct parseunit *);
+static void trimbletaip_event (struct parseunit *, int);
+
+/* query time & UTC correction data */
+static char tsipquery[] = { DLE, 0x21, DLE, ETX, DLE, 0x2F, DLE, ETX };
+
+static poll_info_t trimbletsip_pollinfo = { TRIM_POLLRATE, tsipquery, sizeof(tsipquery) };
+static int trimbletsip_init (struct parseunit *);
+static void trimbletsip_end (struct parseunit *);
+static void trimbletsip_message (struct parseunit *, parsetime_t *);
+static void trimbletsip_event (struct parseunit *, int);
+
+#define TRIMBLETSIP_IDLE_TIME (300) /* 5 minutes silence at most */
+#define TRIMBLE_RESET_HOLDOFF TRIMBLETSIP_IDLE_TIME
+
+#define TRIMBLETAIP_SPEED (B4800)
+#define TRIMBLETAIP_CFLAG (CS8|CREAD|CLOCAL)
+#define TRIMBLETAIP_IFLAG (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON)
+#define TRIMBLETAIP_OFLAG (OPOST|ONLCR)
+#define TRIMBLETAIP_LFLAG (0)
+
+#define TRIMBLETSIP_SPEED (B9600)
+#define TRIMBLETSIP_CFLAG (CS8|CLOCAL|CREAD|PARENB|PARODD)
+#define TRIMBLETSIP_IFLAG (IGNBRK)
+#define TRIMBLETSIP_OFLAG (0)
+#define TRIMBLETSIP_LFLAG (ICANON)
+
+#define TRIMBLETSIP_SAMPLES 5
+#define TRIMBLETSIP_KEEP 3
+#define TRIMBLETAIP_SAMPLES 5
+#define TRIMBLETAIP_KEEP 3
+
+#define TRIMBLETAIP_FLAGS (PARSE_F_PPSONSECOND)
+#define TRIMBLETSIP_FLAGS (TRIMBLETAIP_FLAGS)
+
+#define TRIMBLETAIP_POLL poll_dpoll
+#define TRIMBLETSIP_POLL poll_dpoll
+
+#define TRIMBLETAIP_INIT trimbletaip_init
+#define TRIMBLETSIP_INIT trimbletsip_init
+
+#define TRIMBLETAIP_EVENT trimbletaip_event
+
+#define TRIMBLETSIP_EVENT trimbletsip_event
+#define TRIMBLETSIP_MESSAGE trimbletsip_message
+
+#define TRIMBLETAIP_END 0
+#define TRIMBLETSIP_END trimbletsip_end
+
+#define TRIMBLETAIP_DATA ((void *)(&trimbletaip_pollinfo))
+#define TRIMBLETSIP_DATA ((void *)(&trimbletsip_pollinfo))
+
+#define TRIMBLETAIP_ID GPS_ID
+#define TRIMBLETSIP_ID GPS_ID
+
+#define TRIMBLETAIP_FORMAT "Trimble TAIP"
+#define TRIMBLETSIP_FORMAT "Trimble TSIP"
+
+#define TRIMBLETAIP_ROOTDELAY 0x0
+#define TRIMBLETSIP_ROOTDELAY 0x0
+
+#define TRIMBLETAIP_BASEDELAY 0.0
+#define TRIMBLETSIP_BASEDELAY 0.020 /* GPS time message latency */
+
+#define TRIMBLETAIP_DESCRIPTION "Trimble GPS (TAIP) receiver"
+#define TRIMBLETSIP_DESCRIPTION "Trimble GPS (TSIP) receiver"
+
+#define TRIMBLETAIP_MAXUNSYNC 0
+#define TRIMBLETSIP_MAXUNSYNC 0
+
+#define TRIMBLETAIP_EOL '<'
+
+/*
+ * RadioCode Clocks RCC 800 receiver
+ */
+#define RCC_POLLRATE 0 /* only true direct polling */
+#define RCC_POLLCMD "\r"
+#define RCC_CMDSIZE 1
+
+static poll_info_t rcc8000_pollinfo = { RCC_POLLRATE, RCC_POLLCMD, RCC_CMDSIZE };
+#define RCC8000_FLAGS 0
+#define RCC8000_POLL poll_dpoll
+#define RCC8000_INIT poll_init
+#define RCC8000_END 0
+#define RCC8000_DATA ((void *)(&rcc8000_pollinfo))
+#define RCC8000_ROOTDELAY 0.0
+#define RCC8000_BASEDELAY 0.0
+#define RCC8000_ID "MSF"
+#define RCC8000_DESCRIPTION "RCC 8000 MSF Receiver"
+#define RCC8000_FORMAT "Radiocode RCC8000"
+#define RCC8000_MAXUNSYNC (60*60) /* should be ok for an hour */
+#define RCC8000_SPEED (B2400)
+#define RCC8000_CFLAG (CS8|CREAD|CLOCAL)
+#define RCC8000_IFLAG (IGNBRK|IGNPAR)
+#define RCC8000_OFLAG 0
+#define RCC8000_LFLAG 0
+#define RCC8000_SAMPLES 5
+#define RCC8000_KEEP 3
+
+/*
+ * Hopf Radio clock 6021 Format
+ *
+ */
+#define HOPF6021_ROOTDELAY 0.0
+#define HOPF6021_BASEDELAY 0.0
+#define HOPF6021_DESCRIPTION "HOPF 6021"
+#define HOPF6021_FORMAT "hopf Funkuhr 6021"
+#define HOPF6021_MAXUNSYNC (60*60) /* should be ok for an hour */
+#define HOPF6021_SPEED (B9600)
+#define HOPF6021_CFLAG (CS8|CREAD|CLOCAL)
+#define HOPF6021_IFLAG (IGNBRK|ISTRIP)
+#define HOPF6021_OFLAG 0
+#define HOPF6021_LFLAG 0
+#define HOPF6021_FLAGS 0
+#define HOPF6021_SAMPLES 5
+#define HOPF6021_KEEP 3
+
+/*
+ * Diem's Computime Radio Clock Receiver
+ */
+#define COMPUTIME_FLAGS 0
+#define COMPUTIME_ROOTDELAY 0.0
+#define COMPUTIME_BASEDELAY 0.0
+#define COMPUTIME_ID DCF_ID
+#define COMPUTIME_DESCRIPTION "Diem's Computime receiver"
+#define COMPUTIME_FORMAT "Diem's Computime Radio Clock"
+#define COMPUTIME_TYPE DCF_TYPE
+#define COMPUTIME_MAXUNSYNC (60*60) /* only trust clock for 1 hour */
+#define COMPUTIME_SPEED (B9600)
+#define COMPUTIME_CFLAG (CSTOPB|CS7|CREAD|CLOCAL)
+#define COMPUTIME_IFLAG (IGNBRK|IGNPAR|ISTRIP)
+#define COMPUTIME_OFLAG 0
+#define COMPUTIME_LFLAG 0
+#define COMPUTIME_SAMPLES 5
+#define COMPUTIME_KEEP 3
+
+/*
+ * Varitext Radio Clock Receiver
+ */
+#define VARITEXT_FLAGS 0
+#define VARITEXT_ROOTDELAY 0.0
+#define VARITEXT_BASEDELAY 0.0
+#define VARITEXT_ID "MSF"
+#define VARITEXT_DESCRIPTION "Varitext receiver"
+#define VARITEXT_FORMAT "Varitext Radio Clock"
+#define VARITEXT_TYPE DCF_TYPE
+#define VARITEXT_MAXUNSYNC (60*60) /* only trust clock for 1 hour */
+#define VARITEXT_SPEED (B9600)
+#define VARITEXT_CFLAG (CS7|CREAD|CLOCAL|PARENB|PARODD)
+#define VARITEXT_IFLAG (IGNPAR|IGNBRK|INPCK) /*|ISTRIP)*/
+#define VARITEXT_OFLAG 0
+#define VARITEXT_LFLAG 0
+#define VARITEXT_SAMPLES 32
+#define VARITEXT_KEEP 20
+
+/*
+ * SEL240x Satellite Sychronized Clock
+ */
+#define SEL240X_POLLRATE 0 /* only true direct polling */
+#define SEL240X_POLLCMD "BUB8"
+#define SEL240X_CMDSIZE 4
+
+static poll_info_t sel240x_pollinfo = { SEL240X_POLLRATE,
+ SEL240X_POLLCMD,
+ SEL240X_CMDSIZE };
+#define SEL240X_FLAGS (PARSE_F_PPSONSECOND)
+#define SEL240X_POLL poll_dpoll
+#define SEL240X_INIT poll_init
+#define SEL240X_END 0
+#define SEL240X_DATA ((void *)(&sel240x_pollinfo))
+#define SEL240X_ROOTDELAY 0.0
+#define SEL240X_BASEDELAY 0.0
+#define SEL240X_ID GPS_ID
+#define SEL240X_DESCRIPTION "SEL240x Satellite Synchronized Clock"
+#define SEL240X_FORMAT "SEL B8"
+#define SEL240X_MAXUNSYNC 60*60*12 /* only trust clock for 12 hours */
+#define SEL240X_SPEED (B9600)
+#define SEL240X_CFLAG (CS8|CREAD|CLOCAL)
+#define SEL240X_IFLAG (IGNBRK|IGNPAR)
+#define SEL240X_OFLAG (0)
+#define SEL240X_LFLAG (0)
+#define SEL240X_SAMPLES 5
+#define SEL240X_KEEP 3
+
+static struct parse_clockinfo
+{
+ u_long cl_flags; /* operation flags (PPS interpretation, trust handling) */
+ void (*cl_poll) (struct parseunit *); /* active poll routine */
+ int (*cl_init) (struct parseunit *); /* active poll init routine */
+ void (*cl_event) (struct parseunit *, int); /* special event handling (e.g. reset clock) */
+ void (*cl_end) (struct parseunit *); /* active poll end routine */
+ void (*cl_message) (struct parseunit *, parsetime_t *); /* process a lower layer message */
+ void *cl_data; /* local data area for "poll" mechanism */
+ double cl_rootdelay; /* rootdelay */
+ double cl_basedelay; /* current offset by which the RS232
+ time code is delayed from the actual time */
+ const char *cl_id; /* ID code */
+ const char *cl_description; /* device name */
+ const char *cl_format; /* fixed format */
+ u_char cl_type; /* clock type (ntp control) */
+ u_long cl_maxunsync; /* time to trust oscillator after losing synch */
+ u_long cl_speed; /* terminal input & output baudrate */
+ u_long cl_cflag; /* terminal control flags */
+ u_long cl_iflag; /* terminal input flags */
+ u_long cl_oflag; /* terminal output flags */
+ u_long cl_lflag; /* terminal local flags */
+ u_long cl_samples; /* samples for median filter */
+ u_long cl_keep; /* samples for median filter to keep */
+} parse_clockinfo[] =
+{
+ { /* mode 0 */
+ MBG_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ DCFPZF535_ROOTDELAY,
+ DCFPZF535_BASEDELAY,
+ DCF_P_ID,
+ DCFPZF535_DESCRIPTION,
+ DCFPZF535_FORMAT,
+ DCF_TYPE,
+ DCFPZF535_MAXUNSYNC,
+ DCFPZF535_SPEED,
+ DCFPZF535_CFLAG,
+ DCFPZF535_IFLAG,
+ DCFPZF535_OFLAG,
+ DCFPZF535_LFLAG,
+ DCFPZF535_SAMPLES,
+ DCFPZF535_KEEP
+ },
+ { /* mode 1 */
+ MBG_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ DCFPZF535OCXO_ROOTDELAY,
+ DCFPZF535OCXO_BASEDELAY,
+ DCF_P_ID,
+ DCFPZF535OCXO_DESCRIPTION,
+ DCFPZF535OCXO_FORMAT,
+ DCF_TYPE,
+ DCFPZF535OCXO_MAXUNSYNC,
+ DCFPZF535OCXO_SPEED,
+ DCFPZF535OCXO_CFLAG,
+ DCFPZF535OCXO_IFLAG,
+ DCFPZF535OCXO_OFLAG,
+ DCFPZF535OCXO_LFLAG,
+ DCFPZF535OCXO_SAMPLES,
+ DCFPZF535OCXO_KEEP
+ },
+ { /* mode 2 */
+ MBG_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ DCFUA31_ROOTDELAY,
+ DCFUA31_BASEDELAY,
+ DCF_A_ID,
+ DCFUA31_DESCRIPTION,
+ DCFUA31_FORMAT,
+ DCF_TYPE,
+ DCFUA31_MAXUNSYNC,
+ DCFUA31_SPEED,
+ DCFUA31_CFLAG,
+ DCFUA31_IFLAG,
+ DCFUA31_OFLAG,
+ DCFUA31_LFLAG,
+ DCFUA31_SAMPLES,
+ DCFUA31_KEEP
+ },
+ { /* mode 3 */
+ MBG_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ DCF7000_ROOTDELAY,
+ DCF7000_BASEDELAY,
+ DCF_A_ID,
+ DCF7000_DESCRIPTION,
+ DCF7000_FORMAT,
+ DCF_TYPE,
+ DCF7000_MAXUNSYNC,
+ DCF7000_SPEED,
+ DCF7000_CFLAG,
+ DCF7000_IFLAG,
+ DCF7000_OFLAG,
+ DCF7000_LFLAG,
+ DCF7000_SAMPLES,
+ DCF7000_KEEP
+ },
+ { /* mode 4 */
+ NO_CL_FLAGS,
+ WSDCF_POLL,
+ WSDCF_INIT,
+ NO_EVENT,
+ WSDCF_END,
+ NO_MESSAGE,
+ WSDCF_DATA,
+ WSDCF_ROOTDELAY,
+ WSDCF_BASEDELAY,
+ DCF_A_ID,
+ WSDCF_DESCRIPTION,
+ WSDCF_FORMAT,
+ DCF_TYPE,
+ WSDCF_MAXUNSYNC,
+ WSDCF_SPEED,
+ WSDCF_CFLAG,
+ WSDCF_IFLAG,
+ WSDCF_OFLAG,
+ WSDCF_LFLAG,
+ WSDCF_SAMPLES,
+ WSDCF_KEEP
+ },
+ { /* mode 5 */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCF_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ CONRAD_BASEDELAY,
+ DCF_A_ID,
+ CONRAD_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ RAWDCF_SPEED,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 6 */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCF_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ TIMEBRICK_BASEDELAY,
+ DCF_A_ID,
+ TIMEBRICK_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ RAWDCF_SPEED,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 7 */
+ MBG_FLAGS,
+ GPS16X_POLL,
+ GPS16X_INIT,
+ NO_EVENT,
+ GPS16X_END,
+ GPS16X_MESSAGE,
+ GPS16X_DATA,
+ GPS16X_ROOTDELAY,
+ GPS16X_BASEDELAY,
+ GPS16X_ID,
+ GPS16X_DESCRIPTION,
+ GPS16X_FORMAT,
+ GPS_TYPE,
+ GPS16X_MAXUNSYNC,
+ GPS16X_SPEED,
+ GPS16X_CFLAG,
+ GPS16X_IFLAG,
+ GPS16X_OFLAG,
+ GPS16X_LFLAG,
+ GPS16X_SAMPLES,
+ GPS16X_KEEP
+ },
+ { /* mode 8 */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ IGELCLOCK_BASEDELAY,
+ DCF_A_ID,
+ IGELCLOCK_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ IGELCLOCK_SPEED,
+ IGELCLOCK_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 9 */
+ TRIMBLETAIP_FLAGS,
+#if TRIM_POLLRATE /* DHD940515: Allow user config */
+ NO_POLL,
+#else
+ TRIMBLETAIP_POLL,
+#endif
+ TRIMBLETAIP_INIT,
+ TRIMBLETAIP_EVENT,
+ TRIMBLETAIP_END,
+ NO_MESSAGE,
+ TRIMBLETAIP_DATA,
+ TRIMBLETAIP_ROOTDELAY,
+ TRIMBLETAIP_BASEDELAY,
+ TRIMBLETAIP_ID,
+ TRIMBLETAIP_DESCRIPTION,
+ TRIMBLETAIP_FORMAT,
+ GPS_TYPE,
+ TRIMBLETAIP_MAXUNSYNC,
+ TRIMBLETAIP_SPEED,
+ TRIMBLETAIP_CFLAG,
+ TRIMBLETAIP_IFLAG,
+ TRIMBLETAIP_OFLAG,
+ TRIMBLETAIP_LFLAG,
+ TRIMBLETAIP_SAMPLES,
+ TRIMBLETAIP_KEEP
+ },
+ { /* mode 10 */
+ TRIMBLETSIP_FLAGS,
+#if TRIM_POLLRATE /* DHD940515: Allow user config */
+ NO_POLL,
+#else
+ TRIMBLETSIP_POLL,
+#endif
+ TRIMBLETSIP_INIT,
+ TRIMBLETSIP_EVENT,
+ TRIMBLETSIP_END,
+ TRIMBLETSIP_MESSAGE,
+ TRIMBLETSIP_DATA,
+ TRIMBLETSIP_ROOTDELAY,
+ TRIMBLETSIP_BASEDELAY,
+ TRIMBLETSIP_ID,
+ TRIMBLETSIP_DESCRIPTION,
+ TRIMBLETSIP_FORMAT,
+ GPS_TYPE,
+ TRIMBLETSIP_MAXUNSYNC,
+ TRIMBLETSIP_SPEED,
+ TRIMBLETSIP_CFLAG,
+ TRIMBLETSIP_IFLAG,
+ TRIMBLETSIP_OFLAG,
+ TRIMBLETSIP_LFLAG,
+ TRIMBLETSIP_SAMPLES,
+ TRIMBLETSIP_KEEP
+ },
+ { /* mode 11 */
+ NO_CL_FLAGS,
+ RCC8000_POLL,
+ RCC8000_INIT,
+ NO_EVENT,
+ RCC8000_END,
+ NO_MESSAGE,
+ RCC8000_DATA,
+ RCC8000_ROOTDELAY,
+ RCC8000_BASEDELAY,
+ RCC8000_ID,
+ RCC8000_DESCRIPTION,
+ RCC8000_FORMAT,
+ DCF_TYPE,
+ RCC8000_MAXUNSYNC,
+ RCC8000_SPEED,
+ RCC8000_CFLAG,
+ RCC8000_IFLAG,
+ RCC8000_OFLAG,
+ RCC8000_LFLAG,
+ RCC8000_SAMPLES,
+ RCC8000_KEEP
+ },
+ { /* mode 12 */
+ HOPF6021_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ HOPF6021_ROOTDELAY,
+ HOPF6021_BASEDELAY,
+ DCF_ID,
+ HOPF6021_DESCRIPTION,
+ HOPF6021_FORMAT,
+ DCF_TYPE,
+ HOPF6021_MAXUNSYNC,
+ HOPF6021_SPEED,
+ HOPF6021_CFLAG,
+ HOPF6021_IFLAG,
+ HOPF6021_OFLAG,
+ HOPF6021_LFLAG,
+ HOPF6021_SAMPLES,
+ HOPF6021_KEEP
+ },
+ { /* mode 13 */
+ COMPUTIME_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ COMPUTIME_ROOTDELAY,
+ COMPUTIME_BASEDELAY,
+ COMPUTIME_ID,
+ COMPUTIME_DESCRIPTION,
+ COMPUTIME_FORMAT,
+ COMPUTIME_TYPE,
+ COMPUTIME_MAXUNSYNC,
+ COMPUTIME_SPEED,
+ COMPUTIME_CFLAG,
+ COMPUTIME_IFLAG,
+ COMPUTIME_OFLAG,
+ COMPUTIME_LFLAG,
+ COMPUTIME_SAMPLES,
+ COMPUTIME_KEEP
+ },
+ { /* mode 14 */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCFDTRSET_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ RAWDCF_BASEDELAY,
+ DCF_A_ID,
+ RAWDCFDTRSET_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ RAWDCF_SPEED,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 15 */
+ 0, /* operation flags (io modes) */
+ NO_POLL, /* active poll routine */
+ NO_INIT, /* active poll init routine */
+ NO_EVENT, /* special event handling (e.g. reset clock) */
+ NO_END, /* active poll end routine */
+ NO_MESSAGE, /* process a lower layer message */
+ NO_LCLDATA, /* local data area for "poll" mechanism */
+ 0, /* rootdelay */
+ 11.0 /* bits */ / 9600, /* current offset by which the RS232
+ time code is delayed from the actual time */
+ DCF_ID, /* ID code */
+ "WHARTON 400A Series clock", /* device name */
+ "WHARTON 400A Series clock Output Format 1", /* fixed format */
+ /* Must match a format-name in a libparse/clk_xxx.c file */
+ DCF_TYPE, /* clock type (ntp control) */
+ (1*60*60), /* time to trust oscillator after losing synch */
+ B9600, /* terminal input & output baudrate */
+ (CS8|CREAD|PARENB|CLOCAL|HUPCL),/* terminal control flags */
+ 0, /* terminal input flags */
+ 0, /* terminal output flags */
+ 0, /* terminal local flags */
+ 5, /* samples for median filter */
+ 3, /* samples for median filter to keep */
+ },
+ { /* mode 16 - RAWDCF RTS set, DTR clr */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCFDTRCLRRTSSET_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ RAWDCF_BASEDELAY,
+ DCF_A_ID,
+ RAWDCFDTRCLRRTSSET_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ RAWDCF_SPEED,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 17 */
+ VARITEXT_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ VARITEXT_ROOTDELAY,
+ VARITEXT_BASEDELAY,
+ VARITEXT_ID,
+ VARITEXT_DESCRIPTION,
+ VARITEXT_FORMAT,
+ VARITEXT_TYPE,
+ VARITEXT_MAXUNSYNC,
+ VARITEXT_SPEED,
+ VARITEXT_CFLAG,
+ VARITEXT_IFLAG,
+ VARITEXT_OFLAG,
+ VARITEXT_LFLAG,
+ VARITEXT_SAMPLES,
+ VARITEXT_KEEP
+ },
+ { /* mode 18 */
+ MBG_FLAGS,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ GPS16X_END,
+ GPS16X_MESSAGE,
+ GPS16X_DATA,
+ GPS16X_ROOTDELAY,
+ GPS16X_BASEDELAY,
+ GPS16X_ID,
+ GPS16X_DESCRIPTION,
+ GPS16X_FORMAT,
+ GPS_TYPE,
+ GPS16X_MAXUNSYNC,
+ GPS16X_SPEED,
+ GPS16X_CFLAG,
+ GPS16X_IFLAG,
+ GPS16X_OFLAG,
+ GPS16X_LFLAG,
+ GPS16X_SAMPLES,
+ GPS16X_KEEP
+ },
+ { /* mode 19 */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCF_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ GUDE_EMC_USB_V20_BASEDELAY,
+ DCF_A_ID,
+ GUDE_EMC_USB_V20_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ GUDE_EMC_USB_V20_SPEED,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 20, like mode 14 but driven by 75 baud */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCFDTRSET_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ RAWDCF_BASEDELAY,
+ DCF_A_ID,
+ RAWDCFDTRSET75_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ B75,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 21, like mode 16 but driven by 75 baud
+ - RAWDCF RTS set, DTR clr */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCFDTRCLRRTSSET_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ RAWDCF_ROOTDELAY,
+ RAWDCF_BASEDELAY,
+ DCF_A_ID,
+ RAWDCFDTRCLRRTSSET75_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ B75,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 22 - like 2 with POWERUP trust */
+ MBG_FLAGS | PARSE_F_POWERUPTRUST,
+ NO_POLL,
+ NO_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_LCLDATA,
+ DCFUA31_ROOTDELAY,
+ DCFUA31_BASEDELAY,
+ DCF_A_ID,
+ DCFUA31_DESCRIPTION,
+ DCFUA31_FORMAT,
+ DCF_TYPE,
+ DCFUA31_MAXUNSYNC,
+ DCFUA31_SPEED,
+ DCFUA31_CFLAG,
+ DCFUA31_IFLAG,
+ DCFUA31_OFLAG,
+ DCFUA31_LFLAG,
+ DCFUA31_SAMPLES,
+ DCFUA31_KEEP
+ },
+ { /* mode 23 - like 7 with POWERUP trust */
+ MBG_FLAGS | PARSE_F_POWERUPTRUST,
+ GPS16X_POLL,
+ GPS16X_INIT,
+ NO_EVENT,
+ GPS16X_END,
+ GPS16X_MESSAGE,
+ GPS16X_DATA,
+ GPS16X_ROOTDELAY,
+ GPS16X_BASEDELAY,
+ GPS16X_ID,
+ GPS16X_DESCRIPTION,
+ GPS16X_FORMAT,
+ GPS_TYPE,
+ GPS16X_MAXUNSYNC,
+ GPS16X_SPEED,
+ GPS16X_CFLAG,
+ GPS16X_IFLAG,
+ GPS16X_OFLAG,
+ GPS16X_LFLAG,
+ GPS16X_SAMPLES,
+ GPS16X_KEEP
+ },
+ { /* mode 24 */
+ SEL240X_FLAGS,
+ SEL240X_POLL,
+ SEL240X_INIT,
+ NO_EVENT,
+ SEL240X_END,
+ NO_MESSAGE,
+ SEL240X_DATA,
+ SEL240X_ROOTDELAY,
+ SEL240X_BASEDELAY,
+ SEL240X_ID,
+ SEL240X_DESCRIPTION,
+ SEL240X_FORMAT,
+ GPS_TYPE,
+ SEL240X_MAXUNSYNC,
+ SEL240X_SPEED,
+ SEL240X_CFLAG,
+ SEL240X_IFLAG,
+ SEL240X_OFLAG,
+ SEL240X_LFLAG,
+ SEL240X_SAMPLES,
+ SEL240X_KEEP
+ },
+};
+
+static int ncltypes = sizeof(parse_clockinfo) / sizeof(struct parse_clockinfo);
+
+#define CLK_REALTYPE(x) ((int)(((x)->ttl) & 0x7F))
+#define CLK_TYPE(x) ((CLK_REALTYPE(x) >= ncltypes) ? ~0 : CLK_REALTYPE(x))
+#define CLK_UNIT(x) ((int)REFCLOCKUNIT(&(x)->srcadr))
+#define CLK_PPS(x) (((x)->ttl) & 0x80)
+
+/*
+ * Other constant stuff
+ */
+#define PARSEHSREFID 0x7f7f08ff /* 127.127.8.255 refid for hi strata */
+
+#define PARSESTATISTICS (60*60) /* output state statistics every hour */
+
+static int notice = 0;
+
+#define PARSE_STATETIME(parse, i) ((parse->generic->currentstatus == i) ? parse->statetime[i] + current_time - parse->lastchange : parse->statetime[i])
+
+static void parse_event (struct parseunit *, int);
+static void parse_process (struct parseunit *, parsetime_t *);
+static void clear_err (struct parseunit *, u_long);
+static int list_err (struct parseunit *, u_long);
+static char * l_mktime (u_long);
+
+/**===========================================================================
+ ** implementation error message regression module
+ **/
+static void
+clear_err(
+ struct parseunit *parse,
+ u_long lstate
+ )
+{
+ if (lstate == ERR_ALL)
+ {
+ int i;
+
+ for (i = 0; i < ERR_CNT; i++)
+ {
+ parse->errors[i].err_stage = err_tbl[i];
+ parse->errors[i].err_cnt = 0;
+ parse->errors[i].err_last = 0;
+ parse->errors[i].err_started = 0;
+ parse->errors[i].err_suppressed = 0;
+ }
+ }
+ else
+ {
+ parse->errors[lstate].err_stage = err_tbl[lstate];
+ parse->errors[lstate].err_cnt = 0;
+ parse->errors[lstate].err_last = 0;
+ parse->errors[lstate].err_started = 0;
+ parse->errors[lstate].err_suppressed = 0;
+ }
+}
+
+static int
+list_err(
+ struct parseunit *parse,
+ u_long lstate
+ )
+{
+ int do_it;
+ struct errorinfo *err = &parse->errors[lstate];
+
+ if (err->err_started == 0)
+ {
+ err->err_started = current_time;
+ }
+
+ do_it = (current_time - err->err_last) >= err->err_stage->err_delay;
+
+ if (do_it)
+ err->err_cnt++;
+
+ if (err->err_stage->err_count &&
+ (err->err_cnt >= err->err_stage->err_count))
+ {
+ err->err_stage++;
+ err->err_cnt = 0;
+ }
+
+ if (!err->err_cnt && do_it)
+ msyslog(LOG_INFO, "PARSE receiver #%d: interval for following error message class is at least %s",
+ CLK_UNIT(parse->peer), l_mktime(err->err_stage->err_delay));
+
+ if (!do_it)
+ err->err_suppressed++;
+ else
+ err->err_last = current_time;
+
+ if (do_it && err->err_suppressed)
+ {
+ msyslog(LOG_INFO, "PARSE receiver #%d: %ld message%s suppressed, error condition class persists for %s",
+ CLK_UNIT(parse->peer), err->err_suppressed, (err->err_suppressed == 1) ? " was" : "s where",
+ l_mktime(current_time - err->err_started));
+ err->err_suppressed = 0;
+ }
+
+ return do_it;
+}
+
+/*--------------------------------------------------
+ * mkreadable - make a printable ascii string (without
+ * embedded quotes so that the ntpq protocol isn't
+ * fooled
+ */
+#ifndef isprint
+#define isprint(_X_) (((_X_) > 0x1F) && ((_X_) < 0x7F))
+#endif
+
+static char *
+mkreadable(
+ char *buffer,
+ long blen,
+ const char *src,
+ u_long srclen,
+ int hex
+ )
+{
+ static const char ellipsis[] = "...";
+ char *b = buffer;
+ char *endb = NULL;
+
+ if (blen < 4)
+ return NULL; /* don't bother with mini buffers */
+
+ endb = buffer + blen - sizeof(ellipsis);
+
+ blen--; /* account for '\0' */
+
+ while (blen && srclen--)
+ {
+ if (!hex && /* no binary only */
+ (*src != '\\') && /* no plain \ */
+ (*src != '"') && /* no " */
+ isprint((int)*src)) /* only printables */
+ { /* they are easy... */
+ *buffer++ = *src++;
+ blen--;
+ }
+ else
+ {
+ if (blen < 4)
+ {
+ while (blen--)
+ {
+ *buffer++ = '.';
+ }
+ *buffer = '\0';
+ return b;
+ }
+ else
+ {
+ if (*src == '\\')
+ {
+ memcpy(buffer, "\\\\", 2);
+ buffer += 2;
+ blen -= 2;
+ src++;
+ }
+ else
+ {
+ snprintf(buffer, blen, "\\x%02x", *src++);
+ blen -= 4;
+ buffer += 4;
+ }
+ }
+ }
+ if (srclen && !blen && endb) /* overflow - set last chars to ... */
+ memcpy(endb, ellipsis, sizeof(ellipsis));
+ }
+
+ *buffer = '\0';
+ return b;
+}
+
+
+/*--------------------------------------------------
+ * mkascii - make a printable ascii string
+ * assumes (unless defined better) 7-bit ASCII
+ */
+static char *
+mkascii(
+ char *buffer,
+ long blen,
+ const char *src,
+ u_long srclen
+ )
+{
+ return mkreadable(buffer, blen, src, srclen, 0);
+}
+
+/**===========================================================================
+ ** implementation of i/o handling methods
+ ** (all STREAM, partial STREAM, user level)
+ **/
+
+/*
+ * define possible io handling methods
+ */
+#ifdef STREAM
+static int ppsclock_init (struct parseunit *);
+static int stream_init (struct parseunit *);
+static void stream_end (struct parseunit *);
+static int stream_enable (struct parseunit *);
+static int stream_disable (struct parseunit *);
+static int stream_setcs (struct parseunit *, parsectl_t *);
+static int stream_getfmt (struct parseunit *, parsectl_t *);
+static int stream_setfmt (struct parseunit *, parsectl_t *);
+static int stream_timecode (struct parseunit *, parsectl_t *);
+static void stream_receive (struct recvbuf *);
+#endif
+
+static int local_init (struct parseunit *);
+static void local_end (struct parseunit *);
+static int local_nop (struct parseunit *);
+static int local_setcs (struct parseunit *, parsectl_t *);
+static int local_getfmt (struct parseunit *, parsectl_t *);
+static int local_setfmt (struct parseunit *, parsectl_t *);
+static int local_timecode (struct parseunit *, parsectl_t *);
+static void local_receive (struct recvbuf *);
+static int local_input (struct recvbuf *);
+
+static bind_t io_bindings[] =
+{
+#ifdef STREAM
+ {
+ "parse STREAM",
+ stream_init,
+ stream_end,
+ stream_setcs,
+ stream_disable,
+ stream_enable,
+ stream_getfmt,
+ stream_setfmt,
+ stream_timecode,
+ stream_receive,
+ 0,
+ },
+ {
+ "ppsclock STREAM",
+ ppsclock_init,
+ local_end,
+ local_setcs,
+ local_nop,
+ local_nop,
+ local_getfmt,
+ local_setfmt,
+ local_timecode,
+ local_receive,
+ local_input,
+ },
+#endif
+ {
+ "normal",
+ local_init,
+ local_end,
+ local_setcs,
+ local_nop,
+ local_nop,
+ local_getfmt,
+ local_setfmt,
+ local_timecode,
+ local_receive,
+ local_input,
+ },
+ {
+ (char *)0,
+ }
+};
+
+#ifdef STREAM
+
+/*--------------------------------------------------
+ * ppsclock STREAM init
+ */
+static int
+ppsclock_init(
+ struct parseunit *parse
+ )
+{
+ static char m1[] = "ppsclocd";
+ static char m2[] = "ppsclock";
+
+ /*
+ * now push the parse streams module
+ * it will ensure exclusive access to the device
+ */
+ if (ioctl(parse->ppsfd, I_PUSH, (caddr_t)m1) == -1 &&
+ ioctl(parse->ppsfd, I_PUSH, (caddr_t)m2) == -1)
+ {
+ if (errno != EINVAL)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: ppsclock_init: ioctl(fd, I_PUSH, \"ppsclock\"): %m",
+ CLK_UNIT(parse->peer));
+ }
+ return 0;
+ }
+ if (!local_init(parse))
+ {
+ (void)ioctl(parse->ppsfd, I_POP, (caddr_t)0);
+ return 0;
+ }
+
+ parse->flags |= PARSE_PPSCLOCK;
+ return 1;
+}
+
+/*--------------------------------------------------
+ * parse STREAM init
+ */
+static int
+stream_init(
+ struct parseunit *parse
+ )
+{
+ static char m1[] = "parse";
+ /*
+ * now push the parse streams module
+ * to test whether it is there (neat interface 8-( )
+ */
+ if (ioctl(parse->generic->io.fd, I_PUSH, (caddr_t)m1) == -1)
+ {
+ if (errno != EINVAL) /* accept non-existence */
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_init: ioctl(fd, I_PUSH, \"parse\"): %m", CLK_UNIT(parse->peer));
+ }
+ return 0;
+ }
+ else
+ {
+ while(ioctl(parse->generic->io.fd, I_POP, (caddr_t)0) == 0)
+ /* empty loop */;
+
+ /*
+ * now push it a second time after we have removed all
+ * module garbage
+ */
+ if (ioctl(parse->generic->io.fd, I_PUSH, (caddr_t)m1) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_init: ioctl(fd, I_PUSH, \"parse\"): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+ }
+}
+
+/*--------------------------------------------------
+ * parse STREAM end
+ */
+static void
+stream_end(
+ struct parseunit *parse
+ )
+{
+ while(ioctl(parse->generic->io.fd, I_POP, (caddr_t)0) == 0)
+ /* empty loop */;
+}
+
+/*--------------------------------------------------
+ * STREAM setcs
+ */
+static int
+stream_setcs(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ struct strioctl strioc;
+
+ strioc.ic_cmd = PARSEIOC_SETCS;
+ strioc.ic_timout = 0;
+ strioc.ic_dp = (char *)tcl;
+ strioc.ic_len = sizeof (*tcl);
+
+ if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_setcs: ioctl(fd, I_STR, PARSEIOC_SETCS): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ return 1;
+}
+
+/*--------------------------------------------------
+ * STREAM enable
+ */
+static int
+stream_enable(
+ struct parseunit *parse
+ )
+{
+ struct strioctl strioc;
+
+ strioc.ic_cmd = PARSEIOC_ENABLE;
+ strioc.ic_timout = 0;
+ strioc.ic_dp = (char *)0;
+ strioc.ic_len = 0;
+
+ if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_enable: ioctl(fd, I_STR, PARSEIOC_ENABLE): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ parse->generic->io.clock_recv = stream_receive; /* ok - parse input in kernel */
+ return 1;
+}
+
+/*--------------------------------------------------
+ * STREAM disable
+ */
+static int
+stream_disable(
+ struct parseunit *parse
+ )
+{
+ struct strioctl strioc;
+
+ strioc.ic_cmd = PARSEIOC_DISABLE;
+ strioc.ic_timout = 0;
+ strioc.ic_dp = (char *)0;
+ strioc.ic_len = 0;
+
+ if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_disable: ioctl(fd, I_STR, PARSEIOC_DISABLE): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ parse->generic->io.clock_recv = local_receive; /* ok - parse input in daemon */
+ return 1;
+}
+
+/*--------------------------------------------------
+ * STREAM getfmt
+ */
+static int
+stream_getfmt(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ struct strioctl strioc;
+
+ strioc.ic_cmd = PARSEIOC_GETFMT;
+ strioc.ic_timout = 0;
+ strioc.ic_dp = (char *)tcl;
+ strioc.ic_len = sizeof (*tcl);
+ if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: ioctl(fd, I_STR, PARSEIOC_GETFMT): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ return 1;
+}
+
+/*--------------------------------------------------
+ * STREAM setfmt
+ */
+static int
+stream_setfmt(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ struct strioctl strioc;
+
+ strioc.ic_cmd = PARSEIOC_SETFMT;
+ strioc.ic_timout = 0;
+ strioc.ic_dp = (char *)tcl;
+ strioc.ic_len = sizeof (*tcl);
+
+ if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_setfmt: ioctl(fd, I_STR, PARSEIOC_SETFMT): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ return 1;
+}
+
+
+/*--------------------------------------------------
+ * STREAM timecode
+ */
+static int
+stream_timecode(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ struct strioctl strioc;
+
+ strioc.ic_cmd = PARSEIOC_TIMECODE;
+ strioc.ic_timout = 0;
+ strioc.ic_dp = (char *)tcl;
+ strioc.ic_len = sizeof (*tcl);
+
+ if (ioctl(parse->generic->io.fd, I_STR, (caddr_t)&strioc) == -1)
+ {
+ ERR(ERR_INTERNAL)
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_timecode: ioctl(fd, I_STR, PARSEIOC_TIMECODE): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ clear_err(parse, ERR_INTERNAL);
+ return 1;
+}
+
+/*--------------------------------------------------
+ * STREAM receive
+ */
+static void
+stream_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct parseunit * parse;
+ parsetime_t parsetime;
+
+ parse = (struct parseunit *)rbufp->recv_peer->procptr->unitptr;
+ if (!parse->peer)
+ return;
+
+ if (rbufp->recv_length != sizeof(parsetime_t))
+ {
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR,"PARSE receiver #%d: stream_receive: bad size (got %d expected %d)",
+ CLK_UNIT(parse->peer), rbufp->recv_length, (int)sizeof(parsetime_t));
+ parse_event(parse, CEVNT_BADREPLY);
+ return;
+ }
+ clear_err(parse, ERR_BADIO);
+
+ memmove((caddr_t)&parsetime,
+ (caddr_t)rbufp->recv_buffer,
+ sizeof(parsetime_t));
+
+#ifdef DEBUG
+ if (debug > 3)
+ {
+ printf("PARSE receiver #%d: status %06x, state %08x, time %lx.%08lx, stime %lx.%08lx, ptime %lx.%08lx\n",
+ CLK_UNIT(parse->peer),
+ (unsigned int)parsetime.parse_status,
+ (unsigned int)parsetime.parse_state,
+ (unsigned long)parsetime.parse_time.tv.tv_sec,
+ (unsigned long)parsetime.parse_time.tv.tv_usec,
+ (unsigned long)parsetime.parse_stime.tv.tv_sec,
+ (unsigned long)parsetime.parse_stime.tv.tv_usec,
+ (unsigned long)parsetime.parse_ptime.tv.tv_sec,
+ (unsigned long)parsetime.parse_ptime.tv.tv_usec);
+ }
+#endif
+
+ /*
+ * switch time stamp world - be sure to normalize small usec field
+ * errors.
+ */
+
+ parsetime.parse_stime.fp = tval_stamp_to_lfp(parsetime.parse_stime.tv);
+
+ if (PARSE_TIMECODE(parsetime.parse_state))
+ {
+ parsetime.parse_time.fp = tval_stamp_to_lfp(parsetime.parse_time.tv);
+ }
+
+ if (PARSE_PPS(parsetime.parse_state))
+ {
+ parsetime.parse_ptime.fp = tval_stamp_to_lfp(parsetime.parse_ptime.tv);
+ }
+
+ parse_process(parse, &parsetime);
+}
+#endif
+
+/*--------------------------------------------------
+ * local init
+ */
+static int
+local_init(
+ struct parseunit *parse
+ )
+{
+ return parse_ioinit(&parse->parseio);
+}
+
+/*--------------------------------------------------
+ * local end
+ */
+static void
+local_end(
+ struct parseunit *parse
+ )
+{
+ parse_ioend(&parse->parseio);
+}
+
+
+/*--------------------------------------------------
+ * local nop
+ */
+static int
+local_nop(
+ struct parseunit *parse
+ )
+{
+ return 1;
+}
+
+/*--------------------------------------------------
+ * local setcs
+ */
+static int
+local_setcs(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ return parse_setcs(tcl, &parse->parseio);
+}
+
+/*--------------------------------------------------
+ * local getfmt
+ */
+static int
+local_getfmt(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ return parse_getfmt(tcl, &parse->parseio);
+}
+
+/*--------------------------------------------------
+ * local setfmt
+ */
+static int
+local_setfmt(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ return parse_setfmt(tcl, &parse->parseio);
+}
+
+/*--------------------------------------------------
+ * local timecode
+ */
+static int
+local_timecode(
+ struct parseunit *parse,
+ parsectl_t *tcl
+ )
+{
+ return parse_timecode(tcl, &parse->parseio);
+}
+
+
+/*--------------------------------------------------
+ * local input
+ */
+static int
+local_input(
+ struct recvbuf *rbufp
+ )
+{
+ struct parseunit * parse;
+
+ int count;
+ unsigned char *s;
+ timestamp_t ts;
+
+ parse = (struct parseunit *)rbufp->recv_peer->procptr->unitptr;
+ if (!parse->peer)
+ return 0;
+
+ /*
+ * eat all characters, parsing then and feeding complete samples
+ */
+ count = rbufp->recv_length;
+ s = (unsigned char *)rbufp->recv_buffer;
+ ts.fp = rbufp->recv_time;
+
+ while (count--)
+ {
+ if (parse_ioread(&parse->parseio, (unsigned int)(*s++), &ts))
+ {
+ struct recvbuf *buf;
+
+ /*
+ * got something good to eat
+ */
+ if (!PARSE_PPS(parse->parseio.parse_dtime.parse_state))
+ {
+#ifdef HAVE_PPSAPI
+ if (parse->flags & PARSE_PPSCLOCK)
+ {
+ struct timespec pps_timeout;
+ pps_info_t pps_info;
+
+ pps_timeout.tv_sec = 0;
+ pps_timeout.tv_nsec = 0;
+
+ if (time_pps_fetch(parse->atom.handle, PPS_TSFMT_TSPEC, &pps_info,
+ &pps_timeout) == 0)
+ {
+ if (pps_info.assert_sequence + pps_info.clear_sequence != parse->ppsserial)
+ {
+ double dtemp;
+
+ struct timespec pts;
+ /*
+ * add PPS time stamp if available via ppsclock module
+ * and not supplied already.
+ */
+ if (parse->flags & PARSE_CLEAR)
+ pts = pps_info.clear_timestamp;
+ else
+ pts = pps_info.assert_timestamp;
+
+ parse->parseio.parse_dtime.parse_ptime.fp.l_ui = pts.tv_sec + JAN_1970;
+
+ dtemp = pts.tv_nsec / 1e9;
+ if (dtemp < 0.) {
+ dtemp += 1;
+ parse->parseio.parse_dtime.parse_ptime.fp.l_ui--;
+ }
+ if (dtemp > 1.) {
+ dtemp -= 1;
+ parse->parseio.parse_dtime.parse_ptime.fp.l_ui++;
+ }
+ parse->parseio.parse_dtime.parse_ptime.fp.l_uf = dtemp * FRAC;
+
+ parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+#ifdef DEBUG
+ if (debug > 3)
+ {
+ printf(
+ "parse: local_receive: fd %d PPSAPI seq %ld - PPS %s\n",
+ rbufp->fd,
+ (long)pps_info.assert_sequence + (long)pps_info.clear_sequence,
+ lfptoa(&parse->parseio.parse_dtime.parse_ptime.fp, 6));
+ }
+#endif
+ }
+#ifdef DEBUG
+ else
+ {
+ if (debug > 3)
+ {
+ printf(
+ "parse: local_receive: fd %d PPSAPI seq assert %ld, seq clear %ld - NO PPS event\n",
+ rbufp->fd,
+ (long)pps_info.assert_sequence, (long)pps_info.clear_sequence);
+ }
+ }
+#endif
+ parse->ppsserial = pps_info.assert_sequence + pps_info.clear_sequence;
+ }
+#ifdef DEBUG
+ else
+ {
+ if (debug > 3)
+ {
+ printf(
+ "parse: local_receive: fd %d PPSAPI time_pps_fetch errno = %d\n",
+ rbufp->fd,
+ errno);
+ }
+ }
+#endif
+ }
+#else
+#ifdef TIOCDCDTIMESTAMP
+ struct timeval dcd_time;
+
+ if (ioctl(parse->ppsfd, TIOCDCDTIMESTAMP, &dcd_time) != -1)
+ {
+ l_fp tstmp;
+
+ TVTOTS(&dcd_time, &tstmp);
+ tstmp.l_ui += JAN_1970;
+ L_SUB(&ts.fp, &tstmp);
+ if (ts.fp.l_ui == 0)
+ {
+#ifdef DEBUG
+ if (debug)
+ {
+ printf(
+ "parse: local_receive: fd %d DCDTIMESTAMP %s\n",
+ parse->ppsfd,
+ lfptoa(&tstmp, 6));
+ printf(" sigio %s\n",
+ lfptoa(&ts.fp, 6));
+ }
+#endif
+ parse->parseio.parse_dtime.parse_ptime.fp = tstmp;
+ parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+ }
+ }
+#else /* TIOCDCDTIMESTAMP */
+#if defined(HAVE_STRUCT_PPSCLOCKEV) && (defined(HAVE_CIOGETEV) || defined(HAVE_TIOCGPPSEV))
+ if (parse->flags & PARSE_PPSCLOCK)
+ {
+ l_fp tts;
+ struct ppsclockev ev;
+
+#ifdef HAVE_CIOGETEV
+ if (ioctl(parse->ppsfd, CIOGETEV, (caddr_t)&ev) == 0)
+#endif
+#ifdef HAVE_TIOCGPPSEV
+ if (ioctl(parse->ppsfd, TIOCGPPSEV, (caddr_t)&ev) == 0)
+#endif
+ {
+ if (ev.serial != parse->ppsserial)
+ {
+ /*
+ * add PPS time stamp if available via ppsclock module
+ * and not supplied already.
+ */
+ if (!buftvtots((const char *)&ev.tv, &tts))
+ {
+ ERR(ERR_BADDATA)
+ msyslog(LOG_ERR,"parse: local_receive: timestamp conversion error (buftvtots) (ppsclockev.tv)");
+ }
+ else
+ {
+ parse->parseio.parse_dtime.parse_ptime.fp = tts;
+ parse->parseio.parse_dtime.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+ }
+ }
+ parse->ppsserial = ev.serial;
+ }
+ }
+#endif
+#endif /* TIOCDCDTIMESTAMP */
+#endif /* !HAVE_PPSAPI */
+ }
+ if (count)
+ { /* simulate receive */
+ buf = get_free_recv_buffer();
+ if (buf != NULL) {
+ memmove((caddr_t)buf->recv_buffer,
+ (caddr_t)&parse->parseio.parse_dtime,
+ sizeof(parsetime_t));
+ buf->recv_length = sizeof(parsetime_t);
+ buf->recv_time = rbufp->recv_time;
+#ifndef HAVE_IO_COMPLETION_PORT
+ buf->srcadr = rbufp->srcadr;
+#endif
+ buf->dstadr = rbufp->dstadr;
+ buf->receiver = rbufp->receiver;
+ buf->fd = rbufp->fd;
+ buf->X_from_where = rbufp->X_from_where;
+ parse->generic->io.recvcount++;
+ packets_received++;
+ add_full_recv_buffer(buf);
+#ifdef HAVE_IO_COMPLETION_PORT
+ SetEvent(WaitableIoEventHandle);
+#endif
+ }
+ parse_iodone(&parse->parseio);
+ }
+ else
+ {
+ memmove((caddr_t)rbufp->recv_buffer,
+ (caddr_t)&parse->parseio.parse_dtime,
+ sizeof(parsetime_t));
+ parse_iodone(&parse->parseio);
+ rbufp->recv_length = sizeof(parsetime_t);
+ return 1; /* got something & in place return */
+ }
+ }
+ }
+ return 0; /* nothing to pass up */
+}
+
+/*--------------------------------------------------
+ * local receive
+ */
+static void
+local_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct parseunit * parse;
+ parsetime_t parsetime;
+
+ parse = (struct parseunit *)rbufp->recv_peer->procptr->unitptr;
+ if (!parse->peer)
+ return;
+
+ if (rbufp->recv_length != sizeof(parsetime_t))
+ {
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR,"PARSE receiver #%d: local_receive: bad size (got %d expected %d)",
+ CLK_UNIT(parse->peer), rbufp->recv_length, (int)sizeof(parsetime_t));
+ parse_event(parse, CEVNT_BADREPLY);
+ return;
+ }
+ clear_err(parse, ERR_BADIO);
+
+ memmove((caddr_t)&parsetime,
+ (caddr_t)rbufp->recv_buffer,
+ sizeof(parsetime_t));
+
+#ifdef DEBUG
+ if (debug > 3)
+ {
+ printf("PARSE receiver #%d: status %06x, state %08x, time(fp) %lx.%08lx, stime(fp) %lx.%08lx, ptime(fp) %lx.%08lx\n",
+ CLK_UNIT(parse->peer),
+ (unsigned int)parsetime.parse_status,
+ (unsigned int)parsetime.parse_state,
+ (unsigned long)parsetime.parse_time.fp.l_ui,
+ (unsigned long)parsetime.parse_time.fp.l_uf,
+ (unsigned long)parsetime.parse_stime.fp.l_ui,
+ (unsigned long)parsetime.parse_stime.fp.l_uf,
+ (unsigned long)parsetime.parse_ptime.fp.l_ui,
+ (unsigned long)parsetime.parse_ptime.fp.l_uf);
+ }
+#endif
+
+ parse_process(parse, &parsetime);
+}
+
+/*--------------------------------------------------
+ * init_iobinding - find and initialize lower layers
+ */
+static bind_t *
+init_iobinding(
+ struct parseunit *parse
+ )
+{
+ bind_t *b = io_bindings;
+
+ while (b->bd_description != (char *)0)
+ {
+ if ((*b->bd_init)(parse))
+ {
+ return b;
+ }
+ b++;
+ }
+ return (bind_t *)0;
+}
+
+/**===========================================================================
+ ** support routines
+ **/
+
+/*--------------------------------------------------
+ * convert a flag field to a string
+ */
+static char *
+parsestate(
+ u_long lstate,
+ char *buffer,
+ int size
+ )
+{
+ static struct bits
+ {
+ u_long bit;
+ const char *name;
+ } flagstrings[] =
+ {
+ { PARSEB_ANNOUNCE, "DST SWITCH WARNING" },
+ { PARSEB_POWERUP, "NOT SYNCHRONIZED" },
+ { PARSEB_NOSYNC, "TIME CODE NOT CONFIRMED" },
+ { PARSEB_DST, "DST" },
+ { PARSEB_UTC, "UTC DISPLAY" },
+ { PARSEB_LEAPADD, "LEAP ADD WARNING" },
+ { PARSEB_LEAPDEL, "LEAP DELETE WARNING" },
+ { PARSEB_LEAPSECOND, "LEAP SECOND" },
+ { PARSEB_ALTERNATE, "ALTERNATE ANTENNA" },
+ { PARSEB_TIMECODE, "TIME CODE" },
+ { PARSEB_PPS, "PPS" },
+ { PARSEB_POSITION, "POSITION" },
+ { 0 }
+ };
+
+ static struct sbits
+ {
+ u_long bit;
+ const char *name;
+ } sflagstrings[] =
+ {
+ { PARSEB_S_LEAP, "LEAP INDICATION" },
+ { PARSEB_S_PPS, "PPS SIGNAL" },
+ { PARSEB_S_ANTENNA, "ANTENNA" },
+ { PARSEB_S_POSITION, "POSITION" },
+ { 0 }
+ };
+ int i;
+ char *s, *t;
+
+
+ *buffer = '\0';
+ s = t = buffer;
+
+ i = 0;
+ while (flagstrings[i].bit)
+ {
+ if (flagstrings[i].bit & lstate)
+ {
+ if (s != t)
+ strlcpy(t, "; ", BUFFER_SIZES(buffer, t, size));
+ if (strlcat(t, flagstrings[i].name, BUFFER_SIZES(buffer, t, size)) <
+ BUFFER_SIZES(buffer, t, size))
+ t += strlen(t);
+ }
+ i++;
+ }
+
+ if (lstate & (PARSEB_S_LEAP|PARSEB_S_ANTENNA|PARSEB_S_PPS|PARSEB_S_POSITION))
+ {
+ if (s != t &&
+ strlcpy(t, "; ", BUFFER_SIZES(buffer, t, size)) <
+ BUFFER_SIZES(buffer, t, size))
+ t += strlen(t);
+
+ if (strlcpy(t, "(", BUFFER_SIZES(buffer, t, size)) <
+ BUFFER_SIZES(buffer, t, size))
+ s = t = t + strlen(t);
+
+ i = 0;
+ while (sflagstrings[i].bit)
+ {
+ if (sflagstrings[i].bit & lstate)
+ {
+ if (t != s &&
+ strlcpy(t, "; ", BUFFER_SIZES(buffer, t, size)) <
+ BUFFER_SIZES(buffer, t, size))
+ t += 2;
+
+ if (strlcpy(t, sflagstrings[i].name, BUFFER_SIZES(buffer, t, size)) <
+ BUFFER_SIZES(buffer, t, size))
+ t += strlen(t);
+ }
+ i++;
+ }
+ strlcpy(t, ")", BUFFER_SIZES(buffer, t, size));
+ }
+ return buffer;
+}
+
+/*--------------------------------------------------
+ * convert a status flag field to a string
+ */
+static char *
+parsestatus(
+ u_long lstate,
+ char *buffer,
+ int size
+ )
+{
+ static struct bits
+ {
+ u_long bit;
+ const char *name;
+ } flagstrings[] =
+ {
+ { CVT_OK, "CONVERSION SUCCESSFUL" },
+ { CVT_NONE, "NO CONVERSION" },
+ { CVT_FAIL, "CONVERSION FAILED" },
+ { CVT_BADFMT, "ILLEGAL FORMAT" },
+ { CVT_BADDATE, "DATE ILLEGAL" },
+ { CVT_BADTIME, "TIME ILLEGAL" },
+ { CVT_ADDITIONAL, "ADDITIONAL DATA" },
+ { 0 }
+ };
+ int i;
+
+ *buffer = '\0';
+
+ i = 0;
+ while (flagstrings[i].bit)
+ {
+ if (flagstrings[i].bit & lstate)
+ {
+ if (buffer[0])
+ strlcat(buffer, "; ", size);
+ strlcat(buffer, flagstrings[i].name, size);
+ }
+ i++;
+ }
+
+ return buffer;
+}
+
+/*--------------------------------------------------
+ * convert a clock status flag field to a string
+ */
+static const char *
+clockstatus(
+ u_long lstate
+ )
+{
+ static char buffer[20];
+ static struct status
+ {
+ u_long value;
+ const char *name;
+ } flagstrings[] =
+ {
+ { CEVNT_NOMINAL, "NOMINAL" },
+ { CEVNT_TIMEOUT, "NO RESPONSE" },
+ { CEVNT_BADREPLY,"BAD FORMAT" },
+ { CEVNT_FAULT, "FAULT" },
+ { CEVNT_PROP, "PROPAGATION DELAY" },
+ { CEVNT_BADDATE, "ILLEGAL DATE" },
+ { CEVNT_BADTIME, "ILLEGAL TIME" },
+ { (unsigned)~0L }
+ };
+ int i;
+
+ i = 0;
+ while (flagstrings[i].value != ~0)
+ {
+ if (flagstrings[i].value == lstate)
+ {
+ return flagstrings[i].name;
+ }
+ i++;
+ }
+
+ snprintf(buffer, sizeof(buffer), "unknown #%ld", (u_long)lstate);
+
+ return buffer;
+}
+
+
+/*--------------------------------------------------
+ * l_mktime - make representation of a relative time
+ */
+static char *
+l_mktime(
+ u_long delta
+ )
+{
+ u_long tmp, m, s;
+ static char buffer[40];
+ char *t;
+
+ buffer[0] = '\0';
+
+ if ((tmp = delta / (60*60*24)) != 0)
+ {
+ snprintf(buffer, BUFFER_SIZE(buffer, buffer), "%ldd+", (u_long)tmp);
+ delta -= tmp * 60*60*24;
+ }
+
+ s = delta % 60;
+ delta /= 60;
+ m = delta % 60;
+ delta /= 60;
+
+ t = buffer + strlen(buffer);
+
+ snprintf(t, BUFFER_SIZE(buffer, t), "%02d:%02d:%02d",
+ (int)delta, (int)m, (int)s);
+
+ return buffer;
+}
+
+
+/*--------------------------------------------------
+ * parse_statistics - list summary of clock states
+ */
+static void
+parse_statistics(
+ struct parseunit *parse
+ )
+{
+ int i;
+
+ NLOG(NLOG_CLOCKSTATIST) /* conditional if clause for conditional syslog */
+ {
+ msyslog(LOG_INFO, "PARSE receiver #%d: running time: %s",
+ CLK_UNIT(parse->peer),
+ l_mktime(current_time - parse->generic->timestarted));
+
+ msyslog(LOG_INFO, "PARSE receiver #%d: current status: %s",
+ CLK_UNIT(parse->peer),
+ clockstatus(parse->generic->currentstatus));
+
+ for (i = 0; i <= CEVNT_MAX; i++)
+ {
+ u_long s_time;
+ u_long percent, d = current_time - parse->generic->timestarted;
+
+ percent = s_time = PARSE_STATETIME(parse, i);
+
+ while (((u_long)(~0) / 10000) < percent)
+ {
+ percent /= 10;
+ d /= 10;
+ }
+
+ if (d)
+ percent = (percent * 10000) / d;
+ else
+ percent = 10000;
+
+ if (s_time)
+ msyslog(LOG_INFO, "PARSE receiver #%d: state %18s: %13s (%3ld.%02ld%%)",
+ CLK_UNIT(parse->peer),
+ clockstatus((unsigned int)i),
+ l_mktime(s_time),
+ percent / 100, percent % 100);
+ }
+ }
+}
+
+/*--------------------------------------------------
+ * cparse_statistics - wrapper for statistics call
+ */
+static void
+cparse_statistics(
+ struct parseunit *parse
+ )
+{
+ if (parse->laststatistic + PARSESTATISTICS < current_time)
+ parse_statistics(parse);
+ parse->laststatistic = current_time;
+}
+
+/**===========================================================================
+ ** ntp interface routines
+ **/
+
+/*--------------------------------------------------
+ * parse_shutdown - shut down a PARSE clock
+ */
+static void
+parse_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct parseunit *parse = NULL;
+
+ if (peer && peer->procptr)
+ parse = peer->procptr->unitptr;
+
+ if (!parse)
+ {
+ /* nothing to clean up */
+ return;
+ }
+
+ if (!parse->peer)
+ {
+ msyslog(LOG_INFO, "PARSE receiver #%d: INTERNAL ERROR - unit already inactive - shutdown ignored", unit);
+ return;
+ }
+
+#ifdef HAVE_PPSAPI
+ if (parse->flags & PARSE_PPSCLOCK)
+ {
+ (void)time_pps_destroy(parse->atom.handle);
+ }
+#endif
+ if (parse->generic->io.fd != parse->ppsfd && parse->ppsfd != -1)
+ (void)closeserial(parse->ppsfd); /* close separate PPS source */
+
+ /*
+ * print statistics a last time and
+ * stop statistics machine
+ */
+ parse_statistics(parse);
+
+ if (parse->parse_type->cl_end)
+ {
+ parse->parse_type->cl_end(parse);
+ }
+
+ /*
+ * cleanup before leaving this world
+ */
+ if (parse->binding)
+ PARSE_END(parse);
+
+ /*
+ * Tell the I/O module to turn us off. We're history.
+ */
+ io_closeclock(&parse->generic->io);
+
+ free_varlist(parse->kv);
+
+ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO, "PARSE receiver #%d: reference clock \"%s\" removed",
+ CLK_UNIT(parse->peer), parse->parse_type->cl_description);
+
+ parse->peer = (struct peer *)0; /* unused now */
+ peer->procptr->unitptr = (caddr_t)0;
+ free(parse);
+}
+
+#ifdef HAVE_PPSAPI
+/*----------------------------------------
+ * set up HARDPPS via PPSAPI
+ */
+static void
+parse_hardpps(
+ struct parseunit *parse,
+ int mode
+ )
+{
+ if (parse->hardppsstate == mode)
+ return;
+
+ if (CLK_PPS(parse->peer) && (parse->flags & PARSE_PPSKERNEL)) {
+ int i = 0;
+
+ if (mode == PARSE_HARDPPS_ENABLE)
+ {
+ if (parse->flags & PARSE_CLEAR)
+ i = PPS_CAPTURECLEAR;
+ else
+ i = PPS_CAPTUREASSERT;
+ }
+
+ if (time_pps_kcbind(parse->atom.handle, PPS_KC_HARDPPS, i,
+ PPS_TSFMT_TSPEC) < 0) {
+ msyslog(LOG_ERR, "PARSE receiver #%d: time_pps_kcbind failed: %m",
+ CLK_UNIT(parse->peer));
+ } else {
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO, "PARSE receiver #%d: kernel PPS synchronisation %sabled",
+ CLK_UNIT(parse->peer), (mode == PARSE_HARDPPS_ENABLE) ? "en" : "dis");
+ /*
+ * tell the rest, that we have a kernel PPS source, iff we ever enable HARDPPS
+ */
+ if (mode == PARSE_HARDPPS_ENABLE)
+ hardpps_enable = 1;
+ }
+ }
+
+ parse->hardppsstate = mode;
+}
+
+/*----------------------------------------
+ * set up PPS via PPSAPI
+ */
+static int
+parse_ppsapi(
+ struct parseunit *parse
+ )
+{
+ int cap, mode_ppsoffset;
+ char *cp;
+
+ parse->flags &= ~PARSE_PPSCLOCK;
+
+ /*
+ * collect PPSAPI offset capability - should move into generic handling
+ */
+ if (time_pps_getcap(parse->atom.handle, &cap) < 0) {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_ppsapi: time_pps_getcap failed: %m",
+ CLK_UNIT(parse->peer));
+
+ return 0;
+ }
+
+ /*
+ * initialize generic PPSAPI interface
+ *
+ * we leave out CLK_FLAG3 as time_pps_kcbind()
+ * is handled here for now. Ideally this should also
+ * be part of the generic PPSAPI interface
+ */
+ if (!refclock_params(parse->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG4), &parse->atom))
+ return 0;
+
+ /* nb. only turn things on, if someone else has turned something
+ * on before we get here, leave it alone!
+ */
+
+ if (parse->flags & PARSE_CLEAR) {
+ cp = "CLEAR";
+ mode_ppsoffset = PPS_OFFSETCLEAR;
+ } else {
+ cp = "ASSERT";
+ mode_ppsoffset = PPS_OFFSETASSERT;
+ }
+
+ msyslog(LOG_INFO, "PARSE receiver #%d: initializing PPS to %s",
+ CLK_UNIT(parse->peer), cp);
+
+ if (!(mode_ppsoffset & cap)) {
+ msyslog(LOG_WARNING, "PARSE receiver #%d: Cannot set PPS_%sCLEAR, this will increase jitter (PPS API capabilities=0x%x)",
+ CLK_UNIT(parse->peer), cp, cap);
+ mode_ppsoffset = 0;
+ } else {
+ if (mode_ppsoffset == PPS_OFFSETCLEAR)
+ {
+ parse->atom.pps_params.clear_offset.tv_sec = -parse->ppsphaseadjust;
+ parse->atom.pps_params.clear_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
+ }
+
+ if (mode_ppsoffset == PPS_OFFSETASSERT)
+ {
+ parse->atom.pps_params.assert_offset.tv_sec = -parse->ppsphaseadjust;
+ parse->atom.pps_params.assert_offset.tv_nsec = -1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
+ }
+ }
+
+ parse->atom.pps_params.mode |= mode_ppsoffset;
+
+ if (time_pps_setparams(parse->atom.handle, &parse->atom.pps_params) < 0) {
+ msyslog(LOG_ERR, "PARSE receiver #%d: FAILED set PPS parameters: %m",
+ CLK_UNIT(parse->peer));
+ return 0;
+ }
+
+ parse->flags |= PARSE_PPSCLOCK;
+ return 1;
+}
+#else
+#define parse_hardpps(_PARSE_, _MODE_) /* empty */
+#endif
+
+/*--------------------------------------------------
+ * parse_start - open the PARSE devices and initialize data for processing
+ */
+static int
+parse_start(
+ int sysunit,
+ struct peer *peer
+ )
+{
+ u_int unit;
+ int fd232;
+#ifdef HAVE_TERMIOS
+ struct termios tio; /* NEEDED FOR A LONG TIME ! */
+#endif
+#ifdef HAVE_SYSV_TTYS
+ struct termio tio; /* NEEDED FOR A LONG TIME ! */
+#endif
+ struct parseunit * parse;
+ char parsedev[sizeof(PARSEDEVICE)+20];
+ char parseppsdev[sizeof(PARSEPPSDEVICE)+20];
+ parsectl_t tmp_ctl;
+ u_int type;
+
+ /*
+ * get out Copyright information once
+ */
+ if (!notice)
+ {
+ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO, "NTP PARSE support: Copyright (c) 1989-2009, Frank Kardel");
+ notice = 1;
+ }
+
+ type = CLK_TYPE(peer);
+ unit = CLK_UNIT(peer);
+
+ if ((type == ~0) || (parse_clockinfo[type].cl_description == (char *)0))
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: unsupported clock type %d (max %d)",
+ unit, CLK_REALTYPE(peer), ncltypes-1);
+ return 0;
+ }
+
+ /*
+ * Unit okay, attempt to open the device.
+ */
+ (void) snprintf(parsedev, sizeof(parsedev), PARSEDEVICE, unit);
+ (void) snprintf(parseppsdev, sizeof(parsedev), PARSEPPSDEVICE, unit);
+
+#ifndef O_NOCTTY
+#define O_NOCTTY 0
+#endif
+#ifndef O_NONBLOCK
+#define O_NONBLOCK 0
+#endif
+
+ fd232 = tty_open(parsedev, O_RDWR | O_NOCTTY | O_NONBLOCK, 0777);
+
+ if (fd232 == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: open of %s failed: %m", unit, parsedev);
+ return 0;
+ }
+
+ parse = emalloc_zero(sizeof(*parse));
+
+ parse->generic = peer->procptr; /* link up */
+ parse->generic->unitptr = (caddr_t)parse; /* link down */
+
+ /*
+ * Set up the structures
+ */
+ parse->generic->timestarted = current_time;
+ parse->lastchange = current_time;
+
+ parse->flags = 0;
+ parse->pollneeddata = 0;
+ parse->laststatistic = current_time;
+ parse->lastformat = (unsigned short)~0; /* assume no format known */
+ parse->timedata.parse_status = (unsigned short)~0; /* be sure to mark initial status change */
+ parse->lastmissed = 0; /* assume got everything */
+ parse->ppsserial = 0;
+ parse->ppsfd = -1;
+ parse->localdata = (void *)0;
+ parse->localstate = 0;
+ parse->kv = (struct ctl_var *)0;
+
+ clear_err(parse, ERR_ALL);
+
+ parse->parse_type = &parse_clockinfo[type];
+
+ parse->maxunsync = parse->parse_type->cl_maxunsync;
+
+ parse->generic->fudgetime1 = parse->parse_type->cl_basedelay;
+
+ parse->generic->fudgetime2 = 0.0;
+ parse->ppsphaseadjust = parse->generic->fudgetime2;
+
+ parse->generic->clockdesc = parse->parse_type->cl_description;
+
+ peer->rootdelay = parse->parse_type->cl_rootdelay;
+ peer->sstclktype = parse->parse_type->cl_type;
+ peer->precision = sys_precision;
+
+ peer->stratum = STRATUM_REFCLOCK;
+
+ if (peer->stratum <= 1)
+ memmove((char *)&parse->generic->refid, parse->parse_type->cl_id, 4);
+ else
+ parse->generic->refid = htonl(PARSEHSREFID);
+
+ parse->generic->io.fd = fd232;
+
+ parse->peer = peer; /* marks it also as busy */
+
+ /*
+ * configure terminal line
+ */
+ if (TTY_GETATTR(fd232, &tio) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcgetattr(%d, &tio): %m", unit, fd232);
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0;
+ }
+ else
+ {
+#ifndef _PC_VDISABLE
+ memset((char *)tio.c_cc, 0, sizeof(tio.c_cc));
+#else
+ int disablec;
+ errno = 0; /* pathconf can deliver -1 without changing errno ! */
+
+ disablec = fpathconf(parse->generic->io.fd, _PC_VDISABLE);
+ if (disablec == -1 && errno)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: fpathconf(fd, _PC_VDISABLE): %m", CLK_UNIT(parse->peer));
+ memset((char *)tio.c_cc, 0, sizeof(tio.c_cc)); /* best guess */
+ }
+ else
+ if (disablec != -1)
+ memset((char *)tio.c_cc, disablec, sizeof(tio.c_cc));
+#endif
+
+#if defined (VMIN) || defined(VTIME)
+ if ((parse_clockinfo[type].cl_lflag & ICANON) == 0)
+ {
+#ifdef VMIN
+ tio.c_cc[VMIN] = 1;
+#endif
+#ifdef VTIME
+ tio.c_cc[VTIME] = 0;
+#endif
+ }
+#endif
+
+ tio.c_cflag = parse_clockinfo[type].cl_cflag;
+ tio.c_iflag = parse_clockinfo[type].cl_iflag;
+ tio.c_oflag = parse_clockinfo[type].cl_oflag;
+ tio.c_lflag = parse_clockinfo[type].cl_lflag;
+
+
+#ifdef HAVE_TERMIOS
+ if ((cfsetospeed(&tio, parse_clockinfo[type].cl_speed) == -1) ||
+ (cfsetispeed(&tio, parse_clockinfo[type].cl_speed) == -1))
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcset{i,o}speed(&tio, speed): %m", unit);
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0;
+ }
+#else
+ tio.c_cflag |= parse_clockinfo[type].cl_speed;
+#endif
+
+ /*
+ * set up pps device
+ * if the PARSEPPSDEVICE can be opened that will be used
+ * for PPS else PARSEDEVICE will be used
+ */
+ parse->ppsfd = tty_open(parseppsdev, O_RDWR | O_NOCTTY | O_NONBLOCK, 0777);
+
+ if (parse->ppsfd == -1)
+ {
+ parse->ppsfd = fd232;
+ }
+
+/*
+ * Linux PPS - the old way
+ */
+#if defined(HAVE_TIO_SERIAL_STUFF) /* Linux hack: define PPS interface */
+ {
+ struct serial_struct ss;
+ if (ioctl(parse->ppsfd, TIOCGSERIAL, &ss) < 0 ||
+ (
+#ifdef ASYNC_LOW_LATENCY
+ ss.flags |= ASYNC_LOW_LATENCY,
+#endif
+#ifndef HAVE_PPSAPI
+#ifdef ASYNC_PPS_CD_NEG
+ ss.flags |= ASYNC_PPS_CD_NEG,
+#endif
+#endif
+ ioctl(parse->ppsfd, TIOCSSERIAL, &ss)) < 0) {
+ msyslog(LOG_NOTICE, "refclock_parse: TIOCSSERIAL fd %d, %m", parse->ppsfd);
+ msyslog(LOG_NOTICE,
+ "refclock_parse: optional PPS processing not available");
+ } else {
+ parse->flags |= PARSE_PPSCLOCK;
+#ifdef ASYNC_PPS_CD_NEG
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO,
+ "refclock_parse: PPS detection on");
+#endif
+ }
+ }
+#endif
+
+/*
+ * SUN the Solaris way
+ */
+#ifdef HAVE_TIOCSPPS /* SUN PPS support */
+ if (CLK_PPS(parse->peer))
+ {
+ int i = 1;
+
+ if (ioctl(parse->ppsfd, TIOCSPPS, (caddr_t)&i) == 0)
+ {
+ parse->flags |= PARSE_PPSCLOCK;
+ }
+ }
+#endif
+
+/*
+ * PPS via PPSAPI
+ */
+#if defined(HAVE_PPSAPI)
+ parse->hardppsstate = PARSE_HARDPPS_DISABLE;
+ if (CLK_PPS(parse->peer))
+ {
+ if (!refclock_ppsapi(parse->ppsfd, &parse->atom))
+ {
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: parse_start: could not set up PPS: %m", CLK_UNIT(parse->peer));
+ }
+ else
+ {
+ parse_ppsapi(parse);
+ }
+ }
+#endif
+
+ if (TTY_SETATTR(fd232, &tio) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcsetattr(%d, &tio): %m", unit, fd232);
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0;
+ }
+ }
+
+ /*
+ * pick correct input machine
+ */
+ parse->generic->io.srcclock = peer;
+ parse->generic->io.datalen = 0;
+
+ parse->binding = init_iobinding(parse);
+
+ if (parse->binding == (bind_t *)0)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: io sub system initialisation failed.", CLK_UNIT(parse->peer));
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0; /* well, ok - special initialisation broke */
+ }
+
+ parse->generic->io.clock_recv = parse->binding->bd_receive; /* pick correct receive routine */
+ parse->generic->io.io_input = parse->binding->bd_io_input; /* pick correct input routine */
+
+ /*
+ * as we always(?) get 8 bit chars we want to be
+ * sure, that the upper bits are zero for less
+ * than 8 bit I/O - so we pass that information on.
+ * note that there can be only one bit count format
+ * per file descriptor
+ */
+
+ switch (tio.c_cflag & CSIZE)
+ {
+ case CS5:
+ tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS5;
+ break;
+
+ case CS6:
+ tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS6;
+ break;
+
+ case CS7:
+ tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS7;
+ break;
+
+ case CS8:
+ tmp_ctl.parsesetcs.parse_cs = PARSE_IO_CS8;
+ break;
+ }
+
+ if (!PARSE_SETCS(parse, &tmp_ctl))
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: parse_setcs() FAILED.", unit);
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0; /* well, ok - special initialisation broke */
+ }
+
+ tmp_ctl.parseformat.parse_count = strlcpy(tmp_ctl.parseformat.parse_buffer,
+ parse->parse_type->cl_format,
+ sizeof(tmp_ctl.parseformat.parse_buffer));
+ if (tmp_ctl.parseformat.parse_count >= sizeof(tmp_ctl.parseformat.parse_buffer))
+ tmp_ctl.parseformat.parse_count = sizeof(tmp_ctl.parseformat.parse_buffer) - 1;
+
+ if (!PARSE_SETFMT(parse, &tmp_ctl))
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_start: parse_setfmt() FAILED.", unit);
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0; /* well, ok - special initialisation broke */
+ }
+
+ /*
+ * get rid of all IO accumulated so far
+ */
+#ifdef HAVE_TERMIOS
+ (void) tcflush(parse->generic->io.fd, TCIOFLUSH);
+#else
+#if defined(TCFLSH) && defined(TCIOFLUSH)
+ {
+ int flshcmd = TCIOFLUSH;
+
+ (void) ioctl(parse->generic->io.fd, TCFLSH, (caddr_t)&flshcmd);
+ }
+#endif
+#endif
+
+ /*
+ * try to do any special initializations
+ */
+ if (parse->parse_type->cl_init)
+ {
+ if (parse->parse_type->cl_init(parse))
+ {
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0; /* well, ok - special initialisation broke */
+ }
+ }
+
+ /*
+ * Insert in async io device list.
+ */
+ if (!io_addclock(&parse->generic->io))
+ {
+ msyslog(LOG_ERR,
+ "PARSE receiver #%d: parse_start: addclock %s fails (ABORT - clock type requires async io)", CLK_UNIT(parse->peer), parsedev);
+ parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
+ return 0;
+ }
+
+ /*
+ * print out configuration
+ */
+ NLOG(NLOG_CLOCKINFO)
+ {
+ /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO, "PARSE receiver #%d: reference clock \"%s\" (I/O device %s, PPS device %s) added",
+ CLK_UNIT(parse->peer),
+ parse->parse_type->cl_description, parsedev,
+ (parse->ppsfd != parse->generic->io.fd) ? parseppsdev : parsedev);
+
+ msyslog(LOG_INFO, "PARSE receiver #%d: Stratum %d, trust time %s, precision %d",
+ CLK_UNIT(parse->peer),
+ parse->peer->stratum,
+ l_mktime(parse->maxunsync), parse->peer->precision);
+
+ msyslog(LOG_INFO, "PARSE receiver #%d: rootdelay %.6f s, phase adjustment %.6f s, PPS phase adjustment %.6f s, %s IO handling",
+ CLK_UNIT(parse->peer),
+ parse->parse_type->cl_rootdelay,
+ parse->generic->fudgetime1,
+ parse->ppsphaseadjust,
+ parse->binding->bd_description);
+
+ msyslog(LOG_INFO, "PARSE receiver #%d: Format recognition: %s", CLK_UNIT(parse->peer),
+ parse->parse_type->cl_format);
+ msyslog(LOG_INFO, "PARSE receiver #%d: %sPPS support%s", CLK_UNIT(parse->peer),
+ CLK_PPS(parse->peer) ? "" : "NO ",
+ CLK_PPS(parse->peer) ?
+#ifdef PPS_METHOD
+ " (implementation " PPS_METHOD ")"
+#else
+ ""
+#endif
+ : ""
+ );
+ }
+
+ return 1;
+}
+
+/*--------------------------------------------------
+ * parse_ctl - process changes on flags/time values
+ */
+static void
+parse_ctl(
+ struct parseunit *parse,
+ const struct refclockstat *in
+ )
+{
+ if (in)
+ {
+ if (in->haveflags & (CLK_HAVEFLAG1|CLK_HAVEFLAG2|CLK_HAVEFLAG3|CLK_HAVEFLAG4))
+ {
+ parse->flags = (parse->flags & ~(CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4)) |
+ (in->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4));
+#if defined(HAVE_PPSAPI)
+ if (CLK_PPS(parse->peer))
+ {
+ parse_ppsapi(parse);
+ }
+#endif
+ }
+
+ if (in->haveflags & CLK_HAVETIME1)
+ {
+ parse->generic->fudgetime1 = in->fudgetime1;
+ msyslog(LOG_INFO, "PARSE receiver #%d: new phase adjustment %.6f s",
+ CLK_UNIT(parse->peer),
+ parse->generic->fudgetime1);
+ }
+
+ if (in->haveflags & CLK_HAVETIME2)
+ {
+ parse->generic->fudgetime2 = in->fudgetime2;
+ if (parse->flags & PARSE_TRUSTTIME)
+ {
+ parse->maxunsync = (u_long)ABS(in->fudgetime2);
+ msyslog(LOG_INFO, "PARSE receiver #%d: new trust time %s",
+ CLK_UNIT(parse->peer),
+ l_mktime(parse->maxunsync));
+ }
+ else
+ {
+ parse->ppsphaseadjust = in->fudgetime2;
+ msyslog(LOG_INFO, "PARSE receiver #%d: new PPS phase adjustment %.6f s",
+ CLK_UNIT(parse->peer),
+ parse->ppsphaseadjust);
+#if defined(HAVE_PPSAPI)
+ if (CLK_PPS(parse->peer))
+ {
+ parse_ppsapi(parse);
+ }
+#endif
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------
+ * parse_poll - called by the transmit procedure
+ */
+static void
+parse_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct parseunit *parse = peer->procptr->unitptr;
+
+ if (peer != parse->peer)
+ {
+ msyslog(LOG_ERR,
+ "PARSE receiver #%d: poll: INTERNAL: peer incorrect",
+ unit);
+ return;
+ }
+
+ /*
+ * Update clock stat counters
+ */
+ parse->generic->polls++;
+
+ if (parse->pollneeddata &&
+ ((current_time - parse->pollneeddata) > (1<<(max(min(parse->peer->hpoll, parse->peer->ppoll), parse->peer->minpoll)))))
+ {
+ /*
+ * start worrying when exceeding a poll inteval
+ * bad news - didn't get a response last time
+ */
+ parse->lastmissed = current_time;
+ parse_event(parse, CEVNT_TIMEOUT);
+
+ ERR(ERR_NODATA)
+ msyslog(LOG_WARNING, "PARSE receiver #%d: no data from device within poll interval (check receiver / wiring)", CLK_UNIT(parse->peer));
+ }
+
+ /*
+ * we just mark that we want the next sample for the clock filter
+ */
+ parse->pollneeddata = current_time;
+
+ if (parse->parse_type->cl_poll)
+ {
+ parse->parse_type->cl_poll(parse);
+ }
+
+ cparse_statistics(parse);
+
+ return;
+}
+
+#define LEN_STATES 300 /* length of state string */
+
+/*--------------------------------------------------
+ * parse_control - set fudge factors, return statistics
+ */
+static void
+parse_control(
+ int unit,
+ const struct refclockstat *in,
+ struct refclockstat *out,
+ struct peer *peer
+ )
+{
+ struct parseunit *parse = peer->procptr->unitptr;
+ parsectl_t tmpctl;
+
+ static char outstatus[400]; /* status output buffer */
+
+ if (out)
+ {
+ out->lencode = 0;
+ out->p_lastcode = 0;
+ out->kv_list = (struct ctl_var *)0;
+ }
+
+ if (!parse || !parse->peer)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_control: unit invalid (UNIT INACTIVE)",
+ unit);
+ return;
+ }
+
+ unit = CLK_UNIT(parse->peer);
+
+ /*
+ * handle changes
+ */
+ parse_ctl(parse, in);
+
+ /*
+ * supply data
+ */
+ if (out)
+ {
+ u_long sum = 0;
+ char *tt, *start;
+ int i;
+
+ outstatus[0] = '\0';
+
+ out->type = REFCLK_PARSE;
+
+ /*
+ * keep fudgetime2 in sync with TRUSTTIME/MAXUNSYNC flag1
+ */
+ parse->generic->fudgetime2 = (parse->flags & PARSE_TRUSTTIME) ? (double)parse->maxunsync : parse->ppsphaseadjust;
+
+ /*
+ * figure out skew between PPS and RS232 - just for informational
+ * purposes
+ */
+ if (PARSE_SYNC(parse->timedata.parse_state))
+ {
+ if (PARSE_PPS(parse->timedata.parse_state) && PARSE_TIMECODE(parse->timedata.parse_state))
+ {
+ l_fp off;
+
+ /*
+ * we have a PPS and RS232 signal - calculate the skew
+ * WARNING: assumes on TIMECODE == PULSE (timecode after pulse)
+ */
+ off = parse->timedata.parse_stime.fp;
+ L_SUB(&off, &parse->timedata.parse_ptime.fp); /* true offset */
+ tt = add_var(&out->kv_list, 80, RO);
+ snprintf(tt, 80, "refclock_ppsskew=%s", lfptoms(&off, 6));
+ }
+ }
+
+ if (PARSE_PPS(parse->timedata.parse_state))
+ {
+ tt = add_var(&out->kv_list, 80, RO|DEF);
+ snprintf(tt, 80, "refclock_ppstime=\"%s\"", gmprettydate(&parse->timedata.parse_ptime.fp));
+ }
+
+ start = tt = add_var(&out->kv_list, 128, RO|DEF);
+ snprintf(tt, 128, "refclock_time=\"");
+ tt += strlen(tt);
+
+ if (parse->timedata.parse_time.fp.l_ui == 0)
+ {
+ strlcpy(tt, "<UNDEFINED>\"", BUFFER_SIZES(start, tt, 128));
+ }
+ else
+ {
+ snprintf(tt, 128, "%s\"", gmprettydate(&parse->timedata.parse_time.fp));
+ }
+
+ if (!PARSE_GETTIMECODE(parse, &tmpctl))
+ {
+ ERR(ERR_INTERNAL)
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_control: parse_timecode() FAILED", unit);
+ }
+ else
+ {
+ start = tt = add_var(&out->kv_list, 512, RO|DEF);
+ snprintf(tt, 512, "refclock_status=\"");
+ tt += strlen(tt);
+
+ /*
+ * copy PPS flags from last read transaction (informational only)
+ */
+ tmpctl.parsegettc.parse_state |= parse->timedata.parse_state &
+ (PARSEB_PPS|PARSEB_S_PPS);
+
+ (void) parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));
+
+ strlcat(tt, "\"", BUFFER_SIZES(start, tt, 512));
+
+ if (tmpctl.parsegettc.parse_count)
+ mkascii(outstatus+strlen(outstatus), (int)(sizeof(outstatus)- strlen(outstatus) - 1),
+ tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count));
+
+ }
+
+ tmpctl.parseformat.parse_format = tmpctl.parsegettc.parse_format;
+
+ if (!PARSE_GETFMT(parse, &tmpctl))
+ {
+ ERR(ERR_INTERNAL)
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_control: parse_getfmt() FAILED", unit);
+ }
+ else
+ {
+ tt = add_var(&out->kv_list, 80, RO|DEF);
+ snprintf(tt, 80, "refclock_format=\"");
+
+ strlcat(tt, tmpctl.parseformat.parse_buffer, 80);
+ strlcat(tt,"\"", 80);
+ }
+
+ /*
+ * gather state statistics
+ */
+
+ start = tt = add_var(&out->kv_list, LEN_STATES, RO|DEF);
+ strlcpy(tt, "refclock_states=\"", LEN_STATES);
+ tt += strlen(tt);
+
+ for (i = 0; i <= CEVNT_MAX; i++)
+ {
+ u_long s_time;
+ u_long d = current_time - parse->generic->timestarted;
+ u_long percent;
+
+ percent = s_time = PARSE_STATETIME(parse, i);
+
+ while (((u_long)(~0) / 10000) < percent)
+ {
+ percent /= 10;
+ d /= 10;
+ }
+
+ if (d)
+ percent = (percent * 10000) / d;
+ else
+ percent = 10000;
+
+ if (s_time)
+ {
+ char item[80];
+ int count;
+
+ snprintf(item, 80, "%s%s%s: %s (%d.%02d%%)",
+ sum ? "; " : "",
+ (parse->generic->currentstatus == i) ? "*" : "",
+ clockstatus((unsigned int)i),
+ l_mktime(s_time),
+ (int)(percent / 100), (int)(percent % 100));
+ if ((count = strlen(item)) < (LEN_STATES - 40 - (tt - start)))
+ {
+ strlcpy(tt, item, BUFFER_SIZES(start, tt, LEN_STATES));
+ tt += count;
+ }
+ sum += s_time;
+ }
+ }
+
+ snprintf(tt, BUFFER_SIZES(start, tt, LEN_STATES), "; running time: %s\"", l_mktime(sum));
+
+ tt = add_var(&out->kv_list, 32, RO);
+ snprintf(tt, 32, "refclock_id=\"%s\"", parse->parse_type->cl_id);
+
+ tt = add_var(&out->kv_list, 80, RO);
+ snprintf(tt, 80, "refclock_iomode=\"%s\"", parse->binding->bd_description);
+
+ tt = add_var(&out->kv_list, 128, RO);
+ snprintf(tt, 128, "refclock_driver_version=\"%s\"", rcsid);
+
+ {
+ struct ctl_var *k;
+
+ k = parse->kv;
+ while (k && !(k->flags & EOV))
+ {
+ set_var(&out->kv_list, k->text, strlen(k->text)+1, k->flags);
+ k++;
+ }
+ }
+
+ out->lencode = strlen(outstatus);
+ out->p_lastcode = outstatus;
+ }
+}
+
+/**===========================================================================
+ ** processing routines
+ **/
+
+/*--------------------------------------------------
+ * event handling - note that nominal events will also be posted
+ * keep track of state dwelling times
+ */
+static void
+parse_event(
+ struct parseunit *parse,
+ int event
+ )
+{
+ if (parse->generic->currentstatus != (u_char) event)
+ {
+ parse->statetime[parse->generic->currentstatus] += current_time - parse->lastchange;
+ parse->lastchange = current_time;
+
+ if (parse->parse_type->cl_event)
+ parse->parse_type->cl_event(parse, event);
+
+ if (event == CEVNT_NOMINAL)
+ {
+ NLOG(NLOG_CLOCKSTATUS)
+ msyslog(LOG_INFO, "PARSE receiver #%d: SYNCHRONIZED",
+ CLK_UNIT(parse->peer));
+ }
+
+ refclock_report(parse->peer, event);
+ }
+}
+
+/*--------------------------------------------------
+ * process a PARSE time sample
+ */
+static void
+parse_process(
+ struct parseunit *parse,
+ parsetime_t *parsetime
+ )
+{
+ l_fp off, rectime, reftime;
+ double fudge;
+
+ /* silence warning: 'off.Ul_i.Xl_i' may be used uninitialized in this function */
+ ZERO(off);
+
+ /*
+ * check for changes in conversion status
+ * (only one for each new status !)
+ */
+ if (((parsetime->parse_status & CVT_MASK) != CVT_OK) &&
+ ((parsetime->parse_status & CVT_MASK) != CVT_NONE) &&
+ (parse->timedata.parse_status != parsetime->parse_status))
+ {
+ char buffer[400];
+
+ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_WARNING, "PARSE receiver #%d: conversion status \"%s\"",
+ CLK_UNIT(parse->peer), parsestatus(parsetime->parse_status, buffer, sizeof(buffer)));
+
+ if ((parsetime->parse_status & CVT_MASK) == CVT_FAIL)
+ {
+ /*
+ * tell more about the story - list time code
+ * there is a slight change for a race condition and
+ * the time code might be overwritten by the next packet
+ */
+ parsectl_t tmpctl;
+
+ if (!PARSE_GETTIMECODE(parse, &tmpctl))
+ {
+ ERR(ERR_INTERNAL)
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_process: parse_timecode() FAILED", CLK_UNIT(parse->peer));
+ }
+ else
+ {
+ ERR(ERR_BADDATA)
+ msyslog(LOG_WARNING, "PARSE receiver #%d: FAILED TIMECODE: \"%s\" (check receiver configuration / wiring)",
+ CLK_UNIT(parse->peer), mkascii(buffer, sizeof buffer, tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count - 1)));
+ }
+ }
+ }
+
+ /*
+ * examine status and post appropriate events
+ */
+ if ((parsetime->parse_status & CVT_MASK) != CVT_OK)
+ {
+ /*
+ * got bad data - tell the rest of the system
+ */
+ switch (parsetime->parse_status & CVT_MASK)
+ {
+ case CVT_NONE:
+ if ((parsetime->parse_status & CVT_ADDITIONAL) &&
+ parse->parse_type->cl_message)
+ parse->parse_type->cl_message(parse, parsetime);
+ /*
+ * save PPS information that comes piggyback
+ */
+ if (PARSE_PPS(parsetime->parse_state))
+ {
+ parse->timedata.parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+ parse->timedata.parse_ptime = parsetime->parse_ptime;
+ }
+ break; /* well, still waiting - timeout is handled at higher levels */
+
+ case CVT_FAIL:
+ if (parsetime->parse_status & CVT_BADFMT)
+ {
+ parse_event(parse, CEVNT_BADREPLY);
+ }
+ else
+ if (parsetime->parse_status & CVT_BADDATE)
+ {
+ parse_event(parse, CEVNT_BADDATE);
+ }
+ else
+ if (parsetime->parse_status & CVT_BADTIME)
+ {
+ parse_event(parse, CEVNT_BADTIME);
+ }
+ else
+ {
+ parse_event(parse, CEVNT_BADREPLY); /* for the lack of something better */
+ }
+ }
+ return; /* skip the rest - useless */
+ }
+
+ /*
+ * check for format changes
+ * (in case somebody has swapped clocks 8-)
+ */
+ if (parse->lastformat != parsetime->parse_format)
+ {
+ parsectl_t tmpctl;
+
+ tmpctl.parseformat.parse_format = parsetime->parse_format;
+
+ if (!PARSE_GETFMT(parse, &tmpctl))
+ {
+ ERR(ERR_INTERNAL)
+ msyslog(LOG_ERR, "PARSE receiver #%d: parse_getfmt() FAILED", CLK_UNIT(parse->peer));
+ }
+ else
+ {
+ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO, "PARSE receiver #%d: packet format \"%s\"",
+ CLK_UNIT(parse->peer), tmpctl.parseformat.parse_buffer);
+ }
+ parse->lastformat = parsetime->parse_format;
+ }
+
+ /*
+ * now, any changes ?
+ */
+ if ((parse->timedata.parse_state ^ parsetime->parse_state) &
+ ~(unsigned)(PARSEB_PPS|PARSEB_S_PPS))
+ {
+ char tmp1[200];
+ char tmp2[200];
+ /*
+ * something happend - except for PPS events
+ */
+
+ (void) parsestate(parsetime->parse_state, tmp1, sizeof(tmp1));
+ (void) parsestate(parse->timedata.parse_state, tmp2, sizeof(tmp2));
+
+ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
+ msyslog(LOG_INFO,"PARSE receiver #%d: STATE CHANGE: %s -> %s",
+ CLK_UNIT(parse->peer), tmp2, tmp1);
+ }
+
+ /*
+ * carry on PPS information if still usable
+ */
+ if (PARSE_PPS(parse->timedata.parse_state) && !PARSE_PPS(parsetime->parse_state))
+ {
+ parsetime->parse_state |= PARSEB_PPS|PARSEB_S_PPS;
+ parsetime->parse_ptime = parse->timedata.parse_ptime;
+ }
+
+ /*
+ * remember for future
+ */
+ parse->timedata = *parsetime;
+
+ /*
+ * check to see, whether the clock did a complete powerup or lost PZF signal
+ * and post correct events for current condition
+ */
+ if (PARSE_POWERUP(parsetime->parse_state))
+ {
+ /*
+ * this is bad, as we have completely lost synchronisation
+ * well this is a problem with the receiver here
+ * for PARSE Meinberg DCF77 receivers the lost synchronisation
+ * is true as it is the powerup state and the time is taken
+ * from a crude real time clock chip
+ * for the PZF/GPS series this is only partly true, as
+ * PARSE_POWERUP only means that the pseudo random
+ * phase shift sequence cannot be found. this is only
+ * bad, if we have never seen the clock in the SYNC
+ * state, where the PHASE and EPOCH are correct.
+ * for reporting events the above business does not
+ * really matter, but we can use the time code
+ * even in the POWERUP state after having seen
+ * the clock in the synchronized state (PZF class
+ * receivers) unless we have had a telegram disruption
+ * after having seen the clock in the SYNC state. we
+ * thus require having seen the clock in SYNC state
+ * *after* having missed telegrams (noresponse) from
+ * the clock. one problem remains: we might use erroneously
+ * POWERUP data if the disruption is shorter than 1 polling
+ * interval. fortunately powerdowns last usually longer than 64
+ * seconds and the receiver is at least 2 minutes in the
+ * POWERUP or NOSYNC state before switching to SYNC
+ * for GPS receivers this can mean antenna problems and other causes.
+ * the additional grace period can be enables by a clock
+ * mode having the PARSE_F_POWERUPTRUST flag in cl_flag set.
+ */
+ parse_event(parse, CEVNT_FAULT);
+ NLOG(NLOG_CLOCKSTATUS)
+ ERR(ERR_BADSTATUS)
+ msyslog(LOG_ERR,"PARSE receiver #%d: NOT SYNCHRONIZED/RECEIVER PROBLEMS",
+ CLK_UNIT(parse->peer));
+ }
+ else
+ {
+ /*
+ * we have two states left
+ *
+ * SYNC:
+ * this state means that the EPOCH (timecode) and PHASE
+ * information has be read correctly (at least two
+ * successive PARSE timecodes were received correctly)
+ * this is the best possible state - full trust
+ *
+ * NOSYNC:
+ * The clock should be on phase with respect to the second
+ * signal, but the timecode has not been received correctly within
+ * at least the last two minutes. this is a sort of half baked state
+ * for PARSE Meinberg DCF77 clocks this is bad news (clock running
+ * without timecode confirmation)
+ * PZF 535 has also no time confirmation, but the phase should be
+ * very precise as the PZF signal can be decoded
+ */
+
+ if (PARSE_SYNC(parsetime->parse_state))
+ {
+ /*
+ * currently completely synchronized - best possible state
+ */
+ parse->lastsync = current_time;
+ clear_err(parse, ERR_BADSTATUS);
+ }
+ else
+ {
+ /*
+ * we have had some problems receiving the time code
+ */
+ parse_event(parse, CEVNT_PROP);
+ NLOG(NLOG_CLOCKSTATUS)
+ ERR(ERR_BADSTATUS)
+ msyslog(LOG_ERR,"PARSE receiver #%d: TIMECODE NOT CONFIRMED",
+ CLK_UNIT(parse->peer));
+ }
+ }
+
+ fudge = parse->generic->fudgetime1; /* standard RS232 Fudgefactor */
+
+ if (PARSE_TIMECODE(parsetime->parse_state))
+ {
+ rectime = parsetime->parse_stime.fp;
+ off = reftime = parsetime->parse_time.fp;
+
+ L_SUB(&off, &rectime); /* prepare for PPS adjustments logic */
+
+#ifdef DEBUG
+ if (debug > 3)
+ printf("PARSE receiver #%d: Reftime %s, Recvtime %s - initial offset %s\n",
+ CLK_UNIT(parse->peer),
+ prettydate(&reftime),
+ prettydate(&rectime),
+ lfptoa(&off,6));
+#endif
+ }
+
+ if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
+ {
+ l_fp offset;
+ double ppsphaseadjust = parse->ppsphaseadjust;
+
+#ifdef HAVE_PPSAPI
+ /*
+ * set fudge = 0.0 if already included in PPS time stamps
+ */
+ if (parse->atom.pps_params.mode & (PPS_OFFSETCLEAR|PPS_OFFSETASSERT))
+ {
+ ppsphaseadjust = 0.0;
+ }
+#endif
+
+ /*
+ * we have a PPS signal - much better than the RS232 stuff (we hope)
+ */
+ offset = parsetime->parse_ptime.fp;
+
+#ifdef DEBUG
+ if (debug > 3)
+ printf("PARSE receiver #%d: PPStime %s\n",
+ CLK_UNIT(parse->peer),
+ prettydate(&offset));
+#endif
+ if (PARSE_TIMECODE(parsetime->parse_state))
+ {
+ if (M_ISGEQ(off.l_i, off.l_uf, -1, 0x80000000) &&
+ M_ISGEQ(0, 0x7fffffff, off.l_i, off.l_uf))
+ {
+ fudge = ppsphaseadjust; /* pick PPS fudge factor */
+
+ /*
+ * RS232 offsets within [-0.5..0.5[ - take PPS offsets
+ */
+
+ if (parse->parse_type->cl_flags & PARSE_F_PPSONSECOND)
+ {
+ reftime = off = offset;
+ if (reftime.l_uf & 0x80000000)
+ reftime.l_ui++;
+ reftime.l_uf = 0;
+
+
+ /*
+ * implied on second offset
+ */
+ off.l_uf = ~off.l_uf; /* map [0.5..1[ -> [-0.5..0[ */
+ off.l_i = (off.l_uf & 0x8000000) ? -1 : 0; /* sign extend */
+ }
+ else
+ {
+ /*
+ * time code describes pulse
+ */
+ reftime = off = parsetime->parse_time.fp;
+
+ L_SUB(&off, &offset); /* true offset */
+ }
+ }
+ /*
+ * take RS232 offset when PPS when out of bounds
+ */
+ }
+ else
+ {
+ fudge = ppsphaseadjust; /* pick PPS fudge factor */
+ /*
+ * Well, no time code to guide us - assume on second pulse
+ * and pray, that we are within [-0.5..0.5[
+ */
+ off = offset;
+ reftime = offset;
+ if (reftime.l_uf & 0x80000000)
+ reftime.l_ui++;
+ reftime.l_uf = 0;
+ /*
+ * implied on second offset
+ */
+ off.l_uf = ~off.l_uf; /* map [0.5..1[ -> [-0.5..0[ */
+ off.l_i = (off.l_uf & 0x80000000) ? -1 : 0; /* sign extend */
+ }
+ }
+ else
+ {
+ if (!PARSE_TIMECODE(parsetime->parse_state))
+ {
+ /*
+ * Well, no PPS, no TIMECODE, no more work ...
+ */
+ if ((parsetime->parse_status & CVT_ADDITIONAL) &&
+ parse->parse_type->cl_message)
+ parse->parse_type->cl_message(parse, parsetime);
+ return;
+ }
+ }
+
+#ifdef DEBUG
+ if (debug > 3)
+ printf("PARSE receiver #%d: Reftime %s, Recvtime %s - final offset %s\n",
+ CLK_UNIT(parse->peer),
+ prettydate(&reftime),
+ prettydate(&rectime),
+ lfptoa(&off,6));
+#endif
+
+
+ rectime = reftime;
+ L_SUB(&rectime, &off); /* just to keep the ntp interface happy */
+
+#ifdef DEBUG
+ if (debug > 3)
+ printf("PARSE receiver #%d: calculated Reftime %s, Recvtime %s\n",
+ CLK_UNIT(parse->peer),
+ prettydate(&reftime),
+ prettydate(&rectime));
+#endif
+
+ if ((parsetime->parse_status & CVT_ADDITIONAL) &&
+ parse->parse_type->cl_message)
+ parse->parse_type->cl_message(parse, parsetime);
+
+ if (PARSE_SYNC(parsetime->parse_state))
+ {
+ /*
+ * log OK status
+ */
+ parse_event(parse, CEVNT_NOMINAL);
+ }
+
+ clear_err(parse, ERR_BADIO);
+ clear_err(parse, ERR_BADDATA);
+ clear_err(parse, ERR_NODATA);
+ clear_err(parse, ERR_INTERNAL);
+
+ /*
+ * and now stick it into the clock machine
+ * samples are only valid iff lastsync is not too old and
+ * we have seen the clock in sync at least once
+ * after the last time we didn't see an expected data telegram
+ * at startup being not in sync is also bad just like
+ * POWERUP state unless PARSE_F_POWERUPTRUST is set
+ * see the clock states section above for more reasoning
+ */
+ if (((current_time - parse->lastsync) > parse->maxunsync) ||
+ (parse->lastsync < parse->lastmissed) ||
+ ((parse->lastsync == 0) && !PARSE_SYNC(parsetime->parse_state)) ||
+ (((parse->parse_type->cl_flags & PARSE_F_POWERUPTRUST) == 0) &&
+ PARSE_POWERUP(parsetime->parse_state)))
+ {
+ parse->generic->leap = LEAP_NOTINSYNC;
+ parse->lastsync = 0; /* wait for full sync again */
+ }
+ else
+ {
+ if (PARSE_LEAPADD(parsetime->parse_state))
+ {
+ /*
+ * we pick this state also for time code that pass leap warnings
+ * without direction information (as earth is currently slowing
+ * down).
+ */
+ parse->generic->leap = (parse->flags & PARSE_LEAP_DELETE) ? LEAP_DELSECOND : LEAP_ADDSECOND;
+ }
+ else
+ if (PARSE_LEAPDEL(parsetime->parse_state))
+ {
+ parse->generic->leap = LEAP_DELSECOND;
+ }
+ else
+ {
+ parse->generic->leap = LEAP_NOWARNING;
+ }
+ }
+
+ if (parse->generic->leap != LEAP_NOTINSYNC)
+ {
+ /*
+ * only good/trusted samples are interesting
+ */
+#ifdef DEBUG
+ if (debug > 2)
+ {
+ printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n",
+ CLK_UNIT(parse->peer),
+ prettydate(&reftime),
+ prettydate(&rectime),
+ fudge);
+ }
+#endif
+ parse->generic->lastref = reftime;
+
+ refclock_process_offset(parse->generic, reftime, rectime, fudge);
+
+#ifdef HAVE_PPSAPI
+ /*
+ * pass PPS information on to PPS clock
+ */
+ if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
+ {
+ /* refclock_pps includes fudgetime1 - we keep the RS232 offset in there :-( */
+ double savedtime1 = parse->generic->fudgetime1;
+
+ parse->generic->fudgetime1 = fudge;
+
+ if (refclock_pps(parse->peer, &parse->atom,
+ parse->flags & (CLK_FLAG1|CLK_FLAG2|CLK_FLAG3|CLK_FLAG4))) {
+ parse->peer->flags |= FLAG_PPS;
+ } else {
+ parse->peer->flags &= ~FLAG_PPS;
+ }
+
+ parse->generic->fudgetime1 = savedtime1;
+
+ parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
+ }
+#endif
+ } else {
+ parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
+ parse->peer->flags &= ~FLAG_PPS;
+ }
+
+ /*
+ * ready, unless the machine wants a sample or
+ * we are in fast startup mode (peer->dist > MAXDISTANCE)
+ */
+ if (!parse->pollneeddata && parse->peer->disp <= MAXDISTANCE)
+ return;
+
+ parse->pollneeddata = 0;
+
+ parse->timedata.parse_state &= ~(unsigned)(PARSEB_PPS|PARSEB_S_PPS);
+
+ refclock_receive(parse->peer);
+}
+
+/**===========================================================================
+ ** special code for special clocks
+ **/
+
+static void
+mk_utcinfo(
+ char *t,
+ int wnt,
+ int wnlsf,
+ int dn,
+ int dtls,
+ int dtlsf,
+ int size
+ )
+{
+ l_fp leapdate;
+ char *start = t;
+
+ snprintf(t, size, "current correction %d sec", dtls);
+ t += strlen(t);
+
+ if (wnlsf < 990)
+ wnlsf += 1024;
+
+ if (wnt < 990)
+ wnt += 1024;
+
+ gpstolfp((unsigned short)wnlsf, (unsigned short)dn, 0, &leapdate);
+
+ if ((dtlsf != dtls) &&
+ ((wnlsf - wnt) < 52))
+ {
+ snprintf(t, BUFFER_SIZES(start, t, size), ", next correction %d sec on %s, new GPS-UTC offset %d",
+ dtlsf - dtls, gmprettydate(&leapdate), dtlsf);
+ }
+ else
+ {
+ snprintf(t, BUFFER_SIZES(start, t, size), ", last correction on %s",
+ gmprettydate(&leapdate));
+ }
+}
+
+#ifdef CLOCK_MEINBERG
+/**===========================================================================
+ ** Meinberg GPS166/GPS167 support
+ **/
+
+/*------------------------------------------------------------
+ * gps16x_message - process GPS16x messages
+ */
+static void
+gps16x_message(
+ struct parseunit *parse,
+ parsetime_t *parsetime
+ )
+{
+ if (parse->timedata.parse_msglen && parsetime->parse_msg[0] == SOH)
+ {
+ GPS_MSG_HDR header;
+ unsigned char *bufp = (unsigned char *)parsetime->parse_msg + 1;
+
+#ifdef DEBUG
+ if (debug > 2)
+ {
+ char msgbuffer[600];
+
+ mkreadable(msgbuffer, sizeof(msgbuffer), (char *)parsetime->parse_msg, parsetime->parse_msglen, 1);
+ printf("PARSE receiver #%d: received message (%d bytes) >%s<\n",
+ CLK_UNIT(parse->peer),
+ parsetime->parse_msglen,
+ msgbuffer);
+ }
+#endif
+ get_mbg_header(&bufp, &header);
+ if (header.gps_hdr_csum == mbg_csum(parsetime->parse_msg + 1, 6) &&
+ (header.gps_len == 0 ||
+ (header.gps_len < sizeof(parsetime->parse_msg) &&
+ header.gps_data_csum == mbg_csum(bufp, header.gps_len))))
+ {
+ /*
+ * clean message
+ */
+ switch (header.gps_cmd)
+ {
+ case GPS_SW_REV:
+ {
+ char buffer[64];
+ SW_REV gps_sw_rev;
+
+ get_mbg_sw_rev(&bufp, &gps_sw_rev);
+ snprintf(buffer, sizeof(buffer), "meinberg_gps_version=\"%x.%02x%s%s\"",
+ (gps_sw_rev.code >> 8) & 0xFF,
+ gps_sw_rev.code & 0xFF,
+ gps_sw_rev.name[0] ? " " : "",
+ gps_sw_rev.name);
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
+ }
+ break;
+
+ case GPS_STAT:
+ {
+ static struct state
+ {
+ unsigned short flag; /* status flag */
+ unsigned const char *string; /* bit name */
+ } states[] =
+ {
+ { TM_ANT_DISCONN, (const unsigned char *)"ANTENNA FAULTY" },
+ { TM_SYN_FLAG, (const unsigned char *)"NO SYNC SIGNAL" },
+ { TM_NO_SYNC, (const unsigned char *)"NO SYNC POWERUP" },
+ { TM_NO_POS, (const unsigned char *)"NO POSITION" },
+ { 0, (const unsigned char *)"" }
+ };
+ unsigned short status;
+ struct state *s = states;
+ char buffer[512];
+ char *p, *b;
+
+ status = get_lsb_short(&bufp);
+ snprintf(buffer, sizeof(buffer), "meinberg_gps_status=\"[0x%04x] ", status);
+
+ if (status)
+ {
+ p = b = buffer + strlen(buffer);
+ while (s->flag)
+ {
+ if (status & s->flag)
+ {
+ if (p != b)
+ {
+ *p++ = ',';
+ *p++ = ' ';
+ }
+
+ strlcat(p, (const char *)s->string, sizeof(buffer));
+ }
+ s++;
+ }
+
+ *p++ = '"';
+ *p = '\0';
+ }
+ else
+ {
+ strlcat(buffer, "<OK>\"", sizeof(buffer));
+ }
+
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
+ }
+ break;
+
+ case GPS_POS_XYZ:
+ {
+ XYZ xyz;
+ char buffer[256];
+
+ get_mbg_xyz(&bufp, xyz);
+ snprintf(buffer, sizeof(buffer), "gps_position(XYZ)=\"%s m, %s m, %s m\"",
+ mfptoa(xyz[XP].l_ui, xyz[XP].l_uf, 1),
+ mfptoa(xyz[YP].l_ui, xyz[YP].l_uf, 1),
+ mfptoa(xyz[ZP].l_ui, xyz[ZP].l_uf, 1));
+
+ set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
+ }
+ break;
+
+ case GPS_POS_LLA:
+ {
+ LLA lla;
+ char buffer[256];
+
+ get_mbg_lla(&bufp, lla);
+
+ snprintf(buffer, sizeof(buffer), "gps_position(LLA)=\"%s deg, %s deg, %s m\"",
+ mfptoa(lla[LAT].l_ui, lla[LAT].l_uf, 4),
+ mfptoa(lla[LON].l_ui, lla[LON].l_uf, 4),
+ mfptoa(lla[ALT].l_ui, lla[ALT].l_uf, 1));
+
+ set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
+ }
+ break;
+
+ case GPS_TZDL:
+ break;
+
+ case GPS_PORT_PARM:
+ break;
+
+ case GPS_SYNTH:
+ break;
+
+ case GPS_ANT_INFO:
+ {
+ ANT_INFO antinfo;
+ char buffer[512];
+ char *p;
+
+ get_mbg_antinfo(&bufp, &antinfo);
+ snprintf(buffer, sizeof(buffer), "meinberg_antenna_status=\"");
+ p = buffer + strlen(buffer);
+
+ switch (antinfo.status)
+ {
+ case ANT_INVALID:
+ strlcat(p, "<OK>", BUFFER_SIZE(buffer, p));
+ p += strlen(p);
+ break;
+
+ case ANT_DISCONN:
+ strlcat(p, "DISCONNECTED since ", BUFFER_SIZE(buffer, p));
+ NLOG(NLOG_CLOCKSTATUS)
+ ERR(ERR_BADSTATUS)
+ msyslog(LOG_ERR,"PARSE receiver #%d: ANTENNA FAILURE: %s",
+ CLK_UNIT(parse->peer), p);
+
+ p += strlen(p);
+ mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
+ *p = '\0';
+ break;
+
+ case ANT_RECONN:
+ strlcat(p, "RECONNECTED on ", BUFFER_SIZE(buffer, p));
+ p += strlen(p);
+ mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p));
+ snprintf(p, BUFFER_SIZE(buffer, p), ", reconnect clockoffset %c%ld.%07ld s, disconnect time ",
+ (antinfo.delta_t < 0) ? '-' : '+',
+ ABS(antinfo.delta_t) / 10000,
+ ABS(antinfo.delta_t) % 10000);
+ p += strlen(p);
+ mbg_tm_str(&p, &antinfo.tm_disconn, BUFFER_SIZE(buffer, p));
+ *p = '\0';
+ break;
+
+ default:
+ snprintf(p, BUFFER_SIZE(buffer, p), "bad status 0x%04x", antinfo.status);
+ p += strlen(p);
+ break;
+ }
+
+ strlcat(p, "\"", BUFFER_SIZE(buffer, p));
+
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
+ }
+ break;
+
+ case GPS_UCAP:
+ break;
+
+ case GPS_CFGH:
+ {
+ CFGH cfgh;
+ char buffer[512];
+ char *p;
+
+ get_mbg_cfgh(&bufp, &cfgh);
+ if (cfgh.valid)
+ {
+ int i;
+
+ p = buffer;
+ strlcpy(buffer, "gps_tot_51=\"", BUFFER_SIZE(buffer, p));
+ p += strlen(p);
+ mbg_tgps_str(&p, &cfgh.tot_51, BUFFER_SIZE(buffer, p));
+ strlcpy(p, "\"", BUFFER_SIZE(buffer, p));
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
+
+ p = buffer;
+ strlcpy(buffer, "gps_tot_63=\"", BUFFER_SIZE(buffer, p));
+ p += strlen(p);
+ mbg_tgps_str(&p, &cfgh.tot_63, BUFFER_SIZE(buffer, p));
+ strlcpy(p, "\"", BUFFER_SIZE(buffer, p));
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
+
+ p = buffer;
+ strlcpy(buffer, "gps_t0a=\"", BUFFER_SIZE(buffer, p));
+ p += strlen(p);
+ mbg_tgps_str(&p, &cfgh.t0a, BUFFER_SIZE(buffer, p));
+ strlcpy(p, "\"", BUFFER_SIZE(buffer, p));
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
+
+ for (i = MIN_SVNO; i < MAX_SVNO; i++)
+ {
+ p = buffer;
+ snprintf(p, BUFFER_SIZE(buffer, p), "gps_cfg[%d]=\"[0x%x] ", i, cfgh.cfg[i]);
+ p += strlen(p);
+ switch (cfgh.cfg[i] & 0x7)
+ {
+ case 0:
+ strlcpy(p, "BLOCK I", BUFFER_SIZE(buffer, p));
+ break;
+ case 1:
+ strlcpy(p, "BLOCK II", BUFFER_SIZE(buffer, p));
+ break;
+ default:
+ strlcpy(p, "bad CFG", BUFFER_SIZE(buffer, p));
+ break;
+ }
+ strlcat(p, "\"", BUFFER_SIZE(buffer, p));
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
+
+ p = buffer;
+ snprintf(p, BUFFER_SIZE(buffer, p), "gps_health[%d]=\"[0x%x] ", i, cfgh.health[i]);
+ p += strlen(p);
+ switch ((cfgh.health[i] >> 5) & 0x7 )
+ {
+ case 0:
+ strlcpy(p, "OK;", BUFFER_SIZE(buffer, p));
+ break;
+ case 1:
+ strlcpy(p, "PARITY;", BUFFER_SIZE(buffer, p));
+ break;
+ case 2:
+ strlcpy(p, "TLM/HOW;", BUFFER_SIZE(buffer, p));
+ break;
+ case 3:
+ strlcpy(p, "Z-COUNT;", BUFFER_SIZE(buffer, p));
+ break;
+ case 4:
+ strlcpy(p, "SUBFRAME 1,2,3;", BUFFER_SIZE(buffer, p));
+ break;
+ case 5:
+ strlcpy(p, "SUBFRAME 4,5;", BUFFER_SIZE(buffer, p));
+ break;
+ case 6:
+ strlcpy(p, "UPLOAD BAD;", BUFFER_SIZE(buffer, p));
+ break;
+ case 7:
+ strlcpy(p, "DATA BAD;", BUFFER_SIZE(buffer, p));
+ break;
+ }
+
+ p += strlen(p);
+
+ switch (cfgh.health[i] & 0x1F)
+ {
+ case 0:
+ strlcpy(p, "SIGNAL OK", BUFFER_SIZE(buffer, p));
+ break;
+ case 0x1C:
+ strlcpy(p, "SV TEMP OUT", BUFFER_SIZE(buffer, p));
+ break;
+ case 0x1D:
+ strlcpy(p, "SV WILL BE TEMP OUT", BUFFER_SIZE(buffer, p));
+ break;
+ case 0x1E:
+ break;
+ case 0x1F:
+ strlcpy(p, "MULTIPLE ERRS", BUFFER_SIZE(buffer, p));
+ break;
+ default:
+ strlcpy(p, "TRANSMISSION PROBLEMS", BUFFER_SIZE(buffer, p));
+ break;
+ }
+
+ strlcat(p, "\"", sizeof(buffer));
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
+ }
+ }
+ }
+ break;
+
+ case GPS_ALM:
+ break;
+
+ case GPS_EPH:
+ break;
+
+ case GPS_UTC:
+ {
+ UTC utc;
+ char buffer[512];
+ char *p;
+
+ p = buffer;
+
+ get_mbg_utc(&bufp, &utc);
+
+ if (utc.valid)
+ {
+ strlcpy(p, "gps_utc_correction=\"", sizeof(buffer));
+ p += strlen(p);
+ mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt, utc.delta_tls, utc.delta_tlsf, BUFFER_SIZE(buffer, p));
+ strlcat(p, "\"", BUFFER_SIZE(buffer, p));
+ }
+ else
+ {
+ strlcpy(p, "gps_utc_correction=\"<NO UTC DATA>\"", BUFFER_SIZE(buffer, p));
+ }
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
+ }
+ break;
+
+ case GPS_IONO:
+ break;
+
+ case GPS_ASCII_MSG:
+ {
+ ASCII_MSG gps_ascii_msg;
+ char buffer[128];
+
+ get_mbg_ascii_msg(&bufp, &gps_ascii_msg);
+
+ if (gps_ascii_msg.valid)
+ {
+ char buffer1[128];
+ mkreadable(buffer1, sizeof(buffer1), gps_ascii_msg.s, strlen(gps_ascii_msg.s), (int)0);
+
+ snprintf(buffer, sizeof(buffer), "gps_message=\"%s\"", buffer1);
+ }
+ else
+ strlcpy(buffer, "gps_message=<NONE>", sizeof(buffer));
+
+ set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
+ }
+
+ break;
+
+ default:
+ break;
+ }
+ }
+ else
+ {
+ msyslog(LOG_DEBUG, "PARSE receiver #%d: gps16x_message: message checksum error: hdr_csum = 0x%x (expected 0x%lx), data_len = %d, data_csum = 0x%x (expected 0x%lx)",
+ CLK_UNIT(parse->peer),
+ header.gps_hdr_csum, mbg_csum(parsetime->parse_msg + 1, 6),
+ header.gps_len,
+ header.gps_data_csum, mbg_csum(bufp, (unsigned)((header.gps_len < sizeof(parsetime->parse_msg)) ? header.gps_len : 0)));
+ }
+ }
+
+ return;
+}
+
+/*------------------------------------------------------------
+ * gps16x_poll - query the reciver peridically
+ */
+static void
+gps16x_poll(
+ struct peer *peer
+ )
+{
+ struct parseunit *parse = peer->procptr->unitptr;
+
+ static GPS_MSG_HDR sequence[] =
+ {
+ { GPS_SW_REV, 0, 0, 0 },
+ { GPS_STAT, 0, 0, 0 },
+ { GPS_UTC, 0, 0, 0 },
+ { GPS_ASCII_MSG, 0, 0, 0 },
+ { GPS_ANT_INFO, 0, 0, 0 },
+ { GPS_CFGH, 0, 0, 0 },
+ { GPS_POS_XYZ, 0, 0, 0 },
+ { GPS_POS_LLA, 0, 0, 0 },
+ { (unsigned short)~0, 0, 0, 0 }
+ };
+
+ int rtc;
+ unsigned char cmd_buffer[64];
+ unsigned char *outp = cmd_buffer;
+ GPS_MSG_HDR *header;
+
+ if (((poll_info_t *)parse->parse_type->cl_data)->rate)
+ {
+ parse->peer->procptr->nextaction = current_time + ((poll_info_t *)parse->parse_type->cl_data)->rate;
+ }
+
+ if (sequence[parse->localstate].gps_cmd == (unsigned short)~0)
+ parse->localstate = 0;
+
+ header = sequence + parse->localstate++;
+
+ *outp++ = SOH; /* start command */
+
+ put_mbg_header(&outp, header);
+ outp = cmd_buffer + 1;
+
+ header->gps_hdr_csum = (short)mbg_csum(outp, 6);
+ put_mbg_header(&outp, header);
+
+#ifdef DEBUG
+ if (debug > 2)
+ {
+ char buffer[128];
+
+ mkreadable(buffer, sizeof(buffer), (char *)cmd_buffer, (unsigned)(outp - cmd_buffer), 1);
+ printf("PARSE receiver #%d: transmitted message #%ld (%d bytes) >%s<\n",
+ CLK_UNIT(parse->peer),
+ parse->localstate - 1,
+ (int)(outp - cmd_buffer),
+ buffer);
+ }
+#endif
+
+ rtc = write(parse->generic->io.fd, cmd_buffer, (unsigned long)(outp - cmd_buffer));
+
+ if (rtc < 0)
+ {
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR, "PARSE receiver #%d: gps16x_poll: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
+ }
+ else
+ if (rtc != outp - cmd_buffer)
+ {
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR, "PARSE receiver #%d: gps16x_poll: failed to send cmd incomplete (%d of %d bytes sent)", CLK_UNIT(parse->peer), rtc, (int)(outp - cmd_buffer));
+ }
+
+ clear_err(parse, ERR_BADIO);
+ return;
+}
+
+/*--------------------------------------------------
+ * init routine - setup timer
+ */
+static int
+gps16x_poll_init(
+ struct parseunit *parse
+ )
+{
+ if (((poll_info_t *)parse->parse_type->cl_data)->rate)
+ {
+ parse->peer->procptr->action = gps16x_poll;
+ gps16x_poll(parse->peer);
+ }
+
+ return 0;
+}
+
+#else
+static void
+gps16x_message(
+ struct parseunit *parse,
+ parsetime_t *parsetime
+ )
+{}
+static int
+gps16x_poll_init(
+ struct parseunit *parse
+ )
+{
+ return 1;
+}
+#endif /* CLOCK_MEINBERG */
+
+/**===========================================================================
+ ** clock polling support
+ **/
+
+/*--------------------------------------------------
+ * direct poll routine
+ */
+static void
+poll_dpoll(
+ struct parseunit *parse
+ )
+{
+ int rtc;
+ const char *ps = ((poll_info_t *)parse->parse_type->cl_data)->string;
+ int ct = ((poll_info_t *)parse->parse_type->cl_data)->count;
+
+ rtc = write(parse->generic->io.fd, ps, (unsigned long)ct);
+ if (rtc < 0)
+ {
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
+ }
+ else
+ if (rtc != ct)
+ {
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR, "PARSE receiver #%d: poll_dpoll: failed to send cmd incomplete (%d of %d bytes sent)", CLK_UNIT(parse->peer), rtc, ct);
+ }
+ clear_err(parse, ERR_BADIO);
+}
+
+/*--------------------------------------------------
+ * periodic poll routine
+ */
+static void
+poll_poll(
+ struct peer *peer
+ )
+{
+ struct parseunit *parse = peer->procptr->unitptr;
+
+ if (parse->parse_type->cl_poll)
+ parse->parse_type->cl_poll(parse);
+
+ if (((poll_info_t *)parse->parse_type->cl_data)->rate)
+ {
+ parse->peer->procptr->nextaction = current_time + ((poll_info_t *)parse->parse_type->cl_data)->rate;
+ }
+}
+
+/*--------------------------------------------------
+ * init routine - setup timer
+ */
+static int
+poll_init(
+ struct parseunit *parse
+ )
+{
+ if (((poll_info_t *)parse->parse_type->cl_data)->rate)
+ {
+ parse->peer->procptr->action = poll_poll;
+ poll_poll(parse->peer);
+ }
+
+ return 0;
+}
+
+/**===========================================================================
+ ** Trimble support
+ **/
+
+/*-------------------------------------------------------------
+ * trimble TAIP init routine - setup EOL and then do poll_init.
+ */
+static int
+trimbletaip_init(
+ struct parseunit *parse
+ )
+{
+#ifdef HAVE_TERMIOS
+ struct termios tio;
+#endif
+#ifdef HAVE_SYSV_TTYS
+ struct termio tio;
+#endif
+ /*
+ * configure terminal line for trimble receiver
+ */
+ if (TTY_GETATTR(parse->generic->io.fd, &tio) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_init: tcgetattr(fd, &tio): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ else
+ {
+ tio.c_cc[VEOL] = TRIMBLETAIP_EOL;
+
+ if (TTY_SETATTR(parse->generic->io.fd, &tio) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_init: tcsetattr(fd, &tio): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+ }
+ return poll_init(parse);
+}
+
+/*--------------------------------------------------
+ * trimble TAIP event routine - reset receiver upon data format trouble
+ */
+static const char *taipinit[] = {
+ ">FPV00000000<",
+ ">SRM;ID_FLAG=F;CS_FLAG=T;EC_FLAG=F;FR_FLAG=T;CR_FLAG=F<",
+ ">FTM00020001<",
+ (char *)0
+};
+
+static void
+trimbletaip_event(
+ struct parseunit *parse,
+ int event
+ )
+{
+ switch (event)
+ {
+ case CEVNT_BADREPLY: /* reset on garbled input */
+ case CEVNT_TIMEOUT: /* reset on no input */
+ {
+ const char **iv;
+
+ iv = taipinit;
+ while (*iv)
+ {
+ int rtc = write(parse->generic->io.fd, *iv, strlen(*iv));
+ if (rtc < 0)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
+ return;
+ }
+ else
+ {
+ if (rtc != strlen(*iv))
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: failed to send cmd incomplete (%d of %d bytes sent)",
+ CLK_UNIT(parse->peer), rtc, (int)strlen(*iv));
+ return;
+ }
+ }
+ iv++;
+ }
+
+ NLOG(NLOG_CLOCKINFO)
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletaip_event: RECEIVER INITIALIZED",
+ CLK_UNIT(parse->peer));
+ }
+ break;
+
+ default: /* ignore */
+ break;
+ }
+}
+
+/*
+ * This driver supports the Trimble SVee Six Plus GPS receiver module.
+ * It should support other Trimble receivers which use the Trimble Standard
+ * Interface Protocol (see below).
+ *
+ * The module has a serial I/O port for command/data and a 1 pulse-per-second
+ * output, about 1 microsecond wide. The leading edge of the pulse is
+ * coincident with the change of the GPS second. This is the same as
+ * the change of the UTC second +/- ~1 microsecond. Some other clocks
+ * specifically use a feature in the data message as a timing reference, but
+ * the SVee Six Plus does not do this. In fact there is considerable jitter
+ * on the timing of the messages, so this driver only supports the use
+ * of the PPS pulse for accurate timing. Where it is determined that
+ * the offset is way off, when first starting up ntpd for example,
+ * the timing of the data stream is used until the offset becomes low enough
+ * (|offset| < CLOCK_MAX), at which point the pps offset is used.
+ *
+ * It can use either option for receiving PPS information - the 'ppsclock'
+ * stream pushed onto the serial data interface to timestamp the Carrier
+ * Detect interrupts, where the 1PPS connects to the CD line. This only
+ * works on SunOS 4.1.x currently. To select this, define PPSPPS in
+ * Config.local. The other option is to use a pulse-stretcher/level-converter
+ * to convert the PPS pulse into a RS232 start pulse & feed this into another
+ * tty port. To use this option, define PPSCLK in Config.local. The pps input,
+ * by whichever method, is handled in ntp_loopfilter.c
+ *
+ * The receiver uses a serial message protocol called Trimble Standard
+ * Interface Protocol (it can support others but this driver only supports
+ * TSIP). Messages in this protocol have the following form:
+ *
+ * <DLE><id> ... <data> ... <DLE><ETX>
+ *
+ * Any bytes within the <data> portion of value 10 hex (<DLE>) are doubled
+ * on transmission and compressed back to one on reception. Otherwise
+ * the values of data bytes can be anything. The serial interface is RS-422
+ * asynchronous using 9600 baud, 8 data bits with odd party (**note** 9 bits
+ * in total!), and 1 stop bit. The protocol supports byte, integer, single,
+ * and double datatypes. Integers are two bytes, sent most significant first.
+ * Singles are IEEE754 single precision floating point numbers (4 byte) sent
+ * sign & exponent first. Doubles are IEEE754 double precision floating point
+ * numbers (8 byte) sent sign & exponent first.
+ * The receiver supports a large set of messages, only a small subset of
+ * which are used here. From driver to receiver the following are used:
+ *
+ * ID Description
+ *
+ * 21 Request current time
+ * 22 Mode Select
+ * 2C Set/Request operating parameters
+ * 2F Request UTC info
+ * 35 Set/Request I/O options
+
+ * From receiver to driver the following are recognised:
+ *
+ * ID Description
+ *
+ * 41 GPS Time
+ * 44 Satellite selection, PDOP, mode
+ * 46 Receiver health
+ * 4B Machine code/status
+ * 4C Report operating parameters (debug only)
+ * 4F UTC correction data (used to get leap second warnings)
+ * 55 I/O options (debug only)
+ *
+ * All others are accepted but ignored.
+ *
+ */
+
+#define PI 3.1415926535898 /* lots of sig figs */
+#define D2R PI/180.0
+
+/*-------------------------------------------------------------------
+ * sendcmd, sendbyte, sendetx, sendflt, sendint implement the command
+ * interface to the receiver.
+ *
+ * CAVEAT: the sendflt, sendint routines are byte order dependend and
+ * float implementation dependend - these must be converted to portable
+ * versions !
+ *
+ * CURRENT LIMITATION: float implementation. This runs only on systems
+ * with IEEE754 floats as native floats
+ */
+
+typedef struct trimble
+{
+ u_long last_msg; /* last message received */
+ u_long last_reset; /* last time a reset was issued */
+ u_char qtracking; /* query tracking status */
+ u_long ctrack; /* current tracking set */
+ u_long ltrack; /* last tracking set */
+} trimble_t;
+
+union uval {
+ u_char bd[8];
+ int iv;
+ float fv;
+ double dv;
+};
+
+struct txbuf
+{
+ short idx; /* index to first unused byte */
+ u_char *txt; /* pointer to actual data buffer */
+};
+
+void sendcmd (struct txbuf *buf, int c);
+void sendbyte (struct txbuf *buf, int b);
+void sendetx (struct txbuf *buf, struct parseunit *parse);
+void sendint (struct txbuf *buf, int a);
+void sendflt (struct txbuf *buf, double a);
+
+void
+sendcmd(
+ struct txbuf *buf,
+ int c
+ )
+{
+ buf->txt[0] = DLE;
+ buf->txt[1] = (u_char)c;
+ buf->idx = 2;
+}
+
+void sendcmd (struct txbuf *buf, int c);
+void sendbyte (struct txbuf *buf, int b);
+void sendetx (struct txbuf *buf, struct parseunit *parse);
+void sendint (struct txbuf *buf, int a);
+void sendflt (struct txbuf *buf, double a);
+
+void
+sendbyte(
+ struct txbuf *buf,
+ int b
+ )
+{
+ if (b == DLE)
+ buf->txt[buf->idx++] = DLE;
+ buf->txt[buf->idx++] = (u_char)b;
+}
+
+void
+sendetx(
+ struct txbuf *buf,
+ struct parseunit *parse
+ )
+{
+ buf->txt[buf->idx++] = DLE;
+ buf->txt[buf->idx++] = ETX;
+
+ if (write(parse->generic->io.fd, buf->txt, (unsigned long)buf->idx) != buf->idx)
+ {
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR, "PARSE receiver #%d: sendetx: failed to send cmd to clock: %m", CLK_UNIT(parse->peer));
+ }
+ else
+ {
+#ifdef DEBUG
+ if (debug > 2)
+ {
+ char buffer[256];
+
+ mkreadable(buffer, sizeof(buffer), (char *)buf->txt, (unsigned)buf->idx, 1);
+ printf("PARSE receiver #%d: transmitted message (%d bytes) >%s<\n",
+ CLK_UNIT(parse->peer),
+ buf->idx, buffer);
+ }
+#endif
+ clear_err(parse, ERR_BADIO);
+ }
+}
+
+void
+sendint(
+ struct txbuf *buf,
+ int a
+ )
+{
+ /* send 16bit int, msbyte first */
+ sendbyte(buf, (u_char)((a>>8) & 0xff));
+ sendbyte(buf, (u_char)(a & 0xff));
+}
+
+void
+sendflt(
+ struct txbuf *buf,
+ double a
+ )
+{
+ int i;
+ union uval uval;
+
+ uval.fv = a;
+#ifdef WORDS_BIGENDIAN
+ for (i=0; i<=3; i++)
+#else
+ for (i=3; i>=0; i--)
+#endif
+ sendbyte(buf, uval.bd[i]);
+}
+
+#define TRIM_POS_OPT 0x13 /* output position with high precision */
+#define TRIM_TIME_OPT 0x03 /* use UTC time stamps, on second */
+
+/*--------------------------------------------------
+ * trimble TSIP setup routine
+ */
+static int
+trimbletsip_setup(
+ struct parseunit *parse,
+ const char *reason
+ )
+{
+ u_char buffer[256];
+ struct txbuf buf;
+ trimble_t *t = parse->localdata;
+
+ if (t && t->last_reset &&
+ ((t->last_reset + TRIMBLE_RESET_HOLDOFF) > current_time)) {
+ return 1; /* not yet */
+ }
+
+ if (t)
+ t->last_reset = current_time;
+
+ buf.txt = buffer;
+
+ sendcmd(&buf, CMD_CVERSION); /* request software versions */
+ sendetx(&buf, parse);
+
+ sendcmd(&buf, CMD_COPERPARAM); /* set operating parameters */
+ sendbyte(&buf, 4); /* static */
+ sendflt(&buf, 5.0*D2R); /* elevation angle mask = 10 deg XXX */
+ sendflt(&buf, 4.0); /* s/n ratio mask = 6 XXX */
+ sendflt(&buf, 12.0); /* PDOP mask = 12 */
+ sendflt(&buf, 8.0); /* PDOP switch level = 8 */
+ sendetx(&buf, parse);
+
+ sendcmd(&buf, CMD_CMODESEL); /* fix mode select */
+ sendbyte(&buf, 1); /* time transfer mode */
+ sendetx(&buf, parse);
+
+ sendcmd(&buf, CMD_CMESSAGE); /* request system message */
+ sendetx(&buf, parse);
+
+ sendcmd(&buf, CMD_CSUPER); /* superpacket fix */
+ sendbyte(&buf, 0x2); /* binary mode */
+ sendetx(&buf, parse);
+
+ sendcmd(&buf, CMD_CIOOPTIONS); /* set I/O options */
+ sendbyte(&buf, TRIM_POS_OPT); /* position output */
+ sendbyte(&buf, 0x00); /* no velocity output */
+ sendbyte(&buf, TRIM_TIME_OPT); /* UTC, compute on seconds */
+ sendbyte(&buf, 0x00); /* no raw measurements */
+ sendetx(&buf, parse);
+
+ sendcmd(&buf, CMD_CUTCPARAM); /* request UTC correction data */
+ sendetx(&buf, parse);
+
+ NLOG(NLOG_CLOCKINFO)
+ ERR(ERR_BADIO)
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletsip_setup: RECEIVER RE-INITIALIZED (%s)", CLK_UNIT(parse->peer), reason);
+
+ return 0;
+}
+
+/*--------------------------------------------------
+ * TRIMBLE TSIP check routine
+ */
+static void
+trimble_check(
+ struct peer *peer
+ )
+{
+ struct parseunit *parse = peer->procptr->unitptr;
+ trimble_t *t = parse->localdata;
+ u_char buffer[256];
+ struct txbuf buf;
+ buf.txt = buffer;
+
+ if (t)
+ {
+ if (current_time > t->last_msg + TRIMBLETSIP_IDLE_TIME)
+ (void)trimbletsip_setup(parse, "message timeout");
+ }
+
+ poll_poll(parse->peer); /* emit query string and re-arm timer */
+
+ if (t && t->qtracking)
+ {
+ u_long oldsats = t->ltrack & ~t->ctrack;
+
+ t->qtracking = 0;
+ t->ltrack = t->ctrack;
+
+ if (oldsats)
+ {
+ int i;
+
+ for (i = 0; oldsats; i++) {
+ if (oldsats & (1 << i))
+ {
+ sendcmd(&buf, CMD_CSTATTRACK);
+ sendbyte(&buf, i+1); /* old sat */
+ sendetx(&buf, parse);
+ }
+ oldsats &= ~(1 << i);
+ }
+ }
+
+ sendcmd(&buf, CMD_CSTATTRACK);
+ sendbyte(&buf, 0x00); /* current tracking set */
+ sendetx(&buf, parse);
+ }
+}
+
+/*--------------------------------------------------
+ * TRIMBLE TSIP end routine
+ */
+static void
+trimbletsip_end(
+ struct parseunit *parse
+ )
+{ trimble_t *t = parse->localdata;
+
+ if (t)
+ {
+ free(t);
+ parse->localdata = NULL;
+ }
+ parse->peer->procptr->nextaction = 0;
+ parse->peer->procptr->action = NULL;
+}
+
+/*--------------------------------------------------
+ * TRIMBLE TSIP init routine
+ */
+static int
+trimbletsip_init(
+ struct parseunit *parse
+ )
+{
+#if defined(VEOL) || defined(VEOL2)
+#ifdef HAVE_TERMIOS
+ struct termios tio; /* NEEDED FOR A LONG TIME ! */
+#endif
+#ifdef HAVE_SYSV_TTYS
+ struct termio tio; /* NEEDED FOR A LONG TIME ! */
+#endif
+ /*
+ * allocate local data area
+ */
+ if (!parse->localdata)
+ {
+ trimble_t *t;
+
+ t = (trimble_t *)(parse->localdata = emalloc(sizeof(trimble_t)));
+
+ if (t)
+ {
+ memset((char *)t, 0, sizeof(trimble_t));
+ t->last_msg = current_time;
+ }
+ }
+
+ parse->peer->procptr->action = trimble_check;
+ parse->peer->procptr->nextaction = current_time;
+
+ /*
+ * configure terminal line for ICANON mode with VEOL characters
+ */
+ if (TTY_GETATTR(parse->generic->io.fd, &tio) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletsip_init: tcgetattr(%d, &tio): %m", CLK_UNIT(parse->peer), parse->generic->io.fd);
+ return 0;
+ }
+ else
+ {
+ if ((parse_clockinfo[CLK_TYPE(parse->peer)].cl_lflag & ICANON))
+ {
+#ifdef VEOL
+ tio.c_cc[VEOL] = ETX;
+#endif
+#ifdef VEOL2
+ tio.c_cc[VEOL2] = DLE;
+#endif
+ }
+
+ if (TTY_SETATTR(parse->generic->io.fd, &tio) == -1)
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: trimbletsip_init: tcsetattr(%d, &tio): %m", CLK_UNIT(parse->peer), parse->generic->io.fd);
+ return 0;
+ }
+ }
+#endif
+ return trimbletsip_setup(parse, "initial startup");
+}
+
+/*------------------------------------------------------------
+ * trimbletsip_event - handle Trimble events
+ * simple evente handler - attempt to re-initialize receiver
+ */
+static void
+trimbletsip_event(
+ struct parseunit *parse,
+ int event
+ )
+{
+ switch (event)
+ {
+ case CEVNT_BADREPLY: /* reset on garbled input */
+ case CEVNT_TIMEOUT: /* reset on no input */
+ (void)trimbletsip_setup(parse, "event BAD_REPLY/TIMEOUT");
+ break;
+
+ default: /* ignore */
+ break;
+ }
+}
+
+/*
+ * getflt, getint convert fields in the incoming data into the
+ * appropriate type of item
+ *
+ * CAVEAT: these routines are currently definitely byte order dependent
+ * and assume Representation(float) == IEEE754
+ * These functions MUST be converted to portable versions (especially
+ * converting the float representation into ntp_fp formats in order
+ * to avoid floating point operations at all!
+ */
+
+static float
+getflt(
+ u_char *bp
+ )
+{
+ union uval uval;
+
+#ifdef WORDS_BIGENDIAN
+ uval.bd[0] = *bp++;
+ uval.bd[1] = *bp++;
+ uval.bd[2] = *bp++;
+ uval.bd[3] = *bp;
+#else /* ! WORDS_BIGENDIAN */
+ uval.bd[3] = *bp++;
+ uval.bd[2] = *bp++;
+ uval.bd[1] = *bp++;
+ uval.bd[0] = *bp;
+#endif /* ! WORDS_BIGENDIAN */
+ return uval.fv;
+}
+
+static double
+getdbl(
+ u_char *bp
+ )
+{
+ union uval uval;
+
+#ifdef WORDS_BIGENDIAN
+ uval.bd[0] = *bp++;
+ uval.bd[1] = *bp++;
+ uval.bd[2] = *bp++;
+ uval.bd[3] = *bp++;
+ uval.bd[4] = *bp++;
+ uval.bd[5] = *bp++;
+ uval.bd[6] = *bp++;
+ uval.bd[7] = *bp;
+#else /* ! WORDS_BIGENDIAN */
+ uval.bd[7] = *bp++;
+ uval.bd[6] = *bp++;
+ uval.bd[5] = *bp++;
+ uval.bd[4] = *bp++;
+ uval.bd[3] = *bp++;
+ uval.bd[2] = *bp++;
+ uval.bd[1] = *bp++;
+ uval.bd[0] = *bp;
+#endif /* ! WORDS_BIGENDIAN */
+ return uval.dv;
+}
+
+static int
+getshort(
+ unsigned char *p
+ )
+{
+ return get_msb_short(&p);
+}
+
+/*--------------------------------------------------
+ * trimbletsip_message - process trimble messages
+ */
+#define RTOD (180.0 / 3.1415926535898)
+#define mb(_X_) (buffer[2+(_X_)]) /* shortcut for buffer access */
+
+static void
+trimbletsip_message(
+ struct parseunit *parse,
+ parsetime_t *parsetime
+ )
+{
+ unsigned char *buffer = parsetime->parse_msg;
+ unsigned int size = parsetime->parse_msglen;
+
+ if ((size < 4) ||
+ (buffer[0] != DLE) ||
+ (buffer[size-1] != ETX) ||
+ (buffer[size-2] != DLE))
+ {
+#ifdef DEBUG
+ if (debug > 2) {
+ int i;
+
+ printf("TRIMBLE BAD packet, size %d:\n ", size);
+ for (i = 0; i < size; i++) {
+ printf ("%2.2x, ", buffer[i]&0xff);
+ if (i%16 == 15) printf("\n\t");
+ }
+ printf("\n");
+ }
+#endif
+ return;
+ }
+ else
+ {
+ int var_flag;
+ trimble_t *tr = parse->localdata;
+ unsigned int cmd = buffer[1];
+ char pbuffer[200];
+ char *t = pbuffer;
+ cmd_info_t *s;
+
+#ifdef DEBUG
+ if (debug > 3) {
+ int i;
+
+ printf("TRIMBLE packet 0x%02x, size %d:\n ", cmd, size);
+ for (i = 0; i < size; i++) {
+ printf ("%2.2x, ", buffer[i]&0xff);
+ if (i%16 == 15) printf("\n\t");
+ }
+ printf("\n");
+ }
+#endif
+
+ if (tr)
+ tr->last_msg = current_time;
+
+ s = trimble_convert(cmd, trimble_rcmds);
+
+ if (s)
+ {
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "%s=\"", s->varname);
+ }
+ else
+ {
+ DPRINTF(1, ("TRIMBLE UNKNOWN COMMAND 0x%02x\n", cmd));
+ return;
+ }
+
+ var_flag = s->varmode;
+
+ t += strlen(t);
+
+ switch(cmd)
+ {
+ case CMD_RCURTIME:
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "%f, %d, %f",
+ getflt((unsigned char *)&mb(0)), getshort((unsigned char *)&mb(4)),
+ getflt((unsigned char *)&mb(6)));
+ break;
+
+ case CMD_RBEST4:
+ strlcpy(t, "mode: ", BUFFER_SIZE(pbuffer, t));
+ t += strlen(t);
+ switch (mb(0) & 0xF)
+ {
+ default:
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "0x%x", mb(0) & 0x7);
+ break;
+
+ case 1:
+ strlcpy(t, "0D", BUFFER_SIZE(pbuffer, t));
+ break;
+
+ case 3:
+ strlcpy(t, "2D", BUFFER_SIZE(pbuffer, t));
+ break;
+
+ case 4:
+ strlcpy(t, "3D", BUFFER_SIZE(pbuffer, t));
+ break;
+ }
+ t += strlen(t);
+ if (mb(0) & 0x10)
+ strlcpy(t, "-MANUAL, ", BUFFER_SIZE(pbuffer, t));
+ else
+ strlcpy(t, "-AUTO, ", BUFFER_SIZE(pbuffer, t));
+ t += strlen(t);
+
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "satellites %02d %02d %02d %02d, PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f",
+ mb(1), mb(2), mb(3), mb(4),
+ getflt((unsigned char *)&mb(5)),
+ getflt((unsigned char *)&mb(9)),
+ getflt((unsigned char *)&mb(13)),
+ getflt((unsigned char *)&mb(17)));
+
+ break;
+
+ case CMD_RVERSION:
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "%d.%d (%d/%d/%d)",
+ mb(0)&0xff, mb(1)&0xff, 1900+(mb(4)&0xff), mb(2)&0xff, mb(3)&0xff);
+ break;
+
+ case CMD_RRECVHEALTH:
+ {
+ static const char *msgs[] =
+ {
+ "Battery backup failed",
+ "Signal processor error",
+ "Alignment error, channel or chip 1",
+ "Alignment error, channel or chip 2",
+ "Antenna feed line fault",
+ "Excessive ref freq. error",
+ "<BIT 6>",
+ "<BIT 7>"
+ };
+
+ int i, bits;
+
+ switch (mb(0) & 0xFF)
+ {
+ default:
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "illegal value 0x%02x", mb(0) & 0xFF);
+ break;
+ case 0x00:
+ strlcpy(t, "doing position fixes", BUFFER_SIZE(pbuffer, t));
+ break;
+ case 0x01:
+ strlcpy(t, "no GPS time yet", BUFFER_SIZE(pbuffer, t));
+ break;
+ case 0x03:
+ strlcpy(t, "PDOP too high", BUFFER_SIZE(pbuffer, t));
+ break;
+ case 0x08:
+ strlcpy(t, "no usable satellites", BUFFER_SIZE(pbuffer, t));
+ break;
+ case 0x09:
+ strlcpy(t, "only ONE usable satellite", BUFFER_SIZE(pbuffer, t));
+ break;
+ case 0x0A:
+ strlcpy(t, "only TWO usable satellites", BUFFER_SIZE(pbuffer, t));
+ break;
+ case 0x0B:
+ strlcpy(t, "only THREE usable satellites", BUFFER_SIZE(pbuffer, t));
+ break;
+ case 0x0C:
+ strlcpy(t, "the chosen satellite is unusable", BUFFER_SIZE(pbuffer, t));
+ break;
+ }
+
+ t += strlen(t);
+
+ bits = mb(1) & 0xFF;
+
+ for (i = 0; i < 8; i++)
+ if (bits & (0x1<<i))
+ {
+ snprintf(t, BUFFER_SIZE(pbuffer, t), ", %s", msgs[i]);
+ t += strlen(t);
+ }
+ }
+ break;
+
+ case CMD_RMESSAGE:
+ mkreadable(t, (int)BUFFER_SIZE(pbuffer, t), (char *)&mb(0), (unsigned)(size - 2 - (&mb(0) - buffer)), 0);
+ break;
+
+ case CMD_RMACHSTAT:
+ {
+ static const char *msgs[] =
+ {
+ "Synthesizer Fault",
+ "Battery Powered Time Clock Fault",
+ "A-to-D Converter Fault",
+ "The almanac stored in the receiver is not complete and current",
+ "<BIT 4>",
+ "<BIT 5",
+ "<BIT 6>",
+ "<BIT 7>"
+ };
+
+ int i, bits;
+
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "machine id 0x%02x", mb(0) & 0xFF);
+ t += strlen(t);
+
+ bits = mb(1) & 0xFF;
+
+ for (i = 0; i < 8; i++)
+ if (bits & (0x1<<i))
+ {
+ snprintf(t, BUFFER_SIZE(pbuffer, t), ", %s", msgs[i]);
+ t += strlen(t);
+ }
+
+ snprintf(t, BUFFER_SIZE(pbuffer, t), ", Superpackets %ssupported", (mb(2) & 0xFF) ? "" :"un" );
+ }
+ break;
+
+ case CMD_ROPERPARAM:
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "%2x %.1f %.1f %.1f %.1f",
+ mb(0), getflt((unsigned char *)&mb(1)), getflt((unsigned char *)&mb(5)),
+ getflt((unsigned char *)&mb(9)), getflt((unsigned char *)&mb(13)));
+ break;
+
+ case CMD_RUTCPARAM:
+ {
+ float t0t = getflt((unsigned char *)&mb(14));
+ short wnt = getshort((unsigned char *)&mb(18));
+ short dtls = getshort((unsigned char *)&mb(12));
+ short wnlsf = getshort((unsigned char *)&mb(20));
+ short dn = getshort((unsigned char *)&mb(22));
+ short dtlsf = getshort((unsigned char *)&mb(24));
+
+ if ((int)t0t != 0)
+ {
+ mk_utcinfo(t, wnt, wnlsf, dn, dtls, dtlsf, BUFFER_SIZE(pbuffer, t));
+ }
+ else
+ {
+ strlcpy(t, "<NO UTC DATA>", BUFFER_SIZE(pbuffer, t));
+ }
+ }
+ break;
+
+ case CMD_RSAT1BIAS:
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "%.1fm %.2fm/s at %.1fs",
+ getflt(&mb(0)), getflt(&mb(4)), getflt(&mb(8)));
+ break;
+
+ case CMD_RIOOPTIONS:
+ {
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "%02x %02x %02x %02x",
+ mb(0), mb(1), mb(2), mb(3));
+ if (mb(0) != TRIM_POS_OPT ||
+ mb(2) != TRIM_TIME_OPT)
+ {
+ (void)trimbletsip_setup(parse, "bad io options");
+ }
+ }
+ break;
+
+ case CMD_RSPOSXYZ:
+ {
+ double x = getflt((unsigned char *)&mb(0));
+ double y = getflt((unsigned char *)&mb(4));
+ double z = getflt((unsigned char *)&mb(8));
+ double f = getflt((unsigned char *)&mb(12));
+
+ if (f > 0.0)
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "x= %.1fm, y= %.1fm, z= %.1fm, time_of_fix= %f sec",
+ x, y, z,
+ f);
+ else
+ return;
+ }
+ break;
+
+ case CMD_RSLLAPOS:
+ {
+ double lat = getflt((unsigned char *)&mb(0));
+ double lng = getflt((unsigned char *)&mb(4));
+ double f = getflt((unsigned char *)&mb(12));
+
+ if (f > 0.0)
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "lat %f %c, long %f %c, alt %.2fm",
+ ((lat < 0.0) ? (-lat) : (lat))*RTOD, (lat < 0.0 ? 'S' : 'N'),
+ ((lng < 0.0) ? (-lng) : (lng))*RTOD, (lng < 0.0 ? 'W' : 'E'),
+ getflt((unsigned char *)&mb(8)));
+ else
+ return;
+ }
+ break;
+
+ case CMD_RDOUBLEXYZ:
+ {
+ double x = getdbl((unsigned char *)&mb(0));
+ double y = getdbl((unsigned char *)&mb(8));
+ double z = getdbl((unsigned char *)&mb(16));
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "x= %.1fm, y= %.1fm, z= %.1fm",
+ x, y, z);
+ }
+ break;
+
+ case CMD_RDOUBLELLA:
+ {
+ double lat = getdbl((unsigned char *)&mb(0));
+ double lng = getdbl((unsigned char *)&mb(8));
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "lat %f %c, lon %f %c, alt %.2fm",
+ ((lat < 0.0) ? (-lat) : (lat))*RTOD, (lat < 0.0 ? 'S' : 'N'),
+ ((lng < 0.0) ? (-lng) : (lng))*RTOD, (lng < 0.0 ? 'W' : 'E'),
+ getdbl((unsigned char *)&mb(16)));
+ }
+ break;
+
+ case CMD_RALLINVIEW:
+ {
+ int i, sats;
+
+ strlcpy(t, "mode: ", BUFFER_SIZE(pbuffer, t));
+ t += strlen(t);
+ switch (mb(0) & 0x7)
+ {
+ default:
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "0x%x", mb(0) & 0x7);
+ break;
+
+ case 3:
+ strlcpy(t, "2D", BUFFER_SIZE(pbuffer, t));
+ break;
+
+ case 4:
+ strlcpy(t, "3D", BUFFER_SIZE(pbuffer, t));
+ break;
+ }
+ t += strlen(t);
+ if (mb(0) & 0x8)
+ strlcpy(t, "-MANUAL, ", BUFFER_SIZE(pbuffer, t));
+ else
+ strlcpy(t, "-AUTO, ", BUFFER_SIZE(pbuffer, t));
+ t += strlen(t);
+
+ sats = (mb(0)>>4) & 0xF;
+
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f, %d satellite%s in view: ",
+ getflt((unsigned char *)&mb(1)),
+ getflt((unsigned char *)&mb(5)),
+ getflt((unsigned char *)&mb(9)),
+ getflt((unsigned char *)&mb(13)),
+ sats, (sats == 1) ? "" : "s");
+ t += strlen(t);
+
+ for (i=0; i < sats; i++)
+ {
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "%s%02d", i ? ", " : "", mb(17+i));
+ t += strlen(t);
+ if (tr)
+ tr->ctrack |= (1 << (mb(17+i)-1));
+ }
+
+ if (tr)
+ { /* mark for tracking status query */
+ tr->qtracking = 1;
+ }
+ }
+ break;
+
+ case CMD_RSTATTRACK:
+ {
+ snprintf(t-2, BUFFER_SIZE(pbuffer, t-2), "[%02d]=\"", mb(0)); /* add index to var name */
+ t += strlen(t);
+
+ if (getflt((unsigned char *)&mb(4)) < 0.0)
+ {
+ strlcpy(t, "<NO MEASUREMENTS>", BUFFER_SIZE(pbuffer, t));
+ var_flag &= ~DEF;
+ }
+ else
+ {
+ snprintf(t, BUFFER_SIZE(pbuffer, t), "ch=%d, acq=%s, eph=%d, signal_level= %5.2f, elevation= %5.2f, azimuth= %6.2f",
+ (mb(1) & 0xFF)>>3,
+ mb(2) ? ((mb(2) == 1) ? "ACQ" : "SRCH") : "NEVER",
+ mb(3),
+ getflt((unsigned char *)&mb(4)),
+ getflt((unsigned char *)&mb(12)) * RTOD,
+ getflt((unsigned char *)&mb(16)) * RTOD);
+ t += strlen(t);
+ if (mb(20))
+ {
+ var_flag &= ~DEF;
+ strlcpy(t, ", OLD", BUFFER_SIZE(pbuffer, t));
+ }
+ t += strlen(t);
+ if (mb(22))
+ {
+ if (mb(22) == 1)
+ strlcpy(t, ", BAD PARITY", BUFFER_SIZE(pbuffer, t));
+ else
+ if (mb(22) == 2)
+ strlcpy(t, ", BAD EPH HEALTH", BUFFER_SIZE(pbuffer, t));
+ }
+ t += strlen(t);
+ if (mb(23))
+ strlcpy(t, ", collecting data", BUFFER_SIZE(pbuffer, t));
+ }
+ }
+ break;
+
+ default:
+ strlcpy(t, "<UNDECODED>", BUFFER_SIZE(pbuffer, t));
+ break;
+ }
+ t += strlen(t);
+
+ strlcpy(t,"\"", BUFFER_SIZE(pbuffer, t));
+ set_var(&parse->kv, pbuffer, sizeof(pbuffer), var_flag);
+ }
+}
+
+
+/**============================================================
+ ** RAWDCF support
+ **/
+
+/*--------------------------------------------------
+ * rawdcf_init_1 - set up modem lines for RAWDCF receivers
+ * SET DTR line
+ */
+#if defined(TIOCMSET) && (defined(TIOCM_DTR) || defined(CIOCM_DTR))
+static int
+rawdcf_init_1(
+ struct parseunit *parse
+ )
+{
+ /* fixed 2000 for using with Linux by Wolfram Pienkoss <wp@bszh.de> */
+ /*
+ * You can use the RS232 to supply the power for a DCF77 receiver.
+ * Here a voltage between the DTR and the RTS line is used. Unfortunately
+ * the name has changed from CIOCM_DTR to TIOCM_DTR recently.
+ */
+ int sl232;
+
+ if (ioctl(parse->generic->io.fd, TIOCMGET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: ioctl(fd, TIOCMGET, [C|T]IOCM_DTR): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+
+#ifdef TIOCM_DTR
+ sl232 = (sl232 & ~TIOCM_RTS) | TIOCM_DTR; /* turn on DTR, clear RTS for power supply */
+#else
+ sl232 = (sl232 & ~CIOCM_RTS) | CIOCM_DTR; /* turn on DTR, clear RTS for power supply */
+#endif
+
+ if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_DTR): %m", CLK_UNIT(parse->peer));
+ }
+ return 0;
+}
+#else
+static int
+rawdcfdtr_init_1(
+ struct parseunit *parse
+ )
+{
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: OS interface incapable of setting DTR to power DCF modules", CLK_UNIT(parse->peer));
+ return 0;
+}
+#endif /* DTR initialisation type */
+
+/*--------------------------------------------------
+ * rawdcf_init_2 - set up modem lines for RAWDCF receivers
+ * CLR DTR line, SET RTS line
+ */
+#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
+static int
+rawdcf_init_2(
+ struct parseunit *parse
+ )
+{
+ /* fixed 2000 for using with Linux by Wolfram Pienkoss <wp@bszh.de> */
+ /*
+ * You can use the RS232 to supply the power for a DCF77 receiver.
+ * Here a voltage between the DTR and the RTS line is used. Unfortunately
+ * the name has changed from CIOCM_DTR to TIOCM_DTR recently.
+ */
+ int sl232;
+
+ if (ioctl(parse->generic->io.fd, TIOCMGET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: ioctl(fd, TIOCMGET, [C|T]IOCM_RTS): %m", CLK_UNIT(parse->peer));
+ return 0;
+ }
+
+#ifdef TIOCM_RTS
+ sl232 = (sl232 & ~TIOCM_DTR) | TIOCM_RTS; /* turn on RTS, clear DTR for power supply */
+#else
+ sl232 = (sl232 & ~CIOCM_DTR) | CIOCM_RTS; /* turn on RTS, clear DTR for power supply */
+#endif
+
+ if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
+ {
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_RTS): %m", CLK_UNIT(parse->peer));
+ }
+ return 0;
+}
+#else
+static int
+rawdcf_init_2(
+ struct parseunit *parse
+ )
+{
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: OS interface incapable of setting RTS to power DCF modules", CLK_UNIT(parse->peer));
+ return 0;
+}
+#endif /* DTR initialisation type */
+
+#else /* defined(REFCLOCK) && defined(PARSE) */
+NONEMPTY_TRANSLATION_UNIT
+#endif /* defined(REFCLOCK) && defined(PARSE) */
+
+/*
+ * History:
+ *
+ * refclock_parse.c,v
+ * Revision 4.81 2009/05/01 10:15:29 kardel
+ * use new refclock_ppsapi interface
+ *
+ * Revision 4.80 2007/08/11 12:06:29 kardel
+ * update comments wrt/ to PPS
+ *
+ * Revision 4.79 2007/08/11 11:52:23 kardel
+ * - terminate io bindings before io_closeclock() will close our file descriptor
+ *
+ * Revision 4.78 2006/12/22 20:08:27 kardel
+ * Bug 746 (RFE): add configuration for Expert mouseCLOCK USB v2.0 as mode 19
+ *
+ * Revision 4.77 2006/08/05 07:44:49 kardel
+ * support optionally separate PPS devices via /dev/refclockpps-{0..3}
+ *
+ * Revision 4.76 2006/06/22 18:40:47 kardel
+ * clean up signedness (gcc 4)
+ *
+ * Revision 4.75 2006/06/22 16:58:10 kardel
+ * Bug #632: call parse_ppsapi() in parse_ctl() when updating
+ * the PPS offset. Fix sign of offset passed to kernel.
+ *
+ * Revision 4.74 2006/06/18 21:18:37 kardel
+ * NetBSD Coverity CID 3796: possible NULL deref
+ *
+ * Revision 4.73 2006/05/26 14:23:46 kardel
+ * cleanup of copyright info
+ *
+ * Revision 4.72 2006/05/26 14:19:43 kardel
+ * cleanup of ioctl cruft
+ *
+ * Revision 4.71 2006/05/26 14:15:57 kardel
+ * delay adding refclock to async refclock io after all initializations
+ *
+ * Revision 4.70 2006/05/25 18:20:50 kardel
+ * bug #619
+ * terminate parse io engine after de-registering
+ * from refclock io engine
+ *
+ * Revision 4.69 2006/05/25 17:28:02 kardel
+ * complete refclock io structure initialization *before* inserting it into the
+ * refclock input machine (avoids null pointer deref) (bug #619)
+ *
+ * Revision 4.68 2006/05/01 17:02:51 kardel
+ * copy receiver method also for newlwy created receive buffers
+ *
+ * Revision 4.67 2006/05/01 14:37:29 kardel
+ * If an input buffer parses into more than one message do insert the
+ * parsed message in a new input buffer instead of processing it
+ * directly. This avoids deed complicated processing in signal
+ * handling.
+ *
+ * Revision 4.66 2006/03/18 00:45:30 kardel
+ * coverity fixes found in NetBSD coverity scan
+ *
+ * Revision 4.65 2006/01/26 06:08:33 kardel
+ * output errno on PPS setup failure
+ *
+ * Revision 4.64 2005/11/09 20:44:47 kardel
+ * utilize full PPS timestamp resolution from PPS API
+ *
+ * Revision 4.63 2005/10/07 22:10:25 kardel
+ * bounded buffer implementation
+ *
+ * Revision 4.62.2.2 2005/09/25 10:20:16 kardel
+ * avoid unexpected buffer overflows due to sprintf("%f") on strange floats:
+ * replace almost all str* and *printf functions be their buffer bounded
+ * counterparts
+ *
+ * Revision 4.62.2.1 2005/08/27 16:19:27 kardel
+ * limit re-set rate of trimble clocks
+ *
+ * Revision 4.62 2005/08/06 17:40:00 kardel
+ * cleanup size handling wrt/ to buffer boundaries
+ *
+ * Revision 4.61 2005/07/27 21:16:19 kardel
+ * fix a long (> 11 years) misconfiguration wrt/ Meinberg cflag factory
+ * default setup. CSTOPB was missing for the 7E2 default data format of
+ * the DCF77 clocks.
+ *
+ * Revision 4.60 2005/07/17 21:14:44 kardel
+ * change contents of version string to include the RCS/CVS Id
+ *
+ * Revision 4.59 2005/07/06 06:56:38 kardel
+ * syntax error
+ *
+ * Revision 4.58 2005/07/04 13:10:40 kardel
+ * fix bug 455: tripping over NULL pointer on cleanup
+ * fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2
+ * fix compiler warnings for some platforms wrt/ printf formatstrings and
+ * varying structure element sizes
+ * reorder assignment in binding to avoid tripping over NULL pointers
+ *
+ * Revision 4.57 2005/06/25 09:25:19 kardel
+ * sort out log output sequence
+ *
+ * Revision 4.56 2005/06/14 21:47:27 kardel
+ * collect samples only if samples are ok (sync or trusted flywheel)
+ * propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
+ * en- and dis-able HARDPPS in correlation to receiver sync state
+ *
+ * Revision 4.55 2005/06/02 21:28:31 kardel
+ * clarify trust logic
+ *
+ * Revision 4.54 2005/06/02 17:06:49 kardel
+ * change status reporting to use fixed refclock_report()
+ *
+ * Revision 4.53 2005/06/02 16:33:31 kardel
+ * fix acceptance of clocks unsync clocks right at start
+ *
+ * Revision 4.52 2005/05/26 21:55:06 kardel
+ * cleanup status reporting
+ *
+ * Revision 4.51 2005/05/26 19:19:14 kardel
+ * implement fast refclock startup
+ *
+ * Revision 4.50 2005/04/16 20:51:35 kardel
+ * set hardpps_enable = 1 when binding a kernel PPS source
+ *
+ * Revision 4.49 2005/04/16 17:29:26 kardel
+ * add non polling clock type 18 for just listenning to Meinberg clocks
+ *
+ * Revision 4.48 2005/04/16 16:22:27 kardel
+ * bk sync 20050415 ntp-dev
+ *
+ * Revision 4.47 2004/11/29 10:42:48 kardel
+ * bk sync ntp-dev 20041129
+ *
+ * Revision 4.46 2004/11/29 10:26:29 kardel
+ * keep fudgetime2 in sync with trusttime/ppsphaseadjust depending in flag1
+ *
+ * Revision 4.45 2004/11/14 20:53:20 kardel
+ * clear PPS flags after using them
+ *
+ * Revision 4.44 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ * Revision 4.43 2001/05/26 22:53:16 kardel
+ * 20010526 reconcilation
+ *
+ * Revision 4.42 2000/05/14 15:31:51 kardel
+ * PPSAPI && RAWDCF modemline support
+ *
+ * Revision 4.41 2000/04/09 19:50:45 kardel
+ * fixed rawdcfdtr_init() -> rawdcf_init_1
+ *
+ * Revision 4.40 2000/04/09 15:27:55 kardel
+ * modem line fiddle in rawdcf_init_2
+ *
+ * Revision 4.39 2000/03/18 09:16:55 kardel
+ * PPSAPI integration
+ *
+ * Revision 4.38 2000/03/05 20:25:06 kardel
+ * support PPSAPI
+ *
+ * Revision 4.37 2000/03/05 20:11:14 kardel
+ * 4.0.99g reconcilation
+ *
+ * Revision 4.36 1999/11/28 17:18:20 kardel
+ * disabled burst mode
+ *
+ * Revision 4.35 1999/11/28 09:14:14 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.34 1999/05/14 06:08:05 kardel
+ * store current_time in a suitable container (u_long)
+ *
+ * Revision 4.33 1999/05/13 21:48:38 kardel
+ * double the no response timeout interval
+ *
+ * Revision 4.32 1999/05/13 20:09:13 kardel
+ * complain only about missing polls after a full poll interval
+ *
+ * Revision 4.31 1999/05/13 19:59:32 kardel
+ * add clock type 16 for RTS set DTR clr in RAWDCF
+ *
+ * Revision 4.30 1999/02/28 20:36:43 kardel
+ * fixed printf fmt
+ *
+ * Revision 4.29 1999/02/28 19:58:23 kardel
+ * updated copyright information
+ *
+ * Revision 4.28 1999/02/28 19:01:50 kardel
+ * improved debug out on sent Meinberg messages
+ *
+ * Revision 4.27 1999/02/28 18:05:55 kardel
+ * no linux/ppsclock.h stuff
+ *
+ * Revision 4.26 1999/02/28 15:27:27 kardel
+ * wharton clock integration
+ *
+ * Revision 4.25 1999/02/28 14:04:46 kardel
+ * added missing double quotes to UTC information string
+ *
+ * Revision 4.24 1999/02/28 12:06:50 kardel
+ * (parse_control): using gmprettydate instead of prettydate()
+ * (mk_utcinfo): new function for formatting GPS derived UTC information
+ * (gps16x_message): changed to use mk_utcinfo()
+ * (trimbletsip_message): changed to use mk_utcinfo()
+ * ignoring position information in unsynchronized mode
+ * (parse_start): augument linux support for optional ASYNC_LOW_LATENCY
+ *
+ * Revision 4.23 1999/02/23 19:47:53 kardel
+ * fixed #endifs
+ * (stream_receive): fixed formats
+ *
+ * Revision 4.22 1999/02/22 06:21:02 kardel
+ * use new autoconfig symbols
+ *
+ * Revision 4.21 1999/02/21 12:18:13 kardel
+ * 4.91f reconcilation
+ *
+ * Revision 4.20 1999/02/21 10:53:36 kardel
+ * initial Linux PPSkit version
+ *
+ * Revision 4.19 1999/02/07 09:10:45 kardel
+ * clarify STREAMS mitigation rules in comment
+ *
+ * Revision 4.18 1998/12/20 23:45:34 kardel
+ * fix types and warnings
+ *
+ * Revision 4.17 1998/11/15 21:24:51 kardel
+ * cannot access mbg_ routines when CLOCK_MEINBERG
+ * is not defined
+ *
+ * Revision 4.16 1998/11/15 20:28:17 kardel
+ * Release 4.0.73e13 reconcilation
+ *
+ * Revision 4.15 1998/08/22 21:56:08 kardel
+ * fixed IO handling for non-STREAM IO
+ *
+ * Revision 4.14 1998/08/16 19:00:48 kardel
+ * (gps16x_message): reduced UTC parameter information (dropped A0,A1)
+ * made uval a local variable (killed one of the last globals)
+ * (sendetx): added logging of messages when in debug mode
+ * (trimble_check): added periodic checks to facilitate re-initialization
+ * (trimbletsip_init): made use of EOL character if in non-kernel operation
+ * (trimbletsip_message): extended message interpretation
+ * (getdbl): fixed data conversion
+ *
+ * Revision 4.13 1998/08/09 22:29:13 kardel
+ * Trimble TSIP support
+ *
+ * Revision 4.12 1998/07/11 10:05:34 kardel
+ * Release 4.0.73d reconcilation
+ *
+ * Revision 4.11 1998/06/14 21:09:42 kardel
+ * Sun acc cleanup
+ *
+ * Revision 4.10 1998/06/13 12:36:45 kardel
+ * signed/unsigned, name clashes
+ *
+ * Revision 4.9 1998/06/12 15:30:00 kardel
+ * prototype fixes
+ *
+ * Revision 4.8 1998/06/12 11:19:42 kardel
+ * added direct input processing routine for refclocks in
+ * order to avaiod that single character io gobbles up all
+ * receive buffers and drops input data. (Problem started
+ * with fast machines so a character a buffer was possible
+ * one of the few cases where faster machines break existing
+ * allocation algorithms)
+ *
+ * Revision 4.7 1998/06/06 18:35:20 kardel
+ * (parse_start): added BURST mode initialisation
+ *
+ * Revision 4.6 1998/05/27 06:12:46 kardel
+ * RAWDCF_BASEDELAY default added
+ * old comment removed
+ * casts for ioctl()
+ *
+ * Revision 4.5 1998/05/25 22:05:09 kardel
+ * RAWDCF_SETDTR option removed
+ * clock type 14 attempts to set DTR for
+ * power supply of RAWDCF receivers
+ *
+ * Revision 4.4 1998/05/24 16:20:47 kardel
+ * updated comments referencing Meinberg clocks
+ * added RAWDCF clock with DTR set option as type 14
+ *
+ * Revision 4.3 1998/05/24 10:48:33 kardel
+ * calibrated CONRAD RAWDCF default fudge factor
+ *
+ * Revision 4.2 1998/05/24 09:59:35 kardel
+ * corrected version information (ntpq support)
+ *
+ * Revision 4.1 1998/05/24 09:52:31 kardel
+ * use fixed format only (new IO model)
+ * output debug to stdout instead of msyslog()
+ * don't include >"< in ASCII output in order not to confuse
+ * ntpq parsing
+ *
+ * Revision 4.0 1998/04/10 19:52:11 kardel
+ * Start 4.0 release version numbering
+ *
+ * Revision 1.2 1998/04/10 19:28:04 kardel
+ * initial NTP VERSION 4 integration of PARSE with GPS166 binary support
+ * derived from 3.105.1.2 from V3 tree
+ *
+ * Revision information 3.1 - 3.105 from log deleted 1998/04/10 kardel
+ *
+ */
diff --git a/ntpd/refclock_pcf.c b/ntpd/refclock_pcf.c
new file mode 100644
index 0000000..4379832
--- /dev/null
+++ b/ntpd/refclock_pcf.c
@@ -0,0 +1,227 @@
+/*
+ * refclock_pcf - clock driver for the Conrad parallel port radio clock
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PCF)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+/*
+ * This driver supports the parallel port radio clock sold by Conrad
+ * Electronic under order numbers 967602 and 642002.
+ *
+ * It requires that the local timezone be CET/CEST and that the pcfclock
+ * device driver be installed. A device driver for Linux is available at
+ * http://home.pages.de/~voegele/pcf.html. Information about a FreeBSD
+ * driver is available at http://schumann.cx/pcfclock/.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/pcfclocks/%d"
+#define OLDDEVICE "/dev/pcfclock%d"
+#define PRECISION (-1) /* precision assumed (about 0.5 s) */
+#define REFID "PCF"
+#define DESCRIPTION "Conrad parallel port radio clock"
+
+#define LENPCF 18 /* timecode length */
+
+/*
+ * Function prototypes
+ */
+static int pcf_start (int, struct peer *);
+static void pcf_shutdown (int, struct peer *);
+static void pcf_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_pcf = {
+ pcf_start, /* start up driver */
+ pcf_shutdown, /* shut down driver */
+ pcf_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * pcf_start - open the device and initialize data for processing
+ */
+static int
+pcf_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ int fd;
+ char device[128];
+
+ /*
+ * Open device file for reading.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = open(device, O_RDONLY);
+ if (fd == -1) {
+ snprintf(device, sizeof(device), OLDDEVICE, unit);
+ fd = open(device, O_RDONLY);
+ }
+#ifdef DEBUG
+ if (debug)
+ printf ("starting PCF with device %s\n",device);
+#endif
+ if (fd == -1) {
+ return (0);
+ }
+
+ pp = peer->procptr;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ /* one transmission takes 172.5 milliseconds since the radio clock
+ transmits 69 bits with a period of 2.5 milliseconds per bit */
+ pp->fudgetime1 = 0.1725;
+ memcpy((char *)&pp->refid, REFID, 4);
+
+ return (1);
+}
+
+
+/*
+ * pcf_shutdown - shut down the clock
+ */
+static void
+pcf_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ if (NULL != pp)
+ close(pp->io.fd);
+}
+
+
+/*
+ * pcf_poll - called by the transmit procedure
+ */
+static void
+pcf_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ char buf[LENPCF];
+ struct tm tm, *tp;
+ time_t t;
+
+ pp = peer->procptr;
+
+ buf[0] = 0;
+ if (read(pp->io.fd, buf, sizeof(buf)) < sizeof(buf) || buf[0] != 9) {
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+
+ ZERO(tm);
+
+ tm.tm_mday = buf[11] * 10 + buf[10];
+ tm.tm_mon = buf[13] * 10 + buf[12] - 1;
+ tm.tm_year = buf[15] * 10 + buf[14];
+ tm.tm_hour = buf[7] * 10 + buf[6];
+ tm.tm_min = buf[5] * 10 + buf[4];
+ tm.tm_sec = buf[3] * 10 + buf[2];
+ tm.tm_isdst = (buf[8] & 1) ? 1 : (buf[8] & 2) ? 0 : -1;
+
+ /*
+ * Y2K convert the 2-digit year
+ */
+ if (tm.tm_year < 99)
+ tm.tm_year += 100;
+
+ t = mktime(&tm);
+ if (t == (time_t) -1) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+#if defined(__GLIBC__) && defined(_BSD_SOURCE)
+ if ((tm.tm_isdst > 0 && tm.tm_gmtoff != 7200)
+ || (tm.tm_isdst == 0 && tm.tm_gmtoff != 3600)
+ || tm.tm_isdst < 0) {
+#ifdef DEBUG
+ if (debug)
+ printf ("local time zone not set to CET/CEST\n");
+#endif
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+#endif
+
+ pp->lencode = strftime(pp->a_lastcode, BMAX, "%Y %m %d %H %M %S", &tm);
+
+#if defined(_REENTRANT) || defined(_THREAD_SAFE)
+ tp = gmtime_r(&t, &tm);
+#else
+ tp = gmtime(&t);
+#endif
+ if (!tp) {
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+
+ get_systime(&pp->lastrec);
+ pp->polls++;
+ pp->year = tp->tm_year + 1900;
+ pp->day = tp->tm_yday + 1;
+ pp->hour = tp->tm_hour;
+ pp->minute = tp->tm_min;
+ pp->second = tp->tm_sec;
+ pp->nsec = buf[16] * 31250000;
+ if (buf[17] & 1)
+ pp->nsec += 500000000;
+
+#ifdef DEBUG
+ if (debug)
+ printf ("pcf%d: time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
+ unit, pp->year, tp->tm_mon + 1, tp->tm_mday, pp->hour,
+ pp->minute, pp->second);
+#endif
+
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ if ((buf[1] & 1) && !(pp->sloppyclockflag & CLK_FLAG2))
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+}
+#else
+int refclock_pcf_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_pst.c b/ntpd/refclock_pst.c
new file mode 100644
index 0000000..39be051
--- /dev/null
+++ b/ntpd/refclock_pst.c
@@ -0,0 +1,318 @@
+/*
+ * refclock_pst - clock driver for PSTI/Traconex WWV/WWVH receivers
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PST)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+/*
+ * This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH
+ * Receivers. No specific claim of accuracy is made for these receiver,
+ * but actual experience suggests that 10 ms would be a conservative
+ * assumption.
+ *
+ * The DIPswitches should be set for 9600 bps line speed, 24-hour day-
+ * of-year format and UTC time zone. Automatic correction for DST should
+ * be disabled. It is very important that the year be set correctly in
+ * the DIPswitches; otherwise, the day of year will be incorrect after
+ * 28 April of a normal or leap year. The propagation delay DIPswitches
+ * should be set according to the distance from the transmitter for both
+ * WWV and WWVH, as described in the instructions. While the delay can
+ * be set only to within 11 ms, the fudge time1 parameter can be used
+ * for vernier corrections.
+ *
+ * Using the poll sequence QTQDQM, the response timecode is in three
+ * sections totalling 50 ASCII printing characters, as concatenated by
+ * the driver, in the following format:
+ *
+ * ahh:mm:ss.fffs<cr> yy/dd/mm/ddd<cr> frdzycchhSSFTttttuuxx<cr>
+ *
+ * on-time = first <cr>
+ * hh:mm:ss.fff = hours, minutes, seconds, milliseconds
+ * a = AM/PM indicator (' ' for 24-hour mode)
+ * yy = year (from internal switches)
+ * dd/mm/ddd = day of month, month, day of year
+ * s = daylight-saving indicator (' ' for 24-hour mode)
+ * f = frequency enable (O = all frequencies enabled)
+ * r = baud rate (3 = 1200, 6 = 9600)
+ * d = features indicator (@ = month/day display enabled)
+ * z = time zone (0 = UTC)
+ * y = year (5 = 91)
+ * cc = WWV propagation delay (52 = 22 ms)
+ * hh = WWVH propagation delay (81 = 33 ms)
+ * SS = status (80 or 82 = operating correctly)
+ * F = current receive frequency (4 = 15 MHz)
+ * T = transmitter (C = WWV, H = WWVH)
+ * tttt = time since last update (0000 = minutes)
+ * uu = flush character (03 = ^c)
+ * xx = 94 (unknown)
+ *
+ * The alarm condition is indicated by other than '8' at A, which occurs
+ * during initial synchronization and when received signal is lost for
+ * an extended period; unlock condition is indicated by other than
+ * "0000" in the tttt subfield at Q.
+ *
+ * Fudge Factors
+ *
+ * There are no special fudge factors other than the generic.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/wwv%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define WWVREFID "WWV\0" /* WWV reference ID */
+#define WWVHREFID "WWVH" /* WWVH reference ID */
+#define DESCRIPTION "PSTI/Traconex WWV/WWVH Receiver" /* WRU */
+#define PST_PHI (10e-6) /* max clock oscillator offset */
+#define LENPST 46 /* min timecode length */
+
+/*
+ * Unit control structure
+ */
+struct pstunit {
+ int tcswitch; /* timecode switch */
+ char *lastptr; /* pointer to timecode data */
+};
+
+/*
+ * Function prototypes
+ */
+static int pst_start (int, struct peer *);
+static void pst_shutdown (int, struct peer *);
+static void pst_receive (struct recvbuf *);
+static void pst_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_pst = {
+ pst_start, /* start up driver */
+ pst_shutdown, /* shut down driver */
+ pst_poll, /* transmit poll message */
+ noentry, /* not used (old pst_control) */
+ noentry, /* initialize driver */
+ noentry, /* not used (old pst_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * pst_start - open the devices and initialize data for processing
+ */
+static int
+pst_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct pstunit *up;
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_CLK);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = pst_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, WWVREFID, 4);
+ return (1);
+}
+
+
+/*
+ * pst_shutdown - shut down the clock
+ */
+static void
+pst_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct pstunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * pst_receive - receive data from the serial interface
+ */
+static void
+pst_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct pstunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ l_fp trtmp;
+ u_long ltemp;
+ char ampmchar; /* AM/PM indicator */
+ char daychar; /* standard/daylight indicator */
+ char junque[10]; /* "yy/dd/mm/" discard */
+ char info[14]; /* "frdzycchhSSFT" clock info */
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ up->lastptr += refclock_gtlin(rbufp, up->lastptr, pp->a_lastcode
+ + BMAX - 2 - up->lastptr, &trtmp);
+ *up->lastptr++ = ' ';
+ *up->lastptr = '\0';
+
+ /*
+ * Note we get a buffer and timestamp for each <cr>, but only
+ * the first timestamp is retained.
+ */
+ if (up->tcswitch == 0)
+ pp->lastrec = trtmp;
+ up->tcswitch++;
+ pp->lencode = up->lastptr - pp->a_lastcode;
+ if (up->tcswitch < 3)
+ return;
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has invalid length or is not in
+ * proper format, we declare bad format and exit.
+ */
+ if (pp->lencode < LENPST) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Timecode format:
+ * "ahh:mm:ss.fffs yy/dd/mm/ddd frdzycchhSSFTttttuuxx"
+ */
+ if (sscanf(pp->a_lastcode,
+ "%c%2d:%2d:%2d.%3ld%c %9s%3d%13s%4ld",
+ &ampmchar, &pp->hour, &pp->minute, &pp->second, &pp->nsec,
+ &daychar, junque, &pp->day, info, &ltemp) != 10) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+ pp->nsec *= 1000000;
+
+ /*
+ * Decode synchronization, quality and last update. If
+ * unsynchronized, set the leap bits accordingly and exit. Once
+ * synchronized, the dispersion depends only on when the clock
+ * was last heard, which depends on the time since last update,
+ * as reported by the clock.
+ */
+ if (info[9] != '8')
+ pp->leap = LEAP_NOTINSYNC;
+ if (info[12] == 'H')
+ memcpy((char *)&pp->refid, WWVHREFID, 4);
+ else
+ memcpy((char *)&pp->refid, WWVREFID, 4);
+ if (peer->stratum <= 1)
+ peer->refid = pp->refid;
+ if (ltemp == 0)
+ pp->lastref = pp->lastrec;
+ pp->disp = PST_PHI * ltemp * 60;
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+ if (!refclock_process(pp))
+ refclock_report(peer, CEVNT_BADTIME);
+ else if (peer->disp > MAXDISTANCE)
+ refclock_receive(peer);
+}
+
+
+/*
+ * pst_poll - called by the transmit procedure
+ */
+static void
+pst_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct pstunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * Time to poll the clock. The PSTI/Traconex clock responds to a
+ * "QTQDQMT" by returning a timecode in the format specified
+ * above. Note there is no checking on state, since this may not
+ * be the only customer reading the clock. Only one customer
+ * need poll the clock; all others just listen in. If the clock
+ * becomes unreachable, declare a timeout and keep going.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ up->tcswitch = 0;
+ up->lastptr = pp->a_lastcode;
+ if (write(pp->io.fd, "QTQDQMT", 6) != 6)
+ refclock_report(peer, CEVNT_FAULT);
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("pst: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif
+ pp->polls++;
+}
+
+#else
+int refclock_pst_int;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_ripencc.c b/ntpd/refclock_ripencc.c
new file mode 100644
index 0000000..75d8f38
--- /dev/null
+++ b/ntpd/refclock_ripencc.c
@@ -0,0 +1,5255 @@
+/*
+ * $Id: refclock_ripencc.c,v 1.13 2002/06/18 14:20:55 marks Exp marks $
+ *
+ * Copyright (c) 2002 RIPE NCC
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of the author not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *
+ *
+ * This driver was developed for use with the RIPE NCC TTM project.
+ *
+ *
+ * The initial driver was developed by Daniel Karrenberg <dfk@ripe.net>
+ * using the code made available by Trimble. This was for xntpd-3.x.x
+ *
+ * Rewrite of the driver for ntpd-4.x.x by Mark Santcroos <marks@ripe.net>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#if defined(REFCLOCK) && defined(CLOCK_RIPENCC)
+
+#include "ntp_stdlib.h"
+#include "ntpd.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_io.h"
+
+#ifdef HAVE_PPSAPI
+# include "ppsapi_timepps.h"
+#endif
+
+/*
+ * Definitions
+ */
+
+/* we are on little endian */
+#define BYTESWAP
+
+/*
+ * DEBUG statements: uncomment if necessary
+ */
+/* #define DEBUG_NCC */ /* general debug statements */
+/* #define DEBUG_PPS */ /* debug pps */
+/* #define DEBUG_RAW */ /* print raw packets */
+
+#define TRIMBLE_OUTPUT_FUNC
+#define TSIP_VERNUM "7.12a"
+
+#ifndef FALSE
+#define FALSE (0)
+#define TRUE (!FALSE)
+#endif /* FALSE */
+
+#define GPS_PI (3.1415926535898)
+#define GPS_C (299792458.)
+#define D2R (GPS_PI/180.0)
+#define R2D (180.0/GPS_PI)
+#define WEEK (604800.)
+#define MAXCHAN (8)
+
+/* control characters for TSIP packets */
+#define DLE (0x10)
+#define ETX (0x03)
+
+#define MAX_RPTBUF (256)
+
+/* values of TSIPPKT.status */
+#define TSIP_PARSED_EMPTY 0
+#define TSIP_PARSED_FULL 1
+#define TSIP_PARSED_DLE_1 2
+#define TSIP_PARSED_DATA 3
+#define TSIP_PARSED_DLE_2 4
+
+#define UTCF_UTC_AVAIL (unsigned char) (1) /* UTC available */
+#define UTCF_LEAP_SCHD (unsigned char) (1<<4) /* Leap scheduled */
+#define UTCF_LEAP_PNDG (unsigned char) (1<<5) /* Leap pending, will occur at end of day */
+
+#define DEVICE "/dev/gps%d" /* name of radio device */
+#define PRECISION (-9) /* precision assumed (about 2 ms) */
+#define PPS_PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "GPS\0" /* reference id */
+#define REFID_LEN 4
+#define DESCRIPTION "RIPE NCC GPS (Palisade)" /* Description */
+#define SPEED232 B9600 /* 9600 baud */
+
+#define NSAMPLES 3 /* stages of median filter */
+
+/* Structures */
+
+/* TSIP packets have the following structure, whether report or command. */
+typedef struct {
+ short
+ counter, /* counter */
+ len; /* size of buf; < MAX_RPTBUF unsigned chars */
+ unsigned char
+ status, /* TSIP packet format/parse status */
+ code, /* TSIP code */
+ buf[MAX_RPTBUF]; /* report or command string */
+} TSIPPKT;
+
+/* TSIP binary data structures */
+typedef struct {
+ unsigned char
+ t_oa_raw, SV_health;
+ float
+ e, t_oa, i_0, OMEGADOT, sqrt_A,
+ OMEGA_0, omega, M_0, a_f0, a_f1,
+ Axis, n, OMEGA_n, ODOT_n, t_zc;
+ short
+ weeknum, wn_oa;
+} ALM_INFO;
+
+typedef struct { /* Almanac health page (25) parameters */
+ unsigned char
+ WN_a, SV_health[32], t_oa;
+} ALH_PARMS;
+
+typedef struct { /* Universal Coordinated Time (UTC) parms */
+ double
+ A_0;
+ float
+ A_1;
+ short
+ delta_t_LS;
+ float
+ t_ot;
+ short
+ WN_t, WN_LSF, DN, delta_t_LSF;
+} UTC_INFO;
+
+typedef struct { /* Ionospheric info (float) */
+ float
+ alpha_0, alpha_1, alpha_2, alpha_3,
+ beta_0, beta_1, beta_2, beta_3;
+} ION_INFO;
+
+typedef struct { /* Subframe 1 info (float) */
+ short
+ weeknum;
+ unsigned char
+ codeL2, L2Pdata, SVacc_raw, SV_health;
+ short
+ IODC;
+ float
+ T_GD, t_oc, a_f2, a_f1, a_f0, SVacc;
+} EPHEM_CLOCK;
+
+typedef struct { /* Ephemeris info (float) */
+ unsigned char
+ IODE, fit_interval;
+ float
+ C_rs, delta_n;
+ double
+ M_0;
+ float
+ C_uc;
+ double
+ e;
+ float
+ C_us;
+ double
+ sqrt_A;
+ float
+ t_oe, C_ic;
+ double
+ OMEGA_0;
+ float
+ C_is;
+ double
+ i_0;
+ float
+ C_rc;
+ double
+ omega;
+ float
+ OMEGADOT, IDOT;
+ double
+ Axis, n, r1me2, OMEGA_n, ODOT_n;
+} EPHEM_ORBIT;
+
+typedef struct { /* Navigation data structure */
+ short
+ sv_number; /* SV number (0 = no entry) */
+ float
+ t_ephem; /* time of ephemeris collection */
+ EPHEM_CLOCK
+ ephclk; /* subframe 1 data */
+ EPHEM_ORBIT
+ ephorb; /* ephemeris data */
+} NAV_INFO;
+
+typedef struct {
+ unsigned char
+ bSubcode,
+ operating_mode,
+ dgps_mode,
+ dyn_code,
+ trackmode;
+ float
+ elev_mask,
+ cno_mask,
+ dop_mask,
+ dop_switch;
+ unsigned char
+ dgps_age_limit;
+} TSIP_RCVR_CFG;
+
+
+#ifdef TRIMBLE_OUTPUT_FUNC
+static char
+ *dayname[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"},
+ old_baudnum[] = {0, 1, 4, 5, 6, 8, 9, 11, 28, 12},
+ *st_baud_text_app [] = {"", "", " 300", " 600", " 1200", " 2400",
+ " 4800", " 9600", "19200", "38400"},
+ *old_parity_text[] = {"EVEN", "ODD", "", "", "NONE"},
+ *parity_text [] = {"NONE", "ODD", "EVEN"},
+ *old_input_ch[] = { "TSIP", "RTCM (6 of 8 bits)"},
+ *old_output_ch[] = { "TSIP", "No output", "", "", "", "NMEA 0183"},
+ *protocols_in_text[] = { "", "TSIP", "", ""},
+ *protocols_out_text[] = { "", "TSIP", "NMEA"},
+ *rcvr_port_text [] = { "Port A ", "Port B ", "Current Port"},
+ *dyn_text [] = {"Unchanged", "Land", "Sea", "Air", "Static"},
+ *NavModeText0xBB[] = {"automatic", "time only (0-D)", "", "2-D",
+ "3-D", "", "", "OverDetermined Time"},
+ *PPSTimeBaseText[] = {"GPS", "UTC", "USER"},
+ *PPSPolarityText[] = {"Positive", "Negative"},
+ *MaskText[] = { "Almanac ", "Ephemeris", "UTC ", "Iono ",
+ "GPS Msg ", "Alm Hlth ", "Time Fix ", "SV Select",
+ "Ext Event", "Pos Fix ", "Raw Meas "};
+
+#endif /* TRIMBLE_OUTPUT_FUNC */
+
+/*
+ * Unit control structure
+ */
+struct ripencc_unit {
+ int unit; /* unit number */
+ int pollcnt; /* poll message counter */
+ int polled; /* Hand in a sample? */
+ char leapdelta; /* delta of next leap event */
+ unsigned char utcflags; /* delta of next leap event */
+ l_fp tstamp; /* timestamp of last poll */
+
+ struct timespec ts; /* last timestamp */
+ pps_params_t pps_params; /* pps parameters */
+ pps_info_t pps_info; /* last pps data */
+ pps_handle_t handle; /* pps handlebars */
+
+};
+
+
+/******************* PROTOYPES *****************/
+
+/* prototypes for report parsing primitives */
+short rpt_0x3D (TSIPPKT *rpt, unsigned char *tx_baud_index,
+ unsigned char *rx_baud_index, unsigned char *char_format_index,
+ unsigned char *stop_bits, unsigned char *tx_mode_index,
+ unsigned char *rx_mode_index);
+short rpt_0x40 (TSIPPKT *rpt, unsigned char *sv_prn, short *week_num,
+ float *t_zc, float *eccentricity, float *t_oa, float *i_0,
+ float *OMEGA_dot, float *sqrt_A, float *OMEGA_0, float *omega,
+ float *M_0);
+short rpt_0x41 (TSIPPKT *rpt, float *time_of_week, float *UTC_offset,
+ short *week_num);
+short rpt_0x42 (TSIPPKT *rpt, float ECEF_pos[3], float *time_of_fix);
+short rpt_0x43 (TSIPPKT *rpt, float ECEF_vel[3], float *freq_offset,
+ float *time_of_fix);
+short rpt_0x45 (TSIPPKT *rpt, unsigned char *major_nav_version,
+ unsigned char *minor_nav_version, unsigned char *nav_day,
+ unsigned char *nav_month, unsigned char *nav_year,
+ unsigned char *major_dsp_version, unsigned char *minor_dsp_version,
+ unsigned char *dsp_day, unsigned char *dsp_month,
+ unsigned char *dsp_year);
+short rpt_0x46 (TSIPPKT *rpt, unsigned char *status1, unsigned char *status2);
+short rpt_0x47 (TSIPPKT *rpt, unsigned char *nsvs, unsigned char *sv_prn,
+ float *snr);
+short rpt_0x48 (TSIPPKT *rpt, unsigned char *message);
+short rpt_0x49 (TSIPPKT *rpt, unsigned char *sv_health);
+short rpt_0x4A (TSIPPKT *rpt, float *lat, float *lon, float *alt,
+ float *clock_bias, float *time_of_fix);
+short rpt_0x4A_2 (TSIPPKT *rpt, float *alt, float *dummy,
+ unsigned char *alt_flag);
+short rpt_0x4B (TSIPPKT *rpt, unsigned char *machine_id,
+ unsigned char *status3, unsigned char *status4);
+short rpt_0x4C (TSIPPKT *rpt, unsigned char *dyn_code, float *el_mask,
+ float *snr_mask, float *dop_mask, float *dop_switch);
+short rpt_0x4D (TSIPPKT *rpt, float *osc_offset);
+short rpt_0x4E (TSIPPKT *rpt, unsigned char *response);
+short rpt_0x4F (TSIPPKT *rpt, double *a0, float *a1, float *time_of_data,
+ short *dt_ls, short *wn_t, short *wn_lsf, short *dn, short *dt_lsf);
+short rpt_0x54 (TSIPPKT *rpt, float *clock_bias, float *freq_offset,
+ float *time_of_fix);
+short rpt_0x55 (TSIPPKT *rpt, unsigned char *pos_code, unsigned char *vel_code,
+ unsigned char *time_code, unsigned char *aux_code);
+short rpt_0x56 (TSIPPKT *rpt, float vel_ENU[3], float *freq_offset,
+ float *time_of_fix);
+short rpt_0x57 (TSIPPKT *rpt, unsigned char *source_code,
+ unsigned char *diag_code, short *week_num, float *time_of_fix);
+short rpt_0x58 (TSIPPKT *rpt, unsigned char *op_code, unsigned char *data_type,
+ unsigned char *sv_prn, unsigned char *data_length,
+ unsigned char *data_packet);
+short rpt_0x59 (TSIPPKT *rpt, unsigned char *code_type,
+ unsigned char status_code[32]);
+short rpt_0x5A (TSIPPKT *rpt, unsigned char *sv_prn, float *sample_length,
+ float *signal_level, float *code_phase, float *Doppler,
+ double *time_of_fix);
+short rpt_0x5B (TSIPPKT *rpt, unsigned char *sv_prn, unsigned char *sv_health,
+ unsigned char *sv_iode, unsigned char *fit_interval_flag,
+ float *time_of_collection, float *time_of_eph, float *sv_accy);
+short rpt_0x5C (TSIPPKT *rpt, unsigned char *sv_prn, unsigned char *slot,
+ unsigned char *chan, unsigned char *acq_flag, unsigned char *eph_flag,
+ float *signal_level, float *time_of_last_msmt, float *elev,
+ float *azim, unsigned char *old_msmt_flag,
+ unsigned char *integer_msec_flag, unsigned char *bad_data_flag,
+ unsigned char *data_collect_flag);
+short rpt_0x6D (TSIPPKT *rpt, unsigned char *manual_mode, unsigned char *nsvs,
+ unsigned char *ndim, unsigned char sv_prn[], float *pdop,
+ float *hdop, float *vdop, float *tdop);
+short rpt_0x82 (TSIPPKT *rpt, unsigned char *diff_mode);
+short rpt_0x83 (TSIPPKT *rpt, double ECEF_pos[3], double *clock_bias,
+ float *time_of_fix);
+short rpt_0x84 (TSIPPKT *rpt, double *lat, double *lon, double *alt,
+ double *clock_bias, float *time_of_fix);
+short rpt_Paly0xBB(TSIPPKT *rpt, TSIP_RCVR_CFG *TsipxBB);
+short rpt_0xBC (TSIPPKT *rpt, unsigned char *port_num,
+ unsigned char *in_baud, unsigned char *out_baud,
+ unsigned char *data_bits, unsigned char *parity,
+ unsigned char *stop_bits, unsigned char *flow_control,
+ unsigned char *protocols_in, unsigned char *protocols_out,
+ unsigned char *reserved);
+
+/* prototypes for superpacket parsers */
+
+short rpt_0x8F0B (TSIPPKT *rpt, unsigned short *event, double *tow,
+ unsigned char *date, unsigned char *month, short *year,
+ unsigned char *dim_mode, short *utc_offset, double *bias, double *drift,
+ float *bias_unc, float *dr_unc, double *lat, double *lon, double *alt,
+ char sv_id[8]);
+short rpt_0x8F14 (TSIPPKT *rpt, short *datum_idx, double datum_coeffs[5]);
+short rpt_0x8F15 (TSIPPKT *rpt, short *datum_idx, double datum_coeffs[5]);
+short rpt_0x8F20 (TSIPPKT *rpt, unsigned char *info, double *lat,
+ double *lon, double *alt, double vel_enu[], double *time_of_fix,
+ short *week_num, unsigned char *nsvs, unsigned char sv_prn[],
+ short sv_IODC[], short *datum_index);
+short rpt_0x8F41 (TSIPPKT *rpt, unsigned char *bSearchRange,
+ unsigned char *bBoardOptions, unsigned long *iiSerialNumber,
+ unsigned char *bBuildYear, unsigned char *bBuildMonth,
+ unsigned char *bBuildDay, unsigned char *bBuildHour,
+ float *fOscOffset, unsigned short *iTestCodeId);
+short rpt_0x8F42 (TSIPPKT *rpt, unsigned char *bProdOptionsPre,
+ unsigned char *bProdNumberExt, unsigned short *iCaseSerialNumberPre,
+ unsigned long *iiCaseSerialNumber, unsigned long *iiProdNumber,
+ unsigned short *iPremiumOptions, unsigned short *iMachineID,
+ unsigned short *iKey);
+short rpt_0x8F45 (TSIPPKT *rpt, unsigned char *bSegMask);
+short rpt_0x8F4A_16 (TSIPPKT *rpt, unsigned char *pps_enabled,
+ unsigned char *pps_timebase, unsigned char *pos_polarity,
+ double *pps_offset, float *bias_unc_threshold);
+short rpt_0x8F4B (TSIPPKT *rpt, unsigned long *decorr_max);
+short rpt_0x8F4D (TSIPPKT *rpt, unsigned long *event_mask);
+short rpt_0x8FA5 (TSIPPKT *rpt, unsigned char *spktmask);
+short rpt_0x8FAD (TSIPPKT *rpt, unsigned short *COUNT, double *FracSec,
+ unsigned char *Hour, unsigned char *Minute, unsigned char *Second,
+ unsigned char *Day, unsigned char *Month, unsigned short *Year,
+ unsigned char *Status, unsigned char *Flags);
+
+/**/
+/* prototypes for command-encode primitives with suffix convention: */
+/* c = clear, s = set, q = query, e = enable, d = disable */
+void cmd_0x1F (TSIPPKT *cmd);
+void cmd_0x26 (TSIPPKT *cmd);
+void cmd_0x2F (TSIPPKT *cmd);
+void cmd_0x35s (TSIPPKT *cmd, unsigned char pos_code, unsigned char vel_code,
+ unsigned char time_code, unsigned char opts_code);
+void cmd_0x3C (TSIPPKT *cmd, unsigned char sv_prn);
+void cmd_0x3Ds (TSIPPKT *cmd, unsigned char baud_out, unsigned char baud_inp,
+ unsigned char char_code, unsigned char stopbitcode,
+ unsigned char output_mode, unsigned char input_mode);
+void cmd_0xBBq (TSIPPKT *cmd, unsigned char subcode) ;
+
+/* prototypes 8E commands */
+void cmd_0x8E0Bq (TSIPPKT *cmd);
+void cmd_0x8E41q (TSIPPKT *cmd);
+void cmd_0x8E42q (TSIPPKT *cmd);
+void cmd_0x8E4Aq (TSIPPKT *cmd);
+void cmd_0x8E4As (TSIPPKT *cmd, unsigned char PPSOnOff, unsigned char TimeBase,
+ unsigned char Polarity, double PPSOffset, float Uncertainty);
+void cmd_0x8E4Bq (TSIPPKT *cmd);
+void cmd_0x8E4Ds (TSIPPKT *cmd, unsigned long AutoOutputMask);
+void cmd_0x8EADq (TSIPPKT *cmd);
+
+/* header/source border XXXXXXXXXXXXXXXXXXXXXXXXXX */
+
+/* Trimble parse functions */
+static int parse0x8FAD (TSIPPKT *, struct peer *);
+static int parse0x8F0B (TSIPPKT *, struct peer *);
+#ifdef TRIMBLE_OUTPUT_FUNC
+static int parseany (TSIPPKT *, struct peer *);
+static void TranslateTSIPReportToText (TSIPPKT *, char *);
+#endif /* TRIMBLE_OUTPUT_FUNC */
+static int parse0x5C (TSIPPKT *, struct peer *);
+static int parse0x4F (TSIPPKT *, struct peer *);
+static void tsip_input_proc (TSIPPKT *, int);
+
+/* Trimble helper functions */
+static void bPutFloat (float *, unsigned char *);
+static void bPutDouble (double *, unsigned char *);
+static void bPutULong (unsigned long *, unsigned char *);
+static int print_msg_table_header (int rptcode, char *HdrStr, int force);
+static char * show_time (float time_of_week);
+
+/* RIPE NCC functions */
+static void ripencc_control (int, const struct refclockstat *,
+ struct refclockstat *, struct peer *);
+static int ripencc_ppsapi (struct peer *, int, int);
+static int ripencc_get_pps_ts (struct ripencc_unit *, l_fp *);
+static int ripencc_start (int, struct peer *);
+static void ripencc_shutdown (int, struct peer *);
+static void ripencc_poll (int, struct peer *);
+static void ripencc_send (struct peer *, TSIPPKT spt);
+static void ripencc_receive (struct recvbuf *);
+
+/* fill in reflock structure for our clock */
+struct refclock refclock_ripencc = {
+ ripencc_start, /* start up driver */
+ ripencc_shutdown, /* shut down driver */
+ ripencc_poll, /* transmit poll message */
+ ripencc_control, /* control function */
+ noentry, /* initialize driver */
+ noentry, /* debug info */
+ NOFLAGS /* clock flags */
+};
+
+/*
+ * Tables to compute the ddd of year form icky dd/mm timecode. Viva la
+ * leap.
+ */
+static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+
+/*
+ * ripencc_start - open the GPS devices and initialize data for processing
+ */
+static int
+ripencc_start(int unit, struct peer *peer)
+{
+ register struct ripencc_unit *up;
+ struct refclockproc *pp;
+ char device[40];
+ int fd;
+ struct termios tio;
+ TSIPPKT spt;
+
+ pp = peer->procptr;
+
+ /*
+ * Open serial port
+ */
+ (void)snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_RAW);
+ if (fd <= 0) {
+ pp->io.fd = -1;
+ return (0);
+ }
+
+ pp->io.fd = fd;
+
+ /* from refclock_palisade.c */
+ if (tcgetattr(fd, &tio) < 0) {
+ msyslog(LOG_ERR, "Palisade(%d) tcgetattr(fd, &tio): %m",unit);
+ return (0);
+ }
+
+ /*
+ * set flags
+ */
+ tio.c_cflag |= (PARENB|PARODD);
+ tio.c_iflag &= ~ICRNL;
+ if (tcsetattr(fd, TCSANOW, &tio) == -1) {
+ msyslog(LOG_ERR, "Palisade(%d) tcsetattr(fd, &tio): %m",unit);
+ return (0);
+ }
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+
+ pp->io.clock_recv = ripencc_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ if (!io_addclock(&pp->io)) {
+ pp->io.fd = -1;
+ close(fd);
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, REFID_LEN);
+ up->pollcnt = 2;
+ up->unit = unit;
+ up->leapdelta = 0;
+ up->utcflags = 0;
+
+ /*
+ * Initialize the Clock
+ */
+
+ /* query software versions */
+ cmd_0x1F(&spt);
+ ripencc_send(peer, spt);
+
+ /* query receiver health */
+ cmd_0x26(&spt);
+ ripencc_send(peer, spt);
+
+ /* query serial numbers */
+ cmd_0x8E42q(&spt);
+ ripencc_send(peer, spt);
+
+ /* query manuf params */
+ cmd_0x8E41q(&spt);
+ ripencc_send(peer, spt);
+
+ /* i/o opts */ /* trimble manual page A30 */
+ cmd_0x35s(&spt,
+ 0x1C, /* position */
+ 0x00, /* velocity */
+ 0x05, /* timing */
+ 0x0a); /* auxilary */
+ ripencc_send(peer, spt);
+
+ /* turn off port A */
+ cmd_0x3Ds (&spt,
+ 0x0B, /* baud_out */
+ 0x0B, /* baud_inp */
+ 0x07, /* char_code */
+ 0x07, /* stopbitcode */
+ 0x01, /* output_mode */
+ 0x00); /* input_mode */
+ ripencc_send(peer, spt);
+
+ /* set i/o options */
+ cmd_0x8E4As (&spt,
+ 0x01, /* PPS on */
+ 0x01, /* Timebase UTC */
+ 0x00, /* polarity positive */
+ 0., /* 100 ft. cable XXX make flag */
+ 1e-6 * GPS_C); /* turn of biasuncert. > (1us) */
+ ripencc_send(peer,spt);
+
+ /* all outomatic packet output off */
+ cmd_0x8E4Ds(&spt,
+ 0x00000000); /* AutoOutputMask */
+ ripencc_send(peer, spt);
+
+ cmd_0xBBq (&spt,
+ 0x00); /* query primary configuration */
+ ripencc_send(peer,spt);
+
+
+ /* query PPS parameters */
+ cmd_0x8E4Aq (&spt); /* query PPS params */
+ ripencc_send(peer,spt);
+
+ /* query survey limit */
+ cmd_0x8E4Bq (&spt); /* query survey limit */
+ ripencc_send(peer,spt);
+
+#ifdef DEBUG_NCC
+ if (debug)
+ printf("ripencc_start: success\n");
+#endif /* DEBUG_NCC */
+
+ /*
+ * Start the PPSAPI interface if it is there. Default to use
+ * the assert edge and do not enable the kernel hardpps.
+ */
+ if (time_pps_create(fd, &up->handle) < 0) {
+ up->handle = 0;
+ msyslog(LOG_ERR, "refclock_ripencc: time_pps_create failed: %m");
+ return (1);
+ }
+
+ return(ripencc_ppsapi(peer, 0, 0));
+}
+
+/*
+ * ripencc_control - fudge control
+ */
+static void
+ripencc_control(
+ int unit, /* unit (not used) */
+ const struct refclockstat *in, /* input parameters (not used) */
+ struct refclockstat *out, /* output parameters (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+
+#ifdef DEBUG_NCC
+ msyslog(LOG_INFO,"%s()",__FUNCTION__);
+#endif /* DEBUG_NCC */
+
+ pp = peer->procptr;
+ ripencc_ppsapi(peer, pp->sloppyclockflag & CLK_FLAG2,
+ pp->sloppyclockflag & CLK_FLAG3);
+}
+
+
+/*
+ * Initialize PPSAPI
+ */
+int
+ripencc_ppsapi(
+ struct peer *peer, /* peer structure pointer */
+ int enb_clear, /* clear enable */
+ int enb_hardpps /* hardpps enable */
+ )
+{
+ struct refclockproc *pp;
+ struct ripencc_unit *up;
+ int capability;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (time_pps_getcap(up->handle, &capability) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_ripencc: time_pps_getcap failed: %m");
+ return (0);
+ }
+ memset(&up->pps_params, 0, sizeof(pps_params_t));
+ if (enb_clear)
+ up->pps_params.mode = capability & PPS_CAPTURECLEAR;
+ else
+ up->pps_params.mode = capability & PPS_CAPTUREASSERT;
+ if (!up->pps_params.mode) {
+ msyslog(LOG_ERR,
+ "refclock_ripencc: invalid capture edge %d",
+ !enb_clear);
+ return (0);
+ }
+ up->pps_params.mode |= PPS_TSFMT_TSPEC;
+ if (time_pps_setparams(up->handle, &up->pps_params) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_ripencc: time_pps_setparams failed: %m");
+ return (0);
+ }
+ if (enb_hardpps) {
+ if (time_pps_kcbind(up->handle, PPS_KC_HARDPPS,
+ up->pps_params.mode & ~PPS_TSFMT_TSPEC,
+ PPS_TSFMT_TSPEC) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_ripencc: time_pps_kcbind failed: %m");
+ return (0);
+ }
+ pps_enable = 1;
+ }
+ peer->precision = PPS_PRECISION;
+
+#if DEBUG_NCC
+ if (debug) {
+ time_pps_getparams(up->handle, &up->pps_params);
+ printf(
+ "refclock_ripencc: capability 0x%x version %d mode 0x%x kern %d\n",
+ capability, up->pps_params.api_version,
+ up->pps_params.mode, enb_hardpps);
+ }
+#endif /* DEBUG_NCC */
+
+ return (1);
+}
+
+/*
+ * This function is called every 64 seconds from ripencc_receive
+ * It will fetch the pps time
+ *
+ * Return 0 on failure and 1 on success.
+ */
+static int
+ripencc_get_pps_ts(
+ struct ripencc_unit *up,
+ l_fp *tsptr
+ )
+{
+ pps_info_t pps_info;
+ struct timespec timeout, ts;
+ double dtemp;
+ l_fp tstmp;
+
+#ifdef DEBUG_PPS
+ msyslog(LOG_INFO,"ripencc_get_pps_ts");
+#endif /* DEBUG_PPS */
+
+
+ /*
+ * Convert the timespec nanoseconds field to ntp l_fp units.
+ */
+ if (up->handle == 0)
+ return (0);
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 0;
+ memcpy(&pps_info, &up->pps_info, sizeof(pps_info_t));
+ if (time_pps_fetch(up->handle, PPS_TSFMT_TSPEC, &up->pps_info,
+ &timeout) < 0)
+ return (0);
+ if (up->pps_params.mode & PPS_CAPTUREASSERT) {
+ if (pps_info.assert_sequence ==
+ up->pps_info.assert_sequence)
+ return (0);
+ ts = up->pps_info.assert_timestamp;
+ } else if (up->pps_params.mode & PPS_CAPTURECLEAR) {
+ if (pps_info.clear_sequence ==
+ up->pps_info.clear_sequence)
+ return (0);
+ ts = up->pps_info.clear_timestamp;
+ } else {
+ return (0);
+ }
+ if ((up->ts.tv_sec == ts.tv_sec) && (up->ts.tv_nsec == ts.tv_nsec))
+ return (0);
+ up->ts = ts;
+
+ tstmp.l_ui = ts.tv_sec + JAN_1970;
+ dtemp = ts.tv_nsec * FRAC / 1e9;
+ tstmp.l_uf = (u_int32)dtemp;
+
+#ifdef DEBUG_PPS
+ msyslog(LOG_INFO,"ts.tv_sec: %d",(int)ts.tv_sec);
+ msyslog(LOG_INFO,"ts.tv_nsec: %ld",ts.tv_nsec);
+#endif /* DEBUG_PPS */
+
+ *tsptr = tstmp;
+ return (1);
+}
+
+/*
+ * ripencc_shutdown - shut down a GPS clock
+ */
+static void
+ripencc_shutdown(int unit, struct peer *peer)
+{
+ register struct ripencc_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (up != NULL) {
+ if (up->handle != 0)
+ time_pps_destroy(up->handle);
+ free(up);
+ }
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+
+ return;
+}
+
+/*
+ * ripencc_poll - called by the transmit procedure
+ */
+static void
+ripencc_poll(int unit, struct peer *peer)
+{
+ register struct ripencc_unit *up;
+ struct refclockproc *pp;
+ TSIPPKT spt;
+
+#ifdef DEBUG_NCC
+ if (debug)
+ fprintf(stderr, "ripencc_poll(%d)\n", unit);
+#endif /* DEBUG_NCC */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->pollcnt == 0)
+ refclock_report(peer, CEVNT_TIMEOUT);
+ else
+ up->pollcnt--;
+
+ pp->polls++;
+ up->polled = 1;
+
+ /* poll for UTC superpacket */
+ cmd_0x8EADq (&spt);
+ ripencc_send(peer,spt);
+}
+
+/*
+ * ripencc_send - send message to clock
+ * use the structures being created by the trimble functions!
+ * makes the code more readable/clean
+ */
+static void
+ripencc_send(struct peer *peer, TSIPPKT spt)
+{
+ unsigned char *ip, *op;
+ unsigned char obuf[512];
+
+#ifdef DEBUG_RAW
+ {
+ register struct ripencc_unit *up;
+ register struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (debug)
+ printf("ripencc_send(%d, %02X)\n", up->unit, cmd);
+ }
+#endif /* DEBUG_RAW */
+
+ ip = spt.buf;
+ op = obuf;
+
+ *op++ = 0x10;
+ *op++ = spt.code;
+
+ while (spt.len--) {
+ if (op-obuf > sizeof(obuf)-5) {
+ msyslog(LOG_ERR, "ripencc_send obuf overflow!");
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+
+ if (*ip == 0x10) /* byte stuffing */
+ *op++ = 0x10;
+ *op++ = *ip++;
+ }
+
+ *op++ = 0x10;
+ *op++ = 0x03;
+
+#ifdef DEBUG_RAW
+ if (debug) { /* print raw packet */
+ unsigned char *cp;
+ int i;
+
+ printf("ripencc_send: len %d\n", op-obuf);
+ for (i=1, cp=obuf; cp<op; i++, cp++) {
+ printf(" %02X", *cp);
+ if (i%10 == 0)
+ printf("\n");
+ }
+ printf("\n");
+ }
+#endif /* DEBUG_RAW */
+
+ if (write(peer->procptr->io.fd, obuf, op-obuf) == -1) {
+ refclock_report(peer, CEVNT_FAULT);
+ }
+}
+
+/*
+ * ripencc_receive()
+ *
+ * called when a packet is received on the serial port
+ * takes care of further processing
+ *
+ */
+static void
+ripencc_receive(struct recvbuf *rbufp)
+{
+ register struct ripencc_unit *up;
+ register struct refclockproc *pp;
+ struct peer *peer;
+ static TSIPPKT rpt; /* for current incoming TSIP report */
+ TSIPPKT spt; /* send packet */
+ int ns_since_pps;
+ int i;
+ char *cp;
+ /* these variables hold data until we decide it's worth keeping */
+ char rd_lastcode[BMAX];
+ l_fp rd_tmp;
+ u_short rd_lencode;
+
+ /* msyslog(LOG_INFO, "%s",__FUNCTION__); */
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ rd_lencode = refclock_gtlin(rbufp, rd_lastcode, BMAX, &rd_tmp);
+
+#ifdef DEBUG_RAW
+ if (debug)
+ fprintf(stderr, "ripencc_receive(%d)\n", up->unit);
+#endif /* DEBUG_RAW */
+
+#ifdef DEBUG_RAW
+ if (debug) { /* print raw packet */
+ int i;
+ unsigned char *cp;
+
+ printf("ripencc_receive: len %d\n", rbufp->recv_length);
+ for (i=1, cp=(char*)&rbufp->recv_space;
+ i <= rbufp->recv_length;
+ i++, cp++) {
+ printf(" %02X", *cp);
+ if (i%10 == 0)
+ printf("\n");
+ }
+ printf("\n");
+ }
+#endif /* DEBUG_RAW */
+
+ cp = (char*) &rbufp->recv_space;
+ i=rbufp->recv_length;
+
+ while (i--) { /* loop over received chars */
+
+ tsip_input_proc(&rpt, (unsigned char) *cp++);
+
+ if (rpt.status != TSIP_PARSED_FULL)
+ continue;
+
+ switch (rpt.code) {
+
+ case 0x8F: /* superpacket */
+
+ switch (rpt.buf[0]) {
+
+ case 0xAD: /* UTC Time */
+ /*
+ ** When polling on port B the timecode is
+ ** the time of the previous PPS. If we
+ ** completed receiving the packet less than
+ ** 150ms after the turn of the second, it
+ ** may have the code of the previous second.
+ ** We do not trust that and simply poll
+ ** again without even parsing it.
+ **
+ ** More elegant would be to re-schedule the
+ ** poll, but I do not know (yet) how to do
+ ** that cleanly.
+ **
+ */
+ /* BLA ns_since_pps = ncc_tstmp(rbufp, &trtmp); */
+/* if (up->polled && ns_since_pps > -1 && ns_since_pps < 150) { */
+
+ ns_since_pps = 200;
+ if (up->polled && ns_since_pps < 150) {
+ msyslog(LOG_INFO, "%s(): up->polled",
+ __FUNCTION__);
+ ripencc_poll(up->unit, peer);
+ break;
+ }
+
+ /*
+ * Parse primary utc time packet
+ * and fill refclock structure
+ * from results.
+ */
+ if (parse0x8FAD(&rpt, peer) < 0) {
+ msyslog(LOG_INFO, "%s(): parse0x8FAD < 0",__FUNCTION__);
+ refclock_report(peer, CEVNT_BADREPLY);
+ break;
+ }
+ /*
+ * If the PPSAPI is working, rather use its
+ * timestamps.
+ * assume that the PPS occurs on the second
+ * so blow any msec
+ */
+ if (ripencc_get_pps_ts(up, &rd_tmp) == 1) {
+ pp->lastrec = up->tstamp = rd_tmp;
+ pp->nsec = 0;
+ }
+ else
+ msyslog(LOG_INFO, "%s(): ripencc_get_pps_ts returns failure",__FUNCTION__);
+
+
+ if (!up->polled) {
+ msyslog(LOG_INFO, "%s(): unrequested packet",__FUNCTION__);
+ /* unrequested packet */
+ break;
+ }
+
+ /* we have been polled ! */
+ up->polled = 0;
+ up->pollcnt = 2;
+
+ /* poll for next packet */
+ cmd_0x8E0Bq(&spt);
+ ripencc_send(peer,spt);
+
+ if (ns_since_pps < 0) { /* no PPS */
+ msyslog(LOG_INFO, "%s(): ns_since_pps < 0",__FUNCTION__);
+ refclock_report(peer, CEVNT_BADTIME);
+ break;
+ }
+
+ /*
+ ** Process the new sample in the median
+ ** filter and determine the reference clock
+ ** offset and dispersion.
+ */
+ if (!refclock_process(pp)) {
+ msyslog(LOG_INFO, "%s(): !refclock_process",__FUNCTION__);
+ refclock_report(peer, CEVNT_BADTIME);
+ break;
+ }
+
+ refclock_receive(peer);
+ break;
+
+ case 0x0B: /* comprehensive time packet */
+ parse0x8F0B(&rpt, peer);
+ break;
+
+ default: /* other superpackets */
+#ifdef DEBUG_NCC
+ msyslog(LOG_INFO, "%s(): calling parseany",
+ __FUNCTION__);
+#endif /* DEBUG_NCC */
+#ifdef TRIMBLE_OUTPUT_FUNC
+ parseany(&rpt, peer);
+#endif /* TRIMBLE_OUTPUT_FUNC */
+ break;
+ }
+ break;
+
+ case 0x4F: /* UTC parameters, for leap info */
+ parse0x4F(&rpt, peer);
+ break;
+
+ case 0x5C: /* sat tracking data */
+ parse0x5C(&rpt, peer);
+ break;
+
+ default: /* other packets */
+#ifdef TRIMBLE_OUTPUT_FUNC
+ parseany(&rpt, peer);
+#endif /* TRIMBLE_OUTPUT_FUNC */
+ break;
+ }
+ rpt.status = TSIP_PARSED_EMPTY;
+ }
+}
+
+/*
+ * All trimble functions that are directly referenced from driver code
+ * (so not from parseany)
+ */
+
+/* request software versions */
+void
+cmd_0x1F(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 0;
+ cmd->code = 0x1F;
+}
+
+/* request receiver health */
+void
+cmd_0x26(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 0;
+ cmd->code = 0x26;
+}
+
+/* request UTC params */
+void
+cmd_0x2F(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 0;
+ cmd->code = 0x2F;
+}
+
+/* set serial I/O options */
+void
+cmd_0x35s(
+ TSIPPKT *cmd,
+ unsigned char pos_code,
+ unsigned char vel_code,
+ unsigned char time_code,
+ unsigned char opts_code
+ )
+{
+ cmd->buf[0] = pos_code;
+ cmd->buf[1] = vel_code;
+ cmd->buf[2] = time_code;
+ cmd->buf[3] = opts_code;
+ cmd->len = 4;
+ cmd->code = 0x35;
+}
+
+/* request tracking status */
+void
+cmd_0x3C(
+ TSIPPKT *cmd,
+ unsigned char sv_prn
+ )
+{
+ cmd->buf[0] = sv_prn;
+ cmd->len = 1;
+ cmd->code = 0x3C;
+}
+
+/* set Channel A configuration for dual-port operation */
+void
+cmd_0x3Ds(
+ TSIPPKT *cmd,
+ unsigned char baud_out,
+ unsigned char baud_inp,
+ unsigned char char_code,
+ unsigned char stopbitcode,
+ unsigned char output_mode,
+ unsigned char input_mode
+ )
+{
+ cmd->buf[0] = baud_out; /* XMT baud rate */
+ cmd->buf[1] = baud_inp; /* RCV baud rate */
+ cmd->buf[2] = char_code; /* parity and #bits per byte */
+ cmd->buf[3] = stopbitcode; /* number of stop bits code */
+ cmd->buf[4] = output_mode; /* Ch. A transmission mode */
+ cmd->buf[5] = input_mode; /* Ch. A reception mode */
+ cmd->len = 6;
+ cmd->code = 0x3D;
+}
+
+
+/* query primary configuration */
+void
+cmd_0xBBq(
+ TSIPPKT *cmd,
+ unsigned char subcode
+ )
+{
+ cmd->len = 1;
+ cmd->code = 0xBB;
+ cmd->buf[0] = subcode;
+}
+
+
+/**** Superpackets ****/
+/* 8E-0B to query 8F-0B controls */
+void
+cmd_0x8E0Bq(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 1;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0x0B;
+}
+
+
+/* 8F-41 to query board serial number */
+void
+cmd_0x8E41q(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 1;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0x41;
+}
+
+
+/* 8F-42 to query product serial number */
+void
+cmd_0x8E42q(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 1;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0x42;
+}
+
+
+/* 8F-4A to query PPS parameters */
+void
+cmd_0x8E4Aq(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 1;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0x4A;
+}
+
+
+/* set i/o options */
+void
+cmd_0x8E4As(
+ TSIPPKT *cmd,
+ unsigned char PPSOnOff,
+ unsigned char TimeBase,
+ unsigned char Polarity,
+ double PPSOffset,
+ float Uncertainty
+ )
+{
+ cmd->len = 16;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0x4A;
+ cmd->buf[1] = PPSOnOff;
+ cmd->buf[2] = TimeBase;
+ cmd->buf[3] = Polarity;
+ bPutDouble (&PPSOffset, &cmd->buf[4]);
+ bPutFloat (&Uncertainty, &cmd->buf[12]);
+}
+
+/* 8F-4B query survey limit */
+void
+cmd_0x8E4Bq(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 1;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0x4B;
+}
+
+/* poll for UTC superpacket */
+/* 8E-AD to query 8F-AD controls */
+void
+cmd_0x8EADq(
+ TSIPPKT *cmd
+ )
+{
+ cmd->len = 1;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0xAD;
+}
+
+/* all outomatic packet output off */
+void
+cmd_0x8E4Ds(
+ TSIPPKT *cmd,
+ unsigned long AutoOutputMask
+ )
+{
+ cmd->len = 5;
+ cmd->code = 0x8E;
+ cmd->buf[0] = 0x4D;
+ bPutULong (&AutoOutputMask, &cmd->buf[1]);
+}
+
+
+/*
+ * for DOS machines, reverse order of bytes as they come through the
+ * serial port.
+ */
+#ifdef BYTESWAP
+static short
+bGetShort(
+ unsigned char *bp
+ )
+{
+ short outval;
+ unsigned char *optr;
+
+ optr = (unsigned char*)&outval + 1;
+ *optr-- = *bp++;
+ *optr = *bp;
+ return outval;
+}
+
+#ifdef TRIMBLE_OUTPUT_FUNC
+static unsigned short
+bGetUShort(
+ unsigned char *bp
+ )
+{
+ unsigned short outval;
+ unsigned char *optr;
+
+ optr = (unsigned char*)&outval + 1;
+ *optr-- = *bp++;
+ *optr = *bp;
+ return outval;
+}
+
+static long
+bGetLong(
+ unsigned char *bp
+ )
+{
+ long outval;
+ unsigned char *optr;
+
+ optr = (unsigned char*)&outval + 3;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr = *bp;
+ return outval;
+}
+
+static unsigned long
+bGetULong(
+ unsigned char *bp
+ )
+{
+ unsigned long outval;
+ unsigned char *optr;
+
+ optr = (unsigned char*)&outval + 3;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr = *bp;
+ return outval;
+}
+#endif /* TRIMBLE_OUTPUT_FUNC */
+
+static float
+bGetSingle(
+ unsigned char *bp
+ )
+{
+ float outval;
+ unsigned char *optr;
+
+ optr = (unsigned char*)&outval + 3;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr = *bp;
+ return outval;
+}
+
+static double
+bGetDouble(
+ unsigned char *bp
+ )
+{
+ double outval;
+ unsigned char *optr;
+
+ optr = (unsigned char*)&outval + 7;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr-- = *bp++;
+ *optr = *bp;
+ return outval;
+}
+
+#else /* not BYTESWAP */
+
+#define bGetShort(bp) (*(short*)(bp))
+#define bGetLong(bp) (*(long*)(bp))
+#define bGetULong(bp) (*(unsigned long*)(bp))
+#define bGetSingle(bp) (*(float*)(bp))
+#define bGetDouble(bp) (*(double*)(bp))
+
+#endif /* BYTESWAP */
+/*
+ * Byte-reversal is necessary for little-endian (Intel-based) machines.
+ * TSIP streams are Big-endian (Motorola-based).
+ */
+#ifdef BYTESWAP
+
+void
+bPutFloat(
+ float *in,
+ unsigned char *out
+ )
+{
+ unsigned char *inptr;
+
+ inptr = (unsigned char*)in + 3;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out = *inptr;
+}
+
+static void
+bPutULong(
+ unsigned long *in,
+ unsigned char *out
+ )
+{
+ unsigned char *inptr;
+
+ inptr = (unsigned char*)in + 3;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out = *inptr;
+}
+
+static void
+bPutDouble(
+ double *in,
+ unsigned char *out
+ )
+{
+ unsigned char *inptr;
+
+ inptr = (unsigned char*)in + 7;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out++ = *inptr--;
+ *out = *inptr;
+}
+
+#else /* not BYTESWAP */
+
+void bPutShort (short a, unsigned char *cmdbuf) {*(short*) cmdbuf = a;}
+void bPutULong (long a, unsigned char *cmdbuf) {*(long*) cmdbuf = a;}
+void bPutFloat (float a, unsigned char *cmdbuf) {*(float*) cmdbuf = a;}
+void bPutDouble (double a, unsigned char *cmdbuf){*(double*) cmdbuf = a;}
+
+#endif /* BYTESWAP */
+
+/*
+ * Parse primary utc time packet
+ * and fill refclock structure
+ * from results.
+ *
+ * 0 = success
+ * -1 = errors
+ */
+
+static int
+parse0x8FAD(
+ TSIPPKT *rpt,
+ struct peer *peer
+ )
+{
+ register struct refclockproc *pp;
+ register struct ripencc_unit *up;
+
+ unsigned day, month, year; /* data derived from received timecode */
+ unsigned hour, minute, second;
+ unsigned char trackstat, utcflags;
+
+ static char logbuf[1024]; /* logging string buffer */
+ int i;
+ unsigned char *buf;
+
+ buf = rpt->buf;
+ pp = peer->procptr;
+
+ if (rpt->len != 22)
+ return (-1);
+
+ if (bGetShort(&buf[1]) != 0) {
+#ifdef DEBUG_NCC
+ if (debug)
+ printf("parse0x8FAD: event count != 0\n");
+#endif /* DEBUG_NCC */
+ return(-1);
+ }
+
+ if (bGetDouble(&buf[3]) != 0.0) {
+#ifdef DEBUG_NCC
+ if (debug)
+ printf("parse0x8FAD: fracsecs != 0\n");
+#endif /* DEBUG_NCC */
+ return(-1);
+ }
+
+ hour = (unsigned int) buf[11];
+ minute = (unsigned int) buf[12];
+ second = (unsigned int) buf[13];
+ day = (unsigned int) buf[14];
+ month = (unsigned int) buf[15];
+ year = bGetShort(&buf[16]);
+ trackstat = buf[18];
+ utcflags = buf[19];
+
+
+ sprintf(logbuf, "U1 %d.%d.%d %02d:%02d:%02d %d %02x",
+ day, month, year, hour, minute, second, trackstat, utcflags);
+
+#ifdef DEBUG_NCC
+ if (debug)
+ puts(logbuf);
+#endif /* DEBUG_NCC */
+
+ record_clock_stats(&peer->srcadr, logbuf);
+
+ if (!utcflags & UTCF_UTC_AVAIL)
+ return(-1);
+
+ /* poll for UTC parameters once and then if UTC flag changed */
+ up = (struct ripencc_unit *) pp->unitptr;
+ if (utcflags != up->utcflags) {
+ TSIPPKT spt; /* local structure for send packet */
+ cmd_0x2F (&spt); /* request UTC params */
+ ripencc_send(peer,spt);
+ up->utcflags = utcflags;
+ }
+
+ /*
+ * If we hit the leap second, we choose to skip this sample
+ * rather than rely on other code to be perfectly correct.
+ * No offense, just defense ;-).
+ */
+ if (second == 60)
+ return(-1);
+
+ /* now check and convert the time we received */
+
+ pp->year = year;
+ if (month < 1 || month > 12 || day < 1 || day > 31)
+ return(-1);
+
+ if (pp->year % 4) { /* XXX: use is_leapyear() ? */
+ if (day > day1tab[month - 1])
+ return(-1);
+ for (i = 0; i < month - 1; i++)
+ day += day1tab[i];
+ } else {
+ if (day > day2tab[month - 1])
+ return(-1);
+ for (i = 0; i < month - 1; i++)
+ day += day2tab[i];
+ }
+ pp->day = day;
+ pp->hour = hour;
+ pp->minute = minute;
+ pp-> second = second;
+ pp->nsec = 0;
+
+ if ((utcflags&UTCF_LEAP_PNDG) && up->leapdelta != 0)
+ pp-> leap = (up->leapdelta > 0)
+ ? LEAP_ADDSECOND
+ : LEAP_DELSECOND;
+ else
+ pp-> leap = LEAP_NOWARNING;
+
+ return (0);
+}
+
+/*
+ * Parse comprehensive time packet
+ *
+ * 0 = success
+ * -1 = errors
+ */
+
+int
+parse0x8F0B(
+ TSIPPKT *rpt,
+ struct peer *peer
+ )
+{
+ register struct refclockproc *pp;
+
+ unsigned day, month, year; /* data derived from received timecode */
+ unsigned hour, minute, second;
+ unsigned utcoff;
+ unsigned char mode;
+ double bias, rate;
+ float biasunc, rateunc;
+ double lat, lon, alt;
+ short lat_deg, lon_deg;
+ float lat_min, lon_min;
+ unsigned char north_south, east_west;
+ char sv[9];
+
+ static char logbuf[1024]; /* logging string buffer */
+ unsigned char b;
+ int i;
+ unsigned char *buf;
+ double tow;
+
+ buf = rpt->buf;
+ pp = peer->procptr;
+
+ if (rpt->len != 74)
+ return (-1);
+
+ if (bGetShort(&buf[1]) != 0)
+ return(-1);;
+
+ tow = bGetDouble(&buf[3]);
+
+ if (tow == -1.0) {
+ return(-1);
+ }
+ else if ((tow >= 604800.0) || (tow < 0.0)) {
+ return(-1);
+ }
+ else
+ {
+ if (tow < 604799.9) tow = tow + .00000001;
+ second = (unsigned int) fmod(tow, 60.);
+ minute = (unsigned int) fmod(tow/60., 60.);
+ hour = (unsigned int )fmod(tow / 3600., 24.);
+ }
+
+ day = (unsigned int) buf[11];
+ month = (unsigned int) buf[12];
+ year = bGetShort(&buf[13]);
+ mode = buf[15];
+ utcoff = bGetShort(&buf[16]);
+ bias = bGetDouble(&buf[18]) / GPS_C * 1e9; /* ns */
+ rate = bGetDouble(&buf[26]) / GPS_C * 1e9; /* ppb */
+ biasunc = bGetSingle(&buf[34]) / GPS_C * 1e9; /* ns */
+ rateunc = bGetSingle(&buf[38]) / GPS_C * 1e9; /* ppb */
+ lat = bGetDouble(&buf[42]) * R2D;
+ lon = bGetDouble(&buf[50]) * R2D;
+ alt = bGetDouble(&buf[58]);
+
+ if (lat < 0.0) {
+ north_south = 'S';
+ lat = -lat;
+ }
+ else {
+ north_south = 'N';
+ }
+ lat_deg = (short)lat;
+ lat_min = (lat - lat_deg) * 60.0;
+
+ if (lon < 0.0) {
+ east_west = 'W';
+ lon = -lon;
+ }
+ else {
+ east_west = 'E';
+ }
+
+ lon_deg = (short)lon;
+ lon_min = (lon - lon_deg) * 60.0;
+
+ for (i=0; i<8; i++) {
+ sv[i] = buf[i + 66];
+ if (sv[i]) {
+ TSIPPKT spt; /* local structure for sendpacket */
+ b = (unsigned char) (sv[i]<0 ? -sv[i] : sv[i]);
+ /* request tracking status */
+ cmd_0x3C (&spt, b);
+ ripencc_send(peer,spt);
+ }
+ }
+
+
+ sprintf(logbuf, "C1 %02d%02d%04d %02d%02d%02d %d %7.0f %.1f %.0f %.1f %d %02d%09.6f %c %02d%09.6f %c %.0f %d %d %d %d %d %d %d %d",
+ day, month, year, hour, minute, second, mode, bias, biasunc,
+ rate, rateunc, utcoff, lat_deg, lat_min, north_south, lon_deg,
+ lon_min, east_west, alt, sv[0], sv[1], sv[2], sv[3], sv[4],
+ sv[5], sv[6], sv[7]);
+
+#ifdef DEBUG_NCC
+ if (debug)
+ puts(logbuf);
+#endif /* DEBUG_NCC */
+
+ record_clock_stats(&peer->srcadr, logbuf);
+
+ return (0);
+}
+
+#ifdef TRIMBLE_OUTPUT_FUNC
+/*
+ * Parse any packet using Trimble machinery
+ */
+int
+parseany(
+ TSIPPKT *rpt,
+ struct peer *peer
+ )
+{
+ static char logbuf[1024]; /* logging string buffer */
+
+ TranslateTSIPReportToText (rpt, logbuf); /* anything else */
+#ifdef DEBUG_NCC
+ if (debug)
+ puts(&logbuf[1]);
+#endif /* DEBUG_NCC */
+ record_clock_stats(&peer->srcadr, &logbuf[1]);
+ return(0);
+}
+#endif /* TRIMBLE_OUTPUT_FUNC */
+
+
+/*
+ * Parse UTC Parameter Packet
+ *
+ * See the IDE for documentation!
+ *
+ * 0 = success
+ * -1 = errors
+ */
+
+int
+parse0x4F(
+ TSIPPKT *rpt,
+ struct peer *peer
+ )
+{
+ register struct ripencc_unit *up;
+
+ double a0;
+ float a1, tot;
+ int dt_ls, wn_t, wn_lsf, dn, dt_lsf;
+
+ static char logbuf[1024]; /* logging string buffer */
+ unsigned char *buf;
+
+ buf = rpt->buf;
+
+ if (rpt->len != 26)
+ return (-1);
+ a0 = bGetDouble (buf);
+ a1 = bGetSingle (&buf[8]);
+ dt_ls = bGetShort (&buf[12]);
+ tot = bGetSingle (&buf[14]);
+ wn_t = bGetShort (&buf[18]);
+ wn_lsf = bGetShort (&buf[20]);
+ dn = bGetShort (&buf[22]);
+ dt_lsf = bGetShort (&buf[24]);
+
+ sprintf(logbuf, "L1 %d %d %d %g %g %g %d %d %d",
+ dt_lsf - dt_ls, dt_ls, dt_lsf, a0, a1, tot, wn_t, wn_lsf, dn);
+
+#ifdef DEBUG_NCC
+ if (debug)
+ puts(logbuf);
+#endif /* DEBUG_NCC */
+
+ record_clock_stats(&peer->srcadr, logbuf);
+
+ up = (struct ripencc_unit *) peer->procptr->unitptr;
+ up->leapdelta = dt_lsf - dt_ls;
+
+ return (0);
+}
+
+/*
+ * Parse Tracking Status packet
+ *
+ * 0 = success
+ * -1 = errors
+ */
+
+int
+parse0x5C(
+ TSIPPKT *rpt,
+ struct peer *peer
+ )
+{
+ unsigned char prn, channel, aqflag, ephstat;
+ float snr, azinuth, elevation;
+
+ static char logbuf[1024]; /* logging string buffer */
+ unsigned char *buf;
+
+ buf = rpt->buf;
+
+ if (rpt->len != 24)
+ return(-1);
+
+ prn = buf[0];
+ channel = (unsigned char)(buf[1] >> 3);
+ if (channel == 0x10)
+ channel = 2;
+ else
+ channel++;
+ aqflag = buf[2];
+ ephstat = buf[3];
+ snr = bGetSingle(&buf[4]);
+ elevation = bGetSingle(&buf[12]) * R2D;
+ azinuth = bGetSingle(&buf[16]) * R2D;
+
+ sprintf(logbuf, "S1 %02d %d %d %02x %4.1f %5.1f %4.1f",
+ prn, channel, aqflag, ephstat, snr, azinuth, elevation);
+
+#ifdef DEBUG_NCC
+ if (debug)
+ puts(logbuf);
+#endif /* DEBUG_NCC */
+
+ record_clock_stats(&peer->srcadr, logbuf);
+
+ return (0);
+}
+
+/******* Code below is from Trimble Tsipchat *************/
+
+/*
+ * *************************************************************************
+ *
+ * Trimble Navigation, Ltd.
+ * OEM Products Development Group
+ * P.O. Box 3642
+ * 645 North Mary Avenue
+ * Sunnyvale, California 94088-3642
+ *
+ * Corporate Headquarter:
+ * Telephone: (408) 481-8000
+ * Fax: (408) 481-6005
+ *
+ * Technical Support Center:
+ * Telephone: (800) 767-4822 (U.S. and Canada)
+ * (408) 481-6940 (outside U.S. and Canada)
+ * Fax: (408) 481-6020
+ * BBS: (408) 481-7800
+ * e-mail: trimble_support@trimble.com
+ * ftp://ftp.trimble.com/pub/sct/embedded/bin
+ *
+ * *************************************************************************
+ *
+ * ------- BYTE-SWAPPING -------
+ * TSIP is big-endian (Motorola) protocol. To use on little-endian (Intel)
+ * systems, the bytes of all multi-byte types (shorts, floats, doubles, etc.)
+ * must be reversed. This is controlled by the MACRO BYTESWAP; if defined, it
+ * assumes little-endian protocol.
+ * --------------------------------
+ *
+ * T_PARSER.C and T_PARSER.H contains primitive functions that interpret
+ * reports received from the receiver. A second source file pair,
+ * T_FORMAT.C and T_FORMAT.H, contin the matching TSIP command formatters.
+ *
+ * The module is in very portable, basic C language. It can be used as is, or
+ * with minimal changes if a TSIP communications application is needed separate
+ * from TSIPCHAT. The construction of most argument lists avoid the use of
+ * structures, but the developer is encouraged to reconstruct them using such
+ * definitions to meet project requirements. Declarations of T_PARSER.C
+ * functions are included in T_PARSER.H to provide prototyping definitions.
+ *
+ * There are two types of functions: a serial input processing routine,
+ * tsip_input_proc()
+ * which assembles incoming bytes into a TSIPPKT structure, and the
+ * report parsers, rpt_0x??().
+ *
+ * 1) The function tsip_input_proc() accumulates bytes from the receiver,
+ * strips control bytes (DLE), and checks if the report end sequence (DLE ETX)
+ * has been received. rpt.status is defined as TSIP_PARSED_FULL (== 1)
+ * if a complete packet is available.
+ *
+ * 2) The functions rpt_0x??() are report string interpreters patterned after
+ * the document called "Trimble Standard Interface Protocol". It should be
+ * noted that if the report buffer is sent into the receiver with the wrong
+ * length (byte count), the rpt_0x??() returns the Boolean equivalence for
+ * TRUE.
+ *
+ * *************************************************************************
+ *
+ */
+
+
+/*
+ * reads bytes until serial buffer is empty or a complete report
+ * has been received; end of report is signified by DLE ETX.
+ */
+static void
+tsip_input_proc(
+ TSIPPKT *rpt,
+ int inbyte
+ )
+{
+ unsigned char newbyte;
+
+ if (inbyte < 0 || inbyte > 0xFF) return;
+
+ newbyte = (unsigned char)(inbyte);
+ switch (rpt->status)
+ {
+ case TSIP_PARSED_DLE_1:
+ switch (newbyte)
+ {
+ case 0:
+ case ETX:
+ /* illegal TSIP IDs */
+ rpt->len = 0;
+ rpt->status = TSIP_PARSED_EMPTY;
+ break;
+ case DLE:
+ /* try normal message start again */
+ rpt->len = 0;
+ rpt->status = TSIP_PARSED_DLE_1;
+ break;
+ default:
+ /* legal TSIP ID; start message */
+ rpt->code = newbyte;
+ rpt->len = 0;
+ rpt->status = TSIP_PARSED_DATA;
+ break;
+ }
+ break;
+ case TSIP_PARSED_DATA:
+ switch (newbyte) {
+ case DLE:
+ /* expect DLE or ETX next */
+ rpt->status = TSIP_PARSED_DLE_2;
+ break;
+ default:
+ /* normal data byte */
+ rpt->buf[rpt->len] = newbyte;
+ rpt->len++;
+ /* no change in rpt->status */
+ break;
+ }
+ break;
+ case TSIP_PARSED_DLE_2:
+ switch (newbyte) {
+ case DLE:
+ /* normal data byte */
+ rpt->buf[rpt->len] = newbyte;
+ rpt->len++;
+ rpt->status = TSIP_PARSED_DATA;
+ break;
+ case ETX:
+ /* end of message; return TRUE here. */
+ rpt->status = TSIP_PARSED_FULL;
+ break;
+ default:
+ /* error: treat as TSIP_PARSED_DLE_1; start new report packet */
+ rpt->code = newbyte;
+ rpt->len = 0;
+ rpt->status = TSIP_PARSED_DATA;
+ }
+ break;
+ case TSIP_PARSED_FULL:
+ case TSIP_PARSED_EMPTY:
+ default:
+ switch (newbyte) {
+ case DLE:
+ /* normal message start */
+ rpt->len = 0;
+ rpt->status = TSIP_PARSED_DLE_1;
+ break;
+ default:
+ /* error: ignore newbyte */
+ rpt->len = 0;
+ rpt->status = TSIP_PARSED_EMPTY;
+ }
+ break;
+ }
+ if (rpt->len > MAX_RPTBUF) {
+ /* error: start new report packet */
+ rpt->status = TSIP_PARSED_EMPTY;
+ rpt->len = 0;
+ }
+}
+
+#ifdef TRIMBLE_OUTPUT_FUNC
+
+/**/
+/* Channel A configuration for dual port operation */
+short
+rpt_0x3D(
+ TSIPPKT *rpt,
+ unsigned char *tx_baud_index,
+ unsigned char *rx_baud_index,
+ unsigned char *char_format_index,
+ unsigned char *stop_bits,
+ unsigned char *tx_mode_index,
+ unsigned char *rx_mode_index
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 6) return TRUE;
+ *tx_baud_index = buf[0];
+ *rx_baud_index = buf[1];
+ *char_format_index = buf[2];
+ *stop_bits = (unsigned char)((buf[3] == 0x07) ? 1 : 2);
+ *tx_mode_index = buf[4];
+ *rx_mode_index = buf[5];
+ return FALSE;
+}
+
+/**/
+/* almanac data for specified satellite */
+short
+rpt_0x40(
+ TSIPPKT *rpt,
+ unsigned char *sv_prn,
+ short *week_num,
+ float *t_zc,
+ float *eccentricity,
+ float *t_oa,
+ float *i_0,
+ float *OMEGA_dot,
+ float *sqrt_A,
+ float *OMEGA_0,
+ float *omega,
+ float *M_0
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 39) return TRUE;
+ *sv_prn = buf[0];
+ *t_zc = bGetSingle (&buf[1]);
+ *week_num = bGetShort (&buf[5]);
+ *eccentricity = bGetSingle (&buf[7]);
+ *t_oa = bGetSingle (&buf[11]);
+ *i_0 = bGetSingle (&buf[15]);
+ *OMEGA_dot = bGetSingle (&buf[19]);
+ *sqrt_A = bGetSingle (&buf[23]);
+ *OMEGA_0 = bGetSingle (&buf[27]);
+ *omega = bGetSingle (&buf[31]);
+ *M_0 = bGetSingle (&buf[35]);
+ return FALSE;
+}
+
+/* GPS time */
+short
+rpt_0x41(
+ TSIPPKT *rpt,
+ float *time_of_week,
+ float *UTC_offset,
+ short *week_num
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 10) return TRUE;
+ *time_of_week = bGetSingle (buf);
+ *week_num = bGetShort (&buf[4]);
+ *UTC_offset = bGetSingle (&buf[6]);
+ return FALSE;
+}
+
+/* position in ECEF, single precision */
+short
+rpt_0x42(
+ TSIPPKT *rpt,
+ float pos_ECEF[3],
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 16) return TRUE;
+ pos_ECEF[0] = bGetSingle (buf);
+ pos_ECEF[1]= bGetSingle (&buf[4]);
+ pos_ECEF[2]= bGetSingle (&buf[8]);
+ *time_of_fix = bGetSingle (&buf[12]);
+ return FALSE;
+}
+
+/* velocity in ECEF, single precision */
+short
+rpt_0x43(
+ TSIPPKT *rpt,
+ float ECEF_vel[3],
+ float *freq_offset,
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 20) return TRUE;
+ ECEF_vel[0] = bGetSingle (buf);
+ ECEF_vel[1] = bGetSingle (&buf[4]);
+ ECEF_vel[2] = bGetSingle (&buf[8]);
+ *freq_offset = bGetSingle (&buf[12]);
+ *time_of_fix = bGetSingle (&buf[16]);
+ return FALSE;
+}
+
+/* software versions */
+short
+rpt_0x45(
+ TSIPPKT *rpt,
+ unsigned char *major_nav_version,
+ unsigned char *minor_nav_version,
+ unsigned char *nav_day,
+ unsigned char *nav_month,
+ unsigned char *nav_year,
+ unsigned char *major_dsp_version,
+ unsigned char *minor_dsp_version,
+ unsigned char *dsp_day,
+ unsigned char *dsp_month,
+ unsigned char *dsp_year
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 10) return TRUE;
+ *major_nav_version = buf[0];
+ *minor_nav_version = buf[1];
+ *nav_day = buf[2];
+ *nav_month = buf[3];
+ *nav_year = buf[4];
+ *major_dsp_version = buf[5];
+ *minor_dsp_version = buf[6];
+ *dsp_day = buf[7];
+ *dsp_month = buf[8];
+ *dsp_year = buf[9];
+ return FALSE;
+}
+
+/* receiver health and status */
+short
+rpt_0x46(
+ TSIPPKT *rpt,
+ unsigned char *status1,
+ unsigned char *status2
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 2) return TRUE;
+ *status1 = buf[0];
+ *status2 = buf[1];
+ return FALSE;
+}
+
+/* signal levels for all satellites tracked */
+short
+rpt_0x47(
+ TSIPPKT *rpt,
+ unsigned char *nsvs,
+ unsigned char *sv_prn,
+ float *snr
+ )
+{
+ short isv;
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 1 + 5*buf[0]) return TRUE;
+ *nsvs = buf[0];
+ for (isv = 0; isv < (*nsvs); isv++) {
+ sv_prn[isv] = buf[5*isv + 1];
+ snr[isv] = bGetSingle (&buf[5*isv + 2]);
+ }
+ return FALSE;
+}
+
+/* GPS system message */
+short
+rpt_0x48(
+ TSIPPKT *rpt,
+ unsigned char *message
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 22) return TRUE;
+ memcpy (message, buf, 22);
+ message[22] = 0;
+ return FALSE;
+}
+
+/* health for all satellites from almanac health page */
+short
+rpt_0x49(
+ TSIPPKT *rpt,
+ unsigned char *sv_health
+ )
+{
+ short i;
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 32) return TRUE;
+ for (i = 0; i < 32; i++) sv_health [i]= buf[i];
+ return FALSE;
+}
+
+/* position in lat-lon-alt, single precision */
+short
+rpt_0x4A(
+ TSIPPKT *rpt,
+ float *lat,
+ float *lon,
+ float *alt,
+ float *clock_bias,
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 20) return TRUE;
+ *lat = bGetSingle (buf);
+ *lon = bGetSingle (&buf[4]);
+ *alt = bGetSingle (&buf[8]);
+ *clock_bias = bGetSingle (&buf[12]);
+ *time_of_fix = bGetSingle (&buf[16]);
+ return FALSE;
+}
+
+/* reference altitude parameters */
+short
+rpt_0x4A_2(
+ TSIPPKT *rpt,
+ float *alt,
+ float *dummy,
+ unsigned char *alt_flag
+ )
+{
+ unsigned char *buf;
+
+ buf = rpt->buf;
+
+ if (rpt->len != 9) return TRUE;
+ *alt = bGetSingle (buf);
+ *dummy = bGetSingle (&buf[4]);
+ *alt_flag = buf[8];
+ return FALSE;
+}
+
+/* machine ID code, status */
+short
+rpt_0x4B(
+ TSIPPKT *rpt,
+ unsigned char *machine_id,
+ unsigned char *status3,
+ unsigned char *status4
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 3) return TRUE;
+ *machine_id = buf[0];
+ *status3 = buf[1];
+ *status4 = buf[2];
+ return FALSE;
+}
+
+/* operating parameters and masks */
+short
+rpt_0x4C(
+ TSIPPKT *rpt,
+ unsigned char *dyn_code,
+ float *el_mask,
+ float *snr_mask,
+ float *dop_mask,
+ float *dop_switch
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 17) return TRUE;
+ *dyn_code = buf[0];
+ *el_mask = bGetSingle (&buf[1]);
+ *snr_mask = bGetSingle (&buf[5]);
+ *dop_mask = bGetSingle (&buf[9]);
+ *dop_switch = bGetSingle (&buf[13]);
+ return FALSE;
+}
+
+/* oscillator offset */
+short
+rpt_0x4D(
+ TSIPPKT *rpt,
+ float *osc_offset
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 4) return TRUE;
+ *osc_offset = bGetSingle (buf);
+ return FALSE;
+}
+
+/* yes/no response to command to set GPS time */
+short
+rpt_0x4E(
+ TSIPPKT *rpt,
+ unsigned char *response
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 1) return TRUE;
+ *response = buf[0];
+ return FALSE;
+}
+
+/* UTC data */
+short
+rpt_0x4F(
+ TSIPPKT *rpt,
+ double *a0,
+ float *a1,
+ float *time_of_data,
+ short *dt_ls,
+ short *wn_t,
+ short *wn_lsf,
+ short *dn,
+ short *dt_lsf
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 26) return TRUE;
+ *a0 = bGetDouble (buf);
+ *a1 = bGetSingle (&buf[8]);
+ *dt_ls = bGetShort (&buf[12]);
+ *time_of_data = bGetSingle (&buf[14]);
+ *wn_t = bGetShort (&buf[18]);
+ *wn_lsf = bGetShort (&buf[20]);
+ *dn = bGetShort (&buf[22]);
+ *dt_lsf = bGetShort (&buf[24]);
+ return FALSE;
+}
+
+/**/
+/* clock offset and frequency offset in 1-SV (0-D) mode */
+short
+rpt_0x54(
+ TSIPPKT *rpt,
+ float *clock_bias,
+ float *freq_offset,
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 12) return TRUE;
+ *clock_bias = bGetSingle (buf);
+ *freq_offset = bGetSingle (&buf[4]);
+ *time_of_fix = bGetSingle (&buf[8]);
+ return FALSE;
+}
+
+/* I/O serial options */
+short
+rpt_0x55(
+ TSIPPKT *rpt,
+ unsigned char *pos_code,
+ unsigned char *vel_code,
+ unsigned char *time_code,
+ unsigned char *aux_code
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 4) return TRUE;
+ *pos_code = buf[0];
+ *vel_code = buf[1];
+ *time_code = buf[2];
+ *aux_code = buf[3];
+ return FALSE;
+}
+
+/* velocity in east-north-up coordinates */
+short
+rpt_0x56(
+ TSIPPKT *rpt,
+ float vel_ENU[3],
+ float *freq_offset,
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 20) return TRUE;
+ /* east */
+ vel_ENU[0] = bGetSingle (buf);
+ /* north */
+ vel_ENU[1] = bGetSingle (&buf[4]);
+ /* up */
+ vel_ENU[2] = bGetSingle (&buf[8]);
+ *freq_offset = bGetSingle (&buf[12]);
+ *time_of_fix = bGetSingle (&buf[16]);
+ return FALSE;
+}
+
+/* info about last computed fix */
+short
+rpt_0x57(
+ TSIPPKT *rpt,
+ unsigned char *source_code,
+ unsigned char *diag_code,
+ short *week_num,
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 8) return TRUE;
+ *source_code = buf[0];
+ *diag_code = buf[1];
+ *time_of_fix = bGetSingle (&buf[2]);
+ *week_num = bGetShort (&buf[6]);
+ return FALSE;
+}
+
+/* GPS system data or acknowledgment of GPS system data load */
+short
+rpt_0x58(
+ TSIPPKT *rpt,
+ unsigned char *op_code,
+ unsigned char *data_type,
+ unsigned char *sv_prn,
+ unsigned char *data_length,
+ unsigned char *data_packet
+ )
+{
+ unsigned char *buf, *buf4;
+ short dl;
+ ALM_INFO* alminfo;
+ ION_INFO* ioninfo;
+ UTC_INFO* utcinfo;
+ NAV_INFO* navinfo;
+
+ buf = rpt->buf;
+
+ if (buf[0] == 2) {
+ if (rpt->len < 4) return TRUE;
+ if (rpt->len != 4+buf[3]) return TRUE;
+ }
+ else if (rpt->len != 3) {
+ return TRUE;
+ }
+ *op_code = buf[0];
+ *data_type = buf[1];
+ *sv_prn = buf[2];
+ if (*op_code == 2) {
+ dl = buf[3];
+ *data_length = (unsigned char)dl;
+ buf4 = &buf[4];
+ switch (*data_type) {
+ case 2:
+ /* Almanac */
+ if (*data_length != sizeof (ALM_INFO)) return TRUE;
+ alminfo = (ALM_INFO*)data_packet;
+ alminfo->t_oa_raw = buf4[0];
+ alminfo->SV_health = buf4[1];
+ alminfo->e = bGetSingle(&buf4[2]);
+ alminfo->t_oa = bGetSingle(&buf4[6]);
+ alminfo->i_0 = bGetSingle(&buf4[10]);
+ alminfo->OMEGADOT = bGetSingle(&buf4[14]);
+ alminfo->sqrt_A = bGetSingle(&buf4[18]);
+ alminfo->OMEGA_0 = bGetSingle(&buf4[22]);
+ alminfo->omega = bGetSingle(&buf4[26]);
+ alminfo->M_0 = bGetSingle(&buf4[30]);
+ alminfo->a_f0 = bGetSingle(&buf4[34]);
+ alminfo->a_f1 = bGetSingle(&buf4[38]);
+ alminfo->Axis = bGetSingle(&buf4[42]);
+ alminfo->n = bGetSingle(&buf4[46]);
+ alminfo->OMEGA_n = bGetSingle(&buf4[50]);
+ alminfo->ODOT_n = bGetSingle(&buf4[54]);
+ alminfo->t_zc = bGetSingle(&buf4[58]);
+ alminfo->weeknum = bGetShort(&buf4[62]);
+ alminfo->wn_oa = bGetShort(&buf4[64]);
+ break;
+
+ case 3:
+ /* Almanac health page */
+ if (*data_length != sizeof (ALH_PARMS) + 3) return TRUE;
+
+ /* this record is returned raw */
+ memcpy (data_packet, buf4, dl);
+ break;
+
+ case 4:
+ /* Ionosphere */
+ if (*data_length != sizeof (ION_INFO) + 8) return TRUE;
+ ioninfo = (ION_INFO*)data_packet;
+ ioninfo->alpha_0 = bGetSingle (&buf4[8]);
+ ioninfo->alpha_1 = bGetSingle (&buf4[12]);
+ ioninfo->alpha_2 = bGetSingle (&buf4[16]);
+ ioninfo->alpha_3 = bGetSingle (&buf4[20]);
+ ioninfo->beta_0 = bGetSingle (&buf4[24]);
+ ioninfo->beta_1 = bGetSingle (&buf4[28]);
+ ioninfo->beta_2 = bGetSingle (&buf4[32]);
+ ioninfo->beta_3 = bGetSingle (&buf4[36]);
+ break;
+
+ case 5:
+ /* UTC */
+ if (*data_length != sizeof (UTC_INFO) + 13) return TRUE;
+ utcinfo = (UTC_INFO*)data_packet;
+ utcinfo->A_0 = bGetDouble (&buf4[13]);
+ utcinfo->A_1 = bGetSingle (&buf4[21]);
+ utcinfo->delta_t_LS = bGetShort (&buf4[25]);
+ utcinfo->t_ot = bGetSingle(&buf4[27]);
+ utcinfo->WN_t = bGetShort (&buf4[31]);
+ utcinfo->WN_LSF = bGetShort (&buf4[33]);
+ utcinfo->DN = bGetShort (&buf4[35]);
+ utcinfo->delta_t_LSF = bGetShort (&buf4[37]);
+ break;
+
+ case 6:
+ /* Ephemeris */
+ if (*data_length != sizeof (NAV_INFO) - 1) return TRUE;
+
+ navinfo = (NAV_INFO*)data_packet;
+
+ navinfo->sv_number = buf4[0];
+ navinfo->t_ephem = bGetSingle (&buf4[1]);
+ navinfo->ephclk.weeknum = bGetShort (&buf4[5]);
+
+ navinfo->ephclk.codeL2 = buf4[7];
+ navinfo->ephclk.L2Pdata = buf4[8];
+ navinfo->ephclk.SVacc_raw = buf4[9];
+ navinfo->ephclk.SV_health = buf4[10];
+ navinfo->ephclk.IODC = bGetShort (&buf4[11]);
+ navinfo->ephclk.T_GD = bGetSingle (&buf4[13]);
+ navinfo->ephclk.t_oc = bGetSingle (&buf4[17]);
+ navinfo->ephclk.a_f2 = bGetSingle (&buf4[21]);
+ navinfo->ephclk.a_f1 = bGetSingle (&buf4[25]);
+ navinfo->ephclk.a_f0 = bGetSingle (&buf4[29]);
+ navinfo->ephclk.SVacc = bGetSingle (&buf4[33]);
+
+ navinfo->ephorb.IODE = buf4[37];
+ navinfo->ephorb.fit_interval = buf4[38];
+ navinfo->ephorb.C_rs = bGetSingle (&buf4[39]);
+ navinfo->ephorb.delta_n = bGetSingle (&buf4[43]);
+ navinfo->ephorb.M_0 = bGetDouble (&buf4[47]);
+ navinfo->ephorb.C_uc = bGetSingle (&buf4[55]);
+ navinfo->ephorb.e = bGetDouble (&buf4[59]);
+ navinfo->ephorb.C_us = bGetSingle (&buf4[67]);
+ navinfo->ephorb.sqrt_A = bGetDouble (&buf4[71]);
+ navinfo->ephorb.t_oe = bGetSingle (&buf4[79]);
+ navinfo->ephorb.C_ic = bGetSingle (&buf4[83]);
+ navinfo->ephorb.OMEGA_0 = bGetDouble (&buf4[87]);
+ navinfo->ephorb.C_is = bGetSingle (&buf4[95]);
+ navinfo->ephorb.i_0 = bGetDouble (&buf4[99]);
+ navinfo->ephorb.C_rc = bGetSingle (&buf4[107]);
+ navinfo->ephorb.omega = bGetDouble (&buf4[111]);
+ navinfo->ephorb.OMEGADOT=bGetSingle (&buf4[119]);
+ navinfo->ephorb.IDOT = bGetSingle (&buf4[123]);
+ navinfo->ephorb.Axis = bGetDouble (&buf4[127]);
+ navinfo->ephorb.n = bGetDouble (&buf4[135]);
+ navinfo->ephorb.r1me2 = bGetDouble (&buf4[143]);
+ navinfo->ephorb.OMEGA_n=bGetDouble (&buf4[151]);
+ navinfo->ephorb.ODOT_n = bGetDouble (&buf4[159]);
+ break;
+ }
+ }
+ return FALSE;
+}
+
+/* satellite enable/disable or health heed/ignore list */
+short
+rpt_0x59(
+ TSIPPKT *rpt,
+ unsigned char *code_type,
+ unsigned char status_code[32]
+ )
+{
+ short iprn;
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 33) return TRUE;
+ *code_type = buf[0];
+ for (iprn = 0; iprn < 32; iprn++)
+ status_code[iprn] = buf[iprn + 1];
+ return FALSE;
+}
+
+/* raw measurement data - code phase/Doppler */
+short
+rpt_0x5A(
+ TSIPPKT *rpt,
+ unsigned char *sv_prn,
+ float *sample_length,
+ float *signal_level,
+ float *code_phase,
+ float *Doppler,
+ double *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 25) return TRUE;
+ *sv_prn = buf[0];
+ *sample_length = bGetSingle (&buf[1]);
+ *signal_level = bGetSingle (&buf[5]);
+ *code_phase = bGetSingle (&buf[9]);
+ *Doppler = bGetSingle (&buf[13]);
+ *time_of_fix = bGetDouble (&buf[17]);
+ return FALSE;
+}
+
+/* satellite ephorb status */
+short
+rpt_0x5B(
+ TSIPPKT *rpt,
+ unsigned char *sv_prn,
+ unsigned char *sv_health,
+ unsigned char *sv_iode,
+ unsigned char *fit_interval_flag,
+ float *time_of_collection,
+ float *time_of_eph,
+ float *sv_accy
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 16) return TRUE;
+ *sv_prn = buf[0];
+ *time_of_collection = bGetSingle (&buf[1]);
+ *sv_health = buf[5];
+ *sv_iode = buf[6];
+ *time_of_eph = bGetSingle (&buf[7]);
+ *fit_interval_flag = buf[11];
+ *sv_accy = bGetSingle (&buf[12]);
+ return FALSE;
+}
+
+/* satellite tracking status */
+short
+rpt_0x5C(
+ TSIPPKT *rpt,
+ unsigned char *sv_prn,
+ unsigned char *slot,
+ unsigned char *chan,
+ unsigned char *acq_flag,
+ unsigned char *eph_flag,
+ float *signal_level,
+ float *time_of_last_msmt,
+ float *elev,
+ float *azim,
+ unsigned char *old_msmt_flag,
+ unsigned char *integer_msec_flag,
+ unsigned char *bad_data_flag,
+ unsigned char *data_collect_flag
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 24) return TRUE;
+ *sv_prn = buf[0];
+ *slot = (unsigned char)((buf[1] & 0x07) + 1);
+ *chan = (unsigned char)(buf[1] >> 3);
+ if (*chan == 0x10) *chan = 2;
+ else (*chan)++;
+ *acq_flag = buf[2];
+ *eph_flag = buf[3];
+ *signal_level = bGetSingle (&buf[4]);
+ *time_of_last_msmt = bGetSingle (&buf[8]);
+ *elev = bGetSingle (&buf[12]);
+ *azim = bGetSingle (&buf[16]);
+ *old_msmt_flag = buf[20];
+ *integer_msec_flag = buf[21];
+ *bad_data_flag = buf[22];
+ *data_collect_flag = buf[23];
+ return FALSE;
+}
+
+/**/
+/* over-determined satellite selection for position fixes, PDOP, fix mode */
+short
+rpt_0x6D(
+ TSIPPKT *rpt,
+ unsigned char *manual_mode,
+ unsigned char *nsvs,
+ unsigned char *ndim,
+ unsigned char sv_prn[],
+ float *pdop,
+ float *hdop,
+ float *vdop,
+ float *tdop
+ )
+{
+ short islot;
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ *nsvs = (unsigned char)((buf[0] & 0xF0) >> 4);
+ if ((*nsvs)>8) return TRUE;
+ if (rpt->len != 17 + (*nsvs) ) return TRUE;
+
+ *manual_mode = (unsigned char)(buf[0] & 0x08);
+ *ndim = (unsigned char)((buf[0] & 0x07));
+ *pdop = bGetSingle (&buf[1]);
+ *hdop = bGetSingle (&buf[5]);
+ *vdop = bGetSingle (&buf[9]);
+ *tdop = bGetSingle (&buf[13]);
+ for (islot = 0; islot < (*nsvs); islot++)
+ sv_prn[islot] = buf[islot + 17];
+ return FALSE;
+}
+
+/**/
+/* differential fix mode */
+short
+rpt_0x82(
+ TSIPPKT *rpt,
+ unsigned char *diff_mode
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 1) return TRUE;
+ *diff_mode = buf[0];
+ return FALSE;
+}
+
+/* position, ECEF double precision */
+short
+rpt_0x83(
+ TSIPPKT *rpt,
+ double ECEF_pos[3],
+ double *clock_bias,
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 36) return TRUE;
+ ECEF_pos[0] = bGetDouble (buf);
+ ECEF_pos[1] = bGetDouble (&buf[8]);
+ ECEF_pos[2] = bGetDouble (&buf[16]);
+ *clock_bias = bGetDouble (&buf[24]);
+ *time_of_fix = bGetSingle (&buf[32]);
+ return FALSE;
+}
+
+/* position, lat-lon-alt double precision */
+short
+rpt_0x84(
+ TSIPPKT *rpt,
+ double *lat,
+ double *lon,
+ double *alt,
+ double *clock_bias,
+ float *time_of_fix
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 36) return TRUE;
+ *lat = bGetDouble (buf);
+ *lon = bGetDouble (&buf[8]);
+ *alt = bGetDouble (&buf[16]);
+ *clock_bias = bGetDouble (&buf[24]);
+ *time_of_fix = bGetSingle (&buf[32]);
+ return FALSE;
+}
+
+short
+rpt_Paly0xBB(
+ TSIPPKT *rpt,
+ TSIP_RCVR_CFG *TsipxBB
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ /* Palisade is inconsistent with other TSIP, which has a length of 40 */
+ /* if (rpt->len != 40) return TRUE; */
+ if (rpt->len != 43) return TRUE;
+
+ TsipxBB->bSubcode = buf[0];
+ TsipxBB->operating_mode = buf[1];
+ TsipxBB->dyn_code = buf[3];
+ TsipxBB->elev_mask = bGetSingle (&buf[5]);
+ TsipxBB->cno_mask = bGetSingle (&buf[9]);
+ TsipxBB->dop_mask = bGetSingle (&buf[13]);
+ TsipxBB->dop_switch = bGetSingle (&buf[17]);
+ return FALSE;
+}
+
+/* Receiver serial port configuration */
+short
+rpt_0xBC(
+ TSIPPKT *rpt,
+ unsigned char *port_num,
+ unsigned char *in_baud,
+ unsigned char *out_baud,
+ unsigned char *data_bits,
+ unsigned char *parity,
+ unsigned char *stop_bits,
+ unsigned char *flow_control,
+ unsigned char *protocols_in,
+ unsigned char *protocols_out,
+ unsigned char *reserved
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 10) return TRUE;
+ *port_num = buf[0];
+ *in_baud = buf[1];
+ *out_baud = buf[2];
+ *data_bits = buf[3];
+ *parity = buf[4];
+ *stop_bits = buf[5];
+ *flow_control = buf[6];
+ *protocols_in = buf[7];
+ *protocols_out = buf[8];
+ *reserved = buf[9];
+
+ return FALSE;
+}
+
+/**** Superpackets ****/
+
+short
+rpt_0x8F0B(
+ TSIPPKT *rpt,
+ unsigned short *event,
+ double *tow,
+ unsigned char *date,
+ unsigned char *month,
+ short *year,
+ unsigned char *dim_mode,
+ short *utc_offset,
+ double *bias,
+ double *drift,
+ float *bias_unc,
+ float *dr_unc,
+ double *lat,
+ double *lon,
+ double *alt,
+ char sv_id[8]
+ )
+{
+ short local_index;
+ unsigned char *buf;
+
+ buf = rpt->buf;
+ if (rpt->len != 74) return TRUE;
+ *event = bGetShort(&buf[1]);
+ *tow = bGetDouble(&buf[3]);
+ *date = buf[11];
+ *month = buf[12];
+ *year = bGetShort(&buf[13]);
+ *dim_mode = buf[15];
+ *utc_offset = bGetShort(&buf[16]);
+ *bias = bGetDouble(&buf[18]);
+ *drift = bGetDouble(&buf[26]);
+ *bias_unc = bGetSingle(&buf[34]);
+ *dr_unc = bGetSingle(&buf[38]);
+ *lat = bGetDouble(&buf[42]);
+ *lon = bGetDouble(&buf[50]);
+ *alt = bGetDouble(&buf[58]);
+
+ for (local_index=0; local_index<8; local_index++) sv_id[local_index] = buf[local_index + 66];
+ return FALSE;
+}
+
+/* datum index and coefficients */
+short
+rpt_0x8F14(
+ TSIPPKT *rpt,
+ short *datum_idx,
+ double datum_coeffs[5]
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 43) return TRUE;
+ *datum_idx = bGetShort(&buf[1]);
+ datum_coeffs[0] = bGetDouble (&buf[3]);
+ datum_coeffs[1] = bGetDouble (&buf[11]);
+ datum_coeffs[2] = bGetDouble (&buf[19]);
+ datum_coeffs[3] = bGetDouble (&buf[27]);
+ datum_coeffs[4] = bGetDouble (&buf[35]);
+ return FALSE;
+}
+
+
+/* datum index and coefficients */
+short
+rpt_0x8F15(
+ TSIPPKT *rpt,
+ short *datum_idx,
+ double datum_coeffs[5]
+ )
+{
+ unsigned char *buf;
+ buf = rpt->buf;
+
+ if (rpt->len != 43) return TRUE;
+ *datum_idx = bGetShort(&buf[1]);
+ datum_coeffs[0] = bGetDouble (&buf[3]);
+ datum_coeffs[1] = bGetDouble (&buf[11]);
+ datum_coeffs[2] = bGetDouble (&buf[19]);
+ datum_coeffs[3] = bGetDouble (&buf[27]);
+ datum_coeffs[4] = bGetDouble (&buf[35]);
+ return FALSE;
+}
+
+
+#define MAX_LONG (2147483648.) /* 2**31 */
+
+short
+rpt_0x8F20(
+ TSIPPKT *rpt,
+ unsigned char *info,
+ double *lat,
+ double *lon,
+ double *alt,
+ double vel_enu[],
+ double *time_of_fix,
+ short *week_num,
+ unsigned char *nsvs,
+ unsigned char sv_prn[],
+ short sv_IODC[],
+ short *datum_index
+ )
+{
+ short
+ isv;
+ unsigned char
+ *buf, prnx, iode;
+ unsigned long
+ ulongtemp;
+ long
+ longtemp;
+ double
+ vel_scale;
+
+ buf = rpt->buf;
+
+ if (rpt->len != 56) return TRUE;
+
+ vel_scale = (buf[24]&1)? 0.020 : 0.005;
+ vel_enu[0] = bGetShort (buf+2)*vel_scale;
+ vel_enu[1] = bGetShort (buf+4)*vel_scale;
+ vel_enu[2] = bGetShort (buf+6)*vel_scale;
+
+ *time_of_fix = bGetULong (buf+8)*.001;
+
+ longtemp = bGetLong (buf+12);
+ *lat = longtemp*(GPS_PI/MAX_LONG);
+
+ ulongtemp = bGetULong (buf+16);
+ *lon = ulongtemp*(GPS_PI/MAX_LONG);
+ if (*lon > GPS_PI) *lon -= 2.0*GPS_PI;
+
+ *alt = bGetLong (buf+20)*.001;
+ /* 25 blank; 29 = UTC */
+ (*datum_index) = (short)((short)buf[26]-1);
+ *info = buf[27];
+ *nsvs = buf[28];
+ *week_num = bGetShort (&buf[30]);
+ for (isv = 0; isv < 8; isv++) {
+ prnx = buf[32+2*isv];
+ sv_prn[isv] = (unsigned char)(prnx&0x3F);
+ iode = buf[33+2*isv];
+ sv_IODC[isv] = (short)(iode | ((prnx>>6)<<8));
+ }
+ return FALSE;
+}
+
+short
+rpt_0x8F41(
+ TSIPPKT *rpt,
+ unsigned char *bSearchRange,
+ unsigned char *bBoardOptions,
+ unsigned long *iiSerialNumber,
+ unsigned char *bBuildYear,
+ unsigned char *bBuildMonth,
+ unsigned char *bBuildDay,
+ unsigned char *bBuildHour,
+ float *fOscOffset,
+ unsigned short *iTestCodeId
+ )
+{
+ if (rpt->len != 17) return FALSE;
+ *bSearchRange = rpt->buf[1];
+ *bBoardOptions = rpt->buf[2];
+ *iiSerialNumber = bGetLong(&rpt->buf[3]);
+ *bBuildYear = rpt->buf[7];
+ *bBuildMonth = rpt->buf[8];
+ *bBuildDay = rpt->buf[9];
+ *bBuildHour = rpt->buf[10];
+ *fOscOffset = bGetSingle(&rpt->buf[11]);
+ *iTestCodeId = bGetShort(&rpt->buf[15]);
+/* Tsipx8E41Data = *Tsipx8E41; */
+ return TRUE;
+}
+
+short
+rpt_0x8F42(
+ TSIPPKT *rpt,
+ unsigned char *bProdOptionsPre,
+ unsigned char *bProdNumberExt,
+ unsigned short *iCaseSerialNumberPre,
+ unsigned long *iiCaseSerialNumber,
+ unsigned long *iiProdNumber,
+ unsigned short *iPremiumOptions,
+ unsigned short *iMachineID,
+ unsigned short *iKey
+ )
+{
+ if (rpt->len != 19) return FALSE;
+ *bProdOptionsPre = rpt->buf[1];
+ *bProdNumberExt = rpt->buf[2];
+ *iCaseSerialNumberPre = bGetShort(&rpt->buf[3]);
+ *iiCaseSerialNumber = bGetLong(&rpt->buf[5]);
+ *iiProdNumber = bGetLong(&rpt->buf[9]);
+ *iPremiumOptions = bGetShort(&rpt->buf[13]);
+ *iMachineID = bGetShort(&rpt->buf[15]);
+ *iKey = bGetShort(&rpt->buf[17]);
+ return TRUE;
+}
+
+short
+rpt_0x8F45(
+ TSIPPKT *rpt,
+ unsigned char *bSegMask
+ )
+{
+ if (rpt->len != 2) return FALSE;
+ *bSegMask = rpt->buf[1];
+ return TRUE;
+}
+
+/* Stinger PPS definition */
+short
+rpt_0x8F4A_16(
+ TSIPPKT *rpt,
+ unsigned char *pps_enabled,
+ unsigned char *pps_timebase,
+ unsigned char *pos_polarity,
+ double *pps_offset,
+ float *bias_unc_threshold
+ )
+{
+ unsigned char
+ *buf;
+
+ buf = rpt->buf;
+ if (rpt->len != 16) return TRUE;
+ *pps_enabled = buf[1];
+ *pps_timebase = buf[2];
+ *pos_polarity = buf[3];
+ *pps_offset = bGetDouble(&buf[4]);
+ *bias_unc_threshold = bGetSingle(&buf[12]);
+ return FALSE;
+}
+
+short
+rpt_0x8F4B(
+ TSIPPKT *rpt,
+ unsigned long *decorr_max
+ )
+{
+ unsigned char
+ *buf;
+
+ buf = rpt->buf;
+ if (rpt->len != 5) return TRUE;
+ *decorr_max = bGetLong(&buf[1]);
+ return FALSE;
+}
+
+short
+rpt_0x8F4D(
+ TSIPPKT *rpt,
+ unsigned long *event_mask
+ )
+{
+ unsigned char
+ *buf;
+
+ buf = rpt->buf;
+ if (rpt->len != 5) return TRUE;
+ *event_mask = bGetULong (&buf[1]);
+ return FALSE;
+}
+
+short
+rpt_0x8FA5(
+ TSIPPKT *rpt,
+ unsigned char *spktmask
+ )
+{
+ unsigned char
+ *buf;
+
+ buf = rpt->buf;
+ if (rpt->len != 5) return TRUE;
+ spktmask[0] = buf[1];
+ spktmask[1] = buf[2];
+ spktmask[2] = buf[3];
+ spktmask[3] = buf[4];
+ return FALSE;
+}
+
+short
+rpt_0x8FAD(
+ TSIPPKT *rpt,
+ unsigned short *COUNT,
+ double *FracSec,
+ unsigned char *Hour,
+ unsigned char *Minute,
+ unsigned char *Second,
+ unsigned char *Day,
+ unsigned char *Month,
+ unsigned short *Year,
+ unsigned char *Status,
+ unsigned char *Flags
+ )
+{
+ if (rpt->len != 22) return TRUE;
+
+ *COUNT = bGetUShort(&rpt->buf[1]);
+ *FracSec = bGetDouble(&rpt->buf[3]);
+ *Hour = rpt->buf[11];
+ *Minute = rpt->buf[12];
+ *Second = rpt->buf[13];
+ *Day = rpt->buf[14];
+ *Month = rpt->buf[15];
+ *Year = bGetUShort(&rpt->buf[16]);
+ *Status = rpt->buf[18];
+ *Flags = rpt->buf[19];
+ return FALSE;
+}
+
+
+/*
+ * *************************************************************************
+ *
+ * Trimble Navigation, Ltd.
+ * OEM Products Development Group
+ * P.O. Box 3642
+ * 645 North Mary Avenue
+ * Sunnyvale, California 94088-3642
+ *
+ * Corporate Headquarter:
+ * Telephone: (408) 481-8000
+ * Fax: (408) 481-6005
+ *
+ * Technical Support Center:
+ * Telephone: (800) 767-4822 (U.S. and Canada)
+ * (408) 481-6940 (outside U.S. and Canada)
+ * Fax: (408) 481-6020
+ * BBS: (408) 481-7800
+ * e-mail: trimble_support@trimble.com
+ * ftp://ftp.trimble.com/pub/sct/embedded/bin
+ *
+ * *************************************************************************
+ *
+ * T_REPORT.C consists of a primary function TranslateTSIPReportToText()
+ * called by main().
+ *
+ * This function takes a character buffer that has been received as a report
+ * from a TSIP device and interprets it. The character buffer has been
+ * assembled using tsip_input_proc() in T_PARSER.C.
+ *
+ * A large case statement directs processing to one of many mid-level
+ * functions. The mid-level functions specific to the current report
+ * code passes the report buffer to the appropriate report decoder
+ * rpt_0x?? () in T_PARSER.C, which converts the byte stream in rpt.buf
+ * to data values approporaite for use.
+ *
+ * *************************************************************************
+ *
+ */
+
+
+#define GOOD_PARSE 0
+#define BADID_PARSE 1
+#define BADLEN_PARSE 2
+#define BADDATA_PARSE 3
+
+#define B_TSIP 0x02
+#define B_NMEA 0x04
+
+
+/* pbuf is the pointer to the current location of the text output */
+static char
+*pbuf;
+
+/* keep track of whether the message has been successfully parsed */
+static short
+parsed;
+
+
+/* convert time of week into day-hour-minute-second and print */
+char *
+show_time(
+ float time_of_week
+ )
+{
+ short days, hours, minutes;
+ float seconds;
+ double tow = 0;
+ static char timestring [80];
+
+ if (time_of_week == -1.0)
+ {
+ sprintf(timestring, " <No time yet> ");
+ }
+ else if ((time_of_week >= 604800.0) || (time_of_week < 0.0))
+ {
+ sprintf(timestring, " <Bad time> ");
+ }
+ else
+ {
+ if (time_of_week < 604799.9)
+ tow = time_of_week + .00000001;
+ seconds = (float)fmod(tow, 60.);
+ minutes = (short) fmod(tow/60., 60.);
+ hours = (short)fmod(tow / 3600., 24.);
+ days = (short)(tow / 86400.0);
+ sprintf(timestring, " %s %02d:%02d:%05.2f ",
+ dayname[days], hours, minutes, seconds);
+ }
+ return timestring;
+}
+
+/**/
+/* 0x3D */
+static void
+rpt_chan_A_config(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ tx_baud_index, rx_baud_index,
+ char_format_index, stop_bits,
+ tx_mode_index, rx_mode_index,
+ databits, parity;
+ int
+ i, nbaud;
+
+ /* unload rptbuf */
+ if (rpt_0x3D (rpt,
+ &tx_baud_index, &rx_baud_index, &char_format_index,
+ &stop_bits, &tx_mode_index, &rx_mode_index)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nChannel A Configuration");
+
+ nbaud = sizeof(old_baudnum);
+
+ for (i = 0; i < nbaud; ++i) if (tx_baud_index == old_baudnum[i]) break;
+ pbuf += sprintf(pbuf, "\n Transmit speed: %s at %s",
+ old_output_ch[tx_mode_index], st_baud_text_app[i]);
+
+ for (i = 0; i < nbaud; ++i) if (rx_baud_index == old_baudnum[i]) break;
+ pbuf += sprintf(pbuf, "\n Receive speed: %s at %s",
+ old_input_ch[rx_mode_index], st_baud_text_app[i]);
+
+ databits = (unsigned char)((char_format_index & 0x03) + 5);
+
+ parity = (unsigned char)(char_format_index >> 2);
+ if (parity > 4) parity = 2;
+
+ pbuf += sprintf(pbuf, "\n Character format (bits/char, parity, stop bits): %d-%s-%d",
+ databits, old_parity_text[parity], stop_bits);
+}
+
+/**/
+/* 0x40 */
+static void
+rpt_almanac_data_page(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ sv_prn;
+ short
+ week_num;
+ float
+ t_zc,
+ eccentricity,
+ t_oa,
+ i_0,
+ OMEGA_dot,
+ sqrt_A,
+ OMEGA_0,
+ omega,
+ M_0;
+
+ /* unload rptbuf */
+ if (rpt_0x40 (rpt,
+ &sv_prn, &week_num, &t_zc, &eccentricity, &t_oa,
+ &i_0, &OMEGA_dot, &sqrt_A, &OMEGA_0, &omega, &M_0)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nAlmanac for SV %02d", sv_prn);
+ pbuf += sprintf(pbuf, "\n Captured:%15.0f %s",
+ t_zc, show_time (t_zc));
+ pbuf += sprintf(pbuf, "\n week:%15d", week_num);
+ pbuf += sprintf(pbuf, "\n Eccentricity:%15g", eccentricity);
+ pbuf += sprintf(pbuf, "\n T_oa:%15.0f %s",
+ t_oa, show_time (t_oa));
+ pbuf += sprintf(pbuf, "\n i 0:%15g", i_0);
+ pbuf += sprintf(pbuf, "\n OMEGA dot:%15g", OMEGA_dot);
+ pbuf += sprintf(pbuf, "\n sqrt A:%15g", sqrt_A);
+ pbuf += sprintf(pbuf, "\n OMEGA 0:%15g", OMEGA_0);
+ pbuf += sprintf(pbuf, "\n omega:%15g", omega);
+ pbuf += sprintf(pbuf, "\n M 0:%15g", M_0);
+}
+
+/* 0x41 */
+static void
+rpt_GPS_time(
+ TSIPPKT *rpt
+ )
+{
+ float
+ time_of_week, UTC_offset;
+ short
+ week_num;
+
+ /* unload rptbuf */
+ if (rpt_0x41 (rpt, &time_of_week, &UTC_offset, &week_num)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nGPS time:%s GPS week: %d UTC offset %.1f",
+ show_time(time_of_week), week_num, UTC_offset);
+
+}
+
+/* 0x42 */
+static void
+rpt_single_ECEF_position(
+ TSIPPKT *rpt
+ )
+{
+ float
+ ECEF_pos[3], time_of_fix;
+
+ /* unload rptbuf */
+ if (rpt_0x42 (rpt, ECEF_pos, &time_of_fix)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nSXYZ: %15.0f %15.0f %15.0f %s",
+ ECEF_pos[0], ECEF_pos[1], ECEF_pos[2],
+ show_time(time_of_fix));
+}
+
+/* 0x43 */
+static void
+rpt_single_ECEF_velocity(
+ TSIPPKT *rpt
+ )
+{
+
+ float
+ ECEF_vel[3], freq_offset, time_of_fix;
+
+ /* unload rptbuf */
+ if (rpt_0x43 (rpt, ECEF_vel, &freq_offset, &time_of_fix)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nVelECEF: %11.3f %11.3f %11.3f %12.3f%s",
+ ECEF_vel[0], ECEF_vel[1], ECEF_vel[2], freq_offset,
+ show_time(time_of_fix));
+}
+
+/* 0x45 */
+static void
+rpt_SW_version(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ major_nav_version, minor_nav_version,
+ nav_day, nav_month, nav_year,
+ major_dsp_version, minor_dsp_version,
+ dsp_day, dsp_month, dsp_year;
+
+ /* unload rptbuf */
+ if (rpt_0x45 (rpt,
+ &major_nav_version, &minor_nav_version,
+ &nav_day, &nav_month, &nav_year,
+ &major_dsp_version, &minor_dsp_version,
+ &dsp_day, &dsp_month, &dsp_year)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf,
+ "\nFW Versions: Nav Proc %2d.%02d %2d/%2d/%2d Sig Proc %2d.%02d %2d/%2d/%2d",
+ major_nav_version, minor_nav_version, nav_day, nav_month, nav_year,
+ major_dsp_version, minor_dsp_version, dsp_day, dsp_month, dsp_year);
+}
+
+/* 0x46 */
+static void
+rpt_rcvr_health(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ status1, status2;
+ const char
+ *text;
+ static const char const
+ *sc_text[] = {
+ "Doing position fixes",
+ "Don't have GPS time yet",
+ "Waiting for almanac collection",
+ "DOP too high ",
+ "No satellites available",
+ "Only 1 satellite available",
+ "Only 2 satellites available",
+ "Only 3 satellites available",
+ "No satellites usable ",
+ "Only 1 satellite usable",
+ "Only 2 satellites usable",
+ "Only 3 satellites usable",
+ "Chosen satellite unusable"};
+
+
+ /* unload rptbuf */
+ if (rpt_0x46 (rpt, &status1, &status2))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ text = (status1 < COUNTOF(sc_text))
+ ? sc_text[status1]
+ : "(out of range)";
+ pbuf += sprintf(pbuf, "\nRcvr status1: %s (%02Xh); ",
+ text, status1);
+
+ pbuf += sprintf(pbuf, "status2: %s, %s (%02Xh)",
+ (status2 & 0x01)?"No BBRAM":"BBRAM OK",
+ (status2 & 0x10)?"No Ant":"Ant OK",
+ status2);
+}
+
+/* 0x47 */
+static void
+rpt_SNR_all_SVs(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ nsvs, sv_prn[12];
+ short
+ isv;
+ float
+ snr[12];
+
+ /* unload rptbuf */
+ if (rpt_0x47 (rpt, &nsvs, sv_prn, snr))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nSNR for satellites: %d", nsvs);
+ for (isv = 0; isv < nsvs; isv++)
+ {
+ pbuf += sprintf(pbuf, "\n SV %02d %6.2f",
+ sv_prn[isv], snr[isv]);
+ }
+}
+
+/* 0x48 */
+static void
+rpt_GPS_system_message(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ message[23];
+
+ /* unload rptbuf */
+ if (rpt_0x48 (rpt, message))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nGPS message: %s", message);
+}
+
+/* 0x49 */
+static void
+rpt_almanac_health_page(
+ TSIPPKT *rpt
+ )
+{
+ short
+ iprn;
+ unsigned char
+ sv_health [32];
+
+ /* unload rptbuf */
+ if (rpt_0x49 (rpt, sv_health))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nAlmanac health page:");
+ for (iprn = 0; iprn < 32; iprn++)
+ {
+ if (!(iprn%5)) *pbuf++ = '\n';
+ pbuf += sprintf(pbuf, " SV%02d %2X",
+ (iprn+1) , sv_health[iprn]);
+ }
+}
+
+/* 0x4A */
+static void
+rpt_single_lla_position(
+ TSIPPKT *rpt
+ )
+{
+ short
+ lat_deg, lon_deg;
+ float
+ lat, lon,
+ alt, clock_bias, time_of_fix;
+ double lat_min, lon_min;
+ unsigned char
+ north_south, east_west;
+
+ if (rpt_0x4A (rpt,
+ &lat, &lon, &alt, &clock_bias, &time_of_fix))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ /* convert from radians to degrees */
+ lat *= (float)R2D;
+ north_south = 'N';
+ if (lat < 0.0)
+ {
+ north_south = 'S';
+ lat = -lat;
+ }
+ lat_deg = (short)lat;
+ lat_min = (lat - lat_deg) * 60.0;
+
+ lon *= (float)R2D;
+ east_west = 'E';
+ if (lon < 0.0)
+ {
+ east_west = 'W';
+ lon = -lon;
+ }
+ lon_deg = (short)lon;
+ lon_min = (lon - lon_deg) * 60.0;
+
+ pbuf += sprintf(pbuf, "\nSLLA: %4d: %06.3f %c%5d:%06.3f %c%10.2f %12.2f%s",
+ lat_deg, lat_min, north_south,
+ lon_deg, lon_min, east_west,
+ alt, clock_bias,
+ show_time(time_of_fix));
+}
+
+/* 0x4A */
+static void
+rpt_ref_alt(
+ TSIPPKT *rpt
+ )
+{
+ float
+ alt, dummy;
+ unsigned char
+ alt_flag;
+
+ if (rpt_0x4A_2 (rpt, &alt, &dummy, &alt_flag))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nReference Alt: %.1f m; %s",
+ alt, alt_flag?"ON":"OFF");
+}
+
+/* 0x4B */
+static void
+rpt_rcvr_id_and_status(
+ TSIPPKT *rpt
+ )
+{
+
+ unsigned char
+ machine_id, status3, status4;
+
+ /* unload rptbuf */
+ if (rpt_0x4B (rpt, &machine_id, &status3, &status4))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nRcvr Machine ID: %d; Status3 = %s, %s (%02Xh)",
+ machine_id,
+ (status3 & 0x02)?"No RTC":"RTC OK",
+ (status3 & 0x08)?"No Alm":"Alm OK",
+ status3);
+}
+
+/* 0x4C */
+static void
+rpt_operating_parameters(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ dyn_code;
+ float
+ el_mask, snr_mask, dop_mask, dop_switch;
+
+ /* unload rptbuf */
+ if (rpt_0x4C (rpt, &dyn_code, &el_mask,
+ &snr_mask, &dop_mask, &dop_switch))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nOperating Parameters:");
+ pbuf += sprintf(pbuf, "\n Dynamics code = %d %s",
+ dyn_code, dyn_text[dyn_code]);
+ pbuf += sprintf(pbuf, "\n Elevation mask = %.2f", el_mask * R2D);
+ pbuf += sprintf(pbuf, "\n SNR mask = %.2f", snr_mask);
+ pbuf += sprintf(pbuf, "\n DOP mask = %.2f", dop_mask);
+ pbuf += sprintf(pbuf, "\n DOP switch = %.2f", dop_switch);
+}
+
+/* 0x4D */
+static void
+rpt_oscillator_offset(
+ TSIPPKT *rpt
+ )
+{
+ float
+ osc_offset;
+
+ /* unload rptbuf */
+ if (rpt_0x4D (rpt, &osc_offset))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nOscillator offset: %.2f Hz = %.3f PPM",
+ osc_offset, osc_offset/1575.42);
+}
+
+/* 0x4E */
+static void
+rpt_GPS_time_set_response(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ response;
+
+ /* unload rptbuf */
+ if (rpt_0x4E (rpt, &response))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ switch (response)
+ {
+ case 'Y':
+ pbuf += sprintf(pbuf, "\nTime set accepted");
+ break;
+
+ case 'N':
+ pbuf += sprintf(pbuf, "\nTime set rejected or not required");
+ break;
+
+ default:
+ parsed = BADDATA_PARSE;
+ }
+}
+
+/* 0x4F */
+static void
+rpt_UTC_offset(
+ TSIPPKT *rpt
+ )
+{
+ double
+ a0;
+ float
+ a1, time_of_data;
+ short
+ dt_ls, wn_t, wn_lsf, dn, dt_lsf;
+
+ /* unload rptbuf */
+ if (rpt_0x4F (rpt, &a0, &a1, &time_of_data,
+ &dt_ls, &wn_t, &wn_lsf, &dn, &dt_lsf)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nUTC Correction Data");
+ pbuf += sprintf(pbuf, "\n A_0 = %g ", a0);
+ pbuf += sprintf(pbuf, "\n A_1 = %g ", a1);
+ pbuf += sprintf(pbuf, "\n delta_t_LS = %d ", dt_ls);
+ pbuf += sprintf(pbuf, "\n t_ot = %.0f ", time_of_data);
+ pbuf += sprintf(pbuf, "\n WN_t = %d ", wn_t );
+ pbuf += sprintf(pbuf, "\n WN_LSF = %d ", wn_lsf );
+ pbuf += sprintf(pbuf, "\n DN = %d ", dn );
+ pbuf += sprintf(pbuf, "\n delta_t_LSF = %d ", dt_lsf );
+}
+
+/**/
+/* 0x54 */
+static void
+rpt_1SV_bias(
+ TSIPPKT *rpt
+ )
+{
+ float
+ clock_bias, freq_offset, time_of_fix;
+
+ /* unload rptbuf */
+ if (rpt_0x54 (rpt, &clock_bias, &freq_offset, &time_of_fix)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf (pbuf, "\nTime Fix Clock Bias: %6.2f m Freq Bias: %6.2f m/s%s",
+ clock_bias, freq_offset, show_time (time_of_fix));
+}
+
+/* 0x55 */
+static void
+rpt_io_opt(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ pos_code, vel_code, time_code, aux_code;
+
+ /* unload rptbuf */
+ if (rpt_0x55 (rpt,
+ &pos_code, &vel_code, &time_code, &aux_code)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+ /* rptbuf unloaded */
+
+ pbuf += sprintf(pbuf, "\nI/O Options: %2X %2X %2X %2X",
+ pos_code, vel_code, time_code, aux_code);
+
+ if (pos_code & 0x01) {
+ pbuf += sprintf(pbuf, "\n ECEF XYZ position output");
+ }
+
+ if (pos_code & 0x02) {
+ pbuf += sprintf(pbuf, "\n LLA position output");
+ }
+
+ pbuf += sprintf(pbuf, (pos_code & 0x04)?
+ "\n MSL altitude output (Geoid height) ":
+ "\n WGS-84 altitude output");
+
+ pbuf += sprintf(pbuf, (pos_code & 0x08)?
+ "\n MSL altitude input":
+ "\n WGS-84 altitude input");
+
+ pbuf += sprintf(pbuf, (pos_code & 0x10)?
+ "\n Double precision":
+ "\n Single precision");
+
+ if (pos_code & 0x20) {
+ pbuf += sprintf(pbuf, "\n All Enabled Superpackets");
+ }
+
+ if (vel_code & 0x01) {
+ pbuf += sprintf(pbuf, "\n ECEF XYZ velocity output");
+ }
+
+ if (vel_code & 0x02) {
+ pbuf += sprintf(pbuf, "\n ENU velocity output");
+ }
+
+ pbuf += sprintf(pbuf, (time_code & 0x01)?
+ "\n Time tags in UTC":
+ "\n Time tags in GPS time");
+
+ if (time_code & 0x02) {
+ pbuf += sprintf(pbuf, "\n Fixes delayed to integer seconds");
+ }
+
+ if (time_code & 0x04) {
+ pbuf += sprintf(pbuf, "\n Fixes sent only on request");
+ }
+
+ if (time_code & 0x08) {
+ pbuf += sprintf(pbuf, "\n Synchronized measurements");
+ }
+
+ if (time_code & 0x10) {
+ pbuf += sprintf(pbuf, "\n Minimize measurement propagation");
+ }
+
+ pbuf += sprintf(pbuf, (time_code & 0x20) ?
+ "\n PPS output at all times" :
+ "\n PPS output during fixes");
+
+ if (aux_code & 0x01) {
+ pbuf += sprintf(pbuf, "\n Raw measurement output");
+ }
+
+ if (aux_code & 0x02) {
+ pbuf += sprintf(pbuf, "\n Code-phase smoothed before output");
+ }
+
+ if (aux_code & 0x04) {
+ pbuf += sprintf(pbuf, "\n Additional fix status");
+ }
+
+ pbuf += sprintf(pbuf, (aux_code & 0x08)?
+ "\n Signal Strength Output as dBHz" :
+ "\n Signal Strength Output as AMU");
+}
+
+/* 0x56 */
+static void
+rpt_ENU_velocity(
+ TSIPPKT *rpt
+ )
+{
+ float
+ vel_ENU[3], freq_offset, time_of_fix;
+
+ /* unload rptbuf */
+ if (rpt_0x56 (rpt, vel_ENU, &freq_offset, &time_of_fix)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nVel ENU: %11.3f %11.3f %11.3f %12.3f%s",
+ vel_ENU[0], vel_ENU[1], vel_ENU[2], freq_offset,
+ show_time (time_of_fix));
+}
+
+/* 0x57 */
+static void
+rpt_last_fix_info(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ source_code, diag_code;
+ short
+ week_num;
+ float
+ time_of_fix;
+
+ /* unload rptbuf */
+ if (rpt_0x57 (rpt, &source_code, &diag_code, &week_num, &time_of_fix)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\n source code %d; diag code: %2Xh",
+ source_code, diag_code);
+ pbuf += sprintf(pbuf, "\n Time of last fix:%s", show_time(time_of_fix));
+ pbuf += sprintf(pbuf, "\n Week of last fix: %d", week_num);
+}
+
+/* 0x58 */
+static void
+rpt_GPS_system_data(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ iprn,
+ op_code, data_type, sv_prn,
+ data_length, data_packet[250];
+ ALM_INFO
+ *almanac;
+ ALH_PARMS
+ *almh;
+ UTC_INFO
+ *utc;
+ ION_INFO
+ *ionosphere;
+ EPHEM_CLOCK
+ *cdata;
+ EPHEM_ORBIT
+ *edata;
+ NAV_INFO
+ *nav_data;
+ unsigned char
+ curr_t_oa;
+ unsigned short
+ curr_wn_oa;
+ static char
+ *datname[] =
+ {"", "", "Almanac Orbit",
+ "Health Page & Ref Time", "Ionosphere", "UTC ",
+ "Ephemeris"};
+
+ /* unload rptbuf */
+ if (rpt_0x58 (rpt, &op_code, &data_type, &sv_prn,
+ &data_length, data_packet))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nSystem data [%d]: %s SV%02d",
+ data_type, datname[data_type], sv_prn);
+ switch (op_code)
+ {
+ case 1:
+ pbuf += sprintf(pbuf, " Acknowledgment");
+ break;
+ case 2:
+ pbuf += sprintf(pbuf, " length = %d bytes", data_length);
+ switch (data_type) {
+ case 2:
+ /* Almanac */
+ if (sv_prn == 0 || sv_prn > 32) {
+ pbuf += sprintf(pbuf, " Binary PRN invalid");
+ return;
+ }
+ almanac = (ALM_INFO*)data_packet;
+ pbuf += sprintf(pbuf, "\n t_oa_raw = % -12d SV_hlth = % -12d ",
+ almanac->t_oa_raw , almanac->SV_health );
+ pbuf += sprintf(pbuf, "\n e = % -12g t_oa = % -12g ",
+ almanac->e , almanac->t_oa );
+ pbuf += sprintf(pbuf, "\n i_0 = % -12g OMEGADOT = % -12g ",
+ almanac->i_0 , almanac->OMEGADOT );
+ pbuf += sprintf(pbuf, "\n sqrt_A = % -12g OMEGA_0 = % -12g ",
+ almanac->sqrt_A , almanac->OMEGA_0 );
+ pbuf += sprintf(pbuf, "\n omega = % -12g M_0 = % -12g ",
+ almanac->omega , almanac->M_0 );
+ pbuf += sprintf(pbuf, "\n a_f0 = % -12g a_f1 = % -12g ",
+ almanac->a_f0 , almanac->a_f1 );
+ pbuf += sprintf(pbuf, "\n Axis = % -12g n = % -12g ",
+ almanac->Axis , almanac->n );
+ pbuf += sprintf(pbuf, "\n OMEGA_n = % -12g ODOT_n = % -12g ",
+ almanac->OMEGA_n , almanac->ODOT_n );
+ pbuf += sprintf(pbuf, "\n t_zc = % -12g weeknum = % -12d ",
+ almanac->t_zc , almanac->weeknum );
+ pbuf += sprintf(pbuf, "\n wn_oa = % -12d", almanac->wn_oa );
+ break;
+
+ case 3:
+ /* Almanac health page */
+ almh = (ALH_PARMS*)data_packet;
+ pbuf += sprintf(pbuf, "\n t_oa = %d, wn_oa&0xFF = %d ",
+ almh->t_oa, almh->WN_a);
+ pbuf += sprintf(pbuf, "\nAlmanac health page:");
+ for (iprn = 0; iprn < 32; iprn++) {
+ if (!(iprn%5)) *pbuf++ = '\n';
+ pbuf += sprintf(pbuf, " SV%02d %2X",
+ (iprn+1) , almh->SV_health[iprn]);
+ }
+ curr_t_oa = data_packet[34];
+ curr_wn_oa = (unsigned short)((data_packet[35]<<8) + data_packet[36]);
+ pbuf += sprintf(pbuf, "\n current t_oa = %d, wn_oa = %d ",
+ curr_t_oa, curr_wn_oa);
+ break;
+
+ case 4:
+ /* Ionosphere */
+ ionosphere = (ION_INFO*)data_packet;
+ pbuf += sprintf(pbuf, "\n alpha_0 = % -12g alpha_1 = % -12g ",
+ ionosphere->alpha_0, ionosphere->alpha_1);
+ pbuf += sprintf(pbuf, "\n alpha_2 = % -12g alpha_3 = % -12g ",
+ ionosphere->alpha_2, ionosphere->alpha_3);
+ pbuf += sprintf(pbuf, "\n beta_0 = % -12g beta_1 = % -12g ",
+ ionosphere->beta_0, ionosphere->beta_1);
+ pbuf += sprintf(pbuf, "\n beta_2 = % -12g beta_3 = % -12g ",
+ ionosphere->beta_2, ionosphere->beta_3);
+ break;
+
+ case 5:
+ /* UTC */
+ utc = (UTC_INFO*)data_packet;
+ pbuf += sprintf(pbuf, "\n A_0 = %g ", utc->A_0);
+ pbuf += sprintf(pbuf, "\n A_1 = %g ", utc->A_1);
+ pbuf += sprintf(pbuf, "\n delta_t_LS = %d ", utc->delta_t_LS);
+ pbuf += sprintf(pbuf, "\n t_ot = %.0f ", utc->t_ot );
+ pbuf += sprintf(pbuf, "\n WN_t = %d ", utc->WN_t );
+ pbuf += sprintf(pbuf, "\n WN_LSF = %d ", utc->WN_LSF );
+ pbuf += sprintf(pbuf, "\n DN = %d ", utc->DN );
+ pbuf += sprintf(pbuf, "\n delta_t_LSF = %d ", utc->delta_t_LSF );
+ break;
+
+ case 6: /* Ephemeris */
+ if (sv_prn == 0 || sv_prn > 32) {
+ pbuf += sprintf(pbuf, " Binary PRN invalid");
+ return;
+ }
+ nav_data = (NAV_INFO*)data_packet;
+
+ pbuf += sprintf(pbuf, "\n SV_PRN = % -12d . t_ephem = % -12g . ",
+ nav_data->sv_number , nav_data->t_ephem );
+ cdata = &(nav_data->ephclk);
+ pbuf += sprintf(pbuf,
+ "\n weeknum = % -12d . codeL2 = % -12d . L2Pdata = % -12d",
+ cdata->weeknum , cdata->codeL2 , cdata->L2Pdata );
+ pbuf += sprintf(pbuf,
+ "\n SVacc_raw = % -12d .SV_health = % -12d . IODC = % -12d",
+ cdata->SVacc_raw, cdata->SV_health, cdata->IODC );
+ pbuf += sprintf(pbuf,
+ "\n T_GD = % -12g . t_oc = % -12g . a_f2 = % -12g",
+ cdata->T_GD, cdata->t_oc, cdata->a_f2 );
+ pbuf += sprintf(pbuf,
+ "\n a_f1 = % -12g . a_f0 = % -12g . SVacc = % -12g",
+ cdata->a_f1, cdata->a_f0, cdata->SVacc );
+ edata = &(nav_data->ephorb);
+ pbuf += sprintf(pbuf,
+ "\n IODE = % -12d .fit_intvl = % -12d . C_rs = % -12g",
+ edata->IODE, edata->fit_interval, edata->C_rs );
+ pbuf += sprintf(pbuf,
+ "\n delta_n = % -12g . M_0 = % -12g . C_uc = % -12g",
+ edata->delta_n, edata->M_0, edata->C_uc );
+ pbuf += sprintf(pbuf,
+ "\n ecc = % -12g . C_us = % -12g . sqrt_A = % -12g",
+ edata->e, edata->C_us, edata->sqrt_A );
+ pbuf += sprintf(pbuf,
+ "\n t_oe = % -12g . C_ic = % -12g . OMEGA_0 = % -12g",
+ edata->t_oe, edata->C_ic, edata->OMEGA_0 );
+ pbuf += sprintf(pbuf,
+ "\n C_is = % -12g . i_0 = % -12g . C_rc = % -12g",
+ edata->C_is, edata->i_0, edata->C_rc );
+ pbuf += sprintf(pbuf,
+ "\n omega = % -12g . OMEGADOT = % -12g . IDOT = % -12g",
+ edata->omega, edata->OMEGADOT, edata->IDOT );
+ pbuf += sprintf(pbuf,
+ "\n Axis = % -12g . n = % -12g . r1me2 = % -12g",
+ edata->Axis, edata->n, edata->r1me2 );
+ pbuf += sprintf(pbuf,
+ "\n OMEGA_n = % -12g . ODOT_n = % -12g",
+ edata->OMEGA_n, edata->ODOT_n );
+ break;
+ }
+ }
+}
+
+
+/* 0x59: */
+static void
+rpt_SVs_enabled(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ numsvs,
+ code_type,
+ status_code[32];
+ short
+ iprn;
+
+ /* unload rptbuf */
+ if (rpt_0x59 (rpt, &code_type, status_code))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+ switch (code_type)
+ {
+ case 3: pbuf += sprintf(pbuf, "\nSVs Disabled:\n"); break;
+ case 6: pbuf += sprintf(pbuf, "\nSVs with Health Ignored:\n"); break;
+ default: return;
+ }
+ numsvs = 0;
+ for (iprn = 0; iprn < 32; iprn++)
+ {
+ if (status_code[iprn])
+ {
+ pbuf += sprintf(pbuf, " %02d", iprn+1);
+ numsvs++;
+ }
+ }
+ if (numsvs == 0) pbuf += sprintf(pbuf, "None");
+}
+
+
+/* 0x5A */
+static void
+rpt_raw_msmt(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ sv_prn;
+ float
+ sample_length, signal_level, code_phase, Doppler;
+ double
+ time_of_fix;
+
+ /* unload rptbuf */
+ if (rpt_0x5A (rpt, &sv_prn, &sample_length, &signal_level,
+ &code_phase, &Doppler, &time_of_fix))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\n %02d %5.0f %7.1f %10.2f %10.2f %12.3f %s",
+ sv_prn, sample_length, signal_level, code_phase, Doppler, time_of_fix,
+ show_time ((float)time_of_fix));
+}
+
+/* 0x5B */
+static void
+rpt_SV_ephemeris_status(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ sv_prn, sv_health, sv_iode, fit_interval_flag;
+ float
+ time_of_collection, time_of_eph, sv_accy;
+
+ /* unload rptbuf */
+ if (rpt_0x5B (rpt, &sv_prn, &sv_health, &sv_iode, &fit_interval_flag,
+ &time_of_collection, &time_of_eph, &sv_accy))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\n SV%02d %s %2Xh %2Xh ",
+ sv_prn, show_time (time_of_collection), sv_health, sv_iode);
+ /* note: cannot use show_time twice in same call */
+ pbuf += sprintf(pbuf, "%s %1d %4.1f",
+ show_time (time_of_eph), fit_interval_flag, sv_accy);
+}
+
+/* 0x5C */
+static void
+rpt_SV_tracking_status(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ sv_prn, chan, slot, acq_flag, eph_flag,
+ old_msmt_flag, integer_msec_flag, bad_data_flag,
+ data_collect_flag;
+ float
+ signal_level, time_of_last_msmt,
+ elev, azim;
+
+ /* unload rptbuf */
+ if (rpt_0x5C (rpt,
+ &sv_prn, &slot, &chan, &acq_flag, &eph_flag,
+ &signal_level, &time_of_last_msmt, &elev, &azim,
+ &old_msmt_flag, &integer_msec_flag, &bad_data_flag,
+ &data_collect_flag))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf,
+ "\n SV%2d %1d %1d %1d %4.1f %s %5.1f %5.1f",
+ sv_prn, chan,
+ acq_flag, eph_flag, signal_level,
+ show_time(time_of_last_msmt),
+ elev*R2D, azim*R2D);
+}
+
+/**/
+/* 0x6D */
+static void
+rpt_allSV_selection(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ manual_mode, nsvs, sv_prn[8], ndim;
+ short
+ islot;
+ float
+ pdop, hdop, vdop, tdop;
+
+ /* unload rptbuf */
+ if (rpt_0x6D (rpt,
+ &manual_mode, &nsvs, &ndim, sv_prn,
+ &pdop, &hdop, &vdop, &tdop))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ switch (ndim)
+ {
+ case 0:
+ pbuf += sprintf(pbuf, "\nMode: Searching, %d-SV:", nsvs);
+ break;
+ case 1:
+ pbuf += sprintf(pbuf, "\nMode: One-SV Timing:");
+ break;
+ case 3: case 4:
+ pbuf += sprintf(pbuf, "\nMode: %c-%dD, %d-SV:",
+ manual_mode ? 'M' : 'A', ndim - 1, nsvs);
+ break;
+ case 5:
+ pbuf += sprintf(pbuf, "\nMode: Timing, %d-SV:", nsvs);
+ break;
+ default:
+ pbuf += sprintf(pbuf, "\nMode: Unknown = %d:", ndim);
+ break;
+ }
+
+ for (islot = 0; islot < nsvs; islot++)
+ {
+ if (sv_prn[islot]) pbuf += sprintf(pbuf, " %02d", sv_prn[islot]);
+ }
+ if (ndim == 3 || ndim == 4)
+ {
+ pbuf += sprintf(pbuf, "; DOPs: P %.1f H %.1f V %.1f T %.1f",
+ pdop, hdop, vdop, tdop);
+ }
+}
+
+/**/
+/* 0x82 */
+static void
+rpt_DGPS_position_mode(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ diff_mode;
+
+ /* unload rptbuf */
+ if (rpt_0x82 (rpt, &diff_mode)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nFix is%s DGPS-corrected (%s mode) (%d)",
+ (diff_mode&1) ? "" : " not",
+ (diff_mode&2) ? "auto" : "manual",
+ diff_mode);
+}
+
+/* 0x83 */
+static void
+rpt_double_ECEF_position(
+ TSIPPKT *rpt
+ )
+{
+ double
+ ECEF_pos[3], clock_bias;
+ float
+ time_of_fix;
+
+ /* unload rptbuf */
+ if (rpt_0x83 (rpt, ECEF_pos, &clock_bias, &time_of_fix))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nDXYZ:%12.2f %13.2f %13.2f %12.2f%s",
+ ECEF_pos[0], ECEF_pos[1], ECEF_pos[2], clock_bias,
+ show_time(time_of_fix));
+}
+
+/* 0x84 */
+static void
+rpt_double_lla_position(
+ TSIPPKT *rpt
+ )
+{
+ short
+ lat_deg, lon_deg;
+ double
+ lat, lon, lat_min, lon_min,
+ alt, clock_bias;
+ float
+ time_of_fix;
+ unsigned char
+ north_south, east_west;
+
+ /* unload rptbuf */
+ if (rpt_0x84 (rpt,
+ &lat, &lon, &alt, &clock_bias, &time_of_fix))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ lat *= R2D;
+ lon *= R2D;
+ if (lat < 0.0) {
+ north_south = 'S';
+ lat = -lat;
+ } else {
+ north_south = 'N';
+ }
+ lat_deg = (short)lat;
+ lat_min = (lat - lat_deg) * 60.0;
+
+ if (lon < 0.0) {
+ east_west = 'W';
+ lon = -lon;
+ } else {
+ east_west = 'E';
+ }
+ lon_deg = (short)lon;
+ lon_min = (lon - lon_deg) * 60.0;
+ pbuf += sprintf(pbuf, "\nDLLA: %2d:%08.5f %c; %3d:%08.5f %c; %10.2f %12.2f%s",
+ lat_deg, lat_min, north_south,
+ lon_deg, lon_min, east_west,
+ alt, clock_bias,
+ show_time(time_of_fix));
+}
+
+/* 0xBB */
+static void
+rpt_complete_rcvr_config(
+ TSIPPKT *rpt
+ )
+{
+ TSIP_RCVR_CFG TsipxBB ;
+ /* unload rptbuf */
+ if (rpt_Paly0xBB (rpt, &TsipxBB))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\n operating mode: %s",
+ NavModeText0xBB[TsipxBB.operating_mode]);
+ pbuf += sprintf(pbuf, "\n dynamics: %s",
+ dyn_text[TsipxBB.dyn_code]);
+ pbuf += sprintf(pbuf, "\n elev angle mask: %g deg",
+ TsipxBB.elev_mask * R2D);
+ pbuf += sprintf(pbuf, "\n SNR mask: %g AMU",
+ TsipxBB.cno_mask);
+ pbuf += sprintf(pbuf, "\n DOP mask: %g",
+ TsipxBB.dop_mask);
+ pbuf += sprintf(pbuf, "\n DOP switch: %g",
+ TsipxBB.dop_switch);
+ return ;
+}
+
+/* 0xBC */
+static void
+rpt_rcvr_serial_port_config(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ port_num, in_baud, out_baud, data_bits, parity, stop_bits, flow_control,
+ protocols_in, protocols_out, reserved;
+ unsigned char known;
+
+ /* unload rptbuf */
+ if (rpt_0xBC (rpt, &port_num, &in_baud, &out_baud, &data_bits, &parity,
+ &stop_bits, &flow_control, &protocols_in, &protocols_out, &reserved)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+ /* rptbuf unloaded */
+
+ pbuf += sprintf(pbuf, "\n RECEIVER serial port %s config:",
+ rcvr_port_text[port_num]);
+
+ pbuf += sprintf(pbuf, "\n I/O Baud %s/%s, %d - %s - %d",
+ st_baud_text_app[in_baud],
+ st_baud_text_app[out_baud],
+ data_bits+5,
+ parity_text[parity],
+ stop_bits=1);
+ pbuf += sprintf(pbuf, "\n Input protocols: ");
+ known = FALSE;
+ if (protocols_in&B_TSIP)
+ {
+ pbuf += sprintf(pbuf, "%s ", protocols_in_text[1]);
+ known = TRUE;
+ }
+ if (known == FALSE) pbuf += sprintf(pbuf, "No known");
+
+ pbuf += sprintf(pbuf, "\n Output protocols: ");
+ known = FALSE;
+ if (protocols_out&B_TSIP)
+ {
+ pbuf += sprintf(pbuf, "%s ", protocols_out_text[1]);
+ known = TRUE;
+ }
+ if (protocols_out&B_NMEA)
+ {
+ pbuf += sprintf(pbuf, "%s ", protocols_out_text[2]);
+ known = TRUE;
+ }
+ if (known == FALSE) pbuf += sprintf(pbuf, "No known");
+ reserved = reserved;
+
+}
+
+/* 0x8F */
+/* 8F0B */
+static void
+rpt_8F0B(
+ TSIPPKT *rpt
+ )
+{
+ const char
+ *oprtng_dim[7] = {
+ "horizontal (2-D)",
+ "full position (3-D)",
+ "single satellite (0-D)",
+ "automatic",
+ "N/A",
+ "N/A",
+ "overdetermined clock"};
+ char
+ sv_id[8];
+ unsigned char
+ month,
+ date,
+ dim_mode,
+ north_south,
+ east_west;
+ unsigned short
+ event;
+ short
+ utc_offset,
+ year,
+ local_index;
+ short
+ lat_deg,
+ lon_deg;
+ float
+ bias_unc,
+ dr_unc;
+ double
+ tow,
+ bias,
+ drift,
+ lat,
+ lon,
+ alt,
+ lat_min,
+ lon_min;
+ int
+ numfix,
+ numnotfix;
+
+ if (rpt_0x8F0B(rpt,
+ &event,
+ &tow,
+ &date,
+ &month,
+ &year,
+ &dim_mode,
+ &utc_offset,
+ &bias,
+ &drift,
+ &bias_unc,
+ &dr_unc,
+ &lat,
+ &lon,
+ &alt,
+ sv_id))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ if (event == 0)
+ {
+ pbuf += sprintf(pbuf, "\nNew partial+full meas");
+ }
+ else
+ {
+ pbuf += sprintf(pbuf, "\nEvent count: %5d", event);
+ }
+
+ pbuf += sprintf(pbuf, "\nGPS time : %s %2d/%2d/%2d (DMY)",
+ show_time(tow), date, month, year);
+ pbuf += sprintf(pbuf, "\nMode : %s", oprtng_dim[dim_mode]);
+ pbuf += sprintf(pbuf, "\nUTC offset: %2d", utc_offset);
+ pbuf += sprintf(pbuf, "\nClock Bias: %6.2f m", bias);
+ pbuf += sprintf(pbuf, "\nFreq bias : %6.2f m/s", drift);
+ pbuf += sprintf(pbuf, "\nBias unc : %6.2f m", bias_unc);
+ pbuf += sprintf(pbuf, "\nFreq unc : %6.2f m/s", dr_unc);
+
+ lat *= R2D; /* convert from radians to degrees */
+ lon *= R2D;
+ if (lat < 0.0)
+ {
+ north_south = 'S';
+ lat = -lat;
+ }
+ else
+ {
+ north_south = 'N';
+ }
+
+ lat_deg = (short)lat;
+ lat_min = (lat - lat_deg) * 60.0;
+ if (lon < 0.0)
+ {
+ east_west = 'W';
+ lon = -lon;
+ }
+ else
+ {
+ east_west = 'E';
+ }
+
+ lon_deg = (short)lon;
+ lon_min = (lon - lon_deg) * 60.0;
+ pbuf += sprintf(pbuf, "\nPosition :");
+ pbuf += sprintf(pbuf, " %4d %6.3f %c", lat_deg, lat_min, north_south);
+ pbuf += sprintf(pbuf, " %5d %6.3f %c", lon_deg, lon_min, east_west);
+ pbuf += sprintf(pbuf, " %10.2f", alt);
+
+ numfix = numnotfix = 0;
+ for (local_index=0; local_index<8; local_index++)
+ {
+ if (sv_id[local_index] < 0) numnotfix++;
+ if (sv_id[local_index] > 0) numfix++;
+ }
+ if (numfix > 0)
+ {
+ pbuf += sprintf(pbuf, "\nSVs used in fix : ");
+ for (local_index=0; local_index<8; local_index++)
+ {
+ if (sv_id[local_index] > 0)
+ {
+ pbuf += sprintf(pbuf, "%2d ", sv_id[local_index]);
+ }
+ }
+ }
+ if (numnotfix > 0)
+ {
+ pbuf += sprintf(pbuf, "\nOther SVs tracked: ");
+ for (local_index=0; local_index<8; local_index++)
+ {
+ if (sv_id[local_index] < 0)
+ {
+ pbuf += sprintf(pbuf, "%2d ", sv_id[local_index]);
+ }
+ }
+ }
+}
+
+/* 0x8F14 */
+/* Datum parameters */
+static void
+rpt_8F14(
+ TSIPPKT *rpt
+ )
+{
+ double
+ datum_coeffs[5];
+ short
+ datum_idx;
+
+ /* unload rptbuf */
+ if (rpt_0x8F14 (rpt, &datum_idx, datum_coeffs))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ if (datum_idx == -1)
+ {
+ pbuf += sprintf(pbuf, "\nUser-Entered Datum:");
+ pbuf += sprintf(pbuf, "\n dx = %6.1f", datum_coeffs[0]);
+ pbuf += sprintf(pbuf, "\n dy = %6.1f", datum_coeffs[1]);
+ pbuf += sprintf(pbuf, "\n dz = %6.1f", datum_coeffs[2]);
+ pbuf += sprintf(pbuf, "\n a-axis = %10.3f", datum_coeffs[3]);
+ pbuf += sprintf(pbuf, "\n e-squared = %16.14f", datum_coeffs[4]);
+ }
+ else if (datum_idx == 0)
+ {
+ pbuf += sprintf(pbuf, "\nWGS-84 datum, Index 0 ");
+ }
+ else
+ {
+ pbuf += sprintf(pbuf, "\nStandard Datum, Index %3d ", datum_idx);
+ }
+}
+
+/* 0x8F15 */
+/* Datum parameters */
+static void
+rpt_8F15(
+ TSIPPKT *rpt
+ )
+{
+ double
+ datum_coeffs[5];
+ short
+ datum_idx;
+
+ /* unload rptbuf */
+ if (rpt_0x8F15 (rpt, &datum_idx, datum_coeffs)) {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ if (datum_idx == -1)
+ {
+ pbuf += sprintf(pbuf, "\nUser-Entered Datum:");
+ pbuf += sprintf(pbuf, "\n dx = %6.1f", datum_coeffs[0]);
+ pbuf += sprintf(pbuf, "\n dy = %6.1f", datum_coeffs[1]);
+ pbuf += sprintf(pbuf, "\n dz = %6.1f", datum_coeffs[2]);
+ pbuf += sprintf(pbuf, "\n a-axis = %10.3f", datum_coeffs[3]);
+ pbuf += sprintf(pbuf, "\n e-squared = %16.14f", datum_coeffs[4]);
+ }
+ else if (datum_idx == 0)
+ {
+ pbuf += sprintf(pbuf, "\nWGS-84 datum, Index 0 ");
+ }
+ else
+ {
+ pbuf += sprintf(pbuf, "\nStandard Datum, Index %3d ", datum_idx);
+ }
+}
+
+/* 0x8F20 */
+#define INFO_DGPS 0x02
+#define INFO_2D 0x04
+#define INFO_ALTSET 0x08
+#define INFO_FILTERED 0x10
+static void
+rpt_8F20(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ info, nsvs, sv_prn[32];
+ short
+ week_num, datum_index, sv_IODC[32];
+ double
+ lat, lon, alt, time_of_fix;
+ double
+ londeg, latdeg, vel[3];
+ short
+ isv;
+ char
+ datum_string[20];
+
+ /* unload rptbuf */
+ if (rpt_0x8F20 (rpt,
+ &info, &lat, &lon, &alt, vel,
+ &time_of_fix,
+ &week_num, &nsvs, sv_prn, sv_IODC, &datum_index))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+ pbuf += sprintf(pbuf,
+ "\nFix at: %04d:%3s:%02d:%02d:%06.3f GPS (=UTC+%2ds) FixType: %s%s%s",
+ week_num,
+ dayname[(short)(time_of_fix/86400.0)],
+ (short)fmod(time_of_fix/3600., 24.),
+ (short)fmod(time_of_fix/60., 60.),
+ fmod(time_of_fix, 60.),
+ (char)rpt->buf[29], /* UTC offset */
+ (info & INFO_DGPS)?"Diff":"",
+ (info & INFO_2D)?"2D":"3D",
+ (info & INFO_FILTERED)?"-Filtrd":"");
+
+ if (datum_index > 0)
+ {
+ sprintf(datum_string, "Datum%3d", datum_index);
+ }
+ else if (datum_index)
+ {
+ sprintf(datum_string, "Unknown ");
+ }
+ else
+ {
+ sprintf(datum_string, "WGS-84");
+ }
+
+ /* convert from radians to degrees */
+ latdeg = R2D * fabs(lat);
+ londeg = R2D * fabs(lon);
+ pbuf += sprintf(pbuf,
+ "\n Pos: %4d:%09.6f %c %5d:%09.6f %c %10.2f m HAE (%s)",
+ (short)latdeg, fmod (latdeg, 1.)*60.0,
+ (lat<0.0)?'S':'N',
+ (short)londeg, fmod (londeg, 1.)*60.0,
+ (lon<0.0)?'W':'E',
+ alt,
+ datum_string);
+ pbuf += sprintf(pbuf,
+ "\n Vel: %9.3f E %9.3f N %9.3f U (m/sec)",
+ vel[0], vel[1], vel[2]);
+
+ pbuf += sprintf(pbuf,
+ "\n SVs: ");
+ for (isv = 0; isv < nsvs; isv++) {
+ pbuf += sprintf(pbuf, " %02d", sv_prn[isv]);
+ }
+ pbuf += sprintf(pbuf, " (IODEs:");
+ for (isv = 0; isv < nsvs; isv++) {
+ pbuf += sprintf(pbuf, " %02X", sv_IODC[isv]&0xFF);
+ }
+ pbuf += sprintf(pbuf, ")");
+}
+
+/* 0x8F41 */
+static void
+rpt_8F41(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ bSearchRange,
+ bBoardOptions,
+ bBuildYear,
+ bBuildMonth,
+ bBuildDay,
+ bBuildHour;
+ float
+ fOscOffset;
+ unsigned short
+ iTestCodeId;
+ unsigned long
+ iiSerialNumber;
+
+ if (!rpt_0x8F41(rpt,
+ &bSearchRange,
+ &bBoardOptions,
+ &iiSerialNumber,
+ &bBuildYear,
+ &bBuildMonth,
+ &bBuildDay,
+ &bBuildHour,
+ &fOscOffset,
+ &iTestCodeId))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\n search range: %d",
+ bSearchRange);
+ pbuf += sprintf(pbuf, "\n board options: %d",
+ bBoardOptions);
+ pbuf += sprintf(pbuf, "\n board serial #: %ld",
+ iiSerialNumber);
+ pbuf += sprintf(pbuf, "\n build date/hour: %02d/%02d/%02d %02d:00",
+ bBuildDay, bBuildMonth, bBuildYear, bBuildHour);
+ pbuf += sprintf(pbuf, "\n osc offset: %.3f PPM (%.0f Hz)",
+ fOscOffset/1575.42, fOscOffset);
+ pbuf += sprintf(pbuf, "\n test code: %d",
+ iTestCodeId);
+}
+
+/* 0x8F42 */
+static void
+rpt_8F42(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ bProdOptionsPre,
+ bProdNumberExt;
+ unsigned short
+ iCaseSerialNumberPre,
+ iPremiumOptions,
+ iMachineID,
+ iKey;
+ unsigned long
+ iiCaseSerialNumber,
+ iiProdNumber;
+
+ if (!rpt_0x8F42(rpt,
+ &bProdOptionsPre,
+ &bProdNumberExt,
+ &iCaseSerialNumberPre,
+ &iiCaseSerialNumber,
+ &iiProdNumber,
+ &iPremiumOptions,
+ &iMachineID,
+ &iKey))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nProduct ID 8F42");
+ pbuf += sprintf(pbuf, "\n extension: %d", bProdNumberExt);
+ pbuf += sprintf(pbuf, "\n case serial # prefix: %d", iCaseSerialNumberPre);
+ pbuf += sprintf(pbuf, "\n case serial #: %ld", iiCaseSerialNumber);
+ pbuf += sprintf(pbuf, "\n prod. #: %ld", iiProdNumber);
+ pbuf += sprintf(pbuf, "\n premium options: %Xh", iPremiumOptions);
+ pbuf += sprintf(pbuf, "\n machine ID: %d", iMachineID);
+ pbuf += sprintf(pbuf, "\n key: %Xh", iKey);
+}
+
+/* 0x8F45 */
+static void
+rpt_8F45(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char bSegMask;
+
+ if (!rpt_0x8F45(rpt,
+ &bSegMask))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+ pbuf += sprintf(pbuf, "\nCleared Segment Mask: %Xh", bSegMask);
+}
+
+/* Stinger PPS def */
+static void
+rpt_8F4A(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ pps_enabled,
+ pps_timebase,
+ pps_polarity;
+ float
+ bias_unc_threshold;
+ double
+ pps_offset;
+
+ if (rpt_0x8F4A_16 (rpt,
+ &pps_enabled,
+ &pps_timebase,
+ &pps_polarity,
+ &pps_offset,
+ &bias_unc_threshold))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nPPS is %s", pps_enabled?"enabled":"disabled");
+ pbuf += sprintf(pbuf, "\n timebase: %s", PPSTimeBaseText[pps_timebase]);
+ pbuf += sprintf(pbuf, "\n polarity: %s", PPSPolarityText[pps_polarity]);
+ pbuf += sprintf(pbuf, "\n offset: %.1f ns, ", pps_offset*1.e9);
+ pbuf += sprintf(pbuf, "\n biasunc: %.1f ns", bias_unc_threshold/GPS_C*1.e9);
+}
+
+/* fast-SA decorrolation time for self-survey */
+static void
+rpt_8F4B(
+ TSIPPKT *rpt
+ )
+{
+ unsigned long
+ decorr_max;
+
+ if (rpt_0x8F4B(rpt, &decorr_max))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf,
+ "\nMax # of position fixes for self-survey : %ld",
+ decorr_max);
+}
+
+static void
+rpt_8F4D(
+ TSIPPKT *rpt
+ )
+{
+ static char
+ *linestart;
+ unsigned long
+ OutputMask;
+ static unsigned long
+ MaskBit[] = {
+ 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010,
+ 0x00000020,
+ 0x00000100L, 0x00000800L, 0x00001000L,
+ 0x40000000L, 0x80000000L};
+ int
+ ichoice,
+ numchoices;
+
+ if (rpt_0x8F4D(rpt, &OutputMask))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nAuto-Report Mask: %02X %02X %02X %02X",
+ (unsigned char)(OutputMask>>24),
+ (unsigned char)(OutputMask>>16),
+ (unsigned char)(OutputMask>>8),
+ (unsigned char)OutputMask);
+
+ numchoices = sizeof(MaskText)/sizeof(char*);
+ pbuf += sprintf(pbuf, "\nAuto-Reports scheduled for Output:");
+ linestart = pbuf;
+ for (ichoice = 0; ichoice < numchoices; ichoice++)
+ {
+ if (OutputMask&MaskBit[ichoice])
+ {
+ pbuf += sprintf(pbuf, "%s %s",
+ (pbuf==linestart)?"\n ":",",
+ MaskText[ichoice]);
+ if (pbuf-linestart > 60) linestart = pbuf;
+ }
+ }
+
+ pbuf += sprintf(pbuf, "\nAuto-Reports NOT scheduled for Output:");
+ linestart = pbuf;
+ for (ichoice = 0; ichoice < numchoices; ichoice++)
+ {
+ if (OutputMask&MaskBit[ichoice]) continue;
+ pbuf += sprintf(pbuf, "%s %s",
+ (pbuf==linestart)?"\n ":",",
+ MaskText[ichoice]);
+ if (pbuf-linestart > 60) linestart = pbuf;
+ }
+}
+
+static void
+rpt_8FA5(
+ TSIPPKT *rpt
+ )
+{
+ unsigned char
+ spktmask[4];
+
+ if (rpt_0x8FA5(rpt, spktmask))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\nSuperpacket auto-output mask: %02X %02X %02X %02X",
+ spktmask[0], spktmask[1], spktmask[2], spktmask[3]);
+
+ if (spktmask[0]&0x01) pbuf+= sprintf (pbuf, "\n PPS 8F-0B");
+ if (spktmask[0]&0x02) pbuf+= sprintf (pbuf, "\n Event 8F-0B");
+ if (spktmask[0]&0x10) pbuf+= sprintf (pbuf, "\n PPS 8F-AD");
+ if (spktmask[0]&0x20) pbuf+= sprintf (pbuf, "\n Event 8F-AD");
+ if (spktmask[2]&0x01) pbuf+= sprintf (pbuf, "\n ppos Fix 8F-20");
+}
+
+static void
+rpt_8FAD(
+ TSIPPKT *rpt
+ )
+{
+ unsigned short
+ Count,
+ Year;
+ double
+ FracSec;
+ unsigned char
+ Hour,
+ Minute,
+ Second,
+ Day,
+ Month,
+ Status,
+ Flags;
+ static char* Status8FADText[] = {
+ "CODE_DOING_FIXES",
+ "CODE_GOOD_1_SV",
+ "CODE_APPX_1SV",
+ "CODE_NEED_TIME",
+ "CODE_NEED_INITIALIZATION",
+ "CODE_PDOP_HIGH",
+ "CODE_BAD_1SV",
+ "CODE_0SVS",
+ "CODE_1SV",
+ "CODE_2SVS",
+ "CODE_3SVS",
+ "CODE_NO_INTEGRITY",
+ "CODE_DCORR_GEN",
+ "CODE_OVERDET_CLK",
+ "Invalid Status"},
+ *LeapStatusText[] = {
+ " UTC Avail", " ", " ", " ",
+ " Scheduled", " Pending", " Warning", " In Progress"};
+ int i;
+
+ if (rpt_0x8FAD (rpt,
+ &Count,
+ &FracSec,
+ &Hour,
+ &Minute,
+ &Second,
+ &Day,
+ &Month,
+ &Year,
+ &Status,
+ &Flags))
+ {
+ parsed = BADLEN_PARSE;
+ return;
+ }
+
+ pbuf += sprintf(pbuf, "\n8FAD Count: %d Status: %s",
+ Count, Status8FADText[Status]);
+
+ pbuf += sprintf(pbuf, "\n Leap Flags:");
+ if (Flags)
+ {
+ for (i=0; i<8; i++)
+ {
+ if (Flags&(1<<i)) pbuf += sprintf(pbuf, LeapStatusText[i]);
+ }
+ }
+ else
+ {
+ pbuf += sprintf(pbuf, " UTC info not available");
+ }
+
+ pbuf += sprintf(pbuf, "\n %02d/%02d/%04d (DMY) %02d:%02d:%02d.%09ld UTC",
+ Day, Month, Year, Hour, Minute, Second, (long)(FracSec*1.e9));
+}
+
+
+int
+print_msg_table_header(
+ int rptcode,
+ char *HdrStr,
+ int force
+ )
+{
+ /* force header is to help auto-output function */
+ /* last_rptcode is to determine whether to print a header */
+ /* for the first occurrence of a series of reports */
+ static int
+ last_rptcode = 0;
+ int
+ numchars;
+
+ numchars = 0;
+ if (force || rptcode!=last_rptcode)
+ {
+ /* supply a header in console output */
+ switch (rptcode)
+ {
+ case 0x5A:
+ numchars = sprintf(HdrStr, "\nRaw Measurement Data");
+ numchars += sprintf(HdrStr+numchars,
+ "\n SV Sample SNR Code Phase Doppler Seconds Time of Meas");
+ break;
+
+ case 0x5B:
+ numchars = sprintf(HdrStr, "\nEphemeris Status");
+ numchars += sprintf(HdrStr+numchars,
+ "\n SV Time collected Health IODE t oe Fit URA");
+ break;
+
+ case 0x5C:
+ numchars = sprintf(HdrStr, "\nTracking Info");
+ numchars += sprintf(HdrStr+numchars,
+ "\n SV C Acq Eph SNR Time of Meas Elev Azim ");
+ break;
+
+ }
+ }
+ last_rptcode = rptcode;
+ return (short)numchars;
+}
+
+static void
+unknown_rpt(
+ TSIPPKT *rpt
+ )
+{
+ int i;
+
+ /* app-specific rpt packets */
+ if (parsed == BADLEN_PARSE)
+ {
+ pbuf += sprintf(pbuf, "\nTSIP report packet ID %2Xh, length %d: Bad length",
+ rpt->code, rpt->len);
+ }
+ if (parsed == BADID_PARSE)
+ {
+ pbuf += sprintf(pbuf,
+ "\nTSIP report packet ID %2Xh, length %d: translation not supported",
+ rpt->code, rpt->len);
+ }
+
+ if (parsed == BADDATA_PARSE)
+ {
+ pbuf += sprintf(pbuf,
+ "\nTSIP report packet ID %2Xh, length %d: data content incorrect",
+ rpt->code, rpt->len);
+ }
+
+ for (i = 0; i < rpt->len; i++) {
+ if ((i % 20) == 0) *pbuf++ = '\n';
+ pbuf += sprintf(pbuf, " %02X", rpt->buf[i]);
+ }
+}
+/**/
+
+/*
+** main subroutine, called from ProcessInputBytesWhileWaitingForKBHit()
+*/
+void
+TranslateTSIPReportToText(
+ TSIPPKT *rpt,
+ char *TextOutputBuffer
+ )
+{
+
+ /* pbuf is the pointer to the current location of the text output */
+ pbuf = TextOutputBuffer;
+
+ /* keep track of whether the message has been successfully parsed */
+ parsed = GOOD_PARSE;
+
+ /* print a header if this is the first of a series of messages */
+ pbuf += print_msg_table_header (rpt->code, pbuf, FALSE);
+
+ /* process incoming TSIP report according to code */
+ switch (rpt->code)
+ {
+ case 0x3D: rpt_chan_A_config (rpt); break;
+ case 0x40: rpt_almanac_data_page (rpt); break;
+ case 0x41: rpt_GPS_time (rpt); break;
+ case 0x42: rpt_single_ECEF_position (rpt); break;
+ case 0x43: rpt_single_ECEF_velocity (rpt); break;
+ case 0x45: rpt_SW_version (rpt); break;
+ case 0x46: rpt_rcvr_health (rpt); break;
+ case 0x47: rpt_SNR_all_SVs (rpt); break;
+ case 0x48: rpt_GPS_system_message (rpt); break;
+ case 0x49: rpt_almanac_health_page (rpt); break;
+ case 0x4A: switch (rpt->len) {
+ /*
+ ** special case (=slip-up) in the TSIP protocol;
+ ** parsing method depends on length
+ */
+ case 20: rpt_single_lla_position (rpt); break;
+ case 9: rpt_ref_alt (rpt); break;
+ } break;
+ case 0x4B: rpt_rcvr_id_and_status (rpt);break;
+ case 0x4C: rpt_operating_parameters (rpt); break;
+ case 0x4D: rpt_oscillator_offset (rpt); break;
+ case 0x4E: rpt_GPS_time_set_response (rpt); break;
+ case 0x4F: rpt_UTC_offset (rpt); break;
+ case 0x54: rpt_1SV_bias (rpt); break;
+ case 0x55: rpt_io_opt (rpt); break;
+ case 0x56: rpt_ENU_velocity (rpt); break;
+ case 0x57: rpt_last_fix_info (rpt); break;
+ case 0x58: rpt_GPS_system_data (rpt); break;
+ case 0x59: rpt_SVs_enabled (rpt); break;
+ case 0x5A: rpt_raw_msmt (rpt); break;
+ case 0x5B: rpt_SV_ephemeris_status (rpt); break;
+ case 0x5C: rpt_SV_tracking_status (rpt); break;
+ case 0x6D: rpt_allSV_selection (rpt); break;
+ case 0x82: rpt_DGPS_position_mode (rpt); break;
+ case 0x83: rpt_double_ECEF_position (rpt); break;
+ case 0x84: rpt_double_lla_position (rpt); break;
+ case 0xBB: rpt_complete_rcvr_config (rpt); break;
+ case 0xBC: rpt_rcvr_serial_port_config (rpt); break;
+
+ case 0x8F: switch (rpt->buf[0])
+ {
+ /* superpackets; parsed according to subcodes */
+ case 0x0B: rpt_8F0B(rpt); break;
+ case 0x14: rpt_8F14(rpt); break;
+ case 0x15: rpt_8F15(rpt); break;
+ case 0x20: rpt_8F20(rpt); break;
+ case 0x41: rpt_8F41(rpt); break;
+ case 0x42: rpt_8F42(rpt); break;
+ case 0x45: rpt_8F45(rpt); break;
+ case 0x4A: rpt_8F4A(rpt); break;
+ case 0x4B: rpt_8F4B(rpt); break;
+ case 0x4D: rpt_8F4D(rpt); break;
+ case 0xA5: rpt_8FA5(rpt); break;
+ case 0xAD: rpt_8FAD(rpt); break;
+ default: parsed = BADID_PARSE; break;
+ }
+ break;
+
+ default: parsed = BADID_PARSE; break;
+ }
+
+ if (parsed != GOOD_PARSE)
+ {
+ /*
+ **The message has TSIP structure (DLEs, etc.)
+ ** but could not be parsed by above routines
+ */
+ unknown_rpt (rpt);
+ }
+
+ /* close TextOutputBuffer */
+ pbuf = '\0';
+}
+
+#endif /* TRIMBLE_OUTPUT_FUNC */
+
+#else /* defined(REFCLOCK) && defined(CLOCK_RIPENCC) */
+int refclock_ripencc_bs;
+#endif /* defined(REFCLOCK) && defined(CLOCK_RIPENCC) */
+
diff --git a/ntpd/refclock_shm.c b/ntpd/refclock_shm.c
new file mode 100644
index 0000000..6540e6f
--- /dev/null
+++ b/ntpd/refclock_shm.c
@@ -0,0 +1,571 @@
+/*
+ * refclock_shm - clock driver for utc via shared memory
+ * - under construction -
+ * To add new modes: Extend or union the shmTime-struct. Do not
+ * extend/shrink size, because otherwise existing implementations
+ * will specify wrong size of shared memory-segment
+ * PB 18.3.97
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#if defined(REFCLOCK) && defined(CLOCK_SHM)
+
+#include "ntpd.h"
+#undef fileno
+#include "ntp_io.h"
+#undef fileno
+#include "ntp_refclock.h"
+#undef fileno
+#include "timespecops.h"
+#undef fileno
+#include "ntp_stdlib.h"
+
+#undef fileno
+#include <ctype.h>
+#undef fileno
+
+#ifndef SYS_WINNT
+# include <sys/ipc.h>
+# include <sys/shm.h>
+# include <assert.h>
+# include <unistd.h>
+# include <stdio.h>
+#endif
+
+/*
+ * This driver supports a reference clock attached thru shared memory
+ */
+
+/*
+ * SHM interface definitions
+ */
+#define PRECISION (-1) /* precision assumed (0.5 s) */
+#define REFID "SHM" /* reference ID */
+#define DESCRIPTION "SHM/Shared memory interface"
+
+#define NSAMPLES 3 /* stages of median filter */
+
+/*
+ * Function prototypes
+ */
+static int shm_start (int unit, struct peer *peer);
+static void shm_shutdown (int unit, struct peer *peer);
+static void shm_poll (int unit, struct peer *peer);
+static void shm_timer (int unit, struct peer *peer);
+static void shm_peek (int unit, struct peer *peer);
+static void shm_clockstats (int unit, struct peer *peer);
+static void shm_control (int unit, const struct refclockstat * in_st,
+ struct refclockstat * out_st, struct peer *peer);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_shm = {
+ shm_start, /* start up driver */
+ shm_shutdown, /* shut down driver */
+ shm_poll, /* transmit poll message */
+ shm_control, /* control settings */
+ noentry, /* not used: init */
+ noentry, /* not used: buginfo */
+ shm_timer, /* once per second */
+};
+
+struct shmTime {
+ int mode; /* 0 - if valid is set:
+ * use values,
+ * clear valid
+ * 1 - if valid is set:
+ * if count before and after read of values is equal,
+ * use values
+ * clear valid
+ */
+ volatile int count;
+ time_t clockTimeStampSec;
+ int clockTimeStampUSec;
+ time_t receiveTimeStampSec;
+ int receiveTimeStampUSec;
+ int leap;
+ int precision;
+ int nsamples;
+ volatile int valid;
+ unsigned clockTimeStampNSec; /* Unsigned ns timestamps */
+ unsigned receiveTimeStampNSec; /* Unsigned ns timestamps */
+ int dummy[8];
+};
+
+struct shmunit {
+ struct shmTime *shm; /* pointer to shared memory segment */
+
+ /* debugging/monitoring counters - reset when printed */
+ int ticks; /* number of attempts to read data*/
+ int good; /* number of valid samples */
+ int notready; /* number of peeks without data ready */
+ int bad; /* number of invalid samples */
+ int clash; /* number of access clashes while reading */
+
+ time_t max_delta; /* difference limit */
+ time_t max_delay; /* age/stale limit */
+};
+
+
+struct shmTime *getShmTime(int);
+
+struct shmTime *getShmTime (int unit) {
+#ifndef SYS_WINNT
+ int shmid=0;
+
+ /* 0x4e545030 is NTP0.
+ * Big units will give non-ascii but that's OK
+ * as long as everybody does it the same way.
+ */
+ shmid=shmget (0x4e545030 + unit, sizeof (struct shmTime),
+ IPC_CREAT | ((unit < 2) ? 0600 : 0666));
+ if (shmid == -1) { /* error */
+ msyslog(LOG_ERR, "SHM shmget (unit %d): %m", unit);
+ return 0;
+ }
+ else { /* no error */
+ struct shmTime *p = (struct shmTime *)shmat (shmid, 0, 0);
+ if (p == (struct shmTime *)-1) { /* error */
+ msyslog(LOG_ERR, "SHM shmat (unit %d): %m", unit);
+ return 0;
+ }
+ return p;
+ }
+#else
+ char buf[10];
+ LPSECURITY_ATTRIBUTES psec = 0;
+ HANDLE shmid = 0;
+ SECURITY_DESCRIPTOR sd;
+ SECURITY_ATTRIBUTES sa;
+
+ snprintf(buf, sizeof(buf), "NTP%d", unit);
+ if (unit >= 2) { /* world access */
+ if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) {
+ msyslog(LOG_ERR,"SHM InitializeSecurityDescriptor (unit %d): %m", unit);
+ return 0;
+ }
+ if (!SetSecurityDescriptorDacl(&sd, 1, 0, 0)) {
+ msyslog(LOG_ERR, "SHM SetSecurityDescriptorDacl (unit %d): %m", unit);
+ return 0;
+ }
+ sa.nLength=sizeof (SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = &sd;
+ sa.bInheritHandle = 0;
+ psec = &sa;
+ }
+ shmid = CreateFileMapping ((HANDLE)0xffffffff, psec, PAGE_READWRITE,
+ 0, sizeof (struct shmTime), buf);
+ if (!shmid) { /*error*/
+ char buf[1000];
+
+ FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
+ 0, GetLastError (), 0, buf, sizeof (buf), 0);
+ msyslog(LOG_ERR, "SHM CreateFileMapping (unit %d): %s", unit, buf);
+ return 0;
+ } else {
+ struct shmTime *p = (struct shmTime *) MapViewOfFile (shmid,
+ FILE_MAP_WRITE, 0, 0, sizeof (struct shmTime));
+ if (p == 0) { /*error*/
+ char buf[1000];
+
+ FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
+ 0, GetLastError (), 0, buf, sizeof (buf), 0);
+ msyslog(LOG_ERR,"SHM MapViewOfFile (unit %d): %s", unit, buf)
+ return 0;
+ }
+ return p;
+ }
+#endif
+}
+/*
+ * shm_start - attach to shared memory
+ */
+static int
+shm_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct shmunit *up;
+
+ pp = peer->procptr;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = -1;
+
+ up = emalloc_zero(sizeof(*up));
+
+ up->shm = getShmTime(unit);
+
+ /*
+ * Initialize miscellaneous peer variables
+ */
+ memcpy((char *)&pp->refid, REFID, 4);
+ if (up->shm != 0) {
+ pp->unitptr = up;
+ up->shm->precision = PRECISION;
+ peer->precision = up->shm->precision;
+ up->shm->valid = 0;
+ up->shm->nsamples = NSAMPLES;
+ pp->clockdesc = DESCRIPTION;
+ /* items to be changed later in 'shm_control()': */
+ up->max_delay = 5;
+ up->max_delta = 4*3600;
+ return 1;
+ } else {
+ free(up);
+ pp->unitptr = NULL;
+ return 0;
+ }
+}
+
+
+/*
+ * shm_control - configure flag1/time2 params
+ *
+ * These are not yet available during 'shm_start', so we have to do any
+ * pre-computations we want to avoid during regular poll/timer callbacks
+ * in this callback.
+ */
+static void
+shm_control(
+ int unit,
+ const struct refclockstat * in_st,
+ struct refclockstat * out_st,
+ struct peer * peer
+ )
+{
+ struct refclockproc *pp;
+ struct shmunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (NULL == up)
+ return;
+ if (pp->sloppyclockflag & CLK_FLAG1)
+ up->max_delta = 0;
+ else if (pp->fudgetime2 < 1. || pp->fudgetime2 > 86400.)
+ up->max_delta = 4*3600;
+ else
+ up->max_delta = (time_t)floor(pp->fudgetime2 + 0.5);
+}
+
+
+/*
+ * shm_shutdown - shut down the clock
+ */
+static void
+shm_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct shmunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (NULL == up)
+ return;
+#ifndef SYS_WINNT
+ /* HMS: shmdt() wants char* or const void * */
+ (void) shmdt ((char *)up->shm);
+#else
+ UnmapViewOfFile (up->shm);
+#endif
+ free(up);
+}
+
+
+/*
+ * shm_timer - called every second
+ */
+static void
+shm_timer(int unit, struct peer *peer)
+{
+ shm_peek(unit, peer);
+}
+
+
+/*
+ * shm_poll - called by the transmit procedure
+ */
+static void
+shm_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct shmunit *up;
+ int major_error;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ pp->polls++;
+
+ /* get dominant reason if we have no samples at all */
+ major_error = max(up->notready, up->bad);
+ major_error = max(major_error, up->clash);
+
+ /*
+ * Process median filter samples. If none received, see what
+ * happened, tell the core and keep going.
+ */
+ if (pp->coderecv != pp->codeproc) {
+ /* have some samples, everything OK */
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ } else if (NULL == up->shm) { /* is this possible at all? */
+ /* we're out of business without SHM access */
+ refclock_report(peer, CEVNT_FAULT);
+ } else if (major_error == up->clash) {
+ /* too many collisions is like a bad signal */
+ refclock_report(peer, CEVNT_PROP);
+ } else if (major_error == up->bad) {
+ /* too much stale/bad/garbled data */
+ refclock_report(peer, CEVNT_BADREPLY);
+ } else {
+ /* in any other case assume it's just a timeout */
+ refclock_report(peer, CEVNT_TIMEOUT);
+ }
+ /* shm_clockstats() clears the tallies, so it must be last... */
+ shm_clockstats(unit, peer);
+}
+
+/*
+ * shm_peek - try to grab a sample
+ */
+static void
+shm_peek(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct shmunit *up;
+
+ /* access order is important for lock-free SHM access; we
+ ** enforce order by treating the whole structure volatile.
+ **
+ ** IMPORTANT NOTE: This does not protect from reordering on CPU
+ ** level, and it does nothing for cache consistency and
+ ** visibility of changes by other cores. We need atomic and/or
+ ** fence instructions for that.
+ */
+ volatile struct shmTime *shm;
+
+ struct timespec tvr;
+ struct timespec tvt;
+ l_fp tsrcv;
+ l_fp tsref;
+ unsigned int c;
+ unsigned int cns_new, rns_new;
+ int cnt;
+
+ /* for formatting 'a_lastcode': */
+ struct calendar cd;
+ time_t tt, now;
+ vint64 ts;
+
+ /*
+ * This is the main routine. It snatches the time from the shm
+ * board and tacks on a local timestamp.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ up->ticks++;
+ if (up->shm == 0) {
+ /* try to map again - this may succeed if meanwhile some-
+ body has ipcrm'ed the old (unaccessible) shared mem segment */
+ up->shm = getShmTime(unit);
+ }
+ shm = up->shm;
+ if (shm == 0) {
+ DPRINTF(1, ("%s: no SHM segment\n",
+ refnumtoa(&peer->srcadr)));
+ return;
+ }
+ if ( ! shm->valid) {
+ DPRINTF(1, ("%s: SHM not ready\n",
+ refnumtoa(&peer->srcadr)));
+ up->notready++;
+ return;
+ }
+
+ switch (shm->mode) {
+ case 0:
+ tvr.tv_sec = shm->receiveTimeStampSec;
+ tvr.tv_nsec = shm->receiveTimeStampUSec * 1000;
+ rns_new = shm->receiveTimeStampNSec;
+ tvt.tv_sec = shm->clockTimeStampSec;
+ tvt.tv_nsec = shm->clockTimeStampUSec * 1000;
+ cns_new = shm->clockTimeStampNSec;
+
+ /* Since the following comparisons are between unsigned
+ ** variables they are always well defined, and any
+ ** (signed) underflow will turn into very large unsigned
+ ** values, well above the 1000 cutoff.
+ **
+ ** Note: The usecs *must* be a *truncated*
+ ** representation of the nsecs. This code will fail for
+ ** *rounded* usecs, and the logic to deal with
+ ** wrap-arounds in the presence of rounded values is
+ ** much more convoluted.
+ */
+ if ( ((cns_new - (unsigned)tvt.tv_nsec) < 1000)
+ && ((rns_new - (unsigned)tvr.tv_nsec) < 1000)) {
+ tvt.tv_nsec = cns_new;
+ tvr.tv_nsec = rns_new;
+ }
+ /* At this point tvr and tvt contains valid ns-level
+ ** timestamps, possibly generated by extending the old
+ ** us-level timestamps
+ */
+ DPRINTF(2, ("%s: SHM type 0 sample\n",
+ refnumtoa(&peer->srcadr)));
+ break;
+
+ case 1:
+ cnt = shm->count;
+
+ tvr.tv_sec = shm->receiveTimeStampSec;
+ tvr.tv_nsec = shm->receiveTimeStampUSec * 1000;
+ rns_new = shm->receiveTimeStampNSec;
+ tvt.tv_sec = shm->clockTimeStampSec;
+ tvt.tv_nsec = shm->clockTimeStampUSec * 1000;
+ cns_new = shm->clockTimeStampNSec;
+ if (cnt != shm->count) {
+ DPRINTF(1, ("%s: type 1 access clash\n",
+ refnumtoa(&peer->srcadr)));
+ msyslog (LOG_NOTICE, "SHM: access clash in shared memory");
+ up->clash++;
+ return;
+ }
+
+ /* See the case above for an explanation of the
+ ** following test.
+ */
+ if ( ((cns_new - (unsigned)tvt.tv_nsec) < 1000)
+ && ((rns_new - (unsigned)tvr.tv_nsec) < 1000)) {
+ tvt.tv_nsec = cns_new;
+ tvr.tv_nsec = rns_new;
+ }
+ /* At this point tvr and tvt contains valid ns-level
+ ** timestamps, possibly generated by extending the old
+ ** us-level timestamps
+ */
+ DPRINTF(2, ("%s: SHM type 1 sample\n",
+ refnumtoa(&peer->srcadr)));
+ break;
+
+ default:
+ DPRINTF(1, ("%s: SHM type blooper, mode=%d\n",
+ refnumtoa(&peer->srcadr), shm->mode));
+ up->bad++;
+ msyslog (LOG_ERR, "SHM: bad mode found in shared memory: %d",
+ shm->mode);
+ return;
+ }
+ shm->valid = 0;
+
+ /* format the last time code in human-readable form into
+ * 'pp->a_lastcode'. Someone claimed: "NetBSD has incompatible
+ * tv_sec". I can't find a base for this claim, but we can work
+ * around that potential problem. BTW, simply casting a pointer
+ * is a receipe for disaster on some architectures.
+ */
+ tt = (time_t)tvt.tv_sec;
+ ts = time_to_vint64(&tt);
+ ntpcal_time_to_date(&cd, &ts);
+
+ /* add ntpq -c cv timecode in ISO 8601 format */
+ c = snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%04u-%02u-%02uT%02u:%02u:%02u.%09ldZ",
+ cd.year, cd.month, cd.monthday,
+ cd.hour, cd.minute, cd.second,
+ (long)tvt.tv_nsec);
+ pp->lencode = (c < sizeof(pp->a_lastcode)) ? c : 0;
+
+ /* check 1: age control of local time stamp */
+ time(&now);
+ tt = now - tvr.tv_sec;
+ if (tt < 0 || tt > up->max_delay) {
+ DPRINTF(1, ("%s:SHM stale/bad receive time, delay=%llds\n",
+ refnumtoa(&peer->srcadr), (long long)tt));
+ up->bad++;
+ msyslog (LOG_ERR, "SHM: stale/bad receive time, delay=%llds",
+ (long long)tt);
+ return;
+ }
+
+ /* check 2: delta check */
+ tt = tvr.tv_sec - tvt.tv_sec - (tvr.tv_nsec < tvt.tv_nsec);
+ if (tt < 0)
+ tt = -tt;
+ if (up->max_delta > 0 && tt > up->max_delta) {
+ DPRINTF(1, ("%s: SHM diff limit exceeded, delta=%llds\n",
+ refnumtoa(&peer->srcadr), (long long)tt));
+ up->bad++;
+ msyslog (LOG_ERR, "SHM: difference limit exceeded, delta=%llds\n",
+ (long long)tt);
+ return;
+ }
+
+ /* if we really made it to this point... we're winners! */
+ DPRINTF(2, ("%s: SHM feeding data\n",
+ refnumtoa(&peer->srcadr)));
+ tsrcv = tspec_stamp_to_lfp(tvr);
+ tsref = tspec_stamp_to_lfp(tvt);
+ pp->leap = shm->leap;
+ peer->precision = shm->precision;
+ refclock_process_offset(pp, tsref, tsrcv, pp->fudgetime1);
+ up->good++;
+}
+
+/*
+ * shm_clockstats - dump and reset counters
+ */
+static void shm_clockstats(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct shmunit *up;
+ char logbuf[64];
+ unsigned int llen;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (pp->sloppyclockflag & CLK_FLAG4) {
+ /* if snprintf() returns a negative values on errors
+ ** (some older ones do) make sure we are NUL
+ ** terminated. Using an unsigned result does the trick.
+ */
+ llen = snprintf(logbuf, sizeof(logbuf),
+ "%3d %3d %3d %3d %3d",
+ up->ticks, up->good, up->notready,
+ up->bad, up->clash);
+ logbuf[min(llen, sizeof(logbuf)-1)] = '\0';
+ record_clock_stats(&peer->srcadr, logbuf);
+ }
+ up->ticks = up->good = up->notready = up->bad = up->clash = 0;
+
+}
+
+#else
+NONEMPTY_TRANSLATION_UNIT
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_tpro.c b/ntpd/refclock_tpro.c
new file mode 100644
index 0000000..ac511bb
--- /dev/null
+++ b/ntpd/refclock_tpro.c
@@ -0,0 +1,208 @@
+/*
+ * refclock_tpro - clock driver for the KSI/Odetics TPRO-S IRIG-B reader
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_TPRO)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "sys/tpro.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+/*
+ * This driver supports the KSI/Odetecs TPRO-S IRIG-B reader and TPRO-
+ * SAT GPS receiver for the Sun Microsystems SBus. It requires that the
+ * tpro.o device driver be installed and loaded.
+ */
+
+/*
+ * TPRO interface definitions
+ */
+#define DEVICE "/dev/tpro%d" /* device name and unit */
+#define PRECISION (-20) /* precision assumed (1 us) */
+#define REFID "IRIG" /* reference ID */
+#define DESCRIPTION "KSI/Odetics TPRO/S IRIG Interface" /* WRU */
+
+/*
+ * Unit control structure
+ */
+struct tprounit {
+ struct tproval tprodata; /* data returned from tpro read */
+};
+
+/*
+ * Function prototypes
+ */
+static int tpro_start (int, struct peer *);
+static void tpro_shutdown (int, struct peer *);
+static void tpro_poll (int unit, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_tpro = {
+ tpro_start, /* start up driver */
+ tpro_shutdown, /* shut down driver */
+ tpro_poll, /* transmit poll message */
+ noentry, /* not used (old tpro_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old tpro_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * tpro_start - open the TPRO device and initialize data for processing
+ */
+static int
+tpro_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct tprounit *up;
+ struct refclockproc *pp;
+ char device[20];
+ int fd;
+
+ /*
+ * Open TPRO device
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = open(device, O_RDONLY | O_NDELAY, 0777);
+ if (fd == -1) {
+ msyslog(LOG_ERR, "tpro_start: open of %s: %m", device);
+ return (0);
+ }
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous peer variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ return (1);
+}
+
+
+/*
+ * tpro_shutdown - shut down the clock
+ */
+static void
+tpro_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct tprounit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * tpro_poll - called by the transmit procedure
+ */
+static void
+tpro_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct tprounit *up;
+ struct refclockproc *pp;
+ struct tproval *tp;
+
+ /*
+ * This is the main routine. It snatches the time from the TPRO
+ * board and tacks on a local timestamp.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ tp = &up->tprodata;
+ if (read(pp->io.fd, (char *)tp, sizeof(struct tproval)) < 0) {
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+ get_systime(&pp->lastrec);
+ pp->polls++;
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has invalid length or is not in
+ * proper format, we declare bad format and exit. Note: we
+ * can't use the sec/usec conversion produced by the driver,
+ * since the year may be suspect. All format error checking is
+ * done by the snprintf() and sscanf() routines.
+ *
+ * Note that the refclockproc usec member has now become nsec.
+ * We could either multiply the read-in usec value by 1000 or
+ * we could pad the written string appropriately and read the
+ * resulting value in already scaled.
+ */
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
+ tp->day100, tp->day10, tp->day1, tp->hour10, tp->hour1,
+ tp->min10, tp->min1, tp->sec10, tp->sec1, tp->ms100,
+ tp->ms10, tp->ms1, tp->usec100, tp->usec10, tp->usec1,
+ tp->status);
+ pp->lencode = strlen(pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("tpro: time %s timecode %d %s\n",
+ ulfptoa(&pp->lastrec, 6), pp->lencode,
+ pp->a_lastcode);
+#endif
+ if (sscanf(pp->a_lastcode, "%3d %2d:%2d:%2d.%6ld", &pp->day,
+ &pp->hour, &pp->minute, &pp->second, &pp->nsec)
+ != 5) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ pp->nsec *= 1000; /* Convert usec to nsec */
+ if (!tp->status & 0x3)
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ refclock_receive(peer);
+}
+
+#else
+int refclock_tpro_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_true.c b/ntpd/refclock_true.c
new file mode 100644
index 0000000..36ade81
--- /dev/null
+++ b/ntpd/refclock_true.c
@@ -0,0 +1,986 @@
+/*
+ * refclock_true - clock driver for the Kinemetrics/TrueTime receivers
+ * Receiver Version 3.0C - tested plain, with CLKLDISC
+ * Development work being done:
+ * - Support TL-3 WWV TOD receiver
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_TRUETIME)
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+
+#ifdef SYS_WINNT
+extern int async_write(int, const void *, unsigned int);
+#undef write
+#define write(fd, data, octets) async_write(fd, data, octets)
+#endif
+
+/* This should be an atom clock but those are very hard to build.
+ *
+ * The PCL720 from P C Labs has an Intel 8253 lookalike, as well as a bunch
+ * of TTL input and output pins, all brought out to the back panel. If you
+ * wire a PPS signal (such as the TTL PPS coming out of a GOES or other
+ * Kinemetrics/Truetime clock) to the 8253's GATE0, and then also wire the
+ * 8253's OUT0 to the PCL720's INPUT3.BIT0, then we can read CTR0 to get the
+ * number of uSecs since the last PPS upward swing, mediated by reading OUT0
+ * to find out if the counter has wrapped around (this happens if more than
+ * 65535us (65ms) elapses between the PPS event and our being called.)
+ */
+#ifdef CLOCK_PPS720
+# undef min /* XXX */
+# undef max /* XXX */
+# include <machine/inline.h>
+# include <sys/pcl720.h>
+# include <sys/i8253.h>
+# define PCL720_IOB 0x2a0 /* XXX */
+# define PCL720_CTR 0 /* XXX */
+#endif
+
+/*
+ * Support for Kinemetrics Truetime Receivers
+ * GOES: (468-DC, usable with GPS->GOES converting antenna)
+ * GPS/TM-TMD:
+ * XL-DC: (a 151-602-210, reported by the driver as a GPS/TM-TMD)
+ * GPS-800 TCU: (an 805-957 with the RS232 Talker/Listener module)
+ * TL-3: 3 channel WWV/H receiver w/ IRIG and RS-232 outputs
+ * OM-DC: getting stale ("OMEGA")
+ *
+ * Most of this code is originally from refclock_wwvb.c with thanks.
+ * It has been so mangled that wwvb is not a recognizable ancestor.
+ *
+ * Timcode format: ADDD:HH:MM:SSQCL
+ * A - control A (this is stripped before we see it)
+ * Q - Quality indication (see below)
+ * C - Carriage return
+ * L - Line feed
+ *
+ * Quality codes indicate possible error of
+ * 468-DC GOES Receiver:
+ * GPS-TM/TMD Receiver: (default quality codes for XL-DC)
+ * ? +/- 1 milliseconds # +/- 100 microseconds
+ * * +/- 10 microseconds . +/- 1 microsecond
+ * space less than 1 microsecond
+ * TL-3 Receiver: (default quality codes for TL-3)
+ * ? unknown quality (receiver is unlocked)
+ * space +/- 5 milliseconds
+ * OM-DC OMEGA Receiver: (default quality codes for OMEGA)
+ * WARNING OMEGA navigation system is no longer existent
+ * > >+- 5 seconds
+ * ? >+/- 500 milliseconds # >+/- 50 milliseconds
+ * * >+/- 5 milliseconds . >+/- 1 millisecond
+ * A-H less than 1 millisecond. Character indicates which station
+ * is being received as follows:
+ * A = Norway, B = Liberia, C = Hawaii, D = North Dakota,
+ * E = La Reunion, F = Argentina, G = Australia, H = Japan.
+ *
+ * The carriage return start bit begins on 0 seconds and extends to 1 bit time.
+ *
+ * Notes on 468-DC and OMEGA receiver:
+ *
+ * Send the clock a 'R' or 'C' and once per second a timestamp will
+ * appear. Send a 'P' to get the satellite position once (GOES only.)
+ *
+ * Notes on the 468-DC receiver:
+ *
+ * Since the old east/west satellite locations are only historical, you can't
+ * set your clock propagation delay settings correctly and still use
+ * automatic mode. The manual says to use a compromise when setting the
+ * switches. This results in significant errors. The solution; use fudge
+ * time1 and time2 to incorporate corrections. If your clock is set for
+ * 50 and it should be 58 for using the west and 46 for using the east,
+ * use the line
+ *
+ * fudge 127.127.5.0 time1 +0.008 time2 -0.004
+ *
+ * This corrects the 4 milliseconds advance and 8 milliseconds retard
+ * needed. The software will ask the clock which satellite it sees.
+ *
+ * Notes on the TrueTime TimeLink TL-3 WWV TOD receiver:
+ *
+ * This clock may be polled, or send one timecode per second.
+ * That mode may be toggled via the front panel ("C" mode), or controlled
+ * from the RS-232 port. Send the receiver "ST1" to turn it on, and
+ * "ST0" to turn it off. Send "QV" to get the firmware revision (useful
+ * for identifying this model.)
+ *
+ * Note that it can take several polling cycles, especially if the receiver
+ * was in the continuous timecode mode. (It can be slow to leave that mode.)
+ *
+ * ntp.conf parameters:
+ * time1 - offset applied to samples when reading WEST satellite (default = 0)
+ * time2 - offset applied to samples when reading EAST satellite (default = 0)
+ * stratum - stratum to assign to this clock (default = 0)
+ * refid - refid assigned to this clock (default = "TRUE", see below)
+ * flag1 - will silence the clock side of ntpd, just reading the clock
+ * without trying to write to it. (default = 0)
+ * flag2 - generate a debug file /tmp/true%d.
+ * flag3 - enable ppsclock streams module
+ * flag4 - use the PCL-720 (BSD/OS only)
+ */
+
+
+/*
+ * Definitions
+ */
+#define DEVICE "/dev/true%d"
+#define SPEED232 B9600 /* 9600 baud */
+
+/*
+ * Radio interface parameters
+ */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define REFID "TRUE" /* reference id */
+#define DESCRIPTION "Kinemetrics/TrueTime Receiver"
+
+/*
+ * Tags which station (satellite) we see
+ */
+#define GOES_WEST 0 /* Default to WEST satellite and apply time1 */
+#define GOES_EAST 1 /* until you discover otherwise */
+
+/*
+ * used by the state machine
+ */
+enum true_event {e_Init, e_Huh, e_F18, e_F50, e_F51, e_Satellite,
+ e_TL3, e_Poll, e_Location, e_TS, e_Max};
+const char *events[] = {"Init", "Huh", "F18", "F50", "F51", "Satellite",
+ "TL3", "Poll", "Location", "TS"};
+#define eventStr(x) (((int)x<(int)e_Max) ? events[(int)x] : "?")
+
+enum true_state {s_Base, s_InqTM, s_InqTCU, s_InqOmega, s_InqGOES,
+ s_InqTL3, s_Init, s_F18, s_F50, s_Start, s_Auto, s_Max};
+const char *states[] = {"Base", "InqTM", "InqTCU", "InqOmega", "InqGOES",
+ "InqTL3", "Init", "F18", "F50", "Start", "Auto"};
+#define stateStr(x) (((int)x<(int)s_Max) ? states[(int)x] : "?")
+
+enum true_type {t_unknown, t_goes, t_tm, t_tcu, t_omega, t_tl3, t_Max};
+const char *types[] = {"unknown", "goes", "tm", "tcu", "omega", "tl3"};
+#define typeStr(x) (((int)x<(int)t_Max) ? types[(int)x] : "?")
+
+/*
+ * unit control structure
+ */
+struct true_unit {
+ unsigned int pollcnt; /* poll message counter */
+ unsigned int station; /* which station we are on */
+ unsigned int polled; /* Hand in a time sample? */
+ enum true_state state; /* state machine */
+ enum true_type type; /* what kind of clock is it? */
+ int unit; /* save an extra copy of this */
+ FILE *debug; /* debug logging file */
+#ifdef CLOCK_PPS720
+ int pcl720init; /* init flag for PCL 720 */
+#endif
+};
+
+/*
+ * Function prototypes
+ */
+static int true_start (int, struct peer *);
+static void true_shutdown (int, struct peer *);
+static void true_receive (struct recvbuf *);
+static void true_poll (int, struct peer *);
+static void true_send (struct peer *, const char *);
+static void true_doevent (struct peer *, enum true_event);
+
+#ifdef CLOCK_PPS720
+static u_long true_sample720 (void);
+#endif
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_true = {
+ true_start, /* start up driver */
+ true_shutdown, /* shut down driver */
+ true_poll, /* transmit poll message */
+ noentry, /* not used (old true_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old true_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+#if !defined(__STDC__)
+# define true_debug (void)
+#else
+static void
+true_debug(struct peer *peer, const char *fmt, ...)
+{
+ va_list ap;
+ int want_debugging, now_debugging;
+ struct refclockproc *pp;
+ struct true_unit *up;
+
+ va_start(ap, fmt);
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ want_debugging = (pp->sloppyclockflag & CLK_FLAG2) != 0;
+ now_debugging = (up->debug != NULL);
+ if (want_debugging != now_debugging)
+ {
+ if (want_debugging) {
+ char filename[40];
+ int fd;
+
+ snprintf(filename, sizeof(filename),
+ "/tmp/true%d.debug", up->unit);
+ fd = open(filename, O_CREAT | O_WRONLY | O_EXCL,
+ 0600);
+ if (fd >= 0 && (up->debug = fdopen(fd, "r+"))) {
+#ifdef HAVE_SETVBUF
+ static char buf[BUFSIZ];
+
+ setvbuf(up->debug, buf, _IOLBF, BUFSIZ);
+#else
+ setlinebuf(up->debug);
+#endif
+ }
+ } else {
+ fclose(up->debug);
+ up->debug = NULL;
+ }
+ }
+
+ if (up->debug) {
+ fprintf(up->debug, "true%d: ", up->unit);
+ vfprintf(up->debug, fmt, ap);
+ }
+ va_end(ap);
+}
+#endif /*STDC*/
+
+/*
+ * true_start - open the devices and initialize data for processing
+ */
+static int
+true_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct true_unit *up;
+ struct refclockproc *pp;
+ char device[40];
+ int fd;
+
+ /*
+ * Open serial port
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_CLK);
+ if (fd <= 0)
+ return 0;
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = true_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, REFID, 4);
+ up->pollcnt = 2;
+ up->type = t_unknown;
+ up->state = s_Base;
+
+ /*
+ * Send a CTRL-C character at the start,
+ * just in case the clock is already
+ * sending timecodes
+ */
+ true_send(peer, "\03\r");
+
+ true_doevent(peer, e_Init);
+
+ return (1);
+}
+
+
+/*
+ * true_shutdown - shut down the clock
+ */
+static void
+true_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct true_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (pp->io.fd != -1)
+ io_closeclock(&pp->io);
+ if (up != NULL)
+ free(up);
+}
+
+
+/*
+ * true_receive - receive data from the serial interface on a clock
+ */
+static void
+true_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct true_unit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ u_short new_station;
+ char synced;
+ int i;
+ int lat, lon, off; /* GOES Satellite position */
+ /* These variables hold data until we decide to keep it */
+ char rd_lastcode[BMAX];
+ l_fp rd_tmp;
+ u_short rd_lencode;
+
+ /*
+ * Get the clock this applies to and pointers to the data.
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Read clock output. Automatically handles STREAMS, CLKLDISC.
+ */
+ rd_lencode = refclock_gtlin(rbufp, rd_lastcode, BMAX, &rd_tmp);
+ rd_lastcode[rd_lencode] = '\0';
+
+ /*
+ * There is a case where <cr><lf> generates 2 timestamps.
+ */
+ if (rd_lencode == 0)
+ return;
+ pp->lencode = rd_lencode;
+ strlcpy(pp->a_lastcode, rd_lastcode, sizeof(pp->a_lastcode));
+ pp->lastrec = rd_tmp;
+ true_debug(peer, "receive(%s) [%d]\n", pp->a_lastcode,
+ pp->lencode);
+
+ up->pollcnt = 2;
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. This code decodes a multitude of different
+ * clock messages. Timecodes are processed if needed. All replies
+ * will be run through the state machine to tweak driver options
+ * and program the clock.
+ */
+
+ /*
+ * Clock misunderstood our last command?
+ */
+ if (pp->a_lastcode[0] == '?' ||
+ strcmp(pp->a_lastcode, "ERROR 05 NO SUCH FUNCTION") == 0) {
+ true_doevent(peer, e_Huh);
+ return;
+ }
+
+ /*
+ * Timecode: "nnnnn+nnn-nnn"
+ * (from GOES clock when asked about satellite position)
+ */
+ if ((pp->a_lastcode[5] == '+' || pp->a_lastcode[5] == '-') &&
+ (pp->a_lastcode[9] == '+' || pp->a_lastcode[9] == '-') &&
+ sscanf(pp->a_lastcode, "%5d%*c%3d%*c%3d", &lon, &lat, &off) == 3
+ ) {
+ const char *label = "Botch!";
+
+ /*
+ * This is less than perfect. Call the (satellite)
+ * either EAST or WEST and adjust slop accodingly
+ * Perfectionists would recalculate the exact delay
+ * and adjust accordingly...
+ */
+ if (lon > 7000 && lon < 14000) {
+ if (lon < 10000) {
+ new_station = GOES_EAST;
+ label = "EAST";
+ } else {
+ new_station = GOES_WEST;
+ label = "WEST";
+ }
+
+ if (new_station != up->station) {
+ double dtemp;
+
+ dtemp = pp->fudgetime1;
+ pp->fudgetime1 = pp->fudgetime2;
+ pp->fudgetime2 = dtemp;
+ up->station = new_station;
+ }
+ }
+ else {
+ /*refclock_report(peer, CEVNT_BADREPLY);*/
+ label = "UNKNOWN";
+ }
+ true_debug(peer, "GOES: station %s\n", label);
+ true_doevent(peer, e_Satellite);
+ return;
+ }
+
+ /*
+ * Timecode: "Fnn"
+ * (from TM/TMD clock when it wants to tell us what it's up to.)
+ */
+ if (sscanf(pp->a_lastcode, "F%2d", &i) == 1 && i > 0 && i < 80) {
+ switch (i) {
+ case 50:
+ true_doevent(peer, e_F50);
+ break;
+ case 51:
+ true_doevent(peer, e_F51);
+ break;
+ default:
+ true_debug(peer, "got F%02d - ignoring\n", i);
+ break;
+ }
+ return;
+ }
+
+ /*
+ * Timecode: "VER xx.xx"
+ * (from a TL3 when sent "QV", so id's it during initialization.)
+ */
+ if (pp->a_lastcode[0] == 'V' && pp->a_lastcode[1] == 'E' &&
+ pp->a_lastcode[2] == 'R' && pp->a_lastcode[6] == '.') {
+ true_doevent(peer, e_TL3);
+ NLOG(NLOG_CLOCKSTATUS) {
+ msyslog(LOG_INFO, "TL3: %s", pp->a_lastcode);
+ }
+ return;
+ }
+
+ /*
+ * Timecode: " TRUETIME Mk III" or " TRUETIME XL"
+ * (from a TM/TMD/XL clock during initialization.)
+ */
+ if (strncmp(pp->a_lastcode, " TRUETIME Mk III ", 17) == 0 ||
+ strncmp(pp->a_lastcode, " TRUETIME XL", 12) == 0) {
+ true_doevent(peer, e_F18);
+ NLOG(NLOG_CLOCKSTATUS) {
+ msyslog(LOG_INFO, "TM/TMD/XL: %s", pp->a_lastcode);
+ }
+ return;
+ }
+
+ /*
+ * Timecode: "N03726428W12209421+000033"
+ * 1 2
+ * index 0123456789012345678901234
+ * (from a TCU during initialization)
+ */
+ if ((pp->a_lastcode[0] == 'N' || pp->a_lastcode[0] == 'S') &&
+ (pp->a_lastcode[9] == 'W' || pp->a_lastcode[9] == 'E') &&
+ pp->a_lastcode[18] == '+') {
+ true_doevent(peer, e_Location);
+ NLOG(NLOG_CLOCKSTATUS) {
+ msyslog(LOG_INFO, "TCU-800: %s", pp->a_lastcode);
+ }
+ return;
+ }
+ /*
+ * Timecode: "ddd:hh:mm:ssQ"
+ * 1 2
+ * index 0123456789012345678901234
+ * (from all clocks supported by this driver.)
+ */
+ if (pp->a_lastcode[3] == ':' &&
+ pp->a_lastcode[6] == ':' &&
+ pp->a_lastcode[9] == ':' &&
+ sscanf(pp->a_lastcode, "%3d:%2d:%2d:%2d%c",
+ &pp->day, &pp->hour, &pp->minute,
+ &pp->second, &synced) == 5) {
+
+ /*
+ * Adjust the synchronize indicator according to timecode
+ * say were OK, and then say not if we really are not OK
+ */
+ if (synced == '>' || synced == '#' || synced == '?'
+ || synced == 'X')
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+
+ true_doevent(peer, e_TS);
+
+#ifdef CLOCK_PPS720
+ /* If it's taken more than 65ms to get here, we'll lose. */
+ if ((pp->sloppyclockflag & CLK_FLAG4) && up->pcl720init) {
+ l_fp off;
+
+#ifdef CLOCK_ATOM
+ /*
+ * find out what time it really is. Include
+ * the count from the PCL720
+ */
+ if (!clocktime(pp->day, pp->hour, pp->minute,
+ pp->second, GMT, pp->lastrec.l_ui,
+ &pp->yearstart, &off.l_ui)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ off.l_uf = 0;
+#endif
+
+ pp->usec = true_sample720();
+#ifdef CLOCK_ATOM
+ TVUTOTSF(pp->usec, off.l_uf);
+#endif
+
+ /*
+ * Stomp all over the timestamp that was pulled out
+ * of the input stream. It's irrelevant since we've
+ * adjusted the input time to reflect now (via pp->usec)
+ * rather than when the data was collected.
+ */
+ get_systime(&pp->lastrec);
+#ifdef CLOCK_ATOM
+ /*
+ * Create a true offset for feeding to pps_sample()
+ */
+ L_SUB(&off, &pp->lastrec);
+
+ pps_sample(peer, &off);
+#endif
+ true_debug(peer, "true_sample720: %luus\n", pp->usec);
+ }
+#endif
+
+ /*
+ * The clock will blurt a timecode every second but we only
+ * want one when polled. If we havn't been polled, bail out.
+ */
+ if (!up->polled)
+ return;
+
+ /* We only call doevent if additional things need be done
+ * at poll interval. Currently, its only for GOES. We also
+ * call it for clock unknown so that it gets logged.
+ */
+ if (up->type == t_goes || up->type == t_unknown)
+ true_doevent(peer, e_Poll);
+
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ /*
+ * If clock is good we send a NOMINAL message so that
+ * any previous BAD messages are nullified
+ */
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ refclock_report(peer, CEVNT_NOMINAL);
+
+ /*
+ * We have succedded in answering the poll.
+ * Turn off the flag and return
+ */
+ up->polled = 0;
+
+ return;
+ }
+
+ /*
+ * No match to known timecodes, report failure and return
+ */
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+}
+
+
+/*
+ * true_send - time to send the clock a signal to cough up a time sample
+ */
+static void
+true_send(
+ struct peer *peer,
+ const char *cmd
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ if (!(pp->sloppyclockflag & CLK_FLAG1)) {
+ int len = strlen(cmd);
+
+ true_debug(peer, "Send '%s'\n", cmd);
+ if (write(pp->io.fd, cmd, (unsigned)len) != len)
+ refclock_report(peer, CEVNT_FAULT);
+ else
+ pp->polls++;
+ }
+}
+
+
+/*
+ * state machine for initializing and controlling a clock
+ */
+static void
+true_doevent(
+ struct peer *peer,
+ enum true_event event
+ )
+{
+ struct true_unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (event != e_TS) {
+ NLOG(NLOG_CLOCKSTATUS) {
+ msyslog(LOG_INFO, "TRUE: clock %s, state %s, event %s",
+ typeStr(up->type),
+ stateStr(up->state),
+ eventStr(event));
+ }
+ }
+ true_debug(peer, "clock %s, state %s, event %s\n",
+ typeStr(up->type), stateStr(up->state), eventStr(event));
+ switch (up->type) {
+ case t_goes:
+ switch (event) {
+ case e_Init: /* FALLTHROUGH */
+ case e_Satellite:
+ /*
+ * Switch back to on-second time codes and return.
+ */
+ true_send(peer, "C");
+ up->state = s_Start;
+ break;
+ case e_Poll:
+ /*
+ * After each poll, check the station (satellite).
+ */
+ true_send(peer, "P");
+ /* No state change needed. */
+ break;
+ default:
+ break;
+ }
+ /* FALLTHROUGH */
+ case t_omega:
+ switch (event) {
+ case e_Init:
+ true_send(peer, "C");
+ up->state = s_Start;
+ break;
+ case e_TS:
+ if (up->state != s_Start && up->state != s_Auto) {
+ true_send(peer, "\03\r");
+ break;
+ }
+ up->state = s_Auto;
+ break;
+ default:
+ break;
+ }
+ break;
+ case t_tm:
+ switch (event) {
+ case e_Init:
+ true_send(peer, "F18\r");
+ up->state = s_Init;
+ break;
+ case e_F18:
+ true_send(peer, "F50\r");
+ /*
+ * Timecode: " TRUETIME Mk III" or " TRUETIME XL"
+ * (from a TM/TMD/XL clock during initialization.)
+ */
+ if ( strcmp(pp->a_lastcode, " TRUETIME Mk III") == 0 ||
+ strncmp(pp->a_lastcode, " TRUETIME XL", 12) == 0) {
+ true_doevent(peer, e_F18);
+ NLOG(NLOG_CLOCKSTATUS) {
+ msyslog(LOG_INFO, "TM/TMD/XL: %s",
+ pp->a_lastcode);
+ }
+ return;
+ }
+ up->state = s_F18;
+ break;
+ case e_F50:
+ true_send(peer, "F51\r");
+ up->state = s_F50;
+ break;
+ case e_F51:
+ true_send(peer, "F08\r");
+ up->state = s_Start;
+ break;
+ case e_TS:
+ if (up->state != s_Start && up->state != s_Auto) {
+ true_send(peer, "\03\r");
+ break;
+ }
+ up->state = s_Auto;
+ break;
+ default:
+ break;
+ }
+ break;
+ case t_tcu:
+ switch (event) {
+ case e_Init:
+ true_send(peer, "MD3\r"); /* GPS Synch'd Gen. */
+ true_send(peer, "TSU\r"); /* UTC, not GPS. */
+ true_send(peer, "AU\r"); /* Auto Timestamps. */
+ up->state = s_Start;
+ break;
+ case e_TS:
+ if (up->state != s_Start && up->state != s_Auto) {
+ true_send(peer, "\03\r");
+ break;
+ }
+ up->state = s_Auto;
+ break;
+ default:
+ break;
+ }
+ break;
+ case t_tl3:
+ switch (event) {
+ case e_Init:
+ true_send(peer, "ST1"); /* Turn on continuous stream */
+ break;
+ case e_TS:
+ up->state = s_Auto;
+ break;
+ default:
+ break;
+ }
+ break;
+ case t_unknown:
+ if (event == e_Poll)
+ break;
+ switch (up->state) {
+ case s_Base:
+ if (event != e_Init)
+ abort();
+ true_send(peer, "P\r");
+ up->state = s_InqGOES;
+ break;
+ case s_InqGOES:
+ switch (event) {
+ case e_Satellite:
+ up->type = t_goes;
+ true_doevent(peer, e_Init);
+ break;
+ case e_Init: /*FALLTHROUGH*/
+ case e_Huh:
+ case e_TS:
+ true_send(peer, "ST0"); /* turn off TL3 auto */
+ sleep(1); /* wait for it */
+ up->state = s_InqTL3;
+ true_send(peer, "QV"); /* see if its a TL3 */
+ break;
+ default:
+ abort();
+ }
+ break;
+ case s_InqTL3:
+ switch (event) {
+ case e_TL3:
+ up->type = t_tl3;
+ up->state = s_Auto; /* Inq side-effect. */
+ true_send(peer, "ST1"); /* Turn on 1/sec data */
+ break;
+ case e_Init: /*FALLTHROUGH*/
+ case e_Huh:
+ up->state = s_InqOmega;
+ true_send(peer, "C\r");
+ break;
+ case e_TS:
+ up->type = t_tl3; /* Already sending data */
+ up->state = s_Auto;
+ break;
+ default:
+ msyslog(LOG_INFO,
+ "TRUE: TL3 init fellthrough! (%d)", event);
+ break;
+ }
+ break;
+ case s_InqOmega:
+ switch (event) {
+ case e_TS:
+ up->type = t_omega;
+ up->state = s_Auto; /* Inq side-effect. */
+ break;
+ case e_Init: /*FALLTHROUGH*/
+ case e_Huh:
+ up->state = s_InqTM;
+ true_send(peer, "F18\r");
+ break;
+ default:
+ abort();
+ }
+ break;
+ case s_InqTM:
+ switch (event) {
+ case e_F18:
+ up->type = t_tm;
+ true_doevent(peer, e_Init);
+ break;
+ case e_Init: /*FALLTHROUGH*/
+ case e_Huh:
+ true_send(peer, "PO\r");
+ up->state = s_InqTCU;
+ break;
+ default:
+ msyslog(LOG_INFO,
+ "TRUE: TM/TMD init fellthrough!");
+ break;
+ }
+ break;
+ case s_InqTCU:
+ switch (event) {
+ case e_Location:
+ up->type = t_tcu;
+ true_doevent(peer, e_Init);
+ break;
+ case e_Init: /*FALLTHROUGH*/
+ case e_Huh:
+ up->state = s_Base;
+ sleep(1); /* XXX */
+ break;
+ default:
+ msyslog(LOG_INFO,
+ "TRUE: TCU init fellthrough!");
+ break;
+ }
+ break;
+ /*
+ * An expedient hack to prevent lint complaints,
+ * these don't actually need to be used here...
+ */
+ case s_Init:
+ case s_F18:
+ case s_F50:
+ case s_Start:
+ case s_Auto:
+ case s_Max:
+ msyslog(LOG_INFO, "TRUE: state %s is unexpected!",
+ stateStr(up->state));
+ }
+ break;
+ default:
+ msyslog(LOG_INFO, "TRUE: cannot identify refclock!");
+ abort();
+ /* NOTREACHED */
+ }
+
+#ifdef CLOCK_PPS720
+ if ((pp->sloppyclockflag & CLK_FLAG4) && !up->pcl720init) {
+ /* Make counter trigger on gate0, count down from 65535. */
+ pcl720_load(PCL720_IOB, PCL720_CTR, i8253_oneshot, 65535);
+ /*
+ * (These constants are OK since
+ * they represent hardware maximums.)
+ */
+ NLOG(NLOG_CLOCKINFO) {
+ msyslog(LOG_NOTICE, "PCL-720 initialized");
+ }
+ up->pcl720init++;
+ }
+#endif
+
+
+}
+
+/*
+ * true_poll - called by the transmit procedure
+ */
+static void
+true_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct true_unit *up;
+ struct refclockproc *pp;
+
+ /*
+ * You don't need to poll this clock. It puts out timecodes
+ * once per second. If asked for a timestamp, take note.
+ * The next time a timecode comes in, it will be fed back.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->pollcnt > 0) {
+ up->pollcnt--;
+ } else {
+ true_doevent(peer, e_Init);
+ refclock_report(peer, CEVNT_TIMEOUT);
+ }
+
+ /*
+ * polled every 64 seconds. Ask true_receive to hand in a
+ * timestamp.
+ */
+ up->polled = 1;
+ pp->polls++;
+}
+
+#ifdef CLOCK_PPS720
+/*
+ * true_sample720 - sample the PCL-720
+ */
+static u_long
+true_sample720(void)
+{
+ unsigned long f;
+
+ /* We wire the PCL-720's 8253.OUT0 to bit 0 of connector 3.
+ * If it is not being held low now, we did not get called
+ * within 65535us.
+ */
+ if (inb(pcl720_data_16_23(PCL720_IOB)) & 0x01) {
+ NLOG(NLOG_CLOCKINFO) {
+ msyslog(LOG_NOTICE, "PCL-720 out of synch");
+ }
+ return (0);
+ }
+ f = (65536 - pcl720_read(PCL720_IOB, PCL720_CTR));
+#ifdef PPS720_DEBUG
+ msyslog(LOG_DEBUG, "PCL-720: %luus", f);
+#endif
+ return (f);
+}
+#endif
+
+#else
+int refclock_true_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_tsyncpci.c b/ntpd/refclock_tsyncpci.c
new file mode 100644
index 0000000..e70a7cf
--- /dev/null
+++ b/ntpd/refclock_tsyncpci.c
@@ -0,0 +1,912 @@
+/*******************************************************************************
+*
+* Module : refclock_tsyncpci.c
+* Date : 09/08/08
+* Purpose : Implements a reference clock driver for the NTP daemon. This
+* reference clock driver provides a means to communicate with
+* the Spectracom TSYNC PCI timing devices and use them as a time
+* source.
+*
+* (C) Copyright 2008 Spectracom Corporation
+*
+* This software is provided by Spectracom Corporation '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 Spectracom Corporation 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.
+*
+* This software is released for distribution according to the NTP copyright
+* and license contained in html/copyright.html of NTP source.
+*
+*******************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_TSYNCPCI)
+
+#include <asm/ioctl.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <netinet/in.h>
+
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+
+
+/*******************************************************************************
+**
+** This driver supports the Spectracom TSYNC PCI GPS receiver. It requires
+** that the tsyncpci.o device driver be installed and loaded.
+**
+*******************************************************************************/
+
+#define TSYNC_PCI_REVISION "1.11"
+
+/*
+** TPRO interface definitions
+*/
+#define DEVICE "/dev/tsyncpci" /* device name */
+#define PRECISION (-20) /* precision assumed (1 us) */
+#define DESCRIPTION "Spectracom TSYNC-PCI" /* WRU */
+
+#define SECONDS_1900_TO_1970 (2208988800U)
+
+#define TSYNC_REF_IID (0x2500) // SS CAI, REF IID
+#define TSYNC_REF_DEST_ID (0x0001) // KTS Firmware
+#define TSYNC_REF_IN_PYLD_OFF (0)
+#define TSYNC_REF_IN_LEN (0)
+#define TSYNC_REF_OUT_PYLD_OFF (0)
+#define TSYNC_REF_OUT_LEN (8)
+#define TSYNC_REF_MAX_OUT_LEN (16)
+#define TSYNC_REF_PYLD_LEN (TSYNC_REF_IN_LEN + \
+ TSYNC_REF_MAX_OUT_LEN)
+#define TSYNC_REF_LEN (4)
+#define TSYNC_REF_LOCAL ("LOCL")
+
+#define TSYNC_TMSCL_IID (0x2301) // CS CAI, TIMESCALE IID
+#define TSYNC_TMSCL_DEST_ID (0x0001) // KTS Firmware
+#define TSYNC_TMSCL_IN_PYLD_OFF (0)
+#define TSYNC_TMSCL_IN_LEN (0)
+#define TSYNC_TMSCL_OUT_PYLD_OFF (0)
+#define TSYNC_TMSCL_OUT_LEN (4)
+#define TSYNC_TMSCL_MAX_OUT_LEN (12)
+#define TSYNC_TMSCL_PYLD_LEN (TSYNC_TMSCL_IN_LEN + \
+ TSYNC_TMSCL_MAX_OUT_LEN)
+
+#define TSYNC_LEAP_IID (0x2307) // CS CAI, LEAP SEC IID
+#define TSYNC_LEAP_DEST_ID (0x0001) // KTS Firmware
+#define TSYNC_LEAP_IN_PYLD_OFF (0)
+#define TSYNC_LEAP_IN_LEN (0)
+#define TSYNC_LEAP_OUT_PYLD_OFF (0)
+#define TSYNC_LEAP_OUT_LEN (28)
+#define TSYNC_LEAP_MAX_OUT_LEN (36)
+#define TSYNC_LEAP_PYLD_LEN (TSYNC_LEAP_IN_LEN + \
+ TSYNC_LEAP_MAX_OUT_LEN)
+
+// These define the base date/time of the system clock. The system time will
+// be tracked as the number of seconds from this date/time.
+#define TSYNC_TIME_BASE_YEAR (1970) // earliest acceptable year
+
+#define TSYNC_LCL_STRATUM (0)
+
+/*
+** TSYNC Time Scales type
+*/
+typedef enum
+{
+ TIME_SCALE_UTC = 0, // Universal Coordinated Time
+ TIME_SCALE_TAI = 1, // International Atomic Time
+ TIME_SCALE_GPS = 2, // Global Positioning System
+ TIME_SCALE_LOCAL = 3, // UTC w/local rules for time zone and DST
+ NUM_TIME_SCALES = 4, // Number of time scales
+
+ TIME_SCALE_MAX = 15 // Maximum number of timescales
+
+} TIME_SCALE;
+
+/*
+** TSYNC Board Object
+*/
+typedef struct BoardObj {
+
+ int file_descriptor;
+ unsigned short devid;
+ unsigned short options;
+ unsigned char firmware[5];
+ unsigned char FPGA[5];
+ unsigned char driver[7];
+
+} BoardObj;
+
+/*
+** TSYNC Time Object
+*/
+typedef struct TimeObj {
+
+ unsigned char syncOption; /* -M option */
+ unsigned int secsDouble; /* seconds floating pt */
+ unsigned char seconds; /* seconds whole num */
+ unsigned char minutes;
+ unsigned char hours;
+ unsigned short days;
+ unsigned short year;
+ unsigned short flags; /* bit 2 SYNC, bit 1 TCODE; all others 0 */
+
+} TimeObj;
+
+/*
+** NTP Time Object
+*/
+typedef struct NtpTimeObj {
+
+ TimeObj timeObj;
+ struct timeval tv;
+ unsigned int refId;
+
+} NtpTimeObj;
+/*
+** TSYNC Supervisor Reference Object
+*/
+typedef struct ReferenceObj {
+
+ char time[TSYNC_REF_LEN];
+ char pps[TSYNC_REF_LEN];
+
+} ReferenceObj;
+
+/*
+** TSYNC Seconds Time Object
+*/
+typedef struct SecTimeObj
+{
+ unsigned int seconds;
+ unsigned int ns;
+}
+SecTimeObj;
+
+/*
+** TSYNC DOY Time Object
+*/
+typedef struct DoyTimeObj
+{
+ unsigned int year;
+ unsigned int doy;
+ unsigned int hour;
+ unsigned int minute;
+ unsigned int second;
+ unsigned int ns;
+}
+DoyTimeObj;
+
+/*
+** TSYNC Leap Second Object
+*/
+typedef struct LeapSecondObj
+{
+ int offset;
+ DoyTimeObj utcDate;
+}
+LeapSecondObj;
+
+/*
+ * structures for ioctl interactions with driver
+ */
+#define DI_PAYLOADS_STARTER_LENGTH 4
+typedef struct ioctl_trans_di {
+
+ // input parameters
+ uint16_t dest;
+ uint16_t iid;
+
+ uint32_t inPayloadOffset;
+ uint32_t inLength;
+ uint32_t outPayloadOffset;
+ uint32_t maxOutLength;
+
+ // output parameters
+ uint32_t actualOutLength;
+ int32_t status;
+
+ // Input and output
+
+ // The payloads field MUST be last in ioctl_trans_di.
+ uint8_t payloads[DI_PAYLOADS_STARTER_LENGTH];
+
+}ioctl_trans_di;
+
+/*
+ * structure for looking up a reference ID from a reference name
+ */
+typedef struct
+{
+ const char* pRef; // KTS Reference Name
+ const char* pRefId; // NTP Reference ID
+
+} RefIdLookup;
+
+/*
+ * unit control structure
+ */
+typedef struct {
+ uint32_t refPrefer; // Reference prefer flag
+ uint32_t refId; // Host peer reference ID
+ uint8_t refStratum; // Host peer reference stratum
+
+} TsyncUnit;
+
+/*
+** Function prototypes
+*/
+static void tsync_poll (int unit, struct peer *);
+static void tsync_shutdown (int, struct peer *);
+static int tsync_start (int, struct peer *);
+
+/*
+** Helper functions
+*/
+static void ApplyTimeOffset (DoyTimeObj* pDt, int off);
+static void SecTimeFromDoyTime (SecTimeObj* pSt, DoyTimeObj* pDt);
+static void DoyTimeFromSecTime (DoyTimeObj* pDt, SecTimeObj* pSt);
+
+/*
+** Transfer vector
+*/
+struct refclock refclock_tsyncpci = {
+ tsync_start, /* start up driver */
+ tsync_shutdown, /* shut down driver */
+ tsync_poll, /* transmit poll message */
+ noentry, /* not used (old tsync_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old tsync_buginfo) */
+ NOFLAGS /* not used */
+};
+
+/*
+ * Reference ID lookup table
+ */
+static RefIdLookup RefIdLookupTbl[] =
+{
+ {"gps", "GPS"},
+ {"ir", "IRIG"},
+ {"hvq", "HVQ"},
+ {"frq", "FREQ"},
+ {"mdm", "ACTS"},
+ {"epp", "PPS"},
+ {"ptp", "PTP"},
+ {"asc", "ATC"},
+ {"hst0", "USER"},
+ {"hst", TSYNC_REF_LOCAL},
+ {"self", TSYNC_REF_LOCAL},
+ {NULL, NULL}
+};
+
+/*******************************************************************************
+** IOCTL DEFINITIONS
+*******************************************************************************/
+#define IOCTL_TPRO_ID 't'
+#define IOCTL_TPRO_OPEN _IOWR(IOCTL_TPRO_ID, 0, BoardObj)
+#define IOCTL_TPRO_GET_NTP_TIME _IOWR(IOCTL_TPRO_ID, 25, NtpTimeObj)
+#define IOCTL_TSYNC_GET _IOWR(IOCTL_TPRO_ID, 26, ioctl_trans_di)
+
+/******************************************************************************
+ *
+ * Function: tsync_start()
+ * Description: Used to intialize the Spectracom TSYNC reference driver.
+ *
+ * Parameters:
+ * IN: unit - not used.
+ * *peer - pointer to this reference clock's peer structure
+ * Returns: 0 - unsuccessful
+ * 1 - successful
+ *
+*******************************************************************************/
+static int tsync_start(int unit, struct peer *peer)
+{
+ struct refclockproc *pp;
+ TsyncUnit *up;
+
+
+ /*
+ ** initialize reference clock and peer parameters
+ */
+ pp = peer->procptr;
+ pp->clockdesc = DESCRIPTION;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ peer->precision = PRECISION;
+
+ // Allocate and initialize unit structure
+ if (!(up = (TsyncUnit*)emalloc(sizeof(TsyncUnit))))
+ {
+ return (0);
+ }
+
+ // Store reference preference
+ up->refPrefer = peer->flags & FLAG_PREFER;
+
+ // Initialize reference stratum level and ID
+ up->refStratum = STRATUM_UNSPEC;
+ strncpy((char *)&up->refId, TSYNC_REF_LOCAL, TSYNC_REF_LEN);
+
+ // Attach unit structure
+ pp->unitptr = (caddr_t)up;
+
+ /* Declare our refId as local in the beginning because we do not know
+ * what our actual refid is yet.
+ */
+ strncpy((char *)&pp->refid, TSYNC_REF_LOCAL, TSYNC_REF_LEN);
+
+ return (1);
+
+} /* End - tsync_start() */
+
+/*******************************************************************************
+**
+** Function: tsync_shutdown()
+** Description: Handles anything related to shutting down the reference clock
+** driver. Nothing at this point in time.
+**
+** Parameters:
+** IN: unit - not used.
+** *peer - pointer to this reference clock's peer structure
+** Returns: none.
+**
+*******************************************************************************/
+static void tsync_shutdown(int unit, struct peer *peer)
+{
+
+} /* End - tsync_shutdown() */
+
+/******************************************************************************
+ *
+ * Function: tsync_poll()
+ * Description: Retrieve time from the TSYNC device.
+ *
+ * Parameters:
+ * IN: unit - not used.
+ * *peer - pointer to this reference clock's peer structure
+ * Returns: none.
+ *
+*******************************************************************************/
+static void tsync_poll(int unit, struct peer *peer)
+{
+ char device[32];
+ struct refclockproc *pp;
+ struct calendar jt;
+ TsyncUnit *up;
+ unsigned char synch;
+ double seconds;
+ int err;
+ int err1;
+ int err2;
+ int err3;
+ int i;
+ int j;
+ unsigned int itAllocationLength;
+ unsigned int itAllocationLength1;
+ unsigned int itAllocationLength2;
+ NtpTimeObj TimeContext;
+ BoardObj hBoard;
+ char timeRef[TSYNC_REF_LEN + 1];
+ char ppsRef [TSYNC_REF_LEN + 1];
+ TIME_SCALE tmscl = TIME_SCALE_UTC;
+ LeapSecondObj leapSec;
+ ioctl_trans_di *it;
+ ioctl_trans_di *it1;
+ ioctl_trans_di *it2;
+ l_fp offset;
+ l_fp ltemp;
+ ReferenceObj * pRefObj;
+
+
+ /* Construct the device name */
+ sprintf(device, "%s%d", DEVICE, (int)peer->refclkunit);
+
+ printf("Polling device number %d...\n", (int)peer->refclkunit);
+
+ /* Open the TSYNC device */
+ hBoard.file_descriptor = open(device, O_RDONLY | O_NDELAY, 0777);
+
+ /* If error opening TSYNC device... */
+ if (hBoard.file_descriptor < 0)
+ {
+ msyslog(LOG_ERR, "Couldn't open device");
+ return;
+ }
+
+ /* If error while initializing the board... */
+ if (ioctl(hBoard.file_descriptor, IOCTL_TPRO_OPEN, &hBoard) < 0)
+ {
+ msyslog(LOG_ERR, "Couldn't initialize device");
+ close(hBoard.file_descriptor);
+ return;
+ }
+
+ /* Allocate memory for ioctl message */
+ itAllocationLength =
+ (sizeof(ioctl_trans_di) - DI_PAYLOADS_STARTER_LENGTH) +
+ TSYNC_REF_IN_LEN + TSYNC_REF_MAX_OUT_LEN;
+
+ it = (ioctl_trans_di*)alloca(itAllocationLength);
+ if (it == NULL) {
+ msyslog(LOG_ERR, "Couldn't allocate transaction memory - Reference");
+ return;
+ }
+
+ /* Build SS_GetRef ioctl message */
+ it->dest = TSYNC_REF_DEST_ID;
+ it->iid = TSYNC_REF_IID;
+ it->inPayloadOffset = TSYNC_REF_IN_PYLD_OFF;
+ it->inLength = TSYNC_REF_IN_LEN;
+ it->outPayloadOffset = TSYNC_REF_OUT_PYLD_OFF;
+ it->maxOutLength = TSYNC_REF_MAX_OUT_LEN;
+ it->actualOutLength = 0;
+ it->status = 0;
+ memset(it->payloads, 0, TSYNC_REF_MAX_OUT_LEN);
+
+ /* Read the reference from the TSYNC-PCI device */
+ err = ioctl(hBoard.file_descriptor,
+ IOCTL_TSYNC_GET,
+ (char *)it);
+
+ /* Allocate memory for ioctl message */
+ itAllocationLength1 =
+ (sizeof(ioctl_trans_di) - DI_PAYLOADS_STARTER_LENGTH) +
+ TSYNC_TMSCL_IN_LEN + TSYNC_TMSCL_MAX_OUT_LEN;
+
+ it1 = (ioctl_trans_di*)alloca(itAllocationLength1);
+ if (it1 == NULL) {
+ msyslog(LOG_ERR, "Couldn't allocate transaction memory - Time Scale");
+ return;
+ }
+
+ /* Build CS_GetTimeScale ioctl message */
+ it1->dest = TSYNC_TMSCL_DEST_ID;
+ it1->iid = TSYNC_TMSCL_IID;
+ it1->inPayloadOffset = TSYNC_TMSCL_IN_PYLD_OFF;
+ it1->inLength = TSYNC_TMSCL_IN_LEN;
+ it1->outPayloadOffset = TSYNC_TMSCL_OUT_PYLD_OFF;
+ it1->maxOutLength = TSYNC_TMSCL_MAX_OUT_LEN;
+ it1->actualOutLength = 0;
+ it1->status = 0;
+ memset(it1->payloads, 0, TSYNC_TMSCL_MAX_OUT_LEN);
+
+ /* Read the Time Scale info from the TSYNC-PCI device */
+ err1 = ioctl(hBoard.file_descriptor,
+ IOCTL_TSYNC_GET,
+ (char *)it1);
+
+ /* Allocate memory for ioctl message */
+ itAllocationLength2 =
+ (sizeof(ioctl_trans_di) - DI_PAYLOADS_STARTER_LENGTH) +
+ TSYNC_LEAP_IN_LEN + TSYNC_LEAP_MAX_OUT_LEN;
+
+ it2 = (ioctl_trans_di*)alloca(itAllocationLength2);
+ if (it2 == NULL) {
+ msyslog(LOG_ERR, "Couldn't allocate transaction memory - Leap Second");
+ return;
+ }
+
+ /* Build CS_GetLeapSec ioctl message */
+ it2->dest = TSYNC_LEAP_DEST_ID;
+ it2->iid = TSYNC_LEAP_IID;
+ it2->inPayloadOffset = TSYNC_LEAP_IN_PYLD_OFF;
+ it2->inLength = TSYNC_LEAP_IN_LEN;
+ it2->outPayloadOffset = TSYNC_LEAP_OUT_PYLD_OFF;
+ it2->maxOutLength = TSYNC_LEAP_MAX_OUT_LEN;
+ it2->actualOutLength = 0;
+ it2->status = 0;
+ memset(it2->payloads, 0, TSYNC_LEAP_MAX_OUT_LEN);
+
+ /* Read the leap seconds info from the TSYNC-PCI device */
+ err2 = ioctl(hBoard.file_descriptor,
+ IOCTL_TSYNC_GET,
+ (char *)it2);
+
+ pp = peer->procptr;
+ up = (TsyncUnit*)pp->unitptr;
+
+ /* Read the time from the TSYNC-PCI device */
+ err3 = ioctl(hBoard.file_descriptor,
+ IOCTL_TPRO_GET_NTP_TIME,
+ (char *)&TimeContext);
+
+ /* Close the TSYNC device */
+ close(hBoard.file_descriptor);
+
+ // Check for errors
+ if ((err < 0) ||(err1 < 0) || (err2 < 0) || (err3 < 0) ||
+ (it->status != 0) || (it1->status != 0) || (it2->status != 0) ||
+ (it->actualOutLength != TSYNC_REF_OUT_LEN) ||
+ (it1->actualOutLength != TSYNC_TMSCL_OUT_LEN) ||
+ (it2->actualOutLength != TSYNC_LEAP_OUT_LEN)) {
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+
+ // Extract reference identifiers from ioctl payload
+ memset(timeRef, '\0', sizeof(timeRef));
+ memset(ppsRef, '\0', sizeof(ppsRef));
+ pRefObj = (void *)it->payloads;
+ memcpy(timeRef, pRefObj->time, TSYNC_REF_LEN);
+ memcpy(ppsRef, pRefObj->pps, TSYNC_REF_LEN);
+
+ // Extract the Clock Service Time Scale and convert to correct byte order
+ memcpy(&tmscl, ((TIME_SCALE*)(it1->payloads)), sizeof(tmscl));
+ tmscl = ntohl(tmscl);
+
+ // Extract leap second info from ioctl payload and perform byte swapping
+ for (i = 0; i < (sizeof(leapSec) / 4); i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ ((unsigned char*)&leapSec)[(i * 4) + j] =
+ ((unsigned char*)(it2->payloads))[(i * 4) + (3 - j)];
+ }
+ }
+
+ // Determine time reference ID from reference name
+ for (i = 0; RefIdLookupTbl[i].pRef != NULL; i++)
+ {
+ // Search RefID table
+ if (strstr(timeRef, RefIdLookupTbl[i].pRef) != NULL)
+ {
+ // Found the matching string
+ break;
+ }
+ }
+
+ // Determine pps reference ID from reference name
+ for (j = 0; RefIdLookupTbl[j].pRef != NULL; j++)
+ {
+ // Search RefID table
+ if (strstr(ppsRef, RefIdLookupTbl[j].pRef) != NULL)
+ {
+ // Found the matching string
+ break;
+ }
+ }
+
+ // Determine synchronization state from flags
+ synch = (TimeContext.timeObj.flags == 0x4) ? 1 : 0;
+
+ // Pull seconds information from time object
+ seconds = (double) (TimeContext.timeObj.secsDouble);
+ seconds /= (double) 1000000.0;
+
+ /*
+ ** Convert the number of microseconds to double and then place in the
+ ** peer's last received long floating point format.
+ */
+ DTOLFP(((double)TimeContext.tv.tv_usec / 1000000.0), &pp->lastrec);
+
+ /*
+ ** The specTimeStamp is the number of seconds since 1/1/1970, while the
+ ** peer's lastrec time should be compatible with NTP which is seconds since
+ ** 1/1/1900. So Add the number of seconds between 1900 and 1970 to the
+ ** specTimeStamp and place in the peer's lastrec long floating point struct.
+ */
+ pp->lastrec.Ul_i.Xl_ui += (unsigned int)TimeContext.tv.tv_sec +
+ SECONDS_1900_TO_1970;
+
+ pp->polls++;
+
+ /*
+ ** set the reference clock object
+ */
+ sprintf(pp->a_lastcode, "%03d %02d:%02d:%02.6f",
+ TimeContext.timeObj.days, TimeContext.timeObj.hours,
+ TimeContext.timeObj.minutes, seconds);
+
+ pp->lencode = strlen (pp->a_lastcode);
+ pp->day = TimeContext.timeObj.days;
+ pp->hour = TimeContext.timeObj.hours;
+ pp->minute = TimeContext.timeObj.minutes;
+ pp->second = (int) seconds;
+ seconds = (seconds - (double) (pp->second / 1.0)) * 1000000000;
+ pp->nsec = (long) seconds;
+
+ /*
+ ** calculate year start
+ */
+ jt.year = TimeContext.timeObj.year;
+ jt.yearday = 1;
+ jt.monthday = 1;
+ jt.month = 1;
+ jt.hour = 0;
+ jt.minute = 0;
+ jt.second = 0;
+ pp->yearstart = caltontp(&jt);
+
+ // Calculate and report reference clock offset
+ offset.l_ui = (long)(((pp->day - 1) * 24) + pp->hour + GMT);
+ offset.l_ui = (offset.l_ui * 60) + (long)pp->minute;
+ offset.l_ui = (offset.l_ui * 60) + (long)pp->second;
+ offset.l_ui = offset.l_ui + (long)pp->yearstart;
+ offset.l_uf = 0;
+ DTOLFP(pp->nsec / 1e9, &ltemp);
+ L_ADD(&offset, &ltemp);
+ refclock_process_offset(pp, offset, pp->lastrec,
+ pp->fudgetime1);
+
+ // KTS in sync
+ if (synch) {
+ // Subtract leap second info by one second to determine effective day
+ ApplyTimeOffset(&(leapSec.utcDate), -1);
+
+ // If there is a leap second today and the KTS is using a time scale
+ // which handles leap seconds then
+ if ((tmscl != TIME_SCALE_GPS) && (tmscl != TIME_SCALE_TAI) &&
+ (leapSec.utcDate.year == (unsigned int)TimeContext.timeObj.year) &&
+ (leapSec.utcDate.doy == (unsigned int)TimeContext.timeObj.days))
+ {
+ // If adding a second
+ if (leapSec.offset == 1)
+ {
+ pp->leap = LEAP_ADDSECOND;
+ }
+ // Else if removing a second
+ else if (leapSec.offset == -1)
+ {
+ pp->leap = LEAP_DELSECOND;
+ }
+ // Else report no leap second pending (no handling of offsets
+ // other than +1 or -1)
+ else
+ {
+ pp->leap = LEAP_NOWARNING;
+ }
+ }
+ // Else report no leap second pending
+ else
+ {
+ pp->leap = LEAP_NOWARNING;
+ }
+
+ peer->leap = pp->leap;
+ refclock_report(peer, CEVNT_NOMINAL);
+
+ // If reference name reported, then not in holdover
+ if ((RefIdLookupTbl[i].pRef != NULL) &&
+ (RefIdLookupTbl[j].pRef != NULL))
+ {
+ // Determine if KTS being synchronized by host (identified as
+ // "LOCL")
+ if ((strcmp(RefIdLookupTbl[i].pRefId, TSYNC_REF_LOCAL) == 0) ||
+ (strcmp(RefIdLookupTbl[j].pRefId, TSYNC_REF_LOCAL) == 0))
+ {
+ // Clear prefer flag
+ peer->flags &= ~FLAG_PREFER;
+
+ // Set reference clock stratum level as unusable
+ pp->stratum = STRATUM_UNSPEC;
+ peer->stratum = pp->stratum;
+
+ // If a valid peer is available
+ if ((sys_peer != NULL) && (sys_peer != peer))
+ {
+ // Store reference peer stratum level and ID
+ up->refStratum = sys_peer->stratum;
+ up->refId = addr2refid(&sys_peer->srcadr);
+ }
+ }
+ else
+ {
+ // Restore prefer flag
+ peer->flags |= up->refPrefer;
+
+ // Store reference stratum as local clock
+ up->refStratum = TSYNC_LCL_STRATUM;
+ strncpy((char *)&up->refId, RefIdLookupTbl[j].pRefId,
+ TSYNC_REF_LEN);
+
+ // Set reference clock stratum level as local clock
+ pp->stratum = TSYNC_LCL_STRATUM;
+ peer->stratum = pp->stratum;
+ }
+
+ // Update reference name
+ strncpy((char *)&pp->refid, RefIdLookupTbl[j].pRefId,
+ TSYNC_REF_LEN);
+ peer->refid = pp->refid;
+ }
+ // Else in holdover
+ else
+ {
+ // Restore prefer flag
+ peer->flags |= up->refPrefer;
+
+ // Update reference ID to saved ID
+ pp->refid = up->refId;
+ peer->refid = pp->refid;
+
+ // Update stratum level to saved stratum level
+ pp->stratum = up->refStratum;
+ peer->stratum = pp->stratum;
+ }
+ }
+ // Else KTS not in sync
+ else {
+ // Place local identifier in peer RefID
+ strncpy((char *)&pp->refid, TSYNC_REF_LOCAL, TSYNC_REF_LEN);
+ peer->refid = pp->refid;
+
+ // Report not in sync
+ pp->leap = LEAP_NOTINSYNC;
+ peer->leap = pp->leap;
+ }
+
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ refclock_receive(peer);
+
+ /* Increment the number of times the reference has been polled */
+ pp->polls++;
+
+} /* End - tsync_poll() */
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Function: ApplyTimeOffset
+// Description: The ApplyTimeOffset function adds an offset (in seconds) to a
+// specified date and time. The specified date and time is passed
+// back after being modified.
+//
+// Assumptions: 1. Every fourth year is a leap year. Therefore, this function
+// is only accurate through Feb 28, 2100.
+////////////////////////////////////////////////////////////////////////////////
+void ApplyTimeOffset(DoyTimeObj* pDt, int off)
+{
+ SecTimeObj st; // Time, in seconds
+
+
+ // Convert date and time to seconds
+ SecTimeFromDoyTime(&st, pDt);
+
+ // Apply offset
+ st.seconds = (int)((signed long long)st.seconds + (signed long long)off);
+
+ // Convert seconds to date and time
+ DoyTimeFromSecTime(pDt, &st);
+
+} // End ApplyTimeOffset
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Function: SecTimeFromDoyTime
+// Description: The SecTimeFromDoyTime function converts a specified date
+// and time into a count of seconds since the base time. This
+// function operates across the range Base Time to Max Time for
+// the system.
+//
+// Assumptions: 1. A leap year is any year evenly divisible by 4. Therefore,
+// this function is only accurate through Feb 28, 2100.
+// 2. Conversion does not account for leap seconds.
+////////////////////////////////////////////////////////////////////////////////
+void SecTimeFromDoyTime(SecTimeObj* pSt, DoyTimeObj* pDt)
+{
+ unsigned int yrs; // Years
+ unsigned int lyrs; // Leap years
+
+
+ // Start with accumulated time of 0
+ pSt->seconds = 0;
+
+ // Calculate the number of years and leap years
+ yrs = pDt->year - TSYNC_TIME_BASE_YEAR;
+ lyrs = (yrs + 1) / 4;
+
+ // Convert leap years and years
+ pSt->seconds += lyrs * SECSPERLEAPYEAR;
+ pSt->seconds += (yrs - lyrs) * SECSPERYEAR;
+
+ // Convert days, hours, minutes and seconds
+ pSt->seconds += (pDt->doy - 1) * SECSPERDAY;
+ pSt->seconds += pDt->hour * SECSPERHR;
+ pSt->seconds += pDt->minute * SECSPERMIN;
+ pSt->seconds += pDt->second;
+
+ // Copy the subseconds count
+ pSt->ns = pDt->ns;
+
+} // End SecTimeFromDoyTime
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Function: DoyTimeFromSecTime
+// Description: The DoyTimeFromSecTime function converts a specified count
+// of seconds since the start of our base time into a SecTimeObj
+// structure.
+//
+// Assumptions: 1. A leap year is any year evenly divisible by 4. Therefore,
+// this function is only accurate through Feb 28, 2100.
+// 2. Conversion does not account for leap seconds.
+////////////////////////////////////////////////////////////////////////////////
+void DoyTimeFromSecTime(DoyTimeObj* pDt, SecTimeObj* pSt)
+{
+ signed long long secs; // Seconds accumulator variable
+ unsigned int yrs; // Years accumulator variable
+ unsigned int doys; // Days accumulator variable
+ unsigned int hrs; // Hours accumulator variable
+ unsigned int mins; // Minutes accumulator variable
+
+
+ // Convert the seconds count into a signed 64-bit number for calculations
+ secs = (signed long long)(pSt->seconds);
+
+ // Calculate the number of 4 year chunks
+ yrs = (unsigned int)((secs /
+ ((SECSPERYEAR * 3) + SECSPERLEAPYEAR)) * 4);
+ secs %= ((SECSPERYEAR * 3) + SECSPERLEAPYEAR);
+
+ // If there is at least a normal year worth of time left
+ if (secs >= SECSPERYEAR)
+ {
+ // Increment the number of years and subtract a normal year of time
+ yrs++;
+ secs -= SECSPERYEAR;
+ }
+
+ // If there is still at least a normal year worth of time left
+ if (secs >= SECSPERYEAR)
+ {
+ // Increment the number of years and subtract a normal year of time
+ yrs++;
+ secs -= SECSPERYEAR;
+ }
+
+ // If there is still at least a leap year worth of time left
+ if (secs >= SECSPERLEAPYEAR)
+ {
+ // Increment the number of years and subtract a leap year of time
+ yrs++;
+ secs -= SECSPERLEAPYEAR;
+ }
+
+ // Calculate the day of year as the number of days left, then add 1
+ // because months start on the 1st.
+ doys = (unsigned int)((secs / SECSPERDAY) + 1);
+ secs %= SECSPERDAY;
+
+ // Calculate the hour
+ hrs = (unsigned int)(secs / SECSPERHR);
+ secs %= SECSPERHR;
+
+ // Calculate the minute
+ mins = (unsigned int)(secs / SECSPERMIN);
+ secs %= SECSPERMIN;
+
+ // Fill in the doytime structure
+ pDt->year = yrs + TSYNC_TIME_BASE_YEAR;
+ pDt->doy = doys;
+ pDt->hour = hrs;
+ pDt->minute = mins;
+ pDt->second = (unsigned int)secs;
+ pDt->ns = pSt->ns;
+
+} // End DoyTimeFromSecTime
+
+#else
+int refclock_tsyncpci_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_tt560.c b/ntpd/refclock_tt560.c
new file mode 100644
index 0000000..171ba5c
--- /dev/null
+++ b/ntpd/refclock_tt560.c
@@ -0,0 +1,270 @@
+/*
+ * refclock_tt560 - clock driver for the TrueTime 560 IRIG-B decoder
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_TT560)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_unixtime.h"
+#include "sys/tt560_api.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+/*
+ * This driver supports the TrueTime 560 IRIG-B decoder for the PCI bus.
+ */
+
+/*
+ * TT560 interface definitions
+ */
+#define DEVICE "/dev/tt560%d" /* device name and unit */
+#define PRECISION (-20) /* precision assumed (1 us) */
+#define REFID "IRIG" /* reference ID */
+#define DESCRIPTION "TrueTime 560 IRIG-B PCI Decoder"
+
+/*
+ * Unit control structure
+ */
+struct tt560unit {
+ tt_mem_space_t *tt_mem; /* mapped address of PCI board */
+ time_freeze_reg_t tt560rawt; /* data returned from PCI board */
+};
+
+typedef union byteswap_u
+{
+ unsigned int long_word;
+ unsigned char byte[4];
+} byteswap_t;
+
+/*
+ * Function prototypes
+ */
+static int tt560_start (int, struct peer *);
+static void tt560_shutdown (int, struct peer *);
+static void tt560_poll (int unit, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_tt560 = {
+ tt560_start, /* clock_start */
+ tt560_shutdown, /* clock_shutdown */
+ tt560_poll, /* clock_poll */
+ noentry, /* clock_control (not used) */
+ noentry, /* clock_init (not used) */
+ noentry, /* clock_buginfo (not used) */
+ NOFLAGS /* clock_flags (not used) */
+};
+
+
+/*
+ * tt560_start - open the TT560 device and initialize data for processing
+ */
+static int
+tt560_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct tt560unit *up;
+ struct refclockproc *pp;
+ char device[20];
+ int fd;
+ caddr_t membase;
+
+ /*
+ * Open TT560 device
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = open(device, O_RDWR);
+ if (fd == -1) {
+ msyslog(LOG_ERR, "tt560_start: open of %s: %m", device);
+ return (0);
+ }
+
+ /*
+ * Map the device registers into user space.
+ */
+ membase = mmap ((caddr_t) 0, TTIME_MEMORY_SIZE,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, fd, (off_t)0);
+
+ if (membase == (caddr_t) -1) {
+ msyslog(LOG_ERR, "tt560_start: mapping of %s: %m", device);
+ (void) close(fd);
+ return (0);
+ }
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ if (!(up = (struct tt560unit *) emalloc(sizeof(struct tt560unit)))) {
+ (void) close(fd);
+ return (0);
+ }
+ memset((char *)up, 0, sizeof(struct tt560unit));
+ up->tt_mem = (tt_mem_space_t *)membase;
+ pp = peer->procptr;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = (caddr_t)peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ pp->unitptr = (caddr_t)up;
+
+ /*
+ * Initialize miscellaneous peer variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ return (1);
+}
+
+
+/*
+ * tt560_shutdown - shut down the clock
+ */
+static void
+tt560_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct tt560unit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = (struct tt560unit *)pp->unitptr;
+ io_closeclock(&pp->io);
+ free(up);
+}
+
+
+/*
+ * tt560_poll - called by the transmit procedure
+ */
+static void
+tt560_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct tt560unit *up;
+ struct refclockproc *pp;
+ time_freeze_reg_t *tp;
+ tt_mem_space_t *mp;
+
+ int i;
+ unsigned int *p_time_t, *tt_mem_t;
+
+ /*
+ * This is the main routine. It snatches the time from the TT560
+ * board and tacks on a local timestamp.
+ */
+ pp = peer->procptr;
+ up = (struct tt560unit *)pp->unitptr;
+ mp = up->tt_mem;
+ tp = &up->tt560rawt;
+
+ p_time_t = (unsigned int *)tp;
+ tt_mem_t = (unsigned int *)&mp->time_freeze_reg;
+
+ *tt_mem_t = 0; /* update the time freeze register */
+ /* and copy time stamp to memory */
+ for (i=0; i < TIME_FREEZE_REG_LEN; i++) {
+ *p_time_t = byte_swap(*tt_mem_t);
+ p_time_t++;
+ tt_mem_t++;
+ }
+
+ get_systime(&pp->lastrec);
+ pp->polls++;
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has invalid length or is not in
+ * proper format, we declare bad format and exit. Note: we
+ * can't use the sec/usec conversion produced by the driver,
+ * since the year may be suspect. All format error checking is
+ * done by the snprintf() and sscanf() routines.
+ */
+ snprintf(pp->a_lastcode, sizeof(pp->a_lastcode),
+ "%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
+ tp->hun_day, tp->tens_day, tp->unit_day,
+ tp->tens_hour, tp->unit_hour,
+ tp->tens_min, tp->unit_min,
+ tp->tens_sec, tp->unit_sec,
+ tp->hun_ms, tp->tens_ms, tp->unit_ms,
+ tp->hun_us, tp->tens_us, tp->unit_us,
+ tp->status);
+ pp->lencode = strlen(pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("tt560: time %s timecode %d %s\n",
+ ulfptoa(&pp->lastrec, 6), pp->lencode,
+ pp->a_lastcode);
+#endif
+ if (sscanf(pp->a_lastcode, "%3d %2d:%2d:%2d.%6ld",
+ &pp->day, &pp->hour, &pp->minute, &pp->second, &pp->usec)
+ != 5) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ if ((tp->status & 0x6) != 0x6)
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ refclock_receive(peer);
+}
+
+/******************************************************************
+ *
+ * byte_swap
+ *
+ * Inputs: 32 bit integer
+ *
+ * Output: byte swapped 32 bit integer.
+ *
+ * This routine is used to compensate for the byte alignment
+ * differences between big-endian and little-endian integers.
+ *
+ ******************************************************************/
+static unsigned int
+byte_swap(unsigned int input_num)
+{
+ byteswap_t byte_swap;
+ unsigned char temp;
+
+ byte_swap.long_word = input_num;
+
+ temp = byte_swap.byte[3];
+ byte_swap.byte[3] = byte_swap.byte[0];
+ byte_swap.byte[0] = temp;
+
+ temp = byte_swap.byte[2];
+ byte_swap.byte[2] = byte_swap.byte[1];
+ byte_swap.byte[1] = temp;
+
+ return (byte_swap.long_word);
+}
+
+#else
+int refclock_tt560_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_ulink.c b/ntpd/refclock_ulink.c
new file mode 100644
index 0000000..d8f24a5
--- /dev/null
+++ b/ntpd/refclock_ulink.c
@@ -0,0 +1,568 @@
+/*
+ * refclock_ulink - clock driver for Ultralink WWVB receiver
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_ULINK)
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+/* This driver supports ultralink Model 320,325,330,331,332 WWVB radios
+ *
+ * this driver was based on the refclock_wwvb.c driver
+ * in the ntp distribution.
+ *
+ * Fudge Factors
+ *
+ * fudge flag1 0 don't poll clock
+ * 1 send poll character
+ *
+ * revision history:
+ * 99/9/09 j.c.lang original edit's
+ * 99/9/11 j.c.lang changed timecode parse to
+ * match what the radio actually
+ * sends.
+ * 99/10/11 j.c.lang added support for continous
+ * time code mode (dipsw2)
+ * 99/11/26 j.c.lang added support for 320 decoder
+ * (taken from Dave Strout's
+ * Model 320 driver)
+ * 99/11/29 j.c.lang added fudge flag 1 to control
+ * clock polling
+ * 99/12/15 j.c.lang fixed 320 quality flag
+ * 01/02/21 s.l.smith fixed 33x quality flag
+ * added more debugging stuff
+ * updated 33x time code explanation
+ * 04/01/23 frank migge added support for 325 decoder
+ * (tested with ULM325.F)
+ *
+ * Questions, bugs, ideas send to:
+ * Joseph C. Lang
+ * tcnojl1@earthlink.net
+ *
+ * Dave Strout
+ * dstrout@linuxfoundry.com
+ *
+ * Frank Migge
+ * frank.migge@oracle.com
+ *
+ *
+ * on the Ultralink model 33X decoder Dip switch 2 controls
+ * polled or continous timecode
+ * set fudge flag1 if using polled (needed for model 320 and 325)
+ * dont set fudge flag1 if dip switch 2 is set on model 33x decoder
+*/
+
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/wwvb%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define PRECISION (-10) /* precision assumed (about 10 ms) */
+#define REFID "WWVB" /* reference ID */
+#define DESCRIPTION "Ultralink WWVB Receiver" /* WRU */
+
+#define LEN33X 32 /* timecode length Model 33X and 325 */
+#define LEN320 24 /* timecode length Model 320 */
+
+#define SIGLCHAR33x 'S' /* signal strength identifier char 325 */
+#define SIGLCHAR325 'R' /* signal strength identifier char 33x */
+
+/*
+ * unit control structure
+ */
+struct ulinkunit {
+ u_char tcswitch; /* timecode switch */
+ l_fp laststamp; /* last receive timestamp */
+};
+
+/*
+ * Function prototypes
+ */
+static int ulink_start (int, struct peer *);
+static void ulink_shutdown (int, struct peer *);
+static void ulink_receive (struct recvbuf *);
+static void ulink_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_ulink = {
+ ulink_start, /* start up driver */
+ ulink_shutdown, /* shut down driver */
+ ulink_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* not used */
+ noentry, /* not used */
+ NOFLAGS
+};
+
+
+/*
+ * ulink_start - open the devices and initialize data for processing
+ */
+static int
+ulink_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct ulinkunit *up;
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_CLK);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc(sizeof(struct ulinkunit));
+ memset(up, 0, sizeof(struct ulinkunit));
+ pp = peer->procptr;
+ pp->io.clock_recv = ulink_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ return (1);
+}
+
+
+/*
+ * ulink_shutdown - shut down the clock
+ */
+static void
+ulink_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct ulinkunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (pp->io.fd != -1)
+ io_closeclock(&pp->io);
+ if (up != NULL)
+ free(up);
+}
+
+
+/*
+ * ulink_receive - receive data from the serial interface
+ */
+static void
+ulink_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct ulinkunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ l_fp trtmp; /* arrival timestamp */
+ int quality = INT_MAX; /* quality indicator */
+ int temp; /* int temp */
+ char syncchar; /* synchronization indicator */
+ char leapchar; /* leap indicator */
+ char modechar; /* model 320 mode flag */
+ char siglchar; /* model difference between 33x/325 */
+ char char_quality[2]; /* temp quality flag */
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);
+
+ /*
+ * Note we get a buffer and timestamp for both a <cr> and <lf>,
+ * but only the <cr> timestamp is retained.
+ */
+ if (temp == 0) {
+ if (up->tcswitch == 0) {
+ up->tcswitch = 1;
+ up->laststamp = trtmp;
+ } else
+ up->tcswitch = 0;
+ return;
+ }
+ pp->lencode = temp;
+ pp->lastrec = up->laststamp;
+ up->laststamp = trtmp;
+ up->tcswitch = 1;
+#ifdef DEBUG
+ if (debug)
+ printf("ulink: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has invalid length or is not in
+ * proper format, we declare bad format and exit.
+ */
+ syncchar = leapchar = modechar = siglchar = ' ';
+ switch (pp->lencode ) {
+ case LEN33X:
+
+ /*
+ * First we check if the format is 33x or 325:
+ * <CR><LF>S9+D 00 YYYY+DDDUTCS HH:MM:SSL+5 (33x)
+ * <CR><LF>R5_1C00LYYYY+DDDUTCS HH:MM:SSL+5 (325)
+ * simply by comparing if the signal level is 'S' or 'R'
+ */
+
+ if (sscanf(pp->a_lastcode, "%c%*31c",
+ &siglchar) == 1) {
+
+ if(siglchar == SIGLCHAR325) {
+
+ /*
+ * decode for a Model 325 decoder.
+ * Timecode format from January 23, 2004 datasheet is:
+ *
+ * <CR><LF>R5_1C00LYYYY+DDDUTCS HH:MM:SSL+5
+ *
+ * R WWVB decodersignal readability R1 - R5
+ * 5 R1 is unreadable, R5 is best
+ * space a space (0x20)
+ * 1 Data bit 0, 1, M (pos mark), or ? (unknown).
+ * C Reception from either (C)olorado or (H)awaii
+ * 00 Hours since last good WWVB frame sync. Will
+ * be 00-99
+ * space Space char (0x20) or (0xa5) if locked to wwvb
+ * YYYY Current year, 2000-2099
+ * + Leap year indicator. '+' if a leap year,
+ * a space (0x20) if not.
+ * DDD Day of year, 000 - 365.
+ * UTC Timezone (always 'UTC').
+ * S Daylight savings indicator
+ * S - standard time (STD) in effect
+ * O - during STD to DST day 0000-2400
+ * D - daylight savings time (DST) in effect
+ * I - during DST to STD day 0000-2400
+ * space Space character (0x20)
+ * HH Hours 00-23
+ * : This is the REAL in sync indicator (: = insync)
+ * MM Minutes 00-59
+ * : : = in sync ? = NOT in sync
+ * SS Seconds 00-59
+ * L Leap second flag. Changes from space (0x20)
+ * to 'I' or 'D' during month preceding leap
+ * second adjustment. (I)nsert or (D)elete
+ * +5 UT1 correction (sign + digit ))
+ */
+
+ if (sscanf(pp->a_lastcode,
+ "%*2c %*2c%2c%*c%4d%*c%3d%*4c %2d%c%2d:%2d%c%*2c",
+ char_quality, &pp->year, &pp->day,
+ &pp->hour, &syncchar, &pp->minute, &pp->second,
+ &leapchar) == 8) {
+
+ if (char_quality[0] == '0') {
+ quality = 0;
+ } else if (char_quality[0] == '0') {
+ quality = (char_quality[1] & 0x0f);
+ } else {
+ quality = 99;
+ }
+
+ if (leapchar == 'I' ) leapchar = '+';
+ if (leapchar == 'D' ) leapchar = '-';
+
+ /*
+ #ifdef DEBUG
+ if (debug) {
+ printf("ulink: char_quality %c %c\n",
+ char_quality[0], char_quality[1]);
+ printf("ulink: quality %d\n", quality);
+ printf("ulink: syncchar %x\n", syncchar);
+ printf("ulink: leapchar %x\n", leapchar);
+ }
+ #endif
+ */
+
+ }
+
+ }
+ if(siglchar == SIGLCHAR33x) {
+
+ /*
+ * We got a Model 33X decoder.
+ * Timecode format from January 29, 2001 datasheet is:
+ * <CR><LF>S9+D 00 YYYY+DDDUTCS HH:MM:SSL+5
+ * S WWVB decoder sync indicator. S for in-sync(?)
+ * or N for noisy signal.
+ * 9+ RF signal level in S-units, 0-9 followed by
+ * a space (0x20). The space turns to '+' if the
+ * level is over 9.
+ * D Data bit 0, 1, 2 (position mark), or
+ * 3 (unknown).
+ * space Space character (0x20)
+ * 00 Hours since last good WWVB frame sync. Will
+ * be 00-23 hrs, or '1d' to '7d'. Will be 'Lk'
+ * if currently in sync.
+ * space Space character (0x20)
+ * YYYY Current year, 1990-2089
+ * + Leap year indicator. '+' if a leap year,
+ * a space (0x20) if not.
+ * DDD Day of year, 001 - 366.
+ * UTC Timezone (always 'UTC').
+ * S Daylight savings indicator
+ * S - standard time (STD) in effect
+ * O - during STD to DST day 0000-2400
+ * D - daylight savings time (DST) in effect
+ * I - during DST to STD day 0000-2400
+ * space Space character (0x20)
+ * HH Hours 00-23
+ * : This is the REAL in sync indicator (: = insync)
+ * MM Minutes 00-59
+ * : : = in sync ? = NOT in sync
+ * SS Seconds 00-59
+ * L Leap second flag. Changes from space (0x20)
+ * to '+' or '-' during month preceding leap
+ * second adjustment.
+ * +5 UT1 correction (sign + digit ))
+ */
+
+ if (sscanf(pp->a_lastcode,
+ "%*4c %2c %4d%*c%3d%*4c %2d%c%2d:%2d%c%*2c",
+ char_quality, &pp->year, &pp->day,
+ &pp->hour, &syncchar, &pp->minute, &pp->second,
+ &leapchar) == 8) {
+
+ if (char_quality[0] == 'L') {
+ quality = 0;
+ } else if (char_quality[0] == '0') {
+ quality = (char_quality[1] & 0x0f);
+ } else {
+ quality = 99;
+ }
+
+ /*
+ #ifdef DEBUG
+ if (debug) {
+ printf("ulink: char_quality %c %c\n",
+ char_quality[0], char_quality[1]);
+ printf("ulink: quality %d\n", quality);
+ printf("ulink: syncchar %x\n", syncchar);
+ printf("ulink: leapchar %x\n", leapchar);
+ }
+ #endif
+ */
+
+ }
+ }
+ break;
+ }
+
+ case LEN320:
+
+ /*
+ * Model 320 Decoder
+ * The timecode format is:
+ *
+ * <cr><lf>SQRYYYYDDD+HH:MM:SS.mmLT<cr>
+ *
+ * where:
+ *
+ * S = 'S' -- sync'd in last hour,
+ * '0'-'9' - hours x 10 since last update,
+ * '?' -- not in sync
+ * Q = Number of correlating time-frames, from 0 to 5
+ * R = 'R' -- reception in progress,
+ * 'N' -- Noisy reception,
+ * ' ' -- standby mode
+ * YYYY = year from 1990 to 2089
+ * DDD = current day from 1 to 366
+ * + = '+' if current year is a leap year, else ' '
+ * HH = UTC hour 0 to 23
+ * MM = Minutes of current hour from 0 to 59
+ * SS = Seconds of current minute from 0 to 59
+ * mm = 10's milliseconds of the current second from 00 to 99
+ * L = Leap second pending at end of month
+ * 'I' = insert, 'D'= delete
+ * T = DST <-> STD transition indicators
+ *
+ */
+
+ if (sscanf(pp->a_lastcode, "%c%1d%c%4d%3d%*c%2d:%2d:%2d.%2ld%c",
+ &syncchar, &quality, &modechar, &pp->year, &pp->day,
+ &pp->hour, &pp->minute, &pp->second,
+ &pp->nsec, &leapchar) == 10) {
+ pp->nsec *= 10000000; /* M320 returns 10's of msecs */
+ if (leapchar == 'I' ) leapchar = '+';
+ if (leapchar == 'D' ) leapchar = '-';
+ if (syncchar != '?' ) syncchar = ':';
+
+ break;
+ }
+
+ default:
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ /*
+ * Decode quality indicator
+ * For the 325 & 33x series, the lower the number the "better"
+ * the time is. I used the dispersion as the measure of time
+ * quality. The quality indicator in the 320 is the number of
+ * correlating time frames (the more the better)
+ */
+
+ /*
+ * The spec sheet for the 325 & 33x series states the clock will
+ * maintain +/-0.002 seconds accuracy when locked to WWVB. This
+ * is indicated by 'Lk' in the quality portion of the incoming
+ * string. When not in lock, a drift of +/-0.015 seconds should
+ * be allowed for.
+ * With the quality indicator decoding scheme above, the 'Lk'
+ * condition will produce a quality value of 0. If the quality
+ * indicator starts with '0' then the second character is the
+ * number of hours since we were last locked. If the first
+ * character is anything other than 'L' or '0' then we have been
+ * out of lock for more than 9 hours so we assume the worst and
+ * force a quality value that selects the 'default' maximum
+ * dispersion. The dispersion values below are what came with the
+ * driver. They're not unreasonable so they've not been changed.
+ */
+
+ if (pp->lencode == LEN33X) {
+ switch (quality) {
+ case 0 :
+ pp->disp=.002;
+ break;
+ case 1 :
+ pp->disp=.02;
+ break;
+ case 2 :
+ pp->disp=.04;
+ break;
+ case 3 :
+ pp->disp=.08;
+ break;
+ default:
+ pp->disp=MAXDISPERSE;
+ break;
+ }
+ } else {
+ switch (quality) {
+ case 5 :
+ pp->disp=.002;
+ break;
+ case 4 :
+ pp->disp=.02;
+ break;
+ case 3 :
+ pp->disp=.04;
+ break;
+ case 2 :
+ pp->disp=.08;
+ break;
+ case 1 :
+ pp->disp=.16;
+ break;
+ default:
+ pp->disp=MAXDISPERSE;
+ break;
+ }
+
+ }
+
+ /*
+ * Decode synchronization, and leap characters. If
+ * unsynchronized, set the leap bits accordingly and exit.
+ * Otherwise, set the leap bits according to the leap character.
+ */
+
+ if (syncchar != ':')
+ pp->leap = LEAP_NOTINSYNC;
+ else if (leapchar == '+')
+ pp->leap = LEAP_ADDSECOND;
+ else if (leapchar == '-')
+ pp->leap = LEAP_DELSECOND;
+ else
+ pp->leap = LEAP_NOWARNING;
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ }
+
+}
+
+/*
+ * ulink_poll - called by the transmit procedure
+ */
+
+static void
+ulink_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ char pollchar;
+
+ pp = peer->procptr;
+ pollchar = 'T';
+ if (pp->sloppyclockflag & CLK_FLAG1) {
+ if (write(pp->io.fd, &pollchar, 1) != 1)
+ refclock_report(peer, CEVNT_FAULT);
+ else
+ pp->polls++;
+ }
+ else
+ pp->polls++;
+
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ pp->lastref = pp->lastrec;
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+}
+
+#else
+int refclock_ulink_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_wwv.c b/ntpd/refclock_wwv.c
new file mode 100644
index 0000000..14183b4
--- /dev/null
+++ b/ntpd/refclock_wwv.c
@@ -0,0 +1,2709 @@
+/*
+ * refclock_wwv - clock driver for NIST WWV/H time/frequency station
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_WWV)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "audio.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#define ICOM 1
+
+#ifdef ICOM
+#include "icom.h"
+#endif /* ICOM */
+
+/*
+ * Audio WWV/H demodulator/decoder
+ *
+ * This driver synchronizes the computer time using data encoded in
+ * radio transmissions from NIST time/frequency stations WWV in Boulder,
+ * CO, and WWVH in Kauai, HI. Transmissions are made continuously on
+ * 2.5, 5, 10 and 15 MHz from WWV and WWVH, and 20 MHz from WWV. An
+ * ordinary AM shortwave receiver can be tuned manually to one of these
+ * frequencies or, in the case of ICOM receivers, the receiver can be
+ * tuned automatically using this program as propagation conditions
+ * change throughout the weasons, both day and night.
+ *
+ * The driver requires an audio codec or sound card with sampling rate 8
+ * kHz and mu-law companding. This is the same standard as used by the
+ * telephone industry and is supported by most hardware and operating
+ * systems, including Solaris, SunOS, FreeBSD, NetBSD and Linux. In this
+ * implementation, only one audio driver and codec can be supported on a
+ * single machine.
+ *
+ * The demodulation and decoding algorithms used in this driver are
+ * based on those developed for the TAPR DSP93 development board and the
+ * TI 320C25 digital signal processor described in: Mills, D.L. A
+ * precision radio clock for WWV transmissions. Electrical Engineering
+ * Report 97-8-1, University of Delaware, August 1997, 25 pp., available
+ * from www.eecis.udel.edu/~mills/reports.html. The algorithms described
+ * in this report have been modified somewhat to improve performance
+ * under weak signal conditions and to provide an automatic station
+ * identification feature.
+ *
+ * The ICOM code is normally compiled in the driver. It isn't used,
+ * unless the mode keyword on the server configuration command specifies
+ * a nonzero ICOM ID select code. The C-IV trace is turned on if the
+ * debug level is greater than one.
+ *
+ * Fudge factors
+ *
+ * Fudge flag4 causes the debugging output described above to be
+ * recorded in the clockstats file. Fudge flag2 selects the audio input
+ * port, where 0 is the mike port (default) and 1 is the line-in port.
+ * It does not seem useful to select the compact disc player port. Fudge
+ * flag3 enables audio monitoring of the input signal. For this purpose,
+ * the monitor gain is set to a default value.
+ *
+ * CEVNT_BADTIME invalid date or time
+ * CEVNT_PROP propagation failure - no stations heard
+ * CEVNT_TIMEOUT timeout (see newgame() below)
+ */
+/*
+ * General definitions. These ordinarily do not need to be changed.
+ */
+#define DEVICE_AUDIO "/dev/audio" /* audio device name */
+#define AUDIO_BUFSIZ 320 /* audio buffer size (50 ms) */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define DESCRIPTION "WWV/H Audio Demodulator/Decoder" /* WRU */
+#define WWV_SEC 8000 /* second epoch (sample rate) (Hz) */
+#define WWV_MIN (WWV_SEC * 60) /* minute epoch */
+#define OFFSET 128 /* companded sample offset */
+#define SIZE 256 /* decompanding table size */
+#define MAXAMP 6000. /* max signal level reference */
+#define MAXCLP 100 /* max clips above reference per s */
+#define MAXSNR 40. /* max SNR reference */
+#define MAXFREQ 1.5 /* max frequency tolerance (187 PPM) */
+#define DATCYC 170 /* data filter cycles */
+#define DATSIZ (DATCYC * MS) /* data filter size */
+#define SYNCYC 800 /* minute filter cycles */
+#define SYNSIZ (SYNCYC * MS) /* minute filter size */
+#define TCKCYC 5 /* tick filter cycles */
+#define TCKSIZ (TCKCYC * MS) /* tick filter size */
+#define NCHAN 5 /* number of radio channels */
+#define AUDIO_PHI 5e-6 /* dispersion growth factor */
+#define TBUF 128 /* max monitor line length */
+
+/*
+ * Tunable parameters. The DGAIN parameter can be changed to fit the
+ * audio response of the radio at 100 Hz. The WWV/WWVH data subcarrier
+ * is transmitted at about 20 percent percent modulation; the matched
+ * filter boosts it by a factor of 17 and the receiver response does
+ * what it does. The compromise value works for ICOM radios. If the
+ * radio is not tunable, the DCHAN parameter can be changed to fit the
+ * expected best propagation frequency: higher if further from the
+ * transmitter, lower if nearer. The compromise value works for the US
+ * right coast.
+ */
+#define DCHAN 3 /* default radio channel (15 Mhz) */
+#define DGAIN 5. /* subcarrier gain */
+
+/*
+ * General purpose status bits (status)
+ *
+ * SELV and/or SELH are set when WWV or WWVH have been heard and cleared
+ * on signal loss. SSYNC is set when the second sync pulse has been
+ * acquired and cleared by signal loss. MSYNC is set when the minute
+ * sync pulse has been acquired. DSYNC is set when the units digit has
+ * has reached the threshold and INSYNC is set when all nine digits have
+ * reached the threshold. The MSYNC, DSYNC and INSYNC bits are cleared
+ * only by timeout, upon which the driver starts over from scratch.
+ *
+ * DGATE is lit if the data bit amplitude or SNR is below thresholds and
+ * BGATE is lit if the pulse width amplitude or SNR is below thresolds.
+ * LEPSEC is set during the last minute of the leap day. At the end of
+ * this minute the driver inserts second 60 in the seconds state machine
+ * and the minute sync slips a second.
+ */
+#define MSYNC 0x0001 /* minute epoch sync */
+#define SSYNC 0x0002 /* second epoch sync */
+#define DSYNC 0x0004 /* minute units sync */
+#define INSYNC 0x0008 /* clock synchronized */
+#define FGATE 0x0010 /* frequency gate */
+#define DGATE 0x0020 /* data pulse amplitude error */
+#define BGATE 0x0040 /* data pulse width error */
+#define METRIC 0x0080 /* one or more stations heard */
+#define LEPSEC 0x1000 /* leap minute */
+
+/*
+ * Station scoreboard bits
+ *
+ * These are used to establish the signal quality for each of the five
+ * frequencies and two stations.
+ */
+#define SELV 0x0100 /* WWV station select */
+#define SELH 0x0200 /* WWVH station select */
+
+/*
+ * Alarm status bits (alarm)
+ *
+ * These bits indicate various alarm conditions, which are decoded to
+ * form the quality character included in the timecode.
+ */
+#define CMPERR 0x1 /* digit or misc bit compare error */
+#define LOWERR 0x2 /* low bit or digit amplitude or SNR */
+#define NINERR 0x4 /* less than nine digits in minute */
+#define SYNERR 0x8 /* not tracking second sync */
+
+/*
+ * Watchcat timeouts (watch)
+ *
+ * If these timeouts expire, the status bits are mashed to zero and the
+ * driver starts from scratch. Suitably more refined procedures may be
+ * developed in future. All these are in minutes.
+ */
+#define ACQSN 6 /* station acquisition timeout */
+#define DATA 15 /* unit minutes timeout */
+#define SYNCH 40 /* station sync timeout */
+#define PANIC (2 * 1440) /* panic timeout */
+
+/*
+ * Thresholds. These establish the minimum signal level, minimum SNR and
+ * maximum jitter thresholds which establish the error and false alarm
+ * rates of the driver. The values defined here may be on the
+ * adventurous side in the interest of the highest sensitivity.
+ */
+#define MTHR 13. /* minute sync gate (percent) */
+#define TTHR 50. /* minute sync threshold (percent) */
+#define AWND 20 /* minute sync jitter threshold (ms) */
+#define ATHR 2500. /* QRZ minute sync threshold */
+#define ASNR 20. /* QRZ minute sync SNR threshold (dB) */
+#define QTHR 2500. /* QSY minute sync threshold */
+#define QSNR 20. /* QSY minute sync SNR threshold (dB) */
+#define STHR 2500. /* second sync threshold */
+#define SSNR 15. /* second sync SNR threshold (dB) */
+#define SCMP 10 /* second sync compare threshold */
+#define DTHR 1000. /* bit threshold */
+#define DSNR 10. /* bit SNR threshold (dB) */
+#define AMIN 3 /* min bit count */
+#define AMAX 6 /* max bit count */
+#define BTHR 1000. /* digit threshold */
+#define BSNR 3. /* digit likelihood threshold (dB) */
+#define BCMP 3 /* digit compare threshold */
+#define MAXERR 40 /* maximum error alarm */
+
+/*
+ * Tone frequency definitions. The increments are for 4.5-deg sine
+ * table.
+ */
+#define MS (WWV_SEC / 1000) /* samples per millisecond */
+#define IN100 ((100 * 80) / WWV_SEC) /* 100 Hz increment */
+#define IN1000 ((1000 * 80) / WWV_SEC) /* 1000 Hz increment */
+#define IN1200 ((1200 * 80) / WWV_SEC) /* 1200 Hz increment */
+
+/*
+ * Acquisition and tracking time constants
+ */
+#define MINAVG 8 /* min averaging time */
+#define MAXAVG 1024 /* max averaging time */
+#define FCONST 3 /* frequency time constant */
+#define TCONST 16 /* data bit/digit time constant */
+
+/*
+ * Miscellaneous status bits (misc)
+ *
+ * These bits correspond to designated bits in the WWV/H timecode. The
+ * bit probabilities are exponentially averaged over several minutes and
+ * processed by a integrator and threshold.
+ */
+#define DUT1 0x01 /* 56 DUT .1 */
+#define DUT2 0x02 /* 57 DUT .2 */
+#define DUT4 0x04 /* 58 DUT .4 */
+#define DUTS 0x08 /* 50 DUT sign */
+#define DST1 0x10 /* 55 DST1 leap warning */
+#define DST2 0x20 /* 2 DST2 DST1 delayed one day */
+#define SECWAR 0x40 /* 3 leap second warning */
+
+/*
+ * The on-time synchronization point is the positive-going zero crossing
+ * of the first cycle of the 5-ms second pulse. The IIR baseband filter
+ * phase delay is 0.91 ms, while the receiver delay is approximately 4.7
+ * ms at 1000 Hz. The fudge value -0.45 ms due to the codec and other
+ * causes was determined by calibrating to a PPS signal from a GPS
+ * receiver. The additional propagation delay specific to each receiver
+ * location can be programmed in the fudge time1 and time2 values for
+ * WWV and WWVH, respectively.
+ *
+ * The resulting offsets with a 2.4-GHz P4 running FreeBSD 6.1 are
+ * generally within .02 ms short-term with .02 ms jitter. The long-term
+ * offsets vary up to 0.3 ms due to ionosperhic layer height variations.
+ * The processor load due to the driver is 5.8 percent.
+ */
+#define PDELAY ((.91 + 4.7 - 0.45) / 1000) /* system delay (s) */
+
+/*
+ * Table of sine values at 4.5-degree increments. This is used by the
+ * synchronous matched filter demodulators.
+ */
+double sintab[] = {
+ 0.000000e+00, 7.845910e-02, 1.564345e-01, 2.334454e-01, /* 0-3 */
+ 3.090170e-01, 3.826834e-01, 4.539905e-01, 5.224986e-01, /* 4-7 */
+ 5.877853e-01, 6.494480e-01, 7.071068e-01, 7.604060e-01, /* 8-11 */
+ 8.090170e-01, 8.526402e-01, 8.910065e-01, 9.238795e-01, /* 12-15 */
+ 9.510565e-01, 9.723699e-01, 9.876883e-01, 9.969173e-01, /* 16-19 */
+ 1.000000e+00, 9.969173e-01, 9.876883e-01, 9.723699e-01, /* 20-23 */
+ 9.510565e-01, 9.238795e-01, 8.910065e-01, 8.526402e-01, /* 24-27 */
+ 8.090170e-01, 7.604060e-01, 7.071068e-01, 6.494480e-01, /* 28-31 */
+ 5.877853e-01, 5.224986e-01, 4.539905e-01, 3.826834e-01, /* 32-35 */
+ 3.090170e-01, 2.334454e-01, 1.564345e-01, 7.845910e-02, /* 36-39 */
+-0.000000e+00, -7.845910e-02, -1.564345e-01, -2.334454e-01, /* 40-43 */
+-3.090170e-01, -3.826834e-01, -4.539905e-01, -5.224986e-01, /* 44-47 */
+-5.877853e-01, -6.494480e-01, -7.071068e-01, -7.604060e-01, /* 48-51 */
+-8.090170e-01, -8.526402e-01, -8.910065e-01, -9.238795e-01, /* 52-55 */
+-9.510565e-01, -9.723699e-01, -9.876883e-01, -9.969173e-01, /* 56-59 */
+-1.000000e+00, -9.969173e-01, -9.876883e-01, -9.723699e-01, /* 60-63 */
+-9.510565e-01, -9.238795e-01, -8.910065e-01, -8.526402e-01, /* 64-67 */
+-8.090170e-01, -7.604060e-01, -7.071068e-01, -6.494480e-01, /* 68-71 */
+-5.877853e-01, -5.224986e-01, -4.539905e-01, -3.826834e-01, /* 72-75 */
+-3.090170e-01, -2.334454e-01, -1.564345e-01, -7.845910e-02, /* 76-79 */
+ 0.000000e+00}; /* 80 */
+
+/*
+ * Decoder operations at the end of each second are driven by a state
+ * machine. The transition matrix consists of a dispatch table indexed
+ * by second number. Each entry in the table contains a case switch
+ * number and argument.
+ */
+struct progx {
+ int sw; /* case switch number */
+ int arg; /* argument */
+};
+
+/*
+ * Case switch numbers
+ */
+#define IDLE 0 /* no operation */
+#define COEF 1 /* BCD bit */
+#define COEF1 2 /* BCD bit for minute unit */
+#define COEF2 3 /* BCD bit not used */
+#define DECIM9 4 /* BCD digit 0-9 */
+#define DECIM6 5 /* BCD digit 0-6 */
+#define DECIM3 6 /* BCD digit 0-3 */
+#define DECIM2 7 /* BCD digit 0-2 */
+#define MSCBIT 8 /* miscellaneous bit */
+#define MSC20 9 /* miscellaneous bit */
+#define MSC21 10 /* QSY probe channel */
+#define MIN1 11 /* latch time */
+#define MIN2 12 /* leap second */
+#define SYNC2 13 /* latch minute sync pulse */
+#define SYNC3 14 /* latch data pulse */
+
+/*
+ * Offsets in decoding matrix
+ */
+#define MN 0 /* minute digits (2) */
+#define HR 2 /* hour digits (2) */
+#define DA 4 /* day digits (3) */
+#define YR 7 /* year digits (2) */
+
+struct progx progx[] = {
+ {SYNC2, 0}, /* 0 latch minute sync pulse */
+ {SYNC3, 0}, /* 1 latch data pulse */
+ {MSCBIT, DST2}, /* 2 dst2 */
+ {MSCBIT, SECWAR}, /* 3 lw */
+ {COEF, 0}, /* 4 1 year units */
+ {COEF, 1}, /* 5 2 */
+ {COEF, 2}, /* 6 4 */
+ {COEF, 3}, /* 7 8 */
+ {DECIM9, YR}, /* 8 */
+ {IDLE, 0}, /* 9 p1 */
+ {COEF1, 0}, /* 10 1 minute units */
+ {COEF1, 1}, /* 11 2 */
+ {COEF1, 2}, /* 12 4 */
+ {COEF1, 3}, /* 13 8 */
+ {DECIM9, MN}, /* 14 */
+ {COEF, 0}, /* 15 10 minute tens */
+ {COEF, 1}, /* 16 20 */
+ {COEF, 2}, /* 17 40 */
+ {COEF2, 3}, /* 18 80 (not used) */
+ {DECIM6, MN + 1}, /* 19 p2 */
+ {COEF, 0}, /* 20 1 hour units */
+ {COEF, 1}, /* 21 2 */
+ {COEF, 2}, /* 22 4 */
+ {COEF, 3}, /* 23 8 */
+ {DECIM9, HR}, /* 24 */
+ {COEF, 0}, /* 25 10 hour tens */
+ {COEF, 1}, /* 26 20 */
+ {COEF2, 2}, /* 27 40 (not used) */
+ {COEF2, 3}, /* 28 80 (not used) */
+ {DECIM2, HR + 1}, /* 29 p3 */
+ {COEF, 0}, /* 30 1 day units */
+ {COEF, 1}, /* 31 2 */
+ {COEF, 2}, /* 32 4 */
+ {COEF, 3}, /* 33 8 */
+ {DECIM9, DA}, /* 34 */
+ {COEF, 0}, /* 35 10 day tens */
+ {COEF, 1}, /* 36 20 */
+ {COEF, 2}, /* 37 40 */
+ {COEF, 3}, /* 38 80 */
+ {DECIM9, DA + 1}, /* 39 p4 */
+ {COEF, 0}, /* 40 100 day hundreds */
+ {COEF, 1}, /* 41 200 */
+ {COEF2, 2}, /* 42 400 (not used) */
+ {COEF2, 3}, /* 43 800 (not used) */
+ {DECIM3, DA + 2}, /* 44 */
+ {IDLE, 0}, /* 45 */
+ {IDLE, 0}, /* 46 */
+ {IDLE, 0}, /* 47 */
+ {IDLE, 0}, /* 48 */
+ {IDLE, 0}, /* 49 p5 */
+ {MSCBIT, DUTS}, /* 50 dut+- */
+ {COEF, 0}, /* 51 10 year tens */
+ {COEF, 1}, /* 52 20 */
+ {COEF, 2}, /* 53 40 */
+ {COEF, 3}, /* 54 80 */
+ {MSC20, DST1}, /* 55 dst1 */
+ {MSCBIT, DUT1}, /* 56 0.1 dut */
+ {MSCBIT, DUT2}, /* 57 0.2 */
+ {MSC21, DUT4}, /* 58 0.4 QSY probe channel */
+ {MIN1, 0}, /* 59 p6 latch time */
+ {MIN2, 0} /* 60 leap second */
+};
+
+/*
+ * BCD coefficients for maximum-likelihood digit decode
+ */
+#define P15 1. /* max positive number */
+#define N15 -1. /* max negative number */
+
+/*
+ * Digits 0-9
+ */
+#define P9 (P15 / 4) /* mark (+1) */
+#define N9 (N15 / 4) /* space (-1) */
+
+double bcd9[][4] = {
+ {N9, N9, N9, N9}, /* 0 */
+ {P9, N9, N9, N9}, /* 1 */
+ {N9, P9, N9, N9}, /* 2 */
+ {P9, P9, N9, N9}, /* 3 */
+ {N9, N9, P9, N9}, /* 4 */
+ {P9, N9, P9, N9}, /* 5 */
+ {N9, P9, P9, N9}, /* 6 */
+ {P9, P9, P9, N9}, /* 7 */
+ {N9, N9, N9, P9}, /* 8 */
+ {P9, N9, N9, P9}, /* 9 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * Digits 0-6 (minute tens)
+ */
+#define P6 (P15 / 3) /* mark (+1) */
+#define N6 (N15 / 3) /* space (-1) */
+
+double bcd6[][4] = {
+ {N6, N6, N6, 0}, /* 0 */
+ {P6, N6, N6, 0}, /* 1 */
+ {N6, P6, N6, 0}, /* 2 */
+ {P6, P6, N6, 0}, /* 3 */
+ {N6, N6, P6, 0}, /* 4 */
+ {P6, N6, P6, 0}, /* 5 */
+ {N6, P6, P6, 0}, /* 6 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * Digits 0-3 (day hundreds)
+ */
+#define P3 (P15 / 2) /* mark (+1) */
+#define N3 (N15 / 2) /* space (-1) */
+
+double bcd3[][4] = {
+ {N3, N3, 0, 0}, /* 0 */
+ {P3, N3, 0, 0}, /* 1 */
+ {N3, P3, 0, 0}, /* 2 */
+ {P3, P3, 0, 0}, /* 3 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * Digits 0-2 (hour tens)
+ */
+#define P2 (P15 / 2) /* mark (+1) */
+#define N2 (N15 / 2) /* space (-1) */
+
+double bcd2[][4] = {
+ {N2, N2, 0, 0}, /* 0 */
+ {P2, N2, 0, 0}, /* 1 */
+ {N2, P2, 0, 0}, /* 2 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * DST decode (DST2 DST1) for prettyprint
+ */
+char dstcod[] = {
+ 'S', /* 00 standard time */
+ 'I', /* 01 set clock ahead at 0200 local */
+ 'O', /* 10 set clock back at 0200 local */
+ 'D' /* 11 daylight time */
+};
+
+/*
+ * The decoding matrix consists of nine row vectors, one for each digit
+ * of the timecode. The digits are stored from least to most significant
+ * order. The maximum-likelihood timecode is formed from the digits
+ * corresponding to the maximum-likelihood values reading in the
+ * opposite order: yy ddd hh:mm.
+ */
+struct decvec {
+ int radix; /* radix (3, 4, 6, 10) */
+ int digit; /* current clock digit */
+ int count; /* match count */
+ double digprb; /* max digit probability */
+ double digsnr; /* likelihood function (dB) */
+ double like[10]; /* likelihood integrator 0-9 */
+};
+
+/*
+ * The station structure (sp) is used to acquire the minute pulse from
+ * WWV and/or WWVH. These stations are distinguished by the frequency
+ * used for the second and minute sync pulses, 1000 Hz for WWV and 1200
+ * Hz for WWVH. Other than frequency, the format is the same.
+ */
+struct sync {
+ double epoch; /* accumulated epoch differences */
+ double maxeng; /* sync max energy */
+ double noieng; /* sync noise energy */
+ long pos; /* max amplitude position */
+ long lastpos; /* last max position */
+ long mepoch; /* minute synch epoch */
+
+ double amp; /* sync signal */
+ double syneng; /* sync signal max */
+ double synmax; /* sync signal max latched at 0 s */
+ double synsnr; /* sync signal SNR */
+ double metric; /* signal quality metric */
+ int reach; /* reachability register */
+ int count; /* bit counter */
+ int select; /* select bits */
+ char refid[5]; /* reference identifier */
+};
+
+/*
+ * The channel structure (cp) is used to mitigate between channels.
+ */
+struct chan {
+ int gain; /* audio gain */
+ struct sync wwv; /* wwv station */
+ struct sync wwvh; /* wwvh station */
+};
+
+/*
+ * WWV unit control structure (up)
+ */
+struct wwvunit {
+ l_fp timestamp; /* audio sample timestamp */
+ l_fp tick; /* audio sample increment */
+ double phase, freq; /* logical clock phase and frequency */
+ double monitor; /* audio monitor point */
+ double pdelay; /* propagation delay (s) */
+#ifdef ICOM
+ int fd_icom; /* ICOM file descriptor */
+#endif /* ICOM */
+ int errflg; /* error flags */
+ int watch; /* watchcat */
+
+ /*
+ * Audio codec variables
+ */
+ double comp[SIZE]; /* decompanding table */
+ int port; /* codec port */
+ int gain; /* codec gain */
+ int mongain; /* codec monitor gain */
+ int clipcnt; /* sample clipped count */
+
+ /*
+ * Variables used to establish basic system timing
+ */
+ int avgint; /* master time constant */
+ int yepoch; /* sync epoch */
+ int repoch; /* buffered sync epoch */
+ double epomax; /* second sync amplitude */
+ double eposnr; /* second sync SNR */
+ double irig; /* data I channel amplitude */
+ double qrig; /* data Q channel amplitude */
+ int datapt; /* 100 Hz ramp */
+ double datpha; /* 100 Hz VFO control */
+ int rphase; /* second sample counter */
+ long mphase; /* minute sample counter */
+
+ /*
+ * Variables used to mitigate which channel to use
+ */
+ struct chan mitig[NCHAN]; /* channel data */
+ struct sync *sptr; /* station pointer */
+ int dchan; /* data channel */
+ int schan; /* probe channel */
+ int achan; /* active channel */
+
+ /*
+ * Variables used by the clock state machine
+ */
+ struct decvec decvec[9]; /* decoding matrix */
+ int rsec; /* seconds counter */
+ int digcnt; /* count of digits synchronized */
+
+ /*
+ * Variables used to estimate signal levels and bit/digit
+ * probabilities
+ */
+ double datsig; /* data signal max */
+ double datsnr; /* data signal SNR (dB) */
+
+ /*
+ * Variables used to establish status and alarm conditions
+ */
+ int status; /* status bits */
+ int alarm; /* alarm flashers */
+ int misc; /* miscellaneous timecode bits */
+ int errcnt; /* data bit error counter */
+};
+
+/*
+ * Function prototypes
+ */
+static int wwv_start (int, struct peer *);
+static void wwv_shutdown (int, struct peer *);
+static void wwv_receive (struct recvbuf *);
+static void wwv_poll (int, struct peer *);
+
+/*
+ * More function prototypes
+ */
+static void wwv_epoch (struct peer *);
+static void wwv_rf (struct peer *, double);
+static void wwv_endpoc (struct peer *, int);
+static void wwv_rsec (struct peer *, double);
+static void wwv_qrz (struct peer *, struct sync *, int);
+static void wwv_corr4 (struct peer *, struct decvec *,
+ double [], double [][4]);
+static void wwv_gain (struct peer *);
+static void wwv_tsec (struct peer *);
+static int timecode (struct wwvunit *, char *, size_t);
+static double wwv_snr (double, double);
+static int carry (struct decvec *);
+static int wwv_newchan (struct peer *);
+static void wwv_newgame (struct peer *);
+static double wwv_metric (struct sync *);
+static void wwv_clock (struct peer *);
+#ifdef ICOM
+static int wwv_qsy (struct peer *, int);
+#endif /* ICOM */
+
+static double qsy[NCHAN] = {2.5, 5, 10, 15, 20}; /* frequencies (MHz) */
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_wwv = {
+ wwv_start, /* start up driver */
+ wwv_shutdown, /* shut down driver */
+ wwv_poll, /* transmit poll message */
+ noentry, /* not used (old wwv_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old wwv_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * wwv_start - open the devices and initialize data for processing
+ */
+static int
+wwv_start(
+ int unit, /* instance number (used by PCM) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+#ifdef ICOM
+ int temp;
+#endif /* ICOM */
+
+ /*
+ * Local variables
+ */
+ int fd; /* file descriptor */
+ int i; /* index */
+ double step; /* codec adjustment */
+
+ /*
+ * Open audio device
+ */
+ fd = audio_init(DEVICE_AUDIO, AUDIO_BUFSIZ, unit);
+ if (fd < 0)
+ return (0);
+#ifdef DEBUG
+ if (debug)
+ audio_show();
+#endif /* DEBUG */
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = wwv_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+
+ /*
+ * The companded samples are encoded sign-magnitude. The table
+ * contains all the 256 values in the interest of speed.
+ */
+ up->comp[0] = up->comp[OFFSET] = 0.;
+ up->comp[1] = 1.; up->comp[OFFSET + 1] = -1.;
+ up->comp[2] = 3.; up->comp[OFFSET + 2] = -3.;
+ step = 2.;
+ for (i = 3; i < OFFSET; i++) {
+ up->comp[i] = up->comp[i - 1] + step;
+ up->comp[OFFSET + i] = -up->comp[i];
+ if (i % 16 == 0)
+ step *= 2.;
+ }
+ DTOLFP(1. / WWV_SEC, &up->tick);
+
+ /*
+ * Initialize the decoding matrix with the radix for each digit
+ * position.
+ */
+ up->decvec[MN].radix = 10; /* minutes */
+ up->decvec[MN + 1].radix = 6;
+ up->decvec[HR].radix = 10; /* hours */
+ up->decvec[HR + 1].radix = 3;
+ up->decvec[DA].radix = 10; /* days */
+ up->decvec[DA + 1].radix = 10;
+ up->decvec[DA + 2].radix = 4;
+ up->decvec[YR].radix = 10; /* years */
+ up->decvec[YR + 1].radix = 10;
+
+#ifdef ICOM
+ /*
+ * Initialize autotune if available. Note that the ICOM select
+ * code must be less than 128, so the high order bit can be used
+ * to select the line speed 0 (9600 bps) or 1 (1200 bps). Note
+ * we don't complain if the ICOM device is not there; but, if it
+ * is, the radio better be working.
+ */
+ temp = 0;
+#ifdef DEBUG
+ if (debug > 1)
+ temp = P_TRACE;
+#endif /* DEBUG */
+ if (peer->ttl != 0) {
+ if (peer->ttl & 0x80)
+ up->fd_icom = icom_init("/dev/icom", B1200,
+ temp);
+ else
+ up->fd_icom = icom_init("/dev/icom", B9600,
+ temp);
+ }
+ if (up->fd_icom > 0) {
+ if (wwv_qsy(peer, DCHAN) != 0) {
+ msyslog(LOG_NOTICE, "icom: radio not found");
+ close(up->fd_icom);
+ up->fd_icom = 0;
+ } else {
+ msyslog(LOG_NOTICE, "icom: autotune enabled");
+ }
+ }
+#endif /* ICOM */
+
+ /*
+ * Let the games begin.
+ */
+ wwv_newgame(peer);
+ return (1);
+}
+
+
+/*
+ * wwv_shutdown - shut down the clock
+ */
+static void
+wwv_shutdown(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up == NULL)
+ return;
+
+ io_closeclock(&pp->io);
+#ifdef ICOM
+ if (up->fd_icom > 0)
+ close(up->fd_icom);
+#endif /* ICOM */
+ free(up);
+}
+
+
+/*
+ * wwv_receive - receive data from the audio device
+ *
+ * This routine reads input samples and adjusts the logical clock to
+ * track the A/D sample clock by dropping or duplicating codec samples.
+ * It also controls the A/D signal level with an AGC loop to mimimize
+ * quantization noise and avoid overload.
+ */
+static void
+wwv_receive(
+ struct recvbuf *rbufp /* receive buffer structure pointer */
+ )
+{
+ struct peer *peer;
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ /*
+ * Local variables
+ */
+ double sample; /* codec sample */
+ u_char *dpt; /* buffer pointer */
+ int bufcnt; /* buffer counter */
+ l_fp ltemp;
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Main loop - read until there ain't no more. Note codec
+ * samples are bit-inverted.
+ */
+ DTOLFP((double)rbufp->recv_length / WWV_SEC, &ltemp);
+ L_SUB(&rbufp->recv_time, &ltemp);
+ up->timestamp = rbufp->recv_time;
+ dpt = rbufp->recv_buffer;
+ for (bufcnt = 0; bufcnt < rbufp->recv_length; bufcnt++) {
+ sample = up->comp[~*dpt++ & 0xff];
+
+ /*
+ * Clip noise spikes greater than MAXAMP (6000) and
+ * record the number of clips to be used later by the
+ * AGC.
+ */
+ if (sample > MAXAMP) {
+ sample = MAXAMP;
+ up->clipcnt++;
+ } else if (sample < -MAXAMP) {
+ sample = -MAXAMP;
+ up->clipcnt++;
+ }
+
+ /*
+ * Variable frequency oscillator. The codec oscillator
+ * runs at the nominal rate of 8000 samples per second,
+ * or 125 us per sample. A frequency change of one unit
+ * results in either duplicating or deleting one sample
+ * per second, which results in a frequency change of
+ * 125 PPM.
+ */
+ up->phase += (up->freq + clock_codec) / WWV_SEC;
+ if (up->phase >= .5) {
+ up->phase -= 1.;
+ } else if (up->phase < -.5) {
+ up->phase += 1.;
+ wwv_rf(peer, sample);
+ wwv_rf(peer, sample);
+ } else {
+ wwv_rf(peer, sample);
+ }
+ L_ADD(&up->timestamp, &up->tick);
+ }
+
+ /*
+ * Set the input port and monitor gain for the next buffer.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ up->port = 2;
+ else
+ up->port = 1;
+ if (pp->sloppyclockflag & CLK_FLAG3)
+ up->mongain = MONGAIN;
+ else
+ up->mongain = 0;
+}
+
+
+/*
+ * wwv_poll - called by the transmit procedure
+ *
+ * This routine keeps track of status. If no offset samples have been
+ * processed during a poll interval, a timeout event is declared. If
+ * errors have have occurred during the interval, they are reported as
+ * well.
+ */
+static void
+wwv_poll(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->errflg)
+ refclock_report(peer, up->errflg);
+ up->errflg = 0;
+ pp->polls++;
+}
+
+
+/*
+ * wwv_rf - process signals and demodulate to baseband
+ *
+ * This routine grooms and filters decompanded raw audio samples. The
+ * output signal is the 100-Hz filtered baseband data signal in
+ * quadrature phase. The routine also determines the minute synch epoch,
+ * as well as certain signal maxima, minima and related values.
+ *
+ * There are two 1-s ramps used by this program. Both count the 8000
+ * logical clock samples spanning exactly one second. The epoch ramp
+ * counts the samples starting at an arbitrary time. The rphase ramp
+ * counts the samples starting at the 5-ms second sync pulse found
+ * during the epoch ramp.
+ *
+ * There are two 1-m ramps used by this program. The mphase ramp counts
+ * the 480,000 logical clock samples spanning exactly one minute and
+ * starting at an arbitrary time. The rsec ramp counts the 60 seconds of
+ * the minute starting at the 800-ms minute sync pulse found during the
+ * mphase ramp. The rsec ramp drives the seconds state machine to
+ * determine the bits and digits of the timecode.
+ *
+ * Demodulation operations are based on three synthesized quadrature
+ * sinusoids: 100 Hz for the data signal, 1000 Hz for the WWV sync
+ * signal and 1200 Hz for the WWVH sync signal. These drive synchronous
+ * matched filters for the data signal (170 ms at 100 Hz), WWV minute
+ * sync signal (800 ms at 1000 Hz) and WWVH minute sync signal (800 ms
+ * at 1200 Hz). Two additional matched filters are switched in
+ * as required for the WWV second sync signal (5 cycles at 1000 Hz) and
+ * WWVH second sync signal (6 cycles at 1200 Hz).
+ */
+static void
+wwv_rf(
+ struct peer *peer, /* peerstructure pointer */
+ double isig /* input signal */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct sync *sp, *rp;
+
+ static double lpf[5]; /* 150-Hz lpf delay line */
+ double data; /* lpf output */
+ static double bpf[9]; /* 1000/1200-Hz bpf delay line */
+ double syncx; /* bpf output */
+ static double mf[41]; /* 1000/1200-Hz mf delay line */
+ double mfsync; /* mf output */
+
+ static int iptr; /* data channel pointer */
+ static double ibuf[DATSIZ]; /* data I channel delay line */
+ static double qbuf[DATSIZ]; /* data Q channel delay line */
+
+ static int jptr; /* sync channel pointer */
+ static int kptr; /* tick channel pointer */
+
+ static int csinptr; /* wwv channel phase */
+ static double cibuf[SYNSIZ]; /* wwv I channel delay line */
+ static double cqbuf[SYNSIZ]; /* wwv Q channel delay line */
+ static double ciamp; /* wwv I channel amplitude */
+ static double cqamp; /* wwv Q channel amplitude */
+
+ static double csibuf[TCKSIZ]; /* wwv I tick delay line */
+ static double csqbuf[TCKSIZ]; /* wwv Q tick delay line */
+ static double csiamp; /* wwv I tick amplitude */
+ static double csqamp; /* wwv Q tick amplitude */
+
+ static int hsinptr; /* wwvh channel phase */
+ static double hibuf[SYNSIZ]; /* wwvh I channel delay line */
+ static double hqbuf[SYNSIZ]; /* wwvh Q channel delay line */
+ static double hiamp; /* wwvh I channel amplitude */
+ static double hqamp; /* wwvh Q channel amplitude */
+
+ static double hsibuf[TCKSIZ]; /* wwvh I tick delay line */
+ static double hsqbuf[TCKSIZ]; /* wwvh Q tick delay line */
+ static double hsiamp; /* wwvh I tick amplitude */
+ static double hsqamp; /* wwvh Q tick amplitude */
+
+ static double epobuf[WWV_SEC]; /* second sync comb filter */
+ static double epomax, nxtmax; /* second sync amplitude buffer */
+ static int epopos; /* epoch second sync position buffer */
+
+ static int iniflg; /* initialization flag */
+ int epoch; /* comb filter index */
+ double dtemp;
+ int i;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (!iniflg) {
+ iniflg = 1;
+ memset((char *)lpf, 0, sizeof(lpf));
+ memset((char *)bpf, 0, sizeof(bpf));
+ memset((char *)mf, 0, sizeof(mf));
+ memset((char *)ibuf, 0, sizeof(ibuf));
+ memset((char *)qbuf, 0, sizeof(qbuf));
+ memset((char *)cibuf, 0, sizeof(cibuf));
+ memset((char *)cqbuf, 0, sizeof(cqbuf));
+ memset((char *)csibuf, 0, sizeof(csibuf));
+ memset((char *)csqbuf, 0, sizeof(csqbuf));
+ memset((char *)hibuf, 0, sizeof(hibuf));
+ memset((char *)hqbuf, 0, sizeof(hqbuf));
+ memset((char *)hsibuf, 0, sizeof(hsibuf));
+ memset((char *)hsqbuf, 0, sizeof(hsqbuf));
+ memset((char *)epobuf, 0, sizeof(epobuf));
+ }
+
+ /*
+ * Baseband data demodulation. The 100-Hz subcarrier is
+ * extracted using a 150-Hz IIR lowpass filter. This attenuates
+ * the 1000/1200-Hz sync signals, as well as the 440-Hz and
+ * 600-Hz tones and most of the noise and voice modulation
+ * components.
+ *
+ * The subcarrier is transmitted 10 dB down from the carrier.
+ * The DGAIN parameter can be adjusted for this and to
+ * compensate for the radio audio response at 100 Hz.
+ *
+ * Matlab IIR 4th-order IIR elliptic, 150 Hz lowpass, 0.2 dB
+ * passband ripple, -50 dB stopband ripple, phase delay 0.97 ms.
+ */
+ data = (lpf[4] = lpf[3]) * 8.360961e-01;
+ data += (lpf[3] = lpf[2]) * -3.481740e+00;
+ data += (lpf[2] = lpf[1]) * 5.452988e+00;
+ data += (lpf[1] = lpf[0]) * -3.807229e+00;
+ lpf[0] = isig * DGAIN - data;
+ data = lpf[0] * 3.281435e-03
+ + lpf[1] * -1.149947e-02
+ + lpf[2] * 1.654858e-02
+ + lpf[3] * -1.149947e-02
+ + lpf[4] * 3.281435e-03;
+
+ /*
+ * The 100-Hz data signal is demodulated using a pair of
+ * quadrature multipliers, matched filters and a phase lock
+ * loop. The I and Q quadrature data signals are produced by
+ * multiplying the filtered signal by 100-Hz sine and cosine
+ * signals, respectively. The signals are processed by 170-ms
+ * synchronous matched filters to produce the amplitude and
+ * phase signals used by the demodulator. The signals are scaled
+ * to produce unit energy at the maximum value.
+ */
+ i = up->datapt;
+ up->datapt = (up->datapt + IN100) % 80;
+ dtemp = sintab[i] * data / (MS / 2. * DATCYC);
+ up->irig -= ibuf[iptr];
+ ibuf[iptr] = dtemp;
+ up->irig += dtemp;
+
+ i = (i + 20) % 80;
+ dtemp = sintab[i] * data / (MS / 2. * DATCYC);
+ up->qrig -= qbuf[iptr];
+ qbuf[iptr] = dtemp;
+ up->qrig += dtemp;
+ iptr = (iptr + 1) % DATSIZ;
+
+ /*
+ * Baseband sync demodulation. The 1000/1200 sync signals are
+ * extracted using a 600-Hz IIR bandpass filter. This removes
+ * the 100-Hz data subcarrier, as well as the 440-Hz and 600-Hz
+ * tones and most of the noise and voice modulation components.
+ *
+ * Matlab 4th-order IIR elliptic, 800-1400 Hz bandpass, 0.2 dB
+ * passband ripple, -50 dB stopband ripple, phase delay 0.91 ms.
+ */
+ syncx = (bpf[8] = bpf[7]) * 4.897278e-01;
+ syncx += (bpf[7] = bpf[6]) * -2.765914e+00;
+ syncx += (bpf[6] = bpf[5]) * 8.110921e+00;
+ syncx += (bpf[5] = bpf[4]) * -1.517732e+01;
+ syncx += (bpf[4] = bpf[3]) * 1.975197e+01;
+ syncx += (bpf[3] = bpf[2]) * -1.814365e+01;
+ syncx += (bpf[2] = bpf[1]) * 1.159783e+01;
+ syncx += (bpf[1] = bpf[0]) * -4.735040e+00;
+ bpf[0] = isig - syncx;
+ syncx = bpf[0] * 8.203628e-03
+ + bpf[1] * -2.375732e-02
+ + bpf[2] * 3.353214e-02
+ + bpf[3] * -4.080258e-02
+ + bpf[4] * 4.605479e-02
+ + bpf[5] * -4.080258e-02
+ + bpf[6] * 3.353214e-02
+ + bpf[7] * -2.375732e-02
+ + bpf[8] * 8.203628e-03;
+
+ /*
+ * The 1000/1200 sync signals are demodulated using a pair of
+ * quadrature multipliers and matched filters. However,
+ * synchronous demodulation at these frequencies is impractical,
+ * so only the signal amplitude is used. The I and Q quadrature
+ * sync signals are produced by multiplying the filtered signal
+ * by 1000-Hz (WWV) and 1200-Hz (WWVH) sine and cosine signals,
+ * respectively. The WWV and WWVH signals are processed by 800-
+ * ms synchronous matched filters and combined to produce the
+ * minute sync signal and detect which one (or both) the WWV or
+ * WWVH signal is present. The WWV and WWVH signals are also
+ * processed by 5-ms synchronous matched filters and combined to
+ * produce the second sync signal. The signals are scaled to
+ * produce unit energy at the maximum value.
+ *
+ * Note the master timing ramps, which run continuously. The
+ * minute counter (mphase) counts the samples in the minute,
+ * while the second counter (epoch) counts the samples in the
+ * second.
+ */
+ up->mphase = (up->mphase + 1) % WWV_MIN;
+ epoch = up->mphase % WWV_SEC;
+
+ /*
+ * WWV
+ */
+ i = csinptr;
+ csinptr = (csinptr + IN1000) % 80;
+
+ dtemp = sintab[i] * syncx / (MS / 2.);
+ ciamp -= cibuf[jptr];
+ cibuf[jptr] = dtemp;
+ ciamp += dtemp;
+ csiamp -= csibuf[kptr];
+ csibuf[kptr] = dtemp;
+ csiamp += dtemp;
+
+ i = (i + 20) % 80;
+ dtemp = sintab[i] * syncx / (MS / 2.);
+ cqamp -= cqbuf[jptr];
+ cqbuf[jptr] = dtemp;
+ cqamp += dtemp;
+ csqamp -= csqbuf[kptr];
+ csqbuf[kptr] = dtemp;
+ csqamp += dtemp;
+
+ sp = &up->mitig[up->achan].wwv;
+ sp->amp = sqrt(ciamp * ciamp + cqamp * cqamp) / SYNCYC;
+ if (!(up->status & MSYNC))
+ wwv_qrz(peer, sp, (int)(pp->fudgetime1 * WWV_SEC));
+
+ /*
+ * WWVH
+ */
+ i = hsinptr;
+ hsinptr = (hsinptr + IN1200) % 80;
+
+ dtemp = sintab[i] * syncx / (MS / 2.);
+ hiamp -= hibuf[jptr];
+ hibuf[jptr] = dtemp;
+ hiamp += dtemp;
+ hsiamp -= hsibuf[kptr];
+ hsibuf[kptr] = dtemp;
+ hsiamp += dtemp;
+
+ i = (i + 20) % 80;
+ dtemp = sintab[i] * syncx / (MS / 2.);
+ hqamp -= hqbuf[jptr];
+ hqbuf[jptr] = dtemp;
+ hqamp += dtemp;
+ hsqamp -= hsqbuf[kptr];
+ hsqbuf[kptr] = dtemp;
+ hsqamp += dtemp;
+
+ rp = &up->mitig[up->achan].wwvh;
+ rp->amp = sqrt(hiamp * hiamp + hqamp * hqamp) / SYNCYC;
+ if (!(up->status & MSYNC))
+ wwv_qrz(peer, rp, (int)(pp->fudgetime2 * WWV_SEC));
+ jptr = (jptr + 1) % SYNSIZ;
+ kptr = (kptr + 1) % TCKSIZ;
+
+ /*
+ * The following section is called once per minute. It does
+ * housekeeping and timeout functions and empties the dustbins.
+ */
+ if (up->mphase == 0) {
+ up->watch++;
+ if (!(up->status & MSYNC)) {
+
+ /*
+ * If minute sync has not been acquired before
+ * ACQSN timeout (6 min), or if no signal is
+ * heard, the program cycles to the next
+ * frequency and tries again.
+ */
+ if (!wwv_newchan(peer))
+ up->watch = 0;
+ } else {
+
+ /*
+ * If the leap bit is set, set the minute epoch
+ * back one second so the station processes
+ * don't miss a beat.
+ */
+ if (up->status & LEPSEC) {
+ up->mphase -= WWV_SEC;
+ if (up->mphase < 0)
+ up->mphase += WWV_MIN;
+ }
+ }
+ }
+
+ /*
+ * When the channel metric reaches threshold and the second
+ * counter matches the minute epoch within the second, the
+ * driver has synchronized to the station. The second number is
+ * the remaining seconds until the next minute epoch, while the
+ * sync epoch is zero. Watch out for the first second; if
+ * already synchronized to the second, the buffered sync epoch
+ * must be set.
+ *
+ * Note the guard interval is 200 ms; if for some reason the
+ * clock drifts more than that, it might wind up in the wrong
+ * second. If the maximum frequency error is not more than about
+ * 1 PPM, the clock can go as much as two days while still in
+ * the same second.
+ */
+ if (up->status & MSYNC) {
+ wwv_epoch(peer);
+ } else if (up->sptr != NULL) {
+ sp = up->sptr;
+ if (sp->metric >= TTHR && epoch == sp->mepoch % WWV_SEC)
+ {
+ up->rsec = (60 - sp->mepoch / WWV_SEC) % 60;
+ up->rphase = 0;
+ up->status |= MSYNC;
+ up->watch = 0;
+ if (!(up->status & SSYNC))
+ up->repoch = up->yepoch = epoch;
+ else
+ up->repoch = up->yepoch;
+
+ }
+ }
+
+ /*
+ * The second sync pulse is extracted using 5-ms (40 sample) FIR
+ * matched filters at 1000 Hz for WWV or 1200 Hz for WWVH. This
+ * pulse is used for the most precise synchronization, since if
+ * provides a resolution of one sample (125 us). The filters run
+ * only if the station has been reliably determined.
+ */
+ if (up->status & SELV)
+ mfsync = sqrt(csiamp * csiamp + csqamp * csqamp) /
+ TCKCYC;
+ else if (up->status & SELH)
+ mfsync = sqrt(hsiamp * hsiamp + hsqamp * hsqamp) /
+ TCKCYC;
+ else
+ mfsync = 0;
+
+ /*
+ * Enhance the seconds sync pulse using a 1-s (8000-sample) comb
+ * filter. Correct for the FIR matched filter delay, which is 5
+ * ms for both the WWV and WWVH filters, and also for the
+ * propagation delay. Once each second look for second sync. If
+ * not in minute sync, fiddle the codec gain. Note the SNR is
+ * computed from the maximum sample and the envelope of the
+ * sample 6 ms before it, so if we slip more than a cycle the
+ * SNR should plummet. The signal is scaled to produce unit
+ * energy at the maximum value.
+ */
+ dtemp = (epobuf[epoch] += (mfsync - epobuf[epoch]) /
+ up->avgint);
+ if (dtemp > epomax) {
+ int j;
+
+ epomax = dtemp;
+ epopos = epoch;
+ j = epoch - 6 * MS;
+ if (j < 0)
+ j += WWV_SEC;
+ nxtmax = fabs(epobuf[j]);
+ }
+ if (epoch == 0) {
+ up->epomax = epomax;
+ up->eposnr = wwv_snr(epomax, nxtmax);
+ epopos -= TCKCYC * MS;
+ if (epopos < 0)
+ epopos += WWV_SEC;
+ wwv_endpoc(peer, epopos);
+ if (!(up->status & SSYNC))
+ up->alarm |= SYNERR;
+ epomax = 0;
+ if (!(up->status & MSYNC))
+ wwv_gain(peer);
+ }
+}
+
+
+/*
+ * wwv_qrz - identify and acquire WWV/WWVH minute sync pulse
+ *
+ * This routine implements a virtual station process used to acquire
+ * minute sync and to mitigate among the ten frequency and station
+ * combinations. During minute sync acquisition the process probes each
+ * frequency and station in turn for the minute pulse, which
+ * involves searching through the entire 480,000-sample minute. The
+ * process finds the maximum signal and RMS noise plus signal. Then, the
+ * actual noise is determined by subtracting the energy of the matched
+ * filter.
+ *
+ * Students of radar receiver technology will discover this algorithm
+ * amounts to a range-gate discriminator. A valid pulse must have peak
+ * amplitude at least QTHR (2500) and SNR at least QSNR (20) dB and the
+ * difference between the current and previous epoch must be less than
+ * AWND (20 ms). Note that the discriminator peak occurs about 800 ms
+ * into the second, so the timing is retarded to the previous second
+ * epoch.
+ */
+static void
+wwv_qrz(
+ struct peer *peer, /* peer structure pointer */
+ struct sync *sp, /* sync channel structure */
+ int pdelay /* propagation delay (samples) */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ char tbuf[TBUF]; /* monitor buffer */
+ long epoch;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Find the sample with peak amplitude, which defines the minute
+ * epoch. Accumulate all samples to determine the total noise
+ * energy.
+ */
+ epoch = up->mphase - pdelay - SYNSIZ;
+ if (epoch < 0)
+ epoch += WWV_MIN;
+ if (sp->amp > sp->maxeng) {
+ sp->maxeng = sp->amp;
+ sp->pos = epoch;
+ }
+ sp->noieng += sp->amp;
+
+ /*
+ * At the end of the minute, determine the epoch of the minute
+ * sync pulse, as well as the difference between the current and
+ * previous epoches due to the intrinsic frequency error plus
+ * jitter. When calculating the SNR, subtract the pulse energy
+ * from the total noise energy and then normalize.
+ */
+ if (up->mphase == 0) {
+ sp->synmax = sp->maxeng;
+ sp->synsnr = wwv_snr(sp->synmax, (sp->noieng -
+ sp->synmax) / WWV_MIN);
+ if (sp->count == 0)
+ sp->lastpos = sp->pos;
+ epoch = (sp->pos - sp->lastpos) % WWV_MIN;
+ sp->reach <<= 1;
+ if (sp->reach & (1 << AMAX))
+ sp->count--;
+ if (sp->synmax > ATHR && sp->synsnr > ASNR) {
+ if (abs(epoch) < AWND * MS) {
+ sp->reach |= 1;
+ sp->count++;
+ sp->mepoch = sp->lastpos = sp->pos;
+ } else if (sp->count == 1) {
+ sp->lastpos = sp->pos;
+ }
+ }
+ if (up->watch > ACQSN)
+ sp->metric = 0;
+ else
+ sp->metric = wwv_metric(sp);
+ if (pp->sloppyclockflag & CLK_FLAG4) {
+ snprintf(tbuf, sizeof(tbuf),
+ "wwv8 %04x %3d %s %04x %.0f %.0f/%.1f %ld %ld",
+ up->status, up->gain, sp->refid,
+ sp->reach & 0xffff, sp->metric, sp->synmax,
+ sp->synsnr, sp->pos % WWV_SEC, epoch);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+ sp->maxeng = sp->noieng = 0;
+ }
+}
+
+
+/*
+ * wwv_endpoc - identify and acquire second sync pulse
+ *
+ * This routine is called at the end of the second sync interval. It
+ * determines the second sync epoch position within the second and
+ * disciplines the sample clock using a frequency-lock loop (FLL).
+ *
+ * Second sync is determined in the RF input routine as the maximum
+ * over all 8000 samples in the second comb filter. To assure accurate
+ * and reliable time and frequency discipline, this routine performs a
+ * great deal of heavy-handed heuristic data filtering and grooming.
+ */
+static void
+wwv_endpoc(
+ struct peer *peer, /* peer structure pointer */
+ int epopos /* epoch max position */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ static int epoch_mf[3]; /* epoch median filter */
+ static int tepoch; /* current second epoch */
+ static int xepoch; /* last second epoch */
+ static int zepoch; /* last run epoch */
+ static int zcount; /* last run end time */
+ static int scount; /* seconds counter */
+ static int syncnt; /* run length counter */
+ static int maxrun; /* longest run length */
+ static int mepoch; /* longest run end epoch */
+ static int mcount; /* longest run end time */
+ static int avgcnt; /* averaging interval counter */
+ static int avginc; /* averaging ratchet */
+ static int iniflg; /* initialization flag */
+ char tbuf[TBUF]; /* monitor buffer */
+ double dtemp;
+ int tmp2;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (!iniflg) {
+ iniflg = 1;
+ ZERO(epoch_mf);
+ }
+
+ /*
+ * If the signal amplitude or SNR fall below thresholds, dim the
+ * second sync lamp and wait for hotter ions. If no stations are
+ * heard, we are either in a probe cycle or the ions are really
+ * cold.
+ */
+ scount++;
+ if (up->epomax < STHR || up->eposnr < SSNR) {
+ up->status &= ~(SSYNC | FGATE);
+ avgcnt = syncnt = maxrun = 0;
+ return;
+ }
+ if (!(up->status & (SELV | SELH)))
+ return;
+
+ /*
+ * A three-stage median filter is used to help denoise the
+ * second sync pulse. The median sample becomes the candidate
+ * epoch.
+ */
+ epoch_mf[2] = epoch_mf[1];
+ epoch_mf[1] = epoch_mf[0];
+ epoch_mf[0] = epopos;
+ if (epoch_mf[0] > epoch_mf[1]) {
+ if (epoch_mf[1] > epoch_mf[2])
+ tepoch = epoch_mf[1]; /* 0 1 2 */
+ else if (epoch_mf[2] > epoch_mf[0])
+ tepoch = epoch_mf[0]; /* 2 0 1 */
+ else
+ tepoch = epoch_mf[2]; /* 0 2 1 */
+ } else {
+ if (epoch_mf[1] < epoch_mf[2])
+ tepoch = epoch_mf[1]; /* 2 1 0 */
+ else if (epoch_mf[2] < epoch_mf[0])
+ tepoch = epoch_mf[0]; /* 1 0 2 */
+ else
+ tepoch = epoch_mf[2]; /* 1 2 0 */
+ }
+
+
+ /*
+ * If the epoch candidate is the same as the last one, increment
+ * the run counter. If not, save the length, epoch and end
+ * time of the current run for use later and reset the counter.
+ * The epoch is considered valid if the run is at least SCMP
+ * (10) s, the minute is synchronized and the interval since the
+ * last epoch is not greater than the averaging interval. Thus,
+ * after a long absence, the program will wait a full averaging
+ * interval while the comb filter charges up and noise
+ * dissapates..
+ */
+ tmp2 = (tepoch - xepoch) % WWV_SEC;
+ if (tmp2 == 0) {
+ syncnt++;
+ if (syncnt > SCMP && up->status & MSYNC && (up->status &
+ FGATE || scount - zcount <= up->avgint)) {
+ up->status |= SSYNC;
+ up->yepoch = tepoch;
+ }
+ } else if (syncnt >= maxrun) {
+ maxrun = syncnt;
+ mcount = scount;
+ mepoch = xepoch;
+ syncnt = 0;
+ }
+ if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
+ MSYNC)) {
+ snprintf(tbuf, sizeof(tbuf),
+ "wwv1 %04x %3d %4d %5.0f %5.1f %5d %4d %4d %4d",
+ up->status, up->gain, tepoch, up->epomax,
+ up->eposnr, tmp2, avgcnt, syncnt,
+ maxrun);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+ avgcnt++;
+ if (avgcnt < up->avgint) {
+ xepoch = tepoch;
+ return;
+ }
+
+ /*
+ * The sample clock frequency is disciplined using a first-order
+ * feedback loop with time constant consistent with the Allan
+ * intercept of typical computer clocks. During each averaging
+ * interval the candidate epoch at the end of the longest run is
+ * determined. If the longest run is zero, all epoches in the
+ * interval are different, so the candidate epoch is the current
+ * epoch. The frequency update is computed from the candidate
+ * epoch difference (125-us units) and time difference (seconds)
+ * between updates.
+ */
+ if (syncnt >= maxrun) {
+ maxrun = syncnt;
+ mcount = scount;
+ mepoch = xepoch;
+ }
+ xepoch = tepoch;
+ if (maxrun == 0) {
+ mepoch = tepoch;
+ mcount = scount;
+ }
+
+ /*
+ * The master clock runs at the codec sample frequency of 8000
+ * Hz, so the intrinsic time resolution is 125 us. The frequency
+ * resolution ranges from 18 PPM at the minimum averaging
+ * interval of 8 s to 0.12 PPM at the maximum interval of 1024
+ * s. An offset update is determined at the end of the longest
+ * run in each averaging interval. The frequency adjustment is
+ * computed from the difference between offset updates and the
+ * interval between them.
+ *
+ * The maximum frequency adjustment ranges from 187 PPM at the
+ * minimum interval to 1.5 PPM at the maximum. If the adjustment
+ * exceeds the maximum, the update is discarded and the
+ * hysteresis counter is decremented. Otherwise, the frequency
+ * is incremented by the adjustment, but clamped to the maximum
+ * 187.5 PPM. If the update is less than half the maximum, the
+ * hysteresis counter is incremented. If the counter increments
+ * to +3, the averaging interval is doubled and the counter set
+ * to zero; if it decrements to -3, the interval is halved and
+ * the counter set to zero.
+ */
+ dtemp = (mepoch - zepoch) % WWV_SEC;
+ if (up->status & FGATE) {
+ if (abs(dtemp) < MAXFREQ * MINAVG) {
+ up->freq += (dtemp / 2.) / ((mcount - zcount) *
+ FCONST);
+ if (up->freq > MAXFREQ)
+ up->freq = MAXFREQ;
+ else if (up->freq < -MAXFREQ)
+ up->freq = -MAXFREQ;
+ if (abs(dtemp) < MAXFREQ * MINAVG / 2.) {
+ if (avginc < 3) {
+ avginc++;
+ } else {
+ if (up->avgint < MAXAVG) {
+ up->avgint <<= 1;
+ avginc = 0;
+ }
+ }
+ }
+ } else {
+ if (avginc > -3) {
+ avginc--;
+ } else {
+ if (up->avgint > MINAVG) {
+ up->avgint >>= 1;
+ avginc = 0;
+ }
+ }
+ }
+ }
+ if (pp->sloppyclockflag & CLK_FLAG4) {
+ snprintf(tbuf, sizeof(tbuf),
+ "wwv2 %04x %5.0f %5.1f %5d %4d %4d %4d %4.0f %7.2f",
+ up->status, up->epomax, up->eposnr, mepoch,
+ up->avgint, maxrun, mcount - zcount, dtemp,
+ up->freq * 1e6 / WWV_SEC);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+
+ /*
+ * This is a valid update; set up for the next interval.
+ */
+ up->status |= FGATE;
+ zepoch = mepoch;
+ zcount = mcount;
+ avgcnt = syncnt = maxrun = 0;
+}
+
+
+/*
+ * wwv_epoch - epoch scanner
+ *
+ * This routine extracts data signals from the 100-Hz subcarrier. It
+ * scans the receiver second epoch to determine the signal amplitudes
+ * and pulse timings. Receiver synchronization is determined by the
+ * minute sync pulse detected in the wwv_rf() routine and the second
+ * sync pulse detected in the wwv_epoch() routine. The transmitted
+ * signals are delayed by the propagation delay, receiver delay and
+ * filter delay of this program. Delay corrections are introduced
+ * separately for WWV and WWVH.
+ *
+ * Most communications radios use a highpass filter in the audio stages,
+ * which can do nasty things to the subcarrier phase relative to the
+ * sync pulses. Therefore, the data subcarrier reference phase is
+ * disciplined using the hardlimited quadrature-phase signal sampled at
+ * the same time as the in-phase signal. The phase tracking loop uses
+ * phase adjustments of plus-minus one sample (125 us).
+ */
+static void
+wwv_epoch(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct chan *cp;
+ static double sigmin, sigzer, sigone, engmax, engmin;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Find the maximum minute sync pulse energy for both the
+ * WWV and WWVH stations. This will be used later for channel
+ * and station mitigation. Also set the seconds epoch at 800 ms
+ * well before the end of the second to make sure we never set
+ * the epoch backwards.
+ */
+ cp = &up->mitig[up->achan];
+ if (cp->wwv.amp > cp->wwv.syneng)
+ cp->wwv.syneng = cp->wwv.amp;
+ if (cp->wwvh.amp > cp->wwvh.syneng)
+ cp->wwvh.syneng = cp->wwvh.amp;
+ if (up->rphase == 800 * MS)
+ up->repoch = up->yepoch;
+
+ /*
+ * Use the signal amplitude at epoch 15 ms as the noise floor.
+ * This gives a guard time of +-15 ms from the beginning of the
+ * second until the second pulse rises at 30 ms. There is a
+ * compromise here; we want to delay the sample as long as
+ * possible to give the radio time to change frequency and the
+ * AGC to stabilize, but as early as possible if the second
+ * epoch is not exact.
+ */
+ if (up->rphase == 15 * MS)
+ sigmin = sigzer = sigone = up->irig;
+
+ /*
+ * Latch the data signal at 200 ms. Keep this around until the
+ * end of the second. Use the signal energy as the peak to
+ * compute the SNR. Use the Q sample to adjust the 100-Hz
+ * reference oscillator phase.
+ */
+ if (up->rphase == 200 * MS) {
+ sigzer = up->irig;
+ engmax = sqrt(up->irig * up->irig + up->qrig *
+ up->qrig);
+ up->datpha = up->qrig / up->avgint;
+ if (up->datpha >= 0) {
+ up->datapt++;
+ if (up->datapt >= 80)
+ up->datapt -= 80;
+ } else {
+ up->datapt--;
+ if (up->datapt < 0)
+ up->datapt += 80;
+ }
+ }
+
+
+ /*
+ * Latch the data signal at 500 ms. Keep this around until the
+ * end of the second.
+ */
+ else if (up->rphase == 500 * MS)
+ sigone = up->irig;
+
+ /*
+ * At the end of the second crank the clock state machine and
+ * adjust the codec gain. Note the epoch is buffered from the
+ * center of the second in order to avoid jitter while the
+ * seconds synch is diddling the epoch. Then, determine the true
+ * offset and update the median filter in the driver interface.
+ *
+ * Use the energy at the end of the second as the noise to
+ * compute the SNR for the data pulse. This gives a better
+ * measurement than the beginning of the second, especially when
+ * returning from the probe channel. This gives a guard time of
+ * 30 ms from the decay of the longest pulse to the rise of the
+ * next pulse.
+ */
+ up->rphase++;
+ if (up->mphase % WWV_SEC == up->repoch) {
+ up->status &= ~(DGATE | BGATE);
+ engmin = sqrt(up->irig * up->irig + up->qrig *
+ up->qrig);
+ up->datsig = engmax;
+ up->datsnr = wwv_snr(engmax, engmin);
+
+ /*
+ * If the amplitude or SNR is below threshold, average a
+ * 0 in the the integrators; otherwise, average the
+ * bipolar signal. This is done to avoid noise polution.
+ */
+ if (engmax < DTHR || up->datsnr < DSNR) {
+ up->status |= DGATE;
+ wwv_rsec(peer, 0);
+ } else {
+ sigzer -= sigone;
+ sigone -= sigmin;
+ wwv_rsec(peer, sigone - sigzer);
+ }
+ if (up->status & (DGATE | BGATE))
+ up->errcnt++;
+ if (up->errcnt > MAXERR)
+ up->alarm |= LOWERR;
+ wwv_gain(peer);
+ cp = &up->mitig[up->achan];
+ cp->wwv.syneng = 0;
+ cp->wwvh.syneng = 0;
+ up->rphase = 0;
+ }
+}
+
+
+/*
+ * wwv_rsec - process receiver second
+ *
+ * This routine is called at the end of each receiver second to
+ * implement the per-second state machine. The machine assembles BCD
+ * digit bits, decodes miscellaneous bits and dances the leap seconds.
+ *
+ * Normally, the minute has 60 seconds numbered 0-59. If the leap
+ * warning bit is set, the last minute (1439) of 30 June (day 181 or 182
+ * for leap years) or 31 December (day 365 or 366 for leap years) is
+ * augmented by one second numbered 60. This is accomplished by
+ * extending the minute interval by one second and teaching the state
+ * machine to ignore it.
+ */
+static void
+wwv_rsec(
+ struct peer *peer, /* peer structure pointer */
+ double bit
+ )
+{
+ static int iniflg; /* initialization flag */
+ static double bcddld[4]; /* BCD data bits */
+ static double bitvec[61]; /* bit integrator for misc bits */
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct chan *cp;
+ struct sync *sp, *rp;
+ char tbuf[TBUF]; /* monitor buffer */
+ int sw, arg, nsec;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (!iniflg) {
+ iniflg = 1;
+ ZERO(bitvec);
+ }
+
+ /*
+ * The bit represents the probability of a hit on zero (negative
+ * values), a hit on one (positive values) or a miss (zero
+ * value). The likelihood vector is the exponential average of
+ * these probabilities. Only the bits of this vector
+ * corresponding to the miscellaneous bits of the timecode are
+ * used, but it's easier to do them all. After that, crank the
+ * seconds state machine.
+ */
+ nsec = up->rsec;
+ up->rsec++;
+ bitvec[nsec] += (bit - bitvec[nsec]) / TCONST;
+ sw = progx[nsec].sw;
+ arg = progx[nsec].arg;
+
+ /*
+ * The minute state machine. Fly off to a particular section as
+ * directed by the transition matrix and second number.
+ */
+ switch (sw) {
+
+ /*
+ * Ignore this second.
+ */
+ case IDLE: /* 9, 45-49 */
+ break;
+
+ /*
+ * Probe channel stuff
+ *
+ * The WWV/H format contains data pulses in second 59 (position
+ * identifier) and second 1, but not in second 0. The minute
+ * sync pulse is contained in second 0. At the end of second 58
+ * QSY to the probe channel, which rotates in turn over all
+ * WWV/H frequencies. At the end of second 0 measure the minute
+ * sync pulse. At the end of second 1 measure the data pulse and
+ * QSY back to the data channel. Note that the actions commented
+ * here happen at the end of the second numbered as shown.
+ *
+ * At the end of second 0 save the minute sync amplitude latched
+ * at 800 ms as the signal later used to calculate the SNR.
+ */
+ case SYNC2: /* 0 */
+ cp = &up->mitig[up->achan];
+ cp->wwv.synmax = cp->wwv.syneng;
+ cp->wwvh.synmax = cp->wwvh.syneng;
+ break;
+
+ /*
+ * At the end of second 1 use the minute sync amplitude latched
+ * at 800 ms as the noise to calculate the SNR. If the minute
+ * sync pulse and SNR are above thresholds and the data pulse
+ * amplitude and SNR are above thresolds, shift a 1 into the
+ * station reachability register; otherwise, shift a 0. The
+ * number of 1 bits in the last six intervals is a component of
+ * the channel metric computed by the wwv_metric() routine.
+ * Finally, QSY back to the data channel.
+ */
+ case SYNC3: /* 1 */
+ cp = &up->mitig[up->achan];
+
+ /*
+ * WWV station
+ */
+ sp = &cp->wwv;
+ sp->synsnr = wwv_snr(sp->synmax, sp->amp);
+ sp->reach <<= 1;
+ if (sp->reach & (1 << AMAX))
+ sp->count--;
+ if (sp->synmax >= QTHR && sp->synsnr >= QSNR &&
+ !(up->status & (DGATE | BGATE))) {
+ sp->reach |= 1;
+ sp->count++;
+ }
+ sp->metric = wwv_metric(sp);
+
+ /*
+ * WWVH station
+ */
+ rp = &cp->wwvh;
+ rp->synsnr = wwv_snr(rp->synmax, rp->amp);
+ rp->reach <<= 1;
+ if (rp->reach & (1 << AMAX))
+ rp->count--;
+ if (rp->synmax >= QTHR && rp->synsnr >= QSNR &&
+ !(up->status & (DGATE | BGATE))) {
+ rp->reach |= 1;
+ rp->count++;
+ }
+ rp->metric = wwv_metric(rp);
+ if (pp->sloppyclockflag & CLK_FLAG4) {
+ snprintf(tbuf, sizeof(tbuf),
+ "wwv5 %04x %3d %4d %.0f/%.1f %.0f/%.1f %s %04x %.0f %.0f/%.1f %s %04x %.0f %.0f/%.1f",
+ up->status, up->gain, up->yepoch,
+ up->epomax, up->eposnr, up->datsig,
+ up->datsnr,
+ sp->refid, sp->reach & 0xffff,
+ sp->metric, sp->synmax, sp->synsnr,
+ rp->refid, rp->reach & 0xffff,
+ rp->metric, rp->synmax, rp->synsnr);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+ up->errcnt = up->digcnt = up->alarm = 0;
+
+ /*
+ * If synchronized to a station, restart if no stations
+ * have been heard within the PANIC timeout (2 days). If
+ * not and the minute digit has been found, restart if
+ * not synchronized withing the SYNCH timeout (40 m). If
+ * not, restart if the unit digit has not been found
+ * within the DATA timeout (15 m).
+ */
+ if (up->status & INSYNC) {
+ if (up->watch > PANIC) {
+ wwv_newgame(peer);
+ return;
+ }
+ } else if (up->status & DSYNC) {
+ if (up->watch > SYNCH) {
+ wwv_newgame(peer);
+ return;
+ }
+ } else if (up->watch > DATA) {
+ wwv_newgame(peer);
+ return;
+ }
+ wwv_newchan(peer);
+ break;
+
+ /*
+ * Save the bit probability in the BCD data vector at the index
+ * given by the argument. Bits not used in the digit are forced
+ * to zero.
+ */
+ case COEF1: /* 4-7 */
+ bcddld[arg] = bit;
+ break;
+
+ case COEF: /* 10-13, 15-17, 20-23, 25-26,
+ 30-33, 35-38, 40-41, 51-54 */
+ if (up->status & DSYNC)
+ bcddld[arg] = bit;
+ else
+ bcddld[arg] = 0;
+ break;
+
+ case COEF2: /* 18, 27-28, 42-43 */
+ bcddld[arg] = 0;
+ break;
+
+ /*
+ * Correlate coefficient vector with each valid digit vector and
+ * save in decoding matrix. We step through the decoding matrix
+ * digits correlating each with the coefficients and saving the
+ * greatest and the next lower for later SNR calculation.
+ */
+ case DECIM2: /* 29 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd2);
+ break;
+
+ case DECIM3: /* 44 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd3);
+ break;
+
+ case DECIM6: /* 19 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd6);
+ break;
+
+ case DECIM9: /* 8, 14, 24, 34, 39 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd9);
+ break;
+
+ /*
+ * Miscellaneous bits. If above the positive threshold, declare
+ * 1; if below the negative threshold, declare 0; otherwise
+ * raise the BGATE bit. The design is intended to avoid
+ * integrating noise under low SNR conditions.
+ */
+ case MSC20: /* 55 */
+ wwv_corr4(peer, &up->decvec[YR + 1], bcddld, bcd9);
+ /* fall through */
+
+ case MSCBIT: /* 2-3, 50, 56-57 */
+ if (bitvec[nsec] > BTHR) {
+ if (!(up->misc & arg))
+ up->alarm |= CMPERR;
+ up->misc |= arg;
+ } else if (bitvec[nsec] < -BTHR) {
+ if (up->misc & arg)
+ up->alarm |= CMPERR;
+ up->misc &= ~arg;
+ } else {
+ up->status |= BGATE;
+ }
+ break;
+
+ /*
+ * Save the data channel gain, then QSY to the probe channel and
+ * dim the seconds comb filters. The www_newchan() routine will
+ * light them back up.
+ */
+ case MSC21: /* 58 */
+ if (bitvec[nsec] > BTHR) {
+ if (!(up->misc & arg))
+ up->alarm |= CMPERR;
+ up->misc |= arg;
+ } else if (bitvec[nsec] < -BTHR) {
+ if (up->misc & arg)
+ up->alarm |= CMPERR;
+ up->misc &= ~arg;
+ } else {
+ up->status |= BGATE;
+ }
+ up->status &= ~(SELV | SELH);
+#ifdef ICOM
+ if (up->fd_icom > 0) {
+ up->schan = (up->schan + 1) % NCHAN;
+ wwv_qsy(peer, up->schan);
+ } else {
+ up->mitig[up->achan].gain = up->gain;
+ }
+#else
+ up->mitig[up->achan].gain = up->gain;
+#endif /* ICOM */
+ break;
+
+ /*
+ * The endgames
+ *
+ * During second 59 the receiver and codec AGC are settling
+ * down, so the data pulse is unusable as quality metric. If
+ * LEPSEC is set on the last minute of 30 June or 31 December,
+ * the transmitter and receiver insert an extra second (60) in
+ * the timescale and the minute sync repeats the second. Once
+ * leaps occurred at intervals of about 18 months, but the last
+ * leap before the most recent leap in 1995 was in 1998.
+ */
+ case MIN1: /* 59 */
+ if (up->status & LEPSEC)
+ break;
+
+ /* fall through */
+
+ case MIN2: /* 60 */
+ up->status &= ~LEPSEC;
+ wwv_tsec(peer);
+ up->rsec = 0;
+ wwv_clock(peer);
+ break;
+ }
+ if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
+ DSYNC)) {
+ snprintf(tbuf, sizeof(tbuf),
+ "wwv3 %2d %04x %3d %4d %5.0f %5.1f %5.0f %5.1f %5.0f",
+ nsec, up->status, up->gain, up->yepoch, up->epomax,
+ up->eposnr, up->datsig, up->datsnr, bit);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+ pp->disp += AUDIO_PHI;
+}
+
+/*
+ * The radio clock is set if the alarm bits are all zero. After that,
+ * the time is considered valid if the second sync bit is lit. It should
+ * not be a surprise, especially if the radio is not tunable, that
+ * sometimes no stations are above the noise and the integrators
+ * discharge below the thresholds. We assume that, after a day of signal
+ * loss, the minute sync epoch will be in the same second. This requires
+ * the codec frequency be accurate within 6 PPM. Practical experience
+ * shows the frequency typically within 0.1 PPM, so after a day of
+ * signal loss, the time should be within 8.6 ms..
+ */
+static void
+wwv_clock(
+ struct peer *peer /* peer unit pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ l_fp offset; /* offset in NTP seconds */
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (!(up->status & SSYNC))
+ up->alarm |= SYNERR;
+ if (up->digcnt < 9)
+ up->alarm |= NINERR;
+ if (!(up->alarm))
+ up->status |= INSYNC;
+ if (up->status & INSYNC && up->status & SSYNC) {
+ if (up->misc & SECWAR)
+ pp->leap = LEAP_ADDSECOND;
+ else
+ pp->leap = LEAP_NOWARNING;
+ pp->second = up->rsec;
+ pp->minute = up->decvec[MN].digit + up->decvec[MN +
+ 1].digit * 10;
+ pp->hour = up->decvec[HR].digit + up->decvec[HR +
+ 1].digit * 10;
+ pp->day = up->decvec[DA].digit + up->decvec[DA +
+ 1].digit * 10 + up->decvec[DA + 2].digit * 100;
+ pp->year = up->decvec[YR].digit + up->decvec[YR +
+ 1].digit * 10;
+ pp->year += 2000;
+ L_CLR(&offset);
+ if (!clocktime(pp->day, pp->hour, pp->minute,
+ pp->second, GMT, up->timestamp.l_ui,
+ &pp->yearstart, &offset.l_ui)) {
+ up->errflg = CEVNT_BADTIME;
+ } else {
+ up->watch = 0;
+ pp->disp = 0;
+ pp->lastref = up->timestamp;
+ refclock_process_offset(pp, offset,
+ up->timestamp, PDELAY + up->pdelay);
+ refclock_receive(peer);
+ }
+ }
+ pp->lencode = timecode(up, pp->a_lastcode,
+ sizeof(pp->a_lastcode));
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("wwv: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif /* DEBUG */
+}
+
+
+/*
+ * wwv_corr4 - determine maximum-likelihood digit
+ *
+ * This routine correlates the received digit vector with the BCD
+ * coefficient vectors corresponding to all valid digits at the given
+ * position in the decoding matrix. The maximum value corresponds to the
+ * maximum-likelihood digit, while the ratio of this value to the next
+ * lower value determines the likelihood function. Note that, if the
+ * digit is invalid, the likelihood vector is averaged toward a miss.
+ */
+static void
+wwv_corr4(
+ struct peer *peer, /* peer unit pointer */
+ struct decvec *vp, /* decoding table pointer */
+ double data[], /* received data vector */
+ double tab[][4] /* correlation vector array */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ double topmax, nxtmax; /* metrics */
+ double acc; /* accumulator */
+ char tbuf[TBUF]; /* monitor buffer */
+ int mldigit; /* max likelihood digit */
+ int i, j;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Correlate digit vector with each BCD coefficient vector. If
+ * any BCD digit bit is bad, consider all bits a miss. Until the
+ * minute units digit has been resolved, don't to anything else.
+ * Note the SNR is calculated as the ratio of the largest
+ * likelihood value to the next largest likelihood value.
+ */
+ mldigit = 0;
+ topmax = nxtmax = -MAXAMP;
+ for (i = 0; tab[i][0] != 0; i++) {
+ acc = 0;
+ for (j = 0; j < 4; j++)
+ acc += data[j] * tab[i][j];
+ acc = (vp->like[i] += (acc - vp->like[i]) / TCONST);
+ if (acc > topmax) {
+ nxtmax = topmax;
+ topmax = acc;
+ mldigit = i;
+ } else if (acc > nxtmax) {
+ nxtmax = acc;
+ }
+ }
+ vp->digprb = topmax;
+ vp->digsnr = wwv_snr(topmax, nxtmax);
+
+ /*
+ * The current maximum-likelihood digit is compared to the last
+ * maximum-likelihood digit. If different, the compare counter
+ * and maximum-likelihood digit are reset. When the compare
+ * counter reaches the BCMP threshold (3), the digit is assumed
+ * correct. When the compare counter of all nine digits have
+ * reached threshold, the clock is assumed correct.
+ *
+ * Note that the clock display digit is set before the compare
+ * counter has reached threshold; however, the clock display is
+ * not considered correct until all nine clock digits have
+ * reached threshold. This is intended as eye candy, but avoids
+ * mistakes when the signal is low and the SNR is very marginal.
+ */
+ if (vp->digprb < BTHR || vp->digsnr < BSNR) {
+ up->status |= BGATE;
+ } else {
+ if (vp->digit != mldigit) {
+ up->alarm |= CMPERR;
+ if (vp->count > 0)
+ vp->count--;
+ if (vp->count == 0)
+ vp->digit = mldigit;
+ } else {
+ if (vp->count < BCMP)
+ vp->count++;
+ if (vp->count == BCMP) {
+ up->status |= DSYNC;
+ up->digcnt++;
+ }
+ }
+ }
+ if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
+ INSYNC)) {
+ snprintf(tbuf, sizeof(tbuf),
+ "wwv4 %2d %04x %3d %4d %5.0f %2d %d %d %d %5.0f %5.1f",
+ up->rsec - 1, up->status, up->gain, up->yepoch,
+ up->epomax, vp->radix, vp->digit, mldigit,
+ vp->count, vp->digprb, vp->digsnr);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+}
+
+
+/*
+ * wwv_tsec - transmitter minute processing
+ *
+ * This routine is called at the end of the transmitter minute. It
+ * implements a state machine that advances the logical clock subject to
+ * the funny rules that govern the conventional clock and calendar.
+ */
+static void
+wwv_tsec(
+ struct peer *peer /* driver structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ int minute, day, isleap;
+ int temp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Advance minute unit of the day. Don't propagate carries until
+ * the unit minute digit has been found.
+ */
+ temp = carry(&up->decvec[MN]); /* minute units */
+ if (!(up->status & DSYNC))
+ return;
+
+ /*
+ * Propagate carries through the day.
+ */
+ if (temp == 0) /* carry minutes */
+ temp = carry(&up->decvec[MN + 1]);
+ if (temp == 0) /* carry hours */
+ temp = carry(&up->decvec[HR]);
+ if (temp == 0)
+ temp = carry(&up->decvec[HR + 1]);
+
+ /*
+ * Decode the current minute and day. Set leap day if the
+ * timecode leap bit is set on 30 June or 31 December. Set leap
+ * minute if the last minute on leap day, but only if the clock
+ * is syncrhronized. This code fails in 2400 AD.
+ */
+ minute = up->decvec[MN].digit + up->decvec[MN + 1].digit *
+ 10 + up->decvec[HR].digit * 60 + up->decvec[HR +
+ 1].digit * 600;
+ day = up->decvec[DA].digit + up->decvec[DA + 1].digit * 10 +
+ up->decvec[DA + 2].digit * 100;
+
+ /*
+ * Set the leap bit on the last minute of the leap day.
+ */
+ isleap = up->decvec[YR].digit & 0x3;
+ if (up->misc & SECWAR && up->status & INSYNC) {
+ if ((day == (isleap ? 182 : 183) || day == (isleap ?
+ 365 : 366)) && minute == 1439)
+ up->status |= LEPSEC;
+ }
+
+ /*
+ * Roll the day if this the first minute and propagate carries
+ * through the year.
+ */
+ if (minute != 1440)
+ return;
+
+ minute = 0;
+ while (carry(&up->decvec[HR]) != 0); /* advance to minute 0 */
+ while (carry(&up->decvec[HR + 1]) != 0);
+ day++;
+ temp = carry(&up->decvec[DA]); /* carry days */
+ if (temp == 0)
+ temp = carry(&up->decvec[DA + 1]);
+ if (temp == 0)
+ temp = carry(&up->decvec[DA + 2]);
+
+ /*
+ * Roll the year if this the first day and propagate carries
+ * through the century.
+ */
+ if (day != (isleap ? 365 : 366))
+ return;
+
+ day = 1;
+ while (carry(&up->decvec[DA]) != 1); /* advance to day 1 */
+ while (carry(&up->decvec[DA + 1]) != 0);
+ while (carry(&up->decvec[DA + 2]) != 0);
+ temp = carry(&up->decvec[YR]); /* carry years */
+ if (temp == 0)
+ carry(&up->decvec[YR + 1]);
+}
+
+
+/*
+ * carry - process digit
+ *
+ * This routine rotates a likelihood vector one position and increments
+ * the clock digit modulo the radix. It returns the new clock digit or
+ * zero if a carry occurred. Once synchronized, the clock digit will
+ * match the maximum-likelihood digit corresponding to that position.
+ */
+static int
+carry(
+ struct decvec *dp /* decoding table pointer */
+ )
+{
+ int temp;
+ int j;
+
+ dp->digit++;
+ if (dp->digit == dp->radix)
+ dp->digit = 0;
+ temp = dp->like[dp->radix - 1];
+ for (j = dp->radix - 1; j > 0; j--)
+ dp->like[j] = dp->like[j - 1];
+ dp->like[0] = temp;
+ return (dp->digit);
+}
+
+
+/*
+ * wwv_snr - compute SNR or likelihood function
+ */
+static double
+wwv_snr(
+ double signal, /* signal */
+ double noise /* noise */
+ )
+{
+ double rval;
+
+ /*
+ * This is a little tricky. Due to the way things are measured,
+ * either or both the signal or noise amplitude can be negative
+ * or zero. The intent is that, if the signal is negative or
+ * zero, the SNR must always be zero. This can happen with the
+ * subcarrier SNR before the phase has been aligned. On the
+ * other hand, in the likelihood function the "noise" is the
+ * next maximum down from the peak and this could be negative.
+ * However, in this case the SNR is truly stupendous, so we
+ * simply cap at MAXSNR dB (40).
+ */
+ if (signal <= 0) {
+ rval = 0;
+ } else if (noise <= 0) {
+ rval = MAXSNR;
+ } else {
+ rval = 20. * log10(signal / noise);
+ if (rval > MAXSNR)
+ rval = MAXSNR;
+ }
+ return (rval);
+}
+
+
+/*
+ * wwv_newchan - change to new data channel
+ *
+ * The radio actually appears to have ten channels, one channel for each
+ * of five frequencies and each of two stations (WWV and WWVH), although
+ * if not tunable only the DCHAN channel appears live. While the radio
+ * is tuned to the working data channel frequency and station for most
+ * of the minute, during seconds 59, 0 and 1 the radio is tuned to a
+ * probe frequency in order to search for minute sync pulse and data
+ * subcarrier from other transmitters.
+ *
+ * The search for WWV and WWVH operates simultaneously, with WWV minute
+ * sync pulse at 1000 Hz and WWVH at 1200 Hz. The probe frequency
+ * rotates each minute over 2.5, 5, 10, 15 and 20 MHz in order and yes,
+ * we all know WWVH is dark on 20 MHz, but few remember when WWV was lit
+ * on 25 MHz.
+ *
+ * This routine selects the best channel using a metric computed from
+ * the reachability register and minute pulse amplitude. Normally, the
+ * award goes to the the channel with the highest metric; but, in case
+ * of ties, the award goes to the channel with the highest minute sync
+ * pulse amplitude and then to the highest frequency.
+ *
+ * The routine performs an important squelch function to keep dirty data
+ * from polluting the integrators. In order to consider a station valid,
+ * the metric must be at least MTHR (13); otherwise, the station select
+ * bits are cleared so the second sync is disabled and the data bit
+ * integrators averaged to a miss.
+ */
+static int
+wwv_newchan(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct sync *sp, *rp;
+ double rank, dtemp;
+ int i, j, rval;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Search all five station pairs looking for the channel with
+ * maximum metric.
+ */
+ sp = NULL;
+ j = 0;
+ rank = 0;
+ for (i = 0; i < NCHAN; i++) {
+ rp = &up->mitig[i].wwvh;
+ dtemp = rp->metric;
+ if (dtemp >= rank) {
+ rank = dtemp;
+ sp = rp;
+ j = i;
+ }
+ rp = &up->mitig[i].wwv;
+ dtemp = rp->metric;
+ if (dtemp >= rank) {
+ rank = dtemp;
+ sp = rp;
+ j = i;
+ }
+ }
+
+ /*
+ * If the strongest signal is less than the MTHR threshold (13),
+ * we are beneath the waves, so squelch the second sync and
+ * advance to the next station. This makes sure all stations are
+ * scanned when the ions grow dim. If the strongest signal is
+ * greater than the threshold, tune to that frequency and
+ * transmitter QTH.
+ */
+ up->status &= ~(SELV | SELH);
+ if (rank < MTHR) {
+ up->dchan = (up->dchan + 1) % NCHAN;
+ if (up->status & METRIC) {
+ up->status &= ~METRIC;
+ refclock_report(peer, CEVNT_PROP);
+ }
+ rval = FALSE;
+ } else {
+ up->dchan = j;
+ up->sptr = sp;
+ memcpy(&pp->refid, sp->refid, 4);
+ peer->refid = pp->refid;
+ up->status |= METRIC;
+ if (sp->select & SELV) {
+ up->status |= SELV;
+ up->pdelay = pp->fudgetime1;
+ } else if (sp->select & SELH) {
+ up->status |= SELH;
+ up->pdelay = pp->fudgetime2;
+ } else {
+ up->pdelay = 0;
+ }
+ rval = TRUE;
+ }
+#ifdef ICOM
+ if (up->fd_icom > 0)
+ wwv_qsy(peer, up->dchan);
+#endif /* ICOM */
+ return (rval);
+}
+
+
+/*
+ * wwv_newgame - reset and start over
+ *
+ * There are three conditions resulting in a new game:
+ *
+ * 1 After finding the minute pulse (MSYNC lit), going 15 minutes
+ * (DATA) without finding the unit seconds digit.
+ *
+ * 2 After finding good data (DSYNC lit), going more than 40 minutes
+ * (SYNCH) without finding station sync (INSYNC lit).
+ *
+ * 3 After finding station sync (INSYNC lit), going more than 2 days
+ * (PANIC) without finding any station.
+ */
+static void
+wwv_newgame(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct chan *cp;
+ int i;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Initialize strategic values. Note we set the leap bits
+ * NOTINSYNC and the refid "NONE".
+ */
+ if (up->status)
+ up->errflg = CEVNT_TIMEOUT;
+ peer->leap = LEAP_NOTINSYNC;
+ up->watch = up->status = up->alarm = 0;
+ up->avgint = MINAVG;
+ up->freq = 0;
+ up->gain = MAXGAIN / 2;
+
+ /*
+ * Initialize the station processes for audio gain, select bit,
+ * station/frequency identifier and reference identifier. Start
+ * probing at the strongest channel or the default channel if
+ * nothing heard.
+ */
+ memset(up->mitig, 0, sizeof(up->mitig));
+ for (i = 0; i < NCHAN; i++) {
+ cp = &up->mitig[i];
+ cp->gain = up->gain;
+ cp->wwv.select = SELV;
+ snprintf(cp->wwv.refid, sizeof(cp->wwv.refid), "WV%.0f",
+ floor(qsy[i]));
+ cp->wwvh.select = SELH;
+ snprintf(cp->wwvh.refid, sizeof(cp->wwvh.refid), "WH%.0f",
+ floor(qsy[i]));
+ }
+ up->dchan = (DCHAN + NCHAN - 1) % NCHAN;
+ wwv_newchan(peer);
+ up->schan = up->dchan;
+}
+
+/*
+ * wwv_metric - compute station metric
+ *
+ * The most significant bits represent the number of ones in the
+ * station reachability register. The least significant bits represent
+ * the minute sync pulse amplitude. The combined value is scaled 0-100.
+ */
+double
+wwv_metric(
+ struct sync *sp /* station pointer */
+ )
+{
+ double dtemp;
+
+ dtemp = sp->count * MAXAMP;
+ if (sp->synmax < MAXAMP)
+ dtemp += sp->synmax;
+ else
+ dtemp += MAXAMP - 1;
+ dtemp /= (AMAX + 1) * MAXAMP;
+ return (dtemp * 100.);
+}
+
+
+#ifdef ICOM
+/*
+ * wwv_qsy - Tune ICOM receiver
+ *
+ * This routine saves the AGC for the current channel, switches to a new
+ * channel and restores the AGC for that channel. If a tunable receiver
+ * is not available, just fake it.
+ */
+static int
+wwv_qsy(
+ struct peer *peer, /* peer structure pointer */
+ int chan /* channel */
+ )
+{
+ int rval = 0;
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->fd_icom > 0) {
+ up->mitig[up->achan].gain = up->gain;
+ rval = icom_freq(up->fd_icom, peer->ttl & 0x7f,
+ qsy[chan]);
+ up->achan = chan;
+ up->gain = up->mitig[up->achan].gain;
+ }
+ return (rval);
+}
+#endif /* ICOM */
+
+
+/*
+ * timecode - assemble timecode string and length
+ *
+ * Prettytime format - similar to Spectracom
+ *
+ * sq yy ddd hh:mm:ss ld dut lset agc iden sig errs freq avgt
+ *
+ * s sync indicator ('?' or ' ')
+ * q error bits (hex 0-F)
+ * yyyy year of century
+ * ddd day of year
+ * hh hour of day
+ * mm minute of hour
+ * ss second of minute)
+ * l leap second warning (' ' or 'L')
+ * d DST state ('S', 'D', 'I', or 'O')
+ * dut DUT sign and magnitude (0.1 s)
+ * lset minutes since last clock update
+ * agc audio gain (0-255)
+ * iden reference identifier (station and frequency)
+ * sig signal quality (0-100)
+ * errs bit errors in last minute
+ * freq frequency offset (PPM)
+ * avgt averaging time (s)
+ */
+static int
+timecode(
+ struct wwvunit *up, /* driver structure pointer */
+ char * tc, /* target string */
+ size_t tcsiz /* target max chars */
+ )
+{
+ struct sync *sp;
+ int year, day, hour, minute, second, dut;
+ char synchar, leapchar, dst;
+ char cptr[50];
+
+
+ /*
+ * Common fixed-format fields
+ */
+ synchar = (up->status & INSYNC) ? ' ' : '?';
+ year = up->decvec[YR].digit + up->decvec[YR + 1].digit * 10 +
+ 2000;
+ day = up->decvec[DA].digit + up->decvec[DA + 1].digit * 10 +
+ up->decvec[DA + 2].digit * 100;
+ hour = up->decvec[HR].digit + up->decvec[HR + 1].digit * 10;
+ minute = up->decvec[MN].digit + up->decvec[MN + 1].digit * 10;
+ second = 0;
+ leapchar = (up->misc & SECWAR) ? 'L' : ' ';
+ dst = dstcod[(up->misc >> 4) & 0x3];
+ dut = up->misc & 0x7;
+ if (!(up->misc & DUTS))
+ dut = -dut;
+ snprintf(tc, tcsiz, "%c%1X", synchar, up->alarm);
+ snprintf(cptr, sizeof(cptr),
+ " %4d %03d %02d:%02d:%02d %c%c %+d",
+ year, day, hour, minute, second, leapchar, dst, dut);
+ strlcat(tc, cptr, tcsiz);
+
+ /*
+ * Specific variable-format fields
+ */
+ sp = up->sptr;
+ snprintf(cptr, sizeof(cptr), " %d %d %s %.0f %d %.1f %d",
+ up->watch, up->mitig[up->dchan].gain, sp->refid,
+ sp->metric, up->errcnt, up->freq / WWV_SEC * 1e6,
+ up->avgint);
+ strlcat(tc, cptr, tcsiz);
+
+ return strlen(tc);
+}
+
+
+/*
+ * wwv_gain - adjust codec gain
+ *
+ * This routine is called at the end of each second. During the second
+ * the number of signal clips above the MAXAMP threshold (6000). If
+ * there are no clips, the gain is bumped up; if there are more than
+ * MAXCLP clips (100), it is bumped down. The decoder is relatively
+ * insensitive to amplitude, so this crudity works just peachy. The
+ * routine also jiggles the input port and selectively mutes the
+ * monitor.
+ */
+static void
+wwv_gain(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ /*
+ * Apparently, the codec uses only the high order bits of the
+ * gain control field. Thus, it may take awhile for changes to
+ * wiggle the hardware bits.
+ */
+ if (up->clipcnt == 0) {
+ up->gain += 4;
+ if (up->gain > MAXGAIN)
+ up->gain = MAXGAIN;
+ } else if (up->clipcnt > MAXCLP) {
+ up->gain -= 4;
+ if (up->gain < 0)
+ up->gain = 0;
+ }
+ audio_gain(up->gain, up->mongain, up->port);
+ up->clipcnt = 0;
+#if DEBUG
+ if (debug > 1)
+ audio_show();
+#endif
+}
+
+
+#else
+int refclock_wwv_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_wwvb.c b/ntpd/refclock_wwvb.c
new file mode 100644
index 0000000..75897fc
--- /dev/null
+++ b/ntpd/refclock_wwvb.c
@@ -0,0 +1,603 @@
+/*
+ * refclock_wwvb - clock driver for Spectracom WWVB and GPS receivers
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_SPECTRACOM)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#ifdef HAVE_PPSAPI
+#include "ppsapi_timepps.h"
+#include "refclock_atom.h"
+#endif /* HAVE_PPSAPI */
+
+/*
+ * This driver supports the Spectracom Model 8170 and Netclock/2 WWVB
+ * Synchronized Clocks and the Netclock/GPS Master Clock. Both the WWVB
+ * and GPS clocks have proven reliable sources of time; however, the
+ * WWVB clocks have proven vulnerable to high ambient conductive RF
+ * interference. The claimed accuracy of the WWVB clocks is 100 us
+ * relative to the broadcast signal, while the claimed accuracy of the
+ * GPS clock is 50 ns; however, in most cases the actual accuracy is
+ * limited by the resolution of the timecode and the latencies of the
+ * serial interface and operating system.
+ *
+ * The WWVB and GPS clocks should be configured for 24-hour display,
+ * AUTO DST off, time zone 0 (UTC), data format 0 or 2 (see below) and
+ * baud rate 9600. If the clock is to used as the source for the IRIG
+ * Audio Decoder (refclock_irig.c in this distribution), it should be
+ * configured for AM IRIG output and IRIG format 1 (IRIG B with
+ * signature control). The GPS clock can be configured either to respond
+ * to a 'T' poll character or left running continuously.
+ *
+ * There are two timecode formats used by these clocks. Format 0, which
+ * is available with both the Netclock/2 and 8170, and format 2, which
+ * is available only with the Netclock/2, specially modified 8170 and
+ * GPS.
+ *
+ * Format 0 (22 ASCII printing characters):
+ *
+ * <cr><lf>i ddd hh:mm:ss TZ=zz<cr><lf>
+ *
+ * on-time = first <cr>
+ * hh:mm:ss = hours, minutes, seconds
+ * i = synchronization flag (' ' = in synch, '?' = out of synch)
+ *
+ * The alarm condition is indicated by other than ' ' at i, which occurs
+ * during initial synchronization and when received signal is lost for
+ * about ten hours.
+ *
+ * Format 2 (24 ASCII printing characters):
+ *
+ * <cr><lf>iqyy ddd hh:mm:ss.fff ld
+ *
+ * on-time = <cr>
+ * i = synchronization flag (' ' = in synch, '?' = out of synch)
+ * q = quality indicator (' ' = locked, 'A'...'D' = unlocked)
+ * yy = year (as broadcast)
+ * ddd = day of year
+ * hh:mm:ss.fff = hours, minutes, seconds, milliseconds
+ *
+ * The alarm condition is indicated by other than ' ' at i, which occurs
+ * during initial synchronization and when received signal is lost for
+ * about ten hours. The unlock condition is indicated by other than ' '
+ * at q.
+ *
+ * The q is normally ' ' when the time error is less than 1 ms and a
+ * character in the set 'A'...'D' when the time error is less than 10,
+ * 100, 500 and greater than 500 ms respectively. The l is normally ' ',
+ * but is set to 'L' early in the month of an upcoming UTC leap second
+ * and reset to ' ' on the first day of the following month. The d is
+ * set to 'S' for standard time 'I' on the day preceding a switch to
+ * daylight time, 'D' for daylight time and 'O' on the day preceding a
+ * switch to standard time. The start bit of the first <cr> is
+ * synchronized to the indicated time as returned.
+ *
+ * This driver does not need to be told which format is in use - it
+ * figures out which one from the length of the message. The driver
+ * makes no attempt to correct for the intrinsic jitter of the radio
+ * itself, which is a known problem with the older radios.
+ *
+ * PPS Signal Processing
+ *
+ * When PPS signal processing is enabled, and when the system clock has
+ * been set by this or another driver and the PPS signal offset is
+ * within 0.4 s of the system clock offset, the PPS signal replaces the
+ * timecode for as long as the PPS signal is active. If for some reason
+ * the PPS signal fails for one or more poll intervals, the driver
+ * reverts to the timecode. If the timecode fails for one or more poll
+ * intervals, the PPS signal is disconnected.
+ *
+ * Fudge Factors
+ *
+ * This driver can retrieve a table of quality data maintained
+ * internally by the Netclock/2 clock. If flag4 of the fudge
+ * configuration command is set to 1, the driver will retrieve this
+ * table and write it to the clockstats file when the first timecode
+ * message of a new day is received.
+ *
+ * PPS calibration fudge time 1: format 0 .003134, format 2 .004034
+ */
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/wwvb%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define PRECISION (-13) /* precision assumed (about 100 us) */
+#define PPS_PRECISION (-13) /* precision assumed (about 100 us) */
+#define REFID "WWVB" /* reference ID */
+#define DESCRIPTION "Spectracom WWVB/GPS Receiver" /* WRU */
+
+#define LENWWVB0 22 /* format 0 timecode length */
+#define LENWWVB2 24 /* format 2 timecode length */
+#define LENWWVB3 29 /* format 3 timecode length */
+#define MONLIN 15 /* number of monitoring lines */
+
+/*
+ * WWVB unit control structure
+ */
+struct wwvbunit {
+#ifdef HAVE_PPSAPI
+ struct refclock_atom atom; /* PPSAPI structure */
+ int ppsapi_tried; /* attempt PPSAPI once */
+ int ppsapi_lit; /* time_pps_create() worked */
+ int tcount; /* timecode sample counter */
+ int pcount; /* PPS sample counter */
+#endif /* HAVE_PPSAPI */
+ l_fp laststamp; /* last <CR> timestamp */
+ int prev_eol_cr; /* was last EOL <CR> (not <LF>)? */
+ u_char lasthour; /* last hour (for monitor) */
+ u_char linect; /* count ignored lines (for monitor */
+};
+
+/*
+ * Function prototypes
+ */
+static int wwvb_start (int, struct peer *);
+static void wwvb_shutdown (int, struct peer *);
+static void wwvb_receive (struct recvbuf *);
+static void wwvb_poll (int, struct peer *);
+static void wwvb_timer (int, struct peer *);
+#ifdef HAVE_PPSAPI
+static void wwvb_control (int, const struct refclockstat *,
+ struct refclockstat *, struct peer *);
+#define WWVB_CONTROL wwvb_control
+#else
+#define WWVB_CONTROL noentry
+#endif /* HAVE_PPSAPI */
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_wwvb = {
+ wwvb_start, /* start up driver */
+ wwvb_shutdown, /* shut down driver */
+ wwvb_poll, /* transmit poll message */
+ WWVB_CONTROL, /* fudge set/change notification */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old wwvb_buginfo) */
+ wwvb_timer /* called once per second */
+};
+
+
+/*
+ * wwvb_start - open the devices and initialize data for processing
+ */
+static int
+wwvb_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct wwvbunit *up;
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open serial port. Use CLK line discipline, if available.
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_CLK);
+ if (fd <= 0)
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc_zero(sizeof(*up));
+ pp = peer->procptr;
+ pp->io.clock_recv = wwvb_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy(&pp->refid, REFID, 4);
+ return (1);
+}
+
+
+/*
+ * wwvb_shutdown - shut down the clock
+ */
+static void
+wwvb_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc * pp;
+ struct wwvbunit * up;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (-1 != pp->io.fd)
+ io_closeclock(&pp->io);
+ if (NULL != up)
+ free(up);
+}
+
+
+/*
+ * wwvb_receive - receive data from the serial interface
+ */
+static void
+wwvb_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct wwvbunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+
+ l_fp trtmp; /* arrival timestamp */
+ int tz; /* time zone */
+ int day, month; /* ddd conversion */
+ int temp; /* int temp */
+ char syncchar; /* synchronization indicator */
+ char qualchar; /* quality indicator */
+ char leapchar; /* leap indicator */
+ char dstchar; /* daylight/standard indicator */
+ char tmpchar; /* trashbin */
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ */
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ temp = refclock_gtlin(rbufp, pp->a_lastcode, BMAX, &trtmp);
+
+ /*
+ * Note we get a buffer and timestamp for both a <cr> and <lf>,
+ * but only the <cr> timestamp is retained. Note: in format 0 on
+ * a Netclock/2 or upgraded 8170 the start bit is delayed 100
+ * +-50 us relative to the pps; however, on an unmodified 8170
+ * the start bit can be delayed up to 10 ms. In format 2 the
+ * reading precision is only to the millisecond. Thus, unless
+ * you have a PPS gadget and don't have to have the year, format
+ * 0 provides the lowest jitter.
+ * Save the timestamp of each <CR> in up->laststamp. Lines with
+ * no characters occur for every <LF>, and for some <CR>s when
+ * format 0 is used. Format 0 starts and ends each cycle with a
+ * <CR><LF> pair, format 2 starts each cycle with its only pair.
+ * The preceding <CR> is the on-time character for both formats.
+ * The timestamp provided with non-empty lines corresponds to
+ * the <CR> following the timecode, which is ultimately not used
+ * with format 0 and is used for the following timecode for
+ * format 2.
+ */
+ if (temp == 0) {
+ if (up->prev_eol_cr) {
+ DPRINTF(2, ("wwvb: <LF> @ %s\n",
+ prettydate(&trtmp)));
+ } else {
+ up->laststamp = trtmp;
+ DPRINTF(2, ("wwvb: <CR> @ %s\n",
+ prettydate(&trtmp)));
+ }
+ up->prev_eol_cr = !up->prev_eol_cr;
+ return;
+ }
+ pp->lencode = temp;
+ pp->lastrec = up->laststamp;
+ up->laststamp = trtmp;
+ up->prev_eol_cr = TRUE;
+ DPRINTF(2, ("wwvb: code @ %s\n"
+ " using %s minus one char\n",
+ prettydate(&trtmp), prettydate(&pp->lastrec)));
+ if (L_ISZERO(&pp->lastrec))
+ return;
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. This code uses the timecode length to determine
+ * format 0, 2 or 3. If the timecode has invalid length or is
+ * not in proper format, we declare bad format and exit.
+ */
+ syncchar = qualchar = leapchar = dstchar = ' ';
+ tz = 0;
+ switch (pp->lencode) {
+
+ case LENWWVB0:
+
+ /*
+ * Timecode format 0: "I ddd hh:mm:ss DTZ=nn"
+ */
+ if (sscanf(pp->a_lastcode,
+ "%c %3d %2d:%2d:%2d%c%cTZ=%2d",
+ &syncchar, &pp->day, &pp->hour, &pp->minute,
+ &pp->second, &tmpchar, &dstchar, &tz) == 8) {
+ pp->nsec = 0;
+ break;
+ }
+ goto bad_format;
+
+ case LENWWVB2:
+
+ /*
+ * Timecode format 2: "IQyy ddd hh:mm:ss.mmm LD" */
+ if (sscanf(pp->a_lastcode,
+ "%c%c %2d %3d %2d:%2d:%2d.%3ld %c",
+ &syncchar, &qualchar, &pp->year, &pp->day,
+ &pp->hour, &pp->minute, &pp->second, &pp->nsec,
+ &leapchar) == 9) {
+ pp->nsec *= 1000000;
+ break;
+ }
+ goto bad_format;
+
+ case LENWWVB3:
+
+ /*
+ * Timecode format 3: "0003I yyyymmdd hhmmss+0000SL#"
+ * WARNING: Undocumented, and the on-time character # is
+ * not yet handled correctly by this driver. It may be
+ * as simple as compensating for an additional 1/960 s.
+ */
+ if (sscanf(pp->a_lastcode,
+ "0003%c %4d%2d%2d %2d%2d%2d+0000%c%c",
+ &syncchar, &pp->year, &month, &day, &pp->hour,
+ &pp->minute, &pp->second, &dstchar, &leapchar) == 8)
+ {
+ pp->day = ymd2yd(pp->year, month, day);
+ pp->nsec = 0;
+ break;
+ }
+ goto bad_format;
+
+ default:
+ bad_format:
+
+ /*
+ * Unknown format: If dumping internal table, record
+ * stats; otherwise, declare bad format.
+ */
+ if (up->linect > 0) {
+ up->linect--;
+ record_clock_stats(&peer->srcadr,
+ pp->a_lastcode);
+ } else {
+ refclock_report(peer, CEVNT_BADREPLY);
+ }
+ return;
+ }
+
+ /*
+ * Decode synchronization, quality and leap characters. If
+ * unsynchronized, set the leap bits accordingly and exit.
+ * Otherwise, set the leap bits according to the leap character.
+ * Once synchronized, the dispersion depends only on the
+ * quality character.
+ */
+ switch (qualchar) {
+
+ case ' ':
+ pp->disp = .001;
+ pp->lastref = pp->lastrec;
+ break;
+
+ case 'A':
+ pp->disp = .01;
+ break;
+
+ case 'B':
+ pp->disp = .1;
+ break;
+
+ case 'C':
+ pp->disp = .5;
+ break;
+
+ case 'D':
+ pp->disp = MAXDISPERSE;
+ break;
+
+ default:
+ pp->disp = MAXDISPERSE;
+ refclock_report(peer, CEVNT_BADREPLY);
+ break;
+ }
+ if (syncchar != ' ')
+ pp->leap = LEAP_NOTINSYNC;
+ else if (leapchar == 'L')
+ pp->leap = LEAP_ADDSECOND;
+ else
+ pp->leap = LEAP_NOWARNING;
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp, but only if the PPS is not in control.
+ */
+#ifdef HAVE_PPSAPI
+ up->tcount++;
+ if (peer->flags & FLAG_PPS)
+ return;
+
+#endif /* HAVE_PPSAPI */
+ if (!refclock_process_f(pp, pp->fudgetime2))
+ refclock_report(peer, CEVNT_BADTIME);
+}
+
+
+/*
+ * wwvb_timer - called once per second by the transmit procedure
+ */
+static void
+wwvb_timer(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct wwvbunit *up;
+ struct refclockproc *pp;
+ char pollchar; /* character sent to clock */
+#ifdef DEBUG
+ l_fp now;
+#endif
+
+ /*
+ * Time to poll the clock. The Spectracom clock responds to a
+ * 'T' by returning a timecode in the format(s) specified above.
+ * Note there is no checking on state, since this may not be the
+ * only customer reading the clock. Only one customer need poll
+ * the clock; all others just listen in.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (up->linect > 0)
+ pollchar = 'R';
+ else
+ pollchar = 'T';
+ if (write(pp->io.fd, &pollchar, 1) != 1)
+ refclock_report(peer, CEVNT_FAULT);
+#ifdef DEBUG
+ get_systime(&now);
+ if (debug)
+ printf("%c poll at %s\n", pollchar, prettydate(&now));
+#endif
+#ifdef HAVE_PPSAPI
+ if (up->ppsapi_lit &&
+ refclock_pps(peer, &up->atom, pp->sloppyclockflag) > 0) {
+ up->pcount++,
+ peer->flags |= FLAG_PPS;
+ peer->precision = PPS_PRECISION;
+ }
+#endif /* HAVE_PPSAPI */
+}
+
+
+/*
+ * wwvb_poll - called by the transmit procedure
+ */
+static void
+wwvb_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct wwvbunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * Sweep up the samples received since the last poll. If none
+ * are received, declare a timeout and keep going.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ pp->polls++;
+
+ /*
+ * If the monitor flag is set (flag4), we dump the internal
+ * quality table at the first timecode beginning the day.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG4 && pp->hour <
+ (int)up->lasthour)
+ up->linect = MONLIN;
+ up->lasthour = (u_char)pp->hour;
+
+ /*
+ * Process median filter samples. If none received, declare a
+ * timeout and keep going.
+ */
+#ifdef HAVE_PPSAPI
+ if (up->pcount == 0) {
+ peer->flags &= ~FLAG_PPS;
+ peer->precision = PRECISION;
+ }
+ if (up->tcount == 0) {
+ pp->coderecv = pp->codeproc;
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ up->pcount = up->tcount = 0;
+#else /* HAVE_PPSAPI */
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+#endif /* HAVE_PPSAPI */
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("wwvb: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif
+}
+
+
+/*
+ * wwvb_control - fudge parameters have been set or changed
+ */
+#ifdef HAVE_PPSAPI
+static void
+wwvb_control(
+ int unit,
+ const struct refclockstat *in_st,
+ struct refclockstat *out_st,
+ struct peer *peer
+ )
+{
+ register struct wwvbunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+
+ if (!(pp->sloppyclockflag & CLK_FLAG1)) {
+ if (!up->ppsapi_tried)
+ return;
+ up->ppsapi_tried = 0;
+ if (!up->ppsapi_lit)
+ return;
+ peer->flags &= ~FLAG_PPS;
+ peer->precision = PRECISION;
+ time_pps_destroy(up->atom.handle);
+ up->atom.handle = 0;
+ up->ppsapi_lit = 0;
+ return;
+ }
+
+ if (up->ppsapi_tried)
+ return;
+ /*
+ * Light up the PPSAPI interface.
+ */
+ up->ppsapi_tried = 1;
+ if (refclock_ppsapi(pp->io.fd, &up->atom)) {
+ up->ppsapi_lit = 1;
+ return;
+ }
+
+ msyslog(LOG_WARNING, "%s flag1 1 but PPSAPI fails",
+ refnumtoa(&peer->srcadr));
+}
+#endif /* HAVE_PPSAPI */
+
+#else
+int refclock_wwvb_bs;
+#endif /* REFCLOCK */
diff --git a/ntpd/refclock_zyfer.c b/ntpd/refclock_zyfer.c
new file mode 100644
index 0000000..7b79da3
--- /dev/null
+++ b/ntpd/refclock_zyfer.c
@@ -0,0 +1,331 @@
+/*
+ * refclock_zyfer - clock driver for the Zyfer GPSTarplus Clock
+ *
+ * Harlan Stenn, Jan 2002
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_ZYFER)
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+
+#include <stdio.h>
+#include <ctype.h>
+
+#if defined(HAVE_TERMIOS_H)
+# include <termios.h>
+#elif defined(HAVE_SYS_TERMIOS_H)
+# include <sys/termios.h>
+#endif
+#ifdef HAVE_SYS_PPSCLOCK_H
+# include <sys/ppsclock.h>
+#endif
+
+/*
+ * This driver provides support for the TOD serial port of a Zyfer GPStarplus.
+ * This clock also provides PPS as well as IRIG outputs.
+ * Precision is limited by the serial driver, etc.
+ *
+ * If I was really brave I'd hack/generalize the serial driver to deal
+ * with arbitrary on-time characters. This clock *begins* the stream with
+ * `!`, the on-time character, and the string is *not* EOL-terminated.
+ *
+ * Configure the beast for 9600, 8N1. While I see leap-second stuff
+ * in the documentation, the published specs on the TOD format only show
+ * the seconds going to '59'. I see no leap warning in the TOD format.
+ *
+ * The clock sends the following message once per second:
+ *
+ * !TIME,2002,017,07,59,32,2,4,1
+ * YYYY DDD HH MM SS m T O
+ *
+ * ! On-time character
+ * YYYY Year
+ * DDD 001-366 Day of Year
+ * HH 00-23 Hour
+ * MM 00-59 Minute
+ * SS 00-59 Second (probably 00-60)
+ * m 1-5 Time Mode:
+ * 1 = GPS time
+ * 2 = UTC time
+ * 3 = LGPS time (Local GPS)
+ * 4 = LUTC time (Local UTC)
+ * 5 = Manual time
+ * T 4-9 Time Figure Of Merit:
+ * 4 x <= 1us
+ * 5 1us < x <= 10 us
+ * 6 10us < x <= 100us
+ * 7 100us < x <= 1ms
+ * 8 1ms < x <= 10ms
+ * 9 10ms < x
+ * O 0-4 Operation Mode:
+ * 0 Warm-up
+ * 1 Time Locked
+ * 2 Coasting
+ * 3 Recovering
+ * 4 Manual
+ *
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/zyfer%d" /* device name and unit */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+#define PRECISION (-20) /* precision assumed (about 1 us) */
+#define REFID "GPS\0" /* reference ID */
+#define DESCRIPTION "Zyfer GPStarplus" /* WRU */
+
+#define LENZYFER 29 /* timecode length */
+
+/*
+ * Unit control structure
+ */
+struct zyferunit {
+ u_char Rcvbuf[LENZYFER + 1];
+ u_char polled; /* poll message flag */
+ int pollcnt;
+ l_fp tstamp; /* timestamp of last poll */
+ int Rcvptr;
+};
+
+/*
+ * Function prototypes
+ */
+static int zyfer_start (int, struct peer *);
+static void zyfer_shutdown (int, struct peer *);
+static void zyfer_receive (struct recvbuf *);
+static void zyfer_poll (int, struct peer *);
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_zyfer = {
+ zyfer_start, /* start up driver */
+ zyfer_shutdown, /* shut down driver */
+ zyfer_poll, /* transmit poll message */
+ noentry, /* not used (old zyfer_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old zyfer_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * zyfer_start - open the devices and initialize data for processing
+ */
+static int
+zyfer_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct zyferunit *up;
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open serial port.
+ * Something like LDISC_ACTS that looked for ! would be nice...
+ */
+ snprintf(device, sizeof(device), DEVICE, unit);
+ fd = refclock_open(device, SPEED232, LDISC_RAW);
+ if (fd <= 0)
+ return (0);
+
+ msyslog(LOG_NOTICE, "zyfer(%d) fd: %d dev <%s>", unit, fd, device);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ up = emalloc(sizeof(struct zyferunit));
+ memset(up, 0, sizeof(struct zyferunit));
+ pp = peer->procptr;
+ pp->io.clock_recv = zyfer_receive;
+ pp->io.srcclock = peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ close(fd);
+ pp->io.fd = -1;
+ free(up);
+ return (0);
+ }
+ pp->unitptr = up;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ up->pollcnt = 2;
+ up->polled = 0; /* May not be needed... */
+
+ return (1);
+}
+
+
+/*
+ * zyfer_shutdown - shut down the clock
+ */
+static void
+zyfer_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct zyferunit *up;
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (pp->io.fd != -1)
+ io_closeclock(&pp->io);
+ if (up != NULL)
+ free(up);
+}
+
+
+/*
+ * zyfer_receive - receive data from the serial interface
+ */
+static void
+zyfer_receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct zyferunit *up;
+ struct refclockproc *pp;
+ struct peer *peer;
+ int tmode; /* Time mode */
+ int tfom; /* Time Figure Of Merit */
+ int omode; /* Operation mode */
+ u_char *p;
+
+ peer = rbufp->recv_peer;
+ pp = peer->procptr;
+ up = pp->unitptr;
+ p = (u_char *) &rbufp->recv_space;
+ /*
+ * If lencode is 0:
+ * - if *rbufp->recv_space is !
+ * - - call refclock_gtlin to get things going
+ * - else flush
+ * else stuff it on the end of lastcode
+ * If we don't have LENZYFER bytes
+ * - wait for more data
+ * Crack the beast, and if it's OK, process it.
+ *
+ * We use refclock_gtlin() because we might use LDISC_CLK.
+ *
+ * Under FreeBSD, we get the ! followed by two 14-byte packets.
+ */
+
+ if (pp->lencode >= LENZYFER)
+ pp->lencode = 0;
+
+ if (!pp->lencode) {
+ if (*p == '!')
+ pp->lencode = refclock_gtlin(rbufp, pp->a_lastcode,
+ BMAX, &pp->lastrec);
+ else
+ return;
+ } else {
+ memcpy(pp->a_lastcode + pp->lencode, p, rbufp->recv_length);
+ pp->lencode += rbufp->recv_length;
+ pp->a_lastcode[pp->lencode] = '\0';
+ }
+
+ if (pp->lencode < LENZYFER)
+ return;
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+ /*
+ * We get down to business, check the timecode format and decode
+ * its contents. If the timecode has invalid length or is not in
+ * proper format, we declare bad format and exit.
+ */
+
+ if (pp->lencode != LENZYFER) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+ /*
+ * Timecode sample: "!TIME,2002,017,07,59,32,2,4,1"
+ */
+ if (sscanf(pp->a_lastcode, "!TIME,%4d,%3d,%2d,%2d,%2d,%d,%d,%d",
+ &pp->year, &pp->day, &pp->hour, &pp->minute, &pp->second,
+ &tmode, &tfom, &omode) != 8) {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return;
+ }
+
+ if (tmode != 2) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+ /* Should we make sure tfom is 4? */
+
+ if (omode != 1) {
+ pp->leap = LEAP_NOTINSYNC;
+ return;
+ }
+
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+ /*
+ * Good place for record_clock_stats()
+ */
+ up->pollcnt = 2;
+
+ if (up->polled) {
+ up->polled = 0;
+ refclock_receive(peer);
+ }
+}
+
+
+/*
+ * zyfer_poll - called by the transmit procedure
+ */
+static void
+zyfer_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ register struct zyferunit *up;
+ struct refclockproc *pp;
+
+ /*
+ * We don't really do anything here, except arm the receiving
+ * side to capture a sample and check for timeouts.
+ */
+ pp = peer->procptr;
+ up = pp->unitptr;
+ if (!up->pollcnt)
+ refclock_report(peer, CEVNT_TIMEOUT);
+ else
+ up->pollcnt--;
+ pp->polls++;
+ up->polled = 1;
+}
+
+#else
+int refclock_zyfer_bs;
+#endif /* REFCLOCK */
diff --git a/ntpdate/Makefile.am b/ntpdate/Makefile.am
new file mode 100644
index 0000000..774cf29
--- /dev/null
+++ b/ntpdate/Makefile.am
@@ -0,0 +1,40 @@
+NULL =
+
+BUILT_SOURCES =
+CLEANFILES =
+
+bin_PROGRAMS = $(NTPDATE_DB)
+libexec_PROGRAMS = $(NTPDATE_DL)
+sbin_PROGRAMS = $(NTPDATE_DS)
+
+EXTRA_PROGRAMS = ntpdate
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+LDADD = version.o ../libntp/libntp.a
+ntpdate_LDADD = $(LDADD) $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LIBOPTS_LDADD)
+ntpdate_LDADD += $(LIBM) $(LDADD_NTP)
+DISTCLEANFILES= .version version.c stamp-v
+noinst_HEADERS= ntpdate.h
+
+$(PROGRAMS): $(LDADD)
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdate
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/ntpdate/Makefile.in b/ntpdate/Makefile.in
new file mode 100644
index 0000000..d961900
--- /dev/null
+++ b/ntpdate/Makefile.in
@@ -0,0 +1,913 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = ntpdate$(EXEEXT)
+DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/bincheck.mf \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/check-libntp.mf
+subdir = ntpdate
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+ntpdate_SOURCES = ntpdate.c
+ntpdate_OBJECTS = ntpdate.$(OBJEXT)
+am__DEPENDENCIES_1 =
+ntpdate_DEPENDENCIES = $(LDADD) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = ntpdate.c
+DIST_SOURCES = ntpdate.c
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 = check-libntp .deps-ver
+CLEANFILES = check-libntp .deps-ver
+bin_PROGRAMS = $(NTPDATE_DB)
+libexec_PROGRAMS = $(NTPDATE_DL)
+sbin_PROGRAMS = $(NTPDATE_DS)
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+LDADD = version.o ../libntp/libntp.a
+ntpdate_LDADD = $(LDADD) $(LDADD_LIBNTP) $(PTHREAD_LIBS) \
+ $(LIBOPTS_LDADD) $(LIBM) $(LDADD_NTP)
+DISTCLEANFILES = .version version.c stamp-v
+noinst_HEADERS = ntpdate.h
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(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 ntpdate/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ntpdate/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+ntpdate$(EXEEXT): $(ntpdate_OBJECTS) $(ntpdate_DEPENDENCIES)
+ @rm -f ntpdate$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntpdate_OBJECTS) $(ntpdate_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdate.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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-libexecPROGRAMS \
+ uninstall-sbinPROGRAMS
+
+.MAKE: all check install install-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-sbinPROGRAMS ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-hook \
+ install-html install-html-am install-info install-info-am \
+ install-libexecPROGRAMS install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-sbinPROGRAMS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-libexecPROGRAMS uninstall-sbinPROGRAMS
+
+
+$(PROGRAMS): $(LDADD)
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdate
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/ntpdate/README b/ntpdate/README
new file mode 100644
index 0000000..27b51ed
--- /dev/null
+++ b/ntpdate/README
@@ -0,0 +1,7 @@
+README file for directory ./ntpdate of the NTP Version 4 distribution
+
+This directory contains the sources for the ntpdate utility program. See
+the README and RELNOTES files in the parent directory for directions on
+how to make and install this program. The current version number of this
+program is in the version.c file.
+
diff --git a/ntpdate/ntpdate.c b/ntpdate/ntpdate.c
new file mode 100644
index 0000000..16569f3
--- /dev/null
+++ b/ntpdate/ntpdate.c
@@ -0,0 +1,2246 @@
+/*
+ * ntpdate - set the time of day by polling one or more NTP servers
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef HAVE_NETINFO
+#include <netinfo/ni.h>
+#endif
+
+#include "ntp_machine.h"
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "ntp_io.h"
+#include "timevalops.h"
+#include "ntpdate.h"
+#include "ntp_string.h"
+#include "ntp_syslog.h"
+#include "ntp_select.h"
+#include "ntp_stdlib.h"
+#include <ssl_applink.c>
+
+#include "isc/net.h"
+#include "isc/result.h"
+#include "isc/sockaddr.h"
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <stdio.h>
+#include <signal.h>
+#include <ctype.h>
+#ifdef HAVE_POLL_H
+# include <poll.h>
+#endif
+#ifdef HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
+
+#include <arpa/inet.h>
+
+#ifdef SYS_VXWORKS
+# include "ioLib.h"
+# include "sockLib.h"
+# include "timers.h"
+
+/* select wants a zero structure ... */
+struct timeval timeout = {0,0};
+#elif defined(SYS_WINNT)
+/*
+ * Windows does not abort a select select call if SIGALRM goes off
+ * so a 200 ms timeout is needed (TIMER_HZ is 5).
+ */
+struct sock_timeval timeout = {0,1000000/TIMER_HZ};
+#else
+struct timeval timeout = {60,0};
+#endif
+
+#ifdef HAVE_NETINFO
+#include <netinfo/ni.h>
+#endif
+
+#include "recvbuff.h"
+
+#ifdef SYS_WINNT
+#define TARGET_RESOLUTION 1 /* Try for 1-millisecond accuracy
+ on Windows NT timers. */
+#pragma comment(lib, "winmm")
+isc_boolean_t ntp_port_inuse(int af, u_short port);
+UINT wTimerRes;
+#endif /* SYS_WINNT */
+
+/*
+ * Scheduling priority we run at
+ */
+#ifndef SYS_VXWORKS
+# define NTPDATE_PRIO (-12)
+#else
+# define NTPDATE_PRIO (100)
+#endif
+
+#ifdef HAVE_TIMER_CREATE
+/* POSIX TIMERS - vxWorks doesn't have itimer - casey */
+static timer_t ntpdate_timerid;
+#endif
+
+/*
+ * Compatibility stuff for Version 2
+ */
+#define NTP_MAXSKW 0x28f /* 0.01 sec in fp format */
+#define NTP_MINDIST 0x51f /* 0.02 sec in fp format */
+#define PEER_MAXDISP (64*FP_SECOND) /* maximum dispersion (fp 64) */
+#define NTP_INFIN 15 /* max stratum, infinity a la Bellman-Ford */
+#define NTP_MAXWGT (8*FP_SECOND) /* maximum select weight 8 seconds */
+#define NTP_MAXLIST 5 /* maximum select list size */
+#define PEER_SHIFT 8 /* 8 suitable for crystal time base */
+
+/*
+ * for get_systime()
+ */
+s_char sys_precision; /* local clock precision (log2 s) */
+
+/*
+ * File descriptor masks etc. for call to select
+ */
+
+int ai_fam_templ;
+int nbsock; /* the number of sockets used */
+SOCKET fd[MAX_AF];
+int fd_family[MAX_AF]; /* to remember the socket family */
+#ifdef HAVE_POLL_H
+struct pollfd fdmask[MAX_AF];
+#else
+fd_set fdmask;
+SOCKET maxfd;
+#endif
+int polltest = 0;
+
+/*
+ * Initializing flag. All async routines watch this and only do their
+ * thing when it is clear.
+ */
+int initializing = 1;
+
+/*
+ * Alarm flag. Set when an alarm occurs
+ */
+volatile int alarm_flag = 0;
+
+/*
+ * Simple query flag.
+ */
+int simple_query = 0;
+
+/*
+ * Unprivileged port flag.
+ */
+int unpriv_port = 0;
+
+/*
+ * Program name.
+ */
+char *progname;
+
+/*
+ * Systemwide parameters and flags
+ */
+int sys_samples = DEFSAMPLES; /* number of samples/server */
+u_long sys_timeout = DEFTIMEOUT; /* timeout time, in TIMER_HZ units */
+struct server *sys_servers; /* the server list */
+int sys_numservers = 0; /* number of servers to poll */
+int sys_authenticate = 0; /* true when authenticating */
+u_int32 sys_authkey = 0; /* set to authentication key in use */
+u_long sys_authdelay = 0; /* authentication delay */
+int sys_version = NTP_VERSION; /* version to poll with */
+
+/*
+ * The current internal time
+ */
+u_long current_time = 0;
+
+/*
+ * Counter for keeping track of completed servers
+ */
+int complete_servers = 0;
+
+/*
+ * File of encryption keys
+ */
+
+#ifndef KEYFILE
+# ifndef SYS_WINNT
+#define KEYFILE "/etc/ntp.keys"
+# else
+#define KEYFILE "%windir%\\ntp.keys"
+# endif /* SYS_WINNT */
+#endif /* KEYFILE */
+
+#ifndef SYS_WINNT
+const char *key_file = KEYFILE;
+#else
+char key_file_storage[MAX_PATH+1], *key_file ;
+#endif /* SYS_WINNT */
+
+/*
+ * Miscellaneous flags
+ */
+int verbose = 0;
+int always_step = 0;
+int never_step = 0;
+
+int ntpdatemain (int, char **);
+
+static void transmit (struct server *);
+static void receive (struct recvbuf *);
+static void server_data (struct server *, s_fp, l_fp *, u_fp);
+static void clock_filter (struct server *);
+static struct server *clock_select (void);
+static int clock_adjust (void);
+static void addserver (char *);
+static struct server *findserver (sockaddr_u *);
+ void timer (void);
+static void init_alarm (void);
+#ifndef SYS_WINNT
+static RETSIGTYPE alarming (int);
+#endif /* SYS_WINNT */
+static void init_io (void);
+static void sendpkt (sockaddr_u *, struct pkt *, int);
+void input_handler (void);
+
+static int l_adj_systime (l_fp *);
+static int l_step_systime (l_fp *);
+
+static void printserver (struct server *, FILE *);
+
+#ifdef SYS_WINNT
+int on = 1;
+WORD wVersionRequested;
+WSADATA wsaData;
+#endif /* SYS_WINNT */
+
+#ifdef NO_MAIN_ALLOWED
+CALL(ntpdate,"ntpdate",ntpdatemain);
+
+void clear_globals()
+{
+ /*
+ * Debugging flag
+ */
+ debug = 0;
+
+ ntp_optind = 0;
+ /*
+ * Initializing flag. All async routines watch this and only do their
+ * thing when it is clear.
+ */
+ initializing = 1;
+
+ /*
+ * Alarm flag. Set when an alarm occurs
+ */
+ alarm_flag = 0;
+
+ /*
+ * Simple query flag.
+ */
+ simple_query = 0;
+
+ /*
+ * Unprivileged port flag.
+ */
+ unpriv_port = 0;
+
+ /*
+ * Systemwide parameters and flags
+ */
+ sys_numservers = 0; /* number of servers to poll */
+ sys_authenticate = 0; /* true when authenticating */
+ sys_authkey = 0; /* set to authentication key in use */
+ sys_authdelay = 0; /* authentication delay */
+ sys_version = NTP_VERSION; /* version to poll with */
+
+ /*
+ * The current internal time
+ */
+ current_time = 0;
+
+ /*
+ * Counter for keeping track of completed servers
+ */
+ complete_servers = 0;
+ verbose = 0;
+ always_step = 0;
+ never_step = 0;
+}
+#endif
+
+#ifdef HAVE_NETINFO
+static ni_namelist *getnetinfoservers (void);
+#endif
+
+/*
+ * Main program. Initialize us and loop waiting for I/O and/or
+ * timer expiries.
+ */
+#ifndef NO_MAIN_ALLOWED
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ return ntpdatemain (argc, argv);
+}
+#endif /* NO_MAIN_ALLOWED */
+
+int
+ntpdatemain (
+ int argc,
+ char *argv[]
+ )
+{
+ int was_alarmed;
+ int tot_recvbufs;
+ struct recvbuf *rbuf;
+ l_fp tmp;
+ int errflg;
+ int c;
+ int nfound;
+
+#ifdef HAVE_NETINFO
+ ni_namelist *netinfoservers;
+#endif
+#ifdef SYS_WINNT
+ key_file = key_file_storage;
+
+ if (!ExpandEnvironmentStrings(KEYFILE, key_file, MAX_PATH))
+ msyslog(LOG_ERR, "ExpandEnvironmentStrings(KEYFILE) failed: %m");
+
+ ssl_applink();
+#endif /* SYS_WINNT */
+
+#ifdef NO_MAIN_ALLOWED
+ clear_globals();
+#endif
+
+ init_lib(); /* sets up ipv4_works, ipv6_works */
+
+ /* Check to see if we have IPv6. Otherwise default to IPv4 */
+ if (!ipv6_works)
+ ai_fam_templ = AF_INET;
+
+ errflg = 0;
+ progname = argv[0];
+ syslogit = 0;
+
+ /*
+ * Decode argument list
+ */
+ while ((c = ntp_getopt(argc, argv, "46a:bBde:k:o:p:qst:uv")) != EOF)
+ switch (c)
+ {
+ case '4':
+ ai_fam_templ = AF_INET;
+ break;
+ case '6':
+ ai_fam_templ = AF_INET6;
+ break;
+ case 'a':
+ c = atoi(ntp_optarg);
+ sys_authenticate = 1;
+ sys_authkey = c;
+ break;
+ case 'b':
+ always_step++;
+ never_step = 0;
+ break;
+ case 'B':
+ never_step++;
+ always_step = 0;
+ break;
+ case 'd':
+ ++debug;
+ break;
+ case 'e':
+ if (!atolfp(ntp_optarg, &tmp)
+ || tmp.l_ui != 0) {
+ (void) fprintf(stderr,
+ "%s: encryption delay %s is unlikely\n",
+ progname, ntp_optarg);
+ errflg++;
+ } else {
+ sys_authdelay = tmp.l_uf;
+ }
+ break;
+ case 'k':
+ key_file = ntp_optarg;
+ break;
+ case 'o':
+ sys_version = atoi(ntp_optarg);
+ break;
+ case 'p':
+ c = atoi(ntp_optarg);
+ if (c <= 0 || c > NTP_SHIFT) {
+ (void) fprintf(stderr,
+ "%s: number of samples (%d) is invalid\n",
+ progname, c);
+ errflg++;
+ } else {
+ sys_samples = c;
+ }
+ break;
+ case 'q':
+ simple_query = 1;
+ break;
+ case 's':
+ syslogit = 1;
+ break;
+ case 't':
+ if (!atolfp(ntp_optarg, &tmp)) {
+ (void) fprintf(stderr,
+ "%s: timeout %s is undecodeable\n",
+ progname, ntp_optarg);
+ errflg++;
+ } else {
+ sys_timeout = ((LFPTOFP(&tmp) * TIMER_HZ)
+ + 0x8000) >> 16;
+ sys_timeout = max(sys_timeout, MINTIMEOUT);
+ }
+ break;
+ case 'v':
+ verbose = 1;
+ break;
+ case 'u':
+ unpriv_port = 1;
+ break;
+ case '?':
+ ++errflg;
+ break;
+ default:
+ break;
+ }
+
+ if (errflg) {
+ (void) fprintf(stderr,
+ "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n",
+ progname);
+ exit(2);
+ }
+
+ if (debug || simple_query) {
+#ifdef HAVE_SETVBUF
+ static char buf[BUFSIZ];
+ setvbuf(stdout, buf, _IOLBF, BUFSIZ);
+#else
+ setlinebuf(stdout);
+#endif
+ }
+
+ /*
+ * Logging. Open the syslog if we have to
+ */
+ if (syslogit) {
+#if !defined (SYS_WINNT) && !defined (SYS_VXWORKS) && !defined SYS_CYGWIN32
+# ifndef LOG_DAEMON
+ openlog("ntpdate", LOG_PID);
+# else
+
+# ifndef LOG_NTP
+# define LOG_NTP LOG_DAEMON
+# endif
+ openlog("ntpdate", LOG_PID | LOG_NDELAY, LOG_NTP);
+ if (debug)
+ setlogmask(LOG_UPTO(LOG_DEBUG));
+ else
+ setlogmask(LOG_UPTO(LOG_INFO));
+# endif /* LOG_DAEMON */
+#endif /* SYS_WINNT */
+ }
+
+ if (debug || verbose)
+ msyslog(LOG_NOTICE, "%s", Version);
+
+ /*
+ * Add servers we are going to be polling
+ */
+#ifdef HAVE_NETINFO
+ netinfoservers = getnetinfoservers();
+#endif
+
+ for ( ; ntp_optind < argc; ntp_optind++)
+ addserver(argv[ntp_optind]);
+
+#ifdef HAVE_NETINFO
+ if (netinfoservers) {
+ if ( netinfoservers->ni_namelist_len &&
+ *netinfoservers->ni_namelist_val ) {
+ u_int servercount = 0;
+ while (servercount < netinfoservers->ni_namelist_len) {
+ if (debug) msyslog(LOG_DEBUG,
+ "Adding time server %s from NetInfo configuration.",
+ netinfoservers->ni_namelist_val[servercount]);
+ addserver(netinfoservers->ni_namelist_val[servercount++]);
+ }
+ }
+ ni_namelist_free(netinfoservers);
+ free(netinfoservers);
+ }
+#endif
+
+ if (sys_numservers == 0) {
+ msyslog(LOG_ERR, "no servers can be used, exiting");
+ exit(1);
+ }
+
+ /*
+ * Initialize the time of day routines and the I/O subsystem
+ */
+ if (sys_authenticate) {
+ init_auth();
+ if (!authreadkeys(key_file)) {
+ msyslog(LOG_ERR, "no key file <%s>, exiting", key_file);
+ exit(1);
+ }
+ authtrust(sys_authkey, 1);
+ if (!authistrusted(sys_authkey)) {
+ msyslog(LOG_ERR, "authentication key %lu unknown",
+ (unsigned long) sys_authkey);
+ exit(1);
+ }
+ }
+ init_io();
+ init_alarm();
+
+ /*
+ * Set the priority.
+ */
+#ifdef SYS_VXWORKS
+ taskPrioritySet( taskIdSelf(), NTPDATE_PRIO);
+#endif
+#if defined(HAVE_ATT_NICE)
+ nice (NTPDATE_PRIO);
+#endif
+#if defined(HAVE_BSD_NICE)
+ (void) setpriority(PRIO_PROCESS, 0, NTPDATE_PRIO);
+#endif
+
+
+ initializing = 0;
+ was_alarmed = 0;
+
+ while (complete_servers < sys_numservers) {
+#ifdef HAVE_POLL_H
+ struct pollfd* rdfdes;
+ rdfdes = fdmask;
+#else
+ fd_set rdfdes;
+ rdfdes = fdmask;
+#endif
+
+ if (alarm_flag) { /* alarmed? */
+ was_alarmed = 1;
+ alarm_flag = 0;
+ }
+ tot_recvbufs = full_recvbuffs(); /* get received buffers */
+
+ if (!was_alarmed && tot_recvbufs == 0) {
+ /*
+ * Nothing to do. Wait for something.
+ */
+#ifdef HAVE_POLL_H
+ nfound = poll(rdfdes, (unsigned int)nbsock, timeout.tv_sec * 1000);
+
+#else
+ nfound = select(maxfd, &rdfdes, (fd_set *)0,
+ (fd_set *)0, &timeout);
+#endif
+ if (nfound > 0)
+ input_handler();
+ else if (nfound == SOCKET_ERROR)
+ {
+#ifndef SYS_WINNT
+ if (errno != EINTR)
+#else
+ if (WSAGetLastError() != WSAEINTR)
+#endif
+ msyslog(LOG_ERR,
+#ifdef HAVE_POLL_H
+ "poll() error: %m"
+#else
+ "select() error: %m"
+#endif
+ );
+ } else if (errno != 0) {
+#ifndef SYS_VXWORKS
+ msyslog(LOG_DEBUG,
+#ifdef HAVE_POLL_H
+ "poll(): nfound = %d, error: %m",
+#else
+ "select(): nfound = %d, error: %m",
+#endif
+ nfound);
+#endif
+ }
+ if (alarm_flag) { /* alarmed? */
+ was_alarmed = 1;
+ alarm_flag = 0;
+ }
+ tot_recvbufs = full_recvbuffs(); /* get received buffers */
+ }
+
+ /*
+ * Out here, signals are unblocked. Call receive
+ * procedure for each incoming packet.
+ */
+ rbuf = get_full_recv_buffer();
+ while (rbuf != NULL)
+ {
+ receive(rbuf);
+ freerecvbuf(rbuf);
+ rbuf = get_full_recv_buffer();
+ }
+
+ /*
+ * Call timer to process any timeouts
+ */
+ if (was_alarmed) {
+ timer();
+ was_alarmed = 0;
+ }
+
+ /*
+ * Go around again
+ */
+ }
+
+ /*
+ * When we get here we've completed the polling of all servers.
+ * Adjust the clock, then exit.
+ */
+#ifdef SYS_WINNT
+ WSACleanup();
+#endif
+#ifdef SYS_VXWORKS
+ close (fd);
+ timer_delete(ntpdate_timerid);
+#endif
+
+ return clock_adjust();
+}
+
+
+/*
+ * transmit - transmit a packet to the given server, or mark it completed.
+ * This is called by the timeout routine and by the receive
+ * procedure.
+ */
+static void
+transmit(
+ register struct server *server
+ )
+{
+ struct pkt xpkt;
+
+ if (debug)
+ printf("transmit(%s)\n", stoa(&server->srcadr));
+
+ if (server->filter_nextpt < server->xmtcnt) {
+ l_fp ts;
+ /*
+ * Last message to this server timed out. Shift
+ * zeros into the filter.
+ */
+ L_CLR(&ts);
+ server_data(server, 0, &ts, 0);
+ }
+
+ if ((int)server->filter_nextpt >= sys_samples) {
+ /*
+ * Got all the data we need. Mark this guy
+ * completed and return.
+ */
+ server->event_time = 0;
+ complete_servers++;
+ return;
+ }
+
+ /*
+ * If we're here, send another message to the server. Fill in
+ * the packet and let 'er rip.
+ */
+ xpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
+ sys_version, MODE_CLIENT);
+ xpkt.stratum = STRATUM_TO_PKT(STRATUM_UNSPEC);
+ xpkt.ppoll = NTP_MINPOLL;
+ xpkt.precision = NTPDATE_PRECISION;
+ xpkt.rootdelay = htonl(NTPDATE_DISTANCE);
+ xpkt.rootdisp = htonl(NTPDATE_DISP);
+ xpkt.refid = htonl(NTPDATE_REFID);
+ L_CLR(&xpkt.reftime);
+ L_CLR(&xpkt.org);
+ L_CLR(&xpkt.rec);
+
+ /*
+ * Determine whether to authenticate or not. If so,
+ * fill in the extended part of the packet and do it.
+ * If not, just timestamp it and send it away.
+ */
+ if (sys_authenticate) {
+ int len;
+
+ xpkt.exten[0] = htonl(sys_authkey);
+ get_systime(&server->xmt);
+ L_ADDUF(&server->xmt, sys_authdelay);
+ HTONL_FP(&server->xmt, &xpkt.xmt);
+ len = authencrypt(sys_authkey, (u_int32 *)&xpkt, LEN_PKT_NOMAC);
+ sendpkt(&server->srcadr, &xpkt, (int)(LEN_PKT_NOMAC + len));
+
+ if (debug > 1)
+ printf("transmit auth to %s\n",
+ stoa(&server->srcadr));
+ } else {
+ get_systime(&(server->xmt));
+ HTONL_FP(&server->xmt, &xpkt.xmt);
+ sendpkt(&server->srcadr, &xpkt, LEN_PKT_NOMAC);
+
+ if (debug > 1)
+ printf("transmit to %s\n", stoa(&server->srcadr));
+ }
+
+ /*
+ * Update the server timeout and transmit count
+ */
+ server->event_time = current_time + sys_timeout;
+ server->xmtcnt++;
+}
+
+
+/*
+ * receive - receive and process an incoming frame
+ */
+static void
+receive(
+ struct recvbuf *rbufp
+ )
+{
+ register struct pkt *rpkt;
+ register struct server *server;
+ register s_fp di;
+ l_fp t10, t23, tmp;
+ l_fp org;
+ l_fp rec;
+ l_fp ci;
+ int has_mac;
+ int is_authentic;
+
+ if (debug)
+ printf("receive(%s)\n", stoa(&rbufp->recv_srcadr));
+ /*
+ * Check to see if the packet basically looks like something
+ * intended for us.
+ */
+ if (rbufp->recv_length == LEN_PKT_NOMAC)
+ has_mac = 0;
+ else if (rbufp->recv_length >= LEN_PKT_NOMAC)
+ has_mac = 1;
+ else {
+ if (debug)
+ printf("receive: packet length %d\n",
+ rbufp->recv_length);
+ return; /* funny length packet */
+ }
+
+ rpkt = &(rbufp->recv_pkt);
+ if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION ||
+ PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) {
+ return;
+ }
+
+ if ((PKT_MODE(rpkt->li_vn_mode) != MODE_SERVER
+ && PKT_MODE(rpkt->li_vn_mode) != MODE_PASSIVE)
+ || rpkt->stratum >= STRATUM_UNSPEC) {
+ if (debug)
+ printf("receive: mode %d stratum %d\n",
+ PKT_MODE(rpkt->li_vn_mode), rpkt->stratum);
+ return;
+ }
+
+ /*
+ * So far, so good. See if this is from a server we know.
+ */
+ server = findserver(&(rbufp->recv_srcadr));
+ if (server == NULL) {
+ if (debug)
+ printf("receive: server not found\n");
+ return;
+ }
+
+ /*
+ * Decode the org timestamp and make sure we're getting a response
+ * to our last request.
+ */
+ NTOHL_FP(&rpkt->org, &org);
+ if (!L_ISEQU(&org, &server->xmt)) {
+ if (debug)
+ printf("receive: pkt.org and peer.xmt differ\n");
+ return;
+ }
+
+ /*
+ * Check out the authenticity if we're doing that.
+ */
+ if (!sys_authenticate)
+ is_authentic = 1;
+ else {
+ is_authentic = 0;
+
+ if (debug > 3)
+ printf("receive: rpkt keyid=%ld sys_authkey=%ld decrypt=%ld\n",
+ (long int)ntohl(rpkt->exten[0]), (long int)sys_authkey,
+ (long int)authdecrypt(sys_authkey, (u_int32 *)rpkt,
+ LEN_PKT_NOMAC, (int)(rbufp->recv_length - LEN_PKT_NOMAC)));
+
+ if (has_mac && ntohl(rpkt->exten[0]) == sys_authkey &&
+ authdecrypt(sys_authkey, (u_int32 *)rpkt, LEN_PKT_NOMAC,
+ (int)(rbufp->recv_length - LEN_PKT_NOMAC)))
+ is_authentic = 1;
+ if (debug)
+ printf("receive: authentication %s\n",
+ is_authentic ? "passed" : "failed");
+ }
+ server->trust <<= 1;
+ if (!is_authentic)
+ server->trust |= 1;
+
+ /*
+ * Check for a KoD (rate limiting) response, cease and decist.
+ */
+ if (LEAP_NOTINSYNC == PKT_LEAP(rpkt->li_vn_mode) &&
+ STRATUM_PKT_UNSPEC == rpkt->stratum &&
+ !memcmp("RATE", &rpkt->refid, 4)) {
+ msyslog(LOG_ERR, "%s rate limit response from server.",
+ stoa(&rbufp->recv_srcadr));
+ server->event_time = 0;
+ complete_servers++;
+ return;
+ }
+
+ /*
+ * Looks good. Record info from the packet.
+ */
+ server->leap = PKT_LEAP(rpkt->li_vn_mode);
+ server->stratum = PKT_TO_STRATUM(rpkt->stratum);
+ server->precision = rpkt->precision;
+ server->rootdelay = ntohl(rpkt->rootdelay);
+ server->rootdisp = ntohl(rpkt->rootdisp);
+ server->refid = rpkt->refid;
+ NTOHL_FP(&rpkt->reftime, &server->reftime);
+ NTOHL_FP(&rpkt->rec, &rec);
+ NTOHL_FP(&rpkt->xmt, &server->org);
+
+ /*
+ * Make sure the server is at least somewhat sane. If not, try
+ * again.
+ */
+ if (L_ISZERO(&rec) || !L_ISHIS(&server->org, &rec)) {
+ server->event_time = current_time + sys_timeout;
+ return;
+ }
+
+ /*
+ * Calculate the round trip delay (di) and the clock offset (ci).
+ * We use the equations (reordered from those in the spec):
+ *
+ * d = (t2 - t3) - (t1 - t0)
+ * c = ((t2 - t3) + (t1 - t0)) / 2
+ */
+ t10 = server->org; /* pkt.xmt == t1 */
+ L_SUB(&t10, &rbufp->recv_time); /* recv_time == t0*/
+
+ t23 = rec; /* pkt.rec == t2 */
+ L_SUB(&t23, &org); /* pkt->org == t3 */
+
+ /* now have (t2 - t3) and (t0 - t1). Calculate (ci) and (di) */
+ /*
+ * Calculate (ci) = ((t1 - t0) / 2) + ((t2 - t3) / 2)
+ * For large offsets this may prevent an overflow on '+'
+ */
+ ci = t10;
+ L_RSHIFT(&ci);
+ tmp = t23;
+ L_RSHIFT(&tmp);
+ L_ADD(&ci, &tmp);
+
+ /*
+ * Calculate di in t23 in full precision, then truncate
+ * to an s_fp.
+ */
+ L_SUB(&t23, &t10);
+ di = LFPTOFP(&t23);
+
+ if (debug > 3)
+ printf("offset: %s, delay %s\n", lfptoa(&ci, 6), fptoa(di, 5));
+
+ di += (FP_SECOND >> (-(int)NTPDATE_PRECISION))
+ + (FP_SECOND >> (-(int)server->precision)) + NTP_MAXSKW;
+
+ if (di <= 0) { /* value still too raunchy to use? */
+ L_CLR(&ci);
+ di = 0;
+ } else {
+ di = max(di, NTP_MINDIST);
+ }
+
+ /*
+ * Shift this data in, then schedule another transmit.
+ */
+ server_data(server, (s_fp) di, &ci, 0);
+
+ if ((int)server->filter_nextpt >= sys_samples) {
+ /*
+ * Got all the data we need. Mark this guy
+ * completed and return.
+ */
+ server->event_time = 0;
+ complete_servers++;
+ return;
+ }
+
+ server->event_time = current_time + sys_timeout;
+}
+
+
+/*
+ * server_data - add a sample to the server's filter registers
+ */
+static void
+server_data(
+ register struct server *server,
+ s_fp d,
+ l_fp *c,
+ u_fp e
+ )
+{
+ u_short i;
+
+ i = server->filter_nextpt;
+ if (i < NTP_SHIFT) {
+ server->filter_delay[i] = d;
+ server->filter_offset[i] = *c;
+ server->filter_soffset[i] = LFPTOFP(c);
+ server->filter_error[i] = e;
+ server->filter_nextpt = (u_short)(i + 1);
+ }
+}
+
+
+/*
+ * clock_filter - determine a server's delay, dispersion and offset
+ */
+static void
+clock_filter(
+ register struct server *server
+ )
+{
+ register int i, j;
+ int ord[NTP_SHIFT];
+
+ /*
+ * Sort indices into increasing delay order
+ */
+ for (i = 0; i < sys_samples; i++)
+ ord[i] = i;
+
+ for (i = 0; i < (sys_samples-1); i++) {
+ for (j = i+1; j < sys_samples; j++) {
+ if (server->filter_delay[ord[j]] == 0)
+ continue;
+ if (server->filter_delay[ord[i]] == 0
+ || (server->filter_delay[ord[i]]
+ > server->filter_delay[ord[j]])) {
+ register int tmp;
+
+ tmp = ord[i];
+ ord[i] = ord[j];
+ ord[j] = tmp;
+ }
+ }
+ }
+
+ /*
+ * Now compute the dispersion, and assign values to delay and
+ * offset. If there are no samples in the register, delay and
+ * offset go to zero and dispersion is set to the maximum.
+ */
+ if (server->filter_delay[ord[0]] == 0) {
+ server->delay = 0;
+ L_CLR(&server->offset);
+ server->soffset = 0;
+ server->dispersion = PEER_MAXDISP;
+ } else {
+ register s_fp d;
+
+ server->delay = server->filter_delay[ord[0]];
+ server->offset = server->filter_offset[ord[0]];
+ server->soffset = LFPTOFP(&server->offset);
+ server->dispersion = 0;
+ for (i = 1; i < sys_samples; i++) {
+ if (server->filter_delay[ord[i]] == 0)
+ d = PEER_MAXDISP;
+ else {
+ d = server->filter_soffset[ord[i]]
+ - server->filter_soffset[ord[0]];
+ if (d < 0)
+ d = -d;
+ if (d > PEER_MAXDISP)
+ d = PEER_MAXDISP;
+ }
+ /*
+ * XXX This *knows* PEER_FILTER is 1/2
+ */
+ server->dispersion += (u_fp)(d) >> i;
+ }
+ }
+ /*
+ * We're done
+ */
+}
+
+
+/*
+ * clock_select - select the pick-of-the-litter clock from the samples
+ * we've got.
+ */
+static struct server *
+clock_select(void)
+{
+ struct server *server;
+ u_int nlist;
+ s_fp d;
+ u_int count;
+ u_int i;
+ u_int j;
+ u_int k;
+ int n;
+ s_fp local_threshold;
+ struct server *server_list[NTP_MAXCLOCK];
+ u_fp server_badness[NTP_MAXCLOCK];
+ struct server *sys_server;
+
+ /*
+ * This first chunk of code is supposed to go through all
+ * servers we know about to find the NTP_MAXLIST servers which
+ * are most likely to succeed. We run through the list
+ * doing the sanity checks and trying to insert anyone who
+ * looks okay. We are at all times aware that we should
+ * only keep samples from the top two strata and we only need
+ * NTP_MAXLIST of them.
+ */
+ nlist = 0; /* none yet */
+ for (server = sys_servers; server != NULL; server = server->next_server) {
+ if (server->delay == 0) {
+ if (debug)
+ printf("%s: Server dropped: no data\n", ntoa(&server->srcadr));
+ continue; /* no data */
+ }
+ if (server->stratum > NTP_INFIN) {
+ if (debug)
+ printf("%s: Server dropped: strata too high\n", ntoa(&server->srcadr));
+ continue; /* stratum no good */
+ }
+ if (server->delay > NTP_MAXWGT) {
+ if (debug)
+ printf("%s: Server dropped: server too far away\n",
+ ntoa(&server->srcadr));
+ continue; /* too far away */
+ }
+ if (server->leap == LEAP_NOTINSYNC) {
+ if (debug)
+ printf("%s: Server dropped: Leap not in sync\n", ntoa(&server->srcadr));
+ continue; /* he's in trouble */
+ }
+ if (!L_ISHIS(&server->org, &server->reftime)) {
+ if (debug)
+ printf("%s: Server dropped: server is very broken\n",
+ ntoa(&server->srcadr));
+ continue; /* very broken host */
+ }
+ if ((server->org.l_ui - server->reftime.l_ui)
+ >= NTP_MAXAGE) {
+ if (debug)
+ printf("%s: Server dropped: Server has gone too long without sync\n",
+ ntoa(&server->srcadr));
+ continue; /* too long without sync */
+ }
+ if (server->trust != 0) {
+ if (debug)
+ printf("%s: Server dropped: Server is untrusted\n",
+ ntoa(&server->srcadr));
+ continue;
+ }
+
+ /*
+ * This one seems sane. Find where he belongs
+ * on the list.
+ */
+ d = server->dispersion + server->dispersion;
+ for (i = 0; i < nlist; i++)
+ if (server->stratum <= server_list[i]->stratum)
+ break;
+ for ( ; i < nlist; i++) {
+ if (server->stratum < server_list[i]->stratum)
+ break;
+ if (d < (s_fp) server_badness[i])
+ break;
+ }
+
+ /*
+ * If i points past the end of the list, this
+ * guy is a loser, else stick him in.
+ */
+ if (i >= NTP_MAXLIST)
+ continue;
+ for (j = nlist; j > i; j--)
+ if (j < NTP_MAXLIST) {
+ server_list[j] = server_list[j-1];
+ server_badness[j]
+ = server_badness[j-1];
+ }
+
+ server_list[i] = server;
+ server_badness[i] = d;
+ if (nlist < NTP_MAXLIST)
+ nlist++;
+ }
+
+ /*
+ * Got the five-or-less best. Cut the list where the number of
+ * strata exceeds two.
+ */
+ count = 0;
+ for (i = 1; i < nlist; i++)
+ if (server_list[i]->stratum > server_list[i-1]->stratum) {
+ count++;
+ if (2 == count) {
+ nlist = i;
+ break;
+ }
+ }
+
+ /*
+ * Whew! What we should have by now is 0 to 5 candidates for
+ * the job of syncing us. If we have none, we're out of luck.
+ * If we have one, he's a winner. If we have more, do falseticker
+ * detection.
+ */
+
+ if (0 == nlist)
+ sys_server = NULL;
+ else if (1 == nlist) {
+ sys_server = server_list[0];
+ } else {
+ /*
+ * Re-sort by stratum, bdelay estimate quality and
+ * server.delay.
+ */
+ for (i = 0; i < nlist-1; i++)
+ for (j = i+1; j < nlist; j++) {
+ if (server_list[i]->stratum <
+ server_list[j]->stratum)
+ /* already sorted by stratum */
+ break;
+ if (server_list[i]->delay <
+ server_list[j]->delay)
+ continue;
+ server = server_list[i];
+ server_list[i] = server_list[j];
+ server_list[j] = server;
+ }
+
+ /*
+ * Calculate the fixed part of the dispersion limit
+ */
+ local_threshold = (FP_SECOND >> (-(int)NTPDATE_PRECISION))
+ + NTP_MAXSKW;
+
+ /*
+ * Now drop samples until we're down to one.
+ */
+ while (nlist > 1) {
+ for (k = 0; k < nlist; k++) {
+ server_badness[k] = 0;
+ for (j = 0; j < nlist; j++) {
+ if (j == k) /* with self? */
+ continue;
+ d = server_list[j]->soffset -
+ server_list[k]->soffset;
+ if (d < 0) /* abs value */
+ d = -d;
+ /*
+ * XXX This code *knows* that
+ * NTP_SELECT is 3/4
+ */
+ for (i = 0; i < j; i++)
+ d = (d>>1) + (d>>2);
+ server_badness[k] += d;
+ }
+ }
+
+ /*
+ * We now have an array of nlist badness
+ * coefficients. Find the badest. Find
+ * the minimum precision while we're at
+ * it.
+ */
+ i = 0;
+ n = server_list[0]->precision;;
+ for (j = 1; j < nlist; j++) {
+ if (server_badness[j] >= server_badness[i])
+ i = j;
+ if (n > server_list[j]->precision)
+ n = server_list[j]->precision;
+ }
+
+ /*
+ * i is the index of the server with the worst
+ * dispersion. If his dispersion is less than
+ * the threshold, stop now, else delete him and
+ * continue around again.
+ */
+ if ( (s_fp) server_badness[i] < (local_threshold
+ + (FP_SECOND >> (-n))))
+ break;
+ for (j = i + 1; j < nlist; j++)
+ server_list[j-1] = server_list[j];
+ nlist--;
+ }
+
+ /*
+ * What remains is a list of less than 5 servers. Take
+ * the best.
+ */
+ sys_server = server_list[0];
+ }
+
+ /*
+ * That's it. Return our server.
+ */
+ return sys_server;
+}
+
+
+/*
+ * clock_adjust - process what we've received, and adjust the time
+ * if we got anything decent.
+ */
+static int
+clock_adjust(void)
+{
+ register struct server *sp, *server;
+ s_fp absoffset;
+ int dostep;
+
+ for (sp = sys_servers; sp != NULL; sp = sp->next_server)
+ clock_filter(sp);
+ server = clock_select();
+
+ if (debug || simple_query) {
+ for (sp = sys_servers; sp != NULL; sp = sp->next_server)
+ printserver(sp, stdout);
+ }
+
+ if (server == 0) {
+ msyslog(LOG_ERR,
+ "no server suitable for synchronization found");
+ return(1);
+ }
+
+ if (always_step) {
+ dostep = 1;
+ } else if (never_step) {
+ dostep = 0;
+ } else {
+ absoffset = server->soffset;
+ if (absoffset < 0)
+ absoffset = -absoffset;
+ dostep = (absoffset >= NTPDATE_THRESHOLD || absoffset < 0);
+ }
+
+ if (dostep) {
+ if (simple_query || debug || l_step_systime(&server->offset)){
+ msyslog(LOG_NOTICE, "step time server %s offset %s sec",
+ stoa(&server->srcadr),
+ lfptoa(&server->offset, 6));
+ }
+ } else {
+#ifndef SYS_WINNT
+ if (simple_query || l_adj_systime(&server->offset)) {
+ msyslog(LOG_NOTICE, "adjust time server %s offset %s sec",
+ stoa(&server->srcadr),
+ lfptoa(&server->offset, 6));
+ }
+#else
+ /* The NT SetSystemTimeAdjustment() call achieves slewing by
+ * changing the clock frequency. This means that we cannot specify
+ * it to slew the clock by a definite amount and then stop like
+ * the Unix adjtime() routine. We can technically adjust the clock
+ * frequency, have ntpdate sleep for a while, and then wake
+ * up and reset the clock frequency, but this might cause some
+ * grief if the user attempts to run ntpd immediately after
+ * ntpdate and the socket is in use.
+ */
+ printf("\nThe -b option is required by ntpdate on Windows NT platforms\n");
+ exit(1);
+#endif /* SYS_WINNT */
+ }
+ return(0);
+}
+
+
+/*
+ * is_unreachable - check to see if we have a route to given destination
+ * (non-blocking).
+ */
+static int
+is_reachable (sockaddr_u *dst)
+{
+ SOCKET sockfd;
+
+ sockfd = socket(AF(dst), SOCK_DGRAM, 0);
+ if (sockfd == -1) {
+ return 0;
+ }
+
+ if (connect(sockfd, &dst->sa, SOCKLEN(dst))) {
+ closesocket(sockfd);
+ return 0;
+ }
+ closesocket(sockfd);
+ return 1;
+}
+
+
+
+/* XXX ELIMINATE: merge BIG slew into adj_systime in lib/systime.c */
+/*
+ * addserver - determine a server's address and allocate a new structure
+ * for it.
+ */
+static void
+addserver(
+ char *serv
+ )
+{
+ register struct server *server;
+ /* Address infos structure to store result of getaddrinfo */
+ struct addrinfo *addrResult, *ptr;
+ /* Address infos structure to store hints for getaddrinfo */
+ struct addrinfo hints;
+ /* Error variable for getaddrinfo */
+ int error;
+ /* Service name */
+ char service[5];
+ sockaddr_u addr;
+
+ strlcpy(service, "ntp", sizeof(service));
+
+ /* Get host address. Looking for UDP datagram connection. */
+ ZERO(hints);
+ hints.ai_family = ai_fam_templ;
+ hints.ai_socktype = SOCK_DGRAM;
+
+#ifdef DEBUG
+ if (debug)
+ printf("Looking for host %s and service %s\n", serv, service);
+#endif
+
+ error = getaddrinfo(serv, service, &hints, &addrResult);
+ if (error != 0) {
+ /* Conduct more refined error analysis */
+ if (error == EAI_FAIL || error == EAI_AGAIN){
+ /* Name server is unusable. Exit after failing on the
+ first server, in order to shorten the timeout caused
+ by waiting for resolution of several servers */
+ fprintf(stderr, "Exiting, name server cannot be used: %s (%d)",
+ gai_strerror(error), error);
+ msyslog(LOG_ERR, "name server cannot be used: %s (%d)",
+ gai_strerror(error), error);
+ exit(1);
+ }
+ fprintf(stderr, "Error resolving %s: %s (%d)\n", serv,
+ gai_strerror(error), error);
+ msyslog(LOG_ERR, "Can't find host %s: %s (%d)", serv,
+ gai_strerror(error), error);
+ return;
+ }
+#ifdef DEBUG
+ if (debug) {
+ ZERO(addr);
+ INSIST(addrResult->ai_addrlen <= sizeof(addr));
+ memcpy(&addr, addrResult->ai_addr, addrResult->ai_addrlen);
+ fprintf(stderr, "host found : %s\n", stohost(&addr));
+ }
+#endif
+
+ /* We must get all returned server in case the first one fails */
+ for (ptr = addrResult; ptr != NULL; ptr = ptr->ai_next) {
+ ZERO(addr);
+ INSIST(ptr->ai_addrlen <= sizeof(addr));
+ memcpy(&addr, ptr->ai_addr, ptr->ai_addrlen);
+ if (is_reachable(&addr)) {
+ server = emalloc_zero(sizeof(*server));
+ memcpy(&server->srcadr, ptr->ai_addr, ptr->ai_addrlen);
+ server->event_time = ++sys_numservers;
+ if (sys_servers == NULL)
+ sys_servers = server;
+ else {
+ struct server *sp;
+
+ for (sp = sys_servers; sp->next_server != NULL;
+ sp = sp->next_server)
+ /* empty */;
+ sp->next_server = server;
+ }
+ }
+ }
+
+ freeaddrinfo(addrResult);
+}
+
+
+/*
+ * findserver - find a server in the list given its address
+ * ***(For now it isn't totally AF-Independant, to check later..)
+ */
+static struct server *
+findserver(
+ sockaddr_u *addr
+ )
+{
+ struct server *server;
+ struct server *mc_server;
+
+ mc_server = NULL;
+ if (SRCPORT(addr) != NTP_PORT)
+ return 0;
+
+ for (server = sys_servers; server != NULL;
+ server = server->next_server) {
+ if (SOCK_EQ(addr, &server->srcadr))
+ return server;
+
+ if (AF(addr) == AF(&server->srcadr)) {
+ if (IS_MCAST(&server->srcadr))
+ mc_server = server;
+ }
+ }
+
+ if (mc_server != NULL) {
+
+ struct server *sp;
+
+ if (mc_server->event_time != 0) {
+ mc_server->event_time = 0;
+ complete_servers++;
+ }
+
+ server = emalloc_zero(sizeof(*server));
+
+ server->srcadr = *addr;
+
+ server->event_time = ++sys_numservers;
+
+ for (sp = sys_servers; sp->next_server != NULL;
+ sp = sp->next_server)
+ /* empty */;
+ sp->next_server = server;
+ transmit(server);
+ }
+ return NULL;
+}
+
+
+/*
+ * timer - process a timer interrupt
+ */
+void
+timer(void)
+{
+ struct server *server;
+
+ /*
+ * Bump the current idea of the time
+ */
+ current_time++;
+
+ /*
+ * Search through the server list looking for guys
+ * who's event timers have expired. Give these to
+ * the transmit routine.
+ */
+ for (server = sys_servers; server != NULL;
+ server = server->next_server) {
+ if (server->event_time != 0
+ && server->event_time <= current_time)
+ transmit(server);
+ }
+}
+
+
+/*
+ * The code duplication in the following subroutine sucks, but
+ * we need to appease ansi2knr.
+ */
+
+#ifndef SYS_WINNT
+/*
+ * alarming - record the occurance of an alarm interrupt
+ */
+static RETSIGTYPE
+alarming(
+ int sig
+ )
+{
+ alarm_flag++;
+}
+#else /* SYS_WINNT follows */
+void CALLBACK
+alarming(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
+{
+ UNUSED_ARG(uTimerID); UNUSED_ARG(uMsg); UNUSED_ARG(dwUser);
+ UNUSED_ARG(dw1); UNUSED_ARG(dw2);
+
+ alarm_flag++;
+}
+
+static void
+callTimeEndPeriod(void)
+{
+ timeEndPeriod( wTimerRes );
+ wTimerRes = 0;
+}
+#endif /* SYS_WINNT */
+
+
+/*
+ * init_alarm - set up the timer interrupt
+ */
+static void
+init_alarm(void)
+{
+#ifndef SYS_WINNT
+# ifdef HAVE_TIMER_CREATE
+ struct itimerspec its;
+# else
+ struct itimerval itv;
+# endif
+#else /* SYS_WINNT follows */
+ TIMECAPS tc;
+ UINT wTimerID;
+ HANDLE hToken;
+ TOKEN_PRIVILEGES tkp;
+ DWORD dwUser = 0;
+#endif /* SYS_WINNT */
+
+ alarm_flag = 0;
+
+#ifndef SYS_WINNT
+# ifdef HAVE_TIMER_CREATE
+ alarm_flag = 0;
+ /* this code was put in as setitimer() is non existant this us the
+ * POSIX "equivalents" setup - casey
+ */
+ /* ntpdate_timerid is global - so we can kill timer later */
+ if (timer_create (CLOCK_REALTIME, NULL, &ntpdate_timerid) ==
+# ifdef SYS_VXWORKS
+ ERROR
+# else
+ -1
+# endif
+ )
+ {
+ fprintf (stderr, "init_alarm(): timer_create (...) FAILED\n");
+ return;
+ }
+
+ /* TIMER_HZ = (5)
+ * Set up the alarm interrupt. The first comes 1/(2*TIMER_HZ)
+ * seconds from now and they continue on every 1/TIMER_HZ seconds.
+ */
+ signal_no_reset(SIGALRM, alarming);
+ its.it_interval.tv_sec = 0;
+ its.it_value.tv_sec = 0;
+ its.it_interval.tv_nsec = 1000000000/TIMER_HZ;
+ its.it_value.tv_nsec = 1000000000/(TIMER_HZ<<1);
+ timer_settime(ntpdate_timerid, 0 /* !TIMER_ABSTIME */, &its, NULL);
+# else /* !HAVE_TIMER_CREATE follows */
+ /*
+ * Set up the alarm interrupt. The first comes 1/(2*TIMER_HZ)
+ * seconds from now and they continue on every 1/TIMER_HZ seconds.
+ */
+ signal_no_reset(SIGALRM, alarming);
+ itv.it_interval.tv_sec = 0;
+ itv.it_value.tv_sec = 0;
+ itv.it_interval.tv_usec = 1000000/TIMER_HZ;
+ itv.it_value.tv_usec = 1000000/(TIMER_HZ<<1);
+
+ setitimer(ITIMER_REAL, &itv, NULL);
+# endif /* !HAVE_TIMER_CREATE */
+#else /* SYS_WINNT follows */
+ _tzset();
+
+ /*
+ * Get privileges needed for fiddling with the clock
+ */
+
+ /* get the current process token handle */
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
+ msyslog(LOG_ERR, "OpenProcessToken failed: %m");
+ exit(1);
+ }
+ /* get the LUID for system-time privilege. */
+ LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &tkp.Privileges[0].Luid);
+ tkp.PrivilegeCount = 1; /* one privilege to set */
+ tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+ /* get set-time privilege for this process. */
+ AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0);
+ /* cannot test return value of AdjustTokenPrivileges. */
+ if (GetLastError() != ERROR_SUCCESS)
+ msyslog(LOG_ERR, "AdjustTokenPrivileges failed: %m");
+
+ /*
+ * Set up timer interrupts for every 2**EVENT_TIMEOUT seconds
+ * Under Win/NT, expiry of timer interval leads to invocation
+ * of a callback function (on a different thread) rather than
+ * generating an alarm signal
+ */
+
+ /* determine max and min resolution supported */
+ if(timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) {
+ msyslog(LOG_ERR, "timeGetDevCaps failed: %m");
+ exit(1);
+ }
+ wTimerRes = min(max(tc.wPeriodMin, TARGET_RESOLUTION), tc.wPeriodMax);
+ /* establish the minimum timer resolution that we'll use */
+ timeBeginPeriod(wTimerRes);
+ atexit(callTimeEndPeriod);
+
+ /* start the timer event */
+ wTimerID = timeSetEvent(
+ (UINT) (1000/TIMER_HZ), /* Delay */
+ wTimerRes, /* Resolution */
+ (LPTIMECALLBACK) alarming, /* Callback function */
+ (DWORD) dwUser, /* User data */
+ TIME_PERIODIC); /* Event type (periodic) */
+ if (wTimerID == 0) {
+ msyslog(LOG_ERR, "timeSetEvent failed: %m");
+ exit(1);
+ }
+#endif /* SYS_WINNT */
+}
+
+
+
+
+/*
+ * We do asynchronous input using the SIGIO facility. A number of
+ * recvbuf buffers are preallocated for input. In the signal
+ * handler we poll to see if the socket is ready and read the
+ * packets from it into the recvbuf's along with a time stamp and
+ * an indication of the source host and the interface it was received
+ * through. This allows us to get as accurate receive time stamps
+ * as possible independent of other processing going on.
+ *
+ * We allocate a number of recvbufs equal to the number of servers
+ * plus 2. This should be plenty.
+ */
+
+
+/*
+ * init_io - initialize I/O data and open socket
+ */
+static void
+init_io(void)
+{
+ struct addrinfo *res, *ressave;
+ struct addrinfo hints;
+ sockaddr_u addr;
+ char service[5];
+ int rc;
+ int optval = 1;
+ int check_ntp_port_in_use = !debug && !simple_query && !unpriv_port;
+
+ /*
+ * Init buffer free list and stat counters
+ */
+ init_recvbuff(sys_numservers + 2);
+
+ /*
+ * Open the socket
+ */
+
+ strlcpy(service, "ntp", sizeof(service));
+
+ /*
+ * Init hints addrinfo structure
+ */
+ ZERO(hints);
+ hints.ai_family = ai_fam_templ;
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_socktype = SOCK_DGRAM;
+
+ if (getaddrinfo(NULL, service, &hints, &res) != 0) {
+ msyslog(LOG_ERR, "getaddrinfo() failed: %m");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+#ifdef SYS_WINNT
+ if (check_ntp_port_in_use && ntp_port_inuse(AF_INET, NTP_PORT)){
+ msyslog(LOG_ERR, "the NTP socket is in use, exiting: %m");
+ exit(1);
+ }
+#endif
+
+ /* Remember the address of the addrinfo structure chain */
+ ressave = res;
+
+ /*
+ * For each structure returned, open and bind socket
+ */
+ for(nbsock = 0; (nbsock < MAX_AF) && res ; res = res->ai_next) {
+ /* create a datagram (UDP) socket */
+ fd[nbsock] = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+ if (fd[nbsock] == SOCKET_ERROR) {
+#ifndef SYS_WINNT
+ if (errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT ||
+ errno == EPFNOSUPPORT)
+#else
+ int err = WSAGetLastError();
+ if (err == WSAEPROTONOSUPPORT || err == WSAEAFNOSUPPORT ||
+ err == WSAEPFNOSUPPORT)
+#endif
+ continue;
+ msyslog(LOG_ERR, "socket() failed: %m");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ /* set socket to reuse address */
+ if (setsockopt(fd[nbsock], SOL_SOCKET, SO_REUSEADDR, (void*) &optval, sizeof(optval)) < 0) {
+ msyslog(LOG_ERR, "setsockopt() SO_REUSEADDR failed: %m");
+ exit(1);
+ /*NOTREACHED*/
+ }
+#ifdef IPV6_V6ONLY
+ /* Restricts AF_INET6 socket to IPv6 communications (see RFC 2553bis-03) */
+ if (res->ai_family == AF_INET6)
+ if (setsockopt(fd[nbsock], IPPROTO_IPV6, IPV6_V6ONLY, (void*) &optval, sizeof(optval)) < 0) {
+ msyslog(LOG_ERR, "setsockopt() IPV6_V6ONLY failed: %m");
+ exit(1);
+ /*NOTREACHED*/
+ }
+#endif
+
+ /* Remember the socket family in fd_family structure */
+ fd_family[nbsock] = res->ai_family;
+
+ /*
+ * bind the socket to the NTP port
+ */
+ if (check_ntp_port_in_use) {
+ ZERO(addr);
+ INSIST(res->ai_addrlen <= sizeof(addr));
+ memcpy(&addr, res->ai_addr, res->ai_addrlen);
+ rc = bind(fd[nbsock], &addr.sa, SOCKLEN(&addr));
+ if (rc < 0) {
+ if (EADDRINUSE == socket_errno())
+ msyslog(LOG_ERR, "the NTP socket is in use, exiting");
+ else
+ msyslog(LOG_ERR, "bind() fails: %m");
+ exit(1);
+ }
+ }
+
+#ifdef HAVE_POLL_H
+ fdmask[nbsock].fd = fd[nbsock];
+ fdmask[nbsock].events = POLLIN;
+#else
+ FD_SET(fd[nbsock], &fdmask);
+ if (maxfd < fd[nbsock]+1) {
+ maxfd = fd[nbsock]+1;
+ }
+#endif
+
+ /*
+ * set non-blocking,
+ */
+#ifndef SYS_WINNT
+# ifdef SYS_VXWORKS
+ {
+ int on = TRUE;
+
+ if (ioctl(fd[nbsock],FIONBIO, &on) == ERROR) {
+ msyslog(LOG_ERR, "ioctl(FIONBIO) fails: %m");
+ exit(1);
+ }
+ }
+# else /* not SYS_VXWORKS */
+# if defined(O_NONBLOCK)
+ if (fcntl(fd[nbsock], F_SETFL, O_NONBLOCK) < 0) {
+ msyslog(LOG_ERR, "fcntl(FNDELAY|FASYNC) fails: %m");
+ exit(1);
+ /*NOTREACHED*/
+ }
+# else /* not O_NONBLOCK */
+# if defined(FNDELAY)
+ if (fcntl(fd[nbsock], F_SETFL, FNDELAY) < 0) {
+ msyslog(LOG_ERR, "fcntl(FNDELAY|FASYNC) fails: %m");
+ exit(1);
+ /*NOTREACHED*/
+ }
+# else /* FNDELAY */
+# include "Bletch: Need non blocking I/O"
+# endif /* FNDELAY */
+# endif /* not O_NONBLOCK */
+# endif /* SYS_VXWORKS */
+#else /* SYS_WINNT */
+ if (ioctlsocket(fd[nbsock], FIONBIO, (u_long *) &on) == SOCKET_ERROR) {
+ msyslog(LOG_ERR, "ioctlsocket(FIONBIO) fails: %m");
+ exit(1);
+ }
+#endif /* SYS_WINNT */
+ nbsock++;
+ }
+ freeaddrinfo(ressave);
+}
+
+/*
+ * sendpkt - send a packet to the specified destination
+ */
+static void
+sendpkt(
+ sockaddr_u *dest,
+ struct pkt *pkt,
+ int len
+ )
+{
+ int i;
+ int cc;
+ SOCKET sock = INVALID_SOCKET;
+
+#ifdef SYS_WINNT
+ DWORD err;
+#endif /* SYS_WINNT */
+
+ /* Find a local family compatible socket to send ntp packet to ntp server */
+ for(i = 0; (i < MAX_AF); i++) {
+ if(AF(dest) == fd_family[i]) {
+ sock = fd[i];
+ break;
+ }
+ }
+
+ if (INVALID_SOCKET == sock) {
+ msyslog(LOG_ERR, "cannot find family compatible socket to send ntp packet");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ cc = sendto(sock, (char *)pkt, len, 0, (struct sockaddr *)dest,
+ SOCKLEN(dest));
+
+ if (SOCKET_ERROR == cc) {
+#ifndef SYS_WINNT
+ if (errno != EWOULDBLOCK && errno != ENOBUFS)
+#else
+ err = WSAGetLastError();
+ if (err != WSAEWOULDBLOCK && err != WSAENOBUFS)
+#endif /* SYS_WINNT */
+ msyslog(LOG_ERR, "sendto(%s): %m", stohost(dest));
+ }
+}
+
+
+/*
+ * input_handler - receive packets asynchronously
+ */
+void
+input_handler(void)
+{
+ register int n;
+ register struct recvbuf *rb;
+ struct sock_timeval tvzero;
+ GETSOCKNAME_SOCKLEN_TYPE fromlen;
+ l_fp ts;
+ int i;
+#ifdef HAVE_POLL_H
+ struct pollfd fds[MAX_AF];
+#else
+ fd_set fds;
+#endif
+ int fdc = 0;
+
+ /*
+ * Do a poll to see if we have data
+ */
+ for (;;) {
+ tvzero.tv_sec = tvzero.tv_usec = 0;
+#ifdef HAVE_POLL_H
+ memcpy(fds, fdmask, sizeof(fdmask));
+ n = poll(fds, (unsigned int)nbsock, tvzero.tv_sec * 1000);
+
+ /*
+ * Determine which socket received data
+ */
+
+ for(i=0; i < nbsock; i++) {
+ if(fds[i].revents & POLLIN) {
+ fdc = fd[i];
+ break;
+ }
+ }
+
+#else
+ fds = fdmask;
+ n = select(maxfd, &fds, (fd_set *)0, (fd_set *)0, &tvzero);
+
+ /*
+ * Determine which socket received data
+ */
+
+ for(i=0; i < nbsock; i++) {
+ if(FD_ISSET(fd[i], &fds)) {
+ fdc = fd[i];
+ break;
+ }
+ }
+
+#endif
+
+ /*
+ * If nothing to do, just return. If an error occurred,
+ * complain and return. If we've got some, freeze a
+ * timestamp.
+ */
+ if (n == 0)
+ return;
+ else if (n == -1) {
+ if (errno != EINTR)
+ msyslog(LOG_ERR,
+#ifdef HAVE_POLL_H
+ "poll() error: %m"
+#else
+ "select() error: %m"
+#endif
+ );
+ return;
+ }
+ get_systime(&ts);
+
+ /*
+ * Get a buffer and read the frame. If we
+ * haven't got a buffer, or this is received
+ * on the wild card socket, just dump the packet.
+ */
+ if (initializing || free_recvbuffs() == 0) {
+ char buf[100];
+
+
+#ifndef SYS_WINNT
+ (void) read(fdc, buf, sizeof buf);
+#else
+ /* NT's _read does not operate on nonblocking sockets
+ * either recvfrom or ReadFile() has to be used here.
+ * ReadFile is used in [ntpd]ntp_intres() and ntpdc,
+ * just to be different use recvfrom() here
+ */
+ recvfrom(fdc, buf, sizeof(buf), 0, (struct sockaddr *)0, NULL);
+#endif /* SYS_WINNT */
+ continue;
+ }
+
+ rb = get_free_recv_buffer();
+
+ fromlen = sizeof(rb->recv_srcadr);
+ rb->recv_length = recvfrom(fdc, (char *)&rb->recv_pkt,
+ sizeof(rb->recv_pkt), 0,
+ (struct sockaddr *)&rb->recv_srcadr, &fromlen);
+ if (rb->recv_length == -1) {
+ freerecvbuf(rb);
+ continue;
+ }
+
+ /*
+ * Got one. Mark how and when it got here,
+ * put it on the full list.
+ */
+ rb->recv_time = ts;
+ add_full_recv_buffer(rb);
+ }
+}
+
+
+#if !defined SYS_WINNT && !defined SYS_CYGWIN32
+/*
+ * adj_systime - do a big long slew of the system time
+ */
+static int
+l_adj_systime(
+ l_fp *ts
+ )
+{
+ struct timeval adjtv, oadjtv;
+ int isneg = 0;
+ l_fp offset;
+#ifndef STEP_SLEW
+ l_fp overshoot;
+#endif
+
+ /*
+ * Take the absolute value of the offset
+ */
+ offset = *ts;
+ if (L_ISNEG(&offset)) {
+ isneg = 1;
+ L_NEG(&offset);
+ }
+
+#ifndef STEP_SLEW
+ /*
+ * Calculate the overshoot. XXX N.B. This code *knows*
+ * ADJ_OVERSHOOT is 1/2.
+ */
+ overshoot = offset;
+ L_RSHIFTU(&overshoot);
+ if (overshoot.l_ui != 0 || (overshoot.l_uf > ADJ_MAXOVERSHOOT)) {
+ overshoot.l_ui = 0;
+ overshoot.l_uf = ADJ_MAXOVERSHOOT;
+ }
+ L_ADD(&offset, &overshoot);
+#endif
+ TSTOTV(&offset, &adjtv);
+
+ if (isneg) {
+ adjtv.tv_sec = -adjtv.tv_sec;
+ adjtv.tv_usec = -adjtv.tv_usec;
+ }
+
+ if (adjtv.tv_usec != 0 && !debug) {
+ if (adjtime(&adjtv, &oadjtv) < 0) {
+ msyslog(LOG_ERR, "Can't adjust the time of day: %m");
+ exit(1);
+ }
+ }
+ return 1;
+}
+#endif /* SYS_WINNT */
+
+
+/*
+ * This fuction is not the same as lib/systime step_systime!!!
+ */
+static int
+l_step_systime(
+ l_fp *ts
+ )
+{
+ double dtemp;
+
+#ifdef SLEWALWAYS
+#ifdef STEP_SLEW
+ l_fp ftmp;
+ int isneg;
+ int n;
+
+ if (debug) return 1;
+ /*
+ * Take the absolute value of the offset
+ */
+ ftmp = *ts;
+ if (L_ISNEG(&ftmp)) {
+ L_NEG(&ftmp);
+ isneg = 1;
+ } else
+ isneg = 0;
+
+ if (ftmp.l_ui >= 3) { /* Step it and slew - we might win */
+ LFPTOD(ts, dtemp);
+ n = step_systime(dtemp);
+ if (!n)
+ return n;
+ if (isneg)
+ ts->l_ui = ~0;
+ else
+ ts->l_ui = ~0;
+ }
+ /*
+ * Just add adjustment into the current offset. The update
+ * routine will take care of bringing the system clock into
+ * line.
+ */
+#endif
+ if (debug)
+ return 1;
+#ifdef FORCE_NTPDATE_STEP
+ LFPTOD(ts, dtemp);
+ return step_systime(dtemp);
+#else
+ l_adj_systime(ts);
+ return 1;
+#endif
+#else /* SLEWALWAYS */
+ if (debug)
+ return 1;
+ LFPTOD(ts, dtemp);
+ return step_systime(dtemp);
+#endif /* SLEWALWAYS */
+}
+
+
+/* XXX ELIMINATE printserver similar in ntptrace.c, ntpdate.c */
+/*
+ * printserver - print detail information for a server
+ */
+static void
+printserver(
+ register struct server *pp,
+ FILE *fp
+ )
+{
+ register int i;
+ char junk[5];
+ const char *str;
+
+ if (!debug) {
+ (void) fprintf(fp, "server %s, stratum %d, offset %s, delay %s\n",
+ stoa(&pp->srcadr), pp->stratum,
+ lfptoa(&pp->offset, 6), fptoa((s_fp)pp->delay, 5));
+ return;
+ }
+
+ (void) fprintf(fp, "server %s, port %d\n",
+ stoa(&pp->srcadr), ntohs(((struct sockaddr_in*)&(pp->srcadr))->sin_port));
+
+ (void) fprintf(fp, "stratum %d, precision %d, leap %c%c, trust %03o\n",
+ pp->stratum, pp->precision,
+ pp->leap & 0x2 ? '1' : '0',
+ pp->leap & 0x1 ? '1' : '0',
+ pp->trust);
+
+ if (pp->stratum == 1) {
+ junk[4] = 0;
+ memmove(junk, (char *)&pp->refid, 4);
+ str = junk;
+ } else {
+ str = stoa(&pp->srcadr);
+ }
+ (void) fprintf(fp,
+ "refid [%s], delay %s, dispersion %s\n",
+ str, fptoa((s_fp)pp->delay, 5),
+ ufptoa(pp->dispersion, 5));
+
+ (void) fprintf(fp, "transmitted %d, in filter %d\n",
+ pp->xmtcnt, pp->filter_nextpt);
+
+ (void) fprintf(fp, "reference time: %s\n",
+ prettydate(&pp->reftime));
+ (void) fprintf(fp, "originate timestamp: %s\n",
+ prettydate(&pp->org));
+ (void) fprintf(fp, "transmit timestamp: %s\n",
+ prettydate(&pp->xmt));
+
+ (void) fprintf(fp, "filter delay: ");
+ for (i = 0; i < NTP_SHIFT; i++) {
+ (void) fprintf(fp, " %-8.8s", fptoa(pp->filter_delay[i], 5));
+ if (i == (NTP_SHIFT>>1)-1)
+ (void) fprintf(fp, "\n ");
+ }
+ (void) fprintf(fp, "\n");
+
+ (void) fprintf(fp, "filter offset:");
+ for (i = 0; i < PEER_SHIFT; i++) {
+ (void) fprintf(fp, " %-8.8s", lfptoa(&pp->filter_offset[i], 6));
+ if (i == (PEER_SHIFT>>1)-1)
+ (void) fprintf(fp, "\n ");
+ }
+ (void) fprintf(fp, "\n");
+
+ (void) fprintf(fp, "delay %s, dispersion %s\n",
+ fptoa((s_fp)pp->delay, 5), ufptoa(pp->dispersion, 5));
+
+ (void) fprintf(fp, "offset %s\n\n",
+ lfptoa(&pp->offset, 6));
+}
+
+
+#ifdef HAVE_NETINFO
+static ni_namelist *
+getnetinfoservers(void)
+{
+ ni_status status;
+ void *domain;
+ ni_id confdir;
+ ni_namelist *namelist = emalloc(sizeof(ni_namelist));
+
+ /* Find a time server in NetInfo */
+ if ((status = ni_open(NULL, ".", &domain)) != NI_OK) return NULL;
+
+ while (status = ni_pathsearch(domain, &confdir, NETINFO_CONFIG_DIR) == NI_NODIR) {
+ void *next_domain;
+ if (ni_open(domain, "..", &next_domain) != NI_OK) break;
+ ni_free(domain);
+ domain = next_domain;
+ }
+ if (status != NI_OK) return NULL;
+
+ NI_INIT(namelist);
+ if (ni_lookupprop(domain, &confdir, "server", namelist) != NI_OK) {
+ ni_namelist_free(namelist);
+ free(namelist);
+ return NULL;
+ }
+
+ return(namelist);
+}
+#endif
+
+#ifdef SYS_WINNT
+isc_boolean_t ntp_port_inuse(int af, u_short port)
+{
+ /*
+ * Check if NTP socket is already in use on this system
+ * This is only for Windows Systems, as they tend not to fail on the real bind() below
+ */
+
+ SOCKET checksocket;
+ struct sockaddr_in checkservice;
+ checksocket = socket(af, SOCK_DGRAM, 0);
+ if (checksocket == INVALID_SOCKET) {
+ return (ISC_TRUE);
+ }
+
+ checkservice.sin_family = (short) AF_INET;
+ checkservice.sin_addr.s_addr = INADDR_LOOPBACK;
+ checkservice.sin_port = htons(port);
+
+ if (bind(checksocket, (struct sockaddr *)&checkservice,
+ sizeof(checkservice)) == SOCKET_ERROR) {
+ if ( WSAGetLastError() == WSAEADDRINUSE ){
+ closesocket(checksocket);
+ return (ISC_TRUE);
+ }
+ }
+ closesocket(checksocket);
+ return (ISC_FALSE);
+}
+#endif
diff --git a/ntpdate/ntpdate.h b/ntpdate/ntpdate.h
new file mode 100644
index 0000000..df9c49e
--- /dev/null
+++ b/ntpdate/ntpdate.h
@@ -0,0 +1,108 @@
+/*
+ * ntpdate.h - declarations for the ntpdate and ntptimeset programs
+ */
+
+#include "ntp_malloc.h"
+
+extern void loadservers (char *cfgpath);
+
+/*
+ * The server structure is a much simplified version of the
+ * peer structure, for ntpdate's use. Since we always send
+ * in client mode and expect to receive in server mode, this
+ * leaves only a very limited number of things we need to
+ * remember about the server.
+ */
+struct server {
+ struct server *next_server; /* next server in build list */
+ sockaddr_u srcadr; /* address of remote host */
+ u_char version; /* version to use */
+ u_char leap; /* leap indicator */
+ u_char stratum; /* stratum of remote server */
+ s_char precision; /* server's clock precision */
+ u_char trust; /* trustability of the filtered data */
+ u_fp rootdelay; /* distance from primary clock */
+ u_fp rootdisp; /* peer clock dispersion */
+ u_int32 refid; /* peer reference ID */
+ l_fp reftime; /* time of peer's last update */
+ u_long event_time; /* time for next timeout */
+ u_long last_xmit; /* time of last transmit */
+ u_short xmtcnt; /* number of packets transmitted */
+ u_short rcvcnt; /* number of packets received */
+ u_char reach; /* reachability, NTP_WINDOW bits */
+ u_short filter_nextpt; /* index into filter shift register */
+ s_fp filter_delay[NTP_SHIFT]; /* delay part of shift register */
+ l_fp filter_offset[NTP_SHIFT]; /* offset part of shift register */
+ s_fp filter_soffset[NTP_SHIFT]; /* offset in s_fp format, for disp */
+ u_fp filter_error[NTP_SHIFT]; /* error part of shift register */
+ l_fp org; /* peer's originate time stamp */
+ l_fp xmt; /* transmit time stamp */
+ u_fp delay; /* filter estimated delay */
+ u_fp dispersion; /* filter estimated dispersion */
+ l_fp offset; /* filter estimated clock offset */
+ s_fp soffset; /* fp version of above */
+};
+
+
+/*
+ * ntpdate runs everything on a simple, short timeout. It sends a
+ * packet and sets the timeout (by default, to a small value suitable
+ * for a LAN). If it receives a response it sends another request.
+ * If it times out it shifts zeroes into the filter and sends another
+ * request.
+ *
+ * The timer routine is run often (once every 1/5 second currently)
+ * so that time outs are done with reasonable precision.
+ */
+#define TIMER_HZ (5) /* 5 per second */
+
+/*
+ * ntpdate will make a long adjustment using adjtime() if the times
+ * are close, or step the time if the times are farther apart. The
+ * following defines what is "close".
+ */
+#define NTPDATE_THRESHOLD (FP_SECOND >> 1) /* 1/2 second */
+
+#define NTP_MAXAGE 86400 /* one day in seconds */
+
+/*
+ * When doing adjustments, ntpdate actually overadjusts (currently
+ * by 50%, though this may change). While this will make it take longer
+ * to reach a steady state condition, it will typically result in
+ * the clock keeping more accurate time, on average. The amount of
+ * overshoot is limited.
+ */
+#ifdef NOTNOW
+#define ADJ_OVERSHOOT 1/2 /* this is hard coded */
+#endif /* NOTNOW */
+#define ADJ_MAXOVERSHOOT 0x10000000 /* 50 ms as a ts fraction */
+
+/*
+ * Since ntpdate isn't aware of some of the things that normally get
+ * put in an NTP packet, we fix some values.
+ */
+#define NTPDATE_PRECISION (-6) /* use this precision */
+#define NTPDATE_DISTANCE FP_SECOND /* distance is 1 sec */
+#define NTPDATE_DISP FP_SECOND /* so is the dispersion */
+#define NTPDATE_REFID (0) /* reference ID to use */
+#define PEER_MAXDISP (64*FP_SECOND) /* maximum dispersion (fp 64) */
+
+
+/*
+ * No less than 2s between requests to a server to stay within ntpd's
+ * default "discard minimum 1" (and 1s enforcement slop). That is
+ * enforced only if the nondefault limited restriction is in place, such
+ * as with "restrict ... limited" and "restrict ... kod limited".
+ */
+#define MINTIMEOUT (1 * TIMER_HZ) /* 1s min. between packets */
+#define DEFTIMEOUT (2 * TIMER_HZ) /* 2s by default */
+#define DEFSAMPLES 4 /* get 4 samples per server */
+#define DEFPRECISION (-5) /* the precision we claim */
+#define DEFMAXPERIOD 60 /* maximum time to wait */
+#define DEFMINSERVERS 3 /* minimum responding servers */
+#define DEFMINVALID 1 /* mimimum servers with valid time */
+
+/*
+ * Define the max number of sockets we can open
+ */
+#define MAX_AF 2
diff --git a/ntpdc/Makefile.am b/ntpdc/Makefile.am
new file mode 100644
index 0000000..a61dab9
--- /dev/null
+++ b/ntpdc/Makefile.am
@@ -0,0 +1,151 @@
+NULL=
+
+bin_PROGRAMS= $(NTPDC_DB)
+libexec_PROGRAMS= $(NTPDC_DL)
+sbin_PROGRAMS= $(NTPDC_DS)
+
+EXTRA_PROGRAMS= ntpdc ntpdc-layout
+EXTRA_DATA= check-layout
+BUILT_SOURCES= @MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+ntpdc_LDADD = version.o $(LIBOPTS_LDADD)
+ntpdc_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
+ntpdc_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS)
+ntpdc_LDADD += $(LDADD_NTP)
+# ntpdc-layout doesn't need any additional libraries at all
+ntpdc_layout_LDADD=
+
+DISTCLEANFILES= .version version.c config.log $(man_MANS)
+CLEANFILES= check-layout layout.here nl.c ntpdc-layout
+noinst_HEADERS= ntpdc.h
+ETAGS_ARGS= Makefile.am
+EXTRA_DIST= \
+ invoke-ntpdc.menu \
+ invoke-ntpdc.texi \
+ layout.std \
+ nl_in.c \
+ nl.pl \
+ ntpdc-opts.def \
+ ntpdc.1ntpdcman \
+ ntpdc.1ntpdcmdoc \
+ ntpdc.man.in \
+ ntpdc.mdoc.in \
+ ntpdc.html \
+ ntpdc.texi \
+ $(NULL)
+
+man1_MANS=
+man8_MANS=
+man_MANS= ntpdc.$(NTPDC_MS)
+
+## HMS: Real Soon Now...
+##info_TEXINFOS= ntpdc.texi
+##ntpdc_TEXINFOS= ntpdc-opts.texi
+
+html_DATA= \
+ $(srcdir)/ntpdc.html \
+ $(NULL)
+
+noinst_DATA= \
+ $(srcdir)/invoke-ntpdc.menu \
+ $(srcdir)/invoke-ntpdc.texi \
+ $(srcdir)/ntpdc.man.in \
+ $(srcdir)/ntpdc.mdoc.in \
+ $(NULL)
+
+install-data-local: install-html
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+$(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) ntpdc-opts.def
+
+###
+
+$(srcdir)/ntpdc.1ntpdcman: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdcman -Tagman-cmd.tpl ntpdc-opts.def
+
+$(srcdir)/ntpdc.man.in: $(srcdir)/ntpdc.1ntpdcman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcman > $(srcdir)/ntpdc.man.in+
+ mv $(srcdir)/ntpdc.man.in+ $(srcdir)/ntpdc.man.in
+
+###
+
+$(srcdir)/ntpdc.1ntpdcmdoc: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdcmdoc -Tagmdoc-cmd.tpl ntpdc-opts.def
+
+$(srcdir)/ntpdc.mdoc.in: $(srcdir)/ntpdc.1ntpdcmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcmdoc > $(srcdir)/ntpdc.mdoc.in+
+ mv $(srcdir)/ntpdc.mdoc.in+ $(srcdir)/ntpdc.mdoc.in
+
+###
+
+ntpdc.$(NTPDC_MS): $(srcdir)/ntpdc.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpdc.$(NTPDC_MS)+:$(srcdir)/ntpdc.$(MANTAGFMT).in
+ mv ntpdc.$(NTPDC_MS)+ ntpdc.$(NTPDC_MS)
+
+###
+
+$(srcdir)/invoke-ntpdc.menu: $(srcdir)/invoke-ntpdc.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpdc.texi: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntpdc.html: $(srcdir)/invoke-ntpdc.menu $(srcdir)/invoke-ntpdc.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpdc.html ntpdc.texi || true )
+
+ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h
+
+ntpdc-layout.o: nl.c
+
+layout.here: ntpdc-layout
+ ./ntpdc-layout > $@
+
+check-layout: ntpdc-layout $(srcdir)/layout.std layout.here
+ cmp $(srcdir)/layout.std layout.here && echo stamp > $@
+
+$(PROGRAMS): version.o
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdc
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+# I ran nl_in.c (attached, to be installed into ntpdc) through
+# $(CC) -E nl_in.c | nl.pl > nl.c
+nl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h
+ $(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/check-libopts.mf
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/ntpdc/Makefile.in b/ntpdc/Makefile.in
new file mode 100644
index 0000000..b31604d
--- /dev/null
+++ b/ntpdc/Makefile.in
@@ -0,0 +1,1180 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = ntpdc$(EXEEXT) ntpdc-layout$(EXEEXT)
+DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/nl.pl.in \
+ $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/check-libntp.mf
+subdir = ntpdc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = nl.pl
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+am_ntpdc_OBJECTS = ntpdc.$(OBJEXT) ntpdc_ops.$(OBJEXT) \
+ ntpdc-opts.$(OBJEXT)
+ntpdc_OBJECTS = $(am_ntpdc_OBJECTS)
+am__DEPENDENCIES_1 =
+ntpdc_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) \
+ ../libntp/libntp.a $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+ntpdc_layout_SOURCES = ntpdc-layout.c
+ntpdc_layout_OBJECTS = ntpdc-layout.$(OBJEXT)
+ntpdc_layout_DEPENDENCIES =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(ntpdc_SOURCES) ntpdc-layout.c
+DIST_SOURCES = $(ntpdc_SOURCES) ntpdc-layout.c
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+bin_PROGRAMS = $(NTPDC_DB)
+libexec_PROGRAMS = $(NTPDC_DL)
+sbin_PROGRAMS = $(NTPDC_DS)
+EXTRA_DATA = check-layout
+BUILT_SOURCES = @MAKE_CHECK_LAYOUT@ ntpdc-opts.c ntpdc-opts.h \
+ check-libopts check-libntp .deps-ver
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+ntpdc_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \
+ $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(EDITLINE_LIBS) \
+ $(LDADD_NTP)
+# ntpdc-layout doesn't need any additional libraries at all
+ntpdc_layout_LDADD =
+DISTCLEANFILES = .version version.c config.log $(man_MANS)
+CLEANFILES = check-layout layout.here nl.c ntpdc-layout check-libopts \
+ check-libntp .deps-ver
+noinst_HEADERS = ntpdc.h
+ETAGS_ARGS = Makefile.am
+EXTRA_DIST = \
+ invoke-ntpdc.menu \
+ invoke-ntpdc.texi \
+ layout.std \
+ nl_in.c \
+ nl.pl \
+ ntpdc-opts.def \
+ ntpdc.1ntpdcman \
+ ntpdc.1ntpdcmdoc \
+ ntpdc.man.in \
+ ntpdc.mdoc.in \
+ ntpdc.html \
+ ntpdc.texi \
+ $(NULL)
+
+man1_MANS =
+man8_MANS =
+man_MANS = ntpdc.$(NTPDC_MS)
+html_DATA = \
+ $(srcdir)/ntpdc.html \
+ $(NULL)
+
+noinst_DATA = \
+ $(srcdir)/invoke-ntpdc.menu \
+ $(srcdir)/invoke-ntpdc.texi \
+ $(srcdir)/ntpdc.man.in \
+ $(srcdir)/ntpdc.mdoc.in \
+ $(NULL)
+
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/sntp/check-libntp.mf $(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 ntpdc/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ntpdc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+nl.pl: $(top_builddir)/config.status $(srcdir)/nl.pl.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+ntpdc$(EXEEXT): $(ntpdc_OBJECTS) $(ntpdc_DEPENDENCIES)
+ @rm -f ntpdc$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntpdc_OBJECTS) $(ntpdc_LDADD) $(LIBS)
+ntpdc-layout$(EXEEXT): $(ntpdc_layout_OBJECTS) $(ntpdc_layout_DEPENDENCIES)
+ @rm -f ntpdc-layout$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntpdc_layout_OBJECTS) $(ntpdc_layout_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc-layout.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc-opts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdc_ops.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: all check install install-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-sbinPROGRAMS ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-data-local install-dvi install-dvi-am install-exec \
+ install-exec-am install-exec-hook install-html install-html-am \
+ install-htmlDATA install-info install-info-am \
+ install-libexecPROGRAMS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinPROGRAMS install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-htmlDATA uninstall-libexecPROGRAMS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinPROGRAMS
+
+
+install-data-local: install-html
+
+$(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) ntpdc-opts.def
+
+###
+
+$(srcdir)/ntpdc.1ntpdcman: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdcman -Tagman-cmd.tpl ntpdc-opts.def
+
+$(srcdir)/ntpdc.man.in: $(srcdir)/ntpdc.1ntpdcman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcman > $(srcdir)/ntpdc.man.in+
+ mv $(srcdir)/ntpdc.man.in+ $(srcdir)/ntpdc.man.in
+
+###
+
+$(srcdir)/ntpdc.1ntpdcmdoc: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpdcmdoc -Tagmdoc-cmd.tpl ntpdc-opts.def
+
+$(srcdir)/ntpdc.mdoc.in: $(srcdir)/ntpdc.1ntpdcmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcmdoc > $(srcdir)/ntpdc.mdoc.in+
+ mv $(srcdir)/ntpdc.mdoc.in+ $(srcdir)/ntpdc.mdoc.in
+
+###
+
+ntpdc.$(NTPDC_MS): $(srcdir)/ntpdc.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpdc.$(NTPDC_MS)+:$(srcdir)/ntpdc.$(MANTAGFMT).in
+ mv ntpdc.$(NTPDC_MS)+ ntpdc.$(NTPDC_MS)
+
+###
+
+$(srcdir)/invoke-ntpdc.menu: $(srcdir)/invoke-ntpdc.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpdc.texi: $(srcdir)/ntpdc-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntpdc.html: $(srcdir)/invoke-ntpdc.menu $(srcdir)/invoke-ntpdc.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpdc.html ntpdc.texi || true )
+
+ntpdc-layout.o: nl.c
+
+layout.here: ntpdc-layout
+ ./ntpdc-layout > $@
+
+check-layout: ntpdc-layout $(srcdir)/layout.std layout.here
+ cmp $(srcdir)/layout.std layout.here && echo stamp > $@
+
+$(PROGRAMS): version.o
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdc
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+# I ran nl_in.c (attached, to be installed into ntpdc) through
+# $(CC) -E nl_in.c | nl.pl > nl.c
+nl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h
+ $(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libopts: ../sntp/libopts/libopts.la
+ @echo stamp > $@
+
+../sntp/libopts/libopts.la:
+ -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/ntpdc/README b/ntpdc/README
new file mode 100644
index 0000000..618e846
--- /dev/null
+++ b/ntpdc/README
@@ -0,0 +1,6 @@
+README file for directory ./xntpdc of the NTP Version 4 distribution
+
+This directory contains the sources for the xntpdc utility program. See
+the README and RELNOTES files in the parent directory for directions on
+how to make and install this program. The current version number of this
+program is in the version.c file.
diff --git a/ntpdc/invoke-ntpdc.menu b/ntpdc/invoke-ntpdc.menu
new file mode 100644
index 0000000..42ca3b4
--- /dev/null
+++ b/ntpdc/invoke-ntpdc.menu
@@ -0,0 +1 @@
+* ntpdc Invocation:: Invoking ntpdc
diff --git a/ntpdc/invoke-ntpdc.texi b/ntpdc/invoke-ntpdc.texi
new file mode 100644
index 0000000..57c73e5
--- /dev/null
+++ b/ntpdc/invoke-ntpdc.texi
@@ -0,0 +1,349 @@
+@node ntpdc Invocation
+@section Invoking ntpdc
+@pindex ntpdc
+@cindex vendor-specific NTPD control program
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:57:32 AM by AutoGen 5.18.5pre4
+# From the definitions ntpdc-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+@code{ntpdc}
+is deprecated.
+Please use
+@code{ntpq(1ntpqmdoc)} instead - it can do everything
+@code{ntpdc}
+used to do, and it does so using a much more sane interface.
+
+@code{ntpdc}
+is a utility program used to query
+@code{ntpd(1ntpdmdoc)}
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+@code{ntpdc}
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+@code{ntpdc}
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpdc} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpdc usage:: ntpdc help/usage (@option{--help})
+* ntpdc ipv4:: ipv4 option (-4)
+* ntpdc ipv6:: ipv6 option (-6)
+* ntpdc command:: command option (-c)
+* ntpdc interactive:: interactive option (-i)
+* ntpdc listpeers:: listpeers option (-l)
+* ntpdc numeric:: numeric option (-n)
+* ntpdc peers:: peers option (-p)
+* ntpdc showpeers:: showpeers option (-s)
+* ntpdc config:: presetting/configuring ntpdc
+* ntpdc exit status:: exit status
+* ntpdc Usage:: Usage
+* ntpdc See Also:: See Also
+* ntpdc Authors:: Authors
+* ntpdc Bugs:: Bugs
+@end menu
+
+@node ntpdc usage
+@subsection ntpdc help/usage (@option{--help})
+@cindex ntpdc help
+
+This is the automatically generated usage text for ntpdc.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p482
+Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
+ Flg Arg Option-Name Description
+ -4 no ipv4 Force IPv4 DNS name resolution
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -c Str command run a command and exit
+ - may appear multiple times
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -i no interactive Force ntpq to operate in interactive mode
+ - prohibits these options:
+ command
+ listpeers
+ peers
+ showpeers
+ -l no listpeers Print a list of the peers
+ - prohibits the option 'command'
+ -n no numeric numeric host addresses
+ -p no peers Print a list of the peers
+ - prohibits the option 'command'
+ -s no showpeers Show a list of the peers
+ - prohibits the option 'command'
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -> opt save-opts save the option state to a config file
+ -< Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTPDC_*
+
+Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org>
+@end example
+@exampleindent 4
+
+@node ntpdc ipv4
+@subsection ipv4 option (-4)
+@cindex ntpdc-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+@node ntpdc ipv6
+@subsection ipv6 option (-6)
+@cindex ntpdc-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+@node ntpdc command
+@subsection command option (-c)
+@cindex ntpdc-command
+
+This is the ``run a command and exit'' option.
+This option takes a string argument @file{cmd}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+@node ntpdc interactive
+@subsection interactive option (-i)
+@cindex ntpdc-interactive
+
+This is the ``force ntpq to operate in interactive mode'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command, listpeers, peers, showpeers.
+@end itemize
+
+Force ntpq to operate in interactive mode. Prompts will be written
+to the standard output and commands read from the standard input.
+@node ntpdc listpeers
+@subsection listpeers option (-l)
+@cindex ntpdc-listpeers
+
+This is the ``print a list of the peers'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary of
+their state. This is equivalent to the 'listpeers' interactive command.
+@node ntpdc numeric
+@subsection numeric option (-n)
+@cindex ntpdc-numeric
+
+This is the ``numeric host addresses'' option.
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+@node ntpdc peers
+@subsection peers option (-p)
+@cindex ntpdc-peers
+
+This is the ``print a list of the peers'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+@node ntpdc showpeers
+@subsection showpeers option (-s)
+@cindex ntpdc-showpeers
+
+This is the ``show a list of the peers'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'dmpeers' interactive command.
+
+
+@node ntpdc config
+@subsection presetting/configuring ntpdc
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTPDC} and @code{NTPDC_<OPTION_NAME>}. @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPDC} variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntpdc} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+@example
+[NTPDC]
+@end example
+@noindent
+or by
+@example
+<?program ntpdc>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+ <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions. You simply note that it is a
+hierarchicly valued option. @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version. This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpdc exit status
+@subsection ntpdc exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error. Please report
+it to autogen-users@@lists.sourceforge.net. Thank you.
+@end table
+@node ntpdc Usage
+@subsection ntpdc Usage
+@node ntpdc See Also
+@subsection ntpdc See Also
+@node ntpdc Authors
+@subsection ntpdc Authors
+@node ntpdc Bugs
+@subsection ntpdc Bugs
diff --git a/ntpdc/layout.std b/ntpdc/layout.std
new file mode 100644
index 0000000..6117f52
--- /dev/null
+++ b/ntpdc/layout.std
@@ -0,0 +1,447 @@
+sizeof(union req_data_u_tag) = 176
+offsetof(u32) = 0
+offsetof(data) = 0
+
+sizeof(struct req_pkt) = 216
+offsetof(rm_vn_mode) = 0
+offsetof(auth_seq) = 1
+offsetof(implementation) = 2
+offsetof(request) = 3
+offsetof(err_nitems) = 4
+offsetof(mbz_itemsize) = 6
+offsetof(u) = 8
+offsetof(tstamp) = 184
+offsetof(keyid) = 192
+offsetof(mac) = 196
+
+sizeof(struct req_pkt_tail) = 32
+offsetof(tstamp) = 0
+offsetof(keyid) = 8
+offsetof(mac) = 12
+
+sizeof(union resp_pkt_u_tag) = 500
+offsetof(data) = 0
+offsetof(u32) = 0
+
+sizeof(struct resp_pkt) = 508
+offsetof(rm_vn_mode) = 0
+offsetof(auth_seq) = 1
+offsetof(implementation) = 2
+offsetof(request) = 3
+offsetof(err_nitems) = 4
+offsetof(mbz_itemsize) = 6
+offsetof(u) = 8
+
+sizeof(struct info_peer_list) = 32
+offsetof(addr) = 0
+offsetof(port) = 4
+offsetof(hmode) = 6
+offsetof(flags) = 7
+offsetof(v6_flag) = 8
+offsetof(unused1) = 12
+offsetof(addr6) = 16
+
+sizeof(struct info_peer_summary) = 72
+offsetof(dstadr) = 0
+offsetof(srcadr) = 4
+offsetof(srcport) = 8
+offsetof(stratum) = 10
+offsetof(hpoll) = 11
+offsetof(ppoll) = 12
+offsetof(reach) = 13
+offsetof(flags) = 14
+offsetof(hmode) = 15
+offsetof(delay) = 16
+offsetof(offset) = 20
+offsetof(dispersion) = 28
+offsetof(v6_flag) = 32
+offsetof(unused1) = 36
+offsetof(dstadr6) = 40
+offsetof(srcadr6) = 56
+
+sizeof(struct info_peer) = 280
+offsetof(dstadr) = 0
+offsetof(srcadr) = 4
+offsetof(srcport) = 8
+offsetof(flags) = 10
+offsetof(leap) = 11
+offsetof(hmode) = 12
+offsetof(pmode) = 13
+offsetof(stratum) = 14
+offsetof(ppoll) = 15
+offsetof(hpoll) = 16
+offsetof(precision) = 17
+offsetof(version) = 18
+offsetof(unused8) = 19
+offsetof(reach) = 20
+offsetof(unreach) = 21
+offsetof(flash) = 22
+offsetof(ttl) = 23
+offsetof(flash2) = 24
+offsetof(associd) = 26
+offsetof(keyid) = 28
+offsetof(pkeyid) = 32
+offsetof(refid) = 36
+offsetof(timer) = 40
+offsetof(rootdelay) = 44
+offsetof(rootdispersion) = 48
+offsetof(reftime) = 52
+offsetof(org) = 60
+offsetof(rec) = 68
+offsetof(xmt) = 76
+offsetof(filtdelay) = 84
+offsetof(filtoffset) = 116
+offsetof(order) = 180
+offsetof(delay) = 188
+offsetof(dispersion) = 192
+offsetof(offset) = 196
+offsetof(selectdisp) = 204
+offsetof(unused1) = 208
+offsetof(unused2) = 212
+offsetof(unused3) = 216
+offsetof(unused4) = 220
+offsetof(unused5) = 224
+offsetof(unused6) = 228
+offsetof(unused7) = 232
+offsetof(estbdelay) = 236
+offsetof(v6_flag) = 240
+offsetof(unused9) = 244
+offsetof(dstadr6) = 248
+offsetof(srcadr6) = 264
+
+sizeof(struct info_peer_stats) = 120
+offsetof(dstadr) = 0
+offsetof(srcadr) = 4
+offsetof(srcport) = 8
+offsetof(flags) = 10
+offsetof(timereset) = 12
+offsetof(timereceived) = 16
+offsetof(timetosend) = 20
+offsetof(timereachable) = 24
+offsetof(sent) = 28
+offsetof(unused1) = 32
+offsetof(processed) = 36
+offsetof(unused2) = 40
+offsetof(badauth) = 44
+offsetof(bogusorg) = 48
+offsetof(oldpkt) = 52
+offsetof(unused3) = 56
+offsetof(unused4) = 60
+offsetof(seldisp) = 64
+offsetof(selbroken) = 68
+offsetof(unused5) = 72
+offsetof(candidate) = 76
+offsetof(unused6) = 77
+offsetof(unused7) = 78
+offsetof(unused8) = 79
+offsetof(v6_flag) = 80
+offsetof(unused9) = 84
+offsetof(dstadr6) = 88
+offsetof(srcadr6) = 104
+
+sizeof(struct info_loop) = 24
+offsetof(last_offset) = 0
+offsetof(drift_comp) = 8
+offsetof(compliance) = 16
+offsetof(watchdog_timer) = 20
+
+sizeof(struct info_sys) = 80
+offsetof(peer) = 0
+offsetof(peer_mode) = 4
+offsetof(leap) = 5
+offsetof(stratum) = 6
+offsetof(precision) = 7
+offsetof(rootdelay) = 8
+offsetof(rootdispersion) = 12
+offsetof(refid) = 16
+offsetof(reftime) = 20
+offsetof(poll) = 28
+offsetof(flags) = 32
+offsetof(unused1) = 33
+offsetof(unused2) = 34
+offsetof(unused3) = 35
+offsetof(bdelay) = 36
+offsetof(frequency) = 40
+offsetof(authdelay) = 44
+offsetof(stability) = 52
+offsetof(v6_flag) = 56
+offsetof(unused4) = 60
+offsetof(peer6) = 64
+
+sizeof(struct info_sys_stats) = 44
+offsetof(timeup) = 0
+offsetof(timereset) = 4
+offsetof(denied) = 8
+offsetof(oldversionpkt) = 12
+offsetof(newversionpkt) = 16
+offsetof(unknownversion) = 20
+offsetof(badlength) = 24
+offsetof(processed) = 28
+offsetof(badauth) = 32
+offsetof(received) = 36
+offsetof(limitrejected) = 40
+
+sizeof(struct old_info_sys_stats) = 40
+offsetof(timeup) = 0
+offsetof(timereset) = 4
+offsetof(denied) = 8
+offsetof(oldversionpkt) = 12
+offsetof(newversionpkt) = 16
+offsetof(unknownversion) = 20
+offsetof(badlength) = 24
+offsetof(processed) = 28
+offsetof(badauth) = 32
+offsetof(wanderhold) = 36
+
+sizeof(struct info_mem_stats) = 148
+offsetof(timereset) = 0
+offsetof(totalpeermem) = 4
+offsetof(freepeermem) = 6
+offsetof(findpeer_calls) = 8
+offsetof(allocations) = 12
+offsetof(demobilizations) = 16
+offsetof(hashcount) = 20
+
+sizeof(struct info_io_stats) = 40
+offsetof(timereset) = 0
+offsetof(totalrecvbufs) = 4
+offsetof(freerecvbufs) = 6
+offsetof(fullrecvbufs) = 8
+offsetof(lowwater) = 10
+offsetof(dropped) = 12
+offsetof(ignored) = 16
+offsetof(received) = 20
+offsetof(sent) = 24
+offsetof(notsent) = 28
+offsetof(interrupts) = 32
+offsetof(int_received) = 36
+
+sizeof(struct info_timer_stats) = 16
+offsetof(timereset) = 0
+offsetof(alarms) = 4
+offsetof(overflows) = 8
+offsetof(xmtcalls) = 12
+
+sizeof(struct old_conf_peer) = 16
+offsetof(peeraddr) = 0
+offsetof(hmode) = 4
+offsetof(version) = 5
+offsetof(minpoll) = 6
+offsetof(maxpoll) = 7
+offsetof(flags) = 8
+offsetof(ttl) = 9
+offsetof(unused) = 10
+offsetof(keyid) = 12
+
+sizeof(struct conf_peer) = 168
+offsetof(peeraddr) = 0
+offsetof(hmode) = 4
+offsetof(version) = 5
+offsetof(minpoll) = 6
+offsetof(maxpoll) = 7
+offsetof(flags) = 8
+offsetof(ttl) = 9
+offsetof(unused1) = 10
+offsetof(keyid) = 12
+offsetof(keystr) = 16
+offsetof(v6_flag) = 144
+offsetof(unused2) = 148
+offsetof(peeraddr6) = 152
+
+sizeof(struct conf_unpeer) = 24
+offsetof(peeraddr) = 0
+offsetof(v6_flag) = 4
+offsetof(peeraddr6) = 8
+
+sizeof(struct conf_sys_flags) = 4
+offsetof(flags) = 0
+
+sizeof(struct info_restrict) = 56
+offsetof(addr) = 0
+offsetof(mask) = 4
+offsetof(count) = 8
+offsetof(flags) = 12
+offsetof(mflags) = 14
+offsetof(v6_flag) = 16
+offsetof(unused1) = 20
+offsetof(addr6) = 24
+offsetof(mask6) = 40
+
+sizeof(struct conf_restrict) = 48
+offsetof(addr) = 0
+offsetof(mask) = 4
+offsetof(flags) = 8
+offsetof(mflags) = 10
+offsetof(v6_flag) = 12
+offsetof(addr6) = 16
+offsetof(mask6) = 32
+
+sizeof(struct info_monitor_1) = 72
+offsetof(avg_int) = 0
+offsetof(last_int) = 4
+offsetof(restr) = 8
+offsetof(count) = 12
+offsetof(addr) = 16
+offsetof(daddr) = 20
+offsetof(flags) = 24
+offsetof(port) = 28
+offsetof(mode) = 30
+offsetof(version) = 31
+offsetof(v6_flag) = 32
+offsetof(unused1) = 36
+offsetof(addr6) = 40
+offsetof(daddr6) = 56
+
+sizeof(struct info_monitor) = 48
+offsetof(avg_int) = 0
+offsetof(last_int) = 4
+offsetof(restr) = 8
+offsetof(count) = 12
+offsetof(addr) = 16
+offsetof(port) = 20
+offsetof(mode) = 22
+offsetof(version) = 23
+offsetof(v6_flag) = 24
+offsetof(unused1) = 28
+offsetof(addr6) = 32
+
+sizeof(struct old_info_monitor) = 40
+offsetof(lasttime) = 0
+offsetof(firsttime) = 4
+offsetof(count) = 8
+offsetof(addr) = 12
+offsetof(port) = 16
+offsetof(mode) = 18
+offsetof(version) = 19
+offsetof(v6_flag) = 20
+offsetof(addr6) = 24
+
+sizeof(struct reset_flags) = 4
+offsetof(flags) = 0
+
+sizeof(struct info_auth) = 36
+offsetof(timereset) = 0
+offsetof(numkeys) = 4
+offsetof(numfreekeys) = 8
+offsetof(keylookups) = 12
+offsetof(keynotfound) = 16
+offsetof(encryptions) = 20
+offsetof(decryptions) = 24
+offsetof(expired) = 28
+offsetof(keyuncached) = 32
+
+sizeof(struct info_trap) = 64
+offsetof(local_address) = 0
+offsetof(trap_address) = 4
+offsetof(trap_port) = 8
+offsetof(sequence) = 10
+offsetof(settime) = 12
+offsetof(origtime) = 16
+offsetof(resets) = 20
+offsetof(flags) = 24
+offsetof(v6_flag) = 28
+offsetof(local_address6) = 32
+offsetof(trap_address6) = 48
+
+sizeof(struct conf_trap) = 48
+offsetof(local_address) = 0
+offsetof(trap_address) = 4
+offsetof(trap_port) = 8
+offsetof(unused) = 10
+offsetof(v6_flag) = 12
+offsetof(local_address6) = 16
+offsetof(trap_address6) = 32
+
+sizeof(struct info_control) = 60
+offsetof(ctltimereset) = 0
+offsetof(numctlreq) = 4
+offsetof(numctlbadpkts) = 8
+offsetof(numctlresponses) = 12
+offsetof(numctlfrags) = 16
+offsetof(numctlerrors) = 20
+offsetof(numctltooshort) = 24
+offsetof(numctlinputresp) = 28
+offsetof(numctlinputfrag) = 32
+offsetof(numctlinputerr) = 36
+offsetof(numctlbadoffset) = 40
+offsetof(numctlbadversion) = 44
+offsetof(numctldatatooshort) = 48
+offsetof(numctlbadop) = 52
+offsetof(numasyncmsgs) = 56
+
+sizeof(struct info_clock) = 52
+offsetof(clockadr) = 0
+offsetof(type) = 4
+offsetof(flags) = 5
+offsetof(lastevent) = 6
+offsetof(currentstatus) = 7
+offsetof(polls) = 8
+offsetof(noresponse) = 12
+offsetof(badformat) = 16
+offsetof(baddata) = 20
+offsetof(timestarted) = 24
+offsetof(fudgetime1) = 28
+offsetof(fudgetime2) = 36
+offsetof(fudgeval1) = 44
+offsetof(fudgeval2) = 48
+
+sizeof(struct conf_fudge) = 20
+offsetof(clockadr) = 0
+offsetof(which) = 4
+offsetof(fudgetime) = 8
+offsetof(fudgeval_flags) = 16
+
+sizeof(struct info_clkbug) = 332
+offsetof(clockadr) = 0
+offsetof(nvalues) = 4
+offsetof(ntimes) = 5
+offsetof(svalues) = 6
+offsetof(stimes) = 8
+offsetof(values) = 12
+offsetof(times) = 76
+
+sizeof(struct info_kernel) = 60
+offsetof(offset) = 0
+offsetof(freq) = 4
+offsetof(maxerror) = 8
+offsetof(esterror) = 12
+offsetof(status) = 16
+offsetof(shift) = 18
+offsetof(constant) = 20
+offsetof(precision) = 24
+offsetof(tolerance) = 28
+offsetof(ppsfreq) = 32
+offsetof(jitter) = 36
+offsetof(stabil) = 40
+offsetof(jitcnt) = 44
+offsetof(calcnt) = 48
+offsetof(errcnt) = 52
+offsetof(stbcnt) = 56
+
+sizeof(struct info_if_stats) = 136
+offsetof(unaddr) = 0
+offsetof(unbcast) = 16
+offsetof(unmask) = 32
+offsetof(v6_flag) = 48
+offsetof(name) = 52
+offsetof(flags) = 84
+offsetof(last_ttl) = 88
+offsetof(num_mcast) = 92
+offsetof(received) = 96
+offsetof(sent) = 100
+offsetof(notsent) = 104
+offsetof(uptime) = 108
+offsetof(scopeid) = 112
+offsetof(ifindex) = 116
+offsetof(ifnum) = 120
+offsetof(peercnt) = 124
+offsetof(family) = 128
+offsetof(ignore_packets) = 130
+offsetof(action) = 131
+offsetof(_filler0) = 132
+
+sizeof(struct info_dns_assoc) = 32
+offsetof(peeraddr) = 0
+offsetof(associd) = 4
+offsetof(hostname) = 6
+
diff --git a/ntpdc/nl.pl b/ntpdc/nl.pl
new file mode 100755
index 0000000..4a418fb
--- /dev/null
+++ b/ntpdc/nl.pl
@@ -0,0 +1,43 @@
+#! /usr/local/perl-5.8.8/bin/perl -w
+
+$found = 0;
+$last = 0;
+$debug = 0;
+
+while (<>) {
+ next if /^#/;
+ next if /^\s*$/;
+ if (/^typedef union req_data_u_tag/) {
+ $found = 1;
+ }
+ if (/^struct info_dns_assoc/) {
+ $last = 1;
+ }
+ if ($found) {
+ if (/^(struct\s*\w*)\s*{\s*$/) {
+ $type = $1;
+ print STDERR "type = '$type'\n" if $debug;
+ printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n";
+ next;
+ }
+ if (/^typedef (union\s*\w*)\s*{\s*$/) {
+ $type = $1;
+ print STDERR "union = '$type'\n" if $debug;
+ printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n";
+ next;
+ }
+ if (/\s*\w+\s+(\w*)\s*(\[.*\])?\s*;\s*$/) {
+ $field = $1;
+ print STDERR "\tfield = '$field'\n" if $debug;
+ printf " printf(\"offsetof($field) = %%d\\n\", \n\t (int) offsetof($type, $field));\n";
+ next;
+ }
+ if (/^}\s*\w*\s*;\s*$/) {
+ printf " printf(\"\\n\");\n\n";
+ $found = 0 if $last;
+ next;
+ }
+ print STDERR "Unmatched line: $_";
+ exit 1;
+ }
+}
diff --git a/ntpdc/nl.pl.in b/ntpdc/nl.pl.in
new file mode 100644
index 0000000..8007538
--- /dev/null
+++ b/ntpdc/nl.pl.in
@@ -0,0 +1,43 @@
+#! @PATH_PERL@ -w
+
+$found = 0;
+$last = 0;
+$debug = 0;
+
+while (<>) {
+ next if /^#/;
+ next if /^\s*$/;
+ if (/^typedef union req_data_u_tag/) {
+ $found = 1;
+ }
+ if (/^struct info_dns_assoc/) {
+ $last = 1;
+ }
+ if ($found) {
+ if (/^(struct\s*\w*)\s*{\s*$/) {
+ $type = $1;
+ print STDERR "type = '$type'\n" if $debug;
+ printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n";
+ next;
+ }
+ if (/^typedef (union\s*\w*)\s*{\s*$/) {
+ $type = $1;
+ print STDERR "union = '$type'\n" if $debug;
+ printf " printf(\"sizeof($type) = %%d\\n\", \n\t (int) sizeof($type));\n";
+ next;
+ }
+ if (/\s*\w+\s+(\w*)\s*(\[.*\])?\s*;\s*$/) {
+ $field = $1;
+ print STDERR "\tfield = '$field'\n" if $debug;
+ printf " printf(\"offsetof($field) = %%d\\n\", \n\t (int) offsetof($type, $field));\n";
+ next;
+ }
+ if (/^}\s*\w*\s*;\s*$/) {
+ printf " printf(\"\\n\");\n\n";
+ $found = 0 if $last;
+ next;
+ }
+ print STDERR "Unmatched line: $_";
+ exit 1;
+ }
+}
diff --git a/ntpdc/nl_in.c b/ntpdc/nl_in.c
new file mode 100644
index 0000000..3df8c78
--- /dev/null
+++ b/ntpdc/nl_in.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#include "ntpdc.h"
+#include "ntp_request.h"
diff --git a/ntpdc/ntpdc-layout.c b/ntpdc/ntpdc-layout.c
new file mode 100644
index 0000000..0171488
--- /dev/null
+++ b/ntpdc/ntpdc-layout.c
@@ -0,0 +1,22 @@
+/*
+ * ntpdc-layout - print layout of NTP mode 7 request/response packets
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stddef.h>
+
+#include "ntpdc.h"
+#include "ntp_stdlib.h"
+
+#if defined(IMPL_XNTPD_OLD) && IMPL_XNTPD != 3
+#error Unexpected IMPL_XNTPD
+#endif
+
+int
+main(void)
+{
+#include "nl.c"
+
+ return (EXIT_SUCCESS);
+}
diff --git a/ntpdc/ntpdc-opts.c b/ntpdc/ntpdc-opts.c
new file mode 100644
index 0000000..8e595a4
--- /dev/null
+++ b/ntpdc/ntpdc-opts.c
@@ -0,0 +1,1173 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpdc-opts.c)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:57:15 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpdc-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpdc author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpdc program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+
+#ifndef __doxygen__
+#define OPTION_CODE_COMPILE 1
+#include "ntpdc-opts.h"
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern FILE * option_usage_fp;
+#define zCopyright (ntpdc_opt_strs+0)
+#define zLicenseDescrip (ntpdc_opt_strs+315)
+
+/*
+ * global included definitions
+ */
+#ifdef __windows
+ extern int atoi(const char*);
+#else
+# include <stdlib.h>
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/**
+ * static const strings for ntpdc options
+ */
+static char const ntpdc_opt_strs[1861] =
+/* 0 */ "ntpdc 4.2.7p482\n"
+ "Copyright (C) 1970-2014 The University of Delaware, 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"
+ "can be seen at:\n"
+ " <http://ntp.org/license>\n"
+ " <http://opensource.org/licenses/ntp-license.php>\n\0"
+/* 315 */ "Permission to use, copy, modify, and distribute this software and its\n"
+ "documentation for any purpose with or without fee is hereby granted,\n"
+ "provided that the above copyright notice appears in all copies and that\n"
+ "both the copyright notice and this permission notice appear in supporting\n"
+ "documentation, and that the name The University of Delaware not be used in\n"
+ "advertising or publicity pertaining to distribution of the software without\n"
+ "specific, written prior permission. The University of Delaware makes no\n"
+ "representations about the suitability this software for any purpose. It is\n"
+ "provided \"as is\" without express or implied warranty.\n\0"
+/* 955 */ "Force IPv4 DNS name resolution\0"
+/* 986 */ "IPV4\0"
+/* 991 */ "ipv4\0"
+/* 996 */ "Force IPv6 DNS name resolution\0"
+/* 1027 */ "IPV6\0"
+/* 1032 */ "ipv6\0"
+/* 1037 */ "run a command and exit\0"
+/* 1060 */ "COMMAND\0"
+/* 1068 */ "command\0"
+/* 1076 */ "Increase debug verbosity level\0"
+/* 1107 */ "DEBUG_LEVEL\0"
+/* 1119 */ "debug-level\0"
+/* 1131 */ "Set the debug verbosity level\0"
+/* 1161 */ "SET_DEBUG_LEVEL\0"
+/* 1177 */ "set-debug-level\0"
+/* 1193 */ "Force ntpq to operate in interactive mode\0"
+/* 1235 */ "INTERACTIVE\0"
+/* 1247 */ "interactive\0"
+/* 1259 */ "Print a list of the peers\0"
+/* 1285 */ "LISTPEERS\0"
+/* 1295 */ "listpeers\0"
+/* 1305 */ "numeric host addresses\0"
+/* 1328 */ "NUMERIC\0"
+/* 1336 */ "numeric\0"
+/* 1344 */ "PEERS\0"
+/* 1350 */ "peers\0"
+/* 1356 */ "Show a list of the peers\0"
+/* 1381 */ "SHOWPEERS\0"
+/* 1391 */ "showpeers\0"
+/* 1401 */ "display extended usage information and exit\0"
+/* 1445 */ "help\0"
+/* 1450 */ "extended usage information passed thru pager\0"
+/* 1495 */ "more-help\0"
+/* 1505 */ "output version information and exit\0"
+/* 1541 */ "version\0"
+/* 1549 */ "save the option state to a config file\0"
+/* 1588 */ "save-opts\0"
+/* 1598 */ "load options from a config file\0"
+/* 1630 */ "LOAD_OPTS\0"
+/* 1640 */ "no-load-opts\0"
+/* 1653 */ "no\0"
+/* 1656 */ "NTPDC\0"
+/* 1662 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p482\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
+/* 1794 */ "$HOME\0"
+/* 1800 */ ".\0"
+/* 1802 */ ".ntprc\0"
+/* 1809 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 1843 */ "\n\0"
+/* 1845 */ "ntpdc 4.2.7p482";
+
+/**
+ * ipv4 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv4 option */
+#define IPV4_DESC (ntpdc_opt_strs+955)
+/** Upper-cased name for the ipv4 option */
+#define IPV4_NAME (ntpdc_opt_strs+986)
+/** Name string for the ipv4 option */
+#define IPV4_name (ntpdc_opt_strs+991)
+/** Other options that appear in conjunction with the ipv4 option */
+static int const aIpv4CantList[] = {
+ INDEX_OPT_IPV6, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv4 option */
+#define IPV4_FLAGS (OPTST_DISABLED)
+
+/**
+ * ipv6 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv6 option */
+#define IPV6_DESC (ntpdc_opt_strs+996)
+/** Upper-cased name for the ipv6 option */
+#define IPV6_NAME (ntpdc_opt_strs+1027)
+/** Name string for the ipv6 option */
+#define IPV6_name (ntpdc_opt_strs+1032)
+/** Other options that appear in conjunction with the ipv6 option */
+static int const aIpv6CantList[] = {
+ INDEX_OPT_IPV4, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv6 option */
+#define IPV6_FLAGS (OPTST_DISABLED)
+
+/**
+ * command option description:
+ */
+/** Descriptive text for the command option */
+#define COMMAND_DESC (ntpdc_opt_strs+1037)
+/** Upper-cased name for the command option */
+#define COMMAND_NAME (ntpdc_opt_strs+1060)
+/** Name string for the command option */
+#define COMMAND_name (ntpdc_opt_strs+1068)
+/** Compiled in flag settings for the command option */
+#define COMMAND_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * debug-level option description:
+ */
+/** Descriptive text for the debug-level option */
+#define DEBUG_LEVEL_DESC (ntpdc_opt_strs+1076)
+/** Upper-cased name for the debug-level option */
+#define DEBUG_LEVEL_NAME (ntpdc_opt_strs+1107)
+/** Name string for the debug-level option */
+#define DEBUG_LEVEL_name (ntpdc_opt_strs+1119)
+/** Compiled in flag settings for the debug-level option */
+#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
+
+/**
+ * set-debug-level option description:
+ */
+/** Descriptive text for the set-debug-level option */
+#define SET_DEBUG_LEVEL_DESC (ntpdc_opt_strs+1131)
+/** Upper-cased name for the set-debug-level option */
+#define SET_DEBUG_LEVEL_NAME (ntpdc_opt_strs+1161)
+/** Name string for the set-debug-level option */
+#define SET_DEBUG_LEVEL_name (ntpdc_opt_strs+1177)
+/** Compiled in flag settings for the set-debug-level option */
+#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * interactive option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the interactive option */
+#define INTERACTIVE_DESC (ntpdc_opt_strs+1193)
+/** Upper-cased name for the interactive option */
+#define INTERACTIVE_NAME (ntpdc_opt_strs+1235)
+/** Name string for the interactive option */
+#define INTERACTIVE_name (ntpdc_opt_strs+1247)
+/** Other options that appear in conjunction with the interactive option */
+static int const aInteractiveCantList[] = {
+ INDEX_OPT_COMMAND,
+ INDEX_OPT_LISTPEERS,
+ INDEX_OPT_PEERS,
+ INDEX_OPT_SHOWPEERS, NO_EQUIVALENT };
+/** Compiled in flag settings for the interactive option */
+#define INTERACTIVE_FLAGS (OPTST_DISABLED)
+
+/**
+ * listpeers option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the listpeers option */
+#define LISTPEERS_DESC (ntpdc_opt_strs+1259)
+/** Upper-cased name for the listpeers option */
+#define LISTPEERS_NAME (ntpdc_opt_strs+1285)
+/** Name string for the listpeers option */
+#define LISTPEERS_name (ntpdc_opt_strs+1295)
+/** Other options that appear in conjunction with the listpeers option */
+static int const aListpeersCantList[] = {
+ INDEX_OPT_COMMAND, NO_EQUIVALENT };
+/** Compiled in flag settings for the listpeers option */
+#define LISTPEERS_FLAGS (OPTST_DISABLED)
+
+/**
+ * numeric option description:
+ */
+/** Descriptive text for the numeric option */
+#define NUMERIC_DESC (ntpdc_opt_strs+1305)
+/** Upper-cased name for the numeric option */
+#define NUMERIC_NAME (ntpdc_opt_strs+1328)
+/** Name string for the numeric option */
+#define NUMERIC_name (ntpdc_opt_strs+1336)
+/** Compiled in flag settings for the numeric option */
+#define NUMERIC_FLAGS (OPTST_DISABLED)
+
+/**
+ * peers option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the peers option */
+#define PEERS_DESC (ntpdc_opt_strs+1259)
+/** Upper-cased name for the peers option */
+#define PEERS_NAME (ntpdc_opt_strs+1344)
+/** Name string for the peers option */
+#define PEERS_name (ntpdc_opt_strs+1350)
+/** Other options that appear in conjunction with the peers option */
+static int const aPeersCantList[] = {
+ INDEX_OPT_COMMAND, NO_EQUIVALENT };
+/** Compiled in flag settings for the peers option */
+#define PEERS_FLAGS (OPTST_DISABLED)
+
+/**
+ * showpeers option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the showpeers option */
+#define SHOWPEERS_DESC (ntpdc_opt_strs+1356)
+/** Upper-cased name for the showpeers option */
+#define SHOWPEERS_NAME (ntpdc_opt_strs+1381)
+/** Name string for the showpeers option */
+#define SHOWPEERS_name (ntpdc_opt_strs+1391)
+/** Other options that appear in conjunction with the showpeers option */
+static int const aShowpeersCantList[] = {
+ INDEX_OPT_COMMAND, NO_EQUIVALENT };
+/** Compiled in flag settings for the showpeers option */
+#define SHOWPEERS_FLAGS (OPTST_DISABLED)
+
+/*
+ * Help/More_Help/Version option descriptions:
+ */
+#define HELP_DESC (ntpdc_opt_strs+1401)
+#define HELP_name (ntpdc_opt_strs+1445)
+#ifdef HAVE_WORKING_FORK
+#define MORE_HELP_DESC (ntpdc_opt_strs+1450)
+#define MORE_HELP_name (ntpdc_opt_strs+1495)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+#define MORE_HELP_DESC HELP_DESC
+#define MORE_HELP_name HELP_name
+#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#endif
+#ifdef NO_OPTIONAL_OPT_ARGS
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
+#endif
+#define VER_DESC (ntpdc_opt_strs+1505)
+#define VER_name (ntpdc_opt_strs+1541)
+#define SAVE_OPTS_DESC (ntpdc_opt_strs+1549)
+#define SAVE_OPTS_name (ntpdc_opt_strs+1588)
+#define LOAD_OPTS_DESC (ntpdc_opt_strs+1598)
+#define LOAD_OPTS_NAME (ntpdc_opt_strs+1630)
+#define NO_LOAD_OPTS_name (ntpdc_opt_strs+1640)
+#define LOAD_OPTS_pfx (ntpdc_opt_strs+1653)
+#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
+/**
+ * Declare option callback procedures
+ */
+extern tOptProc
+ ntpOptionPrintVersion, optionBooleanVal, optionNestedVal,
+ optionNumericVal, optionPagedUsage, optionResetOpt,
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVendorOption;
+static tOptProc
+ doOptDebug_Level, doUsageOpt;
+#define VER_PROC ntpOptionPrintVersion
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the ntpdc Option Descriptions.
+ * This is an array of OPTION_CT entries, one for each
+ * option that the ntpdc program responds to.
+ */
+static tOptDesc optDesc[OPTION_CT] = {
+ { /* entry idx, value */ 0, VALUE_OPT_IPV4,
+ /* equiv idx, value */ 0, VALUE_OPT_IPV4,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV4_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv4 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv4CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 1, VALUE_OPT_IPV6,
+ /* equiv idx, value */ 1, VALUE_OPT_IPV6,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV6_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv6 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv6CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 2, VALUE_OPT_COMMAND,
+ /* equiv idx, value */ 2, VALUE_OPT_COMMAND,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ COMMAND_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --command */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ COMMAND_DESC, COMMAND_NAME, COMMAND_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
+ /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptDebug_Level,
+ /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --set-debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 5, VALUE_OPT_INTERACTIVE,
+ /* equiv idx, value */ 5, VALUE_OPT_INTERACTIVE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ INTERACTIVE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --interactive */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aInteractiveCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ INTERACTIVE_DESC, INTERACTIVE_NAME, INTERACTIVE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 6, VALUE_OPT_LISTPEERS,
+ /* equiv idx, value */ 6, VALUE_OPT_LISTPEERS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ LISTPEERS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --listpeers */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aListpeersCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ LISTPEERS_DESC, LISTPEERS_NAME, LISTPEERS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 7, VALUE_OPT_NUMERIC,
+ /* equiv idx, value */ 7, VALUE_OPT_NUMERIC,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ NUMERIC_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --numeric */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ NUMERIC_DESC, NUMERIC_NAME, NUMERIC_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 8, VALUE_OPT_PEERS,
+ /* equiv idx, value */ 8, VALUE_OPT_PEERS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PEERS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --peers */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aPeersCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ PEERS_DESC, PEERS_NAME, PEERS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 9, VALUE_OPT_SHOWPEERS,
+ /* equiv idx, value */ 9, VALUE_OPT_SHOWPEERS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SHOWPEERS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --showpeers */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aShowpeersCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SHOWPEERS_DESC, SHOWPEERS_NAME, SHOWPEERS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ VER_PROC,
+ /* desc, NAME, name */ VER_DESC, NULL, VER_name,
+ /* disablement strs */ NULL, NULL },
+
+
+
+ { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doUsageOpt,
+ /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionPagedUsage,
+ /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionLoadOpt,
+ /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
+ /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
+};
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of ntpdc. */
+#define zPROGNAME (ntpdc_opt_strs+1656)
+/** Reference to the title line for ntpdc usage. */
+#define zUsageTitle (ntpdc_opt_strs+1662)
+/** ntpdc configuration file name. */
+#define zRcName (ntpdc_opt_strs+1802)
+/** Directories to search for ntpdc config files. */
+static char const * const apzHomeList[3] = {
+ ntpdc_opt_strs+1794,
+ ntpdc_opt_strs+1800,
+ NULL };
+/** The ntpdc program bug email address. */
+#define zBugsAddr (ntpdc_opt_strs+1809)
+/** Clarification/explanation of what ntpdc does. */
+#define zExplain (ntpdc_opt_strs+1843)
+/** Extra detail explaining what ntpdc does. */
+#define zDetail (NULL)
+/** The full version string for ntpdc. */
+#define zFullVersion (ntpdc_opt_strs+1845)
+/* extracted from optcode.tlib near line 364 */
+
+#if defined(ENABLE_NLS)
+# define OPTPROC_BASE OPTPROC_TRANSLATE
+ static tOptionXlateProc translate_option_strings;
+#else
+# define OPTPROC_BASE OPTPROC_NONE
+# define translate_option_strings NULL
+#endif /* ENABLE_NLS */
+
+#define ntpdc_full_usage (NULL)
+#define ntpdc_short_usage (NULL)
+
+#endif /* not defined __doxygen__ */
+
+/*
+ * Create the static procedure(s) declared above.
+ */
+/**
+ * The callout function that invokes the optionUsage function.
+ *
+ * @param[in] opts the AutoOpts option description structure
+ * @param[in] od the descriptor for the "help" (usage) option.
+ * @noreturn
+ */
+static void
+doUsageOpt(tOptions * opts, tOptDesc * od)
+{
+ int ex_code;
+ ex_code = NTPDC_EXIT_SUCCESS;
+ optionUsage(&ntpdcOptions, ex_code);
+ /* NOTREACHED */
+ exit(1);
+ (void)opts;
+ (void)od;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the debug-level option.
+ *
+ * @param[in] pOptions the ntpdc options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ /*
+ * Be sure the flag-code[0] handles special values for the options pointer
+ * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
+ * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
+ * reset its state.
+ */
+ /* extracted from debug-opt.def, line 15 */
+OPT_VALUE_SET_DEBUG_LEVEL++;
+ (void)pOptDesc;
+ (void)pOptions;
+}
+/* extracted from optmain.tlib near line 1245 */
+
+/**
+ * The directory containing the data associated with ntpdc.
+ */
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+/**
+ * Information about the person or institution that packaged ntpdc
+ * for the current distribution.
+ */
+#ifndef WITH_PACKAGER
+# define ntpdc_packager_info NULL
+#else
+/** Packager information for ntpdc. */
+static char const ntpdc_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpdc bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+#ifndef __doxygen__
+
+#endif /* __doxygen__ */
+/**
+ * The option definitions for ntpdc. The one structure that
+ * binds them all.
+ */
+tOptions ntpdcOptions = {
+ OPTIONS_STRUCT_VERSION,
+ 0, NULL, /* original argc + argv */
+ ( OPTPROC_BASE
+ + OPTPROC_ERRSTOP
+ + OPTPROC_SHORTOPT
+ + OPTPROC_LONGOPT
+ + OPTPROC_NO_REQ_OPT
+ + OPTPROC_ENVIRON
+ + OPTPROC_MISUSE ),
+ 0, NULL, /* current option index, current option */
+ NULL, NULL, zPROGNAME,
+ zRcName, zCopyright, zLicenseDescrip,
+ zFullVersion, apzHomeList, zUsageTitle,
+ zExplain, zDetail, optDesc,
+ zBugsAddr, /* address to send bugs to */
+ NULL, NULL, /* extensions/saved state */
+ optionUsage, /* usage procedure */
+ translate_option_strings, /* translation procedure */
+ /*
+ * Indexes to special options
+ */
+ { INDEX_OPT_MORE_HELP, /* more-help option index */
+ INDEX_OPT_SAVE_OPTS, /* save option index */
+ NO_EQUIVALENT, /* '-#' option index */
+ NO_EQUIVALENT /* index of default opt */
+ },
+ 15 /* full option count */, 10 /* user option count */,
+ ntpdc_full_usage, ntpdc_short_usage,
+ NULL, NULL,
+ PKGDATADIR, ntpdc_packager_info
+};
+
+#if ENABLE_NLS
+/**
+ * This code is designed to translate translatable option text for the
+ * ntpdc program. These translations happen upon entry
+ * to optionProcess().
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#ifdef HAVE_DCGETTEXT
+# include <gettext.h>
+#endif
+#include <autoopts/usage-txt.h>
+
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
+
+/**
+ * AutoGen specific wrapper function for gettext. It relies on the macro _()
+ * to convert from English to the target language, then strdup-duplicates the
+ * result string. It tries the "libopts" domain first, then whatever has been
+ * set via the \a textdomain(3) call.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
+AO_gettext(char const * pz)
+{
+ char * res;
+ if (pz == NULL)
+ return NULL;
+#ifdef HAVE_DCGETTEXT
+ /*
+ * While processing the option_xlateable_txt data, try to use the
+ * "libopts" domain. Once we switch to the option descriptor data,
+ * do *not* use that domain.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ res = dgettext("libopts", pz);
+ if (res == pz)
+ res = (char *)(void *)_(pz);
+ } else
+ res = (char *)(void *)_(pz);
+#else
+ res = (char *)(void *)_(pz);
+#endif
+ if (res == pz)
+ return res;
+ res = strdup(res);
+ if (res == NULL) {
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(NTPDC_EXIT_FAILURE);
+ }
+ return res;
+}
+
+/**
+ * All the pointers we use are marked "* const", but they are stored in
+ * writable memory. Coerce the mutability and set the pointer.
+ */
+static void coerce_it(void ** s) { *s = AO_gettext(*s);
+}
+
+/**
+ * Translate all the translatable strings in the ntpdcOptions
+ * structure defined above. This is done only once.
+ */
+static void
+translate_option_strings(void)
+{
+ tOptions * const opts = &ntpdcOptions;
+
+ /*
+ * Guard against re-translation. It won't work. The strings will have
+ * been changed by the first pass through this code. One shot only.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ /*
+ * Do the translations. The first pointer follows the field count
+ * field. The field count field is the size of a pointer.
+ */
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
+
+ do {
+ ppz++; /* skip over field_ct */
+ *ppz = AO_gettext(*ppz);
+ } while (--ix > 0);
+ /* prevent re-translation and disable "libopts" domain lookup */
+ option_xlateable_txt.field_ct = 0;
+
+ coerce_it((void*)&(opts->pzCopyright));
+ coerce_it((void*)&(opts->pzCopyNotice));
+ coerce_it((void*)&(opts->pzFullVersion));
+ coerce_it((void*)&(opts->pzUsageTitle));
+ coerce_it((void*)&(opts->pzExplain));
+ coerce_it((void*)&(opts->pzDetail));
+ {
+ tOptDesc * od = opts->pOptDesc;
+ for (ix = opts->optCt; ix > 0; ix--, od++)
+ coerce_it((void*)&(od->pzText));
+ }
+ }
+}
+#endif /* ENABLE_NLS */
+
+#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
+/** I18N function strictly for xgettext. Do not compile. */
+static void bogus_function(void) {
+ /* TRANSLATORS:
+
+ The following dummy function was crated solely so that xgettext can
+ extract the correct strings. These strings are actually referenced
+ by a field name in the ntpdcOptions structure noted in the
+ comments below. The literal text is defined in ntpdc_opt_strs.
+
+ NOTE: the strings below are segmented with respect to the source string
+ ntpdc_opt_strs. The strings above are handed off for translation
+ at run time a paragraph at a time. Consequently, they are presented here
+ for translation a paragraph at a time.
+
+ ALSO: often the description for an option will reference another option
+ by name. These are set off with apostrophe quotes (I hope). Do not
+ translate option names.
+ */
+ /* referenced via ntpdcOptions.pzCopyright */
+ puts(_("ntpdc 4.2.7p482\n\
+Copyright (C) 1970-2014 The University of Delaware, 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\
+can be seen at:\n"));
+ puts(_(" <http://ntp.org/license>\n\
+ <http://opensource.org/licenses/ntp-license.php>\n"));
+
+ /* referenced via ntpdcOptions.pzCopyNotice */
+ puts(_("Permission to use, copy, modify, and distribute this software and its\n\
+documentation for any purpose with or without fee is hereby granted,\n\
+provided that the above copyright notice appears in all copies and that\n\
+both the copyright notice and this permission notice appear in supporting\n\
+documentation, and that the name The University of Delaware not be used in\n\
+advertising or publicity pertaining to distribution of the software without\n\
+specific, written prior permission. The University of Delaware makes no\n\
+representations about the suitability this software for any purpose. It is\n\
+provided \"as is\" without express or implied warranty.\n"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Force IPv4 DNS name resolution"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Force IPv6 DNS name resolution"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("run a command and exit"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Increase debug verbosity level"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Set the debug verbosity level"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Force ntpq to operate in interactive mode"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Print a list of the peers"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("numeric host addresses"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Print a list of the peers"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("Show a list of the peers"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("display extended usage information and exit"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("extended usage information passed thru pager"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("output version information and exit"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("save the option state to a config file"));
+
+ /* referenced via ntpdcOptions.pOptDesc->pzText */
+ puts(_("load options from a config file"));
+
+ /* referenced via ntpdcOptions.pzUsageTitle */
+ puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p482\n\
+Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
+
+ /* referenced via ntpdcOptions.pzExplain */
+ puts(_("\n"));
+
+ /* referenced via ntpdcOptions.pzFullVersion */
+ puts(_("ntpdc 4.2.7p482"));
+
+ /* referenced via ntpdcOptions.pzFullUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+
+ /* referenced via ntpdcOptions.pzShortUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 86 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 84 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 88 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* uncompilable code */
+#ifdef __cplusplus
+}
+#endif
+/* ntpdc-opts.c ends here */
diff --git a/ntpdc/ntpdc-opts.def b/ntpdc/ntpdc-opts.def
new file mode 100644
index 0000000..df3350e
--- /dev/null
+++ b/ntpdc/ntpdc-opts.def
@@ -0,0 +1,812 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include autogen-version.def
+#include copyright.def
+
+prog-name = "ntpdc";
+prog-title = "vendor-specific NTPD control program";
+argument = '[ host ...]';
+
+#include homerc.def
+
+flag = {
+ name = ipv4;
+ value = 4;
+ flags-cant = ipv6;
+ descrip = "Force IPv4 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv4 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = ipv6;
+ value = 6;
+ flags-cant = ipv4;
+ descrip = "Force IPv6 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv6 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = command;
+ value = c;
+ arg-type = string;
+ descrip = "run a command and exit";
+ max = NOLIMIT;
+ arg-name = cmd;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ The following argument is interpreted as an interactive format command
+ and is added to the list of commands to be executed on the specified
+ host(s).
+ _EndOfDoc_;
+};
+
+#include debug-opt.def
+
+flag = {
+ name = interactive;
+ value = i;
+ flags-cant = command, listpeers, peers, showpeers;
+ descrip = "Force ntpq to operate in interactive mode";
+ doc = <<- _EndOfDoc_
+ Force ntpq to operate in interactive mode. Prompts will be written
+ to the standard output and commands read from the standard input.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = listpeers;
+ value = l;
+ descrip = "Print a list of the peers";
+ flags-cant = command;
+ doc = <<- _EndOfDoc_
+ Print a list of the peers known to the server as well as a summary of
+ their state. This is equivalent to the 'listpeers' interactive command.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = numeric;
+ value = n;
+ descrip = "numeric host addresses";
+ doc = <<- _EndOfDoc_
+ Output all host addresses in dotted-quad numeric format rather than
+ converting to the canonical host names.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peers;
+ value = p;
+ descrip = "Print a list of the peers";
+ flags-cant = command;
+ doc = <<- _EndOfDoc_
+ Print a list of the peers known to the server as well as a summary
+ of their state. This is equivalent to the 'peers' interactive command.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = showpeers;
+ value = s;
+ descrip = "Show a list of the peers";
+ flags-cant = command;
+ doc = <<- _EndOfDoc_
+ Print a list of the peers known to the server as well as a summary
+ of their state. This is equivalent to the 'dmpeers' interactive command.
+ _EndOfDoc_;
+};
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+.Nm
+is deprecated.
+Please use
+.Xr ntpq 1ntpqmdoc instead - it can do everything
+.Nm
+used to do, and it does so using a much more sane interface.
+.Pp
+.Nm
+is a utility program used to query
+.Xr ntpd 1ntpdmdoc
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+.Nm
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+.Nm .
+ _END_PROG_MDOC_DESCRIP;
+};
+
+
+doc-section = {
+ ds-type = 'USAGE';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_USAGE
+If one or more request options are included on the command line
+when
+.Nm
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+.Nm
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+.Nm
+utility will prompt for
+commands if the standard input is a terminal device.
+.Pp
+The
+.Nm
+utility uses NTP mode 7 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+.Nm
+utility makes
+no attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+.Pp
+The operation of
+.Nm
+are specific to the particular
+implementation of the
+.Xr ntpd 1ntpdmdoc
+daemon and can be expected to
+work only with this and maybe some previous versions of the daemon.
+Requests from a remote
+.Nm
+utility which affect the
+state of the local server must be authenticated, which requires
+both the remote program and local server share a common key and key
+identifier.
+.Pp
+Note that in contexts where a host name is expected, a
+.Fl 4
+qualifier preceding the host name forces DNS resolution to the IPv4 namespace,
+while a
+.Fl 6
+qualifier forces DNS resolution to the IPv6 namespace.
+Specifying a command line option other than
+.Fl i
+or
+.Fl n
+will cause the specified query (queries) to be sent to
+the indicated host(s) immediately.
+Otherwise,
+.Nm
+will
+attempt to read interactive format commands from the standard
+input.
+.Ss "Interactive Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+The output of a
+command is normally sent to the standard output, but optionally the
+output of individual commands may be sent to a file by appending a
+.Ql \&> ,
+followed by a file name, to the command line.
+.Pp
+A number of interactive format commands are executed entirely
+within the
+.Nm
+utility itself and do not result in NTP
+mode 7 requests being sent to a server.
+These are described
+following.
+.Bl -tag -width indent
+.It Ic \&? Ar command_keyword
+.It Ic help Ar command_keyword
+A
+.Sq Ic \&?
+will print a list of all the command
+keywords known to this incarnation of
+.Nm .
+A
+.Sq Ic \&?
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+.Xr ntpq 1ntpqmdoc
+than this manual
+page.
+.It Ic delay Ar milliseconds
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.It Ic host Ar hostname
+Set the host to which future queries will be sent.
+Hostname may
+be either a host name or a numeric address.
+.It Ic hostnames Op Cm yes | Cm no
+If
+.Cm yes
+is specified, host names are printed in
+information displays.
+If
+.Cm no
+is specified, numeric
+addresses are printed instead.
+The default is
+.Cm yes ,
+unless
+modified using the command line
+.Fl n
+switch.
+.It Ic keyid Ar keyid
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.It Ic quit
+Exit
+.Nm .
+.It Ic passwd
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.It Ic timeout Ar milliseconds
+Specify a timeout period for responses to server queries.
+The
+default is about 8000 milliseconds.
+Note that since
+.Nm
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.El
+.Ss "Control Message Commands"
+Query commands result in NTP mode 7 packets containing requests for
+information being sent to the server.
+These are read-only commands
+in that they make no modification of the server configuration
+state.
+.Bl -tag -width indent
+.It Ic listpeers
+Obtains and prints a brief list of the peers for which the
+server is maintaining state.
+These should include all configured
+peer associations as well as those peers whose stratum is such that
+they are considered by the server to be possible future
+synchronization candidates.
+.It Ic peers
+Obtains a list of peers for which the server is maintaining
+state, along with a summary of that state.
+Summary information
+includes the address of the remote peer, the local interface
+address (0.0.0.0 if a local address has yet to be determined), the
+stratum of the remote peer (a stratum of 16 indicates the remote
+peer is unsynchronized), the polling interval, in seconds, the
+reachability register, in octal, and the current estimated delay,
+offset and dispersion of the peer, all in seconds.
+.Pp
+The character in the left margin indicates the mode this peer
+entry is operating in.
+A
+.Ql \&+
+denotes symmetric active, a
+.Ql \&-
+indicates symmetric passive, a
+.Ql \&=
+means the
+remote server is being polled in client mode, a
+.Ql \&^
+indicates that the server is broadcasting to this address, a
+.Ql \&~
+denotes that the remote peer is sending broadcasts and a
+.Ql \&~
+denotes that the remote peer is sending broadcasts and a
+.Ql \&*
+marks the peer the server is currently synchronizing
+to.
+.Pp
+The contents of the host field may be one of four forms.
+It may
+be a host name, an IP address, a reference clock implementation
+name with its parameter or
+.Fn REFCLK "implementation_number" "parameter" .
+On
+.Ic hostnames
+.Cm no
+only IP-addresses
+will be displayed.
+.It Ic dmpeers
+A slightly different peer summary list.
+Identical to the output
+of the
+.Ic peers
+command, except for the character in the
+leftmost column.
+Characters only appear beside peers which were
+included in the final stage of the clock selection algorithm.
+A
+.Ql \&.
+indicates that this peer was cast off in the falseticker
+detection, while a
+.Ql \&+
+indicates that the peer made it
+through.
+A
+.Ql \&*
+denotes the peer the server is currently
+synchronizing with.
+.It Ic showpeer Ar peer_address Oo Ar ... Oc
+Shows a detailed display of the current peer variables for one
+or more peers.
+Most of these values are described in the NTP
+Version 2 specification.
+.It Ic pstats Ar peer_address Oo Ar ... Oc
+Show per-peer statistic counters associated with the specified
+peer(s).
+.It Ic clockstat Ar clock_peer_address Oo Ar ... Oc
+Obtain and print information concerning a peer clock.
+The
+values obtained provide information on the setting of fudge factors
+and other clock performance information.
+.It Ic kerninfo
+Obtain and print kernel phase-lock loop operating parameters.
+This information is available only if the kernel has been specially
+modified for a precision timekeeping function.
+.It Ic loopinfo Op Cm oneline | Cm multiline
+Print the values of selected loop filter variables.
+The loop
+filter is the part of NTP which deals with adjusting the local
+system clock.
+The
+.Sq offset
+is the last offset given to the
+loop filter by the packet processing code.
+The
+.Sq frequency
+is the frequency error of the local clock in parts-per-million
+(ppm).
+The
+.Sq time_const
+controls the stiffness of the
+phase-lock loop and thus the speed at which it can adapt to
+oscillator drift.
+The
+.Sq watchdog timer
+value is the number
+of seconds which have elapsed since the last sample offset was
+given to the loop filter.
+The
+.Cm oneline
+and
+.Cm multiline
+options specify the format in which this
+information is to be printed, with
+.Cm multiline
+as the
+default.
+.It Ic sysinfo
+Print a variety of system state variables, i.e., state related
+to the local server.
+All except the last four lines are described
+in the NTP Version 3 specification, RFC-1305.
+.Pp
+The
+.Sq system flags
+show various system flags, some of
+which can be set and cleared by the
+.Ic enable
+and
+.Ic disable
+configuration commands, respectively.
+These are
+the
+.Cm auth ,
+.Cm bclient ,
+.Cm monitor ,
+.Cm pll ,
+.Cm pps
+and
+.Cm stats
+flags.
+See the
+.Xr ntpd 1ntpdmdoc
+documentation for the meaning of these flags.
+There
+are two additional flags which are read only, the
+.Cm kernel_pll
+and
+.Cm kernel_pps .
+These flags indicate
+the synchronization status when the precision time kernel
+modifications are in use.
+The
+.Sq kernel_pll
+indicates that
+the local clock is being disciplined by the kernel, while the
+.Sq kernel_pps
+indicates the kernel discipline is provided by the PPS
+signal.
+.Pp
+The
+.Sq stability
+is the residual frequency error remaining
+after the system frequency correction is applied and is intended for
+maintenance and debugging.
+In most architectures, this value will
+initially decrease from as high as 500 ppm to a nominal value in
+the range .01 to 0.1 ppm.
+If it remains high for some time after
+starting the daemon, something may be wrong with the local clock,
+or the value of the kernel variable
+.Va kern.clockrate.tick
+may be
+incorrect.
+.Pp
+The
+.Sq broadcastdelay
+shows the default broadcast delay,
+as set by the
+.Ic broadcastdelay
+configuration command.
+.Pp
+The
+.Sq authdelay
+shows the default authentication delay,
+as set by the
+.Ic authdelay
+configuration command.
+.It Ic sysstats
+Print statistics counters maintained in the protocol
+module.
+.It Ic memstats
+Print statistics counters related to memory allocation
+code.
+.It Ic iostats
+Print statistics counters maintained in the input-output
+module.
+.It Ic timerstats
+Print statistics counters maintained in the timer/event queue
+support code.
+.It Ic reslist
+Obtain and print the server's restriction list.
+This list is
+(usually) printed in sorted order and may help to understand how
+the restrictions are applied.
+.It Ic monlist Op Ar version
+Obtain and print traffic counts collected and maintained by the
+monitor facility.
+The version number should not normally need to be
+specified.
+.It Ic clkbug Ar clock_peer_address Oo Ar ... Oc
+Obtain debugging information for a reference clock driver.
+This
+information is provided only by some clock drivers and is mostly
+undecodable without a copy of the driver source in hand.
+.El
+.Ss "Runtime Configuration Requests"
+All requests which cause state changes in the server are
+authenticated by the server using a configured NTP key (the
+facility can also be disabled by the server by not configuring a
+key).
+The key number and the corresponding key must also be made
+known to
+.Nm .
+This can be done using the
+.Ic keyid
+and
+.Ic passwd
+commands, the latter of which will prompt at the terminal for a
+password to use as the encryption key.
+You will also be prompted
+automatically for both the key number and password the first time a
+command which would result in an authenticated request to the
+server is given.
+Authentication not only provides verification that
+the requester has permission to make such changes, but also gives
+an extra degree of protection again transmission errors.
+.Pp
+Authenticated requests always include a timestamp in the packet
+data, which is included in the computation of the authentication
+code.
+This timestamp is compared by the server to its receive time
+stamp.
+If they differ by more than a small amount the request is
+rejected.
+This is done for two reasons.
+First, it makes simple
+replay attacks on the server, by someone who might be able to
+overhear traffic on your LAN, much more difficult.
+Second, it makes
+it more difficult to request configuration changes to your server
+from topologically remote hosts.
+While the reconfiguration facility
+will work well with a server on the local host, and may work
+adequately between time-synchronized hosts on the same LAN, it will
+work very poorly for more distant hosts.
+As such, if reasonable
+passwords are chosen, care is taken in the distribution and
+protection of keys and appropriate source address restrictions are
+applied, the run time reconfiguration facility should provide an
+adequate level of security.
+.Pp
+The following commands all make authenticated requests.
+.Bl -tag -width indent
+.It Xo Ic addpeer Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Add a configured peer association at the given address and
+operating in symmetric active mode.
+Note that an existing
+association with the same peer may be deleted when this command is
+executed, or may simply be converted to conform to the new
+configuration, as appropriate.
+If the optional
+.Ar keyid
+is a
+nonzero integer, all outgoing packets to the remote server will
+have an authentication field attached encrypted with this key.
+If
+the value is 0 (or not given) no authentication will be done.
+The
+.Ar version
+can be 1, 2 or 3 and defaults to 3.
+The
+.Cm prefer
+keyword indicates a preferred peer (and thus will
+be used primarily for clock synchronisation if possible).
+The
+preferred peer also determines the validity of the PPS signal - if
+the preferred peer is suitable for synchronisation so is the PPS
+signal.
+.It Xo Ic addserver Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Identical to the addpeer command, except that the operating
+mode is client.
+.It Xo Ic broadcast Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Identical to the addpeer command, except that the operating
+mode is broadcast.
+In this case a valid key identifier and key are
+required.
+The
+.Ar peer_address
+parameter can be the broadcast
+address of the local network or a multicast group address assigned
+to NTP.
+If a multicast address, a multicast-capable kernel is
+required.
+.It Ic unconfig Ar peer_address Oo Ar ... Oc
+This command causes the configured bit to be removed from the
+specified peer(s).
+In many cases this will cause the peer
+association to be deleted.
+When appropriate, however, the
+association may persist in an unconfigured mode if the remote peer
+is willing to continue on in this fashion.
+.It Xo Ic fudge Ar peer_address
+.Op Cm time1
+.Op Cm time2
+.Op Ar stratum
+.Op Ar refid
+.Xc
+This command provides a way to set certain data for a reference
+clock.
+See the source listing for further information.
+.It Xo Ic enable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm monitor | Cm ntp |
+.Cm pps | Cm stats
+.Oc
+.Xc
+.It Xo Ic disable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm monitor | Cm ntp |
+.Cm pps | Cm stats
+.Oc
+.Xc
+These commands operate in the same way as the
+.Ic enable
+and
+.Ic disable
+configuration file commands of
+.Xr ntpd 1ntpdmdoc .
+.Bl -tag -width indent
+.It Cm auth
+Enables the server to synchronize with unconfigured peers only
+if the peer has been correctly authenticated using either public key
+or private key cryptography.
+The default for this flag is enable.
+.It Cm bclient
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the multicastclient command with
+default address.
+The default for this flag is disable.
+.It Cm calibrate
+Enables the calibrate feature for reference clocks.
+The default for this flag is disable.
+.It Cm kernel
+Enables the kernel time discipline, if available.
+The default for this flag is enable if support is available, otherwise disable.
+.It Cm monitor
+Enables the monitoring facility.
+See the documentation here about the
+.Cm monlist
+command or further information.
+The default for this flag is enable.
+.It Cm ntp
+Enables time and frequency discipline.
+In effect, this switch opens and closes the feedback loop,
+which is useful for testing.
+The default for this flag is enable.
+.It Cm pps
+Enables the pulse-per-second (PPS) signal when frequency
+and time is disciplined by the precision time kernel modifications.
+See the
+.Qq A Kernel Model for Precision Timekeeping
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+page for further information.
+The default for this flag is disable.
+.It Cm stats
+Enables the statistics facility.
+See the
+.Sx Monitoring Options
+section of
+.Xr ntp.conf 5
+for further information.
+The default for this flag is disable.
+.El
+.It Xo Ic restrict Ar address Ar mask
+.Ar flag Oo Ar ... Oc
+.Xc
+This command operates in the same way as the
+.Ic restrict
+configuration file commands of
+.Xr ntpd 1ntpdmdoc .
+.It Xo Ic unrestrict Ar address Ar mask
+.Ar flag Oo Ar ... Oc
+.Xc
+Unrestrict the matching entry from the restrict list.
+.It Xo Ic delrestrict Ar address Ar mask
+.Op Cm ntpport
+.Xc
+Delete the matching entry from the restrict list.
+.It Ic readkeys
+Causes the current set of authentication keys to be purged and
+a new set to be obtained by rereading the keys file (which must
+have been specified in the
+.Xr ntpd 1ntpdmdoc
+configuration file).
+This
+allows encryption keys to be changed without restarting the
+server.
+.It Ic trustedkey Ar keyid Oo Ar ... Oc
+.It Ic untrustedkey Ar keyid Oo Ar ... Oc
+These commands operate in the same way as the
+.Ic trustedkey
+and
+.Ic untrustedkey
+configuration file
+commands of
+.Xr ntpd 1ntpdmdoc .
+.It Ic authinfo
+Returns information concerning the authentication module,
+including known keys and counts of encryptions and decryptions
+which have been done.
+.It Ic traps
+Display the traps set in the server.
+See the source listing for
+further information.
+.It Xo Ic addtrap Ar address
+.Op Ar port
+.Op Ar interface
+.Xc
+Set a trap for asynchronous messages.
+See the source listing
+for further information.
+.It Xo Ic clrtrap Ar address
+.Op Ar port
+.Op Ar interface
+.Xc
+Clear a trap for asynchronous messages.
+See the source listing
+for further information.
+.It Ic reset
+Clear the statistics counters in various modules of the server.
+See the source listing for further information.
+.El
+ _END_MDOC_USAGE;
+};
+
+
+doc-section = {
+ ds-type = 'SEE ALSO';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_SEEALSO
+.Xr ntp.conf 5 ,
+.Xr ntpd 1ntpdmdoc
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 3)
+.%O RFC1305
+.Re
+ _END_MDOC_SEEALSO;
+};
+
+
+doc-section = {
+ ds-type = 'AUTHORS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_AUTHORS
+The formatting directives in this document came from FreeBSD.
+ _END_MDOC_AUTHORS;
+};
+
+
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+The
+.Nm
+utility is a crude hack.
+Much of the information it shows is
+deadly boring and could only be loved by its implementer.
+The
+program was designed so that new (and temporary) features were easy
+to hack in, at great expense to the program's ease of use.
+Despite
+this, the program is occasionally useful.
+.Pp
+Please report bugs to http://bugs.ntp.org .
+ _END_MDOC_BUGS;
+};
diff --git a/ntpdc/ntpdc-opts.h b/ntpdc/ntpdc-opts.h
new file mode 100644
index 0000000..182f77a
--- /dev/null
+++ b/ntpdc/ntpdc-opts.h
@@ -0,0 +1,294 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:57:15 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpdc-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpdc author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpdc program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+/**
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the ntpdc program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_NTPDC_OPTS_H_GUARD
+#define AUTOOPTS_NTPDC_OPTS_H_GUARD 1
+#include "config.h"
+#include <autoopts/options.h>
+
+/**
+ * Ensure that the library used for compiling this generated header is at
+ * least as new as the version current when the header template was released
+ * (not counting patch version increments). Also ensure that the oldest
+ * tolerable version is at least as old as what was current when the header
+ * template was released.
+ */
+#define AO_TEMPLATE_VERSION 167936
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+ Choke Me.
+#endif
+
+/**
+ * Enumeration of each option type for ntpdc
+ */
+typedef enum {
+ INDEX_OPT_IPV4 = 0,
+ INDEX_OPT_IPV6 = 1,
+ INDEX_OPT_COMMAND = 2,
+ INDEX_OPT_DEBUG_LEVEL = 3,
+ INDEX_OPT_SET_DEBUG_LEVEL = 4,
+ INDEX_OPT_INTERACTIVE = 5,
+ INDEX_OPT_LISTPEERS = 6,
+ INDEX_OPT_NUMERIC = 7,
+ INDEX_OPT_PEERS = 8,
+ INDEX_OPT_SHOWPEERS = 9,
+ INDEX_OPT_VERSION = 10,
+ INDEX_OPT_HELP = 11,
+ INDEX_OPT_MORE_HELP = 12,
+ INDEX_OPT_SAVE_OPTS = 13,
+ INDEX_OPT_LOAD_OPTS = 14
+} teOptIndex;
+/** count of all options for ntpdc */
+#define OPTION_CT 15
+/** ntpdc version */
+#define NTPDC_VERSION "4.2.7p482"
+/** Full ntpdc version text */
+#define NTPDC_FULL_VERSION "ntpdc 4.2.7p482"
+
+/**
+ * Interface defines for all options. Replace "n" with the UPPER_CASED
+ * option name (as in the teOptIndex enumeration above).
+ * e.g. HAVE_OPT(IPV4)
+ */
+#define DESC(n) (ntpdcOptions.pOptDesc[INDEX_OPT_## n])
+/** 'true' if an option has been specified in any way */
+#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
+/** The string argument to an option. The argument type must be \"string\". */
+#define OPT_ARG(n) (DESC(n).optArg.argString)
+/** Mask the option state revealing how an option was specified.
+ * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
+ * \a OPTST_DEFINED, \a OPTST_RESET or zero.
+ */
+#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
+/** Count of option's occurrances *on the command line*. */
+#define COUNT_OPT(n) (DESC(n).optOccCt)
+/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
+#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
+/** 'true' if \a HAVE_OPT would yield 'false'. */
+#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
+/** 'true' if OPTST_DISABLED bit not set. */
+#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
+/** number of stacked option arguments.
+ * Valid only for stacked option arguments. */
+#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
+/** stacked argument vector.
+ * Valid only for stacked option arguments. */
+#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
+/** Reset an option. */
+#define CLEAR_OPT(n) STMTS( \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ DESC(n).fOptState |= OPTST_DISABLED; \
+ DESC(n).optCookie = NULL )
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Enumeration of ntpdc exit codes
+ */
+typedef enum {
+ NTPDC_EXIT_SUCCESS = 0,
+ NTPDC_EXIT_FAILURE = 1,
+ NTPDC_EXIT_USAGE_ERROR = 64,
+ NTPDC_EXIT_NO_CONFIG_INPUT = 66,
+ NTPDC_EXIT_LIBOPTS_FAILURE = 70
+} ntpdc_exit_code_t;
+/** @} */
+/**
+ * Make sure there are no #define name conflicts with the option names
+ */
+#ifndef NO_OPTION_NAME_WARNINGS
+# ifdef IPV4
+# warning undefining IPV4 due to option name conflict
+# undef IPV4
+# endif
+# ifdef IPV6
+# warning undefining IPV6 due to option name conflict
+# undef IPV6
+# endif
+# ifdef COMMAND
+# warning undefining COMMAND due to option name conflict
+# undef COMMAND
+# endif
+# ifdef DEBUG_LEVEL
+# warning undefining DEBUG_LEVEL due to option name conflict
+# undef DEBUG_LEVEL
+# endif
+# ifdef SET_DEBUG_LEVEL
+# warning undefining SET_DEBUG_LEVEL due to option name conflict
+# undef SET_DEBUG_LEVEL
+# endif
+# ifdef INTERACTIVE
+# warning undefining INTERACTIVE due to option name conflict
+# undef INTERACTIVE
+# endif
+# ifdef LISTPEERS
+# warning undefining LISTPEERS due to option name conflict
+# undef LISTPEERS
+# endif
+# ifdef NUMERIC
+# warning undefining NUMERIC due to option name conflict
+# undef NUMERIC
+# endif
+# ifdef PEERS
+# warning undefining PEERS due to option name conflict
+# undef PEERS
+# endif
+# ifdef SHOWPEERS
+# warning undefining SHOWPEERS due to option name conflict
+# undef SHOWPEERS
+# endif
+#else /* NO_OPTION_NAME_WARNINGS */
+# undef IPV4
+# undef IPV6
+# undef COMMAND
+# undef DEBUG_LEVEL
+# undef SET_DEBUG_LEVEL
+# undef INTERACTIVE
+# undef LISTPEERS
+# undef NUMERIC
+# undef PEERS
+# undef SHOWPEERS
+#endif /* NO_OPTION_NAME_WARNINGS */
+
+/**
+ * Interface defines for specific options.
+ * @{
+ */
+#define VALUE_OPT_IPV4 '4'
+#define VALUE_OPT_IPV6 '6'
+#define VALUE_OPT_COMMAND 'c'
+#define VALUE_OPT_DEBUG_LEVEL 'd'
+#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
+
+#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
+#define VALUE_OPT_INTERACTIVE 'i'
+#define VALUE_OPT_LISTPEERS 'l'
+#define VALUE_OPT_NUMERIC 'n'
+#define VALUE_OPT_PEERS 'p'
+#define VALUE_OPT_SHOWPEERS 's'
+/** option flag (value) for help-value option */
+#define VALUE_OPT_HELP '?'
+/** option flag (value) for more-help-value option */
+#define VALUE_OPT_MORE_HELP '!'
+/** option flag (value) for version-value option */
+#define VALUE_OPT_VERSION 0x1001
+/** option flag (value) for save-opts-value option */
+#define VALUE_OPT_SAVE_OPTS '>'
+/** option flag (value) for load-opts-value option */
+#define VALUE_OPT_LOAD_OPTS '<'
+#define SET_OPT_SAVE_OPTS(a) STMTS( \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
+ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
+ DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
+/*
+ * Interface defines not associated with particular options
+ */
+#define ERRSKIP_OPTERR STMTS(ntpdcOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(ntpdcOptions.fOptSet |= OPTPROC_ERRSTOP)
+#define RESTART_OPT(n) STMTS( \
+ ntpdcOptions.curOptIdx = (n); \
+ ntpdcOptions.pzCurOpt = NULL )
+#define START_OPT RESTART_OPT(1)
+#define USAGE(c) (*ntpdcOptions.pUsageProc)(&ntpdcOptions, c)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* * * * * *
+ *
+ * Declare the ntpdc option descriptor.
+ */
+extern tOptions ntpdcOptions;
+
+#if defined(ENABLE_NLS)
+# ifndef _
+# include <stdio.h>
+# ifndef HAVE_GETTEXT
+ extern char * gettext(char const *);
+# else
+# include <libintl.h>
+# endif
+
+# ifndef ATTRIBUTE_FORMAT_ARG
+# define ATTRIBUTE_FORMAT_ARG(_a)
+# endif
+
+static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
+static inline char* aoGetsText(char const* pz) {
+ if (pz == NULL) return NULL;
+ return (char*)gettext(pz);
+}
+# define _(s) aoGetsText(s)
+# endif /* _() */
+
+# define OPT_NO_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT_CFG;)
+# define OPT_NO_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
+
+# define OPT_XLAT_CFG_NAMES STMTS(ntpdcOptions.fOptSet &= \
+ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
+# define OPT_XLAT_OPT_NAMES STMTS(ntpdcOptions.fOptSet &= \
+ ~OPTPROC_NXLAT_OPT;)
+
+#else /* ENABLE_NLS */
+# define OPT_NO_XLAT_CFG_NAMES
+# define OPT_NO_XLAT_OPT_NAMES
+
+# define OPT_XLAT_CFG_NAMES
+# define OPT_XLAT_OPT_NAMES
+
+# ifndef _
+# define _(_s) _s
+# endif
+#endif /* ENABLE_NLS */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_NTPDC_OPTS_H_GUARD */
+
+/* ntpdc-opts.h ends here */
diff --git a/ntpdc/ntpdc.1ntpdcman b/ntpdc/ntpdc.1ntpdcman
new file mode 100644
index 0000000..a3579bb
--- /dev/null
+++ b/ntpdc/ntpdc.1ntpdcman
@@ -0,0 +1,874 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpdc 1ntpdcman "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6QaWHN/ag-hRaOGN)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:28 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpdc-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpdc\fP
+\- vendor-specific NTPD control program
+.SH SYNOPSIS
+\f\*[B-Font]ntpdc\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ host ...]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpdc\fP
+is deprecated.
+Please use
+\fCntpq\fR(1ntpqmdoc)\f[] instead \- it can do everything
+\f\*[B-Font]ntpdc\fP
+used to do, and it does so using a much more sane interface.
+.sp \n(Ppu
+.ne 2
+
+\f\*[B-Font]ntpdc\fP
+is a utility program used to query
+\fCntpd\fR(1ntpdmdoc)\f[]
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+\f\*[B-Font]ntpdc\fP
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+\f\*[B-Font]ntpdc\fP.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[]
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[]
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, listpeers, peers, showpeers.
+.sp
+Force ntpq to operate in interactive mode. Prompts will be written
+to the standard output and commands read from the standard input.
+.TP
+.NOP \f\*[B-Font]\-l\f[], \f\*[B-Font]\-\-listpeers\f[]
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary of
+their state. This is equivalent to the 'listpeers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+numeric host addresses.
+.sp
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-s\f[], \f\*[B-Font]\-\-showpeers\f[]
+Show a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'dmpeers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPDC_<option-name>\fP or \fBNTPDC\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+If one or more request options are included on the command line
+when
+\f\*[B-Font]ntpdc\fP
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+\f\*[B-Font]ntpdc\fP
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+\f\*[B-Font]ntpdc\fP
+utility will prompt for
+commands if the standard input is a terminal device.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]ntpdc\fP
+utility uses NTP mode 7 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+\f\*[B-Font]ntpdc\fP
+utility makes
+no attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+.sp \n(Ppu
+.ne 2
+
+The operation of
+\f\*[B-Font]ntpdc\fP
+are specific to the particular
+implementation of the
+\fCntpd\fR(1ntpdmdoc)\f[]
+daemon and can be expected to
+work only with this and maybe some previous versions of the daemon.
+Requests from a remote
+\f\*[B-Font]ntpdc\fP
+utility which affect the
+state of the local server must be authenticated, which requires
+both the remote program and local server share a common key and key
+identifier.
+.sp \n(Ppu
+.ne 2
+
+Note that in contexts where a host name is expected, a
+\f\*[B-Font]\-4\f[]
+qualifier preceding the host name forces DNS resolution to the IPv4 namespace,
+while a
+\f\*[B-Font]\-6\f[]
+qualifier forces DNS resolution to the IPv6 namespace.
+Specifying a command line option other than
+\f\*[B-Font]\-i\f[]
+or
+\f\*[B-Font]\-n\f[]
+will cause the specified query (queries) to be sent to
+the indicated host(s) immediately.
+Otherwise,
+\f\*[B-Font]ntpdc\fP
+will
+attempt to read interactive format commands from the standard
+input.
+.SS "Interactive Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+The output of a
+command is normally sent to the standard output, but optionally the
+output of individual commands may be sent to a file by appending a
+\[oq]\&>\[cq],
+followed by a file name, to the command line.
+.sp \n(Ppu
+.ne 2
+
+A number of interactive format commands are executed entirely
+within the
+\f\*[B-Font]ntpdc\fP
+utility itself and do not result in NTP
+mode 7 requests being sent to a server.
+These are described
+following.
+.TP 7
+.NOP \f\*[B-Font]\&?\f[] \f\*[I-Font]command_keyword\f[]
+.TP 7
+.NOP \f\*[B-Font]help\f[] \f\*[I-Font]command_keyword\f[]
+A
+\[oq]\f\*[B-Font]\&?\f[]\[cq]
+will print a list of all the command
+keywords known to this incarnation of
+\f\*[B-Font]ntpdc\fP.
+A
+\[oq]\f\*[B-Font]\&?\f[]\[cq]
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+\fCntpq\fR(1ntpqmdoc)\f[]
+than this manual
+page.
+.TP 7
+.NOP \f\*[B-Font]delay\f[] \f\*[I-Font]milliseconds\f[]
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.TP 7
+.NOP \f\*[B-Font]host\f[] \f\*[I-Font]hostname\f[]
+Set the host to which future queries will be sent.
+Hostname may
+be either a host name or a numeric address.
+.TP 7
+.NOP \f\*[B-Font]hostnames\f[] [\f\*[B-Font]yes\f[] | \f\*[B-Font]no\f[]]
+If
+\f\*[B-Font]yes\f[]
+is specified, host names are printed in
+information displays.
+If
+\f\*[B-Font]no\f[]
+is specified, numeric
+addresses are printed instead.
+The default is
+\f\*[B-Font]yes\f[],
+unless
+modified using the command line
+\f\*[B-Font]\-n\f[]
+switch.
+.TP 7
+.NOP \f\*[B-Font]keyid\f[] \f\*[I-Font]keyid\f[]
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.TP 7
+.NOP \f\*[B-Font]quit\f[]
+Exit
+\f\*[B-Font]ntpdc\fP.
+.TP 7
+.NOP \f\*[B-Font]passwd\f[]
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.TP 7
+.NOP \f\*[B-Font]timeout\f[] \f\*[I-Font]milliseconds\f[]
+Specify a timeout period for responses to server queries.
+The
+default is about 8000 milliseconds.
+Note that since
+\f\*[B-Font]ntpdc\fP
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.PP
+.SS "Control Message Commands"
+Query commands result in NTP mode 7 packets containing requests for
+information being sent to the server.
+These are read-only commands
+in that they make no modification of the server configuration
+state.
+.TP 7
+.NOP \f\*[B-Font]listpeers\f[]
+Obtains and prints a brief list of the peers for which the
+server is maintaining state.
+These should include all configured
+peer associations as well as those peers whose stratum is such that
+they are considered by the server to be possible future
+synchronization candidates.
+.TP 7
+.NOP \f\*[B-Font]peers\f[]
+Obtains a list of peers for which the server is maintaining
+state, along with a summary of that state.
+Summary information
+includes the address of the remote peer, the local interface
+address (0.0.0.0 if a local address has yet to be determined), the
+stratum of the remote peer (a stratum of 16 indicates the remote
+peer is unsynchronized), the polling interval, in seconds, the
+reachability register, in octal, and the current estimated delay,
+offset and dispersion of the peer, all in seconds.
+.sp \n(Ppu
+.ne 2
+
+The character in the left margin indicates the mode this peer
+entry is operating in.
+A
+\[oq]\&+\[cq]
+denotes symmetric active, a
+\[oq]\&-\[cq]
+indicates symmetric passive, a
+\[oq]\&=\[cq]
+means the
+remote server is being polled in client mode, a
+\[oq]\&^\[cq]
+indicates that the server is broadcasting to this address, a
+\[oq]\&~\[cq]
+denotes that the remote peer is sending broadcasts and a
+\[oq]\&~\[cq]
+denotes that the remote peer is sending broadcasts and a
+\[oq]\&*\[cq]
+marks the peer the server is currently synchronizing
+to.
+.sp \n(Ppu
+.ne 2
+
+The contents of the host field may be one of four forms.
+It may
+be a host name, an IP address, a reference clock implementation
+name with its parameter or
+\fBREFCLK\fR()\f[]
+On
+\f\*[B-Font]hostnames\f[]
+\f\*[B-Font]no\f[]
+only IP-addresses
+will be displayed.
+.TP 7
+.NOP \f\*[B-Font]dmpeers\f[]
+A slightly different peer summary list.
+Identical to the output
+of the
+\f\*[B-Font]peers\f[]
+command, except for the character in the
+leftmost column.
+Characters only appear beside peers which were
+included in the final stage of the clock selection algorithm.
+A
+\[oq]\&.\[cq]
+indicates that this peer was cast off in the falseticker
+detection, while a
+\[oq]\&+\[cq]
+indicates that the peer made it
+through.
+A
+\[oq]\&*\[cq]
+denotes the peer the server is currently
+synchronizing with.
+.TP 7
+.NOP \f\*[B-Font]showpeer\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]...\f[]]
+Shows a detailed display of the current peer variables for one
+or more peers.
+Most of these values are described in the NTP
+Version 2 specification.
+.TP 7
+.NOP \f\*[B-Font]pstats\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]...\f[]]
+Show per-peer statistic counters associated with the specified
+peer(s).
+.TP 7
+.NOP \f\*[B-Font]clockstat\f[] \f\*[I-Font]clock_peer_address\f[] [\f\*[I-Font]...\f[]]
+Obtain and print information concerning a peer clock.
+The
+values obtained provide information on the setting of fudge factors
+and other clock performance information.
+.TP 7
+.NOP \f\*[B-Font]kerninfo\f[]
+Obtain and print kernel phase-lock loop operating parameters.
+This information is available only if the kernel has been specially
+modified for a precision timekeeping function.
+.TP 7
+.NOP \f\*[B-Font]loopinfo\f[] [\f\*[B-Font]oneline\f[] | \f\*[B-Font]multiline\f[]]
+Print the values of selected loop filter variables.
+The loop
+filter is the part of NTP which deals with adjusting the local
+system clock.
+The
+\[oq]offset\[cq]
+is the last offset given to the
+loop filter by the packet processing code.
+The
+\[oq]frequency\[cq]
+is the frequency error of the local clock in parts-per-million
+(ppm).
+The
+\[oq]time_const\[cq]
+controls the stiffness of the
+phase-lock loop and thus the speed at which it can adapt to
+oscillator drift.
+The
+\[oq]watchdog timer\[cq]
+value is the number
+of seconds which have elapsed since the last sample offset was
+given to the loop filter.
+The
+\f\*[B-Font]oneline\f[]
+and
+\f\*[B-Font]multiline\f[]
+options specify the format in which this
+information is to be printed, with
+\f\*[B-Font]multiline\f[]
+as the
+default.
+.TP 7
+.NOP \f\*[B-Font]sysinfo\f[]
+Print a variety of system state variables, i.e., state related
+to the local server.
+All except the last four lines are described
+in the NTP Version 3 specification, RFC-1305.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]system flags\[cq]
+show various system flags, some of
+which can be set and cleared by the
+\f\*[B-Font]enable\f[]
+and
+\f\*[B-Font]disable\f[]
+configuration commands, respectively.
+These are
+the
+\f\*[B-Font]auth\f[],
+\f\*[B-Font]bclient\f[],
+\f\*[B-Font]monitor\f[],
+\f\*[B-Font]pll\f[],
+\f\*[B-Font]pps\f[]
+and
+\f\*[B-Font]stats\f[]
+flags.
+See the
+\fCntpd\fR(1ntpdmdoc)\f[]
+documentation for the meaning of these flags.
+There
+are two additional flags which are read only, the
+\f\*[B-Font]kernel_pll\f[]
+and
+\f\*[B-Font]kernel_pps\f[].
+These flags indicate
+the synchronization status when the precision time kernel
+modifications are in use.
+The
+\[oq]kernel_pll\[cq]
+indicates that
+the local clock is being disciplined by the kernel, while the
+\[oq]kernel_pps\[cq]
+indicates the kernel discipline is provided by the PPS
+signal.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]stability\[cq]
+is the residual frequency error remaining
+after the system frequency correction is applied and is intended for
+maintenance and debugging.
+In most architectures, this value will
+initially decrease from as high as 500 ppm to a nominal value in
+the range .01 to 0.1 ppm.
+If it remains high for some time after
+starting the daemon, something may be wrong with the local clock,
+or the value of the kernel variable
+\fIkern.clockrate.tick\f[]
+may be
+incorrect.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]broadcastdelay\[cq]
+shows the default broadcast delay,
+as set by the
+\f\*[B-Font]broadcastdelay\f[]
+configuration command.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]authdelay\[cq]
+shows the default authentication delay,
+as set by the
+\f\*[B-Font]authdelay\f[]
+configuration command.
+.TP 7
+.NOP \f\*[B-Font]sysstats\f[]
+Print statistics counters maintained in the protocol
+module.
+.TP 7
+.NOP \f\*[B-Font]memstats\f[]
+Print statistics counters related to memory allocation
+code.
+.TP 7
+.NOP \f\*[B-Font]iostats\f[]
+Print statistics counters maintained in the input-output
+module.
+.TP 7
+.NOP \f\*[B-Font]timerstats\f[]
+Print statistics counters maintained in the timer/event queue
+support code.
+.TP 7
+.NOP \f\*[B-Font]reslist\f[]
+Obtain and print the server's restriction list.
+This list is
+(usually) printed in sorted order and may help to understand how
+the restrictions are applied.
+.TP 7
+.NOP \f\*[B-Font]monlist\f[] [\f\*[I-Font]version\f[]]
+Obtain and print traffic counts collected and maintained by the
+monitor facility.
+The version number should not normally need to be
+specified.
+.TP 7
+.NOP \f\*[B-Font]clkbug\f[] \f\*[I-Font]clock_peer_address\f[] [\f\*[I-Font]...\f[]]
+Obtain debugging information for a reference clock driver.
+This
+information is provided only by some clock drivers and is mostly
+undecodable without a copy of the driver source in hand.
+.PP
+.SS "Runtime Configuration Requests"
+All requests which cause state changes in the server are
+authenticated by the server using a configured NTP key (the
+facility can also be disabled by the server by not configuring a
+key).
+The key number and the corresponding key must also be made
+known to
+\f\*[B-Font]ntpdc\fP.
+This can be done using the
+\f\*[B-Font]keyid\f[]
+and
+\f\*[B-Font]passwd\f[]
+commands, the latter of which will prompt at the terminal for a
+password to use as the encryption key.
+You will also be prompted
+automatically for both the key number and password the first time a
+command which would result in an authenticated request to the
+server is given.
+Authentication not only provides verification that
+the requester has permission to make such changes, but also gives
+an extra degree of protection again transmission errors.
+.sp \n(Ppu
+.ne 2
+
+Authenticated requests always include a timestamp in the packet
+data, which is included in the computation of the authentication
+code.
+This timestamp is compared by the server to its receive time
+stamp.
+If they differ by more than a small amount the request is
+rejected.
+This is done for two reasons.
+First, it makes simple
+replay attacks on the server, by someone who might be able to
+overhear traffic on your LAN, much more difficult.
+Second, it makes
+it more difficult to request configuration changes to your server
+from topologically remote hosts.
+While the reconfiguration facility
+will work well with a server on the local host, and may work
+adequately between time-synchronized hosts on the same LAN, it will
+work very poorly for more distant hosts.
+As such, if reasonable
+passwords are chosen, care is taken in the distribution and
+protection of keys and appropriate source address restrictions are
+applied, the run time reconfiguration facility should provide an
+adequate level of security.
+.sp \n(Ppu
+.ne 2
+
+The following commands all make authenticated requests.
+.TP 7
+.NOP \f\*[B-Font]addpeer\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]keyid\f[]] [\f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]]
+Add a configured peer association at the given address and
+operating in symmetric active mode.
+Note that an existing
+association with the same peer may be deleted when this command is
+executed, or may simply be converted to conform to the new
+configuration, as appropriate.
+If the optional
+\f\*[I-Font]keyid\f[]
+is a
+nonzero integer, all outgoing packets to the remote server will
+have an authentication field attached encrypted with this key.
+If
+the value is 0 (or not given) no authentication will be done.
+The
+\f\*[I-Font]version\f[]
+can be 1, 2 or 3 and defaults to 3.
+The
+\f\*[B-Font]prefer\f[]
+keyword indicates a preferred peer (and thus will
+be used primarily for clock synchronisation if possible).
+The
+preferred peer also determines the validity of the PPS signal \- if
+the preferred peer is suitable for synchronisation so is the PPS
+signal.
+.TP 7
+.NOP \f\*[B-Font]addserver\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]keyid\f[]] [\f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]]
+Identical to the addpeer command, except that the operating
+mode is client.
+.TP 7
+.NOP \f\*[B-Font]broadcast\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]keyid\f[]] [\f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]]
+Identical to the addpeer command, except that the operating
+mode is broadcast.
+In this case a valid key identifier and key are
+required.
+The
+\f\*[I-Font]peer_address\f[]
+parameter can be the broadcast
+address of the local network or a multicast group address assigned
+to NTP.
+If a multicast address, a multicast-capable kernel is
+required.
+.TP 7
+.NOP \f\*[B-Font]unconfig\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]...\f[]]
+This command causes the configured bit to be removed from the
+specified peer(s).
+In many cases this will cause the peer
+association to be deleted.
+When appropriate, however, the
+association may persist in an unconfigured mode if the remote peer
+is willing to continue on in this fashion.
+.TP 7
+.NOP \f\*[B-Font]fudge\f[] \f\*[I-Font]peer_address\f[] [\f\*[B-Font]time1\f[]] [\f\*[B-Font]time2\f[]] [\f\*[I-Font]stratum\f[]] [\f\*[I-Font]refid\f[]]
+This command provides a way to set certain data for a reference
+clock.
+See the source listing for further information.
+.TP 7
+.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]pps\f[] | \f\*[B-Font]stats\f[]]
+.TP 7
+.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]pps\f[] | \f\*[B-Font]stats\f[]]
+These commands operate in the same way as the
+\f\*[B-Font]enable\f[]
+and
+\f\*[B-Font]disable\f[]
+configuration file commands of
+\fCntpd\fR(1ntpdmdoc)\f[].
+.RS
+.TP 7
+.NOP \f\*[B-Font]auth\f[]
+Enables the server to synchronize with unconfigured peers only
+if the peer has been correctly authenticated using either public key
+or private key cryptography.
+The default for this flag is enable.
+.TP 7
+.NOP \f\*[B-Font]bclient\f[]
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the multicastclient command with
+default address.
+The default for this flag is disable.
+.TP 7
+.NOP \f\*[B-Font]calibrate\f[]
+Enables the calibrate feature for reference clocks.
+The default for this flag is disable.
+.TP 7
+.NOP \f\*[B-Font]kernel\f[]
+Enables the kernel time discipline, if available.
+The default for this flag is enable if support is available, otherwise disable.
+.TP 7
+.NOP \f\*[B-Font]monitor\f[]
+Enables the monitoring facility.
+See the documentation here about the
+\f\*[B-Font]monlist\f[]
+command or further information.
+The default for this flag is enable.
+.TP 7
+.NOP \f\*[B-Font]ntp\f[]
+Enables time and frequency discipline.
+In effect, this switch opens and closes the feedback loop,
+which is useful for testing.
+The default for this flag is enable.
+.TP 7
+.NOP \f\*[B-Font]pps\f[]
+Enables the pulse-per-second (PPS) signal when frequency
+and time is disciplined by the precision time kernel modifications.
+See the
+"A Kernel Model for Precision Timekeeping"
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+page for further information.
+The default for this flag is disable.
+.TP 7
+.NOP \f\*[B-Font]stats\f[]
+Enables the statistics facility.
+See the
+\fIMonitoring\f[] \fIOptions\f[]
+section of
+\fCntp.conf\fR(5)\f[]
+for further information.
+The default for this flag is disable.
+.RE
+.TP 7
+.NOP \f\*[B-Font]restrict\f[] \f\*[I-Font]address\f[] \f\*[I-Font]mask\f[] \f\*[I-Font]flag\f[] [\f\*[I-Font]...\f[]]
+This command operates in the same way as the
+\f\*[B-Font]restrict\f[]
+configuration file commands of
+\fCntpd\fR(1ntpdmdoc)\f[].
+.TP 7
+.NOP \f\*[B-Font]unrestrict\f[] \f\*[I-Font]address\f[] \f\*[I-Font]mask\f[] \f\*[I-Font]flag\f[] [\f\*[I-Font]...\f[]]
+Unrestrict the matching entry from the restrict list.
+.TP 7
+.NOP \f\*[B-Font]delrestrict\f[] \f\*[I-Font]address\f[] \f\*[I-Font]mask\f[] [\f\*[B-Font]ntpport\f[]]
+Delete the matching entry from the restrict list.
+.TP 7
+.NOP \f\*[B-Font]readkeys\f[]
+Causes the current set of authentication keys to be purged and
+a new set to be obtained by rereading the keys file (which must
+have been specified in the
+\fCntpd\fR(1ntpdmdoc)\f[]
+configuration file).
+This
+allows encryption keys to be changed without restarting the
+server.
+.TP 7
+.NOP \f\*[B-Font]trustedkey\f[] \f\*[I-Font]keyid\f[] [\f\*[I-Font]...\f[]]
+.TP 7
+.NOP \f\*[B-Font]untrustedkey\f[] \f\*[I-Font]keyid\f[] [\f\*[I-Font]...\f[]]
+These commands operate in the same way as the
+\f\*[B-Font]trustedkey\f[]
+and
+\f\*[B-Font]untrustedkey\f[]
+configuration file
+commands of
+\fCntpd\fR(1ntpdmdoc)\f[].
+.TP 7
+.NOP \f\*[B-Font]authinfo\f[]
+Returns information concerning the authentication module,
+including known keys and counts of encryptions and decryptions
+which have been done.
+.TP 7
+.NOP \f\*[B-Font]traps\f[]
+Display the traps set in the server.
+See the source listing for
+further information.
+.TP 7
+.NOP \f\*[B-Font]addtrap\f[] \f\*[I-Font]address\f[] [\f\*[I-Font]port\f[]] [\f\*[I-Font]interface\f[]]
+Set a trap for asynchronous messages.
+See the source listing
+for further information.
+.TP 7
+.NOP \f\*[B-Font]clrtrap\f[] \f\*[I-Font]address\f[] [\f\*[I-Font]port\f[]] [\f\*[I-Font]interface\f[]]
+Clear a trap for asynchronous messages.
+See the source listing
+for further information.
+.TP 7
+.NOP \f\*[B-Font]reset\f[]
+Clear the statistics counters in various modules of the server.
+See the source listing for further information.
+.PP
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "SEE ALSO"
+\fCntp.conf\fR(5)\f[],
+\fCntpd\fR(1ntpdmdoc)\f[]
+David L. Mills,
+\fINetwork Time Protocol (Version 3)\fR,
+RFC1305
+.PP
+
+.SH AUTHORS
+The formatting directives in this document came from FreeBSD.
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+The
+\f\*[B-Font]ntpdc\fP
+utility is a crude hack.
+Much of the information it shows is
+deadly boring and could only be loved by its implementer.
+The
+program was designed so that new (and temporary) features were easy
+to hack in, at great expense to the program's ease of use.
+Despite
+this, the program is occasionally useful.
+.sp \n(Ppu
+.ne 2
+
+Please report bugs to http://bugs.ntp.org .
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpdc\fP
+option definitions.
diff --git a/ntpdc/ntpdc.1ntpdcmdoc b/ntpdc/ntpdc.1ntpdcmdoc
new file mode 100644
index 0000000..46f1fa5
--- /dev/null
+++ b/ntpdc/ntpdc.1ntpdcmdoc
@@ -0,0 +1,809 @@
+.Dd December 2 2014
+.Dt NTPDC 1ntpdcmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:34 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpdc-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpdc
+.Nd vendor-specific NTPD control program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ host ...]
+.Pp
+.Sh DESCRIPTION
+.Nm
+is deprecated.
+Please use
+.Xr ntpq 1ntpqmdoc instead \- it can do everything
+.Nm
+used to do, and it does so using a much more sane interface.
+.Pp
+.Nm
+is a utility program used to query
+.Xr ntpd 1ntpdmdoc
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+.Nm
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+.Nm .
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl i , Fl \-interactive
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, listpeers, peers, showpeers.
+.sp
+Force ntpq to operate in interactive mode. Prompts will be written
+to the standard output and commands read from the standard input.
+.It Fl l , Fl \-listpeers
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary of
+their state. This is equivalent to the 'listpeers' interactive command.
+.It Fl n , Fl \-numeric
+numeric host addresses.
+.sp
+Output all host addresses in dotted\-quad numeric format rather than
+converting to the canonical host names.
+.It Fl p , Fl \-peers
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.It Fl s , Fl \-showpeers
+Show a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'dmpeers' interactive command.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPDC_<option\-name>\fP or \fBNTPDC\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+If one or more request options are included on the command line
+when
+.Nm
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+.Nm
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+.Nm
+utility will prompt for
+commands if the standard input is a terminal device.
+.Pp
+The
+.Nm
+utility uses NTP mode 7 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+.Nm
+utility makes
+no attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+.Pp
+The operation of
+.Nm
+are specific to the particular
+implementation of the
+.Xr ntpd 1ntpdmdoc
+daemon and can be expected to
+work only with this and maybe some previous versions of the daemon.
+Requests from a remote
+.Nm
+utility which affect the
+state of the local server must be authenticated, which requires
+both the remote program and local server share a common key and key
+identifier.
+.Pp
+Note that in contexts where a host name is expected, a
+.Fl 4
+qualifier preceding the host name forces DNS resolution to the IPv4 namespace,
+while a
+.Fl 6
+qualifier forces DNS resolution to the IPv6 namespace.
+Specifying a command line option other than
+.Fl i
+or
+.Fl n
+will cause the specified query (queries) to be sent to
+the indicated host(s) immediately.
+Otherwise,
+.Nm
+will
+attempt to read interactive format commands from the standard
+input.
+.Ss "Interactive Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+The output of a
+command is normally sent to the standard output, but optionally the
+output of individual commands may be sent to a file by appending a
+.Ql \&> ,
+followed by a file name, to the command line.
+.Pp
+A number of interactive format commands are executed entirely
+within the
+.Nm
+utility itself and do not result in NTP
+mode 7 requests being sent to a server.
+These are described
+following.
+.Bl -tag -width indent
+.It Ic \&? Ar command_keyword
+.It Ic help Ar command_keyword
+A
+.Sq Ic \&?
+will print a list of all the command
+keywords known to this incarnation of
+.Nm .
+A
+.Sq Ic \&?
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+.Xr ntpq 1ntpqmdoc
+than this manual
+page.
+.It Ic delay Ar milliseconds
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.It Ic host Ar hostname
+Set the host to which future queries will be sent.
+Hostname may
+be either a host name or a numeric address.
+.It Ic hostnames Op Cm yes | Cm no
+If
+.Cm yes
+is specified, host names are printed in
+information displays.
+If
+.Cm no
+is specified, numeric
+addresses are printed instead.
+The default is
+.Cm yes ,
+unless
+modified using the command line
+.Fl n
+switch.
+.It Ic keyid Ar keyid
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.It Ic quit
+Exit
+.Nm .
+.It Ic passwd
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.It Ic timeout Ar milliseconds
+Specify a timeout period for responses to server queries.
+The
+default is about 8000 milliseconds.
+Note that since
+.Nm
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.El
+.Ss "Control Message Commands"
+Query commands result in NTP mode 7 packets containing requests for
+information being sent to the server.
+These are read\-only commands
+in that they make no modification of the server configuration
+state.
+.Bl -tag -width indent
+.It Ic listpeers
+Obtains and prints a brief list of the peers for which the
+server is maintaining state.
+These should include all configured
+peer associations as well as those peers whose stratum is such that
+they are considered by the server to be possible future
+synchronization candidates.
+.It Ic peers
+Obtains a list of peers for which the server is maintaining
+state, along with a summary of that state.
+Summary information
+includes the address of the remote peer, the local interface
+address (0.0.0.0 if a local address has yet to be determined), the
+stratum of the remote peer (a stratum of 16 indicates the remote
+peer is unsynchronized), the polling interval, in seconds, the
+reachability register, in octal, and the current estimated delay,
+offset and dispersion of the peer, all in seconds.
+.Pp
+The character in the left margin indicates the mode this peer
+entry is operating in.
+A
+.Ql \&+
+denotes symmetric active, a
+.Ql \&\-
+indicates symmetric passive, a
+.Ql \&=
+means the
+remote server is being polled in client mode, a
+.Ql \&^
+indicates that the server is broadcasting to this address, a
+.Ql \&~
+denotes that the remote peer is sending broadcasts and a
+.Ql \&~
+denotes that the remote peer is sending broadcasts and a
+.Ql \&*
+marks the peer the server is currently synchronizing
+to.
+.Pp
+The contents of the host field may be one of four forms.
+It may
+be a host name, an IP address, a reference clock implementation
+name with its parameter or
+.Fn REFCLK "implementation_number" "parameter" .
+On
+.Ic hostnames
+.Cm no
+only IP\-addresses
+will be displayed.
+.It Ic dmpeers
+A slightly different peer summary list.
+Identical to the output
+of the
+.Ic peers
+command, except for the character in the
+leftmost column.
+Characters only appear beside peers which were
+included in the final stage of the clock selection algorithm.
+A
+.Ql \&.
+indicates that this peer was cast off in the falseticker
+detection, while a
+.Ql \&+
+indicates that the peer made it
+through.
+A
+.Ql \&*
+denotes the peer the server is currently
+synchronizing with.
+.It Ic showpeer Ar peer_address Oo Ar ... Oc
+Shows a detailed display of the current peer variables for one
+or more peers.
+Most of these values are described in the NTP
+Version 2 specification.
+.It Ic pstats Ar peer_address Oo Ar ... Oc
+Show per\-peer statistic counters associated with the specified
+peer(s).
+.It Ic clockstat Ar clock_peer_address Oo Ar ... Oc
+Obtain and print information concerning a peer clock.
+The
+values obtained provide information on the setting of fudge factors
+and other clock performance information.
+.It Ic kerninfo
+Obtain and print kernel phase\-lock loop operating parameters.
+This information is available only if the kernel has been specially
+modified for a precision timekeeping function.
+.It Ic loopinfo Op Cm oneline | Cm multiline
+Print the values of selected loop filter variables.
+The loop
+filter is the part of NTP which deals with adjusting the local
+system clock.
+The
+.Sq offset
+is the last offset given to the
+loop filter by the packet processing code.
+The
+.Sq frequency
+is the frequency error of the local clock in parts\-per\-million
+(ppm).
+The
+.Sq time_const
+controls the stiffness of the
+phase\-lock loop and thus the speed at which it can adapt to
+oscillator drift.
+The
+.Sq watchdog timer
+value is the number
+of seconds which have elapsed since the last sample offset was
+given to the loop filter.
+The
+.Cm oneline
+and
+.Cm multiline
+options specify the format in which this
+information is to be printed, with
+.Cm multiline
+as the
+default.
+.It Ic sysinfo
+Print a variety of system state variables, i.e., state related
+to the local server.
+All except the last four lines are described
+in the NTP Version 3 specification, RFC\-1305.
+.Pp
+The
+.Sq system flags
+show various system flags, some of
+which can be set and cleared by the
+.Ic enable
+and
+.Ic disable
+configuration commands, respectively.
+These are
+the
+.Cm auth ,
+.Cm bclient ,
+.Cm monitor ,
+.Cm pll ,
+.Cm pps
+and
+.Cm stats
+flags.
+See the
+.Xr ntpd 1ntpdmdoc
+documentation for the meaning of these flags.
+There
+are two additional flags which are read only, the
+.Cm kernel_pll
+and
+.Cm kernel_pps .
+These flags indicate
+the synchronization status when the precision time kernel
+modifications are in use.
+The
+.Sq kernel_pll
+indicates that
+the local clock is being disciplined by the kernel, while the
+.Sq kernel_pps
+indicates the kernel discipline is provided by the PPS
+signal.
+.Pp
+The
+.Sq stability
+is the residual frequency error remaining
+after the system frequency correction is applied and is intended for
+maintenance and debugging.
+In most architectures, this value will
+initially decrease from as high as 500 ppm to a nominal value in
+the range .01 to 0.1 ppm.
+If it remains high for some time after
+starting the daemon, something may be wrong with the local clock,
+or the value of the kernel variable
+.Va kern.clockrate.tick
+may be
+incorrect.
+.Pp
+The
+.Sq broadcastdelay
+shows the default broadcast delay,
+as set by the
+.Ic broadcastdelay
+configuration command.
+.Pp
+The
+.Sq authdelay
+shows the default authentication delay,
+as set by the
+.Ic authdelay
+configuration command.
+.It Ic sysstats
+Print statistics counters maintained in the protocol
+module.
+.It Ic memstats
+Print statistics counters related to memory allocation
+code.
+.It Ic iostats
+Print statistics counters maintained in the input\-output
+module.
+.It Ic timerstats
+Print statistics counters maintained in the timer/event queue
+support code.
+.It Ic reslist
+Obtain and print the server's restriction list.
+This list is
+(usually) printed in sorted order and may help to understand how
+the restrictions are applied.
+.It Ic monlist Op Ar version
+Obtain and print traffic counts collected and maintained by the
+monitor facility.
+The version number should not normally need to be
+specified.
+.It Ic clkbug Ar clock_peer_address Oo Ar ... Oc
+Obtain debugging information for a reference clock driver.
+This
+information is provided only by some clock drivers and is mostly
+undecodable without a copy of the driver source in hand.
+.El
+.Ss "Runtime Configuration Requests"
+All requests which cause state changes in the server are
+authenticated by the server using a configured NTP key (the
+facility can also be disabled by the server by not configuring a
+key).
+The key number and the corresponding key must also be made
+known to
+.Nm .
+This can be done using the
+.Ic keyid
+and
+.Ic passwd
+commands, the latter of which will prompt at the terminal for a
+password to use as the encryption key.
+You will also be prompted
+automatically for both the key number and password the first time a
+command which would result in an authenticated request to the
+server is given.
+Authentication not only provides verification that
+the requester has permission to make such changes, but also gives
+an extra degree of protection again transmission errors.
+.Pp
+Authenticated requests always include a timestamp in the packet
+data, which is included in the computation of the authentication
+code.
+This timestamp is compared by the server to its receive time
+stamp.
+If they differ by more than a small amount the request is
+rejected.
+This is done for two reasons.
+First, it makes simple
+replay attacks on the server, by someone who might be able to
+overhear traffic on your LAN, much more difficult.
+Second, it makes
+it more difficult to request configuration changes to your server
+from topologically remote hosts.
+While the reconfiguration facility
+will work well with a server on the local host, and may work
+adequately between time\-synchronized hosts on the same LAN, it will
+work very poorly for more distant hosts.
+As such, if reasonable
+passwords are chosen, care is taken in the distribution and
+protection of keys and appropriate source address restrictions are
+applied, the run time reconfiguration facility should provide an
+adequate level of security.
+.Pp
+The following commands all make authenticated requests.
+.Bl -tag -width indent
+.It Xo Ic addpeer Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Add a configured peer association at the given address and
+operating in symmetric active mode.
+Note that an existing
+association with the same peer may be deleted when this command is
+executed, or may simply be converted to conform to the new
+configuration, as appropriate.
+If the optional
+.Ar keyid
+is a
+nonzero integer, all outgoing packets to the remote server will
+have an authentication field attached encrypted with this key.
+If
+the value is 0 (or not given) no authentication will be done.
+The
+.Ar version
+can be 1, 2 or 3 and defaults to 3.
+The
+.Cm prefer
+keyword indicates a preferred peer (and thus will
+be used primarily for clock synchronisation if possible).
+The
+preferred peer also determines the validity of the PPS signal \- if
+the preferred peer is suitable for synchronisation so is the PPS
+signal.
+.It Xo Ic addserver Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Identical to the addpeer command, except that the operating
+mode is client.
+.It Xo Ic broadcast Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Identical to the addpeer command, except that the operating
+mode is broadcast.
+In this case a valid key identifier and key are
+required.
+The
+.Ar peer_address
+parameter can be the broadcast
+address of the local network or a multicast group address assigned
+to NTP.
+If a multicast address, a multicast\-capable kernel is
+required.
+.It Ic unconfig Ar peer_address Oo Ar ... Oc
+This command causes the configured bit to be removed from the
+specified peer(s).
+In many cases this will cause the peer
+association to be deleted.
+When appropriate, however, the
+association may persist in an unconfigured mode if the remote peer
+is willing to continue on in this fashion.
+.It Xo Ic fudge Ar peer_address
+.Op Cm time1
+.Op Cm time2
+.Op Ar stratum
+.Op Ar refid
+.Xc
+This command provides a way to set certain data for a reference
+clock.
+See the source listing for further information.
+.It Xo Ic enable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm monitor | Cm ntp |
+.Cm pps | Cm stats
+.Oc
+.Xc
+.It Xo Ic disable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm monitor | Cm ntp |
+.Cm pps | Cm stats
+.Oc
+.Xc
+These commands operate in the same way as the
+.Ic enable
+and
+.Ic disable
+configuration file commands of
+.Xr ntpd 1ntpdmdoc .
+.Bl -tag -width indent
+.It Cm auth
+Enables the server to synchronize with unconfigured peers only
+if the peer has been correctly authenticated using either public key
+or private key cryptography.
+The default for this flag is enable.
+.It Cm bclient
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the multicastclient command with
+default address.
+The default for this flag is disable.
+.It Cm calibrate
+Enables the calibrate feature for reference clocks.
+The default for this flag is disable.
+.It Cm kernel
+Enables the kernel time discipline, if available.
+The default for this flag is enable if support is available, otherwise disable.
+.It Cm monitor
+Enables the monitoring facility.
+See the documentation here about the
+.Cm monlist
+command or further information.
+The default for this flag is enable.
+.It Cm ntp
+Enables time and frequency discipline.
+In effect, this switch opens and closes the feedback loop,
+which is useful for testing.
+The default for this flag is enable.
+.It Cm pps
+Enables the pulse\-per\-second (PPS) signal when frequency
+and time is disciplined by the precision time kernel modifications.
+See the
+.Qq A Kernel Model for Precision Timekeeping
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+page for further information.
+The default for this flag is disable.
+.It Cm stats
+Enables the statistics facility.
+See the
+.Sx Monitoring Options
+section of
+.Xr ntp.conf 5
+for further information.
+The default for this flag is disable.
+.El
+.It Xo Ic restrict Ar address Ar mask
+.Ar flag Oo Ar ... Oc
+.Xc
+This command operates in the same way as the
+.Ic restrict
+configuration file commands of
+.Xr ntpd 1ntpdmdoc .
+.It Xo Ic unrestrict Ar address Ar mask
+.Ar flag Oo Ar ... Oc
+.Xc
+Unrestrict the matching entry from the restrict list.
+.It Xo Ic delrestrict Ar address Ar mask
+.Op Cm ntpport
+.Xc
+Delete the matching entry from the restrict list.
+.It Ic readkeys
+Causes the current set of authentication keys to be purged and
+a new set to be obtained by rereading the keys file (which must
+have been specified in the
+.Xr ntpd 1ntpdmdoc
+configuration file).
+This
+allows encryption keys to be changed without restarting the
+server.
+.It Ic trustedkey Ar keyid Oo Ar ... Oc
+.It Ic untrustedkey Ar keyid Oo Ar ... Oc
+These commands operate in the same way as the
+.Ic trustedkey
+and
+.Ic untrustedkey
+configuration file
+commands of
+.Xr ntpd 1ntpdmdoc .
+.It Ic authinfo
+Returns information concerning the authentication module,
+including known keys and counts of encryptions and decryptions
+which have been done.
+.It Ic traps
+Display the traps set in the server.
+See the source listing for
+further information.
+.It Xo Ic addtrap Ar address
+.Op Ar port
+.Op Ar interface
+.Xc
+Set a trap for asynchronous messages.
+See the source listing
+for further information.
+.It Xo Ic clrtrap Ar address
+.Op Ar port
+.Op Ar interface
+.Xc
+Clear a trap for asynchronous messages.
+See the source listing
+for further information.
+.It Ic reset
+Clear the statistics counters in various modules of the server.
+See the source listing for further information.
+.El
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntp.conf 5 ,
+.Xr ntpd 1ntpdmdoc
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 3)
+.%O RFC1305
+.Re
+.Sh AUTHORS
+The formatting directives in this document came from FreeBSD.
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+The
+.Nm
+utility is a crude hack.
+Much of the information it shows is
+deadly boring and could only be loved by its implementer.
+The
+program was designed so that new (and temporary) features were easy
+to hack in, at great expense to the program's ease of use.
+Despite
+this, the program is occasionally useful.
+.Pp
+Please report bugs to http://bugs.ntp.org .
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpdc\fP
+option definitions.
diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c
new file mode 100644
index 0000000..3595184
--- /dev/null
+++ b/ntpdc/ntpdc.c
@@ -0,0 +1,1934 @@
+/*
+ * ntpdc - control and monitor your ntpd daemon
+ */
+#include <config.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <signal.h>
+#include <setjmp.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#ifdef SYS_WINNT
+# include <mswsock.h>
+#endif
+#include <isc/net.h>
+#include <isc/result.h>
+
+#include "ntpdc.h"
+#include "ntp_select.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+#include "ntp_lineedit.h"
+#ifdef OPENSSL
+#include "openssl/evp.h"
+#include "openssl/objects.h"
+#endif
+#include <ssl_applink.c>
+
+#include "ntp_libopts.h"
+#include "ntpdc-opts.h"
+
+#ifdef SYS_VXWORKS
+ /* vxWorks needs mode flag -casey*/
+# define open(name, flags) open(name, flags, 0777)
+# define SERVER_PORT_NUM 123
+#endif
+
+/* We use COMMAND as an autogen keyword */
+#ifdef COMMAND
+# undef COMMAND
+#endif
+
+/*
+ * Because we now potentially understand a lot of commands (and
+ * it requires a lot of commands to talk to ntpd) we will run
+ * interactive if connected to a terminal.
+ */
+static int interactive = 0; /* set to 1 when we should prompt */
+static const char * prompt = "ntpdc> "; /* prompt to ask him about */
+
+/*
+ * Keyid used for authenticated requests. Obtained on the fly.
+ */
+static u_long info_auth_keyid;
+static int keyid_entered = 0;
+
+static int info_auth_keytype = NID_md5; /* MD5 */
+static size_t info_auth_hashlen = 16; /* MD5 */
+u_long current_time; /* needed by authkeys; not used */
+
+/*
+ * for get_systime()
+ */
+s_char sys_precision; /* local clock precision (log2 s) */
+
+int ntpdcmain (int, char **);
+/*
+ * Built in command handler declarations
+ */
+static int openhost (const char *);
+static int sendpkt (void *, size_t);
+static void growpktdata (void);
+static int getresponse (int, int, int *, int *, char **, int);
+static int sendrequest (int, int, int, u_int, size_t, char *);
+static void getcmds (void);
+static RETSIGTYPE abortcmd (int);
+static void docmd (const char *);
+static void tokenize (const char *, char **, int *);
+static int findcmd (char *, struct xcmd *, struct xcmd *, struct xcmd **);
+static int getarg (char *, int, arg_v *);
+static int getnetnum (const char *, sockaddr_u *, char *, int);
+static void help (struct parse *, FILE *);
+static int helpsort (const void *, const void *);
+static void printusage (struct xcmd *, FILE *);
+static void timeout (struct parse *, FILE *);
+static void my_delay (struct parse *, FILE *);
+static void host (struct parse *, FILE *);
+static void keyid (struct parse *, FILE *);
+static void keytype (struct parse *, FILE *);
+static void passwd (struct parse *, FILE *);
+static void hostnames (struct parse *, FILE *);
+static void setdebug (struct parse *, FILE *);
+static void quit (struct parse *, FILE *);
+static void version (struct parse *, FILE *);
+static void warning (const char *, const char *, const char *);
+static void error (const char *, const char *, const char *);
+static u_long getkeyid (const char *);
+
+
+
+/*
+ * Built-in commands we understand
+ */
+static struct xcmd builtins[] = {
+ { "?", help, { OPT|NTP_STR, NO, NO, NO },
+ { "command", "", "", "" },
+ "tell the use and syntax of commands" },
+ { "help", help, { OPT|NTP_STR, NO, NO, NO },
+ { "command", "", "", "" },
+ "tell the use and syntax of commands" },
+ { "timeout", timeout, { OPT|NTP_UINT, NO, NO, NO },
+ { "msec", "", "", "" },
+ "set the primary receive time out" },
+ { "delay", my_delay, { OPT|NTP_INT, NO, NO, NO },
+ { "msec", "", "", "" },
+ "set the delay added to encryption time stamps" },
+ { "host", host, { OPT|NTP_STR, OPT|NTP_STR, NO, NO },
+ { "-4|-6", "hostname", "", "" },
+ "specify the host whose NTP server we talk to" },
+ { "passwd", passwd, { OPT|NTP_STR, NO, NO, NO },
+ { "", "", "", "" },
+ "specify a password to use for authenticated requests"},
+ { "hostnames", hostnames, { OPT|NTP_STR, NO, NO, NO },
+ { "yes|no", "", "", "" },
+ "specify whether hostnames or net numbers are printed"},
+ { "debug", setdebug, { OPT|NTP_STR, NO, NO, NO },
+ { "no|more|less", "", "", "" },
+ "set/change debugging level" },
+ { "quit", quit, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "exit ntpdc" },
+ { "exit", quit, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "exit ntpdc" },
+ { "keyid", keyid, { OPT|NTP_UINT, NO, NO, NO },
+ { "key#", "", "", "" },
+ "set/show keyid to use for authenticated requests" },
+ { "keytype", keytype, { OPT|NTP_STR, NO, NO, NO },
+ { "(md5|des)", "", "", "" },
+ "set/show key authentication type for authenticated requests (des|md5)" },
+ { "version", version, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "print version number" },
+ { 0, 0, { NO, NO, NO, NO },
+ { "", "", "", "" }, "" }
+};
+
+
+/*
+ * Default values we use.
+ */
+#define DEFHOST "localhost" /* default host name */
+#define DEFTIMEOUT (5) /* 5 second time out */
+#define DEFSTIMEOUT (2) /* 2 second time out after first */
+#define DEFDELAY 0x51EB852 /* 20 milliseconds, l_fp fraction */
+#define LENHOSTNAME 256 /* host name is 256 characters long */
+#define MAXCMDS 100 /* maximum commands on cmd line */
+#define MAXHOSTS 200 /* maximum hosts on cmd line */
+#define MAXLINE 512 /* maximum line length */
+#define MAXTOKENS (1+1+MAXARGS+MOREARGS+2) /* maximum number of usable tokens */
+#define SCREENWIDTH 78 /* nominal screen width in columns */
+
+/*
+ * Some variables used and manipulated locally
+ */
+static struct sock_timeval tvout = { DEFTIMEOUT, 0 }; /* time out for reads */
+static struct sock_timeval tvsout = { DEFSTIMEOUT, 0 };/* secondary time out */
+static l_fp delay_time; /* delay time */
+static char currenthost[LENHOSTNAME]; /* current host name */
+int showhostnames = 1; /* show host names by default */
+
+static int ai_fam_templ; /* address family */
+static int ai_fam_default; /* default address family */
+static SOCKET sockfd; /* fd socket is opened on */
+static int havehost = 0; /* set to 1 when host open */
+int s_port = 0;
+
+/*
+ * Holds data returned from queries. We allocate INITDATASIZE
+ * octets to begin with, increasing this as we need to.
+ */
+#define INITDATASIZE (sizeof(struct resp_pkt) * 16)
+#define INCDATASIZE (sizeof(struct resp_pkt) * 8)
+
+static char *pktdata;
+static int pktdatasize;
+
+/*
+ * These are used to help the magic with old and new versions of ntpd.
+ */
+int impl_ver = IMPL_XNTPD;
+static int req_pkt_size = REQ_LEN_NOMAC;
+
+/*
+ * For commands typed on the command line (with the -c option)
+ */
+static int numcmds = 0;
+static const char *ccmds[MAXCMDS];
+#define ADDCMD(cp) if (numcmds < MAXCMDS) ccmds[numcmds++] = (cp)
+
+/*
+ * When multiple hosts are specified.
+ */
+static int numhosts = 0;
+static const char *chosts[MAXHOSTS];
+#define ADDHOST(cp) if (numhosts < MAXHOSTS) chosts[numhosts++] = (cp)
+
+/*
+ * Error codes for internal use
+ */
+#define ERR_INCOMPLETE 16
+#define ERR_TIMEOUT 17
+
+/*
+ * Macro definitions we use
+ */
+#define ISSPACE(c) ((c) == ' ' || (c) == '\t')
+#define ISEOL(c) ((c) == '\n' || (c) == '\r' || (c) == '\0')
+#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
+
+/*
+ * Jump buffer for longjumping back to the command level
+ */
+static jmp_buf interrupt_buf;
+static volatile int jump = 0;
+
+/*
+ * Pointer to current output unit
+ */
+static FILE *current_output;
+
+/*
+ * Command table imported from ntpdc_ops.c
+ */
+extern struct xcmd opcmds[];
+
+char *progname;
+
+#ifdef NO_MAIN_ALLOWED
+CALL(ntpdc,"ntpdc",ntpdcmain);
+#else
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ return ntpdcmain(argc, argv);
+}
+#endif
+
+#ifdef SYS_VXWORKS
+void clear_globals(void)
+{
+ showhostnames = 0; /* show host names by default */
+ havehost = 0; /* set to 1 when host open */
+ numcmds = 0;
+ numhosts = 0;
+}
+#endif
+
+/*
+ * main - parse arguments and handle options
+ */
+int
+ntpdcmain(
+ int argc,
+ char *argv[]
+ )
+{
+
+ delay_time.l_ui = 0;
+ delay_time.l_uf = DEFDELAY;
+
+#ifdef SYS_VXWORKS
+ clear_globals();
+ taskPrioritySet(taskIdSelf(), 100 );
+#endif
+
+ init_lib(); /* sets up ipv4_works, ipv6_works */
+ ssl_applink();
+ init_auth();
+
+ /* Check to see if we have IPv6. Otherwise default to IPv4 */
+ if (!ipv6_works)
+ ai_fam_default = AF_INET;
+
+ progname = argv[0];
+
+ {
+ int optct = ntpOptionProcess(&ntpdcOptions, argc, argv);
+ argc -= optct;
+ argv += optct;
+ }
+
+ if (HAVE_OPT(IPV4))
+ ai_fam_templ = AF_INET;
+ else if (HAVE_OPT(IPV6))
+ ai_fam_templ = AF_INET6;
+ else
+ ai_fam_templ = ai_fam_default;
+
+ if (HAVE_OPT(COMMAND)) {
+ int cmdct = STACKCT_OPT( COMMAND );
+ const char** cmds = STACKLST_OPT( COMMAND );
+
+ while (cmdct-- > 0) {
+ ADDCMD(*cmds++);
+ }
+ }
+
+ debug = OPT_VALUE_SET_DEBUG_LEVEL;
+
+ if (HAVE_OPT(INTERACTIVE)) {
+ interactive = 1;
+ }
+
+ if (HAVE_OPT(NUMERIC)) {
+ showhostnames = 0;
+ }
+
+ if (HAVE_OPT(LISTPEERS)) {
+ ADDCMD("listpeers");
+ }
+
+ if (HAVE_OPT(PEERS)) {
+ ADDCMD("peers");
+ }
+
+ if (HAVE_OPT(SHOWPEERS)) {
+ ADDCMD("dmpeers");
+ }
+
+ if (ntp_optind == argc) {
+ ADDHOST(DEFHOST);
+ } else {
+ for (; ntp_optind < argc; ntp_optind++)
+ ADDHOST(argv[ntp_optind]);
+ }
+
+ if (numcmds == 0 && interactive == 0
+ && isatty(fileno(stdin)) && isatty(fileno(stderr))) {
+ interactive = 1;
+ }
+
+#ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */
+ if (interactive)
+ (void) signal_no_reset(SIGINT, abortcmd);
+#endif /* SYS_WINNT */
+
+ /*
+ * Initialize the packet data buffer
+ */
+ pktdatasize = INITDATASIZE;
+ pktdata = emalloc(INITDATASIZE);
+
+ if (numcmds == 0) {
+ (void) openhost(chosts[0]);
+ getcmds();
+ } else {
+ int ihost;
+ int icmd;
+
+ for (ihost = 0; ihost < numhosts; ihost++) {
+ if (openhost(chosts[ihost]))
+ for (icmd = 0; icmd < numcmds; icmd++) {
+ if (numhosts > 1)
+ printf ("--- %s ---\n",chosts[ihost]);
+ docmd(ccmds[icmd]);
+ }
+ }
+ }
+#ifdef SYS_WINNT
+ WSACleanup();
+#endif
+ return(0);
+} /* main end */
+
+
+/*
+ * openhost - open a socket to a host
+ */
+static int
+openhost(
+ const char *hname
+ )
+{
+ char temphost[LENHOSTNAME];
+ int a_info, i;
+ struct addrinfo hints, *ai = NULL;
+ sockaddr_u addr;
+ size_t octets;
+ register const char *cp;
+ char name[LENHOSTNAME];
+ char service[5];
+
+ /*
+ * We need to get by the [] if they were entered
+ */
+
+ cp = hname;
+
+ if (*cp == '[') {
+ cp++;
+ for (i = 0; *cp && *cp != ']'; cp++, i++)
+ name[i] = *cp;
+ if (*cp == ']') {
+ name[i] = '\0';
+ hname = name;
+ } else {
+ return 0;
+ }
+ }
+
+ /*
+ * First try to resolve it as an ip address and if that fails,
+ * do a fullblown (dns) lookup. That way we only use the dns
+ * when it is needed and work around some implementations that
+ * will return an "IPv4-mapped IPv6 address" address if you
+ * give it an IPv4 address to lookup.
+ */
+ strlcpy(service, "ntp", sizeof(service));
+ ZERO(hints);
+ hints.ai_family = ai_fam_templ;
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = Z_AI_NUMERICHOST;
+
+ a_info = getaddrinfo(hname, service, &hints, &ai);
+ if (a_info == EAI_NONAME
+#ifdef EAI_NODATA
+ || a_info == EAI_NODATA
+#endif
+ ) {
+ hints.ai_flags = AI_CANONNAME;
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+ a_info = getaddrinfo(hname, service, &hints, &ai);
+ }
+ /* Some older implementations don't like AI_ADDRCONFIG. */
+ if (a_info == EAI_BADFLAGS) {
+ hints.ai_flags = AI_CANONNAME;
+ a_info = getaddrinfo(hname, service, &hints, &ai);
+ }
+ if (a_info != 0) {
+ fprintf(stderr, "%s\n", gai_strerror(a_info));
+ if (ai != NULL)
+ freeaddrinfo(ai);
+ return 0;
+ }
+
+ /*
+ * getaddrinfo() has returned without error so ai should not
+ * be NULL.
+ */
+ INSIST(ai != NULL);
+ ZERO(addr);
+ octets = min(sizeof(addr), ai->ai_addrlen);
+ memcpy(&addr, ai->ai_addr, octets);
+
+ if (ai->ai_canonname == NULL)
+ strlcpy(temphost, stoa(&addr), sizeof(temphost));
+ else
+ strlcpy(temphost, ai->ai_canonname, sizeof(temphost));
+
+ if (debug > 2)
+ printf("Opening host %s\n", temphost);
+
+ if (havehost == 1) {
+ if (debug > 2)
+ printf("Closing old host %s\n", currenthost);
+ closesocket(sockfd);
+ havehost = 0;
+ }
+ strlcpy(currenthost, temphost, sizeof(currenthost));
+
+ /* port maps to the same in both families */
+ s_port = NSRCPORT(&addr);;
+#ifdef SYS_VXWORKS
+ ((struct sockaddr_in6 *)&hostaddr)->sin6_port = htons(SERVER_PORT_NUM);
+ if (ai->ai_family == AF_INET)
+ *(struct sockaddr_in *)&hostaddr=
+ *((struct sockaddr_in *)ai->ai_addr);
+ else
+ *(struct sockaddr_in6 *)&hostaddr=
+ *((struct sockaddr_in6 *)ai->ai_addr);
+#endif /* SYS_VXWORKS */
+
+#ifdef SYS_WINNT
+ {
+ int optionValue = SO_SYNCHRONOUS_NONALERT;
+ int err;
+
+ err = setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&optionValue, sizeof(optionValue));
+ if (err != NO_ERROR) {
+ (void) fprintf(stderr, "cannot open nonoverlapped sockets\n");
+ exit(1);
+ }
+ }
+#endif /* SYS_WINNT */
+
+ sockfd = socket(ai->ai_family, SOCK_DGRAM, 0);
+ if (sockfd == INVALID_SOCKET) {
+ error("socket", "", "");
+ exit(-1);
+ }
+
+#ifdef NEED_RCVBUF_SLOP
+# ifdef SO_RCVBUF
+ {
+ int rbufsize = INITDATASIZE + 2048; /* 2K for slop */
+
+ if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
+ &rbufsize, sizeof(int)) == -1)
+ error("setsockopt", "", "");
+ }
+# endif
+#endif
+
+#ifdef SYS_VXWORKS
+ if (connect(sockfd, (struct sockaddr *)&hostaddr,
+ sizeof(hostaddr)) == -1) {
+#else
+ if (connect(sockfd, ai->ai_addr, ai->ai_addrlen) == -1) {
+#endif /* SYS_VXWORKS */
+ error("connect", "", "");
+ exit(-1);
+ }
+
+ freeaddrinfo(ai);
+ havehost = 1;
+ req_pkt_size = REQ_LEN_NOMAC;
+ impl_ver = IMPL_XNTPD;
+ return 1;
+}
+
+
+/* XXX ELIMINATE sendpkt similar in ntpq.c, ntpdc.c, ntp_io.c, ntptrace.c */
+/*
+ * sendpkt - send a packet to the remote host
+ */
+static int
+sendpkt(
+ void * xdata,
+ size_t xdatalen
+ )
+{
+ if (send(sockfd, xdata, xdatalen, 0) == -1) {
+ warning("write to %s failed", currenthost, "");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/*
+ * growpktdata - grow the packet data area
+ */
+static void
+growpktdata(void)
+{
+ size_t priorsz;
+
+ priorsz = (size_t)pktdatasize;
+ pktdatasize += INCDATASIZE;
+ pktdata = erealloc_zero(pktdata, (size_t)pktdatasize, priorsz);
+}
+
+
+/*
+ * getresponse - get a (series of) response packet(s) and return the data
+ */
+static int
+getresponse(
+ int implcode,
+ int reqcode,
+ int *ritems,
+ int *rsize,
+ char **rdata,
+ int esize
+ )
+{
+ struct resp_pkt rpkt;
+ struct sock_timeval tvo;
+ int items;
+ int i;
+ int size;
+ int datasize;
+ char *datap;
+ char *tmp_data;
+ char haveseq[MAXSEQ+1];
+ int firstpkt;
+ int lastseq;
+ int numrecv;
+ int seq;
+ fd_set fds;
+ int n;
+ int pad;
+
+ /*
+ * This is pretty tricky. We may get between 1 and many packets
+ * back in response to the request. We peel the data out of
+ * each packet and collect it in one long block. When the last
+ * packet in the sequence is received we'll know how many we
+ * should have had. Note we use one long time out, should reconsider.
+ */
+ *ritems = 0;
+ *rsize = 0;
+ firstpkt = 1;
+ numrecv = 0;
+ *rdata = datap = pktdata;
+ lastseq = 999; /* too big to be a sequence number */
+ ZERO(haveseq);
+ FD_ZERO(&fds);
+
+ again:
+ if (firstpkt)
+ tvo = tvout;
+ else
+ tvo = tvsout;
+
+ FD_SET(sockfd, &fds);
+ n = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvo);
+
+ if (n == -1) {
+ warning("select fails", "", "");
+ return -1;
+ }
+ if (n == 0) {
+ /*
+ * Timed out. Return what we have
+ */
+ if (firstpkt) {
+ (void) fprintf(stderr,
+ "%s: timed out, nothing received\n", currenthost);
+ return ERR_TIMEOUT;
+ } else {
+ (void) fprintf(stderr,
+ "%s: timed out with incomplete data\n",
+ currenthost);
+ if (debug) {
+ printf("Received sequence numbers");
+ for (n = 0; n <= MAXSEQ; n++)
+ if (haveseq[n])
+ printf(" %d,", n);
+ if (lastseq != 999)
+ printf(" last frame received\n");
+ else
+ printf(" last frame not received\n");
+ }
+ return ERR_INCOMPLETE;
+ }
+ }
+
+ n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0);
+ if (n == -1) {
+ warning("read", "", "");
+ return -1;
+ }
+
+
+ /*
+ * Check for format errors. Bug proofing.
+ */
+ if (n < RESP_HEADER_SIZE) {
+ if (debug)
+ printf("Short (%d byte) packet received\n", n);
+ goto again;
+ }
+ if (INFO_VERSION(rpkt.rm_vn_mode) > NTP_VERSION ||
+ INFO_VERSION(rpkt.rm_vn_mode) < NTP_OLDVERSION) {
+ if (debug)
+ printf("Packet received with version %d\n",
+ INFO_VERSION(rpkt.rm_vn_mode));
+ goto again;
+ }
+ if (INFO_MODE(rpkt.rm_vn_mode) != MODE_PRIVATE) {
+ if (debug)
+ printf("Packet received with mode %d\n",
+ INFO_MODE(rpkt.rm_vn_mode));
+ goto again;
+ }
+ if (INFO_IS_AUTH(rpkt.auth_seq)) {
+ if (debug)
+ printf("Encrypted packet received\n");
+ goto again;
+ }
+ if (!ISRESPONSE(rpkt.rm_vn_mode)) {
+ if (debug)
+ printf("Received request packet, wanted response\n");
+ goto again;
+ }
+ if (INFO_MBZ(rpkt.mbz_itemsize) != 0) {
+ if (debug)
+ printf("Received packet with nonzero MBZ field!\n");
+ goto again;
+ }
+
+ /*
+ * Check implementation/request. Could be old data getting to us.
+ */
+ if (rpkt.implementation != implcode || rpkt.request != reqcode) {
+ if (debug)
+ printf(
+ "Received implementation/request of %d/%d, wanted %d/%d",
+ rpkt.implementation, rpkt.request,
+ implcode, reqcode);
+ goto again;
+ }
+
+ /*
+ * Check the error code. If non-zero, return it.
+ */
+ if (INFO_ERR(rpkt.err_nitems) != INFO_OKAY) {
+ if (debug && ISMORE(rpkt.rm_vn_mode)) {
+ printf("Error code %d received on not-final packet\n",
+ INFO_ERR(rpkt.err_nitems));
+ }
+ return (int)INFO_ERR(rpkt.err_nitems);
+ }
+
+ /*
+ * Collect items and size. Make sure they make sense.
+ */
+ items = INFO_NITEMS(rpkt.err_nitems);
+ size = INFO_ITEMSIZE(rpkt.mbz_itemsize);
+ if (esize > size)
+ pad = esize - size;
+ else
+ pad = 0;
+ datasize = items * size;
+ if ((size_t)datasize > (n-RESP_HEADER_SIZE)) {
+ if (debug)
+ printf(
+ "Received items %d, size %d (total %d), data in packet is %lu\n",
+ items, size, datasize, (u_long)(n-RESP_HEADER_SIZE));
+ goto again;
+ }
+
+ /*
+ * If this isn't our first packet, make sure the size matches
+ * the other ones.
+ */
+ if (!firstpkt && size != *rsize) {
+ if (debug)
+ printf("Received itemsize %d, previous %d\n",
+ size, *rsize);
+ goto again;
+ }
+ /*
+ * If we've received this before, +toss it
+ */
+ seq = INFO_SEQ(rpkt.auth_seq);
+ if (haveseq[seq]) {
+ if (debug)
+ printf("Received duplicate sequence number %d\n", seq);
+ goto again;
+ }
+ haveseq[seq] = 1;
+
+ /*
+ * If this is the last in the sequence, record that.
+ */
+ if (!ISMORE(rpkt.rm_vn_mode)) {
+ if (lastseq != 999) {
+ printf("Received second end sequence packet\n");
+ goto again;
+ }
+ lastseq = seq;
+ }
+
+ /*
+ * So far, so good. Copy this data into the output array.
+ */
+ if ((datap + datasize + (pad * items)) > (pktdata + pktdatasize)) {
+ int offset = datap - pktdata;
+ growpktdata();
+ *rdata = pktdata; /* might have been realloced ! */
+ datap = pktdata + offset;
+ }
+ /*
+ * We now move the pointer along according to size and number of
+ * items. This is so we can play nice with older implementations
+ */
+
+ tmp_data = rpkt.u.data;
+ for (i = 0; i < items; i++) {
+ memcpy(datap, tmp_data, (unsigned)size);
+ tmp_data += size;
+ zero_mem(datap + size, pad);
+ datap += size + pad;
+ }
+
+ if (firstpkt) {
+ firstpkt = 0;
+ *rsize = size + pad;
+ }
+ *ritems += items;
+
+ /*
+ * Finally, check the count of received packets. If we've got them
+ * all, return
+ */
+ ++numrecv;
+ if (numrecv <= lastseq)
+ goto again;
+ return INFO_OKAY;
+}
+
+
+/*
+ * sendrequest - format and send a request packet
+ *
+ * Historically, ntpdc has used a fixed-size request packet regardless
+ * of the actual payload size. When authenticating, the timestamp, key
+ * ID, and digest have been placed just before the end of the packet.
+ * With the introduction in late 2009 of support for authenticated
+ * ntpdc requests using larger 20-octet digests (vs. 16 for MD5), we
+ * come up four bytes short.
+ *
+ * To maintain interop while allowing for larger digests, the behavior
+ * is unchanged when using 16-octet digests. For larger digests, the
+ * timestamp, key ID, and digest are placed immediately following the
+ * request payload, with the overall packet size variable. ntpd can
+ * distinguish 16-octet digests by the overall request size being
+ * REQ_LEN_NOMAC + 4 + 16 with the auth bit enabled. When using a
+ * longer digest, that request size should be avoided.
+ *
+ * With the form used with 20-octet and larger digests, the timestamp,
+ * key ID, and digest are located by ntpd relative to the start of the
+ * packet, and the size of the digest is then implied by the packet
+ * size.
+ */
+static int
+sendrequest(
+ int implcode,
+ int reqcode,
+ int auth,
+ u_int qitems,
+ size_t qsize,
+ char *qdata
+ )
+{
+ struct req_pkt qpkt;
+ size_t datasize;
+ size_t reqsize;
+ u_long key_id;
+ l_fp ts;
+ l_fp * ptstamp;
+ int maclen;
+ char * pass;
+
+ ZERO(qpkt);
+ qpkt.rm_vn_mode = RM_VN_MODE(0, 0, 0);
+ qpkt.implementation = (u_char)implcode;
+ qpkt.request = (u_char)reqcode;
+
+ datasize = qitems * qsize;
+ if (datasize && qdata != NULL) {
+ memcpy(qpkt.u.data, qdata, datasize);
+ qpkt.err_nitems = ERR_NITEMS(0, qitems);
+ qpkt.mbz_itemsize = MBZ_ITEMSIZE(qsize);
+ } else {
+ qpkt.err_nitems = ERR_NITEMS(0, 0);
+ qpkt.mbz_itemsize = MBZ_ITEMSIZE(qsize); /* allow for optional first item */
+ }
+
+ if (!auth || (keyid_entered && info_auth_keyid == 0)) {
+ qpkt.auth_seq = AUTH_SEQ(0, 0);
+ return sendpkt(&qpkt, req_pkt_size);
+ }
+
+ if (info_auth_keyid == 0) {
+ key_id = getkeyid("Keyid: ");
+ if (!key_id) {
+ fprintf(stderr, "Invalid key identifier\n");
+ return 1;
+ }
+ info_auth_keyid = key_id;
+ }
+ if (!authistrusted(info_auth_keyid)) {
+ pass = getpass_keytype(info_auth_keytype);
+ if ('\0' == pass[0]) {
+ fprintf(stderr, "Invalid password\n");
+ return 1;
+ }
+ authusekey(info_auth_keyid, info_auth_keytype,
+ (u_char *)pass);
+ authtrust(info_auth_keyid, 1);
+ }
+ qpkt.auth_seq = AUTH_SEQ(1, 0);
+ if (info_auth_hashlen > 16) {
+ /*
+ * Only ntpd which expects REQ_LEN_NOMAC plus maclen
+ * octets in an authenticated request using a 16 octet
+ * digest (that is, a newer ntpd) will handle digests
+ * larger than 16 octets, so for longer digests, do
+ * not attempt to shorten the requests for downlevel
+ * ntpd compatibility.
+ */
+ if (REQ_LEN_NOMAC != req_pkt_size)
+ return 1;
+ reqsize = REQ_LEN_HDR + datasize + sizeof(*ptstamp);
+ /* align to 32 bits */
+ reqsize = (reqsize + 3) & ~3;
+ } else
+ reqsize = req_pkt_size;
+ ptstamp = (void *)((char *)&qpkt + reqsize);
+ ptstamp--;
+ get_systime(&ts);
+ L_ADD(&ts, &delay_time);
+ HTONL_FP(&ts, ptstamp);
+ maclen = authencrypt(info_auth_keyid, (void *)&qpkt, reqsize);
+ if (!maclen) {
+ fprintf(stderr, "Key not found\n");
+ return 1;
+ } else if (maclen != (info_auth_hashlen + sizeof(keyid_t))) {
+ fprintf(stderr,
+ "%d octet MAC, %lu expected with %lu octet digest\n",
+ maclen, (u_long)(info_auth_hashlen + sizeof(keyid_t)),
+ (u_long)info_auth_hashlen);
+ return 1;
+ }
+ return sendpkt(&qpkt, reqsize + maclen);
+}
+
+
+/*
+ * doquery - send a request and process the response
+ */
+int
+doquery(
+ int implcode,
+ int reqcode,
+ int auth,
+ int qitems,
+ int qsize,
+ char *qdata,
+ int *ritems,
+ int *rsize,
+ char **rdata,
+ int quiet_mask,
+ int esize
+ )
+{
+ int res;
+ char junk[512];
+ fd_set fds;
+ struct sock_timeval tvzero;
+
+ /*
+ * Check to make sure host is open
+ */
+ if (!havehost) {
+ (void) fprintf(stderr, "***No host open, use `host' command\n");
+ return -1;
+ }
+
+ /*
+ * Poll the socket and clear out any pending data
+ */
+again:
+ do {
+ tvzero.tv_sec = tvzero.tv_usec = 0;
+ FD_ZERO(&fds);
+ FD_SET(sockfd, &fds);
+ res = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvzero);
+
+ if (res == -1) {
+ warning("polling select", "", "");
+ return -1;
+ } else if (res > 0)
+
+ (void) recv(sockfd, junk, sizeof junk, 0);
+ } while (res > 0);
+
+
+ /*
+ * send a request
+ */
+ res = sendrequest(implcode, reqcode, auth, qitems, qsize, qdata);
+ if (res != 0)
+ return res;
+
+ /*
+ * Get the response. If we got a standard error, print a message
+ */
+ res = getresponse(implcode, reqcode, ritems, rsize, rdata, esize);
+
+ /*
+ * Try to be compatible with older implementations of ntpd.
+ */
+ if (res == INFO_ERR_FMT && req_pkt_size != 48) {
+ int oldsize;
+
+ oldsize = req_pkt_size;
+
+ switch(req_pkt_size) {
+ case REQ_LEN_NOMAC:
+ req_pkt_size = 160;
+ break;
+ case 160:
+ req_pkt_size = 48;
+ break;
+ }
+ if (impl_ver == IMPL_XNTPD) {
+ fprintf(stderr,
+ "***Warning changing to older implementation\n");
+ return INFO_ERR_IMPL;
+ }
+
+ fprintf(stderr,
+ "***Warning changing the request packet size from %d to %d\n",
+ oldsize, req_pkt_size);
+ goto again;
+ }
+
+ /* log error message if not told to be quiet */
+ if ((res > 0) && (((1 << res) & quiet_mask) == 0)) {
+ switch(res) {
+ case INFO_ERR_IMPL:
+ /* Give us a chance to try the older implementation. */
+ if (implcode == IMPL_XNTPD)
+ break;
+ (void) fprintf(stderr,
+ "***Server implementation incompatible with our own\n");
+ break;
+ case INFO_ERR_REQ:
+ (void) fprintf(stderr,
+ "***Server doesn't implement this request\n");
+ break;
+ case INFO_ERR_FMT:
+ (void) fprintf(stderr,
+ "***Server reports a format error in the received packet (shouldn't happen)\n");
+ break;
+ case INFO_ERR_NODATA:
+ (void) fprintf(stderr,
+ "***Server reports data not found\n");
+ break;
+ case INFO_ERR_AUTH:
+ (void) fprintf(stderr, "***Permission denied\n");
+ break;
+ case ERR_TIMEOUT:
+ (void) fprintf(stderr, "***Request timed out\n");
+ break;
+ case ERR_INCOMPLETE:
+ (void) fprintf(stderr,
+ "***Response from server was incomplete\n");
+ break;
+ default:
+ (void) fprintf(stderr,
+ "***Server returns unknown error code %d\n", res);
+ break;
+ }
+ }
+ return res;
+}
+
+
+/*
+ * getcmds - read commands from the standard input and execute them
+ */
+static void
+getcmds(void)
+{
+ char * line;
+ int count;
+
+ ntp_readline_init(interactive ? prompt : NULL);
+
+ for (;;) {
+ line = ntp_readline(&count);
+ if (NULL == line)
+ break;
+ docmd(line);
+ free(line);
+ }
+
+ ntp_readline_uninit();
+}
+
+
+#ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */
+/*
+ * abortcmd - catch interrupts and abort the current command
+ */
+static RETSIGTYPE
+abortcmd(
+ int sig
+ )
+{
+
+ if (current_output == stdout)
+ (void) fflush(stdout);
+ putc('\n', stderr);
+ (void) fflush(stderr);
+ if (jump) longjmp(interrupt_buf, 1);
+}
+#endif /* SYS_WINNT */
+
+/*
+ * docmd - decode the command line and execute a command
+ */
+static void
+docmd(
+ const char *cmdline
+ )
+{
+ char *tokens[1+MAXARGS+MOREARGS+2];
+ struct parse pcmd;
+ int ntok;
+ int i, ti;
+ int rval;
+ struct xcmd *xcmd;
+
+ ai_fam_templ = ai_fam_default;
+ /*
+ * Tokenize the command line. If nothing on it, return.
+ */
+ if (strlen(cmdline) >= MAXLINE) {
+ fprintf(stderr, "***Command ignored, more than %d characters:\n%s\n",
+ MAXLINE - 1, cmdline);
+ return;
+ }
+ tokenize(cmdline, tokens, &ntok);
+ if (ntok == 0)
+ return;
+
+ /*
+ * Find the appropriate command description.
+ */
+ i = findcmd(tokens[0], builtins, opcmds, &xcmd);
+ if (i == 0) {
+ (void) fprintf(stderr, "***Command `%s' unknown\n",
+ tokens[0]);
+ return;
+ } else if (i >= 2) {
+ (void) fprintf(stderr, "***Command `%s' ambiguous\n",
+ tokens[0]);
+ return;
+ }
+
+ /*
+ * Save the keyword, then walk through the arguments, interpreting
+ * as we go.
+ */
+ pcmd.keyword = tokens[0];
+ pcmd.nargs = 0;
+ ti = 1;
+ for (i = 0; i < MAXARGS && xcmd->arg[i] != NO;) {
+ if ((i+ti) >= ntok) {
+ if (!(xcmd->arg[i] & OPT)) {
+ printusage(xcmd, stderr);
+ return;
+ }
+ break;
+ }
+ if ((xcmd->arg[i] & OPT) && (*tokens[i+ti] == '>'))
+ break;
+ rval = getarg(tokens[i+ti], (int)xcmd->arg[i], &pcmd.argval[i]);
+ if (rval == -1) {
+ ti++;
+ continue;
+ }
+ if (rval == 0)
+ return;
+ pcmd.nargs++;
+ i++;
+ }
+
+ /* Any extra args are assumed to be "OPT|NTP_STR". */
+ for ( ; i < MAXARGS + MOREARGS;) {
+ if ((i+ti) >= ntok)
+ break;
+ rval = getarg(tokens[i+ti], (int)(OPT|NTP_STR), &pcmd.argval[i]);
+ if (rval == -1) {
+ ti++;
+ continue;
+ }
+ if (rval == 0)
+ return;
+ pcmd.nargs++;
+ i++;
+ }
+
+ i += ti;
+ if (i < ntok && *tokens[i] == '>') {
+ char *fname;
+
+ if (*(tokens[i]+1) != '\0')
+ fname = tokens[i]+1;
+ else if ((i+1) < ntok)
+ fname = tokens[i+1];
+ else {
+ (void) fprintf(stderr, "***No file for redirect\n");
+ return;
+ }
+
+ current_output = fopen(fname, "w");
+ if (current_output == NULL) {
+ (void) fprintf(stderr, "***Error opening %s: ", fname);
+ perror("");
+ return;
+ }
+ } else {
+ current_output = stdout;
+ }
+
+ if (interactive && setjmp(interrupt_buf)) {
+ return;
+ } else {
+ jump = 1;
+ (xcmd->handler)(&pcmd, current_output);
+ jump = 0;
+ if (current_output != stdout)
+ (void) fclose(current_output);
+ current_output = NULL;
+ }
+}
+
+
+/*
+ * tokenize - turn a command line into tokens
+ */
+static void
+tokenize(
+ const char *line,
+ char **tokens,
+ int *ntok
+ )
+{
+ register const char *cp;
+ register char *sp;
+ static char tspace[MAXLINE];
+
+ sp = tspace;
+ cp = line;
+ for (*ntok = 0; *ntok < MAXTOKENS; (*ntok)++) {
+ tokens[*ntok] = sp;
+ while (ISSPACE(*cp))
+ cp++;
+ if (ISEOL(*cp))
+ break;
+ do {
+ *sp++ = *cp++;
+ } while (!ISSPACE(*cp) && !ISEOL(*cp));
+
+ *sp++ = '\0';
+ }
+}
+
+
+
+/*
+ * findcmd - find a command in a command description table
+ */
+static int
+findcmd(
+ register char *str,
+ struct xcmd *clist1,
+ struct xcmd *clist2,
+ struct xcmd **cmd
+ )
+{
+ register struct xcmd *cl;
+ register int clen;
+ int nmatch;
+ struct xcmd *nearmatch = NULL;
+ struct xcmd *clist;
+
+ clen = strlen(str);
+ nmatch = 0;
+ if (clist1 != 0)
+ clist = clist1;
+ else if (clist2 != 0)
+ clist = clist2;
+ else
+ return 0;
+
+ again:
+ for (cl = clist; cl->keyword != 0; cl++) {
+ /* do a first character check, for efficiency */
+ if (*str != *(cl->keyword))
+ continue;
+ if (strncmp(str, cl->keyword, (unsigned)clen) == 0) {
+ /*
+ * Could be extact match, could be approximate.
+ * Is exact if the length of the keyword is the
+ * same as the str.
+ */
+ if (*((cl->keyword) + clen) == '\0') {
+ *cmd = cl;
+ return 1;
+ }
+ nmatch++;
+ nearmatch = cl;
+ }
+ }
+
+ /*
+ * See if there is more to do. If so, go again. Sorry about the
+ * goto, too much looking at BSD sources...
+ */
+ if (clist == clist1 && clist2 != 0) {
+ clist = clist2;
+ goto again;
+ }
+
+ /*
+ * If we got extactly 1 near match, use it, else return number
+ * of matches.
+ */
+ if (nmatch == 1) {
+ *cmd = nearmatch;
+ return 1;
+ }
+ return nmatch;
+}
+
+
+/*
+ * getarg - interpret an argument token
+ *
+ * string is always set.
+ * type is set to the decoded type.
+ *
+ * return: 0 - failure
+ * 1 - success
+ * -1 - skip to next token
+ */
+static int
+getarg(
+ char *str,
+ int code,
+ arg_v *argp
+ )
+{
+ int isneg;
+ char *cp, *np;
+ static const char *digits = "0123456789";
+
+ ZERO(*argp);
+ argp->string = str;
+ argp->type = code & ~OPT;
+
+ switch (argp->type) {
+ case NTP_STR:
+ break;
+ case NTP_ADD:
+ if (!strcmp("-6", str)) {
+ ai_fam_templ = AF_INET6;
+ return -1;
+ } else if (!strcmp("-4", str)) {
+ ai_fam_templ = AF_INET;
+ return -1;
+ }
+ if (!getnetnum(str, &(argp->netnum), (char *)0, 0)) {
+ return 0;
+ }
+ break;
+ case NTP_INT:
+ case NTP_UINT:
+ isneg = 0;
+ np = str;
+ if (*np == '-') {
+ np++;
+ isneg = 1;
+ }
+
+ argp->uval = 0;
+ do {
+ cp = strchr(digits, *np);
+ if (cp == NULL) {
+ (void) fprintf(stderr,
+ "***Illegal integer value %s\n", str);
+ return 0;
+ }
+ argp->uval *= 10;
+ argp->uval += (cp - digits);
+ } while (*(++np) != '\0');
+
+ if (isneg) {
+ if ((code & ~OPT) == NTP_UINT) {
+ (void) fprintf(stderr,
+ "***Value %s should be unsigned\n", str);
+ return 0;
+ }
+ argp->ival = -argp->ival;
+ }
+ break;
+ case IP_VERSION:
+ if (!strcmp("-6", str))
+ argp->ival = 6 ;
+ else if (!strcmp("-4", str))
+ argp->ival = 4 ;
+ else {
+ (void) fprintf(stderr,
+ "***Version must be either 4 or 6\n");
+ return 0;
+ }
+ break;
+ }
+
+ return 1;
+}
+
+
+/*
+ * getnetnum - given a host name, return its net number
+ * and (optional) full name
+ */
+static int
+getnetnum(
+ const char *hname,
+ sockaddr_u *num,
+ char *fullhost,
+ int af
+ )
+{
+ struct addrinfo hints, *ai = NULL;
+
+ ZERO(hints);
+ hints.ai_flags = AI_CANONNAME;
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+
+ /*
+ * decodenetnum only works with addresses, but handles syntax
+ * that getaddrinfo doesn't: [2001::1]:1234
+ */
+ if (decodenetnum(hname, num)) {
+ if (fullhost != NULL)
+ getnameinfo(&num->sa, SOCKLEN(num), fullhost,
+ LENHOSTNAME, NULL, 0, 0);
+ return 1;
+ } else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) {
+ NTP_INSIST(sizeof(*num) >= ai->ai_addrlen);
+ memcpy(num, ai->ai_addr, ai->ai_addrlen);
+ if (fullhost != NULL) {
+ if (ai->ai_canonname != NULL)
+ strlcpy(fullhost, ai->ai_canonname,
+ LENHOSTNAME);
+ else
+ getnameinfo(&num->sa, SOCKLEN(num),
+ fullhost, LENHOSTNAME, NULL,
+ 0, 0);
+ }
+ return 1;
+ }
+ fprintf(stderr, "***Can't find host %s\n", hname);
+
+ return 0;
+}
+
+
+/*
+ * nntohost - convert network number to host name. This routine enforces
+ * the showhostnames setting.
+ */
+const char *
+nntohost(
+ sockaddr_u *netnum
+ )
+{
+ if (!showhostnames || SOCK_UNSPEC(netnum))
+ return stoa(netnum);
+ else if (ISREFCLOCKADR(netnum))
+ return refnumtoa(netnum);
+ else
+ return socktohost(netnum);
+}
+
+
+/*
+ * Finally, the built in command handlers
+ */
+
+/*
+ * help - tell about commands, or details of a particular command
+ */
+static void
+help(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct xcmd *xcp;
+ char *cmd;
+ const char *list[100];
+ size_t word, words;
+ size_t row, rows;
+ size_t col, cols;
+ size_t length;
+
+ if (pcmd->nargs == 0) {
+ words = 0;
+ for (xcp = builtins; xcp->keyword != 0; xcp++) {
+ if (*(xcp->keyword) != '?')
+ list[words++] = xcp->keyword;
+ }
+ for (xcp = opcmds; xcp->keyword != 0; xcp++)
+ list[words++] = xcp->keyword;
+
+ qsort((void *)list, words, sizeof(list[0]), helpsort);
+ col = 0;
+ for (word = 0; word < words; word++) {
+ length = strlen(list[word]);
+ col = max(col, length);
+ }
+
+ cols = SCREENWIDTH / ++col;
+ rows = (words + cols - 1) / cols;
+
+ fprintf(fp, "ntpdc commands:\n");
+
+ for (row = 0; row < rows; row++) {
+ for (word = row; word < words; word += rows)
+ fprintf(fp, "%-*.*s", (int)col,
+ (int)col - 1, list[word]);
+ fprintf(fp, "\n");
+ }
+ } else {
+ cmd = pcmd->argval[0].string;
+ words = findcmd(cmd, builtins, opcmds, &xcp);
+ if (words == 0) {
+ fprintf(stderr,
+ "Command `%s' is unknown\n", cmd);
+ return;
+ } else if (words >= 2) {
+ fprintf(stderr,
+ "Command `%s' is ambiguous\n", cmd);
+ return;
+ }
+ fprintf(fp, "function: %s\n", xcp->comment);
+ printusage(xcp, fp);
+ }
+}
+
+
+/*
+ * helpsort - do hostname qsort comparisons
+ */
+static int
+helpsort(
+ const void *t1,
+ const void *t2
+ )
+{
+ const char * const * name1 = t1;
+ const char * const * name2 = t2;
+
+ return strcmp(*name1, *name2);
+}
+
+
+/*
+ * printusage - print usage information for a command
+ */
+static void
+printusage(
+ struct xcmd *xcp,
+ FILE *fp
+ )
+{
+ int i, opt46;
+
+ opt46 = 0;
+ (void) fprintf(fp, "usage: %s", xcp->keyword);
+ for (i = 0; i < MAXARGS && xcp->arg[i] != NO; i++) {
+ if (opt46 == 0 && (xcp->arg[i] & ~OPT) == NTP_ADD) {
+ (void) fprintf(fp, " [ -4|-6 ]");
+ opt46 = 1;
+ }
+ if (xcp->arg[i] & OPT)
+ (void) fprintf(fp, " [ %s ]", xcp->desc[i]);
+ else
+ (void) fprintf(fp, " %s", xcp->desc[i]);
+ }
+ (void) fprintf(fp, "\n");
+}
+
+
+/*
+ * timeout - set time out time
+ */
+static void
+timeout(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int val;
+
+ if (pcmd->nargs == 0) {
+ val = tvout.tv_sec * 1000 + tvout.tv_usec / 1000;
+ (void) fprintf(fp, "primary timeout %d ms\n", val);
+ } else {
+ tvout.tv_sec = pcmd->argval[0].uval / 1000;
+ tvout.tv_usec = (pcmd->argval[0].uval - (tvout.tv_sec * 1000))
+ * 1000;
+ }
+}
+
+
+/*
+ * my_delay - set delay for auth requests
+ */
+static void
+my_delay(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int isneg;
+ u_long val;
+
+ if (pcmd->nargs == 0) {
+ val = delay_time.l_ui * 1000 + delay_time.l_uf / 4294967;
+ (void) fprintf(fp, "delay %lu ms\n", val);
+ } else {
+ if (pcmd->argval[0].ival < 0) {
+ isneg = 1;
+ val = (u_long)(-pcmd->argval[0].ival);
+ } else {
+ isneg = 0;
+ val = (u_long)pcmd->argval[0].ival;
+ }
+
+ delay_time.l_ui = val / 1000;
+ val %= 1000;
+ delay_time.l_uf = val * 4294967; /* 2**32/1000 */
+
+ if (isneg)
+ L_NEG(&delay_time);
+ }
+}
+
+
+/*
+ * host - set the host we are dealing with.
+ */
+static void
+host(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int i;
+
+ if (pcmd->nargs == 0) {
+ if (havehost)
+ (void) fprintf(fp, "current host is %s\n", currenthost);
+ else
+ (void) fprintf(fp, "no current host\n");
+ return;
+ }
+
+ i = 0;
+ if (pcmd->nargs == 2) {
+ if (!strcmp("-4", pcmd->argval[i].string))
+ ai_fam_templ = AF_INET;
+ else if (!strcmp("-6", pcmd->argval[i].string))
+ ai_fam_templ = AF_INET6;
+ else {
+ if (havehost)
+ (void) fprintf(fp,
+ "current host remains %s\n", currenthost);
+ else
+ (void) fprintf(fp, "still no current host\n");
+ return;
+ }
+ i = 1;
+ }
+ if (openhost(pcmd->argval[i].string)) {
+ (void) fprintf(fp, "current host set to %s\n", currenthost);
+ } else {
+ if (havehost)
+ (void) fprintf(fp,
+ "current host remains %s\n", currenthost);
+ else
+ (void) fprintf(fp, "still no current host\n");
+ }
+}
+
+
+/*
+ * keyid - get a keyid to use for authenticating requests
+ */
+static void
+keyid(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ if (info_auth_keyid == 0 && !keyid_entered)
+ (void) fprintf(fp, "no keyid defined\n");
+ else if (info_auth_keyid == 0 && keyid_entered)
+ (void) fprintf(fp, "no keyid will be sent\n");
+ else
+ (void) fprintf(fp, "keyid is %lu\n", (u_long)info_auth_keyid);
+ } else {
+ info_auth_keyid = pcmd->argval[0].uval;
+ keyid_entered = 1;
+ }
+}
+
+
+/*
+ * keytype - get type of key to use for authenticating requests
+ */
+static void
+keytype(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ const char * digest_name;
+ size_t digest_len;
+ int key_type;
+
+ if (!pcmd->nargs) {
+ fprintf(fp, "keytype is %s with %lu octet digests\n",
+ keytype_name(info_auth_keytype),
+ (u_long)info_auth_hashlen);
+ return;
+ }
+
+ digest_name = pcmd->argval[0].string;
+ digest_len = 0;
+ key_type = keytype_from_text(digest_name, &digest_len);
+
+ if (!key_type) {
+ fprintf(fp, "keytype must be 'md5'%s\n",
+#ifdef OPENSSL
+ " or a digest type provided by OpenSSL");
+#else
+ "");
+#endif
+ return;
+ }
+
+ info_auth_keytype = key_type;
+ info_auth_hashlen = digest_len;
+}
+
+
+/*
+ * passwd - get an authentication key
+ */
+/*ARGSUSED*/
+static void
+passwd(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ char *pass;
+
+ if (info_auth_keyid == 0) {
+ info_auth_keyid = getkeyid("Keyid: ");
+ if (info_auth_keyid == 0) {
+ (void)fprintf(fp, "Keyid must be defined\n");
+ return;
+ }
+ }
+ if (pcmd->nargs >= 1)
+ pass = pcmd->argval[0].string;
+ else {
+ pass = getpass_keytype(info_auth_keytype);
+ if ('\0' == *pass) {
+ fprintf(fp, "Password unchanged\n");
+ return;
+ }
+ }
+ authusekey(info_auth_keyid, info_auth_keytype, (u_char *)pass);
+ authtrust(info_auth_keyid, 1);
+}
+
+
+/*
+ * hostnames - set the showhostnames flag
+ */
+static void
+hostnames(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ if (showhostnames)
+ (void) fprintf(fp, "hostnames being shown\n");
+ else
+ (void) fprintf(fp, "hostnames not being shown\n");
+ } else {
+ if (STREQ(pcmd->argval[0].string, "yes"))
+ showhostnames = 1;
+ else if (STREQ(pcmd->argval[0].string, "no"))
+ showhostnames = 0;
+ else
+ (void)fprintf(stderr, "What?\n");
+ }
+}
+
+
+/*
+ * setdebug - set/change debugging level
+ */
+static void
+setdebug(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ (void) fprintf(fp, "debug level is %d\n", debug);
+ return;
+ } else if (STREQ(pcmd->argval[0].string, "no")) {
+ debug = 0;
+ } else if (STREQ(pcmd->argval[0].string, "more")) {
+ debug++;
+ } else if (STREQ(pcmd->argval[0].string, "less")) {
+ debug--;
+ } else {
+ (void) fprintf(fp, "What?\n");
+ return;
+ }
+ (void) fprintf(fp, "debug level set to %d\n", debug);
+}
+
+
+/*
+ * quit - stop this nonsense
+ */
+/*ARGSUSED*/
+static void
+quit(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (havehost)
+ closesocket(sockfd);
+ exit(0);
+}
+
+
+/*
+ * version - print the current version number
+ */
+/*ARGSUSED*/
+static void
+version(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+
+ (void) fprintf(fp, "%s\n", Version);
+ return;
+}
+
+
+/*
+ * warning - print a warning message
+ */
+static void
+warning(
+ const char *fmt,
+ const char *st1,
+ const char *st2
+ )
+{
+ (void) fprintf(stderr, "%s: ", progname);
+ (void) fprintf(stderr, fmt, st1, st2);
+ (void) fprintf(stderr, ": ");
+ perror("");
+}
+
+
+/*
+ * error - print a message and exit
+ */
+static void
+error(
+ const char *fmt,
+ const char *st1,
+ const char *st2
+ )
+{
+ warning(fmt, st1, st2);
+ exit(1);
+}
+
+/*
+ * getkeyid - prompt the user for a keyid to use
+ */
+static u_long
+getkeyid(
+ const char *keyprompt
+ )
+{
+ int c;
+ FILE *fi;
+ char pbuf[20];
+ size_t i;
+ size_t ilim;
+
+#ifndef SYS_WINNT
+ if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL)
+#else
+ if ((fi = _fdopen(open("CONIN$", _O_TEXT), "r")) == NULL)
+#endif /* SYS_WINNT */
+ fi = stdin;
+ else
+ setbuf(fi, (char *)NULL);
+ fprintf(stderr, "%s", keyprompt); fflush(stderr);
+ for (i = 0, ilim = COUNTOF(pbuf) - 1;
+ i < ilim && (c = getc(fi)) != '\n' && c != EOF;
+ )
+ pbuf[i++] = (char)c;
+ pbuf[i] = '\0';
+ if (fi != stdin)
+ fclose(fi);
+
+ return (u_long) atoi(pbuf);
+}
diff --git a/ntpdc/ntpdc.h b/ntpdc/ntpdc.h
new file mode 100644
index 0000000..bfc2228
--- /dev/null
+++ b/ntpdc/ntpdc.h
@@ -0,0 +1,67 @@
+/*
+ * ntpdc.h - definitions of interest to ntpdc
+ */
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "ntp_request.h"
+#include "ntp_string.h"
+#include "ntp_malloc.h"
+
+/*
+ * Maximum number of arguments
+ */
+#define MAXARGS 4
+#define MOREARGS 10
+
+/*
+ * Flags for forming descriptors.
+ */
+#define OPT 0x80 /* this argument is optional, or'd with type */
+
+#define NO 0x0
+#define NTP_STR 0x1 /* string argument */
+#define NTP_UINT 0x2 /* unsigned integer */
+#define NTP_INT 0x3 /* signed integer */
+#define NTP_ADD 0x4 /* IP network address */
+#define IP_VERSION 0x5 /* IP version */
+
+/*
+ * Arguments are returned in a struct - no
+ * union space saving is attempted.
+ */
+typedef struct {
+ u_char type;
+ char *string;
+ long ival;
+ u_long uval;
+ sockaddr_u netnum;
+} arg_v;
+
+/*
+ * Structure for passing parsed command line
+ */
+struct parse {
+ char *keyword;
+ arg_v argval[MAXARGS + MOREARGS];
+ int nargs;
+};
+
+/*
+ * ntpdc includes a command parser which could charitably be called
+ * crude. The following structure is used to define the command
+ * syntax.
+ */
+struct xcmd {
+ const char *keyword; /* command key word */
+ void (*handler) (struct parse *, FILE *); /* command handler */
+ u_char arg[MAXARGS]; /* descriptors for arguments */
+ const char *desc[MAXARGS]; /* descriptions for arguments */
+ const char *comment;
+};
+
+extern int impl_ver;
+extern int showhostnames;
+extern int s_port;
+
+extern int doquery (int, int, int, int, int, char *, int *, int *, char **, int, int);
+extern const char * nntohost (sockaddr_u *);
diff --git a/ntpdc/ntpdc.html b/ntpdc/ntpdc.html
new file mode 100644
index 0000000..8381a2b
--- /dev/null
+++ b/ntpdc/ntpdc.html
@@ -0,0 +1,515 @@
+<html lang="en">
+<head>
+<title>ntpdc: NTPD Control User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="ntpdc: NTPD Control User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">ntpdc: NTPD Control User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-Description">ntpdc Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">ntpdc: NTPD Control User Manual</h2>
+
+<p>This document describes the use of the NTP Project's <code>ntpdc</code> program,
+that can be used to query a Network Time Protocol (NTP) server and
+display the time offset of the system clock relative to the server
+clock. Run as root, it can correct the system clock to this offset as
+well. It can be run as an interactive command or from a cron job.
+
+ <p>This document applies to version 4.2.7p482 of <code>ntpdc</code>.
+
+ <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
+IETF specification.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">ntpdc: NTPD Control User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpdc-Description">ntpdc Description</a>: Description
+<li><a accesskey="2" href="#ntpdc-Invocation">ntpdc Invocation</a>: Invoking ntpdc
+<li><a accesskey="3" href="#Usage">Usage</a>: Usage
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-Description"></a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>By default, <code>ntpdc</code> writes the local data and time (i.e., not UTC) to the
+standard output in the format:
+
+<pre class="example"> 1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
+</pre>
+ <p>where
+YYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
+(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
+and
+the +4.567 +/- 0.089 secs indicates the time offset and
+error bound of the system clock relative to the server clock.
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">Invoking ntpdc</h3>
+
+<p><a name="index-ntpdc-1"></a><a name="index-vendor_002dspecific-NTPD-control-program-2"></a>
+
+ <p><code>ntpdc</code>
+is deprecated.
+Please use
+<code>ntpq(1ntpqmdoc)</code> instead - it can do everything
+<code>ntpdc</code>
+used to do, and it does so using a much more sane interface.
+
+ <p><code>ntpdc</code>
+is a utility program used to query
+<code>ntpd(1ntpdmdoc)</code>
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+<code>ntpdc</code>
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+<code>ntpdc</code>
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpdc</code> program.
+This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpdc-usage">ntpdc usage</a>: ntpdc help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntpdc-ipv4">ntpdc ipv4</a>: ipv4 option (-4)
+<li><a accesskey="3" href="#ntpdc-ipv6">ntpdc ipv6</a>: ipv6 option (-6)
+<li><a accesskey="4" href="#ntpdc-command">ntpdc command</a>: command option (-c)
+<li><a accesskey="5" href="#ntpdc-interactive">ntpdc interactive</a>: interactive option (-i)
+<li><a accesskey="6" href="#ntpdc-listpeers">ntpdc listpeers</a>: listpeers option (-l)
+<li><a accesskey="7" href="#ntpdc-numeric">ntpdc numeric</a>: numeric option (-n)
+<li><a accesskey="8" href="#ntpdc-peers">ntpdc peers</a>: peers option (-p)
+<li><a accesskey="9" href="#ntpdc-showpeers">ntpdc showpeers</a>: showpeers option (-s)
+<li><a href="#ntpdc-config">ntpdc config</a>: presetting/configuring ntpdc
+<li><a href="#ntpdc-exit-status">ntpdc exit status</a>: exit status
+<li><a href="#ntpdc-Usage">ntpdc Usage</a>: Usage
+<li><a href="#ntpdc-See-Also">ntpdc See Also</a>: See Also
+<li><a href="#ntpdc-Authors">ntpdc Authors</a>: Authors
+<li><a href="#ntpdc-Bugs">ntpdc Bugs</a>: Bugs
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-ipv4">ntpdc ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpdc help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntpdc-help-3"></a>
+This is the automatically generated usage text for ntpdc.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.7p482
+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
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -c Str command run a command and exit
+ - may appear multiple times
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -i no interactive Force ntpq to operate in interactive mode
+ - prohibits these options:
+ command
+ listpeers
+ peers
+ showpeers
+ -l no listpeers Print a list of the peers
+ - prohibits the option 'command'
+ -n no numeric numeric host addresses
+ -p no peers Print a list of the peers
+ - prohibits the option 'command'
+ -s no showpeers Show a list of the peers
+ - prohibits the option 'command'
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -&gt; opt save-opts save the option state to a config file
+ -&lt; Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTPDC_*
+
+Please send bug reports to: &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntpdc-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-ipv6">ntpdc ipv6</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-usage">ntpdc usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv4 option (-4)</h4>
+
+<p><a name="index-ntpdc_002dipv4-4"></a>
+This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv6.
+</ul>
+
+ <p>Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+<div class="node">
+<p><hr>
+<a name="ntpdc-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-command">ntpdc command</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-ipv4">ntpdc ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv6 option (-6)</h4>
+
+<p><a name="index-ntpdc_002dipv6-5"></a>
+This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv4.
+</ul>
+
+ <p>Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+<div class="node">
+<p><hr>
+<a name="ntpdc-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-interactive">ntpdc interactive</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-ipv6">ntpdc ipv6</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">command option (-c)</h4>
+
+<p><a name="index-ntpdc_002dcommand-6"></a>
+This is the &ldquo;run a command and exit&rdquo; option.
+This option takes a string argument <span class="file">cmd</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+<div class="node">
+<p><hr>
+<a name="ntpdc-interactive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-listpeers">ntpdc listpeers</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-command">ntpdc command</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">interactive option (-i)</h4>
+
+<p><a name="index-ntpdc_002dinteractive-7"></a>
+This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+command, listpeers, peers, showpeers.
+</ul>
+
+ <p>Force ntpq to operate in interactive mode. Prompts will be written
+to the standard output and commands read from the standard input.
+<div class="node">
+<p><hr>
+<a name="ntpdc-listpeers"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-numeric">ntpdc numeric</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-interactive">ntpdc interactive</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">listpeers option (-l)</h4>
+
+<p><a name="index-ntpdc_002dlistpeers-8"></a>
+This is the &ldquo;print a list of the peers&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+command.
+</ul>
+
+ <p>Print a list of the peers known to the server as well as a summary of
+their state. This is equivalent to the 'listpeers' interactive command.
+<div class="node">
+<p><hr>
+<a name="ntpdc-numeric"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-peers">ntpdc peers</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-listpeers">ntpdc listpeers</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">numeric option (-n)</h4>
+
+<p><a name="index-ntpdc_002dnumeric-9"></a>
+This is the &ldquo;numeric host addresses&rdquo; option.
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+<div class="node">
+<p><hr>
+<a name="ntpdc-peers"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-showpeers">ntpdc showpeers</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-numeric">ntpdc numeric</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">peers option (-p)</h4>
+
+<p><a name="index-ntpdc_002dpeers-10"></a>
+This is the &ldquo;print a list of the peers&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+command.
+</ul>
+
+ <p>Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+<div class="node">
+<p><hr>
+<a name="ntpdc-showpeers"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-config">ntpdc config</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-peers">ntpdc peers</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">showpeers option (-s)</h4>
+
+<p><a name="index-ntpdc_002dshowpeers-11"></a>
+This is the &ldquo;show a list of the peers&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+command.
+</ul>
+
+ <p>Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'dmpeers' interactive command.
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-exit-status">ntpdc exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-showpeers">ntpdc showpeers</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">presetting/configuring ntpdc</h4>
+
+<p>Any option that is not marked as <i>not presettable</i> may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named <code>NTPDC</code> and <code>NTPDC_&lt;OPTION_NAME&gt;</code>. <code>&lt;OPTION_NAME&gt;</code> must be one of
+the options listed above in upper case and segmented with underscores.
+The <code>NTPDC</code> variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+<p class="noindent"><code>libopts</code> will search in 2 places for configuration files:
+ <ul>
+<li>$HOME
+<li>$PWD
+</ul>
+ The environment variables <code>HOME</code>, and <code>PWD</code>
+are expanded and replaced when <span class="file">ntpdc</span> runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named <span class="file">.ntprc</span> is searched for
+within that directory and processed.
+
+ <p>Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+ <p>Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+<pre class="example"> [NTPDC]
+</pre>
+ <p class="noindent">or by
+<pre class="example"> &lt;?program ntpdc&gt;
+</pre>
+ <p class="noindent">Do not mix these styles within one configuration file.
+
+ <p>Compound values and carefully constructed string values may also be
+specified using XML syntax:
+<pre class="example"> &lt;option-name&gt;
+ &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
+ &lt;/option-name&gt;
+</pre>
+ <p class="noindent">yielding an <code>option-name.sub-opt</code> string value of
+<pre class="example"> "...&lt;...&gt;..."
+</pre>
+ <p><code>AutoOpts</code> does not track suboptions. You simply note that it is a
+hierarchicly valued option. <code>AutoOpts</code> does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+ <p>The command line options relating to configuration and/or usage help are:
+
+<h5 class="subsubheading">version (-)</h5>
+
+<p>Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+ <dl>
+<dt><span class="samp">version</span><dd>Only print the version. This is the default.
+<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
+<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
+</dl>
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-Usage">ntpdc Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-config">ntpdc config</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpdc exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+<br><dt><span class="samp">66 (EX_NOINPUT)</span><dd>A specified configuration file could not be loaded.
+<br><dt><span class="samp">70 (EX_SOFTWARE)</span><dd>libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+</dl>
+ <div class="node">
+<p><hr>
+<a name="ntpdc-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-See-Also">ntpdc See Also</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-exit-status">ntpdc exit status</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpdc Usage</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-See-Also"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-Authors">ntpdc Authors</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-Usage">ntpdc Usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpdc See Also</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-Authors"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpdc-Bugs">ntpdc Bugs</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-See-Also">ntpdc See Also</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpdc Authors</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntpdc-Bugs"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpdc-Authors">ntpdc Authors</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpdc-Invocation">ntpdc Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpdc Bugs</h4>
+
+<div class="node">
+<p><hr>
+<a name="Usage"></a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Usage</h3>
+
+<p>The simplest use of this program is as an unprivileged command to
+check the current time, offset, and error in the local clock.
+For example:
+
+<pre class="example"> ntpdc ntpserver.somewhere
+</pre>
+ <p>With suitable privilege, it can be run as a command or in a
+<code>cron</code> job to reset the local clock from a reliable server, like
+the <code>ntpdate</code> and <code>rdate</code> commands.
+For example:
+
+<pre class="example"> ntpdc -a ntpserver.somewhere
+</pre>
+ </body></html>
+
diff --git a/ntpdc/ntpdc.man.in b/ntpdc/ntpdc.man.in
new file mode 100644
index 0000000..db5d1cc
--- /dev/null
+++ b/ntpdc/ntpdc.man.in
@@ -0,0 +1,874 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpdc @NTPDC_MS@ "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6QaWHN/ag-hRaOGN)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:28 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpdc-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpdc\fP
+\- vendor-specific NTPD control program
+.SH SYNOPSIS
+\f\*[B-Font]ntpdc\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ host ...]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpdc\fP
+is deprecated.
+Please use
+\fCntpq\fR(@NTPQ_MS@)\f[] instead \- it can do everything
+\f\*[B-Font]ntpdc\fP
+used to do, and it does so using a much more sane interface.
+.sp \n(Ppu
+.ne 2
+
+\f\*[B-Font]ntpdc\fP
+is a utility program used to query
+\fCntpd\fR(@NTPD_MS@)\f[]
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+\f\*[B-Font]ntpdc\fP
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+\f\*[B-Font]ntpdc\fP.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[]
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[]
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, listpeers, peers, showpeers.
+.sp
+Force ntpq to operate in interactive mode. Prompts will be written
+to the standard output and commands read from the standard input.
+.TP
+.NOP \f\*[B-Font]\-l\f[], \f\*[B-Font]\-\-listpeers\f[]
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary of
+their state. This is equivalent to the 'listpeers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+numeric host addresses.
+.sp
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-s\f[], \f\*[B-Font]\-\-showpeers\f[]
+Show a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'dmpeers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPDC_<option-name>\fP or \fBNTPDC\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+If one or more request options are included on the command line
+when
+\f\*[B-Font]ntpdc\fP
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+\f\*[B-Font]ntpdc\fP
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+\f\*[B-Font]ntpdc\fP
+utility will prompt for
+commands if the standard input is a terminal device.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]ntpdc\fP
+utility uses NTP mode 7 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+\f\*[B-Font]ntpdc\fP
+utility makes
+no attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+.sp \n(Ppu
+.ne 2
+
+The operation of
+\f\*[B-Font]ntpdc\fP
+are specific to the particular
+implementation of the
+\fCntpd\fR(@NTPD_MS@)\f[]
+daemon and can be expected to
+work only with this and maybe some previous versions of the daemon.
+Requests from a remote
+\f\*[B-Font]ntpdc\fP
+utility which affect the
+state of the local server must be authenticated, which requires
+both the remote program and local server share a common key and key
+identifier.
+.sp \n(Ppu
+.ne 2
+
+Note that in contexts where a host name is expected, a
+\f\*[B-Font]\-4\f[]
+qualifier preceding the host name forces DNS resolution to the IPv4 namespace,
+while a
+\f\*[B-Font]\-6\f[]
+qualifier forces DNS resolution to the IPv6 namespace.
+Specifying a command line option other than
+\f\*[B-Font]\-i\f[]
+or
+\f\*[B-Font]\-n\f[]
+will cause the specified query (queries) to be sent to
+the indicated host(s) immediately.
+Otherwise,
+\f\*[B-Font]ntpdc\fP
+will
+attempt to read interactive format commands from the standard
+input.
+.SS "Interactive Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+The output of a
+command is normally sent to the standard output, but optionally the
+output of individual commands may be sent to a file by appending a
+\[oq]\&>\[cq],
+followed by a file name, to the command line.
+.sp \n(Ppu
+.ne 2
+
+A number of interactive format commands are executed entirely
+within the
+\f\*[B-Font]ntpdc\fP
+utility itself and do not result in NTP
+mode 7 requests being sent to a server.
+These are described
+following.
+.TP 7
+.NOP \f\*[B-Font]\&?\f[] \f\*[I-Font]command_keyword\f[]
+.TP 7
+.NOP \f\*[B-Font]help\f[] \f\*[I-Font]command_keyword\f[]
+A
+\[oq]\f\*[B-Font]\&?\f[]\[cq]
+will print a list of all the command
+keywords known to this incarnation of
+\f\*[B-Font]ntpdc\fP.
+A
+\[oq]\f\*[B-Font]\&?\f[]\[cq]
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+\fCntpq\fR(@NTPQ_MS@)\f[]
+than this manual
+page.
+.TP 7
+.NOP \f\*[B-Font]delay\f[] \f\*[I-Font]milliseconds\f[]
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.TP 7
+.NOP \f\*[B-Font]host\f[] \f\*[I-Font]hostname\f[]
+Set the host to which future queries will be sent.
+Hostname may
+be either a host name or a numeric address.
+.TP 7
+.NOP \f\*[B-Font]hostnames\f[] [\f\*[B-Font]yes\f[] | \f\*[B-Font]no\f[]]
+If
+\f\*[B-Font]yes\f[]
+is specified, host names are printed in
+information displays.
+If
+\f\*[B-Font]no\f[]
+is specified, numeric
+addresses are printed instead.
+The default is
+\f\*[B-Font]yes\f[],
+unless
+modified using the command line
+\f\*[B-Font]\-n\f[]
+switch.
+.TP 7
+.NOP \f\*[B-Font]keyid\f[] \f\*[I-Font]keyid\f[]
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.TP 7
+.NOP \f\*[B-Font]quit\f[]
+Exit
+\f\*[B-Font]ntpdc\fP.
+.TP 7
+.NOP \f\*[B-Font]passwd\f[]
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.TP 7
+.NOP \f\*[B-Font]timeout\f[] \f\*[I-Font]milliseconds\f[]
+Specify a timeout period for responses to server queries.
+The
+default is about 8000 milliseconds.
+Note that since
+\f\*[B-Font]ntpdc\fP
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.PP
+.SS "Control Message Commands"
+Query commands result in NTP mode 7 packets containing requests for
+information being sent to the server.
+These are read-only commands
+in that they make no modification of the server configuration
+state.
+.TP 7
+.NOP \f\*[B-Font]listpeers\f[]
+Obtains and prints a brief list of the peers for which the
+server is maintaining state.
+These should include all configured
+peer associations as well as those peers whose stratum is such that
+they are considered by the server to be possible future
+synchronization candidates.
+.TP 7
+.NOP \f\*[B-Font]peers\f[]
+Obtains a list of peers for which the server is maintaining
+state, along with a summary of that state.
+Summary information
+includes the address of the remote peer, the local interface
+address (0.0.0.0 if a local address has yet to be determined), the
+stratum of the remote peer (a stratum of 16 indicates the remote
+peer is unsynchronized), the polling interval, in seconds, the
+reachability register, in octal, and the current estimated delay,
+offset and dispersion of the peer, all in seconds.
+.sp \n(Ppu
+.ne 2
+
+The character in the left margin indicates the mode this peer
+entry is operating in.
+A
+\[oq]\&+\[cq]
+denotes symmetric active, a
+\[oq]\&-\[cq]
+indicates symmetric passive, a
+\[oq]\&=\[cq]
+means the
+remote server is being polled in client mode, a
+\[oq]\&^\[cq]
+indicates that the server is broadcasting to this address, a
+\[oq]\&~\[cq]
+denotes that the remote peer is sending broadcasts and a
+\[oq]\&~\[cq]
+denotes that the remote peer is sending broadcasts and a
+\[oq]\&*\[cq]
+marks the peer the server is currently synchronizing
+to.
+.sp \n(Ppu
+.ne 2
+
+The contents of the host field may be one of four forms.
+It may
+be a host name, an IP address, a reference clock implementation
+name with its parameter or
+\fBREFCLK\fR()\f[]
+On
+\f\*[B-Font]hostnames\f[]
+\f\*[B-Font]no\f[]
+only IP-addresses
+will be displayed.
+.TP 7
+.NOP \f\*[B-Font]dmpeers\f[]
+A slightly different peer summary list.
+Identical to the output
+of the
+\f\*[B-Font]peers\f[]
+command, except for the character in the
+leftmost column.
+Characters only appear beside peers which were
+included in the final stage of the clock selection algorithm.
+A
+\[oq]\&.\[cq]
+indicates that this peer was cast off in the falseticker
+detection, while a
+\[oq]\&+\[cq]
+indicates that the peer made it
+through.
+A
+\[oq]\&*\[cq]
+denotes the peer the server is currently
+synchronizing with.
+.TP 7
+.NOP \f\*[B-Font]showpeer\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]...\f[]]
+Shows a detailed display of the current peer variables for one
+or more peers.
+Most of these values are described in the NTP
+Version 2 specification.
+.TP 7
+.NOP \f\*[B-Font]pstats\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]...\f[]]
+Show per-peer statistic counters associated with the specified
+peer(s).
+.TP 7
+.NOP \f\*[B-Font]clockstat\f[] \f\*[I-Font]clock_peer_address\f[] [\f\*[I-Font]...\f[]]
+Obtain and print information concerning a peer clock.
+The
+values obtained provide information on the setting of fudge factors
+and other clock performance information.
+.TP 7
+.NOP \f\*[B-Font]kerninfo\f[]
+Obtain and print kernel phase-lock loop operating parameters.
+This information is available only if the kernel has been specially
+modified for a precision timekeeping function.
+.TP 7
+.NOP \f\*[B-Font]loopinfo\f[] [\f\*[B-Font]oneline\f[] | \f\*[B-Font]multiline\f[]]
+Print the values of selected loop filter variables.
+The loop
+filter is the part of NTP which deals with adjusting the local
+system clock.
+The
+\[oq]offset\[cq]
+is the last offset given to the
+loop filter by the packet processing code.
+The
+\[oq]frequency\[cq]
+is the frequency error of the local clock in parts-per-million
+(ppm).
+The
+\[oq]time_const\[cq]
+controls the stiffness of the
+phase-lock loop and thus the speed at which it can adapt to
+oscillator drift.
+The
+\[oq]watchdog timer\[cq]
+value is the number
+of seconds which have elapsed since the last sample offset was
+given to the loop filter.
+The
+\f\*[B-Font]oneline\f[]
+and
+\f\*[B-Font]multiline\f[]
+options specify the format in which this
+information is to be printed, with
+\f\*[B-Font]multiline\f[]
+as the
+default.
+.TP 7
+.NOP \f\*[B-Font]sysinfo\f[]
+Print a variety of system state variables, i.e., state related
+to the local server.
+All except the last four lines are described
+in the NTP Version 3 specification, RFC-1305.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]system flags\[cq]
+show various system flags, some of
+which can be set and cleared by the
+\f\*[B-Font]enable\f[]
+and
+\f\*[B-Font]disable\f[]
+configuration commands, respectively.
+These are
+the
+\f\*[B-Font]auth\f[],
+\f\*[B-Font]bclient\f[],
+\f\*[B-Font]monitor\f[],
+\f\*[B-Font]pll\f[],
+\f\*[B-Font]pps\f[]
+and
+\f\*[B-Font]stats\f[]
+flags.
+See the
+\fCntpd\fR(@NTPD_MS@)\f[]
+documentation for the meaning of these flags.
+There
+are two additional flags which are read only, the
+\f\*[B-Font]kernel_pll\f[]
+and
+\f\*[B-Font]kernel_pps\f[].
+These flags indicate
+the synchronization status when the precision time kernel
+modifications are in use.
+The
+\[oq]kernel_pll\[cq]
+indicates that
+the local clock is being disciplined by the kernel, while the
+\[oq]kernel_pps\[cq]
+indicates the kernel discipline is provided by the PPS
+signal.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]stability\[cq]
+is the residual frequency error remaining
+after the system frequency correction is applied and is intended for
+maintenance and debugging.
+In most architectures, this value will
+initially decrease from as high as 500 ppm to a nominal value in
+the range .01 to 0.1 ppm.
+If it remains high for some time after
+starting the daemon, something may be wrong with the local clock,
+or the value of the kernel variable
+\fIkern.clockrate.tick\f[]
+may be
+incorrect.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]broadcastdelay\[cq]
+shows the default broadcast delay,
+as set by the
+\f\*[B-Font]broadcastdelay\f[]
+configuration command.
+.sp \n(Ppu
+.ne 2
+
+The
+\[oq]authdelay\[cq]
+shows the default authentication delay,
+as set by the
+\f\*[B-Font]authdelay\f[]
+configuration command.
+.TP 7
+.NOP \f\*[B-Font]sysstats\f[]
+Print statistics counters maintained in the protocol
+module.
+.TP 7
+.NOP \f\*[B-Font]memstats\f[]
+Print statistics counters related to memory allocation
+code.
+.TP 7
+.NOP \f\*[B-Font]iostats\f[]
+Print statistics counters maintained in the input-output
+module.
+.TP 7
+.NOP \f\*[B-Font]timerstats\f[]
+Print statistics counters maintained in the timer/event queue
+support code.
+.TP 7
+.NOP \f\*[B-Font]reslist\f[]
+Obtain and print the server's restriction list.
+This list is
+(usually) printed in sorted order and may help to understand how
+the restrictions are applied.
+.TP 7
+.NOP \f\*[B-Font]monlist\f[] [\f\*[I-Font]version\f[]]
+Obtain and print traffic counts collected and maintained by the
+monitor facility.
+The version number should not normally need to be
+specified.
+.TP 7
+.NOP \f\*[B-Font]clkbug\f[] \f\*[I-Font]clock_peer_address\f[] [\f\*[I-Font]...\f[]]
+Obtain debugging information for a reference clock driver.
+This
+information is provided only by some clock drivers and is mostly
+undecodable without a copy of the driver source in hand.
+.PP
+.SS "Runtime Configuration Requests"
+All requests which cause state changes in the server are
+authenticated by the server using a configured NTP key (the
+facility can also be disabled by the server by not configuring a
+key).
+The key number and the corresponding key must also be made
+known to
+\f\*[B-Font]ntpdc\fP.
+This can be done using the
+\f\*[B-Font]keyid\f[]
+and
+\f\*[B-Font]passwd\f[]
+commands, the latter of which will prompt at the terminal for a
+password to use as the encryption key.
+You will also be prompted
+automatically for both the key number and password the first time a
+command which would result in an authenticated request to the
+server is given.
+Authentication not only provides verification that
+the requester has permission to make such changes, but also gives
+an extra degree of protection again transmission errors.
+.sp \n(Ppu
+.ne 2
+
+Authenticated requests always include a timestamp in the packet
+data, which is included in the computation of the authentication
+code.
+This timestamp is compared by the server to its receive time
+stamp.
+If they differ by more than a small amount the request is
+rejected.
+This is done for two reasons.
+First, it makes simple
+replay attacks on the server, by someone who might be able to
+overhear traffic on your LAN, much more difficult.
+Second, it makes
+it more difficult to request configuration changes to your server
+from topologically remote hosts.
+While the reconfiguration facility
+will work well with a server on the local host, and may work
+adequately between time-synchronized hosts on the same LAN, it will
+work very poorly for more distant hosts.
+As such, if reasonable
+passwords are chosen, care is taken in the distribution and
+protection of keys and appropriate source address restrictions are
+applied, the run time reconfiguration facility should provide an
+adequate level of security.
+.sp \n(Ppu
+.ne 2
+
+The following commands all make authenticated requests.
+.TP 7
+.NOP \f\*[B-Font]addpeer\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]keyid\f[]] [\f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]]
+Add a configured peer association at the given address and
+operating in symmetric active mode.
+Note that an existing
+association with the same peer may be deleted when this command is
+executed, or may simply be converted to conform to the new
+configuration, as appropriate.
+If the optional
+\f\*[I-Font]keyid\f[]
+is a
+nonzero integer, all outgoing packets to the remote server will
+have an authentication field attached encrypted with this key.
+If
+the value is 0 (or not given) no authentication will be done.
+The
+\f\*[I-Font]version\f[]
+can be 1, 2 or 3 and defaults to 3.
+The
+\f\*[B-Font]prefer\f[]
+keyword indicates a preferred peer (and thus will
+be used primarily for clock synchronisation if possible).
+The
+preferred peer also determines the validity of the PPS signal \- if
+the preferred peer is suitable for synchronisation so is the PPS
+signal.
+.TP 7
+.NOP \f\*[B-Font]addserver\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]keyid\f[]] [\f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]]
+Identical to the addpeer command, except that the operating
+mode is client.
+.TP 7
+.NOP \f\*[B-Font]broadcast\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]keyid\f[]] [\f\*[I-Font]version\f[]] [\f\*[B-Font]prefer\f[]]
+Identical to the addpeer command, except that the operating
+mode is broadcast.
+In this case a valid key identifier and key are
+required.
+The
+\f\*[I-Font]peer_address\f[]
+parameter can be the broadcast
+address of the local network or a multicast group address assigned
+to NTP.
+If a multicast address, a multicast-capable kernel is
+required.
+.TP 7
+.NOP \f\*[B-Font]unconfig\f[] \f\*[I-Font]peer_address\f[] [\f\*[I-Font]...\f[]]
+This command causes the configured bit to be removed from the
+specified peer(s).
+In many cases this will cause the peer
+association to be deleted.
+When appropriate, however, the
+association may persist in an unconfigured mode if the remote peer
+is willing to continue on in this fashion.
+.TP 7
+.NOP \f\*[B-Font]fudge\f[] \f\*[I-Font]peer_address\f[] [\f\*[B-Font]time1\f[]] [\f\*[B-Font]time2\f[]] [\f\*[I-Font]stratum\f[]] [\f\*[I-Font]refid\f[]]
+This command provides a way to set certain data for a reference
+clock.
+See the source listing for further information.
+.TP 7
+.NOP \f\*[B-Font]enable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]pps\f[] | \f\*[B-Font]stats\f[]]
+.TP 7
+.NOP \f\*[B-Font]disable\f[] [\f\*[B-Font]auth\f[] | \f\*[B-Font]bclient\f[] | \f\*[B-Font]calibrate\f[] | \f\*[B-Font]kernel\f[] | \f\*[B-Font]monitor\f[] | \f\*[B-Font]ntp\f[] | \f\*[B-Font]pps\f[] | \f\*[B-Font]stats\f[]]
+These commands operate in the same way as the
+\f\*[B-Font]enable\f[]
+and
+\f\*[B-Font]disable\f[]
+configuration file commands of
+\fCntpd\fR(@NTPD_MS@)\f[].
+.RS
+.TP 7
+.NOP \f\*[B-Font]auth\f[]
+Enables the server to synchronize with unconfigured peers only
+if the peer has been correctly authenticated using either public key
+or private key cryptography.
+The default for this flag is enable.
+.TP 7
+.NOP \f\*[B-Font]bclient\f[]
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the multicastclient command with
+default address.
+The default for this flag is disable.
+.TP 7
+.NOP \f\*[B-Font]calibrate\f[]
+Enables the calibrate feature for reference clocks.
+The default for this flag is disable.
+.TP 7
+.NOP \f\*[B-Font]kernel\f[]
+Enables the kernel time discipline, if available.
+The default for this flag is enable if support is available, otherwise disable.
+.TP 7
+.NOP \f\*[B-Font]monitor\f[]
+Enables the monitoring facility.
+See the documentation here about the
+\f\*[B-Font]monlist\f[]
+command or further information.
+The default for this flag is enable.
+.TP 7
+.NOP \f\*[B-Font]ntp\f[]
+Enables time and frequency discipline.
+In effect, this switch opens and closes the feedback loop,
+which is useful for testing.
+The default for this flag is enable.
+.TP 7
+.NOP \f\*[B-Font]pps\f[]
+Enables the pulse-per-second (PPS) signal when frequency
+and time is disciplined by the precision time kernel modifications.
+See the
+"A Kernel Model for Precision Timekeeping"
+(available as part of the HTML documentation
+provided in
+\fI/usr/share/doc/ntp\f[])
+page for further information.
+The default for this flag is disable.
+.TP 7
+.NOP \f\*[B-Font]stats\f[]
+Enables the statistics facility.
+See the
+\fIMonitoring\f[] \fIOptions\f[]
+section of
+\fCntp.conf\fR(5)\f[]
+for further information.
+The default for this flag is disable.
+.RE
+.TP 7
+.NOP \f\*[B-Font]restrict\f[] \f\*[I-Font]address\f[] \f\*[I-Font]mask\f[] \f\*[I-Font]flag\f[] [\f\*[I-Font]...\f[]]
+This command operates in the same way as the
+\f\*[B-Font]restrict\f[]
+configuration file commands of
+\fCntpd\fR(@NTPD_MS@)\f[].
+.TP 7
+.NOP \f\*[B-Font]unrestrict\f[] \f\*[I-Font]address\f[] \f\*[I-Font]mask\f[] \f\*[I-Font]flag\f[] [\f\*[I-Font]...\f[]]
+Unrestrict the matching entry from the restrict list.
+.TP 7
+.NOP \f\*[B-Font]delrestrict\f[] \f\*[I-Font]address\f[] \f\*[I-Font]mask\f[] [\f\*[B-Font]ntpport\f[]]
+Delete the matching entry from the restrict list.
+.TP 7
+.NOP \f\*[B-Font]readkeys\f[]
+Causes the current set of authentication keys to be purged and
+a new set to be obtained by rereading the keys file (which must
+have been specified in the
+\fCntpd\fR(@NTPD_MS@)\f[]
+configuration file).
+This
+allows encryption keys to be changed without restarting the
+server.
+.TP 7
+.NOP \f\*[B-Font]trustedkey\f[] \f\*[I-Font]keyid\f[] [\f\*[I-Font]...\f[]]
+.TP 7
+.NOP \f\*[B-Font]untrustedkey\f[] \f\*[I-Font]keyid\f[] [\f\*[I-Font]...\f[]]
+These commands operate in the same way as the
+\f\*[B-Font]trustedkey\f[]
+and
+\f\*[B-Font]untrustedkey\f[]
+configuration file
+commands of
+\fCntpd\fR(@NTPD_MS@)\f[].
+.TP 7
+.NOP \f\*[B-Font]authinfo\f[]
+Returns information concerning the authentication module,
+including known keys and counts of encryptions and decryptions
+which have been done.
+.TP 7
+.NOP \f\*[B-Font]traps\f[]
+Display the traps set in the server.
+See the source listing for
+further information.
+.TP 7
+.NOP \f\*[B-Font]addtrap\f[] \f\*[I-Font]address\f[] [\f\*[I-Font]port\f[]] [\f\*[I-Font]interface\f[]]
+Set a trap for asynchronous messages.
+See the source listing
+for further information.
+.TP 7
+.NOP \f\*[B-Font]clrtrap\f[] \f\*[I-Font]address\f[] [\f\*[I-Font]port\f[]] [\f\*[I-Font]interface\f[]]
+Clear a trap for asynchronous messages.
+See the source listing
+for further information.
+.TP 7
+.NOP \f\*[B-Font]reset\f[]
+Clear the statistics counters in various modules of the server.
+See the source listing for further information.
+.PP
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "SEE ALSO"
+\fCntp.conf\fR(5)\f[],
+\fCntpd\fR(@NTPD_MS@)\f[]
+David L. Mills,
+\fINetwork Time Protocol (Version 3)\fR,
+RFC1305
+.PP
+
+.SH AUTHORS
+The formatting directives in this document came from FreeBSD.
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+The
+\f\*[B-Font]ntpdc\fP
+utility is a crude hack.
+Much of the information it shows is
+deadly boring and could only be loved by its implementer.
+The
+program was designed so that new (and temporary) features were easy
+to hack in, at great expense to the program's ease of use.
+Despite
+this, the program is occasionally useful.
+.sp \n(Ppu
+.ne 2
+
+Please report bugs to http://bugs.ntp.org .
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpdc\fP
+option definitions.
diff --git a/ntpdc/ntpdc.mdoc.in b/ntpdc/ntpdc.mdoc.in
new file mode 100644
index 0000000..95b2a23
--- /dev/null
+++ b/ntpdc/ntpdc.mdoc.in
@@ -0,0 +1,809 @@
+.Dd December 2 2014
+.Dt NTPDC @NTPDC_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:57:34 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpdc-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpdc
+.Nd vendor-specific NTPD control program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ host ...]
+.Pp
+.Sh DESCRIPTION
+.Nm
+is deprecated.
+Please use
+.Xr ntpq @NTPQ_MS@ instead \- it can do everything
+.Nm
+used to do, and it does so using a much more sane interface.
+.Pp
+.Nm
+is a utility program used to query
+.Xr ntpd @NTPD_MS@
+about its
+current state and to request changes in that state.
+It uses NTP mode 7 control message formats described in the source code.
+The program may
+be run either in interactive mode or controlled using command line
+arguments.
+Extensive state and statistics information is available
+through the
+.Nm
+interface.
+In addition, nearly all the
+configuration options which can be specified at startup using
+ntpd's configuration file may also be specified at run time using
+.Nm .
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl i , Fl \-interactive
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, listpeers, peers, showpeers.
+.sp
+Force ntpq to operate in interactive mode. Prompts will be written
+to the standard output and commands read from the standard input.
+.It Fl l , Fl \-listpeers
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary of
+their state. This is equivalent to the 'listpeers' interactive command.
+.It Fl n , Fl \-numeric
+numeric host addresses.
+.sp
+Output all host addresses in dotted\-quad numeric format rather than
+converting to the canonical host names.
+.It Fl p , Fl \-peers
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.It Fl s , Fl \-showpeers
+Show a list of the peers.
+This option must not appear in combination with any of the following options:
+command.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'dmpeers' interactive command.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPDC_<option\-name>\fP or \fBNTPDC\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+If one or more request options are included on the command line
+when
+.Nm
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+.Nm
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+.Nm
+utility will prompt for
+commands if the standard input is a terminal device.
+.Pp
+The
+.Nm
+utility uses NTP mode 7 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+.Nm
+utility makes
+no attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+.Pp
+The operation of
+.Nm
+are specific to the particular
+implementation of the
+.Xr ntpd @NTPD_MS@
+daemon and can be expected to
+work only with this and maybe some previous versions of the daemon.
+Requests from a remote
+.Nm
+utility which affect the
+state of the local server must be authenticated, which requires
+both the remote program and local server share a common key and key
+identifier.
+.Pp
+Note that in contexts where a host name is expected, a
+.Fl 4
+qualifier preceding the host name forces DNS resolution to the IPv4 namespace,
+while a
+.Fl 6
+qualifier forces DNS resolution to the IPv6 namespace.
+Specifying a command line option other than
+.Fl i
+or
+.Fl n
+will cause the specified query (queries) to be sent to
+the indicated host(s) immediately.
+Otherwise,
+.Nm
+will
+attempt to read interactive format commands from the standard
+input.
+.Ss "Interactive Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+The output of a
+command is normally sent to the standard output, but optionally the
+output of individual commands may be sent to a file by appending a
+.Ql \&> ,
+followed by a file name, to the command line.
+.Pp
+A number of interactive format commands are executed entirely
+within the
+.Nm
+utility itself and do not result in NTP
+mode 7 requests being sent to a server.
+These are described
+following.
+.Bl -tag -width indent
+.It Ic \&? Ar command_keyword
+.It Ic help Ar command_keyword
+A
+.Sq Ic \&?
+will print a list of all the command
+keywords known to this incarnation of
+.Nm .
+A
+.Sq Ic \&?
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+.Xr ntpq @NTPQ_MS@
+than this manual
+page.
+.It Ic delay Ar milliseconds
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.It Ic host Ar hostname
+Set the host to which future queries will be sent.
+Hostname may
+be either a host name or a numeric address.
+.It Ic hostnames Op Cm yes | Cm no
+If
+.Cm yes
+is specified, host names are printed in
+information displays.
+If
+.Cm no
+is specified, numeric
+addresses are printed instead.
+The default is
+.Cm yes ,
+unless
+modified using the command line
+.Fl n
+switch.
+.It Ic keyid Ar keyid
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.It Ic quit
+Exit
+.Nm .
+.It Ic passwd
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.It Ic timeout Ar milliseconds
+Specify a timeout period for responses to server queries.
+The
+default is about 8000 milliseconds.
+Note that since
+.Nm
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.El
+.Ss "Control Message Commands"
+Query commands result in NTP mode 7 packets containing requests for
+information being sent to the server.
+These are read\-only commands
+in that they make no modification of the server configuration
+state.
+.Bl -tag -width indent
+.It Ic listpeers
+Obtains and prints a brief list of the peers for which the
+server is maintaining state.
+These should include all configured
+peer associations as well as those peers whose stratum is such that
+they are considered by the server to be possible future
+synchronization candidates.
+.It Ic peers
+Obtains a list of peers for which the server is maintaining
+state, along with a summary of that state.
+Summary information
+includes the address of the remote peer, the local interface
+address (0.0.0.0 if a local address has yet to be determined), the
+stratum of the remote peer (a stratum of 16 indicates the remote
+peer is unsynchronized), the polling interval, in seconds, the
+reachability register, in octal, and the current estimated delay,
+offset and dispersion of the peer, all in seconds.
+.Pp
+The character in the left margin indicates the mode this peer
+entry is operating in.
+A
+.Ql \&+
+denotes symmetric active, a
+.Ql \&\-
+indicates symmetric passive, a
+.Ql \&=
+means the
+remote server is being polled in client mode, a
+.Ql \&^
+indicates that the server is broadcasting to this address, a
+.Ql \&~
+denotes that the remote peer is sending broadcasts and a
+.Ql \&~
+denotes that the remote peer is sending broadcasts and a
+.Ql \&*
+marks the peer the server is currently synchronizing
+to.
+.Pp
+The contents of the host field may be one of four forms.
+It may
+be a host name, an IP address, a reference clock implementation
+name with its parameter or
+.Fn REFCLK "implementation_number" "parameter" .
+On
+.Ic hostnames
+.Cm no
+only IP\-addresses
+will be displayed.
+.It Ic dmpeers
+A slightly different peer summary list.
+Identical to the output
+of the
+.Ic peers
+command, except for the character in the
+leftmost column.
+Characters only appear beside peers which were
+included in the final stage of the clock selection algorithm.
+A
+.Ql \&.
+indicates that this peer was cast off in the falseticker
+detection, while a
+.Ql \&+
+indicates that the peer made it
+through.
+A
+.Ql \&*
+denotes the peer the server is currently
+synchronizing with.
+.It Ic showpeer Ar peer_address Oo Ar ... Oc
+Shows a detailed display of the current peer variables for one
+or more peers.
+Most of these values are described in the NTP
+Version 2 specification.
+.It Ic pstats Ar peer_address Oo Ar ... Oc
+Show per\-peer statistic counters associated with the specified
+peer(s).
+.It Ic clockstat Ar clock_peer_address Oo Ar ... Oc
+Obtain and print information concerning a peer clock.
+The
+values obtained provide information on the setting of fudge factors
+and other clock performance information.
+.It Ic kerninfo
+Obtain and print kernel phase\-lock loop operating parameters.
+This information is available only if the kernel has been specially
+modified for a precision timekeeping function.
+.It Ic loopinfo Op Cm oneline | Cm multiline
+Print the values of selected loop filter variables.
+The loop
+filter is the part of NTP which deals with adjusting the local
+system clock.
+The
+.Sq offset
+is the last offset given to the
+loop filter by the packet processing code.
+The
+.Sq frequency
+is the frequency error of the local clock in parts\-per\-million
+(ppm).
+The
+.Sq time_const
+controls the stiffness of the
+phase\-lock loop and thus the speed at which it can adapt to
+oscillator drift.
+The
+.Sq watchdog timer
+value is the number
+of seconds which have elapsed since the last sample offset was
+given to the loop filter.
+The
+.Cm oneline
+and
+.Cm multiline
+options specify the format in which this
+information is to be printed, with
+.Cm multiline
+as the
+default.
+.It Ic sysinfo
+Print a variety of system state variables, i.e., state related
+to the local server.
+All except the last four lines are described
+in the NTP Version 3 specification, RFC\-1305.
+.Pp
+The
+.Sq system flags
+show various system flags, some of
+which can be set and cleared by the
+.Ic enable
+and
+.Ic disable
+configuration commands, respectively.
+These are
+the
+.Cm auth ,
+.Cm bclient ,
+.Cm monitor ,
+.Cm pll ,
+.Cm pps
+and
+.Cm stats
+flags.
+See the
+.Xr ntpd @NTPD_MS@
+documentation for the meaning of these flags.
+There
+are two additional flags which are read only, the
+.Cm kernel_pll
+and
+.Cm kernel_pps .
+These flags indicate
+the synchronization status when the precision time kernel
+modifications are in use.
+The
+.Sq kernel_pll
+indicates that
+the local clock is being disciplined by the kernel, while the
+.Sq kernel_pps
+indicates the kernel discipline is provided by the PPS
+signal.
+.Pp
+The
+.Sq stability
+is the residual frequency error remaining
+after the system frequency correction is applied and is intended for
+maintenance and debugging.
+In most architectures, this value will
+initially decrease from as high as 500 ppm to a nominal value in
+the range .01 to 0.1 ppm.
+If it remains high for some time after
+starting the daemon, something may be wrong with the local clock,
+or the value of the kernel variable
+.Va kern.clockrate.tick
+may be
+incorrect.
+.Pp
+The
+.Sq broadcastdelay
+shows the default broadcast delay,
+as set by the
+.Ic broadcastdelay
+configuration command.
+.Pp
+The
+.Sq authdelay
+shows the default authentication delay,
+as set by the
+.Ic authdelay
+configuration command.
+.It Ic sysstats
+Print statistics counters maintained in the protocol
+module.
+.It Ic memstats
+Print statistics counters related to memory allocation
+code.
+.It Ic iostats
+Print statistics counters maintained in the input\-output
+module.
+.It Ic timerstats
+Print statistics counters maintained in the timer/event queue
+support code.
+.It Ic reslist
+Obtain and print the server's restriction list.
+This list is
+(usually) printed in sorted order and may help to understand how
+the restrictions are applied.
+.It Ic monlist Op Ar version
+Obtain and print traffic counts collected and maintained by the
+monitor facility.
+The version number should not normally need to be
+specified.
+.It Ic clkbug Ar clock_peer_address Oo Ar ... Oc
+Obtain debugging information for a reference clock driver.
+This
+information is provided only by some clock drivers and is mostly
+undecodable without a copy of the driver source in hand.
+.El
+.Ss "Runtime Configuration Requests"
+All requests which cause state changes in the server are
+authenticated by the server using a configured NTP key (the
+facility can also be disabled by the server by not configuring a
+key).
+The key number and the corresponding key must also be made
+known to
+.Nm .
+This can be done using the
+.Ic keyid
+and
+.Ic passwd
+commands, the latter of which will prompt at the terminal for a
+password to use as the encryption key.
+You will also be prompted
+automatically for both the key number and password the first time a
+command which would result in an authenticated request to the
+server is given.
+Authentication not only provides verification that
+the requester has permission to make such changes, but also gives
+an extra degree of protection again transmission errors.
+.Pp
+Authenticated requests always include a timestamp in the packet
+data, which is included in the computation of the authentication
+code.
+This timestamp is compared by the server to its receive time
+stamp.
+If they differ by more than a small amount the request is
+rejected.
+This is done for two reasons.
+First, it makes simple
+replay attacks on the server, by someone who might be able to
+overhear traffic on your LAN, much more difficult.
+Second, it makes
+it more difficult to request configuration changes to your server
+from topologically remote hosts.
+While the reconfiguration facility
+will work well with a server on the local host, and may work
+adequately between time\-synchronized hosts on the same LAN, it will
+work very poorly for more distant hosts.
+As such, if reasonable
+passwords are chosen, care is taken in the distribution and
+protection of keys and appropriate source address restrictions are
+applied, the run time reconfiguration facility should provide an
+adequate level of security.
+.Pp
+The following commands all make authenticated requests.
+.Bl -tag -width indent
+.It Xo Ic addpeer Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Add a configured peer association at the given address and
+operating in symmetric active mode.
+Note that an existing
+association with the same peer may be deleted when this command is
+executed, or may simply be converted to conform to the new
+configuration, as appropriate.
+If the optional
+.Ar keyid
+is a
+nonzero integer, all outgoing packets to the remote server will
+have an authentication field attached encrypted with this key.
+If
+the value is 0 (or not given) no authentication will be done.
+The
+.Ar version
+can be 1, 2 or 3 and defaults to 3.
+The
+.Cm prefer
+keyword indicates a preferred peer (and thus will
+be used primarily for clock synchronisation if possible).
+The
+preferred peer also determines the validity of the PPS signal \- if
+the preferred peer is suitable for synchronisation so is the PPS
+signal.
+.It Xo Ic addserver Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Identical to the addpeer command, except that the operating
+mode is client.
+.It Xo Ic broadcast Ar peer_address
+.Op Ar keyid
+.Op Ar version
+.Op Cm prefer
+.Xc
+Identical to the addpeer command, except that the operating
+mode is broadcast.
+In this case a valid key identifier and key are
+required.
+The
+.Ar peer_address
+parameter can be the broadcast
+address of the local network or a multicast group address assigned
+to NTP.
+If a multicast address, a multicast\-capable kernel is
+required.
+.It Ic unconfig Ar peer_address Oo Ar ... Oc
+This command causes the configured bit to be removed from the
+specified peer(s).
+In many cases this will cause the peer
+association to be deleted.
+When appropriate, however, the
+association may persist in an unconfigured mode if the remote peer
+is willing to continue on in this fashion.
+.It Xo Ic fudge Ar peer_address
+.Op Cm time1
+.Op Cm time2
+.Op Ar stratum
+.Op Ar refid
+.Xc
+This command provides a way to set certain data for a reference
+clock.
+See the source listing for further information.
+.It Xo Ic enable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm monitor | Cm ntp |
+.Cm pps | Cm stats
+.Oc
+.Xc
+.It Xo Ic disable
+.Oo
+.Cm auth | Cm bclient |
+.Cm calibrate | Cm kernel |
+.Cm monitor | Cm ntp |
+.Cm pps | Cm stats
+.Oc
+.Xc
+These commands operate in the same way as the
+.Ic enable
+and
+.Ic disable
+configuration file commands of
+.Xr ntpd @NTPD_MS@ .
+.Bl -tag -width indent
+.It Cm auth
+Enables the server to synchronize with unconfigured peers only
+if the peer has been correctly authenticated using either public key
+or private key cryptography.
+The default for this flag is enable.
+.It Cm bclient
+Enables the server to listen for a message from a broadcast or
+multicast server, as in the multicastclient command with
+default address.
+The default for this flag is disable.
+.It Cm calibrate
+Enables the calibrate feature for reference clocks.
+The default for this flag is disable.
+.It Cm kernel
+Enables the kernel time discipline, if available.
+The default for this flag is enable if support is available, otherwise disable.
+.It Cm monitor
+Enables the monitoring facility.
+See the documentation here about the
+.Cm monlist
+command or further information.
+The default for this flag is enable.
+.It Cm ntp
+Enables time and frequency discipline.
+In effect, this switch opens and closes the feedback loop,
+which is useful for testing.
+The default for this flag is enable.
+.It Cm pps
+Enables the pulse\-per\-second (PPS) signal when frequency
+and time is disciplined by the precision time kernel modifications.
+See the
+.Qq A Kernel Model for Precision Timekeeping
+(available as part of the HTML documentation
+provided in
+.Pa /usr/share/doc/ntp )
+page for further information.
+The default for this flag is disable.
+.It Cm stats
+Enables the statistics facility.
+See the
+.Sx Monitoring Options
+section of
+.Xr ntp.conf 5
+for further information.
+The default for this flag is disable.
+.El
+.It Xo Ic restrict Ar address Ar mask
+.Ar flag Oo Ar ... Oc
+.Xc
+This command operates in the same way as the
+.Ic restrict
+configuration file commands of
+.Xr ntpd @NTPD_MS@ .
+.It Xo Ic unrestrict Ar address Ar mask
+.Ar flag Oo Ar ... Oc
+.Xc
+Unrestrict the matching entry from the restrict list.
+.It Xo Ic delrestrict Ar address Ar mask
+.Op Cm ntpport
+.Xc
+Delete the matching entry from the restrict list.
+.It Ic readkeys
+Causes the current set of authentication keys to be purged and
+a new set to be obtained by rereading the keys file (which must
+have been specified in the
+.Xr ntpd @NTPD_MS@
+configuration file).
+This
+allows encryption keys to be changed without restarting the
+server.
+.It Ic trustedkey Ar keyid Oo Ar ... Oc
+.It Ic untrustedkey Ar keyid Oo Ar ... Oc
+These commands operate in the same way as the
+.Ic trustedkey
+and
+.Ic untrustedkey
+configuration file
+commands of
+.Xr ntpd @NTPD_MS@ .
+.It Ic authinfo
+Returns information concerning the authentication module,
+including known keys and counts of encryptions and decryptions
+which have been done.
+.It Ic traps
+Display the traps set in the server.
+See the source listing for
+further information.
+.It Xo Ic addtrap Ar address
+.Op Ar port
+.Op Ar interface
+.Xc
+Set a trap for asynchronous messages.
+See the source listing
+for further information.
+.It Xo Ic clrtrap Ar address
+.Op Ar port
+.Op Ar interface
+.Xc
+Clear a trap for asynchronous messages.
+See the source listing
+for further information.
+.It Ic reset
+Clear the statistics counters in various modules of the server.
+See the source listing for further information.
+.El
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "SEE ALSO"
+.Xr ntp.conf 5 ,
+.Xr ntpd @NTPD_MS@
+.Rs
+.%A David L. Mills
+.%T Network Time Protocol (Version 3)
+.%O RFC1305
+.Re
+.Sh AUTHORS
+The formatting directives in this document came from FreeBSD.
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+The
+.Nm
+utility is a crude hack.
+Much of the information it shows is
+deadly boring and could only be loved by its implementer.
+The
+program was designed so that new (and temporary) features were easy
+to hack in, at great expense to the program's ease of use.
+Despite
+this, the program is occasionally useful.
+.Pp
+Please report bugs to http://bugs.ntp.org .
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpdc\fP
+option definitions.
diff --git a/ntpdc/ntpdc.texi b/ntpdc/ntpdc.texi
new file mode 100644
index 0000000..3a82806
--- /dev/null
+++ b/ntpdc/ntpdc.texi
@@ -0,0 +1,88 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntpdc.info
+@settitle ntpdc: NTPD Control User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of the NTP Project's ntpdc, a program for
+controlling ntpd.
+@end ifinfo
+
+@direntry
+* ntpdc: (ntpdc). ntpd Control program
+@end direntry
+
+@titlepage
+@title ntpdc: NTPD Control User's Manual
+@subtitle ntpdc, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntpdc Description, (dir), (dir)
+@top ntpdc: NTPD Control User Manual
+
+This document describes the use of the NTP Project's @code{ntpdc} program,
+that can be used to query a Network Time Protocol (NTP) server and
+display the time offset of the system clock relative to the server
+clock. Run as root, it can correct the system clock to this offset as
+well. It can be run as an interactive command or from a cron job.
+
+This document applies to version @value{VERSION} of @code{ntpdc}.
+
+The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
+IETF specification.
+
+@shortcontents
+
+@menu
+* ntpdc Description:: Description
+* ntpdc Invocation:: Invoking ntpdc
+* Usage:: Usage
+@end menu
+
+@node ntpdc Description
+@comment node-name, next, previous, up
+@section Description
+
+By default, @code{ntpdc} writes the local data and time (i.e., not UTC) to the
+standard output in the format:
+
+@example
+1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
+@end example
+
+where
+YYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
+(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
+and
+the +4.567 +/- 0.089 secs indicates the time offset and
+error bound of the system clock relative to the server clock.
+
+@include invoke-ntpdc.texi
+
+@node Usage
+@comment node-name, next, previous, up
+@section Usage
+
+The simplest use of this program is as an unprivileged command to
+check the current time, offset, and error in the local clock.
+For example:
+
+@example
+ntpdc ntpserver.somewhere
+@end example
+
+With suitable privilege, it can be run as a command or in a
+@code{cron} job to reset the local clock from a reliable server, like
+the @code{ntpdate} and @code{rdate} commands.
+For example:
+
+@example
+ntpdc -a ntpserver.somewhere
+@end example
diff --git a/ntpdc/ntpdc_ops.c b/ntpdc/ntpdc_ops.c
new file mode 100644
index 0000000..b0e7af0
--- /dev/null
+++ b/ntpdc/ntpdc_ops.c
@@ -0,0 +1,3142 @@
+/*
+ * ntpdc_ops.c - subroutines which are called to perform operations by
+ * ntpdc
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+
+#include "ntpdc.h"
+#include "ntp_net.h"
+#include "ntp_control.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+
+#include <ctype.h>
+#ifdef HAVE_SYS_TIMEX_H
+# include <sys/timex.h>
+#endif
+#if !defined(__bsdi__) && !defined(apollo)
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#endif
+
+#include <arpa/inet.h>
+
+/*
+ * utility functions
+ */
+static int checkitems (int, FILE *);
+static int checkitemsize (int, int);
+static int check1item (int, FILE *);
+
+/*
+ * Declarations for command handlers in here
+ */
+static void peerlist (struct parse *, FILE *);
+static void peers (struct parse *, FILE *);
+static void doconfig (struct parse *pcmd, FILE *fp, int mode, int refc);
+static void dmpeers (struct parse *, FILE *);
+static void dopeers (struct parse *, FILE *, int);
+static void printpeer (struct info_peer *, FILE *);
+static void showpeer (struct parse *, FILE *);
+static void peerstats (struct parse *, FILE *);
+static void loopinfo (struct parse *, FILE *);
+static void sysinfo (struct parse *, FILE *);
+static void sysstats (struct parse *, FILE *);
+static void iostats (struct parse *, FILE *);
+static void memstats (struct parse *, FILE *);
+static void timerstats (struct parse *, FILE *);
+static void addpeer (struct parse *, FILE *);
+static void addserver (struct parse *, FILE *);
+static void addrefclock (struct parse *, FILE *);
+static void broadcast (struct parse *, FILE *);
+static void doconfig (struct parse *, FILE *, int, int);
+static void unconfig (struct parse *, FILE *);
+static void set (struct parse *, FILE *);
+static void sys_clear (struct parse *, FILE *);
+static void doset (struct parse *, FILE *, int);
+static void reslist (struct parse *, FILE *);
+static void new_restrict (struct parse *, FILE *);
+static void unrestrict (struct parse *, FILE *);
+static void delrestrict (struct parse *, FILE *);
+static void do_restrict (struct parse *, FILE *, int);
+static void monlist (struct parse *, FILE *);
+static void reset (struct parse *, FILE *);
+static void preset (struct parse *, FILE *);
+static void readkeys (struct parse *, FILE *);
+static void trustkey (struct parse *, FILE *);
+static void untrustkey (struct parse *, FILE *);
+static void do_trustkey (struct parse *, FILE *, int);
+static void authinfo (struct parse *, FILE *);
+static void traps (struct parse *, FILE *);
+static void addtrap (struct parse *, FILE *);
+static void clrtrap (struct parse *, FILE *);
+static void do_addclr_trap (struct parse *, FILE *, int);
+static void requestkey (struct parse *, FILE *);
+static void controlkey (struct parse *, FILE *);
+static void do_changekey (struct parse *, FILE *, int);
+static void ctlstats (struct parse *, FILE *);
+static void clockstat (struct parse *, FILE *);
+static void fudge (struct parse *, FILE *);
+static void clkbug (struct parse *, FILE *);
+static void kerninfo (struct parse *, FILE *);
+static void get_if_stats (struct parse *, FILE *);
+static void do_if_reload (struct parse *, FILE *);
+
+/*
+ * Commands we understand. Ntpdc imports this.
+ */
+struct xcmd opcmds[] = {
+ { "listpeers", peerlist, { OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "display list of peers the server knows about [IP Version]" },
+ { "peers", peers, { OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "display peer summary information [IP Version]" },
+ { "dmpeers", dmpeers, { OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "display peer summary info the way Dave Mills likes it (IP Version)" },
+ { "showpeer", showpeer, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD},
+ { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" },
+ "display detailed information for one or more peers" },
+ { "pstats", peerstats, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD },
+ { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" },
+ "display statistical information for one or more peers" },
+ { "loopinfo", loopinfo, { OPT|NTP_STR, NO, NO, NO },
+ { "oneline|multiline", "", "", "" },
+ "display loop filter information" },
+ { "sysinfo", sysinfo, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display local server information" },
+ { "sysstats", sysstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display local server statistics" },
+ { "memstats", memstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display peer memory usage statistics" },
+ { "iostats", iostats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display I/O subsystem statistics" },
+ { "timerstats", timerstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display event timer subsystem statistics" },
+ { "addpeer", addpeer, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR },
+ { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." },
+ "configure a new peer association" },
+ { "addserver", addserver, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR },
+ { "addr", "keyid", "version", "minpoll#|prefer|burst|iburst|'minpoll N'|'maxpoll N'|'keyid N'|'version N' ..." },
+ "configure a new server" },
+ { "addrefclock",addrefclock, { NTP_ADD, OPT|NTP_UINT, OPT|NTP_STR, OPT|NTP_STR },
+ { "addr", "mode", "minpoll|prefer", "minpoll|prefer" },
+ "configure a new server" },
+ { "broadcast", broadcast, { NTP_ADD, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR },
+ { "addr", "keyid", "version", "minpoll" },
+ "configure broadcasting time service" },
+ { "unconfig", unconfig, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD },
+ { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" },
+ "unconfigure existing peer assocations" },
+ { "enable", set, { NTP_STR, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR },
+ { "auth|bclient|monitor|pll|kernel|stats", "...", "...", "..." },
+ "set a system flag (auth, bclient, monitor, pll, kernel, stats)" },
+ { "disable", sys_clear, { NTP_STR, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR },
+ { "auth|bclient|monitor|pll|kernel|stats", "...", "...", "..." },
+ "clear a system flag (auth, bclient, monitor, pll, kernel, stats)" },
+ { "reslist", reslist, {OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "display the server's restrict list" },
+ { "restrict", new_restrict, { NTP_ADD, NTP_ADD, NTP_STR, OPT|NTP_STR },
+ { "address", "mask",
+ "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer|version|kod",
+ "..." },
+ "create restrict entry/add flags to entry" },
+ { "unrestrict", unrestrict, { NTP_ADD, NTP_ADD, NTP_STR, OPT|NTP_STR },
+ { "address", "mask",
+ "ntpport|ignore|noserve|notrust|noquery|nomodify|nopeer|version|kod",
+ "..." },
+ "remove flags from a restrict entry" },
+ { "delrestrict", delrestrict, { NTP_ADD, NTP_ADD, OPT|NTP_STR, NO },
+ { "address", "mask", "ntpport", "" },
+ "delete a restrict entry" },
+ { "monlist", monlist, { OPT|NTP_INT, NO, NO, NO },
+ { "version", "", "", "" },
+ "display data the server's monitor routines have collected" },
+ { "reset", reset, { NTP_STR, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR },
+ { "io|sys|mem|timer|auth|ctl|allpeers", "...", "...", "..." },
+ "reset various subsystem statistics counters" },
+ { "preset", preset, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD },
+ { "peer_address", "peer2_addr", "peer3_addr", "peer4_addr" },
+ "reset stat counters associated with particular peer(s)" },
+ { "readkeys", readkeys, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "request a reread of the keys file and re-init of system keys" },
+ { "trustedkey", trustkey, { NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT },
+ { "keyid", "keyid", "keyid", "keyid" },
+ "add one or more key ID's to the trusted list" },
+ { "untrustedkey", untrustkey, { NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT, OPT|NTP_UINT },
+ { "keyid", "keyid", "keyid", "keyid" },
+ "remove one or more key ID's from the trusted list" },
+ { "authinfo", authinfo, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display the state of the authentication code" },
+ { "traps", traps, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display the traps set in the server" },
+ { "addtrap", addtrap, { NTP_ADD, OPT|NTP_UINT, OPT|NTP_ADD, NO },
+ { "address", "port", "interface", "" },
+ "configure a trap in the server" },
+ { "clrtrap", clrtrap, { NTP_ADD, OPT|NTP_UINT, OPT|NTP_ADD, NO },
+ { "address", "port", "interface", "" },
+ "remove a trap (configured or otherwise) from the server" },
+ { "requestkey", requestkey, { NTP_UINT, NO, NO, NO },
+ { "keyid", "", "", "" },
+ "change the keyid the server uses to authenticate requests" },
+ { "controlkey", controlkey, { NTP_UINT, NO, NO, NO },
+ { "keyid", "", "", "" },
+ "change the keyid the server uses to authenticate control messages" },
+ { "ctlstats", ctlstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display packet count statistics from the control module" },
+ { "clockstat", clockstat, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD },
+ { "address", "address", "address", "address" },
+ "display clock status information" },
+ { "fudge", fudge, { NTP_ADD, NTP_STR, NTP_STR, NO },
+ { "address", "time1|time2|val1|val2|flags", "value", "" },
+ "set/change one of a clock's fudge factors" },
+ { "clkbug", clkbug, { NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD, OPT|NTP_ADD },
+ { "address", "address", "address", "address" },
+ "display clock debugging information" },
+ { "kerninfo", kerninfo, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display the kernel pll/pps variables" },
+ { "ifstats", get_if_stats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "list interface statistics" },
+ { "ifreload", do_if_reload, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "reload interface configuration" },
+ { 0, 0, { NO, NO, NO, NO },
+ { "", "", "", "" }, "" }
+};
+
+/*
+ * For quick string comparisons
+ */
+#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
+
+/*
+ * SET_SS_LEN_IF_PRESENT - used by SET_ADDR, SET_ADDRS macros
+ */
+
+#ifdef ISC_PLATFORM_HAVESALEN
+#define SET_SS_LEN_IF_PRESENT(psau) \
+ do { \
+ (psau)->sa.sa_len = SOCKLEN(psau); \
+ } while (0)
+#else
+#define SET_SS_LEN_IF_PRESENT(psau) do { } while (0)
+#endif
+
+/*
+ * SET_ADDR - setup address for v4/v6 as needed
+ */
+#define SET_ADDR(address, v6flag, v4addr, v6addr) \
+do { \
+ ZERO(address); \
+ if (v6flag) { \
+ AF(&(address)) = AF_INET6; \
+ SOCK_ADDR6(&(address)) = (v6addr); \
+ } else { \
+ AF(&(address)) = AF_INET; \
+ NSRCADR(&(address)) = (v4addr); \
+ } \
+ SET_SS_LEN_IF_PRESENT(&(address)); \
+} while (0)
+
+
+/*
+ * SET_ADDRS - setup source and destination addresses for
+ * v4/v6 as needed
+ */
+#define SET_ADDRS(a1, a2, info, a1prefix, a2prefix) \
+do { \
+ ZERO(a1); \
+ ZERO(a2); \
+ if ((info)->v6_flag) { \
+ AF(&(a1)) = AF_INET6; \
+ AF(&(a2)) = AF_INET6; \
+ SOCK_ADDR6(&(a1)) = (info)->a1prefix##6; \
+ SOCK_ADDR6(&(a2)) = (info)->a2prefix##6; \
+ } else { \
+ AF(&(a1)) = AF_INET; \
+ AF(&(a2)) = AF_INET; \
+ NSRCADR(&(a1)) = (info)->a1prefix; \
+ NSRCADR(&(a2)) = (info)->a2prefix; \
+ } \
+ SET_SS_LEN_IF_PRESENT(&(a1)); \
+ SET_SS_LEN_IF_PRESENT(&(a2)); \
+} while (0)
+
+
+/*
+ * checkitems - utility to print a message if no items were returned
+ */
+static int
+checkitems(
+ int items,
+ FILE *fp
+ )
+{
+ if (items == 0) {
+ (void) fprintf(fp, "No data returned in response to query\n");
+ return 0;
+ }
+ return 1;
+}
+
+
+/*
+ * checkitemsize - utility to print a message if the item size is wrong
+ */
+static int
+checkitemsize(
+ int itemsize,
+ int expected
+ )
+{
+ if (itemsize != expected) {
+ (void) fprintf(stderr,
+ "***Incorrect item size returned by remote host (%d should be %d)\n",
+ itemsize, expected);
+ return 0;
+ }
+ return 1;
+}
+
+
+/*
+ * check1item - check to make sure we have exactly one item
+ */
+static int
+check1item(
+ int items,
+ FILE *fp
+ )
+{
+ if (items == 0) {
+ (void) fprintf(fp, "No data returned in response to query\n");
+ return 0;
+ }
+ if (items > 1) {
+ (void) fprintf(fp, "Expected one item in response, got %d\n",
+ items);
+ return 0;
+ }
+ return 1;
+}
+
+
+/*
+ * peerlist - get a short list of peers
+ */
+/*ARGSUSED*/
+static void
+peerlist(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_peer_list *plist;
+ sockaddr_u paddr;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_PEER_LIST, 0, 0, 0, (char *)NULL, &items,
+ &itemsize, (void *)&plist, 0,
+ sizeof(struct info_peer_list));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_peer_list)) &&
+ !checkitemsize(itemsize, v4sizeof(struct info_peer_list)))
+ return;
+
+ while (items > 0) {
+ SET_ADDR(paddr, plist->v6_flag, plist->addr, plist->addr6);
+ if ((pcmd->nargs == 0) ||
+ ((pcmd->argval->ival == 6) && (plist->v6_flag != 0)) ||
+ ((pcmd->argval->ival == 4) && (plist->v6_flag == 0)))
+ (void) fprintf(fp, "%-9s %s\n",
+ modetoa(plist->hmode),
+ nntohost(&paddr));
+ plist++;
+ items--;
+ }
+}
+
+
+/*
+ * peers - show peer summary
+ */
+static void
+peers(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ dopeers(pcmd, fp, 0);
+}
+
+/*
+ * dmpeers - show peer summary, Dave Mills style
+ */
+static void
+dmpeers(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ dopeers(pcmd, fp, 1);
+}
+
+
+/*
+ * peers - show peer summary
+ */
+/*ARGSUSED*/
+static void
+dopeers(
+ struct parse *pcmd,
+ FILE *fp,
+ int dmstyle
+ )
+{
+ struct info_peer_summary *plist;
+ sockaddr_u dstadr;
+ sockaddr_u srcadr;
+ int items;
+ int itemsize;
+ int ntp_poll;
+ int res;
+ int c;
+ l_fp tempts;
+
+again:
+ res = doquery(impl_ver, REQ_PEER_LIST_SUM, 0, 0, 0, (char *)NULL,
+ &items, &itemsize, (void *)&plist, 0,
+ sizeof(struct info_peer_summary));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_peer_summary)) &&
+ !checkitemsize(itemsize, v4sizeof(struct info_peer_summary)))
+ return;
+
+ (void) fprintf(fp,
+ " remote local st poll reach delay offset disp\n");
+ (void) fprintf(fp,
+ "=======================================================================\n");
+ while (items > 0) {
+ if (!dmstyle) {
+ if (plist->flags & INFO_FLAG_SYSPEER)
+ c = '*';
+ else if (plist->hmode == MODE_ACTIVE)
+ c = '+';
+ else if (plist->hmode == MODE_PASSIVE)
+ c = '-';
+ else if (plist->hmode == MODE_CLIENT)
+ c = '=';
+ else if (plist->hmode == MODE_BROADCAST)
+ c = '^';
+ else if (plist->hmode == MODE_BCLIENT)
+ c = '~';
+ else
+ c = ' ';
+ } else {
+ if (plist->flags & INFO_FLAG_SYSPEER)
+ c = '*';
+ else if (plist->flags & INFO_FLAG_SHORTLIST)
+ c = '+';
+ else if (plist->flags & INFO_FLAG_SEL_CANDIDATE)
+ c = '.';
+ else
+ c = ' ';
+ }
+ NTOHL_FP(&(plist->offset), &tempts);
+ ntp_poll = 1<<max(min3(plist->ppoll, plist->hpoll, NTP_MAXPOLL),
+ NTP_MINPOLL);
+ SET_ADDRS(dstadr, srcadr, plist, dstadr, srcadr);
+ if ((pcmd->nargs == 0) ||
+ ((pcmd->argval->ival == 6) && (plist->v6_flag != 0)) ||
+ ((pcmd->argval->ival == 4) && (plist->v6_flag == 0)))
+ (void) fprintf(fp,
+ "%c%-15.15s %-15.15s %2u %4d %3o %7.7s %9.9s %7.7s\n",
+ c, nntohost(&srcadr), stoa(&dstadr),
+ plist->stratum, ntp_poll, plist->reach,
+ fptoa(NTOHS_FP(plist->delay), 5),
+ lfptoa(&tempts, 6),
+ ufptoa(NTOHS_FP(plist->dispersion), 5));
+ plist++;
+ items--;
+ }
+}
+
+/* Convert a refid & stratum (in host order) to a string */
+static char *
+refid_string(
+ u_int32 refid,
+ int stratum
+ )
+{
+ if (stratum <= 1) {
+ static char junk[5];
+ junk[4] = 0;
+ memcpy(junk, &refid, 4);
+ return junk;
+ }
+
+ return numtoa(refid);
+}
+
+static void
+print_pflag(
+ FILE * fp,
+ u_int32 flags
+ )
+{
+ static const char none[] = "";
+ static const char comma[] = ",";
+ const char *dlim;
+
+ if (0 == flags) {
+ fprintf(fp, " none\n");
+ return;
+ }
+ dlim = none;
+ if (flags & INFO_FLAG_SYSPEER) {
+ fprintf(fp, " system_peer");
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_CONFIG) {
+ fprintf(fp, "%s config", dlim);
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_REFCLOCK) {
+ fprintf(fp, "%s refclock", dlim);
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_AUTHENABLE) {
+ fprintf(fp, "%s auth", dlim);
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_PREFER) {
+ fprintf(fp, "%s prefer", dlim);
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_IBURST) {
+ fprintf(fp, "%s iburst", dlim);
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_BURST) {
+ fprintf(fp, "%s burst", dlim);
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_SEL_CANDIDATE) {
+ fprintf(fp, "%s candidate", dlim);
+ dlim = comma;
+ }
+ if (flags & INFO_FLAG_SHORTLIST) {
+ fprintf(fp, "%s shortlist", dlim);
+ dlim = comma;
+ }
+ fprintf(fp, "\n");
+}
+/*
+ * printpeer - print detail information for a peer
+ */
+static void
+printpeer(
+ register struct info_peer *pp,
+ FILE *fp
+ )
+{
+ register int i;
+ l_fp tempts;
+ sockaddr_u srcadr, dstadr;
+
+ SET_ADDRS(dstadr, srcadr, pp, dstadr, srcadr);
+
+ (void) fprintf(fp, "remote %s, local %s\n",
+ stoa(&srcadr), stoa(&dstadr));
+ (void) fprintf(fp, "hmode %s, pmode %s, stratum %d, precision %d\n",
+ modetoa(pp->hmode), modetoa(pp->pmode),
+ pp->stratum, pp->precision);
+
+ (void) fprintf(fp,
+ "leap %c%c, refid [%s], rootdistance %s, rootdispersion %s\n",
+ pp->leap & 0x2 ? '1' : '0',
+ pp->leap & 0x1 ? '1' : '0',
+ refid_string(pp->refid, pp->stratum), fptoa(NTOHS_FP(pp->rootdelay), 5),
+ ufptoa(NTOHS_FP(pp->rootdispersion), 5));
+
+ (void) fprintf(fp,
+ "ppoll %d, hpoll %d, keyid %lu, version %d, association %u\n",
+ pp->ppoll, pp->hpoll, (u_long)pp->keyid, pp->version, ntohs(pp->associd));
+
+ (void) fprintf(fp,
+ "reach %03o, unreach %d, flash 0x%04x, ",
+ pp->reach, pp->unreach, pp->flash2);
+
+ (void) fprintf(fp, "boffset %s, ttl/mode %d\n",
+ fptoa(NTOHS_FP(pp->estbdelay), 5), pp->ttl);
+
+ (void) fprintf(fp, "timer %lds, flags", (long)ntohl(pp->timer));
+ print_pflag(fp, pp->flags);
+
+ NTOHL_FP(&pp->reftime, &tempts);
+ (void) fprintf(fp, "reference time: %s\n",
+ prettydate(&tempts));
+ NTOHL_FP(&pp->org, &tempts);
+ (void) fprintf(fp, "originate timestamp: %s\n",
+ prettydate(&tempts));
+ NTOHL_FP(&pp->rec, &tempts);
+ (void) fprintf(fp, "receive timestamp: %s\n",
+ prettydate(&tempts));
+ NTOHL_FP(&pp->xmt, &tempts);
+ (void) fprintf(fp, "transmit timestamp: %s\n",
+ prettydate(&tempts));
+
+ (void) fprintf(fp, "filter delay: ");
+ for (i = 0; i < NTP_SHIFT; i++) {
+ (void) fprintf(fp, " %-8.8s",
+ fptoa(NTOHS_FP(pp->filtdelay[i]), 5));
+ if (i == (NTP_SHIFT>>1)-1)
+ (void) fprintf(fp, "\n ");
+ }
+ (void) fprintf(fp, "\n");
+
+ (void) fprintf(fp, "filter offset:");
+ for (i = 0; i < NTP_SHIFT; i++) {
+ NTOHL_FP(&pp->filtoffset[i], &tempts);
+ (void) fprintf(fp, " %-8.8s", lfptoa(&tempts, 6));
+ if (i == (NTP_SHIFT>>1)-1)
+ (void) fprintf(fp, "\n ");
+ }
+ (void) fprintf(fp, "\n");
+
+ (void) fprintf(fp, "filter order: ");
+ for (i = 0; i < NTP_SHIFT; i++) {
+ (void) fprintf(fp, " %-8d", pp->order[i]);
+ if (i == (NTP_SHIFT>>1)-1)
+ (void) fprintf(fp, "\n ");
+ }
+ (void) fprintf(fp, "\n");
+
+
+ NTOHL_FP(&pp->offset, &tempts);
+ (void) fprintf(fp,
+ "offset %s, delay %s, error bound %s, filter error %s\n",
+ lfptoa(&tempts, 6), fptoa(NTOHS_FP(pp->delay), 5),
+ ufptoa(NTOHS_FP(pp->dispersion), 5),
+ ufptoa(NTOHS_FP(pp->selectdisp), 5));
+}
+
+
+/*
+ * showpeer - show detailed information for a peer
+ */
+static void
+showpeer(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_peer *pp;
+ /* 4 is the maximum number of peers which will fit in a packet */
+ struct info_peer_list *pl, plist[min(MAXARGS, 4)];
+ int qitemlim;
+ int qitems;
+ int items;
+ int itemsize;
+ int res;
+ int sendsize;
+
+again:
+ if (impl_ver == IMPL_XNTPD)
+ sendsize = sizeof(struct info_peer_list);
+ else
+ sendsize = v4sizeof(struct info_peer_list);
+
+ qitemlim = min(pcmd->nargs, COUNTOF(plist));
+ for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) {
+ if (IS_IPV4(&pcmd->argval[qitems].netnum)) {
+ pl->addr = NSRCADR(&pcmd->argval[qitems].netnum);
+ if (impl_ver == IMPL_XNTPD)
+ pl->v6_flag = 0;
+ } else {
+ if (impl_ver == IMPL_XNTPD_OLD) {
+ fprintf(stderr,
+ "***Server doesn't understand IPv6 addresses\n");
+ return;
+ }
+ pl->addr6 = SOCK_ADDR6(&pcmd->argval[qitems].netnum);
+ pl->v6_flag = 1;
+ }
+ pl->port = (u_short)s_port;
+ pl->hmode = pl->flags = 0;
+ pl = (void *)((char *)pl + sendsize);
+ }
+
+ res = doquery(impl_ver, REQ_PEER_INFO, 0, qitems,
+ sendsize, (char *)plist, &items,
+ &itemsize, (void *)&pp, 0, sizeof(struct info_peer));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_peer)) &&
+ !checkitemsize(itemsize, v4sizeof(struct info_peer)))
+ return;
+
+ while (items-- > 0) {
+ printpeer(pp, fp);
+ if (items > 0)
+ fprintf(fp, "\n");
+ pp++;
+ }
+}
+
+
+/*
+ * peerstats - return statistics for a peer
+ */
+static void
+peerstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_peer_stats *pp;
+ /* 4 is the maximum number of peers which will fit in a packet */
+ struct info_peer_list *pl, plist[min(MAXARGS, 4)];
+ sockaddr_u src, dst;
+ int qitemlim;
+ int qitems;
+ int items;
+ int itemsize;
+ int res;
+ int sendsize;
+
+again:
+ if (impl_ver == IMPL_XNTPD)
+ sendsize = sizeof(struct info_peer_list);
+ else
+ sendsize = v4sizeof(struct info_peer_list);
+
+ ZERO(plist);
+
+ qitemlim = min(pcmd->nargs, COUNTOF(plist));
+ for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) {
+ if (IS_IPV4(&pcmd->argval[qitems].netnum)) {
+ pl->addr = NSRCADR(&pcmd->argval[qitems].netnum);
+ if (impl_ver == IMPL_XNTPD)
+ pl->v6_flag = 0;
+ } else {
+ if (impl_ver == IMPL_XNTPD_OLD) {
+ fprintf(stderr,
+ "***Server doesn't understand IPv6 addresses\n");
+ return;
+ }
+ pl->addr6 = SOCK_ADDR6(&pcmd->argval[qitems].netnum);
+ pl->v6_flag = 1;
+ }
+ pl->port = (u_short)s_port;
+ pl->hmode = plist[qitems].flags = 0;
+ pl = (void *)((char *)pl + sendsize);
+ }
+
+ res = doquery(impl_ver, REQ_PEER_STATS, 0, qitems,
+ sendsize, (char *)plist, &items,
+ &itemsize, (void *)&pp, 0,
+ sizeof(struct info_peer_stats));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_peer_stats)) &&
+ !checkitemsize(itemsize, v4sizeof(struct info_peer_stats)))
+ return;
+
+ while (items-- > 0) {
+ ZERO_SOCK(&dst);
+ ZERO_SOCK(&src);
+ if (pp->v6_flag != 0) {
+ AF(&dst) = AF_INET6;
+ AF(&src) = AF_INET6;
+ SOCK_ADDR6(&dst) = pp->dstadr6;
+ SOCK_ADDR6(&src) = pp->srcadr6;
+ } else {
+ AF(&dst) = AF_INET;
+ AF(&src) = AF_INET;
+ NSRCADR(&dst) = pp->dstadr;
+ NSRCADR(&src) = pp->srcadr;
+ }
+#ifdef ISC_PLATFORM_HAVESALEN
+ src.sa.sa_len = SOCKLEN(&src);
+ dst.sa.sa_len = SOCKLEN(&dst);
+#endif
+ fprintf(fp, "remote host: %s\n",
+ nntohost(&src));
+ fprintf(fp, "local interface: %s\n",
+ stoa(&dst));
+ fprintf(fp, "time last received: %lus\n",
+ (u_long)ntohl(pp->timereceived));
+ fprintf(fp, "time until next send: %lus\n",
+ (u_long)ntohl(pp->timetosend));
+ fprintf(fp, "reachability change: %lus\n",
+ (u_long)ntohl(pp->timereachable));
+ fprintf(fp, "packets sent: %lu\n",
+ (u_long)ntohl(pp->sent));
+ fprintf(fp, "packets received: %lu\n",
+ (u_long)ntohl(pp->processed));
+ fprintf(fp, "bad authentication: %lu\n",
+ (u_long)ntohl(pp->badauth));
+ fprintf(fp, "bogus origin: %lu\n",
+ (u_long)ntohl(pp->bogusorg));
+ fprintf(fp, "duplicate: %lu\n",
+ (u_long)ntohl(pp->oldpkt));
+ fprintf(fp, "bad dispersion: %lu\n",
+ (u_long)ntohl(pp->seldisp));
+ fprintf(fp, "bad reference time: %lu\n",
+ (u_long)ntohl(pp->selbroken));
+ fprintf(fp, "candidate order: %u\n",
+ pp->candidate);
+ if (items > 0)
+ fprintf(fp, "\n");
+ fprintf(fp, "flags: ");
+ print_pflag(fp, ntohs(pp->flags));
+ pp++;
+ }
+}
+
+
+/*
+ * loopinfo - show loop filter information
+ */
+static void
+loopinfo(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_loop *il;
+ int items;
+ int itemsize;
+ int oneline = 0;
+ int res;
+ l_fp tempts;
+
+ if (pcmd->nargs > 0) {
+ if (STREQ(pcmd->argval[0].string, "oneline"))
+ oneline = 1;
+ else if (STREQ(pcmd->argval[0].string, "multiline"))
+ oneline = 0;
+ else {
+ (void) fprintf(stderr, "How many lines?\n");
+ return;
+ }
+ }
+
+again:
+ res = doquery(impl_ver, REQ_LOOP_INFO, 0, 0, 0, (char *)NULL,
+ &items, &itemsize, (void *)&il, 0,
+ sizeof(struct info_loop));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_loop)))
+ return;
+
+ if (oneline) {
+ l_fp temp2ts;
+
+ NTOHL_FP(&il->last_offset, &tempts);
+ NTOHL_FP(&il->drift_comp, &temp2ts);
+
+ (void) fprintf(fp,
+ "offset %s, frequency %s, time_const %ld, watchdog %ld\n",
+ lfptoa(&tempts, 6),
+ lfptoa(&temp2ts, 3),
+ (long)(int32)ntohl((u_long)il->compliance),
+ (u_long)ntohl((u_long)il->watchdog_timer));
+ } else {
+ NTOHL_FP(&il->last_offset, &tempts);
+ (void) fprintf(fp, "offset: %s s\n",
+ lfptoa(&tempts, 6));
+ NTOHL_FP(&il->drift_comp, &tempts);
+ (void) fprintf(fp, "frequency: %s ppm\n",
+ lfptoa(&tempts, 3));
+ (void) fprintf(fp, "poll adjust: %ld\n",
+ (long)(int32)ntohl(il->compliance));
+ (void) fprintf(fp, "watchdog timer: %ld s\n",
+ (u_long)ntohl(il->watchdog_timer));
+ }
+}
+
+
+/*
+ * sysinfo - show current system state
+ */
+/*ARGSUSED*/
+static void
+sysinfo(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_sys *is;
+ sockaddr_u peeraddr;
+ int items;
+ int itemsize;
+ int res;
+ l_fp tempts;
+
+again:
+ res = doquery(impl_ver, REQ_SYS_INFO, 0, 0, 0, (char *)NULL,
+ &items, &itemsize, (void *)&is, 0,
+ sizeof(struct info_sys));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_sys)) &&
+ !checkitemsize(itemsize, v4sizeof(struct info_sys)))
+ return;
+
+ SET_ADDR(peeraddr, is->v6_flag, is->peer, is->peer6);
+
+ (void) fprintf(fp, "system peer: %s\n", nntohost(&peeraddr));
+ (void) fprintf(fp, "system peer mode: %s\n", modetoa(is->peer_mode));
+ (void) fprintf(fp, "leap indicator: %c%c\n",
+ is->leap & 0x2 ? '1' : '0',
+ is->leap & 0x1 ? '1' : '0');
+ (void) fprintf(fp, "stratum: %d\n", (int)is->stratum);
+ (void) fprintf(fp, "precision: %d\n", (int)is->precision);
+ (void) fprintf(fp, "root distance: %s s\n",
+ fptoa(NTOHS_FP(is->rootdelay), 5));
+ (void) fprintf(fp, "root dispersion: %s s\n",
+ ufptoa(NTOHS_FP(is->rootdispersion), 5));
+ (void) fprintf(fp, "reference ID: [%s]\n",
+ refid_string(is->refid, is->stratum));
+ NTOHL_FP(&is->reftime, &tempts);
+ (void) fprintf(fp, "reference time: %s\n", prettydate(&tempts));
+
+ (void) fprintf(fp, "system flags: ");
+ if ((is->flags & (INFO_FLAG_BCLIENT | INFO_FLAG_AUTHENABLE |
+ INFO_FLAG_NTP | INFO_FLAG_KERNEL| INFO_FLAG_CAL |
+ INFO_FLAG_PPS_SYNC | INFO_FLAG_MONITOR | INFO_FLAG_FILEGEN)) == 0) {
+ (void) fprintf(fp, "none\n");
+ } else {
+ if (is->flags & INFO_FLAG_BCLIENT)
+ (void) fprintf(fp, "bclient ");
+ if (is->flags & INFO_FLAG_AUTHENTICATE)
+ (void) fprintf(fp, "auth ");
+ if (is->flags & INFO_FLAG_MONITOR)
+ (void) fprintf(fp, "monitor ");
+ if (is->flags & INFO_FLAG_NTP)
+ (void) fprintf(fp, "ntp ");
+ if (is->flags & INFO_FLAG_KERNEL)
+ (void) fprintf(fp, "kernel ");
+ if (is->flags & INFO_FLAG_FILEGEN)
+ (void) fprintf(fp, "stats ");
+ if (is->flags & INFO_FLAG_CAL)
+ (void) fprintf(fp, "calibrate ");
+ if (is->flags & INFO_FLAG_PPS_SYNC)
+ (void) fprintf(fp, "pps ");
+ (void) fprintf(fp, "\n");
+ }
+ (void) fprintf(fp, "jitter: %s s\n",
+ fptoa(ntohl(is->frequency), 6));
+ (void) fprintf(fp, "stability: %s ppm\n",
+ ufptoa(ntohl(is->stability), 3));
+ (void) fprintf(fp, "broadcastdelay: %s s\n",
+ fptoa(NTOHS_FP(is->bdelay), 6));
+ NTOHL_FP(&is->authdelay, &tempts);
+ (void) fprintf(fp, "authdelay: %s s\n", lfptoa(&tempts, 6));
+}
+
+
+/*
+ * sysstats - print system statistics
+ */
+/*ARGSUSED*/
+static void
+sysstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_sys_stats *ss;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_SYS_STATS, 0, 0, 0, (char *)NULL,
+ &items, &itemsize, (void *)&ss, 0,
+ sizeof(struct info_sys_stats));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (itemsize != sizeof(struct info_sys_stats) &&
+ itemsize != sizeof(struct old_info_sys_stats)) {
+ /* issue warning according to new structure size */
+ checkitemsize(itemsize, sizeof(struct info_sys_stats));
+ return;
+ }
+ fprintf(fp, "time since restart: %lu\n",
+ (u_long)ntohl(ss->timeup));
+ fprintf(fp, "time since reset: %lu\n",
+ (u_long)ntohl(ss->timereset));
+ fprintf(fp, "packets received: %lu\n",
+ (u_long)ntohl(ss->received));
+ fprintf(fp, "packets processed: %lu\n",
+ (u_long)ntohl(ss->processed));
+ fprintf(fp, "current version: %lu\n",
+ (u_long)ntohl(ss->newversionpkt));
+ fprintf(fp, "previous version: %lu\n",
+ (u_long)ntohl(ss->oldversionpkt));
+ fprintf(fp, "declined: %lu\n",
+ (u_long)ntohl(ss->unknownversion));
+ fprintf(fp, "access denied: %lu\n",
+ (u_long)ntohl(ss->denied));
+ fprintf(fp, "bad length or format: %lu\n",
+ (u_long)ntohl(ss->badlength));
+ fprintf(fp, "bad authentication: %lu\n",
+ (u_long)ntohl(ss->badauth));
+ if (itemsize != sizeof(struct info_sys_stats))
+ return;
+
+ fprintf(fp, "rate exceeded: %lu\n",
+ (u_long)ntohl(ss->limitrejected));
+}
+
+
+
+/*
+ * iostats - print I/O statistics
+ */
+/*ARGSUSED*/
+static void
+iostats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_io_stats *io;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_IO_STATS, 0, 0, 0, NULL, &items,
+ &itemsize, (void *)&io, 0, sizeof(*io));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(*io)))
+ return;
+
+ fprintf(fp, "time since reset: %lu\n",
+ (u_long)ntohl(io->timereset));
+ fprintf(fp, "receive buffers: %u\n",
+ (u_int)ntohs(io->totalrecvbufs));
+ fprintf(fp, "free receive buffers: %u\n",
+ (u_int)ntohs(io->freerecvbufs));
+ fprintf(fp, "used receive buffers: %u\n",
+ (u_int)ntohs(io->fullrecvbufs));
+ fprintf(fp, "low water refills: %u\n",
+ (u_int)ntohs(io->lowwater));
+ fprintf(fp, "dropped packets: %lu\n",
+ (u_long)ntohl(io->dropped));
+ fprintf(fp, "ignored packets: %lu\n",
+ (u_long)ntohl(io->ignored));
+ fprintf(fp, "received packets: %lu\n",
+ (u_long)ntohl(io->received));
+ fprintf(fp, "packets sent: %lu\n",
+ (u_long)ntohl(io->sent));
+ fprintf(fp, "packets not sent: %lu\n",
+ (u_long)ntohl(io->notsent));
+ fprintf(fp, "interrupts handled: %lu\n",
+ (u_long)ntohl(io->interrupts));
+ fprintf(fp, "received by int: %lu\n",
+ (u_long)ntohl(io->int_received));
+}
+
+
+/*
+ * memstats - print peer memory statistics
+ */
+/*ARGSUSED*/
+static void
+memstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_mem_stats *mem;
+ int i;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_MEM_STATS, 0, 0, 0, NULL, &items,
+ &itemsize, (void *)&mem, 0, sizeof(*mem));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(*mem)))
+ return;
+
+ fprintf(fp, "time since reset: %lu\n",
+ (u_long)ntohl(mem->timereset));
+ fprintf(fp, "total peer memory: %u\n",
+ (u_int)ntohs(mem->totalpeermem));
+ fprintf(fp, "free peer memory: %u\n",
+ (u_int)ntohs(mem->freepeermem));
+ fprintf(fp, "calls to findpeer: %lu\n",
+ (u_long)ntohl(mem->findpeer_calls));
+ fprintf(fp, "new peer allocations: %lu\n",
+ (u_long)ntohl(mem->allocations));
+ fprintf(fp, "peer demobilizations: %lu\n",
+ (u_long)ntohl(mem->demobilizations));
+
+ fprintf(fp, "hash table counts: ");
+ for (i = 0; i < NTP_HASH_SIZE; i++) {
+ fprintf(fp, "%4d", (int)mem->hashcount[i]);
+ if ((i % 8) == 7 && i != (NTP_HASH_SIZE-1))
+ fprintf(fp, "\n ");
+ }
+ fprintf(fp, "\n");
+}
+
+
+
+/*
+ * timerstats - print timer statistics
+ */
+/*ARGSUSED*/
+static void
+timerstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_timer_stats *tim;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_TIMER_STATS, 0, 0, 0, NULL, &items,
+ &itemsize, (void *)&tim, 0, sizeof(*tim));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(*tim)))
+ return;
+
+ fprintf(fp, "time since reset: %lu\n",
+ (u_long)ntohl(tim->timereset));
+ fprintf(fp, "alarms handled: %lu\n",
+ (u_long)ntohl(tim->alarms));
+ fprintf(fp, "alarm overruns: %lu\n",
+ (u_long)ntohl(tim->overflows));
+ fprintf(fp, "calls to transmit: %lu\n",
+ (u_long)ntohl(tim->xmtcalls));
+}
+
+
+/*
+ * addpeer - configure an active mode association
+ */
+static void
+addpeer(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doconfig(pcmd, fp, MODE_ACTIVE, 0);
+}
+
+
+/*
+ * addserver - configure a client mode association
+ */
+static void
+addserver(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doconfig(pcmd, fp, MODE_CLIENT, 0);
+}
+
+/*
+ * addrefclock - configure a reference clock association
+ */
+static void
+addrefclock(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doconfig(pcmd, fp, MODE_CLIENT, 1);
+}
+
+/*
+ * broadcast - configure a broadcast mode association
+ */
+static void
+broadcast(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doconfig(pcmd, fp, MODE_BROADCAST, 0);
+}
+
+
+/*
+ * config - configure a new peer association
+ */
+static void
+doconfig(
+ struct parse *pcmd,
+ FILE *fp,
+ int mode,
+ int refc
+ )
+{
+ struct conf_peer cpeer;
+ int items;
+ int itemsize;
+ char *dummy;
+ u_long keyid;
+ u_int version;
+ u_char minpoll;
+ u_char maxpoll;
+ u_int flags;
+ u_char cmode;
+ int res;
+ int sendsize;
+ int numtyp;
+ long val;
+
+again:
+ keyid = 0;
+ version = 3;
+ flags = 0;
+ res = FALSE;
+ cmode = 0;
+ minpoll = NTP_MINDPOLL;
+ maxpoll = NTP_MAXDPOLL;
+ numtyp = 1;
+ if (refc)
+ numtyp = 5;
+
+ if (impl_ver == IMPL_XNTPD)
+ sendsize = sizeof(struct conf_peer);
+ else
+ sendsize = v4sizeof(struct conf_peer);
+
+ items = 1;
+ while (pcmd->nargs > items) {
+ if (STREQ(pcmd->argval[items].string, "prefer"))
+ flags |= CONF_FLAG_PREFER;
+ else if (STREQ(pcmd->argval[items].string, "burst"))
+ flags |= CONF_FLAG_BURST;
+ else if (STREQ(pcmd->argval[items].string, "iburst"))
+ flags |= CONF_FLAG_IBURST;
+ else if (!refc && STREQ(pcmd->argval[items].string, "keyid"))
+ numtyp = 1;
+ else if (!refc && STREQ(pcmd->argval[items].string, "version"))
+ numtyp = 2;
+ else if (STREQ(pcmd->argval[items].string, "minpoll"))
+ numtyp = 3;
+ else if (STREQ(pcmd->argval[items].string, "maxpoll"))
+ numtyp = 4;
+ else {
+ if (!atoint(pcmd->argval[items].string, &val))
+ numtyp = 0;
+ switch (numtyp) {
+ case 1:
+ keyid = val;
+ numtyp = 2;
+ break;
+
+ case 2:
+ version = (u_int)val;
+ numtyp = 0;
+ break;
+
+ case 3:
+ minpoll = (u_char)val;
+ numtyp = 0;
+ break;
+
+ case 4:
+ maxpoll = (u_char)val;
+ numtyp = 0;
+ break;
+
+ case 5:
+ cmode = (u_char)val;
+ numtyp = 0;
+ break;
+
+ default:
+ fprintf(fp, "*** '%s' not understood\n",
+ pcmd->argval[items].string);
+ res = TRUE;
+ numtyp = 0;
+ }
+ if (val < 0) {
+ fprintf(stderr,
+ "*** Value '%s' should be unsigned\n",
+ pcmd->argval[items].string);
+ res = TRUE;
+ }
+ }
+ items++;
+ }
+ if (keyid > 0)
+ flags |= CONF_FLAG_AUTHENABLE;
+ if (version > NTP_VERSION || version < NTP_OLDVERSION) {
+ fprintf(fp, "***invalid version number: %u\n",
+ version);
+ res = TRUE;
+ }
+ if (minpoll < NTP_MINPOLL || minpoll > NTP_MAXPOLL ||
+ maxpoll < NTP_MINPOLL || maxpoll > NTP_MAXPOLL ||
+ minpoll > maxpoll) {
+ fprintf(fp, "***min/max-poll must be within %d..%d\n",
+ NTP_MINPOLL, NTP_MAXPOLL);
+ res = TRUE;
+ }
+
+ if (res)
+ return;
+
+ ZERO(cpeer);
+
+ if (IS_IPV4(&pcmd->argval[0].netnum)) {
+ cpeer.peeraddr = NSRCADR(&pcmd->argval[0].netnum);
+ if (impl_ver == IMPL_XNTPD)
+ cpeer.v6_flag = 0;
+ } else {
+ if (impl_ver == IMPL_XNTPD_OLD) {
+ fprintf(stderr,
+ "***Server doesn't understand IPv6 addresses\n");
+ return;
+ }
+ cpeer.peeraddr6 = SOCK_ADDR6(&pcmd->argval[0].netnum);
+ cpeer.v6_flag = 1;
+ }
+ cpeer.hmode = (u_char) mode;
+ cpeer.keyid = keyid;
+ cpeer.version = (u_char) version;
+ cpeer.minpoll = minpoll;
+ cpeer.maxpoll = maxpoll;
+ cpeer.flags = (u_char)flags;
+ cpeer.ttl = cmode;
+
+ res = doquery(impl_ver, REQ_CONFIG, 1, 1,
+ sendsize, (char *)&cpeer, &items,
+ &itemsize, &dummy, 0, sizeof(struct conf_peer));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == INFO_ERR_FMT) {
+ (void) fprintf(fp,
+ "***Retrying command with old conf_peer size\n");
+ res = doquery(impl_ver, REQ_CONFIG, 1, 1,
+ sizeof(struct old_conf_peer), (char *)&cpeer,
+ &items, &itemsize, &dummy, 0,
+ sizeof(struct conf_peer));
+ }
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+
+/*
+ * unconfig - unconfigure some associations
+ */
+static void
+unconfig(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ /* 8 is the maximum number of peers which will fit in a packet */
+ struct conf_unpeer *pl, plist[min(MAXARGS, 8)];
+ int qitemlim;
+ int qitems;
+ int items;
+ int itemsize;
+ char *dummy;
+ int res;
+ int sendsize;
+
+again:
+ if (impl_ver == IMPL_XNTPD)
+ sendsize = sizeof(struct conf_unpeer);
+ else
+ sendsize = v4sizeof(struct conf_unpeer);
+
+ qitemlim = min(pcmd->nargs, COUNTOF(plist));
+ for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) {
+ if (IS_IPV4(&pcmd->argval[0].netnum)) {
+ pl->peeraddr = NSRCADR(&pcmd->argval[qitems].netnum);
+ if (impl_ver == IMPL_XNTPD)
+ pl->v6_flag = 0;
+ } else {
+ if (impl_ver == IMPL_XNTPD_OLD) {
+ fprintf(stderr,
+ "***Server doesn't understand IPv6 addresses\n");
+ return;
+ }
+ pl->peeraddr6 =
+ SOCK_ADDR6(&pcmd->argval[qitems].netnum);
+ pl->v6_flag = 1;
+ }
+ pl = (void *)((char *)pl + sendsize);
+ }
+
+ res = doquery(impl_ver, REQ_UNCONFIG, 1, qitems,
+ sendsize, (char *)plist, &items,
+ &itemsize, &dummy, 0, sizeof(struct conf_unpeer));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+}
+
+
+/*
+ * set - set some system flags
+ */
+static void
+set(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doset(pcmd, fp, REQ_SET_SYS_FLAG);
+}
+
+
+/*
+ * clear - clear some system flags
+ */
+static void
+sys_clear(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doset(pcmd, fp, REQ_CLR_SYS_FLAG);
+}
+
+
+/*
+ * doset - set/clear system flags
+ */
+static void
+doset(
+ struct parse *pcmd,
+ FILE *fp,
+ int req
+ )
+{
+ struct conf_sys_flags sys;
+ int items;
+ int itemsize;
+ char *dummy;
+ int res;
+
+ sys.flags = 0;
+ res = 0;
+ for (items = 0; items < pcmd->nargs; items++) {
+ if (STREQ(pcmd->argval[items].string, "auth"))
+ sys.flags |= SYS_FLAG_AUTH;
+ else if (STREQ(pcmd->argval[items].string, "bclient"))
+ sys.flags |= SYS_FLAG_BCLIENT;
+ else if (STREQ(pcmd->argval[items].string, "calibrate"))
+ sys.flags |= SYS_FLAG_CAL;
+ else if (STREQ(pcmd->argval[items].string, "kernel"))
+ sys.flags |= SYS_FLAG_KERNEL;
+ else if (STREQ(pcmd->argval[items].string, "monitor"))
+ sys.flags |= SYS_FLAG_MONITOR;
+ else if (STREQ(pcmd->argval[items].string, "ntp"))
+ sys.flags |= SYS_FLAG_NTP;
+ else if (STREQ(pcmd->argval[items].string, "pps"))
+ sys.flags |= SYS_FLAG_PPS;
+ else if (STREQ(pcmd->argval[items].string, "stats"))
+ sys.flags |= SYS_FLAG_FILEGEN;
+ else {
+ (void) fprintf(fp, "Unknown flag %s\n",
+ pcmd->argval[items].string);
+ res = 1;
+ }
+ }
+
+ sys.flags = htonl(sys.flags);
+ if (res || sys.flags == 0)
+ return;
+
+again:
+ res = doquery(impl_ver, req, 1, 1,
+ sizeof(struct conf_sys_flags), (char *)&sys, &items,
+ &itemsize, &dummy, 0, sizeof(struct conf_sys_flags));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+}
+
+
+/*
+ * data for printing/interrpreting the restrict flags
+ */
+struct resflags {
+ const char *str;
+ int bit;
+};
+
+/* XXX: HMS: we apparently don't report set bits we do not recognize. */
+
+static struct resflags resflagsV2[] = {
+ { "ignore", 0x001 },
+ { "noserve", 0x002 },
+ { "notrust", 0x004 },
+ { "noquery", 0x008 },
+ { "nomodify", 0x010 },
+ { "nopeer", 0x020 },
+ { "notrap", 0x040 },
+ { "lptrap", 0x080 },
+ { "limited", 0x100 },
+ { "", 0 }
+};
+
+static struct resflags resflagsV3[] = {
+ { "ignore", RES_IGNORE },
+ { "noserve", RES_DONTSERVE },
+ { "notrust", RES_DONTTRUST },
+ { "noquery", RES_NOQUERY },
+ { "nomodify", RES_NOMODIFY },
+ { "nopeer", RES_NOPEER },
+ { "notrap", RES_NOTRAP },
+ { "lptrap", RES_LPTRAP },
+ { "limited", RES_LIMITED },
+ { "version", RES_VERSION },
+ { "kod", RES_KOD },
+ { "flake", RES_FLAKE },
+
+ { "", 0 }
+};
+
+static struct resflags resmflags[] = {
+ { "ntpport", RESM_NTPONLY },
+ { "interface", RESM_INTERFACE },
+ { "source", RESM_SOURCE },
+ { "", 0 }
+};
+
+
+/*
+ * reslist - obtain and print the server's restrict list
+ */
+/*ARGSUSED*/
+static void
+reslist(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_restrict *rl;
+ sockaddr_u resaddr;
+ sockaddr_u maskaddr;
+ int items;
+ int itemsize;
+ int res;
+ int skip;
+ const char *addr;
+ const char *mask;
+ struct resflags *rf;
+ u_int32 count;
+ u_short flags;
+ u_short mflags;
+ char flagstr[300];
+ static const char *comma = ", ";
+
+again:
+ res = doquery(impl_ver, REQ_GET_RESTRICT, 0, 0, 0, (char *)NULL,
+ &items, &itemsize, (void *)&rl, 0,
+ sizeof(struct info_restrict));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_restrict)) &&
+ !checkitemsize(itemsize, v4sizeof(struct info_restrict)))
+ return;
+
+ fprintf(fp,
+ " address mask count flags\n");
+ fprintf(fp,
+ "=====================================================================\n");
+
+ while (items > 0) {
+ SET_ADDRS(resaddr, maskaddr, rl, addr, mask);
+ if (rl->v6_flag != 0) {
+ addr = nntohost(&resaddr);
+ } else {
+ if (rl->mask == (u_int32)0xffffffff)
+ addr = nntohost(&resaddr);
+ else
+ addr = stoa(&resaddr);
+ }
+ mask = stoa(&maskaddr);
+ skip = 1;
+ if ((pcmd->nargs == 0) ||
+ ((pcmd->argval->ival == 6) && (rl->v6_flag != 0)) ||
+ ((pcmd->argval->ival == 4) && (rl->v6_flag == 0)))
+ skip = 0;
+ count = ntohl(rl->count);
+ flags = ntohs(rl->flags);
+ mflags = ntohs(rl->mflags);
+ flagstr[0] = '\0';
+
+ res = 1;
+ rf = &resmflags[0];
+ while (rf->bit != 0) {
+ if (mflags & rf->bit) {
+ if (!res)
+ strlcat(flagstr, comma,
+ sizeof(flagstr));
+ res = 0;
+ strlcat(flagstr, rf->str,
+ sizeof(flagstr));
+ }
+ rf++;
+ }
+
+ rf = (impl_ver == IMPL_XNTPD_OLD)
+ ? &resflagsV2[0]
+ : &resflagsV3[0];
+
+ while (rf->bit != 0) {
+ if (flags & rf->bit) {
+ if (!res)
+ strlcat(flagstr, comma,
+ sizeof(flagstr));
+ res = 0;
+ strlcat(flagstr, rf->str,
+ sizeof(flagstr));
+ }
+ rf++;
+ }
+
+ if (flagstr[0] == '\0')
+ strlcpy(flagstr, "none", sizeof(flagstr));
+
+ if (!skip)
+ fprintf(fp, "%-15.15s %-15.15s %9lu %s\n",
+ addr, mask, (u_long)count, flagstr);
+ rl++;
+ items--;
+ }
+}
+
+
+
+/*
+ * new_restrict - create/add a set of restrictions
+ */
+static void
+new_restrict(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_restrict(pcmd, fp, REQ_RESADDFLAGS);
+}
+
+
+/*
+ * unrestrict - remove restriction flags from existing entry
+ */
+static void
+unrestrict(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_restrict(pcmd, fp, REQ_RESSUBFLAGS);
+}
+
+
+/*
+ * delrestrict - delete an existing restriction
+ */
+static void
+delrestrict(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_restrict(pcmd, fp, REQ_UNRESTRICT);
+}
+
+
+/*
+ * do_restrict - decode commandline restrictions and make the request
+ */
+static void
+do_restrict(
+ struct parse *pcmd,
+ FILE *fp,
+ int req_code
+ )
+{
+ struct conf_restrict cres;
+ int items;
+ int itemsize;
+ char *dummy;
+ u_int32 num;
+ u_long bit;
+ int i;
+ int res;
+ int err;
+ int sendsize;
+
+ /* Initialize cres */
+ cres.addr = 0;
+ cres.mask = 0;
+ cres.flags = 0;
+ cres.mflags = 0;
+ cres.v6_flag = 0;
+
+again:
+ if (impl_ver == IMPL_XNTPD)
+ sendsize = sizeof(struct conf_restrict);
+ else
+ sendsize = v4sizeof(struct conf_restrict);
+
+ if (IS_IPV4(&pcmd->argval[0].netnum)) {
+ cres.addr = NSRCADR(&pcmd->argval[0].netnum);
+ cres.mask = NSRCADR(&pcmd->argval[1].netnum);
+ if (impl_ver == IMPL_XNTPD)
+ cres.v6_flag = 0;
+ } else {
+ if (impl_ver == IMPL_XNTPD_OLD) {
+ fprintf(stderr,
+ "***Server doesn't understand IPv6 addresses\n");
+ return;
+ }
+ cres.addr6 = SOCK_ADDR6(&pcmd->argval[0].netnum);
+ cres.v6_flag = 1;
+ }
+ cres.flags = 0;
+ cres.mflags = 0;
+ err = FALSE;
+ for (res = 2; res < pcmd->nargs; res++) {
+ if (STREQ(pcmd->argval[res].string, "ntpport")) {
+ cres.mflags |= RESM_NTPONLY;
+ } else {
+ for (i = 0; resflagsV3[i].bit != 0; i++) {
+ if (STREQ(pcmd->argval[res].string,
+ resflagsV3[i].str))
+ break;
+ }
+ if (resflagsV3[i].bit != 0) {
+ cres.flags |= resflagsV3[i].bit;
+ if (req_code == REQ_UNRESTRICT) {
+ fprintf(fp,
+ "Flag %s inappropriate\n",
+ resflagsV3[i].str);
+ err = TRUE;
+ }
+ } else {
+ fprintf(fp, "Unknown flag %s\n",
+ pcmd->argval[res].string);
+ err = TRUE;
+ }
+ }
+ }
+ cres.flags = htons(cres.flags);
+ cres.mflags = htons(cres.mflags);
+
+ /*
+ * Make sure mask for default address is zero. Otherwise,
+ * make sure mask bits are contiguous.
+ */
+ if (IS_IPV4(&pcmd->argval[0].netnum)) {
+ if (cres.addr == 0) {
+ cres.mask = 0;
+ } else {
+ num = ntohl(cres.mask);
+ for (bit = 0x80000000; bit != 0; bit >>= 1)
+ if ((num & bit) == 0)
+ break;
+ for ( ; bit != 0; bit >>= 1)
+ if ((num & bit) != 0)
+ break;
+ if (bit != 0) {
+ fprintf(fp, "Invalid mask %s\n",
+ numtoa(cres.mask));
+ err = TRUE;
+ }
+ }
+ } else {
+ /* XXX IPv6 sanity checking stuff */
+ }
+
+ if (err)
+ return;
+
+ res = doquery(impl_ver, req_code, 1, 1, sendsize, (char *)&cres,
+ &items, &itemsize, &dummy, 0, sizeof(cres));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+
+/*
+ * monlist - obtain and print the server's monitor data
+ */
+/*ARGSUSED*/
+static void
+monlist(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ char *struct_star;
+ struct info_monitor *ml;
+ struct info_monitor_1 *m1;
+ struct old_info_monitor *oml;
+ sockaddr_u addr;
+ sockaddr_u dstadr;
+ int items;
+ int itemsize;
+ int res;
+ int version = -1;
+
+ if (pcmd->nargs > 0)
+ version = pcmd->argval[0].ival;
+
+again:
+ res = doquery(impl_ver,
+ (version == 1 || version == -1) ? REQ_MON_GETLIST_1 :
+ REQ_MON_GETLIST, 0, 0, 0, NULL,
+ &items, &itemsize, &struct_star,
+ (version < 0) ? (1 << INFO_ERR_REQ) : 0,
+ sizeof(struct info_monitor_1));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == INFO_ERR_REQ && version < 0)
+ res = doquery(impl_ver, REQ_MON_GETLIST, 0, 0, 0, NULL,
+ &items, &itemsize, &struct_star, 0,
+ sizeof(struct info_monitor));
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (itemsize == sizeof(struct info_monitor_1) ||
+ itemsize == v4sizeof(struct info_monitor_1)) {
+
+ m1 = (void *)struct_star;
+ fprintf(fp,
+ "remote address port local address count m ver rstr avgint lstint\n");
+ fprintf(fp,
+ "===============================================================================\n");
+ while (items > 0) {
+ SET_ADDRS(dstadr, addr, m1, daddr, addr);
+ if ((pcmd->nargs == 0) ||
+ ((pcmd->argval->ival == 6) && (m1->v6_flag != 0)) ||
+ ((pcmd->argval->ival == 4) && (m1->v6_flag == 0)))
+ fprintf(fp,
+ "%-22.22s %5d %-15s %8lu %1u %1u %6lx %6lu %7lu\n",
+ nntohost(&addr),
+ ntohs(m1->port),
+ stoa(&dstadr),
+ (u_long)ntohl(m1->count),
+ m1->mode,
+ m1->version,
+ (u_long)ntohl(m1->restr),
+ (u_long)ntohl(m1->avg_int),
+ (u_long)ntohl(m1->last_int));
+ m1++;
+ items--;
+ }
+ } else if (itemsize == sizeof(struct info_monitor) ||
+ itemsize == v4sizeof(struct info_monitor)) {
+
+ ml = (void *) struct_star;
+ fprintf(fp,
+ " address port count mode ver rstr avgint lstint\n");
+ fprintf(fp,
+ "===============================================================================\n");
+ while (items > 0) {
+ SET_ADDR(dstadr, ml->v6_flag, ml->addr, ml->addr6);
+ if ((pcmd->nargs == 0) ||
+ ((pcmd->argval->ival == 6) && (ml->v6_flag != 0)) ||
+ ((pcmd->argval->ival == 4) && (ml->v6_flag == 0)))
+ fprintf(fp,
+ "%-25.25s %5u %9lu %4u %2u %9lx %9lu %9lu\n",
+ nntohost(&dstadr),
+ ntohs(ml->port),
+ (u_long)ntohl(ml->count),
+ ml->mode,
+ ml->version,
+ (u_long)ntohl(ml->restr),
+ (u_long)ntohl(ml->avg_int),
+ (u_long)ntohl(ml->last_int));
+ ml++;
+ items--;
+ }
+ } else if (itemsize == sizeof(struct old_info_monitor)) {
+
+ oml = (void *)struct_star;
+ fprintf(fp,
+ " address port count mode version lasttime firsttime\n");
+ fprintf(fp,
+ "======================================================================\n");
+ while (items > 0) {
+ SET_ADDR(dstadr, oml->v6_flag, oml->addr, oml->addr6);
+ fprintf(fp, "%-20.20s %5u %9lu %4u %3u %9lu %9lu\n",
+ nntohost(&dstadr),
+ ntohs(oml->port),
+ (u_long)ntohl(oml->count),
+ oml->mode,
+ oml->version,
+ (u_long)ntohl(oml->lasttime),
+ (u_long)ntohl(oml->firsttime));
+ oml++;
+ items--;
+ }
+ } else {
+ /* issue warning according to new info_monitor size */
+ checkitemsize(itemsize, sizeof(struct info_monitor));
+ }
+}
+
+
+/*
+ * Mapping between command line strings and stat reset flags
+ */
+struct statreset {
+ const char * const str;
+ const int flag;
+} sreset[] = {
+ { "allpeers", RESET_FLAG_ALLPEERS },
+ { "io", RESET_FLAG_IO },
+ { "sys", RESET_FLAG_SYS },
+ { "mem", RESET_FLAG_MEM },
+ { "timer", RESET_FLAG_TIMER },
+ { "auth", RESET_FLAG_AUTH },
+ { "ctl", RESET_FLAG_CTL },
+ { "", 0 }
+};
+
+/*
+ * reset - reset statistic counters
+ */
+static void
+reset(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct reset_flags rflags;
+ int items;
+ int itemsize;
+ char *dummy;
+ int i;
+ int res;
+ int err;
+
+ err = 0;
+ rflags.flags = 0;
+ for (res = 0; res < pcmd->nargs; res++) {
+ for (i = 0; sreset[i].flag != 0; i++) {
+ if (STREQ(pcmd->argval[res].string, sreset[i].str))
+ break;
+ }
+ if (sreset[i].flag == 0) {
+ fprintf(fp, "Flag %s unknown\n",
+ pcmd->argval[res].string);
+ err++;
+ } else {
+ rflags.flags |= sreset[i].flag;
+ }
+ }
+ rflags.flags = htonl(rflags.flags);
+
+ if (err) {
+ (void) fprintf(fp, "Not done due to errors\n");
+ return;
+ }
+
+again:
+ res = doquery(impl_ver, REQ_RESET_STATS, 1, 1,
+ sizeof(struct reset_flags), (char *)&rflags, &items,
+ &itemsize, &dummy, 0, sizeof(struct reset_flags));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+
+
+/*
+ * preset - reset stat counters for particular peers
+ */
+static void
+preset(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ /* 8 is the maximum number of peers which will fit in a packet */
+ struct conf_unpeer *pl, plist[min(MAXARGS, 8)];
+ int qitemlim;
+ int qitems;
+ int items;
+ int itemsize;
+ char *dummy;
+ int res;
+ int sendsize;
+
+again:
+ if (impl_ver == IMPL_XNTPD)
+ sendsize = sizeof(struct conf_unpeer);
+ else
+ sendsize = v4sizeof(struct conf_unpeer);
+
+ qitemlim = min(pcmd->nargs, COUNTOF(plist));
+ for (qitems = 0, pl = plist; qitems < qitemlim; qitems++) {
+ if (IS_IPV4(&pcmd->argval[qitems].netnum)) {
+ pl->peeraddr = NSRCADR(&pcmd->argval[qitems].netnum);
+ if (impl_ver == IMPL_XNTPD)
+ pl->v6_flag = 0;
+ } else {
+ if (impl_ver == IMPL_XNTPD_OLD) {
+ fprintf(stderr,
+ "***Server doesn't understand IPv6 addresses\n");
+ return;
+ }
+ pl->peeraddr6 =
+ SOCK_ADDR6(&pcmd->argval[qitems].netnum);
+ pl->v6_flag = 1;
+ }
+ pl = (void *)((char *)pl + sendsize);
+ }
+
+ res = doquery(impl_ver, REQ_RESET_PEER, 1, qitems,
+ sendsize, (char *)plist, &items,
+ &itemsize, &dummy, 0, sizeof(struct conf_unpeer));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+}
+
+
+/*
+ * readkeys - request the server to reread the keys file
+ */
+/*ARGSUSED*/
+static void
+readkeys(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int items;
+ int itemsize;
+ char *dummy;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_REREAD_KEYS, 1, 0, 0, (char *)0,
+ &items, &itemsize, &dummy, 0, sizeof(dummy));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+
+/*
+ * trustkey - add some keys to the trusted key list
+ */
+static void
+trustkey(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_trustkey(pcmd, fp, REQ_TRUSTKEY);
+}
+
+
+/*
+ * untrustkey - remove some keys from the trusted key list
+ */
+static void
+untrustkey(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_trustkey(pcmd, fp, REQ_UNTRUSTKEY);
+}
+
+
+/*
+ * do_trustkey - do grunge work of adding/deleting keys
+ */
+static void
+do_trustkey(
+ struct parse *pcmd,
+ FILE *fp,
+ int req
+ )
+{
+ u_long keyids[MAXARGS];
+ int i;
+ int items;
+ int itemsize;
+ char *dummy;
+ int ritems;
+ int res;
+
+ ritems = 0;
+ for (i = 0; i < pcmd->nargs; i++) {
+ keyids[ritems++] = pcmd->argval[i].uval;
+ }
+
+again:
+ res = doquery(impl_ver, req, 1, ritems, sizeof(u_long),
+ (char *)keyids, &items, &itemsize, &dummy, 0,
+ sizeof(dummy));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+
+
+/*
+ * authinfo - obtain and print info about authentication
+ */
+/*ARGSUSED*/
+static void
+authinfo(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_auth *ia;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_AUTHINFO, 0, 0, 0, NULL, &items,
+ &itemsize, (void *)&ia, 0, sizeof(*ia));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(*ia)))
+ return;
+
+ fprintf(fp, "time since reset: %lu\n",
+ (u_long)ntohl(ia->timereset));
+ fprintf(fp, "stored keys: %lu\n",
+ (u_long)ntohl(ia->numkeys));
+ fprintf(fp, "free keys: %lu\n",
+ (u_long)ntohl(ia->numfreekeys));
+ fprintf(fp, "key lookups: %lu\n",
+ (u_long)ntohl(ia->keylookups));
+ fprintf(fp, "keys not found: %lu\n",
+ (u_long)ntohl(ia->keynotfound));
+ fprintf(fp, "uncached keys: %lu\n",
+ (u_long)ntohl(ia->keyuncached));
+ fprintf(fp, "encryptions: %lu\n",
+ (u_long)ntohl(ia->encryptions));
+ fprintf(fp, "decryptions: %lu\n",
+ (u_long)ntohl(ia->decryptions));
+ fprintf(fp, "expired keys: %lu\n",
+ (u_long)ntohl(ia->expired));
+}
+
+
+
+/*
+ * traps - obtain and print a list of traps
+ */
+/*ARGSUSED*/
+static void
+traps(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int i;
+ struct info_trap *it;
+ sockaddr_u trap_addr, local_addr;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_TRAPS, 0, 0, 0, NULL, &items,
+ &itemsize, (void *)&it, 0, sizeof(*it));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_trap)) &&
+ !checkitemsize(itemsize, v4sizeof(struct info_trap)))
+ return;
+
+ for (i = 0; i < items; i++ ) {
+ SET_ADDRS(trap_addr, local_addr, it, trap_address, local_address);
+ fprintf(fp, "%saddress %s, port %d\n",
+ (0 == i)
+ ? ""
+ : "\n",
+ stoa(&trap_addr), ntohs(it->trap_port));
+ fprintf(fp, "interface: %s, ",
+ (0 == it->local_address)
+ ? "wildcard"
+ : stoa(&local_addr));
+ if (ntohl(it->flags) & TRAP_CONFIGURED)
+ fprintf(fp, "configured\n");
+ else if (ntohl(it->flags) & TRAP_NONPRIO)
+ fprintf(fp, "low priority\n");
+ else
+ fprintf(fp, "normal priority\n");
+
+ fprintf(fp, "set for %ld secs, last set %ld secs ago\n",
+ (long)ntohl(it->origtime),
+ (long)ntohl(it->settime));
+ fprintf(fp, "sequence %d, number of resets %ld\n",
+ ntohs(it->sequence), (long)ntohl(it->resets));
+ }
+}
+
+
+/*
+ * addtrap - configure a trap
+ */
+static void
+addtrap(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_addclr_trap(pcmd, fp, REQ_ADD_TRAP);
+}
+
+
+/*
+ * clrtrap - clear a trap from the server
+ */
+static void
+clrtrap(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_addclr_trap(pcmd, fp, REQ_CLR_TRAP);
+}
+
+
+/*
+ * do_addclr_trap - do grunge work of adding/deleting traps
+ */
+static void
+do_addclr_trap(
+ struct parse *pcmd,
+ FILE *fp,
+ int req
+ )
+{
+ struct conf_trap ctrap;
+ int items;
+ int itemsize;
+ char *dummy;
+ int res;
+ int sendsize;
+
+again:
+ if (impl_ver == IMPL_XNTPD)
+ sendsize = sizeof(struct conf_trap);
+ else
+ sendsize = v4sizeof(struct conf_trap);
+
+ if (IS_IPV4(&pcmd->argval[0].netnum)) {
+ ctrap.trap_address = NSRCADR(&pcmd->argval[0].netnum);
+ if (impl_ver == IMPL_XNTPD)
+ ctrap.v6_flag = 0;
+ } else {
+ if (impl_ver == IMPL_XNTPD_OLD) {
+ fprintf(stderr,
+ "***Server doesn't understand IPv6 addresses\n");
+ return;
+ }
+ ctrap.trap_address6 = SOCK_ADDR6(&pcmd->argval[0].netnum);
+ ctrap.v6_flag = 1;
+ }
+ ctrap.local_address = 0;
+ ctrap.trap_port = htons(TRAPPORT);
+ ctrap.unused = 0;
+
+ if (pcmd->nargs > 1) {
+ ctrap.trap_port = htons((u_short)pcmd->argval[1].uval);
+ if (pcmd->nargs > 2) {
+ if (AF(&pcmd->argval[2].netnum) !=
+ AF(&pcmd->argval[0].netnum)) {
+ fprintf(stderr,
+ "***Cannot mix IPv4 and IPv6 addresses\n");
+ return;
+ }
+ if (IS_IPV4(&pcmd->argval[2].netnum))
+ ctrap.local_address = NSRCADR(&pcmd->argval[2].netnum);
+ else
+ ctrap.local_address6 = SOCK_ADDR6(&pcmd->argval[2].netnum);
+ }
+ }
+
+ res = doquery(impl_ver, req, 1, 1, sendsize,
+ (char *)&ctrap, &items, &itemsize, &dummy, 0,
+ sizeof(struct conf_trap));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+
+
+/*
+ * requestkey - change the server's request key (a dangerous request)
+ */
+static void
+requestkey(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_changekey(pcmd, fp, REQ_REQUEST_KEY);
+}
+
+
+/*
+ * controlkey - change the server's control key
+ */
+static void
+controlkey(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ do_changekey(pcmd, fp, REQ_CONTROL_KEY);
+}
+
+
+
+/*
+ * do_changekey - do grunge work of changing keys
+ */
+static void
+do_changekey(
+ struct parse *pcmd,
+ FILE *fp,
+ int req
+ )
+{
+ u_long key;
+ int items;
+ int itemsize;
+ char *dummy;
+ int res;
+
+
+ key = htonl((u_int32)pcmd->argval[0].uval);
+
+again:
+ res = doquery(impl_ver, req, 1, 1, sizeof(u_int32),
+ (char *)&key, &items, &itemsize, &dummy, 0,
+ sizeof(dummy));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+
+
+/*
+ * ctlstats - obtain and print info about authentication
+ */
+/*ARGSUSED*/
+static void
+ctlstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_control *ic;
+ int items;
+ int itemsize;
+ int res;
+
+again:
+ res = doquery(impl_ver, REQ_GET_CTLSTATS, 0, 0, 0, NULL, &items,
+ &itemsize, (void *)&ic, 0, sizeof(*ic));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!check1item(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(*ic)))
+ return;
+
+ fprintf(fp, "time since reset: %lu\n",
+ (u_long)ntohl(ic->ctltimereset));
+ fprintf(fp, "requests received: %lu\n",
+ (u_long)ntohl(ic->numctlreq));
+ fprintf(fp, "responses sent: %lu\n",
+ (u_long)ntohl(ic->numctlresponses));
+ fprintf(fp, "fragments sent: %lu\n",
+ (u_long)ntohl(ic->numctlfrags));
+ fprintf(fp, "async messages sent: %lu\n",
+ (u_long)ntohl(ic->numasyncmsgs));
+ fprintf(fp, "error msgs sent: %lu\n",
+ (u_long)ntohl(ic->numctlerrors));
+ fprintf(fp, "total bad pkts: %lu\n",
+ (u_long)ntohl(ic->numctlbadpkts));
+ fprintf(fp, "packet too short: %lu\n",
+ (u_long)ntohl(ic->numctltooshort));
+ fprintf(fp, "response on input: %lu\n",
+ (u_long)ntohl(ic->numctlinputresp));
+ fprintf(fp, "fragment on input: %lu\n",
+ (u_long)ntohl(ic->numctlinputfrag));
+ fprintf(fp, "error set on input: %lu\n",
+ (u_long)ntohl(ic->numctlinputerr));
+ fprintf(fp, "bad offset on input: %lu\n",
+ (u_long)ntohl(ic->numctlbadoffset));
+ fprintf(fp, "bad version packets: %lu\n",
+ (u_long)ntohl(ic->numctlbadversion));
+ fprintf(fp, "data in pkt too short: %lu\n",
+ (u_long)ntohl(ic->numctldatatooshort));
+ fprintf(fp, "unknown op codes: %lu\n",
+ (u_long)ntohl(ic->numctlbadop));
+}
+
+
+/*
+ * clockstat - get and print clock status information
+ */
+static void
+clockstat(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_clock *cl;
+ /* 8 is the maximum number of clocks which will fit in a packet */
+ u_long clist[min(MAXARGS, 8)];
+ int qitemlim;
+ int qitems;
+ int items;
+ int itemsize;
+ int res;
+ l_fp ts;
+ struct clktype *clk;
+
+ qitemlim = min(pcmd->nargs, COUNTOF(clist));
+ for (qitems = 0; qitems < qitemlim; qitems++)
+ clist[qitems] = NSRCADR(&pcmd->argval[qitems].netnum);
+
+again:
+ res = doquery(impl_ver, REQ_GET_CLOCKINFO, 0, qitems,
+ sizeof(u_int32), (char *)clist, &items,
+ &itemsize, (void *)&cl, 0, sizeof(struct info_clock));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_clock)))
+ return;
+
+ while (items-- > 0) {
+ (void) fprintf(fp, "clock address: %s\n",
+ numtoa(cl->clockadr));
+ for (clk = clktypes; clk->code >= 0; clk++)
+ if (clk->code == cl->type)
+ break;
+ if (clk->code >= 0)
+ (void) fprintf(fp, "clock type: %s\n",
+ clk->clocktype);
+ else
+ (void) fprintf(fp, "clock type: unknown type (%d)\n",
+ cl->type);
+ (void) fprintf(fp, "last event: %d\n",
+ cl->lastevent);
+ (void) fprintf(fp, "current status: %d\n",
+ cl->currentstatus);
+ (void) fprintf(fp, "number of polls: %lu\n",
+ (u_long)ntohl(cl->polls));
+ (void) fprintf(fp, "no response to poll: %lu\n",
+ (u_long)ntohl(cl->noresponse));
+ (void) fprintf(fp, "bad format responses: %lu\n",
+ (u_long)ntohl(cl->badformat));
+ (void) fprintf(fp, "bad data responses: %lu\n",
+ (u_long)ntohl(cl->baddata));
+ (void) fprintf(fp, "running time: %lu\n",
+ (u_long)ntohl(cl->timestarted));
+ NTOHL_FP(&cl->fudgetime1, &ts);
+ (void) fprintf(fp, "fudge time 1: %s\n",
+ lfptoa(&ts, 6));
+ NTOHL_FP(&cl->fudgetime2, &ts);
+ (void) fprintf(fp, "fudge time 2: %s\n",
+ lfptoa(&ts, 6));
+ (void) fprintf(fp, "stratum: %ld\n",
+ (u_long)ntohl(cl->fudgeval1));
+ (void) fprintf(fp, "reference ID: %s\n",
+ refid_string(ntohl(cl->fudgeval2), 0));
+ (void) fprintf(fp, "fudge flags: 0x%x\n",
+ cl->flags);
+
+ if (items > 0)
+ (void) fprintf(fp, "\n");
+ cl++;
+ }
+}
+
+
+/*
+ * fudge - set clock fudge factors
+ */
+static void
+fudge(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct conf_fudge fudgedata;
+ int items;
+ int itemsize;
+ char *dummy;
+ l_fp ts;
+ int res;
+ long val;
+ u_long u_val;
+ int err;
+
+
+ err = 0;
+ ZERO(fudgedata);
+ fudgedata.clockadr = NSRCADR(&pcmd->argval[0].netnum);
+
+ if (STREQ(pcmd->argval[1].string, "time1")) {
+ fudgedata.which = htonl(FUDGE_TIME1);
+ if (!atolfp(pcmd->argval[2].string, &ts))
+ err = 1;
+ else
+ NTOHL_FP(&ts, &fudgedata.fudgetime);
+ } else if (STREQ(pcmd->argval[1].string, "time2")) {
+ fudgedata.which = htonl(FUDGE_TIME2);
+ if (!atolfp(pcmd->argval[2].string, &ts))
+ err = 1;
+ else
+ NTOHL_FP(&ts, &fudgedata.fudgetime);
+ } else if (STREQ(pcmd->argval[1].string, "val1")) {
+ fudgedata.which = htonl(FUDGE_VAL1);
+ if (!atoint(pcmd->argval[2].string, &val))
+ err = 1;
+ else
+ fudgedata.fudgeval_flags = htonl(val);
+ } else if (STREQ(pcmd->argval[1].string, "val2")) {
+ fudgedata.which = htonl(FUDGE_VAL2);
+ if (!atoint(pcmd->argval[2].string, &val))
+ err = 1;
+ else
+ fudgedata.fudgeval_flags = htonl((u_int32)val);
+ } else if (STREQ(pcmd->argval[1].string, "flags")) {
+ fudgedata.which = htonl(FUDGE_FLAGS);
+ if (!hextoint(pcmd->argval[2].string, &u_val))
+ err = 1;
+ else
+ fudgedata.fudgeval_flags = htonl((u_int32)(u_val & 0xf));
+ } else {
+ (void) fprintf(stderr, "What fudge is %s?\n",
+ pcmd->argval[1].string);
+ return;
+ }
+
+ if (err) {
+ (void) fprintf(stderr, "Unknown fudge parameter %s\n",
+ pcmd->argval[2].string);
+ return;
+ }
+
+again:
+ res = doquery(impl_ver, REQ_SET_CLKFUDGE, 1, 1,
+ sizeof(struct conf_fudge), (char *)&fudgedata, &items,
+ &itemsize, &dummy, 0, sizeof(dummy));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res == 0)
+ (void) fprintf(fp, "done!\n");
+ return;
+}
+
+/*
+ * clkbug - get and print clock debugging information
+ */
+static void
+clkbug(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ register int i;
+ register int n;
+ register u_int32 s;
+ struct info_clkbug *cl;
+ /* 8 is the maximum number of clocks which will fit in a packet */
+ u_long clist[min(MAXARGS, 8)];
+ u_int32 ltemp;
+ int qitemlim;
+ int qitems;
+ int items;
+ int itemsize;
+ int res;
+ int needsp;
+ l_fp ts;
+
+ qitemlim = min(pcmd->nargs, COUNTOF(clist));
+ for (qitems = 0; qitems < qitemlim; qitems++)
+ clist[qitems] = NSRCADR(&pcmd->argval[qitems].netnum);
+
+again:
+ res = doquery(impl_ver, REQ_GET_CLKBUGINFO, 0, qitems,
+ sizeof(u_int32), (char *)clist, &items,
+ &itemsize, (void *)&cl, 0, sizeof(struct info_clkbug));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_clkbug)))
+ return;
+
+ while (items-- > 0) {
+ (void) fprintf(fp, "clock address: %s\n",
+ numtoa(cl->clockadr));
+ n = (int)cl->nvalues;
+ (void) fprintf(fp, "values: %d", n);
+ s = ntohs(cl->svalues);
+ if (n > NUMCBUGVALUES)
+ n = NUMCBUGVALUES;
+ for (i = 0; i < n; i++) {
+ ltemp = ntohl(cl->values[i]);
+ ltemp &= 0xffffffff; /* HMS: This does nothing now */
+ if ((i & 0x3) == 0)
+ (void) fprintf(fp, "\n");
+ if (s & (1 << i))
+ (void) fprintf(fp, "%12ld", (u_long)ltemp);
+ else
+ (void) fprintf(fp, "%12lu", (u_long)ltemp);
+ }
+ (void) fprintf(fp, "\n");
+
+ n = (int)cl->ntimes;
+ (void) fprintf(fp, "times: %d", n);
+ s = ntohl(cl->stimes);
+ if (n > NUMCBUGTIMES)
+ n = NUMCBUGTIMES;
+ needsp = 0;
+ for (i = 0; i < n; i++) {
+ if ((i & 0x1) == 0) {
+ (void) fprintf(fp, "\n");
+ } else {
+ for (;needsp > 0; needsp--)
+ putc(' ', fp);
+ }
+ NTOHL_FP(&cl->times[i], &ts);
+ if (s & (1 << i)) {
+ (void) fprintf(fp, "%17s",
+ lfptoa(&ts, 6));
+ needsp = 22;
+ } else {
+ (void) fprintf(fp, "%37s",
+ uglydate(&ts));
+ needsp = 2;
+ }
+ }
+ (void) fprintf(fp, "\n");
+ if (items > 0) {
+ cl++;
+ (void) fprintf(fp, "\n");
+ }
+ }
+}
+
+
+/*
+ * kerninfo - display the kernel pll/pps variables
+ */
+static void
+kerninfo(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_kernel *ik;
+ int items;
+ int itemsize;
+ int res;
+ unsigned status;
+ double tscale = 1e-6;
+
+again:
+ res = doquery(impl_ver, REQ_GET_KERNEL, 0, 0, 0, (char *)NULL,
+ &items, &itemsize, (void *)&ik, 0,
+ sizeof(struct info_kernel));
+
+ if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
+ impl_ver = IMPL_XNTPD_OLD;
+ goto again;
+ }
+
+ if (res != 0)
+ return;
+ if (!check1item(items, fp))
+ return;
+ if (!checkitemsize(itemsize, sizeof(struct info_kernel)))
+ return;
+
+ status = ntohs(ik->status) & 0xffff;
+ /*
+ * pll variables. We know more than we should about the NANO bit.
+ */
+#ifdef STA_NANO
+ if (status & STA_NANO)
+ tscale = 1e-9;
+#endif
+ (void)fprintf(fp, "pll offset: %g s\n",
+ (int32)ntohl(ik->offset) * tscale);
+ (void)fprintf(fp, "pll frequency: %s ppm\n",
+ fptoa((s_fp)ntohl(ik->freq), 3));
+ (void)fprintf(fp, "maximum error: %g s\n",
+ (u_long)ntohl(ik->maxerror) * tscale);
+ (void)fprintf(fp, "estimated error: %g s\n",
+ (u_long)ntohl(ik->esterror) * tscale);
+ (void)fprintf(fp, "status: %04x ", status);
+#ifdef STA_PLL
+ if (status & STA_PLL) (void)fprintf(fp, " pll");
+#endif
+#ifdef STA_PPSFREQ
+ if (status & STA_PPSFREQ) (void)fprintf(fp, " ppsfreq");
+#endif
+#ifdef STA_PPSTIME
+ if (status & STA_PPSTIME) (void)fprintf(fp, " ppstime");
+#endif
+#ifdef STA_FLL
+ if (status & STA_FLL) (void)fprintf(fp, " fll");
+#endif
+#ifdef STA_INS
+ if (status & STA_INS) (void)fprintf(fp, " ins");
+#endif
+#ifdef STA_DEL
+ if (status & STA_DEL) (void)fprintf(fp, " del");
+#endif
+#ifdef STA_UNSYNC
+ if (status & STA_UNSYNC) (void)fprintf(fp, " unsync");
+#endif
+#ifdef STA_FREQHOLD
+ if (status & STA_FREQHOLD) (void)fprintf(fp, " freqhold");
+#endif
+#ifdef STA_PPSSIGNAL
+ if (status & STA_PPSSIGNAL) (void)fprintf(fp, " ppssignal");
+#endif
+#ifdef STA_PPSJITTER
+ if (status & STA_PPSJITTER) (void)fprintf(fp, " ppsjitter");
+#endif
+#ifdef STA_PPSWANDER
+ if (status & STA_PPSWANDER) (void)fprintf(fp, " ppswander");
+#endif
+#ifdef STA_PPSERROR
+ if (status & STA_PPSERROR) (void)fprintf(fp, " ppserror");
+#endif
+#ifdef STA_CLOCKERR
+ if (status & STA_CLOCKERR) (void)fprintf(fp, " clockerr");
+#endif
+#ifdef STA_NANO
+ if (status & STA_NANO) (void)fprintf(fp, " nano");
+#endif
+#ifdef STA_MODE
+ if (status & STA_MODE) (void)fprintf(fp, " mode=fll");
+#endif
+#ifdef STA_CLK
+ if (status & STA_CLK) (void)fprintf(fp, " src=B");
+#endif
+ (void)fprintf(fp, "\n");
+ (void)fprintf(fp, "pll time constant: %ld\n",
+ (u_long)ntohl(ik->constant));
+ (void)fprintf(fp, "precision: %g s\n",
+ (u_long)ntohl(ik->precision) * tscale);
+ (void)fprintf(fp, "frequency tolerance: %s ppm\n",
+ fptoa((s_fp)ntohl(ik->tolerance), 0));
+
+ /*
+ * For backwards compatibility (ugh), we find the pps variables
+ * only if the shift member is nonzero.
+ */
+ if (!ik->shift)
+ return;
+
+ /*
+ * pps variables
+ */
+ (void)fprintf(fp, "pps frequency: %s ppm\n",
+ fptoa((s_fp)ntohl(ik->ppsfreq), 3));
+ (void)fprintf(fp, "pps stability: %s ppm\n",
+ fptoa((s_fp)ntohl(ik->stabil), 3));
+ (void)fprintf(fp, "pps jitter: %g s\n",
+ (u_long)ntohl(ik->jitter) * tscale);
+ (void)fprintf(fp, "calibration interval: %d s\n",
+ 1 << ntohs(ik->shift));
+ (void)fprintf(fp, "calibration cycles: %ld\n",
+ (u_long)ntohl(ik->calcnt));
+ (void)fprintf(fp, "jitter exceeded: %ld\n",
+ (u_long)ntohl(ik->jitcnt));
+ (void)fprintf(fp, "stability exceeded: %ld\n",
+ (u_long)ntohl(ik->stbcnt));
+ (void)fprintf(fp, "calibration errors: %ld\n",
+ (u_long)ntohl(ik->errcnt));
+}
+
+#define IF_LIST_FMT "%2d %c %48s %c %c %12.12s %03lx %3lu %2lu %5lu %5lu %5lu %2lu %3lu %7lu\n"
+#define IF_LIST_FMT_STR "%2s %c %48s %c %c %12.12s %3s %3s %2s %5s %5s %5s %2s %3s %7s\n"
+#define IF_LIST_AFMT_STR " %48s %c\n"
+#define IF_LIST_LABELS "#", 'A', "Address/Mask/Broadcast", 'T', 'E', "IF name", "Flg", "TL", "#M", "recv", "sent", "drop", "S", "PC", "uptime"
+#define IF_LIST_LINE "==================================================================================================================\n"
+
+static void
+iflist(
+ FILE *fp,
+ struct info_if_stats *ifs,
+ int items,
+ int itemsize,
+ int res
+ )
+{
+ static char *actions = "?.+-";
+ sockaddr_u saddr;
+
+ if (res != 0)
+ return;
+
+ if (!checkitems(items, fp))
+ return;
+
+ if (!checkitemsize(itemsize, sizeof(struct info_if_stats)))
+ return;
+
+ fprintf(fp, IF_LIST_FMT_STR, IF_LIST_LABELS);
+ fprintf(fp, IF_LIST_LINE);
+
+ while (items > 0) {
+ SET_ADDR(saddr, ntohl(ifs->v6_flag),
+ ifs->unaddr.addr.s_addr, ifs->unaddr.addr6);
+ fprintf(fp, IF_LIST_FMT,
+ ntohl(ifs->ifnum),
+ actions[(ifs->action >= 1 && ifs->action < 4) ? ifs->action : 0],
+ stoa((&saddr)), 'A',
+ ifs->ignore_packets ? 'D' : 'E',
+ ifs->name,
+ (u_long)ntohl(ifs->flags),
+ (u_long)ntohl(ifs->last_ttl),
+ (u_long)ntohl(ifs->num_mcast),
+ (u_long)ntohl(ifs->received),
+ (u_long)ntohl(ifs->sent),
+ (u_long)ntohl(ifs->notsent),
+ (u_long)ntohl(ifs->scopeid),
+ (u_long)ntohl(ifs->peercnt),
+ (u_long)ntohl(ifs->uptime));
+
+ SET_ADDR(saddr, ntohl(ifs->v6_flag),
+ ifs->unmask.addr.s_addr, ifs->unmask.addr6);
+ fprintf(fp, IF_LIST_AFMT_STR, stoa(&saddr), 'M');
+
+ if (!ntohl(ifs->v6_flag) && ntohl(ifs->flags) & (INT_BCASTOPEN)) {
+ SET_ADDR(saddr, ntohl(ifs->v6_flag),
+ ifs->unbcast.addr.s_addr, ifs->unbcast.addr6);
+ fprintf(fp, IF_LIST_AFMT_STR, stoa(&saddr), 'B');
+
+ }
+
+ ifs++;
+ items--;
+ }
+}
+
+/*ARGSUSED*/
+static void
+get_if_stats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_if_stats *ifs;
+ int items;
+ int itemsize;
+ int res;
+
+ res = doquery(impl_ver, REQ_IF_STATS, 1, 0, 0, (char *)NULL, &items,
+ &itemsize, (void *)&ifs, 0,
+ sizeof(struct info_if_stats));
+ iflist(fp, ifs, items, itemsize, res);
+}
+
+/*ARGSUSED*/
+static void
+do_if_reload(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct info_if_stats *ifs;
+ int items;
+ int itemsize;
+ int res;
+
+ res = doquery(impl_ver, REQ_IF_RELOAD, 1, 0, 0, (char *)NULL, &items,
+ &itemsize, (void *)&ifs, 0,
+ sizeof(struct info_if_stats));
+ iflist(fp, ifs, items, itemsize, res);
+}
diff --git a/ntpq/Makefile.am b/ntpq/Makefile.am
new file mode 100644
index 0000000..50c072a
--- /dev/null
+++ b/ntpq/Makefile.am
@@ -0,0 +1,131 @@
+NULL=
+
+EXTRA_PROGRAMS= ntpq
+bin_PROGRAMS= $(NTPQ_DB)
+libexec_PROGRAMS= $(NTPQ_DL)
+sbin_PROGRAMS= $(NTPQ_DS)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+ntpq_LDADD = version.o $(LIBOPTS_LDADD)
+ntpq_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
+ntpq_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS)
+ntpq_LDADD += $(LDADD_NTP)
+noinst_HEADERS= ntpq.h
+noinst_LIBRARIES= libntpq.a
+libntpq_a_CFLAGS= -DNO_MAIN_ALLOWED -DBUILD_AS_LIB
+CLEANFILES=
+DISTCLEANFILES= .version version.c config.log $(man_MANS)
+ETAGS_ARGS= Makefile.am
+EXTRA_DIST= \
+ invoke-ntpq.menu \
+ invoke-ntpq.texi \
+ ntpq-opts.def \
+ ntpq.1ntpqman \
+ ntpq.1ntpqmdoc \
+ ntpq.man.in \
+ ntpq.mdoc.in \
+ ntpq.html \
+ ntpq.texi \
+ $(NULL)
+
+BUILT_SOURCES= ntpq-opts.c ntpq-opts.h
+
+html_DATA= \
+ $(srcdir)/ntpq.html \
+ $(NULL)
+
+noinst_DATA= \
+ $(srcdir)/invoke-ntpq.menu \
+ $(srcdir)/invoke-ntpq.texi \
+ $(srcdir)/ntpq.man.in \
+ $(srcdir)/ntpq.mdoc.in \
+ $(NULL)
+
+install-data-local: install-html
+
+man1_MANS=
+man8_MANS=
+man_MANS= ntpq.$(NTPQ_MS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+ntpq_SOURCES= ntpq.c ntpq-subs.c ntpq-opts.c ntpq-opts.h
+
+libntpq_a_SOURCES = libntpq.c libntpq.h libntpq_subs.c
+
+$(srcdir)/ntpq-opts.h: $(srcdir)/ntpq-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpq-opts.c: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) ntpq-opts.def
+
+###
+
+$(srcdir)/ntpq.1ntpqman: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpqman -Tagman-cmd.tpl ntpq-opts.def
+
+$(srcdir)/ntpq.man.in: $(srcdir)/ntpq.1ntpqman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqman > $(srcdir)/ntpq.man.in+
+ mv $(srcdir)/ntpq.man.in+ $(srcdir)/ntpq.man.in
+
+###
+
+$(srcdir)/ntpq.1ntpqmdoc: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpqmdoc -Tagmdoc-cmd.tpl ntpq-opts.def
+
+$(srcdir)/ntpq.mdoc.in: $(srcdir)/ntpq.1ntpqmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqmdoc > $(srcdir)/ntpq.mdoc.in+
+ mv $(srcdir)/ntpq.mdoc.in+ $(srcdir)/ntpq.mdoc.in
+
+###
+
+ntpq.$(NTPQ_MS): $(srcdir)/ntpq.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpq.$(NTPQ_MS)+:$(srcdir)/ntpq.$(MANTAGFMT).in
+ mv ntpq.$(NTPQ_MS)+ ntpq.$(NTPQ_MS)
+
+###
+
+$(srcdir)/invoke-ntpq.menu: $(srcdir)/invoke-ntpq.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpq.texi: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpq-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntpq.html: $(srcdir)/ntpq.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpq.html ntpq.texi || true )
+
+###
+
+$(PROGRAMS): version.o
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpq
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/check-libopts.mf
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/ntpq/Makefile.in b/ntpq/Makefile.in
new file mode 100644
index 0000000..ccb5a84
--- /dev/null
+++ b/ntpq/Makefile.in
@@ -0,0 +1,1208 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = ntpq$(EXEEXT)
+DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/bincheck.mf \
+ $(top_srcdir)/check-libopts.mf $(top_srcdir)/depsver.mf \
+ $(top_srcdir)/includes.mf $(top_srcdir)/sntp/check-libntp.mf
+subdir = ntpq
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+am__v_AR_0 = @echo " AR " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+libntpq_a_AR = $(AR) $(ARFLAGS)
+libntpq_a_LIBADD =
+am_libntpq_a_OBJECTS = libntpq_a-libntpq.$(OBJEXT) \
+ libntpq_a-libntpq_subs.$(OBJEXT)
+libntpq_a_OBJECTS = $(am_libntpq_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+am_ntpq_OBJECTS = ntpq.$(OBJEXT) ntpq-subs.$(OBJEXT) \
+ ntpq-opts.$(OBJEXT)
+ntpq_OBJECTS = $(am_ntpq_OBJECTS)
+am__DEPENDENCIES_1 =
+ntpq_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) ../libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libntpq_a_SOURCES) $(ntpq_SOURCES)
+DIST_SOURCES = $(libntpq_a_SOURCES) $(ntpq_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+bin_PROGRAMS = $(NTPQ_DB)
+libexec_PROGRAMS = $(NTPQ_DL)
+sbin_PROGRAMS = $(NTPQ_DS)
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+ntpq_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \
+ $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(EDITLINE_LIBS) \
+ $(LDADD_NTP)
+noinst_HEADERS = ntpq.h
+noinst_LIBRARIES = libntpq.a
+libntpq_a_CFLAGS = -DNO_MAIN_ALLOWED -DBUILD_AS_LIB
+CLEANFILES = check-libopts check-libntp .deps-ver
+DISTCLEANFILES = .version version.c config.log $(man_MANS)
+ETAGS_ARGS = Makefile.am
+EXTRA_DIST = \
+ invoke-ntpq.menu \
+ invoke-ntpq.texi \
+ ntpq-opts.def \
+ ntpq.1ntpqman \
+ ntpq.1ntpqmdoc \
+ ntpq.man.in \
+ ntpq.mdoc.in \
+ ntpq.html \
+ ntpq.texi \
+ $(NULL)
+
+BUILT_SOURCES = ntpq-opts.c ntpq-opts.h check-libopts check-libntp \
+ .deps-ver
+html_DATA = \
+ $(srcdir)/ntpq.html \
+ $(NULL)
+
+noinst_DATA = \
+ $(srcdir)/invoke-ntpq.menu \
+ $(srcdir)/invoke-ntpq.texi \
+ $(srcdir)/ntpq.man.in \
+ $(srcdir)/ntpq.mdoc.in \
+ $(NULL)
+
+man1_MANS =
+man8_MANS =
+man_MANS = ntpq.$(NTPQ_MS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+ntpq_SOURCES = ntpq.c ntpq-subs.c ntpq-opts.c ntpq-opts.h
+libntpq_a_SOURCES = libntpq.c libntpq.h libntpq_subs.c
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/sntp/check-libntp.mf $(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 ntpq/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ntpq/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libntpq.a: $(libntpq_a_OBJECTS) $(libntpq_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libntpq.a
+ $(AM_V_AR)$(libntpq_a_AR) libntpq.a $(libntpq_a_OBJECTS) $(libntpq_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libntpq.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+ntpq$(EXEEXT): $(ntpq_OBJECTS) $(ntpq_DEPENDENCIES)
+ @rm -f ntpq$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntpq_OBJECTS) $(ntpq_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libntpq_a-libntpq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libntpq_a-libntpq_subs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpq-opts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpq-subs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpq.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libntpq_a-libntpq.o: libntpq.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq.o -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq.Tpo -c -o libntpq_a-libntpq.o `test -f 'libntpq.c' || echo '$(srcdir)/'`libntpq.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libntpq_a-libntpq.Tpo $(DEPDIR)/libntpq_a-libntpq.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq.c' object='libntpq_a-libntpq.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq.o `test -f 'libntpq.c' || echo '$(srcdir)/'`libntpq.c
+
+libntpq_a-libntpq.obj: libntpq.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq.obj -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq.Tpo -c -o libntpq_a-libntpq.obj `if test -f 'libntpq.c'; then $(CYGPATH_W) 'libntpq.c'; else $(CYGPATH_W) '$(srcdir)/libntpq.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libntpq_a-libntpq.Tpo $(DEPDIR)/libntpq_a-libntpq.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq.c' object='libntpq_a-libntpq.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq.obj `if test -f 'libntpq.c'; then $(CYGPATH_W) 'libntpq.c'; else $(CYGPATH_W) '$(srcdir)/libntpq.c'; fi`
+
+libntpq_a-libntpq_subs.o: libntpq_subs.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq_subs.o -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq_subs.Tpo -c -o libntpq_a-libntpq_subs.o `test -f 'libntpq_subs.c' || echo '$(srcdir)/'`libntpq_subs.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libntpq_a-libntpq_subs.Tpo $(DEPDIR)/libntpq_a-libntpq_subs.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq_subs.c' object='libntpq_a-libntpq_subs.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq_subs.o `test -f 'libntpq_subs.c' || echo '$(srcdir)/'`libntpq_subs.c
+
+libntpq_a-libntpq_subs.obj: libntpq_subs.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -MT libntpq_a-libntpq_subs.obj -MD -MP -MF $(DEPDIR)/libntpq_a-libntpq_subs.Tpo -c -o libntpq_a-libntpq_subs.obj `if test -f 'libntpq_subs.c'; then $(CYGPATH_W) 'libntpq_subs.c'; else $(CYGPATH_W) '$(srcdir)/libntpq_subs.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libntpq_a-libntpq_subs.Tpo $(DEPDIR)/libntpq_a-libntpq_subs.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libntpq_subs.c' object='libntpq_a-libntpq_subs.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libntpq_a_CFLAGS) $(CFLAGS) -c -o libntpq_a-libntpq_subs.obj `if test -f 'libntpq_subs.c'; then $(CYGPATH_W) 'libntpq_subs.c'; else $(CYGPATH_W) '$(srcdir)/libntpq_subs.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: all check install install-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-noinstLIBRARIES clean-sbinPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-data-local install-dvi install-dvi-am \
+ install-exec install-exec-am install-exec-hook install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecPROGRAMS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinPROGRAMS install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-htmlDATA uninstall-libexecPROGRAMS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinPROGRAMS
+
+
+install-data-local: install-html
+
+$(srcdir)/ntpq-opts.h: $(srcdir)/ntpq-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpq-opts.c: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) ntpq-opts.def
+
+###
+
+$(srcdir)/ntpq.1ntpqman: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpqman -Tagman-cmd.tpl ntpq-opts.def
+
+$(srcdir)/ntpq.man.in: $(srcdir)/ntpq.1ntpqman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqman > $(srcdir)/ntpq.man.in+
+ mv $(srcdir)/ntpq.man.in+ $(srcdir)/ntpq.man.in
+
+###
+
+$(srcdir)/ntpq.1ntpqmdoc: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpqmdoc -Tagmdoc-cmd.tpl ntpq-opts.def
+
+$(srcdir)/ntpq.mdoc.in: $(srcdir)/ntpq.1ntpqmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqmdoc > $(srcdir)/ntpq.mdoc.in+
+ mv $(srcdir)/ntpq.mdoc.in+ $(srcdir)/ntpq.mdoc.in
+
+###
+
+ntpq.$(NTPQ_MS): $(srcdir)/ntpq.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpq.$(NTPQ_MS)+:$(srcdir)/ntpq.$(MANTAGFMT).in
+ mv ntpq.$(NTPQ_MS)+ ntpq.$(NTPQ_MS)
+
+###
+
+$(srcdir)/invoke-ntpq.menu: $(srcdir)/invoke-ntpq.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpq.texi: $(srcdir)/ntpq-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpq-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntpq.html: $(srcdir)/ntpq.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpq.html ntpq.texi || true )
+
+###
+
+$(PROGRAMS): version.o
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpq
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libopts: ../sntp/libopts/libopts.la
+ @echo stamp > $@
+
+../sntp/libopts/libopts.la:
+ -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/ntpq/README b/ntpq/README
new file mode 100644
index 0000000..d280f74
--- /dev/null
+++ b/ntpq/README
@@ -0,0 +1,6 @@
+README file for directory ./ntpq of the NTP Version 4 distribution
+
+This directory contains the sources for the ntpq utility program. See
+the README and RELNOTES files in the parent directory for directions on
+how to make and install this program. The current version number of this
+program is in the version.c file.
diff --git a/ntpq/invoke-ntpq.menu b/ntpq/invoke-ntpq.menu
new file mode 100644
index 0000000..c06f90d
--- /dev/null
+++ b/ntpq/invoke-ntpq.menu
@@ -0,0 +1 @@
+* ntpq Invocation:: Invoking ntpq
diff --git a/ntpq/invoke-ntpq.texi b/ntpq/invoke-ntpq.texi
new file mode 100644
index 0000000..e30ccd1
--- /dev/null
+++ b/ntpq/invoke-ntpq.texi
@@ -0,0 +1,1086 @@
+@node ntpq Invocation
+@section Invoking ntpq
+@pindex ntpq
+@cindex standard NTP query program
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:58:08 AM by AutoGen 5.18.5pre4
+# From the definitions ntpq-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+The
+@code{ntpq}
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty-printed output
+options being available.
+The
+@code{ntpq}
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+
+If one or more request options is included on the command line
+when
+@code{ntpq}
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+@code{ntpq}
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+@code{ntpq}
+utility will prompt for
+commands if the standard input is a terminal device.
+
+@code{ntpq}
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+@code{ntpq}
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+
+Specifying a
+command line option other than
+@code{-i}
+or
+@code{-n}
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+@code{ntpq}
+will attempt to read
+interactive format commands from the standard input.
+@subsubsection Internal Commands
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+
+A
+number of interactive format commands are executed entirely within
+the
+@code{ntpq}
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+@table @asis
+@item @code{?} @code{[@kbd{command_keyword}]}
+@item @code{help} @code{[@kbd{command_keyword}]}
+A
+@quoteleft{}?@quoteright{}
+by itself will print a list of all the command
+keywords known to this incarnation of
+@code{ntpq}
+A
+@quoteleft{}?@quoteright{}
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+@code{ntpq}
+than this manual
+page.
+@item @code{addvars} @kbd{variable_name}@code{[@code{=value}]} @code{...}
+@item @code{rmvars} @kbd{variable_name} @code{...}
+@item @code{clearvars}
+@item @code{showvars}
+The data carried by NTP mode 6 messages consists of a list of
+items of the form
+@quoteleft{}variable_name=value@quoteright{},
+where the
+@quoteleft{}=value@quoteright{}
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+@code{ntpq}
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+@code{readlist}
+and
+@code{writelist}
+commands described below.
+The
+@code{addvars}
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma-separated and not contain white space.
+The
+@code{rmvars}
+command can be used to remove individual variables from the list,
+while the
+@code{clearlist}
+command removes all variables from the
+list.
+The
+@code{showvars}
+command displays the current list of optional variables.
+@item @code{authenticate} @code{[yes | no]}
+Normally
+@code{ntpq}
+does not authenticate requests unless
+they are write requests.
+The command
+@quoteleft{}authenticate yes@quoteright{}
+causes
+@code{ntpq}
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+@code{peer}
+display.
+The command
+@quoteleft{}authenticate@quoteright{}
+causes
+@code{ntpq}
+to display whether or not
+@code{ntpq}
+is currently autheinticating requests.
+@item @code{cooked}
+Causes output from query commands to be "cooked", so that
+variables which are recognized by
+@code{ntpq}
+will have their
+values reformatted for human consumption.
+Variables which
+@code{ntpq}
+thinks should have a decodable value but didn't are
+marked with a trailing
+@quoteleft{}?@quoteright{}.
+@item @code{debug} @code{[@code{more} | @code{less} | @code{off}]}
+With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+@item @code{delay} @kbd{milliseconds}
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+@item @code{exit}
+Exit
+@code{ntpq}
+@item @code{host} @kbd{hostname}
+Set the host to which future queries will be sent.
+@kbd{hostname}
+may be either a host name or a numeric address.
+@item @code{hostnames} @code{[@code{yes} | @code{no}]}
+If
+@code{yes}
+is specified, host names are printed in
+information displays.
+If
+@code{no}
+is specified, numeric
+addresses are printed instead.
+The default is
+@code{yes},
+unless
+modified using the command line
+@code{-n}
+switch.
+@item @code{keyid} @kbd{keyid}
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+@item @code{keytype} @code{[@code{md5} | @code{OpenSSLDigestType}]}
+Specify the type of key to use for authenticating requests.
+@code{md5}
+is alway supported.
+If
+@code{ntpq}
+was built with OpenSSL support,
+any digest type supported by OpenSSL can also be provided.
+If no argument is given, the current
+@code{keytype}
+is displayed.
+@item @code{ntpversion} @code{[@code{1} | @code{2} | @code{3} | @code{4}]}
+Sets the NTP version number which
+@code{ntpq}
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+@item @code{passwd}
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+@code{poll}
+@kbd{n}
+@code{verbose}
+@item @code{quit}
+Exit
+@code{ntpq}
+@item @code{raw}
+Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+@item @code{timeout} @kbd{milliseconds}
+Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+@code{ntpq}
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+@item @code{version}
+Print the version of the
+@code{ntpq}
+program.
+@end table
+
+@subsubsection Control Message Commands
+Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode-6 message to the server and expect a single response message.
+The exceptions are the
+@code{peers}
+command, which sends a series of messages,
+and the
+@code{mreadlist}
+and
+@code{mreadvar}
+commands, which iterate over a range of associations.
+@table @asis
+@item @code{associations}
+Display a list of mobilized associations in the form:
+@example
+ind assid status conf reach auth condition last_event cnt
+@end example
+@table @asis
+@item Sy String Ta Sy Description
+@item @code{ind} @code{Ta} @code{index} @code{on} @code{this} @code{list}
+@item @code{assid} @code{Ta} @code{association} @code{ID}
+@item @code{status} @code{Ta} @code{peer} @code{status} @code{word}
+@item @code{conf} @code{Ta} @code{yes}: @code{persistent,} @code{no}: @code{ephemeral}
+@item @code{reach} @code{Ta} @code{yes}: @code{reachable,} @code{no}: @code{unreachable}
+@item @code{auth} @code{Ta} @code{ok}, @code{yes}, @code{bad} @code{and} @code{none}
+@item @code{condition} @code{Ta} @code{selection} @code{status} @code{(see} @code{the} @code{select} @code{field} @code{of} @code{the} @code{peer} @code{status} @code{word)}
+@item @code{last_event} @code{Ta} @code{event} @code{report} @code{(see} @code{the} @code{event} @code{field} @code{of} @code{the} @code{peer} @code{status} @code{word)}
+@item @code{cnt} @code{Ta} @code{event} @code{count} @code{(see} @code{the} @code{count} @code{field} @code{of} @code{the} @code{peer} @code{status} @code{word)}
+@end table
+@item @code{authinfo}
+Display the authentication statistics.
+@item @code{clockvar} @kbd{assocID} @code{[@kbd{name}@code{[@code{=}@kbd{value}]}]} @code{[...]}
+@item @code{cv} @kbd{assocID} @code{[@kbd{name}@code{[@code{=}@kbd{value}]}]} @code{[...]}
+Display a list of clock variables for those associations supporting a reference clock.
+@item @code{:config} @code{[...]}
+Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
+@item @code{config-from-file} @kbd{filename}
+Send the each line of
+@kbd{filename}
+to the server as run-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
+@item @code{ifstats}
+Display statistics for each local network address. Authentication is required.
+@item @code{iostats}
+Display network and reference clock I/O statistics.
+@item @code{kerninfo}
+Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
+@item @code{lassociations}
+Perform the same function as the associations command, except display mobilized and unmobilized associations.
+@item @code{lopeers} @code{[@code{-4} | @code{-6}]}
+Obtain and print a list of all peers and clients showing
+@kbd{dstadr}
+(associated with any given IP version).
+@item @code{lpeers} @code{[@code{-4} | @code{-6}]}
+Print a peer spreadsheet for the appropriate IP version(s).
+@kbd{dstadr}
+(associated with any given IP version).
+@item @code{monstats}
+Display monitor facility statistics.
+@item @code{mrulist} @code{[@code{limited} | @code{kod} | @code{mincount}=@kbd{count} | @code{laddr}=@kbd{localaddr} | @code{sort}=@kbd{sortorder} | @code{resany}=@kbd{hexmask} | @code{resall}=@kbd{hexmask}]}
+Obtain and print traffic counts collected and maintained by the monitor facility.
+With the exception of
+@code{sort}=@kbd{sortorder},
+the options filter the list returned by
+@code{ntpd.}
+The
+@code{limited}
+and
+@code{kod}
+options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
+The
+@code{mincount}=@kbd{count}
+option filters entries representing less than
+@kbd{count}
+packets.
+The
+@code{laddr}=@kbd{localaddr}
+option filters entries for packets received on any local address other than
+@kbd{localaddr}.
+@code{resany}=@kbd{hexmask}
+and
+@code{resall}=@kbd{hexmask}
+filter entries containing none or less than all, respectively, of the bits in
+@kbd{hexmask},
+which must begin with
+@code{0x}.
+The
+@kbd{sortorder}
+defaults to
+@code{lstint}
+and may be any of
+@code{addr},
+@code{count},
+@code{avgint},
+@code{lstint},
+or any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+@table @asis
+@item Column
+Description
+@item @code{lstint}
+Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
+@code{ntpq}
+@item @code{avgint}
+Average interval in s between packets from this address.
+@item @code{rstr}
+Restriction flags associated with this address.
+Most are copied unchanged from the matching
+@code{restrict}
+command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
+@item @code{r}
+Rate control indicator, either
+a period,
+@code{L}
+or
+@code{K}
+for no rate control response,
+rate limiting by discarding, or rate limiting with a KoD response, respectively.
+@item @code{m}
+Packet mode.
+@item @code{v}
+Packet version number.
+@item @code{count}
+Packets received from this address.
+@item @code{rport}
+Source port of last packet from this address.
+@item @code{remote} @code{address}
+DNS name, numeric address, or address followed by
+claimed DNS name which could not be verified in parentheses.
+@end table
+@item @code{mreadvar} @code{assocID} @code{assocID} @code{[@kbd{variable_name}@code{[=@kbd{value}]} ...]}
+@item @code{mrv} @code{assocID} @code{assocID} @code{[@kbd{variable_name}@code{[=@kbd{value}]} ...]}
+Perform the same function as the
+@code{readvar}
+command, except for a range of association IDs.
+This range is determined from the association list cached by the most recent
+@code{associations}
+command.
+@item @code{opeers} @code{[@code{-4} | @code{-6}]}
+Obtain and print the old-style list of all peers and clients showing
+@kbd{dstadr}
+(associated with any given IP version),
+rather than the
+@kbd{refid}.
+@item @code{passociations}
+Perform the same function as the
+@code{associations}
+command,
+except that it uses previously stored data rather than making a new query.
+@item @code{peers}
+Display a list of peers in the form:
+@example
+[tally]remote refid st t when pool reach delay offset jitter
+@end example
+@table @asis
+@item Variable
+Description
+@item @code{[tally]}
+single-character code indicating current value of the
+@code{select}
+field of the
+.Lk decode.html#peer "peer status word"
+@item @code{remote}
+host name (or IP number) of peer.
+The value displayed will be truncated to 15 characters unless the
+@code{-w}
+flag is given, in which case the full value will be displayed
+on the first line,
+and the remaining data is displayed on the next line.
+@item @code{refid}
+association ID or
+.Lk decode.html#kiss "'kiss code"
+@item @code{st}
+stratum
+@item @code{t}
+@code{u}:
+unicast or manycast client,
+@code{b}:
+broadcast or multicast client,
+@code{l}:
+local (reference clock),
+@code{s}:
+symmetric (peer),
+@code{A}:
+manycast server,
+@code{B}:
+broadcast server,
+@code{M}:
+multicast server
+@item @code{when}
+sec/min/hr since last received packet
+@item @code{poll}
+poll interval (log2 s)
+@item @code{reach}
+reach shift register (octal)
+@item @code{delay}
+roundtrip delay
+@item @code{offset}
+offset of server relative to this host
+@item @code{jitter}
+jitter
+@end table
+@item @code{pstats} @kbd{assocID}
+Show the statistics for the peer with the given
+@kbd{assocID}.
+@item @code{readlist} @kbd{assocID}
+@item @code{rl} @kbd{assocID}
+Read the system or peer variables included in the variable list.
+@item @code{readvar} @kbd{assocID} @kbd{name}@code{[=@kbd{value}]} @code{[, ...]}
+@item @code{rv} @kbd{assocID} @kbd{name}@code{[=@kbd{value}]} @code{[, ...]}
+Display the specified variables.
+If
+@kbd{assocID}
+is zero, the variables are from the
+@ref{System Variables}
+name space, otherwise they are from the
+@ref{Peer Variables}
+name space.
+The
+@kbd{assocID}
+is required, as the same name can occur in both spaces.
+If no
+@kbd{name}
+is included, all operative variables in the name space are displayed.
+
+In this case only, if the
+@kbd{assocID}
+is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds
+and frequency values in parts-per-million (PPM).
+Some NTP timestamps are represented in the format
+YYYYMMDDTTTT ,
+where YYYY is the year,
+MM the month of year,
+DD the day of month and
+TTTT the time of day.
+@item @code{reslist}
+Show the access control (restrict) list for
+@code{ntpq}
+
+@item @code{saveconfig} @kbd{filename}
+Write the current configuration,
+including any runtime modifications given with
+@code{:config}
+or
+@code{config-from-file},
+to the ntpd host's file
+@kbd{filename}.
+This command will be rejected by the server unless
+.Lk miscopt.html#saveconfigdir "saveconfigdir"
+appears in the
+@code{ntpd}
+configuration file.
+@kbd{filename}
+can use
+@code{strftime()}
+format specifies to substitute the current date and time, for example,
+@code{q]saveconfig} @code{ntp-%Y%m%d-%H%M%S.confq]}.
+The filename used is stored in system variable
+@code{savedconfig}.
+Authentication is required.
+@item @code{timerstats}
+Display interval timer counters.
+@item @code{writelist} @kbd{assocID}
+Write the system or peer variables included in the variable list.
+@item @code{writevar} @kbd{assocID} @kbd{name}=@kbd{value} @code{[, ...]}
+Write the specified variables.
+If the
+@kbd{assocID}
+is zero, the variables are from the
+@ref{System Variables}
+name space, otherwise they are from the
+@ref{Peer Variables}
+name space.
+The
+@kbd{assocID}
+is required, as the same name can occur in both spaces.
+@item @code{sysinfo}
+Display operational summary.
+@item @code{sysstats}
+Print statistics counters maintained in the protocol module.
+@end table
+
+@subsubsection Status Words and Kiss Codes
+
+The current state of the operating program is shown
+in a set of status words
+maintained by the system.
+Status information is also available on a per-association basis.
+These words are displayed in the
+@code{rv}
+and
+@code{as}
+commands both in hexadecimal and in decoded short tip strings.
+The codes, tips and short explanations are documented on the
+.Lk decode.html "Event Messages and Status Words"
+page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+
+Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+.Lk decode.html#kiss "kiss codes" .
+The original purpose was for kiss-o'-death (KoD) packets
+sent by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+
+@subsubsection System Variables
+The following system variables appear in the
+@code{rv}
+billboard.
+Not all variables are displayed in some configurations.
+@table @asis
+@item Variable
+Description
+@item @code{status}
+.Lk decode.html#sys "system status word"
+@item @code{version}
+NTP software version and build time
+@item @code{processor}
+hardware platform and version
+@item @code{system}
+operating system and version
+@item @code{leap}
+leap warning indicator (0-3)
+@item @code{stratum}
+stratum (1-15)
+@item @code{precision}
+precision (log2 s)
+@item @code{rootdelay}
+total roundtrip delay to the primary reference clock
+@item @code{rootdisp}
+total dispersion to the primary reference clock
+@item @code{peer}
+system peer association ID
+@item @code{tc}
+time constant and poll exponent (log2 s) (3-17)
+@item @code{mintc}
+minimum time constant (log2 s) (3-10)
+@item @code{clock}
+date and time of day
+@item @code{refid}
+reference ID or
+.Lk decode.html#kiss "kiss code"
+@item @code{reftime}
+reference time
+@item @code{offset}
+combined offset of server relative to this host
+@item @code{sys_jitter}
+combined system jitter
+@item @code{frequency}
+frequency offset (PPM) relative to hardware clock
+@item @code{clk_wander}
+clock frequency wander (PPM)
+@item @code{clk_jitter}
+clock jitter
+@item @code{tai}
+TAI-UTC offset (s)
+@item @code{leapsec}
+NTP seconds when the next leap second is/was inserted
+@item @code{expire}
+NTP seconds when the NIST leapseconds file expires
+@end table
+The jitter and wander statistics are exponentially-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed,
+including some or all of the following,
+depending on the particular Autokey dance:
+
+@table @asis
+@item Variable
+Description
+@item @code{host}
+Autokey host name for this host
+@item @code{ident}
+Autokey group name for this host
+@item @code{flags}
+host flags (see Autokey specification)
+@item @code{digest}
+OpenSSL message digest algorithm
+@item @code{signature}
+OpenSSL digest/signature scheme
+@item @code{update}
+NTP seconds at last signature update
+@item @code{cert}
+certificate subject, issuer and certificate flags
+@item @code{until}
+NTP seconds when the certificate expires
+@end table
+@subsubsection Peer Variables
+The following peer variables appear in the
+@code{rv}
+billboard for each association.
+Not all variables are displayed in some configurations.
+
+@table @asis
+@item Variable
+Description
+@item @code{associd}
+association ID
+@item @code{status}
+.Lk decode.html#peer "peer status word"
+@item @code{srcadr}
+source (remote) IP address
+@item @code{srcport}
+source (remote) port
+@item @code{dstadr}
+destination (local) IP address
+@item @code{dstport}
+destination (local) port
+@item @code{leap}
+leap indicator (0-3)
+@item @code{stratum}
+stratum (0-15)
+@item @code{precision}
+precision (log2 s)
+@item @code{rootdelay}
+total roundtrip delay to the primary reference clock
+@item @code{rootdisp}
+total root dispersion to the primary reference clock
+@item @code{refid}
+reference ID or
+.Lk decode.html#kiss "kiss code"
+@item @code{reftime}
+reference time
+@item @code{reach}
+reach register (octal)
+@item @code{unreach}
+unreach counter
+@item @code{hmode}
+host mode (1-6)
+@item @code{pmode}
+peer mode (1-5)
+@item @code{hpoll}
+host poll exponent (log2 s) (3-17)
+@item @code{ppoll}
+peer poll exponent (log2 s) (3-17)
+@item @code{headway}
+headway (see
+.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" )
+@item @code{flash}
+.Lk decode.html#flash "flash status word"
+@item @code{offset}
+filter offset
+@item @code{delay}
+filter delay
+@item @code{dispersion}
+filter dispersion
+@item @code{jitter}
+filter jitter
+@item @code{ident}
+Autokey group name for this association
+@item @code{bias}
+unicast/broadcast bias
+@item @code{xleave}
+interleave delay (see
+.Lk xleave.html "NTP Interleaved Modes" )
+@end table
+The
+@code{bias}
+variable is calculated when the first broadcast packet is received
+after the calibration volley.
+It represents the offset of the broadcast subgraph relative to the unicast subgraph.
+The
+@code{xleave}
+variable appears only for the interleaved symmetric and interleaved modes.
+It represents the internal queuing, buffering and transmission delays
+for the preceding packet.
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+@table @asis
+@item Variable
+Description
+@item @code{flags}
+peer flags (see Autokey specification)
+@item @code{host}
+Autokey server name
+@item @code{flags}
+peer flags (see Autokey specification)
+@item @code{signature}
+OpenSSL digest/signature scheme
+@item @code{initsequence}
+initial key ID
+@item @code{initkey}
+initial key index
+@item @code{timestamp}
+Autokey signature timestamp
+@end table
+
+@subsubsection Clock Variables
+The following clock variables appear in the
+@code{cv}
+billboard for each association with a reference clock.
+Not all variables are displayed in some configurations.
+@table @asis
+@item Variable
+Description
+@item @code{associd}
+association ID
+@item @code{status}
+.Lk decode.html#clock "clock status word"
+@item @code{device}
+device description
+@item @code{timecode}
+ASCII time code string (specific to device)
+@item @code{poll}
+poll messages sent
+@item @code{noreply}
+no reply
+@item @code{badformat}
+bad format
+@item @code{baddata}
+bad date or time
+@item @code{fudgetime1}
+fudge time 1
+@item @code{fudgetime2}
+fudge time 2
+@item @code{stratum}
+driver stratum
+@item @code{refid}
+driver reference ID
+@item @code{flags}
+driver flags
+@end table
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpq} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpq usage:: ntpq help/usage (@option{--help})
+* ntpq ipv4:: ipv4 option (-4)
+* ntpq ipv6:: ipv6 option (-6)
+* ntpq command:: command option (-c)
+* ntpq interactive:: interactive option (-i)
+* ntpq numeric:: numeric option (-n)
+* ntpq old-rv:: old-rv option
+* ntpq peers:: peers option (-p)
+* ntpq wide:: wide option (-w)
+* ntpq config:: presetting/configuring ntpq
+* ntpq exit status:: exit status
+@end menu
+
+@node ntpq usage
+@subsection ntpq help/usage (@option{--help})
+@cindex ntpq help
+
+This is the automatically generated usage text for ntpq.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpq - standard NTP query program - Ver. 4.2.7p482
+Usage: ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
+ Flg Arg Option-Name Description
+ -4 no ipv4 Force IPv4 DNS name resolution
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -c Str command run a command and exit
+ - may appear multiple times
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -i no interactive Force ntpq to operate in interactive mode
+ - prohibits these options:
+ command
+ peers
+ -n no numeric numeric host addresses
+ no old-rv Always output status line with readvar
+ -p no peers Print a list of the peers
+ - prohibits the option 'interactive'
+ -w no wide Display the full 'remote' value
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -> opt save-opts save the option state to a config file
+ -< Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTPQ_*
+
+Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org>
+@end example
+@exampleindent 4
+
+@node ntpq ipv4
+@subsection ipv4 option (-4)
+@cindex ntpq-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+@node ntpq ipv6
+@subsection ipv6 option (-6)
+@cindex ntpq-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+@node ntpq command
+@subsection command option (-c)
+@cindex ntpq-command
+
+This is the ``run a command and exit'' option.
+This option takes a string argument @file{cmd}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+@node ntpq interactive
+@subsection interactive option (-i)
+@cindex ntpq-interactive
+
+This is the ``force ntpq to operate in interactive mode'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+command, peers.
+@end itemize
+
+Force @code{ntpq} to operate in interactive mode.
+Prompts will be written to the standard output and
+commands read from the standard input.
+@node ntpq numeric
+@subsection numeric option (-n)
+@cindex ntpq-numeric
+
+This is the ``numeric host addresses'' option.
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+@node ntpq old-rv
+@subsection old-rv option
+@cindex ntpq-old-rv
+
+This is the ``always output status line with readvar'' option.
+By default, @code{ntpq} now suppresses the @code{associd=...}
+line that precedes the output of @code{readvar}
+(alias @code{rv}) when a single variable is requested, such as
+@code{ntpq -c "rv 0 offset"}.
+This option causes @code{ntpq} to include both lines of output
+for a single-variable @code{readvar}.
+Using an environment variable to
+preset this option in a script will enable both older and
+newer @code{ntpq} to behave identically in this regard.
+@node ntpq peers
+@subsection peers option (-p)
+@cindex ntpq-peers
+
+This is the ``print a list of the peers'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+interactive.
+@end itemize
+
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+@node ntpq wide
+@subsection wide option (-w)
+@cindex ntpq-wide
+
+This is the ``display the full 'remote' value'' option.
+Display the full value of the 'remote' value. If this requires
+more than 15 characters, display the full value, emit a newline,
+and continue the data display properly indented on the next line.
+
+
+@node ntpq config
+@subsection presetting/configuring ntpq
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTPQ} and @code{NTPQ_<OPTION_NAME>}. @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPQ} variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntpq} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+@example
+[NTPQ]
+@end example
+@noindent
+or by
+@example
+<?program ntpq>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+ <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions. You simply note that it is a
+hierarchicly valued option. @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version. This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpq exit status
+@subsection ntpq exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error. Please report
+it to autogen-users@@lists.sourceforge.net. Thank you.
+@end table
diff --git a/ntpq/libntpq.c b/ntpq/libntpq.c
new file mode 100644
index 0000000..becd956
--- /dev/null
+++ b/ntpq/libntpq.c
@@ -0,0 +1,771 @@
+/*****************************************************************************
+ *
+ * libntpq.c
+ *
+ * This is the wrapper library for ntpq, the NTP query utility.
+ * This library reuses the sourcecode from ntpq and exports a number
+ * of useful functions in a library that can be linked against applications
+ * that need to query the status of a running ntpd. The whole
+ * communcation is based on mode 6 packets.
+ *
+ ****************************************************************************/
+#define LIBNTPQ_C
+#define NO_MAIN_ALLOWED 1
+/* #define BUILD_AS_LIB Already provided by the Makefile */
+
+#include "ntpq.c"
+#include "libntpq.h"
+
+/* Function Prototypes */
+
+
+const char *Version = "libntpq 0.3beta";
+
+/* global variables used for holding snapshots of data */
+char peervars[NTPQ_BUFLEN];
+int peervarlen = 0;
+associd_t peervar_assoc = 0;
+char clockvars[NTPQ_BUFLEN];
+int clockvarlen = 0;
+int clockvar_assoc = 0;
+char sysvars[NTPQ_BUFLEN];
+int sysvarlen = 0;
+char *ntpq_resultbuffer[NTPQ_BUFLEN];
+unsigned short ntpq_associations[MAXASSOC];
+struct ntpq_varlist ntpq_varlist[MAXLIST];
+
+/*****************************************************************************
+ *
+ * ntpq_stripquotes
+ *
+ * Parses a given character buffer srcbuf and removes all quoted
+ * characters. The resulting string is copied to the specified
+ * resultbuf character buffer. E.g. \" will be translated into "
+ *
+ ****************************************************************************
+ * Parameters:
+ * resultbuf char* The resulting string without quoted
+ * characters
+ * srcbuf char* The buffer holding the original string
+ * datalen int The number of bytes stored in srcbuf
+ * maxlen int Max. number of bytes for resultbuf
+ *
+ * Returns:
+ * int number of chars that have been copied to
+ * resultbuf
+ ****************************************************************************/
+
+int ntpq_stripquotes ( char *resultbuf, char *srcbuf, int datalen, int maxlen )
+{
+ char* tmpbuf = srcbuf;
+
+ while ( *tmpbuf != 0 )
+ {
+ if ( *tmpbuf == '\"' )
+ {
+ tmpbuf++;
+ continue;
+ }
+
+ if ( *tmpbuf == '\\' )
+ {
+ tmpbuf++;
+ switch ( *tmpbuf )
+ {
+ /* ignore if end of string */
+ case 0:
+ continue;
+ /* skip and do not copy */
+ case '\"': /* quotes */
+ case 'n': /*newline*/
+ case 'r': /*carriage return*/
+ case 'g': /*bell*/
+ case 't': /*tab*/
+ tmpbuf++;
+ continue;
+ }
+ }
+
+ *resultbuf++ = *tmpbuf++;
+
+ }
+
+ *resultbuf = 0;
+ return strlen(resultbuf);
+}
+
+
+/*****************************************************************************
+ *
+ * ntpq_getvar
+ *
+ * This function parses a given buffer for a variable/value pair and
+ * copies the value of the requested variable into the specified
+ * varvalue buffer.
+ *
+ * It returns the number of bytes copied or zero for an empty result
+ * (=no matching variable found or empty value)
+ *
+ ****************************************************************************
+ * Parameters:
+ * resultbuf char* The resulting string without quoted
+ * characters
+ * datalen size_t The number of bytes stored in
+ * resultbuf
+ * varname char* Name of the required variable
+ * varvalue char* Where the value of the variable should
+ * be stored
+ * maxlen size_t Max. number of bytes for varvalue
+ *
+ * Returns:
+ * size_t number of chars that have been copied to
+ * varvalue
+ ****************************************************************************/
+
+size_t
+ntpq_getvar(
+ const char * resultbuf,
+ size_t datalen,
+ const char * varname,
+ char * varvalue,
+ size_t maxlen)
+{
+ char * name;
+ char * value;
+ int idatalen;
+
+ value = NULL;
+ idatalen = (int)datalen;
+
+ while (nextvar(&idatalen, &resultbuf, &name, &value)) {
+ if (strcmp(varname, name) == 0) {
+ ntpq_stripquotes(varvalue, value, strlen(value), maxlen);
+
+ return strlen(varvalue);
+ }
+ }
+
+ return 0;
+}
+
+
+/*****************************************************************************
+ *
+ * ntpq_queryhost
+ *
+ * Sends a mode 6 query packet to the current open host (see
+ * ntpq_openhost) and stores the requested variable set in the specified
+ * character buffer.
+ * It returns the number of bytes read or zero for an empty result
+ * (=no answer or empty value)
+ *
+ ****************************************************************************
+ * Parameters:
+ * VARSET u_short Which variable set should be
+ * read (PEERVARS or CLOCKVARS)
+ * association int The association ID that should be read
+ * 0 represents the ntpd instance itself
+ * resultbuf char* The resulting string without quoted
+ * characters
+ * maxlen int Max. number of bytes for varvalue
+ *
+ * Returns:
+ * int number of bytes that have been copied to
+ * resultbuf
+ * - OR -
+ * 0 (zero) if no reply has been received or
+ * another failure occured
+ ****************************************************************************/
+
+int ntpq_queryhost(unsigned short VARSET, unsigned short association, char *resultbuf, int maxlen)
+{
+ const char *datap;
+ int res;
+ int dsize;
+ u_short rstatus;
+
+ if ( numhosts > 0 )
+ res = doquery(VARSET,association,0,0, (char *)0, &rstatus, &dsize, &datap);
+ else
+ return 0;
+
+ if ( ( res != 0) || ( dsize == 0 ) ) /* no data */
+ return 0;
+
+ if ( dsize > maxlen)
+ dsize = maxlen;
+
+
+ /* fill result resultbuf */
+ memcpy(resultbuf, datap, dsize);
+
+ return dsize;
+}
+
+
+
+/*****************************************************************************
+ *
+ * ntpq_openhost
+ *
+ * Sets up a connection to the ntpd instance of a specified host. Note:
+ * There is no real "connection" established because NTP solely works
+ * based on UDP.
+ *
+ ****************************************************************************
+ * Parameters:
+ * hostname char* Hostname/IP of the host running ntpd
+ * fam int Address Family (AF_INET, AF_INET6, or 0)
+ *
+ * Returns:
+ * int 1 if the host connection could be set up, i.e.
+ * name resolution was succesful and/or IP address
+ * has been validated
+ * - OR -
+ * 0 (zero) if a failure occured
+ ****************************************************************************/
+
+int
+ntpq_openhost(
+ char *hostname,
+ int fam
+ )
+{
+ if ( openhost(hostname, fam) )
+ {
+ numhosts = 1;
+ } else {
+ numhosts = 0;
+ }
+
+ return numhosts;
+
+}
+
+
+/*****************************************************************************
+ *
+ * ntpq_closehost
+ *
+ * Cleans up a connection by closing the used socket. Should be called
+ * when no further queries are required for the currently used host.
+ *
+ ****************************************************************************
+ * Parameters:
+ * - none -
+ *
+ * Returns:
+ * int 0 (zero) if no host has been opened before
+ * - OR -
+ * the resultcode from the closesocket function call
+ ****************************************************************************/
+
+int ntpq_closehost(void)
+{
+ if ( numhosts )
+ return closesocket(sockfd);
+
+ return 0;
+}
+
+
+/*****************************************************************************
+ *
+ * ntpq_read_associations
+ *
+ * This function queries the ntp host for its associations and returns the
+ * number of associations found.
+ *
+ * It takes an u_short array as its first parameter, this array holds the
+ * IDs of the associations,
+ * the function will not write more entries than specified with the
+ * max_entries parameter.
+ *
+ * However, if more than max_entries associations were found, the return
+ * value of this function will reflect the real number, even if not all
+ * associations have been stored in the array.
+ *
+ ****************************************************************************
+ * Parameters:
+ * resultbuf u_short*Array that should hold the list of
+ * association IDs
+ * maxentries int maximum number of association IDs that can
+ * be stored in resultbuf
+ *
+ * Returns:
+ * int number of association IDs stored in resultbuf
+ * - OR -
+ * 0 (zero) if a failure occured or no association has
+ * been returned.
+ ****************************************************************************/
+
+ int ntpq_read_associations ( u_short resultbuf[], int max_entries )
+{
+ int i = 0;
+
+ if (ntpq_dogetassoc()) {
+
+ if(numassoc < max_entries)
+ max_entries = numassoc;
+
+ for (i=0;i<max_entries;i++)
+ resultbuf[i] = assoc_cache[i].assid;
+
+ return numassoc;
+ }
+
+ return 0;
+}
+
+
+
+
+/*****************************************************************************
+ *
+ * ntpq_get_assocs
+ *
+ * This function reads the associations of a previously selected (with
+ * ntpq_openhost) NTP host into its own (global) array and returns the
+ * number of associations found.
+ *
+ * The obtained association IDs can be read by using the ntpq_get_assoc_id
+ * function.
+ *
+ ****************************************************************************
+ * Parameters:
+ * - none -
+ *
+ * Returns:
+ * int number of association IDs stored in resultbuf
+ * - OR -
+ * 0 (zero) if a failure occured or no association has
+ * been returned.
+ ****************************************************************************/
+
+ int ntpq_get_assocs ( void )
+{
+ return ntpq_read_associations( ntpq_associations, MAXASSOC );
+}
+
+
+/*****************************************************************************
+ *
+ * ntpq_get_assoc_number
+ *
+ * This function returns for a given Association ID the association number
+ * in the internal association array, which is filled by the ntpq_get_assocs
+ * function.
+ *
+ ****************************************************************************
+ * Parameters:
+ * associd int requested associaton ID
+ *
+ * Returns:
+ * int the number of the association array element that is
+ * representing the given association ID
+ * - OR -
+ * -1 if a failure occured or no matching association
+ * ID has been found
+ ****************************************************************************/
+
+int ntpq_get_assoc_number ( associd_t associd )
+{
+ int i;
+
+ for (i=0;i<numassoc;i++) {
+ if (assoc_cache[i].assid == associd)
+ return i;
+ }
+
+ return -1;
+
+}
+
+
+/*****************************************************************************
+ *
+ * ntpq_read_assoc_peervars
+ *
+ * This function reads the peervars variable-set of a specified association
+ * from a NTP host and writes it to the result buffer specified, honoring
+ * the maxsize limit.
+ *
+ * It returns the number of bytes written or 0 when the variable-set is
+ * empty or failed to read.
+ *
+ ****************************************************************************
+ * Parameters:
+ * associd int requested associaton ID
+ * resultbuf char* character buffer where the variable set
+ * should be stored
+ * maxsize int the maximum number of bytes that can be
+ * written to resultbuf
+ *
+ * Returns:
+ * int number of chars that have been copied to
+ * resultbuf
+ * - OR -
+ * 0 (zero) if an error occured
+ ****************************************************************************/
+
+int
+ntpq_read_assoc_peervars(
+ associd_t associd,
+ char * resultbuf,
+ int maxsize
+ )
+{
+ const char * datap;
+ int res;
+ int dsize;
+ u_short rstatus;
+
+ res = doquery(CTL_OP_READVAR, associd, 0, 0, NULL, &rstatus,
+ &dsize, &datap);
+ if (res != 0)
+ return 0;
+ if (dsize <= 0) {
+ if (numhosts > 1)
+ fprintf(stderr, "server=%s ", currenthost);
+ fprintf(stderr,
+ "***No information returned for association %d\n",
+ associd);
+
+ return 0;
+ }
+ if (dsize > maxsize)
+ dsize = maxsize;
+ memcpy(resultbuf, datap, dsize);
+
+ return dsize;
+}
+
+
+
+
+/*****************************************************************************
+ *
+ * ntpq_read_sysvars
+ *
+ * This function reads the sysvars variable-set from a NTP host and writes it
+ * to the result buffer specified, honoring the maxsize limit.
+ *
+ * It returns the number of bytes written or 0 when the variable-set is empty
+ * or could not be read.
+ *
+ ****************************************************************************
+ * Parameters:
+ * resultbuf char* character buffer where the variable set
+ * should be stored
+ * maxsize int the maximum number of bytes that can be
+ * written to resultbuf
+ *
+ * Returns:
+ * int number of chars that have been copied to
+ * resultbuf
+ * - OR -
+ * 0 (zero) if an error occured
+ ****************************************************************************/
+size_t
+ntpq_read_sysvars(
+ char * resultbuf,
+ size_t maxsize
+ )
+{
+ const char * datap;
+ int res;
+ int i_dsize;
+ size_t dsize;
+ u_short rstatus;
+
+ res = doquery(CTL_OP_READVAR, 0, 0, 0, NULL, &rstatus,
+ &i_dsize, &datap);
+
+ if (res != 0)
+ return 0;
+
+ if (i_dsize == 0) {
+ if (numhosts > 1)
+ fprintf(stderr, "server=%s ", currenthost);
+ fprintf(stderr, "***No sysvar information returned\n");
+
+ return 0;
+ } else {
+ dsize = max(0, i_dsize);
+ dsize = min(dsize, maxsize);
+ memcpy(resultbuf, datap, dsize);
+ }
+
+ return dsize;
+}
+
+
+/*****************************************************************************
+ * ntpq_get_assoc_allvars
+ *
+ * With this function all association variables for the specified association
+ * ID can be requested from a NTP host. They are stored internally and can be
+ * read by using the ntpq_get_peervar or ntpq_get_clockvar functions.
+ *
+ * Basically this is only a combination of the ntpq_get_assoc_peervars and
+ * ntpq_get_assoc_clockvars functions.
+ *
+ * It returns 1 if both variable-sets (peervars and clockvars) were
+ * received successfully. If one variable-set or both of them weren't
+ * received,
+ *
+ ****************************************************************************
+ * Parameters:
+ * associd int requested associaton ID
+ *
+ * Returns:
+ * int nonzero if at least one variable set could be read
+ * - OR -
+ * 0 (zero) if an error occured and both variable sets
+ * could not be read
+ ****************************************************************************/
+ int ntpq_get_assoc_allvars( associd_t associd )
+{
+ return ntpq_get_assoc_peervars ( associd ) &
+ ntpq_get_assoc_clockvars( associd );
+}
+
+
+
+
+/*****************************************************************************
+ *
+ * ntpq_get_sysvars
+ *
+ * The system variables of a NTP host can be requested by using this function
+ * and afterwards using ntpq_get_sysvar to read the single variable values.
+ *
+ ****************************************************************************
+ * Parameters:
+ * - none -
+ *
+ * Returns:
+ * int nonzero if the variable set could be read
+ * - OR -
+ * 0 (zero) if an error occured and the sysvars
+ * could not be read
+ ****************************************************************************/
+int
+ntpq_get_sysvars(void)
+{
+ sysvarlen = ntpq_read_sysvars(sysvars, sizeof(sysvars));
+ if (sysvarlen <= 0)
+ return 0;
+ else
+ return 1;
+}
+
+
+/*****************************************************************************
+ *
+ * ntp_get_peervar
+ *
+ * This function uses the variable-set which was read by using
+ * ntp_get_peervars and searches for a variable specified with varname. If
+ * such a variable exists, it writes its value into
+ * varvalue (maxlen specifies the size of this target buffer).
+ *
+ ****************************************************************************
+ * Parameters:
+ * varname char* requested variable name
+ * varvalue char* the buffer where the value should go into
+ * maxlen int maximum number of bytes that can be copied to
+ * varvalue
+ *
+ * Returns:
+ * int number of bytes copied to varvalue
+ * - OR -
+ * 0 (zero) if an error occured or the variable could
+ * not be found
+ ****************************************************************************/
+int ntpq_get_peervar( const char *varname, char *varvalue, int maxlen)
+{
+ return ( ntpq_getvar(peervars,peervarlen,varname,varvalue,maxlen) );
+}
+
+
+
+/*****************************************************************************
+ *
+ * ntpq_get_assoc_peervars
+ *
+ * This function requests the peer variables of the specified association
+ * from a NTP host. In order to access the variable values, the function
+ * ntpq_get_peervar must be used.
+ *
+ ****************************************************************************
+ * Parameters:
+ * associd int requested associaton ID
+ *
+ * Returns:
+ * int 1 (one) if the peervars have been read
+ * - OR -
+ * 0 (zero) if an error occured and the variable set
+ * could not be read
+ ****************************************************************************/
+int
+ntpq_get_assoc_peervars(
+ associd_t associd
+ )
+{
+ peervarlen = ntpq_read_assoc_peervars(associd, peervars,
+ sizeof(peervars));
+ if (peervarlen <= 0) {
+ peervar_assoc = 0;
+
+ return 0;
+ }
+ peervar_assoc = associd;
+
+ return 1;
+}
+
+
+/*****************************************************************************
+ *
+ * ntp_read_assoc_clockvars
+ *
+ * This function reads the clockvars variable-set of a specified association
+ * from a NTP host and writes it to the result buffer specified, honoring
+ * the maxsize limit.
+ *
+ * It returns the number of bytes written or 0 when the variable-set is
+ * empty or failed to read.
+ *
+ ****************************************************************************
+ * Parameters:
+ * associd int requested associaton ID
+ * resultbuf char* character buffer where the variable set
+ * should be stored
+ * maxsize int the maximum number of bytes that can be
+ * written to resultbuf
+ *
+ * Returns:
+ * int number of chars that have been copied to
+ * resultbuf
+ * - OR -
+ * 0 (zero) if an error occured
+ ****************************************************************************/
+
+int
+ntpq_read_assoc_clockvars(
+ associd_t associd,
+ char * resultbuf,
+ int maxsize
+ )
+{
+ const char *datap;
+ int res;
+ int dsize;
+ u_short rstatus;
+
+ res = ntpq_doquerylist(ntpq_varlist, CTL_OP_READCLOCK, associd,
+ 0, &rstatus, &dsize, &datap);
+ if (res != 0)
+ return 0;
+
+ if (dsize == 0) {
+ if (numhosts > 1) /* no information returned from server */
+ return 0;
+ } else {
+ if (dsize > maxsize)
+ dsize = maxsize;
+ memcpy(resultbuf, datap, dsize);
+ }
+
+ return dsize;
+}
+
+
+
+/*****************************************************************************
+ *
+ * ntpq_get_assoc_clocktype
+ *
+ * This function returns a clocktype value for a given association number
+ * (not ID!):
+ *
+ * NTP_CLOCKTYPE_UNKNOWN Unknown clock type
+ * NTP_CLOCKTYPE_BROADCAST Broadcast server
+ * NTP_CLOCKTYPE_LOCAL Local clock
+ * NTP_CLOCKTYPE_UNICAST Unicast server
+ * NTP_CLOCKTYPE_MULTICAST Multicast server
+ *
+ ****************************************************************************/
+int
+ntpq_get_assoc_clocktype(
+ int assoc_index
+ )
+{
+ associd_t associd;
+ int i;
+ int rc;
+ sockaddr_u dum_store;
+ char dstadr[LENHOSTNAME];
+ char resultbuf[NTPQ_BUFLEN];
+
+ if (assoc_index < 0 || assoc_index >= numassoc)
+ return -1;
+
+ associd = assoc_cache[assoc_index].assid;
+ if (associd == peervar_assoc) {
+ rc = ntpq_get_peervar("dstadr", dstadr, sizeof(dstadr));
+ } else {
+ i = ntpq_read_assoc_peervars(associd, resultbuf,
+ sizeof(resultbuf));
+ if (i <= 0)
+ return -1;
+ rc = ntpq_getvar(resultbuf, i, "dstadr", dstadr,
+ sizeof(dstadr));
+ }
+
+ if (0 != rc && decodenetnum(dstadr, &dum_store))
+ return ntpq_decodeaddrtype(&dum_store);
+
+ return -1;
+}
+
+
+
+/*****************************************************************************
+ *
+ * ntpq_get_assoc_clockvars
+ *
+ * With this function the clock variables of the specified association are
+ * requested from a NTP host. This makes only sense for associations with
+ * the type 'l' (Local Clock) and you should check this with
+ * ntpq_get_assoc_clocktype for each association, before you use this function
+ * on it.
+ *
+ ****************************************************************************
+ * Parameters:
+ * associd int requested associaton ID
+ *
+ * Returns:
+ * int 1 (one) if the clockvars have been read
+ * - OR -
+ * 0 (zero) if an error occured and the variable set
+ * could not be read
+ ****************************************************************************/
+int ntpq_get_assoc_clockvars( associd_t associd )
+{
+ if (NTP_CLOCKTYPE_LOCAL != ntpq_get_assoc_clocktype(
+ ntpq_get_assoc_number(associd)))
+ return 0;
+ clockvarlen = ntpq_read_assoc_clockvars( associd, clockvars,
+ sizeof(clockvars) );
+ if ( clockvarlen <= 0 ) {
+ clockvar_assoc = 0;
+ return 0;
+ } else {
+ clockvar_assoc = associd;
+ return 1;
+ }
+}
+
+
diff --git a/ntpq/libntpq.h b/ntpq/libntpq.h
new file mode 100644
index 0000000..82a8740
--- /dev/null
+++ b/ntpq/libntpq.h
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ *
+ * libntpq.h
+ *
+ * This is the wrapper library for ntpq, the NTP query utility.
+ * This library reuses the sourcecode from ntpq and exports a number
+ * of useful functions in a library that can be linked against applications
+ * that need to query the status of a running ntpd. The whole
+ * communcation is based on mode 6 packets.
+ *
+ * This header file can be used in applications that want to link against
+ * libntpq.
+ *
+ ****************************************************************************/
+
+#include "ntp_net.h"
+
+/* general purpose buffer size */
+#define NTPQ_BUFLEN 2048
+
+/* max. number of associations */
+#ifndef MAXASSOC
+#define MAXASSOC 1024
+#endif
+
+/* general purpose max array size definition */
+#ifndef MAXLIST
+#define MAXLIST 64
+#endif
+
+#ifndef LENHOSTNAME
+#define LENHOSTNAME 256 /* host name is max. 256 characters long */
+#endif
+
+/* NTP Status codes */
+#define NTP_STATUS_INVALID 0
+#define NTP_STATUS_FALSETICKER 1
+#define NTP_STATUS_EXCESS 2
+#define NTP_STATUS_OUTLYER 3
+#define NTP_STATUS_CANDIDATE 4
+#define NTP_STATUS_SELECTED 5
+#define NTP_STATUS_SYSPEER 6
+#define NTP_STATUS_PPSPEER 7
+
+/* NTP association type identifier */
+#define NTP_CLOCKTYPE_UNKNOWN '-'
+#define NTP_CLOCKTYPE_BROADCAST 'b'
+#define NTP_CLOCKTYPE_LOCAL 'l'
+#define NTP_CLOCKTYPE_UNICAST 'u'
+#define NTP_CLOCKTYPE_MULTICAST 'm'
+
+/* Variable Sets */
+#define PEERVARS CTL_OP_READVAR
+#define CLOCKVARS CTL_OP_CLOCKVAR
+
+/* Variable list struct */
+struct ntpq_varlist {
+ char *name;
+ char *value;
+};
+
+/* global variables used for holding snapshots of data */
+#ifndef LIBNTPQ_C
+extern char peervars[];
+extern int peervarlen;
+extern int peervar_assoc;
+extern char clockvars[];
+extern int clockvarlen;
+extern int clockvar_assoc;
+extern char sysvars[];
+extern int sysvarlen;
+extern char *ntpq_resultbuffer[];
+extern struct ntpq_varlist ntpq_varlist[MAXLIST];
+#endif
+
+
+
+/*
+ * Prototypes of exported libary functions
+ */
+
+/* from libntpq.c */
+extern int ntpq_openhost(char *, int);
+extern int ntpq_closehost(void);
+extern int ntpq_queryhost(unsigned short VARSET, associd_t association,
+ char *resultbuf, int maxlen);
+extern size_t ntpq_getvar(const char *resultbuf, size_t datalen,
+ const char *varname, char *varvalue,
+ size_t maxlen);
+extern int ntpq_stripquotes ( char *resultbuf, char *srcbuf, int datalen, int maxlen );
+extern int ntpq_queryhost_peervars(associd_t association, char *resultbuf, int maxlen);
+extern int ntpq_get_peervar( const char *varname, char *varvalue, int maxlen);
+extern size_t ntpq_read_sysvars(char *resultbuf, size_t maxsize);
+extern int ntpq_get_sysvars( void );
+extern int ntpq_read_associations ( unsigned short resultbuf[], int max_entries );
+extern int ntpq_get_assocs ( void );
+extern int ntpq_get_assoc_number ( associd_t associd );
+extern int ntpq_get_assoc_peervars( associd_t associd );
+extern int ntpq_get_assoc_clockvars( associd_t associd );
+extern int ntpq_get_assoc_allvars( associd_t associd );
+extern int ntpq_get_assoc_clocktype(int assoc_index);
+extern int ntpq_read_assoc_peervars( associd_t associd, char *resultbuf, int maxsize );
+extern int ntpq_read_assoc_clockvars( associd_t associd, char *resultbuf, int maxsize );
+
+/* in libntpq_subs.c */
+extern int ntpq_dogetassoc(void);
+extern char ntpq_decodeaddrtype(sockaddr_u *sock);
+extern int ntpq_doquerylist(struct ntpq_varlist *, int, associd_t, int,
+ u_short *, int *, const char **datap);
diff --git a/ntpq/libntpq_subs.c b/ntpq/libntpq_subs.c
new file mode 100644
index 0000000..e53b419
--- /dev/null
+++ b/ntpq/libntpq_subs.c
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ *
+ * libntpq_subs.c
+ *
+ * This is the second part of the wrapper library for ntpq, the NTP query utility.
+ * This library reuses the sourcecode from ntpq and exports a number
+ * of useful functions in a library that can be linked against applications
+ * that need to query the status of a running ntpd. The whole
+ * communcation is based on mode 6 packets.
+ *
+ * This source file exports the (private) functions from ntpq-subs.c
+ *
+ ****************************************************************************/
+
+
+#include "ntpq-subs.c"
+#include "libntpq.h"
+
+
+int ntpq_dogetassoc(void)
+{
+
+ if (dogetassoc(NULL))
+ return numassoc;
+ else
+ return 0;
+}
+
+/* the following functions are required internally by a number of libntpq functions
+ * and since they are defined as static in ntpq-subs.c, they need to be exported here
+ */
+
+char ntpq_decodeaddrtype(sockaddr_u *sock)
+{
+ return decodeaddrtype(sock);
+}
+
+int
+ntpq_doquerylist(
+ struct ntpq_varlist *vlist,
+ int op,
+ associd_t associd,
+ int auth,
+ u_short *rstatus,
+ int *dsize,
+ const char **datap
+ )
+{
+ return doquerylist((struct varlist *)vlist, op, associd, auth,
+ rstatus, dsize, datap);
+}
+
diff --git a/ntpq/ntpq-opts.c b/ntpq/ntpq-opts.c
new file mode 100644
index 0000000..733b0dd
--- /dev/null
+++ b/ntpq/ntpq-opts.c
@@ -0,0 +1,1160 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpq-opts.c)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:57:37 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpq-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpq author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpq program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+
+#ifndef __doxygen__
+#define OPTION_CODE_COMPILE 1
+#include "ntpq-opts.h"
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern FILE * option_usage_fp;
+#define zCopyright (ntpq_opt_strs+0)
+#define zLicenseDescrip (ntpq_opt_strs+314)
+
+/*
+ * global included definitions
+ */
+#ifdef __windows
+ extern int atoi(const char*);
+#else
+# include <stdlib.h>
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/**
+ * static const strings for ntpq options
+ */
+static char const ntpq_opt_strs[1875] =
+/* 0 */ "ntpq 4.2.7p482\n"
+ "Copyright (C) 1970-2014 The University of Delaware, 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"
+ "can be seen at:\n"
+ " <http://ntp.org/license>\n"
+ " <http://opensource.org/licenses/ntp-license.php>\n\0"
+/* 314 */ "Permission to use, copy, modify, and distribute this software and its\n"
+ "documentation for any purpose with or without fee is hereby granted,\n"
+ "provided that the above copyright notice appears in all copies and that\n"
+ "both the copyright notice and this permission notice appear in supporting\n"
+ "documentation, and that the name The University of Delaware not be used in\n"
+ "advertising or publicity pertaining to distribution of the software without\n"
+ "specific, written prior permission. The University of Delaware makes no\n"
+ "representations about the suitability this software for any purpose. It is\n"
+ "provided \"as is\" without express or implied warranty.\n\0"
+/* 954 */ "Force IPv4 DNS name resolution\0"
+/* 985 */ "IPV4\0"
+/* 990 */ "ipv4\0"
+/* 995 */ "Force IPv6 DNS name resolution\0"
+/* 1026 */ "IPV6\0"
+/* 1031 */ "ipv6\0"
+/* 1036 */ "run a command and exit\0"
+/* 1059 */ "COMMAND\0"
+/* 1067 */ "command\0"
+/* 1075 */ "Increase debug verbosity level\0"
+/* 1106 */ "DEBUG_LEVEL\0"
+/* 1118 */ "debug-level\0"
+/* 1130 */ "Set the debug verbosity level\0"
+/* 1160 */ "SET_DEBUG_LEVEL\0"
+/* 1176 */ "set-debug-level\0"
+/* 1192 */ "Force ntpq to operate in interactive mode\0"
+/* 1234 */ "INTERACTIVE\0"
+/* 1246 */ "interactive\0"
+/* 1258 */ "numeric host addresses\0"
+/* 1281 */ "NUMERIC\0"
+/* 1289 */ "numeric\0"
+/* 1297 */ "Always output status line with readvar\0"
+/* 1336 */ "OLD_RV\0"
+/* 1343 */ "old-rv\0"
+/* 1350 */ "Print a list of the peers\0"
+/* 1376 */ "PEERS\0"
+/* 1382 */ "peers\0"
+/* 1388 */ "Display the full 'remote' value\0"
+/* 1420 */ "WIDE\0"
+/* 1425 */ "wide\0"
+/* 1430 */ "display extended usage information and exit\0"
+/* 1474 */ "help\0"
+/* 1479 */ "extended usage information passed thru pager\0"
+/* 1524 */ "more-help\0"
+/* 1534 */ "output version information and exit\0"
+/* 1570 */ "version\0"
+/* 1578 */ "save the option state to a config file\0"
+/* 1617 */ "save-opts\0"
+/* 1627 */ "load options from a config file\0"
+/* 1659 */ "LOAD_OPTS\0"
+/* 1669 */ "no-load-opts\0"
+/* 1682 */ "no\0"
+/* 1685 */ "NTPQ\0"
+/* 1690 */ "ntpq - standard NTP query program - Ver. 4.2.7p482\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
+/* 1811 */ "$HOME\0"
+/* 1817 */ ".\0"
+/* 1819 */ ".ntprc\0"
+/* 1826 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 1860 */ "ntpq 4.2.7p482";
+
+/**
+ * ipv4 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv4 option */
+#define IPV4_DESC (ntpq_opt_strs+954)
+/** Upper-cased name for the ipv4 option */
+#define IPV4_NAME (ntpq_opt_strs+985)
+/** Name string for the ipv4 option */
+#define IPV4_name (ntpq_opt_strs+990)
+/** Other options that appear in conjunction with the ipv4 option */
+static int const aIpv4CantList[] = {
+ INDEX_OPT_IPV6, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv4 option */
+#define IPV4_FLAGS (OPTST_DISABLED)
+
+/**
+ * ipv6 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv6 option */
+#define IPV6_DESC (ntpq_opt_strs+995)
+/** Upper-cased name for the ipv6 option */
+#define IPV6_NAME (ntpq_opt_strs+1026)
+/** Name string for the ipv6 option */
+#define IPV6_name (ntpq_opt_strs+1031)
+/** Other options that appear in conjunction with the ipv6 option */
+static int const aIpv6CantList[] = {
+ INDEX_OPT_IPV4, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv6 option */
+#define IPV6_FLAGS (OPTST_DISABLED)
+
+/**
+ * command option description:
+ */
+/** Descriptive text for the command option */
+#define COMMAND_DESC (ntpq_opt_strs+1036)
+/** Upper-cased name for the command option */
+#define COMMAND_NAME (ntpq_opt_strs+1059)
+/** Name string for the command option */
+#define COMMAND_name (ntpq_opt_strs+1067)
+/** Compiled in flag settings for the command option */
+#define COMMAND_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * debug-level option description:
+ */
+/** Descriptive text for the debug-level option */
+#define DEBUG_LEVEL_DESC (ntpq_opt_strs+1075)
+/** Upper-cased name for the debug-level option */
+#define DEBUG_LEVEL_NAME (ntpq_opt_strs+1106)
+/** Name string for the debug-level option */
+#define DEBUG_LEVEL_name (ntpq_opt_strs+1118)
+/** Compiled in flag settings for the debug-level option */
+#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
+
+/**
+ * set-debug-level option description:
+ */
+/** Descriptive text for the set-debug-level option */
+#define SET_DEBUG_LEVEL_DESC (ntpq_opt_strs+1130)
+/** Upper-cased name for the set-debug-level option */
+#define SET_DEBUG_LEVEL_NAME (ntpq_opt_strs+1160)
+/** Name string for the set-debug-level option */
+#define SET_DEBUG_LEVEL_name (ntpq_opt_strs+1176)
+/** Compiled in flag settings for the set-debug-level option */
+#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * interactive option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the interactive option */
+#define INTERACTIVE_DESC (ntpq_opt_strs+1192)
+/** Upper-cased name for the interactive option */
+#define INTERACTIVE_NAME (ntpq_opt_strs+1234)
+/** Name string for the interactive option */
+#define INTERACTIVE_name (ntpq_opt_strs+1246)
+/** Other options that appear in conjunction with the interactive option */
+static int const aInteractiveCantList[] = {
+ INDEX_OPT_COMMAND,
+ INDEX_OPT_PEERS, NO_EQUIVALENT };
+/** Compiled in flag settings for the interactive option */
+#define INTERACTIVE_FLAGS (OPTST_DISABLED)
+
+/**
+ * numeric option description:
+ */
+/** Descriptive text for the numeric option */
+#define NUMERIC_DESC (ntpq_opt_strs+1258)
+/** Upper-cased name for the numeric option */
+#define NUMERIC_NAME (ntpq_opt_strs+1281)
+/** Name string for the numeric option */
+#define NUMERIC_name (ntpq_opt_strs+1289)
+/** Compiled in flag settings for the numeric option */
+#define NUMERIC_FLAGS (OPTST_DISABLED)
+
+/**
+ * old-rv option description:
+ */
+/** Descriptive text for the old-rv option */
+#define OLD_RV_DESC (ntpq_opt_strs+1297)
+/** Upper-cased name for the old-rv option */
+#define OLD_RV_NAME (ntpq_opt_strs+1336)
+/** Name string for the old-rv option */
+#define OLD_RV_name (ntpq_opt_strs+1343)
+/** Compiled in flag settings for the old-rv option */
+#define OLD_RV_FLAGS (OPTST_DISABLED)
+
+/**
+ * peers option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the peers option */
+#define PEERS_DESC (ntpq_opt_strs+1350)
+/** Upper-cased name for the peers option */
+#define PEERS_NAME (ntpq_opt_strs+1376)
+/** Name string for the peers option */
+#define PEERS_name (ntpq_opt_strs+1382)
+/** Other options that appear in conjunction with the peers option */
+static int const aPeersCantList[] = {
+ INDEX_OPT_INTERACTIVE, NO_EQUIVALENT };
+/** Compiled in flag settings for the peers option */
+#define PEERS_FLAGS (OPTST_DISABLED)
+
+/**
+ * wide option description:
+ */
+/** Descriptive text for the wide option */
+#define WIDE_DESC (ntpq_opt_strs+1388)
+/** Upper-cased name for the wide option */
+#define WIDE_NAME (ntpq_opt_strs+1420)
+/** Name string for the wide option */
+#define WIDE_name (ntpq_opt_strs+1425)
+/** Compiled in flag settings for the wide option */
+#define WIDE_FLAGS (OPTST_DISABLED)
+
+/*
+ * Help/More_Help/Version option descriptions:
+ */
+#define HELP_DESC (ntpq_opt_strs+1430)
+#define HELP_name (ntpq_opt_strs+1474)
+#ifdef HAVE_WORKING_FORK
+#define MORE_HELP_DESC (ntpq_opt_strs+1479)
+#define MORE_HELP_name (ntpq_opt_strs+1524)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+#define MORE_HELP_DESC HELP_DESC
+#define MORE_HELP_name HELP_name
+#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#endif
+#ifdef NO_OPTIONAL_OPT_ARGS
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
+#endif
+#define VER_DESC (ntpq_opt_strs+1534)
+#define VER_name (ntpq_opt_strs+1570)
+#define SAVE_OPTS_DESC (ntpq_opt_strs+1578)
+#define SAVE_OPTS_name (ntpq_opt_strs+1617)
+#define LOAD_OPTS_DESC (ntpq_opt_strs+1627)
+#define LOAD_OPTS_NAME (ntpq_opt_strs+1659)
+#define NO_LOAD_OPTS_name (ntpq_opt_strs+1669)
+#define LOAD_OPTS_pfx (ntpq_opt_strs+1682)
+#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
+/**
+ * Declare option callback procedures
+ */
+extern tOptProc
+ ntpOptionPrintVersion, ntpq_custom_opt_handler, optionBooleanVal,
+ optionNestedVal, optionNumericVal, optionPagedUsage,
+ optionResetOpt, optionStackArg, optionTimeDate,
+ optionTimeVal, optionUnstackArg, optionVendorOption;
+static tOptProc
+ doOptDebug_Level, doUsageOpt;
+#define VER_PROC ntpOptionPrintVersion
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the ntpq Option Descriptions.
+ * This is an array of OPTION_CT entries, one for each
+ * option that the ntpq program responds to.
+ */
+static tOptDesc optDesc[OPTION_CT] = {
+ { /* entry idx, value */ 0, VALUE_OPT_IPV4,
+ /* equiv idx, value */ 0, VALUE_OPT_IPV4,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV4_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv4 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv4CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 1, VALUE_OPT_IPV6,
+ /* equiv idx, value */ 1, VALUE_OPT_IPV6,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV6_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv6 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv6CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 2, VALUE_OPT_COMMAND,
+ /* equiv idx, value */ 2, VALUE_OPT_COMMAND,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ COMMAND_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --command */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ ntpq_custom_opt_handler,
+ /* desc, NAME, name */ COMMAND_DESC, COMMAND_NAME, COMMAND_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
+ /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptDebug_Level,
+ /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --set-debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 5, VALUE_OPT_INTERACTIVE,
+ /* equiv idx, value */ 5, VALUE_OPT_INTERACTIVE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ INTERACTIVE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --interactive */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aInteractiveCantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ INTERACTIVE_DESC, INTERACTIVE_NAME, INTERACTIVE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 6, VALUE_OPT_NUMERIC,
+ /* equiv idx, value */ 6, VALUE_OPT_NUMERIC,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ NUMERIC_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --numeric */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ NUMERIC_DESC, NUMERIC_NAME, NUMERIC_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 7, VALUE_OPT_OLD_RV,
+ /* equiv idx, value */ 7, VALUE_OPT_OLD_RV,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OLD_RV_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --old-rv */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ OLD_RV_DESC, OLD_RV_NAME, OLD_RV_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 8, VALUE_OPT_PEERS,
+ /* equiv idx, value */ 8, VALUE_OPT_PEERS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PEERS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --peers */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aPeersCantList,
+ /* option proc */ ntpq_custom_opt_handler,
+ /* desc, NAME, name */ PEERS_DESC, PEERS_NAME, PEERS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 9, VALUE_OPT_WIDE,
+ /* equiv idx, value */ 9, VALUE_OPT_WIDE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ WIDE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --wide */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ WIDE_DESC, WIDE_NAME, WIDE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ VER_PROC,
+ /* desc, NAME, name */ VER_DESC, NULL, VER_name,
+ /* disablement strs */ NULL, NULL },
+
+
+
+ { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doUsageOpt,
+ /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionPagedUsage,
+ /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionLoadOpt,
+ /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
+ /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
+};
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of ntpq. */
+#define zPROGNAME (ntpq_opt_strs+1685)
+/** Reference to the title line for ntpq usage. */
+#define zUsageTitle (ntpq_opt_strs+1690)
+/** ntpq configuration file name. */
+#define zRcName (ntpq_opt_strs+1819)
+/** Directories to search for ntpq config files. */
+static char const * const apzHomeList[3] = {
+ ntpq_opt_strs+1811,
+ ntpq_opt_strs+1817,
+ NULL };
+/** The ntpq program bug email address. */
+#define zBugsAddr (ntpq_opt_strs+1826)
+/** Clarification/explanation of what ntpq does. */
+#define zExplain (NULL)
+/** Extra detail explaining what ntpq does. */
+#define zDetail (NULL)
+/** The full version string for ntpq. */
+#define zFullVersion (ntpq_opt_strs+1860)
+/* extracted from optcode.tlib near line 364 */
+
+#if defined(ENABLE_NLS)
+# define OPTPROC_BASE OPTPROC_TRANSLATE
+ static tOptionXlateProc translate_option_strings;
+#else
+# define OPTPROC_BASE OPTPROC_NONE
+# define translate_option_strings NULL
+#endif /* ENABLE_NLS */
+
+#define ntpq_full_usage (NULL)
+#define ntpq_short_usage (NULL)
+
+#endif /* not defined __doxygen__ */
+
+/*
+ * Create the static procedure(s) declared above.
+ */
+/**
+ * The callout function that invokes the optionUsage function.
+ *
+ * @param[in] opts the AutoOpts option description structure
+ * @param[in] od the descriptor for the "help" (usage) option.
+ * @noreturn
+ */
+static void
+doUsageOpt(tOptions * opts, tOptDesc * od)
+{
+ int ex_code;
+ ex_code = NTPQ_EXIT_SUCCESS;
+ optionUsage(&ntpqOptions, ex_code);
+ /* NOTREACHED */
+ exit(1);
+ (void)opts;
+ (void)od;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the debug-level option.
+ *
+ * @param[in] pOptions the ntpq options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ /*
+ * Be sure the flag-code[0] handles special values for the options pointer
+ * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
+ * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
+ * reset its state.
+ */
+ /* extracted from debug-opt.def, line 15 */
+OPT_VALUE_SET_DEBUG_LEVEL++;
+ (void)pOptDesc;
+ (void)pOptions;
+}
+/* extracted from optmain.tlib near line 1245 */
+
+/**
+ * The directory containing the data associated with ntpq.
+ */
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+/**
+ * Information about the person or institution that packaged ntpq
+ * for the current distribution.
+ */
+#ifndef WITH_PACKAGER
+# define ntpq_packager_info NULL
+#else
+/** Packager information for ntpq. */
+static char const ntpq_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpq bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+#ifndef __doxygen__
+
+#endif /* __doxygen__ */
+/**
+ * The option definitions for ntpq. The one structure that
+ * binds them all.
+ */
+tOptions ntpqOptions = {
+ OPTIONS_STRUCT_VERSION,
+ 0, NULL, /* original argc + argv */
+ ( OPTPROC_BASE
+ + OPTPROC_ERRSTOP
+ + OPTPROC_SHORTOPT
+ + OPTPROC_LONGOPT
+ + OPTPROC_NO_REQ_OPT
+ + OPTPROC_ENVIRON
+ + OPTPROC_MISUSE ),
+ 0, NULL, /* current option index, current option */
+ NULL, NULL, zPROGNAME,
+ zRcName, zCopyright, zLicenseDescrip,
+ zFullVersion, apzHomeList, zUsageTitle,
+ zExplain, zDetail, optDesc,
+ zBugsAddr, /* address to send bugs to */
+ NULL, NULL, /* extensions/saved state */
+ optionUsage, /* usage procedure */
+ translate_option_strings, /* translation procedure */
+ /*
+ * Indexes to special options
+ */
+ { INDEX_OPT_MORE_HELP, /* more-help option index */
+ INDEX_OPT_SAVE_OPTS, /* save option index */
+ NO_EQUIVALENT, /* '-#' option index */
+ NO_EQUIVALENT /* index of default opt */
+ },
+ 15 /* full option count */, 10 /* user option count */,
+ ntpq_full_usage, ntpq_short_usage,
+ NULL, NULL,
+ PKGDATADIR, ntpq_packager_info
+};
+
+#if ENABLE_NLS
+/**
+ * This code is designed to translate translatable option text for the
+ * ntpq program. These translations happen upon entry
+ * to optionProcess().
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#ifdef HAVE_DCGETTEXT
+# include <gettext.h>
+#endif
+#include <autoopts/usage-txt.h>
+
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
+
+/**
+ * AutoGen specific wrapper function for gettext. It relies on the macro _()
+ * to convert from English to the target language, then strdup-duplicates the
+ * result string. It tries the "libopts" domain first, then whatever has been
+ * set via the \a textdomain(3) call.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
+AO_gettext(char const * pz)
+{
+ char * res;
+ if (pz == NULL)
+ return NULL;
+#ifdef HAVE_DCGETTEXT
+ /*
+ * While processing the option_xlateable_txt data, try to use the
+ * "libopts" domain. Once we switch to the option descriptor data,
+ * do *not* use that domain.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ res = dgettext("libopts", pz);
+ if (res == pz)
+ res = (char *)(void *)_(pz);
+ } else
+ res = (char *)(void *)_(pz);
+#else
+ res = (char *)(void *)_(pz);
+#endif
+ if (res == pz)
+ return res;
+ res = strdup(res);
+ if (res == NULL) {
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(NTPQ_EXIT_FAILURE);
+ }
+ return res;
+}
+
+/**
+ * All the pointers we use are marked "* const", but they are stored in
+ * writable memory. Coerce the mutability and set the pointer.
+ */
+static void coerce_it(void ** s) { *s = AO_gettext(*s);
+}
+
+/**
+ * Translate all the translatable strings in the ntpqOptions
+ * structure defined above. This is done only once.
+ */
+static void
+translate_option_strings(void)
+{
+ tOptions * const opts = &ntpqOptions;
+
+ /*
+ * Guard against re-translation. It won't work. The strings will have
+ * been changed by the first pass through this code. One shot only.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ /*
+ * Do the translations. The first pointer follows the field count
+ * field. The field count field is the size of a pointer.
+ */
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
+
+ do {
+ ppz++; /* skip over field_ct */
+ *ppz = AO_gettext(*ppz);
+ } while (--ix > 0);
+ /* prevent re-translation and disable "libopts" domain lookup */
+ option_xlateable_txt.field_ct = 0;
+
+ coerce_it((void*)&(opts->pzCopyright));
+ coerce_it((void*)&(opts->pzCopyNotice));
+ coerce_it((void*)&(opts->pzFullVersion));
+ coerce_it((void*)&(opts->pzUsageTitle));
+ coerce_it((void*)&(opts->pzExplain));
+ coerce_it((void*)&(opts->pzDetail));
+ {
+ tOptDesc * od = opts->pOptDesc;
+ for (ix = opts->optCt; ix > 0; ix--, od++)
+ coerce_it((void*)&(od->pzText));
+ }
+ }
+}
+#endif /* ENABLE_NLS */
+
+#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
+/** I18N function strictly for xgettext. Do not compile. */
+static void bogus_function(void) {
+ /* TRANSLATORS:
+
+ The following dummy function was crated solely so that xgettext can
+ extract the correct strings. These strings are actually referenced
+ by a field name in the ntpqOptions structure noted in the
+ comments below. The literal text is defined in ntpq_opt_strs.
+
+ NOTE: the strings below are segmented with respect to the source string
+ ntpq_opt_strs. The strings above are handed off for translation
+ at run time a paragraph at a time. Consequently, they are presented here
+ for translation a paragraph at a time.
+
+ ALSO: often the description for an option will reference another option
+ by name. These are set off with apostrophe quotes (I hope). Do not
+ translate option names.
+ */
+ /* referenced via ntpqOptions.pzCopyright */
+ puts(_("ntpq 4.2.7p482\n\
+Copyright (C) 1970-2014 The University of Delaware, 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\
+can be seen at:\n"));
+ puts(_(" <http://ntp.org/license>\n\
+ <http://opensource.org/licenses/ntp-license.php>\n"));
+
+ /* referenced via ntpqOptions.pzCopyNotice */
+ puts(_("Permission to use, copy, modify, and distribute this software and its\n\
+documentation for any purpose with or without fee is hereby granted,\n\
+provided that the above copyright notice appears in all copies and that\n\
+both the copyright notice and this permission notice appear in supporting\n\
+documentation, and that the name The University of Delaware not be used in\n\
+advertising or publicity pertaining to distribution of the software without\n\
+specific, written prior permission. The University of Delaware makes no\n\
+representations about the suitability this software for any purpose. It is\n\
+provided \"as is\" without express or implied warranty.\n"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Force IPv4 DNS name resolution"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Force IPv6 DNS name resolution"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("run a command and exit"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Increase debug verbosity level"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Set the debug verbosity level"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Force ntpq to operate in interactive mode"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("numeric host addresses"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Always output status line with readvar"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Print a list of the peers"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("Display the full 'remote' value"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("display extended usage information and exit"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("extended usage information passed thru pager"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("output version information and exit"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("save the option state to a config file"));
+
+ /* referenced via ntpqOptions.pOptDesc->pzText */
+ puts(_("load options from a config file"));
+
+ /* referenced via ntpqOptions.pzUsageTitle */
+ puts(_("ntpq - standard NTP query program - Ver. 4.2.7p482\n\
+Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
+
+ /* referenced via ntpqOptions.pzFullVersion */
+ puts(_("ntpq 4.2.7p482"));
+
+ /* referenced via ntpqOptions.pzFullUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+
+ /* referenced via ntpqOptions.pzShortUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 86 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 84 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 88 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* uncompilable code */
+#ifdef __cplusplus
+}
+#endif
+/* ntpq-opts.c ends here */
diff --git a/ntpq/ntpq-opts.def b/ntpq/ntpq-opts.def
new file mode 100644
index 0000000..d0c57a0
--- /dev/null
+++ b/ntpq/ntpq-opts.def
@@ -0,0 +1,938 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include copyright.def
+#include homerc.def
+#include autogen-version.def
+
+prog-name = "ntpq";
+prog-title = "standard NTP query program";
+argument = '[ host ...]';
+
+flag = {
+ name = ipv4;
+ flags-cant = ipv6;
+ value = 4;
+ descrip = "Force IPv4 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv4 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = ipv6;
+ flags-cant = ipv4;
+ value = 6;
+ descrip = "Force IPv6 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of following host names on the command line
+ to the IPv6 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = command;
+ value = c;
+ arg-type = string;
+ descrip = "run a command and exit";
+ max = NOLIMIT;
+ arg-name = cmd;
+ call-proc = ntpq_custom_opt_handler;
+ doc = <<- _EndOfDoc_
+ The following argument is interpreted as an interactive format command
+ and is added to the list of commands to be executed on the specified
+ host(s).
+ _EndOfDoc_;
+};
+
+#include debug-opt.def
+
+flag = {
+ name = interactive;
+ value = i;
+ flags-cant = command, peers;
+ descrip = "Force ntpq to operate in interactive mode";
+ doc = <<- _EndOfDoc_
+ Force @code{ntpq} to operate in interactive mode.
+ Prompts will be written to the standard output and
+ commands read from the standard input.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = numeric;
+ value = n;
+ descrip = "numeric host addresses";
+ doc = <<- _EndOfDoc_
+ Output all host addresses in dotted-quad numeric format rather than
+ converting to the canonical host names.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = old-rv;
+ descrip = "Always output status line with readvar";
+ doc = <<- _EndOfDoc_
+ By default, @code{ntpq} now suppresses the @code{associd=...}
+ line that precedes the output of @code{readvar}
+ (alias @code{rv}) when a single variable is requested, such as
+ @code{ntpq -c "rv 0 offset"}.
+ This option causes @code{ntpq} to include both lines of output
+ for a single-variable @code{readvar}.
+ Using an environment variable to
+ preset this option in a script will enable both older and
+ newer @code{ntpq} to behave identically in this regard.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peers;
+ value = p;
+ descrip = "Print a list of the peers";
+ flags-cant = interactive;
+ call-proc = ntpq_custom_opt_handler;
+ doc = <<- _EndOfDoc_
+ Print a list of the peers known to the server as well as a summary
+ of their state. This is equivalent to the 'peers' interactive command.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = wide;
+ value = w;
+ descrip = "Display the full 'remote' value";
+ doc = <<- _EndOfDoc_
+ Display the full value of the 'remote' value. If this requires
+ more than 15 characters, display the full value, emit a newline,
+ and continue the data display properly indented on the next line.
+ _EndOfDoc_;
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+
+The
+.Nm
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty-printed output
+options being available.
+The
+.Nm
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+
+If one or more request options is included on the command line
+when
+.Nm
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+.Nm
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+.Nm
+utility will prompt for
+commands if the standard input is a terminal device.
+
+.Nm
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+.Nm
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+
+Specifying a
+command line option other than
+.Fl i
+or
+.Fl n
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+.Nm
+will attempt to read
+interactive format commands from the standard input.
+.Ss "Internal Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+
+A
+number of interactive format commands are executed entirely within
+the
+.Nm
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+.Bl -tag -width "? [command_keyword]" -compact -offset indent
+.It Ic ? Op Ar command_keyword
+.It Ic help Op Ar command_keyword
+A
+.Ql \&?
+by itself will print a list of all the command
+keywords known to this incarnation of
+.Nm .
+A
+.Ql \&?
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+.Nm
+than this manual
+page.
+.It Ic addvars Ar variable_name Ns Xo Op Ic =value
+.Ic ...
+.Xc
+.It Ic rmvars Ar variable_name Ic ...
+.It Ic clearvars
+.It Ic showvars
+The data carried by NTP mode 6 messages consists of a list of
+items of the form
+.Ql variable_name=value ,
+where the
+.Ql =value
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+.Nm
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+.Ic readlist
+and
+.Ic writelist
+commands described below.
+The
+.Ic addvars
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma-separated and not contain white space.
+The
+.Ic rmvars
+command can be used to remove individual variables from the list,
+while the
+.Ic clearlist
+command removes all variables from the
+list.
+The
+.Ic showvars
+command displays the current list of optional variables.
+.It Ic authenticate Op yes | no
+Normally
+.Nm
+does not authenticate requests unless
+they are write requests.
+The command
+.Ql authenticate yes
+causes
+.Nm
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+.Ic peer
+display.
+The command
+.Ql authenticate
+causes
+.Nm
+to display whether or not
+.Nm
+is currently autheinticating requests.
+.It Ic cooked
+Causes output from query commands to be "cooked", so that
+variables which are recognized by
+.Nm
+will have their
+values reformatted for human consumption.
+Variables which
+.Nm
+thinks should have a decodable value but didn't are
+marked with a trailing
+.Ql \&? .
+.It Xo
+.Ic debug
+.Oo
+.Cm more |
+.Cm less |
+.Cm off
+.Oc
+.Xc
+With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+.It Ic delay Ar milliseconds
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.It Ic exit
+Exit
+.Nm .
+.It Ic host Ar hostname
+Set the host to which future queries will be sent.
+.Ar hostname
+may be either a host name or a numeric address.
+.It Ic hostnames Op Cm yes | Cm no
+If
+.Cm yes
+is specified, host names are printed in
+information displays.
+If
+.Cm no
+is specified, numeric
+addresses are printed instead.
+The default is
+.Cm yes ,
+unless
+modified using the command line
+.Fl n
+switch.
+.It Ic keyid Ar keyid
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.It Ic keytype Xo Oo
+.Cm md5 |
+.Cm OpenSSLDigestType
+.Oc
+.Xc
+Specify the type of key to use for authenticating requests.
+.Cm md5
+is alway supported.
+If
+.Nm
+was built with OpenSSL support,
+any digest type supported by OpenSSL can also be provided.
+If no argument is given, the current
+.Ic keytype
+is displayed.
+.It Ic ntpversion Xo Oo
+.Cm 1 |
+.Cm 2 |
+.Cm 3 |
+.Cm 4
+.Oc
+.Xc
+Sets the NTP version number which
+.Nm
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+.It Ic passwd
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.\" Not yet implemented.
+.\" .It Ic poll
+.\" .Op Ar n
+.\" .Op Ic verbose
+.\" Poll an NTP server in client mode
+.\" .Ar n
+.\" times.
+.It Ic quit
+Exit
+.Nm .
+.It Ic raw
+Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+.It Ic timeout Ar milliseconds
+Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+.Nm
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.It Ic version
+Print the version of the
+.Nm
+program.
+.El
+
+.Ss "Control Message Commands"
+Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode-6 message to the server and expect a single response message.
+The exceptions are the
+.Li peers
+command, which sends a series of messages,
+and the
+.Li mreadlist
+and
+.Li mreadvar
+commands, which iterate over a range of associations.
+.Bl -tag -width "something" -compact -offset indent
+.It Cm associations
+Display a list of mobilized associations in the form:
+.Dl ind assid status conf reach auth condition last_event cnt
+.Bl -column -offset indent ".Sy Variable" ".Sy Description"
+.It Sy String Ta Sy Description
+.It Li ind Ta index on this list
+.It Li assid Ta association ID
+.It Li status Ta peer status word
+.It Li conf Ta Li yes : persistent, Li no : ephemeral
+.It Li reach Ta Li yes : reachable, Li no : unreachable
+.It Li auth Ta Li ok , Li yes , Li bad and Li none
+.It Li condition Ta selection status (see the Li select field of the peer status word)
+.It Li last_event Ta event report (see the Li event field of the peer status word)
+.It Li cnt Ta event count (see the Li count field of the peer status word)
+.El
+.It Cm authinfo
+Display the authentication statistics.
+.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
+.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
+Display a list of clock variables for those associations supporting a reference clock.
+.It Cm :config Op ...
+Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
+.It Cm config-from-file Ar filename
+Send the each line of
+.Ar filename
+to the server as run-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
+.It Ic ifstats
+Display statistics for each local network address. Authentication is required.
+.It Ic iostats
+Display network and reference clock I/O statistics.
+.It Ic kerninfo
+Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
+.It Ic lassociations
+Perform the same function as the associations command, except display mobilized and unmobilized associations.
+.It Ic lopeers Xo
+.Oo Ic -4 |
+.Ic -6
+.Oc
+.Xc
+Obtain and print a list of all peers and clients showing
+.Ar dstadr
+(associated with any given IP version).
+.It Ic lpeers Xo
+.Oo Ic -4 |
+.Ic -6
+.Oc
+.Xc
+Print a peer spreadsheet for the appropriate IP version(s).
+.Ar dstadr
+(associated with any given IP version).
+.It Ic monstats
+Display monitor facility statistics.
+.It Ic mrulist Oo Ic limited | Ic kod | Ic mincount Ns = Ns Ar count | Ic laddr Ns = Ns Ar localaddr | Ic sort Ns = Ns Ar sortorder | Ic resany Ns = Ns Ar hexmask | Ic resall Ns = Ns Ar hexmask Oc
+Obtain and print traffic counts collected and maintained by the monitor facility.
+With the exception of
+.Cm sort Ns = Ns Ar sortorder ,
+the options filter the list returned by
+.Cm ntpd.
+The
+.Cm limited
+and
+.Cm kod
+options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
+The
+.Cm mincount Ns = Ns Ar count
+option filters entries representing less than
+.Ar count
+packets.
+The
+.Cm laddr Ns = Ns Ar localaddr
+option filters entries for packets received on any local address other than
+.Ar localaddr .
+.Cm resany Ns = Ns Ar hexmask
+and
+.Cm resall Ns = Ns Ar hexmask
+filter entries containing none or less than all, respectively, of the bits in
+.Ar hexmask ,
+which must begin with
+.Cm 0x .
+The
+.Ar sortorder
+defaults to
+.Cm lstint
+and may be any of
+.Cm addr ,
+.Cm count ,
+.Cm avgint ,
+.Cm lstint ,
+or any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+.Bl -tag -width "something" -compact -offset indent
+.It Column
+Description
+.It Ic lstint
+Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
+.Nm .
+.It Ic avgint
+Average interval in s between packets from this address.
+.It Ic rstr
+Restriction flags associated with this address.
+Most are copied unchanged from the matching
+.Ic restrict
+command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
+.It Ic r
+Rate control indicator, either
+a period,
+.Ic L
+or
+.Ic K
+for no rate control response,
+rate limiting by discarding, or rate limiting with a KoD response, respectively.
+.It Ic m
+Packet mode.
+.It Ic v
+Packet version number.
+.It Ic count
+Packets received from this address.
+.It Ic rport
+Source port of last packet from this address.
+.It Ic remote address
+DNS name, numeric address, or address followed by
+claimed DNS name which could not be verified in parentheses.
+.El
+.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
+.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
+Perform the same function as the
+.Ic readvar
+command, except for a range of association IDs.
+This range is determined from the association list cached by the most recent
+.Ic associations
+command.
+.It Ic opeers Xo
+.Oo Ic -4 |
+.Ic -6
+.Oc
+.Xc
+Obtain and print the old-style list of all peers and clients showing
+.Ar dstadr
+(associated with any given IP version),
+rather than the
+.Ar refid .
+.It Ic passociations
+Perform the same function as the
+.Ic associations
+command,
+except that it uses previously stored data rather than making a new query.
+.It Ic peers
+Display a list of peers in the form:
+.Dl [tally]remote refid st t when pool reach delay offset jitter
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic [tally]
+single-character code indicating current value of the
+.Ic select
+field of the
+.Lk decode.html#peer "peer status word"
+.It Ic remote
+host name (or IP number) of peer.
+The value displayed will be truncated to 15 characters unless the
+.Fl w
+flag is given, in which case the full value will be displayed
+on the first line,
+and the remaining data is displayed on the next line.
+.It Ic refid
+association ID or
+.Lk decode.html#kiss "'kiss code"
+.It Ic st
+stratum
+.It Ic t
+.Ic u :
+unicast or manycast client,
+.Ic b :
+broadcast or multicast client,
+.Ic l :
+local (reference clock),
+.Ic s :
+symmetric (peer),
+.Ic A :
+manycast server,
+.Ic B :
+broadcast server,
+.Ic M :
+multicast server
+.It Ic when
+sec/min/hr since last received packet
+.It Ic poll
+poll interval (log2 s)
+.It Ic reach
+reach shift register (octal)
+.It Ic delay
+roundtrip delay
+.It Ic offset
+offset of server relative to this host
+.It Ic jitter
+jitter
+.El
+.It Ic pstats Ar assocID
+Show the statistics for the peer with the given
+.Ar assocID .
+.It Ic readlist Ar assocID
+.It Ic rl Ar assocID
+Read the system or peer variables included in the variable list.
+.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc
+.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc
+Display the specified variables.
+If
+.Ar assocID
+is zero, the variables are from the
+.Sx System Variables
+name space, otherwise they are from the
+.Sx Peer Variables
+name space.
+The
+.Ar assocID
+is required, as the same name can occur in both spaces.
+If no
+.Ar name
+is included, all operative variables in the name space are displayed.
+
+In this case only, if the
+.Ar assocID
+is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds
+and frequency values in parts-per-million (PPM).
+Some NTP timestamps are represented in the format
+YYYYMMDDTTTT ,
+where YYYY is the year,
+MM the month of year,
+DD the day of month and
+TTTT the time of day.
+.It Ic reslist
+Show the access control (restrict) list for
+.Nm .
+
+.It Ic saveconfig Ar filename
+Write the current configuration,
+including any runtime modifications given with
+.Ic :config
+or
+.Ic config-from-file ,
+to the ntpd host's file
+.Ar filename .
+This command will be rejected by the server unless
+.Lk miscopt.html#saveconfigdir "saveconfigdir"
+appears in the
+.Ic ntpd
+configuration file.
+.Ar filename
+can use
+.Xr strftime
+format specifies to substitute the current date and time, for example,
+.Ic q]saveconfig ntp-%Y%m%d-%H%M%S.confq] .
+The filename used is stored in system variable
+.Ic savedconfig .
+Authentication is required.
+.It Ic timerstats
+Display interval timer counters.
+.It Ic writelist Ar assocID
+Write the system or peer variables included in the variable list.
+.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ...
+Write the specified variables.
+If the
+.Ar assocID
+is zero, the variables are from the
+.Sx System Variables
+name space, otherwise they are from the
+.Sx Peer Variables
+name space.
+The
+.Ar assocID
+is required, as the same name can occur in both spaces.
+.It Ic sysinfo
+Display operational summary.
+.It Ic sysstats
+Print statistics counters maintained in the protocol module.
+.El
+
+.Ss Status Words and Kiss Codes
+
+The current state of the operating program is shown
+in a set of status words
+maintained by the system.
+Status information is also available on a per-association basis.
+These words are displayed in the
+.Ic rv
+and
+.Ic as
+commands both in hexadecimal and in decoded short tip strings.
+The codes, tips and short explanations are documented on the
+.Lk decode.html "Event Messages and Status Words"
+page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+.Pp
+Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+.Lk decode.html#kiss "kiss codes" .
+The original purpose was for kiss-o'-death (KoD) packets
+sent by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+
+.Ss System Variables
+The following system variables appear in the
+.Ic rv
+billboard.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic status
+.Lk decode.html#sys "system status word"
+.It Ic version
+NTP software version and build time
+.It Ic processor
+hardware platform and version
+.It Ic system
+operating system and version
+.It Ic leap
+leap warning indicator (0-3)
+.It Ic stratum
+stratum (1-15)
+.It Ic precision
+precision (log2 s)
+.It Ic rootdelay
+total roundtrip delay to the primary reference clock
+.It Ic rootdisp
+total dispersion to the primary reference clock
+.It Ic peer
+system peer association ID
+.It Ic tc
+time constant and poll exponent (log2 s) (3-17)
+.It Ic mintc
+minimum time constant (log2 s) (3-10)
+.It Ic clock
+date and time of day
+.It Ic refid
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.It Ic reftime
+reference time
+.It Ic offset
+combined offset of server relative to this host
+.It Ic sys_jitter
+combined system jitter
+.It Ic frequency
+frequency offset (PPM) relative to hardware clock
+.It Ic clk_wander
+clock frequency wander (PPM)
+.It Ic clk_jitter
+clock jitter
+.It Ic tai
+TAI-UTC offset (s)
+.It Ic leapsec
+NTP seconds when the next leap second is/was inserted
+.It Ic expire
+NTP seconds when the NIST leapseconds file expires
+.El
+The jitter and wander statistics are exponentially-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+.Pp
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed,
+including some or all of the following,
+depending on the particular Autokey dance:
+
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic host
+Autokey host name for this host
+.It Ic ident
+Autokey group name for this host
+.It Ic flags
+host flags (see Autokey specification)
+.It Ic digest
+OpenSSL message digest algorithm
+.It Ic signature
+OpenSSL digest/signature scheme
+.It Ic update
+NTP seconds at last signature update
+.It Ic cert
+certificate subject, issuer and certificate flags
+.It Ic until
+NTP seconds when the certificate expires
+.El
+.Ss Peer Variables
+The following peer variables appear in the
+.Ic rv
+billboard for each association.
+Not all variables are displayed in some configurations.
+
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic associd
+association ID
+.It Ic status
+.Lk decode.html#peer "peer status word"
+.It Ic srcadr
+source (remote) IP address
+.It Ic srcport
+source (remote) port
+.It Ic dstadr
+destination (local) IP address
+.It Ic dstport
+destination (local) port
+.It Ic leap
+leap indicator (0-3)
+.It Ic stratum
+stratum (0-15)
+.It Ic precision
+precision (log2 s)
+.It Ic rootdelay
+total roundtrip delay to the primary reference clock
+.It Ic rootdisp
+total root dispersion to the primary reference clock
+.It Ic refid
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.It Ic reftime
+reference time
+.It Ic reach
+reach register (octal)
+.It Ic unreach
+unreach counter
+.It Ic hmode
+host mode (1-6)
+.It Ic pmode
+peer mode (1-5)
+.It Ic hpoll
+host poll exponent (log2 s) (3-17)
+.It Ic ppoll
+peer poll exponent (log2 s) (3-17)
+.It Ic headway
+headway (see
+.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" )
+.It Ic flash
+.Lk decode.html#flash "flash status word"
+.It Ic offset
+filter offset
+.It Ic delay
+filter delay
+.It Ic dispersion
+filter dispersion
+.It Ic jitter
+filter jitter
+.It Ic ident
+Autokey group name for this association
+.It Ic bias
+unicast/broadcast bias
+.It Ic xleave
+interleave delay (see
+.Lk xleave.html "NTP Interleaved Modes" )
+.El
+The
+.Ic bias
+variable is calculated when the first broadcast packet is received
+after the calibration volley.
+It represents the offset of the broadcast subgraph relative to the unicast subgraph.
+The
+.Ic xleave
+variable appears only for the interleaved symmetric and interleaved modes.
+It represents the internal queuing, buffering and transmission delays
+for the preceding packet.
+.Pp
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic flags
+peer flags (see Autokey specification)
+.It Ic host
+Autokey server name
+.It Ic flags
+peer flags (see Autokey specification)
+.It Ic signature
+OpenSSL digest/signature scheme
+.It Ic initsequence
+initial key ID
+.It Ic initkey
+initial key index
+.It Ic timestamp
+Autokey signature timestamp
+.El
+
+.Ss Clock Variables
+The following clock variables appear in the
+.Ic cv
+billboard for each association with a reference clock.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic associd
+association ID
+.It Ic status
+.Lk decode.html#clock "clock status word"
+.It Ic device
+device description
+.It Ic timecode
+ASCII time code string (specific to device)
+.It Ic poll
+poll messages sent
+.It Ic noreply
+no reply
+.It Ic badformat
+bad format
+.It Ic baddata
+bad date or time
+.It Ic fudgetime1
+fudge time 1
+.It Ic fudgetime2
+fudge time 2
+.It Ic stratum
+driver stratum
+.It Ic refid
+driver reference ID
+.It Ic flags
+driver flags
+.El
+ _END_PROG_MDOC_DESCRIP;
+};
diff --git a/ntpq/ntpq-opts.h b/ntpq/ntpq-opts.h
new file mode 100644
index 0000000..c6c4f8d
--- /dev/null
+++ b/ntpq/ntpq-opts.h
@@ -0,0 +1,294 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpq-opts.h)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:57:37 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpq-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpq author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpq program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+/**
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the ntpq program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_NTPQ_OPTS_H_GUARD
+#define AUTOOPTS_NTPQ_OPTS_H_GUARD 1
+#include "config.h"
+#include <autoopts/options.h>
+
+/**
+ * Ensure that the library used for compiling this generated header is at
+ * least as new as the version current when the header template was released
+ * (not counting patch version increments). Also ensure that the oldest
+ * tolerable version is at least as old as what was current when the header
+ * template was released.
+ */
+#define AO_TEMPLATE_VERSION 167936
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+ Choke Me.
+#endif
+
+/**
+ * Enumeration of each option type for ntpq
+ */
+typedef enum {
+ INDEX_OPT_IPV4 = 0,
+ INDEX_OPT_IPV6 = 1,
+ INDEX_OPT_COMMAND = 2,
+ INDEX_OPT_DEBUG_LEVEL = 3,
+ INDEX_OPT_SET_DEBUG_LEVEL = 4,
+ INDEX_OPT_INTERACTIVE = 5,
+ INDEX_OPT_NUMERIC = 6,
+ INDEX_OPT_OLD_RV = 7,
+ INDEX_OPT_PEERS = 8,
+ INDEX_OPT_WIDE = 9,
+ INDEX_OPT_VERSION = 10,
+ INDEX_OPT_HELP = 11,
+ INDEX_OPT_MORE_HELP = 12,
+ INDEX_OPT_SAVE_OPTS = 13,
+ INDEX_OPT_LOAD_OPTS = 14
+} teOptIndex;
+/** count of all options for ntpq */
+#define OPTION_CT 15
+/** ntpq version */
+#define NTPQ_VERSION "4.2.7p482"
+/** Full ntpq version text */
+#define NTPQ_FULL_VERSION "ntpq 4.2.7p482"
+
+/**
+ * Interface defines for all options. Replace "n" with the UPPER_CASED
+ * option name (as in the teOptIndex enumeration above).
+ * e.g. HAVE_OPT(IPV4)
+ */
+#define DESC(n) (ntpqOptions.pOptDesc[INDEX_OPT_## n])
+/** 'true' if an option has been specified in any way */
+#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
+/** The string argument to an option. The argument type must be \"string\". */
+#define OPT_ARG(n) (DESC(n).optArg.argString)
+/** Mask the option state revealing how an option was specified.
+ * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
+ * \a OPTST_DEFINED, \a OPTST_RESET or zero.
+ */
+#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
+/** Count of option's occurrances *on the command line*. */
+#define COUNT_OPT(n) (DESC(n).optOccCt)
+/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
+#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
+/** 'true' if \a HAVE_OPT would yield 'false'. */
+#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
+/** 'true' if OPTST_DISABLED bit not set. */
+#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
+/** number of stacked option arguments.
+ * Valid only for stacked option arguments. */
+#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
+/** stacked argument vector.
+ * Valid only for stacked option arguments. */
+#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
+/** Reset an option. */
+#define CLEAR_OPT(n) STMTS( \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ DESC(n).fOptState |= OPTST_DISABLED; \
+ DESC(n).optCookie = NULL )
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Enumeration of ntpq exit codes
+ */
+typedef enum {
+ NTPQ_EXIT_SUCCESS = 0,
+ NTPQ_EXIT_FAILURE = 1,
+ NTPQ_EXIT_USAGE_ERROR = 64,
+ NTPQ_EXIT_NO_CONFIG_INPUT = 66,
+ NTPQ_EXIT_LIBOPTS_FAILURE = 70
+} ntpq_exit_code_t;
+/** @} */
+/**
+ * Make sure there are no #define name conflicts with the option names
+ */
+#ifndef NO_OPTION_NAME_WARNINGS
+# ifdef IPV4
+# warning undefining IPV4 due to option name conflict
+# undef IPV4
+# endif
+# ifdef IPV6
+# warning undefining IPV6 due to option name conflict
+# undef IPV6
+# endif
+# ifdef COMMAND
+# warning undefining COMMAND due to option name conflict
+# undef COMMAND
+# endif
+# ifdef DEBUG_LEVEL
+# warning undefining DEBUG_LEVEL due to option name conflict
+# undef DEBUG_LEVEL
+# endif
+# ifdef SET_DEBUG_LEVEL
+# warning undefining SET_DEBUG_LEVEL due to option name conflict
+# undef SET_DEBUG_LEVEL
+# endif
+# ifdef INTERACTIVE
+# warning undefining INTERACTIVE due to option name conflict
+# undef INTERACTIVE
+# endif
+# ifdef NUMERIC
+# warning undefining NUMERIC due to option name conflict
+# undef NUMERIC
+# endif
+# ifdef OLD_RV
+# warning undefining OLD_RV due to option name conflict
+# undef OLD_RV
+# endif
+# ifdef PEERS
+# warning undefining PEERS due to option name conflict
+# undef PEERS
+# endif
+# ifdef WIDE
+# warning undefining WIDE due to option name conflict
+# undef WIDE
+# endif
+#else /* NO_OPTION_NAME_WARNINGS */
+# undef IPV4
+# undef IPV6
+# undef COMMAND
+# undef DEBUG_LEVEL
+# undef SET_DEBUG_LEVEL
+# undef INTERACTIVE
+# undef NUMERIC
+# undef OLD_RV
+# undef PEERS
+# undef WIDE
+#endif /* NO_OPTION_NAME_WARNINGS */
+
+/**
+ * Interface defines for specific options.
+ * @{
+ */
+#define VALUE_OPT_IPV4 '4'
+#define VALUE_OPT_IPV6 '6'
+#define VALUE_OPT_COMMAND 'c'
+#define VALUE_OPT_DEBUG_LEVEL 'd'
+#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
+
+#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
+#define VALUE_OPT_INTERACTIVE 'i'
+#define VALUE_OPT_NUMERIC 'n'
+#define VALUE_OPT_OLD_RV 0x1001
+#define VALUE_OPT_PEERS 'p'
+#define VALUE_OPT_WIDE 'w'
+/** option flag (value) for help-value option */
+#define VALUE_OPT_HELP '?'
+/** option flag (value) for more-help-value option */
+#define VALUE_OPT_MORE_HELP '!'
+/** option flag (value) for version-value option */
+#define VALUE_OPT_VERSION 0x1002
+/** option flag (value) for save-opts-value option */
+#define VALUE_OPT_SAVE_OPTS '>'
+/** option flag (value) for load-opts-value option */
+#define VALUE_OPT_LOAD_OPTS '<'
+#define SET_OPT_SAVE_OPTS(a) STMTS( \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
+ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
+ DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
+/*
+ * Interface defines not associated with particular options
+ */
+#define ERRSKIP_OPTERR STMTS(ntpqOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(ntpqOptions.fOptSet |= OPTPROC_ERRSTOP)
+#define RESTART_OPT(n) STMTS( \
+ ntpqOptions.curOptIdx = (n); \
+ ntpqOptions.pzCurOpt = NULL )
+#define START_OPT RESTART_OPT(1)
+#define USAGE(c) (*ntpqOptions.pUsageProc)(&ntpqOptions, c)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* * * * * *
+ *
+ * Declare the ntpq option descriptor.
+ */
+extern tOptions ntpqOptions;
+
+#if defined(ENABLE_NLS)
+# ifndef _
+# include <stdio.h>
+# ifndef HAVE_GETTEXT
+ extern char * gettext(char const *);
+# else
+# include <libintl.h>
+# endif
+
+# ifndef ATTRIBUTE_FORMAT_ARG
+# define ATTRIBUTE_FORMAT_ARG(_a)
+# endif
+
+static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
+static inline char* aoGetsText(char const* pz) {
+ if (pz == NULL) return NULL;
+ return (char*)gettext(pz);
+}
+# define _(s) aoGetsText(s)
+# endif /* _() */
+
+# define OPT_NO_XLAT_CFG_NAMES STMTS(ntpqOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT_CFG;)
+# define OPT_NO_XLAT_OPT_NAMES STMTS(ntpqOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
+
+# define OPT_XLAT_CFG_NAMES STMTS(ntpqOptions.fOptSet &= \
+ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
+# define OPT_XLAT_OPT_NAMES STMTS(ntpqOptions.fOptSet &= \
+ ~OPTPROC_NXLAT_OPT;)
+
+#else /* ENABLE_NLS */
+# define OPT_NO_XLAT_CFG_NAMES
+# define OPT_NO_XLAT_OPT_NAMES
+
+# define OPT_XLAT_CFG_NAMES
+# define OPT_XLAT_OPT_NAMES
+
+# ifndef _
+# define _(_s) _s
+# endif
+#endif /* ENABLE_NLS */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_NTPQ_OPTS_H_GUARD */
+
+/* ntpq-opts.h ends here */
diff --git a/ntpq/ntpq-subs.c b/ntpq/ntpq-subs.c
new file mode 100644
index 0000000..5460f80
--- /dev/null
+++ b/ntpq/ntpq-subs.c
@@ -0,0 +1,3875 @@
+/*
+ * ntpq-subs.c - subroutines which are called to perform ntpq commands.
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/time.h>
+
+#include "ntpq.h"
+#include "ntpq-opts.h"
+
+extern char currenthost[];
+extern int currenthostisnum;
+size_t maxhostlen;
+
+/*
+ * Declarations for command handlers in here
+ */
+static associd_t checkassocid (u_int32);
+static struct varlist *findlistvar (struct varlist *, char *);
+static void doaddvlist (struct varlist *, const char *);
+static void dormvlist (struct varlist *, const char *);
+static void doclearvlist (struct varlist *);
+static void makequerydata (struct varlist *, int *, char *);
+static int doquerylist (struct varlist *, int, associd_t, int,
+ u_short *, int *, const char **);
+static void doprintvlist (struct varlist *, FILE *);
+static void addvars (struct parse *, FILE *);
+static void rmvars (struct parse *, FILE *);
+static void clearvars (struct parse *, FILE *);
+static void showvars (struct parse *, FILE *);
+static int dolist (struct varlist *, associd_t, int, int,
+ FILE *);
+static void readlist (struct parse *, FILE *);
+static void writelist (struct parse *, FILE *);
+static void readvar (struct parse *, FILE *);
+static void writevar (struct parse *, FILE *);
+static void clocklist (struct parse *, FILE *);
+static void clockvar (struct parse *, FILE *);
+static int findassidrange (u_int32, u_int32, int *, int *,
+ FILE *);
+static void mreadlist (struct parse *, FILE *);
+static void mreadvar (struct parse *, FILE *);
+static void printassoc (int, FILE *);
+static void associations (struct parse *, FILE *);
+static void lassociations (struct parse *, FILE *);
+static void passociations (struct parse *, FILE *);
+static void lpassociations (struct parse *, FILE *);
+
+#ifdef UNUSED
+static void radiostatus (struct parse *, FILE *);
+#endif /* UNUSED */
+
+static void authinfo (struct parse *, FILE *);
+static void pstats (struct parse *, FILE *);
+static long when (l_fp *, l_fp *, l_fp *);
+static char * prettyinterval (char *, size_t, long);
+static int doprintpeers (struct varlist *, int, int, int, const char *, FILE *, int);
+static int dogetpeers (struct varlist *, associd_t, FILE *, int);
+static void dopeers (int, FILE *, int);
+static void peers (struct parse *, FILE *);
+static void lpeers (struct parse *, FILE *);
+static void doopeers (int, FILE *, int);
+static void opeers (struct parse *, FILE *);
+static void lopeers (struct parse *, FILE *);
+static void config (struct parse *, FILE *);
+static void saveconfig (struct parse *, FILE *);
+static void config_from_file(struct parse *, FILE *);
+static void mrulist (struct parse *, FILE *);
+static void ifstats (struct parse *, FILE *);
+static void reslist (struct parse *, FILE *);
+static void sysstats (struct parse *, FILE *);
+static void sysinfo (struct parse *, FILE *);
+static void kerninfo (struct parse *, FILE *);
+static void monstats (struct parse *, FILE *);
+static void iostats (struct parse *, FILE *);
+static void timerstats (struct parse *, FILE *);
+
+/*
+ * Commands we understand. Ntpdc imports this.
+ */
+struct xcmd opcmds[] = {
+ { "saveconfig", saveconfig, { NTP_STR, NO, NO, NO },
+ { "filename", "", "", ""},
+ "save ntpd configuration to file, . for current config file"},
+ { "associations", associations, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "print list of association ID's and statuses for the server's peers" },
+ { "passociations", passociations, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "print list of associations returned by last associations command" },
+ { "lassociations", lassociations, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "print list of associations including all client information" },
+ { "lpassociations", lpassociations, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "print last obtained list of associations, including client information" },
+ { "addvars", addvars, { NTP_STR, NO, NO, NO },
+ { "name[=value][,...]", "", "", "" },
+ "add variables to the variable list or change their values" },
+ { "rmvars", rmvars, { NTP_STR, NO, NO, NO },
+ { "name[,...]", "", "", "" },
+ "remove variables from the variable list" },
+ { "clearvars", clearvars, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "remove all variables from the variable list" },
+ { "showvars", showvars, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "print variables on the variable list" },
+ { "readlist", readlist, { OPT|NTP_UINT, NO, NO, NO },
+ { "assocID", "", "", "" },
+ "read the system or peer variables included in the variable list" },
+ { "rl", readlist, { OPT|NTP_UINT, NO, NO, NO },
+ { "assocID", "", "", "" },
+ "read the system or peer variables included in the variable list" },
+ { "writelist", writelist, { OPT|NTP_UINT, NO, NO, NO },
+ { "assocID", "", "", "" },
+ "write the system or peer variables included in the variable list" },
+ { "readvar", readvar, { OPT|NTP_UINT, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR, },
+ { "assocID", "varname1", "varname2", "varname3" },
+ "read system or peer variables" },
+ { "rv", readvar, { OPT|NTP_UINT, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR, },
+ { "assocID", "varname1", "varname2", "varname3" },
+ "read system or peer variables" },
+ { "writevar", writevar, { NTP_UINT, NTP_STR, NO, NO },
+ { "assocID", "name=value,[...]", "", "" },
+ "write system or peer variables" },
+ { "mreadlist", mreadlist, { NTP_UINT, NTP_UINT, NO, NO },
+ { "assocIDlow", "assocIDhigh", "", "" },
+ "read the peer variables in the variable list for multiple peers" },
+ { "mrl", mreadlist, { NTP_UINT, NTP_UINT, NO, NO },
+ { "assocIDlow", "assocIDhigh", "", "" },
+ "read the peer variables in the variable list for multiple peers" },
+ { "mreadvar", mreadvar, { NTP_UINT, NTP_UINT, OPT|NTP_STR, NO },
+ { "assocIDlow", "assocIDhigh", "name=value[,...]", "" },
+ "read peer variables from multiple peers" },
+ { "mrv", mreadvar, { NTP_UINT, NTP_UINT, OPT|NTP_STR, NO },
+ { "assocIDlow", "assocIDhigh", "name=value[,...]", "" },
+ "read peer variables from multiple peers" },
+ { "clocklist", clocklist, { OPT|NTP_UINT, NO, NO, NO },
+ { "assocID", "", "", "" },
+ "read the clock variables included in the variable list" },
+ { "cl", clocklist, { OPT|NTP_UINT, NO, NO, NO },
+ { "assocID", "", "", "" },
+ "read the clock variables included in the variable list" },
+ { "clockvar", clockvar, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO },
+ { "assocID", "name=value[,...]", "", "" },
+ "read clock variables" },
+ { "cv", clockvar, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO },
+ { "assocID", "name=value[,...]", "", "" },
+ "read clock variables" },
+ { "pstats", pstats, { NTP_UINT, NO, NO, NO },
+ { "assocID", "", "", "" },
+ "show statistics for a peer" },
+ { "peers", peers, { OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "obtain and print a list of the server's peers [IP version]" },
+ { "lpeers", lpeers, { OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "obtain and print a list of all peers and clients [IP version]" },
+ { "opeers", opeers, { OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "print peer list the old way, with dstadr shown rather than refid [IP version]" },
+ { "lopeers", lopeers, { OPT|IP_VERSION, NO, NO, NO },
+ { "-4|-6", "", "", "" },
+ "obtain and print a list of all peers and clients showing dstadr [IP version]" },
+ { ":config", config, { NTP_STR, NO, NO, NO },
+ { "<configuration command line>", "", "", "" },
+ "send a remote configuration command to ntpd" },
+ { "config-from-file", config_from_file, { NTP_STR, NO, NO, NO },
+ { "<configuration filename>", "", "", "" },
+ "configure ntpd using the configuration filename" },
+ { "mrulist", mrulist, { OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR, OPT|NTP_STR },
+ { "tag=value", "tag=value", "tag=value", "tag=value" },
+ "display the list of most recently seen source addresses, tags mincount=... resall=0x... resany=0x..." },
+ { "ifstats", ifstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "show statistics for each local address ntpd is using" },
+ { "reslist", reslist, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "show ntpd access control list" },
+ { "sysinfo", sysinfo, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display system summary" },
+ { "kerninfo", kerninfo, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display kernel loop and PPS statistics" },
+ { "sysstats", sysstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display system uptime and packet counts" },
+ { "monstats", monstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display monitor (mrulist) counters and limits" },
+ { "authinfo", authinfo, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display symmetric authentication counters" },
+ { "iostats", iostats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display network input and output counters" },
+ { "timerstats", timerstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display interval timer counters" },
+ { 0, 0, { NO, NO, NO, NO },
+ { "-4|-6", "", "", "" }, "" }
+};
+
+
+/*
+ * Variable list data space
+ */
+#define MAXLINE 512 /* maximum length of a line */
+#define MAXLIST 128 /* maximum variables in list */
+#define LENHOSTNAME 256 /* host name limit */
+
+#define MRU_GOT_COUNT 0x1
+#define MRU_GOT_LAST 0x2
+#define MRU_GOT_FIRST 0x4
+#define MRU_GOT_MV 0x8
+#define MRU_GOT_RS 0x10
+#define MRU_GOT_ADDR 0x20
+#define MRU_GOT_ALL (MRU_GOT_COUNT | MRU_GOT_LAST | MRU_GOT_FIRST \
+ | MRU_GOT_MV | MRU_GOT_RS | MRU_GOT_ADDR)
+
+/*
+ * mrulist() depends on MRUSORT_DEF and MRUSORT_RDEF being the first two
+ */
+typedef enum mru_sort_order_tag {
+ MRUSORT_DEF = 0, /* lstint ascending */
+ MRUSORT_R_DEF, /* lstint descending */
+ MRUSORT_AVGINT, /* avgint ascending */
+ MRUSORT_R_AVGINT, /* avgint descending */
+ MRUSORT_ADDR, /* IPv4 asc. then IPv6 asc. */
+ MRUSORT_R_ADDR, /* IPv6 desc. then IPv4 desc. */
+ MRUSORT_COUNT, /* hit count ascending */
+ MRUSORT_R_COUNT, /* hit count descending */
+ MRUSORT_MAX, /* special: count of this enum */
+} mru_sort_order;
+
+const char * const mru_sort_keywords[MRUSORT_MAX] = {
+ "lstint", /* MRUSORT_DEF */
+ "-lstint", /* MRUSORT_R_DEF */
+ "avgint", /* MRUSORT_AVGINT */
+ "-avgint", /* MRUSORT_R_AVGINT */
+ "addr", /* MRUSORT_ADDR */
+ "-addr", /* MRUSORT_R_ADDR */
+ "count", /* MRUSORT_COUNT */
+ "-count", /* MRUSORT_R_COUNT */
+};
+
+typedef int (*qsort_cmp)(const void *, const void *);
+
+/*
+ * Old CTL_PST defines for version 2.
+ */
+#define OLD_CTL_PST_CONFIG 0x80
+#define OLD_CTL_PST_AUTHENABLE 0x40
+#define OLD_CTL_PST_AUTHENTIC 0x20
+#define OLD_CTL_PST_REACH 0x10
+#define OLD_CTL_PST_SANE 0x08
+#define OLD_CTL_PST_DISP 0x04
+
+#define OLD_CTL_PST_SEL_REJECT 0
+#define OLD_CTL_PST_SEL_SELCAND 1
+#define OLD_CTL_PST_SEL_SYNCCAND 2
+#define OLD_CTL_PST_SEL_SYSPEER 3
+
+char flash2[] = " .+* "; /* flash decode for version 2 */
+char flash3[] = " x.-+#*o"; /* flash decode for peer status version 3 */
+
+struct varlist {
+ char *name;
+ char *value;
+} g_varlist[MAXLIST] = { { 0, 0 } };
+
+/*
+ * Imported from ntpq.c
+ */
+extern int showhostnames;
+extern int wideremote;
+extern int rawmode;
+extern struct servent *server_entry;
+extern struct association *assoc_cache;
+extern u_char pktversion;
+
+typedef struct mru_tag mru;
+struct mru_tag {
+ mru * hlink; /* next in hash table bucket */
+ DECL_DLIST_LINK(mru, mlink);
+ int count;
+ l_fp last;
+ l_fp first;
+ u_char mode;
+ u_char ver;
+ u_short rs;
+ sockaddr_u addr;
+};
+
+typedef struct ifstats_row_tag {
+ u_int ifnum;
+ sockaddr_u addr;
+ sockaddr_u bcast;
+ int enabled;
+ u_int flags;
+ int mcast_count;
+ char name[32];
+ int peer_count;
+ int received;
+ int sent;
+ int send_errors;
+ u_int ttl;
+ u_int uptime;
+} ifstats_row;
+
+typedef struct reslist_row_tag {
+ u_int idx;
+ sockaddr_u addr;
+ sockaddr_u mask;
+ u_long hits;
+ char flagstr[128];
+} reslist_row;
+
+typedef struct var_display_collection_tag {
+ const char * const tag; /* system variable */
+ const char * const display; /* descriptive text */
+ u_char type; /* NTP_STR, etc */
+ union {
+ char * str;
+ sockaddr_u sau; /* NTP_ADD */
+ l_fp lfp; /* NTP_LFP */
+ } v; /* retrieved value */
+} vdc;
+
+/*
+ * other local function prototypes
+ */
+void mrulist_ctrl_c_hook(void);
+static mru * add_mru(mru *);
+static int collect_mru_list(const char *, l_fp *);
+static int fetch_nonce(char *, size_t);
+static int qcmp_mru_avgint(const void *, const void *);
+static int qcmp_mru_r_avgint(const void *, const void *);
+static int qcmp_mru_addr(const void *, const void *);
+static int qcmp_mru_r_addr(const void *, const void *);
+static int qcmp_mru_count(const void *, const void *);
+static int qcmp_mru_r_count(const void *, const void *);
+static void validate_ifnum(FILE *, u_int, int *, ifstats_row *);
+static void another_ifstats_field(int *, ifstats_row *, FILE *);
+static void collect_display_vdc(associd_t as, vdc *table,
+ int decodestatus, FILE *fp);
+
+/*
+ * static globals
+ */
+static u_int mru_count;
+static u_int mru_dupes;
+volatile int mrulist_interrupted;
+static mru mru_list; /* listhead */
+static mru ** hash_table;
+
+/*
+ * qsort comparison function table for mrulist(). The first two
+ * entries are NULL because they are handled without qsort().
+ */
+const static qsort_cmp mru_qcmp_table[MRUSORT_MAX] = {
+ NULL, /* MRUSORT_DEF unused */
+ NULL, /* MRUSORT_R_DEF unused */
+ &qcmp_mru_avgint, /* MRUSORT_AVGINT */
+ &qcmp_mru_r_avgint, /* MRUSORT_R_AVGINT */
+ &qcmp_mru_addr, /* MRUSORT_ADDR */
+ &qcmp_mru_r_addr, /* MRUSORT_R_ADDR */
+ &qcmp_mru_count, /* MRUSORT_COUNT */
+ &qcmp_mru_r_count, /* MRUSORT_R_COUNT */
+};
+
+/*
+ * checkassocid - return the association ID, checking to see if it is valid
+ */
+static associd_t
+checkassocid(
+ u_int32 value
+ )
+{
+ associd_t associd;
+ u_long ulvalue;
+
+ associd = (associd_t)value;
+ if (0 == associd || value != associd) {
+ ulvalue = value;
+ fprintf(stderr,
+ "***Invalid association ID %lu specified\n",
+ ulvalue);
+ return 0;
+ }
+
+ return associd;
+}
+
+
+/*
+ * findlistvar - Look for the named variable in a varlist. If found,
+ * return a pointer to it. Otherwise, if the list has
+ * slots available, return the pointer to the first free
+ * slot, or NULL if it's full.
+ */
+static struct varlist *
+findlistvar(
+ struct varlist *list,
+ char *name
+ )
+{
+ struct varlist *vl;
+
+ for (vl = list; vl < list + MAXLIST && vl->name != NULL; vl++)
+ if (!strcmp(name, vl->name))
+ return vl;
+ if (vl < list + MAXLIST)
+ return vl;
+
+ return NULL;
+}
+
+
+/*
+ * doaddvlist - add variable(s) to the variable list
+ */
+static void
+doaddvlist(
+ struct varlist *vlist,
+ const char *vars
+ )
+{
+ struct varlist *vl;
+ int len;
+ char *name;
+ char *value;
+
+ len = strlen(vars);
+ while (nextvar(&len, &vars, &name, &value)) {
+ vl = findlistvar(vlist, name);
+ if (NULL == vl) {
+ fprintf(stderr, "Variable list full\n");
+ return;
+ }
+
+ if (NULL == vl->name) {
+ vl->name = estrdup(name);
+ } else if (vl->value != NULL) {
+ free(vl->value);
+ vl->value = NULL;
+ }
+
+ if (value != NULL)
+ vl->value = estrdup(value);
+ }
+}
+
+
+/*
+ * dormvlist - remove variable(s) from the variable list
+ */
+static void
+dormvlist(
+ struct varlist *vlist,
+ const char *vars
+ )
+{
+ struct varlist *vl;
+ int len;
+ char *name;
+ char *value;
+
+ len = strlen(vars);
+ while (nextvar(&len, &vars, &name, &value)) {
+ vl = findlistvar(vlist, name);
+ if (vl == 0 || vl->name == 0) {
+ (void) fprintf(stderr, "Variable `%s' not found\n",
+ name);
+ } else {
+ free((void *)vl->name);
+ if (vl->value != 0)
+ free(vl->value);
+ for ( ; (vl+1) < (g_varlist + MAXLIST)
+ && (vl+1)->name != 0; vl++) {
+ vl->name = (vl+1)->name;
+ vl->value = (vl+1)->value;
+ }
+ vl->name = vl->value = 0;
+ }
+ }
+}
+
+
+/*
+ * doclearvlist - clear a variable list
+ */
+static void
+doclearvlist(
+ struct varlist *vlist
+ )
+{
+ register struct varlist *vl;
+
+ for (vl = vlist; vl < vlist + MAXLIST && vl->name != 0; vl++) {
+ free((void *)vl->name);
+ vl->name = 0;
+ if (vl->value != 0) {
+ free(vl->value);
+ vl->value = 0;
+ }
+ }
+}
+
+
+/*
+ * makequerydata - form a data buffer to be included with a query
+ */
+static void
+makequerydata(
+ struct varlist *vlist,
+ int *datalen,
+ char *data
+ )
+{
+ register struct varlist *vl;
+ register char *cp, *cpend;
+ register int namelen, valuelen;
+ register int totallen;
+
+ cp = data;
+ cpend = data + *datalen;
+
+ for (vl = vlist; vl < vlist + MAXLIST && vl->name != 0; vl++) {
+ namelen = strlen(vl->name);
+ if (vl->value == 0)
+ valuelen = 0;
+ else
+ valuelen = strlen(vl->value);
+ totallen = namelen + valuelen + (valuelen != 0) + (cp != data);
+ if (cp + totallen > cpend) {
+ fprintf(stderr,
+ "***Ignoring variables starting with `%s'\n",
+ vl->name);
+ break;
+ }
+
+ if (cp != data)
+ *cp++ = ',';
+ memcpy(cp, vl->name, (size_t)namelen);
+ cp += namelen;
+ if (valuelen != 0) {
+ *cp++ = '=';
+ memcpy(cp, vl->value, (size_t)valuelen);
+ cp += valuelen;
+ }
+ }
+ *datalen = cp - data;
+}
+
+
+/*
+ * doquerylist - send a message including variables in a list
+ */
+static int
+doquerylist(
+ struct varlist *vlist,
+ int op,
+ associd_t associd,
+ int auth,
+ u_short *rstatus,
+ int *dsize,
+ const char **datap
+ )
+{
+ char data[CTL_MAX_DATA_LEN];
+ int datalen;
+
+ datalen = sizeof(data);
+ makequerydata(vlist, &datalen, data);
+
+ return doquery(op, associd, auth, datalen, data, rstatus, dsize,
+ datap);
+}
+
+
+/*
+ * doprintvlist - print the variables on a list
+ */
+static void
+doprintvlist(
+ struct varlist *vlist,
+ FILE *fp
+ )
+{
+ size_t n;
+
+ if (NULL == vlist->name) {
+ fprintf(fp, "No variables on list\n");
+ return;
+ }
+ for (n = 0; n < MAXLIST && vlist[n].name != NULL; n++) {
+ if (NULL == vlist[n].value)
+ fprintf(fp, "%s\n", vlist[n].name);
+ else
+ fprintf(fp, "%s=%s\n", vlist[n].name,
+ vlist[n].value);
+ }
+}
+
+/*
+ * addvars - add variables to the variable list
+ */
+/*ARGSUSED*/
+static void
+addvars(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doaddvlist(g_varlist, pcmd->argval[0].string);
+}
+
+
+/*
+ * rmvars - remove variables from the variable list
+ */
+/*ARGSUSED*/
+static void
+rmvars(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ dormvlist(g_varlist, pcmd->argval[0].string);
+}
+
+
+/*
+ * clearvars - clear the variable list
+ */
+/*ARGSUSED*/
+static void
+clearvars(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doclearvlist(g_varlist);
+}
+
+
+/*
+ * showvars - show variables on the variable list
+ */
+/*ARGSUSED*/
+static void
+showvars(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ doprintvlist(g_varlist, fp);
+}
+
+
+/*
+ * dolist - send a request with the given list of variables
+ */
+static int
+dolist(
+ struct varlist *vlist,
+ associd_t associd,
+ int op,
+ int type,
+ FILE *fp
+ )
+{
+ const char *datap;
+ int res;
+ int dsize;
+ u_short rstatus;
+ int quiet;
+
+ /*
+ * if we're asking for specific variables don't include the
+ * status header line in the output.
+ */
+ if (old_rv)
+ quiet = 0;
+ else
+ quiet = (vlist->name != NULL);
+
+ res = doquerylist(vlist, op, associd, 0, &rstatus, &dsize, &datap);
+
+ if (res != 0)
+ return 0;
+
+ if (numhosts > 1)
+ fprintf(fp, "server=%s ", currenthost);
+ if (dsize == 0) {
+ if (associd == 0)
+ fprintf(fp, "No system%s variables returned\n",
+ (type == TYPE_CLOCK) ? " clock" : "");
+ else
+ fprintf(fp,
+ "No information returned for%s association %u\n",
+ (type == TYPE_CLOCK) ? " clock" : "",
+ associd);
+ return 1;
+ }
+
+ if (!quiet)
+ fprintf(fp, "associd=%u ", associd);
+ printvars(dsize, datap, (int)rstatus, type, quiet, fp);
+ return 1;
+}
+
+
+/*
+ * readlist - send a read variables request with the variables on the list
+ */
+static void
+readlist(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ associd_t associd;
+ int type;
+
+ if (pcmd->nargs == 0) {
+ associd = 0;
+ } else {
+ /* HMS: I think we want the u_int32 target here, not the u_long */
+ if (pcmd->argval[0].uval == 0)
+ associd = 0;
+ else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
+ return;
+ }
+
+ type = (0 == associd)
+ ? TYPE_SYS
+ : TYPE_PEER;
+ dolist(g_varlist, associd, CTL_OP_READVAR, type, fp);
+}
+
+
+/*
+ * writelist - send a write variables request with the variables on the list
+ */
+static void
+writelist(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ const char *datap;
+ int res;
+ associd_t associd;
+ int dsize;
+ u_short rstatus;
+
+ if (pcmd->nargs == 0) {
+ associd = 0;
+ } else {
+ /* HMS: Do we really want uval here? */
+ if (pcmd->argval[0].uval == 0)
+ associd = 0;
+ else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
+ return;
+ }
+
+ res = doquerylist(g_varlist, CTL_OP_WRITEVAR, associd, 1, &rstatus,
+ &dsize, &datap);
+
+ if (res != 0)
+ return;
+
+ if (numhosts > 1)
+ (void) fprintf(fp, "server=%s ", currenthost);
+ if (dsize == 0)
+ (void) fprintf(fp, "done! (no data returned)\n");
+ else {
+ (void) fprintf(fp,"associd=%u ", associd);
+ printvars(dsize, datap, (int)rstatus,
+ (associd != 0) ? TYPE_PEER : TYPE_SYS, 0, fp);
+ }
+ return;
+}
+
+
+/*
+ * readvar - send a read variables request with the specified variables
+ */
+static void
+readvar(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ associd_t associd;
+ u_int tmpcount;
+ u_int u;
+ int type;
+ struct varlist tmplist[MAXLIST];
+
+
+ /* HMS: uval? */
+ if (pcmd->nargs == 0 || pcmd->argval[0].uval == 0)
+ associd = 0;
+ else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
+ return;
+
+ ZERO(tmplist);
+ if (pcmd->nargs > 1) {
+ tmpcount = pcmd->nargs - 1;
+ for (u = 0; u < tmpcount; u++)
+ doaddvlist(tmplist, pcmd->argval[1 + u].string);
+ }
+
+ type = (0 == associd)
+ ? TYPE_SYS
+ : TYPE_PEER;
+ dolist(tmplist, associd, CTL_OP_READVAR, type, fp);
+
+ doclearvlist(tmplist);
+}
+
+
+/*
+ * writevar - send a write variables request with the specified variables
+ */
+static void
+writevar(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ const char *datap;
+ int res;
+ associd_t associd;
+ int type;
+ int dsize;
+ u_short rstatus;
+ struct varlist tmplist[MAXLIST];
+
+ /* HMS: uval? */
+ if (pcmd->argval[0].uval == 0)
+ associd = 0;
+ else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
+ return;
+
+ ZERO(tmplist);
+ doaddvlist(tmplist, pcmd->argval[1].string);
+
+ res = doquerylist(tmplist, CTL_OP_WRITEVAR, associd, 1, &rstatus,
+ &dsize, &datap);
+
+ doclearvlist(tmplist);
+
+ if (res != 0)
+ return;
+
+ if (numhosts > 1)
+ fprintf(fp, "server=%s ", currenthost);
+ if (dsize == 0)
+ fprintf(fp, "done! (no data returned)\n");
+ else {
+ fprintf(fp,"associd=%u ", associd);
+ type = (0 == associd)
+ ? TYPE_SYS
+ : TYPE_PEER;
+ printvars(dsize, datap, (int)rstatus, type, 0, fp);
+ }
+ return;
+}
+
+
+/*
+ * clocklist - send a clock variables request with the variables on the list
+ */
+static void
+clocklist(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ associd_t associd;
+
+ /* HMS: uval? */
+ if (pcmd->nargs == 0) {
+ associd = 0;
+ } else {
+ if (pcmd->argval[0].uval == 0)
+ associd = 0;
+ else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
+ return;
+ }
+
+ dolist(g_varlist, associd, CTL_OP_READCLOCK, TYPE_CLOCK, fp);
+}
+
+
+/*
+ * clockvar - send a clock variables request with the specified variables
+ */
+static void
+clockvar(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ associd_t associd;
+ struct varlist tmplist[MAXLIST];
+
+ /* HMS: uval? */
+ if (pcmd->nargs == 0 || pcmd->argval[0].uval == 0)
+ associd = 0;
+ else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
+ return;
+
+ ZERO(tmplist);
+ if (pcmd->nargs >= 2)
+ doaddvlist(tmplist, pcmd->argval[1].string);
+
+ dolist(tmplist, associd, CTL_OP_READCLOCK, TYPE_CLOCK, fp);
+
+ doclearvlist(tmplist);
+}
+
+
+/*
+ * findassidrange - verify a range of association ID's
+ */
+static int
+findassidrange(
+ u_int32 assid1,
+ u_int32 assid2,
+ int * from,
+ int * to,
+ FILE * fp
+ )
+{
+ associd_t assids[2];
+ int ind[COUNTOF(assids)];
+ u_int i;
+ size_t a;
+
+
+ if (0 == numassoc)
+ dogetassoc(fp);
+
+ assids[0] = checkassocid(assid1);
+ if (0 == assids[0])
+ return 0;
+ assids[1] = checkassocid(assid2);
+ if (0 == assids[1])
+ return 0;
+
+ for (a = 0; a < COUNTOF(assids); a++) {
+ ind[a] = -1;
+ for (i = 0; i < numassoc; i++)
+ if (assoc_cache[i].assid == assids[a])
+ ind[a] = i;
+ }
+ for (a = 0; a < COUNTOF(assids); a++)
+ if (-1 == ind[a]) {
+ fprintf(stderr,
+ "***Association ID %u not found in list\n",
+ assids[a]);
+ return 0;
+ }
+
+ if (ind[0] < ind[1]) {
+ *from = ind[0];
+ *to = ind[1];
+ } else {
+ *to = ind[0];
+ *from = ind[1];
+ }
+ return 1;
+}
+
+
+
+/*
+ * mreadlist - send a read variables request for multiple associations
+ */
+static void
+mreadlist(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int i;
+ int from;
+ int to;
+
+ if (!findassidrange(pcmd->argval[0].uval, pcmd->argval[1].uval,
+ &from, &to, fp))
+ return;
+
+ for (i = from; i <= to; i++) {
+ if (i != from)
+ fprintf(fp, "\n");
+ if (!dolist(g_varlist, assoc_cache[i].assid,
+ CTL_OP_READVAR, TYPE_PEER, fp))
+ return;
+ }
+ return;
+}
+
+
+/*
+ * mreadvar - send a read variables request for multiple associations
+ */
+static void
+mreadvar(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int i;
+ int from;
+ int to;
+ struct varlist tmplist[MAXLIST];
+ struct varlist *pvars;
+
+ if (!findassidrange(pcmd->argval[0].uval, pcmd->argval[1].uval,
+ &from, &to, fp))
+ return;
+
+ ZERO(tmplist);
+ if (pcmd->nargs >= 3) {
+ doaddvlist(tmplist, pcmd->argval[2].string);
+ pvars = tmplist;
+ } else {
+ pvars = g_varlist;
+ }
+
+ for (i = from; i <= to; i++) {
+ if (!dolist(pvars, assoc_cache[i].assid, CTL_OP_READVAR,
+ TYPE_PEER, fp))
+ break;
+ }
+
+ if (pvars == tmplist)
+ doclearvlist(tmplist);
+
+ return;
+}
+
+
+/*
+ * dogetassoc - query the host for its list of associations
+ */
+int
+dogetassoc(
+ FILE *fp
+ )
+{
+ const char *datap;
+ const u_short *pus;
+ int res;
+ int dsize;
+ u_short rstatus;
+
+ res = doquery(CTL_OP_READSTAT, 0, 0, 0, (char *)0, &rstatus,
+ &dsize, &datap);
+
+ if (res != 0)
+ return 0;
+
+ if (dsize == 0) {
+ if (numhosts > 1)
+ fprintf(fp, "server=%s ", currenthost);
+ fprintf(fp, "No association ID's returned\n");
+ return 0;
+ }
+
+ if (dsize & 0x3) {
+ if (numhosts > 1)
+ fprintf(stderr, "server=%s ", currenthost);
+ fprintf(stderr,
+ "***Server returned %d octets, should be multiple of 4\n",
+ dsize);
+ return 0;
+ }
+
+ numassoc = 0;
+
+ while (dsize > 0) {
+ if (numassoc >= assoc_cache_slots) {
+ grow_assoc_cache();
+ }
+ pus = (const void *)datap;
+ assoc_cache[numassoc].assid = ntohs(*pus);
+ datap += sizeof(*pus);
+ pus = (const void *)datap;
+ assoc_cache[numassoc].status = ntohs(*pus);
+ datap += sizeof(*pus);
+ dsize -= 2 * sizeof(*pus);
+ if (debug) {
+ fprintf(stderr, "[%u] ",
+ assoc_cache[numassoc].assid);
+ }
+ numassoc++;
+ }
+ if (debug) {
+ fprintf(stderr, "\n%d associations total\n", numassoc);
+ }
+ sortassoc();
+ return 1;
+}
+
+
+/*
+ * printassoc - print the current list of associations
+ */
+static void
+printassoc(
+ int showall,
+ FILE *fp
+ )
+{
+ register char *bp;
+ u_int i;
+ u_char statval;
+ int event;
+ u_long event_count;
+ const char *conf;
+ const char *reach;
+ const char *auth;
+ const char *condition = "";
+ const char *last_event;
+ char buf[128];
+
+ if (numassoc == 0) {
+ (void) fprintf(fp, "No association ID's in list\n");
+ return;
+ }
+
+ /*
+ * Output a header
+ */
+ (void) fprintf(fp,
+ "\nind assid status conf reach auth condition last_event cnt\n");
+ (void) fprintf(fp,
+ "===========================================================\n");
+ for (i = 0; i < numassoc; i++) {
+ statval = (u_char) CTL_PEER_STATVAL(assoc_cache[i].status);
+ if (!showall && !(statval & (CTL_PST_CONFIG|CTL_PST_REACH)))
+ continue;
+ event = CTL_PEER_EVENT(assoc_cache[i].status);
+ event_count = CTL_PEER_NEVNT(assoc_cache[i].status);
+ if (statval & CTL_PST_CONFIG)
+ conf = "yes";
+ else
+ conf = "no";
+ if (statval & CTL_PST_BCAST) {
+ reach = "none";
+ if (statval & CTL_PST_AUTHENABLE)
+ auth = "yes";
+ else
+ auth = "none";
+ } else {
+ if (statval & CTL_PST_REACH)
+ reach = "yes";
+ else
+ reach = "no";
+ if (statval & CTL_PST_AUTHENABLE) {
+ if (statval & CTL_PST_AUTHENTIC)
+ auth = "ok ";
+ else
+ auth = "bad";
+ } else {
+ auth = "none";
+ }
+ }
+ if (pktversion > NTP_OLDVERSION) {
+ switch (statval & 0x7) {
+
+ case CTL_PST_SEL_REJECT:
+ condition = "reject";
+ break;
+
+ case CTL_PST_SEL_SANE:
+ condition = "falsetick";
+ break;
+
+ case CTL_PST_SEL_CORRECT:
+ condition = "excess";
+ break;
+
+ case CTL_PST_SEL_SELCAND:
+ condition = "outlyer";
+ break;
+
+ case CTL_PST_SEL_SYNCCAND:
+ condition = "candidate";
+ break;
+
+ case CTL_PST_SEL_EXCESS:
+ condition = "backup";
+ break;
+
+ case CTL_PST_SEL_SYSPEER:
+ condition = "sys.peer";
+ break;
+
+ case CTL_PST_SEL_PPS:
+ condition = "pps.peer";
+ break;
+ }
+ } else {
+ switch (statval & 0x3) {
+
+ case OLD_CTL_PST_SEL_REJECT:
+ if (!(statval & OLD_CTL_PST_SANE))
+ condition = "insane";
+ else if (!(statval & OLD_CTL_PST_DISP))
+ condition = "hi_disp";
+ else
+ condition = "";
+ break;
+
+ case OLD_CTL_PST_SEL_SELCAND:
+ condition = "sel_cand";
+ break;
+
+ case OLD_CTL_PST_SEL_SYNCCAND:
+ condition = "sync_cand";
+ break;
+
+ case OLD_CTL_PST_SEL_SYSPEER:
+ condition = "sys_peer";
+ break;
+ }
+ }
+ switch (PEER_EVENT|event) {
+
+ case PEVNT_MOBIL:
+ last_event = "mobilize";
+ break;
+
+ case PEVNT_DEMOBIL:
+ last_event = "demobilize";
+ break;
+
+ case PEVNT_REACH:
+ last_event = "reachable";
+ break;
+
+ case PEVNT_UNREACH:
+ last_event = "unreachable";
+ break;
+
+ case PEVNT_RESTART:
+ last_event = "restart";
+ break;
+
+ case PEVNT_REPLY:
+ last_event = "no_reply";
+ break;
+
+ case PEVNT_RATE:
+ last_event = "rate_exceeded";
+ break;
+
+ case PEVNT_DENY:
+ last_event = "access_denied";
+ break;
+
+ case PEVNT_ARMED:
+ last_event = "leap_armed";
+ break;
+
+ case PEVNT_NEWPEER:
+ last_event = "sys_peer";
+ break;
+
+ case PEVNT_CLOCK:
+ last_event = "clock_alarm";
+ break;
+
+ default:
+ last_event = "";
+ break;
+ }
+ snprintf(buf, sizeof(buf),
+ "%3d %5u %04x %3.3s %4s %4.4s %9.9s %11s %2lu",
+ i + 1, assoc_cache[i].assid,
+ assoc_cache[i].status, conf, reach, auth,
+ condition, last_event, event_count);
+ bp = buf + strlen(buf);
+ while (bp > buf && ' ' == bp[-1])
+ --bp;
+ bp[0] = '\0';
+ fprintf(fp, "%s\n", buf);
+ }
+}
+
+
+/*
+ * associations - get, record and print a list of associations
+ */
+/*ARGSUSED*/
+static void
+associations(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (dogetassoc(fp))
+ printassoc(0, fp);
+}
+
+
+/*
+ * lassociations - get, record and print a long list of associations
+ */
+/*ARGSUSED*/
+static void
+lassociations(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (dogetassoc(fp))
+ printassoc(1, fp);
+}
+
+
+/*
+ * passociations - print the association list
+ */
+/*ARGSUSED*/
+static void
+passociations(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ printassoc(0, fp);
+}
+
+
+/*
+ * lpassociations - print the long association list
+ */
+/*ARGSUSED*/
+static void
+lpassociations(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ printassoc(1, fp);
+}
+
+
+/*
+ * saveconfig - dump ntp server configuration to server file
+ */
+static void
+saveconfig(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ const char *datap;
+ int res;
+ int dsize;
+ u_short rstatus;
+
+ if (0 == pcmd->nargs)
+ return;
+
+ res = doquery(CTL_OP_SAVECONFIG, 0, 1,
+ strlen(pcmd->argval[0].string),
+ pcmd->argval[0].string, &rstatus, &dsize,
+ &datap);
+
+ if (res != 0)
+ return;
+
+ if (0 == dsize)
+ fprintf(fp, "(no response message, curiously)");
+ else
+ fprintf(fp, "%.*s", dsize, datap);
+}
+
+
+#ifdef UNUSED
+/*
+ * radiostatus - print the radio status returned by the server
+ */
+/*ARGSUSED*/
+static void
+radiostatus(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ char *datap;
+ int res;
+ int dsize;
+ u_short rstatus;
+
+ res = doquery(CTL_OP_READCLOCK, 0, 0, 0, (char *)0, &rstatus,
+ &dsize, &datap);
+
+ if (res != 0)
+ return;
+
+ if (numhosts > 1)
+ (void) fprintf(fp, "server=%s ", currenthost);
+ if (dsize == 0) {
+ (void) fprintf(fp, "No radio status string returned\n");
+ return;
+ }
+
+ asciize(dsize, datap, fp);
+}
+#endif /* UNUSED */
+
+/*
+ * when - print how long its been since his last packet arrived
+ */
+static long
+when(
+ l_fp *ts,
+ l_fp *rec,
+ l_fp *reftime
+ )
+{
+ l_fp *lasttime;
+
+ if (rec->l_ui != 0)
+ lasttime = rec;
+ else if (reftime->l_ui != 0)
+ lasttime = reftime;
+ else
+ return 0;
+
+ return (ts->l_ui - lasttime->l_ui);
+}
+
+
+/*
+ * Pretty-print an interval into the given buffer, in a human-friendly format.
+ */
+static char *
+prettyinterval(
+ char *buf,
+ size_t cb,
+ long diff
+ )
+{
+ if (diff <= 0) {
+ buf[0] = '-';
+ buf[1] = 0;
+ return buf;
+ }
+
+ if (diff <= 2048) {
+ snprintf(buf, cb, "%ld", diff);
+ return buf;
+ }
+
+ diff = (diff + 29) / 60;
+ if (diff <= 300) {
+ snprintf(buf, cb, "%ldm", diff);
+ return buf;
+ }
+
+ diff = (diff + 29) / 60;
+ if (diff <= 96) {
+ snprintf(buf, cb, "%ldh", diff);
+ return buf;
+ }
+
+ diff = (diff + 11) / 24;
+ snprintf(buf, cb, "%ldd", diff);
+ return buf;
+}
+
+static char
+decodeaddrtype(
+ sockaddr_u *sock
+ )
+{
+ char ch = '-';
+ u_int32 dummy;
+
+ switch(AF(sock)) {
+ case AF_INET:
+ dummy = SRCADR(sock);
+ ch = (char)(((dummy&0xf0000000)==0xe0000000) ? 'm' :
+ ((dummy&0x000000ff)==0x000000ff) ? 'b' :
+ ((dummy&0xffffffff)==0x7f000001) ? 'l' :
+ ((dummy&0xffffffe0)==0x00000000) ? '-' :
+ 'u');
+ break;
+ case AF_INET6:
+ if (IN6_IS_ADDR_MULTICAST(PSOCK_ADDR6(sock)))
+ ch = 'm';
+ else
+ ch = 'u';
+ break;
+ default:
+ ch = '-';
+ break;
+ }
+ return ch;
+}
+
+/*
+ * A list of variables required by the peers command
+ */
+struct varlist opeervarlist[] = {
+ { "srcadr", 0 }, /* 0 */
+ { "dstadr", 0 }, /* 1 */
+ { "stratum", 0 }, /* 2 */
+ { "hpoll", 0 }, /* 3 */
+ { "ppoll", 0 }, /* 4 */
+ { "reach", 0 }, /* 5 */
+ { "delay", 0 }, /* 6 */
+ { "offset", 0 }, /* 7 */
+ { "jitter", 0 }, /* 8 */
+ { "dispersion", 0 }, /* 9 */
+ { "rec", 0 }, /* 10 */
+ { "reftime", 0 }, /* 11 */
+ { "srcport", 0 }, /* 12 */
+ { "hmode", 0 }, /* 13 */
+ { 0, 0 }
+};
+
+struct varlist peervarlist[] = {
+ { "srcadr", 0 }, /* 0 */
+ { "refid", 0 }, /* 1 */
+ { "stratum", 0 }, /* 2 */
+ { "hpoll", 0 }, /* 3 */
+ { "ppoll", 0 }, /* 4 */
+ { "reach", 0 }, /* 5 */
+ { "delay", 0 }, /* 6 */
+ { "offset", 0 }, /* 7 */
+ { "jitter", 0 }, /* 8 */
+ { "dispersion", 0 }, /* 9 */
+ { "rec", 0 }, /* 10 */
+ { "reftime", 0 }, /* 11 */
+ { "srcport", 0 }, /* 12 */
+ { "hmode", 0 }, /* 13 */
+ { "srchost", 0 }, /* 14 */
+ { 0, 0 }
+};
+
+
+/*
+ * Decode an incoming data buffer and print a line in the peer list
+ */
+static int
+doprintpeers(
+ struct varlist *pvl,
+ int associd,
+ int rstatus,
+ int datalen,
+ const char *data,
+ FILE *fp,
+ int af
+ )
+{
+ char *name;
+ char *value = NULL;
+ int c;
+ int len;
+ int have_srchost;
+ int have_dstadr;
+ int have_da_rid;
+ int have_jitter;
+ sockaddr_u srcadr;
+ sockaddr_u dstadr;
+ sockaddr_u dum_store;
+ sockaddr_u refidadr;
+ long hmode = 0;
+ u_long srcport = 0;
+ u_int32 u32;
+ const char *dstadr_refid = "0.0.0.0";
+ const char *serverlocal;
+ size_t drlen;
+ u_long stratum = 0;
+ long ppoll = 0;
+ long hpoll = 0;
+ u_long reach = 0;
+ l_fp estoffset;
+ l_fp estdelay;
+ l_fp estjitter;
+ l_fp estdisp;
+ l_fp reftime;
+ l_fp rec;
+ l_fp ts;
+ u_long poll_sec;
+ char type = '?';
+ char whenbuf[8], pollbuf[8];
+ char clock_name[LENHOSTNAME];
+
+ get_systime(&ts);
+
+ have_srchost = FALSE;
+ have_dstadr = FALSE;
+ have_da_rid = FALSE;
+ have_jitter = FALSE;
+ ZERO_SOCK(&srcadr);
+ ZERO_SOCK(&dstadr);
+ clock_name[0] = '\0';
+ ZERO(estoffset);
+ ZERO(estdelay);
+ ZERO(estjitter);
+ ZERO(estdisp);
+
+ while (nextvar(&datalen, &data, &name, &value)) {
+ if (!strcmp("srcadr", name) ||
+ !strcmp("peeradr", name)) {
+ if (!decodenetnum(value, &srcadr))
+ fprintf(stderr, "malformed %s=%s\n",
+ name, value);
+ } else if (!strcmp("srchost", name)) {
+ if (pvl == peervarlist) {
+ len = strlen(value);
+ if (2 < len &&
+ (size_t)len < sizeof(clock_name)) {
+ /* strip quotes */
+ value++;
+ len -= 2;
+ memcpy(clock_name, value, len);
+ clock_name[len] = '\0';
+ have_srchost = TRUE;
+ }
+ }
+ } else if (!strcmp("dstadr", name)) {
+ if (decodenetnum(value, &dum_store)) {
+ type = decodeaddrtype(&dum_store);
+ have_dstadr = TRUE;
+ dstadr = dum_store;
+ if (pvl == opeervarlist) {
+ have_da_rid = TRUE;
+ dstadr_refid = trunc_left(stoa(&dstadr), 15);
+ }
+ }
+ } else if (!strcmp("hmode", name)) {
+ decodeint(value, &hmode);
+ } else if (!strcmp("refid", name)) {
+ if (pvl == peervarlist) {
+ have_da_rid = TRUE;
+ drlen = strlen(value);
+ if (0 == drlen) {
+ dstadr_refid = "";
+ } else if (drlen <= 4) {
+ ZERO(u32);
+ memcpy(&u32, value, drlen);
+ dstadr_refid = refid_str(u32, 1);
+ } else if (decodenetnum(value, &refidadr)) {
+ if (SOCK_UNSPEC(&refidadr))
+ dstadr_refid = "0.0.0.0";
+ else if (ISREFCLOCKADR(&refidadr))
+ dstadr_refid =
+ refnumtoa(&refidadr);
+ else
+ dstadr_refid =
+ stoa(&refidadr);
+ } else {
+ have_da_rid = FALSE;
+ }
+ }
+ } else if (!strcmp("stratum", name)) {
+ decodeuint(value, &stratum);
+ } else if (!strcmp("hpoll", name)) {
+ if (decodeint(value, &hpoll) && hpoll < 0)
+ hpoll = NTP_MINPOLL;
+ } else if (!strcmp("ppoll", name)) {
+ if (decodeint(value, &ppoll) && ppoll < 0)
+ ppoll = NTP_MINPOLL;
+ } else if (!strcmp("reach", name)) {
+ decodeuint(value, &reach);
+ } else if (!strcmp("delay", name)) {
+ decodetime(value, &estdelay);
+ } else if (!strcmp("offset", name)) {
+ decodetime(value, &estoffset);
+ } else if (!strcmp("jitter", name)) {
+ if (pvl == peervarlist &&
+ decodetime(value, &estjitter))
+ have_jitter = 1;
+ } else if (!strcmp("rootdisp", name) ||
+ !strcmp("dispersion", name)) {
+ decodetime(value, &estdisp);
+ } else if (!strcmp("rec", name)) {
+ decodets(value, &rec);
+ } else if (!strcmp("srcport", name) ||
+ !strcmp("peerport", name)) {
+ decodeuint(value, &srcport);
+ } else if (!strcmp("reftime", name)) {
+ if (!decodets(value, &reftime))
+ L_CLR(&reftime);
+ }
+ }
+
+ /*
+ * hmode gives the best guidance for the t column. If the response
+ * did not include hmode we'll use the old decodeaddrtype() result.
+ */
+ switch (hmode) {
+
+ case MODE_BCLIENT:
+ /* broadcastclient or multicastclient */
+ type = 'b';
+ break;
+
+ case MODE_BROADCAST:
+ /* broadcast or multicast server */
+ if (IS_MCAST(&srcadr))
+ type = 'M';
+ else
+ type = 'B';
+ break;
+
+ case MODE_CLIENT:
+ if (ISREFCLOCKADR(&srcadr))
+ type = 'l'; /* local refclock*/
+ else if (SOCK_UNSPEC(&srcadr))
+ type = 'p'; /* pool */
+ else if (IS_MCAST(&srcadr))
+ type = 'a'; /* manycastclient */
+ else
+ type = 'u'; /* unicast */
+ break;
+
+ case MODE_ACTIVE:
+ type = 's'; /* symmetric active */
+ break; /* configured */
+
+ case MODE_PASSIVE:
+ type = 'S'; /* symmetric passive */
+ break; /* ephemeral */
+ }
+
+ /*
+ * Got everything, format the line
+ */
+ poll_sec = 1 << min(ppoll, hpoll);
+ if (pktversion > NTP_OLDVERSION)
+ c = flash3[CTL_PEER_STATVAL(rstatus) & 0x7];
+ else
+ c = flash2[CTL_PEER_STATVAL(rstatus) & 0x3];
+ if (numhosts > 1) {
+ if (peervarlist == pvl && have_dstadr) {
+ serverlocal = nntohost_col(&dstadr,
+ (size_t)min(LIB_BUFLENGTH - 1, maxhostlen),
+ TRUE);
+ } else {
+ if (currenthostisnum)
+ serverlocal = trunc_left(currenthost,
+ maxhostlen);
+ else
+ serverlocal = currenthost;
+ }
+ fprintf(fp, "%-*s ", (int)maxhostlen, serverlocal);
+ }
+ if (AF_UNSPEC == af || AF(&srcadr) == af) {
+ if (!have_srchost)
+ strlcpy(clock_name, nntohost(&srcadr),
+ sizeof(clock_name));
+ if (wideremote && 15 < strlen(clock_name))
+ fprintf(fp, "%c%s\n ", c, clock_name);
+ else
+ fprintf(fp, "%c%-15.15s ", c, clock_name);
+ if (!have_da_rid) {
+ drlen = 0;
+ } else {
+ drlen = strlen(dstadr_refid);
+ makeascii(drlen, dstadr_refid, fp);
+ }
+ while (drlen++ < 15)
+ fputc(' ', fp);
+ fprintf(fp,
+ " %2ld %c %4.4s %4.4s %3lo %7.7s %8.7s %7.7s\n",
+ stratum, type,
+ prettyinterval(whenbuf, sizeof(whenbuf),
+ when(&ts, &rec, &reftime)),
+ prettyinterval(pollbuf, sizeof(pollbuf),
+ (int)poll_sec),
+ reach, lfptoms(&estdelay, 3),
+ lfptoms(&estoffset, 3),
+ (have_jitter)
+ ? lfptoms(&estjitter, 3)
+ : lfptoms(&estdisp, 3));
+ return (1);
+ }
+ else
+ return(1);
+}
+
+
+/*
+ * dogetpeers - given an association ID, read and print the spreadsheet
+ * peer variables.
+ */
+static int
+dogetpeers(
+ struct varlist *pvl,
+ associd_t associd,
+ FILE *fp,
+ int af
+ )
+{
+ const char *datap;
+ int res;
+ int dsize;
+ u_short rstatus;
+
+#ifdef notdef
+ res = doquerylist(pvl, CTL_OP_READVAR, associd, 0, &rstatus,
+ &dsize, &datap);
+#else
+ /*
+ * Damn fuzzballs
+ */
+ res = doquery(CTL_OP_READVAR, associd, 0, 0, NULL, &rstatus,
+ &dsize, &datap);
+#endif
+
+ if (res != 0)
+ return 0;
+
+ if (dsize == 0) {
+ if (numhosts > 1)
+ fprintf(stderr, "server=%s ", currenthost);
+ fprintf(stderr,
+ "***No information returned for association %u\n",
+ associd);
+ return 0;
+ }
+
+ return doprintpeers(pvl, associd, (int)rstatus, dsize, datap,
+ fp, af);
+}
+
+
+/*
+ * peers - print a peer spreadsheet
+ */
+static void
+dopeers(
+ int showall,
+ FILE *fp,
+ int af
+ )
+{
+ u_int u;
+ char fullname[LENHOSTNAME];
+ sockaddr_u netnum;
+ const char * name_or_num;
+ size_t sl;
+
+ if (!dogetassoc(fp))
+ return;
+
+ for (u = 0; u < numhosts; u++) {
+ if (getnetnum(chosts[u].name, &netnum, fullname, af)) {
+ name_or_num = nntohost(&netnum);
+ sl = strlen(name_or_num);
+ maxhostlen = max(maxhostlen, sl);
+ }
+ }
+ if (numhosts > 1)
+ fprintf(fp, "%-*.*s ", (int)maxhostlen, (int)maxhostlen,
+ "server (local)");
+ fprintf(fp,
+ " remote refid st t when poll reach delay offset jitter\n");
+ if (numhosts > 1)
+ for (u = 0; u <= maxhostlen; u++)
+ fprintf(fp, "=");
+ fprintf(fp,
+ "==============================================================================\n");
+
+ for (u = 0; u < numassoc; u++) {
+ if (!showall &&
+ !(CTL_PEER_STATVAL(assoc_cache[u].status)
+ & (CTL_PST_CONFIG|CTL_PST_REACH))) {
+ if (debug)
+ fprintf(stderr, "eliding [%d]\n",
+ (int)assoc_cache[u].assid);
+ continue;
+ }
+ if (!dogetpeers(peervarlist, (int)assoc_cache[u].assid,
+ fp, af))
+ return;
+ }
+ return;
+}
+
+
+/*
+ * peers - print a peer spreadsheet
+ */
+/*ARGSUSED*/
+static void
+peers(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int af = 0;
+
+ if (pcmd->nargs == 1) {
+ if (pcmd->argval->ival == 6)
+ af = AF_INET6;
+ else
+ af = AF_INET;
+ }
+ dopeers(0, fp, af);
+}
+
+
+/*
+ * lpeers - print a peer spreadsheet including all fuzzball peers
+ */
+/*ARGSUSED*/
+static void
+lpeers(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int af = 0;
+
+ if (pcmd->nargs == 1) {
+ if (pcmd->argval->ival == 6)
+ af = AF_INET6;
+ else
+ af = AF_INET;
+ }
+ dopeers(1, fp, af);
+}
+
+
+/*
+ * opeers - print a peer spreadsheet
+ */
+static void
+doopeers(
+ int showall,
+ FILE *fp,
+ int af
+ )
+{
+ u_int i;
+ char fullname[LENHOSTNAME];
+ sockaddr_u netnum;
+
+ if (!dogetassoc(fp))
+ return;
+
+ for (i = 0; i < numhosts; ++i) {
+ if (getnetnum(chosts[i].name, &netnum, fullname, af))
+ if (strlen(fullname) > maxhostlen)
+ maxhostlen = strlen(fullname);
+ }
+ if (numhosts > 1)
+ fprintf(fp, "%-*.*s ", (int)maxhostlen, (int)maxhostlen,
+ "server");
+ fprintf(fp,
+ " remote local st t when poll reach delay offset disp\n");
+ if (numhosts > 1)
+ for (i = 0; i <= maxhostlen; ++i)
+ fprintf(fp, "=");
+ fprintf(fp,
+ "==============================================================================\n");
+
+ for (i = 0; i < numassoc; i++) {
+ if (!showall &&
+ !(CTL_PEER_STATVAL(assoc_cache[i].status) &
+ (CTL_PST_CONFIG | CTL_PST_REACH)))
+ continue;
+ if (!dogetpeers(opeervarlist, assoc_cache[i].assid, fp, af))
+ return;
+ }
+ return;
+}
+
+
+/*
+ * opeers - print a peer spreadsheet the old way
+ */
+/*ARGSUSED*/
+static void
+opeers(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int af = 0;
+
+ if (pcmd->nargs == 1) {
+ if (pcmd->argval->ival == 6)
+ af = AF_INET6;
+ else
+ af = AF_INET;
+ }
+ doopeers(0, fp, af);
+}
+
+
+/*
+ * lopeers - print a peer spreadsheet including all fuzzball peers
+ */
+/*ARGSUSED*/
+static void
+lopeers(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int af = 0;
+
+ if (pcmd->nargs == 1) {
+ if (pcmd->argval->ival == 6)
+ af = AF_INET6;
+ else
+ af = AF_INET;
+ }
+ doopeers(1, fp, af);
+}
+
+
+/*
+ * config - send a configuration command to a remote host
+ */
+static void
+config (
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ const char *cfgcmd;
+ u_short rstatus;
+ int rsize;
+ const char *rdata;
+ char *resp;
+ int res;
+ int col;
+ int i;
+
+ cfgcmd = pcmd->argval[0].string;
+
+ if (debug > 2)
+ fprintf(stderr,
+ "In Config\n"
+ "Keyword = %s\n"
+ "Command = %s\n", pcmd->keyword, cfgcmd);
+
+ res = doquery(CTL_OP_CONFIGURE, 0, 1, strlen(cfgcmd), cfgcmd,
+ &rstatus, &rsize, &rdata);
+
+ if (res != 0)
+ return;
+
+ if (rsize > 0 && '\n' == rdata[rsize - 1])
+ rsize--;
+
+ resp = emalloc(rsize + 1);
+ memcpy(resp, rdata, rsize);
+ resp[rsize] = '\0';
+
+ col = -1;
+ if (1 == sscanf(resp, "column %d syntax error", &col)
+ && col >= 0 && (size_t)col <= strlen(cfgcmd) + 1) {
+ if (interactive) {
+ printf("______"); /* "ntpq> " */
+ printf("________"); /* ":config " */
+ } else
+ printf("%s\n", cfgcmd);
+ for (i = 1; i < col; i++)
+ putchar('_');
+ printf("^\n");
+ }
+ printf("%s\n", resp);
+ free(resp);
+}
+
+
+/*
+ * config_from_file - remotely configure an ntpd daemon using the
+ * specified configuration file
+ * SK: This function is a kludge at best and is full of bad design
+ * bugs:
+ * 1. ntpq uses UDP, which means that there is no guarantee of in-order,
+ * error-free delivery.
+ * 2. The maximum length of a packet is constrained, and as a result, the
+ * maximum length of a line in a configuration file is constrained.
+ * Longer lines will lead to unpredictable results.
+ * 3. Since this function is sending a line at a time, we can't update
+ * the control key through the configuration file (YUCK!!)
+ */
+static void
+config_from_file (
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ u_short rstatus;
+ int rsize;
+ const char *rdata;
+ int res;
+ FILE *config_fd;
+ char config_cmd[MAXLINE];
+ size_t config_len;
+ int i;
+ int retry_limit;
+
+ if (debug > 2)
+ fprintf(stderr,
+ "In Config\n"
+ "Keyword = %s\n"
+ "Filename = %s\n", pcmd->keyword,
+ pcmd->argval[0].string);
+
+ config_fd = fopen(pcmd->argval[0].string, "r");
+ if (NULL == config_fd) {
+ printf("ERROR!! Couldn't open file: %s\n",
+ pcmd->argval[0].string);
+ return;
+ }
+
+ printf("Sending configuration file, one line at a time.\n");
+ i = 0;
+ while (fgets(config_cmd, MAXLINE, config_fd) != NULL) {
+ config_len = strlen(config_cmd);
+ /* ensure even the last line has newline, if possible */
+ if (config_len > 0 &&
+ config_len + 2 < sizeof(config_cmd) &&
+ '\n' != config_cmd[config_len - 1])
+ config_cmd[config_len++] = '\n';
+ ++i;
+ retry_limit = 2;
+ do
+ res = doquery(CTL_OP_CONFIGURE, 0, 1,
+ strlen(config_cmd), config_cmd,
+ &rstatus, &rsize, &rdata);
+ while (res != 0 && retry_limit--);
+ if (res != 0) {
+ printf("Line No: %d query failed: %s", i,
+ config_cmd);
+ printf("Subsequent lines not sent.\n");
+ fclose(config_fd);
+ return;
+ }
+
+ if (rsize > 0 && '\n' == rdata[rsize - 1])
+ rsize--;
+ if (rsize > 0 && '\r' == rdata[rsize - 1])
+ rsize--;
+ printf("Line No: %d %.*s: %s", i, rsize, rdata,
+ config_cmd);
+ }
+ printf("Done sending file\n");
+ fclose(config_fd);
+}
+
+
+static int
+fetch_nonce(
+ char * nonce,
+ size_t cb_nonce
+ )
+{
+ const char nonce_eq[] = "nonce=";
+ int qres;
+ u_short rstatus;
+ int rsize;
+ const char * rdata;
+ int chars;
+
+ /*
+ * Retrieve a nonce specific to this client to demonstrate to
+ * ntpd that we're capable of receiving responses to our source
+ * IP address, and thereby unlikely to be forging the source.
+ */
+ qres = doquery(CTL_OP_REQ_NONCE, 0, 0, 0, NULL, &rstatus,
+ &rsize, &rdata);
+ if (qres) {
+ fprintf(stderr, "nonce request failed\n");
+ return FALSE;
+ }
+
+ if (rsize <= sizeof(nonce_eq) - 1 ||
+ strncmp(rdata, nonce_eq, sizeof(nonce_eq) - 1)) {
+ fprintf(stderr, "unexpected nonce response format: %.*s\n",
+ rsize, rdata);
+ return FALSE;
+ }
+ chars = rsize - (sizeof(nonce_eq) - 1);
+ if (chars >= (int)cb_nonce)
+ return FALSE;
+ memcpy(nonce, rdata + sizeof(nonce_eq) - 1, chars);
+ nonce[chars] = '\0';
+ while (chars > 0 &&
+ ('\r' == nonce[chars - 1] || '\n' == nonce[chars - 1])) {
+ chars--;
+ nonce[chars] = '\0';
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * add_mru Add and entry to mru list, hash table, and allocate
+ * and return a replacement.
+ * This is a helper for collect_mru_list().
+ */
+static mru *
+add_mru(
+ mru *add
+ )
+{
+ u_short hash;
+ mru *mon;
+ mru *unlinked;
+
+
+ hash = NTP_HASH_ADDR(&add->addr);
+ /* see if we have it among previously received entries */
+ for (mon = hash_table[hash]; mon != NULL; mon = mon->hlink)
+ if (SOCK_EQ(&mon->addr, &add->addr))
+ break;
+ if (mon != NULL) {
+ if (!L_ISGEQ(&add->first, &mon->first)) {
+ fprintf(stderr,
+ "add_mru duplicate %s new first ts %08x.%08x precedes prior %08x.%08x\n",
+ sptoa(&add->addr), add->last.l_ui,
+ add->last.l_uf, mon->last.l_ui,
+ mon->last.l_uf);
+ exit(1);
+ }
+ UNLINK_DLIST(mon, mlink);
+ UNLINK_SLIST(unlinked, hash_table[hash], mon, hlink, mru);
+ NTP_INSIST(unlinked == mon);
+ mru_dupes++;
+ TRACE(2, ("(updated from %08x.%08x) ", mon->last.l_ui,
+ mon->last.l_uf));
+ }
+ LINK_DLIST(mru_list, add, mlink);
+ LINK_SLIST(hash_table[hash], add, hlink);
+ TRACE(2, ("add_mru %08x.%08x c %d m %d v %d rest %x first %08x.%08x %s\n",
+ add->last.l_ui, add->last.l_uf, add->count,
+ (int)add->mode, (int)add->ver, (u_int)add->rs,
+ add->first.l_ui, add->first.l_uf, sptoa(&add->addr)));
+ /* if we didn't update an existing entry, alloc replacement */
+ if (NULL == mon) {
+ mon = emalloc(sizeof(*mon));
+ mru_count++;
+ }
+ ZERO(*mon);
+
+ return mon;
+}
+
+
+/* MGOT macro is specific to collect_mru_list() */
+#define MGOT(bit) \
+ do { \
+ got |= (bit); \
+ if (MRU_GOT_ALL == got) { \
+ got = 0; \
+ mon = add_mru(mon); \
+ ci++; \
+ } \
+ } while (0)
+
+
+void
+mrulist_ctrl_c_hook(void)
+{
+ mrulist_interrupted = TRUE;
+}
+
+
+static int
+collect_mru_list(
+ const char * parms,
+ l_fp * pnow
+ )
+{
+ const u_int sleep_msecs = 5;
+ static int ntpd_row_limit = MRU_ROW_LIMIT;
+ int c_mru_l_rc; /* this function's return code */
+ u_char got; /* MRU_GOT_* bits */
+ time_t next_report;
+ size_t cb;
+ mru *mon;
+ mru *head;
+ mru *recent;
+ int list_complete;
+ char nonce[128];
+ char buf[128];
+ char req_buf[CTL_MAX_DATA_LEN];
+ char *req;
+ char *req_end;
+ int chars;
+ int qres;
+ u_short rstatus;
+ int rsize;
+ const char *rdata;
+ int limit;
+ int frags;
+ int cap_frags;
+ char *tag;
+ char *val;
+ int si; /* server index in response */
+ int ci; /* client (our) index for validation */
+ int ri; /* request index (.# suffix) */
+ int mv;
+ l_fp newest;
+ l_fp last_older;
+ sockaddr_u addr_older;
+ int have_now;
+ int have_addr_older;
+ int have_last_older;
+ u_int restarted_count;
+ u_int nonce_uses;
+ u_short hash;
+ mru *unlinked;
+
+ if (!fetch_nonce(nonce, sizeof(nonce)))
+ return FALSE;
+
+ nonce_uses = 0;
+ restarted_count = 0;
+ mru_count = 0;
+ INIT_DLIST(mru_list, mlink);
+ cb = NTP_HASH_SIZE * sizeof(*hash_table);
+ NTP_INSIST(NULL == hash_table);
+ hash_table = emalloc_zero(cb);
+
+ c_mru_l_rc = FALSE;
+ list_complete = FALSE;
+ have_now = FALSE;
+ cap_frags = TRUE;
+ got = 0;
+ ri = 0;
+ cb = sizeof(*mon);
+ mon = emalloc_zero(cb);
+ ZERO(*pnow);
+ ZERO(last_older);
+ mrulist_interrupted = FALSE;
+ set_ctrl_c_hook(&mrulist_ctrl_c_hook);
+ fprintf(stderr,
+ "Ctrl-C will stop MRU retrieval and display partial results.\n");
+ fflush(stderr);
+ next_report = time(NULL) + MRU_REPORT_SECS;
+
+ limit = min(3 * MAXFRAGS, ntpd_row_limit);
+ frags = MAXFRAGS;
+ snprintf(req_buf, sizeof(req_buf), "nonce=%s, frags=%d%s",
+ nonce, frags, parms);
+ nonce_uses++;
+
+ while (TRUE) {
+ if (debug)
+ fprintf(stderr, "READ_MRU parms: %s\n", req_buf);
+
+ qres = doqueryex(CTL_OP_READ_MRU, 0, 0, strlen(req_buf),
+ req_buf, &rstatus, &rsize, &rdata, TRUE);
+
+ if (CERR_UNKNOWNVAR == qres && ri > 0) {
+ /*
+ * None of the supplied prior entries match, so
+ * toss them from our list and try again.
+ */
+ if (debug)
+ fprintf(stderr,
+ "no overlap between %d prior entries and server MRU list\n",
+ ri);
+ while (ri--) {
+ recent = HEAD_DLIST(mru_list, mlink);
+ NTP_INSIST(recent != NULL);
+ if (debug)
+ fprintf(stderr,
+ "tossing prior entry %s to resync\n",
+ sptoa(&recent->addr));
+ UNLINK_DLIST(recent, mlink);
+ hash = NTP_HASH_ADDR(&recent->addr);
+ UNLINK_SLIST(unlinked, hash_table[hash],
+ recent, hlink, mru);
+ NTP_INSIST(unlinked == recent);
+ free(recent);
+ mru_count--;
+ }
+ if (NULL == HEAD_DLIST(mru_list, mlink)) {
+ restarted_count++;
+ if (restarted_count > 8) {
+ fprintf(stderr,
+ "Giving up after 8 restarts from the beginning.\n"
+ "With high-traffic NTP servers, this can occur if the\n"
+ "MRU list is limited to less than about 16 seconds' of\n"
+ "entries. See the 'mru' ntp.conf directive to adjust.\n");
+ goto cleanup_return;
+ }
+ if (debug)
+ fprintf(stderr,
+ "---> Restarting from the beginning, retry #%u\n",
+ restarted_count);
+ }
+ } else if (CERR_UNKNOWNVAR == qres) {
+ fprintf(stderr,
+ "CERR_UNKNOWNVAR from ntpd but no priors given.\n");
+ goto cleanup_return;
+ } else if (CERR_BADVALUE == qres) {
+ if (cap_frags) {
+ cap_frags = FALSE;
+ if (debug)
+ fprintf(stderr,
+ "Reverted to row limit from fragments limit.\n");
+ } else {
+ /* ntpd has lower cap on row limit */
+ ntpd_row_limit--;
+ limit = min(limit, ntpd_row_limit);
+ if (debug)
+ fprintf(stderr,
+ "Row limit reduced to %d following CERR_BADVALUE.\n",
+ limit);
+ }
+ } else if (ERR_INCOMPLETE == qres ||
+ ERR_TIMEOUT == qres) {
+ /*
+ * Reduce the number of rows/frags requested by
+ * half to recover from lost response fragments.
+ */
+ if (cap_frags) {
+ frags = max(2, frags / 2);
+ if (debug)
+ fprintf(stderr,
+ "Frag limit reduced to %d following incomplete response.\n",
+ frags);
+ } else {
+ limit = max(2, limit / 2);
+ if (debug)
+ fprintf(stderr,
+ "Row limit reduced to %d following incomplete response.\n",
+ limit);
+ }
+ } else if (qres) {
+ show_error_msg(qres, 0);
+ goto cleanup_return;
+ }
+ /*
+ * This is a cheap cop-out implementation of rawmode
+ * output for mrulist. A better approach would be to
+ * dump similar output after the list is collected by
+ * ntpq with a continuous sequence of indexes. This
+ * cheap approach has indexes resetting to zero for
+ * each query/response, and duplicates are not
+ * coalesced.
+ */
+ if (!qres && rawmode)
+ printvars(rsize, rdata, rstatus, TYPE_SYS, 1, stdout);
+ ci = 0;
+ have_addr_older = FALSE;
+ have_last_older = FALSE;
+ while (!qres && nextvar(&rsize, &rdata, &tag, &val)) {
+ if (debug > 1)
+ fprintf(stderr, "nextvar gave: %s = %s\n",
+ tag, val);
+ switch(tag[0]) {
+
+ case 'a':
+ if (!strcmp(tag, "addr.older")) {
+ if (!have_last_older) {
+ fprintf(stderr,
+ "addr.older %s before last.older\n",
+ val);
+ goto cleanup_return;
+ }
+ if (!decodenetnum(val, &addr_older)) {
+ fprintf(stderr,
+ "addr.older %s garbled\n",
+ val);
+ goto cleanup_return;
+ }
+ hash = NTP_HASH_ADDR(&addr_older);
+ for (recent = hash_table[hash];
+ recent != NULL;
+ recent = recent->hlink)
+ if (ADDR_PORT_EQ(
+ &addr_older,
+ &recent->addr))
+ break;
+ if (NULL == recent) {
+ fprintf(stderr,
+ "addr.older %s not in hash table\n",
+ val);
+ goto cleanup_return;
+ }
+ if (!L_ISEQU(&last_older,
+ &recent->last)) {
+ fprintf(stderr,
+ "last.older %08x.%08x mismatches %08x.%08x expected.\n",
+ last_older.l_ui,
+ last_older.l_uf,
+ recent->last.l_ui,
+ recent->last.l_uf);
+ goto cleanup_return;
+ }
+ have_addr_older = TRUE;
+ } else if (1 != sscanf(tag, "addr.%d", &si)
+ || si != ci)
+ goto nomatch;
+ else if (decodenetnum(val, &mon->addr))
+ MGOT(MRU_GOT_ADDR);
+ break;
+
+ case 'l':
+ if (!strcmp(tag, "last.older")) {
+ if ('0' != val[0] ||
+ 'x' != val[1] ||
+ !hextolfp(val + 2, &last_older)) {
+ fprintf(stderr,
+ "last.older %s garbled\n",
+ val);
+ goto cleanup_return;
+ }
+ have_last_older = TRUE;
+ } else if (!strcmp(tag, "last.newest")) {
+ if (0 != got) {
+ fprintf(stderr,
+ "last.newest %s before complete row, got = 0x%x\n",
+ val, (u_int)got);
+ goto cleanup_return;
+ }
+ if (!have_now) {
+ fprintf(stderr,
+ "last.newest %s before now=\n",
+ val);
+ goto cleanup_return;
+ }
+ head = HEAD_DLIST(mru_list, mlink);
+ if (NULL != head) {
+ if ('0' != val[0] ||
+ 'x' != val[1] ||
+ !hextolfp(val + 2, &newest) ||
+ !L_ISEQU(&newest,
+ &head->last)) {
+ fprintf(stderr,
+ "last.newest %s mismatches %08x.%08x",
+ val,
+ head->last.l_ui,
+ head->last.l_uf);
+ goto cleanup_return;
+ }
+ }
+ list_complete = TRUE;
+ } else if (1 != sscanf(tag, "last.%d", &si) ||
+ si != ci || '0' != val[0] ||
+ 'x' != val[1] ||
+ !hextolfp(val + 2, &mon->last)) {
+ goto nomatch;
+ } else {
+ MGOT(MRU_GOT_LAST);
+ /*
+ * allow interrupted retrieval,
+ * using most recent retrieved
+ * entry's last seen timestamp
+ * as the end of operation.
+ */
+ *pnow = mon->last;
+ }
+ break;
+
+ case 'f':
+ if (1 != sscanf(tag, "first.%d", &si) ||
+ si != ci || '0' != val[0] ||
+ 'x' != val[1] ||
+ !hextolfp(val + 2, &mon->first))
+ goto nomatch;
+ MGOT(MRU_GOT_FIRST);
+ break;
+
+ case 'n':
+ if (!strcmp(tag, "nonce")) {
+ strlcpy(nonce, val, sizeof(nonce));
+ nonce_uses = 0;
+ break; /* case */
+ } else if (strcmp(tag, "now") ||
+ '0' != val[0] ||
+ 'x' != val[1] ||
+ !hextolfp(val + 2, pnow))
+ goto nomatch;
+ have_now = TRUE;
+ break;
+
+ case 'c':
+ if (1 != sscanf(tag, "ct.%d", &si) ||
+ si != ci ||
+ 1 != sscanf(val, "%d", &mon->count)
+ || mon->count < 1)
+ goto nomatch;
+ MGOT(MRU_GOT_COUNT);
+ break;
+
+ case 'm':
+ if (1 != sscanf(tag, "mv.%d", &si) ||
+ si != ci ||
+ 1 != sscanf(val, "%d", &mv))
+ goto nomatch;
+ mon->mode = PKT_MODE(mv);
+ mon->ver = PKT_VERSION(mv);
+ MGOT(MRU_GOT_MV);
+ break;
+
+ case 'r':
+ if (1 != sscanf(tag, "rs.%d", &si) ||
+ si != ci ||
+ 1 != sscanf(val, "0x%hx", &mon->rs))
+ goto nomatch;
+ MGOT(MRU_GOT_RS);
+ break;
+
+ default:
+ nomatch:
+ /* empty stmt */ ;
+ /* ignore unknown tags */
+ }
+ }
+ if (have_now)
+ list_complete = TRUE;
+ if (list_complete) {
+ NTP_INSIST(0 == ri || have_addr_older);
+ }
+ if (mrulist_interrupted) {
+ printf("mrulist retrieval interrupted by operator.\n"
+ "Displaying partial client list.\n");
+ fflush(stdout);
+ }
+ if (list_complete || mrulist_interrupted) {
+ fprintf(stderr,
+ "\rRetrieved %u unique MRU entries and %u updates.\n",
+ mru_count, mru_dupes);
+ fflush(stderr);
+ break;
+ }
+ if (time(NULL) >= next_report) {
+ next_report += MRU_REPORT_SECS;
+ fprintf(stderr, "\r%u (%u updates) ", mru_count,
+ mru_dupes);
+ fflush(stderr);
+ }
+
+ /*
+ * Snooze for a bit between queries to let ntpd catch
+ * up with other duties.
+ */
+#ifdef SYS_WINNT
+ Sleep(sleep_msecs);
+#elif !defined(HAVE_NANOSLEEP)
+ sleep((sleep_msecs / 1000) + 1);
+#else
+ {
+ struct timespec interv = { 0,
+ 1000 * sleep_msecs };
+ nanosleep(&interv, NULL);
+ }
+#endif
+ /*
+ * If there were no errors, increase the number of rows
+ * to a maximum of 3 * MAXFRAGS (the most packets ntpq
+ * can handle in one response), on the assumption that
+ * no less than 3 rows fit in each packet, capped at
+ * our best guess at the server's row limit.
+ */
+ if (!qres) {
+ if (cap_frags) {
+ frags = min(MAXFRAGS, frags + 1);
+ } else {
+ limit = min3(3 * MAXFRAGS,
+ ntpd_row_limit,
+ max(limit + 1,
+ limit * 33 / 32));
+ }
+ }
+ /*
+ * prepare next query with as many address and last-seen
+ * timestamps as will fit in a single packet.
+ */
+ req = req_buf;
+ req_end = req_buf + sizeof(req_buf);
+#define REQ_ROOM (req_end - req)
+ snprintf(req, REQ_ROOM, "nonce=%s, %s=%d%s", nonce,
+ (cap_frags)
+ ? "frags"
+ : "limit",
+ (cap_frags)
+ ? frags
+ : limit,
+ parms);
+ req += strlen(req);
+ nonce_uses++;
+ if (nonce_uses >= 4) {
+ if (!fetch_nonce(nonce, sizeof(nonce)))
+ goto cleanup_return;
+ nonce_uses = 0;
+ }
+
+
+ for (ri = 0, recent = HEAD_DLIST(mru_list, mlink);
+ recent != NULL;
+ ri++, recent = NEXT_DLIST(mru_list, recent, mlink)) {
+
+ snprintf(buf, sizeof(buf),
+ ", addr.%d=%s, last.%d=0x%08x.%08x",
+ ri, sptoa(&recent->addr), ri,
+ recent->last.l_ui, recent->last.l_uf);
+ chars = strlen(buf);
+ if (REQ_ROOM - chars < 1)
+ break;
+ memcpy(req, buf, chars + 1);
+ req += chars;
+ }
+ }
+
+ set_ctrl_c_hook(NULL);
+ c_mru_l_rc = TRUE;
+ goto retain_hash_table;
+
+cleanup_return:
+ free(hash_table);
+ hash_table = NULL;
+
+retain_hash_table:
+ if (mon != NULL)
+ free(mon);
+
+ return c_mru_l_rc;
+}
+
+
+/*
+ * qcmp_mru_addr - sort MRU entries by remote address.
+ *
+ * All IPv4 addresses sort before any IPv6, addresses are sorted by
+ * value within address family.
+ */
+static int
+qcmp_mru_addr(
+ const void *v1,
+ const void *v2
+ )
+{
+ const mru * const * ppm1 = v1;
+ const mru * const * ppm2 = v2;
+ const mru * pm1;
+ const mru * pm2;
+ u_short af1;
+ u_short af2;
+ size_t cmplen;
+ size_t addr_off;
+
+ pm1 = *ppm1;
+ pm2 = *ppm2;
+
+ af1 = AF(&pm1->addr);
+ af2 = AF(&pm2->addr);
+
+ if (af1 != af2)
+ return (AF_INET == af1)
+ ? -1
+ : 1;
+
+ cmplen = SIZEOF_INADDR(af1);
+ addr_off = (AF_INET == af1)
+ ? offsetof(struct sockaddr_in, sin_addr)
+ : offsetof(struct sockaddr_in6, sin6_addr);
+
+ return memcmp((const char *)&pm1->addr + addr_off,
+ (const char *)&pm2->addr + addr_off,
+ cmplen);
+}
+
+
+static int
+qcmp_mru_r_addr(
+ const void *v1,
+ const void *v2
+ )
+{
+ return -qcmp_mru_addr(v1, v2);
+}
+
+
+/*
+ * qcmp_mru_count - sort MRU entries by times seen (hit count).
+ */
+static int
+qcmp_mru_count(
+ const void *v1,
+ const void *v2
+ )
+{
+ const mru * const * ppm1 = v1;
+ const mru * const * ppm2 = v2;
+ const mru * pm1;
+ const mru * pm2;
+
+ pm1 = *ppm1;
+ pm2 = *ppm2;
+
+ return (pm1->count < pm2->count)
+ ? -1
+ : ((pm1->count == pm2->count)
+ ? 0
+ : 1);
+}
+
+
+static int
+qcmp_mru_r_count(
+ const void *v1,
+ const void *v2
+ )
+{
+ return -qcmp_mru_count(v1, v2);
+}
+
+
+/*
+ * qcmp_mru_avgint - sort MRU entries by average interval.
+ */
+static int
+qcmp_mru_avgint(
+ const void *v1,
+ const void *v2
+ )
+{
+ const mru * const * ppm1 = v1;
+ const mru * const * ppm2 = v2;
+ const mru * pm1;
+ const mru * pm2;
+ l_fp interval;
+ double avg1;
+ double avg2;
+
+ pm1 = *ppm1;
+ pm2 = *ppm2;
+
+ interval = pm1->last;
+ L_SUB(&interval, &pm1->first);
+ LFPTOD(&interval, avg1);
+ avg1 /= pm1->count;
+
+ interval = pm2->last;
+ L_SUB(&interval, &pm2->first);
+ LFPTOD(&interval, avg2);
+ avg2 /= pm2->count;
+
+ if (avg1 < avg2)
+ return -1;
+ else if (avg1 > avg2)
+ return 1;
+
+ /* secondary sort on lstint - rarely tested */
+ if (L_ISEQU(&pm1->last, &pm2->last))
+ return 0;
+ else if (L_ISGEQ(&pm1->last, &pm2->last))
+ return -1;
+ else
+ return 1;
+}
+
+
+static int
+qcmp_mru_r_avgint(
+ const void *v1,
+ const void *v2
+ )
+{
+ return -qcmp_mru_avgint(v1, v2);
+}
+
+
+/*
+ * mrulist - ntpq's mrulist command to fetch an arbitrarily large Most
+ * Recently Used (seen) remote address list from ntpd.
+ *
+ * Similar to ntpdc's monlist command, but not limited to a single
+ * request/response, and thereby not limited to a few hundred remote
+ * addresses.
+ *
+ * See ntpd/ntp_control.c read_mru_list() for comments on the way
+ * CTL_OP_READ_MRU is designed to be used.
+ *
+ * mrulist intentionally differs from monlist in the way the avgint
+ * column is calculated. monlist includes the time after the last
+ * packet from the client until the monlist query time in the average,
+ * while mrulist excludes it. That is, monlist's average interval grows
+ * over time for remote addresses not heard from in some time, while it
+ * remains unchanged in mrulist. This also affects the avgint value for
+ * entries representing a single packet, with identical first and last
+ * timestamps. mrulist shows 0 avgint, monlist shows a value identical
+ * to lstint.
+ */
+static void
+mrulist(
+ struct parse * pcmd,
+ FILE * fp
+ )
+{
+ const char mincount_eq[] = "mincount=";
+ const char resall_eq[] = "resall=";
+ const char resany_eq[] = "resany=";
+ const char maxlstint_eq[] = "maxlstint=";
+ const char laddr_eq[] = "laddr=";
+ const char sort_eq[] = "sort=";
+ mru_sort_order order;
+ size_t n;
+ char parms_buf[128];
+ char buf[24];
+ char *parms;
+ const char *arg;
+ size_t cb;
+ mru **sorted;
+ mru **ppentry;
+ mru *recent;
+ l_fp now;
+ l_fp interval;
+ double favgint;
+ double flstint;
+ int avgint;
+ int lstint;
+ int i;
+
+ order = MRUSORT_DEF;
+ parms_buf[0] = '\0';
+ parms = parms_buf;
+ for (i = 0; i < pcmd->nargs; i++) {
+ arg = pcmd->argval[i].string;
+ if (arg != NULL) {
+ cb = strlen(arg) + 1;
+ if ((!strncmp(resall_eq, arg, sizeof(resall_eq)
+ - 1) || !strncmp(resany_eq, arg,
+ sizeof(resany_eq) - 1) || !strncmp(
+ mincount_eq, arg, sizeof(mincount_eq) - 1)
+ || !strncmp(laddr_eq, arg, sizeof(laddr_eq)
+ - 1) || !strncmp(maxlstint_eq, arg,
+ sizeof(laddr_eq) - 1)) && parms + cb + 2 <=
+ parms_buf + sizeof(parms_buf)) {
+ /* these are passed intact to ntpd */
+ memcpy(parms, ", ", 2);
+ parms += 2;
+ memcpy(parms, arg, cb);
+ parms += cb - 1;
+ } else if (!strncmp(sort_eq, arg,
+ sizeof(sort_eq) - 1)) {
+ arg += sizeof(sort_eq) - 1;
+ for (n = 0;
+ n < COUNTOF(mru_sort_keywords);
+ n++)
+ if (!strcmp(mru_sort_keywords[n],
+ arg))
+ break;
+ if (n < COUNTOF(mru_sort_keywords))
+ order = n;
+ } else if (!strcmp("limited", arg) ||
+ !strcmp("kod", arg)) {
+ /* transform to resany=... */
+ snprintf(buf, sizeof(buf),
+ ", resany=0x%x",
+ ('k' == arg[0])
+ ? RES_KOD
+ : RES_LIMITED);
+ cb = 1 + strlen(buf);
+ if (parms + cb <
+ parms_buf + sizeof(parms_buf)) {
+ memcpy(parms, buf, cb);
+ parms += cb - 1;
+ }
+ } else
+ fprintf(stderr,
+ "ignoring unrecognized mrulist parameter: %s\n",
+ arg);
+ }
+ }
+ parms = parms_buf;
+
+ if (!collect_mru_list(parms, &now))
+ return;
+
+ /* display the results */
+ if (rawmode)
+ goto cleanup_return;
+
+ /* construct an array of entry pointers in default order */
+ sorted = emalloc(mru_count * sizeof(*sorted));
+ ppentry = sorted;
+ if (MRUSORT_R_DEF != order) {
+ ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
+ NTP_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);
+ *ppentry = recent;
+ ppentry++;
+ REV_ITER_DLIST_END()
+ }
+
+ if (ppentry - sorted != (int)mru_count) {
+ fprintf(stderr,
+ "mru_count %u should match MRU list depth %ld.\n",
+ mru_count, (long)(ppentry - sorted));
+ free(sorted);
+ goto cleanup_return;
+ }
+
+ /* re-sort sorted[] if not default or reverse default */
+ if (MRUSORT_R_DEF < order)
+ qsort(sorted, mru_count, sizeof(sorted[0]),
+ mru_qcmp_table[order]);
+
+ printf( "lstint avgint rstr r m v count rport remote address\n"
+ "==============================================================================\n");
+ /* '=' x 78 */
+ for (ppentry = sorted; ppentry < sorted + mru_count; ppentry++) {
+ recent = *ppentry;
+ interval = now;
+ L_SUB(&interval, &recent->last);
+ LFPTOD(&interval, flstint);
+ lstint = (int)(flstint + 0.5);
+ interval = recent->last;
+ L_SUB(&interval, &recent->first);
+ LFPTOD(&interval, favgint);
+ favgint /= recent->count;
+ avgint = (int)(favgint + 0.5);
+ fprintf(fp, "%6d %6d %4hx %c %d %d %6d %5hu %s\n",
+ lstint, avgint, recent->rs,
+ (RES_KOD & recent->rs)
+ ? 'K'
+ : (RES_LIMITED & recent->rs)
+ ? 'L'
+ : '.',
+ (int)recent->mode, (int)recent->ver,
+ recent->count, SRCPORT(&recent->addr),
+ nntohost(&recent->addr));
+ if (showhostnames)
+ fflush(fp);
+ }
+ fflush(fp);
+ if (debug) {
+ fprintf(stderr,
+ "--- completed, freeing sorted[] pointers\n");
+ fflush(stderr);
+ }
+ free(sorted);
+
+cleanup_return:
+ if (debug) {
+ fprintf(stderr, "... freeing MRU entries\n");
+ fflush(stderr);
+ }
+ ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
+ free(recent);
+ ITER_DLIST_END()
+ if (debug) {
+ fprintf(stderr, "... freeing hash_table[]\n");
+ fflush(stderr);
+ }
+ free(hash_table);
+ hash_table = NULL;
+ INIT_DLIST(mru_list, mlink);
+}
+
+
+/*
+ * validate_ifnum - helper for ifstats()
+ *
+ * Ensures rows are received in order and complete.
+ */
+static void
+validate_ifnum(
+ FILE * fp,
+ u_int ifnum,
+ int * pfields,
+ ifstats_row * prow
+ )
+{
+ if (prow->ifnum == ifnum)
+ return;
+ if (prow->ifnum + 1 == ifnum) {
+ if (*pfields < IFSTATS_FIELDS)
+ fprintf(fp, "Warning: incomplete row with %d (of %d) fields",
+ *pfields, IFSTATS_FIELDS);
+ *pfields = 0;
+ prow->ifnum = ifnum;
+ return;
+ }
+ fprintf(stderr,
+ "received if index %u, have %d of %d fields for index %u, aborting.\n",
+ ifnum, *pfields, IFSTATS_FIELDS, prow->ifnum);
+ exit(1);
+}
+
+
+/*
+ * another_ifstats_field - helper for ifstats()
+ *
+ * If all fields for the row have been received, print it.
+ */
+static void
+another_ifstats_field(
+ int * pfields,
+ ifstats_row * prow,
+ FILE * fp
+ )
+{
+ u_int ifnum;
+
+ (*pfields)++;
+ /* we understand 12 tags */
+ if (IFSTATS_FIELDS > *pfields)
+ return;
+ /*
+ " interface name send\n"
+ " # address/broadcast drop flag ttl mc received sent failed peers uptime\n"
+ "==============================================================================\n");
+ */
+ fprintf(fp,
+ "%3u %-24.24s %c %4x %3d %2d %6d %6d %6d %5d %8d\n"
+ " %s\n",
+ prow->ifnum, prow->name,
+ (prow->enabled)
+ ? '.'
+ : 'D',
+ prow->flags, prow->ttl, prow->mcast_count,
+ prow->received, prow->sent, prow->send_errors,
+ prow->peer_count, prow->uptime, sptoa(&prow->addr));
+ if (!SOCK_UNSPEC(&prow->bcast))
+ fprintf(fp, " %s\n", sptoa(&prow->bcast));
+ ifnum = prow->ifnum;
+ ZERO(*prow);
+ prow->ifnum = ifnum;
+}
+
+
+/*
+ * ifstats - ntpq -c ifstats modeled on ntpdc -c ifstats.
+ */
+static void
+ifstats(
+ struct parse * pcmd,
+ FILE * fp
+ )
+{
+ const char addr_fmt[] = "addr.%u";
+ const char bcast_fmt[] = "bcast.%u";
+ const char en_fmt[] = "en.%u"; /* enabled */
+ const char flags_fmt[] = "flags.%u";
+ const char mc_fmt[] = "mc.%u"; /* mcast count */
+ const char name_fmt[] = "name.%u";
+ const char pc_fmt[] = "pc.%u"; /* peer count */
+ const char rx_fmt[] = "rx.%u";
+ const char tl_fmt[] = "tl.%u"; /* ttl */
+ const char tx_fmt[] = "tx.%u";
+ const char txerr_fmt[] = "txerr.%u";
+ const char up_fmt[] = "up.%u"; /* uptime */
+ const char * datap;
+ int qres;
+ int dsize;
+ u_short rstatus;
+ char * tag;
+ char * val;
+ int fields;
+ u_int ifnum;
+ u_int ui;
+ ifstats_row row;
+ int comprende;
+ size_t len;
+
+ qres = doquery(CTL_OP_READ_ORDLIST_A, 0, TRUE, 0, NULL, &rstatus,
+ &dsize, &datap);
+ if (qres) /* message already displayed */
+ return;
+
+ fprintf(fp,
+ " interface name send\n"
+ " # address/broadcast drop flag ttl mc received sent failed peers uptime\n"
+ "==============================================================================\n");
+ /* '=' x 78 */
+
+ ZERO(row);
+ fields = 0;
+ ifnum = 0;
+ ui = 0;
+ while (nextvar(&dsize, &datap, &tag, &val)) {
+ if (debug > 1)
+ fprintf(stderr, "nextvar gave: %s = %s\n", tag,
+ (NULL == val)
+ ? ""
+ : val);
+ comprende = FALSE;
+ switch(tag[0]) {
+
+ case 'a':
+ if (1 == sscanf(tag, addr_fmt, &ui) &&
+ decodenetnum(val, &row.addr))
+ comprende = TRUE;
+ break;
+
+ case 'b':
+ if (1 == sscanf(tag, bcast_fmt, &ui) &&
+ (NULL == val ||
+ decodenetnum(val, &row.bcast)))
+ comprende = TRUE;
+ break;
+
+ case 'e':
+ if (1 == sscanf(tag, en_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.enabled))
+ comprende = TRUE;
+ break;
+
+ case 'f':
+ if (1 == sscanf(tag, flags_fmt, &ui) &&
+ 1 == sscanf(val, "0x%x", &row.flags))
+ comprende = TRUE;
+ break;
+
+ case 'm':
+ if (1 == sscanf(tag, mc_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.mcast_count))
+ comprende = TRUE;
+ break;
+
+ case 'n':
+ if (1 == sscanf(tag, name_fmt, &ui)) {
+ /* strip quotes */
+ len = strlen(val);
+ if (len >= 2 &&
+ len - 2 < sizeof(row.name)) {
+ len -= 2;
+ memcpy(row.name, val + 1, len);
+ row.name[len] = '\0';
+ comprende = TRUE;
+ }
+ }
+ break;
+
+ case 'p':
+ if (1 == sscanf(tag, pc_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.peer_count))
+ comprende = TRUE;
+ break;
+
+ case 'r':
+ if (1 == sscanf(tag, rx_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.received))
+ comprende = TRUE;
+ break;
+
+ case 't':
+ if (1 == sscanf(tag, tl_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.ttl))
+ comprende = TRUE;
+ else if (1 == sscanf(tag, tx_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.sent))
+ comprende = TRUE;
+ else if (1 == sscanf(tag, txerr_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.send_errors))
+ comprende = TRUE;
+ break;
+
+ case 'u':
+ if (1 == sscanf(tag, up_fmt, &ui) &&
+ 1 == sscanf(val, "%d", &row.uptime))
+ comprende = TRUE;
+ break;
+ }
+
+ if (comprende) {
+ /* error out if rows out of order */
+ validate_ifnum(fp, ui, &fields, &row);
+ /* if the row is complete, print it */
+ another_ifstats_field(&fields, &row, fp);
+ }
+ }
+ if (fields != IFSTATS_FIELDS)
+ fprintf(fp, "Warning: incomplete row with %d (of %d) fields",
+ fields, IFSTATS_FIELDS);
+
+ fflush(fp);
+}
+
+
+/*
+ * validate_reslist_idx - helper for reslist()
+ *
+ * Ensures rows are received in order and complete.
+ */
+static void
+validate_reslist_idx(
+ FILE * fp,
+ u_int idx,
+ int * pfields,
+ reslist_row * prow
+ )
+{
+ if (prow->idx == idx)
+ return;
+ if (prow->idx + 1 == idx) {
+ if (*pfields < RESLIST_FIELDS)
+ fprintf(fp, "Warning: incomplete row with %d (of %d) fields",
+ *pfields, RESLIST_FIELDS);
+ *pfields = 0;
+ prow->idx = idx;
+ return;
+ }
+ fprintf(stderr,
+ "received reslist index %u, have %d of %d fields for index %u, aborting.\n",
+ idx, *pfields, RESLIST_FIELDS, prow->idx);
+ exit(1);
+}
+
+
+/*
+ * another_reslist_field - helper for reslist()
+ *
+ * If all fields for the row have been received, print it.
+ */
+static void
+another_reslist_field(
+ int * pfields,
+ reslist_row * prow,
+ FILE * fp
+ )
+{
+ char addrmaskstr[128];
+ int prefix; /* subnet mask as prefix bits count */
+ u_int idx;
+
+ (*pfields)++;
+ /* we understand 4 tags */
+ if (RESLIST_FIELDS > *pfields)
+ return;
+
+ prefix = sockaddr_masktoprefixlen(&prow->mask);
+ if (prefix >= 0)
+ snprintf(addrmaskstr, sizeof(addrmaskstr), "%s/%d",
+ stoa(&prow->addr), prefix);
+ else
+ snprintf(addrmaskstr, sizeof(addrmaskstr), "%s %s",
+ stoa(&prow->addr), stoa(&prow->mask));
+
+ /*
+ " hits addr/prefix or addr mask\n"
+ " restrictions\n"
+ "==============================================================================\n");
+ */
+ fprintf(fp,
+ "%10lu %s\n"
+ " %s\n",
+ prow->hits, addrmaskstr, prow->flagstr);
+ idx = prow->idx;
+ ZERO(*prow);
+ prow->idx = idx;
+}
+
+
+/*
+ * reslist - ntpq -c reslist modeled on ntpdc -c reslist.
+ */
+static void
+reslist(
+ struct parse * pcmd,
+ FILE * fp
+ )
+{
+ const char addr_fmtu[] = "addr.%u";
+ const char mask_fmtu[] = "mask.%u";
+ const char hits_fmt[] = "hits.%u";
+ const char flags_fmt[] = "flags.%u";
+ const char qdata[] = "addr_restrictions";
+ const int qdata_chars = COUNTOF(qdata) - 1;
+ const char * datap;
+ int qres;
+ int dsize;
+ u_short rstatus;
+ char * tag;
+ char * val;
+ int fields;
+ u_int idx;
+ u_int ui;
+ reslist_row row;
+ int comprende;
+ size_t len;
+
+ qres = doquery(CTL_OP_READ_ORDLIST_A, 0, TRUE, qdata_chars,
+ qdata, &rstatus, &dsize, &datap);
+ if (qres) /* message already displayed */
+ return;
+
+ fprintf(fp,
+ " hits addr/prefix or addr mask\n"
+ " restrictions\n"
+ "==============================================================================\n");
+ /* '=' x 78 */
+
+ ZERO(row);
+ fields = 0;
+ idx = 0;
+ ui = 0;
+ while (nextvar(&dsize, &datap, &tag, &val)) {
+ if (debug > 1)
+ fprintf(stderr, "nextvar gave: %s = %s\n", tag,
+ (NULL == val)
+ ? ""
+ : val);
+ comprende = FALSE;
+ switch(tag[0]) {
+
+ case 'a':
+ if (1 == sscanf(tag, addr_fmtu, &ui) &&
+ decodenetnum(val, &row.addr))
+ comprende = TRUE;
+ break;
+
+ case 'f':
+ if (1 == sscanf(tag, flags_fmt, &ui)) {
+ if (NULL == val) {
+ row.flagstr[0] = '\0';
+ comprende = TRUE;
+ } else {
+ len = strlen(val);
+ memcpy(row.flagstr, val, len);
+ row.flagstr[len] = '\0';
+ comprende = TRUE;
+ }
+ }
+ break;
+
+ case 'h':
+ if (1 == sscanf(tag, hits_fmt, &ui) &&
+ 1 == sscanf(val, "%lu", &row.hits))
+ comprende = TRUE;
+ break;
+
+ case 'm':
+ if (1 == sscanf(tag, mask_fmtu, &ui) &&
+ decodenetnum(val, &row.mask))
+ comprende = TRUE;
+ break;
+ }
+
+ if (comprende) {
+ /* error out if rows out of order */
+ validate_reslist_idx(fp, ui, &fields, &row);
+ /* if the row is complete, print it */
+ another_reslist_field(&fields, &row, fp);
+ }
+ }
+ if (fields != RESLIST_FIELDS)
+ fprintf(fp, "Warning: incomplete row with %d (of %d) fields",
+ fields, RESLIST_FIELDS);
+
+ fflush(fp);
+}
+
+
+/*
+ * collect_display_vdc
+ */
+static void
+collect_display_vdc(
+ associd_t as,
+ vdc * table,
+ int decodestatus,
+ FILE * fp
+ )
+{
+ static const char * const suf[2] = { "adr", "port" };
+ static const char * const leapbits[4] = { "00", "01",
+ "10", "11" };
+ struct varlist vl[MAXLIST];
+ char tagbuf[32];
+ vdc *pvdc;
+ u_short rstatus;
+ int rsize;
+ const char *rdata;
+ int qres;
+ char *tag;
+ char *val;
+ u_int n;
+ size_t len;
+ int match;
+ u_long ul;
+ int vtype;
+
+ ZERO(vl);
+ for (pvdc = table; pvdc->tag != NULL; pvdc++) {
+ ZERO(pvdc->v);
+ if (NTP_ADD != pvdc->type) {
+ doaddvlist(vl, pvdc->tag);
+ } else {
+ for (n = 0; n < COUNTOF(suf); n++) {
+ snprintf(tagbuf, sizeof(tagbuf), "%s%s",
+ pvdc->tag, suf[n]);
+ doaddvlist(vl, tagbuf);
+ }
+ }
+ }
+ qres = doquerylist(vl, CTL_OP_READVAR, as, 0, &rstatus, &rsize,
+ &rdata);
+ doclearvlist(vl);
+ if (qres)
+ return; /* error msg already displayed */
+
+ /*
+ * iterate over the response variables filling vdc_table with
+ * the retrieved values.
+ */
+ while (nextvar(&rsize, &rdata, &tag, &val)) {
+ if (NULL == val)
+ continue;
+ n = 0;
+ for (pvdc = table; pvdc->tag != NULL; pvdc++) {
+ len = strlen(pvdc->tag);
+ if (strncmp(tag, pvdc->tag, len))
+ continue;
+ if (NTP_ADD != pvdc->type) {
+ if ('\0' != tag[len])
+ continue;
+ break;
+ }
+ match = FALSE;
+ for (n = 0; n < COUNTOF(suf); n++) {
+ if (strcmp(tag + len, suf[n]))
+ continue;
+ match = TRUE;
+ break;
+ }
+ if (match)
+ break;
+ }
+ if (NULL == pvdc->tag)
+ continue;
+ switch (pvdc->type) {
+
+ case NTP_STR:
+ /* strip surrounding double quotes */
+ if ('"' == val[0]) {
+ len = strlen(val);
+ if (len > 0 && '"' == val[len - 1]) {
+ val[len - 1] = '\0';
+ val++;
+ }
+ }
+ /* fallthru */
+ case NTP_MODE: /* fallthru */
+ case NTP_2BIT:
+ pvdc->v.str = estrdup(val);
+ break;
+
+ case NTP_LFP:
+ decodets(val, &pvdc->v.lfp);
+ break;
+
+ case NTP_ADP:
+ if (!decodenetnum(val, &pvdc->v.sau))
+ fprintf(stderr, "malformed %s=%s\n",
+ pvdc->tag, val);
+ break;
+
+ case NTP_ADD:
+ if (0 == n) { /* adr */
+ if (!decodenetnum(val, &pvdc->v.sau))
+ fprintf(stderr,
+ "malformed %s=%s\n",
+ pvdc->tag, val);
+ } else { /* port */
+ if (atouint(val, &ul))
+ SET_PORT(&pvdc->v.sau,
+ (u_short)ul);
+ }
+ break;
+ }
+ }
+
+ /* and display */
+ if (decodestatus) {
+ vtype = (0 == as)
+ ? TYPE_SYS
+ : TYPE_PEER;
+ fprintf(fp, "associd=%u status=%04x %s,\n", as, rstatus,
+ statustoa(vtype, rstatus));
+ }
+
+ for (pvdc = table; pvdc->tag != NULL; pvdc++) {
+ switch (pvdc->type) {
+
+ case NTP_STR:
+ if (pvdc->v.str != NULL) {
+ fprintf(fp, "%s %s\n", pvdc->display,
+ pvdc->v.str);
+ free(pvdc->v.str);
+ pvdc->v.str = NULL;
+ }
+ break;
+
+ case NTP_ADD: /* fallthru */
+ case NTP_ADP:
+ fprintf(fp, "%s %s\n", pvdc->display,
+ nntohostp(&pvdc->v.sau));
+ break;
+
+ case NTP_LFP:
+ fprintf(fp, "%s %s\n", pvdc->display,
+ prettydate(&pvdc->v.lfp));
+ break;
+
+ case NTP_MODE:
+ atouint(pvdc->v.str, &ul);
+ fprintf(fp, "%s %s\n", pvdc->display,
+ modetoa((int)ul));
+ break;
+
+ case NTP_2BIT:
+ atouint(pvdc->v.str, &ul);
+ fprintf(fp, "%s %s\n", pvdc->display,
+ leapbits[ul & 0x3]);
+ break;
+
+ default:
+ fprintf(stderr, "unexpected vdc type %d for %s\n",
+ pvdc->type, pvdc->tag);
+ break;
+ }
+ }
+}
+
+
+/*
+ * sysstats - implements ntpq -c sysstats modeled on ntpdc -c sysstats
+ */
+static void
+sysstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc sysstats_vdc[] = {
+ { "ss_uptime", "uptime: ", NTP_STR },
+ { "ss_reset", "sysstats reset: ", NTP_STR },
+ { "ss_received", "packets received: ", NTP_STR },
+ { "ss_thisver", "current version: ", NTP_STR },
+ { "ss_oldver", "older version: ", NTP_STR },
+ { "ss_badformat", "bad length or format: ", NTP_STR },
+ { "ss_badauth", "authentication failed:", NTP_STR },
+ { "ss_declined", "declined: ", NTP_STR },
+ { "ss_restricted", "restricted: ", NTP_STR },
+ { "ss_limited", "rate limited: ", NTP_STR },
+ { "ss_kodsent", "KoD responses: ", NTP_STR },
+ { "ss_processed", "processed for time: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, sysstats_vdc, FALSE, fp);
+}
+
+
+/*
+ * sysinfo - modeled on ntpdc's sysinfo
+ */
+static void
+sysinfo(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc sysinfo_vdc[] = {
+ { "peeradr", "system peer: ", NTP_ADP },
+ { "peermode", "system peer mode: ", NTP_MODE },
+ { "leap", "leap indicator: ", NTP_2BIT },
+ { "stratum", "stratum: ", NTP_STR },
+ { "precision", "log2 precision: ", NTP_STR },
+ { "rootdelay", "root delay: ", NTP_STR },
+ { "rootdisp", "root dispersion: ", NTP_STR },
+ { "refid", "reference ID: ", NTP_STR },
+ { "reftime", "reference time: ", NTP_LFP },
+ { "sys_jitter", "system jitter: ", NTP_STR },
+ { "clk_jitter", "clock jitter: ", NTP_STR },
+ { "clk_wander", "clock wander: ", NTP_STR },
+ { "bcastdelay", "broadcast delay: ", NTP_STR },
+ { "authdelay", "symm. auth. delay:", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, sysinfo_vdc, TRUE, fp);
+}
+
+
+/*
+ * kerninfo - modeled on ntpdc's kerninfo
+ */
+static void
+kerninfo(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc kerninfo_vdc[] = {
+ { "koffset", "pll offset: ", NTP_STR },
+ { "kfreq", "pll frequency: ", NTP_STR },
+ { "kmaxerr", "maximum error: ", NTP_STR },
+ { "kesterr", "estimated error: ", NTP_STR },
+ { "kstflags", "kernel status: ", NTP_STR },
+ { "ktimeconst", "pll time constant: ", NTP_STR },
+ { "kprecis", "precision: ", NTP_STR },
+ { "kfreqtol", "frequency tolerance: ", NTP_STR },
+ { "kppsfreq", "pps frequency: ", NTP_STR },
+ { "kppsstab", "pps stability: ", NTP_STR },
+ { "kppsjitter", "pps jitter: ", NTP_STR },
+ { "kppscalibdur", "calibration interval ", NTP_STR },
+ { "kppscalibs", "calibration cycles: ", NTP_STR },
+ { "kppsjitexc", "jitter exceeded: ", NTP_STR },
+ { "kppsstbexc", "stability exceeded: ", NTP_STR },
+ { "kppscaliberrs", "calibration errors: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, kerninfo_vdc, TRUE, fp);
+}
+
+
+/*
+ * monstats - implements ntpq -c monstats
+ */
+static void
+monstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc monstats_vdc[] = {
+ { "mru_enabled", "enabled: ", NTP_STR },
+ { "mru_depth", "addresses: ", NTP_STR },
+ { "mru_deepest", "peak addresses: ", NTP_STR },
+ { "mru_maxdepth", "maximum addresses: ", NTP_STR },
+ { "mru_mindepth", "reclaim above count:", NTP_STR },
+ { "mru_maxage", "reclaim older than: ", NTP_STR },
+ { "mru_mem", "kilobytes: ", NTP_STR },
+ { "mru_maxmem", "maximum kilobytes: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, monstats_vdc, FALSE, fp);
+}
+
+
+/*
+ * iostats - ntpq -c iostats - network input and output counters
+ */
+static void
+iostats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc iostats_vdc[] = {
+ { "iostats_reset", "time since reset: ", NTP_STR },
+ { "total_rbuf", "receive buffers: ", NTP_STR },
+ { "free_rbuf", "free receive buffers: ", NTP_STR },
+ { "used_rbuf", "used receive buffers: ", NTP_STR },
+ { "rbuf_lowater", "low water refills: ", NTP_STR },
+ { "io_dropped", "dropped packets: ", NTP_STR },
+ { "io_ignored", "ignored packets: ", NTP_STR },
+ { "io_received", "received packets: ", NTP_STR },
+ { "io_sent", "packets sent: ", NTP_STR },
+ { "io_sendfailed", "packet send failures: ", NTP_STR },
+ { "io_wakeups", "input wakeups: ", NTP_STR },
+ { "io_goodwakeups", "useful input wakeups: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, iostats_vdc, FALSE, fp);
+}
+
+
+/*
+ * timerstats - ntpq -c timerstats - interval timer counters
+ */
+static void
+timerstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc timerstats_vdc[] = {
+ { "timerstats_reset", "time since reset: ", NTP_STR },
+ { "timer_overruns", "timer overruns: ", NTP_STR },
+ { "timer_xmts", "calls to transmit: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, timerstats_vdc, FALSE, fp);
+}
+
+
+/*
+ * authinfo - implements ntpq -c authinfo
+ */
+static void
+authinfo(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc authinfo_vdc[] = {
+ { "authreset", "time since reset:", NTP_STR },
+ { "authkeys", "stored keys: ", NTP_STR },
+ { "authfreek", "free keys: ", NTP_STR },
+ { "authklookups", "key lookups: ", NTP_STR },
+ { "authknotfound", "keys not found: ", NTP_STR },
+ { "authkuncached", "uncached keys: ", NTP_STR },
+ { "authkexpired", "expired keys: ", NTP_STR },
+ { "authencrypts", "encryptions: ", NTP_STR },
+ { "authdecrypts", "decryptions: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, authinfo_vdc, FALSE, fp);
+}
+
+
+/*
+ * pstats - show statistics for a peer
+ */
+static void
+pstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc pstats_vdc[] = {
+ { "src", "remote host: ", NTP_ADD },
+ { "dst", "local address: ", NTP_ADD },
+ { "timerec", "time last received: ", NTP_STR },
+ { "timer", "time until next send:", NTP_STR },
+ { "timereach", "reachability change: ", NTP_STR },
+ { "sent", "packets sent: ", NTP_STR },
+ { "received", "packets received: ", NTP_STR },
+ { "badauth", "bad authentication: ", NTP_STR },
+ { "bogusorg", "bogus origin: ", NTP_STR },
+ { "oldpkt", "duplicate: ", NTP_STR },
+ { "seldisp", "bad dispersion: ", NTP_STR },
+ { "selbroken", "bad reference time: ", NTP_STR },
+ { "candidate", "candidate order: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+ associd_t associd;
+
+ associd = checkassocid(pcmd->argval[0].uval);
+ if (0 == associd)
+ return;
+
+ collect_display_vdc(associd, pstats_vdc, TRUE, fp);
+}
+
diff --git a/ntpq/ntpq.1ntpqman b/ntpq/ntpq.1ntpqman
new file mode 100644
index 0000000..bc203c3
--- /dev/null
+++ b/ntpq/ntpq.1ntpqman
@@ -0,0 +1,1408 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpq 1ntpqman "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-fJaqSO/ag-rJaiRO)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:04 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpq-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpq\fP
+\- standard NTP query program
+.SH SYNOPSIS
+\f\*[B-Font]ntpq\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ host ...]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The
+\f\*[B-Font]ntpq\fP
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty-printed output
+options being available.
+The
+\f\*[B-Font]ntpq\fP
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+If one or more request options is included on the command line
+when
+\f\*[B-Font]ntpq\fP
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+\f\*[B-Font]ntpq\fP
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+\f\*[B-Font]ntpq\fP
+utility will prompt for
+commands if the standard input is a terminal device.
+\f\*[B-Font]ntpq\fP
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+\f\*[B-Font]ntpq\fP
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+Specifying a
+command line option other than
+\f\*[B-Font]\-i\f[]
+or
+\f\*[B-Font]\-n\f[]
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+\f\*[B-Font]ntpq\fP
+will attempt to read
+interactive format commands from the standard input.
+.SS "Internal Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+A
+number of interactive format commands are executed entirely within
+the
+\f\*[B-Font]ntpq\fP
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+.TP 20
+.NOP \f\*[B-Font]?\f[] [\f\*[I-Font]command_keyword\f[]]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]help\f[] [\f\*[I-Font]command_keyword\f[]]
+A
+\[oq]\&?\[cq]
+by itself will print a list of all the command
+keywords known to this incarnation of
+\f\*[B-Font]ntpq\fP.
+A
+\[oq]\&?\[cq]
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+\f\*[B-Font]ntpq\fP
+than this manual
+page.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]addvars\f[] \f\*[I-Font]variable_name\f[][\f\*[B-Font]=value\f[]] \f\*[B-Font]...\f[]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]rmvars\f[] \f\*[I-Font]variable_name\f[] \f\*[B-Font]...\f[]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]clearvars\f[]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]showvars\f[]
+The data carried by NTP mode 6 messages consists of a list of
+items of the form
+\[oq]variable_name=value\[cq],
+where the
+\[oq]=value\[cq]
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+\f\*[B-Font]ntpq\fP
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+\f\*[B-Font]readlist\f[]
+and
+\f\*[B-Font]writelist\f[]
+commands described below.
+The
+\f\*[B-Font]addvars\f[]
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma-separated and not contain white space.
+The
+\f\*[B-Font]rmvars\f[]
+command can be used to remove individual variables from the list,
+while the
+\f\*[B-Font]clearlist\f[]
+command removes all variables from the
+list.
+The
+\f\*[B-Font]showvars\f[]
+command displays the current list of optional variables.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]authenticate\f[] [yes | no]
+Normally
+\f\*[B-Font]ntpq\fP
+does not authenticate requests unless
+they are write requests.
+The command
+\[oq]authenticate yes\[cq]
+causes
+\f\*[B-Font]ntpq\fP
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+\f\*[B-Font]peer\f[]
+display.
+The command
+\[oq]authenticate\[cq]
+causes
+\f\*[B-Font]ntpq\fP
+to display whether or not
+\f\*[B-Font]ntpq\fP
+is currently autheinticating requests.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]cooked\f[]
+Causes output from query commands to be "cooked", so that
+variables which are recognized by
+\f\*[B-Font]ntpq\fP
+will have their
+values reformatted for human consumption.
+Variables which
+\f\*[B-Font]ntpq\fP
+thinks should have a decodable value but didn't are
+marked with a trailing
+\[oq]\&?\[cq].
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]debug\f[] [\f\*[B-Font]more\f[] | \f\*[B-Font]less\f[] | \f\*[B-Font]off\f[]]
+With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]delay\f[] \f\*[I-Font]milliseconds\f[]
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]exit\f[]
+Exit
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]host\f[] \f\*[I-Font]hostname\f[]
+Set the host to which future queries will be sent.
+\f\*[I-Font]hostname\f[]
+may be either a host name or a numeric address.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]hostnames\f[] [\f\*[B-Font]yes\f[] | \f\*[B-Font]no\f[]]
+If
+\f\*[B-Font]yes\f[]
+is specified, host names are printed in
+information displays.
+If
+\f\*[B-Font]no\f[]
+is specified, numeric
+addresses are printed instead.
+The default is
+\f\*[B-Font]yes\f[],
+unless
+modified using the command line
+\f\*[B-Font]\-n\f[]
+switch.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]keyid\f[] \f\*[I-Font]keyid\f[]
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]keytype\f[] [\f\*[B-Font]md5\f[] | \f\*[B-Font]OpenSSLDigestType\f[]]
+Specify the type of key to use for authenticating requests.
+\f\*[B-Font]md5\f[]
+is alway supported.
+If
+\f\*[B-Font]ntpq\fP
+was built with OpenSSL support,
+any digest type supported by OpenSSL can also be provided.
+If no argument is given, the current
+\f\*[B-Font]keytype\f[]
+is displayed.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]ntpversion\f[] [\f\*[B-Font]1\f[] | \f\*[B-Font]2\f[] | \f\*[B-Font]3\f[] | \f\*[B-Font]4\f[]]
+Sets the NTP version number which
+\f\*[B-Font]ntpq\fP
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]passwd\f[]
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.\" Not yet implemented.
+.\" .It Ic poll
+.\" .Op Ar n
+.\" .Op Ic verbose
+.\" Poll an NTP server in client mode
+.\" .Ar n
+.\" times.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]quit\f[]
+Exit
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]raw\f[]
+Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]timeout\f[] \f\*[I-Font]milliseconds\f[]
+Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+\f\*[B-Font]ntpq\fP
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]version\f[]
+Print the version of the
+\f\*[B-Font]ntpq\fP
+program.
+.PP
+.SS "Control Message Commands"
+Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode-6 message to the server and expect a single response message.
+The exceptions are the
+\f[C]peers\f[]
+command, which sends a series of messages,
+and the
+\f[C]mreadlist\f[]
+and
+\f[C]mreadvar\f[]
+commands, which iterate over a range of associations.
+.TP 10
+.NOP \f\*[B-Font]associations\f[]
+Display a list of mobilized associations in the form:
+.Dl ind assid status conf reach auth condition last_event cnt
+.RS
+.IP \fB\(bu\fP 2
+.IP \fB\(bu\fP 2 \f[C]ind\f[] \f[C]Ta\f[] \f[C]index\f[] \f[C]on\f[] \f[C]this\f[] \f[C]list\f[]
+.IP \fB\(bu\fP 2 \f[C]assid\f[] \f[C]Ta\f[] \f[C]association\f[] \f[C]ID\f[]
+.IP \fB\(bu\fP 2 \f[C]status\f[] \f[C]Ta\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word\f[]
+.IP \fB\(bu\fP 2 \f[C]conf\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]persistent,\f[] \f[C]no\f[]: \f[C]ephemeral\f[]
+.IP \fB\(bu\fP 2 \f[C]reach\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]reachable,\f[] \f[C]no\f[]: \f[C]unreachable\f[]
+.IP \fB\(bu\fP 2 \f[C]auth\f[] \f[C]Ta\f[] \f[C]ok\f[], \f[C]yes\f[], \f[C]bad\f[] \f[C]and\f[] \f[C]none\f[]
+.IP \fB\(bu\fP 2 \f[C]condition\f[] \f[C]Ta\f[] \f[C]selection\f[] \f[C]status\f[] \f[C](see\f[] \f[C]the\f[] \f[C]select\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
+.IP \fB\(bu\fP 2 \f[C]last_event\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]report\f[] \f[C](see\f[] \f[C]the\f[] \f[C]event\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
+.IP \fB\(bu\fP 2 \f[C]cnt\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]count\f[] \f[C](see\f[] \f[C]the\f[] \f[C]count\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
+.RE
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]authinfo\f[]
+Display the authentication statistics.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clockvar\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...]
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]cv\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...]
+Display a list of clock variables for those associations supporting a reference clock.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]:config\f[] [...]
+Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]config-from-file\f[] \f\*[I-Font]filename\f[]
+Send the each line of
+\f\*[I-Font]filename\f[]
+to the server as run-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ifstats\f[]
+Display statistics for each local network address. Authentication is required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]iostats\f[]
+Display network and reference clock I/O statistics.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]kerninfo\f[]
+Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lassociations\f[]
+Perform the same function as the associations command, except display mobilized and unmobilized associations.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lopeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
+Obtain and print a list of all peers and clients showing
+\f\*[I-Font]dstadr\f[]
+(associated with any given IP version).
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lpeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
+Print a peer spreadsheet for the appropriate IP version(s).
+\f\*[I-Font]dstadr\f[]
+(associated with any given IP version).
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]monstats\f[]
+Display monitor facility statistics.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mrulist\f[] [\f\*[B-Font]limited\f[] | \f\*[B-Font]kod\f[] | \f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[] | \f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[] | \f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[] | \f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[] | \f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[]]
+Obtain and print traffic counts collected and maintained by the monitor facility.
+With the exception of
+\f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[],
+the options filter the list returned by
+\f\*[B-Font]ntpd.\f[]
+The
+\f\*[B-Font]limited\f[]
+and
+\f\*[B-Font]kod\f[]
+options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
+The
+\f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[]
+option filters entries representing less than
+\f\*[I-Font]count\f[]
+packets.
+The
+\f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[]
+option filters entries for packets received on any local address other than
+\f\*[I-Font]localaddr\f[].
+\f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[]
+and
+\f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[]
+filter entries containing none or less than all, respectively, of the bits in
+\f\*[I-Font]hexmask\f[],
+which must begin with
+\f\*[B-Font]0x\f[].
+The
+\f\*[I-Font]sortorder\f[]
+defaults to
+\f\*[B-Font]lstint\f[]
+and may be any of
+\f\*[B-Font]addr\f[],
+\f\*[B-Font]count\f[],
+\f\*[B-Font]avgint\f[],
+\f\*[B-Font]lstint\f[],
+or any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+.RS
+.TP 10
+.NOP Column
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lstint\f[]
+Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]avgint\f[]
+Average interval in s between packets from this address.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rstr\f[]
+Restriction flags associated with this address.
+Most are copied unchanged from the matching
+\f\*[B-Font]restrict\f[]
+command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]r\f[]
+Rate control indicator, either
+a period,
+\f\*[B-Font]L\f[]
+or
+\f\*[B-Font]K\f[]
+for no rate control response,
+rate limiting by discarding, or rate limiting with a KoD response, respectively.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]m\f[]
+Packet mode.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]v\f[]
+Packet version number.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]count\f[]
+Packets received from this address.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rport\f[]
+Source port of last packet from this address.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]remote\f[] \f\*[B-Font]address\f[]
+DNS name, numeric address, or address followed by
+claimed DNS name which could not be verified in parentheses.
+.RE
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mreadvar\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ...
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mrv\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ...
+Perform the same function as the
+\f\*[B-Font]readvar\f[]
+command, except for a range of association IDs.
+This range is determined from the association list cached by the most recent
+\f\*[B-Font]associations\f[]
+command.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]opeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
+Obtain and print the old-style list of all peers and clients showing
+\f\*[I-Font]dstadr\f[]
+(associated with any given IP version),
+rather than the
+\f\*[I-Font]refid\f[].
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]passociations\f[]
+Perform the same function as the
+\f\*[B-Font]associations\f[]
+command,
+except that it uses previously stored data rather than making a new query.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]peers\f[]
+Display a list of peers in the form:
+.Dl [tally]remote refid st t when pool reach delay offset jitter
+.RS
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font][tally]\f[]
+single-character code indicating current value of the
+\f\*[B-Font]select\f[]
+field of the
+.Lk decode.html#peer "peer status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]remote\f[]
+host name (or IP number) of peer.
+The value displayed will be truncated to 15 characters unless the
+\f\*[B-Font]\-w\f[]
+flag is given, in which case the full value will be displayed
+on the first line,
+and the remaining data is displayed on the next line.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+association ID or
+.Lk decode.html#kiss "'kiss code"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]st\f[]
+stratum
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]t\f[]
+\f\*[B-Font]u\f[]:
+unicast or manycast client,
+\f\*[B-Font]b\f[]:
+broadcast or multicast client,
+\f\*[B-Font]l\f[]:
+local (reference clock),
+\f\*[B-Font]s\f[]:
+symmetric (peer),
+\f\*[B-Font]A\f[]:
+manycast server,
+\f\*[B-Font]B\f[]:
+broadcast server,
+\f\*[B-Font]M\f[]:
+multicast server
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]when\f[]
+sec/min/hr since last received packet
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]poll\f[]
+poll interval (log2 s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reach\f[]
+reach shift register (octal)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]delay\f[]
+roundtrip delay
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]offset\f[]
+offset of server relative to this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]jitter\f[]
+jitter
+.RE
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]pstats\f[] \f\*[I-Font]assocID\f[]
+Show the statistics for the peer with the given
+\f\*[I-Font]assocID\f[].
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]readlist\f[] \f\*[I-Font]assocID\f[]
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rl\f[] \f\*[I-Font]assocID\f[]
+Read the system or peer variables included in the variable list.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]readvar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...]
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rv\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...]
+Display the specified variables.
+If
+\f\*[I-Font]assocID\f[]
+is zero, the variables are from the
+\fISystem\f[] \fIVariables\f[]
+name space, otherwise they are from the
+\fIPeer\f[] \fIVariables\f[]
+name space.
+The
+\f\*[I-Font]assocID\f[]
+is required, as the same name can occur in both spaces.
+If no
+\f\*[I-Font]name\f[]
+is included, all operative variables in the name space are displayed.
+In this case only, if the
+\f\*[I-Font]assocID\f[]
+is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds
+and frequency values in parts-per-million (PPM).
+Some NTP timestamps are represented in the format
+YYYYMMDDTTTT ,
+where YYYY is the year,
+MM the month of year,
+DD the day of month and
+TTTT the time of day.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reslist\f[]
+Show the access control (restrict) list for
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]saveconfig\f[] \f\*[I-Font]filename\f[]
+Write the current configuration,
+including any runtime modifications given with
+\f\*[B-Font]:config\f[]
+or
+\f\*[B-Font]config-from-file\f[],
+to the ntpd host's file
+\f\*[I-Font]filename\f[].
+This command will be rejected by the server unless
+.Lk miscopt.html#saveconfigdir "saveconfigdir"
+appears in the
+\f\*[B-Font]ntpd\f[]
+configuration file.
+\f\*[I-Font]filename\f[]
+can use
+\fCstrftime\fR()\f[]
+format specifies to substitute the current date and time, for example,
+\f\*[B-Font]q]saveconfig\f[] \f\*[B-Font]ntp-%Y%m%d-%H%M%S.confq]\f[].
+The filename used is stored in system variable
+\f\*[B-Font]savedconfig\f[].
+Authentication is required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]timerstats\f[]
+Display interval timer counters.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]writelist\f[] \f\*[I-Font]assocID\f[]
+Write the system or peer variables included in the variable list.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]writevar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[]=\f\*[I-Font]value\f[] [, ...]
+Write the specified variables.
+If the
+\f\*[I-Font]assocID\f[]
+is zero, the variables are from the
+\fISystem\f[] \fIVariables\f[]
+name space, otherwise they are from the
+\fIPeer\f[] \fIVariables\f[]
+name space.
+The
+\f\*[I-Font]assocID\f[]
+is required, as the same name can occur in both spaces.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]sysinfo\f[]
+Display operational summary.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]sysstats\f[]
+Print statistics counters maintained in the protocol module.
+.PP
+.SS Status Words and Kiss Codes
+The current state of the operating program is shown
+in a set of status words
+maintained by the system.
+Status information is also available on a per-association basis.
+These words are displayed in the
+\f\*[B-Font]rv\f[]
+and
+\f\*[B-Font]as\f[]
+commands both in hexadecimal and in decoded short tip strings.
+The codes, tips and short explanations are documented on the
+.Lk decode.html "Event Messages and Status Words"
+page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+.sp \n(Ppu
+.ne 2
+
+Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+.Lk decode.html#kiss "kiss codes" .
+The original purpose was for kiss-o'-death (KoD) packets
+sent by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+.SS System Variables
+The following system variables appear in the
+\f\*[B-Font]rv\f[]
+billboard.
+Not all variables are displayed in some configurations.
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]status\f[]
+.Lk decode.html#sys "system status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]version\f[]
+NTP software version and build time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]processor\f[]
+hardware platform and version
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]system\f[]
+operating system and version
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]leap\f[]
+leap warning indicator (0-3)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]stratum\f[]
+stratum (1-15)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]precision\f[]
+precision (log2 s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdelay\f[]
+total roundtrip delay to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdisp\f[]
+total dispersion to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]peer\f[]
+system peer association ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]tc\f[]
+time constant and poll exponent (log2 s) (3-17)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mintc\f[]
+minimum time constant (log2 s) (3-10)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clock\f[]
+date and time of day
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reftime\f[]
+reference time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]offset\f[]
+combined offset of server relative to this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]sys_jitter\f[]
+combined system jitter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]frequency\f[]
+frequency offset (PPM) relative to hardware clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clk_wander\f[]
+clock frequency wander (PPM)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clk_jitter\f[]
+clock jitter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]tai\f[]
+TAI-UTC offset (s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]leapsec\f[]
+NTP seconds when the next leap second is/was inserted
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]expire\f[]
+NTP seconds when the NIST leapseconds file expires
+.PP
+The jitter and wander statistics are exponentially-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+.sp \n(Ppu
+.ne 2
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed,
+including some or all of the following,
+depending on the particular Autokey dance:
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]host\f[]
+Autokey host name for this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ident\f[]
+Autokey group name for this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+host flags (see Autokey specification)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]digest\f[]
+OpenSSL message digest algorithm
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]signature\f[]
+OpenSSL digest/signature scheme
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]update\f[]
+NTP seconds at last signature update
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]cert\f[]
+certificate subject, issuer and certificate flags
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]until\f[]
+NTP seconds when the certificate expires
+.PP
+.SS Peer Variables
+The following peer variables appear in the
+\f\*[B-Font]rv\f[]
+billboard for each association.
+Not all variables are displayed in some configurations.
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]associd\f[]
+association ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]status\f[]
+.Lk decode.html#peer "peer status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]srcadr\f[]
+source (remote) IP address
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]srcport\f[]
+source (remote) port
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]dstadr\f[]
+destination (local) IP address
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]dstport\f[]
+destination (local) port
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]leap\f[]
+leap indicator (0-3)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]stratum\f[]
+stratum (0-15)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]precision\f[]
+precision (log2 s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdelay\f[]
+total roundtrip delay to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdisp\f[]
+total root dispersion to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reftime\f[]
+reference time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reach\f[]
+reach register (octal)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]unreach\f[]
+unreach counter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]hmode\f[]
+host mode (1-6)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]pmode\f[]
+peer mode (1-5)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]hpoll\f[]
+host poll exponent (log2 s) (3-17)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ppoll\f[]
+peer poll exponent (log2 s) (3-17)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]headway\f[]
+headway (see
+.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" )
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flash\f[]
+.Lk decode.html#flash "flash status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]offset\f[]
+filter offset
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]delay\f[]
+filter delay
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]dispersion\f[]
+filter dispersion
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]jitter\f[]
+filter jitter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ident\f[]
+Autokey group name for this association
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]bias\f[]
+unicast/broadcast bias
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]xleave\f[]
+interleave delay (see
+.Lk xleave.html "NTP Interleaved Modes" )
+.PP
+The
+\f\*[B-Font]bias\f[]
+variable is calculated when the first broadcast packet is received
+after the calibration volley.
+It represents the offset of the broadcast subgraph relative to the unicast subgraph.
+The
+\f\*[B-Font]xleave\f[]
+variable appears only for the interleaved symmetric and interleaved modes.
+It represents the internal queuing, buffering and transmission delays
+for the preceding packet.
+.sp \n(Ppu
+.ne 2
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+peer flags (see Autokey specification)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]host\f[]
+Autokey server name
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+peer flags (see Autokey specification)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]signature\f[]
+OpenSSL digest/signature scheme
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]initsequence\f[]
+initial key ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]initkey\f[]
+initial key index
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]timestamp\f[]
+Autokey signature timestamp
+.PP
+.SS Clock Variables
+The following clock variables appear in the
+\f\*[B-Font]cv\f[]
+billboard for each association with a reference clock.
+Not all variables are displayed in some configurations.
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]associd\f[]
+association ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]status\f[]
+.Lk decode.html#clock "clock status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]device\f[]
+device description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]timecode\f[]
+ASCII time code string (specific to device)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]poll\f[]
+poll messages sent
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]noreply\f[]
+no reply
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]badformat\f[]
+bad format
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]baddata\f[]
+bad date or time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]fudgetime1\f[]
+fudge time 1
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]fudgetime2\f[]
+fudge time 2
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]stratum\f[]
+driver stratum
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+driver reference ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+driver flags
+.PP
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[]
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[]
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, peers.
+.sp
+Force \fBntpq\fP to operate in interactive mode.
+Prompts will be written to the standard output and
+commands read from the standard input.
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+numeric host addresses.
+.sp
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-\-old\-rv\f[]
+Always output status line with readvar.
+.sp
+By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
+line that precedes the output of \fBreadvar\fP
+(alias \fBrv\fP) when a single variable is requested, such as
+\fBntpq \-c "rv 0 offset"\fP.
+This option causes \fBntpq\fP to include both lines of output
+for a single-variable \fBreadvar\fP.
+Using an environment variable to
+preset this option in a script will enable both older and
+newer \fBntpq\fP to behave identically in this regard.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+interactive.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-w\f[], \f\*[B-Font]\-\-wide\f[]
+Display the full 'remote' value.
+.sp
+Display the full value of the 'remote' value. If this requires
+more than 15 characters, display the full value, emit a newline,
+and continue the data display properly indented on the next line.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPQ_<option-name>\fP or \fBNTPQ\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpq\fP
+option definitions.
diff --git a/ntpq/ntpq.1ntpqmdoc b/ntpq/ntpq.1ntpqmdoc
new file mode 100644
index 0000000..8d70a07
--- /dev/null
+++ b/ntpq/ntpq.1ntpqmdoc
@@ -0,0 +1,954 @@
+.Dd December 2 2014
+.Dt NTPQ 1ntpqmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:10 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpq-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpq
+.Nd standard NTP query program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ host ...]
+.Pp
+.Sh DESCRIPTION
+The
+.Nm
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty\-printed output
+options being available.
+The
+.Nm
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+If one or more request options is included on the command line
+when
+.Nm
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+.Nm
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+.Nm
+utility will prompt for
+commands if the standard input is a terminal device.
+.Nm
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+.Nm
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+Specifying a
+command line option other than
+.Fl i
+or
+.Fl n
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+.Nm
+will attempt to read
+interactive format commands from the standard input.
+.Ss "Internal Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+A
+number of interactive format commands are executed entirely within
+the
+.Nm
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+.Bl -tag -width "? [command_keyword]" -compact -offset indent
+.It Ic ? Op Ar command_keyword
+.It Ic help Op Ar command_keyword
+A
+.Ql \&?
+by itself will print a list of all the command
+keywords known to this incarnation of
+.Nm .
+A
+.Ql \&?
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+.Nm
+than this manual
+page.
+.It Ic addvars Ar variable_name Ns Xo Op Ic =value
+.Ic ...
+.Xc
+.It Ic rmvars Ar variable_name Ic ...
+.It Ic clearvars
+.It Ic showvars
+The data carried by NTP mode 6 messages consists of a list of
+items of the form
+.Ql variable_name=value ,
+where the
+.Ql =value
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+.Nm
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+.Ic readlist
+and
+.Ic writelist
+commands described below.
+The
+.Ic addvars
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma\-separated and not contain white space.
+The
+.Ic rmvars
+command can be used to remove individual variables from the list,
+while the
+.Ic clearlist
+command removes all variables from the
+list.
+The
+.Ic showvars
+command displays the current list of optional variables.
+.It Ic authenticate Op yes | no
+Normally
+.Nm
+does not authenticate requests unless
+they are write requests.
+The command
+.Ql authenticate yes
+causes
+.Nm
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+.Ic peer
+display.
+The command
+.Ql authenticate
+causes
+.Nm
+to display whether or not
+.Nm
+is currently autheinticating requests.
+.It Ic cooked
+Causes output from query commands to be "cooked", so that
+variables which are recognized by
+.Nm
+will have their
+values reformatted for human consumption.
+Variables which
+.Nm
+thinks should have a decodable value but didn't are
+marked with a trailing
+.Ql \&? .
+.It Xo
+.Ic debug
+.Oo
+.Cm more |
+.Cm less |
+.Cm off
+.Oc
+.Xc
+With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+.It Ic delay Ar milliseconds
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.It Ic exit
+Exit
+.Nm .
+.It Ic host Ar hostname
+Set the host to which future queries will be sent.
+.Ar hostname
+may be either a host name or a numeric address.
+.It Ic hostnames Op Cm yes | Cm no
+If
+.Cm yes
+is specified, host names are printed in
+information displays.
+If
+.Cm no
+is specified, numeric
+addresses are printed instead.
+The default is
+.Cm yes ,
+unless
+modified using the command line
+.Fl n
+switch.
+.It Ic keyid Ar keyid
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.It Ic keytype Xo Oo
+.Cm md5 |
+.Cm OpenSSLDigestType
+.Oc
+.Xc
+Specify the type of key to use for authenticating requests.
+.Cm md5
+is alway supported.
+If
+.Nm
+was built with OpenSSL support,
+any digest type supported by OpenSSL can also be provided.
+If no argument is given, the current
+.Ic keytype
+is displayed.
+.It Ic ntpversion Xo Oo
+.Cm 1 |
+.Cm 2 |
+.Cm 3 |
+.Cm 4
+.Oc
+.Xc
+Sets the NTP version number which
+.Nm
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+.It Ic passwd
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.\" Not yet implemented.
+.\" .It Ic poll
+.\" .Op Ar n
+.\" .Op Ic verbose
+.\" Poll an NTP server in client mode
+.\" .Ar n
+.\" times.
+.It Ic quit
+Exit
+.Nm .
+.It Ic raw
+Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+.It Ic timeout Ar milliseconds
+Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+.Nm
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.It Ic version
+Print the version of the
+.Nm
+program.
+.El
+.Ss "Control Message Commands"
+Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode\-6 message to the server and expect a single response message.
+The exceptions are the
+.Li peers
+command, which sends a series of messages,
+and the
+.Li mreadlist
+and
+.Li mreadvar
+commands, which iterate over a range of associations.
+.Bl -tag -width "something" -compact -offset indent
+.It Cm associations
+Display a list of mobilized associations in the form:
+.Dl ind assid status conf reach auth condition last_event cnt
+.Bl -column -offset indent ".Sy Variable" ".Sy Description"
+.It Sy String Ta Sy Description
+.It Li ind Ta index on this list
+.It Li assid Ta association ID
+.It Li status Ta peer status word
+.It Li conf Ta Li yes : persistent, Li no : ephemeral
+.It Li reach Ta Li yes : reachable, Li no : unreachable
+.It Li auth Ta Li ok , Li yes , Li bad and Li none
+.It Li condition Ta selection status (see the Li select field of the peer status word)
+.It Li last_event Ta event report (see the Li event field of the peer status word)
+.It Li cnt Ta event count (see the Li count field of the peer status word)
+.El
+.It Cm authinfo
+Display the authentication statistics.
+.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
+.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
+Display a list of clock variables for those associations supporting a reference clock.
+.It Cm :config Op ...
+Send the remainder of the command line, including whitespace, to the server as a run\-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
+.It Cm config\-from\-file Ar filename
+Send the each line of
+.Ar filename
+to the server as run\-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
+.It Ic ifstats
+Display statistics for each local network address. Authentication is required.
+.It Ic iostats
+Display network and reference clock I/O statistics.
+.It Ic kerninfo
+Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
+.It Ic lassociations
+Perform the same function as the associations command, except display mobilized and unmobilized associations.
+.It Ic lopeers Xo
+.Oo Ic \-4 |
+.Ic \-6
+.Oc
+.Xc
+Obtain and print a list of all peers and clients showing
+.Ar dstadr
+(associated with any given IP version).
+.It Ic lpeers Xo
+.Oo Ic \-4 |
+.Ic \-6
+.Oc
+.Xc
+Print a peer spreadsheet for the appropriate IP version(s).
+.Ar dstadr
+(associated with any given IP version).
+.It Ic monstats
+Display monitor facility statistics.
+.It Ic mrulist Oo Ic limited | Ic kod | Ic mincount Ns = Ns Ar count | Ic laddr Ns = Ns Ar localaddr | Ic sort Ns = Ns Ar sortorder | Ic resany Ns = Ns Ar hexmask | Ic resall Ns = Ns Ar hexmask Oc
+Obtain and print traffic counts collected and maintained by the monitor facility.
+With the exception of
+.Cm sort Ns = Ns Ar sortorder ,
+the options filter the list returned by
+.Cm ntpd.
+The
+.Cm limited
+and
+.Cm kod
+options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
+The
+.Cm mincount Ns = Ns Ar count
+option filters entries representing less than
+.Ar count
+packets.
+The
+.Cm laddr Ns = Ns Ar localaddr
+option filters entries for packets received on any local address other than
+.Ar localaddr .
+.Cm resany Ns = Ns Ar hexmask
+and
+.Cm resall Ns = Ns Ar hexmask
+filter entries containing none or less than all, respectively, of the bits in
+.Ar hexmask ,
+which must begin with
+.Cm 0x .
+The
+.Ar sortorder
+defaults to
+.Cm lstint
+and may be any of
+.Cm addr ,
+.Cm count ,
+.Cm avgint ,
+.Cm lstint ,
+or any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+.Bl -tag -width "something" -compact -offset indent
+.It Column
+Description
+.It Ic lstint
+Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
+.Nm .
+.It Ic avgint
+Average interval in s between packets from this address.
+.It Ic rstr
+Restriction flags associated with this address.
+Most are copied unchanged from the matching
+.Ic restrict
+command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
+.It Ic r
+Rate control indicator, either
+a period,
+.Ic L
+or
+.Ic K
+for no rate control response,
+rate limiting by discarding, or rate limiting with a KoD response, respectively.
+.It Ic m
+Packet mode.
+.It Ic v
+Packet version number.
+.It Ic count
+Packets received from this address.
+.It Ic rport
+Source port of last packet from this address.
+.It Ic remote address
+DNS name, numeric address, or address followed by
+claimed DNS name which could not be verified in parentheses.
+.El
+.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
+.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
+Perform the same function as the
+.Ic readvar
+command, except for a range of association IDs.
+This range is determined from the association list cached by the most recent
+.Ic associations
+command.
+.It Ic opeers Xo
+.Oo Ic \-4 |
+.Ic \-6
+.Oc
+.Xc
+Obtain and print the old\-style list of all peers and clients showing
+.Ar dstadr
+(associated with any given IP version),
+rather than the
+.Ar refid .
+.It Ic passociations
+Perform the same function as the
+.Ic associations
+command,
+except that it uses previously stored data rather than making a new query.
+.It Ic peers
+Display a list of peers in the form:
+.Dl [tally]remote refid st t when pool reach delay offset jitter
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic [tally]
+single\-character code indicating current value of the
+.Ic select
+field of the
+.Lk decode.html#peer "peer status word"
+.It Ic remote
+host name (or IP number) of peer.
+The value displayed will be truncated to 15 characters unless the
+.Fl w
+flag is given, in which case the full value will be displayed
+on the first line,
+and the remaining data is displayed on the next line.
+.It Ic refid
+association ID or
+.Lk decode.html#kiss "'kiss code"
+.It Ic st
+stratum
+.It Ic t
+.Ic u :
+unicast or manycast client,
+.Ic b :
+broadcast or multicast client,
+.Ic l :
+local (reference clock),
+.Ic s :
+symmetric (peer),
+.Ic A :
+manycast server,
+.Ic B :
+broadcast server,
+.Ic M :
+multicast server
+.It Ic when
+sec/min/hr since last received packet
+.It Ic poll
+poll interval (log2 s)
+.It Ic reach
+reach shift register (octal)
+.It Ic delay
+roundtrip delay
+.It Ic offset
+offset of server relative to this host
+.It Ic jitter
+jitter
+.El
+.It Ic pstats Ar assocID
+Show the statistics for the peer with the given
+.Ar assocID .
+.It Ic readlist Ar assocID
+.It Ic rl Ar assocID
+Read the system or peer variables included in the variable list.
+.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc
+.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc
+Display the specified variables.
+If
+.Ar assocID
+is zero, the variables are from the
+.Sx System Variables
+name space, otherwise they are from the
+.Sx Peer Variables
+name space.
+The
+.Ar assocID
+is required, as the same name can occur in both spaces.
+If no
+.Ar name
+is included, all operative variables in the name space are displayed.
+In this case only, if the
+.Ar assocID
+is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds
+and frequency values in parts\-per\-million (PPM).
+Some NTP timestamps are represented in the format
+YYYYMMDDTTTT ,
+where YYYY is the year,
+MM the month of year,
+DD the day of month and
+TTTT the time of day.
+.It Ic reslist
+Show the access control (restrict) list for
+.Nm .
+.It Ic saveconfig Ar filename
+Write the current configuration,
+including any runtime modifications given with
+.Ic :config
+or
+.Ic config\-from\-file ,
+to the ntpd host's file
+.Ar filename .
+This command will be rejected by the server unless
+.Lk miscopt.html#saveconfigdir "saveconfigdir"
+appears in the
+.Ic ntpd
+configuration file.
+.Ar filename
+can use
+.Xr strftime
+format specifies to substitute the current date and time, for example,
+.Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] .
+The filename used is stored in system variable
+.Ic savedconfig .
+Authentication is required.
+.It Ic timerstats
+Display interval timer counters.
+.It Ic writelist Ar assocID
+Write the system or peer variables included in the variable list.
+.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ...
+Write the specified variables.
+If the
+.Ar assocID
+is zero, the variables are from the
+.Sx System Variables
+name space, otherwise they are from the
+.Sx Peer Variables
+name space.
+The
+.Ar assocID
+is required, as the same name can occur in both spaces.
+.It Ic sysinfo
+Display operational summary.
+.It Ic sysstats
+Print statistics counters maintained in the protocol module.
+.El
+.Ss Status Words and Kiss Codes
+The current state of the operating program is shown
+in a set of status words
+maintained by the system.
+Status information is also available on a per\-association basis.
+These words are displayed in the
+.Ic rv
+and
+.Ic as
+commands both in hexadecimal and in decoded short tip strings.
+The codes, tips and short explanations are documented on the
+.Lk decode.html "Event Messages and Status Words"
+page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+.Pp
+Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+.Lk decode.html#kiss "kiss codes" .
+The original purpose was for kiss\-o'\-death (KoD) packets
+sent by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+.Ss System Variables
+The following system variables appear in the
+.Ic rv
+billboard.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic status
+.Lk decode.html#sys "system status word"
+.It Ic version
+NTP software version and build time
+.It Ic processor
+hardware platform and version
+.It Ic system
+operating system and version
+.It Ic leap
+leap warning indicator (0\-3)
+.It Ic stratum
+stratum (1\-15)
+.It Ic precision
+precision (log2 s)
+.It Ic rootdelay
+total roundtrip delay to the primary reference clock
+.It Ic rootdisp
+total dispersion to the primary reference clock
+.It Ic peer
+system peer association ID
+.It Ic tc
+time constant and poll exponent (log2 s) (3\-17)
+.It Ic mintc
+minimum time constant (log2 s) (3\-10)
+.It Ic clock
+date and time of day
+.It Ic refid
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.It Ic reftime
+reference time
+.It Ic offset
+combined offset of server relative to this host
+.It Ic sys_jitter
+combined system jitter
+.It Ic frequency
+frequency offset (PPM) relative to hardware clock
+.It Ic clk_wander
+clock frequency wander (PPM)
+.It Ic clk_jitter
+clock jitter
+.It Ic tai
+TAI\-UTC offset (s)
+.It Ic leapsec
+NTP seconds when the next leap second is/was inserted
+.It Ic expire
+NTP seconds when the NIST leapseconds file expires
+.El
+The jitter and wander statistics are exponentially\-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+.Pp
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed,
+including some or all of the following,
+depending on the particular Autokey dance:
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic host
+Autokey host name for this host
+.It Ic ident
+Autokey group name for this host
+.It Ic flags
+host flags (see Autokey specification)
+.It Ic digest
+OpenSSL message digest algorithm
+.It Ic signature
+OpenSSL digest/signature scheme
+.It Ic update
+NTP seconds at last signature update
+.It Ic cert
+certificate subject, issuer and certificate flags
+.It Ic until
+NTP seconds when the certificate expires
+.El
+.Ss Peer Variables
+The following peer variables appear in the
+.Ic rv
+billboard for each association.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic associd
+association ID
+.It Ic status
+.Lk decode.html#peer "peer status word"
+.It Ic srcadr
+source (remote) IP address
+.It Ic srcport
+source (remote) port
+.It Ic dstadr
+destination (local) IP address
+.It Ic dstport
+destination (local) port
+.It Ic leap
+leap indicator (0\-3)
+.It Ic stratum
+stratum (0\-15)
+.It Ic precision
+precision (log2 s)
+.It Ic rootdelay
+total roundtrip delay to the primary reference clock
+.It Ic rootdisp
+total root dispersion to the primary reference clock
+.It Ic refid
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.It Ic reftime
+reference time
+.It Ic reach
+reach register (octal)
+.It Ic unreach
+unreach counter
+.It Ic hmode
+host mode (1\-6)
+.It Ic pmode
+peer mode (1\-5)
+.It Ic hpoll
+host poll exponent (log2 s) (3\-17)
+.It Ic ppoll
+peer poll exponent (log2 s) (3\-17)
+.It Ic headway
+headway (see
+.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" )
+.It Ic flash
+.Lk decode.html#flash "flash status word"
+.It Ic offset
+filter offset
+.It Ic delay
+filter delay
+.It Ic dispersion
+filter dispersion
+.It Ic jitter
+filter jitter
+.It Ic ident
+Autokey group name for this association
+.It Ic bias
+unicast/broadcast bias
+.It Ic xleave
+interleave delay (see
+.Lk xleave.html "NTP Interleaved Modes" )
+.El
+The
+.Ic bias
+variable is calculated when the first broadcast packet is received
+after the calibration volley.
+It represents the offset of the broadcast subgraph relative to the unicast subgraph.
+The
+.Ic xleave
+variable appears only for the interleaved symmetric and interleaved modes.
+It represents the internal queuing, buffering and transmission delays
+for the preceding packet.
+.Pp
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic flags
+peer flags (see Autokey specification)
+.It Ic host
+Autokey server name
+.It Ic flags
+peer flags (see Autokey specification)
+.It Ic signature
+OpenSSL digest/signature scheme
+.It Ic initsequence
+initial key ID
+.It Ic initkey
+initial key index
+.It Ic timestamp
+Autokey signature timestamp
+.El
+.Ss Clock Variables
+The following clock variables appear in the
+.Ic cv
+billboard for each association with a reference clock.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic associd
+association ID
+.It Ic status
+.Lk decode.html#clock "clock status word"
+.It Ic device
+device description
+.It Ic timecode
+ASCII time code string (specific to device)
+.It Ic poll
+poll messages sent
+.It Ic noreply
+no reply
+.It Ic badformat
+bad format
+.It Ic baddata
+bad date or time
+.It Ic fudgetime1
+fudge time 1
+.It Ic fudgetime2
+fudge time 2
+.It Ic stratum
+driver stratum
+.It Ic refid
+driver reference ID
+.It Ic flags
+driver flags
+.El
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl i , Fl \-interactive
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, peers.
+.sp
+Force \fBntpq\fP to operate in interactive mode.
+Prompts will be written to the standard output and
+commands read from the standard input.
+.It Fl n , Fl \-numeric
+numeric host addresses.
+.sp
+Output all host addresses in dotted\-quad numeric format rather than
+converting to the canonical host names.
+.It Fl \-old\-rv
+Always output status line with readvar.
+.sp
+By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
+line that precedes the output of \fBreadvar\fP
+(alias \fBrv\fP) when a single variable is requested, such as
+\fBntpq \-c "rv 0 offset"\fP.
+This option causes \fBntpq\fP to include both lines of output
+for a single\-variable \fBreadvar\fP.
+Using an environment variable to
+preset this option in a script will enable both older and
+newer \fBntpq\fP to behave identically in this regard.
+.It Fl p , Fl \-peers
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+interactive.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.It Fl w , Fl \-wide
+Display the full 'remote' value.
+.sp
+Display the full value of the 'remote' value. If this requires
+more than 15 characters, display the full value, emit a newline,
+and continue the data display properly indented on the next line.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP
+option definitions.
diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c
new file mode 100644
index 0000000..2ffdfc7
--- /dev/null
+++ b/ntpq/ntpq.c
@@ -0,0 +1,3415 @@
+/*
+ * ntpq - query an NTP server using mode 6 commands
+ */
+#include <config.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+#include <setjmp.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#ifdef SYS_WINNT
+# include <mswsock.h>
+#endif
+#include <isc/net.h>
+#include <isc/result.h>
+
+#include "ntpq.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "ntp_calendar.h"
+#include "ntp_select.h"
+#include "ntp_assert.h"
+#include "lib_strbuf.h"
+#include "ntp_lineedit.h"
+#include "ntp_debug.h"
+#ifdef OPENSSL
+#include "openssl/evp.h"
+#include "openssl/objects.h"
+#endif
+#include <ssl_applink.c>
+
+#include "ntp_libopts.h"
+#include "ntpq-opts.h"
+
+
+#ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/
+# define open(name, flags) open(name, flags, 0777)
+# define SERVER_PORT_NUM 123
+#endif
+
+/* we use COMMAND as an autogen keyword */
+#ifdef COMMAND
+# undef COMMAND
+#endif
+
+/*
+ * Because we potentially understand a lot of commands we will run
+ * interactive if connected to a terminal.
+ */
+int interactive = 0; /* set to 1 when we should prompt */
+const char *prompt = "ntpq> "; /* prompt to ask him about */
+
+/*
+ * use old readvars behavior? --old-rv processing in ntpq resets
+ * this value based on the presence or absence of --old-rv. It is
+ * initialized to 1 here to maintain backward compatibility with
+ * libntpq clients such as ntpsnmpd, which are free to reset it as
+ * desired.
+ */
+int old_rv = 1;
+
+
+/*
+ * for get_systime()
+ */
+s_char sys_precision; /* local clock precision (log2 s) */
+
+/*
+ * Keyid used for authenticated requests. Obtained on the fly.
+ */
+u_long info_auth_keyid = 0;
+
+static int info_auth_keytype = NID_md5; /* MD5 */
+static size_t info_auth_hashlen = 16; /* MD5 */
+u_long current_time; /* needed by authkeys; not used */
+
+/*
+ * Flag which indicates we should always send authenticated requests
+ */
+int always_auth = 0;
+
+/*
+ * Flag which indicates raw mode output.
+ */
+int rawmode = 0;
+
+/*
+ * Packet version number we use
+ */
+u_char pktversion = NTP_OLDVERSION + 1;
+
+/*
+ * Don't jump if no set jmp.
+ */
+volatile int jump = 0;
+
+/*
+ * Format values
+ */
+#define PADDING 0
+#define HA 1 /* host address */
+#define NA 2 /* network address */
+#define LP 3 /* leap (print in binary) */
+#define RF 4 /* refid (sometimes string, sometimes not) */
+#define AR 5 /* array of times */
+#define FX 6 /* test flags */
+#define TS 7 /* l_fp timestamp in hex */
+#define OC 8 /* integer, print in octal */
+#define EOV 255 /* end of table */
+
+/*
+ * For the most part ntpq simply displays what ntpd provides in the
+ * mostly plain-text mode 6 responses. A few variable names are by
+ * default "cooked" to provide more human-friendly output.
+ */
+const var_format cookedvars[] = {
+ { "leap", LP },
+ { "reach", OC },
+ { "refid", RF },
+ { "reftime", TS },
+ { "clock", TS },
+ { "org", TS },
+ { "rec", TS },
+ { "xmt", TS },
+ { "flash", FX },
+ { "srcadr", HA },
+ { "peeradr", HA }, /* compat with others */
+ { "dstadr", NA },
+ { "filtdelay", AR },
+ { "filtoffset", AR },
+ { "filtdisp", AR },
+ { "filterror", AR }, /* compat with others */
+};
+
+
+
+/*
+ * flasher bits
+ */
+static const char *tstflagnames[] = {
+ "pkt_dup", /* TEST1 */
+ "pkt_bogus", /* TEST2 */
+ "pkt_unsync", /* TEST3 */
+ "pkt_denied", /* TEST4 */
+ "pkt_auth", /* TEST5 */
+ "pkt_stratum", /* TEST6 */
+ "pkt_header", /* TEST7 */
+ "pkt_autokey", /* TEST8 */
+ "pkt_crypto", /* TEST9 */
+ "peer_stratum", /* TEST10 */
+ "peer_dist", /* TEST11 */
+ "peer_loop", /* TEST12 */
+ "peer_unreach" /* TEST13 */
+};
+
+
+int ntpqmain (int, char **);
+/*
+ * Built in command handler declarations
+ */
+static int openhost (const char *, int);
+static void dump_hex_printable(const void *, size_t);
+static int sendpkt (void *, size_t);
+static int getresponse (int, int, u_short *, int *, const char **, int);
+static int sendrequest (int, associd_t, int, int, const char *);
+static char * tstflags (u_long);
+#ifndef BUILD_AS_LIB
+static void getcmds (void);
+#ifndef SYS_WINNT
+static RETSIGTYPE abortcmd (int);
+#endif /* SYS_WINNT */
+static void docmd (const char *);
+static void tokenize (const char *, char **, int *);
+static int getarg (const char *, int, arg_v *);
+#endif /* BUILD_AS_LIB */
+static int findcmd (const char *, struct xcmd *,
+ struct xcmd *, struct xcmd **);
+static int rtdatetolfp (char *, l_fp *);
+static int decodearr (char *, int *, l_fp *);
+static void help (struct parse *, FILE *);
+static int helpsort (const void *, const void *);
+static void printusage (struct xcmd *, FILE *);
+static void timeout (struct parse *, FILE *);
+static void auth_delay (struct parse *, FILE *);
+static void host (struct parse *, FILE *);
+static void ntp_poll (struct parse *, FILE *);
+static void keyid (struct parse *, FILE *);
+static void keytype (struct parse *, FILE *);
+static void passwd (struct parse *, FILE *);
+static void hostnames (struct parse *, FILE *);
+static void setdebug (struct parse *, FILE *);
+static void quit (struct parse *, FILE *);
+static void version (struct parse *, FILE *);
+static void raw (struct parse *, FILE *);
+static void cooked (struct parse *, FILE *);
+static void authenticate (struct parse *, FILE *);
+static void ntpversion (struct parse *, FILE *);
+static void warning (const char *, const char *, const char *);
+static void error (const char *, const char *, const char *);
+static u_long getkeyid (const char *);
+static void atoascii (const char *, size_t, char *, size_t);
+static void cookedprint (int, int, const char *, int, int, FILE *);
+static void rawprint (int, int, const char *, int, int, FILE *);
+static void startoutput (void);
+static void output (FILE *, const char *, const char *);
+static void endoutput (FILE *);
+static void outputarr (FILE *, char *, int, l_fp *);
+static int assoccmp (const void *, const void *);
+ u_short varfmt (const char *);
+
+void ntpq_custom_opt_handler (tOptions *, tOptDesc *);
+
+
+/*
+ * Built-in commands we understand
+ */
+struct xcmd builtins[] = {
+ { "?", help, { OPT|NTP_STR, NO, NO, NO },
+ { "command", "", "", "" },
+ "tell the use and syntax of commands" },
+ { "help", help, { OPT|NTP_STR, NO, NO, NO },
+ { "command", "", "", "" },
+ "tell the use and syntax of commands" },
+ { "timeout", timeout, { OPT|NTP_UINT, NO, NO, NO },
+ { "msec", "", "", "" },
+ "set the primary receive time out" },
+ { "delay", auth_delay, { OPT|NTP_INT, NO, NO, NO },
+ { "msec", "", "", "" },
+ "set the delay added to encryption time stamps" },
+ { "host", host, { OPT|NTP_STR, OPT|NTP_STR, NO, NO },
+ { "-4|-6", "hostname", "", "" },
+ "specify the host whose NTP server we talk to" },
+ { "poll", ntp_poll, { OPT|NTP_UINT, OPT|NTP_STR, NO, NO },
+ { "n", "verbose", "", "" },
+ "poll an NTP server in client mode `n' times" },
+ { "passwd", passwd, { OPT|NTP_STR, NO, NO, NO },
+ { "", "", "", "" },
+ "specify a password to use for authenticated requests"},
+ { "hostnames", hostnames, { OPT|NTP_STR, NO, NO, NO },
+ { "yes|no", "", "", "" },
+ "specify whether hostnames or net numbers are printed"},
+ { "debug", setdebug, { OPT|NTP_STR, NO, NO, NO },
+ { "no|more|less", "", "", "" },
+ "set/change debugging level" },
+ { "quit", quit, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "exit ntpq" },
+ { "exit", quit, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "exit ntpq" },
+ { "keyid", keyid, { OPT|NTP_UINT, NO, NO, NO },
+ { "key#", "", "", "" },
+ "set keyid to use for authenticated requests" },
+ { "version", version, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "print version number" },
+ { "raw", raw, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "do raw mode variable output" },
+ { "cooked", cooked, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "do cooked mode variable output" },
+ { "authenticate", authenticate, { OPT|NTP_STR, NO, NO, NO },
+ { "yes|no", "", "", "" },
+ "always authenticate requests to this server" },
+ { "ntpversion", ntpversion, { OPT|NTP_UINT, NO, NO, NO },
+ { "version number", "", "", "" },
+ "set the NTP version number to use for requests" },
+ { "keytype", keytype, { OPT|NTP_STR, NO, NO, NO },
+ { "key type (md5|des)", "", "", "" },
+ "set key type to use for authenticated requests (des|md5)" },
+ { 0, 0, { NO, NO, NO, NO },
+ { "", "", "", "" }, "" }
+};
+
+
+/*
+ * Default values we use.
+ */
+#define DEFHOST "localhost" /* default host name */
+#define DEFTIMEOUT 5 /* wait 5 seconds for 1st pkt */
+#define DEFSTIMEOUT 3 /* and 3 more for each additional */
+/*
+ * Requests are automatically retried once, so total timeout with no
+ * response is a bit over 2 * DEFTIMEOUT, or 10 seconds. At the other
+ * extreme, a request eliciting 32 packets of responses each for some
+ * reason nearly DEFSTIMEOUT seconds after the prior in that series,
+ * with a single packet dropped, would take around 32 * DEFSTIMEOUT, or
+ * 93 seconds to fail each of two times, or 186 seconds.
+ * Some commands involve a series of requests, such as "peers" and
+ * "mrulist", so the cumulative timeouts are even longer for those.
+ */
+#define DEFDELAY 0x51EB852 /* 20 milliseconds, l_fp fraction */
+#define LENHOSTNAME 256 /* host name is 256 characters long */
+#define MAXCMDS 100 /* maximum commands on cmd line */
+#define MAXHOSTS 200 /* maximum hosts on cmd line */
+#define MAXLINE 512 /* maximum line length */
+#define MAXTOKENS (1+MAXARGS+2) /* maximum number of usable tokens */
+#define MAXVARLEN 256 /* maximum length of a variable name */
+#define MAXVALLEN 2048 /* maximum length of a variable value */
+#define MAXOUTLINE 72 /* maximum length of an output line */
+#define SCREENWIDTH 76 /* nominal screen width in columns */
+
+/*
+ * Some variables used and manipulated locally
+ */
+struct sock_timeval tvout = { DEFTIMEOUT, 0 }; /* time out for reads */
+struct sock_timeval tvsout = { DEFSTIMEOUT, 0 };/* secondary time out */
+l_fp delay_time; /* delay time */
+char currenthost[LENHOSTNAME]; /* current host name */
+int currenthostisnum; /* is prior text from IP? */
+struct sockaddr_in hostaddr = { 0 }; /* host address */
+int showhostnames = 1; /* show host names by default */
+int wideremote = 0; /* show wide remote names? */
+
+int ai_fam_templ; /* address family */
+int ai_fam_default; /* default address family */
+SOCKET sockfd; /* fd socket is opened on */
+int havehost = 0; /* set to 1 when host open */
+int s_port = 0;
+struct servent *server_entry = NULL; /* server entry for ntp */
+
+
+/*
+ * Sequence number used for requests. It is incremented before
+ * it is used.
+ */
+u_short sequence;
+
+/*
+ * Holds data returned from queries. Declare buffer long to be sure of
+ * alignment.
+ */
+#define DATASIZE (MAXFRAGS*480) /* maximum amount of data */
+long pktdata[DATASIZE/sizeof(long)];
+
+/*
+ * assoc_cache[] is a dynamic array which allows references to
+ * associations using &1 ... &N for n associations, avoiding manual
+ * lookup of the current association IDs for a given ntpd. It also
+ * caches the status word for each association, retrieved incidentally.
+ */
+struct association * assoc_cache;
+u_int assoc_cache_slots;/* count of allocated array entries */
+u_int numassoc; /* number of cached associations */
+
+/*
+ * For commands typed on the command line (with the -c option)
+ */
+int numcmds = 0;
+const char *ccmds[MAXCMDS];
+#define ADDCMD(cp) if (numcmds < MAXCMDS) ccmds[numcmds++] = (cp)
+
+/*
+ * When multiple hosts are specified.
+ */
+
+u_int numhosts;
+
+chost chosts[MAXHOSTS];
+#define ADDHOST(cp) \
+ do { \
+ if (numhosts < MAXHOSTS) { \
+ chosts[numhosts].name = (cp); \
+ chosts[numhosts].fam = ai_fam_templ; \
+ numhosts++; \
+ } \
+ } while (0)
+
+/*
+ * Macro definitions we use
+ */
+#define ISSPACE(c) ((c) == ' ' || (c) == '\t')
+#define ISEOL(c) ((c) == '\n' || (c) == '\r' || (c) == '\0')
+#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
+
+/*
+ * Jump buffer for longjumping back to the command level
+ */
+jmp_buf interrupt_buf;
+
+/*
+ * Points at file being currently printed into
+ */
+FILE *current_output;
+
+/*
+ * Command table imported from ntpdc_ops.c
+ */
+extern struct xcmd opcmds[];
+
+char *progname;
+
+#ifdef NO_MAIN_ALLOWED
+#ifndef BUILD_AS_LIB
+CALL(ntpq,"ntpq",ntpqmain);
+
+void clear_globals(void)
+{
+ extern int ntp_optind;
+ showhostnames = 0; /* don'tshow host names by default */
+ ntp_optind = 0;
+ server_entry = NULL; /* server entry for ntp */
+ havehost = 0; /* set to 1 when host open */
+ numassoc = 0; /* number of cached associations */
+ numcmds = 0;
+ numhosts = 0;
+}
+#endif /* !BUILD_AS_LIB */
+#endif /* NO_MAIN_ALLOWED */
+
+/*
+ * main - parse arguments and handle options
+ */
+#ifndef NO_MAIN_ALLOWED
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ return ntpqmain(argc, argv);
+}
+#endif
+
+#ifndef BUILD_AS_LIB
+int
+ntpqmain(
+ int argc,
+ char *argv[]
+ )
+{
+ u_int ihost;
+ int icmd;
+
+
+#ifdef SYS_VXWORKS
+ clear_globals();
+ taskPrioritySet(taskIdSelf(), 100 );
+#endif
+
+ delay_time.l_ui = 0;
+ delay_time.l_uf = DEFDELAY;
+
+ init_lib(); /* sets up ipv4_works, ipv6_works */
+ ssl_applink();
+ init_auth();
+
+ /* Check to see if we have IPv6. Otherwise default to IPv4 */
+ if (!ipv6_works)
+ ai_fam_default = AF_INET;
+
+ progname = argv[0];
+
+ {
+ int optct = ntpOptionProcess(&ntpqOptions, argc, argv);
+ argc -= optct;
+ argv += optct;
+ }
+
+ /*
+ * Process options other than -c and -p, which are specially
+ * handled by ntpq_custom_opt_handler().
+ */
+
+ debug = OPT_VALUE_SET_DEBUG_LEVEL;
+
+ if (HAVE_OPT(IPV4))
+ ai_fam_templ = AF_INET;
+ else if (HAVE_OPT(IPV6))
+ ai_fam_templ = AF_INET6;
+ else
+ ai_fam_templ = ai_fam_default;
+
+ if (HAVE_OPT(INTERACTIVE))
+ interactive = 1;
+
+ if (HAVE_OPT(NUMERIC))
+ showhostnames = 0;
+
+ if (HAVE_OPT(WIDE))
+ wideremote = 1;
+
+ old_rv = HAVE_OPT(OLD_RV);
+
+ if (0 == argc) {
+ ADDHOST(DEFHOST);
+ } else {
+ for (ihost = 0; ihost < (u_int)argc; ihost++) {
+ if ('-' == *argv[ihost]) {
+ //
+ // If I really cared I'd also check:
+ // 0 == argv[ihost][2]
+ //
+ // and there are other cases as well...
+ //
+ if ('4' == argv[ihost][1]) {
+ ai_fam_templ = AF_INET;
+ continue;
+ } else if ('6' == argv[ihost][1]) {
+ ai_fam_templ = AF_INET6;
+ continue;
+ } else {
+ // XXX Throw a usage error
+ }
+ }
+ ADDHOST(argv[ihost]);
+ }
+ }
+
+ if (numcmds == 0 && interactive == 0
+ && isatty(fileno(stdin)) && isatty(fileno(stderr))) {
+ interactive = 1;
+ }
+
+#ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */
+ if (interactive)
+ (void) signal_no_reset(SIGINT, abortcmd);
+#endif /* SYS_WINNT */
+
+ if (numcmds == 0) {
+ (void) openhost(chosts[0].name, chosts[0].fam);
+ getcmds();
+ } else {
+ for (ihost = 0; ihost < numhosts; ihost++) {
+ if (openhost(chosts[ihost].name, chosts[ihost].fam))
+ for (icmd = 0; icmd < numcmds; icmd++)
+ docmd(ccmds[icmd]);
+ }
+ }
+#ifdef SYS_WINNT
+ WSACleanup();
+#endif /* SYS_WINNT */
+ return 0;
+}
+#endif /* !BUILD_AS_LIB */
+
+/*
+ * openhost - open a socket to a host
+ */
+static int
+openhost(
+ const char *hname,
+ int fam
+ )
+{
+ const char svc[] = "ntp";
+ char temphost[LENHOSTNAME];
+ int a_info, i;
+ struct addrinfo hints, *ai;
+ sockaddr_u addr;
+ size_t octets;
+ register const char *cp;
+ char name[LENHOSTNAME];
+
+ /*
+ * We need to get by the [] if they were entered
+ */
+
+ cp = hname;
+
+ if (*cp == '[') {
+ cp++;
+ for (i = 0; *cp && *cp != ']'; cp++, i++)
+ name[i] = *cp;
+ if (*cp == ']') {
+ name[i] = '\0';
+ hname = name;
+ } else {
+ return 0;
+ }
+ }
+
+ /*
+ * First try to resolve it as an ip address and if that fails,
+ * do a fullblown (dns) lookup. That way we only use the dns
+ * when it is needed and work around some implementations that
+ * will return an "IPv4-mapped IPv6 address" address if you
+ * give it an IPv4 address to lookup.
+ */
+ ZERO(hints);
+ hints.ai_family = fam;
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = Z_AI_NUMERICHOST;
+ ai = NULL;
+
+ a_info = getaddrinfo(hname, svc, &hints, &ai);
+ if (a_info == EAI_NONAME
+#ifdef EAI_NODATA
+ || a_info == EAI_NODATA
+#endif
+ ) {
+ hints.ai_flags = AI_CANONNAME;
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+ a_info = getaddrinfo(hname, svc, &hints, &ai);
+ }
+#ifdef AI_ADDRCONFIG
+ /* Some older implementations don't like AI_ADDRCONFIG. */
+ if (a_info == EAI_BADFLAGS) {
+ hints.ai_flags &= ~AI_ADDRCONFIG;
+ a_info = getaddrinfo(hname, svc, &hints, &ai);
+ }
+#endif
+ if (a_info != 0) {
+ fprintf(stderr, "%s\n", gai_strerror(a_info));
+ return 0;
+ }
+
+ INSIST(ai != NULL);
+ ZERO(addr);
+ octets = min(sizeof(addr), ai->ai_addrlen);
+ memcpy(&addr, ai->ai_addr, octets);
+
+ if (ai->ai_canonname == NULL) {
+ strlcpy(temphost, stoa(&addr), sizeof(temphost));
+ currenthostisnum = TRUE;
+ } else {
+ strlcpy(temphost, ai->ai_canonname, sizeof(temphost));
+ currenthostisnum = FALSE;
+ }
+
+ if (debug > 2)
+ printf("Opening host %s (%s)\n",
+ temphost,
+ (ai->ai_family == AF_INET)
+ ? "AF_INET"
+ : (ai->ai_family == AF_INET6)
+ ? "AF_INET6"
+ : "AF-???"
+ );
+
+ if (havehost == 1) {
+ if (debug > 2)
+ printf("Closing old host %s\n", currenthost);
+ closesocket(sockfd);
+ havehost = 0;
+ }
+ strlcpy(currenthost, temphost, sizeof(currenthost));
+
+ /* port maps to the same location in both families */
+ s_port = NSRCPORT(&addr);
+#ifdef SYS_VXWORKS
+ ((struct sockaddr_in6 *)&hostaddr)->sin6_port = htons(SERVER_PORT_NUM);
+ if (ai->ai_family == AF_INET)
+ *(struct sockaddr_in *)&hostaddr=
+ *((struct sockaddr_in *)ai->ai_addr);
+ else
+ *(struct sockaddr_in6 *)&hostaddr=
+ *((struct sockaddr_in6 *)ai->ai_addr);
+#endif /* SYS_VXWORKS */
+
+#ifdef SYS_WINNT
+ {
+ int optionValue = SO_SYNCHRONOUS_NONALERT;
+ int err;
+
+ err = setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
+ (char *)&optionValue, sizeof(optionValue));
+ if (err) {
+ mfprintf(stderr,
+ "setsockopt(SO_SYNCHRONOUS_NONALERT)"
+ " error: %m\n");
+ freeaddrinfo(ai);
+ exit(1);
+ }
+ }
+#endif /* SYS_WINNT */
+
+ sockfd = socket(ai->ai_family, ai->ai_socktype,
+ ai->ai_protocol);
+ if (sockfd == INVALID_SOCKET) {
+ error("socket", "", "");
+ freeaddrinfo(ai);
+ return 0;
+ }
+
+
+#ifdef NEED_RCVBUF_SLOP
+# ifdef SO_RCVBUF
+ { int rbufsize = DATASIZE + 2048; /* 2K for slop */
+ if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
+ &rbufsize, sizeof(int)) == -1)
+ error("setsockopt", "", "");
+ }
+# endif
+#endif
+
+ if
+#ifdef SYS_VXWORKS
+ (connect(sockfd, (struct sockaddr *)&hostaddr,
+ sizeof(hostaddr)) == -1)
+#else
+ (connect(sockfd, (struct sockaddr *)ai->ai_addr,
+ ai->ai_addrlen) == -1)
+#endif /* SYS_VXWORKS */
+ {
+ error("connect", "", "");
+ freeaddrinfo(ai);
+ return 0;
+ }
+ freeaddrinfo(ai);
+ havehost = 1;
+ numassoc = 0;
+
+ return 1;
+}
+
+
+static void
+dump_hex_printable(
+ const void * data,
+ size_t len
+ )
+{
+ const char * cdata;
+ const char * rowstart;
+ size_t idx;
+ size_t rowlen;
+ u_char uch;
+
+ cdata = data;
+ while (len > 0) {
+ rowstart = cdata;
+ rowlen = min(16, len);
+ for (idx = 0; idx < rowlen; idx++) {
+ uch = *(cdata++);
+ printf("%02x ", uch);
+ }
+ for ( ; idx < 16 ; idx++)
+ printf(" ");
+ cdata = rowstart;
+ for (idx = 0; idx < rowlen; idx++) {
+ uch = *(cdata++);
+ printf("%c", (isprint(uch))
+ ? uch
+ : '.');
+ }
+ printf("\n");
+ len -= rowlen;
+ }
+}
+
+
+/* XXX ELIMINATE sendpkt similar in ntpq.c, ntpdc.c, ntp_io.c, ntptrace.c */
+/*
+ * sendpkt - send a packet to the remote host
+ */
+static int
+sendpkt(
+ void * xdata,
+ size_t xdatalen
+ )
+{
+ if (debug >= 3)
+ printf("Sending %lu octets\n", (u_long)xdatalen);
+
+ if (send(sockfd, xdata, (size_t)xdatalen, 0) == -1) {
+ warning("write to %s failed", currenthost, "");
+ return -1;
+ }
+
+ if (debug >= 4) {
+ printf("Request packet:\n");
+ dump_hex_printable(xdata, xdatalen);
+ }
+ return 0;
+}
+
+/*
+ * getresponse - get a (series of) response packet(s) and return the data
+ */
+static int
+getresponse(
+ int opcode,
+ int associd,
+ u_short *rstatus,
+ int *rsize,
+ const char **rdata,
+ int timeo
+ )
+{
+ struct ntp_control rpkt;
+ struct sock_timeval tvo;
+ u_short offsets[MAXFRAGS+1];
+ u_short counts[MAXFRAGS+1];
+ u_short offset;
+ u_short count;
+ size_t numfrags;
+ size_t f;
+ size_t ff;
+ int seenlastfrag;
+ int shouldbesize;
+ fd_set fds;
+ int n;
+ int errcode;
+
+ /*
+ * This is pretty tricky. We may get between 1 and MAXFRAG packets
+ * back in response to the request. We peel the data out of
+ * each packet and collect it in one long block. When the last
+ * packet in the sequence is received we'll know how much data we
+ * should have had. Note we use one long time out, should reconsider.
+ */
+ *rsize = 0;
+ if (rstatus)
+ *rstatus = 0;
+ *rdata = (char *)pktdata;
+
+ numfrags = 0;
+ seenlastfrag = 0;
+
+ FD_ZERO(&fds);
+
+ /*
+ * Loop until we have an error or a complete response. Nearly all
+ * code paths to loop again use continue.
+ */
+ for (;;) {
+
+ if (numfrags == 0)
+ tvo = tvout;
+ else
+ tvo = tvsout;
+
+ FD_SET(sockfd, &fds);
+ n = select(sockfd + 1, &fds, NULL, NULL, &tvo);
+
+ if (n == -1) {
+ warning("select fails", "", "");
+ return -1;
+ }
+ if (n == 0) {
+ /*
+ * Timed out. Return what we have
+ */
+ if (numfrags == 0) {
+ if (timeo)
+ fprintf(stderr,
+ "%s: timed out, nothing received\n",
+ currenthost);
+ return ERR_TIMEOUT;
+ }
+ if (timeo)
+ fprintf(stderr,
+ "%s: timed out with incomplete data\n",
+ currenthost);
+ if (debug) {
+ fprintf(stderr,
+ "ERR_INCOMPLETE: Received fragments:\n");
+ for (f = 0; f < numfrags; f++)
+ fprintf(stderr,
+ "%2u: %5d %5d\t%3d octets\n",
+ (u_int)f, offsets[f],
+ offsets[f] +
+ counts[f],
+ counts[f]);
+ fprintf(stderr,
+ "last fragment %sreceived\n",
+ (seenlastfrag)
+ ? ""
+ : "not ");
+ }
+ return ERR_INCOMPLETE;
+ }
+
+ n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0);
+ if (n == -1) {
+ warning("read", "", "");
+ return -1;
+ }
+
+ if (debug >= 4) {
+ printf("Response packet:\n");
+ dump_hex_printable(&rpkt, n);
+ }
+
+ /*
+ * Check for format errors. Bug proofing.
+ */
+ if (n < CTL_HEADER_LEN) {
+ if (debug)
+ printf("Short (%d byte) packet received\n", n);
+ continue;
+ }
+ if (PKT_VERSION(rpkt.li_vn_mode) > NTP_VERSION
+ || PKT_VERSION(rpkt.li_vn_mode) < NTP_OLDVERSION) {
+ if (debug)
+ printf("Packet received with version %d\n",
+ PKT_VERSION(rpkt.li_vn_mode));
+ continue;
+ }
+ if (PKT_MODE(rpkt.li_vn_mode) != MODE_CONTROL) {
+ if (debug)
+ printf("Packet received with mode %d\n",
+ PKT_MODE(rpkt.li_vn_mode));
+ continue;
+ }
+ if (!CTL_ISRESPONSE(rpkt.r_m_e_op)) {
+ if (debug)
+ printf("Received request packet, wanted response\n");
+ continue;
+ }
+
+ /*
+ * Check opcode and sequence number for a match.
+ * Could be old data getting to us.
+ */
+ if (ntohs(rpkt.sequence) != sequence) {
+ if (debug)
+ printf("Received sequnce number %d, wanted %d\n",
+ ntohs(rpkt.sequence), sequence);
+ continue;
+ }
+ if (CTL_OP(rpkt.r_m_e_op) != opcode) {
+ if (debug)
+ printf(
+ "Received opcode %d, wanted %d (sequence number okay)\n",
+ CTL_OP(rpkt.r_m_e_op), opcode);
+ continue;
+ }
+
+ /*
+ * Check the error code. If non-zero, return it.
+ */
+ if (CTL_ISERROR(rpkt.r_m_e_op)) {
+ errcode = (ntohs(rpkt.status) >> 8) & 0xff;
+ if (CTL_ISMORE(rpkt.r_m_e_op))
+ TRACE(1, ("Error code %d received on not-final packet\n",
+ errcode));
+ if (errcode == CERR_UNSPEC)
+ return ERR_UNSPEC;
+ return errcode;
+ }
+
+ /*
+ * Check the association ID to make sure it matches what
+ * we sent.
+ */
+ if (ntohs(rpkt.associd) != associd) {
+ TRACE(1, ("Association ID %d doesn't match expected %d\n",
+ ntohs(rpkt.associd), associd));
+ /*
+ * Hack for silly fuzzballs which, at the time of writing,
+ * return an assID of sys.peer when queried for system variables.
+ */
+#ifdef notdef
+ continue;
+#endif
+ }
+
+ /*
+ * Collect offset and count. Make sure they make sense.
+ */
+ offset = ntohs(rpkt.offset);
+ count = ntohs(rpkt.count);
+
+ /*
+ * validate received payload size is padded to next 32-bit
+ * boundary and no smaller than claimed by rpkt.count
+ */
+ if (n & 0x3) {
+ TRACE(1, ("Response packet not padded, size = %d\n",
+ n));
+ continue;
+ }
+
+ shouldbesize = (CTL_HEADER_LEN + count + 3) & ~3;
+
+ if (n < shouldbesize) {
+ printf("Response packet claims %u octets payload, above %ld received\n",
+ count, (long)n - CTL_HEADER_LEN);
+ return ERR_INCOMPLETE;
+ }
+
+ if (debug >= 3 && shouldbesize > n) {
+ u_int32 key;
+ u_int32 *lpkt;
+ int maclen;
+
+ /*
+ * Usually we ignore authentication, but for debugging purposes
+ * we watch it here.
+ */
+ /* round to 8 octet boundary */
+ shouldbesize = (shouldbesize + 7) & ~7;
+
+ maclen = n - shouldbesize;
+ if (maclen >= MIN_MAC_LEN) {
+ printf(
+ "Packet shows signs of authentication (total %d, data %d, mac %d)\n",
+ n, shouldbesize, maclen);
+ lpkt = (u_int32 *)&rpkt;
+ printf("%08lx %08lx %08lx %08lx %08lx %08lx\n",
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 3]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 2]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) - 1]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32)]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) + 1]),
+ (u_long)ntohl(lpkt[(n - maclen)/sizeof(u_int32) + 2]));
+ key = ntohl(lpkt[(n - maclen) / sizeof(u_int32)]);
+ printf("Authenticated with keyid %lu\n", (u_long)key);
+ if (key != 0 && key != info_auth_keyid) {
+ printf("We don't know that key\n");
+ } else {
+ if (authdecrypt(key, (u_int32 *)&rpkt,
+ n - maclen, maclen)) {
+ printf("Auth okay!\n");
+ } else {
+ printf("Auth failed!\n");
+ }
+ }
+ }
+ }
+
+ TRACE(2, ("Got packet, size = %d\n", n));
+ if (count > (n - CTL_HEADER_LEN)) {
+ TRACE(1, ("Received count of %u octets, data in packet is %ld\n",
+ count, (long)n - CTL_HEADER_LEN));
+ continue;
+ }
+ if (count == 0 && CTL_ISMORE(rpkt.r_m_e_op)) {
+ TRACE(1, ("Received count of 0 in non-final fragment\n"));
+ continue;
+ }
+ if (offset + count > sizeof(pktdata)) {
+ TRACE(1, ("Offset %u, count %u, too big for buffer\n",
+ offset, count));
+ return ERR_TOOMUCH;
+ }
+ if (seenlastfrag && !CTL_ISMORE(rpkt.r_m_e_op)) {
+ TRACE(1, ("Received second last fragment packet\n"));
+ continue;
+ }
+
+ /*
+ * So far, so good. Record this fragment, making sure it doesn't
+ * overlap anything.
+ */
+ TRACE(2, ("Packet okay\n"));
+
+ if (numfrags > (MAXFRAGS - 1)) {
+ TRACE(2, ("Number of fragments exceeds maximum %d\n",
+ MAXFRAGS - 1));
+ return ERR_TOOMUCH;
+ }
+
+ /*
+ * Find the position for the fragment relative to any
+ * previously received.
+ */
+ for (f = 0;
+ f < numfrags && offsets[f] < offset;
+ f++) {
+ /* empty body */ ;
+ }
+
+ if (f < numfrags && offset == offsets[f]) {
+ TRACE(1, ("duplicate %u octets at %u ignored, prior %u at %u\n",
+ count, offset, counts[f], offsets[f]));
+ continue;
+ }
+
+ if (f > 0 && (offsets[f-1] + counts[f-1]) > offset) {
+ TRACE(1, ("received frag at %u overlaps with %u octet frag at %u\n",
+ offset, counts[f-1], offsets[f-1]));
+ continue;
+ }
+
+ if (f < numfrags && (offset + count) > offsets[f]) {
+ TRACE(1, ("received %u octet frag at %u overlaps with frag at %u\n",
+ count, offset, offsets[f]));
+ continue;
+ }
+
+ for (ff = numfrags; ff > f; ff--) {
+ offsets[ff] = offsets[ff-1];
+ counts[ff] = counts[ff-1];
+ }
+ offsets[f] = offset;
+ counts[f] = count;
+ numfrags++;
+
+ /*
+ * Got that stuffed in right. Figure out if this was the last.
+ * Record status info out of the last packet.
+ */
+ if (!CTL_ISMORE(rpkt.r_m_e_op)) {
+ seenlastfrag = 1;
+ if (rstatus != 0)
+ *rstatus = ntohs(rpkt.status);
+ }
+
+ /*
+ * Copy the data into the data buffer.
+ */
+ memcpy((char *)pktdata + offset, &rpkt.u, count);
+
+ /*
+ * If we've seen the last fragment, look for holes in the sequence.
+ * If there aren't any, we're done.
+ */
+ if (seenlastfrag && offsets[0] == 0) {
+ for (f = 1; f < numfrags; f++)
+ if (offsets[f-1] + counts[f-1] !=
+ offsets[f])
+ break;
+ if (f == numfrags) {
+ *rsize = offsets[f-1] + counts[f-1];
+ TRACE(1, ("%lu packets reassembled into response\n",
+ (u_long)numfrags));
+ return 0;
+ }
+ }
+ } /* giant for (;;) collecting response packets */
+} /* getresponse() */
+
+
+/*
+ * sendrequest - format and send a request packet
+ */
+static int
+sendrequest(
+ int opcode,
+ associd_t associd,
+ int auth,
+ int qsize,
+ const char *qdata
+ )
+{
+ struct ntp_control qpkt;
+ int pktsize;
+ u_long key_id;
+ char * pass;
+ int maclen;
+
+ /*
+ * Check to make sure the data will fit in one packet
+ */
+ if (qsize > CTL_MAX_DATA_LEN) {
+ fprintf(stderr,
+ "***Internal error! qsize (%d) too large\n",
+ qsize);
+ return 1;
+ }
+
+ /*
+ * Fill in the packet
+ */
+ qpkt.li_vn_mode = PKT_LI_VN_MODE(0, pktversion, MODE_CONTROL);
+ qpkt.r_m_e_op = (u_char)(opcode & CTL_OP_MASK);
+ qpkt.sequence = htons(sequence);
+ qpkt.status = 0;
+ qpkt.associd = htons((u_short)associd);
+ qpkt.offset = 0;
+ qpkt.count = htons((u_short)qsize);
+
+ pktsize = CTL_HEADER_LEN;
+
+ /*
+ * If we have data, copy and pad it out to a 32-bit boundary.
+ */
+ if (qsize > 0) {
+ memcpy(&qpkt.u, qdata, (size_t)qsize);
+ pktsize += qsize;
+ while (pktsize & (sizeof(u_int32) - 1)) {
+ qpkt.u.data[qsize++] = 0;
+ pktsize++;
+ }
+ }
+
+ /*
+ * If it isn't authenticated we can just send it. Otherwise
+ * we're going to have to think about it a little.
+ */
+ if (!auth && !always_auth) {
+ return sendpkt(&qpkt, pktsize);
+ }
+
+ /*
+ * Pad out packet to a multiple of 8 octets to be sure
+ * receiver can handle it.
+ */
+ while (pktsize & 7) {
+ qpkt.u.data[qsize++] = 0;
+ pktsize++;
+ }
+
+ /*
+ * Get the keyid and the password if we don't have one.
+ */
+ if (info_auth_keyid == 0) {
+ key_id = getkeyid("Keyid: ");
+ if (key_id == 0 || key_id > NTP_MAXKEY) {
+ fprintf(stderr,
+ "Invalid key identifier\n");
+ return 1;
+ }
+ info_auth_keyid = key_id;
+ }
+ if (!authistrusted(info_auth_keyid)) {
+ pass = getpass_keytype(info_auth_keytype);
+ if ('\0' == pass[0]) {
+ fprintf(stderr, "Invalid password\n");
+ return 1;
+ }
+ authusekey(info_auth_keyid, info_auth_keytype,
+ (u_char *)pass);
+ authtrust(info_auth_keyid, 1);
+ }
+
+ /*
+ * Do the encryption.
+ */
+ maclen = authencrypt(info_auth_keyid, (void *)&qpkt, pktsize);
+ if (!maclen) {
+ fprintf(stderr, "Key not found\n");
+ return 1;
+ } else if ((size_t)maclen != (info_auth_hashlen + sizeof(keyid_t))) {
+ fprintf(stderr,
+ "%d octet MAC, %lu expected with %lu octet digest\n",
+ maclen, (u_long)(info_auth_hashlen + sizeof(keyid_t)),
+ (u_long)info_auth_hashlen);
+ return 1;
+ }
+
+ return sendpkt((char *)&qpkt, pktsize + maclen);
+}
+
+
+/*
+ * show_error_msg - display the error text for a mode 6 error response.
+ */
+void
+show_error_msg(
+ int m6resp,
+ associd_t associd
+ )
+{
+ if (numhosts > 1)
+ fprintf(stderr, "server=%s ", currenthost);
+
+ switch(m6resp) {
+
+ case CERR_BADFMT:
+ fprintf(stderr,
+ "***Server reports a bad format request packet\n");
+ break;
+
+ case CERR_PERMISSION:
+ fprintf(stderr,
+ "***Server disallowed request (authentication?)\n");
+ break;
+
+ case CERR_BADOP:
+ fprintf(stderr,
+ "***Server reports a bad opcode in request\n");
+ break;
+
+ case CERR_BADASSOC:
+ fprintf(stderr,
+ "***Association ID %d unknown to server\n",
+ associd);
+ break;
+
+ case CERR_UNKNOWNVAR:
+ fprintf(stderr,
+ "***A request variable unknown to the server\n");
+ break;
+
+ case CERR_BADVALUE:
+ fprintf(stderr,
+ "***Server indicates a request variable was bad\n");
+ break;
+
+ case ERR_UNSPEC:
+ fprintf(stderr,
+ "***Server returned an unspecified error\n");
+ break;
+
+ case ERR_TIMEOUT:
+ fprintf(stderr, "***Request timed out\n");
+ break;
+
+ case ERR_INCOMPLETE:
+ fprintf(stderr,
+ "***Response from server was incomplete\n");
+ break;
+
+ case ERR_TOOMUCH:
+ fprintf(stderr,
+ "***Buffer size exceeded for returned data\n");
+ break;
+
+ default:
+ fprintf(stderr,
+ "***Server returns unknown error code %d\n",
+ m6resp);
+ }
+}
+
+/*
+ * doquery - send a request and process the response, displaying
+ * error messages for any error responses.
+ */
+int
+doquery(
+ int opcode,
+ associd_t associd,
+ int auth,
+ int qsize,
+ const char *qdata,
+ u_short *rstatus,
+ int *rsize,
+ const char **rdata
+ )
+{
+ return doqueryex(opcode, associd, auth, qsize, qdata, rstatus,
+ rsize, rdata, FALSE);
+}
+
+
+/*
+ * doqueryex - send a request and process the response, optionally
+ * displaying error messages for any error responses.
+ */
+int
+doqueryex(
+ int opcode,
+ associd_t associd,
+ int auth,
+ int qsize,
+ const char *qdata,
+ u_short *rstatus,
+ int *rsize,
+ const char **rdata,
+ int quiet
+ )
+{
+ int res;
+ int done;
+
+ /*
+ * Check to make sure host is open
+ */
+ if (!havehost) {
+ fprintf(stderr, "***No host open, use `host' command\n");
+ return -1;
+ }
+
+ done = 0;
+ sequence++;
+
+ again:
+ /*
+ * send a request
+ */
+ res = sendrequest(opcode, associd, auth, qsize, qdata);
+ if (res != 0)
+ return res;
+
+ /*
+ * Get the response. If we got a standard error, print a message
+ */
+ res = getresponse(opcode, associd, rstatus, rsize, rdata, done);
+
+ if (res > 0) {
+ if (!done && (res == ERR_TIMEOUT || res == ERR_INCOMPLETE)) {
+ if (res == ERR_INCOMPLETE) {
+ /*
+ * better bump the sequence so we don't
+ * get confused about differing fragments.
+ */
+ sequence++;
+ }
+ done = 1;
+ goto again;
+ }
+ if (!quiet)
+ show_error_msg(res, associd);
+
+ }
+ return res;
+}
+
+
+#ifndef BUILD_AS_LIB
+/*
+ * getcmds - read commands from the standard input and execute them
+ */
+static void
+getcmds(void)
+{
+ char * line;
+ int count;
+
+ ntp_readline_init(interactive ? prompt : NULL);
+
+ for (;;) {
+ line = ntp_readline(&count);
+ if (NULL == line)
+ break;
+ docmd(line);
+ free(line);
+ }
+
+ ntp_readline_uninit();
+}
+#endif /* !BUILD_AS_LIB */
+
+
+#if !defined(SYS_WINNT) && !defined(BUILD_AS_LIB)
+/*
+ * abortcmd - catch interrupts and abort the current command
+ */
+static RETSIGTYPE
+abortcmd(
+ int sig
+ )
+{
+ if (current_output == stdout)
+ (void) fflush(stdout);
+ putc('\n', stderr);
+ (void) fflush(stderr);
+ if (jump) longjmp(interrupt_buf, 1);
+}
+#endif /* !SYS_WINNT && !BUILD_AS_LIB */
+
+
+#ifndef BUILD_AS_LIB
+/*
+ * docmd - decode the command line and execute a command
+ */
+static void
+docmd(
+ const char *cmdline
+ )
+{
+ char *tokens[1+MAXARGS+2];
+ struct parse pcmd;
+ int ntok;
+ static int i;
+ struct xcmd *xcmd;
+
+ /*
+ * Tokenize the command line. If nothing on it, return.
+ */
+ tokenize(cmdline, tokens, &ntok);
+ if (ntok == 0)
+ return;
+
+ /*
+ * Find the appropriate command description.
+ */
+ i = findcmd(tokens[0], builtins, opcmds, &xcmd);
+ if (i == 0) {
+ (void) fprintf(stderr, "***Command `%s' unknown\n",
+ tokens[0]);
+ return;
+ } else if (i >= 2) {
+ (void) fprintf(stderr, "***Command `%s' ambiguous\n",
+ tokens[0]);
+ return;
+ }
+
+ /* Warn about ignored extra args */
+ for (i = MAXARGS + 1; i < ntok ; ++i) {
+ fprintf(stderr, "***Extra arg `%s' ignored\n", tokens[i]);
+ }
+
+ /*
+ * Save the keyword, then walk through the arguments, interpreting
+ * as we go.
+ */
+ pcmd.keyword = tokens[0];
+ pcmd.nargs = 0;
+ for (i = 0; i < MAXARGS && xcmd->arg[i] != NO; i++) {
+ if ((i+1) >= ntok) {
+ if (!(xcmd->arg[i] & OPT)) {
+ printusage(xcmd, stderr);
+ return;
+ }
+ break;
+ }
+ if ((xcmd->arg[i] & OPT) && (*tokens[i+1] == '>'))
+ break;
+ if (!getarg(tokens[i+1], (int)xcmd->arg[i], &pcmd.argval[i]))
+ return;
+ pcmd.nargs++;
+ }
+
+ i++;
+ if (i < ntok && *tokens[i] == '>') {
+ char *fname;
+
+ if (*(tokens[i]+1) != '\0')
+ fname = tokens[i]+1;
+ else if ((i+1) < ntok)
+ fname = tokens[i+1];
+ else {
+ (void) fprintf(stderr, "***No file for redirect\n");
+ return;
+ }
+
+ current_output = fopen(fname, "w");
+ if (current_output == NULL) {
+ (void) fprintf(stderr, "***Error opening %s: ", fname);
+ perror("");
+ return;
+ }
+ i = 1; /* flag we need a close */
+ } else {
+ current_output = stdout;
+ i = 0; /* flag no close */
+ }
+
+ if (interactive && setjmp(interrupt_buf)) {
+ jump = 0;
+ return;
+ } else {
+ jump++;
+ (xcmd->handler)(&pcmd, current_output);
+ jump = 0; /* HMS: 961106: was after fclose() */
+ if (i) (void) fclose(current_output);
+ }
+
+ return;
+}
+
+
+/*
+ * tokenize - turn a command line into tokens
+ *
+ * SK: Modified to allow a quoted string
+ *
+ * HMS: If the first character of the first token is a ':' then (after
+ * eating inter-token whitespace) the 2nd token is the rest of the line.
+ */
+
+static void
+tokenize(
+ const char *line,
+ char **tokens,
+ int *ntok
+ )
+{
+ register const char *cp;
+ register char *sp;
+ static char tspace[MAXLINE];
+
+ sp = tspace;
+ cp = line;
+ for (*ntok = 0; *ntok < MAXTOKENS; (*ntok)++) {
+ tokens[*ntok] = sp;
+
+ /* Skip inter-token whitespace */
+ while (ISSPACE(*cp))
+ cp++;
+
+ /* If we're at EOL we're done */
+ if (ISEOL(*cp))
+ break;
+
+ /* If this is the 2nd token and the first token begins
+ * with a ':', then just grab to EOL.
+ */
+
+ if (*ntok == 1 && tokens[0][0] == ':') {
+ do {
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
+ *sp++ = *cp++;
+ } while (!ISEOL(*cp));
+ }
+
+ /* Check if this token begins with a double quote.
+ * If yes, continue reading till the next double quote
+ */
+ else if (*cp == '\"') {
+ ++cp;
+ do {
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
+ *sp++ = *cp++;
+ } while ((*cp != '\"') && !ISEOL(*cp));
+ /* HMS: a missing closing " should be an error */
+ }
+ else {
+ do {
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
+ *sp++ = *cp++;
+ } while ((*cp != '\"') && !ISSPACE(*cp) && !ISEOL(*cp));
+ /* HMS: Why check for a " in the previous line? */
+ }
+
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
+ *sp++ = '\0';
+ }
+ return;
+
+ toobig:
+ *ntok = 0;
+ fprintf(stderr,
+ "***Line `%s' is too big\n",
+ line);
+ return;
+}
+
+
+/*
+ * getarg - interpret an argument token
+ */
+static int
+getarg(
+ const char *str,
+ int code,
+ arg_v *argp
+ )
+{
+ u_long ul;
+
+ switch (code & ~OPT) {
+ case NTP_STR:
+ argp->string = str;
+ break;
+
+ case NTP_ADD:
+ if (!getnetnum(str, &argp->netnum, NULL, 0))
+ return 0;
+ break;
+
+ case NTP_UINT:
+ if ('&' == str[0]) {
+ if (!atouint(&str[1], &ul)) {
+ fprintf(stderr,
+ "***Association index `%s' invalid/undecodable\n",
+ str);
+ return 0;
+ }
+ if (0 == numassoc) {
+ dogetassoc(stdout);
+ if (0 == numassoc) {
+ fprintf(stderr,
+ "***No associations found, `%s' unknown\n",
+ str);
+ return 0;
+ }
+ }
+ ul = min(ul, numassoc);
+ argp->uval = assoc_cache[ul - 1].assid;
+ break;
+ }
+ if (!atouint(str, &argp->uval)) {
+ fprintf(stderr, "***Illegal unsigned value %s\n",
+ str);
+ return 0;
+ }
+ break;
+
+ case NTP_INT:
+ if (!atoint(str, &argp->ival)) {
+ fprintf(stderr, "***Illegal integer value %s\n",
+ str);
+ return 0;
+ }
+ break;
+
+ case IP_VERSION:
+ if (!strcmp("-6", str)) {
+ argp->ival = 6;
+ } else if (!strcmp("-4", str)) {
+ argp->ival = 4;
+ } else {
+ fprintf(stderr, "***Version must be either 4 or 6\n");
+ return 0;
+ }
+ break;
+ }
+
+ return 1;
+}
+#endif /* !BUILD_AS_LIB */
+
+
+/*
+ * findcmd - find a command in a command description table
+ */
+static int
+findcmd(
+ const char * str,
+ struct xcmd * clist1,
+ struct xcmd * clist2,
+ struct xcmd ** cmd
+ )
+{
+ struct xcmd *cl;
+ int clen;
+ int nmatch;
+ struct xcmd *nearmatch = NULL;
+ struct xcmd *clist;
+
+ clen = strlen(str);
+ nmatch = 0;
+ if (clist1 != 0)
+ clist = clist1;
+ else if (clist2 != 0)
+ clist = clist2;
+ else
+ return 0;
+
+ again:
+ for (cl = clist; cl->keyword != 0; cl++) {
+ /* do a first character check, for efficiency */
+ if (*str != *(cl->keyword))
+ continue;
+ if (strncmp(str, cl->keyword, (unsigned)clen) == 0) {
+ /*
+ * Could be extact match, could be approximate.
+ * Is exact if the length of the keyword is the
+ * same as the str.
+ */
+ if (*((cl->keyword) + clen) == '\0') {
+ *cmd = cl;
+ return 1;
+ }
+ nmatch++;
+ nearmatch = cl;
+ }
+ }
+
+ /*
+ * See if there is more to do. If so, go again. Sorry about the
+ * goto, too much looking at BSD sources...
+ */
+ if (clist == clist1 && clist2 != 0) {
+ clist = clist2;
+ goto again;
+ }
+
+ /*
+ * If we got extactly 1 near match, use it, else return number
+ * of matches.
+ */
+ if (nmatch == 1) {
+ *cmd = nearmatch;
+ return 1;
+ }
+ return nmatch;
+}
+
+
+/*
+ * getnetnum - given a host name, return its net number
+ * and (optional) full name
+ */
+int
+getnetnum(
+ const char *hname,
+ sockaddr_u *num,
+ char *fullhost,
+ int af
+ )
+{
+ struct addrinfo hints, *ai = NULL;
+
+ ZERO(hints);
+ hints.ai_flags = AI_CANONNAME;
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
+
+ /*
+ * decodenetnum only works with addresses, but handles syntax
+ * that getaddrinfo doesn't: [2001::1]:1234
+ */
+ if (decodenetnum(hname, num)) {
+ if (fullhost != NULL)
+ getnameinfo(&num->sa, SOCKLEN(num), fullhost,
+ LENHOSTNAME, NULL, 0, 0);
+ return 1;
+ } else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) {
+ INSIST(sizeof(*num) >= ai->ai_addrlen);
+ memcpy(num, ai->ai_addr, ai->ai_addrlen);
+ if (fullhost != NULL) {
+ if (ai->ai_canonname != NULL)
+ strlcpy(fullhost, ai->ai_canonname,
+ LENHOSTNAME);
+ else
+ getnameinfo(&num->sa, SOCKLEN(num),
+ fullhost, LENHOSTNAME, NULL,
+ 0, 0);
+ }
+ freeaddrinfo(ai);
+ return 1;
+ }
+ fprintf(stderr, "***Can't find host %s\n", hname);
+
+ return 0;
+}
+
+
+/*
+ * nntohost - convert network number to host name. This routine enforces
+ * the showhostnames setting.
+ */
+const char *
+nntohost(
+ sockaddr_u *netnum
+ )
+{
+ return nntohost_col(netnum, LIB_BUFLENGTH - 1, FALSE);
+}
+
+
+/*
+ * nntohost_col - convert network number to host name in fixed width.
+ * This routine enforces the showhostnames setting.
+ * When displaying hostnames longer than the width,
+ * the first part of the hostname is displayed. When
+ * displaying numeric addresses longer than the width,
+ * Such as IPv6 addresses, the caller decides whether
+ * the first or last of the numeric address is used.
+ */
+const char *
+nntohost_col(
+ sockaddr_u * addr,
+ size_t width,
+ int preserve_lowaddrbits
+ )
+{
+ const char * out;
+
+ if (!showhostnames || SOCK_UNSPEC(addr)) {
+ if (preserve_lowaddrbits)
+ out = trunc_left(stoa(addr), width);
+ else
+ out = trunc_right(stoa(addr), width);
+ } else if (ISREFCLOCKADR(addr)) {
+ out = refnumtoa(addr);
+ } else {
+ out = trunc_right(socktohost(addr), width);
+ }
+ return out;
+}
+
+
+/*
+ * nntohostp() is the same as nntohost() plus a :port suffix
+ */
+const char *
+nntohostp(
+ sockaddr_u *netnum
+ )
+{
+ const char * hostn;
+ char * buf;
+
+ if (!showhostnames || SOCK_UNSPEC(netnum))
+ return sptoa(netnum);
+ else if (ISREFCLOCKADR(netnum))
+ return refnumtoa(netnum);
+
+ hostn = socktohost(netnum);
+ LIB_GETBUF(buf);
+ snprintf(buf, LIB_BUFLENGTH, "%s:%u", hostn, SRCPORT(netnum));
+
+ return buf;
+}
+
+/*
+ * rtdatetolfp - decode an RT-11 date into an l_fp
+ */
+static int
+rtdatetolfp(
+ char *str,
+ l_fp *lfp
+ )
+{
+ register char *cp;
+ register int i;
+ struct calendar cal;
+ char buf[4];
+
+ cal.yearday = 0;
+
+ /*
+ * An RT-11 date looks like:
+ *
+ * d[d]-Mth-y[y] hh:mm:ss
+ *
+ * (No docs, but assume 4-digit years are also legal...)
+ *
+ * d[d]-Mth-y[y[y[y]]] hh:mm:ss
+ */
+ cp = str;
+ if (!isdigit((int)*cp)) {
+ if (*cp == '-') {
+ /*
+ * Catch special case
+ */
+ L_CLR(lfp);
+ return 1;
+ }
+ return 0;
+ }
+
+ cal.monthday = (u_char) (*cp++ - '0'); /* ascii dependent */
+ if (isdigit((int)*cp)) {
+ cal.monthday = (u_char)((cal.monthday << 3) + (cal.monthday << 1));
+ cal.monthday = (u_char)(cal.monthday + *cp++ - '0');
+ }
+
+ if (*cp++ != '-')
+ return 0;
+
+ for (i = 0; i < 3; i++)
+ buf[i] = *cp++;
+ buf[3] = '\0';
+
+ for (i = 0; i < 12; i++)
+ if (STREQ(buf, months[i]))
+ break;
+ if (i == 12)
+ return 0;
+ cal.month = (u_char)(i + 1);
+
+ if (*cp++ != '-')
+ return 0;
+
+ if (!isdigit((int)*cp))
+ return 0;
+ cal.year = (u_short)(*cp++ - '0');
+ if (isdigit((int)*cp)) {
+ cal.year = (u_short)((cal.year << 3) + (cal.year << 1));
+ cal.year = (u_short)(*cp++ - '0');
+ }
+ if (isdigit((int)*cp)) {
+ cal.year = (u_short)((cal.year << 3) + (cal.year << 1));
+ cal.year = (u_short)(cal.year + *cp++ - '0');
+ }
+ if (isdigit((int)*cp)) {
+ cal.year = (u_short)((cal.year << 3) + (cal.year << 1));
+ cal.year = (u_short)(cal.year + *cp++ - '0');
+ }
+
+ /*
+ * Catch special case. If cal.year == 0 this is a zero timestamp.
+ */
+ if (cal.year == 0) {
+ L_CLR(lfp);
+ return 1;
+ }
+
+ if (*cp++ != ' ' || !isdigit((int)*cp))
+ return 0;
+ cal.hour = (u_char)(*cp++ - '0');
+ if (isdigit((int)*cp)) {
+ cal.hour = (u_char)((cal.hour << 3) + (cal.hour << 1));
+ cal.hour = (u_char)(cal.hour + *cp++ - '0');
+ }
+
+ if (*cp++ != ':' || !isdigit((int)*cp))
+ return 0;
+ cal.minute = (u_char)(*cp++ - '0');
+ if (isdigit((int)*cp)) {
+ cal.minute = (u_char)((cal.minute << 3) + (cal.minute << 1));
+ cal.minute = (u_char)(cal.minute + *cp++ - '0');
+ }
+
+ if (*cp++ != ':' || !isdigit((int)*cp))
+ return 0;
+ cal.second = (u_char)(*cp++ - '0');
+ if (isdigit((int)*cp)) {
+ cal.second = (u_char)((cal.second << 3) + (cal.second << 1));
+ cal.second = (u_char)(cal.second + *cp++ - '0');
+ }
+
+ /*
+ * For RT-11, 1972 seems to be the pivot year
+ */
+ if (cal.year < 72)
+ cal.year += 2000;
+ if (cal.year < 100)
+ cal.year += 1900;
+
+ lfp->l_ui = caltontp(&cal);
+ lfp->l_uf = 0;
+ return 1;
+}
+
+
+/*
+ * decodets - decode a timestamp into an l_fp format number, with
+ * consideration of fuzzball formats.
+ */
+int
+decodets(
+ char *str,
+ l_fp *lfp
+ )
+{
+ char *cp;
+ char buf[30];
+ size_t b;
+
+ /*
+ * If it starts with a 0x, decode as hex.
+ */
+ if (*str == '0' && (*(str+1) == 'x' || *(str+1) == 'X'))
+ return hextolfp(str+2, lfp);
+
+ /*
+ * If it starts with a '"', try it as an RT-11 date.
+ */
+ if (*str == '"') {
+ cp = str + 1;
+ b = 0;
+ while ('"' != *cp && '\0' != *cp &&
+ b < COUNTOF(buf) - 1)
+ buf[b++] = *cp++;
+ buf[b] = '\0';
+ return rtdatetolfp(buf, lfp);
+ }
+
+ /*
+ * Might still be hex. Check out the first character. Talk
+ * about heuristics!
+ */
+ if ((*str >= 'A' && *str <= 'F') || (*str >= 'a' && *str <= 'f'))
+ return hextolfp(str, lfp);
+
+ /*
+ * Try it as a decimal. If this fails, try as an unquoted
+ * RT-11 date. This code should go away eventually.
+ */
+ if (atolfp(str, lfp))
+ return 1;
+
+ return rtdatetolfp(str, lfp);
+}
+
+
+/*
+ * decodetime - decode a time value. It should be in milliseconds
+ */
+int
+decodetime(
+ char *str,
+ l_fp *lfp
+ )
+{
+ return mstolfp(str, lfp);
+}
+
+
+/*
+ * decodeint - decode an integer
+ */
+int
+decodeint(
+ char *str,
+ long *val
+ )
+{
+ if (*str == '0') {
+ if (*(str+1) == 'x' || *(str+1) == 'X')
+ return hextoint(str+2, (u_long *)val);
+ return octtoint(str, (u_long *)val);
+ }
+ return atoint(str, val);
+}
+
+
+/*
+ * decodeuint - decode an unsigned integer
+ */
+int
+decodeuint(
+ char *str,
+ u_long *val
+ )
+{
+ if (*str == '0') {
+ if (*(str + 1) == 'x' || *(str + 1) == 'X')
+ return (hextoint(str + 2, val));
+ return (octtoint(str, val));
+ }
+ return (atouint(str, val));
+}
+
+
+/*
+ * decodearr - decode an array of time values
+ */
+static int
+decodearr(
+ char *str,
+ int *narr,
+ l_fp *lfparr
+ )
+{
+ register char *cp, *bp;
+ register l_fp *lfp;
+ char buf[60];
+
+ lfp = lfparr;
+ cp = str;
+ *narr = 0;
+
+ while (*narr < 8) {
+ while (isspace((int)*cp))
+ cp++;
+ if (*cp == '\0')
+ break;
+
+ bp = buf;
+ while (!isspace((int)*cp) && *cp != '\0')
+ *bp++ = *cp++;
+ *bp++ = '\0';
+
+ if (!decodetime(buf, lfp))
+ return 0;
+ (*narr)++;
+ lfp++;
+ }
+ return 1;
+}
+
+
+/*
+ * Finally, the built in command handlers
+ */
+
+/*
+ * help - tell about commands, or details of a particular command
+ */
+static void
+help(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ struct xcmd *xcp = NULL; /* quiet warning */
+ const char *cmd;
+ const char *list[100];
+ size_t word, words;
+ size_t row, rows;
+ size_t col, cols;
+ size_t length;
+
+ if (pcmd->nargs == 0) {
+ words = 0;
+ for (xcp = builtins; xcp->keyword != NULL; xcp++) {
+ if (*(xcp->keyword) != '?' &&
+ words < COUNTOF(list))
+ list[words++] = xcp->keyword;
+ }
+ for (xcp = opcmds; xcp->keyword != NULL; xcp++)
+ if (words < COUNTOF(list))
+ list[words++] = xcp->keyword;
+
+ qsort((void *)list, words, sizeof(list[0]), helpsort);
+ col = 0;
+ for (word = 0; word < words; word++) {
+ length = strlen(list[word]);
+ col = max(col, length);
+ }
+
+ cols = SCREENWIDTH / ++col;
+ rows = (words + cols - 1) / cols;
+
+ fprintf(fp, "ntpq commands:\n");
+
+ for (row = 0; row < rows; row++) {
+ for (word = row; word < words; word += rows)
+ fprintf(fp, "%-*.*s", (int)col,
+ (int)col - 1, list[word]);
+ fprintf(fp, "\n");
+ }
+ } else {
+ cmd = pcmd->argval[0].string;
+ words = findcmd(cmd, builtins, opcmds, &xcp);
+ if (words == 0) {
+ fprintf(stderr,
+ "Command `%s' is unknown\n", cmd);
+ return;
+ } else if (words >= 2) {
+ fprintf(stderr,
+ "Command `%s' is ambiguous\n", cmd);
+ return;
+ }
+ fprintf(fp, "function: %s\n", xcp->comment);
+ printusage(xcp, fp);
+ }
+}
+
+
+/*
+ * helpsort - do hostname qsort comparisons
+ */
+static int
+helpsort(
+ const void *t1,
+ const void *t2
+ )
+{
+ const char * const * name1 = t1;
+ const char * const * name2 = t2;
+
+ return strcmp(*name1, *name2);
+}
+
+
+/*
+ * printusage - print usage information for a command
+ */
+static void
+printusage(
+ struct xcmd *xcp,
+ FILE *fp
+ )
+{
+ register int i;
+
+ /* XXX: Do we need to warn about extra args here too? */
+
+ (void) fprintf(fp, "usage: %s", xcp->keyword);
+ for (i = 0; i < MAXARGS && xcp->arg[i] != NO; i++) {
+ if (xcp->arg[i] & OPT)
+ (void) fprintf(fp, " [ %s ]", xcp->desc[i]);
+ else
+ (void) fprintf(fp, " %s", xcp->desc[i]);
+ }
+ (void) fprintf(fp, "\n");
+}
+
+
+/*
+ * timeout - set time out time
+ */
+static void
+timeout(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int val;
+
+ if (pcmd->nargs == 0) {
+ val = (int)tvout.tv_sec * 1000 + tvout.tv_usec / 1000;
+ (void) fprintf(fp, "primary timeout %d ms\n", val);
+ } else {
+ tvout.tv_sec = pcmd->argval[0].uval / 1000;
+ tvout.tv_usec = (pcmd->argval[0].uval - ((long)tvout.tv_sec * 1000))
+ * 1000;
+ }
+}
+
+
+/*
+ * auth_delay - set delay for auth requests
+ */
+static void
+auth_delay(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int isneg;
+ u_long val;
+
+ if (pcmd->nargs == 0) {
+ val = delay_time.l_ui * 1000 + delay_time.l_uf / 4294967;
+ (void) fprintf(fp, "delay %lu ms\n", val);
+ } else {
+ if (pcmd->argval[0].ival < 0) {
+ isneg = 1;
+ val = (u_long)(-pcmd->argval[0].ival);
+ } else {
+ isneg = 0;
+ val = (u_long)pcmd->argval[0].ival;
+ }
+
+ delay_time.l_ui = val / 1000;
+ val %= 1000;
+ delay_time.l_uf = val * 4294967; /* 2**32/1000 */
+
+ if (isneg)
+ L_NEG(&delay_time);
+ }
+}
+
+
+/*
+ * host - set the host we are dealing with.
+ */
+static void
+host(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ int i;
+
+ if (pcmd->nargs == 0) {
+ if (havehost)
+ (void) fprintf(fp, "current host is %s\n",
+ currenthost);
+ else
+ (void) fprintf(fp, "no current host\n");
+ return;
+ }
+
+ i = 0;
+ ai_fam_templ = ai_fam_default;
+ if (pcmd->nargs == 2) {
+ if (!strcmp("-4", pcmd->argval[i].string))
+ ai_fam_templ = AF_INET;
+ else if (!strcmp("-6", pcmd->argval[i].string))
+ ai_fam_templ = AF_INET6;
+ else
+ goto no_change;
+ i = 1;
+ }
+ if (openhost(pcmd->argval[i].string, ai_fam_templ)) {
+ fprintf(fp, "current host set to %s\n", currenthost);
+ } else {
+ no_change:
+ if (havehost)
+ fprintf(fp, "current host remains %s\n",
+ currenthost);
+ else
+ fprintf(fp, "still no current host\n");
+ }
+}
+
+
+/*
+ * poll - do one (or more) polls of the host via NTP
+ */
+/*ARGSUSED*/
+static void
+ntp_poll(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ (void) fprintf(fp, "poll not implemented yet\n");
+}
+
+
+/*
+ * keyid - get a keyid to use for authenticating requests
+ */
+static void
+keyid(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ if (info_auth_keyid == 0)
+ (void) fprintf(fp, "no keyid defined\n");
+ else
+ (void) fprintf(fp, "keyid is %lu\n", (u_long)info_auth_keyid);
+ } else {
+ /* allow zero so that keyid can be cleared. */
+ if(pcmd->argval[0].uval > NTP_MAXKEY)
+ (void) fprintf(fp, "Invalid key identifier\n");
+ info_auth_keyid = pcmd->argval[0].uval;
+ }
+}
+
+/*
+ * keytype - get type of key to use for authenticating requests
+ */
+static void
+keytype(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ const char * digest_name;
+ size_t digest_len;
+ int key_type;
+
+ if (!pcmd->nargs) {
+ fprintf(fp, "keytype is %s with %lu octet digests\n",
+ keytype_name(info_auth_keytype),
+ (u_long)info_auth_hashlen);
+ return;
+ }
+
+ digest_name = pcmd->argval[0].string;
+ digest_len = 0;
+ key_type = keytype_from_text(digest_name, &digest_len);
+
+ if (!key_type) {
+ fprintf(fp, "keytype must be 'md5'%s\n",
+#ifdef OPENSSL
+ " or a digest type provided by OpenSSL");
+#else
+ "");
+#endif
+ return;
+ }
+
+ info_auth_keytype = key_type;
+ info_auth_hashlen = digest_len;
+}
+
+
+/*
+ * passwd - get an authentication key
+ */
+/*ARGSUSED*/
+static void
+passwd(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ const char *pass;
+
+ if (info_auth_keyid == 0) {
+ info_auth_keyid = getkeyid("Keyid: ");
+ if (info_auth_keyid == 0) {
+ (void)fprintf(fp, "Keyid must be defined\n");
+ return;
+ }
+ }
+ if (pcmd->nargs >= 1)
+ pass = pcmd->argval[0].string;
+ else {
+ pass = getpass_keytype(info_auth_keytype);
+ if ('\0' == pass[0]) {
+ fprintf(fp, "Password unchanged\n");
+ return;
+ }
+ }
+ authusekey(info_auth_keyid, info_auth_keytype,
+ (const u_char *)pass);
+ authtrust(info_auth_keyid, 1);
+}
+
+
+/*
+ * hostnames - set the showhostnames flag
+ */
+static void
+hostnames(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ if (showhostnames)
+ (void) fprintf(fp, "hostnames being shown\n");
+ else
+ (void) fprintf(fp, "hostnames not being shown\n");
+ } else {
+ if (STREQ(pcmd->argval[0].string, "yes"))
+ showhostnames = 1;
+ else if (STREQ(pcmd->argval[0].string, "no"))
+ showhostnames = 0;
+ else
+ (void)fprintf(stderr, "What?\n");
+ }
+}
+
+
+
+/*
+ * setdebug - set/change debugging level
+ */
+static void
+setdebug(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ (void) fprintf(fp, "debug level is %d\n", debug);
+ return;
+ } else if (STREQ(pcmd->argval[0].string, "no")) {
+ debug = 0;
+ } else if (STREQ(pcmd->argval[0].string, "more")) {
+ debug++;
+ } else if (STREQ(pcmd->argval[0].string, "less")) {
+ debug--;
+ } else {
+ (void) fprintf(fp, "What?\n");
+ return;
+ }
+ (void) fprintf(fp, "debug level set to %d\n", debug);
+}
+
+
+/*
+ * quit - stop this nonsense
+ */
+/*ARGSUSED*/
+static void
+quit(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (havehost)
+ closesocket(sockfd); /* cleanliness next to godliness */
+ exit(0);
+}
+
+
+/*
+ * version - print the current version number
+ */
+/*ARGSUSED*/
+static void
+version(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+
+ (void) fprintf(fp, "%s\n", Version);
+ return;
+}
+
+
+/*
+ * raw - set raw mode output
+ */
+/*ARGSUSED*/
+static void
+raw(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ rawmode = 1;
+ (void) fprintf(fp, "Output set to raw\n");
+}
+
+
+/*
+ * cooked - set cooked mode output
+ */
+/*ARGSUSED*/
+static void
+cooked(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ rawmode = 0;
+ (void) fprintf(fp, "Output set to cooked\n");
+ return;
+}
+
+
+/*
+ * authenticate - always authenticate requests to this host
+ */
+static void
+authenticate(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ if (always_auth) {
+ (void) fprintf(fp,
+ "authenticated requests being sent\n");
+ } else
+ (void) fprintf(fp,
+ "unauthenticated requests being sent\n");
+ } else {
+ if (STREQ(pcmd->argval[0].string, "yes")) {
+ always_auth = 1;
+ } else if (STREQ(pcmd->argval[0].string, "no")) {
+ always_auth = 0;
+ } else
+ (void)fprintf(stderr, "What?\n");
+ }
+}
+
+
+/*
+ * ntpversion - choose the NTP version to use
+ */
+static void
+ntpversion(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ if (pcmd->nargs == 0) {
+ (void) fprintf(fp,
+ "NTP version being claimed is %d\n", pktversion);
+ } else {
+ if (pcmd->argval[0].uval < NTP_OLDVERSION
+ || pcmd->argval[0].uval > NTP_VERSION) {
+ (void) fprintf(stderr, "versions %d to %d, please\n",
+ NTP_OLDVERSION, NTP_VERSION);
+ } else {
+ pktversion = (u_char) pcmd->argval[0].uval;
+ }
+ }
+}
+
+
+/*
+ * warning - print a warning message
+ */
+static void
+warning(
+ const char *fmt,
+ const char *st1,
+ const char *st2
+ )
+{
+ (void) fprintf(stderr, "%s: ", progname);
+ (void) fprintf(stderr, fmt, st1, st2);
+ (void) fprintf(stderr, ": ");
+ perror("");
+}
+
+
+/*
+ * error - print a message and exit
+ */
+static void
+error(
+ const char *fmt,
+ const char *st1,
+ const char *st2
+ )
+{
+ warning(fmt, st1, st2);
+ exit(1);
+}
+
+/*
+ * getkeyid - prompt the user for a keyid to use
+ */
+static u_long
+getkeyid(
+ const char *keyprompt
+ )
+{
+ int c;
+ FILE *fi;
+ char pbuf[20];
+ size_t i;
+ size_t ilim;
+
+#ifndef SYS_WINNT
+ if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL)
+#else
+ if ((fi = _fdopen(open("CONIN$", _O_TEXT), "r")) == NULL)
+#endif /* SYS_WINNT */
+ fi = stdin;
+ else
+ setbuf(fi, (char *)NULL);
+ fprintf(stderr, "%s", keyprompt); fflush(stderr);
+ for (i = 0, ilim = COUNTOF(pbuf) - 1;
+ i < ilim && (c = getc(fi)) != '\n' && c != EOF;
+ )
+ pbuf[i++] = (char)c;
+ pbuf[i] = '\0';
+ if (fi != stdin)
+ fclose(fi);
+
+ return (u_long) atoi(pbuf);
+}
+
+
+/*
+ * atoascii - printable-ize possibly ascii data using the character
+ * transformations cat -v uses.
+ */
+static void
+atoascii(
+ const char *in,
+ size_t in_octets,
+ char *out,
+ size_t out_octets
+ )
+{
+ const u_char * pchIn;
+ const u_char * pchInLimit;
+ u_char * pchOut;
+ u_char c;
+
+ pchIn = (const u_char *)in;
+ pchInLimit = pchIn + in_octets;
+ pchOut = (u_char *)out;
+
+ if (NULL == pchIn) {
+ if (0 < out_octets)
+ *pchOut = '\0';
+ return;
+ }
+
+#define ONEOUT(c) \
+do { \
+ if (0 == --out_octets) { \
+ *pchOut = '\0'; \
+ return; \
+ } \
+ *pchOut++ = (c); \
+} while (0)
+
+ for ( ; pchIn < pchInLimit; pchIn++) {
+ c = *pchIn;
+ if ('\0' == c)
+ break;
+ if (c & 0x80) {
+ ONEOUT('M');
+ ONEOUT('-');
+ c &= 0x7f;
+ }
+ if (c < ' ') {
+ ONEOUT('^');
+ ONEOUT((u_char)(c + '@'));
+ } else if (0x7f == c) {
+ ONEOUT('^');
+ ONEOUT('?');
+ } else
+ ONEOUT(c);
+ }
+ ONEOUT('\0');
+
+#undef ONEOUT
+}
+
+
+/*
+ * makeascii - print possibly ascii data using the character
+ * transformations that cat -v uses.
+ */
+void
+makeascii(
+ int length,
+ const char *data,
+ FILE *fp
+ )
+{
+ const u_char *data_u_char;
+ const u_char *cp;
+ int c;
+
+ data_u_char = (const u_char *)data;
+
+ for (cp = data_u_char; cp < data_u_char + length; cp++) {
+ c = (int)*cp;
+ if (c & 0x80) {
+ putc('M', fp);
+ putc('-', fp);
+ c &= 0x7f;
+ }
+
+ if (c < ' ') {
+ putc('^', fp);
+ putc(c + '@', fp);
+ } else if (0x7f == c) {
+ putc('^', fp);
+ putc('?', fp);
+ } else
+ putc(c, fp);
+ }
+}
+
+
+/*
+ * asciize - same thing as makeascii except add a newline
+ */
+void
+asciize(
+ int length,
+ char *data,
+ FILE *fp
+ )
+{
+ makeascii(length, data, fp);
+ putc('\n', fp);
+}
+
+
+/*
+ * truncate string to fit clipping excess at end.
+ * "too long" -> "too l"
+ * Used for hostnames.
+ */
+const char *
+trunc_right(
+ const char * src,
+ size_t width
+ )
+{
+ size_t sl;
+ char * out;
+
+
+ sl = strlen(src);
+ if (sl > width && LIB_BUFLENGTH - 1 > width && width > 0) {
+ LIB_GETBUF(out);
+ memcpy(out, src, width);
+ out[width] = '\0';
+
+ return out;
+ }
+
+ return src;
+}
+
+
+/*
+ * truncate string to fit by preserving right side and using '_' to hint
+ * "too long" -> "_long"
+ * Used for local IPv6 addresses, where low bits differentiate.
+ */
+const char *
+trunc_left(
+ const char * src,
+ size_t width
+ )
+{
+ size_t sl;
+ char * out;
+
+
+ sl = strlen(src);
+ if (sl > width && LIB_BUFLENGTH - 1 > width && width > 1) {
+ LIB_GETBUF(out);
+ out[0] = '_';
+ memcpy(&out[1], &src[sl + 1 - width], width);
+
+ return out;
+ }
+
+ return src;
+}
+
+
+/*
+ * Some circular buffer space
+ */
+#define CBLEN 80
+#define NUMCB 6
+
+char circ_buf[NUMCB][CBLEN];
+int nextcb = 0;
+
+/*
+ * nextvar - find the next variable in the buffer
+ */
+int
+nextvar(
+ int *datalen,
+ const char **datap,
+ char **vname,
+ char **vvalue
+ )
+{
+ const char *cp;
+ const char *np;
+ const char *cpend;
+ size_t srclen;
+ size_t len;
+ static char name[MAXVARLEN];
+ static char value[MAXVALLEN];
+
+ cp = *datap;
+ cpend = cp + *datalen;
+
+ /*
+ * Space past commas and white space
+ */
+ while (cp < cpend && (*cp == ',' || isspace((int)*cp)))
+ cp++;
+ if (cp >= cpend)
+ return 0;
+
+ /*
+ * Copy name until we hit a ',', an '=', a '\r' or a '\n'. Backspace
+ * over any white space and terminate it.
+ */
+ srclen = strcspn(cp, ",=\r\n");
+ srclen = min(srclen, (size_t)(cpend - cp));
+ len = srclen;
+ while (len > 0 && isspace(cp[len - 1]))
+ len--;
+ if (len > 0)
+ memcpy(name, cp, len);
+ name[len] = '\0';
+ *vname = name;
+ cp += srclen;
+
+ /*
+ * Check if we hit the end of the buffer or a ','. If so we are done.
+ */
+ if (cp >= cpend || *cp == ',' || *cp == '\r' || *cp == '\n') {
+ if (cp < cpend)
+ cp++;
+ *datap = cp;
+ *datalen = cpend - cp;
+ *vvalue = NULL;
+ return 1;
+ }
+
+ /*
+ * So far, so good. Copy out the value
+ */
+ cp++; /* past '=' */
+ while (cp < cpend && (isspace(*cp) && *cp != '\r' && *cp != '\n'))
+ cp++;
+ np = cp;
+ if ('"' == *np) {
+ do {
+ np++;
+ } while (np < cpend && '"' != *np);
+ if (np < cpend && '"' == *np)
+ np++;
+ } else {
+ while (np < cpend && ',' != *np && '\r' != *np)
+ np++;
+ }
+ len = np - cp;
+ if (np > cpend || len >= sizeof(value) ||
+ (np < cpend && ',' != *np && '\r' != *np))
+ return 0;
+ memcpy(value, cp, len);
+ /*
+ * Trim off any trailing whitespace
+ */
+ while (len > 0 && isspace(value[len - 1]))
+ len--;
+ value[len] = '\0';
+
+ /*
+ * Return this. All done.
+ */
+ if (np < cpend && ',' == *np)
+ np++;
+ *datap = np;
+ *datalen = cpend - np;
+ *vvalue = value;
+ return 1;
+}
+
+
+u_short
+varfmt(const char * varname)
+{
+ u_int n;
+
+ for (n = 0; n < COUNTOF(cookedvars); n++)
+ if (!strcmp(varname, cookedvars[n].varname))
+ return cookedvars[n].fmt;
+
+ return PADDING;
+}
+
+
+/*
+ * printvars - print variables returned in response packet
+ */
+void
+printvars(
+ int length,
+ const char *data,
+ int status,
+ int sttype,
+ int quiet,
+ FILE *fp
+ )
+{
+ if (rawmode)
+ rawprint(sttype, length, data, status, quiet, fp);
+ else
+ cookedprint(sttype, length, data, status, quiet, fp);
+}
+
+
+/*
+ * rawprint - do a printout of the data in raw mode
+ */
+static void
+rawprint(
+ int datatype,
+ int length,
+ const char *data,
+ int status,
+ int quiet,
+ FILE *fp
+ )
+{
+ const char *cp;
+ const char *cpend;
+
+ /*
+ * Essentially print the data as is. We reformat unprintables, though.
+ */
+ cp = data;
+ cpend = data + length;
+
+ if (!quiet)
+ (void) fprintf(fp, "status=0x%04x,\n", status);
+
+ while (cp < cpend) {
+ if (*cp == '\r') {
+ /*
+ * If this is a \r and the next character is a
+ * \n, supress this, else pretty print it. Otherwise
+ * just output the character.
+ */
+ if (cp == (cpend - 1) || *(cp + 1) != '\n')
+ makeascii(1, cp, fp);
+ } else if (isspace(*cp) || isprint(*cp))
+ putc(*cp, fp);
+ else
+ makeascii(1, cp, fp);
+ cp++;
+ }
+}
+
+
+/*
+ * Global data used by the cooked output routines
+ */
+int out_chars; /* number of characters output */
+int out_linecount; /* number of characters output on this line */
+
+
+/*
+ * startoutput - get ready to do cooked output
+ */
+static void
+startoutput(void)
+{
+ out_chars = 0;
+ out_linecount = 0;
+}
+
+
+/*
+ * output - output a variable=value combination
+ */
+static void
+output(
+ FILE *fp,
+ const char *name,
+ const char *value
+ )
+{
+ size_t len;
+
+ /* strlen of "name=value" */
+ len = strlen(name) + 1 + strlen(value);
+
+ if (out_chars != 0) {
+ out_chars += 2;
+ if ((out_linecount + len + 2) > MAXOUTLINE) {
+ fputs(",\n", fp);
+ out_linecount = 0;
+ } else {
+ fputs(", ", fp);
+ out_linecount += 2;
+ }
+ }
+
+ fputs(name, fp);
+ putc('=', fp);
+ fputs(value, fp);
+ out_chars += len;
+ out_linecount += len;
+}
+
+
+/*
+ * endoutput - terminate a block of cooked output
+ */
+static void
+endoutput(
+ FILE *fp
+ )
+{
+ if (out_chars != 0)
+ putc('\n', fp);
+}
+
+
+/*
+ * outputarr - output an array of values
+ */
+static void
+outputarr(
+ FILE *fp,
+ char *name,
+ int narr,
+ l_fp *lfp
+ )
+{
+ register char *bp;
+ register char *cp;
+ register int i;
+ register int len;
+ char buf[256];
+
+ bp = buf;
+ /*
+ * Hack to align delay and offset values
+ */
+ for (i = (int)strlen(name); i < 11; i++)
+ *bp++ = ' ';
+
+ for (i = narr; i > 0; i--) {
+ if (i != narr)
+ *bp++ = ' ';
+ cp = lfptoms(lfp, 2);
+ len = strlen(cp);
+ if (len > 7) {
+ cp[7] = '\0';
+ len = 7;
+ }
+ while (len < 7) {
+ *bp++ = ' ';
+ len++;
+ }
+ while (*cp != '\0')
+ *bp++ = *cp++;
+ lfp++;
+ }
+ *bp = '\0';
+ output(fp, name, buf);
+}
+
+static char *
+tstflags(
+ u_long val
+ )
+{
+ register char *cp, *s;
+ size_t cb;
+ register int i;
+ register const char *sep;
+
+ sep = "";
+ i = 0;
+ s = cp = circ_buf[nextcb];
+ if (++nextcb >= NUMCB)
+ nextcb = 0;
+ cb = sizeof(circ_buf[0]);
+
+ snprintf(cp, cb, "%02lx", val);
+ cp += strlen(cp);
+ cb -= strlen(cp);
+ if (!val) {
+ strlcat(cp, " ok", cb);
+ cp += strlen(cp);
+ cb -= strlen(cp);
+ } else {
+ if (cb) {
+ *cp++ = ' ';
+ cb--;
+ }
+ for (i = 0; i < COUNTOF(tstflagnames); i++) {
+ if (val & 0x1) {
+ snprintf(cp, cb, "%s%s", sep,
+ tstflagnames[i]);
+ sep = ", ";
+ cp += strlen(cp);
+ cb -= strlen(cp);
+ }
+ val >>= 1;
+ }
+ }
+ if (cb)
+ *cp = '\0';
+
+ return s;
+}
+
+/*
+ * cookedprint - output variables in cooked mode
+ */
+static void
+cookedprint(
+ int datatype,
+ int length,
+ const char *data,
+ int status,
+ int quiet,
+ FILE *fp
+ )
+{
+ char *name;
+ char *value;
+ char output_raw;
+ int fmt;
+ l_fp lfp;
+ sockaddr_u hval;
+ u_long uval;
+ int narr;
+ size_t len;
+ l_fp lfparr[8];
+ char b[12];
+ char bn[2 * MAXVARLEN];
+ char bv[2 * MAXVALLEN];
+
+ UNUSED_ARG(datatype);
+
+ if (!quiet)
+ fprintf(fp, "status=%04x %s,\n", status,
+ statustoa(datatype, status));
+
+ startoutput();
+ while (nextvar(&length, &data, &name, &value)) {
+ fmt = varfmt(name);
+ output_raw = 0;
+ switch (fmt) {
+
+ case PADDING:
+ output_raw = '*';
+ break;
+
+ case TS:
+ if (!decodets(value, &lfp))
+ output_raw = '?';
+ else
+ output(fp, name, prettydate(&lfp));
+ break;
+
+ case HA: /* fallthru */
+ case NA:
+ if (!decodenetnum(value, &hval)) {
+ output_raw = '?';
+ } else if (fmt == HA){
+ output(fp, name, nntohost(&hval));
+ } else {
+ output(fp, name, stoa(&hval));
+ }
+ break;
+
+ case RF:
+ if (decodenetnum(value, &hval)) {
+ if (ISREFCLOCKADR(&hval))
+ output(fp, name,
+ refnumtoa(&hval));
+ else
+ output(fp, name, stoa(&hval));
+ } else if (strlen(value) <= 4) {
+ output(fp, name, value);
+ } else {
+ output_raw = '?';
+ }
+ break;
+
+ case LP:
+ if (!decodeuint(value, &uval) || uval > 3) {
+ output_raw = '?';
+ } else {
+ b[0] = (0x2 & uval)
+ ? '1'
+ : '0';
+ b[1] = (0x1 & uval)
+ ? '1'
+ : '0';
+ b[2] = '\0';
+ output(fp, name, b);
+ }
+ break;
+
+ case OC:
+ if (!decodeuint(value, &uval)) {
+ output_raw = '?';
+ } else {
+ snprintf(b, sizeof(b), "%03lo", uval);
+ output(fp, name, b);
+ }
+ break;
+
+ case AR:
+ if (!decodearr(value, &narr, lfparr))
+ output_raw = '?';
+ else
+ outputarr(fp, name, narr, lfparr);
+ break;
+
+ case FX:
+ if (!decodeuint(value, &uval))
+ output_raw = '?';
+ else
+ output(fp, name, tstflags(uval));
+ break;
+
+ default:
+ fprintf(stderr, "Internal error in cookedprint, %s=%s, fmt %d\n",
+ name, value, fmt);
+ output_raw = '?';
+ break;
+ }
+
+ if (output_raw != 0) {
+ atoascii(name, MAXVARLEN, bn, sizeof(bn));
+ atoascii(value, MAXVALLEN, bv, sizeof(bv));
+ if (output_raw != '*') {
+ len = strlen(bv);
+ bv[len] = output_raw;
+ bv[len+1] = '\0';
+ }
+ output(fp, bn, bv);
+ }
+ }
+ endoutput(fp);
+}
+
+
+/*
+ * sortassoc - sort associations in the cache into ascending order
+ */
+void
+sortassoc(void)
+{
+ if (numassoc > 1)
+ qsort(assoc_cache, (size_t)numassoc,
+ sizeof(assoc_cache[0]), &assoccmp);
+}
+
+
+/*
+ * assoccmp - compare two associations
+ */
+static int
+assoccmp(
+ const void *t1,
+ const void *t2
+ )
+{
+ const struct association *ass1 = t1;
+ const struct association *ass2 = t2;
+
+ if (ass1->assid < ass2->assid)
+ return -1;
+ if (ass1->assid > ass2->assid)
+ return 1;
+ return 0;
+}
+
+
+/*
+ * grow_assoc_cache() - enlarge dynamic assoc_cache array
+ *
+ * The strategy is to add an assumed 4k page size at a time, leaving
+ * room for malloc() bookkeeping overhead equivalent to 4 pointers.
+ */
+void
+grow_assoc_cache(void)
+{
+ static size_t prior_sz;
+ size_t new_sz;
+
+ new_sz = prior_sz + 4 * 1024;
+ if (0 == prior_sz) {
+ new_sz -= 4 * sizeof(void *);
+ }
+ assoc_cache = erealloc_zero(assoc_cache, new_sz, prior_sz);
+ prior_sz = new_sz;
+ assoc_cache_slots = new_sz / sizeof(assoc_cache[0]);
+}
+
+
+/*
+ * ntpq_custom_opt_handler - autoopts handler for -c and -p
+ *
+ * By default, autoopts loses the relative order of -c and -p options
+ * on the command line. This routine replaces the default handler for
+ * those routines and builds a list of commands to execute preserving
+ * the order.
+ */
+void
+ntpq_custom_opt_handler(
+ tOptions *pOptions,
+ tOptDesc *pOptDesc
+ )
+{
+ switch (pOptDesc->optValue) {
+
+ default:
+ fprintf(stderr,
+ "ntpq_custom_opt_handler unexpected option '%c' (%d)\n",
+ pOptDesc->optValue, pOptDesc->optValue);
+ exit(1);
+
+ case 'c':
+ ADDCMD(pOptDesc->pzLastArg);
+ break;
+
+ case 'p':
+ ADDCMD("peers");
+ break;
+ }
+}
diff --git a/ntpq/ntpq.h b/ntpq/ntpq.h
new file mode 100644
index 0000000..ec2bcb9
--- /dev/null
+++ b/ntpq/ntpq.h
@@ -0,0 +1,154 @@
+/*
+ * ntpq.h - definitions of interest to ntpq
+ */
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include "ntp_string.h"
+#include "ntp_malloc.h"
+#include "ntp_assert.h"
+#include "ntp_control.h"
+#include "lib_strbuf.h"
+
+/*
+ * Maximum number of arguments
+ */
+#define MAXARGS 4
+
+/*
+ * Limit on packets in a single response. Increasing this value to
+ * 96 will marginally speed "mrulist" operation on lossless networks
+ * but it has been observed to cause loss on WiFi networks and with
+ * an IPv6 go6.net tunnel over UDP. That loss causes the request
+ * row limit to be cut in half, and it grows back very slowly to
+ * ensure forward progress is made and loss isn't triggered too quickly
+ * afterward. While the lossless case gains only marginally with
+ * MAXFRAGS == 96, the lossy case is a lot slower due to the repeated
+ * timeouts. Empirally, MAXFRAGS == 32 avoids most of the routine loss
+ * on both the WiFi and UDP v6 tunnel tests and seems a good compromise.
+ * This suggests some device in the path has a limit of 32 ~512 byte UDP
+ * packets in queue.
+ * Lowering MAXFRAGS may help with particularly lossy networks, but some
+ * ntpq commands may rely on the longtime value of 24 implicitly,
+ * assuming a single multipacket response will be large enough for any
+ * needs. In contrast, the "mrulist" command is implemented as a series
+ * of requests and multipacket responses to each.
+ */
+#define MAXFRAGS 32
+
+/*
+ * Error codes for internal use
+ */
+#define ERR_UNSPEC 256
+#define ERR_INCOMPLETE 257
+#define ERR_TIMEOUT 258
+#define ERR_TOOMUCH 259
+
+/*
+ * Flags for forming descriptors.
+ */
+#define OPT 0x80 /* this argument is optional, or'd with type */
+
+#define NO 0x0
+#define NTP_STR 0x1 /* string argument */
+#define NTP_UINT 0x2 /* unsigned integer */
+#define NTP_INT 0x3 /* signed integer */
+#define NTP_ADD 0x4 /* IP network address */
+#define IP_VERSION 0x5 /* IP version */
+#define NTP_ADP 0x6 /* IP address and port */
+#define NTP_LFP 0x7 /* NTP timestamp */
+#define NTP_MODE 0x8 /* peer mode */
+#define NTP_2BIT 0x9 /* leap bits */
+
+/*
+ * Arguments are returned in a union
+ */
+typedef union {
+ const char *string;
+ long ival;
+ u_long uval;
+ sockaddr_u netnum;
+} arg_v;
+
+/*
+ * Structure for passing parsed command line
+ */
+struct parse {
+ const char *keyword;
+ arg_v argval[MAXARGS];
+ int nargs;
+};
+
+/*
+ * ntpdc includes a command parser which could charitably be called
+ * crude. The following structure is used to define the command
+ * syntax.
+ */
+struct xcmd {
+ const char *keyword; /* command key word */
+ void (*handler) (struct parse *, FILE *); /* command handler */
+ u_char arg[MAXARGS]; /* descriptors for arguments */
+ const char *desc[MAXARGS]; /* descriptions for arguments */
+ const char *comment;
+};
+
+/*
+ * Structure to hold association data
+ */
+struct association {
+ associd_t assid;
+ u_short status;
+};
+
+/*
+ * mrulist terminal status interval
+ */
+#define MRU_REPORT_SECS 5
+
+/*
+ * var_format is used to override cooked formatting for selected vars.
+ */
+typedef struct var_format_tag {
+ const char * varname;
+ u_short fmt;
+} var_format;
+
+typedef struct chost_tag chost;
+struct chost_tag {
+ const char *name;
+ int fam;
+};
+
+extern chost chosts[];
+
+extern int interactive; /* are we prompting? */
+extern int old_rv; /* use old rv behavior? --old-rv */
+extern u_int assoc_cache_slots;/* count of allocated array entries */
+extern u_int numassoc; /* number of cached associations */
+extern u_int numhosts;
+
+extern void grow_assoc_cache(void);
+extern void asciize (int, char *, FILE *);
+extern int getnetnum (const char *, sockaddr_u *, char *, int);
+extern void sortassoc (void);
+extern void show_error_msg (int, associd_t);
+extern int dogetassoc (FILE *);
+extern int doquery (int, associd_t, int, int, const char *,
+ u_short *, int *, const char **);
+extern int doqueryex (int, associd_t, int, int, const char *,
+ u_short *, int *, const char **, int);
+extern const char * nntohost (sockaddr_u *);
+extern const char * nntohost_col (sockaddr_u *, size_t, int);
+extern const char * nntohostp (sockaddr_u *);
+extern int decodets (char *, l_fp *);
+extern int decodeuint (char *, u_long *);
+extern int nextvar (int *, const char **, char **, char **);
+extern int decodetime (char *, l_fp *);
+extern void printvars (int, const char *, int, int, int, FILE *);
+extern int decodeint (char *, long *);
+extern void makeascii (int, const char *, FILE *);
+extern const char * trunc_left (const char *, size_t);
+extern const char * trunc_right(const char *, size_t);
diff --git a/ntpq/ntpq.html b/ntpq/ntpq.html
new file mode 100644
index 0000000..b3e7c67
--- /dev/null
+++ b/ntpq/ntpq.html
@@ -0,0 +1,1814 @@
+<html lang="en">
+<head>
+<title>ntpq: Network Time Protocol Query User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="ntpq: Network Time Protocol Query User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">ntpq: Network Time Protocol Query User's Manual</h1>
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">ntpq: Network Time Protocol Query User Manual</a>
+</ul>
+</div>
+
+
+
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-Description">ntpq Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">ntpq: Network Time Protocol Query User Manual</h2>
+
+<p>The <code>ntpq</code> utility program is used to
+monitor the operational status
+and determine the performance of
+<code>ntpd</code>, the NTP daemon.
+
+ <p>This document applies to version 4.2.7p482 of <code>ntpq</code>.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpq-Description">ntpq Description</a>
+<li><a accesskey="2" href="#ntpq-Invocation">ntpq Invocation</a>: Invoking ntpq
+<li><a accesskey="3" href="#Usage">Usage</a>
+<li><a accesskey="4" href="#Internal-Commands">Internal Commands</a>
+<li><a accesskey="5" href="#Control-Message-Commands">Control Message Commands</a>
+<li><a accesskey="6" href="#Status-Words-and-Kiss-Codes">Status Words and Kiss Codes</a>
+<li><a accesskey="7" href="#System-Variables">System Variables</a>
+<li><a accesskey="8" href="#Peer-Variables">Peer Variables</a>
+<li><a accesskey="9" href="#Clock-Variables">Clock Variables</a>
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpq-Description"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Usage">Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>The <code>ntpq</code> utility program is used to monitor NTP daemon <code>ntpd</code> operations and determine performance.
+It uses the standard NTP mode 6 control message formats defined in
+Appendix B of the NTPv3 specification RFC1305.
+The same formats are used in NTPv4, although some of the variable names have changed and new ones added.
+The description on this page is for the NTPv4 variables.
+
+ <p>The program can be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The <code>ntpq</code> can also obtain and print a list of peers in a common format by sending multiple queries to the server.
+
+ <p>If one or more request options is included on the command line when <code>ntpq</code> is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, <code>ntpq</code> will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. <code>ntpq</code> will prompt for commands if the standard input is a terminal device.
+
+ <p><code>ntpq</code> uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. <code>ntpq</code> makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.
+
+ <p>Note that in contexts where a host name is expected, a <code>-4</code> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <code>-6</code> qualifier forces DNS resolution to the IPv6 namespace.
+
+ <p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.
+
+<div class="node">
+<p><hr>
+<a name="ntpq-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">Invoking ntpq</h3>
+
+<p><a name="index-ntpq-1"></a><a name="index-standard-NTP-query-program-2"></a>
+
+ <p>The
+<code>ntpq</code>
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty-printed output
+options being available.
+The
+<code>ntpq</code>
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+
+ <p>If one or more request options is included on the command line
+when
+<code>ntpq</code>
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+<code>ntpq</code>
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+<code>ntpq</code>
+utility will prompt for
+commands if the standard input is a terminal device.
+
+ <p><code>ntpq</code>
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+<code>ntpq</code>
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+
+ <p>Specifying a
+command line option other than
+<code>-i</code>
+or
+<code>-n</code>
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+<code>ntpq</code>
+will attempt to read
+interactive format commands from the standard input.
+
+<h5 class="subsubsection">Internal Commands</h5>
+
+<p>Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+
+ <p>A
+number of interactive format commands are executed entirely within
+the
+<code>ntpq</code>
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+ <dl>
+<dt><code>?</code> <code>[</code><kbd>command_keyword</kbd><code>]</code><br><dt><code>help</code> <code>[</code><kbd>command_keyword</kbd><code>]</code><dd>A
+?
+by itself will print a list of all the command
+keywords known to this incarnation of
+<code>ntpq</code>
+A
+?
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+<code>ntpq</code>
+than this manual
+page.
+<br><dt><code>addvars</code> <kbd>variable_name</kbd><code>[=value]</code> <code>...</code><br><dt><code>rmvars</code> <kbd>variable_name</kbd> <code>...</code><br><dt><code>clearvars</code><br><dt><code>showvars</code><dd>The data carried by NTP mode 6 messages consists of a list of
+items of the form
+variable_name=value,
+where the
+=value
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+<code>ntpq</code>
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+<code>readlist</code>
+and
+<code>writelist</code>
+commands described below.
+The
+<code>addvars</code>
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma-separated and not contain white space.
+The
+<code>rmvars</code>
+command can be used to remove individual variables from the list,
+while the
+<code>clearlist</code>
+command removes all variables from the
+list.
+The
+<code>showvars</code>
+command displays the current list of optional variables.
+<br><dt><code>authenticate</code> <code>[yes | no]</code><dd>Normally
+<code>ntpq</code>
+does not authenticate requests unless
+they are write requests.
+The command
+authenticate yes
+causes
+<code>ntpq</code>
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+<code>peer</code>
+display.
+The command
+authenticate
+causes
+<code>ntpq</code>
+to display whether or not
+<code>ntpq</code>
+is currently autheinticating requests.
+<br><dt><code>cooked</code><dd>Causes output from query commands to be "cooked", so that
+variables which are recognized by
+<code>ntpq</code>
+will have their
+values reformatted for human consumption.
+Variables which
+<code>ntpq</code>
+thinks should have a decodable value but didn't are
+marked with a trailing
+?.
+<br><dt><code>debug</code> <code>[more | less | off]</code><dd>With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+<br><dt><code>delay</code> <kbd>milliseconds</kbd><dd>Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+<br><dt><code>exit</code><dd>Exit
+<code>ntpq</code>
+<br><dt><code>host</code> <kbd>hostname</kbd><dd>Set the host to which future queries will be sent.
+<kbd>hostname</kbd>
+may be either a host name or a numeric address.
+<br><dt><code>hostnames</code> <code>[yes | no]</code><dd>If
+<code>yes</code>
+is specified, host names are printed in
+information displays.
+If
+<code>no</code>
+is specified, numeric
+addresses are printed instead.
+The default is
+<code>yes</code>,
+unless
+modified using the command line
+<code>-n</code>
+switch.
+<br><dt><code>keyid</code> <kbd>keyid</kbd><dd>This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+<br><dt><code>keytype</code> <code>[md5 | OpenSSLDigestType]</code><dd>Specify the type of key to use for authenticating requests.
+<code>md5</code>
+is alway supported.
+If
+<code>ntpq</code>
+was built with OpenSSL support,
+any digest type supported by OpenSSL can also be provided.
+If no argument is given, the current
+<code>keytype</code>
+is displayed.
+<br><dt><code>ntpversion</code> <code>[1 | 2 | 3 | 4]</code><dd>Sets the NTP version number which
+<code>ntpq</code>
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+<br><dt><code>passwd</code><dd>This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+<code>poll</code>
+<kbd>n</kbd>
+<code>verbose</code>
+<br><dt><code>quit</code><dd>Exit
+<code>ntpq</code>
+<br><dt><code>raw</code><dd>Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+<br><dt><code>timeout</code> <kbd>milliseconds</kbd><dd>Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+<code>ntpq</code>
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+<br><dt><code>version</code><dd>Print the version of the
+<code>ntpq</code>
+program.
+</dl>
+
+<h5 class="subsubsection">Control Message Commands</h5>
+
+<p>Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode-6 message to the server and expect a single response message.
+The exceptions are the
+<code>peers</code>
+command, which sends a series of messages,
+and the
+<code>mreadlist</code>
+and
+<code>mreadvar</code>
+commands, which iterate over a range of associations.
+ <dl>
+<dt><code>associations</code><dd>Display a list of mobilized associations in the form:
+ <pre class="example"> ind assid status conf reach auth condition last_event cnt
+ </pre>
+ <dl>
+<dt>Sy String Ta Sy Description<br><dt><code>ind</code> <code>Ta</code> <code>index</code> <code>on</code> <code>this</code> <code>list</code><br><dt><code>assid</code> <code>Ta</code> <code>association</code> <code>ID</code><br><dt><code>status</code> <code>Ta</code> <code>peer</code> <code>status</code> <code>word</code><br><dt><code>conf</code> <code>Ta</code> <code>yes</code>: <code>persistent,</code> <code>no</code>: <code>ephemeral</code><br><dt><code>reach</code> <code>Ta</code> <code>yes</code>: <code>reachable,</code> <code>no</code>: <code>unreachable</code><br><dt><code>auth</code> <code>Ta</code> <code>ok</code>, <code>yes</code>, <code>bad</code> <code>and</code> <code>none</code><br><dt><code>condition</code> <code>Ta</code> <code>selection</code> <code>status</code> <code>(see</code> <code>the</code> <code>select</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code><br><dt><code>last_event</code> <code>Ta</code> <code>event</code> <code>report</code> <code>(see</code> <code>the</code> <code>event</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code><br><dt><code>cnt</code> <code>Ta</code> <code>event</code> <code>count</code> <code>(see</code> <code>the</code> <code>count</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code><dd></dl>
+ <br><dt><code>authinfo</code><dd>Display the authentication statistics.
+<br><dt><code>clockvar</code> <kbd>assocID</kbd> <code>[</code><kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]]</code> <code>[...]</code><br><dt><code>cv</code> <kbd>assocID</kbd> <code>[</code><kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]]</code> <code>[...]</code><dd>Display a list of clock variables for those associations supporting a reference clock.
+<br><dt><code>:config</code> <code>[...]</code><dd>Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
+<br><dt><code>config-from-file</code> <kbd>filename</kbd><dd>Send the each line of
+<kbd>filename</kbd>
+to the server as run-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
+<br><dt><code>ifstats</code><dd>Display statistics for each local network address. Authentication is required.
+<br><dt><code>iostats</code><dd>Display network and reference clock I/O statistics.
+<br><dt><code>kerninfo</code><dd>Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
+<br><dt><code>lassociations</code><dd>Perform the same function as the associations command, except display mobilized and unmobilized associations.
+<br><dt><code>lopeers</code> <code>[-4 | -6]</code><dd>Obtain and print a list of all peers and clients showing
+<kbd>dstadr</kbd>
+(associated with any given IP version).
+<br><dt><code>lpeers</code> <code>[-4 | -6]</code><dd>Print a peer spreadsheet for the appropriate IP version(s).
+<kbd>dstadr</kbd>
+(associated with any given IP version).
+<br><dt><code>monstats</code><dd>Display monitor facility statistics.
+<br><dt><code>mrulist</code> <code>[limited | kod | mincount=</code><kbd>count</kbd><code> | laddr=</code><kbd>localaddr</kbd><code> | sort=</code><kbd>sortorder</kbd><code> | resany=</code><kbd>hexmask</kbd><code> | resall=</code><kbd>hexmask</kbd><code>]</code><dd>Obtain and print traffic counts collected and maintained by the monitor facility.
+With the exception of
+<code>sort</code>=<kbd>sortorder</kbd>,
+the options filter the list returned by
+<code>ntpd.</code>
+The
+<code>limited</code>
+and
+<code>kod</code>
+options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
+The
+<code>mincount</code>=<kbd>count</kbd>
+option filters entries representing less than
+<kbd>count</kbd>
+packets.
+The
+<code>laddr</code>=<kbd>localaddr</kbd>
+option filters entries for packets received on any local address other than
+<kbd>localaddr</kbd>.
+<code>resany</code>=<kbd>hexmask</kbd>
+and
+<code>resall</code>=<kbd>hexmask</kbd>
+filter entries containing none or less than all, respectively, of the bits in
+<kbd>hexmask</kbd>,
+which must begin with
+<code>0x</code>.
+The
+<kbd>sortorder</kbd>
+defaults to
+<code>lstint</code>
+and may be any of
+<code>addr</code>,
+<code>count</code>,
+<code>avgint</code>,
+<code>lstint</code>,
+or any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+ <dl>
+<dt>Column<dd>Description
+<br><dt><code>lstint</code><dd>Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
+<code>ntpq</code>
+<br><dt><code>avgint</code><dd>Average interval in s between packets from this address.
+<br><dt><code>rstr</code><dd>Restriction flags associated with this address.
+Most are copied unchanged from the matching
+<code>restrict</code>
+command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
+<br><dt><code>r</code><dd>Rate control indicator, either
+a period,
+<code>L</code>
+or
+<code>K</code>
+for no rate control response,
+rate limiting by discarding, or rate limiting with a KoD response, respectively.
+<br><dt><code>m</code><dd>Packet mode.
+<br><dt><code>v</code><dd>Packet version number.
+<br><dt><code>count</code><dd>Packets received from this address.
+<br><dt><code>rport</code><dd>Source port of last packet from this address.
+<br><dt><code>remote</code> <code>address</code><dd>DNS name, numeric address, or address followed by
+claimed DNS name which could not be verified in parentheses.
+</dl>
+ <br><dt><code>mreadvar</code> <code>assocID</code> <code>assocID</code> <code>[</code><kbd>variable_name</kbd><code>[=</code><kbd>value</kbd><code>] ...]</code><br><dt><code>mrv</code> <code>assocID</code> <code>assocID</code> <code>[</code><kbd>variable_name</kbd><code>[=</code><kbd>value</kbd><code>] ...]</code><dd>Perform the same function as the
+<code>readvar</code>
+command, except for a range of association IDs.
+This range is determined from the association list cached by the most recent
+<code>associations</code>
+command.
+<br><dt><code>opeers</code> <code>[-4 | -6]</code><dd>Obtain and print the old-style list of all peers and clients showing
+<kbd>dstadr</kbd>
+(associated with any given IP version),
+rather than the
+<kbd>refid</kbd>.
+<br><dt><code>passociations</code><dd>Perform the same function as the
+<code>associations</code>
+command,
+except that it uses previously stored data rather than making a new query.
+<br><dt><code>peers</code><dd>Display a list of peers in the form:
+ <pre class="example"> [tally]remote refid st t when pool reach delay offset jitter
+ </pre>
+ <dl>
+<dt>Variable<dd>Description
+<br><dt><code>[tally]</code><dd>single-character code indicating current value of the
+<code>select</code>
+field of the
+.Lk decode.html#peer "peer status word"
+<br><dt><code>remote</code><dd>host name (or IP number) of peer.
+The value displayed will be truncated to 15 characters unless the
+<code>-w</code>
+flag is given, in which case the full value will be displayed
+on the first line,
+and the remaining data is displayed on the next line.
+<br><dt><code>refid</code><dd>association ID or
+.Lk decode.html#kiss "'kiss code"
+<br><dt><code>st</code><dd>stratum
+<br><dt><code>t</code><dd><code>u</code>:
+unicast or manycast client,
+<code>b</code>:
+broadcast or multicast client,
+<code>l</code>:
+local (reference clock),
+<code>s</code>:
+symmetric (peer),
+<code>A</code>:
+manycast server,
+<code>B</code>:
+broadcast server,
+<code>M</code>:
+multicast server
+<br><dt><code>when</code><dd>sec/min/hr since last received packet
+<br><dt><code>poll</code><dd>poll interval (log2 s)
+<br><dt><code>reach</code><dd>reach shift register (octal)
+<br><dt><code>delay</code><dd>roundtrip delay
+<br><dt><code>offset</code><dd>offset of server relative to this host
+<br><dt><code>jitter</code><dd>jitter
+</dl>
+ <br><dt><code>pstats</code> <kbd>assocID</kbd><dd>Show the statistics for the peer with the given
+<kbd>assocID</kbd>.
+<br><dt><code>readlist</code> <kbd>assocID</kbd><br><dt><code>rl</code> <kbd>assocID</kbd><dd>Read the system or peer variables included in the variable list.
+<br><dt><code>readvar</code> <kbd>assocID</kbd> <kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]</code> <code>[, ...]</code><br><dt><code>rv</code> <kbd>assocID</kbd> <kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]</code> <code>[, ...]</code><dd>Display the specified variables.
+If
+<kbd>assocID</kbd>
+is zero, the variables are from the
+<a href="#System-Variables">System Variables</a>
+name space, otherwise they are from the
+<a href="#Peer-Variables">Peer Variables</a>
+name space.
+The
+<kbd>assocID</kbd>
+is required, as the same name can occur in both spaces.
+If no
+<kbd>name</kbd>
+is included, all operative variables in the name space are displayed.
+
+ <p>In this case only, if the
+<kbd>assocID</kbd>
+is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds
+and frequency values in parts-per-million (PPM).
+Some NTP timestamps are represented in the format
+YYYYMMDDTTTT ,
+where YYYY is the year,
+MM the month of year,
+DD the day of month and
+TTTT the time of day.
+<br><dt><code>reslist</code><dd>Show the access control (restrict) list for
+<code>ntpq</code>
+
+ <br><dt><code>saveconfig</code> <kbd>filename</kbd><dd>Write the current configuration,
+including any runtime modifications given with
+<code>:config</code>
+or
+<code>config-from-file</code>,
+to the ntpd host's file
+<kbd>filename</kbd>.
+This command will be rejected by the server unless
+.Lk miscopt.html#saveconfigdir "saveconfigdir"
+appears in the
+<code>ntpd</code>
+configuration file.
+<kbd>filename</kbd>
+can use
+<code>strftime()</code>
+format specifies to substitute the current date and time, for example,
+<code>q]saveconfig</code> <code>ntp-%Y%m%d-%H%M%S.confq]</code>.
+The filename used is stored in system variable
+<code>savedconfig</code>.
+Authentication is required.
+<br><dt><code>timerstats</code><dd>Display interval timer counters.
+<br><dt><code>writelist</code> <kbd>assocID</kbd><dd>Write the system or peer variables included in the variable list.
+<br><dt><code>writevar</code> <kbd>assocID</kbd> <kbd>name</kbd>=<kbd>value</kbd> <code>[, ...]</code><dd>Write the specified variables.
+If the
+<kbd>assocID</kbd>
+is zero, the variables are from the
+<a href="#System-Variables">System Variables</a>
+name space, otherwise they are from the
+<a href="#Peer-Variables">Peer Variables</a>
+name space.
+The
+<kbd>assocID</kbd>
+is required, as the same name can occur in both spaces.
+<br><dt><code>sysinfo</code><dd>Display operational summary.
+<br><dt><code>sysstats</code><dd>Print statistics counters maintained in the protocol module.
+</dl>
+
+<h5 class="subsubsection">Status Words and Kiss Codes</h5>
+
+<p>The current state of the operating program is shown
+in a set of status words
+maintained by the system.
+Status information is also available on a per-association basis.
+These words are displayed in the
+<code>rv</code>
+and
+<code>as</code>
+commands both in hexadecimal and in decoded short tip strings.
+The codes, tips and short explanations are documented on the
+.Lk decode.html "Event Messages and Status Words"
+page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+
+ <p>Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+.Lk decode.html#kiss "kiss codes" .
+The original purpose was for kiss-o'-death (KoD) packets
+sent by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+
+<h5 class="subsubsection">System Variables</h5>
+
+<p>The following system variables appear in the
+<code>rv</code>
+billboard.
+Not all variables are displayed in some configurations.
+ <dl>
+<dt>Variable<dd>Description
+<br><dt><code>status</code><dd>.Lk decode.html#sys "system status word"
+<br><dt><code>version</code><dd>NTP software version and build time
+<br><dt><code>processor</code><dd>hardware platform and version
+<br><dt><code>system</code><dd>operating system and version
+<br><dt><code>leap</code><dd>leap warning indicator (0-3)
+<br><dt><code>stratum</code><dd>stratum (1-15)
+<br><dt><code>precision</code><dd>precision (log2 s)
+<br><dt><code>rootdelay</code><dd>total roundtrip delay to the primary reference clock
+<br><dt><code>rootdisp</code><dd>total dispersion to the primary reference clock
+<br><dt><code>peer</code><dd>system peer association ID
+<br><dt><code>tc</code><dd>time constant and poll exponent (log2 s) (3-17)
+<br><dt><code>mintc</code><dd>minimum time constant (log2 s) (3-10)
+<br><dt><code>clock</code><dd>date and time of day
+<br><dt><code>refid</code><dd>reference ID or
+.Lk decode.html#kiss "kiss code"
+<br><dt><code>reftime</code><dd>reference time
+<br><dt><code>offset</code><dd>combined offset of server relative to this host
+<br><dt><code>sys_jitter</code><dd>combined system jitter
+<br><dt><code>frequency</code><dd>frequency offset (PPM) relative to hardware clock
+<br><dt><code>clk_wander</code><dd>clock frequency wander (PPM)
+<br><dt><code>clk_jitter</code><dd>clock jitter
+<br><dt><code>tai</code><dd>TAI-UTC offset (s)
+<br><dt><code>leapsec</code><dd>NTP seconds when the next leap second is/was inserted
+<br><dt><code>expire</code><dd>NTP seconds when the NIST leapseconds file expires
+</dl>
+ The jitter and wander statistics are exponentially-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+
+ <p>When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed,
+including some or all of the following,
+depending on the particular Autokey dance:
+
+ <dl>
+<dt>Variable<dd>Description
+<br><dt><code>host</code><dd>Autokey host name for this host
+<br><dt><code>ident</code><dd>Autokey group name for this host
+<br><dt><code>flags</code><dd>host flags (see Autokey specification)
+<br><dt><code>digest</code><dd>OpenSSL message digest algorithm
+<br><dt><code>signature</code><dd>OpenSSL digest/signature scheme
+<br><dt><code>update</code><dd>NTP seconds at last signature update
+<br><dt><code>cert</code><dd>certificate subject, issuer and certificate flags
+<br><dt><code>until</code><dd>NTP seconds when the certificate expires
+</dl>
+
+<h5 class="subsubsection">Peer Variables</h5>
+
+<p>The following peer variables appear in the
+<code>rv</code>
+billboard for each association.
+Not all variables are displayed in some configurations.
+
+ <dl>
+<dt>Variable<dd>Description
+<br><dt><code>associd</code><dd>association ID
+<br><dt><code>status</code><dd>.Lk decode.html#peer "peer status word"
+<br><dt><code>srcadr</code><dd>source (remote) IP address
+<br><dt><code>srcport</code><dd>source (remote) port
+<br><dt><code>dstadr</code><dd>destination (local) IP address
+<br><dt><code>dstport</code><dd>destination (local) port
+<br><dt><code>leap</code><dd>leap indicator (0-3)
+<br><dt><code>stratum</code><dd>stratum (0-15)
+<br><dt><code>precision</code><dd>precision (log2 s)
+<br><dt><code>rootdelay</code><dd>total roundtrip delay to the primary reference clock
+<br><dt><code>rootdisp</code><dd>total root dispersion to the primary reference clock
+<br><dt><code>refid</code><dd>reference ID or
+.Lk decode.html#kiss "kiss code"
+<br><dt><code>reftime</code><dd>reference time
+<br><dt><code>reach</code><dd>reach register (octal)
+<br><dt><code>unreach</code><dd>unreach counter
+<br><dt><code>hmode</code><dd>host mode (1-6)
+<br><dt><code>pmode</code><dd>peer mode (1-5)
+<br><dt><code>hpoll</code><dd>host poll exponent (log2 s) (3-17)
+<br><dt><code>ppoll</code><dd>peer poll exponent (log2 s) (3-17)
+<br><dt><code>headway</code><dd>headway (see
+.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" )
+<br><dt><code>flash</code><dd>.Lk decode.html#flash "flash status word"
+<br><dt><code>offset</code><dd>filter offset
+<br><dt><code>delay</code><dd>filter delay
+<br><dt><code>dispersion</code><dd>filter dispersion
+<br><dt><code>jitter</code><dd>filter jitter
+<br><dt><code>ident</code><dd>Autokey group name for this association
+<br><dt><code>bias</code><dd>unicast/broadcast bias
+<br><dt><code>xleave</code><dd>interleave delay (see
+.Lk xleave.html "NTP Interleaved Modes" )
+</dl>
+ The
+<code>bias</code>
+variable is calculated when the first broadcast packet is received
+after the calibration volley.
+It represents the offset of the broadcast subgraph relative to the unicast subgraph.
+The
+<code>xleave</code>
+variable appears only for the interleaved symmetric and interleaved modes.
+It represents the internal queuing, buffering and transmission delays
+for the preceding packet.
+
+ <p>When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+ <dl>
+<dt>Variable<dd>Description
+<br><dt><code>flags</code><dd>peer flags (see Autokey specification)
+<br><dt><code>host</code><dd>Autokey server name
+<br><dt><code>flags</code><dd>peer flags (see Autokey specification)
+<br><dt><code>signature</code><dd>OpenSSL digest/signature scheme
+<br><dt><code>initsequence</code><dd>initial key ID
+<br><dt><code>initkey</code><dd>initial key index
+<br><dt><code>timestamp</code><dd>Autokey signature timestamp
+</dl>
+
+<h5 class="subsubsection">Clock Variables</h5>
+
+<p>The following clock variables appear in the
+<code>cv</code>
+billboard for each association with a reference clock.
+Not all variables are displayed in some configurations.
+ <dl>
+<dt>Variable<dd>Description
+<br><dt><code>associd</code><dd>association ID
+<br><dt><code>status</code><dd>.Lk decode.html#clock "clock status word"
+<br><dt><code>device</code><dd>device description
+<br><dt><code>timecode</code><dd>ASCII time code string (specific to device)
+<br><dt><code>poll</code><dd>poll messages sent
+<br><dt><code>noreply</code><dd>no reply
+<br><dt><code>badformat</code><dd>bad format
+<br><dt><code>baddata</code><dd>bad date or time
+<br><dt><code>fudgetime1</code><dd>fudge time 1
+<br><dt><code>fudgetime2</code><dd>fudge time 2
+<br><dt><code>stratum</code><dd>driver stratum
+<br><dt><code>refid</code><dd>driver reference ID
+<br><dt><code>flags</code><dd>driver flags
+</dl>
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpq</code> program.
+This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpq-usage">ntpq usage</a>: ntpq help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntpq-ipv4">ntpq ipv4</a>: ipv4 option (-4)
+<li><a accesskey="3" href="#ntpq-ipv6">ntpq ipv6</a>: ipv6 option (-6)
+<li><a accesskey="4" href="#ntpq-command">ntpq command</a>: command option (-c)
+<li><a accesskey="5" href="#ntpq-interactive">ntpq interactive</a>: interactive option (-i)
+<li><a accesskey="6" href="#ntpq-numeric">ntpq numeric</a>: numeric option (-n)
+<li><a accesskey="7" href="#ntpq-old_002drv">ntpq old-rv</a>: old-rv option
+<li><a accesskey="8" href="#ntpq-peers">ntpq peers</a>: peers option (-p)
+<li><a accesskey="9" href="#ntpq-wide">ntpq wide</a>: wide option (-w)
+<li><a href="#ntpq-config">ntpq config</a>: presetting/configuring ntpq
+<li><a href="#ntpq-exit-status">ntpq exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpq-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-ipv4">ntpq ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpq help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntpq-help-3"></a>
+This is the automatically generated usage text for ntpq.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntpq - standard NTP query program - Ver. 4.2.7p481
+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
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -c Str command run a command and exit
+ - may appear multiple times
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -i no interactive Force ntpq to operate in interactive mode
+ - prohibits these options:
+ command
+ peers
+ -n no numeric numeric host addresses
+ no old-rv Always output status line with readvar
+ -p no peers Print a list of the peers
+ - prohibits the option 'interactive'
+ -w no wide Display the full 'remote' value
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -&gt; opt save-opts save the option state to a config file
+ -&lt; Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTPQ_*
+
+Please send bug reports to: &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntpq-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-ipv6">ntpq ipv6</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-usage">ntpq usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv4 option (-4)</h4>
+
+<p><a name="index-ntpq_002dipv4-4"></a>
+This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv6.
+</ul>
+
+ <p>Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+<div class="node">
+<p><hr>
+<a name="ntpq-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-command">ntpq command</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-ipv4">ntpq ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv6 option (-6)</h4>
+
+<p><a name="index-ntpq_002dipv6-5"></a>
+This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv4.
+</ul>
+
+ <p>Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+<div class="node">
+<p><hr>
+<a name="ntpq-command"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-interactive">ntpq interactive</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-ipv6">ntpq ipv6</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">command option (-c)</h4>
+
+<p><a name="index-ntpq_002dcommand-6"></a>
+This is the &ldquo;run a command and exit&rdquo; option.
+This option takes a string argument <span class="file">cmd</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+<div class="node">
+<p><hr>
+<a name="ntpq-interactive"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-numeric">ntpq numeric</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-command">ntpq command</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">interactive option (-i)</h4>
+
+<p><a name="index-ntpq_002dinteractive-7"></a>
+This is the &ldquo;force ntpq to operate in interactive mode&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+command, peers.
+</ul>
+
+ <p>Force <code>ntpq</code> to operate in interactive mode.
+Prompts will be written to the standard output and
+commands read from the standard input.
+<div class="node">
+<p><hr>
+<a name="ntpq-numeric"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-old_002drv">ntpq old-rv</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-interactive">ntpq interactive</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">numeric option (-n)</h4>
+
+<p><a name="index-ntpq_002dnumeric-8"></a>
+This is the &ldquo;numeric host addresses&rdquo; option.
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+<div class="node">
+<p><hr>
+<a name="ntpq-old_002drv"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-peers">ntpq peers</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-numeric">ntpq numeric</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">old-rv option</h4>
+
+<p><a name="index-ntpq_002dold_002drv-9"></a>
+This is the &ldquo;always output status line with readvar&rdquo; option.
+By default, <code>ntpq</code> now suppresses the <code>associd=...</code>
+line that precedes the output of <code>readvar</code>
+(alias <code>rv</code>) when a single variable is requested, such as
+<code>ntpq -c "rv 0 offset"</code>.
+This option causes <code>ntpq</code> to include both lines of output
+for a single-variable <code>readvar</code>.
+Using an environment variable to
+preset this option in a script will enable both older and
+newer <code>ntpq</code> to behave identically in this regard.
+<div class="node">
+<p><hr>
+<a name="ntpq-peers"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-wide">ntpq wide</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-old_002drv">ntpq old-rv</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">peers option (-p)</h4>
+
+<p><a name="index-ntpq_002dpeers-10"></a>
+This is the &ldquo;print a list of the peers&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+interactive.
+</ul>
+
+ <p>Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+<div class="node">
+<p><hr>
+<a name="ntpq-wide"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-config">ntpq config</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-peers">ntpq peers</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">wide option (-w)</h4>
+
+<p><a name="index-ntpq_002dwide-11"></a>
+This is the &ldquo;display the full 'remote' value&rdquo; option.
+Display the full value of the 'remote' value. If this requires
+more than 15 characters, display the full value, emit a newline,
+and continue the data display properly indented on the next line.
+
+<div class="node">
+<p><hr>
+<a name="ntpq-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpq-exit-status">ntpq exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-wide">ntpq wide</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">presetting/configuring ntpq</h4>
+
+<p>Any option that is not marked as <i>not presettable</i> may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named <code>NTPQ</code> and <code>NTPQ_&lt;OPTION_NAME&gt;</code>. <code>&lt;OPTION_NAME&gt;</code> must be one of
+the options listed above in upper case and segmented with underscores.
+The <code>NTPQ</code> variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+<p class="noindent"><code>libopts</code> will search in 2 places for configuration files:
+ <ul>
+<li>$HOME
+<li>$PWD
+</ul>
+ The environment variables <code>HOME</code>, and <code>PWD</code>
+are expanded and replaced when <span class="file">ntpq</span> runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named <span class="file">.ntprc</span> is searched for
+within that directory and processed.
+
+ <p>Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+ <p>Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+<pre class="example"> [NTPQ]
+</pre>
+ <p class="noindent">or by
+<pre class="example"> &lt;?program ntpq&gt;
+</pre>
+ <p class="noindent">Do not mix these styles within one configuration file.
+
+ <p>Compound values and carefully constructed string values may also be
+specified using XML syntax:
+<pre class="example"> &lt;option-name&gt;
+ &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
+ &lt;/option-name&gt;
+</pre>
+ <p class="noindent">yielding an <code>option-name.sub-opt</code> string value of
+<pre class="example"> "...&lt;...&gt;..."
+</pre>
+ <p><code>AutoOpts</code> does not track suboptions. You simply note that it is a
+hierarchicly valued option. <code>AutoOpts</code> does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+ <p>The command line options relating to configuration and/or usage help are:
+
+<h5 class="subsubheading">version (-)</h5>
+
+<p>Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+ <dl>
+<dt><span class="samp">version</span><dd>Only print the version. This is the default.
+<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
+<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
+</dl>
+
+<div class="node">
+<p><hr>
+<a name="ntpq-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-config">ntpq config</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpq exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+<br><dt><span class="samp">66 (EX_NOINPUT)</span><dd>A specified configuration file could not be loaded.
+<br><dt><span class="samp">70 (EX_SOFTWARE)</span><dd>libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+</dl>
+
+<div class="node">
+<p><hr>
+<a name="Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Internal-Commands">Internal Commands</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpq-Description">ntpq Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Usage</h3>
+
+<p><table summary=""><tr align="left"><th valign="top" width="23%">What </th><th valign="top" width="23%">Default </th><th valign="top" width="5%">Flag </th><th valign="top" width="15%">Option
+<br></th></tr><tr align="left"><td valign="top" width="23%">configuration file
+</td><td valign="top" width="23%"><code>/etc/ntp.conf</code>
+</td><td valign="top" width="5%"><code>-c</code>
+</td><td valign="top" width="15%"><code>conffile</code>
+<br></td></tr><tr align="left"><td valign="top" width="23%">frequency file
+</td><td valign="top" width="23%">none
+</td><td valign="top" width="5%"><code>-f</code>
+</td><td valign="top" width="15%"><code>driftfile</code>
+<br></td></tr><tr align="left"><td valign="top" width="23%">leapseconds file
+</td><td valign="top" width="23%">none
+</td><td valign="top" width="5%">
+</td><td valign="top" width="15%"><code>leapfile</code>
+<br></td></tr><tr align="left"><td valign="top" width="23%">process ID file
+</td><td valign="top" width="23%">none
+</td><td valign="top" width="5%"><code>-p</code>
+</td><td valign="top" width="15%"><code>pidfile</code>
+<br></td></tr><tr align="left"><td valign="top" width="23%">log file
+</td><td valign="top" width="23%">system log
+</td><td valign="top" width="5%"><code>-l</code>
+</td><td valign="top" width="15%"><code>logfile</code>
+<br></td></tr><tr align="left"><td valign="top" width="23%">include file
+</td><td valign="top" width="23%">none
+</td><td valign="top" width="5%">none
+</td><td valign="top" width="15%"><code>includefile</code>
+<br></td></tr><tr align="left"><td valign="top" width="23%">statistics path
+</td><td valign="top" width="23%"><code>/var/NTP</code>
+</td><td valign="top" width="5%"><code>-s</code>
+</td><td valign="top" width="15%"><code>statsdir</code>
+<br></td></tr><tr align="left"><td valign="top" width="23%">keys path
+</td><td valign="top" width="23%"><code>/usr/local/etc</code>
+</td><td valign="top" width="5%"><code>-k</code>
+</td><td valign="top" width="15%"><code>keysdir</code>
+<br></td></tr></table>
+
+<div class="node">
+<p><hr>
+<a name="Internal-Commands"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Control-Message-Commands">Control Message Commands</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Usage">Usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Internal Commands</h3>
+
+<p>Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <code>&gt;</code>, followed by a file name, to the command line. A number of interactive format commands are executed entirely within the <code>ntpq</code> program itself and do not result in NTP mode-6 requests being sent to a server. These are described following.
+
+ <dl>
+<dt><code><a name="help"></a> ? [</code><kbd>command_keyword</kbd><code>]</code><dt><code>help [</code><kbd>command_keyword</kbd><code>]</code><dd>A <code>?</code> by itself will print a list of all the command keywords known to <code>ntpq</code>. A <code>?</code> followed by a command keyword will print function and usage information about the command.
+
+ <br><dt><code><a name="addvars"></a> &gt;addvars </code><kbd>name</kbd><code> [ = </code><kbd>value</kbd><code>] [...]</code><dt><code>rmvars </code><kbd>name</kbd><code> [...]</code><dt><code>clearvars&lt;/dt&gt;</code><dd>The arguments to these commands consist of a list of items of the form
+<kbd>name</kbd><code> = </code><kbd>value</kbd>, where the <code>= </code><kbd>value</kbd> is ignored,
+and can be omitted in read requests.
+<code>ntpq</code> maintains an internal list in which data to be included
+in control messages can be assembled, and sent using the <code>readlist</code>
+and <code>writelist</code> commands described below.
+The <code>addvars</code> command allows variables and optional values
+to be added to the list.
+If more than one variable is to be added
+the list should be comma-separated and not contain white space.
+The <code>rmvars</code> command can be used to remove individual variables
+from the list,
+while the <code>clearlist</code> command removes all variables from the list.
+
+ <br><dt><code><a name="cooked"></a> cooked</code><dd>Display server messages in prettyprint format.
+
+ <br><dt><code><a name="debug"></a> debug more | less | off</code><dd>Turns internal query program debugging on and off.
+
+ <br><dt><code><a name="delay"></a> delay </code><kbd>milliseconds</kbd><dd>Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.
+
+ <br><dt><code><a name="host"></a> host </code><kbd>name</kbd><dd>Set the host to which future queries will be sent.
+The name may be either a DNS name or a numeric address.
+
+ <br><dt><code><a name="hostnames"></a> hostnames [yes | no]</code><dd>If <code>yes</code> is specified, host names are printed in information displays.
+If <code>no</code> is specified, numeric addresses are printed instead.
+The default is <code>yes</code>,
+unless modified using the command line <code>-n</code> switch.
+
+ <br><dt><code><a name="keyid"></a> keyid </code><kbd>keyid</kbd><dd>This command specifies the key number to be used
+to authenticate configuration requests.
+This must correspond to a key ID configured in <code>ntp.conf</code> for this purpose.
+
+ <br><dt><code><a name="keytype"></a> keytype</code><dd>Specify the digest algorithm to use for authenticated requests,
+with default <code>MD5</code>.
+If the OpenSSL library is installed,
+digest can be be any message digest algorithm supported by the library.
+The current selections are: <code>MD2</code>, <code>MD4</code>, <code>MD5</code>, <code>MDC2</code>, <code>RIPEMD160</code>, <code>SHA</code> and <code>SHA1</code>.
+
+ <br><dt><code><a name="ntpversion"></a> ntpversion 1 | 2 | 3 | 4</code><dd>Sets the NTP version number which <code>ntpq</code> claims in packets.
+Defaults to 2.
+Note that mode-6 control messages (and modes, for that matter)
+didn't exist in NTP version 1.
+
+ <br><dt><code><a name="passwd"></a> passwd</code><dd>This command prompts for a password to authenticate requests.
+The password must correspond to the key ID configured in <code>ntp.conf</code> for this purpose.
+
+ <br><dt><code><a name="quit"></a> quit</code><dd>Exit <code>ntpq</code>.
+
+ <br><dt><code><a name="raw"></a> raw</code><dd>Display server messages as received and without reformatting.
+
+ <br><dt><code><a name="timeout"></a> timeout </code><kbd>millseconds</kbd><dd>Specify a timeout period for responses to server queries.
+The default is about 5000 milliseconds.
+Note that since <code>ntpq</code> retries each query once after a timeout
+the total waiting time for a timeout will be twice the timeout value set.
+
+ </dl>
+
+<div class="node">
+<p><hr>
+<a name="Control-Message-Commands"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Status-Words-and-Kiss-Codes">Status Words and Kiss Codes</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Internal-Commands">Internal Commands</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Control Message Commands</h3>
+
+<p>Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space,
+while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode-6 message to the server
+and expect a single response message.
+The exceptions are the <code>peers</code> command,
+which sends a series of messages,
+and the <code>mreadlist</code> and <code>mreadvar</code> commands,
+which iterate over a range of associations.
+
+ <p><a name="as"></a>
+ <dl>
+<dt><code>associations</code><dd>Display a list of mobilized associations in the form:
+<br>
+<code>ind assid status conf reach auth condition last_event cnt</code>
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="40%">Description
+
+ <p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>ind</code>
+</td><td valign="top" width="40%">index on this list
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>assid</code>
+</td><td valign="top" width="40%">association ID
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
+</td><td valign="top" width="40%"><a href="decode.html#peer">peer status word</a>
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>conf</code>
+</td><td valign="top" width="40%"><code>yes</code>: persistent, <code>no</code>: ephemeral
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reach</code>
+</td><td valign="top" width="40%"><code>yes</code>: reachable, <code>no</code>: unreachable
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>auth</code>
+</td><td valign="top" width="40%"><code>ok</code>, <code>yes</code>, <code>bad</code> and <code>none</code>
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>condition</code>
+</td><td valign="top" width="40%">selection status (see the <code>select</code> field of the <a href="decode.html#peer">peer status word</a>)
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>last_event</code>
+</td><td valign="top" width="40%">event report (see the <code>event</code> field of the <a href="decode.html#peer">peer status word</a>)
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>cnt</code>
+event count (see the <code>count</code> field of the <a href="decode.html#peer">peer status word</a>)
+
+ <br></td></tr></table>
+
+ <br><dt><code><a name="cv"></a> clockvar </code><kbd>assocID</kbd><code> [</code><kbd>name</kbd><code> [ = </code><kbd>value</kbd><code> [...]] [...]]</code><dt><code>cv </code><kbd>assocID</kbd><code> [</code><kbd>name</kbd><code> [ = </code><kbd>value</kbd><code> [...] ][...]]</code><dd>Display a list of <a href="#clock">clock variables</a> for those associations supporting a reference clock.
+
+ <br><dt><code><a name="_003aconfig"></a> :config [...]</code><dd>Send the remainder of the command line, including whitespace, to the server
+as a run-time configuration command in the same format
+as the configuration file.
+This command is experimental until further notice and clarification.
+Authentication is of course required.
+
+ <br><dt><code><a name="config_002dfrom_002dfile"></a> config-from-file </code><kbd>filename</kbd><dd>Send the each line of <kbd>filename</kbd> to the server as
+run-time configuration commands in the same format as the configuration file.
+This command is experimental until further notice and clarification.
+Authentication is required.
+
+ <br><dt><code><a name="ifstats"></a> ifstats</code><dd>Display statistics for each local network address.
+Authentication is required.
+
+ <br><dt><code><a name="iostats"></a> iostats</code><dd>Display network and reference clock I/O statistics.
+
+ <br><dt><code><a name="kerninfo"></a> kerninfo</code><dd>Display kernel loop and PPS statistics.
+As with other ntpq output, times are in milliseconds.
+The precision value displayed is in milliseconds as well,
+unlike the precision system variable.
+
+ <br><dt><code><a name="lassoc"></a> lassociations</code><dd>Perform the same function as the associations command,
+except display mobilized and unmobilized associations.
+
+ <br><dt><code><a name="monstats"></a> monstats</code><dd>Display monitor facility statistics.
+
+ <br><dt><code><a name="mrulist"></a> mrulist [limited | kod | mincount=</code><kbd>count</kbd><code> | laddr=</code><kbd>localaddr</kbd><code> | sort=</code><kbd>sortorder</kbd><code> | resany=</code><kbd>hexmask</kbd><code> | resall=</code><kbd>hexmask</kbd><code>]</code><dd>Obtain and print traffic counts collected and maintained by
+the monitor facility.
+With the exception of <code>sort=</code><kbd>sortorder</kbd>,
+the options filter the list returned by <code>ntpd</code>.
+The <code>limited</code> and <code>kod</code> options return only entries
+representing client addresses from which the last packet received
+triggered either discarding or a KoD response.
+The <code>mincount=</code><kbd>count</kbd> option filters entries representing
+less than <kbd>count</kbd> packets.
+The <code>laddr=</code><kbd>localaddr</kbd> option filters entries for packets
+received on any local address other than <kbd>localaddr</kbd>.
+<code>resany=</code><kbd>hexmask</kbd> and <code>resall=</code><kbd>hexmask</kbd>
+filter entries containing none or less than all, respectively,
+of the bits in <kbd>hexmask</kbd>, which must begin with <code>0x</code>.
+<br>
+The <kbd>sortorder</kbd> defaults to <code>lstint</code> and may be any of
+<code>addr</code>, <code>count</code>, <code>avgint</code>, <code>lstint</code>, or
+any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Column </th><th valign="top" width="40%">Description
+
+ <p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>lstint</code>
+</td><td valign="top" width="40%">
+Interval in s between the receipt of the most recent packet from this
+address and the completion of the retrieval of the MRU list by <code>ntpq</code>
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>avgint</code>
+</td><td valign="top" width="40%">
+Average interval in s between packets from this address.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rstr</code>
+</td><td valign="top" width="40%">
+Restriction flags associated with this address.
+Most are copied unchanged from the matching <code>restrict</code> command,
+however 0x400 (kod) and 0x20 (limited) flags are cleared unless
+the last packet from this address triggered a rate control response.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>r</code>
+</td><td valign="top" width="40%">
+Rate control indicator, either a period, <code>L</code> or <code>K</code> for
+no rate control response, rate limiting by discarding, or
+rate limiting with a KoD response, respectively.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>m</code>
+</td><td valign="top" width="40%">
+Packet mode.
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>v</code>
+</td><td valign="top" width="40%">
+Packet version number.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>count</code>
+</td><td valign="top" width="40%">
+Packets received from this address.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rport</code>
+</td><td valign="top" width="40%">
+Source port of last packet from this address.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>remote address</code>
+</td><td valign="top" width="40%">
+DNS name, numeric address, or address followed by claimed DNS name which
+could not be verified in parentheses.
+
+ <br></td></tr></table>
+
+ <br><dt><code><a name="mreadvar"></a> mreadvar </code><kbd>assocID</kbd> <kbd>assocID</kbd><code> [ </code><kbd>variable_name</kbd><code> [ = </code><kbd>value</kbd><code>[ ... ]</code><dt><code><a name="mrv"></a> mrv </code><kbd>assocID</kbd> <kbd>assocID</kbd><code> [ </code><kbd>variable_name</kbd><code> [ = </code><kbd>value</kbd><code>[ ... ]</code><dd>Perform the same function as the <code>readvar</code> command,
+except for a range of association IDs.
+This range is determined from the association list cached by
+the most recent <code>associations</code> command.
+
+ <br><dt><code><a name="passoc"></a> passociations</code><dd>Perform the same function as the <code>associations command</code>, except that
+it uses previously stored data rather than making a new query.
+
+ <br><dt><code><a name="pe"></a> peers</code><dd>Display a list of peers in the form:
+<br>
+<code>[tally]remote refid st t when pool reach delay offset jitter</code>
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
+<br></th></tr><tr align="left"><td valign="top" width="10%"><code>[tally]</code>
+</td><td valign="top" width="20%">
+single-character code indicating current value of the <code>select</code> field
+of the <a href="decode.html#peer">peer status word</a>.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>remote</code>
+</td><td valign="top" width="20%">
+host name (or IP number) of peer
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
+</td><td valign="top" width="20%">
+association ID or <a href="decode.html#kiss">kiss code</a>.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>st</code>
+</td><td valign="top" width="20%">
+stratum
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>t</code>
+</td><td valign="top" width="20%">
+<code>u</code>: unicast or manycast client,
+<code>b</code>: broadcast or multicast client,
+<code>l</code>: local (reference clock),
+<code>s</code>: symmetric (peer),
+<code>A</code>: manycast server,
+<code>B</code>: broadcast server,
+<code>M</code>: multicast server.
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>when</code>
+</td><td valign="top" width="20%">
+sec/min/hr since last received packet
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>poll</code>
+</td><td valign="top" width="20%">
+poll interval (log(2) s)
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reach</code>
+</td><td valign="top" width="20%">
+reach shift register (octal)
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>delay</code>
+</td><td valign="top" width="20%">
+roundtrip delay
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>offset</code>
+</td><td valign="top" width="20%">
+offset of server relative to this host
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>jitter</code>
+</td><td valign="top" width="20%">
+jitter
+
+ <br></td></tr></table>
+
+ <br><dt><code><a name="rv"></a> readvar </code><kbd>assocID</kbd> <kbd>name</kbd><code> [ = </code><kbd>value</kbd><code> ] [,...]</code><dt><code>rv </code><kbd>assocID</kbd><code> [ </code><kbd>name</kbd><code> ] [,...]</code><dd>Display the specified variables.
+If <kbd>assocID</kbd> is zero,
+the variables are from the <a href="#system">system variables</a> name space,
+otherwise they are from the <a href="#peer">peer variables</a> name space.
+The <kbd>assocID</kbd> is required, as the same name can occur in both spaces.
+If no <kbd>name</kbd> is included,
+all operative variables in the name space are displayed.
+In this case only, if the <kbd>assocID</kbd> is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds and
+frequency values in parts-per-million (PPM).
+Some NTP timestamps are represented in the format YYYYMMDDTTTT,
+where YYYY is the year, MM the month of year, DD the day of month and
+TTTT the time of day.
+
+ <br><dt><code><a name="saveconfig"></a> saveconfig </code><kbd>filename</kbd><dd>Write the current configuration, including any runtime modifications
+given with <code>:config</code> or <code>config-from-file</code>,
+to the ntpd host's file <kbd>filename</kbd>.
+This command will be rejected by the server unless
+<a href="miscopt.html#saveconfigdir">saveconfigdir</a>
+appears in the <code>ntpd</code> configuration file.
+<kbd>filename</kbd> can use <code>strftime()</code> format specifiers
+to substitute the current date and time, for example,
+<code>saveconfig ntp-%Y%m%d-%H%M%S.conf</code>.
+The filename used is stored in system variable <code>savedconfig</code>.
+Authentication is required.
+
+ <br><dt><code><a name="writevar"></a> writevar </code><kbd>assocID</kbd> <kbd>name</kbd><code> = </code><kbd>value</kbd><code> [,...]</code><dd>Write the specified variables.
+If the <kbd>assocID</kbd> is zero, the variables are from the
+<a href="#system">system variables</a> name space, otherwise they are from the
+<a href="#peer">peer variables</a> name space.
+The <kbd>assocID</kbd> is required,
+as the same name can occur in both spaces.
+
+ <br><dt><code><a name="sysinfo"></a> sysinfo</code><dd>Display operational summary.
+
+ <br><dt><code><a name="sysstats"></a> sysstats</code><dd>Print statistics counters maintained in the protocol module.
+
+ </dl>
+
+<div class="node">
+<p><hr>
+<a name="Status-Words-and-Kiss-Codes"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#System-Variables">System Variables</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Control-Message-Commands">Control Message Commands</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Status Words and Kiss Codes</h3>
+
+<p>The current state of the operating program is shown
+in a set of status words maintained by the system
+and each association separately.
+These words are displayed in the <code>rv</code> and <code>as</code> commands
+both in hexadecimal and decoded short tip strings.
+The codes, tips and short explanations are on the
+<a href="decode.html">Event Messages and Status Words</a> page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+
+ <p>Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+<a href="decode.html#kiss">kiss codes</a>.
+The original purpose was for kiss-o'-death (KoD) packets sent
+by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+
+<div class="node">
+<p><hr>
+<a name="System-Variables"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Peer-Variables">Peer Variables</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Status-Words-and-Kiss-Codes">Status Words and Kiss Codes</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">System Variables</h3>
+
+<p>The following system variables appear in the <code>rv</code> billboard.
+Not all variables are displayed in some configurations.
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
+
+<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
+</td><td valign="top" width="20%">
+<a href="decode.html#sys">system status word</a>
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>version</code>
+</td><td valign="top" width="20%">
+NTP software version and build time
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>processor</code>
+</td><td valign="top" width="20%">
+hardware platform and version
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>system</code>
+</td><td valign="top" width="20%">
+operating system and version
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>leap</code>
+</td><td valign="top" width="20%">
+leap warning indicator (0-3)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>stratum</code>
+</td><td valign="top" width="20%">
+stratum (1-15)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>precision</code>
+</td><td valign="top" width="20%">
+precision (log(2) s)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdelay</code>
+</td><td valign="top" width="20%">
+total roundtrip delay to the primary reference clock
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdisp</code>
+</td><td valign="top" width="20%">
+total dispersion to the primary reference clock
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>peer</code>
+</td><td valign="top" width="20%">
+system peer association ID
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>tc</code>
+time constant and poll exponent (log(2) s) (3-17)
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>mintc</code>
+minimum time constant (log(2) s) (3-10)
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>clock</code>
+</td><td valign="top" width="20%">
+date and time of day
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
+reference ID or <a href="decode.html#kiss">kiss code</a>
+
+ <p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reftime</code>
+</td><td valign="top" width="20%">
+reference time
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>offset</code>
+</td><td valign="top" width="20%">
+combined offset of server relative to this host
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>sys_jitter</code>
+</td><td valign="top" width="20%">
+combined system jitter
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>frequency</code>
+</td><td valign="top" width="20%">
+frequency offset (PPM) relative to hardware clock
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>clk_wander</code>
+</td><td valign="top" width="20%">
+clock frequency wander (PPM)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>clk_jitter</code>
+</td><td valign="top" width="20%">
+clock jitter
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>tai</code>
+</td><td valign="top" width="20%">
+TAI-UTC offset (s)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>leapsec</code>
+</td><td valign="top" width="20%">
+NTP seconds when the next leap second is/was inserted
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>expire</code>
+</td><td valign="top" width="20%">
+NTP seconds when the NIST leapseconds file expires
+
+ <br></td></tr></table>
+
+ <p>The jitter and wander statistics are exponentially-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+
+ <p>When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed, including some or all of the
+following, depending on the particular Autokey dance:
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
+
+<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>host</code>
+</td><td valign="top" width="20%">
+Autokey host name for this host
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>ident</code>
+</td><td valign="top" width="20%">
+Autokey group name for this host
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
+</td><td valign="top" width="20%">
+host flags (see Autokey specification)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>digest</code>
+</td><td valign="top" width="20%">
+OpenSSL message digest algorithm
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>signature</code>
+</td><td valign="top" width="20%">
+OpenSSL digest/signature scheme
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>update</code>
+</td><td valign="top" width="20%">
+NTP seconds at last signature update
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>cert</code>
+</td><td valign="top" width="20%">
+certificate subject, issuer and certificate flags
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>until</code>
+</td><td valign="top" width="20%">
+NTP seconds when the certificate expires
+
+ <br></td></tr></table>
+
+<div class="node">
+<p><hr>
+<a name="Peer-Variables"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Clock-Variables">Clock Variables</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#System-Variables">System Variables</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Peer Variables</h3>
+
+<p>The following peer variables appear in the <code>rv</code> billboard
+for each association.
+Not all variables are displayed in some configurations.
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
+
+<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>associd</code>
+</td><td valign="top" width="20%">
+association ID
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
+</td><td valign="top" width="20%">
+<a href="decode.html#peer">peer status word</a>
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>srcadr</code>
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>srcport</code>
+</td><td valign="top" width="20%">
+source (remote) IP address and port
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>dstadr</code>
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>dstport</code>
+</td><td valign="top" width="20%">
+destination (local) IP address and port
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>leap</code>
+</td><td valign="top" width="20%">
+leap indicator (0-3)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>stratum</code>
+</td><td valign="top" width="20%">
+stratum (0-15)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>precision</code>
+</td><td valign="top" width="20%">
+precision (log(2) s)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdelay</code>
+</td><td valign="top" width="20%">
+total roundtrip delay to the primary reference clock
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdisp</code>
+</td><td valign="top" width="20%">total root dispersion to the primary reference clock
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
+</td><td valign="top" width="20%">
+reference ID or <a href="decode.html#kiss">kiss code</a>
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reftime</code>
+</td><td valign="top" width="20%">
+reference time
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reach</code>
+</td><td valign="top" width="20%">
+reach register (octal)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>unreach</code>
+</td><td valign="top" width="20%">
+unreach counter
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>hmode</code>
+</td><td valign="top" width="20%">
+host mode (1-6)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>pmode</code>
+</td><td valign="top" width="20%">
+peer mode (1-5)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>hpoll</code>
+</td><td valign="top" width="20%">
+host poll exponent (log(2) s) (3-17)
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>ppoll</code>
+</td><td valign="top" width="20%">
+peer poll exponent (log(2) s) (3-17)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>headway</code>
+</td><td valign="top" width="20%">
+headway (see <a href="rate.html">Rate Management and the Kiss-o'-Death Packet</a>)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>flash</code>
+</td><td valign="top" width="20%">
+<a href="decode.html#flash">flash status word</a>
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>offset</code>
+</td><td valign="top" width="20%">
+filter offset
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>delay</code>
+</td><td valign="top" width="20%">
+filter delay
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>dispersion</code>
+</td><td valign="top" width="20%">
+filter dispersion
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>jitter</code>
+</td><td valign="top" width="20%">
+filter jitter
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>ident</code>
+</td><td valign="top" width="20%">
+Autokey group name for this association
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>bias</code>
+</td><td valign="top" width="20%">
+unicast/broadcast bias
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>xleave</code>
+</td><td valign="top" width="20%">
+interleave delay (see <a href="xleave.html">NTP Interleaved Modes</a>)
+
+ <br></td></tr></table>
+
+ <p>The bias variable is calculated when the first broadcast packet is received
+after the calibration volley. It represents the offset of the broadcast
+subgraph relative to the unicast subgraph. The xleave variable appears
+only the interleaved symmetric and interleaved modes. It represents
+the internal queuing, buffering and transmission delays for the preceding
+packet.
+
+ <p>When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
+
+<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
+</td><td valign="top" width="20%">
+peer flags (see Autokey specification)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>host</code>
+</td><td valign="top" width="20%">
+Autokey server name
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
+</td><td valign="top" width="20%">
+peer flags (see Autokey specification)
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>signature</code>
+</td><td valign="top" width="20%">
+OpenSSL digest/signature scheme
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>initsequence</code>
+</td><td valign="top" width="20%">
+initial key ID
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>initkey</code>
+</td><td valign="top" width="20%">
+initial key index
+
+<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>timestamp</code>
+</td><td valign="top" width="20%">
+Autokey signature timestamp
+
+ <br></td></tr></table>
+
+<div class="node">
+<p><hr>
+<a name="Clock-Variables"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Peer-Variables">Peer Variables</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Clock Variables</h3>
+
+<p>The following clock variables appear in the <code>cv</code> billboard for each association with a reference clock. Not all variables are displayed in some configurations.
+
+ <p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
+<br></th></tr><tr align="left"><td valign="top" width="10%"><code>associd</code>
+</td><td valign="top" width="20%">association ID
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
+</td><td valign="top" width="20%"><a href="decode.html#clock">clock status word</a>
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>device</code>
+</td><td valign="top" width="20%">device description
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>timecode</code>
+</td><td valign="top" width="20%">ASCII time code string (specific to device)
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>poll</code>
+</td><td valign="top" width="20%">poll messages sent
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>noreply</code>
+</td><td valign="top" width="20%">no reply
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>badformat</code>
+</td><td valign="top" width="20%">bad format
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>baddata</code>
+</td><td valign="top" width="20%">bad date or time
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>fudgetime1</code>
+</td><td valign="top" width="20%">fudge time 1
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>fudgetime2</code>
+</td><td valign="top" width="20%">fudge time 2
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>stratum</code>
+</td><td valign="top" width="20%">driver stratum
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
+</td><td valign="top" width="20%">driver reference ID
+<br></td></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
+</td><td valign="top" width="20%">driver flags
+ <br></td></tr></table>
+
+</body></html>
+
diff --git a/ntpq/ntpq.man.in b/ntpq/ntpq.man.in
new file mode 100644
index 0000000..4daca5a
--- /dev/null
+++ b/ntpq/ntpq.man.in
@@ -0,0 +1,1408 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpq @NTPQ_MS@ "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-fJaqSO/ag-rJaiRO)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:04 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpq-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpq\fP
+\- standard NTP query program
+.SH SYNOPSIS
+\f\*[B-Font]ntpq\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ host ...]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The
+\f\*[B-Font]ntpq\fP
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty-printed output
+options being available.
+The
+\f\*[B-Font]ntpq\fP
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+If one or more request options is included on the command line
+when
+\f\*[B-Font]ntpq\fP
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+\f\*[B-Font]ntpq\fP
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+\f\*[B-Font]ntpq\fP
+utility will prompt for
+commands if the standard input is a terminal device.
+\f\*[B-Font]ntpq\fP
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+\f\*[B-Font]ntpq\fP
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+Specifying a
+command line option other than
+\f\*[B-Font]\-i\f[]
+or
+\f\*[B-Font]\-n\f[]
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+\f\*[B-Font]ntpq\fP
+will attempt to read
+interactive format commands from the standard input.
+.SS "Internal Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+A
+number of interactive format commands are executed entirely within
+the
+\f\*[B-Font]ntpq\fP
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+.TP 20
+.NOP \f\*[B-Font]?\f[] [\f\*[I-Font]command_keyword\f[]]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]help\f[] [\f\*[I-Font]command_keyword\f[]]
+A
+\[oq]\&?\[cq]
+by itself will print a list of all the command
+keywords known to this incarnation of
+\f\*[B-Font]ntpq\fP.
+A
+\[oq]\&?\[cq]
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+\f\*[B-Font]ntpq\fP
+than this manual
+page.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]addvars\f[] \f\*[I-Font]variable_name\f[][\f\*[B-Font]=value\f[]] \f\*[B-Font]...\f[]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]rmvars\f[] \f\*[I-Font]variable_name\f[] \f\*[B-Font]...\f[]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]clearvars\f[]
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]showvars\f[]
+The data carried by NTP mode 6 messages consists of a list of
+items of the form
+\[oq]variable_name=value\[cq],
+where the
+\[oq]=value\[cq]
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+\f\*[B-Font]ntpq\fP
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+\f\*[B-Font]readlist\f[]
+and
+\f\*[B-Font]writelist\f[]
+commands described below.
+The
+\f\*[B-Font]addvars\f[]
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma-separated and not contain white space.
+The
+\f\*[B-Font]rmvars\f[]
+command can be used to remove individual variables from the list,
+while the
+\f\*[B-Font]clearlist\f[]
+command removes all variables from the
+list.
+The
+\f\*[B-Font]showvars\f[]
+command displays the current list of optional variables.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]authenticate\f[] [yes | no]
+Normally
+\f\*[B-Font]ntpq\fP
+does not authenticate requests unless
+they are write requests.
+The command
+\[oq]authenticate yes\[cq]
+causes
+\f\*[B-Font]ntpq\fP
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+\f\*[B-Font]peer\f[]
+display.
+The command
+\[oq]authenticate\[cq]
+causes
+\f\*[B-Font]ntpq\fP
+to display whether or not
+\f\*[B-Font]ntpq\fP
+is currently autheinticating requests.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]cooked\f[]
+Causes output from query commands to be "cooked", so that
+variables which are recognized by
+\f\*[B-Font]ntpq\fP
+will have their
+values reformatted for human consumption.
+Variables which
+\f\*[B-Font]ntpq\fP
+thinks should have a decodable value but didn't are
+marked with a trailing
+\[oq]\&?\[cq].
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]debug\f[] [\f\*[B-Font]more\f[] | \f\*[B-Font]less\f[] | \f\*[B-Font]off\f[]]
+With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]delay\f[] \f\*[I-Font]milliseconds\f[]
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]exit\f[]
+Exit
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]host\f[] \f\*[I-Font]hostname\f[]
+Set the host to which future queries will be sent.
+\f\*[I-Font]hostname\f[]
+may be either a host name or a numeric address.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]hostnames\f[] [\f\*[B-Font]yes\f[] | \f\*[B-Font]no\f[]]
+If
+\f\*[B-Font]yes\f[]
+is specified, host names are printed in
+information displays.
+If
+\f\*[B-Font]no\f[]
+is specified, numeric
+addresses are printed instead.
+The default is
+\f\*[B-Font]yes\f[],
+unless
+modified using the command line
+\f\*[B-Font]\-n\f[]
+switch.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]keyid\f[] \f\*[I-Font]keyid\f[]
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]keytype\f[] [\f\*[B-Font]md5\f[] | \f\*[B-Font]OpenSSLDigestType\f[]]
+Specify the type of key to use for authenticating requests.
+\f\*[B-Font]md5\f[]
+is alway supported.
+If
+\f\*[B-Font]ntpq\fP
+was built with OpenSSL support,
+any digest type supported by OpenSSL can also be provided.
+If no argument is given, the current
+\f\*[B-Font]keytype\f[]
+is displayed.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]ntpversion\f[] [\f\*[B-Font]1\f[] | \f\*[B-Font]2\f[] | \f\*[B-Font]3\f[] | \f\*[B-Font]4\f[]]
+Sets the NTP version number which
+\f\*[B-Font]ntpq\fP
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]passwd\f[]
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.\" Not yet implemented.
+.\" .It Ic poll
+.\" .Op Ar n
+.\" .Op Ic verbose
+.\" Poll an NTP server in client mode
+.\" .Ar n
+.\" times.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]quit\f[]
+Exit
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]raw\f[]
+Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]timeout\f[] \f\*[I-Font]milliseconds\f[]
+Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+\f\*[B-Font]ntpq\fP
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.br
+.ns
+.TP 20
+.NOP \f\*[B-Font]version\f[]
+Print the version of the
+\f\*[B-Font]ntpq\fP
+program.
+.PP
+.SS "Control Message Commands"
+Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode-6 message to the server and expect a single response message.
+The exceptions are the
+\f[C]peers\f[]
+command, which sends a series of messages,
+and the
+\f[C]mreadlist\f[]
+and
+\f[C]mreadvar\f[]
+commands, which iterate over a range of associations.
+.TP 10
+.NOP \f\*[B-Font]associations\f[]
+Display a list of mobilized associations in the form:
+.Dl ind assid status conf reach auth condition last_event cnt
+.RS
+.IP \fB\(bu\fP 2
+.IP \fB\(bu\fP 2 \f[C]ind\f[] \f[C]Ta\f[] \f[C]index\f[] \f[C]on\f[] \f[C]this\f[] \f[C]list\f[]
+.IP \fB\(bu\fP 2 \f[C]assid\f[] \f[C]Ta\f[] \f[C]association\f[] \f[C]ID\f[]
+.IP \fB\(bu\fP 2 \f[C]status\f[] \f[C]Ta\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word\f[]
+.IP \fB\(bu\fP 2 \f[C]conf\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]persistent,\f[] \f[C]no\f[]: \f[C]ephemeral\f[]
+.IP \fB\(bu\fP 2 \f[C]reach\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]reachable,\f[] \f[C]no\f[]: \f[C]unreachable\f[]
+.IP \fB\(bu\fP 2 \f[C]auth\f[] \f[C]Ta\f[] \f[C]ok\f[], \f[C]yes\f[], \f[C]bad\f[] \f[C]and\f[] \f[C]none\f[]
+.IP \fB\(bu\fP 2 \f[C]condition\f[] \f[C]Ta\f[] \f[C]selection\f[] \f[C]status\f[] \f[C](see\f[] \f[C]the\f[] \f[C]select\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
+.IP \fB\(bu\fP 2 \f[C]last_event\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]report\f[] \f[C](see\f[] \f[C]the\f[] \f[C]event\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
+.IP \fB\(bu\fP 2 \f[C]cnt\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]count\f[] \f[C](see\f[] \f[C]the\f[] \f[C]count\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[]
+.RE
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]authinfo\f[]
+Display the authentication statistics.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clockvar\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...]
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]cv\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...]
+Display a list of clock variables for those associations supporting a reference clock.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]:config\f[] [...]
+Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]config-from-file\f[] \f\*[I-Font]filename\f[]
+Send the each line of
+\f\*[I-Font]filename\f[]
+to the server as run-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ifstats\f[]
+Display statistics for each local network address. Authentication is required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]iostats\f[]
+Display network and reference clock I/O statistics.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]kerninfo\f[]
+Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lassociations\f[]
+Perform the same function as the associations command, except display mobilized and unmobilized associations.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lopeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
+Obtain and print a list of all peers and clients showing
+\f\*[I-Font]dstadr\f[]
+(associated with any given IP version).
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lpeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
+Print a peer spreadsheet for the appropriate IP version(s).
+\f\*[I-Font]dstadr\f[]
+(associated with any given IP version).
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]monstats\f[]
+Display monitor facility statistics.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mrulist\f[] [\f\*[B-Font]limited\f[] | \f\*[B-Font]kod\f[] | \f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[] | \f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[] | \f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[] | \f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[] | \f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[]]
+Obtain and print traffic counts collected and maintained by the monitor facility.
+With the exception of
+\f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[],
+the options filter the list returned by
+\f\*[B-Font]ntpd.\f[]
+The
+\f\*[B-Font]limited\f[]
+and
+\f\*[B-Font]kod\f[]
+options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
+The
+\f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[]
+option filters entries representing less than
+\f\*[I-Font]count\f[]
+packets.
+The
+\f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[]
+option filters entries for packets received on any local address other than
+\f\*[I-Font]localaddr\f[].
+\f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[]
+and
+\f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[]
+filter entries containing none or less than all, respectively, of the bits in
+\f\*[I-Font]hexmask\f[],
+which must begin with
+\f\*[B-Font]0x\f[].
+The
+\f\*[I-Font]sortorder\f[]
+defaults to
+\f\*[B-Font]lstint\f[]
+and may be any of
+\f\*[B-Font]addr\f[],
+\f\*[B-Font]count\f[],
+\f\*[B-Font]avgint\f[],
+\f\*[B-Font]lstint\f[],
+or any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+.RS
+.TP 10
+.NOP Column
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]lstint\f[]
+Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]avgint\f[]
+Average interval in s between packets from this address.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rstr\f[]
+Restriction flags associated with this address.
+Most are copied unchanged from the matching
+\f\*[B-Font]restrict\f[]
+command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]r\f[]
+Rate control indicator, either
+a period,
+\f\*[B-Font]L\f[]
+or
+\f\*[B-Font]K\f[]
+for no rate control response,
+rate limiting by discarding, or rate limiting with a KoD response, respectively.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]m\f[]
+Packet mode.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]v\f[]
+Packet version number.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]count\f[]
+Packets received from this address.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rport\f[]
+Source port of last packet from this address.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]remote\f[] \f\*[B-Font]address\f[]
+DNS name, numeric address, or address followed by
+claimed DNS name which could not be verified in parentheses.
+.RE
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mreadvar\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ...
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mrv\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ...
+Perform the same function as the
+\f\*[B-Font]readvar\f[]
+command, except for a range of association IDs.
+This range is determined from the association list cached by the most recent
+\f\*[B-Font]associations\f[]
+command.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]opeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]]
+Obtain and print the old-style list of all peers and clients showing
+\f\*[I-Font]dstadr\f[]
+(associated with any given IP version),
+rather than the
+\f\*[I-Font]refid\f[].
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]passociations\f[]
+Perform the same function as the
+\f\*[B-Font]associations\f[]
+command,
+except that it uses previously stored data rather than making a new query.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]peers\f[]
+Display a list of peers in the form:
+.Dl [tally]remote refid st t when pool reach delay offset jitter
+.RS
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font][tally]\f[]
+single-character code indicating current value of the
+\f\*[B-Font]select\f[]
+field of the
+.Lk decode.html#peer "peer status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]remote\f[]
+host name (or IP number) of peer.
+The value displayed will be truncated to 15 characters unless the
+\f\*[B-Font]\-w\f[]
+flag is given, in which case the full value will be displayed
+on the first line,
+and the remaining data is displayed on the next line.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+association ID or
+.Lk decode.html#kiss "'kiss code"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]st\f[]
+stratum
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]t\f[]
+\f\*[B-Font]u\f[]:
+unicast or manycast client,
+\f\*[B-Font]b\f[]:
+broadcast or multicast client,
+\f\*[B-Font]l\f[]:
+local (reference clock),
+\f\*[B-Font]s\f[]:
+symmetric (peer),
+\f\*[B-Font]A\f[]:
+manycast server,
+\f\*[B-Font]B\f[]:
+broadcast server,
+\f\*[B-Font]M\f[]:
+multicast server
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]when\f[]
+sec/min/hr since last received packet
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]poll\f[]
+poll interval (log2 s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reach\f[]
+reach shift register (octal)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]delay\f[]
+roundtrip delay
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]offset\f[]
+offset of server relative to this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]jitter\f[]
+jitter
+.RE
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]pstats\f[] \f\*[I-Font]assocID\f[]
+Show the statistics for the peer with the given
+\f\*[I-Font]assocID\f[].
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]readlist\f[] \f\*[I-Font]assocID\f[]
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rl\f[] \f\*[I-Font]assocID\f[]
+Read the system or peer variables included in the variable list.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]readvar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...]
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rv\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...]
+Display the specified variables.
+If
+\f\*[I-Font]assocID\f[]
+is zero, the variables are from the
+\fISystem\f[] \fIVariables\f[]
+name space, otherwise they are from the
+\fIPeer\f[] \fIVariables\f[]
+name space.
+The
+\f\*[I-Font]assocID\f[]
+is required, as the same name can occur in both spaces.
+If no
+\f\*[I-Font]name\f[]
+is included, all operative variables in the name space are displayed.
+In this case only, if the
+\f\*[I-Font]assocID\f[]
+is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds
+and frequency values in parts-per-million (PPM).
+Some NTP timestamps are represented in the format
+YYYYMMDDTTTT ,
+where YYYY is the year,
+MM the month of year,
+DD the day of month and
+TTTT the time of day.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reslist\f[]
+Show the access control (restrict) list for
+\f\*[B-Font]ntpq\fP.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]saveconfig\f[] \f\*[I-Font]filename\f[]
+Write the current configuration,
+including any runtime modifications given with
+\f\*[B-Font]:config\f[]
+or
+\f\*[B-Font]config-from-file\f[],
+to the ntpd host's file
+\f\*[I-Font]filename\f[].
+This command will be rejected by the server unless
+.Lk miscopt.html#saveconfigdir "saveconfigdir"
+appears in the
+\f\*[B-Font]ntpd\f[]
+configuration file.
+\f\*[I-Font]filename\f[]
+can use
+\fCstrftime\fR()\f[]
+format specifies to substitute the current date and time, for example,
+\f\*[B-Font]q]saveconfig\f[] \f\*[B-Font]ntp-%Y%m%d-%H%M%S.confq]\f[].
+The filename used is stored in system variable
+\f\*[B-Font]savedconfig\f[].
+Authentication is required.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]timerstats\f[]
+Display interval timer counters.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]writelist\f[] \f\*[I-Font]assocID\f[]
+Write the system or peer variables included in the variable list.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]writevar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[]=\f\*[I-Font]value\f[] [, ...]
+Write the specified variables.
+If the
+\f\*[I-Font]assocID\f[]
+is zero, the variables are from the
+\fISystem\f[] \fIVariables\f[]
+name space, otherwise they are from the
+\fIPeer\f[] \fIVariables\f[]
+name space.
+The
+\f\*[I-Font]assocID\f[]
+is required, as the same name can occur in both spaces.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]sysinfo\f[]
+Display operational summary.
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]sysstats\f[]
+Print statistics counters maintained in the protocol module.
+.PP
+.SS Status Words and Kiss Codes
+The current state of the operating program is shown
+in a set of status words
+maintained by the system.
+Status information is also available on a per-association basis.
+These words are displayed in the
+\f\*[B-Font]rv\f[]
+and
+\f\*[B-Font]as\f[]
+commands both in hexadecimal and in decoded short tip strings.
+The codes, tips and short explanations are documented on the
+.Lk decode.html "Event Messages and Status Words"
+page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+.sp \n(Ppu
+.ne 2
+
+Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+.Lk decode.html#kiss "kiss codes" .
+The original purpose was for kiss-o'-death (KoD) packets
+sent by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+.SS System Variables
+The following system variables appear in the
+\f\*[B-Font]rv\f[]
+billboard.
+Not all variables are displayed in some configurations.
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]status\f[]
+.Lk decode.html#sys "system status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]version\f[]
+NTP software version and build time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]processor\f[]
+hardware platform and version
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]system\f[]
+operating system and version
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]leap\f[]
+leap warning indicator (0-3)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]stratum\f[]
+stratum (1-15)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]precision\f[]
+precision (log2 s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdelay\f[]
+total roundtrip delay to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdisp\f[]
+total dispersion to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]peer\f[]
+system peer association ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]tc\f[]
+time constant and poll exponent (log2 s) (3-17)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]mintc\f[]
+minimum time constant (log2 s) (3-10)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clock\f[]
+date and time of day
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reftime\f[]
+reference time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]offset\f[]
+combined offset of server relative to this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]sys_jitter\f[]
+combined system jitter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]frequency\f[]
+frequency offset (PPM) relative to hardware clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clk_wander\f[]
+clock frequency wander (PPM)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]clk_jitter\f[]
+clock jitter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]tai\f[]
+TAI-UTC offset (s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]leapsec\f[]
+NTP seconds when the next leap second is/was inserted
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]expire\f[]
+NTP seconds when the NIST leapseconds file expires
+.PP
+The jitter and wander statistics are exponentially-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+.sp \n(Ppu
+.ne 2
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed,
+including some or all of the following,
+depending on the particular Autokey dance:
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]host\f[]
+Autokey host name for this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ident\f[]
+Autokey group name for this host
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+host flags (see Autokey specification)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]digest\f[]
+OpenSSL message digest algorithm
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]signature\f[]
+OpenSSL digest/signature scheme
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]update\f[]
+NTP seconds at last signature update
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]cert\f[]
+certificate subject, issuer and certificate flags
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]until\f[]
+NTP seconds when the certificate expires
+.PP
+.SS Peer Variables
+The following peer variables appear in the
+\f\*[B-Font]rv\f[]
+billboard for each association.
+Not all variables are displayed in some configurations.
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]associd\f[]
+association ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]status\f[]
+.Lk decode.html#peer "peer status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]srcadr\f[]
+source (remote) IP address
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]srcport\f[]
+source (remote) port
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]dstadr\f[]
+destination (local) IP address
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]dstport\f[]
+destination (local) port
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]leap\f[]
+leap indicator (0-3)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]stratum\f[]
+stratum (0-15)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]precision\f[]
+precision (log2 s)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdelay\f[]
+total roundtrip delay to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]rootdisp\f[]
+total root dispersion to the primary reference clock
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reftime\f[]
+reference time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]reach\f[]
+reach register (octal)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]unreach\f[]
+unreach counter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]hmode\f[]
+host mode (1-6)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]pmode\f[]
+peer mode (1-5)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]hpoll\f[]
+host poll exponent (log2 s) (3-17)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ppoll\f[]
+peer poll exponent (log2 s) (3-17)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]headway\f[]
+headway (see
+.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" )
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flash\f[]
+.Lk decode.html#flash "flash status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]offset\f[]
+filter offset
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]delay\f[]
+filter delay
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]dispersion\f[]
+filter dispersion
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]jitter\f[]
+filter jitter
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]ident\f[]
+Autokey group name for this association
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]bias\f[]
+unicast/broadcast bias
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]xleave\f[]
+interleave delay (see
+.Lk xleave.html "NTP Interleaved Modes" )
+.PP
+The
+\f\*[B-Font]bias\f[]
+variable is calculated when the first broadcast packet is received
+after the calibration volley.
+It represents the offset of the broadcast subgraph relative to the unicast subgraph.
+The
+\f\*[B-Font]xleave\f[]
+variable appears only for the interleaved symmetric and interleaved modes.
+It represents the internal queuing, buffering and transmission delays
+for the preceding packet.
+.sp \n(Ppu
+.ne 2
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+peer flags (see Autokey specification)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]host\f[]
+Autokey server name
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+peer flags (see Autokey specification)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]signature\f[]
+OpenSSL digest/signature scheme
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]initsequence\f[]
+initial key ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]initkey\f[]
+initial key index
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]timestamp\f[]
+Autokey signature timestamp
+.PP
+.SS Clock Variables
+The following clock variables appear in the
+\f\*[B-Font]cv\f[]
+billboard for each association with a reference clock.
+Not all variables are displayed in some configurations.
+.TP 10
+.NOP Variable
+Description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]associd\f[]
+association ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]status\f[]
+.Lk decode.html#clock "clock status word"
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]device\f[]
+device description
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]timecode\f[]
+ASCII time code string (specific to device)
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]poll\f[]
+poll messages sent
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]noreply\f[]
+no reply
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]badformat\f[]
+bad format
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]baddata\f[]
+bad date or time
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]fudgetime1\f[]
+fudge time 1
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]fudgetime2\f[]
+fudge time 2
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]stratum\f[]
+driver stratum
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]refid\f[]
+driver reference ID
+.br
+.ns
+.TP 10
+.NOP \f\*[B-Font]flags\f[]
+driver flags
+.PP
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[]
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[]
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, peers.
+.sp
+Force \fBntpq\fP to operate in interactive mode.
+Prompts will be written to the standard output and
+commands read from the standard input.
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+numeric host addresses.
+.sp
+Output all host addresses in dotted-quad numeric format rather than
+converting to the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-\-old\-rv\f[]
+Always output status line with readvar.
+.sp
+By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
+line that precedes the output of \fBreadvar\fP
+(alias \fBrv\fP) when a single variable is requested, such as
+\fBntpq \-c "rv 0 offset"\fP.
+This option causes \fBntpq\fP to include both lines of output
+for a single-variable \fBreadvar\fP.
+Using an environment variable to
+preset this option in a script will enable both older and
+newer \fBntpq\fP to behave identically in this regard.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+interactive.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.TP
+.NOP \f\*[B-Font]\-w\f[], \f\*[B-Font]\-\-wide\f[]
+Display the full 'remote' value.
+.sp
+Display the full value of the 'remote' value. If this requires
+more than 15 characters, display the full value, emit a newline,
+and continue the data display properly indented on the next line.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPQ_<option-name>\fP or \fBNTPQ\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpq\fP
+option definitions.
diff --git a/ntpq/ntpq.mdoc.in b/ntpq/ntpq.mdoc.in
new file mode 100644
index 0000000..9666347
--- /dev/null
+++ b/ntpq/ntpq.mdoc.in
@@ -0,0 +1,954 @@
+.Dd December 2 2014
+.Dt NTPQ @NTPQ_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:10 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpq-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpq
+.Nd standard NTP query program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ host ...]
+.Pp
+.Sh DESCRIPTION
+The
+.Nm
+utility program is used to query NTP servers which
+implement the standard NTP mode 6 control message formats defined
+in Appendix B of the NTPv3 specification RFC1305, requesting
+information about current state and/or changes in that state.
+The same formats are used in NTPv4, although some of the
+variables have changed and new ones added. The description on this
+page is for the NTPv4 variables.
+The program may be run either in interactive mode or controlled using
+command line arguments.
+Requests to read and write arbitrary
+variables can be assembled, with raw and pretty\-printed output
+options being available.
+The
+.Nm
+utility can also obtain and print a
+list of peers in a common format by sending multiple queries to the
+server.
+If one or more request options is included on the command line
+when
+.Nm
+is executed, each of the requests will be sent
+to the NTP servers running on each of the hosts given as command
+line arguments, or on localhost by default.
+If no request options
+are given,
+.Nm
+will attempt to read commands from the
+standard input and execute these on the NTP server running on the
+first host given on the command line, again defaulting to localhost
+when no other host is specified.
+The
+.Nm
+utility will prompt for
+commands if the standard input is a terminal device.
+.Nm
+uses NTP mode 6 packets to communicate with the
+NTP server, and hence can be used to query any compatible server on
+the network which permits it.
+Note that since NTP is a UDP protocol
+this communication will be somewhat unreliable, especially over
+large distances in terms of network topology.
+The
+.Nm
+utility makes
+one attempt to retransmit requests, and will time requests out if
+the remote host is not heard from within a suitable timeout
+time.
+Specifying a
+command line option other than
+.Fl i
+or
+.Fl n
+will
+cause the specified query (queries) to be sent to the indicated
+host(s) immediately.
+Otherwise,
+.Nm
+will attempt to read
+interactive format commands from the standard input.
+.Ss "Internal Commands"
+Interactive format commands consist of a keyword followed by zero
+to four arguments.
+Only enough characters of the full keyword to
+uniquely identify the command need be typed.
+A
+number of interactive format commands are executed entirely within
+the
+.Nm
+utility itself and do not result in NTP mode 6
+requests being sent to a server.
+These are described following.
+.Bl -tag -width "? [command_keyword]" -compact -offset indent
+.It Ic ? Op Ar command_keyword
+.It Ic help Op Ar command_keyword
+A
+.Ql \&?
+by itself will print a list of all the command
+keywords known to this incarnation of
+.Nm .
+A
+.Ql \&?
+followed by a command keyword will print function and usage
+information about the command.
+This command is probably a better
+source of information about
+.Nm
+than this manual
+page.
+.It Ic addvars Ar variable_name Ns Xo Op Ic =value
+.Ic ...
+.Xc
+.It Ic rmvars Ar variable_name Ic ...
+.It Ic clearvars
+.It Ic showvars
+The data carried by NTP mode 6 messages consists of a list of
+items of the form
+.Ql variable_name=value ,
+where the
+.Ql =value
+is ignored, and can be omitted,
+in requests to the server to read variables.
+The
+.Nm
+utility maintains an internal list in which data to be included in control
+messages can be assembled, and sent using the
+.Ic readlist
+and
+.Ic writelist
+commands described below.
+The
+.Ic addvars
+command allows variables and their optional values to be added to
+the list.
+If more than one variable is to be added, the list should
+be comma\-separated and not contain white space.
+The
+.Ic rmvars
+command can be used to remove individual variables from the list,
+while the
+.Ic clearlist
+command removes all variables from the
+list.
+The
+.Ic showvars
+command displays the current list of optional variables.
+.It Ic authenticate Op yes | no
+Normally
+.Nm
+does not authenticate requests unless
+they are write requests.
+The command
+.Ql authenticate yes
+causes
+.Nm
+to send authentication with all requests it
+makes.
+Authenticated requests causes some servers to handle
+requests slightly differently, and can occasionally melt the CPU in
+fuzzballs if you turn authentication on before doing a
+.Ic peer
+display.
+The command
+.Ql authenticate
+causes
+.Nm
+to display whether or not
+.Nm
+is currently autheinticating requests.
+.It Ic cooked
+Causes output from query commands to be "cooked", so that
+variables which are recognized by
+.Nm
+will have their
+values reformatted for human consumption.
+Variables which
+.Nm
+thinks should have a decodable value but didn't are
+marked with a trailing
+.Ql \&? .
+.It Xo
+.Ic debug
+.Oo
+.Cm more |
+.Cm less |
+.Cm off
+.Oc
+.Xc
+With no argument, displays the current debug level.
+Otherwise, the debug level is changed to the indicated level.
+.It Ic delay Ar milliseconds
+Specify a time interval to be added to timestamps included in
+requests which require authentication.
+This is used to enable
+(unreliable) server reconfiguration over long delay network paths
+or between machines whose clocks are unsynchronized.
+Actually the
+server does not now require timestamps in authenticated requests,
+so this command may be obsolete.
+.It Ic exit
+Exit
+.Nm .
+.It Ic host Ar hostname
+Set the host to which future queries will be sent.
+.Ar hostname
+may be either a host name or a numeric address.
+.It Ic hostnames Op Cm yes | Cm no
+If
+.Cm yes
+is specified, host names are printed in
+information displays.
+If
+.Cm no
+is specified, numeric
+addresses are printed instead.
+The default is
+.Cm yes ,
+unless
+modified using the command line
+.Fl n
+switch.
+.It Ic keyid Ar keyid
+This command allows the specification of a key number to be
+used to authenticate configuration requests.
+This must correspond
+to a key number the server has been configured to use for this
+purpose.
+.It Ic keytype Xo Oo
+.Cm md5 |
+.Cm OpenSSLDigestType
+.Oc
+.Xc
+Specify the type of key to use for authenticating requests.
+.Cm md5
+is alway supported.
+If
+.Nm
+was built with OpenSSL support,
+any digest type supported by OpenSSL can also be provided.
+If no argument is given, the current
+.Ic keytype
+is displayed.
+.It Ic ntpversion Xo Oo
+.Cm 1 |
+.Cm 2 |
+.Cm 3 |
+.Cm 4
+.Oc
+.Xc
+Sets the NTP version number which
+.Nm
+claims in
+packets.
+Defaults to 3, and note that mode 6 control messages (and
+modes, for that matter) didn't exist in NTP version 1.
+There appear
+to be no servers left which demand version 1.
+With no argument, displays the current NTP version that will be used
+when communicating with servers.
+.It Ic passwd
+This command prompts you to type in a password (which will not
+be echoed) which will be used to authenticate configuration
+requests.
+The password must correspond to the key configured for
+use by the NTP server for this purpose if such requests are to be
+successful.
+.\" Not yet implemented.
+.\" .It Ic poll
+.\" .Op Ar n
+.\" .Op Ic verbose
+.\" Poll an NTP server in client mode
+.\" .Ar n
+.\" times.
+.It Ic quit
+Exit
+.Nm .
+.It Ic raw
+Causes all output from query commands is printed as received
+from the remote server.
+The only formating/interpretation done on
+the data is to transform nonascii data into a printable (but barely
+understandable) form.
+.It Ic timeout Ar milliseconds
+Specify a timeout period for responses to server queries.
+The
+default is about 5000 milliseconds.
+Note that since
+.Nm
+retries each query once after a timeout, the total waiting time for
+a timeout will be twice the timeout value set.
+.It Ic version
+Print the version of the
+.Nm
+program.
+.El
+.Ss "Control Message Commands"
+Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode\-6 message to the server and expect a single response message.
+The exceptions are the
+.Li peers
+command, which sends a series of messages,
+and the
+.Li mreadlist
+and
+.Li mreadvar
+commands, which iterate over a range of associations.
+.Bl -tag -width "something" -compact -offset indent
+.It Cm associations
+Display a list of mobilized associations in the form:
+.Dl ind assid status conf reach auth condition last_event cnt
+.Bl -column -offset indent ".Sy Variable" ".Sy Description"
+.It Sy String Ta Sy Description
+.It Li ind Ta index on this list
+.It Li assid Ta association ID
+.It Li status Ta peer status word
+.It Li conf Ta Li yes : persistent, Li no : ephemeral
+.It Li reach Ta Li yes : reachable, Li no : unreachable
+.It Li auth Ta Li ok , Li yes , Li bad and Li none
+.It Li condition Ta selection status (see the Li select field of the peer status word)
+.It Li last_event Ta event report (see the Li event field of the peer status word)
+.It Li cnt Ta event count (see the Li count field of the peer status word)
+.El
+.It Cm authinfo
+Display the authentication statistics.
+.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
+.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
+Display a list of clock variables for those associations supporting a reference clock.
+.It Cm :config Op ...
+Send the remainder of the command line, including whitespace, to the server as a run\-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
+.It Cm config\-from\-file Ar filename
+Send the each line of
+.Ar filename
+to the server as run\-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
+.It Ic ifstats
+Display statistics for each local network address. Authentication is required.
+.It Ic iostats
+Display network and reference clock I/O statistics.
+.It Ic kerninfo
+Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
+.It Ic lassociations
+Perform the same function as the associations command, except display mobilized and unmobilized associations.
+.It Ic lopeers Xo
+.Oo Ic \-4 |
+.Ic \-6
+.Oc
+.Xc
+Obtain and print a list of all peers and clients showing
+.Ar dstadr
+(associated with any given IP version).
+.It Ic lpeers Xo
+.Oo Ic \-4 |
+.Ic \-6
+.Oc
+.Xc
+Print a peer spreadsheet for the appropriate IP version(s).
+.Ar dstadr
+(associated with any given IP version).
+.It Ic monstats
+Display monitor facility statistics.
+.It Ic mrulist Oo Ic limited | Ic kod | Ic mincount Ns = Ns Ar count | Ic laddr Ns = Ns Ar localaddr | Ic sort Ns = Ns Ar sortorder | Ic resany Ns = Ns Ar hexmask | Ic resall Ns = Ns Ar hexmask Oc
+Obtain and print traffic counts collected and maintained by the monitor facility.
+With the exception of
+.Cm sort Ns = Ns Ar sortorder ,
+the options filter the list returned by
+.Cm ntpd.
+The
+.Cm limited
+and
+.Cm kod
+options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
+The
+.Cm mincount Ns = Ns Ar count
+option filters entries representing less than
+.Ar count
+packets.
+The
+.Cm laddr Ns = Ns Ar localaddr
+option filters entries for packets received on any local address other than
+.Ar localaddr .
+.Cm resany Ns = Ns Ar hexmask
+and
+.Cm resall Ns = Ns Ar hexmask
+filter entries containing none or less than all, respectively, of the bits in
+.Ar hexmask ,
+which must begin with
+.Cm 0x .
+The
+.Ar sortorder
+defaults to
+.Cm lstint
+and may be any of
+.Cm addr ,
+.Cm count ,
+.Cm avgint ,
+.Cm lstint ,
+or any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+.Bl -tag -width "something" -compact -offset indent
+.It Column
+Description
+.It Ic lstint
+Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
+.Nm .
+.It Ic avgint
+Average interval in s between packets from this address.
+.It Ic rstr
+Restriction flags associated with this address.
+Most are copied unchanged from the matching
+.Ic restrict
+command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
+.It Ic r
+Rate control indicator, either
+a period,
+.Ic L
+or
+.Ic K
+for no rate control response,
+rate limiting by discarding, or rate limiting with a KoD response, respectively.
+.It Ic m
+Packet mode.
+.It Ic v
+Packet version number.
+.It Ic count
+Packets received from this address.
+.It Ic rport
+Source port of last packet from this address.
+.It Ic remote address
+DNS name, numeric address, or address followed by
+claimed DNS name which could not be verified in parentheses.
+.El
+.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
+.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
+Perform the same function as the
+.Ic readvar
+command, except for a range of association IDs.
+This range is determined from the association list cached by the most recent
+.Ic associations
+command.
+.It Ic opeers Xo
+.Oo Ic \-4 |
+.Ic \-6
+.Oc
+.Xc
+Obtain and print the old\-style list of all peers and clients showing
+.Ar dstadr
+(associated with any given IP version),
+rather than the
+.Ar refid .
+.It Ic passociations
+Perform the same function as the
+.Ic associations
+command,
+except that it uses previously stored data rather than making a new query.
+.It Ic peers
+Display a list of peers in the form:
+.Dl [tally]remote refid st t when pool reach delay offset jitter
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic [tally]
+single\-character code indicating current value of the
+.Ic select
+field of the
+.Lk decode.html#peer "peer status word"
+.It Ic remote
+host name (or IP number) of peer.
+The value displayed will be truncated to 15 characters unless the
+.Fl w
+flag is given, in which case the full value will be displayed
+on the first line,
+and the remaining data is displayed on the next line.
+.It Ic refid
+association ID or
+.Lk decode.html#kiss "'kiss code"
+.It Ic st
+stratum
+.It Ic t
+.Ic u :
+unicast or manycast client,
+.Ic b :
+broadcast or multicast client,
+.Ic l :
+local (reference clock),
+.Ic s :
+symmetric (peer),
+.Ic A :
+manycast server,
+.Ic B :
+broadcast server,
+.Ic M :
+multicast server
+.It Ic when
+sec/min/hr since last received packet
+.It Ic poll
+poll interval (log2 s)
+.It Ic reach
+reach shift register (octal)
+.It Ic delay
+roundtrip delay
+.It Ic offset
+offset of server relative to this host
+.It Ic jitter
+jitter
+.El
+.It Ic pstats Ar assocID
+Show the statistics for the peer with the given
+.Ar assocID .
+.It Ic readlist Ar assocID
+.It Ic rl Ar assocID
+Read the system or peer variables included in the variable list.
+.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc
+.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc
+Display the specified variables.
+If
+.Ar assocID
+is zero, the variables are from the
+.Sx System Variables
+name space, otherwise they are from the
+.Sx Peer Variables
+name space.
+The
+.Ar assocID
+is required, as the same name can occur in both spaces.
+If no
+.Ar name
+is included, all operative variables in the name space are displayed.
+In this case only, if the
+.Ar assocID
+is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds
+and frequency values in parts\-per\-million (PPM).
+Some NTP timestamps are represented in the format
+YYYYMMDDTTTT ,
+where YYYY is the year,
+MM the month of year,
+DD the day of month and
+TTTT the time of day.
+.It Ic reslist
+Show the access control (restrict) list for
+.Nm .
+.It Ic saveconfig Ar filename
+Write the current configuration,
+including any runtime modifications given with
+.Ic :config
+or
+.Ic config\-from\-file ,
+to the ntpd host's file
+.Ar filename .
+This command will be rejected by the server unless
+.Lk miscopt.html#saveconfigdir "saveconfigdir"
+appears in the
+.Ic ntpd
+configuration file.
+.Ar filename
+can use
+.Xr strftime
+format specifies to substitute the current date and time, for example,
+.Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] .
+The filename used is stored in system variable
+.Ic savedconfig .
+Authentication is required.
+.It Ic timerstats
+Display interval timer counters.
+.It Ic writelist Ar assocID
+Write the system or peer variables included in the variable list.
+.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ...
+Write the specified variables.
+If the
+.Ar assocID
+is zero, the variables are from the
+.Sx System Variables
+name space, otherwise they are from the
+.Sx Peer Variables
+name space.
+The
+.Ar assocID
+is required, as the same name can occur in both spaces.
+.It Ic sysinfo
+Display operational summary.
+.It Ic sysstats
+Print statistics counters maintained in the protocol module.
+.El
+.Ss Status Words and Kiss Codes
+The current state of the operating program is shown
+in a set of status words
+maintained by the system.
+Status information is also available on a per\-association basis.
+These words are displayed in the
+.Ic rv
+and
+.Ic as
+commands both in hexadecimal and in decoded short tip strings.
+The codes, tips and short explanations are documented on the
+.Lk decode.html "Event Messages and Status Words"
+page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+.Pp
+Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+.Lk decode.html#kiss "kiss codes" .
+The original purpose was for kiss\-o'\-death (KoD) packets
+sent by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+.Ss System Variables
+The following system variables appear in the
+.Ic rv
+billboard.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic status
+.Lk decode.html#sys "system status word"
+.It Ic version
+NTP software version and build time
+.It Ic processor
+hardware platform and version
+.It Ic system
+operating system and version
+.It Ic leap
+leap warning indicator (0\-3)
+.It Ic stratum
+stratum (1\-15)
+.It Ic precision
+precision (log2 s)
+.It Ic rootdelay
+total roundtrip delay to the primary reference clock
+.It Ic rootdisp
+total dispersion to the primary reference clock
+.It Ic peer
+system peer association ID
+.It Ic tc
+time constant and poll exponent (log2 s) (3\-17)
+.It Ic mintc
+minimum time constant (log2 s) (3\-10)
+.It Ic clock
+date and time of day
+.It Ic refid
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.It Ic reftime
+reference time
+.It Ic offset
+combined offset of server relative to this host
+.It Ic sys_jitter
+combined system jitter
+.It Ic frequency
+frequency offset (PPM) relative to hardware clock
+.It Ic clk_wander
+clock frequency wander (PPM)
+.It Ic clk_jitter
+clock jitter
+.It Ic tai
+TAI\-UTC offset (s)
+.It Ic leapsec
+NTP seconds when the next leap second is/was inserted
+.It Ic expire
+NTP seconds when the NIST leapseconds file expires
+.El
+The jitter and wander statistics are exponentially\-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+.Pp
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed,
+including some or all of the following,
+depending on the particular Autokey dance:
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic host
+Autokey host name for this host
+.It Ic ident
+Autokey group name for this host
+.It Ic flags
+host flags (see Autokey specification)
+.It Ic digest
+OpenSSL message digest algorithm
+.It Ic signature
+OpenSSL digest/signature scheme
+.It Ic update
+NTP seconds at last signature update
+.It Ic cert
+certificate subject, issuer and certificate flags
+.It Ic until
+NTP seconds when the certificate expires
+.El
+.Ss Peer Variables
+The following peer variables appear in the
+.Ic rv
+billboard for each association.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic associd
+association ID
+.It Ic status
+.Lk decode.html#peer "peer status word"
+.It Ic srcadr
+source (remote) IP address
+.It Ic srcport
+source (remote) port
+.It Ic dstadr
+destination (local) IP address
+.It Ic dstport
+destination (local) port
+.It Ic leap
+leap indicator (0\-3)
+.It Ic stratum
+stratum (0\-15)
+.It Ic precision
+precision (log2 s)
+.It Ic rootdelay
+total roundtrip delay to the primary reference clock
+.It Ic rootdisp
+total root dispersion to the primary reference clock
+.It Ic refid
+reference ID or
+.Lk decode.html#kiss "kiss code"
+.It Ic reftime
+reference time
+.It Ic reach
+reach register (octal)
+.It Ic unreach
+unreach counter
+.It Ic hmode
+host mode (1\-6)
+.It Ic pmode
+peer mode (1\-5)
+.It Ic hpoll
+host poll exponent (log2 s) (3\-17)
+.It Ic ppoll
+peer poll exponent (log2 s) (3\-17)
+.It Ic headway
+headway (see
+.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" )
+.It Ic flash
+.Lk decode.html#flash "flash status word"
+.It Ic offset
+filter offset
+.It Ic delay
+filter delay
+.It Ic dispersion
+filter dispersion
+.It Ic jitter
+filter jitter
+.It Ic ident
+Autokey group name for this association
+.It Ic bias
+unicast/broadcast bias
+.It Ic xleave
+interleave delay (see
+.Lk xleave.html "NTP Interleaved Modes" )
+.El
+The
+.Ic bias
+variable is calculated when the first broadcast packet is received
+after the calibration volley.
+It represents the offset of the broadcast subgraph relative to the unicast subgraph.
+The
+.Ic xleave
+variable appears only for the interleaved symmetric and interleaved modes.
+It represents the internal queuing, buffering and transmission delays
+for the preceding packet.
+.Pp
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic flags
+peer flags (see Autokey specification)
+.It Ic host
+Autokey server name
+.It Ic flags
+peer flags (see Autokey specification)
+.It Ic signature
+OpenSSL digest/signature scheme
+.It Ic initsequence
+initial key ID
+.It Ic initkey
+initial key index
+.It Ic timestamp
+Autokey signature timestamp
+.El
+.Ss Clock Variables
+The following clock variables appear in the
+.Ic cv
+billboard for each association with a reference clock.
+Not all variables are displayed in some configurations.
+.Bl -tag -width "something" -compact -offset indent
+.It Variable
+Description
+.It Ic associd
+association ID
+.It Ic status
+.Lk decode.html#clock "clock status word"
+.It Ic device
+device description
+.It Ic timecode
+ASCII time code string (specific to device)
+.It Ic poll
+poll messages sent
+.It Ic noreply
+no reply
+.It Ic badformat
+bad format
+.It Ic baddata
+bad date or time
+.It Ic fudgetime1
+fudge time 1
+.It Ic fudgetime2
+fudge time 2
+.It Ic stratum
+driver stratum
+.It Ic refid
+driver reference ID
+.It Ic flags
+driver flags
+.El
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of following host names on the command line
+to the IPv6 namespace.
+.It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd
+run a command and exit.
+This option may appear an unlimited number of times.
+.sp
+The following argument is interpreted as an interactive format command
+and is added to the list of commands to be executed on the specified
+host(s).
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl i , Fl \-interactive
+Force ntpq to operate in interactive mode.
+This option must not appear in combination with any of the following options:
+command, peers.
+.sp
+Force \fBntpq\fP to operate in interactive mode.
+Prompts will be written to the standard output and
+commands read from the standard input.
+.It Fl n , Fl \-numeric
+numeric host addresses.
+.sp
+Output all host addresses in dotted\-quad numeric format rather than
+converting to the canonical host names.
+.It Fl \-old\-rv
+Always output status line with readvar.
+.sp
+By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
+line that precedes the output of \fBreadvar\fP
+(alias \fBrv\fP) when a single variable is requested, such as
+\fBntpq \-c "rv 0 offset"\fP.
+This option causes \fBntpq\fP to include both lines of output
+for a single\-variable \fBreadvar\fP.
+Using an environment variable to
+preset this option in a script will enable both older and
+newer \fBntpq\fP to behave identically in this regard.
+.It Fl p , Fl \-peers
+Print a list of the peers.
+This option must not appear in combination with any of the following options:
+interactive.
+.sp
+Print a list of the peers known to the server as well as a summary
+of their state. This is equivalent to the 'peers' interactive command.
+.It Fl w , Fl \-wide
+Display the full 'remote' value.
+.sp
+Display the full value of the 'remote' value. If this requires
+more than 15 characters, display the full value, emit a newline,
+and continue the data display properly indented on the next line.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP
+option definitions.
diff --git a/ntpq/ntpq.texi b/ntpq/ntpq.texi
new file mode 100644
index 0000000..ac79dcc
--- /dev/null
+++ b/ntpq/ntpq.texi
@@ -0,0 +1,834 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntpq.info
+@settitle ntpq: Network Time Protocol Query User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of the NTP Project's ntpq, a program for
+querying the state of an NTP server.
+@end ifinfo
+
+@direntry
+* ntpq: (ntpq). NTP Query program
+@end direntry
+
+@titlepage
+@title ntpq: Network Time Protocol Query User's Manual
+@subtitle ntpq, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@shortcontents
+
+@node Top, ntpq Description, (dir), (dir)
+@top ntpq: Network Time Protocol Query User Manual
+
+The @code{ntpq} utility program is used to
+monitor the operational status
+and determine the performance of
+@code{ntpd}, the NTP daemon.
+
+This document applies to version @value{VERSION} of @code{ntpq}.
+
+@menu
+* ntpq Description::
+* ntpq Invocation:: Invoking ntpq
+* Usage::
+* Internal Commands::
+* Control Message Commands::
+* Status Words and Kiss Codes::
+* System Variables::
+* Peer Variables::
+* Clock Variables::
+@end menu
+
+@node ntpq Description, Usage, Top, Top
+@comment node-name, next, previous, up
+@section Description
+
+The @code{ntpq} utility program is used to monitor NTP daemon @code{ntpd} operations and determine performance.
+It uses the standard NTP mode 6 control message formats defined in
+Appendix B of the NTPv3 specification RFC1305.
+The same formats are used in NTPv4, although some of the variable names have changed and new ones added.
+The description on this page is for the NTPv4 variables.
+
+The program can be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The @code{ntpq} can also obtain and print a list of peers in a common format by sending multiple queries to the server.
+
+If one or more request options is included on the command line when @code{ntpq} is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, @code{ntpq} will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. @code{ntpq} will prompt for commands if the standard input is a terminal device.
+
+@code{ntpq} uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. @code{ntpq} makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.
+
+Note that in contexts where a host name is expected, a @code{-4} qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a @code{-6} qualifier forces DNS resolution to the IPv6 namespace.
+
+For examples and usage, see the @url{debug.html, NTP Debugging Techniques} page.
+
+@include invoke-ntpq.texi
+
+@node Usage, Internal Commands, ntpq Description, Top
+@comment node-name, next, previous, up
+@section Usage
+
+@multitable @columnfractions .23 .23 .05 .15
+@headitem What @tab Default @tab Flag @tab Option
+@item configuration file
+@tab @code{/etc/ntp.conf}
+@tab @code{-c}
+@tab @code{conffile}
+@item frequency file
+@tab none
+@tab @code{-f}
+@tab @code{driftfile}
+@item leapseconds file
+@tab none
+@tab
+@tab @code{leapfile}
+@item process ID file
+@tab none
+@tab @code{-p}
+@tab @code{pidfile}
+@item log file
+@tab system log
+@tab @code{-l}
+@tab @code{logfile}
+@item include file
+@tab none
+@tab none
+@tab @code{includefile}
+@item statistics path
+@tab @code{/var/NTP}
+@tab @code{-s}
+@tab @code{statsdir}
+@item keys path
+@tab @code{/usr/local/etc}
+@tab @code{-k}
+@tab @code{keysdir}
+@end multitable
+
+@node Internal Commands, Control Message Commands, Usage, Top
+@comment node-name, next, previous, up
+@section Internal Commands
+
+Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a @code{>}, followed by a file name, to the command line. A number of interactive format commands are executed entirely within the @code{ntpq} program itself and do not result in NTP mode-6 requests being sent to a server. These are described following.
+
+@table @code
+
+@item @anchor{help} @code{? [}@kbd{command_keyword}@code{]}
+@itemx @code{help [}@kbd{command_keyword}@code{]}
+A @code{?} by itself will print a list of all the command keywords known to @code{ntpq}. A @code{?} followed by a command keyword will print function and usage information about the command.
+
+@item @anchor{addvars} >@code{addvars @kbd{name} [ = @kbd{value}] [...]}
+@itemx @code{rmvars @kbd{name} [...]}
+@itemx @code{clearvars}</dt>
+The arguments to these commands consist of a list of items of the form
+@code{@kbd{name} = @kbd{value}}, where the @code{= @kbd{value}} is ignored,
+and can be omitted in read requests.
+@code{ntpq} maintains an internal list in which data to be included
+in control messages can be assembled, and sent using the @code{readlist}
+and @code{writelist} commands described below.
+The @code{addvars} command allows variables and optional values
+to be added to the list.
+If more than one variable is to be added
+the list should be comma-separated and not contain white space.
+The @code{rmvars} command can be used to remove individual variables
+from the list,
+while the @code{clearlist} command removes all variables from the list.
+
+@item @anchor{cooked} @code{cooked}
+Display server messages in prettyprint format.
+
+@item @anchor{debug} @code{debug more | less | off}
+Turns internal query program debugging on and off.
+
+@item @anchor{delay} @code{delay @kbd{milliseconds}}
+Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.
+
+@item @anchor{host} @code{host @kbd{name}}
+Set the host to which future queries will be sent.
+The name may be either a DNS name or a numeric address.
+
+@item @anchor{hostnames} @code{hostnames [yes | no]}
+If @code{yes} is specified, host names are printed in information displays.
+If @code{no} is specified, numeric addresses are printed instead.
+The default is @code{yes},
+unless modified using the command line @code{-n} switch.
+
+@item @anchor{keyid} @code{keyid @kbd{keyid}}
+This command specifies the key number to be used
+to authenticate configuration requests.
+This must correspond to a key ID configured in @code{ntp.conf} for this purpose.
+
+@item @anchor{keytype} @code{keytype}
+Specify the digest algorithm to use for authenticated requests,
+with default @code{MD5}.
+If the OpenSSL library is installed,
+digest can be be any message digest algorithm supported by the library.
+The current selections are: @code{MD2}, @code{MD4}, @code{MD5}, @code{MDC2}, @code{RIPEMD160}, @code{SHA} and @code{SHA1}.
+
+@item @anchor{ntpversion} @code{ntpversion 1 | 2 | 3 | 4}
+Sets the NTP version number which @code{ntpq} claims in packets.
+Defaults to 2.
+Note that mode-6 control messages (and modes, for that matter)
+didn't exist in NTP version 1.
+
+@item @anchor{passwd} @code{passwd}
+This command prompts for a password to authenticate requests.
+The password must correspond to the key ID configured in @code{ntp.conf} for this purpose.
+
+@item @anchor{quit} @code{quit}
+Exit @code{ntpq}.
+
+@item @anchor{raw} @code{raw}
+Display server messages as received and without reformatting.
+
+@item @anchor{timeout} @code{timeout @kbd{millseconds}}
+Specify a timeout period for responses to server queries.
+The default is about 5000 milliseconds.
+Note that since @code{ntpq} retries each query once after a timeout
+the total waiting time for a timeout will be twice the timeout value set.
+
+@end table
+
+@node Control Message Commands, Status Words and Kiss Codes, Internal Commands, Top
+@comment node-name, next, previous, up
+@section Control Message Commands
+
+Association IDs are used to identify system, peer and clock variables.
+System variables are assigned an association ID of zero and system name space,
+while each association is assigned a nonzero association ID and peer namespace.
+Most control commands send a single mode-6 message to the server
+and expect a single response message.
+The exceptions are the @code{peers} command,
+which sends a series of messages,
+and the @code{mreadlist} and @code{mreadvar} commands,
+which iterate over a range of associations.
+
+@anchor{as}
+@table @code
+@item @code{associations}
+Display a list of mobilized associations in the form:
+@*
+@code{ind assid status conf reach auth condition last_event cnt}
+
+@multitable @columnfractions .1 .4
+@headitem Variable @tab Description
+
+@item @code{ind}
+@tab index on this list
+
+@item @code{assid}
+@tab association ID
+
+@item @code{status}
+@tab @url{decode.html#peer, peer status word}
+
+@item @code{conf}
+@tab @code{yes}: persistent, @code{no}: ephemeral
+
+@item @code{reach}
+@tab @code{yes}: reachable, @code{no}: unreachable
+
+@item @code{auth}
+@tab @code{ok}, @code{yes}, @code{bad} and @code{none}
+
+@item @code{condition}
+@tab selection status (see the @code{select} field of the @url{decode.html#peer, peer status word})
+
+@item @code{last_event}
+@tab event report (see the @code{event} field of the @url{decode.html#peer, peer status word})
+
+@item @code{cnt}
+event count (see the @code{count} field of the @url{decode.html#peer, peer status word})
+
+@end multitable
+
+@item @anchor{cv} clockvar @kbd{assocID} [@kbd{name} [ = @kbd{value} [...]] [...]]
+@itemx cv @kbd{assocID} [@kbd{name} [ = @kbd{value} [...] ][...]]
+Display a list of @ref{clock,,clock variables} for those associations supporting a reference clock.
+
+@item @anchor{:config} :config [...]
+Send the remainder of the command line, including whitespace, to the server
+as a run-time configuration command in the same format
+as the configuration file.
+This command is experimental until further notice and clarification.
+Authentication is of course required.
+
+@item @anchor{config-from-file} config-from-file @kbd{filename}
+Send the each line of @kbd{filename} to the server as
+run-time configuration commands in the same format as the configuration file.
+This command is experimental until further notice and clarification.
+Authentication is required.
+
+@item @anchor{ifstats} ifstats
+Display statistics for each local network address.
+Authentication is required.
+
+@item @anchor{iostats} iostats
+Display network and reference clock I/O statistics.
+
+@item @anchor{kerninfo} kerninfo
+Display kernel loop and PPS statistics.
+As with other ntpq output, times are in milliseconds.
+The precision value displayed is in milliseconds as well,
+unlike the precision system variable.
+
+@item @anchor{lassoc} lassociations
+Perform the same function as the associations command,
+except display mobilized and unmobilized associations.
+
+@item @anchor{monstats} monstats
+Display monitor facility statistics.
+
+@item @anchor{mrulist} mrulist [limited | kod | mincount=@kbd{count} | laddr=@kbd{localaddr} | sort=@kbd{sortorder} | resany=@kbd{hexmask} | resall=@kbd{hexmask}]
+Obtain and print traffic counts collected and maintained by
+the monitor facility.
+With the exception of @code{sort=@kbd{sortorder}},
+the options filter the list returned by @code{ntpd}.
+The @code{limited} and @code{kod} options return only entries
+representing client addresses from which the last packet received
+triggered either discarding or a KoD response.
+The @code{mincount=@kbd{count}} option filters entries representing
+less than @code{@kbd{count}} packets.
+The @code{laddr=@kbd{localaddr}} option filters entries for packets
+received on any local address other than @code{@kbd{localaddr}}.
+@code{resany=@kbd{hexmask}} and @code{resall=@kbd{hexmask}}
+filter entries containing none or less than all, respectively,
+of the bits in @code{@kbd{hexmask}}, which must begin with @code{0x}.
+@*
+The @code{@kbd{sortorder}} defaults to @code{lstint} and may be any of
+@code{addr}, @code{count}, @code{avgint}, @code{lstint}, or
+any of those preceded by a minus sign (hyphen) to reverse the sort order.
+The output columns are:
+
+@multitable @columnfractions .1 .4
+@headitem Column @tab Description
+
+@item @code{lstint}
+@tab
+Interval in s between the receipt of the most recent packet from this
+address and the completion of the retrieval of the MRU list by @code{ntpq}
+
+@item @code{avgint}
+@tab
+Average interval in s between packets from this address.
+
+@item @code{rstr}
+@tab
+Restriction flags associated with this address.
+Most are copied unchanged from the matching @code{restrict} command,
+however 0x400 (kod) and 0x20 (limited) flags are cleared unless
+the last packet from this address triggered a rate control response.
+
+@item @code{r}
+@tab
+Rate control indicator, either a period, @code{L} or @code{K} for
+no rate control response, rate limiting by discarding, or
+rate limiting with a KoD response, respectively.
+
+@item @code{m}
+@tab
+Packet mode.
+@item @code{v}
+@tab
+Packet version number.
+
+@item @code{count}
+@tab
+Packets received from this address.
+
+@item @code{rport}
+@tab
+Source port of last packet from this address.
+
+@item @code{remote address}
+@tab
+DNS name, numeric address, or address followed by claimed DNS name which
+could not be verified in parentheses.
+
+@end multitable
+
+@item @anchor{mreadvar} @code{mreadvar @kbd{assocID} @kbd{assocID} [ @kbd{variable_name} [ = @kbd{value}[ ... ]}
+@itemx @anchor{mrv} @code{mrv @kbd{assocID} @kbd{assocID} [ @kbd{variable_name} [ = @kbd{value}[ ... ]}
+Perform the same function as the @code{readvar} command,
+except for a range of association IDs.
+This range is determined from the association list cached by
+the most recent @code{associations} command.
+
+@item @anchor{passoc} @code{passociations}
+Perform the same function as the @code{associations command}, except that
+it uses previously stored data rather than making a new query.
+
+@item @anchor{pe} @code{peers}
+Display a list of peers in the form:
+@*
+@code{[tally]remote refid st t when pool reach delay offset jitter}
+
+@multitable @columnfractions .1 .2
+@headitem Variable @tab Description
+@item @code{[tally]}
+@tab
+single-character code indicating current value of the @code{select} field
+of the @url{decode.html#peer, peer status word}.
+
+@item @code{remote}
+@tab
+host name (or IP number) of peer
+
+@item @code{refid}
+@tab
+association ID or @url{decode.html#kiss, kiss code}.
+
+@item @code{st}
+@tab
+stratum
+
+@item @code{t}
+@tab
+@code{u}: unicast or manycast client,
+@code{b}: broadcast or multicast client,
+@code{l}: local (reference clock),
+@code{s}: symmetric (peer),
+@code{A}: manycast server,
+@code{B}: broadcast server,
+@code{M}: multicast server.
+
+@item @code{when}
+@tab
+sec/min/hr since last received packet
+
+@item @code{poll}
+@tab
+poll interval (log(2) s)
+
+@item @code{reach}
+@tab
+reach shift register (octal)
+
+@item @code{delay}
+@tab
+roundtrip delay
+
+@item @code{offset}
+@tab
+offset of server relative to this host
+
+@item @code{jitter}
+@tab
+jitter
+
+@end multitable
+
+@item @anchor{rv} readvar @kbd{assocID} @kbd{name} [ = @kbd{value} ] [,...]
+@itemx rv @kbd{assocID} [ @kbd{name} ] [,...]
+Display the specified variables.
+If @code{@kbd{assocID}} is zero,
+the variables are from the @ref{system, system variables} name space,
+otherwise they are from the @ref{peer, peer variables} name space.
+The @kbd{assocID} is required, as the same name can occur in both spaces.
+If no @kbd{name} is included,
+all operative variables in the name space are displayed.
+In this case only, if the @code{@kbd{assocID}} is omitted, it is assumed zero.
+Multiple names are specified with comma separators and without whitespace.
+Note that time values are represented in milliseconds and
+frequency values in parts-per-million (PPM).
+Some NTP timestamps are represented in the format YYYYMMDDTTTT,
+where YYYY is the year, MM the month of year, DD the day of month and
+TTTT the time of day.
+
+@item @anchor{saveconfig} @code{saveconfig @kbd{filename}}
+Write the current configuration, including any runtime modifications
+given with @code{:config} or @code{config-from-file},
+to the ntpd host's file @kbd{filename}.
+This command will be rejected by the server unless
+@url{miscopt.html#saveconfigdir, saveconfigdir}
+appears in the @code{ntpd} configuration file.
+@kbd{filename} can use @code{strftime()} format specifiers
+to substitute the current date and time, for example,
+@code{saveconfig ntp-%Y%m%d-%H%M%S.conf}.
+The filename used is stored in system variable @code{savedconfig}.
+Authentication is required.
+
+@item @anchor{writevar} writevar @kbd{assocID} @kbd{name} = @kbd{value} [,...]
+Write the specified variables.
+If the @code{@kbd{assocID}} is zero, the variables are from the
+@ref{system, system variables} name space, otherwise they are from the
+@ref{peer, peer variables} name space.
+The @code{@kbd{assocID}} is required,
+as the same name can occur in both spaces.
+
+@item @anchor{sysinfo} @code{sysinfo}
+Display operational summary.
+
+@item @anchor{sysstats} @code{sysstats}
+Print statistics counters maintained in the protocol module.
+
+@end table
+
+@node Status Words and Kiss Codes, System Variables, Control Message Commands, Top
+@comment node-name, next, previous, up
+@section Status Words and Kiss Codes
+
+The current state of the operating program is shown
+in a set of status words maintained by the system
+and each association separately.
+These words are displayed in the @code{rv} and @code{as} commands
+both in hexadecimal and decoded short tip strings.
+The codes, tips and short explanations are on the
+@url{decode.html, Event Messages and Status Words} page.
+The page also includes a list of system and peer messages,
+the code for the latest of which is included in the status word.
+
+Information resulting from protocol machine state transitions
+is displayed using an informal set of ASCII strings called
+@url{decode.html#kiss, kiss codes}.
+The original purpose was for kiss-o'-death (KoD) packets sent
+by the server to advise the client of an unusual condition.
+They are now displayed, when appropriate,
+in the reference identifier field in various billboards.
+
+@node System Variables, Peer Variables, Status Words and Kiss Codes, Top
+@comment node-name, next, previous, up
+@section System Variables
+
+The following system variables appear in the @code{rv} billboard.
+Not all variables are displayed in some configurations.
+
+@multitable @columnfractions .1 .2
+@headitem Variable @tab Description
+
+@item @code{status}
+@tab
+@url{decode.html#sys, system status word}
+
+@item @code{version}
+@tab
+NTP software version and build time
+
+@item @code{processor}
+@tab
+hardware platform and version
+
+@item @code{system}
+@tab
+operating system and version
+
+@item @code{leap}
+@tab
+leap warning indicator (0-3)
+
+@item @code{stratum}
+@tab
+stratum (1-15)
+
+@item @code{precision}
+@tab
+precision (log(2) s)
+
+@item @code{rootdelay}
+@tab
+total roundtrip delay to the primary reference clock
+
+@item @code{rootdisp}
+@tab
+total dispersion to the primary reference clock
+
+@item @code{peer}
+@tab
+system peer association ID
+
+@item @code{tc}
+time constant and poll exponent (log(2) s) (3-17)
+
+@item @code{mintc}
+minimum time constant (log(2) s) (3-10)
+
+@item @code{clock}
+@tab
+date and time of day
+
+@item @code{refid}
+reference ID or @url{decode.html#kiss, kiss code}
+
+@item @code{reftime}
+@tab
+reference time
+
+@item @code{offset}
+@tab
+combined offset of server relative to this host
+
+@item @code{sys_jitter}
+@tab
+combined system jitter
+
+@item @code{frequency}
+@tab
+frequency offset (PPM) relative to hardware clock
+
+@item @code{clk_wander}
+@tab
+clock frequency wander (PPM)
+
+@item @code{clk_jitter}
+@tab
+clock jitter
+
+@item @code{tai}
+@tab
+TAI-UTC offset (s)
+
+@item @code{leapsec}
+@tab
+NTP seconds when the next leap second is/was inserted
+
+@item @code{expire}
+@tab
+NTP seconds when the NIST leapseconds file expires
+
+@end multitable
+
+The jitter and wander statistics are exponentially-weighted RMS averages.
+The system jitter is defined in the NTPv4 specification;
+the clock jitter statistic is computed by the clock discipline module.
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional system variables are displayed, including some or all of the
+following, depending on the particular Autokey dance:
+
+@multitable @columnfractions .1 .2
+@headitem Variable @tab Description
+
+@item @code{host}
+@tab
+Autokey host name for this host
+
+@item @code{ident}
+@tab
+Autokey group name for this host
+
+@item @code{flags}
+@tab
+host flags (see Autokey specification)
+
+@item @code{digest}
+@tab
+OpenSSL message digest algorithm
+
+@item @code{signature}
+@tab
+OpenSSL digest/signature scheme
+
+@item @code{update}
+@tab
+NTP seconds at last signature update
+
+@item @code{cert}
+@tab
+certificate subject, issuer and certificate flags
+
+@item @code{until}
+@tab
+NTP seconds when the certificate expires
+
+@end multitable
+
+@node Peer Variables, Clock Variables, System Variables, Top
+@comment node-name, next, previous, up
+@section Peer Variables
+
+The following peer variables appear in the @code{rv} billboard
+for each association.
+Not all variables are displayed in some configurations.
+
+@multitable @columnfractions .1 .2
+@headitem Variable @tab Description
+
+@item @code{associd}
+@tab
+association ID
+
+@item @code{status}
+@tab
+@url{decode.html#peer, peer status word}
+
+@item @code{srcadr}
+@itemx @code{srcport}
+@tab
+source (remote) IP address and port
+
+@item @code{dstadr}
+@itemx @code{dstport}
+@tab
+destination (local) IP address and port
+
+@item @code{leap}
+@tab
+leap indicator (0-3)
+
+@item @code{stratum}
+@tab
+stratum (0-15)
+
+@item @code{precision}
+@tab
+precision (log(2) s)
+
+@item @code{rootdelay}
+@tab
+total roundtrip delay to the primary reference clock
+
+@item @code{rootdisp}
+@tab total root dispersion to the primary reference clock
+
+@item @code{refid}
+@tab
+reference ID or @url{decode.html#kiss, kiss code}
+
+@item @code{reftime}
+@tab
+reference time
+
+@item @code{reach}
+@tab
+reach register (octal)
+
+@item @code{unreach}
+@tab
+unreach counter
+
+@item @code{hmode}
+@tab
+host mode (1-6)
+
+@item @code{pmode}
+@tab
+peer mode (1-5)
+
+@item @code{hpoll}
+@tab
+host poll exponent (log(2) s) (3-17)
+@item @code{ppoll}
+@tab
+peer poll exponent (log(2) s) (3-17)
+
+@item @code{headway}
+@tab
+headway (see @url{rate.html, Rate Management and the Kiss-o'-Death Packet})
+
+@item @code{flash}
+@tab
+@url{decode.html#flash, flash status word}
+
+@item @code{offset}
+@tab
+filter offset
+
+@item @code{delay}
+@tab
+filter delay
+
+@item @code{dispersion}
+@tab
+filter dispersion
+
+@item @code{jitter}
+@tab
+filter jitter
+
+@item @code{ident}
+@tab
+Autokey group name for this association
+
+@item @code{bias}
+@tab
+unicast/broadcast bias
+
+@item @code{xleave}
+@tab
+interleave delay (see @url{xleave.html, NTP Interleaved Modes})
+
+@end multitable
+
+The bias variable is calculated when the first broadcast packet is received
+after the calibration volley. It represents the offset of the broadcast
+subgraph relative to the unicast subgraph. The xleave variable appears
+only the interleaved symmetric and interleaved modes. It represents
+the internal queuing, buffering and transmission delays for the preceding
+packet.
+
+When the NTPv4 daemon is compiled with the OpenSSL software library,
+additional peer variables are displayed, including the following:
+
+@multitable @columnfractions .1 .2
+@headitem Variable @tab Description
+
+@item @code{flags}
+@tab
+peer flags (see Autokey specification)
+
+@item @code{host}
+@tab
+Autokey server name
+
+@item @code{flags}
+@tab
+peer flags (see Autokey specification)
+
+@item @code{signature}
+@tab
+OpenSSL digest/signature scheme
+
+@item @code{initsequence}
+@tab
+initial key ID
+
+@item @code{initkey}
+@tab
+initial key index
+
+@item @code{timestamp}
+@tab
+Autokey signature timestamp
+
+@end multitable
+
+@node Clock Variables, , Peer Variables, Top
+@comment node-name, next, previous, up
+@section Clock Variables
+
+The following clock variables appear in the @code{cv} billboard for each association with a reference clock. Not all variables are displayed in some configurations.
+
+@multitable @columnfractions .1 .2
+@headitem Variable @tab Description
+@item @code{associd}
+@tab association ID
+@item @code{status}
+@tab @url{decode.html#clock, clock status word}
+@item @code{device}
+@tab device description
+@item @code{timecode}
+@tab ASCII time code string (specific to device)
+@item @code{poll}
+@tab poll messages sent
+@item @code{noreply}
+@tab no reply
+@item @code{badformat}
+@tab bad format
+@item @code{baddata}
+@tab bad date or time
+@item @code{fudgetime1}
+@tab fudge time 1
+@item @code{fudgetime2}
+@tab fudge time 2
+@item @code{stratum}
+@tab driver stratum
+@item @code{refid}
+@tab driver reference ID
+@item @code{flags}
+@tab driver flags
+@end multitable
diff --git a/ntpsnmpd/Makefile.am b/ntpsnmpd/Makefile.am
new file mode 100644
index 0000000..11ecf1b
--- /dev/null
+++ b/ntpsnmpd/Makefile.am
@@ -0,0 +1,117 @@
+NULL=
+
+bin_PROGRAMS= $(NTPSNMPD_DB)
+libexec_PROGRAMS= $(NTPSNMPD_DL)
+sbin_PROGRAMS= $(NTPSNMPD_DS)
+
+EXTRA_PROGRAMS= ntpsnmpd
+ntpsnmpd_SOURCES= netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \
+ ntpsnmpd-opts.c ntpsnmpd-opts.h ntpSnmpSubagentObject.h \
+ ntp_snmp.h
+# HMS: we probably want a version.o file here, too.
+LDADD = ../ntpq/libntpq.a ../libntp/libntp.a
+LDADD += $(SNMP_LIBS) $(LDADD_LIBNTP) $(LIBM)
+LDADD += $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBOPTS_LDADD)
+
+AM_CFLAGS = $(SNMP_CFLAGS) $(CFLAGS_NTP)
+
+AM_CPPFLAGS = -I$(top_srcdir)/ntpq
+AM_CPPFLAGS += $(NTP_INCS)
+AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
+AM_CPPFLAGS += $(SNMP_CPPFLAGS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+EXTRA_DIST= \
+ invoke-ntpsnmpd.menu \
+ invoke-ntpsnmpd.texi \
+ ntpsnmpd-opts.def \
+ ntpsnmpd.1ntpsnmpdman \
+ ntpsnmpd.1ntpsnmpdmdoc \
+ ntpsnmpd.man.in \
+ ntpsnmpd.mdoc.in \
+ ntpsnmpd.html \
+ ntpsnmpd.texi \
+ ntpv4-mib.mib \
+ $(NULL)
+
+BUILT_SOURCES= ntpsnmpd-opts.c ntpsnmpd-opts.h
+CLEANFILES=
+DISTCLEANFILES= config.log $(man_MANS)
+
+html_DATA= \
+ $(srcdir)/ntpsnmpd.html \
+ $(NULL)
+
+noinst_DATA= \
+ $(srcdir)/invoke-ntpsnmpd.menu \
+ $(srcdir)/invoke-ntpsnmpd.texi \
+ $(srcdir)/ntpsnmpd.man.in \
+ $(srcdir)/ntpsnmpd.mdoc.in \
+ $(NULL)
+
+install-data-local: install-html
+
+man1_MANS=
+man8_MANS=
+man_MANS= ntpsnmpd.$(NTPSNMPD_MS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+$(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) ntpsnmpd-opts.def
+
+###
+
+$(srcdir)/ntpsnmpd.1ntpsnmpdman: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsnmpdman -Tagman-cmd.tpl ntpsnmpd-opts.def
+
+$(srcdir)/ntpsnmpd.man.in: $(srcdir)/ntpsnmpd.1ntpsnmpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdman > $(srcdir)/ntpsnmpd.man.in+
+ mv $(srcdir)/ntpsnmpd.man.in+ $(srcdir)/ntpsnmpd.man.in
+
+###
+
+$(srcdir)/ntpsnmpd.1ntpsnmpdmdoc: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsnmpdmdoc -Tagmdoc-cmd.tpl ntpsnmpd-opts.def
+
+$(srcdir)/ntpsnmpd.mdoc.in: $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc > $(srcdir)/ntpsnmpd.mdoc.in+
+ mv $(srcdir)/ntpsnmpd.mdoc.in+ $(srcdir)/ntpsnmpd.mdoc.in
+
+###
+
+ntpsnmpd.$(NTPSNMPD_MS): $(srcdir)/ntpsnmpd.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpsnmpd.$(NTPSNMPD_MS)+:$(srcdir)/ntpsnmpd.$(MANTAGFMT).in
+ mv ntpsnmpd.$(NTPSNMPD_MS)+ ntpsnmpd.$(NTPSNMPD_MS)
+
+###
+
+$(srcdir)/invoke-ntpsnmpd.menu: $(srcdir)/invoke-ntpsnmpd.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpsnmpd.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntpsnmpd.html: $(srcdir)/ntpsnmpd.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpsnmpd.html ntpsnmpd.texi || true )
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/check-libopts.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/ntpsnmpd/Makefile.in b/ntpsnmpd/Makefile.in
new file mode 100644
index 0000000..3ffaff7
--- /dev/null
+++ b/ntpsnmpd/Makefile.in
@@ -0,0 +1,1141 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = ntpsnmpd$(EXEEXT)
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/check-libntp.mf
+subdir = ntpsnmpd
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+am_ntpsnmpd_OBJECTS = netsnmp_daemonize.$(OBJEXT) ntpsnmpd.$(OBJEXT) \
+ ntpSnmpSubagentObject.$(OBJEXT) ntpsnmpd-opts.$(OBJEXT)
+ntpsnmpd_OBJECTS = $(am_ntpsnmpd_OBJECTS)
+ntpsnmpd_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+ntpsnmpd_DEPENDENCIES = ../ntpq/libntpq.a ../libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(ntpsnmpd_SOURCES)
+DIST_SOURCES = $(ntpsnmpd_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+bin_PROGRAMS = $(NTPSNMPD_DB)
+libexec_PROGRAMS = $(NTPSNMPD_DL)
+sbin_PROGRAMS = $(NTPSNMPD_DS)
+ntpsnmpd_SOURCES = netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \
+ ntpsnmpd-opts.c ntpsnmpd-opts.h ntpSnmpSubagentObject.h \
+ ntp_snmp.h
+
+# HMS: we probably want a version.o file here, too.
+LDADD = ../ntpq/libntpq.a ../libntp/libntp.a $(SNMP_LIBS) \
+ $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NTP) \
+ $(LIBOPTS_LDADD)
+AM_CFLAGS = $(SNMP_CFLAGS) $(CFLAGS_NTP)
+AM_CPPFLAGS = -I$(top_srcdir)/ntpq $(NTP_INCS) $(LIBOPTS_CFLAGS) \
+ $(SNMP_CPPFLAGS) $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+EXTRA_DIST = \
+ invoke-ntpsnmpd.menu \
+ invoke-ntpsnmpd.texi \
+ ntpsnmpd-opts.def \
+ ntpsnmpd.1ntpsnmpdman \
+ ntpsnmpd.1ntpsnmpdmdoc \
+ ntpsnmpd.man.in \
+ ntpsnmpd.mdoc.in \
+ ntpsnmpd.html \
+ ntpsnmpd.texi \
+ ntpv4-mib.mib \
+ $(NULL)
+
+BUILT_SOURCES = ntpsnmpd-opts.c ntpsnmpd-opts.h check-libntp \
+ check-libopts .deps-ver
+CLEANFILES = check-libntp check-libopts .deps-ver
+DISTCLEANFILES = config.log $(man_MANS)
+html_DATA = \
+ $(srcdir)/ntpsnmpd.html \
+ $(NULL)
+
+noinst_DATA = \
+ $(srcdir)/invoke-ntpsnmpd.menu \
+ $(srcdir)/invoke-ntpsnmpd.texi \
+ $(srcdir)/ntpsnmpd.man.in \
+ $(srcdir)/ntpsnmpd.mdoc.in \
+ $(NULL)
+
+man1_MANS =
+man8_MANS =
+man_MANS = ntpsnmpd.$(NTPSNMPD_MS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/check-libopts.mf $(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 ntpsnmpd/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ntpsnmpd/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+ntpsnmpd$(EXEEXT): $(ntpsnmpd_OBJECTS) $(ntpsnmpd_DEPENDENCIES)
+ @rm -f ntpsnmpd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntpsnmpd_OBJECTS) $(ntpsnmpd_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netsnmp_daemonize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpSnmpSubagentObject.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpsnmpd-opts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpsnmpd.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: all check install install-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-sbinPROGRAMS ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-data-local install-dvi install-dvi-am install-exec \
+ install-exec-am install-exec-hook install-html install-html-am \
+ install-htmlDATA install-info install-info-am \
+ install-libexecPROGRAMS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinPROGRAMS install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-htmlDATA uninstall-libexecPROGRAMS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinPROGRAMS
+
+
+install-data-local: install-html
+
+$(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) ntpsnmpd-opts.def
+
+###
+
+$(srcdir)/ntpsnmpd.1ntpsnmpdman: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsnmpdman -Tagman-cmd.tpl ntpsnmpd-opts.def
+
+$(srcdir)/ntpsnmpd.man.in: $(srcdir)/ntpsnmpd.1ntpsnmpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdman > $(srcdir)/ntpsnmpd.man.in+
+ mv $(srcdir)/ntpsnmpd.man.in+ $(srcdir)/ntpsnmpd.man.in
+
+###
+
+$(srcdir)/ntpsnmpd.1ntpsnmpdmdoc: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsnmpdmdoc -Tagmdoc-cmd.tpl ntpsnmpd-opts.def
+
+$(srcdir)/ntpsnmpd.mdoc.in: $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc > $(srcdir)/ntpsnmpd.mdoc.in+
+ mv $(srcdir)/ntpsnmpd.mdoc.in+ $(srcdir)/ntpsnmpd.mdoc.in
+
+###
+
+ntpsnmpd.$(NTPSNMPD_MS): $(srcdir)/ntpsnmpd.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpsnmpd.$(NTPSNMPD_MS)+:$(srcdir)/ntpsnmpd.$(MANTAGFMT).in
+ mv ntpsnmpd.$(NTPSNMPD_MS)+ ntpsnmpd.$(NTPSNMPD_MS)
+
+###
+
+$(srcdir)/invoke-ntpsnmpd.menu: $(srcdir)/invoke-ntpsnmpd.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpsnmpd.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntpsnmpd.html: $(srcdir)/ntpsnmpd.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpsnmpd.html ntpsnmpd.texi || true )
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+check-libopts: ../sntp/libopts/libopts.la
+ @echo stamp > $@
+
+../sntp/libopts/libopts.la:
+ -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
+$(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/ntpsnmpd/README b/ntpsnmpd/README
new file mode 100644
index 0000000..5227f40
--- /dev/null
+++ b/ntpsnmpd/README
@@ -0,0 +1,40 @@
+NTP SNMP subagent for Net-SNMP
+
+Installation Guides:
+
+- install net-snmp from source (configure, make;, make install)
+- edit the snmpd configuration file (/usr/local/share/snmp/snmpd.conf):
+ add the lines
+ master agentx
+ agentXSocket tcp:localhost:705
+ and check which read-only community is configured (should be "rocommunity public")
+- start snmpd (sudo /usr/local/sbin/snmpd) and check that it is running correctly by running the command
+ snmpwalk -v2c -c public localhost
+ (which should output a lot of data values for the supported built-in MIBs of net-snmp)
+- build the libntpq and the libntp library
+- build the ntpsnmpd application (make) and run it (./ntpsnmpd)
+- now you can run
+ snmpwalk -v2c -c public localhost enterprises.5597.99
+ which should give you a list of all currently supported NTP MIB objects and their current values
+
+Please note that currently I use a private MIB OID (enterprises.5597 is the Meinberg top level OEM OID and 99 is my temporary working space for this project).
+The final OID has to be registered with IANA and this is done by the RFC Editor when the NTPv4 MIB RFC is standardized.
+I will try to do this earlier in order to be able to have a working solution at the end of this project.
+
+In its current state the daemon supports these objects:
+
+ntpEntSoftwareName
+ntpEntSoftwareVersion
+ntpEntSoftwareVersionVal
+ntpEntSoftwareVendor
+ntpEntSystemType
+ntpEntTimeResolution
+ntpEntTimeResolutionVal
+ntpEntTimePrecision
+ntpEntTimePrecisionVal
+ntpEntTimeDistance
+
+They all use the libntpq library to access information from the ntpd instance with mode 6 packets.
+
+Next step is to implement the status section of the MIB (section 2).
+
diff --git a/ntpsnmpd/invoke-ntpsnmpd.menu b/ntpsnmpd/invoke-ntpsnmpd.menu
new file mode 100644
index 0000000..886e80a
--- /dev/null
+++ b/ntpsnmpd/invoke-ntpsnmpd.menu
@@ -0,0 +1 @@
+* ntpsnmpd Invocation:: Invoking ntpsnmpd
diff --git a/ntpsnmpd/invoke-ntpsnmpd.texi b/ntpsnmpd/invoke-ntpsnmpd.texi
new file mode 100644
index 0000000..fbaad2c
--- /dev/null
+++ b/ntpsnmpd/invoke-ntpsnmpd.texi
@@ -0,0 +1,188 @@
+@node ntpsnmpd Invocation
+@section Invoking ntpsnmpd
+@pindex ntpsnmpd
+@cindex NTP SNMP MIB agent
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntpsnmpd.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:58:24 AM by AutoGen 5.18.5pre4
+# From the definitions ntpsnmpd-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+@code{ntpsnmpd}
+is an SNMP MIB agent designed to interface with
+@code{ntpd(1ntpdmdoc)}.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpsnmpd} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntpsnmpd usage:: ntpsnmpd help/usage (@option{--help})
+* ntpsnmpd agentxsocket:: agentxsocket option
+* ntpsnmpd config:: presetting/configuring ntpsnmpd
+* ntpsnmpd exit status:: exit status
+* ntpsnmpd Usage:: Usage
+* ntpsnmpd Notes:: Notes
+* ntpsnmpd Authors:: Authors
+@end menu
+
+@node ntpsnmpd usage
+@subsection ntpsnmpd help/usage (@option{--help})
+@cindex ntpsnmpd help
+
+This is the automatically generated usage text for ntpsnmpd.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p482
+Usage: ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+ Flg Arg Option-Name Description
+ -n no nofork Do not fork
+ -p no syslog Log to syslog()
+ Str agentxsocket The socket address ntpsnmpd uses to connect to net-snmpd
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -> opt save-opts save the option state to a config file
+ -< Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTPSNMPD_*
+
+Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org>
+@end example
+@exampleindent 4
+
+@node ntpsnmpd agentxsocket
+@subsection agentxsocket option
+@cindex ntpsnmpd-agentxsocket
+
+This is the ``the socket address ntpsnmpd uses to connect to net-snmpd'' option.
+This option takes a string argument.
+[<transport-specifier>:]<transport-address>
+The default "agent X socket" is the Unix Domain socket
+@file{unix:/var/agentx/master}.
+Another common alternative is @file{tcp:localhost:705}.
+
+
+@node ntpsnmpd config
+@subsection presetting/configuring ntpsnmpd
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTPSNMPD} and @code{NTPSNMPD_<OPTION_NAME>}. @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTPSNMPD} variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntpsnmpd} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+@example
+[NTPSNMPD]
+@end example
+@noindent
+or by
+@example
+<?program ntpsnmpd>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+ <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions. You simply note that it is a
+hierarchicly valued option. @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version. This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntpsnmpd exit status
+@subsection ntpsnmpd exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error. Please report
+it to autogen-users@@lists.sourceforge.net. Thank you.
+@end table
+@node ntpsnmpd Usage
+@subsection ntpsnmpd Usage
+@node ntpsnmpd Notes
+@subsection ntpsnmpd Notes
+@node ntpsnmpd Authors
+@subsection ntpsnmpd Authors
diff --git a/ntpsnmpd/netsnmp_daemonize.c b/ntpsnmpd/netsnmp_daemonize.c
new file mode 100644
index 0000000..969caa0
--- /dev/null
+++ b/ntpsnmpd/netsnmp_daemonize.c
@@ -0,0 +1,270 @@
+/*
+ * system.c
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/***********************************************************
+ Copyright 1992 by Carnegie Mellon University
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of CMU not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+******************************************************************/
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+/*
+ * System dependent routines go here
+ */
+#include <net-snmp/net-snmp-config.h>
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#include <config.h>
+
+#ifdef NEED_NETSNMP_DAEMONIZE
+
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <sys/types.h>
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_NLIST_H
+#include <nlist.h>
+#endif
+
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#if defined(hpux10) || defined(hpux11)
+#include <sys/pstat.h>
+#endif
+
+#if HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
+#if HAVE_SYS_SYSTEMCFG_H
+#include <sys/systemcfg.h>
+#endif
+
+#if HAVE_SYS_SYSTEMINFO_H
+#include <sys/systeminfo.h>
+#endif
+
+#include <net-snmp/types.h>
+#include <net-snmp/output_api.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/library/system.h> /* for "internal" definitions */
+
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/read_config.h> /* for get_temp_file_pattern() */
+
+#ifndef IFF_LOOPBACK
+# define IFF_LOOPBACK 0
+#endif
+
+#ifdef INADDR_LOOPBACK
+# define LOOPBACK INADDR_LOOPBACK
+#else
+# define LOOPBACK 0x7f000001
+#endif
+
+/**
+ * fork current process into the background.
+ *
+ * This function forks a process into the background, in order to
+ * become a daemon process. It does a few things along the way:
+ *
+ * - becoming a process/session group leader, and forking a second time so
+ * that process/session group leader can exit.
+ *
+ * - changing the working directory to /
+ *
+ * - closing stdin, stdout and stderr (unless stderr_log is set) and
+ * redirecting them to /dev/null
+ *
+ * @param quit_immediately : indicates if the parent process should
+ * exit after a successful fork.
+ * @param stderr_log : indicates if stderr is being used for
+ * logging and shouldn't be closed
+ * @returns -1 : fork error
+ * 0 : child process returning
+ * >0 : parent process returning. returned value is the child PID.
+ */
+int
+netsnmp_daemonize(int quit_immediately, int stderr_log)
+{
+ int i = 0;
+ int saved_errno;
+
+ DEBUGMSGT(("daemonize","deamonizing...\n"));
+#ifdef HAVE_WORKING_FORK
+ /*
+ * Fork to return control to the invoking process and to
+ * guarantee that we aren't a process group leader.
+ */
+ i = fork();
+ if (i != 0) {
+ /* Parent. */
+ saved_errno = errno;
+ DEBUGMSGT(("daemonize","first fork returned %d.\n", i));
+ if(i == -1) {
+ snmp_log(LOG_ERR,"first fork failed (errno %d) in "
+ "netsnmp_daemonize()\n", saved_errno);
+ return -1;
+ }
+ if (quit_immediately) {
+ DEBUGMSGT(("daemonize","parent exiting\n"));
+ exit(0);
+ }
+ } else {
+ /* Child. */
+#ifdef HAVE_SETSID
+ /* Become a process/session group leader. */
+ setsid();
+#endif
+ /*
+ * Fork to let the process/session group leader exit.
+ */
+ if ((i = fork()) != 0) {
+ saved_errno = errno;
+ DEBUGMSGT(("daemonize","second fork returned %d.\n", i));
+ if(i == -1) {
+ snmp_log(LOG_ERR,"second fork failed (errno %d) in "
+ "netsnmp_daemonize()\n", saved_errno);
+ }
+ /* Parent. */
+ exit(0);
+ }
+#ifndef WIN32
+ else {
+ /* Child. */
+
+ DEBUGMSGT(("daemonize","child continuing\n"));
+
+ /* Avoid keeping any directory in use. */
+ chdir("/");
+
+ if (!stderr_log) {
+ /*
+ * Close inherited file descriptors to avoid
+ * keeping unnecessary references.
+ */
+ close(0);
+ close(1);
+ close(2);
+
+ /*
+ * Redirect std{in,out,err} to /dev/null, just in
+ * case.
+ */
+ open("/dev/null", O_RDWR);
+ dup(0);
+ dup(0);
+ }
+ }
+#endif /* !WIN32 */
+ }
+#endif /* HAVE_WORKING_FORK */
+ return i;
+}
+
+#else /* !NEED_NETSNMP_DAEMONIZE */
+int netsnp_daemonize_bs;
+#endif
diff --git a/ntpsnmpd/ntpSnmpSubagentObject.c b/ntpsnmpd/ntpSnmpSubagentObject.c
new file mode 100644
index 0000000..f65fedf
--- /dev/null
+++ b/ntpsnmpd/ntpSnmpSubagentObject.c
@@ -0,0 +1,549 @@
+/*****************************************************************************
+ *
+ * ntpSnmpSubAgentObject.c
+ *
+ * This file provides the callback functions for net-snmp and registers the
+ * serviced MIB objects with the master agent.
+ *
+ * Each object has its own callback function that is called by the
+ * master agent process whenever someone queries the corresponding MIB
+ * object.
+ *
+ * At the moment this triggers a full send/receive procedure for each
+ * queried MIB object, one of the things that are still on my todo list:
+ * a caching mechanism that reduces the number of requests sent to the
+ * ntpd process.
+ *
+ ****************************************************************************/
+#include <ntp_snmp.h>
+#include <ctype.h>
+#include <ntp.h>
+#include <libntpq.h>
+
+/* general purpose buffer length definition */
+#define NTPQ_BUFLEN 2048
+
+char ntpvalue[NTPQ_BUFLEN];
+
+
+/*****************************************************************************
+ *
+ * ntpsnmpd_parse_string
+ *
+ * This function will parse a given NULL terminated string and cut it
+ * into a fieldname and a value part (using the '=' as the delimiter.
+ * The fieldname will be converted to uppercase and all whitespace
+ * characters are removed from it.
+ * The value part is stripped, e.g. all whitespace characters are removed
+ * from the beginning and end of the string.
+ * If the value is started and ended with quotes ("), they will be removed
+ * and everything between the quotes is left untouched (including
+ * whitespace)
+ * Example:
+ * server host name = hello world!
+ * will result in a field string "SERVERHOSTNAME" and a value
+ * of "hello world!".
+ * My first Parameter = " is this! "
+ * results in a field string "MYFIRSTPARAMETER" and a value " is this! "
+ ****************************************************************************
+ * Parameters:
+ * string const char * The source string to parse.
+ * NOTE: must be NULL terminated!
+ * field char * The buffer for the field name.
+ * fieldsize size_t The size of the field buffer.
+ * value char * The buffer for the value.
+ * valuesize size_t The size of the value buffer.
+ *
+ * Returns:
+ * size_t length of value string
+ ****************************************************************************/
+
+size_t
+ntpsnmpd_parse_string(
+ const char * string,
+ char * field,
+ size_t fieldsize,
+ char * value,
+ size_t valuesize
+ )
+{
+ int i;
+ int j;
+ int loop;
+ size_t str_cnt;
+ size_t val_cnt;
+
+ /* we need at least one byte to work with to simplify */
+ if (fieldsize < 1 || valuesize < 1)
+ return 0;
+
+ str_cnt = strlen(string);
+
+ /* Parsing the field name */
+ j = 0;
+ loop = TRUE;
+ for (i = 0; loop && i <= str_cnt; i++) {
+ switch (string[i]) {
+
+ case '\t': /* Tab */
+ case '\n': /* LF */
+ case '\r': /* CR */
+ case ' ': /* Space */
+ break;
+
+ case '=':
+ loop = FALSE;
+ break;
+
+ default:
+ if (j < fieldsize)
+ field[j++] = toupper(string[i]);
+ }
+ }
+
+ j = min(j, fieldsize - 1);
+ field[j] = '\0';
+
+ /* Now parsing the value */
+ value[0] = '\0';
+ j = 0;
+ for (val_cnt = 0; i < str_cnt; i++) {
+ if (string[i] > 0x0D && string[i] != ' ')
+ val_cnt = min(j + 1, valuesize - 1);
+
+ if (value[0] != '\0' ||
+ (string[i] > 0x0D && string[i] != ' ')) {
+ if (j < valuesize)
+ value[j++] = string[i];
+ }
+ }
+ value[val_cnt] = '\0';
+
+ if (value[0] == '"') {
+ val_cnt--;
+ strlcpy(value, &value[1], valuesize);
+ if (val_cnt > 0 && value[val_cnt - 1] == '"') {
+ val_cnt--;
+ value[val_cnt] = '\0';
+ }
+ }
+
+ return val_cnt;
+}
+
+
+/*****************************************************************************
+ *
+ * ntpsnmpd_cut_string
+ *
+ * This function will parse a given NULL terminated string and cut it
+ * into fields using the specified delimiter character.
+ * It will then copy the requested field into a destination buffer
+ * Example:
+ * ntpsnmpd_cut_string(read:my:lips:fool, RESULT, ':', 2, sizeof(RESULT))
+ * will copy "lips" to RESULT.
+ ****************************************************************************
+ * Parameters:
+ * src const char * The name of the source string variable
+ * NOTE: must be NULL terminated!
+ * dest char * The name of the string which takes the
+ * requested field content
+ * delim char The delimiter character
+ * fieldnumber int The number of the required field
+ * (start counting with 0)
+ * maxsize size_t The maximum size of dest
+ *
+ * Returns:
+ * size_t length of resulting dest string
+ ****************************************************************************/
+
+size_t
+ntpsnmpd_cut_string(
+ const char * string,
+ char * dest,
+ char delim,
+ int fieldnumber,
+ size_t maxsize
+ )
+{
+ size_t i;
+ size_t j;
+ int l;
+ size_t str_cnt;
+
+ if (maxsize < 1)
+ return 0;
+
+ str_cnt = strlen(string);
+ j = 0;
+ memset(dest, 0, maxsize);
+
+ /* Parsing the field name */
+ for (i = 0, l = 0; i < str_cnt && l <= fieldnumber; i++) {
+ if (string[i] == delim)
+ l++; /* next field */
+ else if (l == fieldnumber && j < maxsize)
+ dest[j++] = string[i];
+ }
+ j = min(j, maxsize - 1);
+ dest[j] = '\0';
+
+ return j;
+}
+
+
+/*****************************************************************************
+ *
+ * read_ntp_value
+ *
+ * This function retrieves the value for a given variable, currently
+ * this only supports sysvars. It starts a full mode 6 send/receive/parse
+ * iteration and needs to be optimized, e.g. by using a caching mechanism
+ *
+ ****************************************************************************
+ * Parameters:
+ * variable char* The name of the required variable
+ * rbuffer char* The buffer where the value goes
+ * maxlength int Max. number of bytes for resultbuf
+ *
+ * Returns:
+ * u_int number of chars that have been copied to
+ * rbuffer
+ ****************************************************************************/
+
+size_t
+read_ntp_value(
+ const char * variable,
+ char * value,
+ size_t valuesize
+ )
+{
+ size_t sv_len;
+ char sv_data[NTPQ_BUFLEN];
+
+ memset(sv_data, 0, sizeof(sv_data));
+ sv_len = ntpq_read_sysvars(sv_data, sizeof(sv_data));
+
+ if (0 == sv_len)
+ return 0;
+ else
+ return ntpq_getvar(sv_data, sv_len, variable, value,
+ valuesize);
+}
+
+
+/*****************************************************************************
+ *
+ * The get_xxx functions
+ *
+ * The following function calls are callback functions that will be
+ * used by the master agent process to retrieve a value for a requested
+ * MIB object.
+ *
+ ****************************************************************************/
+
+
+int get_ntpEntSoftwareName (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ char ntp_softwarename[NTPQ_BUFLEN];
+
+ memset (ntp_softwarename, 0, NTPQ_BUFLEN);
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ {
+ if ( read_ntp_value("product", ntpvalue, NTPQ_BUFLEN) )
+ {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)ntpvalue,
+ strlen(ntpvalue)
+ );
+ }
+ else if ( read_ntp_value("version", ntpvalue, NTPQ_BUFLEN) )
+ {
+ ntpsnmpd_cut_string(ntpvalue, ntp_softwarename, ' ', 0, sizeof(ntp_softwarename)-1);
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)ntp_softwarename,
+ strlen(ntp_softwarename)
+ );
+ } else {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)"N/A",
+ 3
+ );
+ }
+ break;
+
+ }
+
+
+ default:
+ /* If we cannot get the information we need, we will return a generic error to the SNMP client */
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int get_ntpEntSoftwareVersion (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ {
+
+ if ( read_ntp_value("version", ntpvalue, NTPQ_BUFLEN) )
+ {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)ntpvalue,
+ strlen(ntpvalue)
+ );
+ } else {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)"N/A",
+ 3
+ );
+ }
+ break;
+
+ }
+
+
+ default:
+ /* If we cannot get the information we need, we will return a generic error to the SNMP client */
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int get_ntpEntSoftwareVendor (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ {
+
+ if ( read_ntp_value("vendor", ntpvalue, NTPQ_BUFLEN) )
+ {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)ntpvalue,
+ strlen(ntpvalue)
+ );
+ } else {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)"N/A",
+ 3
+ );
+ }
+ break;
+
+ default:
+ /* If we cannot get the information we need, we will return a generic error to the SNMP client */
+ return SNMP_ERR_GENERR;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int get_ntpEntSystemType (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ {
+
+ if ( read_ntp_value("systemtype", ntpvalue, NTPQ_BUFLEN) )
+ {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)ntpvalue,
+ strlen(ntpvalue)
+ );
+ }
+
+ if ( read_ntp_value("system", ntpvalue, NTPQ_BUFLEN) )
+ {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)ntpvalue,
+ strlen(ntpvalue)
+ );
+ } else {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)"N/A",
+ 3
+ );
+ }
+ break;
+
+ }
+
+
+ default:
+ /* If we cannot get the information we need, we will return a generic error to the SNMP client */
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/*
+ * ntpEntTimeResolution
+ * "The time resolution in integer format, where the resolution
+ * is represented as divisions of a second, e.g., a value of 1000
+ * translates to 1.0 ms."
+ *
+ * ntpEntTimeResolution is a challenge for ntpd, as the resolution is
+ * not known nor exposed by ntpd, only the measured precision (time to
+ * read the clock).
+ *
+ * Logically the resolution must be at least the precision, so report
+ * it as our best approximation of resolution until/unless ntpd provides
+ * better.
+ */
+int
+get_ntpEntTimeResolution(
+ netsnmp_mib_handler * handler,
+ netsnmp_handler_registration * reginfo,
+ netsnmp_agent_request_info * reqinfo,
+ netsnmp_request_info * requests
+ )
+{
+ int precision;
+ u_int32 resolution;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ if (!read_ntp_value("precision", ntpvalue,
+ sizeof(ntpvalue)))
+ return SNMP_ERR_GENERR;
+ if (1 != sscanf(ntpvalue, "%d", &precision))
+ return SNMP_ERR_GENERR;
+ if (precision >= 0)
+ return SNMP_ERR_GENERR;
+ precision = max(precision, -31);
+ resolution = 1 << -precision;
+ snmp_set_var_typed_value(
+ requests->requestvb,
+ ASN_UNSIGNED,
+ (void *)&resolution,
+ sizeof(resolution));
+ break;
+
+ default:
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/*
+ * ntpEntTimePrecision
+ * "The entity's precision in integer format, shows the precision.
+ * A value of -5 would mean 2^-5 = 31.25 ms."
+ */
+int
+get_ntpEntTimePrecision(
+ netsnmp_mib_handler * handler,
+ netsnmp_handler_registration * reginfo,
+ netsnmp_agent_request_info * reqinfo,
+ netsnmp_request_info * requests
+ )
+{
+ int precision;
+ int32 precision32;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ if (!read_ntp_value("precision", ntpvalue,
+ sizeof(ntpvalue)))
+ return SNMP_ERR_GENERR;
+ if (1 != sscanf(ntpvalue, "%d", &precision))
+ return SNMP_ERR_GENERR;
+ precision32 = (int32)precision;
+ snmp_set_var_typed_value(
+ requests->requestvb,
+ ASN_INTEGER,
+ (void *)&precision32,
+ sizeof(precision32));
+ break;
+
+ default:
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int get_ntpEntTimeDistance (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ {
+
+ if ( read_ntp_value("rootdelay", ntpvalue, NTPQ_BUFLEN) )
+ {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)ntpvalue,
+ strlen(ntpvalue)
+ );
+ } else {
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)"N/A",
+ 3
+ );
+ }
+ break;
+
+ }
+
+
+ default:
+ /* If we cannot get the information we need, we will return a generic error to the SNMP client */
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/*
+ *
+ * Initialize sub agent
+ */
+
+void
+init_ntpSnmpSubagentObject(void)
+{
+ /* Register all MIB objects with the agentx master */
+ NTP_OID_RO( ntpEntSoftwareName, 1, 1, 1, 0);
+ NTP_OID_RO( ntpEntSoftwareVersion, 1, 1, 2, 0);
+ NTP_OID_RO( ntpEntSoftwareVendor, 1, 1, 3, 0);
+ NTP_OID_RO( ntpEntSystemType, 1, 1, 4, 0);
+ NTP_OID_RO( ntpEntTimeResolution, 1, 1, 5, 0);
+ NTP_OID_RO( ntpEntTimePrecision, 1, 1, 6, 0);
+ NTP_OID_RO( ntpEntTimeDistance, 1, 1, 7, 0);
+}
+
diff --git a/ntpsnmpd/ntpSnmpSubagentObject.h b/ntpsnmpd/ntpSnmpSubagentObject.h
new file mode 100644
index 0000000..41d5ac9
--- /dev/null
+++ b/ntpsnmpd/ntpSnmpSubagentObject.h
@@ -0,0 +1,81 @@
+/*****************************************************************************
+ *
+ * ntpSnmpSubAgentObject.h
+ *
+ * Definitions and macros for ntpSnmpSubAgentObject.c
+ *
+ ****************************************************************************/
+
+
+#ifndef NTPSNMPSUBAGENTOBJECT_H
+#define NTPSNMPSUBAGENTOBJECT_H
+
+/* Function Prototypes */
+size_t ntpsnmpd_parse_string(const char *string, char *field, size_t
+ fieldsize, char *value, size_t valuesize);
+size_t ntpsnmpd_cut_string(const char *string, char *dest, char delim,
+ int fieldnumber, size_t maxsize);
+size_t read_ntp_value(const char *variable, char *value,
+ size_t valuesize);
+
+/* Initialization */
+void init_ntpSnmpSubagentObject(void);
+
+/* MIB Section 1 Callback Functions*/
+Netsnmp_Node_Handler get_ntpEntSoftwareName;
+Netsnmp_Node_Handler get_ntpEntSoftwareVersion;
+Netsnmp_Node_Handler get_ntpEntSoftwareVendor;
+Netsnmp_Node_Handler get_ntpEntSystemType;
+Netsnmp_Node_Handler get_ntpEntTimeResolution;
+Netsnmp_Node_Handler get_ntpEntTimePrecision;
+Netsnmp_Node_Handler get_ntpEntTimeDistance;
+
+/* MIB Section 2 Callback Functions (TODO) */
+Netsnmp_Node_Handler get_ntpEntStatusCurrentMode;
+Netsnmp_Node_Handler get_ntpEntStatusCurrentModeVal;
+Netsnmp_Node_Handler get_ntpEntStatusStratum;
+Netsnmp_Node_Handler get_ntpEntStatusActiveRefSourceId;
+Netsnmp_Node_Handler get_ntpEntStatusActiveRefSourceName;
+Netsnmp_Node_Handler get_ntpEntStatusActiveOffset;
+
+#define NTPV4_OID 1,3,6,1,2,1,197 /* mib-2 197 */
+
+
+/*
+ * The following macros simplify the registration of the callback
+ * functions and register the name and OID of either read-only (RO) or
+ * read-write (RW) functions.
+ */
+
+#define SETUP_OID_RO(oidname, ...) \
+static oid oidname##_oid [] = { __VA_ARGS__ }; \
+{ \
+ netsnmp_register_read_only_instance( \
+ netsnmp_create_handler_registration( \
+ "#oidname", \
+ get_##oidname, \
+ oidname##_oid, \
+ OID_LENGTH \
+ ( oidname##_oid ), \
+ HANDLER_CAN_RONLY)); \
+}
+
+#define SETUP_OID_RW(oidname, ...) \
+static oid oidname##_oid [] = { __VA_ARGS__ }; \
+{ \
+ netsnmp_register_instance( \
+ netsnmp_create_handler_registration( \
+ "#oidname", \
+ do_##oidname, \
+ oidname##_oid, \
+ OID_LENGTH \
+ ( oidname##_oid ), \
+ HANDLER_CAN_RWRITE)); \
+}
+
+#define NTP_OID_RO(oidname, w, x, y, z) \
+ SETUP_OID_RO(oidname, NTPV4_OID, w, x, y, z)
+#define NTP_OID_RW(oidname, w, x, y, z) \
+ SETUP_OID_RW(oidname, NTPV4_OID, w, x, y, z)
+
+#endif
diff --git a/ntpsnmpd/ntp_snmp.h b/ntpsnmpd/ntp_snmp.h
new file mode 100644
index 0000000..1e0499d
--- /dev/null
+++ b/ntpsnmpd/ntp_snmp.h
@@ -0,0 +1,34 @@
+/*
+ * ntp_snmp.h -- common net-snmp header includes and workaround
+ * for Autoconf-related PACKAGE_* redefinitions between
+ * net-snmp and NTP.
+ *
+ * Currently ntpsnmpd *.c files are exceptions to the rule that every .c
+ * file should include <config.h> before any other headers. It would be
+ * ideal to rearrange its includes so that our config.h is first, but
+ * that is complicated by the redefinitions between our config.h and
+ * net-snmp/net-snmp-config.h.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#ifdef PACKAGE_BUGREPORT
+# undef PACKAGE_BUGREPORT
+#endif
+#ifdef PACKAGE_NAME
+# undef PACKAGE_NAME
+#endif
+#ifdef PACKAGE_STRING
+# undef PACKAGE_STRING
+#endif
+#ifdef PACKAGE_TARNAME
+# undef PACKAGE_TARNAME
+#endif
+#ifdef PACKAGE_VERSION
+# undef PACKAGE_VERSION
+#endif
+
+#include <ntpSnmpSubagentObject.h>
+#include <config.h>
diff --git a/ntpsnmpd/ntpsnmpd-opts.c b/ntpsnmpd/ntpsnmpd-opts.c
new file mode 100644
index 0000000..f5dc900
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd-opts.c
@@ -0,0 +1,910 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:58:13 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpsnmpd-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpsnmpd author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpsnmpd program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+
+#ifndef __doxygen__
+#define OPTION_CODE_COMPILE 1
+#include "ntpsnmpd-opts.h"
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern FILE * option_usage_fp;
+#define zCopyright (ntpsnmpd_opt_strs+0)
+#define zLicenseDescrip (ntpsnmpd_opt_strs+318)
+
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/**
+ * static const strings for ntpsnmpd options
+ */
+static char const ntpsnmpd_opt_strs[1560] =
+/* 0 */ "ntpsnmpd 4.2.7p482\n"
+ "Copyright (C) 1970-2014 The University of Delaware, 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"
+ "can be seen at:\n"
+ " <http://ntp.org/license>\n"
+ " <http://opensource.org/licenses/ntp-license.php>\n\0"
+/* 318 */ "Permission to use, copy, modify, and distribute this software and its\n"
+ "documentation for any purpose with or without fee is hereby granted,\n"
+ "provided that the above copyright notice appears in all copies and that\n"
+ "both the copyright notice and this permission notice appear in supporting\n"
+ "documentation, and that the name The University of Delaware not be used in\n"
+ "advertising or publicity pertaining to distribution of the software without\n"
+ "specific, written prior permission. The University of Delaware makes no\n"
+ "representations about the suitability this software for any purpose. It is\n"
+ "provided \"as is\" without express or implied warranty.\n\0"
+/* 958 */ "Do not fork\0"
+/* 970 */ "NOFORK\0"
+/* 977 */ "nofork\0"
+/* 984 */ "Log to syslog()\0"
+/* 1000 */ "SYSLOG\0"
+/* 1007 */ "syslog\0"
+/* 1014 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0"
+/* 1071 */ "AGENTXSOCKET\0"
+/* 1084 */ "agentxsocket\0"
+/* 1097 */ "unix:/var/agentx/master\0"
+/* 1121 */ "display extended usage information and exit\0"
+/* 1165 */ "help\0"
+/* 1170 */ "extended usage information passed thru pager\0"
+/* 1215 */ "more-help\0"
+/* 1225 */ "output version information and exit\0"
+/* 1261 */ "version\0"
+/* 1269 */ "save the option state to a config file\0"
+/* 1308 */ "save-opts\0"
+/* 1318 */ "load options from a config file\0"
+/* 1350 */ "LOAD_OPTS\0"
+/* 1360 */ "no-load-opts\0"
+/* 1373 */ "no\0"
+/* 1376 */ "NTPSNMPD\0"
+/* 1385 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p482\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
+/* 1490 */ "$HOME\0"
+/* 1496 */ ".\0"
+/* 1498 */ ".ntprc\0"
+/* 1505 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 1539 */ "\n\0"
+/* 1541 */ "ntpsnmpd 4.2.7p482";
+
+/**
+ * nofork option description:
+ */
+/** Descriptive text for the nofork option */
+#define NOFORK_DESC (ntpsnmpd_opt_strs+958)
+/** Upper-cased name for the nofork option */
+#define NOFORK_NAME (ntpsnmpd_opt_strs+970)
+/** Name string for the nofork option */
+#define NOFORK_name (ntpsnmpd_opt_strs+977)
+/** Compiled in flag settings for the nofork option */
+#define NOFORK_FLAGS (OPTST_DISABLED)
+
+/**
+ * syslog option description:
+ */
+/** Descriptive text for the syslog option */
+#define SYSLOG_DESC (ntpsnmpd_opt_strs+984)
+/** Upper-cased name for the syslog option */
+#define SYSLOG_NAME (ntpsnmpd_opt_strs+1000)
+/** Name string for the syslog option */
+#define SYSLOG_name (ntpsnmpd_opt_strs+1007)
+/** Compiled in flag settings for the syslog option */
+#define SYSLOG_FLAGS (OPTST_DISABLED)
+
+/**
+ * agentXSocket option description:
+ */
+/** Descriptive text for the agentXSocket option */
+#define AGENTXSOCKET_DESC (ntpsnmpd_opt_strs+1014)
+/** Upper-cased name for the agentXSocket option */
+#define AGENTXSOCKET_NAME (ntpsnmpd_opt_strs+1071)
+/** Name string for the agentXSocket option */
+#define AGENTXSOCKET_name (ntpsnmpd_opt_strs+1084)
+/** The compiled in default value for the agentXSocket option argument */
+#define AGENTXSOCKET_DFT_ARG (ntpsnmpd_opt_strs+1097)
+/** Compiled in flag settings for the agentXSocket option */
+#define AGENTXSOCKET_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/*
+ * Help/More_Help/Version option descriptions:
+ */
+#define HELP_DESC (ntpsnmpd_opt_strs+1121)
+#define HELP_name (ntpsnmpd_opt_strs+1165)
+#ifdef HAVE_WORKING_FORK
+#define MORE_HELP_DESC (ntpsnmpd_opt_strs+1170)
+#define MORE_HELP_name (ntpsnmpd_opt_strs+1215)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+#define MORE_HELP_DESC HELP_DESC
+#define MORE_HELP_name HELP_name
+#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#endif
+#ifdef NO_OPTIONAL_OPT_ARGS
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
+#endif
+#define VER_DESC (ntpsnmpd_opt_strs+1225)
+#define VER_name (ntpsnmpd_opt_strs+1261)
+#define SAVE_OPTS_DESC (ntpsnmpd_opt_strs+1269)
+#define SAVE_OPTS_name (ntpsnmpd_opt_strs+1308)
+#define LOAD_OPTS_DESC (ntpsnmpd_opt_strs+1318)
+#define LOAD_OPTS_NAME (ntpsnmpd_opt_strs+1350)
+#define NO_LOAD_OPTS_name (ntpsnmpd_opt_strs+1360)
+#define LOAD_OPTS_pfx (ntpsnmpd_opt_strs+1373)
+#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
+/**
+ * Declare option callback procedures
+ */
+extern tOptProc
+ ntpOptionPrintVersion, optionBooleanVal, optionNestedVal,
+ optionNumericVal, optionPagedUsage, optionResetOpt,
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVendorOption;
+static tOptProc
+ doUsageOpt;
+#define VER_PROC ntpOptionPrintVersion
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the ntpsnmpd Option Descriptions.
+ * This is an array of OPTION_CT entries, one for each
+ * option that the ntpsnmpd program responds to.
+ */
+static tOptDesc optDesc[OPTION_CT] = {
+ { /* entry idx, value */ 0, VALUE_OPT_NOFORK,
+ /* equiv idx, value */ 0, VALUE_OPT_NOFORK,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ NOFORK_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --nofork */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 1, VALUE_OPT_SYSLOG,
+ /* equiv idx, value */ 1, VALUE_OPT_SYSLOG,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SYSLOG_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --syslog */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SYSLOG_DESC, SYSLOG_NAME, SYSLOG_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
+ /* equiv idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ AGENTXSOCKET_FLAGS, 0,
+ /* last opt argumnt */ { AGENTXSOCKET_DFT_ARG },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ AGENTXSOCKET_DESC, AGENTXSOCKET_NAME, AGENTXSOCKET_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ VER_PROC,
+ /* desc, NAME, name */ VER_DESC, NULL, VER_name,
+ /* disablement strs */ NULL, NULL },
+
+
+
+ { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doUsageOpt,
+ /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionPagedUsage,
+ /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionLoadOpt,
+ /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
+ /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
+};
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of ntpsnmpd. */
+#define zPROGNAME (ntpsnmpd_opt_strs+1376)
+/** Reference to the title line for ntpsnmpd usage. */
+#define zUsageTitle (ntpsnmpd_opt_strs+1385)
+/** ntpsnmpd configuration file name. */
+#define zRcName (ntpsnmpd_opt_strs+1498)
+/** Directories to search for ntpsnmpd config files. */
+static char const * const apzHomeList[3] = {
+ ntpsnmpd_opt_strs+1490,
+ ntpsnmpd_opt_strs+1496,
+ NULL };
+/** The ntpsnmpd program bug email address. */
+#define zBugsAddr (ntpsnmpd_opt_strs+1505)
+/** Clarification/explanation of what ntpsnmpd does. */
+#define zExplain (ntpsnmpd_opt_strs+1539)
+/** Extra detail explaining what ntpsnmpd does. */
+#define zDetail (NULL)
+/** The full version string for ntpsnmpd. */
+#define zFullVersion (ntpsnmpd_opt_strs+1541)
+/* extracted from optcode.tlib near line 364 */
+
+#if defined(ENABLE_NLS)
+# define OPTPROC_BASE OPTPROC_TRANSLATE
+ static tOptionXlateProc translate_option_strings;
+#else
+# define OPTPROC_BASE OPTPROC_NONE
+# define translate_option_strings NULL
+#endif /* ENABLE_NLS */
+
+#define ntpsnmpd_full_usage (NULL)
+#define ntpsnmpd_short_usage (NULL)
+
+#endif /* not defined __doxygen__ */
+
+/*
+ * Create the static procedure(s) declared above.
+ */
+/**
+ * The callout function that invokes the optionUsage function.
+ *
+ * @param[in] opts the AutoOpts option description structure
+ * @param[in] od the descriptor for the "help" (usage) option.
+ * @noreturn
+ */
+static void
+doUsageOpt(tOptions * opts, tOptDesc * od)
+{
+ int ex_code;
+ ex_code = NTPSNMPD_EXIT_SUCCESS;
+ optionUsage(&ntpsnmpdOptions, ex_code);
+ /* NOTREACHED */
+ exit(1);
+ (void)opts;
+ (void)od;
+}
+/* extracted from optmain.tlib near line 1245 */
+
+/**
+ * The directory containing the data associated with ntpsnmpd.
+ */
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+/**
+ * Information about the person or institution that packaged ntpsnmpd
+ * for the current distribution.
+ */
+#ifndef WITH_PACKAGER
+# define ntpsnmpd_packager_info NULL
+#else
+/** Packager information for ntpsnmpd. */
+static char const ntpsnmpd_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntpsnmpd bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+#ifndef __doxygen__
+
+#endif /* __doxygen__ */
+/**
+ * The option definitions for ntpsnmpd. The one structure that
+ * binds them all.
+ */
+tOptions ntpsnmpdOptions = {
+ OPTIONS_STRUCT_VERSION,
+ 0, NULL, /* original argc + argv */
+ ( OPTPROC_BASE
+ + OPTPROC_ERRSTOP
+ + OPTPROC_SHORTOPT
+ + OPTPROC_LONGOPT
+ + OPTPROC_NO_REQ_OPT
+ + OPTPROC_ENVIRON
+ + OPTPROC_NO_ARGS
+ + OPTPROC_MISUSE ),
+ 0, NULL, /* current option index, current option */
+ NULL, NULL, zPROGNAME,
+ zRcName, zCopyright, zLicenseDescrip,
+ zFullVersion, apzHomeList, zUsageTitle,
+ zExplain, zDetail, optDesc,
+ zBugsAddr, /* address to send bugs to */
+ NULL, NULL, /* extensions/saved state */
+ optionUsage, /* usage procedure */
+ translate_option_strings, /* translation procedure */
+ /*
+ * Indexes to special options
+ */
+ { INDEX_OPT_MORE_HELP, /* more-help option index */
+ INDEX_OPT_SAVE_OPTS, /* save option index */
+ NO_EQUIVALENT, /* '-#' option index */
+ NO_EQUIVALENT /* index of default opt */
+ },
+ 8 /* full option count */, 3 /* user option count */,
+ ntpsnmpd_full_usage, ntpsnmpd_short_usage,
+ NULL, NULL,
+ PKGDATADIR, ntpsnmpd_packager_info
+};
+
+#if ENABLE_NLS
+/**
+ * This code is designed to translate translatable option text for the
+ * ntpsnmpd program. These translations happen upon entry
+ * to optionProcess().
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#ifdef HAVE_DCGETTEXT
+# include <gettext.h>
+#endif
+#include <autoopts/usage-txt.h>
+
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
+
+/**
+ * AutoGen specific wrapper function for gettext. It relies on the macro _()
+ * to convert from English to the target language, then strdup-duplicates the
+ * result string. It tries the "libopts" domain first, then whatever has been
+ * set via the \a textdomain(3) call.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
+AO_gettext(char const * pz)
+{
+ char * res;
+ if (pz == NULL)
+ return NULL;
+#ifdef HAVE_DCGETTEXT
+ /*
+ * While processing the option_xlateable_txt data, try to use the
+ * "libopts" domain. Once we switch to the option descriptor data,
+ * do *not* use that domain.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ res = dgettext("libopts", pz);
+ if (res == pz)
+ res = (char *)(void *)_(pz);
+ } else
+ res = (char *)(void *)_(pz);
+#else
+ res = (char *)(void *)_(pz);
+#endif
+ if (res == pz)
+ return res;
+ res = strdup(res);
+ if (res == NULL) {
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(NTPSNMPD_EXIT_FAILURE);
+ }
+ return res;
+}
+
+/**
+ * All the pointers we use are marked "* const", but they are stored in
+ * writable memory. Coerce the mutability and set the pointer.
+ */
+static void coerce_it(void ** s) { *s = AO_gettext(*s);
+}
+
+/**
+ * Translate all the translatable strings in the ntpsnmpdOptions
+ * structure defined above. This is done only once.
+ */
+static void
+translate_option_strings(void)
+{
+ tOptions * const opts = &ntpsnmpdOptions;
+
+ /*
+ * Guard against re-translation. It won't work. The strings will have
+ * been changed by the first pass through this code. One shot only.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ /*
+ * Do the translations. The first pointer follows the field count
+ * field. The field count field is the size of a pointer.
+ */
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
+
+ do {
+ ppz++; /* skip over field_ct */
+ *ppz = AO_gettext(*ppz);
+ } while (--ix > 0);
+ /* prevent re-translation and disable "libopts" domain lookup */
+ option_xlateable_txt.field_ct = 0;
+
+ coerce_it((void*)&(opts->pzCopyright));
+ coerce_it((void*)&(opts->pzCopyNotice));
+ coerce_it((void*)&(opts->pzFullVersion));
+ coerce_it((void*)&(opts->pzUsageTitle));
+ coerce_it((void*)&(opts->pzExplain));
+ coerce_it((void*)&(opts->pzDetail));
+ {
+ tOptDesc * od = opts->pOptDesc;
+ for (ix = opts->optCt; ix > 0; ix--, od++)
+ coerce_it((void*)&(od->pzText));
+ }
+ }
+}
+#endif /* ENABLE_NLS */
+
+#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
+/** I18N function strictly for xgettext. Do not compile. */
+static void bogus_function(void) {
+ /* TRANSLATORS:
+
+ The following dummy function was crated solely so that xgettext can
+ extract the correct strings. These strings are actually referenced
+ by a field name in the ntpsnmpdOptions structure noted in the
+ comments below. The literal text is defined in ntpsnmpd_opt_strs.
+
+ NOTE: the strings below are segmented with respect to the source string
+ ntpsnmpd_opt_strs. The strings above are handed off for translation
+ at run time a paragraph at a time. Consequently, they are presented here
+ for translation a paragraph at a time.
+
+ ALSO: often the description for an option will reference another option
+ by name. These are set off with apostrophe quotes (I hope). Do not
+ translate option names.
+ */
+ /* referenced via ntpsnmpdOptions.pzCopyright */
+ puts(_("ntpsnmpd 4.2.7p482\n\
+Copyright (C) 1970-2014 The University of Delaware, 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\
+can be seen at:\n"));
+ puts(_(" <http://ntp.org/license>\n\
+ <http://opensource.org/licenses/ntp-license.php>\n"));
+
+ /* referenced via ntpsnmpdOptions.pzCopyNotice */
+ puts(_("Permission to use, copy, modify, and distribute this software and its\n\
+documentation for any purpose with or without fee is hereby granted,\n\
+provided that the above copyright notice appears in all copies and that\n\
+both the copyright notice and this permission notice appear in supporting\n\
+documentation, and that the name The University of Delaware not be used in\n\
+advertising or publicity pertaining to distribution of the software without\n\
+specific, written prior permission. The University of Delaware makes no\n\
+representations about the suitability this software for any purpose. It is\n\
+provided \"as is\" without express or implied warranty.\n"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("Do not fork"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("Log to syslog()"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("The socket address ntpsnmpd uses to connect to net-snmpd"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("display extended usage information and exit"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("extended usage information passed thru pager"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("output version information and exit"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("save the option state to a config file"));
+
+ /* referenced via ntpsnmpdOptions.pOptDesc->pzText */
+ puts(_("load options from a config file"));
+
+ /* referenced via ntpsnmpdOptions.pzUsageTitle */
+ puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.7p482\n\
+Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
+
+ /* referenced via ntpsnmpdOptions.pzExplain */
+ puts(_("\n"));
+
+ /* referenced via ntpsnmpdOptions.pzFullVersion */
+ puts(_("ntpsnmpd 4.2.7p482"));
+
+ /* referenced via ntpsnmpdOptions.pzFullUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+
+ /* referenced via ntpsnmpdOptions.pzShortUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 86 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 84 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 88 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* uncompilable code */
+#ifdef __cplusplus
+}
+#endif
+/* ntpsnmpd-opts.c ends here */
diff --git a/ntpsnmpd/ntpsnmpd-opts.def b/ntpsnmpd/ntpsnmpd-opts.def
new file mode 100644
index 0000000..b3162e5
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd-opts.def
@@ -0,0 +1,146 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include copyright.def
+#include homerc.def
+#include autogen-version.def
+
+prog-name = "ntpsnmpd";
+prog-title = "NTP SNMP MIB agent";
+
+flag = {
+ name = nofork;
+ value = n;
+ descrip = "Do not fork";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = syslog;
+ value = p;
+ descrip = "Log to syslog()";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = agentXSocket;
+/* value = x; */
+ arg-type = string;
+ arg-default = "unix:/var/agentx/master";
+ descrip = "The socket address ntpsnmpd uses to connect to net-snmpd";
+ doc = <<- _EndOfDoc_
+ [<transport-specifier>:]<transport-address>
+ The default "agent X socket" is the Unix Domain socket
+ @file{unix:/var/agentx/master}.
+ Another common alternative is @file{tcp:localhost:705}.
+ _EndOfDoc_;
+};
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+ .Nm
+ is an SNMP MIB agent designed to interface with
+ .Xr ntpd 1ntpdmdoc .
+ _END_PROG_MDOC_DESCRIP;
+};
+
+/*
+prog-info-descrip = <<- _END_PROG_INFO_DESCRIP
+ _END_PROG_INFO_DESCRIP;
+*/
+
+doc-section = {
+ ds-type = 'USAGE';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_USAGE
+ .Nm
+ currently uses a private MIB OID,
+ .Ql enterprises.5597 ,
+ which is the Meinberg top level OEM OID, and
+ .Ql 99
+ is the temporary working space for this project.
+ The final OID has to be registered with IANA
+ and this is done by the RFC Editor
+ when the NTPv4 MIB RFC is standardized.
+ .Pp
+ If you have
+ .Xr snmpwalk 1
+ installed you can run
+ .Dl % snmpwalk -v2c -c public localhost enterprises.5597.99
+ to see a list of all currently supported NTP MIB objects
+ and their current values.
+ _END_MDOC_USAGE;
+};
+
+doc-section = {
+ ds-type = 'NOTES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_NOTES
+The following objects are currently supported:
+.Pp
+.Bl -tag -width ".Li ntpEntSoftwareVersionVal" -compact -offset indent
+.It Li ntpEntSoftwareName
+please fill me in...
+.It Li ntpEntSoftwareVersion
+please fill me in...
+.It Li ntpEntSoftwareVersionVal
+please fill me in...
+.It Li ntpEntSoftwareVendor
+please fill me in...
+.It Li ntpEntSystemType
+please fill me in...
+.It Li ntpEntTimeResolution
+please fill me in...
+.It Li ntpEntTimeResolutionVal
+please fill me in...
+.It Li ntpEntTimePrecision
+please fill me in...
+.It Li ntpEntTimePrecisionVal
+please fill me in...
+.It Li ntpEntTimeDistance
+please fill me in...
+.El
+ _END_MDOC_NOTES;
+};
+
+doc-section = {
+ ds-type = 'AUTHORS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_AUTHORS
+.An "Heiko Gerstung"
+ _END_MDOC_AUTHORS;
+};
+
+/*
+doc-section = {
+ ds-type = 'SEE ALSO';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_SEE_ALSO
+.Rs
+.%A H. Gerstung
+.%A C. Elliott
+.%A B. Haberman, Ed.
+.%T Definitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)
+.%O RFC5907
+.Re
+ _END_MDOC_SEE_ALSO;
+};
+*/
+
+/*
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+ _END_MDOC_BUGS;
+};
+*/
diff --git a/ntpsnmpd/ntpsnmpd-opts.h b/ntpsnmpd/ntpsnmpd-opts.h
new file mode 100644
index 0000000..f4608dd
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd-opts.h
@@ -0,0 +1,243 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:58:13 AM by AutoGen 5.18.5pre4
+ * From the definitions ntpsnmpd-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntpsnmpd author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntpsnmpd program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+/**
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the ntpsnmpd program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_NTPSNMPD_OPTS_H_GUARD
+#define AUTOOPTS_NTPSNMPD_OPTS_H_GUARD 1
+#include "config.h"
+#include <autoopts/options.h>
+
+/**
+ * Ensure that the library used for compiling this generated header is at
+ * least as new as the version current when the header template was released
+ * (not counting patch version increments). Also ensure that the oldest
+ * tolerable version is at least as old as what was current when the header
+ * template was released.
+ */
+#define AO_TEMPLATE_VERSION 167936
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+ Choke Me.
+#endif
+
+/**
+ * Enumeration of each option type for ntpsnmpd
+ */
+typedef enum {
+ INDEX_OPT_NOFORK = 0,
+ INDEX_OPT_SYSLOG = 1,
+ INDEX_OPT_AGENTXSOCKET = 2,
+ INDEX_OPT_VERSION = 3,
+ INDEX_OPT_HELP = 4,
+ INDEX_OPT_MORE_HELP = 5,
+ INDEX_OPT_SAVE_OPTS = 6,
+ INDEX_OPT_LOAD_OPTS = 7
+} teOptIndex;
+/** count of all options for ntpsnmpd */
+#define OPTION_CT 8
+/** ntpsnmpd version */
+#define NTPSNMPD_VERSION "4.2.7p482"
+/** Full ntpsnmpd version text */
+#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.7p482"
+
+/**
+ * Interface defines for all options. Replace "n" with the UPPER_CASED
+ * option name (as in the teOptIndex enumeration above).
+ * e.g. HAVE_OPT(NOFORK)
+ */
+#define DESC(n) (ntpsnmpdOptions.pOptDesc[INDEX_OPT_## n])
+/** 'true' if an option has been specified in any way */
+#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
+/** The string argument to an option. The argument type must be \"string\". */
+#define OPT_ARG(n) (DESC(n).optArg.argString)
+/** Mask the option state revealing how an option was specified.
+ * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
+ * \a OPTST_DEFINED, \a OPTST_RESET or zero.
+ */
+#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
+/** Count of option's occurrances *on the command line*. */
+#define COUNT_OPT(n) (DESC(n).optOccCt)
+/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
+#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
+/** 'true' if \a HAVE_OPT would yield 'false'. */
+#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
+/** 'true' if OPTST_DISABLED bit not set. */
+#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
+/** number of stacked option arguments.
+ * Valid only for stacked option arguments. */
+#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
+/** stacked argument vector.
+ * Valid only for stacked option arguments. */
+#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
+/** Reset an option. */
+#define CLEAR_OPT(n) STMTS( \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ DESC(n).fOptState |= OPTST_DISABLED; \
+ DESC(n).optCookie = NULL )
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Enumeration of ntpsnmpd exit codes
+ */
+typedef enum {
+ NTPSNMPD_EXIT_SUCCESS = 0,
+ NTPSNMPD_EXIT_FAILURE = 1,
+ NTPSNMPD_EXIT_USAGE_ERROR = 64,
+ NTPSNMPD_EXIT_NO_CONFIG_INPUT = 66,
+ NTPSNMPD_EXIT_LIBOPTS_FAILURE = 70
+} ntpsnmpd_exit_code_t;
+/** @} */
+/**
+ * Make sure there are no #define name conflicts with the option names
+ */
+#ifndef NO_OPTION_NAME_WARNINGS
+# ifdef NOFORK
+# warning undefining NOFORK due to option name conflict
+# undef NOFORK
+# endif
+# ifdef SYSLOG
+# warning undefining SYSLOG due to option name conflict
+# undef SYSLOG
+# endif
+# ifdef AGENTXSOCKET
+# warning undefining AGENTXSOCKET due to option name conflict
+# undef AGENTXSOCKET
+# endif
+#else /* NO_OPTION_NAME_WARNINGS */
+# undef NOFORK
+# undef SYSLOG
+# undef AGENTXSOCKET
+#endif /* NO_OPTION_NAME_WARNINGS */
+
+/**
+ * Interface defines for specific options.
+ * @{
+ */
+#define VALUE_OPT_NOFORK 'n'
+#define VALUE_OPT_SYSLOG 'p'
+#define VALUE_OPT_AGENTXSOCKET 0x1001
+/** option flag (value) for help-value option */
+#define VALUE_OPT_HELP '?'
+/** option flag (value) for more-help-value option */
+#define VALUE_OPT_MORE_HELP '!'
+/** option flag (value) for version-value option */
+#define VALUE_OPT_VERSION 0x1002
+/** option flag (value) for save-opts-value option */
+#define VALUE_OPT_SAVE_OPTS '>'
+/** option flag (value) for load-opts-value option */
+#define VALUE_OPT_LOAD_OPTS '<'
+#define SET_OPT_SAVE_OPTS(a) STMTS( \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
+ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
+ DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
+/*
+ * Interface defines not associated with particular options
+ */
+#define ERRSKIP_OPTERR STMTS(ntpsnmpdOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP)
+#define RESTART_OPT(n) STMTS( \
+ ntpsnmpdOptions.curOptIdx = (n); \
+ ntpsnmpdOptions.pzCurOpt = NULL )
+#define START_OPT RESTART_OPT(1)
+#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* * * * * *
+ *
+ * Declare the ntpsnmpd option descriptor.
+ */
+extern tOptions ntpsnmpdOptions;
+
+#if defined(ENABLE_NLS)
+# ifndef _
+# include <stdio.h>
+# ifndef HAVE_GETTEXT
+ extern char * gettext(char const *);
+# else
+# include <libintl.h>
+# endif
+
+# ifndef ATTRIBUTE_FORMAT_ARG
+# define ATTRIBUTE_FORMAT_ARG(_a)
+# endif
+
+static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
+static inline char* aoGetsText(char const* pz) {
+ if (pz == NULL) return NULL;
+ return (char*)gettext(pz);
+}
+# define _(s) aoGetsText(s)
+# endif /* _() */
+
+# define OPT_NO_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT_CFG;)
+# define OPT_NO_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
+
+# define OPT_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \
+ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
+# define OPT_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \
+ ~OPTPROC_NXLAT_OPT;)
+
+#else /* ENABLE_NLS */
+# define OPT_NO_XLAT_CFG_NAMES
+# define OPT_NO_XLAT_OPT_NAMES
+
+# define OPT_XLAT_CFG_NAMES
+# define OPT_XLAT_OPT_NAMES
+
+# ifndef _
+# define _(_s) _s
+# endif
+#endif /* ENABLE_NLS */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_NTPSNMPD_OPTS_H_GUARD */
+
+/* ntpsnmpd-opts.h ends here */
diff --git a/ntpsnmpd/ntpsnmpd.1ntpsnmpdman b/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
new file mode 100644
index 0000000..90b3481
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
@@ -0,0 +1,203 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpsnmpd 1ntpsnmpdman "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ELai0P/ag-QLaaZP)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:21 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsnmpd-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpsnmpd\fP
+\- NTP SNMP MIB agent
+.SH SYNOPSIS
+\f\*[B-Font]ntpsnmpd\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpsnmpd\fP
+is an SNMP MIB agent designed to interface with
+\fCntpd\fR(1ntpdmdoc)\f[].
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-nofork\f[]
+Do not fork.
+.sp
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-syslog\f[]
+Log to syslog().
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-agentxsocket\f[]=\f\*[I-Font]string\f[]
+The socket address ntpsnmpd uses to connect to net-snmpd.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ unix:/var/agentx/master
+.sp
+[<transport-specifier>:]<transport-address>
+The default "agent X socket" is the Unix Domain socket
+\fIunix:/var/agentx/master\fP.
+Another common alternative is \fItcp:localhost:705\fP.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPSNMPD_<option-name>\fP or \fBNTPSNMPD\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+\f\*[B-Font]ntpsnmpd\fP
+currently uses a private MIB OID,
+\[oq]enterprises.5597\[cq],
+which is the Meinberg top level OEM OID, and
+\[oq]99\[cq]
+is the temporary working space for this project.
+The final OID has to be registered with IANA
+and this is done by the RFC Editor
+when the NTPv4 MIB RFC is standardized.
+.sp \n(Ppu
+.ne 2
+
+If you have
+\fCsnmpwalk\fR(1)\f[]
+installed you can run
+.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99
+to see a list of all currently supported NTP MIB objects
+and their current values.
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Heiko Gerstung"
+.br
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+The following objects are currently supported:
+.sp \n(Ppu
+.ne 2
+
+.TP 29
+.NOP \f[C]ntpEntSoftwareName\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSoftwareVersion\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSoftwareVersionVal\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSoftwareVendor\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSystemType\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimeResolution\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimeResolutionVal\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimePrecision\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimePrecisionVal\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimeDistance\f[]
+please fill me in...
+.PP
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntpsnmpd\fP
+option definitions.
diff --git a/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc b/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
new file mode 100644
index 0000000..565004c
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
@@ -0,0 +1,144 @@
+.Dd December 2 2014
+.Dt NTPSNMPD 1ntpsnmpdmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:27 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsnmpd-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpsnmpd
+.Nd NTP SNMP MIB agent
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+is an SNMP MIB agent designed to interface with
+.Xr ntpd 1ntpdmdoc .
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n , Fl \-nofork
+Do not fork.
+.sp
+.It Fl p , Fl \-syslog
+Log to syslog().
+.sp
+.It Fl \-agentxsocket Ns = Ns Ar string
+The socket address ntpsnmpd uses to connect to net\-snmpd.
+The default
+.Ar string
+for this option is:
+.ti +4
+ unix:/var/agentx/master
+.sp
+[<transport\-specifier>:]<transport\-address>
+The default "agent X socket" is the Unix Domain socket
+\fIunix:/var/agentx/master\fP.
+Another common alternative is \fItcp:localhost:705\fP.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPSNMPD_<option\-name>\fP or \fBNTPSNMPD\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+.Nm
+currently uses a private MIB OID,
+.Ql enterprises.5597 ,
+which is the Meinberg top level OEM OID, and
+.Ql 99
+is the temporary working space for this project.
+The final OID has to be registered with IANA
+and this is done by the RFC Editor
+when the NTPv4 MIB RFC is standardized.
+.Pp
+If you have
+.Xr snmpwalk 1
+installed you can run
+.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99
+to see a list of all currently supported NTP MIB objects
+and their current values.
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Heiko Gerstung"
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+The following objects are currently supported:
+.Pp
+.Bl -tag -width ".Li ntpEntSoftwareVersionVal" -compact -offset indent
+.It Li ntpEntSoftwareName
+please fill me in...
+.It Li ntpEntSoftwareVersion
+please fill me in...
+.It Li ntpEntSoftwareVersionVal
+please fill me in...
+.It Li ntpEntSoftwareVendor
+please fill me in...
+.It Li ntpEntSystemType
+please fill me in...
+.It Li ntpEntTimeResolution
+please fill me in...
+.It Li ntpEntTimeResolutionVal
+please fill me in...
+.It Li ntpEntTimePrecision
+please fill me in...
+.It Li ntpEntTimePrecisionVal
+please fill me in...
+.It Li ntpEntTimeDistance
+please fill me in...
+.El
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntpsnmpd\fP
+option definitions.
diff --git a/ntpsnmpd/ntpsnmpd.c b/ntpsnmpd/ntpsnmpd.c
new file mode 100644
index 0000000..d96ad3a
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.c
@@ -0,0 +1,118 @@
+/*****************************************************************************
+ *
+ * ntpsnmpd.c
+ *
+ * The NTP SNMP daemon is an Agent X subagent application that
+ * registers itself with a running SNMP Agent X master process running
+ * on the same machine on port TCP 705. It utilizes the libntqp library
+ * which accesses status and general data of a running ntpd process on
+ * the same machine and enables the user to monitor the status of a
+ * ntp daemon process via SNMP.
+ *
+ * This started as a Google Summer of Code 2008 project,
+ * including the ntpsnmpd sub agent and the libntpq library.
+ *
+ * For more information please visit
+ * http://support.ntp.org/bin/view/Dev/GSoC2008snmp
+ * Or contact:
+ * Harlan Stenn (Mentor) at stenn@ntp.org
+ * Heiko Gerstung (Student) at gerstung@ntp.org
+ *
+ ****************************************************************************/
+
+#include <ntp_snmp.h>
+#include <signal.h>
+#include <sys/time.h>
+
+#ifdef SOLARIS /* needed with at least Solaris 8 */
+#include <siginfo.h>
+#endif
+
+#include <libntpq.h>
+#include <ntpsnmpd-opts.h>
+
+static int keep_running;
+RETSIGTYPE stop_server(int);
+
+RETSIGTYPE
+stop_server(int a) {
+ keep_running = 0;
+}
+
+/* The main function just sets up a few things and then enters a loop in which it will
+ * wait for SNMP requests coming from the master agent
+ */
+
+int
+main (int argc, char **argv) {
+ int background = 0; /* start as background process */
+ int use_syslog = 1; /* use syslog for logging */
+
+ {
+ int optct = optionProcess(&ntpsnmpdOptions, argc, argv);
+ argc -= optct;
+ argv += optct;
+ }
+
+ if (!HAVE_OPT(NOFORK))
+ background = 1;
+
+ if (!HAVE_OPT(SYSLOG))
+ use_syslog = 0;
+
+ /* using the net-snmp syslog facility */
+ if (use_syslog)
+ snmp_enable_calllog();
+ else
+ snmp_enable_stderrlog();
+
+ /* Become Subagent */
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);
+
+ /* go into background mode, if requested */
+ if (background && netsnmp_daemonize(1, !use_syslog))
+ exit(1);
+
+ /* Now register with the master Agent X process */
+
+ /* call Netsnmp socket startup macro, which will initialize the network stuff if required */
+ SOCK_STARTUP;
+
+ /* Set AgentX socket interface */
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET, OPT_ARG( AGENTXSOCKET ));
+
+ init_agent("ntpsnmpd");
+
+ /* Try to connect to ntpd */
+ if ( ntpq_openhost("localhost", 0) == 0 )
+ {
+ fprintf(stderr, "Error: Could not connect to ntpd. Aborting.\n");
+ exit(1);
+ }
+
+
+ /* Register callback functions ... */
+ init_ntpSnmpSubagentObject();
+ init_snmp("ntpsnmpd");
+
+ /* Signal handler */
+ keep_running = 1;
+ signal(SIGTERM, stop_server);
+ signal(SIGINT, stop_server);
+
+ snmp_log(LOG_INFO,"ntpsnmpd started.\n");
+
+ /* main loop here... */
+ while(keep_running) {
+ agent_check_and_process(1); /* 0 == don't block */
+ }
+
+ /* at shutdown time */
+ ntpq_closehost();
+ snmp_shutdown("ntpsnmpd");
+ SOCK_CLEANUP;
+
+ return 0;
+}
+
diff --git a/ntpsnmpd/ntpsnmpd.html b/ntpsnmpd/ntpsnmpd.html
new file mode 100644
index 0000000..8987015
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.html
@@ -0,0 +1,79 @@
+<html lang="en">
+<head>
+<title>ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual</h1>
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">ntpsnmpd: Network Time Protocol Query User Manual</a>
+</ul>
+</div>
+
+
+
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsnmpd-Description">ntpsnmpd Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">ntpsnmpd: Network Time Protocol Query User Manual</h2>
+
+<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.7p482 of <code>ntpsnmpd</code>.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpsnmpd-Description">ntpsnmpd Description</a>: Description
+<li><a accesskey="2" href="#ntpsnmpd-Invocation">ntpsnmpd Invocation</a>: Invoking ntpsnmpd
+<li><a accesskey="3" href="#Usage">Usage</a>: Usage
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpsnmpd-Description"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Usage">Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>The <code>ntpsnmpd</code> utility program provides an SNMP MIB agent for <code>ntpd</code>.
+
+<div class="node">
+<p><hr>
+<a name="Usage"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsnmpd-Description">ntpsnmpd Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Usage</h3>
+
+<p>(what should we say here?)
+
+</body></html>
+
diff --git a/ntpsnmpd/ntpsnmpd.man.in b/ntpsnmpd/ntpsnmpd.man.in
new file mode 100644
index 0000000..af9bafa
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.man.in
@@ -0,0 +1,203 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpsnmpd @NTPSNMPD_MS@ "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ELai0P/ag-QLaaZP)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:21 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsnmpd-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpsnmpd\fP
+\- NTP SNMP MIB agent
+.SH SYNOPSIS
+\f\*[B-Font]ntpsnmpd\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpsnmpd\fP
+is an SNMP MIB agent designed to interface with
+\fCntpd\fR(@NTPD_MS@)\f[].
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-nofork\f[]
+Do not fork.
+.sp
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-syslog\f[]
+Log to syslog().
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-agentxsocket\f[]=\f\*[I-Font]string\f[]
+The socket address ntpsnmpd uses to connect to net-snmpd.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ unix:/var/agentx/master
+.sp
+[<transport-specifier>:]<transport-address>
+The default "agent X socket" is the Unix Domain socket
+\fIunix:/var/agentx/master\fP.
+Another common alternative is \fItcp:localhost:705\fP.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPSNMPD_<option-name>\fP or \fBNTPSNMPD\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+\f\*[B-Font]ntpsnmpd\fP
+currently uses a private MIB OID,
+\[oq]enterprises.5597\[cq],
+which is the Meinberg top level OEM OID, and
+\[oq]99\[cq]
+is the temporary working space for this project.
+The final OID has to be registered with IANA
+and this is done by the RFC Editor
+when the NTPv4 MIB RFC is standardized.
+.sp \n(Ppu
+.ne 2
+
+If you have
+\fCsnmpwalk\fR(1)\f[]
+installed you can run
+.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99
+to see a list of all currently supported NTP MIB objects
+and their current values.
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Heiko Gerstung"
+.br
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+The following objects are currently supported:
+.sp \n(Ppu
+.ne 2
+
+.TP 29
+.NOP \f[C]ntpEntSoftwareName\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSoftwareVersion\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSoftwareVersionVal\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSoftwareVendor\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntSystemType\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimeResolution\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimeResolutionVal\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimePrecision\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimePrecisionVal\f[]
+please fill me in...
+.br
+.ns
+.TP 29
+.NOP \f[C]ntpEntTimeDistance\f[]
+please fill me in...
+.PP
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntpsnmpd\fP
+option definitions.
diff --git a/ntpsnmpd/ntpsnmpd.mdoc.in b/ntpsnmpd/ntpsnmpd.mdoc.in
new file mode 100644
index 0000000..594c7e3
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.mdoc.in
@@ -0,0 +1,144 @@
+.Dd December 2 2014
+.Dt NTPSNMPD @NTPSNMPD_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:27 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsnmpd-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpsnmpd
+.Nd NTP SNMP MIB agent
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+is an SNMP MIB agent designed to interface with
+.Xr ntpd @NTPD_MS@ .
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n , Fl \-nofork
+Do not fork.
+.sp
+.It Fl p , Fl \-syslog
+Log to syslog().
+.sp
+.It Fl \-agentxsocket Ns = Ns Ar string
+The socket address ntpsnmpd uses to connect to net\-snmpd.
+The default
+.Ar string
+for this option is:
+.ti +4
+ unix:/var/agentx/master
+.sp
+[<transport\-specifier>:]<transport\-address>
+The default "agent X socket" is the Unix Domain socket
+\fIunix:/var/agentx/master\fP.
+Another common alternative is \fItcp:localhost:705\fP.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTPSNMPD_<option\-name>\fP or \fBNTPSNMPD\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+.Nm
+currently uses a private MIB OID,
+.Ql enterprises.5597 ,
+which is the Meinberg top level OEM OID, and
+.Ql 99
+is the temporary working space for this project.
+The final OID has to be registered with IANA
+and this is done by the RFC Editor
+when the NTPv4 MIB RFC is standardized.
+.Pp
+If you have
+.Xr snmpwalk 1
+installed you can run
+.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99
+to see a list of all currently supported NTP MIB objects
+and their current values.
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Heiko Gerstung"
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+The following objects are currently supported:
+.Pp
+.Bl -tag -width ".Li ntpEntSoftwareVersionVal" -compact -offset indent
+.It Li ntpEntSoftwareName
+please fill me in...
+.It Li ntpEntSoftwareVersion
+please fill me in...
+.It Li ntpEntSoftwareVersionVal
+please fill me in...
+.It Li ntpEntSoftwareVendor
+please fill me in...
+.It Li ntpEntSystemType
+please fill me in...
+.It Li ntpEntTimeResolution
+please fill me in...
+.It Li ntpEntTimeResolutionVal
+please fill me in...
+.It Li ntpEntTimePrecision
+please fill me in...
+.It Li ntpEntTimePrecisionVal
+please fill me in...
+.It Li ntpEntTimeDistance
+please fill me in...
+.El
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntpsnmpd\fP
+option definitions.
diff --git a/ntpsnmpd/ntpsnmpd.texi b/ntpsnmpd/ntpsnmpd.texi
new file mode 100644
index 0000000..6935596
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.texi
@@ -0,0 +1,53 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntpsnmpd.info
+@settitle ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of the NTP Project's ntpsnmpd, a program for
+querying the state of an NTP server via SNMP.
+@end ifinfo
+
+@direntry
+* ntpsnmpd: (ntpsnmpd). NTP SNMP Daemon program
+@end direntry
+
+@titlepage
+@title ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual
+@subtitle ntpsnmpd, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@shortcontents
+
+@node Top, ntpsnmpd Description, (dir), (dir)
+@top ntpsnmpd: Network Time Protocol Query User Manual
+
+The @code{ntpsnmpd} utility program is used to monitor NTP daemon @code{ntpd}
+operations and determine performance. It uses the standard NTP mode 6 control
+
+This document applies to version @value{VERSION} of @code{ntpsnmpd}.
+
+@menu
+* ntpsnmpd Description:: Description
+* ntpsnmpd Invocation:: Invoking ntpsnmpd
+* Usage:: Usage
+@end menu
+
+@node ntpsnmpd Description, Usage, Top, Top
+@comment node-name, next, previous, up
+@section Description
+
+The @code{ntpsnmpd} utility program provides an SNMP MIB agent for @code{ntpd}.
+
+@node Usage, , ntpsnmpd Description, Top
+@comment node-name, next, previous, up
+@section Usage
+
+(what should we say here?)
diff --git a/ntpsnmpd/ntpv4-mib.mib b/ntpsnmpd/ntpv4-mib.mib
new file mode 100644
index 0000000..e8cb016
--- /dev/null
+++ b/ntpsnmpd/ntpv4-mib.mib
@@ -0,0 +1,892 @@
+-- *********************************************************************
+--
+-- The Network Time Protocol Version 4
+-- Management Information Base (MIB)
+--
+-- Authors: Heiko Gerstung (heiko.gerstung@meinberg.de)
+-- Chris Elliott (chelliot@pobox.com)
+--
+-- for the Internet Engineering Task Force (IETF)
+-- NTP Working Group (ntpwg)
+--
+--
+-- *********************************************************************
+-- Rev 1.00
+-- Published as RFC 5907
+--
+-- *********************************************************************
+
+NTPv4-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE , mib-2, Integer32, NOTIFICATION-TYPE,
+ Unsigned32, Counter32, TimeTicks
+ FROM SNMPv2-SMI -- RFC 2578
+ MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
+ FROM SNMPv2-CONF -- RFC 2580
+ DisplayString, TEXTUAL-CONVENTION
+ FROM SNMPv2-TC -- RFC 2579
+ InetAddressType, InetAddress
+ FROM INET-ADDRESS-MIB -- RFC 4001
+ Utf8String
+ FROM SYSAPPL-MIB; -- RFC 2287
+
+ntpSnmpMIB MODULE-IDENTITY
+ LAST-UPDATED "201005170000Z" -- May 17, 2010
+ ORGANIZATION "The IETF NTP Working Group (ntpwg)"
+ CONTACT-INFO
+ " WG Email: ntpwg@lists.ntp.isc.org
+ Subscribe:
+ https://lists.ntp.isc.org/mailman/listinfo/ntpwg
+
+ Heiko Gerstung
+ Meinberg Funkuhren Gmbh & Co. KG
+ Lange Wand 9
+ Bad Pyrmont 31812
+ Germany
+
+ Phone: +49 5281 9309 25
+ Email: heiko.gerstung@meinberg.de
+
+ Chris Elliott
+ 1516 Kent St.
+ Durham, NC 27707
+ USA
+
+ Phone: +1-919-308-1216
+ Email: chelliot@pobox.com
+
+ Brian Haberman
+ 11100 Johns Hopkins Road
+ Laurel, MD 20723
+ USA
+
+ Phone: +1-443-778-1319
+ Email: brian@innovationslab.net"
+ DESCRIPTION
+ "The Management Information Base for NTP time entities.
+
+ Copyright (c) 2010 IETF Trust and the persons identified as
+ authors of the code. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, is permitted pursuant to, and subject
+ to the license terms contained in, the Simplified BSD License
+ set forth in Section 4.c of the IETF Trust's Legal Provisions
+ Relating to IETF Documents
+ (http://trustee.ietf.org/license-info)."
+
+ REVISION "201005170000Z"
+ DESCRIPTION
+ "This revision of the MIB module is published as RFC 5907."
+
+ ::= { mib-2 197 }
+
+ntpSnmpMIBObjects OBJECT IDENTIFIER ::= { ntpSnmpMIB 1 }
+
+-- MIB contains 6 groups
+
+ntpEntInfo OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 1 }
+ntpEntStatus OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 2 }
+ntpAssociation OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 3 }
+ntpEntControl OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 4 }
+ntpEntNotifObjects OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 5 }
+
+--
+-- Textual Conventions
+--
+
+NtpStratum ::= TEXTUAL-CONVENTION
+ DISPLAY-HINT "d"
+ STATUS current
+ DESCRIPTION
+ "The NTP stratum, with 16 representing no stratum."
+ SYNTAX Unsigned32 (1..16)
+
+NtpDateTime ::= TEXTUAL-CONVENTION
+ DISPLAY-HINT "4d:4d:4d.4d"
+ STATUS current
+ DESCRIPTION
+ "NTP date/time on the device, in 128-bit
+ NTP date format. If time is not syncronized, this
+ field shall be a zero-length string.
+
+ This trusted certificate (TC) is not to be used for objects
+ that are used to set the time of the node querying this
+ object. NTP should be used for this -- or at least SNTP."
+ REFERENCE "RFC 5905, section 6"
+ SYNTAX OCTET STRING (SIZE (0 | 16))
+
+--
+-- Section 1: General NTP Entity information objects
+-- (relatively static information)
+--
+
+ntpEntSoftwareName OBJECT-TYPE
+ SYNTAX Utf8String
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The product name of the running NTP version, e.g., 'ntpd'."
+ ::= { ntpEntInfo 1 }
+
+ntpEntSoftwareVersion OBJECT-TYPE
+ SYNTAX Utf8String
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The software version of the installed NTP implementation
+ as a full version string, e.g., 'ntpd-4.2.0b@1.1433 ...'"
+ ::= { ntpEntInfo 2 }
+
+ntpEntSoftwareVendor OBJECT-TYPE
+ SYNTAX Utf8String
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The vendor/author of the installed NTP version."
+ ::= { ntpEntInfo 3 }
+
+ntpEntSystemType OBJECT-TYPE
+ SYNTAX Utf8String
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "General hardware/os platform information,
+ e.g., 'Linux 2.6.12 / x86'."
+ -- freely configurable, default is OS Version / Hardware platform
+ ::= { ntpEntInfo 4 }
+
+ntpEntTimeResolution OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The time resolution in integer format, where the resolution
+ is represented as divisions of a second, e.g., a value of 1000
+ translates to 1.0 ms."
+ ::= { ntpEntInfo 5 }
+
+ntpEntTimePrecision OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The entity's precision in integer format, shows the precision.
+ A value of -5 would mean 2^-5 = 31.25 ms."
+ ::= { ntpEntInfo 6 }
+
+ntpEntTimeDistance OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The distance from this NTP entity to the root time reference
+ (stratum 0) source including the unit, e.g., '13.243 ms'."
+ ::= { ntpEntInfo 7 }
+
+--
+-- Section 2: Current NTP status (dynamic information)
+--
+
+ntpEntStatusCurrentMode OBJECT-TYPE
+ SYNTAX INTEGER {
+ notRunning(1),
+ notSynchronized(2),
+ noneConfigured(3),
+ syncToLocal(4),
+ syncToRefclock(5),
+ syncToRemoteServer(6),
+ unknown(99)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The current mode of the NTP. The definition of each possible
+ value is:
+ notRunning(1) - NTP is not running.
+ notSynchronized(2) - NTP is not synchronized to any time
+ source (stratum = 16).
+ noneConfigured(3) - NTP is not synchronized and does not
+ have a reference configured
+ (stratum = 16).
+ syncToLocal(4) - NTP is distributing time based on its
+ local clock (degraded accuracy and/or
+ reliability).
+ syncToRefclock(5) - NTP is synchronized to a local
+ hardware refclock (e.g., GPS).
+ syncToRemoteServer(6) - NTP is synchronized to a remote
+ NTP server ('upstream' server).
+ unknown(99) - The state of NTP is unknown."
+ ::= { ntpEntStatus 1 }
+
+ntpEntStatusStratum OBJECT-TYPE
+ SYNTAX NtpStratum
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The NTP entity's own stratum value. Should be a stratum of
+ syspeer + 1 (or 16 if no syspeer)."
+ ::= { ntpEntStatus 2 }
+
+ntpEntStatusActiveRefSourceId OBJECT-TYPE
+ SYNTAX Unsigned32 ( 0..99999 )
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The association ID of the current syspeer."
+ ::= { ntpEntStatus 3 }
+
+ntpEntStatusActiveRefSourceName OBJECT-TYPE
+ SYNTAX Utf8String
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The hostname/descriptive name of the current reference source
+ selected as syspeer, e.g., 'ntp1.ptb.de' or 'GPS' or
+ 'DCFi', ..."
+ ::= { ntpEntStatus 4 }
+
+ntpEntStatusActiveOffset OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The time offset to the current selected reference time source
+ as a string including unit, e.g., '0.032 ms' or '1.232 s'."
+ ::= { ntpEntStatus 5 }
+
+ntpEntStatusNumberOfRefSources OBJECT-TYPE
+ SYNTAX Unsigned32 (0..99)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of reference sources configured for NTP."
+ ::= { ntpEntStatus 6 }
+
+ntpEntStatusDispersion OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The root dispersion of the running NTP entity, e.g., '6.927'."
+ ::= { ntpEntStatus 7 }
+
+ntpEntStatusEntityUptime OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The uptime of the NTP entity, (i.e., the time since ntpd was
+ (re-)initialized not sysUptime!). The time is represented in
+ hundreds of seconds since Jan 1, 1970 (00:00:00.000) UTC."
+ ::= { ntpEntStatus 8 }
+
+ntpEntStatusDateTime OBJECT-TYPE
+ SYNTAX NtpDateTime
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The current NTP date/time on the device, in 128-bit
+ NTP date format. If time is not syncronized, this
+ field shall be a zero-length string.
+
+ This object can be used to timestamp events on this
+ node and allow a management station to correlate
+ different time objects. For example, a management
+ station could query this object and sysUpTime in
+ the same operation to be able to relate sysUpTime
+ to NTP time.
+
+ This object is not to be used to set the time of
+ the node querying this object. NTP should be used
+ for this -- or at least SNTP."
+ REFERENCE "RFC 5905, section 6"
+ ::= { ntpEntStatus 9 }
+
+ntpEntStatusLeapSecond OBJECT-TYPE
+ SYNTAX NtpDateTime
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Date the next known leap second will occur. If there is
+ no leap second announced, then this object should be 0."
+ ::= { ntpEntStatus 10 }
+
+ntpEntStatusLeapSecDirection OBJECT-TYPE
+ SYNTAX Integer32 (-1..1)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Direction of next known leap second. If there is no
+ leap second announced, then this object should be 0."
+ ::= { ntpEntStatus 11 }
+
+ntpEntStatusInPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of NTP messages delivered to the
+ NTP entity from the transport service.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpEntStatus 12 }
+
+ntpEntStatusOutPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of NTP messages delivered to the
+ transport service by this NTP entity.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpEntStatus 13 }
+
+ntpEntStatusBadVersion OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of NTP messages that were delivered
+ to this NTP entity and were for an unsupported NTP
+ version.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpEntStatus 14 }
+
+ntpEntStatusProtocolError OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of NTP messages that were delivered
+ to this NTP entity and this entity was not able to
+ process due to an NTP protocol error.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpEntStatus 15 }
+
+ntpEntStatusNotifications OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "notifications"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of SNMP notifications that this NTP
+ entity has generated.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpEntStatus 16 }
+
+ntpEntStatPktModeTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NtpEntStatPktModeEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The number of packets sent and received by packet mode.
+ One entry per packet mode."
+ ::= { ntpEntStatus 17 }
+
+ntpEntStatPktModeEntry OBJECT-TYPE
+ SYNTAX NtpEntStatPktModeEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A statistical record of the number of packets sent and
+ received for each packet mode."
+ INDEX { ntpEntStatPktMode }
+ ::= { ntpEntStatPktModeTable 1 }
+
+NtpEntStatPktModeEntry ::= SEQUENCE {
+ ntpEntStatPktMode INTEGER,
+ ntpEntStatPktSent Counter32,
+ ntpEntStatPktReceived Counter32
+}
+
+ntpEntStatPktMode OBJECT-TYPE
+ SYNTAX INTEGER {
+ symetricactive(1),
+ symetricpassive(2),
+ client(3),
+ server(4),
+ broadcastserver(5),
+ broadcastclient(6)
+ }
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The NTP packet mode."
+ ::= { ntpEntStatPktModeEntry 1 }
+
+ntpEntStatPktSent OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of NTP packets sent with this packet mode.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpEntStatPktModeEntry 2 }
+
+ntpEntStatPktReceived OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of NTP packets received with this packet mode.
+
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpEntStatPktModeEntry 3 }
+
+--
+-- Section 3: The status of all currently mobilized associations
+--
+
+ntpAssociationTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NtpAssociationEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The table of currently mobilized associations."
+ ::= { ntpAssociation 1 }
+
+ntpAssociationEntry OBJECT-TYPE
+ SYNTAX NtpAssociationEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The table entry of currently mobilized associations."
+ INDEX { ntpAssocId }
+ ::= { ntpAssociationTable 1 }
+
+NtpAssociationEntry ::= SEQUENCE {
+ ntpAssocId Unsigned32,
+ ntpAssocName Utf8String,
+ ntpAssocRefId DisplayString,
+ ntpAssocAddressType InetAddressType,
+ ntpAssocAddress InetAddress,
+ ntpAssocOffset DisplayString,
+ ntpAssocStratum NtpStratum,
+ ntpAssocStatusJitter DisplayString,
+ ntpAssocStatusDelay DisplayString,
+ ntpAssocStatusDispersion DisplayString
+}
+
+ntpAssocId OBJECT-TYPE
+ SYNTAX Unsigned32 ( 1..99999 )
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The association ID. This is an internal, unique ID."
+ ::= { ntpAssociationEntry 1 }
+
+ntpAssocName OBJECT-TYPE
+ SYNTAX Utf8String
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The hostname or other descriptive name for the association."
+ ::= { ntpAssociationEntry 2 }
+
+ntpAssocRefId OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The refclock driver ID, if available."
+ -- a refclock driver ID like "127.127.1.0" for non
+ -- uni/multi/broadcast associations
+ ::= { ntpAssociationEntry 3 }
+
+ntpAssocAddressType OBJECT-TYPE
+ SYNTAX InetAddressType { ipv4(1), ipv6(2), ipv4z(3), ipv6z(4) }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The type of address of the association. Can be either IPv4 or
+ IPv6 (both with or without zone index) and contains the type of
+ address for unicast, multicast, and broadcast associations."
+ ::= { ntpAssociationEntry 4 }
+
+ntpAssocAddress OBJECT-TYPE
+ SYNTAX InetAddress (SIZE (4|8|16|20))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The IP address (IPv4 or IPv6, with or without zone index) of
+ the association. The type and size depends on the
+ ntpAssocAddressType object. Represents the IP address of a
+ uni/multi/broadcast association."
+ ::= { ntpAssociationEntry 5 }
+
+ntpAssocOffset OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The time offset to the association as a string."
+ -- including unit, e.g., "0.032 ms" or "1.232 s"
+ ::= { ntpAssociationEntry 6 }
+
+ntpAssocStratum OBJECT-TYPE
+ SYNTAX NtpStratum
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The association stratum value."
+ ::= { ntpAssociationEntry 7 }
+
+ntpAssocStatusJitter OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The jitter in milliseconds as a string."
+ ::= { ntpAssociationEntry 8 }
+
+ntpAssocStatusDelay OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The network delay in milliseconds as a string."
+ ::= { ntpAssociationEntry 9 }
+
+ntpAssocStatusDispersion OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The root dispersion of the association."
+ -- e.g., "6.927"
+ ::= { ntpAssociationEntry 10 }
+
+ntpAssociationStatisticsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF NtpAssociationStatisticsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The table of statistics for current associations."
+ ::= { ntpAssociation 2 }
+
+ntpAssociationStatisticsEntry OBJECT-TYPE
+ SYNTAX NtpAssociationStatisticsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The table entry of statistics for current associations."
+ INDEX { ntpAssocId }
+ ::= { ntpAssociationStatisticsTable 1 }
+
+NtpAssociationStatisticsEntry ::= SEQUENCE {
+ ntpAssocStatInPkts Counter32,
+ ntpAssocStatOutPkts Counter32,
+ ntpAssocStatProtocolError Counter32
+}
+
+ntpAssocStatInPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of NTP messages delivered to the
+ NTP entity from this association.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpAssociationStatisticsEntry 1 }
+
+ntpAssocStatOutPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of NTP messages delivered to the
+ transport service by this NTP entity for this
+ association.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpAssociationStatisticsEntry 2 }
+
+ntpAssocStatProtocolError OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of NTP messages that were delivered
+ to this NTP entity from this association and this entity
+ was not able to process due to an NTP protocol error.
+ Discountinuities in the value of this counter can occur
+ upon cold start or reinitialization of the NTP entity, the
+ management system and at other times as indicated by
+ discontinuities in the value of sysUpTime."
+ ::= { ntpAssociationStatisticsEntry 3 }
+
+--
+-- Section 4: Control objects
+--
+
+ntpEntHeartbeatInterval OBJECT-TYPE
+ SYNTAX Unsigned32
+ UNITS "seconds"
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The interval at which the ntpEntNotifHeartbeat notification
+ should be sent, in seconds. If set to 0 and the
+ entNotifHeartbeat bit in ntpEntNotifBits is 1, then
+ ntpEntNotifHeartbeat is sent once.
+ This value is stored persistently and will be restored to its
+ last set value upon cold start or restart."
+ DEFVAL { 60 }
+ ::= { ntpEntControl 1 }
+
+ntpEntNotifBits OBJECT-TYPE
+ SYNTAX BITS {
+ notUsed(0), -- Used to sync up bit and notification
+ -- indices
+ entNotifModeChange(1),
+ entNotifStratumChange(2),
+ entNotifSyspeerChanged(3),
+ entNotifAddAssociation(4),
+ entNotifRemoveAssociation(5),
+ entNotifConfigChanged(6),
+ entNotifLeapSecondAnnounced(7),
+ entNotifHeartbeat(8)
+ }
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "A bit for each notification. A 1 for a particular bit enables
+ that particular notification, a 0 disables it.
+ This value is stored persistently and will be restored to its
+ last set value upon cold start or restart."
+ ::= { ntpEntControl 2 }
+
+--
+-- Section 5: Notification objects
+--
+
+ntpEntNotifMessage OBJECT-TYPE
+ SYNTAX Utf8String
+ MAX-ACCESS accessible-for-notify
+ STATUS current
+ DESCRIPTION
+ "Used as a payload object for all notifications. Holds a
+ cleartext event message."
+ DEFVAL { "no event" }
+ ::= { ntpEntNotifObjects 1 }
+
+--
+-- SNMP notification definitions
+--
+
+ntpEntNotifications OBJECT IDENTIFIER ::= { ntpSnmpMIB 0 }
+
+ntpEntNotifModeChange NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusCurrentMode }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent when the NTP entity changes mode,
+ including starting and stopping (if possible)."
+ ::= { ntpEntNotifications 1 }
+
+ntpEntNotifStratumChange NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusDateTime, ntpEntStatusStratum,
+ ntpEntNotifMessage }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent when stratum level of NTP changes."
+ ::= { ntpEntNotifications 2 }
+
+ntpEntNotifSyspeerChanged NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusDateTime, ntpEntStatusActiveRefSourceId,
+ ntpEntNotifMessage }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent when a (new) syspeer has been
+ selected."
+ ::= { ntpEntNotifications 3 }
+
+ntpEntNotifAddAssociation NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusDateTime, ntpAssocName, ntpEntNotifMessage }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent when a new association is
+ mobilized."
+ ::= { ntpEntNotifications 4 }
+
+ntpEntNotifRemoveAssociation NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusDateTime, ntpAssocName, ntpEntNotifMessage }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent when an association is
+ demobilized."
+ ::= { ntpEntNotifications 5 }
+
+ntpEntNotifConfigChanged NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusDateTime, ntpEntNotifMessage }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent when the NTP configuration has
+ changed, e.g., when the system connected to the Internet and
+ was assigned a new IP address by the ISPs DHCP server."
+ ::= { ntpEntNotifications 6 }
+
+ntpEntNotifLeapSecondAnnounced NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusDateTime, ntpEntNotifMessage }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent when a leap second has been
+ announced."
+ ::= { ntpEntNotifications 7 }
+
+ntpEntNotifHeartbeat NOTIFICATION-TYPE
+ OBJECTS { ntpEntStatusDateTime, ntpEntStatusCurrentMode,
+ ntpEntHeartbeatInterval, ntpEntNotifMessage }
+ STATUS current
+ DESCRIPTION
+ "The notification to be sent periodically (as defined by
+ ntpEntHeartbeatInterval) to indicate that the NTP entity is
+ still alive."
+ ::= { ntpEntNotifications 8 }
+
+--
+-- Conformance/Compliance statements
+--
+
+ntpEntConformance OBJECT IDENTIFIER ::= { ntpSnmpMIB 2 }
+
+ntpEntCompliances OBJECT IDENTIFIER ::= { ntpEntConformance 1 }
+ntpEntGroups OBJECT IDENTIFIER ::= { ntpEntConformance 2 }
+
+ntpEntNTPCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION
+ "The compliance statement for SNMP entities that use NTP and
+ implement the NTP MIB."
+ MODULE -- this module
+ MANDATORY-GROUPS {
+ ntpEntObjectsGroup1
+ }
+ ::= { ntpEntCompliances 1 }
+
+ntpEntSNTPCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION
+ "The compliance statement for SNMP entities that use SNTP and
+ implement the NTP MIB."
+ MODULE -- this module
+ MANDATORY-GROUPS {
+ ntpEntObjectsGroup1
+ }
+ GROUP ntpEntObjectsGroup2
+ DESCRIPTION
+ "Optional object group."
+ GROUP ntpEntNotifGroup
+ DESCRIPTION
+ "Optional notifications for this MIB."
+ ::= { ntpEntCompliances 2 }
+
+ntpEntObjectsGroup1 OBJECT-GROUP
+ OBJECTS {
+ ntpEntSoftwareName,
+ ntpEntSoftwareVersion,
+ ntpEntSoftwareVendor,
+ ntpEntSystemType,
+ ntpEntStatusEntityUptime,
+ ntpEntStatusDateTime,
+ ntpAssocName,
+ ntpAssocRefId,
+ ntpAssocAddressType,
+ ntpAssocAddress
+ }
+ STATUS current
+ DESCRIPTION
+ "A collection of objects for the NTP MIB."
+ ::= { ntpEntGroups 1 }
+
+ntpEntObjectsGroup2 OBJECT-GROUP
+ OBJECTS {
+ ntpEntTimeResolution,
+ ntpEntTimePrecision,
+ ntpEntTimeDistance,
+ ntpEntStatusCurrentMode,
+ ntpEntStatusStratum,
+ ntpEntStatusActiveRefSourceId,
+ ntpEntStatusActiveRefSourceName,
+ ntpEntStatusActiveOffset,
+ ntpEntStatusNumberOfRefSources,
+ ntpEntStatusDispersion,
+ ntpEntStatusLeapSecond,
+ ntpEntStatusLeapSecDirection,
+ ntpEntStatusInPkts,
+ ntpEntStatusOutPkts,
+ ntpEntStatusBadVersion,
+ ntpEntStatusProtocolError,
+ ntpEntStatusNotifications,
+ ntpEntStatPktSent,
+ ntpEntStatPktReceived,
+ ntpAssocOffset,
+ ntpAssocStratum,
+ ntpAssocStatusJitter,
+ ntpAssocStatusDelay,
+ ntpAssocStatusDispersion,
+ ntpAssocStatInPkts,
+ ntpAssocStatOutPkts,
+ ntpAssocStatProtocolError,
+ ntpEntHeartbeatInterval,
+ ntpEntNotifBits,
+ ntpEntNotifMessage
+ }
+ STATUS current
+ DESCRIPTION
+ "A collection of objects for the NTP MIB."
+ ::= { ntpEntGroups 2 }
+
+ntpEntNotifGroup NOTIFICATION-GROUP
+ NOTIFICATIONS {
+ ntpEntNotifModeChange,
+ ntpEntNotifStratumChange,
+ ntpEntNotifSyspeerChanged,
+ ntpEntNotifAddAssociation,
+ ntpEntNotifRemoveAssociation,
+ ntpEntNotifConfigChanged,
+ ntpEntNotifLeapSecondAnnounced,
+ ntpEntNotifHeartbeat
+ }
+ STATUS current
+ DESCRIPTION
+ "A collection of notifications for the NTP MIB"
+ ::= { ntpEntGroups 3 }
+
+END
diff --git a/packageinfo.sh b/packageinfo.sh
new file mode 100644
index 0000000..6963a20
--- /dev/null
+++ b/packageinfo.sh
@@ -0,0 +1,107 @@
+#
+# packageinfo.sh - set shell variables with version components
+#
+# This file is sourced by other scripts and does not need execute
+# permission or the #! shell selector.
+#
+# Most changes to this file are fully or semi-automated using the
+# UpdatePoint script on the ntp.org tarball build machine. Changes
+# required by the typical ntp.org release sequences are below.
+#
+## DEV:
+#
+# To bump the -dev point (p) number, UpdatePoint needs no changes here.
+#
+# To start a -RC cycle in -dev leading to the next -stable release,
+# set prerelease=rc.
+#
+# To move from dev -RC to new -stable and -dev major/minor version, set
+# minor and/or major to the new version, repotype to match the new
+# minor version, empty prerelease, and set point=NEW. UpdatePoint
+# will empty point and rcpoint, and set betapoint=0.
+#
+## STABLE:
+#
+# To start a -stable beta cycle, which normally occurs before a -stable
+# -RC1 during the runup to a -stable point release, UpdatePoint needs
+# no changes here. Both betapoint and point will be incremented, and
+# prerelease will be set to beta.
+#
+# To move on from -stable beta to RC set prerelease=rc.
+#
+# To fall back from -stable RC to beta set prerelease=beta.
+#
+# To skip over -stable beta1 directly to -RC1, set prerelease=rc.
+#
+# To skip all -stable prereleases and move from one primary or point
+# release directly to the next point release, set rcpoint=GO.
+#
+##
+#
+# To see what UpdatePoint will do without modifying packageinfo.sh as it
+# does by default, use the -t/--test option before the repo type:
+#
+# shell# scripts/UpdatePoint -t stable
+#
+
+# repotype must be stable or dev
+repotype=dev
+
+# post-4.2.8:
+# version=Major.Minor
+# 4.2.8 and before:
+# version=Protocol.Major.Minor
+# odd minor numbers are for -dev, even minor numbers are for -stable
+# UpdatePoint will fail if repotype is inconsistent with minor.
+proto=4
+major=2
+minor=7
+
+case "${proto}.${major}" in
+ 4.[012])
+ version=${proto}.${major}.${minor}
+ ;;
+ *) version=${major}.${minor}
+ ;;
+esac
+
+# Special. Normally unused. A suffix.
+#special=ag
+special=
+
+# prerelease can be empty, 'beta', or 'rc'.
+prerelease=
+
+# ChangeLog starting tag (see also CommitLog-4.1.0)
+CLTAG=NTP_4_2_0
+
+### post-4.2.8:
+### Point number, after "major.minor.", normally modified by script.
+### 4.2.8 and before:
+### Point number, after "p", normally modified by script.
+# 3 cases:
+# - Numeric values increment
+# - empty 'increments' to 1
+# - NEW 'increments' to empty
+point=482
+
+### betapoint is normally modified by script.
+# ntp-stable Beta number (betapoint)
+# Should be zeroed at release, and left at zero until first beta.
+# The first beta is -beta1.
+# betapoint is always zero in ntp-dev.
+betapoint=0
+
+### rcpoint is normally modified by script except for GO.
+# RC number (rcpoint)
+# for ntp-dev, always empty as RC numbers are not used, nor is GO.
+# For ntp-stable:
+# if prerelease is 'rc':
+# - Numeric values increment
+# - GO triggers a release
+# - - rcpoint is emptied
+# - - betapoint is set to 0
+# - - prerelease is emptied
+# else (not in RC)
+# - rcpoint is empty and unused (for now).
+rcpoint=
diff --git a/parseutil/Makefile.am b/parseutil/Makefile.am
new file mode 100644
index 0000000..99fb3d1
--- /dev/null
+++ b/parseutil/Makefile.am
@@ -0,0 +1,24 @@
+NULL=
+
+BUILT_SOURCES =
+CLEANFILES =
+noinst_PROGRAMS = @TESTDCF@ @DCFD@
+EXTRA_PROGRAMS = testdcf dcfd
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
+
+ETAGS_ARGS = Makefile.am
+DISTCLEANFILES = $(EXTRA_PROGRAMS)
+
+check-local: @DCFD@
+ case "$(noinst_PROGRAMS)" in \
+ *dcfd*) ./dcfd -Y ;; \
+ esac
+
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/parseutil/Makefile.in b/parseutil/Makefile.in
new file mode 100644
index 0000000..963fd08
--- /dev/null
+++ b/parseutil/Makefile.in
@@ -0,0 +1,752 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = testdcf$(EXEEXT) dcfd$(EXEEXT)
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf
+subdir = parseutil
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+dcfd_SOURCES = dcfd.c
+dcfd_OBJECTS = dcfd.$(OBJEXT)
+dcfd_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+dcfd_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+testdcf_SOURCES = testdcf.c
+testdcf_OBJECTS = testdcf.$(OBJEXT)
+testdcf_LDADD = $(LDADD)
+testdcf_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = dcfd.c testdcf.c
+DIST_SOURCES = dcfd.c testdcf.c
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 = .deps-ver
+CLEANFILES = .deps-ver
+noinst_PROGRAMS = @TESTDCF@ @DCFD@
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(CPPFLAGS_NTP)
+LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
+ETAGS_ARGS = Makefile.am
+DISTCLEANFILES = $(EXTRA_PROGRAMS)
+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 .o .obj
+$(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 parseutil/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign parseutil/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+dcfd$(EXEEXT): $(dcfd_OBJECTS) $(dcfd_DEPENDENCIES)
+ @rm -f dcfd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(dcfd_OBJECTS) $(dcfd_LDADD) $(LIBS)
+testdcf$(EXEEXT): $(testdcf_OBJECTS) $(testdcf_DEPENDENCIES)
+ @rm -f testdcf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(testdcf_OBJECTS) $(testdcf_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dcfd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdcf.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: all check check-am install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+ clean-generic clean-libtool clean-noinstPROGRAMS ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+check-local: @DCFD@
+ case "$(noinst_PROGRAMS)" in \
+ *dcfd*) ./dcfd -Y ;; \
+ esac
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/parseutil/README b/parseutil/README
new file mode 100644
index 0000000..8bc5140
--- /dev/null
+++ b/parseutil/README
@@ -0,0 +1,16 @@
+This directory contains some DCF77 related programs.
+They have not yet fully been ported to architectures other than Sun with
+SunOS 4.x. So if you want to try them you are on your own - a little
+porting may be necessary.
+
+parsetest: simple parse streams module test
+ Works only under SunOS with parse Streams Module loaded
+ and Meinberg-Clocks
+
+testdcf: simple DCF77 raw impulse test program via 50Baud RS232
+
+dcfd: simple DCF77 raw impulse receiver with NTP loopfilter
+ mechanics for synchronisation (allows DCF77 synchronisation
+ without network code in a nutshell)
+
+Frank Kardel
diff --git a/parseutil/dcfd.c b/parseutil/dcfd.c
new file mode 100644
index 0000000..0db94c0
--- /dev/null
+++ b/parseutil/dcfd.c
@@ -0,0 +1,1872 @@
+/*
+ * /src/NTP/REPOSITORY/ntp4-dev/parseutil/dcfd.c,v 4.18 2005/10/07 22:08:18 kardel RELEASE_20051008_A
+ *
+ * dcfd.c,v 4.18 2005/10/07 22:08:18 kardel RELEASE_20051008_A
+ *
+ * DCF77 100/200ms pulse synchronisation daemon program (via 50Baud serial line)
+ *
+ * Features:
+ * DCF77 decoding
+ * simple NTP loopfilter logic for local clock
+ * interactive display for debugging
+ *
+ * Lacks:
+ * Leap second handling (at that level you should switch to NTP Version 4 - really!)
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <signal.h>
+#include <syslog.h>
+#include <time.h>
+
+/*
+ * NTP compilation environment
+ */
+#include "ntp_stdlib.h"
+#include "ntpd.h" /* indirectly include ntp.h to get YEAR_PIVOT Y2KFixes */
+
+/*
+ * select which terminal handling to use (currently only SysV variants)
+ */
+#if defined(HAVE_TERMIOS_H) || defined(STREAM)
+#include <termios.h>
+#define TTY_GETATTR(_FD_, _ARG_) tcgetattr((_FD_), (_ARG_))
+#define TTY_SETATTR(_FD_, _ARG_) tcsetattr((_FD_), TCSANOW, (_ARG_))
+#else /* not HAVE_TERMIOS_H || STREAM */
+# if defined(HAVE_TERMIO_H) || defined(HAVE_SYSV_TTYS)
+# include <termio.h>
+# define TTY_GETATTR(_FD_, _ARG_) ioctl((_FD_), TCGETA, (_ARG_))
+# define TTY_SETATTR(_FD_, _ARG_) ioctl((_FD_), TCSETAW, (_ARG_))
+# endif/* HAVE_TERMIO_H || HAVE_SYSV_TTYS */
+#endif /* not HAVE_TERMIOS_H || STREAM */
+
+
+#ifndef TTY_GETATTR
+#include "Bletch: MUST DEFINE ONE OF 'HAVE_TERMIOS_H' or 'HAVE_TERMIO_H'"
+#endif
+
+#ifndef days_per_year
+#define days_per_year(_x_) (((_x_) % 4) ? 365 : (((_x_) % 400) ? 365 : 366))
+#endif
+
+#define timernormalize(_a_) \
+ if ((_a_)->tv_usec >= 1000000) \
+ { \
+ (_a_)->tv_sec += (_a_)->tv_usec / 1000000; \
+ (_a_)->tv_usec = (_a_)->tv_usec % 1000000; \
+ } \
+ if ((_a_)->tv_usec < 0) \
+ { \
+ (_a_)->tv_sec -= 1 + (-(_a_)->tv_usec / 1000000); \
+ (_a_)->tv_usec = 999999 - (-(_a_)->tv_usec - 1); \
+ }
+
+#ifdef timeradd
+#undef timeradd
+#endif
+#define timeradd(_a_, _b_) \
+ (_a_)->tv_sec += (_b_)->tv_sec; \
+ (_a_)->tv_usec += (_b_)->tv_usec; \
+ timernormalize((_a_))
+
+#ifdef timersub
+#undef timersub
+#endif
+#define timersub(_a_, _b_) \
+ (_a_)->tv_sec -= (_b_)->tv_sec; \
+ (_a_)->tv_usec -= (_b_)->tv_usec; \
+ timernormalize((_a_))
+
+/*
+ * debug macros
+ */
+#define PRINTF if (interactive) printf
+#define LPRINTF if (interactive && loop_filter_debug) printf
+
+#ifdef DEBUG
+#define dprintf(_x_) LPRINTF _x_
+#else
+#define dprintf(_x_)
+#endif
+
+#ifdef DECL_ERRNO
+ extern int errno;
+#endif
+
+static char *revision = "4.18";
+
+/*
+ * display received data (avoids also detaching from tty)
+ */
+static int interactive = 0;
+
+/*
+ * display loopfilter (clock control) variables
+ */
+static int loop_filter_debug = 0;
+
+/*
+ * do not set/adjust system time
+ */
+static int no_set = 0;
+
+/*
+ * time that passes between start of DCF impulse and time stamping (fine
+ * adjustment) in microseconds (receiver/OS dependent)
+ */
+#define DEFAULT_DELAY 230000 /* rough estimate */
+
+/*
+ * The two states we can be in - eithe we receive nothing
+ * usable or we have the correct time
+ */
+#define NO_SYNC 0x01
+#define SYNC 0x02
+
+static int sync_state = NO_SYNC;
+static time_t last_sync;
+
+static unsigned long ticks = 0;
+
+static char pat[] = "-\\|/";
+
+#define LINES (24-2) /* error lines after which the two headlines are repeated */
+
+#define MAX_UNSYNC (10*60) /* allow synchronisation loss for 10 minutes */
+#define NOTICE_INTERVAL (20*60) /* mention missing synchronisation every 20 minutes */
+
+/*
+ * clock adjustment PLL - see NTP protocol spec (RFC1305) for details
+ */
+
+#define USECSCALE 10
+#define TIMECONSTANT 2
+#define ADJINTERVAL 0
+#define FREQ_WEIGHT 18
+#define PHASE_WEIGHT 7
+#define MAX_DRIFT 0x3FFFFFFF
+
+#define R_SHIFT(_X_, _Y_) (((_X_) < 0) ? -(-(_X_) >> (_Y_)) : ((_X_) >> (_Y_)))
+
+static long max_adj_offset_usec = 128000;
+
+static long clock_adjust = 0; /* current adjustment value (usec * 2^USECSCALE) */
+static long accum_drift = 0; /* accumulated drift value (usec / ADJINTERVAL) */
+static long adjustments = 0;
+static char skip_adjust = 1; /* discard first adjustment (bad samples) */
+
+/*
+ * DCF77 state flags
+ */
+#define DCFB_ANNOUNCE 0x0001 /* switch time zone warning (DST switch) */
+#define DCFB_DST 0x0002 /* DST in effect */
+#define DCFB_LEAP 0x0004 /* LEAP warning (1 hour prior to occurrence) */
+#define DCFB_ALTERNATE 0x0008 /* alternate antenna used */
+
+struct clocktime /* clock time broken up from time code */
+{
+ long wday; /* Day of week: 1: Monday - 7: Sunday */
+ long day;
+ long month;
+ long year;
+ long hour;
+ long minute;
+ long second;
+ long usecond;
+ long utcoffset; /* in minutes */
+ long flags; /* current clock status (DCF77 state flags) */
+};
+
+typedef struct clocktime clocktime_t;
+
+/*
+ * (usually) quick constant multiplications
+ */
+#define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1)) /* *8 + *2 */
+#define TIMES24(_X_) (((_X_) << 4) + ((_X_) << 3)) /* *16 + *8 */
+#define TIMES60(_X_) ((((_X_) << 4) - (_X_)) << 2) /* *(16 - 1) *4 */
+/*
+ * generic l_abs() function
+ */
+#define l_abs(_x_) (((_x_) < 0) ? -(_x_) : (_x_))
+
+/*
+ * conversion related return/error codes
+ */
+#define CVT_MASK 0x0000000F /* conversion exit code */
+#define CVT_NONE 0x00000001 /* format not applicable */
+#define CVT_FAIL 0x00000002 /* conversion failed - error code returned */
+#define CVT_OK 0x00000004 /* conversion succeeded */
+#define CVT_BADFMT 0x00000010 /* general format error - (unparsable) */
+#define CVT_BADDATE 0x00000020 /* invalid date */
+#define CVT_BADTIME 0x00000040 /* invalid time */
+
+/*
+ * DCF77 raw time code
+ *
+ * From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig
+ * und Berlin, Maerz 1989
+ *
+ * Timecode transmission:
+ * AM:
+ * time marks are send every second except for the second before the
+ * next minute mark
+ * time marks consist of a reduction of transmitter power to 25%
+ * of the nominal level
+ * the falling edge is the time indication (on time)
+ * time marks of a 100ms duration constitute a logical 0
+ * time marks of a 200ms duration constitute a logical 1
+ * FM:
+ * see the spec. (basically a (non-)inverted psuedo random phase shift)
+ *
+ * Encoding:
+ * Second Contents
+ * 0 - 10 AM: free, FM: 0
+ * 11 - 14 free
+ * 15 R - alternate antenna
+ * 16 A1 - expect zone change (1 hour before)
+ * 17 - 18 Z1,Z2 - time zone
+ * 0 0 illegal
+ * 0 1 MEZ (MET)
+ * 1 0 MESZ (MED, MET DST)
+ * 1 1 illegal
+ * 19 A2 - expect leap insertion/deletion (1 hour before)
+ * 20 S - start of time code (1)
+ * 21 - 24 M1 - BCD (lsb first) Minutes
+ * 25 - 27 M10 - BCD (lsb first) 10 Minutes
+ * 28 P1 - Minute Parity (even)
+ * 29 - 32 H1 - BCD (lsb first) Hours
+ * 33 - 34 H10 - BCD (lsb first) 10 Hours
+ * 35 P2 - Hour Parity (even)
+ * 36 - 39 D1 - BCD (lsb first) Days
+ * 40 - 41 D10 - BCD (lsb first) 10 Days
+ * 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday)
+ * 45 - 49 MO - BCD (lsb first) Month
+ * 50 MO0 - 10 Months
+ * 51 - 53 Y1 - BCD (lsb first) Years
+ * 54 - 57 Y10 - BCD (lsb first) 10 Years
+ * 58 P3 - Date Parity (even)
+ * 59 - usually missing (minute indication), except for leap insertion
+ */
+
+/*-----------------------------------------------------------------------
+ * conversion table to map DCF77 bit stream into data fields.
+ * Encoding:
+ * Each field of the DCF77 code is described with two adjacent entries in
+ * this table. The first entry specifies the offset into the DCF77 data stream
+ * while the length is given as the difference between the start index and
+ * the start index of the following field.
+ */
+static struct rawdcfcode
+{
+ char offset; /* start bit */
+} rawdcfcode[] =
+{
+ { 0 }, { 15 }, { 16 }, { 17 }, { 19 }, { 20 }, { 21 }, { 25 }, { 28 }, { 29 },
+ { 33 }, { 35 }, { 36 }, { 40 }, { 42 }, { 45 }, { 49 }, { 50 }, { 54 }, { 58 }, { 59 }
+};
+
+/*-----------------------------------------------------------------------
+ * symbolic names for the fields of DCF77 describes in "rawdcfcode".
+ * see comment above for the structure of the DCF77 data
+ */
+#define DCF_M 0
+#define DCF_R 1
+#define DCF_A1 2
+#define DCF_Z 3
+#define DCF_A2 4
+#define DCF_S 5
+#define DCF_M1 6
+#define DCF_M10 7
+#define DCF_P1 8
+#define DCF_H1 9
+#define DCF_H10 10
+#define DCF_P2 11
+#define DCF_D1 12
+#define DCF_D10 13
+#define DCF_DW 14
+#define DCF_MO 15
+#define DCF_MO0 16
+#define DCF_Y1 17
+#define DCF_Y10 18
+#define DCF_P3 19
+
+/*-----------------------------------------------------------------------
+ * parity field table (same encoding as rawdcfcode)
+ * This table describes the sections of the DCF77 code that are
+ * parity protected
+ */
+static struct partab
+{
+ char offset; /* start bit of parity field */
+} partab[] =
+{
+ { 21 }, { 29 }, { 36 }, { 59 }
+};
+
+/*-----------------------------------------------------------------------
+ * offsets for parity field descriptions
+ */
+#define DCF_P_P1 0
+#define DCF_P_P2 1
+#define DCF_P_P3 2
+
+/*-----------------------------------------------------------------------
+ * legal values for time zone information
+ */
+#define DCF_Z_MET 0x2
+#define DCF_Z_MED 0x1
+
+/*-----------------------------------------------------------------------
+ * symbolic representation if the DCF77 data stream
+ */
+static struct dcfparam
+{
+ unsigned char onebits[60];
+ unsigned char zerobits[60];
+} dcfparam =
+{
+ "###############RADMLS1248124P124812P1248121241248112481248P", /* 'ONE' representation */
+ "--------------------s-------p------p----------------------p" /* 'ZERO' representation */
+};
+
+/*-----------------------------------------------------------------------
+ * extract a bitfield from DCF77 datastream
+ * All numeric fields are LSB first.
+ * buf holds a pointer to a DCF77 data buffer in symbolic
+ * representation
+ * idx holds the index to the field description in rawdcfcode
+ */
+static unsigned long
+ext_bf(
+ register unsigned char *buf,
+ register int idx
+ )
+{
+ register unsigned long sum = 0;
+ register int i, first;
+
+ first = rawdcfcode[idx].offset;
+
+ for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--)
+ {
+ sum <<= 1;
+ sum |= (buf[i] != dcfparam.zerobits[i]);
+ }
+ return sum;
+}
+
+/*-----------------------------------------------------------------------
+ * check even parity integrity for a bitfield
+ *
+ * buf holds a pointer to a DCF77 data buffer in symbolic
+ * representation
+ * idx holds the index to the field description in partab
+ */
+static unsigned
+pcheck(
+ register unsigned char *buf,
+ register int idx
+ )
+{
+ register int i,last;
+ register unsigned psum = 1;
+
+ last = partab[idx+1].offset;
+
+ for (i = partab[idx].offset; i < last; i++)
+ psum ^= (buf[i] != dcfparam.zerobits[i]);
+
+ return psum;
+}
+
+/*-----------------------------------------------------------------------
+ * convert a DCF77 data buffer into wall clock time + flags
+ *
+ * buffer holds a pointer to a DCF77 data buffer in symbolic
+ * representation
+ * size describes the length of DCF77 information in bits (represented
+ * as chars in symbolic notation
+ * clock points to a wall clock time description of the DCF77 data (result)
+ */
+static unsigned long
+convert_rawdcf(
+ unsigned char *buffer,
+ int size,
+ clocktime_t *clock_time
+ )
+{
+ if (size < 57)
+ {
+ PRINTF("%-30s", "*** INCOMPLETE");
+ return CVT_NONE;
+ }
+
+ /*
+ * check Start and Parity bits
+ */
+ if ((ext_bf(buffer, DCF_S) == 1) &&
+ pcheck(buffer, DCF_P_P1) &&
+ pcheck(buffer, DCF_P_P2) &&
+ pcheck(buffer, DCF_P_P3))
+ {
+ /*
+ * buffer OK - extract all fields and build wall clock time from them
+ */
+
+ clock_time->flags = 0;
+ clock_time->usecond= 0;
+ clock_time->second = 0;
+ clock_time->minute = ext_bf(buffer, DCF_M10);
+ clock_time->minute = TIMES10(clock_time->minute) + ext_bf(buffer, DCF_M1);
+ clock_time->hour = ext_bf(buffer, DCF_H10);
+ clock_time->hour = TIMES10(clock_time->hour) + ext_bf(buffer, DCF_H1);
+ clock_time->day = ext_bf(buffer, DCF_D10);
+ clock_time->day = TIMES10(clock_time->day) + ext_bf(buffer, DCF_D1);
+ clock_time->month = ext_bf(buffer, DCF_MO0);
+ clock_time->month = TIMES10(clock_time->month) + ext_bf(buffer, DCF_MO);
+ clock_time->year = ext_bf(buffer, DCF_Y10);
+ clock_time->year = TIMES10(clock_time->year) + ext_bf(buffer, DCF_Y1);
+ clock_time->wday = ext_bf(buffer, DCF_DW);
+
+ /*
+ * determine offset to UTC by examining the time zone
+ */
+ switch (ext_bf(buffer, DCF_Z))
+ {
+ case DCF_Z_MET:
+ clock_time->utcoffset = -60;
+ break;
+
+ case DCF_Z_MED:
+ clock_time->flags |= DCFB_DST;
+ clock_time->utcoffset = -120;
+ break;
+
+ default:
+ PRINTF("%-30s", "*** BAD TIME ZONE");
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ /*
+ * extract various warnings from DCF77
+ */
+ if (ext_bf(buffer, DCF_A1))
+ clock_time->flags |= DCFB_ANNOUNCE;
+
+ if (ext_bf(buffer, DCF_A2))
+ clock_time->flags |= DCFB_LEAP;
+
+ if (ext_bf(buffer, DCF_R))
+ clock_time->flags |= DCFB_ALTERNATE;
+
+ return CVT_OK;
+ }
+ else
+ {
+ /*
+ * bad format - not for us
+ */
+ PRINTF("%-30s", "*** BAD FORMAT (invalid/parity)");
+ return CVT_FAIL|CVT_BADFMT;
+ }
+}
+
+/*-----------------------------------------------------------------------
+ * raw dcf input routine - fix up 50 baud
+ * characters for 1/0 decision
+ */
+static unsigned long
+cvt_rawdcf(
+ unsigned char *buffer,
+ int size,
+ clocktime_t *clock_time
+ )
+{
+ register unsigned char *s = buffer;
+ register unsigned char *e = buffer + size;
+ register unsigned char *b = dcfparam.onebits;
+ register unsigned char *c = dcfparam.zerobits;
+ register unsigned rtc = CVT_NONE;
+ register unsigned int i, lowmax, highmax, cutoff, span;
+#define BITS 9
+ unsigned char histbuf[BITS];
+ /*
+ * the input buffer contains characters with runs of consecutive
+ * bits set. These set bits are an indication of the DCF77 pulse
+ * length. We assume that we receive the pulse at 50 Baud. Thus
+ * a 100ms pulse would generate a 4 bit train (20ms per bit and
+ * start bit)
+ * a 200ms pulse would create all zeroes (and probably a frame error)
+ *
+ * The basic idea is that on corret reception we must have two
+ * maxima in the pulse length distribution histogram. (one for
+ * the zero representing pulses and one for the one representing
+ * pulses)
+ * There will always be ones in the datastream, thus we have to see
+ * two maxima.
+ * The best point to cut for a 1/0 decision is the minimum between those
+ * between the maxima. The following code tries to find this cutoff point.
+ */
+
+ /*
+ * clear histogram buffer
+ */
+ for (i = 0; i < BITS; i++)
+ {
+ histbuf[i] = 0;
+ }
+
+ cutoff = 0;
+ lowmax = 0;
+
+ /*
+ * convert sequences of set bits into bits counts updating
+ * the histogram alongway
+ */
+ while (s < e)
+ {
+ register unsigned int ch = *s ^ 0xFF;
+ /*
+ * check integrity and update histogramm
+ */
+ if (!((ch+1) & ch) || !*s)
+ {
+ /*
+ * character ok
+ */
+ for (i = 0; ch; i++)
+ {
+ ch >>= 1;
+ }
+
+ *s = i;
+ histbuf[i]++;
+ cutoff += i;
+ lowmax++;
+ }
+ else
+ {
+ /*
+ * invalid character (no consecutive bit sequence)
+ */
+ dprintf(("parse: cvt_rawdcf: character check for 0x%x@%ld FAILED\n",
+ (u_int)*s, (long)(s - buffer)));
+ *s = (unsigned char)~0;
+ rtc = CVT_FAIL|CVT_BADFMT;
+ }
+ s++;
+ }
+
+ /*
+ * first cutoff estimate (average bit count - must be between both
+ * maxima)
+ */
+ if (lowmax)
+ {
+ cutoff /= lowmax;
+ }
+ else
+ {
+ cutoff = 4; /* doesn't really matter - it'll fail anyway, but gives error output */
+ }
+
+ dprintf(("parse: cvt_rawdcf: average bit count: %d\n", cutoff));
+
+ lowmax = 0; /* weighted sum */
+ highmax = 0; /* bitcount */
+
+ /*
+ * collect weighted sum of lower bits (left of initial guess)
+ */
+ dprintf(("parse: cvt_rawdcf: histogram:"));
+ for (i = 0; i <= cutoff; i++)
+ {
+ lowmax += histbuf[i] * i;
+ highmax += histbuf[i];
+ dprintf((" %d", histbuf[i]));
+ }
+ dprintf((" <M>"));
+
+ /*
+ * round up
+ */
+ lowmax += highmax / 2;
+
+ /*
+ * calculate lower bit maximum (weighted sum / bit count)
+ *
+ * avoid divide by zero
+ */
+ if (highmax)
+ {
+ lowmax /= highmax;
+ }
+ else
+ {
+ lowmax = 0;
+ }
+
+ highmax = 0; /* weighted sum of upper bits counts */
+ cutoff = 0; /* bitcount */
+
+ /*
+ * collect weighted sum of lower bits (right of initial guess)
+ */
+ for (; i < BITS; i++)
+ {
+ highmax+=histbuf[i] * i;
+ cutoff +=histbuf[i];
+ dprintf((" %d", histbuf[i]));
+ }
+ dprintf(("\n"));
+
+ /*
+ * determine upper maximum (weighted sum / bit count)
+ */
+ if (cutoff)
+ {
+ highmax /= cutoff;
+ }
+ else
+ {
+ highmax = BITS-1;
+ }
+
+ /*
+ * following now holds:
+ * lowmax <= cutoff(initial guess) <= highmax
+ * best cutoff is the minimum nearest to higher bits
+ */
+
+ /*
+ * find the minimum between lowmax and highmax (detecting
+ * possibly a minimum span)
+ */
+ span = cutoff = lowmax;
+ for (i = lowmax; i <= highmax; i++)
+ {
+ if (histbuf[cutoff] > histbuf[i])
+ {
+ /*
+ * got a new minimum move beginning of minimum (cutoff) and
+ * end of minimum (span) there
+ */
+ cutoff = span = i;
+ }
+ else
+ if (histbuf[cutoff] == histbuf[i])
+ {
+ /*
+ * minimum not better yet - but it spans more than
+ * one bit value - follow it
+ */
+ span = i;
+ }
+ }
+
+ /*
+ * cutoff point for 1/0 decision is the middle of the minimum section
+ * in the histogram
+ */
+ cutoff = (cutoff + span) / 2;
+
+ dprintf(("parse: cvt_rawdcf: lower maximum %d, higher maximum %d, cutoff %d\n", lowmax, highmax, cutoff));
+
+ /*
+ * convert the bit counts to symbolic 1/0 information for data conversion
+ */
+ s = buffer;
+ while ((s < e) && *c && *b)
+ {
+ if (*s == (unsigned char)~0)
+ {
+ /*
+ * invalid character
+ */
+ *s = '?';
+ }
+ else
+ {
+ /*
+ * symbolic 1/0 representation
+ */
+ *s = (*s >= cutoff) ? *b : *c;
+ }
+ s++;
+ b++;
+ c++;
+ }
+
+ /*
+ * if everything went well so far return the result of the symbolic
+ * conversion routine else just the accumulated errors
+ */
+ if (rtc != CVT_NONE)
+ {
+ PRINTF("%-30s", "*** BAD DATA");
+ }
+
+ return (rtc == CVT_NONE) ? convert_rawdcf(buffer, size, clock_time) : rtc;
+}
+
+/*-----------------------------------------------------------------------
+ * convert a wall clock time description of DCF77 to a Unix time (seconds
+ * since 1.1. 1970 UTC)
+ */
+static time_t
+dcf_to_unixtime(
+ clocktime_t *clock_time,
+ unsigned *cvtrtc
+ )
+{
+#define SETRTC(_X_) { if (cvtrtc) *cvtrtc = (_X_); }
+ static int days_of_month[] =
+ {
+ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+ };
+ register int i;
+ time_t t;
+
+ /*
+ * map 2 digit years to 19xx (DCF77 is a 20th century item)
+ */
+ if ( clock_time->year < YEAR_PIVOT ) /* in case of Y2KFixes [ */
+ clock_time->year += 100; /* *year%100, make tm_year */
+ /* *(do we need this?) */
+ if ( clock_time->year < YEAR_BREAK ) /* (failsafe if) */
+ clock_time->year += 1900; /* Y2KFixes ] */
+
+ /*
+ * must have been a really bad year code - drop it
+ */
+ if (clock_time->year < (YEAR_PIVOT + 1900) ) /* Y2KFixes */
+ {
+ SETRTC(CVT_FAIL|CVT_BADDATE);
+ return -1;
+ }
+ /*
+ * sorry, slow section here - but it's not time critical anyway
+ */
+
+ /*
+ * calculate days since 1970 (watching leap years)
+ */
+ t = julian0( clock_time->year ) - julian0( 1970 );
+
+ /* month */
+ if (clock_time->month <= 0 || clock_time->month > 12)
+ {
+ SETRTC(CVT_FAIL|CVT_BADDATE);
+ return -1; /* bad month */
+ }
+ /* adjust current leap year */
+#if 0
+ if (clock_time->month < 3 && days_per_year(clock_time->year) == 366)
+ t--;
+#endif
+
+ /*
+ * collect days from months excluding the current one
+ */
+ for (i = 1; i < clock_time->month; i++)
+ {
+ t += days_of_month[i];
+ }
+ /* day */
+ if (clock_time->day < 1 || ((clock_time->month == 2 && days_per_year(clock_time->year) == 366) ?
+ clock_time->day > 29 : clock_time->day > days_of_month[clock_time->month]))
+ {
+ SETRTC(CVT_FAIL|CVT_BADDATE);
+ return -1; /* bad day */
+ }
+
+ /*
+ * collect days from date excluding the current one
+ */
+ t += clock_time->day - 1;
+
+ /* hour */
+ if (clock_time->hour < 0 || clock_time->hour >= 24)
+ {
+ SETRTC(CVT_FAIL|CVT_BADTIME);
+ return -1; /* bad hour */
+ }
+
+ /*
+ * calculate hours from 1. 1. 1970
+ */
+ t = TIMES24(t) + clock_time->hour;
+
+ /* min */
+ if (clock_time->minute < 0 || clock_time->minute > 59)
+ {
+ SETRTC(CVT_FAIL|CVT_BADTIME);
+ return -1; /* bad min */
+ }
+
+ /*
+ * calculate minutes from 1. 1. 1970
+ */
+ t = TIMES60(t) + clock_time->minute;
+ /* sec */
+
+ /*
+ * calculate UTC in minutes
+ */
+ t += clock_time->utcoffset;
+
+ if (clock_time->second < 0 || clock_time->second > 60) /* allow for LEAPs */
+ {
+ SETRTC(CVT_FAIL|CVT_BADTIME);
+ return -1; /* bad sec */
+ }
+
+ /*
+ * calculate UTC in seconds - phew !
+ */
+ t = TIMES60(t) + clock_time->second;
+ /* done */
+ return t;
+}
+
+/*-----------------------------------------------------------------------
+ * cheap half baked 1/0 decision - for interactive operation only
+ */
+static char
+type(
+ unsigned int c
+ )
+{
+ c ^= 0xFF;
+ return (c > 0xF);
+}
+
+/*-----------------------------------------------------------------------
+ * week day representation
+ */
+static const char *wday[8] =
+{
+ "??",
+ "Mo",
+ "Tu",
+ "We",
+ "Th",
+ "Fr",
+ "Sa",
+ "Su"
+};
+
+/*-----------------------------------------------------------------------
+ * generate a string representation for a timeval
+ */
+static char *
+pr_timeval(
+ struct timeval *val
+ )
+{
+ static char buf[20];
+
+ if (val->tv_sec == 0)
+ snprintf(buf, sizeof(buf), "%c0.%06ld",
+ (val->tv_usec < 0) ? '-' : '+',
+ (long int)l_abs(val->tv_usec));
+ else
+ snprintf(buf, sizeof(buf), "%ld.%06ld",
+ (long int)val->tv_sec,
+ (long int)l_abs(val->tv_usec));
+ return buf;
+}
+
+/*-----------------------------------------------------------------------
+ * correct the current time by an offset by setting the time rigorously
+ */
+static void
+set_time(
+ struct timeval *offset
+ )
+{
+ struct timeval the_time;
+
+ if (no_set)
+ return;
+
+ LPRINTF("set_time: %s ", pr_timeval(offset));
+ syslog(LOG_NOTICE, "setting time (offset %s)", pr_timeval(offset));
+
+ if (gettimeofday(&the_time, 0L) == -1)
+ {
+ perror("gettimeofday()");
+ }
+ else
+ {
+ timeradd(&the_time, offset);
+ if (settimeofday(&the_time, 0L) == -1)
+ {
+ perror("settimeofday()");
+ }
+ }
+}
+
+/*-----------------------------------------------------------------------
+ * slew the time by a given offset
+ */
+static void
+adj_time(
+ long offset
+ )
+{
+ struct timeval time_offset;
+
+ if (no_set)
+ return;
+
+ time_offset.tv_sec = offset / 1000000;
+ time_offset.tv_usec = offset % 1000000;
+
+ LPRINTF("adj_time: %ld us ", (long int)offset);
+ if (adjtime(&time_offset, 0L) == -1)
+ perror("adjtime()");
+}
+
+/*-----------------------------------------------------------------------
+ * read in a possibly previously written drift value
+ */
+static void
+read_drift(
+ const char *drift_file
+ )
+{
+ FILE *df;
+
+ df = fopen(drift_file, "r");
+ if (df != NULL)
+ {
+ int idrift = 0, fdrift = 0;
+
+ fscanf(df, "%4d.%03d", &idrift, &fdrift);
+ fclose(df);
+ LPRINTF("read_drift: %d.%03d ppm ", idrift, fdrift);
+
+ accum_drift = idrift << USECSCALE;
+ fdrift = (fdrift << USECSCALE) / 1000;
+ accum_drift += fdrift & (1<<USECSCALE);
+ LPRINTF("read_drift: drift_comp %ld ", (long int)accum_drift);
+ }
+}
+
+/*-----------------------------------------------------------------------
+ * write out the current drift value
+ */
+static void
+update_drift(
+ const char *drift_file,
+ long offset,
+ time_t reftime
+ )
+{
+ FILE *df;
+
+ df = fopen(drift_file, "w");
+ if (df != NULL)
+ {
+ int idrift = R_SHIFT(accum_drift, USECSCALE);
+ int fdrift = accum_drift & ((1<<USECSCALE)-1);
+
+ LPRINTF("update_drift: drift_comp %ld ", (long int)accum_drift);
+ fdrift = (fdrift * 1000) / (1<<USECSCALE);
+ fprintf(df, "%4d.%03d %c%ld.%06ld %.24s\n", idrift, fdrift,
+ (offset < 0) ? '-' : '+', (long int)(l_abs(offset) / 1000000),
+ (long int)(l_abs(offset) % 1000000), asctime(localtime(&reftime)));
+ fclose(df);
+ LPRINTF("update_drift: %d.%03d ppm ", idrift, fdrift);
+ }
+}
+
+/*-----------------------------------------------------------------------
+ * process adjustments derived from the DCF77 observation
+ * (controls clock PLL)
+ */
+static void
+adjust_clock(
+ struct timeval *offset,
+ const char *drift_file,
+ time_t reftime
+ )
+{
+ struct timeval toffset;
+ register long usecoffset;
+ int tmp;
+
+ if (no_set)
+ return;
+
+ if (skip_adjust)
+ {
+ skip_adjust = 0;
+ return;
+ }
+
+ toffset = *offset;
+ toffset.tv_sec = l_abs(toffset.tv_sec);
+ toffset.tv_usec = l_abs(toffset.tv_usec);
+ if (toffset.tv_sec ||
+ (!toffset.tv_sec && toffset.tv_usec > max_adj_offset_usec))
+ {
+ /*
+ * hopeless - set the clock - and clear the timing
+ */
+ set_time(offset);
+ clock_adjust = 0;
+ skip_adjust = 1;
+ return;
+ }
+
+ usecoffset = offset->tv_sec * 1000000 + offset->tv_usec;
+
+ clock_adjust = R_SHIFT(usecoffset, TIMECONSTANT); /* adjustment to make for next period */
+
+ tmp = 0;
+ while (adjustments > (1 << tmp))
+ tmp++;
+ adjustments = 0;
+ if (tmp > FREQ_WEIGHT)
+ tmp = FREQ_WEIGHT;
+
+ accum_drift += R_SHIFT(usecoffset << USECSCALE, TIMECONSTANT+TIMECONSTANT+FREQ_WEIGHT-tmp);
+
+ if (accum_drift > MAX_DRIFT) /* clamp into interval */
+ accum_drift = MAX_DRIFT;
+ else
+ if (accum_drift < -MAX_DRIFT)
+ accum_drift = -MAX_DRIFT;
+
+ update_drift(drift_file, usecoffset, reftime);
+ LPRINTF("clock_adjust: %s, clock_adjust %ld, drift_comp %ld(%ld) ",
+ pr_timeval(offset),(long int) R_SHIFT(clock_adjust, USECSCALE),
+ (long int)R_SHIFT(accum_drift, USECSCALE), (long int)accum_drift);
+}
+
+/*-----------------------------------------------------------------------
+ * adjust the clock by a small mount to simulate frequency correction
+ */
+static void
+periodic_adjust(
+ void
+ )
+{
+ register long adjustment;
+
+ adjustments++;
+
+ adjustment = R_SHIFT(clock_adjust, PHASE_WEIGHT);
+
+ clock_adjust -= adjustment;
+
+ adjustment += R_SHIFT(accum_drift, USECSCALE+ADJINTERVAL);
+
+ adj_time(adjustment);
+}
+
+/*-----------------------------------------------------------------------
+ * control synchronisation status (warnings) and do periodic adjusts
+ * (frequency control simulation)
+ */
+static void
+tick(
+ int signum
+ )
+{
+ static unsigned long last_notice = 0;
+
+#if !defined(HAVE_SIGACTION) && !defined(HAVE_SIGVEC)
+ (void)signal(SIGALRM, tick);
+#endif
+
+ periodic_adjust();
+
+ ticks += 1<<ADJINTERVAL;
+
+ if ((ticks - last_sync) > MAX_UNSYNC)
+ {
+ /*
+ * not getting time for a while
+ */
+ if (sync_state == SYNC)
+ {
+ /*
+ * completely lost information
+ */
+ sync_state = NO_SYNC;
+ syslog(LOG_INFO, "DCF77 reception lost (timeout)");
+ last_notice = ticks;
+ }
+ else
+ /*
+ * in NO_SYNC state - look whether its time to speak up again
+ */
+ if ((ticks - last_notice) > NOTICE_INTERVAL)
+ {
+ syslog(LOG_NOTICE, "still not synchronized to DCF77 - check receiver/signal");
+ last_notice = ticks;
+ }
+ }
+
+#ifndef ITIMER_REAL
+ (void) alarm(1<<ADJINTERVAL);
+#endif
+}
+
+/*-----------------------------------------------------------------------
+ * break association from terminal to avoid catching terminal
+ * or process group related signals (-> daemon operation)
+ */
+static void
+detach(
+ void
+ )
+{
+# ifdef HAVE_DAEMON
+ daemon(0, 0);
+# else /* not HAVE_DAEMON */
+ if (fork())
+ exit(0);
+
+ {
+ u_long s;
+ int max_fd;
+
+#if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX)
+ max_fd = sysconf(_SC_OPEN_MAX);
+#else /* HAVE_SYSCONF && _SC_OPEN_MAX */
+ max_fd = getdtablesize();
+#endif /* HAVE_SYSCONF && _SC_OPEN_MAX */
+ for (s = 0; s < max_fd; s++)
+ (void) close((int)s);
+ (void) open("/", 0);
+ (void) dup2(0, 1);
+ (void) dup2(0, 2);
+#ifdef SYS_DOMAINOS
+ {
+ uid_$t puid;
+ status_$t st;
+
+ proc2_$who_am_i(&puid);
+ proc2_$make_server(&puid, &st);
+ }
+#endif /* SYS_DOMAINOS */
+#if defined(HAVE_SETPGID) || defined(HAVE_SETSID)
+# ifdef HAVE_SETSID
+ if (setsid() == (pid_t)-1)
+ syslog(LOG_ERR, "dcfd: setsid(): %m");
+# else
+ if (setpgid(0, 0) == -1)
+ syslog(LOG_ERR, "dcfd: setpgid(): %m");
+# endif
+#else /* HAVE_SETPGID || HAVE_SETSID */
+ {
+ int fid;
+
+ fid = open("/dev/tty", 2);
+ if (fid >= 0)
+ {
+ (void) ioctl(fid, (u_long) TIOCNOTTY, (char *) 0);
+ (void) close(fid);
+ }
+# ifdef HAVE_SETPGRP_0
+ (void) setpgrp();
+# else /* HAVE_SETPGRP_0 */
+ (void) setpgrp(0, getpid());
+# endif /* HAVE_SETPGRP_0 */
+ }
+#endif /* HAVE_SETPGID || HAVE_SETSID */
+ }
+#endif /* not HAVE_DAEMON */
+}
+
+/*-----------------------------------------------------------------------
+ * list possible arguments and options
+ */
+static void
+usage(
+ char *program
+ )
+{
+ fprintf(stderr, "usage: %s [-n] [-f] [-l] [-t] [-i] [-o] [-d <drift_file>] [-D <input delay>] <device>\n", program);
+ fprintf(stderr, "\t-n do not change time\n");
+ fprintf(stderr, "\t-i interactive\n");
+ fprintf(stderr, "\t-t trace (print all datagrams)\n");
+ fprintf(stderr, "\t-f print all databits (includes PTB private data)\n");
+ fprintf(stderr, "\t-l print loop filter debug information\n");
+ fprintf(stderr, "\t-o print offet average for current minute\n");
+ fprintf(stderr, "\t-Y make internal Y2K checks then exit\n"); /* Y2KFixes */
+ fprintf(stderr, "\t-d <drift_file> specify alternate drift file\n");
+ fprintf(stderr, "\t-D <input delay>specify delay from input edge to processing in micro seconds\n");
+}
+
+/*-----------------------------------------------------------------------
+ * check_y2k() - internal check of Y2K logic
+ * (a lot of this logic lifted from ../ntpd/check_y2k.c)
+ */
+static int
+check_y2k( void )
+{
+ int year; /* current working year */
+ int year0 = 1900; /* sarting year for NTP time */
+ int yearend; /* ending year we test for NTP time.
+ * 32-bit systems: through 2036, the
+ **year in which NTP time overflows.
+ * 64-bit systems: a reasonable upper
+ **limit (well, maybe somewhat beyond
+ **reasonable, but well before the
+ **max time, by which time the earth
+ **will be dead.) */
+ time_t Time;
+ struct tm LocalTime;
+
+ int Fatals, Warnings;
+#define Error(year) if ( (year)>=2036 && LocalTime.tm_year < 110 ) \
+ Warnings++; else Fatals++
+
+ Fatals = Warnings = 0;
+
+ Time = time( (time_t *)NULL );
+ LocalTime = *localtime( &Time );
+
+ year = ( sizeof( u_long ) > 4 ) /* save max span using year as temp */
+ ? ( 400 * 3 ) /* three greater gregorian cycles */
+ : ((int)(0x7FFFFFFF / 365.242 / 24/60/60)* 2 ); /*32-bit limit*/
+ /* NOTE: will automacially expand test years on
+ * 64 bit machines.... this may cause some of the
+ * existing ntp logic to fail for years beyond
+ * 2036 (the current 32-bit limit). If all checks
+ * fail ONLY beyond year 2036 you may ignore such
+ * errors, at least for a decade or so. */
+ yearend = year0 + year;
+
+ year = 1900+YEAR_PIVOT;
+ printf( " starting year %04d\n", (int) year );
+ printf( " ending year %04d\n", (int) yearend );
+
+ for ( ; year < yearend; year++ )
+ {
+ clocktime_t ct;
+ time_t Observed;
+ time_t Expected;
+ unsigned Flag;
+ unsigned long t;
+
+ ct.day = 1;
+ ct.month = 1;
+ ct.year = year;
+ ct.hour = ct.minute = ct.second = ct.usecond = 0;
+ ct.utcoffset = 0;
+ ct.flags = 0;
+
+ Flag = 0;
+ Observed = dcf_to_unixtime( &ct, &Flag );
+ /* seems to be a clone of parse_to_unixtime() with
+ * *a minor difference to arg2 type */
+ if ( ct.year != year )
+ {
+ fprintf( stdout,
+ "%04d: dcf_to_unixtime(,%d) CORRUPTED ct.year: was %d\n",
+ (int)year, (int)Flag, (int)ct.year );
+ Error(year);
+ break;
+ }
+ t = julian0(year) - julian0(1970); /* Julian day from 1970 */
+ Expected = t * 24 * 60 * 60;
+ if ( Observed != Expected || Flag )
+ { /* time difference */
+ fprintf( stdout,
+ "%04d: dcf_to_unixtime(,%d) FAILURE: was=%lu s/b=%lu (%ld)\n",
+ year, (int)Flag,
+ (unsigned long)Observed, (unsigned long)Expected,
+ ((long)Observed - (long)Expected) );
+ Error(year);
+ break;
+ }
+
+ }
+
+ return ( Fatals );
+}
+
+/*--------------------------------------------------
+ * rawdcf_init - set up modem lines for RAWDCF receivers
+ */
+#if defined(TIOCMSET) && (defined(TIOCM_DTR) || defined(CIOCM_DTR))
+static void
+rawdcf_init(
+ int fd
+ )
+{
+ /*
+ * You can use the RS232 to supply the power for a DCF77 receiver.
+ * Here a voltage between the DTR and the RTS line is used. Unfortunately
+ * the name has changed from CIOCM_DTR to TIOCM_DTR recently.
+ */
+
+#ifdef TIOCM_DTR
+ int sl232 = TIOCM_DTR; /* turn on DTR for power supply */
+#else
+ int sl232 = CIOCM_DTR; /* turn on DTR for power supply */
+#endif
+
+ if (ioctl(fd, TIOCMSET, (caddr_t)&sl232) == -1)
+ {
+ syslog(LOG_NOTICE, "rawdcf_init: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_DTR): %m");
+ }
+}
+#else
+static void
+rawdcf_init(
+ int fd
+ )
+{
+ syslog(LOG_NOTICE, "rawdcf_init: WARNING: OS interface incapable of setting DTR to power DCF modules");
+}
+#endif /* DTR initialisation type */
+
+/*-----------------------------------------------------------------------
+ * main loop - argument interpreter / setup / main loop
+ */
+int
+main(
+ int argc,
+ char **argv
+ )
+{
+ unsigned char c;
+ char **a = argv;
+ int ac = argc;
+ char *file = NULL;
+ const char *drift_file = "/etc/dcfd.drift";
+ int fd;
+ int offset = 15;
+ int offsets = 0;
+ int delay = DEFAULT_DELAY; /* average delay from input edge to time stamping */
+ int trace = 0;
+ int errs = 0;
+
+ /*
+ * process arguments
+ */
+ while (--ac)
+ {
+ char *arg = *++a;
+ if (*arg == '-')
+ while ((c = *++arg))
+ switch (c)
+ {
+ case 't':
+ trace = 1;
+ interactive = 1;
+ break;
+
+ case 'f':
+ offset = 0;
+ interactive = 1;
+ break;
+
+ case 'l':
+ loop_filter_debug = 1;
+ offsets = 1;
+ interactive = 1;
+ break;
+
+ case 'n':
+ no_set = 1;
+ break;
+
+ case 'o':
+ offsets = 1;
+ interactive = 1;
+ break;
+
+ case 'i':
+ interactive = 1;
+ break;
+
+ case 'D':
+ if (ac > 1)
+ {
+ delay = atoi(*++a);
+ ac--;
+ }
+ else
+ {
+ fprintf(stderr, "%s: -D requires integer argument\n", argv[0]);
+ errs=1;
+ }
+ break;
+
+ case 'd':
+ if (ac > 1)
+ {
+ drift_file = *++a;
+ ac--;
+ }
+ else
+ {
+ fprintf(stderr, "%s: -d requires file name argument\n", argv[0]);
+ errs=1;
+ }
+ break;
+
+ case 'Y':
+ errs=check_y2k();
+ exit( errs ? 1 : 0 );
+
+ default:
+ fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
+ errs=1;
+ break;
+ }
+ else
+ if (file == NULL)
+ file = arg;
+ else
+ {
+ fprintf(stderr, "%s: device specified twice\n", argv[0]);
+ errs=1;
+ }
+ }
+
+ if (errs)
+ {
+ usage(argv[0]);
+ exit(1);
+ }
+ else
+ if (file == NULL)
+ {
+ fprintf(stderr, "%s: device not specified\n", argv[0]);
+ usage(argv[0]);
+ exit(1);
+ }
+
+ errs = LINES+1;
+
+ /*
+ * get access to DCF77 tty port
+ */
+ fd = open(file, O_RDONLY);
+ if (fd == -1)
+ {
+ perror(file);
+ exit(1);
+ }
+ else
+ {
+ int i, rrc;
+ struct timeval t, tt, tlast;
+ struct timeval timeout;
+ struct timeval phase;
+ struct timeval time_offset;
+ char pbuf[61]; /* printable version */
+ char buf[61]; /* raw data */
+ clocktime_t clock_time; /* wall clock time */
+ time_t utc_time = 0;
+ time_t last_utc_time = 0;
+ long usecerror = 0;
+ long lasterror = 0;
+#if defined(HAVE_TERMIOS_H) || defined(STREAM)
+ struct termios term;
+#else /* not HAVE_TERMIOS_H || STREAM */
+# if defined(HAVE_TERMIO_H) || defined(HAVE_SYSV_TTYS)
+ struct termio term;
+# endif/* HAVE_TERMIO_H || HAVE_SYSV_TTYS */
+#endif /* not HAVE_TERMIOS_H || STREAM */
+ unsigned int rtc = CVT_NONE;
+
+ rawdcf_init(fd);
+
+ timeout.tv_sec = 1;
+ timeout.tv_usec = 500000;
+
+ phase.tv_sec = 0;
+ phase.tv_usec = delay;
+
+ /*
+ * setup TTY (50 Baud, Read, 8Bit, No Hangup, 1 character IO)
+ */
+ if (TTY_GETATTR(fd, &term) == -1)
+ {
+ perror("tcgetattr");
+ exit(1);
+ }
+
+ memset(term.c_cc, 0, sizeof(term.c_cc));
+ term.c_cc[VMIN] = 1;
+#ifdef NO_PARENB_IGNPAR
+ term.c_cflag = CS8|CREAD|CLOCAL;
+#else
+ term.c_cflag = CS8|CREAD|CLOCAL|PARENB;
+#endif
+ term.c_iflag = IGNPAR;
+ term.c_oflag = 0;
+ term.c_lflag = 0;
+
+ cfsetispeed(&term, B50);
+ cfsetospeed(&term, B50);
+
+ if (TTY_SETATTR(fd, &term) == -1)
+ {
+ perror("tcsetattr");
+ exit(1);
+ }
+
+ /*
+ * lose terminal if in daemon operation
+ */
+ if (!interactive)
+ detach();
+
+ /*
+ * get syslog() initialized
+ */
+#ifdef LOG_DAEMON
+ openlog("dcfd", LOG_PID, LOG_DAEMON);
+#else
+ openlog("dcfd", LOG_PID);
+#endif
+
+ /*
+ * setup periodic operations (state control / frequency control)
+ */
+#ifdef HAVE_SIGACTION
+ {
+ struct sigaction act;
+
+# ifdef HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION
+ act.sa_sigaction = (void (*) (int, siginfo_t *, void *))0;
+# endif /* HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION */
+ act.sa_handler = tick;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+
+ if (sigaction(SIGALRM, &act, (struct sigaction *)0) == -1)
+ {
+ syslog(LOG_ERR, "sigaction(SIGALRM): %m");
+ exit(1);
+ }
+ }
+#else
+#ifdef HAVE_SIGVEC
+ {
+ struct sigvec vec;
+
+ vec.sv_handler = tick;
+ vec.sv_mask = 0;
+ vec.sv_flags = 0;
+
+ if (sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1)
+ {
+ syslog(LOG_ERR, "sigvec(SIGALRM): %m");
+ exit(1);
+ }
+ }
+#else
+ (void) signal(SIGALRM, tick);
+#endif
+#endif
+
+#ifdef ITIMER_REAL
+ {
+ struct itimerval it;
+
+ it.it_interval.tv_sec = 1<<ADJINTERVAL;
+ it.it_interval.tv_usec = 0;
+ it.it_value.tv_sec = 1<<ADJINTERVAL;
+ it.it_value.tv_usec = 0;
+
+ if (setitimer(ITIMER_REAL, &it, (struct itimerval *)0) == -1)
+ {
+ syslog(LOG_ERR, "setitimer: %m");
+ exit(1);
+ }
+ }
+#else
+ (void) alarm(1<<ADJINTERVAL);
+#endif
+
+ PRINTF(" DCF77 monitor %s - Copyright (C) 1993-2005 by Frank Kardel\n\n", revision);
+
+ pbuf[60] = '\0';
+ for ( i = 0; i < 60; i++)
+ pbuf[i] = '.';
+
+ read_drift(drift_file);
+
+ /*
+ * what time is it now (for interval measurement)
+ */
+ gettimeofday(&tlast, 0L);
+ i = 0;
+ /*
+ * loop until input trouble ...
+ */
+ do
+ {
+ /*
+ * get an impulse
+ */
+ while ((rrc = read(fd, &c, 1)) == 1)
+ {
+ gettimeofday(&t, 0L);
+ tt = t;
+ timersub(&t, &tlast);
+
+ if (errs > LINES)
+ {
+ PRINTF(" %s", &"PTB private....RADMLSMin....PHour..PMDay..DayMonthYear....P\n"[offset]);
+ PRINTF(" %s", &"---------------RADMLS1248124P124812P1248121241248112481248P\n"[offset]);
+ errs = 0;
+ }
+
+ /*
+ * timeout -> possible minute mark -> interpretation
+ */
+ if (timercmp(&t, &timeout, >))
+ {
+ PRINTF("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &pbuf[offset]);
+
+ if ((rtc = cvt_rawdcf((unsigned char *)buf, i, &clock_time)) != CVT_OK)
+ {
+ /*
+ * this data was bad - well - forget synchronisation for now
+ */
+ PRINTF("\n");
+ if (sync_state == SYNC)
+ {
+ sync_state = NO_SYNC;
+ syslog(LOG_INFO, "DCF77 reception lost (bad data)");
+ }
+ errs++;
+ }
+ else
+ if (trace)
+ {
+ PRINTF("\r %.*s ", 59 - offset, &buf[offset]);
+ }
+
+
+ buf[0] = c;
+
+ /*
+ * collect first character
+ */
+ if (((c^0xFF)+1) & (c^0xFF))
+ pbuf[0] = '?';
+ else
+ pbuf[0] = type(c) ? '#' : '-';
+
+ for ( i = 1; i < 60; i++)
+ pbuf[i] = '.';
+
+ i = 0;
+ }
+ else
+ {
+ /*
+ * collect character
+ */
+ buf[i] = c;
+
+ /*
+ * initial guess (usually correct)
+ */
+ if (((c^0xFF)+1) & (c^0xFF))
+ pbuf[i] = '?';
+ else
+ pbuf[i] = type(c) ? '#' : '-';
+
+ PRINTF("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &pbuf[offset]);
+ }
+
+ if (i == 0 && rtc == CVT_OK)
+ {
+ /*
+ * we got a good time code here - try to convert it to
+ * UTC
+ */
+ if ((utc_time = dcf_to_unixtime(&clock_time, &rtc)) == -1)
+ {
+ PRINTF("*** BAD CONVERSION\n");
+ }
+
+ if (utc_time != (last_utc_time + 60))
+ {
+ /*
+ * well, two successive sucessful telegrams are not 60 seconds
+ * apart
+ */
+ PRINTF("*** NO MINUTE INC\n");
+ if (sync_state == SYNC)
+ {
+ sync_state = NO_SYNC;
+ syslog(LOG_INFO, "DCF77 reception lost (data mismatch)");
+ }
+ errs++;
+ rtc = CVT_FAIL|CVT_BADTIME|CVT_BADDATE;
+ }
+ else
+ usecerror = 0;
+
+ last_utc_time = utc_time;
+ }
+
+ if (rtc == CVT_OK)
+ {
+ if (i == 0)
+ {
+ /*
+ * valid time code - determine offset and
+ * note regained reception
+ */
+ last_sync = ticks;
+ if (sync_state == NO_SYNC)
+ {
+ syslog(LOG_INFO, "receiving DCF77");
+ }
+ else
+ {
+ /*
+ * we had at least one minute SYNC - thus
+ * last error is valid
+ */
+ time_offset.tv_sec = lasterror / 1000000;
+ time_offset.tv_usec = lasterror % 1000000;
+ adjust_clock(&time_offset, drift_file, utc_time);
+ }
+ sync_state = SYNC;
+ }
+
+ time_offset.tv_sec = utc_time + i;
+ time_offset.tv_usec = 0;
+
+ timeradd(&time_offset, &phase);
+
+ usecerror += (time_offset.tv_sec - tt.tv_sec) * 1000000 + time_offset.tv_usec
+ -tt.tv_usec;
+
+ /*
+ * output interpreted DCF77 data
+ */
+ PRINTF(offsets ? "%s, %2ld:%02ld:%02d, %ld.%02ld.%02ld, <%s%s%s%s> (%c%ld.%06lds)" :
+ "%s, %2ld:%02ld:%02d, %ld.%02ld.%02ld, <%s%s%s%s>",
+ wday[clock_time.wday],
+ clock_time.hour, clock_time.minute, i, clock_time.day, clock_time.month,
+ clock_time.year,
+ (clock_time.flags & DCFB_ALTERNATE) ? "R" : "_",
+ (clock_time.flags & DCFB_ANNOUNCE) ? "A" : "_",
+ (clock_time.flags & DCFB_DST) ? "D" : "_",
+ (clock_time.flags & DCFB_LEAP) ? "L" : "_",
+ (lasterror < 0) ? '-' : '+', l_abs(lasterror) / 1000000, l_abs(lasterror) % 1000000
+ );
+
+ if (trace && (i == 0))
+ {
+ PRINTF("\n");
+ errs++;
+ }
+ lasterror = usecerror / (i+1);
+ }
+ else
+ {
+ lasterror = 0; /* we cannot calculate phase errors on bad reception */
+ }
+
+ PRINTF("\r");
+
+ if (i < 60)
+ {
+ i++;
+ }
+
+ tlast = tt;
+
+ if (interactive)
+ fflush(stdout);
+ }
+ } while ((rrc == -1) && (errno == EINTR));
+
+ /*
+ * lost IO - sorry guys
+ */
+ syslog(LOG_ERR, "TERMINATING - cannot read from device %s (%m)", file);
+
+ (void)close(fd);
+ }
+
+ closelog();
+
+ return 0;
+}
+
+/*
+ * History:
+ *
+ * dcfd.c,v
+ * Revision 4.18 2005/10/07 22:08:18 kardel
+ * make dcfd.c compile on NetBSD 3.99.9 again (configure/sigvec compatibility fix)
+ *
+ * Revision 4.17.2.1 2005/10/03 19:15:16 kardel
+ * work around configure not detecting a missing sigvec compatibility
+ * interface on NetBSD 3.99.9 and above
+ *
+ * Revision 4.17 2005/08/10 10:09:44 kardel
+ * output revision information
+ *
+ * Revision 4.16 2005/08/10 06:33:25 kardel
+ * cleanup warnings
+ *
+ * Revision 4.15 2005/08/10 06:28:45 kardel
+ * fix setting of baud rate
+ *
+ * Revision 4.14 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.13 2004/11/14 15:29:41 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ */
diff --git a/parseutil/testdcf.c b/parseutil/testdcf.c
new file mode 100644
index 0000000..c78c242
--- /dev/null
+++ b/parseutil/testdcf.c
@@ -0,0 +1,541 @@
+/*
+ * /src/NTP/ntp4-dev/parseutil/testdcf.c,v 4.10 2005/08/06 14:18:43 kardel RELEASE_20050806_A
+ *
+ * testdcf.c,v 4.10 2005/08/06 14:18:43 kardel RELEASE_20050806_A
+ *
+ * simple DCF77 100/200ms pulse test program (via 50Baud serial line)
+ *
+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+#include "ntp_stdlib.h"
+
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <termios.h>
+
+/*
+ * state flags
+ */
+#define DCFB_ANNOUNCE 0x0001 /* switch time zone warning (DST switch) */
+#define DCFB_DST 0x0002 /* DST in effect */
+#define DCFB_LEAP 0x0004 /* LEAP warning (1 hour prior to occurrence) */
+#define DCFB_ALTERNATE 0x0008 /* alternate antenna used */
+
+struct clocktime /* clock time broken up from time code */
+{
+ long wday;
+ long day;
+ long month;
+ long year;
+ long hour;
+ long minute;
+ long second;
+ long usecond;
+ long utcoffset; /* in minutes */
+ long flags; /* current clock status */
+};
+
+typedef struct clocktime clocktime_t;
+
+static char type(unsigned int);
+
+#define TIMES10(_X_) (((_X_) << 3) + ((_X_) << 1))
+
+/*
+ * parser related return/error codes
+ */
+#define CVT_MASK 0x0000000F /* conversion exit code */
+#define CVT_NONE 0x00000001 /* format not applicable */
+#define CVT_FAIL 0x00000002 /* conversion failed - error code returned */
+#define CVT_OK 0x00000004 /* conversion succeeded */
+#define CVT_BADFMT 0x00000010 /* general format error - (unparsable) */
+
+/*
+ * DCF77 raw time code
+ *
+ * From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig
+ * und Berlin, Maerz 1989
+ *
+ * Timecode transmission:
+ * AM:
+ * time marks are send every second except for the second before the
+ * next minute mark
+ * time marks consist of a reduction of transmitter power to 25%
+ * of the nominal level
+ * the falling edge is the time indication (on time)
+ * time marks of a 100ms duration constitute a logical 0
+ * time marks of a 200ms duration constitute a logical 1
+ * FM:
+ * see the spec. (basically a (non-)inverted psuedo random phase shift)
+ *
+ * Encoding:
+ * Second Contents
+ * 0 - 10 AM: free, FM: 0
+ * 11 - 14 free
+ * 15 R - alternate antenna
+ * 16 A1 - expect zone change (1 hour before)
+ * 17 - 18 Z1,Z2 - time zone
+ * 0 0 illegal
+ * 0 1 MEZ (MET)
+ * 1 0 MESZ (MED, MET DST)
+ * 1 1 illegal
+ * 19 A2 - expect leap insertion/deletion (1 hour before)
+ * 20 S - start of time code (1)
+ * 21 - 24 M1 - BCD (lsb first) Minutes
+ * 25 - 27 M10 - BCD (lsb first) 10 Minutes
+ * 28 P1 - Minute Parity (even)
+ * 29 - 32 H1 - BCD (lsb first) Hours
+ * 33 - 34 H10 - BCD (lsb first) 10 Hours
+ * 35 P2 - Hour Parity (even)
+ * 36 - 39 D1 - BCD (lsb first) Days
+ * 40 - 41 D10 - BCD (lsb first) 10 Days
+ * 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday)
+ * 45 - 49 MO - BCD (lsb first) Month
+ * 50 MO0 - 10 Months
+ * 51 - 53 Y1 - BCD (lsb first) Years
+ * 54 - 57 Y10 - BCD (lsb first) 10 Years
+ * 58 P3 - Date Parity (even)
+ * 59 - usually missing (minute indication), except for leap insertion
+ */
+
+static char revision[] = "4.10";
+
+static struct rawdcfcode
+{
+ char offset; /* start bit */
+} rawdcfcode[] =
+{
+ { 0 }, { 15 }, { 16 }, { 17 }, { 19 }, { 20 }, { 21 }, { 25 }, { 28 }, { 29 },
+ { 33 }, { 35 }, { 36 }, { 40 }, { 42 }, { 45 }, { 49 }, { 50 }, { 54 }, { 58 }, { 59 }
+};
+
+#define DCF_M 0
+#define DCF_R 1
+#define DCF_A1 2
+#define DCF_Z 3
+#define DCF_A2 4
+#define DCF_S 5
+#define DCF_M1 6
+#define DCF_M10 7
+#define DCF_P1 8
+#define DCF_H1 9
+#define DCF_H10 10
+#define DCF_P2 11
+#define DCF_D1 12
+#define DCF_D10 13
+#define DCF_DW 14
+#define DCF_MO 15
+#define DCF_MO0 16
+#define DCF_Y1 17
+#define DCF_Y10 18
+#define DCF_P3 19
+
+static struct partab
+{
+ char offset; /* start bit of parity field */
+} partab[] =
+{
+ { 21 }, { 29 }, { 36 }, { 59 }
+};
+
+#define DCF_P_P1 0
+#define DCF_P_P2 1
+#define DCF_P_P3 2
+
+#define DCF_Z_MET 0x2
+#define DCF_Z_MED 0x1
+
+static unsigned long
+ext_bf(
+ register unsigned char *buf,
+ register int idx
+ )
+{
+ register unsigned long sum = 0;
+ register int i, first;
+
+ first = rawdcfcode[idx].offset;
+
+ for (i = rawdcfcode[idx+1].offset - 1; i >= first; i--)
+ {
+ sum <<= 1;
+ sum |= (buf[i] != '-');
+ }
+ return sum;
+}
+
+static unsigned
+pcheck(
+ register unsigned char *buf,
+ register int idx
+ )
+{
+ register int i,last;
+ register unsigned psum = 1;
+
+ last = partab[idx+1].offset;
+
+ for (i = partab[idx].offset; i < last; i++)
+ psum ^= (buf[i] != '-');
+
+ return psum;
+}
+
+static unsigned long
+convert_rawdcf(
+ register unsigned char *buffer,
+ register int size,
+ register clocktime_t *clock_time
+ )
+{
+ if (size < 57)
+ {
+ printf("%-30s", "*** INCOMPLETE");
+ return CVT_NONE;
+ }
+
+ /*
+ * check Start and Parity bits
+ */
+ if ((ext_bf(buffer, DCF_S) == 1) &&
+ pcheck(buffer, DCF_P_P1) &&
+ pcheck(buffer, DCF_P_P2) &&
+ pcheck(buffer, DCF_P_P3))
+ {
+ /*
+ * buffer OK
+ */
+
+ clock_time->flags = 0;
+ clock_time->usecond= 0;
+ clock_time->second = 0;
+ clock_time->minute = ext_bf(buffer, DCF_M10);
+ clock_time->minute = TIMES10(clock_time->minute) + ext_bf(buffer, DCF_M1);
+ clock_time->hour = ext_bf(buffer, DCF_H10);
+ clock_time->hour = TIMES10(clock_time->hour) + ext_bf(buffer, DCF_H1);
+ clock_time->day = ext_bf(buffer, DCF_D10);
+ clock_time->day = TIMES10(clock_time->day) + ext_bf(buffer, DCF_D1);
+ clock_time->month = ext_bf(buffer, DCF_MO0);
+ clock_time->month = TIMES10(clock_time->month) + ext_bf(buffer, DCF_MO);
+ clock_time->year = ext_bf(buffer, DCF_Y10);
+ clock_time->year = TIMES10(clock_time->year) + ext_bf(buffer, DCF_Y1);
+ clock_time->wday = ext_bf(buffer, DCF_DW);
+
+ switch (ext_bf(buffer, DCF_Z))
+ {
+ case DCF_Z_MET:
+ clock_time->utcoffset = -60;
+ break;
+
+ case DCF_Z_MED:
+ clock_time->flags |= DCFB_DST;
+ clock_time->utcoffset = -120;
+ break;
+
+ default:
+ printf("%-30s", "*** BAD TIME ZONE");
+ return CVT_FAIL|CVT_BADFMT;
+ }
+
+ if (ext_bf(buffer, DCF_A1))
+ clock_time->flags |= DCFB_ANNOUNCE;
+
+ if (ext_bf(buffer, DCF_A2))
+ clock_time->flags |= DCFB_LEAP;
+
+ if (ext_bf(buffer, DCF_R))
+ clock_time->flags |= DCFB_ALTERNATE;
+
+ return CVT_OK;
+ }
+ else
+ {
+ /*
+ * bad format - not for us
+ */
+ printf("%-30s", "*** BAD FORMAT (invalid/parity)");
+ return CVT_FAIL|CVT_BADFMT;
+ }
+}
+
+static char
+type(
+ unsigned int c
+ )
+{
+ c ^= 0xFF;
+ return (c >= 0xF);
+}
+
+static const char *wday[8] =
+{
+ "??",
+ "Mo",
+ "Tu",
+ "We",
+ "Th",
+ "Fr",
+ "Sa",
+ "Su"
+};
+
+static char pat[] = "-\\|/";
+
+#define LINES (24-2) /* error lines after which the two headlines are repeated */
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ if ((argc != 2) && (argc != 3))
+ {
+ fprintf(stderr, "usage: %s [-f|-t|-ft|-tf] <device>\n", argv[0]);
+ exit(1);
+ }
+ else
+ {
+ unsigned char c;
+ char *file;
+ int fd;
+ int offset = 15;
+ int trace = 0;
+ int errs = LINES+1;
+
+ /*
+ * SIMPLE(!) argument "parser"
+ */
+ if (argc == 3)
+ {
+ if (strcmp(argv[1], "-f") == 0)
+ offset = 0;
+ if (strcmp(argv[1], "-t") == 0)
+ trace = 1;
+ if ((strcmp(argv[1], "-ft") == 0) ||
+ (strcmp(argv[1], "-tf") == 0))
+ {
+ offset = 0;
+ trace = 1;
+ }
+ file = argv[2];
+ }
+ else
+ {
+ file = argv[1];
+ }
+
+ fd = open(file, O_RDONLY);
+ if (fd == -1)
+ {
+ perror(file);
+ exit(1);
+ }
+ else
+ {
+ int i;
+#ifdef TIOCM_RTS
+ int on = TIOCM_RTS;
+#endif
+ struct timeval t, tt, tlast;
+ char buf[61];
+ clocktime_t clock_time;
+ struct termios term;
+ int rtc = CVT_NONE;
+
+ if (tcgetattr(fd, &term) == -1)
+ {
+ perror("tcgetattr");
+ exit(1);
+ }
+
+ memset(term.c_cc, 0, sizeof(term.c_cc));
+ term.c_cc[VMIN] = 1;
+#ifdef NO_PARENB_IGNPAR /* Was: defined(SYS_IRIX4) || defined (SYS_IRIX5) */
+ /* somehow doesn't grok PARENB & IGNPAR (mj) */
+ term.c_cflag = CS8|CREAD|CLOCAL;
+#else
+ term.c_cflag = CS8|CREAD|CLOCAL|PARENB;
+#endif
+ term.c_iflag = IGNPAR;
+ term.c_oflag = 0;
+ term.c_lflag = 0;
+
+ cfsetispeed(&term, B50);
+ cfsetospeed(&term, B50);
+
+ if (tcsetattr(fd, TCSANOW, &term) == -1)
+ {
+ perror("tcsetattr");
+ exit(1);
+ }
+
+#ifdef I_POP
+ while (ioctl(fd, I_POP, 0) == 0)
+ ;
+#endif
+#if defined(TIOCMBIC) && defined(TIOCM_RTS)
+ if (ioctl(fd, TIOCMBIC, (caddr_t)&on) == -1)
+ {
+ perror("TIOCM_RTS");
+ }
+#endif
+
+ printf(" DCF77 monitor %s - Copyright (C) 1993-2005, Frank Kardel\n\n", revision);
+
+ clock_time.hour = 0;
+ clock_time.minute = 0;
+ clock_time.day = 0;
+ clock_time.wday = 0;
+ clock_time.month = 0;
+ clock_time.year = 0;
+ clock_time.flags = 0;
+ buf[60] = '\0';
+ for ( i = 0; i < 60; i++)
+ buf[i] = '.';
+
+ gettimeofday(&tlast, 0L);
+ i = 0;
+ while (read(fd, &c, 1) == 1)
+ {
+ gettimeofday(&t, 0L);
+ tt = t;
+ t.tv_sec -= tlast.tv_sec;
+ t.tv_usec -= tlast.tv_usec;
+ if (t.tv_usec < 0)
+ {
+ t.tv_usec += 1000000;
+ t.tv_sec -= 1;
+ }
+
+ if (errs > LINES)
+ {
+ printf(" %s", &"PTB private....RADMLSMin....PHour..PMDay..DayMonthYear....P\n"[offset]);
+ printf(" %s", &"---------------RADMLS1248124P124812P1248121241248112481248P\n"[offset]);
+ errs = 0;
+ }
+
+ if (t.tv_sec > 1 ||
+ (t.tv_sec == 1 &&
+ t.tv_usec > 500000))
+ {
+ printf("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &buf[offset]);
+
+ if ((rtc = convert_rawdcf((unsigned char *)buf, i, &clock_time)) != CVT_OK)
+ {
+ printf("\n");
+ clock_time.hour = 0;
+ clock_time.minute = 0;
+ clock_time.day = 0;
+ clock_time.wday = 0;
+ clock_time.month = 0;
+ clock_time.year = 0;
+ clock_time.flags = 0;
+ errs++;
+ }
+
+ if (((c^0xFF)+1) & (c^0xFF))
+ buf[0] = '?';
+ else
+ buf[0] = type(c) ? '#' : '-';
+
+ for ( i = 1; i < 60; i++)
+ buf[i] = '.';
+
+ i = 0;
+ }
+ else
+ {
+ if (((c^0xFF)+1) & (c^0xFF))
+ buf[i] = '?';
+ else
+ buf[i] = type(c) ? '#' : '-';
+
+ printf("%c %.*s ", pat[i % (sizeof(pat)-1)], 59 - offset, &buf[offset]);
+ }
+
+ if (rtc == CVT_OK)
+ {
+ printf("%s, %2d:%02d:%02d, %d.%02d.%02d, <%s%s%s%s>",
+ wday[clock_time.wday],
+ (int)clock_time.hour, (int)clock_time.minute, (int)i, (int)clock_time.day, (int)clock_time.month,
+ (int)clock_time.year,
+ (clock_time.flags & DCFB_ALTERNATE) ? "R" : "_",
+ (clock_time.flags & DCFB_ANNOUNCE) ? "A" : "_",
+ (clock_time.flags & DCFB_DST) ? "D" : "_",
+ (clock_time.flags & DCFB_LEAP) ? "L" : "_"
+ );
+ if (trace && (i == 0))
+ {
+ printf("\n");
+ errs++;
+ }
+ }
+
+ printf("\r");
+
+ if (i < 60)
+ {
+ i++;
+ }
+
+ tlast = tt;
+
+ fflush(stdout);
+ }
+ close(fd);
+ }
+ }
+ return 0;
+}
+
+/*
+ * History:
+ *
+ * testdcf.c,v
+ * Revision 4.10 2005/08/06 14:18:43 kardel
+ * cleanup warnings
+ *
+ * Revision 4.9 2005/08/06 14:14:38 kardel
+ * document revision on startup
+ *
+ * Revision 4.8 2005/08/06 14:10:08 kardel
+ * fix setting of baud rate
+ *
+ * Revision 4.7 2005/04/16 17:32:10 kardel
+ * update copyright
+ *
+ * Revision 4.6 2004/11/14 15:29:42 kardel
+ * support PPSAPI, upgrade Copyright to Berkeley style
+ *
+ */
diff --git a/ports/winnt/include/arpa/inet.h b/ports/winnt/include/arpa/inet.h
new file mode 100644
index 0000000..5e15997
--- /dev/null
+++ b/ports/winnt/include/arpa/inet.h
@@ -0,0 +1,4 @@
+/**************************************************************
+ * Dummy Header for Unix to Windows NT portability
+ * Created for NTP package
+ **************************************************************/
diff --git a/ports/winnt/include/clockstuff.h b/ports/winnt/include/clockstuff.h
new file mode 100644
index 0000000..df85699
--- /dev/null
+++ b/ports/winnt/include/clockstuff.h
@@ -0,0 +1,44 @@
+#ifndef _CLOCKSTUFF_H
+#define _CLOCKSTUFF_H
+
+#include <time.h>
+#include <sys\timeb.h>
+
+#include "ntp_fp.h"
+#include "ntp_syslog.h"
+
+
+void init_winnt_time(void);
+void reset_winnt_time(void);
+void lock_thread_to_processor(HANDLE);
+
+/* 100ns intervals between 1/1/1601 and 1/1/1970 as reported by
+ * SystemTimeToFileTime()
+ */
+
+#define FILETIME_1970 0x019db1ded53e8000
+#define HECTONANOSECONDS 10000000
+
+/*
+ * Multimedia Timer
+ */
+
+void set_mm_timer(int);
+
+enum {
+ MM_TIMER_LORES,
+ MM_TIMER_HIRES
+};
+
+/*
+ * get_sys_time_as_filetime is a function pointer to
+ * either GetSystemTimeAsFileTime provided by Windows
+ * or ntpd's interpolating replacement.
+ */
+typedef void (WINAPI *PGSTAFT)(LPFILETIME pftResult);
+extern PGSTAFT get_sys_time_as_filetime;
+extern PGSTAFT pGetSystemTimePreciseAsFileTime;
+
+void lock_thread_to_processor(HANDLE);
+
+#endif
diff --git a/ports/winnt/include/config.h b/ports/winnt/include/config.h
new file mode 100644
index 0000000..b99aaa7
--- /dev/null
+++ b/ports/winnt/include/config.h
@@ -0,0 +1,554 @@
+/*
+ * ports/winnt/include/config.h - static Windows config.h
+ *
+ * On most systems config.h is generated by the configure script.
+ * For the Windows port, it's hand-maintained. Compilers earlier
+ * than Visual C++ 2005 are no longer supported, enabling
+ * portable use of "long long" and "%lld".
+ */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/*
+ * Known predifined MS compiler version codes:
+ * 1800: MSVC++ 12.0 (Visual Studio 2013)
+ * 1700: MSVC++ 11.0 (Visual Studio 2012)
+ * 1600: MSVC++ 10.0 (Visual Studio 2010)
+ * 1500: MSVC++ 9.0 (Visual Studio 2008)
+ * 1400: MSVC++ 8.0 (Visual Studio 2005)
+ * 1310: MSVC++ 7.1 (Visual Studio 2003)
+ * 1300: MSVC++ 7.0
+ * 1200: MSVC++ 6.0 (Visual C++ 6)
+ * 1100: MSVC++ 5.0
+ */
+
+#if defined(_MSC_VER) && _MSC_VER < 1400
+#error Minimum supported Microsoft compiler is Visual C++ 2005.
+#endif
+
+/*
+ * We want structures and prototypes added after Windows NT 4.0 exposed
+ * by Windows header files, so we define _WIN32_WINNT to target Windows
+ * XP (version 5.1). By default, _WIN32_WINNT also controls the minimum
+ * required Windows version to launch the .exe. As we want a single
+ * binary to work on all supported Windows versions, we runtime link
+ * newer functions, and use the linker /version:0x0400 option to
+ * override the .EXE header minimum Windows version.
+ *
+ * When using the VC++ 2008 and later compilers, the resulting binaries
+ * will not work on versions earlier than Windows XP, due to runtime
+ * library dependencies. That is, Visual C++ 2005 is the last version
+ * capable of producing binaries usable with Windows NT 4 and 2000.
+ */
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+
+#define __attribute__(x) /* empty */
+#define _CRT_SECURE_NO_DEPRECATE 1
+
+/*
+ * ANSI C compliance enabled
+ */
+#define __STDC__ 1
+
+/*
+ * Enable the debug build of MS C runtime to dump leaks
+ * at exit time (currently only if run under a debugger).
+ */
+#if defined(_MSC_VER) && defined(_DEBUG)
+# define _CRTDBG_MAP_ALLOC
+# include <stdlib.h>
+# include <malloc.h>
+# include <crtdbg.h>
+/* # define MALLOC_LINT */ /* defers free() */
+# define EREALLOC_IMPL(ptr, newsz, filenm, loc) \
+ _realloc_dbg(ptr, newsz, _NORMAL_BLOCK, filenm, loc)
+#endif
+
+/*
+ * We need to include stdio.h first before we #define snprintf
+ * otherwise we can get errors during the build
+ */
+#include <stdio.h>
+
+/* Prevent inclusion of winsock.h in windows.h */
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_
+#endif
+
+#ifndef __RPCASYNC_H__
+#define __RPCASYNC_H__
+#endif
+
+/*
+ * On Unix struct sock_timeval is equivalent to struct timeval.
+ * On Windows built with 64-bit time_t, sock_timeval.tv_sec is a long
+ * as required by Windows' socket() interface timeout argument, while
+ * timeval.tv_sec is time_t for the more common use as a UTC time
+ * within NTP.
+ *
+ * winsock.h unconditionally defines struct timeval with long tv_sec
+ * instead of time_t tv_sec. We redirect its declaration to struct
+ * sock_timeval instead of struct timeval with a #define.
+ */
+#define timeval sock_timeval
+
+/* Include Windows headers */
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+#undef timeval /* see sock_timeval #define and comment above */
+
+/*
+ * Some definitions we are using are missing in the headers
+ * shipping with VC6. However, if the SDK is installed then the
+ * SDK's headers may declare the missing types. This is at least
+ * the case in the Oct 2001 SDK. That SDK and all subsequent
+ * versions also define the symbol _W64, so we can use that one
+ * to determine whether some types need to be defined, or not.
+ */
+#ifdef _W64
+/* VC6 can include wspiapi.h only if the SDK is installed */
+#include <wspiapi.h>
+#endif
+
+#undef interface
+#include <process.h>
+#include <time.h> /* time_t for timeval decl */
+#include <io.h>
+#include <isc/strerror.h>
+
+/* ---------------------------------------------------------------------
+ * Above this line are #include lines and the few #define lines
+ * needed before including headers.
+ */
+
+struct timeval {
+ time_t tv_sec;
+ long tv_usec;
+};
+
+/*
+ * ntohl and friends are actual functions on Windows, use our own
+ * macros instead to save the function call overhead. All releases
+ * of Windows are little-endian.
+ */
+#ifdef ntohl
+#error ntohl is already defined in ports/winnt/include/config.h
+#else
+#define ntohl(ul) (((u_long)(ul) & 0xff) << 24 | \
+ ((u_long)(ul) & 0xff00) << 8 | \
+ ((u_long)(ul) & 0xff0000) >> 8 | \
+ ((u_long)(ul) & 0xff000000) >> 24)
+#define htonl(ul) ntohl(ul)
+#define ntohs(us) ((u_short) \
+ (((u_short)(us) & 0xff) << 8 | \
+ ((u_short)(us) & 0xff00) >> 8))
+#define htons(us) ntohs(us)
+#endif
+
+/*
+ * On Unix open() works for tty (serial) devices just fine, while on
+ * Windows refclock serial devices are opened using CreateFile, a lower
+ * level than the CRT-provided descriptors, because the C runtime lacks
+ * tty APIs. For refclocks which wish to use open() as well as or
+ * instead of refclock_open(), tty_open() is equivalent to open() on
+ * Unix and implemented in the Windows port similarly to
+ * refclock_open().
+ */
+extern int tty_open(char *, int, int);
+
+/*
+ * disable use of __declspec(dllexport) by libisc routines
+ */
+#define ISC_STATIC_WIN 1
+
+/*
+ * ntp_rfc2553.h has cruft under #ifdef SYS_WINNT which is
+ * appropriate for older Microsoft IPv6 definitions, such
+ * as in_addr6 being the struct type. We can differentiate
+ * the RFC2553-compliant newer headers because they have
+ * #define in_addr6 in6_addr
+ * for backward compatibility. With the newer headers,
+ * we define ISC_PLATFORM_HAVEIPV6 and disable the cruft.
+ */
+#ifdef in_addr6
+#define WANT_IPV6
+#define ISC_PLATFORM_HAVEIPV6
+#define ISC_PLATFORM_HAVESCOPEID
+#define HAVE_STRUCT_SOCKADDR_STORAGE
+#define ISC_PLATFORM_HAVEIN6PKTINFO
+#endif /* in_addr6 / RFC2553-compliant IPv6 headers */
+
+#define NO_OPTION_NAME_WARNINGS
+
+#if !defined( _W64 )
+ /*
+ * if ULONG_PTR needs to be defined then the build environment
+ * is pure 32 bit Windows. Since ULONG_PTR and DWORD have
+ * the same size in 32 bit Windows we can safely define
+ * a replacement.
+ */
+typedef DWORD ULONG_PTR;
+/* VC6 doesn't know about socklen_t, except if the SDK is installed */
+typedef int socklen_t;
+#endif /* _W64 */
+
+#define ISC_PLATFORM_NEEDIN6ADDRANY
+#define HAVE_SOCKADDR_IN6
+
+/*
+ * The type of the socklen_t defined for getnameinfo() and getaddrinfo()
+ * is int for VS compilers on Windows but the type is already declared
+ */
+#define GETSOCKNAME_SOCKLEN_TYPE socklen_t
+
+/*
+ * Older SDKs do not define SO_EXCLUSIVEADDRUSE in winsock2.h
+ */
+#ifndef SO_EXCLUSIVEADDRUSE
+#define SO_EXCLUSIVEADDRUSE ((int)(~SO_REUSEADDR))
+#endif
+
+#if defined _MSC_VER && _MSC_VER < 1400
+/*
+ * Use 32-bit time definitions for versions prior to VS 2005
+ * VS 2005 defaults to 64-bit time
+ */
+# define SIZEOF_TIME_T 4
+#else
+# define SIZEOF_TIME_T 8
+#endif
+
+
+/*
+ * An attempt to cut down the number of warnings generated during compilation.
+ * All of these should be benign to disable.
+ */
+
+#pragma warning(disable: 4100) /* unreferenced formal parameter */
+#pragma warning(disable: 4127) /* conditional expression is constant */
+#pragma warning(disable: 4996) /* more secure replacement available */
+
+/*
+ * Windows NT Configuration Values
+ */
+#if defined _DEBUG /* Use VC standard macro definitions */
+# define DEBUG 1
+#endif
+
+#define __windows__ 1
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+#define OPEN_BCAST_SOCKET 1 /* for ntp_io.c */
+#define TYPEOF_IP_MULTICAST_LOOP BOOL
+#define SETSOCKOPT_ARG_CAST (const char *)
+#define HAVE_RANDOM
+#define AUTOKEY
+#define SAVECONFIG 1
+
+/*
+ * Multimedia timer enable
+ */
+#define USE_MM_TIMER
+
+/* Enable OpenSSL */
+#define OPENSSL 1
+
+/*
+ * Keywords and functions that Microsoft maps
+ * to other names
+ */
+#define inline __inline
+#define stricmp _stricmp
+#define strcasecmp _stricmp
+#define isascii __isascii
+#define finite _finite
+#define random rand
+#define srandom srand
+#define fdopen _fdopen
+#define read _read
+#define open _open
+#ifndef close
+#define close _close
+#endif
+#define write _write
+#define strdup _strdup
+#define alloca _alloca
+#define stat _stat /*struct stat from <sys/stat.h> */
+#define fstat _fstat
+#define unlink _unlink
+/*
+ * punt on fchmod on Windows
+ */
+#define fchmod(x,y) {}
+#define lseek _lseek
+#define pipe _pipe
+#define dup2 _dup2
+/*
+ * scale, unix sleep is seconds, Windows Sleep is msec
+ */
+#define sleep(x) Sleep((unsigned)(x) * 1000)
+#define fileno _fileno
+#define isatty _isatty
+#define mktemp _mktemp
+#define getpid _getpid
+#define timegm _mkgmtime
+#define errno_to_str isc__strerror
+
+typedef int pid_t; /* PID is an int */
+typedef int ssize_t; /* ssize is an int */
+
+/*
+ * Map the stream to the file number
+ */
+#define STDOUT_FILENO _fileno(stdout)
+#define STDERR_FILENO _fileno(stderr)
+
+/*
+ * To minimize Windows-specific changes to the rest of the NTP code,
+ * particularly reference clocks, ntp_stdlib.h will
+ *
+ * #define strerror(e) ntp_strerror(e)
+ *
+ * to deal with our mixture of C runtime (open, write) and Windows
+ * (sockets, serial ports) error codes. This is an ugly hack because
+ * both use the lowest values differently, but particularly for ntpd,
+ * it's not a problem.
+ */
+#define NTP_REDEFINE_STRERROR
+
+#define MCAST /* Enable Multicast Support */
+#define MULTICAST_NONEWSOCKET /* Don't create a new socket for mcast address */
+
+# define REFCLOCK /* from ntpd.mak */
+
+/* #define CLOCK_PARSE */
+#define CLOCK_ACTS
+#define CLOCK_ARBITER
+#define CLOCK_ARCRON_MSF
+#define OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER /* timepps.h */
+#define HAVE_TIMEPPS_H
+#define HAVE_PPSAPI
+#define CLOCK_ATOM
+#define CLOCK_CHU
+#define CLOCK_CHRONOLOG
+#define CLOCK_DUMBCLOCK
+#define CLOCK_HOPF_SERIAL /* device 38, hopf DCF77/GPS serial line receiver */
+#define CLOCK_HOPF_PCI /* device 39, hopf DCF77/GPS PCI-Bus receiver */
+#define CLOCK_JUPITER
+#define CLOCK_LOCAL
+#define CLOCK_NMEA
+#define CLOCK_ONCORE
+#define CLOCK_PALISADE /* from ntpd.mak */
+#define CLOCK_PARSE
+/* parse component drivers */
+#define CLOCK_COMPUTIME
+#define CLOCK_DCF7000
+#define CLOCK_HOPF6021
+#define CLOCK_MEINBERG
+#define CLOCK_RAWDCF
+#define CLOCK_RCC8000
+#define CLOCK_SCHMID
+#define CLOCK_TRIMTAIP
+#define CLOCK_TRIMTSIP
+#define CLOCK_VARITEXT
+#define CLOCK_WHARTON_400A
+/* end parse component drivers */
+/* # define CLOCK_SHM */
+#define CLOCK_SPECTRACOM /* refclock_wwvb.c */
+#define CLOCK_TRIMBLEDC
+#define CLOCK_TRUETIME
+
+#define NTP_LITTLE_ENDIAN /* from libntp.mak */
+#define NTP_POSIX_SOURCE
+
+#define SYSLOG_FILE /* from libntp.mak */
+
+#define HAVE_LONG_LONG_INT 1
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+#define HAVE_SIZE_T 1
+#define HAVE_PTRDIFF_T 1
+
+# define SIZEOF_SIGNED_CHAR 1
+# define SIZEOF_SHORT 2
+# define SIZEOF_INT 4
+# define SIZEOF_LONG 4
+# define SIZEOF_LONG_LONG 8
+
+/* libntp/snprintf.c doesn't know %I64d */
+#define ISC_PLATFORM_QUADFORMAT "ll"
+
+# define HAVE_ERRNO_H 1
+# define HAVE_FCNTL_H 1
+# define HAVE_LIMITS_H 1
+# define HAVE_STDARG_H 1
+# define HAVE_SYS_RESOURCE_H 1
+# define HAVE_SYS_TIME_H 1
+# define HAVE_TERMIOS_H 1
+
+# define HAVE_ALLOCA 1
+# define HAVE_GETCLOCK 1
+# define HAVE_MEMMOVE 1
+# define HAVE_MKTIME 1
+# define HAVE_SETVBUF 1
+# define HAVE_STRCHR 1 /* for libopts */
+# define HAVE_STRDUP 1
+# define HAVE_TIMEGM 1 /* actually _mkgmtime */
+
+# define HAVE_STRUCT_TIMESPEC
+# define HAVE_IO_COMPLETION_PORT
+# define ISC_PLATFORM_NEEDNTOP
+# define ISC_PLATFORM_NEEDPTON
+
+#define HAVE_BSD_NICE /* emulate BSD setpriority() */
+
+#define HW_WANT_RPL_VSNPRINTF 1
+#define vsnprintf rpl_vsnprintf
+#include <stdarg.h>
+int rpl_vsnprintf(char *, size_t, const char *, va_list);
+#define HW_WANT_RPL_SNPRINTF 1
+#define snprintf rpl_snprintf
+int rpl_snprintf(char *, size_t, const char *, ...);
+#define HAVE_VSNPRINTF 1
+#define HAVE_SNPRINTF 1
+
+typedef char *caddr_t;
+
+#ifdef _WCTYPE_T_DEFINED /* see vc/include/crtdefs.h */
+#define HAVE_WINT_T 1
+#endif
+
+#ifndef _INTPTR_T_DEFINED
+typedef long intptr_t;
+#define _INTPTR_T_DEFINED
+#endif
+#define HAVE_INTPTR_T 1
+
+#ifndef _UINTPTR_T_DEFINED
+typedef unsigned long uintptr_t;
+#define _UINTPTR_T_DEFINED
+#endif
+#define HAVE_UINTPTR_T 1
+
+#if !defined( _W64 )
+ /*
+ * if DWORD_PTR needs to be defined then the build environment
+ * is pure 32 bit Windows. Since DWORD_PTR and DWORD have
+ * the same size in 32 bit Windows we can safely define
+ * a replacement.
+ */
+ typedef DWORD DWORD_PTR;
+#endif
+
+#define NEED_S_CHAR_TYPEDEF
+
+
+/* C99 exact size integer support. */
+#if defined(_MSC_VER) && _MSC_VER<1800
+# define MISSING_INTTYPES_H 1 /* not provided by VS2012 and earlier */
+# define MISSING_STDBOOL_H 1 /* not provided by VS2012 and earlier */
+#else
+#if defined(_MSC_VER) && _MSC_VER>=1800
+/* VS2013 and above support C99 types */
+# define HAVE_INT8_T 1
+# define HAVE_UINT8_T 1
+# define HAVE_INT16_T 1
+# define HAVE_UINT16_T 1
+# define HAVE_INT32_T 1
+# define HAVE_UINT32_T 1
+#endif
+#endif
+
+#if !defined (MISSING_STDBOOL_H)
+# define HAVE_STDBOOL_H
+#endif
+#if !defined(MISSING_INTTYPES_H)
+# define HAVE_INTTYPES_H 1
+#elif !defined(MISSING_STDINT_H)
+# define HAVE_STDINT_H 1
+#elif !defined(ADDED_EXACT_SIZE_INTEGERS)
+# define ADDED_EXACT_SIZE_INTEGERS 1
+ typedef __int8 int8_t;
+ typedef unsigned __int8 uint8_t;
+
+ typedef __int16 int16_t;
+ typedef unsigned __int16 uint16_t;
+
+ typedef __int32 int32_t;
+ typedef unsigned __int32 uint32_t;
+
+ typedef __int64 int64_t;
+ typedef unsigned __int64 uint64_t;
+#endif
+
+
+/* Directory separator, usually / or \ */
+#define DIR_SEP '\\'
+
+#define POSIX_SHELL "/bin/sh" /* libopts/makeshell.c */
+
+#define ULONG_CONST(a) a ## UL
+
+#define NOKMEM
+#define RETSIGTYPE void
+
+#ifndef STR_SYSTEM
+#define STR_SYSTEM "Windows"
+#endif
+
+#ifndef STR_PROCESSOR
+
+#define STRINGIZE(arg) #arg
+
+#ifdef _M_IX86
+#ifndef _M_IX86_FP
+#define STR_PROCESSOR "x86"
+#else
+#if !_M_IX86_FP
+#define STR_PROCESSOR "x86"
+#else
+#if _M_IX86_FP > 2
+#define STR_PROCESSOR "x86-FP-" STRINGIZE(_M_IX86_FP)
+#else
+#if _M_IX86_FP == 2
+#define STR_PROCESSOR "x86-SSE2"
+#else
+#define STR_PROCESSOR "x86-SSE"
+#endif /* _M_IX86 == 2 */
+#endif /* _M_IX86_FP > 2 */
+#endif /* !_M_IX86_FP */
+#endif /* !defined(_M_IX86_FP) */
+#endif /* !defined(_M_IX86) */
+
+#ifdef _M_IA64
+#define STR_PROCESSOR "Itanium"
+#endif
+
+#ifdef _M_X64
+#define STR_PROCESSOR "x64"
+#endif
+
+#endif /* !defined(STR_PROCESSOR) */
+
+#undef STRINGIZE
+
+#define SIOCGIFFLAGS SIO_GET_INTERFACE_LIST /* used in ntp_io.c */
+/*
+ * Below this line are includes which must happen after the bulk of
+ * config.h is processed. If you need to add another #include to this
+ * file the preferred location is near the top, above the similar
+ * line of hyphens.
+ * ---------------------------------------------------------------------
+ */
+
+/*
+ * Include standard stat information
+ */
+#include <isc/stat.h>
+
+#endif /* CONFIG_H */
diff --git a/ports/winnt/include/gaa_compat.h b/ports/winnt/include/gaa_compat.h
new file mode 100644
index 0000000..fdacaf0
--- /dev/null
+++ b/ports/winnt/include/gaa_compat.h
@@ -0,0 +1,771 @@
+/*
+ * ports/winnt/include/gaa_compat.h
+ *
+ * This header allows systems without a recent-enough SDK to build NTP
+ * which can use GetAdaptersAddresses(), related functions and macros.
+ */
+#ifndef GAA_COMPAT_H
+#define GAA_COMPAT_H
+
+#ifdef _W64
+# include <iphlpapi.h>
+#else /* !_W64 follows */
+
+#pragma warning(push)
+/* warning C4201: nonstandard extension used : nameless struct/union */
+#pragma warning(disable:4201)
+/* warning C4214: nonstandard extension used : bit field types other than int */
+#pragma warning(disable:4214)
+
+/* +++++++++++++++++++++++ from nldef.h */
+typedef enum {
+ //
+ // These values are from iptypes.h.
+ // They need to fit in a 4 bit field.
+ //
+ IpPrefixOriginOther = 0,
+ IpPrefixOriginManual,
+ IpPrefixOriginWellKnown,
+ IpPrefixOriginDhcp,
+ IpPrefixOriginRouterAdvertisement,
+ IpPrefixOriginUnchanged = 1 << 4
+} NL_PREFIX_ORIGIN;
+
+typedef enum {
+ //
+ // These values are from in iptypes.h.
+ // They need to fit in a 4 bit field.
+ //
+ IpSuffixOriginOther = 0,
+ IpSuffixOriginManual,
+ IpSuffixOriginWellKnown,
+ IpSuffixOriginDhcp,
+ IpSuffixOriginLinkLayerAddress,
+ IpSuffixOriginRandom,
+ IpSuffixOriginUnchanged = 1 << 4
+} NL_SUFFIX_ORIGIN;
+
+typedef enum {
+ //
+ // These values are from in iptypes.h.
+ //
+ IpDadStateInvalid = 0,
+ IpDadStateTentative,
+ IpDadStateDuplicate,
+ IpDadStateDeprecated,
+ IpDadStatePreferred,
+} NL_DAD_STATE;
+/* +++++++++++++++++++++++ from nldef.h */
+
+
+/* +++++++++++++++++++++++ from ifdef.h */
+typedef ULONG32 NET_IF_OBJECT_ID, *PNET_IF_OBJECT_ID;
+
+
+typedef enum _NET_IF_ADMIN_STATUS // ifAdminStatus
+{
+ NET_IF_ADMIN_STATUS_UP = 1,
+ NET_IF_ADMIN_STATUS_DOWN = 2,
+ NET_IF_ADMIN_STATUS_TESTING = 3
+} NET_IF_ADMIN_STATUS, *PNET_IF_ADMIN_STATUS;
+
+typedef enum _NET_IF_OPER_STATUS // ifOperStatus
+{
+ NET_IF_OPER_STATUS_UP = 1,
+ NET_IF_OPER_STATUS_DOWN = 2,
+ NET_IF_OPER_STATUS_TESTING = 3,
+ NET_IF_OPER_STATUS_UNKNOWN = 4,
+ NET_IF_OPER_STATUS_DORMANT = 5,
+ NET_IF_OPER_STATUS_NOT_PRESENT = 6,
+ NET_IF_OPER_STATUS_LOWER_LAYER_DOWN = 7
+} NET_IF_OPER_STATUS, *PNET_IF_OPER_STATUS;
+
+//
+// Flags to extend operational status
+//
+#define NET_IF_OPER_STATUS_DOWN_NOT_AUTHENTICATED 0x00000001
+#define NET_IF_OPER_STATUS_DOWN_NOT_MEDIA_CONNECTED 0x00000002
+#define NET_IF_OPER_STATUS_DORMANT_PAUSED 0x00000004
+#define NET_IF_OPER_STATUS_DORMANT_LOW_POWER 0x00000008
+
+typedef UINT32 NET_IF_COMPARTMENT_ID, *PNET_IF_COMPARTMENT_ID;
+
+//
+// Define compartment ID type:
+//
+#define NET_IF_COMPARTMENT_ID_UNSPECIFIED (NET_IF_COMPARTMENT_ID)0
+#define NET_IF_COMPARTMENT_ID_PRIMARY (NET_IF_COMPARTMENT_ID)1
+
+#define NET_IF_OID_IF_ALIAS 0x00000001 // identifies the ifAlias string for an interface
+#define NET_IF_OID_COMPARTMENT_ID 0x00000002 // identifies the compartment ID for an interface.
+#define NET_IF_OID_NETWORK_GUID 0x00000003 // identifies the NetworkGuid for an interface.
+#define NET_IF_OID_IF_ENTRY 0x00000004 // identifies statistics for an interface.
+
+//
+// Define NetworkGUID type:
+//
+typedef GUID NET_IF_NETWORK_GUID, *PNET_IF_NETWORK_GUID;
+
+//
+// Define macros for an "unspecified" NetworkGUID value to be used in structures
+// that haven't had the NET_LUID field filled in yet.
+//
+#define NET_SET_UNSPECIFIED_NETWORK_GUID(_pNetworkGuid)
+#define NET_IS_UNSPECIFIED_NETWORK_GUID(_NetworkGuidValue)
+
+//
+// To prevent collisions between user-assigned and system-assigend site-ids,
+// we partition the site-id space into two:
+// 1. User-Assigned: NET_SITEID_UNSPECIFIED < SiteId < NET_SITEID_MAXUSER
+// 2. System-Assigned: NET_SITEID_MAXUSER < SiteId < NET_SITEID_MAXSYSTEM
+//
+// Note: A network's SiteId doesn't really need to be settable.
+// 1. The network profile manager creates a network per network profile.
+// 2. NDIS/IF assigns a unique SiteId to each network.
+//
+#define NET_SITEID_UNSPECIFIED (0)
+#define NET_SITEID_MAXUSER (0x07ffffff)
+#define NET_SITEID_MAXSYSTEM (0x0fffffff)
+C_ASSERT(NET_SITEID_MAXUSER < NET_SITEID_MAXSYSTEM);
+
+typedef enum _NET_IF_RCV_ADDRESS_TYPE // ifRcvAddressType
+{
+ NET_IF_RCV_ADDRESS_TYPE_OTHER = 1,
+ NET_IF_RCV_ADDRESS_TYPE_VOLATILE = 2,
+ NET_IF_RCV_ADDRESS_TYPE_NON_VOLATILE = 3
+} NET_IF_RCV_ADDRESS_TYPE, *PNET_IF_RCV_ADDRESS_TYPE;
+
+typedef struct _NET_IF_RCV_ADDRESS_LH
+{
+ NET_IF_RCV_ADDRESS_TYPE ifRcvAddressType;
+ USHORT ifRcvAddressLength;
+ USHORT ifRcvAddressOffset; // from beginning of this struct
+} NET_IF_RCV_ADDRESS_LH, *PNET_IF_RCV_ADDRESS_LH;
+
+typedef struct _NET_IF_ALIAS_LH
+{
+ USHORT ifAliasLength; // in bytes, of ifAlias string
+ USHORT ifAliasOffset; // in bytes, from beginning of this struct
+} NET_IF_ALIAS_LH, *PNET_IF_ALIAS_LH;
+
+#pragma warning(push)
+#pragma warning(disable:4214) // bit field types other than int
+typedef union _NET_LUID_LH
+{
+ ULONG64 Value;
+ struct
+ {
+ ULONG64 Reserved:24;
+ ULONG64 NetLuidIndex:24;
+ ULONG64 IfType:16; // equal to IANA IF type
+ }Info;
+} NET_LUID_LH, *PNET_LUID_LH;
+#pragma warning(pop)
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef NET_IF_RCV_ADDRESS_LH NET_IF_RCV_ADDRESS;
+typedef NET_IF_RCV_ADDRESS* PNET_IF_RCV_ADDRESS;
+
+typedef NET_IF_ALIAS_LH NET_IF_ALIAS;
+typedef NET_IF_ALIAS* PNET_IF_ALIAS;
+#endif //NTDDI_LONGHORN
+
+//
+// Need to make this visible on all platforms (for the purpose of IF_LUID).
+//
+typedef NET_LUID_LH NET_LUID;
+typedef NET_LUID* PNET_LUID;
+
+//
+// IF_LUID
+//
+// Define the locally unique datalink interface identifier type.
+// This type is persistable.
+//
+typedef NET_LUID IF_LUID, *PIF_LUID;
+
+typedef ULONG NET_IFINDEX, *PNET_IFINDEX; // Interface Index (ifIndex)
+typedef UINT16 NET_IFTYPE, *PNET_IFTYPE; // Interface Type (IANA ifType)
+
+#define NET_IFINDEX_UNSPECIFIED (NET_IFINDEX)(0) // Not a valid ifIndex
+#define NET_IFLUID_UNSPECIFIED (0) // Not a valid if Luid
+
+//
+// Definitions for NET_IF_INFORMATION.Flags
+//
+#define NIIF_HARDWARE_INTERFACE 0x00000001 // Set iff hardware
+#define NIIF_FILTER_INTERFACE 0x00000002
+#define NIIF_NDIS_RESERVED1 0x00000004
+#define NIIF_NDIS_RESERVED2 0x00000008
+#define NIIF_NDIS_RESERVED3 0x00000010
+#define NIIF_NDIS_WDM_INTERFACE 0x00000020
+#define NIIF_NDIS_ENDPOINT_INTERFACE 0x00000040
+
+#define NIIF_WAN_TUNNEL_TYPE_UNKNOWN ((ULONG)(-1))
+
+//
+// Define datalink interface access types.
+//
+typedef enum _NET_IF_ACCESS_TYPE
+{
+ NET_IF_ACCESS_LOOPBACK = 1,
+ NET_IF_ACCESS_BROADCAST = 2,
+ NET_IF_ACCESS_POINT_TO_POINT = 3,
+ NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4,
+ NET_IF_ACCESS_MAXIMUM = 5
+} NET_IF_ACCESS_TYPE, *PNET_IF_ACCESS_TYPE;
+
+
+//
+// Define datalink interface direction types.
+//
+typedef enum _NET_IF_DIRECTION_TYPE
+{
+ NET_IF_DIRECTION_SENDRECEIVE,
+ NET_IF_DIRECTION_SENDONLY,
+ NET_IF_DIRECTION_RECEIVEONLY,
+ NET_IF_DIRECTION_MAXIMUM
+} NET_IF_DIRECTION_TYPE, *PNET_IF_DIRECTION_TYPE;
+
+
+typedef enum _NET_IF_CONNECTION_TYPE
+{
+ NET_IF_CONNECTION_DEDICATED = 1,
+ NET_IF_CONNECTION_PASSIVE = 2,
+ NET_IF_CONNECTION_DEMAND = 3,
+ NET_IF_CONNECTION_MAXIMUM = 4
+} NET_IF_CONNECTION_TYPE, *PNET_IF_CONNECTION_TYPE;
+
+
+typedef enum _NET_IF_MEDIA_CONNECT_STATE
+{
+ MediaConnectStateUnknown,
+ MediaConnectStateConnected,
+ MediaConnectStateDisconnected
+} NET_IF_MEDIA_CONNECT_STATE, *PNET_IF_MEDIA_CONNECT_STATE;
+
+#define NET_IF_LINK_SPEED_UNKNOWN ((ULONG64)(-1))
+
+//
+// Defines the duplex state of media
+//
+typedef enum _NET_IF_MEDIA_DUPLEX_STATE
+{
+ MediaDuplexStateUnknown,
+ MediaDuplexStateHalf,
+ MediaDuplexStateFull
+} NET_IF_MEDIA_DUPLEX_STATE, *PNET_IF_MEDIA_DUPLEX_STATE;
+
+
+// Special values for fields in NET_PHYSICAL_LOCATION
+#define NIIF_BUS_NUMBER_UNKNOWN ((ULONG)(-1))
+#define NIIF_SLOT_NUMBER_UNKNOWN ((ULONG)(-1))
+#define NIIF_FUNCTION_NUMBER_UNKNOWN ((ULONG)(-1))
+
+typedef struct _NET_PHYSICAL_LOCATION_LH
+{
+ ULONG BusNumber; // Physical location
+ ULONG SlotNumber; // ... for hardware
+ ULONG FunctionNumber; // ... devices.
+} NET_PHYSICAL_LOCATION_LH, *PNET_PHYSICAL_LOCATION_LH;
+
+//
+// maximum string size in -wchar- units
+//
+#define IF_MAX_STRING_SIZE 256
+
+typedef struct _IF_COUNTED_STRING_LH
+{
+ USHORT Length; // in -Bytes-
+ WCHAR String[IF_MAX_STRING_SIZE + 1];
+} IF_COUNTED_STRING_LH, *PIF_COUNTED_STRING_LH;
+
+#define IF_MAX_PHYS_ADDRESS_LENGTH 32
+
+typedef struct _IF_PHYSICAL_ADDRESS_LH
+{
+ USHORT Length;
+ UCHAR Address[IF_MAX_PHYS_ADDRESS_LENGTH];
+} IF_PHYSICAL_ADDRESS_LH, *PIF_PHYSICAL_ADDRESS_LH;
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef NET_PHYSICAL_LOCATION_LH NET_PHYSICAL_LOCATION;
+typedef NET_PHYSICAL_LOCATION* PNET_PHYSICAL_LOCATION;
+
+typedef IF_COUNTED_STRING_LH IF_COUNTED_STRING;
+typedef IF_COUNTED_STRING* PIF_COUNTED_STRING;
+
+typedef IF_PHYSICAL_ADDRESS_LH IF_PHYSICAL_ADDRESS;
+typedef IF_PHYSICAL_ADDRESS* PIF_PHYSICAL_ADDRESS;
+#endif
+
+
+//
+// IF_INDEX
+//
+// Define the interface index type.
+// This type is not persistable.
+// This must be unsigned (not an enum) to replace previous uses of
+// an index that used a DWORD type.
+//
+
+typedef NET_IFINDEX IF_INDEX, *PIF_INDEX;
+#define IFI_UNSPECIFIED NET_IFINDEX_UNSPECIFIED
+
+
+//
+// Get definitions for IFTYPE and IF_ACCESS_TYPE.
+//
+#include <ipifcons.h>
+
+
+//
+// Types of tunnels (sub-type of IF_TYPE when IF_TYPE is IF_TYPE_TUNNEL).
+// See http://www.iana.org/assignments/ianaiftype-mib.
+//
+typedef enum {
+ TUNNEL_TYPE_NONE = 0,
+ TUNNEL_TYPE_OTHER = 1,
+ TUNNEL_TYPE_DIRECT = 2,
+ TUNNEL_TYPE_6TO4 = 11,
+ TUNNEL_TYPE_ISATAP = 13,
+ TUNNEL_TYPE_TEREDO = 14,
+} TUNNEL_TYPE, *PTUNNEL_TYPE;
+
+//
+// IF_ADMINISTRATIVE_STATE
+//
+// Datalink Interface Administrative State.
+// Indicates whether the interface has been administratively enabled.
+//
+
+typedef enum _IF_ADMINISTRATIVE_STATE {
+ IF_ADMINISTRATIVE_DISABLED,
+ IF_ADMINISTRATIVE_ENABLED,
+ IF_ADMINISTRATIVE_DEMANDDIAL,
+} IF_ADMINISTRATIVE_STATE, *PIF_ADMINISTRATIVE_STATE;
+
+
+//
+// Note: Interface is Operational iff
+// ((MediaSense is Connected) and (AdministrativeState is Enabled))
+// or
+// ((MediaSense is Connected) and (AdministrativeState is OnDemand))
+//
+// !Operational iff
+// ((MediaSense != Connected) or (AdministrativeState is Disabled))
+//
+
+//
+// OperStatus values from RFC 2863
+//
+typedef enum {
+ IfOperStatusUp = 1,
+ IfOperStatusDown,
+ IfOperStatusTesting,
+ IfOperStatusUnknown,
+ IfOperStatusDormant,
+ IfOperStatusNotPresent,
+ IfOperStatusLowerLayerDown
+} IF_OPER_STATUS;
+/* +++++++++++++++++++++++ from ifdef.h */
+
+
+/* +++++++++++++++++++++++ from iptypes.h */
+// Definitions and structures used by getnetworkparams and getadaptersinfo apis
+
+#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 // arb.
+#define MAX_ADAPTER_NAME_LENGTH 256 // arb.
+#define MAX_ADAPTER_ADDRESS_LENGTH 8 // arb.
+#define DEFAULT_MINIMUM_ENTITIES 32 // arb.
+#define MAX_HOSTNAME_LEN 128 // arb.
+#define MAX_DOMAIN_NAME_LEN 128 // arb.
+#define MAX_SCOPE_ID_LEN 256 // arb.
+#define MAX_DHCPV6_DUID_LENGTH 130 // RFC 3315.
+
+//
+// types
+//
+
+// Node Type
+
+#define BROADCAST_NODETYPE 1
+#define PEER_TO_PEER_NODETYPE 2
+#define MIXED_NODETYPE 4
+#define HYBRID_NODETYPE 8
+
+//
+// IP_ADDRESS_STRING - store an IP address as a dotted decimal string
+//
+
+typedef struct {
+ char String[4 * 4];
+} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
+
+//
+// IP_ADDR_STRING - store an IP address with its corresponding subnet mask,
+// both as dotted decimal strings
+//
+
+typedef struct _IP_ADDR_STRING {
+ struct _IP_ADDR_STRING* Next;
+ IP_ADDRESS_STRING IpAddress;
+ IP_MASK_STRING IpMask;
+ DWORD Context;
+} IP_ADDR_STRING, *PIP_ADDR_STRING;
+
+//
+// ADAPTER_INFO - per-adapter information. All IP addresses are stored as
+// strings
+//
+
+typedef struct _IP_ADAPTER_INFO {
+ struct _IP_ADAPTER_INFO* Next;
+ DWORD ComboIndex;
+ char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
+ char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
+ UINT AddressLength;
+ BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
+ DWORD Index;
+ UINT Type;
+ UINT DhcpEnabled;
+ PIP_ADDR_STRING CurrentIpAddress;
+ IP_ADDR_STRING IpAddressList;
+ IP_ADDR_STRING GatewayList;
+ IP_ADDR_STRING DhcpServer;
+ BOOL HaveWins;
+ IP_ADDR_STRING PrimaryWinsServer;
+ IP_ADDR_STRING SecondaryWinsServer;
+ time_t LeaseObtained;
+ time_t LeaseExpires;
+} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
+
+#ifdef _WINSOCK2API_
+
+//
+// The following types require Winsock2.
+//
+
+typedef NL_PREFIX_ORIGIN IP_PREFIX_ORIGIN;
+typedef NL_SUFFIX_ORIGIN IP_SUFFIX_ORIGIN;
+typedef NL_DAD_STATE IP_DAD_STATE;
+
+typedef struct _IP_ADAPTER_UNICAST_ADDRESS_LH {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Flags;
+ };
+ };
+ struct _IP_ADAPTER_UNICAST_ADDRESS_LH *Next;
+ SOCKET_ADDRESS Address;
+
+ IP_PREFIX_ORIGIN PrefixOrigin;
+ IP_SUFFIX_ORIGIN SuffixOrigin;
+ IP_DAD_STATE DadState;
+
+ ULONG ValidLifetime;
+ ULONG PreferredLifetime;
+ ULONG LeaseLifetime;
+ UINT8 OnLinkPrefixLength;
+} IP_ADAPTER_UNICAST_ADDRESS_LH,
+ *PIP_ADAPTER_UNICAST_ADDRESS_LH;
+
+typedef struct _IP_ADAPTER_UNICAST_ADDRESS_XP {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Flags;
+ };
+ };
+ struct _IP_ADAPTER_UNICAST_ADDRESS_XP *Next;
+ SOCKET_ADDRESS Address;
+
+ IP_PREFIX_ORIGIN PrefixOrigin;
+ IP_SUFFIX_ORIGIN SuffixOrigin;
+ IP_DAD_STATE DadState;
+
+ ULONG ValidLifetime;
+ ULONG PreferredLifetime;
+ ULONG LeaseLifetime;
+} IP_ADAPTER_UNICAST_ADDRESS_XP, *PIP_ADAPTER_UNICAST_ADDRESS_XP;
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef IP_ADAPTER_UNICAST_ADDRESS_LH IP_ADAPTER_UNICAST_ADDRESS;
+typedef IP_ADAPTER_UNICAST_ADDRESS_LH *PIP_ADAPTER_UNICAST_ADDRESS;
+#elif (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_UNICAST_ADDRESS_XP IP_ADAPTER_UNICAST_ADDRESS;
+typedef IP_ADAPTER_UNICAST_ADDRESS_XP *PIP_ADAPTER_UNICAST_ADDRESS;
+#endif
+
+//
+// Bit values of IP_ADAPTER_UNICAST_ADDRESS Flags field.
+//
+#define IP_ADAPTER_ADDRESS_DNS_ELIGIBLE 0x01
+#define IP_ADAPTER_ADDRESS_TRANSIENT 0x02
+
+typedef struct _IP_ADAPTER_ANYCAST_ADDRESS_XP {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Flags;
+ };
+ };
+ struct _IP_ADAPTER_ANYCAST_ADDRESS_XP *Next;
+ SOCKET_ADDRESS Address;
+} IP_ADAPTER_ANYCAST_ADDRESS_XP, *PIP_ADAPTER_ANYCAST_ADDRESS_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_ANYCAST_ADDRESS_XP IP_ADAPTER_ANYCAST_ADDRESS;
+typedef IP_ADAPTER_ANYCAST_ADDRESS_XP *PIP_ADAPTER_ANYCAST_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_MULTICAST_ADDRESS_XP {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Flags;
+ };
+ };
+ struct _IP_ADAPTER_MULTICAST_ADDRESS_XP *Next;
+ SOCKET_ADDRESS Address;
+} IP_ADAPTER_MULTICAST_ADDRESS_XP, *PIP_ADAPTER_MULTICAST_ADDRESS_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_MULTICAST_ADDRESS_XP IP_ADAPTER_MULTICAST_ADDRESS;
+typedef IP_ADAPTER_MULTICAST_ADDRESS_XP *PIP_ADAPTER_MULTICAST_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Reserved;
+ };
+ };
+ struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP *Next;
+ SOCKET_ADDRESS Address;
+} IP_ADAPTER_DNS_SERVER_ADDRESS_XP, *PIP_ADAPTER_DNS_SERVER_ADDRESS_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_DNS_SERVER_ADDRESS_XP IP_ADAPTER_DNS_SERVER_ADDRESS;
+typedef IP_ADAPTER_DNS_SERVER_ADDRESS_XP *PIP_ADAPTER_DNS_SERVER_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Reserved;
+ };
+ };
+ struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH *Next;
+ SOCKET_ADDRESS Address;
+} IP_ADAPTER_WINS_SERVER_ADDRESS_LH, *PIP_ADAPTER_WINS_SERVER_ADDRESS_LH;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH IP_ADAPTER_WINS_SERVER_ADDRESS;
+typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH *PIP_ADAPTER_WINS_SERVER_ADDRESS;
+#endif
+
+
+typedef struct _IP_ADAPTER_GATEWAY_ADDRESS_LH {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Reserved;
+ };
+ };
+ struct _IP_ADAPTER_GATEWAY_ADDRESS_LH *Next;
+ SOCKET_ADDRESS Address;
+} IP_ADAPTER_GATEWAY_ADDRESS_LH, *PIP_ADAPTER_GATEWAY_ADDRESS_LH;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef IP_ADAPTER_GATEWAY_ADDRESS_LH IP_ADAPTER_GATEWAY_ADDRESS;
+typedef IP_ADAPTER_GATEWAY_ADDRESS_LH *PIP_ADAPTER_GATEWAY_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_PREFIX_XP {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD Flags;
+ };
+ };
+ struct _IP_ADAPTER_PREFIX_XP *Next;
+ SOCKET_ADDRESS Address;
+ ULONG PrefixLength;
+} IP_ADAPTER_PREFIX_XP, *PIP_ADAPTER_PREFIX_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_PREFIX_XP IP_ADAPTER_PREFIX;
+typedef IP_ADAPTER_PREFIX_XP *PIP_ADAPTER_PREFIX;
+#endif
+
+//
+// Bit values of IP_ADAPTER_ADDRESSES Flags field.
+//
+#define IP_ADAPTER_DDNS_ENABLED 0x00000001
+#define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x00000002
+#define IP_ADAPTER_DHCP_ENABLED 0x00000004
+#define IP_ADAPTER_RECEIVE_ONLY 0x00000008
+#define IP_ADAPTER_NO_MULTICAST 0x00000010
+#define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x00000020
+#define IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED 0x00000040
+#define IP_ADAPTER_IPV4_ENABLED 0x00000080
+#define IP_ADAPTER_IPV6_ENABLED 0x00000100
+
+typedef struct _IP_ADAPTER_ADDRESSES_LH {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ IF_INDEX IfIndex;
+ };
+ };
+ struct _IP_ADAPTER_ADDRESSES_LH *Next;
+ PCHAR AdapterName;
+ PIP_ADAPTER_UNICAST_ADDRESS_LH FirstUnicastAddress;
+ PIP_ADAPTER_ANYCAST_ADDRESS_XP FirstAnycastAddress;
+ PIP_ADAPTER_MULTICAST_ADDRESS_XP FirstMulticastAddress;
+ PIP_ADAPTER_DNS_SERVER_ADDRESS_XP FirstDnsServerAddress;
+ PWCHAR DnsSuffix;
+ PWCHAR Description;
+ PWCHAR FriendlyName;
+ BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
+ ULONG PhysicalAddressLength;
+ union {
+ ULONG Flags;
+ struct {
+ ULONG DdnsEnabled : 1;
+ ULONG RegisterAdapterSuffix : 1;
+ ULONG Dhcpv4Enabled : 1;
+ ULONG ReceiveOnly : 1;
+ ULONG NoMulticast : 1;
+ ULONG Ipv6OtherStatefulConfig : 1;
+ ULONG NetbiosOverTcpipEnabled : 1;
+ ULONG Ipv4Enabled : 1;
+ ULONG Ipv6Enabled : 1;
+ ULONG Ipv6ManagedAddressConfigurationSupported : 1;
+ };
+ };
+ ULONG Mtu;
+ IFTYPE IfType;
+ IF_OPER_STATUS OperStatus;
+ IF_INDEX Ipv6IfIndex;
+ ULONG ZoneIndices[16];
+ PIP_ADAPTER_PREFIX_XP FirstPrefix;
+
+ ULONG64 TransmitLinkSpeed;
+ ULONG64 ReceiveLinkSpeed;
+ PIP_ADAPTER_WINS_SERVER_ADDRESS_LH FirstWinsServerAddress;
+ PIP_ADAPTER_GATEWAY_ADDRESS_LH FirstGatewayAddress;
+ ULONG Ipv4Metric;
+ ULONG Ipv6Metric;
+ IF_LUID Luid;
+ SOCKET_ADDRESS Dhcpv4Server;
+ NET_IF_COMPARTMENT_ID CompartmentId;
+ NET_IF_NETWORK_GUID NetworkGuid;
+ NET_IF_CONNECTION_TYPE ConnectionType;
+ TUNNEL_TYPE TunnelType;
+ //
+ // DHCP v6 Info.
+ //
+ SOCKET_ADDRESS Dhcpv6Server;
+ BYTE Dhcpv6ClientDuid[MAX_DHCPV6_DUID_LENGTH];
+ ULONG Dhcpv6ClientDuidLength;
+ ULONG Dhcpv6Iaid;
+} IP_ADAPTER_ADDRESSES_LH,
+ *PIP_ADAPTER_ADDRESSES_LH;
+
+typedef struct _IP_ADAPTER_ADDRESSES_XP {
+ union {
+ ULONGLONG Alignment;
+ struct {
+ ULONG Length;
+ DWORD IfIndex;
+ };
+ };
+ struct _IP_ADAPTER_ADDRESSES_XP *Next;
+ PCHAR AdapterName;
+ PIP_ADAPTER_UNICAST_ADDRESS_XP FirstUnicastAddress;
+ PIP_ADAPTER_ANYCAST_ADDRESS_XP FirstAnycastAddress;
+ PIP_ADAPTER_MULTICAST_ADDRESS_XP FirstMulticastAddress;
+ PIP_ADAPTER_DNS_SERVER_ADDRESS_XP FirstDnsServerAddress;
+ PWCHAR DnsSuffix;
+ PWCHAR Description;
+ PWCHAR FriendlyName;
+ BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
+ DWORD PhysicalAddressLength;
+ DWORD Flags;
+ DWORD Mtu;
+ DWORD IfType;
+ IF_OPER_STATUS OperStatus;
+ DWORD Ipv6IfIndex;
+ DWORD ZoneIndices[16];
+ PIP_ADAPTER_PREFIX_XP FirstPrefix;
+} IP_ADAPTER_ADDRESSES_XP,
+ *PIP_ADAPTER_ADDRESSES_XP;
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef IP_ADAPTER_ADDRESSES_LH IP_ADAPTER_ADDRESSES;
+typedef IP_ADAPTER_ADDRESSES_LH *PIP_ADAPTER_ADDRESSES;
+#elif (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_ADDRESSES_XP IP_ADAPTER_ADDRESSES;
+typedef IP_ADAPTER_ADDRESSES_XP *PIP_ADAPTER_ADDRESSES;
+#else
+//
+// For platforms other platforms that are including
+// the file but not using the types.
+//
+typedef IP_ADAPTER_ADDRESSES_XP IP_ADAPTER_ADDRESSES;
+typedef IP_ADAPTER_ADDRESSES_XP *PIP_ADAPTER_ADDRESSES;
+#endif
+
+
+//
+// Flags used as argument to GetAdaptersAddresses().
+// "SKIP" flags are added when the default is to include the information.
+// "INCLUDE" flags are added when the default is to skip the information.
+//
+#define GAA_FLAG_SKIP_UNICAST 0x0001
+#define GAA_FLAG_SKIP_ANYCAST 0x0002
+#define GAA_FLAG_SKIP_MULTICAST 0x0004
+#define GAA_FLAG_SKIP_DNS_SERVER 0x0008
+#define GAA_FLAG_INCLUDE_PREFIX 0x0010
+#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020
+#define GAA_FLAG_INCLUDE_WINS_INFO 0x0040
+#define GAA_FLAG_INCLUDE_GATEWAYS 0x0080
+#define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x0100
+#define GAA_FLAG_INCLUDE_ALL_COMPARTMENTS 0x0200
+#define GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER 0x0400
+
+#endif /* _WINSOCK2API_ */
+/* +++++++++++++++++++++++ from iptypes.h */
+
+
+/* +++++++++++++++++++++++ from iphlpapi.h */
+#ifdef _WINSOCK2API_
+
+//
+// The following functions require Winsock2.
+//
+
+ULONG
+WINAPI
+GetAdaptersAddresses(
+ IN ULONG Family,
+ IN ULONG Flags,
+ IN PVOID Reserved,
+ __out_bcount_opt(*SizePointer) PIP_ADAPTER_ADDRESSES AdapterAddresses,
+ IN OUT PULONG SizePointer
+ );
+
+#endif
+/* +++++++++++++++++++++++ from iphlpapi.h */
+
+#pragma warning(pop)
+#endif /* !_W64 */
+#endif /* GAA_COMPAT_H */
diff --git a/ports/winnt/include/hopf_PCI_io.h b/ports/winnt/include/hopf_PCI_io.h
new file mode 100644
index 0000000..7bca1d3
--- /dev/null
+++ b/ports/winnt/include/hopf_PCI_io.h
@@ -0,0 +1,91 @@
+/*
+ * hopf_PCI_io.h
+ * structur definition and prototype Function declarations
+ *
+ * Date: 21.03.2000 Revision: 01.10
+ *
+ * Copyright (C) 1999, 2000 by Bernd Altmeier altmeier@ATLSoft.de
+ *
+ */
+
+#if defined(__cplusplus)
+extern "C"{
+#endif
+
+#ifndef __inpREAD_H
+#define __inpREAD_H
+
+
+typedef struct _CLOCKVER {
+ CHAR cVersion[255];
+} CLOCKVER, *PCLOCKVER, *LPCLOCKVER;
+
+typedef struct _HOPFTIME {
+ WORD wYear;
+ WORD wMonth;
+ WORD wDayOfWeek;
+ WORD wDay;
+ WORD wHour;
+ WORD wMinute;
+ WORD wSecond;
+ WORD wMilliseconds;
+ WORD wStatus;
+} HOPFTIME, *PHOPFTIME, *LPHOPFTIME;
+
+typedef struct _SATSTAT {
+ BYTE wVisible;
+ BYTE wMode;
+ BYTE wSat0;
+ BYTE wRat0;
+ BYTE wSat1;
+ BYTE wRat1;
+ BYTE wSat2;
+ BYTE wRat2;
+ BYTE wSat3;
+ BYTE wRat3;
+ BYTE wSat4;
+ BYTE wRat4;
+ BYTE wSat5;
+ BYTE wRat5;
+ BYTE wSat6;
+ BYTE wRat6;
+ BYTE wSat7;
+ BYTE wRat7;
+} SATSTAT, *PSATSTAT, *LPSATSTAT;
+
+
+typedef struct _GPSPOS {
+ LONG wAltitude; // Höhe immer 0
+ LONG wLongitude; // Länge in Msec
+ LONG wLatitude; // Breite in Msec
+} GPSPOS, *PGPSPOS, *LPGPSPOS;
+
+
+typedef struct _DCFANTENNE {
+ BYTE bStatus;
+ BYTE bStatus1;
+ WORD wAntValue;
+} DCFANTENNE, *PDCFANTENNE, *LPDCFANTENNE;
+
+
+
+// Function declarations
+BOOL OpenHopfDevice();
+BOOL CloseHopfDevice();
+VOID GetHopfTime(LPHOPFTIME Data, DWORD Offset);
+VOID GetHopfLocalTime(LPHOPFTIME Data);
+VOID GetHopfSystemTime(LPHOPFTIME Data);
+VOID GetSatData(LPSATSTAT Data);
+VOID GetDiffTime(LPLONG Data);
+VOID GetPosition(LPGPSPOS Data);
+VOID GetHardwareVersion(LPCLOCKVER Data);
+VOID GetHardwareData(LPDWORD Data,WORD Ofs);
+VOID GetDCFAntenne(LPDCFANTENNE Data);
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* inpREAD_H */
+
diff --git a/ports/winnt/include/netdb.h b/ports/winnt/include/netdb.h
new file mode 100644
index 0000000..5e15997
--- /dev/null
+++ b/ports/winnt/include/netdb.h
@@ -0,0 +1,4 @@
+/**************************************************************
+ * Dummy Header for Unix to Windows NT portability
+ * Created for NTP package
+ **************************************************************/
diff --git a/ports/winnt/include/ntp_iocompletionport.h b/ports/winnt/include/ntp_iocompletionport.h
new file mode 100644
index 0000000..7d7ff7c
--- /dev/null
+++ b/ports/winnt/include/ntp_iocompletionport.h
@@ -0,0 +1,27 @@
+#if !defined __ntp_iocompletionport_h
+# define __ntp_iocompletionport_h
+
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "clockstuff.h"
+#include "ntp_worker.h"
+
+# if defined(HAVE_IO_COMPLETION_PORT)
+
+extern void init_io_completion_port(void);
+extern void uninit_io_completion_port(void);
+
+extern int io_completion_port_add_socket(SOCKET fd, struct interface *);
+
+struct refclockio; /* in ntp_refclock.h but inclusion here triggers problems */
+extern int io_completion_port_add_clock_io(struct refclockio *rio);
+extern void io_completion_port_remove_clock_io(struct refclockio *rio);
+extern int io_completion_port_sendto(int, void *, size_t, sockaddr_u *);
+
+extern int GetReceivedBuffers(void);
+
+extern HANDLE WaitableExitEventHandle;
+
+# endif
+
+#endif
diff --git a/ports/winnt/include/ntp_timer.h b/ports/winnt/include/ntp_timer.h
new file mode 100644
index 0000000..15328a6
--- /dev/null
+++ b/ports/winnt/include/ntp_timer.h
@@ -0,0 +1,6 @@
+#ifndef NTP_TIMER_H
+#define NTP_TIMER_H
+
+extern void timer_clr_stats(void);
+
+#endif /* NTP_TIMER_H */
diff --git a/ports/winnt/include/ntservice.h b/ports/winnt/include/ntservice.h
new file mode 100644
index 0000000..f44335f
--- /dev/null
+++ b/ports/winnt/include/ntservice.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef NTSERVICE_H
+#define NTSERVICE_H
+
+#define NTP_DISPLAY_NAME "NetworkTimeProtocol"
+#define NTP_SERVICE_NAME "ntpd"
+
+void ntservice_init(void);
+void UpdateSCM(DWORD);
+void WINAPI ServiceControl(DWORD dwCtrlCode);
+void ntservice_shutdown(void);
+BOOL ntservice_systemisshuttingdown(void);
+BOOL WINAPI OnConsoleEvent(DWORD dwCtrlType);
+
+#endif /* NTSERVICE_H */
diff --git a/ports/winnt/include/stdint.h b/ports/winnt/include/stdint.h
new file mode 100644
index 0000000..4040c24
--- /dev/null
+++ b/ports/winnt/include/stdint.h
@@ -0,0 +1,244 @@
+/*
+ * stdint_msvc.h - C99 integer types for older Visual C compilers
+ *
+ * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
+ * The contents of 'html/copyright.html' apply.
+ *
+ * ----------------------------------------------------------------------
+ *
+ * Fairly straight forward implementation of the C99 standard integer
+ * types.
+ */
+
+#ifndef __STDINT_INCLUDED
+#define __STDINT_INCLUDED
+
+#if !defined(_MSC_VER) || _MSC_VER >= 1800
+# error Use only with MSVC6 - MSVC11(VS2012)
+#endif
+
+#include <crtdefs.h>
+#include <limits.h>
+
+/* ---------------------------------------------------------------------
+ * We declare the min/max values, using the MSVC syntax for literals of
+ * a given bit width.
+ */
+
+#define _VC_SI_LIT(lit,wbit) (lit ## i ## wbit)
+#define _VC_UI_LIT(lit,wbit) (lit ## ui ## wbit)
+
+/* ---------------------------------------------------------------------
+ * Exact width integer types
+ */
+typedef __int8 int8_t;
+typedef __int16 int16_t;
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+# define INT8_MIN _I8_MIN
+# define INT8_MAX _I8_MAX
+# define UINT8_MAX _UI8_MAX
+# define INT16_MIN _I16_MIN
+# define INT16_MAX _I16_MAX
+# define UINT16_MAX _UI16_MAX
+# define INT32_MIN _I32_MIN
+# define INT32_MAX _I32_MAX
+# define UINT32_MAX _UI32_MAX
+# define INT64_MIN _I64_MIN
+# define INT64_MAX _I64_MAX
+# define UINT64_MAX _UI64_MAX
+#endif
+
+/* ---------------------------------------------------------------------
+ * Least-size integers
+ *
+ * These are mapped to exact size.
+ */
+typedef __int8 int_least8_t;
+typedef __int16 int_least16_t;
+typedef __int32 int_least32_t;
+typedef __int64 int_least64_t;
+
+typedef unsigned __int8 uint_least8_t;
+typedef unsigned __int16 uint_least16_t;
+typedef unsigned __int32 uint_least32_t;
+typedef unsigned __int64 uint_least64_t;
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+#define INT_LEAST8_MIN _I8_MIN
+#define INT_LEAST8_MAX _I8_MAX
+#define UINT_LEAST8_MAX _UI8_MAX
+#define INT_LEAST16_MIN _I16_MIN
+#define INT_LEAST16_MAX _I16_MAX
+#define UINT_LEAST16_MAX _UI16_MAX
+#define INT_LEAST32_MIN _I32_MIN
+#define INT_LEAST32_MAX _I32_MAX
+#define UINT_LEAST32_MAX _UI32_MAX
+#define INT_LEAST64_MIN _I64_MIN
+#define INT_LEAST64_MAX _I64_MAX
+#define UINT_LEAST64_MAX _UI64_MAX
+#endif
+
+/* ---------------------------------------------------------------------
+ * least-size, fastest integer
+ *
+ * The 'FAST' types are all 32 bits, except the 64 bit quantity; as the
+ * natural register width is 32 bits, quantities of that size are fastest
+ * to operate on naturally. (This even holds for the x86_64; MSVC uses
+ * the 'llp64' model.
+ */
+typedef __int32 int_fast8_t;
+typedef __int32 int_fast16_t;
+typedef __int32 int_fast32_t;
+typedef __int64 int_fast64_t;
+
+typedef unsigned __int32 uint_fast8_t;
+typedef unsigned __int32 uint_fast16_t;
+typedef unsigned __int32 uint_fast32_t;
+typedef unsigned __int64 uint_fast64_t;
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+#define INT_FAST8_MIN _I32_MIN
+#define INT_FAST8_MAX _I32_MAX
+#define UINT_FAST8_MAX _UI32_MAX
+#define INT_FAST16_MIN _I32_MIN
+#define INT_FAST16_MAX _I32_MAX
+#define UINT_FAST16_MAX _UI32_MAX
+#define INT_FAST32_MIN _I32_MIN
+#define INT_FAST32_MAX _I32_MAX
+#define UINT_FAST32_MAX _UI32_MAX
+#define INT_FAST64_MIN _I64_MIN
+#define INT_FAST64_MAX _I64_MAX
+#define UINT_FAST64_MAX _UI64_MAX
+#endif
+
+/* ---------------------------------------------------------------------
+ * The (u)intptr_t, ptrdiff_t and size_t definitions depend on the
+ * target: 32bit for x86, and 64bit for x64, aka amd64. Well, we
+ * have to bite the bullet.
+ */
+
+/* ------------------------------------------------------------------ */
+# if defined(_WIN64) || defined(WIN64)
+/* ------------------------------------------------------------------ */
+
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+ typedef __int64 intptr_t;
+# endif
+
+# ifndef _UINTPTR_T_DEFINED
+# define _UINTPTR_T_DEFINED
+ typedef unsigned __int64 uintptr_t;
+# endif
+
+# ifndef _PTRDIFF_T_DEFINED
+# define _PTRDIFF_T_DEFINED
+ typedef __int64 ptrdiff_t;
+# endif
+
+# if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+# ifndef INTPTR_MIN
+# define INTPTR_MIN _I64_MIN
+# endif
+# ifndef INTPTR_MAX
+# define INTPTR_MAX _I64_MAX
+# endif
+# ifndef UINTPTR_MAX
+# define UINTPTR_MAX _UI64_MAX
+# endif
+# ifndef PTRDIFF_MIN
+# define PTRDIFF_MIN _I64_MIN
+# endif
+# ifndef PTRDIFF_MAX
+# define PTRDIFF_MAX _I64_MAX
+# endif
+# endif
+
+/* ------------------------------------------------------------------ */
+#else /* 32 bit target assumed here! */
+/* ------------------------------------------------------------------ */
+
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+ typedef __int32 intptr_t;
+# endif
+
+# ifndef _UINTPTR_T_DEFINED
+# define _UINTPTR_T_DEFINED
+ typedef unsigned __int32 uintptr_t;
+# endif
+
+# ifndef _PTRDIFF_T_DEFINED
+# define _PTRDIFF_T_DEFINED
+ typedef __int64 ptrdiff_t;
+# endif
+
+# if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+# ifndef INTPTR_MIN
+# define INTPTR_MIN _I32_MIN
+# endif
+# ifndef INTPTR_MAX
+# define INTPTR_MAX _I32_MAX
+# endif
+# ifndef UINTPTR_MAX
+# define UINTPTR_MAX _UI32_MAX
+# endif
+# ifndef PTRDIFF_MIN
+# define PTRDIFF_MIN _I32_MIN
+# endif
+# ifndef PTRDIFF_MAX
+# define PTRDIFF_MAX _I32_MAX
+# endif
+# endif
+#endif /* platform dependent stuff */
+
+
+/* ---------------------------------------------------------------------
+ * max integer is 64-bit integer
+ */
+typedef __int64 intmax_t;
+typedef unsigned __int64 uintmax_t;
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+# define INTMAX_MIN _I64_MIN
+# define INTMAX_MAX _I64_MAX
+# define UINTMAX_MAX _UI64_MAX
+#endif
+
+/* ---------------------------------------------------------------------
+ * limit for size_t (older MSVC versions lack that one)
+ */
+#if _MSC_VER <=1200
+# if defined(_WIN64) || defined(WIN64)
+# define SIZE_MAX _UI64_MAX
+#else
+# define SIZE_MAX _UI32_MAX
+# endif
+#endif
+
+/* ---------------------------------------------------------------------
+ * construct numerical literals with precise size
+ */
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
+# define INT8_C(lit) _VC_SI_LIT(lit,8)
+# define UINT8_C(lit) _VC_UI_LIT(lit,8)
+# define INT16_C(lit) _VC_SI_LIT(lit,16)
+# define UINT16_C(lit) _VC_UI_LIT(lit,16)
+# define INT32_C(lit) _VC_SI_LIT(lit,32)
+# define UINT32_C(lit) _VC_UI_LIT(lit,32)
+# define INT64_C(lit) _VC_SI_LIT(lit,64)
+# define UINT64_C(lit) _VC_UI_LIT(lit,64)
+# define INTMAX_C(lit) _VC_SI_LIT(lit,64)
+# define UINTMAX_C(lit) _VC_UI_LIT(lit,64)
+#endif
+
+#endif
+/**** EOF ****/
diff --git a/ports/winnt/include/stdnoreturn.h b/ports/winnt/include/stdnoreturn.h
new file mode 100644
index 0000000..65702e0
--- /dev/null
+++ b/ports/winnt/include/stdnoreturn.h
@@ -0,0 +1,61 @@
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+/* A substitute for ISO C11 <stdnoreturn.h>.
+
+ Copyright 2012-2014 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef noreturn
+
+/* ISO C11 <stdnoreturn.h> for platforms that lack it.
+
+ References:
+ ISO C11 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
+ section 7.23 */
+
+/* The definition of _Noreturn is copied here. */
+#if !defined _Noreturn && __STDC_VERSION__ < 201112
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+
+#if 1200 <= _MSC_VER
+/* Standard include files on this platform contain declarations like
+ "__declspec (noreturn) void abort (void);". "#define noreturn
+ _Noreturn" would cause this declaration to be rewritten to the
+ invalid "__declspec (__declspec (noreturn)) void abort (void);".
+ Instead, define noreturn to empty, so that such declarations are
+ rewritten to "__declspec () void abort (void);", which is
+ equivalent to "void abort (void);"; this gives up on noreturn's
+ advice to the compiler but at least it is valid code. */
+# define noreturn /*empty*/
+#else
+# define noreturn _Noreturn
+#endif
+
+/* Did he ever return?
+ No he never returned
+ And his fate is still unlearn'd ...
+ -- Steiner J, Hawes BL. M.T.A. (1949) */
+
+#endif /* noreturn */
diff --git a/ports/winnt/include/sys/ioctl.h b/ports/winnt/include/sys/ioctl.h
new file mode 100644
index 0000000..6f4b076
--- /dev/null
+++ b/ports/winnt/include/sys/ioctl.h
@@ -0,0 +1,11 @@
+/**************************************************************
+ * Dummy Header for Unix to Windows NT portability
+ * Created for NTP package
+ **************************************************************/
+
+#ifndef _IOCTL_H
+#define _IOCTL_H
+
+#include "win32_io.h"
+
+#endif \ No newline at end of file
diff --git a/ports/winnt/include/sys/param.h b/ports/winnt/include/sys/param.h
new file mode 100644
index 0000000..5e15997
--- /dev/null
+++ b/ports/winnt/include/sys/param.h
@@ -0,0 +1,4 @@
+/**************************************************************
+ * Dummy Header for Unix to Windows NT portability
+ * Created for NTP package
+ **************************************************************/
diff --git a/ports/winnt/include/sys/resource.h b/ports/winnt/include/sys/resource.h
new file mode 100644
index 0000000..01f4c81
--- /dev/null
+++ b/ports/winnt/include/sys/resource.h
@@ -0,0 +1,10 @@
+/*
+ * ports/winnt/include/sys/resource.h
+ *
+ * routines declared in Unix systems' sys/resource.h
+ */
+
+#define PRIO_PROCESS 0
+#define NTP_PRIO (-12)
+
+int setpriority(int, int, int); /* winnt\libntp\setpriority.c */
diff --git a/ports/winnt/include/sys/signal.h b/ports/winnt/include/sys/signal.h
new file mode 100644
index 0000000..5e15997
--- /dev/null
+++ b/ports/winnt/include/sys/signal.h
@@ -0,0 +1,4 @@
+/**************************************************************
+ * Dummy Header for Unix to Windows NT portability
+ * Created for NTP package
+ **************************************************************/
diff --git a/ports/winnt/include/sys/time.h b/ports/winnt/include/sys/time.h
new file mode 100644
index 0000000..b448917
--- /dev/null
+++ b/ports/winnt/include/sys/time.h
@@ -0,0 +1,25 @@
+/*
+ * ports/winnt/include/sys/time.h
+ *
+ * routines declared in Unix systems' sys/time.h
+ */
+
+#ifndef SYS_TIME_H
+#define SYS_TIME_H
+
+#include "ntp_types.h"
+#include <time.h>
+#include <sys/timeb.h>
+
+typedef struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+} timespec_t;
+
+#define TIMEOFDAY 0 /* getclock() clktyp arg */
+extern int getclock(int, struct timespec *ts);
+extern int gettimeofday(struct timeval *, void *);
+extern int settimeofday(struct timeval *);
+extern void init_win_precise_time(void);
+
+#endif /* SYS_TIME_H */
diff --git a/ports/winnt/include/sys/wait.h b/ports/winnt/include/sys/wait.h
new file mode 100644
index 0000000..5e15997
--- /dev/null
+++ b/ports/winnt/include/sys/wait.h
@@ -0,0 +1,4 @@
+/**************************************************************
+ * Dummy Header for Unix to Windows NT portability
+ * Created for NTP package
+ **************************************************************/
diff --git a/ports/winnt/include/syslog.h b/ports/winnt/include/syslog.h
new file mode 100644
index 0000000..5cbf30a
--- /dev/null
+++ b/ports/winnt/include/syslog.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* From BIND 9 lib/isc/include/isc/: syslog.h,v 1.4 2002/08/01 03:43:31 mayer */
+
+#ifndef _SYSLOG_H
+#define _SYSLOG_H
+
+#include <stdio.h>
+
+/* Constant definitions for openlog() */
+#define LOG_PID 1
+#define LOG_CONS 2
+/* NT event log does not support facility level */
+#define LOG_KERN 0
+#define LOG_USER 0
+#define LOG_MAIL 0
+#define LOG_DAEMON 0
+#define LOG_AUTH 0
+#define LOG_SYSLOG 0
+#define LOG_LPR 0
+#define LOG_LOCAL0 0
+#define LOG_LOCAL1 0
+#define LOG_LOCAL2 0
+#define LOG_LOCAL3 0
+#define LOG_LOCAL4 0
+#define LOG_LOCAL5 0
+#define LOG_LOCAL6 0
+#define LOG_LOCAL7 0
+
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but signification condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
+
+/*
+ * These are ignored on NT
+ */
+#define LOG_NDELAY 0 /* Open the connection to syslogd immediately */
+
+#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
+
+void
+syslog(int level, const char *fmt, ...);
+
+void
+openlog(const char *, int, ...);
+
+void
+closelog(void);
+
+void
+ModifyLogLevel(int level);
+
+int
+setlogmask(int maskpri);
+
+void
+InitNTLogging(FILE *, int);
+
+void
+NTReportError(const char *, const char *);
+
+#endif
diff --git a/ports/winnt/include/termios.h b/ports/winnt/include/termios.h
new file mode 100644
index 0000000..9c1cc62
--- /dev/null
+++ b/ports/winnt/include/termios.h
@@ -0,0 +1,214 @@
+#ifndef NTP_WIN_TERMIOS_H
+#define NTP_WIN_TERMIOS_H
+
+/* Flag definitions for compatibility
+ * ==================================
+*/
+
+#include <fcntl.h>
+
+#define NCCS 18 /* refclock_arc.c uses VTIME (17) */
+#define VEOL 3
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+struct termios
+{
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
+/* c_cc characters
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+*/
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+
+#define NLDLY 0000400
+#define NL0 0000000
+#define NL1 0000400
+
+#define CRDLY 0003000
+#define CR0 0000000
+#define CR1 0001000
+#define CR2 0002000
+#define CR3 0003000
+
+#define TABDLY 0014000
+#define TAB0 0000000
+#define TAB1 0004000
+#define TAB2 0010000
+#define TAB3 0014000
+#define XTABS 0014000
+
+#define BSDLY 0020000
+#define BS0 0000000
+#define BS1 0020000
+
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+
+/* c_cflag bit meaning */
+#define CBAUD 0010017
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+
+#define EXTA B19200
+#define EXTB B38400
+
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+
+#define CBAUDEX 0010000
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+
+#define CIBAUD 002003600000 /* input baud rate (not used) */
+#define CRTSCTS 020000000000 /* flow control */
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#define XCASE 0000004
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+#define VMIN 16
+#define VTIME 17
+
+/* modem lines */
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_OUT1 0x2000
+#define TIOCM_OUT2 0x4000
+
+/* ioctl */
+#define TIOCMGET 1
+#define TIOCMSET 2
+#define TIOCMBIC 3
+#define TIOCMBIS 4
+
+/* NOP cfsetospeed() and cfsetispeed() for now */
+#define cfsetospeed(dcb, spd) (0)
+#define cfsetispeed(dcb, spd) (0)
+
+extern int closeserial (int);
+extern int ioctl (int, int, int *);
+extern int tcsetattr (int, int, const struct termios *);
+extern int tcgetattr (int, struct termios *);
+extern int tcflush (int, int);
+extern int isserialhandle (HANDLE);
+
+#endif /* NTP_WIN_TERMIOS_H */
diff --git a/ports/winnt/include/timepps.h b/ports/winnt/include/timepps.h
new file mode 100644
index 0000000..76b1bfa
--- /dev/null
+++ b/ports/winnt/include/timepps.h
@@ -0,0 +1,811 @@
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2009 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and with or without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * This modified timepps.h can be used to provide a PPSAPI interface *
+ * to a machine running Windows with one or more backend provider DLLs *
+ * implementing the provider interfaces defined herein. *
+ * *
+ * This Windows version was derived by Dave Hart *
+ * <davehart@davehart.com> from Mills' timepps-Solaris.h *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+#ifndef TIMEPPS_H
+#define TIMEPPS_H
+
+#include "sys/time.h" /* in ntp ref source declares struct timespec */
+
+/*
+ * The following definitions are architecture independent
+ */
+
+#define PPS_API_VERS_1 1 /* API version number */
+#define PPS_JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
+#define PPS_NANOSECOND 1000000000L /* one nanosecond in decimal */
+#define PPS_FRAC 4294967296. /* 2^32 as a double */
+#define PPS_HECTONANOSECONDS 10000000 /* 100ns units in a second */
+#define PPS_FILETIME_1970 0x019db1ded53e8000 /* unix epoch to Windows */
+
+#define PPS_NORMALIZE(x) /* normalize timespec */ \
+ do { \
+ if ((x).tv_nsec >= PPS_NANOSECOND) { \
+ (x).tv_nsec -= PPS_NANOSECOND; \
+ (x).tv_sec++; \
+ } else if ((x).tv_nsec < 0) { \
+ (x).tv_nsec += PPS_NANOSECOND; \
+ (x).tv_sec--; \
+ } \
+ } while (0)
+
+#define PPS_TSPECTONTP(x) /* convert timespec to ntp_fp */ \
+ do { \
+ double d_frac; \
+ \
+ d_frac = ((struct timespec)&(x))->tv_nsec \
+ * PPS_FRAC / PPS_NANOSECOND; \
+ (x).integral = ((struct timespec)&(x))->tv_sec \
+ + PPS_JAN_1970; \
+ (x).fractional = (unsigned int)d_frac; \
+ if (d_frac >= PPS_FRAC) \
+ (x).integral++; \
+ } while (0)
+
+#define PPS_NTPTOTSPEC(x) /* convert ntp_fp to timespec */ \
+ do { \
+ double d_frac; \
+ \
+ /* careful, doing in place and tv_sec may be 64bit */ \
+ d_frac = (double)((ntp_fp_t *)&(x))->fractional \
+ * PPS_NANOSECOND / PPS_FRAC; \
+ (x).tv_sec = ((ntp_fp_t *)&(x))->integral \
+ - (time_t)PPS_JAN_1970; \
+ (x).tv_nsec = (long)d_frac; \
+ } while (0)
+
+
+/*
+ * Device/implementation parameters (mode)
+ */
+
+#define PPS_CAPTUREASSERT 0x01 /* capture assert events */
+#define PPS_CAPTURECLEAR 0x02 /* capture clear events */
+#define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */
+
+#define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */
+#define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */
+#define PPS_OFFSETBOTH 0x30 /* apply compensation for both */
+
+#define PPS_CANWAIT 0x100 /* Can we wait for an event? */
+#define PPS_CANPOLL 0x200 /* "This bit is reserved for */
+
+/*
+ * Kernel actions (mode)
+ */
+
+#define PPS_ECHOASSERT 0x40 /* feed back assert event to output */
+#define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */
+
+/*
+ * Timestamp formats (tsformat)
+ */
+
+#define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */
+#define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */
+#define PPS_TSFMT_BOTH (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+
+/*
+ * Kernel discipline actions (not used in Windows yet)
+ */
+
+#define PPS_KC_HARDPPS 0 /* enable kernel consumer */
+#define PPS_KC_HARDPPS_PLL 1 /* phase-lock mode */
+#define PPS_KC_HARDPPS_FLL 2 /* frequency-lock mode */
+
+/*
+ * Type definitions
+ */
+
+typedef unsigned long pps_seq_t; /* sequence number */
+
+#pragma warning(push)
+#pragma warning(disable: 201) /* nonstd extension nameless union */
+
+typedef struct ntp_fp {
+ union ntp_fp_sec {
+ unsigned int integral;
+ int s_integral;
+ };
+ unsigned int fractional;
+} ntp_fp_t; /* NTP-compatible time stamp */
+
+#pragma warning(pop)
+
+typedef union pps_timeu { /* timestamp format */
+ struct timespec tspec;
+ ntp_fp_t ntpfp;
+ unsigned long longpad[3];
+} pps_timeu_t; /* generic data type to represent time stamps */
+
+/* addition of NTP fixed-point format */
+
+#define NTPFP_M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \
+ do { \
+ register u_int32 lo_tmp; \
+ register u_int32 hi_tmp; \
+ \
+ lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \
+ hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \
+ if (lo_tmp & 0x10000) \
+ hi_tmp++; \
+ (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
+ \
+ (r_i) += (a_i); \
+ if (hi_tmp & 0x10000) \
+ (r_i)++; \
+ } while (0)
+
+#define NTPFP_L_ADDS(r, a) NTPFP_M_ADD((r)->integral, (r)->fractional, \
+ (a)->s_integral, (a)->fractional)
+
+
+/*
+ * Timestamp information structure
+ */
+
+typedef struct pps_info {
+ pps_seq_t assert_sequence; /* seq. num. of assert event */
+ pps_seq_t clear_sequence; /* seq. num. of clear event */
+ pps_timeu_t assert_tu; /* time of assert event */
+ pps_timeu_t clear_tu; /* time of clear event */
+ int current_mode; /* current mode bits */
+} pps_info_t;
+
+#define assert_timestamp assert_tu.tspec
+#define clear_timestamp clear_tu.tspec
+
+#define assert_timestamp_ntpfp assert_tu.ntpfp
+#define clear_timestamp_ntpfp clear_tu.ntpfp
+
+/*
+ * Parameter structure
+ */
+
+typedef struct pps_params {
+ int api_version; /* API version # */
+ int mode; /* mode bits */
+ pps_timeu_t assert_off_tu; /* offset compensation for assert */
+ pps_timeu_t clear_off_tu; /* offset compensation for clear */
+} pps_params_t;
+
+#define assert_offset assert_off_tu.tspec
+#define clear_offset clear_off_tu.tspec
+
+#define assert_offset_ntpfp assert_off_tu.ntpfp
+#define clear_offset_ntpfp clear_off_tu.ntpfp
+
+/*
+ *------ Here begins the implementation-specific part! ------
+ */
+
+#include <windows.h>
+#include <errno.h>
+#include <stddef.h> /* offsetof() */
+#include <io.h> /* _get_osfhandle() */
+
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP 45
+#endif
+
+typedef UINT_PTR pps_handle_t; /* pps handlebars */
+
+#ifndef inline
+#define inline __inline
+#endif
+
+/*
+ * ntpd on Windows is typically distributed as a binary as few users
+ * have the tools needed to build from source. Rather than build
+ * a single timepps.h for Windows which knows how to talk to all
+ * PPS implementations frozen in time as of compiling, this timepps.h
+ * allows one or more backend providers to be used by naming a DLL
+ * which exports the provider interfaces defined here.
+ */
+typedef enum ppsapi_magic_tag {
+ PPSAPI_MAGIC_UNIT = 0x70707355, /* ppsU */
+} ppsapi_magic;
+
+typedef struct {
+ struct pps_provider_tag *provider;
+ void * context;/* provider's unit pointer */
+ ppsapi_magic magic; /* to detect invalid handles */
+ pps_params_t params; /* PPS parameters set by user */
+} pps_unit_t;
+
+typedef void (*ppps_ntp_timestamp_from_counter)(
+ ntp_fp_t *result,
+ ULONGLONG Timestamp,
+ ULONGLONG Counterstamp
+ );
+
+typedef pps_handle_t (*pcreate_pps_handle)(
+ void * prov_context
+ );
+
+/*
+ * ppsapi_prov_init() - exported by backend DLLs
+ *
+ * Return value is pps capabilities available to PPSAPI consumers
+ * via time_pps_getcaps().
+ */
+#define PPSAPI_TIMEPPS_PROV_VER 2
+
+typedef int (WINAPI *pppsapi_prov_init)(
+ int ppsapi_timepps_prov_ver,
+ pcreate_pps_handle create_pps_handle,
+ ppps_ntp_timestamp_from_counter ntp_timestamp_from_counter,
+ char * short_name_buf,
+ size_t short_name_size,
+ char * full_name_buf,
+ size_t full_name_size
+ );
+
+typedef int (WINAPI *provtime_pps_create)(
+ HANDLE winhandle, /* user device handle */
+ pps_handle_t *phandle /* returned handle */
+ );
+
+typedef int (WINAPI *provtime_pps_destroy)(
+ pps_unit_t * unit,
+ void * context
+ );
+
+typedef int (WINAPI *provtime_pps_setparams)(
+ pps_unit_t * unit,
+ void * context,
+ const pps_params_t * params
+ );
+
+typedef int (WINAPI *provtime_pps_fetch)(
+ pps_unit_t * unit,
+ void * context,
+ const int tsformat,
+ pps_info_t * pinfo,
+ const struct timespec * timeout
+ );
+
+typedef int (WINAPI *provtime_pps_kcbind)(
+ pps_unit_t * unit,
+ void * context,
+ const int kernel_consumer,
+ const int edge,
+ const int tsformat
+ );
+
+typedef struct pps_provider_tag {
+ struct pps_provider_tag *next;
+ int caps;
+ char * short_name;
+ char * full_name;
+ provtime_pps_create ptime_pps_create;
+ provtime_pps_destroy ptime_pps_destroy;
+ provtime_pps_setparams ptime_pps_setparams;
+ provtime_pps_fetch ptime_pps_fetch;
+ provtime_pps_kcbind ptime_pps_kcbind;
+} ppsapi_provider;
+
+static ppsapi_provider * g_provider_list;
+static ppsapi_provider * g_curr_provider;
+
+
+static inline pps_handle_t
+internal_create_pps_handle(
+ void * prov_context
+ )
+{
+ pps_unit_t * punit;
+
+ if (NULL == g_curr_provider) {
+ fprintf(stderr, "create_pps_handle: provider backend called me outside time_pps_create\n");
+ punit = NULL;
+ } else
+ punit = malloc(sizeof(*punit));
+ if (punit != NULL) {
+ punit->provider = g_curr_provider;
+ punit->context = prov_context;
+ punit->magic = PPSAPI_MAGIC_UNIT;
+ memset(&punit->params, 0, sizeof(punit->params));
+ }
+ return (pps_handle_t)punit;
+}
+
+static inline pps_unit_t *
+unit_from_ppsapi_handle(
+ pps_handle_t handle
+ )
+{
+ pps_unit_t *punit;
+
+ punit = (pps_unit_t *)handle;
+ if (PPSAPI_MAGIC_UNIT != punit->magic)
+ punit = NULL;
+ return punit;
+}
+
+/*
+ * ntpd on Windows only looks to errno after finding
+ * GetLastError returns NO_ERROR. To accomodate its
+ * use of msyslog in portable code such as refclock_atom.c,
+ * this implementation always clears the Windows
+ * error code using SetLastError(NO_ERROR) when
+ * returning an errno. This is also a good idea
+ * for any non-ntpd clients as they should rely only
+ * the errno for PPSAPI functions.
+ */
+#define RETURN_PPS_ERRNO(e) \
+do { \
+ SetLastError(NO_ERROR); \
+ errno = (e); \
+ return -1; \
+} while (0)
+
+
+#ifdef OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER
+extern void pps_ntp_timestamp_from_counter(ntp_fp_t *, ULONGLONG, ULONGLONG);
+#else
+/*
+ * helper routine for serialpps.sys ioctl which returns
+ * performance counter "timestamp" as well as a system
+ * FILETIME timestamp. Converts one of the inputs to
+ * NTP fixed-point format.
+ *
+ * You will probably want to supply your own and #define
+ * OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER, as this stub
+ * converts only the low-resolution system timestamp.
+ *
+ * When implementing a provider, use the pointer to this
+ * conversion function supplied to your prov_init(), as
+ * the copy in your DLL will likely be the stub below,
+ * where you want the one provided by the PPSAPI client
+ * such as ntpd.
+ */
+static inline void
+pps_ntp_timestamp_from_counter(
+ ntp_fp_t *result,
+ ULONGLONG Timestamp,
+ ULONGLONG Counterstamp)
+{
+ ULONGLONG BiasedTimestamp;
+
+ /* convert from 100ns units to NTP fixed point format */
+
+ BiasedTimestamp = Timestamp - PPS_FILETIME_1970;
+ result->integral = PPS_JAN_1970 +
+ (unsigned)(BiasedTimestamp / PPS_HECTONANOSECONDS);
+ result->fractional =
+ (unsigned) ((BiasedTimestamp % PPS_HECTONANOSECONDS) *
+ (PPS_FRAC / PPS_HECTONANOSECONDS));
+}
+#endif
+
+
+static inline int
+load_pps_provider(
+ char * dllpath
+ )
+{
+ char short_name[16];
+ char full_name[64];
+ ppsapi_provider * prov;
+ HMODULE hmod;
+ pppsapi_prov_init pprov_init;
+
+ prov = malloc(sizeof(*prov));
+ if (NULL == prov)
+ return ENOMEM;
+
+ hmod = LoadLibrary(dllpath);
+ if (NULL == hmod) {
+ fprintf(stderr, "load_pps_provider: LoadLibrary(%s) error %u\n", dllpath, GetLastError());
+ free(prov);
+ return ENOENT;
+ }
+
+ pprov_init = (pppsapi_prov_init)GetProcAddress(hmod, "ppsapi_prov_init");
+ if (NULL == pprov_init) {
+ fprintf(stderr, "load_pps_provider: entrypoint ppsapi_prov_init not found in %s\n", dllpath);
+ free(prov);
+ FreeLibrary(hmod);
+ return EFAULT;
+ }
+
+ prov->caps = (*pprov_init)(PPSAPI_TIMEPPS_PROV_VER,
+ &internal_create_pps_handle,
+ &pps_ntp_timestamp_from_counter,
+ short_name, sizeof(short_name),
+ full_name, sizeof(full_name));
+
+ if (!prov->caps) {
+ free(prov);
+ FreeLibrary(hmod);
+ return EACCES;
+ }
+
+ prov->short_name = _strdup(short_name);
+ prov->full_name = _strdup(full_name);
+
+ if (NULL == prov->short_name || !prov->short_name[0]
+ || NULL == prov->full_name || !prov->full_name[0]) {
+
+ if (prov->short_name)
+ free(prov->short_name);
+ if (prov->full_name)
+ free(prov->full_name);
+ free(prov);
+ FreeLibrary(hmod);
+ return EINVAL;
+ }
+
+ prov->ptime_pps_create = (provtime_pps_create)
+ GetProcAddress(hmod, "prov_time_pps_create");
+ prov->ptime_pps_destroy = (provtime_pps_destroy)
+ GetProcAddress(hmod, "prov_time_pps_destroy");
+ prov->ptime_pps_setparams = (provtime_pps_setparams)
+ GetProcAddress(hmod, "prov_time_pps_setparams");
+ prov->ptime_pps_fetch = (provtime_pps_fetch)
+ GetProcAddress(hmod, "prov_time_pps_fetch");
+ prov->ptime_pps_kcbind = (provtime_pps_kcbind)
+ GetProcAddress(hmod, "prov_time_pps_kcbind");
+
+ if (NULL == prov->ptime_pps_create
+ || NULL == prov->ptime_pps_destroy
+ || NULL == prov->ptime_pps_setparams
+ || NULL == prov->ptime_pps_fetch
+ || NULL == prov->ptime_pps_kcbind) {
+
+ fprintf(stderr, "PPSAPI provider %s missing entrypoint\n",
+ prov->short_name);
+ free(prov->short_name);
+ free(prov->full_name);
+ free(prov);
+ FreeLibrary(hmod);
+ return EINVAL;
+ }
+
+ fprintf(stderr, "loaded PPSAPI provider %s caps 0x%x provider %p\n",
+ prov->full_name, prov->caps, prov);
+
+ prov->next = g_provider_list;
+ g_provider_list = prov;
+
+ return 0;
+}
+
+
+/*
+ * time_pps_create - create PPS handle from file descriptor
+ *
+ * This is the initial entrypoint of PPSAPI from the client. Note
+ * to maintain source compatibility with Unix, the input file
+ * descriptor really is a descriptor from the C runtime low-numbered
+ * descriptor namespace, though it may have been converted from a
+ * native Windows HANDLE using _open_osfhandle().
+ */
+static inline int
+time_pps_create(
+ int filedes,/* device file descriptor */
+ pps_handle_t * phandle /* returned handle */
+ )
+{
+ HANDLE winhandle;
+ char * dlls;
+ char * dll;
+ char * pch;
+ ppsapi_provider * prov;
+ pps_handle_t ppshandle;
+ int err;
+
+ if (NULL == phandle)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ winhandle = (HANDLE)_get_osfhandle(filedes);
+ fprintf(stderr, "time_pps_create(%d) got winhandle %p\n", filedes, winhandle);
+ if (INVALID_HANDLE_VALUE == winhandle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ /*
+ * For initial testing the list of PPSAPI backend
+ * providers is provided by the environment variable
+ * PPSAPI_DLLS, separated by semicolons such as
+ * PPSAPI_DLLS=c:\ntp\serial_ppsapi.dll;..\parport_ppsapi.dll
+ * There are a million better ways, such as a well-known
+ * registry key under which a value is created for each
+ * provider DLL installed, or even a platform-specific
+ * ntp.conf directive or command-line switch.
+ */
+ dlls = getenv("PPSAPI_DLLS");
+ if (dlls != NULL && NULL == g_provider_list) {
+ dlls = dll = _strdup(dlls);
+ fprintf(stderr, "getenv(PPSAPI_DLLS) gives %s\n", dlls);
+ } else
+ dlls = dll = NULL;
+
+ while (dll != NULL && dll[0]) {
+ pch = strchr(dll, ';');
+ if (pch != NULL)
+ *pch = 0;
+ err = load_pps_provider(dll);
+ if (err) {
+ fprintf(stderr, "load_pps_provider(%s) got errno %d\n", dll, err);
+ RETURN_PPS_ERRNO(err);
+ }
+ dll = (NULL == pch)
+ ? NULL
+ : pch + 1;
+ }
+
+ if (NULL != dlls)
+ free(dlls);
+ dlls = dll = NULL;
+
+ /*
+ * Hand off to each provider in turn until one returns a PPS
+ * handle or they've all declined.
+ */
+ for (prov = g_provider_list; prov != NULL; prov = prov->next) {
+ ppshandle = 0;
+ g_curr_provider = prov;
+ err = (*prov->ptime_pps_create)(winhandle, &ppshandle);
+ g_curr_provider = NULL;
+ fprintf(stderr, "%s prov_time_pps_create(%p) returned %d\n",
+ prov->short_name, winhandle, err);
+ if (!err && ppshandle) {
+ *phandle = ppshandle;
+ return 0;
+ }
+ }
+
+ fprintf(stderr, "PPSAPI provider list %p\n", g_provider_list);
+
+ RETURN_PPS_ERRNO(ENOEXEC);
+}
+
+
+/*
+ * release PPS handle
+ */
+
+static inline int
+time_pps_destroy(
+ pps_handle_t handle
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ err = (*punit->provider->ptime_pps_destroy)(punit, punit->context);
+
+ free(punit);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+/*
+ * set parameters for handle
+ */
+
+static inline int
+time_pps_setparams(
+ pps_handle_t handle,
+ const pps_params_t *params
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ /*
+ * Check for valid arguments and set parameters.
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == params)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ err = (*punit->provider->ptime_pps_setparams)(punit, punit->context, params);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+/*
+ * get parameters for handle
+ */
+
+static inline int
+time_pps_getparams(
+ pps_handle_t handle,
+ pps_params_t *params_buf
+ )
+{
+ pps_unit_t * punit;
+
+ /*
+ * Check for valid arguments and get parameters.
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == params_buf)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ *params_buf = punit->params;
+ return 0;
+}
+
+
+/*
+ * time_pps_getcap - get capabilities for handle
+ */
+static inline int
+time_pps_getcap(
+ pps_handle_t handle,
+ int *pmode
+ )
+{
+ pps_unit_t * punit;
+
+ /*
+ * Check for valid arguments and get capabilities.
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == pmode)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ *pmode = punit->provider->caps;
+ return 0;
+}
+
+/*
+ * Fetch timestamps
+ */
+
+static inline int
+time_pps_fetch(
+ pps_handle_t handle,
+ const int tsformat,
+ pps_info_t * pinfo,
+ const struct timespec * ptimeout
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ /*
+ * Check for valid arguments and fetch timestamps
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == pinfo)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ err = (*punit->provider->ptime_pps_fetch)(punit,
+ punit->context,
+ tsformat,
+ pinfo,
+ ptimeout);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+/*
+ * time_pps_kcbind - specify kernel consumer
+ *
+ * Not supported so far by Windows.
+ */
+
+static inline int
+time_pps_kcbind(
+ pps_handle_t handle,
+ const int kernel_consumer,
+ const int edge, const int tsformat
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ err = (*punit->provider->ptime_pps_kcbind)(
+ punit,
+ punit->context,
+ kernel_consumer,
+ edge,
+ tsformat);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+
+#endif /* TIMEPPS_H */
diff --git a/ports/winnt/include/unistd.h b/ports/winnt/include/unistd.h
new file mode 100644
index 0000000..5e15997
--- /dev/null
+++ b/ports/winnt/include/unistd.h
@@ -0,0 +1,4 @@
+/**************************************************************
+ * Dummy Header for Unix to Windows NT portability
+ * Created for NTP package
+ **************************************************************/
diff --git a/ports/winnt/include/win32_io.h b/ports/winnt/include/win32_io.h
new file mode 100644
index 0000000..8f67ca1
--- /dev/null
+++ b/ports/winnt/include/win32_io.h
@@ -0,0 +1,7 @@
+#ifndef WIN32_IO_H
+#define WIN32_IO_H
+
+extern void InitSockets(void);
+extern void connection_reset_fix(SOCKET fd, sockaddr_u *addr);
+
+#endif /* WIN32_IO_H */
diff --git a/ports/winnt/instsrv/instsrv.c b/ports/winnt/instsrv/instsrv.c
new file mode 100644
index 0000000..b3acc9f
--- /dev/null
+++ b/ports/winnt/instsrv/instsrv.c
@@ -0,0 +1,461 @@
+/*
+ * File: instsrv.c
+ * Purpose: To install a new service and to insert registry entries.
+ *
+ */
+#ifndef __RPCASYNC_H__
+#define __RPCASYNC_H__ /* Skip asynch rpc inclusion */
+#endif
+
+#include <windows.h>
+#include <stdio.h>
+
+#define PERR(api) printf("\n%s: Error %d from %s on line %d", \
+ __FILE__, GetLastError(), api, __LINE__);
+
+#define MSG_FOR_ACCESS_DENIED "You aren't authorized to do this - please see your system Administrator"
+#define MSG_1_FOR_BAD_PATH "The fully qualified path name to the .exe must be given, and"
+#define MSG_2_FOR_BAD_PATH " the drive letter must be for a fixed disk (e.g., not a net drive)"
+
+SC_HANDLE schService;
+SC_HANDLE schSCManager;
+int ok2;
+
+VOID DisplayHelp(VOID);
+
+/* --------------------------------------------------------------------------------------- */
+
+int InstallService(LPCTSTR serviceName, LPCTSTR displayName, LPCTSTR serviceExe)
+{
+ LPCTSTR lpszBinaryPathName = serviceExe;
+ TCHAR lpszRootPathName[] ="?:\\";
+
+ if ( (':' != *(lpszBinaryPathName+1)) || ('\\' != *(lpszBinaryPathName+2)) )
+ { printf("\n%s",MSG_1_FOR_BAD_PATH);
+ printf("\n%s\n",MSG_2_FOR_BAD_PATH);
+ return 1;
+ }
+
+ #define DRIVE_TYPE_INDETERMINATE 0
+ #define ROOT_DIR_DOESNT_EXIST 1
+
+ *lpszRootPathName = *(lpszBinaryPathName+0) ;
+
+ switch ( GetDriveType(lpszRootPathName) )
+ {
+ case DRIVE_FIXED :
+ { // OK
+ break;
+ }
+ case ROOT_DIR_DOESNT_EXIST :
+ { printf("\n%s",MSG_1_FOR_BAD_PATH);
+ printf("\n the root directory where the .exe is specified to be must exist, and");
+ printf("\n%s\n",MSG_2_FOR_BAD_PATH);
+ return 1;
+ }
+ case DRIVE_TYPE_INDETERMINATE :
+ case DRIVE_REMOVABLE :
+ case DRIVE_REMOTE :
+ case DRIVE_CDROM :
+ case DRIVE_RAMDISK :
+ { printf("\n%s",MSG_1_FOR_BAD_PATH);
+ printf("\n%s\n",MSG_2_FOR_BAD_PATH);
+ return 1;
+ }
+ default :
+ { printf("\n%s",MSG_1_FOR_BAD_PATH);
+ printf("\n%s\n",MSG_2_FOR_BAD_PATH);
+ return 1;
+ }
+ }
+
+ if (INVALID_HANDLE_VALUE == CreateFile(lpszBinaryPathName,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL))
+ {
+ printf("\n%s",MSG_1_FOR_BAD_PATH);
+ printf("\n the file must exist, and");
+ printf("\n%s\n",MSG_2_FOR_BAD_PATH);
+ return 1;
+ }
+
+ schService = CreateService(
+ schSCManager, // SCManager database
+ serviceName, // name of service
+ displayName, // name to display
+ SERVICE_ALL_ACCESS, // desired access
+ SERVICE_WIN32_OWN_PROCESS, // service type
+ SERVICE_AUTO_START, // start type
+ SERVICE_ERROR_NORMAL, // error control type
+ lpszBinaryPathName, // service's binary
+ NULL, // no load ordering group
+ NULL, // no tag identifier
+ NULL, // no dependencies
+ NULL, // Local System account
+ NULL); // null password
+
+ if (NULL == schService)
+ { switch (GetLastError())
+ {
+ case ERROR_ACCESS_DENIED :
+ { printf("\n%s",MSG_FOR_ACCESS_DENIED);
+ break;
+ }
+ case ERROR_SERVICE_EXISTS :
+ { printf("\nThe %s service is already installed",serviceName);
+ printf("\nRemove it first if you need to re-install a new version\n");
+ break;
+ }
+ default :
+ { PERR("CreateService");
+ }
+ }
+ return 1;
+ }
+ else
+
+ CloseServiceHandle(schService);
+ return 0;
+}
+
+/* --------------------------------------------------------------------------------------- */
+
+int RemoveService(LPCTSTR serviceName)
+{
+ {
+ #define SZ_ENUM_BUF 4096
+ ENUM_SERVICE_STATUS essServiceStatus[SZ_ENUM_BUF];
+ DWORD dwBufSize = sizeof(essServiceStatus);
+ DWORD dwBytesNeeded = 0;
+ DWORD dwServicesReturned = 0;
+ DWORD dwResumeHandle = 0;
+ DWORD dwI = 0;
+ BOOLEAN bFound = FALSE;
+
+ if (!EnumServicesStatus(schSCManager,
+ SERVICE_WIN32,
+ SERVICE_ACTIVE,
+ (LPENUM_SERVICE_STATUS)&essServiceStatus,
+ dwBufSize,
+ &dwBytesNeeded,
+ &dwServicesReturned,
+ &dwResumeHandle))
+ { switch (GetLastError())
+ {
+ case ERROR_ACCESS_DENIED :
+ { printf("\n%s",MSG_FOR_ACCESS_DENIED);
+ break;
+ }
+ default :
+ { PERR("EnumServicesStatus");
+ }
+ }
+ return 1;
+ }
+
+ for (dwI=0; dwI<dwServicesReturned; dwI++)
+ { if(0 == _stricmp(essServiceStatus[dwI].lpServiceName,serviceName))
+ { bFound = TRUE;
+ break;
+ }
+ }
+
+ if (bFound)
+ { printf("\nThe %s service cannot be removed until it has been stopped.",serviceName);
+ printf("\nTo stop the %s service, use the Stop button in the Control",serviceName);
+ printf("\n Panel Services applet\n");
+ return 1;
+ }
+ }
+
+ schService = OpenService(schSCManager,
+ serviceName,
+ SERVICE_ALL_ACCESS);
+ if (NULL == schService)
+ { switch (GetLastError())
+ {
+ case ERROR_ACCESS_DENIED :
+ { printf("\n%s",MSG_FOR_ACCESS_DENIED);
+ break;
+ }
+ case ERROR_SERVICE_DOES_NOT_EXIST :
+ { printf("\nThe %s service is not installed, so cannot be removed\n",serviceName);
+ break;
+ }
+ default :
+ { PERR("OpenService");
+ }
+ }
+ return 1;
+ }
+
+ if (DeleteService(schService))
+ { printf("\nDelete of Service \"Network Time Protocol\" was SUCCESSFUL\n");
+ return 0;
+ }
+ else
+ { switch (GetLastError())
+ {
+ case ERROR_ACCESS_DENIED :
+ { printf("\n%s",MSG_FOR_ACCESS_DENIED);
+ break;
+ }
+ default :
+ { PERR("DeleteService");
+ }
+ }
+ return 1;
+ }
+}
+
+/* --------------------------------------------------------------------------------------- */
+
+int addSourceToRegistry(LPSTR pszAppname, LPSTR pszMsgDLL)
+{
+ HKEY hk; /* registry key handle */
+ DWORD dwData;
+ BOOL bSuccess;
+ char regarray[200];
+ char *lpregarray = regarray;
+
+ /* When an application uses the RegisterEventSource or OpenEventLog
+ function to get a handle of an event log, the event loggging service
+ searches for the specified source name in the registry. You can add a
+ new source name to the registry by opening a new registry subkey
+ under the Application key and adding registry values to the new
+ subkey. */
+
+ strcpy(lpregarray, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\");
+ strcat(lpregarray, pszAppname);
+ /* Create a new key for our application */
+ bSuccess = RegCreateKey(HKEY_LOCAL_MACHINE, lpregarray, &hk);
+ if(bSuccess != ERROR_SUCCESS)
+ {
+ PERR("RegCreateKey");
+ return 1;
+ }
+
+ /* Add the Event-ID message-file name to the subkey. */
+ bSuccess = RegSetValueEx(hk, /* subkey handle */
+ "EventMessageFile", /* value name */
+ 0, /* must be zero */
+ REG_EXPAND_SZ, /* value type */
+ (LPBYTE) pszMsgDLL, /* address of value data */
+ strlen(pszMsgDLL) + 1); /* length of value data */
+ if(bSuccess != ERROR_SUCCESS)
+ {
+ PERR("RegSetValueEx");
+ return 1;
+ }
+
+ /* Set the supported types flags and addit to the subkey. */
+ dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |
+ EVENTLOG_INFORMATION_TYPE;
+ bSuccess = RegSetValueEx(hk, /* subkey handle */
+ "TypesSupported", /* value name */
+ 0, /* must be zero */
+ REG_DWORD, /* value type */
+ (LPBYTE) &dwData, /* address of value data */
+ sizeof(DWORD)); /* length of value data */
+ if(bSuccess != ERROR_SUCCESS)
+ {
+ PERR("RegSetValueEx");
+ return 1;
+ }
+ RegCloseKey(hk);
+ return 0;
+}
+
+/* --------------------------------------------------------------------------------------- */
+
+int addKeysToRegistry()
+
+{
+ HKEY hk; /* registry key handle */
+ BOOL bSuccess;
+ char myarray[200];
+ char *lpmyarray = myarray;
+ int arsize = 0;
+
+ /* now add the depends on service key */
+
+ /* Create a new key for our application */
+ bSuccess = RegCreateKey(HKEY_LOCAL_MACHINE,
+ "SYSTEM\\CurrentControlSet\\Services\\NTP", &hk);
+ if(bSuccess != ERROR_SUCCESS)
+ {
+ PERR("RegCreateKey");
+ return 1;
+ }
+
+ strcpy(lpmyarray,"TcpIp");
+ lpmyarray = lpmyarray + 6;
+ arsize = arsize + 6;
+ strcpy(lpmyarray,"Afd");
+ lpmyarray = lpmyarray + 4;
+ arsize = arsize + 4;
+ arsize = arsize + 2;
+ strcpy(lpmyarray,"\0\0");
+
+ bSuccess = RegSetValueEx(hk, /* subkey handle */
+ "DependOnService", /* value name */
+ 0, /* must be zero */
+ REG_MULTI_SZ, /* value type */
+ (LPBYTE) &myarray, /* address of value data */
+ arsize); /* length of value data */
+ if(bSuccess != ERROR_SUCCESS)
+ {
+ PERR("RegSetValueEx");
+ return 1;
+ }
+
+ RegCloseKey(hk);
+ return 0;
+}
+
+/* --------------------------------------------------------------------------------------- */
+
+int main(int argc, char *argv[])
+{
+ #define SZ_NAME_BUF 270 // 256 is max, add a little
+ UCHAR ucNameBuf[SZ_NAME_BUF] = "NTP";
+ LPTSTR lpszServName = (LPTSTR)&ucNameBuf;
+
+ UCHAR ucDNameBuf[SZ_NAME_BUF] = "Network Time Protocol";
+ LPTSTR lpszDispName = (LPTSTR)&ucDNameBuf;
+
+
+ UCHAR ucExeNBuf[SZ_NAME_BUF] = "";
+ LPTSTR lpszExeName = (LPTSTR)&ucExeNBuf;
+
+ BOOL bRemovingService = FALSE;
+ char *p;
+
+ int ok = 0;
+
+ // check if Win32s, if so, display notice and terminate
+ if( GetVersion() & 0x80000000 )
+ {
+ MessageBox( NULL,
+ "This application cannot run on Windows 3.1.\n"
+ "This application will now terminate.",
+ "NAMED",
+ MB_OK | MB_ICONSTOP | MB_SETFOREGROUND );
+ return( 1 );
+ }
+ if (argc == 2)
+ bRemovingService = (!stricmp(argv[1], "remove"));
+
+ if(!bRemovingService)
+ {
+
+
+ if (argc != 2)
+ {
+ DisplayHelp();
+ return(1);
+ }
+
+ p=argv[1];
+ if ( ('/' == *p)
+ || ('-' == *p) )
+ {
+ DisplayHelp();
+ return(1);
+ }
+
+
+ }
+
+ if (strlen(argv[1]) > 256)
+ {
+ printf("\nThe service name cannot be longer than 256 characters\n");
+ return(1);
+ }
+
+
+
+ bRemovingService = (!stricmp(argv[1], "remove"));
+ schSCManager = OpenSCManager(
+ NULL, // machine (NULL == local)
+ NULL, // database (NULL == default)
+ SC_MANAGER_ALL_ACCESS); // access required
+
+ if (NULL == schSCManager)
+ { switch (GetLastError())
+ {
+ case ERROR_ACCESS_DENIED :
+ { printf("\n%s",MSG_FOR_ACCESS_DENIED);
+ break;
+ }
+ default :
+ { PERR("OpenSCManager");
+ }
+ }
+ return (0);
+ }
+
+ if (bRemovingService)
+ {
+ ok = RemoveService(lpszServName);
+ }
+ else
+ {
+ /* get the exe name */
+ strcpy(lpszExeName,argv[1]);
+ ok = InstallService(lpszServName, lpszDispName, lpszExeName);
+ }
+
+ CloseServiceHandle(schSCManager);
+
+ if (!bRemovingService)
+ {
+ if (ok == 0)
+ { /* Set the Event-ID message-file name. */
+ ok = addSourceToRegistry("NTP", lpszExeName);
+ if (ok == 0)
+ ok = addKeysToRegistry();
+ else return ok;
+
+ if (ok == 0)
+ {
+ printf("\nThe \"Network Time Protocol\" service was successfully created.\n");
+ printf("\nDon't forget!!! You must now go to the Control Panel and");
+ printf("\n use the Services applet to change the account name and");
+ printf("\n password that the NTP Service will use when");
+ printf("\n it starts.");
+ printf("\nTo do this: use the Startup button in the Services applet,");
+ printf("\n and (for example) specify the desired account and");
+ printf("\n correct password.");
+ printf("\nAlso, use the Services applet to ensure this newly installed");
+ printf("\n service starts automatically on bootup.\n");
+ return 0;
+ }
+ }
+ else return ok;
+ }
+ return 0;
+}
+
+/* --------------------------------------------------------------------------------------- */
+
+VOID DisplayHelp(VOID)
+{
+ printf("Installs or removes the NTP service.\n");
+ printf("To install the NTP service,\n");
+ printf("type INSTSRV <path> \n");
+ printf("Where:\n");
+ printf(" path Absolute path to the NTP service, name.exe. You must\n");
+ printf(" use a fully qualified path and the drive letter must be for a\n");
+ printf(" fixed, local drive.\n\n");
+ printf("For example, INSTSRV i:\\winnt\\system32\\ntpd.exe\n");
+ printf("To remove the NTP service,\n");
+ printf("type INSTSRV remove \n");
+
+}
+
+/* EOF */
diff --git a/ports/winnt/libntp/MSG00001.bin b/ports/winnt/libntp/MSG00001.bin
new file mode 100644
index 0000000..320ee54
--- /dev/null
+++ b/ports/winnt/libntp/MSG00001.bin
Binary files differ
diff --git a/ports/winnt/libntp/SetSystemTime.c b/ports/winnt/libntp/SetSystemTime.c
new file mode 100644
index 0000000..8cb4317
--- /dev/null
+++ b/ports/winnt/libntp/SetSystemTime.c
@@ -0,0 +1,34 @@
+
+#include <config.h>
+
+#include "clockstuff.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+
+pset_tod_using set_tod_using = NULL;
+
+int
+ntp_set_tod(
+ struct timeval *tv,
+ void *tzp
+ )
+{
+ SYSTEMTIME st;
+ union {
+ FILETIME ft;
+ ULONGLONG ull;
+ } t;
+
+ UNUSED_ARG(tzp);
+
+ t.ull = FILETIME_1970 +
+ (ULONGLONG)tv->tv_sec * 10 * 1000 * 1000 +
+ (ULONGLONG)tv->tv_usec * 10;
+
+ if (!FileTimeToSystemTime(&t.ft, &st) || !SetSystemTime(&st)) {
+ msyslog(LOG_ERR, "SetSystemTime failed: %m");
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/ports/winnt/libntp/getclock.c b/ports/winnt/libntp/getclock.c
new file mode 100644
index 0000000..68496bd
--- /dev/null
+++ b/ports/winnt/libntp/getclock.c
@@ -0,0 +1,63 @@
+/*
+ * getclock.c - Emulate Unix getclock(3) nanosecond interface for libntp/ntpd
+ */
+#include "config.h"
+
+#include "ntp_unixtime.h"
+#include "clockstuff.h"
+#include "ntp_stdlib.h"
+
+/*
+ * getclock() is in libntp. To use interpolation,
+ * ports/winnt/ntpd/nt_clockstuff.c overrides GetSystemTimeAsFileTime
+ * via the pointer get_sys_time_as_filetime.
+ */
+PGSTAFT get_sys_time_as_filetime;
+PGSTAFT pGetSystemTimePreciseAsFileTime;
+
+
+int
+getclock(
+ int clktyp,
+ struct timespec *ts
+ )
+{
+ union {
+ FILETIME ft;
+ ULONGLONG ull;
+ } uNow;
+
+ if (clktyp != TIMEOFDAY) {
+ TRACE(1, ("getclock() supports only TIMEOFDAY clktyp\n"));
+ errno = EINVAL;
+ return -1;
+ }
+
+ (*get_sys_time_as_filetime)(&uNow.ft);
+
+ /*
+ * Convert the hecto-nano second time to timespec format
+ */
+ uNow.ull -= FILETIME_1970;
+ ts->tv_sec = (time_t)( uNow.ull / HECTONANOSECONDS);
+ ts->tv_nsec = (long)(( uNow.ull % HECTONANOSECONDS) * 100);
+
+ return 0;
+}
+
+
+void
+init_win_precise_time(void)
+{
+ HANDLE hDll;
+ FARPROC pfn;
+
+ hDll = LoadLibrary("kernel32");
+ pfn = GetProcAddress(hDll, "GetSystemTimePreciseAsFileTime");
+ if (NULL != pfn) {
+ pGetSystemTimePreciseAsFileTime = (PGSTAFT)pfn;
+ get_sys_time_as_filetime = pGetSystemTimePreciseAsFileTime;
+ } else {
+ get_sys_time_as_filetime = &GetSystemTimeAsFileTime;
+ }
+}
diff --git a/ports/winnt/libntp/messages.h b/ports/winnt/libntp/messages.h
new file mode 100644
index 0000000..4753711
--- /dev/null
+++ b/ports/winnt/libntp/messages.h
@@ -0,0 +1,199 @@
+ /*
+ Microsoft Developer Support
+ Copyright (c) 1992 Microsoft Corporation
+
+ This file contains the message definitions for the Win32
+ syslog support messages for the nntp firewall
+-------------------------------------------------------------------------
+ HEADER SECTION
+
+ The header section defines names and language identifiers for use
+ by the message definitions later in this file. The MessageIdTypedef,
+ SeverityNames, FacilityNames, and LanguageNames keywords are
+ optional and not required.
+
+
+
+ The MessageIdTypedef keyword gives a typedef name that is used in a
+ type cast for each message code in the generated include file. Each
+ message code appears in the include file with the format: #define
+ name ((type) 0xnnnnnnnn) The default value for type is empty, and no
+ type cast is generated. It is the programmer's responsibility to
+ specify a typedef statement in the application source code to define
+ the type. The type used in the typedef must be large enough to
+ accomodate the entire 32-bit message code.
+
+
+
+ The SeverityNames keyword defines the set of names that are allowed
+ as the value of the Severity keyword in the message definition. The
+ set is delimited by left and right parentheses. Associated with each
+ severity name is a number that, when shifted left by 30, gives the
+ bit pattern to logical-OR with the Facility value and MessageId
+ value to form the full 32-bit message code. The default value of
+ this keyword is:
+
+ SeverityNames=(
+ Success=0x0
+ Informational=0x1
+ Warning=0x2
+ Error=0x3
+ )
+
+ Severity values occupy the high two bits of a 32-bit message code.
+ Any severity value that does not fit in two bits is an error. The
+ severity codes can be given symbolic names by following each value
+ with :name
+
+
+FacilityNames=(System=0x0:FACILITY_SYSTEM
+ Runtime=0x2:FACILITY_RUNTIME
+ Stubs=0x3:FACILITY_STUBS
+ Io=0x4:FACILITY_IO_ERROR_CODE
+ )
+
+ The FacilityNames keyword defines the set of names that are allowed
+ as the value of the Facility keyword in the message definition. The
+ set is delimited by left and right parentheses. Associated with each
+ facility name is a number that, when shift it left by 16 bits, gives
+ the bit pattern to logical-OR with the Severity value and MessageId
+ value to form the full 32-bit message code. The default value of
+ this keyword is:
+
+ FacilityNames=(
+ System=0x0FF
+ Application=0xFFF
+ )
+
+ Facility codes occupy the low order 12 bits of the high order
+ 16-bits of a 32-bit message code. Any facility code that does not
+ fit in 12 bits is an error. This allows for 4,096 facility codes.
+ The first 256 codes are reserved for use by the system software. The
+ facility codes can be given symbolic names by following each value
+ with :name
+
+
+ The LanguageNames keyword defines the set of names that are allowed
+ as the value of the Language keyword in the message definition. The
+ set is delimited by left and right parentheses. Associated with each
+ language name is a number and a file name that are used to name the
+ generated resource file that contains the messages for that
+ language. The number corresponds to the language identifier to use
+ in the resource table. The number is separated from the file name
+ with a colon. The initial value of LanguageNames is:
+
+ LanguageNames=(English=1:MSG00001)
+
+ Any new names in the source file which don't override the built-in
+ names are added to the list of valid languages. This allows an
+ application to support private languages with descriptive names.
+
+
+-------------------------------------------------------------------------
+ MESSAGE DEFINITION SECTION
+
+ Following the header section is the body of the Message Compiler
+ source file. The body consists of zero or more message definitions.
+ Each message definition begins with one or more of the following
+ statements:
+
+ MessageId = [number|+number]
+ Severity = severity_name
+ Facility = facility_name
+ SymbolicName = name
+
+ The MessageId statement marks the beginning of the message
+ definition. A MessageID statement is required for each message,
+ although the value is optional. If no value is specified, the value
+ used is the previous value for the facility plus one. If the value
+ is specified as +number then the value used is the previous value
+ for the facility, plus the number after the plus sign. Otherwise, if
+ a numeric value is given, that value is used. Any MessageId value
+ that does not fit in 16 bits is an error.
+
+ The Severity and Facility statements are optional. These statements
+ specify additional bits to OR into the final 32-bit message code. If
+ not specified they default to the value last specified for a message
+ definition. The initial values prior to processing the first message
+ definition are:
+
+ Severity=Success
+ Facility=Application
+
+ The value associated with Severity and Facility must match one of
+ the names given in the FacilityNames and SeverityNames statements in
+ the header section. The SymbolicName statement allows you to
+ associate a C/C++ symbolic constant with the final 32-bit message
+ code.
+ */
+//
+// Values are 32 bit values laid out as follows:
+//
+// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+// +---+-+-+-----------------------+-------------------------------+
+// |Sev|C|R| Facility | Code |
+// +---+-+-+-----------------------+-------------------------------+
+//
+// where
+//
+// Sev - is the severity code
+//
+// 00 - Success
+// 01 - Informational
+// 10 - Warning
+// 11 - Error
+//
+// C - is the Customer code flag
+//
+// R - is a reserved bit
+//
+// Facility - is the facility code
+//
+// Code - is the facility's status code
+//
+//
+// Define the facility codes
+//
+
+
+//
+// Define the severity codes
+//
+#define STATUS_SEVERITY_WARNING 0x2
+#define STATUS_SEVERITY_SUCCESS 0x0
+#define STATUS_SEVERITY_INFORMATIONAL 0x1
+#define STATUS_SEVERITY_ERROR 0x3
+
+
+//
+// MessageId: NTP_ERROR
+//
+// MessageText:
+//
+// %1
+//
+#define NTP_ERROR ((DWORD)0xC0000001L)
+
+//
+// MessageId: NTP_WARNING
+//
+// MessageText:
+//
+// %1
+//
+//
+#define NTP_WARNING ((DWORD)0x80000002L)
+
+//
+// MessageId: NTP_INFO
+//
+// MessageText:
+//
+// %1
+//
+//
+//
+//
+#define NTP_INFO ((DWORD)0x40000003L)
+
diff --git a/ports/winnt/libntp/messages.mc b/ports/winnt/libntp/messages.mc
new file mode 100644
index 0000000..3a6bc7d
--- /dev/null
+++ b/ports/winnt/libntp/messages.mc
@@ -0,0 +1,161 @@
+; /*
+; Microsoft Developer Support
+; Copyright (c) 1992 Microsoft Corporation
+;
+; This file contains the message definitions for the Win32
+; syslog support messages for the nntp firewall
+
+;-------------------------------------------------------------------------
+; HEADER SECTION
+;
+; The header section defines names and language identifiers for use
+; by the message definitions later in this file. The MessageIdTypedef,
+; SeverityNames, FacilityNames, and LanguageNames keywords are
+; optional and not required.
+;
+;
+MessageIdTypedef=DWORD
+;
+; The MessageIdTypedef keyword gives a typedef name that is used in a
+; type cast for each message code in the generated include file. Each
+; message code appears in the include file with the format: #define
+; name ((type) 0xnnnnnnnn) The default value for type is empty, and no
+; type cast is generated. It is the programmer's responsibility to
+; specify a typedef statement in the application source code to define
+; the type. The type used in the typedef must be large enough to
+; accomodate the entire 32-bit message code.
+;
+;
+SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
+ Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
+ Warning=0x2:STATUS_SEVERITY_WARNING
+ Error=0x3:STATUS_SEVERITY_ERROR
+ )
+;
+; The SeverityNames keyword defines the set of names that are allowed
+; as the value of the Severity keyword in the message definition. The
+; set is delimited by left and right parentheses. Associated with each
+; severity name is a number that, when shifted left by 30, gives the
+; bit pattern to logical-OR with the Facility value and MessageId
+; value to form the full 32-bit message code. The default value of
+; this keyword is:
+;
+; SeverityNames=(
+; Success=0x0
+; Informational=0x1
+; Warning=0x2
+; Error=0x3
+; )
+;
+; Severity values occupy the high two bits of a 32-bit message code.
+; Any severity value that does not fit in two bits is an error. The
+; severity codes can be given symbolic names by following each value
+; with :name
+;
+;
+;FacilityNames=(System=0x0:FACILITY_SYSTEM
+; Runtime=0x2:FACILITY_RUNTIME
+; Stubs=0x3:FACILITY_STUBS
+; Io=0x4:FACILITY_IO_ERROR_CODE
+; )
+;
+; The FacilityNames keyword defines the set of names that are allowed
+; as the value of the Facility keyword in the message definition. The
+; set is delimited by left and right parentheses. Associated with each
+; facility name is a number that, when shift it left by 16 bits, gives
+; the bit pattern to logical-OR with the Severity value and MessageId
+; value to form the full 32-bit message code. The default value of
+; this keyword is:
+;
+; FacilityNames=(
+; System=0x0FF
+; Application=0xFFF
+; )
+;
+; Facility codes occupy the low order 12 bits of the high order
+; 16-bits of a 32-bit message code. Any facility code that does not
+; fit in 12 bits is an error. This allows for 4,096 facility codes.
+; The first 256 codes are reserved for use by the system software. The
+; facility codes can be given symbolic names by following each value
+; with :name
+;
+;
+; The LanguageNames keyword defines the set of names that are allowed
+; as the value of the Language keyword in the message definition. The
+; set is delimited by left and right parentheses. Associated with each
+; language name is a number and a file name that are used to name the
+; generated resource file that contains the messages for that
+; language. The number corresponds to the language identifier to use
+; in the resource table. The number is separated from the file name
+; with a colon. The initial value of LanguageNames is:
+;
+; LanguageNames=(English=1:MSG00001)
+;
+; Any new names in the source file which don't override the built-in
+; names are added to the list of valid languages. This allows an
+; application to support private languages with descriptive names.
+;
+;
+;-------------------------------------------------------------------------
+; MESSAGE DEFINITION SECTION
+;
+; Following the header section is the body of the Message Compiler
+; source file. The body consists of zero or more message definitions.
+; Each message definition begins with one or more of the following
+; statements:
+;
+; MessageId = [number|+number]
+; Severity = severity_name
+; Facility = facility_name
+; SymbolicName = name
+;
+; The MessageId statement marks the beginning of the message
+; definition. A MessageID statement is required for each message,
+; although the value is optional. If no value is specified, the value
+; used is the previous value for the facility plus one. If the value
+; is specified as +number then the value used is the previous value
+; for the facility, plus the number after the plus sign. Otherwise, if
+; a numeric value is given, that value is used. Any MessageId value
+; that does not fit in 16 bits is an error.
+;
+; The Severity and Facility statements are optional. These statements
+; specify additional bits to OR into the final 32-bit message code. If
+; not specified they default to the value last specified for a message
+; definition. The initial values prior to processing the first message
+; definition are:
+;
+; Severity=Success
+; Facility=Application
+;
+; The value associated with Severity and Facility must match one of
+; the names given in the FacilityNames and SeverityNames statements in
+; the header section. The SymbolicName statement allows you to
+; associate a C/C++ symbolic constant with the final 32-bit message
+; code.
+; */
+
+MessageId=0x1
+Severity=Error
+Facility=Application
+SymbolicName=NTP_ERROR
+Language=English
+%1
+.
+
+MessageId=0x2
+Severity=Warning
+Facility=Application
+SymbolicName=NTP_WARNING
+Language=English
+%1
+
+.
+MessageId=0x3
+Severity=Informational
+Facility=Application
+SymbolicName=NTP_INFO
+Language=English
+%1
+
+
+
diff --git a/ports/winnt/libntp/messages.rc b/ports/winnt/libntp/messages.rc
new file mode 100644
index 0000000..0abcb0f
--- /dev/null
+++ b/ports/winnt/libntp/messages.rc
@@ -0,0 +1,2 @@
+LANGUAGE 0x9,0x1
+1 11 "MSG00001.bin"
diff --git a/ports/winnt/libntp/randfile.c b/ports/winnt/libntp/randfile.c
new file mode 100644
index 0000000..7de80b8
--- /dev/null
+++ b/ports/winnt/libntp/randfile.c
@@ -0,0 +1,109 @@
+/*
+ * Make sure that there is a good source of random characters
+ * so that OpenSSL can work properly and securely.
+ */
+
+#include <config.h>
+#include <wincrypt.h>
+
+#include <stdio.h>
+
+unsigned int getrandom_chars(int desired, unsigned char *buf, int lenbuf);
+BOOL create_random_file(char *filename);
+
+BOOL
+init_randfile()
+{
+ FILE *rf;
+ char *randfile;
+ char *homedir;
+ char tmp[256];
+ /* See if the environmental variable RANDFILE is defined
+ * and the file exists
+ */
+ randfile = getenv("RANDFILE");
+ if (randfile != NULL) {
+ rf = fopen(randfile, "rb");
+ if (rf != NULL) {
+ fclose(rf);
+ return (TRUE);
+ }
+ else {
+ /* The environmental variable exists but not the file */
+ return (create_random_file(randfile));
+ }
+ }
+ /*
+ * If the RANDFILE environmental variable does not exist,
+ * see if the HOME enviromental variable exists and
+ * a .rnd file is in there.
+ */
+ homedir = getenv("HOME");
+ if (homedir != NULL &&
+ (strlen(homedir) + 5 /* \.rnd */) < sizeof(tmp)) {
+ snprintf(tmp, sizeof(tmp), "%s\\.rnd", homedir);
+ rf = fopen(tmp, "rb");
+ if (rf != NULL) {
+ fclose(rf);
+ return (TRUE);
+ }
+ else {
+ /* The HOME environmental variable exists but not the file */
+ return (create_random_file(tmp));
+ }
+ }
+ /*
+ * Final try. Look for it on the C:\ directory
+ * NOTE: This is a really bad place for it security-wise
+ * However, OpenSSL looks for it there if it can't find it elsewhere
+ */
+ rf = fopen("C:\\.rnd", "rb");
+ if (rf != NULL) {
+ fclose(rf);
+ return (TRUE);
+ }
+ /* The file does not exist */
+ return (create_random_file("C:\\.rnd"));
+}
+/*
+ * Routine to create the random file with 1024 random characters
+ */
+BOOL
+create_random_file(char *filename) {
+ FILE *rf;
+ int nchars;
+ unsigned char buf[1025];
+
+ nchars = getrandom_chars(1024, buf, sizeof(buf));
+ rf = fopen(filename, "wb");
+ if (rf == NULL)
+ return (FALSE);
+ fwrite(buf, sizeof(unsigned char), nchars, rf);
+ fclose(rf);
+ return (TRUE);
+}
+
+unsigned int
+getrandom_chars(int desired, unsigned char *buf, int lenbuf) {
+ HCRYPTPROV hcryptprov;
+ BOOL err;
+
+ if (buf == NULL || lenbuf <= 0 || desired > lenbuf)
+ return (0);
+ /*
+ * The first time we just try to acquire the context
+ */
+ err = CryptAcquireContext(&hcryptprov, NULL, NULL, PROV_RSA_FULL,
+ CRYPT_VERIFYCONTEXT);
+ if (!err){
+ return (0);
+ }
+ if (!CryptGenRandom(hcryptprov, desired, buf)) {
+ CryptReleaseContext(hcryptprov, 0);
+ return (0);
+ }
+
+ CryptReleaseContext(hcryptprov, 0);
+ return (desired);
+}
+
diff --git a/ports/winnt/libntp/setpriority.c b/ports/winnt/libntp/setpriority.c
new file mode 100644
index 0000000..52ab785
--- /dev/null
+++ b/ports/winnt/libntp/setpriority.c
@@ -0,0 +1,76 @@
+#include <config.h>
+#include <stdio.h>
+#include <sys/resource.h> /* our private version */
+#include "ntp_stdlib.h"
+#include "ntp_syslog.h"
+#include "ntp_debug.h"
+#include "ntp_fp.h"
+#include "ntp.h"
+#include "clockstuff.h"
+
+
+/*
+ * setpriority
+ *
+ * to reduce the #ifdef forest in the portable code,
+ * we emulate the BSD setpriority interface:
+ *
+ * if (-1 == setpriority(PRIO_PROCESS, 0, NTP_PRIO))
+ * msyslog(LOG_ERR, "setpriority() error: %m");
+ *
+ * However, since the Windows port of ntpd has always raised its
+ * priority (to realtime if allowed, or silently downgraded to
+ * high by the system if not) with or without -N. Changing that
+ * now would endanger users who upgrade the binary without adding
+ * -N to its invocation. Instsrv assumes ntpd.exe is installed
+ * with no command-line arguments.
+ *
+ * This routine is used by utilities as well as ntpd itself, so
+ * it checks if the priority is already high or realtime and
+ * logs no complaints in that case, to avoid duplicating. ntpd
+ * will have raised the priority to one of those in
+ * init_winnt_time, while the utilities will rely on this
+ * code.
+ *
+ */
+
+int setpriority(
+ int which,
+ int who,
+ int prio
+ )
+{
+ BOOL success;
+ DWORD prio_class;
+
+ if (PRIO_PROCESS != which || who || NTP_PRIO != prio)
+ TRACE(1, ("windows setpriority() clone needs work.\n"));
+
+ prio_class = GetPriorityClass(GetCurrentProcess());
+
+ if (HIGH_PRIORITY_CLASS == prio_class ||
+ REALTIME_PRIORITY_CLASS == prio_class)
+ return 0;
+
+ success = SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
+
+ if (!success) {
+ msyslog(LOG_ERR, "Unable to raise priority: %m");
+ errno = EPERM;
+ return -1;
+ }
+
+ prio_class = GetPriorityClass(GetCurrentProcess());
+
+ if (REALTIME_PRIORITY_CLASS == prio_class)
+ msyslog(LOG_INFO, "Raised to realtime priority class");
+ else if (HIGH_PRIORITY_CLASS == prio_class)
+ msyslog(LOG_ERR, "Raised to high priority class, realtime "
+ "requires Increase Scheduling Priority "
+ "privilege (enabled with secpol.msc).");
+ else
+ msyslog(LOG_ERR, "Unexpected process priority class %d",
+ prio_class);
+
+ return 0;
+}
diff --git a/ports/winnt/libntp/syslog.c b/ports/winnt/libntp/syslog.c
new file mode 100644
index 0000000..71c90c2
--- /dev/null
+++ b/ports/winnt/libntp/syslog.c
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* From BIND 9 lib/isc/win32/: syslog.c,v 1.6 2002/08/03 01:34:14 mayer */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <windows.h>
+#include <string.h>
+#include <stdlib.h>
+#include <syslog.h>
+
+#include <isc/strerror.h>
+#include <lib_strbuf.h>
+
+#include "ntp_stdlib.h"
+
+#include "messages.h"
+
+static HANDLE hAppLog = NULL;
+static FILE *log_stream;
+static int debug_level = 0;
+static char progname[51] = "NTP";
+static int logmask = 0;
+
+static struct dsn_c_pvt_sfnt {
+ int val;
+ const char *strval;
+} facilities[] = {
+ { LOG_KERN, "kern" },
+ { LOG_USER, "user" },
+ { LOG_MAIL, "mail" },
+ { LOG_DAEMON, "daemon" },
+ { LOG_AUTH, "auth" },
+ { LOG_SYSLOG, "syslog" },
+ { LOG_LPR, "lpr" },
+#ifdef LOG_NEWS
+ { LOG_NEWS, "news" },
+#endif
+#ifdef LOG_UUCP
+ { LOG_UUCP, "uucp" },
+#endif
+#ifdef LOG_CRON
+ { LOG_CRON, "cron" },
+#endif
+#ifdef LOG_AUTHPRIV
+ { LOG_AUTHPRIV, "authpriv" },
+#endif
+#ifdef LOG_FTP
+ { LOG_FTP, "ftp" },
+#endif
+ { LOG_LOCAL0, "local0"},
+ { LOG_LOCAL1, "local1"},
+ { LOG_LOCAL2, "local2"},
+ { LOG_LOCAL3, "local3"},
+ { LOG_LOCAL4, "local4"},
+ { LOG_LOCAL5, "local5"},
+ { LOG_LOCAL6, "local6"},
+ { LOG_LOCAL7, "local7"},
+ { 0, NULL }
+};
+
+#if 0
+BOOL
+isc_syslog_facilityfromstring(const char *str, int *facilityp) {
+ int i;
+
+ REQUIRE(str != NULL);
+ REQUIRE(facilityp != NULL);
+
+ for (i = 0 ; facilities[i].strval != NULL ; i++) {
+ if (strcasecmp(facilities[i].strval, str) == 0) {
+ *facilityp = facilities[i].val;
+ return (TRUE);
+ }
+ }
+ return (FALSE);
+}
+#endif
+/*
+ * Log to the NT Event Log
+ */
+void
+syslog(int level, const char *fmt, ...) {
+ va_list ap;
+ char buf[1024];
+ char *str[1];
+
+ str[0] = buf;
+
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+
+ /* Make sure that the channel is open to write the event */
+ if (hAppLog == NULL) {
+ openlog(progname, LOG_PID);
+ }
+ switch (level) {
+ case LOG_INFO:
+ case LOG_NOTICE:
+ case LOG_DEBUG:
+ ReportEvent(hAppLog, EVENTLOG_INFORMATION_TYPE, 0,
+ NTP_INFO, NULL, 1, 0, str, NULL);
+ break;
+ case LOG_WARNING:
+ ReportEvent(hAppLog, EVENTLOG_WARNING_TYPE, 0,
+ NTP_WARNING, NULL, 1, 0, str, NULL);
+ break;
+ default:
+ ReportEvent(hAppLog, EVENTLOG_ERROR_TYPE, 0,
+ NTP_ERROR, NULL, 1, 0, str, NULL);
+ break;
+ }
+}
+
+/*
+ * Initialize event logging
+ */
+void
+openlog(const char *name, int flags, ...) {
+ /* Get a handle to the Application event log */
+ hAppLog = RegisterEventSource(NULL, progname);
+ strlcpy(progname, name, sizeof(progname));
+}
+
+/*
+ * Close the Handle to the application Event Log
+ * We don't care whether or not we succeeded so ignore return values
+ * In fact if we failed then we would have nowhere to put the message
+ */
+void
+closelog() {
+ DeregisterEventSource(hAppLog);
+}
+
+/*
+ * Keep event logging synced with the current debug level
+ */
+void
+ModifyLogLevel(int level) {
+ debug_level = level;
+}
+/*
+ * Set the log priority mask to the given value.
+ * Return the previous priority mask
+ * Note that this setting is ignored in Win32
+ */
+int
+setlogmask(int maskpri) {
+ int temp = logmask;
+ logmask = maskpri;
+ return (temp);
+}
+
+/*
+ * Initialize logging for the port section of libbind.
+ * Piggyback onto stream given.
+ */
+void
+InitNTLogging(FILE *stream, int debug) {
+ log_stream = stream;
+ ModifyLogLevel(debug);
+}
+/*
+ * This function is for reporting errors to the application
+ * event log in case the regular syslog is not available
+ * mainly during startup. It should not be used under normal
+ * circumstances.
+ */
+void
+NTReportError(const char *name, const char *str) {
+ HANDLE hNTAppLog = NULL;
+ const char *buf[1];
+
+ buf[0] = str;
+
+ hNTAppLog = RegisterEventSource(NULL, name);
+
+ ReportEvent(hNTAppLog, EVENTLOG_ERROR_TYPE, 0,
+ NTP_ERROR, NULL, 1, 0, buf, NULL);
+
+ DeregisterEventSource(hNTAppLog);
+}
+
+
+/*
+ * ntp_strerror() - provide strerror()-compatible wrapper for libisc's
+ * isc__strerror(), which knows about Windows as well as
+ * C runtime error messages.
+ */
+
+char *
+ntp_strerror(
+ int code
+ )
+{
+ char * buf;
+
+ LIB_GETBUF(buf);
+ isc__strerror(code, buf, LIB_BUFLENGTH);
+
+ return buf;
+}
diff --git a/ports/winnt/libntp/termios.c b/ports/winnt/libntp/termios.c
new file mode 100644
index 0000000..3fe4e48
--- /dev/null
+++ b/ports/winnt/libntp/termios.c
@@ -0,0 +1,789 @@
+/* This file implements system calls that are not compatible with UNIX */
+/* Moved to libntp/termios.c */
+
+#include <config.h>
+#include <io.h>
+#include <stdio.h>
+
+#include "ntp.h"
+#include "ntp_tty.h"
+#include "lib_strbuf.h"
+#include "ntp_assert.h"
+#include "win32_io.h"
+
+#define MAX_SERIAL 255 /* COM1: - COM255: */
+
+typedef struct comhandles_tag {
+ HANDLE h;
+ size_t opens;
+ HANDLE * dupes;
+} comhandles;
+
+comhandles * hnds; /* handle/dupes array */
+size_t c_hnds; /* current array size */
+
+/*
+ * common_serial_open ensures duplicate opens of the same port
+ * work by duplicating the handle for the 2nd open, allowing
+ * refclock_atom to share a GPS refclock's comm port.
+ */
+HANDLE common_serial_open(
+ char * dev,
+ char ** pwindev
+ )
+{
+ char * windev;
+ HANDLE handle;
+ size_t unit;
+ size_t prev_c_hnds;
+ size_t opens;
+ char * pch;
+
+ /*
+ * This is odd, but we'll take any unix device path
+ * by looking for the initial '/' and strip off everything
+ * before the final digits, then translate that to COM__:
+ * maintaining backward compatibility with NTP practice of
+ * mapping unit 0 to the nonfunctional COM0:
+ *
+ * To ease the job of taking the windows COMx: device names
+ * out of reference clocks, we'll also work with those
+ * equanimously.
+ */
+
+ TRACE(1, ("common_serial_open given %s\n", dev));
+
+ pch = NULL;
+ if ('/' == dev[0]) {
+ pch = dev + strlen(dev) - 1;
+
+ if (isdigit(pch[0])) {
+ while (isdigit(pch[0])) {
+ pch--;
+ }
+ pch++;
+ }
+ TRACE(1, ("common_serial_open skipped to ending digits leaving %s\n", pch));
+ } else if ('c' == tolower(dev[0])
+ && 'o' == tolower(dev[1])
+ && 'm' == tolower(dev[2])) {
+ pch = dev + 3;
+ TRACE(1, ("common_serial_open skipped COM leaving %s\n", pch));
+ }
+
+ if (!pch || !isdigit(pch[0])) {
+ TRACE(1, ("not a digit: %s\n", pch ? pch : "[NULL]"));
+ return INVALID_HANDLE_VALUE;
+ }
+
+ if (1 != sscanf(pch, "%d", &unit)
+ || unit > MAX_SERIAL
+ || unit < 0) {
+ TRACE(1, ("sscanf failure of %s\n", pch));
+ return INVALID_HANDLE_VALUE;
+ }
+
+
+ if (c_hnds < unit + 1) {
+ prev_c_hnds = c_hnds;
+ c_hnds = unit + 1;
+ /* round up to closest multiple of 4 to avoid churn */
+ c_hnds = (c_hnds + 3) & ~3;
+ hnds = erealloc_zero(hnds, c_hnds * sizeof(hnds[0]),
+ prev_c_hnds * sizeof(hnds[0]));
+ }
+
+ if (NULL == hnds[unit].h) {
+ NTP_ENSURE(0 == hnds[unit].opens);
+ LIB_GETBUF(windev);
+ snprintf(windev, LIB_BUFLENGTH, "\\\\.\\COM%d", unit);
+ TRACE(1, ("windows device %s\n", windev));
+ *pwindev = windev;
+ hnds[unit].h =
+ CreateFile(
+ windev,
+ GENERIC_READ | GENERIC_WRITE,
+ 0, /* sharing prohibited */
+ NULL, /* default security */
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
+ NULL);
+ if (INVALID_HANDLE_VALUE == hnds[unit].h)
+ hnds[unit].h = NULL;
+ }
+
+ if (NULL != hnds[unit].h) {
+ /* think handle = dup(hnds[unit].h); */
+ DuplicateHandle(
+ GetCurrentProcess(),
+ hnds[unit].h,
+ GetCurrentProcess(),
+ &handle,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS
+ );
+ hnds[unit].opens++;
+ opens = hnds[unit].opens;
+ hnds[unit].dupes = erealloc(hnds[unit].dupes, opens *
+ sizeof(hnds[unit].dupes[0]));
+ hnds[unit].dupes[opens - 1] = handle;
+ return handle;
+ }
+
+ return INVALID_HANDLE_VALUE;
+}
+
+
+/*
+ * closeserial() is used in place of close by ntpd refclock I/O for ttys
+ */
+int
+closeserial(int fd)
+{
+ HANDLE h;
+ BOOL found;
+ size_t u;
+ size_t d;
+
+ h = (HANDLE)_get_osfhandle(fd);
+ if (INVALID_HANDLE_VALUE == h) {
+ errno = EBADF;
+ return -1;
+ }
+
+ d = 0; /* silence potent. uninit. warning */
+ found = FALSE;
+ for (u = 0; u < c_hnds; u++) {
+ for (d = 0; d < hnds[u].opens; d++) {
+ if (hnds[u].dupes[d] == h) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (found)
+ break;
+ }
+ if (found) {
+ hnds[u].opens--;
+ if (d < hnds[u].opens)
+ memmove(&hnds[u].dupes[d],
+ &hnds[u].dupes[d + 1],
+ hnds[u].opens - d *
+ sizeof(hnds[u].dupes[d]));
+ if (0 == hnds[u].opens) {
+ CloseHandle(hnds[u].h);
+ hnds[u].h = NULL;
+ }
+ }
+
+ return close(fd);
+}
+
+/*
+ * isserialhandle() -- check if a handle is a COM port handle
+ */
+int isserialhandle(
+ HANDLE h
+ )
+{
+ size_t u;
+ size_t d;
+
+
+ for (u = 0; u < c_hnds; u++)
+ for (d = 0; d < hnds[u].opens; d++)
+ if (hnds[u].dupes[d] == h)
+ return TRUE;
+ return FALSE;
+}
+
+
+/*
+ * tty_open - open serial port for refclock special uses
+ *
+ * This routine opens a serial port for and returns the
+ * file descriptor if success and -1 if failure.
+ */
+int tty_open(
+ char *dev, /* device name pointer */
+ int access, /* O_RDWR */
+ int mode /* unused */
+ )
+{
+ HANDLE Handle;
+ char * windev;
+
+ /*
+ * open communication port handle
+ */
+ windev = NULL;
+ Handle = common_serial_open(dev, &windev);
+ windev = (windev)
+ ? windev
+ : dev;
+
+ if (Handle == INVALID_HANDLE_VALUE) {
+ msyslog(LOG_ERR, "tty_open: device %s CreateFile error: %m", windev);
+ errno = EMFILE; /* lie, lacking conversion from GetLastError() */
+ return -1;
+ }
+
+ return (int)_open_osfhandle((int)Handle, _O_TEXT);
+}
+
+
+/*
+ * refclock_open - open serial port for reference clock
+ *
+ * This routine opens a serial port for I/O and sets default options. It
+ * returns the file descriptor or -1 indicating failure.
+ */
+int refclock_open(
+ char * dev, /* device name pointer */
+ u_int speed, /* serial port speed (code) */
+ u_int flags /* line discipline flags */
+ )
+{
+ char * windev;
+ HANDLE h;
+ COMMTIMEOUTS timeouts;
+ DCB dcb;
+ DWORD dwEvtMask;
+ int fd;
+ int translate;
+
+ /*
+ * open communication port handle
+ */
+ windev = NULL;
+ h = common_serial_open(dev, &windev);
+ windev = (windev) ? windev : dev;
+
+ if (INVALID_HANDLE_VALUE == h) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR, "CreateFile(%s) error: %m",
+ windev);
+ )
+ return -1;
+ }
+
+ /* Change the input/output buffers to be large. */
+ if (!SetupComm(h, 1024, 1024)) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR, "SetupComm(%s) error: %m",
+ windev);
+ )
+ return -1;
+ }
+
+ dcb.DCBlength = sizeof(dcb);
+
+ if (!GetCommState(h, &dcb)) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR,
+ "GetCommState(%s) error: %m",
+ windev);
+ )
+ return -1;
+ }
+
+ switch (speed) {
+
+ case B300:
+ dcb.BaudRate = 300;
+ break;
+
+ case B1200:
+ dcb.BaudRate = 1200;
+ break;
+
+ case B2400:
+ dcb.BaudRate = 2400;
+ break;
+
+ case B4800:
+ dcb.BaudRate = 4800;
+ break;
+
+ case B9600:
+ dcb.BaudRate = 9600;
+ break;
+
+ case B19200:
+ dcb.BaudRate = 19200;
+ break;
+
+ case B38400:
+ dcb.BaudRate = 38400;
+ break;
+
+ case B57600:
+ dcb.BaudRate = 57600;
+ break;
+
+ case B115200:
+ dcb.BaudRate = 115200;
+ break;
+
+ default:
+ msyslog(LOG_ERR, "%s unsupported bps code %u", windev,
+ speed);
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return -1;
+ }
+
+ dcb.fBinary = TRUE;
+ dcb.fParity = TRUE;
+ dcb.fOutxCtsFlow = 0;
+ dcb.fOutxDsrFlow = 0;
+ dcb.fDtrControl = DTR_CONTROL_ENABLE;
+ dcb.fDsrSensitivity = 0;
+ dcb.fTXContinueOnXoff = TRUE;
+ dcb.fOutX = 0;
+ dcb.fInX = 0;
+ dcb.fErrorChar = 0;
+ dcb.fNull = 0;
+ dcb.fRtsControl = RTS_CONTROL_DISABLE;
+ dcb.fAbortOnError = 0;
+ dcb.ByteSize = 8;
+ dcb.StopBits = ONESTOPBIT;
+ dcb.Parity = NOPARITY;
+ dcb.ErrorChar = 0;
+ dcb.EofChar = 0;
+ if (LDISC_RAW & flags)
+ dcb.EvtChar = 0;
+ else
+ dcb.EvtChar = '\r';
+
+ if (!SetCommState(h, &dcb)) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR, "SetCommState(%s) error: %m",
+ windev);
+ )
+ return -1;
+ }
+
+ /* watch out for CR (dcb.EvtChar) as well as the CD line */
+ dwEvtMask = EV_RLSD;
+ if (LDISC_RAW & flags)
+ dwEvtMask |= EV_RXCHAR;
+ else
+ dwEvtMask |= EV_RXFLAG;
+ if (!SetCommMask(h, dwEvtMask)) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR, "SetCommMask(%s) error: %m",
+ windev);
+ )
+ return -1;
+ }
+
+ /* configure the handle to never block */
+ timeouts.ReadIntervalTimeout = MAXDWORD;
+ timeouts.ReadTotalTimeoutMultiplier = 0;
+ timeouts.ReadTotalTimeoutConstant = 0;
+ timeouts.WriteTotalTimeoutMultiplier = 0;
+ timeouts.WriteTotalTimeoutConstant = 0;
+
+ if (!SetCommTimeouts(h, &timeouts)) {
+ SAVE_ERRNO(
+ msyslog(LOG_ERR,
+ "Device %s SetCommTimeouts error: %m",
+ windev);
+ )
+ return -1;
+ }
+
+ translate = (LDISC_RAW & flags)
+ ? 0
+ : _O_TEXT;
+ fd = _open_osfhandle((int)h, translate);
+ /* refclock_open() long returned 0 on failure, avoid it. */
+ if (0 == fd) {
+ fd = _dup(0);
+ _close(0);
+ }
+
+ return fd;
+}
+
+
+int
+ioctl_tiocmget(
+ HANDLE h,
+ int *pi
+ )
+{
+ DWORD dw;
+
+ if (!GetCommModemStatus(h, &dw)) {
+ errno = ENOTTY;
+ return -1;
+ }
+
+ *pi = ((dw & MS_CTS_ON) ? TIOCM_CTS : 0)
+ | ((dw & MS_DSR_ON) ? TIOCM_DSR : 0)
+ | ((dw & MS_RLSD_ON) ? TIOCM_CAR : 0)
+ | ((dw & MS_RING_ON) ? TIOCM_RI : 0);
+
+ return 0;
+}
+
+
+int
+ioctl_tiocmset(
+ HANDLE h,
+ int *pi
+ )
+{
+ BOOL failed;
+ int result;
+
+ failed = !EscapeCommFunction(
+ h,
+ (*pi & TIOCM_RTS)
+ ? SETRTS
+ : CLRRTS
+ );
+
+ if (!failed)
+ failed = !EscapeCommFunction(
+ h,
+ (*pi & TIOCM_DTR)
+ ? SETDTR
+ : CLRDTR
+ );
+
+ if (failed) {
+ errno = ENOTTY;
+ result = -1;
+ } else
+ result = 0;
+
+ return result;
+}
+
+
+int
+ioctl(
+ int fd,
+ int op,
+ int *pi
+ )
+{
+ HANDLE h;
+ int result;
+ int modctl;
+
+ h = (HANDLE)_get_osfhandle(fd);
+
+ if (INVALID_HANDLE_VALUE == h) {
+ /* errno already set */
+ return -1;
+ }
+
+ switch (op) {
+
+ case TIOCMGET:
+ result = ioctl_tiocmget(h, pi);
+ break;
+
+ case TIOCMSET:
+ result = ioctl_tiocmset(h, pi);
+ break;
+
+ case TIOCMBIC:
+ result = ioctl_tiocmget(h, &modctl);
+ if (result < 0)
+ return result;
+ modctl &= ~(*pi);
+ result = ioctl_tiocmset(h, &modctl);
+ break;
+
+ case TIOCMBIS:
+ result = ioctl_tiocmget(h, &modctl);
+ if (result < 0)
+ return result;
+ modctl |= *pi;
+ result = ioctl_tiocmset(h, &modctl);
+ break;
+
+ default:
+ errno = EINVAL;
+ result = -1;
+ }
+
+ return result;
+}
+
+
+int
+tcsetattr(
+ int fd,
+ int optional_actions,
+ const struct termios * tios
+ )
+{
+ DCB dcb;
+ HANDLE h;
+
+ UNUSED_ARG(optional_actions);
+
+ h = (HANDLE)_get_osfhandle(fd);
+
+ if (INVALID_HANDLE_VALUE == h) {
+ /* errno already set */
+ return -1;
+ }
+
+ dcb.DCBlength = sizeof(dcb);
+ if (!GetCommState(h, &dcb)) {
+ errno = ENOTTY;
+ return -1;
+ }
+
+ switch (max(tios->c_ospeed, tios->c_ispeed)) {
+
+ case B300:
+ dcb.BaudRate = 300;
+ break;
+
+ case B1200:
+ dcb.BaudRate = 1200;
+ break;
+
+ case B2400:
+ dcb.BaudRate = 2400;
+ break;
+
+ case B4800:
+ dcb.BaudRate = 4800;
+ break;
+
+ case B9600:
+ dcb.BaudRate = 9600;
+ break;
+
+ case B19200:
+ dcb.BaudRate = 19200;
+ break;
+
+ case B38400:
+ dcb.BaudRate = 38400;
+ break;
+
+ case B57600:
+ dcb.BaudRate = 57600;
+ break;
+
+ case B115200:
+ dcb.BaudRate = 115200;
+ break;
+
+ default:
+ msyslog(LOG_ERR, "unsupported serial baud rate");
+ errno = EINVAL;
+ return -1;
+ }
+
+ switch (tios->c_cflag & CSIZE) {
+
+ case CS5:
+ dcb.ByteSize = 5;
+ break;
+
+ case CS6:
+ dcb.ByteSize = 6;
+ break;
+
+ case CS7:
+ dcb.ByteSize = 7;
+ break;
+
+ case CS8:
+ dcb.ByteSize = 8;
+ break;
+
+ default:
+ msyslog(LOG_ERR, "unsupported serial word size");
+ errno = EINVAL;
+ return FALSE;
+ }
+
+ if (PARENB & tios->c_cflag) {
+ dcb.fParity = TRUE;
+ dcb.Parity = (tios->c_cflag & PARODD)
+ ? ODDPARITY
+ : EVENPARITY;
+ } else {
+ dcb.fParity = FALSE;
+ dcb.Parity = NOPARITY;
+ }
+
+ dcb.StopBits = (CSTOPB & tios->c_cflag)
+ ? TWOSTOPBITS
+ : ONESTOPBIT;
+
+ if (!SetCommState(h, &dcb)) {
+ errno = ENOTTY;
+ return -1;
+ }
+
+ return 0;
+}
+
+
+int
+tcgetattr(
+ int fd,
+ struct termios *tios
+ )
+{
+ DCB dcb;
+ HANDLE h;
+
+ h = (HANDLE)_get_osfhandle(fd);
+
+ if (INVALID_HANDLE_VALUE == h) {
+ /* errno already set */
+ return -1;
+ }
+
+ dcb.DCBlength = sizeof(dcb);
+
+ if (!GetCommState(h, &dcb)) {
+ errno = ENOTTY;
+ return -1;
+ }
+
+ /* Set c_ispeed & c_ospeed */
+
+ switch (dcb.BaudRate) {
+
+ case 300:
+ tios->c_ispeed = tios->c_ospeed = B300;
+ break;
+
+ case 1200:
+ tios->c_ispeed = tios->c_ospeed = B1200;
+ break;
+
+ case 2400:
+ tios->c_ispeed = tios->c_ospeed = B2400;
+ break;
+
+ case 4800:
+ tios->c_ispeed = tios->c_ospeed = B4800;
+ break;
+
+ case 9600:
+ tios->c_ispeed = tios->c_ospeed = B9600;
+ break;
+
+ case 19200:
+ tios->c_ispeed = tios->c_ospeed = B19200;
+ break;
+
+ case 38400:
+ tios->c_ispeed = tios->c_ospeed = B38400;
+ break;
+
+ case 57600:
+ tios->c_ispeed = tios->c_ospeed = B57600;
+ break;
+
+ case 115200:
+ tios->c_ispeed = tios->c_ospeed = B115200;
+ break;
+
+ default:
+ tios->c_ispeed = tios->c_ospeed = B9600;
+ }
+
+
+ switch (dcb.ByteSize) {
+ case 5:
+ tios->c_cflag = CS5;
+ break;
+
+ case 6:
+ tios->c_cflag = CS6;
+ break;
+
+ case 7:
+ tios->c_cflag = CS7;
+ break;
+
+ case 8:
+ default:
+ tios->c_cflag = CS8;
+ }
+
+ if (dcb.fParity) {
+ tios->c_cflag |= PARENB;
+
+ if (ODDPARITY == dcb.Parity)
+ tios->c_cflag |= PARODD;
+ }
+
+ if (TWOSTOPBITS == dcb.StopBits)
+ tios->c_cflag |= CSTOPB;
+
+ tios->c_iflag = 0;
+ tios->c_lflag = 0;
+ tios->c_line = 0;
+ tios->c_oflag = 0;
+
+ return 0;
+}
+
+
+int
+tcflush(
+ int fd,
+ int mode
+ )
+{
+ HANDLE h;
+ BOOL success;
+ DWORD flags;
+ int result;
+
+ h = (HANDLE)_get_osfhandle(fd);
+
+ if (INVALID_HANDLE_VALUE == h) {
+ /* errno already set */
+ return -1;
+ }
+
+ switch (mode) {
+
+ case TCIFLUSH:
+ flags = PURGE_RXCLEAR;
+ break;
+
+ case TCOFLUSH:
+ flags = PURGE_TXABORT;
+ break;
+
+ case TCIOFLUSH:
+ flags = PURGE_RXCLEAR | PURGE_TXABORT;
+ break;
+
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+
+ success = PurgeComm(h, flags);
+
+ if (success)
+ result = 0;
+ else {
+ errno = ENOTTY;
+ result = -1;
+ }
+
+ return result;
+}
+
diff --git a/ports/winnt/libntp/util_clockstuff.c b/ports/winnt/libntp/util_clockstuff.c
new file mode 100644
index 0000000..e4bd0de
--- /dev/null
+++ b/ports/winnt/libntp/util_clockstuff.c
@@ -0,0 +1,26 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "ntp_syslog.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "clockstuff.h"
+
+int
+gettimeofday(
+ struct timeval * tv,
+ void * ignored
+ )
+{
+ struct timespec ts;
+
+ UNUSED_ARG(ignored);
+
+ getclock(TIMEOFDAY, &ts);
+
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec / 10;
+
+ return 0;
+}
diff --git a/ports/winnt/libntp/win32_io.c b/ports/winnt/libntp/win32_io.c
new file mode 100644
index 0000000..9e7a861
--- /dev/null
+++ b/ports/winnt/libntp/win32_io.c
@@ -0,0 +1,81 @@
+/* This file implements i/o calls that are specific to Windows */
+
+#include <config.h>
+#include <stdio.h>
+#include "ntp_fp.h"
+#include "ntp_net.h"
+#include "ntp_stdlib.h"
+#include "ntp_syslog.h"
+#include "win32_io.h"
+#include <isc/win32os.h>
+
+/*
+ * Define this macro to control the behavior of connection
+ * resets on UDP sockets. See Microsoft KnowledgeBase Article Q263823
+ * for details.
+ * Based on that article, it is surprising that a much newer winsock2.h
+ * does not define SIO_UDP_CONNRESET (the one that comes with VS 2008).
+ * NOTE: This requires that Windows 2000 systems install Service Pack 2
+ * or later.
+ */
+#ifndef SIO_UDP_CONNRESET
+#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
+#endif
+
+void
+InitSockets(
+ void
+ )
+{
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+
+ /* Need Winsock 2.0 or better */
+ wVersionRequested = MAKEWORD(2, 0);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+ if ( err != 0 ) {
+ SetLastError(err);
+ mfprintf(stderr, "No usable winsock: %m\n");
+ SetLastError(err);
+ msyslog(LOG_ERR, "No usable winsock: %m");
+ exit(1);
+ }
+}
+
+/*
+ * Windows 2000 systems incorrectly cause UDP sockets using WASRecvFrom
+ * to not work correctly, returning a WSACONNRESET error when a WSASendTo
+ * fails with an "ICMP port unreachable" response and preventing the
+ * socket from using the WSARecvFrom in subsequent operations.
+ * The function below fixes this, but requires that Windows 2000
+ * Service Pack 2 or later be installed on the system. NT 4.0
+ * systems are not affected by this and work correctly.
+ * See Microsoft Knowledge Base Article Q263823 for details of this.
+ */
+void
+connection_reset_fix(
+ SOCKET fd,
+ sockaddr_u * addr
+ )
+{
+ DWORD dw;
+ BOOL bNewBehavior = FALSE;
+ DWORD status;
+
+ /*
+ * disable bad behavior using IOCTL: SIO_UDP_CONNRESET
+ * NT 4.0 has no problem
+ */
+ if (isc_win32os_majorversion() >= 5) {
+ status = WSAIoctl(fd, SIO_UDP_CONNRESET, &bNewBehavior,
+ sizeof(bNewBehavior), NULL, 0,
+ &dw, NULL, NULL);
+ if (SOCKET_ERROR == status)
+ msyslog(LOG_ERR,
+ "connection_reset_fix() failed for address %s: %m",
+ stoa(addr));
+ }
+}
+
diff --git a/ports/winnt/ntpd/hopf_PCI_io.c b/ports/winnt/ntpd/hopf_PCI_io.c
new file mode 100644
index 0000000..a1ba200
--- /dev/null
+++ b/ports/winnt/ntpd/hopf_PCI_io.c
@@ -0,0 +1,335 @@
+/*
+ * hopf_PCI_io.c
+ * Read data from a hopf PCI clock using the ATLSoft WinNT driver.
+ *
+ * Date: 21.03.2000 Revision: 01.10
+ *
+ * Copyright (C) 1999, 2000 by Bernd Altmeier altmeier@ATLSoft.de
+ *
+ */
+
+/*
+ * Ignore nonstandard extension warning.
+ * This happens when including winioctl.h
+ */
+#pragma warning(disable: 4201)
+#define _FILESYSTEMFSCTL_
+
+#include <config.h>
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <winioctl.h>
+
+#include "ntp_stdlib.h"
+#include "hopf_PCI_io.h"
+
+
+#define ATL_PASSTHROUGH_READ_TOSIZE (3 * sizeof(ULONG))
+#define ATL_PASSTHROUGH_READ_FROMSIZE 0
+#define IOCTL_ATLSOFT_PASSTHROUGH_READ CTL_CODE( \
+ FILE_DEVICE_UNKNOWN, \
+ 0x805, \
+ METHOD_BUFFERED, \
+ FILE_ANY_ACCESS)
+
+
+HANDLE hDevice = NULL; // this is the handle to the PCI Device
+
+HANDLE hRdEvent;
+OVERLAPPED Rdoverlapped;
+OVERLAPPED * pRdOverlapped;
+
+ULONG iobuffer[256];
+DWORD cbReturned;
+BOOL HaveBoard = FALSE;
+
+struct {
+ ULONG region;
+ ULONG offset;
+ ULONG count;
+} io_params;
+
+
+BOOL
+OpenHopfDevice(void)
+{
+ OSVERSIONINFO VersionInfo;
+ ULONG deviceNumber;
+ CHAR deviceName[255];
+
+ VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&VersionInfo);
+ switch (VersionInfo.dwPlatformId) {
+
+ case VER_PLATFORM_WIN32_WINDOWS: // Win95/98
+ return FALSE; // "NTP does not support Win 95-98."
+ break;
+
+ case VER_PLATFORM_WIN32_NT: // WinNT
+ deviceNumber = 0;
+ snprintf(deviceName, sizeof(deviceName),
+ "\\\\.\\hclk6039%d", deviceNumber + 1);
+ hDevice = CreateFile(
+ deviceName,
+ GENERIC_WRITE | GENERIC_READ,
+ FILE_SHARE_WRITE | FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_DELETE_ON_CLOSE | FILE_FLAG_OVERLAPPED,
+ NULL);
+ break;
+
+ default:
+ hDevice = INVALID_HANDLE_VALUE;
+ break;
+ } // end switch
+
+ if (INVALID_HANDLE_VALUE == hDevice) // the system didn't return a handle
+ return FALSE; //"A handle to the driver could not be obtained properly"
+
+ // an event to be used for async transfers
+ hRdEvent = CreateEvent(
+ NULL,
+ TRUE,
+ FALSE,
+ NULL);
+
+ if (INVALID_HANDLE_VALUE == hRdEvent)
+ return FALSE; // the system didn't return a handle
+
+ pRdOverlapped = &Rdoverlapped;
+ pRdOverlapped->hEvent = hRdEvent;
+
+ HaveBoard = TRUE; // board installed and we have access
+
+ return TRUE;
+} // end of OpenHopfDevice()
+
+
+BOOL
+CloseHopfDevice(void)
+{
+ CloseHandle(hRdEvent);// When done, close the handle to the driver
+
+ return CloseHandle(hDevice);
+} // end of CloseHopfDevice()
+
+
+void
+ReadHopfDevice(void)
+{
+ if (!HaveBoard)
+ return;
+
+ DeviceIoControl(
+ hDevice,
+ IOCTL_ATLSOFT_PASSTHROUGH_READ,
+ &io_params,
+ ATL_PASSTHROUGH_READ_TOSIZE,
+ iobuffer,
+ ATL_PASSTHROUGH_READ_FROMSIZE
+ + io_params.count * sizeof(ULONG),
+ &cbReturned,
+ pRdOverlapped
+ );
+}
+
+
+#ifdef NOTUSED
+void
+GetHardwareData(
+ LPDWORD Data32,
+ WORD Ofs
+ )
+{
+ io_params.region = 1;
+ io_params.offset = Ofs;
+ io_params.count = 1;
+ ReadHopfDevice();
+ *Data32 = iobuffer[0];
+}
+#endif /* NOTUSED */
+
+
+void
+GetHopfTime(
+ LPHOPFTIME Data,
+ DWORD Offset
+ )
+{
+ io_params.region = 1;
+ io_params.offset = Offset;
+ io_params.count = 4;
+
+ ReadHopfDevice();
+
+ Data->wHour = 0;
+ Data->wMinute = 0;
+ Data->wSecond = 0;
+ while (iobuffer[0] >= 60 * 60 * 1000) {
+ iobuffer[0] = iobuffer[0] - 60 * 60 * 1000;
+ Data->wHour++;
+ }
+ while (iobuffer[0] >= 60 * 1000) {
+ iobuffer[0] = iobuffer[0] - 60 * 1000;
+ Data->wMinute++;
+ }
+ while (iobuffer[0] >= 1000) {
+ iobuffer[0] = iobuffer[0] - 1000;
+ Data->wSecond++;
+ }
+ Data->wMilliseconds = LOWORD(iobuffer[0]);
+ Data->wDay = HIBYTE(HIWORD(iobuffer[1]));
+ Data->wMonth = LOBYTE(HIWORD(iobuffer[1]));
+ Data->wYear = LOWORD(iobuffer[1]);
+ Data->wDayOfWeek = HIBYTE(HIWORD(iobuffer[2]));
+ if (Data->wDayOfWeek == 7) // Dow Korrektur
+ Data->wDayOfWeek = 0;
+
+ io_params.region = 1;
+ io_params.offset += 0x08;
+ io_params.count = 1;
+
+ ReadHopfDevice();
+
+ Data->wStatus = LOBYTE(HIWORD(iobuffer[0]));
+}
+
+
+#ifdef NOTUSED
+void
+GetHopfLocalTime(
+ LPHOPFTIME Data
+ )
+{
+ DWORD Offset = 0;
+
+ GetHopfTime(Data, Offset);
+}
+#endif /* NOTUSED */
+
+
+void
+GetHopfSystemTime(
+ LPHOPFTIME Data
+ )
+{
+ DWORD Offset = 0x10;
+
+ GetHopfTime(Data,Offset);
+}
+
+
+#ifdef NOTUSED
+void
+GetSatData(
+ LPSATSTAT Data
+ )
+{
+ io_params.region = 1;
+ io_params.offset = 0xb0;
+ io_params.count = 5;
+
+ ReadHopfDevice();
+
+ Data->wVisible = HIBYTE(HIWORD(iobuffer[0]));
+ Data->wMode = LOBYTE(LOWORD(iobuffer[0]));
+ Data->wSat0 = HIBYTE(HIWORD(iobuffer[1]));
+ Data->wRat0 = LOBYTE(HIWORD(iobuffer[1]));
+ Data->wSat1 = HIBYTE(LOWORD(iobuffer[1]));
+ Data->wRat1 = LOBYTE(LOWORD(iobuffer[1]));
+ Data->wSat2 = HIBYTE(HIWORD(iobuffer[2]));
+ Data->wRat2 = LOBYTE(HIWORD(iobuffer[2]));
+ Data->wSat3 = HIBYTE(LOWORD(iobuffer[2]));
+ Data->wRat3 = LOBYTE(LOWORD(iobuffer[2]));
+ Data->wSat4 = HIBYTE(HIWORD(iobuffer[3]));
+ Data->wRat4 = LOBYTE(HIWORD(iobuffer[3]));
+ Data->wSat5 = HIBYTE(LOWORD(iobuffer[3]));
+ Data->wRat5 = LOBYTE(LOWORD(iobuffer[3]));
+ Data->wSat6 = HIBYTE(HIWORD(iobuffer[4]));
+ Data->wRat6 = LOBYTE(HIWORD(iobuffer[4]));
+ Data->wSat7 = HIBYTE(LOWORD(iobuffer[4]));
+ Data->wRat7 = LOBYTE(LOWORD(iobuffer[4]));
+}
+
+
+void
+GetDiffTime(
+ LPLONG Data
+ )
+{
+ io_params.region = 1;
+ io_params.offset = 0x0c;
+ io_params.count = 1;
+
+ ReadHopfDevice();
+
+ *Data = iobuffer[0];
+}
+
+
+void
+GetPosition(
+ LPGPSPOS Data
+ )
+{
+ io_params.region = 1;
+ io_params.offset = 0x90; // Positionsdaten Länge
+ io_params.count = 1;
+
+ ReadHopfDevice();
+
+ Data->wLongitude = iobuffer[0]; //in Millisekunden
+ io_params.region = 1;
+ io_params.offset = 0xa0; // Positionsdaten Breite
+ io_params.count = 1;
+
+ ReadHopfDevice();
+
+ Data->wLatitude = iobuffer[0];
+ Data->wAltitude = 0;
+}
+
+
+void
+GetHardwareVersion(
+ LPCLOCKVER Data
+ )
+{
+ int i;
+
+ io_params.region = 1;
+ io_params.offset = 0x50;
+ io_params.count = 12;
+
+ ReadHopfDevice();
+
+ Data->cVersion[0] = '\0';
+ iobuffer[13] = 0;
+ for (i = 0; i < 13; i++) {
+ Data->cVersion[i * 4 ] = HIBYTE(HIWORD(iobuffer[i]));
+ Data->cVersion[i * 4 + 1] = LOBYTE(HIWORD(iobuffer[i]));
+ Data->cVersion[i * 4 + 2] = HIBYTE(LOWORD(iobuffer[i]));
+ Data->cVersion[i * 4 + 3] = LOBYTE(LOWORD(iobuffer[i]));
+ }
+}
+
+
+void
+GetDCFAntenne(
+ LPDCFANTENNE Data
+ )
+{
+ io_params.region = 1;
+ io_params.offset = 0xcc;
+ io_params.count = 1;
+
+ ReadHopfDevice();
+ Data->bStatus1 = HIBYTE(HIWORD(iobuffer[0]));
+ Data->bStatus = LOBYTE(HIWORD(iobuffer[0]));
+ Data->wAntValue = LOWORD(iobuffer[0]);
+}
+#endif /* NOTUSED */
+
diff --git a/ports/winnt/ntpd/nt_clockstuff.c b/ports/winnt/ntpd/nt_clockstuff.c
new file mode 100644
index 0000000..052bfcd
--- /dev/null
+++ b/ports/winnt/ntpd/nt_clockstuff.c
@@ -0,0 +1,1743 @@
+/* Windows NT Clock Routines
+ *
+ * Created by Sven Dietrich sven@inter-yacht.com
+ *
+ * New interpolation scheme by Dave Hart <davehart@davehart.com> in
+ * February 2009 overcomes 500us-1ms inherent jitter with the older
+ * scheme, first identified by Peter Rosin (nee Ekberg)
+ * <peda@lysator.liu.se> in 2003 [Bug 216].
+ *
+ * Note: The Windows port of ntpd uses the C99-snprintf replacement for
+ * (v)snprintf(), also used by msyslog(), which does not understand the
+ * printf format specifier %I64d, only the more common %lld. With the
+ * minimum supported compiler raised to Visual C++ 2005 in ntp-dev in
+ * August 2011, all MS C runtime routines also understand %lld and %llu.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/resource.h> /* our private version */
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400 /* VS 2005 */
+#include <intrin.h> /* for __rdtsc() */
+#endif
+
+#ifdef HAVE_PPSAPI
+#include <timepps.h>
+/*
+ * ports/winnt/include/timepps.h defines EOPNOTSUPP for compatibility
+ * with PPSAPI on other platforms. ports/winnt/include/isc/net.h has
+ * #define EOPNOTSUPP WSAEOPNOTSUPP, so to avoid a macro redefinition
+ * warning undefine it.
+ */
+#undef EOPNOTSUPP
+#endif /* HAVE_PPSAPI */
+
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+#include "ntp_timer.h"
+#include "ntp_assert.h"
+#include "ntp_leapsec.h"
+#include "clockstuff.h"
+#include "ntservice.h"
+#include "ntpd.h"
+#include "ntpd-opts.h"
+
+extern double sys_residual; /* residual from previous adjustment */
+
+/*
+ * Include code to possibly modify the MM timer while the service is active.
+ */
+
+/*
+ * Whether or not MM timer modifications takes place is still controlled
+ * by the variable below which is initialized by a default value but
+ * might be changed depending on a command line switch.
+ */
+static int modify_mm_timer = MM_TIMER_LORES;
+
+#define MM_TIMER_INTV 1 /* the interval we'd want to set the MM timer to [ms] */
+
+static UINT wTimerRes;
+
+BOOL init_randfile();
+
+static long last_Adj = 0;
+
+#define LS_CORR_INTV_SECS 2 /* seconds to apply leap second correction */
+#define LS_CORR_INTV ( (LONGLONG) HECTONANOSECONDS * LS_CORR_INTV_SECS )
+#define LS_CORR_LIMIT ( (LONGLONG) HECTONANOSECONDS / 2 ) // half a second
+
+typedef union ft_ull {
+ FILETIME ft;
+ ULONGLONG ull;
+ LONGLONG ll;
+ LARGE_INTEGER li;
+} FT_ULL;
+
+/* leap second stuff */
+static FT_ULL ls_ft;
+static DWORD ls_time_adjustment;
+static ULONGLONG ls_ref_perf_cnt;
+static LONGLONG ls_elapsed;
+
+static BOOL winnt_time_initialized = FALSE;
+static BOOL winnt_use_interpolation = FALSE;
+static unsigned clock_thread_id;
+
+
+void WINAPI GetInterpTimeAsFileTime(LPFILETIME pft);
+static void StartClockThread(void);
+static void tune_ctr_freq(LONGLONG, LONGLONG);
+void StopClockThread(void);
+void atexit_revert_mm_timer(void);
+void win_time_stepped(void);
+
+static HANDLE clock_thread = NULL;
+static HANDLE TimerThreadExitRequest = NULL;
+
+/*
+ * interp_time estimates time in 100ns units
+ * based on a performance counter value given.
+ * The 2nd parameter indicates if this is
+ * part of a current time-of-day calculation.
+ */
+ULONGLONG interp_time(ULONGLONG, BOOL);
+
+/*
+ * add_counter_time_pair is called by the
+ * high priority clock thread with a new
+ * sample.
+ */
+void add_counter_time_pair(ULONGLONG, LONGLONG);
+
+/*
+ * globals used by the above two functions to
+ * implement the counter/time history
+ */
+#define BASELINES_TOT 256
+#define BASELINES_USED 64
+
+static volatile int newest_baseline = 0;
+static volatile int newest_baseline_gen = 0;
+static ULONGLONG baseline_counts[BASELINES_TOT] = {0};
+static LONGLONG baseline_times[BASELINES_TOT] = {0};
+
+#define CLOCK_BACK_THRESHOLD 100 /* < 10us unremarkable */
+static ULONGLONG clock_backward_max = CLOCK_BACK_THRESHOLD;
+static int clock_backward_count;
+
+/**
+ * A flag set on Windows versions which ignore small time adjustments.
+ *
+ * Windows Vista and Windows 7 ignore TimeAdjustment less than 16.
+ * @note Has to be checked for Windows Server 2008/2012 and Windows 8.
+ * Ref: http://support.microsoft.com/kb/2537623, bug #2328
+ */
+static BOOL os_ignores_small_adjustment;
+
+/*
+ * clockperiod is the period used for SetSystemTimeAdjustment
+ * slewing calculations but does not necessarily correspond
+ * to the precision of the OS clock. Prior to Windows Vista
+ * (6.0) the two were identical. In 100ns units.
+ */
+static DWORD clockperiod;
+
+/*
+ * os_clock_precision is the observed precision of the OS
+ * clock, meaning the increment between discrete values. This
+ * is currently calculated once at startup. 100ns units.
+ */
+static ULONGLONG os_clock_precision;
+
+/*
+ * NomPerfCtrFreq is from QueryPerformanceFrequency and is the
+ * number of performance counter beats per second. PerfCtrFreq
+ * starts from NomPerfCtrFreq but is maintained using a sliding
+ * window average based on actual performance counter behavior,
+ * to allow us to better tolerate powersaving measures that
+ * alter the effective frequency of the processor cycle counter
+ * (TSC) which sometimes underlies QueryPerformanceCounter.
+ *
+ * Note that the OS is unlikely to be so subtle in its internal
+ * scheduling of waitable timers, presumably done using the
+ * performance counter. Therefore our calculations for
+ * interpolated time should be based on PerfCtrFreq but our
+ * calculations for SetWaitableTimer should assume the OS will
+ * convert from FILETIME 100ns units to performance counter
+ * beats using the nominal frequency.
+ */
+
+volatile ULONGLONG PerfCtrFreq = 0;
+ ULONGLONG NomPerfCtrFreq = 0;
+
+/*
+ * If we're using RDTSC beating at the same rate as
+ * QueryPerformanceCounter, there is a systemic
+ * offset we need to account for when using
+ * counterstamps from serialpps.sys, which are
+ * always from QPC (actually KeQueryPerformanceCounter).
+ */
+static LONGLONG QPC_offset = 0;
+
+/*
+ * Substitute RDTSC for QueryPerformanceCounter()?
+ */
+static int use_pcc = -1;
+
+/*
+ * Restrict threads that call QPC/RDTSC to one CPU?
+ */
+static int lock_interp_threads = -1;
+
+/*
+ * ppm_per_adjust_unit is parts per million effect on the OS
+ * clock per slewing adjustment unit per second. Per haps.
+ */
+static DOUBLE ppm_per_adjust_unit;
+
+/*
+ * wintickadj emulates the functionality provided by unix tickadj,
+ * providing a baseline clock correction if needed to get the
+ * clock within a few hundred PPM of correct frequency.
+ */
+static long wintickadj;
+
+static void choose_interp_counter(void);
+static int is_qpc_built_on_pcc(void);
+
+/*
+ * performance counter frequency observations
+ */
+#define TUNE_CTR_DEPTH 3 /* running avg depth */
+
+static HANDLE ctr_freq_timer = INVALID_HANDLE_VALUE;
+static ULONGLONG tune_ctr_freq_max_interval;
+static unsigned tune_ctr_period;
+void start_ctr_freq_timer(ULONGLONG now_time);
+void reset_ctr_freq_timer(ULONGLONG when, ULONGLONG now);
+void reset_ctr_freq_timer_abs(ULONGLONG when);
+
+/* round a Windows time to the next bottom of the second */
+
+#define ROUND_TO_NEXT_SEC_BOTTOM(t) \
+do { \
+ (t) += 3 * HECTONANOSECONDS / 2 - 1; \
+ (t) /= HECTONANOSECONDS; \
+ (t) *= HECTONANOSECONDS; \
+ (t) -= HECTONANOSECONDS / 2; \
+} while (0)
+
+/*
+ * NT native time format is 100's of nanoseconds since 1601-01-01.
+ * Helpers for converting between "hectonanoseconds" and the
+ * performance counter scale from which interpolated time is
+ * derived.
+ */
+#define HNS2PERF(hns) ((hns) * PerfCtrFreq / HECTONANOSECONDS)
+#define PERF2HNS(ctr) ((ctr) * HECTONANOSECONDS / PerfCtrFreq)
+
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400 /* VS 2005 */
+#define get_pcc() __rdtsc()
+#else
+/*
+ * something like this can be used for a compiler without __rdtsc()
+ */
+ULONGLONG __forceinline
+get_pcc(void)
+{
+ /* RDTSC returns in EDX:EAX, same as C compiler */
+ __asm {
+ RDTSC
+ }
+}
+#endif
+
+
+/*
+ * perf_ctr() returns the current performance counter value,
+ * from QueryPerformanceCounter or RDTSC.
+ */
+ULONGLONG WINAPI
+perf_ctr(void)
+{
+ FT_ULL ft;
+
+ if (use_pcc)
+ return get_pcc();
+ else {
+ QueryPerformanceCounter(&ft.li);
+ return ft.ull;
+ }
+}
+
+
+/*
+ * init_small_adjustment
+ *
+ * Set variable os_ignores_small_adjustment
+ *
+ */
+static void init_small_adjustment(void)
+{
+ OSVERSIONINFO vi;
+ memset(&vi, 0, sizeof(vi));
+ vi.dwOSVersionInfoSize = sizeof(vi);
+
+ if (!GetVersionEx(&vi)) {
+ msyslog(LOG_WARNING, "GetVersionEx failed with error code %d.", GetLastError());
+ os_ignores_small_adjustment = FALSE;
+ return;
+ }
+
+ if (vi.dwMajorVersion == 6 && vi.dwMinorVersion == 1) {
+ // Windows 7 and Windows Server 2008 R2
+ //
+ // Windows 7 is documented as affected.
+ // Windows Server 2008 R2 is assumed affected.
+ os_ignores_small_adjustment = TRUE;
+ } else if (vi.dwMajorVersion == 6 && vi.dwMinorVersion == 0) {
+ // Windows Vista and Windows Server 2008
+ //
+ // Windows Vista is documented as affected.
+ // Windows Server 2008 is assumed affected.
+ os_ignores_small_adjustment = TRUE;
+ } else {
+ os_ignores_small_adjustment = FALSE;
+ }
+}
+
+
+/*
+ * choose_interp_counter - select between QueryPerformanceCounter and
+ * the x86 processor cycle counter (TSC).
+ */
+static void
+choose_interp_counter(void)
+{
+ const char * ntpd_pcc_freq_text;
+ int qpc_built_on_pcc;
+
+ /*
+ * Regardless of whether we actually use RDTSC, first determine
+ * if QueryPerformanceCounter is built on it, so that we can
+ * decide whether it's prudent to lock QPC-consuming threads to
+ * a particular CPU.
+ */
+ qpc_built_on_pcc = is_qpc_built_on_pcc();
+ lock_interp_threads = qpc_built_on_pcc;
+
+ /*
+ * It's time to make some more permanent knobs,
+ * but for right now the RDTSC aka PCC dance on x86 is:
+ *
+ * 1. With none of these variables defined, only QPC
+ * is used because there is no reliable way to
+ * detect counter frequency variation after ntpd
+ * startup implemented.
+ * 2. We need a better knob, but for now if you know
+ * your RDTSC / CPU frequency is invariant, set
+ * NTPD_PCC and assuming your QPC is based on the
+ * PCC as well, RDTSC will be substituted.
+ * 3. More forcefully, you can jam in a desired exact
+ * processor frequency, expressed in cycles per
+ * second by setting NTPD_PCC_FREQ=398125000, for
+ * example, if yor actual known CPU frequency is
+ * 398.125 MHz, and NTPD_PCC doesn't work because
+ * QueryPerformanceCounter is implemented using
+ * another counter. It is very easy to make ntpd
+ * fall down if the NTPD_PCC_FREQ value isn't very
+ * close to the observed RDTSC units per second.
+ *
+ * Items 2 and 3 could probably best be combined into one
+ * new windows-specific command line switch such as
+ * ntpd --pcc
+ * or
+ * ntpd --pcc=398125000
+ *
+ * They are currently tied to Windows because that is
+ * the only ntpd port with its own interpolation, and
+ * to x86/x64 because no one has ported the Windows
+ * ntpd port to the sole remaining alternative, Intel
+ * Itanium.
+ */
+ if (HAVE_OPT(PCCFREQ))
+ ntpd_pcc_freq_text = OPT_ARG(PCCFREQ);
+ else
+ ntpd_pcc_freq_text = getenv("NTPD_PCC_FREQ");
+
+ if (!HAVE_OPT(USEPCC)
+ && NULL == ntpd_pcc_freq_text
+ && NULL == getenv("NTPD_PCC")) {
+ use_pcc = 0;
+ return;
+ }
+
+ if (!qpc_built_on_pcc && NULL == ntpd_pcc_freq_text) {
+ use_pcc = 0;
+ return;
+ }
+
+ use_pcc = 1;
+ if (ntpd_pcc_freq_text != NULL)
+ sscanf(ntpd_pcc_freq_text,
+ "%llu",
+ &NomPerfCtrFreq);
+
+ NLOG(NLOG_CLOCKINFO)
+ msyslog(LOG_INFO,
+ "using processor cycle counter "
+ "%.3f MHz",
+ NomPerfCtrFreq / 1e6);
+ return;
+}
+
+
+/*
+ * is_qpc_built_on_pcc - test if QueryPerformanceCounter runs at the
+ * same rate as the processor cycle counter (TSC).
+ */
+static int
+is_qpc_built_on_pcc(void)
+{
+ LONGLONG offset;
+ FT_ULL ft1;
+ FT_ULL ft2;
+ FT_ULL ft3;
+ FT_ULL ft4;
+ FT_ULL ft5;
+
+ NTP_REQUIRE(NomPerfCtrFreq != 0);
+
+ QueryPerformanceCounter(&ft1.li);
+ ft2.ull = get_pcc();
+ Sleep(1);
+ QueryPerformanceCounter(&ft3.li);
+ Sleep(1);
+ ft4.ull = get_pcc();
+ Sleep(1);
+ QueryPerformanceCounter(&ft5.li);
+
+ offset = ft2.ull - ft1.ull;
+ ft3.ull += offset;
+ ft5.ull += offset;
+
+ if (ft2.ull <= ft3.ull &&
+ ft3.ull <= ft4.ull &&
+ ft4.ull <= ft5.ull) {
+
+ QPC_offset = offset;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * Request Multimedia Timer
+ */
+void
+set_mm_timer(
+ int timerres
+ )
+{
+ modify_mm_timer = timerres;
+}
+
+/*
+ * adj_systime - called once every second to discipline system clock.
+ * Normally, the offset passed in (parameter now) is in the range
+ * [-NTP_MAXFREQ, NTP_MAXFREQ]. However, at EVNT_NSET, a much larger
+ * slew is requested if the initial offset is less than the step
+ * threshold, in the range [-step, step] where step is the step
+ * threshold, 128 msec by default. For the remainder of the frequency
+ * training interval, adj_systime is called with 0 offset each second
+ * and slew the large offset at 500 PPM (500 usec/sec).
+ * Returns 1 if okay, 0 if trouble.
+ */
+int
+adj_systime(
+ double now
+ )
+{
+ /* ntp time scale origin as ticks since 1601-01-01 */
+ static const ULONGLONG HNS_JAN_1900 = 94354848000000000ull;
+
+ static double adjtime_carry;
+ double dtemp;
+ u_char isneg;
+ BOOL rc;
+ long TimeAdjustment;
+ SYSTEMTIME st;
+ ULONGLONG this_perf_count;
+ FT_ULL curr_ft;
+ leap_result_t lsi;
+
+ /*
+ * Add the residual from the previous adjustment to the new
+ * adjustment, bound and round.
+ */
+ dtemp = adjtime_carry + sys_residual + now;
+ adjtime_carry = 0.;
+ sys_residual = 0.;
+ if (dtemp < 0) {
+ isneg = TRUE;
+ dtemp = -dtemp;
+ } else {
+ isneg = FALSE;
+ }
+
+ if (dtemp > NTP_MAXFREQ) {
+ adjtime_carry = dtemp - NTP_MAXFREQ;
+ dtemp = NTP_MAXFREQ;
+ }
+
+ if (isneg) {
+ dtemp = -dtemp;
+ adjtime_carry = -adjtime_carry;
+ }
+
+ dtemp = dtemp * 1e6;
+
+ /*
+ * dtemp is in micro seconds. NT uses 100 ns units,
+ * so a unit change in TimeAdjustment corresponds
+ * to slewing 10 ppm on a 100 Hz system. Calculate
+ * the number of 100ns units to add, using OS tick
+ * frequency as per suggestion from Harry Pyle,
+ * and leave the remainder in dtemp
+ */
+ TimeAdjustment = (long)(dtemp / ppm_per_adjust_unit +
+ ((isneg)
+ ? -0.5
+ : 0.5));
+
+ if (os_ignores_small_adjustment) {
+ /*
+ * As the OS ignores adjustments smaller than 16, we need to
+ * leave these small adjustments in sys_residual, causing
+ * the small values to be averaged over time.
+ */
+ if (TimeAdjustment > -16 && TimeAdjustment < 16) {
+ TimeAdjustment = 0;
+ }
+ }
+
+ dtemp -= TimeAdjustment * ppm_per_adjust_unit;
+
+
+ /* If a piping-hot close leap second is pending for the end
+ * of this day, determine the UTC time stamp when the transition
+ * must take place. (Calculated in the current leap era!)
+ */
+ if (leapsec >= LSPROX_ALERT) {
+ if (0 == ls_ft.ull && leapsec_frame(&lsi)) {
+ if (lsi.tai_diff > 0) {
+ /* A leap second insert is scheduled at the end
+ * of the day. Since we have not yet computed the
+ * time stamp, do it now. Signal electric mode
+ * for this insert.
+ */
+ ls_ft.ull = lsi.ttime.Q_s * HECTONANOSECONDS
+ + HNS_JAN_1900;
+ FileTimeToSystemTime(&ls_ft.ft, &st);
+ msyslog(LOG_NOTICE,
+ "Detected positive leap second announcement "
+ "for %04d-%02d-%02d %02d:%02d:%02d UTC",
+ st.wYear, st.wMonth, st.wDay,
+ st.wHour, st.wMinute, st.wSecond);
+ leapsec_electric(TRUE);
+ } else if (lsi.tai_diff < 0) {
+ /* Do not handle negative leap seconds here. If this
+ * happens, let the system step.
+ */
+ leapsec_electric(FALSE);
+ }
+ }
+ } else {
+ /* The leap second announcement is gone. Happens primarily after
+ * the leap transition, but can also be due to a clock step.
+ * Disarm the leap second, but only if there is one scheduled
+ * and not currently in progress!
+ */
+ if (ls_ft.ull != 0 && ls_time_adjustment == 0) {
+ ls_ft.ull = 0;
+ msyslog(LOG_NOTICE, "Leap second announcement disarmed");
+ }
+ }
+
+ /*
+ * If the time stamp for the next leap second has been set
+ * then check if the leap second must be handled
+ */
+ if (ls_ft.ull != 0) {
+ this_perf_count = perf_ctr();
+
+ if (0 == ls_time_adjustment) { /* has not yet been scheduled */
+
+ GetSystemTimeAsFileTime(&curr_ft.ft);
+ if (curr_ft.ull >= ls_ft.ull) {
+ ls_time_adjustment = clockperiod / LS_CORR_INTV_SECS;
+ ls_ref_perf_cnt = this_perf_count;
+ ls_elapsed = 0;
+ msyslog(LOG_NOTICE, "Inserting positive leap second.");
+ }
+ } else { /* leap sec adjustment has been scheduled previously */
+ ls_elapsed = (this_perf_count - ls_ref_perf_cnt)
+ * HECTONANOSECONDS / PerfCtrFreq;
+ }
+
+ if (ls_time_adjustment != 0) { /* leap second adjustment is currently active */
+ if (ls_elapsed > (LS_CORR_INTV - LS_CORR_LIMIT)) {
+ ls_time_adjustment = 0; /* leap second adjustment done */
+ ls_ft.ull = 0;
+ }
+
+ /*
+ * NOTE: While the system time is slewed during the leap second
+ * the interpolation function which is based on the performance
+ * counter does not account for the slew.
+ */
+ TimeAdjustment -= ls_time_adjustment;
+ }
+ }
+
+
+ sys_residual = dtemp / 1e6;
+ DPRINTF(3, ("adj_systime: %.9f -> %.9f residual %.9f",
+ now, 1e-6 * (TimeAdjustment * ppm_per_adjust_unit),
+ sys_residual));
+ if (0. == adjtime_carry)
+ DPRINTF(3, ("\n"));
+ else
+ DPRINTF(3, (" adjtime %.9f\n", adjtime_carry));
+
+ /* only adjust the clock if adjustment changes */
+ TimeAdjustment += wintickadj;
+ if (last_Adj != TimeAdjustment) {
+ last_Adj = TimeAdjustment;
+ DPRINTF(2, ("SetSystemTimeAdjustment(%+ld)\n", TimeAdjustment));
+ rc = SetSystemTimeAdjustment(clockperiod + TimeAdjustment, FALSE);
+ if (!rc)
+ msyslog(LOG_ERR, "Can't adjust time: %m");
+ } else {
+ rc = TRUE;
+ }
+
+ return rc;
+}
+
+
+void
+init_winnt_time(void)
+{
+ static const char settod[] = "settimeofday=\"SetSystemTime\"";
+ char szMsgPath[MAX_PATH+1];
+ HANDLE hToken = INVALID_HANDLE_VALUE;
+ TOKEN_PRIVILEGES tkp;
+ TIMECAPS tc;
+ BOOL noslew;
+ DWORD adjclockperiod;
+ LARGE_INTEGER Freq;
+ FT_ULL initial_hectonanosecs;
+ FT_ULL next_hectonanosecs;
+ double adjppm;
+ double rawadj;
+ char * pch;
+
+ if (winnt_time_initialized)
+ return;
+
+ /*
+ * Make sure the service is initialized
+ * before we do anything else
+ */
+ ntservice_init();
+
+ /* Set up the Console Handler */
+ if (!SetConsoleCtrlHandler(OnConsoleEvent, TRUE)) {
+ msyslog(LOG_ERR, "Can't set console control handler: %m");
+ }
+
+ /* Set the Event-ID message-file name. */
+ if (!GetModuleFileName(NULL, szMsgPath, sizeof(szMsgPath))) {
+ msyslog(LOG_ERR, "GetModuleFileName(PGM_EXE_FILE) failed: %m");
+ exit(1);
+ }
+
+ /* Initialize random file before OpenSSL checks */
+ if (!init_randfile())
+ msyslog(LOG_ERR, "Unable to initialize .rnd file");
+
+#pragma warning(push)
+#pragma warning(disable: 4127) /* conditional expression is constant */
+
+#ifdef DEBUG
+ if (SIZEOF_TIME_T != sizeof(time_t)
+ || SIZEOF_INT != sizeof(int)
+ || SIZEOF_SIGNED_CHAR != sizeof(char)) {
+ msyslog(LOG_ERR, "config.h SIZEOF_* macros wrong, fatal");
+ exit(1);
+ }
+#endif
+
+#pragma warning(pop)
+
+ init_small_adjustment();
+ leapsec_electric(TRUE);
+
+ /*
+ * Get privileges needed for fiddling with the clock
+ */
+
+ /* get the current process token handle */
+ if (!OpenProcessToken(
+ GetCurrentProcess(),
+ TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
+ &hToken)) {
+ msyslog(LOG_ERR, "OpenProcessToken failed: %m");
+ exit(-1);
+ }
+ /* get the LUID for system-time privilege. */
+ LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &tkp.Privileges[0].Luid);
+ tkp.PrivilegeCount = 1; /* one privilege to set */
+ tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+
+ /* get set-time privilege for this process. */
+ AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
+ (PTOKEN_PRIVILEGES) NULL, 0);
+
+ /* cannot use return value of AdjustTokenPrivileges. */
+ /* (success does not indicate all privileges were set) */
+ if (GetLastError() != ERROR_SUCCESS) {
+ msyslog(LOG_ERR, "AdjustTokenPrivileges failed: %m");
+ /* later set time call will probably fail */
+ }
+
+ CloseHandle(hToken);
+ hToken = INVALID_HANDLE_VALUE;
+
+ /*
+ * Say how we're setting the time of day
+ */
+ set_sys_var(settod, sizeof(settod), RO);
+
+ /*
+ * ntpd on Windows has always raised its priority, without
+ * requiring -N as on Unix. Since Windows ntpd doesn't share
+ * the history of unix ntpd of once having no -N and therefore
+ * needing to be invoked under nice, there is no reason to
+ * bring it in line with the Unix version in this regard.
+ * Instsrv assumes ntpd is invoked with no arguments, and
+ * upgrading users would be negatively surprised by the
+ * poor timekeeping if they failed to add -N as part of
+ * upgrading were we to correct this platform difference.
+ */
+ if (-1 == setpriority(PRIO_PROCESS, 0, NTP_PRIO))
+ exit(-1);
+
+ /* Determine the existing system time slewing */
+ if (!GetSystemTimeAdjustment(&adjclockperiod, &clockperiod, &noslew)) {
+ msyslog(LOG_ERR, "GetSystemTimeAdjustment failed: %m");
+ exit(-1);
+ }
+
+ /*
+ * If there is no slewing before ntpd, adjclockperiod and clockperiod
+ * will be equal. Any difference is carried into adj_systime's first
+ * pass as the previous adjustment.
+ */
+ last_Adj = adjclockperiod - clockperiod;
+
+ if (last_Adj)
+ msyslog(LOG_INFO,
+ "Clock interrupt period %.3f msec "
+ "(startup slew %.1f usec/period)",
+ clockperiod / 1e4,
+ last_Adj / 10.);
+ else
+ msyslog(LOG_INFO,
+ "Clock interrupt period %.3f msec",
+ clockperiod / 1e4);
+
+ /*
+ * Calculate the time adjustment resulting from incrementing
+ * units per tick by 1 unit for 1 second
+ */
+ ppm_per_adjust_unit = 1e6 / clockperiod;
+
+ pch = getenv("NTPD_TICKADJ_PPM");
+ if (pch != NULL && 1 == sscanf(pch, "%lf", &adjppm)) {
+ rawadj = adjppm / ppm_per_adjust_unit;
+ rawadj += (rawadj < 0)
+ ? -0.5
+ : 0.5;
+ wintickadj = (long)rawadj;
+ msyslog(LOG_INFO,
+ "Using NTPD_TICKADJ_PPM %+g ppm (%+ld)",
+ adjppm, wintickadj);
+ }
+
+ /* get the performance counter ticks per second */
+ if (!QueryPerformanceFrequency(&Freq) || !Freq.QuadPart) {
+ msyslog(LOG_ERR, "QueryPerformanceFrequency failed: %m");
+ exit(-1);
+ }
+
+ NomPerfCtrFreq = PerfCtrFreq = Freq.QuadPart;
+ msyslog(LOG_INFO,
+ "Performance counter frequency %.3f MHz",
+ PerfCtrFreq / 1e6);
+
+ /*
+ * With a precise system clock, our interpolation decision is
+ * a slam dunk.
+ */
+ if (NULL != pGetSystemTimePreciseAsFileTime) {
+ winnt_use_interpolation = FALSE;
+ winnt_time_initialized = TRUE;
+
+ return;
+ }
+
+ /*
+ * Implement any multimedia timer manipulation requested via -M
+ * option. This is rumored to be unneeded on Win8 with the
+ * introduction of the precise (interpolated) system clock.
+ */
+ if (modify_mm_timer) {
+ if (timeGetDevCaps(&tc, sizeof(tc)) == TIMERR_NOERROR) {
+ wTimerRes = min(max(tc.wPeriodMin, MM_TIMER_INTV), tc.wPeriodMax);
+ timeBeginPeriod(wTimerRes);
+ atexit(atexit_revert_mm_timer);
+
+ msyslog(LOG_INFO, "MM timer resolution: %u..%u msec, set to %u msec",
+ tc.wPeriodMin, tc.wPeriodMax, wTimerRes );
+ } else {
+ msyslog(LOG_ERR, "Multimedia timer unavailable");
+ }
+ }
+
+ /*
+ * Spin on GetSystemTimeAsFileTime to determine its
+ * granularity. Prior to Windows Vista this is
+ * typically the same as the clock period.
+ */
+ GetSystemTimeAsFileTime(&initial_hectonanosecs.ft);
+ do {
+ GetSystemTimeAsFileTime(&next_hectonanosecs.ft);
+ } while (initial_hectonanosecs.ull == next_hectonanosecs.ull);
+
+ os_clock_precision = next_hectonanosecs.ull -
+ initial_hectonanosecs.ull;
+
+ msyslog(LOG_INFO,
+ "Windows clock precision %.3f msec, min. slew %.3f ppm/s",
+ os_clock_precision / 1e4, ppm_per_adjust_unit);
+
+ winnt_time_initialized = TRUE;
+
+ choose_interp_counter();
+
+ if (getenv("NTPD_USE_SYSTEM_CLOCK") ||
+ (os_clock_precision < 4 * 10000 &&
+ !getenv("NTPD_USE_INTERP_DANGEROUS"))) {
+ msyslog(LOG_INFO, "using Windows clock directly");
+ } else {
+ winnt_use_interpolation = TRUE;
+ get_sys_time_as_filetime = GetInterpTimeAsFileTime;
+ StartClockThread();
+ }
+}
+
+
+void
+atexit_revert_mm_timer(void)
+{
+ timeEndPeriod(wTimerRes);
+ DPRINTF(1, ("MM timer resolution reset\n"));
+}
+
+
+void
+reset_winnt_time(void)
+{
+ SYSTEMTIME st;
+
+ /*
+ * If we're in the 2-second slew right after a leap second,
+ * we don't want to continue that extreme slew, in that case
+ * disable our slewing and return clock discipline to the
+ * kernel. Similarly if we are not yet synchronized,
+ * our current slew may not be a good ongoing trim.
+ * Otherwise, our leave in place the last SetSystemTimeAdjustment
+ * as an ongoing frequency correction, better than nothing.
+ * TODO:
+ * Verify this will not call SetSystemTimeAdjustment if
+ * ntpd is running in ntpdate mode.
+ */
+ if (sys_leap == LEAP_NOTINSYNC || ls_time_adjustment != 0)
+ SetSystemTimeAdjustment(0, TRUE);
+
+ /*
+ * Read the current system time, and write it back to
+ * force CMOS update, only if we are exiting because
+ * the computer is shutting down and we are already
+ * synchronized.
+ */
+ if (ntservice_systemisshuttingdown() && sys_leap != LEAP_NOTINSYNC) {
+ GetSystemTime(&st);
+ SetSystemTime(&st);
+ NLOG(NLOG_SYSEVENT | NLOG_CLOCKINFO)
+ msyslog(LOG_NOTICE, "system is shutting down, CMOS time reset.");
+ }
+}
+
+
+/*
+ * GetSystemTimeAsFileTime() interface clone is used by getclock() in ntpd.
+ */
+
+void WINAPI
+GetInterpTimeAsFileTime(
+ LPFILETIME pft
+ )
+{
+ static ULONGLONG last_interp_time;
+ FT_ULL now_time;
+ FT_ULL now_count;
+ ULONGLONG clock_backward;
+
+ /*
+ * Mark a mark ASAP. The latency to here should be reasonably
+ * deterministic
+ */
+
+ now_count.ull = perf_ctr();
+ now_time.ull = interp_time(now_count.ull, TRUE);
+
+ if (last_interp_time <= now_time.ull) {
+ last_interp_time = now_time.ull;
+ } else {
+ clock_backward = last_interp_time - now_time.ull;
+ if (clock_backward > clock_backward_max) {
+ clock_backward_max = clock_backward;
+ clock_backward_count++;
+ }
+ now_time.ull = last_interp_time;
+ }
+ *pft = now_time.ft;
+
+ return;
+}
+
+
+/*
+ * TimerApcFunction is invoked on the high-priority clock
+ * thread to capture a new baseline system time and
+ * performance counter correlation every 43 msec (64Hz
+ * OS clock precision).
+ */
+static void CALLBACK
+TimerApcFunction(
+ LPVOID lpArgToCompletionRoutine,
+ DWORD dwTimerLowValue,
+ DWORD dwTimerHighValue
+ )
+{
+ static BOOL ctr_freq_timer_started = FALSE;
+ static ULONGLONG prev_count;
+ ULONGLONG now_time;
+ FT_ULL now_count;
+
+ /* Grab the counter first of all */
+ now_count.ull = perf_ctr();
+
+ now_time = (((ULONGLONG)dwTimerHighValue << 32) |
+ dwTimerLowValue);
+
+ /*
+ * Save this correlation in the history.
+ */
+ add_counter_time_pair(now_count.ull, now_time);
+
+ /*
+ * Once we're synchronized start the counter frequency
+ * tuning timer.
+ */
+ if (INVALID_HANDLE_VALUE == ctr_freq_timer &&
+ LEAP_NOTINSYNC != sys_leap)
+ start_ctr_freq_timer(now_time);
+}
+
+
+unsigned WINAPI
+ClockThread(
+ void *arg
+ )
+{
+ LARGE_INTEGER DueTime;
+ HANDLE timer;
+ double HZ;
+ double TimerHz;
+ DWORD timer_period_msec;
+ DWORD res;
+ char *ntpd_int_int_text;
+
+ UNUSED_ARG(arg);
+
+ timer = CreateWaitableTimer(NULL, FALSE, NULL);
+
+ ntpd_int_int_text = getenv("NTPD_INT_INT");
+
+ HZ = (double)HECTONANOSECONDS / clockperiod;
+
+ if (HZ > 63 && HZ < 65) {
+ timer_period_msec = 43;
+ } else if (HZ > 98 && HZ < 102) {
+ timer_period_msec = 27;
+ if (NULL == ntpd_int_int_text)
+ msyslog(LOG_WARNING,
+ "%.3f Hz system clock may benefit from "
+ "custom NTPD_INT_INT env var timer interval "
+ "override between approx. 20 and 50 msecs.",
+ HZ);
+ } else {
+ timer_period_msec = (DWORD)(0.5 + (2.752 * clockperiod / 10000));
+ if (NULL == ntpd_int_int_text)
+ msyslog(LOG_WARNING,
+ "unfamiliar %.3f Hz system clock may benefit "
+ "from custom NTPD_INT_INT env var timer "
+ "interval override between approx. 20 and 50 "
+ "msecs.",
+ HZ);
+ }
+
+ if (ntpd_int_int_text != NULL) {
+ timer_period_msec = atoi(ntpd_int_int_text);
+ timer_period_msec = max(9, timer_period_msec);
+ msyslog(LOG_NOTICE,
+ "using NTPD_INT_INT env var override %u",
+ timer_period_msec);
+ }
+
+ TimerHz = 1e3 / timer_period_msec;
+ msyslog(LOG_NOTICE, "HZ %.3f using %u msec timer %.3f Hz %d deep",
+ HZ,
+ timer_period_msec,
+ TimerHz,
+ BASELINES_USED);
+
+ /* negative DueTime means relative to now */
+ DueTime.QuadPart = -(int)timer_period_msec;
+
+ SetWaitableTimer(
+ timer,
+ &DueTime, /* first fire */
+ timer_period_msec, /* period thereafter */
+ TimerApcFunction, /* callback routine */
+ &timer, /* context for callback */
+ FALSE); /* do not interfere with power saving */
+
+ /*
+ * The clock thread spends the rest of its life in the TimerApcFunction
+ * and ctr_freq_timer_fired timer APC callbacks, which can only occur
+ * while this thread is in an alertable wait. Note the Ex on
+ * WaitForSingleObjectEx and TRUE for fAlertable. The wait will return
+ * after each APC callback in which case we simply wait again. We will
+ * break out of the loop when StopClockThread signals our exit event.
+ */
+ do res = WaitForSingleObjectEx(
+ TimerThreadExitRequest,
+ INFINITE,
+ TRUE);
+ while (WAIT_OBJECT_0 != res);
+
+ CloseHandle(timer);
+
+ if (ctr_freq_timer != INVALID_HANDLE_VALUE) {
+ CloseHandle(ctr_freq_timer);
+ ctr_freq_timer = INVALID_HANDLE_VALUE;
+ }
+
+ return 0;
+}
+
+
+static void
+StartClockThread(void)
+{
+ static BOOL done_once = FALSE;
+ FT_ULL StartTime;
+
+ /* init variables with the time now */
+ GetSystemTimeAsFileTime(&StartTime.ft);
+ baseline_times[0] = StartTime.ull;
+ baseline_counts[0] = perf_ctr();
+
+ /* init sync objects */
+ TimerThreadExitRequest = CreateEvent(NULL, FALSE, FALSE, NULL);
+
+ clock_thread =
+ (HANDLE)_beginthreadex(
+ NULL,
+ 0,
+ ClockThread,
+ NULL,
+ CREATE_SUSPENDED,
+ &clock_thread_id);
+
+ if (clock_thread != NULL) {
+ /* remember the thread priority is only within the process class */
+ if (!SetThreadPriority(clock_thread, THREAD_PRIORITY_TIME_CRITICAL)) {
+ DPRINTF(1, ("Error setting thread priority\n"));
+ }
+
+ lock_thread_to_processor(clock_thread);
+ ResumeThread(clock_thread);
+
+ if (FALSE == done_once) {
+ done_once = TRUE;
+ lock_thread_to_processor(GetCurrentThread());
+ atexit( StopClockThread );
+ }
+
+ /*
+ * Give the clock thread time to fill its counter/time
+ * sample buffer. This will underfill the buffer a
+ * bit for sample periods over 43 msec.
+ */
+ Sleep(BASELINES_USED * 43);
+ }
+}
+
+
+void
+StopClockThread(void)
+{
+ /*
+ * if the clock thread exit()s this routine
+ * will be called on the clock thread and
+ * we need not (and can't) use the normal
+ * TimerThreadExitRequest event.
+ */
+ if (GetCurrentThreadId() != clock_thread_id) {
+
+ if (!SetEvent(TimerThreadExitRequest) ||
+ WaitForSingleObject(clock_thread, 2 * 1000) !=
+ WAIT_OBJECT_0) {
+ msyslog(LOG_ERR, "Failed to stop clock thread.");
+ }
+ }
+ CloseHandle(TimerThreadExitRequest);
+ TimerThreadExitRequest = NULL;
+ CloseHandle(clock_thread);
+ clock_thread = NULL;
+}
+
+
+void
+lock_thread_to_processor(HANDLE thread)
+{
+ static DWORD_PTR ProcessAffinityMask;
+ static DWORD_PTR ThreadAffinityMask;
+ DWORD_PTR SystemAffinityMask;
+ char *cputext;
+ unsigned int cpu;
+
+ if ( ! winnt_time_initialized) {
+ DPRINTF(1, ("init_winnt_time() must be called before "
+ "lock_thread_to_processor(), exiting\n"));
+ exit(-1);
+ }
+
+ if (!winnt_use_interpolation)
+ return;
+
+ if (-1 == lock_interp_threads) {
+ DPRINTF(1, ("choose_interp_counter() is not called "
+ "before lock_thread_to_processor()\n"));
+ exit(-1);
+ } else if (!lock_interp_threads)
+ return;
+
+ /*
+ * Calculate the ThreadAffinityMask we'll use once on the
+ * first invocation.
+ */
+ if (!ProcessAffinityMask) {
+
+ /*
+ * Choose which processor to nail the main and clock threads to.
+ * If we have more than one, we simply choose the 2nd.
+ * Randomly choosing from 2 to n would be better, but in
+ * either case with clock and network interrupts more likely
+ * to be serviced by the first procecssor, let's stay away
+ * from it. QueryPerformanceCounter is not necessarily
+ * consistent across CPUs, hence the need to nail the two
+ * threads involved in QPC-based interpolation to the same
+ * CPU.
+ */
+
+ GetProcessAffinityMask(
+ GetCurrentProcess(),
+ &ProcessAffinityMask,
+ &SystemAffinityMask);
+
+ /*
+ * respect NTPD_CPU environment variable if present
+ * for testing. NTPD_CPU=0 means use all CPUs, 1-64
+ * means lock threads involved in interpolation to
+ * that CPU. Default to 2nd if more than 1.
+ */
+
+ cpu = 2;
+ cputext = getenv("NTPD_CPU");
+ if (cputext) {
+ cpu = (unsigned int) atoi(cputext);
+ cpu = min((8 * sizeof(DWORD_PTR)), cpu);
+ }
+
+ /*
+ * Clear all bits except the 2nd. If we have only one proc
+ * that leaves ThreadAffinityMask zeroed and we won't bother
+ * with SetThreadAffinityMask.
+ */
+
+ ThreadAffinityMask = (0 == cpu) ? 0 : (1 << (cpu - 1));
+
+ if (ThreadAffinityMask &&
+ !(ThreadAffinityMask & ProcessAffinityMask))
+
+ DPRINTF(1, ("Selected CPU %u (mask %x) is outside "
+ "process mask %x, using all CPUs.\n",
+ cpu, ThreadAffinityMask,
+ ProcessAffinityMask));
+ else
+ DPRINTF(1, ("Wiring to processor %u (0 means all) "
+ "affinity mask %x\n",
+ cpu, ThreadAffinityMask));
+
+ ThreadAffinityMask &= ProcessAffinityMask;
+ }
+
+ if (ThreadAffinityMask &&
+ !SetThreadAffinityMask(thread, ThreadAffinityMask))
+ msyslog(LOG_ERR,
+ "Unable to wire thread to mask %x: %m",
+ ThreadAffinityMask);
+}
+
+
+#ifdef HAVE_PPSAPI
+static inline void ntp_timestamp_from_counter(l_fp *, ULONGLONG,
+ ULONGLONG);
+
+/*
+ * helper routine for serial PPS which returns QueryPerformanceCounter
+ * timestamp and needs to interpolate it to an NTP timestamp.
+ */
+void
+pps_ntp_timestamp_from_counter(
+ ntp_fp_t *result,
+ ULONGLONG Timestamp,
+ ULONGLONG Counterstamp
+ )
+{
+ /*
+ * convert between equivalent l_fp and PPSAPI ntp_fp_t
+ */
+ ntp_timestamp_from_counter(
+ (l_fp *)result,
+ Timestamp,
+ Counterstamp);
+}
+
+
+static inline
+void
+ntp_timestamp_from_counter(
+ l_fp *result,
+ ULONGLONG Timestamp,
+ ULONGLONG Counterstamp
+ )
+{
+ FT_ULL Now;
+ FT_ULL Ctr;
+ LONGLONG CtrDelta;
+ double seconds;
+ ULONGLONG InterpTimestamp;
+
+ if (winnt_use_interpolation) {
+ if (0 == Counterstamp) {
+ DPRINTF(1, ("ntp_timestamp_from_counter rejecting 0 counter.\n"));
+ ZERO(*result);
+ return;
+ }
+
+ InterpTimestamp = interp_time(Counterstamp + QPC_offset, FALSE);
+ } else { /* ! winnt_use_interpolation */
+ if (NULL != pGetSystemTimePreciseAsFileTime &&
+ 0 != Counterstamp) {
+ QueryPerformanceCounter(&Ctr.li);
+ (*pGetSystemTimePreciseAsFileTime)(&Now.ft);
+ CtrDelta = Ctr.ull - Counterstamp;
+ seconds = (double)CtrDelta / PerfCtrFreq;
+ InterpTimestamp = Now.ull -
+ (ULONGLONG)(seconds * HECTONANOSECONDS);
+ } else {
+ /* have to simply use the driver's system time timestamp */
+ InterpTimestamp = Timestamp;
+ GetSystemTimeAsFileTime(&Now.ft);
+ }
+ }
+
+ /* convert from 100ns units to NTP fixed point format */
+
+ InterpTimestamp -= FILETIME_1970;
+ result->l_ui = JAN_1970 + (u_int32)(InterpTimestamp / HECTONANOSECONDS);
+ result->l_uf = (u_int32)((InterpTimestamp % HECTONANOSECONDS) *
+ (ULONGLONG)FRAC / HECTONANOSECONDS);
+}
+#endif /* HAVE_PPSAPI */
+
+
+void
+win_time_stepped(void)
+{
+ /*
+ * called back by ntp_set_tod after the system
+ * time has been stepped (set).
+ *
+ * We normally prevent the reported time from going backwards
+ * but need to allow it in this case.
+ */
+ if (FALSE == winnt_use_interpolation)
+ return;
+
+
+ /*
+ * Restart the clock thread to get a new baseline
+ * time/counter correlation.
+ */
+ StopClockThread();
+
+ /*
+ * newest_baseline_gen is a generation counter
+ * incremented once each time newest_baseline
+ * is reset.
+ */
+ newest_baseline_gen++;
+
+ clock_backward_max = CLOCK_BACK_THRESHOLD;
+ clock_backward_count = 0;
+ newest_baseline = 0;
+ ZERO(baseline_counts);
+ ZERO(baseline_times);
+
+ StartClockThread();
+}
+
+
+/*
+ * log2ull - log base 2 of a unsigned 64-bit number
+ */
+int
+log2ull(
+ ULONGLONG n
+ )
+{
+ const ULONGLONG one = 1;
+ int log = 0;
+
+ if (n >= one<<32) { n >>= 32; log += 32; }
+ if (n >= one<<16) { n >>= 16; log += 16; }
+ if (n >= one<< 8) { n >>= 8; log += 8; }
+ if (n >= one<< 4) { n >>= 4; log += 4; }
+ if (n >= one<< 2) { n >>= 2; log += 2; }
+ if (n >= one<< 1) { log += 1; }
+
+ return (n) ? log : (-1);
+}
+
+
+/*
+ * ctr_freq_timer_fired is called once a few seconds before
+ * tune_ctr_period seconds have elapsed, to reset the timer
+ * and hopefully minimize error due to the system using the
+ * nominal performance counter frequency to set the timer
+ * internally, which is typically dozens of PPM from the
+ * actual performance counter rate. A few seconds later
+ * it is called again to observe the counter and estimate the
+ * counter frequency.
+ */
+static void CALLBACK
+ctr_freq_timer_fired(
+ LPVOID arg,
+ DWORD dwTimeLow,
+ DWORD dwTimeHigh
+ )
+{
+ static FT_ULL begin_time = {0};
+ static FT_ULL begin_count = {0};
+ static ULONGLONG next_period_time = 0;
+ static ULONGLONG report_systemtime = 0;
+ const ULONGLONG five_minutes = 5ui64 * 60 * HECTONANOSECONDS;
+ FT_ULL now_time;
+ FT_ULL now_count;
+
+ if (!begin_time.ull) {
+ begin_count.ull = perf_ctr();
+ begin_time.ft.dwLowDateTime = dwTimeLow;
+ begin_time.ft.dwHighDateTime = dwTimeHigh;
+
+ /*
+ * adapt perf ctr observation interval to the
+ * counter frequency
+ */
+ tune_ctr_period = 22680 / log2ull(NomPerfCtrFreq);
+
+ /*
+ * reset timer 2s before period ends to minimize
+ * error from OS timer routines using nominal
+ * performance frequency internally.
+ */
+ tune_ctr_freq_max_interval = tune_ctr_period - 2;
+
+ next_period_time = begin_time.ull +
+ (ULONGLONG)tune_ctr_period * HECTONANOSECONDS;
+
+ ROUND_TO_NEXT_SEC_BOTTOM(next_period_time);
+
+ reset_ctr_freq_timer(next_period_time, begin_time.ull);
+
+ return;
+ }
+
+ now_time.ft.dwLowDateTime = dwTimeLow;
+ now_time.ft.dwHighDateTime = dwTimeHigh;
+
+ if (now_time.ull >= next_period_time) {
+ now_count.ull = perf_ctr();
+ tune_ctr_freq(
+ now_count.ull - begin_count.ull,
+ now_time.ull - begin_time.ull);
+ next_period_time += (ULONGLONG)tune_ctr_period * HECTONANOSECONDS;
+ begin_count.ull = now_count.ull;
+ begin_time.ull = now_time.ull;
+ }
+
+ /*
+ * Log clock backward events no more often than 5 minutes.
+ */
+ if (!report_systemtime) {
+ report_systemtime = now_time.ull + five_minutes;
+ } else if (report_systemtime <= now_time.ull) {
+ report_systemtime += five_minutes;
+ if (clock_backward_count) {
+ msyslog(LOG_WARNING,
+ "clock would have gone backward %d times, "
+ "max %.1f usec",
+ clock_backward_count,
+ clock_backward_max / 10.);
+
+ clock_backward_max = CLOCK_BACK_THRESHOLD;
+ clock_backward_count = 0;
+ }
+ }
+ reset_ctr_freq_timer(next_period_time, now_time.ull);
+}
+
+
+void
+reset_ctr_freq_timer_abs(
+ ULONGLONG when
+ )
+{
+ FT_ULL fire_time;
+
+ fire_time.ull = when;
+ SetWaitableTimer(
+ ctr_freq_timer,
+ &fire_time.li, /* first fire */
+ 0, /* not periodic */
+ ctr_freq_timer_fired, /* callback routine */
+ NULL, /* context for callback */
+ FALSE); /* do not interfere with power saving */
+}
+
+
+void
+reset_ctr_freq_timer(
+ ULONGLONG when,
+ ULONGLONG now
+ )
+{
+ if (when - now >
+ (tune_ctr_freq_max_interval * HECTONANOSECONDS + HECTONANOSECONDS))
+ when = now + tune_ctr_freq_max_interval * HECTONANOSECONDS;
+
+ reset_ctr_freq_timer_abs(when);
+}
+
+
+void
+start_ctr_freq_timer(
+ ULONGLONG now_time
+ )
+{
+ ULONGLONG when;
+
+ ctr_freq_timer = CreateWaitableTimer(NULL, FALSE, NULL);
+ when = now_time;
+ ROUND_TO_NEXT_SEC_BOTTOM(when);
+
+ reset_ctr_freq_timer_abs(when);
+}
+
+
+/*
+ * tune_ctr_freq is called once per tune_ctr_period seconds
+ * with a counter difference and time difference.
+ */
+void
+tune_ctr_freq(
+ LONGLONG ctr_delta,
+ LONGLONG time_delta
+ )
+{
+ static unsigned count = 0;
+ static unsigned dispcount = 0;
+ static unsigned report_at_count = 0;
+ static int disbelieved = 0;
+ static int i = 0;
+ static double nom_freq = 0;
+ static LONGLONG diffs[TUNE_CTR_DEPTH] = {0};
+ static LONGLONG sum = 0;
+ char ctr_freq_eq[64];
+ LONGLONG delta;
+ LONGLONG deltadiff;
+ ULONGLONG ObsPerfCtrFreq;
+ double freq;
+ double this_freq;
+ BOOL isneg;
+
+ /* one-time initialization */
+ if (!report_at_count) {
+ report_at_count = 24 * 60 * 60 / tune_ctr_period;
+ nom_freq = NomPerfCtrFreq / 1e6;
+ }
+
+ /* delta is the per-second observed frequency this time */
+ delta = (LONGLONG)((double)ctr_delta * HECTONANOSECONDS /
+ time_delta);
+
+ /* disbelieve any delta more than +/- 976 PPM from nominal */
+ deltadiff = delta - NomPerfCtrFreq;
+ if (0 > deltadiff) {
+ isneg = TRUE;
+ deltadiff = -deltadiff;
+ } else {
+ isneg = FALSE;
+ }
+
+ if ((ULONGLONG)deltadiff > (NomPerfCtrFreq / 1024)) {
+ disbelieved++;
+ dispcount++;
+#ifdef DEBUG
+ msyslog(LOG_DEBUG, "ctr delta %s%lld exceeds limit %llu",
+ (isneg) ? "-" : "",
+ deltadiff,
+ NomPerfCtrFreq / 1024);
+#endif
+ } else {
+
+ /*
+ * collect average over TUNE_CTR_DEPTH samples
+ * for our PerfCtrFreq trimming.
+ */
+
+ if (isneg)
+ deltadiff = -deltadiff;
+ sum -= diffs[i];
+ diffs[i] = deltadiff;
+ sum += deltadiff;
+ i = (i + 1) % COUNTOF(diffs);
+ count++;
+ dispcount++;
+ }
+
+ this_freq = delta / 1e6;
+
+ ObsPerfCtrFreq = NomPerfCtrFreq + (sum / COUNTOF(diffs));
+
+#if 1 /* #if 0 to disable changing freq used */
+ /* get rid of ObsPerfCtrFreq when removing the #ifdef */
+ PerfCtrFreq = ObsPerfCtrFreq;
+#endif
+ freq = PerfCtrFreq / 1e6;
+
+ /*
+ * make the performance counter's frequency error from its
+ * nominal rate, expressed in PPM, available via ntpq as
+ * system variable "ctr_frequency". This is consistent with
+ * "frequency" which is the system clock drift in PPM.
+ */
+ snprintf(ctr_freq_eq, sizeof(ctr_freq_eq), "ctr_frequency=%.2f",
+ 1e6 * (freq - nom_freq) / nom_freq);
+ set_sys_var(ctr_freq_eq, strlen(ctr_freq_eq) + 1, RO | DEF);
+
+ /*
+ * report observed ctr freq each time the estimate used during
+ * startup moves toward the observed freq from the nominal.
+ */
+
+ if (count > COUNTOF(diffs) &&
+ /* (count % COUNTOF(diffs)) && */ /* enables reporting each */
+ dispcount < report_at_count) /* TUNE_CTR_DEPTH samples */
+ return;
+
+ NLOG(NLOG_CLOCKINFO)
+ if (count <= COUNTOF(diffs))
+ /* moving to observed freq. from nominal (startup) */
+ msyslog(LOG_INFO,
+ (freq > 100)
+ ? "ctr %.3f MHz %+6.2f PPM using %.3f MHz %+6.2f PPM"
+ : "ctr %.6f MHz %+6.2f PPM using %.6f MHz %+6.2f PPM",
+ this_freq,
+ 1e6 * (this_freq - nom_freq) / nom_freq,
+ freq,
+ 1e6 * (freq - nom_freq) / nom_freq);
+ else
+ /* steady state */
+ msyslog(LOG_INFO,
+ (freq > 100)
+ ? "ctr %.3f MHz %+.2f PPM"
+ : "ctr %.6f MHz %+.2f PPM",
+ freq,
+ 1e6 * (freq - nom_freq) / nom_freq);
+
+ if (disbelieved) {
+ msyslog(LOG_ERR,
+ "%d ctr samples exceed +/- 976 PPM range gate",
+ disbelieved);
+ disbelieved = 0;
+ }
+
+ dispcount = 0;
+}
+
+
+/*
+ * add_counter_time_pair is called by the
+ * high priority clock thread with each new
+ * baseline counter/time correlation.
+ */
+void
+add_counter_time_pair(
+ ULONGLONG ctr,
+ LONGLONG time
+ )
+{
+ int i;
+
+ i = (newest_baseline + 1) % BASELINES_TOT;
+
+ baseline_counts[i] = ctr;
+ baseline_times[i] = time;
+
+ newest_baseline = i;
+}
+
+
+/*
+ * interp_time estimates NT time in 100ns units
+ * based on a performance counter value given.
+ * This must tolerate recent historical counters
+ * as well as current. When current is FALSE
+ * we can't assume ctr is the latest/highest
+ * seen.
+ */
+ULONGLONG
+interp_time(
+ ULONGLONG ctr,
+ BOOL current
+ )
+{
+ static __declspec(thread) int last_newest = -1;
+ static __declspec(thread) int last_newest_gen;
+ static __declspec(thread) int best_index;
+ ULONGLONG this_ctr;
+ LONGLONG this_time;
+ LONGLONG latest_time;
+ LONGLONG ctr_diff;
+ int i;
+ int i_gen;
+ int c;
+
+ /*
+ * Use the system time (roughly synchronised to the tick, and
+ * extrapolated using the system performance counter.
+ *
+ * Cache the results per thread and only repeat the
+ * calculation when new data has arrived.
+ */
+ i = newest_baseline;
+ i_gen = newest_baseline_gen;
+
+ if (last_newest == i && last_newest_gen == i_gen) {
+ this_time = baseline_times[best_index];
+ ctr_diff = ctr - baseline_counts[best_index];
+ this_time += (LONGLONG)PERF2HNS((double)ctr_diff);
+
+ return this_time;
+ }
+
+ last_newest = i;
+ last_newest_gen = i_gen;
+
+ latest_time = 0;
+
+ /*
+ * Run through the history calculating the interpolated
+ * time based on each counter/time correlation in turn,
+ * and believe the latest one. This is akin to the NTP
+ * protocol minimum delay clock filter. Errors due to
+ * counter/time correlations with stale time are all
+ * negative.
+ */
+ for (c = 0; c < BASELINES_USED; c++) {
+ if (baseline_times[i]) {
+ this_time = baseline_times[i];
+ this_ctr = baseline_counts[i];
+
+ ctr_diff = ctr - this_ctr;
+
+ if (current && ctr_diff < 0) {
+ /*
+ * The performance counter apparently went
+ * backwards without rolling over. It might
+ * be nice to complain but we don't want
+ * to do it repeatedly.
+ */
+ ctr_diff = 0;
+ }
+
+ this_time += (LONGLONG)PERF2HNS((double)ctr_diff);
+
+ if (this_time > latest_time) {
+ latest_time = this_time;
+ best_index = i;
+ }
+ }
+ i = i ? (i - 1) : (BASELINES_TOT - 1);
+ }
+
+ return latest_time;
+}
diff --git a/ports/winnt/ntpd/ntp_iocompletionport.c b/ports/winnt/ntpd/ntp_iocompletionport.c
new file mode 100644
index 0000000..046d6cd
--- /dev/null
+++ b/ports/winnt/ntpd/ntp_iocompletionport.c
@@ -0,0 +1,1639 @@
+/*
+-----------------------------------------------------------------------
+This is the IO completion port handling for async/overlapped IO on
+Windows >= Win2000.
+
+Some notes on the implementation:
+
++ Only one thread is used to serve the IO completion port, for several
+ reasons:
+
+ * First, there seems to be (have been?) trouble that locked up NTPD
+ when more than one thread was used for IOCPL.
+
+ * Second, for the sake of the time stamp interpolation the threads
+ must run on the same CPU as the time interpolation thread. This
+ makes using more than one thread useless, as they would compete for
+ the same core and create contention.
+
++ Some IO operations need a possibly lengthy postprocessing. Emulating
+ the UN*X line discipline is currently the only but prominent example.
+ To avoid the processing in the time-critical IOCPL thread, longer
+ processing is offloaded the worker thread pool.
+
++ A fact that seems not as well-known as it should be is that all
+ ressources passed to an overlapped IO operation must be considered
+ owned by the OS until the result has been fetched/dequeued. This
+ includes all overlapped structures and buffers involved, so cleaning
+ up on shutdown must be carefully constructed. (This includes closing
+ all the IO handles and waiting for the results to be dequeued.
+ 'CancleIo()' cannot be used since it's broken beyond repair.)
+
+ If this is not possible, then all ressources should be dropped into
+ oblivion -- otherwise "bad things (tm)" are bound to happen.
+
+ Using a private heap that is silently dropped but not deleted is a
+ good way to avoid cluttering memory stats with IO context related
+ objects. Leak tracing becomes more interesting, though.
+
+
+The current implementation is based on the work of Danny Mayer who improved
+the original implementation and Dave Hart who improved on the serial I/O
+routines. The true roots of this file seem to be shrouded by the mist of time...
+
+
+This version still provides the 'user space PPS' emulation
+feature.
+
+Juergen Perlinger (perlinger@ntp.org) Feb 2012
+
+-----------------------------------------------------------------------
+*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef HAVE_IO_COMPLETION_PORT
+
+#include <stddef.h>
+#include <stdio.h>
+#include <process.h>
+#include <syslog.h>
+
+#include "ntpd.h"
+#include "ntp_machine.h"
+#include "ntp_iocompletionport.h"
+#include "ntp_request.h"
+#include "ntp_assert.h"
+#include "ntp_io.h"
+#include "ntp_lists.h"
+
+
+#define CONTAINEROF(p, type, member) \
+ ((type *)((char *)(p) - offsetof(type, member)))
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 201) /* nonstd extension nameless union */
+#endif
+
+/*
+ * ---------------------------------------------------------------------
+ * storage type for PPS data (DCD change counts & times)
+ * ---------------------------------------------------------------------
+ */
+struct PpsData {
+ u_long cc_assert;
+ u_long cc_clear;
+ l_fp ts_assert;
+ l_fp ts_clear;
+};
+typedef struct PpsData PPSData_t;
+
+struct PpsDataEx {
+ u_long cov_count;
+ PPSData_t data;
+};
+typedef volatile struct PpsDataEx PPSDataEx_t;
+
+/*
+ * ---------------------------------------------------------------------
+ * device context; uses reference counting to avoid nasty surprises.
+ * Currently this stores only the PPS time stamps, but it could be
+ * easily extended.
+ * ---------------------------------------------------------------------
+ */
+#define PPS_QUEUE_LEN 8u /* must be power of two! */
+#define PPS_QUEUE_MSK (PPS_QUEUE_LEN-1) /* mask for easy MOD ops */
+
+struct DeviceContext {
+ volatile long ref_count;
+ volatile u_long cov_count;
+ PPSData_t pps_data;
+ PPSDataEx_t pps_buff[PPS_QUEUE_LEN];
+};
+
+typedef struct DeviceContext DevCtx_t;
+
+/*
+ * ---------------------------------------------------------------------
+ * I/O context structure
+ *
+ * This is an extended overlapped structure. Some fields are only used
+ * for serial I/O, others are used for all operations. The serial I/O is
+ * more interesting since the same context object is used for waiting,
+ * actual I/O and possibly offload processing in a worker thread until
+ * a complete operation cycle is done.
+ *
+ * In this case the I/O context is used to gather all the bits that are
+ * finally needed for the processing of the buffer.
+ * ---------------------------------------------------------------------
+ */
+//struct IoCtx;
+typedef struct IoCtx IoCtx_t;
+typedef struct refclockio RIO_t;
+
+typedef void (*IoCompleteFunc)(ULONG_PTR, IoCtx_t *);
+
+struct IoCtx {
+ OVERLAPPED ol; /* 'kernel' part of the context */
+ union {
+ recvbuf_t * recv_buf; /* incoming -> buffer structure */
+ void * trans_buf; /* outgoing -> char array */
+ PPSData_t * pps_buf; /* for reading PPS seq/stamps */
+ HANDLE ppswake; /* pps wakeup for attach */
+ };
+ IoCompleteFunc onIoDone; /* HL callback to execute */
+ RIO_t * rio; /* RIO backlink (for offload) */
+ DevCtx_t * devCtx;
+ l_fp DCDSTime; /* PPS-hack: time of DCD ON */
+ l_fp FlagTime; /* timestamp of flag/event char */
+ l_fp RecvTime; /* timestamp of callback */
+ DWORD errCode; /* error code of last I/O */
+ DWORD byteCount; /* byte count " */
+ DWORD com_events; /* buffer for COM events */
+ unsigned int flRawMem : 1; /* buffer is raw memory -> free */
+ unsigned int flTsDCDS : 1; /* DCDSTime valid? */
+ unsigned int flTsFlag : 1; /* FlagTime valid? */
+};
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+/*
+ * local function definitions
+ */
+static void ntpd_addremove_semaphore(HANDLE, int);
+static inline void set_serial_recv_time (recvbuf_t *, IoCtx_t *);
+
+/* Initiate/Request async IO operations */
+static BOOL QueueSerialWait (RIO_t *, recvbuf_t *, IoCtx_t *);
+static BOOL QueueSerialRead (RIO_t *, recvbuf_t *, IoCtx_t *);
+static BOOL QueueRawSerialRead(RIO_t *, recvbuf_t *, IoCtx_t *);
+static BOOL QueueSocketRecv (SOCKET , recvbuf_t *, IoCtx_t *);
+
+
+/* High-level IO callback functions */
+static void OnSocketRecv (ULONG_PTR, IoCtx_t *);
+static void OnSerialWaitComplete (ULONG_PTR, IoCtx_t *);
+static void OnSerialReadComplete (ULONG_PTR, IoCtx_t *);
+static void OnRawSerialReadComplete(ULONG_PTR, IoCtx_t *);
+static void OnSerialWriteComplete (ULONG_PTR, IoCtx_t *);
+
+/* worker pool offload functions */
+static DWORD WINAPI OnSerialReadWorker(void * ctx);
+
+
+/* keep a list to traverse to free memory on debug builds */
+#ifdef DEBUG
+static void free_io_completion_port_mem(void);
+#endif
+
+
+ HANDLE WaitableExitEventHandle;
+ HANDLE WaitableIoEventHandle;
+static HANDLE hIoCompletionPort;
+
+DWORD ActiveWaitHandles;
+HANDLE WaitHandles[16];
+
+/*
+ * -------------------------------------------------------------------
+ * We make a pool of our own for IO context objects -- the are owned by
+ * the system until a completion result is pulled from the queue, and
+ * they seriously go into the way of memory tracking until we can safely
+ * cancel an IO request.
+ * -------------------------------------------------------------------
+ */
+static HANDLE hHeapHandle;
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Create a new heap for IO context objects
+ */
+static void
+IoCtxPoolInit(
+ size_t initObjs
+ )
+{
+ hHeapHandle = HeapCreate(0, initObjs * sizeof(IoCtx_t), 0);
+ if (hHeapHandle == NULL) {
+ msyslog(LOG_ERR, "Can't initialize Heap: %m");
+ exit(1);
+ }
+}
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ *
+ * Delete the IO context heap
+ *
+ * Since we do not know what callbacks are pending, we just drop the
+ * pool into oblivion. New allocs and frees will fail from this moment,
+ * but we simply don't care. At least the normal heap dump stats will
+ * show no leaks from IO context blocks. On the downside, we have to
+ * track them ourselves if something goes wrong.
+ */
+static void
+IoCtxPoolDone(void)
+{
+ hHeapHandle = NULL;
+}
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Alloc & Free on local heap
+ *
+ * When the heap handle is NULL, these both will fail; Alloc with a NULL
+ * return and Free silently.
+ */
+static void * __fastcall
+LocalPoolAlloc(
+ size_t size,
+ const char * desc
+)
+{
+ void * ptr;
+
+ /* Windows heaps can't grok zero byte allocation.
+ * We just get one byte.
+ */
+ if (size == 0)
+ size = 1;
+ if (hHeapHandle != NULL)
+ ptr = HeapAlloc(hHeapHandle, HEAP_ZERO_MEMORY, size);
+ else
+ ptr = NULL;
+ DPRINTF(3, ("Allocate '%s', heap=%p, ptr=%p\n",
+ desc, hHeapHandle, ptr));
+
+ return ptr;
+}
+
+static void __fastcall
+LocalPoolFree(
+ void * ptr,
+ const char * desc
+ )
+{
+ DPRINTF(3, ("Free '%s', heap=%p, ptr=%p\n",
+ desc, hHeapHandle, ptr));
+ if (ptr != NULL && hHeapHandle != NULL)
+ HeapFree(hHeapHandle, 0, ptr);
+}
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Alloc & Free of Device context
+ *
+ * When the heap handle is NULL, these both will fail; Alloc with a NULL
+ * return and Free silently.
+ */
+static DevCtx_t * __fastcall
+DevCtxAlloc(void)
+{
+ DevCtx_t * devCtx;
+ u_long slot;
+
+ /* allocate struct and tag all slots as invalid */
+ devCtx = (DevCtx_t *)LocalPoolAlloc(sizeof(DevCtx_t), "DEV ctx");
+ if (devCtx != NULL)
+ {
+ /* The initial COV values make sure there is no busy
+ * loop on unused/empty slots.
+ */
+ devCtx->cov_count = 0;
+ for (slot = 0; slot < PPS_QUEUE_LEN; slot++)
+ devCtx->pps_buff[slot].cov_count = ~slot;
+ }
+ return devCtx;
+}
+
+static void __fastcall
+DevCtxFree(
+ DevCtx_t * devCtx
+ )
+{
+ /* this would be the place to get rid of managed ressources. */
+ LocalPoolFree(devCtx, "DEV ctx");
+}
+
+static DevCtx_t * __fastcall
+DevCtxAttach(
+ DevCtx_t * devCtx
+ )
+{
+ if (devCtx != NULL)
+ InterlockedIncrement(&devCtx->ref_count);
+ return devCtx;
+}
+
+static void __fastcall
+DevCtxDetach(
+ DevCtx_t * devCtx
+ )
+{
+ if (devCtx && !InterlockedDecrement(&devCtx->ref_count))
+ DevCtxFree(devCtx);
+}
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Alloc & Free of I/O context
+ *
+ * When the heap handle is NULL, these both will fail; Alloc with a NULL
+ * return and Free silently.
+ */
+static IoCtx_t * __fastcall
+IoCtxAlloc(
+ DevCtx_t * devCtx
+ )
+{
+ IoCtx_t * ioCtx;
+
+ ioCtx = (IoCtx_t *)LocalPoolAlloc(sizeof(IoCtx_t), "IO ctx");
+ if (ioCtx != NULL)
+ ioCtx->devCtx = DevCtxAttach(devCtx);
+ return ioCtx;
+}
+
+static void __fastcall
+IoCtxFree(
+ IoCtx_t * ctx
+ )
+{
+ if (ctx)
+ DevCtxDetach(ctx->devCtx);
+ LocalPoolFree(ctx, "IO ctx");
+}
+
+static void __fastcall
+IoCtxReset(
+ IoCtx_t * ctx
+ )
+{
+ RIO_t * rio;
+ DevCtx_t * dev;
+ if (ctx) {
+ rio = ctx->rio;
+ dev = ctx->devCtx;
+ ZERO(*ctx);
+ ctx->rio = rio;
+ ctx->devCtx = dev;
+ }
+}
+
+/*
+ * -------------------------------------------------------------------
+ * The IO completion thread and support functions
+ *
+ * There is only one completion thread, because it is locked to the same
+ * core as the time interpolation. Having more than one causes core
+ * contention and is not useful.
+ * -------------------------------------------------------------------
+ */
+static HANDLE hIoCompletionThread;
+static UINT tidCompletionThread;
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * The IO completion worker thread
+ *
+ * Note that this thread does not enter an alertable wait state and that
+ * the only waiting point is the IO completion port. If stopping this
+ * thread with a special queued result packet does not work,
+ * 'TerminateThread()' is the only remaining weapon in the arsenal. A
+ * dangerous weapon -- it's like SIGKILL.
+ */
+static unsigned WINAPI
+iocompletionthread(void *NotUsed)
+{
+ DWORD err;
+ DWORD octets;
+ ULONG_PTR key;
+ OVERLAPPED * pol;
+ IoCtx_t * lpo;
+
+ UNUSED_ARG(NotUsed);
+
+ /*
+ * Socket and refclock receive call gettimeofday() so the I/O
+ * thread needs to be on the same processor as the main and
+ * timing threads to ensure consistent QueryPerformanceCounter()
+ * results.
+ *
+ * This gets seriously into the way of efficient thread pooling
+ * on multicore systems.
+ */
+ lock_thread_to_processor(GetCurrentThread());
+
+ /*
+ * Set the thread priority high enough so I/O will preempt
+ * normal recv packet processing, but not higher than the timer
+ * sync thread.
+ */
+ if (!SetThreadPriority(GetCurrentThread(),
+ THREAD_PRIORITY_ABOVE_NORMAL))
+ msyslog(LOG_ERR, "Can't set thread priority: %m");
+
+ for(;;) {
+ if (GetQueuedCompletionStatus(
+ hIoCompletionPort,
+ &octets,
+ &key,
+ &pol,
+ INFINITE)) {
+ err = ERROR_SUCCESS;
+ } else {
+ err = GetLastError();
+ }
+ if (NULL == pol) {
+ DPRINTF(2, ("Overlapped IO Thread Exiting\n"));
+ break; /* fail */
+ }
+ lpo = CONTAINEROF(pol, IoCtx_t, ol);
+ get_systime(&lpo->RecvTime);
+ lpo->byteCount = octets;
+ lpo->errCode = err;
+ handler_calls++;
+ (*lpo->onIoDone)(key, lpo);
+ }
+
+ return 0;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Create/initialise the I/O creation port
+ */
+void
+init_io_completion_port(void)
+{
+#ifdef DEBUG
+ atexit(&free_io_completion_port_mem);
+#endif
+
+ /* Create the context pool first. */
+ IoCtxPoolInit(20);
+
+ /* Create the event used to signal an IO event */
+ WaitableIoEventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (WaitableIoEventHandle == NULL) {
+ msyslog(LOG_ERR, "Can't create I/O event handle: %m");
+ exit(1);
+ }
+ /* Create the event used to signal an exit event */
+ WaitableExitEventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (WaitableExitEventHandle == NULL) {
+ msyslog(LOG_ERR, "Can't create exit event handle: %m");
+ exit(1);
+ }
+
+ /* Create the IO completion port */
+ hIoCompletionPort = CreateIoCompletionPort(
+ INVALID_HANDLE_VALUE, NULL, 0, 0);
+ if (hIoCompletionPort == NULL) {
+ msyslog(LOG_ERR, "Can't create I/O completion port: %m");
+ exit(1);
+ }
+
+ /* Initialize the Wait Handles table */
+ WaitHandles[0] = WaitableIoEventHandle;
+ WaitHandles[1] = WaitableExitEventHandle; /* exit request */
+ WaitHandles[2] = WaitableTimerHandle;
+ ActiveWaitHandles = 3;
+
+ /*
+ * Supply ntp_worker.c with function to add or remove a
+ * semaphore to the ntpd I/O loop which is signalled by a worker
+ * when a response is ready. The callback is invoked in the
+ * parent.
+ */
+ addremove_io_semaphore = &ntpd_addremove_semaphore;
+
+ /*
+ * Have one thread servicing I/O. See rationale in front matter.
+ */
+ hIoCompletionThread = (HANDLE)_beginthreadex(
+ NULL,
+ 0,
+ iocompletionthread,
+ NULL,
+ 0,
+ &tidCompletionThread);
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * completion port teardown
+ */
+void
+uninit_io_completion_port(
+ void
+ )
+{
+ DWORD rc;
+
+ /* do noting if completion port already gone. */
+ if (NULL == hIoCompletionPort)
+ return;
+
+ /*
+ * Service thread seems running. Terminate him with grace
+ * first and force later...
+ */
+ if (tidCompletionThread != GetCurrentThreadId()) {
+ PostQueuedCompletionStatus(hIoCompletionPort, 0, 0, 0);
+ rc = WaitForSingleObject(hIoCompletionThread, 5000);
+ if (rc == WAIT_TIMEOUT) {
+ /* Thread lost. Kill off with TerminateThread. */
+ msyslog(LOG_ERR,
+ "IO completion thread refuses to terminate");
+ TerminateThread(hIoCompletionThread, ~0UL);
+ }
+ }
+
+ /* stop using the memory pool */
+ IoCtxPoolDone();
+
+ /* now reap all handles... */
+ CloseHandle(hIoCompletionThread);
+ hIoCompletionThread = NULL;
+ CloseHandle(hIoCompletionPort);
+ hIoCompletionPort = NULL;
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * external worker thread support (wait handle stuff)
+ *
+ * !Attention!
+ *
+ * - This function must only be called from the main thread. Changing
+ * a set of wait handles while someone is waiting on it creates
+ * undefined behaviour. Also there's no provision for mutual
+ * exclusion when accessing global values.
+ *
+ * - It's not possible to register a handle that is already in the table.
+ */
+static void
+ntpd_addremove_semaphore(
+ HANDLE sem,
+ int remove
+ )
+{
+ DWORD hi;
+
+ /* search for a matching entry first. */
+ for (hi = 3; hi < ActiveWaitHandles; hi++)
+ if (sem == WaitHandles[hi])
+ break;
+
+ if (remove) {
+ /*
+ * If found, eventually swap with last entry to keep
+ * the table dense.
+ */
+ if (hi < ActiveWaitHandles) {
+ ActiveWaitHandles--;
+ if (hi < ActiveWaitHandles)
+ WaitHandles[hi] =
+ WaitHandles[ActiveWaitHandles];
+ WaitHandles[ActiveWaitHandles] = NULL;
+ }
+ } else {
+ /*
+ * Make sure the entry is not found and there is enough
+ * room, then append to the table array.
+ */
+ if (hi >= ActiveWaitHandles) {
+ NTP_INSIST(ActiveWaitHandles < COUNTOF(WaitHandles));
+ WaitHandles[ActiveWaitHandles] = sem;
+ ActiveWaitHandles++;
+ }
+ }
+}
+
+
+#ifdef DEBUG
+static void
+free_io_completion_port_mem(
+ void
+ )
+{
+ /*
+ * At the moment, do absolutely nothing. Returning memory here
+ * requires NO PENDING OVERLAPPED OPERATIONS AT ALL at this
+ * point in time, and as long we cannot be reasonable sure about
+ * that the simple advice is:
+ *
+ * HANDS OFF!
+ */
+}
+#endif /* DEBUG */
+
+
+/*
+ * -------------------------------------------------------------------
+ * Serial IO stuff
+ *
+ * Prelude -- common error checking code
+ * -------------------------------------------------------------------
+ */
+extern char * NTstrerror(int err, BOOL *bfreebuf);
+
+static BOOL
+IoResultCheck(
+ DWORD err,
+ IoCtx_t * ctx,
+ const char * msg
+ )
+{
+ char * msgbuf;
+ BOOL dynbuf;
+
+ /* If the clock is not / no longer active, assume
+ * 'ERROR_OPERATION_ABORTED' and do the necessary cleanup.
+ */
+ if (ctx->rio && !ctx->rio->active)
+ err = ERROR_OPERATION_ABORTED;
+
+ switch (err)
+ {
+ /* The first ones are no real errors. */
+ case ERROR_SUCCESS: /* all is good */
+ case ERROR_IO_PENDING: /* callback pending */
+ return TRUE;
+
+ /* the next ones go silently -- only cleanup is done */
+ case ERROR_INVALID_PARAMETER: /* handle already closed */
+ case ERROR_OPERATION_ABORTED: /* handle closed while wait */
+ break;
+
+
+ default:
+ /*
+ * We have to resort to the low level error formatting
+ * functions here, since the error code can be an
+ * overlapped result. Relying the value to be the same
+ * as the 'GetLastError()' result at this point of
+ * execution is shaky at best, and using SetLastError()
+ * to force it seems too nasty.
+ */
+ msgbuf = NTstrerror(err, &dynbuf);
+ msyslog(LOG_ERR, "%s: err=%u, '%s'", msg, err, msgbuf);
+ if (dynbuf)
+ LocalFree(msgbuf);
+ break;
+ }
+
+ /* If we end here, we have to mop up the buffer and context */
+ if (ctx->flRawMem) {
+ if (ctx->trans_buf)
+ free(ctx->trans_buf);
+ } else {
+ if (ctx->recv_buf)
+ freerecvbuf(ctx->recv_buf);
+ }
+ IoCtxFree(ctx);
+ return FALSE;
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Serial IO stuff
+ *
+ * Part 1 -- COMM event handling
+ * -------------------------------------------------------------------
+ */
+
+static BOOL
+QueueSerialWait(
+ RIO_t * rio,
+ recvbuf_t * buff,
+ IoCtx_t * lpo
+ )
+{
+ BOOL rc;
+
+ lpo->onIoDone = OnSerialWaitComplete;
+ lpo->recv_buf = buff;
+ lpo->flRawMem = 0;
+ lpo->rio = rio;
+ buff->fd = rio->fd;
+
+ rc = WaitCommEvent((HANDLE)_get_osfhandle(rio->fd),
+ &lpo->com_events, &lpo->ol);
+ if (!rc)
+ return IoResultCheck(GetLastError(), lpo,
+ "Can't wait on Refclock");
+ return TRUE;
+}
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+static void
+OnSerialWaitComplete(
+ ULONG_PTR key,
+ IoCtx_t * lpo
+ )
+{
+ RIO_t * rio;
+ DevCtx_t * dev;
+ recvbuf_t * buff;
+ PPSDataEx_t * ppsbuf;
+ DWORD modem_status;
+ u_long covc;
+
+ /* check and bail out if operation failed */
+ if (!IoResultCheck(lpo->errCode, lpo,
+ "WaitCommEvent failed"))
+ return;
+
+ /* get & validate context and buffer. */
+ rio = (RIO_t *)key;
+ buff = lpo->recv_buf;
+ dev = lpo->devCtx;
+
+ NTP_INSIST(rio == lpo->rio);
+
+#ifdef DEBUG
+ if (~(EV_RXFLAG | EV_RLSD | EV_RXCHAR) & lpo->com_events) {
+ msyslog(LOG_ERR, "WaitCommEvent returned unexpected mask %x",
+ lpo->com_events);
+ exit(-1);
+ }
+#endif
+ /*
+ * Take note of changes on DCD; 'user mode PPS hack'.
+ * perlinger@ntp.org suggested a way of solving several problems with
+ * this code that makes a lot of sense: move to a putative
+ * dcdpps-ppsapi-provider.dll.
+ */
+ if (EV_RLSD & lpo->com_events) {
+ modem_status = 0;
+ GetCommModemStatus((HANDLE)_get_osfhandle(rio->fd),
+ &modem_status);
+
+ if (dev != NULL) {
+ /* PPS-context available -- use it! */
+ if (MS_RLSD_ON & modem_status) {
+ dev->pps_data.cc_assert++;
+ dev->pps_data.ts_assert = lpo->RecvTime;
+ DPRINTF(2, ("upps-real: fd %d DCD PPS Rise at %s\n", rio->fd,
+ ulfptoa(&lpo->RecvTime, 6)));
+ } else {
+ dev->pps_data.cc_clear++;
+ dev->pps_data.ts_clear = lpo->RecvTime;
+ DPRINTF(2, ("upps-real: fd %d DCD PPS Fall at %s\n", rio->fd,
+ ulfptoa(&lpo->RecvTime, 6)));
+ }
+ /*
+ ** Update PPS buffer, writing from low to high, with index
+ ** update as last action. We use interlocked ops and a
+ ** volatile data destination to avoid reordering on compiler
+ ** and CPU level. The interlocked instruction act as full
+ ** barriers -- we need only release semantics, but we don't
+ ** have them before VS2010.
+ */
+ covc = dev->cov_count + 1u;
+ ppsbuf = dev->pps_buff + (covc & PPS_QUEUE_MSK);
+ InterlockedExchange((PLONG)&ppsbuf->cov_count, covc);
+ ppsbuf->data = dev->pps_data;
+ InterlockedExchange((PLONG)&dev->cov_count, covc);
+ }
+ /* perlinger@ntp.org, 2012-11-19
+ It can be argued that once you have the PPS API active, you can
+ disable the old pps hack. This would give a behaviour that's much
+ more like the behaviour under a UN*Xish OS. On the other hand, it
+ will give a nasty surprise for people which have until now happily
+ taken the pps hack for granted, and after the first complaint, I have
+ decided to keep the old implementation unconditionally. So here it is:
+
+ /* backward compat: 'usermode-pps-hack' */
+ if (MS_RLSD_ON & modem_status) {
+ lpo->DCDSTime = lpo->RecvTime;
+ lpo->flTsDCDS = 1;
+ DPRINTF(2, ("upps-hack: fd %d DCD PPS Rise at %s\n", rio->fd,
+ ulfptoa(&lpo->RecvTime, 6)));
+ }
+ }
+
+ /* If IO ready, read data. Go back waiting else. */
+ if (EV_RXFLAG & lpo->com_events) { /* line discipline */
+ lpo->FlagTime = lpo->RecvTime;
+ lpo->flTsFlag = 1;
+ QueueSerialRead(rio, buff, lpo);
+ } else if (EV_RXCHAR & lpo->com_events) { /* raw discipline */
+ lpo->FlagTime = lpo->RecvTime;
+ lpo->flTsFlag = 1;
+ QueueRawSerialRead(rio, buff, lpo);
+ } else { /* idle... */
+ QueueSerialWait(rio, buff, lpo);
+ }
+}
+
+/*
+ * -------------------------------------------------------------------
+ * Serial IO stuff
+ *
+ * Part 2 -- line discipline emulation
+ *
+ * Ideally this should *not* be done in the IO completion thread.
+ * We use a worker pool thread to offload the low-level processing.
+ * -------------------------------------------------------------------
+ */
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Start & Queue a serial read for line discipline emulation.
+ */
+static BOOL
+QueueSerialRead(
+ RIO_t * rio,
+ recvbuf_t * buff,
+ IoCtx_t * lpo
+ )
+{
+ BOOL rc;
+
+ lpo->onIoDone = &OnSerialReadComplete;
+ lpo->recv_buf = buff;
+ lpo->flRawMem = 0;
+ lpo->rio = rio;
+ buff->fd = rio->fd;
+
+ rc = ReadFile((HANDLE)_get_osfhandle(rio->fd),
+ (char*)buff->recv_buffer + buff->recv_length,
+ sizeof(buff->recv_buffer) - buff->recv_length,
+ NULL, &lpo->ol);
+ if (!rc)
+ return IoResultCheck(GetLastError(), lpo,
+ "Can't read from Refclock");
+ return TRUE;
+}
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * IO completion thread callback. Takes a time stamp and offloads the
+ * real work to the worker pool ASAP.
+ */
+static void
+OnSerialReadComplete(
+ ULONG_PTR key,
+ IoCtx_t * lpo
+ )
+{
+ RIO_t * rio;
+ recvbuf_t * buff;
+
+ /* check and bail out if operation failed */
+ if (!IoResultCheck(lpo->errCode, lpo,
+ "Read from Refclock failed"))
+ return;
+
+ /* get & validate context and buffer. */
+ rio = lpo->rio;
+ buff = lpo->recv_buf;
+ NTP_INSIST((ULONG_PTR)rio == key);
+
+ /* Offload to worker pool */
+ if (!QueueUserWorkItem(&OnSerialReadWorker, lpo, WT_EXECUTEDEFAULT)) {
+ msyslog(LOG_ERR,
+ "Can't offload to worker thread, will skip data: %m");
+ IoCtxReset(lpo);
+ buff->recv_length = 0;
+ QueueSerialWait(rio, buff, lpo);
+ }
+}
+
+
+/*
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Worker pool offload function -- avoid lengthy operations in the IO
+ * completion thread (affects timing...)
+ *
+ * This function does the real work of emulating the UN*X line
+ * discipline. Since this involves allocation of additional buffers and
+ * string parsing/copying, it is offloaded to the worker thread pool so
+ * the IO completion thread can resume faster.
+ */
+static DWORD WINAPI
+OnSerialReadWorker(void * ctx)
+{
+ IoCtx_t * lpo;
+ recvbuf_t * buff, *obuf;
+ RIO_t * rio;
+ char *sptr, *send, *dptr;
+ BOOL eol;
+ char ch;
+
+ /* Get context back */
+ lpo = (IoCtx_t*)ctx;
+ buff = lpo->recv_buf;
+ rio = lpo->rio;
+ /*
+ * ignore 0 bytes read due to closure on fd.
+ * Eat the first line of input as it's possibly partial.
+ */
+ if (lpo->byteCount && rio->recvcount++) {
+ /* account for additional input */
+ buff->recv_length += (int)lpo->byteCount;
+
+ /*
+ * Now mimic the Unix line discipline.
+ */
+ sptr = (char *)buff->recv_buffer;
+ send = sptr + buff->recv_length;
+ obuf = NULL;
+ dptr = NULL;
+
+ /* hack #1: eat away leading CR/LF if here is any */
+ while (sptr != send) {
+ ch = *sptr;
+ if (ch != '\n' && ch != '\r')
+ break;
+ sptr++;
+ }
+
+ while (sptr != send)
+ {
+ /* get new buffer to store line */
+ obuf = get_free_recv_buffer_alloc();
+ obuf->fd = rio->fd;
+ obuf->receiver = &process_refclock_packet;
+ obuf->dstadr = NULL;
+ obuf->recv_peer = rio->srcclock;
+ set_serial_recv_time(obuf, lpo);
+
+ /*
+ * Copy data to new buffer, convert CR to LF on
+ * the fly. Stop after either.
+ */
+ dptr = (char *)obuf->recv_buffer;
+ eol = FALSE;
+ while (sptr != send && !eol) {
+ ch = *sptr++;
+ if ('\r' == ch) {
+ ch = '\n';
+ }
+ *dptr++ = ch;
+ eol = ('\n' == ch);
+ }
+ obuf->recv_length =
+ (int)(dptr - (char *)obuf->recv_buffer);
+
+ /*
+ * If NL found, push this buffer and prepare to
+ * get a new one.
+ */
+ if (eol) {
+ add_full_recv_buffer(obuf);
+ SetEvent(WaitableIoEventHandle);
+ obuf = NULL;
+ }
+ }
+
+ /*
+ * If we still have an output buffer, continue to fill
+ * it again.
+ */
+ if (obuf) {
+ obuf->recv_length =
+ (int)(dptr - (char *)obuf->recv_buffer);
+ freerecvbuf(buff);
+ buff = obuf;
+ } else {
+ /* clear the current buffer, continue */
+ buff->recv_length = 0;
+ }
+ } else {
+ buff->recv_length = 0;
+ }
+
+ IoCtxReset(lpo);
+ QueueSerialWait(rio, buff, lpo);
+ return 0;
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * Serial IO stuff
+ *
+ * Part 3 -- raw data input
+ *
+ * Raw data processing is fast enough to do without offloading to the
+ * worker pool, so this is rather short'n sweet...
+ * -------------------------------------------------------------------
+ */
+
+static BOOL
+QueueRawSerialRead(
+ RIO_t * rio,
+ recvbuf_t * buff,
+ IoCtx_t * lpo
+ )
+{
+ BOOL rc;
+
+ lpo->onIoDone = OnRawSerialReadComplete;
+ lpo->recv_buf = buff;
+ lpo->flRawMem = 0;
+ lpo->rio = rio;
+ buff->fd = rio->fd;
+
+ rc = ReadFile((HANDLE)_get_osfhandle(rio->fd),
+ buff->recv_buffer,
+ sizeof(buff->recv_buffer),
+ NULL, &lpo->ol);
+ if (!rc)
+ return IoResultCheck(GetLastError(), lpo,
+ "Can't read raw from Refclock");
+ return TRUE;
+}
+
+
+static void
+OnRawSerialReadComplete(
+ ULONG_PTR key,
+ IoCtx_t * lpo
+ )
+{
+ RIO_t * rio;
+ recvbuf_t * buff;
+
+ /* check and bail out if operation failed */
+ if (!IoResultCheck(lpo->errCode, lpo,
+ "Raw read from Refclock failed"))
+ return;
+
+ /* get & validate context and buffer. */
+ rio = lpo->rio;
+ buff = lpo->recv_buf;
+ NTP_INSIST((ULONG_PTR)rio == key);
+
+ /* ignore 0 bytes read. */
+ if (lpo->byteCount > 0) {
+ buff->recv_length = (int)lpo->byteCount;
+ buff->dstadr = NULL;
+ buff->receiver = process_refclock_packet;
+ buff->recv_peer = rio->srcclock;
+ set_serial_recv_time(buff, lpo);
+ add_full_recv_buffer(buff);
+ SetEvent(WaitableIoEventHandle);
+ buff = get_free_recv_buffer_alloc();
+ }
+
+ buff->recv_length = 0;
+ QueueSerialWait(rio, buff, lpo);
+}
+
+
+static inline void
+set_serial_recv_time(
+ recvbuf_t * obuf,
+ IoCtx_t * lpo
+ )
+{
+ /*
+ * Time stamp assignment is interesting. If we
+ * have a DCD stamp, we use it, otherwise we use
+ * the FLAG char event time, and if that is also
+ * not / no longer available we use the arrival
+ * time.
+ */
+ if (lpo->flTsDCDS)
+ obuf->recv_time = lpo->DCDSTime;
+ else if (lpo->flTsFlag)
+ obuf->recv_time = lpo->FlagTime;
+ else
+ obuf->recv_time = lpo->RecvTime;
+
+ lpo->flTsDCDS = lpo->flTsFlag = 0; /* use only once... */
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * Serial IO stuff
+ *
+ * Part 4 -- Overlapped serial output
+ *
+ * Again, no need to offload any work.
+ * -------------------------------------------------------------------
+ */
+
+/*
+ * async_write, clone of write(), used by some reflock drivers
+ */
+int
+async_write(
+ int fd,
+ const void * data,
+ unsigned int count
+ )
+{
+ IoCtx_t * lpo;
+ BOOL rc;
+
+ lpo = IoCtxAlloc(NULL);
+ if (lpo == NULL) {
+ DPRINTF(1, ("async_write: out of memory\n"));
+ errno = ENOMEM;
+ return -1;
+ }
+
+ lpo->onIoDone = OnSerialWriteComplete;
+ lpo->trans_buf = emalloc(count);
+ lpo->flRawMem = 1;
+ memcpy(lpo->trans_buf, data, count);
+
+ rc = WriteFile((HANDLE)_get_osfhandle(fd),
+ lpo->trans_buf, count,
+ NULL, &lpo->ol);
+ if (!rc && !IoResultCheck(GetLastError(), lpo,
+ "Can't write to Refclock")) {
+ errno = EBADF;
+ return -1;
+ }
+ return count;
+}
+
+static void
+OnSerialWriteComplete(
+ ULONG_PTR key,
+ IoCtx_t * lpo
+ )
+{
+ /* set RIO and force silent cleanup if no error */
+ lpo->rio = (RIO_t *)key;
+ if (ERROR_SUCCESS == lpo->errCode)
+ lpo->errCode = ERROR_OPERATION_ABORTED;
+ IoResultCheck(lpo->errCode, lpo,
+ "Write to Refclock failed");
+}
+
+
+/*
+ * -------------------------------------------------------------------
+ * Serial IO stuff
+ *
+ * Part 5 -- read PPS time stamps
+ *
+ * -------------------------------------------------------------------
+ */
+
+/* The dummy read procedure is used for getting the device context
+ * into the IO completion thread, using the IO completion queue for
+ * transport. There are other ways to accomplish what we need here,
+ * but using the IO machine is handy and avoids a lot of trouble.
+ */
+static void
+OnPpsDummyRead(
+ ULONG_PTR key,
+ IoCtx_t * lpo
+ )
+{
+ RIO_t * rio;
+
+ rio = (RIO_t *)key;
+ lpo->devCtx = DevCtxAttach(rio->device_context);
+ SetEvent(lpo->ppswake);
+}
+
+__declspec(dllexport) void* __stdcall
+ntp_pps_attach_device(
+ HANDLE hndIo
+ )
+{
+ IoCtx_t myIoCtx;
+ HANDLE myEvt;
+ DevCtx_t * dev;
+ DWORD rc;
+
+ if (!isserialhandle(hndIo)) {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return NULL;
+ }
+
+ ZERO(myIoCtx);
+ dev = NULL;
+ myEvt = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (NULL == myEvt)
+ goto done;
+
+ myIoCtx.ppswake = myEvt;
+ myIoCtx.onIoDone = OnPpsDummyRead;
+ rc = ReadFile(hndIo, &myIoCtx.byteCount, 0,
+ &myIoCtx.byteCount, &myIoCtx.ol);
+ if (!rc && (GetLastError() != ERROR_IO_PENDING))
+ goto done;
+ if (WaitForSingleObject(myEvt, INFINITE) == WAIT_OBJECT_0)
+ if (NULL == (dev = myIoCtx.devCtx))
+ SetLastError(ERROR_INVALID_HANDLE);
+done:
+ rc = GetLastError();
+ CloseHandle(myEvt);
+ SetLastError(rc);
+ return dev;
+}
+
+__declspec(dllexport) void __stdcall
+ntp_pps_detach_device(
+ DevCtx_t * dev
+ )
+{
+ DevCtxDetach(dev);
+}
+
+__declspec(dllexport) BOOL __stdcall
+ntp_pps_read(
+ DevCtx_t * dev,
+ PPSData_t * data,
+ size_t dlen
+ )
+{
+ u_long guard, covc;
+ int repc;
+ PPSDataEx_t * ppsbuf;
+
+
+ if (dev == NULL) {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (data == NULL || dlen != sizeof(PPSData_t)) {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ /*
+ ** Reading from shared memory in a lock-free fashion can be
+ ** a bit tricky, since we have to read the components in the
+ ** opposite direction from the write, and the compiler must
+ ** not reorder the read sequence.
+ ** We use interlocked ops and a volatile data source to avoid
+ ** reordering on compiler and CPU level. The interlocked
+ ** instruction act as full barriers -- we need only aquire
+ ** semantics, but we don't have them before VS2010.
+ */
+ repc = 3;
+ do {
+ InterlockedExchange((PLONG)&covc, dev->cov_count);
+ ppsbuf = dev->pps_buff + (covc & PPS_QUEUE_MSK);
+ *data = ppsbuf->data;
+ InterlockedExchange((PLONG)&guard, ppsbuf->cov_count);
+ guard ^= covc;
+ } while (guard && ~guard && --repc);
+
+ if (guard) {
+ SetLastError(ERROR_INVALID_DATA);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * Add a reference clock data structures I/O handles to
+ * the I/O completion port. Return 1 if any error.
+ */
+int
+io_completion_port_add_clock_io(
+ RIO_t *rio
+ )
+{
+ IoCtx_t * lpo;
+ DevCtx_t * dev;
+ recvbuf_t * buff;
+ HANDLE h;
+
+ h = (HANDLE)_get_osfhandle(rio->fd);
+ if (NULL == CreateIoCompletionPort(
+ h,
+ hIoCompletionPort,
+ (ULONG_PTR)rio,
+ 0)) {
+ msyslog(LOG_ERR, "Can't add COM port to i/o completion port: %m");
+ return 1;
+ }
+
+ dev = DevCtxAlloc();
+ if (NULL == dev) {
+ msyslog(LOG_ERR, "Can't allocate device context for i/o completion port: %m");
+ return 1;
+ }
+ rio->device_context = DevCtxAttach(dev);
+ lpo = IoCtxAlloc(dev);
+ if (NULL == lpo) {
+ msyslog(LOG_ERR, "Can't allocate heap for completion port: %m");
+ return 1;
+ }
+ buff = get_free_recv_buffer_alloc();
+ buff->recv_length = 0;
+ QueueSerialWait(rio, buff, lpo);
+
+ return 0;
+}
+
+void
+io_completion_port_remove_clock_io(
+ RIO_t *rio
+ )
+{
+ if (rio)
+ DevCtxDetach((DevCtx_t *)rio->device_context);
+}
+
+/*
+ * Queue a receiver on a socket. Returns 0 if no buffer can be queued
+ *
+ * Note: As per the winsock documentation, we use WSARecvFrom. Using
+ * ReadFile() is less efficient.
+ */
+static BOOL
+QueueSocketRecv(
+ SOCKET s,
+ recvbuf_t * buff,
+ IoCtx_t * lpo
+ )
+{
+ WSABUF wsabuf;
+ DWORD Flags;
+ int rc;
+
+ lpo->onIoDone = OnSocketRecv;
+ lpo->recv_buf = buff;
+ lpo->flRawMem = 0;
+ lpo->rio = NULL;
+
+ Flags = 0;
+ buff->fd = s;
+ buff->recv_srcadr_len = sizeof(buff->recv_srcadr);
+ wsabuf.buf = (char *)buff->recv_buffer;
+ wsabuf.len = sizeof(buff->recv_buffer);
+
+ rc = WSARecvFrom(buff->fd, &wsabuf, 1, NULL, &Flags,
+ &buff->recv_srcadr.sa, &buff->recv_srcadr_len,
+ &lpo->ol, NULL);
+ if (SOCKET_ERROR == rc)
+ return IoResultCheck(GetLastError(), lpo,
+ "Can't read from Socket");
+ return TRUE;
+}
+
+
+static void
+OnSocketRecv(
+ ULONG_PTR key,
+ IoCtx_t * lpo
+ )
+{
+ recvbuf_t * buff;
+ recvbuf_t * newbuff;
+ struct interface * inter = (struct interface *)key;
+
+ NTP_REQUIRE(NULL != lpo);
+ NTP_REQUIRE(NULL != lpo->recv_buf);
+
+ /* check and bail out if operation failed */
+ if (!IoResultCheck(lpo->errCode, lpo,
+ "Read from Socket failed"))
+ return;
+
+ /*
+ * Convert the overlapped pointer back to a recvbuf pointer.
+ * Fetch items that are lost when the context is queued again.
+ */
+ buff = lpo->recv_buf;
+ buff->recv_time = lpo->RecvTime;
+ buff->recv_length = (int)lpo->byteCount;
+
+ /*
+ * Get a new recv buffer for the replacement socket receive
+ */
+ newbuff = get_free_recv_buffer_alloc();
+ if (NULL != newbuff) {
+ QueueSocketRecv(inter->fd, newbuff, lpo);
+ } else {
+ IoCtxFree(lpo);
+ msyslog(LOG_ERR, "Can't add I/O request to socket");
+ }
+ DPRINTF(4, ("%sfd %d %s recv packet mode is %d\n",
+ (MODE_BROADCAST == get_packet_mode(buff))
+ ? " **** Broadcast "
+ : "",
+ (int)buff->fd, stoa(&buff->recv_srcadr),
+ get_packet_mode(buff)));
+
+ /*
+ * If we keep it add some info to the structure
+ */
+ if (buff->recv_length && !inter->ignore_packets) {
+ NTP_INSIST(buff->recv_srcadr_len <=
+ sizeof(buff->recv_srcadr));
+ buff->receiver = &receive;
+ buff->dstadr = inter;
+ packets_received++;
+ handler_pkts++;
+ inter->received++;
+ add_full_recv_buffer(buff);
+
+ DPRINTF(2, ("Received %d bytes fd %d in buffer %p from %s\n",
+ buff->recv_length, (int)buff->fd, buff,
+ stoa(&buff->recv_srcadr)));
+
+ /*
+ * Now signal we have something to process
+ */
+ SetEvent(WaitableIoEventHandle);
+ } else
+ freerecvbuf(buff);
+}
+
+
+/*
+ * Add a socket handle to the I/O completion port, and send
+ * NTP_RECVS_PER_SOCKET recv requests to the kernel.
+ */
+int
+io_completion_port_add_socket(
+ SOCKET fd,
+ struct interface * inter
+ )
+{
+ IoCtx_t * lpo;
+ recvbuf_t * buff;
+ int n;
+
+ if (fd != INVALID_SOCKET) {
+ if (NULL == CreateIoCompletionPort((HANDLE)fd,
+ hIoCompletionPort, (ULONG_PTR)inter, 0)) {
+ msyslog(LOG_ERR,
+ "Can't add socket to i/o completion port: %m");
+ return 1;
+ }
+ }
+
+ /*
+ * Windows 2000 bluescreens with bugcheck 0x76
+ * PROCESS_HAS_LOCKED_PAGES at ntpd process
+ * termination when using more than one pending
+ * receive per socket. A runtime version test
+ * would allow using more on newer versions
+ * of Windows.
+ */
+
+#define WINDOWS_RECVS_PER_SOCKET 1
+
+ for (n = 0; n < WINDOWS_RECVS_PER_SOCKET; n++) {
+
+ buff = get_free_recv_buffer_alloc();
+ lpo = IoCtxAlloc(NULL);
+ if (lpo == NULL)
+ {
+ msyslog(LOG_ERR
+ , "Can't allocate IO completion context: %m");
+ return 1;
+ }
+
+ QueueSocketRecv(fd, buff, lpo);
+
+ }
+ return 0;
+}
+
+
+/*
+ * io_completion_port_sendto() -- sendto() replacement for Windows
+ *
+ * Returns len after successful send.
+ * Returns -1 for any error, with the error code available via
+ * msyslog() %m, or GetLastError().
+ */
+int
+io_completion_port_sendto(
+ int fd,
+ void * pkt,
+ size_t len,
+ sockaddr_u * dest
+ )
+{
+ static u_long time_next_ifscan_after_error;
+ WSABUF wsabuf;
+ DWORD octets_sent;
+ DWORD Result;
+ int errval;
+ int AddrLen;
+
+ wsabuf.buf = (void *)pkt;
+ wsabuf.len = len;
+ AddrLen = SOCKLEN(dest);
+ octets_sent = 0;
+
+ Result = WSASendTo(fd, &wsabuf, 1, &octets_sent, 0,
+ &dest->sa, AddrLen, NULL, NULL);
+ errval = GetLastError();
+ if (SOCKET_ERROR == Result) {
+ if (ERROR_UNEXP_NET_ERR == errval) {
+ /*
+ * We get this error when trying to send if the
+ * network interface is gone or has lost link.
+ * Rescan interfaces to catch on sooner, but no
+ * more often than once per minute. Once ntpd
+ * is able to detect changes without polling
+ * this should be unneccessary
+ */
+ if (time_next_ifscan_after_error < current_time) {
+ time_next_ifscan_after_error = current_time + 60;
+ timer_interfacetimeout(current_time);
+ }
+ DPRINTF(4, ("sendto unexpected network error, interface may be down\n"));
+ } else {
+ msyslog(LOG_ERR, "WSASendTo(%s) error %m",
+ stoa(dest));
+ }
+ SetLastError(errval);
+ return -1;
+ }
+
+ if (len != (int)octets_sent) {
+ msyslog(LOG_ERR, "WSASendTo(%s) sent %u of %d octets",
+ stoa(dest), octets_sent, len);
+ SetLastError(ERROR_BAD_LENGTH);
+ return -1;
+ }
+
+ DPRINTF(4, ("sendto %s %d octets\n", stoa(dest), len));
+
+ return len;
+}
+
+
+
+/*
+ * GetReceivedBuffers
+ * Note that this is in effect the main loop for processing requests
+ * both send and receive. This should be reimplemented
+ */
+int
+GetReceivedBuffers()
+{
+ DWORD index;
+ HANDLE ready;
+ int have_packet;
+
+ have_packet = FALSE;
+ while (!have_packet) {
+ index = WaitForMultipleObjects(ActiveWaitHandles,
+ WaitHandles, FALSE,
+ INFINITE);
+ switch (index) {
+
+ case WAIT_OBJECT_0 + 0: /* Io event */
+ DPRINTF(4, ("IoEvent occurred\n"));
+ have_packet = TRUE;
+ break;
+
+ case WAIT_OBJECT_0 + 1: /* exit request */
+ exit(0);
+ break;
+
+ case WAIT_OBJECT_0 + 2: /* timer */
+ timer();
+ break;
+
+ case WAIT_IO_COMPLETION: /* loop */
+ break;
+
+ case WAIT_TIMEOUT:
+ msyslog(LOG_ERR,
+ "WaitForMultipleObjects INFINITE timed out.");
+ exit(1);
+ break;
+
+ case WAIT_FAILED:
+ msyslog(LOG_ERR,
+ "WaitForMultipleObjects Failed: Error: %m");
+ exit(1);
+ break;
+
+ default:
+ DEBUG_INSIST((index - WAIT_OBJECT_0) <
+ ActiveWaitHandles);
+ ready = WaitHandles[index - WAIT_OBJECT_0];
+ handle_blocking_resp_sem(ready);
+ break;
+
+ } /* switch */
+ }
+
+ return (full_recvbuffs()); /* get received buffers */
+}
+
+#else
+ static int NonEmptyCompilationUnit;
+#endif
+
diff --git a/ports/winnt/ntpd/ntservice.c b/ports/winnt/ntpd/ntservice.c
new file mode 100644
index 0000000..f0840bd
--- /dev/null
+++ b/ports/winnt/ntpd/ntservice.c
@@ -0,0 +1,321 @@
+/*
+ * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1999-2002 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include <ntp_stdlib.h>
+#include "syslog.h"
+#include "ntpd.h"
+#include "ntservice.h"
+#include "clockstuff.h"
+#include "ntp_iocompletionport.h"
+#include "ntpd-opts.h"
+#include "isc/win32os.h"
+#include <ssl_applink.c>
+
+
+/*
+ * Globals
+ */
+static SERVICE_STATUS_HANDLE hServiceStatus = 0;
+static BOOL foreground = FALSE;
+static BOOL computer_shutting_down = FALSE;
+static int glb_argc;
+static char **glb_argv;
+HANDLE hServDoneEvent = NULL;
+extern int accept_wildcard_if_for_winnt;
+
+/*
+ * Forward declarations
+ */
+void uninit_io_completion_port();
+int ntpdmain(int argc, char *argv[]);
+void WINAPI ServiceControl(DWORD dwCtrlCode);
+void ntservice_exit(void);
+
+#ifdef WRAP_DBG_MALLOC
+void *wrap_dbg_malloc(size_t s, const char *f, int l);
+void *wrap_dbg_realloc(void *p, size_t s, const char *f, int l);
+void wrap_dbg_free(void *p);
+#endif
+
+void WINAPI
+service_main(
+ DWORD argc,
+ LPTSTR *argv
+ )
+{
+ if (argc > 1) {
+ /*
+ * Let command line parameters from the Windows SCM GUI
+ * override the standard parameters from the ImagePath registry key.
+ */
+ glb_argc = argc;
+ glb_argv = argv;
+ }
+
+ ntpdmain(glb_argc, glb_argv);
+}
+
+
+/*
+ * This is the entry point for the executable
+ * We can call ntpdmain() explicitly or via StartServiceCtrlDispatcher()
+ * as we need to.
+ */
+int main(
+ int argc,
+ char ** argv
+ )
+{
+ int rc;
+ int argc_after_opts;
+ char ** argv_after_opts;
+
+ ssl_applink();
+
+ /* Save the command line parameters */
+ glb_argc = argc;
+ glb_argv = argv;
+
+ /* Under original Windows NT we must not discard the wildcard */
+ /* socket to workaround a bug in NT's getsockname(). */
+ if (isc_win32os_majorversion() <= 4)
+ accept_wildcard_if_for_winnt = TRUE;
+
+ argc_after_opts = argc;
+ argv_after_opts = argv;
+ parse_cmdline_opts(&argc_after_opts, &argv_after_opts);
+
+ if (HAVE_OPT(QUIT)
+ || HAVE_OPT(SAVECONFIGQUIT)
+ || HAVE_OPT(HELP)
+#ifdef DEBUG
+ || OPT_VALUE_SET_DEBUG_LEVEL != 0
+#endif
+ || HAVE_OPT(NOFORK))
+ foreground = TRUE;
+
+ if (foreground) /* run in console window */
+ rc = ntpdmain(argc, argv);
+ else {
+ /* Start up as service */
+
+ SERVICE_TABLE_ENTRY dispatchTable[] = {
+ { TEXT(NTP_DISPLAY_NAME), service_main },
+ { NULL, NULL }
+ };
+
+ rc = StartServiceCtrlDispatcher(dispatchTable);
+ if (rc)
+ rc = 0;
+ else {
+ rc = GetLastError();
+ fprintf(stderr,
+ "%s: unable to start as service:\n"
+ "%s\n"
+ "Use -d, -q, -n, -?, --help or "
+ "--saveconfigquit to run "
+ "interactive.\n",
+ argv[0], ntp_strerror(rc));
+ }
+ }
+ return rc;
+}
+
+
+/*
+ * Initialize the Service by registering it.
+ */
+void
+ntservice_init() {
+ char ConsoleTitle[256];
+
+ if (!foreground) {
+ /* Register handler with the SCM */
+ hServiceStatus = RegisterServiceCtrlHandler(NTP_DISPLAY_NAME,
+ ServiceControl);
+ if (!hServiceStatus) {
+ NTReportError(NTP_SERVICE_NAME,
+ "could not register service control handler");
+ exit(1);
+ }
+ UpdateSCM(SERVICE_RUNNING);
+ } else {
+ snprintf(ConsoleTitle, sizeof(ConsoleTitle),
+ "NTP Version %s", Version);
+ ConsoleTitle[sizeof(ConsoleTitle) - 1] = '\0';
+ SetConsoleTitle(ConsoleTitle);
+ }
+
+#ifdef _CRTDBG_MAP_ALLOC
+ /* ask the runtime to dump memory leaks at exit */
+ _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF
+ | _CRTDBG_LEAK_CHECK_DF /* report on leaks at exit */
+ | _CRTDBG_CHECK_ALWAYS_DF /* Check heap every alloc/dealloc */
+#ifdef MALLOC_LINT
+ | _CRTDBG_DELAY_FREE_MEM_DF /* Don't actually free memory */
+#endif
+ );
+#ifdef DOES_NOT_WORK
+ /*
+ * hart: I haven't seen this work, running ntpd.exe -n from a shell
+ * to both a file and the debugger output window. Docs indicate it
+ * should cause leak report to go to stderr, but it's only seen if
+ * ntpd runs under a debugger (in the debugger's output), even with
+ * this block of code enabled.
+ */
+ _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
+ _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+#endif
+#endif /* using MS debug C runtime heap, _CRTDBG_MAP_ALLOC */
+
+ atexit( ntservice_exit );
+}
+
+
+/*
+ * Routine to check if the service is stopping
+ * because the computer is shutting down
+ */
+BOOL
+ntservice_systemisshuttingdown() {
+ return computer_shutting_down;
+}
+
+void
+ntservice_exit( void )
+{
+ uninit_io_completion_port();
+ Sleep( 200 ); //##++
+
+ reset_winnt_time();
+
+ msyslog(LOG_INFO, "ntservice: The Network Time Protocol Service is stopping.");
+
+ if (!foreground) {
+ /* service mode, need to have the service_main routine
+ * register with the service control manager that the
+ * service has stopped running, before exiting
+ */
+ UpdateSCM(SERVICE_STOPPED);
+ }
+}
+
+/*
+ * ServiceControl(): Handles requests from the SCM and passes them on
+ * to the service.
+ */
+void WINAPI
+ServiceControl(
+ DWORD dwCtrlCode
+ )
+{
+ switch (dwCtrlCode) {
+
+ case SERVICE_CONTROL_SHUTDOWN:
+ computer_shutting_down = TRUE;
+ /* fall through to stop case */
+
+ case SERVICE_CONTROL_STOP:
+ if (WaitableExitEventHandle != NULL) {
+ SetEvent(WaitableExitEventHandle);
+ UpdateSCM(SERVICE_STOP_PENDING);
+ Sleep(100); //##++
+ }
+ return;
+
+ case SERVICE_CONTROL_PAUSE:
+ case SERVICE_CONTROL_CONTINUE:
+ case SERVICE_CONTROL_INTERROGATE:
+ default:
+ break;
+ }
+ UpdateSCM(SERVICE_RUNNING);
+}
+
+/*
+ * Tell the Service Control Manager the state of the service.
+ */
+void UpdateSCM(DWORD state) {
+ SERVICE_STATUS ss;
+ static DWORD dwState = SERVICE_STOPPED;
+
+ if (hServiceStatus) {
+ if (state)
+ dwState = state;
+
+ ZERO(ss);
+ ss.dwServiceType |= SERVICE_WIN32_OWN_PROCESS;
+ ss.dwCurrentState = dwState;
+ ss.dwControlsAccepted = SERVICE_ACCEPT_STOP |
+ SERVICE_ACCEPT_SHUTDOWN;
+ ss.dwCheckPoint = 0;
+ ss.dwServiceSpecificExitCode = 0;
+ ss.dwWin32ExitCode = NO_ERROR;
+ ss.dwWaitHint = dwState == SERVICE_STOP_PENDING ? 5000 : 1000;
+
+ SetServiceStatus(hServiceStatus, &ss);
+ }
+}
+
+BOOL WINAPI
+OnConsoleEvent(
+ DWORD dwCtrlType
+ )
+{
+ switch (dwCtrlType) {
+#ifdef DEBUG
+ case CTRL_BREAK_EVENT:
+ if (debug > 0) {
+ debug <<= 1;
+ }
+ else {
+ debug = 1;
+ }
+ if (debug > 8) {
+ debug = 0;
+ }
+ msyslog(LOG_DEBUG, "debug level %d", debug);
+ break;
+#else
+ case CTRL_BREAK_EVENT:
+ break;
+#endif
+
+ case CTRL_C_EVENT:
+ case CTRL_CLOSE_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
+ if (WaitableExitEventHandle != NULL) {
+ SetEvent(WaitableExitEventHandle);
+ Sleep(100); //##++
+ }
+ break;
+
+ default :
+ /* pass to next handler */
+ return FALSE;
+ }
+
+ /* we've handled it, no more handlers should be called */
+ return TRUE;
+}
+
diff --git a/ports/winnt/ntptrace/ntptrace.dsp b/ports/winnt/ntptrace/ntptrace.dsp
new file mode 100644
index 0000000..ed8616a
--- /dev/null
+++ b/ports/winnt/ntptrace/ntptrace.dsp
@@ -0,0 +1,153 @@
+# Microsoft Developer Studio Project File - Name="ntptrace" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ntptrace - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ntptrace.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ntptrace.mak" CFG="ntptrace - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ntptrace - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "ntptrace - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""$/ntp/dev/ports/winnt/ntptrace", AXBAAAAA"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ntptrace - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W4 /GX /O2 /I "\\" /I "$(OPENSSL)\inc32" /I "." /I "..\include" /I "..\..\..\include" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /YX"windows.h" /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ntptrace - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "." /I "..\include" /I "..\..\..\include" /I "$(OPENSSL)\inc32" /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /FR /YX"windows.h" /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/Debug/ntptrace.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "ntptrace - Win32 Release"
+# Name "ntptrace - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\ntptrace\ntptrace.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libntp\util_clockstuff.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\version.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\include\sys\ioctl.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\ntptrace\ntptrace.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\sys\resource.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# Begin Source File
+
+SOURCE=..\..\..\configure
+
+!IF "$(CFG)" == "ntptrace - Win32 Release"
+
+# Begin Custom Build
+ProjDir=.
+InputPath=..\..\..\configure
+
+"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ echo Using NT Shell Script to generate version.c
+ ..\scripts\mkver.bat -P ntptrace
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "ntptrace - Win32 Debug"
+
+# Begin Custom Build
+ProjDir=.
+InputPath=..\..\..\configure
+
+"$(ProjDir)\version.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ echo Using NT Shell Script to generate version.c
+ ..\scripts\mkver.bat -P ntptrace
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Target
+# End Project
diff --git a/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h b/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h
new file mode 100644
index 0000000..1007ccd
--- /dev/null
+++ b/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.h
@@ -0,0 +1,714 @@
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2000 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and with or without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * This modified timepps.h can be used to provide a PPSAPI interface *
+ * to a machine running Windows with a suitably modified *
+ * serialpps.sys being used in place of serial.sys. It can *
+ * be extended to support a modified parallel port driver once *
+ * available. *
+ * *
+ * This Windows version was derived by Dave Hart *
+ * <davehart@davehart.com> from Mills' timepps-Solaris.h *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+#ifndef _SYS_TIMEPPS_H_
+#define _SYS_TIMEPPS_H_
+
+/* Implementation note: the logical states ``assert'' and ``clear''
+ * are implemented in terms of the UART register, i.e. ``assert''
+ * means the bit is set.
+ */
+
+/*
+ * The following definitions are architecture independent
+ */
+
+#define PPS_API_VERS_1 1 /* API version number */
+#define PPS_JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
+#define PPS_NANOSECOND 1000000000L /* one nanosecond in decimal */
+#define PPS_FRAC 4294967296. /* 2^32 as a double */
+#define PPS_HECTONANOSECONDS 10000000 /* 100ns units in a second */
+#define PPS_FILETIME_1970 0x019db1ded53e8000 /* unix epoch to Windows */
+
+#define PPS_NORMALIZE(x) /* normalize timespec */ \
+ do { \
+ if ((x).tv_nsec >= PPS_NANOSECOND) { \
+ (x).tv_nsec -= PPS_NANOSECOND; \
+ (x).tv_sec++; \
+ } else if ((x).tv_nsec < 0) { \
+ (x).tv_nsec += PPS_NANOSECOND; \
+ (x).tv_sec--; \
+ } \
+ } while (0)
+
+#define PPS_TSPECTONTP(x) /* convert timespec to ntp_fp */ \
+ do { \
+ double d_temp; \
+ \
+ (x).integral += (unsigned int)PPS_JAN_1970; \
+ d_temp = (x).fractional * PPS_FRAC / PPS_NANOSECOND; \
+ if (d_temp >= PPS_FRAC) \
+ (x).integral++; \
+ (x).fractional = (unsigned int)d_temp; \
+ } while (0)
+
+#define PPS_NTPTOTSPEC(x) /* convert ntp_fp to timespec */ \
+ do { \
+ double d_temp; \
+ \
+ (x).tv_sec -= (time_t)PPS_JAN_1970; \
+ d_temp = (double)((x).tv_nsec); \
+ d_temp *= PPS_NANOSECOND; \
+ d_temp /= PPS_FRAC; \
+ (x).tv_nsec = (long)d_temp; \
+ } while (0)
+
+
+/*
+ * Device/implementation parameters (mode)
+ */
+
+#define PPS_CAPTUREASSERT 0x01 /* capture assert events */
+#define PPS_CAPTURECLEAR 0x02 /* capture clear events */
+#define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */
+
+#define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */
+#define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */
+#define PPS_OFFSETBOTH 0x30 /* apply compensation for both */
+
+#define PPS_CANWAIT 0x100 /* Can we wait for an event? */
+#define PPS_CANPOLL 0x200 /* "This bit is reserved for */
+
+/*
+ * Kernel actions (mode)
+ */
+
+#define PPS_ECHOASSERT 0x40 /* feed back assert event to output */
+#define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */
+
+/*
+ * Timestamp formats (tsformat)
+ */
+
+#define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */
+#define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */
+
+/*
+ * Kernel discipline actions (not used in Windows yet)
+ */
+
+#define PPS_KC_HARDPPS 0 /* enable kernel consumer */
+#define PPS_KC_HARDPPS_PLL 1 /* phase-lock mode */
+#define PPS_KC_HARDPPS_FLL 2 /* frequency-lock mode */
+
+/*
+ * Type definitions
+ */
+
+typedef unsigned long pps_seq_t; /* sequence number */
+
+#pragma warning(push)
+#pragma warning(disable: 201) /* nonstd extension nameless union */
+
+typedef struct ntp_fp {
+ union ntp_fp_sec {
+ unsigned int integral;
+ int s_integral;
+ };
+ unsigned int fractional;
+} ntp_fp_t; /* NTP-compatible time stamp */
+
+#pragma warning(pop)
+
+typedef union pps_timeu { /* timestamp format */
+ struct timespec tspec;
+ ntp_fp_t ntpfp;
+ unsigned long longpad[3];
+} pps_timeu_t; /* generic data type to represent time stamps */
+
+/* addition of NTP fixed-point format */
+
+#define NTPFP_M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \
+ do { \
+ register u_int32 lo_tmp; \
+ register u_int32 hi_tmp; \
+ \
+ lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \
+ hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \
+ if (lo_tmp & 0x10000) \
+ hi_tmp++; \
+ (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
+ \
+ (r_i) += (a_i); \
+ if (hi_tmp & 0x10000) \
+ (r_i)++; \
+ } while (0)
+
+#define NTPFP_L_ADDS(r, a) NTPFP_M_ADD((r)->integral, (r)->fractional, \
+ (a)->s_integral, (a)->fractional)
+
+
+/*
+ * Timestamp information structure
+ */
+
+typedef struct pps_info {
+ pps_seq_t assert_sequence; /* seq. num. of assert event */
+ pps_seq_t clear_sequence; /* seq. num. of clear event */
+ pps_timeu_t assert_tu; /* time of assert event */
+ pps_timeu_t clear_tu; /* time of clear event */
+ int current_mode; /* current mode bits */
+} pps_info_t;
+
+#define assert_timestamp assert_tu.tspec
+#define clear_timestamp clear_tu.tspec
+
+#define assert_timestamp_ntpfp assert_tu.ntpfp
+#define clear_timestamp_ntpfp clear_tu.ntpfp
+
+/*
+ * Parameter structure
+ */
+
+typedef struct pps_params {
+ int api_version; /* API version # */
+ int mode; /* mode bits */
+ pps_timeu_t assert_off_tu; /* offset compensation for assert */
+ pps_timeu_t clear_off_tu; /* offset compensation for clear */
+} pps_params_t;
+
+#define assert_offset assert_off_tu.tspec
+#define clear_offset clear_off_tu.tspec
+
+#define assert_offset_ntpfp assert_off_tu.ntpfp
+#define clear_offset_ntpfp clear_off_tu.ntpfp
+
+/*
+ * The following definitions are architecture-dependent
+ */
+
+#define PPS_CAP (PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+#define PPS_RO (PPS_CANWAIT | PPS_CANPOLL)
+
+typedef struct {
+ int filedes; /* file descriptor */
+ OVERLAPPED ol; /* caches ol.hEvent for DeviceIoControl */
+ pps_params_t params; /* PPS parameters set by user */
+} pps_unit_t;
+
+typedef pps_unit_t* pps_handle_t; /* pps handlebars */
+
+/*
+ *------ Here begins the implementation-specific part! ------
+ */
+
+#include <windows.h>
+#include <errno.h>
+
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP 45
+#endif
+
+typedef struct _OLD_SERIAL_PPS_STAMPS {
+ LARGE_INTEGER Timestamp;
+ LARGE_INTEGER Counterstamp;
+} OLD_SERIAL_PPS_STAMPS, *POLDSERIAL_PPS_STAMPS;
+
+typedef struct _SERIAL_PPS_STAMPS {
+ LARGE_INTEGER Timestamp;
+ LARGE_INTEGER Counterstamp;
+ DWORD SeqNum;
+} SERIAL_PPS_STAMPS, *PSERIAL_PPS_STAMPS;
+
+#define IOCTL_SERIAL_GET_PPS_STAMPS CTL_CODE(FILE_DEVICE_SERIAL_PORT,114,METHOD_BUFFERED,FILE_ANY_ACCESS)
+
+/* byte offset of member m in struct typedef s */
+#define PPS_OFFSETOF(m,s) (size_t)(&((s *)0)->m)
+
+/*
+ * ntpd on Windows only looks to errno after finding
+ * GetLastError returns NO_ERROR. To accomodate its
+ * use of msyslog in portable code such as refclock_atom.c,
+ * this implementation always clears the Windows
+ * error code using SetLastError(NO_ERROR) when
+ * returning an errno. This is also a good idea
+ * for any non-ntpd clients as they should use only
+ * the errno for PPSAPI functions.
+ */
+#define RETURN_PPS_ERRNO(e) \
+do { \
+ SetLastError(NO_ERROR); \
+ errno = (e); \
+ return -1; \
+} while (0)
+
+
+#ifdef OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER
+extern void pps_ntp_timestamp_from_counter(ntp_fp_t *, ULONGLONG, ULONGLONG);
+#else
+/*
+ * helper routine for serialpps.sys ioctl which returns
+ * performance counter "timestamp" as well as a system
+ * FILETIME timestamp. Converts one of the inputs to
+ * NTP fixed-point format.
+ */
+static inline void
+pps_ntp_timestamp_from_counter(
+ ntp_fp_t *result,
+ ULONGLONG Timestamp,
+ ULONGLONG Counterstamp)
+{
+ ULONGLONG BiasedTimestamp;
+
+ /* convert from 100ns units to NTP fixed point format */
+
+ BiasedTimestamp = Timestamp - PPS_FILETIME_1970;
+ result->integral = PPS_JAN_1970 +
+ (unsigned)(BiasedTimestamp / PPS_HECTONANOSECONDS);
+ result->fractional =
+ (unsigned) ((BiasedTimestamp % PPS_HECTONANOSECONDS) *
+ (PPS_FRAC / PPS_HECTONANOSECONDS));
+}
+#endif
+
+
+/*
+ * create PPS handle from file descriptor
+ */
+
+static inline int
+time_pps_create(
+ int filedes, /* file descriptor */
+ pps_handle_t *handle /* returned handle */
+ )
+{
+ OLD_SERIAL_PPS_STAMPS old_pps_stamps;
+ DWORD bytes;
+ OVERLAPPED ol;
+
+ /*
+ * Check for valid arguments and attach PPS signal.
+ */
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ if (PPS_OFFSETOF(tspec.tv_nsec, pps_timeu_t) !=
+ PPS_OFFSETOF(ntpfp.fractional, pps_timeu_t)) {
+ fprintf(stderr,
+ "timepps.h needs work, union of \n"
+ "unsigned int ntp_fp.integral and\n"
+ "time_t timespec.tv_sec accessed\n"
+ "interchangeably.\n");
+ RETURN_PPS_ERRNO(EFAULT);
+ }
+
+ /*
+ * For this ioctl which will never block, we don't want to go
+ * through the overhead of a completion port, so we use an
+ * event handle in the overlapped structure with its 1 bit set.
+ *
+ * From GetQueuedCompletionStatus docs:
+ * Even if you have passed the function a file handle associated
+ * with a completion port and a valid OVERLAPPED structure, an
+ * application can prevent completion port notification. This is
+ * done by specifying a valid event handle for the hEvent member
+ * of the OVERLAPPED structure, and setting its low-order bit. A
+ * valid event handle whose low-order bit is set keeps I/O
+ * completion from being queued to the completion port.
+ */
+
+ ol.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ ol.hEvent = (HANDLE) ((ULONG_PTR)ol.hEvent | 1);
+
+ if (FALSE == DeviceIoControl(
+ (HANDLE)_get_osfhandle(filedes),
+ IOCTL_SERIAL_GET_PPS_STAMPS,
+ NULL,
+ 0,
+ &old_pps_stamps,
+ sizeof(old_pps_stamps),
+ &bytes,
+ &ol)
+ || sizeof(old_pps_stamps) != bytes) {
+
+ /*
+ * If you want to write some dead code this could detect the
+ * IOCTL being pended, but the driver always has the info
+ * instantly, so ERROR_IO_PENDING isn't a concern.
+ */
+
+ CloseHandle(ol.hEvent);
+ fprintf(stderr,
+ "time_pps_create: IOCTL_SERIAL_GET_PPS_STAMPS: %d %d\n",
+ bytes,
+ GetLastError());
+ RETURN_PPS_ERRNO(ENXIO);
+ }
+
+ /*
+ * Allocate and initialize default unit structure.
+ */
+
+ *handle = malloc(sizeof(pps_unit_t));
+ if (!(*handle))
+ RETURN_PPS_ERRNO(ENOMEM);
+
+ memset(*handle, 0, sizeof(pps_unit_t));
+ (*handle)->filedes = filedes;
+ (*handle)->ol.hEvent = ol.hEvent;
+ (*handle)->params.api_version = PPS_API_VERS_1;
+ (*handle)->params.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
+ return (0);
+}
+
+/*
+ * release PPS handle
+ */
+
+static inline int
+time_pps_destroy(
+ pps_handle_t handle
+ )
+{
+ /*
+ * Check for valid arguments and detach PPS signal.
+ */
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ CloseHandle(handle->ol.hEvent);
+ free(handle);
+ return (0);
+}
+
+/*
+ * set parameters for handle
+ */
+
+static inline int
+time_pps_setparams(
+ pps_handle_t handle,
+ const pps_params_t *params
+ )
+{
+ int mode, mode_in;
+ /*
+ * Check for valid arguments and set parameters.
+ */
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (!params)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ /*
+ * There was no reasonable consensu in the API working group.
+ * I require `api_version' to be set!
+ */
+
+ if (params->api_version != PPS_API_VERS_1)
+ RETURN_PPS_ERRNO(EINVAL);
+
+ /*
+ * only settable modes are PPS_CAPTUREASSERT and PPS_OFFSETASSERT
+ */
+
+ mode_in = params->mode;
+
+ /*
+ * Only one of the time formats may be selected
+ * if a nonzero assert offset is supplied.
+ */
+ if ((mode_in & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) ==
+ (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) {
+
+ if (handle->params.assert_offset.tv_sec ||
+ handle->params.assert_offset.tv_nsec)
+
+ RETURN_PPS_ERRNO(EINVAL);
+
+ /*
+ * If no offset was specified but both time
+ * format flags are used consider it harmless
+ * but turn off PPS_TSFMT_NTPFP so getparams
+ * will not show both formats lit.
+ */
+ mode_in &= ~PPS_TSFMT_NTPFP;
+ }
+
+ /* turn off read-only bits */
+
+ mode_in &= ~PPS_RO;
+
+ /*
+ * test remaining bits, should only have captureassert,
+ * offsetassert, and/or timestamp format bits.
+ */
+
+ if (mode_in & ~(PPS_CAPTUREASSERT | PPS_OFFSETASSERT |
+ PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP))
+ RETURN_PPS_ERRNO(EOPNOTSUPP);
+
+ /*
+ * ok, ready to go.
+ */
+
+ mode = handle->params.mode;
+ handle->params = *params;
+ handle->params.mode = mode | mode_in;
+ handle->params.api_version = PPS_API_VERS_1;
+ return (0);
+}
+
+/*
+ * get parameters for handle
+ */
+
+static inline int
+time_pps_getparams(
+ pps_handle_t handle,
+ pps_params_t *params
+ )
+{
+ /*
+ * Check for valid arguments and get parameters.
+ */
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (!params)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ *params = handle->params;
+ return (0);
+}
+
+/* (
+ * get capabilities for handle
+ */
+
+static inline int
+time_pps_getcap(
+ pps_handle_t handle,
+ int *mode
+ )
+{
+ /*
+ * Check for valid arguments and get capabilities.
+ */
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (!mode)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ *mode = PPS_CAP;
+ return (0);
+}
+
+/*
+ * Fetch timestamps
+ */
+
+static inline int
+time_pps_fetch(
+ pps_handle_t handle,
+ const int tsformat,
+ pps_info_t *ppsinfo,
+ const struct timespec *timeout
+ )
+{
+ SERIAL_PPS_STAMPS pps_stamps;
+ pps_info_t infobuf;
+ BOOL rc;
+ DWORD bytes;
+ DWORD lasterr;
+
+ /*
+ * Check for valid arguments and fetch timestamps
+ */
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (!ppsinfo)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ /*
+ * nb. PPS_CANWAIT is NOT set by the implementation, we can totally
+ * ignore the timeout variable.
+ */
+
+ memset(&infobuf, 0, sizeof(infobuf));
+
+ /*
+ * if not captureassert, nothing to return.
+ */
+
+ if (!handle->params.mode & PPS_CAPTUREASSERT) {
+ *ppsinfo = infobuf;
+ return (0);
+ }
+
+ /*
+ * First rev of serialpps.sys didn't support the SeqNum field,
+ * support it by simply returning constant 0 for serial in that case.
+ */
+ pps_stamps.SeqNum = 0;
+
+ /*
+ * interrogate (hopefully) serialpps.sys
+ * if it's the standard serial.sys or another driver,
+ * IOCTL_SERIAL_GET_PPS_STAMPS is most likely unknown
+ * and will result in ERROR_INVALID_PARAMETER.
+ */
+ bytes = 0;
+
+ rc = DeviceIoControl(
+ (HANDLE)_get_osfhandle(handle->filedes),
+ IOCTL_SERIAL_GET_PPS_STAMPS,
+ NULL,
+ 0,
+ &pps_stamps,
+ sizeof(pps_stamps),
+ &bytes,
+ &handle->ol);
+
+ if (!rc) {
+
+ lasterr = GetLastError();
+ if (ERROR_INVALID_PARAMETER != lasterr)
+ fprintf(stderr, "time_pps_fetch: ioctl err %d\n",
+ lasterr);
+ RETURN_PPS_ERRNO(EOPNOTSUPP);
+
+ } else if (bytes != sizeof(pps_stamps) &&
+ bytes != sizeof(OLD_SERIAL_PPS_STAMPS)) {
+
+ fprintf(stderr,
+ "time_pps_fetch: wanted %d or %d bytes got %d from "
+ "IOCTL_SERIAL_GET_PPS_STAMPS 0x%x\n" ,
+ sizeof(OLD_SERIAL_PPS_STAMPS),
+ sizeof(SERIAL_PPS_STAMPS),
+ bytes,
+ IOCTL_SERIAL_GET_PPS_STAMPS);
+ RETURN_PPS_ERRNO(ENXIO);
+ }
+
+ /*
+ * pps_ntp_timestamp_from_counter takes the two flavors
+ * of timestamp we have (counter and system time) and
+ * uses whichever it can to give the best NTP fixed-point
+ * conversion. In ntpd the Counterstamp is typically
+ * used. A stub implementation in this file simply
+ * converts from Windows Timestamp to NTP fixed-point.
+ */
+ pps_ntp_timestamp_from_counter(
+ &infobuf.assert_timestamp_ntpfp,
+ pps_stamps.Timestamp.QuadPart,
+ pps_stamps.Counterstamp.QuadPart);
+
+ /*
+ * Note that only assert timestamps
+ * are captured by this interface.
+ */
+
+ infobuf.assert_sequence = pps_stamps.SeqNum;
+
+ /*
+ * Apply offset and translate to specified format
+ */
+
+ switch (tsformat) {
+ case PPS_TSFMT_NTPFP: /* NTP format requires no translation */
+ if (handle->params.mode & PPS_OFFSETASSERT) {
+ NTPFP_L_ADDS(&infobuf.assert_timestamp_ntpfp,
+ &handle->params.assert_offset_ntpfp);
+ }
+ break;
+
+ case PPS_TSFMT_TSPEC: /* timespec format requires conversion to nsecs form */
+ PPS_NTPTOTSPEC(infobuf.assert_timestamp);
+ if (handle->params.mode & PPS_OFFSETASSERT) {
+ infobuf.assert_timestamp.tv_sec +=
+ handle->params.assert_offset.tv_sec;
+ infobuf.assert_timestamp.tv_nsec +=
+ handle->params.assert_offset.tv_nsec;
+ PPS_NORMALIZE(infobuf.assert_timestamp);
+ }
+ break;
+
+ default:
+ RETURN_PPS_ERRNO(EINVAL);
+ }
+
+ infobuf.current_mode = handle->params.mode;
+ *ppsinfo = infobuf;
+ return (0);
+}
+
+/*
+ * time_pps_kcbind - specify kernel consumer
+ *
+ * Not supported so far by Windows.
+ */
+
+static inline int
+time_pps_kcbind(
+ pps_handle_t handle,
+ const int kernel_consumer,
+ const int edge, const int tsformat
+ )
+{
+ /*
+ * Check for valid arguments before revealing the ugly truth
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ RETURN_PPS_ERRNO(EOPNOTSUPP);
+}
+
+
+
+#endif /* _SYS_TIMEPPS_H_ */
diff --git a/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt b/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt
new file mode 100644
index 0000000..e335d4d
--- /dev/null
+++ b/ports/winnt/ppsapi/loopback/monolithic-serialpps-timepps.txt
@@ -0,0 +1,52 @@
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2000 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and with or without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * This modified timepps.h can be used to provide a PPSAPI interface *
+ * to a machine running Windows with a suitably modified *
+ * serialpps.sys being used in place of serial.sys. It can *
+ * be extended to support a modified parallel port driver once *
+ * available. *
+ * *
+ * This Windows version was derived by Dave Hart *
+ * <davehart@davehart.com> from Mills' timepps-Solaris.h *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+timepps.h implements IETF RFC "Pulse-Per-Second API for UNIX-like
+Operating Systems, Version 1.0" for Microsoft Windows.
+
+
diff --git a/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c b/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c
new file mode 100644
index 0000000..4a708f4
--- /dev/null
+++ b/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.c
@@ -0,0 +1,465 @@
+/*
+ * loopback-ppsapi-provider.c - derived from monolithic timepps.h
+ * for usermode PPS by Juergen Perlinger
+ */
+
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2009 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * This serialpps-ppsapi-provider.dll implements the PPSAPI provider *
+ * for serialpps.sys, which is a very lightly patched Windows *
+ * serial.sys with CD timestamping support.
+ * *
+ * This Windows version was derived by Dave Hart *
+ * <davehart@davehart.com> from David L. Mills' timepps-Solaris.h *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+/*
+ * Implementation note: the logical states ``assert'' and ``clear''
+ * are implemented in terms of the UART register, i.e. ``assert''
+ * means the bit is set. This follows the sense of the serial driver
+ * of the Windows OS, and is opposite of the RS-232 spec for the
+ * CD/DCD logical state.
+ */
+
+
+#define PPSAPI_PROVIDER_EXPORTS
+#include "loopback-ppsapi.h"
+
+/*
+** global stuff
+*/
+
+pcreate_pps_handle p_create_pps_handle;
+
+#define SERIALPPS_CAPS (PPS_CAPTUREBOTH | PPS_OFFSETBOTH | PPS_TSFMT_BOTH)
+#define SERIALPPS_RO (PPS_CANWAIT | PPS_CANPOLL)
+
+
+/*
+ * The ntp_timestamp_from_counter callback into timepps.h routines in
+ * the host is saved in each unit separately, so that binaries that
+ * inline timepps.h into multiple source files (such as refclock_atom.c
+ * and a number of other ntpd refclocks including refclock_nmea.c) will
+ * get called back in the correct instance for each unit. This assumes
+ * that ppsapi_prov_init for subsequent instances happens only after the
+ * first instance has completed all time_pps_create() calls it will
+ * invoke, which is a safe assumption at least for ntpd.
+ */
+struct loopback_unit {
+ HANDLE hnd_dev; /* true device handle */
+ HANDLE hnd_pps; /* loopback handle */
+ ntp_fp_t ofs_assert; /* correction for assert*/
+ ntp_fp_t ofs_clear; /* correction for clear */
+};
+typedef struct loopback_unit loopback_unit;
+
+/*
+ * --------------------------------------------------------------------
+ * DllMain - DLL entrypoint, no-op.
+ * --------------------------------------------------------------------
+ */
+BOOL APIENTRY DllMain(
+ HMODULE hModule,
+ DWORD why,
+ LPVOID lpReserved
+ )
+{
+ UNUSED(hModule);
+ UNUSED(lpReserved);
+ UNUSED(why);
+
+ return TRUE;
+}
+
+/*
+ * --------------------------------------------------------------------
+ * time conversion and other helpers
+ * --------------------------------------------------------------------
+ */
+
+/* --------------------------------------------------------------------
+ * convert fixed point time stamp to struct timespec, with proper
+ * Epoch/Era unfolding around the current time.
+ */
+static struct timespec
+fp_stamp_to_tspec(
+ ntp_fp_t x,
+ time_t p
+ )
+{
+ struct timespec out;
+ u_int64 tmp;
+ u_int32 ntp;
+
+ ntp = x.I.u;
+ tmp = p;
+ tmp -= 0x80000000u; /* unshift of half range */
+ ntp -= (u_int32)PPS_JAN_1970; /* warp into UN*X domain */
+ ntp -= (u_int32)tmp; /* cycle difference */
+ tmp += (u_int64)ntp; /* get expanded time */
+ out.tv_sec = (time_t)tmp;
+ out.tv_nsec = ((long)(((u_int64)x.F.u * PPS_NANOSECOND + 0x80000000u) >> 32));
+ if (out.tv_nsec >= PPS_NANOSECOND) {
+ out.tv_nsec -= PPS_NANOSECOND;
+ out.tv_sec++;
+ }
+
+ return out;
+}
+
+/* --------------------------------------------------------------------
+ * convert a duration in struct timespec format to
+ * fixed point representation.
+ */
+static ntp_fp_t
+tspec_to_fp(
+ const struct timespec * ts
+ )
+{
+ ntp_fp_t out;
+ long tmp;
+
+ out.I.u = (u_int32)ts->tv_sec;
+ tmp = ts->tv_nsec;
+ if (tmp < 0)
+ do {
+ tmp += PPS_NANOSECOND;
+ out.I.u--;
+ } while (tmp < 0);
+ else if (tmp >= PPS_NANOSECOND)
+ do {
+ tmp -= PPS_NANOSECOND;
+ out.I.u++;
+ } while (tmp >= PPS_NANOSECOND);
+ out.F.u = (u_int32)((u_int64)tmp << 32) + (PPS_NANOSECOND / 2) / PPS_NANOSECOND;
+ return out;
+}
+
+/* --------------------------------------------------------------------
+ * count number of '1' bits in a u_long
+ */
+static size_t
+popcount(
+ u_long val
+ )
+{
+ size_t res;
+
+ for (res = 0; val; res++)
+ val &= (val - 1);
+ return res;
+}
+
+/*
+ * --------------------------------------------------------------------
+ * API function implementation
+ * --------------------------------------------------------------------
+ */
+
+/* --------------------------------------------------------------------
+ * prov_time_pps_create - create PPS handle given underlying device
+ */
+int WINAPI
+prov_time_pps_create(
+ HANDLE device, /* underlying device */
+ pps_handle_t * handle /* returned handle */
+ )
+{
+ loopback_unit * loopunit;
+ pps_unit_t * punit;
+
+ /*
+ * Allocate and initialize loopback unit structure.
+ */
+ loopunit = (loopback_unit*)calloc(1, sizeof(loopback_unit));
+ if (NULL == loopunit)
+ return ENOMEM;
+
+ /* Try to attach to NTPD internal data with the device handle.
+ * Free unit buffer on failure.
+ */
+ loopunit->hnd_dev = device;
+ loopunit->hnd_pps = ntp_pps_attach_device(device);
+ if (NULL == loopunit->hnd_pps) {
+ free(loopunit);
+ return ENXIO;
+ }
+
+ /* create the outer PPS handle structure. Undo work done so far
+ * if things go wrong.
+ */
+ *handle = (*p_create_pps_handle)(loopunit);
+ if (!*handle) {
+ ntp_pps_detach_device(loopunit->hnd_pps);
+ free(loopunit);
+ return ENOMEM;
+ }
+
+ /* All good so far. Store things to remember. */
+ punit = (pps_unit_t *)*handle;
+ punit->params.api_version = PPS_API_VERS_1;
+ punit->params.mode = PPS_CAPTUREBOTH | PPS_TSFMT_BOTH;
+ return 0;
+}
+
+
+/* --------------------------------------------------------------------
+ * prov_time_pps_destroy - release PPS handle
+ */
+int WINAPI
+prov_time_pps_destroy(
+ pps_unit_t * unit,
+ void * context
+ )
+{
+ loopback_unit * loopunit;
+
+ loopunit = (loopback_unit*)context;
+ if (unit->context == context)
+ unit->context = NULL;
+ if (NULL != loopunit)
+ ntp_pps_detach_device(loopunit->hnd_pps);
+ free(loopunit);
+ return 0;
+}
+
+
+/* --------------------------------------------------------------------
+ * prov_time_pps_setparams - set parameters for handle
+ */
+int WINAPI
+prov_time_pps_setparams(
+ pps_unit_t * unit,
+ void * context,
+ const pps_params_t * params
+ )
+{
+ loopback_unit * loopunit;
+ int mode;
+
+ loopunit = (loopback_unit*)context;
+ mode = params->mode;
+
+ /*
+ * There was no reasonable consensus in the API working group.
+ * I require `api_version' to be set!
+ */
+ if (params->api_version != PPS_API_VERS_1)
+ return EINVAL;
+
+ /*
+ * We support all edges and formats plus offsets, but not
+ * POLL or WAIT. And we are strict on the time stamp format:
+ * Only one is permitted if we set offsets!
+ */
+
+ /*
+ * Only one of the time formats may be selected.
+ */
+ if ((mode & PPS_OFFSETBOTH) != 0 &&
+ popcount(mode & PPS_TSFMT_BOTH) != 1 )
+ return EINVAL;
+
+ /* turn off read-only bits */
+ mode &= ~SERIALPPS_RO;
+
+ /*
+ * test remaining bits.
+ */
+ if (mode & ~(PPS_CAPTUREBOTH | PPS_OFFSETBOTH | PPS_TSFMT_BOTH))
+ return EOPNOTSUPP;
+
+ /*
+ * ok, ready to go.
+ *
+ * calculate offsets as ntp_fp_t's and store them in unit as ntp_fp_t. They will
+ * be always applied, since fetching the time stamps is not critical.
+ */
+ if (mode & PPS_OFFSETASSERT) {
+ if (mode & PPS_TSFMT_TSPEC)
+ loopunit->ofs_assert = tspec_to_fp(&params->assert_offset);
+ else
+ loopunit->ofs_assert = params->assert_offset_ntpfp;
+ }
+ if (mode & PPS_OFFSETCLEAR) {
+ if (mode & PPS_TSFMT_TSPEC)
+ loopunit->ofs_clear = tspec_to_fp(&params->clear_offset);
+ else
+ loopunit->ofs_clear = params->clear_offset_ntpfp;
+ }
+ /* save remaining bits */
+ mode |= unit->params.mode;
+ unit->params = *params;
+ unit->params.mode = mode;
+
+ return 0;
+}
+
+
+/* --------------------------------------------------------------------
+ * prov_time_pps_fetch - Fetch timestamps
+ */
+
+int WINAPI
+prov_time_pps_fetch(
+ pps_unit_t * unit,
+ void * context,
+ const int tsformat,
+ pps_info_t * pinfo,
+ const struct timespec * timeout
+ )
+{
+ loopback_unit * loopunit;
+ PPSData_t pps_stamps;
+ pps_info_t infobuf;
+ BOOL rc;
+ time_t tnow;
+
+ /*
+ * nb. PPS_CANWAIT is NOT set by the implementation, we can totally
+ * ignore the timeout variable.
+ */
+ UNUSED(timeout);
+ loopunit = (loopback_unit*)context;
+
+ /* read & check raw data from daemon */
+ memset(&infobuf, 0, sizeof(infobuf));
+ rc = ntp_pps_read(loopunit->hnd_pps, &pps_stamps, sizeof(pps_stamps));
+ if (!rc) {
+ switch (GetLastError())
+ {
+ case ERROR_INVALID_HANDLE:
+ return EINVAL;
+ case ERROR_INVALID_PARAMETER:
+ return EOPNOTSUPP;
+ case ERROR_INVALID_DATA:
+ return ENXIO;
+ default:
+ return EINVAL;
+ }
+ }
+
+ /* add offsets on raw data */
+ NTPFP_L_ADDS(&pps_stamps.ts_assert, &loopunit->ofs_assert);
+ NTPFP_L_ADDS(&pps_stamps.ts_clear , &loopunit->ofs_clear);
+
+ /* store sequence numbers */
+ infobuf.assert_sequence = pps_stamps.cc_assert;
+ infobuf.clear_sequence = pps_stamps.cc_clear;
+
+ /*
+ * Translate or copy to specified format
+ */
+ switch (tsformat) {
+ case PPS_TSFMT_NTPFP: /* NTP format requires no translation */
+ infobuf.assert_timestamp_ntpfp = pps_stamps.ts_assert;
+ infobuf.clear_timestamp_ntpfp = pps_stamps.ts_clear;
+ break;
+
+ case PPS_TSFMT_TSPEC: /* timespec format requires conversion to nsecs form */
+ time(&tnow);
+ infobuf.assert_timestamp = fp_stamp_to_tspec(pps_stamps.ts_assert, tnow);
+ infobuf.clear_timestamp = fp_stamp_to_tspec(pps_stamps.ts_clear, tnow);
+ break;
+
+ default:
+ return EINVAL;
+ }
+
+ infobuf.current_mode = unit->params.mode;
+ *pinfo = infobuf;
+
+ return 0;
+}
+
+
+/* --------------------------------------------------------------------
+ * prov_time_pps_kcbind - specify kernel consumer
+ *
+ * Not supported so far by Windows.
+ */
+int WINAPI
+prov_time_pps_kcbind(
+ pps_unit_t * punit,
+ void * context,
+ const int kernel_consumer,
+ const int edge,
+ const int tsformat
+ )
+{
+ UNUSED(punit);
+ UNUSED(context);
+ UNUSED(kernel_consumer);
+ UNUSED(edge);
+ UNUSED(tsformat);
+
+ return EOPNOTSUPP;
+}
+
+
+/* --------------------------------------------------------------------
+ * prov_init - returns capabilities and provider name
+ */
+int WINAPI
+ppsapi_prov_init(
+ int ppsapi_timepps_prov_ver,
+ pcreate_pps_handle create_pps_handle,
+ ppps_ntp_timestamp_from_counter ntp_timestamp_from_counter,
+ char * short_name_buf,
+ size_t short_name_size,
+ char * full_name_buf,
+ size_t full_name_size
+ )
+{
+ UNUSED(ntp_timestamp_from_counter);
+
+ if (ppsapi_timepps_prov_ver < PPSAPI_TIMEPPS_PROV_VER)
+ return 0;
+
+ p_create_pps_handle = create_pps_handle;
+
+ strncpy(short_name_buf, "loopback", short_name_size);
+ short_name_buf[short_name_size - 1] ='\0'; /* ensure ASCIIZ */
+ strncpy(full_name_buf,
+ "loopback user mode DCD change detection",
+ full_name_size);
+ full_name_buf[full_name_size - 1] ='\0'; /* ensure ASCIIZ */
+
+ return SERIALPPS_CAPS;
+}
diff --git a/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def b/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def
new file mode 100644
index 0000000..14573a2
--- /dev/null
+++ b/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.def
@@ -0,0 +1,9 @@
+LIBRARY "loopback-ppsapi-provider.dll"
+
+EXPORTS
+ ppsapi_prov_init
+ prov_time_pps_create
+ prov_time_pps_destroy
+ prov_time_pps_fetch
+ prov_time_pps_kcbind
+ prov_time_pps_setparams \ No newline at end of file
diff --git a/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h b/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h
new file mode 100644
index 0000000..5541e33
--- /dev/null
+++ b/ports/winnt/ppsapi/loopback/src/loopback-ppsapi.h
@@ -0,0 +1,49 @@
+//
+// serialpps-ppsapi-provider.h
+//
+// For this tiny project the single header serves as a precompiled header
+// as well, meaning all the bulky headers are included before or within it.
+// Within, in this case.
+//
+
+#define _CRT_SECURE_NO_WARNINGS
+#include <stdio.h>
+#include <windows.h>
+typedef __int32 int32;
+typedef unsigned __int32 u_int32;
+typedef __int64 int64;
+typedef unsigned __int64 u_int64;
+#include "timepps.h"
+
+#ifndef UNUSED
+#define UNUSED(item) ((void)(item))
+#endif
+
+/* PPS data structure as captured by the serial line I/O system. This
+ * must match the local definition in 'ntp_iocompletionport.c' or
+ * 'Bad Things (tm)' are bound to happen.
+ */
+struct PpsData {
+ u_long cc_assert;
+ u_long cc_clear;
+ ntp_fp_t ts_assert;
+ ntp_fp_t ts_clear;
+};
+typedef struct PpsData PPSData_t;
+
+/* prototypes imported from the NTPD executable */
+__declspec(dllimport) HANDLE WINAPI ntp_pps_attach_device(HANDLE hndIo);
+__declspec(dllimport) void WINAPI ntp_pps_detach_device(HANDLE ppsHandle);
+__declspec(dllimport) BOOL WINAPI ntp_pps_read(HANDLE ppsHandle, void*, size_t);
+
+/* prototypes exported to the NTPD executable */
+__declspec(dllexport) int WINAPI prov_time_pps_create(HANDLE, pps_handle_t*);
+__declspec(dllexport) int WINAPI prov_time_pps_destroy(pps_unit_t*, void*);
+__declspec(dllexport) int WINAPI prov_time_pps_setparams(pps_unit_t*, void*,
+ const pps_params_t*);
+__declspec(dllexport) int WINAPI prov_time_pps_fetch(pps_unit_t*, void*,
+ const int, pps_info_t*, const struct timespec*);
+__declspec(dllexport) int WINAPI prov_time_pps_kcbind(pps_unit_t*, void*, const int, const int, const int);
+__declspec(dllexport) int WINAPI ppsapi_prov_init(int, pcreate_pps_handle,
+ ppps_ntp_timestamp_from_counter, char*, size_t,
+ char*, size_t);
diff --git a/ports/winnt/ppsapi/loopback/src/sys/time.h b/ports/winnt/ppsapi/loopback/src/sys/time.h
new file mode 100644
index 0000000..079e5b6
--- /dev/null
+++ b/ports/winnt/ppsapi/loopback/src/sys/time.h
@@ -0,0 +1,18 @@
+/*
+ * This sys/time.h is part of ppsapi-prov skeleton sample source code
+ * for a Windows PPSAPI provider DLL. It was adapted from
+ * ports/winnt/include/sys/time.h in ntpd.
+ */
+
+#ifndef SYS_TIME_H
+#define SYS_TIME_H
+
+#include <windows.h>
+#include <time.h>
+
+typedef struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+} timespec_t;
+
+#endif /* SYS_TIME_H */
diff --git a/ports/winnt/ppsapi/loopback/src/timepps.h b/ports/winnt/ppsapi/loopback/src/timepps.h
new file mode 100644
index 0000000..3a7e806
--- /dev/null
+++ b/ports/winnt/ppsapi/loopback/src/timepps.h
@@ -0,0 +1,805 @@
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2009 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and with or without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * This modified timepps.h can be used to provide a PPSAPI interface *
+ * to a machine running Windows with one or more backend provider DLLs *
+ * implementing the provider interfaces defined herein. *
+ * *
+ * This Windows version was derived by Dave Hart *
+ * <davehart@davehart.com> from Mills' timepps-Solaris.h *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+#ifndef TIMEPPS_H
+#define TIMEPPS_H
+
+#include "sys/time.h" /* in ntp ref source declares struct timespec */
+
+/*
+ * The following definitions are architecture independent
+ */
+
+#define PPS_API_VERS_1 1 /* API version number */
+#define PPS_JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
+#define PPS_NANOSECOND 1000000000L /* one nanosecond in decimal */
+#define PPS_FRAC 4294967296. /* 2^32 as a double */
+#define PPS_HECTONANOSECONDS 10000000 /* 100ns units in a second */
+#define PPS_FILETIME_1970 0x019db1ded53e8000 /* unix epoch to Windows */
+
+#define PPS_NORMALIZE(x) /* normalize timespec */ \
+ do { \
+ while ((x).tv_nsec >= PPS_NANOSECOND) { \
+ (x).tv_nsec -= PPS_NANOSECOND; \
+ (x).tv_sec++; \
+ } \
+ while ((x).tv_nsec < 0) { \
+ (x).tv_nsec += PPS_NANOSECOND; \
+ (x).tv_sec--; \
+ } \
+ } while (0)
+
+#define PPS_TSPECTONTP(x) /* convert timespec to ntp_fp */ \
+ do { \
+ double d_frac; \
+ \
+ d_frac = ((struct timespec)&(x))->tv_nsec \
+ * PPS_FRAC / PPS_NANOSECOND; \
+ (x).integral = ((struct timespec)&(x))->tv_sec \
+ + PPS_JAN_1970; \
+ (x).fractional = (unsigned int)d_frac; \
+ if (d_frac >= PPS_FRAC) \
+ (x).integral++; \
+ } while (0)
+
+#define PPS_NTPTOTSPEC(x) /* convert ntp_fp to timespec */ \
+ do { \
+ double d_frac; \
+ \
+ /* careful, doing in place and tv_sec may be 64bit */ \
+ d_frac = (double)((ntp_fp_t *)&(x))->F.u \
+ * PPS_NANOSECOND / PPS_FRAC; \
+ (x).tv_sec = ((ntp_fp_t *)&(x))->I.u \
+ - (time_t)PPS_JAN_1970; \
+ (x).tv_nsec = (long)d_frac; \
+ } while (0)
+
+
+/*
+ * Device/implementation parameters (mode)
+ */
+
+#define PPS_CAPTUREASSERT 0x01 /* capture assert events */
+#define PPS_CAPTURECLEAR 0x02 /* capture clear events */
+#define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */
+
+#define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */
+#define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */
+#define PPS_OFFSETBOTH 0x30 /* apply compensation for both */
+
+#define PPS_CANWAIT 0x100 /* Can we wait for an event? */
+#define PPS_CANPOLL 0x200 /* "This bit is reserved for */
+
+/*
+ * Kernel actions (mode)
+ */
+
+#define PPS_ECHOASSERT 0x40 /* feed back assert event to output */
+#define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */
+
+/*
+ * Timestamp formats (tsformat)
+ */
+
+#define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */
+#define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */
+#define PPS_TSFMT_BOTH (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+
+/*
+ * Kernel discipline actions (not used in Windows yet)
+ */
+
+#define PPS_KC_HARDPPS 0 /* enable kernel consumer */
+#define PPS_KC_HARDPPS_PLL 1 /* phase-lock mode */
+#define PPS_KC_HARDPPS_FLL 2 /* frequency-lock mode */
+
+/*
+ * Type definitions
+ */
+
+typedef unsigned long pps_seq_t; /* sequence number */
+
+#pragma warning(push)
+//#pragma warning(disable: 201) /* nonstd extension nameless union */
+
+typedef struct ntp_fp {
+ union {
+ int32 s;
+ u_int32 u;
+ } I;
+ union {
+ int32 s;
+ u_int32 u;
+ } F;
+} ntp_fp_t; /* NTP-compatible time stamp */
+
+#pragma warning(pop)
+
+typedef union pps_timeu { /* timestamp format */
+ struct timespec tspec;
+ ntp_fp_t ntpfp;
+ unsigned long longpad[3];
+} pps_timeu_t; /* generic data type to represent time stamps */
+
+/* addition of NTP fixed-point format */
+
+#define NTPFP_M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \
+ do { \
+ r_f = (u_int32)(r_f) + (u_int32)(a_f); \
+ r_i = (u_int32)(r_i) + (u_int32)(a_i) + \
+ ((u_int32)(r_f) < (u_int32)(a_f)); \
+ } while (0)
+
+#define NTPFP_L_ADDS(r, a) NTPFP_M_ADD((r)->I.u, (r)->F.u, (a)->I.u, (a)->F.u)
+
+
+/*
+ * Timestamp information structure
+ */
+
+typedef struct pps_info {
+ pps_seq_t assert_sequence; /* seq. num. of assert event */
+ pps_seq_t clear_sequence; /* seq. num. of clear event */
+ pps_timeu_t assert_tu; /* time of assert event */
+ pps_timeu_t clear_tu; /* time of clear event */
+ int current_mode; /* current mode bits */
+} pps_info_t;
+
+#define assert_timestamp assert_tu.tspec
+#define clear_timestamp clear_tu.tspec
+
+#define assert_timestamp_ntpfp assert_tu.ntpfp
+#define clear_timestamp_ntpfp clear_tu.ntpfp
+
+/*
+ * Parameter structure
+ */
+
+typedef struct pps_params {
+ int api_version; /* API version # */
+ int mode; /* mode bits */
+ pps_timeu_t assert_off_tu; /* offset compensation for assert */
+ pps_timeu_t clear_off_tu; /* offset compensation for clear */
+} pps_params_t;
+
+#define assert_offset assert_off_tu.tspec
+#define clear_offset clear_off_tu.tspec
+
+#define assert_offset_ntpfp assert_off_tu.ntpfp
+#define clear_offset_ntpfp clear_off_tu.ntpfp
+
+/*
+ *------ Here begins the implementation-specific part! ------
+ */
+
+#include <windows.h>
+#include <errno.h>
+#include <stddef.h> /* offsetof() */
+#include <io.h> /* _get_osfhandle() */
+
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP 45
+#endif
+
+typedef UINT_PTR pps_handle_t; /* pps handlebars */
+
+#ifndef inline
+#define inline __inline
+#endif
+
+/*
+ * ntpd on Windows is typically distributed as a binary as few users
+ * have the tools needed to build from source. Rather than build
+ * a single timepps.h for Windows which knows how to talk to all
+ * PPS implementations frozen in time as of compiling, this timepps.h
+ * allows one or more backend providers to be used by naming a DLL
+ * which exports the provider interfaces defined here.
+ */
+typedef enum ppsapi_magic_tag {
+ PPSAPI_MAGIC_UNIT = 0x70707355, /* ppsU */
+} ppsapi_magic;
+
+typedef struct {
+ struct pps_provider_tag *provider;
+ void * context;/* provider's unit pointer */
+ ppsapi_magic magic; /* to detect invalid handles */
+ pps_params_t params; /* PPS parameters set by user */
+} pps_unit_t;
+
+typedef void (*ppps_ntp_timestamp_from_counter)(
+ ntp_fp_t *result,
+ ULONGLONG Timestamp,
+ ULONGLONG Counterstamp
+ );
+
+typedef pps_handle_t (*pcreate_pps_handle)(
+ void * prov_context
+ );
+
+/*
+ * ppsapi_prov_init() - exported by backend DLLs
+ *
+ * Return value is pps capabilities available to PPSAPI consumers
+ * via time_pps_getcaps().
+ */
+#define PPSAPI_TIMEPPS_PROV_VER 2
+
+typedef int (WINAPI *pppsapi_prov_init)(
+ int ppsapi_timepps_prov_ver,
+ pcreate_pps_handle create_pps_handle,
+ ppps_ntp_timestamp_from_counter ntp_timestamp_from_counter,
+ char * short_name_buf,
+ size_t short_name_size,
+ char * full_name_buf,
+ size_t full_name_size
+ );
+
+typedef int (WINAPI *provtime_pps_create)(
+ HANDLE winhandle, /* user device handle */
+ pps_handle_t *phandle /* returned handle */
+ );
+
+typedef int (WINAPI *provtime_pps_destroy)(
+ pps_unit_t * unit,
+ void * context
+ );
+
+typedef int (WINAPI *provtime_pps_setparams)(
+ pps_unit_t * unit,
+ void * context,
+ const pps_params_t * params
+ );
+
+typedef int (WINAPI *provtime_pps_fetch)(
+ pps_unit_t * unit,
+ void * context,
+ const int tsformat,
+ pps_info_t * pinfo,
+ const struct timespec * timeout
+ );
+
+typedef int (WINAPI *provtime_pps_kcbind)(
+ pps_unit_t * unit,
+ void * context,
+ const int kernel_consumer,
+ const int edge,
+ const int tsformat
+ );
+
+typedef struct pps_provider_tag {
+ struct pps_provider_tag *next;
+ int caps;
+ char * short_name;
+ char * full_name;
+ provtime_pps_create ptime_pps_create;
+ provtime_pps_destroy ptime_pps_destroy;
+ provtime_pps_setparams ptime_pps_setparams;
+ provtime_pps_fetch ptime_pps_fetch;
+ provtime_pps_kcbind ptime_pps_kcbind;
+} ppsapi_provider;
+
+static ppsapi_provider * g_provider_list;
+static ppsapi_provider * g_curr_provider;
+
+
+static inline pps_handle_t
+internal_create_pps_handle(
+ void * prov_context
+ )
+{
+ pps_unit_t * punit;
+
+ if (NULL == g_curr_provider) {
+ fprintf(stderr, "create_pps_handle: provider backend called me outside time_pps_create\n");
+ punit = NULL;
+ } else
+ punit = malloc(sizeof(*punit));
+ if (punit != NULL) {
+ punit->provider = g_curr_provider;
+ punit->context = prov_context;
+ punit->magic = PPSAPI_MAGIC_UNIT;
+ memset(&punit->params, 0, sizeof(punit->params));
+ }
+ return (pps_handle_t)punit;
+}
+
+static inline pps_unit_t *
+unit_from_ppsapi_handle(
+ pps_handle_t handle
+ )
+{
+ pps_unit_t *punit;
+
+ punit = (pps_unit_t *)handle;
+ if (PPSAPI_MAGIC_UNIT != punit->magic)
+ punit = NULL;
+ return punit;
+}
+
+/*
+ * ntpd on Windows only looks to errno after finding
+ * GetLastError returns NO_ERROR. To accomodate its
+ * use of msyslog in portable code such as refclock_atom.c,
+ * this implementation always clears the Windows
+ * error code using SetLastError(NO_ERROR) when
+ * returning an errno. This is also a good idea
+ * for any non-ntpd clients as they should rely only
+ * the errno for PPSAPI functions.
+ */
+#define RETURN_PPS_ERRNO(e) \
+do { \
+ SetLastError(NO_ERROR); \
+ errno = (e); \
+ return -1; \
+} while (0)
+
+
+#ifdef OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER
+extern void pps_ntp_timestamp_from_counter(ntp_fp_t *, ULONGLONG, ULONGLONG);
+#else
+/*
+ * helper routine for serialpps.sys ioctl which returns
+ * performance counter "timestamp" as well as a system
+ * FILETIME timestamp. Converts one of the inputs to
+ * NTP fixed-point format.
+ *
+ * You will probably want to supply your own and #define
+ * OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER, as this stub
+ * converts only the low-resolution system timestamp.
+ *
+ * When implementing a provider, use the pointer to this
+ * conversion function supplied to your prov_init(), as
+ * the copy in your DLL will likely be the stub below,
+ * where you want the one provided by the PPSAPI client
+ * such as ntpd.
+ */
+static inline void
+pps_ntp_timestamp_from_counter(
+ ntp_fp_t *result,
+ ULONGLONG Timestamp,
+ ULONGLONG Counterstamp)
+{
+ ULONGLONG BiasedTimestamp;
+
+ /* convert from 100ns units to NTP fixed point format */
+
+ BiasedTimestamp = Timestamp - PPS_FILETIME_1970;
+ result->I.u = PPS_JAN_1970 +
+ (unsigned)(BiasedTimestamp / PPS_HECTONANOSECONDS);
+ result->F.u =
+ (unsigned) ((BiasedTimestamp % PPS_HECTONANOSECONDS) *
+ (PPS_FRAC / PPS_HECTONANOSECONDS));
+}
+#endif
+
+
+static inline int
+load_pps_provider(
+ char * dllpath
+ )
+{
+ char short_name[16];
+ char full_name[64];
+ ppsapi_provider * prov;
+ HMODULE hmod;
+ pppsapi_prov_init pprov_init;
+
+ prov = malloc(sizeof(*prov));
+ if (NULL == prov)
+ return ENOMEM;
+
+ hmod = LoadLibrary(dllpath);
+ if (NULL == hmod) {
+ fprintf(stderr, "load_pps_provider: LoadLibrary(%s) error %u\n", dllpath, GetLastError());
+ free(prov);
+ return ENOENT;
+ }
+
+ pprov_init = (pppsapi_prov_init)GetProcAddress(hmod, "ppsapi_prov_init");
+ if (NULL == pprov_init) {
+ fprintf(stderr, "load_pps_provider: entrypoint ppsapi_prov_init not found in %s\n", dllpath);
+ free(prov);
+ FreeLibrary(hmod);
+ return EFAULT;
+ }
+
+ prov->caps = (*pprov_init)(PPSAPI_TIMEPPS_PROV_VER,
+ &internal_create_pps_handle,
+ &pps_ntp_timestamp_from_counter,
+ short_name, sizeof(short_name),
+ full_name, sizeof(full_name));
+
+ if (!prov->caps) {
+ free(prov);
+ FreeLibrary(hmod);
+ return EACCES;
+ }
+
+ prov->short_name = _strdup(short_name);
+ prov->full_name = _strdup(full_name);
+
+ if (NULL == prov->short_name || !prov->short_name[0]
+ || NULL == prov->full_name || !prov->full_name[0]) {
+
+ if (prov->short_name)
+ free(prov->short_name);
+ if (prov->full_name)
+ free(prov->full_name);
+ free(prov);
+ FreeLibrary(hmod);
+ return EINVAL;
+ }
+
+ prov->ptime_pps_create = (provtime_pps_create)
+ GetProcAddress(hmod, "prov_time_pps_create");
+ prov->ptime_pps_destroy = (provtime_pps_destroy)
+ GetProcAddress(hmod, "prov_time_pps_destroy");
+ prov->ptime_pps_setparams = (provtime_pps_setparams)
+ GetProcAddress(hmod, "prov_time_pps_setparams");
+ prov->ptime_pps_fetch = (provtime_pps_fetch)
+ GetProcAddress(hmod, "prov_time_pps_fetch");
+ prov->ptime_pps_kcbind = (provtime_pps_kcbind)
+ GetProcAddress(hmod, "prov_time_pps_kcbind");
+
+ if (NULL == prov->ptime_pps_create
+ || NULL == prov->ptime_pps_destroy
+ || NULL == prov->ptime_pps_setparams
+ || NULL == prov->ptime_pps_fetch
+ || NULL == prov->ptime_pps_kcbind) {
+
+ fprintf(stderr, "PPSAPI provider %s missing entrypoint\n",
+ prov->short_name);
+ free(prov->short_name);
+ free(prov->full_name);
+ free(prov);
+ FreeLibrary(hmod);
+ return EINVAL;
+ }
+
+ fprintf(stderr, "loaded PPSAPI provider %s caps 0x%x provider %p\n",
+ prov->full_name, prov->caps, prov);
+
+ prov->next = g_provider_list;
+ g_provider_list = prov;
+
+ return 0;
+}
+
+
+/*
+ * time_pps_create - create PPS handle from file descriptor
+ *
+ * This is the initial entrypoint of PPSAPI from the client. Note
+ * to maintain source compatibility with Unix, the input file
+ * descriptor really is a descriptor from the C runtime low-numbered
+ * descriptor namespace, though it may have been converted from a
+ * native Windows HANDLE using _open_osfhandle().
+ */
+static inline int
+time_pps_create(
+ int filedes,/* device file descriptor */
+ pps_handle_t * phandle /* returned handle */
+ )
+{
+ HANDLE winhandle;
+ char * dlls;
+ char * dll;
+ char * pch;
+ ppsapi_provider * prov;
+ pps_handle_t ppshandle;
+ int err;
+
+ if (NULL == phandle)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ winhandle = (HANDLE)_get_osfhandle(filedes);
+ fprintf(stderr, "time_pps_create(%d) got winhandle %p\n", filedes, winhandle);
+ if (INVALID_HANDLE_VALUE == winhandle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ /*
+ * For initial testing the list of PPSAPI backend
+ * providers is provided by the environment variable
+ * PPSAPI_DLLS, separated by semicolons such as
+ * PPSAPI_DLLS=c:\ntp\serial_ppsapi.dll;..\parport_ppsapi.dll
+ * There are a million better ways, such as a well-known
+ * registry key under which a value is created for each
+ * provider DLL installed, or even a platform-specific
+ * ntp.conf directive or command-line switch.
+ */
+ dlls = getenv("PPSAPI_DLLS");
+ if (dlls != NULL && NULL == g_provider_list) {
+ dlls = dll = _strdup(dlls);
+ fprintf(stderr, "getenv(PPSAPI_DLLS) gives %s\n", dlls);
+ } else
+ dlls = dll = NULL;
+
+ while (dll != NULL && dll[0]) {
+ pch = strchr(dll, ';');
+ if (pch != NULL)
+ *pch = 0;
+ err = load_pps_provider(dll);
+ if (err) {
+ fprintf(stderr, "load_pps_provider(%s) got errno %d\n", dll, err);
+ RETURN_PPS_ERRNO(err);
+ }
+ dll = (NULL == pch)
+ ? NULL
+ : pch + 1;
+ }
+
+ if (NULL != dlls)
+ free(dlls);
+ dlls = dll = NULL;
+
+ /*
+ * Hand off to each provider in turn until one returns a PPS
+ * handle or they've all declined.
+ */
+ for (prov = g_provider_list; prov != NULL; prov = prov->next) {
+ ppshandle = 0;
+ g_curr_provider = prov;
+ err = (*prov->ptime_pps_create)(winhandle, &ppshandle);
+ g_curr_provider = NULL;
+ fprintf(stderr, "%s prov_time_pps_create(%p) returned %d\n",
+ prov->short_name, winhandle, err);
+ if (!err && ppshandle) {
+ *phandle = ppshandle;
+ return 0;
+ }
+ }
+
+ fprintf(stderr, "PPSAPI provider list %p\n", g_provider_list);
+
+ RETURN_PPS_ERRNO(ENOEXEC);
+}
+
+
+/*
+ * release PPS handle
+ */
+
+static inline int
+time_pps_destroy(
+ pps_handle_t handle
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ err = (*punit->provider->ptime_pps_destroy)(punit, punit->context);
+
+ free(punit);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+/*
+ * set parameters for handle
+ */
+
+static inline int
+time_pps_setparams(
+ pps_handle_t handle,
+ const pps_params_t *params
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ /*
+ * Check for valid arguments and set parameters.
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == params)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ err = (*punit->provider->ptime_pps_setparams)(punit, punit->context, params);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+/*
+ * get parameters for handle
+ */
+
+static inline int
+time_pps_getparams(
+ pps_handle_t handle,
+ pps_params_t *params_buf
+ )
+{
+ pps_unit_t * punit;
+
+ /*
+ * Check for valid arguments and get parameters.
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == params_buf)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ *params_buf = punit->params;
+ return 0;
+}
+
+
+/*
+ * time_pps_getcap - get capabilities for handle
+ */
+static inline int
+time_pps_getcap(
+ pps_handle_t handle,
+ int *pmode
+ )
+{
+ pps_unit_t * punit;
+
+ /*
+ * Check for valid arguments and get capabilities.
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == pmode)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ *pmode = punit->provider->caps;
+ return 0;
+}
+
+/*
+ * Fetch timestamps
+ */
+
+static inline int
+time_pps_fetch(
+ pps_handle_t handle,
+ const int tsformat,
+ pps_info_t * pinfo,
+ const struct timespec * ptimeout
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ /*
+ * Check for valid arguments and fetch timestamps
+ */
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ if (NULL == pinfo)
+ RETURN_PPS_ERRNO(EFAULT);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ err = (*punit->provider->ptime_pps_fetch)(punit,
+ punit->context,
+ tsformat,
+ pinfo,
+ ptimeout);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+/*
+ * time_pps_kcbind - specify kernel consumer
+ *
+ * Not supported so far by Windows.
+ */
+
+static inline int
+time_pps_kcbind(
+ pps_handle_t handle,
+ const int kernel_consumer,
+ const int edge, const int tsformat
+ )
+{
+ pps_unit_t * punit;
+ int err;
+
+ if (!handle)
+ RETURN_PPS_ERRNO(EBADF);
+
+ punit = unit_from_ppsapi_handle(handle);
+
+ if (NULL == punit)
+ RETURN_PPS_ERRNO(EBADF);
+
+ err = (*punit->provider->ptime_pps_kcbind)(
+ punit,
+ punit->context,
+ kernel_consumer,
+ edge,
+ tsformat);
+
+ if (err)
+ RETURN_PPS_ERRNO(err);
+ else
+ return 0;
+}
+
+
+#endif /* TIMEPPS_H */
diff --git a/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c
new file mode 100644
index 0000000..fe15d29
--- /dev/null
+++ b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.c
@@ -0,0 +1,382 @@
+/*
+ * skeleton-ppsapi-provider.c - structure but no useful function
+ */
+
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1999-2009 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ * *
+ * This header file complies with "Pulse-Per-Second API for UNIX-like *
+ * Operating Systems, Version 1.0", rfc2783. Credit is due Jeff Mogul *
+ * and Marc Brett, from whom much of this code was shamelessly stolen. *
+ * *
+ * This skeleton-ppsapi-provider.c implements the PPSAPI provider DLL *
+ * interface but has no actual timestamp-fetching code. It is *
+ * derived from serialpps-ppsapi-provider.c which was derived from *
+ * David L. Mills' timepps.h for Solaris. *
+ * *
+ ***********************************************************************
+ * *
+ * Some of this include file *
+ * Copyright (c) 1999 by Ulrich Windl, *
+ * based on code by Reg Clemens <reg@dwf.com> *
+ * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
+ * *
+ ***********************************************************************
+ * *
+ * "THE BEER-WARE LICENSE" (Revision 42): *
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this *
+ * notice you can do whatever you want with this stuff. If we meet some*
+ * day, and you think this stuff is worth it, you can buy me a beer *
+ * in return. Poul-Henning Kamp *
+ * *
+ **********************************************************************/
+
+
+#include "skeleton-ppsapi-provider.h"
+
+pcreate_pps_handle p_create_pps_handle;
+ppps_ntp_timestamp_from_counter p_ntp_timestamp_from_counter;
+
+#define SKELPPS_CAPS (PPS_CAPTUREASSERT | PPS_OFFSETASSERT \
+ | PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)
+#define SKELPPS_RO (PPS_CANWAIT | PPS_CANPOLL)
+
+
+/*
+ * The ntp_timestamp_from_counter callback into timepps.h routines in
+ * the host is saved in each unit separately, so that binaries that
+ * inline timepps.h into multiple source files (such as refclock_atom.c
+ * and a number of other ntpd refclocks including refclock_nmea.c) will
+ * get called back in the correct instance for each unit. This assumes
+ * that ppsapi_prov_init for subsequent instances happens only after the
+ * first instance has completed all time_pps_create() calls it will
+ * invoke, which is a safe assumption at least for ntpd.
+ */
+typedef struct skel_unit_tag {
+ HANDLE device;
+ ppps_ntp_timestamp_from_counter p_ntp_timestamp_from_counter;
+} skel_unit;
+
+
+/*
+ * DllMain - DLL entrypoint, no-op.
+ */
+BOOL APIENTRY DllMain(
+ HMODULE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ UNUSED(hModule);
+ UNUSED(ul_reason_for_call);
+ UNUSED(lpReserved);
+
+ return TRUE;
+}
+
+
+/*
+ * prov_time_pps_create - create PPS handle given underlying device
+ */
+int WINAPI
+prov_time_pps_create(
+ HANDLE device, /* underlying device */
+ pps_handle_t * handle /* returned handle */
+ )
+{
+ skel_unit * pskelunit;
+ pps_unit_t * punit;
+
+ /*
+ * Allocate and initialize unit structure.
+ */
+
+ pskelunit = malloc(sizeof(*pskelunit));
+ if (NULL == pskelunit)
+ return ENOMEM;
+
+ pskelunit->device = device;
+ pskelunit->p_ntp_timestamp_from_counter = p_ntp_timestamp_from_counter;
+
+ *handle = (*p_create_pps_handle)(pskelunit);
+ if (*handle) {
+ punit = (pps_unit_t *)*handle;
+ punit->params.api_version = PPS_API_VERS_1;
+ punit->params.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC;
+ }
+
+ return (*handle)
+ ? 0
+ : ENOMEM;
+}
+
+
+/*
+ * prov_time_pps_destroy - release PPS handle
+ */
+int WINAPI
+prov_time_pps_destroy(
+ pps_unit_t * unit,
+ void * context
+ )
+{
+ skel_unit *pskelunit;
+
+ UNUSED(unit);
+
+ pskelunit = context;
+ free(pskelunit);
+
+ return 0;
+}
+
+
+/*
+ * prov_time_pps_setparams - set parameters for handle
+ */
+int WINAPI
+prov_time_pps_setparams(
+ pps_unit_t * unit,
+ void * context,
+ const pps_params_t * params
+ )
+{
+ skel_unit *pskelunit;
+ int mode, mode_in;
+
+ pskelunit = context;
+
+ /*
+ * There was no reasonable consensus in the API working group.
+ * I require `api_version' to be set!
+ */
+
+ if (params->api_version != PPS_API_VERS_1)
+ return EINVAL;
+
+ /*
+ * The only settable modes are PPS_CAPTUREASSERT,
+ * PPS_OFFSETASSERT, and the timestamp formats.
+ */
+
+ mode_in = params->mode;
+
+ /*
+ * Only one of the time formats may be selected
+ * if a nonzero assert offset is supplied.
+ */
+ if ((mode_in & (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP))
+ == (PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP)) {
+
+ if (params->assert_offset.tv_sec ||
+ params->assert_offset.tv_nsec)
+ return EINVAL;
+
+ /*
+ * If no offset was specified but both time
+ * format flags are used consider it harmless
+ * but turn off PPS_TSFMT_NTPFP so getparams
+ * will not show both formats lit.
+ */
+ mode_in &= ~PPS_TSFMT_NTPFP;
+ }
+
+ /* turn off read-only bits */
+
+ mode_in &= ~SKELPPS_RO;
+
+ /*
+ * test remaining bits, should only have captureassert,
+ * offsetassert, and/or timestamp format bits.
+ */
+
+ if (mode_in & ~(PPS_CAPTUREASSERT | PPS_OFFSETASSERT |
+ PPS_TSFMT_TSPEC | PPS_TSFMT_NTPFP))
+ return EOPNOTSUPP;
+
+ /*
+ * ok, ready to go.
+ */
+
+ mode = unit->params.mode;
+ unit->params = *params;
+ unit->params.mode = mode | mode_in;
+
+ return 0;
+}
+
+
+/*
+ * prov_time_pps_fetch - Fetch timestamps
+ */
+
+int WINAPI
+prov_time_pps_fetch(
+ pps_unit_t * unit,
+ void * context,
+ const int tsformat,
+ pps_info_t * pinfo,
+ const struct timespec * timeout
+ )
+{
+ ULONGLONG WindowsTimestamp;
+ ULONGLONG Counterstamp;
+ skel_unit *pskelunit;
+ pps_info_t infobuf;
+
+ /*
+ * nb. PPS_CANWAIT is NOT set by the implementation, we can totally
+ * ignore the timeout variable.
+ */
+ UNUSED(timeout);
+ pskelunit = context;
+
+ memset(&infobuf, 0, sizeof(infobuf));
+
+ /*
+ * if not captureassert, nothing to return.
+ */
+
+ if (!(unit->params.mode & PPS_CAPTUREASSERT)) {
+ *pinfo = infobuf;
+ return 0;
+ }
+
+ /*
+ * ADD CODE to retrieve timestamp here.
+ */
+ WindowsTimestamp = Counterstamp = 0;
+ /*
+ * ADD CODE to retrieve timestamp here.
+ */
+
+ /*
+ * pps_ntp_timestamp_from_counter takes the two flavors
+ * of timestamp we have (counter and system time) and
+ * uses whichever it can to give the best NTP fixed-point
+ * conversion. In ntpd the Counterstamp is typically
+ * used. A stub implementation in timepps.h simply
+ * converts from Windows timestamp to NTP fixed-point.
+ * We call through a pointer to get ntpd's version.
+ */
+ (*pskelunit->p_ntp_timestamp_from_counter)(
+ &infobuf.assert_timestamp_ntpfp,
+ WindowsTimestamp,
+ Counterstamp);
+
+ /*
+ * Note that only assert timestamps
+ * are captured by this interface.
+ */
+ infobuf.assert_sequence = 0; /* ADD CODE */
+
+ /*
+ * Apply offset and translate to specified format
+ */
+ switch (tsformat) {
+ case PPS_TSFMT_NTPFP: /* NTP format requires no translation */
+ if (unit->params.mode & PPS_OFFSETASSERT) {
+ NTPFP_L_ADDS(&infobuf.assert_timestamp_ntpfp,
+ &unit->params.assert_offset_ntpfp);
+ }
+ break;
+
+ case PPS_TSFMT_TSPEC: /* timespec format requires conversion to nsecs form */
+ PPS_NTPTOTSPEC(infobuf.assert_timestamp);
+ if (unit->params.mode & PPS_OFFSETASSERT) {
+ infobuf.assert_timestamp.tv_sec +=
+ unit->params.assert_offset.tv_sec;
+ infobuf.assert_timestamp.tv_nsec +=
+ unit->params.assert_offset.tv_nsec;
+ PPS_NORMALIZE(infobuf.assert_timestamp);
+ }
+ break;
+
+ default:
+ return EINVAL;
+ }
+
+ infobuf.current_mode = unit->params.mode;
+ *pinfo = infobuf;
+ return (0);
+}
+
+
+/*
+ * prov_time_pps_kcbind - specify kernel consumer
+ *
+ * Not supported so far by Windows.
+ */
+int WINAPI
+prov_time_pps_kcbind(
+ pps_unit_t * punit,
+ void * context,
+ const int kernel_consumer,
+ const int edge,
+ const int tsformat
+ )
+{
+ UNUSED(punit);
+ UNUSED(context);
+ UNUSED(kernel_consumer);
+ UNUSED(edge);
+ UNUSED(tsformat);
+
+ return EOPNOTSUPP;
+}
+
+
+/*
+ * prov_init - returns capabilities and provider name
+ */
+int WINAPI
+ppsapi_prov_init(
+ int ppsapi_timepps_prov_ver,
+ pcreate_pps_handle create_pps_handle,
+ ppps_ntp_timestamp_from_counter ntp_timestamp_from_counter,
+ char * short_name_buf,
+ size_t short_name_size,
+ char * full_name_buf,
+ size_t full_name_size
+ )
+{
+ ppsapi_provider test_prov;
+
+ if (ppsapi_timepps_prov_ver < PPSAPI_TIMEPPS_PROV_VER)
+ return 0;
+
+ p_create_pps_handle = create_pps_handle;
+ p_ntp_timestamp_from_counter = ntp_timestamp_from_counter;
+
+ strncpy(short_name_buf, "skeleton", short_name_size);
+ strncpy(full_name_buf,
+ "skeleton, ADD CODE to make useful",
+ full_name_size);
+
+ /*
+ * Use function pointer prototypes from timepps.h to verify
+ * our prototypes match with some otherwise pointless code.
+ */
+ test_prov.ptime_pps_create = &prov_time_pps_create;
+ test_prov.ptime_pps_destroy = &prov_time_pps_destroy;
+ test_prov.ptime_pps_fetch = &prov_time_pps_fetch;
+ test_prov.ptime_pps_kcbind = &prov_time_pps_kcbind;
+ test_prov.ptime_pps_setparams = &prov_time_pps_setparams;
+
+ return SKELPPS_CAPS;
+}
diff --git a/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def
new file mode 100644
index 0000000..ef29709
--- /dev/null
+++ b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.def
@@ -0,0 +1,9 @@
+LIBRARY "skeleton-ppsapi-provider.dll"
+
+EXPORTS
+ ppsapi_prov_init
+ prov_time_pps_create
+ prov_time_pps_destroy
+ prov_time_pps_fetch
+ prov_time_pps_kcbind
+ prov_time_pps_setparams \ No newline at end of file
diff --git a/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h
new file mode 100644
index 0000000..2bb7991
--- /dev/null
+++ b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.h
@@ -0,0 +1,22 @@
+//
+// serialpps-ppsapi-provider.h
+//
+// For this tiny project the single header serves as a precompiled header
+// as well, meaning all the bulky headers are included before or within it.
+// Within, in this case.
+//
+
+#define _CRT_SECURE_NO_WARNINGS
+#include <stdio.h>
+/* Prevent inclusion of winsock.h in windows.h */
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_
+#endif
+#include <windows.h>
+typedef DWORD u_int32;
+#include "sys/time.h"
+#include "../../include/timepps.h"
+
+#ifndef UNUSED
+#define UNUSED(item) ((void)(item))
+#endif
diff --git a/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln
new file mode 100644
index 0000000..8c2417a
--- /dev/null
+++ b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.sln
@@ -0,0 +1,19 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skeleton-ppsapi-provider", "skeleton-ppsapi-provider.vcproj", "{F7842ACD-EB61-4D65-9999-AFB0E77E63EA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Debug|Win32.Build.0 = Debug|Win32
+ {F7842ACD-EB61-4D65-9999-AFB0E77E63EA}.Release|Win32.ActiveCfg = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj
new file mode 100644
index 0000000..bab3e7d
--- /dev/null
+++ b/ports/winnt/ppsapi/skelprov/skeleton-ppsapi-provider.vcproj
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="skeleton-ppsapi-provider"
+ ProjectGUID="{F7842ACD-EB61-4D65-9999-AFB0E77E63EA}"
+ RootNamespace="skeletonppsapiprovider"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough="skeleton-ppsapi-provider.h"
+ BrowseInformation="1"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateManifest="false"
+ ModuleDefinitionFile="skeleton-ppsapi-provider.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough="skeleton-ppsapi-provider.h"
+ BrowseInformation="1"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ ModuleDefinitionFile="skeleton-ppsapi-provider.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\skeleton-ppsapi-provider.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ GeneratePreprocessedFile="0"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\skeleton-ppsapi-provider.h"
+ >
+ </File>
+ <File
+ RelativePath=".\sys\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\timepps.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/ppsapi/skelprov/sys/time.h b/ports/winnt/ppsapi/skelprov/sys/time.h
new file mode 100644
index 0000000..079e5b6
--- /dev/null
+++ b/ports/winnt/ppsapi/skelprov/sys/time.h
@@ -0,0 +1,18 @@
+/*
+ * This sys/time.h is part of ppsapi-prov skeleton sample source code
+ * for a Windows PPSAPI provider DLL. It was adapted from
+ * ports/winnt/include/sys/time.h in ntpd.
+ */
+
+#ifndef SYS_TIME_H
+#define SYS_TIME_H
+
+#include <windows.h>
+#include <time.h>
+
+typedef struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+} timespec_t;
+
+#endif /* SYS_TIME_H */
diff --git a/ports/winnt/scripts/mkver.bat b/ports/winnt/scripts/mkver.bat
new file mode 100755
index 0000000..7b44829
--- /dev/null
+++ b/ports/winnt/scripts/mkver.bat
@@ -0,0 +1,439 @@
+@echo off
+GOTO PROG
+
+see notes/remarks directly below this header:
+######################################################################
+#
+# Revision: mkver.bat
+# Author: Frederick Czajka
+# Date: 02/10/2000
+# Purpose: Provide a NT Shell script to replace the perl script
+# that replaced the UNIX mkver shell script.
+#
+#
+#
+# Notes: I had two goals with this script one to only use native
+# NT Shell commands and two was too emulate the PERL style
+# output. This required some work for the DATE format as
+# you will see and TIME was really tricky to get a format
+# matching PERLs!
+#
+#
+# Changes:
+# 02/23/2011 David J Taylor - Use reg instead of regedit so "run as
+# administrator" is not required.
+# 12/21/2009 Dave Hart
+# - packageinfo.sh uses prerelease= now not
+# releasecandidate=
+# 08/28/2009 Dave Hart
+# - support for building using per-compiler subdirs of winnt
+# 08/08/2006 Heiko Gerstung
+# - bugfixed point / rcpoint errors leading to a wrong
+# version string
+# - added a few cases for uppercase strings
+# 03/09/2005 Heiko Gerstung
+# - added UTC offset to version time information
+# - bugfixed several issues preventing this script to be used on NT4
+# - removed an obsolete warning
+#
+# 03/08/2005 Danny Mayer
+# - bugfixed NOBK label position
+#
+# 03/08/2005 Heiko Gerstung
+# - bugfixed BK detection and support for multiple ChangeSets
+#
+# 02/24/2005 Heiko Gerstung
+# - check if BK is installed and do not try to call it if not
+#
+#
+# 02/03/2005 Heiko Gerstung
+# - now getting NTP version from version.m4 (not configure)
+# - added BK ChangeSet revision and Openssl-Indicator (-o)
+# to the version number
+# - major rework of the time and date recognition routines
+# in order to reflect international settings and OS-
+# dependand formats
+#
+######################################################################
+
+Notes/Howtos:
+
+If you spot an error stating that bk.exe could not be found or executed
+although it is installed on your computer, you should try to add the path
+to your BK binary in your IDE configuration (for VisualStudio see
+Tools/Options/Directories/Executables).
+
+Alternatively you can create a file called 'version' in the root path of
+your ntp source tree which holds a string that is added to the version number.
+
+
+:PROG
+IF {%1} == {} GOTO USAGE
+IF {%1} == {-H} GOTO USAGE
+IF {%2} == {} GOTO USAGE
+IF {%1} == {-P} GOTO BEGIN
+
+
+
+REM *****************************************************************************************************************
+REM For any other bizarre permutation...
+REM *****************************************************************************************************************
+GOTO USAGE
+
+:BEGIN
+
+SET GENERATED_PROGRAM=%2
+
+REM *****************************************************************************************************************
+REM Reimplemented from orginal Unix Shell script
+REM *****************************************************************************************************************
+ IF NOT EXIST .version ECHO 0 > .version
+ FOR /F %%i IN (.version) do @SET RUN=%%i
+ SET /A RUN=%RUN%+1
+ ECHO %RUN% > .version
+
+REM *****************************************************************************************************************
+REM Resetting variables
+REM *****************************************************************************************************************
+ SET VER=
+ SET CSET=
+ SET SSL=
+ SET MYDATE=
+ SET MYTIME=
+ SET DAY=99
+ SET NMM=99
+ SET YEAR=0
+ SET HOUR=
+ SET MIN=
+ SET MMIN=
+ SET SEC=
+ SET SUBSEC=
+ SET DATEDELIM=
+ SET TIMEDELIM=
+ SET DATEFORMAT=
+ SET TIMEFORMAT=
+ SET UTC=
+ SET ACTIVEBIAS=
+
+REM *****************************************************************************************************************
+REM Check if DATE and TIME environment variables are available
+REM *****************************************************************************************************************
+
+ SET MYDATE=%DATE%
+ SET MYTIME=%TIME%
+
+ REM ** Not available (huh? Are you older than NT4SP6A, grandpa?)
+ IF "%MYDATE%" == "" FOR /F "TOKENS=1 DELIMS=" %%a IN ('date/t') DO SET MYDATE=%%a
+ IF "%MYTIME%" == "" FOR /F "TOKENS=1 DELIMS=" %%a IN ('time/t') DO SET MYTIME=%%a
+
+REM *****************************************************************************************************************
+REM Try to find out UTC offset
+REM *****************************************************************************************************************
+
+ REM *** Start with setting a dummy value which is used when we are not able to find out the real UTC offset
+ SET UTC=(LOCAL TIME)
+ SET UTC_HR=
+ SET UTC_MIN=
+ SET UTC_SIGN=
+
+ REM *** Now get the timezone settings from the registry
+ reg export "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" %TEMP%\TZ-%GENERATED_PROGRAM%.TMP
+ REM was: regedit /e %TEMP%\TZ-%GENERATED_PROGRAM%.TMP "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
+ IF NOT EXIST %TEMP%\TZ-%GENERATED_PROGRAM%.TMP GOTO NOTZINFO
+
+ for /f "Tokens=1* Delims==" %%a in ('type %TEMP%\TZ-%GENERATED_PROGRAM%.TMP') do if %%a == "ActiveTimeBias" SET ACTIVEBIAS=%%b
+ for /f "Tokens=1* Delims=:" %%a in ('echo %ACTIVEBIAS%') do ( SET ACTIVEBIAS=%%b & SET PARTYP=%%a )
+
+ REM *** Clean up temporary file
+ IF EXIST %TEMP%\TZ-%GENERATED_PROGRAM%.TMP DEL %TEMP%\TZ-%GENERATED_PROGRAM%.TMP
+
+ REM *** Check if we really got a dword value from the registry ...
+ IF NOT "%PARTYP%"=="dword " goto NOTZINFO
+
+ REM *** Check if we are in UTC timezone, then we can avoid some stress...
+ if "%ACTIVEBIAS%" == "00000000" SET UTC=(UTC) & GOTO NOTZINFO
+
+ SET HI=0x%ACTIVEBIAS:~0,4%
+ SET LO=0x%ACTIVEBIAS:~4,4%
+
+ if "%HI%"=="0xffff" ( SET /A ACTIVEBIAS=%LO% - %HI% - 1 ) ELSE ( SET /A ACTIVEBIAS=%LO%)
+ SET /A UTC_HR="%ACTIVEBIAS%/60"
+ SET /A UTC_MIN="%ACTIVEBIAS% %% 60"
+ SET UTC_SIGN=%ACTIVEBIAS:~0,1%
+
+ REM *** check the direction in which the local timezone alters UTC time
+ IF NOT "%UTC_SIGN%"=="-" SET UTC_SIGN=+
+ IF "%UTC_SIGN%"=="-" SET UTC_HR=%UTC_HR:~1,2%
+
+ REM *** Now turn the direction, because we need to know it from the viewpoint of UTC
+ IF "%UTC_SIGN%"=="+" (SET UTC_SIGN=-) ELSE (SET UTC_SIGN=+)
+
+ REM *** Put the values in a "00" format
+ IF %UTC_HR% LEQ 9 SET UTC_HR=0%UTC_HR%
+ IF %UTC_MIN% LEQ 9 SET UTC_MIN=0%UTC_MIN%
+
+ REM *** Set up UTC offset string used in version string
+ SET UTC=(UTC%UTC_SIGN%%UTC_HR%:%UTC_MIN%)
+
+
+:NOTZINFO
+echo off
+
+REM *****************************************************************************************************************
+REM Now grab the Version number out of the source code (using the packageinfo.sh file...)
+REM *****************************************************************************************************************
+
+ REM First, get the main NTP version number. In recent versions this must be extracted
+ REM from a packageinfo.sh file while in earlier versions the info was available from
+ REM a version.m4 file.
+ SET F_PACKAGEINFO_SH=..\..\..\..\packageinfo.sh
+ IF EXIST %F_PACKAGEINFO_SH% goto VER_FROM_PACKAGE_INFO
+ REM next two lines can go away when all windows compilers are building under
+ rem ports\winnt\<compiler dir>\<binary name dir> (ports\winnt\vs2008\ntpd)
+ rem rather than ports\winnt\<binary name dir> (ports\winnt\ntpd)
+ SET F_PACKAGEINFO_SH=..\..\..\packageinfo.sh
+ IF EXIST %F_PACKAGEINFO_SH% goto VER_FROM_PACKAGE_INFO
+ goto ERRNOVERF
+
+:VER_FROM_PACKAGE_INFO
+ REM Get version from packageinfo.sh file, which contains lines reading e.g.
+
+ TYPE %F_PACKAGEINFO_SH% | FIND /V "rcpoint=" | FIND /V "betapoint=" | FIND "point=" > point.txt
+ SET F_POINT_SH=point.txt
+
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "proto=" %%F_PACKAGEINFO_SH%%') DO SET PROTO=%%a
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "major=" %%F_PACKAGEINFO_SH%%') DO SET MAJOR=%%a
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "minor=" %%F_PACKAGEINFO_SH%%') DO SET MINOR=%%a
+
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "point=" %%F_POINT_SH%%') DO SET POINT=%%a
+ IF "%POINT%"=="NEW" set POINT=
+ IF NOT "%POINT%"=="" set POINT=p%POINT%
+
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "betapoint=" %%F_PACKAGEINFO_SH%%') DO SET BETAPOINT=%%a
+
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "rcpoint=" %%F_PACKAGEINFO_SH%%') DO SET RCPOINT=%%a
+
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "special=" %%F_PACKAGEINFO_SH%%') DO SET SPECIAL=%%a
+ IF NOT "%SPECIAL%"=="" set SPECIAL=-%SPECIAL%
+
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "prerelease=" %%F_PACKAGEINFO_SH%%') DO SET PRERELEASE=%%a
+ IF /I "%PRERELEASE%"=="beta" set PR_SUF=-beta
+ IF /I "%PRERELEASE%"=="rc" set PR_SUF=-RC
+
+ FOR /F "eol=# TOKENS=2 DELIMS==" %%a IN ('findstr "repotype=" %%F_PACKAGEINFO_SH%%') DO SET REPOTYPE=%%a
+ IF /I "%REPOTYPE%"=="stable" set REPOTYPE=STABLE
+
+ IF NOT "%REPOTYPE%"=="STABLE" SET RCPOINT=
+ IF "%PR_SUF%"=="-RC" set PR_POINT=%RCPOINT%
+ IF "%PR_SUF%"=="-beta" set PR_POINT=%BETAPOINT%
+
+ SET VER=%PROTO%.%MAJOR%.%MINOR%%POINT%%SPECIAL%%PR_SUF%%PR_POINT%
+
+ REM Now we have the version info, try to add a BK ChangeSet version number
+
+ REM ** Check if BK is installed ...
+ bk -R prs -hr+ -nd:I: ChangeSet 2> NUL > NUL
+ IF ERRORLEVEL 1 GOTO NOBK
+
+ REM ** Try to get the CSet rev directly from BK
+ FOR /F "TOKENS=1 DELIMS==" %%a IN ('bk.exe -R prs -hr+ -nd:I: ChangeSet') DO @SET CSET=%%a
+
+:NOBK
+ REM ** If that was not successful, we'll take a look into a version file, if available
+ IF EXIST ..\..\..\..\sntp\scm-rev (
+ IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\..\sntp\scm-rev') DO @SET CSET=%%a
+ )
+ REM next if block can go away once all windows compilers are building in
+ REM ports\winnt\<compiler dir>\<binary name dir> (ports\winnt\vs2008\ntpd)
+ IF EXIST ..\..\..\sntp\scm-rev (
+ IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\sntp\scm-rev') DO @SET CSET=%%a
+ )
+
+ REM ** Now, expand our version number with the CSet revision, if we managed to get one
+ IF NOT "%CSET%"=="" SET VER=%VER%@%CSET%
+
+ REM We can add a "crypto" identifier (-o) if we see that Crypto support is included in our build
+ REM we always include openssl on windows...
+ SET VER=%VER%-o
+
+
+REM *****************************************************************************************************************
+REM Check for user settings regarding the time and date format, we use the registry to find out...
+REM *****************************************************************************************************************
+
+
+ REM Any temporary files left from a previous run? Go where you belong...
+ IF exist userset.reg del userset.reg
+ IF exist userset.txt del userset.txt
+
+ reg export "HKEY_CURRENT_USER\Control Panel\International" userset.reg
+ REM was: regedit /E userset.reg "HKEY_CURRENT_USER\Control Panel\International"
+ IF not exist userset.reg goto ERRNOREG
+
+ rem *** convert from unicode to ascii if necessary
+ type userset.reg > userset.txt
+
+
+ FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr "iDate" userset.txt') DO SET DATEFORMAT=%%b
+ FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr "iTime" userset.txt') DO SET TIMEFORMAT=%%b
+
+ FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr /R "sDate\>" userset.txt') DO SET DATEDELIM=%%b
+ FOR /F "TOKENS=1-9 DELIMS== " %%a IN ('findstr /R "sTime\>" userset.txt') DO SET TIMEDELIM=%%b
+
+ IF "%TIMEFORMAT%"=="" GOTO ERRNOTIME
+ IF "%DATEFORMAT%"=="" GOTO ERRNODATE
+ IF "%TIMEDELIM%"=="" GOTO ERRNOTIME
+ IF "%DATEDELIM%"=="" GOTO ERRNODATE
+
+ SET TIMEDELIM=%TIMEDELIM:~1,1%
+ SET DATEDELIM=%DATEDELIM:~1,1%
+ SET TIMEFORMAT=%TIMEFORMAT:~1,1%
+ SET DATEFORMAT=%DATEFORMAT:~1,1%
+
+REM *****************************************************************************************************************
+REM Well, well. Its time to look at the time and format it in a standard way (if possible)
+REM *****************************************************************************************************************
+
+
+ FOR /F "TOKENS=1-4 DELIMS=%TIMEDELIM% " %%a IN ('echo %MYTIME%') DO SET AA=%%a&SET BB=%%b&SET CC=%%c&SET DD=%%d
+
+ REM 12H Format
+ IF "%TIMEFORMAT%" == "0" (
+ SET HOUR=%AA%
+ SET MIN=%BB%
+ FOR /F "USEBACKQ TOKENS=1 DELIMS=ap" %%a IN ('%BB%') DO SET MMIN=%%a
+ SET SEC=%CC%
+ SET SUBSEC=%DD%
+ )
+
+ REM Get rid of the "a" or "p" if we have one of these in our minute string
+ IF NOT "%MMIN%"=="%MIN%" FOR /F "USEBACKQ TOKENS=1 DELIMS=ap " %%a IN ('%MIN%') DO SET MIN=%%a
+
+ REM 24H Format
+ IF "%TIMEFORMAT%" == "1" (
+ SET HOUR=%AA%
+ SET MIN=%BB%
+ SET SEC=%CC%
+ SET SUBSEC=%DD%
+ )
+
+ IF "%HOUR%"=="" GOTO ERRNOTIME
+ IF "%MIN%"=="" GOTO ERRNOTIME
+
+ IF "%SEC%"=="" SET SEC=00
+ IF "%SUBSEC%"=="" SET SUBSEC=00
+
+
+REM *****************************************************************************************************************
+REM It's time to format the date :-)
+REM *****************************************************************************************************************
+
+
+ FOR /F "TOKENS=1-4 DELIMS=./- " %%a IN ('ECHO %MYDATE%') DO SET AA=%%a&SET BB=%%b&SET CC=%%c&SET DD=%%d
+
+ IF "%DD%" == "" (
+ REM No Day of Week in Date
+ ( IF "%DATEFORMAT%" == "0" SET DOW=_&SET DAY=%BB%&SET NMM=%AA%&SET YEAR=%CC% )
+ ( IF "%DATEFORMAT%" == "1" SET DOW=_&SET DAY=%AA%&SET NMM=%BB%&SET YEAR=%CC% )
+ ( IF "%DATEFORMAT%" == "2" SET DOW=_&SET DAY=%CC%&SET NMM=%BB%&SET YEAR=%AA% )
+ ) ELSE (
+ ( IF "%DATEFORMAT%" == "0" SET DOW=%AA%&SET DAY=%CC%&SET NMM=%BB%&SET YEAR=%DD% )
+ ( IF "%DATEFORMAT%" == "1" SET DOW=%AA%&SET DAY=%BB%&SET NMM=%CC%&SET YEAR=%DD% )
+ ( IF "%DATEFORMAT%" == "2" SET DOW=%AA%&SET DAY=%DD%&SET NMM=%CC%&SET YEAR=%BB% )
+ )
+
+ REM Something went wrong, we weren't able to get a valid date
+ IF NOT "%YEAR%" == "0" GOTO DATEOK
+ goto ERRNODATE
+
+:DATEOK
+
+ REM Clean up any temporary files we may have created...
+ REM IF exist userset.reg del userset.reg
+ REM IF exist userset.txt del userset.txt
+
+ IF "%NMM%" == "01" SET MONTH=Jan
+ IF "%NMM%" == "02" SET MONTH=Feb
+ IF "%NMM%" == "03" SET MONTH=Mar
+ IF "%NMM%" == "04" SET MONTH=Apr
+ IF "%NMM%" == "05" SET MONTH=May
+ IF "%NMM%" == "06" SET MONTH=Jun
+ IF "%NMM%" == "07" SET MONTH=Jul
+ IF "%NMM%" == "08" SET MONTH=Aug
+ IF "%NMM%" == "09" SET MONTH=Sep
+ IF "%NMM%" == "10" SET MONTH=Oct
+ IF "%NMM%" == "11" SET MONTH=Nov
+ IF "%NMM%" == "12" SET MONTH=Dec
+
+ IF NOT {%MONTH%} == {} GOTO DATE_OK
+
+ REM *** Not US date format! Assume ISO: yyyy-mm-dd
+
+ FOR /F "TOKENS=1-4 DELIMS=/- " %%a IN ('date/t') DO SET DAY=%%a&SET yyyy=%%b&SET nmm=%%c&SET dd=%%d
+
+ echo a=%%a b=%%b c=%%c d=%%d
+ IF "%NMM%" == "01" SET MONTH=Jan
+ IF "%NMM%" == "02" SET MONTH=Feb
+ IF "%NMM%" == "03" SET MONTH=Mar
+ IF "%NMM%" == "04" SET MONTH=Apr
+ IF "%NMM%" == "05" SET MONTH=May
+ IF "%NMM%" == "06" SET MONTH=Jun
+ IF "%NMM%" == "07" SET MONTH=Jul
+ IF "%NMM%" == "08" SET MONTH=Aug
+ IF "%NMM%" == "09" SET MONTH=Sep
+ IF "%NMM%" == "10" SET MONTH=Oct
+ IF "%NMM%" == "11" SET MONTH=Nov
+ IF "%NMM%" == "12" SET MONTH=Dec
+
+:DATE_OK
+ IF "%SS" == "" SET SS="00"
+
+
+REM *****************************************************************************************************************
+REM Now create a valid version.c file ...
+REM *****************************************************************************************************************
+
+ ECHO Version %VER% Build %RUN% date %MONTH%/%DAY%/%YEAR% time %HOUR%:%MIN%:%SEC% %UTC%
+ ECHO char * Version = "%GENERATED_PROGRAM% %VER% %MONTH% %DAY% %HOUR%:%MIN%:%SEC% %UTC% %YEAR% (%RUN%)" ; > version.c
+ GOTO EOF
+
+
+REM *****************************************************************************************************************
+REM Here are the error messages I know
+REM *****************************************************************************************************************
+:ERRNOREG
+ ECHO "Error: Registry could not be read (check if reg.exe is available and works as expected)"
+ GOTO EOF
+
+
+:ERRNODATE
+ ECHO "Error: Dateformat unknown (check if contents of userset.txt are correctly, especially for iDate and sDate)"
+ GOTO EOF
+
+:ERRNOTIME
+ ECHO "Error: Timeformat unknown (check if contents of userset.txt are correctly, especially for iTime and sTime)"
+ GOTO EOF
+
+:ERRNOVERF
+ ECHO "Error: Version file not found (searching for ..\..\..\..\packageinfo.sh)"
+ GOTO EOF
+
+
+REM *****************************************************************************************************************
+REM Show'em how to run (me)
+REM *****************************************************************************************************************
+:USAGE
+
+ ECHO Usage: mkver.bat [ -P <Program Name> -H ]
+ ECHO -P Database Name
+ ECHO -H Help on options
+
+REM *****************************************************************************************************************
+REM All good things come to an end someday. Time to leave
+REM *****************************************************************************************************************
+:EOF
+
+REM *** Cleaning up
+IF EXIST point.txt DEL point.txt
+IF EXIST userset.txt DEL userset.txt
+IF EXIST userset.reg DEL userset.reg
diff --git a/ports/winnt/vs2005/Instsrv.vcproj b/ports/winnt/vs2005/Instsrv.vcproj
new file mode 100644
index 0000000..74ccb81
--- /dev/null
+++ b/ports/winnt/vs2005/Instsrv.vcproj
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="instsrv"
+ ProjectGUID="{EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\instsrv\Debug"
+ IntermediateDirectory=".\instsrv\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\instsrv\Debug/Instsrv.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include,..\include,."
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_WIN32_WINNT=0x400;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile=".\instsrv\Debug/Instsrv.pch"
+ AssemblerListingLocation=".\instsrv\Debug/"
+ ObjectFile=".\instsrv\Debug/"
+ ProgramDataBaseFileName=".\instsrv\Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="bin/Debug/Instsrv.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\instsrv\Debug/Instsrv.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\instsrv\Debug/Instsrv.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\instsrv\Release"
+ IntermediateDirectory=".\instsrv\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\instsrv\Release/Instsrv.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include,..\include,."
+ PreprocessorDefinitions="NDEBUG;_WINDOWS;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_WIN32_WINNT=0x400;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\instsrv\Release/Instsrv.pch"
+ AssemblerListingLocation=".\instsrv\Release/"
+ ObjectFile=".\instsrv\Release/"
+ ProgramDataBaseFileName=".\instsrv\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="bin/Release/Instsrv.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\instsrv\Release/Instsrv.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\instsrv\Release/Instsrv.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\instsrv\instsrv.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2005/libntp.vcproj b/ports/winnt/vs2005/libntp.vcproj
new file mode 100644
index 0000000..f2d0b9e
--- /dev/null
+++ b/ports/winnt/vs2005/libntp.vcproj
@@ -0,0 +1,864 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="libntp"
+ ProjectGUID="{ECDDC7EE-5805-4603-B38D-804C09BDC910}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\libntp\Debug"
+ IntermediateDirectory=".\libntp\Debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_LIB;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_WIN32_WINNT=0x400;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderFile=".\libntp\Debug/libntp.pch"
+ AssemblerListingLocation=".\libntp\Debug/"
+ ObjectFile=".\libntp\Debug/"
+ ProgramDataBaseFileName=".\libntp\Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile=".\libntp\Debug\libntp.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\libntp\Debug/libntp.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\libntp\Release"
+ IntermediateDirectory=".\libntp\Release"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_LIB;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_WIN32_WINNT=0x400;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\libntp\Release/libntp.pch"
+ AssemblerListingLocation=".\libntp\Release/"
+ ObjectFile=".\libntp\Release/"
+ ProgramDataBaseFileName=".\libntp\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile=".\libntp\Release\libntp.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\libntp\Release/libntp.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\libntp\a_md5encrypt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\adjtime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\assertions.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\atoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\atolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\atouint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\authkeys.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\authreadkeys.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\authusekey.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\buffer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\backtrace-emtpytbl.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\backtrace.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\buftvtots.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\caljulian.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\caltontp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\calyearstart.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\clocktime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\clocktypes.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\condition.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\decodenetnum.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\dofptoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\dolfptoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\emalloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\error.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\event.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\findconfig.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\getclock.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\getopt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\hextoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\hextolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\humandate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\icom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\inet_aton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\inet_ntop.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\inet_pton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\interfaceiter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\iosignal.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\lib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\lib_strbuf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sntp\libopts\libopts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\log.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\machines.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\md5.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\mktime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\modetoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\nls\msgcat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\mstolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\msyslog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\net.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\netaddr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\netof.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\netscope.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_calendar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_intres.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_libopts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_lineedit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_random.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_rfc2553.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_worker.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\numtoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\numtohost.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\octtoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\once.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\ondestroy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\prettydate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\randfile.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\recvbuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\refnumtoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\setpriority.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\SetSystemTime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\snprintf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\sockaddr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\socket.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\socktoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\socktohost.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ssl_init.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\statestr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\stdtime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\strerror.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\strl_obsd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\syslog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\syssignal.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\systime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\task.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\termios.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\thread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\time.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\timetoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\timevalops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\uglydate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\util_clockstuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\libntp\win32_io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\win32os.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\work_fork.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\work_thread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ymd2yd.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\include\binio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\buffer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\clockstuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\condition.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\event.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\global.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\hash.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ieee754io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\netinet\in.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\arpa\inet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\interfaceiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\intreswork.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\inttypes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\sys\ioctl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\iosignal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\ipv6.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\lib_strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\log.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\md5.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\isc\mem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\isc\netaddr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\netdb.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\isc\netscope.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_control.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_if.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\ntp_iocompletionport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_lineedit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_lists.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_malloc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_random.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_refclock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\ntp_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_intres.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntpd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\ondestroy.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\recvbuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\sys\signal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\sys\socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\stat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\stdtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\task.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\termios.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\thread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\sys\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\win32_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\win32os.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Generated Files"
+ >
+ <File
+ RelativePath="..\libntp\messages.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ >
+ <File
+ RelativePath="..\libntp\messages.mc"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Message Compiler"
+ CommandLine="mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)&#x0D;&#x0A;"
+ Outputs="$(InputDir)$(InputName).rc;$(InputDir)$(InputName).h;$(InputDir)msg00001.bin"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Message Compiler"
+ CommandLine="mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)&#x0D;&#x0A;"
+ Outputs="$(InputDir)$(InputName).rc;$(InputDir)$(InputName).h;$(InputDir)msg00001.bin"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2005/ntp.sln b/ports/winnt/vs2005/ntp.sln
new file mode 100644
index 0000000..6b840be
--- /dev/null
+++ b/ports/winnt/vs2005/ntp.sln
@@ -0,0 +1,70 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instsrv", "Instsrv.vcproj", "{EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libntp", "libntp.vcproj", "{ECDDC7EE-5805-4603-B38D-804C09BDC910}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd", "ntpd.vcproj", "{F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}"
+ ProjectSection(ProjectDependencies) = postProject
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdate", "ntpdate.vcproj", "{9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}"
+ ProjectSection(ProjectDependencies) = postProject
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdc", "ntpdc.vcproj", "{C82634BB-AC80-4796-B2AF-2903C665ED17}"
+ ProjectSection(ProjectDependencies) = postProject
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpkeygen", "ntpkeygen.vcproj", "{9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}"
+ ProjectSection(ProjectDependencies) = postProject
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpq", "ntpq.vcproj", "{EA10E04E-946B-44A6-B0AB-B5B93A160744}"
+ ProjectSection(ProjectDependencies) = postProject
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910} = {ECDDC7EE-5805-4603-B38D-804C09BDC910}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Debug|Win32.Build.0 = Debug|Win32
+ {EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Release|Win32.ActiveCfg = Release|Win32
+ {EAA8D0C8-A8AF-4C40-BF14-4A94570DE033}.Release|Win32.Build.0 = Release|Win32
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910}.Debug|Win32.ActiveCfg = Debug|Win32
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910}.Debug|Win32.Build.0 = Debug|Win32
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910}.Release|Win32.ActiveCfg = Release|Win32
+ {ECDDC7EE-5805-4603-B38D-804C09BDC910}.Release|Win32.Build.0 = Release|Win32
+ {F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Debug|Win32.Build.0 = Debug|Win32
+ {F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Release|Win32.ActiveCfg = Release|Win32
+ {F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}.Release|Win32.Build.0 = Release|Win32
+ {9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Debug|Win32.Build.0 = Debug|Win32
+ {9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Release|Win32.ActiveCfg = Release|Win32
+ {9BF928B1-8A1A-4A0D-BE6D-38EDAD29F416}.Release|Win32.Build.0 = Release|Win32
+ {C82634BB-AC80-4796-B2AF-2903C665ED17}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C82634BB-AC80-4796-B2AF-2903C665ED17}.Debug|Win32.Build.0 = Debug|Win32
+ {C82634BB-AC80-4796-B2AF-2903C665ED17}.Release|Win32.ActiveCfg = Release|Win32
+ {C82634BB-AC80-4796-B2AF-2903C665ED17}.Release|Win32.Build.0 = Release|Win32
+ {9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Debug|Win32.Build.0 = Debug|Win32
+ {9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Release|Win32.ActiveCfg = Release|Win32
+ {9B768B99-2BC8-4A4C-AC0D-A7DA9C695825}.Release|Win32.Build.0 = Release|Win32
+ {EA10E04E-946B-44A6-B0AB-B5B93A160744}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EA10E04E-946B-44A6-B0AB-B5B93A160744}.Debug|Win32.Build.0 = Debug|Win32
+ {EA10E04E-946B-44A6-B0AB-B5B93A160744}.Release|Win32.ActiveCfg = Release|Win32
+ {EA10E04E-946B-44A6-B0AB-B5B93A160744}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/ports/winnt/vs2005/ntpd.vcproj b/ports/winnt/vs2005/ntpd.vcproj
new file mode 100644
index 0000000..005f287
--- /dev/null
+++ b/ports/winnt/vs2005/ntpd.vcproj
@@ -0,0 +1,1893 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ntpd"
+ ProjectGUID="{F6F7E7C0-AE5E-4D7C-A17E-A3043FE68664}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\ntpd\Release"
+ IntermediateDirectory=".\ntpd\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpd\Release/ntpd.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".,..\..\..\ntpd,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\ntpd\Release/ntpd.pch"
+ AssemblerListingLocation=".\ntpd\Release/"
+ ObjectFile=".\ntpd\Release/"
+ ProgramDataBaseFileName=".\ntpd\Release/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="odbc32.lib odbccp32.lib ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Release/ntpd.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile="bin/Release/ntpd.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpd\Release/ntpd.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\ntpd\Debug"
+ IntermediateDirectory=".\ntpd\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpd\Debug/ntpd.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".,..\..\..\ntpd,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderFile=".\ntpd\Debug/ntpd.pch"
+ AssemblerListingLocation=".\ntpd\Debug/"
+ ObjectFile=".\ntpd\Debug/"
+ ProgramDataBaseFileName=".\ntpd\Debug/"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="odbc32.lib odbccp32.lib ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Debug/ntpd.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="bin/Debug/ntpd.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpd\Debug/ntpd.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\ntpd\cmd_args.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\ntpd\nt_clockstuff.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_config.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_control.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_crypto.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_filegen.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_io.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\ntpd\ntp_iocompletionport.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_leapsec.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_loopfilter.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_monitor.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_parser.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_peer.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_proto.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_refclock.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_request.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_restrict.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_scanner.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_timer.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_util.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntpd-opts.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntpd.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\ntpd\ntservice.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\include\ascii.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\assertions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\binio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\boolean.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\clockstuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\hopf_PCI_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ieee754io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\netinet\in.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\arpa\inet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\isc\int.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\interfaceiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\iosignal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\isc\ipv6.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\jupiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\log.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\mbg_gps166.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\netaddr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\netdb.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_cmdargs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_control.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_filegen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_if.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntp_leapsec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\ntp_iocompletionport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_malloc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_random.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_refclock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_request.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\ntp_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_tty.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_worker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntp_workimpl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\ntpd-opts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\ntpd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\ntservice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\isc\offset.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sntp\libopts\autoopts\options.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\sys\param.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\isc\platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\include\recvbuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\include\isc\result.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\sys\socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\termios.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\sys\wait.h"
+ >
+ </File>
+ <File
+ RelativePath="..\include\win32_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\isc\win32\include\isc\win32os.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Generated Files"
+ >
+ <File
+ RelativePath="..\libntp\messages.rc"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ AdditionalIncludeDirectories="\ntp-dev-4.2.5p209\ports\winnt\libntp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ AdditionalIncludeDirectories="\ntp-dev-4.2.5p209\ports\winnt\libntp"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\libntp\MSG00001.bin"
+ >
+ </File>
+ <File
+ RelativePath="version.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="..\libntp\messages.mc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Reference Clock"
+ >
+ <File
+ RelativePath="..\ntpd\hopf_PCI_io.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_acts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_arbiter.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_arc.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_as2201.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_atom.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_bancomm.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_chronolog.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_chu.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_conf.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_datum.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_dumbclock.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_gpsvme.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_heath.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_hopfpci.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_hopfser.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_hpgps.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_irig.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_jupiter.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_leitch.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_local.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_msfees.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_mx4200.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_nmea.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_oncore.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_palisade.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_palisade.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_parse.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_pst.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_ptbacts.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_shm.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_tpro.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_true.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_tsyncpci.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_usno.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpd\refclock_wwvb.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Parse Lib"
+ >
+ <File
+ RelativePath="..\..\..\libparse\clk_computime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_dcf7000.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_hopf6021.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_meinberg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_rawdcf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_rcc8000.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_schmid.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_trimtaip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_trimtsip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_trimtsip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_varitext.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\clk_wharton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\data_mbg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libparse\parse_conf.c"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\..\configure"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpd&#x0D;&#x0A;"
+ AdditionalDependencies="..\scripts\mkver.bat;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpd&#x0D;&#x0A;"
+ AdditionalDependencies="..\scripts\mkver.bat;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\scripts\mkver.bat"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2005/ntpdate.vcproj b/ports/winnt/vs2005/ntpdate.vcproj
new file mode 100644
index 0000000..2e40cad
--- /dev/null
+++ b/ports/winnt/vs2005/ntpdate.vcproj
@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ntpdate"
+ ProjectGUID="{AF12F490-0BDA-4BC4-8F4B-EDA43B381CB3}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\ntpdate\Debug"
+ IntermediateDirectory=".\ntpdate\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpdate\Debug/ntpdate.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC)"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderFile=".\ntpdate\Debug/ntpdate.pch"
+ AssemblerListingLocation=".\ntpdate\Debug/"
+ ObjectFile=".\ntpdate\Debug/"
+ ProgramDataBaseFileName=".\ntpdate\Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Debug/ntpdate.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="bin/Debug/ntpdate.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpdate\Debug/ntpdate.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\ntpdate\Release"
+ IntermediateDirectory=".\ntpdate\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpdate\Release/ntpdate.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC)"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\ntpdate\Release/ntpdate.pch"
+ AssemblerListingLocation=".\ntpdate\Release/"
+ ObjectFile=".\ntpdate\Release/"
+ ProgramDataBaseFileName=".\ntpdate\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Release/ntpdate.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile="bin/Release/ntpdate.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpdate\Release/ntpdate.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\ntpdate\ntpdate.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\ntpdate\ntpdate.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\configure"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpdate&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpdate&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2005/ntpdc.vcproj b/ports/winnt/vs2005/ntpdc.vcproj
new file mode 100644
index 0000000..8339c58
--- /dev/null
+++ b/ports/winnt/vs2005/ntpdc.vcproj
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ntpdc"
+ ProjectGUID="{FA6396FE-2060-4A60-BE9E-86531637FB52}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\ntpdc\Debug"
+ IntermediateDirectory=".\ntpdc\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpdc\Debug/ntpdc.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderFile=".\ntpdc\Debug/ntpdc.pch"
+ AssemblerListingLocation=".\ntpdc\Debug/"
+ ObjectFile=".\ntpdc\Debug/"
+ ProgramDataBaseFileName=".\ntpdc\Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Debug/ntpdc.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="bin/Debug/ntpdc.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpdc\Debug/ntpdc.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\ntpdc\Release"
+ IntermediateDirectory=".\ntpdc\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpdc\Release/ntpdc.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\ntpdc\Release/ntpdc.pch"
+ AssemblerListingLocation=".\ntpdc\Release/"
+ ObjectFile=".\ntpdc\Release/"
+ ProgramDataBaseFileName=".\ntpdc\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Release/ntpdc.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile="bin/Release/ntpdc.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpdc\Release/ntpdc.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\ntpdc\ntpdc-opts.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpdc\ntpdc.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpdc\ntpdc_ops.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\ntpdc\ntpdc.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\configure"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpdc&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpdc&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2005/ntpkeygen.vcproj b/ports/winnt/vs2005/ntpkeygen.vcproj
new file mode 100644
index 0000000..b6c0ab8
--- /dev/null
+++ b/ports/winnt/vs2005/ntpkeygen.vcproj
@@ -0,0 +1,378 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ntpkeygen"
+ ProjectGUID="{AC45551A-4745-4160-839C-066FBFB255D1}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\ntp-keygen\Debug"
+ IntermediateDirectory=".\ntp-keygen\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntp-keygen\Debug/ntpkeygen.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_WIN32_WINNT=0x400;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderFile=".\ntp-keygen\Debug/ntpkeygen.pch"
+ AssemblerListingLocation=".\ntp-keygen\Debug/"
+ ObjectFile=".\ntp-keygen\Debug/"
+ ProgramDataBaseFileName=".\ntp-keygen\Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib libntp\Debug\libntp.lib"
+ OutputFile="bin/Debug/ntp-keygen.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="bin/Debug/ntp-keygen.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntp-keygen\Debug/ntpkeygen.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\ntp-keygen\Release"
+ IntermediateDirectory=".\ntp-keygen\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntp-keygen\Release/ntpkeygen.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_WIN32_WINNT=0x400;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\ntp-keygen\Release/ntpkeygen.pch"
+ AssemblerListingLocation=".\ntp-keygen\Release/"
+ ObjectFile=".\ntp-keygen\Release/"
+ ProgramDataBaseFileName=".\ntp-keygen\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib libntp\Release\libntp.lib"
+ OutputFile="bin/Release/ntp-keygen.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile="bin/Release/ntp-keygen.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntp-keygen\Release/ntpkeygen.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\libntp\getopt.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\util\ntp-keygen-opts.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\util\ntp-keygen.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\ntp_random.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\libntp\randfile.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\configure"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntp-keygen&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntp-keygen&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2005/ntpq.vcproj b/ports/winnt/vs2005/ntpq.vcproj
new file mode 100644
index 0000000..ec7c1a5
--- /dev/null
+++ b/ports/winnt/vs2005/ntpq.vcproj
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ntpq"
+ ProjectGUID="{4BD64547-230D-4C0E-9F2C-9D75B4CC0FC7}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\ntpq\Release"
+ IntermediateDirectory=".\ntpq\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpq\Release/ntpq.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\ntpq\Release/ntpq.pch"
+ AssemblerListingLocation=".\ntpq\Release/"
+ ObjectFile=".\ntpq\Release/"
+ ProgramDataBaseFileName=".\ntpq\Release/"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Release/ntpq.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile="bin/Release/ntpq.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpq\Release/ntpq.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\ntpq\Debug"
+ IntermediateDirectory=".\ntpq\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\ntpq\Debug/ntpq.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".,..\include,..\..\..\include,..\..\..\lib\isc\win32\include,..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderFile=".\ntpq\Debug/ntpq.pch"
+ AssemblerListingLocation=".\ntpq\Debug/"
+ ObjectFile=".\ntpq\Debug/"
+ ProgramDataBaseFileName=".\ntpq\Debug/"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="bin/Debug/ntpq.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="bin/Debug/ntpq.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ Version="0x0400"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\ntpq\Debug/ntpq.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\ntpq\ntpq-opts.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpq\ntpq-subs.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\ntpq\ntpq.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="version.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\ntpq\ntpq.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\configure"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpq&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\scripts\mkver.bat -P ntpq&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/instsrv/instsrv.vcproj b/ports/winnt/vs2008/instsrv/instsrv.vcproj
new file mode 100644
index 0000000..e3324a6
--- /dev/null
+++ b/ports/winnt/vs2008/instsrv/instsrv.vcproj
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="instsrv"
+ ProjectGUID="{C3534C4D-6DF1-498E-9904-4337878A1515}"
+ RootNamespace="instsrv"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)Instsrv.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\..\..\include,..\..\include,..\..\instsrv"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)Instsrv.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)instsrv-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="oldnames.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)Instsrv.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\include,..\..\include,..\..\instsrv"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;_WINDOWS;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)Instsrv.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)instsrv-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="oldnames.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\instsrv\instsrv.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/libntp/libntp.vcproj b/ports/winnt/vs2008/libntp/libntp.vcproj
new file mode 100644
index 0000000..6bf25cb
--- /dev/null
+++ b/ports/winnt/vs2008/libntp/libntp.vcproj
@@ -0,0 +1,948 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="libntp"
+ ProjectGUID="{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\libntp,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)libntp.pch"
+ AssemblerListingLocation="$IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(IntDir)"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\libntp,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ GeneratePreprocessedFile="0"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="false"
+ PrecompiledHeaderFile="$(IntDir)libntp.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(IntDir)"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\libntp\a_md5encrypt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\adjtime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\assertions.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\atoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\atolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\atouint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\audio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\authkeys.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\authreadkeys.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\authusekey.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\backtrace-emptytbl.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\backtrace.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\buffer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\buftvtots.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\caljulian.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\caltontp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\calyearstart.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\clocktime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\clocktypes.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\condition.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\decodenetnum.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\dofptoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\dolfptoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\emalloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\error.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\event.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\findconfig.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\getclock.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\getopt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\hextoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\hextolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\humandate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\icom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\inet_aton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\inet_ntop.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\inet_pton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\interfaceiter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\iosignal.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\lib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\lib_strbuf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\sntp\libopts\libopts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\log.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\machines.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\md5.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\mktime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\modetoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\nls\msgcat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\mstolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\msyslog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\net.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\netaddr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\netof.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\netscope.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_calendar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_intres.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_libopts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_lineedit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_random.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_rfc2553.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_worker.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\numtoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\numtohost.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\octtoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\once.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\ondestroy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\prettydate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\randfile.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\recvbuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\refnumtoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\setpriority.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\SetSystemTime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\sha1.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\snprintf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\sockaddr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\socket.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\socktoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\socktohost.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ssl_init.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\statestr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\stdtime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\strdup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\strerror.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\strl_obsd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\syslog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\syssignal.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\systime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\task.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\termios.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\thread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\time.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\timetoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\timevalops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\uglydate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\util_clockstuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\vint64ops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\win32_io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\win32os.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\work_fork.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\work_thread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ymd2yd.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\sntp\libopts\ag-char-map.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\binio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\buffer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\clockstuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\condition.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\declcond.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\event.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\gaa_compat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\global.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\hash.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ieee754io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netinet\in.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\arpa\inet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\interfaceiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\intreswork.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\ioctl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\iosignal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\ipv6.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\lib_strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\log.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\md5.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\isc\mem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\mutex.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\isc\netaddr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netdb.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\isc\netscope.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_assert.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_control.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_if.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_intres.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_iocompletionport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_libopts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lineedit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lists.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_malloc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_md5.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_random.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_refclock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntpd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\ondestroy.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\recvbuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\resource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\signal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\stat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\stdtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\task.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\termios.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\thread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timespecops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timetoa.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timevalops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\vint64ops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\win32_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\win32os.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Generated Files"
+ >
+ <File
+ RelativePath="..\..\libntp\messages.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ >
+ <File
+ RelativePath="..\..\libntp\messages.mc"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Message Compiler"
+ CommandLine="mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)&#x0D;&#x0A;"
+ Outputs="$(InputDir)$(InputName).rc;$(InputDir)$(InputName).h;$(InputDir)msg00001.bin"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Message Compiler"
+ CommandLine="mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)&#x0D;&#x0A;"
+ Outputs="$(InputDir)$(InputName).rc;$(InputDir)$(InputName).h;$(InputDir)msg00001.bin"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj b/ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj
new file mode 100644
index 0000000..e306108
--- /dev/null
+++ b/ports/winnt/vs2008/loopback-pps/loopback-ppsapi-provider.vcproj
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="loopback-ppsapi-provider"
+ ProjectGUID="{1ACE209D-D56E-450B-8711-B73E4ACFC38E}"
+ RootNamespace="loopbackerialppsapiprovider"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include"
+ PreprocessorDefinitions="SYS_WINNT"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough="serialpps-ppsapi-provider.h"
+ AssemblerListingLocation="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)loopback-ppsapi-provider-vc90"
+ BrowseInformation="1"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ntpd.lib"
+ OutputFile="$(OutDir)$(ProjectName).dll"
+ Version="0x0400"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="$(OutDir)"
+ GenerateManifest="false"
+ ModuleDefinitionFile="..\..\ppsapi\loopback\src\loopback-ppsapi.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include"
+ PreprocessorDefinitions="SYS_WINNT"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough="serialpps-ppsapi-provider.h"
+ AssemblerListingLocation="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)loopback-ppsapi-provider-vc90"
+ BrowseInformation="1"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ntpd.lib"
+ OutputFile="$(OutDir)$(ProjectName).dll"
+ Version="0x0400"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="$(OutDir)"
+ GenerateManifest="false"
+ ModuleDefinitionFile="..\..\ppsapi\loopback\src\loopback-ppsapi.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <ProjectReference
+ ReferencedProjectIdentifier="{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}"
+ CopyLocal="false"
+ CopyLocalDependencies="false"
+ CopyLocalSatelliteAssemblies="false"
+ RelativePathToProject=".\libntp\libntp.vcproj"
+ />
+ <ProjectReference
+ ReferencedProjectIdentifier="{CB61F8BF-9637-495C-9087-E8664B400CE0}"
+ CopyLocal="false"
+ CopyLocalDependencies="false"
+ CopyLocalSatelliteAssemblies="false"
+ RelativePathToProject=".\ntpd\ntpd.vcproj"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\loopback-ppsapi.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\loopback-ppsapi.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\sys\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\timepps.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj b/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj
new file mode 100644
index 0000000..6bf76fe
--- /dev/null
+++ b/ports/winnt/vs2008/ntp-keygen/ntp-keygen.vcproj
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntp-keygen"
+ ProjectGUID="{C88C1FBF-59D2-447F-BF57-0BCA8889028F}"
+ RootNamespace="ntp-keygen"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntp-keygen.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntp-keygen,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ SmallerTypeCheck="true"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntp-keygen.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntp-keygen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntp-keygen.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\ntp-keygen,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntp-keygen.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntp-keygen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\util\ntp-keygen-opts.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\util\ntp-keygen.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntp-keygen&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntp-keygen&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/ntp.sln b/ports/winnt/vs2008/ntp.sln
new file mode 100644
index 0000000..e5556d9
--- /dev/null
+++ b/ports/winnt/vs2008/ntp.sln
@@ -0,0 +1,90 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd", "ntpd\ntpd.vcproj", "{CB61F8BF-9637-495C-9087-E8664B400CE0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A} = {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instsrv", "instsrv\instsrv.vcproj", "{C3534C4D-6DF1-498E-9904-4337878A1515}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libntp", "libntp\libntp.vcproj", "{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdate", "ntpdate\ntpdate.vcproj", "{2789A62E-3F46-44F1-AAF0-816CD23C2911}"
+ ProjectSection(ProjectDependencies) = postProject
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdc", "ntpdc\ntpdc.vcproj", "{8011C820-B3D5-4034-86EA-FFC30AE6764B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntp-keygen", "ntp-keygen\ntp-keygen.vcproj", "{C88C1FBF-59D2-447F-BF57-0BCA8889028F}"
+ ProjectSection(ProjectDependencies) = postProject
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpq", "ntpq\ntpq.vcproj", "{6A92BF14-8931-48B1-A571-DEBE9F190616}"
+ ProjectSection(ProjectDependencies) = postProject
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd-keyword-gen", "ntpd-keyword-gen\ntpd-keyword-gen.vcproj", "{1B814CC1-EAD4-4A13-B29C-A67B23C9845A}"
+ ProjectSection(ProjectDependencies) = postProject
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00} = {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopback-ppsapi-provider", "loopback-pps\loopback-ppsapi-provider.vcproj", "{1ACE209D-D56E-450B-8711-B73E4ACFC38E}"
+ ProjectSection(ProjectDependencies) = postProject
+ {CB61F8BF-9637-495C-9087-E8664B400CE0} = {CB61F8BF-9637-495C-9087-E8664B400CE0}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|Win32.Build.0 = Debug|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|Win32.ActiveCfg = Release|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|Win32.Build.0 = Release|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|Win32.Build.0 = Debug|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release|Win32.ActiveCfg = Release|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release|Win32.Build.0 = Release|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|Win32.ActiveCfg = Debug|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|Win32.Build.0 = Debug|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|Win32.ActiveCfg = Release|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|Win32.Build.0 = Release|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|Win32.Build.0 = Debug|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|Win32.ActiveCfg = Release|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|Win32.Build.0 = Release|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|Win32.Build.0 = Debug|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|Win32.ActiveCfg = Release|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|Win32.Build.0 = Release|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|Win32.Build.0 = Debug|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|Win32.ActiveCfg = Release|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|Win32.Build.0 = Release|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|Win32.Build.0 = Debug|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|Win32.ActiveCfg = Release|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|Win32.Build.0 = Release|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug|Win32.Build.0 = Debug|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release|Win32.ActiveCfg = Release|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release|Win32.Build.0 = Release|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug|Win32.Build.0 = Debug|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release|Win32.ActiveCfg = Release|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj b/ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj
new file mode 100644
index 0000000..9a309d2
--- /dev/null
+++ b/ports/winnt/vs2008/ntpd-keyword-gen/ntpd-keyword-gen.vcproj
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpd-keyword-gen"
+ ProjectGUID="{1B814CC1-EAD4-4A13-B29C-A67B23C9845A}"
+ RootNamespace="ntpdkeywordgen"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ SmallerTypeCheck="true"
+ RuntimeLibrary="1"
+ EnableFunctionLevelLinking="true"
+ ProgramDataBaseFileName="$(OutDir)keyword-gen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)keyword-gen.exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)keywordgen.pdb"
+ RandomizedBaseAddress="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\libopts"
+ PreprocessorDefinitions="_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ ProgramDataBaseFileName="$(OutDir)keyword-gen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)keyword-gen.exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)keywordgen.pdb"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpd\keyword-gen.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\lib_strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_scanner.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_types.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat b/ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat
new file mode 100644
index 0000000..3013b8f
--- /dev/null
+++ b/ports/winnt/vs2008/ntpd/gen-ntp_keyword.bat
@@ -0,0 +1,39 @@
+@echo off
+REM gen-ntp_keyword.bat
+REM helper to invoke keyword-gen and possibly update ntp_keyword.h
+REM Usage:
+REM gen-ntp_keyword dir_containing_keyword-gen.exe
+REM
+if "%1"=="" goto Usage
+if not exist %1\keyword-gen.exe goto ExeNotFound
+%1\keyword-gen.exe ..\..\..\..\ntpd\ntp_parser.h > new_keyword.h
+findstr /v diff_ignore_line new_keyword.h > new_keyword_cmp.h
+findstr /v diff_ignore_line ..\..\..\..\ntpd\ntp_keyword.h > ntp_keyword_cmp.h
+set meat_changed=0
+fc /L ntp_keyword_cmp.h new_keyword_cmp.h > NUL
+if errorlevel 1 set meat_changed=1
+del ntp_keyword_cmp.h new_keyword_cmp.h
+if "0"=="%meat_changed%" goto SkipUpdate
+xcopy /yf new_keyword.h ..\..\..\..\ntpd\ntp_keyword.h
+findstr diff_ignore_line new_keyword.h > ..\..\..\..\ntpd\keyword-gen-utd
+echo updated keyword-gen-utd and ntp_keyword.h
+goto SkipSkipMsg
+
+:skipUpdate
+echo ntp_keyword.h is unchanged
+
+:SkipSkipMsg
+set meat_changed=
+del new_keyword.h
+goto Exit
+
+:Usage
+echo Usage:
+echo gen-ntp_keyword dir_containing_keyword-gen.exe
+goto Exit
+
+:ExeNotFound
+echo keyword-gen.exe not found at %1\keyword-gen.exe
+goto Exit
+
+:Exit
diff --git a/ports/winnt/vs2008/ntpd/ntpd.vcproj b/ports/winnt/vs2008/ntpd/ntpd.vcproj
new file mode 100644
index 0000000..3dfcfe4
--- /dev/null
+++ b/ports/winnt/vs2008/ntpd/ntpd.vcproj
@@ -0,0 +1,1126 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="ntpd"
+ ProjectGUID="{CB61F8BF-9637-495C-9087-E8664B400CE0}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpd.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="false"
+ PrecompiledHeaderFile="$(IntDir)ntpd.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpd-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpd.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ SmallerTypeCheck="true"
+ RuntimeLibrary="1"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpd.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpd-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpd\cmd_args.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\keyword-gen.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\ntpd\nt_clockstuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_config.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_control.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_crypto.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_filegen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ntpd\ntp_iocompletionport.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_leapsec.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_loopfilter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_monitor.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.y"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_peer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_proto.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_refclock.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_request.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_restrict.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_scanner.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_signd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_timer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_util.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpd-opts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpsim.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ntpd\ntservice.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\include\ascii.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\assertions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\binio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\boolean.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\clockstuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\declcond.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\hopf_PCI_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ieee754io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netinet\in.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\arpa\inet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\int.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\interfaceiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\iosignal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\ipv6.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\jupiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\log.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\mbg_gps166.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\netaddr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netdb.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_assert.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_cmdargs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_control.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_filegen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_if.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_iocompletionport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_keyword.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_leapsec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_libopts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lists.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_malloc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_random.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_refclock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_request.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_scanner.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_tty.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_worker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_workimpl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpd-opts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntpd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntpsim.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntservice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\offset.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\sntp\libopts\autoopts\options.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\param.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\recvbuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_palisade.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\result.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\termios.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\timepps.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timespecops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timevalops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\wait.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\win32_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\win32os.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Generated Files"
+ >
+ <File
+ RelativePath="..\..\libntp\messages.rc"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ AdditionalIncludeDirectories="..\libntp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ AdditionalIncludeDirectories="..\libntp"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\libntp\MSG00001.bin"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_keyword.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h"
+ CommandLine=".\gen-ntp_keyword $(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\ntpd\ntp_parser.h"
+ Outputs="..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h"
+ CommandLine=".\gen-ntp_keyword $(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\ntpd\ntp_parser.h"
+ Outputs="..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ ShowIncludes="true"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="..\libntp\messages.mc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Reference Clock"
+ >
+ <File
+ RelativePath="..\..\ntpd\hopf_PCI_io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_acts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_arbiter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_arc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_as2201.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_atom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_bancomm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_chronolog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_chu.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_conf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_datum.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_dumbclock.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_fg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_gpsvme.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_heath.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_hopfpci.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_hopfser.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_hpgps.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_irig.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_jjy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_jupiter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_leitch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_local.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_msfees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_mx4200.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_neoclock4x.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_nmea.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_oncore.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_palisade.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_pcf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_pst.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_ripencc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_shm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_tpro.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_true.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_tsyncpci.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_tt560.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_ulink.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_wwv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_wwvb.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_zyfer.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Parse Lib"
+ >
+ <File
+ RelativePath="..\..\..\..\libparse\binio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_computime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_dcf7000.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_hopf6021.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_meinberg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_rawdcf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_rcc8000.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_schmid.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_trimtaip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_trimtsip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_varitext.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_wharton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\data_mbg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\gpstolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\ieee754io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\info_trimble.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\mfp_mul.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parse_conf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parsesolaris.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parsestreams.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\trim_info.c"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\scripts\mkver.bat"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpd&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\scripts\mkver.bat;..\..\include\config.h"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpd&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\scripts\mkver.bat;..\..\include\config.h"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/ntpdate/ntpdate.vcproj b/ports/winnt/vs2008/ntpdate/ntpdate.vcproj
new file mode 100644
index 0000000..85a4bef
--- /dev/null
+++ b/ports/winnt/vs2008/ntpdate/ntpdate.vcproj
@@ -0,0 +1,362 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpdate"
+ ProjectGUID="{2789A62E-3F46-44F1-AAF0-816CD23C2911}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdate.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\ntpdate,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC)"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntpdate.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdate-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdate.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpdate,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC)"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpdate.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdate-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpdate\ntpdate.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdate\ntpdate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\syslog.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdate&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdate&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/ntpdc/ntpdc.vcproj b/ports/winnt/vs2008/ntpdc/ntpdc.vcproj
new file mode 100644
index 0000000..5fd301d
--- /dev/null
+++ b/ports/winnt/vs2008/ntpdc/ntpdc.vcproj
@@ -0,0 +1,367 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpdc"
+ ProjectGUID="{8011C820-B3D5-4034-86EA-FFC30AE6764B}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdc.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpdc,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntpdc.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdc-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdc.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\ntpdc,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpdc.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdc-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc-opts.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc_ops.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\include\ntp_assert.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lineedit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdc&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdc&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2008/ntpq/ntpq.vcproj b/ports/winnt/vs2008/ntpq/ntpq.vcproj
new file mode 100644
index 0000000..440b38b
--- /dev/null
+++ b/ports/winnt/vs2008/ntpq/ntpq.vcproj
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpq"
+ ProjectGUID="{6A92BF14-8931-48B1-A571-DEBE9F190616}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpq.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\ntpq,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpq.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpq-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpq.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpq,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntpq.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpq-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq-opts.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq-subs.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\include\ntp_lineedit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpq&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpq&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/instsrv/instsrv.vcproj b/ports/winnt/vs2013/instsrv/instsrv.vcproj
new file mode 100644
index 0000000..e3324a6
--- /dev/null
+++ b/ports/winnt/vs2013/instsrv/instsrv.vcproj
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="instsrv"
+ ProjectGUID="{C3534C4D-6DF1-498E-9904-4337878A1515}"
+ RootNamespace="instsrv"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)Instsrv.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\..\..\include,..\..\include,..\..\instsrv"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)Instsrv.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)instsrv-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="oldnames.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)Instsrv.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\include,..\..\include,..\..\instsrv"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;_WINDOWS;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)Instsrv.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)instsrv-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="oldnames.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\instsrv\instsrv.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/instsrv/instsrv.vcxproj b/ports/winnt/vs2013/instsrv/instsrv.vcxproj
new file mode 100644
index 0000000..69360a4
--- /dev/null
+++ b/ports/winnt/vs2013/instsrv/instsrv.vcxproj
@@ -0,0 +1,680 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C3534C4D-6DF1-498E-9904-4337878A1515}</ProjectGuid>
+ <RootNamespace>instsrv</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;_WINDOWS;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;_WINDOWS;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;_WINDOWS;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)Instsrv.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\..\..\include;..\..\include;..\..\instsrv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;_WINDOWS;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)Instsrv.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)instsrv-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>oldnames.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\instsrv\instsrv.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters b/ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters
new file mode 100644
index 0000000..b2d70f6
--- /dev/null
+++ b/ports/winnt/vs2013/instsrv/instsrv.vcxproj.filters
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{e8390c50-c913-4569-99e0-d09ea4a59555}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{bde2853f-cf7f-4658-89e7-21f3b87fc2e2}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{21cb96d9-ac72-4879-98fd-1e8ed146b4be}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\instsrv\instsrv.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/libntp/libntp.vcproj b/ports/winnt/vs2013/libntp/libntp.vcproj
new file mode 100644
index 0000000..f9f5750
--- /dev/null
+++ b/ports/winnt/vs2013/libntp/libntp.vcproj
@@ -0,0 +1,936 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libntp"
+ ProjectGUID="{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\libntp,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)libntp.pch"
+ AssemblerListingLocation="$IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(IntDir)"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\libntp,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ GeneratePreprocessedFile="0"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="false"
+ PrecompiledHeaderFile="$(IntDir)libntp.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(IntDir)"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\libntp\a_md5encrypt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\adjtime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\assertions.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\atoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\atolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\atouint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\audio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\authkeys.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\authreadkeys.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\authusekey.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\backtrace-emptytbl.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\backtrace.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\buffer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\buftvtots.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\caljulian.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\caltontp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\calyearstart.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\clocktime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\clocktypes.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\condition.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\decodenetnum.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\dofptoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\dolfptoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\emalloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\error.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\event.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\findconfig.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\getclock.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\getopt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\hextoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\hextolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\humandate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\icom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\inet_aton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\inet_ntop.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\inet_pton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\interfaceiter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\iosignal.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\lib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\lib_strbuf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\sntp\libopts\libopts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\log.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\machines.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\md5.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\mktime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\modetoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\nls\msgcat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\mstolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\msyslog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\net.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\netaddr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\netof.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\netscope.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_calendar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_intres.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_libopts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_lineedit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_random.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_rfc2553.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ntp_worker.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\numtoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\numtohost.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\octtoint.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\once.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\ondestroy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\prettydate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\randfile.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\recvbuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\refnumtoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\setpriority.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\SetSystemTime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\snprintf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\sockaddr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\socket.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\socktoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\socktohost.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ssl_init.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\statestr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\stdtime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\strdup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\strerror.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\strl_obsd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\syslog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\syssignal.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\systime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\task.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\termios.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\thread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\time.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\timetoa.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\timevalops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\uglydate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\util_clockstuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\libntp\win32_io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\win32os.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\work_fork.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\work_thread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libntp\ymd2yd.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\sntp\libopts\ag-char-map.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\binio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\buffer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\clockstuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\condition.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\declcond.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\event.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\gaa_compat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\global.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\hash.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ieee754io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netinet\in.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\arpa\inet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\interfaceiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\intreswork.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\ioctl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\iosignal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\ipv6.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\lib_strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\log.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\md5.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\isc\mem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\mutex.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\isc\netaddr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netdb.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\isc\netscope.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_assert.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_control.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_if.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_intres.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_iocompletionport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_libopts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lineedit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lists.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_malloc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_md5.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_random.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_refclock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntpd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\ondestroy.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\recvbuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\resource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\signal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\stat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\stdtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\task.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\termios.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\thread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timespecops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timetoa.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timevalops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\win32_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\win32os.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Generated Files"
+ >
+ <File
+ RelativePath="..\..\libntp\messages.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ >
+ <File
+ RelativePath="..\..\libntp\messages.mc"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Message Compiler"
+ CommandLine="mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)&#x0D;&#x0A;"
+ Outputs="$(InputDir)$(InputName).rc;$(InputDir)$(InputName).h;$(InputDir)msg00001.bin"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Message Compiler"
+ CommandLine="mc -h $(InputDir) -r $(InputDir) -e h $(InputPath)&#x0D;&#x0A;"
+ Outputs="$(InputDir)$(InputName).rc;$(InputDir)$(InputName).h;$(InputDir)msg00001.bin"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/libntp/libntp.vcxproj b/ports/winnt/vs2013/libntp/libntp.vcxproj
new file mode 100644
index 0000000..d3b1b6e
--- /dev/null
+++ b/ports/winnt/vs2013/libntp/libntp.vcxproj
@@ -0,0 +1,740 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessToFile>false</PreprocessToFile>
+ <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessToFile>false</PreprocessToFile>
+ <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessToFile>false</PreprocessToFile>
+ <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\libntp;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_LIB;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessToFile>false</PreprocessToFile>
+ <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)libntp.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Lib>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Lib>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\libntp\a_md5encrypt.c" />
+ <ClCompile Include="..\..\..\..\libntp\adjtime.c" />
+ <ClCompile Include="..\..\..\..\libntp\vint64ops.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\assertions.c" />
+ <ClCompile Include="..\..\..\..\libntp\atoint.c" />
+ <ClCompile Include="..\..\..\..\libntp\atolfp.c" />
+ <ClCompile Include="..\..\..\..\libntp\atouint.c" />
+ <ClCompile Include="..\..\..\..\libntp\audio.c" />
+ <ClCompile Include="..\..\..\..\libntp\authkeys.c" />
+ <ClCompile Include="..\..\..\..\libntp\authreadkeys.c" />
+ <ClCompile Include="..\..\..\..\libntp\authusekey.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\backtrace-emptytbl.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\backtrace.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\buffer.c" />
+ <ClCompile Include="..\..\..\..\libntp\buftvtots.c" />
+ <ClCompile Include="..\..\..\..\libntp\caljulian.c" />
+ <ClCompile Include="..\..\..\..\libntp\caltontp.c" />
+ <ClCompile Include="..\..\..\..\libntp\calyearstart.c" />
+ <ClCompile Include="..\..\..\..\libntp\clocktime.c" />
+ <ClCompile Include="..\..\..\..\libntp\clocktypes.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\sha1.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\condition.c" />
+ <ClCompile Include="..\..\..\..\libntp\decodenetnum.c" />
+ <ClCompile Include="..\..\..\..\libntp\dofptoa.c" />
+ <ClCompile Include="..\..\..\..\libntp\dolfptoa.c" />
+ <ClCompile Include="..\..\..\..\libntp\emalloc.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\error.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\event.c" />
+ <ClCompile Include="..\..\..\..\libntp\findconfig.c" />
+ <ClCompile Include="..\..\libntp\getclock.c" />
+ <ClCompile Include="..\..\..\..\libntp\getopt.c" />
+ <ClCompile Include="..\..\..\..\libntp\hextoint.c" />
+ <ClCompile Include="..\..\..\..\libntp\hextolfp.c" />
+ <ClCompile Include="..\..\..\..\libntp\humandate.c" />
+ <ClCompile Include="..\..\..\..\libntp\icom.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\inet_aton.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\inet_ntop.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\inet_pton.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\interfaceiter.c" />
+ <ClCompile Include="..\..\..\..\libntp\iosignal.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\lib.c" />
+ <ClCompile Include="..\..\..\..\libntp\lib_strbuf.c" />
+ <ClCompile Include="..\..\..\..\sntp\libopts\libopts.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\log.c" />
+ <ClCompile Include="..\..\..\..\libntp\machines.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\md5.c" />
+ <ClCompile Include="..\..\..\..\libntp\mktime.c" />
+ <ClCompile Include="..\..\..\..\libntp\modetoa.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\nls\msgcat.c" />
+ <ClCompile Include="..\..\..\..\libntp\mstolfp.c" />
+ <ClCompile Include="..\..\..\..\libntp\msyslog.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\net.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\netaddr.c" />
+ <ClCompile Include="..\..\..\..\libntp\netof.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\netscope.c" />
+ <ClCompile Include="..\..\..\..\libntp\ntp_calendar.c" />
+ <ClCompile Include="..\..\..\..\libntp\ntp_intres.c" />
+ <ClCompile Include="..\..\..\..\libntp\ntp_libopts.c" />
+ <ClCompile Include="..\..\..\..\libntp\ntp_lineedit.c" />
+ <ClCompile Include="..\..\..\..\libntp\ntp_random.c" />
+ <ClCompile Include="..\..\..\..\libntp\ntp_rfc2553.c" />
+ <ClCompile Include="..\..\..\..\libntp\ntp_worker.c" />
+ <ClCompile Include="..\..\..\..\libntp\numtoa.c" />
+ <ClCompile Include="..\..\..\..\libntp\numtohost.c" />
+ <ClCompile Include="..\..\..\..\libntp\octtoint.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\once.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\ondestroy.c" />
+ <ClCompile Include="..\..\..\..\libntp\prettydate.c" />
+ <ClCompile Include="..\..\libntp\randfile.c" />
+ <ClCompile Include="..\..\..\..\libntp\recvbuff.c" />
+ <ClCompile Include="..\..\..\..\libntp\refnumtoa.c" />
+ <ClCompile Include="..\..\libntp\setpriority.c" />
+ <ClCompile Include="..\..\libntp\SetSystemTime.c" />
+ <ClCompile Include="..\..\..\..\libntp\snprintf.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\sockaddr.c" />
+ <ClCompile Include="..\..\..\..\libntp\socket.c" />
+ <ClCompile Include="..\..\..\..\libntp\socktoa.c" />
+ <ClCompile Include="..\..\..\..\libntp\socktohost.c" />
+ <ClCompile Include="..\..\..\..\libntp\ssl_init.c" />
+ <ClCompile Include="..\..\..\..\libntp\statestr.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\stdtime.c" />
+ <ClCompile Include="..\..\..\..\libntp\strdup.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\strerror.c" />
+ <ClCompile Include="..\..\..\..\libntp\strl_obsd.c" />
+ <ClCompile Include="..\..\libntp\syslog.c" />
+ <ClCompile Include="..\..\..\..\libntp\syssignal.c" />
+ <ClCompile Include="..\..\..\..\libntp\systime.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\task.c" />
+ <ClCompile Include="..\..\libntp\termios.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\thread.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\time.c" />
+ <ClCompile Include="..\..\..\..\libntp\timetoa.c" />
+ <ClCompile Include="..\..\..\..\libntp\timevalops.c" />
+ <ClCompile Include="..\..\..\..\libntp\uglydate.c" />
+ <ClCompile Include="..\..\libntp\util_clockstuff.c" />
+ <ClCompile Include="..\..\libntp\win32_io.c" />
+ <ClCompile Include="..\..\..\..\lib\isc\win32\win32os.c" />
+ <ClCompile Include="..\..\..\..\libntp\work_fork.c" />
+ <ClCompile Include="..\..\..\..\libntp\work_thread.c" />
+ <ClCompile Include="..\..\..\..\libntp\ymd2yd.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\include\vint64ops.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\sha1.h" />
+ <ClInclude Include="..\..\..\..\sntp\libopts\ag-char-map.h" />
+ <ClInclude Include="..\..\..\..\include\binio.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\buffer.h" />
+ <ClInclude Include="..\..\include\clockstuff.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\condition.h" />
+ <ClInclude Include="..\..\include\config.h" />
+ <ClInclude Include="..\..\..\..\include\declcond.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\event.h" />
+ <ClInclude Include="..\..\include\gaa_compat.h" />
+ <ClInclude Include="..\..\..\..\include\global.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\hash.h" />
+ <ClInclude Include="..\..\..\..\include\ieee754io.h" />
+ <ClInclude Include="..\..\include\netinet\in.h" />
+ <ClInclude Include="..\..\include\arpa\inet.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\interfaceiter.h" />
+ <ClInclude Include="..\..\..\..\include\intreswork.h" />
+ <ClInclude Include="..\..\include\sys\ioctl.h" />
+ <ClInclude Include="..\..\..\..\include\iosignal.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\ipv6.h" />
+ <ClInclude Include="..\..\..\..\include\l_stdlib.h" />
+ <ClInclude Include="..\..\..\..\include\lib_strbuf.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\log.h" />
+ <ClInclude Include="..\..\..\..\include\md5.h" />
+ <ClInclude Include="..\..\..\..\include\isc\mem.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\mutex.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\net.h" />
+ <ClInclude Include="..\..\..\..\include\isc\netaddr.h" />
+ <ClInclude Include="..\..\include\netdb.h" />
+ <ClInclude Include="..\..\..\..\include\isc\netscope.h" />
+ <ClInclude Include="..\..\..\..\include\ntp.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_assert.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_calendar.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_control.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_debug.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_fp.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_if.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_intres.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_io.h" />
+ <ClInclude Include="..\..\include\ntp_iocompletionport.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_libopts.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_lineedit.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_lists.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_malloc.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_md5.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_net.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_proto.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_random.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_refclock.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_rfc2553.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_select.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_string.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h" />
+ <ClInclude Include="..\..\include\ntp_timer.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_types.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_unixtime.h" />
+ <ClInclude Include="..\..\..\..\include\ntpd.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\ondestroy.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\platform.h" />
+ <ClInclude Include="..\..\..\..\include\recvbuff.h" />
+ <ClInclude Include="..\..\include\sys\resource.h" />
+ <ClInclude Include="..\..\include\sys\signal.h" />
+ <ClInclude Include="..\..\include\sys\socket.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\stat.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\stdtime.h" />
+ <ClInclude Include="..\..\include\syslog.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\task.h" />
+ <ClInclude Include="..\..\include\termios.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\thread.h" />
+ <ClInclude Include="..\..\include\sys\time.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\time.h" />
+ <ClInclude Include="..\..\..\..\include\timespecops.h" />
+ <ClInclude Include="..\..\..\..\include\timetoa.h" />
+ <ClInclude Include="..\..\..\..\include\timevalops.h" />
+ <ClInclude Include="..\..\include\win32_io.h" />
+ <ClInclude Include="..\..\include\isc\win32os.h" />
+ <ClInclude Include="..\..\libntp\messages.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\libntp\messages.mc">
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Message Compiler</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">Message Compiler</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Message Compiler</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">Message Compiler</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Message Compiler</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">Message Compiler</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Message Compiler</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">Message Compiler</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">mc -h %(RootDir)%(Directory) -r %(RootDir)%(Directory) -e h %(FullPath)
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">%(RootDir)%(Directory)%(Filename).rc;%(RootDir)%(Directory)%(Filename).h;%(RootDir)%(Directory)msg00001.bin;%(Outputs)</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/libntp/libntp.vcxproj.filters b/ports/winnt/vs2013/libntp/libntp.vcxproj.filters
new file mode 100644
index 0000000..4eefad7
--- /dev/null
+++ b/ports/winnt/vs2013/libntp/libntp.vcxproj.filters
@@ -0,0 +1,568 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{df2922e3-313f-4661-9019-a88cb5be1bee}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{70e10793-da6a-4bfe-b35a-c00a64ac61bc}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Generated Files">
+ <UniqueIdentifier>{6452d330-e63a-473c-bd9f-1874d4061592}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{fc799aa8-add1-4e83-8dff-de647477bf79}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\libntp\a_md5encrypt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\adjtime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\assertions.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\atoint.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\atolfp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\atouint.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\audio.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\authkeys.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\authreadkeys.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\authusekey.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\backtrace-emptytbl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\backtrace.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\buffer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\buftvtots.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\caljulian.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\caltontp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\calyearstart.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\clocktime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\clocktypes.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\condition.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\decodenetnum.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\dofptoa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\dolfptoa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\emalloc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\error.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\event.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\findconfig.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\getclock.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\getopt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\hextoint.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\hextolfp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\humandate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\icom.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\inet_aton.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\inet_ntop.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\inet_pton.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\interfaceiter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\iosignal.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\lib.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\lib_strbuf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\sntp\libopts\libopts.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\log.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\machines.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\md5.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\mktime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\modetoa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\nls\msgcat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\mstolfp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\msyslog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\net.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\netaddr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\netof.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\netscope.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ntp_calendar.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ntp_intres.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ntp_libopts.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ntp_lineedit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ntp_random.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ntp_rfc2553.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ntp_worker.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\numtoa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\numtohost.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\octtoint.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\once.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\ondestroy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\prettydate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\randfile.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\recvbuff.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\refnumtoa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\setpriority.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\SetSystemTime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\snprintf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\sockaddr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\socket.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\socktoa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\socktohost.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ssl_init.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\statestr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\stdtime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\strdup.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\strerror.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\strl_obsd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\syslog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\syssignal.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\systime.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\task.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\termios.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\thread.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\time.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\timetoa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\timevalops.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\uglydate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\util_clockstuff.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\libntp\win32_io.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\win32\win32os.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\work_fork.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\work_thread.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\ymd2yd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\lib\isc\sha1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libntp\vint64ops.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\sntp\libopts\ag-char-map.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\binio.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\buffer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\clockstuff.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\condition.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\declcond.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\event.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\gaa_compat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\global.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\hash.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ieee754io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\netinet\in.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\arpa\inet.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\interfaceiter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\intreswork.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\ioctl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\iosignal.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\ipv6.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\l_stdlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\lib_strbuf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\log.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\md5.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\isc\mem.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\mutex.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\isc\netaddr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\netdb.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\isc\netscope.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_assert.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_calendar.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_control.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_debug.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_fp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_if.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_intres.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\ntp_iocompletionport.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_libopts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_lineedit.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_lists.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_malloc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_md5.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_proto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_random.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_refclock.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_rfc2553.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_select.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_string.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\ntp_timer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_types.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_unixtime.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntpd.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\ondestroy.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\platform.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\recvbuff.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\signal.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\socket.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\stat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\stdtime.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\syslog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\task.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\termios.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\thread.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\time.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\time.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\timespecops.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\timetoa.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\timevalops.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\win32_io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\isc\win32os.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\libntp\messages.h">
+ <Filter>Generated Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\sha1.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\vint64ops.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\libntp\messages.mc">
+ <Filter>Resource Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj b/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj
new file mode 100644
index 0000000..e306108
--- /dev/null
+++ b/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcproj
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="loopback-ppsapi-provider"
+ ProjectGUID="{1ACE209D-D56E-450B-8711-B73E4ACFC38E}"
+ RootNamespace="loopbackerialppsapiprovider"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include"
+ PreprocessorDefinitions="SYS_WINNT"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough="serialpps-ppsapi-provider.h"
+ AssemblerListingLocation="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)loopback-ppsapi-provider-vc90"
+ BrowseInformation="1"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ntpd.lib"
+ OutputFile="$(OutDir)$(ProjectName).dll"
+ Version="0x0400"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="$(OutDir)"
+ GenerateManifest="false"
+ ModuleDefinitionFile="..\..\ppsapi\loopback\src\loopback-ppsapi.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include"
+ PreprocessorDefinitions="SYS_WINNT"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough="serialpps-ppsapi-provider.h"
+ AssemblerListingLocation="$(IntDir)\"
+ ProgramDataBaseFileName="$(OutDir)loopback-ppsapi-provider-vc90"
+ BrowseInformation="1"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ntpd.lib"
+ OutputFile="$(OutDir)$(ProjectName).dll"
+ Version="0x0400"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="$(OutDir)"
+ GenerateManifest="false"
+ ModuleDefinitionFile="..\..\ppsapi\loopback\src\loopback-ppsapi.def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ <ProjectReference
+ ReferencedProjectIdentifier="{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}"
+ CopyLocal="false"
+ CopyLocalDependencies="false"
+ CopyLocalSatelliteAssemblies="false"
+ RelativePathToProject=".\libntp\libntp.vcproj"
+ />
+ <ProjectReference
+ ReferencedProjectIdentifier="{CB61F8BF-9637-495C-9087-E8664B400CE0}"
+ CopyLocal="false"
+ CopyLocalDependencies="false"
+ CopyLocalSatelliteAssemblies="false"
+ RelativePathToProject=".\ntpd\ntpd.vcproj"
+ />
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\loopback-ppsapi.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\loopback-ppsapi.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\sys\time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ppsapi\loopback\src\timepps.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj b/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj
new file mode 100644
index 0000000..a5ba8aa
--- /dev/null
+++ b/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj
@@ -0,0 +1,583 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{1ACE209D-D56E-450B-8711-B73E4ACFC38E}</ProjectGuid>
+ <RootNamespace>loopbackerialppsapiprovider</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SYS_WINNT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <PrecompiledHeaderFile>serialpps-ppsapi-provider.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ProgramDataBaseFileName>$(OutDir)loopback-ppsapi-provider-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ntpd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <Version>
+ </Version>
+ <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ModuleDefinitionFile>..\..\ppsapi\loopback\src\loopback-ppsapi.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libntp\libntp.vcxproj">
+ <Project>{400fbfcb-462e-40d0-b06b-3b74e3fffd00}</Project>
+ <Private>false</Private>
+ <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
+ <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\ntpd\ntpd.vcxproj">
+ <Project>{cb61f8bf-9637-495c-9087-e8664b400ce0}</Project>
+ <Private>false</Private>
+ <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
+ <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\ppsapi\loopback\src\loopback-ppsapi.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\ppsapi\loopback\src\loopback-ppsapi.h" />
+ <ClInclude Include="..\..\ppsapi\loopback\src\sys\time.h" />
+ <ClInclude Include="..\..\ppsapi\loopback\src\timepps.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters b/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters
new file mode 100644
index 0000000..135f4eb
--- /dev/null
+++ b/ports/winnt/vs2013/loopback-pps/loopback-ppsapi-provider.vcxproj.filters
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\ppsapi\loopback\src\loopback-ppsapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\ppsapi\loopback\src\loopback-ppsapi.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ppsapi\loopback\src\sys\time.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\ppsapi\loopback\src\timepps.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj b/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj
new file mode 100644
index 0000000..6bf76fe
--- /dev/null
+++ b/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcproj
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntp-keygen"
+ ProjectGUID="{C88C1FBF-59D2-447F-BF57-0BCA8889028F}"
+ RootNamespace="ntp-keygen"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntp-keygen.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntp-keygen,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ SmallerTypeCheck="true"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntp-keygen.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntp-keygen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntp-keygen.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\ntp-keygen,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntp-keygen.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntp-keygen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\util\ntp-keygen-opts.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\util\ntp-keygen.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntp-keygen&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntp-keygen&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj b/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj
new file mode 100644
index 0000000..21a2675
--- /dev/null
+++ b/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj
@@ -0,0 +1,752 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C88C1FBF-59D2-447F-BF57-0BCA8889028F}</ProjectGuid>
+ <RootNamespace>ntp-keygen</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntp-keygen.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntp-keygen;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntp-keygen.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntp-keygen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\util\ntp-keygen-opts.c">
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">Level3</WarningLevel>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\util\ntp-keygen.c" />
+ <ClCompile Include="version.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\config.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntp-keygen
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libntp\libntp.vcxproj">
+ <Project>{400fbfcb-462e-40d0-b06b-3b74e3fffd00}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters b/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters
new file mode 100644
index 0000000..4fba551
--- /dev/null
+++ b/ports/winnt/vs2013/ntp-keygen/ntp-keygen.vcxproj.filters
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{f11f7756-c1fa-4353-8941-89cc81be5e02}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{e01d2f25-84af-473d-bb5a-57991927813b}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{8fcd5bab-1f17-4bd9-93a5-33c7eac5b745}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\util\ntp-keygen-opts.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\util\ntp-keygen.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="version.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntp.sln b/ports/winnt/vs2013/ntp.sln
new file mode 100644
index 0000000..e28828f
--- /dev/null
+++ b/ports/winnt/vs2013/ntp.sln
@@ -0,0 +1,166 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.30219.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd", "ntpd\ntpd.vcxproj", "{CB61F8BF-9637-495C-9087-E8664B400CE0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instsrv", "instsrv\instsrv.vcxproj", "{C3534C4D-6DF1-498E-9904-4337878A1515}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libntp", "libntp\libntp.vcxproj", "{400FBFCB-462E-40D0-B06B-3B74E3FFFD00}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdate", "ntpdate\ntpdate.vcxproj", "{2789A62E-3F46-44F1-AAF0-816CD23C2911}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpdc", "ntpdc\ntpdc.vcxproj", "{8011C820-B3D5-4034-86EA-FFC30AE6764B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntp-keygen", "ntp-keygen\ntp-keygen.vcxproj", "{C88C1FBF-59D2-447F-BF57-0BCA8889028F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpq", "ntpq\ntpq.vcxproj", "{6A92BF14-8931-48B1-A571-DEBE9F190616}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ntpd-keyword-gen", "ntpd-keyword-gen\ntpd-keyword-gen.vcxproj", "{1B814CC1-EAD4-4A13-B29C-A67B23C9845A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopback-ppsapi-provider", "loopback-pps\loopback-ppsapi-provider.vcxproj", "{1ACE209D-D56E-450B-8711-B73E4ACFC38E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug XP|Win32 = Debug XP|Win32
+ Debug XP|x64 = Debug XP|x64
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release XP|Win32 = Release XP|Win32
+ Release XP|x64 = Release XP|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|Win32.Build.0 = Debug|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|x64.ActiveCfg = Debug|x64
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Debug|x64.Build.0 = Debug|x64
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release XP|Win32.Build.0 = Release XP|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release XP|x64.ActiveCfg = Release XP|x64
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|Win32.ActiveCfg = Release|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|Win32.Build.0 = Release|Win32
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|x64.ActiveCfg = Release|x64
+ {CB61F8BF-9637-495C-9087-E8664B400CE0}.Release|x64.Build.0 = Release|x64
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|Win32.Build.0 = Debug|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|x64.ActiveCfg = Debug|x64
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Debug|x64.Build.0 = Debug|x64
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release XP|Win32.Build.0 = Release XP|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release XP|x64.ActiveCfg = Release XP|x64
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release|Win32.ActiveCfg = Release|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release|Win32.Build.0 = Release|Win32
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release|x64.ActiveCfg = Release|x64
+ {C3534C4D-6DF1-498E-9904-4337878A1515}.Release|x64.Build.0 = Release|x64
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|Win32.ActiveCfg = Debug|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|Win32.Build.0 = Debug|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|x64.ActiveCfg = Debug|x64
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Debug|x64.Build.0 = Debug|x64
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release XP|Win32.Build.0 = Release XP|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release XP|x64.ActiveCfg = Release XP|x64
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|Win32.ActiveCfg = Release|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|Win32.Build.0 = Release|Win32
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|x64.ActiveCfg = Release|x64
+ {400FBFCB-462E-40D0-B06B-3B74E3FFFD00}.Release|x64.Build.0 = Release|x64
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|Win32.Build.0 = Debug|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|x64.ActiveCfg = Debug|x64
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Debug|x64.Build.0 = Debug|x64
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release XP|Win32.Build.0 = Release XP|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release XP|x64.ActiveCfg = Release XP|x64
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|Win32.ActiveCfg = Release|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|Win32.Build.0 = Release|Win32
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|x64.ActiveCfg = Release|x64
+ {2789A62E-3F46-44F1-AAF0-816CD23C2911}.Release|x64.Build.0 = Release|x64
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|Win32.Build.0 = Debug|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|x64.ActiveCfg = Debug|x64
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Debug|x64.Build.0 = Debug|x64
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release XP|Win32.Build.0 = Release XP|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release XP|x64.ActiveCfg = Release XP|x64
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|Win32.ActiveCfg = Release|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|Win32.Build.0 = Release|Win32
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|x64.ActiveCfg = Release|x64
+ {8011C820-B3D5-4034-86EA-FFC30AE6764B}.Release|x64.Build.0 = Release|x64
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|Win32.Build.0 = Debug|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|x64.ActiveCfg = Debug|x64
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Debug|x64.Build.0 = Debug|x64
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release XP|Win32.Build.0 = Release XP|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release XP|x64.ActiveCfg = Release XP|x64
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|Win32.ActiveCfg = Release|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|Win32.Build.0 = Release|Win32
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|x64.ActiveCfg = Release|x64
+ {C88C1FBF-59D2-447F-BF57-0BCA8889028F}.Release|x64.Build.0 = Release|x64
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|Win32.Build.0 = Debug|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|x64.ActiveCfg = Debug|x64
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Debug|x64.Build.0 = Debug|x64
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release XP|Win32.Build.0 = Release XP|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release XP|x64.ActiveCfg = Release XP|x64
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|Win32.ActiveCfg = Release|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|Win32.Build.0 = Release|Win32
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|x64.ActiveCfg = Release|x64
+ {6A92BF14-8931-48B1-A571-DEBE9F190616}.Release|x64.Build.0 = Release|x64
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug|Win32.Build.0 = Debug|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug|x64.ActiveCfg = Debug|x64
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Debug|x64.Build.0 = Debug|x64
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release XP|Win32.Build.0 = Release XP|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release XP|x64.ActiveCfg = Release XP|x64
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release|Win32.ActiveCfg = Release|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release|Win32.Build.0 = Release|Win32
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release|x64.ActiveCfg = Release|x64
+ {1B814CC1-EAD4-4A13-B29C-A67B23C9845A}.Release|x64.Build.0 = Release|x64
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug XP|Win32.ActiveCfg = Debug XP|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug XP|Win32.Build.0 = Debug XP|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug XP|x64.ActiveCfg = Debug XP|x64
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug|Win32.Build.0 = Debug|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug|x64.ActiveCfg = Debug|x64
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Debug|x64.Build.0 = Debug|x64
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release XP|Win32.ActiveCfg = Release XP|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release XP|Win32.Build.0 = Release XP|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release XP|x64.ActiveCfg = Release XP|x64
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release|Win32.ActiveCfg = Release|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release|Win32.Build.0 = Release|Win32
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release|x64.ActiveCfg = Release|x64
+ {1ACE209D-D56E-450B-8711-B73E4ACFC38E}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj b/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj
new file mode 100644
index 0000000..9a309d2
--- /dev/null
+++ b/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcproj
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpd-keyword-gen"
+ ProjectGUID="{1B814CC1-EAD4-4A13-B29C-A67B23C9845A}"
+ RootNamespace="ntpdkeywordgen"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ SmallerTypeCheck="true"
+ RuntimeLibrary="1"
+ EnableFunctionLevelLinking="true"
+ ProgramDataBaseFileName="$(OutDir)keyword-gen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)keyword-gen.exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)keywordgen.pdb"
+ RandomizedBaseAddress="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\libopts"
+ PreprocessorDefinitions="_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ ProgramDataBaseFileName="$(OutDir)keyword-gen-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)keyword-gen.exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)keywordgen.pdb"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpd\keyword-gen.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\lib_strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_scanner.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_types.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj b/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj
new file mode 100644
index 0000000..979ceb1
--- /dev/null
+++ b/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj
@@ -0,0 +1,531 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{1B814CC1-EAD4-4A13-B29C-A67B23C9845A}</ProjectGuid>
+ <RootNamespace>ntpdkeywordgen</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <ProgramDataBaseFileName>$(OutDir)keyword-gen-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)keyword-gen.exe</OutputFile>
+ <Version>
+ </Version>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)keywordgen.pdb</ProgramDatabaseFile>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpd\keyword-gen.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\config.h" />
+ <ClInclude Include="..\..\..\..\include\l_stdlib.h" />
+ <ClInclude Include="..\..\..\..\include\lib_strbuf.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\net.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_config.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_net.h" />
+ <ClInclude Include="..\..\..\..\ntpd\ntp_parser.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_proto.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_rfc2553.h" />
+ <ClInclude Include="..\..\..\..\ntpd\ntp_scanner.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_string.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_types.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libntp\libntp.vcxproj">
+ <Project>{400fbfcb-462e-40d0-b06b-3b74e3fffd00}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters b/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters
new file mode 100644
index 0000000..44b5167
--- /dev/null
+++ b/ports/winnt/vs2013/ntpd-keyword-gen/ntpd-keyword-gen.vcxproj.filters
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpd\keyword-gen.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\l_stdlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\lib_strbuf.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\ntp_parser.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_proto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_rfc2553.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\ntp_scanner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_string.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_types.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat b/ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat
new file mode 100644
index 0000000..3013b8f
--- /dev/null
+++ b/ports/winnt/vs2013/ntpd/gen-ntp_keyword.bat
@@ -0,0 +1,39 @@
+@echo off
+REM gen-ntp_keyword.bat
+REM helper to invoke keyword-gen and possibly update ntp_keyword.h
+REM Usage:
+REM gen-ntp_keyword dir_containing_keyword-gen.exe
+REM
+if "%1"=="" goto Usage
+if not exist %1\keyword-gen.exe goto ExeNotFound
+%1\keyword-gen.exe ..\..\..\..\ntpd\ntp_parser.h > new_keyword.h
+findstr /v diff_ignore_line new_keyword.h > new_keyword_cmp.h
+findstr /v diff_ignore_line ..\..\..\..\ntpd\ntp_keyword.h > ntp_keyword_cmp.h
+set meat_changed=0
+fc /L ntp_keyword_cmp.h new_keyword_cmp.h > NUL
+if errorlevel 1 set meat_changed=1
+del ntp_keyword_cmp.h new_keyword_cmp.h
+if "0"=="%meat_changed%" goto SkipUpdate
+xcopy /yf new_keyword.h ..\..\..\..\ntpd\ntp_keyword.h
+findstr diff_ignore_line new_keyword.h > ..\..\..\..\ntpd\keyword-gen-utd
+echo updated keyword-gen-utd and ntp_keyword.h
+goto SkipSkipMsg
+
+:skipUpdate
+echo ntp_keyword.h is unchanged
+
+:SkipSkipMsg
+set meat_changed=
+del new_keyword.h
+goto Exit
+
+:Usage
+echo Usage:
+echo gen-ntp_keyword dir_containing_keyword-gen.exe
+goto Exit
+
+:ExeNotFound
+echo keyword-gen.exe not found at %1\keyword-gen.exe
+goto Exit
+
+:Exit
diff --git a/ports/winnt/vs2013/ntpd/ntpd.vcproj b/ports/winnt/vs2013/ntpd/ntpd.vcproj
new file mode 100644
index 0000000..3dfcfe4
--- /dev/null
+++ b/ports/winnt/vs2013/ntpd/ntpd.vcproj
@@ -0,0 +1,1126 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="ntpd"
+ ProjectGUID="{CB61F8BF-9637-495C-9087-E8664B400CE0}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpd.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="false"
+ PrecompiledHeaderFile="$(IntDir)ntpd.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpd-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpd.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\ntpd,..\..\..\..\ntpd,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ SmallerTypeCheck="true"
+ RuntimeLibrary="1"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpd.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpd-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib winmm.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ OptimizeForWindows98="0"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpd\cmd_args.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\keyword-gen.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\ntpd\nt_clockstuff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_config.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_control.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_crypto.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_filegen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ntpd\ntp_iocompletionport.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_leapsec.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_loopfilter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_monitor.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.y"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_peer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_proto.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_refclock.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_request.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_restrict.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_scanner.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_signd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_timer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_util.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpd-opts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpsim.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\ntpd\ntservice.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\include\ascii.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\assertions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\binio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\boolean.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\clockstuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\declcond.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\hopf_PCI_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ieee754io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netinet\in.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\arpa\inet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\int.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\interfaceiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\iosignal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\win32\include\isc\ipv6.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\jupiter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\l_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\libntp\log.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\mbg_gps166.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\netaddr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\netdb.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_assert.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_calendar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_cmdargs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_control.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_debug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_filegen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_if.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_iocompletionport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_keyword.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_leapsec.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_libopts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lists.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_malloc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_parser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_proto.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_random.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_refclock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_request.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_rfc2553.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_scanner.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntp_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_tty.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_worker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_workimpl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntpd-opts.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntpd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntpsim.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\ntservice.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\offset.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\sntp\libopts\autoopts\options.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\param.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\recvbuff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_palisade.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\lib\isc\include\isc\result.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\termios.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\timepps.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timespecops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\timevalops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\sys\wait.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\win32_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\win32os.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Generated Files"
+ >
+ <File
+ RelativePath="..\..\libntp\messages.rc"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ AdditionalIncludeDirectories="..\libntp"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ AdditionalIncludeDirectories="..\libntp"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\libntp\MSG00001.bin"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\ntp_keyword.h"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h"
+ CommandLine=".\gen-ntp_keyword $(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\ntpd\ntp_parser.h"
+ Outputs="..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h"
+ CommandLine=".\gen-ntp_keyword $(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\..\..\ntpd\ntp_parser.h"
+ Outputs="..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ ShowIncludes="true"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="..\libntp\messages.mc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Reference Clock"
+ >
+ <File
+ RelativePath="..\..\ntpd\hopf_PCI_io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_acts.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_arbiter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_arc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_as2201.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_atom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_bancomm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_chronolog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_chu.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_conf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_datum.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_dumbclock.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_fg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_gpsvme.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_heath.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_hopfpci.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_hopfser.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_hpgps.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_irig.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_jjy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_jupiter.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_leitch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_local.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_msfees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_mx4200.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_neoclock4x.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_nmea.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_oncore.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_palisade.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_pcf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_pst.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_ripencc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_shm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_tpro.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_true.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_tsyncpci.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_tt560.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_ulink.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_wwv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_wwvb.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpd\refclock_zyfer.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Parse Lib"
+ >
+ <File
+ RelativePath="..\..\..\..\libparse\binio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_computime.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_dcf7000.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_hopf6021.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_meinberg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_rawdcf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_rcc8000.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_schmid.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_trimtaip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_trimtsip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_varitext.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\clk_wharton.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\data_mbg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\gpstolfp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\ieee754io.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\info_trimble.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\mfp_mul.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parse_conf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parsesolaris.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\parsestreams.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\libparse\trim_info.c"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\scripts\mkver.bat"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpd&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\scripts\mkver.bat;..\..\include\config.h"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpd&#x0D;&#x0A;"
+ AdditionalDependencies="..\..\scripts\mkver.bat;..\..\include\config.h"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/ntpd/ntpd.vcxproj b/ports/winnt/vs2013/ntpd/ntpd.vcxproj
new file mode 100644
index 0000000..50c9cd9
--- /dev/null
+++ b/ports/winnt/vs2013/ntpd/ntpd.vcxproj
@@ -0,0 +1,1036 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{CB61F8BF-9637-495C-9087-E8664B400CE0}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpd.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpd;..\..\..\..\ntpd;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpd.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpd-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;winmm.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpd\cmd_args.c" />
+ <ClCompile Include="..\..\..\..\ntpd\keyword-gen.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\ntpd\nt_clockstuff.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_config.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_control.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_crypto.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_filegen.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_io.c" />
+ <ClCompile Include="..\..\ntpd\ntp_iocompletionport.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_leapsec.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_loopfilter.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_monitor.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_parser.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_peer.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_proto.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_refclock.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_request.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_restrict.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_scanner.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_signd.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_timer.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntp_util.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntpd-opts.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntpd.c" />
+ <ClCompile Include="..\..\..\..\ntpd\ntpsim.c" />
+ <ClCompile Include="..\..\ntpd\ntservice.c" />
+ <ClCompile Include="version.c">
+ <ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ShowIncludes>
+ <ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">true</ShowIncludes>
+ <ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ShowIncludes>
+ <ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">true</ShowIncludes>
+ </ClCompile>
+ <ClCompile Include="..\..\ntpd\hopf_PCI_io.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_acts.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_arbiter.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_arc.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_as2201.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_atom.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_bancomm.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_chronolog.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_chu.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_conf.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_datum.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_dumbclock.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_fg.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_gpsvme.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_heath.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_hopfpci.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_hopfser.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_hpgps.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_irig.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_jjy.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_jupiter.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_leitch.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_local.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_msfees.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_mx4200.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_neoclock4x.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_nmea.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_oncore.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_palisade.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_parse.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_pcf.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_pst.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_ripencc.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_shm.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_tpro.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_true.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_tsyncpci.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_tt560.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_ulink.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_wwv.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_wwvb.c" />
+ <ClCompile Include="..\..\..\..\ntpd\refclock_zyfer.c" />
+ <ClCompile Include="..\..\..\..\libparse\binio.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_computime.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_dcf7000.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_hopf6021.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_meinberg.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_rawdcf.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_rcc8000.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_schmid.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_trimtaip.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_trimtsip.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_varitext.c" />
+ <ClCompile Include="..\..\..\..\libparse\clk_wharton.c" />
+ <ClCompile Include="..\..\..\..\libparse\data_mbg.c" />
+ <ClCompile Include="..\..\..\..\libparse\gpstolfp.c" />
+ <ClCompile Include="..\..\..\..\libparse\ieee754io.c" />
+ <ClCompile Include="..\..\..\..\libparse\info_trimble.c" />
+ <ClCompile Include="..\..\..\..\libparse\mfp_mul.c" />
+ <ClCompile Include="..\..\..\..\libparse\parse.c" />
+ <ClCompile Include="..\..\..\..\libparse\parse_conf.c" />
+ <ClCompile Include="..\..\..\..\libparse\parsesolaris.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\parsestreams.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\trim_info.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\ntpd\ntp_parser.y">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">true</ExcludedFromBuild>
+ </CustomBuild>
+ <None Include="..\..\libntp\MSG00001.bin" />
+ <None Include="..\libntp\messages.mc" />
+ <CustomBuild Include="..\..\scripts\mkver.bat">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">true</ExcludedFromBuild>
+ </CustomBuild>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpd
+</Command>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">..\..\scripts\mkver.bat;..\..\include\config.h;%(AdditionalInputs)</AdditionalInputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\include\ascii.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\assertions.h" />
+ <ClInclude Include="..\..\..\..\include\binio.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\boolean.h" />
+ <ClInclude Include="..\..\include\clockstuff.h" />
+ <ClInclude Include="..\..\include\config.h" />
+ <ClInclude Include="..\..\..\..\ntpd\declcond.h" />
+ <ClInclude Include="..\..\include\hopf_PCI_io.h" />
+ <ClInclude Include="..\..\..\..\include\ieee754io.h" />
+ <ClInclude Include="..\..\include\netinet\in.h" />
+ <ClInclude Include="..\..\include\arpa\inet.h" />
+ <ClInclude Include="..\..\include\isc\int.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\interfaceiter.h" />
+ <ClInclude Include="..\..\..\..\include\iosignal.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\ipv6.h" />
+ <ClInclude Include="..\..\..\..\ntpd\jupiter.h" />
+ <ClInclude Include="..\..\..\..\include\l_stdlib.h" />
+ <ClInclude Include="..\..\..\libntp\log.h" />
+ <ClInclude Include="..\..\..\..\include\mbg_gps166.h" />
+ <ClInclude Include="..\..\include\isc\net.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\netaddr.h" />
+ <ClInclude Include="..\..\include\netdb.h" />
+ <ClInclude Include="..\..\..\..\include\ntp.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_assert.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_calendar.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_cmdargs.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_config.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_control.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_debug.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_filegen.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_fp.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_if.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_io.h" />
+ <ClInclude Include="..\..\include\ntp_iocompletionport.h" />
+ <CustomBuild Include="..\..\..\..\ntpd\ntp_keyword.h">
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">invoking keyword-gen on ntp_parser.h to produce ntp_keyword.h</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">.\gen-ntp_keyword $(SolutionDir)$(Platform)-tmp\$(Configuration)
+</Command>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">..\..\..\..\ntpd\ntp_parser.h;%(AdditionalInputs)</AdditionalInputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">..\..\..\..\ntpd\ntp_keyword.h ..\..\..\..\ntpd\keyword-gen-utd;%(Outputs)</Outputs>
+ </CustomBuild>
+ <ClInclude Include="..\..\..\..\ntpd\ntp_leapsec.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_libopts.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_lists.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_malloc.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_net.h" />
+ <ClInclude Include="..\..\..\..\ntpd\ntp_parser.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_proto.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_random.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_refclock.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_request.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_rfc2553.h" />
+ <ClInclude Include="..\..\..\..\ntpd\ntp_scanner.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_select.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_string.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h" />
+ <ClInclude Include="..\..\include\ntp_timer.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_tty.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_types.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_unixtime.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_worker.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_workimpl.h" />
+ <ClInclude Include="..\..\..\..\ntpd\ntpd-opts.h" />
+ <ClInclude Include="..\..\..\..\include\ntpd.h" />
+ <ClInclude Include="..\..\..\..\include\ntpsim.h" />
+ <ClInclude Include="..\..\include\ntservice.h" />
+ <ClInclude Include="..\..\include\isc\offset.h" />
+ <ClInclude Include="..\..\..\..\sntp\libopts\autoopts\options.h" />
+ <ClInclude Include="..\..\include\sys\param.h" />
+ <ClInclude Include="..\..\include\isc\platform.h" />
+ <ClInclude Include="..\..\..\..\include\recvbuff.h" />
+ <ClInclude Include="..\..\..\..\ntpd\refclock_palisade.h" />
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\result.h" />
+ <ClInclude Include="..\..\include\sys\socket.h" />
+ <ClInclude Include="..\..\include\syslog.h" />
+ <ClInclude Include="..\..\include\termios.h" />
+ <ClInclude Include="..\..\include\timepps.h" />
+ <ClInclude Include="..\..\..\..\include\timespecops.h" />
+ <ClInclude Include="..\..\..\..\include\timevalops.h" />
+ <ClInclude Include="..\..\include\sys\wait.h" />
+ <ClInclude Include="..\..\include\win32_io.h" />
+ <ClInclude Include="..\..\include\isc\win32os.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\..\libntp\messages.rc">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">..\libntp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libntp\libntp.vcxproj">
+ <Project>{400fbfcb-462e-40d0-b06b-3b74e3fffd00}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\ntpd-keyword-gen\ntpd-keyword-gen.vcxproj">
+ <Project>{1b814cc1-ead4-4a13-b29c-a67b23c9845a}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters b/ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters
new file mode 100644
index 0000000..c125d10
--- /dev/null
+++ b/ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters
@@ -0,0 +1,559 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{31ad5712-dbda-49a0-abf3-c24f1d3b3822}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{e8591cc7-e9b7-4fea-9747-d219a1ce73cf}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Generated Files">
+ <UniqueIdentifier>{952e91f9-804e-48f6-b49b-6b47ef88bfcb}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{12a98ad7-139f-4258-8886-ed369f10cae6}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ <Filter Include="Reference Clock">
+ <UniqueIdentifier>{ca4a4827-79af-4bbf-abbb-58d6e6e6fdc3}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Parse Lib">
+ <UniqueIdentifier>{5afb644e-b0fd-4fcb-96a3-2bac7c09a7cd}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpd\cmd_args.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\keyword-gen.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\ntpd\nt_clockstuff.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_config.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_control.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_crypto.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_filegen.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_io.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\ntpd\ntp_iocompletionport.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_leapsec.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_loopfilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_monitor.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_parser.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_peer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_proto.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_refclock.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_request.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_restrict.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_scanner.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_signd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_timer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntp_util.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntpd-opts.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntpd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\ntpsim.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\ntpd\ntservice.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="version.c">
+ <Filter>Generated Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\ntpd\hopf_PCI_io.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_acts.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_arbiter.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_arc.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_as2201.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_atom.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_bancomm.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_chronolog.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_chu.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_conf.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_datum.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_dumbclock.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_fg.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_gpsvme.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_heath.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_hopfpci.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_hopfser.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_hpgps.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_irig.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_jjy.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_jupiter.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_leitch.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_local.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_msfees.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_mx4200.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_neoclock4x.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_nmea.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_oncore.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_palisade.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_parse.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_pcf.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_pst.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_ripencc.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_shm.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_tpro.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_true.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_tsyncpci.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_tt560.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_ulink.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_wwv.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_wwvb.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpd\refclock_zyfer.c">
+ <Filter>Reference Clock</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\binio.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_computime.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_dcf7000.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_hopf6021.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_meinberg.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_rawdcf.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_rcc8000.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_schmid.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_trimtaip.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_trimtsip.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_varitext.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\clk_wharton.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\data_mbg.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\gpstolfp.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\ieee754io.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\info_trimble.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\mfp_mul.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\parse.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\parse_conf.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\parsesolaris.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\parsestreams.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\libparse\trim_info.c">
+ <Filter>Parse Lib</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\libntp\MSG00001.bin">
+ <Filter>Generated Files</Filter>
+ </None>
+ <None Include="..\libntp\messages.mc">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\include\ascii.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\assertions.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\binio.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\boolean.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\clockstuff.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\declcond.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\hopf_PCI_io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ieee754io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\netinet\in.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\arpa\inet.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\isc\int.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\interfaceiter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\iosignal.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\win32\include\isc\ipv6.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\jupiter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\l_stdlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\libntp\log.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\mbg_gps166.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\isc\net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\netaddr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\netdb.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_assert.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_calendar.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_cmdargs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_control.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_debug.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_filegen.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_fp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_if.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\ntp_iocompletionport.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\ntp_leapsec.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_libopts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_lists.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_malloc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\ntp_parser.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_proto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_random.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_refclock.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_request.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_rfc2553.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\ntp_scanner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_select.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_string.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\ntp_timer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_tty.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_types.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_unixtime.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_worker.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_workimpl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\ntpd-opts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntpd.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntpsim.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\ntservice.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\isc\offset.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\sntp\libopts\autoopts\options.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\param.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\isc\platform.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\recvbuff.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpd\refclock_palisade.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\lib\isc\include\isc\result.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\socket.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\syslog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\termios.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\timepps.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\timespecops.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\timevalops.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\sys\wait.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\win32_io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\isc\win32os.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\..\libntp\messages.rc">
+ <Filter>Generated Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\ntpd\ntp_parser.y">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\..\..\..\ntpd\ntp_keyword.h">
+ <Filter>Header Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\..\scripts\mkver.bat">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpdate/ntpdate.vcproj b/ports/winnt/vs2013/ntpdate/ntpdate.vcproj
new file mode 100644
index 0000000..85a4bef
--- /dev/null
+++ b/ports/winnt/vs2013/ntpdate/ntpdate.vcproj
@@ -0,0 +1,362 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpdate"
+ ProjectGUID="{2789A62E-3F46-44F1-AAF0-816CD23C2911}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdate.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\..\ntpdate,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC)"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntpdate.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdate-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdate.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpdate,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC)"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpdate.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdate-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpdate\ntpdate.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\include\config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\isc\net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_fp.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_io.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_machine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_net.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_stdlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_string.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_syslog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_unixtime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdate\ntpdate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\syslog.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdate&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdate&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj b/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj
new file mode 100644
index 0000000..5591fb7
--- /dev/null
+++ b/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj
@@ -0,0 +1,750 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{2789A62E-3F46-44F1-AAF0-816CD23C2911}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdate.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdate;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdate.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdate-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpdate\ntpdate.c" />
+ <ClCompile Include="version.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\config.h" />
+ <ClInclude Include="..\..\include\isc\net.h" />
+ <ClInclude Include="..\..\..\..\include\ntp.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_fp.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_io.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_net.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_select.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_string.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_unixtime.h" />
+ <ClInclude Include="..\..\..\..\ntpdate\ntpdate.h" />
+ <ClInclude Include="..\..\include\syslog.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdate
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libntp\libntp.vcxproj">
+ <Project>{400fbfcb-462e-40d0-b06b-3b74e3fffd00}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters b/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters
new file mode 100644
index 0000000..b2ec7e6
--- /dev/null
+++ b/ports/winnt/vs2013/ntpdate/ntpdate.vcxproj.filters
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{a889d71b-7d63-4e86-a764-a4075ede9e24}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{66b7a61f-7329-4b83-8b39-a15703b336bd}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{7acd1484-cc13-4187-a393-39ea3cb89649}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpdate\ntpdate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="version.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\include\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\isc\net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_fp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_io.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_machine.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_net.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_select.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_stdlib.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_string.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_syslog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_unixtime.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpdate\ntpdate.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\syslog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpdc/ntpdc.vcproj b/ports/winnt/vs2013/ntpdc/ntpdc.vcproj
new file mode 100644
index 0000000..5fd301d
--- /dev/null
+++ b/ports/winnt/vs2013/ntpdc/ntpdc.vcproj
@@ -0,0 +1,367 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpdc"
+ ProjectGUID="{8011C820-B3D5-4034-86EA-FFC30AE6764B}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdc.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpdc,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntpdc.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdc-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpdc.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\ntpdc,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpdc.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpdc-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc-opts.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc_ops.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ WarningLevel="3"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\include\ntp_assert.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\include\ntp_lineedit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpdc\ntpdc.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdc&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpdc&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj b/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj
new file mode 100644
index 0000000..a16ab05
--- /dev/null
+++ b/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj
@@ -0,0 +1,768 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{8011C820-B3D5-4034-86EA-FFC30AE6764B}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpdc.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpdc;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;__STDC__;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpdc.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpdc-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpdc\ntpdc-opts.c">
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">Level3</WarningLevel>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpdc\ntpdc.c">
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">Level3</WarningLevel>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpdc\ntpdc_ops.c">
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level3</WarningLevel>
+ <WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">Level3</WarningLevel>
+ </ClCompile>
+ <ClCompile Include="version.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\include\ntp_assert.h" />
+ <ClInclude Include="..\..\..\..\include\ntp_lineedit.h" />
+ <ClInclude Include="..\..\..\..\ntpdc\ntpdc.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpdc
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libntp\libntp.vcxproj">
+ <Project>{400fbfcb-462e-40d0-b06b-3b74e3fffd00}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters b/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters
new file mode 100644
index 0000000..8e83e76
--- /dev/null
+++ b/ports/winnt/vs2013/ntpdc/ntpdc.vcxproj.filters
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{f9cafbdf-2c38-46c2-9c83-4e177c213fd8}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{5fa1d807-8b78-4e72-b44c-d698dd579a13}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{4c7e2cb5-4dc3-4551-b0a2-11b30ecd802c}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpdc\ntpdc-opts.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpdc\ntpdc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpdc\ntpdc_ops.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="version.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\include\ntp_assert.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\include\ntp_lineedit.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpdc\ntpdc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpq/ntpq.vcproj b/ports/winnt/vs2013/ntpq/ntpq.vcproj
new file mode 100644
index 0000000..440b38b
--- /dev/null
+++ b/ports/winnt/vs2013/ntpq/ntpq.vcproj
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="ntpq"
+ ProjectGUID="{6A92BF14-8931-48B1-A571-DEBE9F190616}"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpq.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\ntpq,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile="$(IntDir)ntpq.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpq-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(PlatformName)-bin\$(ConfigurationName)\"
+ IntermediateDirectory="$(SolutionDir)$(PlatformName)-tmp\$(ConfigurationName)\$(TargetName)\"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ DeleteExtensionsOnClean="*.obj;*.ilk;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(IntDir)ntpq.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\ntpq,..\..\include,..\..\..\..\include,..\..\..\..\lib\isc\win32\include,..\..\..\..\lib\isc\include,$(OPENSSL_INC),..\..\..\..\sntp\libopts"
+ PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ MinimalRebuild="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile="$(IntDir)ntpq.pch"
+ AssemblerListingLocation="$(IntDir)"
+ ObjectFile="$(IntDir)"
+ ProgramDataBaseFileName="$(OutDir)ntpq-vc90"
+ BrowseInformation="1"
+ WarningLevel="4"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib $(OPENSSL_LIB)\libeay32.lib"
+ OutputFile="$(OutDir)$(ProjectName).exe"
+ Version="0x0400"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ GenerateManifest="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)$(ProjectName).pdb"
+ SubSystem="1"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(IntDir)/$(ProjectName).bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq-opts.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq-subs.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\version.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\..\include\ntp_lineedit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\ntpq\ntpq.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\packageinfo.sh"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpq&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo Using NT Shell Script to generate version.c&#x0D;&#x0A;..\..\scripts\mkver.bat -P ntpq&#x0D;&#x0A;"
+ Outputs="$(ProjectDir)version.c"
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ports/winnt/vs2013/ntpq/ntpq.vcxproj b/ports/winnt/vs2013/ntpq/ntpq.vcxproj
new file mode 100644
index 0000000..e5f1f84
--- /dev/null
+++ b/ports/winnt/vs2013/ntpq/ntpq.vcxproj
@@ -0,0 +1,740 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug XP|Win32">
+ <Configuration>Debug XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug XP|x64">
+ <Configuration>Debug XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|Win32">
+ <Configuration>Release XP</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release XP|x64">
+ <Configuration>Release XP</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{6A92BF14-8931-48B1-A571-DEBE9F190616}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <PlatformToolset>v120_xp</PlatformToolset>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <OutDir>$(SolutionDir)$(Platform)-bin\$(Configuration)\</OutDir>
+ <IntDir>$(SolutionDir)$(Platform)-tmp\$(Configuration)\$(TargetName)\</IntDir>
+ <ExtensionsToDeleteOnClean>*.obj%3b*.ilk%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.pgc%3b*.pgd%3b*.meta%3b$(TargetPath)</ExtensionsToDeleteOnClean>
+ <LinkIncremental>false</LinkIncremental>
+ <GenerateManifest>false</GenerateManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL64_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName />
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling />
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention />
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>false</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">
+ <Midl>
+ <TypeLibraryName>$(IntDir)ntpq.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>$(VC_IncludePath);..\..\ntpq;..\..\include;..\..\..\..\include;..\..\..\..\lib\isc\win32\include;..\..\..\..\lib\isc\include;$(OPENSSL_INC);..\..\..\..\sntp\libopts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;WIN32;SYS_WINNT;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>$(IntDir)ntpq.pch</PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(OutDir)ntpq-vc90</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsC</CompileAs>
+ <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <ExpandAttributedSource>true</ExpandAttributedSource>
+ <AssemblerOutput>All</AssemblerOutput>
+ <UseUnicodeForAssemblerListing>true</UseUnicodeForAssemblerListing>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;$(OPENSSL64_LIB)\libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
+ <Version>
+ </Version>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <GenerateMapFile>true</GenerateMapFile>
+ <MapExports>true</MapExports>
+ <OptimizeReferences>false</OptimizeReferences>
+ <EnableCOMDATFolding>false</EnableCOMDATFolding>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(IntDir)$(ProjectName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpq\ntpq-opts.c" />
+ <ClCompile Include="..\..\..\..\ntpq\ntpq-subs.c" />
+ <ClCompile Include="..\..\..\..\ntpq\ntpq.c" />
+ <ClCompile Include="version.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\include\ntp_lineedit.h" />
+ <ClInclude Include="..\..\..\..\ntpq\ntpq.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">echo Using NT Shell Script to generate version.c
+..\..\scripts\mkver.bat -P ntpq
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|Win32'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release XP|x64'">$(ProjectDir)version.c;%(Outputs)</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\libntp\libntp.vcxproj">
+ <Project>{400fbfcb-462e-40d0-b06b-3b74e3fffd00}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters b/ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters
new file mode 100644
index 0000000..0ac851d
--- /dev/null
+++ b/ports/winnt/vs2013/ntpq/ntpq.vcxproj.filters
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{726ba7d7-a7f0-4d12-8713-79de7ce8f776}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{e0db3665-e32f-4959-97ac-4cfa2556ef19}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{29c4355d-bb94-4347-964f-5d1c731481d5}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\..\ntpq\ntpq-opts.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpq\ntpq-subs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\ntpq\ntpq.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="version.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\include\ntp_lineedit.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\ntpq\ntpq.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\..\packageinfo.sh" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/readme.y2kfixes b/readme.y2kfixes
new file mode 100644
index 0000000..4518770
--- /dev/null
+++ b/readme.y2kfixes
@@ -0,0 +1,131 @@
+
+AT&T Freeware Year 2000 Certification
+====================================
+
+This is the "readme" file for the freeware application which has
+been certified by AT&T Labs as part of the "Freeware Y2K
+Certification Project".
+
+DISCLAIMER
+----------
+ For its own internal business purposes AT&T Labs has
+ assessed various programs obtained from the Internet for
+ Year-2000 (Y2K) readiness that were not sufficiently certified
+ for AT&T's needs. As a service to the computing community
+ AT&T Labs is freely releasing this information to the
+ public as a series of "Y2K Application Updates", one update
+ for what AT&T Labs considers an "application".
+
+ For use outside of AT&T, AT&T Labs is not certifying this
+ information is correct, that any software, including repairs
+ and tests, will help others in any way, survive the year
+ 2000, nor work with current applications. Nor is AT&T
+ taking any responsibility for repairing any Y2K problems
+ that were overlooked nor repairing any bugs in any
+ "Y2K Application Update". All risk of using this Y2K
+ Application Update remains with the user who is expected
+ to test that this update meets their needs.
+
+ LICENSE TO USE
+ AT&T's intent is to ensure these Y2K patches are freely
+ available to the public but will not maintain a public web site
+ for their distribution. Any copyright claims only only apply to
+ the specific changes made by Y2K to the code. Any original
+ copyright holders retain rights to unchanged code. Wherever
+ possible patches will be returned to the current owner(s) of the code.
+
+ Owners and publishers are free to incorporate appropriate patches,
+ upgrades, and tests within legal future distributions as long as
+ they include the credit:
+
+ Various Y2K updates and tests provided by AT&T Labs.
+ Copyright 1999 AT&T.
+
+ and any AT&T "comments" on the changed code remain intact.
+
+ Any distributions of the updates must keep the entire update
+ intact, without any change, including copyright and disclaimer
+ information. If integrated with the original application items
+ not needed for an integrated release may be omitted. When
+ distributed on the same media as the original application there
+ must be no charge for this "Y2k Application Update".
+
+ CONTACTS
+ If you find any overlooked Y2K problems, or have other strictly Y2K
+ repairs for the software, please E-mail:
+
+ y2k@y2k.labs.att.com
+
+ This address is strictly reserved for the topic at hand.
+ AT&T makes no commitments to answer any E-mail
+ to this address. AT&T is free to use any submissions,
+ including publishing in future Y2K related release notes,
+ without payment or advance notice to the submitting person or
+ persons... appropriate credit will be given in any future
+ publications to the first person submitting something that
+ AT&T uses.
+
+
+======================================================================
+
+Perl ver - 4.036
+No. of Repairs: 2 Repairs
+Compilation of Patches Required: No
+OS Tested: Solaris 2.6
+
+======================================================================
+
+ORGANIZATION OF THE "Y2KFixes" DIRECTORY
+
+The "Y2KFixes" directory has been included in the archive to give
+you information about the Y2K testing that was conducted and their
+results.
+
+The Y2KFixes directory contains at least the following three files:
+|----> NOTES.y2kfixes -- Technical details about the Y2K Testing
+|----> Readme.y2kfixes -- this Readme file
+|----> Results.y2kfixes -- The results of Y2K Environment Tests
+
+The directory may contain additional files and/or directories, as
+appropriate to the application, to provide the exact snapshots.
+
+
+======================================================================
+
+INSTALLING THE "PATCHES"
+
+If you have downloaded a "patch", then you may install it as follows:
+
+ At the same level as the source directory, invoke:
+
+ patch -p < *.patches
+
+The patch file contains a header which has a manifest of changed files.
+
+======================================================================
+
+ADDITIONAL INSTRUCTIONS:
+
+
+1) Extract the patches into perl-4.036 directory which is top level directory
+ for the perl4 source.
+
+2) cd to Y2KFixes.
+
+3) It will have y2k directory which contains regression tests for Y2K testing.
+
+4) now cd to ../t which contains TEST file for running this regression tests.
+
+5) run TEST, see the results & apply patches.
+
+6) Once you apply the patch, you need to run a shell script in x2p/find2perl.SH
+ which will generate find2perl.
+
+
+======================================================================
+
+SUPPORT
+
+See http://y2k.labs.att.com/freeware. There will be no ongoing
+support for the project. But if you have some very important issue,
+you may email us at: y2k@y2k.labs.att.com
diff --git a/results.y2kfixes b/results.y2kfixes
new file mode 100644
index 0000000..32f42cf
--- /dev/null
+++ b/results.y2kfixes
@@ -0,0 +1,76 @@
+Script started on Sat Jan 1 04:14:09 2000
+[root@timetest ntpdate]# date
+Sat Jan 1 04:14:11 EST 2000
+[root@timetest ntpdate]# ./ntpdate -b timelord.att.com
+14 Jul 13:44:39 ntpdate[11723]: step time server 135.16.xxxx.xxxx offset -14740193.210537 sec
+[root@timetest ntpdate]# date
+Wed Jul 14 13:44:42 EST 1999
+[root@timetest ntpdate]# cd ../ntptrace
+[root@timetest ntptrace]# ./ntptrace timelord.att.com
+timelord.att.com: stratum 2, offset -0.000879, synch distance 0.07207
+timemaster.att.com: stratum 1, offset -0.004876, synch distance 0.03485, refid 'GPS'
+[root@timetest ntptrace]# cd -
+[root@timetest ntpdate]# date
+Mon Feb 28 01:00:04 EST 2000
+[root@timetest ntpdate]# ./ntpdate -b timelord.att.com
+14 Jul 13:49:01 ntpdate[11760]: step time server 135.16.xxxx.xxxx offset -19739467.533126 sec
+[root@timetest ntpdate]# date
+Wed Jul 14 13:49:03 EST 1999
+[root@timetest ntpdate]# cd -
+[root@timetest ntptrace]# ./ntptrace timelord.att.com
+timelord.att.com: stratum 2, offset 0.001383, synch distance 0.05644
+timemaster.att.com: stratum 1, offset -0.006355, synch distance 0.04178, refid 'GPS'
+[root@timetest ntptrace]# cd -
+[root@timetest ntpdate]# date
+Tue Feb 29 01:00:05 EST 2000
+[root@timetest ntpdate]# ./ntpdate -b timelord.att.com
+14 Jul 13:57:41 ntpdate[12423]: step time server 135.16.xxxx.xxxx offset -19825349.396585 sec
+[root@timetest ntpdate]# date
+Wed Jul 14 13:57:43 EST 1999
+[root@timetest ntpdate]# cd -
+[root@timetest ntptrace]# ./ntptrace timelord.att.com
+timelord.att.com: stratum 2, offset -0.000094, synch distance 0.06522
+timemaster.att.com: stratum 1, offset -0.010803, synch distance 0.03078, refid 'GPS'
+[root@timetest ntptrace]# cd -
+[root@timetest ntpdate]# date
+Wed Mar 1 01:00:03 EST 2000
+[root@timetest ntpdate]# ./ntpdate -b timelord.att.com
+14 Jul 13:58:10 ntpdate[12525]: step time server 135.16.xxxx.xxxx offset -19911719.766061 sec
+[root@timetest ntpdate]# date
+Wed Jul 14 13:58:12 EST 1999
+[root@timetest ntpdate]# cd -
+[root@timetest ntptrace]# ./ntptrace timelord.att.com
+timelord.att.com: stratum 2, offset -0.000719, synch distance 0.06561
+timemaster.att.com: stratum 1, offset -0.013598, synch distance 0.03116, refid 'GPS'
+
+Script done on Wed Jul 14 13:58:28 1999
+
+RESULTS OK.
+--------------------END OF TEST1--------------------
+
+
+### freeware test configuration
+server 127.127.1.0 prefer
+fudge 127.127.1.0 stratum 0
+driftfile drift.log
+
+
+ntpdate timelord.att.com
+server 135.16.xxxx.xxxx stratum 1, offset 0.000033, delay 0.02975
+31 Dec 23:58:59 ntpdate[83551]: adjust time server 135.16.74.3 offset 0.039057 s
+ec
+
+ntpdate timelord.att.com
+server 135.16.xxxx.xxxx stratum 1, offset 0.000019, delay 0.02504
+01 Jan 00:01:05 ntpdate[8352]: adjust time server 135.16.74.3 offset 0.039057 s
+ec
+
+ntpdate timelord.att.com
+server 135.25.xxxx.xxxx, stratum 1, offset -0.000023, delay 0.02731
+29 Feb 00:02:15 ntpdate[8353]: adjust time server 135.25.xxxx.xxxx offset -0.000023 sec
+
+
+
+
+
+
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..7ddf424
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,174 @@
+NULL=
+SUBDIRS= \
+ build \
+ calc_tickadj \
+ ntp-wait \
+ ntpsweep \
+ ntptrace \
+ lib \
+ $(NULL)
+
+man1_MANS=
+man8_MANS=
+
+DISTCLEANFILES= config.log $(man_MANS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+noinst_SCRIPTS = \
+ ntpver \
+ plot_summary \
+ summary \
+ $(NULL)
+
+install-data-local: install-html
+
+EXTRA_DIST = \
+ deprecated \
+ monitoring \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ plot_summary-opts \
+ plot_summary-opts.def \
+ rc \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ summary-opts \
+ summary-opts.def \
+ stats \
+ $(NULL)
+
+noinst_DATA = \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ $(NULL)
+
+#OPTTPL = ../sntp/ag-tpl/perlopt.tpl
+OPTTPL = $(std_def_list)
+
+##
+
+plot_summary: $(srcdir)/plot_summary-opts
+
+$(srcdir)/plot_summary-opts: plot_summary-opts.def $(OPTTPL)
+ $(run_ag) plot_summary-opts.def
+
+### Nroff
+
+$(srcdir)/plot_summary.1plot_summaryman: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summaryman -Tagman-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.man.in: $(srcdir)/plot_summary.1plot_summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summaryman > $(srcdir)/plot_summary.man.in+
+ mv $(srcdir)/plot_summary.man.in+ $(srcdir)/plot_summary.man.in
+
+### Mdoc
+
+$(srcdir)/plot_summary.1plot_summarymdoc: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summarymdoc -Tagmdoc-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.mdoc.in: $(srcdir)/plot_summary.1plot_summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summarymdoc > $(srcdir)/plot_summary.mdoc.in+
+ mv $(srcdir)/plot_summary.mdoc.in+ $(srcdir)/plot_summary.mdoc.in
+
+### Manpage (local)
+
+plot_summary.1: $(srcdir)/plot_summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=plot_summary.1+:$(srcdir)/plot_summary.$(MANTAGFMT).in
+ mv plot_summary.1+ plot_summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-plot_summary.menu: $(srcdir)/invoke-plot_summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-plot_summary.texi: plot_summary-opts $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section plot_summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/plot_summary.html: $(srcdir)/invoke-plot_summary.menu $(srcdir)/invoke-plot_summary.texi $(srcdir)/plot_summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o plot_summary.html plot_summary.texi || true )
+
+
+##
+
+summary: $(srcdir)/summary-opts
+
+$(srcdir)/summary-opts: summary-opts.def $(OPTTPL)
+ $(run_ag) summary-opts.def
+
+### Nroff
+
+$(srcdir)/summary.1summaryman: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summaryman -Tagman-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.man.in: $(srcdir)/summary.1summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summaryman > $(srcdir)/summary.man.in+
+ mv $(srcdir)/summary.man.in+ $(srcdir)/summary.man.in
+
+### Mdoc
+
+$(srcdir)/summary.1summarymdoc: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summarymdoc -Tagmdoc-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.mdoc.in: $(srcdir)/summary.1summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summarymdoc > $(srcdir)/summary.mdoc.in+
+ mv $(srcdir)/summary.mdoc.in+ $(srcdir)/summary.mdoc.in
+
+### Manpage (local)
+
+summary.1: $(srcdir)/summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=summary.1+:$(srcdir)/summary.$(MANTAGFMT).in
+ mv summary.1+ summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-summary.menu: $(srcdir)/invoke-summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-summary.texi: summary-opts $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/summary.html: $(srcdir)/invoke-summary.menu $(srcdir)/invoke-summary.texi $(srcdir)/summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o summary.html summary.texi || true )
+
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
new file mode 100644
index 0000000..336c6c4
--- /dev/null
+++ b/scripts/Makefile.in
@@ -0,0 +1,1025 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntpver.in $(srcdir)/plot_summary.in \
+ $(srcdir)/summary.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntpver plot_summary summary
+CONFIG_CLEAN_VPATH_FILES =
+SCRIPTS = $(noinst_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS)
+DATA = $(noinst_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+SUBDIRS = \
+ build \
+ calc_tickadj \
+ ntp-wait \
+ ntpsweep \
+ ntptrace \
+ lib \
+ $(NULL)
+
+man1_MANS =
+man8_MANS =
+DISTCLEANFILES = config.log $(man_MANS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+noinst_SCRIPTS = \
+ ntpver \
+ plot_summary \
+ summary \
+ $(NULL)
+
+EXTRA_DIST = \
+ deprecated \
+ monitoring \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ plot_summary-opts \
+ plot_summary-opts.def \
+ rc \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ summary-opts \
+ summary-opts.def \
+ stats \
+ $(NULL)
+
+noinst_DATA = \
+ invoke-plot_summary.texi \
+ invoke-plot_summary.menu \
+ plot_summary.1plot_summaryman \
+ plot_summary.1plot_summarymdoc \
+ plot_summary.mdoc.in \
+ plot_summary.man.in \
+ plot_summary.texi \
+ plot_summary.html \
+ invoke-summary.texi \
+ invoke-summary.menu \
+ summary.1summaryman \
+ summary.1summarymdoc \
+ summary.mdoc.in \
+ summary.man.in \
+ summary.texi \
+ summary.html \
+ $(NULL)
+
+
+#OPTTPL = ../sntp/ag-tpl/perlopt.tpl
+OPTTPL = $(std_def_list)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntpver: $(top_builddir)/config.status $(srcdir)/ntpver.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+plot_summary: $(top_builddir)/config.status $(srcdir)/plot_summary.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+summary: $(top_builddir)/config.status $(srcdir)/summary.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-data-local install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-man
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-data-local install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-man1 \
+ install-man8 install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-man uninstall-man1 \
+ uninstall-man8
+
+
+install-data-local: install-html
+
+plot_summary: $(srcdir)/plot_summary-opts
+
+$(srcdir)/plot_summary-opts: plot_summary-opts.def $(OPTTPL)
+ $(run_ag) plot_summary-opts.def
+
+### Nroff
+
+$(srcdir)/plot_summary.1plot_summaryman: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summaryman -Tagman-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.man.in: $(srcdir)/plot_summary.1plot_summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summaryman > $(srcdir)/plot_summary.man.in+
+ mv $(srcdir)/plot_summary.man.in+ $(srcdir)/plot_summary.man.in
+
+### Mdoc
+
+$(srcdir)/plot_summary.1plot_summarymdoc: $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1plot_summarymdoc -Tagmdoc-cmd.tpl plot_summary-opts.def
+
+$(srcdir)/plot_summary.mdoc.in: $(srcdir)/plot_summary.1plot_summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summarymdoc > $(srcdir)/plot_summary.mdoc.in+
+ mv $(srcdir)/plot_summary.mdoc.in+ $(srcdir)/plot_summary.mdoc.in
+
+### Manpage (local)
+
+plot_summary.1: $(srcdir)/plot_summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=plot_summary.1+:$(srcdir)/plot_summary.$(MANTAGFMT).in
+ mv plot_summary.1+ plot_summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-plot_summary.menu: $(srcdir)/invoke-plot_summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-plot_summary.texi: plot_summary-opts $(srcdir)/plot_summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section plot_summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/plot_summary.html: $(srcdir)/invoke-plot_summary.menu $(srcdir)/invoke-plot_summary.texi $(srcdir)/plot_summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o plot_summary.html plot_summary.texi || true )
+
+summary: $(srcdir)/summary-opts
+
+$(srcdir)/summary-opts: summary-opts.def $(OPTTPL)
+ $(run_ag) summary-opts.def
+
+### Nroff
+
+$(srcdir)/summary.1summaryman: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summaryman -Tagman-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.man.in: $(srcdir)/summary.1summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summaryman > $(srcdir)/summary.man.in+
+ mv $(srcdir)/summary.man.in+ $(srcdir)/summary.man.in
+
+### Mdoc
+
+$(srcdir)/summary.1summarymdoc: $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1summarymdoc -Tagmdoc-cmd.tpl summary-opts.def
+
+$(srcdir)/summary.mdoc.in: $(srcdir)/summary.1summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summarymdoc > $(srcdir)/summary.mdoc.in+
+ mv $(srcdir)/summary.mdoc.in+ $(srcdir)/summary.mdoc.in
+
+### Manpage (local)
+
+summary.1: $(srcdir)/summary.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=summary.1+:$(srcdir)/summary.$(MANTAGFMT).in
+ mv summary.1+ summary.1
+
+### Texinfo
+
+$(srcdir)/invoke-summary.menu: $(srcdir)/invoke-summary.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-summary.texi: summary-opts $(srcdir)/summary-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section summary-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/summary.html: $(srcdir)/invoke-summary.menu $(srcdir)/invoke-summary.texi $(srcdir)/summary.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o summary.html summary.texi || true )
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/README b/scripts/README
new file mode 100644
index 0000000..9f70a63
--- /dev/null
+++ b/scripts/README
@@ -0,0 +1,31 @@
+README file for directory ./scripts of the NTP Version 4 distribution
+
+This directory contains shell and perl script files for the configuration,
+monitoring and support of NTP installations. See the README and RELNOTES
+files in the parent directory for directions on how to use these files.
+
+calc_tickadj Calculates "optimal" value for tick given ntp.drift file
+
+monitoring directory containing perl scripts useful for monitoring
+ operations
+
+rc start/stop scripts for NTP
+
+ntp-wait Blocks until ntpd is in state 4 (synchronized).
+ Useful at boot time, to delay the boot sequence
+ until after "ntpd -g" has set the time.
+
+ntpsweep prints per host given in <file> the NTP stratum level, the
+ clock offset in seconds, the daemon version, the operating
+ system and the processor.
+
+ntptrace Trace ntp peers of a server up to stratum 1.
+
+stats directory containing awk and shell scripts useful for
+ maintaining statistics summaries of clockstats, loopstats
+ and peerstats files
+
+summary Generate summary files out of stat files produced by NTP
+ daemon.
+
+plot_summary Plot summaries generated by summary script.
diff --git a/scripts/build/Makefile.am b/scripts/build/Makefile.am
new file mode 100644
index 0000000..51a1bbc
--- /dev/null
+++ b/scripts/build/Makefile.am
@@ -0,0 +1,17 @@
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl
+
+noinst_SCRIPTS = mkver
+
+NULL=
+EXTRA_DIST = \
+ check--help \
+ checkChangeLog \
+ checkHtmlFileDates \
+ fixautomakedepsmagic \
+ genCommitLog \
+ genver \
+ updateBEDate \
+ UpdatePoint \
+ VersionName \
+ $(NULL)
diff --git a/scripts/build/Makefile.in b/scripts/build/Makefile.in
new file mode 100644
index 0000000..212d26b
--- /dev/null
+++ b/scripts/build/Makefile.in
@@ -0,0 +1,550 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/build
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/mkver.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = mkver
+CONFIG_CLEAN_VPATH_FILES =
+SCRIPTS = $(noinst_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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@
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl
+
+noinst_SCRIPTS = mkver
+NULL =
+EXTRA_DIST = \
+ check--help \
+ checkChangeLog \
+ checkHtmlFileDates \
+ fixautomakedepsmagic \
+ genCommitLog \
+ genver \
+ updateBEDate \
+ UpdatePoint \
+ VersionName \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/build/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/build/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+mkver: $(top_builddir)/config.status $(srcdir)/mkver.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/build/UpdatePoint b/scripts/build/UpdatePoint
new file mode 100755
index 0000000..e3c5957
--- /dev/null
+++ b/scripts/build/UpdatePoint
@@ -0,0 +1,331 @@
+#! /bin/sh
+
+# showusage is set to 1 on any command-line syntax error
+showusage=0
+# are we playing by stable or dev rules?
+repo=
+# test is set to 1 if -t/--test is given to prevent modifications
+test=0
+
+case "$#" in
+ 1) repo=$1
+ ;;
+ 2) repo=$2
+ case $1 in
+ -t|--test)
+ test=1
+ ;;
+ *)
+ showusage=1
+ ;;
+ esac
+ ;;
+ *) showusage=1
+ ;;
+esac
+
+case "$repo" in
+ dev|stable)
+ ;;
+ '')
+ showusage=1
+ ;;
+ *) echo "Unexpected repo type: <$repo>!"
+ showusage=1
+ ;;
+esac
+
+case "$showusage" in
+ 1) echo "Usage: $0 [-t] <stable|dev>"
+ echo "No changes are made to packageinfo.sh if -t is given."
+ exit 1
+ ;;
+esac
+
+
+set -e
+
+. ./packageinfo.sh
+
+case "$repotype" in
+ $repo)
+ ;;
+ *) echo "You indicated repo type <$repo> but packageinfo.sh"
+ echo "indicates <$repotype>."
+ exit 1
+ ;;
+esac
+
+ver_repo_mismatch=1
+
+case "$minor" in
+ 1|3|5|7|9)
+ case "$repo" in
+ dev)
+ ver_repo_mismatch=0
+ ;;
+ stable)
+ ;;
+ esac
+ ;;
+ 0|2|4|6|8)
+ case "$repo" in
+ dev)
+ ;;
+ stable)
+ ver_repo_mismatch=0
+ ;;
+ esac
+ ;;
+esac
+
+case "$ver_repo_mismatch" in
+ 1) echo "Minor version <$minor> mismatches repotype <$repo>."
+ exit 1
+ ;;
+esac
+
+# Do we want to bump the point?
+bp=1
+# Do we want to bump the beta point?
+bbp=0
+# Do we want to change the RC point? (n=no, z=empty rcpoint and zero
+# betapoint, i=incr)
+crcp=n
+# Do we want to change the prerelease value?
+setpr=0
+
+# for stable:
+# if we are not in a beta or RC state, enter beta unless point is NEW.
+# if we are in a beta state:
+# - bump the beta point
+# else if we are in an RC state:
+# - if rcpoint is GO:
+# - - set rcpoint= (empty)
+# - - set prerelease= (empty)
+# - - set betapoint=0
+# - else
+# - - if rcpoint==(empty)
+# - - - (bump-point) and set rcpoint to 0 (and fall thru, so -RC1 is first)
+# - - bump the RC point
+
+# for dev, we only want to bump-point and possibly clear prerelease,
+# but we do not modify rcpoint nor betapoint.
+
+case "$repo" in
+ dev)
+ case "$point" in
+ [Nn][Ee][Ww])
+ crcp=z
+ ;;
+ *)
+ # crcp=n
+ ;;
+ esac
+ # bp=1
+ ;;
+ stable)
+ case "$prerelease" in
+ '')
+ case "$betapoint::$rcpoint::$point" in
+ *::*::NEW)
+ # new minor release (no p)
+ crcp=z
+ # bp=1
+ ;;
+ 0::::*)
+ # start of first beta cycle for the next point release
+ setpr=1
+ newpr=beta
+ # bp=1
+ bbp=1
+ ;;
+ 0::[Gg][Oo]::*)
+ # skip all -beta and -RC prereleases to the next point.
+ crcp=z
+ setpr=1
+ newpr=
+ # bp=1
+ # bbp=0
+ ;;
+ *) echo "betapoint is <$betapoint>, rcpoint is <$rcpoint>"
+ echo "betapoint must be 0 and rcpoint must be empty to start the"
+ echo "beta cycle."
+ exit 1
+ ;;
+ esac
+ ;;
+ beta)
+ case "$betapoint::$rcpoint" in
+ [1-9]*::*)
+ bp=0
+ bbp=1
+ ;;
+ 0::) echo "betapoint is 0, rcpoint emtpy, and prerelease is beta."
+ echo "You probably intended prerelease= (that is, empty). It"
+ echo "will then be changed to beta by this script, starting the"
+ echo "first beta for the next point release."
+ exit 1
+ ;;
+ *)
+ bp=0
+ bbp=1
+ ;;
+ esac
+ case "$rcpoint" in
+ [Gg][Oo])
+ echo "prerelease is beta, rcpoint is GO, disallowed."
+ echo "rcpoint GO is allowed only when prerelease is RC or empty."
+ exit 1
+ ;;
+ esac
+ ;;
+ rc|RC)
+ case "$rcpoint" in
+ '')
+ case "$betapoint" in
+ 0) # bp=1
+ ;;
+ *) bp=0
+ ;;
+ esac
+ crcp=i
+ ;;
+ [1-9]*)
+ bp=0
+ crcp=i
+ ;;
+ [Gg][Oo])
+ bp=0
+ crcp=z
+ setpr=1
+ newpr=
+ ;;
+ *) echo "Unexpected value for 'rcpoint' <$rcpoint>!"
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ echo "prerelease <$prerelease> unexpected"
+ exit 1
+ ;;
+ esac
+ ;;
+ *) echo "impossible: repo <$repo>!"
+ exit 1
+ ;;
+esac
+
+case "$bp::$point" in
+ 0::*)
+ newpoint=$point
+ ;;
+ 1::[1-9]*)
+ newpoint=`expr $point + 1`
+ ;;
+ 1::)
+ newpoint=1
+ ;;
+ 1::[Nn][Ee][Ww])
+ newpoint=
+ ;;
+ *) echo "Unexpected value for 'point' <$point>!"
+ exit 1
+ ;;
+esac
+
+case "$bbp::$betapoint" in
+ 0::*)
+ newbetapoint=$betapoint
+ ;;
+ 1::[0-9]*)
+ newbetapoint=`expr $betapoint + 1`
+ ;;
+ *) echo "Unexpected value for 'betapoint' <$betapoint>!"
+ exit 1
+ ;;
+esac
+
+case "$crcp::$rcpoint" in
+ n::*)
+ newrcpoint=$rcpoint
+ ;;
+ i::)
+ newrcpoint=1
+ ;;
+ i::[0-9]*)
+ newrcpoint=`expr $rcpoint + 1`
+ ;;
+ z::*)
+ newrcpoint=
+ newbetapoint=0
+ ;;
+ *) echo "Unexpected value for 'crcp::rcpoint' <$crcp::$rcpoint>!"
+ exit 1
+ ;;
+esac
+
+case "$setpr" in
+ 0)
+ newpr=$prerelease
+esac
+
+# display results
+printf "prerelease $prerelease"
+case "$newpr" in
+ $prerelease)
+ printf "\n"
+ ;;
+ *) printf " -> $newpr\n"
+ ;;
+esac
+printf "point $point"
+case "$newpoint" in
+ $point)
+ printf "\n"
+ ;;
+ *) printf " -> $newpoint\n"
+ ;;
+esac
+printf "betapoint $betapoint"
+case "$newbetapoint" in
+ $betapoint)
+ printf "\n"
+ ;;
+ *) printf " -> $newbetapoint\n"
+ ;;
+esac
+printf "rcpoint $rcpoint"
+case "$newrcpoint" in
+ $rcpoint)
+ printf "\n"
+ ;;
+ *) printf " -> $newrcpoint\n"
+ ;;
+esac
+
+printf "Previous version: "
+scripts/build/VersionName
+
+# apply packageinfo.sh changes
+
+sed -e "s/^point=.*/point=$newpoint/" \
+ -e "s/^betapoint=.*/betapoint=$newbetapoint/" \
+ -e "s/^rcpoint=.*/rcpoint=$newrcpoint/" \
+ -e "s/^prerelease=.*/prerelease=$newpr/" \
+ < packageinfo.sh \
+ > packageinfo.sh+
+
+case "$test" in
+ 0)
+ mv packageinfo.sh+ packageinfo.sh
+ printf "Updated version: "
+ scripts/build/VersionName
+ ;;
+ *)
+ printf "Next version would be: "
+ scripts/build/VersionName -p ./packageinfo.sh+
+ rm packageinfo.sh+
+ ;;
+esac
diff --git a/scripts/build/VersionName b/scripts/build/VersionName
new file mode 100755
index 0000000..71e31a9
--- /dev/null
+++ b/scripts/build/VersionName
@@ -0,0 +1,61 @@
+#! /bin/sh
+
+packageinfo='./packageinfo.sh'
+case "$#" in
+ 2)
+ case "$1" in
+ -p|--packageinfo)
+ packageinfo="$2"
+ esac
+ ;;
+ 0)
+ ;;
+ *) echo "Usage: $0 [-p packageinfo.sh]"
+ exit 1
+ ;;
+esac
+
+# This script must be executed from the TLD of the source tree...
+. "$packageinfo"
+
+NAME="$version"
+case $point in
+ [1-9]*)
+ case "${proto}.${major}" in
+ 4.[012])
+ NAME="${NAME}p${point}"
+ ;;
+ *) NAME="${NAME}.${point}"
+ ;;
+ esac
+ ;;
+ NEW) ;;
+ '') ;;
+ *) echo "Unexpected value for 'point' <$point>!"
+ exit 1
+ ;;
+esac
+
+case $special in
+ '') ;;
+ *) NAME="${NAME}-${special}" ;;
+esac
+
+case "$prerelease::$repotype" in
+ ''::*)
+ ;;
+ beta::stable)
+ NAME="${NAME}-beta${betapoint}"
+ ;;
+ rc::dev|RC::dev)
+ NAME="${NAME}-RC"
+ ;;
+ rc::stable|RC::stable)
+ NAME="${NAME}-RC${rcpoint}"
+ ;;
+ *) echo "Unexpected value for 'prerelease::repotype' <$prerelease::$repotype>!"
+ exit 1
+ ;;
+esac
+
+echo "$NAME"
diff --git a/scripts/build/check--help b/scripts/build/check--help
new file mode 100755
index 0000000..1524675
--- /dev/null
+++ b/scripts/build/check--help
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+# Look at the file specified in $1 to see if it contains 'no --help'.
+# If it does:
+# - Squawk
+# - rename the file to ($1)-
+# - exit with a non-zero status.
+# otherwise:
+# - exit with a 0 status.
+
+if test ! -f $1
+then
+ echo "$0: $1 is not a regular file!" 2>&3
+ exit 1
+fi
+
+if grep -q 'no --help' $1
+then
+ echo "$0: $1 contains 'no --help'!" 2>&3
+ mv ${1} ${1}-
+ exit 1
+fi
diff --git a/scripts/build/checkChangeLog b/scripts/build/checkChangeLog
new file mode 100755
index 0000000..46c56c4
--- /dev/null
+++ b/scripts/build/checkChangeLog
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+. ./packageinfo.sh
+
+# HMS: Irix doesn't have 'head'...
+cl1=`head -1 ChangeLog || sed -e 1q ChangeLog`
+
+case "$repotype" in
+ dev) ;;
+ stable) ;;
+ *) echo "Unexpected repotype <$repotype>"
+ exit 1
+ ;;
+esac
+
+case "$repotype$cl1" in
+ dev---)
+ echo "Dev repo ChangeLog must not begin with '---'!"
+ exit 1
+ ;;
+ dev*)
+ ;;
+ stable---)
+ ;;
+ stable*)
+ echo "Stable repo Changelog must begin with '---'!"
+ exit 1
+ ;;
+esac
diff --git a/scripts/build/checkHtmlFileDates b/scripts/build/checkHtmlFileDates
new file mode 100755
index 0000000..9d9a2f2
--- /dev/null
+++ b/scripts/build/checkHtmlFileDates
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+bk version > /dev/null 2>&1 || exit 0
+
+for i in `find * -type f -name '*.html' -print | grep -v SCCS/`
+do
+ # echo $i
+ set `bk diffs $i | wc -l`
+ lines=$1
+ case "$lines" in
+ 0) ;;
+ *) echo "Processing <$i>"
+ ../scripts/build/updateBEDate $i
+ ;;
+ esac
+done
diff --git a/scripts/build/fixautomakedepsmagic b/scripts/build/fixautomakedepsmagic
new file mode 100755
index 0000000..ec82bba
--- /dev/null
+++ b/scripts/build/fixautomakedepsmagic
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+prog=`basename $0`
+
+
+t=/tmp/$prog.$$
+
+trap 'rm -f ${t} ; exit 1' 1 3 15
+
+while [ $# -gt 0 ]; do
+ f=$1
+ shift
+ sed -e '/^DEPS_MAGIC :=/,/^-include \$/s/^/#/' $f > $t
+ c="diff $f $t"
+ echo $c
+ $c
+ tstatus=$?
+ if [ $tstatus = 0 ]; then
+ echo "$prog":" $f not modified"
+ elif [ ! -w $f ]; then
+ echo "$prog":" $f not not writable"
+ else
+ c="cp $t $f"
+ echo $c
+ $c
+ fi
+ rm -f $t
+done
diff --git a/scripts/build/genCommitLog b/scripts/build/genCommitLog
new file mode 100755
index 0000000..318e286
--- /dev/null
+++ b/scripts/build/genCommitLog
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+set -e
+
+GCL_REMOVEWRITE=0
+. ./packageinfo.sh
+if [ ! -w . ] ; then
+ GCL_REMOVEWRITE=1
+ chmod u+w .
+ [ -f CommitLog -a ! -w CommitLog ] && chmod u+w CommitLog
+fi
+bk changes -v -m -r${CLTAG}.. > CommitLog.new
+mv CommitLog.new CommitLog
+case "$GCL_REMOVEWRITE" in
+ 1) chmod a-w CommitLog .
+esac
diff --git a/scripts/build/genver b/scripts/build/genver
new file mode 100755
index 0000000..c073243
--- /dev/null
+++ b/scripts/build/genver
@@ -0,0 +1,96 @@
+#! /bin/sh
+
+# possible usage: $0 [-f] [version.m4] [version.def]
+#
+# -f would be 'force the update'
+
+force=0
+outputs=
+for i in $*
+do
+ case "$i" in
+ -f)
+ force=1
+ ;;
+ *version.m4)
+ outputs="m4/version.m4 $outputs"
+ ;;
+ *version.def)
+ outputs="include/version.def $outputs"
+ ;;
+ *version.texi)
+ outputs="include/version.texi $outputs"
+ ;;
+ *) echo "Unrecognized option: $i"
+ exit 1
+ ;;
+ esac
+done
+
+case "$outputs" in
+ '') outputs="m4/version.m4 include/version.def include/version.texi" ;;
+esac
+
+set -e
+
+. ../packageinfo.sh
+
+dversion=`../scripts/build/VersionName -p ../packageinfo.sh`
+
+set +e
+
+# Create intermediate files in $TEMPDIR defaulting it to /tmp
+# if not set. This avoids races when multiple builds run in
+# parallel on shared source.
+
+TEMPDIR=${TEMPDIR=/tmp}
+
+case "$outputs" in
+ *version.m4*)
+ echo "m4_define([VERSION_NUMBER],[${dversion}])" > "${TEMPDIR}/version.m4+"
+ cmp -s "${TEMPDIR}/version.m4+" m4/version.m4
+ rc=$?
+ case "$force$rc" in
+ 00)
+ rm -f "${TEMPDIR}/version.m4+"
+ ;;
+ *)
+ mv "${TEMPDIR}/version.m4+" m4/version.m4
+ ;;
+ esac
+ ;;
+esac
+
+case "$outputs" in
+ *version.def*)
+ echo "version = '${dversion}';" > "${TEMPDIR}/version.def+"
+ cmp -s "${TEMPDIR}/version.def+" include/version.def
+ rc=$?
+ case "$force$rc" in
+ 00)
+ rm -f "${TEMPDIR}/version.def+"
+ ;;
+ *)
+ mv "${TEMPDIR}/version.def+" include/version.def
+ ;;
+ esac
+ ;;
+esac
+
+case "$outputs" in
+ *version.texi*)
+ echo "@set UPDATED `date +'%d %B %Y'`" > "${TEMPDIR}/version.texi+"
+ echo "@set EDITION $dversion" >> "${TEMPDIR}/version.texi+"
+ echo "@set VERSION $dversion" >> "${TEMPDIR}/version.texi+"
+ cmp -s "${TEMPDIR}/version.texi+" include/version.texi
+ rc=$?
+ case "$force$rc" in
+ 00)
+ rm -f "${TEMPDIR}/version.texi+"
+ ;;
+ *)
+ mv "${TEMPDIR}/version.texi+" include/version.texi
+ ;;
+ esac
+ ;;
+esac
diff --git a/scripts/build/mkver.in b/scripts/build/mkver.in
new file mode 100644
index 0000000..3aef1c8
--- /dev/null
+++ b/scripts/build/mkver.in
@@ -0,0 +1,38 @@
+#!@CONFIG_SHELL@
+PROG=${1-UNKNOWN}
+
+ConfStr="$PROG"
+
+ConfStr="$ConfStr @VERSION@"
+
+case "$CSET" in
+ '') ;;
+ *) ConfStr="$ConfStr@$CSET" ;;
+esac
+
+case "@VER_SUFFIX@" in
+ '') ;;
+ *) ConfStr="${ConfStr}-@VER_SUFFIX@" ;;
+esac
+
+ConfStr="$ConfStr `LC_TIME=C TZ=UTC date`"
+
+if [ ! -f .version ]; then
+ echo 0 > .version
+fi
+RUN="`cat .version`"
+RUN="`expr $RUN + 1`"
+echo $RUN > .version
+
+ConfStr="$ConfStr (${RUN})"
+
+echo "Version <${ConfStr}>";
+
+rm -f version.c
+cat > version.c << -EoF-
+/*
+ * version file for $PROG
+ */
+#include <config.h>
+const char * Version = "${ConfStr}";
+-EoF-
diff --git a/scripts/build/updateBEDate b/scripts/build/updateBEDate
new file mode 100755
index 0000000..467e707
--- /dev/null
+++ b/scripts/build/updateBEDate
@@ -0,0 +1,53 @@
+#! /usr/bin/env perl
+use warnings;
+use strict;
+
+# for each filename on the command line
+# get the modtime
+# make a backup of the file
+# - error if there is already a backup?
+# flush the live version(?)
+# start a line-by-line copy of the backup to the new file,
+# doing the BeginDate/EndDate substitution
+
+# <!-- #BeginDate format:En1m -->3-oct-11 18:20<!-- #EndDate -->
+# <!-- #BeginDate format:En2m -->01-Aug-2011 17:56<!-- #EndDate -->
+# without the 'm' no minutes are included.
+
+my $i;
+my $mod_time;
+my $stamp;
+my @m_abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
+
+foreach ( @ARGV ) {
+ $i = $_;
+ $mod_time = (stat ($i))[9];
+ $stamp = localtime($mod_time);
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime($mod_time);
+ $year += 1900;
+
+ # print "<$i> at <$stamp>\n";
+
+ open(my $IFILE, "<", $i) or die "Cannot open < $i: $!";
+ open(my $OFILE, ">", $i.".new") or die "Cannot open > $i.new: $!";
+ while(<$IFILE>) {
+ if (/(.*<!--\s*#BeginDate\s*format:)(\S*)(\s*-->).*(<!--\s*#EndDate\s*-->.*)/) {
+ # print "Got: $_";
+ # print "as: <$1><$2><$3>...<$4>\n";
+ print { $OFILE } $1,$2,$3;
+ printf { $OFILE } "%s-%s-%s %02d:%02d", $mday,$m_abbr[$mon],$year,$hour,$min;
+ print { $OFILE } $4,"\n";
+ }
+ else {
+ print { $OFILE } $_;
+ }
+ }
+ close($IFILE);
+ close($OFILE);
+ #
+ utime(time, $mod_time, "$i.new") || die "touch $i.new failed: $!";
+ #
+ rename $i,"$i.old" || die "rename $i,$i.old failed: $!";
+ rename "$i.new",$i || die "rename $i.new,$i failed: $!";
+}
diff --git a/scripts/calc_tickadj/Makefile.am b/scripts/calc_tickadj/Makefile.am
new file mode 100644
index 0000000..b98bc87
--- /dev/null
+++ b/scripts/calc_tickadj/Makefile.am
@@ -0,0 +1,104 @@
+NULL=
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+
+bin_SCRIPTS= $(CALC_TICKADJ_DB)
+libexec_SCRIPTS= $(CALC_TICKADJ_DL)
+sbin_SCRIPTS= $(CALC_TICKADJ_DS)
+EXTRA_SCRIPTS= calc_tickadj
+
+man1_MANS=
+man8_MANS=
+manpage_HACK=
+if WANT_CALC_TICKADJ_MS
+man_MANS= calc_tickadj.$(CALC_TICKADJ_MS)
+else
+manpage_HACK+= calc_tickadj.
+# Note that if we don't WANT_CALC_TICKADJ then CALC_TICKADJ_MS will
+# be empty. But we still need the .texi and other files to be built, as
+# they are general prerequisites.
+# The manpage_HACK is listed in noinst_DATA so that takes care of these.
+endif
+
+DISTCLEANFILES = config.log $(man_MANS) calc_tickadj.
+
+EXTRA_DIST = \
+ calc_tickadj.in \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(NULL)
+
+noinst_DATA = \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(manpage_HACK) \
+ $(NULL)
+
+calc_tickadj: $(srcdir)/calc_tickadj-opts
+
+$(srcdir)/calc_tickadj-opts: $(srcdir)/calc_tickadj-opts.def
+ $(run_ag) calc_tickadj-opts.def
+
+### Nroff
+
+$(srcdir)/calc_tickadj.1calc_tickadjman: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjman -Tagman-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.man.in: $(srcdir)/calc_tickadj.1calc_tickadjman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjman > $(srcdir)/calc_tickadj.man.in+
+ mv $(srcdir)/calc_tickadj.man.in+ $(srcdir)/calc_tickadj.man.in
+
+### Mdoc
+
+$(srcdir)/calc_tickadj.1calc_tickadjmdoc: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjmdoc -Tagmdoc-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.mdoc.in: $(srcdir)/calc_tickadj.1calc_tickadjmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjmdoc > $(srcdir)/calc_tickadj.mdoc.in+
+ mv $(srcdir)/calc_tickadj.mdoc.in+ $(srcdir)/calc_tickadj.mdoc.in
+
+### Manpage
+
+calc_tickadj.$(CALC_TICKADJ_MS): $(srcdir)/calc_tickadj.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=calc_tickadj.$(CALC_TICKADJ_MS)+:$(srcdir)/calc_tickadj.$(MANTAGFMT).in
+ mv calc_tickadj.$(CALC_TICKADJ_MS)+ calc_tickadj.$(CALC_TICKADJ_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-calc_tickadj.menu: $(srcdir)/invoke-calc_tickadj.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-calc_tickadj.texi: $(srcdir)/calc_tickadj-opts $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section calc_tickadj-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/calc_tickadj.html: $(srcdir)/invoke-calc_tickadj.menu $(srcdir)/invoke-calc_tickadj.texi $(srcdir)/calc_tickadj.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o calc_tickadj.html calc_tickadj.texi || true )
diff --git a/scripts/calc_tickadj/Makefile.in b/scripts/calc_tickadj/Makefile.in
new file mode 100644
index 0000000..4e5b34f
--- /dev/null
+++ b/scripts/calc_tickadj/Makefile.in
@@ -0,0 +1,865 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@WANT_CALC_TICKADJ_MS_FALSE@am__append_1 = calc_tickadj.
+subdir = scripts/calc_tickadj
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/calc_tickadj.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = calc_tickadj
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+bin_SCRIPTS = $(CALC_TICKADJ_DB)
+libexec_SCRIPTS = $(CALC_TICKADJ_DL)
+sbin_SCRIPTS = $(CALC_TICKADJ_DS)
+EXTRA_SCRIPTS = calc_tickadj
+man1_MANS =
+man8_MANS =
+manpage_HACK = $(am__append_1)
+@WANT_CALC_TICKADJ_MS_TRUE@man_MANS = calc_tickadj.$(CALC_TICKADJ_MS)
+# Note that if we don't WANT_CALC_TICKADJ then CALC_TICKADJ_MS will
+# be empty. But we still need the .texi and other files to be built, as
+# they are general prerequisites.
+# The manpage_HACK is listed in noinst_DATA so that takes care of these.
+DISTCLEANFILES = config.log $(man_MANS) calc_tickadj.
+EXTRA_DIST = \
+ calc_tickadj.in \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(NULL)
+
+noinst_DATA = \
+ calc_tickadj.1calc_tickadjman \
+ calc_tickadj.1calc_tickadjmdoc \
+ calc_tickadj.man.in \
+ calc_tickadj.mdoc.in \
+ calc_tickadj.texi \
+ calc_tickadj.html \
+ calc_tickadj-opts.def \
+ calc_tickadj-opts \
+ invoke-calc_tickadj.texi \
+ invoke-calc_tickadj.menu \
+ $(manpage_HACK) \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/calc_tickadj/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/calc_tickadj/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+calc_tickadj: $(top_builddir)/config.status $(srcdir)/calc_tickadj.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-libexecSCRIPTS \
+ uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-man1 \
+ uninstall-man8 uninstall-sbinSCRIPTS
+
+
+calc_tickadj: $(srcdir)/calc_tickadj-opts
+
+$(srcdir)/calc_tickadj-opts: $(srcdir)/calc_tickadj-opts.def
+ $(run_ag) calc_tickadj-opts.def
+
+### Nroff
+
+$(srcdir)/calc_tickadj.1calc_tickadjman: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjman -Tagman-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.man.in: $(srcdir)/calc_tickadj.1calc_tickadjman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjman > $(srcdir)/calc_tickadj.man.in+
+ mv $(srcdir)/calc_tickadj.man.in+ $(srcdir)/calc_tickadj.man.in
+
+### Mdoc
+
+$(srcdir)/calc_tickadj.1calc_tickadjmdoc: $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1calc_tickadjmdoc -Tagmdoc-cmd.tpl calc_tickadj-opts.def
+
+$(srcdir)/calc_tickadj.mdoc.in: $(srcdir)/calc_tickadj.1calc_tickadjmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjmdoc > $(srcdir)/calc_tickadj.mdoc.in+
+ mv $(srcdir)/calc_tickadj.mdoc.in+ $(srcdir)/calc_tickadj.mdoc.in
+
+### Manpage
+
+calc_tickadj.$(CALC_TICKADJ_MS): $(srcdir)/calc_tickadj.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=calc_tickadj.$(CALC_TICKADJ_MS)+:$(srcdir)/calc_tickadj.$(MANTAGFMT).in
+ mv calc_tickadj.$(CALC_TICKADJ_MS)+ calc_tickadj.$(CALC_TICKADJ_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-calc_tickadj.menu: $(srcdir)/invoke-calc_tickadj.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-calc_tickadj.texi: $(srcdir)/calc_tickadj-opts $(srcdir)/calc_tickadj-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section calc_tickadj-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/calc_tickadj.html: $(srcdir)/invoke-calc_tickadj.menu $(srcdir)/invoke-calc_tickadj.texi $(srcdir)/calc_tickadj.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o calc_tickadj.html calc_tickadj.texi || true )
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/calc_tickadj/calc_tickadj-opts b/scripts/calc_tickadj/calc_tickadj-opts
new file mode 100644
index 0000000..c8a8c0d
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj-opts
@@ -0,0 +1,60 @@
+# EDIT THIS FILE WITH CAUTION (calc_tickadj-opts)
+#
+# It has been AutoGen-ed August 31, 2014 at 04:52:46 AM by AutoGen 5.18.4
+# From the definitions calc_tickadj-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'drift-file' => '/etc/ntp/drift',
+ 'tick' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'drift-file|d=s', 'tick|t=i',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
+USAGE: calc_tickadj [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ -d, --drift-file=str Ntp drift file to use
+ -t, --tick=num Tick value of this host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/calc_tickadj/calc_tickadj-opts.def b/scripts/calc_tickadj/calc_tickadj-opts.def
new file mode 100644
index 0000000..cdb50ef
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj-opts.def
@@ -0,0 +1,60 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = calc_tickadj;
+prog-title = 'Calculates "optimal" value for tick given ntp drift file.';
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = drift-file;
+ value = d;
+ arg-type = string;
+ arg-default = '/etc/ntp/drift';
+ descrip = 'Ntp drift file to use';
+ doc = 'Use the specified drift file for calculations';
+};
+
+flag = {
+ name = tick;
+ value = t;
+ arg-type = number;
+ descrip = 'Tick value of this host';
+ doc = 'The current tick which to adjustment will be calculated';
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'texi';
+ ds-text = <<- _EndOfDoc
+The @code{calc_tickadj} script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+
+The example output of
+@example
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+@end example
+
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+
+@code{calc_tickadj} tries to determine the the tick value by using
+@code{tickadj} program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+ _EndOfDoc;
+};
diff --git a/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
new file mode 100644
index 0000000..18e2310
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
@@ -0,0 +1,108 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH calc_tickadj 1calc_tickadjman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-yLaGPB/ag-LLaOOB)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:04 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]calc_tickadj\fP
+\- Calculates optimal value for tick given ntp drift file.
+.SH SYNOPSIS
+\f\*[B-Font]calc_tickadj\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.br
+.in +4
+.nf
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.in -4
+.fi
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-drift\-file\f[]=\f\*[I-Font]string\f[]
+Ntp drift file to use.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tick\f[]=\f\*[I-Font]number\f[]
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
new file mode 100644
index 0000000..265ec39
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
@@ -0,0 +1,84 @@
+.Dd December 2 2014
+.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:08 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm calc_tickadj
+.Nd Calculates "optimal" value for tick given ntp drift file.
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.Bd -literal -offset indent
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.Ed
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl d Ar string , Fl \-drift\-file Ns = Ns Ar string
+Ntp drift file to use.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.It Fl t Ar number , Fl \-tick Ns = Ns Ar number
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.html b/scripts/calc_tickadj/calc_tickadj.html
new file mode 100644
index 0000000..0d42d6f
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.html
@@ -0,0 +1,166 @@
+<html lang="en">
+<head>
+<title>calc_tickadj User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="calc_tickadj User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">calc_tickadj User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<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.7p482 of <code>calc_tickadj</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">calc_tickadj User's Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#calc_005ftickadj-Description">calc_tickadj Description</a>: Description
+<li><a accesskey="2" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>: Invoking calc_tickadj
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-Description">calc_tickadj Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking calc_tickadj</h3>
+
+<p><a name="index-calc_005ftickadj-1"></a><a name="index-Calculates-_0022optimal_0022-value-for-tick-given-ntp-drift-file_002e-2"></a>
+The <code>calc_tickadj</code> script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+
+ <p>The example output of
+<pre class="example"> $ ./calc_tickadj
+ 81.699 (drift)
+ 9999 usec; 9999779 nsec
+ $ cat /etc/ntp/drift
+ -23.159
+</pre>
+ <p>means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+
+ <p>If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+
+ <p><code>calc_tickadj</code> tries to determine the the tick value by using
+<code>tickadj</code> program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>calc_tickadj</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#calc_005ftickadj-usage">calc_tickadj usage</a>: calc_tickadj help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>: drift-file option (-d)
+<li><a accesskey="3" href="#calc_005ftickadj-tick">calc_tickadj tick</a>: tick option (-t)
+<li><a accesskey="4" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">calc_tickadj help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-calc_005ftickadj-help-3"></a>
+This is the automatically generated usage text for calc_tickadj.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
+USAGE: calc_tickadj [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ -d, --drift-file=str Ntp drift file to use
+ -t, --tick=num Tick value of this host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="calc_005ftickadj-drift_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-usage">calc_tickadj usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">drift-file option (-d)</h4>
+
+<p><a name="index-calc_005ftickadj_002ddrift_002dfile-4"></a>
+This is the &ldquo;ntp drift file to use&rdquo; option.
+This option takes a string argument.
+Use the specified drift file for calculations
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-tick"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#calc_005ftickadj-exit-status">calc_tickadj exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-drift_002dfile">calc_tickadj drift-file</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">tick option (-t)</h4>
+
+<p><a name="index-calc_005ftickadj_002dtick-5"></a>
+This is the &ldquo;tick value of this host&rdquo; option.
+This option takes a number argument.
+The current tick which to adjustment will be calculated
+<div class="node">
+<p><hr>
+<a name="calc_005ftickadj-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#calc_005ftickadj-tick">calc_tickadj tick</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#calc_005ftickadj-Invocation">calc_tickadj Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">calc_tickadj exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/calc_tickadj/calc_tickadj.in b/scripts/calc_tickadj/calc_tickadj.in
new file mode 100644
index 0000000..38b826e
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.in
@@ -0,0 +1,59 @@
+#! @PATH_PERL@ -w
+#
+# drift of 104.8576 -> +1 tick. Base of 10000 ticks.
+#
+# 970306 HMS Deal with nanoseconds. Fix sign of adjustments.
+package calc_tickadj;
+use strict;
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ };
+ my $drift_file = $opts->{'drift-file'};
+ my $tick = $opts->{'tick'};
+
+ if (!$tick) {
+ my ($fl) = `tickadj`;
+ if (defined $fl && $fl =~ /(?:KERNEL|PRESET)?\s*tick\s+=\s+(\d+)/) {
+ $tick = $1;
+ }
+ else {
+ die "Could not get tick value, try manually with -t/--tick\n";
+ }
+ }
+
+ # Drift file is in PPM where Milion is actually 2**20
+ my $cvt = (2 ** 20) / $tick;
+ my $drift = 0.;
+
+ open my $dfh, $drift_file or die "Could not open $drift_file: $!\n";
+
+ $drift = <$dfh>;
+
+ close $dfh;
+ die "Invalid drift file value <$drift>" if $drift !~ /[+-]?\d+\.?[0-9]+/;
+
+ while ($drift < 0) {
+ $drift += $cvt;
+ $tick--;
+ }
+
+ while ($drift > $cvt) {
+ $drift -= $cvt;
+ $tick++;
+ }
+
+ printf "%.3f (drift)\n", $drift;
+ printf "%d usec; %d nsec\n", $tick, ($tick + ($drift/$cvt)) * 1000;
+
+ return 0;
+}
+
+@calc_tickadj_opts@
+
+1;
+__END__
diff --git a/scripts/calc_tickadj/calc_tickadj.man.in b/scripts/calc_tickadj/calc_tickadj.man.in
new file mode 100644
index 0000000..18e2310
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.man.in
@@ -0,0 +1,108 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH calc_tickadj 1calc_tickadjman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-yLaGPB/ag-LLaOOB)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:04 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]calc_tickadj\fP
+\- Calculates optimal value for tick given ntp drift file.
+.SH SYNOPSIS
+\f\*[B-Font]calc_tickadj\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.br
+.in +4
+.nf
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.in -4
+.fi
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-drift\-file\f[]=\f\*[I-Font]string\f[]
+Ntp drift file to use.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tick\f[]=\f\*[I-Font]number\f[]
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.mdoc.in b/scripts/calc_tickadj/calc_tickadj.mdoc.in
new file mode 100644
index 0000000..265ec39
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.mdoc.in
@@ -0,0 +1,84 @@
+.Dd December 2 2014
+.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:08 AM by AutoGen 5.18.5pre4
+.\" From the definitions calc_tickadj-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm calc_tickadj
+.Nd Calculates "optimal" value for tick given ntp drift file.
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+The \fBcalc_tickadj\fP script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+.sp
+The example output of
+.Bd -literal -offset indent
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+.Ed
+.sp
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of \-23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+.sp
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+.sp
+\fBcalc_tickadj\fP tries to determine the the tick value by using
+\fBtickadj\fP program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl d Ar string , Fl \-drift\-file Ns = Ns Ar string
+Ntp drift file to use.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /etc/ntp/drift
+.sp
+Use the specified drift file for calculations
+.It Fl t Ar number , Fl \-tick Ns = Ns Ar number
+Tick value of this host.
+This option takes an integer number as its argument.
+.sp
+The current tick which to adjustment will be calculated
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBcalc_tickadj\fP
+option definitions.
diff --git a/scripts/calc_tickadj/calc_tickadj.texi b/scripts/calc_tickadj/calc_tickadj.texi
new file mode 100644
index 0000000..d15b428
--- /dev/null
+++ b/scripts/calc_tickadj/calc_tickadj.texi
@@ -0,0 +1,37 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename calc_tickadj.info
+@settitle calc_tickadj User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{calc_tickadj}, a program from the NTP
+Project, that is used calculate optimal tick value based on given drift file.
+@end ifinfo
+
+@direntry
+* calc_tickadj: (calc_tickadj). Calculate optimal tick value from a drift file.
+@end direntry
+
+@titlepage
+@title calc_tickadj User's Manual
+@subtitle calc_tickadj, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@node Top, calc_tickadj Description, (dir), (dir)
+@top calc_tickadj User's Manual
+
+This document describes the use of the NTP Project's @code{calc_tickadj} program.
+This document applies to version @value{VERSION} of @code{calc_tickadj}.
+
+@shortcontents
+
+@menu
+* calc_tickadj Description:: Description
+* calc_tickadj Invocation:: Invoking calc_tickadj
+@end menu
+
+@include invoke-calc_tickadj.texi
diff --git a/scripts/calc_tickadj/invoke-calc_tickadj.menu b/scripts/calc_tickadj/invoke-calc_tickadj.menu
new file mode 100644
index 0000000..865a0d7
--- /dev/null
+++ b/scripts/calc_tickadj/invoke-calc_tickadj.menu
@@ -0,0 +1 @@
+* calc_tickadj Invocation:: Invoking calc_tickadj
diff --git a/scripts/calc_tickadj/invoke-calc_tickadj.texi b/scripts/calc_tickadj/invoke-calc_tickadj.texi
new file mode 100644
index 0000000..c274279
--- /dev/null
+++ b/scripts/calc_tickadj/invoke-calc_tickadj.texi
@@ -0,0 +1,102 @@
+@node calc_tickadj Invocation
+@section Invoking calc_tickadj
+@pindex calc_tickadj
+@cindex Calculates "optimal" value for tick given ntp drift file.
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-calc_tickadj.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:10 AM by AutoGen 5.18.5pre4
+# From the definitions calc_tickadj-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+The @code{calc_tickadj} script uses provided ntp drift file to generate optimal
+tick value. Generally, ntpd can do better job if the drift value is the
+smallest possible number.
+
+The example output of
+@example
+$ ./calc_tickadj
+81.699 (drift)
+9999 usec; 9999779 nsec
+$ cat /etc/ntp/drift
+-23.159
+@end example
+
+means the following. If tick on that box is 10,000, by making the value 9999
+we'll shift the box from its current drift of -23.159 to a drift of 81.699, and
+in doing so we'll speed the clock up a little every second instead of slowing
+the clock down a little.
+
+If 'tick' on that box is 10,000,000 then by setting it to 9999779 the drift
+value will be somewhere around 0.0.
+
+@code{calc_tickadj} tries to determine the the tick value by using
+@code{tickadj} program from ntp package. If this doesn't work you can specify
+current tick manually on command line.
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{calc_tickadj} program.
+
+@menu
+* calc_tickadj usage:: calc_tickadj help/usage (@option{--help})
+* calc_tickadj drift-file:: drift-file option (-d)
+* calc_tickadj tick:: tick option (-t)
+* calc_tickadj exit status:: exit status
+@end menu
+
+@node calc_tickadj usage
+@subsection calc_tickadj help/usage (@option{--help})
+@cindex calc_tickadj help
+
+This is the automatically generated usage text for calc_tickadj.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+calc_tickadj - Calculates "optimal" value for tick given ntp drift file. - Ver. 4.2.7p467
+USAGE: calc_tickadj [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ -d, --drift-file=str Ntp drift file to use
+ -t, --tick=num Tick value of this host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node calc_tickadj drift-file
+@subsection drift-file option (-d)
+@cindex calc_tickadj-drift-file
+
+This is the ``ntp drift file to use'' option.
+This option takes a string argument.
+Use the specified drift file for calculations
+@node calc_tickadj tick
+@subsection tick option (-t)
+@cindex calc_tickadj-tick
+
+This is the ``tick value of this host'' option.
+This option takes a number argument.
+The current tick which to adjustment will be calculated
+@node calc_tickadj exit status
+@subsection calc_tickadj exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/deprecated/freq_adj.in b/scripts/deprecated/freq_adj.in
new file mode 100644
index 0000000..88eb390
--- /dev/null
+++ b/scripts/deprecated/freq_adj.in
@@ -0,0 +1,97 @@
+#! @PATH_PERL@ -w
+
+die "perl5 needed\n" unless ($] > 5);
+
+use Getopt::Std;
+use vars qw($opt_n);
+
+getopts('d:nt:');
+
+#chop($ncpu = `sysctl -n hw.ncpu`);
+#die "Found $ncpu CPUs; can only be run on systems with 1 CPU.\n" if ($ncpu > 1);
+
+$driftfile = "/etc/ntp.drift";
+$driftfile = $opt_d if defined($opt_d);
+
+chop($timer = `sysctl -n kern.timecounter.hardware 2> /dev/null`);
+
+$timer =~ tr/\U/\L/;
+
+if ($timer eq '') {
+ open(DM, "/var/run/dmesg.boot");
+ while(<DM>) {
+ # Timecounter "i8254" frequency 1193182 Hz
+ if (/^Timecounter "(\w+)"\s+/) {
+ $timer = $1;
+ last;
+ }
+ }
+ close(DM);
+}
+
+$opt_t = $timer if !defined($opt_t);
+
+if ($timer ne '') { # $timer found...
+ if ($opt_t ne '') { # - and $opt_t found
+ if ($timer ne $opt_t) { # - - and they differ
+ warn "You specified a $opt_t timer but I detected a $timer timer.\n";
+ usage();
+ exit 1;
+ } else { # - - and they are the same
+ ;
+ }
+ } else { # - but no $opt_t specified; this is OK
+ ;
+ }
+} else { # No $timer found...
+ if ($opt_t ne '') { # - but $opt_t was specified
+ $timer = $opt_t; # - - so use it.
+ } else { # - and neither was $opt_t
+ warn "I can't tell what timer you have. Please specify one.\n";
+ usage();
+ exit 1;
+ }
+}
+
+open(DF, $driftfile) || die "Can't open driftfile ($driftfile): $!\n";
+while(<DF>) {
+ chop;
+ if (/^(-?\d+\.\d+)(\s\d)?$/) {
+ $drift = $1;
+ } else {
+ die "Bogus value in driftfile $driftfile: <$_>\n";
+ }
+}
+close(DF);
+
+print "NTP drift is <$drift>\n";
+
+# Convert from NTP's idea of PPM to a decimal equivalent
+$freq_adj = int ( $drift * ( 10 ** 6 / 2 ** 20) );
+print "normalized freq_adj is <$freq_adj>\n";
+
+$freq_adj = int ( ( $freq_adj - 1 ) / 2 );
+print "Applying freq_adj of <".-$freq_adj.">\n";
+
+$sysctl = "machdep.".$timer."_freq";
+
+chop($mach_freq = `sysctl -n $sysctl`);
+
+print "$sysctl is <$mach_freq>\n";
+
+$n_mach_freq = $mach_freq - $freq_adj;
+
+if (defined($opt_n)) {
+ print "$sysctl $mach_freq -> $n_mach_freq\n";
+} else {
+ print "i8254: ".`sysctl -w $sysctl=$n_mach_freq`;
+}
+
+sub usage {
+ print STDERR <<EOUsage
+Usage: $0 [-d drift_file] [-n] [-t timer]
+where "drift_file" defaults to /etc/ntp.drift
+and "timer" is usually "tsc" or "i8254"
+and "-n" says "don't really change anything, just say what would happen".
+EOUsage
+}
diff --git a/scripts/deprecated/hpadjtime.sh b/scripts/deprecated/hpadjtime.sh
new file mode 100755
index 0000000..3de2a40
--- /dev/null
+++ b/scripts/deprecated/hpadjtime.sh
@@ -0,0 +1,18 @@
+#! /bin/sh
+val=1
+if [ -f /bin/uname -o -f /usr/bin/uname ]; then
+ set `uname -a | tr '[A-Z]' '[a-z]'`
+ case "$1" in
+ hp-ux) case "$3" in
+ *.10.*) val=1 ;;
+ *.09.03 | *.09.10) case "$5" in
+ 9000/3*) val=1 ;;
+ *) val=0 ;;
+ esac ;;
+ *) val=0 ;;
+ esac
+ ;;
+ *)
+ esac
+fi
+exit $val
diff --git a/scripts/deprecated/html2man.in b/scripts/deprecated/html2man.in
new file mode 100755
index 0000000..adc4848
--- /dev/null
+++ b/scripts/deprecated/html2man.in
@@ -0,0 +1,234 @@
+#! @PATH_PERL@ -w
+#
+# html2man: Converts the NTP HTML documentation to man page format
+#
+# This file require the Perl HTML::TokeParser module:
+# http://search.cpan.org/search?module=HTML::TokeParser
+#
+# Depending on where this is run from, you might need to modify $MANDIR below.
+#
+# Hacked together by Peter Boettcher <boettcher@ll.mit.edu>
+# Last modified: <Mon Jan 28 17:24:38 2002 by pwb>
+
+require HTML::TokeParser;
+
+# use strict; # I can dream...
+
+$MANDIR = "./man";
+
+# HTML files to convert. Also include per-file info here:
+# name of man page, man section, 'see also' section
+%manfiles = (
+ 'ntpd' => ['ntpd', @NTPD_MS@, 'ntp.conf(5), ntpq(@NTPQ_MS@), ntpdc(@NTPDC_MS@)'],
+ 'ntpq' => ['ntpq', @NTPQ_MS@, 'ntp_decode(5), ntpd(@NTPD_MS@), ntpdc(@NTPDC_MS@)'],
+ 'ntpdate' => ['ntpdate', @NTPDATE_MS@, 'ntpd(@NTPD_MS@)'],
+ 'ntpdc' => ['ntpdc', @NTPDC_MS@, 'ntpd(@NTPD_MS@)'],
+ 'ntptime' => ['ntptime', @NTPTIME_MS@, 'ntpd(@NTPD_MS@), ntpdate(@NTPDATE_MS@)'],
+ 'ntptrace' => ['ntptrace', @NTPTRACE_MS@, 'ntpd(@NTPD_MS@)'],
+ 'ntp-wait' => ['ntp-wait', @NTP_WAIT_MS@, 'ntpd(@NTPD_MS@)'],
+ 'keygen' => ['ntp-keygen', @NTP_KEYGEN_MS@, 'ntpd(@NTPD_MS@), ntp_auth(5)'],
+ 'tickadj' => ['tickadj', @TICKADJ_MS@, 'ntpd(@NTPD_MS@)'],
+ 'confopt' => ['ntp.conf', 5, 'ntpd(@NTPD_MS@), ntp_auth(5), ntp_mon(5), ntp_acc(5), ntp_clock(5), ntp_misc(5)'],
+ 'authopt' => ['ntp_auth', 5, 'ntp.conf(5), ntpd(@NTPD_MS@)'],
+ 'monopt' => ['ntp_mon', 5, 'ntp.conf(5), ntp_decode(5)'],
+ 'accopt' => ['ntp_acc', 5, 'ntp.conf(5)'],
+ 'clockopt' => ['ntp_clock', 5, 'ntp.conf(5)'],
+ 'decode' => ['ntp_decode', 5, 'ntpq(@NTPQ_MS@), ntp_mon(5)'],
+ 'miscopt' => ['ntp_misc', 5, 'ntp.conf(5)']);
+
+%table_headers = (
+ 'ntpd' => 'l l l l.',
+ 'ntpq' => 'l l.',
+ 'monopt' => 'l l l.',
+ 'decode' => 'l l l l.',
+ 'authopt' => 'c c c c c c.'
+);
+
+# Disclaimer to go in SEE ALSO section of the man page
+$seealso_disclaimer = "The official HTML documentation.\n\n" .
+ "This file was automatically generated from HTML source.\n";
+
+mkdir $MANDIR, 0777;
+mkdir "$MANDIR/man8", 0777;
+mkdir "$MANDIR/man5", 0777;
+
+# Do the actual processing
+foreach $file (keys %manfiles) {
+ process($file);
+}
+# End of main function
+
+
+
+# Do the real work
+sub process {
+ my($filename) = @_;
+ $fileinfo = $manfiles{$filename};
+
+ $p = HTML::TokeParser->new("$filename.html") || die "Can't open $filename.html: $!";
+ $fileout = "$MANDIR/man$fileinfo->[1]/$fileinfo->[0].$fileinfo->[1]";
+ open(MANOUT, ">$fileout")
+ || die "Can't open: $!";
+
+ $p->get_tag("title");
+ $name = $p->get_text("/title");
+ $p->get_tag("hr"); # Skip past image and quote, hopefully
+
+ # Setup man header
+ print MANOUT ".TH " . $fileinfo->[0] . " " . $fileinfo->[1] . "\n";
+ print MANOUT ".SH NAME\n";
+ $pat = $fileinfo->[0];
+ if ($name =~ /$pat/) {
+ } else {
+ # Add the manpage name, if not in the HTML title already
+ print MANOUT "$fileinfo->[0] - ";
+ }
+ print MANOUT "$name\n.SH \\ \n\n";
+
+ @fontstack = ();
+ $deflevel = 0;
+ $pre = 0;
+ $ignore = 0;
+ $first_td = 1;
+ # Now start scanning. We basically print everything after translating some tags.
+ # $token->[0] has "T", "S", "E" for Text, Start, End
+ # $token->[1] has the tag name, or text (for "T" case)
+ # Theres lots more in the world of tokens, but who cares?
+ while (my $token = $p->get_token) {
+ if($token->[0] eq "T") {
+ my $text = $token->[1];
+ if (!$pre) {
+ if($tag) {
+ $text =~ s/^[\n\t ]*//;
+ }
+ $text =~ s/^[\n\t ][\n\t ]+$//;
+ $text =~ s/[\n\t ]+/ /g;
+ $text =~ s/&nbsp\;/ /g;
+ $text =~ s/&gt\;/>/g;
+ $text =~ s/&lt\;/</g;
+ $text =~ s/&quot\;/"/g;
+ $text =~ s/&amp\;/&/g;
+ $text =~ s/^\./\\[char46]/;
+ }
+ print MANOUT "$text";
+ $tag = 0;
+ }
+ if($token->[0] eq "S") {
+ if($token->[1] eq "h4") {
+ my $text = uc($p->get_trimmed_text("/h4"));
+ # ignore these sections in ntpd.html
+ if ($filename eq "ntpd" &&
+ ($text eq "CONFIGURATION OPTIONS")) {
+ $ignore = 1;
+ close(MANOUT);
+ open(MANOUT, ">/dev/null");
+ } elsif ($ignore) {
+ $ignore = 0;
+ close(MANOUT);
+ open(MANOUT, ">>$fileout");
+ }
+ print MANOUT "\n\n.SH $text\n";
+ }
+ if($token->[1] eq "tt") {
+ push @fontstack, "tt";
+ print MANOUT "\\fB";
+ }
+ if($token->[1] eq "i") {
+ push @fontstack, "i";
+ print MANOUT "\\fI";
+ }
+ if($token->[1] eq "address") {
+ my $text = $p->get_trimmed_text("/address");
+ print MANOUT "\n.SH AUTHOR\n$text\n";
+ }
+ if($token->[1] eq "dt" || $token->[1] eq "br" && $deflevel > 0) {
+ print MANOUT "\n.TP 8\n";
+ $tag = 1;
+ }
+ if($token->[1] eq "dd") {
+ print MANOUT "\n";
+ $tag = 1;
+ }
+ if($token->[1] eq "dl") {
+ $deflevel+=1;
+ if ($deflevel > 0) {
+ print MANOUT "\n.RS ", $deflevel > 1 ? 8 : 0;
+ }
+ }
+ if($token->[1] eq "p") {
+ print MANOUT "\n";
+ }
+ if($token->[1] eq "pre") {
+ print MANOUT "\n.nf";
+ $pre = 1;
+ }
+ if($token->[1] eq "table") {
+ print MANOUT "\n.TS\n";
+ print MANOUT "expand allbox tab(%);\n";
+ print MANOUT $table_headers{$filename};
+ print MANOUT "\n";
+ }
+ if($token->[1] eq "td") {
+ if ($first_td == 0) {
+ print MANOUT " % ";
+ }
+ $first_td = 0;
+ }
+ }
+ elsif($token->[0] eq "E") {
+ if($token->[1] eq "h4") {
+ $tag = 1;
+ }
+ if($token->[1] eq "tt") {
+ $f = pop @fontstack;
+ if($f ne "tt") {
+ warn "Oops, mismatched font! Trying to continue\n";
+ }
+ if ($#fontstack < 0) { $fontswitch = "\\fR"; }
+ elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; }
+ else { $fontswitch = "\\fI"; }
+ print MANOUT "$fontswitch";
+ }
+ if($token->[1] eq "i") {
+ $f = pop @fontstack;
+ if($f ne "i") {
+ warn "Oops, mismatched font! Trying to continue\n";
+ }
+ if ($#fontstack < 0) { $fontswitch = "\\fR"; }
+ elsif ($fontstack[$#fontstack] eq "tt") { $fontswitch = "\\fB"; }
+ else { $fontswitch = "\\fI"; }
+ print MANOUT "$fontswitch";
+ }
+ if($token->[1] eq "dl") {
+ if ($deflevel > 0) {
+ print MANOUT "\n.RE";
+ }
+ print MANOUT "\n";
+ $deflevel-=1;
+ }
+ if($token->[1] eq "p") {
+ print MANOUT "\n";
+ $tag = 1;
+ }
+ if($token->[1] eq "pre") {
+ print MANOUT "\n.fi";
+ $pre = 0;
+ }
+ if($token->[1] eq "table") {
+ print MANOUT ".TE\n";
+ }
+ if($token->[1] eq "tr") {
+ print MANOUT "\n";
+ $first_td = 1;
+ }
+ }
+ }
+ if ($ignore) {
+ close(MANOUT);
+ open(MANOUT, ">>$fileout");
+ }
+ print MANOUT "\n.SH SEE ALSO\n\n";
+ print MANOUT "$fileinfo->[2]\n\n";
+ print MANOUT "$seealso_disclaimer\n";
+ close(MANOUT);
+}
diff --git a/scripts/deprecated/ntp-close b/scripts/deprecated/ntp-close
new file mode 100755
index 0000000..b5077e6
--- /dev/null
+++ b/scripts/deprecated/ntp-close
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+lynx -source http://www.eecis.udel.edu/~mills/ntp/clock2.htm |
+ sed -n -e 's,).*,,' -e' /([0-9.]*$/s/.*(//p' |
+ xargs ntpdate -q |
+ sort -n +7 > /tmp/ntp-close
+
+# From: Neal McBurnett <neal@bcn.boulder.co.us>
diff --git a/scripts/deprecated/ntp-groper b/scripts/deprecated/ntp-groper
new file mode 100755
index 0000000..1fd0cfe
--- /dev/null
+++ b/scripts/deprecated/ntp-groper
@@ -0,0 +1,95 @@
+#!/bin/sh
+#
+# ntpgroper host ...
+#
+# This script checks each hostname given as an argument to see if
+# it is running NTP. It reports one of the following messages (assume
+# the host is named "dumbo.hp.com":
+#
+# dumbo.hp.com not registered in DNS
+# dumbo.hp.com not responding to ping
+# dumbo.hp.com refused ntpq connection
+# dumbo.hp.com not responding to NTP
+# dumbo.hp.com answers NTP version 2, stratum: 3, ref: telford.nsa.hp.com
+# dumbo.hp.com answers NTP version 3, stratum: 3, ref: telford.nsa.hp.com
+#
+# It ain't pretty, but it is kinda useful.
+#
+# Walter Underwood, 11 Feb 1993, wunder@hpl.hp.com
+#
+# converted to /bin/sh from /bin/ksh by scott@ee.udel.edu 24 Mar 1993
+
+PATH="/usr/local/etc:$PATH" export PATH
+
+verbose=1
+logfile=/tmp/cntp-log$$
+ntpqlog=/tmp/cntp-ntpq$$
+
+# I wrap the whole thing in parens so that it is possible to redirect
+# all the output somewhere, if desired.
+(
+for host in $*
+do
+ # echo "Trying $host."
+
+ gethost $host > /dev/null 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo "$host not registered in DNS"
+ continue
+ fi
+
+ ping $host 64 1 > /dev/null 2>&1
+ if [ $? -ne 0 ]
+ then
+ echo "$host not responding to ping"
+ continue
+ fi
+
+ # Attempt to contact with version 3 ntp, then try version 2.
+ for version in 3 2
+ do
+
+ ntpq -c "ntpversion $version" -p $host > $ntpqlog 2>&1
+
+ if fgrep -s 'Connection refused' $ntpqlog
+ then
+ echo "$host refused ntpq connection"
+ break
+ fi
+
+ responding=1
+ fgrep -s 'timed out, nothing received' $ntpqlog > /dev/null && responding=0
+
+ if [ $responding -eq 1 ]
+ then
+ ntpq -c "ntpversion $version" -c rl $host > $ntpqlog
+
+ # First we extract the reference ID (usually a host or a clock)
+ synchost=`fgrep "refid=" $ntpqlog`
+ #synchost=${synchost##*refid=} # strip off the beginning of the line
+ #synchost=${synchost%%,*} # strip off the end
+ synchost=`expr "$synchost" : '.*refid=\([^,]*\),.*'`
+
+ # Next, we get the stratum
+ stratum=`fgrep "stratum=" $ntpqlog`
+ #stratum=${stratum##*stratum=}
+ #stratum=${stratum%%,*}
+ stratum=`expr "$stratum" : '.*stratum=\([^,]*\),.*'`
+
+ echo "$host answers NTP version $version, stratum: $stratum, ref: $synchost"
+ break;
+ fi
+
+ if [ $version -eq 2 -a $responding -eq 0 ]
+ then
+ echo "$host not responding to NTP"
+ fi
+ done
+done
+)
+# ) >> $logfile
+
+if [ -f $ntpqlog ]; then
+ rm $ntpqlog
+fi
diff --git a/scripts/deprecated/ntp-restart b/scripts/deprecated/ntp-restart
new file mode 100755
index 0000000..0a1d58a
--- /dev/null
+++ b/scripts/deprecated/ntp-restart
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# This script can be used to kill and restart the NTP daemon. Edit the
+# /usr/local/bin/ntpd line to fit.
+#
+kill -INT `ps -ax | egrep "ntpd" | egrep -v "egrep" | sed 's/^\([ 0-9]*\) .*/\1'/`
+sleep 10
+/usr/local/bin/ntpd -g
+/usr/local/bin/ntp-wait
+exit 0
diff --git a/scripts/deprecated/ntp-status b/scripts/deprecated/ntp-status
new file mode 100755
index 0000000..4109124
--- /dev/null
+++ b/scripts/deprecated/ntp-status
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# From: Marc Brett <Marc.Brett@westgeo.com>
+
+# Here's a quick hack which can give you the stratum, delay, offset
+# for any number of ntp servers.
+
+NTPDATE=/usr/local/bin/ntpdate
+NSLOOKUP=/usr/sbin/nslookup
+EGREP=/bin/egrep
+AWK=/bin/awk
+RM=/bin/rm
+FILE=/tmp/ntp.$$
+
+USAGE="Usage: $0 hostname [hostname ...]"
+
+if [ $# -le 0 ]
+then
+ echo $USAGE 2>&1
+ exit 1
+fi
+
+trap '$RM -f $FILE; exit' 1 2 3 4 13 15
+
+for HOST in $*
+do
+ HOSTNAME=`$NSLOOKUP $HOST | $EGREP "Name:" | $AWK '{print $2}'`
+ if [ -n "$HOSTNAME" ]
+ then
+ $NTPDATE -d $HOST 2>/dev/null | $EGREP '^stratum|^delay|^offset|^originate' > $FILE
+ STRATUM=`$EGREP '^stratum' $FILE | $AWK '{print $2}'`
+ OFFSET=`$EGREP '^offset' $FILE | $AWK '{print $2}'`
+ DELAY=`$EGREP '^delay' $FILE | $AWK '{print $2}'`
+ TIMESTAMP=`$EGREP '^originate' $FILE | $AWK '{print $4 " " $5 " " $6 " " $7 " " $8}'`
+ if [ "$STRATUM" -ne 0 ]
+ then
+ echo "$HOSTNAME: stratum:$STRATUM delay:$DELAY offset:$OFFSET $TIMESTAMP"
+ else
+ echo $HOSTNAME: Not running NTP
+ fi
+ fi
+
+done
+
+$RM -f $FILE
diff --git a/scripts/invoke-plot_summary.menu b/scripts/invoke-plot_summary.menu
new file mode 100644
index 0000000..b287f20
--- /dev/null
+++ b/scripts/invoke-plot_summary.menu
@@ -0,0 +1 @@
+* plot_summary Invocation:: Invoking plot_summary
diff --git a/scripts/invoke-plot_summary.texi b/scripts/invoke-plot_summary.texi
new file mode 100644
index 0000000..64930ed
--- /dev/null
+++ b/scripts/invoke-plot_summary.texi
@@ -0,0 +1,121 @@
+@node plot_summary Invocation
+@section Invoking plot_summary
+@pindex plot_summary
+@cindex plot statistics generated by summary script
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-plot_summary.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:45 AM by AutoGen 5.18.5pre4
+# From the definitions plot_summary-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{plot_summary} program.
+
+@menu
+* plot_summary usage:: plot_summary help/usage (@option{--help})
+* plot_summary directory:: directory option
+* plot_summary identifier:: identifier option
+* plot_summary peer:: peer option
+* plot_summary plot-term:: plot-term option
+* plot_summary output-file:: output-file option
+* plot_summary exit status:: exit status
+@end menu
+
+@node plot_summary usage
+@subsection plot_summary help/usage (@option{--help})
+@cindex plot_summary help
+
+This is the automatically generated usage text for plot_summary.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+plot_summary - plot statistics generated by summary script - Ver. 4.2.7p482
+USAGE: plot_summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ --directory=str Where the summary files are
+ --identifier=str Origin of the data
+ --offset-limit=float Limit of absolute offset
+ --peer=str Peers to generate plots for
+ - may appear multiple times
+ --plot-term=str Gnuplot terminal
+ --output-file=str Output file
+ --dont-wait Don't wait for keystroke between plots
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node plot_summary directory
+@subsection directory option
+@cindex plot_summary-directory
+
+This is the ``where the summary files are'' option.
+This option takes a string argument.
+ The directory where the @code{plot_summary} will search for the
+ *_summary files generated by @code{summary} script.
+@node plot_summary identifier
+@subsection identifier option
+@cindex plot_summary-identifier
+
+This is the ``origin of the data'' option.
+This option takes a string argument.
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+@node plot_summary peer
+@subsection peer option
+@cindex plot_summary-peer
+
+This is the ``peers to generate plots for'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+@node plot_summary plot-term
+@subsection plot-term option
+@cindex plot_summary-plot-term
+
+This is the ``gnuplot terminal'' option.
+This option takes a string argument.
+ This is string is passed directly to the @code{gnuplot set terminal}
+ command. Default is @code{x11} if @code{DISPLAY} is set and
+ @code{dumb} is it's not'. See output from @code(gnuplot -e "set
+ terminal") for the list of avalaible options.
+@node plot_summary output-file
+@subsection output-file option
+@cindex plot_summary-output-file
+
+This is the ``output file'' option.
+This option takes a str argument.
+ Output file for @code{gnuplot}, default to stdout.
+@node plot_summary exit status
+@subsection plot_summary exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/invoke-summary.menu b/scripts/invoke-summary.menu
new file mode 100644
index 0000000..f6adfe1
--- /dev/null
+++ b/scripts/invoke-summary.menu
@@ -0,0 +1 @@
+* summary Invocation:: Invoking summary
diff --git a/scripts/invoke-summary.texi b/scripts/invoke-summary.texi
new file mode 100644
index 0000000..3ee25d3
--- /dev/null
+++ b/scripts/invoke-summary.texi
@@ -0,0 +1,103 @@
+@node summary Invocation
+@section Invoking summary
+@pindex summary
+@cindex compute various stastics from NTP stat files
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-summary.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:50 AM by AutoGen 5.18.5pre4
+# From the definitions summary-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{summary} program.
+
+@menu
+* summary usage:: summary help/usage (@option{--help})
+* summary directory:: directory option
+* summary end-date:: end-date option
+* summary output-directory:: output-directory option
+* summary start-date:: start-date option
+* summary exit status:: exit status
+@end menu
+
+@node summary usage
+@subsection summary help/usage (@option{--help})
+@cindex summary help
+
+This is the automatically generated usage text for summary.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+summary - compute various stastics from NTP stat files - Ver. 4.2.7p482
+USAGE: summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ --directory=str Directory containing stat files
+ --end-date=num End date
+ --output-directory=str Output directory
+ --peer-dist-limit=float Peer dist limit
+ --skip-time-steps=float Ignore time offsets larger that this
+ --start-date=num Start date
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node summary directory
+@subsection directory option
+@cindex summary-directory
+
+This is the ``directory containing stat files'' option.
+This option takes a string argument.
+ The directory where @code{ntpd} will search for .stat files generated
+ by @code{ntpd}.
+@node summary end-date
+@subsection end-date option
+@cindex summary-end-date
+
+This is the ``end date'' option.
+This option takes a number argument.
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use @code{date -u +%Y%m%d})
+ to get the timestamp.
+@node summary output-directory
+@subsection output-directory option
+@cindex summary-output-directory
+
+This is the ``output directory'' option.
+This option takes a str argument.
+ The output directory @code{summary} will write all output files to.
+@node summary start-date
+@subsection start-date option
+@cindex summary-start-date
+
+This is the ``start date'' option.
+This option takes a num argument.
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+@node summary exit status
+@subsection summary exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/lib/Makefile.am b/scripts/lib/Makefile.am
new file mode 100644
index 0000000..d7c0c0e
--- /dev/null
+++ b/scripts/lib/Makefile.am
@@ -0,0 +1,5 @@
+perllibdir = @PERLLIBDIR@
+
+nobase_perllib_DATA = NTP/Util.pm
+
+EXTRA_DIST = ${nobase_perllib_DATA}
diff --git a/scripts/lib/Makefile.in b/scripts/lib/Makefile.in
new file mode 100644
index 0000000..1afcf7d
--- /dev/null
+++ b/scripts/lib/Makefile.in
@@ -0,0 +1,583 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/lib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(perllibdir)"
+DATA = $(nobase_perllib_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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@
+perllibdir = @PERLLIBDIR@
+nobase_perllib_DATA = NTP/Util.pm
+EXTRA_DIST = ${nobase_perllib_DATA}
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/lib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/lib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-nobase_perllibDATA: $(nobase_perllib_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(perllibdir)" || $(MKDIR_P) "$(DESTDIR)$(perllibdir)"
+ @list='$(nobase_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
+ $(am__nobase_list) | while read dir files; do \
+ xfiles=; for file in $$files; do \
+ if test -f "$$file"; then xfiles="$$xfiles $$file"; \
+ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
+ test -z "$$xfiles" || { \
+ test "x$$dir" = x. || { \
+ echo "$(MKDIR_P) '$(DESTDIR)$(perllibdir)/$$dir'"; \
+ $(MKDIR_P) "$(DESTDIR)$(perllibdir)/$$dir"; }; \
+ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(perllibdir)/$$dir'"; \
+ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(perllibdir)/$$dir" || exit $$?; }; \
+ done
+
+uninstall-nobase_perllibDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nobase_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
+ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(perllibdir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(perllibdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-nobase_perllibDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-nobase_perllibDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-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-nobase_perllibDATA install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-nobase_perllibDATA
+
+
+# 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/scripts/lib/NTP/Util.pm b/scripts/lib/NTP/Util.pm
new file mode 100644
index 0000000..66f2453
--- /dev/null
+++ b/scripts/lib/NTP/Util.pm
@@ -0,0 +1,137 @@
+package NTP::Util;
+use strict;
+use warnings;
+use Exporter 'import';
+use Carp;
+use version 0.77;
+
+our @EXPORT_OK = qw(ntp_read_vars do_dns ntp_peers ntp_sntp_line);
+
+my $ntpq_path = 'ntpq';
+my $sntp_path = 'sntp';
+
+our $IP_AGNOSTIC;
+
+BEGIN {
+ require Socket;
+ if (version->parse($Socket::VERSION) >= version->parse(1.94)) {
+ Socket->import(qw(getaddrinfo getnameinfo SOCK_RAW AF_INET));
+ $IP_AGNOSTIC = 1;
+ }
+ else {
+ Socket->import(qw(inet_aton SOCK_RAW AF_INET));
+ }
+}
+
+my %obsolete_vars = (
+ phase => 'offset',
+ rootdispersion => 'rootdisp',
+);
+
+sub ntp_read_vars {
+ my ($peer, $vars, $host) = @_;
+ my $do_all = !@$vars;
+ my %out_vars = map {; $_ => undef } @$vars;
+
+ $out_vars{status_line} = {} if $do_all;
+
+ my $cmd = "$ntpq_path -n -c 'rv $peer ".(join ',', @$vars)."'";
+ $cmd .= " $host" if defined $host;
+ $cmd .= " |";
+
+ open my $fh, $cmd or croak "Could not start ntpq: $!";
+
+ while (<$fh>) {
+ return undef if /Connection refused/;
+
+ if (/^asso?c?id=0 status=(\S{4}) (\S+), (\S+),/gi) {
+ $out_vars{status_line}{status} = $1;
+ $out_vars{status_line}{leap} = $2;
+ $out_vars{status_line}{sync} = $3;
+ }
+
+ while (/(\w+)=([^,]+),?\s/g) {
+ my ($var, $val) = ($1, $2);
+ $val =~ s/^"([^"]+)"$/$1/;
+ $var = $obsolete_vars{$var} if exists $obsolete_vars{$var};
+ if ($do_all) {
+ $out_vars{$var} = $val
+ }
+ else {
+ $out_vars{$var} = $val if exists $out_vars{$var};
+ }
+ }
+ }
+
+ close $fh or croak "running ntpq failed: $! (exit status $?)";
+ return \%out_vars;
+}
+
+sub do_dns {
+ my ($host) = @_;
+
+ if ($IP_AGNOSTIC) {
+ my ($err, $res);
+
+ ($err, $res) = getaddrinfo($host, '', {socktype => SOCK_RAW});
+ die "getaddrinfo failed: $err\n" if $err;
+
+ ($err, $res) = getnameinfo($res->{addr}, 0);
+ die "getnameinfo failed: $err\n" if $err;
+
+ return $res;
+ }
+ # Too old perl, do only ipv4
+ elsif ($host =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) {
+ return gethostbyaddr inet_aton($host), AF_INET;
+ }
+ else {
+ return;
+ }
+}
+
+sub ntp_peers {
+ my ($host) = @_;
+
+ my $cmd = "$ntpq_path -np $host |";
+
+ open my $fh, $cmd or croak "Could not start ntpq: $!";
+
+ <$fh> for 1 .. 2;
+
+ my @columns = qw(remote refid st t when poll reach delay offset jitter);
+ my @peers;
+ while (<$fh>) {
+ if (/(?:[\w\.\*-]+\s*){10}/) {
+ my $col = 0;
+ push @peers, { map {; $columns[ $col++ ] => $_ } split /(?<=.)\s+/ };
+ }
+ else {
+ #TODO return error (but not needed anywhere now)
+ warn "ERROR: $_";
+ }
+ }
+
+ close $fh or croak "running ntpq failed: $! (exit status $?)";
+ return \@peers;
+}
+
+# TODO: we don't need this but it would be nice to have all the line parsed
+sub ntp_sntp_line {
+ my ($host) = @_;
+
+ my $cmd = "$sntp_path $host |";
+ open my $fh, $cmd or croak "Could not start sntp: $!";
+
+ my ($offset, $stratum);
+ while (<$fh>) {
+ next if !/^\d{4}-\d\d-\d\d/;
+ chomp;
+ my @output = split / /;
+
+ $offset = $output[3];
+ ($stratum = pop @output) =~ s/s(\d{1,2})/$1/;
+ }
+ close $fh or croak "running sntp failed: $! (exit status $?)";
+ return ($offset, $stratum);
+}
diff --git a/scripts/monitoring/README b/scripts/monitoring/README
new file mode 100644
index 0000000..f8eb0a9
--- /dev/null
+++ b/scripts/monitoring/README
@@ -0,0 +1,158 @@
+This directory contains support for monitoring the local clock of xntp daemons.
+
+WARNING: The scripts and routines contained in this directory are beta
+ release! Do not depend on their correct operation. They are,
+ however, in regular use at University of Erlangen-Nuernberg.
+ No severe problems are known for this code.
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+PLEASE THINK TWICE BEFORE STARTING MONITORING REMOTE XNTP DEAMONS !!!!
+MONITORING MAY INCREASE THE LOAD OF THE DEAMON MONITORED AND MAY
+INCREASE THE NETWORK LOAD SIGNIFICANTLY
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+Files are:
+
+README:
+ This file
+
+ntptrap:
+ perl script to log ntp mode 6 trap messages.
+
+ It sends a set_trap request to each server given and dumps the
+ trap messages received. It handles refresh of set_trap.
+ Currently it handles only NTP V2, however the NTP V3 servers
+ also accept v2 requests. It will not interpret v3 system and
+ peer stati correctly.
+
+ usage:
+ ntptrap [-n] [-p <port>] [-l <debug-output>] servers...
+
+ -n: do not send set_trap requests
+
+ port: port to listen for responses
+ useful if you have a configured trap
+
+ debug-output: file to write trace output to (for debugging)
+
+ This script convinced me that ntp trap messages are only of
+ little use.
+
+ntploopstat:
+ perl script to gather loop info statistics from xntpd via mode 7
+ LOOP_INFO requests.
+
+ This script collects data to allow monitoring of remote xntp servers
+ where it is not possible to directly access the loopstats file
+ produced by xntpd itself. Of course, it can be used to sample
+ a local server if it is not configured to produce a loopstats file.
+
+ Please note, this program poses a high load on the server as
+ a communication takes place every delay seconds ! USE WITH CARE !
+
+ usage:
+ ntploopstat [-d<delay>] [-t<timeout>] [-l <logfile>] [-v] [ntpserver]
+
+ delay: number of seconds to wait between samples
+ default: 60 seconds
+ timeout: number of seconds to wait for reply
+ default 12 seconds
+ logfile: file to log samples to
+ default: loopstats:<ntpserver>:
+ (note the trailing colon)
+ This name actually is a prefix.
+ The file name is dynamically derived by appending
+ the name of the month the sample belongs to.
+ Thus all samples of a month end up in the same file.
+
+ the format of the files generated is identical to the format used by
+ xntpd with the loopstats file:
+ MJD <seconds since midnight UTC> offset frequency compliance
+
+ if a timeout occurs the next sample is tried after delay/2 seconds
+
+ The script will terminate after MAX_FAIL (currently 60)
+ consecutive errors.
+
+ Errors are counted for:
+ - error on send call
+ - error on select call
+ - error on recv call
+ - short packet received
+ - bad packet
+ - error on open for logfile
+
+ntploopwatch:
+ perl script to display loop filter statistics collected by ntploopstat
+ or dumped directly by xntpd.
+
+ Gnuplot is used to produce a graphical representation of the sample
+ values, that have been preprocessed and analysed by this script.
+
+ It can either be called to produce a printout of specific data set or
+ used to continously monitor the values. Monitoring is achieved by
+ periodically reprocessing the logfiles, which are updated regularly
+ either by a running ntploopstat process or by the running xntpd.
+
+ usage:
+ to watch statistics permanently:
+ ntploopwatch [-v[<level>]] [-c <config-file>] [-d <working-dir>]
+
+ to get a single print out specify also
+ -P<printer> [-s<samples>]
+ [-S <start-time>] [-E <end-time>]
+ [-O <MaxOffs>] [-o <MinOffs>]
+
+ level: level of verbosity for debugging
+ config-file: file to read configurable settings from
+ On each iteration it is checked and reread
+ if it has been changed
+ default: loopwatch.config
+ working-dir: specify working directory for process, affects
+ interpretation of relative file names
+
+ All other flags are only useful with printing plots, as otherwise
+ command line values would be replaced by settings from the config file.
+
+ printer: specify printer to print plot
+ BSD print systems semantics apply; if printer
+ is omitted the name "ps" is used; plots are
+ prepared using PostScript, thus the printer
+ should best accept postscript input
+
+ For the following see also the comments in loopwatch.config.SAMPLE
+
+ samples: use last # samples from input data
+ start-time: ignore input samples before this date
+ end-time: ignore input samples after this date
+ if both start-time and end-time are specified
+ a given samples value is ignored
+ MaxOffs:
+ MinOffs: restrict value range
+
+loopwatch.config.SAMPLE:
+ sample config file for ntploopwatch
+ each configurable option is explained there
+
+lr.pl:
+ linear regression package used by ntploopwatch to compute
+ linear approximations for frequency and offset values
+ within display range
+
+timelocal.pl:
+
+ used during conversion of ISO_DATE_TIME values specified in
+ loopwatch config files to unix epoch values (seconds since
+ 1970-01-01_00:00_00 UTC)
+
+ A version of this file is distributed with perl-4.x, however,
+ it has a bug related to dates crossing 1970, causing endless loops..
+ The version contained here has been fixed.
+
+ntp.pl:
+ perl support for ntp v2 mode 6 message handling
+ WARNING: This code is beta level - it triggers a memory leak;
+ as for now it is not quite clear, wether this is caused by a
+ bug in perl or by bad usage of perl within this script.
+
diff --git a/scripts/monitoring/loopwatch.config.SAMPLE b/scripts/monitoring/loopwatch.config.SAMPLE
new file mode 100644
index 0000000..8cefea3
--- /dev/null
+++ b/scripts/monitoring/loopwatch.config.SAMPLE
@@ -0,0 +1,89 @@
+# sample configuration and control file for ntploowatch
+#
+# delay: sampling interval in seconds
+delay=60
+# samples: use only last # samples
+samples=600
+# DO NOT USE srcprefix in shared config files
+# srcprefix: name of file to read samples from
+# current time suffix (month name) is appended
+# defaults to "./var@$STATHOST/loopstats."
+# The string "$STATHOST"is replaced by the name of the host
+# being monitored
+#srcprefix=./var@$STATHOST/loopstats.
+#
+# showoffs: yes/no control display of offset values
+showoffs=yes
+#
+# showfreq: yes/no control display of frequency values
+showfreq=yes
+#
+# showcmpl: yes/no control display of compliance values
+showcmpl=no
+#
+# showoreg: yes/no control display of linear regression of offset values
+showoreg=no
+#
+# showfreg: yes/no control display of linear regression of frequency values
+showfreg=no
+#
+# timebase: dynamic/ISO_DATE_TIME point of zero for linear regression
+# ISO_DATE_TIME: yyyy-mm-dd_hh:mm:ss.ms
+# values are interpreted using local time zone
+# parts omitted from front default to current date/time
+# parts omitted from end default to lowest permitted values
+# to get aa:bb being interpreted as minutes:seconds use aa:bb.0
+# for dynamic '00:00:00.0 of current day' is used
+timebase=dynamic
+#
+# freqbase: dynamic/<baseval>
+# if a number is given, subtract this from sampling values for display
+# if dynamic is selected, freqbase is adjusted to fit into the range of
+# offset values
+freqbase=dynamic
+#
+# cmplscale: dynamic/<scaling>
+# if a number is given, the sampling values are divided by this number
+# if dynamic is selected, cmplscale is adjusted to fit into the range of
+# offset values
+cmplscale=dynamic
+#
+# DumbScale: 0/1
+# 0 enables dynamic adjust of value ranges for freqbase and cmplscale
+# timescale is labeled with human readable times
+# 1 only uses explicit scaling for numbers
+# timescale is labeled with hours relative to timebase
+DumbScale=0
+#
+# StartTime: none/ISO_DATE_TIME
+# ignore any samples before the specified date
+StartTime=none
+#
+# EndTime: none/ISO_DATE_TIME
+# ignore any samples after the specified date
+#
+# if both StartTime and EndTime are specified
+# the value specified for samples is ignored
+EndTime=none
+#
+# MaxOffs: none/<number>
+# limit display (y-axis) to values not larger than <number>
+MaxOffset=none
+#
+# MinOffs: none/<number>
+# limit display (y-axis) to values not smaller than <number>
+MinOffset=none
+
+#
+# verbose: <number>
+# specify level for debugging
+# default is 0 for printing and 1 for monitoring
+# level 1 will just print a timestamp for any display update
+# (this is every delay seconds)
+verbose=1
+#
+# deltaT: <seconds>
+# mark `holes' in the sample data grater than <seconds>
+# by a break in the plot
+# default: 512 seconds
+deltaT=512
diff --git a/scripts/monitoring/lr.pl b/scripts/monitoring/lr.pl
new file mode 100644
index 0000000..1ab3e3f
--- /dev/null
+++ b/scripts/monitoring/lr.pl
@@ -0,0 +1,151 @@
+;#
+;# lr.pl,v 3.1 1993/07/06 01:09:08 jbj Exp
+;#
+;#
+;# Linear Regression Package for perl
+;# to be 'required' from perl
+;#
+;# Copyright (c) 1992
+;# Frank Kardel, Rainer Pruy
+;# Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;# Copyright (c) 1997 by
+;# Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+;# (Converted to a PERL 5.004 package)
+;#
+;#############################################################
+
+package lr;
+
+##
+## y = A + Bx
+##
+## B = (n * Sum(xy) - Sum(x) * Sum(y)) / (n * Sum(x^2) - Sum(x)^2)
+##
+## A = (Sum(y) - B * Sum(x)) / n
+##
+
+##
+## interface
+##
+;# init(tag); initialize data set for tag
+;# sample(x, y, tag); enter sample
+;# Y(x, tag); compute y for given x
+;# X(y, tag); compute x for given y
+;# r(tag); regression coefficient
+;# cov(tag); covariance
+;# A(tag);
+;# B(tag);
+;# sigma(tag); standard deviation
+;# mean(tag);
+#########################
+
+sub init
+{
+ my $self = shift;
+
+ $self->{n} = 0;
+ $self->{sx} = 0.0;
+ $self->{sx2} = 0.0;
+ $self->{sxy} = 0.0;
+ $self->{sy} = 0.0;
+ $self->{sy2} = 0.0;
+}
+
+sub sample($$)
+{
+ my $self = shift;
+ my($_x, $_y) = @_;
+
+ ++($self->{n});
+ $self->{sx} += $_x;
+ $self->{sy} += $_y;
+ $self->{sxy} += $_x * $_y;
+ $self->{sx2} += $_x**2;
+ $self->{sy2} += $_y**2;
+}
+
+sub B()
+{
+ my $self = shift;
+
+ return 1 unless ($self->{n} * $self->{sx2} - $self->{sx}**2);
+ return ($self->{n} * $self->{sxy} - $self->{sx} * $self->{sy})
+ / ($self->{n} * $self->{sx2} - $self->{sx}**2);
+}
+
+sub A()
+{
+ my $self = shift;
+
+ return ($self->{sy} - B() * $self->{sx}) / $self->{n};
+}
+
+sub Y()
+{
+ my $self = shift;
+
+ return A() + B() * $_[$[];
+}
+
+sub X()
+{
+ my $self = shift;
+
+ return ($_[$[] - A()) / B();
+}
+
+sub r()
+{
+ my $self = shift;
+
+ my $s = ($self->{n} * $self->{sx2} - $self->{sx}**2)
+ * ($self->{n} * $self->{sy2} - $self->{sy}**2);
+
+ return 1 unless $s;
+
+ return ($self->{n} * $self->{sxy} - $self->{sx} * $self->{sy}) / sqrt($s);
+}
+
+sub cov()
+{
+ my $self = shift;
+
+ return ($self->{sxy} - $self->{sx} * $self->{sy} / $self->{n})
+ / ($self->{n} - 1);
+}
+
+sub sigma()
+{
+ my $self = shift;
+
+ return 0 if $self->{n} <= 1;
+ return sqrt(($self->{sy2} - ($self->{sy} * $self->{sy}) / $self->{n})
+ / ($self->{n}));
+}
+
+sub mean()
+{
+ my $self = shift;
+
+ return 0 if $self->{n} <= 0;
+ return $self->{sy} / $self->{n};
+}
+
+sub new
+{
+ my $class = shift;
+ my $self = {
+ (n => undef,
+ sx => undef,
+ sx2 => undef,
+ sxy => undef,
+ sy => undef,
+ sy2 => undef)
+ };
+ bless $self, $class;
+ init($self);
+ return $self;
+}
+
+1;
diff --git a/scripts/monitoring/ntp.pl b/scripts/monitoring/ntp.pl
new file mode 100644
index 0000000..3478f71
--- /dev/null
+++ b/scripts/monitoring/ntp.pl
@@ -0,0 +1,506 @@
+#!/usr/bin/perl -w
+;#
+;# ntp.pl,v 3.1 1993/07/06 01:09:09 jbj Exp
+;#
+;# process loop filter statistics file and either
+;# - show statistics periodically using gnuplot
+;# - or print a single plot
+;#
+;# Copyright (c) 1992
+;# Rainer Pruy Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;#
+;#############################################################
+
+package ntp;
+
+$NTP_version = 2;
+$ctrl_mode=6;
+
+$byte1 = (($NTP_version & 0x7)<< 3) & 0x34 | ($ctrl_mode & 0x7);
+$MAX_DATA = 468;
+
+$sequence = 0; # initial sequence number incred before used
+$pad=4;
+$do_auth=0; # no possibility today
+$keyid=0;
+;#list if known keys (passwords)
+%KEYS = ( 0, "\200\200\200\200\200\200\200\200",
+ );
+
+;#-----------------------------------------------------------------------------
+;# access routines for ntp control packet
+ ;# NTP control message format
+ ;# C LI|VN|MODE LI 2bit=00 VN 3bit=2(3) MODE 3bit=6 : $byte1
+ ;# C R|E|M|Op R response E error M more Op opcode
+ ;# n sequence
+ ;# n status
+ ;# n associd
+ ;# n offset
+ ;# n count
+ ;# a+ data (+ padding)
+ ;# optional authentication data
+ ;# N key
+ ;# N2 checksum
+
+;# first byte of packet
+sub pkt_LI { return ($_[$[] >> 6) & 0x3; }
+sub pkt_VN { return ($_[$[] >> 3) & 0x7; }
+sub pkt_MODE { return ($_[$[] ) & 0x7; }
+
+;# second byte of packet
+sub pkt_R { return ($_[$[] & 0x80) == 0x80; }
+sub pkt_E { return ($_[$[] & 0x40) == 0x40; }
+sub pkt_M { return ($_[$[] & 0x20) == 0x20; }
+sub pkt_OP { return $_[$[] & 0x1f; }
+
+;#-----------------------------------------------------------------------------
+
+sub setkey
+{
+ local($id,$key) = @_;
+
+ $KEYS{$id} = $key if (defined($key));
+ if (! defined($KEYS{$id}))
+ {
+ warn "Key $id not yet specified - key not changed\n";
+ return undef;
+ }
+ return ($keyid,$keyid = $id)[$[];
+}
+
+;#-----------------------------------------------------------------------------
+sub numerical { $a <=> $b; }
+
+;#-----------------------------------------------------------------------------
+
+sub send #'
+{
+ local($fh,$opcode, $associd, $data,$address) = @_;
+ $fh = caller(0)."'$fh";
+
+ local($junksize,$junk,$packet,$offset,$ret);
+ $offset = 0;
+
+ $sequence++;
+ while(1)
+ {
+ $junksize = length($data);
+ $junksize = $MAX_DATA if $junksize > $MAX_DATA;
+
+ ($junk,$data) = $data =~ /^(.{$junksize})(.*)$/;
+ $packet
+ = pack("C2n5a".(($junk eq "") ? 0 : &pad($junksize+12,$pad)-12),
+ $byte1,
+ ($opcode & 0x1f) | ($data ? 0x20 : 0),
+ $sequence,
+ 0, $associd,
+ $offset, $junksize, $junk);
+ if ($do_auth)
+ {
+ ;# not yet
+ }
+ $offset += $junksize;
+
+ if (defined($address))
+ {
+ $ret = send($fh, $packet, 0, $address);
+ }
+ else
+ {
+ $ret = send($fh, $packet, 0);
+ }
+
+ if (! defined($ret))
+ {
+ warn "send failed: $!\n";
+ return undef;
+ }
+ elsif ($ret != length($packet))
+ {
+ warn "send failed: sent only $ret from ".length($packet). "bytes\n";
+ return undef;
+ }
+ return $sequence unless $data;
+ }
+}
+
+;#-----------------------------------------------------------------------------
+;# status interpretation
+;#
+sub getval
+{
+ local($val,*list) = @_;
+
+ return $list{$val} if defined($list{$val});
+ return sprintf("%s#%d",$list{"-"},$val) if defined($list{"-"});
+ return "unknown-$val";
+}
+
+;#---------------------------------
+;# system status
+;#
+;# format: |LI|CS|SECnt|SECode| LI=2bit CS=6bit SECnt=4bit SECode=4bit
+sub ssw_LI { return ($_[$[] >> 14) & 0x3; }
+sub ssw_CS { return ($_[$[] >> 8) & 0x3f; }
+sub ssw_SECnt { return ($_[$[] >> 4) & 0xf; }
+sub ssw_SECode { return $_[$[] & 0xf; }
+
+%LI = ( 0, "leap_none", 1, "leap_add_sec", 2, "leap_del_sec", 3, "sync_alarm", "-", "leap");
+%ClockSource = (0, "sync_unspec",
+ 1, "sync_pps",
+ 2, "sync_lf_clock",
+ 3, "sync_hf_clock",
+ 4, "sync_uhf_clock",
+ 5, "sync_local_proto",
+ 6, "sync_ntp",
+ 7, "sync_udp/time",
+ 8, "sync_wristwatch",
+ 9, "sync_telephone",
+ "-", "ClockSource",
+ );
+
+%SystemEvent = (0, "event_unspec",
+ 1, "event_freq_not_set",
+ 2, "event_freq_set",
+ 3, "event_spike_detect",
+ 4, "event_freq_mode",
+ 5, "event_clock_sync",
+ 6, "event_restart",
+ 7, "event_panic_stop",
+ 8, "event_no_sys_peer",
+ 9, "event_leap_armed",
+ 10, "event_leap_disarmed",
+ 11, "event_leap_event",
+ 12, "event_clock_step",
+ 13, "event_kern",
+ 14, "event_loaded_leaps",
+ 15, "event_stale_leaps",
+ "-", "event",
+ );
+sub LI
+{
+ &getval(&ssw_LI($_[$[]),*LI);
+}
+sub ClockSource
+{
+ &getval(&ssw_CS($_[$[]),*ClockSource);
+}
+
+sub SystemEvent
+{
+ &getval(&ssw_SECode($_[$[]),*SystemEvent);
+}
+
+sub system_status
+{
+ return sprintf("%s, %s, %d event%s, %s", &LI($_[$[]), &ClockSource($_[$[]),
+ &ssw_SECnt($_[$[]), ((&ssw_SECnt($_[$[])==1) ? "" : "s"),
+ &SystemEvent($_[$[]));
+}
+;#---------------------------------
+;# peer status
+;#
+;# format: |PStat|PSel|PCnt|PCode| Pstat=6bit PSel=2bit PCnt=4bit PCode=4bit
+sub psw_PStat_config { return ($_[$[] & 0x8000) == 0x8000; }
+sub psw_PStat_authenable { return ($_[$[] & 0x4000) == 0x4000; }
+sub psw_PStat_authentic { return ($_[$[] & 0x2000) == 0x2000; }
+sub psw_PStat_reach { return ($_[$[] & 0x1000) == 0x1000; }
+sub psw_PStat_bcast { return ($_[$[] & 0x0800) == 0x0800; }
+sub psw_PStat { return ($_[$[] >> 10) & 0x3f; }
+sub psw_PSel { return ($_[$[] >> 8) & 0x3; }
+sub psw_PCnt { return ($_[$[] >> 4) & 0xf; }
+sub psw_PCode { return $_[$[] & 0xf; }
+
+%PeerSelection = (0, "sel_reject",
+ 1, "sel_falsetick",
+ 2, "sel_excess",
+ 3, "sel_outlier",
+ 4, "sel_candidate",
+ 5, "sel_backup",
+ 6, "sel_sys.peer",
+ 6, "sel_pps.peer",
+ "-", "PeerSel",
+ );
+%PeerEvent = (0, "event_unspec",
+ 1, "event_mobilize",
+ 2, "event_demobilize",
+ 3, "event_unreach",
+ 4, "event_reach",
+ 5, "event_restart",
+ 6, "event_no_reply",
+ 7, "event_rate_exceed",
+ 8, "event_denied",
+ 9, "event_leap_armed",
+ 10, "event_sys_peer",
+ 11, "event_clock_event",
+ 12, "event_bad_auth",
+ 13, "event_popcorn",
+ 14, "event_intlv_mode",
+ 15, "event_intlv_err",
+ "-", "event",
+ );
+
+sub PeerSelection
+{
+ &getval(&psw_PSel($_[$[]),*PeerSelection);
+}
+
+sub PeerEvent
+{
+ &getval(&psw_PCode($_[$[]),*PeerEvent);
+}
+
+sub peer_status
+{
+ local($x) = ("");
+ $x .= "config," if &psw_PStat_config($_[$[]);
+ $x .= "authenable," if &psw_PStat_authenable($_[$[]);
+ $x .= "authentic," if &psw_PStat_authentic($_[$[]);
+ $x .= "reach," if &psw_PStat_reach($_[$[]);
+ $x .= "bcast," if &psw_PStat_bcast($_[$[]);
+
+ $x .= sprintf(" %s, %d event%s, %s", &PeerSelection($_[$[]),
+ &psw_PCnt($_[$[]), ((&psw_PCnt($_[$[]) == 1) ? "" : "s"),
+ &PeerEvent($_[$[]));
+ return $x;
+}
+
+;#---------------------------------
+;# clock status
+;#
+;# format: |CStat|CEvnt| CStat=8bit CEvnt=8bit
+sub csw_CStat { return ($_[$[] >> 8) & 0xff; }
+sub csw_CEvnt { return $_[$[] & 0xff; }
+
+%ClockStatus = (0, "clk_nominal",
+ 1, "clk_timeout",
+ 2, "clk_badreply",
+ 3, "clk_fault",
+ 4, "clk_badsig",
+ 5, "clk_baddate",
+ 6, "clk_badtime",
+ "-", "clk",
+ );
+
+sub clock_status
+{
+ return sprintf("%s, last %s",
+ &getval(&csw_CStat($_[$[]),*ClockStatus),
+ &getval(&csw_CEvnt($_[$[]),*ClockStatus));
+}
+
+;#---------------------------------
+;# error status
+;#
+;# format: |Err|reserved| Err=8bit
+;#
+sub esw_Err { return ($_[$[] >> 8) & 0xff; }
+
+%ErrorStatus = (0, "err_unspec",
+ 1, "err_auth_fail",
+ 2, "err_invalid_fmt",
+ 3, "err_invalid_opcode",
+ 4, "err_unknown_assoc",
+ 5, "err_unknown_var",
+ 6, "err_invalid_value",
+ 7, "err_adm_prohibit",
+ );
+
+sub error_status
+{
+ return sprintf("%s", &getval(&esw_Err($_[$[]),*ErrorStatus));
+}
+
+;#-----------------------------------------------------------------------------
+;#
+;# cntrl op name translation
+
+%CntrlOpName = (0, "reserved",
+ 1, "read_status",
+ 2, "read_variables",
+ 3, "write_variables",
+ 4, "read_clock_variables",
+ 5, "write_clock_variables",
+ 6, "set_trap",
+ 7, "trap_response",
+ 8, "configure",
+ 9, "saveconf",
+ 10, "read_mru",
+ 11, "read_ordlist",
+ 12, "rqst_nonce",
+ 31, "unset_trap", # !!! unofficial !!!
+ "-", "cntrlop",
+ );
+
+sub cntrlop_name
+{
+ return &getval($_[$[],*CntrlOpName);
+}
+
+;#-----------------------------------------------------------------------------
+
+$STAT_short_pkt = 0;
+$STAT_pkt = 0;
+
+;# process a NTP control message (response) packet
+;# returns a list ($ret,$data,$status,$associd,$op,$seq,$auth_keyid)
+;# $ret: undef --> not yet complete
+;# "" --> complete packet received
+;# "ERROR" --> error during receive, bad packet, ...
+;# else --> error packet - list may contain useful info
+
+
+sub handle_packet
+{
+ local($pkt,$from) = @_; # parameters
+ local($len_pkt) = (length($pkt));
+;# local(*FRAGS,*lastseen);
+ local($li_vn_mode,$r_e_m_op,$seq,$status,$associd,$offset,$count,$data);
+ local($autch_keyid,$auth_cksum);
+
+ $STAT_pkt++;
+ if ($len_pkt < 12)
+ {
+ $STAT_short_pkt++;
+ return ("ERROR","short packet received");
+ }
+
+ ;# now break packet apart
+ ($li_vn_mode,$r_e_m_op,$seq,$status,$associd,$offset,$count,$data) =
+ unpack("C2n5a".($len_pkt-12),$pkt);
+ $data=substr($data,$[,$count);
+ if ((($len_pkt - 12) - &pad($count,4)) >= 12)
+ {
+ ;# looks like an authenticator
+ ($auth_keyid,$auth_cksum) =
+ unpack("Na8",substr($pkt,$len_pkt-12+$[,12));
+ $STAT_auth++;
+ ;# no checking of auth_cksum (yet ?)
+ }
+
+ if (&pkt_VN($li_vn_mode) != $NTP_version)
+ {
+ $STAT_bad_version++;
+ return ("ERROR","version ".&pkt_VN($li_vn_mode)."packet ignored");
+ }
+
+ if (&pkt_MODE($li_vn_mode) != $ctrl_mode)
+ {
+ $STAT_bad_mode++;
+ return ("ERROR", "mode ".&pkt_MODE($li_vn_mode)." packet ignored");
+ }
+
+ ;# handle single fragment fast
+ if ($offset == 0 && &pkt_M($r_e_m_op) == 0)
+ {
+ $STAT_single_frag++;
+ if (&pkt_E($r_e_m_op))
+ {
+ $STAT_err_pkt++;
+ return (&error_status($status),
+ $data,$status,$associd,&pkt_OP($r_e_m_op),$seq,
+ $auth_keyid);
+ }
+ else
+ {
+ return ("",
+ $data,$status,$associd,&pkt_OP($r_e_m_op),$seq,
+ $auth_keyid);
+ }
+ }
+ else
+ {
+ ;# fragment - set up local name space
+ $id = "$from$seq".&pkt_OP($r_e_m_op);
+ $ID{$id} = 1;
+ *FRAGS = "$id FRAGS";
+ *lastseen = "$id lastseen";
+
+ $STAT_frag++;
+
+ $lastseen = 1 if !&pkt_M($r_e_m_op);
+ if (!%FRAGS)
+ {
+ print((&pkt_M($r_e_m_op) ? " more" : "")."\n");
+ $FRAGS{$offset} = $data;
+ ;# save other info
+ @FRAGS = ($status,$associd,&pkt_OP($r_e_m_op),$seq,$auth_keyid,$r_e_m_op);
+ }
+ else
+ {
+ print((&pkt_M($r_e_m_op) ? " more" : "")."\n");
+ ;# add frag to previous - combine on the fly
+ if (defined($FRAGS{$offset}))
+ {
+ $STAT_dup_frag++;
+ return ("ERROR","duplicate fragment at $offset seq=$seq");
+ }
+
+ $FRAGS{$offset} = $data;
+
+ undef($loff);
+ foreach $off (sort numerical keys(%FRAGS))
+ {
+ next unless defined($FRAGS{$off});
+ if (defined($loff) &&
+ ($loff + length($FRAGS{$loff})) == $off)
+ {
+ $FRAGS{$loff} .= $FRAGS{$off};
+ delete $FRAGS{$off};
+ last;
+ }
+ $loff = $off;
+ }
+
+ ;# return packet if all frags arrived
+ ;# at most two frags with possible padding ???
+ if ($lastseen && defined($FRAGS{0}) &&
+ (((scalar(@x=sort numerical keys(%FRAGS)) == 2) &&
+ (length($FRAGS{0}) + 8) > $x[$[+1]) ||
+ (scalar(@x=sort numerical keys(%FRAGS)) < 2)))
+ {
+ @x=((&pkt_E($r_e_m_op) ? &error_status($status) : ""),
+ $FRAGS{0},@FRAGS);
+ &pkt_E($r_e_m_op) ? $STAT_err_frag++ : $STAT_frag_all++;
+ undef(%FRAGS);
+ undef(@FRAGS);
+ undef($lastseen);
+ delete $ID{$id};
+ &main'clear_timeout($id);
+ return @x;
+ }
+ else
+ {
+ &main'set_timeout($id,time+$timeout,"&ntp'handle_packet_timeout(\"".unpack("H*",$id)."\");"); #'";
+ }
+ }
+ return (undef);
+ }
+}
+
+sub handle_packet_timeout
+{
+ local($id) = @_;
+ local($r_e_m_op,*FRAGS,*lastseen,@x) = (@FRAGS[$[+5]);
+
+ *FRAGS = "$id FRAGS";
+ *lastseen = "$id lastseen";
+
+ @x=((&pkt_E($r_e_m_op) ? &error_status($status) : "TIMEOUT"),
+ $FRAGS{0},@FRAGS[$[ .. $[+4]);
+ $STAT_frag_timeout++;
+ undef(%FRAGS);
+ undef(@FRAGS);
+ undef($lastseen);
+ delete $ID{$id};
+ return @x;
+}
+
+
+sub pad
+{
+ return $_[$[+1] * int(($_[$[] + $_[$[+1] - 1) / $_[$[+1]);
+}
+
+1;
diff --git a/scripts/monitoring/ntploopstat b/scripts/monitoring/ntploopstat
new file mode 100644
index 0000000..7583c7c
--- /dev/null
+++ b/scripts/monitoring/ntploopstat
@@ -0,0 +1,458 @@
+#!/usr/bin/perl -w
+# --*-perl-*-
+;#
+;# ntploopstat,v 3.1 1993/07/06 01:09:11 jbj Exp
+;#
+;# Poll NTP server using NTP mode 7 loopinfo request.
+;# Log info and timestamp to file for processing by ntploopwatch.
+;#
+;#
+;# Copyright (c) 1992
+;# Rainer Pruy Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;#################################################################
+;#
+;# The format written to the logfile is the same as used by xntpd
+;# for the loopstats file.
+;# This script however allows to gather loop filter statistics from
+;# remote servers where you do not have access to the loopstats logfile.
+;#
+;# Please note: Communication delays affect the accuracy of the
+;# timestamps recorded. Effects from these delays will probably
+;# not show up, as timestamps are recorded to the second only.
+;# (Should have implemented &gettimeofday()..)
+;#
+
+$0 =~ s!^.*/([^/]+)$!$1!; # beautify script name
+
+$ntpserver = 'localhost'; # default host to poll
+$delay = 60; # default sampling rate
+ ;# keep it shorter than minpoll (=64)
+ ;# to get all values
+
+require "ctime.pl";
+;# handle bug in early ctime distributions
+$ENV{'TZ'} = 'MET' unless defined($ENV{'TZ'}) || $] > 4.010;
+
+if (defined(@ctime'MoY))
+{
+ *MonthName = *ctime'MoY;
+}
+else
+{
+ @MonthName = ('Jan','Feb','Mar','Apr','May','Jun',
+ 'Jul','Aug','Sep','Oct','Nov','Dec');
+}
+
+;# this routine can be redefined to point to syslog if necessary
+sub msg
+{
+ return unless $verbose;
+
+ print STDERR "$0: ";
+ printf STDERR @_;
+}
+
+;#############################################################
+;#
+;# process command line
+$usage = <<"E-O-S";
+
+usage:
+ $0 [-d<delay>] [-t<timeout>] [-l <logfile>] [-v] [ntpserver]
+E-O-S
+
+while($_ = shift)
+{
+ /^-v(\d*)$/ && ($verbose=($1 eq '') ? 1 : $1,1) && next;
+ /^-d(\d*)$/ &&
+ do {
+ ($1 ne '') && ($delay = $1,1) && next;
+ @ARGV || die("$0: delay value missing after -d\n$usage");
+ $delay = shift;
+ ($delay >= 0) || die("$0: bad delay value \"$delay\"\n$usage");
+ next;
+ };
+ /^-l$/ &&
+ do {
+ @ARGV || die("$0: logfile missing after -l\n$usage");
+ $logfile = shift;
+ next;
+ };
+ /^-t(\d*(\.\d*)?)$/ &&
+ do {
+ ($1 ne '') && ($timeout = $1,1) && next;
+ @ARGV || die("$0: timeout value missing after -t\n$usage\n");
+ $timeout = shift;
+ ($timeout > 0) ||
+ die("$0: bad timeout value \"$timeout\"\n$usage");
+ next;
+ };
+
+ /^-/ && die("$0: unknown option \"$_\"\n$usage");
+
+ ;# any other argument is server to poll
+ $ntpserver = $_;
+ last;
+}
+
+if (@ARGV)
+{
+ warn("unexpected arguments: ".join(" ",@ARGV).".\n");
+ die("$0: too many servers specified\n$usage");
+}
+
+;# logfile defaults to include server name
+;# The name of the current month is appended and
+;# the file is opened and closed for each sample.
+;#
+$logfile = "loopstats:$ntpserver." unless defined($logfile);
+$timeout = 12.0 unless defined($timeout); # wait $timeout seconds for reply
+
+$MAX_FAIL = 60; # give up after $MAX_FAIL failed polls
+
+
+$MJD_1970 = 40587;
+
+if (eval 'require "syscall.ph";')
+{
+ if (defined(&SYS_gettimeofday))
+ {
+ ;# assume standard
+ ;# gettimeofday(struct timeval *tp,struct timezone *tzp)
+ ;# syntax for gettimeofday syscall
+ ;# tzp = NULL -> undef
+ ;# tp = (long,long)
+ eval 'sub time { local($tz) = pack("LL",0,0);
+ (&msg("gettimeofday failed: $!\n"),
+ return (time))
+ unless syscall(&SYS_gettimeofday,$tz,undef) == 0;
+ local($s,$us) = unpack("LL",$tz);
+ return $s + $us/1000000; }';
+ local($t1,$t2,$t3);
+ $t1 = time;
+ eval '$t2 = &time;';
+ $t3 = time;
+ die("$0: gettimeofday failed: $@.\n") if defined($@) && $@;
+ die("$0: gettimeofday inconsistency time=$t1,gettimeofday=$t2,time=$t2\n")
+ if (int($t1) != int($t2) && int($t3) != int($t2));
+ &msg("Using gettimeofday for timestamps\n");
+ }
+ else
+ {
+ warn("No gettimeofday syscall found - using time builtin for timestamps\n");
+ eval 'sub time { return time; }';
+ }
+}
+else
+{
+ warn("No syscall.ph file found - using time builtin for timestamps\n");
+ eval 'sub time { return time; }';
+}
+
+
+;#------------------+
+;# from ntp_request.h
+;#------------------+
+
+;# NTP mode 7 packet format:
+;# Byte 1: ResponseBit MoreBit Version(3bit) Mode(3bit)==7
+;# Byte 2: AuthBit Sequence # - 0 - 127 see MoreBit
+;# Byte 3: Implementation #
+;# Byte 4: Request Code
+;#
+;# Short 1: Err(3bit) NumItems(12bit)
+;# Short 2: MBZ(3bit)=0 DataItemSize(12bit)
+;# 0 - 500 byte Data
+;# if AuthBit is set:
+;# Long: KeyId
+;# 2xLong: AuthCode
+
+;#
+$IMPL_XNTPD = 2;
+$REQ_LOOP_INFO = 8;
+
+
+;# request packet for REQ_LOOP_INFO:
+;# B1: RB=0 MB=0 V=2 M=7
+;# B2: S# = 0
+;# B3: I# = IMPL_XNTPD
+;# B4: RC = REQ_LOOP_INFO
+;# S1: E=0 NI=0
+;# S2: MBZ=0 DIS=0
+;# data: 32 byte 0 padding
+;# 8byte timestamp if encryption, 0 padding otherwise
+$loopinfo_reqpkt =
+ pack("CCCC nn x32 x8", 0x17, 0, $IMPL_XNTPD, $REQ_LOOP_INFO, 0, 0);
+
+;# ignore any auth data in packets
+$loopinfo_response_size =
+ 1+1+1+1+2+2 # header size like request pkt
+ + 8 # l_fp last_offset
+ + 8 # l_fp drift_comp
+ + 4 # u_long compliance
+ + 4 # u_long watchdog_timer
+ ;
+$loopinfo_response_fmt = "C4n2N2N2NN";
+$loopinfo_response_fmt_v2 = "C4n2N2N2N2N";
+
+;#
+;# prepare connection to server
+;#
+
+;# workaround for broken socket.ph on dynix_ptx
+eval 'sub INTEL {1;}' unless defined(&INTEL);
+eval 'sub ATT {1;}' unless defined(&ATT);
+
+require "sys/socket.ph";
+
+require 'netinet/in.ph';
+
+;# if you do not have netinet/in.ph enable the following lines
+;#eval 'sub INADDR_ANY { 0x00000000; }' unless defined(&INADDR_ANY);
+;#eval 'sub IPPRORO_UDP { 17; }' unless defined(&IPPROTO_UDP);
+
+if ($ntpserver =~ /^((0x?)?\w+)\.((0x?)?\w+)\.((0x?)?\w+)\.((0x?)?\w+)$/)
+{
+ local($a,$b,$c,$d) = ($1,$3,$5,$7);
+ $a = oct($a) if defined($2);
+ $b = oct($b) if defined($4);
+ $c = oct($c) if defined($6);
+ $d = oct($d) if defined($8);
+ $server_addr = pack("C4", $a,$b,$c,$d);
+
+ $server_mainname
+ = (gethostbyaddr($server_addr,&AF_INET))[$[] || $ntpserver;
+}
+else
+{
+ ($server_mainname,$server_addr)
+ = (gethostbyname($ntpserver))[$[,$[+4];
+
+ die("$0: host \"$ntpserver\" is unknown\n")
+ unless defined($server_addr);
+}
+&msg ("Address of server \"$ntpserver\" is \"%d.%d.%d.%d\"\n",
+ unpack("C4",$server_addr));
+
+$proto_udp = (getprotobyname('udp'))[$[+2] || &IPPROTO_UDP;
+
+$ntp_port =
+ (getservbyname('ntp','udp'))[$[+2] ||
+ (warn "Could not get port number for service \"ntp/udp\" using 123\n"),
+ ($ntp_port=123);
+
+;#
+0 && &SOCK_DGRAM; # satisfy perl -w ...
+socket(S, &AF_INET, &SOCK_DGRAM, $proto_udp) ||
+ die("Cannot open socket: $!\n");
+
+bind(S, pack("S n N x8", &AF_INET, 0, &INADDR_ANY)) ||
+ die("Cannot bind: $!\n");
+
+($my_port, $my_addr) = (unpack("S n a4 x8",getsockname(S)))[$[+1,$[+2];
+
+&msg("Listening at address %d.%d.%d.%d port %d\n",
+ unpack("C4",$my_addr), $my_port);
+
+$server_inaddr = pack("Sna4x8", &AF_INET, $ntp_port, $server_addr);
+
+;############################################################
+;#
+;# the main loop:
+;# send request
+;# get reply
+;# wait til next sample time
+
+undef($lasttime);
+$lostpacket = 0;
+
+while(1)
+{
+ $stime = &time;
+
+ &msg("Sending request $stime...\n");
+
+ $ret = send(S,$loopinfo_reqpkt,0,$server_inaddr);
+
+ if (! defined($ret) || $ret < length($loopinfo_reqpkt))
+ {
+ warn("$0: send failed ret=($ret): $!\n");
+ $fail++;
+ next;
+ }
+
+ &msg("Waiting for reply...\n");
+
+ $mask = ""; vec($mask,fileno(S),1) = 1;
+ $ret = select($mask,undef,undef,$timeout);
+
+ if (! defined($ret))
+ {
+ warn("$0: select failed: $!\n");
+ $fail++;
+ next;
+ }
+ elsif ($ret == 0)
+ {
+ warn("$0: request to $ntpserver timed out ($timeout seconds)\n");
+ ;# do not count this event as failure
+ ;# it usually this happens due to dropped udp packets on noisy and
+ ;# havily loaded lines, so just try again;
+ $lostpacket = 1;
+ next;
+ }
+
+ &msg("Receiving reply...\n");
+
+ $len = 520; # max size of a mode 7 packet
+ $reply = ""; # just make it defined for -w
+ $ret = recv(S,$reply,$len,0);
+
+ if (!defined($ret))
+ {
+ warn("$0: recv failed: $!\n");
+ $fail++;
+ next;
+ }
+
+ $etime = &time;
+ &msg("Received at\t$etime\n");
+
+ ;#$time = ($stime + $etime) / 2; # symmetric delay assumed
+ $time = $etime; # the above assumption breaks for X25
+ ;# so taking etime makes timestamps be a
+ ;# little late, but keeps them increasing
+ ;# monotonously
+
+ &msg(sprintf("Reply from %d.%d.%d.%d took %f seconds\n",
+ (unpack("SnC4",$ret))[$[+2 .. $[+5], ($etime - $stime)));
+
+ if ($len < $loopinfo_response_size)
+ {
+ warn("$0: short packet ($len bytes) received ($loopinfo_response_size bytes expected\n");
+ $fail++;
+ next;
+ }
+
+ ($b1,$b2,$b3,$b4,$s1,$s2,
+ $offset_i,$offset_f,$drift_i,$drift_f,$compl,$watchdog)
+ = unpack($loopinfo_response_fmt,$reply);
+
+ ;# check reply
+ if (($s1 >> 12) != 0) # error !
+ {
+ die("$0: got error reply ".($s1>>12)."\n");
+ }
+ if (($b1 != 0x97 && $b1 != 0x9f) || # Reply NotMore V=2 M=7
+ ($b2 != 0 && $b2 != 0x80) || # S=0 Auth no/yes
+ $b3 != $IMPL_XNTPD || # ! IMPL_XNTPD
+ $b4 != $REQ_LOOP_INFO || # Ehh.. not loopinfo reply ?
+ $s1 != 1 || # ????
+ ($s2 != 24 && $s2 != 28) #
+ )
+ {
+ warn("$0: Bad/unexpected reply from server:\n");
+ warn(" \"".unpack("H*",$reply)."\"\n");
+ warn(" ".sprintf("b1=%x b2=%x b3=%x b4=%x s1=%d s2=%d\n",
+ $b1,$b2,$b3,$b4,$s1,$s2));
+ $fail++;
+ next;
+ }
+ elsif ($s2 == 28)
+ {
+ ;# seems to be a version 2 xntpd
+ ($b1,$b2,$b3,$b4,$s1,$s2,
+ $offset_i,$offset_f,$drift_i,$drift_f,$compl_i,$compl_f,$watchdog)
+ = unpack($loopinfo_response_fmt_v2,$reply);
+ $compl = &lfptoa($compl_i, $compl_f);
+ }
+
+ $time -= $watchdog;
+
+ $offset = &lfptoa($offset_i, $offset_f);
+ $drift = &lfptoa($drift_i, $drift_f);
+
+ &log($time,$offset,$drift,$compl) && ($fail = 0);;
+}
+continue
+{
+ die("$0: Too many failures - terminating\n") if $fail > $MAX_FAIL;
+ &msg("Sleeping " . ($lostpacket ? ($delay / 2) : $delay) . " seconds...\n");
+
+ sleep($lostpacket ? ($delay / 2) : $delay);
+ $lostpacket = 0;
+}
+
+sub log
+{
+ local($time,$offs,$freq,$cmpl) = @_;
+ local($y,$m,$d);
+ local($fname,$suff) = ($logfile);
+
+
+ ;# silently drop sample if distance to last sample is too low
+ if (defined($lasttime) && ($lasttime + 2) >= $time)
+ {
+ &msg("Dropped packet - old sample\n");
+ return 1;
+ }
+
+ ;# $suff determines which samples end up in the same file
+ ;# could have used $year (;-) or WeekOfYear, DayOfYear,....
+ ;# Change it to your suit...
+
+ ($d,$m,$y) = (localtime($time))[$[+3 .. $[+5];
+ $suff = sprintf("%04d%02d%02d",$y+1900,$m+1,$d);
+ $fname .= $suff;
+ if (!open(LOG,">>$fname"))
+ {
+ warn("$0: open($fname) failed: $!\n");
+ $fail++;
+ return 0;
+ }
+ else
+ {
+ ;# file format
+ ;# MJD seconds offset drift compliance
+ printf LOG ("%d %.3lf %.8lf %.7lf %d\n",
+ int($time/86400)+$MJD_1970,
+ $time - int($time/86400) * 86400,
+ $offs,$freq,$cmpl);
+ close(LOG);
+ $lasttime = $time;
+ }
+ return 1;
+}
+
+;# see ntp_fp.h to understand this
+sub lfptoa
+{
+ local($i,$f) = @_;
+ local($sign) = 1;
+
+
+ if ($i & 0x80000000)
+ {
+ if ($f == 0)
+ {
+ $i = -$i;
+ }
+ else
+ {
+ $f = -$f;
+ $i = ~$i;
+ $i += 1; # 2s complement
+ }
+ $sign = -1;
+ ;#print "NEG: $i $f\n";
+ }
+ else
+ {
+ ;#print "POS: $i $f\n";
+ }
+ ;# unlike xntpd I have perl do the dirty work.
+ ;# Using floats here may affect precision, but
+ ;# currently these bits aren't significant anyway
+ return $sign * ($i + $f/2**32);
+}
diff --git a/scripts/monitoring/ntploopwatch b/scripts/monitoring/ntploopwatch
new file mode 100644
index 0000000..a94695c
--- /dev/null
+++ b/scripts/monitoring/ntploopwatch
@@ -0,0 +1,1667 @@
+#!/usr/bin/perl -w
+;# --*-perl-*--
+;#
+;# /src/NTP/ntp4-dev/scripts/monitoring/ntploopwatch,v 4.7 2004/11/14 16:11:05 kardel RELEASE_20050508_A
+;#
+;# process loop filter statistics file and either
+;# - show statistics periodically using gnuplot
+;# - or print a single plot
+;#
+;# Copyright (c) 1992-1998
+;# Rainer Pruy, Friedrich-Alexander Universität Erlangen-Nürnberg
+;#
+;#
+;#############################################################
+$0 =~ s!^.*/([^/]+)$!$1!;
+$F = ' ' x length($0);
+$|=1;
+
+$ENV{'SHELL'} = '/bin/sh'; # use bourne shell
+
+undef($config);
+undef($workdir);
+undef($PrintIt);
+undef($samples);
+undef($StartTime);
+undef($EndTime);
+($a,$b) if 0; # keep -w happy
+$usage = <<"E-O-P";
+usage:
+ to watch statistics permanently:
+ $0 [-v[<level>]] [-c <config-file>] [-d <working-dir>]
+ $F [-h <hostname>]
+
+ to get a single print out specify also
+ $F -P[<printer>] [-s<samples>]
+ $F [-S <start-time>] [-E <end-time>]
+ $F [-Y <MaxOffs>] [-y <MinOffs>]
+
+If You like long option names, You can use:
+ -help
+ -c +config
+ -d +directory
+ -h +host
+ -v +verbose[=<level>]
+ -P +printer[=<printer>]
+ -s +samples[=<samples>]
+ -S +starttime
+ -E +endtime
+ -Y +maxy
+ -y +miny
+
+If <printer> contains a '/' (slash character) output is directed to
+a file of this name instead of delivered to a printer.
+E-O-P
+
+;# add directory to look for lr.pl and timelocal.pl (in front of current list)
+unshift(@INC,".");
+
+require "lr.pl"; # linear regresion routines
+
+$MJD_1970 = 40587; # from ntp.h (V3)
+$RecordSize = 48; # usually a line fits into 42 bytes
+$MinClip = 1; # clip Y scales with greater range than this
+
+;# largest extension of Y scale from mean value, factor for standart deviation
+$FuzzLow = 2.2; # for side closer to zero
+$FuzzBig = 1.8; # for side farther from zero
+
+require "ctime.pl";
+require "timelocal.pl";
+;# early distributions of ctime.pl had a bug
+$ENV{'TZ'} = 'MET' unless defined $ENV{'TZ'} || $[ > 4.010;
+if (defined(@ctime'MoY))
+{
+ *Month=*ctime'MoY;
+ *Day=*ctime'DoW;
+} # ' re-sync emacs fontification
+else
+{
+ @Month = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+ @Day = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
+}
+print @ctime'DoW if 0; # ' re-sync emacs fontification
+
+;# max number of days per month
+@MaxNumDaysPerMonth = (31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+
+;# config settable parameters
+$delay = 60;
+$srcprefix = "./var\@\$STATHOST/loopstats.";
+$showoffs = 1;
+$showfreq = 1;
+$showcmpl = 0;
+$showoreg = 0;
+$showfreg = 0;
+undef($timebase);
+undef($freqbase);
+undef($cmplscale);
+undef($MaxY);
+undef($MinY);
+$deltaT = 512; # indicate sample data gaps greater than $deltaT seconds
+$verbose = 1;
+
+while($_ = shift(@ARGV))
+{
+ (/^[+-]help$/) && die($usage);
+
+ (/^-c$/ || /^\+config$/) &&
+ (@ARGV || die($usage), $config = shift(@ARGV), next);
+
+ (/^-d$/ || /^\+directory$/) &&
+ (@ARGV || die($usage), $workdir = shift(@ARGV), next);
+
+ (/^-h$/ || /^\+host$/) &&
+ (@ARGV || die($usage), $STATHOST = shift, next);
+
+ (/^-v(\d*)$/ || /^\+verbose=?(\d*)$/) &&
+ ($verbose=($1 eq "") ? 1 : $1, next);
+
+ (/^-P(\S*)$/ || /^\+[Pp]rinter=?(\S*)$/) &&
+ ($PrintIt = $1, $verbose==1 && ($verbose = 0), next);
+
+ (/^-s(\d*)$/ || /^\+samples=?(\d*)$/) &&
+ (($samples = ($1 eq "") ? (shift || die($usage)): $1), next);
+
+ (/^-S$/ || /^\+[Ss]tart[Tt]ime$/) &&
+ (@ARGV || die($usage), $StartTime=&date_time_spec2seconds(shift),next);
+
+ (/^-E$/ || /^\+[Ee]nd[Tt]ime$/) &&
+ (@ARGV || die($usage), $EndTime = &date_time_spec2seconds(shift),next);
+
+ (/^-Y$/ || /^\+[Mm]ax[Yy]$/) &&
+ (@ARGV || die($usage), $MaxY = shift, next);
+
+ (/^-y$/ || /^\+[Mm]in[Yy]$/) &&
+ (@ARGV || die($usage), $MinY = shift, next);
+
+ die("$0: unexpected argument \"$_\"\n$usage");
+}
+
+if (defined($workdir))
+{
+ chdir($workdir) ||
+ die("$0: failed to change working dir to \"$workdir\": $!\n");
+}
+
+$PrintIt = "ps" if defined($PrintIt) && $PrintIt eq "";
+
+if (!defined($PrintIt))
+{
+ defined($samples) &&
+ print "WARNING: your samples value may be shadowed by config file settings\n";
+ defined($StartTime) &&
+ print "WARNING: your StartTime value may be shadowed by config file settings\n";
+ defined($EndTime) &&
+ print "WARNING: your EndTime value may be shadowed by config file settings\n";
+ defined($MaxY) &&
+ print "WARNING: your MaxY value may be shadowed by config file settings\n";
+ defined($MinY) &&
+ print "WARNING: your MinY value may be shadowed by config file settings\n";
+
+ ;# check operating environment
+ ;#
+ ;# gnuplot usually has X support
+ ;# I vaguely remember there was one with sunview support
+ ;#
+ ;# If Your plotcmd can display graphics using some other method
+ ;# (Tek window,..) fix the following test
+ ;# (or may be, just disable it)
+ ;#
+ !(defined($ENV{'DISPLAY'}) || defined($ENV{'WINDOW_PARENT'})) &&
+ die("Need window system to monitor statistics\n");
+}
+
+;# configuration file
+$config = "loopwatch.config" unless defined($config);
+($STATHOST = $config) =~ s!.*loopwatch\.config.([^/\.]*)$!$1!
+ unless defined($STATHOST);
+($STATTAG = $STATHOST) =~ s/^([^\.\*\s]+)\..*$/$1/;
+
+$srcprefix =~ s/\$STATHOST/$STATHOST/g;
+
+;# plot command
+@plotcmd=("gnuplot",
+ '-title', "Ntp loop filter statistics $STATHOST",
+ '-name', "NtpLoopWatch_$STATTAG");
+$tmpfile = "/tmp/ntpstat.$$";
+
+;# other variables
+$doplot = ""; # assembled command for @plotcmd to display plot
+undef($laststat);
+
+;# plot value ranges
+undef($mintime);
+undef($maxtime);
+undef($minoffs);
+undef($maxoffs);
+undef($minfreq);
+undef($maxfreq);
+undef($mincmpl);
+undef($maxcmpl);
+undef($miny);
+undef($maxy);
+
+;# stop operation if plot command dies
+sub sigchld
+{
+ local($pid) = wait;
+ unlink($tmpfile);
+ warn(sprintf("%s: %s died: exit status: %d signal %d\n",
+ $0,
+ (defined($Plotpid) && $Plotpid == $pid)
+ ? "plotcmd" : "unknown child $pid",
+ $?>>8,$? & 0xff)) if $?;
+ exit(1) if $? && defined($Plotpid) && $pid == $Plotpid;
+}
+&sigchld if 0;
+$SIG{'CHLD'} = "sigchld";
+$SIG{'CLD'} = "sigchld";
+
+sub abort
+{
+ unlink($tmpfile);
+ defined($Plotpid) && kill('TERM',$Plotpid);
+ die("$0: received signal SIG$_[$[] - exiting\n");
+}
+&abort if 0; # make -w happy - &abort IS used
+$SIG{'INT'} = $SIG{'HUP'} = $SIG{'QUIT'} = $SIG{'TERM'} = $SIG{'PIPE'} = "abort";
+
+;#
+sub abs
+{
+ ($_[$[] < 0) ? -($_[$[]) : $_[$[];
+}
+
+sub boolval
+{
+ local($v) = ($_[$[]);
+
+ return 1 if ($v eq 'yes') || ($v eq 'y');
+ return 1 if ($v =~ /^[0-9]*$/) && ($v != 0);
+ return 0;
+}
+
+;#####################
+;# start of real work
+
+print "starting plot command (" . join(" ",@plotcmd) . ")\n" if $verbose > 1;
+
+$Plotpid = open(PLOT,"|-");
+select((select(PLOT),$|=1)[$[]); # make PLOT line bufferd
+
+defined($Plotpid) ||
+ die("$0: failed to start plot command: $!\n");
+
+unless ($Plotpid)
+{
+ ;# child == plot command
+ close(STDOUT);
+ open(STDOUT,">&STDERR") ||
+ die("$0: failed to redirect STDOUT of plot command: $!\n");
+
+ print STDOUT "plot command running as $$\n";
+
+ exec @plotcmd;
+ die("$0: failed to exec (@plotcmd): $!\n");
+ exit(1); # in case ...
+}
+
+sub read_config
+{
+ local($at) = (stat($config))[$[+9];
+ local($_,$c,$v);
+
+ (undef($laststat),(print("stat $config failed: $!\n")),return) if ! defined($at);
+ return if (defined($laststat) && ($laststat == $at));
+ $laststat = $at;
+
+ print "reading configuration from \"$config\"\n" if $verbose;
+
+ open(CF,"<$config") ||
+ (warn("$0: failed to read \"$config\" - using old settings ($!)\n"),
+ return);
+ while(<CF>)
+ {
+ chop;
+ s/^([^\#]*[^\#\s]?)\s*\#.*$//;
+ next if /^\s*$/;
+
+ s/^\s*([^=\s]*)\s*=\s*(.*\S)\s*$/$1=$2/;
+
+ ($c,$v) = split(/=/,$_,2);
+ print "processing \"$c=$v\"\n" if $verbose > 3;
+ ($c eq "delay") && ($delay = $v,1) && next;
+ ($c eq 'samples') && (!defined($PrintIt) || !defined($samples)) &&
+ ($samples = $v,1) && next;
+ ($c eq 'srcprefix') && (($srcprefix=$v)=~s/\$STATHOST/$STATHOST/g,1)
+ && next;
+ ($c eq 'showoffs') &&
+ ($showoffs = boolval($v),1) && next;
+ ($c eq 'showfreq') &&
+ ($showfreq = boolval($v),1) && next;
+ ($c eq 'showcmpl') &&
+ ($showcmpl = boolval($v),1) && next;
+ ($c eq 'showoreg') &&
+ ($showoreg = boolval($v),1) && next;
+ ($c eq 'showfreg') &&
+ ($showfreg = boolval($v),1) && next;
+
+ ($c eq 'exit') && (unlink($tmpfile),die("$0: exit by config request\n"));
+
+ ($c eq 'freqbase' ||
+ $c eq 'cmplscale') &&
+ do {
+ if (! defined($v) || $v eq "" || $v eq 'dynamic')
+ {
+ eval "undef(\$$c);";
+ }
+ else
+ {
+ eval "\$$c = \$v;";
+ }
+ next;
+ };
+ ($c eq 'timebase') &&
+ do {
+ if (! defined($v) || $v eq "" || $v eq "dynamic")
+ {
+ undef($timebase);
+ }
+ else
+ {
+ $timebase=&date_time_spec2seconds($v);
+ }
+ };
+ ($c eq 'EndTime') &&
+ do {
+ next if defined($EndTime) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($EndTime);
+ }
+ else
+ {
+ $EndTime=&date_time_spec2seconds($v);
+ }
+ };
+ ($c eq 'StartTime') &&
+ do {
+ next if defined($StartTime) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($StartTime);
+ }
+ else
+ {
+ $StartTime=&date_time_spec2seconds($v);
+ }
+ };
+
+ ($c eq 'MaxY') &&
+ do {
+ next if defined($MaxY) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($MaxY);
+ }
+ else
+ {
+ $MaxY=$v;
+ }
+ };
+
+ ($c eq 'MinY') &&
+ do {
+ next if defined($MinY) && defined($PrintIt);
+ if (! defined($v) || $v eq "" || $v eq "none")
+ {
+ undef($MinY);
+ }
+ else
+ {
+ $MinY=$v;
+ }
+ };
+
+ ($c eq 'deltaT') &&
+ do {
+ if (!defined($v) || $v eq "")
+ {
+ undef($deltaT);
+ }
+ else
+ {
+ $deltaT = $v;
+ }
+ next;
+ };
+ ($c eq 'verbose') && ! defined($PrintIt) &&
+ do {
+ if (!defined($v) || $v == 0)
+ {
+ $verbose = 0;
+ }
+ else
+ {
+ $verbose = $v;
+ }
+ next;
+ };
+ ;# otherwise: silently ignore unrecognized config line
+ }
+ close(CF);
+ ;# set show defaults when nothing selected
+ $showoffs = $showfreq = $showcmpl = 1
+ unless $showoffs || $showfreq || $showcmpl;
+ if ($verbose > 3)
+ {
+ print "new configuration:\n";
+ print " delay\t= $delay\n";
+ print " samples\t= $samples\n";
+ print " srcprefix\t= $srcprefix\n";
+ print " showoffs\t= $showoffs\n";
+ print " showfreq\t= $showfreq\n";
+ print " showcmpl\t= $showcmpl\n";
+ print " showoreg\t= $showoreg\n";
+ print " showfreg\t= $showfreg\n";
+ printf " timebase\t= %s",defined($timebase)?&ctime($timebase):"dynamic\n";
+ printf " freqbase\t= %s\n",defined($freqbase) ?"$freqbase":"dynamic";
+ printf " cmplscale\t= %s\n",defined($cmplscale)?"$cmplscale":"dynamic";
+ printf " StartTime\t= %s",defined($StartTime)?&ctime($StartTime):"none\n";
+ printf " EndTime\t= %s", defined($EndTime) ? &ctime($EndTime):"none\n";
+ printf " MaxY\t= %s",defined($MaxY)? $MaxY :"none\n";
+ printf " MinY\t= %s",defined($MinY)? $MinY :"none\n";
+ print " verbose\t= $verbose\n";
+ }
+print "configuration file read\n" if $verbose > 2;
+}
+
+sub make_doplot($$)
+{
+ my($lo, $lf) = @_;
+ local($c) = ("");
+ local($fmt)
+ = ("%s \"%s\" using 1:%d title '%s <%lf %lf> %6s' with lines");
+ local($regfmt)
+ = ("%s ((%lf * x) + %lf) title 'lin. approx. %s (%f t[h]) %s %f <%f> %6s' with lines");
+
+ $doplot = " set title 'NTP loopfilter statistics for $STATHOST " .
+ "(last $LastCnt samples from $srcprefix*)'\n";
+
+ local($xts,$xte,$i,$t);
+
+ local($s,$c) = ("");
+
+ ;# number of integral seconds to get at least 12 tic marks on x axis
+ $t = int(($maxtime - $mintime) / 12 + 0.5);
+ $t = 1 unless $t; # prevent $t to be zero
+ foreach $i (30,
+ 60,5*60,15*60,30*60,
+ 60*60,2*60*60,6*60*60,12*60*60,
+ 24*60*60,48*60*60)
+ {
+ last if $t < $i;
+ $t = $t - ($t % $i);
+ }
+ print "time label resolution: $t seconds\n" if $verbose > 1;
+
+ ;# make gnuplot use wall clock time labels instead of NTP seconds
+ for ($c="", $i = $mintime - ($mintime % $t);
+ $i <= $maxtime + $t;
+ $i += $t, $c=",")
+ {
+ $s .= $c;
+ ((int($i / $t) % 2) &&
+ ($s .= sprintf("'' %lf",($i - $LastTimeBase)/3600))) ||
+ (($t <= 60) &&
+ ($s .= sprintf("'%d:%02d:%02d' %lf",
+ (localtime($i))[$[+2,$[+1,$[+0],
+ ($i - $LastTimeBase)/3600)))
+ || (($t <= 2*60*60) &&
+ ($s .= sprintf("'%d:%02d' %lf",
+ (localtime($i))[$[+2,$[+1],
+ ($i - $LastTimeBase)/3600)))
+ || (($t <= 12*60*60) &&
+ ($s .= sprintf("'%s %d:00' %lf",
+ $Day[(localtime($i))[$[+6]],
+ (localtime($i))[$[+2],
+ ($i - $LastTimeBase)/3600)))
+ || ($s .= sprintf("'%d.%d-%d:00' %lf",
+ (localtime($i))[$[+3,$[+4,$[+2],
+ ($i - $LastTimeBase)/3600));
+ }
+ $doplot .= "set xtics ($s)\n";
+
+ chop($xts = &ctime($mintime));
+ chop($xte = &ctime($maxtime));
+ $doplot .= "set xlabel 'Start: $xts -- Time Scale -- End: $xte'\n";
+ $doplot .= "set yrange [" ;
+ $doplot .= defined($MinY) ? sprintf("%lf", $MinY) : $miny;
+ $doplot .= ':';
+ $doplot .= defined($MaxY) ? sprintf("%lf", $MaxY) : $maxy;
+ $doplot .= "]\n";
+
+ $doplot .= " plot";
+ $c = "";
+ $showoffs &&
+ ($doplot .= sprintf($fmt,$c,$tmpfile,2,
+ "offset",
+ $minoffs,$maxoffs,
+ "[ms]"),
+ $c = ",");
+ $LastCmplScale = 1 if ! defined($LastCmplScale);
+ $showcmpl &&
+ ($doplot .= sprintf($fmt,$c,$tmpfile,4,
+ "compliance" .
+ (&abs($LastCmplScale) > 1
+ ? " / $LastCmplScale"
+ : (&abs($LastCmplScale) == 1 ? "" : " * ".(1/$LastCmplScale))),
+ $mincmpl/$LastCmplScale,$maxcmpl/$LastCmplScale,
+ ""),
+ $c = ",");
+ $LastFreqBase = 0 if ! defined($LastFreqBase);
+ $LastFreqBaseString = "?" if ! defined($LastFreqBaseString);
+ $FreqScale = 1 if ! defined($FreqScale);
+ $FreqScaleInv = 1 if ! defined($FreqScaleInv);
+ $showfreq &&
+ ($doplot .= sprintf($fmt,$c,$tmpfile,3,
+ "frequency" .
+ ($LastFreqBase > 0
+ ? " - $LastFreqBaseString"
+ : ($LastFreqBase == 0 ? "" : " + $LastFreqBaseString")),
+ $minfreq * $FreqScale - $LastFreqBase,
+ $maxfreq * $FreqScale - $LastFreqBase,
+ "[${FreqScaleInv}ppm]"),
+ $c = ",");
+ $showoreg && $showoffs &&
+ ($doplot .= sprintf($regfmt, $c,
+ $lo->B(),$lo->A(),
+ "offset ",
+ $lo->B(),
+ (($lo->A()) < 0 ? '-' : '+'),
+ &abs($lo->A()), $lo->r(),
+ "[ms]"),
+ $c = ",");
+ $showfreg && $showfreq &&
+ ($doplot .= sprintf($regfmt, $c,
+ $lf->B() * $FreqScale,
+ ($lf->A() + $minfreq) * $FreqScale - $LastFreqBase,
+ "frequency",
+ $lf->B() * $FreqScale,
+ (($lf->A() + $minfreq) * $FreqScale - $LastFreqBase) < 0 ? '-' : '+',
+ &abs(($lf->A() + $minfreq) * $FreqScale - $LastFreqBase),
+ $lf->r(),
+ "[${FreqScaleInv}ppm]"),
+ $c = ",");
+ $doplot .= "\n";
+}
+
+%F_key = ();
+%F_name = ();
+%F_size = ();
+%F_mtime = ();
+%F_first = ();
+%F_last = ();
+
+sub genfile
+{
+ local($cnt,$in,$out,$lo,$lf,@fpos) = @_;
+
+ local(@F,@t,$t,$lastT) = ();
+ local(@break,@time,@offs,@freq,@cmpl,@loffset,@filekey) = ();
+ local($lm,$l,@f);
+
+ local($sdir,$sname);
+
+ ;# allocate some storage for the tables
+ ;# otherwise realloc may get into troubles
+ if (defined($StartTime) && defined($EndTime))
+ {
+ $l = ($EndTime-$StartTime) -$[+1 +1; # worst case: 1 sample per second
+ }
+ else
+ {
+ $l = $cnt + 10;
+ }
+ print "preextending arrays to $l entries\n" if $verbose > 2;
+ $#break = $l; for ($i=$[; $i<=$l;$i++) { $break[$i] = 0; }
+ $#time = $l; for ($i=$[; $i<=$l;$i++) { $time[$i] = 0; }
+ $#offs = $l; for ($i=$[; $i<=$l;$i++) { $offs[$i] = 0; }
+ $#freq = $l; for ($i=$[; $i<=$l;$i++) { $freq[$i] = 0; }
+ $#cmpl = $l; for ($i=$[; $i<=$l;$i++) { $cmpl[$i] = 0; }
+ $#loffset = $l; for ($i=$[; $i<=$l;$i++) { $loffset[$i] = 0; }
+ $#filekey = $l; for ($i=$[; $i<=$l;$i++) { $filekey[$i] = 0; }
+ ;# now reduce size again
+ $#break = $[ - 1;
+ $#time = $[ - 1;
+ $#offs = $[ - 1;
+ $#freq = $[ - 1;
+ $#cmpl = $[ - 1;
+ $#loffset = $[ - 1;
+ $#filekey = $[ - 1;
+ print "memory allocation ready\n" if $verbose > 2;
+ sleep(3) if $verbose > 1;
+
+ $fpos[$[] = '' if !defined($fpos[$[]);
+
+ if (index($in,"/") < $[)
+ {
+ $sdir = ".";
+ $sname = $in;
+ }
+ else
+ {
+ ($sdir,$sname) = ($in =~ m!^(.*)/([^/]*)!);
+ $sname = "" unless defined($sname);
+ }
+
+ $Ltime = -1 if ! defined($Ltime);
+ if (!defined($Lsdir) || $Lsdir ne $sdir || $Ltime != (stat($sdir))[$[+9] ||
+ grep($F_mtime{$_} != (stat($F_name{$_}))[$[+9], @F_files))
+
+ {
+ print "rescanning directory \"$sdir\" for files \"$sname*\"\n"
+ if $verbose > 1;
+
+ ;# rescan directory on changes
+ $Lsdir = $sdir;
+ $Ltime = (stat($sdir))[$[+9];
+ </X{> if 0; # dummy line - calm down my formatter
+ local(@newfiles) = < ${in}*[0-9] >;
+ local($st_dev,$st_ino,$st_mtime,$st_size,$name,$key,$modified);
+
+ foreach $name (@newfiles)
+ {
+ ($st_dev,$st_ino,$st_size,$st_mtime) =
+ (stat($name))[$[,$[+1,$[+7,$[+9];
+ $modified = 0;
+ $key = sprintf("%lx|%lu", $st_dev, $st_ino);
+
+ print "candidate file \"$name\"",
+ (defined($st_dev) ? "" : " failed: $!"),"\n"
+ if $verbose > 2;
+
+ if (! defined($F_key{$name}) || $F_key{$name} ne $key)
+ {
+ $F_key{$name} = $key;
+ $modified++;
+ }
+ if (!defined($F_name{$key}) || $F_name{$key} ne $name)
+ {
+ $F_name{$key} = $name;
+ $modified++;
+ }
+ if (!defined($F_size{$key}) || $F_size{$key} != $st_size)
+ {
+ $F_size{$key} = $st_size;
+ $modified++;
+ }
+ if (!defined($F_mtime{$key}) || $F_mtime{$key} != $st_mtime)
+ {
+ $F_mtime{$key} = $st_mtime;
+ $modified++;
+ }
+ if ($modified)
+ {
+ print "new data \"$name\" key: $key;\n" if $verbose > 1;
+ print " size: $st_size; mtime: $st_mtime;\n"
+ if $verbose > 1;
+ $F_last{$key} = $F_first{$key} = $st_mtime;
+ $F_first{$key}--; # prevent zero divide later on
+ ;# now compute derivated attributes
+ open(IN, "<$name") ||
+ do {
+ warn "$0: failed to open \"$name\": $!";
+ next;
+ };
+
+ while(<IN>)
+ {
+ @F = split;
+ next if @F < 5;
+ next if $F[$[] eq "";
+ $t = ($F[$[] - $MJD_1970) * 24 * 60 * 60;
+ $t += $F[$[+1];
+ $F_first{$key} = $t;
+ print "\tfound first entry: $t ",&ctime($t)
+ if $verbose > 4;
+ last;
+ }
+ seek(IN,
+ ($st_size > 4*$RecordSize) ? $st_size - 4*$RecordSize : 0,
+ 0);
+ while(<IN>)
+ {
+ @F = split;
+ next if @F < 5;
+ next if $F[$[] eq "";
+ $t = ($F[$[] - $MJD_1970) * 24 * 60 * 60;
+ $t += $F[$[+1];
+ $F_last{$key} = $t;
+ $_ = <IN>;
+ print "\tfound last entry: $t ", &ctime($t)
+ if $verbose > 4 && ! defined($_);
+ last unless defined($_);
+ redo;
+ ;# Ok, calm down...
+ ;# using $_ = <IN> in conjunction with redo
+ ;# is semantically equivalent to the while loop, but
+ ;# I needed a one line look ahead and this solution
+ ;# was what I thought of first
+ ;# and.. If you do not like it dont look
+ }
+ close(IN);
+ print(" first: ",$F_first{$key},
+ " last: ",$F_last{$key},"\n") if $verbose > 1;
+ }
+ }
+ ;# now reclaim memory used for files no longer referenced ...
+ local(%Names);
+ grep($Names{$_} = 1,@newfiles);
+ foreach (keys %F_key)
+ {
+ next if defined($Names{$_});
+ delete $F_key{$_};
+ $verbose > 2 && print "no longer referenced: \"$_\"\n";
+ }
+ %Names = ();
+
+ grep($Names{$_} = 1,values(%F_key));
+ foreach (keys %F_name)
+ {
+ next if defined($Names{$_});
+ delete $F_name{$_};
+ $verbose > 2 && print "unref name($_)= $F_name{$_}\n";
+ }
+ foreach (keys %F_size)
+ {
+ next if defined($Names{$_});
+ delete $F_size{$_};
+ $verbose > 2 && print "unref size($_)\n";
+ }
+ foreach (keys %F_mtime)
+ {
+ next if defined($Names{$_});
+ delete $F_mtime{$_};
+ $verbose > 2 && print "unref mtime($_)\n";
+ }
+ foreach (keys %F_first)
+ {
+ next if defined($Names{$_});
+ delete $F_first{$_};
+ $verbose > 2 && print "unref first($_)\n";
+ }
+ foreach (keys %F_last)
+ {
+ next if defined($Names{$_});
+ delete $F_last{$_};
+ $verbose > 2 && print "unref last($_)\n";
+ }
+ ;# create list sorted by time
+ @F_files = sort {$F_first{$a} <=> $F_first{$b}; } keys(%F_name);
+ if ($verbose > 1)
+ {
+ print "Resulting file list:\n";
+ foreach (@F_files)
+ {
+ print "\t$_\t$F_name{$_}\n";
+ }
+ }
+ }
+
+ printf("processing %s; output \"$out\" (%d input files)\n",
+ ((defined($StartTime) && defined($EndTime))
+ ? "time range"
+ : (defined($StartTime) ? "$cnt samples from StartTime" :
+ (defined($EndTime) ? "$cnt samples to EndTime" :
+ "last $cnt samples"))),
+ scalar(@F_files))
+ if $verbose > 1;
+
+ ;# open output file - will be input for plotcmd
+ open(OUT,">$out") ||
+ do {
+ warn("$0: cannot create \"$out\": $!\n");
+ };
+
+ @f = @F_files;
+ if (defined($StartTime))
+ {
+ while (@f && ($F_last{$f[$[]} < $StartTime))
+ {
+ print("shifting ", $F_name{$f[$[]},
+ " last: ", $F_last{$f[$[]},
+ " < StartTime: $StartTime\n")
+ if $verbose > 3;
+ shift(@f);
+ }
+
+
+ }
+ if (defined($EndTime))
+ {
+ while (@f && ($F_first{$f[$#f]} > $EndTime))
+ {
+ print("popping ", $F_name{$f[$#f]},
+ " first: ", $F_first{$f[$#f]},
+ " > EndTime: $EndTime\n")
+ if $verbose > 3;
+ pop(@f);
+ }
+ }
+
+ if (@f)
+ {
+ if (defined($StartTime))
+ {
+ print "guess start according to StartTime ($StartTime)\n"
+ if $verbose > 3;
+
+ if ($fpos[$[] eq 'start')
+ {
+ if (grep($_ eq $fpos[$[+1],@f))
+ {
+ shift(@f) while @f && $f[$[] ne $fpos[$[+1];
+ }
+ else
+ {
+ @fpos = ('start', $f[$[], undef);
+ }
+ }
+ else
+ {
+ @fpos = ('start' , $f[$[], undef);
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ if ($StartTime <= $F_first{$f[$[]})
+ {
+ $fpos[$[+2] = 0;
+ }
+ else
+ {
+ $fpos[$[+2] =
+ int($F_size{$f[$[]} *
+ (($StartTime - $F_first{$f[$[]})/
+ ($F_last{$f[$[]} - $F_first{$f[$[]})));
+ $fpos[$[+2] = ($fpos[$[+2] <= 2 * $RecordSize)
+ ? 0 : $fpos[$[+2] - 2 * $RecordSize;
+ ;# anyway as the data may contain "time holes"
+ ;# our heuristics may baldly fail
+ ;# so just start at 0
+ $fpos[$[+2] = 0;
+ }
+ }
+ }
+ elsif (defined($EndTime))
+ {
+ print "guess starting point according to EndTime ($EndTime)\n"
+ if $verbose > 3;
+
+ if ($fpos[$[] eq 'end')
+ {
+ if (grep($_ eq $fpos[$[+1],@f))
+ {
+ shift(@f) while @f && $f[$[] ne $fpos[$[+1];
+ }
+ else
+ {
+ @fpos = ('end', $f[$[], undef);
+ }
+ }
+ else
+ {
+ @fpos = ('end', $f[$[], undef);
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ local(@x) = reverse(@f);
+ local($s,$c) = (0,$cnt);
+ if ($EndTime < $F_last{$x[$[]})
+ {
+ ;# last file will only be used partially
+ $s = int($F_size{$x[$[]} *
+ (($EndTime - $F_first{$x[$[]}) /
+ ($F_last{$x[$[]} - $F_first{$x[$[]})));
+ $s = int($s/$RecordSize);
+ $c -= $s - 1;
+ if ($c <= 0)
+ {
+ ;# start is in the same file
+ $fpos[$[+1] = $x[$[];
+ $fpos[$[+2] = ($c >=-2) ? 0 : (-$c - 2) * $RecordSize;
+ shift(@f) while @f && ($f[$[] ne $x[$[]);
+ }
+ else
+ {
+ shift(@x);
+ }
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ local($_);
+ while($_ = shift(@x))
+ {
+ $s = int($F_size{$_}/$RecordSize);
+ $c -= $s - 1;
+ if ($c <= 0)
+ {
+ $fpos[$[+1] = $_;
+ $fpos[$[+2] = ($c>-2) ? 0 : (-$c - 2) * $RecordSize;
+ shift(@f) while @f && ($f[$[] ne $_);
+ last;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ print "guessing starting point according to count ($cnt)\n"
+ if $verbose > 3;
+ ;# guess offset to get last available $cnt samples
+ if ($fpos[$[] eq 'cnt')
+ {
+ if (grep($_ eq $fpos[$[+1],@f))
+ {
+ print "old positioning applies\n" if $verbose > 3;
+ shift(@f) while @f && $f[$[] ne $fpos[$[+1];
+ }
+ else
+ {
+ @fpos = ('cnt', $f[$[], undef);
+ }
+ }
+ else
+ {
+ @fpos = ('cnt', $f[$[], undef);
+ }
+
+ if (!defined($fpos[$[+2]))
+ {
+ local(@x) = reverse(@f);
+ local($s,$c) = (0,$cnt);
+
+ local($_);
+ while($_ = shift(@x))
+ {
+ print "examing \"$_\" $c samples still needed\n"
+ if $verbose > 4;
+ $s = int($F_size{$_}/$RecordSize);
+ $c -= $s - 1;
+ if ($c <= 0)
+ {
+ $fpos[$[+1] = $_;
+ $fpos[$[+2] = ($c>-2) ? 0 : (-$c - 2) * $RecordSize;
+ shift(@f) while @f && ($f[$[] ne $_);
+ last;
+ }
+ }
+ if (!defined($fpos[$[+2]))
+ {
+ print "no starting point yet - using start of data\n"
+ if $verbose > 2;
+ $fpos[$[+2] = 0;
+ }
+ }
+ }
+ }
+ print "Ooops, no suitable input file ??\n"
+ if $verbose > 1 && @f <= 0;
+
+ printf("Starting at (%s) \"%s\" offset %ld using %d files\n",
+ $fpos[$[+1],
+ $F_name{$fpos[$[+1]},
+ $fpos[$[+2],
+ scalar(@f))
+ if $verbose > 2;
+
+ $lm = 1;
+ $l = 0;
+ foreach $key (@f)
+ {
+ $file = $F_name{$key};
+ print "processing file \"$file\"\n" if $verbose > 2;
+
+ open(IN,"<$file") ||
+ (warn("$0: cannot read \"$file\": $!\n"), next);
+
+ ;# try to seek to a position nearer to the start of the interesting lines
+ ;# should always affect only first item in @f
+ ($key eq $fpos[$[+1]) &&
+ (($verbose > 1) &&
+ print("Seeking to offset $fpos[$[+2]\n"),
+ seek(IN,$fpos[$[+2],0) ||
+ warn("$0: seek(\"$F_name{$key}\" failed: $|\n"));
+
+ while(<IN>)
+ {
+ $l++;
+ ($verbose > 3) &&
+ (($l % $lm) == 0 && print("\t$l lines read\n") &&
+ (($l == 2) && ($lm = 10) ||
+ ($l == 100) && ($lm = 100) ||
+ ($l == 500) && ($lm = 500) ||
+ ($l == 1000) && ($lm = 1000) ||
+ ($l == 5000) && ($lm = 5000) ||
+ ($l == 10000) && ($lm = 10000)));
+
+ @F = split;
+
+ next if @F < 6; # no valid input line is this short
+ next if $F[$[] eq "";
+ next if ($F[$[] !~ /^\d+$/);
+ ($F[$[] !~ /^\d+$/) && # A 'never should have happend' error
+ die("$0: unexpected input line: >$_<\n");
+
+ ;# modified Julian to UNIX epoch
+ $t = ($F[$[] - $MJD_1970) * 24 * 60 * 60;
+ $t += $F[$[+1]; # add seconds + fraction
+
+ ;# multiply offset by 1000 to get ms - try to avoid float op
+ (($F[$[+2] =~ s/(\d*)\.(\d{3})(\d*)/$1$2.$3/) &&
+ $F[$[+2] =~ s/0+([\d\.])/($1 eq '.') ? '0.' : $1/e) # strip leading zeros
+ || ($F[$[+2] *= 1000);
+
+
+ ;# skip samples out of specified time range
+ next if (defined($StartTime) && $StartTime > $t);
+ next if (defined($EndTime) && $EndTime < $t);
+
+ next if defined($lastT) && $t < $lastT; # backward in time ??
+
+ push(@offs,$F[$[+2]);
+ push(@freq,$F[$[+3] * (2**20/10**6));
+ push(@cmpl,$F[$[+5]);
+
+ push(@break, (defined($lastT) && ($t - $lastT > $deltaT)));
+ $lastT = $t;
+ push(@time,$t);
+ push(@loffset, tell(IN) - length($_));
+ push(@filekey, $key);
+
+ shift(@break),shift(@time),shift(@offs),
+ shift(@freq), shift(@cmpl),shift(@loffset),
+ shift(@filekey)
+ if @time > $cnt &&
+ ! (defined($StartTime) && defined($EndTime));
+
+ last if @time >= $cnt && defined($StartTime) && !defined($EndTime);
+ }
+ close(IN);
+ last if @time >= $cnt && defined($StartTime) && !defined($EndTime);
+ }
+ print "input scanned ($l lines/",scalar(@time)," samples)\n"
+ if $verbose > 1;
+
+ if (@time)
+ {
+ local($_,@F);
+
+ local($timebase) unless defined($timebase);
+ local($freqbase) unless defined($freqbase);
+ local($cmplscale) unless defined($cmplscale);
+
+ undef $mintime;
+ undef $maxtime;
+ undef $minoffs;
+ undef $maxoffs;
+ undef $minfreq;
+ undef $maxfreq;
+ undef $mincmpl;
+ undef $maxcmpl;
+ undef $miny;
+ undef $maxy ;
+
+ print "computing ranges\n" if $verbose > 2;
+
+ $LastCnt = @time;
+
+ ;# @time is in ascending order (;-)
+ $mintime = $time[$[];
+ $maxtime = $time[$#time];
+ unless (defined($timebase))
+ {
+ local($time,@X) = (time);
+ @X = localtime($time);
+
+ ;# compute today 00:00:00
+ $timebase = $time - ((($X[$[+2]*60)+$X[$[+1])*60+$X[$[]);
+
+ }
+ $LastTimeBase = $timebase;
+
+ if ($showoffs)
+ {
+ local($i,$m,$f);
+
+ $minoffs = &min(@offs);
+ $maxoffs = &max(@offs);
+
+ ;# I know, it is not perl style using indices to access arrays,
+ ;# but I have to proccess two arrays in sync, non-destructively
+ ;# (otherwise a (shift(@a1),shift(a2)) would do),
+ ;# I dont like to make copies of these arrays as they may be huge
+ $i = $[;
+ $lo->sample(($time[$i]-$timebase)/3600,$offs[$i]),$i++
+ while $i <= $#time;
+
+ ($minoffs == $maxoffs) && ($minoffs -= 0.1,$maxoffs += 0.1);
+
+ $i = $lo->sigma();
+ $m = $lo->mean();
+
+ print "mean offset: $m sigma: $i\n" if $verbose > 2;
+
+ if (($maxoffs - $minoffs) > $MinClip)
+ {
+ $f = (&abs($minoffs) < &abs($maxoffs)) ? $FuzzLow : $FuzzBig;
+ $miny = (($m - $minoffs) <= ($f * $i))
+ ? $minoffs : ($m - $f * $i);
+ $f = ($f == $FuzzLow) ? $FuzzBig : $FuzzLow;
+ $maxy = (($maxoffs - $m) <= ($f * $i))
+ ? $maxoffs : ($m + $f * $i);
+ }
+ else
+ {
+ $miny = $minoffs;
+ $maxy = $maxoffs;
+ }
+ ($maxy-$miny) == 0 &&
+ (($maxy,$miny)
+ = (($maxoffs - $minoffs) > 0)
+ ? ($maxoffs,$minoffs) : ($MinClip,-$MinClip));
+
+ $maxy = $MaxY if defined($MaxY) && $MaxY < $maxy;
+ $miny = $MinY if defined($MinY) && $MinY > $miny;
+
+ print "offset min clipped from $minoffs to $miny\n"
+ if $verbose > 2 && $minoffs != $miny;
+ print "offset max clipped from $maxoffs to $maxy\n"
+ if $verbose > 2 && $maxoffs != $maxy;
+ }
+
+ if ($showfreq)
+ {
+ local($i,$m);
+
+ $minfreq = &min(@freq);
+ $maxfreq = &max(@freq);
+
+ $i = $[;
+ $lf->sample(($time[$i]-$timebase)/3600,$freq[$i]-$minfreq),
+ $i++
+ while $i <= $#time;
+
+ $i = $lf->sigma();
+ $m = $lf->mean() + $minfreq;
+
+ print "mean frequency: $m sigma: $i\n" if $verbose > 2;
+
+ if (defined($maxy))
+ {
+ local($s) =
+ ($maxfreq - $minfreq)
+ ? ($maxy - $miny) / ($maxfreq - $minfreq) : 1;
+
+ if (defined($freqbase))
+ {
+ $FreqScale = 1;
+ $FreqScaleInv = "";
+ }
+ else
+ {
+ $FreqScale = 1;
+ $FreqScale = 10 ** int(log($s)/log(10) - 0.9999);
+ $FreqScaleInv =
+ ("$FreqScale" =~ /^10(0*)$/) ? "0.${1}1" :
+ ($FreqScale == 1 ? "" : (1/$FreqScale));
+
+ $freqbase = ($maxfreq + $minfreq)/ 2 * $FreqScale; #$m * $FreqScale;
+ $freqbase -= ($maxy + $miny) / 2; #$lf->mean();
+
+ ;# round resulting freqbase
+ ;# to precision of min max difference
+ $s = -12;
+ $s = int(log(($maxfreq-$minfreq)*$FreqScale)/log(10))-1
+ unless ($maxfreq-$minfreq) < 1e-12;
+ $s = 10 ** $s;
+ $freqbase = int($freqbase / $s) * $s;
+ }
+ }
+ else
+ {
+ $FreqScale = 1;
+ $FreqScaleInv = "";
+ $freqbase = $m unless defined($freqbase);
+ if (($maxfreq - $minfreq) > $MinClip)
+ {
+ $f = (&abs($minfreq) < &abs($maxfreq))
+ ? $FuzzLow : $FuzzBig;
+ $miny = (($freqbase - $minfreq) <= ($f * $i))
+ ? ($minfreq-$freqbase) : (- $f * $i);
+ $f = ($f == $FuzzLow) ? $FuzzBig : $FuzzLow;
+ $maxy = (($maxfreq - $freqbase) <= ($f * $i))
+ ? ($maxfreq-$freqbase) : ($f * $i);
+ }
+ else
+ {
+ $miny = $minfreq - $freqbase;
+ $maxy = $maxfreq - $freqbase;
+ }
+ ($maxy - $miny) == 0 &&
+ (($maxy,$miny) =
+ (($maxfreq - $minfreq) > 0)
+ ? ($maxfreq-$freqbase,$minfreq-$freqbase) : (0.5,-0.5));
+
+ $maxy = $MaxY if defined($MaxY) && $MaxY < $maxy;
+ $miny = $MinY if defined($MinY) && $MinY > $miny;
+
+ print("frequency min clipped from ",$minfreq-$freqbase,
+ " to $miny\n")
+ if $verbose > 2 && $miny != ($minfreq - $freqbase);
+ print("frequency max clipped from ",$maxfreq-$freqbase,
+ " to $maxy\n")
+ if $verbose > 2 && $maxy != ($maxfreq - $freqbase);
+ }
+ $LastFreqBaseString =
+ sprintf("%g",$freqbase >= 0 ? $freqbase : -$freqbase);
+ $LastFreqBase = $freqbase;
+ print "LastFreqBaseString now \"$LastFreqBaseString\"\n"
+ if $verbose > 5;
+ }
+ else
+ {
+ $FreqScale = 1;
+ $FreqScaleInv = "";
+ $LastFreqBase = 0;
+ $LastFreqBaseString = "";
+ }
+
+ if ($showcmpl)
+ {
+ $mincmpl = &min(@cmpl);
+ $maxcmpl = &max(@cmpl);
+
+ if (!defined($cmplscale))
+ {
+ if (defined($maxy))
+ {
+ local($cmp)
+ = (&abs($miny) > &abs($maxy)) ? &abs($miny) : $maxy;
+ $cmplscale = $cmp == $maxy ? 1 : -1;
+
+ foreach (0.01, 0.02, 0.05,
+ 0.1, 0.2, 0.25, 0.4, 0.5,
+ 1, 2, 4, 5,
+ 10, 20, 25, 50,
+ 100, 200, 250, 500, 1000)
+ {
+ $cmplscale *= $_, last if $maxcmpl/$_ <= $cmp;
+ }
+ }
+ else
+ {
+ $cmplscale = 1;
+ $miny = $mincmpl ? 0 : -$MinClip;
+ $maxy = $maxcmpl+$MinClip;
+ }
+ }
+ $LastCmplScale = $cmplscale;
+ }
+ else
+ {
+ $LastCmplScale = 1;
+ }
+
+ print "creating plot command input file\n" if $verbose > 2;
+
+
+ print OUT ("# preprocessed NTP statistics file for $STATHOST\n");
+ print OUT ("# timebase is: ",&ctime($LastTimeBase))
+ if defined($LastTimeBase);
+ print OUT ("# frequency is offset by ",
+ ($LastFreqBase >= 0 ? "+" : "-"),
+ "$LastFreqBaseString [${FreqScaleInv}ppm]\n");
+ print OUT ("# compliance is scaled by $LastCmplScale\n");
+ print OUT ("# time [h]\toffset [ms]\tfrequency [${FreqScaleInv}ppm]\tcompliance\n");
+
+ printf OUT ("%s%lf\t%lf\t%lf\t%lf\n",
+ (shift(@break) ? "\n" : ""),
+ (shift(@time) - $LastTimeBase)/3600,
+ shift(@offs),
+ shift(@freq) * $FreqScale - $LastFreqBase,
+ shift(@cmpl) / $LastCmplScale)
+ while(@time);
+ }
+ else
+ {
+ ;# prevent plotcmd from processing empty file
+ print "Creating plot command dummy...\n" if $verbose > 2;
+ print OUT "# dummy samples\n0 1 2 3\n1 1 2 3\n";
+ $lo->sample(0,1);
+ $lo->sample(1,1);
+ $lf->sample(0,2);
+ $lf->sample(1,2);
+ @time = (0, 1); $maxtime = 1; $mintime = 0;
+ @offs = (1, 1); $maxoffs = 1; $minoffs = 1;
+ @freq = (2, 2); $maxfreq = 2; $minfreq = 2;
+ @cmpl = (3, 3); $maxcmpl = 3; $mincmpl = 3;
+ $LastCnt = 2;
+ $LastFreqBase = 0;
+ $LastCmplScale = 1;
+ $LastTimeBase = 0;
+ $miny = -$MinClip;
+ $maxy = 3 + $MinClip;
+ }
+ close(OUT);
+
+ print "plot command input file created\n"
+ if $verbose > 2;
+
+
+ if (($fpos[$[] eq 'cnt' && scalar(@loffset) >= $cnt) ||
+ ($fpos[$[] eq 'start' && $mintime <= $StartTime) ||
+ ($fpos[$[] eq 'end'))
+ {
+ return ($fpos[$[],$filekey[$[],$loffset[$[]);
+ }
+ else # found to few lines - next time start search earlier in file
+ {
+ if ($fpos[$[] eq 'start')
+ {
+ ;# the timestamps we got for F_first and F_last guaranteed
+ ;# that no file is left out
+ ;# the only thing that could happen is:
+ ;# we guessed the starting point wrong
+ ;# compute a new guess from the first record found
+ ;# if this equals our last guess use data of first record
+ ;# otherwise try new guess
+
+ if ($fpos[$[+1] eq $filekey[$[] && $loffset[$[] > $fpos[$[+2])
+ {
+ local($noff);
+ $noff = $loffset[$[] - ($cnt - @loffset + 1) * $RecordSize;
+ $noff = 0 if $noff < 0;
+
+ return (@fpos[$[,$[+1], ($noff == $fpos[$[+2]) ? $loffset[$[] : $noff);
+ }
+ return ($fpos[$[],$filekey[$[],$loffset[$[]);
+ }
+ elsif ($fpos[$[] eq 'end' || $fpos[$[] eq 'cnt')
+ {
+ ;# try to start earlier in file
+ ;# if we already started at the beginning
+ ;# try to use previous file
+ ;# this assumes distance to better starting point is at most one file
+ ;# the primary guess at top of genfile() should usually allow this
+ ;# assumption
+ ;# if the offset of the first sample used is within
+ ;# a different file than we guessed it must have occurred later
+ ;# in the sequence of files
+ ;# this only can happen if our starting file did not contain
+ ;# a valid sample from the starting point we guessed
+ ;# however this does not invalidate our assumption, no check needed
+ local($noff,$key);
+ if ($fpos[$[+2] > 0)
+ {
+ $noff = $fpos[$[+2] - $RecordSize * ($cnt - @loffset + 1);
+ $noff = 0 if $noff < 0;
+ return (@fpos[$[,$[+1],$noff);
+ }
+ else
+ {
+ if ($fpos[$[+1] eq $F_files[$[])
+ {
+ ;# first file - and not enough samples
+ ;# use data of first sample
+ return ($fpos[$[], $filekey[$[], $loffset[$[]);
+ }
+ else
+ {
+ ;# search key of previous file
+ $key = $F_files[$[];
+ @F = reverse(@F_files);
+ while ($_ = shift(@F))
+ {
+ if ($_ eq $fpos[$[+1])
+ {
+ $key = shift(@F) if @F;
+ last;
+ }
+ }
+ $noff = int($F_size{$key} / $RecordSize);
+ $noff -= $cnt - @loffset;
+ $noff = 0 if $noff < 0;
+ $noff *= $RecordSize;
+ return ($fpos[$[], $key, $noff);
+ }
+ }
+ }
+ else
+ {
+ return ();
+ }
+
+ return 0 if @loffset <= 1 || ($loffset[$#loffset] - $loffset[$[]) <= 1;
+
+ ;# EOF - 1.1 * avg(line) * $cnt
+ local($val) = $loffset[$#loffset]
+ - $cnt * 11 * (($loffset[$#loffset] - $loffset[$[]) / @loffset) / 10;
+ return ($val < 0) ? 0 : $val;
+ }
+}
+
+$Ltime = -1 if ! defined($Ltime);
+$LastFreqBase = 0;
+$LastFreqBaseString = "??";
+
+;# initial setup of plot
+print "initialize plotting\n" if $verbose;
+if (defined($PrintIt))
+{
+ if ($PrintIt =~ m,/,)
+ {
+ print "Saving plot to file $PrintIt\n";
+ print PLOT "set output '$PrintIt'\n";
+ }
+ else
+ {
+ print "Printing plot on printer $PrintIt\n";
+ print PLOT "set output '| lpr -P$PrintIt -h'\n";
+ }
+ print PLOT "set terminal postscript landscape color solid 'Helvetica' 10\n";
+}
+print PLOT "set grid\n";
+print PLOT "set tics out\n";
+print PLOT "set format y '%g '\n";
+printf PLOT "set time 47\n" unless defined($PrintIt);
+
+@filepos =();
+while(1)
+{
+ print &ctime(time) if $verbose;
+
+ ;# update diplay characteristics
+ &read_config;# unless defined($PrintIt);
+
+ unlink($tmpfile);
+ my $lo = lr->new();
+ my $lf = lr->new();
+
+ @filepos = &genfile($samples,$srcprefix,$tmpfile,$lo,$lf,@filepos);
+
+ ;# make plotcmd display samples
+ make_doplot($lo, $lf);
+ print "Displaying plot...\n" if $verbose > 1;
+ print "command for plot sub process:\n$doplot----\n" if $verbose > 3;
+ print PLOT $doplot;
+}
+continue
+{
+ if (defined($PrintIt))
+ {
+ delete $SIG{'CHLD'};
+ print PLOT "quit\n";
+ close(PLOT);
+ if ($PrintIt =~ m,/,)
+ {
+ print "Plot saved to file $PrintIt\n";
+ }
+ else
+ {
+ print "Plot spooled to printer $PrintIt\n";
+ }
+ unlink($tmpfile);
+ exit(0);
+ }
+ ;# wait $delay seconds
+ print "waiting $delay seconds ..." if $verbose > 2;
+ sleep($delay);
+ print " continuing\n" if $verbose > 2;
+ undef($LastFreqBaseString);
+}
+
+
+sub date_time_spec2seconds
+{
+ local($_) = @_;
+ ;# a date_time_spec consistes of:
+ ;# YYYY-MM-DD_HH:MM:SS.ms
+ ;# values can be omitted from the beginning and default than to
+ ;# values of current date
+ ;# values omitted from the end default to lowest possible values
+
+ local($time) = time;
+ local($sec,$min,$hour,$mday,$mon,$year)
+ = localtime($time);
+
+ local($last) = ();
+
+ s/^\D*(.*\d)\D*/$1/; # strip off garbage
+
+ PARSE:
+ {
+ if (s/^(\d{4})(-|$)//)
+ {
+ if ($1 < 1970)
+ {
+ warn("$0: can not handle years before 1970 - year $1 ignored\n");
+ return undef;
+ }
+ elsif ( $1 >= 2070)
+ {
+ warn("$0: can not handle years past 2070 - year $1 ignored\n");
+ return undef;
+ }
+ else
+ {
+ $year = $1 % 100; # 0<= $year < 100
+ ;# - interpreted 70 .. 99,00 .. 69
+ }
+ $last = $[ + 5;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec: \"$_\" found after YEAR\n"),
+ return(undef)
+ if $2 eq '';
+ }
+
+ if (s/^(\d{1,2})(-|$)//)
+ {
+ warn("$0: implausible month $1\n"),return(undef)
+ if $1 < 1 || $1 > 12;
+ $mon = $1 - 1;
+ $last = $[ + 4;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec: \"$_\" found after MONTH\n"),
+ return(undef)
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"),return(undef)
+ if defined($last);
+
+ }
+
+ if (s/^(\d{1,2})([_ ]|$)//)
+ {
+ warn("$0: implausible month day $1 for month ".($mon+1)." (".
+ $MaxNumDaysPerMonth[$mon].")$mon\n"),
+ return(undef)
+ if $1 < 1 || $1 > $MaxNumDaysPerMonth[$mon];
+ $mday = $1;
+ $last = $[ + 3;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec \"$_\" found after MDAY\n"),
+ return(undef)
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"), return undef
+ if defined($last);
+ }
+
+ ;# now we face a problem:
+ ;# if ! defined($last) a prefix of "07:"
+ ;# can be either 07:MM or 07:ss
+ ;# to get the second interpretation make the user add
+ ;# a msec fraction part and check for this special case
+ if (! defined($last) && s/^(\d{1,2}):(\d{1,2}\.\d+)//)
+ {
+ warn("$0: implausible minute $1\n"), return undef
+ if $1 < 0 || $1 >= 60;
+ warn("$0: implausible second $1\n"), return undef
+ if $2 < 0 || $2 >= 60;
+ $min = $1;
+ $sec = $2;
+ $last = $[ + 1;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec \"$_\" after SECONDS\n");
+ return undef;
+ }
+
+ if (s/^(\d{1,2})(:|$)//)
+ {
+ warn("$0: implausible hour $1\n"), return undef
+ if $1 < 0 || $1 > 24;
+ $hour = $1;
+ $last = $[ + 2;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec found \"$_\" after HOUR\n"),
+ return undef
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"), return undef
+ if defined($last);
+ }
+
+ if (s/^(\d{1,2})(:|$)//)
+ {
+ warn("$0: implausible minute $1\n"), return undef
+ if $1 < 0 || $1 >=60;
+ $min = $1;
+ $last = $[ + 1;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec found \"$_\" after MINUTE\n"),
+ return undef
+ if $2 eq '';
+ }
+ else
+ {
+ warn("$0: bad date_time_spec \"$_\"\n"), return undef
+ if defined($last);
+ }
+
+ if (s/^(\d{1,2}(\.\d+)?)//)
+ {
+ warn("$0: implausible second $1\n"), return undef
+ if $1 < 0 || $1 >=60;
+ $sec = $1;
+ $last = $[;
+ last PARSE if $_ eq '';
+ warn("$0: bad date_time_spec found \"$_\" after SECOND\n");
+ return undef;
+ }
+ }
+
+ return $time unless defined($last);
+
+ $sec = 0 if $last > $[;
+ $min = 0 if $last > $[ + 1;
+ $hour = 0 if $last > $[ + 2;
+ $mday = 1 if $last > $[ + 3;
+ $mon = 0 if $last > $[ + 4;
+ local($rtime) = &timelocal($sec,$min,$hour,$mday,$mon,$year, 0,0, 0);
+
+ ;# $rtime may be off if daylight savings time is in effect at given date
+ return $rtime + ($sec - int($sec))
+ if $hour == (localtime($rtime))[$[+2];
+ return
+ &timelocal($sec,$min,$hour,$mday,$mon,$year, 0,0, 1)
+ + ($sec - int($sec));
+}
+
+
+sub min
+{
+ local($m) = shift;
+
+ grep((($m > $_) && ($m = $_),0),@_);
+ $m;
+}
+
+sub max
+{
+ local($m) = shift;
+
+ grep((($m < $_) && ($m = $_),0),@_);
+ $m;
+}
diff --git a/scripts/monitoring/ntptrap b/scripts/monitoring/ntptrap
new file mode 100644
index 0000000..f2abef9
--- /dev/null
+++ b/scripts/monitoring/ntptrap
@@ -0,0 +1,465 @@
+#!/local/bin/perl --*-perl-*-
+;#
+;# ntptrap,v 3.1 1993/07/06 01:09:15 jbj Exp
+;#
+;# a client for the xntp mode 6 trap mechanism
+;#
+;# Copyright (c) 1992
+;# Rainer Pruy Friedrich-Alexander Universitaet Erlangen-Nuernberg
+;#
+;#
+;#############################################################
+$0 =~ s!^.*/([^/]+)$!$1!; # strip to filename
+;# enforce STDOUT and STDERR to be line buffered
+$| = 1;
+select((select(STDERR),$|=1)[$[]);
+
+;#######################################
+;# load utility routines and definitions
+;#
+require('ntp.pl'); # implementation of the NTP protocol
+use Socket;
+
+#eval { require('sys/socket.ph'); require('netinet/in.ph') unless defined(&INADDR_ANY); } ||
+#do {
+ #die("$0: $@") unless $[ == index($@, "Can't locate ");
+ #warn "$0: $@";
+ #warn "$0: supplying some default definitions\n";
+ #eval 'sub INADDR_ANY { 0; } sub AF_INET {2;} sub SOCK_DGRAM {2;} 1;' || die "$0: $@";
+#};
+require('getopts.pl'); # option parsing
+require('ctime.pl'); # date/time formatting
+
+;######################################
+;# define some global constants
+;#
+$BASE_TIMEOUT=10;
+$FRAG_TIMEOUT=10;
+$MAX_TRY = 5;
+$REFRESH_TIME=60*15; # 15 minutes (server uses 1 hour)
+$ntp'timeout = $FRAG_TIMEOUT; #';
+$ntp'timeout if 0;
+
+;######################################
+;# now process options
+;#
+sub usage
+{
+ die("usage: $0 [-p <port>] [-l <logfile>] [host] ...\n");
+}
+
+&usage unless &Getopts('l:p:');
+&Getopts if 0; # make -w happy
+
+$opt_l = "/dev/null" # where to write debug messages to
+ if (!$opt_l);
+$opt_p = 0 # port to use locally - (0 does mean: will be chosen by kernel)
+ if (!$opt_p);
+
+@Hosts = ($#ARGV < $[) ? ("localhost") : @ARGV;
+
+;# setup for debug output
+$DEBUGFILE=$opt_l;
+$DEBUGFILE="&STDERR" if $DEBUGFILE eq '-';
+
+open(DEBUG,">>$DEBUGFILE") || die("Cannot open \"$DEBUGFILE\": $!\n");
+select((select(DEBUG),$|=1)[$[]);
+
+;# &log prints a single trap record (adding a (local) time stamp)
+sub log
+{
+ chop($date=&ctime(time));
+ print "$date ",@_,"\n";
+}
+
+sub debug
+{
+ print DEBUG @_,"\n";
+}
+;#
+$proto_udp = (getprotobyname('udp'))[$[+2] ||
+ (warn("$0: Could not get protocoll number for 'udp' using 17"), 17);
+
+$ntp_port = (getservbyname('ntp','udp'))[$[+2] ||
+ (warn("$0: Could not get port number for service ntp/udp using 123"), 123);
+
+;#
+socket(S, &AF_INET, &SOCK_DGRAM, $proto_udp) || die("Cannot open socket: $!\n");
+
+;#
+bind(S, pack("S n a4 x8", &AF_INET, $opt_p, &INADDR_ANY)) ||
+ die("Cannot bind: $!\n");
+
+($my_port, $my_addr) = (unpack("S n a4 x8",getsockname(S)))[$[+1,$[+2];
+&log(sprintf("Listening at address %d.%d.%d.%d port %d",
+ unpack("C4",$my_addr), $my_port));
+
+;# disregister with all servers in case of termination
+sub cleanup
+{
+ &log("Aborted by signal \"$_[$[]\"") if defined($_[$[]);
+
+ foreach (@Hosts)
+ {
+ if ( ! defined($Host{$_}) )
+ {
+ print "no info for host '$_'\n";
+ next;
+ }
+ &ntp'send(S,31,0,"",pack("Sna4x8",&AF_INET,$ntp_port,$Host{$_})); #';
+ }
+ close(S);
+ exit(2);
+}
+
+$SIG{'HUP'} = 'cleanup';
+$SIG{'INT'} = 'cleanup';
+$SIG{'QUIT'} = 'cleanup';
+$SIG{'TERM'} = 'cleanup';
+
+0 && $a && $b;
+sub timeouts # sort timeout id array
+{
+ $TIMEOUTS{$a} <=> $TIMEOUTS{$b};
+}
+
+;# a Request element looks like: pack("a4SC",addr,associd,op)
+@Requests= ();
+
+;# compute requests for set trap control msgs to each host given
+{
+ local($name,$addr);
+
+ foreach (@Hosts)
+ {
+ if (/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
+ {
+ ($name,$addr) =
+ (gethostbyaddr(pack("C4",$1,$2,$3,$4),&AF_INET))[$[,$[+4];
+ unless (defined($name))
+ {
+ $name = sprintf("[[%d.%d.%d.%d]]",$1,$2,$3,$4);
+ $addr = pack("C4",$1,$2,$3,$4);
+ }
+ }
+ else
+ {
+ ($name,$addr) = (gethostbyname($_))[$[,$[+4];
+ unless (defined($name))
+ {
+ warn "$0: unknown host \"$_\" - ignored\n";
+ next;
+ }
+ }
+ next if defined($Host{$name});
+ $Host{$name} = $addr;
+ $Host{$_} = $addr;
+ push(@Requests,pack("a4SC",$addr,0,6)); # schedule a set trap request for $name
+ }
+}
+
+sub hostname
+{
+ local($addr) = @_;
+ return $HostName{$addr} if defined($HostName{$addr});
+ local($name) = gethostbyaddr($addr,&AF_INET);
+ &debug(sprintf("hostname(%d.%d.%d.%d) = \"%s\"",unpack("C4",$addr),$name))
+ if defined($name);
+ defined($name) && ($HostName{$addr} = $name) && (return $name);
+ &debug(sprintf("Failed to get name for %d.%d.%d.%d",unpack("C4",$addr)));
+ return sprintf("[%d.%d.%d.%d]",unpack("C4",$addr));
+}
+
+;# when no hosts were given on the commandline no requests have been scheduled
+&usage unless (@Requests);
+
+&debug(sprintf("%d request(s) scheduled",scalar(@Requests)));
+grep(&debug(" - ".$_),keys(%Host));
+
+;# allocate variables;
+$addr="";
+$assoc=0;
+$op = 0;
+$timeout = 0;
+$ret="";
+%TIMEOUTS = ();
+%TIMEOUT_PROCS = ();
+@TIMEOUTS = ();
+
+$len = 512;
+$buf = " " x $len;
+
+while (1)
+{
+ if (@Requests || @TIMEOUTS) # if there is some work pending
+ {
+ if (@Requests)
+ {
+ ($addr,$assoc,$op) = unpack("a4SC",($req = shift(@Requests)));
+ &debug(sprintf("Request: %s: %s(%d)",&hostname($addr), &ntp'cntrlop_name($op), $assoc)); #';))
+ $ret = &ntp'send(S,$op,$assoc,"", #'(
+ pack("Sna4x8",&AF_INET,$ntp_port,$addr));
+ &set_timeout("retry-".unpack("H*",$req),time+$BASE_TIMEOUT,
+ sprintf("&retry(\"%s\");",unpack("H*",$req)));
+
+ last unless (defined($ret)); # warn called by ntp'send();
+
+ ;# if there are more requests just have a quick look for new messages
+ ;# otherwise grant server time for a response
+ $timeout = @Requests ? 0 : $BASE_TIMEOUT;
+ }
+ if ($timeout && @TIMEOUTS)
+ {
+ ;# ensure not to miss a timeout
+ if ($timeout + time > $TIMEOUTS{$TIMEOUTS[$[]})
+ {
+ $timeout = $TIMEOUTS{$TIMEOUTS[$[]} - time;
+ $timeout = 0 if $timeout < 0;
+ }
+ }
+ }
+ else
+ {
+ ;# no work yet - wait for some messages dropping in
+ ;# usually this will not hapen as the refresh semantic will
+ ;# always have a pending timeout
+ undef($timeout);
+ }
+
+ vec($mask="",fileno(S),1) = 1;
+ $ret = select($mask,undef,undef,$timeout);
+
+ warn("$0: select: $!\n"),last if $ret < 0; # give up on error return from select
+
+ if ($ret == 0)
+ {
+ ;# timeout
+ if (@TIMEOUTS && time > $TIMEOUTS{$TIMEOUTS[$[]})
+ {
+ ;# handle timeout
+ $timeout_proc =
+ (delete $TIMEOUT_PROCS{$TIMEOUTS[$[]},
+ delete $TIMEOUTS{shift(@TIMEOUTS)})[$[];
+ eval $timeout_proc;
+ die "timeout eval (\"$timeout_proc\"): $@\n" if $@;
+ }
+ ;# else: there may be something to be sent
+ }
+ else
+ {
+ ;# data avail
+ $from = recv(S,$buf,$len,0);
+ ;# give up on error return from recv
+ warn("$0: recv: $!\n"), last unless (defined($from));
+
+ $from = (unpack("Sna4",$from))[$[+2]; # keep host addr only
+ ;# could check for ntp_port - but who cares
+ &debug("-Packet from ",&hostname($from));
+
+ ;# stuff packet into ntp mode 6 receive machinery
+ ($ret,$data,$status,$associd,$op,$seq,$auth_keyid) =
+ &ntp'handle_packet($buf,$from); # ';
+ &debug(sprintf("%s uses auth_keyid %d",&hostname($from),$auth_keyid)) if defined($auth_keyid);
+ next unless defined($ret);
+
+ if ($ret eq "")
+ {
+ ;# handle packet
+ ;# simple trap response messages have neither timeout nor retries
+ &clear_timeout("retry-".unpack("H*",pack("a4SC",$from,$associd,$op))) unless $op == 7;
+ delete $RETRY{pack("a4SC",$from,$associd,$op)} unless $op == 7;
+
+ &process_response($from,$ret,$data,$status,$associd,$op,$seq,$auth_keyid);
+ }
+ else
+ {
+ ;# some kind of error
+ &log(sprintf("%50s: %s: %s",(gethostbyaddr($from,&AF_INET))[$[],$ret,$data));
+ if ($ret ne "TIMEOUT" && $ret ne "ERROR")
+ {
+ &clear_timeout("retry-".unpack("H*",pack("a4SC",$from,$associd,$op)));
+ }
+ }
+ }
+
+}
+
+warn("$0: terminating\n");
+&cleanup;
+exit 0;
+
+;##################################################
+;# timeout support
+;#
+sub set_timeout
+{
+ local($id,$time,$proc) = @_;
+
+ $TIMEOUTS{$id} = $time;
+ $TIMEOUT_PROCS{$id} = $proc;
+ @TIMEOUTS = sort timeouts keys(%TIMEOUTS);
+ chop($date=&ctime($time));
+ &debug(sprintf("Schedule timeout \"%s\" for %s", $id, $date));
+}
+
+sub clear_timeout
+{
+ local($id) = @_;
+ delete $TIMEOUTS{$id};
+ delete $TIMEOUT_PROCS{$id};
+ @TIMEOUTS = sort timeouts keys(%TIMEOUTS);
+ &debug("Clear timeout \"$id\"");
+}
+
+0 && &refresh;
+sub refresh
+{
+ local($addr) = @_[$[];
+ $addr = pack("H*",$addr);
+ &debug(sprintf("Refreshing trap for %s", &hostname($addr)));
+ push(@Requests,pack("a4SC",$addr,0,6));
+}
+
+0 && &retry;
+sub retry
+{
+ local($tag) = @_;
+ $tag = pack("H*",$tag);
+ $RETRY{$tag} = 0 if (!defined($RETRY{$tag}));
+
+ if (++$RETRY{$tag} > $MAX_TRY)
+ {
+ &debug(sprintf("Retry failed: %s assoc %5d op %d",
+ &hostname(substr($tag,$[,4)),
+ unpack("x4SC",$tag)));
+ return;
+ }
+ &debug(sprintf("Retrying: %s assoc %5d op %d",
+ &hostname(substr($tag,$[,4)),
+ unpack("x4SC",$tag)));
+ push(@Requests,$tag);
+}
+
+sub process_response
+{
+ local($from,$ret,$data,$status,$associd,$op,$seq,$auth_keyid) = @_;
+
+ $msg="";
+ if ($op == 7) # trap response
+ {
+ $msg .= sprintf("%40s trap#%-5d",
+ &hostname($from),$seq);
+ &debug (sprintf("\nTrap %d associd %d:\n%s\n===============\n",$seq,$associd,$data));
+ if ($associd == 0) # system event
+ {
+ $msg .= " SYSTEM ";
+ $evnt = &ntp'SystemEvent($status); #';
+ $msg .= "$evnt ";
+ ;# for special cases add additional info
+ ($stratum) = ($data =~ /stratum=(\d+)/);
+ ($refid) = ($data =~ /refid=([\w\.]+)/);
+ $msg .= "stratum=$stratum refid=$refid";
+ if ($refid =~ /\[?(\d+)\.(\d+)\.(\d+)\.(\d+)/)
+ {
+ local($x) = (gethostbyaddr(pack("C4",$1,$2,$3,$4),&AF_INET));
+ $msg .= " " . $x if defined($x)
+ }
+ if ($evnt eq "event_sync_chg")
+ {
+ $msg .= sprintf("%s %s ",
+ &ntp'LI($status), #',
+ &ntp'ClockSource($status) #'
+ );
+ }
+ elsif ($evnt eq "event_sync/strat_chg")
+ {
+ ($peer) = ($data =~ /peer=([0-9]+)/);
+ $msg .= " peer=$peer";
+ }
+ elsif ($evnt eq "event_clock_excptn")
+ {
+ if (($device) = ($data =~ /device=\"([^\"]+)\"/))
+ {
+ ($cstatus) = ($data =~ /refclockstatus=0?x?([\da-fA-F]+)/);
+ $Cstatus = hex($cstatus);
+ $msg .= sprintf("- %-32s",&ntp'clock_status($Cstatus)); #');
+ ($timecode) = ($data =~ /timecode=\"([^\"]+)\"/);
+ $msg .= " \"$device\" \"$timecode\"";
+ }
+ else
+ {
+ push(@Requests,pack("a4SC",$from, $associd, 4));
+ }
+ }
+ }
+ else # peer event
+ {
+ $msg .= sprintf("peer %5d ",$associd);
+ ($srcadr) = ($data =~ /srcadr=\[?([\d\.]+)/);
+ $msg .= sprintf("%-18s %40s ", "[$srcadr]",
+ &hostname(pack("C4",split(/\./,$srcadr))));
+ $evnt = &ntp'PeerEvent($status); #';
+ $msg .= "$evnt ";
+ ;# for special cases include additional info
+ if ($evnt eq "event_clock_excptn")
+ {
+ if (($device) = ($data =~ /device=\"([^\"]+)\"/))
+ {
+ ;#&debug("----\n$data\n====\n");
+ ($cstatus) = ($data =~ /refclockstatus=0?x?([\da-fA-F]+)/);
+ $Cstatus = hex($cstatus);
+ $msg .= sprintf("- %-32s",&ntp'clock_status($Cstatus)); #');
+ ($timecode) = ($data =~ /timecode=\"([^\"]+)\"/);
+ $msg .= " \"$device\" \"$timecode\"";
+ }
+ else
+ {
+ ;# no clockvars included - post a cv request
+ push(@Requests,pack("a4SC",$from, $associd, 4));
+ }
+ }
+ elsif ($evnt eq "event_stratum_chg")
+ {
+ ($stratum) = ($data =~ /stratum=(\d+)/);
+ $msg .= "new stratum $stratum";
+ }
+ }
+ }
+ elsif ($op == 6) # set trap resonse
+ {
+ &debug("Set trap ok from ",&hostname($from));
+ &set_timeout("refresh-".unpack("H*",$from),time+$REFRESH_TIME,
+ sprintf("&refresh(\"%s\");",unpack("H*",$from)));
+ return;
+ }
+ elsif ($op == 4) # read clock variables response
+ {
+ ;# status of clock
+ $msg .= sprintf(" %40s ", &hostname($from));
+ if ($associd == 0)
+ {
+ $msg .= "system clock status: ";
+ }
+ else
+ {
+ $msg .= sprintf("peer %5d clock",$associd);
+ }
+ $msg .= sprintf("%-32s",&ntp'clock_status($status)); #');
+ ($device) = ($data =~ /device=\"([^\"]+)\"/);
+ ($timecode) = ($data =~ /timecode=\"([^\"]+)\"/);
+ $msg .= " \"$device\" \"$timecode\"";
+ }
+ elsif ($op == 31) # unset trap response (UNOFFICIAL op)
+ {
+ ;# clear timeout
+ &debug("Clear Trap ok from ",&hostname($from));
+ &clear_timeout("refresh-".unpack("H*",$from));
+ return;
+ }
+ else # unexpected response
+ {
+ $msg .= "unexpected response to op $op assoc=$associd";
+ $msg .= sprintf(" status=%04x",$status);
+ }
+ &log($msg);
+}
diff --git a/scripts/monitoring/timelocal.pl b/scripts/monitoring/timelocal.pl
new file mode 100644
index 0000000..d0f73a2
--- /dev/null
+++ b/scripts/monitoring/timelocal.pl
@@ -0,0 +1,77 @@
+;# timelocal.pl
+;#
+;# Usage:
+;# $time = timelocal($sec,$min,$hours,$mday,$mon,$year,$junk,$junk,$isdst);
+;# $time = timegm($sec,$min,$hours,$mday,$mon,$year);
+
+;# These routines are quite efficient and yet are always guaranteed to agree
+;# with localtime() and gmtime(). We manage this by caching the start times
+;# of any months we've seen before. If we know the start time of the month,
+;# we can always calculate any time within the month. The start times
+;# themselves are guessed by successive approximation starting at the
+;# current time, since most dates seen in practice are close to the
+;# current date. Unlike algorithms that do a binary search (calling gmtime
+;# once for each bit of the time value, resulting in 32 calls), this algorithm
+;# calls it at most 6 times, and usually only once or twice. If you hit
+;# the month cache, of course, it doesn't call it at all.
+
+;# timelocal is implemented using the same cache. We just assume that we're
+;# translating a GMT time, and then fudge it when we're done for the timezone
+;# and daylight savings arguments. The timezone is determined by examining
+;# the result of localtime(0) when the package is initialized. The daylight
+;# savings offset is currently assumed to be one hour.
+
+CONFIG: {
+ package timelocal;
+
+ @epoch = localtime(0);
+ $tzmin = $epoch[2] * 60 + $epoch[1]; # minutes east of GMT
+ if ($tzmin > 0) {
+ $tzmin = 24 * 60 - $tzmin; # minutes west of GMT
+ $tzmin -= 24 * 60 if $epoch[5] == 70; # account for the date line
+ }
+
+ $SEC = 1;
+ $MIN = 60 * $SEC;
+ $HR = 60 * $MIN;
+ $DAYS = 24 * $HR;
+ $YearFix = ((gmtime(946684800))[5] == 100) ? 100 : 0;
+}
+
+sub timegm {
+ package timelocal;
+
+ $ym = pack(C2, @_[5,4]);
+ $cheat = $cheat{$ym} || &cheat;
+ $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS;
+}
+
+sub timelocal {
+ package timelocal;
+
+ $ym = pack(C2, @_[5,4]);
+ $cheat = $cheat{$ym} || &cheat;
+ $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS
+ + $tzmin * $MIN - 60 * 60 * ($_[8] != 0);
+}
+
+package timelocal;
+
+sub cheat {
+ $year = $_[5];
+ $month = $_[4];
+ $guess = $^T;
+ @g = gmtime($guess);
+ $year += $YearFix if $year < $epoch[5];
+ while ($diff = $year - $g[5]) {
+ $guess += $diff * (364 * $DAYS);
+ @g = gmtime($guess);
+ }
+ while ($diff = $month - $g[4]) {
+ $guess += $diff * (28 * $DAYS);
+ @g = gmtime($guess);
+ }
+ $g[3]--;
+ $guess -= $g[0] * $SEC + $g[1] * $MIN + $g[2] * $HR + $g[3] * $DAYS;
+ $cheat{$ym} = $guess;
+}
diff --git a/scripts/ntp-wait/Makefile.am b/scripts/ntp-wait/Makefile.am
new file mode 100644
index 0000000..b819329
--- /dev/null
+++ b/scripts/ntp-wait/Makefile.am
@@ -0,0 +1,96 @@
+NULL=
+
+bin_SCRIPTS = $(NTP_WAIT_DB)
+libexec_SCRIPTS = $(NTP_WAIT_DL)
+sbin_SCRIPTS = $(NTP_WAIT_DS)
+
+man1_MANS=
+man8_MANS=
+man_MANS= ntp-wait.$(NTP_WAIT_MS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntp-wait
+
+DISTCLEANFILES = config.log $(man_MANS)
+EXTRA_DIST = \
+ ntp-wait.in \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+html_DATA = $(srcdir)/ntp-wait.html
+
+noinst_DATA = \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+ntp-wait: $(srcdir)/ntp-wait-opts
+
+$(srcdir)/ntp-wait-opts: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) ntp-wait-opts.def
+
+### Nroff
+
+$(srcdir)/ntp-wait.1ntp-waitman: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitman -Tagman-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.man.in: $(srcdir)/ntp-wait.1ntp-waitman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitman > $(srcdir)/ntp-wait.man.in+
+ mv $(srcdir)/ntp-wait.man.in+ $(srcdir)/ntp-wait.man.in
+
+### Mdoc
+
+$(srcdir)/ntp-wait.1ntp-waitmdoc: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitmdoc -Tagmdoc-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.mdoc.in: $(srcdir)/ntp-wait.1ntp-waitmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitmdoc > $(srcdir)/ntp-wait.mdoc.in+
+ mv $(srcdir)/ntp-wait.mdoc.in+ $(srcdir)/ntp-wait.mdoc.in
+
+### Manpage
+
+ntp-wait.$(NTP_WAIT_MS): $(srcdir)/ntp-wait.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp-wait.$(NTP_WAIT_MS)+:$(srcdir)/ntp-wait.$(MANTAGFMT).in
+ mv ntp-wait.$(NTP_WAIT_MS)+ ntp-wait.$(NTP_WAIT_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntp-wait.menu: $(srcdir)/invoke-ntp-wait.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp-wait.texi: ntp-wait-opts $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-wait-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntp-wait.html: $(srcdir)/invoke-ntp-wait.menu $(srcdir)/invoke-ntp-wait.texi $(srcdir)/ntp-wait.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntp-wait.html ntp-wait.texi || true )
diff --git a/scripts/ntp-wait/Makefile.in b/scripts/ntp-wait/Makefile.in
new file mode 100644
index 0000000..bb2eae7
--- /dev/null
+++ b/scripts/ntp-wait/Makefile.in
@@ -0,0 +1,879 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/ntp-wait
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntp-wait.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntp-wait
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+bin_SCRIPTS = $(NTP_WAIT_DB)
+libexec_SCRIPTS = $(NTP_WAIT_DL)
+sbin_SCRIPTS = $(NTP_WAIT_DS)
+man1_MANS =
+man8_MANS =
+man_MANS = ntp-wait.$(NTP_WAIT_MS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntp-wait
+DISTCLEANFILES = config.log $(man_MANS)
+EXTRA_DIST = \
+ ntp-wait.in \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+html_DATA = $(srcdir)/ntp-wait.html
+noinst_DATA = \
+ ntp-wait.1ntp-waitman \
+ ntp-wait.1ntp-waitmdoc \
+ ntp-wait.man.in \
+ ntp-wait.mdoc.in \
+ ntp-wait.texi \
+ ntp-wait.html \
+ ntp-wait-opts.def \
+ ntp-wait-opts \
+ invoke-ntp-wait.texi \
+ invoke-ntp-wait.menu \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/ntp-wait/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/ntp-wait/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntp-wait: $(top_builddir)/config.status $(srcdir)/ntp-wait.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS
+
+
+ntp-wait: $(srcdir)/ntp-wait-opts
+
+$(srcdir)/ntp-wait-opts: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) ntp-wait-opts.def
+
+### Nroff
+
+$(srcdir)/ntp-wait.1ntp-waitman: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitman -Tagman-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.man.in: $(srcdir)/ntp-wait.1ntp-waitman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitman > $(srcdir)/ntp-wait.man.in+
+ mv $(srcdir)/ntp-wait.man.in+ $(srcdir)/ntp-wait.man.in
+
+### Mdoc
+
+$(srcdir)/ntp-wait.1ntp-waitmdoc: $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-waitmdoc -Tagmdoc-cmd.tpl ntp-wait-opts.def
+
+$(srcdir)/ntp-wait.mdoc.in: $(srcdir)/ntp-wait.1ntp-waitmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitmdoc > $(srcdir)/ntp-wait.mdoc.in+
+ mv $(srcdir)/ntp-wait.mdoc.in+ $(srcdir)/ntp-wait.mdoc.in
+
+### Manpage
+
+ntp-wait.$(NTP_WAIT_MS): $(srcdir)/ntp-wait.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp-wait.$(NTP_WAIT_MS)+:$(srcdir)/ntp-wait.$(MANTAGFMT).in
+ mv ntp-wait.$(NTP_WAIT_MS)+ ntp-wait.$(NTP_WAIT_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntp-wait.menu: $(srcdir)/invoke-ntp-wait.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp-wait.texi: ntp-wait-opts $(srcdir)/ntp-wait-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-wait-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntp-wait.html: $(srcdir)/invoke-ntp-wait.menu $(srcdir)/invoke-ntp-wait.texi $(srcdir)/ntp-wait.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntp-wait.html ntp-wait.texi || true )
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/ntp-wait/invoke-ntp-wait.menu b/scripts/ntp-wait/invoke-ntp-wait.menu
new file mode 100644
index 0000000..bb51936
--- /dev/null
+++ b/scripts/ntp-wait/invoke-ntp-wait.menu
@@ -0,0 +1 @@
+* ntp-wait Invocation:: Invoking ntp-wait
diff --git a/scripts/ntp-wait/invoke-ntp-wait.texi b/scripts/ntp-wait/invoke-ntp-wait.texi
new file mode 100644
index 0000000..f329985
--- /dev/null
+++ b/scripts/ntp-wait/invoke-ntp-wait.texi
@@ -0,0 +1,114 @@
+@node ntp-wait Invocation
+@section Invoking ntp-wait
+@pindex ntp-wait
+@cindex Wait for ntpd to stabilize the system clock
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntp-wait.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:18 AM by AutoGen 5.18.5pre4
+# From the definitions ntp-wait-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+@code{ntp-wait}
+will send at most
+@kbd{num-tries}
+queries to
+@code{ntpd(8)},
+sleeping for
+@kbd{secs-between-tries}
+after each status return that says
+@code{ntpd(8)}
+has not yet produced a synchronized and stable system clock.
+
+@code{ntp-wait}
+will do this quietly, unless the
+@code{-v}
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+@kbd{ntpd} @kbd{-g}
+has set the time.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-wait} program.
+
+@menu
+* ntp-wait usage:: ntp-wait help/usage (@option{--help})
+* ntp-wait tries:: tries option (-n)
+* ntp-wait sleep:: sleep option (-s)
+* ntp-wait verbose:: verbose option (-v)
+* ntp-wait exit status:: exit status
+* ntp-wait Authors:: Authors
+* ntp-wait Notes:: Notes
+@end menu
+
+@node ntp-wait usage
+@subsection ntp-wait help/usage (@option{--help})
+@cindex ntp-wait help
+
+This is the automatically generated usage text for ntp-wait.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.7p482
+USAGE: ntp-wait [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+
+ -n, --tries=num Number of times to check ntpd
+ -s, --sleep=num How long to sleep between tries
+ -v, --verbose Be verbose
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node ntp-wait tries
+@subsection tries option (-n)
+@cindex ntp-wait-tries
+
+This is the ``number of times to check ntpd'' option.
+This option takes a number argument.
+ The maximum number of times we will check @code{ntpd} to see if
+ it has been able to synchronize and stabilize the system clock.
+@node ntp-wait sleep
+@subsection sleep option (-s)
+@cindex ntp-wait-sleep
+
+This is the ``how long to sleep between tries'' option.
+This option takes a number argument @file{secs-between-tries}.
+ We will sleep for @file{secs-between-tries} after each query
+ of @code{ntpd} that returns "the time is not yet stable".
+@node ntp-wait verbose
+@subsection verbose option (-v)
+@cindex ntp-wait-verbose
+
+This is the ``be verbose'' option.
+ By default, @code{ntp-wait} is silent.
+ With this option, @code{ntp-wait} will provide status information.
+@node ntp-wait exit status
+@subsection ntp-wait exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
+@node ntp-wait Authors
+@subsection ntp-wait Authors
+@node ntp-wait Notes
+@subsection ntp-wait Notes
diff --git a/scripts/ntp-wait/ntp-wait-opts b/scripts/ntp-wait/ntp-wait-opts
new file mode 100644
index 0000000..73be46b
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait-opts
@@ -0,0 +1,62 @@
+# EDIT THIS FILE WITH CAUTION (ntp-wait-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:12 AM by AutoGen 5.18.5pre4
+# From the definitions ntp-wait-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'tries' => '100',
+ 'sleep' => '6',
+ 'verbose' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'tries|n=i', 'sleep|s=i', 'verbose|v',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.7p482
+USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ -n, --tries=num Number of times to check ntpd
+ -s, --sleep=num How long to sleep between tries
+ -v, --verbose Be verbose
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/ntp-wait/ntp-wait-opts.def b/scripts/ntp-wait/ntp-wait-opts.def
new file mode 100644
index 0000000..14eebbc
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait-opts.def
@@ -0,0 +1,109 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = "ntp-wait";
+prog-title = "Wait for ntpd to stabilize the system clock";
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = tries;
+ value = n;
+ arg-type = number;
+ arg-default = 100;
+ descrip = "Number of times to check ntpd";
+ doc = <<- _EndOfDoc_
+ The maximum number of times we will check @code{ntpd} to see if
+ it has been able to synchronize and stabilize the system clock.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = sleep;
+ value = s;
+ arg-type = number;
+ arg-name = "secs-between-tries";
+ arg-default = 6;
+ descrip = "How long to sleep between tries";
+ doc = <<- _EndOfDoc_
+ We will sleep for @file{secs-between-tries} after each query
+ of @code{ntpd} that returns "the time is not yet stable".
+ _EndOfDoc_;
+};
+
+flag = {
+ name = verbose;
+ value = v;
+ descrip = "Be verbose";
+ doc = <<- _EndOfDoc_
+ By default, @code{ntp-wait} is silent.
+ With this option, @code{ntp-wait} will provide status information.
+ _EndOfDoc_;
+};
+
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+.Nm
+will send at most
+.Ar num-tries
+queries to
+.Xr ntpd 8 ,
+sleeping for
+.Ar secs-between-tries
+after each status return that says
+.Xr ntpd 8
+has not yet produced a synchronized and stable system clock.
+.Pp
+.Nm
+will do this quietly, unless the
+.Fl v
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+.Ar ntpd -g
+has set the time.
+ _END_PROG_MDOC_DESCRIP;
+};
+
+/*
+doc-section = {
+ ds-type = 'USAGE';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_USAGE
+ _END_MDOC_USAGE;
+};
+*/
+
+doc-section = {
+ ds-type = 'AUTHORS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_AUTH
+.An "Harlan Stenn"
+ _END_MDOC_AUTH;
+};
+
+doc-section = {
+ ds-type = 'NOTES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_NOTES
+This document corresponds to version @VERSION@ of NTP.
+ _END_MDOC_NOTES;
+};
+
+/*
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+ _END_MDOC_BUGS;
+};
+*/
diff --git a/scripts/ntp-wait/ntp-wait.1ntp-waitman b/scripts/ntp-wait/ntp-wait.1ntp-waitman
new file mode 100644
index 0000000..1eef06c
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.1ntp-waitman
@@ -0,0 +1,122 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp-wait 1ntp-waitman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-DfaOdD/ag-PfaWcD)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:14 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp-wait\fP
+\- Wait for ntpd to stabilize the system clock
+.SH SYNOPSIS
+\f\*[B-Font]ntp-wait\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntp-wait\fP
+will send at most
+\f\*[I-Font]num-tries\f[]
+queries to
+\fCntpd\fR(8)\f[],
+sleeping for
+\f\*[I-Font]secs-between-tries\f[]
+after each status return that says
+\fCntpd\fR(8)\f[]
+has not yet produced a synchronized and stable system clock.
+.sp \n(Ppu
+.ne 2
+
+\f\*[B-Font]ntp-wait\fP
+will do this quietly, unless the
+\f\*[B-Font]\-v\f[]
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+\f\*[I-Font]ntpd\f[] \f\*[I-Font]\-g\f[]
+has set the time.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tries\f[]=\f\*[I-Font]number\f[]
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]secs\-between\-tries\f[], \f\*[B-Font]\-\-sleep\f[]=\f\*[I-Font]secs\-between\-tries\f[]
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]secs\-between\-tries\f[]
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs-between-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.TP
+.NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
+Be verbose.
+.sp
+ By default, \fBntp-wait\fP is silent.
+ With this option, \fBntp-wait\fP will provide status information.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Harlan Stenn"
+.br
+.SH NOTES
+This document corresponds to version @VERSION@ of NTP.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc b/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
new file mode 100644
index 0000000..911452c
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
@@ -0,0 +1,95 @@
+.Dd December 2 2014
+.Dt NTP_WAIT 1ntp-waitmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:21 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp-wait
+.Nd Wait for ntpd to stabilize the system clock
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+will send at most
+.Ar num\-tries
+queries to
+.Xr ntpd 8 ,
+sleeping for
+.Ar secs\-between\-tries
+after each status return that says
+.Xr ntpd 8
+has not yet produced a synchronized and stable system clock.
+.Pp
+.Nm
+will do this quietly, unless the
+.Fl v
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+.Ar ntpd \-g
+has set the time.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n Ar number , Fl \-tries Ns = Ns Ar number
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.It Fl s Ar secs\-between\-tries , Fl \-sleep Ns = Ns Ar secs\-between\-tries
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+.Ar secs\-between\-tries
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs\-between\-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.It Fl v , Fl \-verbose
+Be verbose.
+.sp
+ By default, \fBntp\-wait\fP is silent.
+ With this option, \fBntp\-wait\fP will provide status information.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Harlan Stenn"
+.Sh NOTES
+This document corresponds to version @VERSION@ of NTP.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp\-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.html b/scripts/ntp-wait/ntp-wait.html
new file mode 100644
index 0000000..a0cc721
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.html
@@ -0,0 +1,208 @@
+<html lang="en">
+<head>
+<title>Ntp-wait User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Ntp-wait User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Ntp-wait User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Description">ntp-wait Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+ <p>This document describes the use of the NTP Project's <code>ntp-wait</code> program.
+
+ <p>If there are time-sensitive applications,
+the proper sequence of events is to
+run <code>ntpd -g</code> as early as possible,
+then invoke all of the non-time-sensitive process,
+run <code>ntp-wait</code> to block
+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.7p482 of <code>ntp-wait</code>.
+
+<div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002dwait-Description">ntp-wait Description</a>: Description
+<li><a accesskey="2" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>: Invoking ntp-wait
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">0.1 Invoking ntp-wait</h3>
+
+<p><a name="index-ntp_002dwait-1"></a><a name="index-Wait-for-ntpd-to-stabilize-the-system-clock-2"></a>
+
+ <p><code>ntp-wait</code>
+will send at most
+<kbd>num-tries</kbd>
+queries to
+<code>ntpd(8)</code>,
+sleeping for
+<kbd>secs-between-tries</kbd>
+after each status return that says
+<code>ntpd(8)</code>
+has not yet produced a synchronized and stable system clock.
+
+ <p><code>ntp-wait</code>
+will do this quietly, unless the
+<code>-v</code>
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+<kbd>ntpd</kbd> <kbd>-g</kbd>
+has set the time.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-wait</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002dwait-usage">ntp-wait usage</a>: ntp-wait help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntp_002dwait-tries">ntp-wait tries</a>: tries option (-n)
+<li><a accesskey="3" href="#ntp_002dwait-sleep">ntp-wait sleep</a>: sleep option (-s)
+<li><a accesskey="4" href="#ntp_002dwait-verbose">ntp-wait verbose</a>: verbose option (-v)
+<li><a accesskey="5" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>: exit status
+<li><a accesskey="6" href="#ntp_002dwait-Authors">ntp-wait Authors</a>: Authors
+<li><a accesskey="7" href="#ntp_002dwait-Notes">ntp-wait Notes</a>: Notes
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-tries">ntp-wait tries</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.1 ntp-wait help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntp_002dwait-help-3"></a>
+This is the automatically generated usage text for ntp-wait.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.7p482
+USAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ -n, --tries=num Number of times to check ntpd
+ -s, --sleep=num How long to sleep between tries
+ -v, --verbose Be verbose
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntp_002dwait-tries"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-sleep">ntp-wait sleep</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-usage">ntp-wait usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.2 tries option (-n)</h4>
+
+<p><a name="index-ntp_002dwait_002dtries-4"></a>
+This is the &ldquo;number of times to check ntpd&rdquo; option.
+This option takes a number argument.
+ The maximum number of times we will check <code>ntpd</code> to see if
+ it has been able to synchronize and stabilize the system clock.
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-sleep"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-verbose">ntp-wait verbose</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-tries">ntp-wait tries</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.3 sleep option (-s)</h4>
+
+<p><a name="index-ntp_002dwait_002dsleep-5"></a>
+This is the &ldquo;how long to sleep between tries&rdquo; option.
+This option takes a number argument <span class="file">secs-between-tries</span>.
+ We will sleep for <span class="file">secs-between-tries</span> after each query
+ of <code>ntpd</code> that returns "the time is not yet stable".
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-verbose"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-sleep">ntp-wait sleep</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.4 verbose option (-v)</h4>
+
+<p><a name="index-ntp_002dwait_002dverbose-6"></a>
+This is the &ldquo;be verbose&rdquo; option.
+ By default, <code>ntp-wait</code> is silent.
+ With this option, <code>ntp-wait</code> will provide status information.
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-verbose">ntp-wait verbose</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.5 ntp-wait exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+ <div class="node">
+<p><hr>
+<a name="ntp_002dwait-Authors"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dwait-Notes">ntp-wait Notes</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-exit-status">ntp-wait exit status</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.6 ntp-wait Authors</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dwait-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dwait-Authors">ntp-wait Authors</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dwait-Invocation">ntp-wait Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.7 ntp-wait Notes</h4>
+
+</body></html>
+
diff --git a/scripts/ntp-wait/ntp-wait.in b/scripts/ntp-wait/ntp-wait.in
new file mode 100644
index 0000000..b35828a
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.in
@@ -0,0 +1,66 @@
+#! @PATH_PERL@
+
+package ntp_wait;
+use 5.006_000;
+use strict;
+use warnings;
+use lib "@PERLLIBDIR@";
+use NTP::Util qw(ntp_read_vars);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ };
+
+ my $tries = $opts->{tries}; # How many tries before we give up? (10 min+)
+ my $sleep = $opts->{sleep}; # Seconds to sleep between tries (6s = 10/min)
+ my $verbose = $opts->{verbose}; # Be verbose?
+
+ # Autoflush stdout
+ $| = 1;
+
+ print "Waiting for ntpd to synchronize... " if $verbose;
+
+ for my $i (1 .. $tries) {
+ my $info = ntp_read_vars(0, []);
+
+ if (!defined $info) {
+ print "\bntpd is not running!\n" if $verbose;
+ return 1;
+ }
+
+ if (!exists $info->{status_line}{leap}) {
+ print "\bLeap status not avalaible\n";
+ return 1;
+ }
+
+ my $leap = $info->{status_line}{leap};
+ my $sync = $info->{status_line}{sync};
+
+ if ($leap =~ /(sync|leap)_alarm/) {
+ print "\b".(substr "*+:.", $i % 4, 1) if $verbose;
+ sleep $sleep if $i < $tries;
+ next;
+ }
+
+ if ($leap =~ /leap_(none|((add|del)_sec))/) {
+ # We could check $sync here to make sure we like the source...
+ print "\bOK!\n" if $verbose;
+ return 0;
+ }
+
+ print "\bUnexpected 'leap' status <$leap>\n";
+ return 1;
+ }
+
+ print "\bNo!\nntpd did not synchronize.\n" if $verbose;
+ return 1;
+}
+
+@ntp_wait_opts@
+
+1;
+__END__
diff --git a/scripts/ntp-wait/ntp-wait.man.in b/scripts/ntp-wait/ntp-wait.man.in
new file mode 100644
index 0000000..971e7f2
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.man.in
@@ -0,0 +1,122 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp-wait @NTP_WAIT_MS@ "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-DfaOdD/ag-PfaWcD)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:14 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp-wait\fP
+\- Wait for ntpd to stabilize the system clock
+.SH SYNOPSIS
+\f\*[B-Font]ntp-wait\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntp-wait\fP
+will send at most
+\f\*[I-Font]num-tries\f[]
+queries to
+\fCntpd\fR(8)\f[],
+sleeping for
+\f\*[I-Font]secs-between-tries\f[]
+after each status return that says
+\fCntpd\fR(8)\f[]
+has not yet produced a synchronized and stable system clock.
+.sp \n(Ppu
+.ne 2
+
+\f\*[B-Font]ntp-wait\fP
+will do this quietly, unless the
+\f\*[B-Font]\-v\f[]
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+\f\*[I-Font]ntpd\f[] \f\*[I-Font]\-g\f[]
+has set the time.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-tries\f[]=\f\*[I-Font]number\f[]
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]secs\-between\-tries\f[], \f\*[B-Font]\-\-sleep\f[]=\f\*[I-Font]secs\-between\-tries\f[]
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]secs\-between\-tries\f[]
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs-between-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.TP
+.NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
+Be verbose.
+.sp
+ By default, \fBntp-wait\fP is silent.
+ With this option, \fBntp-wait\fP will provide status information.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Harlan Stenn"
+.br
+.SH NOTES
+This document corresponds to version @VERSION@ of NTP.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.mdoc.in b/scripts/ntp-wait/ntp-wait.mdoc.in
new file mode 100644
index 0000000..23afeb7
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.mdoc.in
@@ -0,0 +1,95 @@
+.Dd December 2 2014
+.Dt NTP_WAIT @NTP_WAIT_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:21 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-wait-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp-wait
+.Nd Wait for ntpd to stabilize the system clock
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.Nm
+will send at most
+.Ar num\-tries
+queries to
+.Xr ntpd 8 ,
+sleeping for
+.Ar secs\-between\-tries
+after each status return that says
+.Xr ntpd 8
+has not yet produced a synchronized and stable system clock.
+.Pp
+.Nm
+will do this quietly, unless the
+.Fl v
+flag is provided.
+This can be useful at boot time, to delay the boot sequence until after
+.Ar ntpd \-g
+has set the time.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n Ar number , Fl \-tries Ns = Ns Ar number
+Number of times to check ntpd.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 100
+.sp
+ The maximum number of times we will check \fBntpd\fP to see if
+ it has been able to synchronize and stabilize the system clock.
+.It Fl s Ar secs\-between\-tries , Fl \-sleep Ns = Ns Ar secs\-between\-tries
+How long to sleep between tries.
+This option takes an integer number as its argument.
+The default
+.Ar secs\-between\-tries
+for this option is:
+.ti +4
+ 6
+.sp
+ We will sleep for \fIsecs\-between\-tries\fP after each query
+ of \fBntpd\fP that returns "the time is not yet stable".
+.It Fl v , Fl \-verbose
+Be verbose.
+.sp
+ By default, \fBntp\-wait\fP is silent.
+ With this option, \fBntp\-wait\fP will provide status information.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Harlan Stenn"
+.Sh NOTES
+This document corresponds to version @VERSION@ of NTP.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp\-wait\fP
+option definitions.
diff --git a/scripts/ntp-wait/ntp-wait.texi b/scripts/ntp-wait/ntp-wait.texi
new file mode 100644
index 0000000..208639b
--- /dev/null
+++ b/scripts/ntp-wait/ntp-wait.texi
@@ -0,0 +1,52 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntp-wait.info
+@settitle Ntp-wait User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{ntp-wait},
+a program from
+the NTP Project,
+that is used to wait until @code{ntpd} has been able to
+synchronize and stabilize the time on the current host.
+@end ifinfo
+
+@direntry
+* ntp-wait: (ntp-wait). Wait for ntpd to synchronize and stabilize the system clock.
+@end direntry
+
+@titlepage
+@title ntp-wait User's Manual
+@subtitle ntp-wait, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntp-wait Description, (dir), (dir)
+
+This document describes the use of the NTP Project's @code{ntp-wait} program.
+
+If there are time-sensitive applications,
+the proper sequence of events is to
+run @code{ntpd -g} as early as possible,
+then invoke all of the non-time-sensitive process,
+run @code{ntp-wait} to block
+until the system's time has stabilized and synchronized,
+and only then start any applicaitons (like database servers) that require
+accurate and stable time.
+
+This document applies to version @value{VERSION} of @code{ntp-wait}.
+
+@shortcontents
+
+@menu
+* ntp-wait Description:: Description
+* ntp-wait Invocation:: Invoking ntp-wait
+@end menu
+
+@include invoke-ntp-wait.texi
diff --git a/scripts/ntpsweep/Makefile.am b/scripts/ntpsweep/Makefile.am
new file mode 100644
index 0000000..7ecc23b
--- /dev/null
+++ b/scripts/ntpsweep/Makefile.am
@@ -0,0 +1,102 @@
+NULL=
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+bin_SCRIPTS= $(NTPSWEEP_DB)
+sbin_SCRIPTS= $(NTPSWEEP_DS)
+libexec_SCRIPTS= $(NTPSWEEP_DL)
+noinst_SCRIPTS= $(NTPSWEEP_NI)
+EXTRA_SCRIPTS= ntpsweep
+
+man1_MANS=
+man8_MANS=
+if INSTALL_NTPSWEEP
+man_MANS= ntpsweep.$(NTPSWEEP_MS)
+else
+noinst_MANS= ntpsweep.$(NTPSWEEP_MS)
+endif
+
+EXTRA_DIST = \
+ ntpsweep.in \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+html_DATA = ntpsweep.html
+
+CLEANFILES = ntpsweep.1
+DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS)
+
+noinst_DATA = \
+ ntpsweep.1 \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+ntpsweep: $(srcdir)/ntpsweep-opts
+
+$(srcdir)/ntpsweep-opts: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) ntpsweep-opts.def
+
+### Nroff
+
+$(srcdir)/ntpsweep.1ntpsweepman: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepman -Tagman-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.man.in: ntpsweep.1ntpsweepman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepman > $(srcdir)/ntpsweep.man.in+
+ mv $(srcdir)/ntpsweep.man.in+ $(srcdir)/ntpsweep.man.in
+
+### Mdoc
+
+$(srcdir)/ntpsweep.1ntpsweepmdoc: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepmdoc -Tagmdoc-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.mdoc.in: ntpsweep.1ntpsweepmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepmdoc > $(srcdir)/ntpsweep.mdoc.in+
+ mv $(srcdir)/ntpsweep.mdoc.in+ $(srcdir)/ntpsweep.mdoc.in
+
+### Manpage
+
+ntpsweep.1: ntpsweep.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpsweep.1+:$(srcdir)/ntpsweep.$(MANTAGFMT).in
+ mv ntpsweep.1+ ntpsweep.1
+
+### Texinfo
+
+$(srcdir)/invoke-ntpsweep.menu: invoke-ntpsweep.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpsweep.texi: ntpsweep-opts ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsweep-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntpsweep.html: invoke-ntpsweep.menu invoke-ntpsweep.texi ntpsweep.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpsweep.html ntpsweep.texi || true )
diff --git a/scripts/ntpsweep/Makefile.in b/scripts/ntpsweep/Makefile.in
new file mode 100644
index 0000000..f264ada
--- /dev/null
+++ b/scripts/ntpsweep/Makefile.in
@@ -0,0 +1,885 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/ntpsweep
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntpsweep.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntpsweep
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(noinst_SCRIPTS) \
+ $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+bin_SCRIPTS = $(NTPSWEEP_DB)
+sbin_SCRIPTS = $(NTPSWEEP_DS)
+libexec_SCRIPTS = $(NTPSWEEP_DL)
+noinst_SCRIPTS = $(NTPSWEEP_NI)
+EXTRA_SCRIPTS = ntpsweep
+man1_MANS =
+man8_MANS =
+@INSTALL_NTPSWEEP_TRUE@man_MANS = ntpsweep.$(NTPSWEEP_MS)
+@INSTALL_NTPSWEEP_FALSE@noinst_MANS = ntpsweep.$(NTPSWEEP_MS)
+EXTRA_DIST = \
+ ntpsweep.in \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+html_DATA = ntpsweep.html
+CLEANFILES = ntpsweep.1
+DISTCLEANFILES = config.log $(man_MANS) $(noinst_MANS)
+noinst_DATA = \
+ ntpsweep.1 \
+ ntpsweep.1ntpsweepman \
+ ntpsweep.1ntpsweepmdoc \
+ ntpsweep.man.in \
+ ntpsweep.mdoc.in \
+ ntpsweep.texi \
+ ntpsweep.html \
+ ntpsweep-opts.def \
+ ntpsweep-opts \
+ invoke-ntpsweep.texi \
+ invoke-ntpsweep.menu \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/ntpsweep/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/ntpsweep/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntpsweep: $(top_builddir)/config.status $(srcdir)/ntpsweep.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS
+
+
+ntpsweep: $(srcdir)/ntpsweep-opts
+
+$(srcdir)/ntpsweep-opts: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) ntpsweep-opts.def
+
+### Nroff
+
+$(srcdir)/ntpsweep.1ntpsweepman: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepman -Tagman-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.man.in: ntpsweep.1ntpsweepman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepman > $(srcdir)/ntpsweep.man.in+
+ mv $(srcdir)/ntpsweep.man.in+ $(srcdir)/ntpsweep.man.in
+
+### Mdoc
+
+$(srcdir)/ntpsweep.1ntpsweepmdoc: ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntpsweepmdoc -Tagmdoc-cmd.tpl ntpsweep-opts.def
+
+$(srcdir)/ntpsweep.mdoc.in: ntpsweep.1ntpsweepmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepmdoc > $(srcdir)/ntpsweep.mdoc.in+
+ mv $(srcdir)/ntpsweep.mdoc.in+ $(srcdir)/ntpsweep.mdoc.in
+
+### Manpage
+
+ntpsweep.1: ntpsweep.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntpsweep.1+:$(srcdir)/ntpsweep.$(MANTAGFMT).in
+ mv ntpsweep.1+ ntpsweep.1
+
+### Texinfo
+
+$(srcdir)/invoke-ntpsweep.menu: invoke-ntpsweep.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntpsweep.texi: ntpsweep-opts ntpsweep-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsweep-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntpsweep.html: invoke-ntpsweep.menu invoke-ntpsweep.texi ntpsweep.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpsweep.html ntpsweep.texi || true )
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/ntpsweep/invoke-ntpsweep.menu b/scripts/ntpsweep/invoke-ntpsweep.menu
new file mode 100644
index 0000000..6a1faea
--- /dev/null
+++ b/scripts/ntpsweep/invoke-ntpsweep.menu
@@ -0,0 +1 @@
+* ntpsweep Invocation:: Invoking ntpsweep
diff --git a/scripts/ntpsweep/invoke-ntpsweep.texi b/scripts/ntpsweep/invoke-ntpsweep.texi
new file mode 100644
index 0000000..f5dbf32
--- /dev/null
+++ b/scripts/ntpsweep/invoke-ntpsweep.texi
@@ -0,0 +1,118 @@
+@node ntpsweep Invocation
+@section Invoking ntpsweep
+@pindex ntpsweep
+@cindex Print various informations about given ntp servers
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntpsweep.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:25 AM by AutoGen 5.18.5pre4
+# From the definitions ntpsweep-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+@code{ntpsweep}
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpsweep} program.
+
+@menu
+* ntpsweep usage:: ntpsweep help/usage (@option{--help})
+* ntpsweep host-list:: host-list option (-l)
+* ntpsweep peers:: peers option (-p)
+* ntpsweep maxlevel:: maxlevel option (-m)
+* ntpsweep strip:: strip option (-s)
+* ntpsweep host:: host option (-h)
+* ntpsweep exit status:: exit status
+@end menu
+
+@node ntpsweep usage
+@subsection ntpsweep help/usage (@option{--help})
+@cindex ntpsweep help
+
+This is the automatically generated usage text for ntpsweep.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.7p482
+USAGE: ntpsweep [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostfile]
+
+ -l, --host-list=str Host to execute actions on
+ - may appear multiple times
+ -p, --peers Recursively list all peers a host synchronizes to
+ -m, --maxlevel=num Traverse peers up to this level (4 is a reasonable number)
+ -s, --strip=str Strip this string from hostnames
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node ntpsweep host-list
+@subsection host-list option (-l)
+@cindex ntpsweep-host-list
+
+This is the ``host to execute actions on'' option.
+This option takes a string argument.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+@node ntpsweep peers
+@subsection peers option (-p)
+@cindex ntpsweep-peers
+
+This is the ``recursively list all peers a host synchronizes to'' option.
+This option has no @samp{doc} documentation.
+@node ntpsweep maxlevel
+@subsection maxlevel option (-m)
+@cindex ntpsweep-maxlevel
+
+This is the ``traverse peers up to this level (4 is a reasonable number)'' option.
+This option takes a number argument.
+This option has no @samp{doc} documentation.
+@node ntpsweep strip
+@subsection strip option (-s)
+@cindex ntpsweep-strip
+
+This is the ``strip this string from hostnames'' option.
+This option takes a string argument.
+This option has no @samp{doc} documentation.
+@node ntpsweep host
+@subsection host option (-h)
+@cindex ntpsweep-host
+
+This is the ``specify a single host'' option.
+This option takes a string argument.
+This option has no @samp{doc} documentation.
+
+@strong{NOTE}@strong{: THIS OPTION IS DEPRECATED}
+@node ntpsweep exit status
+@subsection ntpsweep exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/ntpsweep/ntpsweep-opts b/scripts/ntpsweep/ntpsweep-opts
new file mode 100644
index 0000000..d29f194
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep-opts
@@ -0,0 +1,67 @@
+# EDIT THIS FILE WITH CAUTION (ntpsweep-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:23 AM by AutoGen 5.18.5pre4
+# From the definitions ntpsweep-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'host-list' => [],
+ 'peers' => '',
+ 'maxlevel' => '',
+ 'strip' => '',
+ 'host' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '[hostfile]';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'host-list|l=s', 'peers|p', 'maxlevel|m=i',
+ 'strip|s=s', 'host|h=s',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.7p482
+USAGE: ntpsweep [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostfile]
+
+ -l, --host-list=str Host to execute actions on
+ - may appear multiple times
+ -p, --peers Recursively list all peers a host synchronizes to
+ -m, --maxlevel=num Traverse peers up to this level (4 is a reasonable number)
+ -s, --strip=str Strip this string from hostnames
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/ntpsweep/ntpsweep-opts.def b/scripts/ntpsweep/ntpsweep-opts.def
new file mode 100644
index 0000000..23dc020
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep-opts.def
@@ -0,0 +1,66 @@
+/* -*- Mode: Text -*- */
+autogen definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = 'ntpsweep';
+prog-title = 'Print various informations about given ntp servers';
+package = ntp;
+#include version.def
+
+argument = '[hostfile]';
+long-opts;
+gnu-usage;
+
+flag = {
+ name = host-list;
+ value = l;
+ arg-type = string;
+ max = NOLIMIT;
+ stack-arg;
+ descrip = 'Host to execute actions on';
+ doc = <<- _EndOfDoc_
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peers;
+ value = p;
+ descrip = 'Recursively list all peers a host synchronizes to';
+};
+
+flag = {
+ name = maxlevel;
+ value = m;
+ arg-type = number;
+ descrip = 'Traverse peers up to this level (4 is a reasonable number)';
+};
+
+flag = {
+ name = strip;
+ value = s;
+ arg-type = string;
+ descrip = 'Strip this string from hostnames';
+};
+
+/* Deprecated options */
+flag = {
+ name = host;
+ value = h;
+ arg-type = string;
+ descrip = 'Specify a single host';
+ deprecated;
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+.Nm
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+ _END_PROG_MDOC_DESCRIP;
+};
diff --git a/scripts/ntpsweep/ntpsweep.1ntpsweepman b/scripts/ntpsweep/ntpsweep.1ntpsweepman
new file mode 100644
index 0000000..5695469
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.1ntpsweepman
@@ -0,0 +1,97 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpsweep 1ntpsweepman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_ja4FE/ag-mkaaFE)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:27 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpsweep\fP
+\- Print various informations about given ntp servers
+.SH SYNOPSIS
+\f\*[B-Font]ntpsweep\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[hostfile]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpsweep\fP
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\-list\f[]=\f\*[I-Font]string\f[]
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-maxlevel\f[]=\f\*[I-Font]number\f[]
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-strip\f[]=\f\*[I-Font]string\f[]
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-h\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc b/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
new file mode 100644
index 0000000..a522052
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
@@ -0,0 +1,75 @@
+.Dd December 2 2014
+.Dt NTPSWEEP 1ntpsweepmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:30 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpsweep
+.Nd Print various informations about given ntp servers
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[hostfile]
+.Pp
+.Sh DESCRIPTION
+.Nm
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl l Ar string , Fl \-host\-list Ns = Ns Ar string
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.It Fl p , Fl \-peers
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.It Fl m Ar number , Fl \-maxlevel Ns = Ns Ar number
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.It Fl s Ar string , Fl \-strip Ns = Ns Ar string
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.It Fl h Ar string , Fl \-host Ns = Ns Ar string
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.html b/scripts/ntpsweep/ntpsweep.html
new file mode 100644
index 0000000..291f434
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.html
@@ -0,0 +1,201 @@
+<html lang="en">
+<head>
+<title>ntpsweep User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="ntpsweep User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">ntpsweep User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-Description">ntpsweep Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+ <p>This document describes the use of the NTP Project's <code>ntpsweep</code> program.
+
+ <p>This document applies to version 4.2.7p482 of <code>ntpsweep</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpsweep-Description">ntpsweep Description</a>: Description
+<li><a accesskey="2" href="#ntpsweep-Invocation">ntpsweep Invocation</a>: Invoking ntpsweep
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpsweep-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">0.1 Invoking ntpsweep</h3>
+
+<p><a name="index-ntpsweep-1"></a><a name="index-Print-various-informations-about-given-ntp-servers-2"></a>
+<code>ntpsweep</code>
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpsweep</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntpsweep-usage">ntpsweep usage</a>: ntpsweep help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntpsweep-host_002dlist">ntpsweep host-list</a>: host-list option (-l)
+<li><a accesskey="3" href="#ntpsweep-peers">ntpsweep peers</a>: peers option (-p)
+<li><a accesskey="4" href="#ntpsweep-maxlevel">ntpsweep maxlevel</a>: maxlevel option (-m)
+<li><a accesskey="5" href="#ntpsweep-strip">ntpsweep strip</a>: strip option (-s)
+<li><a accesskey="6" href="#ntpsweep-host">ntpsweep host</a>: host option (-h)
+<li><a accesskey="7" href="#ntpsweep-exit-status">ntpsweep exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntpsweep-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-host_002dlist">ntpsweep host-list</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.1 ntpsweep help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntpsweep-help-3"></a>
+This is the automatically generated usage text for ntpsweep.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.7p482
+USAGE: ntpsweep [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [hostfile]
+
+ -l, --host-list=str Host to execute actions on
+ - may appear multiple times
+ -p, --peers Recursively list all peers a host synchronizes to
+ -m, --maxlevel=num Traverse peers up to this level (4 is a reasonable number)
+ -s, --strip=str Strip this string from hostnames
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntpsweep-host_002dlist"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-peers">ntpsweep peers</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-usage">ntpsweep usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.2 host-list option (-l)</h4>
+
+<p><a name="index-ntpsweep_002dhost_002dlist-4"></a>
+This is the &ldquo;host to execute actions on&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>Use this option to specify the host on which this script operates.
+ May appear multiple times.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-peers"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-maxlevel">ntpsweep maxlevel</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-host_002dlist">ntpsweep host-list</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.3 peers option (-p)</h4>
+
+<p><a name="index-ntpsweep_002dpeers-5"></a>
+This is the &ldquo;recursively list all peers a host synchronizes to&rdquo; option.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-maxlevel"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-strip">ntpsweep strip</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-peers">ntpsweep peers</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.4 maxlevel option (-m)</h4>
+
+<p><a name="index-ntpsweep_002dmaxlevel-6"></a>
+This is the &ldquo;traverse peers up to this level (4 is a reasonable number)&rdquo; option.
+This option takes a number argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-strip"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-host">ntpsweep host</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-maxlevel">ntpsweep maxlevel</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.5 strip option (-s)</h4>
+
+<p><a name="index-ntpsweep_002dstrip-7"></a>
+This is the &ldquo;strip this string from hostnames&rdquo; option.
+This option takes a string argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntpsweep-host"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpsweep-exit-status">ntpsweep exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-strip">ntpsweep strip</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.6 host option (-h)</h4>
+
+<p><a name="index-ntpsweep_002dhost-8"></a>
+This is the &ldquo;specify a single host&rdquo; option.
+This option takes a string argument.
+This option has no <span class="samp">doc</span> documentation.
+
+ <p><strong>NOTE</strong><strong>: THIS OPTION IS DEPRECATED</strong>
+<div class="node">
+<p><hr>
+<a name="ntpsweep-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpsweep-host">ntpsweep host</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntpsweep-Invocation">ntpsweep Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">0.1.7 ntpsweep exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/ntpsweep/ntpsweep.in b/scripts/ntpsweep/ntpsweep.in
new file mode 100644
index 0000000..fed35d1
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.in
@@ -0,0 +1,204 @@
+#! @PATH_PERL@ -w
+#
+# $Id$
+#
+# DISCLAIMER
+#
+# Copyright (C) 1999,2000 Hans Lambermont and Origin B.V.
+#
+# Permission to use, copy, modify and distribute this software and its
+# documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright notice appears in all copies and
+# that both the copyright notice and this permission notice appear in
+# supporting documentation. This software is supported as is and without
+# any express or implied warranties, including, without limitation, the
+# implied warranties of merchantability and fitness for a particular
+# purpose. The name Origin B.V. must not be used to endorse or promote
+# products derived from this software without prior written permission.
+#
+# Hans Lambermont <ntpsweep@lambermont.dyndns.org>
+
+package ntpsweep;
+use 5.006_000;
+use strict;
+use lib "@PERLLIBDIR@";
+use NTP::Util qw(do_dns ntp_read_vars ntp_peers ntp_sntp_line);
+
+(my $program = $0) =~ s%.*/(.+?)(.pl)?$%$1%;
+my ($showpeers, $maxlevel, $strip);
+my (%known_host_info, %known_host_peers);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts) ||
+ (((@_ != 1) && !$opts->{host} && !@{$opts->{'host-list'}}))) {
+ usage(1);
+ };
+
+ # no STDOUT buffering
+ $| = 1;
+ ($showpeers, $maxlevel, $strip) =
+ ($opts->{peers}, $opts->{maxlevel}, $opts->{strip});
+
+ my $hostsfile = shift;
+
+ # Main program
+
+ my @hosts;
+
+ if ($opts->{host}) {
+ push @hosts, $opts->{host};
+ }
+ else {
+ @hosts = read_hosts($hostsfile) if $hostsfile;
+ push @hosts, @{$opts->{'host-list'}};
+ }
+
+ # Print header
+ print <<EOF;
+Host st offset(s) version system processor
+--------------------------------+--+---------+-----------+------------+---------
+EOF
+
+ %known_host_info = ();
+ %known_host_peers = ();
+ scan_hosts(@hosts);
+
+ return 0;
+}
+
+sub scan_hosts {
+ my (@hosts) = @_;
+
+ my $host;
+ for $host (@hosts) {
+ scan_host($host, 0, $host => 1);
+ }
+}
+
+sub read_hosts {
+ my ($hostsfile) = @_;
+ my @hosts;
+
+ open my $hosts, $hostsfile
+ or die "$program: FATAL: unable to read $hostsfile: $!\n";
+
+ while (<$hosts>) {
+ next if /^\s*(#|$)/; # comment/empty
+ chomp;
+ push @hosts, $_;
+ }
+
+ close $hosts;
+ return @hosts;
+}
+
+sub scan_host {
+ my ($host, $level, %trace) = @_;
+ my $stratum = 0;
+ my $offset = 0;
+ my $daemonversion = "";
+ my $system = "";
+ my $processor = "";
+ my @peers;
+ my $known_host = 0;
+
+ if (exists $known_host_info{$host}) {
+ $known_host = 1;
+ }
+ else {
+ ($offset, $stratum) = ntp_sntp_line($host);
+
+ # got answers ? If so, go on.
+ if ($stratum) {
+ my $vars = ntp_read_vars(0, [qw(processor system daemon_version)], $host) || {};
+ $daemonversion = $vars->{daemon_version};
+ $system = $vars->{system};
+ $processor = $vars->{processor};
+
+ # Shorten daemon_version string.
+ $daemonversion =~ s/(;|Mon|Tue|Wed|Thu|Fri|Sat|Sun).*$//;
+ $daemonversion =~ s/version=//;
+ $daemonversion =~ s/(x|)ntpd //;
+ $daemonversion =~ s/(\(|\))//g;
+ $daemonversion =~ s/beta/b/;
+ $daemonversion =~ s/multicast/mc/;
+
+ # Shorten system string
+ $system =~ s/UNIX\///;
+ $system =~ s/RELEASE/r/;
+ $system =~ s/CURRENT/c/;
+
+ # Shorten processor string
+ $processor =~ s/unknown//;
+ }
+
+ # got answers ? If so, go on.
+ if ($daemonversion) {
+ if ($showpeers) {
+ my @peers_tmp = ntp_peers($host);
+ for (@peers_tmp) {
+ $_->{remote} =~ s/^(?: |x|\.|-|\+|#|\*|o)([^ ]+)/$1/;
+ push @peers, $_->{remote};
+ }
+ }
+ }
+
+ # Add scanned host to known_hosts array
+ #push @known_hosts, $host;
+ if ($stratum) {
+ $known_host_info{$host} = sprintf "%2d %9.3f %-11s %-12s %s",
+ $stratum, $offset, (substr $daemonversion, 0, 11),
+ (substr $system, 0, 12), (substr $processor, 0, 9);
+ }
+ else {
+ # Stratum level 0 is consider invalid
+ $known_host_info{$host} = " ?";
+ }
+ $known_host_peers{$host} = [@peers];
+ }
+
+ if ($stratum || $known_host) { # Valid or known host
+ my $printhost = ' ' x $level . (do_dns($host) || $host);
+ # Shorten host string
+ if ($strip) {
+ $printhost =~ s/$strip//;
+ }
+ # append number of peers in brackets if requested and valid
+ if ($showpeers && ($known_host_info{$host} ne " ?")) {
+ $printhost .= " (" . @{$known_host_peers{$host}} . ")";
+ }
+ # Finally print complete host line
+ printf "%-32s %s\n",
+ (substr $printhost, 0, 32), $known_host_info{$host};
+ if ($showpeers && ($maxlevel ? $level < $maxlevel : 1)) {
+ $trace{$host} = 1;
+ # Loop through peers
+ foreach my $peer (@{$known_host_peers{$host}}) {
+ if (exists $trace{$peer}) {
+ # we've detected a loop !
+ $printhost = ' ' x ($level + 1) . "= " . $peer;
+ # Shorten host string
+ $printhost =~ s/$strip// if $strip;
+ printf "%-32s\n", substr $printhost, 0, 32;
+ } else {
+ if ((substr $peer, 0, 3) ne "127") {
+ scan_host($peer, $level + 1, %trace);
+ }
+ }
+ }
+ }
+ }
+ else { # We did not get answers from this host
+ my $printhost = ' ' x $level . (do_dns($host) || $host);
+ $printhost =~ s/$strip// if $strip;
+ printf "%-32s ?\n", substr $printhost, 0, 32;
+ }
+}
+
+@ntpsweep_opts@
+
+1;
+__END__
diff --git a/scripts/ntpsweep/ntpsweep.man.in b/scripts/ntpsweep/ntpsweep.man.in
new file mode 100644
index 0000000..5695469
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.man.in
@@ -0,0 +1,97 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntpsweep 1ntpsweepman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_ja4FE/ag-mkaaFE)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:27 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntpsweep\fP
+\- Print various informations about given ntp servers
+.SH SYNOPSIS
+\f\*[B-Font]ntpsweep\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[hostfile]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]ntpsweep\fP
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\-list\f[]=\f\*[I-Font]string\f[]
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.TP
+.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[]
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-maxlevel\f[]=\f\*[I-Font]number\f[]
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-strip\f[]=\f\*[I-Font]string\f[]
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-h\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.mdoc.in b/scripts/ntpsweep/ntpsweep.mdoc.in
new file mode 100644
index 0000000..a522052
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.mdoc.in
@@ -0,0 +1,75 @@
+.Dd December 2 2014
+.Dt NTPSWEEP 1ntpsweepmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:30 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntpsweep-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntpsweep
+.Nd Print various informations about given ntp servers
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[hostfile]
+.Pp
+.Sh DESCRIPTION
+.Nm
+prints per host the NTP stratum level, the clock offset in seconds, the daemon
+version, the operating system and the processor. Optionally recursing through
+all peers.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl l Ar string , Fl \-host\-list Ns = Ns Ar string
+Host to execute actions on.
+This option may appear an unlimited number of times.
+.sp
+ Use this option to specify the host on which this script operates.
+ May appear multiple times.
+.It Fl p , Fl \-peers
+Recursively list all peers a host synchronizes to.
+.sp
+This option has not been fully documented.
+.It Fl m Ar number , Fl \-maxlevel Ns = Ns Ar number
+Traverse peers up to this level (4 is a reasonable number).
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.It Fl s Ar string , Fl \-strip Ns = Ns Ar string
+Strip this string from hostnames.
+.sp
+This option has not been fully documented.
+.It Fl h Ar string , Fl \-host Ns = Ns Ar string
+Specify a single host.
+.sp
+This option has not been fully documented.
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntpsweep\fP
+option definitions.
diff --git a/scripts/ntpsweep/ntpsweep.texi b/scripts/ntpsweep/ntpsweep.texi
new file mode 100644
index 0000000..e408065
--- /dev/null
+++ b/scripts/ntpsweep/ntpsweep.texi
@@ -0,0 +1,43 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntpsweep.info
+@settitle ntpsweep User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{ntpsweep},
+a program from
+the NTP Project,
+that is used to wait until @code{ntpd} has been able to
+synchronize and stabilize the time on the current host.
+@end ifinfo
+
+@direntry
+* ntpsweep: (ntpsweep). Wait for ntpd to synchronize and stabilize the system clock.
+@end direntry
+
+@titlepage
+@title ntpsweep User's Manual
+@subtitle ntpsweep, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntpsweep Description, (dir), (dir)
+
+This document describes the use of the NTP Project's @code{ntpsweep} program.
+
+This document applies to version @value{VERSION} of @code{ntpsweep}.
+
+@shortcontents
+
+@menu
+* ntpsweep Description:: Description
+* ntpsweep Invocation:: Invoking ntpsweep
+@end menu
+
+@include invoke-ntpsweep.texi
diff --git a/scripts/ntptrace/Makefile.am b/scripts/ntptrace/Makefile.am
new file mode 100644
index 0000000..19300e8
--- /dev/null
+++ b/scripts/ntptrace/Makefile.am
@@ -0,0 +1,95 @@
+NULL=
+man1_MANS=
+man8_MANS=
+man_MANS= ntptrace.$(NTPTRACE_MS)
+
+bin_SCRIPTS = $(NTPTRACE_DB)
+libexec_SCRIPTS = $(NTPTRACE_DL)
+sbin_SCRIPTS = $(NTPTRACE_DS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntptrace
+
+EXTRA_DIST = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+DISTCLEANFILES = config.log $(man_MANS)
+
+html_DATA = $(srcdir)/ntptrace.html
+
+noinst_DATA = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+ntptrace: $(srcdir)/ntptrace-opts
+
+$(srcdir)/ntptrace-opts: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) ntptrace-opts.def
+
+### Nroff
+
+$(srcdir)/ntptrace.1ntptraceman: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptraceman -Tagman-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.man.in: $(srcdir)/ntptrace.1ntptraceman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptraceman > $(srcdir)/ntptrace.man.in+
+ mv $(srcdir)/ntptrace.man.in+ $(srcdir)/ntptrace.man.in
+
+### Mdoc
+
+$(srcdir)/ntptrace.1ntptracemdoc: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptracemdoc -Tagmdoc-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.mdoc.in: $(srcdir)/ntptrace.1ntptracemdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptracemdoc > $(srcdir)/ntptrace.mdoc.in+
+ mv $(srcdir)/ntptrace.mdoc.in+ $(srcdir)/ntptrace.mdoc.in
+
+### Manpage (local)
+
+ntptrace.$(NTPTRACE_MS): $(srcdir)/ntptrace.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntptrace.$(NTPTRACE_MS)+:$(srcdir)/ntptrace.$(MANTAGFMT).in
+ mv ntptrace.$(NTPTRACE_MS)+ ntptrace.$(NTPTRACE_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntptrace.menu: $(srcdir)/invoke-ntptrace.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntptrace.texi: ntptrace-opts $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntptrace-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntptrace.html: $(srcdir)/invoke-ntptrace.menu $(srcdir)/invoke-ntptrace.texi $(srcdir)/ntptrace.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntptrace.html ntptrace.texi || true )
diff --git a/scripts/ntptrace/Makefile.in b/scripts/ntptrace/Makefile.in
new file mode 100644
index 0000000..825a390
--- /dev/null
+++ b/scripts/ntptrace/Makefile.in
@@ -0,0 +1,878 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts/ntptrace
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/ntptrace.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = ntptrace
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+SCRIPTS = $(bin_SCRIPTS) $(libexec_SCRIPTS) $(sbin_SCRIPTS)
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+man1_MANS =
+man8_MANS =
+man_MANS = ntptrace.$(NTPTRACE_MS)
+bin_SCRIPTS = $(NTPTRACE_DB)
+libexec_SCRIPTS = $(NTPTRACE_DL)
+sbin_SCRIPTS = $(NTPTRACE_DS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" PERL5LIB="$(abs_top_srcdir)/scripts/lib" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../../sntp/include -L ../../sntp/ag-tpl \
+ --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+EXTRA_SCRIPTS = ntptrace
+EXTRA_DIST = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+DISTCLEANFILES = config.log $(man_MANS)
+html_DATA = $(srcdir)/ntptrace.html
+noinst_DATA = \
+ ntptrace.1ntptraceman \
+ ntptrace.1ntptracemdoc \
+ ntptrace.mdoc.in \
+ ntptrace.man.in \
+ ntptrace.texi \
+ ntptrace.html \
+ ntptrace-opts.def \
+ ntptrace-opts \
+ invoke-ntptrace.texi \
+ invoke-ntptrace.menu \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/ntptrace/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/ntptrace/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+ntptrace: $(top_builddir)/config.status $(srcdir)/ntptrace.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS install-libexecSCRIPTS \
+ install-sbinSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-htmlDATA \
+ uninstall-libexecSCRIPTS uninstall-man uninstall-sbinSCRIPTS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecSCRIPTS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinSCRIPTS install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-htmlDATA uninstall-libexecSCRIPTS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinSCRIPTS
+
+
+ntptrace: $(srcdir)/ntptrace-opts
+
+$(srcdir)/ntptrace-opts: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) ntptrace-opts.def
+
+### Nroff
+
+$(srcdir)/ntptrace.1ntptraceman: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptraceman -Tagman-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.man.in: $(srcdir)/ntptrace.1ntptraceman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptraceman > $(srcdir)/ntptrace.man.in+
+ mv $(srcdir)/ntptrace.man.in+ $(srcdir)/ntptrace.man.in
+
+### Mdoc
+
+$(srcdir)/ntptrace.1ntptracemdoc: $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntptracemdoc -Tagmdoc-cmd.tpl ntptrace-opts.def
+
+$(srcdir)/ntptrace.mdoc.in: $(srcdir)/ntptrace.1ntptracemdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptracemdoc > $(srcdir)/ntptrace.mdoc.in+
+ mv $(srcdir)/ntptrace.mdoc.in+ $(srcdir)/ntptrace.mdoc.in
+
+### Manpage (local)
+
+ntptrace.$(NTPTRACE_MS): $(srcdir)/ntptrace.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntptrace.$(NTPTRACE_MS)+:$(srcdir)/ntptrace.$(MANTAGFMT).in
+ mv ntptrace.$(NTPTRACE_MS)+ ntptrace.$(NTPTRACE_MS)
+
+### Texinfo
+
+$(srcdir)/invoke-ntptrace.menu: $(srcdir)/invoke-ntptrace.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntptrace.texi: ntptrace-opts $(srcdir)/ntptrace-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntptrace-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+### HTML
+
+$(srcdir)/ntptrace.html: $(srcdir)/invoke-ntptrace.menu $(srcdir)/invoke-ntptrace.texi $(srcdir)/ntptrace.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntptrace.html ntptrace.texi || true )
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/ntptrace/invoke-ntptrace.menu b/scripts/ntptrace/invoke-ntptrace.menu
new file mode 100644
index 0000000..bea3b8b
--- /dev/null
+++ b/scripts/ntptrace/invoke-ntptrace.menu
@@ -0,0 +1 @@
+* ntptrace Invocation:: Invoking ntptrace
diff --git a/scripts/ntptrace/invoke-ntptrace.texi b/scripts/ntptrace/invoke-ntptrace.texi
new file mode 100644
index 0000000..3f7a53b
--- /dev/null
+++ b/scripts/ntptrace/invoke-ntptrace.texi
@@ -0,0 +1,109 @@
+@node ntptrace Invocation
+@section Invoking ntptrace
+@pindex ntptrace
+@cindex Trace peers of an NTP server
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntptrace.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:37 AM by AutoGen 5.18.5pre4
+# From the definitions ntptrace-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+@code{ntptrace} is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+
+@example
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+@end example
+
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+@code{ntptrace}; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC-1305.
+
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntptrace} program.
+
+@menu
+* ntptrace usage:: ntptrace help/usage (@option{--help})
+* ntptrace numeric:: numeric option (-n)
+* ntptrace max-hosts:: max-hosts option (-m)
+* ntptrace host:: host option (-r)
+* ntptrace exit status:: exit status
+@end menu
+
+@node ntptrace usage
+@subsection ntptrace help/usage (@option{--help})
+@cindex ntptrace help
+
+This is the automatically generated usage text for ntptrace.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntptrace - Trace peers of an NTP server - Ver. 4.2.7p482
+USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
+
+ -n, --numeric Print IP addresses instead of hostnames
+ -m, --max-hosts=num Maximum number of peers to trace
+ -r, --host=str Single remote host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+@end example
+@exampleindent 4
+
+@node ntptrace numeric
+@subsection numeric option (-n)
+@cindex ntptrace-numeric
+
+This is the ``print ip addresses instead of hostnames'' option.
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+@node ntptrace max-hosts
+@subsection max-hosts option (-m)
+@cindex ntptrace-max-hosts
+
+This is the ``maximum number of peers to trace'' option.
+This option takes a number argument.
+This option has no @samp{doc} documentation.
+@node ntptrace host
+@subsection host option (-r)
+@cindex ntptrace-host
+
+This is the ``single remote host'' option.
+This option takes a string argument.
+This option has no @samp{doc} documentation.
+@node ntptrace exit status
+@subsection ntptrace exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@end table
diff --git a/scripts/ntptrace/ntptrace-opts b/scripts/ntptrace/ntptrace-opts
new file mode 100644
index 0000000..36c8e1e
--- /dev/null
+++ b/scripts/ntptrace/ntptrace-opts
@@ -0,0 +1,62 @@
+# EDIT THIS FILE WITH CAUTION (ntptrace-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:32 AM by AutoGen 5.18.5pre4
+# From the definitions ntptrace-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'numeric' => '',
+ 'max-hosts' => '99',
+ 'host' => '127.0.0.1',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '[host]';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'numeric|n', 'max-hosts|m=i', 'host|r=s',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+ntptrace - Trace peers of an NTP server - Ver. 4.2.7p482
+USAGE: ntptrace [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [host]
+
+ -n, --numeric Print IP addresses instead of hostnames
+ -m, --max-hosts=num Maximum number of peers to trace
+ -r, --host=str Single remote host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/ntptrace/ntptrace-opts.def b/scripts/ntptrace/ntptrace-opts.def
new file mode 100644
index 0000000..81ddda3
--- /dev/null
+++ b/scripts/ntptrace/ntptrace-opts.def
@@ -0,0 +1,69 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+//#include copyright.def
+#include autogen-version.def
+
+prog-name = 'ntptrace';
+prog-title = 'Trace peers of an NTP server';
+package = ntp;
+#include version.def
+argument = '[host]';
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = numeric;
+ value = n;
+ descrip = 'Print IP addresses instead of hostnames';
+ doc = <<- _EndOfDoc_
+ Output hosts as dotted-quad numeric format rather than converting to
+ the canonical host names.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = max-hosts;
+ value = m;
+ arg-type = number;
+ arg-default = 99;
+ descrip = 'Maximum number of peers to trace';
+};
+
+flag = {
+ name = host;
+ value = r;
+ arg-type = string;
+ arg-default = '127.0.0.1';
+ descrip = 'Single remote host';
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'texi';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+@code{ntptrace} is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+
+@example
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+@end example
+
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+@code{ntptrace}; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC-1305.
+ _END_PROG_MDOC_DESCRIP;
+};
diff --git a/scripts/ntptrace/ntptrace.1ntptraceman b/scripts/ntptrace/ntptrace.1ntptraceman
new file mode 100644
index 0000000..c5fc935
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.1ntptraceman
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntptrace 1ntptraceman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-S1aqYF/ag-51ayXF)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:34 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntptrace\fP
+\- Trace peers of an NTP server
+.SH SYNOPSIS
+\f\*[B-Font]ntptrace\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[host]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.br
+.in +4
+.nf
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.in -4
+.fi
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-max\-hosts\f[]=\f\*[I-Font]number\f[]
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Single remote host.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.1ntptracemdoc b/scripts/ntptrace/ntptrace.1ntptracemdoc
new file mode 100644
index 0000000..f67e471
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.1ntptracemdoc
@@ -0,0 +1,91 @@
+.Dd December 2 2014
+.Dt NTPTRACE 1ntptracemdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:39 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntptrace
+.Nd Trace peers of an NTP server
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[host]
+.Pp
+.Sh DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.Bd -literal -offset indent
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.Ed
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n , Fl \-numeric
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted\-quad numeric format rather than converting to
+the canonical host names.
+.It Fl m Ar number , Fl \-max\-hosts Ns = Ns Ar number
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.It Fl r Ar string , Fl \-host Ns = Ns Ar string
+Single remote host.
+The default
+.Ar string
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.html b/scripts/ntptrace/ntptrace.html
new file mode 100644
index 0000000..8d45462
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.html
@@ -0,0 +1,180 @@
+<html lang="en">
+<head>
+<title>Ntptrace User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Ntptrace User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Ntptrace User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-Description">ntptrace Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<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.7p482 of <code>ntptrace</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Simple Network Time Protocol User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntptrace-Description">ntptrace Description</a>: Description
+<li><a accesskey="2" href="#ntptrace-Invocation">ntptrace Invocation</a>: Invoking ntptrace
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntptrace-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-Description">ntptrace Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking ntptrace</h3>
+
+<p><a name="index-ntptrace-1"></a><a name="index-Trace-peers-of-an-NTP-server-2"></a>
+<code>ntptrace</code> is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+
+ <p>If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+
+<pre class="example"> % ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+ server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+ stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+</pre>
+ <p>On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+<code>ntptrace</code>; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC-1305.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntptrace</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntptrace-usage">ntptrace usage</a>: ntptrace help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntptrace-numeric">ntptrace numeric</a>: numeric option (-n)
+<li><a accesskey="3" href="#ntptrace-max_002dhosts">ntptrace max-hosts</a>: max-hosts option (-m)
+<li><a accesskey="4" href="#ntptrace-host">ntptrace host</a>: host option (-r)
+<li><a accesskey="5" href="#ntptrace-exit-status">ntptrace exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntptrace-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-numeric">ntptrace numeric</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntptrace help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntptrace-help-3"></a>
+This is the automatically generated usage text for ntptrace.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.7p482
+USAGE: ntptrace [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [host]
+
+ -n, --numeric Print IP addresses instead of hostnames
+ -m, --max-hosts=num Maximum number of peers to trace
+ -r, --host=str Single remote host
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntptrace-numeric"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-max_002dhosts">ntptrace max-hosts</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-usage">ntptrace usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">numeric option (-n)</h4>
+
+<p><a name="index-ntptrace_002dnumeric-4"></a>
+This is the &ldquo;print ip addresses instead of hostnames&rdquo; option.
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+<div class="node">
+<p><hr>
+<a name="ntptrace-max_002dhosts"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-host">ntptrace host</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-numeric">ntptrace numeric</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">max-hosts option (-m)</h4>
+
+<p><a name="index-ntptrace_002dmax_002dhosts-5"></a>
+This is the &ldquo;maximum number of peers to trace&rdquo; option.
+This option takes a number argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntptrace-host"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntptrace-exit-status">ntptrace exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-max_002dhosts">ntptrace max-hosts</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">host option (-r)</h4>
+
+<p><a name="index-ntptrace_002dhost-6"></a>
+This is the &ldquo;single remote host&rdquo; option.
+This option takes a string argument.
+This option has no <span class="samp">doc</span> documentation.
+<div class="node">
+<p><hr>
+<a name="ntptrace-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntptrace-host">ntptrace host</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntptrace-Invocation">ntptrace Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntptrace exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/ntptrace/ntptrace.in b/scripts/ntptrace/ntptrace.in
new file mode 100755
index 0000000..7cc5ce7
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.in
@@ -0,0 +1,80 @@
+#! @PATH_PERL@ -w
+# John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org
+
+package ntptrace;
+use 5.006_000;
+use strict;
+use lib "@PERLLIBDIR@";
+use NTP::Util qw(ntp_read_vars do_dns);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ };
+
+ my $dodns = $opts->{numeric} ? 0 : 1;
+ my $max_hosts = $opts->{'max-hosts'};
+ my $host = shift || $opts->{host};
+ my $nb_host = 0;
+
+ for (;;) {
+ $nb_host++;
+
+ my %info = get_info($host);
+ last if not %info;
+
+ my $dhost = $host;
+ if ($dodns) {
+ my $name = do_dns($host);
+ $dhost = $name if defined $name;
+ }
+
+ printf "%s: stratum %d, offset %f, synch distance %f",
+ $dhost, $info{stratum}, $info{offset}, $info{syncdistance};
+ printf ", refid '%s'", $info{refid} if $info{stratum} == 1;
+ print "\n";
+
+ last if $info{stratum} == 0 || $info{stratum} == 1 ||
+ $info{stratum} == 16;
+ last if $info{refid} =~ /^127\.127\.\d{1,3}\.\d{1,3}$/;
+ last if $nb_host == $max_hosts;
+
+ my $next_host = get_next_host($info{peer}, $host);
+ last if $next_host eq '';
+ last if $next_host =~ /^127\.127\.\d{1,3}\.\d{1,3}$/;
+
+ $host = $next_host;
+ }
+ return 0;
+}
+
+sub get_info {
+ my ($host) = @_;
+ my ($rootdelay, $rootdisp, $info) = (0, 0);
+
+ $info = ntp_read_vars(0, [], $host);
+ return if not defined $info;
+ return if not exists $info->{stratum};
+
+ $info->{offset} /= 1000;
+ $info->{syncdistance} = ($info->{rootdisp} + ($info->{rootdelay} / 2)) / 1000;
+
+ return %$info;
+}
+
+
+sub get_next_host {
+ my ($peer, $host) = @_;
+
+ my $info = ntp_read_vars($peer, [qw(srcadr)], $host);
+ return if not defined $info;
+ return $info->{srcadr};
+}
+
+@ntptrace_opts@
+
+1;
+__END__
diff --git a/scripts/ntptrace/ntptrace.man.in b/scripts/ntptrace/ntptrace.man.in
new file mode 100644
index 0000000..b0f531f
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.man.in
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntptrace @NTPTRACE_MS@ "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-S1aqYF/ag-51ayXF)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:34 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntptrace\fP
+\- Trace peers of an NTP server
+.SH SYNOPSIS
+\f\*[B-Font]ntptrace\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[host]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.br
+.in +4
+.nf
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.in -4
+.fi
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[]
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted-quad numeric format rather than converting to
+the canonical host names.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-max\-hosts\f[]=\f\*[I-Font]number\f[]
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-host\f[]=\f\*[I-Font]string\f[]
+Single remote host.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-v\f[] [{\f\*[I-Font]v|c|n\f[] \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.mdoc.in b/scripts/ntptrace/ntptrace.mdoc.in
new file mode 100644
index 0000000..c952d6d
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.mdoc.in
@@ -0,0 +1,91 @@
+.Dd December 2 2014
+.Dt NTPTRACE @NTPTRACE_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:39 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntptrace-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntptrace
+.Nd Trace peers of an NTP server
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[host]
+.Pp
+.Sh DESCRIPTION
+\fBntptrace\fP is a perl script that uses the ntpq utility program to follow
+the chain of NTP servers from a given host back to the primary time source. For
+ntptrace to work properly, each of these servers must implement the NTP Control
+and Monitoring Protocol specified in RFC 1305 and enable NTP Mode 6 packets.
+.sp
+If given no arguments, ntptrace starts with localhost. Here is an example of
+the output from ntptrace:
+.sp
+.Bd -literal -offset indent
+% ntptrace localhost: stratum 4, offset 0.0019529, synch distance 0.144135
+server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 usndh.edu:
+stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB'
+.Ed
+.sp
+On each line, the fields are (left to right): the host name, the host stratum,
+the time offset between that host and the local host (as measured by
+\fBntptrace\fP; this is why it is not always zero for "localhost"), the host
+synchronization distance, and (only for stratum\-1 servers) the reference clock
+ID. All times are given in seconds. Note that the stratum is the server hop
+count to the primary source, while the synchronization distance is the
+estimated error relative to the primary source. These terms are precisely
+defined in RFC\-1305.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl n , Fl \-numeric
+Print IP addresses instead of hostnames.
+.sp
+Output hosts as dotted\-quad numeric format rather than converting to
+the canonical host names.
+.It Fl m Ar number , Fl \-max\-hosts Ns = Ns Ar number
+Maximum number of peers to trace.
+This option takes an integer number as its argument.
+The default
+.Ar number
+for this option is:
+.ti +4
+ 99
+.sp
+This option has not been fully documented.
+.It Fl r Ar string , Fl \-host Ns = Ns Ar string
+Single remote host.
+The default
+.Ar string
+for this option is:
+.ti +4
+ 127.0.0.1
+.sp
+This option has not been fully documented.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl v Op Brq Ar v|c|n Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBntptrace\fP
+option definitions.
diff --git a/scripts/ntptrace/ntptrace.texi b/scripts/ntptrace/ntptrace.texi
new file mode 100644
index 0000000..b1851f2
--- /dev/null
+++ b/scripts/ntptrace/ntptrace.texi
@@ -0,0 +1,40 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntptrace.info
+@settitle Ntptrace User's Manual
+@include ../../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{ntptrace},
+a program from the NTP Project
+@end ifinfo
+
+@direntry
+* ntptrace: (ntptrace). Trace the ntp server to the primary time source.
+@end direntry
+
+@titlepage
+@title ntptrace User's Manual
+@subtitle ntptrace, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, ntptrace Description, (dir), (dir)
+@top Simple Network Time Protocol User Manual
+
+This document describes the use of the NTP Project's @code{ntptrace} program.
+This document applies to version @value{VERSION} of @code{ntptrace}.
+
+@shortcontents
+
+@menu
+* ntptrace Description:: Description
+* ntptrace Invocation:: Invoking ntptrace
+@end menu
+
+@include invoke-ntptrace.texi
diff --git a/scripts/ntpver.in b/scripts/ntpver.in
new file mode 100644
index 0000000..9615e66
--- /dev/null
+++ b/scripts/ntpver.in
@@ -0,0 +1,7 @@
+#!@CONFIG_SHELL@
+# print version string of NTP daemon
+# Copyright (c) 1997 by Ulrich Windl
+# Modified 970318: Harlan Stenn: rewritten...
+# usage: ntpver hostname
+
+ntpq -c "rv 0 daemon_version" $* | @AWK@ '/daemon_version/ { print $2 }'
diff --git a/scripts/plot_summary-opts b/scripts/plot_summary-opts
new file mode 100644
index 0000000..f574baf
--- /dev/null
+++ b/scripts/plot_summary-opts
@@ -0,0 +1,73 @@
+# EDIT THIS FILE WITH CAUTION (plot_summary-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:41 AM by AutoGen 5.18.5pre4
+# From the definitions plot_summary-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'directory' => '/tmp',
+ 'identifier' => '',
+ 'offset-limit' => '0.128',
+ 'peer' => [],
+ 'plot-term' => '',
+ 'output-file' => '',
+ 'dont-wait' => '',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'directory=s', 'identifier=s', 'offset-limit=f',
+ 'peer=s', 'plot-term=s', 'output-file=s',
+ 'dont-wait',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+plot_summary - plot statistics generated by summary script - Ver. 4.2.7p482
+USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ --directory=str Where the summary files are
+ --identifier=str Origin of the data
+ --offset-limit=float Limit of absolute offset
+ --peer=str Peers to generate plots for
+ - may appear multiple times
+ --plot-term=str Gnuplot terminal
+ --output-file=str Output file
+ --dont-wait Don't wait for keystroke between plots
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/plot_summary-opts.def b/scripts/plot_summary-opts.def
new file mode 100644
index 0000000..61f028b
--- /dev/null
+++ b/scripts/plot_summary-opts.def
@@ -0,0 +1,83 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = 'plot_summary';
+prog-title = 'plot statistics generated by summary script';
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = directory;
+ arg-type = string;
+ arg-default = '/tmp';
+ descrip = 'Where the summary files are';
+ doc = <<- _EndOfDoc_
+ The directory where the @code{plot_summary} will search for the
+ *_summary files generated by @code{summary} script.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = identifier;
+ arg-type = string;
+ descrip = 'Origin of the data';
+ doc = <<- _EndOfDoc_
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+ _EndOfDoc_;
+};
+
+flag = {
+ name = offset-limit;
+ arg-type = string;
+ arg-name = float;
+ arg-default = "0.128";
+ descrip = 'Limit of absolute offset';
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peer;
+ arg-type = string;
+ stack-arg;
+ max = NOLIMIT;
+ descrip = 'Peers to generate plots for';
+ doc = <<- _EndOfDoc_
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = plot-term;
+ arg-type = string;
+ descrip = 'Gnuplot terminal';
+ doc = <<- _EndOfDoc_
+ This is string is passed directly to the @code{gnuplot set terminal}
+ command. Default is @code{x11} if @code{DISPLAY} is set and
+ @code{dumb} is it's not'. See output from @code(gnuplot -e "set
+ terminal") for the list of avalaible options.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = output-file;
+ arg-type = str;
+ descrip = 'Output file';
+ doc = <<- _EndOfDoc_
+ Output file for @code{gnuplot}, default to stdout.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = dont-wait;
+ descrip = "Don't wait for keystroke between plots";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
diff --git a/scripts/plot_summary.1plot_summaryman b/scripts/plot_summary.1plot_summaryman
new file mode 100644
index 0000000..c2394fa
--- /dev/null
+++ b/scripts/plot_summary.1plot_summaryman
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH plot_summary 1plot_summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-L.aO0H/ag-X.aWZH)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:47 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]plot_summary\fP
+\- plot statistics generated by summary script
+.SH SYNOPSIS
+\f\*[B-Font]plot_summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH "DESCRIPTION"
+There is no description for this command.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Where the summary files are.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.TP
+.NOP \f\*[B-Font]\-\-identifier\f[]=\f\*[I-Font]string\f[]
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.TP
+.NOP \f\*[B-Font]\-\-offset\-limit\f[]=\f\*[I-Font]float\f[]
+Limit of absolute offset.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 0.128
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-peer\f[]=\f\*[I-Font]string\f[]
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.TP
+.NOP \f\*[B-Font]\-\-plot\-term\f[]=\f\*[I-Font]string\f[]
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.TP
+.NOP \f\*[B-Font]\-\-output\-file\f[]=\f\*[I-Font]str\f[]
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.TP
+.NOP \f\*[B-Font]\-\-dont\-wait\f[]
+Don't wait for keystroke between plots.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.1plot_summarymdoc b/scripts/plot_summary.1plot_summarymdoc
new file mode 100644
index 0000000..583994a
--- /dev/null
+++ b/scripts/plot_summary.1plot_summarymdoc
@@ -0,0 +1,88 @@
+.Dd December 2 2014
+.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:48 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm plot_summary
+.Nd plot statistics generated by summary script
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh "DESCRIPTION"
+There is no description for this command.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Where the summary files are.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.It Fl \-identifier Ns = Ns Ar string
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.It Fl \-offset\-limit Ns = Ns Ar float
+Limit of absolute offset.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 0.128
+.sp
+.It Fl \-peer Ns = Ns Ar string
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.It Fl \-plot\-term Ns = Ns Ar string
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.It Fl \-output\-file Ns = Ns Ar str
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.It Fl \-dont\-wait
+Don't wait for keystroke between plots.
+.sp
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.html b/scripts/plot_summary.html
new file mode 100644
index 0000000..8de508b
--- /dev/null
+++ b/scripts/plot_summary.html
@@ -0,0 +1,207 @@
+<html lang="en">
+<head>
+<title>Plot_summary User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Plot_summary User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Plot_summary User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-Description">plot_summary Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<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.7p482 of <code>plot_summary</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Plot_summary User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#plot_005fsummary-Description">plot_summary Description</a>: Description
+<li><a accesskey="2" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>: Invoking plot_summary
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-Description">plot_summary Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking plot_summary</h3>
+
+<p><a name="index-plot_005fsummary-1"></a><a name="index-plot-statistics-generated-by-summary-script-2"></a>
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>plot_summary</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#plot_005fsummary-usage">plot_summary usage</a>: plot_summary help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#plot_005fsummary-directory">plot_summary directory</a>: directory option
+<li><a accesskey="3" href="#plot_005fsummary-identifier">plot_summary identifier</a>: identifier option
+<li><a accesskey="4" href="#plot_005fsummary-peer">plot_summary peer</a>: peer option
+<li><a accesskey="5" href="#plot_005fsummary-plot_002dterm">plot_summary plot-term</a>: plot-term option
+<li><a accesskey="6" href="#plot_005fsummary-output_002dfile">plot_summary output-file</a>: output-file option
+<li><a accesskey="7" href="#plot_005fsummary-exit-status">plot_summary exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-directory">plot_summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">plot_summary help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-plot_005fsummary-help-3"></a>
+This is the automatically generated usage text for plot_summary.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.7p482
+USAGE: plot_summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ --directory=str Where the summary files are
+ --identifier=str Origin of the data
+ --offset-limit=float Limit of absolute offset
+ --peer=str Peers to generate plots for
+ - may appear multiple times
+ --plot-term=str Gnuplot terminal
+ --output-file=str Output file
+ --dont-wait Don't wait for keystroke between plots
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="plot_005fsummary-directory"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-identifier">plot_summary identifier</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-usage">plot_summary usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">directory option</h4>
+
+<p><a name="index-plot_005fsummary_002ddirectory-4"></a>
+This is the &ldquo;where the summary files are&rdquo; option.
+This option takes a string argument.
+ The directory where the <code>plot_summary</code> will search for the
+ *_summary files generated by <code>summary</code> script.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-identifier"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-peer">plot_summary peer</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-directory">plot_summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">identifier option</h4>
+
+<p><a name="index-plot_005fsummary_002didentifier-5"></a>
+This is the &ldquo;origin of the data&rdquo; option.
+This option takes a string argument.
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-peer"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-plot_002dterm">plot_summary plot-term</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-identifier">plot_summary identifier</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">peer option</h4>
+
+<p><a name="index-plot_005fsummary_002dpeer-6"></a>
+This is the &ldquo;peers to generate plots for&rdquo; option.
+This option takes a string argument.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-plot_002dterm"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-output_002dfile">plot_summary output-file</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-peer">plot_summary peer</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">plot-term option</h4>
+
+<p><a name="index-plot_005fsummary_002dplot_002dterm-7"></a>
+This is the &ldquo;gnuplot terminal&rdquo; option.
+This option takes a string argument.
+ This is string is passed directly to the <code>gnuplot set terminal</code>
+ command. Default is <code>x11</code> if <code>DISPLAY</code> is set and
+ <code>dumb</code> is it's not'. See output from -e "set
+ terminal") for the list of avalaible options.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-output_002dfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#plot_005fsummary-exit-status">plot_summary exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-plot_002dterm">plot_summary plot-term</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">output-file option</h4>
+
+<p><a name="index-plot_005fsummary_002doutput_002dfile-8"></a>
+This is the &ldquo;output file&rdquo; option.
+This option takes a str argument.
+ Output file for <code>gnuplot</code>, default to stdout.
+<div class="node">
+<p><hr>
+<a name="plot_005fsummary-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#plot_005fsummary-output_002dfile">plot_summary output-file</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#plot_005fsummary-Invocation">plot_summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">plot_summary exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/plot_summary.in b/scripts/plot_summary.in
new file mode 100644
index 0000000..3401b0d
--- /dev/null
+++ b/scripts/plot_summary.in
@@ -0,0 +1,329 @@
+#! @PATH_PERL@ -w
+# $Id$
+#
+# Use Gnuplot to display data in summary files produced by summary.pl.
+# This script requires GNUPLOT 3.7!
+#
+# Copyright (c) 1997, 1999 by Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+package plot_summary;
+use 5.006_000;
+use strict;
+use Time::Local;
+
+my ($identifier, $offset_limit, $gnuplot_terminal, $wait_after_plot,
+ $output_file, $output_file_number);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@_, $opts)) {
+ usage(1);
+ }
+
+ $identifier = $opts->{'identifier'};
+ if (!$identifier) {
+ $identifier = "host".`hostname`;
+ chomp $identifier;
+ }
+ $offset_limit = $opts->{'offset-limit'};
+ $output_file = $opts->{'output-file'};
+ $output_file_number = 1;
+ $gnuplot_terminal = $opts->{'plot-terminal'}
+ || ( $ENV{DISPLAY} ? "x11" : "dumb" );
+ $wait_after_plot = !$opts->{'dont-wait'};
+
+ die "illegal offset-limit: $offset_limit" unless $offset_limit > 0.0;
+ $offset_limit *= 1e6; # scale to microseconds
+
+ my $summary_dir = $opts->{'directory'};
+
+ my $loop_summary ="$summary_dir/loop_summary";
+ my $peer_summary ="$summary_dir/peer_summary";
+ my $clock_summary="$summary_dir/clock_summary";
+
+ my @peer_list = @{$opts->{'peer'}};
+
+ do_loop($loop_summary);
+ do_peer($peer_summary, $_) for @peer_list;
+}
+
+# return the smallest value in the given list
+sub min
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ < $result) } @rest;
+ return($result);
+}
+
+# return the largest value in the given list
+sub max
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ > $result) } @rest;
+ return($result);
+}
+
+# maybe open alternate output file
+sub open_output
+{
+ my $file;
+ if ($output_file) {
+ while ( -r ($file = "$output_file$output_file_number") ) {
+ ++$output_file_number;
+ }
+ open TOUCH, ">$file" and close TOUCH or die "$file: $!";
+ print "set output \"$file\"\n";
+ }
+}
+
+# make Gnuplot wait
+sub maybe_add_pause
+{
+ print "pause -1 \"Press key to continue...\"\n" if $wait_after_plot;
+}
+
+# plot data from loop summary
+sub do_loop
+{
+ my $fname = shift;
+ my $line;
+ my $out_file = "/tmp/tempdata$$";
+ my $cmd_file = "/tmp/tempcmd$$";
+ my ($first_day, $day_out) = ("", 0);
+ my ($lower_bound, $upper_bound, $rms);
+ my ($min_offs, $max_offs) = (1e9, -1e9);
+ my ($min_rms, $max_rms) = (1e9, -1e9);
+ open INPUT, "$fname" or die "$fname: $!";
+ open OUTPUT, ">$out_file" or die "$out_file: $!";
+ my @Fld;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ if ($#Fld == 0) {
+# loops.19960405
+ $_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
+ m/(\d{4})(\d{2})(\d{2})/;
+ $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
+ $line = int $line / 86400; # days relative to 1970
+ $first_day = "$1-$2-$3 ($line)" unless $day_out;
+ next;
+ }
+ if ($#Fld != 8) {
+ warn "Illegal number of fields in file $fname, line $.";
+ next;
+ }
+# loop 216, 856106+/-874041.5, rms 117239.8, freq 67.52+/-10.335, var 4.850
+ $_ = $Fld[1]; s/,/ /; $line .= " $_";
+ $_ = $Fld[2]; m:(.+?)\+/-(.+),:;
+ $lower_bound = $1 - $2;
+ $upper_bound = $1 + $2;
+ $line .= "$1 $lower_bound $upper_bound";
+ $min_offs = min($min_offs, $lower_bound);
+ $max_offs = max($max_offs, $upper_bound);
+ $_ = $Fld[4]; s/,/ /; $rms = $_;
+ $min_rms = min($min_rms, $rms);
+ $max_rms = max($max_rms, $rms);
+ $line .= " $rms";
+ $_ = $Fld[6]; m:(.+?)\+/-(.+),:;
+ $line .= " $1 " . ($1-$2) . " " . ($1+$2);
+ $line .= " $Fld[8]";
+ print OUTPUT "$line\n";
+ $day_out = 1;
+# 9621 216 856106 -17935.5 1730147.5 117239.8 67.52 57.185 77.855 4.850
+ }
+ close INPUT;
+ close OUTPUT or die "close failed on $out_file: $!";
+ my $ylimit = "[";
+ if ($min_offs < -$offset_limit) {
+ $ylimit .= "-$offset_limit";
+ }
+ $ylimit .= ":";
+ if ($max_offs > $offset_limit) {
+ $ylimit .= "$offset_limit";
+ }
+ if ( $ylimit eq "[:" ) {
+ $ylimit = "";
+ } else {
+ $ylimit = "[] $ylimit]";
+ }
+# build command file for GNUplot
+ open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
+ my $oldfh = select OUTPUT;
+ print "set term $gnuplot_terminal\n";
+ open_output;
+ print "set grid\n";
+ print "set title \"Loop Summary for $identifier: " .
+ "Daily mean values since $first_day\\n" .
+ "(Offset limit is $offset_limit microseconds)\"\n";
+ print "set ylabel \"[us]\"\n";
+ print "set style data yerrorbars\n";
+ print "set multiplot\n";
+ print "set size 1, 0.5\n";
+ print "set lmargin 8\n";
+ print "set origin 0, 0.5\n";
+ print "plot $ylimit \"$out_file\"" .
+ " using 1:3:4:5 title \"mean offset\", ";
+ print "\"$out_file\" using 1:(\$3-\$6/2) " .
+ "title \"(sigma low)\" with lines, ";
+ print "\"$out_file\" using 1:3 smooth bezier " .
+ "title \"(Bezier med)\" with lines, ";
+ print "\"$out_file\" using 1:(\$3+\$6/2) " .
+ "title \"(sigma high)\" with lines\n";
+ print "set ylabel \"[ppm]\"\n";
+ print "set origin 0, 0.0\n";
+ print "set title\n";
+ print "set xlabel \"Days relative to 1970\"\n";
+ print "plot \"$out_file\" using 1:7:8:9 title \"mean frequency\", ";
+ print "\"$out_file\" using 1:(\$7-\$10/2) " .
+ "title \"(sigma low)\" with lines, ";
+ print "\"$out_file\" using 1:7 smooth bezier " .
+ "title \"(Bezier med)\" with lines, ";
+ print "\"$out_file\" using 1:(\$7+\$10/2) " .
+ "title \"(sigma high)\" with lines\n";
+ print "set nomultiplot\n";
+ maybe_add_pause;
+
+ $ylimit = "[";
+ if ($min_rms < -$offset_limit) {
+ $ylimit .= "-$offset_limit";
+ }
+ $ylimit .= ":";
+ if ($max_rms > $offset_limit) {
+ $ylimit .= "$offset_limit";
+ }
+ if ( $ylimit eq "[:" ) {
+ $ylimit ="";
+ } else {
+ $ylimit = "[] $ylimit]";
+ }
+
+ open_output;
+ print "set title \"Loop Summary for $identifier: " .
+ "Standard deviation since $first_day\\n" .
+ "(Offset limit is $offset_limit microseconds)\"\n";
+ print "set xlabel\n";
+ print "set ylabel \"[us]\"\n";
+ print "set origin 0, 0.5\n";
+ print "set style data linespoints\n";
+ print "set multiplot\n";
+ print "plot $ylimit \"$out_file\" using 1:6 title \"Offset\", ";
+ print "\"$out_file\" using 1:6 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set title\n";
+ print "set origin 0, 0.0\n";
+ print "set xlabel \"Days relative to 1970\"\n";
+ print "set ylabel \"[ppm]\"\n";
+ print "plot \"$out_file\" using 1:10 title \"Frequency\", ";
+ print "\"$out_file\" using 1:10 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set nomultiplot\n";
+ maybe_add_pause;
+
+ close OUTPUT or die "close failed on $cmd_file: $!";
+ select $oldfh;
+ print `gnuplot $cmd_file`;
+ unlink $cmd_file;
+ unlink $out_file;
+}
+
+# plot data form peer summary
+sub do_peer
+{
+ my $fname = shift;
+ my $peer = shift;
+ my $out_file = "/tmp/tempdata$$";
+ my $cmd_file = "/tmp/tempcmd$$";
+ my $line;
+ my ($first_day, $day_out) = ("", 0);
+ open INPUT, "$fname" or die "$fname: $!";
+ open OUTPUT, ">$out_file" or die "$out_file: $!";
+ my @Fld;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ if ($#Fld == 0) {
+# peers.19960405
+ $_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
+ m/(\d{4})(\d{2})(\d{2})/ or next;
+ $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
+ $line = int $line / 86400; # days relative to 1970
+ $first_day = "$1-$2-$3 ($line)" unless $day_out;
+ next;
+ }
+ if ($#Fld != 7) {
+ warn "Illegal number of fields in file $fname, line $.";
+ next;
+ }
+ next if ($Fld[0] ne $peer);
+# ident cnt mean rms max delay dist disp
+# 127.127.8.1 38 30.972 189.867 1154.607 0.000 879.760 111.037
+ $Fld[0] = $line;
+ print OUTPUT join(' ', @Fld) . "\n";
+# 9969 38 30.972 189.867 1154.607 0.000 879.760 111.037
+ $day_out = 1;
+ }
+ close INPUT;
+ close OUTPUT or die "close failed on $out_file: $!";
+ die "no data found for peer $peer" if !$day_out;
+ open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
+ my $oldfh = select OUTPUT;
+ print "set term $gnuplot_terminal\n";
+ open_output;
+ print "set grid\n";
+ print "set multiplot\n";
+ print "set lmargin 8\n";
+ print "set size 1, 0.34\n";
+ print "set origin 0, 0.66\n";
+ print "set title " .
+ "\"Peer Summary for $peer on $identifier since $first_day\"\n";
+ print "set style data linespoints\n";
+ print "set ylabel \"[us]\"\n";
+ print "plot \"$out_file\" using 1:3 title \"mean offset\", ";
+ print "\"$out_file\" using 1:3 smooth bezier " .
+ "title \"(Bezier)\" with lines, ";
+ print "\"$out_file\" using 1:(\$3-\$7/2) " .
+ "title \"(sigma low)\" with lines, ";
+ print "\"$out_file\" using 1:(\$3+\$7/2) " .
+ "title \"(sigma high)\" with lines\n";
+ print "set title\n";
+ print "set origin 0, 0.34\n";
+ print "set size 1, 0.32\n";
+ print "set ylabel\n";
+ print "plot \"$out_file\" using 1:7 title \"dist\", ";
+ print "\"$out_file\" using 1:7 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set origin 0, 0.00\n";
+ print "set size 1, 0.35\n";
+ print "set xlabel \"Days relative to 1970\"\n";
+ print "plot \"$out_file\" using 1:8 title \"disp\", ";
+ print "\"$out_file\" using 1:8 smooth bezier " .
+ "title \"(Bezier)\" with lines\n";
+ print "set nomultiplot\n";
+ maybe_add_pause;
+
+ select $oldfh;
+ close OUTPUT or die "close failed on $cmd_file: $!";
+ print `gnuplot $cmd_file`;
+ unlink $cmd_file;
+ unlink $out_file;
+}
+
+@plot_summary_opts@
+
+1;
+__END__
diff --git a/scripts/plot_summary.man.in b/scripts/plot_summary.man.in
new file mode 100644
index 0000000..c2394fa
--- /dev/null
+++ b/scripts/plot_summary.man.in
@@ -0,0 +1,114 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH plot_summary 1plot_summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-L.aO0H/ag-X.aWZH)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:47 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]plot_summary\fP
+\- plot statistics generated by summary script
+.SH SYNOPSIS
+\f\*[B-Font]plot_summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH "DESCRIPTION"
+There is no description for this command.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Where the summary files are.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.TP
+.NOP \f\*[B-Font]\-\-identifier\f[]=\f\*[I-Font]string\f[]
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.TP
+.NOP \f\*[B-Font]\-\-offset\-limit\f[]=\f\*[I-Font]float\f[]
+Limit of absolute offset.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 0.128
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-peer\f[]=\f\*[I-Font]string\f[]
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.TP
+.NOP \f\*[B-Font]\-\-plot\-term\f[]=\f\*[I-Font]string\f[]
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.TP
+.NOP \f\*[B-Font]\-\-output\-file\f[]=\f\*[I-Font]str\f[]
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.TP
+.NOP \f\*[B-Font]\-\-dont\-wait\f[]
+Don't wait for keystroke between plots.
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.mdoc.in b/scripts/plot_summary.mdoc.in
new file mode 100644
index 0000000..583994a
--- /dev/null
+++ b/scripts/plot_summary.mdoc.in
@@ -0,0 +1,88 @@
+.Dd December 2 2014
+.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:48 AM by AutoGen 5.18.5pre4
+.\" From the definitions plot_summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm plot_summary
+.Nd plot statistics generated by summary script
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh "DESCRIPTION"
+There is no description for this command.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Where the summary files are.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The directory where the \fBplot_summary\fP will search for the
+ *_summary files generated by \fBsummary\fP script.
+.It Fl \-identifier Ns = Ns Ar string
+Origin of the data.
+.sp
+ Where does the plotted data come from, default to string "host" plus
+ current hostname
+.It Fl \-offset\-limit Ns = Ns Ar float
+Limit of absolute offset.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 0.128
+.sp
+.It Fl \-peer Ns = Ns Ar string
+Peers to generate plots for.
+This option may appear an unlimited number of times.
+.sp
+ By default the peer_summary plots are not generated. Use this option to
+ specify list of peers if you want to generate plots for them.
+.It Fl \-plot\-term Ns = Ns Ar string
+Gnuplot terminal.
+.sp
+ This is string is passed directly to the \fBgnuplot set terminal\fP
+ command. Default is \fBx11\fP if \fBDISPLAY\fP is set and
+ \fBdumb\fP is it's not'. See output from @code(gnuplot \-e "set
+ terminal") for the list of avalaible options.
+.It Fl \-output\-file Ns = Ns Ar str
+Output file.
+.sp
+ Output file for \fBgnuplot\fP, default to stdout.
+.It Fl \-dont\-wait
+Don't wait for keystroke between plots.
+.sp
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBplot_summary\fP
+option definitions.
diff --git a/scripts/plot_summary.texi b/scripts/plot_summary.texi
new file mode 100644
index 0000000..33fa1fd
--- /dev/null
+++ b/scripts/plot_summary.texi
@@ -0,0 +1,40 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename plot_summary.info
+@settitle Plot_summary User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{plot_summary},
+a program from the NTP Project
+@end ifinfo
+
+@direntry
+* plot_summary: (plot_summary). Summarize (something)
+@end direntry
+
+@titlepage
+@title plot_summary User's Manual
+@subtitle plot_summary, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, plot_summary Description, (dir), (dir)
+@top Plot_summary User Manual
+
+This document describes the use of the NTP Project's @code{plot_summary} program.
+This document applies to version @value{VERSION} of @code{plot_summary}.
+
+@shortcontents
+
+@menu
+* plot_summary Description:: Description
+* plot_summary Invocation:: Invoking plot_summary
+@end menu
+
+@include invoke-plot_summary.texi
diff --git a/scripts/rc/README b/scripts/rc/README
new file mode 100644
index 0000000..f5b82bc
--- /dev/null
+++ b/scripts/rc/README
@@ -0,0 +1,13 @@
+This directory contains some example rc scripts for ntpd.
+
+In general, ntpd should be started as soon as possible in the boot process. If
+any services require stable system clock, the ntpwait script should be run
+before them as late as possible.
+
+The rc.d contains scripts for systems using rc.d init system (originated in
+NetBSD). If a service requires stable system time, indicate it with TIMESYNC
+dependency and set ntpwait_enable to YES.
+
+For SysV init systems, you'll have to create links as /etc/rc2.d/S20ntpd and
+/etc/rc2.d/S80ntpwait yourself. (The numbers are just examples, try to give
+ntpd as much time as possible to synchronize before running ntpwait).
diff --git a/scripts/rc/ntpd b/scripts/rc/ntpd
new file mode 100644
index 0000000..9896247
--- /dev/null
+++ b/scripts/rc/ntpd
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+NTPD=/usr/sbin/ntpd
+PIDFILE=/var/run/ntpd.pid
+USER=ntp
+GROUP=ntp
+NTPD_OPTS="-g -u $USER:$GROUP -p $PIDFILE"
+
+ntpd_start() {
+ if [ -r $PIDFILE ]; then
+ echo "ntpd seems to be already running under pid `cat $PIDFILE`."
+ echo "Delete $PIDFILE if this is not the case.";
+ return 1;
+ fi
+ echo -n "Starting NTP daemon... "
+
+ $NTPD $NTPD_OPTS
+
+ # You can't always rely on the ntpd exit code, see Bug #2420
+ # case "$?" in
+ # 0) echo "OK!"
+ # return 0;;
+ # *) echo "FAILED!"
+ # return 1;;
+ # esac
+
+ sleep 1
+
+ if ps -Ao args|grep -q "^$NTPD $NTPD_OPTS"; then
+ echo "OK!"
+ return 0
+ else
+ echo "FAILED!"
+ [ -e $PIDFILE ] && rm $PIDFILE
+ return 1
+ fi
+}
+
+ntpd_stop() {
+ if [ ! -r $PIDFILE ]; then
+ echo "ntpd doesn't seem to be running, cannot read the pid file."
+ return 1;
+ fi
+ echo -n "Stopping NTP daemon...";
+ PID=`cat $PIDFILE`
+
+ if kill -TERM $PID 2> /dev/null;then
+ # Give ntp 15 seconds to exit
+ for i in `seq 1 15`; do
+ if [ -n "`ps -p $PID|grep -v PID`" ]; then
+ echo -n .
+ sleep 1
+ else
+ echo " OK!"
+ rm $PIDFILE
+ return 0
+ fi
+ done
+ fi
+
+ echo " FAILED! ntpd is still running";
+ return 1
+}
+
+ntpd_status() {
+ if [ -r $PIDFILE ]; then
+ echo "NTP daemon is running as `cat $PIDFILE`"
+ else
+ echo "NTP daemon is not running"
+ fi
+}
+
+case "$1" in
+ 'start')
+ ntpd_start
+ ;;
+ 'stop')
+ ntpd_stop
+ ;;
+ 'restart')
+ ntpd_stop && ntpd_start
+ ;;
+ 'status')
+ ntpd_status
+ ;;
+ *)
+ echo "Usage: $0 (start|stop|restart|status)"
+esac
diff --git a/scripts/rc/ntpwait b/scripts/rc/ntpwait
new file mode 100644
index 0000000..2542b2a
--- /dev/null
+++ b/scripts/rc/ntpwait
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+NTPWAIT=/usr/sbin/ntpwait
+
+ntpwait_start() {
+ $NTPWAIT -v
+}
+
+case "$1" in
+ 'start')
+ ntpwait_start
+ ;;
+ *)
+ echo "Usage: $0 (start)"
+esac
diff --git a/scripts/rc/rc.d/TIMESYNC b/scripts/rc/rc.d/TIMESYNC
new file mode 100644
index 0000000..a8c074f
--- /dev/null
+++ b/scripts/rc/rc.d/TIMESYNC
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# PROVIDE: TIMESYNC
+# REQUIRE: LOGIN ntpwait
+
+# This depedency ensures that all services which require stable system clock
+# are run after ntpd is synchronized. It's run as late as possible, if you need
+# stable clock before login use BEFORE: LOGIN
diff --git a/scripts/rc/rc.d/ntpd b/scripts/rc/rc.d/ntpd
new file mode 100644
index 0000000..ea33458
--- /dev/null
+++ b/scripts/rc/rc.d/ntpd
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PROVIDE: ntpd
+# REQUIRE: syslogd cleanvar devfs
+# BEFORE: SERVERS
+
+. /etc/rc.subr
+
+name="ntpd"
+rcvar="ntpd_enable"
+command="/usr/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+start_precmd="ntpd_precmd"
+
+load_rc_config $name
+
+ntpd_precmd()
+{
+ rc_flags="-c ${ntpd_config} ${ntpd_flags}"
+
+ if checkyesno ntpd_sync_on_start; then
+ rc_flags="-g $rc_flags"
+ fi
+
+ if [ -z "$ntpd_chrootdir" ]; then
+ return 0;
+ fi
+
+ rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags"
+}
+
+run_rc_command "$1"
diff --git a/scripts/rc/rc.d/ntpwait b/scripts/rc/rc.d/ntpwait
new file mode 100644
index 0000000..891d0db
--- /dev/null
+++ b/scripts/rc/rc.d/ntpwait
@@ -0,0 +1,21 @@
+#!/bin/sh
+# This script, when run, runs ntp-wait if ntpd is enabled.
+
+# PROVIDE: ntpwait
+
+. /etc/rc.subr
+
+name="ntpwait"
+rcvar="ntpwait_enable"
+start_cmd="ntpwait_start"
+ntp_wait="/usr/sbin/ntp-wait"
+
+load_rc_config "$name"
+
+ntpwait_start() {
+ if checkyesno ntpd_enable; then
+ $ntp_wait -v
+ fi
+}
+
+run_rc_command "$1"
diff --git a/scripts/stats/README b/scripts/stats/README
new file mode 100644
index 0000000..6808963
--- /dev/null
+++ b/scripts/stats/README
@@ -0,0 +1,39 @@
+Statistics processing scripts (README)
+
+This directory contains a number of scripts for use with the filegen
+facility. Those files ending in .awk are for the Unix awk utility, while
+those ending in .sh are for the csh utility. Normally, the summary.sh
+script is called from a cron job once per day. This script processes the
+daily loopstats, peerstats and clockstats files produced by the daemon,
+updates the loop_summary, peer_summary and clock_summary archive files,
+and deletes the daily files.
+
+In the case of the Austron 2201A GPS receiver, the clockstats file
+contains a wealth of additional monitoring data. These data are summarized
+and writted to the clock_summary file, then a series of special files are
+constructed for later processing by the S utility.
+
+The summary.sh script invokes a number of awk scripts to actually produce
+the data. This may result in multiple scans of the same input file.
+The input file is deleted after processing. In fact, the shell scripts will
+process all input files found of the correct type in chronological order,
+deleting each one as it is scanned, except the current day file.
+
+The summary.sh script can produce input files for the S utility, if it
+is found on the search path. This utility makes PostScript graphs of the
+loopstats data for each day, as well as various statistics produced by
+the Austorn 220aA GPS receiver. The S utility is automatically run
+as a background job. Its control files have the .S extension.
+
+The psummary.awk script can be used to scan the peer_summary file and
+construct an historical reprise of the daily summaries.
+
+The file formats are documented in the README.stats file and in the
+scripts themselves. Further detail on the radio clock ASCII timecode
+formats and related data are in the README.timecode file.
+
+David L. Mills
+University of Delaware
+mills@udel.edu
+1 November 1993
+Revised 12 April 1994
diff --git a/scripts/stats/README.stats b/scripts/stats/README.stats
new file mode 100644
index 0000000..aa8e77f
--- /dev/null
+++ b/scripts/stats/README.stats
@@ -0,0 +1,246 @@
+Statistics file formats (README.stats)
+
+The xntp3 daemon can produce a variety of statistics files which are
+useful for maintenance, evaluation and retrospective calibration
+purposes. See the xntpd.8 man page for instructions on how to configure
+this feature. Since these files can become rather large and cumbersome,
+they are ordinarily reduced to summary form by running the summary.sh
+shell script once per day, week or month, as appropriate. There are
+three file collections presently defined: peerstats, loopstats and
+clockstats, each of which is described in this note.
+
+peerstats
+
+The following data are collected in the peerstats files. The files are
+reduced to summary data using the peer.sh shell script. See the peer.awk
+script for further information. A line in the file is produced upon
+reception of each valid update from a configured peer.
+
+ 49236 30.756 140.173.96.1 9474 0.000603 0.37532
+
+ 49236 modified Julian day number
+ 30.756 time of day (s) past midnight UTC
+ 140.173.96.1 peer identifier (IP address or receiver identifier)
+ 9474 peer status word (hex) (see NTP specification)
+ 0.000603 offset (s)
+ 0.08929 delay (s)
+ 0.37532 dispersion (s)
+
+loopstats
+
+The following data are collected in the loopstats files. The files are
+reduced to summary data using the loop.sh shell script. See the loop.awk
+script for further information. A line in the file is produced at each
+valid update of the local clock.
+
+ 49236 11.897 -0.000004 -35.9384 0
+
+ 49236 modified Julian day number
+ 11.897 time of day (s) past midnight UTC
+ -0.000004 time offset (s)
+ -35.9384 frequency offset (ppm)
+ 0 phase-lock loop time constant
+
+clockstats
+
+The following data are collected in the clockstats files. The files are
+reduced to summary data using the clock.sh shell script, which also
+updates the ensemble, etf, itf and tdata data files as well. See the
+clock.awk, ensemble.awk, etf.awk, itf.awk and tdta.awk scripts for
+further information. A line in the file is produced at each valid update
+received from a configured radio clock. Data are at present recorded for
+several radios. The first part of each data line is similar for all
+radios, e.g.:
+
+ 49234 60517.826 127.127.4.1 93 247 16:48:21.814
+
+ 49234 modified Julian day number
+ 60517.826 time of day (s) past midnight UTC
+ 127.127.4.1 receiver identifier (Spectracom 8170/Netclock-2)
+ 93 247 16:48:21.814 timecode (format varies)
+
+In the case of the Austron GPS receiver, a good deal of additional
+information is extracted from the radio, as described below. The formats
+shown consist of one line with all the fields shown in order. The
+timecode formats specific to each radio follow. See the file
+README.timecodes for detailed information on the timecode formats used
+by these radios.
+
+Spectracom 8170/Netclock-2 WWVB receiver
+
+ 49234 60517.826 127.127.4.1 ?A93 247 16:48:21.814
+
+ The '?' and 'A' characters are present only when the receiver is
+ unsynchronized; otherwise, they are replaced by space ' ' characters.
+
+IRIG audio decoder
+
+ 49234 60517.826 127.127.6.0 247 16:48:21?
+
+ The '?' character is present only when the receiver is unsynchronized.
+
+Austron 2200A/2201A GPS receiver
+
+ 49234 60580.843 127.127.10.1 93:247:16:49:24.814?
+
+ The '?' character is present only when the receiver is unsynchronized.
+
+Depending on the installed options, the Austron 2200A/2201A recognizes a
+number of special commands that report various data items. See the
+refclock_as2201.c source module for a list of the commands used. These
+data are collected only if the following line is included in the
+configuration file ntp.conf:
+
+ fudge 127.127.10.1 flag4 1 # enable extended statistics collection
+
+The format of each data line returned is summarized in the following
+list.
+
+External time/frequency data (requires input buffer option IN)
+
+These data determine the deviations of external time/frequency inputs
+relative to receiver oscillator time. The following data are typical
+using an external cesium oscillator PPS and 5-MHz outputs.
+
+ 49234 60580.843 127.127.10.1 93:247:16:49:24.814 ETF
+
+ -85.9 time interval (ns)
+ -89.0 average time interval (ns)
+ 4.0 time interval sigma (ns)
+ +1.510E-11 time interval rate
+ -4.500E-11 deltaf/f
+ +1.592E-11 average deltaf/f
+ 5.297E-13 sigma deltaf/f
+ 500 number of samples
+
+Model and option identifiers
+
+These data show the receiver model number and option configuration.
+
+ 49234 60708.848 127.127.10.1 93:247:16:51:32.817 ID;OPT;VER
+
+ GPS 2201A model ident (must be "GPS 2200A" or "GPS 2201A")
+ TTY1 rs232 option present (required)
+ TC1 IRIG option present (optional)
+ LORAN LORAN assist option present (optional)
+ IN input buffer option present (optional)
+ OUT1 output buffer option present (required)
+ B.00 data processor software version ("B.00" or later)
+ B.00 signal processor software version ("B.00" or later)
+ 28-Apr-93 software version date ("28-Apr-93" or later)
+
+Internal time/frequency data
+
+These data determine the deviations of the receiver oscillator with
+respect to satellite time.
+
+ 49234 60564.846 127.127.10.1 93:247:16:49:08.816 ITF
+
+ COCO current mode (must be "COCO")
+ 0 code coast mode (must be zero)
+ +6.6152E-08 code sigma (s)
+ -3.5053E-08 code delta t (s)
+ -4.0361E-11 deltat/t
+ -6.4746E-11 oscillator ageing rate
+ 500.00 loop time constant
+ 4.984072 electrical tuning (V)
+
+GPS/LORAN ensemble data (requires LORAN assist option LORAN)
+
+These data determine the deviations and weights to calculate ensemble
+time from GPS and LORAN data.
+
+ 49234 60596.852 127.127.10.1 93:247:16:49:40.812 LORAN ENSEMBLE
+
+ +9.06E-08 GPS t (s)
+ +3.53E-08 GPS sigma (s)
+ .532 GPS weight
+ +3.71E-08 LORAN t (s)
+ +3.76E-08 LORAN sigma (s)
+ .468 LORAN weight
+ +6.56E-08 ensemble t
+ +6.94E-08 ensemble sigma (s)
+
+LORAN stationkeeping data (requires LORAN assist option LORAN)
+
+These data determine which stations of the LORAN chain are being
+tracked, together with individual signal/noise ratios, deviations and
+weights.
+
+ 49234 60532.850 127.127.10.1 93:247:16:48:36.820 LORAN TDATA
+
+ M station identifier; data follows
+ OK status (must be "OK" for tracking)
+ 0 cw flag
+ 0 sw flag
+ 1162.17 time of arrival
+ -4.6 snr (-30.0 if not "OK" status)
+ 1.67E-07 2-sample phase-time deviation
+ .507 weight (included only if "OK" status)
+ W AQ 0 0 3387.80 -31.0 station identifier and data
+ X OK 0 0 1740.27 -11.2 2.20E-07 .294 station identifier and data
+ Y OK 0 0 2180.71 -4.6 2.68E-07 .198 station identifier and data
+ Z CV 0 0 3392.94 -30.0 station identifier and data
+
+Oscillator status and environment
+
+These data determine the receiver oscillator type, mode, status and
+environment. Nominal operating conditions are shown below.
+
+ 49234 60628.847 127.127.10.1 93:247:16:50:12.817 OSC;ET;TEMP
+
+ 1121 Software Control oscillator model and mode (must be
+ "Software Control")
+ Locked status (must be "Locked")
+ 4.979905 electrical tuning (V)
+ 44.81 oscillator cavity temperature
+
+Receiver position, status and offsets
+
+These data determine the receiver position and elevation, together with
+programmable delay corrections for the antenna cable and receiver.
+
+ 49234 60788.847 127.127.10.1 93:247:16:52:52.817 POS;PPS;PPSOFF
+
+ +39:40:48.425 receiver latitude (N)
+ -075:45:02.392 receiver longitude (E)
+ +74.09 receiver elevation (m)
+ Stored position status (must be "Stored")
+ UTC PPS/PPM alignment (must be "UTC")
+ 0 receiver delay (ns) (should be zero for calibrated
+ receiver)
+ 200 cable delay (ns)
+ 0 user time bias (ns) (must be zero)
+
+Satellite tracking status
+
+These data determine how many satellites are being tracked. At the
+present state of constellation development, there should be at least
+three visible satellites in view. Much of the time the maximum of
+seven are being tracked; rarely this number drops to two.
+
+ 49234 60612.850 127.127.10.1 93:247:16:49:56.820 TRSTAT
+
+ 24 T satellite prn and status (T = track, A = acquire)
+ 16 A 13 T 20 T 18 T 07 T 12 T list continued
+
+UTC leap-second information
+
+These data determine when the next leap second is to occur. The exact
+method to use is obscure.
+
+ 49234 60548.847 127.127.10.1 93:247:16:48:52.818 UTC
+
+ -1.2107E-08 A0 term (s)
+ -1.2790E-13 A1 term (s)
+ +9.0000E+00 current leap seconds (s)
+ +2.0480E+05 time for leap seconds (s)
+ +2.0100E+02 week number for delta leap (weeks)
+ +1.9100E+02 week number for future leap (weeks)
+ +4.0000E+00 day number for future leap (days)
+ +9.0000E+00 future leap seconds (s)
+
+David L. Mills
+University of Delaware
+mills@udel.edu
+23 October 1993
diff --git a/scripts/stats/README.timecodes b/scripts/stats/README.timecodes
new file mode 100644
index 0000000..00b5ba5
--- /dev/null
+++ b/scripts/stats/README.timecodes
@@ -0,0 +1,149 @@
+Radio Timecode Formats (README.timecodes)
+
+Following are examples of the serial timecode formats used by various
+timecode receivers as given in the instruction manuals. These examples
+are intended only for illustration and not as the basis of system
+design. The following symbols are used to identify the timecode
+character that begins a subfield. The values given after this symbol
+represent the character offset from the beginning of the timecode string
+as edited to remove control characters.
+
+C on-time character (start bit)
+Y year of century
+T time of day
+D day of year or month/day
+A alarm indicator (format specific)
+Q quality indicator (format specific)
+<LF> ASCII line feed (hex 0a)
+<CR> ASCII carriage return (hex 0d)
+<SP> ASCII space (hex 20)
+
+In order to promote uniform behavior in the various implementations, it
+is useful to have a common interpretation of alarm conditions and signal
+quality. When the alarm indicator it on, the receiver is not operating
+correctly or has never synchronized to the broadcast signal. When the
+alarm indicator is off and the quality indicator is on, the receiver has
+synchronized to the broadcast signal, then lost the signal and is
+coasting on its internal oscillator.
+
+In the following uppercase letters, punctuation marks and spaces <SP>
+stand for themselves; lowercase letters stand for fields as described.
+Special characters other than <LF>, <CR> and <SP> are preceded by ^.
+
+Spectracom 8170 and Netclock/2 WWV Synchonized Clock (format 0)
+
+"<CR><LF>i ddd hh:mm:ss TZ=zz<CR><LF>"
+ C A D T
+
+ poll: ?; offsets: Y = none, D = 3, T = 7, A = 0, Q = none
+ i = synchronization flag (<SP> = in synch, ? = out synch)
+ ddd = day of year
+ hh:mm:ss = hours, minutes, seconds
+ zz = timezone offset (hours from UTC)
+
+ Note: alarm condition is indicated by other than <SP> at A, which
+ occurs during initial synchronization and when received signal has
+ been lost for about ten hours
+
+ example: " 216 15:36:43 TZ=0"
+ A D T
+
+Netclock/2 WWV Synchonized Clock (format 2)
+
+"<CR><LF>iqyy ddd hh:mm:ss.fff ld"
+ C AQY D T
+
+ poll: ?; offsets: Y = 2, D = 5, T = 9, A = 0, Q = 1
+ i = synchronization flag (<SP> = in synch, ? = out synch)
+ q = quality indicator (<SP> < 1ms, A < 10 ms, B < 100 ms, C < 500
+ ms, D > 500 ms)
+ yy = year (as broadcast)
+ ddd = day of year
+ hh:mm:ss.fff = hours, minutes, seconds, milliseconds of day
+ l = leap-second warning (L indicates leap at end of month)
+ d = standard/daylight time indicator (<SP> standard, D daylight)
+
+ Note: alarm condition is indicated by other than <SP> at A, which
+ occurs during initial synchronization and when received signal has
+ been lost for about ten hours; unlock condition is indicated by
+ other than <SP> at Q, with time since last lock indicated by the
+ letter code A < 13 min, B < 1.5 hr, C < 7 hr, D > 7 hr.
+
+ example: " 92 216 15:36:43.640 D"
+ AQ D T
+
+TrueTime 468-DC Satellite Synchronized Clock (and other TrueTime
+receivers)
+
+"<CR><LF><^A>ddd:hh:mm:ssq<CR>"
+ D T QC
+
+ poll: none; offsets: Y = none, D = 0, T = 4, A = 12, Q = 12
+ hh:mm:ss = hours, minutes, seconds
+ q = quality/alarm indicator (<SP> = locked, ? = alarm)
+
+ Note: alarm condition is indicated by ? at A, which occurs during
+ initial synchronization and when received signal is lost for an
+ extended period; unlock condition is indicated by other than <SP>
+ at Q
+
+ example: "216:15:36:43 "
+ D T Q
+
+Heath GC-1000 Most Accurate Clock (WWV/H)
+
+"<CR>hh:mm:ss.f dd/mm/yy<CR>"
+ C T A D
+
+ poll: none; offsets: Y = none, D = 15, T = 0, A = 9, Q = none
+ hh:mm:ss = hours, minutes, seconds
+ f = deciseconds (? when out of spec)
+ dd/mm = day, month
+ yy = year of century (from DIPswitches)
+
+ Note: 0?:??:??.? is displayed before synch is first established and
+ hh:mm:ss.? once synch is established and then lost again for about
+ a day.
+
+ example: "15:36:43.6 04/08/91"
+ T A D Y
+
+PST/Traconex 1020 Time Source (WWV/H) (firmware revision V4.01)
+
+"frdzycchhSSFTttttuuxx<CR>" "ahh:mm:ss.fffs<CR>" "yy/dd/mm/ddd<CR>"
+ A Q T Y D
+
+ poll: "QMQDQT"; offsets: Y = 0, D = 3 T = 1,, A = 11, Q = 13
+ f = frequency enable (O = all frequencies enabled)
+ r = baud rate (3 = 1200, 6 = 9600)
+ d = features indicator (@ = month/day display enabled)
+ z = time zone (0 = UTC)
+ y = year (5 = 1991)
+ cc = WWV propagation delay (52 = 22 ms)
+ hh = WWVH propagation delay (81 = 33 ms)
+ SS = status (80 or 82 = operating correctly)
+ F = current receive frequency (1-5 = 2.5, 5, 10, 15, 20 MHz)
+ T = transmitter (C = WWV, H = WWVH)
+ tttt = time since last update (minutes)
+ uu = flush character (03 = ^C)
+ xx = 94 (unknown) (firmware revision X4.01.999 only)
+
+ a = AM/PM indicator (A = AM, P = PM, <SP> - 24-hour format)
+ hh:mm:ss.fff = hours, minutes, seconds, milliseconds of day
+ s = daylight-saving indicator (<SP> standard, D daylight)
+
+ yy = year of century (from DIPswitches)
+ dd/mm/ddd = day of month, month of year, day of year
+
+ Note: The alarm condition is indicated by other than ? at A, which
+ occurs during initial synchronization and when received signal is
+ lost for an extended period. A receiver unlock condition is
+ indicated by other than "0000" in the tttt subfield at Q.
+
+ example: "O3@055281824C00000394 91/08/04/216 15:36:43.640"
+ T Y D T
+
+David L. Mills
+University of Delaware
+mills@udel.edu
+23 October 1993
diff --git a/scripts/stats/clock.awk b/scripts/stats/clock.awk
new file mode 100755
index 0000000..ef62da9
--- /dev/null
+++ b/scripts/stats/clock.awk
@@ -0,0 +1,431 @@
+# awk program to scan clockstat files and report errors/statistics
+#
+# usage: awk -f check.awk clockstats
+#
+# This program works for the following radios:
+# PST/Traconex 1020 WWV reciever
+# Arbiter 1088 GPS receiver
+# Spectracom 8170/Netclock-2 WWVB receiver
+# IRIG audio decoder
+# Austron 2200A/2201A GPS receiver (see README.austron file)
+#
+BEGIN {
+ etf_min = osc_vmin = osc_tmin = 1e9
+ etf_max = osc_vmax = osc_tmax = -1e9
+}
+#
+# scan all records in file
+#
+{
+ #
+ # select PST/Traconex WWV records
+ # 00:00:37.234 96/07/08/190 O6@0:5281825C07510394
+ #
+ if (NF >= 4 && $3 == "127.127.3.1") {
+ if (substr($6, 14, 4) > "0010")
+ wwv_sync++
+ if (substr($6, 13, 1) == "C")
+ wwv_wwv++
+ if (substr($6, 13, 1) == "H")
+ wwv_wwvh++
+ x = substr($6, 12, 1)
+ if (x == "1")
+ wwv_2.5++
+ else if (x == "2")
+ wwv_5++
+ else if (x == "3")
+ wwv_10++
+ else if (x == "4")
+ wwv_15++
+ else if (x == "5")
+ wwv_20++
+ continue
+ }
+ #
+ # select Arbiter GPS records
+ # 96 190 00:00:37.000 0 V=08 S=44 T=3 P=10.6 E=00
+ # N39:42:00.951 W075:46:54.880 210.55 2.50 0.00
+ #
+ if (NF >= 4 && $3 == "127.127.11.1") {
+ if (NF > 8) {
+ arb_count++
+ if ($7 != 0)
+ arb_sync++
+ x = substr($10, 3, 1)
+ if (x == "0")
+ arb_0++
+ else if (x == "1")
+ arb_1++
+ else if (x == "2")
+ arb_2++
+ else if (x == "3")
+ arb_3++
+ else if (x == "4")
+ arb_4++
+ else if (x == "5")
+ arb_5++
+ else if (x == "6")
+ arb_6++
+ } else if (NF == 8) {
+ arbn++
+ arb_mean += $7
+ arb_rms += $7 * $7
+ if (arbn > 0) {
+ x = $7 - arb_val
+ arb_var += x * x
+ }
+ arb_val = $7
+ }
+ continue
+ }
+ #
+ # select Spectracom WWVB records
+ # see summary for decode
+ # 96 189 23:59:32.248 D
+ #
+ if (NF >= 4 && $3 == "127.127.4.1") {
+ if ($4 == "SIGNAL" || NF > 7)
+ printf "%s\n", $0
+ else {
+ wwvb_count++
+ if ($4 ~ /\?/)
+ wwvb_x++
+ else if ($4 ~ /A/)
+ wwvb_a++
+ else if ($4 ~ /B/)
+ wwvb_b++
+ else if ($4 ~ /C/)
+ wwvb_c++
+ else if ($4 ~ /D/)
+ wwvb_d++
+ }
+ continue
+ }
+ #
+ # select IRIG audio decoder records
+ # see summary for decode
+ #
+ if (NF >= 4 && $3 == "127.127.6.0") {
+ irig_count++
+ if ($5 ~ /\?/)
+ irig_error++
+ continue
+ }
+ #
+ # select Austron GPS LORAN ENSEMBLE records
+ # see summary for decode
+ #
+ else if (NF >= 13 && $6 == "ENSEMBLE") {
+ ensemble_count++
+ if ($9 <= 0)
+ ensemble_badgps++
+ else if ($12 <= 0)
+ ensemble_badloran++
+ else {
+ if ($13 > 200e-9 || $13 < -200e-9)
+ ensemble_200++
+ else if ($13 > 100e-9 || $13 < -100e-9)
+ ensemble_100++
+ ensemble_mean += $13
+ ensemble_rms += $13 * $13
+ }
+ continue
+ }
+ #
+ # select Austron LORAN TDATA records
+ # see summary for decode; note that signal quality log is simply
+ # copied to output
+ #
+ else if (NF >= 7 && $6 == "TDATA") {
+ tdata_count++
+ for (i = 7; i < NF; i++) {
+ if ($i == "M" && $(i+1) == "OK") {
+ i += 5
+ m += $i
+ tdata_m++
+ }
+ else if ($i == "W" && $(i+1) == "OK") {
+ i += 5
+ w += $i
+ tdata_w++
+ }
+ else if ($i == "X" && $(i+1) == "OK") {
+ i += 5
+ x += $i
+ tdata_x++
+ }
+ else if ($i == "Y" && $(i+1) == "OK") {
+ i += 5
+ y += $i
+ tdata_y++
+ }
+ else if ($i == "Z" && $(i+1) == "OK") {
+ i += 5
+ z += $i
+ tdata_z++
+ }
+ }
+ continue
+ }
+ #
+ # select Austron ITF records
+ # see summary for decode
+ #
+ else if (NF >= 13 && $5 == "ITF" && $12 >= 100) {
+ itf_count++
+ if ($9 > 200e-9 || $9 < -200e-9)
+ itf_200++
+ else if ($9 > 100e-9 || $9 < -100e-9)
+ itf_100++
+ itf_mean += $9
+ itf_rms += $9 * $9
+ itf_var += $10 * $10
+ continue
+ }
+ #
+ # select Austron ETF records
+ # see summary for decode
+ #
+ else if (NF >= 13 && $5 == "ETF" && $13 >= 100) {
+ etf_count++
+ if ($6 > etf_max)
+ etf_max = $6
+ else if ($6 < etf_min)
+ etf_min = $6
+ etf_mean += $6
+ etf_rms += $6 * $6
+ etf_var += $9 * $9
+ continue
+ }
+ #
+ # select Austron TRSTAT records
+ # see summary for decode
+ #
+ else if (NF >= 5 && $5 == "TRSTAT") {
+ trstat_count++
+ j = 0
+ for (i = 6; i <= NF; i++)
+ if ($i == "T")
+ j++
+ trstat_sat[j]++
+ continue
+ }
+ #
+ # select Austron ID;OPT;VER records
+ #
+ # config GPS 2201A TTY1 TC1 LORAN IN OUT1 B.00 B.00 28-Apr-93
+ #
+ # GPS 2201A receiver model
+ # TTY1 rs232 moduel
+ # TC1 IRIG module
+ # LORAN LORAN assist module
+ # IN input module
+ # OUT1 output module
+ # B.00 B.00 firmware revision
+ # 28-Apr-9 firmware date3
+ #
+ else if (NF >= 5 && $5 == "ID;OPT;VER") {
+ id_count++
+ id_temp = ""
+ for (i = 6; i <= NF; i++)
+ id_temp = id_temp " " $i
+ if (id_string != id_temp)
+ printf "config%s\n", id_temp
+ id_string = id_temp
+ continue
+ }
+ #
+ # select Austron POS;PPS;PPSOFF records
+ #
+ # position +39:40:48.425 -075:45:02.392 +74.09 Stored UTC 0 200 0
+ #
+ # +39:40:48.425 position north latitude
+ # -075:45:02.392 position east longitude
+ # +74.09 elevation (meters)
+ # Stored position is stored
+ # UTC time is relative to UTC
+ # 0 200 0 PPS offsets
+ #
+ else if (NF >= 5 && $5 == "POS;PPS;PPSOFF") {
+ pos_count++
+ pos_temp = ""
+ for (i = 6; i <= NF; i++)
+ pos_temp = pos_temp " " $i
+ if (pos_string != pos_temp)
+ printf "position%s\n", pos_temp
+ pos_string = pos_temp
+ continue
+ }
+ #
+ # select Austron OSC;ET;TEMP records
+ #
+ # loop 1121 Software Control Locked
+ #
+ # 1121 oscillator type
+ # Software Control loop is under software control
+ # Locked loop is locked
+ #
+ else if (NF >= 5 && $5 == "OSC;ET;TEMP") {
+ osc_count++
+ osc_temp = $6 " " $7 " " $8 " " $9
+ if (osc_status != osc_temp)
+ printf "loop %s\n", osc_temp
+ osc_status = osc_temp
+ if ($10 > osc_vmax)
+ osc_vmax = $10
+ if ($10 < osc_vmin)
+ osc_vmin = $10
+ if ($11 > osc_tmax)
+ osc_tmax = $11
+ if ($11 < osc_tmin)
+ osc_tmin = $11
+ continue
+ }
+ #
+ # select Austron UTC records
+ # these ain't ready yet
+ #
+ else if (NF >= 5 && $5 == "UTC") {
+ utc_count++
+ utc_temp = ""
+ for (i = 6; i <= NF; i++)
+ utc_temp = utc_temp " " $i
+ if (utc_string != utc_temp)
+# printf "utc%s\n", utc_temp
+ utc_string = utc_temp
+ continue
+ }
+} END {
+#
+# PST/Traconex WWV summary data
+#
+ if (wwv_wwv + wwv_wwvh > 0)
+ printf "wwv %d, wwvh %d, err %d, MHz (2.5) %d, (5) %d, (10) %d, (15) %d, (20) %d\n", wwv_wwv, wwv_wwvh, wwv_sync, wwv_2.5, wwv_5, wwv_10, wwv_15, wwv_20
+#
+# Arbiter 1088 summary data
+#
+# gps record count
+# err error count
+# sats(0-6) satellites tracked
+# mean 1 PPS mean (us)
+# rms 1 PPS rms error (us)
+# var 1 PPS Allan variance
+#
+ if (arb_count > 0) {
+ printf "gps %d, err %d, sats(0-6) %d %d %d %d %d %d %d", arb_count, arb_sync, arb_0, arb_1, arb_2, arb_3, arb_4, arb_5, arb_6
+ if (arbn > 1) {
+ arb_mean /= arbn
+ arb_rms = sqrt(arb_rms / arbn - arb_mean * arb_mean)
+ arb_var = sqrt(arb_var / (2 * (arbn - 1)))
+ printf ", mean %.2f, rms %.2f, var %.2e\n", arb_mean, arb_rms, arb_var * 1e-6
+ } else {
+ printf "\n"
+ }
+ }
+#
+# ensemble summary data
+#
+# ensemble record count
+# badgps gps data unavailable
+# badloran loran data unavailable
+# rms ensemble rms error (ns)
+# >200 ensemble error >200 ns
+# >100 100 ns < ensemble error < 200 ns
+#
+ if (ensemble_count > 0) {
+ ensemble_mean /= ensemble_count
+ ensemble_rms = sqrt(ensemble_rms / ensemble_count - ensemble_mean * ensemble_mean) * 1e9
+ printf "ensemble %d, badgps %d, badloran %d, rms %.1f, >200 %d, >100 %d\n", ensemble_count, ensemble_badgps, ensemble_badloran, ensemble_rms, ensemble_200, ensemble_100
+ }
+#
+# wwvb summary data
+#
+# wwvb record count
+# ? unsynchronized
+# >1 error > 1 ms
+# >10 error > 10 ms
+# >100 error > 100 ms
+# >500 error > 500 ms
+#
+ if (wwvb_count > 0)
+ printf "wwvb %d, ? %d, >1 %d, >10 %d, >100 %d, >500 %d\n", wwvb_count, wwvb_x, wwvb_a, wwvb_b, wwvb_c, wwvb_d
+#
+# irig summary data
+#
+# irig record count
+# err error count
+#
+ if (irig_count > 0)
+ printf "irig %d, err %d\n", irig_count, irig_error
+#
+# tdata summary data
+#
+# tdata record count
+# m M master OK-count, mean level (dB)
+# w W slave OK-count, mean level (dB)
+# x X slave OK-count, mean level (dB)
+# y Y slave OK-count, mean level (dB)
+# z Z slave OK-count, mean level (dB)
+#
+ if (tdata_count > 0 ) {
+ if (tdata_m > 0)
+ m /= tdata_count
+ if (tdata_x > 0)
+ w /= tdata_count
+ if (tdata_x > 0)
+ x /= tdata_count
+ if (tdata_y > 0)
+ y /= tdata_count
+ if (tdata_z > 0)
+ z /= tdata_count
+ printf "tdata %d, m %d %.1f, w %d %.1f, x %d %.1f, y %d %.1f, z %d %.1f\n", tdata_count, tdata_m, m, tdata_w, w, tdata_x, x, tdata_y, y, tdata_z, z
+ }
+#
+# itf summary data
+#
+# itf record count
+# rms itf rms error (ns)
+# >200 itf error > 200 ns
+# >100 itf error > 100 ns
+# var Allan variance
+#
+ if (itf_count > 1) {
+ itf_mean /= itf_count
+ itf_rms = sqrt(itf_rms / itf_count - itf_mean * itf_mean) * 1e9
+ itf_var = sqrt(itf_var / (2 * (itf_count - 1)))
+ printf "itf %d, rms %.1f, >200 %d, >100 %d, var %.2e\n", itf_count, itf_rms, itf_200, itf_100, itf_var
+ }
+#
+# etf summary data
+#
+# etf record count
+# mean etf mean (ns)
+# rms etf rms error (ns)
+# max etf maximum (ns)
+# min etf minimum (ns)
+# var Allan variance
+#
+ if (etf_count > 0) {
+ etf_mean /= etf_count
+ etf_rms = sqrt(etf_rms / etf_count - etf_mean * etf_mean)
+ etf_var = sqrt(etf_var / (2 * (etf_count - 1)))
+ printf "etf %d, mean %.1f, rms %.1f, max %d, min %d, var %.2e\n", etf_count, etf_mean, etf_rms, etf_max, etf_min, etf_var
+ }
+#
+# trstat summary data
+#
+# trstat record count
+# sat histogram of tracked satellites (0 - 7)
+#
+ if (trstat_count > 0)
+ printf "trstat %d, sat %d %d %d %d %d %d %d %d\n", trstat_count, trstat_sat[0], trstat_sat[1], trstat_sat[2], trstat_sat[2], trstat_sat[3], trstat_sat[4], trstat_sat[5], trstat_sat[6], trstat_sat[7]
+#
+# osc summary data
+#
+# osc record count
+# control control midrange (V) +/- deviation (mV)
+# temp oven temperature midrange +/- deviation (deg C)
+#
+ if (osc_count > 0)
+ printf "osc %d, control %.3f+/-%.3f, temp %.1f+/-%.2f\n", osc_count, (osc_vmax + osc_vmin) / 2, (osc_vmax - osc_vmin) / 2 * 1e3, (osc_tmax + osc_tmin) / 2, (osc_tmax - osc_tmin) / 2
+}
diff --git a/scripts/stats/dupe.awk b/scripts/stats/dupe.awk
new file mode 100755
index 0000000..317c2a4
--- /dev/null
+++ b/scripts/stats/dupe.awk
@@ -0,0 +1,8 @@
+#
+# delete duplicate lines
+#
+{
+ if (old != $0)
+ printf "%s\n", $0
+ old = $0
+}
diff --git a/scripts/stats/ensemble.S b/scripts/stats/ensemble.S
new file mode 100755
index 0000000..32a4dba
--- /dev/null
+++ b/scripts/stats/ensemble.S
@@ -0,0 +1,5 @@
+ensemble <- scan(file1, list(day=0, sec=0, gps=0, gpsw=0, loran=0, loranw=0, ensemble=0, std=0))
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck = 0.03, mar = c(2, 2, 1, 1))
+plot(ensemble$sec, ensemble$ensemble, type="l", xlab=paste("MJD", ensemble$day, "Time (s)"), ylab="Ensemble Offset (ns)", ylim=c(-400, 400))
diff --git a/scripts/stats/ensemble.awk b/scripts/stats/ensemble.awk
new file mode 100755
index 0000000..136b33d
--- /dev/null
+++ b/scripts/stats/ensemble.awk
@@ -0,0 +1,17 @@
+# program to produce loran ensemble statistics from clockstats files
+#
+# usage: awk -f ensemble.awk clockstats
+#
+# format of input record (time values in seconds)
+# 49165 8.628 127.127.10.1 93:178:00:00:07.241 LORAN ENSEMBLE
+# -6.43E-08 +5.02E-08 .091 +5.98E-08 +1.59E-08 .909 +4.85E-08 +3.52E-08
+#
+# format of output record (time values in nanoseconds)
+# MJD sec GPS wgt LORAN wgt avg sigma
+# 49165 8.628 -64.3 0.091 59.8 0.909 48.5 35.2
+#
+# select LORAN ENSEMBLE records with valid format and weights
+{
+ if (NF >= 14 && $6 == "ENSEMBLE" && $9 > 0 && $12 > 0)
+ printf "%5s %9.3f %7.1f %6.3f %7.1f %6.3f %7.1f %7.1f\n", $1, $2, $7*1e9, $9, $10*1e9, $12, $13*1e9, $14*1e9
+}
diff --git a/scripts/stats/etf.S b/scripts/stats/etf.S
new file mode 100755
index 0000000..9b9c68b
--- /dev/null
+++ b/scripts/stats/etf.S
@@ -0,0 +1,15 @@
+options(digits=4)
+file2 <- "etf_summary"
+etf <- scan(file1, list(day=0, sec=0, offset=0, stab=0))
+r <- lsfit(etf$sec, etf$offset)
+count<-length(etf$sec)
+mean<-r$coef[[1]]
+std<-sqrt(var(r$residuals))
+slope<-r$coef[[2]] * 1000
+cat("\n", file=file2 , append=TRUE, fill=FALSE, sep="")
+cat(file1, "\n", file=file2, append=TRUE, fill=FALSE, sep="")
+cat("etf1 ", count, ", T ", mean, " ns, R ", slope, " ps/s, std ", std, " us\n", file=file2, append=TRUE, fill=FALSE, sep="")
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(etf$sec, etf$offset, type="l", xlab=paste("MJD", etf$day, "Time (s)"), ylab="External Offset (ns)", ylim=c(-400, 400))
diff --git a/scripts/stats/etf.awk b/scripts/stats/etf.awk
new file mode 100755
index 0000000..8e6e334
--- /dev/null
+++ b/scripts/stats/etf.awk
@@ -0,0 +1,19 @@
+# program to produce external time/frequence statistics from clockstats files
+#
+# usage: awk -f etf.awk clockstats
+#
+# format of input record
+# 49165 40.473 127.127.10.1 93:178:00:00:39.238 ETF
+# +175.0 +176.8 2.0 +3.729E-11 +1.000E-10 +3.511E-11 4.005E-13 500
+#
+# format of output record (time values in nanoseconds)
+# MJD sec time freq
+# 49165 40.473 175.0 3.729e-11
+#
+# select ETF records with valid format
+{
+ if (NF >= 9 && $5 == "ETF") {
+ printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $6, $9
+ }
+}
+
diff --git a/scripts/stats/itf.S b/scripts/stats/itf.S
new file mode 100755
index 0000000..56c8c8d
--- /dev/null
+++ b/scripts/stats/itf.S
@@ -0,0 +1,5 @@
+itf <- scan(file1, list(day=0, sec=0, offset=0, stab=0))
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(itf$sec, itf$offset, type="l", xlab=paste("MJD", itf$day, "Time (s)"), ylab="Internal Offset (ns)", ylim=c(-400, 400))
diff --git a/scripts/stats/itf.awk b/scripts/stats/itf.awk
new file mode 100755
index 0000000..2b21c5b
--- /dev/null
+++ b/scripts/stats/itf.awk
@@ -0,0 +1,19 @@
+# program to produce intewrnal time/frequence statistics from clockstats files
+#
+# usage: awk -f itf.awk clockstats
+#
+# format of input record
+# 49227 67.846 127.127.10.1 93:240:00:00:51.816 ITF
+# COCO 0 +2.0579E-07 -3.1037E-08 -7.7723E-11 +6.5455E-10 500.00 4.962819
+#
+# format of output record (time values in nanoseconds)
+# MJD sec time freq
+# 49227 67.846 +2.0579E-07 -7.7723E-11
+#
+# select ITF records with valid format
+{
+ if (NF >= 10 && $5 == "ITF") {
+ printf "%5s %9.3f %7.1f %10.3e\n", $1, $2, $8 * 1e9, $10
+ }
+}
+
diff --git a/scripts/stats/loop.S b/scripts/stats/loop.S
new file mode 100755
index 0000000..8e564b6
--- /dev/null
+++ b/scripts/stats/loop.S
@@ -0,0 +1,7 @@
+options(digits=4)
+loop <- scan(file1, list(day=0, sec=0, offset=0, freq=0, tc=0))
+loop$offset <- loop$offset * 1e6
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(loop$sec, loop$offset, type="l", xlab=paste("MJD", loop$day, "Time (s)"), ylab="PLL Offset (us)", ylim=c(-400, 400))
diff --git a/scripts/stats/loop.awk b/scripts/stats/loop.awk
new file mode 100755
index 0000000..bac90db
--- /dev/null
+++ b/scripts/stats/loop.awk
@@ -0,0 +1,45 @@
+# awk program to scan loopstats files and report errors/statistics
+#
+# usage: awk -f loop.awk loopstats
+#
+# format of loopstats record
+# MJD sec time (s) freq (ppm) poll
+# 49235 3.943 0.000016 22.4716 6
+#
+# format of output dataset (time values in milliseconds, freq in ppm)
+# loopstats.19960706
+# loop 1180, 0+/-11.0, rms 2.3, freq -24.45+/-0.045, var 0.019
+#
+BEGIN {
+ loop_tmax = loop_fmax = -1e9
+ loop_tmin = loop_fmin = 1e9
+}
+#
+# scan all records in file
+#
+{
+ if (NF >= 5) {
+ loop_count++
+ if ($3 > loop_tmax)
+ loop_tmax = $3
+ if ($3 < loop_tmin)
+ loop_tmin = $3
+ if ($4 > loop_fmax)
+ loop_fmax = $4
+ if ($4 < loop_fmin)
+ loop_fmin = $4
+ loop_time += $3
+ loop_time_rms += $3 * $3
+ loop_freq += $4
+ loop_freq_rms += $4 * $4
+ }
+} END {
+ if (loop_count > 0) {
+ loop_time /= loop_count
+ loop_time_rms = sqrt(loop_time_rms / loop_count - loop_time * loop_time)
+ loop_freq /= loop_count
+ loop_freq_rms = sqrt(loop_freq_rms / loop_count - loop_freq * loop_freq)
+ printf "loop %d, %.0f+/-%.1f, rms %.1f, freq %.2f+/-%0.3f, var %.3f\n", loop_count, (loop_tmax + loop_tmin) / 2 * 1e6, (loop_tmax - loop_tmin) / 2 * 1e6, loop_time_rms * 1e6, (loop_fmax + loop_fmin) / 2, (loop_fmax - loop_fmin) / 2, loop_freq_rms
+ }
+}
+
diff --git a/scripts/stats/loop_summary b/scripts/stats/loop_summary
new file mode 100755
index 0000000..35479ec
--- /dev/null
+++ b/scripts/stats/loop_summary
@@ -0,0 +1,2 @@
+
+loopstats.[1-9]
diff --git a/scripts/stats/peer.awk b/scripts/stats/peer.awk
new file mode 100755
index 0000000..5fe260e
--- /dev/null
+++ b/scripts/stats/peer.awk
@@ -0,0 +1,68 @@
+# awk program to scan peerstats files and report errors/statistics
+#
+# usage: awk -f peer.awk peerstats
+#
+# format of peerstats record
+# MJD sec ident stat offset (s) delay (s) disp (s)
+# 49235 11.632 128.4.2.7 f414 -0.000041 0.21910 0.00084
+#
+# format of output dataset (time values in milliseconds)
+# peerstats.19960706
+# ident cnt mean rms max delay dist disp
+# ==========================================================================
+# 140.173.112.2 85 -0.509 1.345 4.606 80.417 49.260 1.092
+# 128.4.1.20 1364 0.058 0.364 4.465 3.712 10.540 1.101
+# 140.173.16.1 1415 -0.172 0.185 1.736 3.145 5.020 0.312
+#...
+#
+BEGIN {
+ n = 0
+ MAXDISTANCE = 1.0
+}
+#
+# scan all records in file
+#
+# we toss out all distances greater than one second on the assumption the
+# peer is in initial acquisition
+#
+{
+ if (NF >= 7 && ($7 + $6 / 2) < MAXDISTANCE) {
+ i = n
+ for (j = 0; j < n; j++) {
+ if ($3 == peer_ident[j])
+ i = j
+ }
+ if (i == n) {
+ peer_ident[i] = $3
+ peer_tmax[i] = peer_dist[i] = -1e9
+ peer_tmin[i] = 1e9
+ n++
+ }
+ peer_count[i]++
+ if ($5 > peer_tmax[i])
+ peer_tmax[i] = $5
+ if ($5 < peer_tmin[i])
+ peer_tmin[i] = $5
+ dist = $7 + $6 / 2
+ if (dist > peer_dist[i])
+ peer_dist[i] = dist
+ peer_time[i] += $5
+ peer_time_rms[i] += $5 * $5
+ peer_delay[i] += $6
+ peer_disp[i] += $7
+ }
+} END {
+ printf " ident cnt mean rms max delay dist disp\n"
+ printf "==========================================================================\n"
+ for (i = 0; i < n; i++) {
+ peer_time[i] /= peer_count[i]
+ peer_time_rms[i] = sqrt(peer_time_rms[i] / peer_count[i] - peer_time[i] * peer_time[i])
+ peer_delay[i] /= peer_count[i]
+ peer_disp[i] /= peer_count[i]
+ peer_tmax[i] = peer_tmax[i] - peer_time[i]
+ peer_tmin[i] = peer_time[i] - peer_tmin[i]
+ if (peer_tmin[i] > peer_tmax[i])
+ peer_tmax[i] = peer_tmin[i]
+ printf "%-15s%5d%9.3f%9.3f%9.3f%9.3f%9.3f%9.3f\n", peer_ident[i], peer_count[i], peer_time[i] * 1e3, peer_time_rms[i] * 1e3, peer_tmax[i] * 1e3, peer_delay[i] * 1e3, peer_dist[i] * 1e3, peer_disp[i] * 1e3
+ }
+}
diff --git a/scripts/stats/psummary.awk b/scripts/stats/psummary.awk
new file mode 100755
index 0000000..ec06b0c
--- /dev/null
+++ b/scripts/stats/psummary.awk
@@ -0,0 +1,82 @@
+# program to scan peer_summary file and produce summary of daily summaries
+#
+# usage: awk -f psummary.awk peer_summary
+#
+# format of input records
+# peerstats.19960706
+# ident cnt mean rms max delay dist disp
+# ==========================================================================
+# 140.173.112.2 85 -0.509 1.345 4.606 80.417 49.260 1.092
+# 128.4.1.20 1364 0.058 0.364 4.465 3.712 10.540 1.101
+# ...
+#
+# format of output records (actual data from rackety.udel.edu)
+# host days mean rms max >1 >5 >10 >50
+# ==================================================================
+# 127.127.22.1 1090 0.001 0.401 99.800 19 14 13 10
+# 127.0.0.1 1188 0.060 1.622 105.004 78 65 51 32
+# 127.127.4.1 586 0.000 0.000 0.000 0 0 0 0
+# 140.173.64.1 975 -0.010 2.552 257.595 399 192 114 8
+# 128.175.1.3 1121 0.447 8.637 204.123 479 460 397 147
+# 140.173.16.1 1106 0.027 1.014 267.857 242 38 31 23
+# 128.4.1.4 1119 0.023 1.037 267.748 223 41 34 23
+# 128.4.1.2 850 1.202 1.654 267.704 196 53 45 34
+# 128.4.1.20 1101 0.088 1.139 268.322 430 111 83 16
+# 140.173.32.1 979 -0.949 2.344 257.671 396 217 136 7
+# 140.173.112.2 1066 0.040 2.111 152.969 442 315 152 16
+# 140.173.80.1 1059 0.019 1.858 87.690 438 348 150 9
+# 140.173.96.1 1015 0.110 2.007 266.744 399 314 170 17
+# 140.173.128.1 1103 -0.002 2.600 257.672 465 262 132 13
+# 140.222.135.1 347 -4.626 8.804 196.394 135 135 134 95
+# 140.173.128.2 1081 -0.046 2.967 261.448 463 342 172 17
+# 140.222.141.1 354 0.820 8.809 195.333 142 141 139 100
+# 140.173.144.2 1058 -0.107 2.805 270.498 448 341 163 17
+# 140.222.134.1 354 -0.056 8.479 172.458 142 141 141 100
+# 140.222.144.1 415 -1.456 9.964 191.684 161 161 161 123
+# 140.222.136.1 234 0.902 7.707 182.431 62 62 62 48
+# 128.175.1.1 774 0.890 4.838 266.799 358 291 200 83
+# 127.127.10.1 1086 -0.002 1.462 231.128 240 239 60 57
+# 140.173.48.2 576 0.016 4.092 350.512 213 126 88 16
+# 128.4.1.11 3 0.000 0.000 0.000 0 0 0 0
+# 128.4.1.26 386 -1.363 20.251 341.284 164 164 161 132
+#
+# select table beginning with "ident"
+{
+ if (NF < 8 || $1 == "ident")
+ continue
+ i = n
+ for (j = 0; j < n; j++) {
+ if ($1 == peer_ident[j])
+ i = j
+ }
+ if (i == n) {
+ peer_ident[i] = $1
+ n++
+ }
+ peer_count[i]++
+ if (($7 - $6 / 2) < 400) {
+ peer_count[i]++
+ peer_mean[i] += $3
+ peer_var[i] += $4 * $4
+ if ($5 > peer_max[i])
+ peer_max[i] = $5
+ if ($5 > 1)
+ peer_1[i]++
+ if ($5 > 5)
+ peer_2[i]++
+ if ($5 > 10)
+ peer_3[i]++
+ if ($5 > 50)
+ peer_4[i]++
+ }
+} END {
+ printf " host days mean rms max >1 >5 >10 >50\n"
+ printf "==================================================================\n"
+ for (i = 0; i < n; i++) {
+ if (peer_count[i] <= 0)
+ continue
+ peer_mean[i] /= peer_count[i]
+ peer_var[i] = sqrt(peer_var[i] / peer_count[i])
+ printf "%-15s%4d%10.3f%10.3f%10.3f%4d%4d%4d%4d\n", peer_ident[i], peer_count[i], peer_mean[i], peer_var[i], peer_max[i], peer_1[i], peer_2[i], peer_3[i], peer_4[i]
+ }
+}
diff --git a/scripts/stats/summary.sh b/scripts/stats/summary.sh
new file mode 100755
index 0000000..dffdb0b
--- /dev/null
+++ b/scripts/stats/summary.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# Script to summarize ipeerstats, loopstats and clockstats files
+#
+# This script can be run from a cron job once per day, week or month. It
+# runs the file-specific summary script and appends the summary data to
+# designated files.
+#
+DATE=`date +20%y%m%d`
+S=/usr/local/bin/S
+SIN=S.in
+SOUT=S.out
+LOOP=loop_summary
+PEER=peer_summary
+CLOCK=clock_summary
+
+rm -f $SIN $SOUT
+
+#
+# Summarize loopstats files
+#
+for f in loopstats.[12][0-9][0-9][0-9][0-1][0-9][0-3][0-9]; do
+ d=`echo $f | cut -f2 -d.`
+ if [ -f $f ] && [ $DATE != $d ]; then
+ echo " " >>$LOOP
+ echo $f >>$LOOP
+ awk -f loop.awk $f >>$LOOP
+ if [ -f $S ]; then
+ echo "file1<-"\"${f}\" >>$SIN
+ echo "source("\""loop.S"\"")" >>$SIN
+ echo "unix("\""rm ${f}"\"")" >>$SIN
+ else
+ rm -f $f
+ fi
+ fi
+done
+
+#
+# Summarize peerstats files
+#
+for f in peerstats.199[4-9][0-1][0-9][0-3][0-9]; do
+ d=`echo $f | cut -f2 -d.`
+ if [ -f $f ] && [ $DATE != $d ]; then
+ echo " " >>$PEER
+ echo $f >>$PEER
+ awk -f peer.awk $f >>$PEER
+ rm -f $f
+ fi
+done
+
+#
+# Summarize clockstats files
+#
+for f in clockstats.199[4-9][0-1][0-9][0-3][0-9]; do
+ d=`echo $f | cut -f2 -d.`
+ if [ -f $f ] && [ $DATE != $d ]; then
+ echo " " >>$CLOCK
+ echo $f >>$CLOCK
+ awk -f clock.awk $f >>$CLOCK
+ if [ -f /dev/gps[0-9] ]; then
+ awk -f itf.awk $f >itf.$d
+ awk -f etf.awk $f >etf.$d
+ awk -f ensemble.awk $f >ensemble.$d
+ awk -f tdata.awk $f >tdata.$d
+ fi
+ rm -f $f
+ fi
+done
+
+#
+# Process clockstat files with S and generate PostScript plots
+#
+for f in itf etf ensemble tdata; do
+ for d in ${f}.199[4-9][0-1][0-9][0-3][0-9]; do
+ if [ -f $d ]; then
+ if [ -f $S ]; then
+ echo "file1<-"\"${d}\" >>$SIN
+ echo "source("\"${f}.S\"")" >>$SIN
+ echo "unix("\""rm ${d}"\"")" >>$SIN
+ else
+ rm -f $d
+ fi
+ fi
+ done
+done
+if [ -f $SIN ]; then
+ $S BATCH $SIN $SOUT
+fi
diff --git a/scripts/stats/tdata.S b/scripts/stats/tdata.S
new file mode 100755
index 0000000..f360a24
--- /dev/null
+++ b/scripts/stats/tdata.S
@@ -0,0 +1,5 @@
+tdata <- scan(file1, list(day=0, sec=0, m=0, w=0, x=0, y=0, z=0))
+str <- paste("eps/", file1, ".eps", sep="")
+postscript(str, , , , 5, pointsize=18)
+par(mgp=c(1, 0, 0), tck=0.03, mar=c(2, 2, 1, 1))
+plot(tdata$sec, tdata$m, type="l", xlab=paste("MJD", tdata$day, "Time (s)"), ylab="LORAN-M SNR (dB)")
diff --git a/scripts/stats/tdata.awk b/scripts/stats/tdata.awk
new file mode 100755
index 0000000..5be9c04
--- /dev/null
+++ b/scripts/stats/tdata.awk
@@ -0,0 +1,45 @@
+# program to produce loran tdata statistics from clockstats files
+#
+# usage: awk -f tdata.awk clockstats
+#
+# format of input record (missing replaced by -40.0)
+# 49228 36.852 127.127.10.1 93:241:00:00:20.812 LORAN TDATA
+# M OK 0 0 1169.14 -7.4 3.16E-07 .424
+# W CV 0 0 3329.30 -16.4 1.81E-06
+# X OK 0 0 1737.19 -10.5 3.44E-07 .358
+# Y OK 0 0 2182.07 -9.0 4.41E-07 .218
+#
+# format of output record (time in nanoseconds, signal values in dB)
+# MJD sec time M W X Y Z
+# 49228 36.852 175.0 -7.4 -16.4 -10.5 -9.0
+#
+# select LORAN TDATA records with valid format
+{
+ if (NF >= 7 && $6 == "TDATA") {
+ m = w = x = y = z = -40.0
+ for (i = 7; i < NF - 5; i++) {
+ if ($i == "M" && $(i+1) == "OK") {
+ i += 5
+ m = $i
+ }
+ else if ($i == "W" && $(i+1) == "OK") {
+ i += 5
+ w = $i
+ }
+ else if ($i == "X" && $(i+1) == "OK") {
+ i += 5
+ x = $i
+ }
+ else if ($i == "Y" && $(i+1) == "OK") {
+ i += 5
+ y = $i
+ }
+ else if ($i == "Z" && $(i+1) == "OK") {
+ i += 5
+ z = $i
+ }
+ }
+ printf "%5s %9.3f %6.1f %6.1f %6.1f %6.1f %6.1f\n", $1, $2, m, w, x, y, z
+ }
+}
+
diff --git a/scripts/summary-opts b/scripts/summary-opts
new file mode 100644
index 0000000..b8b5399
--- /dev/null
+++ b/scripts/summary-opts
@@ -0,0 +1,69 @@
+# EDIT THIS FILE WITH CAUTION (summary-opts)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:52:43 AM by AutoGen 5.18.5pre4
+# From the definitions summary-opts.def
+# and the template file perlopt
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ 'directory' => '/var/log/ntp',
+ 'end-date' => '',
+ 'output-directory' => '/tmp',
+ 'peer-dist-limit' => '400',
+ 'skip-time-steps' => '3600',
+ 'start-date' => '19700101',
+ 'help' => '', 'more-help' => ''
+ };
+ my $argument = '';
+ my $ret = GetOptionsFromArray($args, $opts, (
+ 'directory=s', 'end-date=i', 'output-directory=s',
+ 'peer-dist-limit=f', 'skip-time-steps=f', 'start-date=i',
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+summary - compute various stastics from NTP stat files - Ver. 4.2.7p482
+USAGE: summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
+
+ --directory=str Directory containing stat files
+ --end-date=num End date
+ --output-directory=str Output directory
+ --peer-dist-limit=float Peer dist limit
+ --skip-time-steps=float Ignore time offsets larger that this
+ --start-date=num Start date
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/scripts/summary-opts.def b/scripts/summary-opts.def
new file mode 100644
index 0000000..82c31eb
--- /dev/null
+++ b/scripts/summary-opts.def
@@ -0,0 +1,82 @@
+/* -*- Mode: Text -*- */
+AutoGen Definitions perlopt;
+
+#include autogen-version.def
+
+prog-name = 'summary';
+prog-title = 'compute various stastics from NTP stat files';
+package = ntp;
+#include version.def
+
+long-opts;
+gnu-usage;
+
+flag = {
+ name = directory;
+ arg-type = string;
+ arg-default = '/var/log/ntp';
+ descrip = 'Directory containing stat files';
+ doc = <<- _EndOfDoc_
+ The directory where @code{ntpd} will search for .stat files generated
+ by @code{ntpd}.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = end-date;
+ arg-type = number;
+ descrip = 'End date';
+ doc = <<- _EndOfDoc_
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use @code{date -u +%Y%m%d})
+ to get the timestamp.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = output-directory;
+ arg-type = str;
+ arg-default = '/tmp';
+ descrip = 'Output directory';
+ doc = <<- _EndOfDoc_
+ The output directory @code{summary} will write all output files to.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = peer-dist-limit;
+ arg-type = string;
+ arg-name = float;
+ arg-default = 400;
+ descrip = 'Peer dist limit';
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = skip-time-steps;
+ arg-type = string;
+ arg-name = float;
+ arg-default = 3600;
+ descrip = 'Ignore time offsets larger that this';
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = start-date;
+ arg-type = num;
+ arg-default = 19700101;
+ descrip = 'Start date';
+ doc = <<- _EndOfDoc_
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+ _EndOfDoc_;
+};
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'texi';
+ ds-text = <<- _EndOfDoc
+ _EndOfDoc;
+};
diff --git a/scripts/summary.1summaryman b/scripts/summary.1summaryman
new file mode 100644
index 0000000..2b10936
--- /dev/null
+++ b/scripts/summary.1summaryman
@@ -0,0 +1,123 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH summary 1summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-hqaqcI/ag-uqaybI)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:52 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]summary\fP
+\- compute various stastics from NTP stat files
+.SH SYNOPSIS
+\f\*[B-Font]summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+.sp
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Directory containing stat files.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.TP
+.NOP \f\*[B-Font]\-\-end\-date\f[]=\f\*[I-Font]number\f[]
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.TP
+.NOP \f\*[B-Font]\-\-output\-directory\f[]=\f\*[I-Font]str\f[]
+Output directory.
+The default
+\f\*[I-Font]str\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.TP
+.NOP \f\*[B-Font]\-\-peer\-dist\-limit\f[]=\f\*[I-Font]float\f[]
+Peer dist limit.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 400
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-skip\-time\-steps\f[]=\f\*[I-Font]float\f[]
+Ignore time offsets larger that this.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 3600
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-start\-date\f[]=\f\*[I-Font]num\f[]
+Start date.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]num\f[]
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.1summarymdoc b/scripts/summary.1summarymdoc
new file mode 100644
index 0000000..6ec7cc2
--- /dev/null
+++ b/scripts/summary.1summarymdoc
@@ -0,0 +1,98 @@
+.Dd December 2 2014
+.Dt SUMMARY 1summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:54 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm summary
+.Nd compute various stastics from NTP stat files
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.sp
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Directory containing stat files.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.It Fl \-end\-date Ns = Ns Ar number
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.It Fl \-output\-directory Ns = Ns Ar str
+Output directory.
+The default
+.Ar str
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.It Fl \-peer\-dist\-limit Ns = Ns Ar float
+Peer dist limit.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 400
+.sp
+.It Fl \-skip\-time\-steps Ns = Ns Ar float
+Ignore time offsets larger that this.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 3600
+.sp
+.It Fl \-start\-date Ns = Ns Ar num
+Start date.
+This option takes an integer number as its argument.
+The default
+.Ar num
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.html b/scripts/summary.html
new file mode 100644
index 0000000..31cc825
--- /dev/null
+++ b/scripts/summary.html
@@ -0,0 +1,182 @@
+<html lang="en">
+<head>
+<title>Summary User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Summary User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Summary User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-Description">summary Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<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.7p482 of <code>summary</code>.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Summary User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#summary-Description">summary Description</a>: Description
+<li><a accesskey="2" href="#summary-Invocation">summary Invocation</a>: Invoking summary
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="summary-Invocation"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-Description">summary Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<h3 class="section">Invoking summary</h3>
+
+<p><a name="index-summary-1"></a><a name="index-compute-various-stastics-from-NTP-stat-files-2"></a>
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>summary</code> program.
+
+<ul class="menu">
+<li><a accesskey="1" href="#summary-usage">summary usage</a>: summary help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#summary-directory">summary directory</a>: directory option
+<li><a accesskey="3" href="#summary-end_002ddate">summary end-date</a>: end-date option
+<li><a accesskey="4" href="#summary-output_002ddirectory">summary output-directory</a>: output-directory option
+<li><a accesskey="5" href="#summary-start_002ddate">summary start-date</a>: start-date option
+<li><a accesskey="6" href="#summary-exit-status">summary exit status</a>: exit status
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="summary-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-directory">summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">summary help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-summary-help-3"></a>
+This is the automatically generated usage text for summary.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.7p482
+USAGE: summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
+
+ --directory=str Directory containing stat files
+ --end-date=num End date
+ --output-directory=str Output directory
+ --peer-dist-limit=float Peer dist limit
+ --skip-time-steps=float Ignore time offsets larger that this
+ --start-date=num Start date
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage text through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+</pre>
+ <div class="node">
+<p><hr>
+<a name="summary-directory"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-end_002ddate">summary end-date</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-usage">summary usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">directory option</h4>
+
+<p><a name="index-summary_002ddirectory-4"></a>
+This is the &ldquo;directory containing stat files&rdquo; option.
+This option takes a string argument.
+ The directory where <code>ntpd</code> will search for .stat files generated
+ by <code>ntpd</code>.
+<div class="node">
+<p><hr>
+<a name="summary-end_002ddate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-output_002ddirectory">summary output-directory</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-directory">summary directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">end-date option</h4>
+
+<p><a name="index-summary_002dend_002ddate-5"></a>
+This is the &ldquo;end date&rdquo; option.
+This option takes a number argument.
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use <code>date -u +%Y%m%d</code>)
+ to get the timestamp.
+<div class="node">
+<p><hr>
+<a name="summary-output_002ddirectory"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-start_002ddate">summary start-date</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-end_002ddate">summary end-date</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">output-directory option</h4>
+
+<p><a name="index-summary_002doutput_002ddirectory-6"></a>
+This is the &ldquo;output directory&rdquo; option.
+This option takes a str argument.
+ The output directory <code>summary</code> will write all output files to.
+<div class="node">
+<p><hr>
+<a name="summary-start_002ddate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#summary-exit-status">summary exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-output_002ddirectory">summary output-directory</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">start-date option</h4>
+
+<p><a name="index-summary_002dstart_002ddate-7"></a>
+This is the &ldquo;start date&rdquo; option.
+This option takes a num argument.
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+<div class="node">
+<p><hr>
+<a name="summary-exit-status"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#summary-start_002ddate">summary start-date</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#summary-Invocation">summary Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">summary exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+</dl>
+
+</body></html>
+
diff --git a/scripts/summary.in b/scripts/summary.in
new file mode 100644
index 0000000..a99f8df
--- /dev/null
+++ b/scripts/summary.in
@@ -0,0 +1,369 @@
+#! @PATH_PERL@ -w
+# $Id$
+# Perl version of (summary.sh, loop.awk, peer.awk):
+# Create summaries from xntpd's loop and peer statistics.
+#
+# Copyright (c) 1997, 1999 by Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+package summary;
+use 5.006_000;
+use strict;
+
+my ($log_date_pattern, $statsdir, $outputdir, $skip_time_steps, $startdate,
+ $enddate, $peer_dist_limit);
+
+exit run(@ARGV) unless caller;
+
+sub run {
+ my $opts;
+ if (!processOptions(\@ARGV, $opts)) {
+ usage(1);
+ };
+
+ $log_date_pattern = '[12]\d{3}[01]\d[0-3]\d';
+ $statsdir = $opts->{directory};
+ $outputdir = $opts->{'output-directory'};
+ $skip_time_steps = $opts->{'skip-time-steps'};
+ $startdate = $opts->{'start-date'};
+ $enddate = $opts->{'end-date'};
+ if (!$enddate){
+ $enddate = `date -u +%Y%m%d`;
+ chomp $enddate;
+ --$enddate;
+ }
+ $peer_dist_limit = $opts->{'peer-dist-limit'};
+
+ # check possibly current values of options
+ die "$statsdir: no such directory" unless (-d $statsdir);
+ die "$outputdir: no such directory" unless (-d $outputdir);
+ die "$skip_time_steps: skip-time-steps must be positive"
+ unless ($skip_time_steps >= 0.0);
+ die "$startdate: invalid start date|$`|$&|$'"
+ unless ($startdate =~ m/.*$log_date_pattern$/);
+ die "$enddate: invalid end date"
+ unless ($enddate =~ m/.*$log_date_pattern$/);
+
+ $skip_time_steps = 0.128 if ($skip_time_steps == 0);
+
+ my $loop_summary="$outputdir/loop_summary";
+ my $peer_summary="$outputdir/peer_summary";
+ my $clock_summary="$outputdir/clock_summary";
+ my (@loopfiles, @peerfiles, @clockfiles);
+
+ print STDERR "Creating summaries from $statsdir ($startdate to $enddate)\n";
+
+ opendir SDIR, $statsdir or die "directory ${statsdir}: $!";
+ rewinddir SDIR;
+ @loopfiles=sort grep /loop.*$log_date_pattern/, readdir SDIR;
+ rewinddir SDIR;
+ @peerfiles=sort grep /peer.*$log_date_pattern/, readdir SDIR;
+ rewinddir SDIR;
+ @clockfiles=sort grep /clock.*$log_date_pattern/, readdir SDIR;
+ closedir SDIR;
+
+ # remove old summary files
+ for ($loop_summary, $peer_summary, $clock_summary) { unlink $_ if -f $_ };
+
+ my $date;
+ for (@loopfiles) {
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
+ if ($date ge $startdate && $date le $enddate) {
+ do_loop($statsdir, $_, $loop_summary);
+ }
+ }
+
+ for (@peerfiles) {
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
+ if ($date ge $startdate && $date le $enddate) {
+ do_peer($statsdir, $_, $peer_summary);
+ }
+ }
+
+ for (@clockfiles) {
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
+ if ($date ge $startdate && $date le $enddate) {
+ do_clock($statsdir, $_, $clock_summary);
+ }
+ }
+
+ print STDERR "Creating peer summary with limit $peer_dist_limit\n";
+ peer_summary($peer_summary) if (-f $peer_summary);
+}
+
+sub min
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ < $result) } @rest;
+ return($result);
+}
+
+sub max
+{
+ my ($result, @rest) = @_;
+ map { $result = $_ if ($_ > $result) } @rest;
+ return($result);
+}
+
+# calculate mean, range, and standard deviation for offset and frequency
+sub do_loop
+{
+ my ($directory, $fname, $out_file) = @_;
+ print "$directory/$fname\n";
+ open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
+ open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
+ print OUTPUT "$fname\n";
+ my ($loop_tmax, $loop_fmax) = (-1e9, -1e9);
+ my ($loop_tmin, $loop_fmin) = (1e9, 1e9);
+ my ($loop_time_rms, $loop_freq_rms) = (0, 0);
+ my $loop_count = 0;
+ my $loop_time = 0;
+ my $loop_freq = 0;
+ my ($freq, $offs);
+ my @Fld;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ next if ($#Fld < 4);
+#NTPv3: 50529 74356.259 -0.000112 16.1230 8
+#NTPv3: day, sec.msec, offset, drift_comp, sys_poll
+#NTPv4: 51333 54734.582 0.000001648 16.981964 0.000001094 0.020938 6
+#NTPv4: day, sec.msec, offset, drift_comp, sys_error, clock_stabil, sys_poll
+ if ($Fld[2] > $skip_time_steps || $Fld[2] < -$skip_time_steps) {
+ warn "ignoring loop offset $Fld[2] (file $fname, line $.)\n";
+ next
+ }
+ $loop_count++;
+ ($offs, $freq) = ($Fld[2], $Fld[3]);
+ $loop_tmax = max($loop_tmax, $offs);
+ $loop_tmin = min($loop_tmin, $offs);
+ $loop_fmax = max($loop_fmax, $freq);
+ $loop_fmin = min($loop_fmin, $freq);
+ $loop_time += $offs;
+ $loop_time_rms += $offs * $offs;
+ $loop_freq += $freq;
+ $loop_freq_rms += $freq * $freq;
+ }
+ close INPUT;
+ if ($loop_count > 1) {
+ $loop_time /= $loop_count;
+ $loop_time_rms = $loop_time_rms / $loop_count - $loop_time * $loop_time;
+ if ($loop_time_rms < 0) {
+ warn "loop_time_rms: $loop_time_rms < 0";
+ $loop_time_rms = 0;
+ }
+ $loop_time_rms = sqrt($loop_time_rms);
+ $loop_freq /= $loop_count;
+ $loop_freq_rms = $loop_freq_rms / $loop_count - $loop_freq * $loop_freq;
+ if ($loop_freq_rms < 0) {
+ warn "loop_freq_rms: $loop_freq_rms < 0";
+ $loop_freq_rms = 0;
+ }
+ $loop_freq_rms = sqrt($loop_freq_rms);
+ printf OUTPUT
+ ("loop %d, %.0f+/-%.1f, rms %.1f, freq %.2f+/-%0.3f, var %.3f\n",
+ $loop_count, ($loop_tmax + $loop_tmin) / 2 * 1e6,
+ ($loop_tmax - $loop_tmin) / 2 * 1e6, $loop_time_rms * 1e6,
+ ($loop_fmax + $loop_fmin) / 2, ($loop_fmax - $loop_fmin) / 2,
+ $loop_freq_rms);
+ }
+ else {
+ warn "no valid lines in $directory/$fname";
+ }
+ close OUTPUT
+}
+
+# calculate mean, standard deviation, maximum offset, mean dispersion,
+# and maximum distance for each peer
+sub do_peer
+{
+ my ($directory, $fname, $out_file) = @_;
+ print "$directory/$fname\n";
+ open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
+ open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
+ print OUTPUT "$fname\n";
+# we toss out all distances greater than one second on the assumption the
+# peer is in initial acquisition
+ my ($n, $MAXDISTANCE) = (0, 1.0);
+ my %peer_time;
+ my %peer_time_rms;
+ my %peer_count;
+ my %peer_delay;
+ my %peer_disp;
+ my %peer_dist;
+ my %peer_ident;
+ my %peer_tmin;
+ my %peer_tmax;
+ my @Fld;
+ my ($i, $j);
+ my ($dist, $offs);
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ next if ($#Fld < 6);
+#NTPv3: 50529 83316.249 127.127.8.1 9674 0.008628 0.00000 0.00700
+#NTPv3: day, sec.msec, addr, status, offset, delay, dispersion
+#NTPv4: 51333 56042.037 127.127.8.1 94f5 -0.000014657 0.000000000 0.000000000 0.000013214
+#NTPv4: day, sec.msec, addr, status, offset, delay, dispersion, skew
+
+ $dist = $Fld[6] + $Fld[5] / 2;
+ next if ($dist > $MAXDISTANCE);
+ $offs = $Fld[4];
+ if ($offs > $skip_time_steps || $offs < -$skip_time_steps) {
+ warn "ignoring peer offset $offs (file $fname, line $.)\n";
+ next
+ }
+ $i = $n;
+ for ($j = 0; $j < $n; $j++) {
+ if ($Fld[2] eq $peer_ident{$j}) {
+ $i = $j; # peer found
+ last;
+ }
+ }
+ if ($i == $n) { # add new peer
+ $peer_ident{$i} = $Fld[2];
+ $peer_tmax{$i} = $peer_dist{$i} = -1e9;
+ $peer_tmin{$i} = 1e9;
+ $peer_time{$i} = $peer_time_rms{$i} = 0;
+ $peer_delay{$i} = $peer_disp{$i} = 0;
+ $peer_count{$i} = 0;
+ $n++;
+ }
+ $peer_count{$i}++;
+ $peer_tmax{$i} = max($peer_tmax{$i}, $offs);
+ $peer_tmin{$i} = min($peer_tmin{$i}, $offs);
+ $peer_dist{$i} = max($peer_dist{$i}, $dist);
+ $peer_time{$i} += $offs;
+ $peer_time_rms{$i} += $offs * $offs;
+ $peer_delay{$i} += $Fld[5];
+ $peer_disp{$i} += $Fld[6];
+ }
+ close INPUT;
+ print OUTPUT
+" ident cnt mean rms max delay dist disp\n";
+ print OUTPUT
+"==========================================================================\n";
+ my @lines = ();
+ for ($i = 0; $i < $n; $i++) {
+ next if $peer_count{$i} < 2;
+ $peer_time{$i} /= $peer_count{$i};
+ eval { $peer_time_rms{$i} = sqrt($peer_time_rms{$i} / $peer_count{$i} -
+ $peer_time{$i} * $peer_time{$i}); };
+ $peer_time_rms{$i} = 0, warn $@ if $@;
+ $peer_delay{$i} /= $peer_count{$i};
+ $peer_disp{$i} /= $peer_count{$i};
+ $peer_tmax{$i} = $peer_tmax{$i} - $peer_time{$i};
+ $peer_tmin{$i} = $peer_time{$i} - $peer_tmin{$i};
+ if ($peer_tmin{$i} > $peer_tmax{$i}) { # can this happen at all?
+ $peer_tmax{$i} = $peer_tmin{$i};
+ }
+ push @lines, sprintf
+ "%-15s %4d %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n",
+ $peer_ident{$i}, $peer_count{$i}, $peer_time{$i} * 1e3,
+ $peer_time_rms{$i} * 1e3, $peer_tmax{$i} * 1e3,
+ $peer_delay{$i} * 1e3, $peer_dist{$i} * 1e3, $peer_disp{$i} * 1e3;
+ }
+ print OUTPUT sort @lines;
+ close OUTPUT;
+}
+
+sub do_clock
+{
+ my ($directory, $fname, $out_file) = @_;
+ print "$directory/$fname\n";
+ open INPUT, "$directory/$fname";
+ open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
+ print OUTPUT "$fname\n";
+ close INPUT;
+ close OUTPUT;
+}
+
+sub peer_summary
+{
+ my $in_file = shift;
+ my ($i, $j, $n);
+ my (%peer_ident, %peer_count, %peer_mean, %peer_var, %peer_max);
+ my (%peer_1, %peer_2, %peer_3, %peer_4);
+ my $dist;
+ my $max;
+ open INPUT, "<$in_file" or die "can't open $in_file: $!";
+ my @Fld;
+ $n = 0;
+ while (<INPUT>) {
+ chop; # strip record separator
+ @Fld = split;
+ next if ($#Fld < 7 || $Fld[0] eq 'ident');
+ $i = $n;
+ for ($j = 0; $j < $n; $j++) {
+ if ($Fld[0] eq $peer_ident{$j}) {
+ $i = $j;
+ last; # peer found
+ }
+ }
+ if ($i == $n) { # add new peer
+ $peer_count{$i} = $peer_mean{$i} = $peer_var{$i} = 0;
+ $peer_max{$i} = 0;
+ $peer_1{$i} = $peer_2{$i} = $peer_3{$i} = $peer_4{$i} = 0;
+ $peer_ident{$i} = $Fld[0];
+ ++$n;
+ }
+ $dist = $Fld[6] - $Fld[5] / 2;
+ if ($dist < $peer_dist_limit) {
+ $peer_count{$i}++;
+ $peer_mean{$i} += $Fld[2];
+ $peer_var{$i} += $Fld[3] * $Fld[3];
+ $max = $Fld[4];
+ $peer_max{$i} = max($peer_max{$i}, $max);
+ if ($max > 1) {
+ $peer_1{$i}++;
+ if ($max > 5) {
+ $peer_2{$i}++;
+ if ($max > 10) {
+ $peer_3{$i}++;
+ if ($max > 50) {
+ $peer_4{$i}++;
+ }
+ }
+ }
+ }
+ }
+ else {
+ warn "dist exceeds limit: $dist (file $in_file, line $.)\n";
+ }
+ }
+ close INPUT;
+ my @lines = ();
+ print
+ " host days mean rms max >1 >5 >10 >50\n";
+ print
+ "==================================================================\n";
+ for ($i = 0; $i < $n; $i++) {
+ next if ($peer_count{$i} < 2);
+ $peer_mean{$i} /= $peer_count{$i};
+ eval { $peer_var{$i} = sqrt($peer_var{$i} / $peer_count{$i} -
+ $peer_mean{$i} * $peer_mean{$i}); };
+ $peer_var{$i} = 0, warn $@ if $@;
+ push @lines, sprintf
+ "%-15s %3d %9.3f% 9.3f %9.3f %3d %3d %3d %3d\n",
+ $peer_ident{$i}, $peer_count{$i}, $peer_mean{$i}, $peer_var{$i},
+ $peer_max{$i}, $peer_1{$i}, $peer_2{$i}, $peer_3{$i}, $peer_4{$i};
+ }
+ print sort @lines;
+}
+
+@summary_opts@
+
+1;
+__END__
diff --git a/scripts/summary.man.in b/scripts/summary.man.in
new file mode 100644
index 0000000..2b10936
--- /dev/null
+++ b/scripts/summary.man.in
@@ -0,0 +1,123 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH summary 1summaryman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-hqaqcI/ag-uqaybI)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:52 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]summary\fP
+\- compute various stastics from NTP stat files
+.SH SYNOPSIS
+\f\*[B-Font]summary\fP
+[\f\*[B-Font]\-\-option-name\f[]]
+[\f\*[B-Font]\-\-option-name\f[] \f\*[I-Font]value\f[]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+.sp
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-\-directory\f[]=\f\*[I-Font]string\f[]
+Directory containing stat files.
+The default
+\f\*[I-Font]string\f[]
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.TP
+.NOP \f\*[B-Font]\-\-end\-date\f[]=\f\*[I-Font]number\f[]
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.TP
+.NOP \f\*[B-Font]\-\-output\-directory\f[]=\f\*[I-Font]str\f[]
+Output directory.
+The default
+\f\*[I-Font]str\f[]
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.TP
+.NOP \f\*[B-Font]\-\-peer\-dist\-limit\f[]=\f\*[I-Font]float\f[]
+Peer dist limit.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 400
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-skip\-time\-steps\f[]=\f\*[I-Font]float\f[]
+Ignore time offsets larger that this.
+The default
+\f\*[I-Font]float\f[]
+for this option is:
+.ti +4
+ 3600
+.sp
+.TP
+.NOP \f\*[B-Font]\-\-start\-date\f[]=\f\*[I-Font]num\f[]
+Start date.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]num\f[]
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.TP
+.NOP \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.mdoc.in b/scripts/summary.mdoc.in
new file mode 100644
index 0000000..6ec7cc2
--- /dev/null
+++ b/scripts/summary.mdoc.in
@@ -0,0 +1,98 @@
+.Dd December 2 2014
+.Dt SUMMARY 1summarymdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:52:54 AM by AutoGen 5.18.5pre4
+.\" From the definitions summary-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm summary
+.Nd compute various stastics from NTP stat files
+.Sh SYNOPSIS
+.Nm
+.Op Fl \-option\-name
+.Op Fl \-option\-name Ar value
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+.sp
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl \-directory Ns = Ns Ar string
+Directory containing stat files.
+The default
+.Ar string
+for this option is:
+.ti +4
+ /var/log/ntp
+.sp
+ The directory where \fBntpd\fP will search for .stat files generated
+ by \fBntpd\fP.
+.It Fl \-end\-date Ns = Ns Ar number
+End date.
+This option takes an integer number as its argument.
+.sp
+ Process all files with the date suffix less or equal to value of this
+ option. Defaults to today minus one day (Use \fBdate \-u +%Y%m%d\fP)
+ to get the timestamp.
+.It Fl \-output\-directory Ns = Ns Ar str
+Output directory.
+The default
+.Ar str
+for this option is:
+.ti +4
+ /tmp
+.sp
+ The output directory \fBsummary\fP will write all output files to.
+.It Fl \-peer\-dist\-limit Ns = Ns Ar float
+Peer dist limit.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 400
+.sp
+.It Fl \-skip\-time\-steps Ns = Ns Ar float
+Ignore time offsets larger that this.
+The default
+.Ar float
+for this option is:
+.ti +4
+ 3600
+.sp
+.It Fl \-start\-date Ns = Ns Ar num
+Start date.
+This option takes an integer number as its argument.
+The default
+.Ar num
+for this option is:
+.ti +4
+ 19700101
+.sp
+ Process all files with the date suffix more or equal to value of
+ this option. Defaults to 197000101.
+.It Fl \-help
+Display usage information and exit.
+.It Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBsummary\fP
+option definitions.
diff --git a/scripts/summary.texi b/scripts/summary.texi
new file mode 100644
index 0000000..5f1548a
--- /dev/null
+++ b/scripts/summary.texi
@@ -0,0 +1,40 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename summary.info
+@settitle Summary User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of @code{summary},
+a program from the NTP Project
+@end ifinfo
+
+@direntry
+* summary: (summary). Summarize (something)
+@end direntry
+
+@titlepage
+@title summary User's Manual
+@subtitle summary, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, summary Description, (dir), (dir)
+@top Summary User Manual
+
+This document describes the use of the NTP Project's @code{summary} program.
+This document applies to version @value{VERSION} of @code{summary}.
+
+@shortcontents
+
+@menu
+* summary Description:: Description
+* summary Invocation:: Invoking summary
+@end menu
+
+@include invoke-summary.texi
diff --git a/sntp/COPYRIGHT b/sntp/COPYRIGHT
new file mode 100644
index 0000000..1775a64
--- /dev/null
+++ b/sntp/COPYRIGHT
@@ -0,0 +1,197 @@
+This file is automatically generated from html/copyright.html
+
+ Copyright Notice
+
+ jpg "Clone me," says Dolly sheepishly.
+
+ Last update: 9-Aug-2014 07:56 UTC
+ _________________________________________________________________
+
+ The following copyright notice applies to all files collectively
+ called the Network Time Protocol Version 4 Distribution. Unless
+ specifically declared otherwise in an individual file, this notice
+ applies as if the text was explicitly included in the file.
+***********************************************************************
+* *
+* Copyright (c) University of Delaware 1992-2014 *
+* *
+* Permission to use, copy, modify, and distribute this software and *
+* its documentation for any purpose with or without fee is hereby *
+* granted, provided that the above copyright notice appears in all *
+* copies and that both the copyright notice and this permission *
+* notice appear in supporting documentation, and that the name *
+* University of Delaware not be used in advertising or publicity *
+* pertaining to distribution of the software without specific, *
+* written prior permission. The University of Delaware makes no *
+* representations about the suitability this software for any *
+* purpose. It is provided "as is" without express or implied *
+* warranty. *
+* *
+***********************************************************************
+
+ The following individuals contributed in part to the Network Time
+ Protocol Distribution Version 4 and are acknowledged as authors of
+ this work.
+ 1. [1]Takao Abe <takao_abe@xurb.jp> Clock driver for JJY receivers
+ 2. [2]Mark Andrews <mark_andrews@isc.org> Leitch atomic clock
+ controller
+ 3. [3]Bernd Altmeier <altmeier@atlsoft.de> hopf Elektronik serial
+ line and PCI-bus devices
+ 4. [4]Viraj Bais <vbais@mailman1.intel.com> and [5]Clayton Kirkwood
+ <kirkwood@striderfm.intel.com> port to WindowsNT 3.5
+ 5. [6]Michael Barone <michael,barone@lmco.com> GPSVME fixes
+ 6. [7]Karl Berry <karl@owl.HQ.ileaf.com> syslog to file option
+ 7. [8]Greg Brackley <greg.brackley@bigfoot.com> Major rework of WINNT
+ port. Clean up recvbuf and iosignal code into separate modules.
+ 8. [9]Marc Brett <Marc.Brett@westgeo.com> Magnavox GPS clock driver
+ 9. [10]Piete Brooks <Piete.Brooks@cl.cam.ac.uk> MSF clock driver,
+ Trimble PARSE support
+ 10. [11]Nelson B Bolyard <nelson@bolyard.me> update and complete
+ broadcast and crypto features in sntp
+ 11. [12]Jean-Francois Boudreault
+ <Jean-Francois.Boudreault@viagenie.qc.ca> IPv6 support
+ 12. [13]Reg Clemens <reg@dwf.com> Oncore driver (Current maintainer)
+ 13. [14]Steve Clift <clift@ml.csiro.au> OMEGA clock driver
+ 14. [15]Casey Crellin <casey@csc.co.za> vxWorks (Tornado) port and
+ help with target configuration
+ 15. [16]Sven Dietrich <sven_dietrich@trimble.com> Palisade reference
+ clock driver, NT adj. residuals, integrated Greg's Winnt port.
+ 16. [17]John A. Dundas III <dundas@salt.jpl.nasa.gov> Apple A/UX port
+ 17. [18]Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> Linux
+ port
+ 18. [19]Dennis Ferguson <dennis@mrbill.canet.ca> foundation code for
+ NTP Version 2 as specified in RFC-1119
+ 19. [20]John Hay <jhay@icomtek.csir.co.za> IPv6 support and testing
+ 20. [21]Dave Hart <davehart@davehart.com> General maintenance, Windows
+ port interpolation rewrite
+ 21. [22]Claas Hilbrecht <neoclock4x@linum.com> NeoClock4X clock driver
+ 22. [23]Glenn Hollinger <glenn@herald.usask.ca> GOES clock driver
+ 23. [24]Mike Iglesias <iglesias@uci.edu> DEC Alpha port
+ 24. [25]Jim Jagielski <jim@jagubox.gsfc.nasa.gov> A/UX port
+ 25. [26]Jeff Johnson <jbj@chatham.usdesign.com> massive prototyping
+ overhaul
+ 26. [27]Hans Lambermont <Hans.Lambermont@nl.origin-it.com> or
+ [28]<H.Lambermont@chello.nl> ntpsweep
+ 27. [29]Poul-Henning Kamp <phk@FreeBSD.ORG> Oncore driver (Original
+ author)
+ 28. [30]Frank Kardel [31]<kardel (at) ntp (dot) org> PARSE <GENERIC>
+ (driver 14 reference clocks), STREAMS modules for PARSE, support
+ scripts, syslog cleanup, dynamic interface handling
+ 29. [32]Johannes Maximilian Kuehn <kuehn@ntp.org> Rewrote sntp to
+ comply with NTPv4 specification, ntpq saveconfig
+ 30. [33]William L. Jones <jones@hermes.chpc.utexas.edu> RS/6000 AIX
+ modifications, HPUX modifications
+ 31. [34]Dave Katz <dkatz@cisco.com> RS/6000 AIX port
+ 32. [35]Craig Leres <leres@ee.lbl.gov> 4.4BSD port, ppsclock, Magnavox
+ GPS clock driver
+ 33. [36]George Lindholm <lindholm@ucs.ubc.ca> SunOS 5.1 port
+ 34. [37]Louis A. Mamakos <louie@ni.umd.edu> MD5-based authentication
+ 35. [38]Lars H. Mathiesen <thorinn@diku.dk> adaptation of foundation
+ code for Version 3 as specified in RFC-1305
+ 36. [39]Danny Mayer <mayer@ntp.org>Network I/O, Windows Port, Code
+ Maintenance
+ 37. [40]David L. Mills <mills@udel.edu> Version 4 foundation,
+ precision kernel; clock drivers: 1, 3, 4, 6, 7, 11, 13, 18, 19,
+ 22, 36
+ 38. [41]Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de> VMS port
+ 39. [42]Jeffrey Mogul <mogul@pa.dec.com> ntptrace utility
+ 40. [43]Tom Moore <tmoore@fievel.daytonoh.ncr.com> i386 svr4 port
+ 41. [44]Kamal A Mostafa <kamal@whence.com> SCO OpenServer port
+ 42. [45]Derek Mulcahy <derek@toybox.demon.co.uk> and [46]Damon
+ Hart-Davis <d@hd.org> ARCRON MSF clock driver
+ 43. [47]Rob Neal <neal@ntp.org> Bancomm refclock and config/parse code
+ maintenance
+ 44. [48]Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de>
+ monitoring/trap scripts, statistics file handling
+ 45. [49]Dirce Richards <dirce@zk3.dec.com> Digital UNIX V4.0 port
+ 46. [50]Wilfredo Sánchez <wsanchez@apple.com> added support for
+ NetInfo
+ 47. [51]Nick Sayer <mrapple@quack.kfu.com> SunOS streams modules
+ 48. [52]Jack Sasportas <jack@innovativeinternet.com> Saved a Lot of
+ space on the stuff in the html/pic/ subdirectory
+ 49. [53]Ray Schnitzler <schnitz@unipress.com> Unixware1 port
+ 50. [54]Michael Shields <shields@tembel.org> USNO clock driver
+ 51. [55]Jeff Steinman <jss@pebbles.jpl.nasa.gov> Datum PTS clock
+ driver
+ 52. [56]Harlan Stenn <harlan@pfcs.com> GNU automake/autoconfigure
+ makeover, various other bits (see the ChangeLog)
+ 53. [57]Kenneth Stone <ken@sdd.hp.com> HP-UX port
+ 54. [58]Ajit Thyagarajan <ajit@ee.udel.edu>IP multicast/anycast
+ support
+ 55. [59]Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp>TRAK clock
+ driver
+ 56. [60]Brian Utterback <brian.utterback@oracle.com> General codebase,
+ Solaris issues
+ 57. [61]Loganaden Velvindron <loganaden@gmail.com> Sandboxing
+ (libseccomp) support
+ 58. [62]Paul A Vixie <vixie@vix.com> TrueTime GPS driver, generic
+ TrueTime clock driver
+ 59. [63]Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> corrected and
+ validated HTML documents according to the HTML DTD
+ _________________________________________________________________
+
+References
+
+ 1. mailto:%20takao_abe@xurb.jp
+ 2. mailto:%20mark_andrews@isc.org
+ 3. mailto:%20altmeier@atlsoft.de
+ 4. mailto:%20vbais@mailman1.intel.co
+ 5. mailto:%20kirkwood@striderfm.intel.com
+ 6. mailto:%20michael.barone@lmco.com
+ 7. mailto:%20karl@owl.HQ.ileaf.com
+ 8. mailto:%20greg.brackley@bigfoot.com
+ 9. mailto:%20Marc.Brett@westgeo.com
+ 10. mailto:%20Piete.Brooks@cl.cam.ac.uk
+ 11. mailto:%20nelson@bolyard.me
+ 12. mailto:%20Jean-Francois.Boudreault@viagenie.qc.ca
+ 13. mailto:%20reg@dwf.com
+ 14. mailto:%20clift@ml.csiro.au
+ 15. mailto:%20casey@csc.co.za
+ 16. mailto:%20Sven_Dietrich@trimble.COM
+ 17. mailto:%20dundas@salt.jpl.nasa.gov
+ 18. mailto:%20duwe@immd4.informatik.uni-erlangen.de
+ 19. mailto:%20dennis@mrbill.canet.ca
+ 20. mailto:%20jhay@icomtek.csir.co.za
+ 21. mailto:%20davehart@davehart.com
+ 22. mailto:%20neoclock4x@linum.com
+ 23. mailto:%20glenn@herald.usask.ca
+ 24. mailto:%20iglesias@uci.edu
+ 25. mailto:%20jagubox.gsfc.nasa.gov
+ 26. mailto:%20jbj@chatham.usdesign.com
+ 27. mailto:%20Hans.Lambermont@nl.origin-it.com
+ 28. mailto:H.Lambermont@chello.nl
+ 29. mailto:%20phk@FreeBSD.ORG
+ 30. http://www4.informatik.uni-erlangen.de/%7ekardel
+ 31. mailto:%20kardel%20%28at%29%20ntp%20%28dot%29%20org
+ 32. mailto:kuehn@ntp.org
+ 33. mailto:%20jones@hermes.chpc.utexas.edu
+ 34. mailto:%20dkatz@cisco.com
+ 35. mailto:%20leres@ee.lbl.gov
+ 36. mailto:%20lindholm@ucs.ubc.ca
+ 37. mailto:%20louie@ni.umd.edu
+ 38. mailto:%20thorinn@diku.dk
+ 39. mailto:%20mayer@ntp.org
+ 40. mailto:%20mills@udel.edu
+ 41. mailto:%20moeller@gwdgv1.dnet.gwdg.de
+ 42. mailto:%20mogul@pa.dec.com
+ 43. mailto:%20tmoore@fievel.daytonoh.ncr.com
+ 44. mailto:%20kamal@whence.com
+ 45. mailto:%20derek@toybox.demon.co.uk
+ 46. mailto:%20d@hd.org
+ 47. mailto:%20neal@ntp.org
+ 48. mailto:%20Rainer.Pruy@informatik.uni-erlangen.de
+ 49. mailto:%20dirce@zk3.dec.com
+ 50. mailto:%20wsanchez@apple.com
+ 51. mailto:%20mrapple@quack.kfu.com
+ 52. mailto:%20jack@innovativeinternet.com
+ 53. mailto:%20schnitz@unipress.com
+ 54. mailto:%20shields@tembel.org
+ 55. mailto:%20pebbles.jpl.nasa.gov
+ 56. mailto:%20harlan@pfcs.com
+ 57. mailto:%20ken@sdd.hp.com
+ 58. mailto:%20ajit@ee.udel.edu
+ 59. mailto:%20tsuruoka@nc.fukuoka-u.ac.jp
+ 60. mailto:%20brian.utterback@oracle.com
+ 61. mailto:%20loganaden@gmail.com
+ 62. mailto:%20vixie@vix.com
+ 63. mailto:%20Ulrich.Windl@rz.uni-regensburg.de
diff --git a/sntp/Makefile.am b/sntp/Makefile.am
new file mode 100644
index 0000000..81a137a
--- /dev/null
+++ b/sntp/Makefile.am
@@ -0,0 +1,297 @@
+## Makefile.am for JMK's SNTP, by Harlan Stenn
+
+ACLOCAL_AMFLAGS = -I m4 -I libevent/m4 -I libopts/m4
+
+NULL =
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(SNTP_INCS)
+AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
+AM_CPPFLAGS += $(CPPFLAGS_LIBEVENT)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+LDADD = version.o
+LDADD += libsntp.a
+LDADD += $(LIBOPTS_LDADD)
+LDADD += $(LDADD_LIBEVENT)
+LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
+LDADD += $(PTHREAD_LIBS)
+LDADD += $(LDADD_NTP)
+
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L include -L ag-tpl --writable
+std_def_list = \
+ $(srcdir)/include/debug-opt.def \
+ $(srcdir)/include/autogen-version.def \
+ $(srcdir)/include/copyright.def \
+ $(srcdir)/include/homerc.def \
+ $(srcdir)/include/ntp.lic \
+ $(srcdir)/include/version.def \
+ $(NULL)
+
+EXTRA_PROGRAMS = sntp
+
+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
+DIST_SUBDIRS = include scripts
+
+if BUILD_SNTP
+noinst_LIBRARIES = libsntp.a
+if BUILD_LIBEVENT
+SUBDIRS += libevent
+DIST_SUBDIRS += libevent
+endif
+if GTEST_AVAILABLE
+SUBDIRS += tests
+endif
+endif
+
+if NEED_LIBOPTS
+SUBDIRS += libopts
+endif
+
+DIST_SUBDIRS += libopts tests
+
+libsntp_a_SOURCES = \
+ crypto.c \
+ kod_management.c \
+ log.c \
+ main.c \
+ networking.c \
+ sntp-opts.c \
+ utilities.c \
+ $(NULL)
+
+sntp_SOURCES = \
+ sntp.c \
+ $(NULL)
+
+noinst_HEADERS = \
+ crypto.h \
+ data_formats.h \
+ kod_management.h \
+ log.h \
+ main.h \
+ networking.h \
+ sntp-opts.h \
+ tests_main.h \
+ utilities.h \
+ $(NULL)
+
+DISTCLEANFILES = \
+ .version \
+ version.c \
+ config.log \
+ $(man_MANS) \
+ $(NULL)
+
+EXTRA_DIST = \
+ $(srcdir)/COPYRIGHT \
+ ag-tpl \
+ deps-ver \
+ invoke-sntp.menu \
+ invoke-sntp.texi \
+ @NTP_FORCE_LIBEVENT_DIST@ \
+ loc \
+ sntp-opts.def \
+ sntp.1sntpman \
+ sntp.1sntpmdoc \
+ sntp.man.in \
+ sntp.mdoc.in \
+ sntp.html \
+ sntp.texi \
+ $(srcdir)/scm-rev \
+ $(srcdir)/m4/version.m4 \
+ $(NULL)
+
+BUILT_SOURCES = \
+ $(srcdir)/COPYRIGHT \
+ libtool \
+ $(srcdir)/sntp-opts.c \
+ $(srcdir)/sntp-opts.h \
+ check-scm-rev \
+ $(srcdir)/include/version.def \
+ $(srcdir)/m4/version.m4 \
+ $(srcdir)/include/version.texi \
+ $(NULL)
+
+CLEANFILES = \
+ built-sources-only \
+ check-COPYRIGHT-submake \
+ $(NULL)
+
+man1_MANS=
+man8_MANS=
+man_MANS= sntp.$(SNTP_MS)
+
+## HMS: Real Soon Now...
+##info_TEXINFOS= sntp.texi
+##sntp_TEXINFOS= invoke-sntp.texi
+
+html_DATA= \
+ $(srcdir)/sntp.html \
+ $(NULL)
+
+noinst_DATA= \
+ $(srcdir)/invoke-sntp.menu \
+ $(srcdir)/invoke-sntp.texi \
+ $(srcdir)/sntp.man.in \
+ $(srcdir)/sntp.mdoc.in \
+ $(NULL)
+
+install-data-local: install-html
+
+FRC:
+ @: do-nothing action to prevent default SCCS get
+ @: FRC "force" depends on nothing and is not a file, so is
+ @: always out-of-date causing targets which depend on it to
+ @: similarly always be outdated causing their rules to fire
+ @: each time they or a dependent is built.
+
+$(PROGRAMS): version.o
+
+## We probably need something about libevent, too
+## That is probably not possible since LDADD_LIBEVENT may be
+## non-file "-levent_core".
+
+version.c: $(sntp_OBJECTS) ../libntp/libntp.a Makefile $(srcdir)/scm-rev
+ env CSET=`cat $(srcdir)/scm-rev` $(top_builddir)/../scripts/build/mkver sntp
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+check-autogen-version.def: FRC
+ @cd $(srcdir) \
+ && test -r ../include/autogen-version.def \
+ && ( if cmp -s ../include/autogen-version.def autogen-version.def; \
+ then : ; \
+ else cp ../include/autogen-version.def autogen-version.def; \
+ echo "Installing new sntp/autogen-version.def file"; \
+ fi )
+
+$(srcdir)/autogen-version.def:
+ $(MAKE) $(AM_MAKEFLAGS) check-autogen-version.def
+
+built-sources-only: $(BUILT_SOURCES)
+ @: do-nothing action to avoid default SCCS get
+
+## HMS: The next bit is still suboptimal. We'll get an error if this is
+## a bk repo and srcdir or scm-rev is unwritable.
+
+check-scm-rev: $(srcdir)/scm-rev
+ @: do-nothing
+
+$(srcdir)/scm-rev:
+ -test -r $(srcdir)/../SCCS/s.ChangeSet && \
+ (bk version) >/dev/null 2>&1 && \
+ cd $(srcdir)/.. && \
+ x=`bk -R prs -hr+ -nd:I: ChangeSet` && \
+ y=`cat sntp/scm-rev 2>/dev/null` || true && \
+ case "$$x" in ''|$$y) ;; *) echo $$x > sntp/scm-rev ;; esac
+
+$(srcdir)/m4/version.m4: $(srcdir)/../packageinfo.sh
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
+ ../scripts/build/genver m4/version.m4
+
+$(srcdir)/include/version.def: $(srcdir)/../packageinfo.sh
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
+ ../scripts/build/genver include/version.def
+
+$(srcdir)/include/version.texi: $(srcdir)/../packageinfo.sh
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
+ ../scripts/build/genver include/version.texi
+
+$(srcdir)/../COPYRIGHT:
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) COPYRIGHT-please
+
+check-COPYRIGHT-submake: $(srcdir)/../COPYRIGHT
+ @cmp -s $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT \
+ || { cp $(srcdir)/../COPYRIGHT $(srcdir) \
+ && echo 'updated sntp/COPYRIGHT installed' ;}
+ @echo 'submake avoided if this file is newer than parent COPYRIGHT' > $@
+
+check-COPYRIGHT: FRC
+ [ ! -r $(srcdir)/../COPYRIGHT ] \
+ || [ check-COPYRIGHT-submake -nt $(srcdir)/../COPYRIGHT ] \
+ || $(MAKE) $(AM_MAKEFLAGS) check-COPYRIGHT-submake
+
+$(srcdir)/COPYRIGHT: check-COPYRIGHT
+ @: do-nothing action to prevent any default
+
+$(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) sntp-opts.def
+
+###
+
+$(srcdir)/sntp.1sntpman: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1sntpman -Tagman-cmd.tpl sntp-opts.def
+
+$(srcdir)/sntp.man.in: $(srcdir)/sntp.1sntpman $(srcdir)/scripts/mansec2subst.sed
+ sed -f $(srcdir)/scripts/mansec2subst.sed $(srcdir)/sntp.1sntpman > $(srcdir)/sntp.man.in+
+ mv $(srcdir)/sntp.man.in+ $(srcdir)/sntp.man.in
+
+###
+
+$(srcdir)/sntp.1sntpmdoc: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1sntpmdoc -Tagmdoc-cmd.tpl sntp-opts.def
+
+$(srcdir)/sntp.mdoc.in: $(srcdir)/sntp.1sntpmdoc $(srcdir)/scripts/mansec2subst.sed
+ sed -f $(srcdir)/scripts/mansec2subst.sed $(srcdir)/sntp.1sntpmdoc > $(srcdir)/sntp.mdoc.in+
+ mv $(srcdir)/sntp.mdoc.in+ $(srcdir)/sntp.mdoc.in
+
+###
+
+sntp.$(SNTP_MS): $(srcdir)/sntp.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=sntp.$(SNTP_MS)+:$(srcdir)/sntp.$(MANTAGFMT).in
+ mv sntp.$(SNTP_MS)+ sntp.$(SNTP_MS)
+
+###
+
+$(srcdir)/invoke-sntp.menu: $(srcdir)/invoke-sntp.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-sntp.texi: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section sntp-opts.def
+ $(top_srcdir)/../scripts/build/check--help $@
+
+$(srcdir)/sntp.html: $(srcdir)/invoke-sntp.menu $(srcdir)/invoke-sntp.texi $(srcdir)/sntp.texi $(srcdir)/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o sntp.html sntp.texi || true )
+
+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
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/check-libntp.mf
+include $(top_srcdir)/check-libopts.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/sntp/Makefile.in b/sntp/Makefile.in
new file mode 100644
index 0000000..72e1d48
--- /dev/null
+++ b/sntp/Makefile.in
@@ -0,0 +1,1578 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = sntp$(EXEEXT)
+@BUILD_LIBEVENT_TRUE@@BUILD_SNTP_TRUE@am__append_1 = libevent
+@BUILD_LIBEVENT_TRUE@@BUILD_SNTP_TRUE@am__append_2 = libevent
+@BUILD_SNTP_TRUE@@GTEST_AVAILABLE_TRUE@am__append_3 = tests
+@NEED_LIBOPTS_TRUE@am__append_4 = libopts
+DIST_COMMON = $(am__configure_deps) $(noinst_HEADERS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(top_srcdir)/bincheck.mf \
+ $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libopts.mf \
+ $(top_srcdir)/configure $(top_srcdir)/depsver.mf \
+ $(top_srcdir)/includes.mf install-sh \
+ libevent/build-aux/compile libevent/build-aux/config.guess \
+ libevent/build-aux/config.sub libevent/build-aux/depcomp \
+ libevent/build-aux/install-sh libevent/build-aux/ltmain.sh \
+ libevent/build-aux/missing libevent/build-aux/ylwrap
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
+ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/libevent/m4/openldap.m4 \
+ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/m4/ntp_compiler.m4 \
+ $(top_srcdir)/m4/ntp_crosscompile.m4 \
+ $(top_srcdir)/m4/ntp_debug.m4 $(top_srcdir)/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/m4/ntp_googletest.m4 \
+ $(top_srcdir)/m4/ntp_ipv6.m4 $(top_srcdir)/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/m4/ntp_libevent.m4 \
+ $(top_srcdir)/m4/ntp_libntp.m4 \
+ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/m4/ntp_openssl.m4 \
+ $(top_srcdir)/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
+ $(top_srcdir)/m4/ntp_sysexits.m4 \
+ $(top_srcdir)/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
+ $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+am__v_AR_0 = @echo " AR " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+libsntp_a_AR = $(AR) $(ARFLAGS)
+libsntp_a_LIBADD =
+am__objects_1 =
+am_libsntp_a_OBJECTS = crypto.$(OBJEXT) kod_management.$(OBJEXT) \
+ log.$(OBJEXT) main.$(OBJEXT) networking.$(OBJEXT) \
+ sntp-opts.$(OBJEXT) utilities.$(OBJEXT) $(am__objects_1)
+libsntp_a_OBJECTS = $(am_libsntp_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+am_sntp_OBJECTS = sntp.$(OBJEXT) $(am__objects_1)
+sntp_OBJECTS = $(am_sntp_OBJECTS)
+sntp_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+sntp_DEPENDENCIES = version.o libsntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libsntp_a_SOURCES) $(sntp_SOURCES)
+DIST_SOURCES = $(libsntp_a_SOURCES) $(sntp_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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@
+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_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@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIB_SYSLOG = @LIB_SYSLOG@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+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_FORCE_LIBEVENT_DIST = @NTP_FORCE_LIBEVENT_DIST@
+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_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_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+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@
+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@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+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@
+ACLOCAL_AMFLAGS = -I m4 -I libevent/m4 -I libopts/m4
+NULL =
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(SNTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_LIBEVENT) \
+ $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+LDADD = version.o libsntp.a $(LIBOPTS_LDADD) $(LDADD_LIBEVENT) \
+ ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) \
+ $(LDADD_NTP)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L include -L ag-tpl --writable
+
+std_def_list = \
+ $(srcdir)/include/debug-opt.def \
+ $(srcdir)/include/autogen-version.def \
+ $(srcdir)/include/copyright.def \
+ $(srcdir)/include/homerc.def \
+ $(srcdir)/include/ntp.lic \
+ $(srcdir)/include/version.def \
+ $(NULL)
+
+bin_PROGRAMS = @SNTP_DB@
+libexec_PROGRAMS = @SNTP_DL@
+sbin_PROGRAMS = @SNTP_DS@
+SUBDIRS = include scripts $(am__append_1) $(am__append_3) \
+ $(am__append_4)
+DIST_SUBDIRS = include scripts $(am__append_2) libopts tests
+@BUILD_SNTP_TRUE@noinst_LIBRARIES = libsntp.a
+libsntp_a_SOURCES = \
+ crypto.c \
+ kod_management.c \
+ log.c \
+ main.c \
+ networking.c \
+ sntp-opts.c \
+ utilities.c \
+ $(NULL)
+
+sntp_SOURCES = \
+ sntp.c \
+ $(NULL)
+
+noinst_HEADERS = \
+ crypto.h \
+ data_formats.h \
+ kod_management.h \
+ log.h \
+ main.h \
+ networking.h \
+ sntp-opts.h \
+ tests_main.h \
+ utilities.h \
+ $(NULL)
+
+DISTCLEANFILES = \
+ .version \
+ version.c \
+ config.log \
+ $(man_MANS) \
+ $(NULL)
+
+EXTRA_DIST = \
+ $(srcdir)/COPYRIGHT \
+ ag-tpl \
+ deps-ver \
+ invoke-sntp.menu \
+ invoke-sntp.texi \
+ @NTP_FORCE_LIBEVENT_DIST@ \
+ loc \
+ sntp-opts.def \
+ sntp.1sntpman \
+ sntp.1sntpmdoc \
+ sntp.man.in \
+ sntp.mdoc.in \
+ sntp.html \
+ sntp.texi \
+ $(srcdir)/scm-rev \
+ $(srcdir)/m4/version.m4 \
+ $(NULL)
+
+BUILT_SOURCES = $(srcdir)/COPYRIGHT libtool $(srcdir)/sntp-opts.c \
+ $(srcdir)/sntp-opts.h check-scm-rev \
+ $(srcdir)/include/version.def $(srcdir)/m4/version.m4 \
+ $(srcdir)/include/version.texi $(NULL) check-libntp \
+ check-libopts .deps-ver
+CLEANFILES = built-sources-only check-COPYRIGHT-submake $(NULL) \
+ check-libntp check-libopts .deps-ver
+man1_MANS =
+man8_MANS =
+man_MANS = sntp.$(SNTP_MS)
+html_DATA = \
+ $(srcdir)/sntp.html \
+ $(NULL)
+
+noinst_DATA = \
+ $(srcdir)/invoke-sntp.menu \
+ $(srcdir)/invoke-sntp.texi \
+ $(srcdir)/sntp.man.in \
+ $(srcdir)/sntp.mdoc.in \
+ $(NULL)
+
+SNTP_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) config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libntp.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libsntp.a: $(libsntp_a_OBJECTS) $(libsntp_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libsntp.a
+ $(AM_V_AR)$(libsntp_a_AR) libsntp.a $(libsntp_a_OBJECTS) $(libsntp_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libsntp.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+sntp$(EXEEXT): $(sntp_OBJECTS) $(sntp_DEPENDENCIES)
+ @rm -f sntp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(sntp_OBJECTS) $(sntp_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kod_management.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networking.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sntp-opts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sntp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilities.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @$(am__cd) '$(distuninstallcheck_dir)' \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \
+ config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-data-local install-htmlDATA install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+ ctags-recursive install install-am install-exec-am \
+ install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-noinstLIBRARIES clean-sbinPROGRAMS ctags ctags-recursive \
+ dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzma \
+ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-data-local install-dvi install-dvi-am \
+ install-exec install-exec-am install-exec-hook install-html \
+ install-html-am install-htmlDATA install-info install-info-am \
+ install-libexecPROGRAMS install-man install-man1 install-man8 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-sbinPROGRAMS install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-man1 \
+ uninstall-man8 uninstall-sbinPROGRAMS
+
+
+install-data-local: install-html
+
+FRC:
+ @: do-nothing action to prevent default SCCS get
+ @: FRC "force" depends on nothing and is not a file, so is
+ @: always out-of-date causing targets which depend on it to
+ @: similarly always be outdated causing their rules to fire
+ @: each time they or a dependent is built.
+
+$(PROGRAMS): version.o
+
+version.c: $(sntp_OBJECTS) ../libntp/libntp.a Makefile $(srcdir)/scm-rev
+ env CSET=`cat $(srcdir)/scm-rev` $(top_builddir)/../scripts/build/mkver sntp
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+check-autogen-version.def: FRC
+ @cd $(srcdir) \
+ && test -r ../include/autogen-version.def \
+ && ( if cmp -s ../include/autogen-version.def autogen-version.def; \
+ then : ; \
+ else cp ../include/autogen-version.def autogen-version.def; \
+ echo "Installing new sntp/autogen-version.def file"; \
+ fi )
+
+$(srcdir)/autogen-version.def:
+ $(MAKE) $(AM_MAKEFLAGS) check-autogen-version.def
+
+built-sources-only: $(BUILT_SOURCES)
+ @: do-nothing action to avoid default SCCS get
+
+check-scm-rev: $(srcdir)/scm-rev
+ @: do-nothing
+
+$(srcdir)/scm-rev:
+ -test -r $(srcdir)/../SCCS/s.ChangeSet && \
+ (bk version) >/dev/null 2>&1 && \
+ cd $(srcdir)/.. && \
+ x=`bk -R prs -hr+ -nd:I: ChangeSet` && \
+ y=`cat sntp/scm-rev 2>/dev/null` || true && \
+ case "$$x" in ''|$$y) ;; *) echo $$x > sntp/scm-rev ;; esac
+
+$(srcdir)/m4/version.m4: $(srcdir)/../packageinfo.sh
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
+ ../scripts/build/genver m4/version.m4
+
+$(srcdir)/include/version.def: $(srcdir)/../packageinfo.sh
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
+ ../scripts/build/genver include/version.def
+
+$(srcdir)/include/version.texi: $(srcdir)/../packageinfo.sh
+ TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
+ ../scripts/build/genver include/version.texi
+
+$(srcdir)/../COPYRIGHT:
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) COPYRIGHT-please
+
+check-COPYRIGHT-submake: $(srcdir)/../COPYRIGHT
+ @cmp -s $(srcdir)/../COPYRIGHT $(srcdir)/COPYRIGHT \
+ || { cp $(srcdir)/../COPYRIGHT $(srcdir) \
+ && echo 'updated sntp/COPYRIGHT installed' ;}
+ @echo 'submake avoided if this file is newer than parent COPYRIGHT' > $@
+
+check-COPYRIGHT: FRC
+ [ ! -r $(srcdir)/../COPYRIGHT ] \
+ || [ check-COPYRIGHT-submake -nt $(srcdir)/../COPYRIGHT ] \
+ || $(MAKE) $(AM_MAKEFLAGS) check-COPYRIGHT-submake
+
+$(srcdir)/COPYRIGHT: check-COPYRIGHT
+ @: do-nothing action to prevent any default
+
+$(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) sntp-opts.def
+
+###
+
+$(srcdir)/sntp.1sntpman: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1sntpman -Tagman-cmd.tpl sntp-opts.def
+
+$(srcdir)/sntp.man.in: $(srcdir)/sntp.1sntpman $(srcdir)/scripts/mansec2subst.sed
+ sed -f $(srcdir)/scripts/mansec2subst.sed $(srcdir)/sntp.1sntpman > $(srcdir)/sntp.man.in+
+ mv $(srcdir)/sntp.man.in+ $(srcdir)/sntp.man.in
+
+###
+
+$(srcdir)/sntp.1sntpmdoc: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1sntpmdoc -Tagmdoc-cmd.tpl sntp-opts.def
+
+$(srcdir)/sntp.mdoc.in: $(srcdir)/sntp.1sntpmdoc $(srcdir)/scripts/mansec2subst.sed
+ sed -f $(srcdir)/scripts/mansec2subst.sed $(srcdir)/sntp.1sntpmdoc > $(srcdir)/sntp.mdoc.in+
+ mv $(srcdir)/sntp.mdoc.in+ $(srcdir)/sntp.mdoc.in
+
+###
+
+sntp.$(SNTP_MS): $(srcdir)/sntp.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=sntp.$(SNTP_MS)+:$(srcdir)/sntp.$(MANTAGFMT).in
+ mv sntp.$(SNTP_MS)+ sntp.$(SNTP_MS)
+
+###
+
+$(srcdir)/invoke-sntp.menu: $(srcdir)/invoke-sntp.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-sntp.texi: $(srcdir)/sntp-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section sntp-opts.def
+ $(top_srcdir)/../scripts/build/check--help $@
+
+$(srcdir)/sntp.html: $(srcdir)/invoke-sntp.menu $(srcdir)/invoke-sntp.texi $(srcdir)/sntp.texi $(srcdir)/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o sntp.html sntp.texi || true )
+
+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
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+check-libopts: libopts/libopts.la
+ @echo stamp > $@
+
+libopts/libopts.la:
+ -cd libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
+$(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/sntp/aclocal.m4 b/sntp/aclocal.m4
new file mode 100644
index 0000000..aff791b
--- /dev/null
+++ b/sntp/aclocal.m4
@@ -0,0 +1,1163 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# serial 9 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# If autoconf reports a warning
+# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+# but always AC_REQUIREd,
+# 2) to ensure that for each occurrence of
+# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+# or
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+# the corresponding gnulib module description has 'extensions' among
+# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+# invocation occurs in gl_EARLY, not in gl_INIT.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+ if test "$MINIX" = yes; then
+ AC_DEFINE([_POSIX_SOURCE], [1],
+ [Define to 1 if you need to in order for `stat' and other
+ things to work.])
+ AC_DEFINE([_POSIX_1_SOURCE], [2],
+ [Define to 2 if the system does not provide POSIX.1 features
+ except with this defined.])
+ AC_DEFINE([_MINIX], [1],
+ [Define to 1 if on MINIX.])
+ fi
+
+ dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+ dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+ dnl provided.
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_XOPEN_SOURCE], [500],
+ [Define to 500 only on HP-UX.])
+ ;;
+ esac
+
+ AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+])# AC_USE_SYSTEM_EXTENSIONS
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
+[
+ dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
+ dnl gnulib does not need it. But if it gets required by third-party macros
+ dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
+ dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
+ dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+ [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[ --enable-silent-rules less verbose build output (undo: `make V=1')
+ --disable-silent-rules verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([libopts/m4/libopts.m4])
+m4_include([libopts/m4/stdnoreturn.m4])
+m4_include([libevent/m4/openldap-thread-check.m4])
+m4_include([libevent/m4/openldap.m4])
+m4_include([m4/hms_search_lib.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/ntp_cacheversion.m4])
+m4_include([m4/ntp_compiler.m4])
+m4_include([m4/ntp_crosscompile.m4])
+m4_include([m4/ntp_debug.m4])
+m4_include([m4/ntp_dir_sep.m4])
+m4_include([m4/ntp_facilitynames.m4])
+m4_include([m4/ntp_googletest.m4])
+m4_include([m4/ntp_ipv6.m4])
+m4_include([m4/ntp_lib_m.m4])
+m4_include([m4/ntp_libevent.m4])
+m4_include([m4/ntp_libntp.m4])
+m4_include([m4/ntp_lineeditlibs.m4])
+m4_include([m4/ntp_locinfo.m4])
+m4_include([m4/ntp_openssl.m4])
+m4_include([m4/ntp_pkg_config.m4])
+m4_include([m4/ntp_prog_cc.m4])
+m4_include([m4/ntp_sntp.m4])
+m4_include([m4/ntp_sysexits.m4])
+m4_include([m4/ntp_ver_suffix.m4])
+m4_include([m4/os_cflags.m4])
+m4_include([m4/snprintf.m4])
diff --git a/sntp/ag-tpl/0-old/Mdoc.pm b/sntp/ag-tpl/0-old/Mdoc.pm
new file mode 100644
index 0000000..61fffd6
--- /dev/null
+++ b/sntp/ag-tpl/0-old/Mdoc.pm
@@ -0,0 +1,515 @@
+=head1 NAME
+
+Mdoc - perl module to parse Mdoc macros
+
+=head1 SYNOPSIS
+
+ use Mdoc qw(ns pp soff son stoggle mapwords);
+
+See mdoc2man and mdoc2texi for code examples.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item def_macro( NAME, CODE, [ raw => 1, greedy => 1, concat_until => '.Xx' ] )
+
+Define new macro. The CODE reference will be called by call_macro(). You can
+have two distinct definitions for and inline macro and for a standalone macro
+(i. e. 'Pa' and '.Pa').
+
+The CODE reference is passed a list of arguments and is expected to return list
+of strings and control characters (see C<CONSTANTS>).
+
+By default the surrouding "" from arguments to macros are removed, use C<raw>
+to disable this.
+
+Normaly CODE reference is passed all arguments up to next nested macro. Set
+C<greedy> to to pass everything up to the end of the line.
+
+If the concat_until is present, the line is concated until the .Xx macro is
+found. For example the following macro definition
+
+ def_macro('.Oo', gen_encloser(qw([ ]), concat_until => '.Oc' }
+ def_macro('.Cm', sub { mapwords {'($_)'} @_ } }
+
+and the following input
+
+ .Oo
+ .Cm foo |
+ .Cm bar |
+ .Oc
+
+results in [(foo) | (bar)]
+
+=item get_macro( NAME )
+
+Returns a hash reference like:
+
+ { run => CODE, raw => [1|0], greedy => [1|0] }
+
+Where C<CODE> is the CODE reference used to define macro called C<NAME>
+
+=item parse_line( INPUT, OUTPUT_CODE, PREPROCESS_CODE )
+
+Parse a line from the C<INPUT> filehandle. If a macro was detected it returns a
+list (MACRO_NAME, @MACRO_ARGS), otherwise it calls the C<OUTPUT_CODE>, giving
+caller a chance to modify line before printing it. If C<PREPROCESS_CODE> is
+defined it calls it prior to passing argument to a macro, giving caller a
+chance to alter them. if EOF was reached undef is returned.
+
+=item call_macro( MACRO, ARGS, ... )
+
+Call macro C<MACRO> with C<ARGS>. The CODE reference for macro C<MACRO> is
+called and for all the nested macros. Every called macro returns a list which
+is appended to return value and returned when all nested macros are processed.
+Use to_string() to produce a printable string from the list.
+
+=item to_string ( LIST )
+
+Processes C<LIST> returned from call_macro() and returns formatted string.
+
+=item mapwords BLOCK ARRAY
+
+This is like perl's map only it calls BLOCK only on elements which are not
+punctuation or control characters.
+
+=item space ( ['on'|'off] )
+
+Turn spacing on or off. If called without argument it returns the current state.
+
+=item gen_encloser ( START, END )
+
+Helper function for generating macros that enclose their arguments.
+ gen_encloser(qw({ }));
+returns
+ sub { '{', ns, @_, ns, pp('}')}
+
+=item set_Bl_callback( CODE , DEFS )
+
+This module implements the Bl/El macros for you. Using set_Bl_callback you can
+provide a macro definition that should be executed on a .Bl call.
+
+=item set_El_callback( CODE , DEFS )
+
+This module implements the Bl/El macros for you. Using set_El_callback you can
+provide a macro definition that should be executed on a .El call.
+
+=item set_Re_callback( CODE )
+
+The C<CODE> is called after a Rs/Re block is done. With a hash reference as a
+parameter, describing the reference.
+
+=back
+
+=head1 CONSTANTS
+
+=over 4
+
+=item ns
+
+Indicate 'no space' between to members of the list.
+
+=item pp ( STRING )
+
+The string is 'punctuation point'. It means that every punctuation
+preceeding that element is put behind it.
+
+=item soff
+
+Turn spacing off.
+
+=item son
+
+Turn spacing on.
+
+=item stoggle
+
+Toogle spacing.
+
+=item hs
+
+Print space no matter spacing mode.
+
+=back
+
+=head1 TODO
+
+* The concat_until only works with standalone macros. This means that
+ .Po blah Pc
+will hang until .Pc in encountered.
+
+* Provide default macros for Bd/Ed
+
+* The reference implementation is uncomplete
+
+=cut
+
+package Mdoc;
+use strict;
+use warnings;
+use List::Util qw(reduce);
+use Text::ParseWords qw(quotewords);
+use Carp;
+use Exporter qw(import);
+our @EXPORT_OK = qw(ns pp soff son stoggle hs mapwords gen_encloser nl);
+
+use constant {
+ ns => ['nospace'],
+ soff => ['spaceoff'],
+ son => ['spaceon'],
+ stoggle => ['spacetoggle'],
+ hs => ['hardspace'],
+};
+
+sub pp {
+ my $c = shift;
+ return ['pp', $c ];
+}
+sub gen_encloser {
+ my ($o, $c) = @_;
+ return sub { ($o, ns, @_, ns, pp($c)) };
+}
+
+sub mapwords(&@) {
+ my ($f, @l) = @_;
+ my @res;
+ for my $el (@l) {
+ local $_ = $el;
+ push @res, $el =~ /^(?:[,\.\{\}\(\):;\[\]\|])$/ || ref $el eq 'ARRAY' ?
+ $el : $f->();
+ }
+ return @res;
+}
+
+my %macros;
+
+###############################################################################
+
+# Default macro definitions start
+
+###############################################################################
+
+def_macro('Xo', sub { @_ }, concat_until => '.Xc');
+
+def_macro('.Ns', sub {ns, @_});
+def_macro('Ns', sub {ns, @_});
+
+{
+ my %reference;
+ def_macro('.Rs', sub { () } );
+ def_macro('.%A', sub {
+ if ($reference{authors}) {
+ $reference{authors} .= " and @_"
+ }
+ else {
+ $reference{authors} = "@_";
+ }
+ return ();
+ });
+ def_macro('.%T', sub { $reference{title} = "@_"; () } );
+ def_macro('.%O', sub { $reference{optional} = "@_"; () } );
+
+ sub set_Re_callback {
+ my ($sub) = @_;
+ croak 'Not a CODE reference' if not ref $sub eq 'CODE';
+ def_macro('.Re', sub {
+ my @ret = $sub->(\%reference);
+ %reference = (); @ret
+ });
+ return;
+ }
+}
+
+def_macro('.Bl', sub { die '.Bl - no list callback set' });
+def_macro('.It', sub { die ".It called outside of list context - maybe near line $." });
+def_macro('.El', sub { die '.El requires .Bl first' });
+
+
+{
+ my $elcb = sub { () };
+
+ sub set_El_callback {
+ my ($sub) = @_;
+ croak 'Not a CODE reference' if ref $sub ne 'CODE';
+ $elcb = $sub;
+ return;
+ }
+
+ sub set_Bl_callback {
+ my ($blcb, %defs) = @_;
+ croak 'Not a CODE reference' if ref $blcb ne 'CODE';
+ def_macro('.Bl', sub {
+
+ my $orig_it = get_macro('.It');
+ my $orig_el = get_macro('.El');
+ my $orig_bl = get_macro('.Bl');
+ my $orig_elcb = $elcb;
+
+ # Restore previous .It and .El on each .El
+ def_macro('.El', sub {
+ def_macro('.El', delete $orig_el->{run}, %$orig_el);
+ def_macro('.It', delete $orig_it->{run}, %$orig_it);
+ def_macro('.Bl', delete $orig_bl->{run}, %$orig_bl);
+ my @ret = $elcb->(@_);
+ $elcb = $orig_elcb;
+ @ret
+ });
+ $blcb->(@_)
+ }, %defs);
+ return;
+ }
+}
+
+def_macro('.Sm', sub {
+ my ($arg) = @_;
+ if (defined $arg) {
+ space($arg);
+ } else {
+ space() eq 'off' ?
+ space('on') :
+ space('off');
+ }
+ ()
+} );
+def_macro('Sm', do { my $off; sub {
+ my ($arg) = @_;
+ if (defined $arg && $arg =~ /^(on|off)$/) {
+ shift;
+ if ($arg eq 'off') { soff, @_; }
+ elsif ($arg eq 'on') { son, @_; }
+ }
+ else {
+ stoggle, @_;
+ }
+}} );
+
+###############################################################################
+
+# Default macro definitions end
+
+###############################################################################
+
+sub def_macro {
+ croak 'Odd number of elements for hash argument <'.(scalar @_).'>' if @_%2;
+ my ($macro, $sub, %def) = @_;
+ croak 'Not a CODE reference' if ref $sub ne 'CODE';
+
+ $macros{ $macro } = {
+ run => $sub,
+ greedy => delete $def{greedy} || 0,
+ raw => delete $def{raw} || 0,
+ concat_until => delete $def{concat_until},
+ };
+ if ($macros{ $macro }{concat_until}) {
+ $macros{ $macros{ $macro }{concat_until} } = { run => sub { @_ } };
+ $macros{ $macro }{greedy} = 1;
+ }
+ return;
+}
+
+sub get_macro {
+ my ($macro) = @_;
+ croak "Macro <$macro> not defined" if not exists $macros{ $macro };
+ +{ %{ $macros{ $macro } } }
+}
+
+#TODO: document this
+sub parse_opts {
+ my %args;
+ my $last;
+ for (@_) {
+ if ($_ =~ /^\\?-/) {
+ s/^\\?-//;
+ $args{$_} = 1;
+ $last = _unquote($_);
+ }
+ else {
+ $args{$last} = _unquote($_) if $last;
+ undef $last;
+ }
+ }
+ return %args;
+}
+
+sub _is_control {
+ my ($el, $expected) = @_;
+ if (defined $expected) {
+ ref $el eq 'ARRAY' and $el->[0] eq $expected;
+ }
+ else {
+ ref $el eq 'ARRAY';
+ }
+}
+
+{
+ my $sep = ' ';
+
+ sub to_string {
+ if (@_ > 0) {
+ # Handle punctunation
+ my ($in_brace, @punct) = '';
+ my @new = map {
+ if (/^([\[\(])$/) {
+ ($in_brace = $1) =~ tr/([/)]/;
+ $_, ns
+ }
+ elsif (/^([\)\]])$/ && $in_brace eq $1) {
+ $in_brace = '';
+ ns, $_
+ }
+ elsif ($_ =~ /^[,\.;:\?\!\)\]]$/) {
+ push @punct, ns, $_;
+ ();
+ }
+ elsif (_is_control($_, 'pp')) {
+ $_->[1]
+ }
+ elsif (_is_control($_)) {
+ $_
+ }
+ else {
+ splice (@punct), $_;
+ }
+ } @_;
+ push @new, @punct;
+
+ # Produce string out of an array dealing with the special control characters
+ # space('off') must but one character delayed
+ my ($no_space, $space_off) = 1;
+ my $res = '';
+ while (defined(my $el = shift @new)) {
+ if (_is_control($el, 'hardspace')) { $no_space = 1; $res .= ' ' }
+ elsif (_is_control($el, 'nospace')) { $no_space = 1; }
+ elsif (_is_control($el, 'spaceoff')) { $space_off = 1; }
+ elsif (_is_control($el, 'spaceon')) { space('on'); }
+ elsif (_is_control($el, 'spacetoggle')) { space() eq 'on' ?
+ $space_off = 1 :
+ space('on') }
+ else {
+ if ($no_space) {
+ $no_space = 0;
+ $res .= "$el"
+ }
+ else {
+ $res .= "$sep$el"
+ }
+
+ if ($space_off) { space('off'); $space_off = 0; }
+ }
+ }
+ $res
+ }
+ else {
+ '';
+ }
+ }
+
+ sub space {
+ my ($arg) = @_;
+ if (defined $arg && $arg =~ /^(on|off)$/) {
+ $sep = ' ' if $arg eq 'on';
+ $sep = '' if $arg eq 'off';
+ return;
+ }
+ else {
+ return $sep eq '' ? 'off' : 'on';
+ }
+ }
+}
+
+sub _unquote {
+ my @args = @_;
+ $_ =~ s/^"([^"]+)"$/$1/g for @args;
+ wantarray ? @args : $args[0];
+}
+
+sub call_macro {
+ my ($macro, @args) = @_;
+ my @ret;
+
+ my @newargs;
+ my $i = 0;
+
+ @args = _unquote(@args) if (!$macros{ $macro }{raw});
+
+ # Call any callable macros in the argument list
+ for (@args) {
+ if ($_ =~ /^[A-Z][a-z]+$/ && exists $macros{ $_ }) {
+ push @ret, call_macro($_, @args[$i+1 .. $#args]);
+ last;
+ } else {
+ if ($macros{ $macro }{greedy}) {
+ push @ret, $_;
+ }
+ else {
+ push @newargs, $_;
+ }
+ }
+ $i++;
+ }
+
+ if ($macros{ $macro }{concat_until}) {
+ my ($n_macro, @n_args) = ('');
+ while (1) {
+ die "EOF was reached and no $macros{ $macro }{concat_until} found"
+ if not defined $n_macro;
+ ($n_macro, @n_args) = parse_line(undef, sub { push @ret, shift });
+ if ($n_macro eq $macros{ $macro }{concat_until}) {
+ push @ret, call_macro($n_macro, @n_args);
+ last;
+ }
+ else {
+ $n_macro =~ s/^\.//;
+ push @ret, call_macro($n_macro, @n_args) if exists $macros{ $n_macro };
+ }
+ }
+ }
+
+ if ($macros{ $macro }{greedy}) {
+ #print "MACROG $macro (", (join ', ', @ret), ")\n";
+ return $macros{ $macro }{run}->(@ret);
+ }
+ else {
+ #print "MACRO $macro (", (join ', ', @newargs), ")".(join ', ', @ret)."\n";
+ return $macros{ $macro }{run}->(@newargs), @ret;
+ }
+}
+
+{
+ my ($in_fh, $out_sub, $preprocess_sub);
+ sub parse_line {
+ $in_fh = $_[0] if defined $_[0] || !defined $in_fh;
+ $out_sub = $_[1] if defined $_[1] || !defined $out_sub;
+ $preprocess_sub = $_[2] if defined $_[2] || !defined $preprocess_sub;
+
+ croak 'out_sub not a CODE reference'
+ if not ref $out_sub eq 'CODE';
+ croak 'preprocess_sub not a CODE reference'
+ if defined $preprocess_sub && not ref $preprocess_sub eq 'CODE';
+
+ while (my $line = <$in_fh>) {
+ chomp $line;
+ if ($line =~ /^\.[A-z][a-z0-9]+/ || $line =~ /^\.%[A-Z]/ ||
+ $line =~ /^\.\\"/)
+ {
+ $line =~ s/ +/ /g;
+ my ($macro, @args) = quotewords(' ', 1, $line);
+ @args = grep { defined $_ } @args;
+ $preprocess_sub->(@args) if defined $preprocess_sub;
+ if ($macro && exists $macros{ $macro }) {
+ return ($macro, @args);
+ } else {
+ $out_sub->($line);
+ }
+ }
+ else {
+ $out_sub->($line);
+ }
+ }
+ return;
+ }
+}
+
+1;
+__END__
diff --git a/sntp/ag-tpl/0-old/agman-cmd.tpl b/sntp/ag-tpl/0-old/agman-cmd.tpl
new file mode 100644
index 0000000..6d937e4
--- /dev/null
+++ b/sntp/ag-tpl/0-old/agman-cmd.tpl
@@ -0,0 +1,58 @@
+[+: -*- Mode: nroff -*-
+
+ AutoGen5 template man
+
+## agman-cmd.tpl -- Template for command line man pages
+##
+## This file is part of AutoOpts, a companion to AutoGen.
+## AutoOpts is free software.
+## Copyright (C) 1992-2013 Bruce Korb - all rights reserved
+##
+## AutoOpts is available under any one of two licenses. The license
+## in use must be one of these two and the choice is under the control
+## of the user of the license.
+##
+## The GNU Lesser General Public License, version 3 or later
+## See the files "COPYING.lgplv3" and "COPYING.gplv3"
+##
+## The Modified Berkeley Software Distribution License
+## See the file "COPYING.mbsd"
+##
+## These files have the following sha256 sums:
+##
+## 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+## 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+## 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+
+# Produce a man page for section 1, 5 or 8 commands.
+# Which is selected via: -DMAN_SECTION=n
+# passed to the autogen invocation. "n" may have a suffix, if desired.
+#
+:+][+:
+
+(define head-line (lambda()
+ (sprintf ".TH %s %s \"%s\" \"%s\" \"%s\"\n.\\\"\n"
+ (get "prog-name") man-sect
+ (shell "date '+%d %b %Y'") package-text section-name) ))
+
+(define man-page #t)
+(out-push-new) :+][+:
+
+INCLUDE "mdoc-synopsis.tlib" :+][+:
+INCLUDE "cmd-doc.tlib" :+][+:
+
+INVOKE build-doc :+][+:
+
+ (shell (string-append
+ "fn='" (find-file "mdoc2man") "'\n"
+ "test -f ${fn} || die mdoc2man not found from $PWD\n"
+ "${fn} <<\\_EndOfMdoc_ || die ${fn} failed in $PWD\n"
+ (out-pop #t)
+ "\n_EndOfMdoc_" ))
+
+:+][+:
+
+(out-move (string-append (get "prog-name") "."
+ man-sect)) :+][+:
+
+agman-cmd.tpl ends here :+]
diff --git a/sntp/ag-tpl/0-old/agmdoc-cmd.tpl b/sntp/ag-tpl/0-old/agmdoc-cmd.tpl
new file mode 100644
index 0000000..cc56ffe
--- /dev/null
+++ b/sntp/ag-tpl/0-old/agmdoc-cmd.tpl
@@ -0,0 +1,46 @@
+[+: -*- Mode: nroff -*-
+
+ AutoGen5 template mdoc
+
+## agman-cmd.tpl -- Template for command line mdoc pages
+##
+## This file is part of AutoOpts, a companion to AutoGen.
+## AutoOpts is free software.
+## AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved
+##
+## AutoOpts is available under any one of two licenses. The license
+## in use must be one of these two and the choice is under the control
+## of the user of the license.
+##
+## The GNU Lesser General Public License, version 3 or later
+## See the files "COPYING.lgplv3" and "COPYING.gplv3"
+##
+## The Modified Berkeley Software Distribution License
+## See the file "COPYING.mbsd"
+##
+## These files have the following sha256 sums:
+##
+## 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+## 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+## 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+
+# Produce a man page for section 1, 5 or 8 commands.
+# Which is selected via: -DMAN_SECTION=n
+# passed to the autogen invocation. "n" may have a suffix, if desired.
+#
+:+][+:
+
+(define head-line (lambda() (string-append
+ ".Dd " (shell "date '+%B %e %Y' | sed 's/ */ /g'")
+ "\n.Dt " UP-PROG-NAME " " man-sect " " section-name
+ "\n.Os\n") ))
+
+(define man-page #f) :+][+:
+
+INCLUDE "mdoc-synopsis.tlib" :+][+:
+INCLUDE "cmd-doc.tlib" :+][+:
+INVOKE build-doc :+][+:
+
+(out-move (string-append
+ (get "prog-name") "." man-sect)) :+][+:
+agmdoc-cmd.tpl ends here :+]
diff --git a/sntp/ag-tpl/0-old/cmd-doc.tlib b/sntp/ag-tpl/0-old/cmd-doc.tlib
new file mode 100644
index 0000000..0f4c50c
--- /dev/null
+++ b/sntp/ag-tpl/0-old/cmd-doc.tlib
@@ -0,0 +1,1079 @@
+[+: -*- Mode: nroff -*-
+
+ AutoGen5 template man
+
+# cmd-doc.tlib -- Template for command line man/mdoc pages
+#
+# This file is part of AutoOpts, a companion to AutoGen.
+# AutoOpts is free software.
+# Copyright (C) 1992-2013 Bruce Korb - all rights reserved
+#
+# AutoOpts is available under any one of two licenses. The license
+# in use must be one of these two and the choice is under the control
+# of the user of the license.
+#
+# The GNU Lesser General Public License, version 3 or later
+# See the files "COPYING.lgplv3" and "COPYING.gplv3"
+#
+# The Modified Berkeley Software Distribution License
+# See the file "COPYING.mbsd"
+#
+# These files have the following sha256 sums:
+#
+# 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+# 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+# 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+
+# Produce a man page for section 1, 5, 6 or 8 commands. Which is
+# selected via: -DMAN_SECTION=n. "n" may have a suffix, if desired.
+# These sections have default section names that may be overridden
+# with -DSECTIN_NAME=XX, also passed to the autogen invocation.
+#
+:+][+:
+
+ ;;# START-BUILDTREE-ISMS
+ ;;
+ (shell "CLexe=${AGexe%/agen5/*}/columns/columns
+ test -x \"${CLexe}\" || {
+ CLexe=${AGexe%/autogen}/columns
+ test -x \"${CLexe}\" || die 'columns program is not findable'
+ }")
+
+:+][+: # END-BUILDTREE-ISMS
+
+(shell "CLexe=`echo ${AGexe} | sed 's@/autogen@/columns@'`
+ test -x \"${CLexe}\" || CLexe=`which columns`")
+
+# END-INSTALL-ONLY-CODE :+][+:
+
+(define down-prog-name (string-downcase! (get "prog-name")))
+(define UP-PROG-NAME (get-up-name "prog-name"))
+
+(define command-doc #t)
+(define tmp-val (getenv "MAN_SECTION"))
+(define man-sect (if (exist? "cmd-section") (get "cmd-section") "1"))
+(define file-name "")
+(define sect-name "")
+(define macro-name "")
+(define tmp-str "")
+(define fname-line "")
+(define use-flags (exist? "flag.value"))
+(define named-mode (not (or use-flags (exist? "long-opts") )))
+
+(if (defined? 'tmp-val)
+ (if (string? tmp-val)
+ (set! man-sect tmp-val)))
+
+(define section-name
+ (if (=* man-sect "1") "User Commands"
+ (if (=* man-sect "5") "File Formats"
+ (if (=* man-sect "6") "Games"
+ (if (=* man-sect "8") "System Management"
+ (error
+ "the agman-cmd template only produces section 1, 5, 6 and 8 man pages")
+)))))
+(set! tmp-val (getenv "SECTION_NAME"))
+(if (defined? 'tmp-val) (if (string? tmp-val)
+ (set! section-name tmp-val) ))
+
+(define package-text "")
+(define package+version (and (exist? "package") (exist? "version")))
+
+(if (or (exist? "package") (exist? "version")) (begin
+ (set! package-text (string-append
+ (get "package")
+ (if package+version " (" "")
+ (get "version")
+ (if package+version ")" "") ))
+) )
+
+(define name-to-fname (lambda (nm)
+ (string-tr (string-downcase nm) " " "-") ))
+
+(define sect-line-fname (lambda () (begin
+ (out-push-new file-name)
+ (emit (string-append ".Sh \"" sect-name "\"\n"))
+ (string-append "mk-" macro-name) )))
+
+(make-tmp-dir)
+
+(define home-rc-files (exist? "homerc"))
+(define home-rc-text
+ "\nSee \\fBOPTION PRESETS\\fP for configuration files.")
+
+(define environ-init (exist? "environrc"))
+(define environ-text
+ "\nSee \\fBOPTION PRESETS\\fP for configuration environment variables.")
+
+(emit (head-line))
+(dne ".\\\" ") :+]
+.Sh NAME
+.Nm [+: prog-name :+]
+.Nd [+: prog-title :+]
+[+: INCLUDE "tpl-config.tlib" :+][+:#
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" B U I L D D O C
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE build-doc :+][+:
+
+(if (not command-doc) (begin
+ (set! home-rc-files #f)
+ (set! home-rc-text "")
+) ) :+][+:
+
+INVOKE doc-sections :+][+:
+INVOKE ao-sections :+][+:
+INVOKE assemble-sections :+][+:
+
+ENDDEF build-doc
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" A S S E M B L E S E C T I O N S
+.\"
+.\" Emit the files for each section that was provided, and do conversions
+.\"
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE assemble-sections :+][+:
+
+(out-push-new)
+
+:+][+:
+#.\" Insert the sections in the prescribed order
+#.\" Ensure a newline between them all. We strip blank lines,
+#.\" so extra blank lines get removed.
+#:+]
+cvt_prog='[+:
+
+ (define target-form (if man-page "man" "mdoc"))
+ (define source-form (get "option-format" "texi"))
+ (define converter (string-append source-form "2" target-form ))
+ (set! tmp-str (find-file converter))
+
+ (if (not (defined? 'tmp-str))
+ (error (string-append "cannot locate " converter)))
+ tmp-str
+:+]'
+cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd
+ `/`basename "$cvt_prog"`
+cd $tmp_dir
+test -x "$cvt_prog" || die "'$cvt_prog' is not executable"
+{
+ list='synopsis description options option-presets'
+ for f in $list ; do cat $f ; echo ; done
+ rm -f $list name
+ list='implementation-notes environment files examples exit-status errors
+ compatibility see-also conforming-to history authors copyright bugs
+ notes'
+ for f in $list ; do cat $f ; echo ; done > .end-doc
+ rm -f $list
+ list=`ls -1 *`' .end-doc'
+ for f in $list ; do cat $f ; echo ; done
+ rm -f $list
+} 1>.doc 2>/dev/null
+[+:
+IF (exist? "doc-sub") :+][+:
+ (out-push-new (string-append tmp-dir "/.cmds")) :+][+:
+ FOR doc-sub :+][+:
+
+ IF (define field-name (get "sub-type" target-form))
+ (~~ target-form field-name) :+][+:
+
+ (set! field-name (get "sub-name"))
+ (define rep-string (string-append "<<" field-name ">>"))
+ (emit (string-substitute (get "sub-text") rep-string (get field-name)))
+ "\n"
+
+ :+][+: ENDIF :+][+:
+
+ ENDFOR doc-sub :+][+:
+
+ (out-pop)
+ (define post-proc-cmd (string-append
+ (get "doc-sub-cmd" "sed -f %s %s") " | "
+ egrep-prog " -v '^[ ]*$' | $cvt_prog"))
+ (sprintf post-proc-cmd ".cmds" ".doc")
+ :+][+:
+ELSE \:+]
+[+:(. egrep-prog):+] -v '^[ ]*$' .doc | $cvt_prog[+:
+ENDIF doc-sub exists :+][+:
+
+(shell (out-pop #t)) :+][+:
+
+ENDDEF assemble-sections
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" D O C S E C T I O N S
+.\"
+.\" Emit the files for each section that was provided.
+.\" If multiple sections exist, they get glued together with ".Pp"
+.\" between them.
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE doc-sections :+][+:
+
+FOR doc-section :+][+:
+ IF
+ (define sec-type (string-upcase (get "ds-type")))
+ (define sec-name (name-to-fname sec-type))
+ (define cvt-fn (find-file (string-append
+ (get "ds-format" "man") "2mdoc")))
+ (if (not (defined? 'cvt-fn))
+ (error (sprintf "Cannot locate converter for %s"
+ (get "ds-format" "man"))))
+
+ (define sec-file (string-append tmp-dir "/" sec-name))
+ (access? sec-file R_OK) :+][+:
+ (out-push-add sec-file)
+ (emit ".Pp\n") :+][+:
+
+ ELSE :+][+: CASE
+ (out-push-new sec-file)
+ sec-type :+][+:
+
+ == "" :+][+: (error "unnamed doc-section") :+][+:
+ *==* " " :+].Sh "[+: (. sec-type) :+]"[+:
+ * :+].Sh [+: (. sec-type) :+][+:
+ ESAC :+][+:
+ ENDIF :+]
+[+:
+ (shell (string-append
+ "fn='" cvt-fn "'\n"
+ "test -f ${fn} || die ${fn} not found from $PWD\n"
+ "${fn} <<\\_EndOfDocSection_ || die ${fn} failed in $PWD\n"
+ (get "ds-text")
+ "\n_EndOfDocSection_"
+ )) :+][+:
+
+ CASE (emit "\n") sec-type :+][+:
+ == FILES :+][+:
+ (if home-rc-files (emit home-rc-text))
+ (set! home-rc-files #f) :+][+:
+
+ == ENVIRONMENT :+][+:
+ (if environ-init (emit environ-text))
+ (set! environ-init #f) :+][+:
+ ESAC :+][+:
+
+ (out-pop)
+ :+][+:
+
+ENDFOR doc-section :+][+:
+
+ENDDEF doc-sections
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" A O S E C T I O N S
+.\"
+.\" Emit the files for the sections that these templates augment,
+.\" replace or conditionally replace
+.\"
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE ao-sections :+][+:
+ IF (. command-doc) :+][+:
+ INVOKE cond-section sec = "OPTIONS" mode = "replace" :+][+:
+ INVOKE cond-section sec = "EXIT STATUS" mode = "insert" :+][+:
+
+ IF (or home-rc-files environ-init) :+][+:
+ INVOKE cond-section sec = "OPTION PRESETS" mode = "replace" :+][+:
+
+ IF (. home-rc-files) :+][+:
+ INVOKE cond-section sec = "FILES" mode = "append" :+][+:
+ ENDIF :+][+:
+
+ IF (. environ-init) :+][+:
+ INVOKE cond-section sec = "ENVIRONMENT" mode = "append" :+][+:
+ ENDIF :+][+:
+ ENDIF :+][+:
+
+ ELSE section 5, not command :+][+:
+ INVOKE cond-section sec = "FILES" mode = "append" :+][+:
+ ENDIF section 5/not :+][+:
+
+ INVOKE cond-section sec = "SYNOPSIS" mode = "alt" :+][+:
+ INVOKE cond-section sec = "DESCRIPTION" mode = "append" :+][+:
+ INVOKE cond-section sec = "AUTHORS" mode = "alt" :+][+:
+ INVOKE cond-section sec = "BUGS" mode = "append" :+][+:
+ INVOKE cond-section sec = "NOTES" mode = "append" :+][+:
+
+IF (exist? "copyright") :+][+:
+ INVOKE cond-section sec = "COPYRIGHT" mode = "alt" :+][+:
+ENDIF :+][+:
+
+ENDDEF ao-sections
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" C O N D I T I O N A L S E C T I O N
+.\"
+.\" Figure out what to do for AutoOpts required sections, depending on "mode"
+.\" In all cases, if the file does not exist, invoke the "mk" macro to create
+.\" a new file. If it does exist, then:
+.\"
+.\" alt Alternate -- emit no text
+.\" replace throw away any pre-existing file.
+.\" append invoke the "append" macro to emit additional text
+.\" insert save the current contents, replacing the .Sh line with .Pp.
+.\" invoke the "mk" macro then emit the saved text
+.\"
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE cond-section :+][+:
+
+ IF
+ (set! sect-name (string-upcase! (string-substitute
+ (get "sec") "-" " " )))
+ (set! macro-name (string-downcase! (string-substitute
+ sect-name " " "-" )))
+ (set! file-name (string-append tmp-dir "/" macro-name))
+
+ (not (access? file-name R_OK)) :+][+:
+
+ INVOKE (sect-line-fname) :+][+:
+
+ ELSE file exists :+][+:
+
+ CASE (get "mode") :+][+:
+
+ == replace :+][+:
+ INVOKE (sect-line-fname) :+][+:
+
+ == append :+][+:
+ (out-push-add file-name) :+][+:
+ INVOKE (string-append "append-" macro-name) :+][+:
+
+ == insert :+][+:
+ (set! fname-line (shellf
+ "sed '1s/.Sh .*/.Pp/' %1$s ; rm -f %1$s" file-name)) :+][+:
+ INVOKE (sect-line-fname) :+][+:
+
+ == alt :+][+:
+ (out-push-new) :+][+:
+
+ * :+][+:
+ (error (sprintf "invalid section type: %s" (get "mode")))
+
+ :+][+:
+ ESAC :+][+:
+
+ ENDIF file existence/non-existence :+][+:
+ (out-pop) :+][+: # All paths open out :+][+:
+ENDDEF cond-section
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - D E S C R I P T I O N
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-description :+][+:
+
+ (out-push-new)
+ (emit
+ (if (exist? "prog-man-descrip")
+ (stack-join "\n.Pp\n" "prog-man-descrip")
+ (if (exist? "detail")
+ (stack-join "\n.Pp\n" "detail")
+ "There is no description for this command."
+ ) ) )
+ (shell "sed 's/^$/.sp/' <<\\_EODesc_\n" (out-pop #t) "\n_EODesc_")
+
+ :+][+:
+ INVOKE append-description :+][+:
+
+ENDDEF mk-description
+
+.\" = = = = = = = = = = = = = = = = = =
+.\" A P P E N D - D E S C R I P T I O N
+.\" = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE append-description :+][+:
+
+IF (= (get "main.main-type") "for-each"):+][+:
+
+ CASE main.handler-type :+][+:
+ ~* ^(name|file)|.*text \:+]
+.Pp
+This program will perform its function for every file named on the command
+line or every file named in a list read from stdin. The arguments or input
+names must be pre\-existing files. The input list may contain comments,
+which[+:
+
+ !E \:+]
+.Pp
+This program will perform its function for every command line argument
+or every non\-comment line in a list read from stdin.
+The input list comments[+:
+
+ * :+][+:
+ (error "the 'for-each' main has in invalid handler-type.") :+][+:
+ ESAC \:+]
+ are blank lines or lines beginning with a '[+:
+ ?% comment-char "%s" "#" :+]' character.
+[+:
+
+ENDIF - "main" is of "for-each" type :+][+:
+
+ENDDEF append-description
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - O P T I O N S
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-options
+
+:+][+:
+
+(define opt-arg "")
+(define dis-name "")
+(define opt-name "")
+(define optname-from "A-Z_^")
+(define optname-to "a-z--")
+(define cvt-cmd "")
+(define formatted-doc (exist? "option-format"))
+
+(if formatted-doc (begin
+ (out-push-new)
+ (set! cvt-cmd (string-append (get "option-format") "2mdoc"))
+) )
+
+(if (exist? "preserve-case")
+ (begin
+ (set! optname-from "_^")
+ (set! optname-to "--")
+) )
+
+(define fix-optname (lambda (o_nm) (begin
+ (set! o_nm (string-tr o_nm optname-from optname-to))
+ (set! o_nm (string-substitute o_nm "-" "\\-" ))
+ o_nm )))
+
+(if (exist? "option-info")
+ (string-append ".Pp\n" (get "option-info") "\n") )
+\:+]
+.Bl -tag[+:
+
+FOR flag :+][+:
+ IF (not (exist? "documentation")) :+][+:
+ IF (exist? "aliases") :+][+:
+ INVOKE emit-alias-opt :+][+:
+ ELSE :+][+:
+ INVOKE emit-flag-text :+][+:
+ ENDIF :+][+:
+
+ ELSE :+]
+.Ss "[+: (get "descrip" "") :+]"[+:
+(set! tmp-str (get "documentation" ""))
+(if (> (string-length tmp-str) 3) (string-append
+ "\n" tmp-str "\n" )) :+][+:
+
+ ENDIF :+][+:
+ENDFOR flag
+
+.\" = = = = = = = = = = = = = = = = =
+.\" help option
+.\" = = = = = = = = = = = = = = = = =
+
+:+]
+.It [+:
+ (define tmp-val (get "help-value" "\\&?"))
+ (if (and use-flags (> (string-length tmp-val) 0))
+ (string-append "Fl " tmp-val
+ (if (exist? "long-opts") " , Fl -help" "") )
+ (string-append (if (exist? "long-opts") "Fl -" "") "help" )
+ ) \:+]
+
+Display usage information and exit.[+:#
+
+.\" = = = = = = = = = = = = = = = = =
+.\" more-help option
+.\" = = = = = = = = = = = = = = = = = :+][+:
+
+ IF (not (exist? "no-libopts")) :+]
+.It [+:
+ (define tmp-val (get "more-help-value" "\\&!"))
+ (if (and use-flags (> (string-length tmp-val) 0))
+ (string-append "Fl " tmp-val
+ (if (exist? "long-opts") " , Fl -more-help" "") )
+ (string-append (if (exist? "long-opts") "Fl -" "") "more-help" )
+ ) \:+]
+
+Pass the extended usage information through a pager.[+:
+
+ENDIF no no-libopts
+
+.\" = = = = = = = = = = = = = = = = =
+.\" save and load configuration
+.\" = = = = = = = = = = = = = = = = = :+][+:
+
+IF (exist? "homerc") :+]
+.It [+:
+
+ IF (not (exist? "disable-save")) :+][+:
+
+ (define tmp-val (get "save-opts-value" ">"))
+ (if (and use-flags (> (string-length tmp-val) 0))
+ (string-append "Fl " tmp-val " Oo Ar cfgfile Oc"
+ (if (exist? "long-opts")
+ " , Fl -save-opts Oo Ns = Ns Ar cfgfile Oc" ) "")
+ (string-append (if (exist? "long-opts") "Fl -" "")
+ "save-opts Oo Ns = Ns Ar cfgfile Oc" )
+ ) \:+]
+
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It [+:
+ ENDIF saving not disabled :+][+:
+
+ (define tmp-val (get "load-opts-value" "<"))
+ (define tmp-str (if (exist? "long-opts") "Fl -" ""))
+
+ (if (and use-flags (> (string-length tmp-val) 0))
+ (string-append "Fl " tmp-val " Ar cfgfile"
+ (if (exist? "long-opts")
+ (string-append " , " tmp-str "load-opts Ns = Ns Ar cfgfile"
+ " , " tmp-str "no-load-opts" )
+ "") )
+ (string-append tmp-str "load-opts Ns = Ns Ar cfgfile , "
+ tmp-str "no-load-opts" )
+ ) \:+]
+
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.[+:
+
+ENDIF (exist? "homerc")
+
+.\" = = = = = = = = = = = = = = = = =
+.\" version
+.\" = = = = = = = = = = = = = = = = = :+][+:
+
+IF (exist? "version") :+]
+.It [+:
+
+ (define tmp-val (get "version-value" "v"))
+ (if (and use-flags (> (string-length tmp-val) 0))
+ (string-append "Fl " tmp-val " Op Brq Ar v|c|n"
+ (if (exist? "long-opts")
+ " Fl -version Op Brq Ar v|c|n" ) "")
+ (string-append (if (exist? "long-opts") "Fl -" "")
+ "version Op Brq Ar v|c|n" )
+ ) \:+]
+
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.[+:
+ENDIF :+]
+.El
+[+:
+
+(if formatted-doc
+ (shell (string-append
+ "fn='" (find-file cvt-cmd)
+ "'\ntest -f ${fn} || die '" cvt-cmd " not found'\n"
+ "${fn} <<\\_EndOfMdoc_ || die ${fn} failed in $PWD\n"
+ (out-pop #t)
+ "\n_EndOfMdoc_" )) ) :+][+:
+
+ENDDEF mk-options
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - O P T I O N - P R E S E T S
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-option-presets \:+]
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from [+:
+ IF (. home-rc-files)
+ :+]configuration ("RC" or ".INI") file(s)[+:
+ IF (. environ-init) :+] and values from
+[+:
+ ENDIF :+][+:
+ ENDIF :+][+:
+ IF (. environ-init) :+]environment variables named:
+.nf
+ \fB[+:(. UP-PROG-NAME):+]_<option-name>\fP or \fB[+:(. UP-PROG-NAME):+]\fP
+.fi
+.ad[+:
+ IF (. home-rc-files) :+]
+The environmental presets take precedence (are processed later than)
+the configuration files.[+:
+ ENDIF :+][+:
+ ELSE :+].[+:
+ ENDIF :+][+:
+
+ CASE
+ (define rc-file
+ (get "rcfile" (string-append "." (get "prog-name") "rc")) )
+ (count "homerc") :+][+:
+
+ == "0" :+][+:
+ == "1" :+][+:
+
+ CASE homerc :+][+:
+ ~~ '\.|\$HOME' :+]
+The file "\fI[+: (string-append (get "homerc") "/" rc-file)
+:+]\fP" will be used, if present.[+:
+
+ == "" :+][+:
+
+ * :+]
+The \fIhomerc\fP file is "\fI[+:homerc:+]\fP", unless that is a directory.
+In that case, the file "\fI[+: (. rc-file) :+]\fP"
+is searched for within that directory.[+:
+ ESAC :+][+:
+
+ * :+]
+The \fIhomerc\fP files are [+:
+ FOR homerc ", " :+][+:
+ IF (last-for?) :+]and [+:
+ ENDIF :+]"\fI[+: homerc :+]\fP"[+: ENDFOR :+].
+If any of these are directories, then the file \fI[+: (. rc-file) :+]\fP
+is searched for within those directories.[+:
+ ESAC :+][+:
+
+ENDDEF mk-option-presets
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - E X I T - S T A T U S
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-exit-status \:+]
+One of the following exit values will be returned:
+.Bl -tag
+[+:
+(ag-fprintf 0 ".It 0 \" (EXIT_%s)\"\n%s\n"
+ (string->c-name! (string-upcase (get "exit-name[0]" "SUCCESS")))
+ (get "exit-desc[0]" "Successful program execution.") )
+
+(define need-ex-noinput (exist? "homerc"))
+(define need-ex-software #t)
+
+(ag-fprintf 0 ".It 1 \" (EXIT_%s)\"\n%s\n"
+ (string->c-name! (string-upcase (get "exit-name[1]" "FAILURE")))
+ (get "exit-desc[1]"
+ "The operation failed or the command syntax was not valid.")) :+][+:
+
+FOR exit-desc (for-from 2) :+][+:
+ (if (= (for-index) 66)
+ (set! need-ex-noinput #f)
+ (if (= (for-index) 70)
+ (set! need-ex-software #f) ))
+
+ (set! tmp-str (get (sprintf "exit-name[%d]" (for-index)) "* unnamed *"))
+ (sprintf ".It %d \" (EXIT_%s)\"\n%s\n"
+ (for-index)
+ (string-upcase (string->c-name! tmp-str))
+ (get "exit-desc" "")) :+][+:
+ENDFOR exit-desc :+][+:
+(if need-ex-noinput
+ (emit ".It 66 \" (EX_NOINPUT)\"
+A specified configuration file could not be loaded.\n"))
+
+(if need-ex-software
+ (emit ".It 70 \" (EX_SOFTWARE)\"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.\n"))
+
+(if (> (string-length fname-line) 1)
+ (emit fname-line)) :+]
+.El
+[+:
+
+ENDDEF mk-exit-status
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - A U T H O R S
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-authors :+][+:
+
+ (define remove-authors #t)
+
+ (set! tmp-val
+ (if (exist? "copyright.author")
+ (stack-join ",\n" "copyright.author")
+ (stack-join ",\n" "copyright.owner") ))
+
+ (if (> (string-length tmp-val) 1)
+ (string-append tmp-val "\n")
+ (delete-file file-name))
+
+ :+][+:
+
+ENDDEF mk-authors
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - B U G S
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-bugs :+][+:
+
+ (set! tmp-val (get "copyright.eaddr" (get "eaddr")))
+ (if (> (string-length tmp-val) 1)
+ (string-append "Please send bug reports to: " tmp-val "\n")
+ (delete-file file-name) )
+ :+][+:
+
+ENDDEF mk-bugs :+][+:
+
+DEFINE append-bugs :+][+:
+
+ (set! tmp-val (get "copyright.eaddr" (get "eaddr")))
+ (if (> (string-length tmp-val) 1)
+ (string-append "\n.Pp\nPlease send bug reports to: " tmp-val "\n") )
+ :+][+:
+
+ENDDEF append-bugs
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - C O P Y R I G H T (+ licensing)
+.\"
+.\" This section is guaranteed to be the last section in the man page
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-copyright \:+]
+Copyright (C) [+: copyright.date :+] [+:
+ (get "copyright.owner" (get "copyright.author" (get "copyright.eaddr")))
+ :+] all rights reserved.
+[+: CASE (get "copyright.type") :+][+:
+ = note :+][+: (get "copyright.text") :+][+:
+ == '' :+]This program has an unspecified license.[+:
+
+ * :+][+:
+ (string-append "This program is released under the terms of "
+ (license-name (get "copyright.type")) ".") :+][+:
+
+ ESAC :+]
+[+:
+ENDDEF mk-copyright
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - N O T E S
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-notes \:+]
+This manual page was \fIAutoGen\fP-erated from the \fB[+: prog-name :+]\fP
+option definitions.
+[+:
+
+ENDDEF mk-notes
+
+.\" = = = = = APPEND TO IT: :+][+:
+
+DEFINE append-notes :+]
+.Pp
+This manual page was \fIAutoGen\fP-erated from the \fB[+: prog-name :+]\fP
+option definitions.[+:
+
+ENDDEF append-notes
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - E N V I R O N M E N T
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-environment :+][+:
+ INVOKE append-environment :+][+:
+ENDDEF mk-environment
+
+.\" = = = = = APPEND TO IT: :+][+:
+
+DEFINE append-environment :+]
+[+:(. environ-text) :+][+:
+ENDDEF append-environment
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" M K - F I L E S
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE mk-files :+][+:
+ INVOKE append-files :+][+:
+ENDDEF mk-files
+
+.\" = = = = = APPEND TO IT: :+][+:
+
+DEFINE append-files :+]
+[+:(. home-rc-text) :+][+:
+ENDDEF append-files
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" E M I T A L I A S O P T
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE emit-alias-opt :+]
+.It [+:
+ IF (exist? "value") :+][+:
+ IF (exist? "long-opts") \:+]
+ Fl [+:value:+] , Fl \-[+: name :+][+:
+ ELSE \:+]
+ Fl [+:value:+][+:
+ ENDIF (exist? "long-opts") :+][+:
+
+ ELSE value does not exist -- named option only :+][+:
+
+ IF (not (exist? "long-opts")) \:+]
+ [+: name :+][+:
+ ELSE \:+]
+ Fl \-[+: (get "name") :+][+:
+ ENDIF :+][+:
+ ENDIF :+]
+This is an alias for the \fI--[+: aliases :+]\fR option.[+:
+ IF (exist? "deprecated") :+]
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+[+:
+ ENDIF :+][+:
+ENDDEF emit-alias-opt
+
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+.\" E M I T F L A G T E X T
+.\" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = :+][+:
+
+DEFINE emit-flag-text :+][+:
+
+ (if (exist? "enable")
+ (set! opt-name (string-append (get "enable") "-" (get "name")))
+ (set! opt-name (get "name")) )
+ (if (exist? "disable")
+ (set! dis-name (string-append (get "disable") "-" (get "name")))
+ (set! dis-name "") )
+
+ (set! opt-name (fix-optname opt-name))
+ (if (> (string-length dis-name) 0)
+ (set! dis-name (fix-optname dis-name)) )
+
+ (if (not (exist? "arg-type"))
+ (set! opt-arg "")
+ (set! opt-arg (string-append "Ar "
+ (fix-optname (if (exist? "arg-name")
+ (get "arg-name")
+ (string-downcase! (get "arg-type")) ))
+ ))
+ )
+
+:+]
+.It [+:
+ IF (exist? "value") :+][+:
+ IF (exist? "long-opts") :+][+:
+
+ # * * * * * * * * * * * * * * * * * * * *
+ *
+ * The option has a flag value (character) AND
+ * the program uses long options
+ *
+ \:+]
+ Fl [+:value:+][+:
+ IF (not (exist? "arg-type")) :+] , Fl -[+:
+ ELSE :+] [+:(. opt-arg):+] , Fl -[+:
+ ENDIF :+][+: (. opt-name) :+] [+:
+ IF (exist? "arg-type") :+][+:
+ ? arg-optional Oo Ns = Ns
+ :+] [+: (. opt-arg) :+] [+:
+ arg-optional Oc :+][+:
+ ENDIF :+][+:
+ IF (exist? "disable") :+] , Fl -[+:(. dis-name):+][+:
+ ENDIF :+][+:
+
+ ELSE :+][+:
+
+ # * * * * * * * * * * * * * * * * * * * *
+ *
+ * The option has a flag value (character) BUT
+ * the program does _NOT_ use long options
+ *
+ \:+]
+ Fl [+:value:+] [+:
+ IF (exist? "arg-type") :+][+:
+ arg-optional Oo :+] [+:(. opt-arg):+] [+:
+ arg-optional Oc :+] [+:
+ ENDIF " :+][+:
+ ENDIF (exist? "long-opts") :+][+:
+
+
+ ELSE value does not exist -- named option only :+][+:
+
+ IF (not (exist? "long-opts")) :+][+:
+
+ # * * * * * * * * * * * * * * * * * * * *
+ *
+ * The option does not have a flag value (character).
+ * The program does _NOT_ use long options either.
+ * Special magic: All arguments are named options.
+ *
+ \:+]
+ [+: (. opt-name) :+] [+:
+ IF (exist? "arg-type") :+] [+:
+ ? arg-optional ' Oo = Ns' ' Ns = Ns '
+ :+] [+:(. opt-arg) :+] [+:
+ arg-optional Oc :+] [+:
+ ENDIF:+][+:
+ IF (exist? "disable") :+] , Fl -[+:(. dis-name):+][+:
+ ENDIF :+][+:
+
+
+ ELSE :+][+:
+ # * * * * * * * * * * * * * * * * * * * *
+ *
+ * The option does not have a flag value (character).
+ * The program, instead, only accepts long options.
+ *
+ \:+]
+ Fl -[+: (. opt-name) :+] [+:
+
+ IF (exist? "arg-type") :+][+:
+ arg-optional Oo :+] Ns = Ns [+:(. opt-arg):+] [+:
+ arg-optional Oc :+][+:
+ ENDIF :+][+:
+
+ IF (exist? "disable")
+ :+], " Fl \-[+:(. dis-name):+]"[+:
+ ENDIF :+][+:
+ ENDIF :+][+:
+ ENDIF :+]
+[+: (get "descrip" "") :+].[+:
+
+ IF (exist? "min") :+]
+This option is required to appear.[+:
+ ENDIF :+][+:
+
+ IF (exist? "max") :+]
+This option may appear [+:
+ IF % max (= "%s" "NOLIMIT")
+ :+]an unlimited number of times[+:ELSE
+ :+]up to [+: max :+] times[+:
+ ENDIF:+].[+:
+ ENDIF:+][+:
+
+ IF (exist? "disable") :+]
+The \fI[+:(. dis-name):+]\fP form will [+:
+ IF (exist? "stack-arg")
+ :+]clear the list of option arguments[+:
+ ELSE :+]disable the option[+:
+ ENDIF :+].[+:
+ ENDIF:+][+:
+
+ IF (exist? "enabled") :+]
+This option is enabled by default.[+:
+ ENDIF :+][+:
+
+ IF (exist? "no-preset") :+]
+This option may not be preset with environment variables
+or in initialization (rc) files.[+:
+ ENDIF :+][+:
+
+ IF (and (exist? "default") named-mode) :+]
+This option is the default option.[+:
+ ENDIF :+][+:
+
+ IF (exist? "equivalence") :+]
+This option is a member of the [+:equivalence:+] class of options.[+:
+ ENDIF :+][+:
+
+ IF (exist? "flags-must") :+]
+This option must appear in combination with the following options:
+[+: FOR flags-must ", " :+][+:flags-must:+][+:ENDFOR:+].[+:
+ ENDIF :+][+:
+
+ IF (exist? "flags-cant") :+]
+This option must not appear in combination with any of the following options:
+[+: FOR flags-cant ", " :+][+:flags-cant:+][+:ENDFOR:+].[+:
+ ENDIF :+][+:
+
+
+ IF (~* (get "arg-type") "key|set") :+]
+This option takes a keyword as its argument[+:
+
+ IF (=* (get "arg-type") "set")
+
+:+] list. Each entry turns on or off
+membership bits. The bits are set by name or numeric value and cleared
+by preceding the name or number with an exclamation character ('!').
+They can all be cleared with the magic name \fInone\fR and they can all be set
+with
+.IR all .
+A single option will process a list of these values.[+:
+
+ ELSE
+
+:+]. The argument sets an enumeration value that can
+be tested by comparing them against the option value macro.[+:
+
+ ENDIF
+
+:+]
+The available keywords are:
+.in +4
+.nf
+.na
+[+: (shellf "${CLexe} --indent='' --spread=1 -W50 <<_EOF_\n%s\n_EOF_"
+ (join "\n" (stack "keyword")) ) :+]
+.fi
+or their numeric equivalent.
+.in -4[+: (if (exist? "arg-default") "\n.sp" ) :+][+:
+
+ ELIF (=* (get "arg-type") "num") :+]
+This option takes an integer number as its argument.[+:
+
+ IF (exist? "arg-range") :+]
+The value of
+.[+:(. opt-arg):+]
+is constrained to being:
+.in +4
+.nf
+.na[+:FOR arg_range ", or" :+]
+[+: (shellf "
+range='%s'
+
+case \"X${range}\" in
+X'->'?* )
+ echo \"less than or equal to\" `
+ echo $range | sed 's/->//' ` ;;
+
+X?*'->' )
+ echo \"greater than or equal to\" `
+ echo $range | sed 's/->.*//' ` ;;
+
+X?*'->'?* )
+ echo \"in the range \" `
+ echo $range | sed 's/->/ through /' ` ;;
+
+X?* )
+ echo exactly $range ;;
+
+X* ) echo $range is indeterminate
+esac"
+
+(get "arg-range") )
+:+][+:
+ ENDFOR arg-range :+]
+.fi
+.in -4[+:
+
+ ENDIF arg-range exists :+][+:
+
+ ENDIF arg-type key/set/num :+][+:
+
+ IF (exist? "arg-default") :+]
+The default
+.[+: (. opt-arg) :+]
+for this option is:
+.ti +4
+ [+: (join " + " (stack "arg-default" )) :+][+:
+ ENDIF :+]
+.sp
+[+:
+ (if (exist? "doc") (string-substitute (get "doc" "") "\n\n" "\n.sp\n")
+ "This option has not been fully documented." ) :+][+:
+ IF (exist? "deprecated") :+]
+.sp
+.B
+NOTE: THIS OPTION IS DEPRECATED
+[+:
+ ENDIF :+][+:
+
+ENDDEF emit-flag-text
+
+.\" cmd-doc.tlib ends here \:+]
diff --git a/sntp/ag-tpl/0-old/mdoc-synopsis.tlib b/sntp/ag-tpl/0-old/mdoc-synopsis.tlib
new file mode 100644
index 0000000..35fe05b
--- /dev/null
+++ b/sntp/ag-tpl/0-old/mdoc-synopsis.tlib
@@ -0,0 +1,92 @@
+[+: autogen5 template man :+][+:
+DEFINE mk-synopsis :+][+:
+ (out-push-new file-name) \:+]
+.Sh SYNOPSIS
+.Nm[+:
+
+ IF (. use-flags) :+][+:
+ IF (exist? "long-opts") :+]
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[+: ELSE no long options: :+]
+.Op Fl flags
+.Op Fl flag Op Ar value
+[+: ENDIF
+ :+][+:
+ ELIF (exist? "long-opts")
+ :+]
+.Op Fl \-option-name
+.Op Fl \-option-name Ar value
+[+:
+
+ ELIF (not (exist? "argument")) :+]
+.Op Ar option\-name Ar value
+.Pp
+All arguments are named options.
+[+:
+ ENDIF :+][+:
+
+ IF (exist? "argument") :+][+:
+ argument :+][+:
+
+ IF (exist? "reorder-args") :+]
+.Pp
+Operands and options may be intermixed. They will be reordered.
+[+: ENDIF :+][+:
+
+ ELIF (or (exist? "long-opts") use-flags)
+
+:+]
+.Pp
+All arguments must be options.
+[+:
+
+ ENDIF :+][+:
+
+ IF (exist? "main") :+][+:
+ CASE main.main-type :+][+:
+ == shell-process :+]
+.Pp
+This program will emit text that is expected to be evaluated by
+a Bourne-compatible shell, thus digesting the options for the script.[+:
+
+ == shell-parser :+]
+.Pp
+This program is designed to produce output suitable for inclusion
+into a shell script that will parse the options described.[+:
+
+ == for-each :+]
+.Pp
+The operands that this program operates on may be specified either
+on the command line or read from standard input, one per line.
+In that input, leading and trailing white space is stripped,
+blank lines are ignored[+:
+
+ IF (define comment-char (get "comment-char" "#"))
+ (> (string-length comment-char) 1) \:+]
+ and lines beginning with the character
+.I [+: (substring comment-char 1 0):+]
+are treated as comments[+:
+ ENDIF :+].[+:
+
+ IF (exist? "interleaved") :+]
+Options may be interleaved with operands both on the command
+line and when operands are read from standard input.[+:
+ ENDIF interleaved
+
+:+]
+Standard input may not be a terminal.[+:
+
+ ESAC main-type :+][+:
+ ENDIF main exists :+]
+.Pp
+[+:
+
+FOR explain "\n.Pp\n" :+][+:
+ (get "explain" "") :+][+:
+ENDFOR :+][+:
+
+(out-pop) :+][+:
+ENDDEF mk-synopsis :+]
diff --git a/sntp/ag-tpl/0-old/mdoc2man b/sntp/ag-tpl/0-old/mdoc2man
new file mode 100755
index 0000000..4595059
--- /dev/null
+++ b/sntp/ag-tpl/0-old/mdoc2man
@@ -0,0 +1,193 @@
+#!/usr/bin/perl
+
+### ToDo
+# Properly implement -columns in the "my %lists" definition...
+#
+# .Xr requires at least 1 arg, the code here expects at least 2
+###
+
+package mdoc2man;
+use strict;
+use warnings;
+use File::Basename;
+use lib dirname(__FILE__);
+use Mdoc qw(hs ns pp mapwords son soff stoggle gen_encloser);
+
+########
+## Basic
+########
+
+Mdoc::def_macro( '.Sh', sub { '.SH', hs, @_ }, raw => 1);
+Mdoc::def_macro( '.Ss', sub { '.SS', hs, @_ }, raw => 1);
+Mdoc::def_macro( '.Pp', sub { ".sp \\n(Ppu\n.ne 2\n" } );
+Mdoc::def_macro( '.Nd', sub { "\\- @_" } );
+
+# Macros that enclose things
+Mdoc::def_macro( '.Brq', gen_encloser(qw({ })) , greedy => 1 );
+Mdoc::def_macro( '.Op' , gen_encloser(qw([ ])) , greedy => 1 );
+Mdoc::def_macro( '.Qq' , gen_encloser(qw(" ")) , greedy => 1 );
+Mdoc::def_macro( '.Dq' , gen_encloser(qw(\*[Lq] \*[Rq])), greedy => 1 );
+Mdoc::def_macro( '.Ql' , gen_encloser(qw(\[oq] \[cq])) , greedy => 1 );
+Mdoc::def_macro( '.Sq' , gen_encloser(qw(\[oq] \[cq])) , greedy => 1 );
+Mdoc::def_macro( '.Pq' , gen_encloser(qw/( )/) , greedy => 1 );
+Mdoc::def_macro( '.D1' , sub { ".in +4\n", ns, @_ , ns , "\n.in -4" } , greedy => 1);
+
+Mdoc::def_macro( 'Oo', sub { '[', @_ } );
+Mdoc::def_macro( 'Oc', sub { ']', @_ } );
+
+Mdoc::def_macro( 'Po', sub { '(', @_} );
+Mdoc::def_macro( 'Pc', sub { ')', @_ } );
+
+Mdoc::def_macro( 'Bro', sub { '{', ns, @_ } );
+Mdoc::def_macro( 'Brc', sub { '}', @_ } );
+
+Mdoc::def_macro( '.Oo', gen_encloser(qw([ ])), concat_until => '.Oc' );
+Mdoc::def_macro( '.Bro', gen_encloser(qw({ })), concat_until => '.Brc' );
+Mdoc::def_macro( '.Po', gen_encloser(qw/( )/), concat_until => '.Pc' );
+
+Mdoc::def_macro( '.Ev', sub { @_ } );
+Mdoc::def_macro( '.An', sub { ".NOP ", @_, "\n.br" }, raw => 1 );
+Mdoc::def_macro( '.Li', sub { mapwords {"\\f[C]$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Cm', sub { mapwords {"\\f\\*[B-Font]$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Ic', sub { mapwords {"\\f\\*[B-Font]$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Fl', sub { mapwords {"\\f\\*[B-Font]\\-$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Ar', sub { mapwords {"\\f\\*[I-Font]$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Em', sub { mapwords {"\\fI$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Va', sub { mapwords {"\\fI$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Sx', sub { mapwords {"\\fI$_\\f[]"} @_ } );
+Mdoc::def_macro( '.Xr', sub { "\\fC".(shift)."\\fR(".(shift).")\\f[]", @_ } );
+Mdoc::def_macro( '.Fn', sub { "\\f\\*[B-Font]".(shift)."\\fR()\\f[]" } );
+Mdoc::def_macro( '.Fn', sub { "\\fB".(shift)."\\fR()\\f[]" } );
+Mdoc::def_macro( '.Fx', sub { "FreeBSD", @_ } );
+Mdoc::def_macro( '.Ux', sub { "UNIX", @_ } );
+
+Mdoc::def_macro( '.No', sub { ".NOP", map { ($_, ns) } @_ } );
+Mdoc::def_macro( '.Pa', sub { mapwords {"\\fI$_\\f[]"} @_; } );
+{
+ my $name;
+ Mdoc::def_macro('.Nm', sub {
+ $name = shift if (!$name);
+ "\\f\\*[B-Font]$name\\fP", @_
+ } );
+}
+
+########
+## lists
+########
+
+my %lists = (
+ bullet => sub {
+ Mdoc::def_macro('.It', sub { '.IP \fB\(bu\fP 2' });
+ },
+
+ column => sub {
+ Mdoc::def_macro('.It', sub { '.IP \fB\(bu\fP 2' });
+ },
+
+ tag => sub {
+ my (%opts) = @_;
+
+ my $width = '';
+
+ if (exists $opts{width}) {
+ $width = ' '.((length $opts{width})+1);
+ }
+
+ if (exists $opts{compact}) {
+ my $dobrns = 0;
+ Mdoc::def_macro('.It', sub {
+ my @ret = (".TP$width\n.NOP", hs);
+ if ($dobrns) {
+ ".br\n.ns\n", ns, @ret, @_;
+ }
+ else {
+ $dobrns = 1;
+ @ret, @_;
+ }
+ }, raw => 1);
+ }
+ else {
+ Mdoc::def_macro('.It', sub {
+ ".TP$width\n.NOP", hs, @_
+ }, raw => 1);
+ }
+ },
+);
+
+Mdoc::set_Bl_callback(do { my $nested = 0; sub {
+ my $type = shift;
+ my %opts = Mdoc::parse_opts(@_);
+ if (defined $type && $type =~ /-(\w+)/ && exists $lists{$1}) {
+
+ # Wrap nested lists with .RS and .RE
+ Mdoc::set_El_callback(sub {
+ return '.RE' if $nested-- > 1;
+ return '.PP';
+ });
+
+ $lists{$1}->(%opts);
+
+ if ($nested++) {
+ return ".RS";
+ }
+ else {
+ return ();
+ }
+ }
+ else {
+ die "Invalid list type <$type>";
+ }
+}}, raw => 1);
+
+# don't bother with arguments for now and do what mdoc2man'.sh' did
+
+Mdoc::def_macro('.Bd', sub { ".br\n.in +4\n.nf" } );
+Mdoc::def_macro('.Ed', sub { ".in -4\n.fi" } );
+
+Mdoc::set_Re_callback(sub {
+ my ($reference) = @_;
+ <<"REF";
+$reference->{authors},
+\\fI$reference->{title}\\fR,
+$reference->{optional}\n.PP
+REF
+});
+
+# Define all macros which have the same sub for inline and standalone macro
+for (qw(Xr Em Ar Fl Ic Cm Qq Op Nm Pa Sq Li Va Brq Pq Fx Ux)) {
+ my $m = Mdoc::get_macro(".$_");
+ Mdoc::def_macro($_, delete $m->{run}, %$m);
+}
+
+sub print_line {
+ print shift;
+ print "\n";
+}
+
+sub run {
+ print <<'DEFS';
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+DEFS
+
+ while (my ($macro, @args) = Mdoc::parse_line(\*STDIN, \&print_line)) {
+ my @ret = Mdoc::call_macro($macro, @args);
+ print_line(Mdoc::to_string(@ret)) if @ret;
+ }
+ return 0;
+}
+
+exit run(@ARGV) unless caller;
+
+1;
+__END__
diff --git a/sntp/ag-tpl/0-old/mdoc2texi b/sntp/ag-tpl/0-old/mdoc2texi
new file mode 100755
index 0000000..e4966ad
--- /dev/null
+++ b/sntp/ag-tpl/0-old/mdoc2texi
@@ -0,0 +1,162 @@
+#! /usr/bin/perl
+
+### To Do:
+
+# the Bl -column command needs work:
+# - support for "-offset"
+# - support for the header widths
+
+#
+
+###
+
+package mdoc2texi;
+use strict;
+use warnings;
+use File::Basename qw(dirname);
+use lib dirname(__FILE__);
+use Mdoc qw(ns pp hs mapwords gen_encloser nl);
+
+# Ignore commments
+Mdoc::def_macro( '.\"', sub { () } );
+
+# Enclosers
+Mdoc::def_macro( '.An', sub { @_, ns, '@*' } );
+Mdoc::def_macro( '.Aq', gen_encloser(qw(< >)), greedy => 1);
+Mdoc::def_macro( '.Bq', gen_encloser(qw([ ])), greedy => 1);
+Mdoc::def_macro( '.Brq', gen_encloser(qw(@{ @})), greedy => 1);
+Mdoc::def_macro( '.Pq', gen_encloser(qw/( )/), greedy => 1);
+Mdoc::def_macro( '.Qq', gen_encloser(qw(" ")), greedy => 1);
+Mdoc::def_macro( '.Op', gen_encloser(qw(@code{[ ]})), greedy => 1);
+Mdoc::def_macro( '.Ql', gen_encloser(qw(@quoteleft{} @quoteright{})),
+ greedy => 1);
+Mdoc::def_macro( '.Sq', gen_encloser(qw(@quoteleft{} @quoteright{})),
+ greedy => 1);
+Mdoc::def_macro( '.Dq', gen_encloser(qw(@quotedblleft{} @quotedblright{})),
+ greedy => 1);
+Mdoc::def_macro( '.Eq', sub {
+ my ($o, $c) = (shift, pop);
+ gen_encloser($o, $c)->(@_)
+}, greedy => 1);
+Mdoc::def_macro( '.D1', sub { "\@example\n", ns, @_, ns, "\n\@end example" },
+ greedy => 1);
+Mdoc::def_macro( '.Dl', sub { "\@example\n", ns, @_, ns, "\n\@end example" },
+ greedy => 1);
+
+Mdoc::def_macro( '.Oo', gen_encloser(qw(@code{[ ]})), concat_until => '.Oc');
+Mdoc::def_macro( 'Oo', sub { '@code{[', ns, @_ } );
+Mdoc::def_macro( 'Oc', sub { @_, ns, pp(']}') } );
+
+Mdoc::def_macro( '.Bro', gen_encloser(qw(@code{@{ @}})), concat_until => '.Brc');
+Mdoc::def_macro( 'Bro', sub { '@code{@{', ns, @_ } );
+Mdoc::def_macro( 'Brc', sub { @_, ns, pp('@}}') } );
+
+Mdoc::def_macro( '.Po', gen_encloser(qw/( )/), concat_until => '.Pc');
+Mdoc::def_macro( 'Po', sub { '(', @_ } );
+Mdoc::def_macro( 'Pc', sub { @_, ')' } );
+
+Mdoc::def_macro( '.Ar', sub { mapwords {"\@kbd{$_}"} @_ } );
+Mdoc::def_macro( '.Fl', sub { mapwords {"\@code{-$_}"} @_ } );
+Mdoc::def_macro( '.Cm', sub { mapwords {"\@code{-$_}"} @_ } );
+Mdoc::def_macro( '.Ic', sub { mapwords {"\@code{$_}"} @_ } );
+Mdoc::def_macro( '.Cm', sub { mapwords {"\@code{$_}"} @_ } );
+Mdoc::def_macro( '.Li', sub { mapwords {"\@code{$_}"} @_ } );
+Mdoc::def_macro( '.Va', sub { mapwords {"\@code{$_}"} @_ } );
+Mdoc::def_macro( '.Em', sub { mapwords {"\@emph{$_}"} @_ } );
+Mdoc::def_macro( '.Fn', sub { '@code{'.(shift).'()}' } );
+Mdoc::def_macro( '.Ss', sub { "\@subsubsection", hs, @_ });
+Mdoc::def_macro( '.Sh', sub {
+ my $name = "@_";
+ "\@node", hs, "$name\n", ns, "\@subsection", hs, $name
+ });
+Mdoc::def_macro( '.Ss', sub { "\@subsubsection", hs, @_ });
+Mdoc::def_macro( '.Xr', sub { '@code{'.(shift).'('.(shift).')}', @_ } );
+Mdoc::def_macro( '.Sx', gen_encloser(qw(@ref{ })) );
+Mdoc::def_macro( '.Ux', sub { '@sc{unix}', @_ } );
+Mdoc::def_macro( '.Fx', sub { '@sc{freebsd}', @_ } );
+{
+ my $name;
+ Mdoc::def_macro('.Nm', sub {
+ $name = shift || $ENV{AG_DEF_PROG_NAME} || 'XXX' if (!$name);
+ "\@code{$name}"
+ } );
+}
+Mdoc::def_macro( '.Pa', sub { mapwords {"\@file{$_}"} @_ } );
+Mdoc::def_macro( '.Pp', sub { '' } );
+
+# Setup references
+
+Mdoc::def_macro( '.Rs', sub { "\@*\n", @_ } );
+Mdoc::set_Re_callback(sub {
+ my ($reference) = @_;
+ "@*\n", ns, $reference->{authors}, ',', "\@emph{$reference->{title}}",
+ ',', $reference->{optional}
+ });
+
+# Set up Bd/Ed
+
+my %displays = (
+ literal => [ '@verbatim', '@end verbatim' ],
+);
+
+Mdoc::def_macro( '.Bd', sub {
+ (my $type = shift) =~ s/^-//;
+ die "Not supported display type <$type>"
+ if not exists $displays{ $type };
+
+ my $orig_ed = Mdoc::get_macro('.Ed');
+ Mdoc::def_macro('.Ed', sub {
+ Mdoc::def_macro('.Ed', delete $orig_ed->{run}, %$orig_ed);
+ $displays{ $type }[1];
+ });
+ $displays{ $type }[0]
+ });
+Mdoc::def_macro('.Ed', sub { die '.Ed used but .Bd was not seen' });
+
+# Set up Bl/El
+
+my %lists = (
+ bullet => [ '@itemize @bullet', '@end itemize' ],
+ tag => [ '@table @asis', '@end table' ],
+ column => [ '@table @asis', '@end table' ],
+);
+
+Mdoc::set_Bl_callback(sub {
+ my $type = shift;
+ die "Specify a list type" if not defined $type;
+ $type =~ s/^-//;
+ die "Not supported list type <$type>" if not exists $lists{ $type };
+ Mdoc::set_El_callback(sub { $lists{ $type }[1] });
+ $lists{ $type }[0]
+ });
+Mdoc::def_macro('.It', sub { '@item', hs, @_ });
+
+for (qw(Aq Bq Brq Pq Qq Ql Sq Dq Eq Ar Fl Ic Pa Op Cm Li Fx Ux Va)) {
+ my $m = Mdoc::get_macro(".$_");
+ Mdoc::def_macro($_, delete $m->{run}, %$m);
+}
+
+sub print_line {
+ my $s = shift;
+ $s =~ s/\\&//g;
+ print "$s\n";
+}
+
+sub preprocess_args {
+ $_ =~ s/([{}])/\@$1/g for @_;
+}
+
+sub run {
+ while (my ($macro, @args) = Mdoc::parse_line(\*STDIN, \&print_line,
+ \&preprocess_args)
+ ) {
+ my @ret = Mdoc::call_macro($macro, @args);
+ if (@ret) {
+ my $s = Mdoc::to_string(@ret);
+ print_line($s);
+ }
+ }
+ return 0;
+}
+
+exit run(@ARGV) unless caller;
diff --git a/sntp/ag-tpl/0-old/perlopt.tpl b/sntp/ag-tpl/0-old/perlopt.tpl
new file mode 100644
index 0000000..c4fd695
--- /dev/null
+++ b/sntp/ag-tpl/0-old/perlopt.tpl
@@ -0,0 +1,188 @@
+[= AutoGen5 template foo=(base-name) -*- Mode: scheme -*-=]
+[=
+
+(emit (dne "# "))
+
+(if (not (and (exist? "prog-name") (exist? "prog-title") (exist? "version")))
+ (error "prog-name and prog-title are required"))
+(define prog-name (get "prog-name"))
+
+(if (> (string-length prog-name) 16)
+ (error (sprintf "prog-name limited to 16 characters: %s"
+ prog-name)) )
+(if (not (exist? "long-opts"))
+ (error "long-opts is required"))
+
+;; perl list containing string to initialize the option hash
+(define perl_opts "")
+;; perl list containing option definitions for Getopt::Long
+(define perl_defs " ")
+;; usage string
+(define perl_usage "")
+
+(define optname-from "A-Z_^")
+(define optname-to "a-z--")
+(define counter 0)
+
+(define q (lambda (s) (string-append "'" s "'")))
+(define qp (lambda (s) (string-append "q{" s "}")))
+
+=][=
+
+FOR flag =][=
+
+(define optarg "") ;; the option argument for Getopt::Long
+(define opttarget "''") ;; the value of a hash key that represents option
+(define optargname "")
+(define optisarray #f)
+(define optname (string-tr! (get "name") optname-from optname-to))
+
+=][= #
+;; since autoopts doesn't support float we take the combination arg-name =
+;; float and arg-type = string as float
+=][=
+ IF arg-type =][=
+ CASE arg-type =][=
+
+ =* num =][= (set! optarg "=i") =][=
+
+ =* str =][=
+ (if (and (exist? "arg-name") (== (get "arg-name") "float"))
+ (set! optarg "=f")
+ (set! optarg "=s")
+ ) =][=
+
+ * =][=
+ (error (string-append "unknown arg type '"
+ (get "arg-type") "' for " (get "name"))) =][=
+ ESAC arg-type =][=
+ ENDIF =][=
+
+(if (exist? "stack-arg")
+ ;; set optarget to array reference if can take more than one value
+ ;; FIXME: if "max" exists, then just presume it is greater than 1
+ ;;
+ (if (and (exist? "max") (== (get "max") "NOLIMIT"))
+ (begin
+ (set! opttarget (string-append
+ "["
+ (if (exist? "arg-default") (q (get "arg-default")) "")
+ "]"
+ )
+ )
+ (set! optisarray #t)
+ )
+ (error "If stack-arg then max has to be NOLIMIT")
+ )
+ ;; just scalar otherwise
+ (if (exist? "arg-default") (set! opttarget (q (get "arg-default"))))
+)
+
+(set! perl_opts (string-append perl_opts
+ "'" (get "name") "' => " opttarget ",\n "))
+
+(define def_add (string-append "'" optname (if (exist? "value")
+ (string-append "|" (get "value")) "") optarg "',"))
+
+(define add_len (+ (string-length def_add) counter))
+(if (> add_len 80)
+ (begin
+ (set! perl_defs (string-append perl_defs "\n " def_add))
+ (set! counter 8)
+ )
+ (begin
+ (set! perl_defs (string-append perl_defs " " def_add))
+ (set! counter (+ counter add_len))
+ )
+)
+
+(if (exist? "arg-type")
+ (if (and (exist? "arg-name") (== (get "arg-name") "float"))
+ (set! optargname "=float")
+ (set! optargname (string-append "=" (substring (get "arg-type") 0 3)))
+ )
+ (set! optargname " ")
+)
+
+(if (not (exist? "deprecated"))
+ (set! perl_usage (string-append perl_usage
+ (sprintf "\n %-28s %s" (string-append
+ (if (exist? "value") (string-append "-" (get "value") ",") " ")
+ " --"
+ (get "name")
+ optargname)
+ (get "descrip"))
+) ) )
+(if optisarray
+ (set! perl_usage (string-append perl_usage
+ "\n - may appear multiple times"))
+)
+
+=][=
+
+ENDFOR each "flag" =]
+
+use Getopt::Long qw(GetOptionsFromArray);
+Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case_always));
+
+my $usage;
+
+sub usage {
+ my ($ret) = @_;
+ print STDERR $usage;
+ exit $ret;
+}
+
+sub paged_usage {
+ my ($ret) = @_;
+ my $pager = $ENV{PAGER} || '(less || more)';
+
+ open STDOUT, "| $pager" or die "Can't fork a pager: $!";
+ print $usage;
+
+ exit $ret;
+}
+
+sub processOptions {
+ my $args = shift;
+
+ my $opts = {
+ [= (. perl_opts) =]'help' => '', 'more-help' => ''
+ };
+ my $argument = '[= argument =]';
+ my $ret = GetOptionsFromArray($args, $opts, (
+[= (. perl_defs) =]
+ 'help|?', 'more-help'));
+
+ $usage = <<'USAGE';
+[= prog-name =] - [= prog-title =] - Ver. [= version =]
+USAGE: [= prog-name =] [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [= argument =]
+[= (. perl_usage) =]
+ -?, --help Display usage information and exit
+ --more-help Pass the extended usage information through a pager
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+USAGE
+
+ usage(0) if $opts->{'help'};
+ paged_usage(0) if $opts->{'more-help'};[=
+
+CASE argument =][=
+!E =][=
+==* "[" =][=
+* =]
+
+ if ($argument && $argument =~ /^[^\[]/ && !@$args) {
+ print STDERR "Not enough arguments supplied (See --help/-?)\n";
+ exit 1;
+ }[=
+
+ESAC
+
+=]
+ $_[0] = $opts;
+ return $ret;
+}
+
+END { close STDOUT };
diff --git a/sntp/bincheck.mf b/sntp/bincheck.mf
new file mode 100644
index 0000000..67f461f
--- /dev/null
+++ b/sntp/bincheck.mf
@@ -0,0 +1,17 @@
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
diff --git a/sntp/check-libntp.mf b/sntp/check-libntp.mf
new file mode 100644
index 0000000..b867a3a
--- /dev/null
+++ b/sntp/check-libntp.mf
@@ -0,0 +1,15 @@
+## check-libntp.mf - automake fragment
+##
+## tests/libntp/Makefile.am
+## sntp/tests/Makefile.am
+## The above files have adaptations of this for deeper nesting.
+
+BUILT_SOURCES += check-libntp
+CLEANFILES += check-libntp
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
diff --git a/sntp/check-libopts.mf b/sntp/check-libopts.mf
new file mode 100644
index 0000000..7c79b3f
--- /dev/null
+++ b/sntp/check-libopts.mf
@@ -0,0 +1,14 @@
+## check-libopts.mf - automake fragment
+##
+## If we are not using the tearoff libopts, we won't be
+## building its libopts.la, so the submake is allowed
+## to fail.
+
+BUILT_SOURCES += check-libopts
+CLEANFILES += check-libopts
+
+check-libopts: libopts/libopts.la
+ @echo stamp > $@
+
+libopts/libopts.la:
+ -cd libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
diff --git a/sntp/config.h.in b/sntp/config.h.in
new file mode 100644
index 0000000..122fee5
--- /dev/null
+++ b/sntp/config.h.in
@@ -0,0 +1,1011 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* why not HAVE_P_S? */
+#undef CALL_PTHREAD_SETCONCURRENCY
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Enable debugging code? */
+#undef DEBUG
+
+/* Directory separator character, usually / or \\ */
+#undef DIR_SEP
+
+/* number of args to el_init() */
+#undef EL_INIT_ARGS
+
+/* nls support in libopts */
+#undef ENABLE_NLS
+
+/* successful termination */
+#undef EX_OK
+
+/* internal software error */
+#undef EX_SOFTWARE
+
+/* fopen(3) accepts a 'b' in the mode flag */
+#undef FOPEN_BINARY_FLAG
+
+/* fopen(3) accepts a 't' in the mode flag */
+#undef FOPEN_TEXT_FLAG
+
+/* What is getsockname()'s socklen type? */
+#undef GETSOCKNAME_SOCKLEN_TYPE
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#undef HAVE_ARPA_NAMESER_H
+
+/* Define to 1 if you have the `canonicalize_file_name' function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
+/* Define to 1 if you have the `chmod' function. */
+#undef HAVE_CHMOD
+
+/* Define to 1 if you have the `clock_getres' function. */
+#undef HAVE_CLOCK_GETRES
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `clock_settime' function. */
+#undef HAVE_CLOCK_SETTIME
+
+/* Define to 1 if you have the <cthreads.h> header file. */
+#undef HAVE_CTHREADS_H
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRERROR_R
+
+/* Define this if /dev/zero is readable device */
+#undef HAVE_DEV_ZERO
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Can we drop root privileges? */
+#undef HAVE_DROPROOT
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the `fchmod' function. */
+#undef HAVE_FCHMOD
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `fork' function. */
+#undef HAVE_FORK
+
+/* Define to 1 if you have the `fstat' function. */
+#undef HAVE_FSTAT
+
+/* Define to 1 if you have the `getclock' function. */
+#undef HAVE_GETCLOCK
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAVE_GETIFADDRS
+
+/* if you have GNU Pth */
+#undef HAVE_GNU_PTH
+
+/* Define to 1 if you have the <histedit.h> header file. */
+#undef HAVE_HISTEDIT_H
+
+/* Define to 1 if you have the <history.h> header file. */
+#undef HAVE_HISTORY_H
+
+/* Define to 1 if you have the `if_nametoindex' function. */
+#undef HAVE_IF_NAMETOINDEX
+
+/* inline keyword or macro available */
+#undef HAVE_INLINE
+
+/* Define to 1 if the system has the type `int16_t'. */
+#undef HAVE_INT16_T
+
+/* Define to 1 if the system has the type `int32'. */
+#undef HAVE_INT32
+
+/* int32 type in DNS headers, not others. */
+#undef HAVE_INT32_ONLY_WITH_DNS
+
+/* Define to 1 if the system has the type `int32_t'. */
+#undef HAVE_INT32_T
+
+/* Define to 1 if the system has the type `int8_t'. */
+#undef HAVE_INT8_T
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#undef HAVE_INTMAX_T
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `gen' library (-lgen). */
+#undef HAVE_LIBGEN
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
+/* Define to 1 if you have the `intl' library (-lintl). */
+#undef HAVE_LIBINTL
+
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* using Linux pthread? */
+#undef HAVE_LINUXTHREADS
+
+/* Do we have Linux capabilities? */
+#undef HAVE_LINUX_CAPABILITIES
+
+/* Define to 1 if you have the <linux/if_addr.h> header file. */
+#undef HAVE_LINUX_IF_ADDR_H
+
+/* if you have LinuxThreads */
+#undef HAVE_LINUX_THREADS
+
+/* Define to 1 if you have the `localeconv' function. */
+#undef HAVE_LOCALECONV
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if the system has the type `long double'. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define to 1 if the system has the type `long long int'. */
+#undef HAVE_LONG_LONG_INT
+
+/* if you have SunOS LWP package */
+#undef HAVE_LWP
+
+/* Define to 1 if you have the <lwp/lwp.h> header file. */
+#undef HAVE_LWP_LWP_H
+
+/* define if you have Mach Cthreads */
+#undef HAVE_MACH_CTHREADS
+
+/* Define to 1 if you have the <mach/cthreads.h> header file. */
+#undef HAVE_MACH_CTHREADS_H
+
+/* Define to 1 if you have the `MD5Init' function. */
+#undef HAVE_MD5INIT
+
+/* Define to 1 if you have the <md5.h> header file. */
+#undef HAVE_MD5_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/in_system.h> header file. */
+#undef HAVE_NETINET_IN_SYSTEM_H
+
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+#undef HAVE_NETINET_IN_SYSTM_H
+
+/* Define to 1 if you have the <netinet/in_var.h> header file. */
+#undef HAVE_NETINET_IN_VAR_H
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#undef HAVE_NETINET_IP_H
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
+/* Define to 1 if you have the <net/if_var.h> header file. */
+#undef HAVE_NET_IF_VAR_H
+
+/* sntp does not care about 'nice' */
+#undef HAVE_NO_NICE
+
+/* if you have NT Event Log */
+#undef HAVE_NT_EVENT_LOG
+
+/* if you have NT Service Manager */
+#undef HAVE_NT_SERVICE_MANAGER
+
+/* if you have NT Threads */
+#undef HAVE_NT_THREADS
+
+/* Define this if pathfind(3) works */
+#undef HAVE_PATHFIND
+
+/* Define to 1 if the system has the type `pid_t'. */
+#undef HAVE_PID_T
+
+/* Define to 1 if you have the <priv.h> header file. */
+#undef HAVE_PRIV_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* define to pthreads API spec revision */
+#undef HAVE_PTHREADS
+
+/* Define to 1 if you have the `pthread_attr_getstacksize' function. */
+#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
+
+/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
+#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
+
+/* define if you have pthread_detach function */
+#undef HAVE_PTHREAD_DETACH
+
+/* Define to 1 if you have the `pthread_getconcurrency' function. */
+#undef HAVE_PTHREAD_GETCONCURRENCY
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the `pthread_kill' function. */
+#undef HAVE_PTHREAD_KILL
+
+/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */
+#undef HAVE_PTHREAD_KILL_OTHER_THREADS_NP
+
+/* define if you have pthread_rwlock_destroy function */
+#undef HAVE_PTHREAD_RWLOCK_DESTROY
+
+/* Define to 1 if you have the `pthread_setconcurrency' function. */
+#undef HAVE_PTHREAD_SETCONCURRENCY
+
+/* Define to 1 if you have the `pthread_yield' function. */
+#undef HAVE_PTHREAD_YIELD
+
+/* Define to 1 if you have the <pth.h> header file. */
+#undef HAVE_PTH_H
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#undef HAVE_PTRDIFF_T
+
+/* Define to 1 if you have the <readline.h> header file. */
+#undef HAVE_READLINE_H
+
+/* Define if your readline library has \`add_history' */
+#undef HAVE_READLINE_HISTORY
+
+/* Define to 1 if you have the <readline/history.h> header file. */
+#undef HAVE_READLINE_HISTORY_H
+
+/* Define to 1 if you have the <readline/readline.h> header file. */
+#undef HAVE_READLINE_READLINE_H
+
+/* Define this if we have a functional realpath(3C) */
+#undef HAVE_REALPATH
+
+/* Define to 1 if you have the `recvmsg' function. */
+#undef HAVE_RECVMSG
+
+/* Define to 1 if you have the <resolv.h> header file. */
+#undef HAVE_RESOLV_H
+
+/* Define to 1 if you have the `res_init' function. */
+#undef HAVE_RES_INIT
+
+/* Define to 1 if you have the <runetype.h> header file. */
+#undef HAVE_RUNETYPE_H
+
+/* Define to 1 if you have the <sched.h> header file. */
+#undef HAVE_SCHED_H
+
+/* Define to 1 if you have the `sched_yield' function. */
+#undef HAVE_SCHED_YIELD
+
+/* Define to 1 if you have the <semaphore.h> header file. */
+#undef HAVE_SEMAPHORE_H
+
+/* Define to 1 if you have the `sem_timedwait' function. */
+#undef HAVE_SEM_TIMEDWAIT
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#undef HAVE_SETJMP_H
+
+/* Define to 1 if you have the `settimeofday' function. */
+#undef HAVE_SETTIMEOFDAY
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Can we use SIGIO for tcp and udp IO? */
+#undef HAVE_SIGNALED_IO
+
+/* Define to 1 if you have the `sigset' function. */
+#undef HAVE_SIGSET
+
+/* Define to 1 if you have the `sigvec' function. */
+#undef HAVE_SIGVEC
+
+/* sigwait() available? */
+#undef HAVE_SIGWAIT
+
+/* Define to 1 if the system has the type `size_t'. */
+#undef HAVE_SIZE_T
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if you have the `socketpair' function. */
+#undef HAVE_SOCKETPAIR
+
+/* Are Solaris privileges available? */
+#undef HAVE_SOLARIS_PRIVS
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `stime' function. */
+#undef HAVE_STIME
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
+/* Define this if strftime() works */
+#undef HAVE_STRFTIME
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strsignal' function. */
+#undef HAVE_STRSIGNAL
+
+/* Define to 1 if `decimal_point' is a member of `struct lconv'. */
+#undef HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Define to 1 if `thousands_sep' is a member of `struct lconv'. */
+#undef HAVE_STRUCT_LCONV_THOUSANDS_SEP
+
+/* Do we have struct ntptimeval? */
+#undef HAVE_STRUCT_NTPTIMEVAL
+
+/* Does a system header define struct sockaddr_storage? */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* struct timespec declared? */
+#undef HAVE_STRUCT_TIMESPEC
+
+/* Define to 1 if you have the <synch.h> header file. */
+#undef HAVE_SYNCH_H
+
+/* Define to 1 if you have the `sysconf' function. */
+#undef HAVE_SYSCONF
+
+/* Define to 1 if you have the <sysexits.h> header file. */
+#undef HAVE_SYSEXITS_H
+
+/* */
+#undef HAVE_SYSLOG_FACILITYNAMES
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define to 1 if you have the <sys/capability.h> header file. */
+#undef HAVE_SYS_CAPABILITY_H
+
+/* Define to 1 if you have the <sys/clockctl.h> header file. */
+#undef HAVE_SYS_CLOCKCTL_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/limits.h> header file. */
+#undef HAVE_SYS_LIMITS_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/prctl.h> header file. */
+#undef HAVE_SYS_PRCTL_H
+
+/* Define to 1 if you have the <sys/procset.h> header file. */
+#undef HAVE_SYS_PROCSET_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/stropts.h> header file. */
+#undef HAVE_SYS_STROPTS_H
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define to 1 if you have the <sys/timepps.h> header file. */
+#undef HAVE_SYS_TIMEPPS_H
+
+/* Define to 1 if you have the <sys/timers.h> header file. */
+#undef HAVE_SYS_TIMERS_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if the system has the type `s_char'. */
+#undef HAVE_S_CHAR
+
+/* sntp does not care about TTY stuff */
+#undef HAVE_TERMIOS
+
+/* if you have Solaris LWP (thr) package */
+#undef HAVE_THR
+
+/* Define to 1 if you have the <thread.h> header file. */
+#undef HAVE_THREAD_H
+
+/* Define to 1 if you have the `thr_getconcurrency' function. */
+#undef HAVE_THR_GETCONCURRENCY
+
+/* Define to 1 if you have the `thr_setconcurrency' function. */
+#undef HAVE_THR_SETCONCURRENCY
+
+/* Define to 1 if you have the `thr_yield' function. */
+#undef HAVE_THR_YIELD
+
+/* Define to 1 if you have the `timegm' function. */
+#undef HAVE_TIMEGM
+
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#undef HAVE_UINT16_T
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#undef HAVE_UINT32_T
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#undef HAVE_UINT8_T
+
+/* Define to 1 if the system has the type `uintmax_t'. */
+#undef HAVE_UINTMAX_T
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
+/* Define to 1 if the system has the type `uint_t'. */
+#undef HAVE_UINT_T
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* deviant sigwait? */
+#undef HAVE_UNIXWARE_SIGWAIT
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
+
+/* Define to 1 if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
+
+/* Define to 1 if the system has the type `u_int32'. */
+#undef HAVE_U_INT32
+
+/* u_int32 type in DNS headers, not others. */
+#undef HAVE_U_INT32_ONLY_WITH_DNS
+
+/* Define to 1 if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
+
+/* Define to 1 if you have the <varargs.h> header file. */
+#undef HAVE_VARARGS_H
+
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
+/* Define to 1 if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define if C99-compliant `vsnprintf' is available. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if the system has the type `wchar_t'. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if the system has the type `wint_t'. */
+#undef HAVE_WINT_T
+
+/* Define to 1 if `fork' works. */
+#undef HAVE_WORKING_FORK
+
+/* Define to 1 if `vfork' works. */
+#undef HAVE_WORKING_VFORK
+
+/* define if select implicitly yields */
+#undef HAVE_YIELDING_SELECT
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
+/* defined if C compiler supports __attribute__((...)) */
+#undef HAVE___ATTRIBUTE__
+
+
+ /* define away __attribute__() if unsupported */
+ #ifndef HAVE___ATTRIBUTE__
+ # define __attribute__(x) /* empty */
+ #endif
+ #define ISC_PLATFORM_NORETURN_PRE
+ #define ISC_PLATFORM_NORETURN_POST __attribute__((__noreturn__))
+
+
+
+/* Define to 1 if you have the `__res_init' function. */
+#undef HAVE___RES_INIT
+
+/* Does struct sockaddr_storage have __ss_family? */
+#undef HAVE___SS_FAMILY_IN_SS
+
+
+ /* Handle sockaddr_storage.__ss_family */
+ #ifdef HAVE___SS_FAMILY_IN_SS
+ # define ss_family __ss_family
+ #endif /* HAVE___SS_FAMILY_IN_SS */
+
+
+
+/* Define to provide `rpl_snprintf' function. */
+#undef HW_WANT_RPL_SNPRINTF
+
+/* Define to provide `rpl_vsnprintf' function. */
+#undef HW_WANT_RPL_VSNPRINTF
+
+/* Enclose PTHREAD_ONCE_INIT in extra braces? */
+#undef ISC_PLATFORM_BRACEPTHREADONCEINIT
+
+/* Do we need to fix in6isaddr? */
+#undef ISC_PLATFORM_FIXIN6ISADDR
+
+/* ISC: do we have if_nametoindex()? */
+#undef ISC_PLATFORM_HAVEIFNAMETOINDEX
+
+/* have struct if_laddrconf? */
+#undef ISC_PLATFORM_HAVEIF_LADDRCONF
+
+/* have struct if_laddrreq? */
+#undef ISC_PLATFORM_HAVEIF_LADDRREQ
+
+/* have struct in6_pktinfo? */
+#undef ISC_PLATFORM_HAVEIN6PKTINFO
+
+/* have IPv6? */
+#undef ISC_PLATFORM_HAVEIPV6
+
+/* struct sockaddr has sa_len? */
+#undef ISC_PLATFORM_HAVESALEN
+
+/* sin6_scope_id? */
+#undef ISC_PLATFORM_HAVESCOPEID
+
+/* missing in6addr_any? */
+#undef ISC_PLATFORM_NEEDIN6ADDRANY
+
+/* Do we need netinet6/in6.h? */
+#undef ISC_PLATFORM_NEEDNETINET6IN6H
+
+/* ISC: provide inet_ntop() */
+#undef ISC_PLATFORM_NEEDNTOP
+
+/* Declare in_port_t? */
+#undef ISC_PLATFORM_NEEDPORTT
+
+/* ISC: provide inet_pton() */
+#undef ISC_PLATFORM_NEEDPTON
+
+/* enable libisc thread support? */
+#undef ISC_PLATFORM_USETHREADS
+
+/* define to 1 if library is thread safe */
+#undef LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Does the target support multicast IP? */
+#undef MCAST
+
+/* pthread_init() required? */
+#undef NEED_PTHREAD_INIT
+
+/* use PTHREAD_SCOPE_SYSTEM? */
+#undef NEED_PTHREAD_SCOPE_SYSTEM
+
+/* Do we need an s_char typedef? */
+#undef NEED_S_CHAR_TYPEDEF
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Define this if optional arguments are disallowed */
+#undef NO_OPTIONAL_OPT_ARGS
+
+/* Should we avoid #warning on option name collisions? */
+#undef NO_OPTION_NAME_WARNINGS
+
+/* define if you have (or want) no threads */
+#undef NO_THREADS
+
+/* Use OpenSSL? */
+#undef OPENSSL
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* define to a working POSIX compliant shell */
+#undef POSIX_SHELL
+
+/* enable thread safety */
+#undef REENTRANT
+
+/* name of regex header file */
+#undef REGEX_HEADER
+
+/* define if sched_yield yields the entire process */
+#undef REPLACE_BROKEN_YIELD
+
+/* The size of `char*', as computed by sizeof. */
+#undef SIZEOF_CHARP
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `pthread_t', as computed by sizeof. */
+#undef SIZEOF_PTHREAD_T
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `signed char', as computed by sizeof. */
+#undef SIZEOF_SIGNED_CHAR
+
+/* The size of `time_t', as computed by sizeof. */
+#undef SIZEOF_TIME_T
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
+/* canonical system (cpu-vendor-os) of where we should run */
+#undef STR_SYSTEM
+
+/* Does Xettimeofday take 1 arg? */
+#undef SYSV_TIMEOFDAY
+
+/* enable thread safety */
+#undef THREADSAFE
+
+/* enable thread safety */
+#undef THREAD_SAFE
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Provide a typedef for uintptr_t? */
+#ifndef HAVE_UINTPTR_T
+typedef unsigned int uintptr_t;
+#define HAVE_UINTPTR_T 1
+#endif
+
+/* What type to use for setsockopt */
+#undef TYPEOF_IP_MULTICAST_LOOP
+
+/* Can we use SIGPOLL for tty IO? */
+#undef USE_TTY_SIGPOLL
+
+/* Can we use SIGPOLL for UDP? */
+#undef USE_UDP_SIGPOLL
+
+/* Version number of package */
+#undef VERSION
+
+/* vsnprintf expands "%m" to strerror(errno) */
+#undef VSNPRINTF_PERCENT_M
+
+/* configure --enable-ipv6 */
+#undef WANT_IPV6
+
+/* Define this if a working libregex can be found */
+#undef WITH_LIBREGEX
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* enable thread safety */
+#undef _REENTRANT
+
+/* enable thread safety */
+#undef _SGI_MP_SOURCE
+
+/* enable thread safety */
+#undef _THREADSAFE
+
+/* enable thread safety */
+#undef _THREAD_SAFE
+
+/* Define to 500 only on HP-UX. */
+#undef _XOPEN_SOURCE
+
+/* Are we _special_? */
+#undef __APPLE_USE_RFC_3542
+
+/* Define to 1 if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
+#undef intmax_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+
+ #if !defined(_KERNEL) && !defined(PARSESTREAM)
+ /*
+ * stdio.h must be included after _GNU_SOURCE is defined
+ * but before #define snprintf rpl_snprintf
+ */
+ # include <stdio.h>
+ #endif
+
+
+/* Define to rpl_snprintf if the replacement function should be used. */
+#undef snprintf
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
+#undef uintmax_t
+
+/* Define to the type of an unsigned integer type wide enough to hold a
+ pointer, if such a type exists, and if the system does not define it. */
+#undef uintptr_t
+
+/* Define as `fork' if `vfork' does not work. */
+#undef vfork
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
+
+/* Define to rpl_vsnprintf if the replacement function should be used. */
+#undef vsnprintf
+
+
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+
+
+
+ #if !defined(_KERNEL) && !defined(PARSESTREAM)
+ # if defined(HW_WANT_RPL_VSNPRINTF)
+ # if defined(__cplusplus)
+ extern "C" {
+ # endif
+ # include <stdarg.h>
+ int rpl_vsnprintf(char *, size_t, const char *, va_list);
+ # if defined(__cplusplus)
+ }
+ # endif
+ # endif
+ # if defined(HW_WANT_RPL_SNPRINTF)
+ # if defined(__cplusplus)
+ extern "C" {
+ # endif
+ int rpl_snprintf(char *, size_t, const char *, ...);
+ # if defined(__cplusplus)
+ }
+ # endif
+ # endif
+ #endif /* !defined(_KERNEL) && !defined(PARSESTREAM) */
+
diff --git a/sntp/configure b/sntp/configure
new file mode 100755
index 0000000..0d6902b
--- /dev/null
+++ b/sntp/configure
@@ -0,0 +1,32730 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for sntp 4.2.7p482.
+#
+# Report bugs to <http://bugs.ntp.org./>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: http://bugs.ntp.org./ about your system, including any
+$0: error possibly output before this message. Then install
+$0: a modern shell, or manually run the script under such a
+$0: shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='sntp'
+PACKAGE_TARNAME='sntp'
+PACKAGE_VERSION='4.2.7p482'
+PACKAGE_STRING='sntp 4.2.7p482'
+PACKAGE_BUGREPORT='http://bugs.ntp.org./'
+PACKAGE_URL='http://www.ntp.org./'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+enable_option_checking=no
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+GTEST_AVAILABLE_FALSE
+GTEST_AVAILABLE_TRUE
+GTEST_CPPFLAGS
+GTEST_CXXFLAGS
+GTEST_LIBS
+GTEST_LDFLAGS
+GTEST_CONFIG
+CXXCPP
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+VER_SUFFIX
+LIB_SYSLOG
+subdirs
+BUILD_LIBEVENT_FALSE
+BUILD_LIBEVENT_TRUE
+LDADD_LIBEVENT
+CPPFLAGS_LIBEVENT
+PKG_CONFIG
+NTP_FORCE_LIBEVENT_DIST
+LIBOPTS_DIR
+LIBOPTS_CFLAGS
+LIBOPTS_LDADD
+NEED_LIBOPTS_FALSE
+NEED_LIBOPTS_TRUE
+INSTALL_LIBOPTS_FALSE
+INSTALL_LIBOPTS_TRUE
+POSIX_SHELL
+GL_GENERATE_STDNORETURN_H_FALSE
+GL_GENERATE_STDNORETURN_H_TRUE
+STDNORETURN_H
+BUILD_SNTP_FALSE
+BUILD_SNTP_TRUE
+SNTP
+LIBTOOL_DEPS
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LIBTOOL
+LIBOBJS
+PTHREADS_FALSE
+PTHREADS_TRUE
+LIBISC_PTHREADS_NOTHREADS
+PTHREAD_LIBS
+HAVE_INLINE
+ALLOCA
+LIBM
+EDITLINE_LIBS
+LD
+FGREP
+SED
+LDADD_LIBNTP
+NTP_CROSSCOMPILE_FALSE
+NTP_CROSSCOMPILE_TRUE
+TIMETRIM_NI
+TIMETRIM_MS
+TIMETRIM_DS
+TIMETRIM_DL
+TIMETRIM_DB
+TICKADJ_NI
+TICKADJ_MS
+TICKADJ_DS
+TICKADJ_DL
+TICKADJ_DB
+SNTP_NI
+SNTP_MS
+SNTP_DS
+SNTP_DL
+SNTP_DB
+NTP_WAIT_NI
+NTP_WAIT_MS
+NTP_WAIT_DS
+NTP_WAIT_DL
+NTP_WAIT_DB
+NTP_KEYGEN_NI
+NTP_KEYGEN_MS
+NTP_KEYGEN_DS
+NTP_KEYGEN_DL
+NTP_KEYGEN_DB
+NTPTRACE_NI
+NTPTRACE_MS
+NTPTRACE_DS
+NTPTRACE_DL
+NTPTRACE_DB
+NTPTIME_NI
+NTPTIME_MS
+NTPTIME_DS
+NTPTIME_DL
+NTPTIME_DB
+INSTALL_NTPSWEEP_FALSE
+INSTALL_NTPSWEEP_TRUE
+NTPSWEEP_NI
+NTPSWEEP_MS
+NTPSWEEP_DS
+NTPSWEEP_DL
+NTPSWEEP_DB
+NTPSNMPD_NI
+NTPSNMPD_MS
+NTPSNMPD_DS
+NTPSNMPD_DL
+NTPSNMPD_DB
+NTPQ_NI
+NTPQ_MS
+NTPQ_DS
+NTPQ_DL
+NTPQ_DB
+NTPD_NI
+NTPD_MS
+NTPD_DS
+NTPD_DL
+NTPD_DB
+NTPDSIM_NI
+NTPDSIM_MS
+NTPDSIM_DS
+NTPDSIM_DL
+NTPDSIM_DB
+NTPDC_NI
+NTPDC_MS
+NTPDC_DS
+NTPDC_DL
+NTPDC_DB
+NTPDATE_NI
+NTPDATE_MS
+NTPDATE_DS
+NTPDATE_DL
+NTPDATE_DB
+MANTAGFMT
+CALC_TICKADJ_NI
+CALC_TICKADJ_MS
+CALC_TICKADJ_DS
+CALC_TICKADJ_DL
+CALC_TICKADJ_DB
+WANT_CALC_TICKADJ_MS_FALSE
+WANT_CALC_TICKADJ_MS_TRUE
+LDFLAGS_NTP
+LDADD_NTP
+CPPFLAGS_NTP
+CFLAGS_NTP
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_dependency_tracking
+with_locfile
+with_gnu_ld
+with_lineeditlibs
+enable_debugging
+enable_thread_support
+with_threads
+with_yielding_select
+enable_c99_snprintf
+enable_clockctl
+enable_linuxcaps
+enable_solarisprivs
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_sysroot
+enable_libtool_lock
+with_sntp
+enable_nls
+enable_local_libopts
+enable_libopts_install
+with_autoopts_config
+with_regex_header
+with_libregex
+with_libregex_cflags
+with_libregex_libs
+enable_optional_args
+enable_local_libevent
+with_crypto
+with_openssl_libdir
+with_openssl_incdir
+with_rpath
+enable_ipv6
+with_kame
+enable_getifaddrs
+with_gtest
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP'
+ac_subdirs_all='libevent'
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures sntp 4.2.7p482 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/sntp]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of sntp 4.2.7p482:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: `make V=1')
+ --disable-silent-rules verbose build output (undo: `make V=0')
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ defaults: + yes, - no, s system-specific
+ --enable-debugging + include ntpd debugging code
+ --enable-thread-support s use threads (+ if available)
+ --enable-c99-snprintf s force replacement
+ --enable-clockctl s Use /dev/clockctl for non-root clock control
+ --enable-linuxcaps + Use Linux capabilities for non-root clock control
+ --enable-solarisprivs + Use Solaris privileges for non-root clock control
+ --enable-shared[=PKGS] build shared libraries [default=no]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-nls disable nls support in libopts
+ --enable-local-libopts Use the supplied libopts tearoff code
+ --enable-libopts-install
+ Install libopts with client installation
+ --disable-optional-args not wanting optional option args
+ --enable-local-libevent Force using the supplied libevent tearoff code
+ --enable-ipv6 s use IPv6?
+
+ --enable-getifaddrs + Enable the use of getifaddrs() [[yes|no]].
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-locfile=XXX os-specific or "legacy"
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-lineeditlibs edit,editline (readline may be specified if desired)
+ --with-threads with threads [auto]
+ --with-yielding-select with yielding select [auto]
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+ --without-sntp - disable building sntp and sntp/tests
+ --with-autoopts-config specify the config-info script
+ --with-regex-header a reg expr header is specified
+ --with-libregex libregex installation prefix
+ --with-libregex-cflags libregex compile flags
+ --with-libregex-libs libregex link command arguments
+ --with-crypto + =openssl,libcrypto
+
+ --with-openssl-libdir + =/something/reasonable
+
+ --with-openssl-incdir + =/something/reasonable
+
+ --without-rpath s Disable auto-added -R linker paths
+
+ --with-kame - =/usr/local/v6
+ --with-gtest Use the gtest framework (Default: if it's available)
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <http://bugs.ntp.org./>.
+sntp home page: <http://www.ntp.org./>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+sntp configure 4.2.7p482
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------------ ##
+## Report this to http://bugs.ntp.org./ ##
+## ------------------------------------ ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+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.7p482, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+as_fn_append ac_header_list " stdarg.h"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_aux_dir=
+for ac_dir in libevent/build-aux "$srcdir"/libevent/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in libevent/build-aux \"$srcdir\"/libevent/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+# Bump sntp_configure_cache_version for each change to configure.ac or
+# .m4 files which invalidates cached values from previous configure
+# runs.
+#
+# If the change affects cache variables used only by the main NTP
+# configure.ac, then only its version number should be bumped, while
+# the subdir configure.ac version numbers should be unchanged. The
+# same is true for a test/variable that is used only by one subdir
+# being changed incompatibly; only that subdir's cache version needs
+# bumping.
+#
+# If a change affects variables shared by all NTP configure scripts,
+# please bump the version numbers of each. If you are not sure, the
+# safe choice is to bump all on any cache-invalidating change.
+#
+# In order to avoid the risk of version stamp collision between -stable
+# and -dev branches, do not simply increment the version, instead use
+# the date YYYYMMDD optionally with -HHMM if there is more than one
+# bump in a day.
+
+sntp_configure_cache_version=20120806
+
+# When the version of config.cache and configure do not
+# match, NTP_CACHEVERSION will flush the cache.
+
+
+
+ ntp_cache_flush=1
+
+ case "$ntp_cv_sntp_cache_version" in
+ $sntp_configure_cache_version)
+ # same version, good
+ ntp_cache_flush=0
+ ;;
+ '')
+ # No cache, predates ntp_cv_sntp_cache_version, or is empty.
+ case "$cache_file" in
+ /dev/null)
+ ntp_cache_flush=0
+ ;;
+ *)
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
+ # Do not clear the cache immediately after it is created
+ # empty as it is noisy. Differentiate a newly-created
+ # config.cache from one predating the cache version
+ # mechanism by looking for the first cached variable set
+ # by Autoconf
+ case "$ac_cv_path_install" in
+ '')
+ # empty config.cache file
+ ntp_cache_flush=0
+ esac
+ ;;
+ *)
+ # Parent configure just created cache from empty,
+ # flushing would be counterproductive.
+ ntp_cache_flush=0;
+ ;;
+ esac
+ esac
+ ;;
+ *)
+ # configure cache version mismatches config.cache version
+ ;;
+ esac
+
+ case "$ntp_cache_flush" in
+ 1)
+ c_version="${ntp_cv_sntp_cache_version:-(no version found)}"
+
+ # Do we flush all variables or exclude others' version stamps?
+
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
+ # Clear all *_cv_* variables including our child subdirs'
+ # ntp_cv_*_cache_version variables. This prevents subdir
+ # configure scripts from noticing a version mismatch just
+ # after the top configure in the invocation cleared and
+ # recreated the cache.
+
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/_cv_/p'
+ `
+ ;;
+ *)
+ # This is not the top configure this particular invocation.
+ # Clear all *_cv_* variables sparing the version stamps
+ # of other configure scripts, so we don't trigger
+ # useless repeated clearings.
+
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/ntp_cv_.*_cache_version/d' \
+ -e '/_cv_/p'
+ `
+ esac
+
+ for c_varname in $c_varname_list
+ do
+ { eval $c_varname=; unset $c_varname; }
+ done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file saved by another version, ignored." >&5
+$as_echo "$as_me: $cache_file saved by another version, ignored." >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: configure script cache version: $sntp_configure_cache_version" >&5
+$as_echo "$as_me: configure script cache version: $sntp_configure_cache_version" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $cache_file version: $c_version" >&5
+$as_echo "$as_me: $cache_file version: $c_version" >&6;}
+ { c_varname=; unset c_varname;}
+ { c_varname_list=; unset c_varname_list;}
+ { c_version=; unset c_version;}
+ esac
+
+ { ntp_cache_flush=; unset ntp_cache_flush;}
+
+ # save configure version in config.cache for next time
+ ntp_cv_sntp_cache_version="$sntp_configure_cache_version"
+
+ # let any subdir configure.ac NTP_CACHEVERSION invocations
+ # know they are not the top level.
+ NTP_CACHEVERSION_PARENT='sntp' ; export NTP_CACHEVERSION_PARENT
+
+
+am__api_version='1.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='sntp'
+ VERSION='4.2.7p482'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define STR_SYSTEM "$host"
+_ACEOF
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+ MINIX=yes
+else
+ MINIX=
+fi
+
+
+ if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+ fi
+
+ case "$host_os" in
+ hpux*)
+
+$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+ ;;
+ esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+if test "x$CC" != xcc; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+ rm -f conftest2.*
+ if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+# Ralf Wildenhues: With per-target flags we need CC_C_O
+# AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if ${ac_cv_prog_gcc_traditional+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+
+
+
+CFLAGS_NTP=
+CPPFLAGS_NTP=
+LDADD_NTP=
+LDFLAGS_NTP=
+
+
+
+
+
+case "$ac_cv_prog_cc_c89" in
+ no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP
+ version 4.2.5 and higher." >&5
+$as_echo "$as_me: WARNING: ANSI C89/ISO C90 is the minimum to compile NTP
+ version 4.2.5 and higher." >&2;}
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle #warning" >&5
+$as_echo_n "checking if $CC can handle #warning... " >&6; }
+if ${ntp_cv_cpp_warning+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#warning foo
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_cpp_warning=yes
+else
+ ntp_cv_cpp_warning=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cpp_warning" >&5
+$as_echo "$ntp_cv_cpp_warning" >&6; }
+case "$ntp_cv_cpp_warning" in
+ no)
+
+$as_echo "#define NO_OPTION_NAME_WARNINGS 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports __attribute__((...))" >&5
+$as_echo_n "checking if $CC supports __attribute__((...))... " >&6; }
+if ${ntp_cv_cc_attribute+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+void foo(void) __attribute__((__noreturn__));
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_cc_attribute=yes
+else
+ ntp_cv_cc_attribute=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_cc_attribute" >&5
+$as_echo "$ntp_cv_cc_attribute" >&6; }
+case "$ntp_cv_cc_attribute" in
+ yes)
+
+$as_echo "#define HAVE___ATTRIBUTE__ /**/" >>confdefs.h
+
+esac
+
+
+case "$GCC" in
+ yes)
+ SAVED_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wstrict-overflow"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Wstrict-overflow" >&5
+$as_echo_n "checking if $CC can handle -Wstrict-overflow... " >&6; }
+if ${ntp_cv_gcc_Wstrict_overflow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_gcc_Wstrict_overflow=yes
+else
+ ntp_cv_gcc_Wstrict_overflow=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Wstrict_overflow" >&5
+$as_echo "$ntp_cv_gcc_Wstrict_overflow" >&6; }
+ #
+ # $ntp_cv_gcc_Wstrict_overflow is tested later to add the
+ # flag to CFLAGS.
+ #
+ CFLAGS="$SAVED_CFLAGS -Winit-self"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC can handle -Winit-self" >&5
+$as_echo_n "checking if $CC can handle -Winit-self... " >&6; }
+if ${ntp_cv_gcc_Winit_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_gcc_Winit_self=yes
+else
+ ntp_cv_gcc_Winit_self=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gcc_Winit_self" >&5
+$as_echo "$ntp_cv_gcc_Winit_self" >&6; }
+ CFLAGS="$SAVED_CFLAGS"
+ { SAVED_CFLAGS=; unset SAVED_CFLAGS;}
+ #
+ # $ntp_cv_gcc_Winit_self is tested later to add the
+ # flag to CFLAGS_NTP.
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports omitting unused code and data" >&5
+$as_echo_n "checking if linker supports omitting unused code and data... " >&6; }
+if ${ntp_cv_gc_sections_runs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ origCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,--gc-sections"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <stdio.h>
+
+int
+main ()
+{
+
+ FILE * fpC;
+ char buf[32];
+ size_t cch;
+ int read_success_once;
+
+ fpC = fopen("conftest.c", "r");
+ if (NULL == fpC)
+ exit(1);
+ do {
+ cch = fread(buf, sizeof(buf), 1, fpC);
+ read_success_once |= (0 != cch);
+ } while (0 != cch);
+ if (!read_success_once)
+ exit(2);
+ if (!feof(fpC))
+ exit(3);
+ if (0 != fclose(fpC))
+ exit(4);
+
+ exit(EXIT_SUCCESS);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then
+ ntp_cv_gc_sections_runs=no
+ else
+ ntp_cv_gc_sections_runs=no
+ ./conftest >/dev/null 2>&1 && ntp_cv_gc_sections_runs=yes
+ fi
+
+else
+ ntp_cv_gc_sections_runs=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$origCFLAGS"
+ { origCFLAGS=; unset origCFLAGS;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_gc_sections_runs" >&5
+$as_echo "$ntp_cv_gc_sections_runs" >&6; }
+ case "$ntp_cv_gc_sections_runs" in
+ yes)
+ LDADD_LIBNTP="-Wl,--gc-sections"
+ CFLAGS_NTP="$CFLAGS_NTP -ffunction-sections -fdata-sections"
+ ;;
+ no)
+ LDADD_LIBNTP=
+ ;;
+ esac
+ CFLAGS_NTP="$CFLAGS_NTP -Wall"
+ CFLAGS_NTP="$CFLAGS_NTP -Wcast-align"
+ CFLAGS_NTP="$CFLAGS_NTP -Wcast-qual"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wconversion"
+ # CFLAGS_NTP="$CFLAGS_NTP -Werror"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wextra"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wfloat-equal"
+ CFLAGS_NTP="$CFLAGS_NTP -Wmissing-prototypes"
+ CFLAGS_NTP="$CFLAGS_NTP -Wpointer-arith"
+ CFLAGS_NTP="$CFLAGS_NTP -Wshadow"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wtraditional"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wwrite-strings"
+ case "$ntp_cv_gcc_Winit_self" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Winit-self"
+ esac
+ case "$ntp_cv_gcc_Wstrict_overflow" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-overflow"
+ esac
+ # -W[no-]strict-prototypes might be added by NTP_OPENSSL
+esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional compiler flags" >&5
+$as_echo_n "checking additional compiler flags... " >&6; }
+ # allow ntp_os_flags to be preset to skip this stuff
+ case "${ntp_os_cflags+set}" in
+ set)
+ ;;
+ *)
+ ntp_os_cflags=
+ case "$host_os" in
+ aix[1-3]*)
+ ;;
+ aix4.[0-2]*)
+ # turn on additional headers
+ ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
+ ;;
+ aix5.3*)
+ # avoid circular dependencies in yp headers, and more
+ ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
+ ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT"
+ ;;
+ aix*)
+ # XXX Only verified thru AIX6.
+ # aix7 seems to need a different XOPEN_SOURCE_EXTENDED thing.
+ # avoid circular dependencies in yp headers
+ # _XOPEN_SOURCE=500 = X/Open 5: POSIX 1995
+ # _XOPEN_SOURCE=600 = X/Open 6: POSIX 2004
+ # _XOPEN_SOURCE=700 = X/Open 7: POSIX 2008
+ ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_SOURCE=600"
+ ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS"
+ ;;
+ amigaos)
+ ntp_os_cflags="-DSYS_AMIGA"
+ ;;
+ darwin*|macosx*|rhapsody*)
+ ntp_os_cflags="-D_P1003_1B_VISIBLE"
+ ;;
+ hpux10.*) # at least for hppa2.0-hp-hpux10.20
+ case "$GCC" in
+ yes)
+ ;;
+ *)
+ # use Ansi compiler on HPUX, and some -Wp magic
+ ntp_os_cflags="-Ae -Wp,-H18816"
+ ;;
+ esac
+ ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
+ ;;
+ hpux*)
+ case "$GCC" in
+ yes)
+ ;;
+ *)
+ # use Ansi compiler on HPUX
+ ntp_os_cflags="-Ae"
+ esac
+ ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
+ ;;
+ irix6*)
+ case "$CC" in
+ cc)
+ # do not use 64-bit compiler
+ ntp_os_cflags="-n32 -mips3 -Wl,-woff,84"
+ esac
+ ;;
+ nextstep3)
+ ntp_os_cflags="-posix"
+ ;;
+ solaris1*|solaris2.[0-5]|solaris2.5.*)
+ ;;
+ sunos[34]*|sunos5.[0-5]|sunos5.5.*)
+ ;;
+ solaris2*|sunos5*)
+ # turn on 64-bit file offset interface
+ ntp_os_cflags="-D_LARGEFILE64_SOURCE"
+ ;;
+ vxworks*)
+ case "$build" in
+ $host)
+ ;;
+ *)
+ # Quick and dirty sanity check
+ case "$VX_KERNEL" in
+ '')
+ as_fn_error $? "See html/build/hints/vxworks.html" "$LINENO" 5
+ esac
+ ntp_os_cflags="-DSYS_VXWORKS"
+ esac
+ ;;
+ esac
+ esac
+ case "$ntp_os_flags" in
+ '')
+ ntp_os_cflags_msg="none needed"
+ ;;
+ *)
+ ntp_os_cflags_msg="$ntp_os_cflags"
+ esac
+ CFLAGS_NTP="$CFLAGS_NTP $ntp_os_cflags"
+ { $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 whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
+$as_echo_n "checking for working volatile... " >&6; }
+if ${ac_cv_c_volatile+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+volatile int x;
+int * volatile y = (int *) 0;
+return !x && !y;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_volatile=yes
+else
+ ac_cv_c_volatile=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
+$as_echo "$ac_cv_c_volatile" >&6; }
+if test $ac_cv_c_volatile = no; then
+
+$as_echo "#define volatile /**/" >>confdefs.h
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install dir and man conventions" >&5
+$as_echo_n "checking for install dir and man conventions... " >&6; }
+
+
+# Check whether --with-locfile was given.
+if test "${with_locfile+set}" = set; then :
+ withval=$with_locfile;
+else
+ with_locfile=no
+
+fi
+
+
+( \
+ SENTINEL_DIR="$PWD" && \
+ cd $srcdir/ && \
+ case "$with_locfile" in \
+ yes|no|'') \
+ scripts/genLocInfo -d "$SENTINEL_DIR" \
+ ;; \
+ *) \
+ scripts/genLocInfo -d "$SENTINEL_DIR" -f "$with_locfile" \
+ ;; \
+ esac \
+) > genLocInfo.i 2> genLocInfo.err
+. ./genLocInfo.i
+
+case "$GENLOCINFO" in
+ OK)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: in file $GENLOCINFOFILE" >&5
+$as_echo "in file $GENLOCINFOFILE" >&6; }
+ rm genLocInfo.err genLocInfo.i
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed." >&5
+$as_echo "failed." >&6; }
+ as_fn_error $? "Problem with genLocInfo!" "$LINENO" 5
+ ;;
+esac
+
+ if test "$CALC_TICKADJ_MS" ; then
+ WANT_CALC_TICKADJ_MS_TRUE=
+ WANT_CALC_TICKADJ_MS_FALSE='#'
+else
+ WANT_CALC_TICKADJ_MS_TRUE='#'
+ WANT_CALC_TICKADJ_MS_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test -z "$NTPSWEEP_NI" ; then
+ INSTALL_NTPSWEEP_TRUE=
+ INSTALL_NTPSWEEP_FALSE='#'
+else
+ INSTALL_NTPSWEEP_TRUE='#'
+ INSTALL_NTPSWEEP_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Expose a cross-compilation indicator to makefiles
+ if test $build != $host; then
+ NTP_CROSSCOMPILE_TRUE=
+ NTP_CROSSCOMPILE_FALSE='#'
+else
+ NTP_CROSSCOMPILE_TRUE='#'
+ NTP_CROSSCOMPILE_FALSE=
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+ # Check whether --enable-c99-snprintf was given.
+if test "${enable_c99_snprintf+set}" = set; then :
+ enableval=$enable_c99_snprintf; force_c99_snprintf=$enableval
+else
+ force_c99_snprintf=no
+
+fi
+
+ case "$force_c99_snprintf" in
+ yes)
+ hw_force_rpl_snprintf=yes
+ hw_force_rpl_vsnprintf=yes
+ esac
+
+
+
+
+
+
+ for ac_header in $ac_header_list
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+ ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
+if test "x$ac_cv_func_vsnprintf" = xyes; then :
+ hw_cv_func_vsnprintf=yes
+else
+ hw_cv_func_vsnprintf=no
+fi
+
+ if test "$hw_cv_func_vsnprintf" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf is C99 compliant" >&5
+$as_echo_n "checking whether vsnprintf is C99 compliant... " >&6; }
+if ${hw_cv_func_vsnprintf_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ hw_cv_func_vsnprintf_c99=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_STDARG_H
+ #include <stdarg.h>
+ #endif
+ #include <stdio.h>
+ static int testprintf(char *buf, size_t size, const char *format, ...)
+ {
+ int result;
+ va_list ap;
+ va_start(ap, format);
+ result = vsnprintf(buf, size, format, ap);
+ va_end(ap);
+ return result;
+ }
+int
+main ()
+{
+char buf[43];
+ if (testprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+ testprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+ buf[0] != 'T' || buf[3] != '\0')
+ return 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ hw_cv_func_vsnprintf_c99=yes
+else
+ hw_cv_func_vsnprintf_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_vsnprintf_c99" >&5
+$as_echo "$hw_cv_func_vsnprintf_c99" >&6; }
+else
+ hw_cv_func_vsnprintf_c99=no
+fi
+
+$as_echo "#define HAVE_VSNPRINTF 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement vsnprintf will be used" >&5
+$as_echo_n "checking if C99-snprintf replacement vsnprintf will be used... " >&6; }
+ if test "${hw_force_rpl_vsnprintf=no}" = yes -o "$hw_cv_func_vsnprintf_c99" = no; then :
+ hw_use_rpl_vsnprintf=yes
+else
+ hw_use_rpl_vsnprintf=no
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_vsnprintf" >&5
+$as_echo "$hw_use_rpl_vsnprintf" >&6; }
+ if test "$hw_use_rpl_vsnprintf" = yes; then :
+
+$as_echo "#define HW_WANT_RPL_VSNPRINTF 1" >>confdefs.h
+
+ if test ${hw_nodef_vsnprintf=no} = no; then :
+
+$as_echo "#define vsnprintf rpl_vsnprintf" >>confdefs.h
+
+fi
+ for ac_header in inttypes.h locale.h stddef.h stdint.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
+"
+if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct lconv" "thousands_sep" "ac_cv_member_struct_lconv_thousands_sep" "#include <locale.h>
+"
+if test "x$ac_cv_member_struct_lconv_thousands_sep" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LCONV_THOUSANDS_SEP 1
+_ACEOF
+
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
+$as_echo_n "checking for long double... " >&6; }
+if ${ac_cv_type_long_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$GCC" = yes; then
+ ac_cv_type_long_double=yes
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* The Stardent Vistra knows sizeof (long double), but does
+ not support it. */
+ long double foo = 0.0L;
+int
+main ()
+{
+static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
+ sizeof (double) <= sizeof (long double))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_long_double=yes
+else
+ ac_cv_type_long_double=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5
+$as_echo "$ac_cv_type_long_double" >&6; }
+ if test $ac_cv_type_long_double = yes; then
+
+$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if ${ac_cv_type_long_long_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if test "$cross_compiling" = yes; then :
+ ac_cv_type_long_long_int=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ #ifndef LLONG_MAX
+ # define HALF \
+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+ # define LLONG_MAX (HALF - 1 + HALF)
+ #endif
+int
+main ()
+{
+long long int n = 1;
+ int i;
+ for (i = 0; ; i++)
+ {
+ long long int m = n << i;
+ if (m >> i != n)
+ return 1;
+ if (LLONG_MAX / 2 < m)
+ break;
+ }
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_type_long_long_int=yes
+else
+ ac_cv_type_long_long_int=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+else
+ ac_cv_type_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
+$as_echo "$ac_cv_type_long_long_int" >&6; }
+ if test $ac_cv_type_long_long_int = yes; then
+
+$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if ${ac_cv_type_unsigned_long_long_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* For now, do not test the preprocessor; as of 2007 there are too many
+ implementations with broken preprocessors. Perhaps this can
+ be revisited in 2012. In the meantime, code should not expect
+ #if to work with literals wider than 32 bits. */
+ /* Test literals. */
+ long long int ll = 9223372036854775807ll;
+ long long int nll = -9223372036854775807LL;
+ unsigned long long int ull = 18446744073709551615ULL;
+ /* Test constant expressions. */
+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+ ? 1 : -1)];
+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+ ? 1 : -1)];
+ int i = 63;
+int
+main ()
+{
+/* Test availability of runtime routines for shift and division. */
+ long long int llmax = 9223372036854775807ll;
+ unsigned long long int ullmax = 18446744073709551615ull;
+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+ | (llmax / ll) | (llmax % ll)
+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+ | (ullmax / ull) | (ullmax % ull));
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_type_unsigned_long_long_int=yes
+else
+ ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+ if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+ fi
+
+ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default"
+if test "x$ac_cv_type_intmax_t" = xyes; then :
+
+$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
+
+else
+ test $ac_cv_type_long_long_int = yes \
+ && ac_type='long long int' \
+ || ac_type='long int'
+
+cat >>confdefs.h <<_ACEOF
+#define intmax_t $ac_type
+_ACEOF
+
+fi
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintmax_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h
+
+else
+ test $ac_cv_type_unsigned_long_long_int = yes \
+ && ac_type='unsigned long long int' \
+ || ac_type='unsigned long int'
+
+cat >>confdefs.h <<_ACEOF
+#define uintmax_t $ac_type
+_ACEOF
+
+fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
+else
+ for ac_type in 'unsigned int' 'unsigned long int' \
+ 'unsigned long long int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+ ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test -z "$ac_type" && break
+ done
+fi
+
+
+ ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+ for ac_func in localeconv
+do :
+ ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv"
+if test "x$ac_cv_func_localeconv" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LOCALECONV 1
+_ACEOF
+
+fi
+done
+
+
+ if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+
+
+
+ case " $LIBOBJS " in
+ *" snprintf.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
+ ;;
+esac
+
+ _hw_cv_func_xprintf_replace_done=yes
+fi
+
+fi
+
+
+ ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
+if test "x$ac_cv_func_snprintf" = xyes; then :
+ hw_cv_func_snprintf=yes
+else
+ hw_cv_func_snprintf=no
+fi
+
+ if test "$hw_cv_func_snprintf" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf is C99 compliant" >&5
+$as_echo_n "checking whether snprintf is C99 compliant... " >&6; }
+if ${hw_cv_func_snprintf_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ hw_cv_func_snprintf_c99=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+char buf[43];
+ if (snprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+ snprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+ buf[0] != 'T' || buf[3] != '\0')
+ return 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ hw_cv_func_snprintf_c99=yes
+else
+ hw_cv_func_snprintf_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_cv_func_snprintf_c99" >&5
+$as_echo "$hw_cv_func_snprintf_c99" >&6; }
+else
+ hw_cv_func_snprintf_c99=no
+fi
+
+$as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C99-snprintf replacement snprintf will be used" >&5
+$as_echo_n "checking if C99-snprintf replacement snprintf will be used... " >&6; }
+ if test "${hw_force_rpl_snprintf=no}" = yes -o "$hw_cv_func_snprintf_c99" = no; then :
+ hw_use_rpl_snprintf=yes
+else
+ hw_use_rpl_snprintf=no
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hw_use_rpl_snprintf" >&5
+$as_echo "$hw_use_rpl_snprintf" >&6; }
+ if test "$hw_use_rpl_snprintf" = yes; then :
+
+$as_echo "#define HW_WANT_RPL_SNPRINTF 1" >>confdefs.h
+
+ if test ${hw_nodef_snprintf=no} = no; then :
+
+$as_echo "#define snprintf rpl_snprintf" >>confdefs.h
+
+fi
+
+ if test "x$_hw_cv_func_xprintf_replace_done" != xyes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+
+
+
+ case " $LIBOBJS " in
+ *" snprintf.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
+ ;;
+esac
+
+ _hw_cv_func_xprintf_replace_done=yes
+fi
+
+fi
+
+
+
+
+
+# HMS: Save $LIBS and empty it.
+# any LIBS we add here should go in to LDADD_LIBNTP
+
+__LIBS=$LIBS
+LIBS=
+
+
+
+# [Bug 2332] because we need to know if we are using GNU ld...
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for directory path separator" >&5
+$as_echo_n "checking for directory path separator... " >&6; }
+if ${ntp_cv_dir_sep+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$ntp_cv_dir_sep" in
+ '')
+ case "$host_os" in
+ *djgpp | *mingw32* | *emx*)
+ ntp_cv_dir_sep="'\\'"
+ ;;
+ *)
+ ntp_cv_dir_sep="'/'"
+ ;;
+ esac
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_dir_sep" >&5
+$as_echo "$ntp_cv_dir_sep" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DIR_SEP $ntp_cv_dir_sep
+_ACEOF
+
+
+
+ NTP_ORIG_LIBS="$LIBS"
+
+# Check whether --with-lineeditlibs was given.
+if test "${with_lineeditlibs+set}" = set; then :
+ withval=$with_lineeditlibs; use_lineeditlibs="$withval"
+else
+ use_lineeditlibs="edit,editline"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking line editing libraries" >&5
+$as_echo_n "checking line editing libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_lineeditlibs" >&5
+$as_echo "$use_lineeditlibs" >&6; }
+ case "$use_lineeditlibs" in
+ no)
+ ntp_lib_lineedit=no
+ ;;
+ *)
+ for lineedit_lib in `echo $use_lineeditlibs | sed -e 's/,/ /'`; do
+ for term_lib in "" termcap curses ncurses; do
+ case "$term_lib" in
+ '')
+ TRY_LIB="-l$lineedit_lib"
+ ;;
+ *)
+ TRY_LIB="-l$lineedit_lib -l$term_lib"
+ ;;
+ esac
+ LIBS="$NTP_ORIG_LIBS $TRY_LIB"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline() with $TRY_LIB" >&5
+$as_echo_n "checking for readline() with $TRY_LIB... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char readline ();
+int
+main ()
+{
+return readline ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_lib_lineedit="$TRY_LIB"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ case "$ntp_lib_lineedit" in
+ '')
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ *)
+ # Use readline()
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ break
+ esac
+ case "$term_lib" in
+ '')
+ # do not try el_gets without a terminal library
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_gets() with $TRY_LIB" >&5
+$as_echo_n "checking for el_gets() with $TRY_LIB... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char el_gets ();
+int
+main ()
+{
+return el_gets ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_lib_lineedit="$TRY_LIB"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ case "$ntp_lib_lineedit" in
+ '')
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ *) # Use el_gets()
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ break
+ ;;
+ esac # $ntp_lib_lineedit
+ esac # $term_lib
+ done
+ case "$ntp_lib_lineedit" in
+ '')
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ LIBS="$NTP_ORIG_LIBS"
+ ;;
+ esac # $use_lineeditlibs
+
+ case "$ntp_lib_lineedit" in
+ '')
+ ntp_lib_lineedit="no"
+ ;;
+ no)
+ ;;
+ *)
+ EDITLINE_LIBS="$ntp_lib_lineedit"
+
+ ;;
+ esac # $ntp_lib_lineedit
+
+ case "$ntp_lib_lineedit" in
+ no)
+ ;;
+ *)
+ for ac_header in readline.h readline/readline.h histedit.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in history.h readline/history.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ case "$ac_cv_header_histedit_h" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to el_init()" >&5
+$as_echo_n "checking number of arguments to el_init()... " >&6; }
+if ${ntp_cv_el_init_args+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <histedit.h>
+
+int
+main ()
+{
+
+ el_init("conftest", stdin, stdout, stderr);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_el_init_args=4
+else
+ ntp_cv_el_init_args=3
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_el_init_args" >&5
+$as_echo "$ntp_cv_el_init_args" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define EL_INIT_ARGS $ntp_cv_el_init_args
+_ACEOF
+
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5
+$as_echo_n "checking whether readline supports history... " >&6; }
+
+ ntp_lib_lineedit_history="no"
+ ORIG_LIBS="$LIBS"
+ LIBS="$ORIG_LIBS $ntp_lib_lineedit"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char add_history ();
+int
+main ()
+{
+return add_history ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_lib_lineedit_history="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ORIG_LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_lib_lineedit_history" >&5
+$as_echo "$ntp_lib_lineedit_history" >&6; }
+
+ case "$ntp_lib_lineedit_history" in
+ yes)
+
+$as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h
+
+ esac
+ esac # $ntp_lib_lineedit
+ { NTP_ORIG_LIBS=; unset NTP_ORIG_LIBS;}
+ { ORIG_LIBS=; unset ORIG_LIBS;}
+ { TRY_LIB=; unset TRY_LIB;}
+ { use_lineeditlibs=; unset use_lineeditlibs;}
+
+
+LIBM=
+case "$host" in
+ *-*-darwin*)
+ ;;
+ *)
+ _libs=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5
+$as_echo_n "checking for library containing cos... " >&6; }
+if ${ac_cv_search_cos+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_cos=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_cos+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_cos+:} false; then :
+
+else
+ ac_cv_search_cos=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5
+$as_echo "$ac_cv_search_cos" >&6; }
+ac_res=$ac_cv_search_cos
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ LIBM="-lm"
+fi
+
+ LIBS=$_libs
+ ;;
+esac
+
+{ _libs=; unset _libs;}
+
+
+for ac_header in vfork.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
+if test "x$ac_cv_header_vfork_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VFORK_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in fork vfork
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test "x$ac_cv_func_fork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
+$as_echo_n "checking for working fork... " >&6; }
+if ${ac_cv_func_fork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_fork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* By Ruediger Kuhlmann. */
+ return fork () < 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_fork_works=yes
+else
+ ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
+$as_echo "$ac_cv_func_fork_works" >&6; }
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
+$as_echo_n "checking for working vfork... " >&6; }
+if ${ac_cv_func_vfork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_vfork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Thanks to Paul Eggert for this test. */
+$ac_includes_default
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+
+int
+main ()
+{
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test (0);
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ return (
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_vfork_works=yes
+else
+ ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
+$as_echo "$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=$ac_cv_func_vfork
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+$as_echo "#define vfork fork" >>confdefs.h
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${ac_cv_working_alloca_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_working_alloca_h=yes
+else
+ ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if ${ac_cv_func_alloca_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca (size_t);
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_alloca_works=yes
+else
+ ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if ${ac_cv_os_cray+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "webecray" >/dev/null 2>&1; then :
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+ break
+fi
+
+ done
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if ${ac_cv_c_stack_direction+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_c_stack_direction=0
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+ return find_stack_direction () < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_stack_direction=1
+else
+ ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
+
+for ac_func in strerror_r
+do :
+ ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
+if test "x$ac_cv_func_strerror_r" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR_R 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+$as_echo_n "checking whether strerror_r returns char *... " >&6; }
+if ${ac_cv_func_strerror_r_char_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+ # function. BeOS and DEC UNIX 4.0 fall in this category, but the
+ # former has a strerror_r that returns char*, while the latter
+ # has a strerror_r that returns `int'.
+ # This test should segfault on the DEC system.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ extern char *strerror_r ();
+int
+main ()
+{
+char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ return ! isalpha (x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
+$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+
+fi
+
+
+ac_busted_vpath_in_make=no
+case "$build" in
+ *-*-irix6.1*) # 64 bit only
+ # busted vpath?
+ ;;
+ *-*-irix6*) # 6.2 (and later?)
+ ac_busted_vpath_in_make=yes
+ ;;
+ *-*-solaris2.5.1)
+ ac_busted_vpath_in_make=yes
+ ;;
+ *-*-unicosmp*)
+ ac_busted_vpath_in_make=yes
+ ;;
+esac
+
+case "$ac_busted_vpath_in_make$srcdir" in
+ yes.|no*)
+ ;;
+ *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in
+ '')
+ as_fn_error $? "building outside of the main directory requires GNU make" "$LINENO" 5
+ esac
+ ;;
+esac
+
+case "$host" in
+ *-*-aix4*)
+ # Bug 2516:
+ # Was *-*-aix[[4-9]]*
+ # XXX only verified thru AIX6. But...
+ # Ken Link says this is fine for AIX 5.3 and 7.1, and sees no reason
+ # that this support would be in 5.3, removed in 6, and added back.
+ #
+ # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
+ # (returning ENOSYS). I didn't check 4.2. If, in the future,
+ # IBM pulls its thumbs out long enough to implement clock_settime,
+ # this conditional will need to change. Maybe use AC_TRY_RUN
+ # instead to try to set the time to itself and check errno.
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_clock_gettime" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_clock_gettime $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+ for ac_func in clock_getres clock_gettime clock_settime
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ;;
+esac
+
+for ac_func in getclock stime timegm strlcpy strlcat
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+#
+for ac_header in errno.h sys/socket.h sys/types.h time.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in net/if.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+
+"
+if test "x$ac_cv_header_net_if_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_IF_H 1
+_ACEOF
+
+fi
+
+done
+
+case "$host" in
+ *-hp-hpux*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if net/if.h requires mpinfou predeclaration" >&5
+$as_echo_n "checking if net/if.h requires mpinfou predeclaration... " >&6; }
+if ${ntp_cv_predecl_mpinfou+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ np_cv_predecl_mpinfou=no
+ case "$ac_cv_header_net_if_h" in
+ no)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+ } mpinfou_t;
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #include <net/if.h>
+
+int
+main ()
+{
+
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ ntp_cv_predecl_mpinfou=yes
+ ac_cv_header_net_if_h=yes
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_predecl_mpinfou" >&5
+$as_echo "$ntp_cv_predecl_mpinfou" >&6; }
+ case "$ntp_cv_predecl_mpinfou" in
+ yes)
+ cat >>confdefs.h <<_ACEOF
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+_ACEOF
+
+ esac
+esac
+
+case "$host" in
+ *-linux*)
+ for ac_header in linux/if_addr.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "linux/if_addr.h" "ac_cv_header_linux_if_addr_h" "
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+
+"
+if test "x$ac_cv_header_linux_if_addr_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_IF_ADDR_H 1
+_ACEOF
+
+fi
+
+done
+
+esac
+
+for ac_header in arpa/nameser.h sys/param.h sys/time.h sys/timers.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
+for ac_header in sys/sysctl.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "
+ #if defined HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+
+"
+if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SYSCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in netinet/in_system.h netinet/in_systm.h netinet/in.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in resolv.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+
+"
+if test "x$ac_cv_header_resolv_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RESOLV_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in net/if_var.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "net/if_var.h" "ac_cv_header_net_if_var_h" "
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_NET_IF_H
+ # include <net/if.h>
+ #endif
+
+"
+if test "x$ac_cv_header_net_if_var_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NET_IF_VAR_H 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in netinet/ip.h netinet/in_var.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NET_IF_H
+ # include <net/if.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_NET_IF_VAR_H
+ # include <net/if_var.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_SYSTM_H
+ # include <netinet/in_systm.h>
+ #endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# HMS: Do we need to check for -lsocket before or after these tests?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5
+$as_echo_n "checking for library containing inet_pton... " >&6; }
+if ${ac_cv_search_inet_pton+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_pton ();
+int
+main ()
+{
+return inet_pton ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_pton=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_pton+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_pton+:} false; then :
+
+else
+ ac_cv_search_inet_pton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5
+$as_echo "$ac_cv_search_inet_pton" >&6; }
+ac_res=$ac_cv_search_inet_pton
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_inet_pton" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_inet_pton $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
+$as_echo_n "checking for library containing inet_ntop... " >&6; }
+if ${ac_cv_search_inet_ntop+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntop ();
+int
+main ()
+{
+return inet_ntop ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_ntop=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_ntop+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_ntop+:} false; then :
+
+else
+ ac_cv_search_inet_ntop=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
+$as_echo "$ac_cv_search_inet_ntop" >&6; }
+ac_res=$ac_cv_search_inet_ntop
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_inet_ntop" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_inet_ntop $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+
+# [Bug 1628] On Solaris, we need -lxnet -lsocket. Generalize this to
+# avoid keying on the OS name: If we find socket functions in
+# libsocket, next try for them in libxnet without libsocket, if found,
+# list both. If we simply tested libxnet first, we would find the
+# functions there and never add libsocket. See also [Bug 660]
+# http://bugs.ntp.org/show_bug.cgi?id=660#c9
+saved_LIBS=$LIBS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
+$as_echo_n "checking for library containing setsockopt... " >&6; }
+if ${ac_cv_search_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char setsockopt ();
+int
+main ()
+{
+return setsockopt ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_setsockopt=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_setsockopt+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_setsockopt+:} false; then :
+
+else
+ ac_cv_search_setsockopt=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5
+$as_echo "$ac_cv_search_setsockopt" >&6; }
+ac_res=$ac_cv_search_setsockopt
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_setsockopt" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_setsockopt $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+case "$ac_cv_search_setsockopt" in
+ -lsocket)
+ LIBS="$saved_LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getsockopt" >&5
+$as_echo_n "checking for library containing getsockopt... " >&6; }
+if ${ac_cv_search_getsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getsockopt ();
+int
+main ()
+{
+return getsockopt ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' xnet; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getsockopt=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getsockopt+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getsockopt+:} false; then :
+
+else
+ ac_cv_search_getsockopt=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getsockopt" >&5
+$as_echo "$ac_cv_search_getsockopt" >&6; }
+ac_res=$ac_cv_search_getsockopt
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_getsockopt" in
+ 'none required') ;;
+ no) ;;
+ *) LDADD_LIBNTP="$ac_cv_search_getsockopt $LDADD_LIBNTP" ;;
+ esac
+
+fi
+
+ # XXX Possible trouble here - reading the comments above and looking at the
+ # code below I wonder if we'll add -lxnet when we don't need it.
+ # Also, do we need to add -lxnet to LDADD_LIBNTP, or perhaps see if it's
+ # there when it is not needed?
+ case "$ac_cv_search_getsockopt" in
+ -lxnet)
+ LIBS="-lxnet -lsocket $saved_LIBS"
+ ;;
+ *) LIBS="-lsocket $saved_LIBS"
+ ;;
+ esac
+ ;;
+esac
+{ saved_LIBS=; unset saved_LIBS;}
+
+# Bug 2427 - look for recvmsg here.
+for ac_func in recvmsg
+do :
+ ac_fn_c_check_func "$LINENO" "recvmsg" "ac_cv_func_recvmsg"
+if test "x$ac_cv_func_recvmsg" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RECVMSG 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
+case "$ac_cv_c_inline" in
+ '')
+ ;;
+ *)
+
+$as_echo "#define HAVE_INLINE 1" >>confdefs.h
+
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if ${ac_cv_sizeof_time_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_time_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (time_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_time_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5
+$as_echo_n "checking whether char is unsigned... " >&6; }
+if ${ac_cv_c_char_unsigned+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((char) -1) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_char_unsigned=no
+else
+ ac_cv_c_char_unsigned=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5
+$as_echo "$ac_cv_c_char_unsigned" >&6; }
+if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
+ $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h
+
+fi
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5
+$as_echo_n "checking size of signed char... " >&6; }
+if ${ac_cv_sizeof_signed_char+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_signed_char" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (signed char)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_signed_char=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5
+$as_echo "$ac_cv_sizeof_signed_char" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
+_ACEOF
+
+
+ac_fn_c_check_type "$LINENO" "s_char" "ac_cv_type_s_char" "$ac_includes_default"
+if test "x$ac_cv_type_s_char" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_S_CHAR 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
+if test "x$ac_cv_type_long_long" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LONG_LONG 1
+_ACEOF
+
+
+fi
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+case "$ac_cv_type_long_long" in
+ no)
+ ;;
+ *)
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+ ;;
+esac
+
+case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
+ *yes)
+ # We have a typedef for s_char. Might as well believe it...
+ ;;
+ no0no)
+ # We have signed chars, can't say 'signed char', no s_char typedef.
+
+$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h
+
+ ;;
+ no1no)
+ # We have signed chars, can say 'signed char', no s_char typedef.
+
+$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h
+
+ ;;
+ yes0no)
+ # We have unsigned chars, can't say 'signed char', no s_char typedef.
+ as_fn_error $? "No way to specify a signed character!" "$LINENO" 5
+ ;;
+ yes1no)
+ # We have unsigned chars, can say 'signed char', no s_char typedef.
+
+$as_echo "#define NEED_S_CHAR_TYPEDEF 1" >>confdefs.h
+
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
+$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+if ${ac_cv_type_uid_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1; then :
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
+$as_echo "$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
+
+$as_echo "#define uid_t int" >>confdefs.h
+
+
+$as_echo "#define gid_t int" >>confdefs.h
+
+fi
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're including debugging code" >&5
+$as_echo_n "checking if we're including debugging code... " >&6; }
+# Check whether --enable-debugging was given.
+if test "${enable_debugging+set}" = set; then :
+ enableval=$enable_debugging; ntp_ok=$enableval
+else
+ ntp_ok=yes
+
+fi
+
+case "$ntp_ok" in
+ yes)
+
+$as_echo "#define DEBUG 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ok" >&5
+$as_echo "$ntp_ok" >&6; }
+
+
+
+# check if we can compile with pthreads
+for ac_header in semaphore.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default"
+if test "x$ac_cv_header_semaphore_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SEMAPHORE_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in socketpair
+do :
+ ac_fn_c_check_func "$LINENO" "socketpair" "ac_cv_func_socketpair"
+if test "x$ac_cv_func_socketpair" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKETPAIR 1
+_ACEOF
+
+fi
+done
+
+# Check whether --enable-thread-support was given.
+if test "${enable_thread_support+set}" = set; then :
+ enableval=$enable_thread_support;
+else
+ enable_thread_support=yes
+
+fi
+
+have_pthreads=no
+case "$enable_thread_support" in
+ yes)
+ ol_found_pthreads=no
+
+
+
+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
+
+# OpenLDAP --with-threads
+
+# Check whether --with-threads was given.
+if test "${with_threads+set}" = set; then :
+ withval=$with_threads;
+ ol_arg=invalid
+ for ol_val in auto nt posix mach pth lwp yes no manual ; do
+ if test "$withval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ as_fn_error $? "bad value $withval for --with-threads" "$LINENO" 5
+ fi
+ ol_with_threads="$ol_arg"
+
+else
+ ol_with_threads="auto"
+fi
+# end --with-threads
+
+
+case "$ol_with_threads$host" in
+ auto*-*-solaris2.[0-6])
+ ol_with_threads=no
+ ;;
+esac
+
+
+ol_aix_threads=no
+case "$host" in
+*-*-aix*) if test -z "$CC" ; then
+ case "$ol_with_threads" in
+ auto | yes | posix) ol_aix_threads=yes ;;
+ esac
+ fi
+;;
+esac
+
+if test $ol_aix_threads = yes ; then
+ if test -z "${CC}" ; then
+ for ac_prog in cc_r xlc_r cc
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+done
+
+
+ if test "$CC" = cc ; then
+ if test $ol_with_threads != auto ; then
+ as_fn_error $? "--with-threads requires cc_r (or other suitable compiler) on AIX" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5
+$as_echo "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;}
+ fi
+ ol_with_threads=no
+ fi
+ fi
+
+ case ${CC} in cc_r | xlc_r)
+ ol_with_threads=posix
+ ol_cv_pthread_create=yes
+ ;;
+ esac
+fi
+
+ol_link_threads=no
+# OpenLDAP --with-yielding_select
+
+# Check whether --with-yielding_select was given.
+if test "${with_yielding_select+set}" = set; then :
+ withval=$with_yielding_select;
+ ol_arg=invalid
+ for ol_val in auto yes no manual ; do
+ if test "$withval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ as_fn_error $? "bad value $withval for --with-yielding_select" "$LINENO" 5
+ fi
+ ol_with_yielding_select="$ol_arg"
+
+else
+ ol_with_yielding_select="auto"
+fi
+# end --with-yielding_select
+
+
+case $ol_with_threads in auto | yes | nt)
+
+
+ ac_fn_c_check_func "$LINENO" "_beginthread" "ac_cv_func__beginthread"
+if test "x$ac_cv_func__beginthread" = xyes; then :
+
+fi
+
+
+ if test $ac_cv_func__beginthread = yes ; then
+
+$as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h
+
+ ol_cv_nt_threads=yes
+ fi
+
+
+ if test "$ol_cv_nt_threads" = yes ; then
+ ol_link_threads=nt
+ ol_with_threads=found
+ ol_with_yielding_select=yes
+
+
+$as_echo "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h
+
+ fi
+
+ if test $ol_with_threads = nt ; then
+ as_fn_error $? "could not locate NT Threads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | posix)
+
+ for ac_header in pthread.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_pthread_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5
+$as_echo_n "checking POSIX thread version... " >&6; }
+if ${ol_cv_pthread_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+
+int
+main ()
+{
+
+ int i = PTHREAD_CREATE_JOINABLE;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_detach" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=10
+else
+ ol_cv_pthread_version=8
+fi
+rm -f conftest*
+
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+# ifdef PTHREAD_CREATE_UNDETACHED
+ draft7
+# endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "draft7" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=7
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_attr_init" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+#ifdef PTHREAD_MUTEX_INITIALIZER
+ draft5
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "draft5" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=5
+else
+ ol_cv_pthread_version=4
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5
+$as_echo "$ol_cv_pthread_version" >&6; }
+
+
+ if test $ol_cv_pthread_version != 0 ; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREADS $ol_cv_pthread_version
+_ACEOF
+
+ else
+ as_fn_error $? "unknown pthread version" "$LINENO" 5
+ fi
+
+ # consider threads found
+ ol_with_threads=found
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
+$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
+if ${ol_cv_header_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
+ ol_cv_header_linux_threads=yes
+else
+ ol_cv_header_linux_threads=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
+$as_echo "$ol_cv_header_linux_threads" >&6; }
+ if test $ol_cv_header_linux_threads = yes; then
+
+$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5
+$as_echo_n "checking for GNU Pth pthread.h... " >&6; }
+if ${ol_cv_header_gnu_pth_pthread_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+ __gnu_pth__;
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "__gnu_pth__" >/dev/null 2>&1; then :
+ ol_cv_header_gnu_pth_pthread_h=yes
+else
+ ol_cv_header_gnu_pth_pthread_h=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5
+$as_echo "$ol_cv_header_gnu_pth_pthread_h" >&6; }
+
+
+ if test $ol_cv_header_gnu_pth_pthread_h = no ; then
+ for ac_header in sched.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
+if test "x$ac_cv_header_sched_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SCHED_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5
+$as_echo_n "checking for pthread_create in default libraries... " >&6; }
+if ${ol_cv_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_create=yes
+else
+ ol_cv_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_create=yes
+else
+ ol_cv_pthread_create=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5
+$as_echo "$ol_cv_pthread_create" >&6; }
+
+ if test $ol_cv_pthread_create != no ; then
+ ol_link_threads=posix
+ ol_link_pthreads=""
+ fi
+
+ # Pthread try link: -kthread (ol_cv_pthread_kthread)
+if test "$ol_link_threads" = no ; then
+ # try -kthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5
+$as_echo_n "checking for pthread link with -kthread... " >&6; }
+if ${ol_cv_pthread_kthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-kthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_kthread=yes
+else
+ ol_cv_pthread_kthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_kthread=yes
+else
+ ol_cv_pthread_kthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5
+$as_echo "$ol_cv_pthread_kthread" >&6; }
+
+ if test $ol_cv_pthread_kthread = yes ; then
+ ol_link_pthreads="-kthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthread (ol_cv_pthread_pthread)
+if test "$ol_link_threads" = no ; then
+ # try -pthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5
+$as_echo_n "checking for pthread link with -pthread... " >&6; }
+if ${ol_cv_pthread_pthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_pthread=yes
+else
+ ol_cv_pthread_pthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_pthread=yes
+else
+ ol_cv_pthread_pthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5
+$as_echo "$ol_cv_pthread_pthread" >&6; }
+
+ if test $ol_cv_pthread_pthread = yes ; then
+ ol_link_pthreads="-pthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
+if test "$ol_link_threads" = no ; then
+ # try -pthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5
+$as_echo_n "checking for pthread link with -pthreads... " >&6; }
+if ${ol_cv_pthread_pthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_pthreads=yes
+else
+ ol_cv_pthread_pthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_pthreads=yes
+else
+ ol_cv_pthread_pthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5
+$as_echo "$ol_cv_pthread_pthreads" >&6; }
+
+ if test $ol_cv_pthread_pthreads = yes ; then
+ ol_link_pthreads="-pthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
+if test "$ol_link_threads" = no ; then
+ # try -mthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5
+$as_echo_n "checking for pthread link with -mthreads... " >&6; }
+if ${ol_cv_pthread_mthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-mthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_mthreads=yes
+else
+ ol_cv_pthread_mthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_mthreads=yes
+else
+ ol_cv_pthread_mthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5
+$as_echo "$ol_cv_pthread_mthreads" >&6; }
+
+ if test $ol_cv_pthread_mthreads = yes ; then
+ ol_link_pthreads="-mthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -thread (ol_cv_pthread_thread)
+if test "$ol_link_threads" = no ; then
+ # try -thread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5
+$as_echo_n "checking for pthread link with -thread... " >&6; }
+if ${ol_cv_pthread_thread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-thread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_thread=yes
+else
+ ol_cv_pthread_thread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_thread=yes
+else
+ ol_cv_pthread_thread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5
+$as_echo "$ol_cv_pthread_thread" >&6; }
+
+ if test $ol_cv_pthread_thread = yes ; then
+ ol_link_pthreads="-thread"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -lmach -lexc -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+$as_echo_n "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; }
+if ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5
+$as_echo "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -lmach -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthread -lmach -lexc... " >&6; }
+if ${ol_cv_pthread_lpthread_lmach_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthread_lmach_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -Wl,-woff,85
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+$as_echo_n "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; }
+if ${ol_cv_pthread_lib_lpthread_woff+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -Wl,-woff,85 $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lib_lpthread_woff=yes
+else
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lib_lpthread_woff=yes
+else
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5
+$as_echo "$ol_cv_pthread_lib_lpthread_woff" >&6; }
+
+ if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
+ ol_link_pthreads="-lpthread -Wl,-woff,85"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5
+$as_echo_n "checking for pthread link with -lpthread... " >&6; }
+if ${ol_cv_pthread_lpthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread=yes
+else
+ ol_cv_pthread_lpthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread=yes
+else
+ ol_cv_pthread_lpthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5
+$as_echo "$ol_cv_pthread_lpthread" >&6; }
+
+ if test $ol_cv_pthread_lpthread = yes ; then
+ ol_link_pthreads="-lpthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5
+$as_echo_n "checking for pthread link with -lc_r... " >&6; }
+if ${ol_cv_pthread_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lc_r=yes
+else
+ ol_cv_pthread_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lc_r=yes
+else
+ ol_cv_pthread_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5
+$as_echo "$ol_cv_pthread_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lc_r = yes ; then
+ ol_link_pthreads="-lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -threads (ol_cv_pthread_threads)
+if test "$ol_link_threads" = no ; then
+ # try -threads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5
+$as_echo_n "checking for pthread link with -threads... " >&6; }
+if ${ol_cv_pthread_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-threads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_threads=yes
+else
+ ol_cv_pthread_threads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_threads=yes
+else
+ ol_cv_pthread_threads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5
+$as_echo "$ol_cv_pthread_threads" >&6; }
+
+ if test $ol_cv_pthread_threads = yes ; then
+ ol_link_pthreads="-threads"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lmach -lexc -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; }
+if ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
+ ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lmach -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc... " >&6; }
+if ${ol_cv_pthread_lpthreads_lmach_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lmach -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
+ ol_link_pthreads="-lpthreads -lmach -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lexc... " >&6; }
+if ${ol_cv_pthread_lpthreads_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lexc = yes ; then
+ ol_link_pthreads="-lpthreads -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5
+$as_echo_n "checking for pthread link with -lpthreads... " >&6; }
+if ${ol_cv_pthread_lib_lpthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lib_lpthreads=yes
+else
+ ol_cv_pthread_lib_lpthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lib_lpthreads=yes
+else
+ ol_cv_pthread_lib_lpthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5
+$as_echo "$ol_cv_pthread_lib_lpthreads" >&6; }
+
+ if test $ol_cv_pthread_lib_lpthreads = yes ; then
+ ol_link_pthreads="-lpthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ if test $ol_link_threads != no ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
+
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+
+ for ac_func in sched_yield pthread_yield thr_yield
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test $ac_cv_func_thr_yield = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_sched_yield=yes
+else
+ ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+ LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+
+$as_echo "#define HAVE_SCHED_YIELD 1" >>confdefs.h
+
+ ac_cv_func_sched_yield=yes
+else
+ ac_cv_func_sched_yield=no
+fi
+
+ fi
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test "$ac_cv_func_thr_yield" = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5
+$as_echo "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;}
+ fi
+
+ for ac_func in pthread_kill
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill"
+if test "x$ac_cv_func_pthread_kill" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_KILL 1
+_ACEOF
+
+fi
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with <pthread.h>" >&5
+$as_echo_n "checking for pthread_rwlock_destroy with <pthread.h>... " >&6; }
+if ${ol_cv_func_pthread_rwlock_destroy+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+pthread_rwlock_t rwlock;
+
+int
+main ()
+{
+pthread_rwlock_destroy(&rwlock);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_func_pthread_rwlock_destroy=yes
+else
+ ol_cv_func_pthread_rwlock_destroy=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5
+$as_echo "$ol_cv_func_pthread_rwlock_destroy" >&6; }
+ if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
+
+$as_echo "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with <pthread.h>" >&5
+$as_echo_n "checking for pthread_detach with <pthread.h>... " >&6; }
+if ${ol_cv_func_pthread_detach+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+int
+main ()
+{
+pthread_detach(NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_func_pthread_detach=yes
+else
+ ol_cv_func_pthread_detach=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5
+$as_echo "$ol_cv_func_pthread_detach" >&6; }
+
+ if test $ol_cv_func_pthread_detach = no ; then
+ as_fn_error $? "could not locate pthread_detach()" "$LINENO" 5
+ fi
+
+
+$as_echo "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h
+
+
+ for ac_func in \
+ pthread_setconcurrency \
+ pthread_getconcurrency \
+ thr_setconcurrency \
+ thr_getconcurrency \
+
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+ for ac_func in pthread_kill_other_threads_np
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np"
+if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5
+$as_echo_n "checking for LinuxThreads implementation... " >&6; }
+if ${ol_cv_sys_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5
+$as_echo "$ol_cv_sys_linux_threads" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5
+$as_echo_n "checking for LinuxThreads consistency... " >&6; }
+if ${ol_cv_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ol_cv_header_linux_threads = yes &&
+ test $ol_cv_sys_linux_threads = yes; then
+ ol_cv_linux_threads=yes
+ elif test $ol_cv_header_linux_threads = no &&
+ test $ol_cv_sys_linux_threads = no; then
+ ol_cv_linux_threads=no
+ else
+ ol_cv_linux_threads=error
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5
+$as_echo "$ol_cv_linux_threads" >&6; }
+
+
+ if test $ol_cv_linux_threads = error; then
+ as_fn_error $? "LinuxThreads header/library mismatch" "$LINENO" 5;
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5
+$as_echo_n "checking if pthread_create() works... " >&6; }
+if ${ol_cv_pthread_create_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ ol_cv_pthread_create_works=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_create_works=yes
+else
+ ol_cv_pthread_create_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5
+$as_echo "$ol_cv_pthread_create_works" >&6; }
+
+ if test $ol_cv_pthread_create_works = no ; then
+ as_fn_error $? "pthread_create is not usable, check environment settings" "$LINENO" 5
+ fi
+
+ ol_replace_broken_yield=no
+
+ if test $ol_replace_broken_yield = yes ; then
+
+$as_echo "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h
+
+ fi
+
+ if test x$ol_with_yielding_select = xauto ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5
+$as_echo_n "checking if select yields when using pthreads... " >&6; }
+if ${ol_cv_pthread_select_yields+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ ol_cv_pthread_select_yields=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*) 0
+#endif
+
+static int fildes[2];
+
+static void *task(p)
+ void *p;
+{
+ int i;
+ struct timeval tv;
+
+ fd_set rfds;
+
+ tv.tv_sec=10;
+ tv.tv_usec=0;
+
+ FD_ZERO(&rfds);
+ FD_SET(fildes[0], &rfds);
+
+ /* we're not interested in any fds */
+ i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+ if(i < 0) {
+ perror("select");
+ exit(10);
+ }
+
+ exit(0); /* if we exit here, the select blocked the whole process */
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+
+ /* create a pipe to select */
+ if(pipe(&fildes[0])) {
+ perror("select");
+ exit(1);
+ }
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+ (void) pthread_setconcurrency(2);
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
+ /* Set Solaris LWP concurrency to 2 */
+ thr_setconcurrency(2);
+#endif
+#endif
+
+#if HAVE_PTHREADS < 6
+ pthread_create(&t, pthread_attr_default, task, NULL);
+#else
+ pthread_create(&t, NULL, task, NULL);
+#endif
+
+ /* make sure task runs first */
+#ifdef HAVE_THR_YIELD
+ thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+ sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+ pthread_yield();
+#endif
+
+ exit(2);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_select_yields=no
+else
+ ol_cv_pthread_select_yields=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5
+$as_echo "$ol_cv_pthread_select_yields" >&6; }
+
+ if test $ol_cv_pthread_select_yields = cross ; then
+ as_fn_error $? "crossing compiling: use --with-yielding-select=yes|no|manual" "$LINENO" 5
+ fi
+
+ if test $ol_cv_pthread_select_yields = yes ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ else
+ as_fn_error $? "could not locate usable POSIX Threads" "$LINENO" 5
+ fi
+ fi
+
+ if test $ol_with_threads = posix ; then
+ as_fn_error $? "could not locate POSIX Threads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | mach)
+
+ for ac_header in mach/cthreads.h cthreads.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_mach_cthreads_h = yes ; then
+ ol_with_threads=found
+
+ ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
+if test "x$ac_cv_func_cthread_fork" = xyes; then :
+ ol_link_threads=yes
+fi
+
+
+ if test $ol_link_threads = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5
+$as_echo_n "checking for cthread_fork with -all_load... " >&6; }
+if ${ol_cv_cthread_all_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ save_LIBS="$LIBS"
+ LIBS="-all_load $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <mach/cthreads.h>
+int
+main ()
+{
+
+ cthread_fork((void *)0, (void *)0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_cthread_all_load=yes
+else
+ ol_cv_cthread_all_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5
+$as_echo "$ol_cv_cthread_all_load" >&6; }
+
+ if test $ol_cv_cthread_all_load = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+ ol_link_threads=mach
+ ol_with_threads=found
+ fi
+ fi
+
+ elif test $ac_cv_header_cthreads_h = yes ; then
+
+ ol_with_threads=found
+
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lthreads"
+ ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
+if test "x$ac_cv_func_cthread_fork" = xyes; then :
+ ol_link_threads=yes
+fi
+
+ LIBS="$save_LIBS"
+
+ if test $ol_link_threads = yes ; then
+ LTHREAD_LIBS="-lthreads"
+ ol_link_threads=mach
+ ol_with_threads=found
+ else
+ as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
+ fi
+
+ elif test $ol_with_threads = mach ; then
+ as_fn_error $? "could not locate Mach CThreads" "$LINENO" 5
+ fi
+
+ if test $ol_link_threads = mach ; then
+
+$as_echo "#define HAVE_MACH_CTHREADS 1" >>confdefs.h
+
+ elif test $ol_with_threads = found ; then
+ as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | pth)
+
+ for ac_header in pth.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default"
+if test "x$ac_cv_header_pth_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTH_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_pth_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5
+$as_echo_n "checking for pth_version in -lpth... " >&6; }
+if ${ac_cv_lib_pth_pth_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpth $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pth_version ();
+int
+main ()
+{
+return pth_version ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pth_pth_version=yes
+else
+ ac_cv_lib_pth_pth_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5
+$as_echo "$ac_cv_lib_pth_pth_version" >&6; }
+if test "x$ac_cv_lib_pth_pth_version" = xyes; then :
+ have_pth=yes
+else
+ have_pth=no
+fi
+
+
+ if test $have_pth = yes ; then
+
+$as_echo "#define HAVE_GNU_PTH 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
+ ol_link_threads=pth
+ ol_with_threads=found
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | lwp)
+
+ for ac_header in thread.h synch.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_thread_h = yes &&
+ test $ac_cv_header_synch_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5
+$as_echo_n "checking for thr_create in -lthread... " >&6; }
+if ${ac_cv_lib_thread_thr_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char thr_create ();
+int
+main ()
+{
+return thr_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_thread_thr_create=yes
+else
+ ac_cv_lib_thread_thr_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5
+$as_echo "$ac_cv_lib_thread_thr_create" >&6; }
+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
+ have_thr=yes
+else
+ have_thr=no
+fi
+
+
+ if test $have_thr = yes ; then
+
+$as_echo "#define HAVE_THR 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
+ ol_link_threads=thr
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+
+ for ac_func in \
+ thr_setconcurrency \
+ thr_getconcurrency \
+
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ fi
+ fi
+
+ for ac_header in lwp/lwp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
+if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LWP_LWP_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_lwp_lwp_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5
+$as_echo_n "checking for lwp_create in -llwp... " >&6; }
+if ${ac_cv_lib_lwp_lwp_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llwp $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lwp_create ();
+int
+main ()
+{
+return lwp_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_lwp_lwp_create=yes
+else
+ ac_cv_lib_lwp_lwp_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5
+$as_echo "$ac_cv_lib_lwp_lwp_create" >&6; }
+if test "x$ac_cv_lib_lwp_lwp_create" = xyes; then :
+ have_lwp=yes
+else
+ have_lwp=no
+fi
+
+
+ if test $have_lwp = yes ; then
+
+$as_echo "#define HAVE_LWP 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+ ol_link_threads=lwp
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=no
+ fi
+ fi
+ fi
+ ;;
+esac
+
+if test $ol_with_yielding_select = yes ; then
+
+$as_echo "#define HAVE_YIELDING_SELECT 1" >>confdefs.h
+
+fi
+
+if test $ol_with_threads = manual ; then
+ ol_link_threads=yes
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5
+$as_echo "$as_me: WARNING: thread defines and link options must be set manually" >&2;}
+
+ for ac_header in pthread.h sched.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_func in sched_yield pthread_yield
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
+$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
+if ${ol_cv_header_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
+ ol_cv_header_linux_threads=yes
+else
+ ol_cv_header_linux_threads=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
+$as_echo "$ol_cv_header_linux_threads" >&6; }
+ if test $ol_cv_header_linux_threads = yes; then
+
+$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
+
+ fi
+
+
+ for ac_header in mach/cthreads.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default"
+if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MACH_CTHREADS_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in lwp/lwp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
+if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LWP_LWP_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in thread.h synch.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+if test $ol_link_threads != no && test $ol_link_threads != nt ; then
+
+$as_echo "#define REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define THREAD_SAFE 1" >>confdefs.h
+
+
+$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
+
+
+$as_echo "#define THREADSAFE 1" >>confdefs.h
+
+
+$as_echo "#define _THREADSAFE 1" >>confdefs.h
+
+
+$as_echo "#define _SGI_MP_SOURCE 1" >>confdefs.h
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5
+$as_echo_n "checking for thread specific errno... " >&6; }
+if ${ol_cv_errno_thread_specific+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+int
+main ()
+{
+errno = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_errno_thread_specific=yes
+else
+ ol_cv_errno_thread_specific=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5
+$as_echo "$ol_cv_errno_thread_specific" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5
+$as_echo_n "checking for thread specific h_errno... " >&6; }
+if ${ol_cv_h_errno_thread_specific+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netdb.h>
+int
+main ()
+{
+h_errno = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_h_errno_thread_specific=yes
+else
+ ol_cv_h_errno_thread_specific=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5
+$as_echo "$ol_cv_h_errno_thread_specific" >&6; }
+
+ if test $ol_cv_errno_thread_specific != yes ||
+ test $ol_cv_h_errno_thread_specific != yes ; then
+ LIBS="$LTHREAD_LIBS $LIBS"
+ LTHREAD_LIBS=""
+ fi
+
+fi
+
+if test $ol_link_threads = no ; then
+ if test $ol_with_threads = yes ; then
+ as_fn_error $? "no suitable thread support" "$LINENO" 5
+ fi
+
+ if test $ol_with_threads = auto ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5
+$as_echo "$as_me: WARNING: no suitable thread support, disabling threads" >&2;}
+ ol_with_threads=no
+ fi
+
+
+$as_echo "#define NO_THREADS 1" >>confdefs.h
+
+ LTHREAD_LIBS=""
+ BUILD_THREAD=no
+else
+ BUILD_THREAD=yes
+fi
+
+if test $ol_link_threads != no ; then
+
+$as_echo "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h
+
+fi
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+case "$ol_with_threads" in
+ no)
+ ol_pthread_ok=no
+
+ ;;
+ *)
+ ol_found_pthreads=yes
+ ;;
+esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ case "$ol_found_pthreads" in
+ yes)
+ saved_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+ for ac_func in sem_timedwait
+do :
+ ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait"
+if test "x$ac_cv_func_sem_timedwait" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SEM_TIMEDWAIT 1
+_ACEOF
+
+fi
+done
+
+ LIBS="$saved_LIBS"
+ { saved_LIBS=; unset saved_LIBS;}
+ CFLAGS="$saved_CFLAGS"
+ { saved_CFLAGS=; unset saved_CFLAGS;}
+ case "$ac_cv_func_sem_timedwait" 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)
+ { $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
+
+case "$have_pthreads" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP $PTHREAD_CFLAGS"
+ saved_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5
+$as_echo_n "checking size of pthread_t... " >&6; }
+if ${ac_cv_sizeof_pthread_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" "
+ $ac_includes_default
+ #include <pthread.h>
+
+
+"; then :
+
+else
+ if test "$ac_cv_type_pthread_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (pthread_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pthread_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5
+$as_echo "$ac_cv_sizeof_pthread_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t
+_ACEOF
+
+
+ LIBISC_PTHREADS_NOTHREADS=pthreads
+
+$as_echo "#define ISC_PLATFORM_USETHREADS 1" >>confdefs.h
+
+ #
+ # We'd like to use sigwait() too
+ #
+ ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait"
+if test "x$ac_cv_func_sigwait" = xyes; then :
+ have_sigwait=yes
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc" >&5
+$as_echo_n "checking for sigwait in -lc... " >&6; }
+if ${ac_cv_lib_c_sigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $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 sigwait ();
+int
+main ()
+{
+return sigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_sigwait=yes
+else
+ ac_cv_lib_c_sigwait=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_c_sigwait" >&5
+$as_echo "$ac_cv_lib_c_sigwait" >&6; }
+if test "x$ac_cv_lib_c_sigwait" = xyes; then :
+ have_sigwait=yes
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lpthread" >&5
+$as_echo_n "checking for sigwait in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_sigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $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 sigwait ();
+int
+main ()
+{
+return sigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_sigwait=yes
+else
+ ac_cv_lib_pthread_sigwait=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_pthread_sigwait" >&5
+$as_echo "$ac_cv_lib_pthread_sigwait" >&6; }
+if test "x$ac_cv_lib_pthread_sigwait" = xyes; then :
+ have_sigwait=yes
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Psigwait in -lpthread" >&5
+$as_echo_n "checking for _Psigwait in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread__Psigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $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 _Psigwait ();
+int
+main ()
+{
+return _Psigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread__Psigwait=yes
+else
+ ac_cv_lib_pthread__Psigwait=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_pthread__Psigwait" >&5
+$as_echo "$ac_cv_lib_pthread__Psigwait" >&6; }
+if test "x$ac_cv_lib_pthread__Psigwait" = xyes; then :
+ have_sigwait=yes
+else
+ have_sigwait=no
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ case "$host:$have_sigwait" in
+ *-freebsd*:no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwait in -lc_r" >&5
+$as_echo_n "checking for sigwait in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_sigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $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 sigwait ();
+int
+main ()
+{
+return sigwait ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_sigwait=yes
+else
+ ac_cv_lib_c_r_sigwait=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_c_r_sigwait" >&5
+$as_echo "$ac_cv_lib_c_r_sigwait" >&6; }
+if test "x$ac_cv_lib_c_r_sigwait" = xyes; then :
+ have_sigwait=yes
+
+fi
+
+ esac
+ case "$have_sigwait" in
+ yes)
+ ac_cv_func_sigwait=yes
+
+$as_echo "#define HAVE_SIGWAIT 1" >>confdefs.h
+
+ esac
+
+ for ac_func in pthread_attr_getstacksize
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_attr_getstacksize" "ac_cv_func_pthread_attr_getstacksize"
+if test "x$ac_cv_func_pthread_attr_getstacksize" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
+_ACEOF
+
+fi
+done
+
+ for ac_func in pthread_attr_setstacksize sysconf
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ case "$host" in
+ *-freebsd5.[012]|*-freebsd5.[012].*)
+ ;;
+ *-freebsd5.[3456789]|*-freebsd5.[3456789].*|*-freebsd6.*)
+
+$as_echo "#define NEED_PTHREAD_SCOPE_SYSTEM 1" >>confdefs.h
+
+ ;;
+ *-bsdi3.*|*-bsdi4.0*)
+
+$as_echo "#define NEED_PTHREAD_INIT 1" >>confdefs.h
+
+ ;;
+ *-linux*)
+
+$as_echo "#define HAVE_LINUXTHREADS 1" >>confdefs.h
+
+ ;;
+ *-solaris*)
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ for ac_func in pthread_setconcurrency
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_setconcurrency" "ac_cv_func_pthread_setconcurrency"
+if test "x$ac_cv_func_pthread_setconcurrency" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_SETCONCURRENCY 1
+_ACEOF
+
+fi
+done
+
+ case "$ac_cv_func_pthread_setconcurrency" in
+ yes)
+
+$as_echo "#define CALL_PTHREAD_SETCONCURRENCY 1" >>confdefs.h
+
+ esac
+ ;;
+ *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+
+$as_echo "#define HAVE_UNIXWARE_SIGWAIT 1" >>confdefs.h
+
+ ;;
+ esac
+ hack_shutup_pthreadonceinit=no
+ case "$host" in
+ *-aix5.[123].*)
+ hack_shutup_pthreadonceinit=yes
+ ;;
+ *-solaris2.[89])
+ hack_shutup_pthreadonceinit=yes
+ ;;
+ *-solaris2.1[0-9])
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if extra braces are needed for PTHREAD_ONCE_INIT" >&5
+$as_echo_n "checking if extra braces are needed for PTHREAD_ONCE_INIT... " >&6; }
+if ${ntp_cv_braces_around_pthread_once_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+
+int
+main ()
+{
+
+ static pthread_once_t once_test =
+ PTHREAD_ONCE_INIT;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_braces_around_pthread_once_init=no
+else
+ ntp_cv_braces_around_pthread_once_init=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_braces_around_pthread_once_init" >&5
+$as_echo "$ntp_cv_braces_around_pthread_once_init" >&6; }
+ case "$ntp_cv_braces_around_pthread_once_init" in
+ yes)
+ hack_shutup_pthreadonceinit=yes
+ esac
+ ;;
+ esac
+ case "$hack_shutup_pthreadonceinit" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1" >>confdefs.h
+
+ esac
+ LIBS="$saved_LIBS"
+ { saved_LIBS=; unset saved_LIBS;}
+ CFLAGS="$saved_CFLAGS"
+ { saved_CFLAGS=; unset saved_CFLAGS;}
+ ;;
+ *)
+ LIBISC_PTHREADS_NOTHREADS=nothreads
+ ;;
+esac
+
+ if test "$have_pthreads" != "no"; then
+ PTHREADS_TRUE=
+ PTHREADS_FALSE='#'
+else
+ PTHREADS_TRUE='#'
+ PTHREADS_FALSE=
+fi
+
+
+
+
+
+
+
+case "$hw_use_rpl_vsnprintf:$hw_cv_func_vsnprintf" in
+ no:yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if vsnprintf expands \"%m\" to strerror(errno)" >&5
+$as_echo_n "checking if vsnprintf expands \"%m\" to strerror(errno)... " >&6; }
+if ${ntp_cv_vsnprintf_percent_m+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ntp_cv_vsnprintf_percent_m=no
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdarg.h>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ int call_vsnprintf(
+ char * dst,
+ size_t sz,
+ const char *fmt,
+ ...
+ );
+
+ int call_vsnprintf(
+ char * dst,
+ size_t sz,
+ const char *fmt,
+ ...
+ )
+ {
+ va_list ap;
+ int rc;
+
+ va_start(ap, fmt);
+ rc = vsnprintf(dst, sz, fmt, ap);
+ va_end(ap);
+
+ return rc;
+ }
+
+int
+main ()
+{
+
+ char sbuf[512];
+ char pbuf[512];
+ int slen;
+
+ strcpy(sbuf, strerror(ENOENT));
+ errno = ENOENT;
+ slen = call_vsnprintf(pbuf, sizeof(pbuf), "%m",
+ "wrong");
+ return strcmp(sbuf, pbuf);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ntp_cv_vsnprintf_percent_m=yes
+else
+ ntp_cv_vsnprintf_percent_m=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_vsnprintf_percent_m" >&5
+$as_echo "$ntp_cv_vsnprintf_percent_m" >&6; }
+ case "$ntp_cv_vsnprintf_percent_m" in
+ yes)
+
+$as_echo "#define VSNPRINTF_PERCENT_M 1" >>confdefs.h
+
+ esac
+esac
+
+for ac_header in sys/clockctl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/clockctl.h" "ac_cv_header_sys_clockctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_clockctl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_CLOCKCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+# Check whether --enable-clockctl was given.
+if test "${enable_clockctl+set}" = set; then :
+ enableval=$enable_clockctl; ntp_use_dev_clockctl=$enableval
+else
+ ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should use /dev/clockctl" >&5
+$as_echo_n "checking if we should use /dev/clockctl... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_use_dev_clockctl" >&5
+$as_echo "$ntp_use_dev_clockctl" >&6; }
+
+
+for ac_header in sys/capability.h sys/prctl.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have linux capabilities (libcap)" >&5
+$as_echo_n "checking if we have linux capabilities (libcap)... " >&6; }
+
+case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
+ yesyes)
+ case "$host" in
+ mips-sgi-irix*)
+ ntp_have_linuxcaps=no
+ ;;
+ *) ntp_have_linuxcaps=yes
+ ;;
+ esac
+ ;;
+ *)
+ ntp_have_linuxcaps=no
+ ;;
+esac
+
+# Check whether --enable-linuxcaps was given.
+if test "${enable_linuxcaps+set}" = set; then :
+ enableval=$enable_linuxcaps; ntp_have_linuxcaps=$enableval
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_linuxcaps" >&5
+$as_echo "$ntp_have_linuxcaps" >&6; }
+
+case "$ntp_have_linuxcaps" in
+ yes)
+
+$as_echo "#define HAVE_LINUX_CAPABILITIES 1" >>confdefs.h
+
+ LIBS="$LIBS -lcap"
+ ;;
+esac
+
+
+for ac_header in priv.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "priv.h" "ac_cv_header_priv_h" "$ac_includes_default"
+if test "x$ac_cv_header_priv_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PRIV_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have solaris privileges" >&5
+$as_echo_n "checking if we have solaris privileges... " >&6; }
+
+case "$ac_cv_header_priv_h" in
+ yes)
+ case "$host" in
+ *-solaris*)
+ ac_fn_c_check_func "$LINENO" "setppriv" "ac_cv_func_setppriv"
+if test "x$ac_cv_func_setppriv" = xyes; then :
+ ntp_have_solarisprivs=yes
+else
+ ntp_have_solarisprivs=no
+
+fi
+
+ ;;
+ esac
+esac
+
+# Check whether --enable-solarisprivs was given.
+if test "${enable_solarisprivs+set}" = set; then :
+ enableval=$enable_solarisprivs; ntp_have_solarisprivs=$enableval
+
+fi
+
+
+
+case "$ntp_have_solarisprivs" in
+ yes)
+
+$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_have_solarisprivs" >&5
+$as_echo "$ntp_have_solarisprivs" >&6; }
+
+case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs" in
+ *yes*)
+
+$as_echo "#define HAVE_DROPROOT 1" >>confdefs.h
+
+esac
+
+case "$host" in
+ *-*-darwin*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_init" >&5
+$as_echo_n "checking for library containing res_9_init... " >&6; }
+if ${ac_cv_search_res_9_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char res_9_init ();
+int
+main ()
+{
+return res_9_init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_res_9_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_res_9_init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_res_9_init+:} false; then :
+
+else
+ ac_cv_search_res_9_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_init" >&5
+$as_echo "$ac_cv_search_res_9_init" >&6; }
+ac_res=$ac_cv_search_res_9_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5
+$as_echo_n "checking for library containing res_init... " >&6; }
+if ${ac_cv_search_res_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char res_init ();
+int
+main ()
+{
+return res_init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_res_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_res_init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_res_init+:} false; then :
+
+else
+ ac_cv_search_res_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5
+$as_echo "$ac_cv_search_res_init" >&6; }
+ac_res=$ac_cv_search_res_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ ;;
+esac
+for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h> /* inet_ functions / structs */
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+# include <arpa/nameser.h> /* DNS HEADER struct */
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+#HMS: Why do we do this check so "early"?
+for ac_func in res_init
+do :
+ ac_fn_c_check_func "$LINENO" "res_init" "ac_cv_func_res_init"
+if test "x$ac_cv_func_res_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_RES_INIT 1
+_ACEOF
+
+else
+ for ac_func in __res_init
+do :
+ ac_fn_c_check_func "$LINENO" "__res_init" "ac_cv_func___res_init"
+if test "x$ac_cv_func___res_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE___RES_INIT 1
+_ACEOF
+
+fi
+done
+
+fi
+done
+
+
+# We also need -lsocket, but we have tested for that already.
+ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
+if test "x$ac_cv_func_inet_ntop" = xyes; then :
+
+else
+
+$as_echo "#define ISC_PLATFORM_NEEDNTOP 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
+if test "x$ac_cv_func_inet_pton" = xyes; then :
+
+else
+
+$as_echo "#define ISC_PLATFORM_NEEDPTON 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "int32" "ac_cv_type_int32" "$ac_includes_default"
+if test "x$ac_cv_type_int32" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT32 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "u_int32" "ac_cv_type_u_int32" "$ac_includes_default"
+if test "x$ac_cv_type_u_int32" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U_INT32 1
+_ACEOF
+
+
+fi
+
+
+
+
+case "$ac_cv_type_int32::$ac_cv_header_resolv_h" in
+ no::yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int32 with DNS headers included" >&5
+$as_echo_n "checking for int32 with DNS headers included... " >&6; }
+if ${ntp_cv_type_int32_with_dns+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #include <resolv.h>
+
+int
+main ()
+{
+
+ size_t cb = sizeof(int32);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_type_int32_with_dns=yes
+else
+ ntp_cv_type_int32_with_dns=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_int32_with_dns" >&5
+$as_echo "$ntp_cv_type_int32_with_dns" >&6; }
+ case "$ntp_cv_type_int32_with_dns" in
+ yes)
+
+$as_echo "#define HAVE_INT32_ONLY_WITH_DNS 1" >>confdefs.h
+
+ esac
+esac
+
+case "$ac_cv_type_u_int32::$ac_cv_header_resolv_h" in
+ no::yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int32 with DNS headers included" >&5
+$as_echo_n "checking for u_int32 with DNS headers included... " >&6; }
+if ${ntp_cv_type_u_int32_with_dns+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #include <resolv.h>
+
+int
+main ()
+{
+
+ size_t cb = sizeof(u_int32);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_type_u_int32_with_dns=yes
+else
+ ntp_cv_type_u_int32_with_dns=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_type_u_int32_with_dns" >&5
+$as_echo "$ntp_cv_type_u_int32_with_dns" >&6; }
+ case "$ntp_cv_type_u_int32_with_dns" in
+ yes)
+
+$as_echo "#define HAVE_U_INT32_ONLY_WITH_DNS 1" >>confdefs.h
+
+ esac
+esac
+
+for ac_header in sys/timepps.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/timepps.h" "ac_cv_header_sys_timepps_h" "
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+
+
+"
+if test "x$ac_cv_header_sys_timepps_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TIMEPPS_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec" >&5
+$as_echo_n "checking for struct timespec... " >&6; }
+if ${ntp_cv_struct_timespec+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+ /* Under SunOS, timespec is in sys/timepps.h,
+ which needs errno.h and FRAC */
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+ #ifdef HAVE_SYS_TIMEPPS_H
+ # define FRAC 4294967296
+ # include <sys/timepps.h>
+ #endif
+
+int
+main ()
+{
+
+ struct timespec n;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_timespec=yes
+else
+ ntp_cv_struct_timespec=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_timespec" >&5
+$as_echo "$ntp_cv_struct_timespec" >&6; }
+case "$ntp_cv_struct_timespec" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ntptimeval" >&5
+$as_echo_n "checking for struct ntptimeval... " >&6; }
+if ${ntp_cv_struct_ntptimeval+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+ #include <sys/timex.h>
+
+int
+main ()
+{
+
+ struct ntptimeval n;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_struct_ntptimeval=yes
+else
+ ntp_cv_struct_ntptimeval=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_struct_ntptimeval" >&5
+$as_echo "$ntp_cv_struct_ntptimeval" >&6; }
+case "$ntp_cv_struct_ntptimeval" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_NTPTIMEVAL 1" >>confdefs.h
+
+esac
+
+for ac_header in md5.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "md5.h" "ac_cv_header_md5_h" "
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+
+
+"
+if test "x$ac_cv_header_md5_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MD5_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing MD5Init" >&5
+$as_echo_n "checking for library containing MD5Init... " >&6; }
+if ${ac_cv_search_MD5Init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char MD5Init ();
+int
+main ()
+{
+return MD5Init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' md5 md; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_MD5Init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_MD5Init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_MD5Init+:} false; then :
+
+else
+ ac_cv_search_MD5Init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_MD5Init" >&5
+$as_echo "$ac_cv_search_MD5Init" >&6; }
+ac_res=$ac_cv_search_MD5Init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+for ac_func in MD5Init sysconf getdtablesize sigaction sigset sigvec
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGIO" >&5
+$as_echo_n "checking for SIGIO... " >&6; }
+if ${ntp_cv_hdr_def_sigio+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <signal.h>
+
+ #ifndef SIGIO
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_cv_hdr_def_sigio=yes
+else
+ ntp_cv_hdr_def_sigio=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigio" >&5
+$as_echo "$ntp_cv_hdr_def_sigio" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to use SIGIO" >&5
+$as_echo_n "checking if we want to use SIGIO... " >&6; }
+ans=no
+case "$ntp_cv_hdr_def_sigio" in
+ yes)
+ ans=yes
+ case "$host" in
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ ans=no
+ ;;
+ *-convex-*)
+ ans=no
+ ;;
+ *-dec-*)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-univel-sysv*)
+ ans=no
+ ;;
+ *-*-irix6*)
+ ans=no
+ ;;
+ *-*-freebsd*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ m68k-*-mint*)
+ ans=no
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+
+$as_echo "#define HAVE_SIGNALED_IO 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGPOLL" >&5
+$as_echo_n "checking for SIGPOLL... " >&6; }
+if ${ntp_cv_hdr_def_sigpoll+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <signal.h>
+
+ #ifndef SIGPOLL
+ # error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ntp_cv_hdr_def_sigpoll=yes
+else
+ ntp_cv_hdr_def_sigpoll=no
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_hdr_def_sigpoll" >&5
+$as_echo "$ntp_cv_hdr_def_sigpoll" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for UDP I/O" >&5
+$as_echo_n "checking if we can use SIGPOLL for UDP I/O... " >&6; }
+ans=no
+case "$ntp_cv_hdr_def_sigpoll" in
+ yes)
+ case "$host" in
+ mips-sgi-irix*)
+ ans=no
+ ;;
+ vax-dec-bsd)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-*-aix[4-9]*)
+ # XXX Only verified thru AIX6
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-osf*)
+ ans=no
+ ;;
+ *-*-qnx*)
+ ans=no
+ ;;
+ *-*-sunos*)
+ ans=no
+ ;;
+ *-*-solaris*)
+ ans=no
+ ;;
+ *-*-ultrix*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ *) ans=yes
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+
+$as_echo "#define USE_UDP_SIGPOLL 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use SIGPOLL for TTY I/O" >&5
+$as_echo_n "checking if we can use SIGPOLL for TTY I/O... " >&6; }
+ans=no
+case "$ntp_cv_hdr_def_sigpoll" in
+ yes)
+ case "$host" in
+ mips-sgi-irix*)
+ ans=no
+ ;;
+ vax-dec-bsd)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-*-aix[4-9]*)
+ # XXX Only verified thru AIX6
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-osf*)
+ ans=no
+ ;;
+ *-*-sunos*)
+ ans=no
+ ;;
+ *-*-ultrix*)
+ ans=no
+ ;;
+ *-*-qnx*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ *) ans=yes
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+
+$as_echo "#define USE_TTY_SIGPOLL 1" >>confdefs.h
+
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking number of arguments to gettimeofday()" >&5
+$as_echo_n "checking number of arguments to gettimeofday()... " >&6; }
+if ${ntp_cv_func_Xettimeofday_nargs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+
+int
+main ()
+{
+
+ gettimeofday(0, 0);
+ settimeofday(0, 0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_func_Xettimeofday_nargs=2
+else
+ ntp_cv_func_Xettimeofday_nargs=1
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_func_Xettimeofday_nargs" >&5
+$as_echo "$ntp_cv_func_Xettimeofday_nargs" >&6; }
+case "$ntp_cv_func_Xettimeofday_nargs" in
+ 1)
+
+$as_echo "#define SYSV_TIMEOFDAY 1" >>confdefs.h
+
+esac
+
+for ac_func in settimeofday
+do :
+ ac_fn_c_check_func "$LINENO" "settimeofday" "ac_cv_func_settimeofday"
+if test "x$ac_cv_func_settimeofday" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SETTIMEOFDAY 1
+_ACEOF
+
+else
+
+ case "$host" in
+ *-*-mpeix*) ac_cv_func_settimeofday=yes
+ esac
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we'll use clock_settime or settimeofday or stime" >&5
+$as_echo_n "checking if we'll use clock_settime or settimeofday or stime... " >&6; }
+ntp_warning='GRONK'
+ans=none
+case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
+ yes*)
+ ntp_warning=''
+ ans='clock_settime()'
+ ;;
+ noyes*)
+ ntp_warning='But clock_settime() would be better (if we had it)'
+ ans='settimeofday()'
+ ;;
+ nonoyes)
+ ntp_warning='Which is the worst of the three'
+ ans='stime()'
+ ;;
+ *)
+ case "$build" in
+ $host)
+ ntp_warning='Which leaves us with nothing to use!'
+ esac
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
+$as_echo "$ans" >&6; }
+case "$ntp_warning" in
+ '')
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** $ntp_warning ***" >&5
+$as_echo "$as_me: WARNING: *** $ntp_warning ***" >&2;}
+ ;;
+esac
+
+
+LDADD_LIBNTP="$LDADD_LIBNTP $LIBS"
+LIBS=$__LIBS
+{ __LIBS=; unset __LIBS;}
+
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=no
+fi
+
+
+
+
+
+
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4'
+macro_revision='1.3293'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ lt_prog_compiler_pic='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sntp will be built" >&5
+$as_echo_n "checking if sntp will be built... " >&6; }
+
+# Check whether --with-sntp was given.
+if test "${with_sntp+set}" = set; then :
+ withval=$with_sntp;
+else
+ with_sntp="${withsntp=yes}"
+
+fi
+
+case "$with_sntp" in
+ no)
+ SNTP=
+ ;;
+ *)
+ SNTP=sntp
+ ;;
+esac
+
+ if test -n "$SNTP"; then
+ BUILD_SNTP_TRUE=
+ BUILD_SNTP_FALSE='#'
+else
+ BUILD_SNTP_TRUE='#'
+ BUILD_SNTP_FALSE=
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sntp" >&5
+$as_echo "$with_sntp" >&6; }
+
+
+
+case "$SNTP" in
+ '')
+ SNTP_DB=
+ SNTP_DL=
+ SNTP_DS=
+ ;;
+esac
+
+###
+
+# NTP has (so far) been relying on leading-edge autogen.
+# Therefore, by default:
+# - use the version we ship with
+# - do not install it
+# - build a static copy (AC_DISABLE_SHARED - done earlier)
+case "${enable_local_libopts+set}" in
+ set) ;;
+ *) enable_local_libopts=yes ;;
+esac
+case "${enable_libopts_install+set}" in
+ set) ;;
+ *) enable_libopts_install=no ;;
+esac
+enable_nls=no
+
+
+ ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if eval \${$as_ac_Header+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_ac_Header=yes"
+else
+ eval "$as_ac_Header=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_ac_Header
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_opendir=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_opendir+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_opendir+:} false; then :
+
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+
+ # =================
+ # AC_CHECK_HEADERS
+ # =================
+ for ac_header in \
+ sys/mman.h sys/param.h sys/poll.h sys/procset.h \
+ sys/select.h sys/socket.h sys/stropts.h sys/time.h \
+ sys/un.h sys/wait.h dlfcn.h errno.h \
+ fcntl.h libgen.h libintl.h memory.h \
+ netinet/in.h setjmp.h stdbool.h sysexits.h \
+ unistd.h utime.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ for ac_header in stdarg.h varargs.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_arg_hdr=true;break
+else
+ lo_have_arg_hdr=false
+fi
+
+done
+
+
+ for ac_header in string.h strings.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_str_hdr=true;break
+else
+ lo_have_str_hdr=false
+fi
+
+done
+
+
+ for ac_header in limits.h sys/limits.h values.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_lim_hdr=true;break
+else
+ lo_have_lim_hdr=false
+fi
+
+done
+
+
+ for ac_header in inttypes.h stdint.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ lo_have_typ_hdr=true;break
+else
+ lo_have_typ_hdr=false
+fi
+
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdnoreturn.h" >&5
+$as_echo_n "checking for working stdnoreturn.h... " >&6; }
+if ${gl_cv_header_working_stdnoreturn_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #include <stdnoreturn.h>
+ /* Do not check for 'noreturn' after the return type.
+ C11 allows it, but it's rarely done that way
+ and circa-2012 bleeding-edge GCC rejects it when given
+ -Werror=old-style-declaration. */
+ noreturn void foo1 (void) { exit (0); }
+ _Noreturn void foo2 (void) { exit (0); }
+ int testit (int argc, char **argv) {
+ if (argc & 1)
+ return 0;
+ (argv[0][0] ? foo1 : foo2) ();
+ }
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_working_stdnoreturn_h=yes
+else
+ gl_cv_header_working_stdnoreturn_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdnoreturn_h" >&5
+$as_echo "$gl_cv_header_working_stdnoreturn_h" >&6; }
+
+ if test $gl_cv_header_working_stdnoreturn_h = yes; then
+ STDNORETURN_H=''
+ else
+ STDNORETURN_H='stdnoreturn.h'
+ fi
+
+
+ if test -n "$STDNORETURN_H"; then
+ GL_GENERATE_STDNORETURN_H_TRUE=
+ GL_GENERATE_STDNORETURN_H_FALSE='#'
+else
+ GL_GENERATE_STDNORETURN_H_TRUE='#'
+ GL_GENERATE_STDNORETURN_H_FALSE=
+fi
+
+
+
+ # ----------------------------------------------------------------------
+ # check for various programs used during the build.
+ # On OS/X, "wchar.h" needs "runetype.h" to work properly.
+ # ----------------------------------------------------------------------
+ for ac_header in runetype.h wchar.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
+ $ac_includes_default
+ #if HAVE_RUNETYPE_H
+ # include <runetype.h>
+ #endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ # Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then :
+ enableval=$enable_nls;
+fi
+
+ if test "x$enable_nls" != "xno" && \
+ test "X${ac_cv_header_libintl_h}" = Xyes; then :
+
+
+$as_echo "#define ENABLE_NLS 1" >>confdefs.h
+
+fi
+
+ # --------------------------------------------
+ # Verify certain entries from AC_CHECK_HEADERS
+ # --------------------------------------------
+ ${lo_have_arg_hdr} || \
+ as_fn_error $? "you must have stdarg.h or varargs.h on your system" "$LINENO" 5
+
+ ${lo_have_str_hdr} || \
+ as_fn_error $? "you must have string.h or strings.h on your system" "$LINENO" 5
+
+ ${lo_have_lim_hdr} || \
+ as_fn_error $? "you must have one of limits.h, sys/limits.h or values.h" "$LINENO" 5
+
+ ${lo_have_typ_hdr} || \
+ as_fn_error $? "you must have inttypes.h or stdint.h on your system" "$LINENO" 5
+
+ for f in sys_types sys_param sys_stat string errno stdlib memory setjmp
+ do eval as_ac_var=\${ac_cv_header_${f}_h}
+ test "X${as_ac_var}" = Xyes || {
+ as_fn_error $? "you must have ${f}.h on your system" "$LINENO" 5
+ }
+ done
+ test "X${ac_cv_header_inttypes_h-no}" = Xyes || \
+ echo '#include <stdint.h>' > inttypes.h
+
+ # ----------------------------------------------------------------------
+ # Checks for typedefs
+ # ----------------------------------------------------------------------
+ ac_fn_c_check_type "$LINENO" "wchar_t" "ac_cv_type_wchar_t" "$ac_includes_default"
+if test "x$ac_cv_type_wchar_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WCHAR_T 1
+_ACEOF
+
+
+fi
+
+ ac_fn_c_check_type "$LINENO" "wint_t" "ac_cv_type_wint_t" "
+ $ac_includes_default
+ #if HAVE_RUNETYPE_H
+ # include <runetype.h>
+ #endif
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+"
+if test "x$ac_cv_type_wint_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WINT_T 1
+_ACEOF
+
+
+fi
+
+ ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default"
+if test "x$ac_cv_type_int8_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT8_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint8_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT8_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default"
+if test "x$ac_cv_type_int16_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT16_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint16_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT16_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default"
+if test "x$ac_cv_type_int32_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INT32_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint32_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT32_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_intptr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTPTR_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PID_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SIZE_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char*" >&5
+$as_echo_n "checking size of char*... " >&6; }
+if ${ac_cv_sizeof_charp+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char*))" "ac_cv_sizeof_charp" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_charp" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (char*)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_charp=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_charp" >&5
+$as_echo "$ac_cv_sizeof_charp" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHARP $ac_cv_sizeof_charp
+_ACEOF
+
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+
+ # ------------
+ # AC_CHECK_LIB
+ # ------------
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pathfind in -lgen" >&5
+$as_echo_n "checking for pathfind in -lgen... " >&6; }
+if ${ac_cv_lib_gen_pathfind+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgen $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pathfind ();
+int
+main ()
+{
+return pathfind ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_gen_pathfind=yes
+else
+ ac_cv_lib_gen_pathfind=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_pathfind" >&5
+$as_echo "$ac_cv_lib_gen_pathfind" >&6; }
+if test "x$ac_cv_lib_gen_pathfind" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEN 1
+_ACEOF
+
+ LIBS="-lgen $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5
+$as_echo_n "checking for gettext in -lintl... " >&6; }
+if ${ac_cv_lib_intl_gettext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl $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 gettext ();
+int
+main ()
+{
+return gettext ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_intl_gettext=yes
+else
+ ac_cv_lib_intl_gettext=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_intl_gettext" >&5
+$as_echo "$ac_cv_lib_intl_gettext" >&6; }
+if test "x$ac_cv_lib_intl_gettext" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBINTL 1
+_ACEOF
+
+ LIBS="-lintl $LIBS"
+
+fi
+
+ for ac_func in vprintf
+do :
+ ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
+if test "x$ac_cv_func_vprintf" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VPRINTF 1
+_ACEOF
+
+ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
+if test "x$ac_cv_func__doprnt" = xyes; then :
+
+$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+
+fi
+
+fi
+done
+
+
+ for ac_header in vfork.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
+if test "x$ac_cv_header_vfork_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VFORK_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_func in fork vfork
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test "x$ac_cv_func_fork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
+$as_echo_n "checking for working fork... " >&6; }
+if ${ac_cv_func_fork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_fork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* By Ruediger Kuhlmann. */
+ return fork () < 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_fork_works=yes
+else
+ ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
+$as_echo "$ac_cv_func_fork_works" >&6; }
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
+$as_echo_n "checking for working vfork... " >&6; }
+if ${ac_cv_func_vfork_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_vfork_works=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Thanks to Paul Eggert for this test. */
+$ac_includes_default
+#include <sys/wait.h>
+#ifdef HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+ static pid_t child;
+ if (!child) {
+ child = vfork ();
+ if (child < 0) {
+ perror ("vfork");
+ _exit(2);
+ }
+ if (!child) {
+ arg = getpid();
+ write(-1, "", 0);
+ _exit (arg);
+ }
+ }
+}
+
+int
+main ()
+{
+ pid_t parent = getpid ();
+ pid_t child;
+
+ sparc_address_test (0);
+
+ child = vfork ();
+
+ if (child == 0) {
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
+ pid_t
+ p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+ p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+ /* Convince the compiler that p..p7 are live; otherwise, it might
+ use the same hardware register for all 8 local variables. */
+ if (p != p1 || p != p2 || p != p3 || p != p4
+ || p != p5 || p != p6 || p != p7)
+ _exit(1);
+
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
+ _exit(close(fileno(stdout)) != 0);
+ } else {
+ int status;
+ struct stat st;
+
+ while (wait(&status) != child)
+ ;
+ return (
+ /* Was there some problem with vforking? */
+ child < 0
+
+ /* Did the child fail? (This shouldn't happen.) */
+ || status
+
+ /* Did the vfork/compiler bug occur? */
+ || parent != getpid()
+
+ /* Did the file descriptor bug occur? */
+ || fstat(fileno(stdout), &st) != 0
+ );
+ }
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_vfork_works=yes
+else
+ ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
+$as_echo "$ac_cv_func_vfork_works" >&6; }
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=$ac_cv_func_vfork
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+$as_echo "#define vfork fork" >>confdefs.h
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+ for ac_func in mmap canonicalize_file_name snprintf strdup strchr \
+ strrchr strsignal fchmod fstat chmod
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+ while :
+ do
+ POSIX_SHELL=`which bash`
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=`which dash`
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=/usr/xpg4/bin/sh
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=`/bin/sh -c '
+ exec 2>/dev/null
+ if ! true ; then exit 1 ; fi
+ echo /bin/sh'`
+ test -x "$POSIX_SHELL" && break
+ as_fn_error $? "cannot locate a working POSIX shell" "$LINENO" 5
+ done
+
+cat >>confdefs.h <<_ACEOF
+#define POSIX_SHELL "${POSIX_SHELL}"
+_ACEOF
+
+
+
+
+
+ LIBOPTS_BUILD_BLOCKED=''
+
+
+ NEED_LIBOPTS_DIR=''
+
+ # Check whether --enable-local-libopts was given.
+if test "${enable_local_libopts+set}" = set; then :
+ enableval=$enable_local_libopts;
+ if test x$enableval = xyes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using supplied libopts tearoff" >&5
+$as_echo "$as_me: Using supplied libopts tearoff" >&6;}
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts'
+ NEED_LIBOPTS_DIR=true
+ LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la'
+ fi
+fi
+
+
+ # Check whether --enable-libopts-install was given.
+if test "${enable_libopts_install+set}" = set; then :
+ enableval=$enable_libopts_install;
+fi
+
+ if test "X${enable_libopts_install}" = Xyes; then
+ INSTALL_LIBOPTS_TRUE=
+ INSTALL_LIBOPTS_FALSE='#'
+else
+ INSTALL_LIBOPTS_TRUE='#'
+ INSTALL_LIBOPTS_FALSE=
+fi
+
+
+ if test -z "${NEED_LIBOPTS_DIR}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config can be found" >&5
+$as_echo_n "checking whether autoopts-config can be found... " >&6; }
+
+# Check whether --with-autoopts-config was given.
+if test "${with_autoopts_config+set}" = set; then :
+ withval=$with_autoopts_config; lo_cv_with_autoopts_config=${with_autoopts_config}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether autoopts-config is specified" >&5
+$as_echo_n "checking whether autoopts-config is specified... " >&6; }
+if ${lo_cv_with_autoopts_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if autoopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=autoopts-config
+ elif libopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=libopts-config
+ else lo_cv_with_autoopts_config=no ; fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lo_cv_with_autoopts_config" >&5
+$as_echo "$lo_cv_with_autoopts_config" >&6; }
+
+fi
+ # end of AC_ARG_WITH
+
+ if ${lo_cv_test_autoopts+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test -z "${lo_cv_with_autoopts_config}" \
+ -o X"${lo_cv_with_autoopts_config}" = Xno
+ then
+ if autoopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=autoopts-config
+ elif libopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=libopts-config
+ else lo_cv_with_autoopts_config=false ; fi
+ fi
+ lo_cv_test_autoopts=`
+ ${lo_cv_with_autoopts_config} --libs` 2> /dev/null
+ if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
+ then lo_cv_test_autoopts=no ; fi
+
+fi
+ # end of CACHE_VAL
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lo_cv_test_autoopts}" >&5
+$as_echo "${lo_cv_test_autoopts}" >&6; }
+
+ if test "X${lo_cv_test_autoopts}" != Xno
+ then
+ LIBOPTS_LDADD="${lo_cv_test_autoopts}"
+ LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`"
+ else
+ LIBOPTS_LDADD='$(top_builddir)/libopts/libopts.la'
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/libopts'
+ NEED_LIBOPTS_DIR=true
+ fi
+ fi # end of if test -z "${NEED_LIBOPTS_DIR}"
+ if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then
+ NEED_LIBOPTS_DIR=''
+ fi
+ if test -n "${NEED_LIBOPTS_DIR}"; then
+ NEED_LIBOPTS_TRUE=
+ NEED_LIBOPTS_FALSE='#'
+else
+ NEED_LIBOPTS_TRUE='#'
+ NEED_LIBOPTS_FALSE=
+fi
+
+
+
+ LIBOPTS_DIR=libopts
+
+
+# end of AC_DEFUN of LIBOPTS_CHECK_COMMON
+
+
+ if test -z "$NEED_LIBOPTS_TRUE"; then :
+
+
+
+ # Check to see if a reg expr header is specified.
+
+
+# Check whether --with-regex-header was given.
+if test "${with_regex_header+set}" = set; then :
+ withval=$with_regex_header; libopts_cv_with_regex_header=${with_regex_header}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a reg expr header is specified" >&5
+$as_echo_n "checking whether a reg expr header is specified... " >&6; }
+if ${libopts_cv_with_regex_header+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ libopts_cv_with_regex_header=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_regex_header" >&5
+$as_echo "$libopts_cv_with_regex_header" >&6; }
+
+fi
+ # end of AC_ARG_WITH
+ if test "X${libopts_cv_with_regex_header}" != Xno
+ then
+ cat >>confdefs.h <<_ACEOF
+#define REGEX_HEADER <${libopts_cv_with_regex_header}>
+_ACEOF
+
+ else
+
+$as_echo "#define REGEX_HEADER <regex.h>" >>confdefs.h
+
+ fi
+
+
+
+ # Check to see if a working libregex can be found.
+
+
+# Check whether --with-libregex was given.
+if test "${with_libregex+set}" = set; then :
+ withval=$with_libregex; libopts_cv_with_libregex_root=${with_libregex}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether with-libregex was specified" >&5
+$as_echo_n "checking whether with-libregex was specified... " >&6; }
+if ${libopts_cv_with_libregex_root+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ libopts_cv_with_libregex_root=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_libregex_root" >&5
+$as_echo "$libopts_cv_with_libregex_root" >&6; }
+
+fi
+ # end of AC_ARG_WITH libregex
+
+ if test "${with_libregex+set}" = set && \
+ test "X${withval}" = Xno
+ then ## disabled by request
+ libopts_cv_with_libregex_root=no
+ libopts_cv_with_libregex_cflags=no
+ libopts_cv_with_libregex_libs=no
+ else
+
+
+# Check whether --with-libregex-cflags was given.
+if test "${with_libregex_cflags+set}" = set; then :
+ withval=$with_libregex_cflags; libopts_cv_with_libregex_cflags=${with_libregex_cflags}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether with-libregex-cflags was specified" >&5
+$as_echo_n "checking whether with-libregex-cflags was specified... " >&6; }
+if ${libopts_cv_with_libregex_cflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ libopts_cv_with_libregex_cflags=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_libregex_cflags" >&5
+$as_echo "$libopts_cv_with_libregex_cflags" >&6; }
+
+fi
+ # end of AC_ARG_WITH libregex-cflags
+
+
+# Check whether --with-libregex-libs was given.
+if test "${with_libregex_libs+set}" = set; then :
+ withval=$with_libregex_libs; libopts_cv_with_libregex_libs=${with_libregex_libs}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether with-libregex-libs was specified" >&5
+$as_echo_n "checking whether with-libregex-libs was specified... " >&6; }
+if ${libopts_cv_with_libregex_libs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ libopts_cv_with_libregex_libs=no
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_with_libregex_libs" >&5
+$as_echo "$libopts_cv_with_libregex_libs" >&6; }
+
+fi
+ # end of AC_ARG_WITH libregex-libs
+
+ case "X${libopts_cv_with_libregex_cflags}" in
+ Xyes|Xno|X )
+ case "X${libopts_cv_with_libregex_root}" in
+ Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;;
+ * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;;
+ esac
+ esac
+ case "X${libopts_cv_with_libregex_libs}" in
+ Xyes|Xno|X )
+ case "X${libopts_cv_with_libregex_root}" in
+ Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;;
+ * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";;
+ esac
+ esac
+ libopts_save_CPPFLAGS="${CPPFLAGS}"
+ libopts_save_LIBS="${LIBS}"
+ case "X${libopts_cv_with_libregex_cflags}" in
+ Xyes|Xno|X )
+ libopts_cv_with_libregex_cflags="" ;;
+ * ) CPPFLAGS="${CPPFLAGS} ${libopts_cv_with_libregex_cflags}" ;;
+ esac
+ case "X${libopts_cv_with_libregex_libs}" in
+ Xyes|Xno|X )
+ libopts_cv_with_libregex_libs="" ;;
+ * )
+ LIBS="${LIBS} ${libopts_cv_with_libregex_libs}" ;;
+ esac
+ LIBREGEX_CFLAGS=""
+ LIBREGEX_LIBS=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libregex functions properly" >&5
+$as_echo_n "checking whether libregex functions properly... " >&6; }
+ if ${libopts_cv_with_libregex+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ libopts_cv_with_libregex=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include REGEX_HEADER
+static regex_t re;
+void comp_re( char const* pzPat ) {
+ int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE );
+ if (res == 0) return;
+ exit( res ); }
+int main() {
+ regmatch_t m[2];
+ comp_re( "^.*\$" );
+ comp_re( "()|no.*" );
+ comp_re( "." );
+ if (regexec( &re, "X", 2, m, 0 ) != 0) return 1;
+ if ((m[0].rm_so != 0) || (m[0].rm_eo != 1)) {
+ fputs( "error: regex -->.<-- did not match\n", stderr );
+ return 1;
+ }
+ return 0; }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ libopts_cv_with_libregex=yes
+else
+ libopts_cv_with_libregex=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+ # end of AC_RUN_IFELSE
+
+fi
+ # end of AC_CACHE_VAL for libopts_cv_with_libregex
+ fi ## disabled by request
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_with_libregex}" >&5
+$as_echo "${libopts_cv_with_libregex}" >&6; }
+ if test "X${libopts_cv_with_libregex}" != Xno
+ then
+
+$as_echo "#define WITH_LIBREGEX 1" >>confdefs.h
+
+ else
+ CPPFLAGS="${libopts_save_CPPFLAGS}"
+ LIBS="${libopts_save_LIBS}"
+ libopts_cv_with_libregex_root=no
+libopts_cv_with_libregex_cflags=no
+libopts_cv_with_libregex_libs=no
+libopts_cv_with_libregex=no
+ fi
+
+
+
+ # Check to see if pathfind(3) works.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pathfind(3) works" >&5
+$as_echo_n "checking whether pathfind(3) works... " >&6; }
+ if ${libopts_cv_run_pathfind+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ libopts_cv_run_pathfind=no
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+#include <stdlib.h>
+int main (int argc, char** argv) {
+ char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
+ return (pz == 0) ? 1 : 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ libopts_cv_run_pathfind=yes
+else
+ libopts_cv_run_pathfind=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+ # end of RUN_IFELSE
+
+fi
+ # end of AC_CACHE_VAL for libopts_cv_run_pathfind
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_pathfind}" >&5
+$as_echo "${libopts_cv_run_pathfind}" >&6; }
+ if test "X${libopts_cv_run_pathfind}" != Xno
+ then
+
+$as_echo "#define HAVE_PATHFIND 1" >>confdefs.h
+
+ fi
+
+
+
+ # Check to see if /dev/zero is readable device.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether /dev/zero is readable device" >&5
+$as_echo_n "checking whether /dev/zero is readable device... " >&6; }
+ if ${libopts_cv_test_dev_zero+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ libopts_cv_test_dev_zero=`exec 2> /dev/null
+dzero=\`ls -lL /dev/zero | egrep ^c......r\`
+test -z "${dzero}" && exit 1
+echo ${dzero}`
+ if test $? -ne 0 || test -z "$libopts_cv_test_dev_zero"
+ then libopts_cv_test_dev_zero=no
+ fi
+
+fi
+ # end of CACHE_VAL of libopts_cv_test_dev_zero
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_test_dev_zero}" >&5
+$as_echo "${libopts_cv_test_dev_zero}" >&6; }
+ if test "X${libopts_cv_test_dev_zero}" != Xno
+ then
+
+$as_echo "#define HAVE_DEV_ZERO 1" >>confdefs.h
+
+ fi
+
+
+
+ # Check to see if we have a functional realpath(3C).
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a functional realpath(3C)" >&5
+$as_echo_n "checking whether we have a functional realpath(3C)... " >&6; }
+ if ${libopts_cv_run_realpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ libopts_cv_run_realpath=no
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+#include <stdlib.h>
+int main (int argc, char** argv) {
+#ifndef PATH_MAX
+choke me!!
+#else
+ char zPath[PATH_MAX+1];
+#endif
+ char *pz = realpath(argv[0], zPath);
+ return (pz == zPath) ? 0 : 1;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ libopts_cv_run_realpath=yes
+else
+ libopts_cv_run_realpath=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+ # end of RUN_IFELSE
+
+fi
+ # end of AC_CACHE_VAL for libopts_cv_run_realpath
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_realpath}" >&5
+$as_echo "${libopts_cv_run_realpath}" >&6; }
+ if test "X${libopts_cv_run_realpath}" != Xno
+ then
+
+$as_echo "#define HAVE_REALPATH 1" >>confdefs.h
+
+ fi
+
+
+
+ # Check to see if strftime() works.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strftime() works" >&5
+$as_echo_n "checking whether strftime() works... " >&6; }
+ if ${libopts_cv_run_strftime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ libopts_cv_run_strftime=no
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+#include <string.h>
+char t_buf[ 64 ];
+int main() {
+ static char const z[] = "Thursday Aug 28 240";
+ struct tm tm;
+ tm.tm_sec = 36; /* seconds after the minute [0, 61] */
+ tm.tm_min = 44; /* minutes after the hour [0, 59] */
+ tm.tm_hour = 12; /* hour since midnight [0, 23] */
+ tm.tm_mday = 28; /* day of the month [1, 31] */
+ tm.tm_mon = 7; /* months since January [0, 11] */
+ tm.tm_year = 86; /* years since 1900 */
+ tm.tm_wday = 4; /* days since Sunday [0, 6] */
+ tm.tm_yday = 239; /* days since January 1 [0, 365] */
+ tm.tm_isdst = 1; /* flag for daylight savings time */
+ strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
+ return (strcmp( t_buf, z ) != 0); }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ libopts_cv_run_strftime=yes
+else
+ libopts_cv_run_strftime=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+ # end of RUN_IFELSE
+
+fi
+ # end of AC_CACHE_VAL for libopts_cv_run_strftime
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_strftime}" >&5
+$as_echo "${libopts_cv_run_strftime}" >&6; }
+ if test "X${libopts_cv_run_strftime}" != Xno
+ then
+
+$as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
+
+ fi
+
+
+
+ # Check to see if fopen accepts "b" mode.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen accepts \"b\" mode" >&5
+$as_echo_n "checking whether fopen accepts \"b\" mode... " >&6; }
+ if ${libopts_cv_run_fopen_binary+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ libopts_cv_run_fopen_binary=no
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int main (int argc, char** argv) {
+FILE* fp = fopen("conftest.$ac_ext", "rb");
+return (fp == NULL) ? 1 : fclose(fp); }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ libopts_cv_run_fopen_binary=yes
+else
+ libopts_cv_run_fopen_binary=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+ # end of RUN_IFELSE
+
+fi
+ # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_fopen_binary}" >&5
+$as_echo "${libopts_cv_run_fopen_binary}" >&6; }
+ if test "X${libopts_cv_run_fopen_binary}" != Xno
+ then
+
+$as_echo "#define FOPEN_BINARY_FLAG \"b\"" >>confdefs.h
+
+ else
+
+$as_echo "#define FOPEN_BINARY_FLAG \"\"" >>confdefs.h
+
+ fi
+
+
+
+ # Check to see if fopen accepts "t" mode.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen accepts \"t\" mode" >&5
+$as_echo_n "checking whether fopen accepts \"t\" mode... " >&6; }
+ if ${libopts_cv_run_fopen_text+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ libopts_cv_run_fopen_text=no
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int main (int argc, char** argv) {
+FILE* fp = fopen("conftest.$ac_ext", "rt");
+return (fp == NULL) ? 1 : fclose(fp); }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ libopts_cv_run_fopen_text=yes
+else
+ libopts_cv_run_fopen_text=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+ # end of RUN_IFELSE
+
+fi
+ # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${libopts_cv_run_fopen_text}" >&5
+$as_echo "${libopts_cv_run_fopen_text}" >&6; }
+ if test "X${libopts_cv_run_fopen_text}" != Xno
+ then
+
+$as_echo "#define FOPEN_TEXT_FLAG \"t\"" >>confdefs.h
+
+ else
+
+$as_echo "#define FOPEN_TEXT_FLAG \"\"" >>confdefs.h
+
+ fi
+
+
+
+ # Check to see if not wanting optional option args.
+
+ # Check whether --enable-optional-args was given.
+if test "${enable_optional_args+set}" = set; then :
+ enableval=$enable_optional_args; libopts_cv_enable_optional_args=${enable_optional_args}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether not wanting optional option args" >&5
+$as_echo_n "checking whether not wanting optional option args... " >&6; }
+if ${libopts_cv_enable_optional_args+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ libopts_cv_enable_optional_args=yes
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libopts_cv_enable_optional_args" >&5
+$as_echo "$libopts_cv_enable_optional_args" >&6; }
+
+fi
+ # end of AC_ARG_ENABLE
+ if test "X${libopts_cv_enable_optional_args}" = Xno
+ then
+
+$as_echo "#define NO_OPTIONAL_OPT_ARGS 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+ fi
+ ac_config_files="$ac_config_files libopts/Makefile"
+
+ # end of AC_DEFUN of LIBOPTS_CHECK
+
+
+
+
+ntp_pkgconfig_min_version='0.15.0'
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+{ ac_cv_path_PKG_CONFIG=; unset ac_cv_path_PKG_CONFIG;}
+{ ac_cv_path_ac_pt_PKG_CONFIG=; unset ac_cv_path_ac_pt_PKG_CONFIG;}
+
+case "$PKG_CONFIG" in
+ /*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5
+$as_echo_n "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+ ;;
+esac
+
+
+
+
+# Check whether --enable-local-libevent was given.
+if test "${enable_local_libevent+set}" = set; then :
+ enableval=$enable_local_libevent; ntp_use_local_libevent=$enableval
+else
+ ntp_use_local_libevent=${ntp_use_local_libevent-detect}
+
+fi
+
+
+
+
+
+
+ if test -z "$BUILD_SNTP_TRUE"; then :
+
+
+
+
+
+ntp_libevent_min_version=2.0.9
+ntp_libevent_tearoff=libevent
+
+
+
+
+case "$ntp_use_local_libevent" in
+ yes)
+ ;;
+ *) # If we have (a good enough) pkg-config, see if it can find libevent
+ case "$PKG_CONFIG" in
+ /*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libevent $ntp_libevent_min_version or later is installed" >&5
+$as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed... " >&6; }
+ if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent
+ then
+ 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;}
+ 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.
+ # While we could grab only the -L stuff, there *might* be
+ # other flags there we want. Originally we just removed -levent
+ # but then somebody decided to install -levent-2.0
+ # LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
+ # So now we dance...
+ LDADD_LIBEVENT=
+ for i in `$PKG_CONFIG --libs libevent`
+ do
+ case "$i" in
+ -levent*) ;;
+ *) case "$LDADD_LIBEVENT" in
+ '') LDADD_LIBEVENT="$i" ;;
+ *) LDADD_LIBEVENT="$LDADD_LIBEVENT $i" ;;
+ esac
+ ;;
+ esac
+ done
+ case "$LIBISC_PTHREADS_NOTHREADS" in
+ pthreads)
+ LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads"
+ esac
+ LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ ntp_use_local_libevent=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ ntp_use_local_libevent=yes
+ ;;
+ esac
+ ;;
+esac
+
+case "$ntp_use_local_libevent" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using libevent tearoff" >&5
+$as_echo "$as_me: Using libevent tearoff" >&6;}
+ CPPFLAGS_LIBEVENT="-I\$(top_builddir)/$ntp_libevent_tearoff/include -I\$(top_srcdir)/$ntp_libevent_tearoff/include"
+ case "$LIBISC_PTHREADS_NOTHREADS" in
+ pthreads)
+ LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_pthreads.la \$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+ ;;
+ *)
+ LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+ esac
+esac
+
+ if test "x$ntp_use_local_libevent" = "xyes"; then
+ BUILD_LIBEVENT_TRUE=
+ BUILD_LIBEVENT_FALSE='#'
+else
+ BUILD_LIBEVENT_TRUE='#'
+ BUILD_LIBEVENT_FALSE=
+fi
+
+
+
+
+case "$ntp_libevent_tearoff" in
+ libevent)
+ ;;
+ *)
+ as_fn_error $? "ntp_libevent.m4 dir must be libevent, not $ntp_libevent_tearoff" "$LINENO" 5
+ ;;
+esac
+
+case "$ntp_use_local_libevent" in
+ yes)
+ ac_configure_args=" --disable-openssl${ac_configure_args}"
+ ac_configure_args=" --disable-shared${ac_configure_args}"
+ ac_configure_args=" --disable-libevent-regress${ac_configure_args}"
+ ac_configure_args=" --disable-libevent-install${ac_configure_args}"
+ ac_configure_args=" --enable-silent-rules${ac_configure_args}"
+ ac_configure_args=" --enable-function-sections${ac_configure_args}"
+ subdirs="$subdirs libevent"
+
+ ;;
+ *)
+ NTP_FORCE_LIBEVENT_DIST=libevent
+ ;;
+esac
+
+
+
+ else
+
+
+ntp_libevent_min_version=2.0.9
+ntp_libevent_tearoff=libevent
+
+
+
+
+case "$ntp_use_local_libevent" in
+ yes)
+ ;;
+ *) # If we have (a good enough) pkg-config, see if it can find libevent
+ case "$PKG_CONFIG" in
+ /*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libevent $ntp_libevent_min_version or later is installed" >&5
+$as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed... " >&6; }
+ if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent
+ then
+ 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;}
+ 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.
+ # While we could grab only the -L stuff, there *might* be
+ # other flags there we want. Originally we just removed -levent
+ # but then somebody decided to install -levent-2.0
+ # LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
+ # So now we dance...
+ LDADD_LIBEVENT=
+ for i in `$PKG_CONFIG --libs libevent`
+ do
+ case "$i" in
+ -levent*) ;;
+ *) case "$LDADD_LIBEVENT" in
+ '') LDADD_LIBEVENT="$i" ;;
+ *) LDADD_LIBEVENT="$LDADD_LIBEVENT $i" ;;
+ esac
+ ;;
+ esac
+ done
+ case "$LIBISC_PTHREADS_NOTHREADS" in
+ pthreads)
+ LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads"
+ esac
+ LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ ntp_use_local_libevent=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ ntp_use_local_libevent=yes
+ ;;
+ esac
+ ;;
+esac
+
+case "$ntp_use_local_libevent" in
+ yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using libevent tearoff" >&5
+$as_echo "$as_me: Using libevent tearoff" >&6;}
+ CPPFLAGS_LIBEVENT="-I\$(top_builddir)/$ntp_libevent_tearoff/include -I\$(top_srcdir)/$ntp_libevent_tearoff/include"
+ case "$LIBISC_PTHREADS_NOTHREADS" in
+ pthreads)
+ LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_pthreads.la \$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+ ;;
+ *)
+ LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+ esac
+esac
+
+ if test "x$ntp_use_local_libevent" = "xyes"; then
+ BUILD_LIBEVENT_TRUE=
+ BUILD_LIBEVENT_FALSE='#'
+else
+ BUILD_LIBEVENT_TRUE='#'
+ BUILD_LIBEVENT_FALSE=
+fi
+
+
+
+
+ fi
+
+# Checks for libraries.
+
+
+LIB_SYSLOG=''
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing openlog" >&5
+$as_echo_n "checking for library containing openlog... " >&6; }
+if ${ac_cv_search_openlog+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char openlog ();
+int
+main ()
+{
+return openlog ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' gen syslog; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_openlog=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_openlog+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_openlog+:} false; then :
+
+else
+ ac_cv_search_openlog=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_openlog" >&5
+$as_echo "$ac_cv_search_openlog" >&6; }
+ac_res=$ac_cv_search_openlog
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ case "$ac_cv_search_openlog" in
+ 'none required') ;;
+ no) ;;
+ *) LIB_SYSLOG="$ac_cv_search_openlog $LIB_SYSLOG" ;;
+ esac
+
+fi
+
+
+# Checks for header files.
+for ac_header in netdb.h string.h strings.h syslog.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in sysexits.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default"
+if test "x$ac_cv_header_sysexits_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYSEXITS_H 1
+_ACEOF
+
+else
+
+
+$as_echo "#define EX_OK 0" >>confdefs.h
+
+
+$as_echo "#define EX_SOFTWARE 70" >>confdefs.h
+
+
+fi
+
+done
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for facilitynames in syslog.h" >&5
+$as_echo_n "checking for facilitynames in syslog.h... " >&6; }
+if ${ac_cv_HAVE_SYSLOG_FACILITYNAMES+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define SYSLOG_NAMES
+#include <stdlib.h>
+#include <syslog.h>
+
+int
+main ()
+{
+ void *fnames; fnames = facilitynames;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes
+else
+ ac_cv_HAVE_SYSLOG_FACILITYNAMES=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&5
+$as_echo "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" >&6; }
+case "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" in
+ yes)
+
+$as_echo "#define HAVE_SYSLOG_FACILITYNAMES 1" >>confdefs.h
+
+ ;;
+ no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No facilitynames in <syslog.h>" >&5
+$as_echo "$as_me: WARNING: No facilitynames in <syslog.h>" >&2;}
+ ;;
+ cross)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: facilitynames in <syslog.h> - cross-compiling" >&5
+$as_echo "$as_me: WARNING: facilitynames in <syslog.h> - cross-compiling" >&2;}
+ ;;
+esac
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdbool.h>
+#ifndef bool
+ "error: bool is not defined"
+#endif
+#ifndef false
+ "error: false is not defined"
+#endif
+#if false
+ "error: false is not 0"
+#endif
+#ifndef true
+ "error: true is not defined"
+#endif
+#if true != 1
+ "error: true is not 1"
+#endif
+#ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+#endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main ()
+{
+
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdbool_h=yes
+else
+ ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+
+
+
+
+VER_SUFFIX=
+
+
+
+
+# Check whether --with-crypto was given.
+if test "${with_crypto+set}" = set; then :
+ withval=$with_crypto;
+fi
+
+
+# Check whether --with-openssl-libdir was given.
+if test "${with_openssl_libdir+set}" = set; then :
+ withval=$with_openssl_libdir;
+fi
+
+
+# Check whether --with-openssl-incdir was given.
+if test "${with_openssl_incdir+set}" = set; then :
+ withval=$with_openssl_incdir;
+fi
+
+
+# Check whether --with-rpath was given.
+if test "${with_rpath+set}" = set; then :
+ withval=$with_rpath;
+fi
+
+ntp_openssl=no
+ntp_openssl_from_pkg_config=no
+with_crypto=${with_crypto:-openssl,libcrypto}
+case "$with_crypto" in
+ yes)
+ with_crypto=openssl,libcrypto
+esac
+case "$with_crypto:${PKG_CONFIG:+notempty}:${with_openssl_libdir-notgiven}:${with_openssl_incdir-notgiven}" in
+ no:*) ;;
+ *:notempty:notgiven:notgiven)
+ for pkg in `echo $with_crypto | sed -e 's/,/ /'`; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config for $pkg" >&5
+$as_echo_n "checking pkg-config for $pkg... " >&6; }
+ if $PKG_CONFIG --exists $pkg ; then
+ CPPFLAGS_NTP="$CPPFLAGS_NTP `$PKG_CONFIG --cflags-only-I $pkg`"
+ CFLAGS_NTP="$CFLAGS_NTP `$PKG_CONFIG --cflags-only-other $pkg`"
+ LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-L $pkg`"
+ LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-l $pkg`"
+ LDFLAGS_NTP="$LDFLAGS_NTP `$PKG_CONFIG --libs-only-other $pkg`"
+ VER_SUFFIX=o
+ ntp_openssl=yes
+ ntp_openssl_from_pkg_config=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ break
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ done
+esac
+case "$with_crypto:$ntp_openssl" in
+ no:*) ;;
+ *:no)
+ need_dash_r=
+ need_dash_Wlrpath=
+ case "${with_rpath-notgiven}" in
+ yes)
+ # Lame - what to do if we need -Wl... but not -R?
+ need_dash_r=1
+ ;;
+ notgiven)
+ case "$host" in
+ *-*-linux*)
+ # This may really only be true for gcc
+ need_dash_Wlrpath=1
+ ;;
+ *-*-netbsd*)
+ need_dash_r=1
+ ;;
+ *-*-solaris*)
+ need_dash_r=1
+ ;;
+ esac
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl library directory" >&5
+$as_echo_n "checking for openssl library directory... " >&6; }
+ with_openssl_libdir=${with_openssl_libdir-notgiven}
+ case "$with_openssl_libdir" in
+ notgiven)
+ case "$build" in
+ $host)
+ with_openssl_libdir=default
+ ;;
+ *)
+ with_openssl_libdir=no
+ ;;
+ esac
+ esac
+ case "$with_openssl_libdir" in
+ default)
+ # Look in:
+ with_openssl_libdir="/usr/lib /usr/lib/openssl /usr/sfw/lib"
+ with_openssl_libdir="$with_openssl_libdir /usr/local/lib"
+ with_openssl_libdir="$with_openssl_libdir /usr/local/ssl/lib /lib"
+ esac
+ case "$with_openssl_libdir" in
+ no)
+ ;;
+ *) # Look for libcrypto.a and libssl.a:
+ for i in $with_openssl_libdir no
+ do
+ case "$host" in
+ *-*-darwin*)
+ test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
+ ;;
+ *)
+ test -f $i/libcrypto.so -a -f $i/libssl.so && break
+ test -f $i/libcrypto.a -a -f $i/libssl.a && break
+ ;;
+ esac
+ done
+ openssl_libdir=$i
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_libdir" >&5
+$as_echo "$openssl_libdir" >&6; }
+ case "$openssl_libdir" in
+ no)
+ openssl_libdir=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&5
+$as_echo "$as_me: WARNING: libcrypto and libssl not found in any of $with_openssl_libdir" >&2;}
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl include directory" >&5
+$as_echo_n "checking for openssl include directory... " >&6; }
+ with_openssl_incdir=${with_openssl_incdir-notgiven}
+ case "$with_openssl_incdir" in
+ notgiven)
+ # Look in:
+ with_openssl_incdir="/usr/include /usr/sfw/include"
+ with_openssl_incdir="$with_openssl_incdir /usr/local/include"
+ with_openssl_incdir="$with_openssl_incdir /usr/local/ssl/include"
+ esac
+ case "$with_openssl_incdir" in
+ no)
+ ;;
+ *) # look for openssl/evp.h:
+ for i in $with_openssl_incdir no
+ do
+ test -f $i/openssl/evp.h && break
+ done
+ openssl_incdir=$i
+ ;;
+ esac
+ { i=; unset i;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $openssl_incdir" >&5
+$as_echo "$openssl_incdir" >&6; }
+ case "$openssl_incdir" in
+ no)
+ openssl_incdir=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&5
+$as_echo "$as_me: WARNING: did not find openssl/evp.h in any of $with_openssl_incdir" >&2;}
+ esac
+ if test -z "$openssl_libdir" -o -z "$openssl_incdir"
+ then
+ ntp_openssl=no
+ else
+ ntp_openssl=yes
+ VER_SUFFIX=o
+ fi
+ case "$ntp_openssl" in
+ yes)
+ # We have OpenSSL inc/lib dirs - use them.
+ case "$openssl_incdir" in
+ /usr/include)
+ ;;
+ *)
+ CPPFLAGS_NTP="$CPPFLAGS_NTP -I$openssl_incdir"
+ ;;
+ esac
+ case "$openssl_libdir" in
+ /usr/lib)
+ ;;
+ *)
+ LDADD_NTP="$LDADD_NTP -L$openssl_libdir"
+ case "$need_dash_r" in
+ 1)
+ LDFLAGS_NTP="$LDFLAGS_NTP -R$openssl_libdir"
+ esac
+ case "$need_dash_Wlrpath" in
+ 1)
+ LDFLAGS_NTP="$LDFLAGS_NTP -Wl,-rpath,$openssl_libdir"
+ esac
+ ;;
+ esac
+ LDADD_NTP="$LDADD_NTP -lcrypto"
+ esac
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we will use crypto" >&5
+$as_echo_n "checking if we will use crypto... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_openssl" >&5
+$as_echo "$ntp_openssl" >&6; }
+
+case "$ntp_openssl" in
+ yes)
+
+$as_echo "#define OPENSSL /**/" >>confdefs.h
+
+ case "$VER_SUFFIX" in
+ *o*) ;;
+ *) as_fn_error $? "OPENSSL set but no 'o' in VER_SUFFIX!" "$LINENO" 5 ;;
+ esac
+ ;;
+esac
+
+NTPO_SAVED_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $CPPFLAGS_NTP"
+NTPO_SAVED_LIBS="$LIBS"
+
+#
+# check for linking with -lcrypto failure, and try -lcrypto -lz.
+# Helps m68k-atari-mint
+#
+case "$ntp_openssl:$ntp_openssl_from_pkg_config" in
+ yes:no)
+ LIBS="$NTPO_SAVED_LIBS $LDADD_NTP"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto alone works" >&5
+$as_echo_n "checking if linking with -lcrypto alone works... " >&6; }
+if ${ntp_cv_bare_lcrypto+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+
+int
+main ()
+{
+
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_cv_bare_lcrypto=yes
+else
+ ntp_cv_bare_lcrypto=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_bare_lcrypto" >&5
+$as_echo "$ntp_cv_bare_lcrypto" >&6; }
+ case "$ntp_cv_bare_lcrypto" in
+ no)
+ LIBS="$NTPO_SAVED_LIBS $LDADD_NTP -lz"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linking with -lcrypto -lz works" >&5
+$as_echo_n "checking if linking with -lcrypto -lz works... " >&6; }
+if ${ntp_cv_lcrypto_lz+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+
+int
+main ()
+{
+
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ntp_cv_lcrypto_lz=yes
+else
+ ntp_cv_lcrypto_lz=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_lcrypto_lz" >&5
+$as_echo "$ntp_cv_lcrypto_lz" >&6; }
+ case "$ntp_cv_lcrypto_lz" in
+ yes)
+ LDADD_NTP="$LDADD_NTP -lz"
+ esac
+ esac
+esac
+
+#
+# Older OpenSSL headers have a number of callback prototypes inside
+# other function prototypes which trigger copious warnings with gcc's
+# -Wstrict-prototypes, which is included in -Wall.
+#
+# An example:
+#
+# int i2d_RSA_NET(const RSA *a, unsigned char **pp,
+# int (*cb)(), int sgckey);
+# ^^^^^^^^^^^
+#
+#
+#
+openssl_triggers_warnings=unknown
+NTPO_SAVED_CFLAGS="$CFLAGS"
+
+case "$ntp_openssl:$GCC" in
+ yes:yes)
+ CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+
+ /* see if -Werror breaks gcc */
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gcc_handles_Werror=yes
+else
+ gcc_handles_Werror=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ case "$gcc_handles_Werror" in
+ no)
+ # if this gcc doesn't do -Werror go ahead and use
+ # -Wstrict-prototypes.
+ openssl_triggers_warnings=yes
+ ;;
+ yes)
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include "openssl/asn1_mac.h"
+ #include "openssl/bn.h"
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+ #include "openssl/pem.h"
+ #include "openssl/rand.h"
+ #include "openssl/x509v3.h"
+
+int
+main ()
+{
+
+ /* empty body */
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ openssl_triggers_warnings=no
+else
+ openssl_triggers_warnings=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ esac
+ case "$openssl_triggers_warnings" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Wno-strict-prototypes"
+ ;;
+ *)
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes"
+ esac
+ ;;
+ no:yes)
+ # gcc without OpenSSL
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes"
+esac
+
+CFLAGS="$NTPO_SAVED_CFLAGS"
+CPPFLAGS="$NTPO_SAVED_CPPFLAGS"
+LIBS="$NTPO_SAVED_LIBS"
+{ NTPO_SAVED_CFLAGS=; unset NTPO_SAVED_CFLAGS;}
+{ NTPO_SAVED_CPPFLAGS=; unset NTPO_SAVED_CPPFLAGS;}
+{ NTPO_SAVED_LIBS=; unset NTPO_SAVED_LIBS;}
+{ openssl_triggers_warnings=; unset openssl_triggers_warnings;}
+{ ntp_openssl_from_pkg_config=; unset ntp_openssl_from_pkg_config;}
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
+$as_echo_n "checking for struct sockaddr_storage... " >&6; }
+if ${ntp_cv_sockaddr_storage+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+
+int
+main ()
+{
+
+ struct sockaddr_storage n;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_sockaddr_storage=yes
+else
+ ntp_cv_sockaddr_storage=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_sockaddr_storage" >&5
+$as_echo "$ntp_cv_sockaddr_storage" >&6; }
+case "$ntp_cv_sockaddr_storage" in
+ yes)
+
+$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage.__ss_family" >&5
+$as_echo_n "checking for sockaddr_storage.__ss_family... " >&6; }
+if ${ntp_cv_have___ss_family+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+
+int
+main ()
+{
+
+ struct sockaddr_storage s;
+ s.__ss_family = 1;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_have___ss_family=yes
+else
+ ntp_cv_have___ss_family=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_have___ss_family" >&5
+$as_echo "$ntp_cv_have___ss_family" >&6; }
+ case "$ntp_cv_have___ss_family" in
+ yes)
+
+$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h
+
+ esac
+
+esac
+
+
+#
+# Look for in_port_t.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5
+$as_echo_n "checking for in_port_t... " >&6; }
+if ${isc_cv_have_in_port_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <netinet/in.h>
+
+int
+main ()
+{
+
+ in_port_t port = 25;
+ return (0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_have_in_port_t=yes
+else
+ isc_cv_have_in_port_t=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in_port_t" >&5
+$as_echo "$isc_cv_have_in_port_t" >&6; }
+case "$isc_cv_have_in_port_t" in
+ no)
+
+$as_echo "#define ISC_PLATFORM_NEEDPORTT 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of socklen arg for getsockname()" >&5
+$as_echo_n "checking type of socklen arg for getsockname()... " >&6; }
+if ${ntp_cv_getsockname_socklen_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ getsockname_socklen_type_found=no
+ for getsockname_arg2 in 'struct sockaddr *' 'void *'; do
+ for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+
+int
+main ()
+{
+
+ extern
+ getsockname(int, $getsockname_arg2,
+ $ntp_cv_getsockname_socklen_type *);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ getsockname_socklen_type_found=yes ; break 2
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ done
+ case "$getsockname_socklen_type_found" in
+ no)
+ ntp_cv_getsockname_socklen_type='socklen_t'
+ esac
+ { getsockname_arg2=; unset getsockname_arg2;}
+ { getsockname_socklen_type_found=; unset getsockname_socklen_type_found;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_getsockname_socklen_type" >&5
+$as_echo "$ntp_cv_getsockname_socklen_type" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define GETSOCKNAME_SOCKLEN_TYPE $ntp_cv_getsockname_socklen_type
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr for sa_len" >&5
+$as_echo_n "checking struct sockaddr for sa_len... " >&6; }
+if ${isc_cv_platform_havesalen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+int
+main ()
+{
+
+ extern struct sockaddr *ps;
+ return ps->sa_len;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_platform_havesalen=yes
+else
+ isc_cv_platform_havesalen=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_platform_havesalen" >&5
+$as_echo "$isc_cv_platform_havesalen" >&6; }
+case "$isc_cv_platform_havesalen" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVESALEN 1" >>confdefs.h
+
+esac
+
+# Check whether --enable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then :
+ enableval=$enable_ipv6;
+fi
+
+
+case "$enable_ipv6" in
+ yes|''|autodetect)
+ case "$host" in
+ powerpc-ibm-aix4*)
+ ;;
+ *)
+
+$as_echo "#define WANT_IPV6 1" >>confdefs.h
+
+ ;;
+ esac
+ ;;
+ no)
+ ;;
+esac
+
+
+case "$host" in
+ *-*-darwin*)
+
+$as_echo "#define __APPLE_USE_RFC_3542 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 structures" >&5
+$as_echo_n "checking for IPv6 structures... " >&6; }
+if ${isc_cv_found_ipv6+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+
+int
+main ()
+{
+
+ struct sockaddr_in6 sin6;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_found_ipv6=yes
+else
+ isc_cv_found_ipv6=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_found_ipv6" >&5
+$as_echo "$isc_cv_found_ipv6" >&6; }
+
+#
+# See whether IPv6 support is provided via a Kame add-on.
+# This is done before other IPv6 linking tests so LIBS is properly set.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kame IPv6 support" >&5
+$as_echo_n "checking for Kame IPv6 support... " >&6; }
+
+# Check whether --with-kame was given.
+if test "${with_kame+set}" = set; then :
+ withval=$with_kame; use_kame="$withval"
+else
+ use_kame="no"
+
+fi
+
+case "$use_kame" in
+ no)
+ ;;
+ yes)
+ kame_path=/usr/local/v6
+ ;;
+ *)
+ kame_path="$use_kame"
+ ;;
+esac
+case "$use_kame" in
+ no)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ *)
+ if test -f $kame_path/lib/libinet6.a; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kame_path/lib/libinet6.a" >&5
+$as_echo "$kame_path/lib/libinet6.a" >&6; }
+ LIBS="-L$kame_path/lib -linet6 $LIBS"
+ else
+ as_fn_error $? "$kame_path/lib/libinet6.a not found.
+
+Please choose the proper path with the following command:
+
+ configure --with-kame=PATH
+" "$LINENO" 5
+ fi
+ ;;
+esac
+
+#
+# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
+# Including it on Kame-using platforms is very bad, though, because
+# Kame uses #error against direct inclusion. So include it on only
+# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
+# This is done before the in6_pktinfo check because that's what
+# netinet6/in6.h is needed for.
+#
+case "$host" in
+ *-bsdi4.[01]*)
+
+$as_echo "#define ISC_PLATFORM_NEEDNETINET6IN6H 1" >>confdefs.h
+
+ isc_netinet6in6_hack="#include <netinet6/in6.h>"
+ ;;
+ *)
+ isc_netinet6in6_hack=""
+ ;;
+esac
+
+#
+# This is similar to the netinet6/in6.h issue.
+#
+case "$host" in
+ *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+
+$as_echo "#define ISC_PLATFORM_FIXIN6ISADDR 1" >>confdefs.h
+
+ isc_netinetin6_hack="#include <netinet/in6.h>"
+ ;;
+ *)
+ isc_netinetin6_hack=""
+ ;;
+esac
+
+
+case "$isc_cv_found_ipv6" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIPV6 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5
+$as_echo_n "checking for in6_pktinfo... " >&6; }
+if ${isc_cv_have_in6_pktinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+
+int
+main ()
+{
+
+ struct in6_pktinfo xyzzy;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_have_in6_pktinfo=yes
+else
+ isc_cv_have_in6_pktinfo=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_in6_pktinfo" >&5
+$as_echo "$isc_cv_have_in6_pktinfo" >&6; }
+ case "$isc_cv_have_in6_pktinfo" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIN6PKTINFO 1" >>confdefs.h
+
+ esac
+
+
+ # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_in6.sin6_scope_id" >&5
+$as_echo_n "checking for sockaddr_in6.sin6_scope_id... " >&6; }
+if ${isc_cv_have_sin6_scope_id+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+
+int
+main ()
+{
+
+ struct sockaddr_in6 xyzzy;
+ xyzzy.sin6_scope_id = 0;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_have_sin6_scope_id=yes
+else
+ isc_cv_have_sin6_scope_id=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_have_sin6_scope_id" >&5
+$as_echo "$isc_cv_have_sin6_scope_id" >&6; }
+
+ case "$isc_cv_have_sin6_scope_id" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVESCOPEID 1" >>confdefs.h
+
+ esac
+esac
+
+
+# We need this check run even without isc_cv_found_ipv6=yes
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5
+$as_echo_n "checking for in6addr_any... " >&6; }
+if ${isc_cv_in6addr_any_links+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ SAVED_LIBS="$LIBS"
+ LIBS="$LDADD_LIBNTP $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+
+int
+main ()
+{
+
+ printf("%x", in6addr_any.s6_addr[15]);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ isc_cv_in6addr_any_links=yes
+else
+ isc_cv_in6addr_any_links=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$SAVED_LIBS"
+ { SAVED_LIBS=; unset SAVED_LIBS;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_in6addr_any_links" >&5
+$as_echo "$isc_cv_in6addr_any_links" >&6; }
+
+case "$isc_cv_in6addr_any_links" in
+ no)
+
+$as_echo "#define ISC_PLATFORM_NEEDIN6ADDRANY 1" >>confdefs.h
+
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrconf" >&5
+$as_echo_n "checking for struct if_laddrconf... " >&6; }
+if ${isc_cv_struct_if_laddrconf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <net/if6.h>
+
+int
+main ()
+{
+
+ struct if_laddrconf a;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_struct_if_laddrconf=yes
+else
+ isc_cv_struct_if_laddrconf=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrconf" >&5
+$as_echo "$isc_cv_struct_if_laddrconf" >&6; }
+
+case "$isc_cv_struct_if_laddrconf" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRCONF 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrreq" >&5
+$as_echo_n "checking for struct if_laddrreq... " >&6; }
+if ${isc_cv_struct_if_laddrreq+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <net/if6.h>
+
+int
+main ()
+{
+
+ struct if_laddrreq a;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ isc_cv_struct_if_laddrreq=yes
+else
+ isc_cv_struct_if_laddrreq=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $isc_cv_struct_if_laddrreq" >&5
+$as_echo "$isc_cv_struct_if_laddrreq" >&6; }
+
+case "$isc_cv_struct_if_laddrreq" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIF_LADDRREQ 1" >>confdefs.h
+
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multicast IP support" >&5
+$as_echo_n "checking for multicast IP support... " >&6; }
+if ${ntp_cv_multicast+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ntp_cv_multicast=no
+ case "$host" in
+ i386-sequent-sysv4)
+ ;;
+ *)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+
+int
+main ()
+{
+
+ struct ip_mreq ipmr;
+ ipmr.imr_interface.s_addr = 0;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ntp_cv_multicast=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_multicast" >&5
+$as_echo "$ntp_cv_multicast" >&6; }
+case "$ntp_cv_multicast" in
+ yes)
+
+$as_echo "#define MCAST 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking arg type needed for setsockopt() IP*_MULTICAST_LOOP" >&5
+$as_echo_n "checking arg type needed for setsockopt() IP*_MULTICAST_LOOP... " >&6; }
+if ${ntp_cv_typeof_ip_multicast_loop+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host" in
+ *-*-netbsd*|*-*-*linux*)
+ ntp_cv_typeof_ip_multicast_loop=u_int
+ ;;
+ *)
+ ntp_cv_typeof_ip_multicast_loop=u_char
+ ;;
+ esac
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_typeof_ip_multicast_loop" >&5
+$as_echo "$ntp_cv_typeof_ip_multicast_loop" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define TYPEOF_IP_MULTICAST_LOOP $ntp_cv_typeof_ip_multicast_loop
+_ACEOF
+
+esac
+
+# Check whether --enable-getifaddrs was given.
+if test "${enable_getifaddrs+set}" = set; then :
+ enableval=$enable_getifaddrs; want_getifaddrs="$enableval"
+else
+ want_getifaddrs="yes"
+
+fi
+
+
+case $want_getifaddrs in
+ glibc)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-getifaddrs=glibc is no longer required" >&5
+$as_echo "$as_me: WARNING: --enable-getifaddrs=glibc is no longer required" >&2;}
+esac
+case $want_getifaddrs in
+ no)
+ ;;
+ *)
+ SAVED_LIBS="$LIBS"
+ LIBS="$LDADD_LIBNTP $LIBS"
+ for ac_func in getifaddrs
+do :
+ ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs"
+if test "x$ac_cv_func_getifaddrs" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETIFADDRS 1
+_ACEOF
+
+fi
+done
+
+ LIBS="$SAVED_LIBS"
+ { SAVED_LIBS=; unset SAVED_LIBS;}
+ ;;
+esac
+
+#
+# Check for if_nametoindex() for IPv6 scoped addresses support
+#
+case "$host" in
+ *-hp-hpux*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing if_nametoindex" >&5
+$as_echo_n "checking for library containing if_nametoindex... " >&6; }
+if ${ac_cv_search_if_nametoindex+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char if_nametoindex ();
+int
+main ()
+{
+return if_nametoindex ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' ipv6; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_if_nametoindex=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_if_nametoindex+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_if_nametoindex+:} false; then :
+
+else
+ ac_cv_search_if_nametoindex=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_if_nametoindex" >&5
+$as_echo "$ac_cv_search_if_nametoindex" >&6; }
+ac_res=$ac_cv_search_if_nametoindex
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+esac
+SAVED_LIBS="$LIBS"
+LIBS="$LDADD_LIBNTP $LIBS"
+for ac_func in if_nametoindex
+do :
+ ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
+if test "x$ac_cv_func_if_nametoindex" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_IF_NAMETOINDEX 1
+_ACEOF
+
+fi
+done
+
+LIBS="$SAVED_LIBS"
+{ SAVED_LIBS=; unset SAVED_LIBS;}
+case "$ac_cv_func_if_nametoindex" in
+ yes)
+
+$as_echo "#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1" >>confdefs.h
+
+esac
+
+
+
+###
+
+# Hacks
+# these need work if we're to move libntp under sntp
+
+$as_echo "#define HAVE_NO_NICE 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_TERMIOS 1" >>confdefs.h
+
+
+# Checks for library functions.
+for ac_func in socket
+do :
+ ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
+if test "x$ac_cv_func_socket" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKET 1
+_ACEOF
+
+fi
+done
+
+
+# HMS: if we don't find c++ we should not look for gtest.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+else
+ CXXFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+
+
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+ _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+ # save warnings/boilerplate of simple test code
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ compiler_CXX=$CC
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+ else
+ lt_prog_compiler_no_builtin_flag_CXX=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ ld_shlibs_CXX=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ file_list_spec_CXX='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec_CXX='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ fi
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX=' '
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=yes
+ file_list_spec_CXX='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+ enable_shared_with_static_runtimes_CXX=yes
+ # Don't use ranlib
+ old_postinstall_cmds_CXX='chmod 644 $oldlib'
+ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec_CXX=''
+ fi
+ link_all_deplibs_CXX=yes
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+
+ else
+ ld_shlibs_CXX=no
+ fi
+
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs_CXX=yes
+ ;;
+
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ inherit_rpath_CXX=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+ prelink_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ old_archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_CXX=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ ld_shlibs_CXX=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ hardcode_direct_absolute_CXX=yes
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ ;;
+ esac
+
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+ '"$old_archive_cmds_CXX"
+ reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+ '"$reload_cmds_CXX"
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+ test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+ GCC_CXX="$GXX"
+ LD_CXX="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ ;;
+ esac
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc_CXX=no
+ else
+ lt_cv_archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+ archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+ test -n "$runpath_var_CXX" ||
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+ test "$inherit_rpath_CXX" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_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
+
+
+
+gta=false
+
+# Check whether --with-gtest was given.
+if test "${with_gtest+set}" = set; then :
+ withval=$with_gtest; try_gtest=$withval
+else
+ try_gtest=yes
+
+fi
+
+case "$try_gtest" in
+ yes)
+ # Extract the first word of "gtest-config", so it can be a program name with args.
+set dummy gtest-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GTEST_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GTEST_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GTEST_CONFIG="$GTEST_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_GTEST_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GTEST_CONFIG=$ac_cv_path_GTEST_CONFIG
+if test -n "$GTEST_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTEST_CONFIG" >&5
+$as_echo "$GTEST_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ { ac_cv_path_GTEST_CONFIG=; unset ac_cv_path_GTEST_CONFIG;}
+ case x${GTEST_CONFIG} in
+ x) ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking gtest version" >&5
+$as_echo_n "checking gtest version... " >&6; }
+ gtest_version_test=`$GTEST_CONFIG --min-version=1.5 || echo toolow`
+ case "$gtest_version_test" in
+ toolow*)
+ ;;
+ *)
+ GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags`
+ GTEST_LIBS=`$GTEST_CONFIG --libs`
+ GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags`
+ GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags`
+
+
+
+
+ gta=true
+ ;;
+ esac
+ gtest_version=`$GTEST_CONFIG --version`
+ case "$gta" in
+ true)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) ok" >&5
+$as_echo "($gtest_version) ok" >&6; }
+ ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($gtest_version) not ok" >&5
+$as_echo "($gtest_version) not ok" >&6; }
+ ;;
+ esac
+ { gtest_version_test=; unset gtest_version_test;}
+ { gtest_version=; unset gtest_version;}
+ esac
+esac
+ if $gta; then
+ GTEST_AVAILABLE_TRUE=
+ GTEST_AVAILABLE_FALSE='#'
+else
+ GTEST_AVAILABLE_TRUE='#'
+ GTEST_AVAILABLE_FALSE=
+fi
+
+
+
+
+# All libraries should be in various LIB_* variables now.
+#LIBS=
+# Sadly not. There is a gettext() check somewhere, and on Solaris this pulls
+# in -lintl -lgen, outside our "scope".
+
+ac_config_files="$ac_config_files Makefile"
+
+ac_config_files="$ac_config_files include/Makefile"
+
+ac_config_files="$ac_config_files scripts/Makefile"
+
+ac_config_files="$ac_config_files tests/Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+if test -z "${WANT_CALC_TICKADJ_MS_TRUE}" && test -z "${WANT_CALC_TICKADJ_MS_FALSE}"; then
+ as_fn_error $? "conditional \"WANT_CALC_TICKADJ_MS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INSTALL_NTPSWEEP_TRUE}" && test -z "${INSTALL_NTPSWEEP_FALSE}"; then
+ as_fn_error $? "conditional \"INSTALL_NTPSWEEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NTP_CROSSCOMPILE_TRUE}" && test -z "${NTP_CROSSCOMPILE_FALSE}"; then
+ as_fn_error $? "conditional \"NTP_CROSSCOMPILE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${PTHREADS_TRUE}" && test -z "${PTHREADS_FALSE}"; then
+ as_fn_error $? "conditional \"PTHREADS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_SNTP_TRUE}" && test -z "${BUILD_SNTP_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_SNTP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDNORETURN_H_TRUE}" && test -z "${GL_GENERATE_STDNORETURN_H_FALSE}"; then
+ as_fn_error $? "conditional \"GL_GENERATE_STDNORETURN_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INSTALL_LIBOPTS_TRUE}" && test -z "${INSTALL_LIBOPTS_FALSE}"; then
+ as_fn_error $? "conditional \"INSTALL_LIBOPTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEED_LIBOPTS_TRUE}" && test -z "${NEED_LIBOPTS_FALSE}"; then
+ as_fn_error $? "conditional \"NEED_LIBOPTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_LIBEVENT_TRUE}" && test -z "${BUILD_LIBEVENT_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_LIBEVENT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_LIBEVENT_TRUE}" && test -z "${BUILD_LIBEVENT_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_LIBEVENT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+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
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by sntp $as_me 4.2.7p482, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <http://bugs.ntp.org./>.
+sntp home page: <http://www.ntp.org./>."
+
+_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.7p482
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+SHELL \
+ECHO \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_ld_CXX \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "libopts/Makefile") CONFIG_FILES="$CONFIG_FILES libopts/Makefile" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
+ "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+
+#
+# CONFIG_SUBDIRS section.
+#
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+ # so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ eval "set x $ac_configure_args"
+ shift
+ for ac_arg
+ do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case $ac_arg in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+ | --c=*)
+ ;;
+ --config-cache | -C)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ ;;
+ --disable-option-checking)
+ ;;
+ *)
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+ esac
+ done
+
+ # Always prepend --prefix to ensure using the same prefix
+ # in subdir configurations.
+ ac_arg="--prefix=$prefix"
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+ # Pass --silent
+ if test "$silent" = yes; then
+ ac_sub_configure_args="--silent $ac_sub_configure_args"
+ fi
+
+ # Always prepend --disable-option-checking to silence warnings, since
+ # different subdirs can have different --enable and --with options.
+ ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+ ac_popdir=`pwd`
+ for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ test -d "$srcdir/$ac_dir" || continue
+
+ ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+ $as_echo "$ac_msg" >&6
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ cd "$ac_dir"
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ ac_sub_configure=$ac_srcdir/configure.gnu
+ elif test -f "$ac_srcdir/configure"; then
+ ac_sub_configure=$ac_srcdir/configure
+ elif test -f "$ac_srcdir/configure.in"; then
+ # This should be Cygnus configure.
+ ac_sub_configure=$ac_aux_dir/configure
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+ # Make the cache file name correct relative to the subdirectory.
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+ *) # Relative name.
+ ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+ # The eval makes quoting arguments work.
+ eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+ as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+ fi
+
+ cd "$ac_popdir"
+ done
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/sntp/configure.ac b/sntp/configure.ac
new file mode 100644
index 0000000..e103468
--- /dev/null
+++ b/sntp/configure.ac
@@ -0,0 +1,151 @@
+dnl SNTP subpackage configure.ac -*- Autoconf -*-
+dnl
+m4_include([m4/version.m4])
+AC_PREREQ([2.61])
+AC_INIT(
+ [sntp],
+ [VERSION_NUMBER],
+ [http://bugs.ntp.org./],
+ [],
+ [http://www.ntp.org./]dnl
+)
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([libevent/build-aux])
+
+# Bump sntp_configure_cache_version for each change to configure.ac or
+# .m4 files which invalidates cached values from previous configure
+# runs.
+#
+# If the change affects cache variables used only by the main NTP
+# configure.ac, then only its version number should be bumped, while
+# the subdir configure.ac version numbers should be unchanged. The
+# same is true for a test/variable that is used only by one subdir
+# being changed incompatibly; only that subdir's cache version needs
+# bumping.
+#
+# If a change affects variables shared by all NTP configure scripts,
+# please bump the version numbers of each. If you are not sure, the
+# safe choice is to bump all on any cache-invalidating change.
+#
+# In order to avoid the risk of version stamp collision between -stable
+# and -dev branches, do not simply increment the version, instead use
+# the date YYYYMMDD optionally with -HHMM if there is more than one
+# bump in a day.
+
+sntp_configure_cache_version=20120806
+
+# When the version of config.cache and configure do not
+# match, NTP_CACHEVERSION will flush the cache.
+
+NTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
+
+AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
+dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
+m4_ifdef(
+ [AM_SILENT_RULES],
+ [AM_SILENT_RULES([yes])]
+)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+dnl the 'build' machine is where we run configure and compile
+dnl the 'host' machine is where the resulting stuff runs.
+AC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
+AC_CONFIG_HEADER([config.h])
+dnl AC_ARG_PROGRAM
+
+NTP_PROG_CC
+
+NTP_LOCINFO()
+
+dnl AM_PROG_AR req. automake 1.12
+m4_ifdef(
+ [AM_PROG_AR],
+ [AM_PROG_AR]
+)
+
+NTP_LIBNTP
+
+AC_DISABLE_SHARED
+AC_PROG_LIBTOOL
+AC_SUBST([LIBTOOL_DEPS])
+
+NTP_WITHSNTP
+
+case "$SNTP" in
+ '')
+ SNTP_DB=
+ SNTP_DL=
+ SNTP_DS=
+ ;;
+esac
+
+###
+
+# NTP has (so far) been relying on leading-edge autogen.
+# Therefore, by default:
+# - use the version we ship with
+# - do not install it
+# - build a static copy (AC_DISABLE_SHARED - done earlier)
+case "${enable_local_libopts+set}" in
+ set) ;;
+ *) enable_local_libopts=yes ;;
+esac
+case "${enable_libopts_install+set}" in
+ set) ;;
+ *) enable_libopts_install=no ;;
+esac
+enable_nls=no
+LIBOPTS_CHECK
+
+AM_COND_IF(
+ [BUILD_SNTP],
+ [NTP_LIBEVENT_CHECK],
+ [NTP_LIBEVENT_CHECK_NOBUILD]
+)
+
+# Checks for libraries.
+
+dnl NTP_LIBNTP checks for inet_XtoY
+dnl AC_SEARCH_LIBS([inet_pton], [nsl])
+
+dnl AC_SEARCH_LIBS([openlog], [gen syslog])
+LIB_SYSLOG=''
+AC_SUBST([LIB_SYSLOG])
+HMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
+
+# Checks for header files.
+AC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
+NTP_SYSEXITS_H
+NTP_FACILITYNAMES
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+
+NTP_OPENSSL
+NTP_IPV6
+
+###
+
+# Hacks
+# these need work if we're to move libntp under sntp
+AC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
+AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
+
+# Checks for library functions.
+AC_CHECK_FUNCS([socket])
+
+# HMS: if we don't find c++ we should not look for gtest.
+AC_PROG_CXX
+NTP_GOOGLETEST
+
+# All libraries should be in various LIB_* variables now.
+#LIBS=
+# Sadly not. There is a gettext() check somewhere, and on Solaris this pulls
+# in -lintl -lgen, outside our "scope".
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([include/Makefile])
+AC_CONFIG_FILES([scripts/Makefile])
+AC_CONFIG_FILES([tests/Makefile])
+
+AC_OUTPUT
diff --git a/sntp/crypto.c b/sntp/crypto.c
new file mode 100644
index 0000000..aa8d91d
--- /dev/null
+++ b/sntp/crypto.c
@@ -0,0 +1,192 @@
+#include <config.h>
+#include "crypto.h"
+#include <ctype.h>
+
+struct key *key_ptr;
+int key_cnt = 0;
+
+int
+make_mac(
+ char *pkt_data,
+ int pkt_size,
+ int mac_size,
+ struct key *cmp_key,
+ char * digest
+ )
+{
+ u_int len = mac_size;
+ int key_type;
+ EVP_MD_CTX ctx;
+
+ if (cmp_key->key_len > 64)
+ return 0;
+ if (pkt_size % 4 != 0)
+ return 0;
+
+ INIT_SSL();
+ key_type = keytype_from_text(cmp_key->type, NULL);
+ EVP_DigestInit(&ctx, EVP_get_digestbynid(key_type));
+ EVP_DigestUpdate(&ctx, (u_char *)cmp_key->key_seq, (u_int)cmp_key->key_len);
+ EVP_DigestUpdate(&ctx, (u_char *)pkt_data, (u_int)pkt_size);
+ EVP_DigestFinal(&ctx, (u_char *)digest, &len);
+
+ return (int)len;
+}
+
+
+/* Generates a md5 digest of the key specified in keyid concatinated with the
+ * ntp packet (exluding the MAC) and compares this digest to the digest in
+ * the packet's MAC. If they're equal this function returns 1 (packet is
+ * authentic) or else 0 (not authentic).
+ */
+int
+auth_md5(
+ char *pkt_data,
+ int pkt_size,
+ int mac_size,
+ struct key *cmp_key
+ )
+{
+ int hash_len;
+ int authentic;
+ char digest[20];
+
+ if (mac_size > sizeof(digest))
+ return 0;
+ hash_len = make_mac(pkt_data, pkt_size, sizeof(digest), cmp_key,
+ digest);
+ if (!hash_len)
+ authentic = FALSE;
+ else
+ authentic = !memcmp(digest, pkt_data + pkt_size + 4,
+ hash_len);
+ return authentic;
+}
+
+static int
+hex_val(
+ unsigned char x
+ )
+{
+ int val;
+
+ if ('0' <= x && x <= '9')
+ val = x - '0';
+ else if ('a' <= x && x <= 'f')
+ val = x - 'a' + 0xa;
+ else if ('A' <= x && x <= 'F')
+ val = x - 'A' + 0xA;
+ else
+ val = -1;
+
+ return val;
+}
+
+/* Load keys from the specified keyfile into the key structures.
+ * Returns -1 if the reading failed, otherwise it returns the
+ * number of keys it read
+ */
+int
+auth_init(
+ const char *keyfile,
+ struct key **keys
+ )
+{
+ FILE *keyf = fopen(keyfile, "r");
+ struct key *prev = NULL;
+ int scan_cnt, line_cnt = 0;
+ char kbuf[200];
+ char keystring[129];
+
+ if (keyf == NULL) {
+ if (debug)
+ printf("sntp auth_init: Couldn't open key file %s for reading!\n", keyfile);
+ return -1;
+ }
+ if (feof(keyf)) {
+ if (debug)
+ printf("sntp auth_init: Key file %s is empty!\n", keyfile);
+ fclose(keyf);
+ return -1;
+ }
+ key_cnt = 0;
+ while (!feof(keyf)) {
+ char * octothorpe;
+ struct key *act;
+ int goodline = 0;
+
+ if (NULL == fgets(kbuf, sizeof(kbuf), keyf))
+ continue;
+
+ kbuf[sizeof(kbuf) - 1] = '\0';
+ octothorpe = strchr(kbuf, '#');
+ if (octothorpe)
+ *octothorpe = '\0';
+ act = emalloc(sizeof(*act));
+ scan_cnt = sscanf(kbuf, "%d %9s %128s", &act->key_id, act->type, keystring);
+ if (scan_cnt == 3) {
+ int len = strlen(keystring);
+ if (len <= 20) {
+ act->key_len = len;
+ memcpy(act->key_seq, keystring, len + 1);
+ goodline = 1;
+ } else if ((len & 1) != 0) {
+ goodline = 0; /* it's bad */
+ } else {
+ int j;
+ goodline = 1;
+ act->key_len = len >> 1;
+ for (j = 0; j < len; j+=2) {
+ int val;
+ val = (hex_val(keystring[j]) << 4) |
+ hex_val(keystring[j+1]);
+ if (val < 0) {
+ goodline = 0; /* it's bad */
+ break;
+ }
+ act->key_seq[j>>1] = (char)val;
+ }
+ }
+ }
+ if (goodline) {
+ act->next = NULL;
+ if (NULL == prev)
+ *keys = act;
+ else
+ prev->next = act;
+ prev = act;
+ key_cnt++;
+ } else {
+ msyslog(LOG_DEBUG, "auth_init: scanf %d items, skipping line %d.",
+ scan_cnt, line_cnt);
+ free(act);
+ }
+ line_cnt++;
+ }
+ fclose(keyf);
+
+ key_ptr = *keys;
+ return key_cnt;
+}
+
+/* Looks for the key with keyid key_id and sets the d_key pointer to the
+ * address of the key. If no matching key is found the pointer is not touched.
+ */
+void
+get_key(
+ int key_id,
+ struct key **d_key
+ )
+{
+ struct key *itr_key;
+
+ if (key_cnt == 0)
+ return;
+ for (itr_key = key_ptr; itr_key; itr_key = itr_key->next) {
+ if (itr_key->key_id == key_id) {
+ *d_key = itr_key;
+ break;
+ }
+ }
+ return;
+}
diff --git a/sntp/crypto.h b/sntp/crypto.h
new file mode 100644
index 0000000..39e0e6b
--- /dev/null
+++ b/sntp/crypto.h
@@ -0,0 +1,32 @@
+#ifndef CRYPTO_H
+#define CRYPTO_H
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <ntp_fp.h>
+#include <ntp.h>
+#include <ntp_stdlib.h>
+#include <ntp_md5.h> /* provides OpenSSL digest API */
+#include "utilities.h"
+#include "sntp-opts.h"
+
+#define LEN_PKT_MAC LEN_PKT_NOMAC + sizeof(u_int32)
+
+/* #include "sntp-opts.h" */
+
+struct key {
+ struct key *next;
+ int key_id;
+ int key_len;
+ char type[10];
+ char key_seq[64];
+};
+
+int auth_init(const char *keyfile, struct key **keys);
+void get_key(int key_id, struct key **d_key);
+int make_mac(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key, char *digest);
+int auth_md5(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key);
+
+#endif
diff --git a/sntp/data_formats.h b/sntp/data_formats.h
new file mode 100644
index 0000000..28848b2
--- /dev/null
+++ b/sntp/data_formats.h
@@ -0,0 +1,8 @@
+#ifndef DATA_FORMATS_H
+#define DATA_FORMATS_H
+
+#include <ntp_machine.h>
+#include <ntp_fp.h>
+#include <ntp.h>
+
+#endif
diff --git a/sntp/deps-ver b/sntp/deps-ver
new file mode 100644
index 0000000..596602f
--- /dev/null
+++ b/sntp/deps-ver
@@ -0,0 +1 @@
+Mon Jan 31 21:14:29 UTC 2011
diff --git a/sntp/depsver.mf b/sntp/depsver.mf
new file mode 100644
index 0000000..695f730
--- /dev/null
+++ b/sntp/depsver.mf
@@ -0,0 +1,60 @@
+$(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 $@
+
+BUILT_SOURCES += .deps-ver
+CLEANFILES += .deps-ver
+
+#
+# depsver.mf included in Makefile.am for directories with .deps
+#
+# When building in the same directory with sources that change over
+# time, such as when tracking using bk, the .deps files can become
+# stale with respect to moved, deleted, or superceded headers. Most
+# commonly, this would exhibit as make reporting a failure to make a
+# header file which is no longer in the location given. To address
+# this issue, we use a deps-ver file which is updated with each change
+# that breaks old .deps files. A copy of deps-ver is made into
+# $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present
+# with different contents than deps-ver, we make clean to ensure all
+# .o files built before the incompatible change are rebuilt along with
+# their updated .deps files, then remove $(DEPDIR) and recreate it as
+# empty stubs.
+#
+# It is normal when configured with --disable-dependency-tracking for
+# the DEPDIR to not have been created. For this reason, we use the
+# intermediate target .deps-ver, which invokes make recursively if
+# DEPDIR exists.
+#
+# If you modify depsver.mf, please make the changes to the master
+# copy, the one in sntp is copied by the bootstrap script from it.
+#
+# This comment block follows rather than leads the related code so that
+# it stays with it in the generated Makefile.in and Makefile.
+#
diff --git a/sntp/include/Makefile.am b/sntp/include/Makefile.am
new file mode 100644
index 0000000..1222788
--- /dev/null
+++ b/sntp/include/Makefile.am
@@ -0,0 +1,19 @@
+NULL =
+
+EXTRA_DIST = \
+ autogen-version.def \
+ copyright.def \
+ debug-opt.def \
+ homerc.def \
+ ntp.lic \
+ version.def \
+ version.texi \
+ $(NULL)
+
+noinst_HEADERS =
+
+$(srcdir)/version.def: $(srcdir)/../../packageinfo.sh
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) $(abs_top_srcdir)/include/version.def
+
+$(srcdir)/version.texi: $(srcdir)/../../packageinfo.sh
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) $(abs_top_srcdir)/include/version.texi
diff --git a/sntp/include/Makefile.in b/sntp/include/Makefile.in
new file mode 100644
index 0000000..dd0a84b
--- /dev/null
+++ b/sntp/include/Makefile.in
@@ -0,0 +1,512 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
+ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/libevent/m4/openldap.m4 \
+ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/m4/ntp_compiler.m4 \
+ $(top_srcdir)/m4/ntp_crosscompile.m4 \
+ $(top_srcdir)/m4/ntp_debug.m4 $(top_srcdir)/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/m4/ntp_googletest.m4 \
+ $(top_srcdir)/m4/ntp_ipv6.m4 $(top_srcdir)/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/m4/ntp_libevent.m4 \
+ $(top_srcdir)/m4/ntp_libntp.m4 \
+ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/m4/ntp_openssl.m4 \
+ $(top_srcdir)/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
+ $(top_srcdir)/m4/ntp_sysexits.m4 \
+ $(top_srcdir)/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
+ $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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@
+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_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@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIB_SYSLOG = @LIB_SYSLOG@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+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_FORCE_LIBEVENT_DIST = @NTP_FORCE_LIBEVENT_DIST@
+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_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_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+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@
+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@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+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 =
+EXTRA_DIST = \
+ autogen-version.def \
+ copyright.def \
+ debug-opt.def \
+ homerc.def \
+ ntp.lic \
+ version.def \
+ version.texi \
+ $(NULL)
+
+noinst_HEADERS =
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+$(srcdir)/version.def: $(srcdir)/../../packageinfo.sh
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) $(abs_top_srcdir)/include/version.def
+
+$(srcdir)/version.texi: $(srcdir)/../../packageinfo.sh
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) $(abs_top_srcdir)/include/version.texi
+
+# 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/sntp/include/autogen-version.def b/sntp/include/autogen-version.def
new file mode 100644
index 0000000..bbe3f03
--- /dev/null
+++ b/sntp/include/autogen-version.def
@@ -0,0 +1,4 @@
+#assert (version-compare >= autogen-version "5.18.4")
+// >= is usually what we want.
+// > is when we need a pre* version
+guard-option-names;
diff --git a/sntp/include/copyright.def b/sntp/include/copyright.def
new file mode 100644
index 0000000..317ff6d
--- /dev/null
+++ b/sntp/include/copyright.def
@@ -0,0 +1,30 @@
+/* -*- Mode: Text -*- */
+
+copyright = {
+ date = "1970-2014";
+ owner = "The University of Delaware";
+ eaddr = "http://bugs.ntp.org, bugs@ntp.org";
+ type = ntp;
+};
+
+long-opts;
+config-header = config.h;
+environrc;
+no-misuse-usage;
+version-proc = ntpOptionPrintVersion;
+
+version = `
+eval VERSION=\`sed -e 's/.*,\\[//' -e 's/\\].*//' < ../sntp/m4/version.m4\`
+[ -z "${VERSION}" ] && echo "Cannot determine VERSION" && kill -TERM $AG_pid
+echo $VERSION`;
+
+version-value = ''; /* Don't use -v as a shortcut for --version */
+
+/*
+ * HMS: man pages already have this, and texi pages can use the
+ * values in sntp/include/version.texi .
+ */
+// doc-sub = {
+// sub-name = version;
+// sub-text = 's/#VERSION#/<<version>>/g';
+// };
diff --git a/sntp/include/debug-opt.def b/sntp/include/debug-opt.def
new file mode 100644
index 0000000..516163d
--- /dev/null
+++ b/sntp/include/debug-opt.def
@@ -0,0 +1,29 @@
+
+include = <<- _EOF_
+ #ifdef __windows
+ extern int atoi(const char*);
+ #else
+ # include <stdlib.h>
+ #endif
+ _EOF_;
+
+flag = {
+ name = debug-level;
+ value = d;
+ max = NOLIMIT;
+ nopreset;
+ flag-code = 'OPT_VALUE_SET_DEBUG_LEVEL++;';
+ descrip = "Increase debug verbosity level";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = set-debug-level;
+ value = D;
+ max = NOLIMIT;
+ descrip = "Set the debug verbosity level";
+ arg-type = number;
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
diff --git a/sntp/include/homerc.def b/sntp/include/homerc.def
new file mode 100644
index 0000000..18b4dcb
--- /dev/null
+++ b/sntp/include/homerc.def
@@ -0,0 +1,9 @@
+/* -*- Mode: Text -*- */
+
+#ifndef __windows__
+rcfile = ".ntprc";
+#else
+rcfile = "ntp.ini";
+#endif
+
+homerc = $HOME, ".";
diff --git a/sntp/include/ntp.lic b/sntp/include/ntp.lic
new file mode 100644
index 0000000..0e42503
--- /dev/null
+++ b/sntp/include/ntp.lic
@@ -0,0 +1,18 @@
+<PFX>Copyright (C) <years> <owner>, all rights reserved.
+<PFX>This is free software. It is licensed for use, modification and
+<PFX>redistribution under the terms of the NTP License, copies of which
+<PFX>can be seen at:
+<PFX> <http://ntp.org/license>
+<PFX> <http://opensource.org/licenses/ntp-license.php>
+
+<PFX>Permission to use, copy, modify, and distribute this software and its
+<PFX>documentation for any purpose with or without fee is hereby granted,
+<PFX>provided that the above copyright notice appears in all copies and that
+<PFX>both the copyright notice and this permission notice appear in
+<PFX>supporting documentation, and that the name <owner> not be used in
+<PFX>advertising or publicity pertaining to distribution of the software
+<PFX>without specific, written prior permission. <owner> makes no
+<PFX>representations about the suitability this software for any purpose. It
+<PFX>is provided "as is" without express or implied warranty.
+
+the NTP license, <http://ntp.org/license>
diff --git a/sntp/include/version.def b/sntp/include/version.def
new file mode 100644
index 0000000..2097ac6
--- /dev/null
+++ b/sntp/include/version.def
@@ -0,0 +1 @@
+version = '4.2.7p482';
diff --git a/sntp/include/version.texi b/sntp/include/version.texi
new file mode 100644
index 0000000..539f825
--- /dev/null
+++ b/sntp/include/version.texi
@@ -0,0 +1,3 @@
+@set UPDATED 02 December 2014
+@set EDITION 4.2.7p482
+@set VERSION 4.2.7p482
diff --git a/sntp/includes.mf b/sntp/includes.mf
new file mode 100644
index 0000000..9ba126d
--- /dev/null
+++ b/sntp/includes.mf
@@ -0,0 +1,6 @@
+## includes.mf - automake fragment
+
+SNTP_INCS = -I$(top_srcdir)/../include
+SNTP_INCS += -I$(top_srcdir)/../lib/isc/include
+SNTP_INCS += -I$(top_srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include
+SNTP_INCS += -I$(top_srcdir)/../lib/isc/unix/include
diff --git a/sntp/install-sh b/sntp/install-sh
new file mode 100755
index 0000000..4d4a951
--- /dev/null
+++ b/sntp/install-sh
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-05-14.22
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
+
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
+done
+
+if test -z "$1"; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $cpprog "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/sntp/invoke-sntp.menu b/sntp/invoke-sntp.menu
new file mode 100644
index 0000000..e3c8d81
--- /dev/null
+++ b/sntp/invoke-sntp.menu
@@ -0,0 +1 @@
+* sntp Invocation:: Invoking sntp
diff --git a/sntp/invoke-sntp.texi b/sntp/invoke-sntp.texi
new file mode 100644
index 0000000..a79bb59
--- /dev/null
+++ b/sntp/invoke-sntp.texi
@@ -0,0 +1,426 @@
+@node sntp Invocation
+@section Invoking sntp
+@pindex sntp
+@cindex standard Simple Network Time Protocol client program
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-sntp.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:59:28 AM by AutoGen 5.18.5pre4
+# From the definitions sntp-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+@code{sntp}
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command or from a
+@code{cron}
+job.
+
+NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+
+
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+
+@code{'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'}
+
+where the
+@code{'(+0800)'}
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+@code{'+4.567'}
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+@code{'+/- 0.089'}
+is the reported
+@emph{synchronization} @emph{distance}
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+@code{'+/- ?'}.
+If the
+@emph{host}
+is different from the
+@emph{IP},
+both will be displayed.
+Otherwise, only the
+@emph{IP}
+is displayed.
+Finally, the
+@emph{stratum}
+of the host is reported.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{sntp} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* sntp usage:: sntp help/usage (@option{--help})
+* sntp ipv4:: ipv4 option (-4)
+* sntp ipv6:: ipv6 option (-6)
+* sntp authentication:: authentication option (-a)
+* sntp broadcast:: broadcast option (-b)
+* sntp concurrent:: concurrent option (-c)
+* sntp gap:: gap option (-g)
+* sntp kod:: kod option (-K)
+* sntp keyfile:: keyfile option (-k)
+* sntp logfile:: logfile option (-l)
+* sntp steplimit:: steplimit option (-M)
+* sntp ntpversion:: ntpversion option (-o)
+* sntp usereservedport:: usereservedport option (-r)
+* sntp timeout:: timeout option (-t)
+* sntp wait:: wait option
+* sntp config:: presetting/configuring sntp
+* sntp exit status:: exit status
+* sntp Usage:: Usage
+* sntp Authors:: Authors
+@end menu
+
+@node sntp usage
+@subsection sntp help/usage (@option{--help})
+@cindex sntp help
+
+This is the automatically generated usage text for sntp.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p482
+Usage: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
+ [ hostname-or-IP ...]
+ Flg Arg Option-Name Description
+ -4 no ipv4 Force IPv4 DNS name resolution
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -a Num authentication Enable authentication with the key auth-keynumber
+ -b Str broadcast Listen to the address specified for broadcast time sync
+ - may appear multiple times
+ -c Str concurrent Concurrently query all IPs returned for host-name
+ - may appear multiple times
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -g Num gap The gap (in milliseconds) between time requests
+ -K Fil kod KoD history filename
+ -k Fil keyfile Look in this file for the key specified with -a
+ -l Fil logfile Log to specified logfile
+ -M Num steplimit Adjustments less than steplimit msec will be slewed
+ - it must be in the range:
+ greater than or equal to 0
+ -o Num ntpversion Send int as our NTP protocol version
+ - it must be in the range:
+ 0 to 7
+ -r no usereservedport Use the NTP Reserved Port (port 123)
+ -S no step OK to 'step' the time with settimeofday(2)
+ -s no slew OK to 'slew' the time with adjtime(2)
+ -t Num timeout The number of seconds to wait for responses
+ no wait Wait for pending replies (if not setting the time)
+ - disabled as '--no-wait'
+ - enabled by default
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -> opt save-opts save the option state to a config file
+ -< Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named SNTP_*
+
+Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org>
+@end example
+@exampleindent 4
+
+@node sntp ipv4
+@subsection ipv4 option (-4)
+@cindex sntp-ipv4
+
+This is the ``force ipv4 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv6.
+@end itemize
+
+Force DNS resolution of the following host names on the command line
+to the IPv4 namespace.
+@node sntp ipv6
+@subsection ipv6 option (-6)
+@cindex sntp-ipv6
+
+This is the ``force ipv6 dns name resolution'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must not appear in combination with any of the following options:
+ipv4.
+@end itemize
+
+Force DNS resolution of the following host names on the command line
+to the IPv6 namespace.
+@node sntp authentication
+@subsection authentication option (-a)
+@cindex sntp-authentication
+
+This is the ``enable authentication with the key @var{auth-keynumber}'' option.
+This option takes a number argument @file{auth-keynumber}.
+Enable authentication using the key specified in this option's
+argument. The argument of this option is the @option{keyid}, a
+number specified in the @option{keyfile} as this key's identifier.
+See the @option{keyfile} option (@option{-k}) for more details.
+@node sntp broadcast
+@subsection broadcast option (-b)
+@cindex sntp-broadcast
+
+This is the ``listen to the address specified for broadcast time sync'' option.
+This option takes a string argument @file{broadcast-address}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+If specified @code{sntp} will listen to the specified address
+for NTP broadcasts. The default maximum wait time
+can (and probably should) be modified with @option{-t}.
+@node sntp concurrent
+@subsection concurrent option (-c)
+@cindex sntp-concurrent
+
+This is the ``concurrently query all ips returned for host-name'' option.
+This option takes a string argument @file{host-name}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+@code{ntpd}, and therefore @code{sntp} will send queries to these IPs
+one after another, with a 2-second gap in between each query.
+
+The @option{-c} or @option{--concurrent} flag says that any IPs
+returned for the DNS lookup of the supplied host-name are on
+different machines, so we can send concurrent queries.
+@node sntp gap
+@subsection gap option (-g)
+@cindex sntp-gap
+
+This is the ``the gap (in milliseconds) between time requests'' option.
+This option takes a number argument @file{milliseconds}.
+Since we're only going to use the first valid response we get and
+there is benefit to specifying a good number of servers to query,
+separate the queries we send out by the specified number of
+milliseconds.
+@node sntp kod
+@subsection kod option (-K)
+@cindex sntp-kod
+
+This is the ``kod history filename'' option.
+This option takes a file argument @file{file-name}.
+Specifies the filename to be used for the persistent history of KoD
+responses received from servers.
+@node sntp keyfile
+@subsection keyfile option (-k)
+@cindex sntp-keyfile
+
+This is the ``look in this file for the key specified with @option{-a}'' option.
+This option takes a file argument @file{file-name}.
+This option specifies the keyfile.
+@code{sntp} will search for the key specified with @option{-a}
+@file{keyno} in this file. See @command{ntp.keys(5)} for more
+information.
+@node sntp logfile
+@subsection logfile option (-l)
+@cindex sntp-logfile
+
+This is the ``log to specified logfile'' option.
+This option takes a file argument @file{file-name}.
+This option causes the client to write log messages to the specified
+@file{logfile}.
+@node sntp steplimit
+@subsection steplimit option (-M)
+@cindex sntp-steplimit
+
+This is the ``adjustments less than @var{steplimit} msec will be slewed'' option.
+This option takes a number argument.
+If the time adjustment is less than @file{steplimit} milliseconds,
+slew the amount using @command{adjtime(2)}. Otherwise, step the
+correction using @command{settimeofday(2)}.
+@node sntp ntpversion
+@subsection ntpversion option (-o)
+@cindex sntp-ntpversion
+
+This is the ``send @var{int} as our ntp protocol version'' option.
+This option takes a number argument.
+When sending requests to a remote server, tell them we are running
+NTP protocol version @file{ntpversion} .
+@node sntp usereservedport
+@subsection usereservedport option (-r)
+@cindex sntp-usereservedport
+
+This is the ``use the ntp reserved port (port 123)'' option.
+Use port 123, which is reserved for NTP, for our network
+communications.
+@node sntp timeout
+@subsection timeout option (-t)
+@cindex sntp-timeout
+
+This is the ``the number of seconds to wait for responses'' option.
+This option takes a number argument @file{seconds}.
+When waiting for a reply, @code{sntp} will wait the number
+of seconds specified before giving up. The default should be
+more than enough for a unicast response. If @code{sntp} is
+only waiting for a broadcast response a longer timeout is
+likely needed.
+@node sntp wait
+@subsection wait option
+@cindex sntp-wait
+
+This is the ``wait for pending replies (if not setting the time)'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+can be disabled with --no-wait.
+@item
+It is enabled by default.
+@end itemize
+
+If we are not setting the time, wait for all pending responses.
+
+
+@node sntp config
+@subsection presetting/configuring sntp
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{SNTP} and @code{SNTP_<OPTION_NAME>}. @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{SNTP} variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{sntp} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+@example
+[SNTP]
+@end example
+@noindent
+or by
+@example
+<?program sntp>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+ <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions. You simply note that it is a
+hierarchicly valued option. @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version. This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node sntp exit status
+@subsection sntp exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error. Please report
+it to autogen-users@@lists.sourceforge.net. Thank you.
+@end table
+@node sntp Usage
+@subsection sntp Usage
+@node sntp Authors
+@subsection sntp Authors
diff --git a/sntp/kod_management.c b/sntp/kod_management.c
new file mode 100644
index 0000000..5621639
--- /dev/null
+++ b/sntp/kod_management.c
@@ -0,0 +1,301 @@
+#include <config.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "kod_management.h"
+#include "log.h"
+#include "sntp-opts.h"
+#include "ntp_stdlib.h"
+#include "ntp_worker.h"
+#include "ntp_debug.h"
+
+int kod_init = 0, kod_db_cnt = 0;
+const char *kod_db_file;
+struct kod_entry **kod_db; /* array of pointers to kod_entry */
+
+
+/*
+ * Search for a KOD entry
+ */
+int
+search_entry(
+ const char *hostname,
+ struct kod_entry **dst
+ )
+{
+ register int a, b, resc = 0;
+
+ for (a = 0; a < kod_db_cnt; a++)
+ if (!strcmp(kod_db[a]->hostname, hostname))
+ resc++;
+
+ if (!resc) {
+ *dst = NULL;
+ return 0;
+ }
+
+ *dst = emalloc(resc * sizeof(**dst));
+
+ b = 0;
+ for (a = 0; a < kod_db_cnt; a++)
+ if (!strcmp(kod_db[a]->hostname, hostname)) {
+ (*dst)[b] = *kod_db[a];
+ b++;
+ }
+
+ return resc;
+}
+
+
+void
+add_entry(
+ const char * hostname,
+ const char * type /* 4 bytes not \0 terminated */
+ )
+{
+ int n;
+ struct kod_entry *pke;
+
+ pke = emalloc_zero(sizeof(*pke));
+ pke->timestamp = time(NULL);
+ memcpy(pke->type, type, 4);
+ pke->type[sizeof(pke->type) - 1] = '\0';
+ strlcpy(pke->hostname, hostname, sizeof(pke->hostname));
+
+ /*
+ * insert in address ("hostname") order to find duplicates
+ */
+ for (n = 0; n < kod_db_cnt; n++)
+ if (strcmp(kod_db[n]->hostname, pke->hostname) >= 0)
+ break;
+
+ if (n < kod_db_cnt &&
+ 0 == strcmp(kod_db[n]->hostname, pke->hostname)) {
+ kod_db[n]->timestamp = pke->timestamp;
+ free(pke);
+ return;
+ }
+
+ kod_db_cnt++;
+ kod_db = erealloc(kod_db, kod_db_cnt * sizeof(kod_db[0]));
+ if (n != kod_db_cnt - 1)
+ memmove(&kod_db[n + 1], &kod_db[n],
+ sizeof(kod_db[0]) * ((kod_db_cnt - 1) - n));
+ kod_db[n] = pke;
+}
+
+
+void
+delete_entry(
+ const char * hostname,
+ const char * type
+ )
+{
+ int a;
+
+ for (a = 0; a < kod_db_cnt; a++)
+ if (!strcmp(kod_db[a]->hostname, hostname)
+ && !strcmp(kod_db[a]->type, type))
+ break;
+
+ if (a == kod_db_cnt)
+ return;
+
+ free(kod_db[a]);
+ kod_db_cnt--;
+
+ if (a < kod_db_cnt)
+ memmove(&kod_db[a], &kod_db[a + 1],
+ (kod_db_cnt - a) * sizeof(kod_db[0]));
+}
+
+
+void
+atexit_write_kod_db(void)
+{
+#ifdef WORK_FORK
+ if (worker_process)
+ return;
+#endif
+ write_kod_db();
+}
+
+
+int
+write_kod_db(void)
+{
+ FILE *db_s;
+ char *pch;
+ int dirmode;
+ register int a;
+
+ db_s = fopen(kod_db_file, "w");
+
+ /*
+ * If opening fails, blindly attempt to create each directory
+ * in the path first, then retry the open.
+ */
+ if (NULL == db_s && strlen(kod_db_file)) {
+ dirmode = S_IRUSR | S_IWUSR | S_IXUSR
+ | S_IRGRP | S_IXGRP
+ | S_IROTH | S_IXOTH;
+ pch = strchr(kod_db_file + 1, DIR_SEP);
+ while (NULL != pch) {
+ *pch = '\0';
+ if (-1 == mkdir(kod_db_file, dirmode)
+ && errno != EEXIST) {
+ msyslog(LOG_ERR, "mkdir(%s) failed: %m",
+ kod_db_file);
+ return FALSE;
+ }
+ *pch = DIR_SEP;
+ pch = strchr(pch + 1, DIR_SEP);
+ }
+ db_s = fopen(kod_db_file, "w");
+ }
+
+ if (NULL == db_s) {
+ msyslog(LOG_WARNING, "Can't open KOD db file %s for writing: %m",
+ kod_db_file);
+
+ return FALSE;
+ }
+
+ for (a = 0; a < kod_db_cnt; a++) {
+ fprintf(db_s, "%16.16llx %s %s\n", (unsigned long long)
+ kod_db[a]->timestamp, kod_db[a]->type,
+ kod_db[a]->hostname);
+ }
+
+ fflush(db_s);
+ fclose(db_s);
+
+ return TRUE;
+}
+
+
+void
+kod_init_kod_db(
+ const char * db_file,
+ int readonly
+ )
+{
+ /*
+ * Max. of 254 characters for hostname, 10 for timestamp, 4 for
+ * kisscode, 2 for spaces, 1 for \n, and 1 for \0
+ */
+ char fbuf[254+10+4+2+1+1];
+ FILE *db_s;
+ int a, b, sepc, len;
+ unsigned long long ull;
+ char *str_ptr;
+ char error = 0;
+
+ TRACE(2, ("Initializing KOD DB...\n"));
+
+ kod_db_file = estrdup(db_file);
+
+ db_s = fopen(db_file, "r");
+
+ if (NULL == db_s) {
+ msyslog(LOG_WARNING, "kod_init_kod_db(): Cannot open KoD db file %s: %m",
+ db_file);
+
+ return;
+ }
+
+ if (debug)
+ printf("Starting to read KoD file %s...\n", db_file);
+ /* First let's see how many entries there are and check for right syntax */
+
+ while (!feof(db_s) && NULL != fgets(fbuf, sizeof(fbuf), db_s)) {
+
+ /* ignore blank lines */
+ if ('\n' == fbuf[0])
+ continue;
+
+ sepc = 0;
+ len = strlen(fbuf);
+ for (a = 0; a < len; a++) {
+ if (' ' == fbuf[a])
+ sepc++;
+
+ if ('\n' == fbuf[a]) {
+ if (sepc != 2) {
+ if (strcmp(db_file, "/dev/null"))
+ msyslog(LOG_DEBUG,
+ "Syntax error in KoD db file %s in line %i (missing space)",
+ db_file,
+ kod_db_cnt + 1);
+ fclose(db_s);
+ return;
+ }
+ sepc = 0;
+ kod_db_cnt++;
+ }
+ }
+ }
+
+ if (0 == kod_db_cnt) {
+ TRACE(2, ("KoD DB %s empty.\n", db_file));
+ goto wrapup;
+ }
+
+ TRACE(2, ("KoD DB %s contains %d entries, reading...\n", db_file, kod_db_cnt));
+
+ rewind(db_s);
+
+ kod_db = emalloc(sizeof(kod_db[0]) * kod_db_cnt);
+
+ /* Read contents of file */
+ for (b = 0;
+ !feof(db_s) && !ferror(db_s) && b < kod_db_cnt;
+ b++) {
+
+ str_ptr = fgets(fbuf, sizeof(fbuf), db_s);
+ if (NULL == str_ptr) {
+ error = 1;
+ break;
+ }
+
+ /* ignore blank lines */
+ if ('\n' == fbuf[0]) {
+ b--;
+ continue;
+ }
+
+ kod_db[b] = emalloc(sizeof(*kod_db[b]));
+
+ if (3 != sscanf(fbuf, "%llx %4s %254s", &ull,
+ kod_db[b]->type, kod_db[b]->hostname)) {
+
+ free(kod_db[b]);
+ kod_db[b] = NULL;
+ error = 1;
+ break;
+ }
+
+ kod_db[b]->timestamp = (time_t)ull;
+ }
+
+ if (ferror(db_s) || error) {
+ kod_db_cnt = b;
+ msyslog(LOG_WARNING, "An error occured while parsing the KoD db file %s",
+ db_file);
+ fclose(db_s);
+
+ return;
+ }
+
+ wrapup:
+ fclose(db_s);
+ for (a = 0; a < kod_db_cnt; a++)
+ TRACE(2, ("KoD entry %d: %s at %llx type %s\n", a,
+ kod_db[a]->hostname,
+ (unsigned long long)kod_db[a]->timestamp,
+ kod_db[a]->type));
+
+ if (!readonly && write_kod_db())
+ atexit(&atexit_write_kod_db);
+}
diff --git a/sntp/kod_management.h b/sntp/kod_management.h
new file mode 100644
index 0000000..37089f2
--- /dev/null
+++ b/sntp/kod_management.h
@@ -0,0 +1,20 @@
+#ifndef KOD_MANAGEMENT_H
+#define KOD_MANAGEMENT_H
+
+#include <time.h>
+
+struct kod_entry {
+ char hostname[255];
+ time_t timestamp;
+ char type[5];
+};
+
+int search_entry(const char *hostname, struct kod_entry **dst);
+void add_entry(const char *hostname, const char *type);
+void delete_entry(const char *hostname, const char *type);
+void kod_init_kod_db(const char *db_file, int readonly);
+int write_kod_db(void);
+void atexit_write_kod_db(void);
+
+
+#endif
diff --git a/sntp/libevent/ChangeLog b/sntp/libevent/ChangeLog
new file mode 100644
index 0000000..8bb76ca
--- /dev/null
+++ b/sntp/libevent/ChangeLog
@@ -0,0 +1,736 @@
+Changes in version 2.1.4-beta (?? Dec 2013)
+
+ (As of 735d838b0a537ae04f1e6a2e9cbc5f3f45ebb541)
+
+
+ Bugfixes (evdns)
+ o Checking request nameserver for NULL, before using it. (5c710c0
+ Belobrov Andrey)
+ o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (14971a8
+ Azat Khuzhin)
+ o Actually use the log facility for reporting evdns problems. (e1766a1)
+ o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin)
+
+ Bugfixes (compilatin)
+ o Fix test compilation with nmake: add the gdi.lib dependency (5ba8ab7)
+ o Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) (8ab612e)
+ o Don't use return since return type is void and build error occurs using clang (838161d Makoto Kato)
+ o Use void casts to suppress some "unchecked return value" warns (7080d55)
+ o rpcgen: Generate regress.gen.[c,h] in build rather than src dir (243386c Ross Lagerwall)
+ o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865)
+
+ Bugfixes (locks, synchronization)
+ o Missed lock acquire/release in event_base_cancel_single_callback_()
+ (d3d999a Azat Khuzhin)
+ o Fix locking in bufferevent_get_options_(). (dbc9cd4 Maxime Henrion)
+
+ Bugfixes (leaks)
+ o Avoid leaking segment mappings when offset is not a page multiple (d409514)
+
+ Testing
+ o Add tests for evdns_base_resume(). (1cd9ff5 Azat Khuzhin)
+ o Fix dns/leak_resume_send_err test. (7e876df Azat Khuzhin)
+ o Add checks for evhttp_connection_get_server() in unit tests. (fbc323b Maxime Henrion)
+ o Fix a (failure-only) null dereference in the unit tests (1104d0b)
+ o Fix a logic error in test_evbuffer_freeze (7765884)
+ o Add missing check to test_evbuffer_file_segment_add_cleanup_cb (eba4506)
+ o Fix some crash-on-fail cases in DNS regression tests (87cd6f0)
+ o DNS tests: add a missing check (f314900)
+ o Finalize tests: add a missing check (82b6956)
+ o test_evutil_rtrim: add another missing check. (e193c95)
+ o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset (611e28b Azat Khuzhin)
+ o regress_http: add tests for evhttp_connection_get_addr() (4dd500c Azat Khuzhin)
+
+ Bugfixes (core)
+ o If evsel->del() fails, don't leave the evmap in an inconsistent state
+ (9b5a527 Maxime Henrion)
+ o Move event_debug_note_teardown_ before mm_free. (69b5c64)
+ o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3)
+ o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe)
+
+ Performance tweaks (core)
+ o Avoid redundant syscall to make a nonblocking socket nonblocking
+ (42c03da Maxime Henrion)
+ o Avoid redundant syscall if making a socket cloexec twice (1f29b18)
+ o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62)
+
+ Bugfixes (evhttp)
+ o Fix a double close() bug in evhttp when the underlying bufferevent uses
+ BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion)
+ o Fix an unlikely but possible error case for http connections (f22049e)
+ o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum)
+
+ Bugfixes on 2.0 (Windows)
+ o Use windows vsnprintf fixup logic on all windows environments (e826f19)
+ o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis)
+
+ Bugfixes (evutil_secure_rng)
+ o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540)
+ o We should return after arc4random_buf() (1ea1f26 Makoto Kato)
+ o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c)
+ o Really remove RNG seeds from the stack (f5ced88)
+ o Fix another arc4random_buf-related warning (e64a2b0)
+
+ New APIs (core)
+ o Added event_base_get_num_events() (0fa107d Mobai Zhang)
+ o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey)
+ o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb Mark Ellzey)
+
+ New APIs (evhttp)
+ o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion)
+ o add a http default content type option (5a5acd9 Nicolas Martyanoff)
+ o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat Khuzhin)
+
+
+ Documentation
+ o Document that arc4random is not a great cryptographic PRNG. (6e49696)
+ o Small doxygen tweaks (6e67b51)
+ o Try another doxygen tweak (ccf432b)
+
+ New APIs (evutil_secure_rng)
+ o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7)
+
+ Cleanups
+ o Remove an unreachable return statement in minheap-internal.h (e639a9e)
+
+ Sample code
+ o sample/le-proxy: Fail more gracefully if opening listener fails (44b2491)
+ o sample: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin)
+
+
+
+
+
+
+
+
+
+
+
+Changes in version 2.1.3-alpha (1 May 2013)
+
+ Libevent 2.1.3-alpha fixes various bugs, adds new unit tests, and cleans
+ up the code in a couple of places. It has a new callback in evhttp for
+ reporting errors during a request, a new feature for allowing evdns to
+ not keep the event_base looping when there are no requests inflight, and
+ example code for writing an https client.
+
+ Libevent 2.1.3-alpha also has an important new (experimental) event
+ finalization feature to allow safe event teardown in multithreaded
+ programs. This ought to fix the longstanding bug with deadlocks in
+ multithreaded use of SSL-based bufferevents that some people have been
+ experiencing since Libevent 2.0.
+
+
+ Core (event finalization)
+ o Implement event_finalize() and related functions to avoid certain
+ deadlocks (8eedeab)
+ o Use finalization feature so bufferevents can avoid deadlocks (02fbf68)
+ o Always run pending finalizers when event_base_free() is called (e9ebef8)
+ o Remove bufferevent_del_generic_timeout_cbs as now unused (4ea4c6a)
+ o More documentation for finalization feature (a800b91)
+ o Make the event_finalize* functions return an error code (5d11f4f)
+ o Mark the finalize stuff as experiemental in case it needs to
+ change (23e2e29)
+
+ Evdns
+ o evdns: New flag to make evdns not prevent the event loop from
+ exiting (6b7fa62 Azat Khuzhin)
+
+ Bugfixes (Core)
+ o Make event_remove_timer behave correctly with persistent timers (5623e80)
+ o Unit test for event_remove_timer with EV_PERSIST. (96150dd)
+ o Double-check next timeout when adding events (9443868 Nate Rosenblum)
+ o event_base_update_cache_time should be a no-op if the loop isn't
+ running (5e6fa2a)
+
+ Bugfixes (evhttp, crash fix, from 2.0)
+ o fix #73 and fix http_connection_fail_test to catch it (b618204 Greg Hazel)
+
+ Bugfixes (compilation and portability, from 2.0)
+ o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739)
+ o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan)
+ o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5)
+ (74d4c44 Kevin Bowling)
+ o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake
+ 1.13 compat (817ea36)
+ o Rename configure.in to configure.ac to appease newer autoconfs (0c79787)
+ o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e)
+
+ Bugfixes (resource leaks/lock errors on error, from 2.0)
+ o Avoid leaking fds on evconnlistener with no callback set (69db261)
+ o Avoid double-close on getsockname error in evutil_ersatz_socketpair
+ (0a822a6)
+ o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e)
+
+ Documentation Fixes (from 2.0)
+ o Fix a mistake in evbuffer_remove() arguments in example http server code
+ (c322c20 Gyepi Sam)
+ o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5)
+
+ Documentation Fixes
+ o minor documentation typos (809586a Patrick Pelletier)
+ o Fix cut-and-paste err in whatsnew-2.1 (49905ac)
+ o Fix comment to refer to sample/include.am correctly (9e8cdf3 Sebastian
+ Hahn)
+ o Fix typo : Dispatching instead of Dispaching (0c2bacc Volker Lendecke)
+ o fix some hinky indentation in evhttp_make_request (80e220e Patrick
+ Pelletier)
+ o "buffer" spelling (a452811 Patrick Pelletier)
+ o Specify return behavior in header for evbuffer_pullup() in corner case
+ (cf8d1cd Dan Petro)
+ o Clarify an important point about event_base_foreach_event() (920a5e6)
+
+ Compilation Fixes/Tool Support
+ o avoid valgrind false positive by zeroing epoll_event (1258614 Patrick
+ Pelletier)
+ o Fix harmless clang enum warning (b452a43 Sebastian Hahn)
+ o remove all exes on "make clean", not just regress.exe (974bfa0 Patrick
+ Pelletier)
+ o Make --disable-libevent-regress work again (787fd74)
+ o Do not build strlcpy.c when it will have no code. (4914620)
+
+ Portability Fixes
+ o When EWOULDBLOCK is not EAGAIN, treat it as equivalent to it (bf7a0ff)
+ o Preliminary changes for Minix3. (0dda56a Nicholas Heath)
+ o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13
+ compat (bf278b)
+ o Avoid using $(top_srcdir) in TESTS. (2863c83)
+ o build test/test-script.sh on systems with a less-featureful $< (f935e21)
+ o Implement EVUTIL_ERR_IS_EAGAIN on windows. (42aaf4d)
+
+ Evhttp changes:
+ o Fix ipv6 support for http. When URL contain domain, not IP
+ address. (71e709c Azat Khuzhin)
+ o uri decode: fix for warning "use of uninitialised value" (64b6ece Azat
+ Khuzhin)
+ o uri decode: changed the test for the existence of the next character
+ (e1903e3 Azat Khuzhin)
+ o Move prototype of evhttp_decode_uri_internal() to http-internal.h
+ (de8101a Azat Khuzhin)
+ o Test: decoding just part of string with evhttp_decode_uri_internal()
+ (1367653 Azat Khuzhin)
+ o Add new error_cb for actual reporting of HTTP request errors. (7b07719
+ Azat Khuzhin)
+ o Add test for EVREQ_HTTP_REQUEST_CANCEL into http_cancel_test() (862c217
+ Azat Khuzhin)
+ o Drop extra header http_struct.h from regress_http.c (54cc800 Azat Khuzhin)
+
+ Testing
+ o Add regress test ipv6_for_domain. (9ec88bd Azat Khuzhin)
+ o Add an environment variable (EVENT_DEBUG_MODE) to run unit tests in debug
+ mode (2fad0f3)
+ o Add a test with an active_later event at event_base_free time. (1c3147f)
+ o Make all tests pass under EVENT_DEBUG_MODE=1 (b1b054f)
+ o Add some verbose notes to bufferevent unit tests (9d893c9)
+ o New test for active_later->active transition on event_active (a153874)
+ o New tests for event_base_foreach_event() (0b096ef)
+ o Unit tests for event_base_gettimeofday_cached() and
+ event_base_update_cache_time() (30ea291)
+ o A test for event_get_assignment() (f09629e)
+ o More unit tests for initializing common timeouts. (d596739)
+ o Fix a bug in the new main/event_foreach test (702c9aa)
+
+ Windows:
+ o use FormatMessage for winsock errors (0c6ec5d, 2078e9b, 4ccdd53, c9ad3af
+ Patrick Pelletier)
+ o a program to print out the error strings for winsock errors (7296512
+ Patrick Pelletier)
+ o Fix a warning introduced in 0c6ec5d8 (eeb700c)
+ o Fix another warning introduced in 0c6ec5d8 (ed26561)
+
+ Examples (http)
+ o Add sample/https-client.c, an example of stacking evhttp as a client on
+ top of bufferevent_ssl. (be46c99 Catalin Patulea)
+ o use ${OPENSSL_LIBS} instead of -lssl -lcrypto (bf31fa5 Patrick Pelletier)
+ o https-client was putting newlines at 256-byte boundaries (42d7441 Patrick
+ Pelletier)
+ o better handling of OpenSSL errors (5754d96 Patrick Pelletier)
+ o use Debian's default root certificate location (aacd674 Patrick Pelletier)
+ o use iSECPartners code to validate hostname in certificate (64d9f16
+ Patrick Pelletier)
+ o avoid sign mismatch warning in openssl_hostname_validation.c (6021cb5
+ Patrick Pelletier)
+ o pull in wildcard matching code from cURL (4db9da6 Patrick Pelletier)
+ o Another tweak to https-client.c (95acdaa)
+ o Remove http_struct.h usage in sample/https-client.c (8a90a85)
+
+
+
+Changes in version 2.1.2-alpha (18 Nov 2012)
+
+ Libevent 2.1.2-alpha includes more portable for monotonic timers,
+ refactors much of Libevent's internal and external infrastructure,
+ closes some longstanding gaps in the interface, makde other
+ improvements. Ths log below tries to organize features by rough area of
+ effect. It omits a few commits which were pure bugfixes on other commits
+ listed below. For more detail, see the git changelogs. For more
+ insight, see the "whatsnew-2.1.txt" document included in the Libevent
+ 2.1.2-alpha distribution.
+
+ Libevent 2.1.2-alpha also includes all changes made in 2.0.19-stable
+ through 2.0.21-stable inclusive.
+
+ Performance (core):
+ o Replace pipe-based notification with EVFILT_USER where possible. This
+ should make multithreaded programs on OSX and *BSD alert the main thread a
+ little faster. (53a07fe)
+ o Make th_base_lock nonrecursive. (9cd5acb)
+
+ New/Changed API Functions:
+ o New event_get_priority() function to return an event's priority (f90e255)
+ o Add a bufferevent_get_priority() function (bd39554)
+ o Add an event_base_loopcontinue() to tell Libevent to rescan for more
+ events right away (7d6aa5e)
+ o Add a new callback to get called on evbuffer_file_segment free
+ (e9f8feb yangacer, 64051b9)
+ o Expose event_base_foreach_event() as a public API. (84fd6d7 Roman
+ Puls, 232055e, ffe1643)
+ o Add an event_remove_timer() to remove timer on an event without
+ deleting it (e3b2e08)
+ o Make bufferevent_set_timeouts(bev, NULL, NULL) have plausible
+ semantics (9dee36b)
+ o Rename event_enable_lock_debuging() to ..._debugging(). (The old name
+ should still work.) (07e132e)
+ o Add missing implementation for event_enable_debug_logging (3b3e21d)
+
+ PORTABLE MONOTONIC TIMERS:
+
+ Libevent 2.1.2 includes internal support for monotonic timers on
+ (nearly) all supported platforms, including Windows, and OSX. Libevent
+ applications should now be more resilient to jumps forwards or backwards
+ in the system clock. Also, on Linux systems with epoll, we now
+ optionally support microsecond-level timeouts (whereas epoll only
+ supports millisecond-precision timeouts).
+
+ o Use mach_absolute_time() for monotonic clock support on OSX. (b8fd6f9)
+ o Do not track use_monotonic field when is no monotonic clock (cb653a0)
+ o EVENT_BASE_FLAG_PRECISE_TIMER indicates we want fine timer precision
+ (ddd69d3)
+ o On Linux, use CLOCK_MONOTONIC_COARSE by default (55780a7)
+ o Implement a GetTickCount-based monotonic timer for Windows (d5e1d5a)
+ o Refactor monotonic timer handling into a new type and set of
+ functions; add a gettimeofday-based ratcheting implementation (f5e4eb0)
+ o Add EVENT_PRECISE_TIMER environment var for selecting precise-but-slow
+ timer (a2598ec)
+ o Implement fast/precise monotonic clocks on Windows (2c47045)
+ o Simple unit tests for monotonic timers (630f077)
+ o Improve the monotonic-time unit test: make it check the step size (7428c78)
+ o When PRECISE_TIMERS is set with epoll, use timerfd for microsecond
+ precision (26c7582)
+ o Split out time-related evutil functions into a new evutil_time.c (c419485)
+ o Split out time-related prototypes into time-internal.h (71bca50)
+ o Add evutil_time.obj to Makefile.nmake (0ba0683)
+ o Avoid giving a spurious warning when timerfd support is unavailable
+ (1aaf9f0 Dave Hart)
+ o Make test_evutil_monotonic a little more tolerant (def3b83)
+ o Avoid unused-var warning on systems with clock_gettime but without
+ CLOCK_MONOTONIC_COARSE (9be5468)
+
+EVENT_BASE_ONCE LEAKS:
+ If a callback added by event_base_once() is never invoked, Libevent no
+ longer leaks internal memory.
+
+ o Free dangling event_once objects on event_base_free() (c17dd59)
+ o Add a unit test in which an event is created with event_base_once()
+ but never fires (4343edf)
+
+TESTING SUPPORT, FIXES AND IMPROVEMENTS:
+
+ Libevent now disables by default its unit tests that would touch the
+ network, or that tend to fail on heavily-loaded systems. To re-enable
+ them, invoke the ./test/regress program with the @all alias.
+
+ o Simplify test.sh code significantly. (9b856fd Ross Lagerwall)
+ o Make all tests that hit the network disabled by default (f2cea87)
+ o Avoid a resource leak on error in http client benchmark (ea92fba)
+ o Update to latest tinytest (911b4f0349377) (ef7c4f7)
+ o Avoid (unlikely) overflow in bench_httpclient.c (5671033)
+ o Shave 700 msec off the persistent_timeout_jump test (21205b8)
+ o Check return value of write() in regress.c (c8009d2)
+ o Make load-dependent monotonic timer tests off-by-default (2b6fe8b)
+ o Add deferred_cb_skew to list of timing-dependent tests (34c8f31)
+ o Avoid test -e; older shs don't have one. (f1bd938)
+ o Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086)
+ o Fix a couple of compile warnings in the unit tests (5a9a014)
+
+MISC:
+ o Change evutil_weakrand_() to avoid platform random() (e86af4b Nicholas
+ Marriott, 3aa4415)
+
+INFRASTRUCTURE (Active-later events):
+ As a simplification and optimization to Libevent's "deferred callback"
+ logic (introduced in 2.0 to avoid callback recursion), Libevent now
+ treats all of its deferrable callback types using the same logic it uses
+ for active events. Now deferred events no longer cause priority
+ inversion, no longer require special code to cancel them, and so on.
+
+ o Refactor the callback part of an event into its own event_callback
+ type (cba59e5)
+ o Add "active later" event_callbacks to supersede deferred (745a63d)
+ o event_base_assert_ok: check value of event_active_count for
+ correctness (fec8bae)
+ o Replace deferred_cbs with event_callback-based implementation. (ae2b84b)
+ o Replace more deferred_cb names with event_callback (a4079aa)
+ o Give event_base_process_active a single exit path (581b5be)
+ o Restore our priority-inversion-prevention code with deferreds (c0e425a)
+ o Refactor event_persist_closure: raise and extract some common logic
+ (bec22b4)
+ o Remove the unused bits from EVLIST_ALL (9889a3d)
+
+BUILD IMPROVEMENTS:
+ Libevent 2.1.2-alpha modernizes Libevent's use of autotools, and makes
+ numerous other build system. Parallel builds should be faster, and all
+ builds should be quieter.
+
+ o Split long lists in Makefile.am into one-item-per-line (2711cda)
+ o Remove unnecessary code in configure.in. (e65914f Ross Lagerwall)
+ o attempt to support OpenSSL in Makefile.nmake (eba0eb2 Patrick Pelletier)
+ o Use newer syntax for autoconf/automake init (7d60ba8)
+ o Enable silent build rules by default. Override with V=1 (7b18e5c)
+ o Switch to non-recursive makefiles (7092f3b)
+ o Rename subordinate Makefile.ams to include.am (6cdfeeb)
+ o Make quiet build even quieter (371a123)
+ o New --quiet option for event_rpcgen.py (aa59c1e)
+ o Be quiet when making regress.gen.[ch] (607a8ff)
+ o Fix handling of no-python case for nonrecursive make (1e3123d)
+ o We now require automake 1.9 or later. Modernize! (b7f6e89)
+ o Rename configure.in to configure.ac. (b3fea67 Ross Lagerwall)
+ o Use correct openssl libs and includes in pkgconfig file (d70af27)
+ o Use the same CFLAGS for openssl when building unit tests as with
+ libevent (1d9d511)
+
+DOCUMENTATION
+ o Note that make_base_notifiable should not be necessary (26ee5f9)
+ o Be more clear that LEV_OPT_DEFERRED_ACCEPT has tricky prereqs (371efeb)
+ o Add caveat to docs about bufferevent_free() with data in outbuf (6fab9ee)
+ o Make it more clear that NOLOCK means "I promise, no multithreading"
+ (9444524)
+ o Fix a comment in test-fdleak after 077c7e949. (3881d8f Ross Lagerwall)
+ o Make the Makefile.nmake warning slightly less dire (e7bf4c8)
+ o Fix typo : events instead of evets (05f1aca Azat Khuzhin)
+ o Additional comments about OPENSSL_DIR variable, prompted by Dave Hart
+ (6bde2ef Patrick Pelletier)
+
+EVHTTP:
+ o ignore LWS after field-content in headers (370a2c0 Artem Germanov)
+ o Clean up rtrim implementation (aa59d80)
+ o Remove trailing tabs in HTTP headers as well. (ac42519)
+ o Remove internal ws from multiline http headers correctly (c6ff381)
+ o Move evutil_rtrim_lws_ to evutil.c where it belongs (61b93af)
+ o add evhttp_request_get_response_code_line (4f4d0c9 Jay R. Wren)
+ o Use EVUTIL_SOCKET_ERROR() wrapper to save/restore errno in
+ evhttp_connection_fail_ (7afbd60)
+ o preserve errno in evhttp_connection_fail_ for inspection by the
+ callback (36d0ee5 Patrick Pelletier)
+
+BUGFIXES:
+ o Correctly handle running on a system where accept4 doesn't work. (9fbfe9b)
+ o Avoid double-free on error in evbuffer_add_file. Found by
+ coverity. (6a81b1f)
+ o Fix another possible uninitialized read in dns regression tests. Found
+ by coverity. (13525c5)
+ o Add checks for functions in test-ratelim.c; found by Coverity (aa501e1)
+ o Avoid memory leak in test_event_calloc unit test; found by coverity
+ (92817a1)
+ o Fix a shadowed variable in addfile_test_readcb; found by coverity
+ (225344c)
+ o Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by
+ coverity (6487f63)
+ o Prevent reference leak of bufferevent if getaddrinfo fails. (b757786
+ Joachim Bauch)
+ o Make event_base_getnpriorities work with old "implicit base" code
+ (c46cb9c)
+ o Simplify and correct evutil_open_closeonexec_ (0de587f)
+ o Fix event_dlist definition when sys/queue not included (81b6209
+ Derrick Pallas)
+
+
+
+Changes in version 2.1.1-alpha (4 Apr 2012)
+
+ Libevent 2.1.1-alpha includes a number of new features and performance
+ improvements. The log below tries to organize them by rough area of
+ effect. It omits some commits which were pure bugfixes on other commits
+ listed below. For more detail, see the git changelogs. For more
+ insight, see the "whatsnew-2.1.txt" document included in the Libevent
+ 2.1.1-alpha distribution.
+
+ Performance: Core
+ o Replace several TAILQ users with LIST. LIST can be a little faster than
+ TAILQ for cases where we don't need queue-like behavior. (f9db33d,
+ 6494772, d313c29, 974d004)
+ o Disabled code to optimize the case where we reinsert an existing
+ timeout (e47042f, 09cbc3d)
+ o Remove a needless base-notify when rescheduling the first timeout (77a96fd)
+ o Save a needless comparison when removing/adjusting timeouts (dd5189b)
+ o Possible optimization: split event_queue_insert/remove into
+ separate functions. needs testing (efc4dc5)
+ o Make event_count maintenance branchless at the expense of an
+ extra shift. Needs benchmarking (d1cee3b)
+ o In the 2.1 branch, let's try out lazy gettimeofday/clock_gettime
+ comparison (2a83ecc)
+ o Optimization in event_process_active(): ignore maxcb & endtime
+ for highest priority events. (a9866aa Alexander Drozdov)
+ o Bypass event_add when using event_base_once() for a 0-sec timeout (35c5c95)
+ o Remove the eventqueue list and the ev_next pointers. (604569b 066775e)
+
+ Performance: Evbuffers
+ o Roughly 20% speed increase when line-draining a buffer using
+ EVBUFFER_EOL_CRLF (5dde0f0 Mina Naguib)
+ o Try to squeeze a little more speed out of EVBUFFER_EOL_CRLF (7b9d139)
+ o Fix a bug in the improved EOL_CRLF code (d927965)
+ o Remove a needless branch in evbuffer_drain() (d19a326)
+
+ Performance: Linux
+ o Infrastructure for using faster/fewer syscalls when creating
+ sockets (a1c042b)
+ o Minimize syscalls during socket creation in listener.c (7e9e289)
+ o Use a wrapper function to create the notification
+ pipe/socketpair/eventfd (ca76cd9)
+ o Use pipes for telling signals to main thread when possible (a35f396)
+ o Save syscalls when constructing listener sockets for evhttp (af6c9d8)
+ o Save some syscalls when creating evdns sockets (713e570)
+ o Save some syscalls when constructing a socket for a bufferevent (33fca62)
+ o Prefer epoll_create1 on Linuxen that have it (bac906c)
+
+ Performance: Epoll backend
+ o Use current event set rather than current pending change when
+ deciding whether to no-op a del (04ba27e Mike Smellie)
+ o Replace big chain of if/thens in epoll.c with a table lookup (8c83eb6)
+ o Clean up error handling in epoll_apply_one_change() a little (2d55a19)
+
+ Performance: Evport backend
+ o evport: use evmap_io to track fdinfo status. Should save time and
+ RAM. (4687ce4)
+ o evport: Remove a linear search over recent events when
+ reactivating them (0f77efe)
+ o evport: Use portev_user to remember fdinfo struct (276ec0e)
+ o evport: don't scan more events in ed_pending than needed (849a5cf)
+ o evport: Remove artificial low limit on max events per getn call (c04d927)
+ o Reenable main/many_events_slow_add for evport in 2.1 (e903db3)
+
+ Performance: Windows
+ o Use GetSystemTimeAsFileTime to implement gettimeofday on
+ win32. It's faster and more accurate than our old
+ approach. (b8b8aa5)
+
+ New functions and features: debugging
+ o Add event_enable_debug_logging() to control use of debug logs (e30a82f)
+
+ New functions and features: core
+ o Add event_config function to limit time/callbacks between calls
+ to dispatch (fd4de1e, 9fa56bd, a37a0c0, 3c63edd)
+ o New EVLOOP_NO_EXIT_ON_EMPTY option to keep looping even when no
+ events are pending (084e68f)
+ o Add event_base_get_npriorities() function. (ee3a4ee Alexander Drozdov)
+ o Make evbase_priority_init() and evbase_get_npriorities()
+ threadsafe (3c55b5e)
+ o New event_base_update_cache_time() to set cached_tv to current
+ time (212533e Abel Mathew)
+ o Add event_self_cbarg() to be used in conjunction with
+ event_new(). (ed36e6a Ross Lagerwall, fa931bb, 09a1906, 1338e6c,
+ 33e43ef)
+ o Add a new libevent_global_shutdown() to free all globals before
+ exiting. (041ca00 Mark Ellzey, f98c158, 15296d0, 55e991b)
+ o Use getifaddrs to detect our interfaces if possible (7085a45)
+ o Add event_base_get_running_event() to get the event* whose cb we
+ are in (c5732fd, 13dad99)
+
+ New functions and features: building
+ o Implement --enable-gcc-hardening configure option (7550267 Sebastian Hahn)
+
+ New functions and features: evbuffers
+ o Add evbuffer_add_file_segment() so one fd can be used efficiently
+ in more than one evbuffer_add_file at a time (e72afae, c2d9884,
+ 3f405d2, 0aad014)
+ o Fix windows file segment mappings (8254de7)
+ o Allow evbuffer_ptr_set to yield a point just after the end of the
+ buffer. (e6fe1da)
+ o Allow evbuffer_ptr to point to position 0 in an empty evbuffer
+ (7aeb2fd Nir Soffer)
+ o Set the special "not found" evbuffer_ptr consistently. (e3e97ae Nir Soffer)
+ o support adding buffers to other buffers non-destructively
+ (9d7368a Joachim Bauch)
+ o prevent nested multicast references, reworked locking (26041a8
+ Joachim Bauch)
+ o New EVBUFFER_EOL_NUL to read NUL-terminated strings from an
+ evbuffer (d7a8b36 Andrea Montefusco, 54142c9)
+ o Make evbuffer_file_segment_types adaptable (c6bbbf1)
+ o Added evbuffer_add_iovec and unit tests. (aaec5ac Mark Ellzey, 27b5398)
+ o Add evbuffer_copyout_from to copy data from the middle of a
+ buffer (27e2225)
+
+ New functions and features: bufferevents
+ o Allow users to set allow_dirty_shutdown (099d27d Catalin Patulea)
+ o Tweak allow_dirty_shutdown documentation (a44cd2b)
+ o Fix two issues in the allow_dirty_shutdown code. (f3b89de)
+ o Add a bufferevent_getcb() to find a bufferevent's current
+ callbacks (a650394)
+ o bufferevent: Add functions to set/get max_single_read/write
+ values. (998c813 Alexander Drozdov)
+ o bev_ssl: Be more specific in event callbacks. evhttp in particular gets
+ confused without at least one of BEV_EVENT_{READING|WRITING}. (f7eb69a
+ Catalin Patulea)
+
+ New functions and features: evconnlisteners
+ o Support TCP_DEFER_ACCEPT sockopts for listeners (5880e4a Mark Ellzey,
+ a270728)
+ o Add another caveat to the TCP_DEFER_ACCEPT documentation (a270728)
+ o Allow evconnlistener to be created in disabled state. (9593a33
+ Alexander Drozdov)
+ o The LEV_OPT_CLOSE_ON_EXEC flag now applies to accepted listener
+ sockets too (4970329)
+
+ Evhttp:
+ o Add new evhttp_{connection_}set_timeout_tv() functions to set
+ finger-grained http timeouts (6350e6c Constantine Verutin)
+ o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey)
+ o Add missing break to evhttp_parse_request_line (0fcc536)
+ o Add evhttp callback for bufferevent creation; this lets evhttp
+ support SSL. (8d3a850)
+ o Remove calls to deprecated bufferevent functions from evhttp.c (4d63758)
+ o evhttp: Add evhttp_foreach_bound_socket. (a2c48e3 Samy Al Bahra)
+
+ Build improvements:
+ o Add AC_USE_SYSTEM_EXTENSIONS to configure.in. Requires follow on
+ patches for correctness and robustness. (1fa7dbe Kevin Bowling)
+ o Filter '# define' statements from autoconf and generate
+ event-private.h (321b558 Kevin Bowling)
+ o Remove internal usage of _GNU_SOURCE (3b26541 Kevin Bowling)
+ o Eliminate a couple more manual internal _GNU_SOURCE defines (c51ef93
+ Kevin Bowling)
+ o Add AC_GNU_SOURCE to the fallback case. (ea8fa4c Kevin Bowling)
+ o Use a Configuration Header Template for evconfig-private.h (868f888
+ Kevin Bowling)
+ o Fix a comment warning and add evconfig-private.h to .gitignore
+ (f6d66bc Kevin Bowling)
+ o Include evconfig-private.h in internal files for great good. (0915ca0
+ Kevin Bowling)
+ o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5)
+ (ad03952 Kevin Bowling)
+ o Prefer the ./configure evconfig-private.h in MinGW, just in
+ case. (f964b72 Kevin Bowling)
+ o Shell hack for weird mkdir -p commands (fd7b5a8 Kevin Bowling)
+ o Add evconfig-private to remaining files (ded0a09 Kevin Bowling)
+ o Allow use of --enable-silent-rules for quieter compilation with
+ automake 1.11 (f1f8514 Dave Hart)
+ o Use "_WIN32", not WIN32: it's standard and we don't need to fake it
+ (9f560b)
+ o In configure, test for _WIN32 not WIN32. (85078b1 Peter Rosin)
+ o Do not define WIN32 in Makefile.nmake (d41f3ea Peter Rosin)
+ o Provide the autoconf m4 macros for the new OpenSSL via pkg-config
+ stuff. (674dc3d Harlan Stenn)
+ o Use pkg-config (if available) to handle OpenSSL. (1c63860 Harlan Stenn)
+ o We need AM_CPPFLAGS when compiling bufferevent_openssl.c (6d2613b
+ Harlan Stenn)
+ o Fix OSX build: $(OPENSSL_INCS) needs to be after
+ $(AM_CPPFLAGS). (46f1769 Zack Weinberg)
+ o Make gcc warnings on by default, and --enable-gcc-warnings only add
+ -Werror (d46517e Sebastian Hahn)
+ o Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in (88a30ad)
+ o Move libevent 1.x headers to include/, to put all public headers in
+ one place. (bbea8d6)
+ o Put #ifdef around some files to support alternate build
+ systems. (76d4c92 Ross Lagerwall)
+ o Also make win32select.c conditional for IDE users (bf2c5a7)
+
+ Debugging:
+ o Add a magic number to debug_locks to better catch lock-coding
+ errors. (b4a29c0 Dave Hart)
+ o munge the debug_lock signature before freeing it: it might help us
+ catch use-after-free (f28084d)
+ o Added --enable-event-debugging in configure (bc7b4e4, a9c2c9a Mark Ellzey)
+ o Debug addition for printing usec on TIMEOUT debugging. (ac43ce0 Mark Ellzey)
+ o Added usec debug in another area for debug (3baab0d Mark Ellzey)
+ o added timeout debug logs to include event ptr. (4b7d298 Mark Ellzey)
+ o more event dbg updates (6727543 Mark Ellzey)
+ o Clarify event_enable_debug_logging a little (6207826)
+ o Make --enable-verbose-debug option match its help text (10c3450)
+ o Add argument checks to some memory functions in `event.c'. (c8953d1
+ Mansour Moufid)
+
+ Testing:
+ o More abstraction in test.sh (cd74c4e)
+ o Add failing test for evbuffer_search_range. (8e26154 Nir Soffer)
+ o Tweaks to return types with end-of-buf ptrs (9ab8ab8)
+ o Add an (internal) usleep function for use by unit tests (f25d9d3)
+ o Synchronize with upstream tinytest (6c81be7)
+ o Make test-changelist faster (7622d26)
+ o Reduce the timeout in the main/fork test. (ab14f7c)
+ o New evhttp function to adjust initial retry timeout (350a3c4)
+ o Make regression tests run over 3x faster. (67a1763)
+ o Use test_timeval_diff_eq more consistently (b77b43f)
+ o Allow more slop in deferred_cb_skew test; freebsd needs it (b9f7e5f)
+ o When including an -internal.h header outside the main tree, do so
+ early (95e2455)
+ o Add a new test: test-fdleak which tests for fd leaks by creating many
+ sockets. (2ef9278 Ross Lagerwall, f7af194, 1c4288f, etc)
+ o Add a unit test for event_base_dump_events() (7afe48a, 8d08cce)
+ o Test more bufferevent_ratelim features (c24f91a)
+
+ Documentation:
+ o Improve evbuffer_ptr documentation (261ba63)
+ o added comments to describe refcounting of multicast chains (ba24f61
+ Joachim Bauch)
+ o Add doxygen for event_base_dump_events (cad5753)
+
+ OSX:
+ o Use "unlimited select" on OSX so that we can have more than
+ FD_SETSIZE fds (1fb5cc6)
+
+ KQueue:
+ o Use SIG_IGN instead of a do-nothing handler for signal events with
+ kqueue (148458e Zack Weinberg)
+
+ evprc:
+ o event_rpcgen.py now prints status information to stdout and errors to
+ stderr. (ffb0ba0 Ross Lagerwall)
+
+ Code improvement and refactoring:
+ o Make event_reinit() more robust and maintainable (272033e)
+ o Restore fast-path event_reinit() for slower backends (2c4b5de)
+ o Check changelist as part of checking representational integrity (39b3f38)
+ o Fix a compile warning in event_reinit (e4a56ed Sebastian Hahn)
+ o Refactor the functions that run over every event. (c89b4e6)
+ o Remove the last vestiges of _EVENT_USE_EVENTLIST (a3cec90)
+ o Make event-config.h depend on Makefile.am (2958a5c)
+
+ Build fixes:
+ o Don't do clang version detection when disabling some flags (083296b
+ Sebastian Hahn)
+
+ C standards conformance:
+ o Check for NULL return on win32 mm_calloc, and set ENOMEM. (af7ba69)
+ o Convert event-config.h macros to avoid reserved identifiers (68120d9)
+ o Generate event-config.h using the correct macros. (f82c57e)
+ o Convert include-guard macro convention to avoid reserved identifiers
+ (3f8c7cd)
+ o Make event_rpcgen.py output conform to identifier conventions (372bff1)
+ o Stop referring to an obsolete include guard in bench_http.h (5c0f7e0)
+ o Make the generated event-config.h use correct include guards (639383a)
+ o Fix all identifiers with names beginning with underscore. (cb9da0b)
+ o Make event_rpcgen.py output conform to identifier conventions, more
+ (bcefd24)
+ o Fix some problems introduced by automated identifier cleanup script
+ (c963534)
+ o Have all visible internal function names end with an underscore. (8ac3c4c)
+ o Apply the naming convention to our EVUTIL_IS* functions (c7848fa)
+ o Clean up lingering _identifiers. (946b584)
+ o Fix doxygen to use new macro conventions (da455e9)
+
+ Bugfixes:
+ o Do not use system EAI/AI values if we are not using the system
+ getaddrinfo. (7bcac07)
+
+ Sample Code:
+ o Fix up sample/event-test.c to use newer interfaces and make it
+ actually work. (19bab4f Ross Lagerwall)
+ o On Unix, remove event.fifo left by sample/event-test.c. (c0dacd2 Ross
+ Lagerwall)
+ o Rename event-test.c to event-read-fifo.c. (a5b370a Ross Lagerwall)
+ o event-read-fifo: Use EV_PERSIST appropriately (24dab0b)
+
+
+
+
diff --git a/sntp/libevent/ChangeLog-1.4 b/sntp/libevent/ChangeLog-1.4
new file mode 100644
index 0000000..166d308
--- /dev/null
+++ b/sntp/libevent/ChangeLog-1.4
@@ -0,0 +1,231 @@
+Changes in 1.4.14b-stable
+ o Set the VERSION_INFO correctly for 1.4.14
+
+Changes in 1.4.14-stable
+ o Add a .gitignore file for the 1.4 branch. (d014edb)
+ o Backport evbuffer_readln(). (b04cc60 Nicholas Marriott)
+ o Make the evbuffer_readln backport follow the current API (c545485)
+ o Valgrind fix: Clear struct kevent before checking for OSX bug. (5713d5d William Ahern)
+ o Fix a crash when reading badly formatted resolve.conf (5b10d00 Yasuoka Masahiko)
+ o Fix memory-leak of signal handler array with kqueue. [backport] (01f3775)
+ o Update sample/signal-test.c to use newer APIs and not leak. (891765c Evan Jones)
+ o Correct all versions in 1.4 branch (ac0d213)
+ o Make evutil_make_socket_nonblocking() leave any other flags alone. (81c26ba Jardel Weyrich)
+ o Adjusted fcntl() retval comparison on evutil_make_socket_nonblocking(). (5f2e250 Jardel Weyrich)
+ o Correct a debug message in evhttp_parse_request_line (35df59e)
+ o Merge branch 'readln-backport' into patches-1.4 (8771d5b)
+ o Do not send an HTTP error when we've already closed or responded. (4fd2dd9 Pavel Plesov)
+ o Re-add event_siglcb; some old code _was_ still using it. :( (bd03d06)
+ o Make Libevent 1.4 build on win32 with Unicode enabled. (bce58d6 Brodie Thiesfield)
+ o Distribute nmake makefile for 1.4 (20d706d)
+ o do not fail while sending on http connections the client closed. (5c8b446)
+ o make evhttp_send() safe against terminated connections, too (01ea0c5)
+ o Fix a free(NULL) in min_heap.h (2458934)
+ o Fix memory leak when setting up priorities; reported by Alexander Drozdov (cb1a722)
+ o Clean up properly when adding a signal handler fails. (ae6ece0 Gilad Benjamini)
+ o Do not abort HTTP requests missing a reason string. (29d7b32 Pierre Phaneuf)
+ o Fix compile warning in http.c (906d573)
+ o Define _REENTRANT as needed on Solaris, elsewhere (6cbea13)
+
+
+Changes in 1.4.13-stable:
+ o If the kernel tells us that there are a negative number of bytes to read from a socket, do not believe it. Fixes bug 2841177; found by Alexander Pronchenkov.
+ o Do not allocate the maximum event queue and fd array for the epoll backend at startup. Instead, start out accepting 32 events at a time, and double the queue's size when it seems that the OS is generating events faster than we're requesting them. Saves up to 512K per epoll-based event_base. Resolves bug 2839240.
+ o Fix compilation on Android, which forgot to define fd_mask in its sys/select.h
+ o Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
+ o Rename our replacement compat/sys/_time.h header to avoid build a conflict on HPUX; reported by Kathryn Hogg.
+ o Build kqueue.c correctly on GNU/kFreeBSD platforms. Patch pulled upstream from Debian.
+ o Fix a problem with excessive memory allocation when using multiple event priorities.
+ o When running set[ug]id, don't check the environment. Based on a patch from OpenBSD.
+
+
+Changes in 1.4.12-stable:
+ o Try to contain degree of failure when running on a win32 version so heavily firewalled that we can't fake a socketpair.
+ o Fix an obscure timing-dependent, allocator-dependent crash in the evdns code.
+ o Use __VA_ARGS__ syntax for varargs macros in event_rpcgen when compiler is not GCC.
+ o Activate fd events in a pseudorandom order with O(N) backends, so that we don't systematically favor low fds (select) or earlier-added fds (poll, win32).
+ o Fix another pair of fencepost bugs in epoll.c. [Patch from Adam Langley.]
+ o Do not break evdns connections to nameservers when our IP changes.
+ o Set truncated flag correctly in evdns server replies.
+ o Disable strict aliasing with GCC: our code is not compliant with it.
+
+Changes in 1.4.11-stable:
+ o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen]
+ o Remove the limit on size of HTTP headers by removing static buffers.
+ o Fix a nasty dangling pointer bug in epoll.c that could occur after epoll_recalc(). [Patch from Kevin Springborn]
+ o Distribute Win32-Code/event-config.h, not ./event-config.h
+
+Changes in 1.4.10-stable:
+ o clean up buffered http connection data on reset; reported by Brian O'Kelley
+ o bug fix and potential race condition in signal handling; from Alexander Drozdov
+ o rename the Solaris event ports backend to evport
+ o support compilation on Haiku
+ o fix signal processing when a signal callback delivers a signal; from Alexander Drozdov
+ o const-ify some arguments to evdns functions.
+ o off-by-one error in epoll_recalc; reported by Victor Goya
+ o include Doxyfile in tar ball; from Jeff Garzik
+ o correctly parse queries with encoded \r, \n or + characters
+
+Changes in 1.4.9-stable:
+ o event_add would not return error for some backends; from Dean McNamee
+ o Clear the timer cache on entering the event loop; reported by Victor Chang
+ o Only bind the socket on connect when a local address has been provided; reported by Alejo Sanchez
+ o Allow setting of local port for evhttp connections to support millions of connections from a single system; from Richard Jones.
+ o Clear the timer cache when leaving the event loop; reported by Robin Haberkorn
+ o Fix a typo in setting the global event base; reported by lance.
+ o Fix a memory leak when reading multi-line headers
+ o Fix a memory leak by not running explicit close detection for server connections
+
+Changes in 1.4.8-stable:
+ o Match the query in DNS replies to the query in the request; from Vsevolod Stakhov.
+ o Fix a merge problem in which name_from_addr returned pointers to the stack; found by Jiang Hong.
+ o Do not remove Accept-Encoding header
+
+Changes in 1.4.7-stable:
+ o Fix a bug where headers arriving in multiple packets were not parsed; fix from Jiang Hong; test by me.
+
+Changes in 1.4.6-stable:
+ o evutil.h now includes <stdarg.h> directly
+ o switch all uses of [v]snprintf over to evutil
+ o Correct handling of trailing headers in chunked replies; from Scott Lamb.
+ o Support multi-line HTTP headers; based on a patch from Moshe Litvin
+ o Reject negative Content-Length headers; anonymous bug report
+ o Detect CLOCK_MONOTONIC at runtime for evdns; anonymous bug report
+ o Fix a bug where deleting signals with the kqueue backend would cause subsequent adds to fail
+ o Support multiple events listening on the same signal; make signals regular events that go on the same event queue; problem report by Alexander Drozdov.
+ o Deal with evbuffer_read() returning -1 on EINTR|EAGAIN; from Adam Langley.
+ o Fix a bug in which the DNS server would incorrectly set the type of a cname reply to a.
+ o Fix a bug where setting the timeout on a bufferevent would take not effect if the event was already pending.
+ o Fix a memory leak when using signals for some event bases; reported by Alexander Drozdov.
+ o Add libevent.vcproj file to distribution to help with Windows build.
+ o Fix a problem with epoll() and reinit; problem report by Alexander Drozdov.
+ o Fix off-by-one errors in devpoll; from Ian Bell
+ o Make event_add not change any state if it fails; reported by Ian Bell.
+ o Do not warn on accept when errno is either EAGAIN or EINTR
+
+Changes in 1.4.5-stable:
+ o Fix connection keep-alive behavior for HTTP/1.0
+ o Fix use of freed memory in event_reinit; pointed out by Peter Postma
+ o Constify struct timeval * where possible; pointed out by Forest Wilkinson
+ o allow min_heap_erase to be called on removed members; from liusifan.
+ o Rename INPUT and OUTPUT to EVRPC_INPUT and EVRPC_OUTPUT. Retain INPUT/OUTPUT aliases on on-win32 platforms for backwards compatibility.
+ o Do not use SO_REUSEADDR when connecting
+ o Fix Windows build
+ o Fix a bug in event_rpcgen when generated fixed-sized entries
+
+Changes in 1.4.4-stable:
+ o Correct the documentation on buffer printf functions.
+ o Don't warn on unimplemented epoll_create(): this isn't a problem, just a reason to fall back to poll or select.
+ o Correctly handle timeouts larger than 35 minutes on Linux with epoll.c. This is probably a kernel defect, but we'll have to support old kernels anyway even if it gets fixed.
+ o Fix a potential stack corruption bug in tagging on 64-bit CPUs.
+ o expose bufferevent_setwatermark via header files and fix high watermark on read
+ o fix a bug in bufferevent read water marks and add a test for them
+ o introduce bufferevent_setcb and bufferevent_setfd to allow better manipulation of bufferevents
+ o use libevent's internal timercmp on all platforms, to avoid bugs on old platforms where timercmp(a,b,<=) is buggy.
+ o reduce system calls for getting current time by caching it.
+ o fix evhttp_bind_socket() so that multiple sockets can be bound by the same http server.
+ o Build test directory correctly with CPPFLAGS set.
+ o Fix build under Visual C++ 2005.
+ o Expose evhttp_accept_socket() API.
+ o Merge windows gettimeofday() replacement into a new evutil_gettimeofday() function.
+ o Fix autoconf script behavior on IRIX.
+ o Make sure winsock2.h include always comes before windows.h include.
+
+Changes in 1.4.3-stable:
+ o include Content-Length in reply for HTTP/1.0 requests with keep-alive
+ o Patch from Tani Hosokawa: make some functions in http.c threadsafe.
+ o Do not free the kqop file descriptor in other processes, also allow it to be 0; from Andrei Nigmatulin
+ o make event_rpcgen.py generate code include event-config.h; reported by Sam Banks.
+ o make event methods static so that they are not exported; from Andrei Nigmatulin
+ o make RPC replies use application/octet-stream as mime type
+ o do not delete uninitialized timeout event in evdns
+
+Changes in 1.4.2-rc:
+ o remove pending timeouts on event_base_free()
+ o also check EAGAIN for Solaris' event ports; from W.C.A. Wijngaards
+ o devpoll and evport need reinit; tested by W.C.A Wijngaards
+ o event_base_get_method; from Springande Ulv
+ o Send CRLF after each chunk in HTTP output, for compliance with RFC2626. Patch from "propanbutan". Fixes bug 1894184.
+ o Add a int64_t parsing function, with unit tests, so we can apply Scott Lamb's fix to allow large HTTP values.
+ o Use a 64-bit field to hold HTTP content-lengths. Patch from Scott Lamb.
+ o Allow regression code to build even without Python installed
+ o remove NDEBUG ifdefs from evdns.c
+ o update documentation of event_loop and event_base_loop; from Tani Hosokawa.
+ o detect integer types properly on platforms without stdint.h
+ o Remove "AM_MAINTAINER_MODE" declaration in configure.in: now makefiles and configure should get re-generated automatically when Makefile.am or configure.in chanes.
+ o do not insert event into list when evsel->add fails
+
+Changes in 1.4.1-beta:
+ o free minheap on event_base_free(); from Christopher Layne
+ o debug cleanups in signal.c; from Christopher Layne
+ o provide event_base_new() that does not set the current_base global
+ o bufferevent_write now uses a const source argument; report from Charles Kerr
+ o better documentation for event_base_loopexit; from Scott Lamb.
+ o Make kqueue have the same behavior as other backends when a signal is caught between event_add() and event_loop(). Previously, it would catch and ignore such signals.
+ o Make kqueue restore signal handlers correctly when event_del() is called.
+ o provide event_reinit() to reintialize an event_base after fork
+ o small improvements to evhttp documentation
+ o always generate Date and Content-Length headers for HTTP/1.1 replies
+ o set the correct event base for HTTP close events
+ o New function, event_{base_}loopbreak. Like event_loopexit, it makes an event loop stop executing and return. Unlike event_loopexit, it keeps subsequent pending events from getting executed. Patch from Scott Lamb
+ o Removed obsoleted recalc code
+ o pull setters/getters out of RPC structures into a base class to which we just need to store a pointer; this reduces the memory footprint of these structures.
+ o fix a bug with event_rpcgen for integers
+ o move EV_PERSIST handling out of the event backends
+ o support for 32-bit tag numbers in rpc structures; this is wire compatible, but changes the API slightly.
+ o prefix {encode,decode}_tag functions with evtag to avoid collisions
+ o Correctly handle DNS replies with no answers set (Fixes bug 1846282)
+ o The configure script now takes an --enable-gcc-warnigns option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.)
+ o When building with GCC, use the "format" attribute to verify type correctness of calls to printf-like functions.
+ o removed linger from http server socket; reported by Ilya Martynov
+ o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
+ o demote most http warnings to debug messages
+ o Fix Solaris compilation; from Magne Mahre
+ o Add a "Date" header to HTTP responses, as required by HTTP 1.1.
+ o Support specifying the local address of an evhttp_connection using set_local_address
+ o Fix a memory leak in which failed HTTP connections would not free the request object
+ o Make adding of array members in event_rpcgen more efficient, but doubling memory allocation
+ o Fix a memory leak in the DNS server
+ o Fix compilation when DNS_USE_OPENSSL_FOR_ID is enabled
+ o Fix buffer size and string generation in evdns_resolve_reverse_ipv6().
+ o Respond to nonstandard DNS queries with "NOTIMPL" rather than by ignoring them.
+ o In DNS responses, the CD flag should be preserved, not the TC flag.
+ o Fix http.c to compile properly with USE_DEBUG; from Christopher Layne
+ o Handle NULL timeouts correctly on Solaris; from Trond Norbye
+ o Recalculate pending events properly when reallocating event array on Solaris; from Trond Norbye
+ o Add Doxygen documentation to header files; from Mark Heily
+ o Add a evdns_set_transaction_id_fn() function to override the default
+ transaction ID generation code.
+ o Add an evutil module (with header evutil.h) to implement our standard cross-platform hacks, on the theory that somebody else would like to use them too.
+ o Fix signals implementation on windows.
+ o Fix http module on windows to close sockets properly.
+ o Make autogen.sh script run correctly on systems where /bin/sh isn't bash. (Patch from Trond Norbye, rewritten by Hagne Mahre and then Hannah Schroeter.)
+ o Skip calling gettime() in timeout_process if we are not in fact waiting for any events. (Patch from Trond Norbye)
+ o Make test subdirectory compile under mingw.
+ o Fix win32 buffer.c behavior so that it is correct for sockets (which do not like ReadFile and WriteFile).
+ o Make the test.sh script run unit tests for the evpoll method.
+ o Make the entire evdns.h header enclosed in "extern C" as appropriate.
+ o Fix implementation of strsep on platforms that lack it
+ o Fix implementation of getaddrinfo on platforms that lack it; mainly, this will make Windows http.c work better. Original patch by Lubomir Marinov.
+ o Fix evport implementation: port_disassociate called on unassociated events resulting in bogus errors; more efficient memory management; from Trond Norbye and Prakash Sangappa
+ o support for hooks on rpc input and output; can be used to implement rpc independent processing such as compression or authentication.
+ o use a min heap instead of a red-black tree for timeouts; as a result finding the min is a O(1) operation now; from Maxim Yegorushkin
+ o associate an event base with an rpc pool
+ o added two additional libraries: libevent_core and libevent_extra in addition to the regular libevent. libevent_core contains only the event core whereas libevent_extra contains dns, http and rpc support
+ o Begin using libtool's library versioning support correctly. If we don't mess up, this will more or less guarantee binaries linked against old versions of libevent continue working when we make changes to libevent that do not break backward compatibility.
+ o Fix evhttp.h compilation when TAILQ_ENTRY is not defined.
+ o Small code cleanups in epoll_dispatch().
+ o Increase the maximum number of addresses read from a packet in evdns to 32.
+ o Remove support for the rtsig method: it hasn't compiled for a while, and nobody seems to miss it very much. Let us know if there's a good reason to put it back in.
+ o Rename the "class" field in evdns_server_request to dns_question_class, so that it won't break compilation under C++. Use a macro so that old code won't break. Mark the macro as deprecated.
+ o Fix DNS unit tests so that having a DNS server with broken IPv6 support is no longer cause for aborting the unit tests.
+ o Make event_base_free() succeed even if there are pending non-internal events on a base. This may still leak memory and fds, but at least it no longer crashes.
+ o Post-process the config.h file into a new, installed event-config.h file that we can install, and whose macros will be safe to include in header files.
+ o Remove the long-deprecated acconfig.h file.
+ o Do not require #include <sys/types.h> before #include <event.h>.
+ o Add new evutil_timer* functions to wrap (or replace) the regular timeval manipulation functions.
+ o Fix many build issues when using the Microsoft C compiler.
+ o Remove a bash-ism in autogen.sh
+ o When calling event_del on a signal, restore the signal handler's previous value rather than setting it to SIG_DFL. Patch from Christopher Layne.
+ o Make the logic for active events work better with internal events; patch from Christopher Layne.
+ o We do not need to specially remove a timeout before calling event_del; patch from Christopher Layne.
diff --git a/sntp/libevent/ChangeLog-2.0 b/sntp/libevent/ChangeLog-2.0
new file mode 100644
index 0000000..a925d33
--- /dev/null
+++ b/sntp/libevent/ChangeLog-2.0
@@ -0,0 +1,1280 @@
+Changes in version 2.0.21-stable (18 Nov 2012)
+BUGFIXES:
+ o ssl: Don't discard SSL read event when timeout and read come close together (576b29f)
+ o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch)
+ o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch)
+ o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev)
+ o build: Use python2 rather than python (0eb0109 Ross Lagerwall)
+ o build: Compile without warnings on mingw64 (94866c2)
+ o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4)
+ o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4)
+ o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez)
+ o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3)
+ o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier)
+ o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086)
+ o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9)
+
+
+Changes in version 2.0.20-stable (23 Aug 2012)
+BUGFIXES:
+ o core: Make event_pending() threadsafe. (be7a95c Simon Liu)
+ o win32: avoid crash when waiting forever on zero fds. (160e58b)
+ o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31)
+ o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c)
+ o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67)
+ o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3)
+ o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel)
+ o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43)
+
+
+PORTABILITY FIXES:
+ o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel)
+ o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn)
+ o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6)
+
+BUILD FIXES:
+ o Add GCC annotations so that the vsprintf functions get checked properly (117e327)
+ o Fix an unused variable warning on *BSD. (c0720c1)
+
+UNIT TEST FIXES:
+ o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall)
+ o Remove deadcode in http regression tests. Found by coverity. (5553346)
+ o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777)
+ o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d)
+ o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d)
+ o Fix resource leaks in the unit tests; found by coverity (270f279)
+ o Add some missing null checks to unit tests; found by coverity (f021c3d)
+ o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf)
+ o Remove unused variable; spotted by coverity (6355b2a)
+ o Add checks to various return values in unit tests. Found by coverity (b9e7329)
+ o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0)
+
+
+
+Changes in version 2.0.19-stable (3 May 2012)
+BUGFIXES (CORE):
+ o Refactor event_persist_closure: raise and extract some common logic (bec22b4)
+ o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c)
+ o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40)
+
+BUGFIXES (SSL):
+ o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey)
+
+BUGFIXES (DNS):
+ o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel)
+ o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel)
+ o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a)
+
+DOCUMENTATION FIXES:
+ o Fix a typo in the bufferevent documentation (98e9119)
+ o Add missing ) to changelog; spotted by rransom (4c7ee6b)
+ o Fix the website URL in the readme (f775521)
+
+COMPILATION FIXES:
+ o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae)
+ o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn)
+ o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg)
+
+FORWARD-COMPATIBILITY:
+ o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2)
+
+TESTING/DEBUGGING SUPPORT:
+ o dns-example.c can now take a resolv.conf file on the commandline (6610fa5)
+ o Make some evdns.c debug logs more verbose (d873d67)
+ o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd)
+
+
+
+Changes in version 2.0.18-stable (22 Mar 2012)
+BUGFIXES (core):
+ o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42)
+
+BUGFIXES (kqueue):
+ o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn)
+
+BUILD FIXES:
+ o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey)
+ o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey)
+ o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn)
+
+BUGFIXES (dns):
+ o Stop crashing in evdns when nameserver probes give a weird error (bec5068)
+
+
+Changes in version 2.0.17-stable (10 Feb 2012)
+
+BUGFIXES (core):
+ o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5)
+ o check for sysctl before we use it (358c745 Mike Frysinger)
+ o Remove bogus casts of socket to int before calling ev_callback (f032516)
+ o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720)
+ o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc)
+ o Fix a fd leak in event_reinit() (3f18ad1)
+ o Do a memberwise comparison of threading function tables (c94a5f2 Nate R)
+ o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill)
+ o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6)
+ o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott)
+
+BUGFIXES (evbuffer and bufferevents):
+ o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg)
+ o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812)
+
+BUGFIXES (evhttp):
+ o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea)
+
+BUGFIXES (evdns):
+ o evdns: fix a bug in circular-queue implementation (d6094b1)
+
+BUILD FIXES:
+ o Fix a silly compilation error with the sun compiler (1927776 Colin Watt)
+ o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c)
+
+DOCUMENTATION FIXES:
+ o Slightly clarify evbuffer_peek documentation (7bbf6ca)
+ o Update copyright notices to 2012 (e49e289)
+
+NEW APIS:
+ o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker)
+
+TESTS AND TEST FIXES:
+ o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7)
+ o Add function to check referential integrity of an event_base (27737d5)
+ o Check event_base correctness at end of each unit test (3312b02)
+ o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187)
+ o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259)
+
+Changes in version 2.0.16-stable (18 Nov 2011)
+BUGFIXES (core):
+ o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov)
+ o epoll: close fd on alloc fail at initialization (1aee718 Jamie Iles)
+ o Fix compile warning from saying event2/*.h inside a comment (447b0ba)
+ o Warn when unable to construct base because of failing make_base_notifiable (4e797f3)
+ o Don't try to make notifiable event_base when no threading fns are configured (e787413)
+
+BUGFIXES (evbuffer):
+ o unit test for remove_buffer bug (90bd620 Greg Hazel)
+ o Fix an evbuffer crash in evbuffer_remove_buffer() (c37069c)
+
+BUGFIXES (bufferevent_openssl):
+ o Refactor amount-to-read calculations in buffervent_ssl consider_reading() (a186e73 Mark Ellzey)
+ o Move SSL rate-limit enforcement into bytes_to_read() (96c562f)
+ o Avoid spinning on OpenSSL reads (2aa036f Mark Ellzey)
+
+BUGFIXES (dns)
+ o Empty DNS reply with OK status is another way to say NODATA. (21a08d6 Leonid Evdokimov)
+
+TESTING:
+ o Tests for 94fba5b and f72e8f6 (d58c15e Leonid Evdokimov)
+ o Test for commit aff6ba1 (f7841bf Leonid Evdokimov)
+ o Style and comment tweaks for dns/leak* tests (5e42202)
+ o improve test to remove at least one buffer from src (7eb52eb Greg Hazel)
+
+DOCUMENTATION:
+ o Add note about evhttp_send_reply_end to its doxygen (724bfb5)
+ o Update copyright dates to 2011. (3c824bd)
+ o Fix typo in whatsnew-2.0.txt (674bc6a Mansour Moufid)
+ o Improve win32 behavior of dns-sample.c code (a3f320e Gisle Vanem)
+
+
+
+Changes in version 2.0.15-stable (12 Oct 2011)
+BUGFIXES (DNS):
+ o DNS: add ttl for negative answers using RFC 2308 idea. (f72e8f6 Leonid Evdokimov)
+ o Add DNS_ERR_NODATA error code to handle empty replies. (94fba5b Leonid Evdokimov)
+
+BUFGIXES (bufferevents and evbuffers):
+ o Make evbuffer callbacks get the right n_added value after evbuffer_add (1ef1f68 Alex)
+ o Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. (0ba0af9)
+
+BUGFIXES (event loop):
+ o When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run. (4e8eb6a)
+
+DOCUMENTATION FIXES:
+ o Fix docstring in dns.h (2b6eae5 Leonid Evdokimov)
+ o refer to non-deprecated evdns functions in comments (ba5c27d Greg Hazel)
+
+BUILD AND TESTING FIXES:
+ o le-proxy and regress depend on openssl directly (9ae061a Sergey Avseyev)
+ o Use _SOURCES, not _sources, in sample/Makefile.am (7f82382)
+ o Fixed compiler warnings for unchecked read/write calls. (c3b62fd Mark Ellzey)
+ o Make write-checking fixes use tt_fail_perror (2b76847)
+ o Fix some "value never used" warnings with gcc 4.6.1 (39c0cf7)
+
+
+
+Changes in version 2.0.14-stable (31 Aug 2011)
+BUGFIXES (bufferevents and evbuffers):
+ o Propagate errors on the underlying bufferevent to the user. (4a34394 Joachim Bauch)
+ o Ignore OpenSSL deprecation warnings on OS X (5d1b255 Sebastian Hahn)
+ o Fix handling of group rate limits under 64 bytes of burst (6d5440e)
+ o Solaris sendfile: correctly detect amount of data sent (643922e Michael Herf)
+ o Make rate limiting work with common_timeout logic (5b18f13)
+ o clear read watermark on underlying bufferevent when creating filtering bev to fix potentially failing fragmented ssl handshakes (54f7e61 Joachim Bauch)
+
+BUGFIXES (IOCP):
+ o IOCP: don't launch reads or writes on an unconnected socket (495c227)
+ o Make IOCP rate-limiting group support stricter and less surprising. (a98da7b)
+ o Have test-ratelim.c support IOCP (0ff2c5a)
+ o Make overlapped reads result in evbuffer callbacks getting invoked (6acfbdd)
+ o Correctly terminate IO on an async bufferevent on bufferevent_free (e6af35d)
+
+BUGFIXES (other):
+ o Fix evsig_dealloc memory leak with debugging turned on. (9b724b2 Leonid Evdokimov)
+ o Fix request_finished memory leak with debugging turned on. (aff6ba1 Leonid Evdokimov)
+
+BUILD AND TESTING FIXES:
+ o Allow OS-neutral builds for platforms where some versions have arc4random_buf (b442302 Mitchell Livingston)
+ o Try to fix 'make distcheck' errors when building out-of-tree (04656ea Dave Hart)
+ o Clean up some problems identified by Coverity. (7c11e51 Harlan Stenn)
+
+
+Changes in version 2.0.13-stable (18 Jul 2011)
+BUGFIXES
+ o Avoid race-condition when initializing global locks (b683cae)
+ o Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (e050703 Joachim Bauch)
+ o Speed up invoke_callbacks on evbuffers when there are no callbacks (f87f568 Mark Ellzey)
+ o Avoid a segfault when all methods are disabled or broken (27ce38b)
+ o Fix incorrect results from evbuffer_search_eol(EOL_LF) (4461f1a)
+ o Add some missing checks for mm_calloc failures (89d5e09)
+ o Replace an assertion for event_base_free(NULL) with a check-and-warn (09fe97d)
+ o Report kqueue ebadf, epipe, and eperm as EV_READ events (1fd34ab)
+ o Check if the `evhttp_new_object' function in `http.c' returns NULL. (446cc7a Mansour Moufid)
+ o Use the correct printf args when formatting size_t (3203f88)
+ o Complain if the caller tries to change threading cbs after setting them (cb6ecee)
+
+DOCUMENTATION FIXES AND IMPROVEMENTS
+ o Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy (2888fac)
+ o Update Doxyfile to produce more useful output (aea0555)
+
+TEST FIXES
+ o Fix up test_evutil_snprintf (caf695a)
+ o Fix tinytest invocation from windows shell (57def34 Ed Day)
+
+BUILD FIXES
+ o Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS (4a5c82d)
+ o Fix select.c compilation on systems with no NFDBITS (49d1136)
+ o Fix a few warnings on OpenBSD (8ee9f9c Nicholas Marriott)
+ o Don't break when building tests from git without python installed (b031adf)
+ o Don't install event_rpcgen.py when --disable-libevent-install is used (e23cda3 Harlan Stenn)
+ o Fix AIX build issue with TAILQ_FOREACH definition (e934096)
+
+
+Changes in version 2.0.12-stable (4 Jun 2011)
+BUGFIXES
+ o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0)
+ o Fix an assert-inducing fencepost bug in the select backend (d90149d)
+ o Fix failing http assertion introducd in commit 0d6622e (0848814 Kevin Ko)
+ o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1)
+ o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid)
+ o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey)
+ o Added overflow checks in evhttp_read_body and evhttp_get_body (84560fc Mark Ellzey)
+
+DOCUMENTATION:
+ o Add missing words to EVLOOP_NONBLOCK documentation (9556a7d)
+
+BUILD FIXES
+ o libssl depends on libcrypto, not the other way around. (274dd03 Peter Rosin)
+ o Libtool brings in the dependencies of libevent_openssl.la automatically (7b819f2 Peter Rosin)
+ o Use OPENSSL_LIBS in Makefile.am (292092e Sebastian Hahn)
+ o Move the win32 detection in configure.in (ceb03b9 Sebastian Hahn)
+ o Correctly detect openssl on windows (6619385 Sebastian Hahn)
+ o Fix a compile warning with zlib 1.2.4 and 1.2.5 (5786b91 Sebastian Hahn)
+ o Fix compilation with GCC 2, which had no __builtin_expect (09d39a1 Dave Hart)
+ o Fix new warnings from GCC 4.6 (06a714f)
+ o Link with -lshell32 and -ladvapi32 on Win32. (86090ee Peter Rosin)
+ o Make the tests build when OpenSSL is not available. (07c41be Peter Rosin)
+ o Bring in the compile script from automake, if needed. (f3c7a4c Peter Rosin)
+ o MSVC does not provide S_ISDIR, so provide it manually. (70be7d1 Peter Rosin)
+ o unistd.h and sys/time.h might not exist. (fe93022 Peter Rosin)
+ o Make sure TINYTEST_LOCAL is defined when building tinytest.c (8fa030c Peter Rosin)
+ o Fix winsock2.h #include issues with MSVC (3d768dc Peter Rosin)
+ o Use evutil_gettimeofday instead of relying on the system gettimeofday. (0de87fe Peter Rosin)
+ o Always use evutil_snprintf, even if OS provides it (d1b2d11 Sebastian Hahn)
+ o InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. (816115a Peter Rosin)
+ o cygwin: make it possible to build DLLs (d54d3fc)
+
+
+
+Changes in version 2.0.11-stable (27 Apr 2011)
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+BUGFIXES:
+ o Fix evport handling of POLLHUP and POLLERR (b42ce4b)
+ o Fix compilation on Windows with NDEBUG (cb8059d)
+ o Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (0144886 Trond Norbye)
+ o Detect and handle more allocation failures. (666b096 Jardel Weyrich)
+ o Use event_err() only if the failure is truly unrecoverable. (3f8d22a Jardel Weyrich)
+ o Handle resize failures in the select backend better. (83e805a)
+ o Correctly free selectop fields when select_resize fails in select_init (0c0ec0b)
+ o Make --enable-gcc-warnings a no-op if not using gcc (3267703)
+ o Fix a type error in our (unused) arc4random_stir() (f736198)
+ o Correctly detect and stop non-chunked http requests when the body is too long (63a715e)
+ o Have event_base_gettimeofday_cached() always return wall-clock time (a459ef7)
+ o Workaround for http crash bug 3078187 (5dc5662 Tomash Brechko)
+ o Fix incorrect assertions and possible use-after-free in evrpc_free() (4b8f02f Christophe Fillot)
+ o Reset outgoing http connection when read data in idle state. (272823f Tomash Brechko)
+ o Fix subtle recursion in evhttp_connection_cb_cleanup(). (218cf19 Tomash Brechko)
+ o Fix the case when failed evhttp_make_request() leaved request in the queue. (0d6622e Tomash Brechko)
+ o Fix a crash bug in evdns server circular list code (00e91b3)
+ o Handle calloc failure in evdns. (Found by Dave Hart) (364291e)
+ o Fix a memory leak on win32 socket->event map. (b4f89f0)
+ o Add a forgotten NULL check to evhttp_parse_headers (12311ff Sebastian Hahn)
+ o Fix possible NULL-deref in evdns_cancel_request (5208544 Sebastian Hahn)
+
+PORTABILITY:
+ o Fall back to sscanf if we have no other way to implement strtoll (453317b)
+ o Build correctly on platforms without sockaddr_storage (9184563)
+ o Try to build correctly on platforms with no IPv6 support (713c254)
+ o Build on systems without AI_PASSIVE (cb92113)
+ o Fix http unit test on non-windows platforms without getaddrinfo (6092f12)
+ o Do not check for gethostbyname_r versions if we have getaddrinfo (c1260b0)
+ o Include arpa/inet.h as needed on HPUX (10c834c Harlan Stenn)
+ o Include util-internal.h as needed to build on platforms with no sockaddr_storage (bbf5515 Harlan Stenn)
+ o Check for getservbyname even if not on win32. (af08a94 Harlan Stenn)
+ o Add -D_OSF_SOURCE to fix hpux builds (0b33479 Harlan Stenn)
+ o Check for allocation failures in apply_socktype_protocol_hack (637d17a)
+ o Fix the check for multicast or broadcast addresses in evutil_check_interfaces (1a21d7b)
+ o Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart (3417f68)
+
+DEFENSIVE PROGRAMMING:
+ o Add compile-time check for AF_UNSPEC==PF_UNSPEC (3c8f4e7)
+
+BUGS IN TESTS:
+ o Fix test.sh output on solaris (b4f89b6 Dave Hart)
+ o Make test-eof fail with a timeout if we never get an eof. (05a2c22 Harlan Stenn)
+ o Use %s with printf in test.sh (039b9bd)
+ o Add an assert to appease clang's static analyzer (b0ff7eb Sebastian Hahn)
+ o Add a forgotten return value check in the unit tests (3819b62 Sebastian Hahn)
+ o Actually send NULL request in http_bad_request_test (b693c32 Sebastian Hahn)
+ o add some (void) casts for unused variables (65707d7 Sebastian Hahn)
+ o Refactor test_getaddrinfo_async_cancel_stress() (48c44a6 Sebastian Hahn)
+ o Be nice and "handle" error return values in sample code (4bac793 Sebastian Hahn)
+ o Check return value of evbuffer_add_cb in tests (93a1abb Sebastian Hahn)
+ o Remote some dead code from dns-example.c (744c745 Sebastian Hahn)
+ o Zero a struct sockaddr_in before using it (646f9fe Sebastian Hahn)
+
+BUILD FIXES:
+ o Fix warnings about AC_LANG_PROGRAM usage (f663112 Sebastian Hahn)
+ o Skip check for zlib if we have no zlib.h (a317c06 Harlan Stenn)
+ o Fix autoconf bracket issues; make check for getaddrinfo include netdb.h (833e5e9 Harlan Stenn)
+ o Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am (9c469db Dave Hart)
+ o Fix make distcheck & installation of libevent 1 headers (b5a1f9f Dave Hart)
+ o Fix compilation under LLVM/clang with --enable-gcc-warnings (ad9ff58 Sebastian Hahn)
+
+FEATURES:
+ o Make URI parser able to tolerate nonconformant URIs. (95060b5)
+
+DOCUMENTATION:
+ o Clarify event_set_mem_functions doc (926f816)
+ o Correct evhttp_del_accept_socket documentation on whether socket is closed (f665924)
+ o fix spelling mistake in whatsnew-2.0.txt (deb2f73)
+ o Fix sample/http-server ipv6 fixes (eb692be)
+ o Comment internal headers used in sample code. (4eb281c)
+ o Be explicit about how long event loops run in event.h documentation (f95bafb)
+ o Add comment to configure.in to explain gc-sections test logic (c621359)
+ o Fix a couple of memory leaks in samples/http-server.c. Found by Dave Hart. (2e9f665)
+
+BUILD IMPROVEMENTS:
+ o Use the gcc -ffunction-segments feature to allow gc when linking with static libevent (0965c56 Dave Hart)
+ o Add configure options to disable installation, regression tests (49e9bb7 Dave Hart)
+
+
+
+Changes in version 2.0.10-stable (16 Dec 2010)
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+BUGFIXES
+ o Minor fix for IOCP shutdown handling fix (2599b2d Kelly Brock)
+ o Correctly notify the main thread when activating an event from a subthread (5beeec9)
+ o Reject overlong http requests early when Expect:100-continue is set (d23839f Constantine Verutin)
+ o EVUTIL_ASSERT: Use sizeof() to avoid "unused variable" warnings with -DNDEBUG. (b63ab17 Evan Jones)
+
+CODE CLEANUPS
+ o bufferevent-internal.h: Use the new event2/util.h header, not evutil.h (ef5e65a Evan Jones)
+ o Use relative includes instead of system includes consistently. (fbe64f2 Evan Jones)
+ o Make whitespace more consistent
+
+TESTING
+ o tests: Use new event2 headers instead of old compatibility headers. (4f33209 Evan Jones)
+
+DOCUMENTATION
+ o Document that the cpu_hint is only used on Windows with IOCP for now (57689c4)
+ o Add stuff to "whats new in 2.0" based on reading include changes since August. (18adc3f)
+
+
+Changes in 2.0.9-rc (30 Nov 2010):
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+NEW AND MODIFIED APIs
+ o Add a function to change a listener's callback. (46ee061)
+ o Make evbuffer_add_file take ev_off_t, not off_t (ac7e52d)
+ o Make rate-limits go up to SIZE_MAX/EV_SSIZE_MAX, not just INT32_MAX (2cbb1a1)
+ o Add a bufferevent_get_base function (aab49b6)
+
+MAJOR BUGFIXES
+ o Disable changelist for epoll by default because of Linux dup() bug; add an option and/or an envvar to reenable it for speed. (9531763)
+ o Fix a 100%-CPU bug where an SSL connection would sometimes never stop trying to write (1213d3d)
+ o Fix a nasty bug related to use of dup() with epoll on Linux (c281aba)
+ o Fix bugs in posix thread-id calculation when sizeof(pthread_t) != sizeof(long) (fbaf077)
+ o Fix some ints to evutil_socket_t; make tests pass on win64. (f817bfa Dimitre Piskyulev)
+ o Set _EVENT_SIZEOF_VOID_P correctly on win32 and win64 (1ae82cd Dimitre Piskyulev)
+ o Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL (abf01ed)
+ o Set SO_UPDATE_ACCEPT_CONTEXT on sockets from AcceptEx so that shutdown() can work (52aa419)
+ o When closing a filtering bufferevent, clear callbacks on the underlying bufferevent (fc7b1b0)
+
+NEW AND MODIFIED HTTP APIs
+ o Add evhttp_parse_query_str to be used with evhttp_uri_parse. (2075fbc)
+ o Add evhttp_response_code to remove one more reason to include http_struct.h (22e0a9b)
+ o Define enumerators for all HTTP methods, including PATCH from RFC5789 (75a7341 Felix Nawothnig)
+ o Functions to actually use evhttp_bound_socket with/as evconnlistener. (006efa7)
+ o Add evhttp_request_get_command so code can tell GET from POST without peeking at the struct. (49f4bf7)
+ o Introduce absolute URI parsing helpers. (86dd720 Pavel Plesov)
+ o Revise evhttp_uri_parse implementation to handle more of RFC3986 (eaa5f1d)
+ o Add evhttp_connection_get_base() to get the event_base from an http connection (cd00079)
+ o Let evhttp_parse_query return -1 on failure (b1756d0)
+ o New evhttp_uri(encode|decode) functions to handle + and NUL characters right (a8148ce)
+ o Add evhttp_response_code to remove one more reason to include http_struct.h (22e0a9b)
+ o Tweak interface for allowed methods (f5b391e)
+ o Add evhttp server alias interface, correct flagging of proxy requests. (aab8c38 Christopher Davis)
+
+HTTP BUGFIXES
+ o Add some comments to http.c and make a few functions static. (90b3ed5)
+ o Fix Content-Length when trying send more than 100GB of data (!) on an evhttp. (525da3e)
+ o Fix a bug where we would read too much data in HTTP bodies or requests. (58a1cc6)
+ o Correctly count req->body_size on http usage without Content-Length (8e342e5)
+ o Avoid missed-request bug when entire http request arrives before data is flushed (74c0e86)
+ o reset "chunked" flag when sending non-chunked reply (aa5f55f Joachim Bauch)
+ o evhttp_encode_uri encodes all reserved characters, including !$'()*+,/:=@ (2e63a60)
+ o Replace exact-version checks for HTTP/1.1 with >= or < checks (647e094)
+ o evhttp: Return 501 when we get an unrecognized method, not 400. (536311a)
+ o Don't disable reading from the HTTP connection after sending the request to be notified of connection-close in time (c76640b Felix Nawothnig)
+ o Never call evhttp_readcb while writing. (0512487)
+ o Try to fix an assertion failure related to close detection (0faaa39)
+ o Correctly detect timeouts during http connects (04861d5)
+ o Preliminary support for Continue expectation in evhttp. (fa9305f Christopher Davis)
+
+OTHER BUGFIXES
+ o Correct logic for realigning a chain in evbuffer_add (e4f34e8)
+ o Fix a minor syntax error that most compilers didn't care about (e56ff65)
+ o Fix some uses of int for socket in regress (5d389dc)
+ o Check return value for ioctlsocket on win32 (f5ad31c Trond Norbye)
+ o Fix som event_warns that should have been event_warnx (19c71e7)
+ o Fix signal handler types for win64. (b81217f)
+ o Try to clear up more size_t vs int/long issues. (598d133)
+ o Make sure IOCP evconnlistener uses virtual events. (7b40a00 Christopher Davis)
+ o Don't free evdns_request handles until after the callback is invoked (9ed30de)
+ o Fix some more cancel-related bugs in getaddrinfo_async (c7cfbcf)
+ o Make evdns_getaddrinfo_cancel threadsafe (d51b2fc)
+ o Only clear underlying callbacks when the user hasn't reset them. (1ac5b23)
+ o Fix bug in bufferevent_connect on an openssl bufferevent that already had an fd (4f228a1)
+ o Resolve an evport bug in the thread/forking test (3a67d0b)
+ o Make sure the CLOEXEC flag is set on fds we open for base notification (3ab578f)
+ o Fix IRIX build. sa_family collides with a #define in sys/socket.h on IRIX. (e874982 Kevin Bowling)
+ o If not WIN32, include <sys/socket.h> in event2/util.h. (1cd45e5 Kevin Bowling)
+ o Fix some C99-style comments to work with the xlC compiler. (c2e5e22 Kevin Bowling)
+ o Add some checks since lack of TAILQ_FOREACH doesn't imply lack of FIRST, END, NEXT, or INSERT_BEFORE. Quiet some warnings in XL C. (c4dc335 Kevin Bowling)
+ o Reworked AIX __ss_family workaround to use AC_STRUCT_MEMBER. (2e2a3d7 Kevin Bowling)
+ o Take select from <sys/select.h> when testing in autoconf. AIX build fix. (a3a9f6b Kevin Bowling)
+ o Fix snprintf related failures on IRIX. (3239073 Kevin Bowling)
+ o Remove _event_initialized(); make event_initialized() a function(); make it consistent on windows and non-windows (652024b)
+ o Do not let EVLOOP_ONCE exit the loop until all deferred callbacks have run (2d5e1bd)
+ o Make EVLOOP_ONCE ignore internal events (0617a81)
+ o Possible crash fix when freeing an underlying bufferevent of an openssl bufferevent (29f7623)
+
+HTTP CLEANUPS
+ o Stop using Libevent-1 headers in regress_http (1f507d7)
+ o Modernize header usage in bench_http.c (e587069)
+ o fix signed/unsigned warnings in http.c (74a91e5)
+ o Update the HTTP regression tests to use Libevent2 apis for non-http stuff (d9ffa89)
+ o Start porting http tests to not use legacy interfaces (8505a74)
+ o Convert the rest of the http tests to be non-legacy unit tests. (9bb8239)
+ o Rename the confusing "base" static variable in regress_http.c (353402a)
+ o Stop accessing http request struct directly from in the unit tests. (0b137f4)
+ o Refactor http version parsing into a single function (a38140b)
+
+TESTING
+ o Improvements to tinytest_macros.h (ad923a1)
+ o Add a huge pile of tests for the new URI functions, and make them pass. (a5a76e6)
+ o Unit tests for evhttp_uri_set* (bc98f5e)
+ o Increase the skew tolerance to 2 seconds in thread/deferred_cb_skew (f806476 Christopher Davis)
+ o Reorder backends in test.sh to match preference order in event.c (ece974f)
+ o Add a stress test for getaddrinfo_cancel (da1bf52)
+ o Units test for unexpected evhttp methods. (75e3320)
+
+DOCUMENTATION
+ o Document behavior of URI parsing more thoroughly. (3a33462)
+ o Document that two bufferevent functions only work on socket bufferevents (70e1b60)
+ o add a requested docstring for event_rpcgen.CommandLine.__init__ (f1250eb)
+ o Fix a mistake in http documentation found by Julien Blache (229714d)
+ o Add a basic example of how to write a static HTTP server. (4e794d5)
+ o Document event_get_assignment (88be27d)
+ o Note that reentrant calls to libevent from logging cbs may fail badly (e431bcd)
+ o Clarify EVLOOP_* documentation to be more precise. (057a514)
+
+CLEANUPS
+ o Simplify the logic for choosing EPOLL_CTL_ADD vs EPOLL_CTL_MOD (2c66983)
+ o Rename "size" variables in win32select that were really fd counts. (b6a158c)
+ o Fix even more win64 warnings (7484df6)
+ o Fix even more win64 warnings: buffer, event_tagging, http, evdns, evrpc (545a611)
+ o Fix more wn64 warnings. (34b84b9 Christopher Davis)
+ o Use the label_len local variable in evdns instead of recalculating it over and over (ba01456)
+ o Fix some irix compilation warnings spotted by Kevin Bowling (7bcace2)
+
+
+
+Changes in 2.0.8-rc (14 Oct 2010):
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+NEW APIS
+ o Add error callback to evconnlistener (c4be8d8 Simon Perreault)
+ o Add a LEV_OPT_THREADSAFE option for threadsafe evconnlisteners (127d4f2)
+
+CHANGED BEHAVIOR
+ o Correct logic on disabling underlying bufferevents when disabling a filter (ac27eb8)
+
+BUGFIXES
+ o Obey enabled status when unsuspending (040a019 Simon Perreault)
+ o Warn when using the error-prone EV_SIGNAL interface in an error-prone way. Also, fix a couple of race conditions in signal.c (720bd93)
+ O Make default signal backend fully threadsafe (95a7d41)
+ o Put internal events at highest priority (90651b3)
+ o Fix warnings in the main codebase flagged by -Wsigned-compare (9c8db0, 5e4bafb, 5c214a, 6be589a, e06f514)
+ o Fix compile in kqueue.c (b395392 Sebastian Hahn)
+ o Do not search outside of the system directory for windows DLLs (d49b5e3)
+ o Fix a spurious-call bug on epoll.c (0faaee0)
+ o Send a shutdown(SHUT_WR) before closing an http connection (e0fd870 Christopher Davis)
+ o Fix warnings on mingw with gcc 4.5 (5b7a370)
+ o Fix an EINVAL on evbuffer_write_iovec on OpenSolaris. (fdc640b)
+ o Fix allocation error for IOCP listeners. Probably harmless, since struct event is big (481ef92)
+ o Make iocp/listener/error work; don't accept again if lev is disabled. (62b429a Christopher Davis)
+ o Handle rate-limiting for reading on OpenSSL bufferevents correctly. (819b171)
+ o Fix serious bugs in per-bufferevent rate-limiting code (34d64f8)
+ o Avoid spurious reads from just-created open openssl bufferevents (223ee40)
+ o Fix a case where an ssl bufferevent with CLOSE_ON_FREE didn't close its fd (93bb7d8)
+ o The corrected bufferevent filter semantics let us fix our openssl tests (34331e4)
+
+TESTING
+ o Make SSL tests cover enabling/disabling EV_READ. (a5ce9ad)
+ o Bump to the latest version of tinytest (f0bd83e)
+ o Unit tests for listener error callbacks (045eef4)
+ o New unit test for ssl bufferevents starting with connected SSLs. (02f6259)
+
+DEBUGGABILITY
+ o Make debugging output for epoll backend more comprehensive (ec2b05e)
+ o Make event.c debugging messages report fds (e119899)
+ o Make the --enable-gcc-warnings option include signed comparison warnings (d3b096c)
+
+DEADCODE REMOVAL
+ o Remove the now-useless evsig_caught and evsig_process (4858b79)
+ o Remove event_base.evsigbase; nothing used it. (38d0960)
+
+
+
+Changes in 2.0.7-rc (9 Sep 2010):
+ [Autogenerated from the Git log, sorted and cleaned by hand.]
+NEW APIS
+ o Expose a evdns_base_nameserver_sockaddr_add() function to add a nameserver by sockaddr (1952143)
+ o Add event_config_set_num_cpus_hint() for tuning win32 IOCP thread pools, etc. (2447fe8 Christopher Davis)
+
+BUGFIXES
+ o Fix a nasty dangling-event bug when using rate-limiting groups (0bffe43)
+ o Clean up syntax on TAILQ_ENTRY() usage to build correctly with recent MSVC (60433a0 Gilad Benjamini)
+ o Make definition of WIN32_LEAN_AND_MEAN in event.h conditional (3920172 Gilad Benjamini)
+ o Correctly detect failure to delete bufferevent read-timeout event (da6e7cd)
+ o Set close-on-exec bit for filedescriptors created by dns subsystem (d0b8843)
+ o Fix kqueue correctness test on x84_64 (6123d12)
+ o Detect events with no ev_base; warn instead of crashing (f1074b7)
+ o Fix an issue with forking and signal socketpairs in select/poll backends (d61b2f3)
+ o Stop using global arrays to implement the EVUTIL_ctype functions (1fdec20)
+ o On windows, make lock/thread function tables static (5de2bcb)
+ o Close th_notify_fds and open a new pair on reinit (495ed66)
+ o Declare signal handler function as "__cdecl" on Windows (f0056d0)
+ o Use the _func() replacements for open, fstat, etc in evutil.c on win32 (e50c0fc)
+ o Only process up to MAX_DEFERRED deferred_cbs at a time (17a14f1 Christopher Davis)
+
+THREADING BUGFIXES
+ o Avoid deadlock when activating signals (970e6ad)
+ o Add a condition variable backend, with implementations for pthreads and win32 (d4977b5)
+ o Use conditions instead of current_event_lock to fix a deadlock (e0972c2)
+ o Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting (4c32b9d)
+ o Avoid needlessly calling evthread_notify_base() when the loop is not running (c7a06bf)
+ o Minimize calls to base_notify implementation functions, thereby avoiding needless syscalls (4632b78)
+
+IOCP BUGFIXES
+ o IOCP-related evbuffer fixes (03afa20 Christopher Davis)
+ o Stop IOCP when freeing the event_base (d844242 Christopher Davis)
+ o Some IOCP bufferevent tweaks (76f7e7a Christopher Davis)
+
+TESTS
+ o Make the regress_pthread.c tests work on windows with current test APIs (d74ae38)
+ o Add a unit test for conditions (5fb1095)
+ o Allow more than one copy of regression tests to run at once (a97320a)
+ o Fix event_del(0) instance in bench.c (b0f284c Shuo Chen)
+ o Fix a few memory leaks in the tests (1115366)
+ o IOCP-related unit test tweaks (499452f Christopher Davis)
+ o Improve testing of when thread-notification occurs (ce85280)
+
+BUILD AND DISTRIBUTION
+ o Add pkgconfig files for libevent_{openssl,pthreads} (ebcb1f0)
+ o Change include order in Makefile.nmake (4022b28)
+ o Make include/event2/event-config.h not included in source dist (a4af9be)
+ o Honor NDEBUG; build without warnings with NDEBUG; make NDEBUG always-off in unit test code (743f866)
+ o Declare evkeyvalq and event_list even if event_struct.h comes before sys/queue.h (d3ceca8)
+ o Move evkeyvalq into a separate header for evhttp_parse_query users (ca9048f)
+ o Prefer autoreconf -ivf to manual autogen.sh (7ea8e89)
+
+CLEANUP
+ o Completely remove the (mostly-removed) obsolete thread functions (3808168)
+ o Rename regress_pthread.c to regress_thread.c (041989f)
+ o Make defer-internal.h use lock macros, not direct calls to lock fns (5218d2a)
+
+DOCUMENTATION
+ o Document that DNS_NO_SEARCH is an obsolete alias for DNS_QUERY_NO_SEARCH (33200e7)
+ o Update the whatsnew-2.0.txt document (4991669)
+
+
+
+Changes in 2.0.6-rc (6 Aug 2010):
+ [Autogenerated from the Git log, sorted by hand.]
+DOCUMENTATION
+ o Document a change in the semantics of event_get_struct_event_size() (e21f5d1)
+ o Add a comment to describe our plan for library versioning (9659ece)
+ o Fix sentence fragment in docs for event_get_struct_event_size() (7b259b6)
+
+NEW FEATURES AND INTERFACE CHANGES
+ o Remove the obsolete evthread interfaces (c5bab56)
+ o Let evhttp_send_error infer the right error reasons (3990669)
+ o Add a function to retrieve the other side of a bufferevent pair (17a8e2d)
+ o Add bufferevent_lock()/bufferevent_unlock() (215e629)
+ o Stop asserting when asked for a (unsupported) TCP dns port. Just return NULL. (7e87a59)
+ o Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags (e1c1167)
+ o Constify a couple of arguments to evdns_server_request_add_*_reply (cc2379d)
+ o Add an interface to expose min_share in ratelimiting groups (6ae53d6)
+
+BUGFIXES
+ o Avoid event_del on uninitialized event in event_base_free (6d19510)
+ o Add some missing includes to fix Linux build again (75701e8)
+ o Avoid close of uninitialized socket in evbuffer unit test (bda21e7)
+ o Correctly recognize .255 addresses as link-local when looking for interfaces (8c3452b)
+ o If no evdns request can be launched, return NULL, not a handle (b14f151)
+ o Use generic win32 interfaces, not ASCII-only ones, where possible. (899b0a3)
+ o Fix the default HTTP error template (06bd056 Felix Nawothnig)
+ o Close the file in evutil_read_file whether there's an error or not. (0798dd1 Pierre Phaneuf)
+ o Fix possible nullptr dereference in evhttp_send_reply_end() (29b2e23 Felix Nawothnig)
+ o never let bufferevent_rlim functions return negative (0859870)
+ o Make sample/hello_world work on windows (d89fdba)
+ o Fix a deadlock related to event-base notification. Diagnosed by Zhou Li, Avi Bab, and Scott Lamb. (17522d2)
+ o Possible fix to 100% cpu usage with epoll and openssl (cf249e7 Mike Smellie)
+ o Don't race when calling event_active/event_add on a running signal event (fc5e0a2)
+ o Suppress a spurious EPERM warning in epoll.c (e73cbde)
+ o Fix wrong size calculation of iovec buffers when exact=1 (65abdc2 niks)
+ o Change bufferevent_openssl::do_write so it doesn't call SSL_write with a 0 length buffer (c991317 Mike Smellie)
+ o Fixed compilation of sample/le-proxy.c on win32 (13b912e Trond Norbye)
+ o Fix rate-limit calculation on openssl bufferevents. (009f300)
+ o Remember to initialize timeout events for bufferevent_async (de1f5d6 Christopher Davis)
+
+BUILD AND DISTRIBUTION CHANGES
+ o Test the unlocked-deferred callback case of bufferevents (dfb75ab)
+ o Remove the now-unusable EVTHREAD_LOCK/UNLOCK constants (fdfc3fc)
+ o Use -Wlogical-op on gcc 4.5 or higher (d14bb92)
+ o Add the libtool-generated /m4/* stuff to .gitignore (c21c663)
+ o Remove some automake-generated files from version control. (9b14911)
+ o Have autogen.sh pass --force-missing to automake (8a44062)
+ o Set library version for libevent_pthreads correctly (b2d7440)
+ o Really only add libevent_core.la to LIBADD on mingw (1425003 Sebastian Hahn)
+ o Build more cleanly with NetBSDs that dislike toupper(char) (42a8c71)
+ o Fix unit tests with -DUSE_DEBUG enabled (28f31a4)
+ o Fix evdns build with -DUNICODE (5fa30d2)
+ o Move event-config.h to include/event2 (ec347b9)
+
+TESTING
+ o Add options to test-ratelim.c to check its results (2b44dcc)
+ o Make test-ratelim clean up after itself better. (b5bfc44)
+ o Remove the now-obsolete setup_test() and cleanup_test() functions (e73f1d7)
+ o Remove all non-error prints from test/regress.c (8bc1e3d)
+ o Make test.sh exit with nonzero status if tests fail (faf2a04)
+ o Have the unit tests report errors from test.sh (3689bd2)
+ o Fix logic in correcting high values from FIONREAD (3467f2f)
+ o Add test for behavior on remote socket close (44d57ee)
+ o Unit test for event_get_struct_event_size() (7510aac)
+ o Make test/test.sh call test-changelist (7c92691)
+ o Fix badly-behaved subtest of dns/bufferevent_connect_hostname (840a72f Joachim Bauch)
+ o Add option to test-ratelim to test min_share (42f6b62)
+ o Fix an assertion bug in test-ratelim (b2c6202)
+ o Make tests quieter on local dns resolver failure (e996b3d)
+ o Increase the tolerance in our unit tests for sloppy clocks. (170ffd2)
+ o Use AF_INET socketpair to test sendfile on Solaris (9b60209)
+ o Make test-changelist count cpu usage right on win32 (ea1ea3d)
+
+INTERNALS, PERFORMANCE, AND CODE CLEANUPS
+ o Mark the event_err() functions as __attribute__((noreturn)) (33bbbed)
+ o Do not check that event_base is set in EVBASE_ACQUIRE_LOCK (218a3c3)
+ o Replace (safe) use of strcpy with memcpy to appease OpenBSD (caca2f4)
+ o Remove some dead assignments (47c5dfb)
+ o Fix a pedantic gcc 4.4 warning in event2/event.h (276e7ee)
+ o Drain th_notify_fd[0] more bytes at a time. (a5bc15b)
+ o Tidy up the code in evthread_make_base_notifiable a little (61e1eee)
+ o Pass flags to fcntl(F_SETFL) and fcntl(F_SETFD) as int, not long (7c2dea1)
+ o Remove unused variables in test/test-changelist.c (b00d4c0)
+ o Fix whitespace. (cb927a5)
+ o Improve error message for failed epoll to make debugging easier. (9e725f7)
+ o Turn our socketpair() replacement into its own function (57b30cd)
+
+
+
+Changes in 2.0.5-beta (10 May 2010):
+ [Autogenerated from the Git log, sorted by hand.]
+DOCUMENTATION
+ o Update all our copyright notices to say "2010" (17efc1c)
+ o Add Christopher Clark and Maxim Yegorushkin to the LICENSE file (38b7b57)
+ o Clarify Christopher Clark's status as writer of original ht code. (78772c3)
+ o Try to comment some of the event code more (cdd4c49)
+ o Add a few more evmap/changelist comments (c247adc)
+ o Add a comment to explain why evdns_request is now separte from request (ceefbe8)
+ o Document evutil_secure_rng_init() and evutil_secure_rng_add_bytes() (a5bf43a)
+ o Stop distributing and installing manpages: they were too inaccurate (7731ec8)
+
+NEW FEATURES AND INTERFACE CHANGES
+ o Remove signal_assign() and signal_new() macros. (2fac0f7)
+ o Make evdns use the regular logging system by default (b2f2be6)
+ o Allow evbuffer_read() to split across more than 2 iovecs (e470ad3)
+ o Functions to manipulate existing rate limiting groups. (ee41aca)
+ o Functions to track the total bytes sent over a rate limit group. (fb366c1)
+ o Detect and refuse reentrant event_base_loop() calls (b557b17)
+ o Limit the maximum number of events on each socket to 65535 (819f949)
+ o Add evbuffer_copyout to copy data from an evbuffer without draining (eb86c8c)
+ o Expose the request and reply members of rpc_req_generic() (07edf78 Shuo Chen)
+ o Add void* arguments to request_new and reply_new evrpc hooks (755fbf1 Shuo Chen)
+ o Seed the RNG using sysctl() as well as /dev/urandom (71fc3eb)
+ o Make evutil_secure_rng_init() work even with builtin arc4random (f980716)
+ o Report DNS error when lookup fails during bufferevent_socket_connect_hostname. (0ef4070 Christopher Davis)
+ o Release locks on bufferevents while executing callbacks (a5208fe Joachim Bauch) o Make debug mode catch mixed ET and non-ET events on an fd (cb67074)
+ o Catch attempts to enable debug_mode too late (9ecf0d4)
+ o Refuse null keys in evhttp_parse_query() (953e229 Frank Denis)
+
+BUGFIXES
+ o Avoid a spurious close(-1) on Linux (70a44b6)
+ o Do not close(-1) when freeing an uninitialized socket bufferevent (b34abf3)
+ o Free evdns_base->req_heads on evdns_base_free (859af67)
+ o Avoid an (untriggerable so far) crash bug in bufferevent_free() (0cf1431)
+ o Set mem_offset for every bufferevent type (657d1b6)
+ o Fix infrequent memory leak in bufferevent_init_common(). (8398641 Jardel Weyrich)
+ o Make evutil_signal_active() match declaration. (e1e703d Patrick Galbraith)
+ o Fix minheap code to use replacement malloc functions (a527618)
+ o Fix a free(NULL) in minheap-internal.h (6f20492)
+ o Fix critical bug in evbuffer_write when writev is not available (cda56ab)
+ o Make the no_iovecs case of write_atmost compile (8e227b0)
+ o Fix a memory leak when appending/prepending to a buffer with unused space. (45068a3)
+ o Clean up a mistake in pointer manipulation in evbuffer_remove (28bfed4 Christopher Davis)
+ o Always round up when there's a fractional number of msecs. (8f9e60c Christopher Davis)
+ o Fix compiler warnings under WIN32 (d469c50 Giuseppe Scrivano)
+ o Clean up properly when adding a signal handler fails. (b84b598 Gilad Benjamini) o Ensure that evdns_request is a persistent handle. (15bb82d Christopher Davis)
+ o Free search state when finished searching to avoid an infinite loop. (a625840 Christopher Davis)
+ o Assert for valid requests as necessary. (67072f3 Christopher Davis)
+ o do not leak the request object on persistent connections (9d8edf2)
+ o Make evdns logging threadsafe (b1c7950)
+ o Fix a couple of bugs in the BSD sysctl arc4seed logic (a47a4b7)
+ o Remove one last bug in last_with_datap logic. Found with valgrind (d49b92a)
+ o fix a leak when unpausing evrpc requests (94ee125)
+ o Fix a memory leak when unmarshalling RPC object arrays (f6ab2a2)
+ o Fix compilation when openssl support is disabled (40c301b)
+ o Allow empty reason line in HTTP status (739e688 Pierre Phaneuf)
+ o Fix a compile warning introduced in 739e688 (bd1ed5f Sebastian Hahn)
+ o Fix nonstandard TAILQ_FOREACH_REVERSE() definition (71afc52 Frank Denis)
+ o Try /proc on Linux as entropy fallback; use sysctl as last resort (20fda29)
+ o Fix symbol conflict between mm_*() macros and libmm (99e50e9)
+ o Fix some crazy macro mistakes in arc4random.c (90d4225)
+ o Make evbuffer_add_file() work on windows (dcdae6b)
+ o Fix unused-variable warning when building with threads disabled (ad811cd)
+ o Numerous opensolaris compilation fixes (c44de06)
+ o Fix getaddrinfo with protocol unset on Solaris 9. Found by Dagobert Michelsen (2cf2a28)
+ o Fix another nasty solaris getaddrinfo() behavior (3557071)
+ o Define _REENTRANT as needed on Solaris, elsewhere (c1cd32a)
+ o Fix some autoconf issues on OpenBSD (7c519df)
+
+BUILD AND DISTRIBUTION CHANGES
+ o Distribute libevent.pc.in, not libevent.pc (22aff04)
+ o Avoid errors in evutil.c when building with _UNICODE defined (b677032 Brodie Thiesfield)
+ o Avoid errors in http.c when building with VC 2003 .NET (13e4f3b Brodie Thiesfield)
+ o Support the standard 'make check' target in place of 'make verify' (426c8fb)
+ o Remove redundant stuff from EXTRA_DIST (b660edf)
+ o Switch to using AM conditionals in place of AC_LIBOBJ (2e898f5)
+ o Remove an orphaned RELEASE flag in Makefile.am (0794b0d)
+ o Give a better warning for bad automake versions. (77c917d)
+ o Use dist_bin_SCRIPTS, not EXTRA_DIST, to distribute scripts (9eb2fd7)
+ o Never test for select() on windows (3eb044d Trond Norbye)
+ o Do not inhibit automake dependencies generation (10c4c90 Giuseppe Scrivano)
+ o Create shared libraries under Windows (3cbca86 Giuseppe Scrivano)
+ o Add ctags/etags files to .gitignore (0861d17)
+ o Only specify -no-undefined on mingw (25433b9)
+ o Only add libevent_core.la to LIBADD on mingw (fdc6297)
+
+TESTING
+ o Get bench_http to work on Windows; add a switch to enable IOCP. (4ac38a5 Christopher Davis)
+ o VC has no getopt(), so do without in bench_http. (1273d2f Christopher Davis)
+ o Fix an obnoxious typo in the bufferevent_timeout_filter test (0d047c3)
+ o Fix a write of uninitialized RAM in regression tests (68dc742)
+ o Fix some memory leaks in the unit tests (274a7bd)
+ o Make 'main/many_events' test 70 fds, not 64. (33874b0)
+ o Unit-test every evbuffer_add_file() implementation. (06a4443)
+ o Add more unit tests for evbuffer_expand (8c83e99)
+ o Test another case of evbuffer_prepend (1234b95)
+ o Fix a possible double-free bug in SSL bufferevents with CLOSE_ON_FREE (7501895) o Add dns/search_cancel unit test. (39b870b Christopher Davis)
+ o Make http_base_test stop leaking an event_base. (96730d3)
+ o Detect broken unsetenv at unit-test runtime (f37cd4c)
+ o Implement regress_make_tempfile on win32 to test evbuffer_add_file (b4f12a1)
+ o add more (currently skipped) add_file tests on win32 (05de45d)
+ o Fix bench_http build on win32. (384d124)
+ o Make unit test for add_file able to tell "error" from "done" (88a543f)
+ o Make test for bufferevent_connect_hostname system-neutral (f89168e)
+ o Make test.sh support mingw/msys on win32 (0ee6f6c)
+ o Fix test.sh on freebsd (3d9e05b)
+
+INTERNALS, PERFORMANCE, AND AND CODE CLEANUPS
+ o Improve the speed of evbuffer_readln() (cc1600a)
+ o more whitespace normalization (2c2618d)
+ o Revise evbuffer to add last_with_data (2a6d2a1)
+ o Use last_with_data in place of previous_to_last (c8ac57f)
+ o Remove previous_to_last from evbuffer (6f47bd1)
+ o Fix last_with_data compilation on windows (1e7b986)
+ o Add some glass-box tests for the last_with_data code. (17da042)
+ o Improve robustness for refcounting (f1bc125)
+ o Remove a needless min_heap_shift_up_() call (7204b91)
+ o Increase MIN_BUFFER_SIZE to 512 (1024 on 64-bit) (2014ae4)
+ o Do not use evbuffer_expand() to add the first chain to a buffer (5c0ebb3)
+ o Make evbuffer_prepend handle empty buffers better (c87272b)
+ o Replace last_with_data with a slightly smarter version (b7442f8)
+ o Turn the increasingly complex *_CHAIN() macros into functions (96865c4)
+ o Rewrite evbuffer_expand and its users (d5ebcf3)
+ o Add evutil_tv_to_msec for safe conversion of timevals to milliseconds. (850c3ff Christopher Davis)
+ o Initialize last_with_datap correctly in evbuffer_overlapped (a0983b6)
+ o Replace EVUTIL_CLOSESOCKET macro with a function (899c1dc Sebastian Sjöberg)
+ o Move domain search state to evdns_request. (beaa14a Christopher Davis)
+ o Remove redundant checks for lock!=NULL before calling EVLOCK_LOCK (50ec59f)
+ o Rename current_base symbol to event_global_current_base_ (c16e684)
+ o Fix whitespace in evutil.c (935e150)
+ o Replace users of "int fd" with "evutil_socket_t fd" in portable code (c7cf6f0)
+
+
+
+Changes in 2.0.4-alpha (28 Feb 2010):
+ [Autogenerated from the Git log, sorted by hand.]
+DOCUMENTATION
+ o Add stub header for 2.0.4-alpha changelog. (94d0065)
+ o Improve the README with more information and links. (0b42726)
+ o Add more people who wrote patches to the acknowledgments (0af10d5)
+ o Add a warning about the use of event_initialized. (f32b575)
+ o Add a LICENSE file so people can find our license easily (7067006)
+ o Add a new "hello world" sample program (becb9f9)
+ o Clarify status of example programs (d60a1bd)
+ o Update time-test.c to use event2 (f4190bf)
+ o Add the arc4random.c license to the LICENSE file. (e15e1e9)
+
+NEW FEATURES AND INTERFACE CHANGES
+ o Improved optional lock debugging. (0cd3bb9)
+ o Rate-limiting for bufferevents; group and individual limits are supported. (737c9cd)
+ o Testing code for bufferevent rate-limiting. (f0c0124)
+ o Make the initial nameserver probe timeout configurable. (1e56a32)
+ o Revise the locking API: deprecate the old locking callbacks and add trylock. (347952f)
+ o Do not make bufferevent_setfd implicitly disable EV_READ and EV_WRITE. (8274379)
+ o Do not ignore bufferevent_enable(EV_READ) before bufferevent_connect(). (4a5b534)
+ o Introduced evutil_make_socket_closeonexec() to preserve fd flags for F_SETFD. (d0939d2 Jardel Weyrich)
+ o evdns_getaddrinfo() now supports the /etc/hosts file. (72dd666)
+ o Look at the proper /etc/hosts file on windows. (66c02c7)
+ o Allow http connections to use evdns for hostname looksups. (c698b77)
+ o Changelist code to defer event changes until just before dispatch (27308aa)
+ o do not use a function to assign the evdns base; instead assign it via evhttp_connection_base_new() which is a new function introduced in 2.0 (5032e52)
+ o Functions to access more fields of struct event. (0683950)
+ o Make kqueue use changelists. (45e5ae3)
+ o Remove kqueue->pend_changes. (3225dfb)
+ o Minimize epoll_ctl calls by using changelist (c8c6a89)
+ o Add support for a "debug mode" to try to catch common errors. (cd17c3a)
+ o Note a missing ratelim function (361da8f)
+ o Add ev_[u]intptr_t to include/event2/util.h (1fa4c81)
+ o const-ify a few more functions in event.h (d38a7a1)
+ o Deprecate EVENT_FD and EVENT_SIGNAL. (f6b2694)
+ o Remove EVUTIL_CHECK_FMT. (6c21c89)
+ o Add EV_*_MAX macros to event2/util.h to expose limits for ev_* types. (aba1fff) o Functions to view and manipulate rate-limiting buckets. (85047a6)
+ o Add the rest of the integer limits, and add a test for them. (60742d5)
+ o Remove the 'flags' argument from evdns_base_set_option() (1dd7e6d)
+ o Add an arc4random implementation for use by evdns (d4de062)
+ o Use off_t for the length parameter of evbuffer_add_file (3fe60fd)
+ o Construct Windows locks using InitializeCriticalSectionAndSpinCount (32c6f1b)
+ o Expose view of current rate limit as constrained by group limit (162ce8a)
+ o Provide consistent, tested semantics for bufferevent timeouts (d328829)
+
+BUGFIXES AND TESTS
+ o Tolerate code that returns from a fatal_cb. (91fe23f)
+ o Parenthesize macro arguments more aggressively (07e9e9b)
+ o Fix memory-leak of signal handler array with kqueue. (e1ffbb8)
+ o Stop passing EVTHREAD_READ and EVTHREAD_WRITE to non-rw locks. (76cd2b7)
+ o Fix two use-after-free bugs in unit tests spoted by lock debugging (d84d838)
+ o Fix a locking bug in event_base_loop() (da1718b)
+ o Fix an evdns lock violation. (2df1f82 Zhuang Yuyao)
+ o Valgrind fix: Clear struct kevent before checking for OSX bug. (56771a3 William Ahern)
+ o Fix up evthread compilation on windows (bd6f1ba Roman Puls)
+ o Fix regress_iocp.c usage of old lock allocation macros. (31687b4 unknown)
+ o Update nmake makefile to build evthread.c (b62d979 unknown)
+ o Fix a crash when reading badly formatted resolve.conf; from Yasuoka Masahiko (6c7c579 Yasuoka Masahiko)
+ o Fix a snow leopard compile warning in the unit tests. (7ae9445)
+ o Fix compile on Snow Leopard with gcc warnings enabled (70cdfe4 Sebastian Hahn)
+ o Only define _GNU_SOURCE if it is not already defined. (ea6b1df Joachim Bauch)
+ o Update sample/signal-test.c to use newer APIs and not leak. (f6430ac Evan Jones)
+ o Fix a segfault when writing a very fragmented evbuffer onto an SSL (a6adeca Joachim Bauch)
+ o Fix a segfault when freeing SSL bufferevents in an unusual order (a773df5 Joachim Bauch)
+ o Drop install-sh from our git repo: a mismatched version could break "make dist" (6799527)
+ o Set all instances of the version number correctly. (5a112d3)
+ o Fix a few locking issues on windows. (c51bb3c unknown)
+ o Use evutil_socket_t, not int, when logging socket errors. (292467c)
+ o Fix up behavior of never-defered callbacks a little (390e056)
+ o Replace some cases of uint32_t with ev_uint32_t. (a47d88d)
+ o Fix compilation of devpoll.c by adding missing thread includes. (fee2c77 Dagobert Michelsen)
+ o Make evutil_make_socket_nonblocking() leave any other flags alone. (4c8b7cd Jardel Weyrich)
+ o Fix an fd leak in evconnlistener_new_bind(). (24fb502 Jardel Weyrich)
+ o Fix a bogus free in evutil_new_addrinfo() (0d64051 Jardel Weyrich)
+ o Adjusted fcntl() retval comparison on evutil_make_socket_nonblocking(). (4df7dbc Jardel Weyrich)
+ o Fix the code that allowed DNS options to not end with : (ee4953f)
+ o Fix crash bugs when a bufferevent's eventcb is not set. (2e8eeea)
+ o Fix test-ratelim compilation on Linux. (885b427)
+ o Fix compilation of rate-limiting code on win32. (165d30e)
+ o Eradicated the last free() call. Let mm_free() take care of deallocation. (0546ce1 Jardel Weyrich)
+ o Fix byte counts when mixing deferred and non-deferred evbuffer callbacks. (29151e6)
+ o Fixed a memory leak on windows threads implementation. The CRITICAL_SECTION was not being free'd in evthread_win32_lock_free(). (2f33e00 Jardel Weyrich)
+ o Fixed a fd leak in start_accepting(), plus cosmetic changes (4367a33 Jardel Weyrich)
+ o Improved error handling in evconnlistener_new_async(). Also keeping the fd open because it is not opened by this function, so the caller is responsible for closing it. Additionally, since evconnlistener_new_bind() creates a socket and passes it to the function above, it required error checking to close the same socket. (fec66f9 Jardel Weyrich)
+ o Don't use a bind address for nameservers on loopback (8d4aaf9)
+ o Fix compilation of rate-limit code when threading support is disabled (97a8c79)
+ o Detect setenv/unsetenv; skip main/base_environ test if we can't fake them. (7296971)
+ o Check more internal event_add() calls for failure (ff3f6cd)
+ o Fix windows and msvc build (5c7a7bc)
+ o Call event_debug_unassign on internal events (a19b4a0)
+ o Try to fix a warning in hash_debug_entry (137f2c6)
+ o Fix a dumb typo in ev_intptr_t definitions. (27c9a40)
+ o do not fail while sending on http connections the client closed. (93d7369)
+ o make evhttp_send() safe against terminated connections, too (3978180)
+ o Make Libevent 1.4.12 build on win32 with Unicode enabled. (000a33e Brodie Thiesfield)
+ o Fix some additional -DUNICODE issues on win32. (a7a9431)
+ o Add a check to make soure our EVUTIL_AI flags do not conflict with the native ones (c18490e)
+ o Always use our own gai_strerror() replacement. (6810bdb)
+ o Make RNG work when we have arc4random() but not arc4random_buf() (4ec8fea)
+ o validate close cb on server when client connection closes (2f782af)
+ o Fix two unlocked reads in evbuffer. (7116bf2)
+ o When working without a current event base, don't try to use IOCP listeners (cb52838)
+ o Fix getpid() usage on Windows (ff2a134)
+ o Add a unit test for secure rng. (48a29b6)
+ o Add some headers to fix freebsd compilation (b72be50)
+ o When connect() succeeds immediately, don't invoke the callback immediately. (7515de9)
+ o Suspend read/write on bufferevents during hostname lookup (db08f64)
+ o Make bufferevent_free() clear all callbacks immediately. (b2fbeb3)
+ o Fix some race conditions in persistent events and event_reinit (e2642f0)
+ o Fix a bug in resetting timeouts on persistent events when IO triggers. (38ec0a7)
+ o Add a test for timeouts on filtering bufferevents. (c02bfe1)
+ o Add test for periodic timers that get activated for other reasons (8fcb7a1)
+ o Use new timeval diff comparison function in bufferevent test (f3dfe46)
+ o Delete stack-alloced event in new unit test before returning. (7ffd387)
+ o Fix mingw compilation (23170a6)
+ o Try to define a sane _EVENT_SIZEOF_SIZE_T for msvc compilation (1e14f82)
+ o Fix arc4random compilation on MSVC. (98edb89)
+ o deal with connect() failing immediately (7bc48bf)
+ o Small cleanups on freebsd-connect-refused patch. (57b7248)
+
+BUILD AND DISTRIBUTION CHANGES
+ o Remove the contents of WIN32-Prj as unmaintained. (c69d5a5)
+ o Allow the user to redirect the verbose output of test/test.sh to a file (c382de6)
+ o Allow test.sh to be run as ./test/test.sh (7dfbe94)
+ o Never believe that we have pthreads on win32, even if gcc thinks we do. (78ed097)
+ o Make it compile under gcc --std=c89. (e2ca403)
+ o Fix a number of warnings from gcc -pedantic (918e9c5)
+ o Add the msvc-generated .lib files to .gitignore. (e244a2e)
+ o Add the "compile" script to gitignore. (1ba6bed)
+
+INTERNALS AND CODE CLEANUPS
+ o Add a .gitignore file. (ba34071)
+ o New EVTHREAD_TRY_LOCK function to try to grab a lock. (689fc09)
+ o Add the abilitity to mark some buffer callbacks as never-deferred. (438f9ed)
+ o Refactor our 'suspend operation' logic on bufferevents. (0d744aa)
+ o Simplify the read high-watermark checking. (5846bf6)
+ o Improve readability of evutil_unparse_protoname() (5a43df8 Jardel Weyrich)
+ o Expose our cached gettimeofday value with a new interface (47854a8)
+ o Whitespace fixes in test.sh (0b151a9)
+ o Enable branch-prediction hints with EVUTIL_UNLIKELY. (eaaf27f)
+ o Refactor code from evdns into a new internal "read a file" function. (0f7144f)
+ o Comestic changes in evconnlistener_new(), new_accepting_socket(), accepted_socket_invoke_user_cb() and iocp_listener_enable(). (510ab6b Jardel Weyrich)
+ o Add unit-test for bad_request bug fixed in 1.4 recently. (6cc79c6 Pavel Plesov) o Add a comment on evthread_enable_lock_debuging. (b9f43b2)
+ o Fix test.sh on shells without echo -n (94131e9)
+ o More unit tests for getaddrinfo_async: v4timeout and cancel. (a334b31)
+ o Make http use evconnlistener. (ec34533)
+ o move dns utility functions into a separate file so that we can use them for http testing (b822639)
+ o add a test for evhttp_connection_base_new with a dns_base (26714ca)
+ o forgot to add void to test function (78a50fe)
+ o Add a forgotten header (changelist-internal.h) (4b9f307)
+ o Remove some commented-out code in evutil (26e1b6f)
+ o Remove a needless include of rpc_compat.h (70a4a3e)
+ o Use less memory for each entry in a hashtable (a66e947)
+ o Try to untangle the logic in server_port_flush(). (439aea0)
+ o Use ev_[u]intptr_t types in place of [u]intptr_t (cef61a2)
+ o Reduce windows header includes in our own headers. (da6135e)
+ o clean up terminate_chunked test (e8a9782)
+ o Increment the submicro version number. (63e868e)
+ o Update event-config.h version number to match configure.in (aae7db5)
+ o Clean up formatting: Disallow space-before-tab. (8fdf09c)
+ o Clean up formatting: use tabs, not 8-spaces, to indent. (e5bbd40)
+ o Clean up formatting: remove trailing spaces (e5cf987)
+ o Clean up formatting: function/keyword spacing consistency. (4faeaea)
+
+
+
+Changes in 2.0.3-alpha (20 Nov 2009):
+ o Add a new code to support SSL/TLS on bufferevents, using the OpenSSL library (where available).
+ o Fix a bug where we didn't allocate enough memory in event_get_supported_methods().
+ o Avoid segfault during failed allocation of locked evdns_base. (Found by Rocco Carbone.)
+ o Export new evutil_ascii_* functions to perform locale-independent character type operations.
+ o Try to compile better with MSVC: patches from Brodie Thiesfield
+ o New evconnlistener_get_fd function to expose a listener's associated socket.
+ o Expose an ev_socklen_t type for consistent use across platforms.
+ o Make bufferevent_socket_connect() work when the original fd was -1.
+ o Fix a bug in bufferevent_socket_connect() when the connection succeeds too quickly.
+ o Export an evutil_sockaddr_cmp() to compare to sockaddr objects for equality.
+ o Add a bufferevent_get_enabled() to tell what a bufferevent has been configured to do.
+ o Add an evbuffer_search_eol() function to locate the end of a line nondestructively.
+ o Add an evbuffer_search_range() function to search a bounded range of a buffer.
+ o Fix a rare crash bug in evdns.
+ o Have bufferevent_socket_connect() with no arguments put a bufferevent into connecting mode.
+ o Support sendfile on Solaris: patch from Caitlin Mercer.
+ o New functions to explicitly reference a socket used by an evhttp object. Patches from David Reiss.
+ o When we send a BEV_EVENT_CONNECTED to indicate connected status, we no longer invoke the write callback as well unless we actually wrote data too.
+ o If the kernel tells us that there are a negative number of bytes to read from a socket, do not believe it. Fixes bug 2841177; found by Alexander Pronchenkov.
+ o Do not detect whether we have monotonic clock support every time a new event base is created: instead do it only once. Patch taken from Chromium.
+ o Do not allocate the maximum event queue for the epoll backend at startup. Instead, start out accepting 32 events at a time, and double the queue's size when it seems that the OS is generating events faster than we're requesting them. Saves up to 374K per epoll-based event_base. Resolves bug 2839240.
+ o Treat an event with a negative fd as valid but untriggerable by Libevent. This is useful for applications that want to manually activate events.
+ o Fix compilation on Android, which forgot to define fd_mask in its sys/select.h
+ o Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
+ o New event_base_got_exit() and event_base_got_break() functions to tell whether an event loop exited because of an event_base_loopexit() or an event_base_loopbreak(). Patch from Ka-Hing Cheung.
+ o When adding or deleting an event from a non-main thread, only wake up the main thread when its behavior actually needs to change.
+ o Fix some bugs when using the old evdns interfaces to initialize the evdns module.
+ o Detect errors during bufferevent_connect(). Patch from Christopher Davis.
+ o Fix compilation for listener.h for C++ - missing extern "C". Patch from Ferenc Szalai.
+ o Make the event_base_loop() family of functions respect thread-safety better. This should clear up a few hard-to-debug race conditions.
+ o Fix a bug when using a specialized memory allocator on win32.
+ o Have the win32 select() backend label TCP-socket-connected events as EV_WRITE, not EV_READ. This should bring it in line with the other backends, and improve portability. Patch from Christopher Davis.
+ o Stop using enums as arguments or return values when what we mean is a bitfield of enum values. C++ doesn't believe that you can OR two enum values together and get another enum, and C++ takes its typing seriously. Patch from Christopher Davis.
+ o Add an API to replace all fatal calls to exit() with a user-provided panic function.
+ o Replace all assert() calls with a variant that is aware of the user-provided logging and panic functions.
+ o Add a return value to event_assign so that it can fail rather than asserting when the user gives it bad input. event_set still dies on bad input.
+ o The event_base_new() and event_base_new_with_config() functions now never call exit() on failure. For backward "compatibility", event_init() still does, but more consistently.
+ o Remove compat/sys/_time.h. It interfered with system headers on HPUX, and its functionality has been subsumed by event2/util.h and util-internal.h.
+ o Add a new bufferevent_socket_connect_hostname() to encapsulate the resolve-then-connect operation.
+ o Build kqueue.c correctly on GNU/kFreeBSD platforms. Patch pulled upstream from Debian.
+ o Alternative queue-based timeout algorithm for programs that use a large number of timeouts with the same value.
+ o New event_base_config option to disable the timeval cache entirely.
+ o Make EV_PERSIST timeouts more accurate: schedule the next event based on the scheduled time of the previous event, not based on the current time.
+ o Allow http.c to handle cases where getaddrinfo returns an IPv6 address. Patch from Ryan Phillips.
+ o Fix a problem with excessive memory allocation when using multiple event priorities.
+ o Default to using arc4random for DNS transaction IDs on systems that have it; from OpenBSD.
+ o Never check the environment when we're running setuid or setgid; from OpenBSD.
+ o Options passed to evdns_set_option() no longer need to end with a colon.
+ o Add an evutil_getaddrinfo() function to clone getaddrinfo on platforms that don't have it.
+ o Add an evdns_getaddrinfo() function to provide a nonblocking getaddrinfo using evdns, so programs can perform useful hostname lookup.
+ o Finally expose the IOCP-based bufferevent backend. It passes its unit tests, but probably still has some bugs remaining. Code by Nick Mathewson and Christopher Davis.
+ o Numerous other bugfixes.
+ o On FreeBSD and other OSes, connect can return ECONREFUSED immediately; instead of failing the function call, pretend with faileld in the callback.
+ o Fix a race condition in the pthreads test case; found by Nick Mathewson
+ o Remove most calls to event_err() in http and deal with memory errors instead
+
+
+
+Changes in 2.0.2-alpha (25 Jul 2009):
+ o Add a new flag to bufferevents to make all callbacks automatically deferred.
+ o Make evdns functionality locked, and automatically defer dns callbacks.
+ o Fix a possible free(NULL) when freeing an event_base with no signals.
+ o Add a flag to disable checking environment varibles when making an event_base
+ o Disallow setting less than 1 priority.
+ o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen]
+ o Use signal.h, not sys/signal.h. [Patch from mmadia]
+ o Try harder to build with certain older c99 compilers.
+ o Make sure that an event_config's flags field is always initialized to 0. [Bug report from Victor Goya]
+ o Avoid data corruption when reading data entirely into the second-to-last chain of an evbuffer. [Bug report from Victor Goya]
+ o Make sendfile work on FreeBSD
+ o Do not use vararg macros for accessing evrpc structures; this is not backwards compatible, but we did not promise any backwards compatibility for the rpc code.
+ o Actually define the event_config_set_flag() function.
+ o Try harder to compile with Visual C++.
+ o Move event_set() and its allies to event2/event_compat.h where they belong.
+ o Remove the event_gotsig code, which has long been deprecated and unused.
+ o Add an event_get_base() function to return the base assigned to an event.
+ o New function to automate connecting on a socket-based bufferevent.
+ o New functions to automate listening for incoming TCP connections.
+ o Do case-insensitive checks with a locale-independent comparison function.
+ o Rename the evbuffercb and everrorcb callbacks to bufferevent_data_cb and bufferevent_event_cb respectively. The old names are available in bufferevent_compat.h.
+ o Rename the EVBUFFER_* codes used by bufferevent event callbacks to BEV_EVENT_*, to avoid namespace collision with evbuffer flags. The old names are available in bufferevent_compat.h.
+ o Move the EVBUFFER_INPUT and EVBUFFER_OUTPUT macros to bufferevent_compat.h
+ o Add a bufferevent_getfd() function to mirror bufferevent_setfd()
+ o Make bufferevent_setfd() return an error code if the operation is not successful.
+ o Shave 22 bytes off struct event on 32-bit platforms by shrinking and re-ordering fields. The savings on 64-bit platforms is likely higher.
+ o Cap the maximum number of priorities at 256.
+ o Change the semantics of evbuffer_cb_set_flags() to be set-flag only; add a new evbuffer_cb_clear_flags() to remove set flags.
+ o Change the interface of evbuffer_add_reference so that the cleanup callback gets more information
+ o Revise the new evbuffer_reserve_space/evbuffer_commit_space() interfaces so that you can use them without causing extraneous copies or leaving gaps in the evbuffer.
+ o Add a new evbuffer_peek() interface to inspect data in an evbuffer without removing it.
+ o Fix a deadlock when suspending reads in a bufferevent due to a full buffer. (Spotted by Joachim Bauch.)
+ o Fix a memory error when freeing a thread-enabled event base with registered events. (Spotted by Joachim Bauch.)
+ o Try to contain degree of failure when running on a win32 version so heavily firewalled that we can't fake a socketpair.
+ o Activate fd events in a pseudorandom order with O(N) backends, so that we don't systematically favor low fds (select) or earlier-added fds (poll, win32).
+ o Replace some read()/write() instances with send()/recv() to work properly on win32.
+ o Set truncated flag correctly in evdns server replies.
+ o Raise RpcGenError in event_rpcgen.py; from jmanison and Zack Weinberg
+ o Fix preamble of rpcgen-generated files to rely on event2 includes; based on work by jmansion; patch from Zack Weinberg.
+ o Allow specifying the output filename for rpcgen; based on work by jmansion; patch from Zack Weinberg.
+ o Allow C identifiers as struct names; allow multiple comments in .rpc files; from Zack Weinberg
+ o Mitigate a race condition when using socket bufferevents in multiple threads.
+ o Use AC_SEARCH_LIBS, not AC_CHECK_LIB to avoid needless library use.
+ o Do not allow event_del(ev) to return while that event's callback is executing in another thread. This fixes a nasty race condition.
+ o event_get_supported_methods() now lists methods that have been disabled with the EVENT_NO* environment options.
+ o Rename encode_int[64] to evtag_encode_int[64] to avoid polluting the global namespace. The old method names are still available as macros in event2/tag_compat.h.
+
+
+
+Changes in 2.0.1-alpha (17 Apr 2009):
+ o free minheap on event_base_free(); from Christopher Layne
+ o debug cleanups in signal.c; from Christopher Layne
+ o provide event_base_new() that does not set the current_base global
+ o bufferevent_write now uses a const source argument; report from Charles Kerr
+ o improve documentation on event_base_loopexit; patch from Scott Lamb
+ o New function, event_{base_}loopbreak. Like event_loopexit, it makes an event loop stop executing and return. Unlike event_loopexit, it keeps subsequent pending events from getting executed. Patch from Scott Lamb
+ o Check return value of event_add in signal.c
+ o provide event_reinit() to reintialize an event_base after fork
+ o New function event_set_mem_functinons. It allows the user to give libevent replacement functions to use for memory management in place of malloc(), free(), etc. This should be generally useful for memory instrumentation, specialized allocators, and so on.
+ o The kqueue implementation now catches signals that are raised after event_add() is called but before the event_loop() call. This makes it match the other implementations.
+ o The kqueue implementation now restores original signal handlers correctly when its signal events are removed.
+ o Check return value of event_add in signal.c
+ o Add a more powerful evbuffer_readln as a replacement for evbuffer_readline. The new function handles more newline styles, and is more useful with buffers that may contain a nul characters.
+ o Do not mangle socket handles on 64-bit windows.
+ o The configure script now takes an --enable-gcc-warnigns option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.)
+ o move EV_PERSIST handling out of the event backends
+ o small improvements to evhttp documentation
+ o always generate Date and Content-Length headers for HTTP/1.1 replies
+ o set the correct event base for HTTP close events
+ o When building with GCC, use the "format" attribute to verify type correctness of calls to printf-like functions.
+ o Rewrite win32.c backend to be O(n lg n) rather than O(n^2).
+ o Removed obsoleted recalc code
+ o support for 32-bit tag numbers in rpc structures; this is wire compatible, but changes the API slightly.
+ o pull setters/getters out of RPC structures into a base class to which we just need to store a pointer; this reduces the memory footprint of these structures.
+ o prefix {encode,decode}_tag functions with evtag to avoid collisions
+ o fix a bug with event_rpcgen for integers
+ o Correctly handle DNS replies with no answers set (Fixes bug 1846282)
+ o add -Wstrict-aliasing to warnings and more cleanup
+ o removed linger from http server socket; reported by Ilya Martynov
+ o event_rpcgen now allows creating integer arrays
+ o support string arrays in event_rpcgen
+ o change evrpc hooking to allow pausing of RPCs; this will make it possible for the hook to do some meaning ful work; this is not backwards compatible.
+ o allow an http request callback to take ownership of a request structure
+ o allow association of meta data with RPC requests for hook processing
+ o associate more context for hooks to query such as the connection object
+ o remove pending timeouts on event_base_free()
+ o also check EAGAIN for Solaris' event ports; from W.C.A. Wijngaards
+ o devpoll and evport need reinit; tested by W.C.A Wijngaards
+ o event_base_get_method; from Springande Ulv
+ o Send CRLF after each chunk in HTTP output, for compliance with RFC2626. Patch from "propanbutan". Fixes bug 1894184.
+ o Add a int64_t parsing function, with unit tests, so we can apply Scott Lamb's fix to allow large HTTP values.
+ o Use a 64-bit field to hold HTTP content-lengths. Patch from Scott Lamb.
+ o Allow regression code to build even without Python installed
+ o remove NDEBUG ifdefs from evdns.c
+ o detect integer types properly on platforms without stdint.h
+ o udpate documentation of event_loop and event_base_loop; from Tani Hosokawa.
+ o simplify evbuffer by removing orig_buffer
+ o do not insert event into list when evsel->add fails
+ o add support for PUT/DELETE requests; from Josh Rotenberg
+ o introduce evhttp_accept_socket() to accept from an already created socket
+ o include Content-Length in reply for HTTP/1.0 requests with keep-alive
+ o increase listen queue for http sockets to 128; if that is not enough the evhttp_accpet_socket() api can be used with a prepared socket.
+ o Patch from Tani Hosokawa: make some functions in http.c threadsafe.
+ o test support for PUT/DELETE requests; from Josh Rotenberg
+ o rewrite of the evbuffer code to reduce memory copies
+ o Some older Solaris versions demand that _REENTRANT be defined to get strtok_r(); do so.
+ o Do not free the kqop file descriptor in other processes, also allow it to be 0; from Andrei Nigmatulin
+ o Provide OpenSSL style support for multiple threads accessing the same event_base
+ o make event_rpcgen.py generate code include event-config.h; reported by Sam Banks.
+ o switch thread support so that locks get allocated as they are needed.
+ o make event methods static so that they are not exported; from Andrei Nigmatulin
+ o make RPC replies use application/octet-stream as mime type
+ o do not delete uninitialized timeout event in evdns
+ o Correct the documentation on buffer printf functions.
+ o Don't warn on unimplemented epoll_create(): this isn't a problem, just a reason to fall back to poll or select.
+ o Correctly handle timeouts larger than 35 minutes on Linux with epoll.c. This is probably a kernel defect, but we'll have to support old kernels anyway even if it gets fixed.
+ o Make name_from_addr() threadsafe in http.c
+ o Add new thread-safe interfaces to evdns functions.
+ o Make all event_tagging interfaces threadsafe.
+ o Rename internal memory management functions.
+ o New functions (event_assign, event_new, event_free) for use by apps that want to be safely threadsafe, or want to remain ignorant of the contents of struct event.
+ o introduce bufferevent_read_buffer; allows reading without memory copy.
+ o expose bufferevent_setwatermark via header files and fix high watermark on read
+ o fix a bug in buffrevent read water marks and add a test for them
+ o fix a bug in which bufferevent_write_buffer would not schedule a write event
+ o provide bufferevent_input and bufferevent_output without requiring knowledge of the structure
+ o introduce bufferevent_setcb and bufferevent_setfd to allow better manipulation of bufferevents
+ o convert evhttp_connection to use bufferevents.
+ o use libevent's internal timercmp on all platforms, to avoid bugs on old platforms where timercmp(a,b,<=) is buggy.
+ o Remove the never-exported, never-used evhttp_hostportfile function.
+ o Support input/output filters for bufferevents; somewhat similar to libio's model. This will allow us to implement SSL, compression, etc, transparently to users of bufferevents such as the http layer.
+ o allow connections to be removed from an rpc pool
+ o add new evtimer_assign, signal_assign, evtimer_new, and signal_new functions to manipulate timer and signal events, analagous to the now-recommended event_assign and event_new
+ o switch internal uses of event_set over to use event_assign.
+ o introduce evbuffer_contiguous_space() api that tells a user how much data is available in the first buffer chain
+ o introduce evbuffer_reserve_space() and evbuffer_commit_space() to make processing in filters more efficient.
+ o reduce system calls for getting current time by caching it.
+ o separate signal events from io events; making the code less complex.
+ o support for periodic timeouts
+ o support for virtual HTTP hosts.
+ o turn event_initialized() into a function, and add function equivalents to EVENT_SIGNAL and EVENT_FD so that people don't need to include event_struct.h
+ o Build test directory correctly with CPPFLAGS set.
+ o Provide an API for retrieving the supported event mechanisms.
+ o event_base_new_with_config() and corresponding config APIs.
+ o migrate the evhttp header to event2/ but accessors are still missing.
+ o deprecate timeout_* event functions by moving them to event_compat.h
+ o Move windows gettimeofday replacement into a new evutil_gettimeofday().
+ o Make configure script work on IRIX.
+ o provide a method for canceling ongoing http requests.
+ o Make vsnprintf() returns consistent on win32.
+ o Fix connection keep-alive behavior for HTTP/1.0
+ o Fix use of freed memory in event_reinit; pointed out by Peter Postma
+ o constify struct timeval * where possible
+ o make event_get_supported_methods obey environment variables
+ o support for edge-triggered events on epoll and kqueue backends: patch from Valery Kholodkov
+ o support for selecting event backends by their features, and for querying the features of a backend.
+ o change failing behavior of event_base_new_with_config: if a config is provided and no backend is selected, return NULL instead of aborting.
+ o deliver partial data to request callbacks when chunked callback is set even if there is no chunking on the http level; allows cancelation of requests from within the chunked callback; from Scott Lamb.
+ o allow min_heap_erase to be called on removed members; from liusifan.
+ o Rename INPUT and OUTPUT to EVRPC_INPUT and EVRPC_OUTPUT. Retain INPUT/OUTPUT aliases on on-win32 platforms for backwards compatibility.
+ o Do not use SO_REUSEADDR when connecting
+ o Support 64-bit integers in RPC structs
+ o Correct handling of trailing headers in chunked replies; from Scott Lamb.
+ o Support multi-line HTTP headers; based on a patch from Moshe Litvin
+ o Reject negative Content-Length headers; anonymous bug report
+ o Detect CLOCK_MONOTONIC at runtime for evdns; anonymous bug report
+ o Various HTTP correctness fixes from Scott Lamb
+ o Fix a bug where deleting signals with the kqueue backend would cause subsequent adds to fail
+ o Support multiple events listening on the same signal; make signals regular events that go on the same event queue; problem report by Alexander Drozdov.
+ o Fix a problem with epoll() and reinit; problem report by Alexander Drozdov.
+ o Fix off-by-one errors in devpoll; from Ian Bell
+ o Make event_add not change any state if it fails; reported by Ian Bell.
+ o Fix a bug where headers arriving in multiple packets were not parsed; fix from Jiang Hong; test by me.
+ o Match the query in DNS replies to the query in the request; from Vsevolod Stakhov.
+ o Add new utility functions to correctly observe and log winsock errors.
+ o Do not remove Accept-Encoding header
+ o Clear the timer cache on entering the event loop; reported by Victor Chang
+ o Only bind the socket on connect when a local address has been provided; reported by Alejo Sanchez
+ o Allow setting of local port for evhttp connections to support millions of connections from a single system; from Richard Jones.
+ o Clear the timer cache when leaving the event loop; reported by Robin Haberkorn
+ o Fix a typo in setting the global event base; reported by lance.
+ o Set the 0x20 bit on outgoing alphabetic characters in DNS requests randomly, and insist on a match in replies. This helps resist DNS poisoning attacks.
+ o Make the http connection close detection work properly with bufferevents and fix a potential memory leak associated with it.
+ o Restructure the event backends so that they do not need to keep track of events themselves, as a side effect multiple events can use the same fd or signal.
+ o Add generic implementations for parsing and emiting IPv6 addresses on platforms that do not have inet_ntop and/or inet_pton.
+ o Allow DNS servers that have IPv6 addresses.
+ o Add an evbuffer_write_atmost() function to write a limited number of bytes to an fd.
+ o Refactor internal notify-main-thread logic to prefer eventfd to pipe, then pipe to socketpair, and only use socketpairs as a last resort.
+ o Try harder to pack all evbuffer reads into as few chains as possible, using readv/WSARecv as appropriate.
+ o New evthread_use_windows_threads() and evthread_use_pthreads() functions to set up the evthread callbacks with reasonable defaults.
+ o Change the semantics of timeouts in conjunction with EV_PERSIST; timeouts in that case will now repeat until deleted.
+ o sendfile, mmap and memory reference support for evbuffers.
+ o New evutil_make_listen_socket_reuseable() to abstract SO_REUSEADDR.
+ o New bind-to option to allow DNS clients to bind to an arbitrary port for outgoing requests.
+ o evbuffers can now be "frozen" to prevent operations at one or both ends.
+ o Bufferevents now notice external attempts to add data to an inbuf or remove it from an outbuf, and stop them.
+ o Fix parsing of queries where the encoded queries contained \r, \n or +
+ o Do not allow internal events to starve lower-priority events.
+
diff --git a/sntp/libevent/Doxyfile b/sntp/libevent/Doxyfile
new file mode 100644
index 0000000..d9d6603
--- /dev/null
+++ b/sntp/libevent/Doxyfile
@@ -0,0 +1,257 @@
+# Doxyfile 1.5.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = libevent
+
+# Place all output under 'doxygen/'
+
+OUTPUT_DIRECTORY = doxygen/
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = include/
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = \
+ include/event2/buffer.h \
+ include/event2/buffer_compat.h \
+ include/event2/bufferevent.h \
+ include/event2/bufferevent_compat.h \
+ include/event2/bufferevent_ssl.h \
+ include/event2/dns.h \
+ include/event2/dns_compat.h \
+ include/event2/event.h \
+ include/event2/event_compat.h \
+ include/event2/http.h \
+ include/event2/http_compat.h \
+ include/event2/listener.h \
+ include/event2/rpc.h \
+ include/event2/rpc_compat.h \
+ include/event2/tag.h \
+ include/event2/tag_compat.h \
+ include/event2/thread.h \
+ include/event2/util.h
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = TAILQ_ENTRY RB_ENTRY EVENT_DEFINED_TQENTRY_ EVENT_IN_DOXYGEN_
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
diff --git a/sntp/libevent/LICENSE b/sntp/libevent/LICENSE
new file mode 100644
index 0000000..402ca50
--- /dev/null
+++ b/sntp/libevent/LICENSE
@@ -0,0 +1,99 @@
+Libevent is available for use under the following license, commonly known
+as the 3-clause (or "modified") BSD license:
+
+==============================
+Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+==============================
+
+Portions of Libevent are based on works by others, also made available by
+them under the three-clause BSD license above. The copyright notices are
+available in the corresponding source files; the license is as above. Here's
+a list:
+
+log.c:
+ Copyright (c) 2000 Dug Song <dugsong@monkey.org>
+ Copyright (c) 1993 The Regents of the University of California.
+
+strlcpy.c:
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+
+win32select.c:
+ Copyright (c) 2003 Michael A. Davis <mike@datanerds.net>
+
+evport.c:
+ Copyright (c) 2007 Sun Microsystems
+
+ht-internal.h:
+ Copyright (c) 2002 Christopher Clark
+
+minheap-internal.h:
+ Copyright (c) 2006 Maxim Yegorushkin <maxim.yegorushkin@gmail.com>
+
+==============================
+
+The arc4module is available under the following, sometimes called the
+"OpenBSD" license:
+
+ Copyright (c) 1996, David Mazieres <dm@uun.org>
+ Copyright (c) 2008, Damien Miller <djm@openbsd.org>
+
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+==============================
+
+The Windows timer code is based on code from libutp, which is
+distributed under this license, sometimes called the "MIT" license.
+
+
+Copyright (c) 2010 BitTorrent, Inc.
+
+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.
diff --git a/sntp/libevent/Makefile.am b/sntp/libevent/Makefile.am
new file mode 100644
index 0000000..58f1f01
--- /dev/null
+++ b/sntp/libevent/Makefile.am
@@ -0,0 +1,301 @@
+# Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+# 'foreign' means that we're not enforcing GNU package rules strictly.
+# '1.9' means that we need automake 1.9 or later (and we do).
+AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
+
+ACLOCAL_AMFLAGS = -I m4
+
+# This is the "Release" of the Libevent ABI. It takes precedence over
+# the VERSION_INFO, so that two versions of Libevent with the same
+# "Release" are never binary-compatible.
+#
+# This number incremented once for the 2.0 release candidate, and
+# will increment for each series until we revise our interfaces enough
+# that we can seriously expect ABI compatibility between series.
+#
+RELEASE = -release 2.1
+
+# This is the version info for the libevent binary API. It has three
+# numbers:
+# Current -- the number of the binary API that we're implementing
+# Revision -- which iteration of the implementation of the binary
+# API are we supplying?
+# Age -- How many previous binary API versions do we also
+# support?
+#
+# To increment a VERSION_INFO (current:revision:age):
+# If the ABI didn't change:
+# Return (current:revision+1:age)
+# If the ABI changed, but it's backward-compatible:
+# Return (current+1:0:age+1)
+# If the ABI changed and it isn't backward-compatible:
+# Return (current+1:0:0)
+#
+# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
+# UNLESS YOU REALLY REALLY HAVE TO.
+VERSION_INFO = 3:0:0
+
+# History: RELEASE VERSION_INFO
+# 2.0.1-alpha -- 2.0 1:0:0
+# 2.0.2-alpha -- 2:0:0
+# 2.0.3-alpha -- 2:0:0 (should have incremented; didn't.)
+# 2.0.4-alpha -- 3:0:0
+# 2.0.5-beta -- 4:0:0
+# 2.0.6-rc -- 2.0 2:0:0
+# 2.0.7-rc -- 2.0 3:0:1
+# 2.0.8-rc -- 2.0 4:0:2
+# 2.0.9-rc -- 2.0 5:0:0 (ABI changed slightly)
+# 2.0.10-stable-- 2.0 5:1:0 (No ABI change)
+# 2.0.11-stable-- 2.0 6:0:1 (ABI changed, backward-compatible)
+# 2.0.12-stable-- 2.0 6:1:1 (No ABI change)
+# 2.0.13-stable-- 2.0 6:2:1 (No ABI change)
+# 2.0.14-stable-- 2.0 6:3:1 (No ABI change)
+# 2.0.15-stable-- 2.0 6:3:1 (Forgot to update :( )
+# 2.0.16-stable-- 2.0 6:4:1 (No ABI change)
+# 2.0.17-stable-- 2.0 6:5:1 (No ABI change)
+# 2.0.18-stable-- 2.0 6:6:1 (No ABI change)
+# 2.0.19-stable-- 2.0 6:7:1 (No ABI change)
+# 2.0.20-stable-- 2.0 6:8:1 (No ABI change)
+# 2.0.21-stable-- 2.0 6:9:1 (No ABI change)
+#
+# For Libevent 2.1:
+# 2.1.1-alpha -- 2.1 1:0:0
+# 2.1.2-alpha -- 2.1 1:0:0 (should have been 2:0:1)
+# 2.1.3-alpha -- 2.1 3:0:0 (ABI changed slightly)
+
+# ABI version history for this package effectively restarts every time
+# we change RELEASE. Version 1.4.x had RELEASE of 1.4.
+#
+# Ideally, we would not be using RELEASE at all; instead we could just
+# use the VERSION_INFO field to label our backward-incompatible ABI
+# changes, and those would be few and far between. Unfortunately,
+# Libevent still exposes far too many volatile structures in its
+# headers, so we pretty much have to assume that most development
+# series will break ABI compatibility. For now, it's simplest just to
+# keep incrementing the RELEASE between series and resetting VERSION_INFO.
+#
+# Eventually, when we get to the point where the structures in the
+# headers are all non-changing (or not there at all!), we can shift to
+# a more normal worldview where backward-incompatible ABI changes are
+# nice and rare. For the next couple of years, though, 'struct event'
+# is user-visible, and so we can pretty much guarantee that release
+# series won't be binary-compatible.
+
+if INSTALL_LIBEVENT
+dist_bin_SCRIPTS = event_rpcgen.py
+endif
+
+pkgconfigdir=$(libdir)/pkgconfig
+LIBEVENT_PKGCONFIG=libevent.pc
+
+# These sources are conditionally added by configure.ac or conditionally
+# included from other files.
+PLATFORM_DEPENDENT_SRC = \
+ arc4random.c \
+ epoll_sub.c
+
+EXTRA_DIST = \
+ ChangeLog-1.4 \
+ ChangeLog-2.0 \
+ Doxyfile \
+ LICENSE \
+ Makefile.nmake test/Makefile.nmake \
+ autogen.sh \
+ event_rpcgen.py \
+ libevent.pc.in \
+ make-event-config.sed \
+ whatsnew-2.0.txt \
+ whatsnew-2.1.txt \
+ $(PLATFORM_DEPENDENT_SRC)
+
+LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la
+if PTHREADS
+LIBEVENT_LIBS_LA += libevent_pthreads.la
+LIBEVENT_PKGCONFIG += libevent_pthreads.pc
+endif
+if OPENSSL
+LIBEVENT_LIBS_LA += libevent_openssl.la
+LIBEVENT_PKGCONFIG += libevent_openssl.pc
+endif
+
+if INSTALL_LIBEVENT
+lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
+pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
+else
+noinst_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
+endif
+
+EXTRA_SOURCE=
+noinst_HEADERS=
+noinst_PROGRAMS=
+EXTRA_PROGRAMS=
+CLEANFILES=
+DISTCLEANFILES=
+BUILT_SOURCES =
+include include/include.am
+include sample/include.am
+include test/include.am
+
+if BUILD_WIN32
+
+SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
+SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
+ bufferevent_async.c
+SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
+
+else
+
+SYS_LIBS =
+SYS_SRC =
+SYS_INCLUDES =
+
+endif
+
+if STRLCPY_IMPL
+SYS_SRC += strlcpy.c
+endif
+if SELECT_BACKEND
+SYS_SRC += select.c
+endif
+if POLL_BACKEND
+SYS_SRC += poll.c
+endif
+if DEVPOLL_BACKEND
+SYS_SRC += devpoll.c
+endif
+if KQUEUE_BACKEND
+SYS_SRC += kqueue.c
+endif
+if EPOLL_BACKEND
+SYS_SRC += epoll.c
+endif
+if EVPORT_BACKEND
+SYS_SRC += evport.c
+endif
+if SIGNAL_SUPPORT
+SYS_SRC += signal.c
+endif
+
+BUILT_SOURCES += include/event2/event-config.h
+
+include/event2/event-config.h: config.h make-event-config.sed
+ $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
+ $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
+ $(AM_V_at)mv -f $@T $@
+
+CORE_SRC = \
+ buffer.c \
+ bufferevent.c \
+ bufferevent_filter.c \
+ bufferevent_pair.c \
+ bufferevent_ratelim.c \
+ bufferevent_sock.c \
+ event.c \
+ evmap.c \
+ evthread.c \
+ evutil.c \
+ evutil_rand.c \
+ evutil_time.c \
+ listener.c \
+ log.c \
+ $(SYS_SRC)
+
+EXTRAS_SRC = \
+ evdns.c \
+ event_tagging.c \
+ evrpc.c \
+ http.c
+
+if BUILD_WITH_NO_UNDEFINED
+NO_UNDEFINED = -no-undefined
+MAYBE_CORE = libevent_core.la
+else
+NO_UNDEFINED =
+MAYBE_CORE =
+endif
+
+GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED)
+
+libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
+libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
+libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
+
+libevent_core_la_SOURCES = $(CORE_SRC)
+libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
+libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
+
+if PTHREADS
+libevent_pthreads_la_SOURCES = evthread_pthread.c
+libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
+libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
+endif
+
+libevent_extra_la_SOURCES = $(EXTRAS_SRC)
+libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
+libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
+
+if OPENSSL
+libevent_openssl_la_SOURCES = bufferevent_openssl.c
+libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
+libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
+libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
+endif
+
+noinst_HEADERS += \
+ 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 \
+ evbuffer-internal.h \
+ evconfig-private.h \
+ event-internal.h \
+ evmap-internal.h \
+ evrpc-internal.h \
+ evsignal-internal.h \
+ evthread-internal.h \
+ ht-internal.h \
+ http-internal.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
+
+EVENT1_HDRS = \
+ include/evdns.h \
+ include/event.h \
+ include/evhttp.h \
+ include/evrpc.h \
+ include/evutil.h
+
+if INSTALL_LIBEVENT
+include_HEADERS = $(EVENT1_HDRS)
+else
+noinst_HEADERS += $(EVENT1_HDRS)
+endif
+
+AM_CPPFLAGS = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES)
+
+verify: check
+
+doxygen: FORCE
+ doxygen $(srcdir)/Doxyfile
+FORCE:
+
+DISTCLEANFILES += *~ libevent.pc ./include/event2/event-config.h
+
diff --git a/sntp/libevent/Makefile.in b/sntp/libevent/Makefile.in
new file mode 100644
index 0000000..463ae8c
--- /dev/null
+++ b/sntp/libevent/Makefile.in
@@ -0,0 +1,2293 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+# include/Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# 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
+#
+# See LICENSE for copying information.
+
+
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@PTHREADS_TRUE@am__append_1 = libevent_pthreads.la
+@PTHREADS_TRUE@am__append_2 = libevent_pthreads.pc
+@OPENSSL_TRUE@am__append_3 = libevent_openssl.la
+@OPENSSL_TRUE@am__append_4 = libevent_openssl.pc
+noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_5)
+EXTRA_PROGRAMS = $(am__EXEEXT_1)
+DIST_COMMON = README $(am__configure_deps) \
+ $(am__dist_bin_SCRIPTS_DIST) $(am__include_HEADERS_DIST) \
+ $(am__include_event2_HEADERS_DIST) $(am__noinst_HEADERS_DIST) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(srcdir)/evconfig-private.h.in \
+ $(srcdir)/include/include.am $(srcdir)/libevent.pc.in \
+ $(srcdir)/libevent_openssl.pc.in \
+ $(srcdir)/libevent_pthreads.pc.in $(srcdir)/sample/include.am \
+ $(srcdir)/test/include.am $(top_srcdir)/configure ChangeLog \
+ build-aux/compile build-aux/config.guess build-aux/config.sub \
+ build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \
+ build-aux/missing build-aux/ylwrap epoll_sub.c
+@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_REGRESS_TRUE@am__append_8 = $(TESTPROGRAMS)
+@BUILD_REGRESS_TRUE@am__append_9 = test/regress
+@BUILD_REGRESS_TRUE@am__append_10 = test/regress.gen.c test/regress.gen.h
+@PTHREADS_TRUE@am__append_11 = libevent_pthreads.la
+@BUILD_WIN32_TRUE@am__append_12 = test/regress_iocp.c
+@OPENSSL_TRUE@am__append_13 = test/regress_ssl.c
+@OPENSSL_TRUE@am__append_14 = $(OPENSSL_INCS)
+@OPENSSL_TRUE@am__append_15 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
+@STRLCPY_IMPL_TRUE@am__append_16 = strlcpy.c
+@SELECT_BACKEND_TRUE@am__append_17 = select.c
+@POLL_BACKEND_TRUE@am__append_18 = poll.c
+@DEVPOLL_BACKEND_TRUE@am__append_19 = devpoll.c
+@KQUEUE_BACKEND_TRUE@am__append_20 = kqueue.c
+@EPOLL_BACKEND_TRUE@am__append_21 = epoll.c
+@EVPORT_BACKEND_TRUE@am__append_22 = evport.c
+@SIGNAL_SUPPORT_TRUE@am__append_23 = signal.c
+@INSTALL_LIBEVENT_FALSE@am__append_24 = $(EVENT1_HDRS)
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_backport_259_ssizet.m4 \
+ $(top_srcdir)/m4/libevent_openssl.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/m4/openldap.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h evconfig-private.h
+CONFIG_CLEAN_FILES = libevent.pc libevent_openssl.pc \
+ libevent_pthreads.pc
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" \
+ "$(DESTDIR)$(include_event2dir)" \
+ "$(DESTDIR)$(include_event2dir)"
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libevent_la_DEPENDENCIES = @LTLIBOBJS@ $(am__DEPENDENCIES_1)
+am__libevent_la_SOURCES_DIST = buffer.c bufferevent.c \
+ bufferevent_filter.c bufferevent_pair.c bufferevent_ratelim.c \
+ bufferevent_sock.c event.c evmap.c evthread.c evutil.c \
+ evutil_rand.c evutil_time.c listener.c log.c strlcpy.c \
+ select.c poll.c devpoll.c kqueue.c epoll.c evport.c signal.c \
+ win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
+ bufferevent_async.c evdns.c event_tagging.c evrpc.c http.c
+@STRLCPY_IMPL_TRUE@am__objects_1 = strlcpy.lo
+@SELECT_BACKEND_TRUE@am__objects_2 = select.lo
+@POLL_BACKEND_TRUE@am__objects_3 = poll.lo
+@DEVPOLL_BACKEND_TRUE@am__objects_4 = devpoll.lo
+@KQUEUE_BACKEND_TRUE@am__objects_5 = kqueue.lo
+@EPOLL_BACKEND_TRUE@am__objects_6 = epoll.lo
+@EVPORT_BACKEND_TRUE@am__objects_7 = evport.lo
+@SIGNAL_SUPPORT_TRUE@am__objects_8 = signal.lo
+@BUILD_WIN32_FALSE@am__objects_9 = $(am__objects_1) $(am__objects_2) \
+@BUILD_WIN32_FALSE@ $(am__objects_3) $(am__objects_4) \
+@BUILD_WIN32_FALSE@ $(am__objects_5) $(am__objects_6) \
+@BUILD_WIN32_FALSE@ $(am__objects_7) $(am__objects_8)
+@BUILD_WIN32_TRUE@am__objects_9 = win32select.lo evthread_win32.lo \
+@BUILD_WIN32_TRUE@ buffer_iocp.lo event_iocp.lo \
+@BUILD_WIN32_TRUE@ bufferevent_async.lo $(am__objects_1) \
+@BUILD_WIN32_TRUE@ $(am__objects_2) $(am__objects_3) \
+@BUILD_WIN32_TRUE@ $(am__objects_4) $(am__objects_5) \
+@BUILD_WIN32_TRUE@ $(am__objects_6) $(am__objects_7) \
+@BUILD_WIN32_TRUE@ $(am__objects_8)
+am__objects_10 = buffer.lo bufferevent.lo bufferevent_filter.lo \
+ bufferevent_pair.lo bufferevent_ratelim.lo bufferevent_sock.lo \
+ event.lo evmap.lo evthread.lo evutil.lo evutil_rand.lo \
+ evutil_time.lo listener.lo log.lo $(am__objects_9)
+am__objects_11 = evdns.lo event_tagging.lo evrpc.lo http.lo
+am_libevent_la_OBJECTS = $(am__objects_10) $(am__objects_11)
+libevent_la_OBJECTS = $(am_libevent_la_OBJECTS)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+libevent_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libevent_la_LDFLAGS) $(LDFLAGS) -o $@
+@INSTALL_LIBEVENT_FALSE@am_libevent_la_rpath =
+@INSTALL_LIBEVENT_TRUE@am_libevent_la_rpath = -rpath $(libdir)
+libevent_core_la_DEPENDENCIES = @LTLIBOBJS@ $(am__DEPENDENCIES_1)
+am__libevent_core_la_SOURCES_DIST = buffer.c bufferevent.c \
+ bufferevent_filter.c bufferevent_pair.c bufferevent_ratelim.c \
+ bufferevent_sock.c event.c evmap.c evthread.c evutil.c \
+ evutil_rand.c evutil_time.c listener.c log.c strlcpy.c \
+ select.c poll.c devpoll.c kqueue.c epoll.c evport.c signal.c \
+ win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \
+ bufferevent_async.c
+am_libevent_core_la_OBJECTS = $(am__objects_10)
+libevent_core_la_OBJECTS = $(am_libevent_core_la_OBJECTS)
+libevent_core_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(libevent_core_la_LDFLAGS) $(LDFLAGS) \
+ -o $@
+@INSTALL_LIBEVENT_FALSE@am_libevent_core_la_rpath =
+@INSTALL_LIBEVENT_TRUE@am_libevent_core_la_rpath = -rpath $(libdir)
+@BUILD_WITH_NO_UNDEFINED_TRUE@am__DEPENDENCIES_2 = libevent_core.la
+libevent_extra_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
+am_libevent_extra_la_OBJECTS = $(am__objects_11)
+libevent_extra_la_OBJECTS = $(am_libevent_extra_la_OBJECTS)
+libevent_extra_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(libevent_extra_la_LDFLAGS) $(LDFLAGS) \
+ -o $@
+@INSTALL_LIBEVENT_FALSE@am_libevent_extra_la_rpath =
+@INSTALL_LIBEVENT_TRUE@am_libevent_extra_la_rpath = -rpath $(libdir)
+@OPENSSL_TRUE@libevent_openssl_la_DEPENDENCIES = \
+@OPENSSL_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+am__libevent_openssl_la_SOURCES_DIST = bufferevent_openssl.c
+@OPENSSL_TRUE@am_libevent_openssl_la_OBJECTS = \
+@OPENSSL_TRUE@ libevent_openssl_la-bufferevent_openssl.lo
+libevent_openssl_la_OBJECTS = $(am_libevent_openssl_la_OBJECTS)
+libevent_openssl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(libevent_openssl_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+@INSTALL_LIBEVENT_FALSE@@OPENSSL_TRUE@am_libevent_openssl_la_rpath =
+@INSTALL_LIBEVENT_TRUE@@OPENSSL_TRUE@am_libevent_openssl_la_rpath = \
+@INSTALL_LIBEVENT_TRUE@@OPENSSL_TRUE@ -rpath $(libdir)
+@PTHREADS_TRUE@libevent_pthreads_la_DEPENDENCIES = \
+@PTHREADS_TRUE@ $(am__DEPENDENCIES_2)
+am__libevent_pthreads_la_SOURCES_DIST = evthread_pthread.c
+@PTHREADS_TRUE@am_libevent_pthreads_la_OBJECTS = evthread_pthread.lo
+libevent_pthreads_la_OBJECTS = $(am_libevent_pthreads_la_OBJECTS)
+libevent_pthreads_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(libevent_pthreads_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+@INSTALL_LIBEVENT_FALSE@@PTHREADS_TRUE@am_libevent_pthreads_la_rpath =
+@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)
+am__EXEEXT_4 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \
+ test/bench_http$(EXEEXT) test/bench_httpclient$(EXEEXT) \
+ test/test-changelist$(EXEEXT) test/test-dumpevents$(EXEEXT) \
+ test/test-eof$(EXEEXT) test/test-closed$(EXEEXT) \
+ test/test-fdleak$(EXEEXT) test/test-init$(EXEEXT) \
+ test/test-ratelim$(EXEEXT) test/test-time$(EXEEXT) \
+ test/test-weof$(EXEEXT) test/regress$(EXEEXT)
+@BUILD_REGRESS_TRUE@am__EXEEXT_5 = $(am__EXEEXT_4)
+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
+am_test_bench_cascade_OBJECTS = test/bench_cascade.$(OBJEXT)
+test_bench_cascade_OBJECTS = $(am_test_bench_cascade_OBJECTS)
+test_bench_cascade_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
+am_test_bench_http_OBJECTS = test/bench_http.$(OBJEXT)
+test_bench_http_OBJECTS = $(am_test_bench_http_OBJECTS)
+test_bench_http_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
+am_test_bench_httpclient_OBJECTS = test/bench_httpclient.$(OBJEXT)
+test_bench_httpclient_OBJECTS = $(am_test_bench_httpclient_OBJECTS)
+test_bench_httpclient_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ libevent_core.la
+am__test_regress_SOURCES_DIST = test/regress.c test/regress.gen.c \
+ test/regress.gen.h test/regress_buffer.c \
+ test/regress_bufferevent.c test/regress_dns.c \
+ test/regress_et.c test/regress_finalize.c test/regress_http.c \
+ test/regress_listener.c test/regress_main.c \
+ test/regress_minheap.c test/regress_rpc.c \
+ test/regress_testutils.c test/regress_testutils.h \
+ test/regress_util.c test/tinytest.c test/regress_thread.c \
+ test/regress_zlib.c test/regress_iocp.c test/regress_ssl.c
+@BUILD_WIN32_FALSE@@PTHREADS_TRUE@am__objects_12 = test/test_regress-regress_thread.$(OBJEXT)
+@BUILD_WIN32_TRUE@am__objects_12 = \
+@BUILD_WIN32_TRUE@ test/test_regress-regress_thread.$(OBJEXT)
+@ZLIB_REGRESS_TRUE@am__objects_13 = \
+@ZLIB_REGRESS_TRUE@ test/test_regress-regress_zlib.$(OBJEXT)
+@BUILD_WIN32_TRUE@am__objects_14 = \
+@BUILD_WIN32_TRUE@ test/test_regress-regress_iocp.$(OBJEXT)
+@OPENSSL_TRUE@am__objects_15 = \
+@OPENSSL_TRUE@ test/test_regress-regress_ssl.$(OBJEXT)
+am_test_regress_OBJECTS = test/test_regress-regress.$(OBJEXT) \
+ test/test_regress-regress.gen.$(OBJEXT) \
+ test/test_regress-regress_buffer.$(OBJEXT) \
+ test/test_regress-regress_bufferevent.$(OBJEXT) \
+ test/test_regress-regress_dns.$(OBJEXT) \
+ test/test_regress-regress_et.$(OBJEXT) \
+ test/test_regress-regress_finalize.$(OBJEXT) \
+ test/test_regress-regress_http.$(OBJEXT) \
+ test/test_regress-regress_listener.$(OBJEXT) \
+ test/test_regress-regress_main.$(OBJEXT) \
+ test/test_regress-regress_minheap.$(OBJEXT) \
+ test/test_regress-regress_rpc.$(OBJEXT) \
+ test/test_regress-regress_testutils.$(OBJEXT) \
+ test/test_regress-regress_util.$(OBJEXT) \
+ test/test_regress-tinytest.$(OBJEXT) $(am__objects_12) \
+ $(am__objects_13) $(am__objects_14) $(am__objects_15)
+test_regress_OBJECTS = $(am_test_regress_OBJECTS)
+am__DEPENDENCIES_3 = $(am__append_11)
+@OPENSSL_TRUE@am__DEPENDENCIES_4 = libevent_openssl.la \
+@OPENSSL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_regress_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la \
+ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_4)
+test_regress_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(test_regress_LDFLAGS) $(LDFLAGS) -o $@
+am_test_test_changelist_OBJECTS = test/test-changelist.$(OBJEXT)
+test_test_changelist_OBJECTS = $(am_test_test_changelist_OBJECTS)
+test_test_changelist_DEPENDENCIES = libevent_core.la
+am_test_test_closed_OBJECTS = test/test-closed.$(OBJEXT)
+test_test_closed_OBJECTS = $(am_test_test_closed_OBJECTS)
+test_test_closed_DEPENDENCIES = libevent_core.la
+am_test_test_dumpevents_OBJECTS = test/test-dumpevents.$(OBJEXT)
+test_test_dumpevents_OBJECTS = $(am_test_test_dumpevents_OBJECTS)
+test_test_dumpevents_DEPENDENCIES = libevent_core.la
+am_test_test_eof_OBJECTS = test/test-eof.$(OBJEXT)
+test_test_eof_OBJECTS = $(am_test_test_eof_OBJECTS)
+test_test_eof_DEPENDENCIES = libevent_core.la
+am_test_test_fdleak_OBJECTS = test/test-fdleak.$(OBJEXT)
+test_test_fdleak_OBJECTS = $(am_test_test_fdleak_OBJECTS)
+test_test_fdleak_DEPENDENCIES = libevent_core.la
+am_test_test_init_OBJECTS = test/test-init.$(OBJEXT)
+test_test_init_OBJECTS = $(am_test_test_init_OBJECTS)
+test_test_init_DEPENDENCIES = libevent_core.la
+am_test_test_ratelim_OBJECTS = test/test-ratelim.$(OBJEXT)
+test_test_ratelim_OBJECTS = $(am_test_test_ratelim_OBJECTS)
+test_test_ratelim_DEPENDENCIES = libevent_core.la
+am_test_test_time_OBJECTS = test/test-time.$(OBJEXT)
+test_test_time_OBJECTS = $(am_test_test_time_OBJECTS)
+test_test_time_DEPENDENCIES = libevent_core.la
+am_test_test_weof_OBJECTS = test/test-weof.$(OBJEXT)
+test_test_weof_OBJECTS = $(am_test_test_weof_OBJECTS)
+test_test_weof_DEPENDENCIES = libevent_core.la
+am__dist_bin_SCRIPTS_DIST = event_rpcgen.py
+SCRIPTS = $(dist_bin_SCRIPTS)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+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)
+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__test_regress_SOURCES_DIST) \
+ $(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)
+DATA = $(pkgconfig_DATA)
+am__include_HEADERS_DIST = include/evdns.h include/event.h \
+ include/evhttp.h include/evrpc.h include/evutil.h
+am__include_event2_HEADERS_DIST = include/event2/buffer.h \
+ include/event2/buffer_compat.h include/event2/bufferevent.h \
+ include/event2/bufferevent_compat.h \
+ include/event2/bufferevent_ssl.h \
+ include/event2/bufferevent_struct.h include/event2/dns.h \
+ include/event2/dns_compat.h include/event2/dns_struct.h \
+ include/event2/event.h include/event2/event_compat.h \
+ include/event2/event_struct.h include/event2/http.h \
+ include/event2/http_compat.h include/event2/http_struct.h \
+ include/event2/keyvalq_struct.h include/event2/listener.h \
+ include/event2/rpc.h include/event2/rpc_compat.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
+am__noinst_HEADERS_DIST = include/event2/buffer.h \
+ include/event2/buffer_compat.h include/event2/bufferevent.h \
+ include/event2/bufferevent_compat.h \
+ include/event2/bufferevent_ssl.h \
+ include/event2/bufferevent_struct.h include/event2/dns.h \
+ include/event2/dns_compat.h include/event2/dns_struct.h \
+ include/event2/event.h include/event2/event_compat.h \
+ include/event2/event_struct.h include/event2/http.h \
+ include/event2/http_compat.h include/event2/http_struct.h \
+ include/event2/keyvalq_struct.h include/event2/listener.h \
+ include/event2/rpc.h include/event2/rpc_compat.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 \
+ 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 \
+ evbuffer-internal.h evconfig-private.h event-internal.h \
+ evmap-internal.h evrpc-internal.h evsignal-internal.h \
+ evthread-internal.h ht-internal.h http-internal.h \
+ iocp-internal.h ipv6-internal.h kqueue-internal.h \
+ log-internal.h minheap-internal.h mm-internal.h \
+ ratelim-internal.h strlcpy-internal.h time-internal.h \
+ util-internal.h include/evdns.h include/event.h \
+ include/evhttp.h include/evrpc.h include/evutil.h
+HEADERS = $(include_HEADERS) $(include_event2_HEADERS) \
+ $(nodist_include_event2_HEADERS) $(nodist_noinst_HEADERS) \
+ $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EV_LIB_GDI = @EV_LIB_GDI@
+EV_LIB_WS32 = @EV_LIB_WS32@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBEVENT_GC_SECTIONS = @LIBEVENT_GC_SECTIONS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_INCS = @OPENSSL_INCS@
+OPENSSL_LIBADD = @OPENSSL_LIBADD@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_11)
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# 'foreign' means that we're not enforcing GNU package rules strictly.
+# '1.9' means that we need automake 1.9 or later (and we do).
+AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
+ACLOCAL_AMFLAGS = -I m4
+
+# This is the "Release" of the Libevent ABI. It takes precedence over
+# the VERSION_INFO, so that two versions of Libevent with the same
+# "Release" are never binary-compatible.
+#
+# This number incremented once for the 2.0 release candidate, and
+# will increment for each series until we revise our interfaces enough
+# that we can seriously expect ABI compatibility between series.
+#
+RELEASE = -release 2.1
+
+# This is the version info for the libevent binary API. It has three
+# numbers:
+# Current -- the number of the binary API that we're implementing
+# Revision -- which iteration of the implementation of the binary
+# API are we supplying?
+# Age -- How many previous binary API versions do we also
+# support?
+#
+# To increment a VERSION_INFO (current:revision:age):
+# If the ABI didn't change:
+# Return (current:revision+1:age)
+# If the ABI changed, but it's backward-compatible:
+# Return (current+1:0:age+1)
+# If the ABI changed and it isn't backward-compatible:
+# Return (current+1:0:0)
+#
+# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES
+# UNLESS YOU REALLY REALLY HAVE TO.
+VERSION_INFO = 3:0:0
+
+# History: RELEASE VERSION_INFO
+# 2.0.1-alpha -- 2.0 1:0:0
+# 2.0.2-alpha -- 2:0:0
+# 2.0.3-alpha -- 2:0:0 (should have incremented; didn't.)
+# 2.0.4-alpha -- 3:0:0
+# 2.0.5-beta -- 4:0:0
+# 2.0.6-rc -- 2.0 2:0:0
+# 2.0.7-rc -- 2.0 3:0:1
+# 2.0.8-rc -- 2.0 4:0:2
+# 2.0.9-rc -- 2.0 5:0:0 (ABI changed slightly)
+# 2.0.10-stable-- 2.0 5:1:0 (No ABI change)
+# 2.0.11-stable-- 2.0 6:0:1 (ABI changed, backward-compatible)
+# 2.0.12-stable-- 2.0 6:1:1 (No ABI change)
+# 2.0.13-stable-- 2.0 6:2:1 (No ABI change)
+# 2.0.14-stable-- 2.0 6:3:1 (No ABI change)
+# 2.0.15-stable-- 2.0 6:3:1 (Forgot to update :( )
+# 2.0.16-stable-- 2.0 6:4:1 (No ABI change)
+# 2.0.17-stable-- 2.0 6:5:1 (No ABI change)
+# 2.0.18-stable-- 2.0 6:6:1 (No ABI change)
+# 2.0.19-stable-- 2.0 6:7:1 (No ABI change)
+# 2.0.20-stable-- 2.0 6:8:1 (No ABI change)
+# 2.0.21-stable-- 2.0 6:9:1 (No ABI change)
+#
+# For Libevent 2.1:
+# 2.1.1-alpha -- 2.1 1:0:0
+# 2.1.2-alpha -- 2.1 1:0:0 (should have been 2:0:1)
+# 2.1.3-alpha -- 2.1 3:0:0 (ABI changed slightly)
+
+# ABI version history for this package effectively restarts every time
+# we change RELEASE. Version 1.4.x had RELEASE of 1.4.
+#
+# Ideally, we would not be using RELEASE at all; instead we could just
+# use the VERSION_INFO field to label our backward-incompatible ABI
+# changes, and those would be few and far between. Unfortunately,
+# Libevent still exposes far too many volatile structures in its
+# headers, so we pretty much have to assume that most development
+# series will break ABI compatibility. For now, it's simplest just to
+# keep incrementing the RELEASE between series and resetting VERSION_INFO.
+#
+# Eventually, when we get to the point where the structures in the
+# headers are all non-changing (or not there at all!), we can shift to
+# a more normal worldview where backward-incompatible ABI changes are
+# nice and rare. For the next couple of years, though, 'struct event'
+# is user-visible, and so we can pretty much guarantee that release
+# series won't be binary-compatible.
+@INSTALL_LIBEVENT_TRUE@dist_bin_SCRIPTS = event_rpcgen.py
+pkgconfigdir = $(libdir)/pkgconfig
+LIBEVENT_PKGCONFIG = libevent.pc $(am__append_2) $(am__append_4)
+
+# These sources are conditionally added by configure.ac or conditionally
+# included from other files.
+PLATFORM_DEPENDENT_SRC = \
+ arc4random.c \
+ epoll_sub.c
+
+EXTRA_DIST = ChangeLog-1.4 ChangeLog-2.0 Doxyfile LICENSE \
+ Makefile.nmake test/Makefile.nmake autogen.sh event_rpcgen.py \
+ libevent.pc.in make-event-config.sed whatsnew-2.0.txt \
+ whatsnew-2.1.txt $(PLATFORM_DEPENDENT_SRC) \
+ test/check-dumpevents.py test/regress.gen.c test/regress.gen.h \
+ test/regress.rpc test/rpcgen_wrapper.sh test/test.sh
+LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la \
+ $(am__append_1) $(am__append_3)
+@INSTALL_LIBEVENT_TRUE@lib_LTLIBRARIES = $(LIBEVENT_LIBS_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 \
+ 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 \
+ evbuffer-internal.h evconfig-private.h event-internal.h \
+ evmap-internal.h evrpc-internal.h evsignal-internal.h \
+ evthread-internal.h ht-internal.h http-internal.h \
+ iocp-internal.h ipv6-internal.h kqueue-internal.h \
+ log-internal.h minheap-internal.h mm-internal.h \
+ ratelim-internal.h ratelim-internal.h strlcpy-internal.h \
+ time-internal.h util-internal.h $(am__append_24)
+CLEANFILES = test/rpcgen-attempted
+DISTCLEANFILES = test/test-script.sh test/regress.gen.c \
+ test/regress.gen.h *~ libevent.pc \
+ ./include/event2/event-config.h
+BUILT_SOURCES = $(am__append_10) include/event2/event-config.h
+include_event2dir = $(includedir)/event2
+EVENT2_EXPORT = \
+ include/event2/buffer.h \
+ include/event2/buffer_compat.h \
+ include/event2/bufferevent.h \
+ include/event2/bufferevent_compat.h \
+ include/event2/bufferevent_ssl.h \
+ include/event2/bufferevent_struct.h \
+ include/event2/dns.h \
+ include/event2/dns_compat.h \
+ include/event2/dns_struct.h \
+ include/event2/event.h \
+ include/event2/event_compat.h \
+ include/event2/event_struct.h \
+ include/event2/http.h \
+ include/event2/http_compat.h \
+ include/event2/http_struct.h \
+ include/event2/keyvalq_struct.h \
+ include/event2/listener.h \
+ include/event2/rpc.h \
+ include/event2/rpc_compat.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
+
+@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 \
+ test/bench_cascade \
+ test/bench_http \
+ test/bench_httpclient \
+ test/test-changelist \
+ test/test-dumpevents \
+ test/test-eof \
+ test/test-closed \
+ test/test-fdleak \
+ test/test-init \
+ test/test-ratelim \
+ test/test-time \
+ test/test-weof \
+ test/regress
+
+
+# We need to copy this file, since automake doesn't want us to use top_srcdir
+# in TESTS.
+TESTS = test/test-script.sh
+test_test_init_SOURCES = test/test-init.c
+test_test_init_LDADD = libevent_core.la
+test_test_dumpevents_SOURCES = test/test-dumpevents.c
+test_test_dumpevents_LDADD = libevent_core.la
+test_test_eof_SOURCES = test/test-eof.c
+test_test_eof_LDADD = libevent_core.la
+test_test_closed_SOURCES = test/test-closed.c
+test_test_closed_LDADD = libevent_core.la
+test_test_changelist_SOURCES = test/test-changelist.c
+test_test_changelist_LDADD = libevent_core.la
+test_test_weof_SOURCES = test/test-weof.c
+test_test_weof_LDADD = libevent_core.la
+test_test_time_SOURCES = test/test-time.c
+test_test_time_LDADD = libevent_core.la
+test_test_ratelim_SOURCES = test/test-ratelim.c
+test_test_ratelim_LDADD = libevent_core.la -lm
+test_test_fdleak_SOURCES = test/test-fdleak.c
+test_test_fdleak_LDADD = libevent_core.la
+test_regress_SOURCES = test/regress.c test/regress.gen.c \
+ test/regress.gen.h test/regress_buffer.c \
+ test/regress_bufferevent.c test/regress_dns.c \
+ test/regress_et.c test/regress_finalize.c test/regress_http.c \
+ test/regress_listener.c test/regress_main.c \
+ test/regress_minheap.c test/regress_rpc.c \
+ test/regress_testutils.c test/regress_testutils.h \
+ test/regress_util.c test/tinytest.c $(regress_thread_SOURCES) \
+ $(regress_zlib_SOURCES) $(am__append_12) $(am__append_13)
+@BUILD_WIN32_TRUE@regress_thread_SOURCES = test/regress_thread.c
+@PTHREADS_TRUE@regress_thread_SOURCES = test/regress_thread.c
+@ZLIB_REGRESS_TRUE@regress_zlib_SOURCES = test/regress_zlib.c
+test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la \
+ $(PTHREAD_LIBS) $(ZLIB_LIBS) $(am__append_15)
+test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) \
+ $(ZLIB_CFLAGS) -Itest $(am__append_14)
+test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
+test_bench_SOURCES = test/bench.c
+test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+test_bench_cascade_SOURCES = test/bench_cascade.c
+test_bench_cascade_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+test_bench_http_SOURCES = test/bench_http.c
+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 =
+@BUILD_WIN32_TRUE@SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
+@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_16) $(am__append_17) \
+@BUILD_WIN32_FALSE@ $(am__append_18) $(am__append_19) \
+@BUILD_WIN32_FALSE@ $(am__append_20) $(am__append_21) \
+@BUILD_WIN32_FALSE@ $(am__append_22) $(am__append_23)
+@BUILD_WIN32_TRUE@SYS_SRC = win32select.c evthread_win32.c \
+@BUILD_WIN32_TRUE@ buffer_iocp.c event_iocp.c \
+@BUILD_WIN32_TRUE@ bufferevent_async.c $(am__append_16) \
+@BUILD_WIN32_TRUE@ $(am__append_17) $(am__append_18) \
+@BUILD_WIN32_TRUE@ $(am__append_19) $(am__append_20) \
+@BUILD_WIN32_TRUE@ $(am__append_21) $(am__append_22) \
+@BUILD_WIN32_TRUE@ $(am__append_23)
+@BUILD_WIN32_FALSE@SYS_INCLUDES =
+@BUILD_WIN32_TRUE@SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
+CORE_SRC = \
+ buffer.c \
+ bufferevent.c \
+ bufferevent_filter.c \
+ bufferevent_pair.c \
+ bufferevent_ratelim.c \
+ bufferevent_sock.c \
+ event.c \
+ evmap.c \
+ evthread.c \
+ evutil.c \
+ evutil_rand.c \
+ evutil_time.c \
+ listener.c \
+ log.c \
+ $(SYS_SRC)
+
+EXTRAS_SRC = \
+ evdns.c \
+ event_tagging.c \
+ evrpc.c \
+ http.c
+
+@BUILD_WITH_NO_UNDEFINED_FALSE@NO_UNDEFINED =
+@BUILD_WITH_NO_UNDEFINED_TRUE@NO_UNDEFINED = -no-undefined
+@BUILD_WITH_NO_UNDEFINED_FALSE@MAYBE_CORE =
+@BUILD_WITH_NO_UNDEFINED_TRUE@MAYBE_CORE = libevent_core.la
+GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED)
+libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC)
+libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
+libevent_la_LDFLAGS = $(GENERIC_LDFLAGS)
+libevent_core_la_SOURCES = $(CORE_SRC)
+libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
+libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
+@PTHREADS_TRUE@libevent_pthreads_la_SOURCES = evthread_pthread.c
+@PTHREADS_TRUE@libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
+@PTHREADS_TRUE@libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
+libevent_extra_la_SOURCES = $(EXTRAS_SRC)
+libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS)
+libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
+@OPENSSL_TRUE@libevent_openssl_la_SOURCES = bufferevent_openssl.c
+@OPENSSL_TRUE@libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
+@OPENSSL_TRUE@libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
+@OPENSSL_TRUE@libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS)
+EVENT1_HDRS = \
+ include/evdns.h \
+ include/event.h \
+ include/evhttp.h \
+ include/evrpc.h \
+ include/evutil.h
+
+@INSTALL_LIBEVENT_TRUE@include_HEADERS = $(EVENT1_HDRS)
+AM_CPPFLAGS = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES)
+all: $(BUILT_SOURCES) config.h evconfig-private.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/include/include.am $(srcdir)/sample/include.am $(srcdir)/test/include.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+evconfig-private.h: stamp-h2
+ @if test ! -f $@; then \
+ rm -f stamp-h2; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h2; \
+ else :; fi
+
+stamp-h2: $(srcdir)/evconfig-private.h.in $(top_builddir)/config.status
+ @rm -f stamp-h2
+ cd $(top_builddir) && $(SHELL) ./config.status evconfig-private.h
+
+distclean-hdr:
+ -rm -f config.h stamp-h1 evconfig-private.h stamp-h2
+libevent.pc: $(top_builddir)/config.status $(srcdir)/libevent.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+libevent_openssl.pc: $(top_builddir)/config.status $(srcdir)/libevent_openssl.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+libevent_pthreads.pc: $(top_builddir)/config.status $(srcdir)/libevent_pthreads.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libevent.la: $(libevent_la_OBJECTS) $(libevent_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libevent_la_LINK) $(am_libevent_la_rpath) $(libevent_la_OBJECTS) $(libevent_la_LIBADD) $(LIBS)
+libevent_core.la: $(libevent_core_la_OBJECTS) $(libevent_core_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libevent_core_la_LINK) $(am_libevent_core_la_rpath) $(libevent_core_la_OBJECTS) $(libevent_core_la_LIBADD) $(LIBS)
+libevent_extra.la: $(libevent_extra_la_OBJECTS) $(libevent_extra_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libevent_extra_la_LINK) $(am_libevent_extra_la_rpath) $(libevent_extra_la_OBJECTS) $(libevent_extra_la_LIBADD) $(LIBS)
+libevent_openssl.la: $(libevent_openssl_la_OBJECTS) $(libevent_openssl_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libevent_openssl_la_LINK) $(am_libevent_openssl_la_rpath) $(libevent_openssl_la_OBJECTS) $(libevent_openssl_la_LIBADD) $(LIBS)
+libevent_pthreads.la: $(libevent_pthreads_la_OBJECTS) $(libevent_pthreads_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libevent_pthreads_la_LINK) $(am_libevent_pthreads_la_rpath) $(libevent_pthreads_la_OBJECTS) $(libevent_pthreads_la_LIBADD) $(LIBS)
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+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) 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) 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) 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) 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) 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) 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) 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) 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)
+test/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) test/$(DEPDIR)
+ @: > test/$(DEPDIR)/$(am__dirstamp)
+test/bench.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/bench$(EXEEXT): $(test_bench_OBJECTS) $(test_bench_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/bench$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bench_OBJECTS) $(test_bench_LDADD) $(LIBS)
+test/bench_cascade.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/bench_cascade$(EXEEXT): $(test_bench_cascade_OBJECTS) $(test_bench_cascade_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/bench_cascade$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bench_cascade_OBJECTS) $(test_bench_cascade_LDADD) $(LIBS)
+test/bench_http.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/bench_http$(EXEEXT): $(test_bench_http_OBJECTS) $(test_bench_http_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/bench_http$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bench_http_OBJECTS) $(test_bench_http_LDADD) $(LIBS)
+test/bench_httpclient.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/bench_httpclient$(EXEEXT): $(test_bench_httpclient_OBJECTS) $(test_bench_httpclient_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/bench_httpclient$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bench_httpclient_OBJECTS) $(test_bench_httpclient_LDADD) $(LIBS)
+test/test_regress-regress.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress.gen.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_buffer.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_bufferevent.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_dns.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_et.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_finalize.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_http.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_listener.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_main.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_minheap.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_rpc.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_testutils.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_util.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-tinytest.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_thread.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_zlib.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_iocp.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test_regress-regress_ssl.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/regress$(EXEEXT): $(test_regress_OBJECTS) $(test_regress_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/regress$(EXEEXT)
+ $(AM_V_CCLD)$(test_regress_LINK) $(test_regress_OBJECTS) $(test_regress_LDADD) $(LIBS)
+test/test-changelist.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-changelist$(EXEEXT): $(test_test_changelist_OBJECTS) $(test_test_changelist_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-changelist$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_changelist_OBJECTS) $(test_test_changelist_LDADD) $(LIBS)
+test/test-closed.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-closed$(EXEEXT): $(test_test_closed_OBJECTS) $(test_test_closed_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-closed$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_closed_OBJECTS) $(test_test_closed_LDADD) $(LIBS)
+test/test-dumpevents.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-dumpevents$(EXEEXT): $(test_test_dumpevents_OBJECTS) $(test_test_dumpevents_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-dumpevents$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_dumpevents_OBJECTS) $(test_test_dumpevents_LDADD) $(LIBS)
+test/test-eof.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-eof$(EXEEXT): $(test_test_eof_OBJECTS) $(test_test_eof_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-eof$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_eof_OBJECTS) $(test_test_eof_LDADD) $(LIBS)
+test/test-fdleak.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-fdleak$(EXEEXT): $(test_test_fdleak_OBJECTS) $(test_test_fdleak_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-fdleak$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_fdleak_OBJECTS) $(test_test_fdleak_LDADD) $(LIBS)
+test/test-init.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-init$(EXEEXT): $(test_test_init_OBJECTS) $(test_test_init_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-init$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_init_OBJECTS) $(test_test_init_LDADD) $(LIBS)
+test/test-ratelim.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-ratelim$(EXEEXT): $(test_test_ratelim_OBJECTS) $(test_test_ratelim_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-ratelim$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_ratelim_OBJECTS) $(test_test_ratelim_LDADD) $(LIBS)
+test/test-time.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-time$(EXEEXT): $(test_test_time_OBJECTS) $(test_test_time_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-time$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_time_OBJECTS) $(test_test_time_LDADD) $(LIBS)
+test/test-weof.$(OBJEXT): test/$(am__dirstamp) \
+ test/$(DEPDIR)/$(am__dirstamp)
+test/test-weof$(EXEEXT): $(test_test_weof_OBJECTS) $(test_test_weof_DEPENDENCIES) test/$(am__dirstamp)
+ @rm -f test/test-weof$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_test_weof_OBJECTS) $(test_test_weof_LDADD) $(LIBS)
+install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-dist_binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f sample/dns-example.$(OBJEXT)
+ -rm -f sample/event-read-fifo.$(OBJEXT)
+ -rm -f sample/hello-world.$(OBJEXT)
+ -rm -f sample/hostcheck.$(OBJEXT)
+ -rm -f sample/http-server.$(OBJEXT)
+ -rm -f sample/https-client.$(OBJEXT)
+ -rm -f sample/le-proxy.$(OBJEXT)
+ -rm -f sample/openssl_hostname_validation.$(OBJEXT)
+ -rm -f sample/signal-test.$(OBJEXT)
+ -rm -f sample/time-test.$(OBJEXT)
+ -rm -f test/bench.$(OBJEXT)
+ -rm -f test/bench_cascade.$(OBJEXT)
+ -rm -f test/bench_http.$(OBJEXT)
+ -rm -f test/bench_httpclient.$(OBJEXT)
+ -rm -f test/test-changelist.$(OBJEXT)
+ -rm -f test/test-closed.$(OBJEXT)
+ -rm -f test/test-dumpevents.$(OBJEXT)
+ -rm -f test/test-eof.$(OBJEXT)
+ -rm -f test/test-fdleak.$(OBJEXT)
+ -rm -f test/test-init.$(OBJEXT)
+ -rm -f test/test-ratelim.$(OBJEXT)
+ -rm -f test/test-time.$(OBJEXT)
+ -rm -f test/test-weof.$(OBJEXT)
+ -rm -f test/test_regress-regress.$(OBJEXT)
+ -rm -f test/test_regress-regress.gen.$(OBJEXT)
+ -rm -f test/test_regress-regress_buffer.$(OBJEXT)
+ -rm -f test/test_regress-regress_bufferevent.$(OBJEXT)
+ -rm -f test/test_regress-regress_dns.$(OBJEXT)
+ -rm -f test/test_regress-regress_et.$(OBJEXT)
+ -rm -f test/test_regress-regress_finalize.$(OBJEXT)
+ -rm -f test/test_regress-regress_http.$(OBJEXT)
+ -rm -f test/test_regress-regress_iocp.$(OBJEXT)
+ -rm -f test/test_regress-regress_listener.$(OBJEXT)
+ -rm -f test/test_regress-regress_main.$(OBJEXT)
+ -rm -f test/test_regress-regress_minheap.$(OBJEXT)
+ -rm -f test/test_regress-regress_rpc.$(OBJEXT)
+ -rm -f test/test_regress-regress_ssl.$(OBJEXT)
+ -rm -f test/test_regress-regress_testutils.$(OBJEXT)
+ -rm -f test/test_regress-regress_thread.$(OBJEXT)
+ -rm -f test/test_regress-regress_util.$(OBJEXT)
+ -rm -f test/test_regress-regress_zlib.$(OBJEXT)
+ -rm -f test/test_regress-tinytest.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/epoll_sub.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer_iocp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_async.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_filter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_pair.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_ratelim.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_sock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devpoll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evdns.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event_iocp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event_tagging.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evmap.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evport.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evrpc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evthread.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evthread_pthread.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evthread_win32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evutil.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evutil_rand.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evutil_time.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kqueue.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Plo@am__quote@
+@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@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench_httpclient.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-changelist.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-closed.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-dumpevents.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-eof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-fdleak.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-ratelim.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-time.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-weof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress.gen.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_buffer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_bufferevent.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_dns.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_et.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_finalize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_http.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_iocp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_listener.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_minheap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_rpc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_ssl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_testutils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_thread.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-regress_zlib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_regress-tinytest.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libevent_openssl_la-bufferevent_openssl.lo: bufferevent_openssl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_openssl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libevent_openssl_la-bufferevent_openssl.lo -MD -MP -MF $(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Tpo -c -o libevent_openssl_la-bufferevent_openssl.lo `test -f 'bufferevent_openssl.c' || echo '$(srcdir)/'`bufferevent_openssl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Tpo $(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bufferevent_openssl.c' object='libevent_openssl_la-bufferevent_openssl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_openssl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libevent_openssl_la-bufferevent_openssl.lo `test -f 'bufferevent_openssl.c' || echo '$(srcdir)/'`bufferevent_openssl.c
+
+test/test_regress-regress.o: test/regress.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress.Tpo -c -o test/test_regress-regress.o `test -f 'test/regress.c' || echo '$(srcdir)/'`test/regress.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress.Tpo test/$(DEPDIR)/test_regress-regress.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress.c' object='test/test_regress-regress.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress.o `test -f 'test/regress.c' || echo '$(srcdir)/'`test/regress.c
+
+test/test_regress-regress.obj: test/regress.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress.Tpo -c -o test/test_regress-regress.obj `if test -f 'test/regress.c'; then $(CYGPATH_W) 'test/regress.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress.Tpo test/$(DEPDIR)/test_regress-regress.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress.c' object='test/test_regress-regress.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress.obj `if test -f 'test/regress.c'; then $(CYGPATH_W) 'test/regress.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.c'; fi`
+
+test/test_regress-regress.gen.o: test/regress.gen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress.gen.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress.gen.Tpo -c -o test/test_regress-regress.gen.o `test -f 'test/regress.gen.c' || echo '$(srcdir)/'`test/regress.gen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress.gen.Tpo test/$(DEPDIR)/test_regress-regress.gen.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress.gen.c' object='test/test_regress-regress.gen.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress.gen.o `test -f 'test/regress.gen.c' || echo '$(srcdir)/'`test/regress.gen.c
+
+test/test_regress-regress.gen.obj: test/regress.gen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress.gen.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress.gen.Tpo -c -o test/test_regress-regress.gen.obj `if test -f 'test/regress.gen.c'; then $(CYGPATH_W) 'test/regress.gen.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.gen.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress.gen.Tpo test/$(DEPDIR)/test_regress-regress.gen.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress.gen.c' object='test/test_regress-regress.gen.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress.gen.obj `if test -f 'test/regress.gen.c'; then $(CYGPATH_W) 'test/regress.gen.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.gen.c'; fi`
+
+test/test_regress-regress_buffer.o: test/regress_buffer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_buffer.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_buffer.Tpo -c -o test/test_regress-regress_buffer.o `test -f 'test/regress_buffer.c' || echo '$(srcdir)/'`test/regress_buffer.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_buffer.Tpo test/$(DEPDIR)/test_regress-regress_buffer.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_buffer.c' object='test/test_regress-regress_buffer.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_buffer.o `test -f 'test/regress_buffer.c' || echo '$(srcdir)/'`test/regress_buffer.c
+
+test/test_regress-regress_buffer.obj: test/regress_buffer.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_buffer.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_buffer.Tpo -c -o test/test_regress-regress_buffer.obj `if test -f 'test/regress_buffer.c'; then $(CYGPATH_W) 'test/regress_buffer.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_buffer.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_buffer.Tpo test/$(DEPDIR)/test_regress-regress_buffer.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_buffer.c' object='test/test_regress-regress_buffer.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_buffer.obj `if test -f 'test/regress_buffer.c'; then $(CYGPATH_W) 'test/regress_buffer.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_buffer.c'; fi`
+
+test/test_regress-regress_bufferevent.o: test/regress_bufferevent.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_bufferevent.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_bufferevent.Tpo -c -o test/test_regress-regress_bufferevent.o `test -f 'test/regress_bufferevent.c' || echo '$(srcdir)/'`test/regress_bufferevent.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_bufferevent.Tpo test/$(DEPDIR)/test_regress-regress_bufferevent.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_bufferevent.c' object='test/test_regress-regress_bufferevent.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_bufferevent.o `test -f 'test/regress_bufferevent.c' || echo '$(srcdir)/'`test/regress_bufferevent.c
+
+test/test_regress-regress_bufferevent.obj: test/regress_bufferevent.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_bufferevent.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_bufferevent.Tpo -c -o test/test_regress-regress_bufferevent.obj `if test -f 'test/regress_bufferevent.c'; then $(CYGPATH_W) 'test/regress_bufferevent.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_bufferevent.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_bufferevent.Tpo test/$(DEPDIR)/test_regress-regress_bufferevent.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_bufferevent.c' object='test/test_regress-regress_bufferevent.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_bufferevent.obj `if test -f 'test/regress_bufferevent.c'; then $(CYGPATH_W) 'test/regress_bufferevent.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_bufferevent.c'; fi`
+
+test/test_regress-regress_dns.o: test/regress_dns.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_dns.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_dns.Tpo -c -o test/test_regress-regress_dns.o `test -f 'test/regress_dns.c' || echo '$(srcdir)/'`test/regress_dns.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_dns.Tpo test/$(DEPDIR)/test_regress-regress_dns.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_dns.c' object='test/test_regress-regress_dns.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_dns.o `test -f 'test/regress_dns.c' || echo '$(srcdir)/'`test/regress_dns.c
+
+test/test_regress-regress_dns.obj: test/regress_dns.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_dns.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_dns.Tpo -c -o test/test_regress-regress_dns.obj `if test -f 'test/regress_dns.c'; then $(CYGPATH_W) 'test/regress_dns.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_dns.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_dns.Tpo test/$(DEPDIR)/test_regress-regress_dns.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_dns.c' object='test/test_regress-regress_dns.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_dns.obj `if test -f 'test/regress_dns.c'; then $(CYGPATH_W) 'test/regress_dns.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_dns.c'; fi`
+
+test/test_regress-regress_et.o: test/regress_et.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_et.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_et.Tpo -c -o test/test_regress-regress_et.o `test -f 'test/regress_et.c' || echo '$(srcdir)/'`test/regress_et.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_et.Tpo test/$(DEPDIR)/test_regress-regress_et.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_et.c' object='test/test_regress-regress_et.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_et.o `test -f 'test/regress_et.c' || echo '$(srcdir)/'`test/regress_et.c
+
+test/test_regress-regress_et.obj: test/regress_et.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_et.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_et.Tpo -c -o test/test_regress-regress_et.obj `if test -f 'test/regress_et.c'; then $(CYGPATH_W) 'test/regress_et.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_et.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_et.Tpo test/$(DEPDIR)/test_regress-regress_et.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_et.c' object='test/test_regress-regress_et.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_et.obj `if test -f 'test/regress_et.c'; then $(CYGPATH_W) 'test/regress_et.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_et.c'; fi`
+
+test/test_regress-regress_finalize.o: test/regress_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_finalize.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_finalize.Tpo -c -o test/test_regress-regress_finalize.o `test -f 'test/regress_finalize.c' || echo '$(srcdir)/'`test/regress_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_finalize.Tpo test/$(DEPDIR)/test_regress-regress_finalize.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_finalize.c' object='test/test_regress-regress_finalize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_finalize.o `test -f 'test/regress_finalize.c' || echo '$(srcdir)/'`test/regress_finalize.c
+
+test/test_regress-regress_finalize.obj: test/regress_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_finalize.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_finalize.Tpo -c -o test/test_regress-regress_finalize.obj `if test -f 'test/regress_finalize.c'; then $(CYGPATH_W) 'test/regress_finalize.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_finalize.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_finalize.Tpo test/$(DEPDIR)/test_regress-regress_finalize.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_finalize.c' object='test/test_regress-regress_finalize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_finalize.obj `if test -f 'test/regress_finalize.c'; then $(CYGPATH_W) 'test/regress_finalize.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_finalize.c'; fi`
+
+test/test_regress-regress_http.o: test/regress_http.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_http.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_http.Tpo -c -o test/test_regress-regress_http.o `test -f 'test/regress_http.c' || echo '$(srcdir)/'`test/regress_http.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_http.Tpo test/$(DEPDIR)/test_regress-regress_http.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_http.c' object='test/test_regress-regress_http.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_http.o `test -f 'test/regress_http.c' || echo '$(srcdir)/'`test/regress_http.c
+
+test/test_regress-regress_http.obj: test/regress_http.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_http.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_http.Tpo -c -o test/test_regress-regress_http.obj `if test -f 'test/regress_http.c'; then $(CYGPATH_W) 'test/regress_http.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_http.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_http.Tpo test/$(DEPDIR)/test_regress-regress_http.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_http.c' object='test/test_regress-regress_http.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_http.obj `if test -f 'test/regress_http.c'; then $(CYGPATH_W) 'test/regress_http.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_http.c'; fi`
+
+test/test_regress-regress_listener.o: test/regress_listener.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_listener.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_listener.Tpo -c -o test/test_regress-regress_listener.o `test -f 'test/regress_listener.c' || echo '$(srcdir)/'`test/regress_listener.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_listener.Tpo test/$(DEPDIR)/test_regress-regress_listener.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_listener.c' object='test/test_regress-regress_listener.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_listener.o `test -f 'test/regress_listener.c' || echo '$(srcdir)/'`test/regress_listener.c
+
+test/test_regress-regress_listener.obj: test/regress_listener.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_listener.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_listener.Tpo -c -o test/test_regress-regress_listener.obj `if test -f 'test/regress_listener.c'; then $(CYGPATH_W) 'test/regress_listener.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_listener.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_listener.Tpo test/$(DEPDIR)/test_regress-regress_listener.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_listener.c' object='test/test_regress-regress_listener.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_listener.obj `if test -f 'test/regress_listener.c'; then $(CYGPATH_W) 'test/regress_listener.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_listener.c'; fi`
+
+test/test_regress-regress_main.o: test/regress_main.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_main.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_main.Tpo -c -o test/test_regress-regress_main.o `test -f 'test/regress_main.c' || echo '$(srcdir)/'`test/regress_main.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_main.Tpo test/$(DEPDIR)/test_regress-regress_main.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_main.c' object='test/test_regress-regress_main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_main.o `test -f 'test/regress_main.c' || echo '$(srcdir)/'`test/regress_main.c
+
+test/test_regress-regress_main.obj: test/regress_main.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_main.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_main.Tpo -c -o test/test_regress-regress_main.obj `if test -f 'test/regress_main.c'; then $(CYGPATH_W) 'test/regress_main.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_main.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_main.Tpo test/$(DEPDIR)/test_regress-regress_main.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_main.c' object='test/test_regress-regress_main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_main.obj `if test -f 'test/regress_main.c'; then $(CYGPATH_W) 'test/regress_main.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_main.c'; fi`
+
+test/test_regress-regress_minheap.o: test/regress_minheap.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_minheap.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_minheap.Tpo -c -o test/test_regress-regress_minheap.o `test -f 'test/regress_minheap.c' || echo '$(srcdir)/'`test/regress_minheap.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_minheap.Tpo test/$(DEPDIR)/test_regress-regress_minheap.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_minheap.c' object='test/test_regress-regress_minheap.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_minheap.o `test -f 'test/regress_minheap.c' || echo '$(srcdir)/'`test/regress_minheap.c
+
+test/test_regress-regress_minheap.obj: test/regress_minheap.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_minheap.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_minheap.Tpo -c -o test/test_regress-regress_minheap.obj `if test -f 'test/regress_minheap.c'; then $(CYGPATH_W) 'test/regress_minheap.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_minheap.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_minheap.Tpo test/$(DEPDIR)/test_regress-regress_minheap.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_minheap.c' object='test/test_regress-regress_minheap.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_minheap.obj `if test -f 'test/regress_minheap.c'; then $(CYGPATH_W) 'test/regress_minheap.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_minheap.c'; fi`
+
+test/test_regress-regress_rpc.o: test/regress_rpc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_rpc.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_rpc.Tpo -c -o test/test_regress-regress_rpc.o `test -f 'test/regress_rpc.c' || echo '$(srcdir)/'`test/regress_rpc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_rpc.Tpo test/$(DEPDIR)/test_regress-regress_rpc.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_rpc.c' object='test/test_regress-regress_rpc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_rpc.o `test -f 'test/regress_rpc.c' || echo '$(srcdir)/'`test/regress_rpc.c
+
+test/test_regress-regress_rpc.obj: test/regress_rpc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_rpc.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_rpc.Tpo -c -o test/test_regress-regress_rpc.obj `if test -f 'test/regress_rpc.c'; then $(CYGPATH_W) 'test/regress_rpc.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_rpc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_rpc.Tpo test/$(DEPDIR)/test_regress-regress_rpc.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_rpc.c' object='test/test_regress-regress_rpc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_rpc.obj `if test -f 'test/regress_rpc.c'; then $(CYGPATH_W) 'test/regress_rpc.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_rpc.c'; fi`
+
+test/test_regress-regress_testutils.o: test/regress_testutils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_testutils.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_testutils.Tpo -c -o test/test_regress-regress_testutils.o `test -f 'test/regress_testutils.c' || echo '$(srcdir)/'`test/regress_testutils.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_testutils.Tpo test/$(DEPDIR)/test_regress-regress_testutils.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_testutils.c' object='test/test_regress-regress_testutils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_testutils.o `test -f 'test/regress_testutils.c' || echo '$(srcdir)/'`test/regress_testutils.c
+
+test/test_regress-regress_testutils.obj: test/regress_testutils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_testutils.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_testutils.Tpo -c -o test/test_regress-regress_testutils.obj `if test -f 'test/regress_testutils.c'; then $(CYGPATH_W) 'test/regress_testutils.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_testutils.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_testutils.Tpo test/$(DEPDIR)/test_regress-regress_testutils.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_testutils.c' object='test/test_regress-regress_testutils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_testutils.obj `if test -f 'test/regress_testutils.c'; then $(CYGPATH_W) 'test/regress_testutils.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_testutils.c'; fi`
+
+test/test_regress-regress_util.o: test/regress_util.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_util.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_util.Tpo -c -o test/test_regress-regress_util.o `test -f 'test/regress_util.c' || echo '$(srcdir)/'`test/regress_util.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_util.Tpo test/$(DEPDIR)/test_regress-regress_util.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_util.c' object='test/test_regress-regress_util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_util.o `test -f 'test/regress_util.c' || echo '$(srcdir)/'`test/regress_util.c
+
+test/test_regress-regress_util.obj: test/regress_util.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_util.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_util.Tpo -c -o test/test_regress-regress_util.obj `if test -f 'test/regress_util.c'; then $(CYGPATH_W) 'test/regress_util.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_util.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_util.Tpo test/$(DEPDIR)/test_regress-regress_util.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_util.c' object='test/test_regress-regress_util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_util.obj `if test -f 'test/regress_util.c'; then $(CYGPATH_W) 'test/regress_util.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_util.c'; fi`
+
+test/test_regress-tinytest.o: test/tinytest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-tinytest.o -MD -MP -MF test/$(DEPDIR)/test_regress-tinytest.Tpo -c -o test/test_regress-tinytest.o `test -f 'test/tinytest.c' || echo '$(srcdir)/'`test/tinytest.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-tinytest.Tpo test/$(DEPDIR)/test_regress-tinytest.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/tinytest.c' object='test/test_regress-tinytest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-tinytest.o `test -f 'test/tinytest.c' || echo '$(srcdir)/'`test/tinytest.c
+
+test/test_regress-tinytest.obj: test/tinytest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-tinytest.obj -MD -MP -MF test/$(DEPDIR)/test_regress-tinytest.Tpo -c -o test/test_regress-tinytest.obj `if test -f 'test/tinytest.c'; then $(CYGPATH_W) 'test/tinytest.c'; else $(CYGPATH_W) '$(srcdir)/test/tinytest.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-tinytest.Tpo test/$(DEPDIR)/test_regress-tinytest.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/tinytest.c' object='test/test_regress-tinytest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-tinytest.obj `if test -f 'test/tinytest.c'; then $(CYGPATH_W) 'test/tinytest.c'; else $(CYGPATH_W) '$(srcdir)/test/tinytest.c'; fi`
+
+test/test_regress-regress_thread.o: test/regress_thread.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_thread.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_thread.Tpo -c -o test/test_regress-regress_thread.o `test -f 'test/regress_thread.c' || echo '$(srcdir)/'`test/regress_thread.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_thread.Tpo test/$(DEPDIR)/test_regress-regress_thread.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_thread.c' object='test/test_regress-regress_thread.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_thread.o `test -f 'test/regress_thread.c' || echo '$(srcdir)/'`test/regress_thread.c
+
+test/test_regress-regress_thread.obj: test/regress_thread.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_thread.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_thread.Tpo -c -o test/test_regress-regress_thread.obj `if test -f 'test/regress_thread.c'; then $(CYGPATH_W) 'test/regress_thread.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_thread.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_thread.Tpo test/$(DEPDIR)/test_regress-regress_thread.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_thread.c' object='test/test_regress-regress_thread.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_thread.obj `if test -f 'test/regress_thread.c'; then $(CYGPATH_W) 'test/regress_thread.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_thread.c'; fi`
+
+test/test_regress-regress_zlib.o: test/regress_zlib.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_zlib.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_zlib.Tpo -c -o test/test_regress-regress_zlib.o `test -f 'test/regress_zlib.c' || echo '$(srcdir)/'`test/regress_zlib.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_zlib.Tpo test/$(DEPDIR)/test_regress-regress_zlib.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_zlib.c' object='test/test_regress-regress_zlib.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_zlib.o `test -f 'test/regress_zlib.c' || echo '$(srcdir)/'`test/regress_zlib.c
+
+test/test_regress-regress_zlib.obj: test/regress_zlib.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_zlib.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_zlib.Tpo -c -o test/test_regress-regress_zlib.obj `if test -f 'test/regress_zlib.c'; then $(CYGPATH_W) 'test/regress_zlib.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_zlib.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_zlib.Tpo test/$(DEPDIR)/test_regress-regress_zlib.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_zlib.c' object='test/test_regress-regress_zlib.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_zlib.obj `if test -f 'test/regress_zlib.c'; then $(CYGPATH_W) 'test/regress_zlib.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_zlib.c'; fi`
+
+test/test_regress-regress_iocp.o: test/regress_iocp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_iocp.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_iocp.Tpo -c -o test/test_regress-regress_iocp.o `test -f 'test/regress_iocp.c' || echo '$(srcdir)/'`test/regress_iocp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_iocp.Tpo test/$(DEPDIR)/test_regress-regress_iocp.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_iocp.c' object='test/test_regress-regress_iocp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_iocp.o `test -f 'test/regress_iocp.c' || echo '$(srcdir)/'`test/regress_iocp.c
+
+test/test_regress-regress_iocp.obj: test/regress_iocp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_iocp.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_iocp.Tpo -c -o test/test_regress-regress_iocp.obj `if test -f 'test/regress_iocp.c'; then $(CYGPATH_W) 'test/regress_iocp.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_iocp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_iocp.Tpo test/$(DEPDIR)/test_regress-regress_iocp.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_iocp.c' object='test/test_regress-regress_iocp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_iocp.obj `if test -f 'test/regress_iocp.c'; then $(CYGPATH_W) 'test/regress_iocp.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_iocp.c'; fi`
+
+test/test_regress-regress_ssl.o: test/regress_ssl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_ssl.o -MD -MP -MF test/$(DEPDIR)/test_regress-regress_ssl.Tpo -c -o test/test_regress-regress_ssl.o `test -f 'test/regress_ssl.c' || echo '$(srcdir)/'`test/regress_ssl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_ssl.Tpo test/$(DEPDIR)/test_regress-regress_ssl.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_ssl.c' object='test/test_regress-regress_ssl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_ssl.o `test -f 'test/regress_ssl.c' || echo '$(srcdir)/'`test/regress_ssl.c
+
+test/test_regress-regress_ssl.obj: test/regress_ssl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_regress-regress_ssl.obj -MD -MP -MF test/$(DEPDIR)/test_regress-regress_ssl.Tpo -c -o test/test_regress-regress_ssl.obj `if test -f 'test/regress_ssl.c'; then $(CYGPATH_W) 'test/regress_ssl.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_ssl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_regress-regress_ssl.Tpo test/$(DEPDIR)/test_regress-regress_ssl.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/regress_ssl.c' object='test/test_regress-regress_ssl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_regress-regress_ssl.obj `if test -f 'test/regress_ssl.c'; then $(CYGPATH_W) 'test/regress_ssl.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_ssl.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+ -rm -rf sample/.libs sample/_libs
+ -rm -rf test/.libs test/_libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(includedir)" && rm -f $$files
+install-include_event2HEADERS: $(include_event2_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(include_event2dir)" || $(MKDIR_P) "$(DESTDIR)$(include_event2dir)"
+ @list='$(include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(include_event2dir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(include_event2dir)" || exit $$?; \
+ done
+
+uninstall-include_event2HEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(include_event2dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(include_event2dir)" && rm -f $$files
+install-nodist_include_event2HEADERS: $(nodist_include_event2_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(include_event2dir)" || $(MKDIR_P) "$(DESTDIR)$(include_event2dir)"
+ @list='$(nodist_include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(include_event2dir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(include_event2dir)" || exit $$?; \
+ done
+
+uninstall-nodist_include_event2HEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(include_event2dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(include_event2dir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) config.h.in evconfig-private.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in evconfig-private.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) config.h.in evconfig-private.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) config.h.in evconfig-private.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes$$std"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @$(am__cd) '$(distuninstallcheck_dir)' \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
+ $(HEADERS) config.h evconfig-private.h
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(include_event2dir)" "$(DESTDIR)$(include_event2dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -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)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(DEPDIR) ./$(DEPDIR) sample/$(DEPDIR) test/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS install-include_event2HEADERS \
+ install-nodist_include_event2HEADERS install-pkgconfigDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-dist_binSCRIPTS install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf $(DEPDIR) ./$(DEPDIR) sample/$(DEPDIR) test/$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_binSCRIPTS uninstall-includeHEADERS \
+ uninstall-include_event2HEADERS uninstall-libLTLIBRARIES \
+ uninstall-nodist_include_event2HEADERS uninstall-pkgconfigDATA
+
+.MAKE: all check check-am install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
+ clean clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags dist \
+ dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
+ dist-xz dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dist_binSCRIPTS \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-includeHEADERS \
+ install-include_event2HEADERS install-info install-info-am \
+ install-libLTLIBRARIES install-man \
+ install-nodist_include_event2HEADERS install-pdf \
+ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-dist_binSCRIPTS uninstall-includeHEADERS \
+ uninstall-include_event2HEADERS uninstall-libLTLIBRARIES \
+ uninstall-nodist_include_event2HEADERS uninstall-pkgconfigDATA
+
+
+$(SAMPLES) : libevent.la
+
+test/test-script.sh: test/test.sh
+ cp $(top_srcdir)/test/test.sh $@
+
+test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
+
+test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
+ $(AM_V_GEN)date -u > $@
+ $(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
+ true; \
+ else \
+ echo "No Python installed; stubbing out RPC test." >&2; \
+ echo " "> test/regress.gen.c; \
+ echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \
+ fi
+
+$(TESTPROGRAMS) : libevent.la
+
+include/event2/event-config.h: config.h make-event-config.sed
+ $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
+ $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
+ $(AM_V_at)mv -f $@T $@
+
+verify: check
+
+doxygen: FORCE
+ doxygen $(srcdir)/Doxyfile
+FORCE:
+
+# 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/sntp/libevent/Makefile.nmake b/sntp/libevent/Makefile.nmake
new file mode 100644
index 0000000..f27cd61
--- /dev/null
+++ b/sntp/libevent/Makefile.nmake
@@ -0,0 +1,82 @@
+# WATCH OUT! This makefile is a work in progress. -*- makefile -*-
+#
+# I'm not very knowledgeable about MSVC and nmake beyond their most basic
+# aspects. If anything here looks wrong to you, please let me know.
+
+# If OPENSSL_DIR is not set, builds without OpenSSL support. If you want
+# OpenSSL support, you can set the OPENSSL_DIR variable to where you
+# installed OpenSSL. This can be done in the environment:
+# set OPENSSL_DIR=c:\openssl
+# Or on the nmake command line:
+# nmake OPENSSL_DIR=C:\openssl -f Makefile.nmake
+# Or by uncommenting the following line here in the makefile...
+
+# OPENSSL_DIR=c:\openssl
+
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+!ELSE
+SSL_CFLAGS=
+!ENDIF
+
+# Needed for correctness
+CFLAGS=/IWIN32-Code /IWIN32-Code/nmake /Iinclude /Icompat /DHAVE_CONFIG_H /I. $(SSL_CFLAGS)
+
+# For optimization and warnings
+CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
+
+# XXXX have a debug mode
+
+LIBFLAGS=/nologo
+
+CORE_OBJS=event.obj buffer.obj bufferevent.obj bufferevent_sock.obj \
+ bufferevent_pair.obj listener.obj evmap.obj log.obj evutil.obj \
+ strlcpy.obj signal.obj bufferevent_filter.obj evthread.obj \
+ bufferevent_ratelim.obj evutil_rand.obj evutil_time.obj
+WIN_OBJS=win32select.obj evthread_win32.obj buffer_iocp.obj \
+ event_iocp.obj bufferevent_async.obj
+EXTRA_OBJS=event_tagging.obj http.obj evdns.obj evrpc.obj
+
+!IFDEF OPENSSL_DIR
+SSL_OBJS=bufferevent_openssl.obj
+SSL_LIBS=libevent_openssl.lib
+!ELSE
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) $(SSL_OBJS)
+STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib $(SSL_LIBS)
+
+
+all: static_libs tests
+
+static_libs: $(STATIC_LIBS)
+
+libevent_core.lib: $(CORE_OBJS) $(WIN_OBJS)
+ lib $(LIBFLAGS) $(CORE_OBJS) $(WIN_OBJS) /out:libevent_core.lib
+
+libevent_extras.lib: $(EXTRA_OBJS)
+ lib $(LIBFLAGS) $(EXTRA_OBJS) /out:libevent_extras.lib
+
+libevent.lib: $(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
+ lib $(LIBFLAGS) $(CORE_OBJS) $(EXTRA_OBJS) $(WIN_OBJS) /out:libevent.lib
+
+libevent_openssl.lib: $(SSL_OBJS)
+ lib $(LIBFLAGS) $(SSL_OBJS) /out:libevent_openssl.lib
+
+clean:
+ del $(ALL_OBJS)
+ del $(STATIC_LIBS)
+ cd test
+ $(MAKE) /F Makefile.nmake clean
+ cd ..
+
+tests:
+ cd test
+!IFDEF OPENSSL_DIR
+ $(MAKE) OPENSSL_DIR=$(OPENSSL_DIR) /F Makefile.nmake
+!ELSE
+ $(MAKE) /F Makefile.nmake
+!ENDIF
+ cd ..
diff --git a/sntp/libevent/README b/sntp/libevent/README
new file mode 100644
index 0000000..2723a2c
--- /dev/null
+++ b/sntp/libevent/README
@@ -0,0 +1,218 @@
+0. BUILDING AND INSTALLATION (Briefly)
+
+$ ./configure
+$ make
+$ make verify # (optional)
+$ sudo make install
+
+1. BUILDING AND INSTALLATION (In Depth)
+
+To build libevent, type
+
+$ ./configure && make
+
+ (If you got libevent from the git repository, you will
+ first need to run the included "autogen.sh" script in order to
+ generate the configure script.)
+
+You can run the regression tests by running
+
+$ make verify
+
+Install as root via
+
+# make install
+
+Before reporting any problems, please run the regression tests.
+
+To enable the low-level tracing build the library as:
+
+ CFLAGS=-DUSE_DEBUG ./configure [...]
+
+Standard configure flags should work. In particular, see:
+
+ --disable-shared Only build static libraries
+ --prefix Install all files relative to this directory.
+
+
+The configure script also supports the following flags:
+
+ --enable-gcc-warnings Enable extra compiler checking with GCC.
+ --disable-malloc-replacement
+ Don't let applications replace our memory
+ management functions
+ --disable-openssl Disable support for OpenSSL encryption.
+ --disable-thread-support Don't support multithreaded environments.
+
+2. USEFUL LINKS:
+
+For the latest released version of Libevent, see the official website at
+http://libevent.org/ .
+
+There's a pretty good work-in-progress manual up at
+ http://www.wangafu.net/~nickm/libevent-book/ .
+
+For the latest development versions of Libevent, access our Git repository
+via
+ "git clone git://levent.git.sourceforge.net/gitroot/levent/libevent"
+
+You can browse the git repository online at
+http://levent.git.sourceforge.net/git/gitweb-index.cgi .
+
+To report bugs, request features, or submit patches to Libevent,
+use the Sourceforge trackers at
+https://sourceforge.net/tracker/?group_id=50884 .
+
+There's also a libevent-users mailing list for talking about Libevent
+use and development: http://archives.seul.org/libevent/users/
+
+3. ACKNOWLEDGMENTS
+
+The following people have helped with suggestions, ideas, code or
+fixing bugs:
+
+ Samy Al Bahra
+ Jacob Appelbaum
+ Arno Bakker
+ Weston Andros Adamson
+ William Ahern
+ Ivan Andropov
+ Sergey Avseyev
+ Avi Bab
+ Joachim Bauch
+ Gilad Benjamini
+ Stas Bekman
+ Denis Bilenko
+ Julien Blache
+ Kevin Bowling
+ Tomash Brechko
+ Kelly Brock
+ Ralph Castain
+ Adrian Chadd
+ Lawnstein Chan
+ Shuo Chen
+ Ka-Hing Cheung
+ Andrew Cox
+ Paul Croome
+ George Danchev
+ Andrew Danforth
+ Ed Day
+ Christopher Davis
+ Mike Davis
+ Antony Dovgal
+ Mihai Draghicioiu
+ Alexander Drozdov
+ Mark Ellzey
+ Shie Erlich
+ Leonid Evdokimov
+ Juan Pablo Fernandez
+ Christophe Fillot
+ Mike Frysinger
+ Remi Gacogne
+ Artem Germanov
+ Alexander von Gernler
+ Artur Grabowski
+ Diwaker Gupta
+ Sebastian Hahn
+ Dave Hart
+ Greg Hazel
+ Michael Herf
+ Sebastian Hahn
+ Savg He
+ Mark Heily
+ Michael Herf
+ Greg Hewgill
+ Andrew Hochhaus
+ Aaron Hopkins
+ Tani Hosokawa
+ Jamie Iles
+ Claudio Jeker
+ Evan Jones
+ George Kadianakis
+ Phua Keat
+ Azat Khuzhin
+ Alexander Klauer
+ Kevin Ko
+ Brian Koehmstedt
+ Marko Kreen
+ Valery Kyholodov
+ Ross Lagerwall
+ Scott Lamb
+ Christopher Layne
+ Adam Langley
+ Graham Leggett
+ Philip Lewis
+ Zhou Li
+ David Libenzi
+ Yan Lin
+ Moshe Litvin
+ Simon Liu
+ Mitchell Livingston
+ Hagne Mahre
+ Lubomir Marinov
+ Abilio Marques
+ Abel Mathew
+ Nick Mathewson
+ James Mansion
+ Nicholas Marriott
+ Andrey Matveev
+ Caitlin Mercer
+ Dagobert Michelsen
+ Andrea Montefusco
+ Mansour Moufid
+ Mina Naguib
+ Felix Nawothnig
+ Trond Norbye
+ Linus Nordberg
+ Richard Nyberg
+ Jon Oberheide
+ Phil Oleson
+ Dave Pacheco
+ Derrick Pallas
+ Tassilo von Parseval
+ Catalin Patulea
+ Patrick Pelletier
+ Simon Perreault
+ Pierre Phaneuf
+ Amarin Phaosawasdi
+ Ryan Phillips
+ Dimitre Piskyulev
+ Pavel Plesov
+ Jon Poland
+ Roman Puls
+ Nate R
+ Robert Ransom
+ Bert JW Regeer
+ Peter Rosin
+ Maseeb Abdul Qadir
+ Wang Qin
+ Alex S
+ Hanna Schroeter
+ Ralf Schmitt
+ Mike Smellie
+ Kevin Springborn
+ Nir Soffer
+ Harlan Stenn
+ Steve Snyder
+ Dug Song
+ Dongsheng Song
+ Hannes Sowa
+ Ferenc Szalai
+ Brodie Thiesfield
+ Jason Toffaletti
+ Gisle Vanem
+ Bas Verhoeven
+ Constantine Verutin
+ Colin Watt
+ Zack Weinberg
+ Jardel Weyrich
+ Jay R. Wren
+ Zack Weinberg
+ Alejo
+ Alex
+ Taral
+ propanbutan
+ mmadia
+ yangacer
+
+If we have forgotten your name, please contact us.
diff --git a/sntp/libevent/WIN32-Code/nmake/evconfig-private.h b/sntp/libevent/WIN32-Code/nmake/evconfig-private.h
new file mode 100644
index 0000000..88e2062
--- /dev/null
+++ b/sntp/libevent/WIN32-Code/nmake/evconfig-private.h
@@ -0,0 +1,6 @@
+#if !defined(EVENT_EVCONFIG__PRIVATE_H_) && !defined(__MINGW32__)
+#define EVENT_EVCONFIG__PRIVATE_H_
+
+/* Nothing to see here. Move along. */
+
+#endif
diff --git a/sntp/libevent/WIN32-Code/nmake/event2/event-config.h b/sntp/libevent/WIN32-Code/nmake/event2/event-config.h
new file mode 100644
index 0000000..da55028
--- /dev/null
+++ b/sntp/libevent/WIN32-Code/nmake/event2/event-config.h
@@ -0,0 +1,360 @@
+/* event2/event-config.h
+ *
+ * This file was generated by autoconf when libevent was built, and post-
+ * processed by Libevent so that its macros would have a uniform prefix.
+ *
+ * DO NOT EDIT THIS FILE.
+ *
+ * Do not rely on macros in this file existing in later versions.
+ */
+#ifndef EVENT_CONFIG_H__
+#define EVENT_CONFIG_H__
+/* config.h. Generated by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define if libevent should not allow replacing the mm functions */
+/* #undef EVENT__DISABLE_MM_REPLACEMENT */
+
+/* Define if libevent should not be compiled with thread support */
+/* #undef EVENT__DISABLE_THREAD_SUPPORT */
+
+/* Define if clock_gettime is available in libc */
+/* #undef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID */
+
+/* Define is no secure id variant is available */
+/* #define _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID 1 */
+#define EVENT_DNS_USE_FTIME_FOR_ID_ 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* #undef EVENT__HAVE_ARPA_INET_H */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+/* #undef EVENT__HAVE_CLOCK_GETTIME */
+
+/* Define if /dev/poll is available */
+/* #undef EVENT__HAVE_DEVPOLL */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef EVENT__HAVE_DLFCN_H */
+
+/* Define if your system supports the epoll system calls */
+/* #undef EVENT__HAVE_EPOLL */
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+/* #undef EVENT__HAVE_EPOLL_CTL */
+
+/* Define to 1 if you have the `eventfd' function. */
+/* #undef EVENT__HAVE_EVENTFD */
+
+/* Define if your system supports event ports */
+/* #undef EVENT__HAVE_EVENT_PORTS */
+
+/* Define to 1 if you have the `fcntl' function. */
+/* #undef EVENT__HAVE_FCNTL */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define EVENT__HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define EVENT__HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define EVENT__HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `getprotobynumber' function. */
+#define EVENT__HAVE_GETPROTOBYNUMBER 1
+
+/* Define to 1 if you have the `getservbyname' function. */
+#define EVENT__HAVE_GETSERVBYNAME 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+/* #define EVENT__HAVE_GETTIMEOFDAY 1 */
+
+/* Define to 1 if you have the `inet_ntop' function. */
+/* #undef EVENT__HAVE_INET_NTOP */
+
+/* Define to 1 if you have the `inet_pton' function. */
+/* #undef EVENT__HAVE_INET_PTON */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #define EVENT__HAVE_INTTYPES_H 1 */
+
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef EVENT__HAVE_KQUEUE */
+
+/* Define if the system has zlib */
+/* #undef EVENT__HAVE_LIBZ */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define EVENT__HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mmap' function. */
+/* #undef EVENT__HAVE_MMAP */
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+/* #undef EVENT__HAVE_NETINET_IN6_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef EVENT__HAVE_NETINET_IN_H */
+
+/* Define to 1 if you have the `pipe' function. */
+/* #undef EVENT__HAVE_PIPE */
+
+/* Define to 1 if you have the `poll' function. */
+/* #undef EVENT__HAVE_POLL */
+
+/* Define to 1 if you have the <poll.h> header file. */
+/* #undef EVENT__HAVE_POLL_H */
+
+/* Define to 1 if you have the `port_create' function. */
+/* #undef EVENT__HAVE_PORT_CREATE */
+
+/* Define to 1 if you have the <port.h> header file. */
+/* #undef EVENT__HAVE_PORT_H */
+
+/* Define if you have POSIX threads libraries and header files. */
+/* #undef EVENT__HAVE_PTHREAD */
+
+/* Define if we have pthreads on this system */
+/* #undef EVENT__HAVE_PTHREADS */
+
+/* Define to 1 if the system has the type `sa_family_t'. */
+/* #undef EVENT__HAVE_SA_FAMILY_T */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef EVENT__HAVE_SELECT */
+
+/* Define to 1 if you have the `sendfile' function. */
+/* #undef EVENT__HAVE_SENDFILE */
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+/* #undef EVENT__HAVE_SETFD */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef EVENT__HAVE_SIGACTION */
+
+/* Define to 1 if you have the `signal' function. */
+#define EVENT__HAVE_SIGNAL 1
+
+/* Define to 1 if you have the `splice' function. */
+/* #undef EVENT__HAVE_SPLICE */
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define EVENT__HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define EVENT__HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #define EVENT__HAVE_STDINT_H 1 */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define EVENT__HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define EVENT__HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define EVENT__HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef EVENT__HAVE_STRLCPY */
+
+/* Define to 1 if you have the `strsep' function. */
+/* #undef EVENT__HAVE_STRSEP */
+
+/* Define to 1 if you have the `strtok_r' function. */
+/* #undef EVENT__HAVE_STRTOK_R */
+
+/* Define to 1 if you have the `strtoll' function. */
+/* #define EVENT__HAVE_STRTOLL 1 */
+
+#define EVENT__HAVE_STRUCT_ADDRINFO 1
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#define EVENT__HAVE_STRUCT_IN6_ADDR 1
+
+/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
+
+/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
+
+/* Define to 1 if the system has the type `struct sockaddr_in6'. */
+#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
+
+/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
+
+/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+/* #undef EVENT__HAVE_SYS_EPOLL_H */
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+/* #undef EVENT__HAVE_SYS_EVENTFD_H */
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+/* #undef EVENT__HAVE_SYS_EVENT_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef EVENT__HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+/* #undef EVENT__HAVE_SYS_MMAN_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #define EVENT__HAVE_SYS_PARAM_H 1 */
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+/* #undef EVENT__HAVE_SYS_QUEUE_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef EVENT__HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/sendfile.h> header file. */
+/* #undef EVENT__HAVE_SYS_SENDFILE_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef EVENT__HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define EVENT__HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #define EVENT__HAVE_SYS_TIME_H 1 */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define EVENT__HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+/* #undef EVENT__HAVE_SYS_UIO_H */
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+/* #undef EVENT__HAVE_TAILQFOREACH */
+
+/* Define if timeradd is defined in <sys/time.h> */
+/* #undef EVENT__HAVE_TIMERADD */
+
+/* Define if timerclear is defined in <sys/time.h> */
+#define EVENT__HAVE_TIMERCLEAR 1
+
+/* Define if timercmp is defined in <sys/time.h> */
+#define EVENT__HAVE_TIMERCMP 1
+
+/* Define if timerisset is defined in <sys/time.h> */
+#define EVENT__HAVE_TIMERISSET 1
+
+/* Define to 1 if the system has the type `uint16_t'. */
+/* #define EVENT__HAVE_UINT16_T 1 */
+
+/* Define to 1 if the system has the type `uint32_t'. */
+/* #define EVENT__HAVE_UINT32_T 1 */
+
+/* Define to 1 if the system has the type `uint64_t'. */
+/* #define EVENT__HAVE_UINT64_T 1 */
+
+/* Define to 1 if the system has the type `uint8_t'. */
+/* #define EVENT__HAVE_UINT8_T 1 */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #define EVENT__HAVE_UNISTD_H 1 */
+
+/* Define to 1 if you have the `vasprintf' function. */
+/* #undef EVENT__HAVE_VASPRINTF */
+
+/* Define if kqueue works correctly with pipes */
+/* #undef EVENT__HAVE_WORKING_KQUEUE */
+
+/* Numeric representation of the version */
+#define EVENT__NUMERIC_VERSION 0x02010301
+
+/* Name of package */
+#define EVENT__PACKAGE "libevent"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define EVENT__PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define EVENT__PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define EVENT__PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define EVENT__PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define EVENT__PACKAGE_VERSION ""
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+ your system. */
+/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
+
+/* The size of a `int', as computed by sizeof. */
+#define EVENT__SIZEOF_INT 4
+
+/* The size of a `long', as computed by sizeof. */
+#define EVENT__SIZEOF_LONG 4
+
+/* The size of a `long long', as computed by sizeof. */
+#define EVENT__SIZEOF_LONG_LONG 8
+
+/* The size of a `short', as computed by sizeof. */
+#define EVENT__SIZEOF_SHORT 2
+
+/* The size of `size_t', as computed by sizeof. */
+#ifdef _WIN64
+#define EVENT__SIZEOF_SIZE_T 8
+#else
+#define EVENT__SIZEOF_SIZE_T 4
+#endif
+
+/* The size of `void *', as computed by sizeof. */
+#ifdef _WIN64
+#define EVENT__SIZEOF_VOID_P 8
+#else
+#define EVENT__SIZEOF_VOID_P 4
+#endif
+
+/* Define to 1 if you have the ANSI C header files. */
+#define EVENT__STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define EVENT__TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define EVENT__VERSION "2.1.3-alpha-dev"
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+#define EVENT____func__ __FUNCTION__
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef EVENT__const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef _EVENT___cplusplus
+#define EVENT__inline __inline
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef EVENT__pid_t */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef EVENT__size_t */
+
+/* Define to unsigned int if you dont have it */
+#define EVENT__socklen_t unsigned int
+
+/* Define to `int' if <sys/types.h> does not define. */
+#define EVENT__ssize_t SSIZE_T
+
+#endif
diff --git a/sntp/libevent/WIN32-Code/tree.h b/sntp/libevent/WIN32-Code/tree.h
new file mode 100644
index 0000000..585618d
--- /dev/null
+++ b/sntp/libevent/WIN32-Code/tree.h
@@ -0,0 +1,1354 @@
+/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SYS_TREE_H_
+#define _SYS_TREE_H_
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure. Every operation
+ * on the tree causes a splay to happen. The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree. On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n). The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute. It fulfills a set of conditions:
+ * - every search path from the root to a leaf consists of the
+ * same number of black nodes,
+ * - each red node (except for the root) has a black parent,
+ * - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type) \
+struct name { \
+ struct type *sph_root; /* root of the tree */ \
+}
+
+#define SPLAY_INITIALIZER(root) \
+ { NULL }
+
+#define SPLAY_INIT(root) do { \
+ (root)->sph_root = NULL; \
+} while (0)
+
+#define SPLAY_ENTRY(type) \
+struct { \
+ struct type *spe_left; /* left element */ \
+ struct type *spe_right; /* right element */ \
+}
+
+#define SPLAY_LEFT(elm, field) (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right
+#define SPLAY_ROOT(head) (head)->sph_root
+#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (0)
+
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do { \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \
+} while (0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do { \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \
+} while (0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \
+ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
+ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
+} while (0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp) \
+void name##_SPLAY(struct name *, struct type *); \
+void name##_SPLAY_MINMAX(struct name *, int); \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *); \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \
+ \
+/* Finds the node with the same key as elm */ \
+static __inline struct type * \
+name##_SPLAY_FIND(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) \
+ return(NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) \
+ return (head->sph_root); \
+ return (NULL); \
+} \
+ \
+static __inline struct type * \
+name##_SPLAY_NEXT(struct name *head, struct type *elm) \
+{ \
+ name##_SPLAY(head, elm); \
+ if (SPLAY_RIGHT(elm, field) != NULL) { \
+ elm = SPLAY_RIGHT(elm, field); \
+ while (SPLAY_LEFT(elm, field) != NULL) { \
+ elm = SPLAY_LEFT(elm, field); \
+ } \
+ } else \
+ elm = NULL; \
+ return (elm); \
+} \
+ \
+static __inline struct type * \
+name##_SPLAY_MIN_MAX(struct name *head, int val) \
+{ \
+ name##_SPLAY_MINMAX(head, val); \
+ return (SPLAY_ROOT(head)); \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp) \
+struct type * \
+name##_SPLAY_INSERT(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) { \
+ SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \
+ } else { \
+ int __comp; \
+ name##_SPLAY(head, elm); \
+ __comp = (cmp)(elm, (head)->sph_root); \
+ if(__comp < 0) { \
+ SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
+ SPLAY_RIGHT(elm, field) = (head)->sph_root; \
+ SPLAY_LEFT((head)->sph_root, field) = NULL; \
+ } else if (__comp > 0) { \
+ SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT(elm, field) = (head)->sph_root; \
+ SPLAY_RIGHT((head)->sph_root, field) = NULL; \
+ } else \
+ return ((head)->sph_root); \
+ } \
+ (head)->sph_root = (elm); \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *__tmp; \
+ if (SPLAY_EMPTY(head)) \
+ return (NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) { \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
+ } else { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
+ name##_SPLAY(head, elm); \
+ SPLAY_RIGHT((head)->sph_root, field) = __tmp; \
+ } \
+ return (elm); \
+ } \
+ return (NULL); \
+} \
+ \
+void \
+name##_SPLAY(struct name *head, struct type *elm) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+ int __comp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while ((__comp = (cmp)(elm, (head)->sph_root))) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) > 0){ \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+} \
+ \
+/* Splay with either the minimum or the maximum element \
+ * Used to find minimum or maximum element in tree. \
+ */ \
+void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while (1) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp > 0) { \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+}
+
+#define SPLAY_NEGINF -1
+#define SPLAY_INF 1
+
+#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head) \
+ for ((x) = SPLAY_MIN(name, head); \
+ (x) != NULL; \
+ (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-back tree */
+#define RB_HEAD(name, type) \
+struct name { \
+ struct type *rbh_root; /* root of the tree */ \
+}
+
+#define RB_INITIALIZER(root) \
+ { NULL }
+
+#define RB_INIT(root) do { \
+ (root)->rbh_root = NULL; \
+} while (0)
+
+#define RB_BLACK 0
+#define RB_RED 1
+#define RB_ENTRY(type) \
+struct { \
+ struct type *rbe_left; /* left element */ \
+ struct type *rbe_right; /* right element */ \
+ struct type *rbe_parent; /* parent element */ \
+ int rbe_color; /* node color */ \
+}
+
+#define RB_LEFT(elm, field) (elm)->field.rbe_left
+#define RB_RIGHT(elm, field) (elm)->field.rbe_right
+#define RB_PARENT(elm, field) (elm)->field.rbe_parent
+#define RB_COLOR(elm, field) (elm)->field.rbe_color
+#define RB_ROOT(head) (head)->rbh_root
+#define RB_EMPTY(head) (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do { \
+ RB_PARENT(elm, field) = parent; \
+ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
+ RB_COLOR(elm, field) = RB_RED; \
+} while (0)
+
+#define RB_SET_BLACKRED(black, red, field) do { \
+ RB_COLOR(black, field) = RB_BLACK; \
+ RB_COLOR(red, field) = RB_RED; \
+} while (0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \
+ (tmp) = RB_RIGHT(elm, field); \
+ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) { \
+ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_LEFT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
+ (tmp) = RB_LEFT(elm, field); \
+ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) { \
+ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_RIGHT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (0)
+
+/* Generates prototypes and inline functions */
+#define RB_PROTOTYPE(name, type, field, cmp) \
+void name##_RB_INSERT_COLOR(struct name *, struct type *); \
+void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+struct type *name##_RB_REMOVE(struct name *, struct type *); \
+struct type *name##_RB_INSERT(struct name *, struct type *); \
+struct type *name##_RB_FIND(struct name *, struct type *); \
+struct type *name##_RB_NEXT(struct type *); \
+struct type *name##_RB_MINMAX(struct name *, int); \
+ \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define RB_GENERATE(name, type, field, cmp) \
+void \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
+{ \
+ struct type *parent, *gparent, *tmp; \
+ while ((parent = RB_PARENT(elm, field)) && \
+ RB_COLOR(parent, field) == RB_RED) { \
+ gparent = RB_PARENT(parent, field); \
+ if (parent == RB_LEFT(gparent, field)) { \
+ tmp = RB_RIGHT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_RIGHT(parent, field) == elm) { \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_RIGHT(head, gparent, tmp, field); \
+ } else { \
+ tmp = RB_LEFT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_LEFT(parent, field) == elm) { \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_LEFT(head, gparent, tmp, field); \
+ } \
+ } \
+ RB_COLOR(head->rbh_root, field) = RB_BLACK; \
+} \
+ \
+void \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
+{ \
+ struct type *tmp; \
+ while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \
+ elm != RB_ROOT(head)) { \
+ if (RB_LEFT(parent, field) == elm) { \
+ tmp = RB_RIGHT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
+ struct type *oleft; \
+ if ((oleft = RB_LEFT(tmp, field)))\
+ RB_COLOR(oleft, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_RIGHT(head, tmp, oleft, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_RIGHT(tmp, field)) \
+ RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } else { \
+ tmp = RB_LEFT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
+ struct type *oright; \
+ if ((oright = RB_RIGHT(tmp, field)))\
+ RB_COLOR(oright, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_LEFT(head, tmp, oright, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_LEFT(tmp, field)) \
+ RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } \
+ } \
+ if (elm) \
+ RB_COLOR(elm, field) = RB_BLACK; \
+} \
+ \
+struct type * \
+name##_RB_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *child, *parent, *old = elm; \
+ int color; \
+ if (RB_LEFT(elm, field) == NULL) \
+ child = RB_RIGHT(elm, field); \
+ else if (RB_RIGHT(elm, field) == NULL) \
+ child = RB_LEFT(elm, field); \
+ else { \
+ struct type *left; \
+ elm = RB_RIGHT(elm, field); \
+ while ((left = RB_LEFT(elm, field))) \
+ elm = left; \
+ child = RB_RIGHT(elm, field); \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+ if (RB_PARENT(elm, field) == old) \
+ parent = elm; \
+ (elm)->field = (old)->field; \
+ if (RB_PARENT(old, field)) { \
+ if (RB_LEFT(RB_PARENT(old, field), field) == old)\
+ RB_LEFT(RB_PARENT(old, field), field) = elm;\
+ else \
+ RB_RIGHT(RB_PARENT(old, field), field) = elm;\
+ RB_AUGMENT(RB_PARENT(old, field)); \
+ } else \
+ RB_ROOT(head) = elm; \
+ RB_PARENT(RB_LEFT(old, field), field) = elm; \
+ if (RB_RIGHT(old, field)) \
+ RB_PARENT(RB_RIGHT(old, field), field) = elm; \
+ if (parent) { \
+ left = parent; \
+ do { \
+ RB_AUGMENT(left); \
+ } while ((left = RB_PARENT(left, field))); \
+ } \
+ goto color; \
+ } \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+color: \
+ if (color == RB_BLACK) \
+ name##_RB_REMOVE_COLOR(head, parent, child); \
+ return (old); \
+} \
+ \
+/* Inserts a node into the RB tree */ \
+struct type * \
+name##_RB_INSERT(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp; \
+ struct type *parent = NULL; \
+ int comp = 0; \
+ tmp = RB_ROOT(head); \
+ while (tmp) { \
+ parent = tmp; \
+ comp = (cmp)(elm, parent); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ RB_SET(elm, parent, field); \
+ if (parent != NULL) { \
+ if (comp < 0) \
+ RB_LEFT(parent, field) = elm; \
+ else \
+ RB_RIGHT(parent, field) = elm; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = elm; \
+ name##_RB_INSERT_COLOR(head, elm); \
+ return (NULL); \
+} \
+ \
+/* Finds the node with the same key as elm */ \
+struct type * \
+name##_RB_FIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_RB_NEXT(struct type *elm) \
+{ \
+ if (RB_RIGHT(elm, field)) { \
+ elm = RB_RIGHT(elm, field); \
+ while (RB_LEFT(elm, field)) \
+ elm = RB_LEFT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+struct type * \
+name##_RB_MINMAX(struct name *head, int val) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *parent = NULL; \
+ while (tmp) { \
+ parent = tmp; \
+ if (val < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else \
+ tmp = RB_RIGHT(tmp, field); \
+ } \
+ return (parent); \
+}
+
+#define RB_NEGINF -1
+#define RB_INF 1
+
+#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y) name##_RB_FIND(x, y)
+#define RB_NEXT(name, x, y) name##_RB_NEXT(y)
+#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head) \
+ for ((x) = RB_MIN(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_NEXT(x))
+
+#endif /* _SYS_TREE_H_ */
+/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SYS_TREE_H_
+#define _SYS_TREE_H_
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure. Every operation
+ * on the tree causes a splay to happen. The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree. On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n). The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute. It fulfills a set of conditions:
+ * - every search path from the root to a leaf consists of the
+ * same number of black nodes,
+ * - each red node (except for the root) has a black parent,
+ * - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type) \
+struct name { \
+ struct type *sph_root; /* root of the tree */ \
+}
+
+#define SPLAY_INITIALIZER(root) \
+ { NULL }
+
+#define SPLAY_INIT(root) do { \
+ (root)->sph_root = NULL; \
+} while (0)
+
+#define SPLAY_ENTRY(type) \
+struct { \
+ struct type *spe_left; /* left element */ \
+ struct type *spe_right; /* right element */ \
+}
+
+#define SPLAY_LEFT(elm, field) (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right
+#define SPLAY_ROOT(head) (head)->sph_root
+#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (0)
+
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do { \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \
+} while (0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do { \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \
+} while (0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \
+ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
+ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
+} while (0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp) \
+void name##_SPLAY(struct name *, struct type *); \
+void name##_SPLAY_MINMAX(struct name *, int); \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *); \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \
+ \
+/* Finds the node with the same key as elm */ \
+static __inline struct type * \
+name##_SPLAY_FIND(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) \
+ return(NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) \
+ return (head->sph_root); \
+ return (NULL); \
+} \
+ \
+static __inline struct type * \
+name##_SPLAY_NEXT(struct name *head, struct type *elm) \
+{ \
+ name##_SPLAY(head, elm); \
+ if (SPLAY_RIGHT(elm, field) != NULL) { \
+ elm = SPLAY_RIGHT(elm, field); \
+ while (SPLAY_LEFT(elm, field) != NULL) { \
+ elm = SPLAY_LEFT(elm, field); \
+ } \
+ } else \
+ elm = NULL; \
+ return (elm); \
+} \
+ \
+static __inline struct type * \
+name##_SPLAY_MIN_MAX(struct name *head, int val) \
+{ \
+ name##_SPLAY_MINMAX(head, val); \
+ return (SPLAY_ROOT(head)); \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp) \
+struct type * \
+name##_SPLAY_INSERT(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) { \
+ SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \
+ } else { \
+ int __comp; \
+ name##_SPLAY(head, elm); \
+ __comp = (cmp)(elm, (head)->sph_root); \
+ if(__comp < 0) { \
+ SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
+ SPLAY_RIGHT(elm, field) = (head)->sph_root; \
+ SPLAY_LEFT((head)->sph_root, field) = NULL; \
+ } else if (__comp > 0) { \
+ SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT(elm, field) = (head)->sph_root; \
+ SPLAY_RIGHT((head)->sph_root, field) = NULL; \
+ } else \
+ return ((head)->sph_root); \
+ } \
+ (head)->sph_root = (elm); \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *__tmp; \
+ if (SPLAY_EMPTY(head)) \
+ return (NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) { \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
+ } else { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
+ name##_SPLAY(head, elm); \
+ SPLAY_RIGHT((head)->sph_root, field) = __tmp; \
+ } \
+ return (elm); \
+ } \
+ return (NULL); \
+} \
+ \
+void \
+name##_SPLAY(struct name *head, struct type *elm) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+ int __comp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while ((__comp = (cmp)(elm, (head)->sph_root))) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) > 0){ \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+} \
+ \
+/* Splay with either the minimum or the maximum element \
+ * Used to find minimum or maximum element in tree. \
+ */ \
+void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while (1) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp > 0) { \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+}
+
+#define SPLAY_NEGINF -1
+#define SPLAY_INF 1
+
+#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head) \
+ for ((x) = SPLAY_MIN(name, head); \
+ (x) != NULL; \
+ (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-back tree */
+#define RB_HEAD(name, type) \
+struct name { \
+ struct type *rbh_root; /* root of the tree */ \
+}
+
+#define RB_INITIALIZER(root) \
+ { NULL }
+
+#define RB_INIT(root) do { \
+ (root)->rbh_root = NULL; \
+} while (0)
+
+#define RB_BLACK 0
+#define RB_RED 1
+#define RB_ENTRY(type) \
+struct { \
+ struct type *rbe_left; /* left element */ \
+ struct type *rbe_right; /* right element */ \
+ struct type *rbe_parent; /* parent element */ \
+ int rbe_color; /* node color */ \
+}
+
+#define RB_LEFT(elm, field) (elm)->field.rbe_left
+#define RB_RIGHT(elm, field) (elm)->field.rbe_right
+#define RB_PARENT(elm, field) (elm)->field.rbe_parent
+#define RB_COLOR(elm, field) (elm)->field.rbe_color
+#define RB_ROOT(head) (head)->rbh_root
+#define RB_EMPTY(head) (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do { \
+ RB_PARENT(elm, field) = parent; \
+ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
+ RB_COLOR(elm, field) = RB_RED; \
+} while (0)
+
+#define RB_SET_BLACKRED(black, red, field) do { \
+ RB_COLOR(black, field) = RB_BLACK; \
+ RB_COLOR(red, field) = RB_RED; \
+} while (0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \
+ (tmp) = RB_RIGHT(elm, field); \
+ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) { \
+ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_LEFT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
+ (tmp) = RB_LEFT(elm, field); \
+ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) { \
+ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_RIGHT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (0)
+
+/* Generates prototypes and inline functions */
+#define RB_PROTOTYPE(name, type, field, cmp) \
+void name##_RB_INSERT_COLOR(struct name *, struct type *); \
+void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+struct type *name##_RB_REMOVE(struct name *, struct type *); \
+struct type *name##_RB_INSERT(struct name *, struct type *); \
+struct type *name##_RB_FIND(struct name *, struct type *); \
+struct type *name##_RB_NEXT(struct type *); \
+struct type *name##_RB_MINMAX(struct name *, int); \
+ \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define RB_GENERATE(name, type, field, cmp) \
+void \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
+{ \
+ struct type *parent, *gparent, *tmp; \
+ while ((parent = RB_PARENT(elm, field)) && \
+ RB_COLOR(parent, field) == RB_RED) { \
+ gparent = RB_PARENT(parent, field); \
+ if (parent == RB_LEFT(gparent, field)) { \
+ tmp = RB_RIGHT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_RIGHT(parent, field) == elm) { \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_RIGHT(head, gparent, tmp, field); \
+ } else { \
+ tmp = RB_LEFT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_LEFT(parent, field) == elm) { \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_LEFT(head, gparent, tmp, field); \
+ } \
+ } \
+ RB_COLOR(head->rbh_root, field) = RB_BLACK; \
+} \
+ \
+void \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
+{ \
+ struct type *tmp; \
+ while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \
+ elm != RB_ROOT(head)) { \
+ if (RB_LEFT(parent, field) == elm) { \
+ tmp = RB_RIGHT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
+ struct type *oleft; \
+ if ((oleft = RB_LEFT(tmp, field)))\
+ RB_COLOR(oleft, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_RIGHT(head, tmp, oleft, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_RIGHT(tmp, field)) \
+ RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } else { \
+ tmp = RB_LEFT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
+ struct type *oright; \
+ if ((oright = RB_RIGHT(tmp, field)))\
+ RB_COLOR(oright, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_LEFT(head, tmp, oright, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_LEFT(tmp, field)) \
+ RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } \
+ } \
+ if (elm) \
+ RB_COLOR(elm, field) = RB_BLACK; \
+} \
+ \
+struct type * \
+name##_RB_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *child, *parent, *old = elm; \
+ int color; \
+ if (RB_LEFT(elm, field) == NULL) \
+ child = RB_RIGHT(elm, field); \
+ else if (RB_RIGHT(elm, field) == NULL) \
+ child = RB_LEFT(elm, field); \
+ else { \
+ struct type *left; \
+ elm = RB_RIGHT(elm, field); \
+ while ((left = RB_LEFT(elm, field))) \
+ elm = left; \
+ child = RB_RIGHT(elm, field); \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+ if (RB_PARENT(elm, field) == old) \
+ parent = elm; \
+ (elm)->field = (old)->field; \
+ if (RB_PARENT(old, field)) { \
+ if (RB_LEFT(RB_PARENT(old, field), field) == old)\
+ RB_LEFT(RB_PARENT(old, field), field) = elm;\
+ else \
+ RB_RIGHT(RB_PARENT(old, field), field) = elm;\
+ RB_AUGMENT(RB_PARENT(old, field)); \
+ } else \
+ RB_ROOT(head) = elm; \
+ RB_PARENT(RB_LEFT(old, field), field) = elm; \
+ if (RB_RIGHT(old, field)) \
+ RB_PARENT(RB_RIGHT(old, field), field) = elm; \
+ if (parent) { \
+ left = parent; \
+ do { \
+ RB_AUGMENT(left); \
+ } while ((left = RB_PARENT(left, field))); \
+ } \
+ goto color; \
+ } \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+color: \
+ if (color == RB_BLACK) \
+ name##_RB_REMOVE_COLOR(head, parent, child); \
+ return (old); \
+} \
+ \
+/* Inserts a node into the RB tree */ \
+struct type * \
+name##_RB_INSERT(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp; \
+ struct type *parent = NULL; \
+ int comp = 0; \
+ tmp = RB_ROOT(head); \
+ while (tmp) { \
+ parent = tmp; \
+ comp = (cmp)(elm, parent); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ RB_SET(elm, parent, field); \
+ if (parent != NULL) { \
+ if (comp < 0) \
+ RB_LEFT(parent, field) = elm; \
+ else \
+ RB_RIGHT(parent, field) = elm; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = elm; \
+ name##_RB_INSERT_COLOR(head, elm); \
+ return (NULL); \
+} \
+ \
+/* Finds the node with the same key as elm */ \
+struct type * \
+name##_RB_FIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_RB_NEXT(struct type *elm) \
+{ \
+ if (RB_RIGHT(elm, field)) { \
+ elm = RB_RIGHT(elm, field); \
+ while (RB_LEFT(elm, field)) \
+ elm = RB_LEFT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+struct type * \
+name##_RB_MINMAX(struct name *head, int val) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *parent = NULL; \
+ while (tmp) { \
+ parent = tmp; \
+ if (val < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else \
+ tmp = RB_RIGHT(tmp, field); \
+ } \
+ return (parent); \
+}
+
+#define RB_NEGINF -1
+#define RB_INF 1
+
+#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y) name##_RB_FIND(x, y)
+#define RB_NEXT(name, x, y) name##_RB_NEXT(y)
+#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head) \
+ for ((x) = RB_MIN(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_NEXT(x))
+
+#endif /* _SYS_TREE_H_ */
diff --git a/sntp/libevent/aclocal.m4 b/sntp/libevent/aclocal.m4
new file mode 100644
index 0000000..3bba486
--- /dev/null
+++ b/sntp/libevent/aclocal.m4
@@ -0,0 +1,1142 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# serial 9 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# If autoconf reports a warning
+# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+# but always AC_REQUIREd,
+# 2) to ensure that for each occurrence of
+# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+# or
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+# the corresponding gnulib module description has 'extensions' among
+# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+# invocation occurs in gl_EARLY, not in gl_INIT.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+ if test "$MINIX" = yes; then
+ AC_DEFINE([_POSIX_SOURCE], [1],
+ [Define to 1 if you need to in order for `stat' and other
+ things to work.])
+ AC_DEFINE([_POSIX_1_SOURCE], [2],
+ [Define to 2 if the system does not provide POSIX.1 features
+ except with this defined.])
+ AC_DEFINE([_MINIX], [1],
+ [Define to 1 if on MINIX.])
+ fi
+
+ dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+ dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+ dnl provided.
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_XOPEN_SOURCE], [500],
+ [Define to 500 only on HP-UX.])
+ ;;
+ esac
+
+ AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+])# AC_USE_SYSTEM_EXTENSIONS
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
+[
+ dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
+ dnl gnulib does not need it. But if it gets required by third-party macros
+ dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
+ dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
+ dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 10
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+ [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[ --enable-silent-rules less verbose build output (undo: `make V=1')
+ --disable-silent-rules verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/ac_backport_259_ssizet.m4])
+m4_include([m4/libevent_openssl.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/ntp_pkg_config.m4])
+m4_include([m4/openldap-thread-check.m4])
+m4_include([m4/openldap.m4])
diff --git a/sntp/libevent/arc4random.c b/sntp/libevent/arc4random.c
new file mode 100644
index 0000000..a2338e6
--- /dev/null
+++ b/sntp/libevent/arc4random.c
@@ -0,0 +1,556 @@
+/* Portable arc4random.c based on arc4random.c from OpenBSD.
+ * Portable version by Chris Davis, adapted for Libevent by Nick Mathewson
+ * Copyright (c) 2010 Chris Davis, Niels Provos, and Nick Mathewson
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * Note that in Libevent, this file isn't compiled directly. Instead,
+ * it's included from evutil_rand.c
+ */
+
+/*
+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Arc4 random number generator for OpenBSD.
+ *
+ * This code is derived from section 17.1 of Applied Cryptography,
+ * second edition, which describes a stream cipher allegedly
+ * compatible with RSA Labs "RC4" cipher (the actual description of
+ * which is a trade secret). The same algorithm is used as a stream
+ * cipher called "arcfour" in Tatu Ylonen's ssh package.
+ *
+ * Here the stream cipher has been modified always to include the time
+ * when initializing the state. That makes it impossible to
+ * regenerate the same random sequence twice, so this can't be used
+ * for encryption, but will generate good random numbers.
+ *
+ * RC4 is a registered trademark of RSA Laboratories.
+ */
+
+#ifndef ARC4RANDOM_EXPORT
+#define ARC4RANDOM_EXPORT
+#endif
+
+#ifndef ARC4RANDOM_UINT32
+#define ARC4RANDOM_UINT32 uint32_t
+#endif
+
+#ifndef ARC4RANDOM_NO_INCLUDES
+#include "evconfig-private.h"
+#ifdef _WIN32
+#include <wincrypt.h>
+#include <process.h>
+#else
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#ifdef EVENT__HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#endif
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+/* Add platform entropy 32 bytes (256 bits) at a time. */
+#define ADD_ENTROPY 32
+
+/* Re-seed from the platform RNG after generating this many bytes. */
+#define BYTES_BEFORE_RESEED 1600000
+
+struct arc4_stream {
+ unsigned char i;
+ unsigned char j;
+ unsigned char s[256];
+};
+
+#ifdef _WIN32
+#define getpid _getpid
+#define pid_t int
+#endif
+
+static int rs_initialized;
+static struct arc4_stream rs;
+static pid_t arc4_stir_pid;
+static int arc4_count;
+static int arc4_seeded_ok;
+
+static inline unsigned char arc4_getbyte(void);
+
+static inline void
+arc4_init(void)
+{
+ int n;
+
+ for (n = 0; n < 256; n++)
+ rs.s[n] = n;
+ rs.i = 0;
+ rs.j = 0;
+}
+
+static inline void
+arc4_addrandom(const unsigned char *dat, int datlen)
+{
+ int n;
+ unsigned char si;
+
+ rs.i--;
+ for (n = 0; n < 256; n++) {
+ rs.i = (rs.i + 1);
+ si = rs.s[rs.i];
+ rs.j = (rs.j + si + dat[n % datlen]);
+ rs.s[rs.i] = rs.s[rs.j];
+ rs.s[rs.j] = si;
+ }
+ rs.j = rs.i;
+}
+
+#ifndef _WIN32
+static ssize_t
+read_all(int fd, unsigned char *buf, size_t count)
+{
+ size_t numread = 0;
+ ssize_t result;
+
+ while (numread < count) {
+ result = read(fd, buf+numread, count-numread);
+ if (result<0)
+ return -1;
+ else if (result == 0)
+ break;
+ numread += result;
+ }
+
+ return (ssize_t)numread;
+}
+#endif
+
+#ifdef _WIN32
+#define TRY_SEED_WIN32
+static int
+arc4_seed_win32(void)
+{
+ /* This is adapted from Tor's crypto_seed_rng() */
+ static int provider_set = 0;
+ static HCRYPTPROV provider;
+ unsigned char buf[ADD_ENTROPY];
+
+ if (!provider_set) {
+ if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
+ CRYPT_VERIFYCONTEXT)) {
+ if (GetLastError() != (DWORD)NTE_BAD_KEYSET)
+ return -1;
+ }
+ provider_set = 1;
+ }
+ if (!CryptGenRandom(provider, sizeof(buf), buf))
+ return -1;
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+
+#if defined(EVENT__HAVE_SYS_SYSCTL_H) && defined(EVENT__HAVE_SYSCTL)
+#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_RANDOM && EVENT__HAVE_DECL_RANDOM_UUID
+#define TRY_SEED_SYSCTL_LINUX
+static int
+arc4_seed_sysctl_linux(void)
+{
+ /* Based on code by William Ahern, this function tries to use the
+ * RANDOM_UUID sysctl to get entropy from the kernel. This can work
+ * even if /dev/urandom is inaccessible for some reason (e.g., we're
+ * running in a chroot). */
+ int mib[] = { CTL_KERN, KERN_RANDOM, RANDOM_UUID };
+ unsigned char buf[ADD_ENTROPY];
+ size_t len, n;
+ unsigned i;
+ int any_set;
+
+ memset(buf, 0, sizeof(buf));
+
+ for (len = 0; len < sizeof(buf); len += n) {
+ n = sizeof(buf) - len;
+
+ if (0 != sysctl(mib, 3, &buf[len], &n, NULL, 0))
+ return -1;
+ }
+ /* make sure that the buffer actually got set. */
+ for (i=0,any_set=0; i<sizeof(buf); ++i) {
+ any_set |= buf[i];
+ }
+ if (!any_set)
+ return -1;
+
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+
+#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_ARND
+#define TRY_SEED_SYSCTL_BSD
+static int
+arc4_seed_sysctl_bsd(void)
+{
+ /* Based on code from William Ahern and from OpenBSD, this function
+ * tries to use the KERN_ARND syscall to get entropy from the kernel.
+ * This can work even if /dev/urandom is inaccessible for some reason
+ * (e.g., we're running in a chroot). */
+ int mib[] = { CTL_KERN, KERN_ARND };
+ unsigned char buf[ADD_ENTROPY];
+ size_t len, n;
+ int i, any_set;
+
+ memset(buf, 0, sizeof(buf));
+
+ len = sizeof(buf);
+ if (sysctl(mib, 2, buf, &len, NULL, 0) == -1) {
+ for (len = 0; len < sizeof(buf); len += sizeof(unsigned)) {
+ n = sizeof(unsigned);
+ if (n + len > sizeof(buf))
+ n = len - sizeof(buf);
+ if (sysctl(mib, 2, &buf[len], &n, NULL, 0) == -1)
+ return -1;
+ }
+ }
+ /* make sure that the buffer actually got set. */
+ for (i=any_set=0; i<sizeof(buf); ++i) {
+ any_set |= buf[i];
+ }
+ if (!any_set)
+ return -1;
+
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+#endif /* defined(EVENT__HAVE_SYS_SYSCTL_H) */
+
+#ifdef __linux__
+#define TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID
+static int
+arc4_seed_proc_sys_kernel_random_uuid(void)
+{
+ /* Occasionally, somebody will make /proc/sys accessible in a chroot,
+ * but not /dev/urandom. Let's try /proc/sys/kernel/random/uuid.
+ * Its format is stupid, so we need to decode it from hex.
+ */
+ int fd;
+ char buf[128];
+ unsigned char entropy[64];
+ int bytes, n, i, nybbles;
+ for (bytes = 0; bytes<ADD_ENTROPY; ) {
+ fd = evutil_open_closeonexec_("/proc/sys/kernel/random/uuid", O_RDONLY, 0);
+ if (fd < 0)
+ return -1;
+ n = read(fd, buf, sizeof(buf));
+ close(fd);
+ if (n<=0)
+ return -1;
+ memset(entropy, 0, sizeof(entropy));
+ for (i=nybbles=0; i<n; ++i) {
+ if (EVUTIL_ISXDIGIT_(buf[i])) {
+ int nyb = evutil_hex_char_to_int_(buf[i]);
+ if (nybbles & 1) {
+ entropy[nybbles/2] |= nyb;
+ } else {
+ entropy[nybbles/2] |= nyb<<4;
+ }
+ ++nybbles;
+ }
+ }
+ if (nybbles < 2)
+ return -1;
+ arc4_addrandom(entropy, nybbles/2);
+ bytes += nybbles/2;
+ }
+ evutil_memclear_(entropy, sizeof(entropy));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+#endif
+
+#ifndef _WIN32
+#define TRY_SEED_URANDOM
+static char *arc4random_urandom_filename = NULL;
+
+static int arc4_seed_urandom_helper_(const char *fname)
+{
+ unsigned char buf[ADD_ENTROPY];
+ int fd;
+ size_t n;
+
+ fd = evutil_open_closeonexec_(fname, O_RDONLY, 0);
+ if (fd<0)
+ return -1;
+ n = read_all(fd, buf, sizeof(buf));
+ close(fd);
+ if (n != sizeof(buf))
+ return -1;
+ arc4_addrandom(buf, sizeof(buf));
+ evutil_memclear_(buf, sizeof(buf));
+ arc4_seeded_ok = 1;
+ return 0;
+}
+
+static int
+arc4_seed_urandom(void)
+{
+ /* This is adapted from Tor's crypto_seed_rng() */
+ static const char *filenames[] = {
+ "/dev/srandom", "/dev/urandom", "/dev/random", NULL
+ };
+ int i;
+ if (arc4random_urandom_filename)
+ return arc4_seed_urandom_helper_(arc4random_urandom_filename);
+
+ for (i = 0; filenames[i]; ++i) {
+ if (arc4_seed_urandom_helper_(filenames[i]) == 0) {
+ return 0;
+ }
+ }
+
+ return -1;
+}
+#endif
+
+static int
+arc4_seed(void)
+{
+ int ok = 0;
+ /* We try every method that might work, and don't give up even if one
+ * does seem to work. There's no real harm in over-seeding, and if
+ * one of these sources turns out to be broken, that would be bad. */
+#ifdef TRY_SEED_WIN32
+ if (0 == arc4_seed_win32())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_URANDOM
+ if (0 == arc4_seed_urandom())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID
+ if (arc4random_urandom_filename == NULL &&
+ 0 == arc4_seed_proc_sys_kernel_random_uuid())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_SYSCTL_LINUX
+ /* Apparently Linux is deprecating sysctl, and spewing warning
+ * messages when you try to use it. */
+ if (!ok && 0 == arc4_seed_sysctl_linux())
+ ok = 1;
+#endif
+#ifdef TRY_SEED_SYSCTL_BSD
+ if (0 == arc4_seed_sysctl_bsd())
+ ok = 1;
+#endif
+ return ok ? 0 : -1;
+}
+
+static int
+arc4_stir(void)
+{
+ int i;
+
+ if (!rs_initialized) {
+ arc4_init();
+ rs_initialized = 1;
+ }
+
+ arc4_seed();
+ if (!arc4_seeded_ok)
+ return -1;
+
+ /*
+ * Discard early keystream, as per recommendations in
+ * "Weaknesses in the Key Scheduling Algorithm of RC4" by
+ * Scott Fluhrer, Itsik Mantin, and Adi Shamir.
+ * http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
+ *
+ * Ilya Mironov's "(Not So) Random Shuffles of RC4" suggests that
+ * we drop at least 2*256 bytes, with 12*256 as a conservative
+ * value.
+ *
+ * RFC4345 says to drop 6*256.
+ *
+ * At least some versions of this code drop 4*256, in a mistaken
+ * belief that "words" in the Fluhrer/Mantin/Shamir paper refers
+ * to processor words.
+ *
+ * We add another sect to the cargo cult, and choose 12*256.
+ */
+ for (i = 0; i < 12*256; i++)
+ (void)arc4_getbyte();
+
+ arc4_count = BYTES_BEFORE_RESEED;
+
+ return 0;
+}
+
+
+static void
+arc4_stir_if_needed(void)
+{
+ pid_t pid = getpid();
+
+ if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid)
+ {
+ arc4_stir_pid = pid;
+ arc4_stir();
+ }
+}
+
+static inline unsigned char
+arc4_getbyte(void)
+{
+ unsigned char si, sj;
+
+ rs.i = (rs.i + 1);
+ si = rs.s[rs.i];
+ rs.j = (rs.j + si);
+ sj = rs.s[rs.j];
+ rs.s[rs.i] = sj;
+ rs.s[rs.j] = si;
+ return (rs.s[(si + sj) & 0xff]);
+}
+
+static inline unsigned int
+arc4_getword(void)
+{
+ unsigned int val;
+
+ val = arc4_getbyte() << 24;
+ val |= arc4_getbyte() << 16;
+ val |= arc4_getbyte() << 8;
+ val |= arc4_getbyte();
+
+ return val;
+}
+
+#ifndef ARC4RANDOM_NOSTIR
+ARC4RANDOM_EXPORT int
+arc4random_stir(void)
+{
+ int val;
+ ARC4_LOCK_();
+ val = arc4_stir();
+ ARC4_UNLOCK_();
+ return val;
+}
+#endif
+
+#ifndef ARC4RANDOM_NOADDRANDOM
+ARC4RANDOM_EXPORT void
+arc4random_addrandom(const unsigned char *dat, int datlen)
+{
+ int j;
+ ARC4_LOCK_();
+ if (!rs_initialized)
+ arc4_stir();
+ for (j = 0; j < datlen; j += 256) {
+ /* arc4_addrandom() ignores all but the first 256 bytes of
+ * its input. We want to make sure to look at ALL the
+ * data in 'dat', just in case the user is doing something
+ * crazy like passing us all the files in /var/log. */
+ arc4_addrandom(dat + j, datlen - j);
+ }
+ ARC4_UNLOCK_();
+}
+#endif
+
+#ifndef ARC4RANDOM_NORANDOM
+ARC4RANDOM_EXPORT ARC4RANDOM_UINT32
+arc4random(void)
+{
+ ARC4RANDOM_UINT32 val;
+ ARC4_LOCK_();
+ arc4_count -= 4;
+ arc4_stir_if_needed();
+ val = arc4_getword();
+ ARC4_UNLOCK_();
+ return val;
+}
+#endif
+
+ARC4RANDOM_EXPORT void
+arc4random_buf(void *buf_, size_t n)
+{
+ unsigned char *buf = buf_;
+ ARC4_LOCK_();
+ arc4_stir_if_needed();
+ while (n--) {
+ if (--arc4_count <= 0)
+ arc4_stir();
+ buf[n] = arc4_getbyte();
+ }
+ ARC4_UNLOCK_();
+}
+
+#ifndef ARC4RANDOM_NOUNIFORM
+/*
+ * Calculate a uniformly distributed random number less than upper_bound
+ * avoiding "modulo bias".
+ *
+ * Uniformity is achieved by generating new random numbers until the one
+ * returned is outside the range [0, 2**32 % upper_bound). This
+ * guarantees the selected random number will be inside
+ * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound)
+ * after reduction modulo upper_bound.
+ */
+ARC4RANDOM_EXPORT unsigned int
+arc4random_uniform(unsigned int upper_bound)
+{
+ ARC4RANDOM_UINT32 r, min;
+
+ if (upper_bound < 2)
+ return 0;
+
+#if (UINT_MAX > 0xffffffffUL)
+ min = 0x100000000UL % upper_bound;
+#else
+ /* Calculate (2**32 % upper_bound) avoiding 64-bit math */
+ if (upper_bound > 0x80000000)
+ min = 1 + ~upper_bound; /* 2**32 - upper_bound */
+ else {
+ /* (2**32 - (x * 2)) % x == 2**32 % x when x <= 2**31 */
+ min = ((0xffffffff - (upper_bound * 2)) + 1) % upper_bound;
+ }
+#endif
+
+ /*
+ * This could theoretically loop forever but each retry has
+ * p > 0.5 (worst case, usually far better) of selecting a
+ * number inside the range we need, so it should rarely need
+ * to re-roll.
+ */
+ for (;;) {
+ r = arc4random();
+ if (r >= min)
+ break;
+ }
+
+ return r % upper_bound;
+}
+#endif
diff --git a/sntp/libevent/autogen.sh b/sntp/libevent/autogen.sh
new file mode 100755
index 0000000..57eeb94
--- /dev/null
+++ b/sntp/libevent/autogen.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+if [ -x "`which autoreconf 2>/dev/null`" ] ; then
+ exec autoreconf -ivf
+fi
+
+LIBTOOLIZE=libtoolize
+SYSNAME=`uname`
+if [ "x$SYSNAME" = "xDarwin" ] ; then
+ LIBTOOLIZE=glibtoolize
+fi
+aclocal -I m4 && \
+ autoheader && \
+ $LIBTOOLIZE && \
+ autoconf && \
+ automake --add-missing --force-missing --copy
diff --git a/sntp/libevent/buffer.c b/sntp/libevent/buffer.c
new file mode 100644
index 0000000..e603be8
--- /dev/null
+++ b/sntp/libevent/buffer.c
@@ -0,0 +1,3375 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <io.h>
+#endif
+
+#ifdef EVENT__HAVE_VASPRINTF
+/* If we have vasprintf, we need to define _GNU_SOURCE before we include
+ * stdio.h. This comes from evconfig-private.h.
+ */
+#endif
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SENDFILE_H
+#include <sys/sendfile.h>
+#endif
+#ifdef EVENT__HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <limits.h>
+
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/thread.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+#include "evbuffer-internal.h"
+#include "bufferevent-internal.h"
+
+/* some systems do not have MAP_FAILED */
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+/* send file support */
+#if defined(EVENT__HAVE_SYS_SENDFILE_H) && defined(EVENT__HAVE_SENDFILE) && defined(__linux__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_LINUX 1
+#elif defined(EVENT__HAVE_SENDFILE) && defined(__FreeBSD__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_FREEBSD 1
+#elif defined(EVENT__HAVE_SENDFILE) && defined(__APPLE__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_MACOSX 1
+#elif defined(EVENT__HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__)
+#define USE_SENDFILE 1
+#define SENDFILE_IS_SOLARIS 1
+#endif
+
+/* Mask of user-selectable callback flags. */
+#define EVBUFFER_CB_USER_FLAGS 0xffff
+/* Mask of all internal-use-only flags. */
+#define EVBUFFER_CB_INTERNAL_FLAGS 0xffff0000
+
+/* Flag set if the callback is using the cb_obsolete function pointer */
+#define EVBUFFER_CB_OBSOLETE 0x00040000
+
+/* evbuffer_chain support */
+#define CHAIN_SPACE_PTR(ch) ((ch)->buffer + (ch)->misalign + (ch)->off)
+#define CHAIN_SPACE_LEN(ch) ((ch)->flags & EVBUFFER_IMMUTABLE ? \
+ 0 : (ch)->buffer_len - ((ch)->misalign + (ch)->off))
+
+#define CHAIN_PINNED(ch) (((ch)->flags & EVBUFFER_MEM_PINNED_ANY) != 0)
+#define CHAIN_PINNED_R(ch) (((ch)->flags & EVBUFFER_MEM_PINNED_R) != 0)
+
+/* evbuffer_ptr support */
+#define PTR_NOT_FOUND(ptr) do { \
+ (ptr)->pos = -1; \
+ (ptr)->internal_.chain = NULL; \
+ (ptr)->internal_.pos_in_chain = 0; \
+} while (0)
+
+static void evbuffer_chain_align(struct evbuffer_chain *chain);
+static int evbuffer_chain_should_realign(struct evbuffer_chain *chain,
+ size_t datalen);
+static void evbuffer_deferred_callback(struct event_callback *cb, void *arg);
+static int evbuffer_ptr_memcmp(const struct evbuffer *buf,
+ const struct evbuffer_ptr *pos, const char *mem, size_t len);
+static struct evbuffer_chain *evbuffer_expand_singlechain(struct evbuffer *buf,
+ size_t datlen);
+static int evbuffer_ptr_subtract(struct evbuffer *buf, struct evbuffer_ptr *pos,
+ size_t howfar);
+static int evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg);
+static inline void evbuffer_chain_incref(struct evbuffer_chain *chain);
+
+static struct evbuffer_chain *
+evbuffer_chain_new(size_t size)
+{
+ struct evbuffer_chain *chain;
+ size_t to_alloc;
+
+ size += EVBUFFER_CHAIN_SIZE;
+
+ /* get the next largest memory that can hold the buffer */
+ to_alloc = MIN_BUFFER_SIZE;
+ while (to_alloc < size)
+ to_alloc <<= 1;
+
+ /* we get everything in one chunk */
+ if ((chain = mm_malloc(to_alloc)) == NULL)
+ return (NULL);
+
+ memset(chain, 0, EVBUFFER_CHAIN_SIZE);
+
+ chain->buffer_len = to_alloc - EVBUFFER_CHAIN_SIZE;
+
+ /* this way we can manipulate the buffer to different addresses,
+ * which is required for mmap for example.
+ */
+ chain->buffer = EVBUFFER_CHAIN_EXTRA(u_char, chain);
+
+ chain->refcnt = 1;
+
+ return (chain);
+}
+
+static inline void
+evbuffer_chain_free(struct evbuffer_chain *chain)
+{
+ EVUTIL_ASSERT(chain->refcnt > 0);
+ if (--chain->refcnt > 0) {
+ /* chain is still referenced by other chains */
+ return;
+ }
+
+ if (CHAIN_PINNED(chain)) {
+ /* will get freed once no longer dangling */
+ chain->refcnt++;
+ chain->flags |= EVBUFFER_DANGLING;
+ return;
+ }
+
+ /* safe to release chain, it's either a referencing
+ * chain or all references to it have been freed */
+ if (chain->flags & EVBUFFER_REFERENCE) {
+ struct evbuffer_chain_reference *info =
+ EVBUFFER_CHAIN_EXTRA(
+ struct evbuffer_chain_reference,
+ chain);
+ if (info->cleanupfn)
+ (*info->cleanupfn)(chain->buffer,
+ chain->buffer_len,
+ info->extra);
+ }
+ if (chain->flags & EVBUFFER_FILESEGMENT) {
+ struct evbuffer_chain_file_segment *info =
+ EVBUFFER_CHAIN_EXTRA(
+ struct evbuffer_chain_file_segment,
+ chain);
+ if (info->segment) {
+#ifdef _WIN32
+ if (info->segment->is_mapping)
+ UnmapViewOfFile(chain->buffer);
+#endif
+ evbuffer_file_segment_free(info->segment);
+ }
+ }
+ if (chain->flags & EVBUFFER_MULTICAST) {
+ struct evbuffer_multicast_parent *info =
+ EVBUFFER_CHAIN_EXTRA(
+ struct evbuffer_multicast_parent,
+ chain);
+ /* referencing chain is being freed, decrease
+ * refcounts of source chain and associated
+ * evbuffer (which get freed once both reach
+ * zero) */
+ EVUTIL_ASSERT(info->source != NULL);
+ EVUTIL_ASSERT(info->parent != NULL);
+ EVBUFFER_LOCK(info->source);
+ evbuffer_chain_free(info->parent);
+ evbuffer_decref_and_unlock_(info->source);
+ }
+
+ mm_free(chain);
+}
+
+static void
+evbuffer_free_all_chains(struct evbuffer_chain *chain)
+{
+ struct evbuffer_chain *next;
+ for (; chain; chain = next) {
+ next = chain->next;
+ evbuffer_chain_free(chain);
+ }
+}
+
+#ifndef NDEBUG
+static int
+evbuffer_chains_all_empty(struct evbuffer_chain *chain)
+{
+ for (; chain; chain = chain->next) {
+ if (chain->off)
+ return 0;
+ }
+ return 1;
+}
+#else
+/* The definition is needed for EVUTIL_ASSERT, which uses sizeof to avoid
+"unused variable" warnings. */
+static inline int evbuffer_chains_all_empty(struct evbuffer_chain *chain) {
+ return 1;
+}
+#endif
+
+/* Free all trailing chains in 'buf' that are neither pinned nor empty, prior
+ * to replacing them all with a new chain. Return a pointer to the place
+ * where the new chain will go.
+ *
+ * Internal; requires lock. The caller must fix up buf->last and buf->first
+ * as needed; they might have been freed.
+ */
+static struct evbuffer_chain **
+evbuffer_free_trailing_empty_chains(struct evbuffer *buf)
+{
+ struct evbuffer_chain **ch = buf->last_with_datap;
+ /* Find the first victim chain. It might be *last_with_datap */
+ while ((*ch) && ((*ch)->off != 0 || CHAIN_PINNED(*ch)))
+ ch = &(*ch)->next;
+ if (*ch) {
+ EVUTIL_ASSERT(evbuffer_chains_all_empty(*ch));
+ evbuffer_free_all_chains(*ch);
+ *ch = NULL;
+ }
+ return ch;
+}
+
+/* Add a single chain 'chain' to the end of 'buf', freeing trailing empty
+ * chains as necessary. Requires lock. Does not schedule callbacks.
+ */
+static void
+evbuffer_chain_insert(struct evbuffer *buf,
+ struct evbuffer_chain *chain)
+{
+ ASSERT_EVBUFFER_LOCKED(buf);
+ if (*buf->last_with_datap == NULL) {
+ /* There are no chains data on the buffer at all. */
+ EVUTIL_ASSERT(buf->last_with_datap == &buf->first);
+ EVUTIL_ASSERT(buf->first == NULL);
+ buf->first = buf->last = chain;
+ } else {
+ struct evbuffer_chain **chp;
+ chp = evbuffer_free_trailing_empty_chains(buf);
+ *chp = chain;
+ if (chain->off)
+ buf->last_with_datap = chp;
+ buf->last = chain;
+ }
+ buf->total_len += chain->off;
+}
+
+static inline struct evbuffer_chain *
+evbuffer_chain_insert_new(struct evbuffer *buf, size_t datlen)
+{
+ struct evbuffer_chain *chain;
+ if ((chain = evbuffer_chain_new(datlen)) == NULL)
+ return NULL;
+ evbuffer_chain_insert(buf, chain);
+ return chain;
+}
+
+void
+evbuffer_chain_pin_(struct evbuffer_chain *chain, unsigned flag)
+{
+ EVUTIL_ASSERT((chain->flags & flag) == 0);
+ chain->flags |= flag;
+}
+
+void
+evbuffer_chain_unpin_(struct evbuffer_chain *chain, unsigned flag)
+{
+ EVUTIL_ASSERT((chain->flags & flag) != 0);
+ chain->flags &= ~flag;
+ if (chain->flags & EVBUFFER_DANGLING)
+ evbuffer_chain_free(chain);
+}
+
+static inline void
+evbuffer_chain_incref(struct evbuffer_chain *chain)
+{
+ ++chain->refcnt;
+}
+
+struct evbuffer *
+evbuffer_new(void)
+{
+ struct evbuffer *buffer;
+
+ buffer = mm_calloc(1, sizeof(struct evbuffer));
+ if (buffer == NULL)
+ return (NULL);
+
+ LIST_INIT(&buffer->callbacks);
+ buffer->refcnt = 1;
+ buffer->last_with_datap = &buffer->first;
+
+ return (buffer);
+}
+
+int
+evbuffer_set_flags(struct evbuffer *buf, ev_uint64_t flags)
+{
+ EVBUFFER_LOCK(buf);
+ buf->flags |= (ev_uint32_t)flags;
+ EVBUFFER_UNLOCK(buf);
+ return 0;
+}
+
+int
+evbuffer_clear_flags(struct evbuffer *buf, ev_uint64_t flags)
+{
+ EVBUFFER_LOCK(buf);
+ buf->flags &= ~(ev_uint32_t)flags;
+ EVBUFFER_UNLOCK(buf);
+ return 0;
+}
+
+void
+evbuffer_incref_(struct evbuffer *buf)
+{
+ EVBUFFER_LOCK(buf);
+ ++buf->refcnt;
+ EVBUFFER_UNLOCK(buf);
+}
+
+void
+evbuffer_incref_and_lock_(struct evbuffer *buf)
+{
+ EVBUFFER_LOCK(buf);
+ ++buf->refcnt;
+}
+
+int
+evbuffer_defer_callbacks(struct evbuffer *buffer, struct event_base *base)
+{
+ EVBUFFER_LOCK(buffer);
+ buffer->cb_queue = base;
+ buffer->deferred_cbs = 1;
+ event_deferred_cb_init_(&buffer->deferred,
+ event_base_get_npriorities(base) / 2,
+ evbuffer_deferred_callback, buffer);
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_enable_locking(struct evbuffer *buf, void *lock)
+{
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+ return -1;
+#else
+ if (buf->lock)
+ return -1;
+
+ if (!lock) {
+ EVTHREAD_ALLOC_LOCK(lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ if (!lock)
+ return -1;
+ buf->lock = lock;
+ buf->own_lock = 1;
+ } else {
+ buf->lock = lock;
+ buf->own_lock = 0;
+ }
+
+ return 0;
+#endif
+}
+
+void
+evbuffer_set_parent_(struct evbuffer *buf, struct bufferevent *bev)
+{
+ EVBUFFER_LOCK(buf);
+ buf->parent = bev;
+ EVBUFFER_UNLOCK(buf);
+}
+
+static void
+evbuffer_run_callbacks(struct evbuffer *buffer, int running_deferred)
+{
+ struct evbuffer_cb_entry *cbent, *next;
+ struct evbuffer_cb_info info;
+ size_t new_size;
+ ev_uint32_t mask, masked_val;
+ int clear = 1;
+
+ if (running_deferred) {
+ mask = EVBUFFER_CB_NODEFER|EVBUFFER_CB_ENABLED;
+ masked_val = EVBUFFER_CB_ENABLED;
+ } else if (buffer->deferred_cbs) {
+ mask = EVBUFFER_CB_NODEFER|EVBUFFER_CB_ENABLED;
+ masked_val = EVBUFFER_CB_NODEFER|EVBUFFER_CB_ENABLED;
+ /* Don't zero-out n_add/n_del, since the deferred callbacks
+ will want to see them. */
+ clear = 0;
+ } else {
+ mask = EVBUFFER_CB_ENABLED;
+ masked_val = EVBUFFER_CB_ENABLED;
+ }
+
+ ASSERT_EVBUFFER_LOCKED(buffer);
+
+ if (LIST_EMPTY(&buffer->callbacks)) {
+ buffer->n_add_for_cb = buffer->n_del_for_cb = 0;
+ return;
+ }
+ if (buffer->n_add_for_cb == 0 && buffer->n_del_for_cb == 0)
+ return;
+
+ new_size = buffer->total_len;
+ info.orig_size = new_size + buffer->n_del_for_cb - buffer->n_add_for_cb;
+ info.n_added = buffer->n_add_for_cb;
+ info.n_deleted = buffer->n_del_for_cb;
+ if (clear) {
+ buffer->n_add_for_cb = 0;
+ buffer->n_del_for_cb = 0;
+ }
+ for (cbent = LIST_FIRST(&buffer->callbacks);
+ cbent != LIST_END(&buffer->callbacks);
+ cbent = next) {
+ /* Get the 'next' pointer now in case this callback decides
+ * to remove itself or something. */
+ next = LIST_NEXT(cbent, next);
+
+ if ((cbent->flags & mask) != masked_val)
+ continue;
+
+ if ((cbent->flags & EVBUFFER_CB_OBSOLETE))
+ cbent->cb.cb_obsolete(buffer,
+ info.orig_size, new_size, cbent->cbarg);
+ else
+ cbent->cb.cb_func(buffer, &info, cbent->cbarg);
+ }
+}
+
+void
+evbuffer_invoke_callbacks_(struct evbuffer *buffer)
+{
+ if (LIST_EMPTY(&buffer->callbacks)) {
+ buffer->n_add_for_cb = buffer->n_del_for_cb = 0;
+ return;
+ }
+
+ if (buffer->deferred_cbs) {
+ if (event_deferred_cb_schedule_(buffer->cb_queue, &buffer->deferred)) {
+ evbuffer_incref_and_lock_(buffer);
+ if (buffer->parent)
+ bufferevent_incref_(buffer->parent);
+ }
+ EVBUFFER_UNLOCK(buffer);
+ }
+
+ evbuffer_run_callbacks(buffer, 0);
+}
+
+static void
+evbuffer_deferred_callback(struct event_callback *cb, void *arg)
+{
+ struct bufferevent *parent = NULL;
+ struct evbuffer *buffer = arg;
+
+ /* XXXX It would be better to run these callbacks without holding the
+ * lock */
+ EVBUFFER_LOCK(buffer);
+ parent = buffer->parent;
+ evbuffer_run_callbacks(buffer, 1);
+ evbuffer_decref_and_unlock_(buffer);
+ if (parent)
+ bufferevent_decref_(parent);
+}
+
+static void
+evbuffer_remove_all_callbacks(struct evbuffer *buffer)
+{
+ struct evbuffer_cb_entry *cbent;
+
+ while ((cbent = LIST_FIRST(&buffer->callbacks))) {
+ LIST_REMOVE(cbent, next);
+ mm_free(cbent);
+ }
+}
+
+void
+evbuffer_decref_and_unlock_(struct evbuffer *buffer)
+{
+ struct evbuffer_chain *chain, *next;
+ ASSERT_EVBUFFER_LOCKED(buffer);
+
+ EVUTIL_ASSERT(buffer->refcnt > 0);
+
+ if (--buffer->refcnt > 0) {
+ EVBUFFER_UNLOCK(buffer);
+ return;
+ }
+
+ for (chain = buffer->first; chain != NULL; chain = next) {
+ next = chain->next;
+ evbuffer_chain_free(chain);
+ }
+ evbuffer_remove_all_callbacks(buffer);
+ if (buffer->deferred_cbs)
+ event_deferred_cb_cancel_(buffer->cb_queue, &buffer->deferred);
+
+ EVBUFFER_UNLOCK(buffer);
+ if (buffer->own_lock)
+ EVTHREAD_FREE_LOCK(buffer->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(buffer);
+}
+
+void
+evbuffer_free(struct evbuffer *buffer)
+{
+ EVBUFFER_LOCK(buffer);
+ evbuffer_decref_and_unlock_(buffer);
+}
+
+void
+evbuffer_lock(struct evbuffer *buf)
+{
+ EVBUFFER_LOCK(buf);
+}
+
+void
+evbuffer_unlock(struct evbuffer *buf)
+{
+ EVBUFFER_UNLOCK(buf);
+}
+
+size_t
+evbuffer_get_length(const struct evbuffer *buffer)
+{
+ size_t result;
+
+ EVBUFFER_LOCK(buffer);
+
+ result = (buffer->total_len);
+
+ EVBUFFER_UNLOCK(buffer);
+
+ return result;
+}
+
+size_t
+evbuffer_get_contiguous_space(const struct evbuffer *buf)
+{
+ struct evbuffer_chain *chain;
+ size_t result;
+
+ EVBUFFER_LOCK(buf);
+ chain = buf->first;
+ result = (chain != NULL ? chain->off : 0);
+ EVBUFFER_UNLOCK(buf);
+
+ return result;
+}
+
+size_t
+evbuffer_add_iovec(struct evbuffer * buf, struct evbuffer_iovec * vec, int n_vec) {
+ int n;
+ size_t res;
+ size_t to_alloc;
+
+ EVBUFFER_LOCK(buf);
+
+ res = to_alloc = 0;
+
+ for (n = 0; n < n_vec; n++) {
+ to_alloc += vec[n].iov_len;
+ }
+
+ if (evbuffer_expand_fast_(buf, to_alloc, 2) < 0) {
+ goto done;
+ }
+
+ for (n = 0; n < n_vec; n++) {
+ /* XXX each 'add' call here does a bunch of setup that's
+ * obviated by evbuffer_expand_fast_, and some cleanup that we
+ * would like to do only once. Instead we should just extract
+ * the part of the code that's needed. */
+
+ if (evbuffer_add(buf, vec[n].iov_base, vec[n].iov_len) < 0) {
+ goto done;
+ }
+
+ res += vec[n].iov_len;
+ }
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return res;
+}
+
+int
+evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
+ struct evbuffer_iovec *vec, int n_vecs)
+{
+ struct evbuffer_chain *chain, **chainp;
+ int n = -1;
+
+ EVBUFFER_LOCK(buf);
+ if (buf->freeze_end)
+ goto done;
+ if (n_vecs < 1)
+ goto done;
+ if (n_vecs == 1) {
+ if ((chain = evbuffer_expand_singlechain(buf, size)) == NULL)
+ goto done;
+
+ vec[0].iov_base = CHAIN_SPACE_PTR(chain);
+ vec[0].iov_len = (size_t) CHAIN_SPACE_LEN(chain);
+ EVUTIL_ASSERT(size<0 || (size_t)vec[0].iov_len >= (size_t)size);
+ n = 1;
+ } else {
+ if (evbuffer_expand_fast_(buf, size, n_vecs)<0)
+ goto done;
+ n = evbuffer_read_setup_vecs_(buf, size, vec, n_vecs,
+ &chainp, 0);
+ }
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return n;
+
+}
+
+static int
+advance_last_with_data(struct evbuffer *buf)
+{
+ int n = 0;
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ if (!*buf->last_with_datap)
+ return 0;
+
+ while ((*buf->last_with_datap)->next && (*buf->last_with_datap)->next->off) {
+ buf->last_with_datap = &(*buf->last_with_datap)->next;
+ ++n;
+ }
+ return n;
+}
+
+int
+evbuffer_commit_space(struct evbuffer *buf,
+ struct evbuffer_iovec *vec, int n_vecs)
+{
+ struct evbuffer_chain *chain, **firstchainp, **chainp;
+ int result = -1;
+ size_t added = 0;
+ int i;
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end)
+ goto done;
+ if (n_vecs == 0) {
+ result = 0;
+ goto done;
+ } else if (n_vecs == 1 &&
+ (buf->last && vec[0].iov_base == (void*)CHAIN_SPACE_PTR(buf->last))) {
+ /* The user only got or used one chain; it might not
+ * be the first one with space in it. */
+ if ((size_t)vec[0].iov_len > (size_t)CHAIN_SPACE_LEN(buf->last))
+ goto done;
+ buf->last->off += vec[0].iov_len;
+ added = vec[0].iov_len;
+ if (added)
+ advance_last_with_data(buf);
+ goto okay;
+ }
+
+ /* Advance 'firstchain' to the first chain with space in it. */
+ firstchainp = buf->last_with_datap;
+ if (!*firstchainp)
+ goto done;
+ if (CHAIN_SPACE_LEN(*firstchainp) == 0) {
+ firstchainp = &(*firstchainp)->next;
+ }
+
+ chain = *firstchainp;
+ /* pass 1: make sure that the pointers and lengths of vecs[] are in
+ * bounds before we try to commit anything. */
+ for (i=0; i<n_vecs; ++i) {
+ if (!chain)
+ goto done;
+ if (vec[i].iov_base != (void*)CHAIN_SPACE_PTR(chain) ||
+ (size_t)vec[i].iov_len > CHAIN_SPACE_LEN(chain))
+ goto done;
+ chain = chain->next;
+ }
+ /* pass 2: actually adjust all the chains. */
+ chainp = firstchainp;
+ for (i=0; i<n_vecs; ++i) {
+ (*chainp)->off += vec[i].iov_len;
+ added += vec[i].iov_len;
+ if (vec[i].iov_len) {
+ buf->last_with_datap = chainp;
+ }
+ chainp = &(*chainp)->next;
+ }
+
+okay:
+ buf->total_len += added;
+ buf->n_add_for_cb += added;
+ result = 0;
+ evbuffer_invoke_callbacks_(buf);
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+static inline int
+HAS_PINNED_R(struct evbuffer *buf)
+{
+ return (buf->last && CHAIN_PINNED_R(buf->last));
+}
+
+static inline void
+ZERO_CHAIN(struct evbuffer *dst)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ dst->first = NULL;
+ dst->last = NULL;
+ dst->last_with_datap = &(dst)->first;
+ dst->total_len = 0;
+}
+
+/* Prepares the contents of src to be moved to another buffer by removing
+ * read-pinned chains. The first pinned chain is saved in first, and the
+ * last in last. If src has no read-pinned chains, first and last are set
+ * to NULL. */
+static int
+PRESERVE_PINNED(struct evbuffer *src, struct evbuffer_chain **first,
+ struct evbuffer_chain **last)
+{
+ struct evbuffer_chain *chain, **pinned;
+
+ ASSERT_EVBUFFER_LOCKED(src);
+
+ if (!HAS_PINNED_R(src)) {
+ *first = *last = NULL;
+ return 0;
+ }
+
+ pinned = src->last_with_datap;
+ if (!CHAIN_PINNED_R(*pinned))
+ pinned = &(*pinned)->next;
+ EVUTIL_ASSERT(CHAIN_PINNED_R(*pinned));
+ chain = *first = *pinned;
+ *last = src->last;
+
+ /* If there's data in the first pinned chain, we need to allocate
+ * a new chain and copy the data over. */
+ if (chain->off) {
+ struct evbuffer_chain *tmp;
+
+ EVUTIL_ASSERT(pinned == src->last_with_datap);
+ tmp = evbuffer_chain_new(chain->off);
+ if (!tmp)
+ return -1;
+ memcpy(tmp->buffer, chain->buffer + chain->misalign,
+ chain->off);
+ tmp->off = chain->off;
+ *src->last_with_datap = tmp;
+ src->last = tmp;
+ chain->misalign += chain->off;
+ chain->off = 0;
+ } else {
+ src->last = *src->last_with_datap;
+ *pinned = NULL;
+ }
+
+ return 0;
+}
+
+static inline void
+RESTORE_PINNED(struct evbuffer *src, struct evbuffer_chain *pinned,
+ struct evbuffer_chain *last)
+{
+ ASSERT_EVBUFFER_LOCKED(src);
+
+ if (!pinned) {
+ ZERO_CHAIN(src);
+ return;
+ }
+
+ src->first = pinned;
+ src->last = last;
+ src->last_with_datap = &src->first;
+ src->total_len = 0;
+}
+
+static inline void
+COPY_CHAIN(struct evbuffer *dst, struct evbuffer *src)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+ dst->first = src->first;
+ if (src->last_with_datap == &src->first)
+ dst->last_with_datap = &dst->first;
+ else
+ dst->last_with_datap = src->last_with_datap;
+ dst->last = src->last;
+ dst->total_len = src->total_len;
+}
+
+static void
+APPEND_CHAIN(struct evbuffer *dst, struct evbuffer *src)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+ dst->last->next = src->first;
+ if (src->last_with_datap == &src->first)
+ dst->last_with_datap = &dst->last->next;
+ else
+ dst->last_with_datap = src->last_with_datap;
+ dst->last = src->last;
+ dst->total_len += src->total_len;
+}
+
+static inline void
+APPEND_CHAIN_MULTICAST(struct evbuffer *dst, struct evbuffer *src)
+{
+ struct evbuffer_chain *tmp;
+ struct evbuffer_chain *chain = src->first;
+ struct evbuffer_multicast_parent *extra;
+
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+
+ for (; chain; chain = chain->next) {
+ if (!chain->off || chain->flags & EVBUFFER_DANGLING) {
+ /* skip empty chains */
+ continue;
+ }
+
+ tmp = evbuffer_chain_new(sizeof(struct evbuffer_multicast_parent));
+ if (!tmp) {
+ event_warn("%s: out of memory", __func__);
+ return;
+ }
+ extra = EVBUFFER_CHAIN_EXTRA(struct evbuffer_multicast_parent, tmp);
+ /* reference evbuffer containing source chain so it
+ * doesn't get released while the chain is still
+ * being referenced to */
+ evbuffer_incref_(src);
+ extra->source = src;
+ /* reference source chain which now becomes immutable */
+ evbuffer_chain_incref(chain);
+ extra->parent = chain;
+ chain->flags |= EVBUFFER_IMMUTABLE;
+ tmp->buffer_len = chain->buffer_len;
+ tmp->misalign = chain->misalign;
+ tmp->off = chain->off;
+ tmp->flags |= EVBUFFER_MULTICAST|EVBUFFER_IMMUTABLE;
+ tmp->buffer = chain->buffer;
+ evbuffer_chain_insert(dst, tmp);
+ }
+}
+
+static void
+PREPEND_CHAIN(struct evbuffer *dst, struct evbuffer *src)
+{
+ ASSERT_EVBUFFER_LOCKED(dst);
+ ASSERT_EVBUFFER_LOCKED(src);
+ src->last->next = dst->first;
+ dst->first = src->first;
+ dst->total_len += src->total_len;
+ if (*dst->last_with_datap == NULL) {
+ if (src->last_with_datap == &(src)->first)
+ dst->last_with_datap = &dst->first;
+ else
+ dst->last_with_datap = src->last_with_datap;
+ } else if (dst->last_with_datap == &dst->first) {
+ dst->last_with_datap = &src->last->next;
+ }
+}
+
+int
+evbuffer_add_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf)
+{
+ struct evbuffer_chain *pinned, *last;
+ size_t in_total_len, out_total_len;
+ int result = 0;
+
+ EVBUFFER_LOCK2(inbuf, outbuf);
+ in_total_len = inbuf->total_len;
+ out_total_len = outbuf->total_len;
+
+ if (in_total_len == 0 || outbuf == inbuf)
+ goto done;
+
+ if (outbuf->freeze_end || inbuf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ if (PRESERVE_PINNED(inbuf, &pinned, &last) < 0) {
+ result = -1;
+ goto done;
+ }
+
+ if (out_total_len == 0) {
+ /* There might be an empty chain at the start of outbuf; free
+ * it. */
+ evbuffer_free_all_chains(outbuf->first);
+ COPY_CHAIN(outbuf, inbuf);
+ } else {
+ APPEND_CHAIN(outbuf, inbuf);
+ }
+
+ RESTORE_PINNED(inbuf, pinned, last);
+
+ inbuf->n_del_for_cb += in_total_len;
+ outbuf->n_add_for_cb += in_total_len;
+
+ evbuffer_invoke_callbacks_(inbuf);
+ evbuffer_invoke_callbacks_(outbuf);
+
+done:
+ EVBUFFER_UNLOCK2(inbuf, outbuf);
+ return result;
+}
+
+int
+evbuffer_add_buffer_reference(struct evbuffer *outbuf, struct evbuffer *inbuf)
+{
+ size_t in_total_len, out_total_len;
+ struct evbuffer_chain *chain;
+ int result = 0;
+
+ EVBUFFER_LOCK2(inbuf, outbuf);
+ in_total_len = inbuf->total_len;
+ out_total_len = outbuf->total_len;
+ chain = inbuf->first;
+
+ if (in_total_len == 0)
+ goto done;
+
+ if (outbuf->freeze_end || outbuf == inbuf) {
+ result = -1;
+ goto done;
+ }
+
+ for (; chain; chain = chain->next) {
+ if ((chain->flags & (EVBUFFER_FILESEGMENT|EVBUFFER_SENDFILE|EVBUFFER_MULTICAST)) != 0) {
+ /* chain type can not be referenced */
+ result = -1;
+ goto done;
+ }
+ }
+
+ if (out_total_len == 0) {
+ /* There might be an empty chain at the start of outbuf; free
+ * it. */
+ evbuffer_free_all_chains(outbuf->first);
+ }
+ APPEND_CHAIN_MULTICAST(outbuf, inbuf);
+
+ outbuf->n_add_for_cb += in_total_len;
+ evbuffer_invoke_callbacks_(outbuf);
+
+done:
+ EVBUFFER_UNLOCK2(inbuf, outbuf);
+ return result;
+}
+
+int
+evbuffer_prepend_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf)
+{
+ struct evbuffer_chain *pinned, *last;
+ size_t in_total_len, out_total_len;
+ int result = 0;
+
+ EVBUFFER_LOCK2(inbuf, outbuf);
+
+ in_total_len = inbuf->total_len;
+ out_total_len = outbuf->total_len;
+
+ if (!in_total_len || inbuf == outbuf)
+ goto done;
+
+ if (outbuf->freeze_start || inbuf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ if (PRESERVE_PINNED(inbuf, &pinned, &last) < 0) {
+ result = -1;
+ goto done;
+ }
+
+ if (out_total_len == 0) {
+ /* There might be an empty chain at the start of outbuf; free
+ * it. */
+ evbuffer_free_all_chains(outbuf->first);
+ COPY_CHAIN(outbuf, inbuf);
+ } else {
+ PREPEND_CHAIN(outbuf, inbuf);
+ }
+
+ RESTORE_PINNED(inbuf, pinned, last);
+
+ inbuf->n_del_for_cb += in_total_len;
+ outbuf->n_add_for_cb += in_total_len;
+
+ evbuffer_invoke_callbacks_(inbuf);
+ evbuffer_invoke_callbacks_(outbuf);
+done:
+ EVBUFFER_UNLOCK2(inbuf, outbuf);
+ return result;
+}
+
+int
+evbuffer_drain(struct evbuffer *buf, size_t len)
+{
+ struct evbuffer_chain *chain, *next;
+ size_t remaining, old_len;
+ int result = 0;
+
+ EVBUFFER_LOCK(buf);
+ old_len = buf->total_len;
+
+ if (old_len == 0)
+ goto done;
+
+ if (buf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ if (len >= old_len && !HAS_PINNED_R(buf)) {
+ len = old_len;
+ for (chain = buf->first; chain != NULL; chain = next) {
+ next = chain->next;
+ evbuffer_chain_free(chain);
+ }
+
+ ZERO_CHAIN(buf);
+ } else {
+ if (len >= old_len)
+ len = old_len;
+
+ buf->total_len -= len;
+ remaining = len;
+ for (chain = buf->first;
+ remaining >= chain->off;
+ chain = next) {
+ next = chain->next;
+ remaining -= chain->off;
+
+ if (chain == *buf->last_with_datap) {
+ buf->last_with_datap = &buf->first;
+ }
+ if (&chain->next == buf->last_with_datap)
+ buf->last_with_datap = &buf->first;
+
+ if (CHAIN_PINNED_R(chain)) {
+ EVUTIL_ASSERT(remaining == 0);
+ chain->misalign += chain->off;
+ chain->off = 0;
+ break;
+ } else
+ evbuffer_chain_free(chain);
+ }
+
+ buf->first = chain;
+ chain->misalign += remaining;
+ chain->off -= remaining;
+ }
+
+ buf->n_del_for_cb += len;
+ /* Tell someone about changes in this buffer */
+ evbuffer_invoke_callbacks_(buf);
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/* Reads data from an event buffer and drains the bytes read */
+int
+evbuffer_remove(struct evbuffer *buf, void *data_out, size_t datlen)
+{
+ ev_ssize_t n;
+ EVBUFFER_LOCK(buf);
+ n = evbuffer_copyout_from(buf, NULL, data_out, datlen);
+ if (n > 0) {
+ if (evbuffer_drain(buf, n)<0)
+ n = -1;
+ }
+ EVBUFFER_UNLOCK(buf);
+ return (int)n;
+}
+
+ev_ssize_t
+evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen)
+{
+ return evbuffer_copyout_from(buf, NULL, data_out, datlen);
+}
+
+ev_ssize_t
+evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos,
+ void *data_out, size_t datlen)
+{
+ /*XXX fails badly on sendfile case. */
+ struct evbuffer_chain *chain;
+ char *data = data_out;
+ size_t nread;
+ ev_ssize_t result = 0;
+ size_t pos_in_chain;
+
+ EVBUFFER_LOCK(buf);
+
+ if (pos) {
+ chain = pos->internal_.chain;
+ pos_in_chain = pos->internal_.pos_in_chain;
+ if (datlen + pos->pos > buf->total_len)
+ datlen = buf->total_len - pos->pos;
+ } else {
+ chain = buf->first;
+ pos_in_chain = 0;
+ if (datlen > buf->total_len)
+ datlen = buf->total_len;
+ }
+
+
+ if (datlen == 0)
+ goto done;
+
+ if (buf->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ nread = datlen;
+
+ while (datlen && datlen >= chain->off - pos_in_chain) {
+ size_t copylen = chain->off - pos_in_chain;
+ memcpy(data,
+ chain->buffer + chain->misalign + pos_in_chain,
+ copylen);
+ data += copylen;
+ datlen -= copylen;
+
+ chain = chain->next;
+ pos_in_chain = 0;
+ EVUTIL_ASSERT(chain || datlen==0);
+ }
+
+ if (datlen) {
+ EVUTIL_ASSERT(chain);
+ memcpy(data, chain->buffer + chain->misalign + pos_in_chain,
+ datlen);
+ }
+
+ result = nread;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/* reads data from the src buffer to the dst buffer, avoids memcpy as
+ * possible. */
+/* XXXX should return ev_ssize_t */
+int
+evbuffer_remove_buffer(struct evbuffer *src, struct evbuffer *dst,
+ size_t datlen)
+{
+ /*XXX We should have an option to force this to be zero-copy.*/
+
+ /*XXX can fail badly on sendfile case. */
+ struct evbuffer_chain *chain, *previous;
+ size_t nread = 0;
+ int result;
+
+ EVBUFFER_LOCK2(src, dst);
+
+ chain = previous = src->first;
+
+ if (datlen == 0 || dst == src) {
+ result = 0;
+ goto done;
+ }
+
+ if (dst->freeze_end || src->freeze_start) {
+ result = -1;
+ goto done;
+ }
+
+ /* short-cut if there is no more data buffered */
+ if (datlen >= src->total_len) {
+ datlen = src->total_len;
+ evbuffer_add_buffer(dst, src);
+ result = (int)datlen; /*XXXX should return ev_ssize_t*/
+ goto done;
+ }
+
+ /* removes chains if possible */
+ while (chain->off <= datlen) {
+ /* We can't remove the last with data from src unless we
+ * remove all chains, in which case we would have done the if
+ * block above */
+ EVUTIL_ASSERT(chain != *src->last_with_datap);
+ nread += chain->off;
+ datlen -= chain->off;
+ previous = chain;
+ if (src->last_with_datap == &chain->next)
+ src->last_with_datap = &src->first;
+ chain = chain->next;
+ }
+
+ if (nread) {
+ /* we can remove the chain */
+ struct evbuffer_chain **chp;
+ chp = evbuffer_free_trailing_empty_chains(dst);
+
+ if (dst->first == NULL) {
+ dst->first = src->first;
+ } else {
+ *chp = src->first;
+ }
+ dst->last = previous;
+ previous->next = NULL;
+ src->first = chain;
+ advance_last_with_data(dst);
+
+ dst->total_len += nread;
+ dst->n_add_for_cb += nread;
+ }
+
+ /* we know that there is more data in the src buffer than
+ * we want to read, so we manually drain the chain */
+ evbuffer_add(dst, chain->buffer + chain->misalign, datlen);
+ chain->misalign += datlen;
+ chain->off -= datlen;
+ nread += datlen;
+
+ /* You might think we would want to increment dst->n_add_for_cb
+ * here too. But evbuffer_add above already took care of that.
+ */
+ src->total_len -= nread;
+ src->n_del_for_cb += nread;
+
+ if (nread) {
+ evbuffer_invoke_callbacks_(dst);
+ evbuffer_invoke_callbacks_(src);
+ }
+ result = (int)nread;/*XXXX should change return type */
+
+done:
+ EVBUFFER_UNLOCK2(src, dst);
+ return result;
+}
+
+unsigned char *
+evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size)
+{
+ struct evbuffer_chain *chain, *next, *tmp, *last_with_data;
+ unsigned char *buffer, *result = NULL;
+ ev_ssize_t remaining;
+ int removed_last_with_data = 0;
+ int removed_last_with_datap = 0;
+
+ EVBUFFER_LOCK(buf);
+
+ chain = buf->first;
+
+ if (size < 0)
+ size = buf->total_len;
+ /* if size > buf->total_len, we cannot guarantee to the user that she
+ * is going to have a long enough buffer afterwards; so we return
+ * NULL */
+ if (size == 0 || (size_t)size > buf->total_len)
+ goto done;
+
+ /* No need to pull up anything; the first size bytes are
+ * already here. */
+ if (chain->off >= (size_t)size) {
+ result = chain->buffer + chain->misalign;
+ goto done;
+ }
+
+ /* Make sure that none of the chains we need to copy from is pinned. */
+ remaining = size - chain->off;
+ EVUTIL_ASSERT(remaining >= 0);
+ for (tmp=chain->next; tmp; tmp=tmp->next) {
+ if (CHAIN_PINNED(tmp))
+ goto done;
+ if (tmp->off >= (size_t)remaining)
+ break;
+ remaining -= tmp->off;
+ }
+
+ if (CHAIN_PINNED(chain)) {
+ size_t old_off = chain->off;
+ if (CHAIN_SPACE_LEN(chain) < size - chain->off) {
+ /* not enough room at end of chunk. */
+ goto done;
+ }
+ buffer = CHAIN_SPACE_PTR(chain);
+ tmp = chain;
+ tmp->off = size;
+ size -= old_off;
+ chain = chain->next;
+ } else if (chain->buffer_len - chain->misalign >= (size_t)size) {
+ /* already have enough space in the first chain */
+ size_t old_off = chain->off;
+ buffer = chain->buffer + chain->misalign + chain->off;
+ tmp = chain;
+ tmp->off = size;
+ size -= old_off;
+ chain = chain->next;
+ } else {
+ if ((tmp = evbuffer_chain_new(size)) == NULL) {
+ event_warn("%s: out of memory", __func__);
+ goto done;
+ }
+ buffer = tmp->buffer;
+ tmp->off = size;
+ buf->first = tmp;
+ }
+
+ /* TODO(niels): deal with buffers that point to NULL like sendfile */
+
+ /* Copy and free every chunk that will be entirely pulled into tmp */
+ last_with_data = *buf->last_with_datap;
+ for (; chain != NULL && (size_t)size >= chain->off; chain = next) {
+ next = chain->next;
+
+ memcpy(buffer, chain->buffer + chain->misalign, chain->off);
+ size -= chain->off;
+ buffer += chain->off;
+ if (chain == last_with_data)
+ removed_last_with_data = 1;
+ if (&chain->next == buf->last_with_datap)
+ removed_last_with_datap = 1;
+
+ evbuffer_chain_free(chain);
+ }
+
+ if (chain != NULL) {
+ memcpy(buffer, chain->buffer + chain->misalign, size);
+ chain->misalign += size;
+ chain->off -= size;
+ } else {
+ buf->last = tmp;
+ }
+
+ tmp->next = chain;
+
+ if (removed_last_with_data) {
+ buf->last_with_datap = &buf->first;
+ } else if (removed_last_with_datap) {
+ if (buf->first->next && buf->first->next->off)
+ buf->last_with_datap = &buf->first->next;
+ else
+ buf->last_with_datap = &buf->first;
+ }
+
+ result = (tmp->buffer + tmp->misalign);
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/*
+ * Reads a line terminated by either '\r\n', '\n\r' or '\r' or '\n'.
+ * The returned buffer needs to be freed by the called.
+ */
+char *
+evbuffer_readline(struct evbuffer *buffer)
+{
+ return evbuffer_readln(buffer, NULL, EVBUFFER_EOL_ANY);
+}
+
+static inline ev_ssize_t
+evbuffer_strchr(struct evbuffer_ptr *it, const char chr)
+{
+ struct evbuffer_chain *chain = it->internal_.chain;
+ size_t i = it->internal_.pos_in_chain;
+ while (chain != NULL) {
+ char *buffer = (char *)chain->buffer + chain->misalign;
+ char *cp = memchr(buffer+i, chr, chain->off-i);
+ if (cp) {
+ it->internal_.chain = chain;
+ it->internal_.pos_in_chain = cp - buffer;
+ it->pos += (cp - buffer - i);
+ return it->pos;
+ }
+ it->pos += chain->off - i;
+ i = 0;
+ chain = chain->next;
+ }
+
+ return (-1);
+}
+
+static inline char *
+find_eol_char(char *s, size_t len)
+{
+#define CHUNK_SZ 128
+ /* Lots of benchmarking found this approach to be faster in practice
+ * than doing two memchrs over the whole buffer, doin a memchr on each
+ * char of the buffer, or trying to emulate memchr by hand. */
+ char *s_end, *cr, *lf;
+ s_end = s+len;
+ while (s < s_end) {
+ size_t chunk = (s + CHUNK_SZ < s_end) ? CHUNK_SZ : (s_end - s);
+ cr = memchr(s, '\r', chunk);
+ lf = memchr(s, '\n', chunk);
+ if (cr) {
+ if (lf && lf < cr)
+ return lf;
+ return cr;
+ } else if (lf) {
+ return lf;
+ }
+ s += CHUNK_SZ;
+ }
+
+ return NULL;
+#undef CHUNK_SZ
+}
+
+static ev_ssize_t
+evbuffer_find_eol_char(struct evbuffer_ptr *it)
+{
+ struct evbuffer_chain *chain = it->internal_.chain;
+ size_t i = it->internal_.pos_in_chain;
+ while (chain != NULL) {
+ char *buffer = (char *)chain->buffer + chain->misalign;
+ char *cp = find_eol_char(buffer+i, chain->off-i);
+ if (cp) {
+ it->internal_.chain = chain;
+ it->internal_.pos_in_chain = cp - buffer;
+ it->pos += (cp - buffer) - i;
+ return it->pos;
+ }
+ it->pos += chain->off - i;
+ i = 0;
+ chain = chain->next;
+ }
+
+ return (-1);
+}
+
+static inline int
+evbuffer_strspn(
+ struct evbuffer_ptr *ptr, const char *chrset)
+{
+ int count = 0;
+ struct evbuffer_chain *chain = ptr->internal_.chain;
+ size_t i = ptr->internal_.pos_in_chain;
+
+ if (!chain)
+ return 0;
+
+ while (1) {
+ char *buffer = (char *)chain->buffer + chain->misalign;
+ for (; i < chain->off; ++i) {
+ const char *p = chrset;
+ while (*p) {
+ if (buffer[i] == *p++)
+ goto next;
+ }
+ ptr->internal_.chain = chain;
+ ptr->internal_.pos_in_chain = i;
+ ptr->pos += count;
+ return count;
+ next:
+ ++count;
+ }
+ i = 0;
+
+ if (! chain->next) {
+ ptr->internal_.chain = chain;
+ ptr->internal_.pos_in_chain = i;
+ ptr->pos += count;
+ return count;
+ }
+
+ chain = chain->next;
+ }
+}
+
+
+static inline int
+evbuffer_getchr(struct evbuffer_ptr *it)
+{
+ struct evbuffer_chain *chain = it->internal_.chain;
+ size_t off = it->internal_.pos_in_chain;
+
+ if (chain == NULL)
+ return -1;
+
+ return (unsigned char)chain->buffer[chain->misalign + off];
+}
+
+struct evbuffer_ptr
+evbuffer_search_eol(struct evbuffer *buffer,
+ struct evbuffer_ptr *start, size_t *eol_len_out,
+ enum evbuffer_eol_style eol_style)
+{
+ struct evbuffer_ptr it, it2;
+ size_t extra_drain = 0;
+ int ok = 0;
+
+ /* Avoid locking in trivial edge cases */
+ if (start && start->internal_.chain == NULL) {
+ PTR_NOT_FOUND(&it);
+ if (eol_len_out)
+ *eol_len_out = extra_drain;
+ return it;
+ }
+
+ EVBUFFER_LOCK(buffer);
+
+ if (start) {
+ memcpy(&it, start, sizeof(it));
+ } else {
+ it.pos = 0;
+ it.internal_.chain = buffer->first;
+ it.internal_.pos_in_chain = 0;
+ }
+
+ /* the eol_style determines our first stop character and how many
+ * characters we are going to drain afterwards. */
+ switch (eol_style) {
+ case EVBUFFER_EOL_ANY:
+ if (evbuffer_find_eol_char(&it) < 0)
+ goto done;
+ memcpy(&it2, &it, sizeof(it));
+ extra_drain = evbuffer_strspn(&it2, "\r\n");
+ break;
+ case EVBUFFER_EOL_CRLF_STRICT: {
+ it = evbuffer_search(buffer, "\r\n", 2, &it);
+ if (it.pos < 0)
+ goto done;
+ extra_drain = 2;
+ break;
+ }
+ case EVBUFFER_EOL_CRLF: {
+ ev_ssize_t start_pos = it.pos;
+ /* Look for a LF ... */
+ if (evbuffer_strchr(&it, '\n') < 0)
+ goto done;
+ extra_drain = 1;
+ /* ... optionally preceeded by a CR. */
+ if (it.pos == start_pos)
+ break; /* If the first character is \n, don't back up */
+ /* This potentially does an extra linear walk over the first
+ * few chains. Probably, that's not too expensive unless you
+ * have a really pathological setup. */
+ memcpy(&it2, &it, sizeof(it));
+ if (evbuffer_ptr_subtract(buffer, &it2, 1)<0)
+ break;
+ if (evbuffer_getchr(&it2) == '\r') {
+ memcpy(&it, &it2, sizeof(it));
+ extra_drain = 2;
+ }
+ break;
+ }
+ case EVBUFFER_EOL_LF:
+ if (evbuffer_strchr(&it, '\n') < 0)
+ goto done;
+ extra_drain = 1;
+ break;
+ case EVBUFFER_EOL_NUL:
+ if (evbuffer_strchr(&it, '\0') < 0)
+ goto done;
+ extra_drain = 1;
+ break;
+ default:
+ goto done;
+ }
+
+ ok = 1;
+done:
+ EVBUFFER_UNLOCK(buffer);
+
+ if (!ok)
+ PTR_NOT_FOUND(&it);
+ if (eol_len_out)
+ *eol_len_out = extra_drain;
+
+ return it;
+}
+
+char *
+evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
+ enum evbuffer_eol_style eol_style)
+{
+ struct evbuffer_ptr it;
+ char *line;
+ size_t n_to_copy=0, extra_drain=0;
+ char *result = NULL;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (buffer->freeze_start) {
+ goto done;
+ }
+
+ it = evbuffer_search_eol(buffer, NULL, &extra_drain, eol_style);
+ if (it.pos < 0)
+ goto done;
+ n_to_copy = it.pos;
+
+ if ((line = mm_malloc(n_to_copy+1)) == NULL) {
+ event_warn("%s: out of memory", __func__);
+ goto done;
+ }
+
+ evbuffer_remove(buffer, line, n_to_copy);
+ line[n_to_copy] = '\0';
+
+ evbuffer_drain(buffer, extra_drain);
+ result = line;
+done:
+ EVBUFFER_UNLOCK(buffer);
+
+ if (n_read_out)
+ *n_read_out = result ? n_to_copy : 0;
+
+ return result;
+}
+
+#define EVBUFFER_CHAIN_MAX_AUTO_SIZE 4096
+
+/* Adds data to an event buffer */
+
+int
+evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
+{
+ struct evbuffer_chain *chain, *tmp;
+ const unsigned char *data = data_in;
+ size_t remain, to_alloc;
+ int result = -1;
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end) {
+ goto done;
+ }
+
+ chain = buf->last;
+
+ /* If there are no chains allocated for this buffer, allocate one
+ * big enough to hold all the data. */
+ if (chain == NULL) {
+ chain = evbuffer_chain_new(datlen);
+ if (!chain)
+ goto done;
+ evbuffer_chain_insert(buf, chain);
+ }
+
+ if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
+ remain = (size_t)(chain->buffer_len - chain->misalign - chain->off);
+ if (remain >= datlen) {
+ /* there's enough space to hold all the data in the
+ * current last chain */
+ memcpy(chain->buffer + chain->misalign + chain->off,
+ data, datlen);
+ chain->off += datlen;
+ buf->total_len += datlen;
+ buf->n_add_for_cb += datlen;
+ goto out;
+ } else if (!CHAIN_PINNED(chain) &&
+ evbuffer_chain_should_realign(chain, datlen)) {
+ /* we can fit the data into the misalignment */
+ evbuffer_chain_align(chain);
+
+ memcpy(chain->buffer + chain->off, data, datlen);
+ chain->off += datlen;
+ buf->total_len += datlen;
+ buf->n_add_for_cb += datlen;
+ goto out;
+ }
+ } else {
+ /* we cannot write any data to the last chain */
+ remain = 0;
+ }
+
+ /* we need to add another chain */
+ to_alloc = chain->buffer_len;
+ if (to_alloc <= EVBUFFER_CHAIN_MAX_AUTO_SIZE/2)
+ to_alloc <<= 1;
+ if (datlen > to_alloc)
+ to_alloc = datlen;
+ tmp = evbuffer_chain_new(to_alloc);
+ if (tmp == NULL)
+ goto done;
+
+ if (remain) {
+ memcpy(chain->buffer + chain->misalign + chain->off,
+ data, remain);
+ chain->off += remain;
+ buf->total_len += remain;
+ buf->n_add_for_cb += remain;
+ }
+
+ data += remain;
+ datlen -= remain;
+
+ memcpy(tmp->buffer, data, datlen);
+ tmp->off = datlen;
+ evbuffer_chain_insert(buf, tmp);
+ buf->n_add_for_cb += datlen;
+
+out:
+ evbuffer_invoke_callbacks_(buf);
+ result = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+int
+evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen)
+{
+ struct evbuffer_chain *chain, *tmp;
+ int result = -1;
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_start) {
+ goto done;
+ }
+
+ chain = buf->first;
+
+ if (chain == NULL) {
+ chain = evbuffer_chain_new(datlen);
+ if (!chain)
+ goto done;
+ evbuffer_chain_insert(buf, chain);
+ }
+
+ /* we cannot touch immutable buffers */
+ if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) {
+ /* If this chain is empty, we can treat it as
+ * 'empty at the beginning' rather than 'empty at the end' */
+ if (chain->off == 0)
+ chain->misalign = chain->buffer_len;
+
+ if ((size_t)chain->misalign >= datlen) {
+ /* we have enough space to fit everything */
+ memcpy(chain->buffer + chain->misalign - datlen,
+ data, datlen);
+ chain->off += datlen;
+ chain->misalign -= datlen;
+ buf->total_len += datlen;
+ buf->n_add_for_cb += datlen;
+ goto out;
+ } else if (chain->misalign) {
+ /* we can only fit some of the data. */
+ memcpy(chain->buffer,
+ (char*)data + datlen - chain->misalign,
+ (size_t)chain->misalign);
+ chain->off += (size_t)chain->misalign;
+ buf->total_len += (size_t)chain->misalign;
+ buf->n_add_for_cb += (size_t)chain->misalign;
+ datlen -= (size_t)chain->misalign;
+ chain->misalign = 0;
+ }
+ }
+
+ /* we need to add another chain */
+ if ((tmp = evbuffer_chain_new(datlen)) == NULL)
+ goto done;
+ buf->first = tmp;
+ if (buf->last_with_datap == &buf->first)
+ buf->last_with_datap = &tmp->next;
+
+ tmp->next = chain;
+
+ tmp->off = datlen;
+ tmp->misalign = tmp->buffer_len - datlen;
+
+ memcpy(tmp->buffer + tmp->misalign, data, datlen);
+ buf->total_len += datlen;
+ buf->n_add_for_cb += (size_t)chain->misalign;
+
+out:
+ evbuffer_invoke_callbacks_(buf);
+ result = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+/** Helper: realigns the memory in chain->buffer so that misalign is 0. */
+static void
+evbuffer_chain_align(struct evbuffer_chain *chain)
+{
+ EVUTIL_ASSERT(!(chain->flags & EVBUFFER_IMMUTABLE));
+ EVUTIL_ASSERT(!(chain->flags & EVBUFFER_MEM_PINNED_ANY));
+ memmove(chain->buffer, chain->buffer + chain->misalign, chain->off);
+ chain->misalign = 0;
+}
+
+#define MAX_TO_COPY_IN_EXPAND 4096
+#define MAX_TO_REALIGN_IN_EXPAND 2048
+
+/** Helper: return true iff we should realign chain to fit datalen bytes of
+ data in it. */
+static int
+evbuffer_chain_should_realign(struct evbuffer_chain *chain,
+ size_t datlen)
+{
+ return chain->buffer_len - chain->off >= datlen &&
+ (chain->off < chain->buffer_len / 2) &&
+ (chain->off <= MAX_TO_REALIGN_IN_EXPAND);
+}
+
+/* Expands the available space in the event buffer to at least datlen, all in
+ * a single chunk. Return that chunk. */
+static struct evbuffer_chain *
+evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen)
+{
+ struct evbuffer_chain *chain, **chainp;
+ struct evbuffer_chain *result = NULL;
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ chainp = buf->last_with_datap;
+
+ /* XXX If *chainp is no longer writeable, but has enough space in its
+ * misalign, this might be a bad idea: we could still use *chainp, not
+ * (*chainp)->next. */
+ if (*chainp && CHAIN_SPACE_LEN(*chainp) == 0)
+ chainp = &(*chainp)->next;
+
+ /* 'chain' now points to the first chain with writable space (if any)
+ * We will either use it, realign it, replace it, or resize it. */
+ chain = *chainp;
+
+ if (chain == NULL ||
+ (chain->flags & (EVBUFFER_IMMUTABLE|EVBUFFER_MEM_PINNED_ANY))) {
+ /* We can't use the last_with_data chain at all. Just add a
+ * new one that's big enough. */
+ goto insert_new;
+ }
+
+ /* If we can fit all the data, then we don't have to do anything */
+ if (CHAIN_SPACE_LEN(chain) >= datlen) {
+ result = chain;
+ goto ok;
+ }
+
+ /* If the chain is completely empty, just replace it by adding a new
+ * empty chain. */
+ if (chain->off == 0) {
+ goto insert_new;
+ }
+
+ /* If the misalignment plus the remaining space fulfills our data
+ * needs, we could just force an alignment to happen. Afterwards, we
+ * have enough space. But only do this if we're saving a lot of space
+ * and not moving too much data. Otherwise the space savings are
+ * probably offset by the time lost in copying.
+ */
+ if (evbuffer_chain_should_realign(chain, datlen)) {
+ evbuffer_chain_align(chain);
+ result = chain;
+ goto ok;
+ }
+
+ /* At this point, we can either resize the last chunk with space in
+ * it, use the next chunk after it, or If we add a new chunk, we waste
+ * CHAIN_SPACE_LEN(chain) bytes in the former last chunk. If we
+ * resize, we have to copy chain->off bytes.
+ */
+
+ /* Would expanding this chunk be affordable and worthwhile? */
+ if (CHAIN_SPACE_LEN(chain) < chain->buffer_len / 8 ||
+ chain->off > MAX_TO_COPY_IN_EXPAND) {
+ /* It's not worth resizing this chain. Can the next one be
+ * used? */
+ if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) {
+ /* Yes, we can just use the next chain (which should
+ * be empty. */
+ result = chain->next;
+ goto ok;
+ } else {
+ /* No; append a new chain (which will free all
+ * terminal empty chains.) */
+ goto insert_new;
+ }
+ } else {
+ /* Okay, we're going to try to resize this chain: Not doing so
+ * would waste at least 1/8 of its current allocation, and we
+ * can do so without having to copy more than
+ * MAX_TO_COPY_IN_EXPAND bytes. */
+ /* figure out how much space we need */
+ size_t length = chain->off + datlen;
+ struct evbuffer_chain *tmp = evbuffer_chain_new(length);
+ if (tmp == NULL)
+ goto err;
+
+ /* copy the data over that we had so far */
+ tmp->off = chain->off;
+ memcpy(tmp->buffer, chain->buffer + chain->misalign,
+ chain->off);
+ /* fix up the list */
+ EVUTIL_ASSERT(*chainp == chain);
+ result = *chainp = tmp;
+
+ if (buf->last == chain)
+ buf->last = tmp;
+
+ tmp->next = chain->next;
+ evbuffer_chain_free(chain);
+ goto ok;
+ }
+
+insert_new:
+ result = evbuffer_chain_insert_new(buf, datlen);
+ if (!result)
+ goto err;
+ok:
+ EVUTIL_ASSERT(result);
+ EVUTIL_ASSERT(CHAIN_SPACE_LEN(result) >= datlen);
+err:
+ return result;
+}
+
+/* Make sure that datlen bytes are available for writing in the last n
+ * chains. Never copies or moves data. */
+int
+evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n)
+{
+ struct evbuffer_chain *chain = buf->last, *tmp, *next;
+ size_t avail;
+ int used;
+
+ ASSERT_EVBUFFER_LOCKED(buf);
+ EVUTIL_ASSERT(n >= 2);
+
+ if (chain == NULL || (chain->flags & EVBUFFER_IMMUTABLE)) {
+ /* There is no last chunk, or we can't touch the last chunk.
+ * Just add a new chunk. */
+ chain = evbuffer_chain_new(datlen);
+ if (chain == NULL)
+ return (-1);
+
+ evbuffer_chain_insert(buf, chain);
+ return (0);
+ }
+
+ used = 0; /* number of chains we're using space in. */
+ avail = 0; /* how much space they have. */
+ /* How many bytes can we stick at the end of buffer as it is? Iterate
+ * over the chains at the end of the buffer, tring to see how much
+ * space we have in the first n. */
+ for (chain = *buf->last_with_datap; chain; chain = chain->next) {
+ if (chain->off) {
+ size_t space = (size_t) CHAIN_SPACE_LEN(chain);
+ EVUTIL_ASSERT(chain == *buf->last_with_datap);
+ if (space) {
+ avail += space;
+ ++used;
+ }
+ } else {
+ /* No data in chain; realign it. */
+ chain->misalign = 0;
+ avail += chain->buffer_len;
+ ++used;
+ }
+ if (avail >= datlen) {
+ /* There is already enough space. Just return */
+ return (0);
+ }
+ if (used == n)
+ break;
+ }
+
+ /* There wasn't enough space in the first n chains with space in
+ * them. Either add a new chain with enough space, or replace all
+ * empty chains with one that has enough space, depending on n. */
+ if (used < n) {
+ /* The loop ran off the end of the chains before it hit n
+ * chains; we can add another. */
+ EVUTIL_ASSERT(chain == NULL);
+
+ tmp = evbuffer_chain_new(datlen - avail);
+ if (tmp == NULL)
+ return (-1);
+
+ buf->last->next = tmp;
+ buf->last = tmp;
+ /* (we would only set last_with_data if we added the first
+ * chain. But if the buffer had no chains, we would have
+ * just allocated a new chain earlier) */
+ return (0);
+ } else {
+ /* Nuke _all_ the empty chains. */
+ int rmv_all = 0; /* True iff we removed last_with_data. */
+ chain = *buf->last_with_datap;
+ if (!chain->off) {
+ EVUTIL_ASSERT(chain == buf->first);
+ rmv_all = 1;
+ avail = 0;
+ } else {
+ avail = (size_t) CHAIN_SPACE_LEN(chain);
+ chain = chain->next;
+ }
+
+
+ for (; chain; chain = next) {
+ next = chain->next;
+ EVUTIL_ASSERT(chain->off == 0);
+ evbuffer_chain_free(chain);
+ }
+ tmp = evbuffer_chain_new(datlen - avail);
+ if (tmp == NULL) {
+ if (rmv_all) {
+ ZERO_CHAIN(buf);
+ } else {
+ buf->last = *buf->last_with_datap;
+ (*buf->last_with_datap)->next = NULL;
+ }
+ return (-1);
+ }
+
+ if (rmv_all) {
+ buf->first = buf->last = tmp;
+ buf->last_with_datap = &buf->first;
+ } else {
+ (*buf->last_with_datap)->next = tmp;
+ buf->last = tmp;
+ }
+ return (0);
+ }
+}
+
+int
+evbuffer_expand(struct evbuffer *buf, size_t datlen)
+{
+ struct evbuffer_chain *chain;
+
+ EVBUFFER_LOCK(buf);
+ chain = evbuffer_expand_singlechain(buf, datlen);
+ EVBUFFER_UNLOCK(buf);
+ return chain ? 0 : -1;
+}
+
+/*
+ * Reads data from a file descriptor into a buffer.
+ */
+
+#if defined(EVENT__HAVE_SYS_UIO_H) || defined(_WIN32)
+#define USE_IOVEC_IMPL
+#endif
+
+#ifdef USE_IOVEC_IMPL
+
+#ifdef EVENT__HAVE_SYS_UIO_H
+/* number of iovec we use for writev, fragmentation is going to determine
+ * how much we end up writing */
+
+#define DEFAULT_WRITE_IOVEC 128
+
+#if defined(UIO_MAXIOV) && UIO_MAXIOV < DEFAULT_WRITE_IOVEC
+#define NUM_WRITE_IOVEC UIO_MAXIOV
+#elif defined(IOV_MAX) && IOV_MAX < DEFAULT_WRITE_IOVEC
+#define NUM_WRITE_IOVEC IOV_MAX
+#else
+#define NUM_WRITE_IOVEC DEFAULT_WRITE_IOVEC
+#endif
+
+#define IOV_TYPE struct iovec
+#define IOV_PTR_FIELD iov_base
+#define IOV_LEN_FIELD iov_len
+#define IOV_LEN_TYPE size_t
+#else
+#define NUM_WRITE_IOVEC 16
+#define IOV_TYPE WSABUF
+#define IOV_PTR_FIELD buf
+#define IOV_LEN_FIELD len
+#define IOV_LEN_TYPE unsigned long
+#endif
+#endif
+#define NUM_READ_IOVEC 4
+
+#define EVBUFFER_MAX_READ 4096
+
+/** Helper function to figure out which space to use for reading data into
+ an evbuffer. Internal use only.
+
+ @param buf The buffer to read into
+ @param howmuch How much we want to read.
+ @param vecs An array of two or more iovecs or WSABUFs.
+ @param n_vecs_avail The length of vecs
+ @param chainp A pointer to a variable to hold the first chain we're
+ reading into.
+ @param exact Boolean: if true, we do not provide more than 'howmuch'
+ space in the vectors, even if more space is available.
+ @return The number of buffers we're using.
+ */
+int
+evbuffer_read_setup_vecs_(struct evbuffer *buf, ev_ssize_t howmuch,
+ struct evbuffer_iovec *vecs, int n_vecs_avail,
+ struct evbuffer_chain ***chainp, int exact)
+{
+ struct evbuffer_chain *chain;
+ struct evbuffer_chain **firstchainp;
+ size_t so_far;
+ int i;
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ if (howmuch < 0)
+ return -1;
+
+ so_far = 0;
+ /* Let firstchain be the first chain with any space on it */
+ firstchainp = buf->last_with_datap;
+ if (CHAIN_SPACE_LEN(*firstchainp) == 0) {
+ firstchainp = &(*firstchainp)->next;
+ }
+
+ chain = *firstchainp;
+ for (i = 0; i < n_vecs_avail && so_far < (size_t)howmuch; ++i) {
+ size_t avail = (size_t) CHAIN_SPACE_LEN(chain);
+ if (avail > (howmuch - so_far) && exact)
+ avail = howmuch - so_far;
+ vecs[i].iov_base = CHAIN_SPACE_PTR(chain);
+ vecs[i].iov_len = avail;
+ so_far += avail;
+ chain = chain->next;
+ }
+
+ *chainp = firstchainp;
+ return i;
+}
+
+static int
+get_n_bytes_readable_on_socket(evutil_socket_t fd)
+{
+#if defined(FIONREAD) && defined(_WIN32)
+ unsigned long lng = EVBUFFER_MAX_READ;
+ if (ioctlsocket(fd, FIONREAD, &lng) < 0)
+ return -1;
+ return (int)lng;
+#elif defined(FIONREAD)
+ int n = EVBUFFER_MAX_READ;
+ if (ioctl(fd, FIONREAD, &n) < 0)
+ return -1;
+ return n;
+#else
+ return EVBUFFER_MAX_READ;
+#endif
+}
+
+/* TODO(niels): should this function return ev_ssize_t and take ev_ssize_t
+ * as howmuch? */
+int
+evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch)
+{
+ struct evbuffer_chain **chainp;
+ int n;
+ int result;
+
+#ifdef USE_IOVEC_IMPL
+ int nvecs, i, remaining;
+#else
+ struct evbuffer_chain *chain;
+ unsigned char *p;
+#endif
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end) {
+ result = -1;
+ goto done;
+ }
+
+ n = get_n_bytes_readable_on_socket(fd);
+ if (n <= 0 || n > EVBUFFER_MAX_READ)
+ n = EVBUFFER_MAX_READ;
+ if (howmuch < 0 || howmuch > n)
+ howmuch = n;
+
+#ifdef USE_IOVEC_IMPL
+ /* Since we can use iovecs, we're willing to use the last
+ * NUM_READ_IOVEC chains. */
+ if (evbuffer_expand_fast_(buf, howmuch, NUM_READ_IOVEC) == -1) {
+ result = -1;
+ goto done;
+ } else {
+ IOV_TYPE vecs[NUM_READ_IOVEC];
+#ifdef EVBUFFER_IOVEC_IS_NATIVE_
+ nvecs = evbuffer_read_setup_vecs_(buf, howmuch, vecs,
+ NUM_READ_IOVEC, &chainp, 1);
+#else
+ /* We aren't using the native struct iovec. Therefore,
+ we are on win32. */
+ struct evbuffer_iovec ev_vecs[NUM_READ_IOVEC];
+ nvecs = evbuffer_read_setup_vecs_(buf, howmuch, ev_vecs, 2,
+ &chainp, 1);
+
+ for (i=0; i < nvecs; ++i)
+ WSABUF_FROM_EVBUFFER_IOV(&vecs[i], &ev_vecs[i]);
+#endif
+
+#ifdef _WIN32
+ {
+ DWORD bytesRead;
+ DWORD flags=0;
+ if (WSARecv(fd, vecs, nvecs, &bytesRead, &flags, NULL, NULL)) {
+ /* The read failed. It might be a close,
+ * or it might be an error. */
+ if (WSAGetLastError() == WSAECONNABORTED)
+ n = 0;
+ else
+ n = -1;
+ } else
+ n = bytesRead;
+ }
+#else
+ n = readv(fd, vecs, nvecs);
+#endif
+ }
+
+#else /*!USE_IOVEC_IMPL*/
+ /* If we don't have FIONREAD, we might waste some space here */
+ /* XXX we _will_ waste some space here if there is any space left
+ * over on buf->last. */
+ if ((chain = evbuffer_expand_singlechain(buf, howmuch)) == NULL) {
+ result = -1;
+ goto done;
+ }
+
+ /* We can append new data at this point */
+ p = chain->buffer + chain->misalign + chain->off;
+
+#ifndef _WIN32
+ n = read(fd, p, howmuch);
+#else
+ n = recv(fd, p, howmuch, 0);
+#endif
+#endif /* USE_IOVEC_IMPL */
+
+ if (n == -1) {
+ result = -1;
+ goto done;
+ }
+ if (n == 0) {
+ result = 0;
+ goto done;
+ }
+
+#ifdef USE_IOVEC_IMPL
+ remaining = n;
+ for (i=0; i < nvecs; ++i) {
+ ev_ssize_t space = (ev_ssize_t) CHAIN_SPACE_LEN(*chainp);
+ if (space < remaining) {
+ (*chainp)->off += space;
+ remaining -= (int)space;
+ } else {
+ (*chainp)->off += remaining;
+ buf->last_with_datap = chainp;
+ break;
+ }
+ chainp = &(*chainp)->next;
+ }
+#else
+ chain->off += n;
+ advance_last_with_data(buf);
+#endif
+ buf->total_len += n;
+ buf->n_add_for_cb += n;
+
+ /* Tell someone about changes in this buffer */
+ evbuffer_invoke_callbacks_(buf);
+ result = n;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+#ifdef USE_IOVEC_IMPL
+static inline int
+evbuffer_write_iovec(struct evbuffer *buffer, evutil_socket_t fd,
+ ev_ssize_t howmuch)
+{
+ IOV_TYPE iov[NUM_WRITE_IOVEC];
+ struct evbuffer_chain *chain = buffer->first;
+ int n, i = 0;
+
+ if (howmuch < 0)
+ return -1;
+
+ ASSERT_EVBUFFER_LOCKED(buffer);
+ /* XXX make this top out at some maximal data length? if the
+ * buffer has (say) 1MB in it, split over 128 chains, there's
+ * no way it all gets written in one go. */
+ while (chain != NULL && i < NUM_WRITE_IOVEC && howmuch) {
+#ifdef USE_SENDFILE
+ /* we cannot write the file info via writev */
+ if (chain->flags & EVBUFFER_SENDFILE)
+ break;
+#endif
+ iov[i].IOV_PTR_FIELD = (void *) (chain->buffer + chain->misalign);
+ if ((size_t)howmuch >= chain->off) {
+ /* XXXcould be problematic when windows supports mmap*/
+ iov[i++].IOV_LEN_FIELD = (IOV_LEN_TYPE)chain->off;
+ howmuch -= chain->off;
+ } else {
+ /* XXXcould be problematic when windows supports mmap*/
+ iov[i++].IOV_LEN_FIELD = (IOV_LEN_TYPE)howmuch;
+ break;
+ }
+ chain = chain->next;
+ }
+ if (! i)
+ return 0;
+
+#ifdef _WIN32
+ {
+ DWORD bytesSent;
+ if (WSASend(fd, iov, i, &bytesSent, 0, NULL, NULL))
+ n = -1;
+ else
+ n = bytesSent;
+ }
+#else
+ n = writev(fd, iov, i);
+#endif
+ return (n);
+}
+#endif
+
+#ifdef USE_SENDFILE
+static inline int
+evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t dest_fd,
+ ev_ssize_t howmuch)
+{
+ struct evbuffer_chain *chain = buffer->first;
+ struct evbuffer_chain_file_segment *info =
+ EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_file_segment,
+ chain);
+ const int source_fd = info->segment->fd;
+#if defined(SENDFILE_IS_MACOSX) || defined(SENDFILE_IS_FREEBSD)
+ int res;
+ ev_off_t len = chain->off;
+#elif defined(SENDFILE_IS_LINUX) || defined(SENDFILE_IS_SOLARIS)
+ ev_ssize_t res;
+ ev_off_t offset = chain->misalign;
+#endif
+
+ ASSERT_EVBUFFER_LOCKED(buffer);
+
+#if defined(SENDFILE_IS_MACOSX)
+ res = sendfile(source_fd, dest_fd, chain->misalign, &len, NULL, 0);
+ if (res == -1 && !EVUTIL_ERR_RW_RETRIABLE(errno))
+ return (-1);
+
+ return (len);
+#elif defined(SENDFILE_IS_FREEBSD)
+ res = sendfile(source_fd, dest_fd, chain->misalign, chain->off, NULL, &len, 0);
+ if (res == -1 && !EVUTIL_ERR_RW_RETRIABLE(errno))
+ return (-1);
+
+ return (len);
+#elif defined(SENDFILE_IS_LINUX)
+ /* TODO(niels): implement splice */
+ res = sendfile(dest_fd, source_fd, &offset, chain->off);
+ if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
+ /* if this is EAGAIN or EINTR return 0; otherwise, -1 */
+ return (0);
+ }
+ return (res);
+#elif defined(SENDFILE_IS_SOLARIS)
+ {
+ const off_t offset_orig = offset;
+ res = sendfile(dest_fd, source_fd, &offset, chain->off);
+ if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
+ if (offset - offset_orig)
+ return offset - offset_orig;
+ /* if this is EAGAIN or EINTR and no bytes were
+ * written, return 0 */
+ return (0);
+ }
+ return (res);
+ }
+#endif
+}
+#endif
+
+int
+evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
+ ev_ssize_t howmuch)
+{
+ int n = -1;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (buffer->freeze_start) {
+ goto done;
+ }
+
+ if (howmuch < 0 || (size_t)howmuch > buffer->total_len)
+ howmuch = buffer->total_len;
+
+ if (howmuch > 0) {
+#ifdef USE_SENDFILE
+ struct evbuffer_chain *chain = buffer->first;
+ if (chain != NULL && (chain->flags & EVBUFFER_SENDFILE))
+ n = evbuffer_write_sendfile(buffer, fd, howmuch);
+ else {
+#endif
+#ifdef USE_IOVEC_IMPL
+ n = evbuffer_write_iovec(buffer, fd, howmuch);
+#elif defined(_WIN32)
+ /* XXX(nickm) Don't disable this code until we know if
+ * the WSARecv code above works. */
+ void *p = evbuffer_pullup(buffer, howmuch);
+ n = send(fd, p, howmuch, 0);
+#else
+ void *p = evbuffer_pullup(buffer, howmuch);
+ n = write(fd, p, howmuch);
+#endif
+#ifdef USE_SENDFILE
+ }
+#endif
+ }
+
+ if (n > 0)
+ evbuffer_drain(buffer, n);
+
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return (n);
+}
+
+int
+evbuffer_write(struct evbuffer *buffer, evutil_socket_t fd)
+{
+ return evbuffer_write_atmost(buffer, fd, -1);
+}
+
+unsigned char *
+evbuffer_find(struct evbuffer *buffer, const unsigned char *what, size_t len)
+{
+ unsigned char *search;
+ struct evbuffer_ptr ptr;
+
+ EVBUFFER_LOCK(buffer);
+
+ ptr = evbuffer_search(buffer, (const char *)what, len, NULL);
+ if (ptr.pos < 0) {
+ search = NULL;
+ } else {
+ search = evbuffer_pullup(buffer, ptr.pos + len);
+ if (search)
+ search += ptr.pos;
+ }
+ EVBUFFER_UNLOCK(buffer);
+ return search;
+}
+
+/* Subract <b>howfar</b> from the position of <b>pos</b> within
+ * <b>buf</b>. Returns 0 on success, -1 on failure.
+ *
+ * This isn't exposed yet, because of potential inefficiency issues.
+ * Maybe it should be. */
+static int
+evbuffer_ptr_subtract(struct evbuffer *buf, struct evbuffer_ptr *pos,
+ size_t howfar)
+{
+ if (howfar > (size_t)pos->pos)
+ return -1;
+ if (pos->internal_.chain && howfar <= pos->internal_.pos_in_chain) {
+ pos->internal_.pos_in_chain -= howfar;
+ pos->pos -= howfar;
+ return 0;
+ } else {
+ const size_t newpos = pos->pos - howfar;
+ /* Here's the inefficient part: it walks over the
+ * chains until we hit newpos. */
+ return evbuffer_ptr_set(buf, pos, newpos, EVBUFFER_PTR_SET);
+ }
+}
+
+int
+evbuffer_ptr_set(struct evbuffer *buf, struct evbuffer_ptr *pos,
+ size_t position, enum evbuffer_ptr_how how)
+{
+ size_t left = position;
+ struct evbuffer_chain *chain = NULL;
+ int result = 0;
+
+ EVBUFFER_LOCK(buf);
+
+ switch (how) {
+ case EVBUFFER_PTR_SET:
+ chain = buf->first;
+ pos->pos = position;
+ position = 0;
+ break;
+ case EVBUFFER_PTR_ADD:
+ /* this avoids iterating over all previous chains if
+ we just want to advance the position */
+ chain = pos->internal_.chain;
+ pos->pos += position;
+ position = pos->internal_.pos_in_chain;
+ break;
+ }
+
+ while (chain && position + left >= chain->off) {
+ left -= chain->off - position;
+ chain = chain->next;
+ position = 0;
+ }
+ if (chain) {
+ pos->internal_.chain = chain;
+ pos->internal_.pos_in_chain = position + left;
+ } else if (left == 0) {
+ /* The first byte in the (nonexistent) chain after the last chain */
+ pos->internal_.chain = NULL;
+ pos->internal_.pos_in_chain = 0;
+ } else {
+ PTR_NOT_FOUND(pos);
+ result = -1;
+ }
+
+ EVBUFFER_UNLOCK(buf);
+
+ return result;
+}
+
+/**
+ Compare the bytes in buf at position pos to the len bytes in mem. Return
+ less than 0, 0, or greater than 0 as memcmp.
+ */
+static int
+evbuffer_ptr_memcmp(const struct evbuffer *buf, const struct evbuffer_ptr *pos,
+ const char *mem, size_t len)
+{
+ struct evbuffer_chain *chain;
+ size_t position;
+ int r;
+
+ ASSERT_EVBUFFER_LOCKED(buf);
+
+ if (pos->pos + len > buf->total_len)
+ return -1;
+
+ chain = pos->internal_.chain;
+ position = pos->internal_.pos_in_chain;
+ while (len && chain) {
+ size_t n_comparable;
+ if (len + position > chain->off)
+ n_comparable = chain->off - position;
+ else
+ n_comparable = len;
+ r = memcmp(chain->buffer + chain->misalign + position, mem,
+ n_comparable);
+ if (r)
+ return r;
+ mem += n_comparable;
+ len -= n_comparable;
+ position = 0;
+ chain = chain->next;
+ }
+
+ return 0;
+}
+
+struct evbuffer_ptr
+evbuffer_search(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start)
+{
+ return evbuffer_search_range(buffer, what, len, start, NULL);
+}
+
+struct evbuffer_ptr
+evbuffer_search_range(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start, const struct evbuffer_ptr *end)
+{
+ struct evbuffer_ptr pos;
+ struct evbuffer_chain *chain, *last_chain = NULL;
+ const unsigned char *p;
+ char first;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (start) {
+ memcpy(&pos, start, sizeof(pos));
+ chain = pos.internal_.chain;
+ } else {
+ pos.pos = 0;
+ chain = pos.internal_.chain = buffer->first;
+ pos.internal_.pos_in_chain = 0;
+ }
+
+ if (end)
+ last_chain = end->internal_.chain;
+
+ if (!len || len > EV_SSIZE_MAX)
+ goto done;
+
+ first = what[0];
+
+ while (chain) {
+ const unsigned char *start_at =
+ chain->buffer + chain->misalign +
+ pos.internal_.pos_in_chain;
+ p = memchr(start_at, first,
+ chain->off - pos.internal_.pos_in_chain);
+ if (p) {
+ pos.pos += p - start_at;
+ pos.internal_.pos_in_chain += p - start_at;
+ if (!evbuffer_ptr_memcmp(buffer, &pos, what, len)) {
+ if (end && pos.pos + (ev_ssize_t)len > end->pos)
+ goto not_found;
+ else
+ goto done;
+ }
+ ++pos.pos;
+ ++pos.internal_.pos_in_chain;
+ if (pos.internal_.pos_in_chain == chain->off) {
+ chain = pos.internal_.chain = chain->next;
+ pos.internal_.pos_in_chain = 0;
+ }
+ } else {
+ if (chain == last_chain)
+ goto not_found;
+ pos.pos += chain->off - pos.internal_.pos_in_chain;
+ chain = pos.internal_.chain = chain->next;
+ pos.internal_.pos_in_chain = 0;
+ }
+ }
+
+not_found:
+ PTR_NOT_FOUND(&pos);
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return pos;
+}
+
+int
+evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len,
+ struct evbuffer_ptr *start_at,
+ struct evbuffer_iovec *vec, int n_vec)
+{
+ struct evbuffer_chain *chain;
+ int idx = 0;
+ ev_ssize_t len_so_far = 0;
+
+ /* Avoid locking in trivial edge cases */
+ if (start_at && start_at->internal_.chain == NULL)
+ return 0;
+
+ EVBUFFER_LOCK(buffer);
+
+ if (start_at) {
+ chain = start_at->internal_.chain;
+ len_so_far = chain->off
+ - start_at->internal_.pos_in_chain;
+ idx = 1;
+ if (n_vec > 0) {
+ vec[0].iov_base = chain->buffer + chain->misalign
+ + start_at->internal_.pos_in_chain;
+ vec[0].iov_len = len_so_far;
+ }
+ chain = chain->next;
+ } else {
+ chain = buffer->first;
+ }
+
+ if (n_vec == 0 && len < 0) {
+ /* If no vectors are provided and they asked for "everything",
+ * pretend they asked for the actual available amount. */
+ len = buffer->total_len - len_so_far;
+ }
+
+ while (chain) {
+ if (len >= 0 && len_so_far >= len)
+ break;
+ if (idx<n_vec) {
+ vec[idx].iov_base = chain->buffer + chain->misalign;
+ vec[idx].iov_len = chain->off;
+ } else if (len<0) {
+ break;
+ }
+ ++idx;
+ len_so_far += chain->off;
+ chain = chain->next;
+ }
+
+ EVBUFFER_UNLOCK(buffer);
+
+ return idx;
+}
+
+
+int
+evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
+{
+ char *buffer;
+ size_t space;
+ int sz, result = -1;
+ va_list aq;
+ struct evbuffer_chain *chain;
+
+
+ EVBUFFER_LOCK(buf);
+
+ if (buf->freeze_end) {
+ goto done;
+ }
+
+ /* make sure that at least some space is available */
+ if ((chain = evbuffer_expand_singlechain(buf, 64)) == NULL)
+ goto done;
+
+ for (;;) {
+#if 0
+ size_t used = chain->misalign + chain->off;
+ buffer = (char *)chain->buffer + chain->misalign + chain->off;
+ EVUTIL_ASSERT(chain->buffer_len >= used);
+ space = chain->buffer_len - used;
+#endif
+ buffer = (char*) CHAIN_SPACE_PTR(chain);
+ space = (size_t) CHAIN_SPACE_LEN(chain);
+
+#ifndef va_copy
+#define va_copy(dst, src) memcpy(&(dst), &(src), sizeof(va_list))
+#endif
+ va_copy(aq, ap);
+
+ sz = evutil_vsnprintf(buffer, space, fmt, aq);
+
+ va_end(aq);
+
+ if (sz < 0)
+ goto done;
+ if ((size_t)sz < space) {
+ chain->off += sz;
+ buf->total_len += sz;
+ buf->n_add_for_cb += sz;
+
+ advance_last_with_data(buf);
+ evbuffer_invoke_callbacks_(buf);
+ result = sz;
+ goto done;
+ }
+ if ((chain = evbuffer_expand_singlechain(buf, sz + 1)) == NULL)
+ goto done;
+ }
+ /* NOTREACHED */
+
+done:
+ EVBUFFER_UNLOCK(buf);
+ return result;
+}
+
+int
+evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
+{
+ int res = -1;
+ va_list ap;
+
+ va_start(ap, fmt);
+ res = evbuffer_add_vprintf(buf, fmt, ap);
+ va_end(ap);
+
+ return (res);
+}
+
+int
+evbuffer_add_reference(struct evbuffer *outbuf,
+ const void *data, size_t datlen,
+ evbuffer_ref_cleanup_cb cleanupfn, void *extra)
+{
+ struct evbuffer_chain *chain;
+ struct evbuffer_chain_reference *info;
+ int result = -1;
+
+ chain = evbuffer_chain_new(sizeof(struct evbuffer_chain_reference));
+ if (!chain)
+ return (-1);
+ chain->flags |= EVBUFFER_REFERENCE | EVBUFFER_IMMUTABLE;
+ chain->buffer = (u_char *)data;
+ chain->buffer_len = datlen;
+ chain->off = datlen;
+
+ info = EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_reference, chain);
+ info->cleanupfn = cleanupfn;
+ info->extra = extra;
+
+ EVBUFFER_LOCK(outbuf);
+ if (outbuf->freeze_end) {
+ /* don't call chain_free; we do not want to actually invoke
+ * the cleanup function */
+ mm_free(chain);
+ goto done;
+ }
+ evbuffer_chain_insert(outbuf, chain);
+ outbuf->n_add_for_cb += datlen;
+
+ evbuffer_invoke_callbacks_(outbuf);
+
+ result = 0;
+done:
+ EVBUFFER_UNLOCK(outbuf);
+
+ return result;
+}
+
+/* TODO(niels): we may want to add to automagically convert to mmap, in
+ * case evbuffer_remove() or evbuffer_pullup() are being used.
+ */
+struct evbuffer_file_segment *
+evbuffer_file_segment_new(
+ int fd, ev_off_t offset, ev_off_t length, unsigned flags)
+{
+ struct evbuffer_file_segment *seg =
+ mm_calloc(sizeof(struct evbuffer_file_segment), 1);
+ if (!seg)
+ return NULL;
+ seg->refcnt = 1;
+ seg->fd = fd;
+ seg->flags = flags;
+ seg->file_offset = offset;
+ seg->cleanup_cb = NULL;
+ seg->cleanup_cb_arg = NULL;
+#ifdef _WIN32
+#ifndef lseek
+#define lseek _lseeki64
+#endif
+#ifndef fstat
+#define fstat _fstat
+#endif
+#ifndef stat
+#define stat _stat
+#endif
+#endif
+ if (length == -1) {
+ struct stat st;
+ if (fstat(fd, &st) < 0)
+ goto err;
+ length = st.st_size;
+ }
+ seg->length = length;
+
+#if defined(USE_SENDFILE)
+ if (!(flags & EVBUF_FS_DISABLE_SENDFILE)) {
+ seg->can_sendfile = 1;
+ goto done;
+ }
+#endif
+
+ if (evbuffer_file_segment_materialize(seg)<0)
+ goto err;
+
+#if defined(USE_SENDFILE)
+done:
+#endif
+ if (!(flags & EVBUF_FS_DISABLE_LOCKING)) {
+ EVTHREAD_ALLOC_LOCK(seg->lock, 0);
+ }
+ return seg;
+err:
+ mm_free(seg);
+ return NULL;
+}
+
+#ifdef EVENT__HAVE_MMAP
+static long
+get_page_size(void)
+{
+#ifdef SC_PAGE_SIZE
+ return sysconf(SC_PAGE_SIZE);
+#elif defined(_SC_PAGE_SIZE)
+ return sysconf(_SC_PAGE_SIZE);
+#else
+ return 1;
+#endif
+}
+#endif
+
+/* DOCDOC */
+/* Requires lock */
+static int
+evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg)
+{
+ const unsigned flags = seg->flags;
+ const int fd = seg->fd;
+ const ev_off_t length = seg->length;
+ const ev_off_t offset = seg->file_offset;
+
+ if (seg->contents)
+ return 0; /* already materialized */
+
+#if defined(EVENT__HAVE_MMAP)
+ if (!(flags & EVBUF_FS_DISABLE_MMAP)) {
+ off_t offset_rounded = 0, offset_leftover = 0;
+ void *mapped;
+ if (offset) {
+ /* mmap implementations don't generally like us
+ * to have an offset that isn't a round */
+ long page_size = get_page_size();
+ if (page_size == -1)
+ goto err;
+ offset_leftover = offset % page_size;
+ offset_rounded = offset - offset_leftover;
+ }
+ mapped = mmap(NULL, length + offset_leftover,
+ PROT_READ,
+#ifdef MAP_NOCACHE
+ MAP_NOCACHE | /* ??? */
+#endif
+#ifdef MAP_FILE
+ MAP_FILE |
+#endif
+ MAP_PRIVATE,
+ fd, offset_rounded);
+ if (mapped == MAP_FAILED) {
+ event_warn("%s: mmap(%d, %d, %zu) failed",
+ __func__, fd, 0, (size_t)(offset + length));
+ } else {
+ seg->mapping = mapped;
+ seg->contents = (char*)mapped+offset_leftover;
+ seg->mmap_offset = 0;
+ seg->is_mapping = 1;
+ goto done;
+ }
+ }
+#endif
+#ifdef _WIN32
+ if (!(flags & EVBUF_FS_DISABLE_MMAP)) {
+ intptr_t h = _get_osfhandle(fd);
+ HANDLE m;
+ ev_uint64_t total_size = length+offset;
+ if ((HANDLE)h == INVALID_HANDLE_VALUE)
+ goto err;
+ m = CreateFileMapping((HANDLE)h, NULL, PAGE_READONLY,
+ (total_size >> 32), total_size & 0xfffffffful,
+ NULL);
+ if (m != INVALID_HANDLE_VALUE) { /* Does h leak? */
+ seg->mapping_handle = m;
+ seg->mmap_offset = offset;
+ seg->is_mapping = 1;
+ goto done;
+ }
+ }
+#endif
+ {
+ ev_off_t start_pos = lseek(fd, 0, SEEK_CUR), pos;
+ ev_off_t read_so_far = 0;
+ char *mem;
+ int e;
+ ev_ssize_t n = 0;
+ if (!(mem = mm_malloc(length)))
+ goto err;
+ if (start_pos < 0) {
+ mm_free(mem);
+ goto err;
+ }
+ if (lseek(fd, offset, SEEK_SET) < 0) {
+ mm_free(mem);
+ goto err;
+ }
+ while (read_so_far < length) {
+ n = read(fd, mem+read_so_far, length-read_so_far);
+ if (n <= 0)
+ break;
+ read_so_far += n;
+ }
+
+ e = errno;
+ pos = lseek(fd, start_pos, SEEK_SET);
+ if (n < 0 || (n == 0 && length > read_so_far)) {
+ mm_free(mem);
+ errno = e;
+ goto err;
+ } else if (pos < 0) {
+ mm_free(mem);
+ goto err;
+ }
+
+ seg->contents = mem;
+ }
+
+done:
+ return 0;
+err:
+ return -1;
+}
+
+void evbuffer_file_segment_add_cleanup_cb(struct evbuffer_file_segment *seg,
+ evbuffer_file_segment_cleanup_cb cb, void* arg)
+{
+ EVUTIL_ASSERT(seg->refcnt > 0);
+ seg->cleanup_cb = cb;
+ seg->cleanup_cb_arg = arg;
+}
+
+void
+evbuffer_file_segment_free(struct evbuffer_file_segment *seg)
+{
+ int refcnt;
+ EVLOCK_LOCK(seg->lock, 0);
+ refcnt = --seg->refcnt;
+ EVLOCK_UNLOCK(seg->lock, 0);
+ if (refcnt > 0)
+ return;
+ EVUTIL_ASSERT(refcnt == 0);
+
+ if (seg->is_mapping) {
+#ifdef _WIN32
+ CloseHandle(seg->mapping_handle);
+#elif defined (EVENT__HAVE_MMAP)
+ off_t offset_leftover;
+ offset_leftover = seg->file_offset % get_page_size();
+ if (munmap(seg->mapping, seg->length + offset_leftover) == -1)
+ event_warn("%s: munmap failed", __func__);
+#endif
+ } else if (seg->contents) {
+ mm_free(seg->contents);
+ }
+
+ if ((seg->flags & EVBUF_FS_CLOSE_ON_FREE) && seg->fd >= 0) {
+ close(seg->fd);
+ }
+
+ if (seg->cleanup_cb) {
+ (*seg->cleanup_cb)((struct evbuffer_file_segment const*)seg,
+ seg->flags, seg->cleanup_cb_arg);
+ seg->cleanup_cb = NULL;
+ seg->cleanup_cb_arg = NULL;
+ }
+
+ EVTHREAD_FREE_LOCK(seg->lock, 0);
+ mm_free(seg);
+}
+
+int
+evbuffer_add_file_segment(struct evbuffer *buf,
+ struct evbuffer_file_segment *seg, ev_off_t offset, ev_off_t length)
+{
+ struct evbuffer_chain *chain;
+ struct evbuffer_chain_file_segment *extra;
+ int can_use_sendfile = 0;
+
+ EVBUFFER_LOCK(buf);
+ EVLOCK_LOCK(seg->lock, 0);
+ if (buf->flags & EVBUFFER_FLAG_DRAINS_TO_FD) {
+ can_use_sendfile = 1;
+ } else {
+ if (!seg->contents) {
+ if (evbuffer_file_segment_materialize(seg)<0) {
+ EVLOCK_UNLOCK(seg->lock, 0);
+ EVBUFFER_UNLOCK(buf);
+ return -1;
+ }
+ }
+ }
+ ++seg->refcnt;
+ EVLOCK_UNLOCK(seg->lock, 0);
+
+ if (buf->freeze_end)
+ goto err;
+
+ if (length < 0) {
+ if (offset > seg->length)
+ goto err;
+ length = seg->length - offset;
+ }
+
+ /* Can we actually add this? */
+ if (offset+length > seg->length)
+ goto err;
+
+ chain = evbuffer_chain_new(sizeof(struct evbuffer_chain_file_segment));
+ if (!chain)
+ goto err;
+ extra = EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_file_segment, chain);
+
+ chain->flags |= EVBUFFER_IMMUTABLE|EVBUFFER_FILESEGMENT;
+ if (can_use_sendfile && seg->can_sendfile) {
+ chain->flags |= EVBUFFER_SENDFILE;
+ chain->misalign = seg->file_offset + offset;
+ chain->off = length;
+ chain->buffer_len = chain->misalign + length;
+ } else if (seg->is_mapping) {
+#ifdef _WIN32
+ ev_uint64_t total_offset = seg->mmap_offset+offset;
+ ev_uint64_t offset_rounded=0, offset_remaining=0;
+ LPVOID data;
+ if (total_offset) {
+ SYSTEM_INFO si;
+ memset(&si, 0, sizeof(si)); /* cargo cult */
+ GetSystemInfo(&si);
+ offset_remaining = total_offset % si.dwAllocationGranularity;
+ offset_rounded = total_offset - offset_remaining;
+ }
+ data = MapViewOfFile(
+ seg->mapping_handle,
+ FILE_MAP_READ,
+ offset_rounded >> 32,
+ offset_rounded & 0xfffffffful,
+ length + offset_remaining);
+ if (data == NULL) {
+ mm_free(chain);
+ goto err;
+ }
+ chain->buffer = (unsigned char*) data;
+ chain->buffer_len = length+offset_remaining;
+ chain->misalign = offset_remaining;
+ chain->off = length;
+#else
+ chain->buffer = (unsigned char*)(seg->contents + offset);
+ chain->buffer_len = length;
+ chain->off = length;
+#endif
+ } else {
+ chain->buffer = (unsigned char*)(seg->contents + offset);
+ chain->buffer_len = length;
+ chain->off = length;
+ }
+
+ extra->segment = seg;
+ buf->n_add_for_cb += length;
+ evbuffer_chain_insert(buf, chain);
+
+ evbuffer_invoke_callbacks_(buf);
+
+ EVBUFFER_UNLOCK(buf);
+
+ return 0;
+err:
+ EVBUFFER_UNLOCK(buf);
+ evbuffer_file_segment_free(seg);
+ return -1;
+}
+
+int
+evbuffer_add_file(struct evbuffer *buf, int fd, ev_off_t offset, ev_off_t length)
+{
+ struct evbuffer_file_segment *seg;
+ unsigned flags = EVBUF_FS_CLOSE_ON_FREE;
+ int r;
+
+ seg = evbuffer_file_segment_new(fd, offset, length, flags);
+ if (!seg)
+ return -1;
+ r = evbuffer_add_file_segment(buf, seg, 0, length);
+ if (r == 0)
+ evbuffer_file_segment_free(seg);
+ return r;
+}
+
+void
+evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg)
+{
+ EVBUFFER_LOCK(buffer);
+
+ if (!LIST_EMPTY(&buffer->callbacks))
+ evbuffer_remove_all_callbacks(buffer);
+
+ if (cb) {
+ struct evbuffer_cb_entry *ent =
+ evbuffer_add_cb(buffer, NULL, cbarg);
+ ent->cb.cb_obsolete = cb;
+ ent->flags |= EVBUFFER_CB_OBSOLETE;
+ }
+ EVBUFFER_UNLOCK(buffer);
+}
+
+struct evbuffer_cb_entry *
+evbuffer_add_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg)
+{
+ struct evbuffer_cb_entry *e;
+ if (! (e = mm_calloc(1, sizeof(struct evbuffer_cb_entry))))
+ return NULL;
+ EVBUFFER_LOCK(buffer);
+ e->cb.cb_func = cb;
+ e->cbarg = cbarg;
+ e->flags = EVBUFFER_CB_ENABLED;
+ LIST_INSERT_HEAD(&buffer->callbacks, e, next);
+ EVBUFFER_UNLOCK(buffer);
+ return e;
+}
+
+int
+evbuffer_remove_cb_entry(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *ent)
+{
+ EVBUFFER_LOCK(buffer);
+ LIST_REMOVE(ent, next);
+ EVBUFFER_UNLOCK(buffer);
+ mm_free(ent);
+ return 0;
+}
+
+int
+evbuffer_remove_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg)
+{
+ struct evbuffer_cb_entry *cbent;
+ int result = -1;
+ EVBUFFER_LOCK(buffer);
+ LIST_FOREACH(cbent, &buffer->callbacks, next) {
+ if (cb == cbent->cb.cb_func && cbarg == cbent->cbarg) {
+ result = evbuffer_remove_cb_entry(buffer, cbent);
+ goto done;
+ }
+ }
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return result;
+}
+
+int
+evbuffer_cb_set_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags)
+{
+ /* the user isn't allowed to mess with these. */
+ flags &= ~EVBUFFER_CB_INTERNAL_FLAGS;
+ EVBUFFER_LOCK(buffer);
+ cb->flags |= flags;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_cb_clear_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags)
+{
+ /* the user isn't allowed to mess with these. */
+ flags &= ~EVBUFFER_CB_INTERNAL_FLAGS;
+ EVBUFFER_LOCK(buffer);
+ cb->flags &= ~flags;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_freeze(struct evbuffer *buffer, int start)
+{
+ EVBUFFER_LOCK(buffer);
+ if (start)
+ buffer->freeze_start = 1;
+ else
+ buffer->freeze_end = 1;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+int
+evbuffer_unfreeze(struct evbuffer *buffer, int start)
+{
+ EVBUFFER_LOCK(buffer);
+ if (start)
+ buffer->freeze_start = 0;
+ else
+ buffer->freeze_end = 0;
+ EVBUFFER_UNLOCK(buffer);
+ return 0;
+}
+
+#if 0
+void
+evbuffer_cb_suspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb)
+{
+ if (!(cb->flags & EVBUFFER_CB_SUSPENDED)) {
+ cb->size_before_suspend = evbuffer_get_length(buffer);
+ cb->flags |= EVBUFFER_CB_SUSPENDED;
+ }
+}
+
+void
+evbuffer_cb_unsuspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb)
+{
+ if ((cb->flags & EVBUFFER_CB_SUSPENDED)) {
+ unsigned call = (cb->flags & EVBUFFER_CB_CALL_ON_UNSUSPEND);
+ size_t sz = cb->size_before_suspend;
+ cb->flags &= ~(EVBUFFER_CB_SUSPENDED|
+ EVBUFFER_CB_CALL_ON_UNSUSPEND);
+ cb->size_before_suspend = 0;
+ if (call && (cb->flags & EVBUFFER_CB_ENABLED)) {
+ cb->cb(buffer, sz, evbuffer_get_length(buffer), cb->cbarg);
+ }
+ }
+}
+#endif
+
+int
+evbuffer_get_callbacks_(struct evbuffer *buffer, struct event_callback **cbs,
+ int max_cbs)
+{
+ int r = 0;
+ EVBUFFER_LOCK(buffer);
+ if (buffer->deferred_cbs) {
+ if (max_cbs < 1) {
+ r = -1;
+ goto done;
+ }
+ cbs[0] = &buffer->deferred;
+ r = 1;
+ }
+done:
+ EVBUFFER_UNLOCK(buffer);
+ return r;
+}
diff --git a/sntp/libevent/buffer_iocp.c b/sntp/libevent/buffer_iocp.c
new file mode 100644
index 0000000..2d76a90
--- /dev/null
+++ b/sntp/libevent/buffer_iocp.c
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ @file buffer_iocp.c
+
+ This module implements overlapped read and write functions for evbuffer
+ objects on Windows.
+*/
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/util.h"
+#include "event2/thread.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+#include "evbuffer-internal.h"
+#include "iocp-internal.h"
+#include "mm-internal.h"
+
+#include <winsock2.h>
+#include <windows.h>
+#include <stdio.h>
+
+#define MAX_WSABUFS 16
+
+/** An evbuffer that can handle overlapped IO. */
+struct evbuffer_overlapped {
+ struct evbuffer buffer;
+ /** The socket that we're doing overlapped IO on. */
+ evutil_socket_t fd;
+
+ /** pending I/O type */
+ unsigned read_in_progress : 1;
+ unsigned write_in_progress : 1;
+
+ /** The first pinned chain in the buffer. */
+ struct evbuffer_chain *first_pinned;
+
+ /** How many chains are pinned; how many of the fields in buffers
+ * are we using. */
+ int n_buffers;
+ WSABUF buffers[MAX_WSABUFS];
+};
+
+/** Given an evbuffer, return the correponding evbuffer structure, or NULL if
+ * the evbuffer isn't overlapped. */
+static inline struct evbuffer_overlapped *
+upcast_evbuffer(struct evbuffer *buf)
+{
+ if (!buf || !buf->is_overlapped)
+ return NULL;
+ return EVUTIL_UPCAST(buf, struct evbuffer_overlapped, buffer);
+}
+
+/** Unpin all the chains noted as pinned in 'eo'. */
+static void
+pin_release(struct evbuffer_overlapped *eo, unsigned flag)
+{
+ int i;
+ struct evbuffer_chain *next, *chain = eo->first_pinned;
+
+ for (i = 0; i < eo->n_buffers; ++i) {
+ EVUTIL_ASSERT(chain);
+ next = chain->next;
+ evbuffer_chain_unpin_(chain, flag);
+ chain = next;
+ }
+}
+
+void
+evbuffer_commit_read_(struct evbuffer *evbuf, ev_ssize_t nBytes)
+{
+ struct evbuffer_overlapped *buf = upcast_evbuffer(evbuf);
+ struct evbuffer_chain **chainp;
+ size_t remaining, len;
+ unsigned i;
+
+ EVBUFFER_LOCK(evbuf);
+ EVUTIL_ASSERT(buf->read_in_progress && !buf->write_in_progress);
+ EVUTIL_ASSERT(nBytes >= 0); /* XXXX Can this be false? */
+
+ evbuffer_unfreeze(evbuf, 0);
+
+ chainp = evbuf->last_with_datap;
+ if (!((*chainp)->flags & EVBUFFER_MEM_PINNED_R))
+ chainp = &(*chainp)->next;
+ remaining = nBytes;
+ for (i = 0; remaining > 0 && i < (unsigned)buf->n_buffers; ++i) {
+ EVUTIL_ASSERT(*chainp);
+ len = buf->buffers[i].len;
+ if (remaining < len)
+ len = remaining;
+ (*chainp)->off += len;
+ evbuf->last_with_datap = chainp;
+ remaining -= len;
+ chainp = &(*chainp)->next;
+ }
+
+ pin_release(buf, EVBUFFER_MEM_PINNED_R);
+
+ buf->read_in_progress = 0;
+
+ evbuf->total_len += nBytes;
+ evbuf->n_add_for_cb += nBytes;
+
+ evbuffer_invoke_callbacks_(evbuf);
+
+ evbuffer_decref_and_unlock_(evbuf);
+}
+
+void
+evbuffer_commit_write_(struct evbuffer *evbuf, ev_ssize_t nBytes)
+{
+ struct evbuffer_overlapped *buf = upcast_evbuffer(evbuf);
+
+ EVBUFFER_LOCK(evbuf);
+ EVUTIL_ASSERT(buf->write_in_progress && !buf->read_in_progress);
+ evbuffer_unfreeze(evbuf, 1);
+ evbuffer_drain(evbuf, nBytes);
+ pin_release(buf,EVBUFFER_MEM_PINNED_W);
+ buf->write_in_progress = 0;
+ evbuffer_decref_and_unlock_(evbuf);
+}
+
+struct evbuffer *
+evbuffer_overlapped_new_(evutil_socket_t fd)
+{
+ struct evbuffer_overlapped *evo;
+
+ evo = mm_calloc(1, sizeof(struct evbuffer_overlapped));
+ if (!evo)
+ return NULL;
+
+ LIST_INIT(&evo->buffer.callbacks);
+ evo->buffer.refcnt = 1;
+ evo->buffer.last_with_datap = &evo->buffer.first;
+
+ evo->buffer.is_overlapped = 1;
+ evo->fd = fd;
+
+ return &evo->buffer;
+}
+
+int
+evbuffer_launch_write_(struct evbuffer *buf, ev_ssize_t at_most,
+ struct event_overlapped *ol)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ int r = -1;
+ int i;
+ struct evbuffer_chain *chain;
+ DWORD bytesSent;
+
+ if (!buf) {
+ /* No buffer, or it isn't overlapped */
+ return -1;
+ }
+
+ EVBUFFER_LOCK(buf);
+ EVUTIL_ASSERT(!buf_o->read_in_progress);
+ if (buf->freeze_start || buf_o->write_in_progress)
+ goto done;
+ if (!buf->total_len) {
+ /* Nothing to write */
+ r = 0;
+ goto done;
+ } else if (at_most < 0 || (size_t)at_most > buf->total_len) {
+ at_most = buf->total_len;
+ }
+ evbuffer_freeze(buf, 1);
+
+ buf_o->first_pinned = NULL;
+ buf_o->n_buffers = 0;
+ memset(buf_o->buffers, 0, sizeof(buf_o->buffers));
+
+ chain = buf_o->first_pinned = buf->first;
+
+ for (i=0; i < MAX_WSABUFS && chain; ++i, chain=chain->next) {
+ WSABUF *b = &buf_o->buffers[i];
+ b->buf = (char*)( chain->buffer + chain->misalign );
+ evbuffer_chain_pin_(chain, EVBUFFER_MEM_PINNED_W);
+
+ if ((size_t)at_most > chain->off) {
+ /* XXXX Cast is safe for now, since win32 has no
+ mmaped chains. But later, we need to have this
+ add more WSAbufs if chain->off is greater than
+ ULONG_MAX */
+ b->len = (unsigned long)chain->off;
+ at_most -= chain->off;
+ } else {
+ b->len = (unsigned long)at_most;
+ ++i;
+ break;
+ }
+ }
+
+ buf_o->n_buffers = i;
+ evbuffer_incref_(buf);
+ if (WSASend(buf_o->fd, buf_o->buffers, i, &bytesSent, 0,
+ &ol->overlapped, NULL)) {
+ int error = WSAGetLastError();
+ if (error != WSA_IO_PENDING) {
+ /* An actual error. */
+ pin_release(buf_o, EVBUFFER_MEM_PINNED_W);
+ evbuffer_unfreeze(buf, 1);
+ evbuffer_free(buf); /* decref */
+ goto done;
+ }
+ }
+
+ buf_o->write_in_progress = 1;
+ r = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return r;
+}
+
+int
+evbuffer_launch_read_(struct evbuffer *buf, size_t at_most,
+ struct event_overlapped *ol)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ int r = -1, i;
+ int nvecs;
+ int npin=0;
+ struct evbuffer_chain *chain=NULL, **chainp;
+ DWORD bytesRead;
+ DWORD flags = 0;
+ struct evbuffer_iovec vecs[MAX_WSABUFS];
+
+ if (!buf_o)
+ return -1;
+ EVBUFFER_LOCK(buf);
+ EVUTIL_ASSERT(!buf_o->write_in_progress);
+ if (buf->freeze_end || buf_o->read_in_progress)
+ goto done;
+
+ buf_o->first_pinned = NULL;
+ buf_o->n_buffers = 0;
+ memset(buf_o->buffers, 0, sizeof(buf_o->buffers));
+
+ if (evbuffer_expand_fast_(buf, at_most, MAX_WSABUFS) == -1)
+ goto done;
+ evbuffer_freeze(buf, 0);
+
+ nvecs = evbuffer_read_setup_vecs_(buf, at_most,
+ vecs, MAX_WSABUFS, &chainp, 1);
+ for (i=0;i<nvecs;++i) {
+ WSABUF_FROM_EVBUFFER_IOV(
+ &buf_o->buffers[i],
+ &vecs[i]);
+ }
+
+ buf_o->n_buffers = nvecs;
+ buf_o->first_pinned = chain = *chainp;
+
+ npin=0;
+ for ( ; chain; chain = chain->next) {
+ evbuffer_chain_pin_(chain, EVBUFFER_MEM_PINNED_R);
+ ++npin;
+ }
+ EVUTIL_ASSERT(npin == nvecs);
+
+ evbuffer_incref_(buf);
+ if (WSARecv(buf_o->fd, buf_o->buffers, nvecs, &bytesRead, &flags,
+ &ol->overlapped, NULL)) {
+ int error = WSAGetLastError();
+ if (error != WSA_IO_PENDING) {
+ /* An actual error. */
+ pin_release(buf_o, EVBUFFER_MEM_PINNED_R);
+ evbuffer_unfreeze(buf, 0);
+ evbuffer_free(buf); /* decref */
+ goto done;
+ }
+ }
+
+ buf_o->read_in_progress = 1;
+ r = 0;
+done:
+ EVBUFFER_UNLOCK(buf);
+ return r;
+}
+
+evutil_socket_t
+evbuffer_overlapped_get_fd_(struct evbuffer *buf)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ return buf_o ? buf_o->fd : -1;
+}
+
+void
+evbuffer_overlapped_set_fd_(struct evbuffer *buf, evutil_socket_t fd)
+{
+ struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
+ EVBUFFER_LOCK(buf);
+ /* XXX is this right?, should it cancel current I/O operations? */
+ if (buf_o)
+ buf_o->fd = fd;
+ EVBUFFER_UNLOCK(buf);
+}
diff --git a/sntp/libevent/bufferevent-internal.h b/sntp/libevent/bufferevent-internal.h
new file mode 100644
index 0000000..134bb33
--- /dev/null
+++ b/sntp/libevent/bufferevent-internal.h
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef BUFFEREVENT_INTERNAL_H_INCLUDED_
+#define BUFFEREVENT_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "event2/event_struct.h"
+#include "evconfig-private.h"
+#include "event2/util.h"
+#include "defer-internal.h"
+#include "evthread-internal.h"
+#include "event2/thread.h"
+#include "ratelim-internal.h"
+#include "event2/bufferevent_struct.h"
+
+/* These flags are reasons that we might be declining to actually enable
+ reading or writing on a bufferevent.
+ */
+
+/* On a all bufferevents, for reading: used when we have read up to the
+ watermark value.
+
+ On a filtering bufferevent, for writing: used when the underlying
+ bufferevent's write buffer has been filled up to its watermark
+ value.
+*/
+#define BEV_SUSPEND_WM 0x01
+/* On a base bufferevent: when we have emptied a bandwidth buckets */
+#define BEV_SUSPEND_BW 0x02
+/* On a base bufferevent: when we have emptied the group's bandwidth bucket. */
+#define BEV_SUSPEND_BW_GROUP 0x04
+/* On a socket bufferevent: can't do any operations while we're waiting for
+ * name lookup to finish. */
+#define BEV_SUSPEND_LOOKUP 0x08
+/* On a base bufferevent, for reading: used when a filter has choked this
+ * (underlying) bufferevent because it has stopped reading from it. */
+#define BEV_SUSPEND_FILT_READ 0x10
+
+typedef ev_uint16_t bufferevent_suspend_flags;
+
+struct bufferevent_rate_limit_group {
+ /** List of all members in the group */
+ LIST_HEAD(rlim_group_member_list, bufferevent_private) members;
+ /** Current limits for the group. */
+ struct ev_token_bucket rate_limit;
+ struct ev_token_bucket_cfg rate_limit_cfg;
+
+ /** True iff we don't want to read from any member of the group.until
+ * the token bucket refills. */
+ unsigned read_suspended : 1;
+ /** True iff we don't want to write from any member of the group.until
+ * the token bucket refills. */
+ unsigned write_suspended : 1;
+ /** True iff we were unable to suspend one of the bufferevents in the
+ * group for reading the last time we tried, and we should try
+ * again. */
+ unsigned pending_unsuspend_read : 1;
+ /** True iff we were unable to suspend one of the bufferevents in the
+ * group for writing the last time we tried, and we should try
+ * again. */
+ unsigned pending_unsuspend_write : 1;
+
+ /*@{*/
+ /** Total number of bytes read or written in this group since last
+ * reset. */
+ ev_uint64_t total_read;
+ ev_uint64_t total_written;
+ /*@}*/
+
+ /** The number of bufferevents in the group. */
+ int n_members;
+
+ /** The smallest number of bytes that any member of the group should
+ * be limited to read or write at a time. */
+ ev_ssize_t min_share;
+ ev_ssize_t configured_min_share;
+
+ /** Timeout event that goes off once a tick, when the bucket is ready
+ * to refill. */
+ struct event master_refill_event;
+
+ /** Seed for weak random number generator. Protected by 'lock' */
+ struct evutil_weakrand_state weakrand_seed;
+
+ /** Lock to protect the members of this group. This lock should nest
+ * within every bufferevent lock: if you are holding this lock, do
+ * not assume you can lock another bufferevent. */
+ void *lock;
+};
+
+/** Fields for rate-limiting a single bufferevent. */
+struct bufferevent_rate_limit {
+ /* Linked-list elements for storing this bufferevent_private in a
+ * group.
+ *
+ * Note that this field is supposed to be protected by the group
+ * lock */
+ LIST_ENTRY(bufferevent_private) next_in_group;
+ /** The rate-limiting group for this bufferevent, or NULL if it is
+ * only rate-limited on its own. */
+ struct bufferevent_rate_limit_group *group;
+
+ /* This bufferevent's current limits. */
+ struct ev_token_bucket limit;
+ /* Pointer to the rate-limit configuration for this bufferevent.
+ * Can be shared. XXX reference-count this? */
+ struct ev_token_bucket_cfg *cfg;
+
+ /* Timeout event used when one this bufferevent's buckets are
+ * empty. */
+ struct event refill_bucket_event;
+};
+
+/** Parts of the bufferevent structure that are shared among all bufferevent
+ * types, but not exposed in bufferevent_struct.h. */
+struct bufferevent_private {
+ /** The underlying bufferevent structure. */
+ struct bufferevent bev;
+
+ /** Evbuffer callback to enforce watermarks on input. */
+ struct evbuffer_cb_entry *read_watermarks_cb;
+
+ /** If set, we should free the lock when we free the bufferevent. */
+ unsigned own_lock : 1;
+
+ /** Flag: set if we have deferred callbacks and a read callback is
+ * pending. */
+ unsigned readcb_pending : 1;
+ /** Flag: set if we have deferred callbacks and a write callback is
+ * pending. */
+ unsigned writecb_pending : 1;
+ /** Flag: set if we are currently busy connecting. */
+ unsigned connecting : 1;
+ /** Flag: set if a connect failed prematurely; this is a hack for
+ * getting around the bufferevent abstraction. */
+ unsigned connection_refused : 1;
+ /** Set to the events pending if we have deferred callbacks and
+ * an events callback is pending. */
+ short eventcb_pending;
+
+ /** If set, read is suspended until one or more conditions are over.
+ * The actual value here is a bitfield of those conditions; see the
+ * BEV_SUSPEND_* flags above. */
+ bufferevent_suspend_flags read_suspended;
+
+ /** If set, writing is suspended until one or more conditions are over.
+ * The actual value here is a bitfield of those conditions; see the
+ * BEV_SUSPEND_* flags above. */
+ bufferevent_suspend_flags write_suspended;
+
+ /** Set to the current socket errno if we have deferred callbacks and
+ * an events callback is pending. */
+ int errno_pending;
+
+ /** The DNS error code for bufferevent_socket_connect_hostname */
+ int dns_error;
+
+ /** Used to implement deferred callbacks */
+ struct event_callback deferred;
+
+ /** The options this bufferevent was constructed with */
+ enum bufferevent_options options;
+
+ /** Current reference count for this bufferevent. */
+ int refcnt;
+
+ /** Lock for this bufferevent. Shared by the inbuf and the outbuf.
+ * If NULL, locking is disabled. */
+ void *lock;
+
+ /** No matter how big our bucket gets, don't try to read more than this
+ * much in a single read operation. */
+ ev_ssize_t max_single_read;
+
+ /** No matter how big our bucket gets, don't try to write more than this
+ * much in a single write operation. */
+ ev_ssize_t max_single_write;
+
+ /** Rate-limiting information for this bufferevent */
+ struct bufferevent_rate_limit *rate_limiting;
+};
+
+/** Possible operations for a control callback. */
+enum bufferevent_ctrl_op {
+ BEV_CTRL_SET_FD,
+ BEV_CTRL_GET_FD,
+ BEV_CTRL_GET_UNDERLYING,
+ BEV_CTRL_CANCEL_ALL
+};
+
+/** Possible data types for a control callback */
+union bufferevent_ctrl_data {
+ void *ptr;
+ evutil_socket_t fd;
+};
+
+/**
+ Implementation table for a bufferevent: holds function pointers and other
+ information to make the various bufferevent types work.
+*/
+struct bufferevent_ops {
+ /** The name of the bufferevent's type. */
+ const char *type;
+ /** At what offset into the implementation type will we find a
+ bufferevent structure?
+
+ Example: if the type is implemented as
+ struct bufferevent_x {
+ int extra_data;
+ struct bufferevent bev;
+ }
+ then mem_offset should be offsetof(struct bufferevent_x, bev)
+ */
+ off_t mem_offset;
+
+ /** Enables one or more of EV_READ|EV_WRITE on a bufferevent. Does
+ not need to adjust the 'enabled' field. Returns 0 on success, -1
+ on failure.
+ */
+ int (*enable)(struct bufferevent *, short);
+
+ /** Disables one or more of EV_READ|EV_WRITE on a bufferevent. Does
+ not need to adjust the 'enabled' field. Returns 0 on success, -1
+ on failure.
+ */
+ int (*disable)(struct bufferevent *, short);
+
+ /** Detatches the bufferevent from related data structures. Called as
+ * soon as its reference count reaches 0. */
+ void (*unlink)(struct bufferevent *);
+
+ /** Free any storage and deallocate any extra data or structures used
+ in this implementation. Called when the bufferevent is
+ finalized.
+ */
+ void (*destruct)(struct bufferevent *);
+
+ /** Called when the timeouts on the bufferevent have changed.*/
+ int (*adj_timeouts)(struct bufferevent *);
+
+ /** Called to flush data. */
+ int (*flush)(struct bufferevent *, short, enum bufferevent_flush_mode);
+
+ /** Called to access miscellaneous fields. */
+ int (*ctrl)(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+};
+
+extern const struct bufferevent_ops bufferevent_ops_socket;
+extern const struct bufferevent_ops bufferevent_ops_filter;
+extern const struct bufferevent_ops bufferevent_ops_pair;
+
+#define BEV_IS_SOCKET(bevp) ((bevp)->be_ops == &bufferevent_ops_socket)
+#define BEV_IS_FILTER(bevp) ((bevp)->be_ops == &bufferevent_ops_filter)
+#define BEV_IS_PAIR(bevp) ((bevp)->be_ops == &bufferevent_ops_pair)
+
+#ifdef _WIN32
+extern const struct bufferevent_ops bufferevent_ops_async;
+#define BEV_IS_ASYNC(bevp) ((bevp)->be_ops == &bufferevent_ops_async)
+#else
+#define BEV_IS_ASYNC(bevp) 0
+#endif
+
+/** Initialize the shared parts of a bufferevent. */
+int bufferevent_init_common_(struct bufferevent_private *, struct event_base *, const struct bufferevent_ops *, enum bufferevent_options options);
+
+/** For internal use: temporarily stop all reads on bufev, until the conditions
+ * in 'what' are over. */
+void bufferevent_suspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+/** For internal use: clear the conditions 'what' on bufev, and re-enable
+ * reading if there are no conditions left. */
+void bufferevent_unsuspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+
+/** For internal use: temporarily stop all writes on bufev, until the conditions
+ * in 'what' are over. */
+void bufferevent_suspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+/** For internal use: clear the conditions 'what' on bufev, and re-enable
+ * writing if there are no conditions left. */
+void bufferevent_unsuspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what);
+
+#define bufferevent_wm_suspend_read(b) \
+ bufferevent_suspend_read_((b), BEV_SUSPEND_WM)
+#define bufferevent_wm_unsuspend_read(b) \
+ bufferevent_unsuspend_read_((b), BEV_SUSPEND_WM)
+
+/*
+ Disable a bufferevent. Equivalent to bufferevent_disable(), but
+ first resets 'connecting' flag to force EV_WRITE down for sure.
+
+ XXXX this method will go away in the future; try not to add new users.
+ See comment in evhttp_connection_reset_() for discussion.
+
+ @param bufev the bufferevent to be disabled
+ @param event any combination of EV_READ | EV_WRITE.
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_disable()
+ */
+int bufferevent_disable_hard_(struct bufferevent *bufev, short event);
+
+/** Internal: Set up locking on a bufferevent. If lock is set, use it.
+ * Otherwise, use a new lock. */
+int bufferevent_enable_locking_(struct bufferevent *bufev, void *lock);
+/** Internal: Increment the reference count on bufev. */
+void bufferevent_incref_(struct bufferevent *bufev);
+/** Internal: Lock bufev and increase its reference count.
+ * unlocking it otherwise. */
+void bufferevent_incref_and_lock_(struct bufferevent *bufev);
+/** Internal: Decrement the reference count on bufev. Returns 1 if it freed
+ * the bufferevent.*/
+int bufferevent_decref_(struct bufferevent *bufev);
+/** Internal: Drop the reference count on bufev, freeing as necessary, and
+ * unlocking it otherwise. Returns 1 if it freed the bufferevent. */
+int bufferevent_decref_and_unlock_(struct bufferevent *bufev);
+
+/** Internal: If callbacks are deferred and we have a read callback, schedule
+ * a readcb. Otherwise just run the readcb. Ignores watermarks. */
+void bufferevent_run_readcb_(struct bufferevent *bufev, int options);
+/** Internal: If callbacks are deferred and we have a write callback, schedule
+ * a writecb. Otherwise just run the writecb. Ignores watermarks. */
+void bufferevent_run_writecb_(struct bufferevent *bufev, int options);
+/** Internal: If callbacks are deferred and we have an eventcb, schedule
+ * it to run with events "what". Otherwise just run the eventcb.
+ * See bufferevent_trigger_event for meaning of "options". */
+void bufferevent_run_eventcb_(struct bufferevent *bufev, short what, int options);
+
+/** Internal: Run or schedule (if deferred or options contain
+ * BEV_TRIG_DEFER_CALLBACKS) I/O callbacks specified in iotype.
+ * Must already hold the bufev lock. Honors watermarks unless
+ * BEV_TRIG_IGNORE_WATERMARKS is in options. */
+static inline void bufferevent_trigger_nolock_(struct bufferevent *bufev, short iotype, int options);
+
+/* Making this inline since all of the common-case calls to this function in
+ * libevent use constant arguments. */
+static inline void
+bufferevent_trigger_nolock_(struct bufferevent *bufev, short iotype, int options)
+{
+ if ((iotype & EV_READ) && ((options & BEV_TRIG_IGNORE_WATERMARKS) ||
+ evbuffer_get_length(bufev->input) >= bufev->wm_read.low))
+ bufferevent_run_readcb_(bufev, options);
+ if ((iotype & EV_WRITE) && ((options & BEV_TRIG_IGNORE_WATERMARKS) ||
+ evbuffer_get_length(bufev->output) <= bufev->wm_write.low))
+ bufferevent_run_writecb_(bufev, options);
+}
+
+/** Internal: Add the event 'ev' with timeout tv, unless tv is set to 0, in
+ * which case add ev with no timeout. */
+int bufferevent_add_event_(struct event *ev, const struct timeval *tv);
+
+/* =========
+ * These next functions implement timeouts for bufferevents that aren't doing
+ * anything else with ev_read and ev_write, to handle timeouts.
+ * ========= */
+/** Internal use: Set up the ev_read and ev_write callbacks so that
+ * the other "generic_timeout" functions will work on it. Call this from
+ * the constructor function. */
+void bufferevent_init_generic_timeout_cbs_(struct bufferevent *bev);
+/** Internal use: Add or delete the generic timeout events as appropriate.
+ * (If an event is enabled and a timeout is set, we add the event. Otherwise
+ * we delete it.) Call this from anything that changes the timeout values,
+ * that enabled EV_READ or EV_WRITE, or that disables EV_READ or EV_WRITE. */
+int bufferevent_generic_adj_timeouts_(struct bufferevent *bev);
+
+enum bufferevent_options bufferevent_get_options_(struct bufferevent *bev);
+
+/** Internal use: We have just successfully read data into an inbuf, so
+ * reset the read timeout (if any). */
+#define BEV_RESET_GENERIC_READ_TIMEOUT(bev) \
+ do { \
+ if (evutil_timerisset(&(bev)->timeout_read)) \
+ event_add(&(bev)->ev_read, &(bev)->timeout_read); \
+ } while (0)
+/** Internal use: We have just successfully written data from an inbuf, so
+ * reset the read timeout (if any). */
+#define BEV_RESET_GENERIC_WRITE_TIMEOUT(bev) \
+ do { \
+ if (evutil_timerisset(&(bev)->timeout_write)) \
+ event_add(&(bev)->ev_write, &(bev)->timeout_write); \
+ } while (0)
+#define BEV_DEL_GENERIC_READ_TIMEOUT(bev) \
+ event_del(&(bev)->ev_read)
+#define BEV_DEL_GENERIC_WRITE_TIMEOUT(bev) \
+ event_del(&(bev)->ev_write)
+
+
+/** Internal: Given a bufferevent, return its corresponding
+ * bufferevent_private. */
+#define BEV_UPCAST(b) EVUTIL_UPCAST((b), struct bufferevent_private, bev)
+
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+#define BEV_LOCK(b) EVUTIL_NIL_STMT_
+#define BEV_UNLOCK(b) EVUTIL_NIL_STMT_
+#else
+/** Internal: Grab the lock (if any) on a bufferevent */
+#define BEV_LOCK(b) do { \
+ struct bufferevent_private *locking = BEV_UPCAST(b); \
+ EVLOCK_LOCK(locking->lock, 0); \
+ } while (0)
+
+/** Internal: Release the lock (if any) on a bufferevent */
+#define BEV_UNLOCK(b) do { \
+ struct bufferevent_private *locking = BEV_UPCAST(b); \
+ EVLOCK_UNLOCK(locking->lock, 0); \
+ } while (0)
+#endif
+
+
+/* ==== For rate-limiting. */
+
+int bufferevent_decrement_write_buckets_(struct bufferevent_private *bev,
+ ev_ssize_t bytes);
+int bufferevent_decrement_read_buckets_(struct bufferevent_private *bev,
+ ev_ssize_t bytes);
+ev_ssize_t bufferevent_get_read_max_(struct bufferevent_private *bev);
+ev_ssize_t bufferevent_get_write_max_(struct bufferevent_private *bev);
+
+int bufferevent_ratelim_init_(struct bufferevent_private *bev);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* BUFFEREVENT_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/bufferevent.c b/sntp/libevent/bufferevent.c
new file mode 100644
index 0000000..588461a
--- /dev/null
+++ b/sntp/libevent/bufferevent.c
@@ -0,0 +1,984 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+#include <errno.h>
+
+#include "event2/util.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/event.h"
+#include "event-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "evbuffer-internal.h"
+#include "util-internal.h"
+
+static void bufferevent_cancel_all_(struct bufferevent *bev);
+static void bufferevent_finalize_cb_(struct event_callback *evcb, void *arg_);
+
+void
+bufferevent_suspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ if (!bufev_private->read_suspended)
+ bufev->be_ops->disable(bufev, EV_READ);
+ bufev_private->read_suspended |= what;
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_unsuspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ bufev_private->read_suspended &= ~what;
+ if (!bufev_private->read_suspended && (bufev->enabled & EV_READ))
+ bufev->be_ops->enable(bufev, EV_READ);
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_suspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ if (!bufev_private->write_suspended)
+ bufev->be_ops->disable(bufev, EV_WRITE);
+ bufev_private->write_suspended |= what;
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_unsuspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ BEV_LOCK(bufev);
+ bufev_private->write_suspended &= ~what;
+ if (!bufev_private->write_suspended && (bufev->enabled & EV_WRITE))
+ bufev->be_ops->enable(bufev, EV_WRITE);
+ BEV_UNLOCK(bufev);
+}
+
+
+/* Callback to implement watermarks on the input buffer. Only enabled
+ * if the watermark is set. */
+static void
+bufferevent_inbuf_wm_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bufev = arg;
+ size_t size;
+
+ size = evbuffer_get_length(buf);
+
+ if (size >= bufev->wm_read.high)
+ bufferevent_wm_suspend_read(bufev);
+ else
+ bufferevent_wm_unsuspend_read(bufev);
+}
+
+static void
+bufferevent_run_deferred_callbacks_locked(struct event_callback *cb, void *arg)
+{
+ struct bufferevent_private *bufev_private = arg;
+ struct bufferevent *bufev = &bufev_private->bev;
+
+ BEV_LOCK(bufev);
+ if ((bufev_private->eventcb_pending & BEV_EVENT_CONNECTED) &&
+ bufev->errorcb) {
+ /* The "connected" happened before any reads or writes, so
+ send it first. */
+ bufev_private->eventcb_pending &= ~BEV_EVENT_CONNECTED;
+ bufev->errorcb(bufev, BEV_EVENT_CONNECTED, bufev->cbarg);
+ }
+ if (bufev_private->readcb_pending && bufev->readcb) {
+ bufev_private->readcb_pending = 0;
+ bufev->readcb(bufev, bufev->cbarg);
+ }
+ if (bufev_private->writecb_pending && bufev->writecb) {
+ bufev_private->writecb_pending = 0;
+ bufev->writecb(bufev, bufev->cbarg);
+ }
+ if (bufev_private->eventcb_pending && bufev->errorcb) {
+ short what = bufev_private->eventcb_pending;
+ int err = bufev_private->errno_pending;
+ bufev_private->eventcb_pending = 0;
+ bufev_private->errno_pending = 0;
+ EVUTIL_SET_SOCKET_ERROR(err);
+ bufev->errorcb(bufev, what, bufev->cbarg);
+ }
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+static void
+bufferevent_run_deferred_callbacks_unlocked(struct event_callback *cb, void *arg)
+{
+ struct bufferevent_private *bufev_private = arg;
+ struct bufferevent *bufev = &bufev_private->bev;
+
+ BEV_LOCK(bufev);
+#define UNLOCKED(stmt) \
+ do { BEV_UNLOCK(bufev); stmt; BEV_LOCK(bufev); } while(0)
+
+ if ((bufev_private->eventcb_pending & BEV_EVENT_CONNECTED) &&
+ bufev->errorcb) {
+ /* The "connected" happened before any reads or writes, so
+ send it first. */
+ bufferevent_event_cb errorcb = bufev->errorcb;
+ void *cbarg = bufev->cbarg;
+ bufev_private->eventcb_pending &= ~BEV_EVENT_CONNECTED;
+ UNLOCKED(errorcb(bufev, BEV_EVENT_CONNECTED, cbarg));
+ }
+ if (bufev_private->readcb_pending && bufev->readcb) {
+ bufferevent_data_cb readcb = bufev->readcb;
+ void *cbarg = bufev->cbarg;
+ bufev_private->readcb_pending = 0;
+ UNLOCKED(readcb(bufev, cbarg));
+ }
+ if (bufev_private->writecb_pending && bufev->writecb) {
+ bufferevent_data_cb writecb = bufev->writecb;
+ void *cbarg = bufev->cbarg;
+ bufev_private->writecb_pending = 0;
+ UNLOCKED(writecb(bufev, cbarg));
+ }
+ if (bufev_private->eventcb_pending && bufev->errorcb) {
+ bufferevent_event_cb errorcb = bufev->errorcb;
+ void *cbarg = bufev->cbarg;
+ short what = bufev_private->eventcb_pending;
+ int err = bufev_private->errno_pending;
+ bufev_private->eventcb_pending = 0;
+ bufev_private->errno_pending = 0;
+ EVUTIL_SET_SOCKET_ERROR(err);
+ UNLOCKED(errorcb(bufev,what,cbarg));
+ }
+ bufferevent_decref_and_unlock_(bufev);
+#undef UNLOCKED
+}
+
+#define SCHEDULE_DEFERRED(bevp) \
+ do { \
+ if (event_deferred_cb_schedule_( \
+ (bevp)->bev.ev_base, \
+ &(bevp)->deferred)) \
+ bufferevent_incref_(&(bevp)->bev); \
+ } while (0)
+
+
+void
+bufferevent_run_readcb_(struct bufferevent *bufev, int options)
+{
+ /* Requires that we hold the lock and a reference */
+ struct bufferevent_private *p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (bufev->readcb == NULL)
+ return;
+ if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) {
+ p->readcb_pending = 1;
+ SCHEDULE_DEFERRED(p);
+ } else {
+ bufev->readcb(bufev, bufev->cbarg);
+ }
+}
+
+void
+bufferevent_run_writecb_(struct bufferevent *bufev, int options)
+{
+ /* Requires that we hold the lock and a reference */
+ struct bufferevent_private *p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (bufev->writecb == NULL)
+ return;
+ if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) {
+ p->writecb_pending = 1;
+ SCHEDULE_DEFERRED(p);
+ } else {
+ bufev->writecb(bufev, bufev->cbarg);
+ }
+}
+
+#define BEV_TRIG_ALL_OPTS ( \
+ BEV_TRIG_IGNORE_WATERMARKS| \
+ BEV_TRIG_DEFER_CALLBACKS \
+ )
+
+void
+bufferevent_trigger(struct bufferevent *bufev, short iotype, int options)
+{
+ bufferevent_incref_and_lock_(bufev);
+ bufferevent_trigger_nolock_(bufev, iotype, options&BEV_TRIG_ALL_OPTS);
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+void
+bufferevent_run_eventcb_(struct bufferevent *bufev, short what, int options)
+{
+ /* Requires that we hold the lock and a reference */
+ struct bufferevent_private *p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (bufev->errorcb == NULL)
+ return;
+ if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) {
+ p->eventcb_pending |= what;
+ p->errno_pending = EVUTIL_SOCKET_ERROR();
+ SCHEDULE_DEFERRED(p);
+ } else {
+ bufev->errorcb(bufev, what, bufev->cbarg);
+ }
+}
+
+void
+bufferevent_trigger_event(struct bufferevent *bufev, short what, int options)
+{
+ bufferevent_incref_and_lock_(bufev);
+ bufferevent_run_eventcb_(bufev, what, options&BEV_TRIG_ALL_OPTS);
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+int
+bufferevent_init_common_(struct bufferevent_private *bufev_private,
+ struct event_base *base,
+ const struct bufferevent_ops *ops,
+ enum bufferevent_options options)
+{
+ struct bufferevent *bufev = &bufev_private->bev;
+
+ if (!bufev->input) {
+ if ((bufev->input = evbuffer_new()) == NULL)
+ return -1;
+ }
+
+ if (!bufev->output) {
+ if ((bufev->output = evbuffer_new()) == NULL) {
+ evbuffer_free(bufev->input);
+ return -1;
+ }
+ }
+
+ bufev_private->refcnt = 1;
+ bufev->ev_base = base;
+
+ /* Disable timeouts. */
+ evutil_timerclear(&bufev->timeout_read);
+ evutil_timerclear(&bufev->timeout_write);
+
+ bufev->be_ops = ops;
+
+ bufferevent_ratelim_init_(bufev_private);
+
+ /*
+ * Set to EV_WRITE so that using bufferevent_write is going to
+ * trigger a callback. Reading needs to be explicitly enabled
+ * because otherwise no data will be available.
+ */
+ bufev->enabled = EV_WRITE;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (options & BEV_OPT_THREADSAFE) {
+ if (bufferevent_enable_locking_(bufev, NULL) < 0) {
+ /* cleanup */
+ evbuffer_free(bufev->input);
+ evbuffer_free(bufev->output);
+ bufev->input = NULL;
+ bufev->output = NULL;
+ return -1;
+ }
+ }
+#endif
+ if ((options & (BEV_OPT_DEFER_CALLBACKS|BEV_OPT_UNLOCK_CALLBACKS))
+ == BEV_OPT_UNLOCK_CALLBACKS) {
+ event_warnx("UNLOCK_CALLBACKS requires DEFER_CALLBACKS");
+ return -1;
+ }
+ if (options & BEV_OPT_UNLOCK_CALLBACKS)
+ event_deferred_cb_init_(
+ &bufev_private->deferred,
+ event_base_get_npriorities(base) / 2,
+ bufferevent_run_deferred_callbacks_unlocked,
+ bufev_private);
+ else
+ event_deferred_cb_init_(
+ &bufev_private->deferred,
+ event_base_get_npriorities(base) / 2,
+ bufferevent_run_deferred_callbacks_locked,
+ bufev_private);
+
+ bufev_private->options = options;
+
+ evbuffer_set_parent_(bufev->input, bufev);
+ evbuffer_set_parent_(bufev->output, bufev);
+
+ return 0;
+}
+
+void
+bufferevent_setcb(struct bufferevent *bufev,
+ bufferevent_data_cb readcb, bufferevent_data_cb writecb,
+ bufferevent_event_cb eventcb, void *cbarg)
+{
+ BEV_LOCK(bufev);
+
+ bufev->readcb = readcb;
+ bufev->writecb = writecb;
+ bufev->errorcb = eventcb;
+
+ bufev->cbarg = cbarg;
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_getcb(struct bufferevent *bufev,
+ bufferevent_data_cb *readcb_ptr,
+ bufferevent_data_cb *writecb_ptr,
+ bufferevent_event_cb *eventcb_ptr,
+ void **cbarg_ptr)
+{
+ BEV_LOCK(bufev);
+ if (readcb_ptr)
+ *readcb_ptr = bufev->readcb;
+ if (writecb_ptr)
+ *writecb_ptr = bufev->writecb;
+ if (eventcb_ptr)
+ *eventcb_ptr = bufev->errorcb;
+ if (cbarg_ptr)
+ *cbarg_ptr = bufev->cbarg;
+
+ BEV_UNLOCK(bufev);
+}
+
+struct evbuffer *
+bufferevent_get_input(struct bufferevent *bufev)
+{
+ return bufev->input;
+}
+
+struct evbuffer *
+bufferevent_get_output(struct bufferevent *bufev)
+{
+ return bufev->output;
+}
+
+struct event_base *
+bufferevent_get_base(struct bufferevent *bufev)
+{
+ return bufev->ev_base;
+}
+
+int
+bufferevent_get_priority(const struct bufferevent *bufev)
+{
+ if (event_initialized(&bufev->ev_read)) {
+ return event_get_priority(&bufev->ev_read);
+ } else {
+ return event_base_get_npriorities(bufev->ev_base) / 2;
+ }
+}
+
+int
+bufferevent_write(struct bufferevent *bufev, const void *data, size_t size)
+{
+ if (evbuffer_add(bufev->output, data, size) == -1)
+ return (-1);
+
+ return 0;
+}
+
+int
+bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf)
+{
+ if (evbuffer_add_buffer(bufev->output, buf) == -1)
+ return (-1);
+
+ return 0;
+}
+
+size_t
+bufferevent_read(struct bufferevent *bufev, void *data, size_t size)
+{
+ return (evbuffer_remove(bufev->input, data, size));
+}
+
+int
+bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf)
+{
+ return (evbuffer_add_buffer(buf, bufev->input));
+}
+
+int
+bufferevent_enable(struct bufferevent *bufev, short event)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ short impl_events = event;
+ int r = 0;
+
+ bufferevent_incref_and_lock_(bufev);
+ if (bufev_private->read_suspended)
+ impl_events &= ~EV_READ;
+ if (bufev_private->write_suspended)
+ impl_events &= ~EV_WRITE;
+
+ bufev->enabled |= event;
+
+ if (impl_events && bufev->be_ops->enable(bufev, impl_events) < 0)
+ r = -1;
+
+ bufferevent_decref_and_unlock_(bufev);
+ return r;
+}
+
+int
+bufferevent_set_timeouts(struct bufferevent *bufev,
+ const struct timeval *tv_read,
+ const struct timeval *tv_write)
+{
+ int r = 0;
+ BEV_LOCK(bufev);
+ if (tv_read) {
+ bufev->timeout_read = *tv_read;
+ } else {
+ evutil_timerclear(&bufev->timeout_read);
+ }
+ if (tv_write) {
+ bufev->timeout_write = *tv_write;
+ } else {
+ evutil_timerclear(&bufev->timeout_write);
+ }
+
+ if (bufev->be_ops->adj_timeouts)
+ r = bufev->be_ops->adj_timeouts(bufev);
+ BEV_UNLOCK(bufev);
+
+ return r;
+}
+
+
+/* Obsolete; use bufferevent_set_timeouts */
+void
+bufferevent_settimeout(struct bufferevent *bufev,
+ int timeout_read, int timeout_write)
+{
+ struct timeval tv_read, tv_write;
+ struct timeval *ptv_read = NULL, *ptv_write = NULL;
+
+ memset(&tv_read, 0, sizeof(tv_read));
+ memset(&tv_write, 0, sizeof(tv_write));
+
+ if (timeout_read) {
+ tv_read.tv_sec = timeout_read;
+ ptv_read = &tv_read;
+ }
+ if (timeout_write) {
+ tv_write.tv_sec = timeout_write;
+ ptv_write = &tv_write;
+ }
+
+ bufferevent_set_timeouts(bufev, ptv_read, ptv_write);
+}
+
+
+int
+bufferevent_disable_hard_(struct bufferevent *bufev, short event)
+{
+ int r = 0;
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ bufev->enabled &= ~event;
+
+ bufev_private->connecting = 0;
+ if (bufev->be_ops->disable(bufev, event) < 0)
+ r = -1;
+
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+int
+bufferevent_disable(struct bufferevent *bufev, short event)
+{
+ int r = 0;
+
+ BEV_LOCK(bufev);
+ bufev->enabled &= ~event;
+
+ if (bufev->be_ops->disable(bufev, event) < 0)
+ r = -1;
+
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+/*
+ * Sets the water marks
+ */
+
+void
+bufferevent_setwatermark(struct bufferevent *bufev, short events,
+ size_t lowmark, size_t highmark)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ if (events & EV_WRITE) {
+ bufev->wm_write.low = lowmark;
+ bufev->wm_write.high = highmark;
+ }
+
+ if (events & EV_READ) {
+ bufev->wm_read.low = lowmark;
+ bufev->wm_read.high = highmark;
+
+ if (highmark) {
+ /* There is now a new high-water mark for read.
+ enable the callback if needed, and see if we should
+ suspend/bufferevent_wm_unsuspend. */
+
+ if (bufev_private->read_watermarks_cb == NULL) {
+ bufev_private->read_watermarks_cb =
+ evbuffer_add_cb(bufev->input,
+ bufferevent_inbuf_wm_cb,
+ bufev);
+ }
+ evbuffer_cb_set_flags(bufev->input,
+ bufev_private->read_watermarks_cb,
+ EVBUFFER_CB_ENABLED|EVBUFFER_CB_NODEFER);
+
+ if (evbuffer_get_length(bufev->input) > highmark)
+ bufferevent_wm_suspend_read(bufev);
+ else if (evbuffer_get_length(bufev->input) < highmark)
+ bufferevent_wm_unsuspend_read(bufev);
+ } else {
+ /* There is now no high-water mark for read. */
+ if (bufev_private->read_watermarks_cb)
+ evbuffer_cb_clear_flags(bufev->input,
+ bufev_private->read_watermarks_cb,
+ EVBUFFER_CB_ENABLED);
+ bufferevent_wm_unsuspend_read(bufev);
+ }
+ }
+ BEV_UNLOCK(bufev);
+}
+
+void
+bufferevent_getwatermark(struct bufferevent *bufev, short events,
+ size_t *lowmark, size_t *highmark)
+{
+ BEV_LOCK(bufev);
+ if (events == EV_WRITE) {
+ if (lowmark)
+ *lowmark = bufev->wm_write.low;
+ if (highmark)
+ *highmark = bufev->wm_write.high;
+ }
+
+ if (events == EV_READ) {
+ if (lowmark)
+ *lowmark = bufev->wm_read.low;
+ if (highmark)
+ *highmark = bufev->wm_read.high;
+ }
+ BEV_UNLOCK(bufev);
+}
+
+int
+bufferevent_flush(struct bufferevent *bufev,
+ short iotype,
+ enum bufferevent_flush_mode mode)
+{
+ int r = -1;
+ BEV_LOCK(bufev);
+ if (bufev->be_ops->flush)
+ r = bufev->be_ops->flush(bufev, iotype, mode);
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+void
+bufferevent_incref_and_lock_(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_private =
+ BEV_UPCAST(bufev);
+ BEV_LOCK(bufev);
+ ++bufev_private->refcnt;
+}
+
+#if 0
+static void
+bufferevent_transfer_lock_ownership_(struct bufferevent *donor,
+ struct bufferevent *recipient)
+{
+ struct bufferevent_private *d = BEV_UPCAST(donor);
+ struct bufferevent_private *r = BEV_UPCAST(recipient);
+ if (d->lock != r->lock)
+ return;
+ if (r->own_lock)
+ return;
+ if (d->own_lock) {
+ d->own_lock = 0;
+ r->own_lock = 1;
+ }
+}
+#endif
+
+int
+bufferevent_decref_and_unlock_(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ int n_cbs = 0;
+#define MAX_CBS 16
+ struct event_callback *cbs[MAX_CBS];
+
+ EVUTIL_ASSERT(bufev_private->refcnt > 0);
+
+ if (--bufev_private->refcnt) {
+ BEV_UNLOCK(bufev);
+ return 0;
+ }
+
+ if (bufev->be_ops->unlink)
+ bufev->be_ops->unlink(bufev);
+
+ /* Okay, we're out of references. Let's finalize this once all the
+ * callbacks are done running. */
+ cbs[0] = &bufev->ev_read.ev_evcallback;
+ cbs[1] = &bufev->ev_write.ev_evcallback;
+ cbs[2] = &bufev_private->deferred;
+ n_cbs = 3;
+ if (bufev_private->rate_limiting) {
+ struct event *e = &bufev_private->rate_limiting->refill_bucket_event;
+ if (event_initialized(e))
+ cbs[n_cbs++] = &e->ev_evcallback;
+ }
+ n_cbs += evbuffer_get_callbacks_(bufev->input, cbs+n_cbs, MAX_CBS-n_cbs);
+ n_cbs += evbuffer_get_callbacks_(bufev->output, cbs+n_cbs, MAX_CBS-n_cbs);
+
+ event_callback_finalize_many_(bufev->ev_base, n_cbs, cbs,
+ bufferevent_finalize_cb_);
+
+#undef MAX_CBS
+ BEV_UNLOCK(bufev);
+
+ return 1;
+}
+
+static void
+bufferevent_finalize_cb_(struct event_callback *evcb, void *arg_)
+{
+ struct bufferevent *bufev = arg_;
+ struct bufferevent *underlying;
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ underlying = bufferevent_get_underlying(bufev);
+
+ /* Clean up the shared info */
+ if (bufev->be_ops->destruct)
+ bufev->be_ops->destruct(bufev);
+
+ /* XXX what happens if refcnt for these buffers is > 1?
+ * The buffers can share a lock with this bufferevent object,
+ * but the lock might be destroyed below. */
+ /* evbuffer will free the callbacks */
+ evbuffer_free(bufev->input);
+ evbuffer_free(bufev->output);
+
+ if (bufev_private->rate_limiting) {
+ if (bufev_private->rate_limiting->group)
+ bufferevent_remove_from_rate_limit_group_internal_(bufev,0);
+ mm_free(bufev_private->rate_limiting);
+ bufev_private->rate_limiting = NULL;
+ }
+
+
+ BEV_UNLOCK(bufev);
+
+ if (bufev_private->own_lock)
+ EVTHREAD_FREE_LOCK(bufev_private->lock,
+ EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ /* Free the actual allocated memory. */
+ mm_free(((char*)bufev) - bufev->be_ops->mem_offset);
+
+ /* Release the reference to underlying now that we no longer need the
+ * reference to it. We wait this long mainly in case our lock is
+ * shared with underlying.
+ *
+ * The 'destruct' function will also drop a reference to underlying
+ * if BEV_OPT_CLOSE_ON_FREE is set.
+ *
+ * XXX Should we/can we just refcount evbuffer/bufferevent locks?
+ * It would probably save us some headaches.
+ */
+ if (underlying)
+ bufferevent_decref_(underlying);
+}
+
+int
+bufferevent_decref_(struct bufferevent *bufev)
+{
+ BEV_LOCK(bufev);
+ return bufferevent_decref_and_unlock_(bufev);
+}
+
+void
+bufferevent_free(struct bufferevent *bufev)
+{
+ BEV_LOCK(bufev);
+ bufferevent_setcb(bufev, NULL, NULL, NULL, NULL);
+ bufferevent_cancel_all_(bufev);
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+void
+bufferevent_incref_(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_private =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ ++bufev_private->refcnt;
+ BEV_UNLOCK(bufev);
+}
+
+int
+bufferevent_enable_locking_(struct bufferevent *bufev, void *lock)
+{
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+ return -1;
+#else
+ struct bufferevent *underlying;
+
+ if (BEV_UPCAST(bufev)->lock)
+ return -1;
+ underlying = bufferevent_get_underlying(bufev);
+
+ if (!lock && underlying && BEV_UPCAST(underlying)->lock) {
+ lock = BEV_UPCAST(underlying)->lock;
+ BEV_UPCAST(bufev)->lock = lock;
+ BEV_UPCAST(bufev)->own_lock = 0;
+ } else if (!lock) {
+ EVTHREAD_ALLOC_LOCK(lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ if (!lock)
+ return -1;
+ BEV_UPCAST(bufev)->lock = lock;
+ BEV_UPCAST(bufev)->own_lock = 1;
+ } else {
+ BEV_UPCAST(bufev)->lock = lock;
+ BEV_UPCAST(bufev)->own_lock = 0;
+ }
+ evbuffer_enable_locking(bufev->input, lock);
+ evbuffer_enable_locking(bufev->output, lock);
+
+ if (underlying && !BEV_UPCAST(underlying)->lock)
+ bufferevent_enable_locking_(underlying, lock);
+
+ return 0;
+#endif
+}
+
+int
+bufferevent_setfd(struct bufferevent *bev, evutil_socket_t fd)
+{
+ union bufferevent_ctrl_data d;
+ int res = -1;
+ d.fd = fd;
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ res = bev->be_ops->ctrl(bev, BEV_CTRL_SET_FD, &d);
+ BEV_UNLOCK(bev);
+ return res;
+}
+
+evutil_socket_t
+bufferevent_getfd(struct bufferevent *bev)
+{
+ union bufferevent_ctrl_data d;
+ int res = -1;
+ d.fd = -1;
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ res = bev->be_ops->ctrl(bev, BEV_CTRL_GET_FD, &d);
+ BEV_UNLOCK(bev);
+ return (res<0) ? -1 : d.fd;
+}
+
+enum bufferevent_options
+bufferevent_get_options_(struct bufferevent *bev)
+{
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ enum bufferevent_options options;
+
+ BEV_LOCK(bev);
+ options = bev_p->options;
+ BEV_UNLOCK(bev);
+ return options;
+}
+
+
+static void
+bufferevent_cancel_all_(struct bufferevent *bev)
+{
+ union bufferevent_ctrl_data d;
+ memset(&d, 0, sizeof(d));
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ bev->be_ops->ctrl(bev, BEV_CTRL_CANCEL_ALL, &d);
+ BEV_UNLOCK(bev);
+}
+
+short
+bufferevent_get_enabled(struct bufferevent *bufev)
+{
+ short r;
+ BEV_LOCK(bufev);
+ r = bufev->enabled;
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+struct bufferevent *
+bufferevent_get_underlying(struct bufferevent *bev)
+{
+ union bufferevent_ctrl_data d;
+ int res = -1;
+ d.ptr = NULL;
+ BEV_LOCK(bev);
+ if (bev->be_ops->ctrl)
+ res = bev->be_ops->ctrl(bev, BEV_CTRL_GET_UNDERLYING, &d);
+ BEV_UNLOCK(bev);
+ return (res<0) ? NULL : d.ptr;
+}
+
+static void
+bufferevent_generic_read_timeout_cb(evutil_socket_t fd, short event, void *ctx)
+{
+ struct bufferevent *bev = ctx;
+ bufferevent_incref_and_lock_(bev);
+ bufferevent_disable(bev, EV_READ);
+ bufferevent_run_eventcb_(bev, BEV_EVENT_TIMEOUT|BEV_EVENT_READING, 0);
+ bufferevent_decref_and_unlock_(bev);
+}
+static void
+bufferevent_generic_write_timeout_cb(evutil_socket_t fd, short event, void *ctx)
+{
+ struct bufferevent *bev = ctx;
+ bufferevent_incref_and_lock_(bev);
+ bufferevent_disable(bev, EV_WRITE);
+ bufferevent_run_eventcb_(bev, BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING, 0);
+ bufferevent_decref_and_unlock_(bev);
+}
+
+void
+bufferevent_init_generic_timeout_cbs_(struct bufferevent *bev)
+{
+ event_assign(&bev->ev_read, bev->ev_base, -1, EV_FINALIZE,
+ bufferevent_generic_read_timeout_cb, bev);
+ event_assign(&bev->ev_write, bev->ev_base, -1, EV_FINALIZE,
+ bufferevent_generic_write_timeout_cb, bev);
+}
+
+int
+bufferevent_generic_adj_timeouts_(struct bufferevent *bev)
+{
+ const short enabled = bev->enabled;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ int r1=0, r2=0;
+ if ((enabled & EV_READ) && !bev_p->read_suspended &&
+ evutil_timerisset(&bev->timeout_read))
+ r1 = event_add(&bev->ev_read, &bev->timeout_read);
+ else
+ r1 = event_del(&bev->ev_read);
+
+ if ((enabled & EV_WRITE) && !bev_p->write_suspended &&
+ evutil_timerisset(&bev->timeout_write) &&
+ evbuffer_get_length(bev->output))
+ r2 = event_add(&bev->ev_write, &bev->timeout_write);
+ else
+ r2 = event_del(&bev->ev_write);
+ if (r1 < 0 || r2 < 0)
+ return -1;
+ return 0;
+}
+
+int
+bufferevent_add_event_(struct event *ev, const struct timeval *tv)
+{
+ if (tv->tv_sec == 0 && tv->tv_usec == 0)
+ return event_add(ev, NULL);
+ else
+ return event_add(ev, tv);
+}
+
+/* For use by user programs only; internally, we should be calling
+ either bufferevent_incref_and_lock_(), or BEV_LOCK. */
+void
+bufferevent_lock(struct bufferevent *bev)
+{
+ bufferevent_incref_and_lock_(bev);
+}
+
+void
+bufferevent_unlock(struct bufferevent *bev)
+{
+ bufferevent_decref_and_unlock_(bev);
+}
diff --git a/sntp/libevent/bufferevent_async.c b/sntp/libevent/bufferevent_async.c
new file mode 100644
index 0000000..137ad24
--- /dev/null
+++ b/sntp/libevent/bufferevent_async.c
@@ -0,0 +1,684 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+#include <sys/queue.h>
+
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/event.h"
+#include "event2/util.h"
+#include "event-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "util-internal.h"
+#include "iocp-internal.h"
+
+#ifndef SO_UPDATE_CONNECT_CONTEXT
+/* Mingw is sometimes missing this */
+#define SO_UPDATE_CONNECT_CONTEXT 0x7010
+#endif
+
+/* prototypes */
+static int be_async_enable(struct bufferevent *, short);
+static int be_async_disable(struct bufferevent *, short);
+static void be_async_destruct(struct bufferevent *);
+static int be_async_flush(struct bufferevent *, short, enum bufferevent_flush_mode);
+static int be_async_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+struct bufferevent_async {
+ struct bufferevent_private bev;
+ struct event_overlapped connect_overlapped;
+ struct event_overlapped read_overlapped;
+ struct event_overlapped write_overlapped;
+ size_t read_in_progress;
+ size_t write_in_progress;
+ unsigned ok : 1;
+ unsigned read_added : 1;
+ unsigned write_added : 1;
+};
+
+const struct bufferevent_ops bufferevent_ops_async = {
+ "socket_async",
+ evutil_offsetof(struct bufferevent_async, bev.bev),
+ be_async_enable,
+ be_async_disable,
+ NULL, /* Unlink */
+ be_async_destruct,
+ bufferevent_generic_adj_timeouts_,
+ be_async_flush,
+ be_async_ctrl,
+};
+
+static inline struct bufferevent_async *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_async *bev_a;
+ if (bev->be_ops != &bufferevent_ops_async)
+ return NULL;
+ bev_a = EVUTIL_UPCAST(bev, struct bufferevent_async, bev.bev);
+ return bev_a;
+}
+
+static inline struct bufferevent_async *
+upcast_connect(struct event_overlapped *eo)
+{
+ struct bufferevent_async *bev_a;
+ bev_a = EVUTIL_UPCAST(eo, struct bufferevent_async, connect_overlapped);
+ EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev));
+ return bev_a;
+}
+
+static inline struct bufferevent_async *
+upcast_read(struct event_overlapped *eo)
+{
+ struct bufferevent_async *bev_a;
+ bev_a = EVUTIL_UPCAST(eo, struct bufferevent_async, read_overlapped);
+ EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev));
+ return bev_a;
+}
+
+static inline struct bufferevent_async *
+upcast_write(struct event_overlapped *eo)
+{
+ struct bufferevent_async *bev_a;
+ bev_a = EVUTIL_UPCAST(eo, struct bufferevent_async, write_overlapped);
+ EVUTIL_ASSERT(BEV_IS_ASYNC(&bev_a->bev.bev));
+ return bev_a;
+}
+
+static void
+bev_async_del_write(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (beva->write_added) {
+ beva->write_added = 0;
+ event_base_del_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_del_read(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (beva->read_added) {
+ beva->read_added = 0;
+ event_base_del_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_add_write(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (!beva->write_added) {
+ beva->write_added = 1;
+ event_base_add_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_add_read(struct bufferevent_async *beva)
+{
+ struct bufferevent *bev = &beva->bev.bev;
+
+ if (!beva->read_added) {
+ beva->read_added = 1;
+ event_base_add_virtual_(bev->ev_base);
+ }
+}
+
+static void
+bev_async_consider_writing(struct bufferevent_async *beva)
+{
+ size_t at_most;
+ int limit;
+ struct bufferevent *bev = &beva->bev.bev;
+
+ /* Don't write if there's a write in progress, or we do not
+ * want to write, or when there's nothing left to write. */
+ if (beva->write_in_progress || beva->bev.connecting)
+ return;
+ if (!beva->ok || !(bev->enabled&EV_WRITE) ||
+ !evbuffer_get_length(bev->output)) {
+ bev_async_del_write(beva);
+ return;
+ }
+
+ at_most = evbuffer_get_length(bev->output);
+
+ /* This is safe so long as bufferevent_get_write_max never returns
+ * more than INT_MAX. That's true for now. XXXX */
+ limit = (int)bufferevent_get_write_max_(&beva->bev);
+ if (at_most >= (size_t)limit && limit >= 0)
+ at_most = limit;
+
+ if (beva->bev.write_suspended) {
+ bev_async_del_write(beva);
+ return;
+ }
+
+ /* XXXX doesn't respect low-water mark very well. */
+ bufferevent_incref_(bev);
+ if (evbuffer_launch_write_(bev->output, at_most,
+ &beva->write_overlapped)) {
+ bufferevent_decref_(bev);
+ beva->ok = 0;
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ } else {
+ beva->write_in_progress = at_most;
+ bufferevent_decrement_write_buckets_(&beva->bev, at_most);
+ bev_async_add_write(beva);
+ }
+}
+
+static void
+bev_async_consider_reading(struct bufferevent_async *beva)
+{
+ size_t cur_size;
+ size_t read_high;
+ size_t at_most;
+ int limit;
+ struct bufferevent *bev = &beva->bev.bev;
+
+ /* Don't read if there is a read in progress, or we do not
+ * want to read. */
+ if (beva->read_in_progress || beva->bev.connecting)
+ return;
+ if (!beva->ok || !(bev->enabled&EV_READ)) {
+ bev_async_del_read(beva);
+ return;
+ }
+
+ /* Don't read if we're full */
+ cur_size = evbuffer_get_length(bev->input);
+ read_high = bev->wm_read.high;
+ if (read_high) {
+ if (cur_size >= read_high) {
+ bev_async_del_read(beva);
+ return;
+ }
+ at_most = read_high - cur_size;
+ } else {
+ at_most = 16384; /* FIXME totally magic. */
+ }
+
+ /* XXXX This over-commits. */
+ /* XXXX see also not above on cast on bufferevent_get_write_max_() */
+ limit = (int)bufferevent_get_read_max_(&beva->bev);
+ if (at_most >= (size_t)limit && limit >= 0)
+ at_most = limit;
+
+ if (beva->bev.read_suspended) {
+ bev_async_del_read(beva);
+ return;
+ }
+
+ bufferevent_incref_(bev);
+ if (evbuffer_launch_read_(bev->input, at_most, &beva->read_overlapped)) {
+ beva->ok = 0;
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ bufferevent_decref_(bev);
+ } else {
+ beva->read_in_progress = at_most;
+ bufferevent_decrement_read_buckets_(&beva->bev, at_most);
+ bev_async_add_read(beva);
+ }
+
+ return;
+}
+
+static void
+be_async_outbuf_callback(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bev = arg;
+ struct bufferevent_async *bev_async = upcast(bev);
+
+ /* If we added data to the outbuf and were not writing before,
+ * we may want to write now. */
+
+ bufferevent_incref_and_lock_(bev);
+
+ if (cbinfo->n_added)
+ bev_async_consider_writing(bev_async);
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static void
+be_async_inbuf_callback(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bev = arg;
+ struct bufferevent_async *bev_async = upcast(bev);
+
+ /* If we drained data from the inbuf and were not reading before,
+ * we may want to read now */
+
+ bufferevent_incref_and_lock_(bev);
+
+ if (cbinfo->n_deleted)
+ bev_async_consider_reading(bev_async);
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static int
+be_async_enable(struct bufferevent *buf, short what)
+{
+ struct bufferevent_async *bev_async = upcast(buf);
+
+ if (!bev_async->ok)
+ return -1;
+
+ if (bev_async->bev.connecting) {
+ /* Don't launch anything during connection attempts. */
+ return 0;
+ }
+
+ if (what & EV_READ)
+ BEV_RESET_GENERIC_READ_TIMEOUT(buf);
+ if (what & EV_WRITE)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(buf);
+
+ /* If we newly enable reading or writing, and we aren't reading or
+ writing already, consider launching a new read or write. */
+
+ if (what & EV_READ)
+ bev_async_consider_reading(bev_async);
+ if (what & EV_WRITE)
+ bev_async_consider_writing(bev_async);
+ return 0;
+}
+
+static int
+be_async_disable(struct bufferevent *bev, short what)
+{
+ struct bufferevent_async *bev_async = upcast(bev);
+ /* XXXX If we disable reading or writing, we may want to consider
+ * canceling any in-progress read or write operation, though it might
+ * not work. */
+
+ if (what & EV_READ) {
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ bev_async_del_read(bev_async);
+ }
+ if (what & EV_WRITE) {
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ bev_async_del_write(bev_async);
+ }
+
+ return 0;
+}
+
+static void
+be_async_destruct(struct bufferevent *bev)
+{
+ struct bufferevent_async *bev_async = upcast(bev);
+ struct bufferevent_private *bev_p = BEV_UPCAST(bev);
+ evutil_socket_t fd;
+
+ EVUTIL_ASSERT(!upcast(bev)->write_in_progress &&
+ !upcast(bev)->read_in_progress);
+
+ bev_async_del_read(bev_async);
+ bev_async_del_write(bev_async);
+
+ fd = evbuffer_overlapped_get_fd_(bev->input);
+ if (bev_p->options & BEV_OPT_CLOSE_ON_FREE) {
+ /* XXXX possible double-close */
+ evutil_closesocket(fd);
+ }
+}
+
+/* GetQueuedCompletionStatus doesn't reliably yield WSA error codes, so
+ * we use WSAGetOverlappedResult to translate. */
+static void
+bev_async_set_wsa_error(struct bufferevent *bev, struct event_overlapped *eo)
+{
+ DWORD bytes, flags;
+ evutil_socket_t fd;
+
+ fd = evbuffer_overlapped_get_fd_(bev->input);
+ WSAGetOverlappedResult(fd, &eo->overlapped, &bytes, FALSE, &flags);
+}
+
+static int
+be_async_flush(struct bufferevent *bev, short what,
+ enum bufferevent_flush_mode mode)
+{
+ return 0;
+}
+
+static void
+connect_complete(struct event_overlapped *eo, ev_uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ struct bufferevent_async *bev_a = upcast_connect(eo);
+ struct bufferevent *bev = &bev_a->bev.bev;
+ evutil_socket_t sock;
+
+ BEV_LOCK(bev);
+
+ EVUTIL_ASSERT(bev_a->bev.connecting);
+ bev_a->bev.connecting = 0;
+ sock = evbuffer_overlapped_get_fd_(bev_a->bev.bev.input);
+ /* XXXX Handle error? */
+ setsockopt(sock, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0);
+
+ if (ok)
+ bufferevent_async_set_connected_(bev);
+ else
+ bev_async_set_wsa_error(bev, eo);
+
+ bufferevent_run_eventcb_(bev,
+ ok? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR, 0);
+
+ event_base_del_virtual_(bev->ev_base);
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static void
+read_complete(struct event_overlapped *eo, ev_uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ struct bufferevent_async *bev_a = upcast_read(eo);
+ struct bufferevent *bev = &bev_a->bev.bev;
+ short what = BEV_EVENT_READING;
+ ev_ssize_t amount_unread;
+ BEV_LOCK(bev);
+ EVUTIL_ASSERT(bev_a->read_in_progress);
+
+ amount_unread = bev_a->read_in_progress - nbytes;
+ evbuffer_commit_read_(bev->input, nbytes);
+ bev_a->read_in_progress = 0;
+ if (amount_unread)
+ bufferevent_decrement_read_buckets_(&bev_a->bev, -amount_unread);
+
+ if (!ok)
+ bev_async_set_wsa_error(bev, eo);
+
+ if (bev_a->ok) {
+ if (ok && nbytes) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ bufferevent_trigger_nolock_(bev, EV_READ, 0);
+ bev_async_consider_reading(bev_a);
+ } else if (!ok) {
+ what |= BEV_EVENT_ERROR;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ } else if (!nbytes) {
+ what |= BEV_EVENT_EOF;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ }
+ }
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static void
+write_complete(struct event_overlapped *eo, ev_uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ struct bufferevent_async *bev_a = upcast_write(eo);
+ struct bufferevent *bev = &bev_a->bev.bev;
+ short what = BEV_EVENT_WRITING;
+ ev_ssize_t amount_unwritten;
+
+ BEV_LOCK(bev);
+ EVUTIL_ASSERT(bev_a->write_in_progress);
+
+ amount_unwritten = bev_a->write_in_progress - nbytes;
+ evbuffer_commit_write_(bev->output, nbytes);
+ bev_a->write_in_progress = 0;
+
+ if (amount_unwritten)
+ bufferevent_decrement_write_buckets_(&bev_a->bev,
+ -amount_unwritten);
+
+
+ if (!ok)
+ bev_async_set_wsa_error(bev, eo);
+
+ if (bev_a->ok) {
+ if (ok && nbytes) {
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+ bufferevent_trigger_nolock_(bev, EV_WRITE, 0);
+ bev_async_consider_writing(bev_a);
+ } else if (!ok) {
+ what |= BEV_EVENT_ERROR;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ } else if (!nbytes) {
+ what |= BEV_EVENT_EOF;
+ bev_a->ok = 0;
+ bufferevent_run_eventcb_(bev, what, 0);
+ }
+ }
+
+ bufferevent_decref_and_unlock_(bev);
+}
+
+struct bufferevent *
+bufferevent_async_new_(struct event_base *base,
+ evutil_socket_t fd, int options)
+{
+ struct bufferevent_async *bev_a;
+ struct bufferevent *bev;
+ struct event_iocp_port *iocp;
+
+ options |= BEV_OPT_THREADSAFE;
+
+ if (!(iocp = event_base_get_iocp_(base)))
+ return NULL;
+
+ if (fd >= 0 && event_iocp_port_associate_(iocp, fd, 1)<0) {
+ int err = GetLastError();
+ /* We may have alrady associated this fd with a port.
+ * Let's hope it's this port, and that the error code
+ * for doing this neer changes. */
+ if (err != ERROR_INVALID_PARAMETER)
+ return NULL;
+ }
+
+ if (!(bev_a = mm_calloc(1, sizeof(struct bufferevent_async))))
+ return NULL;
+
+ bev = &bev_a->bev.bev;
+ if (!(bev->input = evbuffer_overlapped_new_(fd))) {
+ mm_free(bev_a);
+ return NULL;
+ }
+ if (!(bev->output = evbuffer_overlapped_new_(fd))) {
+ evbuffer_free(bev->input);
+ mm_free(bev_a);
+ return NULL;
+ }
+
+ if (bufferevent_init_common_(&bev_a->bev, base, &bufferevent_ops_async,
+ options)<0)
+ goto err;
+
+ evbuffer_add_cb(bev->input, be_async_inbuf_callback, bev);
+ evbuffer_add_cb(bev->output, be_async_outbuf_callback, bev);
+
+ event_overlapped_init_(&bev_a->connect_overlapped, connect_complete);
+ event_overlapped_init_(&bev_a->read_overlapped, read_complete);
+ event_overlapped_init_(&bev_a->write_overlapped, write_complete);
+
+ bev_a->ok = fd >= 0;
+ if (bev_a->ok)
+ bufferevent_init_generic_timeout_cbs_(bev);
+
+ return bev;
+err:
+ bufferevent_free(&bev_a->bev.bev);
+ return NULL;
+}
+
+void
+bufferevent_async_set_connected_(struct bufferevent *bev)
+{
+ struct bufferevent_async *bev_async = upcast(bev);
+ bev_async->ok = 1;
+ bufferevent_init_generic_timeout_cbs_(bev);
+ /* Now's a good time to consider reading/writing */
+ be_async_enable(bev, bev->enabled);
+}
+
+int
+bufferevent_async_can_connect_(struct bufferevent *bev)
+{
+ const struct win32_extension_fns *ext =
+ event_get_win32_extension_fns_();
+
+ if (BEV_IS_ASYNC(bev) &&
+ event_base_get_iocp_(bev->ev_base) &&
+ ext && ext->ConnectEx)
+ return 1;
+
+ return 0;
+}
+
+int
+bufferevent_async_connect_(struct bufferevent *bev, evutil_socket_t fd,
+ const struct sockaddr *sa, int socklen)
+{
+ BOOL rc;
+ struct bufferevent_async *bev_async = upcast(bev);
+ struct sockaddr_storage ss;
+ const struct win32_extension_fns *ext =
+ event_get_win32_extension_fns_();
+
+ EVUTIL_ASSERT(ext && ext->ConnectEx && fd >= 0 && sa != NULL);
+
+ /* ConnectEx() requires that the socket be bound to an address
+ * with bind() before using, otherwise it will fail. We attempt
+ * to issue a bind() here, taking into account that the error
+ * code is set to WSAEINVAL when the socket is already bound. */
+ memset(&ss, 0, sizeof(ss));
+ if (sa->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)&ss;
+ sin->sin_family = AF_INET;
+ sin->sin_addr.s_addr = INADDR_ANY;
+ } else if (sa->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&ss;
+ sin6->sin6_family = AF_INET6;
+ sin6->sin6_addr = in6addr_any;
+ } else {
+ /* Well, the user will have to bind() */
+ return -1;
+ }
+ if (bind(fd, (struct sockaddr *)&ss, sizeof(ss)) < 0 &&
+ WSAGetLastError() != WSAEINVAL)
+ return -1;
+
+ event_base_add_virtual_(bev->ev_base);
+ bufferevent_incref_(bev);
+ rc = ext->ConnectEx(fd, sa, socklen, NULL, 0, NULL,
+ &bev_async->connect_overlapped.overlapped);
+ if (rc || WSAGetLastError() == ERROR_IO_PENDING)
+ return 0;
+
+ event_base_del_virtual_(bev->ev_base);
+ bufferevent_decref_(bev);
+
+ return -1;
+}
+
+static int
+be_async_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
+ union bufferevent_ctrl_data *data)
+{
+ switch (op) {
+ case BEV_CTRL_GET_FD:
+ data->fd = evbuffer_overlapped_get_fd_(bev->input);
+ return 0;
+ case BEV_CTRL_SET_FD: {
+ struct event_iocp_port *iocp;
+
+ if (data->fd == evbuffer_overlapped_get_fd_(bev->input))
+ return 0;
+ if (!(iocp = event_base_get_iocp_(bev->ev_base)))
+ return -1;
+ if (event_iocp_port_associate_(iocp, data->fd, 1) < 0)
+ return -1;
+ evbuffer_overlapped_set_fd_(bev->input, data->fd);
+ evbuffer_overlapped_set_fd_(bev->output, data->fd);
+ return 0;
+ }
+ case BEV_CTRL_CANCEL_ALL: {
+ struct bufferevent_async *bev_a = upcast(bev);
+ evutil_socket_t fd = evbuffer_overlapped_get_fd_(bev->input);
+ if (fd != (evutil_socket_t)INVALID_SOCKET &&
+ (bev_a->bev.options & BEV_OPT_CLOSE_ON_FREE)) {
+ closesocket(fd);
+ }
+ bev_a->ok = 0;
+ return 0;
+ }
+ case BEV_CTRL_GET_UNDERLYING:
+ default:
+ return -1;
+ }
+}
+
+
diff --git a/sntp/libevent/bufferevent_filter.c b/sntp/libevent/bufferevent_filter.c
new file mode 100644
index 0000000..af71ebe
--- /dev/null
+++ b/sntp/libevent/bufferevent_filter.c
@@ -0,0 +1,518 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright (c) 2002-2006 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#include "event2/event-config.h"
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/event.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "util-internal.h"
+
+/* prototypes */
+static int be_filter_enable(struct bufferevent *, short);
+static int be_filter_disable(struct bufferevent *, short);
+static void be_filter_unlink(struct bufferevent *);
+static void be_filter_destruct(struct bufferevent *);
+
+static void be_filter_readcb(struct bufferevent *, void *);
+static void be_filter_writecb(struct bufferevent *, void *);
+static void be_filter_eventcb(struct bufferevent *, short, void *);
+static int be_filter_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode);
+static int be_filter_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+static void bufferevent_filtered_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *info, void *arg);
+
+struct bufferevent_filtered {
+ struct bufferevent_private bev;
+
+ /** The bufferevent that we read/write filtered data from/to. */
+ struct bufferevent *underlying;
+ /** A callback on our outbuf to notice when somebody adds data */
+ struct evbuffer_cb_entry *outbuf_cb;
+ /** True iff we have received an EOF callback from the underlying
+ * bufferevent. */
+ unsigned got_eof;
+
+ /** Function to free context when we're done. */
+ void (*free_context)(void *);
+ /** Input filter */
+ bufferevent_filter_cb process_in;
+ /** Output filter */
+ bufferevent_filter_cb process_out;
+ /** User-supplied argument to the filters. */
+ void *context;
+};
+
+const struct bufferevent_ops bufferevent_ops_filter = {
+ "filter",
+ evutil_offsetof(struct bufferevent_filtered, bev.bev),
+ be_filter_enable,
+ be_filter_disable,
+ be_filter_unlink,
+ be_filter_destruct,
+ bufferevent_generic_adj_timeouts_,
+ be_filter_flush,
+ be_filter_ctrl,
+};
+
+/* Given a bufferevent that's really the bev filter of a bufferevent_filtered,
+ * return that bufferevent_filtered. Returns NULL otherwise.*/
+static inline struct bufferevent_filtered *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_filtered *bev_f;
+ if (bev->be_ops != &bufferevent_ops_filter)
+ return NULL;
+ bev_f = (void*)( ((char*)bev) -
+ evutil_offsetof(struct bufferevent_filtered, bev.bev));
+ EVUTIL_ASSERT(bev_f->bev.bev.be_ops == &bufferevent_ops_filter);
+ return bev_f;
+}
+
+#define downcast(bev_f) (&(bev_f)->bev.bev)
+
+/** Return 1 iff bevf's underlying bufferevent's output buffer is at or
+ * over its high watermark such that we should not write to it in a given
+ * flush mode. */
+static int
+be_underlying_writebuf_full(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state)
+{
+ struct bufferevent *u = bevf->underlying;
+ return state == BEV_NORMAL &&
+ u->wm_write.high &&
+ evbuffer_get_length(u->output) >= u->wm_write.high;
+}
+
+/** Return 1 if our input buffer is at or over its high watermark such that we
+ * should not write to it in a given flush mode. */
+static int
+be_readbuf_full(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state)
+{
+ struct bufferevent *bufev = downcast(bevf);
+ return state == BEV_NORMAL &&
+ bufev->wm_read.high &&
+ evbuffer_get_length(bufev->input) >= bufev->wm_read.high;
+}
+
+
+/* Filter to use when we're created with a NULL filter. */
+static enum bufferevent_filter_result
+be_null_filter(struct evbuffer *src, struct evbuffer *dst, ev_ssize_t lim,
+ enum bufferevent_flush_mode state, void *ctx)
+{
+ (void)state;
+ if (evbuffer_remove_buffer(src, dst, lim) == 0)
+ return BEV_OK;
+ else
+ return BEV_ERROR;
+}
+
+struct bufferevent *
+bufferevent_filter_new(struct bufferevent *underlying,
+ bufferevent_filter_cb input_filter,
+ bufferevent_filter_cb output_filter,
+ int options,
+ void (*free_context)(void *),
+ void *ctx)
+{
+ struct bufferevent_filtered *bufev_f;
+ int tmp_options = options & ~BEV_OPT_THREADSAFE;
+
+ if (!underlying)
+ return NULL;
+
+ if (!input_filter)
+ input_filter = be_null_filter;
+ if (!output_filter)
+ output_filter = be_null_filter;
+
+ bufev_f = mm_calloc(1, sizeof(struct bufferevent_filtered));
+ if (!bufev_f)
+ return NULL;
+
+ if (bufferevent_init_common_(&bufev_f->bev, underlying->ev_base,
+ &bufferevent_ops_filter, tmp_options) < 0) {
+ mm_free(bufev_f);
+ return NULL;
+ }
+ if (options & BEV_OPT_THREADSAFE) {
+ bufferevent_enable_locking_(downcast(bufev_f), NULL);
+ }
+
+ bufev_f->underlying = underlying;
+
+ bufev_f->process_in = input_filter;
+ bufev_f->process_out = output_filter;
+ bufev_f->free_context = free_context;
+ bufev_f->context = ctx;
+
+ bufferevent_setcb(bufev_f->underlying,
+ be_filter_readcb, be_filter_writecb, be_filter_eventcb, bufev_f);
+
+ bufev_f->outbuf_cb = evbuffer_add_cb(downcast(bufev_f)->output,
+ bufferevent_filtered_outbuf_cb, bufev_f);
+
+ bufferevent_init_generic_timeout_cbs_(downcast(bufev_f));
+ bufferevent_incref_(underlying);
+
+ bufferevent_enable(underlying, EV_READ|EV_WRITE);
+ bufferevent_suspend_read_(underlying, BEV_SUSPEND_FILT_READ);
+
+ return downcast(bufev_f);
+}
+
+static void
+be_filter_unlink(struct bufferevent *bev)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ EVUTIL_ASSERT(bevf);
+
+ if (bevf->bev.options & BEV_OPT_CLOSE_ON_FREE) {
+ /* Yes, there is also a decref in bufferevent_decref_.
+ * That decref corresponds to the incref when we set
+ * underlying for the first time. This decref is an
+ * extra one to remove the last reference.
+ */
+ if (BEV_UPCAST(bevf->underlying)->refcnt < 2) {
+ event_warnx("BEV_OPT_CLOSE_ON_FREE set on an "
+ "bufferevent with too few references");
+ } else {
+ bufferevent_free(bevf->underlying);
+ }
+ } else {
+ if (bevf->underlying) {
+ if (bevf->underlying->errorcb == be_filter_eventcb)
+ bufferevent_setcb(bevf->underlying,
+ NULL, NULL, NULL, NULL);
+ bufferevent_unsuspend_read_(bevf->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ }
+}
+
+static void
+be_filter_destruct(struct bufferevent *bev)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ EVUTIL_ASSERT(bevf);
+ if (bevf->free_context)
+ bevf->free_context(bevf->context);
+}
+
+static int
+be_filter_enable(struct bufferevent *bev, short event)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ if (event & EV_WRITE)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+
+ if (event & EV_READ) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ bufferevent_unsuspend_read_(bevf->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ return 0;
+}
+
+static int
+be_filter_disable(struct bufferevent *bev, short event)
+{
+ struct bufferevent_filtered *bevf = upcast(bev);
+ if (event & EV_WRITE)
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ if (event & EV_READ) {
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ bufferevent_suspend_read_(bevf->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ return 0;
+}
+
+static enum bufferevent_filter_result
+be_filter_process_input(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state,
+ int *processed_out)
+{
+ enum bufferevent_filter_result res;
+ struct bufferevent *bev = downcast(bevf);
+
+ if (state == BEV_NORMAL) {
+ /* If we're in 'normal' mode, don't urge data on the filter
+ * unless we're reading data and under our high-water mark.*/
+ if (!(bev->enabled & EV_READ) ||
+ be_readbuf_full(bevf, state))
+ return BEV_OK;
+ }
+
+ do {
+ ev_ssize_t limit = -1;
+ if (state == BEV_NORMAL && bev->wm_read.high)
+ limit = bev->wm_read.high -
+ evbuffer_get_length(bev->input);
+
+ res = bevf->process_in(bevf->underlying->input,
+ bev->input, limit, state, bevf->context);
+
+ if (res == BEV_OK)
+ *processed_out = 1;
+ } while (res == BEV_OK &&
+ (bev->enabled & EV_READ) &&
+ evbuffer_get_length(bevf->underlying->input) &&
+ !be_readbuf_full(bevf, state));
+
+ if (*processed_out)
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+
+ return res;
+}
+
+
+static enum bufferevent_filter_result
+be_filter_process_output(struct bufferevent_filtered *bevf,
+ enum bufferevent_flush_mode state,
+ int *processed_out)
+{
+ /* Requires references and lock: might call writecb */
+ enum bufferevent_filter_result res = BEV_OK;
+ struct bufferevent *bufev = downcast(bevf);
+ int again = 0;
+
+ if (state == BEV_NORMAL) {
+ /* If we're in 'normal' mode, don't urge data on the
+ * filter unless we're writing data, and the underlying
+ * bufferevent is accepting data, and we have data to
+ * give the filter. If we're in 'flush' or 'finish',
+ * call the filter no matter what. */
+ if (!(bufev->enabled & EV_WRITE) ||
+ be_underlying_writebuf_full(bevf, state) ||
+ !evbuffer_get_length(bufev->output))
+ return BEV_OK;
+ }
+
+ /* disable the callback that calls this function
+ when the user adds to the output buffer. */
+ evbuffer_cb_set_flags(bufev->output, bevf->outbuf_cb, 0);
+
+ do {
+ int processed = 0;
+ again = 0;
+
+ do {
+ ev_ssize_t limit = -1;
+ if (state == BEV_NORMAL &&
+ bevf->underlying->wm_write.high)
+ limit = bevf->underlying->wm_write.high -
+ evbuffer_get_length(bevf->underlying->output);
+
+ res = bevf->process_out(downcast(bevf)->output,
+ bevf->underlying->output,
+ limit,
+ state,
+ bevf->context);
+
+ if (res == BEV_OK)
+ processed = *processed_out = 1;
+ } while (/* Stop if the filter wasn't successful...*/
+ res == BEV_OK &&
+ /* Or if we aren't writing any more. */
+ (bufev->enabled & EV_WRITE) &&
+ /* Of if we have nothing more to write and we are
+ * not flushing. */
+ evbuffer_get_length(bufev->output) &&
+ /* Or if we have filled the underlying output buffer. */
+ !be_underlying_writebuf_full(bevf,state));
+
+ if (processed) {
+ /* call the write callback.*/
+ bufferevent_trigger_nolock_(bufev, EV_WRITE, 0);
+
+ if (res == BEV_OK &&
+ (bufev->enabled & EV_WRITE) &&
+ evbuffer_get_length(bufev->output) &&
+ !be_underlying_writebuf_full(bevf, state)) {
+ again = 1;
+ }
+ }
+ } while (again);
+
+ /* reenable the outbuf_cb */
+ evbuffer_cb_set_flags(bufev->output,bevf->outbuf_cb,
+ EVBUFFER_CB_ENABLED);
+
+ if (*processed_out)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bufev);
+
+ return res;
+}
+
+/* Called when the size of our outbuf changes. */
+static void
+bufferevent_filtered_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo, void *arg)
+{
+ struct bufferevent_filtered *bevf = arg;
+ struct bufferevent *bev = downcast(bevf);
+
+ if (cbinfo->n_added) {
+ int processed_any = 0;
+ /* Somebody added more data to the output buffer. Try to
+ * process it, if we should. */
+ bufferevent_incref_and_lock_(bev);
+ be_filter_process_output(bevf, BEV_NORMAL, &processed_any);
+ bufferevent_decref_and_unlock_(bev);
+ }
+}
+
+/* Called when the underlying socket has read. */
+static void
+be_filter_readcb(struct bufferevent *underlying, void *me_)
+{
+ struct bufferevent_filtered *bevf = me_;
+ enum bufferevent_filter_result res;
+ enum bufferevent_flush_mode state;
+ struct bufferevent *bufev = downcast(bevf);
+ int processed_any = 0;
+
+ bufferevent_incref_and_lock_(bufev);
+
+ if (bevf->got_eof)
+ state = BEV_FINISHED;
+ else
+ state = BEV_NORMAL;
+
+ /* XXXX use return value */
+ res = be_filter_process_input(bevf, state, &processed_any);
+ (void)res;
+
+ /* XXX This should be in process_input, not here. There are
+ * other places that can call process-input, and they should
+ * force readcb calls as needed. */
+ if (processed_any)
+ bufferevent_trigger_nolock_(bufev, EV_READ, 0);
+
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+/* Called when the underlying socket has drained enough that we can write to
+ it. */
+static void
+be_filter_writecb(struct bufferevent *underlying, void *me_)
+{
+ struct bufferevent_filtered *bevf = me_;
+ struct bufferevent *bev = downcast(bevf);
+ int processed_any = 0;
+
+ bufferevent_incref_and_lock_(bev);
+ be_filter_process_output(bevf, BEV_NORMAL, &processed_any);
+ bufferevent_decref_and_unlock_(bev);
+}
+
+/* Called when the underlying socket has given us an error */
+static void
+be_filter_eventcb(struct bufferevent *underlying, short what, void *me_)
+{
+ struct bufferevent_filtered *bevf = me_;
+ struct bufferevent *bev = downcast(bevf);
+
+ bufferevent_incref_and_lock_(bev);
+ /* All we can really to is tell our own eventcb. */
+ bufferevent_run_eventcb_(bev, what, 0);
+ bufferevent_decref_and_unlock_(bev);
+}
+
+static int
+be_filter_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode)
+{
+ struct bufferevent_filtered *bevf = upcast(bufev);
+ int processed_any = 0;
+ EVUTIL_ASSERT(bevf);
+
+ bufferevent_incref_and_lock_(bufev);
+
+ if (iotype & EV_READ) {
+ be_filter_process_input(bevf, mode, &processed_any);
+ }
+ if (iotype & EV_WRITE) {
+ be_filter_process_output(bevf, mode, &processed_any);
+ }
+ /* XXX check the return value? */
+ /* XXX does this want to recursively call lower-level flushes? */
+ bufferevent_flush(bevf->underlying, iotype, mode);
+
+ bufferevent_decref_and_unlock_(bufev);
+
+ return processed_any;
+}
+
+static int
+be_filter_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
+ union bufferevent_ctrl_data *data)
+{
+ struct bufferevent_filtered *bevf;
+ switch (op) {
+ case BEV_CTRL_GET_UNDERLYING:
+ bevf = upcast(bev);
+ data->ptr = bevf->underlying;
+ return 0;
+ case BEV_CTRL_GET_FD:
+ case BEV_CTRL_SET_FD:
+ case BEV_CTRL_CANCEL_ALL:
+ default:
+ return -1;
+ }
+}
diff --git a/sntp/libevent/bufferevent_openssl.c b/sntp/libevent/bufferevent_openssl.c
new file mode 100644
index 0000000..423b34f
--- /dev/null
+++ b/sntp/libevent/bufferevent_openssl.c
@@ -0,0 +1,1502 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Get rid of OSX 10.7 and greater deprecation warnings.
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/bufferevent_ssl.h"
+#include "event2/buffer.h"
+#include "event2/event.h"
+
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "log-internal.h"
+
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+
+/*
+ * Define an OpenSSL bio that targets a bufferevent.
+ */
+
+/* --------------------
+ A BIO is an OpenSSL abstraction that handles reading and writing data. The
+ library will happily speak SSL over anything that implements a BIO
+ interface.
+
+ Here we define a BIO implementation that directs its output to a
+ bufferevent. We'll want to use this only when none of OpenSSL's built-in
+ IO mechanisms work for us.
+ -------------------- */
+
+/* every BIO type needs its own integer type value. */
+#define BIO_TYPE_LIBEVENT 57
+/* ???? Arguably, we should set BIO_TYPE_FILTER or BIO_TYPE_SOURCE_SINK on
+ * this. */
+
+#if 0
+static void
+print_err(int val)
+{
+ int err;
+ printf("Error was %d\n", val);
+
+ while ((err = ERR_get_error())) {
+ 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);
+
+ printf("%s in %s %s\n", msg, lib, func);
+ }
+}
+#else
+#define print_err(v) ((void)0)
+#endif
+
+/* Called to initialize a new BIO */
+static int
+bio_bufferevent_new(BIO *b)
+{
+ b->init = 0;
+ b->num = -1;
+ b->ptr = NULL; /* We'll be putting the bufferevent in this field.*/
+ b->flags = 0;
+ return 1;
+}
+
+/* Called to uninitialize the BIO. */
+static int
+bio_bufferevent_free(BIO *b)
+{
+ if (!b)
+ return 0;
+ if (b->shutdown) {
+ if (b->init && b->ptr)
+ bufferevent_free(b->ptr);
+ b->init = 0;
+ b->flags = 0;
+ b->ptr = NULL;
+ }
+ return 1;
+}
+
+/* Called to extract data from the BIO. */
+static int
+bio_bufferevent_read(BIO *b, char *out, int outlen)
+{
+ int r = 0;
+ struct evbuffer *input;
+
+ BIO_clear_retry_flags(b);
+
+ if (!out)
+ return 0;
+ if (!b->ptr)
+ return -1;
+
+ input = bufferevent_get_input(b->ptr);
+ if (evbuffer_get_length(input) == 0) {
+ /* If there's no data to read, say so. */
+ BIO_set_retry_read(b);
+ return -1;
+ } else {
+ r = evbuffer_remove(input, out, outlen);
+ }
+
+ return r;
+}
+
+/* Called to write data info the BIO */
+static int
+bio_bufferevent_write(BIO *b, const char *in, int inlen)
+{
+ struct bufferevent *bufev = b->ptr;
+ struct evbuffer *output;
+ size_t outlen;
+
+ BIO_clear_retry_flags(b);
+
+ if (!b->ptr)
+ return -1;
+
+ output = bufferevent_get_output(bufev);
+ outlen = evbuffer_get_length(output);
+
+ /* Copy only as much data onto the output buffer as can fit under the
+ * high-water mark. */
+ if (bufev->wm_write.high && bufev->wm_write.high <= (outlen+inlen)) {
+ if (bufev->wm_write.high <= outlen) {
+ /* If no data can fit, we'll need to retry later. */
+ BIO_set_retry_write(b);
+ return -1;
+ }
+ inlen = bufev->wm_write.high - outlen;
+ }
+
+ EVUTIL_ASSERT(inlen > 0);
+ evbuffer_add(output, in, inlen);
+ return inlen;
+}
+
+/* Called to handle various requests */
+static long
+bio_bufferevent_ctrl(BIO *b, int cmd, long num, void *ptr)
+{
+ struct bufferevent *bufev = b->ptr;
+ long ret = 1;
+
+ switch (cmd) {
+ case BIO_CTRL_GET_CLOSE:
+ ret = b->shutdown;
+ break;
+ case BIO_CTRL_SET_CLOSE:
+ b->shutdown = (int)num;
+ break;
+ case BIO_CTRL_PENDING:
+ ret = evbuffer_get_length(bufferevent_get_input(bufev)) != 0;
+ break;
+ case BIO_CTRL_WPENDING:
+ ret = evbuffer_get_length(bufferevent_get_output(bufev)) != 0;
+ break;
+ /* XXXX These two are given a special-case treatment because
+ * of cargo-cultism. I should come up with a better reason. */
+ case BIO_CTRL_DUP:
+ case BIO_CTRL_FLUSH:
+ ret = 1;
+ break;
+ default:
+ ret = 0;
+ break;
+ }
+ return ret;
+}
+
+/* Called to write a string to the BIO */
+static int
+bio_bufferevent_puts(BIO *b, const char *s)
+{
+ return bio_bufferevent_write(b, s, strlen(s));
+}
+
+/* Method table for the bufferevent BIO */
+static BIO_METHOD methods_bufferevent = {
+ BIO_TYPE_LIBEVENT, "bufferevent",
+ bio_bufferevent_write,
+ bio_bufferevent_read,
+ bio_bufferevent_puts,
+ NULL /* bio_bufferevent_gets */,
+ bio_bufferevent_ctrl,
+ bio_bufferevent_new,
+ bio_bufferevent_free,
+ NULL /* callback_ctrl */,
+};
+
+/* Return the method table for the bufferevents BIO */
+static BIO_METHOD *
+BIO_s_bufferevent(void)
+{
+ return &methods_bufferevent;
+}
+
+/* Create a new BIO to wrap communication around a bufferevent. If close_flag
+ * is true, the bufferevent will be freed when the BIO is closed. */
+static BIO *
+BIO_new_bufferevent(struct bufferevent *bufferevent, int close_flag)
+{
+ BIO *result;
+ if (!bufferevent)
+ return NULL;
+ if (!(result = BIO_new(BIO_s_bufferevent())))
+ return NULL;
+ result->init = 1;
+ result->ptr = bufferevent;
+ result->shutdown = close_flag ? 1 : 0;
+ return result;
+}
+
+/* --------------------
+ Now, here's the OpenSSL-based implementation of bufferevent.
+
+ The implementation comes in two flavors: one that connects its SSL object
+ to an underlying bufferevent using a BIO_bufferevent, and one that has the
+ SSL object connect to a socket directly. The latter should generally be
+ faster, except on Windows, where your best bet is using a
+ bufferevent_async.
+
+ (OpenSSL supports many other BIO types, too. But we can't use any unless
+ we have a good way to get notified when they become readable/writable.)
+ -------------------- */
+
+struct bio_data_counts {
+ unsigned long n_written;
+ unsigned long n_read;
+};
+
+struct bufferevent_openssl {
+ /* Shared fields with common bufferevent implementation code.
+ If we were set up with an underlying bufferevent, we use the
+ events here as timers only. If we have an SSL, then we use
+ the events as socket events.
+ */
+ struct bufferevent_private bev;
+ /* An underlying bufferevent that we're directing our output to.
+ If it's NULL, then we're connected to an fd, not an evbuffer. */
+ struct bufferevent *underlying;
+ /* The SSL object doing our encryption. */
+ SSL *ssl;
+
+ /* A callback that's invoked when data arrives on our outbuf so we
+ know to write data to the SSL. */
+ struct evbuffer_cb_entry *outbuf_cb;
+
+ /* A count of how much data the bios have read/written total. Used
+ for rate-limiting. */
+ struct bio_data_counts counts;
+
+ /* If this value is greater than 0, then the last SSL_write blocked,
+ * and we need to try it again with this many bytes. */
+ ev_ssize_t last_write;
+
+#define NUM_ERRORS 3
+ ev_uint32_t errors[NUM_ERRORS];
+
+ /* When we next get available space, we should say "read" instead of
+ "write". This can happen if there's a renegotiation during a read
+ operation. */
+ unsigned read_blocked_on_write : 1;
+ /* When we next get data, we should say "write" instead of "read". */
+ unsigned write_blocked_on_read : 1;
+ /* Treat TCP close before SSL close on SSL >= v3 as clean EOF. */
+ unsigned allow_dirty_shutdown : 1;
+ /* XXXX */
+ unsigned fd_is_set : 1;
+ /* XXX */
+ unsigned n_errors : 2;
+
+ /* Are we currently connecting, accepting, or doing IO? */
+ unsigned state : 2;
+};
+
+static int be_openssl_enable(struct bufferevent *, short);
+static int be_openssl_disable(struct bufferevent *, short);
+static void be_openssl_unlink(struct bufferevent *);
+static void be_openssl_destruct(struct bufferevent *);
+static int be_openssl_adj_timeouts(struct bufferevent *);
+static int be_openssl_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode);
+static int be_openssl_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+const struct bufferevent_ops bufferevent_ops_openssl = {
+ "ssl",
+ evutil_offsetof(struct bufferevent_openssl, bev.bev),
+ be_openssl_enable,
+ be_openssl_disable,
+ be_openssl_unlink,
+ be_openssl_destruct,
+ be_openssl_adj_timeouts,
+ be_openssl_flush,
+ be_openssl_ctrl,
+};
+
+/* Given a bufferevent, return a pointer to the bufferevent_openssl that
+ * contains it, if any. */
+static inline struct bufferevent_openssl *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_o;
+ if (bev->be_ops != &bufferevent_ops_openssl)
+ return NULL;
+ bev_o = (void*)( ((char*)bev) -
+ evutil_offsetof(struct bufferevent_openssl, bev.bev));
+ EVUTIL_ASSERT(bev_o->bev.bev.be_ops == &bufferevent_ops_openssl);
+ return bev_o;
+}
+
+static inline void
+put_error(struct bufferevent_openssl *bev_ssl, unsigned long err)
+{
+ if (bev_ssl->n_errors == NUM_ERRORS)
+ return;
+ /* The error type according to openssl is "unsigned long", but
+ openssl never uses more than 32 bits of it. It _can't_ use more
+ than 32 bits of it, since it needs to report errors on systems
+ where long is only 32 bits.
+ */
+ bev_ssl->errors[bev_ssl->n_errors++] = (ev_uint32_t) err;
+}
+
+/* Have the base communications channel (either the underlying bufferevent or
+ * ev_read and ev_write) start reading. Take the read-blocked-on-write flag
+ * into account. */
+static int
+start_reading(struct bufferevent_openssl *bev_ssl)
+{
+ if (bev_ssl->underlying) {
+ bufferevent_unsuspend_read_(bev_ssl->underlying,
+ BEV_SUSPEND_FILT_READ);
+ return 0;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int r;
+ r = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read);
+ if (r == 0 && bev_ssl->read_blocked_on_write)
+ r = bufferevent_add_event_(&bev->ev_write,
+ &bev->timeout_write);
+ return r;
+ }
+}
+
+/* Have the base communications channel (either the underlying bufferevent or
+ * ev_read and ev_write) start writing. Take the write-blocked-on-read flag
+ * into account. */
+static int
+start_writing(struct bufferevent_openssl *bev_ssl)
+{
+ int r = 0;
+ if (bev_ssl->underlying) {
+ ;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ r = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write);
+ if (!r && bev_ssl->write_blocked_on_read)
+ r = bufferevent_add_event_(&bev->ev_read,
+ &bev->timeout_read);
+ }
+ return r;
+}
+
+static void
+stop_reading(struct bufferevent_openssl *bev_ssl)
+{
+ if (bev_ssl->write_blocked_on_read)
+ return;
+ if (bev_ssl->underlying) {
+ bufferevent_suspend_read_(bev_ssl->underlying,
+ BEV_SUSPEND_FILT_READ);
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ event_del(&bev->ev_read);
+ }
+}
+
+static void
+stop_writing(struct bufferevent_openssl *bev_ssl)
+{
+ if (bev_ssl->read_blocked_on_write)
+ return;
+ if (bev_ssl->underlying) {
+ ;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ event_del(&bev->ev_write);
+ }
+}
+
+static int
+set_rbow(struct bufferevent_openssl *bev_ssl)
+{
+ if (!bev_ssl->underlying)
+ stop_reading(bev_ssl);
+ bev_ssl->read_blocked_on_write = 1;
+ return start_writing(bev_ssl);
+}
+
+static int
+set_wbor(struct bufferevent_openssl *bev_ssl)
+{
+ if (!bev_ssl->underlying)
+ stop_writing(bev_ssl);
+ bev_ssl->write_blocked_on_read = 1;
+ return start_reading(bev_ssl);
+}
+
+static int
+clear_rbow(struct bufferevent_openssl *bev_ssl)
+{
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int r = 0;
+ bev_ssl->read_blocked_on_write = 0;
+ if (!(bev->enabled & EV_WRITE))
+ stop_writing(bev_ssl);
+ if (bev->enabled & EV_READ)
+ r = start_reading(bev_ssl);
+ return r;
+}
+
+
+static int
+clear_wbor(struct bufferevent_openssl *bev_ssl)
+{
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int r = 0;
+ bev_ssl->write_blocked_on_read = 0;
+ if (!(bev->enabled & EV_READ))
+ stop_reading(bev_ssl);
+ if (bev->enabled & EV_WRITE)
+ r = start_writing(bev_ssl);
+ return r;
+}
+
+static void
+conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret)
+{
+ int event = BEV_EVENT_ERROR;
+ int dirty_shutdown = 0;
+ unsigned long err;
+
+ switch (errcode) {
+ case SSL_ERROR_ZERO_RETURN:
+ /* Possibly a clean shutdown. */
+ if (SSL_get_shutdown(bev_ssl->ssl) & SSL_RECEIVED_SHUTDOWN)
+ event = BEV_EVENT_EOF;
+ else
+ dirty_shutdown = 1;
+ break;
+ case SSL_ERROR_SYSCALL:
+ /* IO error; possibly a dirty shutdown. */
+ if (ret == 0 && ERR_peek_error() == 0)
+ dirty_shutdown = 1;
+ break;
+ case SSL_ERROR_SSL:
+ /* Protocol error. */
+ break;
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ /* XXXX handle this. */
+ break;
+ case SSL_ERROR_NONE:
+ case SSL_ERROR_WANT_READ:
+ case SSL_ERROR_WANT_WRITE:
+ case SSL_ERROR_WANT_CONNECT:
+ case SSL_ERROR_WANT_ACCEPT:
+ default:
+ /* should be impossible; treat as normal error. */
+ event_warnx("BUG: Unexpected OpenSSL error code %d", errcode);
+ break;
+ }
+
+ while ((err = ERR_get_error())) {
+ put_error(bev_ssl, err);
+ }
+
+ if (dirty_shutdown && bev_ssl->allow_dirty_shutdown)
+ event = BEV_EVENT_EOF;
+
+ stop_reading(bev_ssl);
+ stop_writing(bev_ssl);
+
+ /* when is BEV_EVENT_{READING|WRITING} */
+ event = when | event;
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev, event, 0);
+}
+
+static void
+init_bio_counts(struct bufferevent_openssl *bev_ssl)
+{
+ bev_ssl->counts.n_written =
+ BIO_number_written(SSL_get_wbio(bev_ssl->ssl));
+ bev_ssl->counts.n_read =
+ BIO_number_read(SSL_get_rbio(bev_ssl->ssl));
+}
+
+static inline void
+decrement_buckets(struct bufferevent_openssl *bev_ssl)
+{
+ unsigned long num_w = BIO_number_written(SSL_get_wbio(bev_ssl->ssl));
+ unsigned long num_r = BIO_number_read(SSL_get_rbio(bev_ssl->ssl));
+ /* These next two subtractions can wrap around. That's okay. */
+ unsigned long w = num_w - bev_ssl->counts.n_written;
+ unsigned long r = num_r - bev_ssl->counts.n_read;
+ if (w)
+ bufferevent_decrement_write_buckets_(&bev_ssl->bev, w);
+ if (r)
+ bufferevent_decrement_read_buckets_(&bev_ssl->bev, r);
+ bev_ssl->counts.n_written = num_w;
+ bev_ssl->counts.n_read = num_r;
+}
+
+#define OP_MADE_PROGRESS 1
+#define OP_BLOCKED 2
+#define OP_ERR 4
+
+/* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if
+ we're now blocked); and OP_ERR (if an error occurred). */
+static int
+do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) {
+ /* Requires lock */
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ struct evbuffer *input = bev->input;
+ int r, n, i, n_used = 0, atmost;
+ struct evbuffer_iovec space[2];
+ int result = 0;
+
+ if (bev_ssl->bev.read_suspended)
+ return 0;
+
+ atmost = bufferevent_get_read_max_(&bev_ssl->bev);
+ if (n_to_read > atmost)
+ n_to_read = atmost;
+
+ n = evbuffer_reserve_space(input, n_to_read, space, 2);
+ if (n < 0)
+ return OP_ERR;
+
+ for (i=0; i<n; ++i) {
+ if (bev_ssl->bev.read_suspended)
+ break;
+ r = SSL_read(bev_ssl->ssl, space[i].iov_base, space[i].iov_len);
+ if (r>0) {
+ result |= OP_MADE_PROGRESS;
+ if (bev_ssl->read_blocked_on_write)
+ if (clear_rbow(bev_ssl) < 0)
+ return OP_ERR | result;
+ ++n_used;
+ space[i].iov_len = r;
+ decrement_buckets(bev_ssl);
+ } else {
+ int err = SSL_get_error(bev_ssl->ssl, r);
+ print_err(err);
+ switch (err) {
+ case SSL_ERROR_WANT_READ:
+ /* Can't read until underlying has more data. */
+ if (bev_ssl->read_blocked_on_write)
+ if (clear_rbow(bev_ssl) < 0)
+ return OP_ERR | result;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+ /* This read operation requires a write, and the
+ * underlying is full */
+ if (!bev_ssl->read_blocked_on_write)
+ if (set_rbow(bev_ssl) < 0)
+ return OP_ERR | result;
+ break;
+ default:
+ conn_closed(bev_ssl, BEV_EVENT_READING, err, r);
+ break;
+ }
+ result |= OP_BLOCKED;
+ break; /* out of the loop */
+ }
+ }
+
+ if (n_used) {
+ evbuffer_commit_space(input, space, n_used);
+ if (bev_ssl->underlying)
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ }
+
+ return result;
+}
+
+/* Return a bitmask of OP_MADE_PROGRESS (if we wrote anything); OP_BLOCKED (if
+ we're now blocked); and OP_ERR (if an error occurred). */
+static int
+do_write(struct bufferevent_openssl *bev_ssl, int atmost)
+{
+ int i, r, n, n_written = 0;
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ struct evbuffer *output = bev->output;
+ struct evbuffer_iovec space[8];
+ int result = 0;
+
+ if (bev_ssl->last_write > 0)
+ atmost = bev_ssl->last_write;
+ else
+ atmost = bufferevent_get_write_max_(&bev_ssl->bev);
+
+ n = evbuffer_peek(output, atmost, NULL, space, 8);
+ if (n < 0)
+ return OP_ERR | result;
+
+ if (n > 8)
+ n = 8;
+ for (i=0; i < n; ++i) {
+ if (bev_ssl->bev.write_suspended)
+ break;
+
+ /* SSL_write will (reasonably) return 0 if we tell it to
+ send 0 data. Skip this case so we don't interpret the
+ result as an error */
+ if (space[i].iov_len == 0)
+ continue;
+
+ r = SSL_write(bev_ssl->ssl, space[i].iov_base,
+ space[i].iov_len);
+ if (r > 0) {
+ result |= OP_MADE_PROGRESS;
+ if (bev_ssl->write_blocked_on_read)
+ if (clear_wbor(bev_ssl) < 0)
+ return OP_ERR | result;
+ n_written += r;
+ bev_ssl->last_write = -1;
+ decrement_buckets(bev_ssl);
+ } else {
+ int err = SSL_get_error(bev_ssl->ssl, r);
+ print_err(err);
+ switch (err) {
+ case SSL_ERROR_WANT_WRITE:
+ /* Can't read until underlying has more data. */
+ if (bev_ssl->write_blocked_on_read)
+ if (clear_wbor(bev_ssl) < 0)
+ return OP_ERR | result;
+ bev_ssl->last_write = space[i].iov_len;
+ break;
+ case SSL_ERROR_WANT_READ:
+ /* This read operation requires a write, and the
+ * underlying is full */
+ if (!bev_ssl->write_blocked_on_read)
+ if (set_wbor(bev_ssl) < 0)
+ return OP_ERR | result;
+ bev_ssl->last_write = space[i].iov_len;
+ break;
+ default:
+ conn_closed(bev_ssl, BEV_EVENT_WRITING, err, r);
+ bev_ssl->last_write = -1;
+ break;
+ }
+ result |= OP_BLOCKED;
+ break;
+ }
+ }
+ if (n_written) {
+ evbuffer_drain(output, n_written);
+ if (bev_ssl->underlying)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+
+ bufferevent_trigger_nolock_(bev, EV_WRITE, 0);
+ }
+ return result;
+}
+
+#define WRITE_FRAME 15000
+
+#define READ_DEFAULT 4096
+
+/* Try to figure out how many bytes to read; return 0 if we shouldn't be
+ * reading. */
+static int
+bytes_to_read(struct bufferevent_openssl *bev)
+{
+ struct evbuffer *input = bev->bev.bev.input;
+ struct event_watermark *wm = &bev->bev.bev.wm_read;
+ int result = READ_DEFAULT;
+ ev_ssize_t limit;
+ /* XXX 99% of this is generic code that nearly all bufferevents will
+ * want. */
+
+ if (bev->write_blocked_on_read) {
+ return 0;
+ }
+
+ if (! (bev->bev.bev.enabled & EV_READ)) {
+ return 0;
+ }
+
+ if (bev->bev.read_suspended) {
+ return 0;
+ }
+
+ if (wm->high) {
+ if (evbuffer_get_length(input) >= wm->high) {
+ return 0;
+ }
+
+ result = wm->high - evbuffer_get_length(input);
+ } else {
+ result = READ_DEFAULT;
+ }
+
+ /* Respect the rate limit */
+ limit = bufferevent_get_read_max_(&bev->bev);
+ if (result > limit) {
+ result = limit;
+ }
+
+ return result;
+}
+
+
+/* Things look readable. If write is blocked on read, write till it isn't.
+ * Read from the underlying buffer until we block or we hit our high-water
+ * mark.
+ */
+static void
+consider_reading(struct bufferevent_openssl *bev_ssl)
+{
+ int r;
+ int n_to_read;
+ int all_result_flags = 0;
+
+ while (bev_ssl->write_blocked_on_read) {
+ r = do_write(bev_ssl, WRITE_FRAME);
+ if (r & (OP_BLOCKED|OP_ERR))
+ break;
+ }
+ if (bev_ssl->write_blocked_on_read)
+ return;
+
+ n_to_read = bytes_to_read(bev_ssl);
+
+ while (n_to_read) {
+ r = do_read(bev_ssl, n_to_read);
+ all_result_flags |= r;
+
+ if (r & (OP_BLOCKED|OP_ERR))
+ break;
+
+ if (bev_ssl->bev.read_suspended)
+ break;
+
+ /* Read all pending data. This won't hit the network
+ * again, and will (most importantly) put us in a state
+ * where we don't need to read anything else until the
+ * socket is readable again. It'll potentially make us
+ * overrun our read high-watermark (somewhat
+ * regrettable). The damage to the rate-limit has
+ * already been done, since OpenSSL went and read a
+ * whole SSL record anyway. */
+ n_to_read = SSL_pending(bev_ssl->ssl);
+
+ /* XXX This if statement is actually a bad bug, added to avoid
+ * XXX a worse bug.
+ *
+ * The bad bug: It can potentially cause resource unfairness
+ * by reading too much data from the underlying bufferevent;
+ * it can potentially cause read looping if the underlying
+ * bufferevent is a bufferevent_pair and deferred callbacks
+ * aren't used.
+ *
+ * The worse bug: If we didn't do this, then we would
+ * potentially not read any more from bev_ssl->underlying
+ * until more data arrived there, which could lead to us
+ * waiting forever.
+ */
+ if (!n_to_read && bev_ssl->underlying)
+ n_to_read = bytes_to_read(bev_ssl);
+ }
+
+ if (all_result_flags & OP_MADE_PROGRESS) {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+
+ bufferevent_trigger_nolock_(bev, EV_READ, 0);
+ }
+
+ if (!bev_ssl->underlying) {
+ /* Should be redundant, but let's avoid busy-looping */
+ if (bev_ssl->bev.read_suspended ||
+ !(bev_ssl->bev.bev.enabled & EV_READ)) {
+ event_del(&bev_ssl->bev.bev.ev_read);
+ }
+ }
+}
+
+static void
+consider_writing(struct bufferevent_openssl *bev_ssl)
+{
+ int r;
+ struct evbuffer *output = bev_ssl->bev.bev.output;
+ struct evbuffer *target = NULL;
+ struct event_watermark *wm = NULL;
+
+ while (bev_ssl->read_blocked_on_write) {
+ r = do_read(bev_ssl, 1024); /* XXXX 1024 is a hack */
+ if (r & OP_MADE_PROGRESS) {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+
+ bufferevent_trigger_nolock_(bev, EV_READ, 0);
+ }
+ if (r & (OP_ERR|OP_BLOCKED))
+ break;
+ }
+ if (bev_ssl->read_blocked_on_write)
+ return;
+ if (bev_ssl->underlying) {
+ target = bev_ssl->underlying->output;
+ wm = &bev_ssl->underlying->wm_write;
+ }
+ while ((bev_ssl->bev.bev.enabled & EV_WRITE) &&
+ (! bev_ssl->bev.write_suspended) &&
+ evbuffer_get_length(output) &&
+ (!target || (! wm->high || evbuffer_get_length(target) < wm->high))) {
+ int n_to_write;
+ if (wm && wm->high)
+ n_to_write = wm->high - evbuffer_get_length(target);
+ else
+ n_to_write = WRITE_FRAME;
+ r = do_write(bev_ssl, n_to_write);
+ if (r & (OP_BLOCKED|OP_ERR))
+ break;
+ }
+
+ if (!bev_ssl->underlying) {
+ if (evbuffer_get_length(output) == 0) {
+ event_del(&bev_ssl->bev.bev.ev_write);
+ } else if (bev_ssl->bev.write_suspended ||
+ !(bev_ssl->bev.bev.enabled & EV_WRITE)) {
+ /* Should be redundant, but let's avoid busy-looping */
+ event_del(&bev_ssl->bev.bev.ev_write);
+ }
+ }
+}
+
+static void
+be_openssl_readcb(struct bufferevent *bev_base, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ consider_reading(bev_ssl);
+}
+
+static void
+be_openssl_writecb(struct bufferevent *bev_base, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ consider_writing(bev_ssl);
+}
+
+static void
+be_openssl_eventcb(struct bufferevent *bev_base, short what, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ int event = 0;
+
+ if (what & BEV_EVENT_EOF) {
+ if (bev_ssl->allow_dirty_shutdown)
+ event = BEV_EVENT_EOF;
+ else
+ event = BEV_EVENT_ERROR;
+ } else if (what & BEV_EVENT_TIMEOUT) {
+ /* We sure didn't set this. Propagate it to the user. */
+ event = what;
+ } else if (what & BEV_EVENT_ERROR) {
+ /* An error occurred on the connection. Propagate it to the user. */
+ event = what;
+ } else if (what & BEV_EVENT_CONNECTED) {
+ /* Ignore it. We're saying SSL_connect() already, which will
+ eat it. */
+ }
+ if (event)
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev, event, 0);
+}
+
+static void
+be_openssl_readeventcb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct bufferevent_openssl *bev_ssl = ptr;
+ bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
+ if (what == EV_TIMEOUT) {
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev,
+ BEV_EVENT_TIMEOUT|BEV_EVENT_READING, 0);
+ } else {
+ consider_reading(bev_ssl);
+ }
+ bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
+}
+
+static void
+be_openssl_writeeventcb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct bufferevent_openssl *bev_ssl = ptr;
+ bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
+ if (what == EV_TIMEOUT) {
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev,
+ BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING, 0);
+ } else {
+ consider_writing(bev_ssl);
+ }
+ bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
+}
+
+static int
+set_open_callbacks(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd)
+{
+ if (bev_ssl->underlying) {
+ bufferevent_setcb(bev_ssl->underlying,
+ be_openssl_readcb, be_openssl_writecb, be_openssl_eventcb,
+ bev_ssl);
+ return 0;
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int rpending=0, wpending=0, r1=0, r2=0;
+ if (fd < 0 && bev_ssl->fd_is_set)
+ fd = event_get_fd(&bev->ev_read);
+ if (bev_ssl->fd_is_set) {
+ rpending = event_pending(&bev->ev_read, EV_READ, NULL);
+ wpending = event_pending(&bev->ev_write, EV_WRITE, NULL);
+ event_del(&bev->ev_read);
+ event_del(&bev->ev_write);
+ }
+ event_assign(&bev->ev_read, bev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE,
+ be_openssl_readeventcb, bev_ssl);
+ event_assign(&bev->ev_write, bev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE,
+ be_openssl_writeeventcb, bev_ssl);
+ if (rpending)
+ r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read);
+ if (wpending)
+ r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write);
+ if (fd >= 0) {
+ bev_ssl->fd_is_set = 1;
+ }
+ return (r1<0 || r2<0) ? -1 : 0;
+ }
+}
+
+static int
+do_handshake(struct bufferevent_openssl *bev_ssl)
+{
+ int r;
+
+ switch (bev_ssl->state) {
+ default:
+ case BUFFEREVENT_SSL_OPEN:
+ EVUTIL_ASSERT(0);
+ return -1;
+ case BUFFEREVENT_SSL_CONNECTING:
+ case BUFFEREVENT_SSL_ACCEPTING:
+ r = SSL_do_handshake(bev_ssl->ssl);
+ break;
+ }
+ decrement_buckets(bev_ssl);
+
+ if (r==1) {
+ /* We're done! */
+ bev_ssl->state = BUFFEREVENT_SSL_OPEN;
+ set_open_callbacks(bev_ssl, -1); /* XXXX handle failure */
+ /* Call do_read and do_write as needed */
+ bufferevent_enable(&bev_ssl->bev.bev, bev_ssl->bev.bev.enabled);
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev,
+ BEV_EVENT_CONNECTED, 0);
+ return 1;
+ } else {
+ int err = SSL_get_error(bev_ssl->ssl, r);
+ print_err(err);
+ switch (err) {
+ case SSL_ERROR_WANT_WRITE:
+ if (!bev_ssl->underlying) {
+ stop_reading(bev_ssl);
+ return start_writing(bev_ssl);
+ }
+ return 0;
+ case SSL_ERROR_WANT_READ:
+ if (!bev_ssl->underlying) {
+ stop_writing(bev_ssl);
+ return start_reading(bev_ssl);
+ }
+ return 0;
+ default:
+ conn_closed(bev_ssl, BEV_EVENT_READING, err, r);
+ return -1;
+ }
+ }
+}
+
+static void
+be_openssl_handshakecb(struct bufferevent *bev_base, void *ctx)
+{
+ struct bufferevent_openssl *bev_ssl = ctx;
+ do_handshake(bev_ssl);/* XXX handle failure */
+}
+
+static void
+be_openssl_handshakeeventcb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct bufferevent_openssl *bev_ssl = ptr;
+
+ bufferevent_incref_and_lock_(&bev_ssl->bev.bev);
+ if (what & EV_TIMEOUT) {
+ bufferevent_run_eventcb_(&bev_ssl->bev.bev, BEV_EVENT_TIMEOUT, 0);
+ } else
+ do_handshake(bev_ssl);/* XXX handle failure */
+ bufferevent_decref_and_unlock_(&bev_ssl->bev.bev);
+}
+
+static int
+set_handshake_callbacks(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd)
+{
+ if (bev_ssl->underlying) {
+ bufferevent_setcb(bev_ssl->underlying,
+ be_openssl_handshakecb, be_openssl_handshakecb,
+ be_openssl_eventcb,
+ bev_ssl);
+ return do_handshake(bev_ssl);
+ } else {
+ struct bufferevent *bev = &bev_ssl->bev.bev;
+ int r1=0, r2=0;
+ if (fd < 0 && bev_ssl->fd_is_set)
+ fd = event_get_fd(&bev->ev_read);
+ if (bev_ssl->fd_is_set) {
+ event_del(&bev->ev_read);
+ event_del(&bev->ev_write);
+ }
+ event_assign(&bev->ev_read, bev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE,
+ be_openssl_handshakeeventcb, bev_ssl);
+ event_assign(&bev->ev_write, bev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE,
+ be_openssl_handshakeeventcb, bev_ssl);
+ if (fd >= 0) {
+ r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read);
+ r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write);
+ bev_ssl->fd_is_set = 1;
+ }
+ return (r1<0 || r2<0) ? -1 : 0;
+ }
+}
+
+int
+bufferevent_ssl_renegotiate(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+ if (!bev_ssl)
+ return -1;
+ if (SSL_renegotiate(bev_ssl->ssl) < 0)
+ return -1;
+ bev_ssl->state = BUFFEREVENT_SSL_CONNECTING;
+ if (set_handshake_callbacks(bev_ssl, -1) < 0)
+ return -1;
+ if (!bev_ssl->underlying)
+ return do_handshake(bev_ssl);
+ return 0;
+}
+
+static void
+be_openssl_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo, void *arg)
+{
+ struct bufferevent_openssl *bev_ssl = arg;
+ int r = 0;
+ /* XXX need to hold a reference here. */
+
+ if (cbinfo->n_added && bev_ssl->state == BUFFEREVENT_SSL_OPEN) {
+ if (cbinfo->orig_size == 0)
+ r = bufferevent_add_event_(&bev_ssl->bev.bev.ev_write,
+ &bev_ssl->bev.bev.timeout_write);
+ consider_writing(bev_ssl);
+ }
+ /* XXX Handle r < 0 */
+ (void)r;
+}
+
+
+static int
+be_openssl_enable(struct bufferevent *bev, short events)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+ int r1 = 0, r2 = 0;
+
+ if (bev_ssl->state != BUFFEREVENT_SSL_OPEN)
+ return 0;
+
+ if (events & EV_READ)
+ r1 = start_reading(bev_ssl);
+ if (events & EV_WRITE)
+ r2 = start_writing(bev_ssl);
+
+ if (bev_ssl->underlying) {
+ if (events & EV_READ)
+ BEV_RESET_GENERIC_READ_TIMEOUT(bev);
+ if (events & EV_WRITE)
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
+
+ if (events & EV_READ)
+ consider_reading(bev_ssl);
+ if (events & EV_WRITE)
+ consider_writing(bev_ssl);
+ }
+ return (r1 < 0 || r2 < 0) ? -1 : 0;
+}
+
+static int
+be_openssl_disable(struct bufferevent *bev, short events)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+ if (bev_ssl->state != BUFFEREVENT_SSL_OPEN)
+ return 0;
+
+ if (events & EV_READ)
+ stop_reading(bev_ssl);
+ if (events & EV_WRITE)
+ stop_writing(bev_ssl);
+
+ if (bev_ssl->underlying) {
+ if (events & EV_READ)
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ if (events & EV_WRITE)
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ }
+ return 0;
+}
+
+static void
+be_openssl_unlink(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+
+ if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) {
+ if (bev_ssl->underlying) {
+ if (BEV_UPCAST(bev_ssl->underlying)->refcnt < 2) {
+ event_warnx("BEV_OPT_CLOSE_ON_FREE set on an "
+ "bufferevent with too few references");
+ } else {
+ bufferevent_free(bev_ssl->underlying);
+ /* We still have a reference to it, via our
+ * BIO. So we don't drop this. */
+ // bev_ssl->underlying = NULL;
+ }
+ }
+ } else {
+ if (bev_ssl->underlying) {
+ if (bev_ssl->underlying->errorcb == be_openssl_eventcb)
+ bufferevent_setcb(bev_ssl->underlying,
+ NULL,NULL,NULL,NULL);
+ bufferevent_unsuspend_read_(bev_ssl->underlying,
+ BEV_SUSPEND_FILT_READ);
+ }
+ }
+}
+
+static void
+be_openssl_destruct(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+
+ if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) {
+ if (! bev_ssl->underlying) {
+ evutil_socket_t fd = -1;
+ BIO *bio = SSL_get_wbio(bev_ssl->ssl);
+ if (bio)
+ fd = BIO_get_fd(bio, NULL);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+ }
+ SSL_free(bev_ssl->ssl);
+ }
+}
+
+static int
+be_openssl_adj_timeouts(struct bufferevent *bev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+
+ if (bev_ssl->underlying) {
+ return bufferevent_generic_adj_timeouts_(bev);
+ } else {
+ int r1=0, r2=0;
+ if (event_pending(&bev->ev_read, EV_READ, NULL)) {
+ if (evutil_timerisset(&bev->timeout_read)) {
+ r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read);
+ } else {
+ event_remove_timer(&bev->ev_read);
+ }
+ }
+ if (event_pending(&bev->ev_write, EV_WRITE, NULL)) {
+ if (evutil_timerisset(&bev->timeout_write)) {
+ r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write);
+ } else {
+ event_remove_timer(&bev->ev_write);
+ }
+ }
+
+ return (r1<0 || r2<0) ? -1 : 0;
+ }
+}
+
+static int
+be_openssl_flush(struct bufferevent *bufev,
+ short iotype, enum bufferevent_flush_mode mode)
+{
+ /* XXXX Implement this. */
+ return 0;
+}
+
+static int
+be_openssl_ctrl(struct bufferevent *bev,
+ enum bufferevent_ctrl_op op, union bufferevent_ctrl_data *data)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bev);
+ switch (op) {
+ case BEV_CTRL_SET_FD:
+ if (bev_ssl->underlying)
+ return -1;
+ {
+ BIO *bio;
+ bio = BIO_new_socket(data->fd, 0);
+ SSL_set_bio(bev_ssl->ssl, bio, bio);
+ bev_ssl->fd_is_set = 1;
+ }
+ if (bev_ssl->state == BUFFEREVENT_SSL_OPEN)
+ return set_open_callbacks(bev_ssl, data->fd);
+ else {
+ return set_handshake_callbacks(bev_ssl, data->fd);
+ }
+ case BEV_CTRL_GET_FD:
+ if (bev_ssl->underlying)
+ return -1;
+ if (!bev_ssl->fd_is_set)
+ return -1;
+ data->fd = event_get_fd(&bev->ev_read);
+ return 0;
+ case BEV_CTRL_GET_UNDERLYING:
+ if (!bev_ssl->underlying)
+ return -1;
+ data->ptr = bev_ssl->underlying;
+ return 0;
+ case BEV_CTRL_CANCEL_ALL:
+ default:
+ return -1;
+ }
+}
+
+SSL *
+bufferevent_openssl_get_ssl(struct bufferevent *bufev)
+{
+ struct bufferevent_openssl *bev_ssl = upcast(bufev);
+ if (!bev_ssl)
+ return NULL;
+ return bev_ssl->ssl;
+}
+
+static struct bufferevent *
+bufferevent_openssl_new_impl(struct event_base *base,
+ struct bufferevent *underlying,
+ evutil_socket_t fd,
+ SSL *ssl,
+ enum bufferevent_ssl_state state,
+ int options)
+{
+ struct bufferevent_openssl *bev_ssl = NULL;
+ struct bufferevent_private *bev_p = NULL;
+ int tmp_options = options & ~BEV_OPT_THREADSAFE;
+
+ if (underlying != NULL && fd >= 0)
+ return NULL; /* Only one can be set. */
+
+ if (!(bev_ssl = mm_calloc(1, sizeof(struct bufferevent_openssl))))
+ goto err;
+
+ bev_p = &bev_ssl->bev;
+
+ if (bufferevent_init_common_(bev_p, base,
+ &bufferevent_ops_openssl, tmp_options) < 0)
+ goto err;
+
+ /* Don't explode if we decide to realloc a chunk we're writing from in
+ * the output buffer. */
+ SSL_set_mode(ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
+ bev_ssl->underlying = underlying;
+ bev_ssl->ssl = ssl;
+
+ bev_ssl->outbuf_cb = evbuffer_add_cb(bev_p->bev.output,
+ be_openssl_outbuf_cb, bev_ssl);
+
+ if (options & BEV_OPT_THREADSAFE)
+ bufferevent_enable_locking_(&bev_ssl->bev.bev, NULL);
+
+ if (underlying) {
+ bufferevent_init_generic_timeout_cbs_(&bev_ssl->bev.bev);
+ bufferevent_incref_(underlying);
+ }
+
+ bev_ssl->state = state;
+ bev_ssl->last_write = -1;
+
+ init_bio_counts(bev_ssl);
+
+ switch (state) {
+ case BUFFEREVENT_SSL_ACCEPTING:
+ SSL_set_accept_state(bev_ssl->ssl);
+ if (set_handshake_callbacks(bev_ssl, fd) < 0)
+ goto err;
+ break;
+ case BUFFEREVENT_SSL_CONNECTING:
+ SSL_set_connect_state(bev_ssl->ssl);
+ if (set_handshake_callbacks(bev_ssl, fd) < 0)
+ goto err;
+ break;
+ case BUFFEREVENT_SSL_OPEN:
+ if (set_open_callbacks(bev_ssl, fd) < 0)
+ goto err;
+ break;
+ default:
+ goto err;
+ }
+
+ if (underlying) {
+ bufferevent_setwatermark(underlying, EV_READ, 0, 0);
+ bufferevent_enable(underlying, EV_READ|EV_WRITE);
+ if (state == BUFFEREVENT_SSL_OPEN)
+ bufferevent_suspend_read_(underlying,
+ BEV_SUSPEND_FILT_READ);
+ } else {
+ bev_ssl->bev.bev.enabled = EV_READ|EV_WRITE;
+ if (bev_ssl->fd_is_set) {
+ if (state != BUFFEREVENT_SSL_OPEN)
+ if (event_add(&bev_ssl->bev.bev.ev_read, NULL) < 0)
+ goto err;
+ if (event_add(&bev_ssl->bev.bev.ev_write, NULL) < 0)
+ goto err;
+ }
+ }
+
+ return &bev_ssl->bev.bev;
+err:
+ if (bev_ssl)
+ bufferevent_free(&bev_ssl->bev.bev);
+ return NULL;
+}
+
+struct bufferevent *
+bufferevent_openssl_filter_new(struct event_base *base,
+ struct bufferevent *underlying,
+ SSL *ssl,
+ enum bufferevent_ssl_state state,
+ int options)
+{
+ /* We don't tell the BIO to close the bufferevent; we do it ourselves
+ * on be_openssl_destruct */
+ int close_flag = 0; /* options & BEV_OPT_CLOSE_ON_FREE; */
+ BIO *bio;
+ if (!underlying)
+ return NULL;
+ if (!(bio = BIO_new_bufferevent(underlying, close_flag)))
+ return NULL;
+
+ SSL_set_bio(ssl, bio, bio);
+
+ return bufferevent_openssl_new_impl(
+ base, underlying, -1, ssl, state, options);
+}
+
+struct bufferevent *
+bufferevent_openssl_socket_new(struct event_base *base,
+ evutil_socket_t fd,
+ SSL *ssl,
+ enum bufferevent_ssl_state state,
+ int options)
+{
+ /* Does the SSL already have an fd? */
+ BIO *bio = SSL_get_wbio(ssl);
+ long have_fd = -1;
+
+ if (bio)
+ have_fd = BIO_get_fd(bio, NULL);
+
+ if (have_fd >= 0) {
+ /* The SSL is already configured with an fd. */
+ if (fd < 0) {
+ /* We should learn the fd from the SSL. */
+ fd = (evutil_socket_t) have_fd;
+ } else if (have_fd == (long)fd) {
+ /* We already know the fd from the SSL; do nothing */
+ } else {
+ /* We specified an fd different from that of the SSL.
+ This is probably an error on our part. Fail. */
+ return NULL;
+ }
+ (void) BIO_set_close(bio, 0);
+ } else {
+ /* The SSL isn't configured with a BIO with an fd. */
+ if (fd >= 0) {
+ /* ... and we have an fd we want to use. */
+ bio = BIO_new_socket(fd, 0);
+ SSL_set_bio(ssl, bio, bio);
+ } else {
+ /* Leave the fd unset. */
+ }
+ }
+
+ return bufferevent_openssl_new_impl(
+ base, NULL, fd, ssl, state, options);
+}
+
+int
+bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev)
+{
+ int allow_dirty_shutdown = -1;
+ struct bufferevent_openssl *bev_ssl;
+ BEV_LOCK(bev);
+ bev_ssl = upcast(bev);
+ if (bev_ssl)
+ allow_dirty_shutdown = bev_ssl->allow_dirty_shutdown;
+ BEV_UNLOCK(bev);
+ return allow_dirty_shutdown;
+}
+
+void
+bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev,
+ int allow_dirty_shutdown)
+{
+ struct bufferevent_openssl *bev_ssl;
+ BEV_LOCK(bev);
+ bev_ssl = upcast(bev);
+ if (bev_ssl)
+ bev_ssl->allow_dirty_shutdown = !!allow_dirty_shutdown;
+ BEV_UNLOCK(bev);
+}
+
+unsigned long
+bufferevent_get_openssl_error(struct bufferevent *bev)
+{
+ unsigned long err = 0;
+ struct bufferevent_openssl *bev_ssl;
+ BEV_LOCK(bev);
+ bev_ssl = upcast(bev);
+ if (bev_ssl && bev_ssl->n_errors) {
+ err = bev_ssl->errors[--bev_ssl->n_errors];
+ }
+ BEV_UNLOCK(bev);
+ return err;
+}
diff --git a/sntp/libevent/bufferevent_pair.c b/sntp/libevent/bufferevent_pair.c
new file mode 100644
index 0000000..4340f23
--- /dev/null
+++ b/sntp/libevent/bufferevent_pair.c
@@ -0,0 +1,327 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/event.h"
+#include "defer-internal.h"
+#include "bufferevent-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+
+struct bufferevent_pair {
+ struct bufferevent_private bev;
+ struct bufferevent_pair *partner;
+};
+
+
+/* Given a bufferevent that's really a bev part of a bufferevent_pair,
+ * return that bufferevent_filtered. Returns NULL otherwise.*/
+static inline struct bufferevent_pair *
+upcast(struct bufferevent *bev)
+{
+ struct bufferevent_pair *bev_p;
+ if (bev->be_ops != &bufferevent_ops_pair)
+ return NULL;
+ bev_p = EVUTIL_UPCAST(bev, struct bufferevent_pair, bev.bev);
+ EVUTIL_ASSERT(bev_p->bev.bev.be_ops == &bufferevent_ops_pair);
+ return bev_p;
+}
+
+#define downcast(bev_pair) (&(bev_pair)->bev.bev)
+
+static inline void
+incref_and_lock(struct bufferevent *b)
+{
+ struct bufferevent_pair *bevp;
+ bufferevent_incref_and_lock_(b);
+ bevp = upcast(b);
+ if (bevp->partner)
+ bufferevent_incref_and_lock_(downcast(bevp->partner));
+}
+
+static inline void
+decref_and_unlock(struct bufferevent *b)
+{
+ struct bufferevent_pair *bevp = upcast(b);
+ if (bevp->partner)
+ bufferevent_decref_and_unlock_(downcast(bevp->partner));
+ bufferevent_decref_and_unlock_(b);
+}
+
+/* XXX Handle close */
+
+static void be_pair_outbuf_cb(struct evbuffer *,
+ const struct evbuffer_cb_info *, void *);
+
+static struct bufferevent_pair *
+bufferevent_pair_elt_new(struct event_base *base,
+ int options)
+{
+ struct bufferevent_pair *bufev;
+ if (! (bufev = mm_calloc(1, sizeof(struct bufferevent_pair))))
+ return NULL;
+ if (bufferevent_init_common_(&bufev->bev, base, &bufferevent_ops_pair,
+ options)) {
+ mm_free(bufev);
+ return NULL;
+ }
+ if (!evbuffer_add_cb(bufev->bev.bev.output, be_pair_outbuf_cb, bufev)) {
+ bufferevent_free(downcast(bufev));
+ return NULL;
+ }
+
+ bufferevent_init_generic_timeout_cbs_(&bufev->bev.bev);
+
+ return bufev;
+}
+
+int
+bufferevent_pair_new(struct event_base *base, int options,
+ struct bufferevent *pair[2])
+{
+ struct bufferevent_pair *bufev1 = NULL, *bufev2 = NULL;
+ int tmp_options;
+
+ options |= BEV_OPT_DEFER_CALLBACKS;
+ tmp_options = options & ~BEV_OPT_THREADSAFE;
+
+ bufev1 = bufferevent_pair_elt_new(base, options);
+ if (!bufev1)
+ return -1;
+ bufev2 = bufferevent_pair_elt_new(base, tmp_options);
+ if (!bufev2) {
+ bufferevent_free(downcast(bufev1));
+ return -1;
+ }
+
+ if (options & BEV_OPT_THREADSAFE) {
+ /*XXXX check return */
+ bufferevent_enable_locking_(downcast(bufev2), bufev1->bev.lock);
+ }
+
+ bufev1->partner = bufev2;
+ bufev2->partner = bufev1;
+
+ evbuffer_freeze(downcast(bufev1)->input, 0);
+ evbuffer_freeze(downcast(bufev1)->output, 1);
+ evbuffer_freeze(downcast(bufev2)->input, 0);
+ evbuffer_freeze(downcast(bufev2)->output, 1);
+
+ pair[0] = downcast(bufev1);
+ pair[1] = downcast(bufev2);
+
+ return 0;
+}
+
+static void
+be_pair_transfer(struct bufferevent *src, struct bufferevent *dst,
+ int ignore_wm)
+{
+ size_t dst_size;
+ size_t n;
+
+ evbuffer_unfreeze(src->output, 1);
+ evbuffer_unfreeze(dst->input, 0);
+
+ if (dst->wm_read.high) {
+ dst_size = evbuffer_get_length(dst->input);
+ if (dst_size < dst->wm_read.high) {
+ n = dst->wm_read.high - dst_size;
+ evbuffer_remove_buffer(src->output, dst->input, n);
+ } else {
+ if (!ignore_wm)
+ goto done;
+ n = evbuffer_get_length(src->output);
+ evbuffer_add_buffer(dst->input, src->output);
+ }
+ } else {
+ n = evbuffer_get_length(src->output);
+ evbuffer_add_buffer(dst->input, src->output);
+ }
+
+ if (n) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(dst);
+
+ if (evbuffer_get_length(dst->output))
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(dst);
+ else
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(dst);
+ }
+
+ bufferevent_trigger_nolock_(dst, EV_READ, 0);
+ bufferevent_trigger_nolock_(src, EV_WRITE, 0);
+done:
+ evbuffer_freeze(src->output, 1);
+ evbuffer_freeze(dst->input, 0);
+}
+
+static inline int
+be_pair_wants_to_talk(struct bufferevent_pair *src,
+ struct bufferevent_pair *dst)
+{
+ return (downcast(src)->enabled & EV_WRITE) &&
+ (downcast(dst)->enabled & EV_READ) &&
+ !dst->bev.read_suspended &&
+ evbuffer_get_length(downcast(src)->output);
+}
+
+static void
+be_pair_outbuf_cb(struct evbuffer *outbuf,
+ const struct evbuffer_cb_info *info, void *arg)
+{
+ struct bufferevent_pair *bev_pair = arg;
+ struct bufferevent_pair *partner = bev_pair->partner;
+
+ incref_and_lock(downcast(bev_pair));
+
+ if (info->n_added > info->n_deleted && partner) {
+ /* We got more data. If the other side's reading, then
+ hand it over. */
+ if (be_pair_wants_to_talk(bev_pair, partner)) {
+ be_pair_transfer(downcast(bev_pair), downcast(partner), 0);
+ }
+ }
+
+ decref_and_unlock(downcast(bev_pair));
+}
+
+static int
+be_pair_enable(struct bufferevent *bufev, short events)
+{
+ struct bufferevent_pair *bev_p = upcast(bufev);
+ struct bufferevent_pair *partner = bev_p->partner;
+
+ incref_and_lock(bufev);
+
+ if (events & EV_READ) {
+ BEV_RESET_GENERIC_READ_TIMEOUT(bufev);
+ }
+ if ((events & EV_WRITE) && evbuffer_get_length(bufev->output))
+ BEV_RESET_GENERIC_WRITE_TIMEOUT(bufev);
+
+ /* We're starting to read! Does the other side have anything to write?*/
+ if ((events & EV_READ) && partner &&
+ be_pair_wants_to_talk(partner, bev_p)) {
+ be_pair_transfer(downcast(partner), bufev, 0);
+ }
+ /* We're starting to write! Does the other side want to read? */
+ if ((events & EV_WRITE) && partner &&
+ be_pair_wants_to_talk(bev_p, partner)) {
+ be_pair_transfer(bufev, downcast(partner), 0);
+ }
+ decref_and_unlock(bufev);
+ return 0;
+}
+
+static int
+be_pair_disable(struct bufferevent *bev, short events)
+{
+ if (events & EV_READ) {
+ BEV_DEL_GENERIC_READ_TIMEOUT(bev);
+ }
+ if (events & EV_WRITE) {
+ BEV_DEL_GENERIC_WRITE_TIMEOUT(bev);
+ }
+ return 0;
+}
+
+static void
+be_pair_unlink(struct bufferevent *bev)
+{
+ struct bufferevent_pair *bev_p = upcast(bev);
+
+ if (bev_p->partner) {
+ bev_p->partner->partner = NULL;
+ bev_p->partner = NULL;
+ }
+}
+
+static int
+be_pair_flush(struct bufferevent *bev, short iotype,
+ enum bufferevent_flush_mode mode)
+{
+ struct bufferevent_pair *bev_p = upcast(bev);
+ struct bufferevent *partner;
+ incref_and_lock(bev);
+ if (!bev_p->partner)
+ return -1;
+
+ partner = downcast(bev_p->partner);
+
+ if (mode == BEV_NORMAL)
+ return 0;
+
+ if ((iotype & EV_READ) != 0)
+ be_pair_transfer(partner, bev, 1);
+
+ if ((iotype & EV_WRITE) != 0)
+ be_pair_transfer(bev, partner, 1);
+
+ if (mode == BEV_FINISHED) {
+ bufferevent_run_eventcb_(partner, iotype|BEV_EVENT_EOF, 0);
+ }
+ decref_and_unlock(bev);
+ return 0;
+}
+
+struct bufferevent *
+bufferevent_pair_get_partner(struct bufferevent *bev)
+{
+ struct bufferevent_pair *bev_p;
+ struct bufferevent *partner = NULL;
+ bev_p = upcast(bev);
+ if (! bev_p)
+ return NULL;
+
+ incref_and_lock(bev);
+ if (bev_p->partner)
+ partner = downcast(bev_p->partner);
+ decref_and_unlock(bev);
+ return partner;
+}
+
+const struct bufferevent_ops bufferevent_ops_pair = {
+ "pair_elt",
+ evutil_offsetof(struct bufferevent_pair, bev.bev),
+ be_pair_enable,
+ be_pair_disable,
+ be_pair_unlink,
+ NULL, /* be_pair_destruct, */
+ bufferevent_generic_adj_timeouts_,
+ be_pair_flush,
+ NULL, /* ctrl */
+};
diff --git a/sntp/libevent/bufferevent_ratelim.c b/sntp/libevent/bufferevent_ratelim.c
new file mode 100644
index 0000000..bde1920
--- /dev/null
+++ b/sntp/libevent/bufferevent_ratelim.c
@@ -0,0 +1,1092 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright (c) 2002-2006 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+#include <limits.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/buffer.h"
+
+#include "ratelim-internal.h"
+
+#include "bufferevent-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "event-internal.h"
+
+int
+ev_token_bucket_init_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick,
+ int reinitialize)
+{
+ if (reinitialize) {
+ /* on reinitialization, we only clip downwards, since we've
+ already used who-knows-how-much bandwidth this tick. We
+ leave "last_updated" as it is; the next update will add the
+ appropriate amount of bandwidth to the bucket.
+ */
+ if (bucket->read_limit > (ev_int64_t) cfg->read_maximum)
+ bucket->read_limit = cfg->read_maximum;
+ if (bucket->write_limit > (ev_int64_t) cfg->write_maximum)
+ bucket->write_limit = cfg->write_maximum;
+ } else {
+ bucket->read_limit = cfg->read_rate;
+ bucket->write_limit = cfg->write_rate;
+ bucket->last_updated = current_tick;
+ }
+ return 0;
+}
+
+int
+ev_token_bucket_update_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick)
+{
+ /* It's okay if the tick number overflows, since we'll just
+ * wrap around when we do the unsigned substraction. */
+ unsigned n_ticks = current_tick - bucket->last_updated;
+
+ /* Make sure some ticks actually happened, and that time didn't
+ * roll back. */
+ if (n_ticks == 0 || n_ticks > INT_MAX)
+ return 0;
+
+ /* Naively, we would say
+ bucket->limit += n_ticks * cfg->rate;
+
+ if (bucket->limit > cfg->maximum)
+ bucket->limit = cfg->maximum;
+
+ But we're worried about overflow, so we do it like this:
+ */
+
+ if ((cfg->read_maximum - bucket->read_limit) / n_ticks < cfg->read_rate)
+ bucket->read_limit = cfg->read_maximum;
+ else
+ bucket->read_limit += n_ticks * cfg->read_rate;
+
+
+ if ((cfg->write_maximum - bucket->write_limit) / n_ticks < cfg->write_rate)
+ bucket->write_limit = cfg->write_maximum;
+ else
+ bucket->write_limit += n_ticks * cfg->write_rate;
+
+
+ bucket->last_updated = current_tick;
+
+ return 1;
+}
+
+static inline void
+bufferevent_update_buckets(struct bufferevent_private *bev)
+{
+ /* Must hold lock on bev. */
+ struct timeval now;
+ unsigned tick;
+ event_base_gettimeofday_cached(bev->bev.ev_base, &now);
+ tick = ev_token_bucket_get_tick_(&now, bev->rate_limiting->cfg);
+ if (tick != bev->rate_limiting->limit.last_updated)
+ ev_token_bucket_update_(&bev->rate_limiting->limit,
+ bev->rate_limiting->cfg, tick);
+}
+
+ev_uint32_t
+ev_token_bucket_get_tick_(const struct timeval *tv,
+ const struct ev_token_bucket_cfg *cfg)
+{
+ /* This computation uses two multiplies and a divide. We could do
+ * fewer if we knew that the tick length was an integer number of
+ * seconds, or if we knew it divided evenly into a second. We should
+ * investigate that more.
+ */
+
+ /* We cast to an ev_uint64_t first, since we don't want to overflow
+ * before we do the final divide. */
+ ev_uint64_t msec = (ev_uint64_t)tv->tv_sec * 1000 + tv->tv_usec / 1000;
+ return (unsigned)(msec / cfg->msec_per_tick);
+}
+
+struct ev_token_bucket_cfg *
+ev_token_bucket_cfg_new(size_t read_rate, size_t read_burst,
+ size_t write_rate, size_t write_burst,
+ const struct timeval *tick_len)
+{
+ struct ev_token_bucket_cfg *r;
+ struct timeval g;
+ if (! tick_len) {
+ g.tv_sec = 1;
+ g.tv_usec = 0;
+ tick_len = &g;
+ }
+ if (read_rate > read_burst || write_rate > write_burst ||
+ read_rate < 1 || write_rate < 1)
+ return NULL;
+ if (read_rate > EV_RATE_LIMIT_MAX ||
+ write_rate > EV_RATE_LIMIT_MAX ||
+ read_burst > EV_RATE_LIMIT_MAX ||
+ write_burst > EV_RATE_LIMIT_MAX)
+ return NULL;
+ r = mm_calloc(1, sizeof(struct ev_token_bucket_cfg));
+ if (!r)
+ return NULL;
+ r->read_rate = read_rate;
+ r->write_rate = write_rate;
+ r->read_maximum = read_burst;
+ r->write_maximum = write_burst;
+ memcpy(&r->tick_timeout, tick_len, sizeof(struct timeval));
+ r->msec_per_tick = (tick_len->tv_sec * 1000) +
+ (tick_len->tv_usec & COMMON_TIMEOUT_MICROSECONDS_MASK)/1000;
+ return r;
+}
+
+void
+ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg)
+{
+ mm_free(cfg);
+}
+
+/* Default values for max_single_read & max_single_write variables. */
+#define MAX_SINGLE_READ_DEFAULT 16384
+#define MAX_SINGLE_WRITE_DEFAULT 16384
+
+#define LOCK_GROUP(g) EVLOCK_LOCK((g)->lock, 0)
+#define UNLOCK_GROUP(g) EVLOCK_UNLOCK((g)->lock, 0)
+
+static int bev_group_suspend_reading_(struct bufferevent_rate_limit_group *g);
+static int bev_group_suspend_writing_(struct bufferevent_rate_limit_group *g);
+static void bev_group_unsuspend_reading_(struct bufferevent_rate_limit_group *g);
+static void bev_group_unsuspend_writing_(struct bufferevent_rate_limit_group *g);
+
+/** Helper: figure out the maximum amount we should write if is_write, or
+ the maximum amount we should read if is_read. Return that maximum, or
+ 0 if our bucket is wholly exhausted.
+ */
+static inline ev_ssize_t
+bufferevent_get_rlim_max_(struct bufferevent_private *bev, int is_write)
+{
+ /* needs lock on bev. */
+ ev_ssize_t max_so_far = is_write?bev->max_single_write:bev->max_single_read;
+
+#define LIM(x) \
+ (is_write ? (x).write_limit : (x).read_limit)
+
+#define GROUP_SUSPENDED(g) \
+ (is_write ? (g)->write_suspended : (g)->read_suspended)
+
+ /* Sets max_so_far to MIN(x, max_so_far) */
+#define CLAMPTO(x) \
+ do { \
+ if (max_so_far > (x)) \
+ max_so_far = (x); \
+ } while (0);
+
+ if (!bev->rate_limiting)
+ return max_so_far;
+
+ /* If rate-limiting is enabled at all, update the appropriate
+ bucket, and take the smaller of our rate limit and the group
+ rate limit.
+ */
+
+ if (bev->rate_limiting->cfg) {
+ bufferevent_update_buckets(bev);
+ max_so_far = LIM(bev->rate_limiting->limit);
+ }
+ if (bev->rate_limiting->group) {
+ struct bufferevent_rate_limit_group *g =
+ bev->rate_limiting->group;
+ ev_ssize_t share;
+ LOCK_GROUP(g);
+ if (GROUP_SUSPENDED(g)) {
+ /* We can get here if we failed to lock this
+ * particular bufferevent while suspending the whole
+ * group. */
+ if (is_write)
+ bufferevent_suspend_write_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ else
+ bufferevent_suspend_read_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ share = 0;
+ } else {
+ /* XXXX probably we should divide among the active
+ * members, not the total members. */
+ share = LIM(g->rate_limit) / g->n_members;
+ if (share < g->min_share)
+ share = g->min_share;
+ }
+ UNLOCK_GROUP(g);
+ CLAMPTO(share);
+ }
+
+ if (max_so_far < 0)
+ max_so_far = 0;
+ return max_so_far;
+}
+
+ev_ssize_t
+bufferevent_get_read_max_(struct bufferevent_private *bev)
+{
+ return bufferevent_get_rlim_max_(bev, 0);
+}
+
+ev_ssize_t
+bufferevent_get_write_max_(struct bufferevent_private *bev)
+{
+ return bufferevent_get_rlim_max_(bev, 1);
+}
+
+int
+bufferevent_decrement_read_buckets_(struct bufferevent_private *bev, ev_ssize_t bytes)
+{
+ /* XXXXX Make sure all users of this function check its return value */
+ int r = 0;
+ /* need to hold lock on bev */
+ if (!bev->rate_limiting)
+ return 0;
+
+ if (bev->rate_limiting->cfg) {
+ bev->rate_limiting->limit.read_limit -= bytes;
+ if (bev->rate_limiting->limit.read_limit <= 0) {
+ bufferevent_suspend_read_(&bev->bev, BEV_SUSPEND_BW);
+ if (event_add(&bev->rate_limiting->refill_bucket_event,
+ &bev->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (bev->read_suspended & BEV_SUSPEND_BW) {
+ if (!(bev->write_suspended & BEV_SUSPEND_BW))
+ event_del(&bev->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_read_(&bev->bev, BEV_SUSPEND_BW);
+ }
+ }
+
+ if (bev->rate_limiting->group) {
+ LOCK_GROUP(bev->rate_limiting->group);
+ bev->rate_limiting->group->rate_limit.read_limit -= bytes;
+ bev->rate_limiting->group->total_read += bytes;
+ if (bev->rate_limiting->group->rate_limit.read_limit <= 0) {
+ bev_group_suspend_reading_(bev->rate_limiting->group);
+ } else if (bev->rate_limiting->group->read_suspended) {
+ bev_group_unsuspend_reading_(bev->rate_limiting->group);
+ }
+ UNLOCK_GROUP(bev->rate_limiting->group);
+ }
+
+ return r;
+}
+
+int
+bufferevent_decrement_write_buckets_(struct bufferevent_private *bev, ev_ssize_t bytes)
+{
+ /* XXXXX Make sure all users of this function check its return value */
+ int r = 0;
+ /* need to hold lock */
+ if (!bev->rate_limiting)
+ return 0;
+
+ if (bev->rate_limiting->cfg) {
+ bev->rate_limiting->limit.write_limit -= bytes;
+ if (bev->rate_limiting->limit.write_limit <= 0) {
+ bufferevent_suspend_write_(&bev->bev, BEV_SUSPEND_BW);
+ if (event_add(&bev->rate_limiting->refill_bucket_event,
+ &bev->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (bev->write_suspended & BEV_SUSPEND_BW) {
+ if (!(bev->read_suspended & BEV_SUSPEND_BW))
+ event_del(&bev->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_write_(&bev->bev, BEV_SUSPEND_BW);
+ }
+ }
+
+ if (bev->rate_limiting->group) {
+ LOCK_GROUP(bev->rate_limiting->group);
+ bev->rate_limiting->group->rate_limit.write_limit -= bytes;
+ bev->rate_limiting->group->total_written += bytes;
+ if (bev->rate_limiting->group->rate_limit.write_limit <= 0) {
+ bev_group_suspend_writing_(bev->rate_limiting->group);
+ } else if (bev->rate_limiting->group->write_suspended) {
+ bev_group_unsuspend_writing_(bev->rate_limiting->group);
+ }
+ UNLOCK_GROUP(bev->rate_limiting->group);
+ }
+
+ return r;
+}
+
+/** Stop reading on every bufferevent in <b>g</b> */
+static int
+bev_group_suspend_reading_(struct bufferevent_rate_limit_group *g)
+{
+ /* Needs group lock */
+ struct bufferevent_private *bev;
+ g->read_suspended = 1;
+ g->pending_unsuspend_read = 0;
+
+ /* Note that in this loop we call EVLOCK_TRY_LOCK_ instead of BEV_LOCK,
+ to prevent a deadlock. (Ordinarily, the group lock nests inside
+ the bufferevent locks. If we are unable to lock any individual
+ bufferevent, it will find out later when it looks at its limit
+ and sees that its group is suspended.)
+ */
+ LIST_FOREACH(bev, &g->members, rate_limiting->next_in_group) {
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_suspend_read_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ }
+ }
+ return 0;
+}
+
+/** Stop writing on every bufferevent in <b>g</b> */
+static int
+bev_group_suspend_writing_(struct bufferevent_rate_limit_group *g)
+{
+ /* Needs group lock */
+ struct bufferevent_private *bev;
+ g->write_suspended = 1;
+ g->pending_unsuspend_write = 0;
+ LIST_FOREACH(bev, &g->members, rate_limiting->next_in_group) {
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_suspend_write_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ }
+ }
+ return 0;
+}
+
+/** Timer callback invoked on a single bufferevent with one or more exhausted
+ buckets when they are ready to refill. */
+static void
+bev_refill_callback_(evutil_socket_t fd, short what, void *arg)
+{
+ unsigned tick;
+ struct timeval now;
+ struct bufferevent_private *bev = arg;
+ int again = 0;
+ BEV_LOCK(&bev->bev);
+ if (!bev->rate_limiting || !bev->rate_limiting->cfg) {
+ BEV_UNLOCK(&bev->bev);
+ return;
+ }
+
+ /* First, update the bucket */
+ event_base_gettimeofday_cached(bev->bev.ev_base, &now);
+ tick = ev_token_bucket_get_tick_(&now,
+ bev->rate_limiting->cfg);
+ ev_token_bucket_update_(&bev->rate_limiting->limit,
+ bev->rate_limiting->cfg,
+ tick);
+
+ /* Now unsuspend any read/write operations as appropriate. */
+ if ((bev->read_suspended & BEV_SUSPEND_BW)) {
+ if (bev->rate_limiting->limit.read_limit > 0)
+ bufferevent_unsuspend_read_(&bev->bev, BEV_SUSPEND_BW);
+ else
+ again = 1;
+ }
+ if ((bev->write_suspended & BEV_SUSPEND_BW)) {
+ if (bev->rate_limiting->limit.write_limit > 0)
+ bufferevent_unsuspend_write_(&bev->bev, BEV_SUSPEND_BW);
+ else
+ again = 1;
+ }
+ if (again) {
+ /* One or more of the buckets may need another refill if they
+ started negative.
+
+ XXXX if we need to be quiet for more ticks, we should
+ maybe figure out what timeout we really want.
+ */
+ /* XXXX Handle event_add failure somehow */
+ event_add(&bev->rate_limiting->refill_bucket_event,
+ &bev->rate_limiting->cfg->tick_timeout);
+ }
+ BEV_UNLOCK(&bev->bev);
+}
+
+/** Helper: grab a random element from a bufferevent group.
+ *
+ * Requires that we hold the lock on the group.
+ */
+static struct bufferevent_private *
+bev_group_random_element_(struct bufferevent_rate_limit_group *group)
+{
+ int which;
+ struct bufferevent_private *bev;
+
+ /* requires group lock */
+
+ if (!group->n_members)
+ return NULL;
+
+ EVUTIL_ASSERT(! LIST_EMPTY(&group->members));
+
+ which = evutil_weakrand_range_(&group->weakrand_seed, group->n_members);
+
+ bev = LIST_FIRST(&group->members);
+ while (which--)
+ bev = LIST_NEXT(bev, rate_limiting->next_in_group);
+
+ return bev;
+}
+
+/** Iterate over the elements of a rate-limiting group 'g' with a random
+ starting point, assigning each to the variable 'bev', and executing the
+ block 'block'.
+
+ We do this in a half-baked effort to get fairness among group members.
+ XXX Round-robin or some kind of priority queue would be even more fair.
+ */
+#define FOREACH_RANDOM_ORDER(block) \
+ do { \
+ first = bev_group_random_element_(g); \
+ for (bev = first; bev != LIST_END(&g->members); \
+ bev = LIST_NEXT(bev, rate_limiting->next_in_group)) { \
+ block ; \
+ } \
+ for (bev = LIST_FIRST(&g->members); bev && bev != first; \
+ bev = LIST_NEXT(bev, rate_limiting->next_in_group)) { \
+ block ; \
+ } \
+ } while (0)
+
+static void
+bev_group_unsuspend_reading_(struct bufferevent_rate_limit_group *g)
+{
+ int again = 0;
+ struct bufferevent_private *bev, *first;
+
+ g->read_suspended = 0;
+ FOREACH_RANDOM_ORDER({
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_unsuspend_read_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ } else {
+ again = 1;
+ }
+ });
+ g->pending_unsuspend_read = again;
+}
+
+static void
+bev_group_unsuspend_writing_(struct bufferevent_rate_limit_group *g)
+{
+ int again = 0;
+ struct bufferevent_private *bev, *first;
+ g->write_suspended = 0;
+
+ FOREACH_RANDOM_ORDER({
+ if (EVLOCK_TRY_LOCK_(bev->lock)) {
+ bufferevent_unsuspend_write_(&bev->bev,
+ BEV_SUSPEND_BW_GROUP);
+ EVLOCK_UNLOCK(bev->lock, 0);
+ } else {
+ again = 1;
+ }
+ });
+ g->pending_unsuspend_write = again;
+}
+
+/** Callback invoked every tick to add more elements to the group bucket
+ and unsuspend group members as needed.
+ */
+static void
+bev_group_refill_callback_(evutil_socket_t fd, short what, void *arg)
+{
+ struct bufferevent_rate_limit_group *g = arg;
+ unsigned tick;
+ struct timeval now;
+
+ event_base_gettimeofday_cached(event_get_base(&g->master_refill_event), &now);
+
+ LOCK_GROUP(g);
+
+ tick = ev_token_bucket_get_tick_(&now, &g->rate_limit_cfg);
+ ev_token_bucket_update_(&g->rate_limit, &g->rate_limit_cfg, tick);
+
+ if (g->pending_unsuspend_read ||
+ (g->read_suspended && (g->rate_limit.read_limit >= g->min_share))) {
+ bev_group_unsuspend_reading_(g);
+ }
+ if (g->pending_unsuspend_write ||
+ (g->write_suspended && (g->rate_limit.write_limit >= g->min_share))){
+ bev_group_unsuspend_writing_(g);
+ }
+
+ /* XXXX Rather than waiting to the next tick to unsuspend stuff
+ * with pending_unsuspend_write/read, we should do it on the
+ * next iteration of the mainloop.
+ */
+
+ UNLOCK_GROUP(g);
+}
+
+int
+bufferevent_set_rate_limit(struct bufferevent *bev,
+ struct ev_token_bucket_cfg *cfg)
+{
+ struct bufferevent_private *bevp =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ int r = -1;
+ struct bufferevent_rate_limit *rlim;
+ struct timeval now;
+ ev_uint32_t tick;
+ int reinit = 0, suspended = 0;
+ /* XXX reference-count cfg */
+
+ BEV_LOCK(bev);
+
+ if (cfg == NULL) {
+ if (bevp->rate_limiting) {
+ rlim = bevp->rate_limiting;
+ rlim->cfg = NULL;
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW);
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW);
+ if (event_initialized(&rlim->refill_bucket_event))
+ event_del(&rlim->refill_bucket_event);
+ }
+ r = 0;
+ goto done;
+ }
+
+ event_base_gettimeofday_cached(bev->ev_base, &now);
+ tick = ev_token_bucket_get_tick_(&now, cfg);
+
+ if (bevp->rate_limiting && bevp->rate_limiting->cfg == cfg) {
+ /* no-op */
+ r = 0;
+ goto done;
+ }
+ if (bevp->rate_limiting == NULL) {
+ rlim = mm_calloc(1, sizeof(struct bufferevent_rate_limit));
+ if (!rlim)
+ goto done;
+ bevp->rate_limiting = rlim;
+ } else {
+ rlim = bevp->rate_limiting;
+ }
+ reinit = rlim->cfg != NULL;
+
+ rlim->cfg = cfg;
+ ev_token_bucket_init_(&rlim->limit, cfg, tick, reinit);
+
+ if (reinit) {
+ EVUTIL_ASSERT(event_initialized(&rlim->refill_bucket_event));
+ event_del(&rlim->refill_bucket_event);
+ }
+ event_assign(&rlim->refill_bucket_event, bev->ev_base,
+ -1, EV_FINALIZE, bev_refill_callback_, bevp);
+
+ if (rlim->limit.read_limit > 0) {
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW);
+ } else {
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_BW);
+ suspended=1;
+ }
+ if (rlim->limit.write_limit > 0) {
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW);
+ } else {
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_BW);
+ suspended = 1;
+ }
+
+ if (suspended)
+ event_add(&rlim->refill_bucket_event, &cfg->tick_timeout);
+
+ r = 0;
+
+done:
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+struct bufferevent_rate_limit_group *
+bufferevent_rate_limit_group_new(struct event_base *base,
+ const struct ev_token_bucket_cfg *cfg)
+{
+ struct bufferevent_rate_limit_group *g;
+ struct timeval now;
+ ev_uint32_t tick;
+
+ event_base_gettimeofday_cached(base, &now);
+ tick = ev_token_bucket_get_tick_(&now, cfg);
+
+ g = mm_calloc(1, sizeof(struct bufferevent_rate_limit_group));
+ if (!g)
+ return NULL;
+ memcpy(&g->rate_limit_cfg, cfg, sizeof(g->rate_limit_cfg));
+ LIST_INIT(&g->members);
+
+ ev_token_bucket_init_(&g->rate_limit, cfg, tick, 0);
+
+ event_assign(&g->master_refill_event, base, -1, EV_PERSIST|EV_FINALIZE,
+ bev_group_refill_callback_, g);
+ /*XXXX handle event_add failure */
+ event_add(&g->master_refill_event, &cfg->tick_timeout);
+
+ EVTHREAD_ALLOC_LOCK(g->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ bufferevent_rate_limit_group_set_min_share(g, 64);
+
+ evutil_weakrand_seed_(&g->weakrand_seed,
+ (ev_uint32_t) ((now.tv_sec + now.tv_usec) + (ev_intptr_t)g));
+
+ return g;
+}
+
+int
+bufferevent_rate_limit_group_set_cfg(
+ struct bufferevent_rate_limit_group *g,
+ const struct ev_token_bucket_cfg *cfg)
+{
+ int same_tick;
+ if (!g || !cfg)
+ return -1;
+
+ LOCK_GROUP(g);
+ same_tick = evutil_timercmp(
+ &g->rate_limit_cfg.tick_timeout, &cfg->tick_timeout, ==);
+ memcpy(&g->rate_limit_cfg, cfg, sizeof(g->rate_limit_cfg));
+
+ if (g->rate_limit.read_limit > (ev_ssize_t)cfg->read_maximum)
+ g->rate_limit.read_limit = cfg->read_maximum;
+ if (g->rate_limit.write_limit > (ev_ssize_t)cfg->write_maximum)
+ g->rate_limit.write_limit = cfg->write_maximum;
+
+ if (!same_tick) {
+ /* This can cause a hiccup in the schedule */
+ event_add(&g->master_refill_event, &cfg->tick_timeout);
+ }
+
+ /* The new limits might force us to adjust min_share differently. */
+ bufferevent_rate_limit_group_set_min_share(g, g->configured_min_share);
+
+ UNLOCK_GROUP(g);
+ return 0;
+}
+
+int
+bufferevent_rate_limit_group_set_min_share(
+ struct bufferevent_rate_limit_group *g,
+ size_t share)
+{
+ if (share > EV_SSIZE_MAX)
+ return -1;
+
+ g->configured_min_share = share;
+
+ /* Can't set share to less than the one-tick maximum. IOW, at steady
+ * state, at least one connection can go per tick. */
+ if (share > g->rate_limit_cfg.read_rate)
+ share = g->rate_limit_cfg.read_rate;
+ if (share > g->rate_limit_cfg.write_rate)
+ share = g->rate_limit_cfg.write_rate;
+
+ g->min_share = share;
+ return 0;
+}
+
+void
+bufferevent_rate_limit_group_free(struct bufferevent_rate_limit_group *g)
+{
+ LOCK_GROUP(g);
+ EVUTIL_ASSERT(0 == g->n_members);
+ event_del(&g->master_refill_event);
+ UNLOCK_GROUP(g);
+ EVTHREAD_FREE_LOCK(g->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(g);
+}
+
+int
+bufferevent_add_to_rate_limit_group(struct bufferevent *bev,
+ struct bufferevent_rate_limit_group *g)
+{
+ int wsuspend, rsuspend;
+ struct bufferevent_private *bevp =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ BEV_LOCK(bev);
+
+ if (!bevp->rate_limiting) {
+ struct bufferevent_rate_limit *rlim;
+ rlim = mm_calloc(1, sizeof(struct bufferevent_rate_limit));
+ if (!rlim) {
+ BEV_UNLOCK(bev);
+ return -1;
+ }
+ event_assign(&rlim->refill_bucket_event, bev->ev_base,
+ -1, EV_FINALIZE, bev_refill_callback_, bevp);
+ bevp->rate_limiting = rlim;
+ }
+
+ if (bevp->rate_limiting->group == g) {
+ BEV_UNLOCK(bev);
+ return 0;
+ }
+ if (bevp->rate_limiting->group)
+ bufferevent_remove_from_rate_limit_group(bev);
+
+ LOCK_GROUP(g);
+ bevp->rate_limiting->group = g;
+ ++g->n_members;
+ LIST_INSERT_HEAD(&g->members, bevp, rate_limiting->next_in_group);
+
+ rsuspend = g->read_suspended;
+ wsuspend = g->write_suspended;
+
+ UNLOCK_GROUP(g);
+
+ if (rsuspend)
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_BW_GROUP);
+ if (wsuspend)
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_BW_GROUP);
+
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+int
+bufferevent_remove_from_rate_limit_group(struct bufferevent *bev)
+{
+ return bufferevent_remove_from_rate_limit_group_internal_(bev, 1);
+}
+
+int
+bufferevent_remove_from_rate_limit_group_internal_(struct bufferevent *bev,
+ int unsuspend)
+{
+ struct bufferevent_private *bevp =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ BEV_LOCK(bev);
+ if (bevp->rate_limiting && bevp->rate_limiting->group) {
+ struct bufferevent_rate_limit_group *g =
+ bevp->rate_limiting->group;
+ LOCK_GROUP(g);
+ bevp->rate_limiting->group = NULL;
+ --g->n_members;
+ LIST_REMOVE(bevp, rate_limiting->next_in_group);
+ UNLOCK_GROUP(g);
+ }
+ if (unsuspend) {
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW_GROUP);
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW_GROUP);
+ }
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+/* ===
+ * API functions to expose rate limits.
+ *
+ * Don't use these from inside Libevent; they're meant to be for use by
+ * the program.
+ * === */
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_read_max_() is more likely what you want*/
+ev_ssize_t
+bufferevent_get_read_limit(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (bevp->rate_limiting && bevp->rate_limiting->cfg) {
+ bufferevent_update_buckets(bevp);
+ r = bevp->rate_limiting->limit.read_limit;
+ } else {
+ r = EV_SSIZE_MAX;
+ }
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_write_max_() is more likely what you want*/
+ev_ssize_t
+bufferevent_get_write_limit(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (bevp->rate_limiting && bevp->rate_limiting->cfg) {
+ bufferevent_update_buckets(bevp);
+ r = bevp->rate_limiting->limit.write_limit;
+ } else {
+ r = EV_SSIZE_MAX;
+ }
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+int
+bufferevent_set_max_single_read(struct bufferevent *bev, size_t size)
+{
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (size == 0 || size > EV_SSIZE_MAX)
+ bevp->max_single_read = MAX_SINGLE_READ_DEFAULT;
+ else
+ bevp->max_single_read = size;
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+int
+bufferevent_set_max_single_write(struct bufferevent *bev, size_t size)
+{
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ if (size == 0 || size > EV_SSIZE_MAX)
+ bevp->max_single_write = MAX_SINGLE_WRITE_DEFAULT;
+ else
+ bevp->max_single_write = size;
+ BEV_UNLOCK(bev);
+ return 0;
+}
+
+ev_ssize_t
+bufferevent_get_max_single_read(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+
+ BEV_LOCK(bev);
+ r = BEV_UPCAST(bev)->max_single_read;
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+ev_ssize_t
+bufferevent_get_max_single_write(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+
+ BEV_LOCK(bev);
+ r = BEV_UPCAST(bev)->max_single_write;
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+ev_ssize_t
+bufferevent_get_max_to_read(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ BEV_LOCK(bev);
+ r = bufferevent_get_read_max_(BEV_UPCAST(bev));
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+ev_ssize_t
+bufferevent_get_max_to_write(struct bufferevent *bev)
+{
+ ev_ssize_t r;
+ BEV_LOCK(bev);
+ r = bufferevent_get_write_max_(BEV_UPCAST(bev));
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+const struct ev_token_bucket_cfg *
+bufferevent_get_token_bucket_cfg(const struct bufferevent *bev) {
+ struct bufferevent_private *bufev_private = BEV_UPCAST(bev);
+ struct ev_token_bucket_cfg *cfg;
+
+ BEV_LOCK(bev);
+
+ if (bufev_private->rate_limiting) {
+ cfg = bufev_private->rate_limiting->cfg;
+ } else {
+ cfg = NULL;
+ }
+
+ BEV_UNLOCK(bev);
+
+ return cfg;
+}
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_read_max_() is more likely what you want*/
+ev_ssize_t
+bufferevent_rate_limit_group_get_read_limit(
+ struct bufferevent_rate_limit_group *grp)
+{
+ ev_ssize_t r;
+ LOCK_GROUP(grp);
+ r = grp->rate_limit.read_limit;
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+/* Mostly you don't want to use this function from inside libevent;
+ * bufferevent_get_write_max_() is more likely what you want. */
+ev_ssize_t
+bufferevent_rate_limit_group_get_write_limit(
+ struct bufferevent_rate_limit_group *grp)
+{
+ ev_ssize_t r;
+ LOCK_GROUP(grp);
+ r = grp->rate_limit.write_limit;
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+int
+bufferevent_decrement_read_limit(struct bufferevent *bev, ev_ssize_t decr)
+{
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ EVUTIL_ASSERT(bevp->rate_limiting && bevp->rate_limiting->cfg);
+ old_limit = bevp->rate_limiting->limit.read_limit;
+
+ new_limit = (bevp->rate_limiting->limit.read_limit -= decr);
+ if (old_limit > 0 && new_limit <= 0) {
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_BW);
+ if (event_add(&bevp->rate_limiting->refill_bucket_event,
+ &bevp->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (old_limit <= 0 && new_limit > 0) {
+ if (!(bevp->write_suspended & BEV_SUSPEND_BW))
+ event_del(&bevp->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_BW);
+ }
+
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+int
+bufferevent_decrement_write_limit(struct bufferevent *bev, ev_ssize_t decr)
+{
+ /* XXXX this is mostly copy-and-paste from
+ * bufferevent_decrement_read_limit */
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ struct bufferevent_private *bevp;
+ BEV_LOCK(bev);
+ bevp = BEV_UPCAST(bev);
+ EVUTIL_ASSERT(bevp->rate_limiting && bevp->rate_limiting->cfg);
+ old_limit = bevp->rate_limiting->limit.write_limit;
+
+ new_limit = (bevp->rate_limiting->limit.write_limit -= decr);
+ if (old_limit > 0 && new_limit <= 0) {
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_BW);
+ if (event_add(&bevp->rate_limiting->refill_bucket_event,
+ &bevp->rate_limiting->cfg->tick_timeout) < 0)
+ r = -1;
+ } else if (old_limit <= 0 && new_limit > 0) {
+ if (!(bevp->read_suspended & BEV_SUSPEND_BW))
+ event_del(&bevp->rate_limiting->refill_bucket_event);
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_BW);
+ }
+
+ BEV_UNLOCK(bev);
+ return r;
+}
+
+int
+bufferevent_rate_limit_group_decrement_read(
+ struct bufferevent_rate_limit_group *grp, ev_ssize_t decr)
+{
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ LOCK_GROUP(grp);
+ old_limit = grp->rate_limit.read_limit;
+ new_limit = (grp->rate_limit.read_limit -= decr);
+
+ if (old_limit > 0 && new_limit <= 0) {
+ bev_group_suspend_reading_(grp);
+ } else if (old_limit <= 0 && new_limit > 0) {
+ bev_group_unsuspend_reading_(grp);
+ }
+
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+int
+bufferevent_rate_limit_group_decrement_write(
+ struct bufferevent_rate_limit_group *grp, ev_ssize_t decr)
+{
+ int r = 0;
+ ev_ssize_t old_limit, new_limit;
+ LOCK_GROUP(grp);
+ old_limit = grp->rate_limit.write_limit;
+ new_limit = (grp->rate_limit.write_limit -= decr);
+
+ if (old_limit > 0 && new_limit <= 0) {
+ bev_group_suspend_writing_(grp);
+ } else if (old_limit <= 0 && new_limit > 0) {
+ bev_group_unsuspend_writing_(grp);
+ }
+
+ UNLOCK_GROUP(grp);
+ return r;
+}
+
+void
+bufferevent_rate_limit_group_get_totals(struct bufferevent_rate_limit_group *grp,
+ ev_uint64_t *total_read_out, ev_uint64_t *total_written_out)
+{
+ EVUTIL_ASSERT(grp != NULL);
+ if (total_read_out)
+ *total_read_out = grp->total_read;
+ if (total_written_out)
+ *total_written_out = grp->total_written;
+}
+
+void
+bufferevent_rate_limit_group_reset_totals(struct bufferevent_rate_limit_group *grp)
+{
+ grp->total_read = grp->total_written = 0;
+}
+
+int
+bufferevent_ratelim_init_(struct bufferevent_private *bev)
+{
+ bev->rate_limiting = NULL;
+ bev->max_single_read = MAX_SINGLE_READ_DEFAULT;
+ bev->max_single_write = MAX_SINGLE_WRITE_DEFAULT;
+
+ return 0;
+}
diff --git a/sntp/libevent/bufferevent_sock.c b/sntp/libevent/bufferevent_sock.c
new file mode 100644
index 0000000..49ebc0b
--- /dev/null
+++ b/sntp/libevent/bufferevent_sock.c
@@ -0,0 +1,709 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright (c) 2002-2006 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/event.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+#include "util-internal.h"
+#ifdef _WIN32
+#include "iocp-internal.h"
+#endif
+
+/* prototypes */
+static int be_socket_enable(struct bufferevent *, short);
+static int be_socket_disable(struct bufferevent *, short);
+static void be_socket_destruct(struct bufferevent *);
+static int be_socket_adj_timeouts(struct bufferevent *);
+static int be_socket_flush(struct bufferevent *, short, enum bufferevent_flush_mode);
+static int be_socket_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *);
+
+static void be_socket_setfd(struct bufferevent *, evutil_socket_t);
+
+const struct bufferevent_ops bufferevent_ops_socket = {
+ "socket",
+ evutil_offsetof(struct bufferevent_private, bev),
+ be_socket_enable,
+ be_socket_disable,
+ NULL, /* unlink */
+ be_socket_destruct,
+ be_socket_adj_timeouts,
+ be_socket_flush,
+ be_socket_ctrl,
+};
+
+#define be_socket_add(ev, t) \
+ bufferevent_add_event_((ev), (t))
+
+static void
+bufferevent_socket_outbuf_cb(struct evbuffer *buf,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+ struct bufferevent *bufev = arg;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ if (cbinfo->n_added &&
+ (bufev->enabled & EV_WRITE) &&
+ !event_pending(&bufev->ev_write, EV_WRITE, NULL) &&
+ !bufev_p->write_suspended) {
+ /* Somebody added data to the buffer, and we would like to
+ * write, and we were not writing. So, start writing. */
+ if (be_socket_add(&bufev->ev_write, &bufev->timeout_write) == -1) {
+ /* Should we log this? */
+ }
+ }
+}
+
+static void
+bufferevent_readcb(evutil_socket_t fd, short event, void *arg)
+{
+ struct bufferevent *bufev = arg;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ struct evbuffer *input;
+ int res = 0;
+ short what = BEV_EVENT_READING;
+ ev_ssize_t howmuch = -1, readmax=-1;
+
+ bufferevent_incref_and_lock_(bufev);
+
+ if (event == EV_TIMEOUT) {
+ /* Note that we only check for event==EV_TIMEOUT. If
+ * event==EV_TIMEOUT|EV_READ, we can safely ignore the
+ * timeout, since a read has occurred */
+ what |= BEV_EVENT_TIMEOUT;
+ goto error;
+ }
+
+ input = bufev->input;
+
+ /*
+ * If we have a high watermark configured then we don't want to
+ * read more data than would make us reach the watermark.
+ */
+ if (bufev->wm_read.high != 0) {
+ howmuch = bufev->wm_read.high - evbuffer_get_length(input);
+ /* we somehow lowered the watermark, stop reading */
+ if (howmuch <= 0) {
+ bufferevent_wm_suspend_read(bufev);
+ goto done;
+ }
+ }
+ readmax = bufferevent_get_read_max_(bufev_p);
+ if (howmuch < 0 || howmuch > readmax) /* The use of -1 for "unlimited"
+ * uglifies this code. XXXX */
+ howmuch = readmax;
+ if (bufev_p->read_suspended)
+ goto done;
+
+ evbuffer_unfreeze(input, 0);
+ res = evbuffer_read(input, fd, (int)howmuch); /* XXXX evbuffer_read would do better to take and return ev_ssize_t */
+ evbuffer_freeze(input, 0);
+
+ if (res == -1) {
+ int err = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ goto reschedule;
+ /* error case */
+ what |= BEV_EVENT_ERROR;
+ } else if (res == 0) {
+ /* eof case */
+ what |= BEV_EVENT_EOF;
+ }
+
+ if (res <= 0)
+ goto error;
+
+ bufferevent_decrement_read_buckets_(bufev_p, res);
+
+ /* Invoke the user callback - must always be called last */
+ bufferevent_trigger_nolock_(bufev, EV_READ, 0);
+
+ goto done;
+
+ reschedule:
+ goto done;
+
+ error:
+ bufferevent_disable(bufev, EV_READ);
+ bufferevent_run_eventcb_(bufev, what, 0);
+
+ done:
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+static void
+bufferevent_writecb(evutil_socket_t fd, short event, void *arg)
+{
+ struct bufferevent *bufev = arg;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ int res = 0;
+ short what = BEV_EVENT_WRITING;
+ int connected = 0;
+ ev_ssize_t atmost = -1;
+
+ bufferevent_incref_and_lock_(bufev);
+
+ if (event == EV_TIMEOUT) {
+ /* Note that we only check for event==EV_TIMEOUT. If
+ * event==EV_TIMEOUT|EV_WRITE, we can safely ignore the
+ * timeout, since a read has occurred */
+ what |= BEV_EVENT_TIMEOUT;
+ goto error;
+ }
+ if (bufev_p->connecting) {
+ int c = evutil_socket_finished_connecting_(fd);
+ /* we need to fake the error if the connection was refused
+ * immediately - usually connection to localhost on BSD */
+ if (bufev_p->connection_refused) {
+ bufev_p->connection_refused = 0;
+ c = -1;
+ }
+
+ if (c == 0)
+ goto done;
+
+ bufev_p->connecting = 0;
+ if (c < 0) {
+ event_del(&bufev->ev_write);
+ event_del(&bufev->ev_read);
+ bufferevent_run_eventcb_(bufev, BEV_EVENT_ERROR, 0);
+ goto done;
+ } else {
+ connected = 1;
+#ifdef _WIN32
+ if (BEV_IS_ASYNC(bufev)) {
+ event_del(&bufev->ev_write);
+ bufferevent_async_set_connected_(bufev);
+ bufferevent_run_eventcb_(bufev,
+ BEV_EVENT_CONNECTED, 0);
+ goto done;
+ }
+#endif
+ bufferevent_run_eventcb_(bufev,
+ BEV_EVENT_CONNECTED, 0);
+ if (!(bufev->enabled & EV_WRITE) ||
+ bufev_p->write_suspended) {
+ event_del(&bufev->ev_write);
+ goto done;
+ }
+ }
+ }
+
+ atmost = bufferevent_get_write_max_(bufev_p);
+
+ if (bufev_p->write_suspended)
+ goto done;
+
+ if (evbuffer_get_length(bufev->output)) {
+ evbuffer_unfreeze(bufev->output, 1);
+ res = evbuffer_write_atmost(bufev->output, fd, atmost);
+ evbuffer_freeze(bufev->output, 1);
+ if (res == -1) {
+ int err = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ goto reschedule;
+ what |= BEV_EVENT_ERROR;
+ } else if (res == 0) {
+ /* eof case
+ XXXX Actually, a 0 on write doesn't indicate
+ an EOF. An ECONNRESET might be more typical.
+ */
+ what |= BEV_EVENT_EOF;
+ }
+ if (res <= 0)
+ goto error;
+
+ bufferevent_decrement_write_buckets_(bufev_p, res);
+ }
+
+ if (evbuffer_get_length(bufev->output) == 0) {
+ event_del(&bufev->ev_write);
+ }
+
+ /*
+ * Invoke the user callback if our buffer is drained or below the
+ * low watermark.
+ */
+ if (res || !connected) {
+ bufferevent_trigger_nolock_(bufev, EV_WRITE, 0);
+ }
+
+ goto done;
+
+ reschedule:
+ if (evbuffer_get_length(bufev->output) == 0) {
+ event_del(&bufev->ev_write);
+ }
+ goto done;
+
+ error:
+ bufferevent_disable(bufev, EV_WRITE);
+ bufferevent_run_eventcb_(bufev, what, 0);
+
+ done:
+ bufferevent_decref_and_unlock_(bufev);
+}
+
+struct bufferevent *
+bufferevent_socket_new(struct event_base *base, evutil_socket_t fd,
+ int options)
+{
+ struct bufferevent_private *bufev_p;
+ struct bufferevent *bufev;
+
+#ifdef _WIN32
+ if (base && event_base_get_iocp_(base))
+ return bufferevent_async_new_(base, fd, options);
+#endif
+
+ if ((bufev_p = mm_calloc(1, sizeof(struct bufferevent_private)))== NULL)
+ return NULL;
+
+ if (bufferevent_init_common_(bufev_p, base, &bufferevent_ops_socket,
+ options) < 0) {
+ mm_free(bufev_p);
+ return NULL;
+ }
+ bufev = &bufev_p->bev;
+ evbuffer_set_flags(bufev->output, EVBUFFER_FLAG_DRAINS_TO_FD);
+
+ event_assign(&bufev->ev_read, bufev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE, bufferevent_readcb, bufev);
+ event_assign(&bufev->ev_write, bufev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE, bufferevent_writecb, bufev);
+
+ evbuffer_add_cb(bufev->output, bufferevent_socket_outbuf_cb, bufev);
+
+ evbuffer_freeze(bufev->input, 0);
+ evbuffer_freeze(bufev->output, 1);
+
+ return bufev;
+}
+
+int
+bufferevent_socket_connect(struct bufferevent *bev,
+ struct sockaddr *sa, int socklen)
+{
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+
+ evutil_socket_t fd;
+ int r = 0;
+ int result=-1;
+ int ownfd = 0;
+
+ bufferevent_incref_and_lock_(bev);
+
+ if (!bufev_p)
+ goto done;
+
+ fd = bufferevent_getfd(bev);
+ if (fd < 0) {
+ if (!sa)
+ goto done;
+ fd = evutil_socket_(sa->sa_family,
+ SOCK_STREAM|EVUTIL_SOCK_NONBLOCK, 0);
+ if (fd < 0)
+ goto done;
+ ownfd = 1;
+ }
+ if (sa) {
+#ifdef _WIN32
+ if (bufferevent_async_can_connect_(bev)) {
+ bufferevent_setfd(bev, fd);
+ r = bufferevent_async_connect_(bev, fd, sa, socklen);
+ if (r < 0)
+ goto freesock;
+ bufev_p->connecting = 1;
+ result = 0;
+ goto done;
+ } else
+#endif
+ r = evutil_socket_connect_(&fd, sa, socklen);
+ if (r < 0)
+ goto freesock;
+ }
+#ifdef _WIN32
+ /* ConnectEx() isn't always around, even when IOCP is enabled.
+ * Here, we borrow the socket object's write handler to fall back
+ * on a non-blocking connect() when ConnectEx() is unavailable. */
+ if (BEV_IS_ASYNC(bev)) {
+ event_assign(&bev->ev_write, bev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE, bufferevent_writecb, bev);
+ }
+#endif
+ bufferevent_setfd(bev, fd);
+ if (r == 0) {
+ if (! be_socket_enable(bev, EV_WRITE)) {
+ bufev_p->connecting = 1;
+ result = 0;
+ goto done;
+ }
+ } else if (r == 1) {
+ /* The connect succeeded already. How very BSD of it. */
+ result = 0;
+ bufev_p->connecting = 1;
+ event_active(&bev->ev_write, EV_WRITE, 1);
+ } else {
+ /* The connect failed already. How very BSD of it. */
+ bufev_p->connection_refused = 1;
+ bufev_p->connecting = 1;
+ result = 0;
+ event_active(&bev->ev_write, EV_WRITE, 1);
+ }
+
+ goto done;
+
+freesock:
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ if (ownfd)
+ evutil_closesocket(fd);
+ /* do something about the error? */
+done:
+ bufferevent_decref_and_unlock_(bev);
+ return result;
+}
+
+static void
+bufferevent_connect_getaddrinfo_cb(int result, struct evutil_addrinfo *ai,
+ void *arg)
+{
+ struct bufferevent *bev = arg;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+ int r;
+ BEV_LOCK(bev);
+
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_LOOKUP);
+
+ if (result != 0) {
+ bev_p->dns_error = result;
+ bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0);
+ bufferevent_decref_and_unlock_(bev);
+ if (ai)
+ evutil_freeaddrinfo(ai);
+ return;
+ }
+
+ /* XXX use the other addrinfos? */
+ /* XXX use this return value */
+ r = bufferevent_socket_connect(bev, ai->ai_addr, (int)ai->ai_addrlen);
+ (void)r;
+ bufferevent_decref_and_unlock_(bev);
+ evutil_freeaddrinfo(ai);
+}
+
+int
+bufferevent_socket_connect_hostname(struct bufferevent *bev,
+ struct evdns_base *evdns_base, int family, const char *hostname, int port)
+{
+ char portbuf[10];
+ struct evutil_addrinfo hint;
+ int err;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+
+ if (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC)
+ return -1;
+ if (port < 1 || port > 65535)
+ return -1;
+
+ BEV_LOCK(bev);
+ bev_p->dns_error = 0;
+ BEV_UNLOCK(bev);
+
+ evutil_snprintf(portbuf, sizeof(portbuf), "%d", port);
+
+ memset(&hint, 0, sizeof(hint));
+ hint.ai_family = family;
+ hint.ai_protocol = IPPROTO_TCP;
+ hint.ai_socktype = SOCK_STREAM;
+
+ bufferevent_suspend_write_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_suspend_read_(bev, BEV_SUSPEND_LOOKUP);
+
+ bufferevent_incref_(bev);
+ err = evutil_getaddrinfo_async_(evdns_base, hostname, portbuf,
+ &hint, bufferevent_connect_getaddrinfo_cb, bev);
+
+ if (err == 0) {
+ return 0;
+ } else {
+ bufferevent_unsuspend_write_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_unsuspend_read_(bev, BEV_SUSPEND_LOOKUP);
+ bufferevent_decref_(bev);
+ return -1;
+ }
+}
+
+int
+bufferevent_socket_get_dns_error(struct bufferevent *bev)
+{
+ int rv;
+ struct bufferevent_private *bev_p =
+ EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bev);
+ rv = bev_p->dns_error;
+ BEV_UNLOCK(bev);
+
+ return rv;
+}
+
+/*
+ * Create a new buffered event object.
+ *
+ * The read callback is invoked whenever we read new data.
+ * The write callback is invoked whenever the output buffer is drained.
+ * The error callback is invoked on a write/read error or on EOF.
+ *
+ * Both read and write callbacks maybe NULL. The error callback is not
+ * allowed to be NULL and have to be provided always.
+ */
+
+struct bufferevent *
+bufferevent_new(evutil_socket_t fd,
+ bufferevent_data_cb readcb, bufferevent_data_cb writecb,
+ bufferevent_event_cb eventcb, void *cbarg)
+{
+ struct bufferevent *bufev;
+
+ if (!(bufev = bufferevent_socket_new(NULL, fd, 0)))
+ return NULL;
+
+ bufferevent_setcb(bufev, readcb, writecb, eventcb, cbarg);
+
+ return bufev;
+}
+
+
+static int
+be_socket_enable(struct bufferevent *bufev, short event)
+{
+ if (event & EV_READ) {
+ if (be_socket_add(&bufev->ev_read,&bufev->timeout_read) == -1)
+ return -1;
+ }
+ if (event & EV_WRITE) {
+ if (be_socket_add(&bufev->ev_write,&bufev->timeout_write) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+static int
+be_socket_disable(struct bufferevent *bufev, short event)
+{
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ if (event & EV_READ) {
+ if (event_del(&bufev->ev_read) == -1)
+ return -1;
+ }
+ /* Don't actually disable the write if we are trying to connect. */
+ if ((event & EV_WRITE) && ! bufev_p->connecting) {
+ if (event_del(&bufev->ev_write) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+static void
+be_socket_destruct(struct bufferevent *bufev)
+{
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+ evutil_socket_t fd;
+ EVUTIL_ASSERT(bufev->be_ops == &bufferevent_ops_socket);
+
+ fd = event_get_fd(&bufev->ev_read);
+
+ if ((bufev_p->options & BEV_OPT_CLOSE_ON_FREE) && fd >= 0)
+ EVUTIL_CLOSESOCKET(fd);
+}
+
+static int
+be_socket_adj_timeouts(struct bufferevent *bufev)
+{
+ int r = 0;
+ if (event_pending(&bufev->ev_read, EV_READ, NULL)) {
+ if (evutil_timerisset(&bufev->timeout_read)) {
+ if (be_socket_add(&bufev->ev_read, &bufev->timeout_read) < 0)
+ r = -1;
+ } else {
+ event_remove_timer(&bufev->ev_read);
+ }
+ }
+ if (event_pending(&bufev->ev_write, EV_WRITE, NULL)) {
+ if (evutil_timerisset(&bufev->timeout_write)) {
+ if (be_socket_add(&bufev->ev_write, &bufev->timeout_write) < 0)
+ r = -1;
+ } else {
+ event_remove_timer(&bufev->ev_write);
+ }
+ }
+ return r;
+}
+
+static int
+be_socket_flush(struct bufferevent *bev, short iotype,
+ enum bufferevent_flush_mode mode)
+{
+ return 0;
+}
+
+
+static void
+be_socket_setfd(struct bufferevent *bufev, evutil_socket_t fd)
+{
+ BEV_LOCK(bufev);
+ EVUTIL_ASSERT(bufev->be_ops == &bufferevent_ops_socket);
+
+ event_del(&bufev->ev_read);
+ event_del(&bufev->ev_write);
+
+ event_assign(&bufev->ev_read, bufev->ev_base, fd,
+ EV_READ|EV_PERSIST|EV_FINALIZE, bufferevent_readcb, bufev);
+ event_assign(&bufev->ev_write, bufev->ev_base, fd,
+ EV_WRITE|EV_PERSIST|EV_FINALIZE, bufferevent_writecb, bufev);
+
+ if (fd >= 0)
+ bufferevent_enable(bufev, bufev->enabled);
+
+ BEV_UNLOCK(bufev);
+}
+
+/* XXXX Should non-socket bufferevents support this? */
+int
+bufferevent_priority_set(struct bufferevent *bufev, int priority)
+{
+ int r = -1;
+ struct bufferevent_private *bufev_p =
+ EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
+
+ BEV_LOCK(bufev);
+ if (bufev->be_ops != &bufferevent_ops_socket)
+ goto done;
+
+ if (event_priority_set(&bufev->ev_read, priority) == -1)
+ goto done;
+ if (event_priority_set(&bufev->ev_write, priority) == -1)
+ goto done;
+
+ event_deferred_cb_set_priority_(&bufev_p->deferred, priority);
+
+ r = 0;
+done:
+ BEV_UNLOCK(bufev);
+ return r;
+}
+
+/* XXXX Should non-socket bufferevents support this? */
+int
+bufferevent_base_set(struct event_base *base, struct bufferevent *bufev)
+{
+ int res = -1;
+
+ BEV_LOCK(bufev);
+ if (bufev->be_ops != &bufferevent_ops_socket)
+ goto done;
+
+ bufev->ev_base = base;
+
+ res = event_base_set(base, &bufev->ev_read);
+ if (res == -1)
+ goto done;
+
+ res = event_base_set(base, &bufev->ev_write);
+done:
+ BEV_UNLOCK(bufev);
+ return res;
+}
+
+static int
+be_socket_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op,
+ union bufferevent_ctrl_data *data)
+{
+ switch (op) {
+ case BEV_CTRL_SET_FD:
+ be_socket_setfd(bev, data->fd);
+ return 0;
+ case BEV_CTRL_GET_FD:
+ data->fd = event_get_fd(&bev->ev_read);
+ return 0;
+ case BEV_CTRL_GET_UNDERLYING:
+ case BEV_CTRL_CANCEL_ALL:
+ default:
+ return -1;
+ }
+}
diff --git a/sntp/libevent/build-aux/compile b/sntp/libevent/build-aux/compile
new file mode 100755
index 0000000..c0096a7
--- /dev/null
+++ b/sntp/libevent/build-aux/compile
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2009-10-06.20; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
+# Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/sntp/libevent/build-aux/config.guess b/sntp/libevent/build-aux/config.guess
new file mode 100755
index 0000000..b02565c
--- /dev/null
+++ b/sntp/libevent/build-aux/config.guess
@@ -0,0 +1,1517 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
+
+timestamp='2011-06-03'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/sntp/libevent/build-aux/config.sub b/sntp/libevent/build-aux/config.sub
new file mode 100755
index 0000000..f9fcdc8
--- /dev/null
+++ b/sntp/libevent/build-aux/config.sub
@@ -0,0 +1,1756 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
+
+timestamp='2011-06-03'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | open8 \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/sntp/libevent/build-aux/depcomp b/sntp/libevent/build-aux/depcomp
new file mode 100755
index 0000000..df8eea7
--- /dev/null
+++ b/sntp/libevent/build-aux/depcomp
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
+# Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u="sed s,\\\\\\\\,/,g"
+ depmode=msvisualcpp
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> "$depfile"
+ echo >> "$depfile"
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/sntp/libevent/build-aux/install-sh b/sntp/libevent/build-aux/install-sh
new file mode 100755
index 0000000..6781b98
--- /dev/null
+++ b/sntp/libevent/build-aux/install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/sntp/libevent/build-aux/ltmain.sh b/sntp/libevent/build-aux/ltmain.sh
new file mode 100755
index 0000000..3061e3c
--- /dev/null
+++ b/sntp/libevent/build-aux/ltmain.sh
@@ -0,0 +1,9636 @@
+
+# libtool (GNU libtool) 2.4
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4
+TIMESTAMP=""
+package_revision=1.3293
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${EGREP="grep -E"}
+: ${FGREP="grep -F"}
+: ${GREP="grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=:
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
+
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_apped perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/sntp/libevent/build-aux/missing b/sntp/libevent/build-aux/missing
new file mode 100755
index 0000000..28055d2
--- /dev/null
+++ b/sntp/libevent/build-aux/missing
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar*)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar*)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/sntp/libevent/build-aux/ylwrap b/sntp/libevent/build-aux/ylwrap
new file mode 100755
index 0000000..84d5634
--- /dev/null
+++ b/sntp/libevent/build-aux/ylwrap
@@ -0,0 +1,222 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
+# 2007, 2009 Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case "$1" in
+ '')
+ echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
+ exit 1
+ ;;
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ -h|--h*)
+ cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+ INPUT is the input file
+ OUTPUT is one file PROG generates
+ DESIRED is the file we actually want instead of OUTPUT
+ PROGRAM is program to run
+ ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v|--v*)
+ echo "ylwrap $scriptversion"
+ exit $?
+ ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+case "$input" in
+ [\\/]* | ?:[\\/]*)
+ # Absolute path; do nothing.
+ ;;
+ *)
+ # Relative path. Make it absolute.
+ input="`pwd`/$input"
+ ;;
+esac
+
+pairlist=
+while test "$#" -ne 0; do
+ if test "$1" = "--"; then
+ shift
+ break
+ fi
+ pairlist="$pairlist $1"
+ shift
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+ [\\/]* | ?:[\\/]*) ;;
+ *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines. But that might take us over the 14-char limit.
+dirname=ylwrap$$
+trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+ 0) "$prog" "$input" ;;
+ *) "$prog" "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+ set X $pairlist
+ shift
+ first=yes
+ # Since DOS filename conventions don't allow two dots,
+ # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+ # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+ y_tab_nodot="no"
+ if test -f y_tab.c || test -f y_tab.h; then
+ y_tab_nodot="yes"
+ fi
+
+ # The directory holding the input.
+ input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
+ # Quote $INPUT_DIR so we can use it in a regexp.
+ # FIXME: really we should care about more than `.' and `\'.
+ input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
+ while test "$#" -ne 0; do
+ from="$1"
+ # Handle y_tab.c and y_tab.h output by DOS
+ if test $y_tab_nodot = "yes"; then
+ if test $from = "y.tab.c"; then
+ from="y_tab.c"
+ else
+ if test $from = "y.tab.h"; then
+ from="y_tab.h"
+ fi
+ fi
+ fi
+ if test -f "$from"; then
+ # If $2 is an absolute path name, then just use that,
+ # otherwise prepend `../'.
+ case "$2" in
+ [\\/]* | ?:[\\/]*) target="$2";;
+ *) target="../$2";;
+ esac
+
+ # We do not want to overwrite a header file if it hasn't
+ # changed. This avoid useless recompilations. However the
+ # parser itself (the first file) should always be updated,
+ # because it is the destination of the .y.c rule in the
+ # Makefile. Divert the output of all other files to a temporary
+ # file so we can compare them to existing versions.
+ if test $first = no; then
+ realtarget="$target"
+ target="tmp-`echo $target | sed s/.*[\\/]//g`"
+ fi
+ # Edit out `#line' or `#' directives.
+ #
+ # We don't want the resulting debug information to point at
+ # an absolute srcdir; it is better for it to just mention the
+ # .y file with no path.
+ #
+ # We want to use the real output file name, not yy.lex.c for
+ # instance.
+ #
+ # We want the include guards to be adjusted too.
+ FROM=`echo "$from" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+ TARGET=`echo "$2" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+
+ sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
+
+ # Check whether header files must be updated.
+ if test $first = no; then
+ if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+ echo "$2" is unchanged
+ rm -f "$target"
+ else
+ echo updating "$2"
+ mv -f "$target" "$realtarget"
+ fi
+ fi
+ else
+ # A missing file is only an error for the first file. This
+ # is a blatant hack to let us support using "yacc -d". If -d
+ # is not specified, we don't want an error when the header
+ # file is "missing".
+ if test $first = yes; then
+ ret=1
+ fi
+ fi
+ shift
+ shift
+ first=no
+ done
+else
+ ret=$?
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/sntp/libevent/changelist-internal.h b/sntp/libevent/changelist-internal.h
new file mode 100644
index 0000000..98fc52a
--- /dev/null
+++ b/sntp/libevent/changelist-internal.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef CHANGELIST_INTERNAL_H_INCLUDED_
+#define CHANGELIST_INTERNAL_H_INCLUDED_
+
+/*
+ A "changelist" is a list of all the fd status changes that should be made
+ between calls to the backend's dispatch function. There are a few reasons
+ that a backend would want to queue changes like this rather than processing
+ them immediately.
+
+ 1) Sometimes applications will add and delete the same event more than
+ once between calls to dispatch. Processing these changes immediately
+ is needless, and potentially expensive (especially if we're on a system
+ that makes one syscall per changed event).
+
+ 2) Sometimes we can coalesce multiple changes on the same fd into a single
+ syscall if we know about them in advance. For example, epoll can do an
+ add and a delete at the same time, but only if we have found out about
+ both of them before we tell epoll.
+
+ 3) Sometimes adding an event that we immediately delete can cause
+ unintended consequences: in kqueue, this makes pending events get
+ reported spuriously.
+ */
+
+#include "event2/util.h"
+
+/** Represents a */
+struct event_change {
+ /** The fd or signal whose events are to be changed */
+ evutil_socket_t fd;
+ /* The events that were enabled on the fd before any of these changes
+ were made. May include EV_READ or EV_WRITE. */
+ short old_events;
+
+ /* The changes that we want to make in reading and writing on this fd.
+ * If this is a signal, then read_change has EV_CHANGE_SIGNAL set,
+ * and write_change is unused. */
+ ev_uint8_t read_change;
+ ev_uint8_t write_change;
+ ev_uint8_t close_change;
+};
+
+/* Flags for read_change and write_change. */
+
+/* If set, add the event. */
+#define EV_CHANGE_ADD 0x01
+/* If set, delete the event. Exclusive with EV_CHANGE_ADD */
+#define EV_CHANGE_DEL 0x02
+/* If set, this event refers a signal, not an fd. */
+#define EV_CHANGE_SIGNAL EV_SIGNAL
+/* Set for persistent events. Currently not used. */
+#define EV_CHANGE_PERSIST EV_PERSIST
+/* Set for adding edge-triggered events. */
+#define EV_CHANGE_ET EV_ET
+
+/* The value of fdinfo_size that a backend should use if it is letting
+ * changelist handle its add and delete functions. */
+#define EVENT_CHANGELIST_FDINFO_SIZE sizeof(int)
+
+/** Set up the data fields in a changelist. */
+void event_changelist_init_(struct event_changelist *changelist);
+/** Remove every change in the changelist, and make corresponding changes
+ * in the event maps in the base. This function is generally used right
+ * after making all the changes in the changelist. */
+void event_changelist_remove_all_(struct event_changelist *changelist,
+ struct event_base *base);
+/** Free all memory held in a changelist. */
+void event_changelist_freemem_(struct event_changelist *changelist);
+
+/** Implementation of eventop_add that queues the event in a changelist. */
+int event_changelist_add_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p);
+/** Implementation of eventop_del that queues the event in a changelist. */
+int event_changelist_del_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p);
+
+#endif
diff --git a/sntp/libevent/compat/sys/queue.h b/sntp/libevent/compat/sys/queue.h
new file mode 100644
index 0000000..c387bdc
--- /dev/null
+++ b/sntp/libevent/compat/sys/queue.h
@@ -0,0 +1,488 @@
+/* $OpenBSD: queue.h,v 1.16 2000/09/07 19:47:59 art Exp $ */
+/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
+
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef SYS_QUEUE_H__
+#define SYS_QUEUE_H__
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ *
+ * A singly-linked list is headed by a single forward pointer. The elements
+ * are singly linked for minimum space and pointer manipulation overhead at
+ * the expense of O(n) removal for arbitrary elements. New elements can be
+ * added to the list after an existing element or at the head of the list.
+ * Elements being removed from the head of the list should use the explicit
+ * macro for this purpose for optimum efficiency. A singly-linked list may
+ * only be traversed in the forward direction. Singly-linked lists are ideal
+ * for applications with large datasets and few or no removals or for
+ * implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * Singly-linked List definitions.
+ */
+#define SLIST_HEAD(name, type) \
+struct name { \
+ struct type *slh_first; /* first element */ \
+}
+
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#ifndef _WIN32
+#define SLIST_ENTRY(type) \
+struct { \
+ struct type *sle_next; /* next element */ \
+}
+#endif
+
+/*
+ * Singly-linked List access methods.
+ */
+#define SLIST_FIRST(head) ((head)->slh_first)
+#define SLIST_END(head) NULL
+#define SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head))
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+#define SLIST_FOREACH(var, head, field) \
+ for((var) = SLIST_FIRST(head); \
+ (var) != SLIST_END(head); \
+ (var) = SLIST_NEXT(var, field))
+
+/*
+ * Singly-linked List functions.
+ */
+#define SLIST_INIT(head) { \
+ SLIST_FIRST(head) = SLIST_END(head); \
+}
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+ (elm)->field.sle_next = (slistelm)->field.sle_next; \
+ (slistelm)->field.sle_next = (elm); \
+} while (0)
+
+#define SLIST_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.sle_next = (head)->slh_first; \
+ (head)->slh_first = (elm); \
+} while (0)
+
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ (head)->slh_first = (head)->slh_first->field.sle_next; \
+} while (0)
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List access methods
+ */
+#define LIST_FIRST(head) ((head)->lh_first)
+#define LIST_END(head) NULL
+#define LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head))
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+#define LIST_FOREACH(var, head, field) \
+ for((var) = LIST_FIRST(head); \
+ (var)!= LIST_END(head); \
+ (var) = LIST_NEXT(var, field))
+
+/*
+ * List functions.
+ */
+#define LIST_INIT(head) do { \
+ LIST_FIRST(head) = LIST_END(head); \
+} while (0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+} while (0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+} while (0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.le_next = (head)->lh_first) != NULL) \
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+} while (0)
+
+#define LIST_REMOVE(elm, field) do { \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+} while (0)
+
+#define LIST_REPLACE(elm, elm2, field) do { \
+ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
+ (elm2)->field.le_next->field.le_prev = \
+ &(elm2)->field.le_next; \
+ (elm2)->field.le_prev = (elm)->field.le_prev; \
+ *(elm2)->field.le_prev = (elm2); \
+} while (0)
+
+/*
+ * Simple queue definitions.
+ */
+#define SIMPLEQ_HEAD(name, type) \
+struct name { \
+ struct type *sqh_first; /* first element */ \
+ struct type **sqh_last; /* addr of last next element */ \
+}
+
+#define SIMPLEQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).sqh_first }
+
+#define SIMPLEQ_ENTRY(type) \
+struct { \
+ struct type *sqe_next; /* next element */ \
+}
+
+/*
+ * Simple queue access methods.
+ */
+#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
+#define SIMPLEQ_END(head) NULL
+#define SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
+#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
+
+#define SIMPLEQ_FOREACH(var, head, field) \
+ for((var) = SIMPLEQ_FIRST(head); \
+ (var) != SIMPLEQ_END(head); \
+ (var) = SIMPLEQ_NEXT(var, field))
+
+/*
+ * Simple queue functions.
+ */
+#define SIMPLEQ_INIT(head) do { \
+ (head)->sqh_first = NULL; \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (head)->sqh_first = (elm); \
+} while (0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.sqe_next = NULL; \
+ *(head)->sqh_last = (elm); \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (listelm)->field.sqe_next = (elm); \
+} while (0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, elm, field) do { \
+ if (((head)->sqh_first = (elm)->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (0)
+
+/*
+ * Tail queue definitions.
+ */
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; /* first element */ \
+ struct type **tqh_last; /* addr of last next element */ \
+}
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).tqh_first }
+
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+
+/*
+ * tail queue access methods
+ */
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#define TAILQ_END(head) NULL
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+/* XXX */
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#define TAILQ_EMPTY(head) \
+ (TAILQ_FIRST(head) == TAILQ_END(head))
+
+#define TAILQ_FOREACH(var, head, field) \
+ for((var) = TAILQ_FIRST(head); \
+ (var) != TAILQ_END(head); \
+ (var) = TAILQ_NEXT(var, field))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for((var) = TAILQ_LAST(head, headname); \
+ (var) != TAILQ_END(head); \
+ (var) = TAILQ_PREV(var, headname, field))
+
+/*
+ * Tail queue functions.
+ */
+#define TAILQ_INIT(head) do { \
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.tqe_next = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_REMOVE(head, elm, field) do { \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+} while (0)
+
+#define TAILQ_REPLACE(head, elm, elm2, field) do { \
+ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \
+ (elm2)->field.tqe_next->field.tqe_prev = \
+ &(elm2)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm2)->field.tqe_next; \
+ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
+ *(elm2)->field.tqe_prev = (elm2); \
+} while (0)
+
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue access methods
+ */
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+#define CIRCLEQ_END(head) ((void *)(head))
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+#define CIRCLEQ_EMPTY(head) \
+ (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
+
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for((var) = CIRCLEQ_FIRST(head); \
+ (var) != CIRCLEQ_END(head); \
+ (var) = CIRCLEQ_NEXT(var, field))
+
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for((var) = CIRCLEQ_LAST(head); \
+ (var) != CIRCLEQ_END(head); \
+ (var) = CIRCLEQ_PREV(var, field))
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = CIRCLEQ_END(head); \
+ (head)->cqh_last = CIRCLEQ_END(head); \
+} while (0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = CIRCLEQ_END(head); \
+ if ((head)->cqh_last == CIRCLEQ_END(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.cqe_next = CIRCLEQ_END(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == CIRCLEQ_END(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (0)
+
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ if ((elm)->field.cqe_next == CIRCLEQ_END(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+} while (0)
+
+#define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \
+ if (((elm2)->field.cqe_next = (elm)->field.cqe_next) == \
+ CIRCLEQ_END(head)) \
+ (head).cqh_last = (elm2); \
+ else \
+ (elm2)->field.cqe_next->field.cqe_prev = (elm2); \
+ if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) == \
+ CIRCLEQ_END(head)) \
+ (head).cqh_first = (elm2); \
+ else \
+ (elm2)->field.cqe_prev->field.cqe_next = (elm2); \
+} while (0)
+
+#endif /* !SYS_QUEUE_H__ */
diff --git a/sntp/libevent/config.h.in b/sntp/libevent/config.h.in
new file mode 100644
index 0000000..7446676
--- /dev/null
+++ b/sntp/libevent/config.h.in
@@ -0,0 +1,632 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if libevent should build without support for a debug mode */
+#undef DISABLE_DEBUG_MODE
+
+/* Define if libevent should not allow replacing the mm functions */
+#undef DISABLE_MM_REPLACEMENT
+
+/* Define if libevent should not be compiled with thread support */
+#undef DISABLE_THREAD_SUPPORT
+
+/* Define to 1 if you have the `accept4' function. */
+#undef HAVE_ACCEPT4
+
+/* Define to 1 if you have the `arc4random' function. */
+#undef HAVE_ARC4RANDOM
+
+/* Define to 1 if you have the `arc4random_buf' function. */
+#undef HAVE_ARC4RANDOM_BUF
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the <cthreads.h> header file. */
+#undef HAVE_CTHREADS_H
+
+/* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you
+ don't. */
+#undef HAVE_DECL_CTL_KERN
+
+/* Define to 1 if you have the declaration of `KERN_ARND', and to 0 if you
+ don't. */
+#undef HAVE_DECL_KERN_ARND
+
+/* Define to 1 if you have the declaration of `KERN_RANDOM', and to 0 if you
+ don't. */
+#undef HAVE_DECL_KERN_RANDOM
+
+/* Define to 1 if you have the declaration of `RANDOM_UUID', and to 0 if you
+ don't. */
+#undef HAVE_DECL_RANDOM_UUID
+
+/* Define if /dev/poll is available */
+#undef HAVE_DEVPOLL
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if your system supports the epoll system calls */
+#undef HAVE_EPOLL
+
+/* Define to 1 if you have the `epoll_create1' function. */
+#undef HAVE_EPOLL_CREATE1
+
+/* Define to 1 if you have the `epoll_ctl' function. */
+#undef HAVE_EPOLL_CTL
+
+/* Define to 1 if you have the `eventfd' function. */
+#undef HAVE_EVENTFD
+
+/* Define if your system supports event ports */
+#undef HAVE_EVENT_PORTS
+
+/* Define to 1 if you have the `fcntl' function. */
+#undef HAVE_FCNTL
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if the system has the type `fd_mask'. */
+#undef HAVE_FD_MASK
+
+/* Do we have getaddrinfo()? */
+#undef HAVE_GETADDRINFO
+
+/* Define to 1 if you have the `getegid' function. */
+#undef HAVE_GETEGID
+
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define this if you have any gethostbyname_r() */
+#undef HAVE_GETHOSTBYNAME_R
+
+/* Define this if gethostbyname_r takes 3 arguments */
+#undef HAVE_GETHOSTBYNAME_R_3_ARG
+
+/* Define this if gethostbyname_r takes 5 arguments */
+#undef HAVE_GETHOSTBYNAME_R_5_ARG
+
+/* Define this if gethostbyname_r takes 6 arguments */
+#undef HAVE_GETHOSTBYNAME_R_6_ARG
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAVE_GETIFADDRS
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#undef HAVE_GETNAMEINFO
+
+/* Define to 1 if you have the `getprotobynumber' function. */
+#undef HAVE_GETPROTOBYNUMBER
+
+/* Define to 1 if you have the `getservbyname' function. */
+#undef HAVE_GETSERVBYNAME
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* if you have GNU Pth */
+#undef HAVE_GNU_PTH
+
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#undef HAVE_IFADDRS_H
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `issetugid' function. */
+#undef HAVE_ISSETUGID
+
+/* Define to 1 if you have the `kqueue' function. */
+#undef HAVE_KQUEUE
+
+/* Define if the system has zlib */
+#undef HAVE_LIBZ
+
+/* if you have LinuxThreads */
+#undef HAVE_LINUX_THREADS
+
+/* if you have SunOS LWP package */
+#undef HAVE_LWP
+
+/* Define to 1 if you have the <lwp/lwp.h> header file. */
+#undef HAVE_LWP_LWP_H
+
+/* Define to 1 if you have the `mach_absolute_time' function. */
+#undef HAVE_MACH_ABSOLUTE_TIME
+
+/* define if you have Mach Cthreads */
+#undef HAVE_MACH_CTHREADS
+
+/* Define to 1 if you have the <mach/cthreads.h> header file. */
+#undef HAVE_MACH_CTHREADS_H
+
+/* Define to 1 if you have the <mach/mach_time.h> header file. */
+#undef HAVE_MACH_MACH_TIME_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in6.h> header file. */
+#undef HAVE_NETINET_IN6_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#undef HAVE_NETINET_TCP_H
+
+/* if you have NT Event Log */
+#undef HAVE_NT_EVENT_LOG
+
+/* if you have NT Service Manager */
+#undef HAVE_NT_SERVICE_MANAGER
+
+/* if you have NT Threads */
+#undef HAVE_NT_THREADS
+
+/* Define if the system has openssl */
+#undef HAVE_OPENSSL
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `pipe2' function. */
+#undef HAVE_PIPE2
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
+/* Define to 1 if you have the `port_create' function. */
+#undef HAVE_PORT_CREATE
+
+/* Define to 1 if you have the <port.h> header file. */
+#undef HAVE_PORT_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* define to pthreads API spec revision */
+#undef HAVE_PTHREADS
+
+/* define if you have pthread_detach function */
+#undef HAVE_PTHREAD_DETACH
+
+/* Define to 1 if you have the `pthread_getconcurrency' function. */
+#undef HAVE_PTHREAD_GETCONCURRENCY
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the `pthread_kill' function. */
+#undef HAVE_PTHREAD_KILL
+
+/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */
+#undef HAVE_PTHREAD_KILL_OTHER_THREADS_NP
+
+/* define if you have pthread_rwlock_destroy function */
+#undef HAVE_PTHREAD_RWLOCK_DESTROY
+
+/* Define to 1 if you have the `pthread_setconcurrency' function. */
+#undef HAVE_PTHREAD_SETCONCURRENCY
+
+/* Define to 1 if you have the `pthread_yield' function. */
+#undef HAVE_PTHREAD_YIELD
+
+/* Define to 1 if you have the <pth.h> header file. */
+#undef HAVE_PTH_H
+
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
+
+/* Define to 1 if the system has the type `sa_family_t'. */
+#undef HAVE_SA_FAMILY_T
+
+/* Define to 1 if you have the <sched.h> header file. */
+#undef HAVE_SCHED_H
+
+/* Define to 1 if you have the `sched_yield' function. */
+#undef HAVE_SCHED_YIELD
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the `sendfile' function. */
+#undef HAVE_SENDFILE
+
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define if F_SETFD is defined in <fcntl.h> */
+#undef HAVE_SETFD
+
+/* Define to 1 if you have the `setrlimit' function. */
+#undef HAVE_SETRLIMIT
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `signal' function. */
+#undef HAVE_SIGNAL
+
+/* Define to 1 if you have the `splice' function. */
+#undef HAVE_SPLICE
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strsep' function. */
+#undef HAVE_STRSEP
+
+/* Define to 1 if you have the `strtok_r' function. */
+#undef HAVE_STRTOK_R
+
+/* Define to 1 if you have the `strtoll' function. */
+#undef HAVE_STRTOLL
+
+/* Define to 1 if the system has the type `struct addrinfo'. */
+#undef HAVE_STRUCT_ADDRINFO
+
+/* Define to 1 if the system has the type `struct in6_addr'. */
+#undef HAVE_STRUCT_IN6_ADDR
+
+/* Define to 1 if `s6_addr16' is a member of `struct in6_addr'. */
+#undef HAVE_STRUCT_IN6_ADDR_S6_ADDR16
+
+/* Define to 1 if `s6_addr32' is a member of `struct in6_addr'. */
+#undef HAVE_STRUCT_IN6_ADDR_S6_ADDR32
+
+/* Define to 1 if the system has the type `struct sockaddr_in6'. */
+#undef HAVE_STRUCT_SOCKADDR_IN6
+
+/* Define to 1 if `sin6_len' is a member of `struct sockaddr_in6'. */
+#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+
+/* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */
+#undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+
+/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
+
+/* Define to 1 if the system has the type `struct so_linger'. */
+#undef HAVE_STRUCT_SO_LINGER
+
+/* Define to 1 if you have the <synch.h> header file. */
+#undef HAVE_SYNCH_H
+
+/* Define to 1 if you have the `sysctl' function. */
+#undef HAVE_SYSCTL
+
+/* Define to 1 if you have the <sys/devpoll.h> header file. */
+#undef HAVE_SYS_DEVPOLL_H
+
+/* Define to 1 if you have the <sys/epoll.h> header file. */
+#undef HAVE_SYS_EPOLL_H
+
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#undef HAVE_SYS_EVENTFD_H
+
+/* Define to 1 if you have the <sys/event.h> header file. */
+#undef HAVE_SYS_EVENT_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/queue.h> header file. */
+#undef HAVE_SYS_QUEUE_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/sendfile.h> header file. */
+#undef HAVE_SYS_SENDFILE_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define to 1 if you have the <sys/timerfd.h> header file. */
+#undef HAVE_SYS_TIMERFD_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
+#undef HAVE_TAILQFOREACH
+
+/* if you have Solaris LWP (thr) package */
+#undef HAVE_THR
+
+/* Define to 1 if you have the <thread.h> header file. */
+#undef HAVE_THREAD_H
+
+/* Define to 1 if you have the `thr_getconcurrency' function. */
+#undef HAVE_THR_GETCONCURRENCY
+
+/* Define to 1 if you have the `thr_setconcurrency' function. */
+#undef HAVE_THR_SETCONCURRENCY
+
+/* Define to 1 if you have the `thr_yield' function. */
+#undef HAVE_THR_YIELD
+
+/* Define if timeradd is defined in <sys/time.h> */
+#undef HAVE_TIMERADD
+
+/* Define if timerclear is defined in <sys/time.h> */
+#undef HAVE_TIMERCLEAR
+
+/* Define if timercmp is defined in <sys/time.h> */
+#undef HAVE_TIMERCMP
+
+/* Define to 1 if you have the `timerfd_create' function. */
+#undef HAVE_TIMERFD_CREATE
+
+/* Define if timerisset is defined in <sys/time.h> */
+#undef HAVE_TIMERISSET
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#undef HAVE_UINT16_T
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#undef HAVE_UINT32_T
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#undef HAVE_UINT64_T
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#undef HAVE_UINT8_T
+
+/* Define to 1 if the system has the type `uintptr_t'. */
+#undef HAVE_UINTPTR_T
+
+/* Define to 1 if you have the `umask' function. */
+#undef HAVE_UMASK
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
+/* Define to 1 if you have the `vasprintf' function. */
+#undef HAVE_VASPRINTF
+
+/* Define if kqueue works correctly with pipes */
+#undef HAVE_WORKING_KQUEUE
+
+/* define if select implicitly yields */
+#undef HAVE_YIELDING_SELECT
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* define to 1 if library is thread safe */
+#undef LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* define if you have (or want) no threads */
+#undef NO_THREADS
+
+/* Numeric representation of the version */
+#undef NUMERIC_VERSION
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* enable thread safety */
+#undef REENTRANT
+
+/* define if sched_yield yields the entire process */
+#undef REPLACE_BROKEN_YIELD
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `off_t', as computed by sizeof. */
+#undef SIZEOF_OFF_T
+
+/* The size of `pthread_t', as computed by sizeof. */
+#undef SIZEOF_PTHREAD_T
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* enable thread safety */
+#undef THREADSAFE
+
+/* enable thread safety */
+#undef THREAD_SAFE
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* enable thread safety */
+#undef _REENTRANT
+
+/* enable thread safety */
+#undef _SGI_MP_SOURCE
+
+/* enable thread safety */
+#undef _THREADSAFE
+
+/* enable thread safety */
+#undef _THREAD_SAFE
+
+/* Define to 500 only on HP-UX. */
+#undef _XOPEN_SOURCE
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to appropriate substitue if compiler doesnt have __func__ */
+#undef __func__
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to unsigned int if you dont have it */
+#undef socklen_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
diff --git a/sntp/libevent/configure b/sntp/libevent/configure
new file mode 100755
index 0000000..09d6eed
--- /dev/null
+++ b/sntp/libevent/configure
@@ -0,0 +1,22030 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for libevent 2.1.3-alpha-dev.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='libevent'
+PACKAGE_TARNAME='libevent'
+PACKAGE_VERSION='2.1.3-alpha-dev'
+PACKAGE_STRING='libevent 2.1.3-alpha-dev'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+ac_unique_file="event.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+INSTALL_LIBEVENT_FALSE
+INSTALL_LIBEVENT_TRUE
+LIBEVENT_GC_SECTIONS
+PTHREADS_FALSE
+PTHREADS_TRUE
+PTHREAD_CFLAGS
+PTHREAD_LIBS
+SIGNAL_SUPPORT_FALSE
+SIGNAL_SUPPORT_TRUE
+EVPORT_BACKEND_FALSE
+EVPORT_BACKEND_TRUE
+EPOLL_BACKEND_FALSE
+EPOLL_BACKEND_TRUE
+LIBOBJS
+KQUEUE_BACKEND_FALSE
+KQUEUE_BACKEND_TRUE
+DEVPOLL_BACKEND_FALSE
+DEVPOLL_BACKEND_TRUE
+POLL_BACKEND_FALSE
+POLL_BACKEND_TRUE
+SELECT_BACKEND_FALSE
+SELECT_BACKEND_TRUE
+STRLCPY_IMPL_FALSE
+STRLCPY_IMPL_TRUE
+BUILD_WITH_NO_UNDEFINED_FALSE
+BUILD_WITH_NO_UNDEFINED_TRUE
+BUILD_CYGWIN_FALSE
+BUILD_CYGWIN_TRUE
+BUILD_WIN32_FALSE
+BUILD_WIN32_TRUE
+OPENSSL_FALSE
+OPENSSL_TRUE
+OPENSSL_LIBS
+OPENSSL_INCS
+PKG_CONFIG
+OPENSSL_LIBADD
+EV_LIB_GDI
+EV_LIB_WS32
+ZLIB_REGRESS_FALSE
+ZLIB_REGRESS_TRUE
+ZLIB_LIBS
+BUILD_REGRESS_FALSE
+BUILD_REGRESS_TRUE
+LIBTOOL_DEPS
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+LIBTOOL
+SED
+LN_S
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_dependency_tracking
+enable_gcc_warnings
+enable_gcc_hardening
+enable_thread_support
+enable_malloc_replacement
+enable_openssl
+enable_debug_mode
+enable_libevent_install
+enable_libevent_regress
+enable_function_sections
+enable_verbose_debug
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+enable_largefile
+with_threads
+with_yielding_select
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures libevent 2.1.3-alpha-dev to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/libevent]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of libevent 2.1.3-alpha-dev:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: `make V=1')
+ --disable-silent-rules verbose build output (undo: `make V=0')
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --disable-gcc-warnings disable verbose warnings with GCC
+ --enable-gcc-hardening enable compiler security checks
+ --disable-thread-support
+ disable support for threading
+ --disable-malloc-replacement
+ disable support for replacing the memory mgt
+ functions
+ --disable-openssl disable support for openssl encryption
+ --disable-debug-mode disable support for running in debug mode
+ --disable-libevent-install, disable installation of libevent
+
+ --disable-libevent-regress, skip regress in make check
+
+ --enable-function-sections, make static library allow smaller binaries with --gc-sections
+
+ --enable-verbose-debug, verbose debug logging
+
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-largefile omit support for large files
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+ --with-threads with threads [auto]
+ --with-yielding-select with yielding select [auto]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+libevent configure 2.1.3-alpha-dev
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by libevent $as_me 2.1.3-alpha-dev, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+am__api_version='1.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='libevent'
+ VERSION='2.1.3-alpha-dev'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no) AM_DEFAULT_VERBOSITY=1;;
+*) AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+ac_config_headers="$ac_config_headers config.h evconfig-private.h:evconfig-private.h.in"
+
+
+$as_echo "#define NUMERIC_VERSION 0x02010301" >>confdefs.h
+
+
+if test "$prefix" = "NONE"; then
+ prefix="/usr/local"
+fi
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+ MINIX=yes
+else
+ MINIX=
+fi
+
+
+ if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+ fi
+
+ case "$host_os" in
+ hpux*)
+
+$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+ ;;
+ esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+
+
+
+
+
+#case "$host_os" in
+#
+# osf5*)
+# CFLAGS="$CFLAGS -D_OSF_SOURCE"
+# ;;
+#esac
+
+if test "x$CC" != xcc; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+ rm -f conftest2.*
+ if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# AC_PROG_MKDIR_P - $(MKDIR_P) should be defined by AM_INIT_AUTOMAKE
+
+# AC_PROG_SED is only available in Autoconf >= 2.59b; workaround for older
+# versions
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if ${ac_cv_prog_gcc_traditional+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+
+# We need to test for at least gcc 2.95 here, because older versions don't
+# have -fno-strict-aliasing
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
+#error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ have_gcc295=yes
+else
+ have_gcc295=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test "$GCC" = "yes" ; then
+ # Enable many gcc warnings by default...
+ CFLAGS="$CFLAGS -Wall"
+ # And disable the strict-aliasing optimization, since it breaks
+ # our sockaddr-handling code in strange ways.
+ if test x$have_gcc295 = xyes; then
+ CFLAGS="$CFLAGS -fno-strict-aliasing"
+ fi
+fi
+
+# OS X Lion started deprecating the system openssl. Let's just disable
+# all deprecation warnings on OS X.
+case "$host_os" in
+
+ darwin*)
+ CFLAGS="$CFLAGS -Wno-deprecated-declarations"
+ ;;
+esac
+
+# Check whether --enable-gcc-warnings was given.
+if test "${enable_gcc_warnings+set}" = set; then :
+ enableval=$enable_gcc_warnings;
+fi
+
+
+# Check whether --enable-gcc-hardening was given.
+if test "${enable_gcc_hardening+set}" = set; then :
+ enableval=$enable_gcc_hardening; if test x$enableval = xyes; then
+ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
+ CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
+ CFLAGS="$CFLAGS --param ssp-buffer-size=1"
+fi
+fi
+
+
+# Check whether --enable-thread-support was given.
+if test "${enable_thread_support+set}" = set; then :
+ enableval=$enable_thread_support;
+else
+ enable_thread_support=yes
+fi
+
+# Check whether --enable-malloc-replacement was given.
+if test "${enable_malloc_replacement+set}" = set; then :
+ enableval=$enable_malloc_replacement;
+else
+ enable_malloc_replacement=yes
+fi
+
+# Check whether --enable-openssl was given.
+if test "${enable_openssl+set}" = set; then :
+ enableval=$enable_openssl;
+else
+ enable_openssl=yes
+fi
+
+# Check whether --enable-debug-mode was given.
+if test "${enable_debug_mode+set}" = set; then :
+ enableval=$enable_debug_mode;
+else
+ enable_debug_mode=yes
+fi
+
+# Check whether --enable-libevent-install was given.
+if test "${enable_libevent_install+set}" = set; then :
+ enableval=$enable_libevent_install;
+else
+ enable_libevent_install=yes
+fi
+
+# Check whether --enable-libevent-regress was given.
+if test "${enable_libevent_regress+set}" = set; then :
+ enableval=$enable_libevent_regress;
+else
+ enable_libevent_regress=yes
+fi
+
+# Check whether --enable-function-sections was given.
+if test "${enable_function_sections+set}" = set; then :
+ enableval=$enable_function_sections;
+else
+ enable_function_sections=no
+fi
+
+# Check whether --enable-verbose-debug was given.
+if test "${enable_verbose_debug+set}" = set; then :
+ enableval=$enable_verbose_debug;
+else
+ enable_verbose_debug=no
+fi
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4'
+macro_revision='1.3293'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ lt_prog_compiler_pic='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+
+ if test "$enable_libevent_regress" = "yes"; then
+ BUILD_REGRESS_TRUE=
+ BUILD_REGRESS_FALSE='#'
+else
+ BUILD_REGRESS_TRUE='#'
+ BUILD_REGRESS_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntoa" >&5
+$as_echo_n "checking for library containing inet_ntoa... " >&6; }
+if ${ac_cv_search_inet_ntoa+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_ntoa=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_ntoa+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_ntoa+:} false; then :
+
+else
+ ac_cv_search_inet_ntoa=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntoa" >&5
+$as_echo "$ac_cv_search_inet_ntoa" >&6; }
+ac_res=$ac_cv_search_inet_ntoa
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_socket=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_socket+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_socket+:} false; then :
+
+else
+ ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_aton" >&5
+$as_echo_n "checking for library containing inet_aton... " >&6; }
+if ${ac_cv_search_inet_aton+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_aton ();
+int
+main ()
+{
+return inet_aton ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_aton=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_aton+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_aton+:} false; then :
+
+else
+ ac_cv_search_inet_aton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_aton" >&5
+$as_echo "$ac_cv_search_inet_aton" >&6; }
+ac_res=$ac_cv_search_inet_aton
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sendfile" >&5
+$as_echo_n "checking for library containing sendfile... " >&6; }
+if ${ac_cv_search_sendfile+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sendfile ();
+int
+main ()
+{
+return sendfile ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' sendfile; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_sendfile=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_sendfile+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_sendfile+:} false; then :
+
+else
+ ac_cv_search_sendfile=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sendfile" >&5
+$as_echo "$ac_cv_search_sendfile" >&6; }
+ac_res=$ac_cv_search_sendfile
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WIN32" >&5
+$as_echo_n "checking for WIN32... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifndef _WIN32
+die horribly
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ bwin32=true; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ bwin32=false; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN" >&5
+$as_echo_n "checking for CYGWIN... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifndef __CYGWIN__
+die horribly
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cygwin=true; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ cygwin=false; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+for ac_header in zlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "x$ac_cv_header_zlib_h" = "xyes"; then
+save_LIBS="$LIBS"
+LIBS=""
+ZLIB_LIBS=""
+have_zlib=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inflateEnd" >&5
+$as_echo_n "checking for library containing inflateEnd... " >&6; }
+if ${ac_cv_search_inflateEnd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inflateEnd ();
+int
+main ()
+{
+return inflateEnd ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inflateEnd=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inflateEnd+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inflateEnd+:} false; then :
+
+else
+ ac_cv_search_inflateEnd=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inflateEnd" >&5
+$as_echo "$ac_cv_search_inflateEnd" >&6; }
+ac_res=$ac_cv_search_inflateEnd
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ have_zlib=yes
+ ZLIB_LIBS="$LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+LIBS="$save_LIBS"
+
+fi
+ if test "$have_zlib" = "yes"; then
+ ZLIB_REGRESS_TRUE=
+ ZLIB_REGRESS_FALSE='#'
+else
+ ZLIB_REGRESS_TRUE='#'
+ ZLIB_REGRESS_FALSE=
+fi
+
+
+if test "$bwin32" = true; then
+ EV_LIB_WS32=-lws2_32
+ EV_LIB_GDI=-lgdi32
+else
+ EV_LIB_WS32=
+ EV_LIB_GDI=
+fi
+
+
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+fi
+
+
+
+
+ntp_pkgconfig_min_version='0.15.0'
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+{ ac_cv_path_PKG_CONFIG=; unset ac_cv_path_PKG_CONFIG;}
+{ ac_cv_path_ac_pt_PKG_CONFIG=; unset ac_cv_path_ac_pt_PKG_CONFIG;}
+
+case "$PKG_CONFIG" in
+ /*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pkg-config is at least version $ntp_pkgconfig_min_version" >&5
+$as_echo_n "checking if pkg-config is at least version $ntp_pkgconfig_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+ ;;
+esac
+
+
+
+
+case "$enable_openssl" in
+ yes)
+ have_openssl=no
+ case "$PKG_CONFIG" in
+ '')
+ ;;
+ *)
+ OPENSSL_LIBS=`$PKG_CONFIG --libs openssl 2>/dev/null`
+ case "$OPENSSL_LIBS" in
+ '') ;;
+ *) OPENSSL_LIBS="$OPENSSL_LIBS $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"
+ have_openssl=yes
+ ;;
+ esac
+ OPENSSL_INCS=`$PKG_CONFIG --cflags openssl 2>/dev/null`
+ ;;
+ esac
+ case "$have_openssl" in
+ yes) ;;
+ *)
+ save_LIBS="$LIBS"
+ LIBS=""
+ OPENSSL_LIBS=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_new" >&5
+$as_echo_n "checking for library containing SSL_new... " >&6; }
+if ${ac_cv_search_SSL_new+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SSL_new ();
+int
+main ()
+{
+return SSL_new ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' ssl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_SSL_new=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_SSL_new+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_SSL_new+:} false; then :
+
+else
+ ac_cv_search_SSL_new=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_new" >&5
+$as_echo "$ac_cv_search_SSL_new" >&6; }
+ac_res=$ac_cv_search_SSL_new
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ have_openssl=yes
+ OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"
+else
+ have_openssl=no
+fi
+
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+
+ case "$have_openssl" in
+ yes)
+$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h
+ ;;
+ esac
+ ;;
+esac
+
+# check if we have and should use openssl
+ if test "$enable_openssl" != "no" && test "$have_openssl" = "yes"; then
+ OPENSSL_TRUE=
+ OPENSSL_FALSE='#'
+else
+ OPENSSL_TRUE='#'
+ OPENSSL_FALSE=
+fi
+
+
+
+for ac_header in \
+ arpa/inet.h \
+ fcntl.h \
+ ifaddrs.h \
+ mach/mach_time.h \
+ netdb.h \
+ netinet/in.h \
+ netinet/in6.h \
+ netinet/tcp.h \
+ poll.h \
+ port.h \
+ stdarg.h \
+ stddef.h \
+ sys/devpoll.h \
+ sys/epoll.h \
+ sys/event.h \
+ sys/eventfd.h \
+ sys/ioctl.h \
+ sys/mman.h \
+ sys/param.h \
+ sys/queue.h \
+ sys/resource.h \
+ sys/select.h \
+ sys/sendfile.h \
+ sys/socket.h \
+ sys/stat.h \
+ sys/time.h \
+ sys/timerfd.h \
+ sys/uio.h \
+ sys/wait.h \
+
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/sysctl.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+"
+if test "x$ac_cv_header_sys_sysctl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SYSCTL_H 1
+_ACEOF
+
+fi
+
+done
+
+if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAILQ_FOREACH in sys/queue.h" >&5
+$as_echo_n "checking for TAILQ_FOREACH in sys/queue.h... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/queue.h>
+#ifdef TAILQ_FOREACH
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_TAILQFOREACH 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f conftest*
+
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timeradd in sys/time.h" >&5
+$as_echo_n "checking for timeradd in sys/time.h... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/time.h>
+#ifdef timeradd
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+
+$as_echo "#define HAVE_TIMERADD 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f conftest*
+
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timercmp in sys/time.h" >&5
+$as_echo_n "checking for timercmp in sys/time.h... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/time.h>
+#ifdef timercmp
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+
+$as_echo "#define HAVE_TIMERCMP 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f conftest*
+
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerclear in sys/time.h" >&5
+$as_echo_n "checking for timerclear in sys/time.h... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/time.h>
+#ifdef timerclear
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+
+$as_echo "#define HAVE_TIMERCLEAR 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f conftest*
+
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerisset in sys/time.h" >&5
+$as_echo_n "checking for timerisset in sys/time.h... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/time.h>
+#ifdef timerisset
+ yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+
+$as_echo "#define HAVE_TIMERISSET 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f conftest*
+
+fi
+
+if test "x$ac_cv_header_sys_sysctl_h" = "xyes"; then
+ ac_fn_c_check_decl "$LINENO" "CTL_KERN" "ac_cv_have_decl_CTL_KERN" "#include <sys/types.h>
+ #include <sys/sysctl.h>
+
+"
+if test "x$ac_cv_have_decl_CTL_KERN" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_CTL_KERN $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "KERN_RANDOM" "ac_cv_have_decl_KERN_RANDOM" "#include <sys/types.h>
+ #include <sys/sysctl.h>
+
+"
+if test "x$ac_cv_have_decl_KERN_RANDOM" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_KERN_RANDOM $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "RANDOM_UUID" "ac_cv_have_decl_RANDOM_UUID" "#include <sys/types.h>
+ #include <sys/sysctl.h>
+
+"
+if test "x$ac_cv_have_decl_RANDOM_UUID" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_RANDOM_UUID $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "KERN_ARND" "ac_cv_have_decl_KERN_ARND" "#include <sys/types.h>
+ #include <sys/sysctl.h>
+
+"
+if test "x$ac_cv_have_decl_KERN_ARND" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_KERN_ARND $ac_have_decl
+_ACEOF
+
+fi
+
+ if test x$bwin32 = xtrue; then
+ BUILD_WIN32_TRUE=
+ BUILD_WIN32_FALSE='#'
+else
+ BUILD_WIN32_TRUE='#'
+ BUILD_WIN32_FALSE=
+fi
+
+ if test x$cygwin = xtrue; then
+ BUILD_CYGWIN_TRUE=
+ BUILD_CYGWIN_FALSE='#'
+else
+ BUILD_CYGWIN_TRUE='#'
+ BUILD_CYGWIN_FALSE=
+fi
+
+ if test x$bwin32 = xtrue || test x$cygwin = xtrue; then
+ BUILD_WITH_NO_UNDEFINED_TRUE=
+ BUILD_WITH_NO_UNDEFINED_FALSE='#'
+else
+ BUILD_WITH_NO_UNDEFINED_TRUE='#'
+ BUILD_WITH_NO_UNDEFINED_FALSE=
+fi
+
+
+if test x$bwin32 = xtrue; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5
+$as_echo_n "checking for library containing getservbyname... " >&6; }
+if ${ac_cv_search_getservbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getservbyname ();
+int
+main ()
+{
+return getservbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' ws2_32; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getservbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getservbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getservbyname+:} false; then :
+
+else
+ ac_cv_search_getservbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyname" >&5
+$as_echo "$ac_cv_search_getservbyname" >&6; }
+ac_res=$ac_cv_search_getservbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+
+for ac_func in \
+ accept4 \
+ arc4random \
+ arc4random_buf \
+ clock_gettime \
+ eventfd \
+ epoll_create1 \
+ fcntl \
+ getegid \
+ geteuid \
+ getifaddrs \
+ getnameinfo \
+ getprotobynumber \
+ gettimeofday \
+ inet_ntop \
+ inet_pton \
+ issetugid \
+ mach_absolute_time \
+ mmap \
+ nanosleep \
+ pipe \
+ pipe2 \
+ putenv \
+ sendfile \
+ setenv \
+ setrlimit \
+ sigaction \
+ signal \
+ splice \
+ strlcpy \
+ strsep \
+ strtok_r \
+ strtoll \
+ sysctl \
+ timerfd_create \
+ umask \
+ unsetenv \
+ usleep \
+ vasprintf \
+
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ if test x"$ac_cv_func_strlcpy" = xno; then
+ STRLCPY_IMPL_TRUE=
+ STRLCPY_IMPL_FALSE='#'
+else
+ STRLCPY_IMPL_TRUE='#'
+ STRLCPY_IMPL_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5
+$as_echo_n "checking for getaddrinfo... " >&6; }
+if ${libevent_cv_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+
+int
+main ()
+{
+
+ getaddrinfo;
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ libevent_cv_getaddrinfo=yes
+else
+ libevent_cv_getaddrinfo=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libevent_cv_getaddrinfo" >&5
+$as_echo "$libevent_cv_getaddrinfo" >&6; }
+if test "$libevent_cv_getaddrinfo" = "yes" ; then
+
+$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
+
+else
+
+for ac_func in getservbyname
+do :
+ ac_fn_c_check_func "$LINENO" "getservbyname" "ac_cv_func_getservbyname"
+if test "x$ac_cv_func_getservbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETSERVBYNAME 1
+_ACEOF
+
+fi
+done
+
+# Check for gethostbyname_r in all its glorious incompatible versions.
+# (This is cut-and-pasted from Tor, which based its logic on
+# Python's configure.in.)
+
+
+ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r"
+if test "x$ac_cv_func_gethostbyname_r" = xyes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how many arguments gethostbyname_r() wants" >&5
+$as_echo_n "checking how many arguments gethostbyname_r() wants... " >&6; }
+ OLD_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <netdb.h>
+
+int
+main ()
+{
+
+ char *cp1, *cp2;
+ struct hostent *h1, *h2;
+ int i1, i2;
+ (void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_GETHOSTBYNAME_R_6_ARG 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 6" >&5
+$as_echo "6" >&6; }
+
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <netdb.h>
+
+int
+main ()
+{
+
+ char *cp1, *cp2;
+ struct hostent *h1;
+ int i1, i2;
+ (void)gethostbyname_r(cp1,h1,cp2,i1,&i2);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_GETHOSTBYNAME_R_5_ARG 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 5" >&5
+$as_echo "5" >&6; }
+
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <netdb.h>
+
+int
+main ()
+{
+
+ char *cp1;
+ struct hostent *h1;
+ struct hostent_data hd;
+ (void) gethostbyname_r(cp1,h1,&hd);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_GETHOSTBYNAME_R_3_ARG 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 3" >&5
+$as_echo "3" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 0" >&5
+$as_echo "0" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$OLD_CFLAGS
+
+fi
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for F_SETFD in fcntl.h" >&5
+$as_echo_n "checking for F_SETFD in fcntl.h... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _GNU_SOURCE
+#include <fcntl.h>
+#ifdef F_SETFD
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+
+$as_echo "#define HAVE_SETFD 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f conftest*
+
+
+needsignal=no
+haveselect=no
+if test x$bwin32 != xtrue; then
+ for ac_func in select
+do :
+ ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select"
+if test "x$ac_cv_func_select" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SELECT 1
+_ACEOF
+ haveselect=yes
+fi
+done
+
+ if test "x$haveselect" = "xyes" ; then
+ needsignal=yes
+ fi
+fi
+ if test "x$haveselect" = "xyes"; then
+ SELECT_BACKEND_TRUE=
+ SELECT_BACKEND_FALSE='#'
+else
+ SELECT_BACKEND_TRUE='#'
+ SELECT_BACKEND_FALSE=
+fi
+
+
+havepoll=no
+for ac_func in poll
+do :
+ ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll"
+if test "x$ac_cv_func_poll" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_POLL 1
+_ACEOF
+ havepoll=yes
+fi
+done
+
+if test "x$havepoll" = "xyes" ; then
+ needsignal=yes
+fi
+ if test "x$havepoll" = "xyes"; then
+ POLL_BACKEND_TRUE=
+ POLL_BACKEND_FALSE='#'
+else
+ POLL_BACKEND_TRUE='#'
+ POLL_BACKEND_FALSE=
+fi
+
+
+havedevpoll=no
+if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
+
+$as_echo "#define HAVE_DEVPOLL 1" >>confdefs.h
+
+fi
+ if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
+ DEVPOLL_BACKEND_TRUE=
+ DEVPOLL_BACKEND_FALSE='#'
+else
+ DEVPOLL_BACKEND_TRUE='#'
+ DEVPOLL_BACKEND_FALSE=
+fi
+
+
+havekqueue=no
+if test "x$ac_cv_header_sys_event_h" = "xyes"; then
+ for ac_func in kqueue
+do :
+ ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue"
+if test "x$ac_cv_func_kqueue" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_KQUEUE 1
+_ACEOF
+ havekqueue=yes
+fi
+done
+
+ if test "x$havekqueue" = "xyes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working kqueue" >&5
+$as_echo_n "checking for working kqueue... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/event.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int
+main(int argc, char **argv)
+{
+ int kq;
+ int n;
+ int fd[2];
+ struct kevent ev;
+ struct timespec ts;
+ char buf[8000];
+
+ if (pipe(fd) == -1)
+ exit(1);
+ if (fcntl(fd[1], F_SETFL, O_NONBLOCK) == -1)
+ exit(1);
+
+ while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
+ ;
+
+ if ((kq = kqueue()) == -1)
+ exit(1);
+
+ memset(&ev, 0, sizeof(ev));
+ ev.ident = fd[1];
+ ev.filter = EVFILT_WRITE;
+ ev.flags = EV_ADD | EV_ENABLE;
+ n = kevent(kq, &ev, 1, NULL, 0, NULL);
+ if (n == -1)
+ exit(1);
+
+ read(fd[0], buf, sizeof(buf));
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+ n = kevent(kq, NULL, 0, &ev, 1, &ts);
+ if (n == -1 || n == 0)
+ exit(1);
+
+ exit(0);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_WORKING_KQUEUE 1" >>confdefs.h
+
+ havekqueue=yes
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+ if test "x$havekqueue" = "xyes"; then
+ KQUEUE_BACKEND_TRUE=
+ KQUEUE_BACKEND_FALSE='#'
+else
+ KQUEUE_BACKEND_TRUE='#'
+ KQUEUE_BACKEND_FALSE=
+fi
+
+
+haveepollsyscall=no
+haveepoll=no
+for ac_func in epoll_ctl
+do :
+ ac_fn_c_check_func "$LINENO" "epoll_ctl" "ac_cv_func_epoll_ctl"
+if test "x$ac_cv_func_epoll_ctl" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_EPOLL_CTL 1
+_ACEOF
+ haveepoll=yes
+fi
+done
+
+if test "x$haveepoll" = "xyes" ; then
+
+$as_echo "#define HAVE_EPOLL 1" >>confdefs.h
+
+ needsignal=yes
+fi
+if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
+ if test "x$haveepoll" = "xno" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for epoll system call" >&5
+$as_echo_n "checking for epoll system call... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/epoll.h>
+#include <unistd.h>
+
+int
+epoll_create(int size)
+{
+ return (syscall(__NR_epoll_create, size));
+}
+
+int
+main(int argc, char **argv)
+{
+ int epfd;
+
+ epfd = epoll_create(256);
+ exit (epfd == -1 ? 1 : 0);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_EPOLL 1" >>confdefs.h
+
+ needsignal=yes
+ have_epoll=yes
+ case " $LIBOBJS " in
+ *" epoll_sub.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS epoll_sub.$ac_objext"
+ ;;
+esac
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+ if test "x$haveepoll" = "xyes"; then
+ EPOLL_BACKEND_TRUE=
+ EPOLL_BACKEND_FALSE='#'
+else
+ EPOLL_BACKEND_TRUE='#'
+ EPOLL_BACKEND_FALSE=
+fi
+
+
+haveeventports=no
+for ac_func in port_create
+do :
+ ac_fn_c_check_func "$LINENO" "port_create" "ac_cv_func_port_create"
+if test "x$ac_cv_func_port_create" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PORT_CREATE 1
+_ACEOF
+ haveeventports=yes
+fi
+done
+
+if test "x$haveeventports" = "xyes" ; then
+
+$as_echo "#define HAVE_EVENT_PORTS 1" >>confdefs.h
+
+ needsignal=yes
+fi
+ if test "x$haveeventports" = "xyes"; then
+ EVPORT_BACKEND_TRUE=
+ EVPORT_BACKEND_FALSE='#'
+else
+ EVPORT_BACKEND_TRUE='#'
+ EVPORT_BACKEND_FALSE=
+fi
+
+
+if test "x$bwin32" = "xtrue"; then
+ needsignal=yes
+fi
+
+ if test "x$needsignal" = "xyes"; then
+ SIGNAL_SUPPORT_TRUE=
+ SIGNAL_SUPPORT_FALSE='#'
+else
+ SIGNAL_SUPPORT_TRUE='#'
+ SIGNAL_SUPPORT_FALSE=
+fi
+
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
+if test "x$ac_cv_type_ssize_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define ssize_t int
+_ACEOF
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+"
+if test "x$ac_cv_type_uint64_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT64_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+"
+if test "x$ac_cv_type_uint32_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT32_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+"
+if test "x$ac_cv_type_uint16_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT16_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+"
+if test "x$ac_cv_type_uint8_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT8_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+"
+if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "fd_mask" "ac_cv_type_fd_mask" "#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+"
+if test "x$ac_cv_type_fd_mask" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FD_MASK 1
+_ACEOF
+
+
+fi
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+$as_echo_n "checking size of short... " >&6; }
+if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_short" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
+$as_echo "$ac_cv_sizeof_short" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if ${ac_cv_sizeof_size_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_size_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (size_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_size_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
+if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_void_p" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+
+ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "#define _GNU_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_type_struct_in6_addr" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IN6_ADDR 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "#define _GNU_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_IN6 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "#define _GNU_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_type_sa_family_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SA_FAMILY_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#define _GNU_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ADDRINFO 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#define _GNU_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_member "$LINENO" "struct in6_addr" "s6_addr32" "ac_cv_member_struct_in6_addr_s6_addr32" "#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_member_struct_in6_addr_s6_addr32" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct in6_addr" "s6_addr16" "ac_cv_member_struct_in6_addr_s6_addr16" "#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_member_struct_in6_addr_s6_addr16" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_in" "sin_len" "ac_cv_member_struct_sockaddr_in_sin_len" "#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_in_sin_len" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_len" "ac_cv_member_struct_sockaddr_in6_sin6_len" "#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_in6_sin6_len" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
+_ACEOF
+
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "struct so_linger" "ac_cv_type_struct_so_linger" "
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+"
+if test "x$ac_cv_type_struct_so_linger" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SO_LINGER 1
+_ACEOF
+
+#define HAVE_SO_LINGER
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
+$as_echo_n "checking for socklen_t... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+int
+main ()
+{
+socklen_t x;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define socklen_t unsigned int" >>confdefs.h
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether our compiler supports __func__" >&5
+$as_echo_n "checking whether our compiler supports __func__... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+ const char *cp = __func__;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether our compiler supports __FUNCTION__" >&5
+$as_echo_n "checking whether our compiler supports __FUNCTION__... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+ const char *cp = __FUNCTION__;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define __func__ __FUNCTION__" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define __func__ __FILE__" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+# check if we can compile with pthreads
+have_pthreads=no
+if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then
+
+
+
+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
+
+# OpenLDAP --with-threads
+
+# Check whether --with-threads was given.
+if test "${with_threads+set}" = set; then :
+ withval=$with_threads;
+ ol_arg=invalid
+ for ol_val in auto nt posix mach pth lwp yes no manual ; do
+ if test "$withval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ as_fn_error $? "bad value $withval for --with-threads" "$LINENO" 5
+ fi
+ ol_with_threads="$ol_arg"
+
+else
+ ol_with_threads="auto"
+fi
+# end --with-threads
+
+
+case "$ol_with_threads$host" in
+ auto*-*-solaris2.[0-6])
+ ol_with_threads=no
+ ;;
+esac
+
+
+ol_aix_threads=no
+case "$host" in
+*-*-aix*) if test -z "$CC" ; then
+ case "$ol_with_threads" in
+ auto | yes | posix) ol_aix_threads=yes ;;
+ esac
+ fi
+;;
+esac
+
+if test $ol_aix_threads = yes ; then
+ if test -z "${CC}" ; then
+ for ac_prog in cc_r xlc_r cc
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+done
+
+
+ if test "$CC" = cc ; then
+ if test $ol_with_threads != auto ; then
+ as_fn_error $? "--with-threads requires cc_r (or other suitable compiler) on AIX" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling threads, no cc_r on AIX" >&5
+$as_echo "$as_me: WARNING: disabling threads, no cc_r on AIX" >&2;}
+ fi
+ ol_with_threads=no
+ fi
+ fi
+
+ case ${CC} in cc_r | xlc_r)
+ ol_with_threads=posix
+ ol_cv_pthread_create=yes
+ ;;
+ esac
+fi
+
+ol_link_threads=no
+# OpenLDAP --with-yielding_select
+
+# Check whether --with-yielding_select was given.
+if test "${with_yielding_select+set}" = set; then :
+ withval=$with_yielding_select;
+ ol_arg=invalid
+ for ol_val in auto yes no manual ; do
+ if test "$withval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ as_fn_error $? "bad value $withval for --with-yielding_select" "$LINENO" 5
+ fi
+ ol_with_yielding_select="$ol_arg"
+
+else
+ ol_with_yielding_select="auto"
+fi
+# end --with-yielding_select
+
+
+case $ol_with_threads in auto | yes | nt)
+
+
+ ac_fn_c_check_func "$LINENO" "_beginthread" "ac_cv_func__beginthread"
+if test "x$ac_cv_func__beginthread" = xyes; then :
+
+fi
+
+
+ if test $ac_cv_func__beginthread = yes ; then
+
+$as_echo "#define HAVE_NT_THREADS 1" >>confdefs.h
+
+ ol_cv_nt_threads=yes
+ fi
+
+
+ if test "$ol_cv_nt_threads" = yes ; then
+ ol_link_threads=nt
+ ol_with_threads=found
+ ol_with_yielding_select=yes
+
+
+$as_echo "#define HAVE_NT_SERVICE_MANAGER 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_NT_EVENT_LOG 1" >>confdefs.h
+
+ fi
+
+ if test $ol_with_threads = nt ; then
+ as_fn_error $? "could not locate NT Threads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | posix)
+
+ for ac_header in pthread.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_pthread_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX thread version" >&5
+$as_echo_n "checking POSIX thread version... " >&6; }
+if ${ol_cv_pthread_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+
+int
+main ()
+{
+
+ int i = PTHREAD_CREATE_JOINABLE;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_detach" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=10
+else
+ ol_cv_pthread_version=8
+fi
+rm -f conftest*
+
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+# ifdef PTHREAD_CREATE_UNDETACHED
+ draft7
+# endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "draft7" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=7
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_attr_init" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <pthread.h>
+#ifdef PTHREAD_MUTEX_INITIALIZER
+ draft5
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "draft5" >/dev/null 2>&1; then :
+ ol_cv_pthread_version=5
+else
+ ol_cv_pthread_version=4
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_version" >&5
+$as_echo "$ol_cv_pthread_version" >&6; }
+
+
+ if test $ol_cv_pthread_version != 0 ; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREADS $ol_cv_pthread_version
+_ACEOF
+
+ else
+ as_fn_error $? "unknown pthread version" "$LINENO" 5
+ fi
+
+ # consider threads found
+ ol_with_threads=found
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
+$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
+if ${ol_cv_header_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
+ ol_cv_header_linux_threads=yes
+else
+ ol_cv_header_linux_threads=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
+$as_echo "$ol_cv_header_linux_threads" >&6; }
+ if test $ol_cv_header_linux_threads = yes; then
+
+$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth pthread.h" >&5
+$as_echo_n "checking for GNU Pth pthread.h... " >&6; }
+if ${ol_cv_header_gnu_pth_pthread_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+ __gnu_pth__;
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "__gnu_pth__" >/dev/null 2>&1; then :
+ ol_cv_header_gnu_pth_pthread_h=yes
+else
+ ol_cv_header_gnu_pth_pthread_h=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_gnu_pth_pthread_h" >&5
+$as_echo "$ol_cv_header_gnu_pth_pthread_h" >&6; }
+
+
+ if test $ol_cv_header_gnu_pth_pthread_h = no ; then
+ for ac_header in sched.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
+if test "x$ac_cv_header_sched_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SCHED_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in default libraries" >&5
+$as_echo_n "checking for pthread_create in default libraries... " >&6; }
+if ${ol_cv_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_create=yes
+else
+ ol_cv_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_create=yes
+else
+ ol_cv_pthread_create=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create" >&5
+$as_echo "$ol_cv_pthread_create" >&6; }
+
+ if test $ol_cv_pthread_create != no ; then
+ ol_link_threads=posix
+ ol_link_pthreads=""
+ fi
+
+ # Pthread try link: -kthread (ol_cv_pthread_kthread)
+if test "$ol_link_threads" = no ; then
+ # try -kthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -kthread" >&5
+$as_echo_n "checking for pthread link with -kthread... " >&6; }
+if ${ol_cv_pthread_kthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-kthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_kthread=yes
+else
+ ol_cv_pthread_kthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_kthread=yes
+else
+ ol_cv_pthread_kthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_kthread" >&5
+$as_echo "$ol_cv_pthread_kthread" >&6; }
+
+ if test $ol_cv_pthread_kthread = yes ; then
+ ol_link_pthreads="-kthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthread (ol_cv_pthread_pthread)
+if test "$ol_link_threads" = no ; then
+ # try -pthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthread" >&5
+$as_echo_n "checking for pthread link with -pthread... " >&6; }
+if ${ol_cv_pthread_pthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_pthread=yes
+else
+ ol_cv_pthread_pthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_pthread=yes
+else
+ ol_cv_pthread_pthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthread" >&5
+$as_echo "$ol_cv_pthread_pthread" >&6; }
+
+ if test $ol_cv_pthread_pthread = yes ; then
+ ol_link_pthreads="-pthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
+if test "$ol_link_threads" = no ; then
+ # try -pthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -pthreads" >&5
+$as_echo_n "checking for pthread link with -pthreads... " >&6; }
+if ${ol_cv_pthread_pthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-pthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_pthreads=yes
+else
+ ol_cv_pthread_pthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_pthreads=yes
+else
+ ol_cv_pthread_pthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_pthreads" >&5
+$as_echo "$ol_cv_pthread_pthreads" >&6; }
+
+ if test $ol_cv_pthread_pthreads = yes ; then
+ ol_link_pthreads="-pthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
+if test "$ol_link_threads" = no ; then
+ # try -mthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -mthreads" >&5
+$as_echo_n "checking for pthread link with -mthreads... " >&6; }
+if ${ol_cv_pthread_mthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-mthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_mthreads=yes
+else
+ ol_cv_pthread_mthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_mthreads=yes
+else
+ ol_cv_pthread_mthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_mthreads" >&5
+$as_echo "$ol_cv_pthread_mthreads" >&6; }
+
+ if test $ol_cv_pthread_mthreads = yes ; then
+ ol_link_pthreads="-mthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -thread (ol_cv_pthread_thread)
+if test "$ol_link_threads" = no ; then
+ # try -thread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -thread" >&5
+$as_echo_n "checking for pthread link with -thread... " >&6; }
+if ${ol_cv_pthread_thread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-thread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_thread=yes
+else
+ ol_cv_pthread_thread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_thread=yes
+else
+ ol_cv_pthread_thread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_thread" >&5
+$as_echo "$ol_cv_pthread_thread" >&6; }
+
+ if test $ol_cv_pthread_thread = yes ; then
+ ol_link_pthreads="-thread"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -lmach -lexc -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+$as_echo_n "checking for pthread link with -lpthread -lmach -lexc -lc_r... " >&6; }
+if ${ol_cv_pthread_lpthread_lmach_lexc_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&5
+$as_echo "$ol_cv_pthread_lpthread_lmach_lexc_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -lmach -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -lmach -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthread -lmach -lexc... " >&6; }
+if ${ol_cv_pthread_lpthread_lmach_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -lmach -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthread_lmach_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread_lmach_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthread_lmach_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
+ ol_link_pthreads="-lpthread -lmach -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread -Wl,-woff,85
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+$as_echo_n "checking for pthread link with -lpthread -Wl,-woff,85... " >&6; }
+if ${ol_cv_pthread_lib_lpthread_woff+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread -Wl,-woff,85 $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lib_lpthread_woff=yes
+else
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lib_lpthread_woff=yes
+else
+ ol_cv_pthread_lib_lpthread_woff=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthread_woff" >&5
+$as_echo "$ol_cv_pthread_lib_lpthread_woff" >&6; }
+
+ if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
+ ol_link_pthreads="-lpthread -Wl,-woff,85"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
+if test "$ol_link_threads" = no ; then
+ # try -lpthread
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthread" >&5
+$as_echo_n "checking for pthread link with -lpthread... " >&6; }
+if ${ol_cv_pthread_lpthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthread $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthread=yes
+else
+ ol_cv_pthread_lpthread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthread=yes
+else
+ ol_cv_pthread_lpthread=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthread" >&5
+$as_echo "$ol_cv_pthread_lpthread" >&6; }
+
+ if test $ol_cv_pthread_lpthread = yes ; then
+ ol_link_pthreads="-lpthread"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lc_r" >&5
+$as_echo_n "checking for pthread link with -lc_r... " >&6; }
+if ${ol_cv_pthread_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lc_r=yes
+else
+ ol_cv_pthread_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lc_r=yes
+else
+ ol_cv_pthread_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lc_r" >&5
+$as_echo "$ol_cv_pthread_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lc_r = yes ; then
+ ol_link_pthreads="-lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -threads (ol_cv_pthread_threads)
+if test "$ol_link_threads" = no ; then
+ # try -threads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -threads" >&5
+$as_echo_n "checking for pthread link with -threads... " >&6; }
+if ${ol_cv_pthread_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-threads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_threads=yes
+else
+ ol_cv_pthread_threads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_threads=yes
+else
+ ol_cv_pthread_threads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_threads" >&5
+$as_echo "$ol_cv_pthread_threads" >&6; }
+
+ if test $ol_cv_pthread_threads = yes ; then
+ ol_link_pthreads="-threads"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lmach -lexc -lc_r
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r... " >&6; }
+if ${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
+ ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lmach -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lmach -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lmach -lexc... " >&6; }
+if ${ol_cv_pthread_lpthreads_lmach_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lmach -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lmach_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lmach_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lmach_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lmach_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
+ ol_link_pthreads="-lpthreads -lmach -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+ # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads -lexc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads -lexc" >&5
+$as_echo_n "checking for pthread link with -lpthreads -lexc... " >&6; }
+if ${ol_cv_pthread_lpthreads_lexc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads -lexc $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lpthreads_lexc=yes
+else
+ ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lpthreads_lexc" >&5
+$as_echo "$ol_cv_pthread_lpthreads_lexc" >&6; }
+
+ if test $ol_cv_pthread_lpthreads_lexc = yes ; then
+ ol_link_pthreads="-lpthreads -lexc"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
+if test "$ol_link_threads" = no ; then
+ # try -lpthreads
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread link with -lpthreads" >&5
+$as_echo_n "checking for pthread link with -lpthreads... " >&6; }
+if ${ol_cv_pthread_lib_lpthreads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="-lpthreads $LIBS"
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int
+main ()
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_pthread_lib_lpthreads=yes
+else
+ ol_cv_pthread_lib_lpthreads=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_lib_lpthreads=yes
+else
+ ol_cv_pthread_lib_lpthreads=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_lib_lpthreads" >&5
+$as_echo "$ol_cv_pthread_lib_lpthreads" >&6; }
+
+ if test $ol_cv_pthread_lib_lpthreads = yes ; then
+ ol_link_pthreads="-lpthreads"
+ ol_link_threads=posix
+ fi
+fi
+
+
+ if test $ol_link_threads != no ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
+
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+
+ for ac_func in sched_yield pthread_yield thr_yield
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test $ac_cv_func_thr_yield = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_sched_yield=yes
+else
+ ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+ LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+
+$as_echo "#define HAVE_SCHED_YIELD 1" >>confdefs.h
+
+ ac_cv_func_sched_yield=yes
+else
+ ac_cv_func_sched_yield=no
+fi
+
+ fi
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test "$ac_cv_func_thr_yield" = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not locate sched_yield() or pthread_yield()" >&5
+$as_echo "$as_me: WARNING: could not locate sched_yield() or pthread_yield()" >&2;}
+ fi
+
+ for ac_func in pthread_kill
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill"
+if test "x$ac_cv_func_pthread_kill" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_KILL 1
+_ACEOF
+
+fi
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy with <pthread.h>" >&5
+$as_echo_n "checking for pthread_rwlock_destroy with <pthread.h>... " >&6; }
+if ${ol_cv_func_pthread_rwlock_destroy+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+pthread_rwlock_t rwlock;
+
+int
+main ()
+{
+pthread_rwlock_destroy(&rwlock);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_func_pthread_rwlock_destroy=yes
+else
+ ol_cv_func_pthread_rwlock_destroy=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_rwlock_destroy" >&5
+$as_echo "$ol_cv_func_pthread_rwlock_destroy" >&6; }
+ if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
+
+$as_echo "#define HAVE_PTHREAD_RWLOCK_DESTROY 1" >>confdefs.h
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_detach with <pthread.h>" >&5
+$as_echo_n "checking for pthread_detach with <pthread.h>... " >&6; }
+if ${ol_cv_func_pthread_detach+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+int
+main ()
+{
+pthread_detach(NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_func_pthread_detach=yes
+else
+ ol_cv_func_pthread_detach=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_func_pthread_detach" >&5
+$as_echo "$ol_cv_func_pthread_detach" >&6; }
+
+ if test $ol_cv_func_pthread_detach = no ; then
+ as_fn_error $? "could not locate pthread_detach()" "$LINENO" 5
+ fi
+
+
+$as_echo "#define HAVE_PTHREAD_DETACH 1" >>confdefs.h
+
+
+ for ac_func in \
+ pthread_setconcurrency \
+ pthread_getconcurrency \
+ thr_setconcurrency \
+ thr_getconcurrency \
+
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+ for ac_func in pthread_kill_other_threads_np
+do :
+ ac_fn_c_check_func "$LINENO" "pthread_kill_other_threads_np" "ac_cv_func_pthread_kill_other_threads_np"
+if test "x$ac_cv_func_pthread_kill_other_threads_np" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_KILL_OTHER_THREADS_NP 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads implementation" >&5
+$as_echo_n "checking for LinuxThreads implementation... " >&6; }
+if ${ol_cv_sys_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_sys_linux_threads" >&5
+$as_echo "$ol_cv_sys_linux_threads" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads consistency" >&5
+$as_echo_n "checking for LinuxThreads consistency... " >&6; }
+if ${ol_cv_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ol_cv_header_linux_threads = yes &&
+ test $ol_cv_sys_linux_threads = yes; then
+ ol_cv_linux_threads=yes
+ elif test $ol_cv_header_linux_threads = no &&
+ test $ol_cv_sys_linux_threads = no; then
+ ol_cv_linux_threads=no
+ else
+ ol_cv_linux_threads=error
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_linux_threads" >&5
+$as_echo "$ol_cv_linux_threads" >&6; }
+
+
+ if test $ol_cv_linux_threads = error; then
+ as_fn_error $? "LinuxThreads header/library mismatch" "$LINENO" 5;
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_create() works" >&5
+$as_echo_n "checking if pthread_create() works... " >&6; }
+if ${ol_cv_pthread_create_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ ol_cv_pthread_create_works=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_create_works=yes
+else
+ ol_cv_pthread_create_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_create_works" >&5
+$as_echo "$ol_cv_pthread_create_works" >&6; }
+
+ if test $ol_cv_pthread_create_works = no ; then
+ as_fn_error $? "pthread_create is not usable, check environment settings" "$LINENO" 5
+ fi
+
+ ol_replace_broken_yield=no
+
+ if test $ol_replace_broken_yield = yes ; then
+
+$as_echo "#define REPLACE_BROKEN_YIELD 1" >>confdefs.h
+
+ fi
+
+ if test x$ol_with_yielding_select = xauto ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if select yields when using pthreads" >&5
+$as_echo_n "checking if select yields when using pthreads... " >&6; }
+if ${ol_cv_pthread_select_yields+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ ol_cv_pthread_select_yields=cross
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*) 0
+#endif
+
+static int fildes[2];
+
+static void *task(p)
+ void *p;
+{
+ int i;
+ struct timeval tv;
+
+ fd_set rfds;
+
+ tv.tv_sec=10;
+ tv.tv_usec=0;
+
+ FD_ZERO(&rfds);
+ FD_SET(fildes[0], &rfds);
+
+ /* we're not interested in any fds */
+ i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+ if(i < 0) {
+ perror("select");
+ exit(10);
+ }
+
+ exit(0); /* if we exit here, the select blocked the whole process */
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+
+ /* create a pipe to select */
+ if(pipe(&fildes[0])) {
+ perror("select");
+ exit(1);
+ }
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+ (void) pthread_setconcurrency(2);
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
+ /* Set Solaris LWP concurrency to 2 */
+ thr_setconcurrency(2);
+#endif
+#endif
+
+#if HAVE_PTHREADS < 6
+ pthread_create(&t, pthread_attr_default, task, NULL);
+#else
+ pthread_create(&t, NULL, task, NULL);
+#endif
+
+ /* make sure task runs first */
+#ifdef HAVE_THR_YIELD
+ thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+ sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+ pthread_yield();
+#endif
+
+ exit(2);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ol_cv_pthread_select_yields=no
+else
+ ol_cv_pthread_select_yields=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_pthread_select_yields" >&5
+$as_echo "$ol_cv_pthread_select_yields" >&6; }
+
+ if test $ol_cv_pthread_select_yields = cross ; then
+ as_fn_error $? "crossing compiling: use --with-yielding-select=yes|no|manual" "$LINENO" 5
+ fi
+
+ if test $ol_cv_pthread_select_yields = yes ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ else
+ as_fn_error $? "could not locate usable POSIX Threads" "$LINENO" 5
+ fi
+ fi
+
+ if test $ol_with_threads = posix ; then
+ as_fn_error $? "could not locate POSIX Threads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | mach)
+
+ for ac_header in mach/cthreads.h cthreads.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_mach_cthreads_h = yes ; then
+ ol_with_threads=found
+
+ ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
+if test "x$ac_cv_func_cthread_fork" = xyes; then :
+ ol_link_threads=yes
+fi
+
+
+ if test $ol_link_threads = no ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cthread_fork with -all_load" >&5
+$as_echo_n "checking for cthread_fork with -all_load... " >&6; }
+if ${ol_cv_cthread_all_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ save_LIBS="$LIBS"
+ LIBS="-all_load $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <mach/cthreads.h>
+int
+main ()
+{
+
+ cthread_fork((void *)0, (void *)0);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_cthread_all_load=yes
+else
+ ol_cv_cthread_all_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_cthread_all_load" >&5
+$as_echo "$ol_cv_cthread_all_load" >&6; }
+
+ if test $ol_cv_cthread_all_load = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+ ol_link_threads=mach
+ ol_with_threads=found
+ fi
+ fi
+
+ elif test $ac_cv_header_cthreads_h = yes ; then
+
+ ol_with_threads=found
+
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lthreads"
+ ac_fn_c_check_func "$LINENO" "cthread_fork" "ac_cv_func_cthread_fork"
+if test "x$ac_cv_func_cthread_fork" = xyes; then :
+ ol_link_threads=yes
+fi
+
+ LIBS="$save_LIBS"
+
+ if test $ol_link_threads = yes ; then
+ LTHREAD_LIBS="-lthreads"
+ ol_link_threads=mach
+ ol_with_threads=found
+ else
+ as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
+ fi
+
+ elif test $ol_with_threads = mach ; then
+ as_fn_error $? "could not locate Mach CThreads" "$LINENO" 5
+ fi
+
+ if test $ol_link_threads = mach ; then
+
+$as_echo "#define HAVE_MACH_CTHREADS 1" >>confdefs.h
+
+ elif test $ol_with_threads = found ; then
+ as_fn_error $? "could not link with Mach CThreads" "$LINENO" 5
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | pth)
+
+ for ac_header in pth.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pth.h" "ac_cv_header_pth_h" "$ac_includes_default"
+if test "x$ac_cv_header_pth_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTH_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ if test $ac_cv_header_pth_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pth_version in -lpth" >&5
+$as_echo_n "checking for pth_version in -lpth... " >&6; }
+if ${ac_cv_lib_pth_pth_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpth $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pth_version ();
+int
+main ()
+{
+return pth_version ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pth_pth_version=yes
+else
+ ac_cv_lib_pth_pth_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pth_pth_version" >&5
+$as_echo "$ac_cv_lib_pth_pth_version" >&6; }
+if test "x$ac_cv_lib_pth_pth_version" = xyes; then :
+ have_pth=yes
+else
+ have_pth=no
+fi
+
+
+ if test $have_pth = yes ; then
+
+$as_echo "#define HAVE_GNU_PTH 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
+ ol_link_threads=pth
+ ol_with_threads=found
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | lwp)
+
+ for ac_header in thread.h synch.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_thread_h = yes &&
+ test $ac_cv_header_synch_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5
+$as_echo_n "checking for thr_create in -lthread... " >&6; }
+if ${ac_cv_lib_thread_thr_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char thr_create ();
+int
+main ()
+{
+return thr_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_thread_thr_create=yes
+else
+ ac_cv_lib_thread_thr_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5
+$as_echo "$ac_cv_lib_thread_thr_create" >&6; }
+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
+ have_thr=yes
+else
+ have_thr=no
+fi
+
+
+ if test $have_thr = yes ; then
+
+$as_echo "#define HAVE_THR 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
+ ol_link_threads=thr
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+
+ for ac_func in \
+ thr_setconcurrency \
+ thr_getconcurrency \
+
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ fi
+ fi
+
+ for ac_header in lwp/lwp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
+if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LWP_LWP_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_lwp_lwp_h = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwp_create in -llwp" >&5
+$as_echo_n "checking for lwp_create in -llwp... " >&6; }
+if ${ac_cv_lib_lwp_lwp_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llwp $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lwp_create ();
+int
+main ()
+{
+return lwp_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_lwp_lwp_create=yes
+else
+ ac_cv_lib_lwp_lwp_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lwp_lwp_create" >&5
+$as_echo "$ac_cv_lib_lwp_lwp_create" >&6; }
+if test "x$ac_cv_lib_lwp_lwp_create" = xyes; then :
+ have_lwp=yes
+else
+ have_lwp=no
+fi
+
+
+ if test $have_lwp = yes ; then
+
+$as_echo "#define HAVE_LWP 1" >>confdefs.h
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+ ol_link_threads=lwp
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=no
+ fi
+ fi
+ fi
+ ;;
+esac
+
+if test $ol_with_yielding_select = yes ; then
+
+$as_echo "#define HAVE_YIELDING_SELECT 1" >>confdefs.h
+
+fi
+
+if test $ol_with_threads = manual ; then
+ ol_link_threads=yes
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: thread defines and link options must be set manually" >&5
+$as_echo "$as_me: WARNING: thread defines and link options must be set manually" >&2;}
+
+ for ac_header in pthread.h sched.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_func in sched_yield pthread_yield
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LinuxThreads pthread.h" >&5
+$as_echo_n "checking for LinuxThreads pthread.h... " >&6; }
+if ${ol_cv_header_linux_threads+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pthread_kill_other_threads_np" >/dev/null 2>&1; then :
+ ol_cv_header_linux_threads=yes
+else
+ ol_cv_header_linux_threads=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_header_linux_threads" >&5
+$as_echo "$ol_cv_header_linux_threads" >&6; }
+ if test $ol_cv_header_linux_threads = yes; then
+
+$as_echo "#define HAVE_LINUX_THREADS 1" >>confdefs.h
+
+ fi
+
+
+ for ac_header in mach/cthreads.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h" "ac_cv_header_mach_cthreads_h" "$ac_includes_default"
+if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MACH_CTHREADS_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in lwp/lwp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lwp/lwp.h" "ac_cv_header_lwp_lwp_h" "$ac_includes_default"
+if test "x$ac_cv_header_lwp_lwp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LWP_LWP_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in thread.h synch.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+if test $ol_link_threads != no && test $ol_link_threads != nt ; then
+
+$as_echo "#define REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define THREAD_SAFE 1" >>confdefs.h
+
+
+$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
+
+
+$as_echo "#define THREADSAFE 1" >>confdefs.h
+
+
+$as_echo "#define _THREADSAFE 1" >>confdefs.h
+
+
+$as_echo "#define _SGI_MP_SOURCE 1" >>confdefs.h
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific errno" >&5
+$as_echo_n "checking for thread specific errno... " >&6; }
+if ${ol_cv_errno_thread_specific+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+int
+main ()
+{
+errno = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_errno_thread_specific=yes
+else
+ ol_cv_errno_thread_specific=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_errno_thread_specific" >&5
+$as_echo "$ol_cv_errno_thread_specific" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread specific h_errno" >&5
+$as_echo_n "checking for thread specific h_errno... " >&6; }
+if ${ol_cv_h_errno_thread_specific+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netdb.h>
+int
+main ()
+{
+h_errno = 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ol_cv_h_errno_thread_specific=yes
+else
+ ol_cv_h_errno_thread_specific=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ol_cv_h_errno_thread_specific" >&5
+$as_echo "$ol_cv_h_errno_thread_specific" >&6; }
+
+ if test $ol_cv_errno_thread_specific != yes ||
+ test $ol_cv_h_errno_thread_specific != yes ; then
+ LIBS="$LTHREAD_LIBS $LIBS"
+ LTHREAD_LIBS=""
+ fi
+
+fi
+
+if test $ol_link_threads = no ; then
+ if test $ol_with_threads = yes ; then
+ as_fn_error $? "no suitable thread support" "$LINENO" 5
+ fi
+
+ if test $ol_with_threads = auto ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no suitable thread support, disabling threads" >&5
+$as_echo "$as_me: WARNING: no suitable thread support, disabling threads" >&2;}
+ ol_with_threads=no
+ fi
+
+
+$as_echo "#define NO_THREADS 1" >>confdefs.h
+
+ LTHREAD_LIBS=""
+ BUILD_THREAD=no
+else
+ BUILD_THREAD=yes
+fi
+
+if test $ol_link_threads != no ; then
+
+$as_echo "#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1" >>confdefs.h
+
+fi
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+case "$ol_with_threads" in
+ no)
+ ol_pthread_ok=no
+
+ ;;
+ *)
+
+ have_pthreads=yes
+ PTHREAD_LIBS="$LTHREAD_LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ # The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5
+$as_echo_n "checking size of pthread_t... " >&6; }
+if ${ac_cv_sizeof_pthread_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" "
+ $ac_includes_default
+ #include <pthread.h>
+
+
+"; then :
+
+else
+ if test "$ac_cv_type_pthread_t" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (pthread_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pthread_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5
+$as_echo "$ac_cv_sizeof_pthread_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t
+_ACEOF
+
+
+
+ ;;
+esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+fi
+
+
+ if test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"; then
+ PTHREADS_TRUE=
+ PTHREADS_FALSE='#'
+else
+ PTHREADS_TRUE='#'
+ PTHREADS_FALSE=
+fi
+
+
+# check if we should compile locking into the library
+if test x$enable_thread_support = xno; then
+
+$as_echo "#define DISABLE_THREAD_SUPPORT 1" >>confdefs.h
+
+fi
+
+# check if we should hard-code the mm functions.
+if test x$enable_malloc_replacement = xno; then
+
+$as_echo "#define DISABLE_MM_REPLACEMENT 1" >>confdefs.h
+
+fi
+
+# check if we should hard-code debugging out
+if test x$enable_debug_mode = xno; then
+
+$as_echo "#define DISABLE_DEBUG_MODE 1" >>confdefs.h
+
+fi
+
+# check if we should enable verbose debugging
+if test x$enable_verbose_debug = xyes; then
+ CFLAGS="$CFLAGS -DUSE_DEBUG"
+fi
+
+# check if we have and should use openssl
+ if test "$enable_openssl" != "no" && test "$have_openssl" = "yes"; then
+ OPENSSL_TRUE=
+ OPENSSL_FALSE='#'
+else
+ OPENSSL_TRUE='#'
+ OPENSSL_FALSE=
+fi
+
+
+# Add some more warnings which we use in development but not in the
+# released versions. (Some relevant gcc versions can't handle these.)
+if test x$enable_gcc_warnings != xno && test "$GCC" = "yes"; then
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#if !defined(__GNUC__) || (__GNUC__ < 4)
+#error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ have_gcc4=yes
+else
+ have_gcc4=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+#error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ have_gcc42=yes
+else
+ have_gcc42=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+#error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ have_gcc45=yes
+else
+ have_gcc45=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#if !defined(__clang__)
+#error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ have_clang=yes
+else
+ have_clang=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum"
+ if test x$enable_gcc_warnings = xyes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+
+ CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing"
+
+ if test x$have_gcc4 = xyes ; then
+ # These warnings break gcc 3.3.5 and work on gcc 4.0.2
+ CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement"
+ #CFLAGS="$CFLAGS -Wold-style-definition"
+ fi
+
+ if test x$have_gcc42 = xyes ; then
+ # These warnings break gcc 4.0.2 and work on gcc 4.2
+ CFLAGS="$CFLAGS -Waddress"
+ fi
+
+ if test x$have_gcc42 = xyes && test x$have_clang = xno; then
+ # These warnings break gcc 4.0.2 and clang, but work on gcc 4.2
+ CFLAGS="$CFLAGS -Wnormalized=id -Woverride-init"
+ fi
+
+ if test x$have_gcc45 = xyes ; then
+ # These warnings work on gcc 4.5
+ CFLAGS="$CFLAGS -Wlogical-op"
+ fi
+
+ if test x$have_clang = xyes; then
+ # Disable the unused-function warnings, because these trigger
+ # for minheap-internal.h related code.
+ CFLAGS="$CFLAGS -Wno-unused-function"
+
+ # clang on macosx emits warnigns for each directory specified which
+ # isn't "used" generating a lot of build noise (typically 3 warnings
+ # per file
+ case "$host_os" in
+ darwin*)
+ CFLAGS="$CFLAGS -Qunused-arguments"
+ ;;
+ esac
+ fi
+
+##This will break the world on some 64-bit architectures
+# CFLAGS="$CFLAGS -Winline"
+
+fi
+
+LIBEVENT_GC_SECTIONS=
+if test "$GCC" = yes && test "$enable_function_sections" = yes ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports omitting unused code and data" >&5
+$as_echo_n "checking if linker supports omitting unused code and data... " >&6; }
+if ${libevent_cv_gc_sections_runs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ origCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,--gc-sections"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <stdio.h>
+
+int
+main ()
+{
+
+ FILE * fpC;
+ char buf[32];
+ size_t cch;
+ int read_success_once;
+
+ fpC = fopen("conftest.c", "r");
+ if (NULL == fpC)
+ exit(1);
+ do {
+ cch = fread(buf, sizeof(buf), 1, fpC);
+ read_success_once |= (0 != cch);
+ } while (0 != cch);
+ if (!read_success_once)
+ exit(2);
+ if (!feof(fpC))
+ exit(3);
+ if (0 != fclose(fpC))
+ exit(4);
+
+ exit(EXIT_SUCCESS);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then
+ libevent_cv_gc_sections_runs=no
+ else
+ libevent_cv_gc_sections_runs=no
+ ./conftest >/dev/null 2>&1 && libevent_cv_gc_sections_runs=yes
+ fi
+
+else
+ libevent_cv_gc_sections_runs=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$origCFLAGS"
+ { origCFLAGS=; unset origCFLAGS;}
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libevent_cv_gc_sections_runs" >&5
+$as_echo "$libevent_cv_gc_sections_runs" >&6; }
+ case "$libevent_cv_gc_sections_runs" in
+ yes)
+ CFLAGS="-ffunction-sections -fdata-sections $CFLAGS"
+ LIBEVENT_GC_SECTIONS="-Wl,--gc-sections"
+ ;;
+ esac
+fi
+
+
+ if test "$enable_libevent_install" = "yes"; then
+ INSTALL_LIBEVENT_TRUE=
+ INSTALL_LIBEVENT_FALSE='#'
+else
+ INSTALL_LIBEVENT_TRUE='#'
+ INSTALL_LIBEVENT_FALSE=
+fi
+
+
+ac_config_files="$ac_config_files libevent.pc libevent_openssl.pc libevent_pthreads.pc"
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_REGRESS_TRUE}" && test -z "${BUILD_REGRESS_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_REGRESS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ZLIB_REGRESS_TRUE}" && test -z "${ZLIB_REGRESS_FALSE}"; then
+ as_fn_error $? "conditional \"ZLIB_REGRESS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OPENSSL_TRUE}" && test -z "${OPENSSL_FALSE}"; then
+ as_fn_error $? "conditional \"OPENSSL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_WIN32_TRUE}" && test -z "${BUILD_WIN32_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_WIN32\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_CYGWIN_TRUE}" && test -z "${BUILD_CYGWIN_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_CYGWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_WITH_NO_UNDEFINED_TRUE}" && test -z "${BUILD_WITH_NO_UNDEFINED_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_WITH_NO_UNDEFINED\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${STRLCPY_IMPL_TRUE}" && test -z "${STRLCPY_IMPL_FALSE}"; then
+ as_fn_error $? "conditional \"STRLCPY_IMPL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${SELECT_BACKEND_TRUE}" && test -z "${SELECT_BACKEND_FALSE}"; then
+ as_fn_error $? "conditional \"SELECT_BACKEND\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${POLL_BACKEND_TRUE}" && test -z "${POLL_BACKEND_FALSE}"; then
+ as_fn_error $? "conditional \"POLL_BACKEND\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DEVPOLL_BACKEND_TRUE}" && test -z "${DEVPOLL_BACKEND_FALSE}"; then
+ as_fn_error $? "conditional \"DEVPOLL_BACKEND\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${KQUEUE_BACKEND_TRUE}" && test -z "${KQUEUE_BACKEND_FALSE}"; then
+ as_fn_error $? "conditional \"KQUEUE_BACKEND\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${EPOLL_BACKEND_TRUE}" && test -z "${EPOLL_BACKEND_FALSE}"; then
+ as_fn_error $? "conditional \"EPOLL_BACKEND\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${EVPORT_BACKEND_TRUE}" && test -z "${EVPORT_BACKEND_FALSE}"; then
+ as_fn_error $? "conditional \"EVPORT_BACKEND\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${SIGNAL_SUPPORT_TRUE}" && test -z "${SIGNAL_SUPPORT_FALSE}"; then
+ as_fn_error $? "conditional \"SIGNAL_SUPPORT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${PTHREADS_TRUE}" && test -z "${PTHREADS_FALSE}"; then
+ as_fn_error $? "conditional \"PTHREADS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${OPENSSL_TRUE}" && test -z "${OPENSSL_FALSE}"; then
+ as_fn_error $? "conditional \"OPENSSL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INSTALL_LIBEVENT_TRUE}" && test -z "${INSTALL_LIBEVENT_FALSE}"; then
+ as_fn_error $? "conditional \"INSTALL_LIBEVENT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by libevent $as_me 2.1.3-alpha-dev, which was
+generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+libevent config.status 2.1.3-alpha-dev
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "evconfig-private.h") CONFIG_HEADERS="$CONFIG_HEADERS evconfig-private.h:evconfig-private.h.in" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "libevent.pc") CONFIG_FILES="$CONFIG_FILES libevent.pc" ;;
+ "libevent_openssl.pc") CONFIG_FILES="$CONFIG_FILES libevent_openssl.pc" ;;
+ "libevent_pthreads.pc") CONFIG_FILES="$CONFIG_FILES libevent_pthreads.pc" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/sntp/libevent/configure.ac b/sntp/libevent/configure.ac
new file mode 100644
index 0000000..c60c7ac
--- /dev/null
+++ b/sntp/libevent/configure.ac
@@ -0,0 +1,919 @@
+dnl Copyright 2000-2007 Niels Provos
+dnl Copyright 2007-2012 Niels Provos and Nick Mathewson
+dnl
+dnl See LICENSE for copying information.
+dnl
+dnl Original version Dug Song <dugsong@monkey.org>
+
+AC_INIT(libevent,2.1.3-alpha-dev)
+AC_PREREQ(2.59)
+AC_CONFIG_SRCDIR(event.c)
+
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([build-aux])
+
+AM_INIT_AUTOMAKE
+dnl AM_SILENT_RULES req. automake 1.11. [no] defaults V=1
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AC_CONFIG_HEADERS(config.h evconfig-private.h:evconfig-private.h.in)
+AC_DEFINE(NUMERIC_VERSION, 0x02010301, [Numeric representation of the version])
+
+dnl Initialize prefix.
+if test "$prefix" = "NONE"; then
+ prefix="/usr/local"
+fi
+
+dnl Try and get a full POSIX environment on obscure systems
+ifdef([AC_USE_SYSTEM_EXTENSIONS], [
+AC_USE_SYSTEM_EXTENSIONS
+], [
+AC_AIX
+AC_GNU_SOURCE
+AC_MINIX
+])
+
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+dnl the 'build' machine is where we run configure and compile
+dnl the 'host' machine is where the resulting stuff runs.
+
+#case "$host_os" in
+#
+# osf5*)
+# CFLAGS="$CFLAGS -D_OSF_SOURCE"
+# ;;
+#esac
+
+dnl Checks for programs.
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LN_S
+# AC_PROG_MKDIR_P - $(MKDIR_P) should be defined by AM_INIT_AUTOMAKE
+
+# AC_PROG_SED is only available in Autoconf >= 2.59b; workaround for older
+# versions
+ifdef([AC_PROG_SED], [AC_PROG_SED], [
+AC_CHECK_PROGS(SED, [gsed sed])
+])
+
+AC_PROG_GCC_TRADITIONAL
+
+# We need to test for at least gcc 2.95 here, because older versions don't
+# have -fno-strict-aliasing
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
+#error
+#endif])], have_gcc295=yes, have_gcc295=no)
+
+if test "$GCC" = "yes" ; then
+ # Enable many gcc warnings by default...
+ CFLAGS="$CFLAGS -Wall"
+ # And disable the strict-aliasing optimization, since it breaks
+ # our sockaddr-handling code in strange ways.
+ if test x$have_gcc295 = xyes; then
+ CFLAGS="$CFLAGS -fno-strict-aliasing"
+ fi
+fi
+
+# OS X Lion started deprecating the system openssl. Let's just disable
+# all deprecation warnings on OS X.
+case "$host_os" in
+
+ darwin*)
+ CFLAGS="$CFLAGS -Wno-deprecated-declarations"
+ ;;
+esac
+
+AC_ARG_ENABLE(gcc-warnings,
+ AS_HELP_STRING(--disable-gcc-warnings, disable verbose warnings with GCC))
+
+AC_ARG_ENABLE(gcc-hardening,
+ AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
+[if test x$enableval = xyes; then
+ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
+ CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
+ CFLAGS="$CFLAGS --param ssp-buffer-size=1"
+fi])
+
+AC_ARG_ENABLE(thread-support,
+ AS_HELP_STRING(--disable-thread-support, disable support for threading),
+ [], [enable_thread_support=yes])
+AC_ARG_ENABLE(malloc-replacement,
+ AS_HELP_STRING(--disable-malloc-replacement, disable support for replacing the memory mgt functions),
+ [], [enable_malloc_replacement=yes])
+AC_ARG_ENABLE(openssl,
+ AS_HELP_STRING(--disable-openssl, disable support for openssl encryption),
+ [], [enable_openssl=yes])
+AC_ARG_ENABLE(debug-mode,
+ AS_HELP_STRING(--disable-debug-mode, disable support for running in debug mode),
+ [], [enable_debug_mode=yes])
+AC_ARG_ENABLE([libevent-install],
+ AS_HELP_STRING([--disable-libevent-install, disable installation of libevent]),
+ [], [enable_libevent_install=yes])
+AC_ARG_ENABLE([libevent-regress],
+ AS_HELP_STRING([--disable-libevent-regress, skip regress in make check]),
+ [], [enable_libevent_regress=yes])
+AC_ARG_ENABLE([function-sections],
+ AS_HELP_STRING([--enable-function-sections, make static library allow smaller binaries with --gc-sections]),
+ [], [enable_function_sections=no])
+AC_ARG_ENABLE([verbose-debug],
+ AS_HELP_STRING([--enable-verbose-debug, verbose debug logging]),
+ [], [enable_verbose_debug=no])
+
+
+AC_PROG_LIBTOOL
+
+dnl Uncomment "AC_DISABLE_SHARED" to make shared libraries not get
+dnl built by default. You can also turn shared libs on and off from
+dnl the command line with --enable-shared and --disable-shared.
+dnl AC_DISABLE_SHARED
+AC_SUBST(LIBTOOL_DEPS)
+
+AM_CONDITIONAL([BUILD_REGRESS], [test "$enable_libevent_regress" = "yes"])
+
+dnl Checks for libraries.
+AC_SEARCH_LIBS([inet_ntoa], [nsl])
+AC_SEARCH_LIBS([socket], [socket])
+AC_SEARCH_LIBS([inet_aton], [resolv])
+AC_SEARCH_LIBS([clock_gettime], [rt])
+AC_SEARCH_LIBS([sendfile], [sendfile])
+
+dnl - check if the macro _WIN32 is defined on this compiler.
+dnl - (this is how we check for a windows compiler)
+AC_MSG_CHECKING(for WIN32)
+AC_TRY_COMPILE(,
+ [
+#ifndef _WIN32
+die horribly
+#endif
+ ],
+ bwin32=true; AC_MSG_RESULT(yes),
+ bwin32=false; AC_MSG_RESULT(no),
+)
+
+dnl - check if the macro __CYGWIN__ is defined on this compiler.
+dnl - (this is how we check for a cygwin version of GCC)
+AC_MSG_CHECKING(for CYGWIN)
+AC_TRY_COMPILE(,
+ [
+#ifndef __CYGWIN__
+die horribly
+#endif
+ ],
+ cygwin=true; AC_MSG_RESULT(yes),
+ cygwin=false; AC_MSG_RESULT(no),
+)
+
+AC_CHECK_HEADERS([zlib.h])
+
+if test "x$ac_cv_header_zlib_h" = "xyes"; then
+dnl Determine if we have zlib for regression tests
+dnl Don't put this one in LIBS
+save_LIBS="$LIBS"
+LIBS=""
+ZLIB_LIBS=""
+have_zlib=no
+AC_SEARCH_LIBS([inflateEnd], [z],
+ [have_zlib=yes
+ ZLIB_LIBS="$LIBS"
+ AC_DEFINE(HAVE_LIBZ, 1, [Define if the system has zlib])])
+LIBS="$save_LIBS"
+AC_SUBST(ZLIB_LIBS)
+fi
+AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"])
+
+dnl See if we have openssl. This doesn't go in LIBS either.
+if test "$bwin32" = true; then
+ EV_LIB_WS32=-lws2_32
+ EV_LIB_GDI=-lgdi32
+else
+ EV_LIB_WS32=
+ EV_LIB_GDI=
+fi
+AC_SUBST(EV_LIB_WS32)
+AC_SUBST(EV_LIB_GDI)
+AC_SUBST(OPENSSL_LIBADD)
+
+AC_SYS_LARGEFILE
+
+LIBEVENT_OPENSSL
+
+dnl Checks for header files.
+AC_CHECK_HEADERS([ \
+ arpa/inet.h \
+ fcntl.h \
+ ifaddrs.h \
+ mach/mach_time.h \
+ netdb.h \
+ netinet/in.h \
+ netinet/in6.h \
+ netinet/tcp.h \
+ poll.h \
+ port.h \
+ stdarg.h \
+ stddef.h \
+ sys/devpoll.h \
+ sys/epoll.h \
+ sys/event.h \
+ sys/eventfd.h \
+ sys/ioctl.h \
+ sys/mman.h \
+ sys/param.h \
+ sys/queue.h \
+ sys/resource.h \
+ sys/select.h \
+ sys/sendfile.h \
+ sys/socket.h \
+ sys/stat.h \
+ sys/time.h \
+ sys/timerfd.h \
+ sys/uio.h \
+ sys/wait.h \
+])
+
+AC_CHECK_HEADERS(sys/sysctl.h, [], [], [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+])
+if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
+ AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/queue.h>
+#ifdef TAILQ_FOREACH
+ yes
+#endif
+], [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_TAILQFOREACH, 1,
+ [Define if TAILQ_FOREACH is defined in <sys/queue.h>])],
+ AC_MSG_RESULT(no)
+ )
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timeradd in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timeradd
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERADD, 1,
+ [Define if timeradd is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timercmp in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timercmp
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERCMP, 1,
+ [Define if timercmp is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timerclear in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timerclear
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERCLEAR, 1,
+ [Define if timerclear is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_time_h" = "xyes"; then
+ AC_MSG_CHECKING(for timerisset in sys/time.h)
+ AC_EGREP_CPP(yes,
+[
+#include <sys/time.h>
+#ifdef timerisset
+ yes
+#endif
+], [ AC_DEFINE(HAVE_TIMERISSET, 1,
+ [Define if timerisset is defined in <sys/time.h>])
+ AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no)
+)
+fi
+
+if test "x$ac_cv_header_sys_sysctl_h" = "xyes"; then
+ AC_CHECK_DECLS([CTL_KERN, KERN_RANDOM, RANDOM_UUID, KERN_ARND], [], [],
+ [[#include <sys/types.h>
+ #include <sys/sysctl.h>]]
+ )
+fi
+
+AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
+AM_CONDITIONAL(BUILD_CYGWIN, test x$cygwin = xtrue)
+AM_CONDITIONAL(BUILD_WITH_NO_UNDEFINED, test x$bwin32 = xtrue || test x$cygwin = xtrue)
+
+if test x$bwin32 = xtrue; then
+ AC_SEARCH_LIBS([getservbyname],[ws2_32])
+fi
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_HEADER_TIME
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS([ \
+ accept4 \
+ arc4random \
+ arc4random_buf \
+ clock_gettime \
+ eventfd \
+ epoll_create1 \
+ fcntl \
+ getegid \
+ geteuid \
+ getifaddrs \
+ getnameinfo \
+ getprotobynumber \
+ gettimeofday \
+ inet_ntop \
+ inet_pton \
+ issetugid \
+ mach_absolute_time \
+ mmap \
+ nanosleep \
+ pipe \
+ pipe2 \
+ putenv \
+ sendfile \
+ setenv \
+ setrlimit \
+ sigaction \
+ signal \
+ splice \
+ strlcpy \
+ strsep \
+ strtok_r \
+ strtoll \
+ sysctl \
+ timerfd_create \
+ umask \
+ unsetenv \
+ usleep \
+ vasprintf \
+])
+AM_CONDITIONAL(STRLCPY_IMPL, [test x"$ac_cv_func_strlcpy" = xno])
+
+AC_CACHE_CHECK(
+ [for getaddrinfo],
+ [libevent_cv_getaddrinfo],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+ ]],
+ [[
+ getaddrinfo;
+ ]]
+ )],
+ [libevent_cv_getaddrinfo=yes],
+ [libevent_cv_getaddrinfo=no]
+ )]
+)
+if test "$libevent_cv_getaddrinfo" = "yes" ; then
+ AC_DEFINE([HAVE_GETADDRINFO], [1], [Do we have getaddrinfo()?])
+else
+
+AC_CHECK_FUNCS([getservbyname])
+# Check for gethostbyname_r in all its glorious incompatible versions.
+# (This is cut-and-pasted from Tor, which based its logic on
+# Python's configure.in.)
+AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
+ [Define this if you have any gethostbyname_r()])
+
+AC_CHECK_FUNC(gethostbyname_r, [
+ AC_MSG_CHECKING([how many arguments gethostbyname_r() wants])
+ OLD_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <netdb.h>
+ ], [[
+ char *cp1, *cp2;
+ struct hostent *h1, *h2;
+ int i1, i2;
+ (void)gethostbyname_r(cp1,h1,cp2,i1,&h2,&i2);
+ ]])],[
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1,
+ [Define this if gethostbyname_r takes 6 arguments])
+ AC_MSG_RESULT(6)
+ ], [
+ AC_TRY_COMPILE([
+#include <netdb.h>
+ ], [
+ char *cp1, *cp2;
+ struct hostent *h1;
+ int i1, i2;
+ (void)gethostbyname_r(cp1,h1,cp2,i1,&i2);
+ ], [
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1,
+ [Define this if gethostbyname_r takes 5 arguments])
+ AC_MSG_RESULT(5)
+ ], [
+ AC_TRY_COMPILE([
+#include <netdb.h>
+ ], [
+ char *cp1;
+ struct hostent *h1;
+ struct hostent_data hd;
+ (void) gethostbyname_r(cp1,h1,&hd);
+ ], [
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R)
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1,
+ [Define this if gethostbyname_r takes 3 arguments])
+ AC_MSG_RESULT(3)
+ ], [
+ AC_MSG_RESULT(0)
+ ])
+ ])
+ ])
+ CFLAGS=$OLD_CFLAGS
+])
+
+fi
+
+AC_MSG_CHECKING(for F_SETFD in fcntl.h)
+AC_EGREP_CPP(yes,
+[
+#define _GNU_SOURCE
+#include <fcntl.h>
+#ifdef F_SETFD
+yes
+#endif
+], [ AC_DEFINE(HAVE_SETFD, 1,
+ [Define if F_SETFD is defined in <fcntl.h>])
+ AC_MSG_RESULT(yes) ], AC_MSG_RESULT(no))
+
+needsignal=no
+haveselect=no
+if test x$bwin32 != xtrue; then
+ AC_CHECK_FUNCS(select, [haveselect=yes], )
+ if test "x$haveselect" = "xyes" ; then
+ needsignal=yes
+ fi
+fi
+AM_CONDITIONAL(SELECT_BACKEND, [test "x$haveselect" = "xyes"])
+
+havepoll=no
+AC_CHECK_FUNCS(poll, [havepoll=yes], )
+if test "x$havepoll" = "xyes" ; then
+ needsignal=yes
+fi
+AM_CONDITIONAL(POLL_BACKEND, [test "x$havepoll" = "xyes"])
+
+havedevpoll=no
+if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
+ AC_DEFINE(HAVE_DEVPOLL, 1,
+ [Define if /dev/poll is available])
+fi
+AM_CONDITIONAL(DEVPOLL_BACKEND, [test "x$ac_cv_header_sys_devpoll_h" = "xyes"])
+
+havekqueue=no
+if test "x$ac_cv_header_sys_event_h" = "xyes"; then
+ AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
+ if test "x$havekqueue" = "xyes" ; then
+ AC_MSG_CHECKING(for working kqueue)
+ AC_TRY_RUN(
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/event.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int
+main(int argc, char **argv)
+{
+ int kq;
+ int n;
+ int fd[[2]];
+ struct kevent ev;
+ struct timespec ts;
+ char buf[[8000]];
+
+ if (pipe(fd) == -1)
+ exit(1);
+ if (fcntl(fd[[1]], F_SETFL, O_NONBLOCK) == -1)
+ exit(1);
+
+ while ((n = write(fd[[1]], buf, sizeof(buf))) == sizeof(buf))
+ ;
+
+ if ((kq = kqueue()) == -1)
+ exit(1);
+
+ memset(&ev, 0, sizeof(ev));
+ ev.ident = fd[[1]];
+ ev.filter = EVFILT_WRITE;
+ ev.flags = EV_ADD | EV_ENABLE;
+ n = kevent(kq, &ev, 1, NULL, 0, NULL);
+ if (n == -1)
+ exit(1);
+
+ read(fd[[0]], buf, sizeof(buf));
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+ n = kevent(kq, NULL, 0, &ev, 1, &ts);
+ if (n == -1 || n == 0)
+ exit(1);
+
+ exit(0);
+}, [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
+ [Define if kqueue works correctly with pipes])
+ havekqueue=yes
+ ], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
+ fi
+fi
+AM_CONDITIONAL(KQUEUE_BACKEND, [test "x$havekqueue" = "xyes"])
+
+haveepollsyscall=no
+haveepoll=no
+AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
+if test "x$haveepoll" = "xyes" ; then
+ AC_DEFINE(HAVE_EPOLL, 1,
+ [Define if your system supports the epoll system calls])
+ needsignal=yes
+fi
+if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
+ if test "x$haveepoll" = "xno" ; then
+ AC_MSG_CHECKING(for epoll system call)
+ AC_TRY_RUN(
+#include <stdint.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/epoll.h>
+#include <unistd.h>
+
+int
+epoll_create(int size)
+{
+ return (syscall(__NR_epoll_create, size));
+}
+
+int
+main(int argc, char **argv)
+{
+ int epfd;
+
+ epfd = epoll_create(256);
+ exit (epfd == -1 ? 1 : 0);
+}, [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_EPOLL, 1,
+ [Define if your system supports the epoll system calls])
+ needsignal=yes
+ have_epoll=yes
+ AC_LIBOBJ(epoll_sub)
+ ], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
+ fi
+fi
+AM_CONDITIONAL(EPOLL_BACKEND, [test "x$haveepoll" = "xyes"])
+
+haveeventports=no
+AC_CHECK_FUNCS(port_create, [haveeventports=yes], )
+if test "x$haveeventports" = "xyes" ; then
+ AC_DEFINE(HAVE_EVENT_PORTS, 1,
+ [Define if your system supports event ports])
+ needsignal=yes
+fi
+AM_CONDITIONAL(EVPORT_BACKEND, [test "x$haveeventports" = "xyes"])
+
+if test "x$bwin32" = "xtrue"; then
+ needsignal=yes
+fi
+
+AM_CONDITIONAL(SIGNAL_SUPPORT, [test "x$needsignal" = "xyes"])
+
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t, uintptr_t], , ,
+[#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif])
+
+AC_CHECK_TYPES([fd_mask], , ,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif])
+
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(off_t)
+
+AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo, struct sockaddr_storage], , ,
+[#define _GNU_SOURCE
+#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+])
+AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct sockaddr_in.sin_len, struct sockaddr_in6.sin6_len, struct sockaddr_storage.ss_family, struct sockaddr_storage.__ss_family], , ,
+[#include <sys/types.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef _WIN32
+#define WIN32_WINNT 0x400
+#define _WIN32_WINNT 0x400
+#define WIN32_LEAN_AND_MEAN
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#include <winsock.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+])
+
+AC_CHECK_TYPES([struct so_linger],
+[#define HAVE_SO_LINGER], ,
+[
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+])
+
+AC_MSG_CHECKING([for socklen_t])
+AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>],
+ [socklen_t x;],
+ AC_MSG_RESULT([yes]),
+ [AC_MSG_RESULT([no])
+ AC_DEFINE(socklen_t, unsigned int,
+ [Define to unsigned int if you dont have it])]
+)
+
+AC_MSG_CHECKING([whether our compiler supports __func__])
+AC_TRY_COMPILE([],
+ [ const char *cp = __func__; ],
+ AC_MSG_RESULT([yes]),
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
+ AC_TRY_COMPILE([],
+ [ const char *cp = __FUNCTION__; ],
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(__func__, __FUNCTION__,
+ [Define to appropriate substitue if compiler doesnt have __func__]),
+ AC_MSG_RESULT([no])
+ AC_DEFINE(__func__, __FILE__,
+ [Define to appropriate substitue if compiler doesnt have __func__])))
+
+
+# check if we can compile with pthreads
+have_pthreads=no
+if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then
+ OL_THREAD_CHECK([
+ have_pthreads=yes
+ PTHREAD_LIBS="$LTHREAD_LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ AC_CHECK_SIZEOF(
+ [pthread_t],
+ [],
+ [
+ AC_INCLUDES_DEFAULT()
+ #include <pthread.h>
+ ]
+ )
+ ])
+fi
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AM_CONDITIONAL([PTHREADS], [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"])
+
+# check if we should compile locking into the library
+if test x$enable_thread_support = xno; then
+ AC_DEFINE(DISABLE_THREAD_SUPPORT, 1,
+ [Define if libevent should not be compiled with thread support])
+fi
+
+# check if we should hard-code the mm functions.
+if test x$enable_malloc_replacement = xno; then
+ AC_DEFINE(DISABLE_MM_REPLACEMENT, 1,
+ [Define if libevent should not allow replacing the mm functions])
+fi
+
+# check if we should hard-code debugging out
+if test x$enable_debug_mode = xno; then
+ AC_DEFINE(DISABLE_DEBUG_MODE, 1,
+ [Define if libevent should build without support for a debug mode])
+fi
+
+# check if we should enable verbose debugging
+if test x$enable_verbose_debug = xyes; then
+ CFLAGS="$CFLAGS -DUSE_DEBUG"
+fi
+
+# check if we have and should use openssl
+AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
+
+# Add some more warnings which we use in development but not in the
+# released versions. (Some relevant gcc versions can't handle these.)
+if test x$enable_gcc_warnings != xno && test "$GCC" = "yes"; then
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 4)
+#error
+#endif])], have_gcc4=yes, have_gcc4=no)
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+#error
+#endif])], have_gcc42=yes, have_gcc42=no)
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+#error
+#endif])], have_gcc45=yes, have_gcc45=no)
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__clang__)
+#error
+#endif])], have_clang=yes, have_clang=no)
+
+ CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum"
+ if test x$enable_gcc_warnings = xyes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+
+ CFLAGS="$CFLAGS -Wno-unused-parameter -Wstrict-aliasing"
+
+ if test x$have_gcc4 = xyes ; then
+ # These warnings break gcc 3.3.5 and work on gcc 4.0.2
+ CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement"
+ #CFLAGS="$CFLAGS -Wold-style-definition"
+ fi
+
+ if test x$have_gcc42 = xyes ; then
+ # These warnings break gcc 4.0.2 and work on gcc 4.2
+ CFLAGS="$CFLAGS -Waddress"
+ fi
+
+ if test x$have_gcc42 = xyes && test x$have_clang = xno; then
+ # These warnings break gcc 4.0.2 and clang, but work on gcc 4.2
+ CFLAGS="$CFLAGS -Wnormalized=id -Woverride-init"
+ fi
+
+ if test x$have_gcc45 = xyes ; then
+ # These warnings work on gcc 4.5
+ CFLAGS="$CFLAGS -Wlogical-op"
+ fi
+
+ if test x$have_clang = xyes; then
+ # Disable the unused-function warnings, because these trigger
+ # for minheap-internal.h related code.
+ CFLAGS="$CFLAGS -Wno-unused-function"
+
+ # clang on macosx emits warnigns for each directory specified which
+ # isn't "used" generating a lot of build noise (typically 3 warnings
+ # per file
+ case "$host_os" in
+ darwin*)
+ CFLAGS="$CFLAGS -Qunused-arguments"
+ ;;
+ esac
+ fi
+
+##This will break the world on some 64-bit architectures
+# CFLAGS="$CFLAGS -Winline"
+
+fi
+
+LIBEVENT_GC_SECTIONS=
+if test "$GCC" = yes && test "$enable_function_sections" = yes ; then
+ AC_CACHE_CHECK(
+ [if linker supports omitting unused code and data],
+ [libevent_cv_gc_sections_runs],
+ [
+ dnl NetBSD will link but likely not run with --gc-sections
+ dnl http://bugs.ntp.org/1844
+ dnl http://gnats.netbsd.org/40401
+ dnl --gc-sections causes attempt to load as linux elf, with
+ dnl wrong syscalls in place. Test a little gauntlet of
+ dnl simple stdio read code checking for errors, expecting
+ dnl enough syscall differences that the NetBSD code will
+ dnl fail even with Linux emulation working as designed.
+ dnl A shorter test could be refined by someone with access
+ dnl to a NetBSD host with Linux emulation working.
+ origCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,--gc-sections"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stdlib.h>
+ #include <stdio.h>
+ ]],
+ [[
+ FILE * fpC;
+ char buf[32];
+ size_t cch;
+ int read_success_once;
+
+ fpC = fopen("conftest.c", "r");
+ if (NULL == fpC)
+ exit(1);
+ do {
+ cch = fread(buf, sizeof(buf), 1, fpC);
+ read_success_once |= (0 != cch);
+ } while (0 != cch);
+ if (!read_success_once)
+ exit(2);
+ if (!feof(fpC))
+ exit(3);
+ if (0 != fclose(fpC))
+ exit(4);
+
+ exit(EXIT_SUCCESS);
+ ]]
+ )],
+ [
+ dnl We have to do this invocation manually so that we can
+ dnl get the output of conftest.err to make sure it doesn't
+ dnl mention gc-sections.
+ if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then
+ libevent_cv_gc_sections_runs=no
+ else
+ libevent_cv_gc_sections_runs=no
+ ./conftest >/dev/null 2>&1 && libevent_cv_gc_sections_runs=yes
+ fi
+ ],
+ [libevent_cv_gc_sections_runs=no]
+ )
+ CFLAGS="$origCFLAGS"
+ AS_UNSET([origCFLAGS])
+ ]
+ )
+ case "$libevent_cv_gc_sections_runs" in
+ yes)
+ CFLAGS="-ffunction-sections -fdata-sections $CFLAGS"
+ LIBEVENT_GC_SECTIONS="-Wl,--gc-sections"
+ ;;
+ esac
+fi
+AC_SUBST([LIBEVENT_GC_SECTIONS])
+
+AM_CONDITIONAL([INSTALL_LIBEVENT], [test "$enable_libevent_install" = "yes"])
+
+AC_CONFIG_FILES( [libevent.pc libevent_openssl.pc libevent_pthreads.pc] )
+AC_OUTPUT(Makefile)
diff --git a/sntp/libevent/defer-internal.h b/sntp/libevent/defer-internal.h
new file mode 100644
index 0000000..d8cf32f
--- /dev/null
+++ b/sntp/libevent/defer-internal.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef DEFER_INTERNAL_H_INCLUDED_
+#define DEFER_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/queue.h>
+
+struct event_callback;
+typedef void (*deferred_cb_fn)(struct event_callback *, void *);
+
+/**
+ Initialize an empty, non-pending event_callback.
+
+ @param deferred The struct event_callback structure to initialize.
+ @param priority The priority that the callback should run at.
+ @param cb The function to run when the struct event_callback executes.
+ @param arg The function's second argument.
+ */
+void event_deferred_cb_init_(struct event_callback *, ev_uint8_t, deferred_cb_fn, void *);
+/**
+ Change the priority of a non-pending event_callback.
+ */
+void event_deferred_cb_set_priority_(struct event_callback *, ev_uint8_t);
+/**
+ Cancel a struct event_callback if it is currently scheduled in an event_base.
+ */
+void event_deferred_cb_cancel_(struct event_base *, struct event_callback *);
+/**
+ Activate a struct event_callback if it is not currently scheduled in an event_base.
+
+ Return true iff it was not previously scheduled.
+ */
+int event_deferred_cb_schedule_(struct event_base *, struct event_callback *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT_INTERNAL_H_INCLUDED_ */
+
diff --git a/sntp/libevent/devpoll.c b/sntp/libevent/devpoll.c
new file mode 100644
index 0000000..3a2f86d
--- /dev/null
+++ b/sntp/libevent/devpoll.c
@@ -0,0 +1,311 @@
+/*
+ * Copyright 2000-2009 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_DEVPOLL
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <sys/devpoll.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/thread.h"
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "evthread-internal.h"
+
+struct devpollop {
+ struct pollfd *events;
+ int nevents;
+ int dpfd;
+ struct pollfd *changes;
+ int nchanges;
+};
+
+static void *devpoll_init(struct event_base *);
+static int devpoll_add(struct event_base *, int fd, short old, short events, void *);
+static int devpoll_del(struct event_base *, int fd, short old, short events, void *);
+static int devpoll_dispatch(struct event_base *, struct timeval *);
+static void devpoll_dealloc(struct event_base *);
+
+const struct eventop devpollops = {
+ "devpoll",
+ devpoll_init,
+ devpoll_add,
+ devpoll_del,
+ devpoll_dispatch,
+ devpoll_dealloc,
+ 1, /* need reinit */
+ EV_FEATURE_FDS|EV_FEATURE_O1,
+ 0
+};
+
+#define NEVENT 32000
+
+static int
+devpoll_commit(struct devpollop *devpollop)
+{
+ /*
+ * Due to a bug in Solaris, we have to use pwrite with an offset of 0.
+ * Write is limited to 2GB of data, until it will fail.
+ */
+ if (pwrite(devpollop->dpfd, devpollop->changes,
+ sizeof(struct pollfd) * devpollop->nchanges, 0) == -1)
+ return (-1);
+
+ devpollop->nchanges = 0;
+ return (0);
+}
+
+static int
+devpoll_queue(struct devpollop *devpollop, int fd, int events) {
+ struct pollfd *pfd;
+
+ if (devpollop->nchanges >= devpollop->nevents) {
+ /*
+ * Change buffer is full, must commit it to /dev/poll before
+ * adding more
+ */
+ if (devpoll_commit(devpollop) != 0)
+ return (-1);
+ }
+
+ pfd = &devpollop->changes[devpollop->nchanges++];
+ pfd->fd = fd;
+ pfd->events = events;
+ pfd->revents = 0;
+
+ return (0);
+}
+
+static void *
+devpoll_init(struct event_base *base)
+{
+ int dpfd, nfiles = NEVENT;
+ struct rlimit rl;
+ struct devpollop *devpollop;
+
+ if (!(devpollop = mm_calloc(1, sizeof(struct devpollop))))
+ return (NULL);
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
+ rl.rlim_cur != RLIM_INFINITY)
+ nfiles = rl.rlim_cur;
+
+ /* Initialize the kernel queue */
+ if ((dpfd = evutil_open_closeonexec_("/dev/poll", O_RDWR, 0)) == -1) {
+ event_warn("open: /dev/poll");
+ mm_free(devpollop);
+ return (NULL);
+ }
+
+ devpollop->dpfd = dpfd;
+
+ /* Initialize fields */
+ /* FIXME: allocating 'nfiles' worth of space here can be
+ * expensive and unnecessary. See how epoll.c does it instead. */
+ devpollop->events = mm_calloc(nfiles, sizeof(struct pollfd));
+ if (devpollop->events == NULL) {
+ mm_free(devpollop);
+ close(dpfd);
+ return (NULL);
+ }
+ devpollop->nevents = nfiles;
+
+ devpollop->changes = mm_calloc(nfiles, sizeof(struct pollfd));
+ if (devpollop->changes == NULL) {
+ mm_free(devpollop->events);
+ mm_free(devpollop);
+ close(dpfd);
+ return (NULL);
+ }
+
+ evsig_init_(base);
+
+ return (devpollop);
+}
+
+static int
+devpoll_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct devpollop *devpollop = base->evbase;
+ struct pollfd *events = devpollop->events;
+ struct dvpoll dvp;
+ int i, res, timeout = -1;
+
+ if (devpollop->nchanges)
+ devpoll_commit(devpollop);
+
+ if (tv != NULL)
+ timeout = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;
+
+ dvp.dp_fds = devpollop->events;
+ dvp.dp_nfds = devpollop->nevents;
+ dvp.dp_timeout = timeout;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = ioctl(devpollop->dpfd, DP_POLL, &dvp);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("ioctl: DP_POLL");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: devpoll_wait reports %d", __func__, res));
+
+ for (i = 0; i < res; i++) {
+ int which = 0;
+ int what = events[i].revents;
+
+ if (what & POLLHUP)
+ what |= POLLIN | POLLOUT;
+ else if (what & POLLERR)
+ what |= POLLIN | POLLOUT;
+
+ if (what & POLLIN)
+ which |= EV_READ;
+ if (what & POLLOUT)
+ which |= EV_WRITE;
+
+ if (!which)
+ continue;
+
+ /* XXX(niels): not sure if this works for devpoll */
+ evmap_io_active_(base, events[i].fd, which);
+ }
+
+ return (0);
+}
+
+
+static int
+devpoll_add(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct devpollop *devpollop = base->evbase;
+ int res;
+ (void)p;
+
+ /*
+ * It's not necessary to OR the existing read/write events that we
+ * are currently interested in with the new event we are adding.
+ * The /dev/poll driver ORs any new events with the existing events
+ * that it has cached for the fd.
+ */
+
+ res = 0;
+ if (events & EV_READ)
+ res |= POLLIN;
+ if (events & EV_WRITE)
+ res |= POLLOUT;
+
+ if (devpoll_queue(devpollop, fd, res) != 0)
+ return (-1);
+
+ return (0);
+}
+
+static int
+devpoll_del(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct devpollop *devpollop = base->evbase;
+ int res;
+ (void)p;
+
+ res = 0;
+ if (events & EV_READ)
+ res |= POLLIN;
+ if (events & EV_WRITE)
+ res |= POLLOUT;
+
+ /*
+ * The only way to remove an fd from the /dev/poll monitored set is
+ * to use POLLREMOVE by itself. This removes ALL events for the fd
+ * provided so if we care about two events and are only removing one
+ * we must re-add the other event after POLLREMOVE.
+ */
+
+ if (devpoll_queue(devpollop, fd, POLLREMOVE) != 0)
+ return (-1);
+
+ if ((res & (POLLIN|POLLOUT)) != (POLLIN|POLLOUT)) {
+ /*
+ * We're not deleting all events, so we must resubmit the
+ * event that we are still interested in if one exists.
+ */
+
+ if ((res & POLLIN) && (old & EV_WRITE)) {
+ /* Deleting read, still care about write */
+ devpoll_queue(devpollop, fd, POLLOUT);
+ } else if ((res & POLLOUT) && (old & EV_READ)) {
+ /* Deleting write, still care about read */
+ devpoll_queue(devpollop, fd, POLLIN);
+ }
+ }
+
+ return (0);
+}
+
+static void
+devpoll_dealloc(struct event_base *base)
+{
+ struct devpollop *devpollop = base->evbase;
+
+ evsig_dealloc_(base);
+ if (devpollop->events)
+ mm_free(devpollop->events);
+ if (devpollop->changes)
+ mm_free(devpollop->changes);
+ if (devpollop->dpfd >= 0)
+ close(devpollop->dpfd);
+
+ memset(devpollop, 0, sizeof(struct devpollop));
+ mm_free(devpollop);
+}
+
+#endif /* EVENT__HAVE_DEVPOLL */
diff --git a/sntp/libevent/epoll.c b/sntp/libevent/epoll.c
new file mode 100644
index 0000000..aa41f84
--- /dev/null
+++ b/sntp/libevent/epoll.c
@@ -0,0 +1,541 @@
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos, Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_EPOLL
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <sys/epoll.h>
+#include <signal.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIMERFD_H
+#include <sys/timerfd.h>
+#endif
+
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "changelist-internal.h"
+#include "time-internal.h"
+
+/* Since Linux 2.6.17, epoll is able to report about peer half-closed connection
+ using special EPOLLRDHUP flag on a read event.
+*/
+#if !defined(EPOLLRDHUP)
+#define EPOLLRDHUP 0
+#define EARLY_CLOSE_IF_HAVE_RDHUP 0
+#else
+#define EARLY_CLOSE_IF_HAVE_RDHUP EV_FEATURE_EARLY_CLOSE
+#endif
+
+#include "epolltable-internal.h"
+
+#if defined(EVENT__HAVE_SYS_TIMERFD_H) && \
+ defined(EVENT__HAVE_TIMERFD_CREATE) && \
+ defined(HAVE_POSIX_MONOTONIC) && defined(TFD_NONBLOCK) && \
+ defined(TFD_CLOEXEC)
+/* Note that we only use timerfd if TFD_NONBLOCK and TFD_CLOEXEC are available
+ and working. This means that we can't support it on 2.6.25 (where timerfd
+ was introduced) or 2.6.26, since 2.6.27 introduced those flags.
+ */
+#define USING_TIMERFD
+#endif
+
+struct epollop {
+ struct epoll_event *events;
+ int nevents;
+ int epfd;
+#ifdef USING_TIMERFD
+ int timerfd;
+#endif
+};
+
+static void *epoll_init(struct event_base *);
+static int epoll_dispatch(struct event_base *, struct timeval *);
+static void epoll_dealloc(struct event_base *);
+
+static const struct eventop epollops_changelist = {
+ "epoll (with changelist)",
+ epoll_init,
+ event_changelist_add_,
+ event_changelist_del_,
+ epoll_dispatch,
+ epoll_dealloc,
+ 1, /* need reinit */
+ EV_FEATURE_ET|EV_FEATURE_O1| EARLY_CLOSE_IF_HAVE_RDHUP,
+ EVENT_CHANGELIST_FDINFO_SIZE
+};
+
+
+static int epoll_nochangelist_add(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p);
+static int epoll_nochangelist_del(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p);
+
+const struct eventop epollops = {
+ "epoll",
+ epoll_init,
+ epoll_nochangelist_add,
+ epoll_nochangelist_del,
+ epoll_dispatch,
+ epoll_dealloc,
+ 1, /* need reinit */
+ EV_FEATURE_ET|EV_FEATURE_O1|EV_FEATURE_EARLY_CLOSE,
+ 0
+};
+
+#define INITIAL_NEVENT 32
+#define MAX_NEVENT 4096
+
+/* On Linux kernels at least up to 2.6.24.4, epoll can't handle timeout
+ * values bigger than (LONG_MAX - 999ULL)/HZ. HZ in the wild can be
+ * as big as 1000, and LONG_MAX can be as small as (1<<31)-1, so the
+ * largest number of msec we can support here is 2147482. Let's
+ * round that down by 47 seconds.
+ */
+#define MAX_EPOLL_TIMEOUT_MSEC (35*60*1000)
+
+static void *
+epoll_init(struct event_base *base)
+{
+ int epfd = -1;
+ struct epollop *epollop;
+
+#ifdef EVENT__HAVE_EPOLL_CREATE1
+ /* First, try the shiny new epoll_create1 interface, if we have it. */
+ epfd = epoll_create1(EPOLL_CLOEXEC);
+#endif
+ if (epfd == -1) {
+ /* Initialize the kernel queue using the old interface. (The
+ size field is ignored since 2.6.8.) */
+ if ((epfd = epoll_create(32000)) == -1) {
+ if (errno != ENOSYS)
+ event_warn("epoll_create");
+ return (NULL);
+ }
+ evutil_make_socket_closeonexec(epfd);
+ }
+
+ if (!(epollop = mm_calloc(1, sizeof(struct epollop)))) {
+ close(epfd);
+ return (NULL);
+ }
+
+ epollop->epfd = epfd;
+
+ /* Initialize fields */
+ epollop->events = mm_calloc(INITIAL_NEVENT, sizeof(struct epoll_event));
+ if (epollop->events == NULL) {
+ mm_free(epollop);
+ close(epfd);
+ return (NULL);
+ }
+ epollop->nevents = INITIAL_NEVENT;
+
+ if ((base->flags & EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST) != 0 ||
+ ((base->flags & EVENT_BASE_FLAG_IGNORE_ENV) == 0 &&
+ evutil_getenv_("EVENT_EPOLL_USE_CHANGELIST") != NULL)) {
+
+ base->evsel = &epollops_changelist;
+ }
+
+#ifdef USING_TIMERFD
+ /*
+ The epoll interface ordinarily gives us one-millisecond precision,
+ so on Linux it makes perfect sense to use the CLOCK_MONOTONIC_COARSE
+ timer. But when the user has set the new PRECISE_TIMER flag for an
+ event_base, we can try to use timerfd to give them finer granularity.
+ */
+ if ((base->flags & EVENT_BASE_FLAG_PRECISE_TIMER) &&
+ base->monotonic_timer.monotonic_clock == CLOCK_MONOTONIC) {
+ int fd;
+ fd = epollop->timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK|TFD_CLOEXEC);
+ if (epollop->timerfd >= 0) {
+ struct epoll_event epev;
+ memset(&epev, 0, sizeof(epev));
+ epev.data.fd = epollop->timerfd;
+ epev.events = EPOLLIN;
+ if (epoll_ctl(epollop->epfd, EPOLL_CTL_ADD, fd, &epev) < 0) {
+ event_warn("epoll_ctl(timerfd)");
+ close(fd);
+ epollop->timerfd = -1;
+ }
+ } else {
+ if (errno != EINVAL && errno != ENOSYS) {
+ /* These errors probably mean that we were
+ * compiled with timerfd/TFD_* support, but
+ * we're running on a kernel that lacks those.
+ */
+ event_warn("timerfd_create");
+ }
+ epollop->timerfd = -1;
+ }
+ } else {
+ epollop->timerfd = -1;
+ }
+#endif
+
+ evsig_init_(base);
+
+ return (epollop);
+}
+
+static const char *
+change_to_string(int change)
+{
+ change &= (EV_CHANGE_ADD|EV_CHANGE_DEL);
+ if (change == EV_CHANGE_ADD) {
+ return "add";
+ } else if (change == EV_CHANGE_DEL) {
+ return "del";
+ } else if (change == 0) {
+ return "none";
+ } else {
+ return "???";
+ }
+}
+
+static const char *
+epoll_op_to_string(int op)
+{
+ return op == EPOLL_CTL_ADD?"ADD":
+ op == EPOLL_CTL_DEL?"DEL":
+ op == EPOLL_CTL_MOD?"MOD":
+ "???";
+}
+
+static int
+epoll_apply_one_change(struct event_base *base,
+ struct epollop *epollop,
+ const struct event_change *ch)
+{
+ struct epoll_event epev;
+ int op, events = 0;
+ int idx;
+
+ idx = EPOLL_OP_TABLE_INDEX(ch);
+ op = epoll_op_table[idx].op;
+ events = epoll_op_table[idx].events;
+
+ if (!events) {
+ EVUTIL_ASSERT(op == 0);
+ return 0;
+ }
+
+ if ((ch->read_change|ch->write_change) & EV_CHANGE_ET)
+ events |= EPOLLET;
+
+ memset(&epev, 0, sizeof(epev));
+ epev.data.fd = ch->fd;
+ epev.events = events;
+ if (epoll_ctl(epollop->epfd, op, ch->fd, &epev) == 0) {
+ event_debug(("Epoll %s(%d) on fd %d okay. [old events were %d; read change was %d; write change was %d; close change was %d]",
+ epoll_op_to_string(op),
+ (int)epev.events,
+ (int)ch->fd,
+ ch->old_events,
+ ch->read_change,
+ ch->write_change,
+ ch->close_change));
+ return 0;
+ }
+
+ switch (op) {
+ case EPOLL_CTL_MOD:
+ if (errno == ENOENT) {
+ /* If a MOD operation fails with ENOENT, the
+ * fd was probably closed and re-opened. We
+ * should retry the operation as an ADD.
+ */
+ if (epoll_ctl(epollop->epfd, EPOLL_CTL_ADD, ch->fd, &epev) == -1) {
+ event_warn("Epoll MOD(%d) on %d retried as ADD; that failed too",
+ (int)epev.events, ch->fd);
+ return -1;
+ } else {
+ event_debug(("Epoll MOD(%d) on %d retried as ADD; succeeded.",
+ (int)epev.events,
+ ch->fd));
+ return 0;
+ }
+ }
+ break;
+ case EPOLL_CTL_ADD:
+ if (errno == EEXIST) {
+ /* If an ADD operation fails with EEXIST,
+ * either the operation was redundant (as with a
+ * precautionary add), or we ran into a fun
+ * kernel bug where using dup*() to duplicate the
+ * same file into the same fd gives you the same epitem
+ * rather than a fresh one. For the second case,
+ * we must retry with MOD. */
+ if (epoll_ctl(epollop->epfd, EPOLL_CTL_MOD, ch->fd, &epev) == -1) {
+ event_warn("Epoll ADD(%d) on %d retried as MOD; that failed too",
+ (int)epev.events, ch->fd);
+ return -1;
+ } else {
+ event_debug(("Epoll ADD(%d) on %d retried as MOD; succeeded.",
+ (int)epev.events,
+ ch->fd));
+ return 0;
+ }
+ }
+ break;
+ case EPOLL_CTL_DEL:
+ if (errno == ENOENT || errno == EBADF || errno == EPERM) {
+ /* If a delete fails with one of these errors,
+ * that's fine too: we closed the fd before we
+ * got around to calling epoll_dispatch. */
+ event_debug(("Epoll DEL(%d) on fd %d gave %s: DEL was unnecessary.",
+ (int)epev.events,
+ ch->fd,
+ strerror(errno)));
+ return 0;
+ }
+ break;
+ default:
+ break;
+ }
+
+ event_warn("Epoll %s(%d) on fd %d failed. Old events were %d; read change was %d (%s); write change was %d (%s); close change was %d (%s)",
+ epoll_op_to_string(op),
+ (int)epev.events,
+ ch->fd,
+ ch->old_events,
+ ch->read_change,
+ change_to_string(ch->read_change),
+ ch->write_change,
+ change_to_string(ch->write_change),
+ ch->close_change,
+ change_to_string(ch->close_change));
+
+ return -1;
+}
+
+static int
+epoll_apply_changes(struct event_base *base)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct epollop *epollop = base->evbase;
+ struct event_change *ch;
+
+ int r = 0;
+ int i;
+
+ for (i = 0; i < changelist->n_changes; ++i) {
+ ch = &changelist->changes[i];
+ if (epoll_apply_one_change(base, epollop, ch) < 0)
+ r = -1;
+ }
+
+ return (r);
+}
+
+static int
+epoll_nochangelist_add(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p)
+{
+ struct event_change ch;
+ ch.fd = fd;
+ ch.old_events = old;
+ ch.read_change = ch.write_change = ch.close_change = 0;
+ if (events & EV_WRITE)
+ ch.write_change = EV_CHANGE_ADD |
+ (events & EV_ET);
+ if (events & EV_READ)
+ ch.read_change = EV_CHANGE_ADD |
+ (events & EV_ET);
+ if (events & EV_CLOSED)
+ ch.close_change = EV_CHANGE_ADD |
+ (events & EV_ET);
+
+ return epoll_apply_one_change(base, base->evbase, &ch);
+}
+
+static int
+epoll_nochangelist_del(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *p)
+{
+ struct event_change ch;
+ ch.fd = fd;
+ ch.old_events = old;
+ ch.read_change = ch.write_change = ch.close_change = 0;
+ if (events & EV_WRITE)
+ ch.write_change = EV_CHANGE_DEL;
+ if (events & EV_READ)
+ ch.read_change = EV_CHANGE_DEL;
+ if (events & EV_CLOSED)
+ ch.close_change = EV_CHANGE_DEL;
+
+ return epoll_apply_one_change(base, base->evbase, &ch);
+}
+
+static int
+epoll_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct epollop *epollop = base->evbase;
+ struct epoll_event *events = epollop->events;
+ int i, res;
+ long timeout = -1;
+
+#ifdef USING_TIMERFD
+ if (epollop->timerfd >= 0) {
+ struct itimerspec is;
+ is.it_interval.tv_sec = 0;
+ is.it_interval.tv_nsec = 0;
+ if (tv == NULL) {
+ /* No timeout; disarm the timer. */
+ is.it_value.tv_sec = 0;
+ is.it_value.tv_nsec = 0;
+ } else {
+ if (tv->tv_sec == 0 && tv->tv_usec == 0) {
+ /* we need to exit immediately; timerfd can't
+ * do that. */
+ timeout = 0;
+ }
+ is.it_value.tv_sec = tv->tv_sec;
+ is.it_value.tv_nsec = tv->tv_usec * 1000;
+ }
+ /* TODO: we could avoid unnecessary syscalls here by only
+ calling timerfd_settime when the top timeout changes, or
+ when we're called with a different timeval.
+ */
+ if (timerfd_settime(epollop->timerfd, 0, &is, NULL) < 0) {
+ event_warn("timerfd_settime");
+ }
+ } else
+#endif
+ if (tv != NULL) {
+ timeout = evutil_tv_to_msec_(tv);
+ if (timeout < 0 || timeout > MAX_EPOLL_TIMEOUT_MSEC) {
+ /* Linux kernels can wait forever if the timeout is
+ * too big; see comment on MAX_EPOLL_TIMEOUT_MSEC. */
+ timeout = MAX_EPOLL_TIMEOUT_MSEC;
+ }
+ }
+
+ epoll_apply_changes(base);
+ event_changelist_remove_all_(&base->changelist, base);
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("epoll_wait");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: epoll_wait reports %d", __func__, res));
+ EVUTIL_ASSERT(res <= epollop->nevents);
+
+ for (i = 0; i < res; i++) {
+ int what = events[i].events;
+ short ev = 0;
+#ifdef USING_TIMERFD
+ if (events[i].data.fd == epollop->timerfd)
+ continue;
+#endif
+
+ if (what & (EPOLLHUP|EPOLLERR)) {
+ ev = EV_READ | EV_WRITE;
+ } else {
+ if (what & EPOLLIN)
+ ev |= EV_READ;
+ if (what & EPOLLOUT)
+ ev |= EV_WRITE;
+ if (what & EPOLLRDHUP)
+ ev |= EV_CLOSED;
+ }
+
+ if (!ev)
+ continue;
+
+ evmap_io_active_(base, events[i].data.fd, ev | EV_ET);
+ }
+
+ if (res == epollop->nevents && epollop->nevents < MAX_NEVENT) {
+ /* We used all of the event space this time. We should
+ be ready for more events next time. */
+ int new_nevents = epollop->nevents * 2;
+ struct epoll_event *new_events;
+
+ new_events = mm_realloc(epollop->events,
+ new_nevents * sizeof(struct epoll_event));
+ if (new_events) {
+ epollop->events = new_events;
+ epollop->nevents = new_nevents;
+ }
+ }
+
+ return (0);
+}
+
+
+static void
+epoll_dealloc(struct event_base *base)
+{
+ struct epollop *epollop = base->evbase;
+
+ evsig_dealloc_(base);
+ if (epollop->events)
+ mm_free(epollop->events);
+ if (epollop->epfd >= 0)
+ close(epollop->epfd);
+#ifdef USING_TIMERFD
+ if (epollop->timerfd >= 0)
+ close(epollop->timerfd);
+#endif
+
+ memset(epollop, 0, sizeof(struct epollop));
+ mm_free(epollop);
+}
+
+#endif /* EVENT__HAVE_EPOLL */
diff --git a/sntp/libevent/epoll_sub.c b/sntp/libevent/epoll_sub.c
new file mode 100644
index 0000000..3f01f6a
--- /dev/null
+++ b/sntp/libevent/epoll_sub.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2003-2009 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "evconfig-private.h"
+#include <stdint.h>
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <sys/epoll.h>
+#include <unistd.h>
+#include <errno.h>
+
+int
+epoll_create(int size)
+{
+#if !defined(__NR_epoll_create) && defined(__NR_epoll_create1)
+ if (size <= 0) {
+ errno = EINVAL;
+ return -1;
+ }
+ return (syscall(__NR_epoll_create1, 0));
+#else
+ return (syscall(__NR_epoll_create, size));
+#endif
+}
+
+int
+epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
+{
+
+ return (syscall(__NR_epoll_ctl, epfd, op, fd, event));
+}
+
+int
+epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
+{
+#if !defined(__NR_epoll_wait) && defined(__NR_epoll_pwait)
+ return (syscall(__NR_epoll_pwait, epfd, events, maxevents, timeout, NULL, 0));
+#else
+ return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
+#endif
+}
diff --git a/sntp/libevent/epolltable-internal.h b/sntp/libevent/epolltable-internal.h
new file mode 100644
index 0000000..da30e09
--- /dev/null
+++ b/sntp/libevent/epolltable-internal.h
@@ -0,0 +1,1166 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EPOLLTABLE_INTERNAL_H_INCLUDED_
+#define EPOLLTABLE_INTERNAL_H_INCLUDED_
+
+/*
+ Here are the values we're masking off to decide what operations to do.
+ Note that since EV_READ|EV_WRITE.
+
+ Note also that this table is a little sparse, since ADD+DEL is
+ nonsensical ("xxx" in the list below.)
+
+ Note also also that we are shifting old_events by only 5 bits, since
+ EV_READ is 2 and EV_WRITE is 4.
+
+ The table was auto-generated with a python script, according to this
+ pseudocode:[*0]
+
+ If either the read or the write change is add+del:
+ This is impossible; Set op==-1, events=0.
+ Else, if either the read or the write change is add:
+ Set events to 0.
+ If the read change is add, or
+ (the read change is not del, and ev_read is in old_events):
+ Add EPOLLIN to events.
+ If the write change is add, or
+ (the write change is not del, and ev_write is in old_events):
+ Add EPOLLOUT to events.
+
+ If old_events is set:
+ Set op to EPOLL_CTL_MOD [*1,*2]
+ Else:
+ Set op to EPOLL_CTL_ADD [*3]
+
+ Else, if the read or the write change is del:
+ Set op to EPOLL_CTL_DEL.
+ If the read change is del:
+ If the write change is del:
+ Set events to EPOLLIN|EPOLLOUT
+ Else if ev_write is in old_events:
+ Set events to EPOLLOUT
+ Set op to EPOLL_CTL_MOD
+ Else
+ Set events to EPOLLIN
+ Else:
+ {The write change is del.}
+ If ev_read is in old_events:
+ Set events to EPOLLIN
+ Set op to EPOLL_CTL_MOD
+ Else:
+ Set the events to EPOLLOUT
+
+ Else:
+ There is no read or write change; set op to 0 and events to 0.
+
+ The logic is a little tricky, since we had no events set on the fd before,
+ we need to set op="ADD" and set events=the events we want to add. If we
+ had any events set on the fd before, and we want any events to remain on
+ the fd, we need to say op="MOD" and set events=the events we want to
+ remain. But if we want to delete the last event, we say op="DEL" and
+ set events=(any non-null pointer).
+
+ [*0] Actually, the Python script has gotten a bit more complicated, to
+ support EPOLLRDHUP.
+
+ [*1] This MOD is only a guess. MOD might fail with ENOENT if the file was
+ closed and a new file was opened with the same fd. If so, we'll retry
+ with ADD.
+
+ [*2] We can't replace this with a no-op even if old_events is the same as
+ the new events: if the file was closed and reopened, we need to retry
+ with an ADD. (We do a MOD in this case since "no change" is more
+ common than "close and reopen", so we'll usually wind up doing 1
+ syscalls instead of 2.)
+
+ [*3] This ADD is only a guess. There is a fun Linux kernel issue where if
+ you have two fds for the same file (via dup) and you ADD one to an
+ epfd, then close it, then re-create it with the same fd (via dup2 or an
+ unlucky dup), then try to ADD it again, you'll get an EEXIST, since the
+ struct epitem is not actually removed from the struct eventpoll until
+ the file itself is closed.
+
+ EV_CHANGE_ADD==1
+ EV_CHANGE_DEL==2
+ EV_READ ==2
+ EV_WRITE ==4
+ EV_CLOSED ==0x80
+
+ Bit 0: close change is add
+ Bit 1: close change is del
+ Bit 2: read change is add
+ Bit 3: read change is del
+ Bit 4: write change is add
+ Bit 5: write change is del
+ Bit 6: old events had EV_READ
+ Bit 7: old events had EV_WRITE
+ Bit 8: old events had EV_CLOSED
+*/
+
+#define EPOLL_OP_TABLE_INDEX(c) \
+ ( (((c)->close_change&(EV_CHANGE_ADD|EV_CHANGE_DEL))) | \
+ (((c)->read_change&(EV_CHANGE_ADD|EV_CHANGE_DEL)) << 2) | \
+ (((c)->write_change&(EV_CHANGE_ADD|EV_CHANGE_DEL)) << 4) | \
+ (((c)->old_events&(EV_READ|EV_WRITE)) << 5) | \
+ (((c)->old_events&(EV_CLOSED)) << 1) \
+ )
+
+#if EV_READ != 2 || EV_WRITE != 4 || EV_CLOSED != 0x80 || EV_CHANGE_ADD != 1 || EV_CHANGE_DEL != 2
+#error "Libevent's internals changed! Regenerate the op_table in epolltable-internal.h"
+#endif
+
+static const struct operation {
+ int events;
+ int op;
+} epoll_op_table[] = {
+ /* old= 0, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= 0, write: 0, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read: 0, close:del */
+ { EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write: 0, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write: 0, read:del, close: 0 */
+ { EPOLLIN, EPOLL_CTL_DEL },
+ /* old= 0, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_ADD },
+ /* old= 0, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_ADD },
+ /* old= 0, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= 0, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= 0, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= r, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read:del, close: 0 */
+ { EPOLLIN, EPOLL_CTL_DEL },
+ /* old= r, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= r, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= r, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read: 0, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= r, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= r, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= r, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= r, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= w, write: 0, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= w, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read: 0, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= w, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= w, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= w, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= w, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= w, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= w, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= rw, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read:del, close: 0 */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= rw, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read: 0, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read:add, close: 0 */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read:del, close: 0 */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_DEL },
+ /* old= rw, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= rw, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= rw, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= rw, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= c, write: 0, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read: 0, close:del */
+ { EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read: 0, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= c, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= c, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read: 0, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= c, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= c, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= c, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= cr, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write: 0, read:del, close:del */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cr, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cr, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read: 0, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cr, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cr, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cr, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old= cw, write: 0, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read: 0, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read: 0, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read: 0, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old= cw, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read: 0, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read: 0, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read: 0, close:del */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cw, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old= cw, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old= cw, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old= cw, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read: 0, close: 0 */
+ { 0, 0 },
+ /* old=crw, write: 0, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write: 0, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write: 0, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read: 0, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read: 0, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read: 0, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read:add, close: 0 */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:add, close:add */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:add, close:del */
+ { EPOLLIN|EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read:del, close: 0 */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:del, close:add */
+ { EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:del, close:del */
+ { EPOLLOUT, EPOLL_CTL_MOD },
+ /* old=crw, write:add, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write:add, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read: 0, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read: 0, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read: 0, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read:add, close: 0 */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:add, close:add */
+ { EPOLLIN|EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:add, close:del */
+ { EPOLLIN, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read:del, close: 0 */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:del, close:add */
+ { EPOLLRDHUP, EPOLL_CTL_MOD },
+ /* old=crw, write:del, read:del, close:del */
+ { EPOLLIN|EPOLLOUT|EPOLLRDHUP, EPOLL_CTL_DEL },
+ /* old=crw, write:del, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write:del, read:xxx, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read: 0, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:add, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:del, close:xxx */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close: 0 */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close:add */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close:del */
+ { 0, 255 },
+ /* old=crw, write:xxx, read:xxx, close:xxx */
+ { 0, 255 },
+};
+
+#endif
diff --git a/sntp/libevent/evbuffer-internal.h b/sntp/libevent/evbuffer-internal.h
new file mode 100644
index 0000000..fb67ec0
--- /dev/null
+++ b/sntp/libevent/evbuffer-internal.h
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVBUFFER_INTERNAL_H_INCLUDED_
+#define EVBUFFER_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+#include "event2/util.h"
+#include "event2/event_struct.h"
+#include "util-internal.h"
+#include "defer-internal.h"
+
+/* Experimental cb flag: "never deferred." Implementation note:
+ * these callbacks may get an inaccurate view of n_del/n_added in their
+ * arguments. */
+#define EVBUFFER_CB_NODEFER 2
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+#include <sys/queue.h>
+
+/* Minimum allocation for a chain. We define this so that we're burning no
+ * more than 5% of each allocation on overhead. It would be nice to lose even
+ * less space, though. */
+#if EVENT__SIZEOF_VOID_P < 8
+#define MIN_BUFFER_SIZE 512
+#else
+#define MIN_BUFFER_SIZE 1024
+#endif
+
+/** A single evbuffer callback for an evbuffer. This function will be invoked
+ * when bytes are added to or removed from the evbuffer. */
+struct evbuffer_cb_entry {
+ /** Structures to implement a doubly-linked queue of callbacks */
+ LIST_ENTRY(evbuffer_cb_entry) next;
+ /** The callback function to invoke when this callback is called.
+ If EVBUFFER_CB_OBSOLETE is set in flags, the cb_obsolete field is
+ valid; otherwise, cb_func is valid. */
+ union {
+ evbuffer_cb_func cb_func;
+ evbuffer_cb cb_obsolete;
+ } cb;
+ /** Argument to pass to cb. */
+ void *cbarg;
+ /** Currently set flags on this callback. */
+ ev_uint32_t flags;
+};
+
+struct bufferevent;
+struct evbuffer_chain;
+struct evbuffer {
+ /** The first chain in this buffer's linked list of chains. */
+ struct evbuffer_chain *first;
+ /** The last chain in this buffer's linked list of chains. */
+ struct evbuffer_chain *last;
+
+ /** Pointer to the next pointer pointing at the 'last_with_data' chain.
+ *
+ * To unpack:
+ *
+ * The last_with_data chain is the last chain that has any data in it.
+ * If all chains in the buffer are empty, it is the first chain.
+ * If the buffer has no chains, it is NULL.
+ *
+ * The last_with_datap pointer points at _whatever 'next' pointer_
+ * points at the last_with_datap chain. If the last_with_data chain
+ * is the first chain, or it is NULL, then the last_with_datap pointer
+ * is &buf->first.
+ */
+ struct evbuffer_chain **last_with_datap;
+
+ /** Total amount of bytes stored in all chains.*/
+ size_t total_len;
+
+ /** Number of bytes we have added to the buffer since we last tried to
+ * invoke callbacks. */
+ size_t n_add_for_cb;
+ /** Number of bytes we have removed from the buffer since we last
+ * tried to invoke callbacks. */
+ size_t n_del_for_cb;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ /** A lock used to mediate access to this buffer. */
+ void *lock;
+#endif
+ /** True iff we should free the lock field when we free this
+ * evbuffer. */
+ unsigned own_lock : 1;
+ /** True iff we should not allow changes to the front of the buffer
+ * (drains or prepends). */
+ unsigned freeze_start : 1;
+ /** True iff we should not allow changes to the end of the buffer
+ * (appends) */
+ unsigned freeze_end : 1;
+ /** True iff this evbuffer's callbacks are not invoked immediately
+ * upon a change in the buffer, but instead are deferred to be invoked
+ * from the event_base's loop. Useful for preventing enormous stack
+ * overflows when we have mutually recursive callbacks, and for
+ * serializing callbacks in a single thread. */
+ unsigned deferred_cbs : 1;
+#ifdef _WIN32
+ /** True iff this buffer is set up for overlapped IO. */
+ unsigned is_overlapped : 1;
+#endif
+ /** Zero or more EVBUFFER_FLAG_* bits */
+ ev_uint32_t flags;
+
+ /** Used to implement deferred callbacks. */
+ struct event_base *cb_queue;
+
+ /** A reference count on this evbuffer. When the reference count
+ * reaches 0, the buffer is destroyed. Manipulated with
+ * evbuffer_incref and evbuffer_decref_and_unlock and
+ * evbuffer_free. */
+ int refcnt;
+
+ /** A struct event_callback handle to make all of this buffer's callbacks
+ * invoked from the event loop. */
+ struct event_callback deferred;
+
+ /** A doubly-linked-list of callback functions */
+ LIST_HEAD(evbuffer_cb_queue, evbuffer_cb_entry) callbacks;
+
+ /** The parent bufferevent object this evbuffer belongs to.
+ * NULL if the evbuffer stands alone. */
+ struct bufferevent *parent;
+};
+
+/** A single item in an evbuffer. */
+struct evbuffer_chain {
+ /** points to next buffer in the chain */
+ struct evbuffer_chain *next;
+
+ /** total allocation available in the buffer field. */
+ size_t buffer_len;
+
+ /** unused space at the beginning of buffer or an offset into a
+ * file for sendfile buffers. */
+ ev_off_t misalign;
+
+ /** Offset into buffer + misalign at which to start writing.
+ * In other words, the total number of bytes actually stored
+ * in buffer. */
+ size_t off;
+
+ /** Set if special handling is required for this chain */
+ unsigned flags;
+#define EVBUFFER_FILESEGMENT 0x0001 /**< A chain used for a file segment */
+#define EVBUFFER_SENDFILE 0x0002 /**< a chain used with sendfile */
+#define EVBUFFER_REFERENCE 0x0004 /**< a chain with a mem reference */
+#define EVBUFFER_IMMUTABLE 0x0008 /**< read-only chain */
+ /** a chain that mustn't be reallocated or freed, or have its contents
+ * memmoved, until the chain is un-pinned. */
+#define EVBUFFER_MEM_PINNED_R 0x0010
+#define EVBUFFER_MEM_PINNED_W 0x0020
+#define EVBUFFER_MEM_PINNED_ANY (EVBUFFER_MEM_PINNED_R|EVBUFFER_MEM_PINNED_W)
+ /** a chain that should be freed, but can't be freed until it is
+ * un-pinned. */
+#define EVBUFFER_DANGLING 0x0040
+ /** a chain that is a referenced copy of another chain */
+#define EVBUFFER_MULTICAST 0x0080
+
+ /** number of references to this chain */
+ int refcnt;
+
+ /** Usually points to the read-write memory belonging to this
+ * buffer allocated as part of the evbuffer_chain allocation.
+ * For mmap, this can be a read-only buffer and
+ * EVBUFFER_IMMUTABLE will be set in flags. For sendfile, it
+ * may point to NULL.
+ */
+ unsigned char *buffer;
+};
+
+/** callback for a reference chain; lets us know what to do with it when
+ * we're done with it. Lives at the end of an evbuffer_chain with the
+ * EVBUFFER_REFERENCE flag set */
+struct evbuffer_chain_reference {
+ evbuffer_ref_cleanup_cb cleanupfn;
+ void *extra;
+};
+
+/** File segment for a file-segment chain. Lives at the end of an
+ * evbuffer_chain with the EVBUFFER_FILESEGMENT flag set. */
+struct evbuffer_chain_file_segment {
+ struct evbuffer_file_segment *segment;
+#ifdef _WIN32
+ /** If we're using CreateFileMapping, this is the handle to the view. */
+ HANDLE view_handle;
+#endif
+};
+
+/* Declared in event2/buffer.h; defined here. */
+struct evbuffer_file_segment {
+ void *lock; /**< lock prevent concurrent access to refcnt */
+ int refcnt; /**< Reference count for this file segment */
+ unsigned flags; /**< combination of EVBUF_FS_* flags */
+
+ /** What kind of file segment is this? */
+ unsigned can_sendfile : 1;
+ unsigned is_mapping : 1;
+
+ /** The fd that we read the data from. */
+ int fd;
+ /** If we're using mmap, this is the raw mapped memory. */
+ void *mapping;
+#ifdef _WIN32
+ /** If we're using CreateFileMapping, this is the mapping */
+ HANDLE mapping_handle;
+#endif
+ /** If we're using mmap or IO, this is the content of the file
+ * segment. */
+ char *contents;
+ /** Position of this segment within the file. */
+ ev_off_t file_offset;
+ /** If we're using mmap, this is the offset within 'mapping' where
+ * this data segment begins. */
+ ev_off_t mmap_offset;
+ /** The length of this segment. */
+ ev_off_t length;
+ /** Cleanup callback function */
+ evbuffer_file_segment_cleanup_cb cleanup_cb;
+ /** Argument to be pass to cleanup callback function */
+ void *cleanup_cb_arg;
+};
+
+/** Information about the multicast parent of a chain. Lives at the
+ * end of an evbuffer_chain with the EVBUFFER_MULTICAST flag set. */
+struct evbuffer_multicast_parent {
+ /** source buffer the multicast parent belongs to */
+ struct evbuffer *source;
+ /** multicast parent for this chain */
+ struct evbuffer_chain *parent;
+};
+
+#define EVBUFFER_CHAIN_SIZE sizeof(struct evbuffer_chain)
+/** Return a pointer to extra data allocated along with an evbuffer. */
+#define EVBUFFER_CHAIN_EXTRA(t, c) (t *)((struct evbuffer_chain *)(c) + 1)
+
+/** Assert that we are holding the lock on an evbuffer */
+#define ASSERT_EVBUFFER_LOCKED(buffer) \
+ EVLOCK_ASSERT_LOCKED((buffer)->lock)
+
+#define EVBUFFER_LOCK(buffer) \
+ do { \
+ EVLOCK_LOCK((buffer)->lock, 0); \
+ } while (0)
+#define EVBUFFER_UNLOCK(buffer) \
+ do { \
+ EVLOCK_UNLOCK((buffer)->lock, 0); \
+ } while (0)
+#define EVBUFFER_LOCK2(buffer1, buffer2) \
+ do { \
+ EVLOCK_LOCK2((buffer1)->lock, (buffer2)->lock, 0, 0); \
+ } while (0)
+#define EVBUFFER_UNLOCK2(buffer1, buffer2) \
+ do { \
+ EVLOCK_UNLOCK2((buffer1)->lock, (buffer2)->lock, 0, 0); \
+ } while (0)
+
+/** Increase the reference count of buf by one. */
+void evbuffer_incref_(struct evbuffer *buf);
+/** Increase the reference count of buf by one and acquire the lock. */
+void evbuffer_incref_and_lock_(struct evbuffer *buf);
+/** Pin a single buffer chain using a given flag. A pinned chunk may not be
+ * moved or freed until it is unpinned. */
+void evbuffer_chain_pin_(struct evbuffer_chain *chain, unsigned flag);
+/** Unpin a single buffer chain using a given flag. */
+void evbuffer_chain_unpin_(struct evbuffer_chain *chain, unsigned flag);
+/** As evbuffer_free, but requires that we hold a lock on the buffer, and
+ * releases the lock before freeing it and the buffer. */
+void evbuffer_decref_and_unlock_(struct evbuffer *buffer);
+
+/** As evbuffer_expand, but does not guarantee that the newly allocated memory
+ * is contiguous. Instead, it may be split across two or more chunks. */
+int evbuffer_expand_fast_(struct evbuffer *, size_t, int);
+
+/** Helper: prepares for a readv/WSARecv call by expanding the buffer to
+ * hold enough memory to read 'howmuch' bytes in possibly noncontiguous memory.
+ * Sets up the one or two iovecs in 'vecs' to point to the free memory and its
+ * extent, and *chainp to point to the first chain that we'll try to read into.
+ * Returns the number of vecs used.
+ */
+int evbuffer_read_setup_vecs_(struct evbuffer *buf, ev_ssize_t howmuch,
+ struct evbuffer_iovec *vecs, int n_vecs, struct evbuffer_chain ***chainp,
+ int exact);
+
+/* Helper macro: copies an evbuffer_iovec in ei to a win32 WSABUF in i. */
+#define WSABUF_FROM_EVBUFFER_IOV(i,ei) do { \
+ (i)->buf = (ei)->iov_base; \
+ (i)->len = (unsigned long)(ei)->iov_len; \
+ } while (0)
+/* XXXX the cast above is safe for now, but not if we allow mmaps on win64.
+ * See note in buffer_iocp's launch_write function */
+
+/** Set the parent bufferevent object for buf to bev */
+void evbuffer_set_parent_(struct evbuffer *buf, struct bufferevent *bev);
+
+void evbuffer_invoke_callbacks_(struct evbuffer *buf);
+
+
+int evbuffer_get_callbacks_(struct evbuffer *buffer,
+ struct event_callback **cbs,
+ int max_cbs);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVBUFFER_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/evconfig-private.h b/sntp/libevent/evconfig-private.h
new file mode 100644
index 0000000..ea4940d
--- /dev/null
+++ b/sntp/libevent/evconfig-private.h
@@ -0,0 +1,49 @@
+/* evconfig-private.h. Generated from evconfig-private.h.in by configure. */
+/* evconfig-private.h template - see "Configuration Header Templates" */
+/* in AC manual. Kevin Bowling <kevin.bowling@kev009.com */
+#ifndef EVCONFIG_PRIVATE_H_INCLUDED_
+#define EVCONFIG_PRIVATE_H_INCLUDED_
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#define _FILE_OFFSET_BITS 64
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+#ifndef _MINIX
+/* #undef _MINIX */
+#endif
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#ifndef _POSIX_1_SOURCE
+/* #undef _POSIX_1_SOURCE */
+#endif
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#ifndef _POSIX_SOURCE
+/* #undef _POSIX_SOURCE */
+#endif
+
+#endif
diff --git a/sntp/libevent/evconfig-private.h.in b/sntp/libevent/evconfig-private.h.in
new file mode 100644
index 0000000..7b3dfdb
--- /dev/null
+++ b/sntp/libevent/evconfig-private.h.in
@@ -0,0 +1,48 @@
+/* evconfig-private.h template - see "Configuration Header Templates" */
+/* in AC manual. Kevin Bowling <kevin.bowling@kev009.com */
+#ifndef EVCONFIG_PRIVATE_H_INCLUDED_
+#define EVCONFIG_PRIVATE_H_INCLUDED_
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#ifndef _MINIX
+#undef _MINIX
+#endif
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#ifndef _POSIX_1_SOURCE
+#undef _POSIX_1_SOURCE
+#endif
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#ifndef _POSIX_SOURCE
+#undef _POSIX_SOURCE
+#endif
+
+#endif
diff --git a/sntp/libevent/evdns.c b/sntp/libevent/evdns.c
new file mode 100644
index 0000000..59c3abe
--- /dev/null
+++ b/sntp/libevent/evdns.c
@@ -0,0 +1,4709 @@
+/* Copyright 2006-2007 Niels Provos
+ * Copyright 2007-2012 Nick Mathewson and Niels Provos
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Based on software by Adam Langly. Adam's original message:
+ *
+ * Async DNS Library
+ * Adam Langley <agl@imperialviolet.org>
+ * http://www.imperialviolet.org/eventdns.html
+ * Public Domain code
+ *
+ * This software is Public Domain. To view a copy of the public domain dedication,
+ * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
+ * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+ *
+ * I ask and expect, but do not require, that all derivative works contain an
+ * attribution similar to:
+ * Parts developed by Adam Langley <agl@imperialviolet.org>
+ *
+ * You may wish to replace the word "Parts" with something else depending on
+ * the amount of original code.
+ *
+ * (Derivative works does not include programs which link against, run or include
+ * the source verbatim in their source distributions)
+ *
+ * Version: 0.1b
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifndef _FORTIFY_SOURCE
+#define _FORTIFY_SOURCE 3
+#endif
+
+#include <string.h>
+#include <fcntl.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <limits.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdarg.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#ifndef _WIN32_IE
+#define _WIN32_IE 0x400
+#endif
+#include <shlobj.h>
+#endif
+
+#include "event2/dns.h"
+#include "event2/dns_struct.h"
+#include "event2/dns_compat.h"
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/thread.h"
+
+#include "defer-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "strlcpy-internal.h"
+#include "ipv6-internal.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+#ifdef _WIN32
+#include <ctype.h>
+#include <winsock2.h>
+#include <windows.h>
+#include <iphlpapi.h>
+#include <io.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#endif
+
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+
+#define EVDNS_LOG_DEBUG EVENT_LOG_DEBUG
+#define EVDNS_LOG_WARN EVENT_LOG_WARN
+#define EVDNS_LOG_MSG EVENT_LOG_MSG
+
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255
+#endif
+
+#include <stdio.h>
+
+#undef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+
+#define ASSERT_VALID_REQUEST(req) \
+ EVUTIL_ASSERT((req)->handle && (req)->handle->current_req == (req))
+
+#define u64 ev_uint64_t
+#define u32 ev_uint32_t
+#define u16 ev_uint16_t
+#define u8 ev_uint8_t
+
+/* maximum number of addresses from a single packet */
+/* that we bother recording */
+#define MAX_V4_ADDRS 32
+#define MAX_V6_ADDRS 32
+
+
+#define TYPE_A EVDNS_TYPE_A
+#define TYPE_CNAME 5
+#define TYPE_PTR EVDNS_TYPE_PTR
+#define TYPE_SOA EVDNS_TYPE_SOA
+#define TYPE_AAAA EVDNS_TYPE_AAAA
+
+#define CLASS_INET EVDNS_CLASS_INET
+
+/* Persistent handle. We keep this separate from 'struct request' since we
+ * need some object to last for as long as an evdns_request is outstanding so
+ * that it can be canceled, whereas a search request can lead to multiple
+ * 'struct request' instances being created over its lifetime. */
+struct evdns_request {
+ struct request *current_req;
+ struct evdns_base *base;
+
+ int pending_cb; /* Waiting for its callback to be invoked; not
+ * owned by event base any more. */
+
+ /* elements used by the searching code */
+ int search_index;
+ struct search_state *search_state;
+ char *search_origname; /* needs to be free()ed */
+ int search_flags;
+};
+
+struct request {
+ u8 *request; /* the dns packet data */
+ u8 request_type; /* TYPE_PTR or TYPE_A or TYPE_AAAA */
+ unsigned int request_len;
+ int reissue_count;
+ int tx_count; /* the number of times that this packet has been sent */
+ void *user_pointer; /* the pointer given to us for this request */
+ evdns_callback_type user_callback;
+ struct nameserver *ns; /* the server which we last sent it */
+
+ /* these objects are kept in a circular list */
+ /* XXX We could turn this into a CIRCLEQ. */
+ struct request *next, *prev;
+
+ struct event timeout_event;
+
+ u16 trans_id; /* the transaction id */
+ unsigned request_appended :1; /* true if the request pointer is data which follows this struct */
+ unsigned transmit_me :1; /* needs to be transmitted */
+
+ /* XXXX This is a horrible hack. */
+ char **put_cname_in_ptr; /* store the cname here if we get one. */
+
+ struct evdns_base *base;
+
+ struct evdns_request *handle;
+};
+
+struct reply {
+ unsigned int type;
+ unsigned int have_answer : 1;
+ union {
+ struct {
+ u32 addrcount;
+ u32 addresses[MAX_V4_ADDRS];
+ } a;
+ struct {
+ u32 addrcount;
+ struct in6_addr addresses[MAX_V6_ADDRS];
+ } aaaa;
+ struct {
+ char name[HOST_NAME_MAX];
+ } ptr;
+ } data;
+};
+
+struct nameserver {
+ evutil_socket_t socket; /* a connected UDP socket */
+ struct sockaddr_storage address;
+ ev_socklen_t addrlen;
+ int failed_times; /* number of times which we have given this server a chance */
+ int timedout; /* number of times in a row a request has timed out */
+ struct event event;
+ /* these objects are kept in a circular list */
+ struct nameserver *next, *prev;
+ struct event timeout_event; /* used to keep the timeout for */
+ /* when we next probe this server. */
+ /* Valid if state == 0 */
+ /* Outstanding probe request for this nameserver, if any */
+ struct evdns_request *probe_request;
+ char state; /* zero if we think that this server is down */
+ char choked; /* true if we have an EAGAIN from this server's socket */
+ char write_waiting; /* true if we are waiting for EV_WRITE events */
+ struct evdns_base *base;
+
+ /* Number of currently inflight requests: used
+ * to track when we should add/del the event. */
+ int requests_inflight;
+};
+
+
+/* Represents a local port where we're listening for DNS requests. Right now, */
+/* only UDP is supported. */
+struct evdns_server_port {
+ evutil_socket_t socket; /* socket we use to read queries and write replies. */
+ int refcnt; /* reference count. */
+ char choked; /* Are we currently blocked from writing? */
+ char closing; /* Are we trying to close this port, pending writes? */
+ evdns_request_callback_fn_type user_callback; /* Fn to handle requests */
+ void *user_data; /* Opaque pointer passed to user_callback */
+ struct event event; /* Read/write event */
+ /* circular list of replies that we want to write. */
+ struct server_request *pending_replies;
+ struct event_base *event_base;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ void *lock;
+#endif
+};
+
+/* Represents part of a reply being built. (That is, a single RR.) */
+struct server_reply_item {
+ struct server_reply_item *next; /* next item in sequence. */
+ char *name; /* name part of the RR */
+ u16 type; /* The RR type */
+ u16 class; /* The RR class (usually CLASS_INET) */
+ u32 ttl; /* The RR TTL */
+ char is_name; /* True iff data is a label */
+ u16 datalen; /* Length of data; -1 if data is a label */
+ void *data; /* The contents of the RR */
+};
+
+/* Represents a request that we've received as a DNS server, and holds */
+/* the components of the reply as we're constructing it. */
+struct server_request {
+ /* Pointers to the next and previous entries on the list of replies */
+ /* that we're waiting to write. Only set if we have tried to respond */
+ /* and gotten EAGAIN. */
+ struct server_request *next_pending;
+ struct server_request *prev_pending;
+
+ u16 trans_id; /* Transaction id. */
+ struct evdns_server_port *port; /* Which port received this request on? */
+ struct sockaddr_storage addr; /* Where to send the response */
+ ev_socklen_t addrlen; /* length of addr */
+
+ int n_answer; /* how many answer RRs have been set? */
+ int n_authority; /* how many authority RRs have been set? */
+ int n_additional; /* how many additional RRs have been set? */
+
+ struct server_reply_item *answer; /* linked list of answer RRs */
+ struct server_reply_item *authority; /* linked list of authority RRs */
+ struct server_reply_item *additional; /* linked list of additional RRs */
+
+ /* Constructed response. Only set once we're ready to send a reply. */
+ /* Once this is set, the RR fields are cleared, and no more should be set. */
+ char *response;
+ size_t response_len;
+
+ /* Caller-visible fields: flags, questions. */
+ struct evdns_server_request base;
+};
+
+struct evdns_base {
+ /* An array of n_req_heads circular lists for inflight requests.
+ * Each inflight request req is in req_heads[req->trans_id % n_req_heads].
+ */
+ struct request **req_heads;
+ /* A circular list of requests that we're waiting to send, but haven't
+ * sent yet because there are too many requests inflight */
+ struct request *req_waiting_head;
+ /* A circular list of nameservers. */
+ struct nameserver *server_head;
+ int n_req_heads;
+
+ struct event_base *event_base;
+
+ /* The number of good nameservers that we have */
+ int global_good_nameservers;
+
+ /* inflight requests are contained in the req_head list */
+ /* and are actually going out across the network */
+ int global_requests_inflight;
+ /* requests which aren't inflight are in the waiting list */
+ /* and are counted here */
+ int global_requests_waiting;
+
+ int global_max_requests_inflight;
+
+ struct timeval global_timeout; /* 5 seconds by default */
+ int global_max_reissues; /* a reissue occurs when we get some errors from the server */
+ int global_max_retransmits; /* number of times we'll retransmit a request which timed out */
+ /* number of timeouts in a row before we consider this server to be down */
+ int global_max_nameserver_timeout;
+ /* true iff we will use the 0x20 hack to prevent poisoning attacks. */
+ int global_randomize_case;
+
+ /* The first time that a nameserver fails, how long do we wait before
+ * probing to see if it has returned? */
+ struct timeval global_nameserver_probe_initial_timeout;
+
+ /** Port to bind to for outgoing DNS packets. */
+ struct sockaddr_storage global_outgoing_address;
+ /** ev_socklen_t for global_outgoing_address. 0 if it isn't set. */
+ ev_socklen_t global_outgoing_addrlen;
+
+ struct timeval global_getaddrinfo_allow_skew;
+
+ int getaddrinfo_ipv4_timeouts;
+ int getaddrinfo_ipv6_timeouts;
+ int getaddrinfo_ipv4_answered;
+ int getaddrinfo_ipv6_answered;
+
+ struct search_state *global_search_state;
+
+ TAILQ_HEAD(hosts_list, hosts_entry) hostsdb;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ void *lock;
+#endif
+
+ int disable_when_inactive;
+};
+
+struct hosts_entry {
+ TAILQ_ENTRY(hosts_entry) next;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ } addr;
+ int addrlen;
+ char hostname[1];
+};
+
+static struct evdns_base *current_base = NULL;
+
+struct evdns_base *
+evdns_get_global_base(void)
+{
+ return current_base;
+}
+
+/* Given a pointer to an evdns_server_request, get the corresponding */
+/* server_request. */
+#define TO_SERVER_REQUEST(base_ptr) \
+ ((struct server_request*) \
+ (((char*)(base_ptr) - evutil_offsetof(struct server_request, base))))
+
+#define REQ_HEAD(base, id) ((base)->req_heads[id % (base)->n_req_heads])
+
+static struct nameserver *nameserver_pick(struct evdns_base *base);
+static void evdns_request_insert(struct request *req, struct request **head);
+static void evdns_request_remove(struct request *req, struct request **head);
+static void nameserver_ready_callback(evutil_socket_t fd, short events, void *arg);
+static int evdns_transmit(struct evdns_base *base);
+static int evdns_request_transmit(struct request *req);
+static void nameserver_send_probe(struct nameserver *const ns);
+static void search_request_finished(struct evdns_request *const);
+static int search_try_next(struct evdns_request *const req);
+static struct request *search_request_new(struct evdns_base *base, struct evdns_request *handle, int type, const char *const name, int flags, evdns_callback_type user_callback, void *user_arg);
+static void evdns_requests_pump_waiting_queue(struct evdns_base *base);
+static u16 transaction_id_pick(struct evdns_base *base);
+static struct request *request_new(struct evdns_base *base, struct evdns_request *handle, int type, const char *name, int flags, evdns_callback_type callback, void *ptr);
+static void request_submit(struct request *const req);
+
+static int server_request_free(struct server_request *req);
+static void server_request_free_answers(struct server_request *req);
+static void server_port_free(struct evdns_server_port *port);
+static void server_port_ready_callback(evutil_socket_t fd, short events, void *arg);
+static int evdns_base_resolv_conf_parse_impl(struct evdns_base *base, int flags, const char *const filename);
+static int evdns_base_set_option_impl(struct evdns_base *base,
+ const char *option, const char *val, int flags);
+static void evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests);
+static void evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg);
+
+static int strtoint(const char *const str);
+
+#ifdef EVENT__DISABLE_THREAD_SUPPORT
+#define EVDNS_LOCK(base) EVUTIL_NIL_STMT_
+#define EVDNS_UNLOCK(base) EVUTIL_NIL_STMT_
+#define ASSERT_LOCKED(base) EVUTIL_NIL_STMT_
+#else
+#define EVDNS_LOCK(base) \
+ EVLOCK_LOCK((base)->lock, 0)
+#define EVDNS_UNLOCK(base) \
+ EVLOCK_UNLOCK((base)->lock, 0)
+#define ASSERT_LOCKED(base) \
+ EVLOCK_ASSERT_LOCKED((base)->lock)
+#endif
+
+static evdns_debug_log_fn_type evdns_log_fn = NULL;
+
+void
+evdns_set_log_fn(evdns_debug_log_fn_type fn)
+{
+ evdns_log_fn = fn;
+}
+
+#ifdef __GNUC__
+#define EVDNS_LOG_CHECK __attribute__ ((format(printf, 2, 3)))
+#else
+#define EVDNS_LOG_CHECK
+#endif
+
+static void evdns_log_(int severity, const char *fmt, ...) EVDNS_LOG_CHECK;
+static void
+evdns_log_(int severity, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args,fmt);
+ if (evdns_log_fn) {
+ char buf[512];
+ int is_warn = (severity == EVDNS_LOG_WARN);
+ evutil_vsnprintf(buf, sizeof(buf), fmt, args);
+ evdns_log_fn(is_warn, buf);
+ } else {
+ event_logv_(severity, NULL, fmt, args);
+ }
+ va_end(args);
+}
+
+#define log evdns_log_
+
+/* This walks the list of inflight requests to find the */
+/* one with a matching transaction id. Returns NULL on */
+/* failure */
+static struct request *
+request_find_from_trans_id(struct evdns_base *base, u16 trans_id) {
+ struct request *req = REQ_HEAD(base, trans_id);
+ struct request *const started_at = req;
+
+ ASSERT_LOCKED(base);
+
+ if (req) {
+ do {
+ if (req->trans_id == trans_id) return req;
+ req = req->next;
+ } while (req != started_at);
+ }
+
+ return NULL;
+}
+
+/* a libevent callback function which is called when a nameserver */
+/* has gone down and we want to test if it has came back to life yet */
+static void
+nameserver_prod_callback(evutil_socket_t fd, short events, void *arg) {
+ struct nameserver *const ns = (struct nameserver *) arg;
+ (void)fd;
+ (void)events;
+
+ EVDNS_LOCK(ns->base);
+ nameserver_send_probe(ns);
+ EVDNS_UNLOCK(ns->base);
+}
+
+/* a libevent callback which is called when a nameserver probe (to see if */
+/* it has come back to life) times out. We increment the count of failed_times */
+/* and wait longer to send the next probe packet. */
+static void
+nameserver_probe_failed(struct nameserver *const ns) {
+ struct timeval timeout;
+ int i;
+
+ ASSERT_LOCKED(ns->base);
+ (void) evtimer_del(&ns->timeout_event);
+ if (ns->state == 1) {
+ /* This can happen if the nameserver acts in a way which makes us mark */
+ /* it as bad and then starts sending good replies. */
+ return;
+ }
+
+#define MAX_PROBE_TIMEOUT 3600
+#define TIMEOUT_BACKOFF_FACTOR 3
+
+ memcpy(&timeout, &ns->base->global_nameserver_probe_initial_timeout,
+ sizeof(struct timeval));
+ for (i=ns->failed_times; i > 0 && timeout.tv_sec < MAX_PROBE_TIMEOUT; --i) {
+ timeout.tv_sec *= TIMEOUT_BACKOFF_FACTOR;
+ timeout.tv_usec *= TIMEOUT_BACKOFF_FACTOR;
+ if (timeout.tv_usec > 1000000) {
+ timeout.tv_sec += timeout.tv_usec / 1000000;
+ timeout.tv_usec %= 1000000;
+ }
+ }
+ if (timeout.tv_sec > MAX_PROBE_TIMEOUT) {
+ timeout.tv_sec = MAX_PROBE_TIMEOUT;
+ timeout.tv_usec = 0;
+ }
+
+ ns->failed_times++;
+
+ if (evtimer_add(&ns->timeout_event, &timeout) < 0) {
+ char addrbuf[128];
+ log(EVDNS_LOG_WARN,
+ "Error from libevent when adding timer event for %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ }
+}
+
+/* called when a nameserver has been deemed to have failed. For example, too */
+/* many packets have timed out etc */
+static void
+nameserver_failed(struct nameserver *const ns, const char *msg) {
+ struct request *req, *started_at;
+ struct evdns_base *base = ns->base;
+ int i;
+ char addrbuf[128];
+
+ ASSERT_LOCKED(base);
+ /* if this nameserver has already been marked as failed */
+ /* then don't do anything */
+ if (!ns->state) return;
+
+ log(EVDNS_LOG_MSG, "Nameserver %s has failed: %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)),
+ msg);
+
+ base->global_good_nameservers--;
+ EVUTIL_ASSERT(base->global_good_nameservers >= 0);
+ if (base->global_good_nameservers == 0) {
+ log(EVDNS_LOG_MSG, "All nameservers have failed");
+ }
+
+ ns->state = 0;
+ ns->failed_times = 1;
+
+ if (evtimer_add(&ns->timeout_event,
+ &base->global_nameserver_probe_initial_timeout) < 0) {
+ log(EVDNS_LOG_WARN,
+ "Error from libevent when adding timer event for %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ /* ???? Do more? */
+ }
+
+ /* walk the list of inflight requests to see if any can be reassigned to */
+ /* a different server. Requests in the waiting queue don't have a */
+ /* nameserver assigned yet */
+
+ /* if we don't have *any* good nameservers then there's no point */
+ /* trying to reassign requests to one */
+ if (!base->global_good_nameservers) return;
+
+ for (i = 0; i < base->n_req_heads; ++i) {
+ req = started_at = base->req_heads[i];
+ if (req) {
+ do {
+ if (req->tx_count == 0 && req->ns == ns) {
+ /* still waiting to go out, can be moved */
+ /* to another server */
+ req->ns = nameserver_pick(base);
+ }
+ req = req->next;
+ } while (req != started_at);
+ }
+ }
+}
+
+static void
+nameserver_up(struct nameserver *const ns)
+{
+ char addrbuf[128];
+ ASSERT_LOCKED(ns->base);
+ if (ns->state) return;
+ log(EVDNS_LOG_MSG, "Nameserver %s is back up",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ evtimer_del(&ns->timeout_event);
+ if (ns->probe_request) {
+ evdns_cancel_request(ns->base, ns->probe_request);
+ ns->probe_request = NULL;
+ }
+ ns->state = 1;
+ ns->failed_times = 0;
+ ns->timedout = 0;
+ ns->base->global_good_nameservers++;
+}
+
+static void
+request_trans_id_set(struct request *const req, const u16 trans_id) {
+ req->trans_id = trans_id;
+ *((u16 *) req->request) = htons(trans_id);
+}
+
+/* Called to remove a request from a list and dealloc it. */
+/* head is a pointer to the head of the list it should be */
+/* removed from or NULL if the request isn't in a list. */
+/* when free_handle is one, free the handle as well. */
+static void
+request_finished(struct request *const req, struct request **head, int free_handle) {
+ struct evdns_base *base = req->base;
+ int was_inflight = (head != &base->req_waiting_head);
+ EVDNS_LOCK(base);
+ ASSERT_VALID_REQUEST(req);
+
+ if (head)
+ evdns_request_remove(req, head);
+
+ log(EVDNS_LOG_DEBUG, "Removing timeout for request %p", req);
+ if (was_inflight) {
+ evtimer_del(&req->timeout_event);
+ base->global_requests_inflight--;
+ req->ns->requests_inflight--;
+ } else {
+ base->global_requests_waiting--;
+ }
+ /* it was initialized during request_new / evtimer_assign */
+ event_debug_unassign(&req->timeout_event);
+
+ if (req->ns &&
+ req->ns->requests_inflight == 0 &&
+ req->base->disable_when_inactive) {
+ event_del(&req->ns->event);
+ }
+
+ if (!req->request_appended) {
+ /* need to free the request data on it's own */
+ mm_free(req->request);
+ } else {
+ /* the request data is appended onto the header */
+ /* so everything gets free()ed when we: */
+ }
+
+ if (req->handle) {
+ EVUTIL_ASSERT(req->handle->current_req == req);
+
+ if (free_handle) {
+ search_request_finished(req->handle);
+ req->handle->current_req = NULL;
+ if (! req->handle->pending_cb) {
+ /* If we're planning to run the callback,
+ * don't free the handle until later. */
+ mm_free(req->handle);
+ }
+ req->handle = NULL; /* If we have a bug, let's crash
+ * early */
+ } else {
+ req->handle->current_req = NULL;
+ }
+ }
+
+ mm_free(req);
+
+ evdns_requests_pump_waiting_queue(base);
+ EVDNS_UNLOCK(base);
+}
+
+/* This is called when a server returns a funny error code. */
+/* We try the request again with another server. */
+/* */
+/* return: */
+/* 0 ok */
+/* 1 failed/reissue is pointless */
+static int
+request_reissue(struct request *req) {
+ const struct nameserver *const last_ns = req->ns;
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+ /* the last nameserver should have been marked as failing */
+ /* by the caller of this function, therefore pick will try */
+ /* not to return it */
+ req->ns = nameserver_pick(req->base);
+ if (req->ns == last_ns) {
+ /* ... but pick did return it */
+ /* not a lot of point in trying again with the */
+ /* same server */
+ return 1;
+ }
+
+ req->reissue_count++;
+ req->tx_count = 0;
+ req->transmit_me = 1;
+
+ return 0;
+}
+
+/* this function looks for space on the inflight queue and promotes */
+/* requests from the waiting queue if it can. */
+/* */
+/* TODO: */
+/* add return code, see at nameserver_pick() and other functions. */
+static void
+evdns_requests_pump_waiting_queue(struct evdns_base *base) {
+ ASSERT_LOCKED(base);
+ while (base->global_requests_inflight < base->global_max_requests_inflight &&
+ base->global_requests_waiting) {
+ struct request *req;
+
+ EVUTIL_ASSERT(base->req_waiting_head);
+ req = base->req_waiting_head;
+
+ req->ns = nameserver_pick(base);
+ if (!req->ns)
+ return;
+
+ /* move a request from the waiting queue to the inflight queue */
+ req->ns->requests_inflight++;
+
+ evdns_request_remove(req, &base->req_waiting_head);
+
+ base->global_requests_waiting--;
+ base->global_requests_inflight++;
+
+ request_trans_id_set(req, transaction_id_pick(base));
+
+ evdns_request_insert(req, &REQ_HEAD(base, req->trans_id));
+ evdns_request_transmit(req);
+ evdns_transmit(base);
+ }
+}
+
+/* TODO(nickm) document */
+struct deferred_reply_callback {
+ struct event_callback deferred;
+ struct evdns_request *handle;
+ u8 request_type;
+ u8 have_reply;
+ u32 ttl;
+ u32 err;
+ evdns_callback_type user_callback;
+ struct reply reply;
+};
+
+static void
+reply_run_callback(struct event_callback *d, void *user_pointer)
+{
+ struct deferred_reply_callback *cb =
+ EVUTIL_UPCAST(d, struct deferred_reply_callback, deferred);
+
+ switch (cb->request_type) {
+ case TYPE_A:
+ if (cb->have_reply)
+ cb->user_callback(DNS_ERR_NONE, DNS_IPv4_A,
+ cb->reply.data.a.addrcount, cb->ttl,
+ cb->reply.data.a.addresses,
+ user_pointer);
+ else
+ cb->user_callback(cb->err, 0, 0, cb->ttl, NULL, user_pointer);
+ break;
+ case TYPE_PTR:
+ if (cb->have_reply) {
+ char *name = cb->reply.data.ptr.name;
+ cb->user_callback(DNS_ERR_NONE, DNS_PTR, 1, cb->ttl,
+ &name, user_pointer);
+ } else {
+ cb->user_callback(cb->err, 0, 0, cb->ttl, NULL, user_pointer);
+ }
+ break;
+ case TYPE_AAAA:
+ if (cb->have_reply)
+ cb->user_callback(DNS_ERR_NONE, DNS_IPv6_AAAA,
+ cb->reply.data.aaaa.addrcount, cb->ttl,
+ cb->reply.data.aaaa.addresses,
+ user_pointer);
+ else
+ cb->user_callback(cb->err, 0, 0, cb->ttl, NULL, user_pointer);
+ break;
+ default:
+ EVUTIL_ASSERT(0);
+ }
+
+ if (cb->handle && cb->handle->pending_cb) {
+ mm_free(cb->handle);
+ }
+
+ mm_free(cb);
+}
+
+static void
+reply_schedule_callback(struct request *const req, u32 ttl, u32 err, struct reply *reply)
+{
+ struct deferred_reply_callback *d = mm_calloc(1, sizeof(*d));
+
+ if (!d) {
+ event_warn("%s: Couldn't allocate space for deferred callback.",
+ __func__);
+ return;
+ }
+
+ ASSERT_LOCKED(req->base);
+
+ d->request_type = req->request_type;
+ d->user_callback = req->user_callback;
+ d->ttl = ttl;
+ d->err = err;
+ if (reply) {
+ d->have_reply = 1;
+ memcpy(&d->reply, reply, sizeof(struct reply));
+ }
+
+ if (req->handle) {
+ req->handle->pending_cb = 1;
+ d->handle = req->handle;
+ }
+
+ event_deferred_cb_init_(
+ &d->deferred,
+ event_get_priority(&req->timeout_event),
+ reply_run_callback,
+ req->user_pointer);
+ event_deferred_cb_schedule_(
+ req->base->event_base,
+ &d->deferred);
+}
+
+/* this processes a parsed reply packet */
+static void
+reply_handle(struct request *const req, u16 flags, u32 ttl, struct reply *reply) {
+ int error;
+ char addrbuf[128];
+ static const int error_codes[] = {
+ DNS_ERR_FORMAT, DNS_ERR_SERVERFAILED, DNS_ERR_NOTEXIST,
+ DNS_ERR_NOTIMPL, DNS_ERR_REFUSED
+ };
+
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+
+ if (flags & 0x020f || !reply || !reply->have_answer) {
+ /* there was an error */
+ if (flags & 0x0200) {
+ error = DNS_ERR_TRUNCATED;
+ } else if (flags & 0x000f) {
+ u16 error_code = (flags & 0x000f) - 1;
+ if (error_code > 4) {
+ error = DNS_ERR_UNKNOWN;
+ } else {
+ error = error_codes[error_code];
+ }
+ } else if (reply && !reply->have_answer) {
+ error = DNS_ERR_NODATA;
+ } else {
+ error = DNS_ERR_UNKNOWN;
+ }
+
+ switch (error) {
+ case DNS_ERR_NOTIMPL:
+ case DNS_ERR_REFUSED:
+ /* we regard these errors as marking a bad nameserver */
+ if (req->reissue_count < req->base->global_max_reissues) {
+ char msg[64];
+ evutil_snprintf(msg, sizeof(msg), "Bad response %d (%s)",
+ error, evdns_err_to_string(error));
+ nameserver_failed(req->ns, msg);
+ if (!request_reissue(req)) return;
+ }
+ break;
+ case DNS_ERR_SERVERFAILED:
+ /* rcode 2 (servfailed) sometimes means "we
+ * are broken" and sometimes (with some binds)
+ * means "that request was very confusing."
+ * Treat this as a timeout, not a failure.
+ */
+ log(EVDNS_LOG_DEBUG, "Got a SERVERFAILED from nameserver"
+ "at %s; will allow the request to time out.",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&req->ns->address,
+ addrbuf, sizeof(addrbuf)));
+ /* Call the timeout function */
+ evdns_request_timeout_callback(0, 0, req);
+ return;
+ default:
+ /* we got a good reply from the nameserver: it is up. */
+ if (req->handle == req->ns->probe_request) {
+ /* Avoid double-free */
+ req->ns->probe_request = NULL;
+ }
+
+ nameserver_up(req->ns);
+ }
+
+ if (req->handle->search_state &&
+ req->request_type != TYPE_PTR) {
+ /* if we have a list of domains to search in,
+ * try the next one */
+ if (!search_try_next(req->handle)) {
+ /* a new request was issued so this
+ * request is finished and */
+ /* the user callback will be made when
+ * that request (or a */
+ /* child of it) finishes. */
+ return;
+ }
+ }
+
+ /* all else failed. Pass the failure up */
+ reply_schedule_callback(req, ttl, error, NULL);
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
+ } else {
+ /* all ok, tell the user */
+ reply_schedule_callback(req, ttl, 0, reply);
+ if (req->handle == req->ns->probe_request)
+ req->ns->probe_request = NULL; /* Avoid double-free */
+ nameserver_up(req->ns);
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
+ }
+}
+
+static int
+name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) {
+ int name_end = -1;
+ int j = *idx;
+ int ptr_count = 0;
+#define GET32(x) do { if (j + 4 > length) goto err; memcpy(&t32_, packet + j, 4); j += 4; x = ntohl(t32_); } while (0)
+#define GET16(x) do { if (j + 2 > length) goto err; memcpy(&t_, packet + j, 2); j += 2; x = ntohs(t_); } while (0)
+#define GET8(x) do { if (j >= length) goto err; x = packet[j++]; } while (0)
+
+ char *cp = name_out;
+ const char *const end = name_out + name_out_len;
+
+ /* Normally, names are a series of length prefixed strings terminated */
+ /* with a length of 0 (the lengths are u8's < 63). */
+ /* However, the length can start with a pair of 1 bits and that */
+ /* means that the next 14 bits are a pointer within the current */
+ /* packet. */
+
+ for (;;) {
+ u8 label_len;
+ if (j >= length) return -1;
+ GET8(label_len);
+ if (!label_len) break;
+ if (label_len & 0xc0) {
+ u8 ptr_low;
+ GET8(ptr_low);
+ if (name_end < 0) name_end = j;
+ j = (((int)label_len & 0x3f) << 8) + ptr_low;
+ /* Make sure that the target offset is in-bounds. */
+ if (j < 0 || j >= length) return -1;
+ /* If we've jumped more times than there are characters in the
+ * message, we must have a loop. */
+ if (++ptr_count > length) return -1;
+ continue;
+ }
+ if (label_len > 63) return -1;
+ if (cp != name_out) {
+ if (cp + 1 >= end) return -1;
+ *cp++ = '.';
+ }
+ if (cp + label_len >= end) return -1;
+ memcpy(cp, packet + j, label_len);
+ cp += label_len;
+ j += label_len;
+ }
+ if (cp >= end) return -1;
+ *cp = '\0';
+ if (name_end < 0)
+ *idx = j;
+ else
+ *idx = name_end;
+ return 0;
+ err:
+ return -1;
+}
+
+/* parses a raw request from a nameserver */
+static int
+reply_parse(struct evdns_base *base, u8 *packet, int length) {
+ int j = 0, k = 0; /* index into packet */
+ u16 t_; /* used by the macros */
+ u32 t32_; /* used by the macros */
+ char tmp_name[256], cmp_name[256]; /* used by the macros */
+ int name_matches = 0;
+
+ u16 trans_id, questions, answers, authority, additional, datalength;
+ u16 flags = 0;
+ u32 ttl, ttl_r = 0xffffffff;
+ struct reply reply;
+ struct request *req = NULL;
+ unsigned int i;
+
+ ASSERT_LOCKED(base);
+
+ GET16(trans_id);
+ GET16(flags);
+ GET16(questions);
+ GET16(answers);
+ GET16(authority);
+ GET16(additional);
+ (void) authority; /* suppress "unused variable" warnings. */
+ (void) additional; /* suppress "unused variable" warnings. */
+
+ req = request_find_from_trans_id(base, trans_id);
+ if (!req) return -1;
+ EVUTIL_ASSERT(req->base == base);
+
+ memset(&reply, 0, sizeof(reply));
+
+ /* If it's not an answer, it doesn't correspond to any request. */
+ if (!(flags & 0x8000)) return -1; /* must be an answer */
+ if ((flags & 0x020f) && (flags & 0x020f) != DNS_ERR_NOTEXIST) {
+ /* there was an error and it's not NXDOMAIN */
+ goto err;
+ }
+ /* if (!answers) return; */ /* must have an answer of some form */
+
+ /* This macro skips a name in the DNS reply. */
+#define SKIP_NAME \
+ do { tmp_name[0] = '\0'; \
+ if (name_parse(packet, length, &j, tmp_name, \
+ sizeof(tmp_name))<0) \
+ goto err; \
+ } while (0)
+#define TEST_NAME \
+ do { tmp_name[0] = '\0'; \
+ cmp_name[0] = '\0'; \
+ k = j; \
+ if (name_parse(packet, length, &j, tmp_name, \
+ sizeof(tmp_name))<0) \
+ goto err; \
+ if (name_parse(req->request, req->request_len, &k, \
+ cmp_name, sizeof(cmp_name))<0) \
+ goto err; \
+ if (base->global_randomize_case) { \
+ if (strcmp(tmp_name, cmp_name) == 0) \
+ name_matches = 1; \
+ } else { \
+ if (evutil_ascii_strcasecmp(tmp_name, cmp_name) == 0) \
+ name_matches = 1; \
+ } \
+ } while (0)
+
+ reply.type = req->request_type;
+
+ /* skip over each question in the reply */
+ for (i = 0; i < questions; ++i) {
+ /* the question looks like
+ * <label:name><u16:type><u16:class>
+ */
+ TEST_NAME;
+ j += 4;
+ if (j > length) goto err;
+ }
+
+ if (!name_matches)
+ goto err;
+
+ /* now we have the answer section which looks like
+ * <label:name><u16:type><u16:class><u32:ttl><u16:len><data...>
+ */
+
+ for (i = 0; i < answers; ++i) {
+ u16 type, class;
+
+ SKIP_NAME;
+ GET16(type);
+ GET16(class);
+ GET32(ttl);
+ GET16(datalength);
+
+ if (type == TYPE_A && class == CLASS_INET) {
+ int addrcount, addrtocopy;
+ if (req->request_type != TYPE_A) {
+ j += datalength; continue;
+ }
+ if ((datalength & 3) != 0) /* not an even number of As. */
+ goto err;
+ addrcount = datalength >> 2;
+ addrtocopy = MIN(MAX_V4_ADDRS - reply.data.a.addrcount, (unsigned)addrcount);
+
+ ttl_r = MIN(ttl_r, ttl);
+ /* we only bother with the first four addresses. */
+ if (j + 4*addrtocopy > length) goto err;
+ memcpy(&reply.data.a.addresses[reply.data.a.addrcount],
+ packet + j, 4*addrtocopy);
+ j += 4*addrtocopy;
+ reply.data.a.addrcount += addrtocopy;
+ reply.have_answer = 1;
+ if (reply.data.a.addrcount == MAX_V4_ADDRS) break;
+ } else if (type == TYPE_PTR && class == CLASS_INET) {
+ if (req->request_type != TYPE_PTR) {
+ j += datalength; continue;
+ }
+ if (name_parse(packet, length, &j, reply.data.ptr.name,
+ sizeof(reply.data.ptr.name))<0)
+ goto err;
+ ttl_r = MIN(ttl_r, ttl);
+ reply.have_answer = 1;
+ break;
+ } else if (type == TYPE_CNAME) {
+ char cname[HOST_NAME_MAX];
+ if (!req->put_cname_in_ptr || *req->put_cname_in_ptr) {
+ j += datalength; continue;
+ }
+ if (name_parse(packet, length, &j, cname,
+ sizeof(cname))<0)
+ goto err;
+ *req->put_cname_in_ptr = mm_strdup(cname);
+ } else if (type == TYPE_AAAA && class == CLASS_INET) {
+ int addrcount, addrtocopy;
+ if (req->request_type != TYPE_AAAA) {
+ j += datalength; continue;
+ }
+ if ((datalength & 15) != 0) /* not an even number of AAAAs. */
+ goto err;
+ addrcount = datalength >> 4; /* each address is 16 bytes long */
+ addrtocopy = MIN(MAX_V6_ADDRS - reply.data.aaaa.addrcount, (unsigned)addrcount);
+ ttl_r = MIN(ttl_r, ttl);
+
+ /* we only bother with the first four addresses. */
+ if (j + 16*addrtocopy > length) goto err;
+ memcpy(&reply.data.aaaa.addresses[reply.data.aaaa.addrcount],
+ packet + j, 16*addrtocopy);
+ reply.data.aaaa.addrcount += addrtocopy;
+ j += 16*addrtocopy;
+ reply.have_answer = 1;
+ if (reply.data.aaaa.addrcount == MAX_V6_ADDRS) break;
+ } else {
+ /* skip over any other type of resource */
+ j += datalength;
+ }
+ }
+
+ if (!reply.have_answer) {
+ for (i = 0; i < authority; ++i) {
+ u16 type, class;
+ SKIP_NAME;
+ GET16(type);
+ GET16(class);
+ GET32(ttl);
+ GET16(datalength);
+ if (type == TYPE_SOA && class == CLASS_INET) {
+ u32 serial, refresh, retry, expire, minimum;
+ SKIP_NAME;
+ SKIP_NAME;
+ GET32(serial);
+ GET32(refresh);
+ GET32(retry);
+ GET32(expire);
+ GET32(minimum);
+ (void)expire;
+ (void)retry;
+ (void)refresh;
+ (void)serial;
+ ttl_r = MIN(ttl_r, ttl);
+ ttl_r = MIN(ttl_r, minimum);
+ } else {
+ /* skip over any other type of resource */
+ j += datalength;
+ }
+ }
+ }
+
+ if (ttl_r == 0xffffffff)
+ ttl_r = 0;
+
+ reply_handle(req, flags, ttl_r, &reply);
+ return 0;
+ err:
+ if (req)
+ reply_handle(req, flags, 0, NULL);
+ return -1;
+}
+
+/* Parse a raw request (packet,length) sent to a nameserver port (port) from */
+/* a DNS client (addr,addrlen), and if it's well-formed, call the corresponding */
+/* callback. */
+static int
+request_parse(u8 *packet, int length, struct evdns_server_port *port, struct sockaddr *addr, ev_socklen_t addrlen)
+{
+ int j = 0; /* index into packet */
+ u16 t_; /* used by the macros */
+ char tmp_name[256]; /* used by the macros */
+
+ int i;
+ u16 trans_id, flags, questions, answers, authority, additional;
+ struct server_request *server_req = NULL;
+
+ ASSERT_LOCKED(port);
+
+ /* Get the header fields */
+ GET16(trans_id);
+ GET16(flags);
+ GET16(questions);
+ GET16(answers);
+ GET16(authority);
+ GET16(additional);
+ (void)answers;
+ (void)additional;
+ (void)authority;
+
+ if (flags & 0x8000) return -1; /* Must not be an answer. */
+ flags &= 0x0110; /* Only RD and CD get preserved. */
+
+ server_req = mm_malloc(sizeof(struct server_request));
+ if (server_req == NULL) return -1;
+ memset(server_req, 0, sizeof(struct server_request));
+
+ server_req->trans_id = trans_id;
+ memcpy(&server_req->addr, addr, addrlen);
+ server_req->addrlen = addrlen;
+
+ server_req->base.flags = flags;
+ server_req->base.nquestions = 0;
+ server_req->base.questions = mm_calloc(sizeof(struct evdns_server_question *), questions);
+ if (server_req->base.questions == NULL)
+ goto err;
+
+ for (i = 0; i < questions; ++i) {
+ u16 type, class;
+ struct evdns_server_question *q;
+ int namelen;
+ if (name_parse(packet, length, &j, tmp_name, sizeof(tmp_name))<0)
+ goto err;
+ GET16(type);
+ GET16(class);
+ namelen = (int)strlen(tmp_name);
+ q = mm_malloc(sizeof(struct evdns_server_question) + namelen);
+ if (!q)
+ goto err;
+ q->type = type;
+ q->dns_question_class = class;
+ memcpy(q->name, tmp_name, namelen+1);
+ server_req->base.questions[server_req->base.nquestions++] = q;
+ }
+
+ /* Ignore answers, authority, and additional. */
+
+ server_req->port = port;
+ port->refcnt++;
+
+ /* Only standard queries are supported. */
+ if (flags & 0x7800) {
+ evdns_server_request_respond(&(server_req->base), DNS_ERR_NOTIMPL);
+ return -1;
+ }
+
+ port->user_callback(&(server_req->base), port->user_data);
+
+ return 0;
+err:
+ if (server_req) {
+ if (server_req->base.questions) {
+ for (i = 0; i < server_req->base.nquestions; ++i)
+ mm_free(server_req->base.questions[i]);
+ mm_free(server_req->base.questions);
+ }
+ mm_free(server_req);
+ }
+ return -1;
+
+#undef SKIP_NAME
+#undef GET32
+#undef GET16
+#undef GET8
+}
+
+
+void
+evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void))
+{
+}
+
+void
+evdns_set_random_bytes_fn(void (*fn)(char *, size_t))
+{
+}
+
+/* Try to choose a strong transaction id which isn't already in flight */
+static u16
+transaction_id_pick(struct evdns_base *base) {
+ ASSERT_LOCKED(base);
+ for (;;) {
+ u16 trans_id;
+ evutil_secure_rng_get_bytes(&trans_id, sizeof(trans_id));
+
+ if (trans_id == 0xffff) continue;
+ /* now check to see if that id is already inflight */
+ if (request_find_from_trans_id(base, trans_id) == NULL)
+ return trans_id;
+ }
+}
+
+/* choose a namesever to use. This function will try to ignore */
+/* nameservers which we think are down and load balance across the rest */
+/* by updating the server_head global each time. */
+static struct nameserver *
+nameserver_pick(struct evdns_base *base) {
+ struct nameserver *started_at = base->server_head, *picked;
+ ASSERT_LOCKED(base);
+ if (!base->server_head) return NULL;
+
+ /* if we don't have any good nameservers then there's no */
+ /* point in trying to find one. */
+ if (!base->global_good_nameservers) {
+ base->server_head = base->server_head->next;
+ return base->server_head;
+ }
+
+ /* remember that nameservers are in a circular list */
+ for (;;) {
+ if (base->server_head->state) {
+ /* we think this server is currently good */
+ picked = base->server_head;
+ base->server_head = base->server_head->next;
+ return picked;
+ }
+
+ base->server_head = base->server_head->next;
+ if (base->server_head == started_at) {
+ /* all the nameservers seem to be down */
+ /* so we just return this one and hope for the */
+ /* best */
+ EVUTIL_ASSERT(base->global_good_nameservers == 0);
+ picked = base->server_head;
+ base->server_head = base->server_head->next;
+ return picked;
+ }
+ }
+}
+
+/* this is called when a namesever socket is ready for reading */
+static void
+nameserver_read(struct nameserver *ns) {
+ struct sockaddr_storage ss;
+ ev_socklen_t addrlen = sizeof(ss);
+ u8 packet[1500];
+ char addrbuf[128];
+ ASSERT_LOCKED(ns->base);
+
+ for (;;) {
+ const int r = recvfrom(ns->socket, (void*)packet,
+ sizeof(packet), 0,
+ (struct sockaddr*)&ss, &addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(ns->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return;
+ nameserver_failed(ns,
+ evutil_socket_error_to_string(err));
+ return;
+ }
+ if (evutil_sockaddr_cmp((struct sockaddr*)&ss,
+ (struct sockaddr*)&ns->address, 0)) {
+ log(EVDNS_LOG_WARN, "Address mismatch on received "
+ "DNS packet. Apparent source was %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ss,
+ addrbuf, sizeof(addrbuf)));
+ return;
+ }
+
+ ns->timedout = 0;
+ reply_parse(ns->base, packet, r);
+ }
+}
+
+/* Read a packet from a DNS client on a server port s, parse it, and */
+/* act accordingly. */
+static void
+server_port_read(struct evdns_server_port *s) {
+ u8 packet[1500];
+ struct sockaddr_storage addr;
+ ev_socklen_t addrlen;
+ int r;
+ ASSERT_LOCKED(s);
+
+ for (;;) {
+ addrlen = sizeof(struct sockaddr_storage);
+ r = recvfrom(s->socket, (void*)packet, sizeof(packet), 0,
+ (struct sockaddr*) &addr, &addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(s->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return;
+ log(EVDNS_LOG_WARN,
+ "Error %s (%d) while reading request.",
+ evutil_socket_error_to_string(err), err);
+ return;
+ }
+ request_parse(packet, r, s, (struct sockaddr*) &addr, addrlen);
+ }
+}
+
+/* Try to write all pending replies on a given DNS server port. */
+static void
+server_port_flush(struct evdns_server_port *port)
+{
+ struct server_request *req = port->pending_replies;
+ ASSERT_LOCKED(port);
+ while (req) {
+ int r = sendto(port->socket, req->response, (int)req->response_len, 0,
+ (struct sockaddr*) &req->addr, (ev_socklen_t)req->addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(port->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return;
+ log(EVDNS_LOG_WARN, "Error %s (%d) while writing response to port; dropping", evutil_socket_error_to_string(err), err);
+ }
+ if (server_request_free(req)) {
+ /* we released the last reference to req->port. */
+ return;
+ } else {
+ EVUTIL_ASSERT(req != port->pending_replies);
+ req = port->pending_replies;
+ }
+ }
+
+ /* We have no more pending requests; stop listening for 'writeable' events. */
+ (void) event_del(&port->event);
+ event_assign(&port->event, port->event_base,
+ port->socket, EV_READ | EV_PERSIST,
+ server_port_ready_callback, port);
+
+ if (event_add(&port->event, NULL) < 0) {
+ log(EVDNS_LOG_WARN, "Error from libevent when adding event for DNS server.");
+ /* ???? Do more? */
+ }
+}
+
+/* set if we are waiting for the ability to write to this server. */
+/* if waiting is true then we ask libevent for EV_WRITE events, otherwise */
+/* we stop these events. */
+static void
+nameserver_write_waiting(struct nameserver *ns, char waiting) {
+ ASSERT_LOCKED(ns->base);
+ if (ns->write_waiting == waiting) return;
+
+ ns->write_waiting = waiting;
+ (void) event_del(&ns->event);
+ event_assign(&ns->event, ns->base->event_base,
+ ns->socket, EV_READ | (waiting ? EV_WRITE : 0) | EV_PERSIST,
+ nameserver_ready_callback, ns);
+ if (event_add(&ns->event, NULL) < 0) {
+ char addrbuf[128];
+ log(EVDNS_LOG_WARN, "Error from libevent when adding event for %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ /* ???? Do more? */
+ }
+}
+
+/* a callback function. Called by libevent when the kernel says that */
+/* a nameserver socket is ready for writing or reading */
+static void
+nameserver_ready_callback(evutil_socket_t fd, short events, void *arg) {
+ struct nameserver *ns = (struct nameserver *) arg;
+ (void)fd;
+
+ EVDNS_LOCK(ns->base);
+ if (events & EV_WRITE) {
+ ns->choked = 0;
+ if (!evdns_transmit(ns->base)) {
+ nameserver_write_waiting(ns, 0);
+ }
+ }
+ if (events & EV_READ) {
+ nameserver_read(ns);
+ }
+ EVDNS_UNLOCK(ns->base);
+}
+
+/* a callback function. Called by libevent when the kernel says that */
+/* a server socket is ready for writing or reading. */
+static void
+server_port_ready_callback(evutil_socket_t fd, short events, void *arg) {
+ struct evdns_server_port *port = (struct evdns_server_port *) arg;
+ (void) fd;
+
+ EVDNS_LOCK(port);
+ if (events & EV_WRITE) {
+ port->choked = 0;
+ server_port_flush(port);
+ }
+ if (events & EV_READ) {
+ server_port_read(port);
+ }
+ EVDNS_UNLOCK(port);
+}
+
+/* This is an inefficient representation; only use it via the dnslabel_table_*
+ * functions, so that is can be safely replaced with something smarter later. */
+#define MAX_LABELS 128
+/* Structures used to implement name compression */
+struct dnslabel_entry { char *v; off_t pos; };
+struct dnslabel_table {
+ int n_labels; /* number of current entries */
+ /* map from name to position in message */
+ struct dnslabel_entry labels[MAX_LABELS];
+};
+
+/* Initialize dnslabel_table. */
+static void
+dnslabel_table_init(struct dnslabel_table *table)
+{
+ table->n_labels = 0;
+}
+
+/* Free all storage held by table, but not the table itself. */
+static void
+dnslabel_clear(struct dnslabel_table *table)
+{
+ int i;
+ for (i = 0; i < table->n_labels; ++i)
+ mm_free(table->labels[i].v);
+ table->n_labels = 0;
+}
+
+/* return the position of the label in the current message, or -1 if the label */
+/* hasn't been used yet. */
+static int
+dnslabel_table_get_pos(const struct dnslabel_table *table, const char *label)
+{
+ int i;
+ for (i = 0; i < table->n_labels; ++i) {
+ if (!strcmp(label, table->labels[i].v))
+ return table->labels[i].pos;
+ }
+ return -1;
+}
+
+/* remember that we've used the label at position pos */
+static int
+dnslabel_table_add(struct dnslabel_table *table, const char *label, off_t pos)
+{
+ char *v;
+ int p;
+ if (table->n_labels == MAX_LABELS)
+ return (-1);
+ v = mm_strdup(label);
+ if (v == NULL)
+ return (-1);
+ p = table->n_labels++;
+ table->labels[p].v = v;
+ table->labels[p].pos = pos;
+
+ return (0);
+}
+
+/* Converts a string to a length-prefixed set of DNS labels, starting */
+/* at buf[j]. name and buf must not overlap. name_len should be the length */
+/* of name. table is optional, and is used for compression. */
+/* */
+/* Input: abc.def */
+/* Output: <3>abc<3>def<0> */
+/* */
+/* Returns the first index after the encoded name, or negative on error. */
+/* -1 label was > 63 bytes */
+/* -2 name too long to fit in buffer. */
+/* */
+static off_t
+dnsname_to_labels(u8 *const buf, size_t buf_len, off_t j,
+ const char *name, const size_t name_len,
+ struct dnslabel_table *table) {
+ const char *end = name + name_len;
+ int ref = 0;
+ u16 t_;
+
+#define APPEND16(x) do { \
+ if (j + 2 > (off_t)buf_len) \
+ goto overflow; \
+ t_ = htons(x); \
+ memcpy(buf + j, &t_, 2); \
+ j += 2; \
+ } while (0)
+#define APPEND32(x) do { \
+ if (j + 4 > (off_t)buf_len) \
+ goto overflow; \
+ t32_ = htonl(x); \
+ memcpy(buf + j, &t32_, 4); \
+ j += 4; \
+ } while (0)
+
+ if (name_len > 255) return -2;
+
+ for (;;) {
+ const char *const start = name;
+ if (table && (ref = dnslabel_table_get_pos(table, name)) >= 0) {
+ APPEND16(ref | 0xc000);
+ return j;
+ }
+ name = strchr(name, '.');
+ if (!name) {
+ const size_t label_len = end - start;
+ if (label_len > 63) return -1;
+ if ((size_t)(j+label_len+1) > buf_len) return -2;
+ if (table) dnslabel_table_add(table, start, j);
+ buf[j++] = (ev_uint8_t)label_len;
+
+ memcpy(buf + j, start, label_len);
+ j += (int) label_len;
+ break;
+ } else {
+ /* append length of the label. */
+ const size_t label_len = name - start;
+ if (label_len > 63) return -1;
+ if ((size_t)(j+label_len+1) > buf_len) return -2;
+ if (table) dnslabel_table_add(table, start, j);
+ buf[j++] = (ev_uint8_t)label_len;
+
+ memcpy(buf + j, start, label_len);
+ j += (int) label_len;
+ /* hop over the '.' */
+ name++;
+ }
+ }
+
+ /* the labels must be terminated by a 0. */
+ /* It's possible that the name ended in a . */
+ /* in which case the zero is already there */
+ if (!j || buf[j-1]) buf[j++] = 0;
+ return j;
+ overflow:
+ return (-2);
+}
+
+/* Finds the length of a dns request for a DNS name of the given */
+/* length. The actual request may be smaller than the value returned */
+/* here */
+static size_t
+evdns_request_len(const size_t name_len) {
+ return 96 + /* length of the DNS standard header */
+ name_len + 2 +
+ 4; /* space for the resource type */
+}
+
+/* build a dns request packet into buf. buf should be at least as long */
+/* as evdns_request_len told you it should be. */
+/* */
+/* Returns the amount of space used. Negative on error. */
+static int
+evdns_request_data_build(const char *const name, const size_t name_len,
+ const u16 trans_id, const u16 type, const u16 class,
+ u8 *const buf, size_t buf_len) {
+ off_t j = 0; /* current offset into buf */
+ u16 t_; /* used by the macros */
+
+ APPEND16(trans_id);
+ APPEND16(0x0100); /* standard query, recusion needed */
+ APPEND16(1); /* one question */
+ APPEND16(0); /* no answers */
+ APPEND16(0); /* no authority */
+ APPEND16(0); /* no additional */
+
+ j = dnsname_to_labels(buf, buf_len, j, name, name_len, NULL);
+ if (j < 0) {
+ return (int)j;
+ }
+
+ APPEND16(type);
+ APPEND16(class);
+
+ return (int)j;
+ overflow:
+ return (-1);
+}
+
+/* exported function */
+struct evdns_server_port *
+evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data)
+{
+ struct evdns_server_port *port;
+ if (flags)
+ return NULL; /* flags not yet implemented */
+ if (!(port = mm_malloc(sizeof(struct evdns_server_port))))
+ return NULL;
+ memset(port, 0, sizeof(struct evdns_server_port));
+
+
+ port->socket = socket;
+ port->refcnt = 1;
+ port->choked = 0;
+ port->closing = 0;
+ port->user_callback = cb;
+ port->user_data = user_data;
+ port->pending_replies = NULL;
+ port->event_base = base;
+
+ event_assign(&port->event, port->event_base,
+ port->socket, EV_READ | EV_PERSIST,
+ server_port_ready_callback, port);
+ if (event_add(&port->event, NULL) < 0) {
+ mm_free(port);
+ return NULL;
+ }
+ EVTHREAD_ALLOC_LOCK(port->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ return port;
+}
+
+struct evdns_server_port *
+evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data)
+{
+ return evdns_add_server_port_with_base(NULL, socket, flags, cb, user_data);
+}
+
+/* exported function */
+void
+evdns_close_server_port(struct evdns_server_port *port)
+{
+ EVDNS_LOCK(port);
+ if (--port->refcnt == 0) {
+ EVDNS_UNLOCK(port);
+ server_port_free(port);
+ } else {
+ port->closing = 1;
+ }
+}
+
+/* exported function */
+int
+evdns_server_request_add_reply(struct evdns_server_request *req_, int section, const char *name, int type, int class, int ttl, int datalen, int is_name, const char *data)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ struct server_reply_item **itemp, *item;
+ int *countp;
+ int result = -1;
+
+ EVDNS_LOCK(req->port);
+ if (req->response) /* have we already answered? */
+ goto done;
+
+ switch (section) {
+ case EVDNS_ANSWER_SECTION:
+ itemp = &req->answer;
+ countp = &req->n_answer;
+ break;
+ case EVDNS_AUTHORITY_SECTION:
+ itemp = &req->authority;
+ countp = &req->n_authority;
+ break;
+ case EVDNS_ADDITIONAL_SECTION:
+ itemp = &req->additional;
+ countp = &req->n_additional;
+ break;
+ default:
+ goto done;
+ }
+ while (*itemp) {
+ itemp = &((*itemp)->next);
+ }
+ item = mm_malloc(sizeof(struct server_reply_item));
+ if (!item)
+ goto done;
+ item->next = NULL;
+ if (!(item->name = mm_strdup(name))) {
+ mm_free(item);
+ goto done;
+ }
+ item->type = type;
+ item->dns_question_class = class;
+ item->ttl = ttl;
+ item->is_name = is_name != 0;
+ item->datalen = 0;
+ item->data = NULL;
+ if (data) {
+ if (item->is_name) {
+ if (!(item->data = mm_strdup(data))) {
+ mm_free(item->name);
+ mm_free(item);
+ goto done;
+ }
+ item->datalen = (u16)-1;
+ } else {
+ if (!(item->data = mm_malloc(datalen))) {
+ mm_free(item->name);
+ mm_free(item);
+ goto done;
+ }
+ item->datalen = datalen;
+ memcpy(item->data, data, datalen);
+ }
+ }
+
+ *itemp = item;
+ ++(*countp);
+ result = 0;
+done:
+ EVDNS_UNLOCK(req->port);
+ return result;
+}
+
+/* exported function */
+int
+evdns_server_request_add_a_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl)
+{
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, name, TYPE_A, CLASS_INET,
+ ttl, n*4, 0, addrs);
+}
+
+/* exported function */
+int
+evdns_server_request_add_aaaa_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl)
+{
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, name, TYPE_AAAA, CLASS_INET,
+ ttl, n*16, 0, addrs);
+}
+
+/* exported function */
+int
+evdns_server_request_add_ptr_reply(struct evdns_server_request *req, struct in_addr *in, const char *inaddr_name, const char *hostname, int ttl)
+{
+ u32 a;
+ char buf[32];
+ if (in && inaddr_name)
+ return -1;
+ else if (!in && !inaddr_name)
+ return -1;
+ if (in) {
+ a = ntohl(in->s_addr);
+ evutil_snprintf(buf, sizeof(buf), "%d.%d.%d.%d.in-addr.arpa",
+ (int)(u8)((a )&0xff),
+ (int)(u8)((a>>8 )&0xff),
+ (int)(u8)((a>>16)&0xff),
+ (int)(u8)((a>>24)&0xff));
+ inaddr_name = buf;
+ }
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, inaddr_name, TYPE_PTR, CLASS_INET,
+ ttl, -1, 1, hostname);
+}
+
+/* exported function */
+int
+evdns_server_request_add_cname_reply(struct evdns_server_request *req, const char *name, const char *cname, int ttl)
+{
+ return evdns_server_request_add_reply(
+ req, EVDNS_ANSWER_SECTION, name, TYPE_CNAME, CLASS_INET,
+ ttl, -1, 1, cname);
+}
+
+/* exported function */
+void
+evdns_server_request_set_flags(struct evdns_server_request *exreq, int flags)
+{
+ struct server_request *req = TO_SERVER_REQUEST(exreq);
+ req->base.flags &= ~(EVDNS_FLAGS_AA|EVDNS_FLAGS_RD);
+ req->base.flags |= flags;
+}
+
+static int
+evdns_server_request_format_response(struct server_request *req, int err)
+{
+ unsigned char buf[1500];
+ size_t buf_len = sizeof(buf);
+ off_t j = 0, r;
+ u16 t_;
+ u32 t32_;
+ int i;
+ u16 flags;
+ struct dnslabel_table table;
+
+ if (err < 0 || err > 15) return -1;
+
+ /* Set response bit and error code; copy OPCODE and RD fields from
+ * question; copy RA and AA if set by caller. */
+ flags = req->base.flags;
+ flags |= (0x8000 | err);
+
+ dnslabel_table_init(&table);
+ APPEND16(req->trans_id);
+ APPEND16(flags);
+ APPEND16(req->base.nquestions);
+ APPEND16(req->n_answer);
+ APPEND16(req->n_authority);
+ APPEND16(req->n_additional);
+
+ /* Add questions. */
+ for (i=0; i < req->base.nquestions; ++i) {
+ const char *s = req->base.questions[i]->name;
+ j = dnsname_to_labels(buf, buf_len, j, s, strlen(s), &table);
+ if (j < 0) {
+ dnslabel_clear(&table);
+ return (int) j;
+ }
+ APPEND16(req->base.questions[i]->type);
+ APPEND16(req->base.questions[i]->dns_question_class);
+ }
+
+ /* Add answer, authority, and additional sections. */
+ for (i=0; i<3; ++i) {
+ struct server_reply_item *item;
+ if (i==0)
+ item = req->answer;
+ else if (i==1)
+ item = req->authority;
+ else
+ item = req->additional;
+ while (item) {
+ r = dnsname_to_labels(buf, buf_len, j, item->name, strlen(item->name), &table);
+ if (r < 0)
+ goto overflow;
+ j = r;
+
+ APPEND16(item->type);
+ APPEND16(item->dns_question_class);
+ APPEND32(item->ttl);
+ if (item->is_name) {
+ off_t len_idx = j, name_start;
+ j += 2;
+ name_start = j;
+ r = dnsname_to_labels(buf, buf_len, j, item->data, strlen(item->data), &table);
+ if (r < 0)
+ goto overflow;
+ j = r;
+ t_ = htons( (short) (j-name_start) );
+ memcpy(buf+len_idx, &t_, 2);
+ } else {
+ APPEND16(item->datalen);
+ if (j+item->datalen > (off_t)buf_len)
+ goto overflow;
+ memcpy(buf+j, item->data, item->datalen);
+ j += item->datalen;
+ }
+ item = item->next;
+ }
+ }
+
+ if (j > 512) {
+overflow:
+ j = 512;
+ buf[2] |= 0x02; /* set the truncated bit. */
+ }
+
+ req->response_len = j;
+
+ if (!(req->response = mm_malloc(req->response_len))) {
+ server_request_free_answers(req);
+ dnslabel_clear(&table);
+ return (-1);
+ }
+ memcpy(req->response, buf, req->response_len);
+ server_request_free_answers(req);
+ dnslabel_clear(&table);
+ return (0);
+}
+
+/* exported function */
+int
+evdns_server_request_respond(struct evdns_server_request *req_, int err)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ struct evdns_server_port *port = req->port;
+ int r = -1;
+
+ EVDNS_LOCK(port);
+ if (!req->response) {
+ if ((r = evdns_server_request_format_response(req, err))<0)
+ goto done;
+ }
+
+ r = sendto(port->socket, req->response, (int)req->response_len, 0,
+ (struct sockaddr*) &req->addr, (ev_socklen_t)req->addrlen);
+ if (r<0) {
+ int sock_err = evutil_socket_geterror(port->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(sock_err))
+ goto done;
+
+ if (port->pending_replies) {
+ req->prev_pending = port->pending_replies->prev_pending;
+ req->next_pending = port->pending_replies;
+ req->prev_pending->next_pending =
+ req->next_pending->prev_pending = req;
+ } else {
+ req->prev_pending = req->next_pending = req;
+ port->pending_replies = req;
+ port->choked = 1;
+
+ (void) event_del(&port->event);
+ event_assign(&port->event, port->event_base, port->socket, (port->closing?0:EV_READ) | EV_WRITE | EV_PERSIST, server_port_ready_callback, port);
+
+ if (event_add(&port->event, NULL) < 0) {
+ log(EVDNS_LOG_WARN, "Error from libevent when adding event for DNS server");
+ }
+
+ }
+
+ r = 1;
+ goto done;
+ }
+ if (server_request_free(req)) {
+ r = 0;
+ goto done;
+ }
+
+ if (port->pending_replies)
+ server_port_flush(port);
+
+ r = 0;
+done:
+ EVDNS_UNLOCK(port);
+ return r;
+}
+
+/* Free all storage held by RRs in req. */
+static void
+server_request_free_answers(struct server_request *req)
+{
+ struct server_reply_item *victim, *next, **list;
+ int i;
+ for (i = 0; i < 3; ++i) {
+ if (i==0)
+ list = &req->answer;
+ else if (i==1)
+ list = &req->authority;
+ else
+ list = &req->additional;
+
+ victim = *list;
+ while (victim) {
+ next = victim->next;
+ mm_free(victim->name);
+ if (victim->data)
+ mm_free(victim->data);
+ mm_free(victim);
+ victim = next;
+ }
+ *list = NULL;
+ }
+}
+
+/* Free all storage held by req, and remove links to it. */
+/* return true iff we just wound up freeing the server_port. */
+static int
+server_request_free(struct server_request *req)
+{
+ int i, rc=1, lock=0;
+ if (req->base.questions) {
+ for (i = 0; i < req->base.nquestions; ++i)
+ mm_free(req->base.questions[i]);
+ mm_free(req->base.questions);
+ }
+
+ if (req->port) {
+ EVDNS_LOCK(req->port);
+ lock=1;
+ if (req->port->pending_replies == req) {
+ if (req->next_pending && req->next_pending != req)
+ req->port->pending_replies = req->next_pending;
+ else
+ req->port->pending_replies = NULL;
+ }
+ rc = --req->port->refcnt;
+ }
+
+ if (req->response) {
+ mm_free(req->response);
+ }
+
+ server_request_free_answers(req);
+
+ if (req->next_pending && req->next_pending != req) {
+ req->next_pending->prev_pending = req->prev_pending;
+ req->prev_pending->next_pending = req->next_pending;
+ }
+
+ if (rc == 0) {
+ EVDNS_UNLOCK(req->port); /* ????? nickm */
+ server_port_free(req->port);
+ mm_free(req);
+ return (1);
+ }
+ if (lock)
+ EVDNS_UNLOCK(req->port);
+ mm_free(req);
+ return (0);
+}
+
+/* Free all storage held by an evdns_server_port. Only called when */
+static void
+server_port_free(struct evdns_server_port *port)
+{
+ EVUTIL_ASSERT(port);
+ EVUTIL_ASSERT(!port->refcnt);
+ EVUTIL_ASSERT(!port->pending_replies);
+ if (port->socket > 0) {
+ evutil_closesocket(port->socket);
+ port->socket = -1;
+ }
+ (void) event_del(&port->event);
+ event_debug_unassign(&port->event);
+ EVTHREAD_FREE_LOCK(port->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(port);
+}
+
+/* exported function */
+int
+evdns_server_request_drop(struct evdns_server_request *req_)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ server_request_free(req);
+ return 0;
+}
+
+/* exported function */
+int
+evdns_server_request_get_requesting_addr(struct evdns_server_request *req_, struct sockaddr *sa, int addr_len)
+{
+ struct server_request *req = TO_SERVER_REQUEST(req_);
+ if (addr_len < (int)req->addrlen)
+ return -1;
+ memcpy(sa, &(req->addr), req->addrlen);
+ return req->addrlen;
+}
+
+#undef APPEND16
+#undef APPEND32
+
+/* this is a libevent callback function which is called when a request */
+/* has timed out. */
+static void
+evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) {
+ struct request *const req = (struct request *) arg;
+ struct evdns_base *base = req->base;
+
+ (void) fd;
+ (void) events;
+
+ log(EVDNS_LOG_DEBUG, "Request %p timed out", arg);
+ EVDNS_LOCK(base);
+
+ req->ns->timedout++;
+ if (req->ns->timedout > req->base->global_max_nameserver_timeout) {
+ req->ns->timedout = 0;
+ nameserver_failed(req->ns, "request timed out.");
+ }
+
+ if (req->tx_count >= req->base->global_max_retransmits) {
+ /* this request has failed */
+ log(EVDNS_LOG_DEBUG, "Giving up on request %p; tx_count==%d",
+ arg, req->tx_count);
+ reply_schedule_callback(req, 0, DNS_ERR_TIMEOUT, NULL);
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
+ } else {
+ /* retransmit it */
+ struct nameserver *new_ns;
+ log(EVDNS_LOG_DEBUG, "Retransmitting request %p; tx_count==%d",
+ arg, req->tx_count);
+ (void) evtimer_del(&req->timeout_event);
+ new_ns = nameserver_pick(base);
+ if (new_ns)
+ req->ns = new_ns;
+ evdns_request_transmit(req);
+ }
+ EVDNS_UNLOCK(base);
+}
+
+/* try to send a request to a given server. */
+/* */
+/* return: */
+/* 0 ok */
+/* 1 temporary failure */
+/* 2 other failure */
+static int
+evdns_request_transmit_to(struct request *req, struct nameserver *server) {
+ int r;
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+
+ if (server->requests_inflight == 1 &&
+ req->base->disable_when_inactive &&
+ event_add(&server->event, NULL) < 0) {
+ return 1;
+ }
+
+ r = sendto(server->socket, (void*)req->request, req->request_len, 0,
+ (struct sockaddr *)&server->address, server->addrlen);
+ if (r < 0) {
+ int err = evutil_socket_geterror(server->socket);
+ if (EVUTIL_ERR_RW_RETRIABLE(err))
+ return 1;
+ nameserver_failed(req->ns, evutil_socket_error_to_string(err));
+ return 2;
+ } else if (r != (int)req->request_len) {
+ return 1; /* short write */
+ } else {
+ return 0;
+ }
+}
+
+/* try to send a request, updating the fields of the request */
+/* as needed */
+/* */
+/* return: */
+/* 0 ok */
+/* 1 failed */
+static int
+evdns_request_transmit(struct request *req) {
+ int retcode = 0, r;
+
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+ /* if we fail to send this packet then this flag marks it */
+ /* for evdns_transmit */
+ req->transmit_me = 1;
+ EVUTIL_ASSERT(req->trans_id != 0xffff);
+
+ if (!req->ns)
+ {
+ /* unable to transmit request if no nameservers */
+ return 1;
+ }
+
+ if (req->ns->choked) {
+ /* don't bother trying to write to a socket */
+ /* which we have had EAGAIN from */
+ return 1;
+ }
+
+ r = evdns_request_transmit_to(req, req->ns);
+ switch (r) {
+ case 1:
+ /* temp failure */
+ req->ns->choked = 1;
+ nameserver_write_waiting(req->ns, 1);
+ return 1;
+ case 2:
+ /* failed to transmit the request entirely. */
+ retcode = 1;
+ /* fall through: we'll set a timeout, which will time out,
+ * and make us retransmit the request anyway. */
+ default:
+ /* all ok */
+ log(EVDNS_LOG_DEBUG,
+ "Setting timeout for request %p, sent to nameserver %p", req, req->ns);
+ if (evtimer_add(&req->timeout_event, &req->base->global_timeout) < 0) {
+ log(EVDNS_LOG_WARN,
+ "Error from libevent when adding timer for request %p",
+ req);
+ /* ???? Do more? */
+ }
+ req->tx_count++;
+ req->transmit_me = 0;
+ return retcode;
+ }
+}
+
+static void
+nameserver_probe_callback(int result, char type, int count, int ttl, void *addresses, void *arg) {
+ struct nameserver *const ns = (struct nameserver *) arg;
+ (void) type;
+ (void) count;
+ (void) ttl;
+ (void) addresses;
+
+ if (result == DNS_ERR_CANCEL) {
+ /* We canceled this request because the nameserver came up
+ * for some other reason. Do not change our opinion about
+ * the nameserver. */
+ return;
+ }
+
+ EVDNS_LOCK(ns->base);
+ ns->probe_request = NULL;
+ if (result == DNS_ERR_NONE || result == DNS_ERR_NOTEXIST) {
+ /* this is a good reply */
+ nameserver_up(ns);
+ } else {
+ nameserver_probe_failed(ns);
+ }
+ EVDNS_UNLOCK(ns->base);
+}
+
+static void
+nameserver_send_probe(struct nameserver *const ns) {
+ struct evdns_request *handle;
+ struct request *req;
+ char addrbuf[128];
+ /* here we need to send a probe to a given nameserver */
+ /* in the hope that it is up now. */
+
+ ASSERT_LOCKED(ns->base);
+ log(EVDNS_LOG_DEBUG, "Sending probe to %s",
+ evutil_format_sockaddr_port_(
+ (struct sockaddr *)&ns->address,
+ addrbuf, sizeof(addrbuf)));
+ handle = mm_calloc(1, sizeof(*handle));
+ if (!handle) return;
+ req = request_new(ns->base, handle, TYPE_A, "google.com", DNS_QUERY_NO_SEARCH, nameserver_probe_callback, ns);
+ if (!req) {
+ mm_free(handle);
+ return;
+ }
+ ns->probe_request = handle;
+ /* we force this into the inflight queue no matter what */
+ request_trans_id_set(req, transaction_id_pick(ns->base));
+ req->ns = ns;
+ request_submit(req);
+}
+
+/* returns: */
+/* 0 didn't try to transmit anything */
+/* 1 tried to transmit something */
+static int
+evdns_transmit(struct evdns_base *base) {
+ char did_try_to_transmit = 0;
+ int i;
+
+ ASSERT_LOCKED(base);
+ for (i = 0; i < base->n_req_heads; ++i) {
+ if (base->req_heads[i]) {
+ struct request *const started_at = base->req_heads[i], *req = started_at;
+ /* first transmit all the requests which are currently waiting */
+ do {
+ if (req->transmit_me) {
+ did_try_to_transmit = 1;
+ evdns_request_transmit(req);
+ }
+
+ req = req->next;
+ } while (req != started_at);
+ }
+ }
+
+ return did_try_to_transmit;
+}
+
+/* exported function */
+int
+evdns_base_count_nameservers(struct evdns_base *base)
+{
+ const struct nameserver *server;
+ int n = 0;
+
+ EVDNS_LOCK(base);
+ server = base->server_head;
+ if (!server)
+ goto done;
+ do {
+ ++n;
+ server = server->next;
+ } while (server != base->server_head);
+done:
+ EVDNS_UNLOCK(base);
+ return n;
+}
+
+int
+evdns_count_nameservers(void)
+{
+ return evdns_base_count_nameservers(current_base);
+}
+
+/* exported function */
+int
+evdns_base_clear_nameservers_and_suspend(struct evdns_base *base)
+{
+ struct nameserver *server, *started_at;
+ int i;
+
+ EVDNS_LOCK(base);
+ server = base->server_head;
+ started_at = base->server_head;
+ if (!server) {
+ EVDNS_UNLOCK(base);
+ return 0;
+ }
+ while (1) {
+ struct nameserver *next = server->next;
+ (void) event_del(&server->event);
+ if (evtimer_initialized(&server->timeout_event))
+ (void) evtimer_del(&server->timeout_event);
+ if (server->probe_request) {
+ evdns_cancel_request(server->base, server->probe_request);
+ server->probe_request = NULL;
+ }
+ if (server->socket >= 0)
+ evutil_closesocket(server->socket);
+ mm_free(server);
+ if (next == started_at)
+ break;
+ server = next;
+ }
+ base->server_head = NULL;
+ base->global_good_nameservers = 0;
+
+ for (i = 0; i < base->n_req_heads; ++i) {
+ struct request *req, *req_started_at;
+ req = req_started_at = base->req_heads[i];
+ while (req) {
+ struct request *next = req->next;
+ req->tx_count = req->reissue_count = 0;
+ req->ns = NULL;
+ /* ???? What to do about searches? */
+ (void) evtimer_del(&req->timeout_event);
+ req->trans_id = 0;
+ req->transmit_me = 0;
+
+ base->global_requests_waiting++;
+ evdns_request_insert(req, &base->req_waiting_head);
+ /* We want to insert these suspended elements at the front of
+ * the waiting queue, since they were pending before any of
+ * the waiting entries were added. This is a circular list,
+ * so we can just shift the start back by one.*/
+ base->req_waiting_head = base->req_waiting_head->prev;
+
+ if (next == req_started_at)
+ break;
+ req = next;
+ }
+ base->req_heads[i] = NULL;
+ }
+
+ base->global_requests_inflight = 0;
+
+ EVDNS_UNLOCK(base);
+ return 0;
+}
+
+int
+evdns_clear_nameservers_and_suspend(void)
+{
+ return evdns_base_clear_nameservers_and_suspend(current_base);
+}
+
+
+/* exported function */
+int
+evdns_base_resume(struct evdns_base *base)
+{
+ EVDNS_LOCK(base);
+ evdns_requests_pump_waiting_queue(base);
+ EVDNS_UNLOCK(base);
+
+ return 0;
+}
+
+int
+evdns_resume(void)
+{
+ return evdns_base_resume(current_base);
+}
+
+static int
+evdns_nameserver_add_impl_(struct evdns_base *base, const struct sockaddr *address, int addrlen) {
+ /* first check to see if we already have this nameserver */
+
+ const struct nameserver *server = base->server_head, *const started_at = base->server_head;
+ struct nameserver *ns;
+ int err = 0;
+ char addrbuf[128];
+
+ ASSERT_LOCKED(base);
+ if (server) {
+ do {
+ if (!evutil_sockaddr_cmp((struct sockaddr*)&server->address, address, 1)) return 3;
+ server = server->next;
+ } while (server != started_at);
+ }
+ if (addrlen > (int)sizeof(ns->address)) {
+ log(EVDNS_LOG_DEBUG, "Addrlen %d too long.", (int)addrlen);
+ return 2;
+ }
+
+ ns = (struct nameserver *) mm_malloc(sizeof(struct nameserver));
+ if (!ns) return -1;
+
+ memset(ns, 0, sizeof(struct nameserver));
+ ns->base = base;
+
+ evtimer_assign(&ns->timeout_event, ns->base->event_base, nameserver_prod_callback, ns);
+
+ ns->socket = evutil_socket_(address->sa_family,
+ SOCK_DGRAM|EVUTIL_SOCK_NONBLOCK|EVUTIL_SOCK_CLOEXEC, 0);
+ if (ns->socket < 0) { err = 1; goto out1; }
+
+ if (base->global_outgoing_addrlen &&
+ !evutil_sockaddr_is_loopback_(address)) {
+ if (bind(ns->socket,
+ (struct sockaddr*)&base->global_outgoing_address,
+ base->global_outgoing_addrlen) < 0) {
+ log(EVDNS_LOG_WARN,"Couldn't bind to outgoing address");
+ err = 2;
+ goto out2;
+ }
+ }
+
+ memcpy(&ns->address, address, addrlen);
+ ns->addrlen = addrlen;
+ ns->state = 1;
+ event_assign(&ns->event, ns->base->event_base, ns->socket,
+ EV_READ | EV_PERSIST, nameserver_ready_callback, ns);
+ if (!base->disable_when_inactive && event_add(&ns->event, NULL) < 0) {
+ err = 2;
+ goto out2;
+ }
+
+ log(EVDNS_LOG_DEBUG, "Added nameserver %s as %p",
+ evutil_format_sockaddr_port_(address, addrbuf, sizeof(addrbuf)), ns);
+
+ /* insert this nameserver into the list of them */
+ if (!base->server_head) {
+ ns->next = ns->prev = ns;
+ base->server_head = ns;
+ } else {
+ ns->next = base->server_head->next;
+ ns->prev = base->server_head;
+ base->server_head->next = ns;
+ ns->next->prev = ns;
+ }
+
+ base->global_good_nameservers++;
+
+ return 0;
+
+out2:
+ evutil_closesocket(ns->socket);
+out1:
+ event_debug_unassign(&ns->event);
+ mm_free(ns);
+ log(EVDNS_LOG_WARN, "Unable to add nameserver %s: error %d",
+ evutil_format_sockaddr_port_(address, addrbuf, sizeof(addrbuf)), err);
+ return err;
+}
+
+/* exported function */
+int
+evdns_base_nameserver_add(struct evdns_base *base, unsigned long int address)
+{
+ struct sockaddr_in sin;
+ int res;
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_addr.s_addr = address;
+ sin.sin_port = htons(53);
+ sin.sin_family = AF_INET;
+ EVDNS_LOCK(base);
+ res = evdns_nameserver_add_impl_(base, (struct sockaddr*)&sin, sizeof(sin));
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+int
+evdns_nameserver_add(unsigned long int address) {
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_nameserver_add(current_base, address);
+}
+
+static void
+sockaddr_setport(struct sockaddr *sa, ev_uint16_t port)
+{
+ if (sa->sa_family == AF_INET) {
+ ((struct sockaddr_in *)sa)->sin_port = htons(port);
+ } else if (sa->sa_family == AF_INET6) {
+ ((struct sockaddr_in6 *)sa)->sin6_port = htons(port);
+ }
+}
+
+static ev_uint16_t
+sockaddr_getport(struct sockaddr *sa)
+{
+ if (sa->sa_family == AF_INET) {
+ return ntohs(((struct sockaddr_in *)sa)->sin_port);
+ } else if (sa->sa_family == AF_INET6) {
+ return ntohs(((struct sockaddr_in6 *)sa)->sin6_port);
+ } else {
+ return 0;
+ }
+}
+
+/* exported function */
+int
+evdns_base_nameserver_ip_add(struct evdns_base *base, const char *ip_as_string) {
+ struct sockaddr_storage ss;
+ struct sockaddr *sa;
+ int len = sizeof(ss);
+ int res;
+ if (evutil_parse_sockaddr_port(ip_as_string, (struct sockaddr *)&ss,
+ &len)) {
+ log(EVDNS_LOG_WARN, "Unable to parse nameserver address %s",
+ ip_as_string);
+ return 4;
+ }
+ sa = (struct sockaddr *) &ss;
+ if (sockaddr_getport(sa) == 0)
+ sockaddr_setport(sa, 53);
+
+ EVDNS_LOCK(base);
+ res = evdns_nameserver_add_impl_(base, sa, len);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+int
+evdns_nameserver_ip_add(const char *ip_as_string) {
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_nameserver_ip_add(current_base, ip_as_string);
+}
+
+int
+evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
+ const struct sockaddr *sa, ev_socklen_t len, unsigned flags)
+{
+ int res;
+ EVUTIL_ASSERT(base);
+ EVDNS_LOCK(base);
+ res = evdns_nameserver_add_impl_(base, sa, len);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+/* remove from the queue */
+static void
+evdns_request_remove(struct request *req, struct request **head)
+{
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+
+#if 0
+ {
+ struct request *ptr;
+ int found = 0;
+ EVUTIL_ASSERT(*head != NULL);
+
+ ptr = *head;
+ do {
+ if (ptr == req) {
+ found = 1;
+ break;
+ }
+ ptr = ptr->next;
+ } while (ptr != *head);
+ EVUTIL_ASSERT(found);
+
+ EVUTIL_ASSERT(req->next);
+ }
+#endif
+
+ if (req->next == req) {
+ /* only item in the list */
+ *head = NULL;
+ } else {
+ req->next->prev = req->prev;
+ req->prev->next = req->next;
+ if (*head == req) *head = req->next;
+ }
+ req->next = req->prev = NULL;
+}
+
+/* insert into the tail of the queue */
+static void
+evdns_request_insert(struct request *req, struct request **head) {
+ ASSERT_LOCKED(req->base);
+ ASSERT_VALID_REQUEST(req);
+ if (!*head) {
+ *head = req;
+ req->next = req->prev = req;
+ return;
+ }
+
+ req->prev = (*head)->prev;
+ req->prev->next = req;
+ req->next = *head;
+ (*head)->prev = req;
+}
+
+static int
+string_num_dots(const char *s) {
+ int count = 0;
+ while ((s = strchr(s, '.'))) {
+ s++;
+ count++;
+ }
+ return count;
+}
+
+static struct request *
+request_new(struct evdns_base *base, struct evdns_request *handle, int type,
+ const char *name, int flags, evdns_callback_type callback,
+ void *user_ptr) {
+
+ const char issuing_now =
+ (base->global_requests_inflight < base->global_max_requests_inflight) ? 1 : 0;
+
+ const size_t name_len = strlen(name);
+ const size_t request_max_len = evdns_request_len(name_len);
+ const u16 trans_id = issuing_now ? transaction_id_pick(base) : 0xffff;
+ /* the request data is alloced in a single block with the header */
+ struct request *const req =
+ mm_malloc(sizeof(struct request) + request_max_len);
+ int rlen;
+ char namebuf[256];
+ (void) flags;
+
+ ASSERT_LOCKED(base);
+
+ if (!req) return NULL;
+
+ if (name_len >= sizeof(namebuf)) {
+ mm_free(req);
+ return NULL;
+ }
+
+ memset(req, 0, sizeof(struct request));
+ req->base = base;
+
+ evtimer_assign(&req->timeout_event, req->base->event_base, evdns_request_timeout_callback, req);
+
+ if (base->global_randomize_case) {
+ unsigned i;
+ char randbits[(sizeof(namebuf)+7)/8];
+ strlcpy(namebuf, name, sizeof(namebuf));
+ evutil_secure_rng_get_bytes(randbits, (name_len+7)/8);
+ for (i = 0; i < name_len; ++i) {
+ if (EVUTIL_ISALPHA_(namebuf[i])) {
+ if ((randbits[i >> 3] & (1<<(i & 7))))
+ namebuf[i] |= 0x20;
+ else
+ namebuf[i] &= ~0x20;
+ }
+ }
+ name = namebuf;
+ }
+
+ /* request data lives just after the header */
+ req->request = ((u8 *) req) + sizeof(struct request);
+ /* denotes that the request data shouldn't be free()ed */
+ req->request_appended = 1;
+ rlen = evdns_request_data_build(name, name_len, trans_id,
+ type, CLASS_INET, req->request, request_max_len);
+ if (rlen < 0)
+ goto err1;
+
+ req->request_len = rlen;
+ req->trans_id = trans_id;
+ req->tx_count = 0;
+ req->request_type = type;
+ req->user_pointer = user_ptr;
+ req->user_callback = callback;
+ req->ns = issuing_now ? nameserver_pick(base) : NULL;
+ req->next = req->prev = NULL;
+ req->handle = handle;
+ if (handle) {
+ handle->current_req = req;
+ handle->base = base;
+ }
+
+ return req;
+err1:
+ mm_free(req);
+ return NULL;
+}
+
+static void
+request_submit(struct request *const req) {
+ struct evdns_base *base = req->base;
+ ASSERT_LOCKED(base);
+ ASSERT_VALID_REQUEST(req);
+ if (req->ns) {
+ /* if it has a nameserver assigned then this is going */
+ /* straight into the inflight queue */
+ evdns_request_insert(req, &REQ_HEAD(base, req->trans_id));
+
+ base->global_requests_inflight++;
+ req->ns->requests_inflight++;
+
+ evdns_request_transmit(req);
+ } else {
+ evdns_request_insert(req, &base->req_waiting_head);
+ base->global_requests_waiting++;
+ }
+}
+
+/* exported function */
+void
+evdns_cancel_request(struct evdns_base *base, struct evdns_request *handle)
+{
+ struct request *req;
+
+ if (!handle->current_req)
+ return;
+
+ if (!base) {
+ /* This redundancy is silly; can we fix it? (Not for 2.0) XXXX */
+ base = handle->base;
+ if (!base)
+ base = handle->current_req->base;
+ }
+
+ EVDNS_LOCK(base);
+ if (handle->pending_cb) {
+ EVDNS_UNLOCK(base);
+ return;
+ }
+
+ req = handle->current_req;
+ ASSERT_VALID_REQUEST(req);
+
+ reply_schedule_callback(req, 0, DNS_ERR_CANCEL, NULL);
+ if (req->ns) {
+ /* remove from inflight queue */
+ request_finished(req, &REQ_HEAD(base, req->trans_id), 1);
+ } else {
+ /* remove from global_waiting head */
+ request_finished(req, &base->req_waiting_head, 1);
+ }
+ EVDNS_UNLOCK(base);
+}
+
+/* exported function */
+struct evdns_request *
+evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags,
+ evdns_callback_type callback, void *ptr) {
+ struct evdns_request *handle;
+ struct request *req;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s", name);
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ EVDNS_LOCK(base);
+ if (flags & DNS_QUERY_NO_SEARCH) {
+ req =
+ request_new(base, handle, TYPE_A, name, flags,
+ callback, ptr);
+ if (req)
+ request_submit(req);
+ } else {
+ search_request_new(base, handle, TYPE_A, name, flags,
+ callback, ptr);
+ }
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return handle;
+}
+
+int evdns_resolve_ipv4(const char *name, int flags,
+ evdns_callback_type callback, void *ptr)
+{
+ return evdns_base_resolve_ipv4(current_base, name, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+
+/* exported function */
+struct evdns_request *
+evdns_base_resolve_ipv6(struct evdns_base *base,
+ const char *name, int flags,
+ evdns_callback_type callback, void *ptr)
+{
+ struct evdns_request *handle;
+ struct request *req;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s", name);
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ EVDNS_LOCK(base);
+ if (flags & DNS_QUERY_NO_SEARCH) {
+ req = request_new(base, handle, TYPE_AAAA, name, flags,
+ callback, ptr);
+ if (req)
+ request_submit(req);
+ } else {
+ search_request_new(base, handle, TYPE_AAAA, name, flags,
+ callback, ptr);
+ }
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return handle;
+}
+
+int evdns_resolve_ipv6(const char *name, int flags,
+ evdns_callback_type callback, void *ptr) {
+ return evdns_base_resolve_ipv6(current_base, name, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+struct evdns_request *
+evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ char buf[32];
+ struct evdns_request *handle;
+ struct request *req;
+ u32 a;
+ EVUTIL_ASSERT(in);
+ a = ntohl(in->s_addr);
+ evutil_snprintf(buf, sizeof(buf), "%d.%d.%d.%d.in-addr.arpa",
+ (int)(u8)((a )&0xff),
+ (int)(u8)((a>>8 )&0xff),
+ (int)(u8)((a>>16)&0xff),
+ (int)(u8)((a>>24)&0xff));
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s (reverse)", buf);
+ EVDNS_LOCK(base);
+ req = request_new(base, handle, TYPE_PTR, buf, flags, callback, ptr);
+ if (req)
+ request_submit(req);
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return (handle);
+}
+
+int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ return evdns_base_resolve_reverse(current_base, in, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+struct evdns_request *
+evdns_base_resolve_reverse_ipv6(struct evdns_base *base, const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ /* 32 nybbles, 32 periods, "ip6.arpa", NUL. */
+ char buf[73];
+ char *cp;
+ struct evdns_request *handle;
+ struct request *req;
+ int i;
+ EVUTIL_ASSERT(in);
+ cp = buf;
+ for (i=15; i >= 0; --i) {
+ u8 byte = in->s6_addr[i];
+ *cp++ = "0123456789abcdef"[byte & 0x0f];
+ *cp++ = '.';
+ *cp++ = "0123456789abcdef"[byte >> 4];
+ *cp++ = '.';
+ }
+ EVUTIL_ASSERT(cp + strlen("ip6.arpa") < buf+sizeof(buf));
+ memcpy(cp, "ip6.arpa", strlen("ip6.arpa")+1);
+ handle = mm_calloc(1, sizeof(*handle));
+ if (handle == NULL)
+ return NULL;
+ log(EVDNS_LOG_DEBUG, "Resolve requested for %s (reverse)", buf);
+ EVDNS_LOCK(base);
+ req = request_new(base, handle, TYPE_PTR, buf, flags, callback, ptr);
+ if (req)
+ request_submit(req);
+ if (handle->current_req == NULL) {
+ mm_free(handle);
+ handle = NULL;
+ }
+ EVDNS_UNLOCK(base);
+ return (handle);
+}
+
+int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr) {
+ return evdns_base_resolve_reverse_ipv6(current_base, in, flags, callback, ptr)
+ ? 0 : -1;
+}
+
+/* ================================================================= */
+/* Search support */
+/* */
+/* the libc resolver has support for searching a number of domains */
+/* to find a name. If nothing else then it takes the single domain */
+/* from the gethostname() call. */
+/* */
+/* It can also be configured via the domain and search options in a */
+/* resolv.conf. */
+/* */
+/* The ndots option controls how many dots it takes for the resolver */
+/* to decide that a name is non-local and so try a raw lookup first. */
+
+struct search_domain {
+ int len;
+ struct search_domain *next;
+ /* the text string is appended to this structure */
+};
+
+struct search_state {
+ int refcount;
+ int ndots;
+ int num_domains;
+ struct search_domain *head;
+};
+
+static void
+search_state_decref(struct search_state *const state) {
+ if (!state) return;
+ state->refcount--;
+ if (!state->refcount) {
+ struct search_domain *next, *dom;
+ for (dom = state->head; dom; dom = next) {
+ next = dom->next;
+ mm_free(dom);
+ }
+ mm_free(state);
+ }
+}
+
+static struct search_state *
+search_state_new(void) {
+ struct search_state *state = (struct search_state *) mm_malloc(sizeof(struct search_state));
+ if (!state) return NULL;
+ memset(state, 0, sizeof(struct search_state));
+ state->refcount = 1;
+ state->ndots = 1;
+
+ return state;
+}
+
+static void
+search_postfix_clear(struct evdns_base *base) {
+ search_state_decref(base->global_search_state);
+
+ base->global_search_state = search_state_new();
+}
+
+/* exported function */
+void
+evdns_base_search_clear(struct evdns_base *base)
+{
+ EVDNS_LOCK(base);
+ search_postfix_clear(base);
+ EVDNS_UNLOCK(base);
+}
+
+void
+evdns_search_clear(void) {
+ evdns_base_search_clear(current_base);
+}
+
+static void
+search_postfix_add(struct evdns_base *base, const char *domain) {
+ size_t domain_len;
+ struct search_domain *sdomain;
+ while (domain[0] == '.') domain++;
+ domain_len = strlen(domain);
+
+ ASSERT_LOCKED(base);
+ if (!base->global_search_state) base->global_search_state = search_state_new();
+ if (!base->global_search_state) return;
+ base->global_search_state->num_domains++;
+
+ sdomain = (struct search_domain *) mm_malloc(sizeof(struct search_domain) + domain_len);
+ if (!sdomain) return;
+ memcpy( ((u8 *) sdomain) + sizeof(struct search_domain), domain, domain_len);
+ sdomain->next = base->global_search_state->head;
+ sdomain->len = (int) domain_len;
+
+ base->global_search_state->head = sdomain;
+}
+
+/* reverse the order of members in the postfix list. This is needed because, */
+/* when parsing resolv.conf we push elements in the wrong order */
+static void
+search_reverse(struct evdns_base *base) {
+ struct search_domain *cur, *prev = NULL, *next;
+ ASSERT_LOCKED(base);
+ cur = base->global_search_state->head;
+ while (cur) {
+ next = cur->next;
+ cur->next = prev;
+ prev = cur;
+ cur = next;
+ }
+
+ base->global_search_state->head = prev;
+}
+
+/* exported function */
+void
+evdns_base_search_add(struct evdns_base *base, const char *domain) {
+ EVDNS_LOCK(base);
+ search_postfix_add(base, domain);
+ EVDNS_UNLOCK(base);
+}
+void
+evdns_search_add(const char *domain) {
+ evdns_base_search_add(current_base, domain);
+}
+
+/* exported function */
+void
+evdns_base_search_ndots_set(struct evdns_base *base, const int ndots) {
+ EVDNS_LOCK(base);
+ if (!base->global_search_state) base->global_search_state = search_state_new();
+ if (base->global_search_state)
+ base->global_search_state->ndots = ndots;
+ EVDNS_UNLOCK(base);
+}
+void
+evdns_search_ndots_set(const int ndots) {
+ evdns_base_search_ndots_set(current_base, ndots);
+}
+
+static void
+search_set_from_hostname(struct evdns_base *base) {
+ char hostname[HOST_NAME_MAX + 1], *domainname;
+
+ ASSERT_LOCKED(base);
+ search_postfix_clear(base);
+ if (gethostname(hostname, sizeof(hostname))) return;
+ domainname = strchr(hostname, '.');
+ if (!domainname) return;
+ search_postfix_add(base, domainname);
+}
+
+/* warning: returns malloced string */
+static char *
+search_make_new(const struct search_state *const state, int n, const char *const base_name) {
+ const size_t base_len = strlen(base_name);
+ const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+ struct search_domain *dom;
+
+ for (dom = state->head; dom; dom = dom->next) {
+ if (!n--) {
+ /* this is the postfix we want */
+ /* the actual postfix string is kept at the end of the structure */
+ const u8 *const postfix = ((u8 *) dom) + sizeof(struct search_domain);
+ const int postfix_len = dom->len;
+ char *const newname = (char *) mm_malloc(base_len + need_to_append_dot + postfix_len + 1);
+ if (!newname) return NULL;
+ memcpy(newname, base_name, base_len);
+ if (need_to_append_dot) newname[base_len] = '.';
+ memcpy(newname + base_len + need_to_append_dot, postfix, postfix_len);
+ newname[base_len + need_to_append_dot + postfix_len] = 0;
+ return newname;
+ }
+ }
+
+ /* we ran off the end of the list and still didn't find the requested string */
+ EVUTIL_ASSERT(0);
+ return NULL; /* unreachable; stops warnings in some compilers. */
+}
+
+static struct request *
+search_request_new(struct evdns_base *base, struct evdns_request *handle,
+ int type, const char *const name, int flags,
+ evdns_callback_type user_callback, void *user_arg) {
+ ASSERT_LOCKED(base);
+ EVUTIL_ASSERT(type == TYPE_A || type == TYPE_AAAA);
+ EVUTIL_ASSERT(handle->current_req == NULL);
+ if ( ((flags & DNS_QUERY_NO_SEARCH) == 0) &&
+ base->global_search_state &&
+ base->global_search_state->num_domains) {
+ /* we have some domains to search */
+ struct request *req;
+ if (string_num_dots(name) >= base->global_search_state->ndots) {
+ req = request_new(base, handle, type, name, flags, user_callback, user_arg);
+ if (!req) return NULL;
+ handle->search_index = -1;
+ } else {
+ char *const new_name = search_make_new(base->global_search_state, 0, name);
+ if (!new_name) return NULL;
+ req = request_new(base, handle, type, new_name, flags, user_callback, user_arg);
+ mm_free(new_name);
+ if (!req) return NULL;
+ handle->search_index = 0;
+ }
+ EVUTIL_ASSERT(handle->search_origname == NULL);
+ handle->search_origname = mm_strdup(name);
+ if (handle->search_origname == NULL) {
+ /* XXX Should we dealloc req? If yes, how? */
+ if (req)
+ mm_free(req);
+ return NULL;
+ }
+ handle->search_state = base->global_search_state;
+ handle->search_flags = flags;
+ base->global_search_state->refcount++;
+ request_submit(req);
+ return req;
+ } else {
+ struct request *const req = request_new(base, handle, type, name, flags, user_callback, user_arg);
+ if (!req) return NULL;
+ request_submit(req);
+ return req;
+ }
+}
+
+/* this is called when a request has failed to find a name. We need to check */
+/* if it is part of a search and, if so, try the next name in the list */
+/* returns: */
+/* 0 another request has been submitted */
+/* 1 no more requests needed */
+static int
+search_try_next(struct evdns_request *const handle) {
+ struct request *req = handle->current_req;
+ struct evdns_base *base = req->base;
+ struct request *newreq;
+ ASSERT_LOCKED(base);
+ if (handle->search_state) {
+ /* it is part of a search */
+ char *new_name;
+ handle->search_index++;
+ if (handle->search_index >= handle->search_state->num_domains) {
+ /* no more postfixes to try, however we may need to try */
+ /* this name without a postfix */
+ if (string_num_dots(handle->search_origname) < handle->search_state->ndots) {
+ /* yep, we need to try it raw */
+ newreq = request_new(base, NULL, req->request_type, handle->search_origname, handle->search_flags, req->user_callback, req->user_pointer);
+ log(EVDNS_LOG_DEBUG, "Search: trying raw query %s", handle->search_origname);
+ if (newreq) {
+ search_request_finished(handle);
+ goto submit_next;
+ }
+ }
+ return 1;
+ }
+
+ new_name = search_make_new(handle->search_state, handle->search_index, handle->search_origname);
+ if (!new_name) return 1;
+ log(EVDNS_LOG_DEBUG, "Search: now trying %s (%d)", new_name, handle->search_index);
+ newreq = request_new(base, NULL, req->request_type, new_name, handle->search_flags, req->user_callback, req->user_pointer);
+ mm_free(new_name);
+ if (!newreq) return 1;
+ goto submit_next;
+ }
+ return 1;
+
+submit_next:
+ request_finished(req, &REQ_HEAD(req->base, req->trans_id), 0);
+ handle->current_req = newreq;
+ newreq->handle = handle;
+ request_submit(newreq);
+ return 0;
+}
+
+static void
+search_request_finished(struct evdns_request *const handle) {
+ ASSERT_LOCKED(handle->current_req->base);
+ if (handle->search_state) {
+ search_state_decref(handle->search_state);
+ handle->search_state = NULL;
+ }
+ if (handle->search_origname) {
+ mm_free(handle->search_origname);
+ handle->search_origname = NULL;
+ }
+}
+
+/* ================================================================= */
+/* Parsing resolv.conf files */
+
+static void
+evdns_resolv_set_defaults(struct evdns_base *base, int flags) {
+ /* if the file isn't found then we assume a local resolver */
+ ASSERT_LOCKED(base);
+ if (flags & DNS_OPTION_SEARCH) search_set_from_hostname(base);
+ if (flags & DNS_OPTION_NAMESERVERS) evdns_base_nameserver_ip_add(base,"127.0.0.1");
+}
+
+#ifndef EVENT__HAVE_STRTOK_R
+static char *
+strtok_r(char *s, const char *delim, char **state) {
+ char *cp, *start;
+ start = cp = s ? s : *state;
+ if (!cp)
+ return NULL;
+ while (*cp && !strchr(delim, *cp))
+ ++cp;
+ if (!*cp) {
+ if (cp == start)
+ return NULL;
+ *state = NULL;
+ return start;
+ } else {
+ *cp++ = '\0';
+ *state = cp;
+ return start;
+ }
+}
+#endif
+
+/* helper version of atoi which returns -1 on error */
+static int
+strtoint(const char *const str)
+{
+ char *endptr;
+ const int r = strtol(str, &endptr, 10);
+ if (*endptr) return -1;
+ return r;
+}
+
+/* Parse a number of seconds into a timeval; return -1 on error. */
+static int
+strtotimeval(const char *const str, struct timeval *out)
+{
+ double d;
+ char *endptr;
+ d = strtod(str, &endptr);
+ if (*endptr) return -1;
+ if (d < 0) return -1;
+ out->tv_sec = (int) d;
+ out->tv_usec = (int) ((d - (int) d)*1000000);
+ if (out->tv_sec == 0 && out->tv_usec < 1000) /* less than 1 msec */
+ return -1;
+ return 0;
+}
+
+/* helper version of atoi that returns -1 on error and clips to bounds. */
+static int
+strtoint_clipped(const char *const str, int min, int max)
+{
+ int r = strtoint(str);
+ if (r == -1)
+ return r;
+ else if (r<min)
+ return min;
+ else if (r>max)
+ return max;
+ else
+ return r;
+}
+
+static int
+evdns_base_set_max_requests_inflight(struct evdns_base *base, int maxinflight)
+{
+ int old_n_heads = base->n_req_heads, n_heads;
+ struct request **old_heads = base->req_heads, **new_heads, *req;
+ int i;
+
+ ASSERT_LOCKED(base);
+ if (maxinflight < 1)
+ maxinflight = 1;
+ n_heads = (maxinflight+4) / 5;
+ EVUTIL_ASSERT(n_heads > 0);
+ new_heads = mm_calloc(n_heads, sizeof(struct request*));
+ if (!new_heads)
+ return (-1);
+ if (old_heads) {
+ for (i = 0; i < old_n_heads; ++i) {
+ while (old_heads[i]) {
+ req = old_heads[i];
+ evdns_request_remove(req, &old_heads[i]);
+ evdns_request_insert(req, &new_heads[req->trans_id % n_heads]);
+ }
+ }
+ mm_free(old_heads);
+ }
+ base->req_heads = new_heads;
+ base->n_req_heads = n_heads;
+ base->global_max_requests_inflight = maxinflight;
+ return (0);
+}
+
+/* exported function */
+int
+evdns_base_set_option(struct evdns_base *base,
+ const char *option, const char *val)
+{
+ int res;
+ EVDNS_LOCK(base);
+ res = evdns_base_set_option_impl(base, option, val, DNS_OPTIONS_ALL);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+static inline int
+str_matches_option(const char *s1, const char *optionname)
+{
+ /* Option names are given as "option:" We accept either 'option' in
+ * s1, or 'option:randomjunk'. The latter form is to implement the
+ * resolv.conf parser. */
+ size_t optlen = strlen(optionname);
+ size_t slen = strlen(s1);
+ if (slen == optlen || slen == optlen - 1)
+ return !strncmp(s1, optionname, slen);
+ else if (slen > optlen)
+ return !strncmp(s1, optionname, optlen);
+ else
+ return 0;
+}
+
+static int
+evdns_base_set_option_impl(struct evdns_base *base,
+ const char *option, const char *val, int flags)
+{
+ ASSERT_LOCKED(base);
+ if (str_matches_option(option, "ndots:")) {
+ const int ndots = strtoint(val);
+ if (ndots == -1) return -1;
+ if (!(flags & DNS_OPTION_SEARCH)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting ndots to %d", ndots);
+ if (!base->global_search_state) base->global_search_state = search_state_new();
+ if (!base->global_search_state) return -1;
+ base->global_search_state->ndots = ndots;
+ } else if (str_matches_option(option, "timeout:")) {
+ struct timeval tv;
+ if (strtotimeval(val, &tv) == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting timeout to %s", val);
+ memcpy(&base->global_timeout, &tv, sizeof(struct timeval));
+ } else if (str_matches_option(option, "getaddrinfo-allow-skew:")) {
+ struct timeval tv;
+ if (strtotimeval(val, &tv) == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting getaddrinfo-allow-skew to %s",
+ val);
+ memcpy(&base->global_getaddrinfo_allow_skew, &tv,
+ sizeof(struct timeval));
+ } else if (str_matches_option(option, "max-timeouts:")) {
+ const int maxtimeout = strtoint_clipped(val, 1, 255);
+ if (maxtimeout == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting maximum allowed timeouts to %d",
+ maxtimeout);
+ base->global_max_nameserver_timeout = maxtimeout;
+ } else if (str_matches_option(option, "max-inflight:")) {
+ const int maxinflight = strtoint_clipped(val, 1, 65000);
+ if (maxinflight == -1) return -1;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting maximum inflight requests to %d",
+ maxinflight);
+ evdns_base_set_max_requests_inflight(base, maxinflight);
+ } else if (str_matches_option(option, "attempts:")) {
+ int retries = strtoint(val);
+ if (retries == -1) return -1;
+ if (retries > 255) retries = 255;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting retries to %d", retries);
+ base->global_max_retransmits = retries;
+ } else if (str_matches_option(option, "randomize-case:")) {
+ int randcase = strtoint(val);
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ base->global_randomize_case = randcase;
+ } else if (str_matches_option(option, "bind-to:")) {
+ /* XXX This only applies to successive nameservers, not
+ * to already-configured ones. We might want to fix that. */
+ int len = sizeof(base->global_outgoing_address);
+ if (!(flags & DNS_OPTION_NAMESERVERS)) return 0;
+ if (evutil_parse_sockaddr_port(val,
+ (struct sockaddr*)&base->global_outgoing_address, &len))
+ return -1;
+ base->global_outgoing_addrlen = len;
+ } else if (str_matches_option(option, "initial-probe-timeout:")) {
+ struct timeval tv;
+ if (strtotimeval(val, &tv) == -1) return -1;
+ if (tv.tv_sec > 3600)
+ tv.tv_sec = 3600;
+ if (!(flags & DNS_OPTION_MISC)) return 0;
+ log(EVDNS_LOG_DEBUG, "Setting initial probe timeout to %s",
+ val);
+ memcpy(&base->global_nameserver_probe_initial_timeout, &tv,
+ sizeof(tv));
+ }
+ return 0;
+}
+
+int
+evdns_set_option(const char *option, const char *val, int flags)
+{
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_set_option(current_base, option, val);
+}
+
+static void
+resolv_conf_parse_line(struct evdns_base *base, char *const start, int flags) {
+ char *strtok_state;
+ static const char *const delims = " \t";
+#define NEXT_TOKEN strtok_r(NULL, delims, &strtok_state)
+
+
+ char *const first_token = strtok_r(start, delims, &strtok_state);
+ ASSERT_LOCKED(base);
+ if (!first_token) return;
+
+ if (!strcmp(first_token, "nameserver") && (flags & DNS_OPTION_NAMESERVERS)) {
+ const char *const nameserver = NEXT_TOKEN;
+
+ if (nameserver)
+ evdns_base_nameserver_ip_add(base, nameserver);
+ } else if (!strcmp(first_token, "domain") && (flags & DNS_OPTION_SEARCH)) {
+ const char *const domain = NEXT_TOKEN;
+ if (domain) {
+ search_postfix_clear(base);
+ search_postfix_add(base, domain);
+ }
+ } else if (!strcmp(first_token, "search") && (flags & DNS_OPTION_SEARCH)) {
+ const char *domain;
+ search_postfix_clear(base);
+
+ while ((domain = NEXT_TOKEN)) {
+ search_postfix_add(base, domain);
+ }
+ search_reverse(base);
+ } else if (!strcmp(first_token, "options")) {
+ const char *option;
+ while ((option = NEXT_TOKEN)) {
+ const char *val = strchr(option, ':');
+ evdns_base_set_option_impl(base, option, val ? val+1 : "", flags);
+ }
+ }
+#undef NEXT_TOKEN
+}
+
+/* exported function */
+/* returns: */
+/* 0 no errors */
+/* 1 failed to open file */
+/* 2 failed to stat file */
+/* 3 file too large */
+/* 4 out of memory */
+/* 5 short read from file */
+int
+evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename) {
+ int res;
+ EVDNS_LOCK(base);
+ res = evdns_base_resolv_conf_parse_impl(base, flags, filename);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+static char *
+evdns_get_default_hosts_filename(void)
+{
+#ifdef _WIN32
+ /* Windows is a little coy about where it puts its configuration
+ * files. Sure, they're _usually_ in C:\windows\system32, but
+ * there's no reason in principle they couldn't be in
+ * W:\hoboken chicken emergency\
+ */
+ char path[MAX_PATH+1];
+ static const char hostfile[] = "\\drivers\\etc\\hosts";
+ char *path_out;
+ size_t len_out;
+
+ if (! SHGetSpecialFolderPathA(NULL, path, CSIDL_SYSTEM, 0))
+ return NULL;
+ len_out = strlen(path)+strlen(hostfile);
+ path_out = mm_malloc(len_out+1);
+ evutil_snprintf(path_out, len_out, "%s%s", path, hostfile);
+ return path_out;
+#else
+ return mm_strdup("/etc/hosts");
+#endif
+}
+
+static int
+evdns_base_resolv_conf_parse_impl(struct evdns_base *base, int flags, const char *const filename) {
+ size_t n;
+ char *resolv;
+ char *start;
+ int err = 0;
+
+ log(EVDNS_LOG_DEBUG, "Parsing resolv.conf file %s", filename);
+
+ if (flags & DNS_OPTION_HOSTSFILE) {
+ char *fname = evdns_get_default_hosts_filename();
+ evdns_base_load_hosts(base, fname);
+ if (fname)
+ mm_free(fname);
+ }
+
+ if ((err = evutil_read_file_(filename, &resolv, &n, 0)) < 0) {
+ if (err == -1) {
+ /* No file. */
+ evdns_resolv_set_defaults(base, flags);
+ return 1;
+ } else {
+ return 2;
+ }
+ }
+
+ start = resolv;
+ for (;;) {
+ char *const newline = strchr(start, '\n');
+ if (!newline) {
+ resolv_conf_parse_line(base, start, flags);
+ break;
+ } else {
+ *newline = 0;
+ resolv_conf_parse_line(base, start, flags);
+ start = newline + 1;
+ }
+ }
+
+ if (!base->server_head && (flags & DNS_OPTION_NAMESERVERS)) {
+ /* no nameservers were configured. */
+ evdns_base_nameserver_ip_add(base, "127.0.0.1");
+ err = 6;
+ }
+ if (flags & DNS_OPTION_SEARCH && (!base->global_search_state || base->global_search_state->num_domains == 0)) {
+ search_set_from_hostname(base);
+ }
+
+ mm_free(resolv);
+ return err;
+}
+
+int
+evdns_resolv_conf_parse(int flags, const char *const filename) {
+ if (!current_base)
+ current_base = evdns_base_new(NULL, 0);
+ return evdns_base_resolv_conf_parse(current_base, flags, filename);
+}
+
+
+#ifdef _WIN32
+/* Add multiple nameservers from a space-or-comma-separated list. */
+static int
+evdns_nameserver_ip_add_line(struct evdns_base *base, const char *ips) {
+ const char *addr;
+ char *buf;
+ int r;
+ ASSERT_LOCKED(base);
+ while (*ips) {
+ while (isspace(*ips) || *ips == ',' || *ips == '\t')
+ ++ips;
+ addr = ips;
+ while (isdigit(*ips) || *ips == '.' || *ips == ':' ||
+ *ips=='[' || *ips==']')
+ ++ips;
+ buf = mm_malloc(ips-addr+1);
+ if (!buf) return 4;
+ memcpy(buf, addr, ips-addr);
+ buf[ips-addr] = '\0';
+ r = evdns_base_nameserver_ip_add(base, buf);
+ mm_free(buf);
+ if (r) return r;
+ }
+ return 0;
+}
+
+typedef DWORD(WINAPI *GetNetworkParams_fn_t)(FIXED_INFO *, DWORD*);
+
+/* Use the windows GetNetworkParams interface in iphlpapi.dll to */
+/* figure out what our nameservers are. */
+static int
+load_nameservers_with_getnetworkparams(struct evdns_base *base)
+{
+ /* Based on MSDN examples and inspection of c-ares code. */
+ FIXED_INFO *fixed;
+ HMODULE handle = 0;
+ ULONG size = sizeof(FIXED_INFO);
+ void *buf = NULL;
+ int status = 0, r, added_any;
+ IP_ADDR_STRING *ns;
+ GetNetworkParams_fn_t fn;
+
+ ASSERT_LOCKED(base);
+ if (!(handle = evutil_load_windows_system_library_(
+ TEXT("iphlpapi.dll")))) {
+ log(EVDNS_LOG_WARN, "Could not open iphlpapi.dll");
+ status = -1;
+ goto done;
+ }
+ if (!(fn = (GetNetworkParams_fn_t) GetProcAddress(handle, "GetNetworkParams"))) {
+ log(EVDNS_LOG_WARN, "Could not get address of function.");
+ status = -1;
+ goto done;
+ }
+
+ buf = mm_malloc(size);
+ if (!buf) { status = 4; goto done; }
+ fixed = buf;
+ r = fn(fixed, &size);
+ if (r != ERROR_SUCCESS && r != ERROR_BUFFER_OVERFLOW) {
+ status = -1;
+ goto done;
+ }
+ if (r != ERROR_SUCCESS) {
+ mm_free(buf);
+ buf = mm_malloc(size);
+ if (!buf) { status = 4; goto done; }
+ fixed = buf;
+ r = fn(fixed, &size);
+ if (r != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG, "fn() failed.");
+ status = -1;
+ goto done;
+ }
+ }
+
+ EVUTIL_ASSERT(fixed);
+ added_any = 0;
+ ns = &(fixed->DnsServerList);
+ while (ns) {
+ r = evdns_nameserver_ip_add_line(base, ns->IpAddress.String);
+ if (r) {
+ log(EVDNS_LOG_DEBUG,"Could not add nameserver %s to list,error: %d",
+ (ns->IpAddress.String),(int)GetLastError());
+ status = r;
+ } else {
+ ++added_any;
+ log(EVDNS_LOG_DEBUG,"Successfully added %s as nameserver",ns->IpAddress.String);
+ }
+
+ ns = ns->Next;
+ }
+
+ if (!added_any) {
+ log(EVDNS_LOG_DEBUG, "No nameservers added.");
+ if (status == 0)
+ status = -1;
+ } else {
+ status = 0;
+ }
+
+ done:
+ if (buf)
+ mm_free(buf);
+ if (handle)
+ FreeLibrary(handle);
+ return status;
+}
+
+static int
+config_nameserver_from_reg_key(struct evdns_base *base, HKEY key, const TCHAR *subkey)
+{
+ char *buf;
+ DWORD bufsz = 0, type = 0;
+ int status = 0;
+
+ ASSERT_LOCKED(base);
+ if (RegQueryValueEx(key, subkey, 0, &type, NULL, &bufsz)
+ != ERROR_MORE_DATA)
+ return -1;
+ if (!(buf = mm_malloc(bufsz)))
+ return -1;
+
+ if (RegQueryValueEx(key, subkey, 0, &type, (LPBYTE)buf, &bufsz)
+ == ERROR_SUCCESS && bufsz > 1) {
+ status = evdns_nameserver_ip_add_line(base,buf);
+ }
+
+ mm_free(buf);
+ return status;
+}
+
+#define SERVICES_KEY TEXT("System\\CurrentControlSet\\Services\\")
+#define WIN_NS_9X_KEY SERVICES_KEY TEXT("VxD\\MSTCP")
+#define WIN_NS_NT_KEY SERVICES_KEY TEXT("Tcpip\\Parameters")
+
+static int
+load_nameservers_from_registry(struct evdns_base *base)
+{
+ int found = 0;
+ int r;
+#define TRY(k, name) \
+ if (!found && config_nameserver_from_reg_key(base,k,TEXT(name)) == 0) { \
+ log(EVDNS_LOG_DEBUG,"Found nameservers in %s/%s",#k,name); \
+ found = 1; \
+ } else if (!found) { \
+ log(EVDNS_LOG_DEBUG,"Didn't find nameservers in %s/%s", \
+ #k,#name); \
+ }
+
+ ASSERT_LOCKED(base);
+
+ if (((int)GetVersion()) > 0) { /* NT */
+ HKEY nt_key = 0, interfaces_key = 0;
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0,
+ KEY_READ, &nt_key) != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG,"Couldn't open nt key, %d",(int)GetLastError());
+ return -1;
+ }
+ r = RegOpenKeyEx(nt_key, TEXT("Interfaces"), 0,
+ KEY_QUERY_VALUE|KEY_ENUMERATE_SUB_KEYS,
+ &interfaces_key);
+ if (r != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG,"Couldn't open interfaces key, %d",(int)GetLastError());
+ return -1;
+ }
+ TRY(nt_key, "NameServer");
+ TRY(nt_key, "DhcpNameServer");
+ TRY(interfaces_key, "NameServer");
+ TRY(interfaces_key, "DhcpNameServer");
+ RegCloseKey(interfaces_key);
+ RegCloseKey(nt_key);
+ } else {
+ HKEY win_key = 0;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_9X_KEY, 0,
+ KEY_READ, &win_key) != ERROR_SUCCESS) {
+ log(EVDNS_LOG_DEBUG, "Couldn't open registry key, %d", (int)GetLastError());
+ return -1;
+ }
+ TRY(win_key, "NameServer");
+ RegCloseKey(win_key);
+ }
+
+ if (found == 0) {
+ log(EVDNS_LOG_WARN,"Didn't find any nameservers.");
+ }
+
+ return found ? 0 : -1;
+#undef TRY
+}
+
+int
+evdns_base_config_windows_nameservers(struct evdns_base *base)
+{
+ int r;
+ char *fname;
+ if (base == NULL)
+ base = current_base;
+ if (base == NULL)
+ return -1;
+ EVDNS_LOCK(base);
+ if (load_nameservers_with_getnetworkparams(base) == 0) {
+ EVDNS_UNLOCK(base);
+ return 0;
+ }
+ r = load_nameservers_from_registry(base);
+
+ fname = evdns_get_default_hosts_filename();
+ evdns_base_load_hosts(base, fname);
+ if (fname)
+ mm_free(fname);
+
+ EVDNS_UNLOCK(base);
+ return r;
+}
+
+int
+evdns_config_windows_nameservers(void)
+{
+ if (!current_base) {
+ current_base = evdns_base_new(NULL, 1);
+ return current_base == NULL ? -1 : 0;
+ } else {
+ return evdns_base_config_windows_nameservers(current_base);
+ }
+}
+#endif
+
+struct evdns_base *
+evdns_base_new(struct event_base *event_base, int flags)
+{
+ struct evdns_base *base;
+
+ if (evutil_secure_rng_init() < 0) {
+ log(EVDNS_LOG_WARN, "Unable to seed random number generator; "
+ "DNS can't run.");
+ return NULL;
+ }
+
+ /* Give the evutil library a hook into its evdns-enabled
+ * functionality. We can't just call evdns_getaddrinfo directly or
+ * else libevent-core will depend on libevent-extras. */
+ evutil_set_evdns_getaddrinfo_fn_(evdns_getaddrinfo);
+
+ base = mm_malloc(sizeof(struct evdns_base));
+ if (base == NULL)
+ return (NULL);
+ memset(base, 0, sizeof(struct evdns_base));
+ base->req_waiting_head = NULL;
+
+ EVTHREAD_ALLOC_LOCK(base->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVDNS_LOCK(base);
+
+ /* Set max requests inflight and allocate req_heads. */
+ base->req_heads = NULL;
+
+ evdns_base_set_max_requests_inflight(base, 64);
+
+ base->server_head = NULL;
+ base->event_base = event_base;
+ base->global_good_nameservers = base->global_requests_inflight =
+ base->global_requests_waiting = 0;
+
+ base->global_timeout.tv_sec = 5;
+ base->global_timeout.tv_usec = 0;
+ base->global_max_reissues = 1;
+ base->global_max_retransmits = 3;
+ base->global_max_nameserver_timeout = 3;
+ base->global_search_state = NULL;
+ base->global_randomize_case = 1;
+ base->global_getaddrinfo_allow_skew.tv_sec = 3;
+ base->global_getaddrinfo_allow_skew.tv_usec = 0;
+ base->global_nameserver_probe_initial_timeout.tv_sec = 10;
+ base->global_nameserver_probe_initial_timeout.tv_usec = 0;
+
+ TAILQ_INIT(&base->hostsdb);
+
+#define EVDNS_BASE_ALL_FLAGS (0x8001)
+ if (flags & ~EVDNS_BASE_ALL_FLAGS) {
+ flags = EVDNS_BASE_INITIALIZE_NAMESERVERS;
+ log(EVDNS_LOG_WARN,
+ "Unrecognized flag passed to evdns_base_new(). Assuming "
+ "you meant EVDNS_BASE_INITIALIZE_NAMESERVERS.");
+ }
+#undef EVDNS_BASE_ALL_FLAGS
+
+ if (flags & EVDNS_BASE_INITIALIZE_NAMESERVERS) {
+ int r;
+#ifdef _WIN32
+ r = evdns_base_config_windows_nameservers(base);
+#else
+ r = evdns_base_resolv_conf_parse(base, DNS_OPTIONS_ALL, "/etc/resolv.conf");
+#endif
+ if (r == -1) {
+ evdns_base_free_and_unlock(base, 0);
+ return NULL;
+ }
+ }
+ if (flags & EVDNS_BASE_DISABLE_WHEN_INACTIVE) {
+ base->disable_when_inactive = 1;
+ }
+
+ EVDNS_UNLOCK(base);
+ return base;
+}
+
+int
+evdns_init(void)
+{
+ struct evdns_base *base = evdns_base_new(NULL, 1);
+ if (base) {
+ current_base = base;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+const char *
+evdns_err_to_string(int err)
+{
+ switch (err) {
+ case DNS_ERR_NONE: return "no error";
+ case DNS_ERR_FORMAT: return "misformatted query";
+ case DNS_ERR_SERVERFAILED: return "server failed";
+ case DNS_ERR_NOTEXIST: return "name does not exist";
+ case DNS_ERR_NOTIMPL: return "query not implemented";
+ case DNS_ERR_REFUSED: return "refused";
+
+ case DNS_ERR_TRUNCATED: return "reply truncated or ill-formed";
+ case DNS_ERR_UNKNOWN: return "unknown";
+ case DNS_ERR_TIMEOUT: return "request timed out";
+ case DNS_ERR_SHUTDOWN: return "dns subsystem shut down";
+ case DNS_ERR_CANCEL: return "dns request canceled";
+ case DNS_ERR_NODATA: return "no records in the reply";
+ default: return "[Unknown error code]";
+ }
+}
+
+static void
+evdns_nameserver_free(struct nameserver *server)
+{
+ if (server->socket >= 0)
+ evutil_closesocket(server->socket);
+ (void) event_del(&server->event);
+ event_debug_unassign(&server->event);
+ if (server->state == 0)
+ (void) event_del(&server->timeout_event);
+ event_debug_unassign(&server->timeout_event);
+ mm_free(server);
+}
+
+static void
+evdns_base_free_and_unlock(struct evdns_base *base, int fail_requests)
+{
+ struct nameserver *server, *server_next;
+ struct search_domain *dom, *dom_next;
+ int i;
+
+ /* Requires that we hold the lock. */
+
+ /* TODO(nickm) we might need to refcount here. */
+
+ for (i = 0; i < base->n_req_heads; ++i) {
+ while (base->req_heads[i]) {
+ if (fail_requests)
+ reply_schedule_callback(base->req_heads[i], 0, DNS_ERR_SHUTDOWN, NULL);
+ request_finished(base->req_heads[i], &REQ_HEAD(base, base->req_heads[i]->trans_id), 1);
+ }
+ }
+ while (base->req_waiting_head) {
+ if (fail_requests)
+ reply_schedule_callback(base->req_waiting_head, 0, DNS_ERR_SHUTDOWN, NULL);
+ request_finished(base->req_waiting_head, &base->req_waiting_head, 1);
+ }
+ base->global_requests_inflight = base->global_requests_waiting = 0;
+
+ for (server = base->server_head; server; server = server_next) {
+ server_next = server->next;
+ evdns_nameserver_free(server);
+ if (server_next == base->server_head)
+ break;
+ }
+ base->server_head = NULL;
+ base->global_good_nameservers = 0;
+
+ if (base->global_search_state) {
+ for (dom = base->global_search_state->head; dom; dom = dom_next) {
+ dom_next = dom->next;
+ mm_free(dom);
+ }
+ mm_free(base->global_search_state);
+ base->global_search_state = NULL;
+ }
+
+ {
+ struct hosts_entry *victim;
+ while ((victim = TAILQ_FIRST(&base->hostsdb))) {
+ TAILQ_REMOVE(&base->hostsdb, victim, next);
+ mm_free(victim);
+ }
+ }
+
+ mm_free(base->req_heads);
+
+ EVDNS_UNLOCK(base);
+ EVTHREAD_FREE_LOCK(base->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ mm_free(base);
+}
+
+void
+evdns_base_free(struct evdns_base *base, int fail_requests)
+{
+ EVDNS_LOCK(base);
+ evdns_base_free_and_unlock(base, fail_requests);
+}
+
+void
+evdns_base_clear_host_addresses(struct evdns_base *base)
+{
+ struct hosts_entry *victim;
+ EVDNS_LOCK(base);
+ while ((victim = TAILQ_FIRST(&base->hostsdb))) {
+ TAILQ_REMOVE(&base->hostsdb, victim, next);
+ mm_free(victim);
+ }
+ EVDNS_UNLOCK(base);
+}
+
+void
+evdns_shutdown(int fail_requests)
+{
+ if (current_base) {
+ struct evdns_base *b = current_base;
+ current_base = NULL;
+ evdns_base_free(b, fail_requests);
+ }
+ evdns_log_fn = NULL;
+}
+
+static int
+evdns_base_parse_hosts_line(struct evdns_base *base, char *line)
+{
+ char *strtok_state;
+ static const char *const delims = " \t";
+ char *const addr = strtok_r(line, delims, &strtok_state);
+ char *hostname, *hash;
+ struct sockaddr_storage ss;
+ int socklen = sizeof(ss);
+ ASSERT_LOCKED(base);
+
+#define NEXT_TOKEN strtok_r(NULL, delims, &strtok_state)
+
+ if (!addr || *addr == '#')
+ return 0;
+
+ memset(&ss, 0, sizeof(ss));
+ if (evutil_parse_sockaddr_port(addr, (struct sockaddr*)&ss, &socklen)<0)
+ return -1;
+ if (socklen > (int)sizeof(struct sockaddr_in6))
+ return -1;
+
+ if (sockaddr_getport((struct sockaddr*)&ss))
+ return -1;
+
+ while ((hostname = NEXT_TOKEN)) {
+ struct hosts_entry *he;
+ size_t namelen;
+ if ((hash = strchr(hostname, '#'))) {
+ if (hash == hostname)
+ return 0;
+ *hash = '\0';
+ }
+
+ namelen = strlen(hostname);
+
+ he = mm_calloc(1, sizeof(struct hosts_entry)+namelen);
+ if (!he)
+ return -1;
+ EVUTIL_ASSERT(socklen <= (int)sizeof(he->addr));
+ memcpy(&he->addr, &ss, socklen);
+ memcpy(he->hostname, hostname, namelen+1);
+ he->addrlen = socklen;
+
+ TAILQ_INSERT_TAIL(&base->hostsdb, he, next);
+
+ if (hash)
+ return 0;
+ }
+
+ return 0;
+#undef NEXT_TOKEN
+}
+
+static int
+evdns_base_load_hosts_impl(struct evdns_base *base, const char *hosts_fname)
+{
+ char *str=NULL, *cp, *eol;
+ size_t len;
+ int err=0;
+
+ ASSERT_LOCKED(base);
+
+ if (hosts_fname == NULL ||
+ (err = evutil_read_file_(hosts_fname, &str, &len, 0)) < 0) {
+ char tmp[64];
+ strlcpy(tmp, "127.0.0.1 localhost", sizeof(tmp));
+ evdns_base_parse_hosts_line(base, tmp);
+ strlcpy(tmp, "::1 localhost", sizeof(tmp));
+ evdns_base_parse_hosts_line(base, tmp);
+ return err ? -1 : 0;
+ }
+
+ /* This will break early if there is a NUL in the hosts file.
+ * Probably not a problem.*/
+ cp = str;
+ for (;;) {
+ eol = strchr(cp, '\n');
+
+ if (eol) {
+ *eol = '\0';
+ evdns_base_parse_hosts_line(base, cp);
+ cp = eol+1;
+ } else {
+ evdns_base_parse_hosts_line(base, cp);
+ break;
+ }
+ }
+
+ mm_free(str);
+ return 0;
+}
+
+int
+evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname)
+{
+ int res;
+ if (!base)
+ base = current_base;
+ EVDNS_LOCK(base);
+ res = evdns_base_load_hosts_impl(base, hosts_fname);
+ EVDNS_UNLOCK(base);
+ return res;
+}
+
+/* A single request for a getaddrinfo, either v4 or v6. */
+struct getaddrinfo_subrequest {
+ struct evdns_request *r;
+ ev_uint32_t type;
+};
+
+/* State data used to implement an in-progress getaddrinfo. */
+struct evdns_getaddrinfo_request {
+ struct evdns_base *evdns_base;
+ /* Copy of the modified 'hints' data that we'll use to build
+ * answers. */
+ struct evutil_addrinfo hints;
+ /* The callback to invoke when we're done */
+ evdns_getaddrinfo_cb user_cb;
+ /* User-supplied data to give to the callback. */
+ void *user_data;
+ /* The port to use when building sockaddrs. */
+ ev_uint16_t port;
+ /* The sub_request for an A record (if any) */
+ struct getaddrinfo_subrequest ipv4_request;
+ /* The sub_request for an AAAA record (if any) */
+ struct getaddrinfo_subrequest ipv6_request;
+
+ /* The cname result that we were told (if any) */
+ char *cname_result;
+
+ /* If we have one request answered and one request still inflight,
+ * then this field holds the answer from the first request... */
+ struct evutil_addrinfo *pending_result;
+ /* And this event is a timeout that will tell us to cancel the second
+ * request if it's taking a long time. */
+ struct event timeout;
+
+ /* And this field holds the error code from the first request... */
+ int pending_error;
+ /* If this is set, the user canceled this request. */
+ unsigned user_canceled : 1;
+ /* If this is set, the user can no longer cancel this request; we're
+ * just waiting for the free. */
+ unsigned request_done : 1;
+};
+
+/* Convert an evdns errors to the equivalent getaddrinfo error. */
+static int
+evdns_err_to_getaddrinfo_err(int e1)
+{
+ /* XXX Do this better! */
+ if (e1 == DNS_ERR_NONE)
+ return 0;
+ else if (e1 == DNS_ERR_NOTEXIST)
+ return EVUTIL_EAI_NONAME;
+ else
+ return EVUTIL_EAI_FAIL;
+}
+
+/* Return the more informative of two getaddrinfo errors. */
+static int
+getaddrinfo_merge_err(int e1, int e2)
+{
+ /* XXXX be cleverer here. */
+ if (e1 == 0)
+ return e2;
+ else
+ return e1;
+}
+
+static void
+free_getaddrinfo_request(struct evdns_getaddrinfo_request *data)
+{
+ /* DO NOT CALL this if either of the requests is pending. Only once
+ * both callbacks have been invoked is it safe to free the request */
+ if (data->pending_result)
+ evutil_freeaddrinfo(data->pending_result);
+ if (data->cname_result)
+ mm_free(data->cname_result);
+ event_del(&data->timeout);
+ mm_free(data);
+ return;
+}
+
+static void
+add_cname_to_reply(struct evdns_getaddrinfo_request *data,
+ struct evutil_addrinfo *ai)
+{
+ if (data->cname_result && ai) {
+ ai->ai_canonname = data->cname_result;
+ data->cname_result = NULL;
+ }
+}
+
+/* Callback: invoked when one request in a mixed-format A/AAAA getaddrinfo
+ * request has finished, but the other one took too long to answer. Pass
+ * along the answer we got, and cancel the other request.
+ */
+static void
+evdns_getaddrinfo_timeout_cb(evutil_socket_t fd, short what, void *ptr)
+{
+ int v4_timedout = 0, v6_timedout = 0;
+ struct evdns_getaddrinfo_request *data = ptr;
+
+ /* Cancel any pending requests, and note which one */
+ if (data->ipv4_request.r) {
+ /* XXXX This does nothing if the request's callback is already
+ * running (pending_cb is set). */
+ evdns_cancel_request(NULL, data->ipv4_request.r);
+ v4_timedout = 1;
+ EVDNS_LOCK(data->evdns_base);
+ ++data->evdns_base->getaddrinfo_ipv4_timeouts;
+ EVDNS_UNLOCK(data->evdns_base);
+ }
+ if (data->ipv6_request.r) {
+ /* XXXX This does nothing if the request's callback is already
+ * running (pending_cb is set). */
+ evdns_cancel_request(NULL, data->ipv6_request.r);
+ v6_timedout = 1;
+ EVDNS_LOCK(data->evdns_base);
+ ++data->evdns_base->getaddrinfo_ipv6_timeouts;
+ EVDNS_UNLOCK(data->evdns_base);
+ }
+
+ /* We only use this timeout callback when we have an answer for
+ * one address. */
+ EVUTIL_ASSERT(!v4_timedout || !v6_timedout);
+
+ /* Report the outcome of the other request that didn't time out. */
+ if (data->pending_result) {
+ add_cname_to_reply(data, data->pending_result);
+ data->user_cb(0, data->pending_result, data->user_data);
+ data->pending_result = NULL;
+ } else {
+ int e = data->pending_error;
+ if (!e)
+ e = EVUTIL_EAI_AGAIN;
+ data->user_cb(e, NULL, data->user_data);
+ }
+
+ data->user_cb = NULL; /* prevent double-call if evdns callbacks are
+ * in-progress. XXXX It would be better if this
+ * weren't necessary. */
+
+ if (!v4_timedout && !v6_timedout) {
+ /* should be impossible? XXXX */
+ free_getaddrinfo_request(data);
+ }
+}
+
+static int
+evdns_getaddrinfo_set_timeout(struct evdns_base *evdns_base,
+ struct evdns_getaddrinfo_request *data)
+{
+ return event_add(&data->timeout, &evdns_base->global_getaddrinfo_allow_skew);
+}
+
+static inline int
+evdns_result_is_answer(int result)
+{
+ return (result != DNS_ERR_NOTIMPL && result != DNS_ERR_REFUSED &&
+ result != DNS_ERR_SERVERFAILED && result != DNS_ERR_CANCEL);
+}
+
+static void
+evdns_getaddrinfo_gotresolve(int result, char type, int count,
+ int ttl, void *addresses, void *arg)
+{
+ int i;
+ struct getaddrinfo_subrequest *req = arg;
+ struct getaddrinfo_subrequest *other_req;
+ struct evdns_getaddrinfo_request *data;
+
+ struct evutil_addrinfo *res;
+
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ struct sockaddr *sa;
+ int socklen, addrlen;
+ void *addrp;
+ int err;
+ int user_canceled;
+
+ EVUTIL_ASSERT(req->type == DNS_IPv4_A || req->type == DNS_IPv6_AAAA);
+ if (req->type == DNS_IPv4_A) {
+ data = EVUTIL_UPCAST(req, struct evdns_getaddrinfo_request, ipv4_request);
+ other_req = &data->ipv6_request;
+ } else {
+ data = EVUTIL_UPCAST(req, struct evdns_getaddrinfo_request, ipv6_request);
+ other_req = &data->ipv4_request;
+ }
+
+ EVDNS_LOCK(data->evdns_base);
+ if (evdns_result_is_answer(result)) {
+ if (req->type == DNS_IPv4_A)
+ ++data->evdns_base->getaddrinfo_ipv4_answered;
+ else
+ ++data->evdns_base->getaddrinfo_ipv6_answered;
+ }
+ user_canceled = data->user_canceled;
+ if (other_req->r == NULL)
+ data->request_done = 1;
+ EVDNS_UNLOCK(data->evdns_base);
+
+ req->r = NULL;
+
+ if (result == DNS_ERR_CANCEL && ! user_canceled) {
+ /* Internal cancel request from timeout or internal error.
+ * we already answered the user. */
+ if (other_req->r == NULL)
+ free_getaddrinfo_request(data);
+ return;
+ }
+
+ if (data->user_cb == NULL) {
+ /* We already answered. XXXX This shouldn't be needed; see
+ * comments in evdns_getaddrinfo_timeout_cb */
+ free_getaddrinfo_request(data);
+ return;
+ }
+
+ if (result == DNS_ERR_NONE) {
+ if (count == 0)
+ err = EVUTIL_EAI_NODATA;
+ else
+ err = 0;
+ } else {
+ err = evdns_err_to_getaddrinfo_err(result);
+ }
+
+ if (err) {
+ /* Looks like we got an error. */
+ if (other_req->r) {
+ /* The other request is still working; maybe it will
+ * succeed. */
+ /* XXXX handle failure from set_timeout */
+ evdns_getaddrinfo_set_timeout(data->evdns_base, data);
+ data->pending_error = err;
+ return;
+ }
+
+ if (user_canceled) {
+ data->user_cb(EVUTIL_EAI_CANCEL, NULL, data->user_data);
+ } else if (data->pending_result) {
+ /* If we have an answer waiting, and we weren't
+ * canceled, ignore this error. */
+ add_cname_to_reply(data, data->pending_result);
+ data->user_cb(0, data->pending_result, data->user_data);
+ data->pending_result = NULL;
+ } else {
+ if (data->pending_error)
+ err = getaddrinfo_merge_err(err,
+ data->pending_error);
+ data->user_cb(err, NULL, data->user_data);
+ }
+ free_getaddrinfo_request(data);
+ return;
+ } else if (user_canceled) {
+ if (other_req->r) {
+ /* The other request is still working; let it hit this
+ * callback with EVUTIL_EAI_CANCEL callback and report
+ * the failure. */
+ return;
+ }
+ data->user_cb(EVUTIL_EAI_CANCEL, NULL, data->user_data);
+ free_getaddrinfo_request(data);
+ return;
+ }
+
+ /* Looks like we got some answers. We should turn them into addrinfos
+ * and then either queue those or return them all. */
+ EVUTIL_ASSERT(type == DNS_IPv4_A || type == DNS_IPv6_AAAA);
+
+ if (type == DNS_IPv4_A) {
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(data->port);
+
+ sa = (struct sockaddr *)&sin;
+ socklen = sizeof(sin);
+ addrlen = 4;
+ addrp = &sin.sin_addr.s_addr;
+ } else {
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(data->port);
+
+ sa = (struct sockaddr *)&sin6;
+ socklen = sizeof(sin6);
+ addrlen = 16;
+ addrp = &sin6.sin6_addr.s6_addr;
+ }
+
+ res = NULL;
+ for (i=0; i < count; ++i) {
+ struct evutil_addrinfo *ai;
+ memcpy(addrp, ((char*)addresses)+i*addrlen, addrlen);
+ ai = evutil_new_addrinfo_(sa, socklen, &data->hints);
+ if (!ai) {
+ if (other_req->r) {
+ evdns_cancel_request(NULL, other_req->r);
+ }
+ data->user_cb(EVUTIL_EAI_MEMORY, NULL, data->user_data);
+ if (res)
+ evutil_freeaddrinfo(res);
+
+ if (other_req->r == NULL)
+ free_getaddrinfo_request(data);
+ return;
+ }
+ res = evutil_addrinfo_append_(res, ai);
+ }
+
+ if (other_req->r) {
+ /* The other request is still in progress; wait for it */
+ /* XXXX handle failure from set_timeout */
+ evdns_getaddrinfo_set_timeout(data->evdns_base, data);
+ data->pending_result = res;
+ return;
+ } else {
+ /* The other request is done or never started; append its
+ * results (if any) and return them. */
+ if (data->pending_result) {
+ if (req->type == DNS_IPv4_A)
+ res = evutil_addrinfo_append_(res,
+ data->pending_result);
+ else
+ res = evutil_addrinfo_append_(
+ data->pending_result, res);
+ data->pending_result = NULL;
+ }
+
+ /* Call the user callback. */
+ add_cname_to_reply(data, res);
+ data->user_cb(0, res, data->user_data);
+
+ /* Free data. */
+ free_getaddrinfo_request(data);
+ }
+}
+
+static struct hosts_entry *
+find_hosts_entry(struct evdns_base *base, const char *hostname,
+ struct hosts_entry *find_after)
+{
+ struct hosts_entry *e;
+
+ if (find_after)
+ e = TAILQ_NEXT(find_after, next);
+ else
+ e = TAILQ_FIRST(&base->hostsdb);
+
+ for (; e; e = TAILQ_NEXT(e, next)) {
+ if (!evutil_ascii_strcasecmp(e->hostname, hostname))
+ return e;
+ }
+ return NULL;
+}
+
+static int
+evdns_getaddrinfo_fromhosts(struct evdns_base *base,
+ const char *nodename, struct evutil_addrinfo *hints, ev_uint16_t port,
+ struct evutil_addrinfo **res)
+{
+ int n_found = 0;
+ struct hosts_entry *e;
+ struct evutil_addrinfo *ai=NULL;
+ int f = hints->ai_family;
+
+ EVDNS_LOCK(base);
+ for (e = find_hosts_entry(base, nodename, NULL); e;
+ e = find_hosts_entry(base, nodename, e)) {
+ struct evutil_addrinfo *ai_new;
+ ++n_found;
+ if ((e->addr.sa.sa_family == AF_INET && f == PF_INET6) ||
+ (e->addr.sa.sa_family == AF_INET6 && f == PF_INET))
+ continue;
+ ai_new = evutil_new_addrinfo_(&e->addr.sa, e->addrlen, hints);
+ if (!ai_new) {
+ n_found = 0;
+ goto out;
+ }
+ sockaddr_setport(ai_new->ai_addr, port);
+ ai = evutil_addrinfo_append_(ai, ai_new);
+ }
+ EVDNS_UNLOCK(base);
+out:
+ if (n_found) {
+ /* Note that we return an empty answer if we found entries for
+ * this hostname but none were of the right address type. */
+ *res = ai;
+ return 0;
+ } else {
+ if (ai)
+ evutil_freeaddrinfo(ai);
+ return -1;
+ }
+}
+
+struct evdns_getaddrinfo_request *
+evdns_getaddrinfo(struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ evdns_getaddrinfo_cb cb, void *arg)
+{
+ struct evdns_getaddrinfo_request *data;
+ struct evutil_addrinfo hints;
+ struct evutil_addrinfo *res = NULL;
+ int err;
+ int port = 0;
+ int want_cname = 0;
+
+ if (!dns_base) {
+ dns_base = current_base;
+ if (!dns_base) {
+ log(EVDNS_LOG_WARN,
+ "Call to getaddrinfo_async with no "
+ "evdns_base configured.");
+ cb(EVUTIL_EAI_FAIL, NULL, arg); /* ??? better error? */
+ return NULL;
+ }
+ }
+
+ /* If we _must_ answer this immediately, do so. */
+ if ((hints_in && (hints_in->ai_flags & EVUTIL_AI_NUMERICHOST))) {
+ res = NULL;
+ err = evutil_getaddrinfo(nodename, servname, hints_in, &res);
+ cb(err, res, arg);
+ return NULL;
+ }
+
+ if (hints_in) {
+ memcpy(&hints, hints_in, sizeof(hints));
+ } else {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ }
+
+ evutil_adjust_hints_for_addrconfig_(&hints);
+
+ /* Now try to see if we _can_ answer immediately. */
+ /* (It would be nice to do this by calling getaddrinfo directly, with
+ * AI_NUMERICHOST, on plaforms that have it, but we can't: there isn't
+ * a reliable way to distinguish the "that wasn't a numeric host!" case
+ * from any other EAI_NONAME cases.) */
+ err = evutil_getaddrinfo_common_(nodename, servname, &hints, &res, &port);
+ if (err != EVUTIL_EAI_NEED_RESOLVE) {
+ cb(err, res, arg);
+ return NULL;
+ }
+
+ /* If there is an entry in the hosts file, we should give it now. */
+ if (!evdns_getaddrinfo_fromhosts(dns_base, nodename, &hints, port, &res)) {
+ cb(0, res, arg);
+ return NULL;
+ }
+
+ /* Okay, things are serious now. We're going to need to actually
+ * launch a request.
+ */
+ data = mm_calloc(1,sizeof(struct evdns_getaddrinfo_request));
+ if (!data) {
+ cb(EVUTIL_EAI_MEMORY, NULL, arg);
+ return NULL;
+ }
+
+ memcpy(&data->hints, &hints, sizeof(data->hints));
+ data->port = (ev_uint16_t)port;
+ data->ipv4_request.type = DNS_IPv4_A;
+ data->ipv6_request.type = DNS_IPv6_AAAA;
+ data->user_cb = cb;
+ data->user_data = arg;
+ data->evdns_base = dns_base;
+
+ want_cname = (hints.ai_flags & EVUTIL_AI_CANONNAME);
+
+ /* If we are asked for a PF_UNSPEC address, we launch two requests in
+ * parallel: one for an A address and one for an AAAA address. We
+ * can't send just one request, since many servers only answer one
+ * question per DNS request.
+ *
+ * Once we have the answer to one request, we allow for a short
+ * timeout before we report it, to see if the other one arrives. If
+ * they both show up in time, then we report both the answers.
+ *
+ * If too many addresses of one type time out or fail, we should stop
+ * launching those requests. (XXX we don't do that yet.)
+ */
+
+ if (hints.ai_family != PF_INET6) {
+ log(EVDNS_LOG_DEBUG, "Sending request for %s on ipv4 as %p",
+ nodename, &data->ipv4_request);
+
+ data->ipv4_request.r = evdns_base_resolve_ipv4(dns_base,
+ nodename, 0, evdns_getaddrinfo_gotresolve,
+ &data->ipv4_request);
+ if (want_cname)
+ data->ipv4_request.r->current_req->put_cname_in_ptr =
+ &data->cname_result;
+ }
+ if (hints.ai_family != PF_INET) {
+ log(EVDNS_LOG_DEBUG, "Sending request for %s on ipv6 as %p",
+ nodename, &data->ipv6_request);
+
+ data->ipv6_request.r = evdns_base_resolve_ipv6(dns_base,
+ nodename, 0, evdns_getaddrinfo_gotresolve,
+ &data->ipv6_request);
+ if (want_cname)
+ data->ipv6_request.r->current_req->put_cname_in_ptr =
+ &data->cname_result;
+ }
+
+ evtimer_assign(&data->timeout, dns_base->event_base,
+ evdns_getaddrinfo_timeout_cb, data);
+
+ if (data->ipv4_request.r || data->ipv6_request.r) {
+ return data;
+ } else {
+ mm_free(data);
+ cb(EVUTIL_EAI_FAIL, NULL, arg);
+ return NULL;
+ }
+}
+
+void
+evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *data)
+{
+ EVDNS_LOCK(data->evdns_base);
+ if (data->request_done) {
+ EVDNS_UNLOCK(data->evdns_base);
+ return;
+ }
+ event_del(&data->timeout);
+ data->user_canceled = 1;
+ if (data->ipv4_request.r)
+ evdns_cancel_request(data->evdns_base, data->ipv4_request.r);
+ if (data->ipv6_request.r)
+ evdns_cancel_request(data->evdns_base, data->ipv6_request.r);
+ EVDNS_UNLOCK(data->evdns_base);
+}
diff --git a/sntp/libevent/event-internal.h b/sntp/libevent/event-internal.h
new file mode 100644
index 0000000..5208fbe
--- /dev/null
+++ b/sntp/libevent/event-internal.h
@@ -0,0 +1,474 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT_INTERNAL_H_INCLUDED_
+#define EVENT_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <time.h>
+#include <sys/queue.h>
+#include "event2/event_struct.h"
+#include "minheap-internal.h"
+#include "evsignal-internal.h"
+#include "mm-internal.h"
+#include "defer-internal.h"
+
+/* map union members back */
+
+/* mutually exclusive */
+#define ev_signal_next ev_.ev_signal.ev_signal_next
+#define ev_io_next ev_.ev_io.ev_io_next
+#define ev_io_timeout ev_.ev_io.ev_timeout
+
+/* used only by signals */
+#define ev_ncalls ev_.ev_signal.ev_ncalls
+#define ev_pncalls ev_.ev_signal.ev_pncalls
+
+#define ev_pri ev_evcallback.evcb_pri
+#define ev_flags ev_evcallback.evcb_flags
+#define ev_closure ev_evcallback.evcb_closure
+#define ev_callback ev_evcallback.evcb_cb_union.evcb_callback
+#define ev_arg ev_evcallback.evcb_arg
+
+/** @name Event closure codes
+
+ Possible values for evcb_closure in struct event_callback
+
+ @{
+ */
+/** A regular event. Uses the evcb_callback callback */
+#define EV_CLOSURE_EVENT 0
+/** A signal event. Uses the evcb_callback callback */
+#define EV_CLOSURE_EVENT_SIGNAL 1
+/** A persistent non-signal event. Uses the evcb_callback callback */
+#define EV_CLOSURE_EVENT_PERSIST 2
+/** A simple callback. Uses the evcb_selfcb callback. */
+#define EV_CLOSURE_CB_SELF 3
+/** A finalizing callback. Uses the evcb_cbfinalize callback. */
+#define EV_CLOSURE_CB_FINALIZE 4
+/** A finalizing event. Uses the evcb_evfinalize callback. */
+#define EV_CLOSURE_EVENT_FINALIZE 5
+/** A finalizing event that should get freed after. Uses the evcb_evfinalize
+ * callback. */
+#define EV_CLOSURE_EVENT_FINALIZE_FREE 6
+/** @} */
+
+/** Structure to define the backend of a given event_base. */
+struct eventop {
+ /** The name of this backend. */
+ const char *name;
+ /** Function to set up an event_base to use this backend. It should
+ * create a new structure holding whatever information is needed to
+ * run the backend, and return it. The returned pointer will get
+ * stored by event_init into the event_base.evbase field. On failure,
+ * this function should return NULL. */
+ void *(*init)(struct event_base *);
+ /** Enable reading/writing on a given fd or signal. 'events' will be
+ * the events that we're trying to enable: one or more of EV_READ,
+ * EV_WRITE, EV_SIGNAL, and EV_ET. 'old' will be those events that
+ * were enabled on this fd previously. 'fdinfo' will be a structure
+ * associated with the fd by the evmap; its size is defined by the
+ * fdinfo field below. It will be set to 0 the first time the fd is
+ * added. The function should return 0 on success and -1 on error.
+ */
+ int (*add)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo);
+ /** As "add", except 'events' contains the events we mean to disable. */
+ int (*del)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo);
+ /** Function to implement the core of an event loop. It must see which
+ added events are ready, and cause event_active to be called for each
+ active event (usually via event_io_active or such). It should
+ return 0 on success and -1 on error.
+ */
+ int (*dispatch)(struct event_base *, struct timeval *);
+ /** Function to clean up and free our data from the event_base. */
+ void (*dealloc)(struct event_base *);
+ /** Flag: set if we need to reinitialize the event base after we fork.
+ */
+ int need_reinit;
+ /** Bit-array of supported event_method_features that this backend can
+ * provide. */
+ enum event_method_feature features;
+ /** Length of the extra information we should record for each fd that
+ has one or more active events. This information is recorded
+ as part of the evmap entry for each fd, and passed as an argument
+ to the add and del functions above.
+ */
+ size_t fdinfo_len;
+};
+
+#ifdef _WIN32
+/* If we're on win32, then file descriptors are not nice low densely packed
+ integers. Instead, they are pointer-like windows handles, and we want to
+ use a hashtable instead of an array to map fds to events.
+*/
+#define EVMAP_USE_HT
+#endif
+
+/* #define HT_CACHE_HASH_VALS */
+
+#ifdef EVMAP_USE_HT
+#define HT_NO_CACHE_HASH_VALUES
+#include "ht-internal.h"
+struct event_map_entry;
+HT_HEAD(event_io_map, event_map_entry);
+#else
+#define event_io_map event_signal_map
+#endif
+
+/* Used to map signal numbers to a list of events. If EVMAP_USE_HT is not
+ defined, this structure is also used as event_io_map, which maps fds to a
+ list of events.
+*/
+struct event_signal_map {
+ /* An array of evmap_io * or of evmap_signal *; empty entries are
+ * set to NULL. */
+ void **entries;
+ /* The number of entries available in entries */
+ int nentries;
+};
+
+/* A list of events waiting on a given 'common' timeout value. Ordinarily,
+ * events waiting for a timeout wait on a minheap. Sometimes, however, a
+ * queue can be faster.
+ **/
+struct common_timeout_list {
+ /* List of events currently waiting in the queue. */
+ struct event_list events;
+ /* 'magic' timeval used to indicate the duration of events in this
+ * queue. */
+ struct timeval duration;
+ /* Event that triggers whenever one of the events in the queue is
+ * ready to activate */
+ struct event timeout_event;
+ /* The event_base that this timeout list is part of */
+ struct event_base *base;
+};
+
+/** Mask used to get the real tv_usec value from a common timeout. */
+#define COMMON_TIMEOUT_MICROSECONDS_MASK 0x000fffff
+
+struct event_change;
+
+/* List of 'changes' since the last call to eventop.dispatch. Only maintained
+ * if the backend is using changesets. */
+struct event_changelist {
+ struct event_change *changes;
+ int n_changes;
+ int changes_size;
+};
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+/* Global internal flag: set to one if debug mode is on. */
+extern int event_debug_mode_on_;
+#define EVENT_DEBUG_MODE_IS_ON() (event_debug_mode_on_)
+#else
+#define EVENT_DEBUG_MODE_IS_ON() (0)
+#endif
+
+TAILQ_HEAD(evcallback_list, event_callback);
+
+/* Sets up an event for processing once */
+struct event_once {
+ LIST_ENTRY(event_once) next_once;
+ struct event ev;
+
+ void (*cb)(evutil_socket_t, short, void *);
+ void *arg;
+};
+
+struct event_base {
+ /** Function pointers and other data to describe this event_base's
+ * backend. */
+ const struct eventop *evsel;
+ /** Pointer to backend-specific data. */
+ void *evbase;
+
+ /** List of changes to tell backend about at next dispatch. Only used
+ * by the O(1) backends. */
+ struct event_changelist changelist;
+
+ /** Function pointers used to describe the backend that this event_base
+ * uses for signals */
+ const struct eventop *evsigsel;
+ /** Data to implement the common signal handelr code. */
+ struct evsig_info sig;
+
+ /** Number of virtual events */
+ int virtual_event_count;
+ /** Maximum number of virtual events active */
+ int virtual_event_count_max;
+ /** Number of total events added to this event_base */
+ int event_count;
+ /** Maximum number of total events added to this event_base */
+ int event_count_max;
+ /** Number of total events active in this event_base */
+ int event_count_active;
+ /** Maximum number of total events active in this event_base */
+ int event_count_active_max;
+
+ /** Set if we should terminate the loop once we're done processing
+ * events. */
+ int event_gotterm;
+ /** Set if we should terminate the loop immediately */
+ int event_break;
+ /** Set if we should start a new instance of the loop immediately. */
+ int event_continue;
+
+ /** The currently running priority of events */
+ int event_running_priority;
+
+ /** Set if we're running the event_base_loop function, to prevent
+ * reentrant invocation. */
+ int running_loop;
+
+ /** Set to the number of deferred_cbs we've made 'active' in the
+ * loop. This is a hack to prevent starvation; it would be smarter
+ * to just use event_config_set_max_dispatch_interval's max_callbacks
+ * feature */
+ int n_deferreds_queued;
+
+ /* Active event management. */
+ /** An array of nactivequeues queues for active event_callbacks (ones
+ * that have triggered, and whose callbacks need to be called). Low
+ * priority numbers are more important, and stall higher ones.
+ */
+ struct evcallback_list *activequeues;
+ /** The length of the activequeues array */
+ int nactivequeues;
+ /** A list of event_callbacks that should become active the next time
+ * we process events, but not this time. */
+ struct evcallback_list active_later_queue;
+
+ /* common timeout logic */
+
+ /** An array of common_timeout_list* for all of the common timeout
+ * values we know. */
+ struct common_timeout_list **common_timeout_queues;
+ /** The number of entries used in common_timeout_queues */
+ int n_common_timeouts;
+ /** The total size of common_timeout_queues. */
+ int n_common_timeouts_allocated;
+
+ /** Mapping from file descriptors to enabled (added) events */
+ struct event_io_map io;
+
+ /** Mapping from signal numbers to enabled (added) events. */
+ struct event_signal_map sigmap;
+
+ /** Priority queue of events with timeouts. */
+ struct min_heap timeheap;
+
+ /** Stored timeval: used to avoid calling gettimeofday/clock_gettime
+ * too often. */
+ struct timeval tv_cache;
+
+ struct evutil_monotonic_timer monotonic_timer;
+
+ /** Difference between internal time (maybe from clock_gettime) and
+ * gettimeofday. */
+ struct timeval tv_clock_diff;
+ /** Second in which we last updated tv_clock_diff, in monotonic time. */
+ time_t last_updated_clock_diff;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ /* threading support */
+ /** The thread currently running the event_loop for this base */
+ unsigned long th_owner_id;
+ /** A lock to prevent conflicting accesses to this event_base */
+ void *th_base_lock;
+ /** A condition that gets signalled when we're done processing an
+ * event with waiters on it. */
+ void *current_event_cond;
+ /** Number of threads blocking on current_event_cond. */
+ int current_event_waiters;
+#endif
+ /** The event whose callback is executing right now */
+ struct event_callback *current_event;
+
+#ifdef _WIN32
+ /** IOCP support structure, if IOCP is enabled. */
+ struct event_iocp_port *iocp;
+#endif
+
+ /** Flags that this base was configured with */
+ enum event_base_config_flag flags;
+
+ struct timeval max_dispatch_time;
+ int max_dispatch_callbacks;
+ int limit_callbacks_after_prio;
+
+ /* Notify main thread to wake up break, etc. */
+ /** True if the base already has a pending notify, and we don't need
+ * to add any more. */
+ int is_notify_pending;
+ /** A socketpair used by some th_notify functions to wake up the main
+ * thread. */
+ evutil_socket_t th_notify_fd[2];
+ /** An event used by some th_notify functions to wake up the main
+ * thread. */
+ struct event th_notify;
+ /** A function used to wake up the main thread from another thread. */
+ int (*th_notify_fn)(struct event_base *base);
+
+ /** Saved seed for weak random number generator. Some backends use
+ * this to produce fairness among sockets. Protected by th_base_lock. */
+ struct evutil_weakrand_state weakrand_seed;
+
+ /** List of event_onces that have not yet fired. */
+ LIST_HEAD(once_event_list, event_once) once_events;
+
+};
+
+struct event_config_entry {
+ TAILQ_ENTRY(event_config_entry) next;
+
+ const char *avoid_method;
+};
+
+/** Internal structure: describes the configuration we want for an event_base
+ * that we're about to allocate. */
+struct event_config {
+ TAILQ_HEAD(event_configq, event_config_entry) entries;
+
+ int n_cpus_hint;
+ struct timeval max_dispatch_interval;
+ int max_dispatch_callbacks;
+ int limit_callbacks_after_prio;
+ enum event_method_feature require_features;
+ enum event_base_config_flag flags;
+};
+
+/* Internal use only: Functions that might be missing from <sys/queue.h> */
+#if defined(EVENT__HAVE_SYS_QUEUE_H) && !defined(EVENT__HAVE_TAILQFOREACH)
+#ifndef TAILQ_FIRST
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#endif
+#ifndef TAILQ_END
+#define TAILQ_END(head) NULL
+#endif
+#ifndef TAILQ_NEXT
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#endif
+
+#ifndef TAILQ_FOREACH
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = TAILQ_FIRST(head); \
+ (var) != TAILQ_END(head); \
+ (var) = TAILQ_NEXT(var, field))
+#endif
+
+#ifndef TAILQ_INSERT_BEFORE
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (0)
+#endif
+#endif /* TAILQ_FOREACH */
+
+#define N_ACTIVE_CALLBACKS(base) \
+ ((base)->event_count_active)
+
+int evsig_set_handler_(struct event_base *base, int evsignal,
+ void (*fn)(int));
+int evsig_restore_handler_(struct event_base *base, int evsignal);
+
+int event_add_nolock_(struct event *ev,
+ const struct timeval *tv, int tv_is_absolute);
+/** Argument for event_del_nolock_. Tells event_del not to block on the event
+ * if it's running in another thread. */
+#define EVENT_DEL_NOBLOCK 0
+/** Argument for event_del_nolock_. Tells event_del to block on the event
+ * if it's running in another thread, regardless of its value for EV_FINALIZE
+ */
+#define EVENT_DEL_BLOCK 1
+/** Argument for event_del_nolock_. Tells event_del to block on the event
+ * if it is running in another thread and it doesn't have EV_FINALIZE set.
+ */
+#define EVENT_DEL_AUTOBLOCK 2
+/** Argument for event_del_nolock_. Tells event_del to procede even if the
+ * event is set up for finalization rather for regular use.*/
+#define EVENT_DEL_EVEN_IF_FINALIZING 3
+int event_del_nolock_(struct event *ev, int blocking);
+int event_remove_timer_nolock_(struct event *ev);
+
+void event_active_nolock_(struct event *ev, int res, short count);
+int event_callback_activate_(struct event_base *, struct event_callback *);
+int event_callback_activate_nolock_(struct event_base *, struct event_callback *);
+int event_callback_cancel_(struct event_base *base,
+ struct event_callback *evcb);
+
+void event_callback_finalize_nolock_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *));
+void event_callback_finalize_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *));
+int event_callback_finalize_many_(struct event_base *base, int n_cbs, struct event_callback **evcb, void (*cb)(struct event_callback *, void *));
+
+
+void event_active_later_(struct event *ev, int res);
+void event_active_later_nolock_(struct event *ev, int res);
+void event_callback_activate_later_nolock_(struct event_base *base,
+ struct event_callback *evcb);
+int event_callback_cancel_nolock_(struct event_base *base,
+ struct event_callback *evcb, int even_if_finalizing);
+void event_callback_init_(struct event_base *base,
+ struct event_callback *cb);
+
+/* FIXME document. */
+void event_base_add_virtual_(struct event_base *base);
+void event_base_del_virtual_(struct event_base *base);
+
+/** For debugging: unless assertions are disabled, verify the referential
+ integrity of the internal data structures of 'base'. This operation can
+ be expensive.
+
+ Returns on success; aborts on failure.
+*/
+void event_base_assert_ok_(struct event_base *base);
+void event_base_assert_ok_nolock_(struct event_base *base);
+
+
+/* Helper function: Call 'fn' exactly once every inserted or active event in
+ * the event_base 'base'.
+ *
+ * If fn returns 0, continue on to the next event. Otherwise, return the same
+ * value that fn returned.
+ *
+ * Requires that 'base' be locked.
+ */
+int event_base_foreach_event_nolock_(struct event_base *base,
+ event_base_foreach_event_cb cb, void *arg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/event.c b/sntp/libevent/event.c
new file mode 100644
index 0000000..01f0e14
--- /dev/null
+++ b/sntp/libevent/event.c
@@ -0,0 +1,3862 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#if !defined(_WIN32) && defined(EVENT__HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+#include <limits.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event-internal.h"
+#include "defer-internal.h"
+#include "evthread-internal.h"
+#include "event2/thread.h"
+#include "event2/util.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "iocp-internal.h"
+#include "changelist-internal.h"
+#define HT_NO_CACHE_HASH_VALUES
+#include "ht-internal.h"
+#include "util-internal.h"
+
+
+#ifdef EVENT__HAVE_WORKING_KQUEUE
+#include "kqueue-internal.h"
+#endif
+
+#ifdef EVENT__HAVE_EVENT_PORTS
+extern const struct eventop evportops;
+#endif
+#ifdef EVENT__HAVE_SELECT
+extern const struct eventop selectops;
+#endif
+#ifdef EVENT__HAVE_POLL
+extern const struct eventop pollops;
+#endif
+#ifdef EVENT__HAVE_EPOLL
+extern const struct eventop epollops;
+#endif
+#ifdef EVENT__HAVE_WORKING_KQUEUE
+extern const struct eventop kqops;
+#endif
+#ifdef EVENT__HAVE_DEVPOLL
+extern const struct eventop devpollops;
+#endif
+#ifdef _WIN32
+extern const struct eventop win32ops;
+#endif
+
+/* Array of backends in order of preference. */
+static const struct eventop *eventops[] = {
+#ifdef EVENT__HAVE_EVENT_PORTS
+ &evportops,
+#endif
+#ifdef EVENT__HAVE_WORKING_KQUEUE
+ &kqops,
+#endif
+#ifdef EVENT__HAVE_EPOLL
+ &epollops,
+#endif
+#ifdef EVENT__HAVE_DEVPOLL
+ &devpollops,
+#endif
+#ifdef EVENT__HAVE_POLL
+ &pollops,
+#endif
+#ifdef EVENT__HAVE_SELECT
+ &selectops,
+#endif
+#ifdef _WIN32
+ &win32ops,
+#endif
+ NULL
+};
+
+/* Global state; deprecated */
+struct event_base *event_global_current_base_ = NULL;
+#define current_base event_global_current_base_
+
+/* Global state */
+
+static void *event_self_cbarg_ptr_ = NULL;
+
+/* Prototypes */
+static void event_queue_insert_active(struct event_base *, struct event_callback *);
+static void event_queue_insert_active_later(struct event_base *, struct event_callback *);
+static void event_queue_insert_timeout(struct event_base *, struct event *);
+static void event_queue_insert_inserted(struct event_base *, struct event *);
+static void event_queue_remove_active(struct event_base *, struct event_callback *);
+static void event_queue_remove_active_later(struct event_base *, struct event_callback *);
+static void event_queue_remove_timeout(struct event_base *, struct event *);
+static void event_queue_remove_inserted(struct event_base *, struct event *);
+static void event_queue_make_later_events_active(struct event_base *base);
+
+static int evthread_make_base_notifiable_nolock_(struct event_base *base);
+static int event_del_(struct event *ev, int blocking);
+
+#ifdef USE_REINSERT_TIMEOUT
+/* This code seems buggy; only turn it on if we find out what the trouble is. */
+static void event_queue_reinsert_timeout(struct event_base *,struct event *, int was_common, int is_common, int old_timeout_idx);
+#endif
+
+static int event_haveevents(struct event_base *);
+
+static int event_process_active(struct event_base *);
+
+static int timeout_next(struct event_base *, struct timeval **);
+static void timeout_process(struct event_base *);
+
+static inline void event_signal_closure(struct event_base *, struct event *ev);
+static inline void event_persist_closure(struct event_base *, struct event *ev);
+
+static int evthread_notify_base(struct event_base *base);
+
+static void insert_common_timeout_inorder(struct common_timeout_list *ctl,
+ struct event *ev);
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+/* These functions implement a hashtable of which 'struct event *' structures
+ * have been setup or added. We don't want to trust the content of the struct
+ * event itself, since we're trying to work through cases where an event gets
+ * clobbered or freed. Instead, we keep a hashtable indexed by the pointer.
+ */
+
+struct event_debug_entry {
+ HT_ENTRY(event_debug_entry) node;
+ const struct event *ptr;
+ unsigned added : 1;
+};
+
+static inline unsigned
+hash_debug_entry(const struct event_debug_entry *e)
+{
+ /* We need to do this silliness to convince compilers that we
+ * honestly mean to cast e->ptr to an integer, and discard any
+ * part of it that doesn't fit in an unsigned.
+ */
+ unsigned u = (unsigned) ((ev_uintptr_t) e->ptr);
+ /* Our hashtable implementation is pretty sensitive to low bits,
+ * and every struct event is over 64 bytes in size, so we can
+ * just say >>6. */
+ return (u >> 6);
+}
+
+static inline int
+eq_debug_entry(const struct event_debug_entry *a,
+ const struct event_debug_entry *b)
+{
+ return a->ptr == b->ptr;
+}
+
+int event_debug_mode_on_ = 0;
+/* Set if it's too late to enable event_debug_mode. */
+static int event_debug_mode_too_late = 0;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+static void *event_debug_map_lock_ = NULL;
+#endif
+static HT_HEAD(event_debug_map, event_debug_entry) global_debug_map =
+ HT_INITIALIZER();
+
+HT_PROTOTYPE(event_debug_map, event_debug_entry, node, hash_debug_entry,
+ eq_debug_entry)
+HT_GENERATE(event_debug_map, event_debug_entry, node, hash_debug_entry,
+ eq_debug_entry, 0.5, mm_malloc, mm_realloc, mm_free)
+
+/* Macro: record that ev is now setup (that is, ready for an add) */
+#define event_debug_note_setup_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent) { \
+ dent->added = 0; \
+ } else { \
+ dent = mm_malloc(sizeof(*dent)); \
+ if (!dent) \
+ event_err(1, \
+ "Out of memory in debugging code"); \
+ dent->ptr = (ev); \
+ dent->added = 0; \
+ HT_INSERT(event_debug_map, &global_debug_map, dent); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: record that ev is no longer setup */
+#define event_debug_note_teardown_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_REMOVE(event_debug_map, &global_debug_map, &find); \
+ if (dent) \
+ mm_free(dent); \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: record that ev is now added */
+#define event_debug_note_add_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent) { \
+ dent->added = 1; \
+ } else { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s: noting an add on a non-setup event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT \
+ ", flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: record that ev is no longer added */
+#define event_debug_note_del_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent) { \
+ dent->added = 0; \
+ } else { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s: noting a del on a non-setup event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT \
+ ", flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ event_debug_mode_too_late = 1; \
+ } while (0)
+/* Macro: assert that ev is setup (i.e., okay to add or inspect) */
+#define event_debug_assert_is_setup_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (!dent) { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s called on a non-initialized event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT\
+ ", flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ } while (0)
+/* Macro: assert that ev is not added (i.e., okay to tear down or set
+ * up again) */
+#define event_debug_assert_not_added_(ev) do { \
+ if (event_debug_mode_on_) { \
+ struct event_debug_entry *dent,find; \
+ find.ptr = (ev); \
+ EVLOCK_LOCK(event_debug_map_lock_, 0); \
+ dent = HT_FIND(event_debug_map, &global_debug_map, &find); \
+ if (dent && dent->added) { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s called on an already added event %p" \
+ " (events: 0x%x, fd: "EV_SOCK_FMT", " \
+ "flags: 0x%x)", \
+ __func__, (ev), (ev)->ev_events, \
+ EV_SOCK_ARG((ev)->ev_fd), (ev)->ev_flags); \
+ } \
+ EVLOCK_UNLOCK(event_debug_map_lock_, 0); \
+ } \
+ } while (0)
+#else
+#define event_debug_note_setup_(ev) \
+ ((void)0)
+#define event_debug_note_teardown_(ev) \
+ ((void)0)
+#define event_debug_note_add_(ev) \
+ ((void)0)
+#define event_debug_note_del_(ev) \
+ ((void)0)
+#define event_debug_assert_is_setup_(ev) \
+ ((void)0)
+#define event_debug_assert_not_added_(ev) \
+ ((void)0)
+#endif
+
+#define EVENT_BASE_ASSERT_LOCKED(base) \
+ EVLOCK_ASSERT_LOCKED((base)->th_base_lock)
+
+/* How often (in seconds) do we check for changes in wall clock time relative
+ * to monotonic time? Set this to -1 for 'never.' */
+#define CLOCK_SYNC_INTERVAL 5
+
+/** Set 'tp' to the current time according to 'base'. We must hold the lock
+ * on 'base'. If there is a cached time, return it. Otherwise, use
+ * clock_gettime or gettimeofday as appropriate to find out the right time.
+ * Return 0 on success, -1 on failure.
+ */
+static int
+gettime(struct event_base *base, struct timeval *tp)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (base->tv_cache.tv_sec) {
+ *tp = base->tv_cache;
+ return (0);
+ }
+
+ if (evutil_gettime_monotonic_(&base->monotonic_timer, tp) == -1) {
+ return -1;
+ }
+
+ if (base->last_updated_clock_diff + CLOCK_SYNC_INTERVAL
+ < tp->tv_sec) {
+ struct timeval tv;
+ evutil_gettimeofday(&tv,NULL);
+ evutil_timersub(&tv, tp, &base->tv_clock_diff);
+ base->last_updated_clock_diff = tp->tv_sec;
+ }
+
+ return 0;
+}
+
+int
+event_base_gettimeofday_cached(struct event_base *base, struct timeval *tv)
+{
+ int r;
+ if (!base) {
+ base = current_base;
+ if (!current_base)
+ return evutil_gettimeofday(tv, NULL);
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (base->tv_cache.tv_sec == 0) {
+ r = evutil_gettimeofday(tv, NULL);
+ } else {
+ evutil_timeradd(&base->tv_cache, &base->tv_clock_diff, tv);
+ r = 0;
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+/** Make 'base' have no current cached time. */
+static inline void
+clear_time_cache(struct event_base *base)
+{
+ base->tv_cache.tv_sec = 0;
+}
+
+/** Replace the cached time in 'base' with the current time. */
+static inline void
+update_time_cache(struct event_base *base)
+{
+ base->tv_cache.tv_sec = 0;
+ if (!(base->flags & EVENT_BASE_FLAG_NO_CACHE_TIME))
+ gettime(base, &base->tv_cache);
+}
+
+int
+event_base_update_cache_time(struct event_base *base)
+{
+
+ if (!base) {
+ base = current_base;
+ if (!current_base)
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (base->running_loop)
+ update_time_cache(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return 0;
+}
+
+static inline struct event *
+event_callback_to_event(struct event_callback *evcb)
+{
+ EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_INIT));
+ return EVUTIL_UPCAST(evcb, struct event, ev_evcallback);
+}
+
+static inline struct event_callback *
+event_to_event_callback(struct event *ev)
+{
+ return &ev->ev_evcallback;
+}
+
+struct event_base *
+event_init(void)
+{
+ struct event_base *base = event_base_new_with_config(NULL);
+
+ if (base == NULL) {
+ event_errx(1, "%s: Unable to construct event_base", __func__);
+ return NULL;
+ }
+
+ current_base = base;
+
+ return (base);
+}
+
+struct event_base *
+event_base_new(void)
+{
+ struct event_base *base = NULL;
+ struct event_config *cfg = event_config_new();
+ if (cfg) {
+ base = event_base_new_with_config(cfg);
+ event_config_free(cfg);
+ }
+ return base;
+}
+
+/** Return true iff 'method' is the name of a method that 'cfg' tells us to
+ * avoid. */
+static int
+event_config_is_avoided_method(const struct event_config *cfg,
+ const char *method)
+{
+ struct event_config_entry *entry;
+
+ TAILQ_FOREACH(entry, &cfg->entries, next) {
+ if (entry->avoid_method != NULL &&
+ strcmp(entry->avoid_method, method) == 0)
+ return (1);
+ }
+
+ return (0);
+}
+
+/** Return true iff 'method' is disabled according to the environment. */
+static int
+event_is_method_disabled(const char *name)
+{
+ char environment[64];
+ int i;
+
+ evutil_snprintf(environment, sizeof(environment), "EVENT_NO%s", name);
+ for (i = 8; environment[i] != '\0'; ++i)
+ environment[i] = EVUTIL_TOUPPER_(environment[i]);
+ /* Note that evutil_getenv_() ignores the environment entirely if
+ * we're setuid */
+ return (evutil_getenv_(environment) != NULL);
+}
+
+int
+event_base_get_features(const struct event_base *base)
+{
+ return base->evsel->features;
+}
+
+void
+event_enable_debug_mode(void)
+{
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_mode_on_)
+ event_errx(1, "%s was called twice!", __func__);
+ if (event_debug_mode_too_late)
+ event_errx(1, "%s must be called *before* creating any events "
+ "or event_bases",__func__);
+
+ event_debug_mode_on_ = 1;
+
+ HT_INIT(event_debug_map, &global_debug_map);
+#endif
+}
+
+#if 0
+void
+event_disable_debug_mode(void)
+{
+ struct event_debug_entry **ent, *victim;
+
+ EVLOCK_LOCK(event_debug_map_lock_, 0);
+ for (ent = HT_START(event_debug_map, &global_debug_map); ent; ) {
+ victim = *ent;
+ ent = HT_NEXT_RMV(event_debug_map,&global_debug_map, ent);
+ mm_free(victim);
+ }
+ HT_CLEAR(event_debug_map, &global_debug_map);
+ EVLOCK_UNLOCK(event_debug_map_lock_ , 0);
+}
+#endif
+
+struct event_base *
+event_base_new_with_config(const struct event_config *cfg)
+{
+ int i;
+ struct event_base *base;
+ int should_check_environment;
+
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ event_debug_mode_too_late = 1;
+#endif
+
+ if ((base = mm_calloc(1, sizeof(struct event_base))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ return NULL;
+ }
+
+ if (cfg)
+ base->flags = cfg->flags;
+
+ should_check_environment =
+ !(cfg && (cfg->flags & EVENT_BASE_FLAG_IGNORE_ENV));
+
+ {
+ struct timeval tmp;
+ int precise_time =
+ cfg && (cfg->flags & EVENT_BASE_FLAG_PRECISE_TIMER);
+ int flags;
+ if (should_check_environment && !precise_time) {
+ precise_time = evutil_getenv_("EVENT_PRECISE_TIMER") != NULL;
+ base->flags |= EVENT_BASE_FLAG_PRECISE_TIMER;
+ }
+ flags = precise_time ? EV_MONOT_PRECISE : 0;
+ evutil_configure_monotonic_time_(&base->monotonic_timer, flags);
+
+ gettime(base, &tmp);
+ }
+
+ min_heap_ctor_(&base->timeheap);
+
+ base->sig.ev_signal_pair[0] = -1;
+ base->sig.ev_signal_pair[1] = -1;
+ base->th_notify_fd[0] = -1;
+ base->th_notify_fd[1] = -1;
+
+ TAILQ_INIT(&base->active_later_queue);
+
+ evmap_io_initmap_(&base->io);
+ evmap_signal_initmap_(&base->sigmap);
+ event_changelist_init_(&base->changelist);
+
+ base->evbase = NULL;
+
+ if (cfg) {
+ memcpy(&base->max_dispatch_time,
+ &cfg->max_dispatch_interval, sizeof(struct timeval));
+ base->limit_callbacks_after_prio =
+ cfg->limit_callbacks_after_prio;
+ } else {
+ base->max_dispatch_time.tv_sec = -1;
+ base->limit_callbacks_after_prio = 1;
+ }
+ if (cfg && cfg->max_dispatch_callbacks >= 0) {
+ base->max_dispatch_callbacks = cfg->max_dispatch_callbacks;
+ } else {
+ base->max_dispatch_callbacks = INT_MAX;
+ }
+ if (base->max_dispatch_callbacks == INT_MAX &&
+ base->max_dispatch_time.tv_sec == -1)
+ base->limit_callbacks_after_prio = INT_MAX;
+
+ for (i = 0; eventops[i] && !base->evbase; i++) {
+ if (cfg != NULL) {
+ /* determine if this backend should be avoided */
+ if (event_config_is_avoided_method(cfg,
+ eventops[i]->name))
+ continue;
+ if ((eventops[i]->features & cfg->require_features)
+ != cfg->require_features)
+ continue;
+ }
+
+ /* also obey the environment variables */
+ if (should_check_environment &&
+ event_is_method_disabled(eventops[i]->name))
+ continue;
+
+ base->evsel = eventops[i];
+
+ base->evbase = base->evsel->init(base);
+ }
+
+ if (base->evbase == NULL) {
+ event_warnx("%s: no event mechanism available",
+ __func__);
+ base->evsel = NULL;
+ event_base_free(base);
+ return NULL;
+ }
+
+ if (evutil_getenv_("EVENT_SHOW_METHOD"))
+ event_msgx("libevent using: %s", base->evsel->name);
+
+ /* allocate a single active event queue */
+ if (event_base_priority_init(base, 1) < 0) {
+ event_base_free(base);
+ return NULL;
+ }
+
+ /* prepare for threading */
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (EVTHREAD_LOCKING_ENABLED() &&
+ (!cfg || !(cfg->flags & EVENT_BASE_FLAG_NOLOCK))) {
+ int r;
+ EVTHREAD_ALLOC_LOCK(base->th_base_lock, 0);
+ EVTHREAD_ALLOC_COND(base->current_event_cond);
+ r = evthread_make_base_notifiable(base);
+ if (r<0) {
+ event_warnx("%s: Unable to make base notifiable.", __func__);
+ event_base_free(base);
+ return NULL;
+ }
+ }
+#endif
+
+#ifdef _WIN32
+ if (cfg && (cfg->flags & EVENT_BASE_FLAG_STARTUP_IOCP))
+ event_base_start_iocp_(base, cfg->n_cpus_hint);
+#endif
+
+ return (base);
+}
+
+int
+event_base_start_iocp_(struct event_base *base, int n_cpus)
+{
+#ifdef _WIN32
+ if (base->iocp)
+ return 0;
+ base->iocp = event_iocp_port_launch_(n_cpus);
+ if (!base->iocp) {
+ event_warnx("%s: Couldn't launch IOCP", __func__);
+ return -1;
+ }
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+void
+event_base_stop_iocp_(struct event_base *base)
+{
+#ifdef _WIN32
+ int rv;
+
+ if (!base->iocp)
+ return;
+ rv = event_iocp_shutdown_(base->iocp, -1);
+ EVUTIL_ASSERT(rv >= 0);
+ base->iocp = NULL;
+#endif
+}
+
+static int
+event_base_cancel_single_callback_(struct event_base *base,
+ struct event_callback *evcb,
+ int run_finalizers)
+{
+ int result = 0;
+
+ if (evcb->evcb_flags & EVLIST_INIT) {
+ struct event *ev = event_callback_to_event(evcb);
+ if (!(ev->ev_flags & EVLIST_INTERNAL)) {
+ event_del_(ev, EVENT_DEL_EVEN_IF_FINALIZING);
+ result = 1;
+ }
+ } else {
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ event_callback_cancel_nolock_(base, evcb, 1);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ result = 1;
+ }
+
+ if (run_finalizers && (evcb->evcb_flags & EVLIST_FINALIZING)) {
+ switch (evcb->evcb_closure) {
+ case EV_CLOSURE_EVENT_FINALIZE:
+ case EV_CLOSURE_EVENT_FINALIZE_FREE: {
+ struct event *ev = event_callback_to_event(evcb);
+ ev->ev_evcallback.evcb_cb_union.evcb_evfinalize(ev, ev->ev_arg);
+ if (evcb->evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE)
+ mm_free(ev);
+ break;
+ }
+ case EV_CLOSURE_CB_FINALIZE:
+ evcb->evcb_cb_union.evcb_cbfinalize(evcb, evcb->evcb_arg);
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
+
+static void
+event_base_free_(struct event_base *base, int run_finalizers)
+{
+ int i, n_deleted=0;
+ struct event *ev;
+ /* XXXX grab the lock? If there is contention when one thread frees
+ * the base, then the contending thread will be very sad soon. */
+
+ /* event_base_free(NULL) is how to free the current_base if we
+ * made it with event_init and forgot to hold a reference to it. */
+ if (base == NULL && current_base)
+ base = current_base;
+ /* Don't actually free NULL. */
+ if (base == NULL) {
+ event_warnx("%s: no base to free", __func__);
+ return;
+ }
+ /* XXX(niels) - check for internal events first */
+
+#ifdef _WIN32
+ event_base_stop_iocp_(base);
+#endif
+
+ /* threading fds if we have them */
+ if (base->th_notify_fd[0] != -1) {
+ event_del(&base->th_notify);
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[0]);
+ if (base->th_notify_fd[1] != -1)
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[1]);
+ base->th_notify_fd[0] = -1;
+ base->th_notify_fd[1] = -1;
+ event_debug_unassign(&base->th_notify);
+ }
+
+ /* Delete all non-internal events. */
+ evmap_delete_all_(base);
+
+ while ((ev = min_heap_top_(&base->timeheap)) != NULL) {
+ event_del(ev);
+ ++n_deleted;
+ }
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ struct common_timeout_list *ctl =
+ base->common_timeout_queues[i];
+ event_del(&ctl->timeout_event); /* Internal; doesn't count */
+ event_debug_unassign(&ctl->timeout_event);
+ for (ev = TAILQ_FIRST(&ctl->events); ev; ) {
+ struct event *next = TAILQ_NEXT(ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ if (!(ev->ev_flags & EVLIST_INTERNAL)) {
+ event_del(ev);
+ ++n_deleted;
+ }
+ ev = next;
+ }
+ mm_free(ctl);
+ }
+ if (base->common_timeout_queues)
+ mm_free(base->common_timeout_queues);
+
+ for (i = 0; i < base->nactivequeues; ++i) {
+ struct event_callback *evcb, *next;
+ for (evcb = TAILQ_FIRST(&base->activequeues[i]); evcb; ) {
+ next = TAILQ_NEXT(evcb, evcb_active_next);
+ n_deleted += event_base_cancel_single_callback_(base, evcb, run_finalizers);
+ evcb = next;
+ }
+ }
+ {
+ struct event_callback *evcb;
+ while ((evcb = TAILQ_FIRST(&base->active_later_queue))) {
+ n_deleted += event_base_cancel_single_callback_(base, evcb, run_finalizers);
+ }
+ }
+
+
+ if (n_deleted)
+ event_debug(("%s: %d events were still set in base",
+ __func__, n_deleted));
+
+ while (LIST_FIRST(&base->once_events)) {
+ struct event_once *eonce = LIST_FIRST(&base->once_events);
+ LIST_REMOVE(eonce, next_once);
+ mm_free(eonce);
+ }
+
+ if (base->evsel != NULL && base->evsel->dealloc != NULL)
+ base->evsel->dealloc(base);
+
+ for (i = 0; i < base->nactivequeues; ++i)
+ EVUTIL_ASSERT(TAILQ_EMPTY(&base->activequeues[i]));
+
+ EVUTIL_ASSERT(min_heap_empty_(&base->timeheap));
+ min_heap_dtor_(&base->timeheap);
+
+ mm_free(base->activequeues);
+
+ evmap_io_clear_(&base->io);
+ evmap_signal_clear_(&base->sigmap);
+ event_changelist_freemem_(&base->changelist);
+
+ EVTHREAD_FREE_LOCK(base->th_base_lock, 0);
+ EVTHREAD_FREE_COND(base->current_event_cond);
+
+ /* If we're freeing current_base, there won't be a current_base. */
+ if (base == current_base)
+ current_base = NULL;
+ mm_free(base);
+}
+
+void
+event_base_free_nofinalize(struct event_base *base)
+{
+ event_base_free_(base, 0);
+}
+
+void
+event_base_free(struct event_base *base)
+{
+ event_base_free_(base, 1);
+}
+
+/* Fake eventop; used to disable the backend temporarily inside event_reinit
+ * so that we can call event_del() on an event without telling the backend.
+ */
+static int
+nil_backend_del(struct event_base *b, evutil_socket_t fd, short old,
+ short events, void *fdinfo)
+{
+ return 0;
+}
+const struct eventop nil_eventop = {
+ "nil",
+ NULL, /* init: unused. */
+ NULL, /* add: unused. */
+ nil_backend_del, /* del: used, so needs to be killed. */
+ NULL, /* dispatch: unused. */
+ NULL, /* dealloc: unused. */
+ 0, 0, 0
+};
+
+/* reinitialize the event base after a fork */
+int
+event_reinit(struct event_base *base)
+{
+ const struct eventop *evsel;
+ int res = 0;
+ int was_notifiable = 0;
+ int had_signal_added = 0;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ evsel = base->evsel;
+
+ /* check if this event mechanism requires reinit on the backend */
+ if (evsel->need_reinit) {
+ /* We're going to call event_del() on our notify events (the
+ * ones that tell about signals and wakeup events). But we
+ * don't actually want to tell the backend to change its
+ * state, since it might still share some resource (a kqueue,
+ * an epoll fd) with the parent process, and we don't want to
+ * delete the fds from _that_ backend, we temporarily stub out
+ * the evsel with a replacement.
+ */
+ base->evsel = &nil_eventop;
+ }
+
+ /* We need to re-create a new signal-notification fd and a new
+ * thread-notification fd. Otherwise, we'll still share those with
+ * the parent process, which would make any notification sent to them
+ * get received by one or both of the event loops, more or less at
+ * random.
+ */
+ if (base->sig.ev_signal_added) {
+ event_del_nolock_(&base->sig.ev_signal, EVENT_DEL_AUTOBLOCK);
+ event_debug_unassign(&base->sig.ev_signal);
+ memset(&base->sig.ev_signal, 0, sizeof(base->sig.ev_signal));
+ if (base->sig.ev_signal_pair[0] != -1)
+ EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[0]);
+ if (base->sig.ev_signal_pair[1] != -1)
+ EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[1]);
+ had_signal_added = 1;
+ base->sig.ev_signal_added = 0;
+ }
+ if (base->th_notify_fn != NULL) {
+ was_notifiable = 1;
+ base->th_notify_fn = NULL;
+ }
+ if (base->th_notify_fd[0] != -1) {
+ event_del_nolock_(&base->th_notify, EVENT_DEL_AUTOBLOCK);
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[0]);
+ if (base->th_notify_fd[1] != -1)
+ EVUTIL_CLOSESOCKET(base->th_notify_fd[1]);
+ base->th_notify_fd[0] = -1;
+ base->th_notify_fd[1] = -1;
+ event_debug_unassign(&base->th_notify);
+ }
+
+ /* Replace the original evsel. */
+ base->evsel = evsel;
+
+ if (evsel->need_reinit) {
+ /* Reconstruct the backend through brute-force, so that we do
+ * not share any structures with the parent process. For some
+ * backends, this is necessary: epoll and kqueue, for
+ * instance, have events associated with a kernel
+ * structure. If didn't reinitialize, we'd share that
+ * structure with the parent process, and any changes made by
+ * the parent would affect our backend's behavior (and vice
+ * versa).
+ */
+ if (base->evsel->dealloc != NULL)
+ base->evsel->dealloc(base);
+ base->evbase = evsel->init(base);
+ if (base->evbase == NULL) {
+ event_errx(1,
+ "%s: could not reinitialize event mechanism",
+ __func__);
+ res = -1;
+ goto done;
+ }
+
+ /* Empty out the changelist (if any): we are starting from a
+ * blank slate. */
+ event_changelist_freemem_(&base->changelist);
+
+ /* Tell the event maps to re-inform the backend about all
+ * pending events. This will make the signal notification
+ * event get re-created if necessary. */
+ if (evmap_reinit_(base) < 0)
+ res = -1;
+ } else {
+ if (had_signal_added)
+ res = evsig_init_(base);
+ }
+
+ /* If we were notifiable before, and nothing just exploded, become
+ * notifiable again. */
+ if (was_notifiable && res == 0)
+ res = evthread_make_base_notifiable_nolock_(base);
+
+done:
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return (res);
+}
+
+const char **
+event_get_supported_methods(void)
+{
+ static const char **methods = NULL;
+ const struct eventop **method;
+ const char **tmp;
+ int i = 0, k;
+
+ /* count all methods */
+ for (method = &eventops[0]; *method != NULL; ++method) {
+ ++i;
+ }
+
+ /* allocate one more than we need for the NULL pointer */
+ tmp = mm_calloc((i + 1), sizeof(char *));
+ if (tmp == NULL)
+ return (NULL);
+
+ /* populate the array with the supported methods */
+ for (k = 0, i = 0; eventops[k] != NULL; ++k) {
+ tmp[i++] = eventops[k]->name;
+ }
+ tmp[i] = NULL;
+
+ if (methods != NULL)
+ mm_free((char**)methods);
+
+ methods = tmp;
+
+ return (methods);
+}
+
+struct event_config *
+event_config_new(void)
+{
+ struct event_config *cfg = mm_calloc(1, sizeof(*cfg));
+
+ if (cfg == NULL)
+ return (NULL);
+
+ TAILQ_INIT(&cfg->entries);
+ cfg->max_dispatch_interval.tv_sec = -1;
+ cfg->max_dispatch_callbacks = INT_MAX;
+ cfg->limit_callbacks_after_prio = 1;
+
+ return (cfg);
+}
+
+static void
+event_config_entry_free(struct event_config_entry *entry)
+{
+ if (entry->avoid_method != NULL)
+ mm_free((char *)entry->avoid_method);
+ mm_free(entry);
+}
+
+void
+event_config_free(struct event_config *cfg)
+{
+ struct event_config_entry *entry;
+
+ while ((entry = TAILQ_FIRST(&cfg->entries)) != NULL) {
+ TAILQ_REMOVE(&cfg->entries, entry, next);
+ event_config_entry_free(entry);
+ }
+ mm_free(cfg);
+}
+
+int
+event_config_set_flag(struct event_config *cfg, int flag)
+{
+ if (!cfg)
+ return -1;
+ cfg->flags |= flag;
+ return 0;
+}
+
+int
+event_config_avoid_method(struct event_config *cfg, const char *method)
+{
+ struct event_config_entry *entry = mm_malloc(sizeof(*entry));
+ if (entry == NULL)
+ return (-1);
+
+ if ((entry->avoid_method = mm_strdup(method)) == NULL) {
+ mm_free(entry);
+ return (-1);
+ }
+
+ TAILQ_INSERT_TAIL(&cfg->entries, entry, next);
+
+ return (0);
+}
+
+int
+event_config_require_features(struct event_config *cfg,
+ int features)
+{
+ if (!cfg)
+ return (-1);
+ cfg->require_features = features;
+ return (0);
+}
+
+int
+event_config_set_num_cpus_hint(struct event_config *cfg, int cpus)
+{
+ if (!cfg)
+ return (-1);
+ cfg->n_cpus_hint = cpus;
+ return (0);
+}
+
+int
+event_config_set_max_dispatch_interval(struct event_config *cfg,
+ const struct timeval *max_interval, int max_callbacks, int min_priority)
+{
+ if (max_interval)
+ memcpy(&cfg->max_dispatch_interval, max_interval,
+ sizeof(struct timeval));
+ else
+ cfg->max_dispatch_interval.tv_sec = -1;
+ cfg->max_dispatch_callbacks =
+ max_callbacks >= 0 ? max_callbacks : INT_MAX;
+ if (min_priority < 0)
+ min_priority = 0;
+ cfg->limit_callbacks_after_prio = min_priority;
+ return (0);
+}
+
+int
+event_priority_init(int npriorities)
+{
+ return event_base_priority_init(current_base, npriorities);
+}
+
+int
+event_base_priority_init(struct event_base *base, int npriorities)
+{
+ int i, r;
+ r = -1;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (N_ACTIVE_CALLBACKS(base) || npriorities < 1
+ || npriorities >= EVENT_MAX_PRIORITIES)
+ goto err;
+
+ if (npriorities == base->nactivequeues)
+ goto ok;
+
+ if (base->nactivequeues) {
+ mm_free(base->activequeues);
+ base->nactivequeues = 0;
+ }
+
+ /* Allocate our priority queues */
+ base->activequeues = (struct evcallback_list *)
+ mm_calloc(npriorities, sizeof(struct evcallback_list));
+ if (base->activequeues == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto err;
+ }
+ base->nactivequeues = npriorities;
+
+ for (i = 0; i < base->nactivequeues; ++i) {
+ TAILQ_INIT(&base->activequeues[i]);
+ }
+
+ok:
+ r = 0;
+err:
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return (r);
+}
+
+int
+event_base_get_npriorities(struct event_base *base)
+{
+
+ int n;
+ if (base == NULL)
+ base = current_base;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ n = base->nactivequeues;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return (n);
+}
+
+int
+event_base_get_num_events(struct event_base *base, unsigned int type)
+{
+ int r = 0;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (type & EVENT_BASE_COUNT_ACTIVE)
+ r += base->event_count_active;
+
+ if (type & EVENT_BASE_COUNT_VIRTUAL)
+ r += base->virtual_event_count;
+
+ if (type & EVENT_BASE_COUNT_ADDED)
+ r += base->event_count;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ return r;
+}
+
+int
+event_base_get_max_events(struct event_base *base, unsigned int type, int clear)
+{
+ int r = 0;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (type & EVENT_BASE_COUNT_ACTIVE) {
+ r += base->event_count_active_max;
+ if (clear)
+ base->event_count_active_max = 0;
+ }
+
+ if (type & EVENT_BASE_COUNT_VIRTUAL) {
+ r += base->virtual_event_count_max;
+ if (clear)
+ base->virtual_event_count_max = 0;
+ }
+
+ if (type & EVENT_BASE_COUNT_ADDED) {
+ r += base->event_count_max;
+ if (clear)
+ base->event_count_max = 0;
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ return r;
+}
+
+/* Returns true iff we're currently watching any events. */
+static int
+event_haveevents(struct event_base *base)
+{
+ /* Caller must hold th_base_lock */
+ return (base->virtual_event_count > 0 || base->event_count > 0);
+}
+
+/* "closure" function called when processing active signal events */
+static inline void
+event_signal_closure(struct event_base *base, struct event *ev)
+{
+ short ncalls;
+ int should_break;
+
+ /* Allows deletes to work */
+ ncalls = ev->ev_ncalls;
+ if (ncalls != 0)
+ ev->ev_pncalls = &ncalls;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ while (ncalls) {
+ ncalls--;
+ ev->ev_ncalls = ncalls;
+ if (ncalls == 0)
+ ev->ev_pncalls = NULL;
+ (*ev->ev_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ should_break = base->event_break;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ if (should_break) {
+ if (ncalls != 0)
+ ev->ev_pncalls = NULL;
+ return;
+ }
+ }
+}
+
+/* Common timeouts are special timeouts that are handled as queues rather than
+ * in the minheap. This is more efficient than the minheap if we happen to
+ * know that we're going to get several thousands of timeout events all with
+ * the same timeout value.
+ *
+ * Since all our timeout handling code assumes timevals can be copied,
+ * assigned, etc, we can't use "magic pointer" to encode these common
+ * timeouts. Searching through a list to see if every timeout is common could
+ * also get inefficient. Instead, we take advantage of the fact that tv_usec
+ * is 32 bits long, but only uses 20 of those bits (since it can never be over
+ * 999999.) We use the top bits to encode 4 bites of magic number, and 8 bits
+ * of index into the event_base's aray of common timeouts.
+ */
+
+#define MICROSECONDS_MASK COMMON_TIMEOUT_MICROSECONDS_MASK
+#define COMMON_TIMEOUT_IDX_MASK 0x0ff00000
+#define COMMON_TIMEOUT_IDX_SHIFT 20
+#define COMMON_TIMEOUT_MASK 0xf0000000
+#define COMMON_TIMEOUT_MAGIC 0x50000000
+
+#define COMMON_TIMEOUT_IDX(tv) \
+ (((tv)->tv_usec & COMMON_TIMEOUT_IDX_MASK)>>COMMON_TIMEOUT_IDX_SHIFT)
+
+/** Return true iff if 'tv' is a common timeout in 'base' */
+static inline int
+is_common_timeout(const struct timeval *tv,
+ const struct event_base *base)
+{
+ int idx;
+ if ((tv->tv_usec & COMMON_TIMEOUT_MASK) != COMMON_TIMEOUT_MAGIC)
+ return 0;
+ idx = COMMON_TIMEOUT_IDX(tv);
+ return idx < base->n_common_timeouts;
+}
+
+/* True iff tv1 and tv2 have the same common-timeout index, or if neither
+ * one is a common timeout. */
+static inline int
+is_same_common_timeout(const struct timeval *tv1, const struct timeval *tv2)
+{
+ return (tv1->tv_usec & ~MICROSECONDS_MASK) ==
+ (tv2->tv_usec & ~MICROSECONDS_MASK);
+}
+
+/** Requires that 'tv' is a common timeout. Return the corresponding
+ * common_timeout_list. */
+static inline struct common_timeout_list *
+get_common_timeout_list(struct event_base *base, const struct timeval *tv)
+{
+ return base->common_timeout_queues[COMMON_TIMEOUT_IDX(tv)];
+}
+
+#if 0
+static inline int
+common_timeout_ok(const struct timeval *tv,
+ struct event_base *base)
+{
+ const struct timeval *expect =
+ &get_common_timeout_list(base, tv)->duration;
+ return tv->tv_sec == expect->tv_sec &&
+ tv->tv_usec == expect->tv_usec;
+}
+#endif
+
+/* Add the timeout for the first event in given common timeout list to the
+ * event_base's minheap. */
+static void
+common_timeout_schedule(struct common_timeout_list *ctl,
+ const struct timeval *now, struct event *head)
+{
+ struct timeval timeout = head->ev_timeout;
+ timeout.tv_usec &= MICROSECONDS_MASK;
+ event_add_nolock_(&ctl->timeout_event, &timeout, 1);
+}
+
+/* Callback: invoked when the timeout for a common timeout queue triggers.
+ * This means that (at least) the first event in that queue should be run,
+ * and the timeout should be rescheduled if there are more events. */
+static void
+common_timeout_callback(evutil_socket_t fd, short what, void *arg)
+{
+ struct timeval now;
+ struct common_timeout_list *ctl = arg;
+ struct event_base *base = ctl->base;
+ struct event *ev = NULL;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ gettime(base, &now);
+ while (1) {
+ ev = TAILQ_FIRST(&ctl->events);
+ if (!ev || ev->ev_timeout.tv_sec > now.tv_sec ||
+ (ev->ev_timeout.tv_sec == now.tv_sec &&
+ (ev->ev_timeout.tv_usec&MICROSECONDS_MASK) > now.tv_usec))
+ break;
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ event_active_nolock_(ev, EV_TIMEOUT, 1);
+ }
+ if (ev)
+ common_timeout_schedule(ctl, &now, ev);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+#define MAX_COMMON_TIMEOUTS 256
+
+const struct timeval *
+event_base_init_common_timeout(struct event_base *base,
+ const struct timeval *duration)
+{
+ int i;
+ struct timeval tv;
+ const struct timeval *result=NULL;
+ struct common_timeout_list *new_ctl;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (duration->tv_usec > 1000000) {
+ memcpy(&tv, duration, sizeof(struct timeval));
+ if (is_common_timeout(duration, base))
+ tv.tv_usec &= MICROSECONDS_MASK;
+ tv.tv_sec += tv.tv_usec / 1000000;
+ tv.tv_usec %= 1000000;
+ duration = &tv;
+ }
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ const struct common_timeout_list *ctl =
+ base->common_timeout_queues[i];
+ if (duration->tv_sec == ctl->duration.tv_sec &&
+ duration->tv_usec ==
+ (ctl->duration.tv_usec & MICROSECONDS_MASK)) {
+ EVUTIL_ASSERT(is_common_timeout(&ctl->duration, base));
+ result = &ctl->duration;
+ goto done;
+ }
+ }
+ if (base->n_common_timeouts == MAX_COMMON_TIMEOUTS) {
+ event_warnx("%s: Too many common timeouts already in use; "
+ "we only support %d per event_base", __func__,
+ MAX_COMMON_TIMEOUTS);
+ goto done;
+ }
+ if (base->n_common_timeouts_allocated == base->n_common_timeouts) {
+ int n = base->n_common_timeouts < 16 ? 16 :
+ base->n_common_timeouts*2;
+ struct common_timeout_list **newqueues =
+ mm_realloc(base->common_timeout_queues,
+ n*sizeof(struct common_timeout_queue *));
+ if (!newqueues) {
+ event_warn("%s: realloc",__func__);
+ goto done;
+ }
+ base->n_common_timeouts_allocated = n;
+ base->common_timeout_queues = newqueues;
+ }
+ new_ctl = mm_calloc(1, sizeof(struct common_timeout_list));
+ if (!new_ctl) {
+ event_warn("%s: calloc",__func__);
+ goto done;
+ }
+ TAILQ_INIT(&new_ctl->events);
+ new_ctl->duration.tv_sec = duration->tv_sec;
+ new_ctl->duration.tv_usec =
+ duration->tv_usec | COMMON_TIMEOUT_MAGIC |
+ (base->n_common_timeouts << COMMON_TIMEOUT_IDX_SHIFT);
+ evtimer_assign(&new_ctl->timeout_event, base,
+ common_timeout_callback, new_ctl);
+ new_ctl->timeout_event.ev_flags |= EVLIST_INTERNAL;
+ event_priority_set(&new_ctl->timeout_event, 0);
+ new_ctl->base = base;
+ base->common_timeout_queues[base->n_common_timeouts++] = new_ctl;
+ result = &new_ctl->duration;
+
+done:
+ if (result)
+ EVUTIL_ASSERT(is_common_timeout(result, base));
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return result;
+}
+
+/* Closure function invoked when we're activating a persistent event. */
+static inline void
+event_persist_closure(struct event_base *base, struct event *ev)
+{
+
+ // Define our callback, we use this to store our callback before it's executed
+ void (*evcb_callback)(evutil_socket_t, short, void *);
+
+ /* reschedule the persistent event if we have a timeout. */
+ if (ev->ev_io_timeout.tv_sec || ev->ev_io_timeout.tv_usec) {
+ /* If there was a timeout, we want it to run at an interval of
+ * ev_io_timeout after the last time it was _scheduled_ for,
+ * not ev_io_timeout after _now_. If it fired for another
+ * reason, though, the timeout ought to start ticking _now_. */
+ struct timeval run_at, relative_to, delay, now;
+ ev_uint32_t usec_mask = 0;
+ EVUTIL_ASSERT(is_same_common_timeout(&ev->ev_timeout,
+ &ev->ev_io_timeout));
+ gettime(base, &now);
+ if (is_common_timeout(&ev->ev_timeout, base)) {
+ delay = ev->ev_io_timeout;
+ usec_mask = delay.tv_usec & ~MICROSECONDS_MASK;
+ delay.tv_usec &= MICROSECONDS_MASK;
+ if (ev->ev_res & EV_TIMEOUT) {
+ relative_to = ev->ev_timeout;
+ relative_to.tv_usec &= MICROSECONDS_MASK;
+ } else {
+ relative_to = now;
+ }
+ } else {
+ delay = ev->ev_io_timeout;
+ if (ev->ev_res & EV_TIMEOUT) {
+ relative_to = ev->ev_timeout;
+ } else {
+ relative_to = now;
+ }
+ }
+ evutil_timeradd(&relative_to, &delay, &run_at);
+ if (evutil_timercmp(&run_at, &now, <)) {
+ /* Looks like we missed at least one invocation due to
+ * a clock jump, not running the event loop for a
+ * while, really slow callbacks, or
+ * something. Reschedule relative to now.
+ */
+ evutil_timeradd(&now, &delay, &run_at);
+ }
+ run_at.tv_usec |= usec_mask;
+ event_add_nolock_(ev, &run_at, 1);
+ }
+
+ // Save our callback before we release the lock
+ evcb_callback = *ev->ev_callback;
+
+ // Release the lock
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ // Execute the callback
+ (evcb_callback)(ev->ev_fd, ev->ev_res, ev->ev_arg);
+}
+
+/*
+ Helper for event_process_active to process all the events in a single queue,
+ releasing the lock as we go. This function requires that the lock be held
+ when it's invoked. Returns -1 if we get a signal or an event_break that
+ means we should stop processing any active events now. Otherwise returns
+ the number of non-internal event_callbacks that we processed.
+*/
+static int
+event_process_active_single_queue(struct event_base *base,
+ struct evcallback_list *activeq,
+ int max_to_process, const struct timeval *endtime)
+{
+ struct event_callback *evcb;
+ int count = 0;
+
+ EVUTIL_ASSERT(activeq != NULL);
+
+ for (evcb = TAILQ_FIRST(activeq); evcb; evcb = TAILQ_FIRST(activeq)) {
+ struct event *ev=NULL;
+ if (evcb->evcb_flags & EVLIST_INIT) {
+ ev = event_callback_to_event(evcb);
+
+ if (ev->ev_events & EV_PERSIST || ev->ev_flags & EVLIST_FINALIZING)
+ event_queue_remove_active(base, evcb);
+ else
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ event_debug((
+ "event_process_active: event: %p, %s%s%scall %p",
+ ev,
+ ev->ev_res & EV_READ ? "EV_READ " : " ",
+ ev->ev_res & EV_WRITE ? "EV_WRITE " : " ",
+ ev->ev_res & EV_CLOSED ? "EV_CLOSED " : " ",
+ ev->ev_callback));
+ } else {
+ event_queue_remove_active(base, evcb);
+ event_debug(("event_process_active: event_callback %p, "
+ "closure %d, call %p",
+ evcb, evcb->evcb_closure, evcb->evcb_cb_union.evcb_callback));
+ }
+
+ if (!(evcb->evcb_flags & EVLIST_INTERNAL))
+ ++count;
+
+
+ base->current_event = evcb;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ base->current_event_waiters = 0;
+#endif
+
+ switch (evcb->evcb_closure) {
+ case EV_CLOSURE_EVENT_SIGNAL:
+ EVUTIL_ASSERT(ev != NULL);
+ event_signal_closure(base, ev);
+ break;
+ case EV_CLOSURE_EVENT_PERSIST:
+ EVUTIL_ASSERT(ev != NULL);
+ event_persist_closure(base, ev);
+ break;
+ case EV_CLOSURE_EVENT: {
+ EVUTIL_ASSERT(ev != NULL);
+ void (*evcb_callback)(evutil_socket_t, short, void *) = *ev->ev_callback;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_callback(ev->ev_fd, ev->ev_res, ev->ev_arg);
+ }
+ break;
+ case EV_CLOSURE_CB_SELF: {
+ void (*evcb_selfcb)(struct event_callback *, void *) = evcb->evcb_cb_union.evcb_selfcb;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_selfcb(evcb, evcb->evcb_arg);
+ }
+ break;
+ case EV_CLOSURE_EVENT_FINALIZE:
+ case EV_CLOSURE_EVENT_FINALIZE_FREE: {
+ EVUTIL_ASSERT(ev != NULL);
+ void (*evcb_evfinalize)(struct event *, void *) = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize;
+ base->current_event = NULL;
+ EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING));
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_evfinalize(ev, ev->ev_arg);
+ event_debug_note_teardown_(ev);
+ if (evcb->evcb_closure == EV_CLOSURE_EVENT_FINALIZE_FREE)
+ mm_free(ev);
+ }
+ break;
+ case EV_CLOSURE_CB_FINALIZE: {
+ void (*evcb_cbfinalize)(struct event_callback *, void *) = evcb->evcb_cb_union.evcb_cbfinalize;
+ base->current_event = NULL;
+ EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING));
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ evcb_cbfinalize(evcb, evcb->evcb_arg);
+ }
+ break;
+ default:
+ EVUTIL_ASSERT(0);
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->current_event = NULL;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->current_event_waiters) {
+ base->current_event_waiters = 0;
+ EVTHREAD_COND_BROADCAST(base->current_event_cond);
+ }
+#endif
+
+ if (base->event_break)
+ return -1;
+ if (count >= max_to_process)
+ return count;
+ if (count && endtime) {
+ struct timeval now;
+ update_time_cache(base);
+ gettime(base, &now);
+ if (evutil_timercmp(&now, endtime, >=))
+ return count;
+ }
+ if (base->event_continue)
+ break;
+ }
+ return count;
+}
+
+/*
+ * Active events are stored in priority queues. Lower priorities are always
+ * process before higher priorities. Low priority events can starve high
+ * priority ones.
+ */
+
+static int
+event_process_active(struct event_base *base)
+{
+ /* Caller must hold th_base_lock */
+ struct evcallback_list *activeq = NULL;
+ int i, c = 0;
+ const struct timeval *endtime;
+ struct timeval tv;
+ const int maxcb = base->max_dispatch_callbacks;
+ const int limit_after_prio = base->limit_callbacks_after_prio;
+ if (base->max_dispatch_time.tv_sec >= 0) {
+ update_time_cache(base);
+ gettime(base, &tv);
+ evutil_timeradd(&base->max_dispatch_time, &tv, &tv);
+ endtime = &tv;
+ } else {
+ endtime = NULL;
+ }
+
+ for (i = 0; i < base->nactivequeues; ++i) {
+ if (TAILQ_FIRST(&base->activequeues[i]) != NULL) {
+ base->event_running_priority = i;
+ activeq = &base->activequeues[i];
+ if (i < limit_after_prio)
+ c = event_process_active_single_queue(base, activeq,
+ INT_MAX, NULL);
+ else
+ c = event_process_active_single_queue(base, activeq,
+ maxcb, endtime);
+ if (c < 0) {
+ goto done;
+ } else if (c > 0)
+ break; /* Processed a real event; do not
+ * consider lower-priority events */
+ /* If we get here, all of the events we processed
+ * were internal. Continue. */
+ }
+ }
+
+done:
+ base->event_running_priority = -1;
+
+ return c;
+}
+
+/*
+ * Wait continuously for events. We exit only if no events are left.
+ */
+
+int
+event_dispatch(void)
+{
+ return (event_loop(0));
+}
+
+int
+event_base_dispatch(struct event_base *event_base)
+{
+ return (event_base_loop(event_base, 0));
+}
+
+const char *
+event_base_get_method(const struct event_base *base)
+{
+ EVUTIL_ASSERT(base);
+ return (base->evsel->name);
+}
+
+/** Callback: used to implement event_base_loopexit by telling the event_base
+ * that it's time to exit its loop. */
+static void
+event_loopexit_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct event_base *base = arg;
+ base->event_gotterm = 1;
+}
+
+int
+event_loopexit(const struct timeval *tv)
+{
+ return (event_once(-1, EV_TIMEOUT, event_loopexit_cb,
+ current_base, tv));
+}
+
+int
+event_base_loopexit(struct event_base *event_base, const struct timeval *tv)
+{
+ return (event_base_once(event_base, -1, EV_TIMEOUT, event_loopexit_cb,
+ event_base, tv));
+}
+
+int
+event_loopbreak(void)
+{
+ return (event_base_loopbreak(current_base));
+}
+
+int
+event_base_loopbreak(struct event_base *event_base)
+{
+ int r = 0;
+ if (event_base == NULL)
+ return (-1);
+
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ event_base->event_break = 1;
+
+ if (EVBASE_NEED_NOTIFY(event_base)) {
+ r = evthread_notify_base(event_base);
+ } else {
+ r = (0);
+ }
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return r;
+}
+
+int
+event_base_loopcontinue(struct event_base *event_base)
+{
+ int r = 0;
+ if (event_base == NULL)
+ return (-1);
+
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ event_base->event_continue = 1;
+
+ if (EVBASE_NEED_NOTIFY(event_base)) {
+ r = evthread_notify_base(event_base);
+ } else {
+ r = (0);
+ }
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return r;
+}
+
+int
+event_base_got_break(struct event_base *event_base)
+{
+ int res;
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ res = event_base->event_break;
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return res;
+}
+
+int
+event_base_got_exit(struct event_base *event_base)
+{
+ int res;
+ EVBASE_ACQUIRE_LOCK(event_base, th_base_lock);
+ res = event_base->event_gotterm;
+ EVBASE_RELEASE_LOCK(event_base, th_base_lock);
+ return res;
+}
+
+/* not thread safe */
+
+int
+event_loop(int flags)
+{
+ return event_base_loop(current_base, flags);
+}
+
+int
+event_base_loop(struct event_base *base, int flags)
+{
+ const struct eventop *evsel = base->evsel;
+ struct timeval tv;
+ struct timeval *tv_p;
+ int res, done, retval = 0;
+
+ /* Grab the lock. We will release it inside evsel.dispatch, and again
+ * as we invoke user callbacks. */
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (base->running_loop) {
+ event_warnx("%s: reentrant invocation. Only one event_base_loop"
+ " can run on each event_base at once.", __func__);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return -1;
+ }
+
+ base->running_loop = 1;
+
+ clear_time_cache(base);
+
+ if (base->sig.ev_signal_added && base->sig.ev_n_signals_added)
+ evsig_set_base_(base);
+
+ done = 0;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ base->th_owner_id = EVTHREAD_GET_ID();
+#endif
+
+ base->event_gotterm = base->event_break = 0;
+
+ while (!done) {
+ base->event_continue = 0;
+ base->n_deferreds_queued = 0;
+
+ /* Terminate the loop if we have been asked to */
+ if (base->event_gotterm) {
+ break;
+ }
+
+ if (base->event_break) {
+ break;
+ }
+
+ tv_p = &tv;
+ if (!N_ACTIVE_CALLBACKS(base) && !(flags & EVLOOP_NONBLOCK)) {
+ timeout_next(base, &tv_p);
+ } else {
+ /*
+ * if we have active events, we just poll new events
+ * without waiting.
+ */
+ evutil_timerclear(&tv);
+ }
+
+ /* If we have no events, we just exit */
+ if (0==(flags&EVLOOP_NO_EXIT_ON_EMPTY) &&
+ !event_haveevents(base) && !N_ACTIVE_CALLBACKS(base)) {
+ event_debug(("%s: no events registered.", __func__));
+ retval = 1;
+ goto done;
+ }
+
+ event_queue_make_later_events_active(base);
+
+ clear_time_cache(base);
+
+ res = evsel->dispatch(base, tv_p);
+
+ if (res == -1) {
+ event_debug(("%s: dispatch returned unsuccessfully.",
+ __func__));
+ retval = -1;
+ goto done;
+ }
+
+ update_time_cache(base);
+
+ timeout_process(base);
+
+ if (N_ACTIVE_CALLBACKS(base)) {
+ int n = event_process_active(base);
+ if ((flags & EVLOOP_ONCE)
+ && N_ACTIVE_CALLBACKS(base) == 0
+ && n != 0)
+ done = 1;
+ } else if (flags & EVLOOP_NONBLOCK)
+ done = 1;
+ }
+ event_debug(("%s: asked to terminate loop.", __func__));
+
+done:
+ clear_time_cache(base);
+ base->running_loop = 0;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ return (retval);
+}
+
+/* One-time callback to implement event_base_once: invokes the user callback,
+ * then deletes the allocated storage */
+static void
+event_once_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct event_once *eonce = arg;
+
+ (*eonce->cb)(fd, events, eonce->arg);
+ EVBASE_ACQUIRE_LOCK(eonce->ev.ev_base, th_base_lock);
+ LIST_REMOVE(eonce, next_once);
+ EVBASE_RELEASE_LOCK(eonce->ev.ev_base, th_base_lock);
+ event_debug_unassign(&eonce->ev);
+ mm_free(eonce);
+}
+
+/* not threadsafe, event scheduled once. */
+int
+event_once(evutil_socket_t fd, short events,
+ void (*callback)(evutil_socket_t, short, void *),
+ void *arg, const struct timeval *tv)
+{
+ return event_base_once(current_base, fd, events, callback, arg, tv);
+}
+
+/* Schedules an event once */
+int
+event_base_once(struct event_base *base, evutil_socket_t fd, short events,
+ void (*callback)(evutil_socket_t, short, void *),
+ void *arg, const struct timeval *tv)
+{
+ struct event_once *eonce;
+ int res = 0;
+ int activate = 0;
+
+ /* We cannot support signals that just fire once, or persistent
+ * events. */
+ if (events & (EV_SIGNAL|EV_PERSIST))
+ return (-1);
+
+ if ((eonce = mm_calloc(1, sizeof(struct event_once))) == NULL)
+ return (-1);
+
+ eonce->cb = callback;
+ eonce->arg = arg;
+
+ if ((events & (EV_TIMEOUT|EV_SIGNAL|EV_READ|EV_WRITE|EV_CLOSED)) == EV_TIMEOUT) {
+ evtimer_assign(&eonce->ev, base, event_once_cb, eonce);
+
+ if (tv == NULL || ! evutil_timerisset(tv)) {
+ /* If the event is going to become active immediately,
+ * don't put it on the timeout queue. This is one
+ * idiom for scheduling a callback, so let's make
+ * it fast (and order-preserving). */
+ activate = 1;
+ }
+ } else if (events & (EV_READ|EV_WRITE|EV_CLOSED)) {
+ events &= EV_READ|EV_WRITE|EV_CLOSED;
+
+ event_assign(&eonce->ev, base, fd, events, event_once_cb, eonce);
+ } else {
+ /* Bad event combination */
+ mm_free(eonce);
+ return (-1);
+ }
+
+ if (res == 0) {
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (activate)
+ event_active_nolock_(&eonce->ev, EV_TIMEOUT, 1);
+ else
+ res = event_add_nolock_(&eonce->ev, tv, 0);
+
+ if (res != 0) {
+ mm_free(eonce);
+ return (res);
+ } else {
+ LIST_INSERT_HEAD(&base->once_events, eonce, next_once);
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ }
+
+ return (0);
+}
+
+int
+event_assign(struct event *ev, struct event_base *base, evutil_socket_t fd, short events, void (*callback)(evutil_socket_t, short, void *), void *arg)
+{
+ if (!base)
+ base = current_base;
+ if (arg == &event_self_cbarg_ptr_)
+ arg = ev;
+
+ event_debug_assert_not_added_(ev);
+
+ ev->ev_base = base;
+
+ ev->ev_callback = callback;
+ ev->ev_arg = arg;
+ ev->ev_fd = fd;
+ ev->ev_events = events;
+ ev->ev_res = 0;
+ ev->ev_flags = EVLIST_INIT;
+ ev->ev_ncalls = 0;
+ ev->ev_pncalls = NULL;
+
+ if (events & EV_SIGNAL) {
+ if ((events & (EV_READ|EV_WRITE|EV_CLOSED)) != 0) {
+ event_warnx("%s: EV_SIGNAL is not compatible with "
+ "EV_READ, EV_WRITE or EV_CLOSED", __func__);
+ return -1;
+ }
+ ev->ev_closure = EV_CLOSURE_EVENT_SIGNAL;
+ } else {
+ if (events & EV_PERSIST) {
+ evutil_timerclear(&ev->ev_io_timeout);
+ ev->ev_closure = EV_CLOSURE_EVENT_PERSIST;
+ } else {
+ ev->ev_closure = EV_CLOSURE_EVENT;
+ }
+ }
+
+ min_heap_elem_init_(ev);
+
+ if (base != NULL) {
+ /* by default, we put new events into the middle priority */
+ ev->ev_pri = base->nactivequeues / 2;
+ }
+
+ event_debug_note_setup_(ev);
+
+ return 0;
+}
+
+int
+event_base_set(struct event_base *base, struct event *ev)
+{
+ /* Only innocent events may be assigned to a different base */
+ if (ev->ev_flags != EVLIST_INIT)
+ return (-1);
+
+ event_debug_assert_is_setup_(ev);
+
+ ev->ev_base = base;
+ ev->ev_pri = base->nactivequeues/2;
+
+ return (0);
+}
+
+void
+event_set(struct event *ev, evutil_socket_t fd, short events,
+ void (*callback)(evutil_socket_t, short, void *), void *arg)
+{
+ int r;
+ r = event_assign(ev, current_base, fd, events, callback, arg);
+ EVUTIL_ASSERT(r == 0);
+}
+
+void *
+event_self_cbarg(void)
+{
+ return &event_self_cbarg_ptr_;
+}
+
+struct event *
+event_base_get_running_event(struct event_base *base)
+{
+ struct event *ev = NULL;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (EVBASE_IN_THREAD(base)) {
+ struct event_callback *evcb = base->current_event;
+ if (evcb->evcb_flags & EVLIST_INIT)
+ ev = event_callback_to_event(evcb);
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return ev;
+}
+
+struct event *
+event_new(struct event_base *base, evutil_socket_t fd, short events, void (*cb)(evutil_socket_t, short, void *), void *arg)
+{
+ struct event *ev;
+ ev = mm_malloc(sizeof(struct event));
+ if (ev == NULL)
+ return (NULL);
+ if (event_assign(ev, base, fd, events, cb, arg) < 0) {
+ mm_free(ev);
+ return (NULL);
+ }
+
+ return (ev);
+}
+
+void
+event_free(struct event *ev)
+{
+ /* This is disabled, so that events which have been finalized be a
+ * valid target for event_free(). That's */
+ // event_debug_assert_is_setup_(ev);
+
+ /* make sure that this event won't be coming back to haunt us. */
+ event_del(ev);
+ event_debug_note_teardown_(ev);
+ mm_free(ev);
+
+}
+
+void
+event_debug_unassign(struct event *ev)
+{
+ event_debug_assert_not_added_(ev);
+ event_debug_note_teardown_(ev);
+
+ ev->ev_flags &= ~EVLIST_INIT;
+}
+
+#define EVENT_FINALIZE_FREE_ 0x10000
+static int
+event_finalize_nolock_(struct event_base *base, unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ ev_uint8_t closure = (flags & EVENT_FINALIZE_FREE_) ?
+ EV_CLOSURE_EVENT_FINALIZE_FREE : EV_CLOSURE_EVENT_FINALIZE;
+
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ ev->ev_closure = closure;
+ ev->ev_evcallback.evcb_cb_union.evcb_evfinalize = cb;
+ event_active_nolock_(ev, EV_FINALIZE, 1);
+ ev->ev_flags |= EVLIST_FINALIZING;
+ return 0;
+}
+
+static int
+event_finalize_impl_(unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ int r;
+ struct event_base *base = ev->ev_base;
+ if (EVUTIL_FAILURE_CHECK(!base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_finalize_nolock_(base, flags, ev, cb);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+int
+event_finalize(unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ return event_finalize_impl_(flags, ev, cb);
+}
+
+int
+event_free_finalize(unsigned flags, struct event *ev, event_finalize_callback_fn cb)
+{
+ return event_finalize_impl_(flags|EVENT_FINALIZE_FREE_, ev, cb);
+}
+
+void
+event_callback_finalize_nolock_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *))
+{
+ struct event *ev = NULL;
+ if (evcb->evcb_flags & EVLIST_INIT) {
+ ev = event_callback_to_event(evcb);
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+ } else {
+ event_callback_cancel_nolock_(base, evcb, 0); /*XXX can this fail?*/
+ }
+
+ evcb->evcb_closure = EV_CLOSURE_CB_FINALIZE;
+ evcb->evcb_cb_union.evcb_cbfinalize = cb;
+ event_callback_activate_nolock_(base, evcb); /* XXX can this really fail?*/
+ evcb->evcb_flags |= EVLIST_FINALIZING;
+}
+
+void
+event_callback_finalize_(struct event_base *base, unsigned flags, struct event_callback *evcb, void (*cb)(struct event_callback *, void *))
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ event_callback_finalize_nolock_(base, flags, evcb, cb);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+/** Internal: Finalize all of the n_cbs callbacks in evcbs. The provided
+ * callback will be invoked on *one of them*, after they have *all* been
+ * finalized. */
+int
+event_callback_finalize_many_(struct event_base *base, int n_cbs, struct event_callback **evcbs, void (*cb)(struct event_callback *, void *))
+{
+ int n_pending = 0, i;
+
+ if (base == NULL)
+ base = current_base;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ event_debug(("%s: %d events finalizing", __func__, n_cbs));
+
+ /* At most one can be currently executing; the rest we just
+ * cancel... But we always make sure that the finalize callback
+ * runs. */
+ for (i = 0; i < n_cbs; ++i) {
+ struct event_callback *evcb = evcbs[i];
+ if (evcb == base->current_event) {
+ event_callback_finalize_nolock_(base, 0, evcb, cb);
+ ++n_pending;
+ } else {
+ event_callback_cancel_nolock_(base, evcb, 0);
+ }
+ }
+
+ if (n_pending == 0) {
+ /* Just do the first one. */
+ event_callback_finalize_nolock_(base, 0, evcbs[0], cb);
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return 0;
+}
+
+/*
+ * Set's the priority of an event - if an event is already scheduled
+ * changing the priority is going to fail.
+ */
+
+int
+event_priority_set(struct event *ev, int pri)
+{
+ event_debug_assert_is_setup_(ev);
+
+ if (ev->ev_flags & EVLIST_ACTIVE)
+ return (-1);
+ if (pri < 0 || pri >= ev->ev_base->nactivequeues)
+ return (-1);
+
+ ev->ev_pri = pri;
+
+ return (0);
+}
+
+/*
+ * Checks if a specific event is pending or scheduled.
+ */
+
+int
+event_pending(const struct event *ev, short event, struct timeval *tv)
+{
+ int flags = 0;
+
+ if (EVUTIL_FAILURE_CHECK(ev->ev_base == NULL)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return 0;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+ event_debug_assert_is_setup_(ev);
+
+ if (ev->ev_flags & EVLIST_INSERTED)
+ flags |= (ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED|EV_SIGNAL));
+ if (ev->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))
+ flags |= ev->ev_res;
+ if (ev->ev_flags & EVLIST_TIMEOUT)
+ flags |= EV_TIMEOUT;
+
+ event &= (EV_TIMEOUT|EV_READ|EV_WRITE|EV_CLOSED|EV_SIGNAL);
+
+ /* See if there is a timeout that we should report */
+ if (tv != NULL && (flags & event & EV_TIMEOUT)) {
+ struct timeval tmp = ev->ev_timeout;
+ tmp.tv_usec &= MICROSECONDS_MASK;
+ /* correctly remamp to real time */
+ evutil_timeradd(&ev->ev_base->tv_clock_diff, &tmp, tv);
+ }
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (flags & event);
+}
+
+int
+event_initialized(const struct event *ev)
+{
+ if (!(ev->ev_flags & EVLIST_INIT))
+ return 0;
+
+ return 1;
+}
+
+void
+event_get_assignment(const struct event *event, struct event_base **base_out, evutil_socket_t *fd_out, short *events_out, event_callback_fn *callback_out, void **arg_out)
+{
+ event_debug_assert_is_setup_(event);
+
+ if (base_out)
+ *base_out = event->ev_base;
+ if (fd_out)
+ *fd_out = event->ev_fd;
+ if (events_out)
+ *events_out = event->ev_events;
+ if (callback_out)
+ *callback_out = event->ev_callback;
+ if (arg_out)
+ *arg_out = event->ev_arg;
+}
+
+size_t
+event_get_struct_event_size(void)
+{
+ return sizeof(struct event);
+}
+
+evutil_socket_t
+event_get_fd(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_fd;
+}
+
+struct event_base *
+event_get_base(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_base;
+}
+
+short
+event_get_events(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_events;
+}
+
+event_callback_fn
+event_get_callback(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_callback;
+}
+
+void *
+event_get_callback_arg(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_arg;
+}
+
+int
+event_get_priority(const struct event *ev)
+{
+ event_debug_assert_is_setup_(ev);
+ return ev->ev_pri;
+}
+
+int
+event_add(struct event *ev, const struct timeval *tv)
+{
+ int res;
+
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ res = event_add_nolock_(ev, tv, 0);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (res);
+}
+
+/* Helper callback: wake an event_base from another thread. This version
+ * works by writing a byte to one end of a socketpair, so that the event_base
+ * listening on the other end will wake up as the corresponding event
+ * triggers */
+static int
+evthread_notify_base_default(struct event_base *base)
+{
+ char buf[1];
+ int r;
+ buf[0] = (char) 0;
+#ifdef _WIN32
+ r = send(base->th_notify_fd[1], buf, 1, 0);
+#else
+ r = write(base->th_notify_fd[1], buf, 1);
+#endif
+ return (r < 0 && ! EVUTIL_ERR_IS_EAGAIN(errno)) ? -1 : 0;
+}
+
+#ifdef EVENT__HAVE_EVENTFD
+/* Helper callback: wake an event_base from another thread. This version
+ * assumes that you have a working eventfd() implementation. */
+static int
+evthread_notify_base_eventfd(struct event_base *base)
+{
+ ev_uint64_t msg = 1;
+ int r;
+ do {
+ r = write(base->th_notify_fd[0], (void*) &msg, sizeof(msg));
+ } while (r < 0 && errno == EAGAIN);
+
+ return (r < 0) ? -1 : 0;
+}
+#endif
+
+
+/** Tell the thread currently running the event_loop for base (if any) that it
+ * needs to stop waiting in its dispatch function (if it is) and process all
+ * active callbacks. */
+static int
+evthread_notify_base(struct event_base *base)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (!base->th_notify_fn)
+ return -1;
+ if (base->is_notify_pending)
+ return 0;
+ base->is_notify_pending = 1;
+ return base->th_notify_fn(base);
+}
+
+/* Implementation function to remove a timeout on a currently pending event.
+ */
+int
+event_remove_timer_nolock_(struct event *ev)
+{
+ struct event_base *base = ev->ev_base;
+
+ EVENT_BASE_ASSERT_LOCKED(base);
+ event_debug_assert_is_setup_(ev);
+
+ event_debug(("event_remove_timer_nolock: event: %p", ev));
+
+ /* If it's not pending on a timeout, we don't need to do anything. */
+ if (ev->ev_flags & EVLIST_TIMEOUT) {
+ event_queue_remove_timeout(base, ev);
+ evutil_timerclear(&ev->ev_.ev_io.ev_timeout);
+ }
+
+ return (0);
+}
+
+int
+event_remove_timer(struct event *ev)
+{
+ int res;
+
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ res = event_remove_timer_nolock_(ev);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (res);
+}
+
+/* Implementation function to add an event. Works just like event_add,
+ * except: 1) it requires that we have the lock. 2) if tv_is_absolute is set,
+ * we treat tv as an absolute time, not as an interval to add to the current
+ * time */
+int
+event_add_nolock_(struct event *ev, const struct timeval *tv,
+ int tv_is_absolute)
+{
+ struct event_base *base = ev->ev_base;
+ int res = 0;
+ int notify = 0;
+
+ EVENT_BASE_ASSERT_LOCKED(base);
+ event_debug_assert_is_setup_(ev);
+
+ event_debug((
+ "event_add: event: %p (fd "EV_SOCK_FMT"), %s%s%s%scall %p",
+ ev,
+ EV_SOCK_ARG(ev->ev_fd),
+ ev->ev_events & EV_READ ? "EV_READ " : " ",
+ ev->ev_events & EV_WRITE ? "EV_WRITE " : " ",
+ ev->ev_events & EV_CLOSED ? "EV_CLOSED " : " ",
+ tv ? "EV_TIMEOUT " : " ",
+ ev->ev_callback));
+
+ EVUTIL_ASSERT(!(ev->ev_flags & ~EVLIST_ALL));
+
+ if (ev->ev_flags & EVLIST_FINALIZING) {
+ /* XXXX debug */
+ return (-1);
+ }
+
+ /*
+ * prepare for timeout insertion further below, if we get a
+ * failure on any step, we should not change any state.
+ */
+ if (tv != NULL && !(ev->ev_flags & EVLIST_TIMEOUT)) {
+ if (min_heap_reserve_(&base->timeheap,
+ 1 + min_heap_size_(&base->timeheap)) == -1)
+ return (-1); /* ENOMEM == errno */
+ }
+
+ /* If the main thread is currently executing a signal event's
+ * callback, and we are not the main thread, then we want to wait
+ * until the callback is done before we mess with the event, or else
+ * we can race on ev_ncalls and ev_pncalls below. */
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->current_event == event_to_event_callback(ev) &&
+ (ev->ev_events & EV_SIGNAL)
+ && !EVBASE_IN_THREAD(base)) {
+ ++base->current_event_waiters;
+ EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock);
+ }
+#endif
+
+ if ((ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED|EV_SIGNAL)) &&
+ !(ev->ev_flags & (EVLIST_INSERTED|EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))) {
+ if (ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED))
+ res = evmap_io_add_(base, ev->ev_fd, ev);
+ else if (ev->ev_events & EV_SIGNAL)
+ res = evmap_signal_add_(base, (int)ev->ev_fd, ev);
+ if (res != -1)
+ event_queue_insert_inserted(base, ev);
+ if (res == 1) {
+ /* evmap says we need to notify the main thread. */
+ notify = 1;
+ res = 0;
+ }
+ }
+
+ /*
+ * we should change the timeout state only if the previous event
+ * addition succeeded.
+ */
+ if (res != -1 && tv != NULL) {
+ struct timeval now;
+ int common_timeout;
+#ifdef USE_REINSERT_TIMEOUT
+ int was_common;
+ int old_timeout_idx;
+#endif
+
+ /*
+ * for persistent timeout events, we remember the
+ * timeout value and re-add the event.
+ *
+ * If tv_is_absolute, this was already set.
+ */
+ if (ev->ev_closure == EV_CLOSURE_EVENT_PERSIST && !tv_is_absolute)
+ ev->ev_io_timeout = *tv;
+
+#ifndef USE_REINSERT_TIMEOUT
+ if (ev->ev_flags & EVLIST_TIMEOUT) {
+ event_queue_remove_timeout(base, ev);
+ }
+#endif
+
+ /* Check if it is active due to a timeout. Rescheduling
+ * this timeout before the callback can be executed
+ * removes it from the active list. */
+ if ((ev->ev_flags & EVLIST_ACTIVE) &&
+ (ev->ev_res & EV_TIMEOUT)) {
+ if (ev->ev_events & EV_SIGNAL) {
+ /* See if we are just active executing
+ * this event in a loop
+ */
+ if (ev->ev_ncalls && ev->ev_pncalls) {
+ /* Abort loop */
+ *ev->ev_pncalls = 0;
+ }
+ }
+
+ event_queue_remove_active(base, event_to_event_callback(ev));
+ }
+
+ gettime(base, &now);
+
+ common_timeout = is_common_timeout(tv, base);
+#ifdef USE_REINSERT_TIMEOUT
+ was_common = is_common_timeout(&ev->ev_timeout, base);
+ old_timeout_idx = COMMON_TIMEOUT_IDX(&ev->ev_timeout);
+#endif
+
+ if (tv_is_absolute) {
+ ev->ev_timeout = *tv;
+ } else if (common_timeout) {
+ struct timeval tmp = *tv;
+ tmp.tv_usec &= MICROSECONDS_MASK;
+ evutil_timeradd(&now, &tmp, &ev->ev_timeout);
+ ev->ev_timeout.tv_usec |=
+ (tv->tv_usec & ~MICROSECONDS_MASK);
+ } else {
+ evutil_timeradd(&now, tv, &ev->ev_timeout);
+ }
+
+ event_debug((
+ "event_add: event %p, timeout in %d seconds %d useconds, call %p",
+ ev, (int)tv->tv_sec, (int)tv->tv_usec, ev->ev_callback));
+
+#ifdef USE_REINSERT_TIMEOUT
+ event_queue_reinsert_timeout(base, ev, was_common, common_timeout, old_timeout_idx);
+#else
+ event_queue_insert_timeout(base, ev);
+#endif
+
+ if (common_timeout) {
+ struct common_timeout_list *ctl =
+ get_common_timeout_list(base, &ev->ev_timeout);
+ if (ev == TAILQ_FIRST(&ctl->events)) {
+ common_timeout_schedule(ctl, &now, ev);
+ }
+ } else {
+ struct event* top = NULL;
+ /* See if the earliest timeout is now earlier than it
+ * was before: if so, we will need to tell the main
+ * thread to wake up earlier than it would otherwise.
+ * We double check the timeout of the top element to
+ * handle time distortions due to system suspension.
+ */
+ if (min_heap_elt_is_top_(ev))
+ notify = 1;
+ else if ((top = min_heap_top_(&base->timeheap)) != NULL &&
+ evutil_timercmp(&top->ev_timeout, &now, <))
+ notify = 1;
+ }
+ }
+
+ /* if we are not in the right thread, we need to wake up the loop */
+ if (res != -1 && notify && EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+
+ event_debug_note_add_(ev);
+
+ return (res);
+}
+
+static int
+event_del_(struct event *ev, int blocking)
+{
+ int res;
+
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ res = event_del_nolock_(ev, blocking);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+
+ return (res);
+}
+
+int
+event_del(struct event *ev)
+{
+ return event_del_(ev, EVENT_DEL_AUTOBLOCK);
+}
+
+int
+event_del_block(struct event *ev)
+{
+ return event_del_(ev, EVENT_DEL_BLOCK);
+}
+
+int
+event_del_noblock(struct event *ev)
+{
+ return event_del_(ev, EVENT_DEL_NOBLOCK);
+}
+
+/** Helper for event_del: always called with th_base_lock held.
+ *
+ * "blocking" must be one of the EVENT_DEL_{BLOCK, NOBLOCK, AUTOBLOCK,
+ * EVEN_IF_FINALIZING} values. See those for more information.
+ */
+int
+event_del_nolock_(struct event *ev, int blocking)
+{
+ struct event_base *base;
+ int res = 0, notify = 0;
+
+ event_debug(("event_del: %p (fd "EV_SOCK_FMT"), callback %p",
+ ev, EV_SOCK_ARG(ev->ev_fd), ev->ev_callback));
+
+ /* An event without a base has not been added */
+ if (ev->ev_base == NULL)
+ return (-1);
+
+ EVENT_BASE_ASSERT_LOCKED(ev->ev_base);
+
+ if (blocking != EVENT_DEL_EVEN_IF_FINALIZING) {
+ if (ev->ev_flags & EVLIST_FINALIZING) {
+ /* XXXX Debug */
+ return 0;
+ }
+ }
+
+ /* If the main thread is currently executing this event's callback,
+ * and we are not the main thread, then we want to wait until the
+ * callback is done before we start removing the event. That way,
+ * when this function returns, it will be safe to free the
+ * user-supplied argument. */
+ base = ev->ev_base;
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (blocking != EVENT_DEL_NOBLOCK &&
+ base->current_event == event_to_event_callback(ev) &&
+ !EVBASE_IN_THREAD(base) &&
+ (blocking == EVENT_DEL_BLOCK || !(ev->ev_events & EV_FINALIZE))) {
+ ++base->current_event_waiters;
+ EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock);
+ }
+#endif
+
+ EVUTIL_ASSERT(!(ev->ev_flags & ~EVLIST_ALL));
+
+ /* See if we are just active executing this event in a loop */
+ if (ev->ev_events & EV_SIGNAL) {
+ if (ev->ev_ncalls && ev->ev_pncalls) {
+ /* Abort loop */
+ *ev->ev_pncalls = 0;
+ }
+ }
+
+ if (ev->ev_flags & EVLIST_TIMEOUT) {
+ /* NOTE: We never need to notify the main thread because of a
+ * deleted timeout event: all that could happen if we don't is
+ * that the dispatch loop might wake up too early. But the
+ * point of notifying the main thread _is_ to wake up the
+ * dispatch loop early anyway, so we wouldn't gain anything by
+ * doing it.
+ */
+ event_queue_remove_timeout(base, ev);
+ }
+
+ if (ev->ev_flags & EVLIST_ACTIVE)
+ event_queue_remove_active(base, event_to_event_callback(ev));
+ else if (ev->ev_flags & EVLIST_ACTIVE_LATER)
+ event_queue_remove_active_later(base, event_to_event_callback(ev));
+
+ if (ev->ev_flags & EVLIST_INSERTED) {
+ event_queue_remove_inserted(base, ev);
+ if (ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED))
+ res = evmap_io_del_(base, ev->ev_fd, ev);
+ else
+ res = evmap_signal_del_(base, (int)ev->ev_fd, ev);
+ if (res == 1) {
+ /* evmap says we need to notify the main thread. */
+ notify = 1;
+ res = 0;
+ }
+ }
+
+ /* if we are not in the right thread, we need to wake up the loop */
+ if (res != -1 && notify && EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+
+ event_debug_note_del_(ev);
+
+ return (res);
+}
+
+void
+event_active(struct event *ev, int res, short ncalls)
+{
+ if (EVUTIL_FAILURE_CHECK(!ev->ev_base)) {
+ event_warnx("%s: event has no event_base set.", __func__);
+ return;
+ }
+
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+
+ event_debug_assert_is_setup_(ev);
+
+ event_active_nolock_(ev, res, ncalls);
+
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+}
+
+
+void
+event_active_nolock_(struct event *ev, int res, short ncalls)
+{
+ struct event_base *base;
+
+ event_debug(("event_active: %p (fd "EV_SOCK_FMT"), res %d, callback %p",
+ ev, EV_SOCK_ARG(ev->ev_fd), (int)res, ev->ev_callback));
+
+ base = ev->ev_base;
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (ev->ev_flags & EVLIST_FINALIZING) {
+ /* XXXX debug */
+ return;
+ }
+
+ switch ((ev->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))) {
+ default:
+ case EVLIST_ACTIVE|EVLIST_ACTIVE_LATER:
+ EVUTIL_ASSERT(0);
+ break;
+ case EVLIST_ACTIVE:
+ /* We get different kinds of events, add them together */
+ ev->ev_res |= res;
+ return;
+ case EVLIST_ACTIVE_LATER:
+ ev->ev_res |= res;
+ break;
+ case 0:
+ ev->ev_res = res;
+ break;
+ }
+
+ if (ev->ev_pri < base->event_running_priority)
+ base->event_continue = 1;
+
+ if (ev->ev_events & EV_SIGNAL) {
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->current_event == event_to_event_callback(ev) &&
+ !EVBASE_IN_THREAD(base)) {
+ ++base->current_event_waiters;
+ EVTHREAD_COND_WAIT(base->current_event_cond, base->th_base_lock);
+ }
+#endif
+ ev->ev_ncalls = ncalls;
+ ev->ev_pncalls = NULL;
+ }
+
+ event_callback_activate_nolock_(base, event_to_event_callback(ev));
+}
+
+void
+event_active_later_(struct event *ev, int res)
+{
+ EVBASE_ACQUIRE_LOCK(ev->ev_base, th_base_lock);
+ event_active_later_nolock_(ev, res);
+ EVBASE_RELEASE_LOCK(ev->ev_base, th_base_lock);
+}
+
+void
+event_active_later_nolock_(struct event *ev, int res)
+{
+ struct event_base *base = ev->ev_base;
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (ev->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) {
+ /* We get different kinds of events, add them together */
+ ev->ev_res |= res;
+ return;
+ }
+
+ ev->ev_res = res;
+
+ event_callback_activate_later_nolock_(base, event_to_event_callback(ev));
+}
+
+int
+event_callback_activate_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ int r;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_callback_activate_nolock_(base, evcb);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+int
+event_callback_activate_nolock_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ int r = 1;
+
+ if (evcb->evcb_flags & EVLIST_FINALIZING)
+ return 0;
+
+ switch (evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) {
+ default:
+ EVUTIL_ASSERT(0);
+ case EVLIST_ACTIVE_LATER:
+ event_queue_remove_active_later(base, evcb);
+ r = 0;
+ break;
+ case EVLIST_ACTIVE:
+ return 0;
+ case 0:
+ break;
+ }
+
+ event_queue_insert_active(base, evcb);
+
+ if (EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+
+ return r;
+}
+
+void
+event_callback_activate_later_nolock_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ if (evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))
+ return;
+
+ event_queue_insert_active_later(base, evcb);
+ if (EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+}
+
+void
+event_callback_init_(struct event_base *base,
+ struct event_callback *cb)
+{
+ memset(cb, 0, sizeof(*cb));
+ cb->evcb_pri = base->nactivequeues - 1;
+}
+
+int
+event_callback_cancel_(struct event_base *base,
+ struct event_callback *evcb)
+{
+ int r;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_callback_cancel_nolock_(base, evcb, 0);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+int
+event_callback_cancel_nolock_(struct event_base *base,
+ struct event_callback *evcb, int even_if_finalizing)
+{
+ if ((evcb->evcb_flags & EVLIST_FINALIZING) && !even_if_finalizing)
+ return 0;
+
+ if (evcb->evcb_flags & EVLIST_INIT)
+ return event_del_nolock_(event_callback_to_event(evcb),
+ even_if_finalizing ? EVENT_DEL_EVEN_IF_FINALIZING : EVENT_DEL_AUTOBLOCK);
+
+ switch ((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER))) {
+ default:
+ case EVLIST_ACTIVE|EVLIST_ACTIVE_LATER:
+ EVUTIL_ASSERT(0);
+ break;
+ case EVLIST_ACTIVE:
+ /* We get different kinds of events, add them together */
+ event_queue_remove_active(base, evcb);
+ return 0;
+ case EVLIST_ACTIVE_LATER:
+ event_queue_remove_active_later(base, evcb);
+ break;
+ case 0:
+ break;
+ }
+
+ return 0;
+}
+
+void
+event_deferred_cb_init_(struct event_callback *cb, ev_uint8_t priority, deferred_cb_fn fn, void *arg)
+{
+ memset(cb, 0, sizeof(*cb));
+ cb->evcb_cb_union.evcb_selfcb = fn;
+ cb->evcb_arg = arg;
+ cb->evcb_pri = priority;
+ cb->evcb_closure = EV_CLOSURE_CB_SELF;
+}
+
+void
+event_deferred_cb_set_priority_(struct event_callback *cb, ev_uint8_t priority)
+{
+ cb->evcb_pri = priority;
+}
+
+void
+event_deferred_cb_cancel_(struct event_base *base, struct event_callback *cb)
+{
+ if (!base)
+ base = current_base;
+ event_callback_cancel_(base, cb);
+}
+
+#define MAX_DEFERREDS_QUEUED 32
+int
+event_deferred_cb_schedule_(struct event_base *base, struct event_callback *cb)
+{
+ int r = 1;
+ if (!base)
+ base = current_base;
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ if (base->n_deferreds_queued > MAX_DEFERREDS_QUEUED) {
+ event_callback_activate_later_nolock_(base, cb);
+ } else {
+ ++base->n_deferreds_queued;
+ r = event_callback_activate_nolock_(base, cb);
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+static int
+timeout_next(struct event_base *base, struct timeval **tv_p)
+{
+ /* Caller must hold th_base_lock */
+ struct timeval now;
+ struct event *ev;
+ struct timeval *tv = *tv_p;
+ int res = 0;
+
+ ev = min_heap_top_(&base->timeheap);
+
+ if (ev == NULL) {
+ /* if no time-based events are active wait for I/O */
+ *tv_p = NULL;
+ goto out;
+ }
+
+ if (gettime(base, &now) == -1) {
+ res = -1;
+ goto out;
+ }
+
+ if (evutil_timercmp(&ev->ev_timeout, &now, <=)) {
+ evutil_timerclear(tv);
+ goto out;
+ }
+
+ evutil_timersub(&ev->ev_timeout, &now, tv);
+
+ EVUTIL_ASSERT(tv->tv_sec >= 0);
+ EVUTIL_ASSERT(tv->tv_usec >= 0);
+ event_debug(("timeout_next: event: %p, in %d seconds, %d useconds", ev, (int)tv->tv_sec, (int)tv->tv_usec));
+
+out:
+ return (res);
+}
+
+/* Activate every event whose timeout has elapsed. */
+static void
+timeout_process(struct event_base *base)
+{
+ /* Caller must hold lock. */
+ struct timeval now;
+ struct event *ev;
+
+ if (min_heap_empty_(&base->timeheap)) {
+ return;
+ }
+
+ gettime(base, &now);
+
+ while ((ev = min_heap_top_(&base->timeheap))) {
+ if (evutil_timercmp(&ev->ev_timeout, &now, >))
+ break;
+
+ /* delete this event from the I/O queues */
+ event_del_nolock_(ev, EVENT_DEL_NOBLOCK);
+
+ event_debug(("timeout_process: event: %p, call %p",
+ ev, ev->ev_callback));
+ event_active_nolock_(ev, EV_TIMEOUT, 1);
+ }
+}
+
+#if (EVLIST_INTERNAL >> 4) != 1
+#error "Mismatch for value of EVLIST_INTERNAL"
+#endif
+
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
+#define MAX_EVENT_COUNT(var, v) var = MAX(var, v)
+
+/* These are a fancy way to spell
+ if (flags & EVLIST_INTERNAL)
+ base->event_count--/++;
+*/
+#define DECR_EVENT_COUNT(base,flags) \
+ ((base)->event_count -= (~((flags) >> 4) & 1))
+#define INCR_EVENT_COUNT(base,flags) do { \
+ ((base)->event_count += (~((flags) >> 4) & 1)); \
+ MAX_EVENT_COUNT((base)->event_count_max, (base)->event_count); \
+} while (0)
+
+static void
+event_queue_remove_inserted(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(ev->ev_flags & EVLIST_INSERTED))) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") not on queue %x", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd), EVLIST_INSERTED);
+ return;
+ }
+ DECR_EVENT_COUNT(base, ev->ev_flags);
+ ev->ev_flags &= ~EVLIST_INSERTED;
+}
+static void
+event_queue_remove_active(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(evcb->evcb_flags & EVLIST_ACTIVE))) {
+ event_errx(1, "%s: %p not on queue %x", __func__,
+ evcb, EVLIST_ACTIVE);
+ return;
+ }
+ DECR_EVENT_COUNT(base, evcb->evcb_flags);
+ evcb->evcb_flags &= ~EVLIST_ACTIVE;
+ base->event_count_active--;
+
+ TAILQ_REMOVE(&base->activequeues[evcb->evcb_pri],
+ evcb, evcb_active_next);
+}
+static void
+event_queue_remove_active_later(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(evcb->evcb_flags & EVLIST_ACTIVE_LATER))) {
+ event_errx(1, "%s: %p not on queue %x", __func__,
+ evcb, EVLIST_ACTIVE_LATER);
+ return;
+ }
+ DECR_EVENT_COUNT(base, evcb->evcb_flags);
+ evcb->evcb_flags &= ~EVLIST_ACTIVE_LATER;
+ base->event_count_active--;
+
+ TAILQ_REMOVE(&base->active_later_queue, evcb, evcb_active_next);
+}
+static void
+event_queue_remove_timeout(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (EVUTIL_FAILURE_CHECK(!(ev->ev_flags & EVLIST_TIMEOUT))) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") not on queue %x", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd), EVLIST_TIMEOUT);
+ return;
+ }
+ DECR_EVENT_COUNT(base, ev->ev_flags);
+ ev->ev_flags &= ~EVLIST_TIMEOUT;
+
+ if (is_common_timeout(&ev->ev_timeout, base)) {
+ struct common_timeout_list *ctl =
+ get_common_timeout_list(base, &ev->ev_timeout);
+ TAILQ_REMOVE(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ } else {
+ min_heap_erase_(&base->timeheap, ev);
+ }
+}
+
+#ifdef USE_REINSERT_TIMEOUT
+/* Remove and reinsert 'ev' into the timeout queue. */
+static void
+event_queue_reinsert_timeout(struct event_base *base, struct event *ev,
+ int was_common, int is_common, int old_timeout_idx)
+{
+ struct common_timeout_list *ctl;
+ if (!(ev->ev_flags & EVLIST_TIMEOUT)) {
+ event_queue_insert_timeout(base, ev);
+ return;
+ }
+
+ switch ((was_common<<1) | is_common) {
+ case 3: /* Changing from one common timeout to another */
+ ctl = base->common_timeout_queues[old_timeout_idx];
+ TAILQ_REMOVE(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ ctl = get_common_timeout_list(base, &ev->ev_timeout);
+ insert_common_timeout_inorder(ctl, ev);
+ break;
+ case 2: /* Was common; is no longer common */
+ ctl = base->common_timeout_queues[old_timeout_idx];
+ TAILQ_REMOVE(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ min_heap_push_(&base->timeheap, ev);
+ break;
+ case 1: /* Wasn't common; has become common. */
+ min_heap_erase_(&base->timeheap, ev);
+ ctl = get_common_timeout_list(base, &ev->ev_timeout);
+ insert_common_timeout_inorder(ctl, ev);
+ break;
+ case 0: /* was in heap; is still on heap. */
+ min_heap_adjust_(&base->timeheap, ev);
+ break;
+ default:
+ EVUTIL_ASSERT(0); /* unreachable */
+ break;
+ }
+}
+#endif
+
+/* Add 'ev' to the common timeout list in 'ev'. */
+static void
+insert_common_timeout_inorder(struct common_timeout_list *ctl,
+ struct event *ev)
+{
+ struct event *e;
+ /* By all logic, we should just be able to append 'ev' to the end of
+ * ctl->events, since the timeout on each 'ev' is set to {the common
+ * timeout} + {the time when we add the event}, and so the events
+ * should arrive in order of their timeeouts. But just in case
+ * there's some wacky threading issue going on, we do a search from
+ * the end of 'ev' to find the right insertion point.
+ */
+ TAILQ_FOREACH_REVERSE(e, &ctl->events,
+ event_list, ev_timeout_pos.ev_next_with_common_timeout) {
+ /* This timercmp is a little sneaky, since both ev and e have
+ * magic values in tv_usec. Fortunately, they ought to have
+ * the _same_ magic values in tv_usec. Let's assert for that.
+ */
+ EVUTIL_ASSERT(
+ is_same_common_timeout(&e->ev_timeout, &ev->ev_timeout));
+ if (evutil_timercmp(&ev->ev_timeout, &e->ev_timeout, >=)) {
+ TAILQ_INSERT_AFTER(&ctl->events, e, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+ return;
+ }
+ }
+ TAILQ_INSERT_HEAD(&ctl->events, ev,
+ ev_timeout_pos.ev_next_with_common_timeout);
+}
+
+static void
+event_queue_insert_inserted(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (EVUTIL_FAILURE_CHECK(ev->ev_flags & EVLIST_INSERTED)) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") already inserted", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd));
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, ev->ev_flags);
+
+ ev->ev_flags |= EVLIST_INSERTED;
+}
+
+static void
+event_queue_insert_active(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (evcb->evcb_flags & EVLIST_ACTIVE) {
+ /* Double insertion is possible for active events */
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, evcb->evcb_flags);
+
+ evcb->evcb_flags |= EVLIST_ACTIVE;
+
+ base->event_count_active++;
+ MAX_EVENT_COUNT(base->event_count_active_max, base->event_count_active);
+ EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues);
+ TAILQ_INSERT_TAIL(&base->activequeues[evcb->evcb_pri],
+ evcb, evcb_active_next);
+}
+
+static void
+event_queue_insert_active_later(struct event_base *base, struct event_callback *evcb)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+ if (evcb->evcb_flags & (EVLIST_ACTIVE_LATER|EVLIST_ACTIVE)) {
+ /* Double insertion is possible */
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, evcb->evcb_flags);
+ evcb->evcb_flags |= EVLIST_ACTIVE_LATER;
+ base->event_count_active++;
+ MAX_EVENT_COUNT(base->event_count_active_max, base->event_count_active);
+ EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues);
+ TAILQ_INSERT_TAIL(&base->active_later_queue, evcb, evcb_active_next);
+}
+
+static void
+event_queue_insert_timeout(struct event_base *base, struct event *ev)
+{
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ if (EVUTIL_FAILURE_CHECK(ev->ev_flags & EVLIST_TIMEOUT)) {
+ event_errx(1, "%s: %p(fd "EV_SOCK_FMT") already on timeout", __func__,
+ ev, EV_SOCK_ARG(ev->ev_fd));
+ return;
+ }
+
+ INCR_EVENT_COUNT(base, ev->ev_flags);
+
+ ev->ev_flags |= EVLIST_TIMEOUT;
+
+ if (is_common_timeout(&ev->ev_timeout, base)) {
+ struct common_timeout_list *ctl =
+ get_common_timeout_list(base, &ev->ev_timeout);
+ insert_common_timeout_inorder(ctl, ev);
+ } else {
+ min_heap_push_(&base->timeheap, ev);
+ }
+}
+
+static void
+event_queue_make_later_events_active(struct event_base *base)
+{
+ struct event_callback *evcb;
+ EVENT_BASE_ASSERT_LOCKED(base);
+
+ while ((evcb = TAILQ_FIRST(&base->active_later_queue))) {
+ TAILQ_REMOVE(&base->active_later_queue, evcb, evcb_active_next);
+ evcb->evcb_flags = (evcb->evcb_flags & ~EVLIST_ACTIVE_LATER) | EVLIST_ACTIVE;
+ EVUTIL_ASSERT(evcb->evcb_pri < base->nactivequeues);
+ TAILQ_INSERT_TAIL(&base->activequeues[evcb->evcb_pri], evcb, evcb_active_next);
+ base->n_deferreds_queued += (evcb->evcb_closure == EV_CLOSURE_CB_SELF);
+ }
+}
+
+/* Functions for debugging */
+
+const char *
+event_get_version(void)
+{
+ return (EVENT__VERSION);
+}
+
+ev_uint32_t
+event_get_version_number(void)
+{
+ return (EVENT__NUMERIC_VERSION);
+}
+
+/*
+ * No thread-safe interface needed - the information should be the same
+ * for all threads.
+ */
+
+const char *
+event_get_method(void)
+{
+ return (current_base->evsel->name);
+}
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+static void *(*mm_malloc_fn_)(size_t sz) = NULL;
+static void *(*mm_realloc_fn_)(void *p, size_t sz) = NULL;
+static void (*mm_free_fn_)(void *p) = NULL;
+
+void *
+event_mm_malloc_(size_t sz)
+{
+ if (sz == 0)
+ return NULL;
+
+ if (mm_malloc_fn_)
+ return mm_malloc_fn_(sz);
+ else
+ return malloc(sz);
+}
+
+void *
+event_mm_calloc_(size_t count, size_t size)
+{
+ if (count == 0 || size == 0)
+ return NULL;
+
+ if (mm_malloc_fn_) {
+ size_t sz = count * size;
+ void *p = NULL;
+ if (count > EV_SIZE_MAX / size)
+ goto error;
+ p = mm_malloc_fn_(sz);
+ if (p)
+ return memset(p, 0, sz);
+ } else {
+ void *p = calloc(count, size);
+#ifdef _WIN32
+ /* Windows calloc doesn't reliably set ENOMEM */
+ if (p == NULL)
+ goto error;
+#endif
+ return p;
+ }
+
+error:
+ errno = ENOMEM;
+ return NULL;
+}
+
+char *
+event_mm_strdup_(const char *str)
+{
+ if (!str) {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ if (mm_malloc_fn_) {
+ size_t ln = strlen(str);
+ void *p = NULL;
+ if (ln == EV_SIZE_MAX)
+ goto error;
+ p = mm_malloc_fn_(ln+1);
+ if (p)
+ return memcpy(p, str, ln+1);
+ } else
+#ifdef _WIN32
+ return _strdup(str);
+#else
+ return strdup(str);
+#endif
+
+error:
+ errno = ENOMEM;
+ return NULL;
+}
+
+void *
+event_mm_realloc_(void *ptr, size_t sz)
+{
+ if (mm_realloc_fn_)
+ return mm_realloc_fn_(ptr, sz);
+ else
+ return realloc(ptr, sz);
+}
+
+void
+event_mm_free_(void *ptr)
+{
+ if (mm_free_fn_)
+ mm_free_fn_(ptr);
+ else
+ free(ptr);
+}
+
+void
+event_set_mem_functions(void *(*malloc_fn)(size_t sz),
+ void *(*realloc_fn)(void *ptr, size_t sz),
+ void (*free_fn)(void *ptr))
+{
+ mm_malloc_fn_ = malloc_fn;
+ mm_realloc_fn_ = realloc_fn;
+ mm_free_fn_ = free_fn;
+}
+#endif
+
+#ifdef EVENT__HAVE_EVENTFD
+static void
+evthread_notify_drain_eventfd(evutil_socket_t fd, short what, void *arg)
+{
+ ev_uint64_t msg;
+ ev_ssize_t r;
+ struct event_base *base = arg;
+
+ r = read(fd, (void*) &msg, sizeof(msg));
+ if (r<0 && errno != EAGAIN) {
+ event_sock_warn(fd, "Error reading from eventfd");
+ }
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->is_notify_pending = 0;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+#endif
+
+static void
+evthread_notify_drain_default(evutil_socket_t fd, short what, void *arg)
+{
+ unsigned char buf[1024];
+ struct event_base *base = arg;
+#ifdef _WIN32
+ while (recv(fd, (char*)buf, sizeof(buf), 0) > 0)
+ ;
+#else
+ while (read(fd, (char*)buf, sizeof(buf)) > 0)
+ ;
+#endif
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->is_notify_pending = 0;
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+int
+evthread_make_base_notifiable(struct event_base *base)
+{
+ int r;
+ if (!base)
+ return -1;
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = evthread_make_base_notifiable_nolock_(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+static int
+evthread_make_base_notifiable_nolock_(struct event_base *base)
+{
+ void (*cb)(evutil_socket_t, short, void *);
+ int (*notify)(struct event_base *);
+
+ if (base->th_notify_fn != NULL) {
+ /* The base is already notifiable: we're doing fine. */
+ return 0;
+ }
+
+#if defined(EVENT__HAVE_WORKING_KQUEUE)
+ if (base->evsel == &kqops && event_kq_add_notify_event_(base) == 0) {
+ base->th_notify_fn = event_kq_notify_base_;
+ /* No need to add an event here; the backend can wake
+ * itself up just fine. */
+ return 0;
+ }
+#endif
+
+#ifdef EVENT__HAVE_EVENTFD
+ base->th_notify_fd[0] = evutil_eventfd_(0,
+ EVUTIL_EFD_CLOEXEC|EVUTIL_EFD_NONBLOCK);
+ if (base->th_notify_fd[0] >= 0) {
+ base->th_notify_fd[1] = -1;
+ notify = evthread_notify_base_eventfd;
+ cb = evthread_notify_drain_eventfd;
+ } else
+#endif
+ if (evutil_make_internal_pipe_(base->th_notify_fd) == 0) {
+ notify = evthread_notify_base_default;
+ cb = evthread_notify_drain_default;
+ } else {
+ return -1;
+ }
+
+ base->th_notify_fn = notify;
+
+ /* prepare an event that we can use for wakeup */
+ event_assign(&base->th_notify, base, base->th_notify_fd[0],
+ EV_READ|EV_PERSIST, cb, base);
+
+ /* we need to mark this as internal event */
+ base->th_notify.ev_flags |= EVLIST_INTERNAL;
+ event_priority_set(&base->th_notify, 0);
+
+ return event_add_nolock_(&base->th_notify, NULL, 0);
+}
+
+int
+event_base_foreach_event_nolock_(struct event_base *base,
+ event_base_foreach_event_cb fn, void *arg)
+{
+ int r, i;
+ unsigned u;
+ struct event *ev;
+
+ /* Start out with all the EVLIST_INSERTED events. */
+ if ((r = evmap_foreach_event_(base, fn, arg)))
+ return r;
+
+ /* Okay, now we deal with those events that have timeouts and are in
+ * the min-heap. */
+ for (u = 0; u < base->timeheap.n; ++u) {
+ ev = base->timeheap.p[u];
+ if (ev->ev_flags & EVLIST_INSERTED) {
+ /* we already processed this one */
+ continue;
+ }
+ if ((r = fn(base, ev, arg)))
+ return r;
+ }
+
+ /* Now for the events in one of the timeout queues.
+ * the min-heap. */
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ struct common_timeout_list *ctl =
+ base->common_timeout_queues[i];
+ TAILQ_FOREACH(ev, &ctl->events,
+ ev_timeout_pos.ev_next_with_common_timeout) {
+ if (ev->ev_flags & EVLIST_INSERTED) {
+ /* we already processed this one */
+ continue;
+ }
+ if ((r = fn(base, ev, arg)))
+ return r;
+ }
+ }
+
+ /* Finally, we deal wit all the active events that we haven't touched
+ * yet. */
+ for (i = 0; i < base->nactivequeues; ++i) {
+ struct event_callback *evcb;
+ TAILQ_FOREACH(evcb, &base->activequeues[i], evcb_active_next) {
+ if ((evcb->evcb_flags & (EVLIST_INIT|EVLIST_INSERTED|EVLIST_TIMEOUT)) != EVLIST_INIT) {
+ /* This isn't an event (evlist_init clear), or
+ * we already processed it. (inserted or
+ * timeout set */
+ continue;
+ }
+ ev = event_callback_to_event(evcb);
+ if ((r = fn(base, ev, arg)))
+ return r;
+ }
+ }
+
+ return 0;
+}
+
+/* Helper for event_base_dump_events: called on each event in the event base;
+ * dumps only the inserted events. */
+static int
+dump_inserted_event_fn(const struct event_base *base, const struct event *e, void *arg)
+{
+ FILE *output = arg;
+ const char *gloss = (e->ev_events & EV_SIGNAL) ?
+ "sig" : "fd ";
+
+ if (! (e->ev_flags & (EVLIST_INSERTED|EVLIST_TIMEOUT)))
+ return 0;
+
+ fprintf(output, " %p [%s "EV_SOCK_FMT"]%s%s%s%s%s%s",
+ (void*)e, gloss, EV_SOCK_ARG(e->ev_fd),
+ (e->ev_events&EV_READ)?" Read":"",
+ (e->ev_events&EV_WRITE)?" Write":"",
+ (e->ev_events&EV_CLOSED)?" EOF":"",
+ (e->ev_events&EV_SIGNAL)?" Signal":"",
+ (e->ev_events&EV_PERSIST)?" Persist":"",
+ (e->ev_flags&EVLIST_INTERNAL)?" Internal":"");
+ if (e->ev_flags & EVLIST_TIMEOUT) {
+ struct timeval tv;
+ tv.tv_sec = e->ev_timeout.tv_sec;
+ tv.tv_usec = e->ev_timeout.tv_usec & MICROSECONDS_MASK;
+ evutil_timeradd(&tv, &base->tv_clock_diff, &tv);
+ fprintf(output, " Timeout=%ld.%06d",
+ (long)tv.tv_sec, (int)(tv.tv_usec & MICROSECONDS_MASK));
+ }
+ fputc('\n', output);
+
+ return 0;
+}
+
+/* Helper for event_base_dump_events: called on each event in the event base;
+ * dumps only the active events. */
+static int
+dump_active_event_fn(const struct event_base *base, const struct event *e, void *arg)
+{
+ FILE *output = arg;
+ const char *gloss = (e->ev_events & EV_SIGNAL) ?
+ "sig" : "fd ";
+
+ if (! (e->ev_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)))
+ return 0;
+
+ fprintf(output, " %p [%s "EV_SOCK_FMT", priority=%d]%s%s%s%s%s active%s%s\n",
+ (void*)e, gloss, EV_SOCK_ARG(e->ev_fd), e->ev_pri,
+ (e->ev_res&EV_READ)?" Read":"",
+ (e->ev_res&EV_WRITE)?" Write":"",
+ (e->ev_res&EV_CLOSED)?" EOF":"",
+ (e->ev_res&EV_SIGNAL)?" Signal":"",
+ (e->ev_res&EV_TIMEOUT)?" Timeout":"",
+ (e->ev_flags&EVLIST_INTERNAL)?" [Internal]":"",
+ (e->ev_flags&EVLIST_ACTIVE_LATER)?" [NextTime]":"");
+
+ return 0;
+}
+
+int
+event_base_foreach_event(struct event_base *base,
+ event_base_foreach_event_cb fn, void *arg)
+{
+ int r;
+ if ((!fn) || (!base)) {
+ return -1;
+ }
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ r = event_base_foreach_event_nolock_(base, fn, arg);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return r;
+}
+
+
+void
+event_base_dump_events(struct event_base *base, FILE *output)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ fprintf(output, "Inserted events:\n");
+ event_base_foreach_event_nolock_(base, dump_inserted_event_fn, output);
+
+ fprintf(output, "Active events:\n");
+ event_base_foreach_event_nolock_(base, dump_active_event_fn, output);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ evmap_io_active_(base, fd, events & (EV_READ|EV_WRITE|EV_CLOSED));
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_active_by_signal(struct event_base *base, int sig)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ evmap_signal_active_(base, sig, 1);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+
+void
+event_base_add_virtual_(struct event_base *base)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ base->virtual_event_count++;
+ MAX_EVENT_COUNT(base->virtual_event_count_max, base->virtual_event_count);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_del_virtual_(struct event_base *base)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ EVUTIL_ASSERT(base->virtual_event_count > 0);
+ base->virtual_event_count--;
+ if (base->virtual_event_count == 0 && EVBASE_NEED_NOTIFY(base))
+ evthread_notify_base(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+static void
+event_free_debug_globals_locks(void)
+{
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ if (event_debug_map_lock_ != NULL) {
+ EVTHREAD_FREE_LOCK(event_debug_map_lock_, 0);
+ event_debug_map_lock_ = NULL;
+ }
+#endif /* EVENT__DISABLE_DEBUG_MODE */
+#endif /* EVENT__DISABLE_THREAD_SUPPORT */
+ return;
+}
+
+static void
+event_free_debug_globals(void)
+{
+ event_free_debug_globals_locks();
+}
+
+static void
+event_free_evsig_globals(void)
+{
+ evsig_free_globals_();
+}
+
+static void
+event_free_evutil_globals(void)
+{
+ evutil_free_globals_();
+}
+
+static void
+event_free_globals(void)
+{
+ event_free_debug_globals();
+ event_free_evsig_globals();
+ event_free_evutil_globals();
+}
+
+void
+libevent_global_shutdown(void)
+{
+ event_free_globals();
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+event_global_setup_locks_(const int enable_locks)
+{
+#ifndef EVENT__DISABLE_DEBUG_MODE
+ EVTHREAD_SETUP_GLOBAL_LOCK(event_debug_map_lock_, 0);
+#endif
+ if (evsig_global_setup_locks_(enable_locks) < 0)
+ return -1;
+ if (evutil_global_setup_locks_(enable_locks) < 0)
+ return -1;
+ if (evutil_secure_rng_global_setup_locks_(enable_locks) < 0)
+ return -1;
+ return 0;
+}
+#endif
+
+void
+event_base_assert_ok_(struct event_base *base)
+{
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ event_base_assert_ok_nolock_(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+void
+event_base_assert_ok_nolock_(struct event_base *base)
+{
+ int i;
+ int count;
+
+ /* First do checks on the per-fd and per-signal lists */
+ evmap_check_integrity_(base);
+
+ /* Check the heap property */
+ for (i = 1; i < (int)base->timeheap.n; ++i) {
+ int parent = (i - 1) / 2;
+ struct event *ev, *p_ev;
+ ev = base->timeheap.p[i];
+ p_ev = base->timeheap.p[parent];
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_TIMEOUT);
+ EVUTIL_ASSERT(evutil_timercmp(&p_ev->ev_timeout, &ev->ev_timeout, <=));
+ EVUTIL_ASSERT(ev->ev_timeout_pos.min_heap_idx == i);
+ }
+
+ /* Check that the common timeouts are fine */
+ for (i = 0; i < base->n_common_timeouts; ++i) {
+ struct common_timeout_list *ctl = base->common_timeout_queues[i];
+ struct event *last=NULL, *ev;
+
+ EVUTIL_ASSERT_TAILQ_OK(&ctl->events, event, ev_timeout_pos.ev_next_with_common_timeout);
+
+ TAILQ_FOREACH(ev, &ctl->events, ev_timeout_pos.ev_next_with_common_timeout) {
+ if (last)
+ EVUTIL_ASSERT(evutil_timercmp(&last->ev_timeout, &ev->ev_timeout, <=));
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_TIMEOUT);
+ EVUTIL_ASSERT(is_common_timeout(&ev->ev_timeout,base));
+ EVUTIL_ASSERT(COMMON_TIMEOUT_IDX(&ev->ev_timeout) == i);
+ last = ev;
+ }
+ }
+
+ /* Check the active queues. */
+ count = 0;
+ for (i = 0; i < base->nactivequeues; ++i) {
+ struct event_callback *evcb;
+ EVUTIL_ASSERT_TAILQ_OK(&base->activequeues[i], event_callback, evcb_active_next);
+ TAILQ_FOREACH(evcb, &base->activequeues[i], evcb_active_next) {
+ EVUTIL_ASSERT((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) == EVLIST_ACTIVE);
+ EVUTIL_ASSERT(evcb->evcb_pri == i);
+ ++count;
+ }
+ }
+
+ {
+ struct event_callback *evcb;
+ TAILQ_FOREACH(evcb, &base->active_later_queue, evcb_active_next) {
+ EVUTIL_ASSERT((evcb->evcb_flags & (EVLIST_ACTIVE|EVLIST_ACTIVE_LATER)) == EVLIST_ACTIVE_LATER);
+ ++count;
+ }
+ }
+ EVUTIL_ASSERT(count == base->event_count_active);
+}
diff --git a/sntp/libevent/event_iocp.c b/sntp/libevent/event_iocp.c
new file mode 100644
index 0000000..a9902fb
--- /dev/null
+++ b/sntp/libevent/event_iocp.c
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "evconfig-private.h"
+
+#ifndef _WIN32_WINNT
+/* Minimum required for InitializeCriticalSectionAndSpinCount */
+#define _WIN32_WINNT 0x0403
+#endif
+#include <winsock2.h>
+#include <windows.h>
+#include <process.h>
+#include <stdio.h>
+#include <mswsock.h>
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "iocp-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "event-internal.h"
+#include "evthread-internal.h"
+
+#define NOTIFICATION_KEY ((ULONG_PTR)-1)
+
+void
+event_overlapped_init_(struct event_overlapped *o, iocp_callback cb)
+{
+ memset(o, 0, sizeof(struct event_overlapped));
+ o->cb = cb;
+}
+
+static void
+handle_entry(OVERLAPPED *o, ULONG_PTR completion_key, DWORD nBytes, int ok)
+{
+ struct event_overlapped *eo =
+ EVUTIL_UPCAST(o, struct event_overlapped, overlapped);
+ eo->cb(eo, completion_key, nBytes, ok);
+}
+
+static void
+loop(void *port_)
+{
+ struct event_iocp_port *port = port_;
+ long ms = port->ms;
+ HANDLE p = port->port;
+
+ if (ms <= 0)
+ ms = INFINITE;
+
+ while (1) {
+ OVERLAPPED *overlapped=NULL;
+ ULONG_PTR key=0;
+ DWORD bytes=0;
+ int ok = GetQueuedCompletionStatus(p, &bytes, &key,
+ &overlapped, ms);
+ EnterCriticalSection(&port->lock);
+ if (port->shutdown) {
+ if (--port->n_live_threads == 0)
+ ReleaseSemaphore(port->shutdownSemaphore, 1,
+ NULL);
+ LeaveCriticalSection(&port->lock);
+ return;
+ }
+ LeaveCriticalSection(&port->lock);
+
+ if (key != NOTIFICATION_KEY && overlapped)
+ handle_entry(overlapped, key, bytes, ok);
+ else if (!overlapped)
+ break;
+ }
+ event_warnx("GetQueuedCompletionStatus exited with no event.");
+ EnterCriticalSection(&port->lock);
+ if (--port->n_live_threads == 0)
+ ReleaseSemaphore(port->shutdownSemaphore, 1, NULL);
+ LeaveCriticalSection(&port->lock);
+}
+
+int
+event_iocp_port_associate_(struct event_iocp_port *port, evutil_socket_t fd,
+ ev_uintptr_t key)
+{
+ HANDLE h;
+ h = CreateIoCompletionPort((HANDLE)fd, port->port, key, port->n_threads);
+ if (!h)
+ return -1;
+ return 0;
+}
+
+static void *
+get_extension_function(SOCKET s, const GUID *which_fn)
+{
+ void *ptr = NULL;
+ DWORD bytes=0;
+ WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER,
+ (GUID*)which_fn, sizeof(*which_fn),
+ &ptr, sizeof(ptr),
+ &bytes, NULL, NULL);
+
+ /* No need to detect errors here: if ptr is set, then we have a good
+ function pointer. Otherwise, we should behave as if we had no
+ function pointer.
+ */
+ return ptr;
+}
+
+/* Mingw doesn't have these in its mswsock.h. The values are copied from
+ wine.h. Perhaps if we copy them exactly, the cargo will come again.
+*/
+#ifndef WSAID_ACCEPTEX
+#define WSAID_ACCEPTEX \
+ {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
+#endif
+#ifndef WSAID_CONNECTEX
+#define WSAID_CONNECTEX \
+ {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
+#endif
+#ifndef WSAID_GETACCEPTEXSOCKADDRS
+#define WSAID_GETACCEPTEXSOCKADDRS \
+ {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
+#endif
+
+static int extension_fns_initialized = 0;
+
+static void
+init_extension_functions(struct win32_extension_fns *ext)
+{
+ const GUID acceptex = WSAID_ACCEPTEX;
+ const GUID connectex = WSAID_CONNECTEX;
+ const GUID getacceptexsockaddrs = WSAID_GETACCEPTEXSOCKADDRS;
+ SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
+ if (s == INVALID_SOCKET)
+ return;
+ ext->AcceptEx = get_extension_function(s, &acceptex);
+ ext->ConnectEx = get_extension_function(s, &connectex);
+ ext->GetAcceptExSockaddrs = get_extension_function(s,
+ &getacceptexsockaddrs);
+ closesocket(s);
+
+ extension_fns_initialized = 1;
+}
+
+static struct win32_extension_fns the_extension_fns;
+
+const struct win32_extension_fns *
+event_get_win32_extension_fns_(void)
+{
+ return &the_extension_fns;
+}
+
+#define N_CPUS_DEFAULT 2
+
+struct event_iocp_port *
+event_iocp_port_launch_(int n_cpus)
+{
+ struct event_iocp_port *port;
+ int i;
+
+ if (!extension_fns_initialized)
+ init_extension_functions(&the_extension_fns);
+
+ if (!(port = mm_calloc(1, sizeof(struct event_iocp_port))))
+ return NULL;
+
+ if (n_cpus <= 0)
+ n_cpus = N_CPUS_DEFAULT;
+ port->n_threads = n_cpus * 2;
+ port->threads = mm_calloc(port->n_threads, sizeof(HANDLE));
+ if (!port->threads)
+ goto err;
+
+ port->port = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0,
+ n_cpus);
+ port->ms = -1;
+ if (!port->port)
+ goto err;
+
+ port->shutdownSemaphore = CreateSemaphore(NULL, 0, 1, NULL);
+ if (!port->shutdownSemaphore)
+ goto err;
+
+ for (i=0; i<port->n_threads; ++i) {
+ ev_uintptr_t th = _beginthread(loop, 0, port);
+ if (th == (ev_uintptr_t)-1)
+ goto err;
+ port->threads[i] = (HANDLE)th;
+ ++port->n_live_threads;
+ }
+
+ InitializeCriticalSectionAndSpinCount(&port->lock, 1000);
+
+ return port;
+err:
+ if (port->port)
+ CloseHandle(port->port);
+ if (port->threads)
+ mm_free(port->threads);
+ if (port->shutdownSemaphore)
+ CloseHandle(port->shutdownSemaphore);
+ mm_free(port);
+ return NULL;
+}
+
+static void
+event_iocp_port_unlock_and_free_(struct event_iocp_port *port)
+{
+ DeleteCriticalSection(&port->lock);
+ CloseHandle(port->port);
+ CloseHandle(port->shutdownSemaphore);
+ mm_free(port->threads);
+ mm_free(port);
+}
+
+static int
+event_iocp_notify_all(struct event_iocp_port *port)
+{
+ int i, r, ok=1;
+ for (i=0; i<port->n_threads; ++i) {
+ r = PostQueuedCompletionStatus(port->port, 0, NOTIFICATION_KEY,
+ NULL);
+ if (!r)
+ ok = 0;
+ }
+ return ok ? 0 : -1;
+}
+
+int
+event_iocp_shutdown_(struct event_iocp_port *port, long waitMsec)
+{
+ DWORD ms = INFINITE;
+ int n;
+
+ EnterCriticalSection(&port->lock);
+ port->shutdown = 1;
+ LeaveCriticalSection(&port->lock);
+ event_iocp_notify_all(port);
+
+ if (waitMsec >= 0)
+ ms = waitMsec;
+
+ WaitForSingleObject(port->shutdownSemaphore, ms);
+ EnterCriticalSection(&port->lock);
+ n = port->n_live_threads;
+ LeaveCriticalSection(&port->lock);
+ if (n == 0) {
+ event_iocp_port_unlock_and_free_(port);
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+int
+event_iocp_activate_overlapped_(
+ struct event_iocp_port *port, struct event_overlapped *o,
+ ev_uintptr_t key, ev_uint32_t n)
+{
+ BOOL r;
+
+ r = PostQueuedCompletionStatus(port->port, n, key, &o->overlapped);
+ return (r==0) ? -1 : 0;
+}
+
+struct event_iocp_port *
+event_base_get_iocp_(struct event_base *base)
+{
+#ifdef _WIN32
+ return base->iocp;
+#else
+ return NULL;
+#endif
+}
diff --git a/sntp/libevent/event_rpcgen.py b/sntp/libevent/event_rpcgen.py
new file mode 100755
index 0000000..c537565
--- /dev/null
+++ b/sntp/libevent/event_rpcgen.py
@@ -0,0 +1,1728 @@
+#!/usr/bin/env python2
+#
+# Copyright (c) 2005-2007 Niels Provos <provos@citi.umich.edu>
+# Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+# All rights reserved.
+#
+# Generates marshaling code based on libevent.
+
+# TODO:
+# 1) use optparse to allow the strategy shell to parse options, and
+# to allow the instantiated factory (for the specific output language)
+# to parse remaining options
+# 2) move the globals into a class that manages execution (including the
+# progress outputs that space stderr at the moment)
+# 3) emit other languages
+
+import sys
+import re
+
+_NAME = "event_rpcgen.py"
+_VERSION = "0.1"
+
+# Globals
+line_count = 0
+
+white = re.compile(r'\s+')
+cppcomment = re.compile(r'\/\/.*$')
+nonident = re.compile(r'[^a-zA-Z0-9_]')
+structref = re.compile(r'^struct\[([a-zA-Z_][a-zA-Z0-9_]*)\]$')
+structdef = re.compile(r'^struct +[a-zA-Z_][a-zA-Z0-9_]* *{$')
+
+headerdirect = []
+cppdirect = []
+
+QUIETLY = 0
+
+def declare(s):
+ if not QUIETLY:
+ print s
+
+def TranslateList(mylist, mydict):
+ return map(lambda x: x % mydict, mylist)
+
+# Exception class for parse errors
+class RpcGenError(Exception):
+ def __init__(self, why):
+ self.why = why
+ def __str__(self):
+ return str(self.why)
+
+# Holds everything that makes a struct
+class Struct:
+ def __init__(self, name):
+ self._name = name
+ self._entries = []
+ self._tags = {}
+ declare(' Created struct: %s' % name)
+
+ def AddEntry(self, entry):
+ if self._tags.has_key(entry.Tag()):
+ raise RpcGenError(
+ 'Entry "%s" duplicates tag number %d from "%s" '
+ 'around line %d' % (entry.Name(), entry.Tag(),
+ self._tags[entry.Tag()], line_count))
+ self._entries.append(entry)
+ self._tags[entry.Tag()] = entry.Name()
+ declare(' Added entry: %s' % entry.Name())
+
+ def Name(self):
+ return self._name
+
+ def EntryTagName(self, entry):
+ """Creates the name inside an enumeration for distinguishing data
+ types."""
+ name = "%s_%s" % (self._name, entry.Name())
+ return name.upper()
+
+ def PrintIndented(self, file, ident, code):
+ """Takes an array, add indentation to each entry and prints it."""
+ for entry in code:
+ print >>file, '%s%s' % (ident, entry)
+
+class StructCCode(Struct):
+ """ Knows how to generate C code for a struct """
+
+ def __init__(self, name):
+ Struct.__init__(self, name)
+
+ def PrintTags(self, file):
+ """Prints the tag definitions for a structure."""
+ print >>file, '/* Tag definition for %s */' % self._name
+ print >>file, 'enum %s_ {' % self._name.lower()
+ for entry in self._entries:
+ print >>file, ' %s=%d,' % (self.EntryTagName(entry),
+ entry.Tag())
+ print >>file, ' %s_MAX_TAGS' % (self._name.upper())
+ print >>file, '};\n'
+
+ def PrintForwardDeclaration(self, file):
+ print >>file, 'struct %s;' % self._name
+
+ def PrintDeclaration(self, file):
+ print >>file, '/* Structure declaration for %s */' % self._name
+ print >>file, 'struct %s_access_ {' % self._name
+ for entry in self._entries:
+ dcl = entry.AssignDeclaration('(*%s_assign)' % entry.Name())
+ dcl.extend(
+ entry.GetDeclaration('(*%s_get)' % entry.Name()))
+ if entry.Array():
+ dcl.extend(
+ entry.AddDeclaration('(*%s_add)' % entry.Name()))
+ self.PrintIndented(file, ' ', dcl)
+ print >>file, '};\n'
+
+ print >>file, 'struct %s {' % self._name
+ print >>file, ' struct %s_access_ *base;\n' % self._name
+ for entry in self._entries:
+ dcl = entry.Declaration()
+ self.PrintIndented(file, ' ', dcl)
+ print >>file, ''
+ for entry in self._entries:
+ print >>file, ' ev_uint8_t %s_set;' % entry.Name()
+ print >>file, '};\n'
+
+ print >>file, \
+"""struct %(name)s *%(name)s_new(void);
+struct %(name)s *%(name)s_new_with_arg(void *);
+void %(name)s_free(struct %(name)s *);
+void %(name)s_clear(struct %(name)s *);
+void %(name)s_marshal(struct evbuffer *, const struct %(name)s *);
+int %(name)s_unmarshal(struct %(name)s *, struct evbuffer *);
+int %(name)s_complete(struct %(name)s *);
+void evtag_marshal_%(name)s(struct evbuffer *, ev_uint32_t,
+ const struct %(name)s *);
+int evtag_unmarshal_%(name)s(struct evbuffer *, ev_uint32_t,
+ struct %(name)s *);""" % { 'name' : self._name }
+
+
+ # Write a setting function of every variable
+ for entry in self._entries:
+ self.PrintIndented(file, '', entry.AssignDeclaration(
+ entry.AssignFuncName()))
+ self.PrintIndented(file, '', entry.GetDeclaration(
+ entry.GetFuncName()))
+ if entry.Array():
+ self.PrintIndented(file, '', entry.AddDeclaration(
+ entry.AddFuncName()))
+
+ print >>file, '/* --- %s done --- */\n' % self._name
+
+ def PrintCode(self, file):
+ print >>file, ('/*\n'
+ ' * Implementation of %s\n'
+ ' */\n') % self._name
+
+ print >>file, \
+ 'static struct %(name)s_access_ %(name)s_base__ = {' % \
+ { 'name' : self._name }
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeBase())
+ print >>file, '};\n'
+
+ # Creation
+ print >>file, (
+ 'struct %(name)s *\n'
+ '%(name)s_new(void)\n'
+ '{\n'
+ ' return %(name)s_new_with_arg(NULL);\n'
+ '}\n'
+ '\n'
+ 'struct %(name)s *\n'
+ '%(name)s_new_with_arg(void *unused)\n'
+ '{\n'
+ ' struct %(name)s *tmp;\n'
+ ' if ((tmp = malloc(sizeof(struct %(name)s))) == NULL) {\n'
+ ' event_warn("%%s: malloc", __func__);\n'
+ ' return (NULL);\n'
+ ' }\n'
+ ' tmp->base = &%(name)s_base__;\n') % { 'name' : self._name }
+
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeInitialize('tmp'))
+ print >>file, ' tmp->%s_set = 0;\n' % entry.Name()
+
+ print >>file, (
+ ' return (tmp);\n'
+ '}\n')
+
+ # Adding
+ for entry in self._entries:
+ if entry.Array():
+ self.PrintIndented(file, '', entry.CodeAdd())
+ print >>file, ''
+
+ # Assigning
+ for entry in self._entries:
+ self.PrintIndented(file, '', entry.CodeAssign())
+ print >>file, ''
+
+ # Getting
+ for entry in self._entries:
+ self.PrintIndented(file, '', entry.CodeGet())
+ print >>file, ''
+
+ # Clearing
+ print >>file, ( 'void\n'
+ '%(name)s_clear(struct %(name)s *tmp)\n'
+ '{'
+ ) % { 'name' : self._name }
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeClear('tmp'))
+
+ print >>file, '}\n'
+
+ # Freeing
+ print >>file, ( 'void\n'
+ '%(name)s_free(struct %(name)s *tmp)\n'
+ '{'
+ ) % { 'name' : self._name }
+
+ for entry in self._entries:
+ self.PrintIndented(file, ' ', entry.CodeFree('tmp'))
+
+ print >>file, (' free(tmp);\n'
+ '}\n')
+
+ # Marshaling
+ print >>file, ('void\n'
+ '%(name)s_marshal(struct evbuffer *evbuf, '
+ 'const struct %(name)s *tmp)'
+ '{') % { 'name' : self._name }
+ for entry in self._entries:
+ indent = ' '
+ # Optional entries do not have to be set
+ if entry.Optional():
+ indent += ' '
+ print >>file, ' if (tmp->%s_set) {' % entry.Name()
+ self.PrintIndented(
+ file, indent,
+ entry.CodeMarshal('evbuf', self.EntryTagName(entry),
+ entry.GetVarName('tmp'),
+ entry.GetVarLen('tmp')))
+ if entry.Optional():
+ print >>file, ' }'
+
+ print >>file, '}\n'
+
+ # Unmarshaling
+ print >>file, ('int\n'
+ '%(name)s_unmarshal(struct %(name)s *tmp, '
+ ' struct evbuffer *evbuf)\n'
+ '{\n'
+ ' ev_uint32_t tag;\n'
+ ' while (evbuffer_get_length(evbuf) > 0) {\n'
+ ' if (evtag_peek(evbuf, &tag) == -1)\n'
+ ' return (-1);\n'
+ ' switch (tag) {\n'
+ ) % { 'name' : self._name }
+ for entry in self._entries:
+ print >>file, ' case %s:\n' % self.EntryTagName(entry)
+ if not entry.Array():
+ print >>file, (
+ ' if (tmp->%s_set)\n'
+ ' return (-1);'
+ ) % (entry.Name())
+
+ self.PrintIndented(
+ file, ' ',
+ entry.CodeUnmarshal('evbuf',
+ self.EntryTagName(entry),
+ entry.GetVarName('tmp'),
+ entry.GetVarLen('tmp')))
+
+ print >>file, ( ' tmp->%s_set = 1;\n' % entry.Name() +
+ ' break;\n' )
+ print >>file, ( ' default:\n'
+ ' return -1;\n'
+ ' }\n'
+ ' }\n' )
+ # Check if it was decoded completely
+ print >>file, ( ' if (%(name)s_complete(tmp) == -1)\n'
+ ' return (-1);'
+ ) % { 'name' : self._name }
+
+ # Successfully decoded
+ print >>file, ( ' return (0);\n'
+ '}\n')
+
+ # Checking if a structure has all the required data
+ print >>file, (
+ 'int\n'
+ '%(name)s_complete(struct %(name)s *msg)\n'
+ '{' ) % { 'name' : self._name }
+ for entry in self._entries:
+ if not entry.Optional():
+ code = [
+ 'if (!msg->%(name)s_set)',
+ ' return (-1);' ]
+ code = TranslateList(code, entry.GetTranslation())
+ self.PrintIndented(
+ file, ' ', code)
+
+ self.PrintIndented(
+ file, ' ',
+ entry.CodeComplete('msg', entry.GetVarName('msg')))
+ print >>file, (
+ ' return (0);\n'
+ '}\n' )
+
+ # Complete message unmarshaling
+ print >>file, (
+ 'int\n'
+ 'evtag_unmarshal_%(name)s(struct evbuffer *evbuf, '
+ 'ev_uint32_t need_tag, struct %(name)s *msg)\n'
+ '{\n'
+ ' ev_uint32_t tag;\n'
+ ' int res = -1;\n'
+ '\n'
+ ' struct evbuffer *tmp = evbuffer_new();\n'
+ '\n'
+ ' if (evtag_unmarshal(evbuf, &tag, tmp) == -1'
+ ' || tag != need_tag)\n'
+ ' goto error;\n'
+ '\n'
+ ' if (%(name)s_unmarshal(msg, tmp) == -1)\n'
+ ' goto error;\n'
+ '\n'
+ ' res = 0;\n'
+ '\n'
+ ' error:\n'
+ ' evbuffer_free(tmp);\n'
+ ' return (res);\n'
+ '}\n' ) % { 'name' : self._name }
+
+ # Complete message marshaling
+ print >>file, (
+ 'void\n'
+ 'evtag_marshal_%(name)s(struct evbuffer *evbuf, ev_uint32_t tag, '
+ 'const struct %(name)s *msg)\n'
+ '{\n'
+ ' struct evbuffer *buf_ = evbuffer_new();\n'
+ ' assert(buf_ != NULL);\n'
+ ' %(name)s_marshal(buf_, msg);\n'
+ ' evtag_marshal_buffer(evbuf, tag, buf_);\n '
+ ' evbuffer_free(buf_);\n'
+ '}\n' ) % { 'name' : self._name }
+
+class Entry:
+ def __init__(self, type, name, tag):
+ self._type = type
+ self._name = name
+ self._tag = int(tag)
+ self._ctype = type
+ self._optional = 0
+ self._can_be_array = 0
+ self._array = 0
+ self._line_count = -1
+ self._struct = None
+ self._refname = None
+
+ self._optpointer = True
+ self._optaddarg = True
+
+ def GetInitializer(self):
+ assert 0, "Entry does not provide initializer"
+
+ def SetStruct(self, struct):
+ self._struct = struct
+
+ def LineCount(self):
+ assert self._line_count != -1
+ return self._line_count
+
+ def SetLineCount(self, number):
+ self._line_count = number
+
+ def Array(self):
+ return self._array
+
+ def Optional(self):
+ return self._optional
+
+ def Tag(self):
+ return self._tag
+
+ def Name(self):
+ return self._name
+
+ def Type(self):
+ return self._type
+
+ def MakeArray(self, yes=1):
+ self._array = yes
+
+ def MakeOptional(self):
+ self._optional = 1
+
+ def Verify(self):
+ if self.Array() and not self._can_be_array:
+ raise RpcGenError(
+ 'Entry "%s" cannot be created as an array '
+ 'around line %d' % (self._name, self.LineCount()))
+ if not self._struct:
+ raise RpcGenError(
+ 'Entry "%s" does not know which struct it belongs to '
+ 'around line %d' % (self._name, self.LineCount()))
+ if self._optional and self._array:
+ raise RpcGenError(
+ 'Entry "%s" has illegal combination of optional and array '
+ 'around line %d' % (self._name, self.LineCount()))
+
+ def GetTranslation(self, extradict = {}):
+ mapping = {
+ "parent_name" : self._struct.Name(),
+ "name" : self._name,
+ "ctype" : self._ctype,
+ "refname" : self._refname,
+ "optpointer" : self._optpointer and "*" or "",
+ "optreference" : self._optpointer and "&" or "",
+ "optaddarg" :
+ self._optaddarg and ", const %s value" % self._ctype or ""
+ }
+ for (k, v) in extradict.items():
+ mapping[k] = v
+
+ return mapping
+
+ def GetVarName(self, var):
+ return '%(var)s->%(name)s_data' % self.GetTranslation({ 'var' : var })
+
+ def GetVarLen(self, var):
+ return 'sizeof(%s)' % self._ctype
+
+ def GetFuncName(self):
+ return '%s_%s_get' % (self._struct.Name(), self._name)
+
+ def GetDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, %s *);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def CodeGet(self):
+ code = (
+ 'int',
+ '%(parent_name)s_%(name)s_get(struct %(parent_name)s *msg, '
+ '%(ctype)s *value)',
+ '{',
+ ' if (msg->%(name)s_set != 1)',
+ ' return (-1);',
+ ' *value = msg->%(name)s_data;',
+ ' return (0);',
+ '}' )
+ code = '\n'.join(code)
+ code = code % self.GetTranslation()
+ return code.split('\n')
+
+ def AssignFuncName(self):
+ return '%s_%s_assign' % (self._struct.Name(), self._name)
+
+ def AddFuncName(self):
+ return '%s_%s_add' % (self._struct.Name(), self._name)
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, const %s);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def CodeAssign(self):
+ code = [ 'int',
+ '%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,'
+ ' const %(ctype)s value)',
+ '{',
+ ' msg->%(name)s_set = 1;',
+ ' msg->%(name)s_data = value;',
+ ' return (0);',
+ '}' ]
+ code = '\n'.join(code)
+ code = code % self.GetTranslation()
+ return code.split('\n')
+
+ def CodeClear(self, structname):
+ code = [ '%s->%s_set = 0;' % (structname, self.Name()) ]
+
+ return code
+
+ def CodeComplete(self, structname, var_name):
+ return []
+
+ def CodeFree(self, name):
+ return []
+
+ def CodeBase(self):
+ code = [
+ '%(parent_name)s_%(name)s_assign,',
+ '%(parent_name)s_%(name)s_get,'
+ ]
+ if self.Array():
+ code.append('%(parent_name)s_%(name)s_add,')
+
+ code = '\n'.join(code)
+ code = code % self.GetTranslation()
+ return code.split('\n')
+
+class EntryBytes(Entry):
+ def __init__(self, type, name, tag, length):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._length = length
+ self._ctype = 'ev_uint8_t'
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarLen(self, var):
+ return '(%s)' % self._length
+
+ def CodeArrayAdd(self, varname, value):
+ # XXX: copy here
+ return [ '%(varname)s = NULL;' % { 'varname' : varname } ]
+
+ def GetDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, %s **);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, const %s *);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def Declaration(self):
+ dcl = ['ev_uint8_t %s_data[%s];' % (self._name, self._length)]
+
+ return dcl
+
+ def CodeGet(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_get(struct %s *msg, %s **value)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_set != 1)' % name,
+ ' return (-1);',
+ ' *value = msg->%s_data;' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeAssign(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_assign(struct %s *msg, const %s *value)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' msg->%s_set = 1;' % name,
+ ' memcpy(msg->%s_data, value, %s);' % (
+ name, self._length),
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = [ 'if (evtag_unmarshal_fixed(%(buf)s, %(tag)s, '
+ '%(var)s, %(varlen)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ return TranslateList(code,
+ self.GetTranslation({
+ 'var' : var_name,
+ 'varlen' : var_len,
+ 'buf' : buf,
+ 'tag' : tag_name }))
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal(%s, %s, %s, %s);' % (
+ buf, tag_name, var_name, var_len)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ '%s->%s_set = 0;' % (structname, self.Name()),
+ 'memset(%s->%s_data, 0, sizeof(%s->%s_data));' % (
+ structname, self._name, structname, self._name)]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['memset(%s->%s_data, 0, sizeof(%s->%s_data));' % (
+ name, self._name, name, self._name)]
+ return code
+
+ def Verify(self):
+ if not self._length:
+ raise RpcGenError(
+ 'Entry "%s" needs a length '
+ 'around line %d' % (self._name, self.LineCount()))
+
+ Entry.Verify(self)
+
+class EntryInt(Entry):
+ def __init__(self, type, name, tag, bits=32):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._can_be_array = 1
+ if bits == 32:
+ self._ctype = 'ev_uint32_t'
+ self._marshal_type = 'int'
+ if bits == 64:
+ self._ctype = 'ev_uint64_t'
+ self._marshal_type = 'int64'
+
+ def GetInitializer(self):
+ return "0"
+
+ def CodeArrayFree(self, var):
+ return []
+
+ def CodeArrayAssign(self, varname, srcvar):
+ return [ '%(varname)s = %(srcvar)s;' % { 'varname' : varname,
+ 'srcvar' : srcvar } ]
+
+ def CodeArrayAdd(self, varname, value):
+ """Returns a new entry of this type."""
+ return [ '%(varname)s = %(value)s;' % { 'varname' : varname,
+ 'value' : value } ]
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = [
+ 'if (evtag_unmarshal_%(ma)s(%(buf)s, %(tag)s, &%(var)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}' ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'ma' : self._marshal_type,
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = [
+ 'evtag_marshal_%s(%s, %s, %s);' % (
+ self._marshal_type, buf, tag_name, var_name)]
+ return code
+
+ def Declaration(self):
+ dcl = ['%s %s_data;' % (self._ctype, self._name)]
+
+ return dcl
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = 0;' % (name, self._name)]
+ return code
+
+class EntryString(Entry):
+ def __init__(self, type, name, tag):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._can_be_array = 1
+ self._ctype = 'char *'
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def CodeArrayFree(self, varname):
+ code = [
+ 'if (%(var)s != NULL) free(%(var)s);' ]
+
+ return TranslateList(code, { 'var' : varname })
+
+ def CodeArrayAssign(self, varname, srcvar):
+ code = [
+ 'if (%(var)s != NULL)',
+ ' free(%(var)s);',
+ '%(var)s = strdup(%(srcvar)s);',
+ 'if (%(var)s == NULL) {',
+ ' event_warnx("%%s: strdup", __func__);',
+ ' return (-1);',
+ '}' ]
+
+ return TranslateList(code, { 'var' : varname,
+ 'srcvar' : srcvar })
+
+ def CodeArrayAdd(self, varname, value):
+ code = [
+ 'if (%(value)s != NULL) {',
+ ' %(var)s = strdup(%(value)s);',
+ ' if (%(var)s == NULL) {',
+ ' goto error;',
+ ' }',
+ '} else {',
+ ' %(var)s = NULL;',
+ '}' ]
+
+ return TranslateList(code, { 'var' : varname,
+ 'value' : value })
+
+ def GetVarLen(self, var):
+ return 'strlen(%s)' % self.GetVarName(var)
+
+ def CodeMakeInitalize(self, varname):
+ return '%(varname)s = NULL;' % { 'varname' : varname }
+
+ def CodeAssign(self):
+ name = self._name
+ code = """int
+%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,
+ const %(ctype)s value)
+{
+ if (msg->%(name)s_data != NULL)
+ free(msg->%(name)s_data);
+ if ((msg->%(name)s_data = strdup(value)) == NULL)
+ return (-1);
+ msg->%(name)s_set = 1;
+ return (0);
+}""" % self.GetTranslation()
+
+ return code.split('\n')
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = ['if (evtag_unmarshal_string(%(buf)s, %(tag)s, &%(var)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal_string(%s, %s, %s);' % (
+ buf, tag_name, var_name)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ 'if (%s->%s_set == 1) {' % (structname, self.Name()),
+ ' free(%s->%s_data);' % (structname, self.Name()),
+ ' %s->%s_data = NULL;' % (structname, self.Name()),
+ ' %s->%s_set = 0;' % (structname, self.Name()),
+ '}'
+ ]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name)]
+ return code
+
+ def CodeFree(self, name):
+ code = ['if (%s->%s_data != NULL)' % (name, self._name),
+ ' free (%s->%s_data);' % (name, self._name)]
+
+ return code
+
+ def Declaration(self):
+ dcl = ['char *%s_data;' % self._name]
+
+ return dcl
+
+class EntryStruct(Entry):
+ def __init__(self, type, name, tag, refname):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._optpointer = False
+ self._can_be_array = 1
+ self._refname = refname
+ self._ctype = 'struct %s*' % refname
+ self._optaddarg = False
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarLen(self, var):
+ return '-1'
+
+ def CodeArrayAdd(self, varname, value):
+ code = [
+ '%(varname)s = %(refname)s_new();',
+ 'if (%(varname)s == NULL)',
+ ' goto error;' ]
+
+ return TranslateList(code, self.GetTranslation({ 'varname' : varname }))
+
+ def CodeArrayFree(self, var):
+ code = [ '%(refname)s_free(%(var)s);' % self.GetTranslation(
+ { 'var' : var }) ]
+ return code
+
+ def CodeArrayAssign(self, var, srcvar):
+ code = [
+ 'int had_error = 0;',
+ 'struct evbuffer *tmp = NULL;',
+ '%(refname)s_clear(%(var)s);',
+ 'if ((tmp = evbuffer_new()) == NULL) {',
+ ' event_warn("%%s: evbuffer_new()", __func__);',
+ ' had_error = 1;',
+ ' goto done;',
+ '}',
+ '%(refname)s_marshal(tmp, %(srcvar)s);',
+ 'if (%(refname)s_unmarshal(%(var)s, tmp) == -1) {',
+ ' event_warnx("%%s: %(refname)s_unmarshal", __func__);',
+ ' had_error = 1;',
+ ' goto done;',
+ '}',
+ 'done:'
+ 'if (tmp != NULL)',
+ ' evbuffer_free(tmp);',
+ 'if (had_error) {',
+ ' %(refname)s_clear(%(var)s);',
+ ' return (-1);',
+ '}' ]
+
+ return TranslateList(code, self.GetTranslation({
+ 'var' : var,
+ 'srcvar' : srcvar}))
+
+ def CodeGet(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_get(struct %s *msg, %s *value)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_set != 1) {' % name,
+ ' msg->%s_data = %s_new();' % (name, self._refname),
+ ' if (msg->%s_data == NULL)' % name,
+ ' return (-1);',
+ ' msg->%s_set = 1;' % name,
+ ' }',
+ ' *value = msg->%s_data;' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeAssign(self):
+ name = self._name
+ code = """int
+%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,
+ const %(ctype)s value)
+{
+ struct evbuffer *tmp = NULL;
+ if (msg->%(name)s_set) {
+ %(refname)s_clear(msg->%(name)s_data);
+ msg->%(name)s_set = 0;
+ } else {
+ msg->%(name)s_data = %(refname)s_new();
+ if (msg->%(name)s_data == NULL) {
+ event_warn("%%s: %(refname)s_new()", __func__);
+ goto error;
+ }
+ }
+ if ((tmp = evbuffer_new()) == NULL) {
+ event_warn("%%s: evbuffer_new()", __func__);
+ goto error;
+ }
+ %(refname)s_marshal(tmp, value);
+ if (%(refname)s_unmarshal(msg->%(name)s_data, tmp) == -1) {
+ event_warnx("%%s: %(refname)s_unmarshal", __func__);
+ goto error;
+ }
+ msg->%(name)s_set = 1;
+ evbuffer_free(tmp);
+ return (0);
+ error:
+ if (tmp != NULL)
+ evbuffer_free(tmp);
+ if (msg->%(name)s_data != NULL) {
+ %(refname)s_free(msg->%(name)s_data);
+ msg->%(name)s_data = NULL;
+ }
+ return (-1);
+}""" % self.GetTranslation()
+ return code.split('\n')
+
+ def CodeComplete(self, structname, var_name):
+ code = [ 'if (%(structname)s->%(name)s_set && '
+ '%(refname)s_complete(%(var)s) == -1)',
+ ' return (-1);' ]
+
+ return TranslateList(code, self.GetTranslation({
+ 'structname' : structname,
+ 'var' : var_name }))
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = ['%(var)s = %(refname)s_new();',
+ 'if (%(var)s == NULL)',
+ ' return (-1);',
+ 'if (evtag_unmarshal_%(refname)s(%(buf)s, %(tag)s, '
+ '%(var)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal_%s(%s, %s, %s);' % (
+ self._refname, buf, tag_name, var_name)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ 'if (%s->%s_set == 1) {' % (structname, self.Name()),
+ ' %s_free(%s->%s_data);' % (
+ self._refname, structname, self.Name()),
+ ' %s->%s_data = NULL;' % (structname, self.Name()),
+ ' %s->%s_set = 0;' % (structname, self.Name()),
+ '}'
+ ]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name)]
+ return code
+
+ def CodeFree(self, name):
+ code = ['if (%s->%s_data != NULL)' % (name, self._name),
+ ' %s_free(%s->%s_data);' % (
+ self._refname, name, self._name)]
+
+ return code
+
+ def Declaration(self):
+ dcl = ['%s %s_data;' % (self._ctype, self._name)]
+
+ return dcl
+
+class EntryVarBytes(Entry):
+ def __init__(self, type, name, tag):
+ # Init base class
+ Entry.__init__(self, type, name, tag)
+
+ self._ctype = 'ev_uint8_t *'
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarLen(self, var):
+ return '%(var)s->%(name)s_length' % self.GetTranslation({ 'var' : var })
+
+ def CodeArrayAdd(self, varname, value):
+ # xxx: copy
+ return [ '%(varname)s = NULL;' % { 'varname' : varname } ]
+
+ def GetDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, %s *, ev_uint32_t *);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, const %s, ev_uint32_t);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def CodeAssign(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_assign(struct %s *msg, '
+ 'const %s value, ev_uint32_t len)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_data != NULL)' % name,
+ ' free (msg->%s_data);' % name,
+ ' msg->%s_data = malloc(len);' % name,
+ ' if (msg->%s_data == NULL)' % name,
+ ' return (-1);',
+ ' msg->%s_set = 1;' % name,
+ ' msg->%s_length = len;' % name,
+ ' memcpy(msg->%s_data, value, len);' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeGet(self):
+ name = self._name
+ code = [ 'int',
+ '%s_%s_get(struct %s *msg, %s *value, ev_uint32_t *plen)' % (
+ self._struct.Name(), name,
+ self._struct.Name(), self._ctype),
+ '{',
+ ' if (msg->%s_set != 1)' % name,
+ ' return (-1);',
+ ' *value = msg->%s_data;' % name,
+ ' *plen = msg->%s_length;' % name,
+ ' return (0);',
+ '}' ]
+ return code
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ code = ['if (evtag_payload_length(%(buf)s, &%(varlen)s) == -1)',
+ ' return (-1);',
+ # We do not want DoS opportunities
+ 'if (%(varlen)s > evbuffer_get_length(%(buf)s))',
+ ' return (-1);',
+ 'if ((%(var)s = malloc(%(varlen)s)) == NULL)',
+ ' return (-1);',
+ 'if (evtag_unmarshal_fixed(%(buf)s, %(tag)s, %(var)s, '
+ '%(varlen)s) == -1) {',
+ ' event_warnx("%%s: failed to unmarshal %(name)s", __func__);',
+ ' return (-1);',
+ '}'
+ ]
+ code = '\n'.join(code) % self.GetTranslation({
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'var' : var_name,
+ 'varlen' : var_len })
+ return code.split('\n')
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['evtag_marshal(%s, %s, %s, %s);' % (
+ buf, tag_name, var_name, var_len)]
+ return code
+
+ def CodeClear(self, structname):
+ code = [ 'if (%s->%s_set == 1) {' % (structname, self.Name()),
+ ' free (%s->%s_data);' % (structname, self.Name()),
+ ' %s->%s_data = NULL;' % (structname, self.Name()),
+ ' %s->%s_length = 0;' % (structname, self.Name()),
+ ' %s->%s_set = 0;' % (structname, self.Name()),
+ '}'
+ ]
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name),
+ '%s->%s_length = 0;' % (name, self._name) ]
+ return code
+
+ def CodeFree(self, name):
+ code = ['if (%s->%s_data != NULL)' % (name, self._name),
+ ' free(%s->%s_data);' % (name, self._name)]
+
+ return code
+
+ def Declaration(self):
+ dcl = ['ev_uint8_t *%s_data;' % self._name,
+ 'ev_uint32_t %s_length;' % self._name]
+
+ return dcl
+
+class EntryArray(Entry):
+ def __init__(self, entry):
+ # Init base class
+ Entry.__init__(self, entry._type, entry._name, entry._tag)
+
+ self._entry = entry
+ self._refname = entry._refname
+ self._ctype = self._entry._ctype
+ self._optional = True
+ self._optpointer = self._entry._optpointer
+ self._optaddarg = self._entry._optaddarg
+
+ # provide a new function for accessing the variable name
+ def GetVarName(var_name):
+ return '%(var)s->%(name)s_data[%(index)s]' % \
+ self._entry.GetTranslation({'var' : var_name,
+ 'index' : self._index})
+ self._entry.GetVarName = GetVarName
+
+ def GetInitializer(self):
+ return "NULL"
+
+ def GetVarName(self, var_name):
+ return var_name
+
+ def GetVarLen(self, var_name):
+ return '-1'
+
+ def GetDeclaration(self, funcname):
+ """Allows direct access to elements of the array."""
+ code = [
+ 'int %(funcname)s(struct %(parent_name)s *, int, %(ctype)s *);' %
+ self.GetTranslation({ 'funcname' : funcname }) ]
+ return code
+
+ def AssignDeclaration(self, funcname):
+ code = [ 'int %s(struct %s *, int, const %s);' % (
+ funcname, self._struct.Name(), self._ctype ) ]
+ return code
+
+ def AddDeclaration(self, funcname):
+ code = [
+ '%(ctype)s %(optpointer)s '
+ '%(funcname)s(struct %(parent_name)s *msg%(optaddarg)s);' % \
+ self.GetTranslation({ 'funcname' : funcname }) ]
+ return code
+
+ def CodeGet(self):
+ code = """int
+%(parent_name)s_%(name)s_get(struct %(parent_name)s *msg, int offset,
+ %(ctype)s *value)
+{
+ if (!msg->%(name)s_set || offset < 0 || offset >= msg->%(name)s_length)
+ return (-1);
+ *value = msg->%(name)s_data[offset];
+ return (0);
+}""" % self.GetTranslation()
+
+ return code.split('\n')
+
+ def CodeAssign(self):
+ code = [
+ 'int',
+ '%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg, int off,',
+ ' const %(ctype)s value)',
+ '{',
+ ' if (!msg->%(name)s_set || off < 0 || off >= msg->%(name)s_length)',
+ ' return (-1);\n',
+ ' {' ]
+ code = TranslateList(code, self.GetTranslation())
+
+ codearrayassign = self._entry.CodeArrayAssign(
+ 'msg->%(name)s_data[off]' % self.GetTranslation(), 'value')
+ code += map(lambda x: ' ' + x, codearrayassign)
+
+ code += TranslateList([
+ ' }',
+ ' return (0);',
+ '}' ], self.GetTranslation())
+
+ return code
+
+ def CodeAdd(self):
+ codearrayadd = self._entry.CodeArrayAdd(
+ 'msg->%(name)s_data[msg->%(name)s_length - 1]' % self.GetTranslation(),
+ 'value')
+ code = [
+ 'static int',
+ '%(parent_name)s_%(name)s_expand_to_hold_more('
+ 'struct %(parent_name)s *msg)',
+ '{',
+ ' int tobe_allocated = msg->%(name)s_num_allocated;',
+ ' %(ctype)s* new_data = NULL;',
+ ' tobe_allocated = !tobe_allocated ? 1 : tobe_allocated << 1;',
+ ' new_data = (%(ctype)s*) realloc(msg->%(name)s_data,',
+ ' tobe_allocated * sizeof(%(ctype)s));',
+ ' if (new_data == NULL)',
+ ' return -1;',
+ ' msg->%(name)s_data = new_data;',
+ ' msg->%(name)s_num_allocated = tobe_allocated;',
+ ' return 0;'
+ '}',
+ '',
+ '%(ctype)s %(optpointer)s',
+ '%(parent_name)s_%(name)s_add('
+ 'struct %(parent_name)s *msg%(optaddarg)s)',
+ '{',
+ ' if (++msg->%(name)s_length >= msg->%(name)s_num_allocated) {',
+ ' if (%(parent_name)s_%(name)s_expand_to_hold_more(msg)<0)',
+ ' goto error;',
+ ' }' ]
+
+ code = TranslateList(code, self.GetTranslation())
+
+ code += map(lambda x: ' ' + x, codearrayadd)
+
+ code += TranslateList([
+ ' msg->%(name)s_set = 1;',
+ ' return %(optreference)s(msg->%(name)s_data['
+ 'msg->%(name)s_length - 1]);',
+ 'error:',
+ ' --msg->%(name)s_length;',
+ ' return (NULL);',
+ '}' ], self.GetTranslation())
+
+ return code
+
+ def CodeComplete(self, structname, var_name):
+ self._index = 'i'
+ tmp = self._entry.CodeComplete(structname, self._entry.GetVarName(var_name))
+ # skip the whole loop if there is nothing to check
+ if not tmp:
+ return []
+
+ translate = self.GetTranslation({ 'structname' : structname })
+ code = [
+ '{',
+ ' int i;',
+ ' for (i = 0; i < %(structname)s->%(name)s_length; ++i) {' ]
+
+ code = TranslateList(code, translate)
+
+ code += map(lambda x: ' ' + x, tmp)
+
+ code += [
+ ' }',
+ '}' ]
+
+ return code
+
+ def CodeUnmarshal(self, buf, tag_name, var_name, var_len):
+ translate = self.GetTranslation({ 'var' : var_name,
+ 'buf' : buf,
+ 'tag' : tag_name,
+ 'init' : self._entry.GetInitializer()})
+ code = [
+ 'if (%(var)s->%(name)s_length >= %(var)s->%(name)s_num_allocated &&',
+ ' %(parent_name)s_%(name)s_expand_to_hold_more(%(var)s) < 0) {',
+ ' puts("HEY NOW");',
+ ' return (-1);',
+ '}']
+
+ # the unmarshal code directly returns
+ code = TranslateList(code, translate)
+
+ self._index = '%(var)s->%(name)s_length' % translate
+ code += self._entry.CodeUnmarshal(buf, tag_name,
+ self._entry.GetVarName(var_name),
+ self._entry.GetVarLen(var_name))
+
+ code += [ '++%(var)s->%(name)s_length;' % translate ]
+
+ return code
+
+ def CodeMarshal(self, buf, tag_name, var_name, var_len):
+ code = ['{',
+ ' int i;',
+ ' for (i = 0; i < %(var)s->%(name)s_length; ++i) {' ]
+
+ self._index = 'i'
+ code += self._entry.CodeMarshal(buf, tag_name,
+ self._entry.GetVarName(var_name),
+ self._entry.GetVarLen(var_name))
+ code += [' }',
+ '}'
+ ]
+
+ code = "\n".join(code) % self.GetTranslation({ 'var' : var_name })
+
+ return code.split('\n')
+
+ def CodeClear(self, structname):
+ translate = self.GetTranslation({ 'structname' : structname })
+ codearrayfree = self._entry.CodeArrayFree(
+ '%(structname)s->%(name)s_data[i]' % self.GetTranslation(
+ { 'structname' : structname } ))
+
+ code = [ 'if (%(structname)s->%(name)s_set == 1) {' ]
+
+ if codearrayfree:
+ code += [
+ ' int i;',
+ ' for (i = 0; i < %(structname)s->%(name)s_length; ++i) {' ]
+
+ code = TranslateList(code, translate)
+
+ if codearrayfree:
+ code += map(lambda x: ' ' + x, codearrayfree)
+ code += [
+ ' }' ]
+
+ code += TranslateList([
+ ' free(%(structname)s->%(name)s_data);',
+ ' %(structname)s->%(name)s_data = NULL;',
+ ' %(structname)s->%(name)s_set = 0;',
+ ' %(structname)s->%(name)s_length = 0;',
+ ' %(structname)s->%(name)s_num_allocated = 0;',
+ '}'
+ ], translate)
+
+ return code
+
+ def CodeInitialize(self, name):
+ code = ['%s->%s_data = NULL;' % (name, self._name),
+ '%s->%s_length = 0;' % (name, self._name),
+ '%s->%s_num_allocated = 0;' % (name, self._name)]
+ return code
+
+ def CodeFree(self, structname):
+ code = self.CodeClear(structname);
+
+ code += TranslateList([
+ 'free(%(structname)s->%(name)s_data);' ],
+ self.GetTranslation({'structname' : structname }))
+
+ return code
+
+ def Declaration(self):
+ dcl = ['%s *%s_data;' % (self._ctype, self._name),
+ 'int %s_length;' % self._name,
+ 'int %s_num_allocated;' % self._name ]
+
+ return dcl
+
+def NormalizeLine(line):
+ global white
+ global cppcomment
+
+ line = cppcomment.sub('', line)
+ line = line.strip()
+ line = white.sub(' ', line)
+
+ return line
+
+def ProcessOneEntry(factory, newstruct, entry):
+ optional = 0
+ array = 0
+ entry_type = ''
+ name = ''
+ tag = ''
+ tag_set = None
+ separator = ''
+ fixed_length = ''
+
+ tokens = entry.split(' ')
+ while tokens:
+ token = tokens[0]
+ tokens = tokens[1:]
+
+ if not entry_type:
+ if not optional and token == 'optional':
+ optional = 1
+ continue
+
+ if not array and token == 'array':
+ array = 1
+ continue
+
+ if not entry_type:
+ entry_type = token
+ continue
+
+ if not name:
+ res = re.match(r'^([^\[\]]+)(\[.*\])?$', token)
+ if not res:
+ raise RpcGenError(
+ 'Cannot parse name: \"%s\" '
+ 'around line %d' % (entry, line_count))
+ name = res.group(1)
+ fixed_length = res.group(2)
+ if fixed_length:
+ fixed_length = fixed_length[1:-1]
+ continue
+
+ if not separator:
+ separator = token
+ if separator != '=':
+ raise RpcGenError('Expected "=" after name \"%s\" got %s'
+ % (name, token))
+ continue
+
+ if not tag_set:
+ tag_set = 1
+ if not re.match(r'^(0x)?[0-9]+$', token):
+ raise RpcGenError('Expected tag number: \"%s\"' % entry)
+ tag = int(token, 0)
+ continue
+
+ raise RpcGenError('Cannot parse \"%s\"' % entry)
+
+ if not tag_set:
+ raise RpcGenError('Need tag number: \"%s\"' % entry)
+
+ # Create the right entry
+ if entry_type == 'bytes':
+ if fixed_length:
+ newentry = factory.EntryBytes(entry_type, name, tag, fixed_length)
+ else:
+ newentry = factory.EntryVarBytes(entry_type, name, tag)
+ elif entry_type == 'int' and not fixed_length:
+ newentry = factory.EntryInt(entry_type, name, tag)
+ elif entry_type == 'int64' and not fixed_length:
+ newentry = factory.EntryInt(entry_type, name, tag, bits=64)
+ elif entry_type == 'string' and not fixed_length:
+ newentry = factory.EntryString(entry_type, name, tag)
+ else:
+ res = structref.match(entry_type)
+ if res:
+ # References another struct defined in our file
+ newentry = factory.EntryStruct(entry_type, name, tag, res.group(1))
+ else:
+ raise RpcGenError('Bad type: "%s" in "%s"' % (entry_type, entry))
+
+ structs = []
+
+ if optional:
+ newentry.MakeOptional()
+ if array:
+ newentry.MakeArray()
+
+ newentry.SetStruct(newstruct)
+ newentry.SetLineCount(line_count)
+ newentry.Verify()
+
+ if array:
+ # We need to encapsulate this entry into a struct
+ newname = newentry.Name()+ '_array'
+
+ # Now borgify the new entry.
+ newentry = factory.EntryArray(newentry)
+ newentry.SetStruct(newstruct)
+ newentry.SetLineCount(line_count)
+ newentry.MakeArray()
+
+ newstruct.AddEntry(newentry)
+
+ return structs
+
+def ProcessStruct(factory, data):
+ tokens = data.split(' ')
+
+ # First three tokens are: 'struct' 'name' '{'
+ newstruct = factory.Struct(tokens[1])
+
+ inside = ' '.join(tokens[3:-1])
+
+ tokens = inside.split(';')
+
+ structs = []
+
+ for entry in tokens:
+ entry = NormalizeLine(entry)
+ if not entry:
+ continue
+
+ # It's possible that new structs get defined in here
+ structs.extend(ProcessOneEntry(factory, newstruct, entry))
+
+ structs.append(newstruct)
+ return structs
+
+def GetNextStruct(file):
+ global line_count
+ global cppdirect
+
+ got_struct = 0
+
+ processed_lines = []
+
+ have_c_comment = 0
+ data = ''
+ while 1:
+ line = file.readline()
+ if not line:
+ break
+
+ line_count += 1
+ line = line[:-1]
+
+ if not have_c_comment and re.search(r'/\*', line):
+ if re.search(r'/\*.*?\*/', line):
+ line = re.sub(r'/\*.*?\*/', '', line)
+ else:
+ line = re.sub(r'/\*.*$', '', line)
+ have_c_comment = 1
+
+ if have_c_comment:
+ if not re.search(r'\*/', line):
+ continue
+ have_c_comment = 0
+ line = re.sub(r'^.*\*/', '', line)
+
+ line = NormalizeLine(line)
+
+ if not line:
+ continue
+
+ if not got_struct:
+ if re.match(r'#include ["<].*[>"]', line):
+ cppdirect.append(line)
+ continue
+
+ if re.match(r'^#(if( |def)|endif)', line):
+ cppdirect.append(line)
+ continue
+
+ if re.match(r'^#define', line):
+ headerdirect.append(line)
+ continue
+
+ if not structdef.match(line):
+ raise RpcGenError('Missing struct on line %d: %s'
+ % (line_count, line))
+ else:
+ got_struct = 1
+ data += line
+ continue
+
+ # We are inside the struct
+ tokens = line.split('}')
+ if len(tokens) == 1:
+ data += ' ' + line
+ continue
+
+ if len(tokens[1]):
+ raise RpcGenError('Trailing garbage after struct on line %d'
+ % line_count)
+
+ # We found the end of the struct
+ data += ' %s}' % tokens[0]
+ break
+
+ # Remove any comments, that might be in there
+ data = re.sub(r'/\*.*\*/', '', data)
+
+ return data
+
+
+def Parse(factory, file):
+ """
+ Parses the input file and returns C code and corresponding header file.
+ """
+
+ entities = []
+
+ while 1:
+ # Just gets the whole struct nicely formatted
+ data = GetNextStruct(file)
+
+ if not data:
+ break
+
+ entities.extend(ProcessStruct(factory, data))
+
+ return entities
+
+class CCodeGenerator:
+ def __init__(self):
+ pass
+
+ def GuardName(self, name):
+ # Use the complete provided path to the input file, with all
+ # non-identifier characters replaced with underscores, to
+ # reduce the chance of a collision between guard macros.
+ return 'EVENT_RPCOUT_' + nonident.sub('_', name).upper() + '_'
+
+ def HeaderPreamble(self, name):
+ guard = self.GuardName(name)
+ pre = (
+ '/*\n'
+ ' * Automatically generated from %s\n'
+ ' */\n\n'
+ '#ifndef %s\n'
+ '#define %s\n\n' ) % (
+ name, guard, guard)
+
+ for statement in headerdirect:
+ pre += '%s\n' % statement
+ if headerdirect:
+ pre += '\n'
+
+ pre += (
+ '#include <event2/util.h> /* for ev_uint*_t */\n'
+ '#include <event2/rpc.h>\n'
+ )
+
+ return pre
+
+ def HeaderPostamble(self, name):
+ guard = self.GuardName(name)
+ return '#endif /* %s */' % guard
+
+ def BodyPreamble(self, name, header_file):
+ global _NAME
+ global _VERSION
+
+ slash = header_file.rfind('/')
+ if slash != -1:
+ header_file = header_file[slash+1:]
+
+ pre = ( '/*\n'
+ ' * Automatically generated from %s\n'
+ ' * by %s/%s. DO NOT EDIT THIS FILE.\n'
+ ' */\n\n' ) % (name, _NAME, _VERSION)
+ pre += ( '#include <stdlib.h>\n'
+ '#include <string.h>\n'
+ '#include <assert.h>\n'
+ '#include <event2/event-config.h>\n'
+ '#include <event2/event.h>\n'
+ '#include <event2/buffer.h>\n'
+ '#include <event2/tag.h>\n\n'
+ '#ifdef EVENT____func__\n'
+ '#define __func__ EVENT____func__\n'
+ '#endif\n\n'
+ )
+
+ for statement in cppdirect:
+ pre += '%s\n' % statement
+
+ pre += '\n#include "%s"\n\n' % header_file
+
+ pre += 'void event_warn(const char *fmt, ...);\n'
+ pre += 'void event_warnx(const char *fmt, ...);\n\n'
+
+ return pre
+
+ def HeaderFilename(self, filename):
+ return '.'.join(filename.split('.')[:-1]) + '.h'
+
+ def CodeFilename(self, filename):
+ return '.'.join(filename.split('.')[:-1]) + '.gen.c'
+
+ def Struct(self, name):
+ return StructCCode(name)
+
+ def EntryBytes(self, entry_type, name, tag, fixed_length):
+ return EntryBytes(entry_type, name, tag, fixed_length)
+
+ def EntryVarBytes(self, entry_type, name, tag):
+ return EntryVarBytes(entry_type, name, tag)
+
+ def EntryInt(self, entry_type, name, tag, bits=32):
+ return EntryInt(entry_type, name, tag, bits)
+
+ def EntryString(self, entry_type, name, tag):
+ return EntryString(entry_type, name, tag)
+
+ def EntryStruct(self, entry_type, name, tag, struct_name):
+ return EntryStruct(entry_type, name, tag, struct_name)
+
+ def EntryArray(self, entry):
+ return EntryArray(entry)
+
+class Usage(RpcGenError):
+ def __init__(self, argv0):
+ RpcGenError.__init__("usage: %s input.rpc [[output.h] output.c]"
+ % argv0)
+
+class CommandLine:
+ def __init__(self, argv):
+ """Initialize a command-line to launch event_rpcgen, as if
+ from a command-line with CommandLine(sys.argv). If you're
+ calling this directly, remember to provide a dummy value
+ for sys.argv[0]
+ """
+ self.filename = None
+ self.header_file = None
+ self.impl_file = None
+ self.factory = CCodeGenerator()
+
+ if len(argv) >= 2 and argv[1] == '--quiet':
+ global QUIETLY
+ QUIETLY = 1
+ del argv[1]
+
+ if len(argv) < 2 or len(argv) > 4:
+ raise Usage(argv[0])
+
+ self.filename = argv[1].replace('\\', '/')
+ if len(argv) == 3:
+ self.impl_file = argv[2].replace('\\', '/')
+ if len(argv) == 4:
+ self.header_file = argv[2].replace('\\', '/')
+ self.impl_file = argv[3].replace('\\', '/')
+
+ if not self.filename:
+ raise Usage(argv[0])
+
+ if not self.impl_file:
+ self.impl_file = self.factory.CodeFilename(self.filename)
+
+ if not self.header_file:
+ self.header_file = self.factory.HeaderFilename(self.impl_file)
+
+ if not self.impl_file.endswith('.c'):
+ raise RpcGenError("can only generate C implementation files")
+ if not self.header_file.endswith('.h'):
+ raise RpcGenError("can only generate C header files")
+
+ def run(self):
+ filename = self.filename
+ header_file = self.header_file
+ impl_file = self.impl_file
+ factory = self.factory
+
+ declare('Reading \"%s\"' % filename)
+
+ fp = open(filename, 'r')
+ entities = Parse(factory, fp)
+ fp.close()
+
+ declare('... creating "%s"' % header_file)
+ header_fp = open(header_file, 'w')
+ print >>header_fp, factory.HeaderPreamble(filename)
+
+ # Create forward declarations: allows other structs to reference
+ # each other
+ for entry in entities:
+ entry.PrintForwardDeclaration(header_fp)
+ print >>header_fp, ''
+
+ for entry in entities:
+ entry.PrintTags(header_fp)
+ entry.PrintDeclaration(header_fp)
+ print >>header_fp, factory.HeaderPostamble(filename)
+ header_fp.close()
+
+ declare('... creating "%s"' % impl_file)
+ impl_fp = open(impl_file, 'w')
+ print >>impl_fp, factory.BodyPreamble(filename, header_file)
+ for entry in entities:
+ entry.PrintCode(impl_fp)
+ impl_fp.close()
+
+if __name__ == '__main__':
+ try:
+ CommandLine(sys.argv).run()
+ sys.exit(0)
+
+ except RpcGenError, e:
+ print >>sys.stderr, e
+ sys.exit(1)
+
+ except EnvironmentError, e:
+ if e.filename and e.strerror:
+ print >>sys.stderr, "%s: %s" % (e.filename, e.strerror)
+ sys.exit(1)
+ elif e.strerror:
+ print >> sys.stderr, e.strerror
+ sys.exit(1)
+ else:
+ raise
diff --git a/sntp/libevent/event_tagging.c b/sntp/libevent/event_tagging.c
new file mode 100644
index 0000000..7edd3da
--- /dev/null
+++ b/sntp/libevent/event_tagging.c
@@ -0,0 +1,591 @@
+/*
+ * Copyright (c) 2003-2009 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#else
+#include <sys/ioctl.h>
+#endif
+
+#include <sys/queue.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef _WIN32
+#include <syslog.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <limits.h>
+
+#include "event2/event.h"
+#include "event2/tag.h"
+#include "event2/buffer.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+
+/*
+ Here's our wire format:
+
+ Stream = TaggedData*
+
+ TaggedData = Tag Length Data
+ where the integer value of 'Length' is the length of 'data'.
+
+ Tag = HByte* LByte
+ where HByte is a byte with the high bit set, and LByte is a byte
+ with the high bit clear. The integer value of the tag is taken
+ by concatenating the lower 7 bits from all the tags. So for example,
+ the tag 0x66 is encoded as [66], whereas the tag 0x166 is encoded as
+ [82 66]
+
+ Length = Integer
+
+ Integer = NNibbles Nibble* Padding?
+ where NNibbles is a 4-bit value encoding the number of nibbles-1,
+ and each Nibble is 4 bits worth of encoded integer, in big-endian
+ order. If the total encoded integer size is an odd number of nibbles,
+ a final padding nibble with value 0 is appended.
+*/
+
+int evtag_decode_int(ev_uint32_t *pnumber, struct evbuffer *evbuf);
+int evtag_decode_int64(ev_uint64_t *pnumber, struct evbuffer *evbuf);
+int evtag_encode_tag(struct evbuffer *evbuf, ev_uint32_t tag);
+int evtag_decode_tag(ev_uint32_t *ptag, struct evbuffer *evbuf);
+
+void
+evtag_init(void)
+{
+}
+
+/*
+ * We encode integers by nibbles; the first nibble contains the number
+ * of significant nibbles - 1; this allows us to encode up to 64-bit
+ * integers. This function is byte-order independent.
+ *
+ * @param number a 32-bit unsigned integer to encode
+ * @param data a pointer to where the data should be written. Must
+ * have at least 5 bytes free.
+ * @return the number of bytes written into data.
+ */
+
+#define ENCODE_INT_INTERNAL(data, number) do { \
+ int off = 1, nibbles = 0; \
+ \
+ memset(data, 0, sizeof(number)+1); \
+ while (number) { \
+ if (off & 0x1) \
+ data[off/2] = (data[off/2] & 0xf0) | (number & 0x0f); \
+ else \
+ data[off/2] = (data[off/2] & 0x0f) | \
+ ((number & 0x0f) << 4); \
+ number >>= 4; \
+ off++; \
+ } \
+ \
+ if (off > 2) \
+ nibbles = off - 2; \
+ \
+ /* Off - 1 is the number of encoded nibbles */ \
+ data[0] = (data[0] & 0x0f) | ((nibbles & 0x0f) << 4); \
+ \
+ return ((off + 1) / 2); \
+} while (0)
+
+static inline int
+encode_int_internal(ev_uint8_t *data, ev_uint32_t number)
+{
+ ENCODE_INT_INTERNAL(data, number);
+}
+
+static inline int
+encode_int64_internal(ev_uint8_t *data, ev_uint64_t number)
+{
+ ENCODE_INT_INTERNAL(data, number);
+}
+
+void
+evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number)
+{
+ ev_uint8_t data[5];
+ int len = encode_int_internal(data, number);
+ evbuffer_add(evbuf, data, len);
+}
+
+void
+evtag_encode_int64(struct evbuffer *evbuf, ev_uint64_t number)
+{
+ ev_uint8_t data[9];
+ int len = encode_int64_internal(data, number);
+ evbuffer_add(evbuf, data, len);
+}
+
+/*
+ * Support variable length encoding of tags; we use the high bit in each
+ * octet as a continuation signal.
+ */
+
+int
+evtag_encode_tag(struct evbuffer *evbuf, ev_uint32_t tag)
+{
+ int bytes = 0;
+ ev_uint8_t data[5];
+
+ memset(data, 0, sizeof(data));
+ do {
+ ev_uint8_t lower = tag & 0x7f;
+ tag >>= 7;
+
+ if (tag)
+ lower |= 0x80;
+
+ data[bytes++] = lower;
+ } while (tag);
+
+ if (evbuf != NULL)
+ evbuffer_add(evbuf, data, bytes);
+
+ return (bytes);
+}
+
+static int
+decode_tag_internal(ev_uint32_t *ptag, struct evbuffer *evbuf, int dodrain)
+{
+ ev_uint32_t number = 0;
+ size_t len = evbuffer_get_length(evbuf);
+ ev_uint8_t *data;
+ size_t count = 0;
+ int shift = 0, done = 0;
+
+ /*
+ * the encoding of a number is at most one byte more than its
+ * storage size. however, it may also be much smaller.
+ */
+ data = evbuffer_pullup(
+ evbuf, len < sizeof(number) + 1 ? len : sizeof(number) + 1);
+
+ while (count++ < len) {
+ ev_uint8_t lower = *data++;
+ number |= (lower & 0x7f) << shift;
+ shift += 7;
+
+ if (!(lower & 0x80)) {
+ done = 1;
+ break;
+ }
+ }
+
+ if (!done)
+ return (-1);
+
+ if (dodrain)
+ evbuffer_drain(evbuf, count);
+
+ if (ptag != NULL)
+ *ptag = number;
+
+ return count > INT_MAX ? INT_MAX : (int)(count);
+}
+
+int
+evtag_decode_tag(ev_uint32_t *ptag, struct evbuffer *evbuf)
+{
+ return (decode_tag_internal(ptag, evbuf, 1 /* dodrain */));
+}
+
+/*
+ * Marshal a data type, the general format is as follows:
+ *
+ * tag number: one byte; length: var bytes; payload: var bytes
+ */
+
+void
+evtag_marshal(struct evbuffer *evbuf, ev_uint32_t tag,
+ const void *data, ev_uint32_t len)
+{
+ evtag_encode_tag(evbuf, tag);
+ evtag_encode_int(evbuf, len);
+ evbuffer_add(evbuf, (void *)data, len);
+}
+
+void
+evtag_marshal_buffer(struct evbuffer *evbuf, ev_uint32_t tag,
+ struct evbuffer *data)
+{
+ evtag_encode_tag(evbuf, tag);
+ /* XXX support more than UINT32_MAX data */
+ evtag_encode_int(evbuf, (ev_uint32_t)evbuffer_get_length(data));
+ evbuffer_add_buffer(evbuf, data);
+}
+
+/* Marshaling for integers */
+void
+evtag_marshal_int(struct evbuffer *evbuf, ev_uint32_t tag, ev_uint32_t integer)
+{
+ ev_uint8_t data[5];
+ int len = encode_int_internal(data, integer);
+
+ evtag_encode_tag(evbuf, tag);
+ evtag_encode_int(evbuf, len);
+ evbuffer_add(evbuf, data, len);
+}
+
+void
+evtag_marshal_int64(struct evbuffer *evbuf, ev_uint32_t tag,
+ ev_uint64_t integer)
+{
+ ev_uint8_t data[9];
+ int len = encode_int64_internal(data, integer);
+
+ evtag_encode_tag(evbuf, tag);
+ evtag_encode_int(evbuf, len);
+ evbuffer_add(evbuf, data, len);
+}
+
+void
+evtag_marshal_string(struct evbuffer *buf, ev_uint32_t tag, const char *string)
+{
+ /* TODO support strings longer than UINT32_MAX ? */
+ evtag_marshal(buf, tag, string, (ev_uint32_t)strlen(string));
+}
+
+void
+evtag_marshal_timeval(struct evbuffer *evbuf, ev_uint32_t tag, struct timeval *tv)
+{
+ ev_uint8_t data[10];
+ int len = encode_int_internal(data, tv->tv_sec);
+ len += encode_int_internal(data + len, tv->tv_usec);
+ evtag_marshal(evbuf, tag, data, len);
+}
+
+#define DECODE_INT_INTERNAL(number, maxnibbles, pnumber, evbuf, offset) \
+do { \
+ ev_uint8_t *data; \
+ ev_ssize_t len = evbuffer_get_length(evbuf) - offset; \
+ int nibbles = 0; \
+ \
+ if (len <= 0) \
+ return (-1); \
+ \
+ /* XXX(niels): faster? */ \
+ data = evbuffer_pullup(evbuf, offset + 1) + offset; \
+ \
+ nibbles = ((data[0] & 0xf0) >> 4) + 1; \
+ if (nibbles > maxnibbles || (nibbles >> 1) + 1 > len) \
+ return (-1); \
+ len = (nibbles >> 1) + 1; \
+ \
+ data = evbuffer_pullup(evbuf, offset + len) + offset; \
+ \
+ while (nibbles > 0) { \
+ number <<= 4; \
+ if (nibbles & 0x1) \
+ number |= data[nibbles >> 1] & 0x0f; \
+ else \
+ number |= (data[nibbles >> 1] & 0xf0) >> 4; \
+ nibbles--; \
+ } \
+ \
+ *pnumber = number; \
+ \
+ return (int)(len); \
+} while (0)
+
+/* Internal: decode an integer from an evbuffer, without draining it.
+ * Only integers up to 32-bits are supported.
+ *
+ * @param evbuf the buffer to read from
+ * @param offset an index into the buffer at which we should start reading.
+ * @param pnumber a pointer to receive the integer.
+ * @return The length of the number as encoded, or -1 on error.
+ */
+
+static int
+decode_int_internal(ev_uint32_t *pnumber, struct evbuffer *evbuf, int offset)
+{
+ ev_uint32_t number = 0;
+ DECODE_INT_INTERNAL(number, 8, pnumber, evbuf, offset);
+}
+
+static int
+decode_int64_internal(ev_uint64_t *pnumber, struct evbuffer *evbuf, int offset)
+{
+ ev_uint64_t number = 0;
+ DECODE_INT_INTERNAL(number, 16, pnumber, evbuf, offset);
+}
+
+int
+evtag_decode_int(ev_uint32_t *pnumber, struct evbuffer *evbuf)
+{
+ int res = decode_int_internal(pnumber, evbuf, 0);
+ if (res != -1)
+ evbuffer_drain(evbuf, res);
+
+ return (res == -1 ? -1 : 0);
+}
+
+int
+evtag_decode_int64(ev_uint64_t *pnumber, struct evbuffer *evbuf)
+{
+ int res = decode_int64_internal(pnumber, evbuf, 0);
+ if (res != -1)
+ evbuffer_drain(evbuf, res);
+
+ return (res == -1 ? -1 : 0);
+}
+
+int
+evtag_peek(struct evbuffer *evbuf, ev_uint32_t *ptag)
+{
+ return (decode_tag_internal(ptag, evbuf, 0 /* dodrain */));
+}
+
+int
+evtag_peek_length(struct evbuffer *evbuf, ev_uint32_t *plength)
+{
+ int res, len;
+
+ len = decode_tag_internal(NULL, evbuf, 0 /* dodrain */);
+ if (len == -1)
+ return (-1);
+
+ res = decode_int_internal(plength, evbuf, len);
+ if (res == -1)
+ return (-1);
+
+ *plength += res + len;
+
+ return (0);
+}
+
+int
+evtag_payload_length(struct evbuffer *evbuf, ev_uint32_t *plength)
+{
+ int res, len;
+
+ len = decode_tag_internal(NULL, evbuf, 0 /* dodrain */);
+ if (len == -1)
+ return (-1);
+
+ res = decode_int_internal(plength, evbuf, len);
+ if (res == -1)
+ return (-1);
+
+ return (0);
+}
+
+/* just unmarshals the header and returns the length of the remaining data */
+
+int
+evtag_unmarshal_header(struct evbuffer *evbuf, ev_uint32_t *ptag)
+{
+ ev_uint32_t len;
+
+ if (decode_tag_internal(ptag, evbuf, 1 /* dodrain */) == -1)
+ return (-1);
+ if (evtag_decode_int(&len, evbuf) == -1)
+ return (-1);
+
+ if (evbuffer_get_length(evbuf) < len)
+ return (-1);
+
+ return (len);
+}
+
+int
+evtag_consume(struct evbuffer *evbuf)
+{
+ int len;
+ if ((len = evtag_unmarshal_header(evbuf, NULL)) == -1)
+ return (-1);
+ evbuffer_drain(evbuf, len);
+
+ return (0);
+}
+
+/* Reads the data type from an event buffer */
+
+int
+evtag_unmarshal(struct evbuffer *src, ev_uint32_t *ptag, struct evbuffer *dst)
+{
+ int len;
+
+ if ((len = evtag_unmarshal_header(src, ptag)) == -1)
+ return (-1);
+
+ if (evbuffer_add(dst, evbuffer_pullup(src, len), len) == -1)
+ return (-1);
+
+ evbuffer_drain(src, len);
+
+ return (len);
+}
+
+/* Marshaling for integers */
+
+int
+evtag_unmarshal_int(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint32_t *pinteger)
+{
+ ev_uint32_t tag;
+ ev_uint32_t len;
+ int result;
+
+ if (decode_tag_internal(&tag, evbuf, 1 /* dodrain */) == -1)
+ return (-1);
+ if (need_tag != tag)
+ return (-1);
+ if (evtag_decode_int(&len, evbuf) == -1)
+ return (-1);
+
+ if (evbuffer_get_length(evbuf) < len)
+ return (-1);
+
+ result = decode_int_internal(pinteger, evbuf, 0);
+ evbuffer_drain(evbuf, len);
+ if (result < 0 || (size_t)result > len) /* XXX Should this be != rather than > ?*/
+ return (-1);
+ else
+ return result;
+}
+
+int
+evtag_unmarshal_int64(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint64_t *pinteger)
+{
+ ev_uint32_t tag;
+ ev_uint32_t len;
+ int result;
+
+ if (decode_tag_internal(&tag, evbuf, 1 /* dodrain */) == -1)
+ return (-1);
+ if (need_tag != tag)
+ return (-1);
+ if (evtag_decode_int(&len, evbuf) == -1)
+ return (-1);
+
+ if (evbuffer_get_length(evbuf) < len)
+ return (-1);
+
+ result = decode_int64_internal(pinteger, evbuf, 0);
+ evbuffer_drain(evbuf, len);
+ if (result < 0 || (size_t)result > len) /* XXX Should this be != rather than > ?*/
+ return (-1);
+ else
+ return result;
+}
+
+/* Unmarshal a fixed length tag */
+
+int
+evtag_unmarshal_fixed(struct evbuffer *src, ev_uint32_t need_tag, void *data,
+ size_t len)
+{
+ ev_uint32_t tag;
+ int tag_len;
+
+ /* Now unmarshal a tag and check that it matches the tag we want */
+ if ((tag_len = evtag_unmarshal_header(src, &tag)) < 0 ||
+ tag != need_tag)
+ return (-1);
+
+ if ((size_t)tag_len != len)
+ return (-1);
+
+ evbuffer_remove(src, data, len);
+ return (0);
+}
+
+int
+evtag_unmarshal_string(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ char **pstring)
+{
+ ev_uint32_t tag;
+ int tag_len;
+
+ if ((tag_len = evtag_unmarshal_header(evbuf, &tag)) == -1 ||
+ tag != need_tag)
+ return (-1);
+
+ *pstring = mm_malloc(tag_len + 1);
+ if (*pstring == NULL) {
+ event_warn("%s: malloc", __func__);
+ return -1;
+ }
+ evbuffer_remove(evbuf, *pstring, tag_len);
+ (*pstring)[tag_len] = '\0';
+
+ return (0);
+}
+
+int
+evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ struct timeval *ptv)
+{
+ ev_uint32_t tag;
+ ev_uint32_t integer;
+ int len, offset, offset2;
+ int result = -1;
+
+ if ((len = evtag_unmarshal_header(evbuf, &tag)) == -1)
+ return (-1);
+ if (tag != need_tag)
+ goto done;
+ if ((offset = decode_int_internal(&integer, evbuf, 0)) == -1)
+ goto done;
+ ptv->tv_sec = integer;
+ if ((offset2 = decode_int_internal(&integer, evbuf, offset)) == -1)
+ goto done;
+ ptv->tv_usec = integer;
+ if (offset + offset2 > len) /* XXX Should this be != instead of > ? */
+ goto done;
+
+ result = 0;
+ done:
+ evbuffer_drain(evbuf, len);
+ return result;
+}
diff --git a/sntp/libevent/evmap-internal.h b/sntp/libevent/evmap-internal.h
new file mode 100644
index 0000000..dfc81d5
--- /dev/null
+++ b/sntp/libevent/evmap-internal.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVMAP_INTERNAL_H_INCLUDED_
+#define EVMAP_INTERNAL_H_INCLUDED_
+
+/** @file evmap-internal.h
+ *
+ * An event_map is a utility structure to map each fd or signal to zero or
+ * more events. Functions to manipulate event_maps should only be used from
+ * inside libevent. They generally need to hold the lock on the corresponding
+ * event_base.
+ **/
+
+struct event_base;
+struct event;
+
+/** Initialize an event_map for use.
+ */
+void evmap_io_initmap_(struct event_io_map* ctx);
+void evmap_signal_initmap_(struct event_signal_map* ctx);
+
+/** Remove all entries from an event_map.
+
+ @param ctx the map to clear.
+ */
+void evmap_io_clear_(struct event_io_map* ctx);
+void evmap_signal_clear_(struct event_signal_map* ctx);
+
+/** Add an IO event (some combination of EV_READ or EV_WRITE) to an
+ event_base's list of events on a given file descriptor, and tell the
+ underlying eventops about the fd if its state has changed.
+
+ Requires that ev is not already added.
+
+ @param base the event_base to operate on.
+ @param fd the file descriptor corresponding to ev.
+ @param ev the event to add.
+*/
+int evmap_io_add_(struct event_base *base, evutil_socket_t fd, struct event *ev);
+/** Remove an IO event (some combination of EV_READ or EV_WRITE) to an
+ event_base's list of events on a given file descriptor, and tell the
+ underlying eventops about the fd if its state has changed.
+
+ @param base the event_base to operate on.
+ @param fd the file descriptor corresponding to ev.
+ @param ev the event to remove.
+ */
+int evmap_io_del_(struct event_base *base, evutil_socket_t fd, struct event *ev);
+/** Active the set of events waiting on an event_base for a given fd.
+
+ @param base the event_base to operate on.
+ @param fd the file descriptor that has become active.
+ @param events a bitmask of EV_READ|EV_WRITE|EV_ET.
+*/
+void evmap_io_active_(struct event_base *base, evutil_socket_t fd, short events);
+
+
+/* These functions behave in the same way as evmap_io_*, except they work on
+ * signals rather than fds. signals use a linear map everywhere; fds use
+ * either a linear map or a hashtable. */
+int evmap_signal_add_(struct event_base *base, int signum, struct event *ev);
+int evmap_signal_del_(struct event_base *base, int signum, struct event *ev);
+void evmap_signal_active_(struct event_base *base, evutil_socket_t signum, int ncalls);
+
+/* Return the fdinfo object associated with a given fd. If the fd has no
+ * events associated with it, the result may be NULL.
+ */
+void *evmap_io_get_fdinfo_(struct event_io_map *ctx, evutil_socket_t fd);
+
+/* Helper for event_reinit(): Tell the backend to re-add every fd and signal
+ * for which we have a pending event.
+ */
+int evmap_reinit_(struct event_base *base);
+
+/* Helper for event_base_free(): Call event_del() on every pending fd and
+ * signal event.
+ */
+void evmap_delete_all_(struct event_base *base);
+
+/* Helper for event_base_assert_ok_(): Check referential integrity of the
+ * evmaps.
+ */
+void evmap_check_integrity_(struct event_base *base);
+
+/* Helper: Call fn on every fd or signal event, passing as its arguments the
+ * provided event_base, the event, and arg. If fn returns 0, process the next
+ * event. If it returns any other value, return that value and process no
+ * more events.
+ */
+int evmap_foreach_event_(struct event_base *base,
+ event_base_foreach_event_cb fn,
+ void *arg);
+
+#endif /* EVMAP_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/evmap.c b/sntp/libevent/evmap.c
new file mode 100644
index 0000000..3f76dd0
--- /dev/null
+++ b/sntp/libevent/evmap.c
@@ -0,0 +1,1055 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#if !defined(_WIN32) && defined(EVENT__HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+
+#include "event-internal.h"
+#include "evmap-internal.h"
+#include "mm-internal.h"
+#include "changelist-internal.h"
+
+/** An entry for an evmap_io list: notes all the events that want to read or
+ write on a given fd, and the number of each.
+ */
+struct evmap_io {
+ struct event_dlist events;
+ ev_uint16_t nread;
+ ev_uint16_t nwrite;
+ ev_uint16_t nclose;
+};
+
+/* An entry for an evmap_signal list: notes all the events that want to know
+ when a signal triggers. */
+struct evmap_signal {
+ struct event_dlist events;
+};
+
+/* On some platforms, fds start at 0 and increment by 1 as they are
+ allocated, and old numbers get used. For these platforms, we
+ implement io maps just like signal maps: as an array of pointers to
+ struct evmap_io. But on other platforms (windows), sockets are not
+ 0-indexed, not necessarily consecutive, and not necessarily reused.
+ There, we use a hashtable to implement evmap_io.
+*/
+#ifdef EVMAP_USE_HT
+struct event_map_entry {
+ HT_ENTRY(event_map_entry) map_node;
+ evutil_socket_t fd;
+ union { /* This is a union in case we need to make more things that can
+ be in the hashtable. */
+ struct evmap_io evmap_io;
+ } ent;
+};
+
+/* Helper used by the event_io_map hashtable code; tries to return a good hash
+ * of the fd in e->fd. */
+static inline unsigned
+hashsocket(struct event_map_entry *e)
+{
+ /* On win32, in practice, the low 2-3 bits of a SOCKET seem not to
+ * matter. Our hashtable implementation really likes low-order bits,
+ * though, so let's do the rotate-and-add trick. */
+ unsigned h = (unsigned) e->fd;
+ h += (h >> 2) | (h << 30);
+ return h;
+}
+
+/* Helper used by the event_io_map hashtable code; returns true iff e1 and e2
+ * have the same e->fd. */
+static inline int
+eqsocket(struct event_map_entry *e1, struct event_map_entry *e2)
+{
+ return e1->fd == e2->fd;
+}
+
+HT_PROTOTYPE(event_io_map, event_map_entry, map_node, hashsocket, eqsocket)
+HT_GENERATE(event_io_map, event_map_entry, map_node, hashsocket, eqsocket,
+ 0.5, mm_malloc, mm_realloc, mm_free)
+
+#define GET_IO_SLOT(x, map, slot, type) \
+ do { \
+ struct event_map_entry key_, *ent_; \
+ key_.fd = slot; \
+ ent_ = HT_FIND(event_io_map, map, &key_); \
+ (x) = ent_ ? &ent_->ent.type : NULL; \
+ } while (0);
+
+#define GET_IO_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len) \
+ do { \
+ struct event_map_entry key_, *ent_; \
+ key_.fd = slot; \
+ HT_FIND_OR_INSERT_(event_io_map, map_node, hashsocket, map, \
+ event_map_entry, &key_, ptr, \
+ { \
+ ent_ = *ptr; \
+ }, \
+ { \
+ ent_ = mm_calloc(1,sizeof(struct event_map_entry)+fdinfo_len); \
+ if (EVUTIL_UNLIKELY(ent_ == NULL)) \
+ return (-1); \
+ ent_->fd = slot; \
+ (ctor)(&ent_->ent.type); \
+ HT_FOI_INSERT_(map_node, map, &key_, ent_, ptr) \
+ }); \
+ (x) = &ent_->ent.type; \
+ } while (0)
+
+void evmap_io_initmap_(struct event_io_map *ctx)
+{
+ HT_INIT(event_io_map, ctx);
+}
+
+void evmap_io_clear_(struct event_io_map *ctx)
+{
+ struct event_map_entry **ent, **next, *this;
+ for (ent = HT_START(event_io_map, ctx); ent; ent = next) {
+ this = *ent;
+ next = HT_NEXT_RMV(event_io_map, ctx, ent);
+ mm_free(this);
+ }
+ HT_CLEAR(event_io_map, ctx); /* remove all storage held by the ctx. */
+}
+#endif
+
+/* Set the variable 'x' to the field in event_map 'map' with fields of type
+ 'struct type *' corresponding to the fd or signal 'slot'. Set 'x' to NULL
+ if there are no entries for 'slot'. Does no bounds-checking. */
+#define GET_SIGNAL_SLOT(x, map, slot, type) \
+ (x) = (struct type *)((map)->entries[slot])
+/* As GET_SLOT, but construct the entry for 'slot' if it is not present,
+ by allocating enough memory for a 'struct type', and initializing the new
+ value by calling the function 'ctor' on it. Makes the function
+ return -1 on allocation failure.
+ */
+#define GET_SIGNAL_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len) \
+ do { \
+ if ((map)->entries[slot] == NULL) { \
+ (map)->entries[slot] = \
+ mm_calloc(1,sizeof(struct type)+fdinfo_len); \
+ if (EVUTIL_UNLIKELY((map)->entries[slot] == NULL)) \
+ return (-1); \
+ (ctor)((struct type *)(map)->entries[slot]); \
+ } \
+ (x) = (struct type *)((map)->entries[slot]); \
+ } while (0)
+
+/* If we aren't using hashtables, then define the IO_SLOT macros and functions
+ as thin aliases over the SIGNAL_SLOT versions. */
+#ifndef EVMAP_USE_HT
+#define GET_IO_SLOT(x,map,slot,type) GET_SIGNAL_SLOT(x,map,slot,type)
+#define GET_IO_SLOT_AND_CTOR(x,map,slot,type,ctor,fdinfo_len) \
+ GET_SIGNAL_SLOT_AND_CTOR(x,map,slot,type,ctor,fdinfo_len)
+#define FDINFO_OFFSET sizeof(struct evmap_io)
+void
+evmap_io_initmap_(struct event_io_map* ctx)
+{
+ evmap_signal_initmap_(ctx);
+}
+void
+evmap_io_clear_(struct event_io_map* ctx)
+{
+ evmap_signal_clear_(ctx);
+}
+#endif
+
+
+/** Expand 'map' with new entries of width 'msize' until it is big enough
+ to store a value in 'slot'.
+ */
+static int
+evmap_make_space(struct event_signal_map *map, int slot, int msize)
+{
+ if (map->nentries <= slot) {
+ int nentries = map->nentries ? map->nentries : 32;
+ void **tmp;
+
+ while (nentries <= slot)
+ nentries <<= 1;
+
+ tmp = (void **)mm_realloc(map->entries, nentries * msize);
+ if (tmp == NULL)
+ return (-1);
+
+ memset(&tmp[map->nentries], 0,
+ (nentries - map->nentries) * msize);
+
+ map->nentries = nentries;
+ map->entries = tmp;
+ }
+
+ return (0);
+}
+
+void
+evmap_signal_initmap_(struct event_signal_map *ctx)
+{
+ ctx->nentries = 0;
+ ctx->entries = NULL;
+}
+
+void
+evmap_signal_clear_(struct event_signal_map *ctx)
+{
+ if (ctx->entries != NULL) {
+ int i;
+ for (i = 0; i < ctx->nentries; ++i) {
+ if (ctx->entries[i] != NULL)
+ mm_free(ctx->entries[i]);
+ }
+ mm_free(ctx->entries);
+ ctx->entries = NULL;
+ }
+ ctx->nentries = 0;
+}
+
+
+/* code specific to file descriptors */
+
+/** Constructor for struct evmap_io */
+static void
+evmap_io_init(struct evmap_io *entry)
+{
+ LIST_INIT(&entry->events);
+ entry->nread = 0;
+ entry->nwrite = 0;
+ entry->nclose = 0;
+}
+
+
+/* return -1 on error, 0 on success if nothing changed in the event backend,
+ * and 1 on success if something did. */
+int
+evmap_io_add_(struct event_base *base, evutil_socket_t fd, struct event *ev)
+{
+ const struct eventop *evsel = base->evsel;
+ struct event_io_map *io = &base->io;
+ struct evmap_io *ctx = NULL;
+ int nread, nwrite, nclose, retval = 0;
+ short res = 0, old = 0;
+ struct event *old_ev;
+
+ EVUTIL_ASSERT(fd == ev->ev_fd);
+
+ if (fd < 0)
+ return 0;
+
+#ifndef EVMAP_USE_HT
+ if (fd >= io->nentries) {
+ if (evmap_make_space(io, fd, sizeof(struct evmap_io *)) == -1)
+ return (-1);
+ }
+#endif
+ GET_IO_SLOT_AND_CTOR(ctx, io, fd, evmap_io, evmap_io_init,
+ evsel->fdinfo_len);
+
+ nread = ctx->nread;
+ nwrite = ctx->nwrite;
+ nclose = ctx->nclose;
+
+ if (nread)
+ old |= EV_READ;
+ if (nwrite)
+ old |= EV_WRITE;
+ if (nclose)
+ old |= EV_CLOSED;
+
+ if (ev->ev_events & EV_READ) {
+ if (++nread == 1)
+ res |= EV_READ;
+ }
+ if (ev->ev_events & EV_WRITE) {
+ if (++nwrite == 1)
+ res |= EV_WRITE;
+ }
+ if (ev->ev_events & EV_CLOSED) {
+ if (++nclose == 1)
+ res |= EV_CLOSED;
+ }
+ if (EVUTIL_UNLIKELY(nread > 0xffff || nwrite > 0xffff || nclose > 0xffff)) {
+ event_warnx("Too many events reading or writing on fd %d",
+ (int)fd);
+ return -1;
+ }
+ if (EVENT_DEBUG_MODE_IS_ON() &&
+ (old_ev = LIST_FIRST(&ctx->events)) &&
+ (old_ev->ev_events&EV_ET) != (ev->ev_events&EV_ET)) {
+ event_warnx("Tried to mix edge-triggered and non-edge-triggered"
+ " events on fd %d", (int)fd);
+ return -1;
+ }
+
+ if (res) {
+ void *extra = ((char*)ctx) + sizeof(struct evmap_io);
+ /* XXX(niels): we cannot mix edge-triggered and
+ * level-triggered, we should probably assert on
+ * this. */
+ if (evsel->add(base, ev->ev_fd,
+ old, (ev->ev_events & EV_ET) | res, extra) == -1)
+ return (-1);
+ retval = 1;
+ }
+
+ ctx->nread = (ev_uint16_t) nread;
+ ctx->nwrite = (ev_uint16_t) nwrite;
+ ctx->nclose = (ev_uint16_t) nclose;
+ LIST_INSERT_HEAD(&ctx->events, ev, ev_io_next);
+
+ return (retval);
+}
+
+/* return -1 on error, 0 on success if nothing changed in the event backend,
+ * and 1 on success if something did. */
+int
+evmap_io_del_(struct event_base *base, evutil_socket_t fd, struct event *ev)
+{
+ const struct eventop *evsel = base->evsel;
+ struct event_io_map *io = &base->io;
+ struct evmap_io *ctx;
+ int nread, nwrite, nclose, retval = 0;
+ short res = 0, old = 0;
+
+ if (fd < 0)
+ return 0;
+
+ EVUTIL_ASSERT(fd == ev->ev_fd);
+
+#ifndef EVMAP_USE_HT
+ if (fd >= io->nentries)
+ return (-1);
+#endif
+
+ GET_IO_SLOT(ctx, io, fd, evmap_io);
+
+ nread = ctx->nread;
+ nwrite = ctx->nwrite;
+ nclose = ctx->nclose;
+
+ if (nread)
+ old |= EV_READ;
+ if (nwrite)
+ old |= EV_WRITE;
+ if (nclose)
+ old |= EV_CLOSED;
+
+ if (ev->ev_events & EV_READ) {
+ if (--nread == 0)
+ res |= EV_READ;
+ EVUTIL_ASSERT(nread >= 0);
+ }
+ if (ev->ev_events & EV_WRITE) {
+ if (--nwrite == 0)
+ res |= EV_WRITE;
+ EVUTIL_ASSERT(nwrite >= 0);
+ }
+ if (ev->ev_events & EV_CLOSED) {
+ if (--nclose == 0)
+ res |= EV_CLOSED;
+ EVUTIL_ASSERT(nclose >= 0);
+ }
+
+ if (res) {
+ void *extra = ((char*)ctx) + sizeof(struct evmap_io);
+ if (evsel->del(base, ev->ev_fd, old, res, extra) == -1) {
+ retval = -1;
+ } else {
+ retval = 1;
+ }
+ }
+
+ ctx->nread = nread;
+ ctx->nwrite = nwrite;
+ ctx->nclose = nclose;
+ LIST_REMOVE(ev, ev_io_next);
+
+ return (retval);
+}
+
+void
+evmap_io_active_(struct event_base *base, evutil_socket_t fd, short events)
+{
+ struct event_io_map *io = &base->io;
+ struct evmap_io *ctx;
+ struct event *ev;
+
+#ifndef EVMAP_USE_HT
+ if (fd < 0 || fd >= io->nentries)
+ return;
+#endif
+ GET_IO_SLOT(ctx, io, fd, evmap_io);
+
+ if (NULL == ctx)
+ return;
+ LIST_FOREACH(ev, &ctx->events, ev_io_next) {
+ if (ev->ev_events & events)
+ event_active_nolock_(ev, ev->ev_events & events, 1);
+ }
+}
+
+/* code specific to signals */
+
+static void
+evmap_signal_init(struct evmap_signal *entry)
+{
+ LIST_INIT(&entry->events);
+}
+
+
+int
+evmap_signal_add_(struct event_base *base, int sig, struct event *ev)
+{
+ const struct eventop *evsel = base->evsigsel;
+ struct event_signal_map *map = &base->sigmap;
+ struct evmap_signal *ctx = NULL;
+
+ if (sig >= map->nentries) {
+ if (evmap_make_space(
+ map, sig, sizeof(struct evmap_signal *)) == -1)
+ return (-1);
+ }
+ GET_SIGNAL_SLOT_AND_CTOR(ctx, map, sig, evmap_signal, evmap_signal_init,
+ base->evsigsel->fdinfo_len);
+
+ if (LIST_EMPTY(&ctx->events)) {
+ if (evsel->add(base, ev->ev_fd, 0, EV_SIGNAL, NULL)
+ == -1)
+ return (-1);
+ }
+
+ LIST_INSERT_HEAD(&ctx->events, ev, ev_signal_next);
+
+ return (1);
+}
+
+int
+evmap_signal_del_(struct event_base *base, int sig, struct event *ev)
+{
+ const struct eventop *evsel = base->evsigsel;
+ struct event_signal_map *map = &base->sigmap;
+ struct evmap_signal *ctx;
+
+ if (sig >= map->nentries)
+ return (-1);
+
+ GET_SIGNAL_SLOT(ctx, map, sig, evmap_signal);
+
+ LIST_REMOVE(ev, ev_signal_next);
+
+ if (LIST_FIRST(&ctx->events) == NULL) {
+ if (evsel->del(base, ev->ev_fd, 0, EV_SIGNAL, NULL) == -1)
+ return (-1);
+ }
+
+ return (1);
+}
+
+void
+evmap_signal_active_(struct event_base *base, evutil_socket_t sig, int ncalls)
+{
+ struct event_signal_map *map = &base->sigmap;
+ struct evmap_signal *ctx;
+ struct event *ev;
+
+ if (sig < 0 || sig >= map->nentries)
+ return;
+ GET_SIGNAL_SLOT(ctx, map, sig, evmap_signal);
+
+ if (!ctx)
+ return;
+ LIST_FOREACH(ev, &ctx->events, ev_signal_next)
+ event_active_nolock_(ev, EV_SIGNAL, ncalls);
+}
+
+void *
+evmap_io_get_fdinfo_(struct event_io_map *map, evutil_socket_t fd)
+{
+ struct evmap_io *ctx;
+ GET_IO_SLOT(ctx, map, fd, evmap_io);
+ if (ctx)
+ return ((char*)ctx) + sizeof(struct evmap_io);
+ else
+ return NULL;
+}
+
+/* Callback type for evmap_io_foreach_fd */
+typedef int (*evmap_io_foreach_fd_cb)(
+ struct event_base *, evutil_socket_t, struct evmap_io *, void *);
+
+/* Multipurpose helper function: Iterate over every file descriptor event_base
+ * for which we could have EV_READ or EV_WRITE events. For each such fd, call
+ * fn(base, signum, evmap_io, arg), where fn is the user-provided
+ * function, base is the event_base, signum is the signal number, evmap_io
+ * is an evmap_io structure containing a list of events pending on the
+ * file descriptor, and arg is the user-supplied argument.
+ *
+ * If fn returns 0, continue on to the next signal. Otherwise, return the same
+ * value that fn returned.
+ *
+ * Note that there is no guarantee that the file descriptors will be processed
+ * in any particular order.
+ */
+static int
+evmap_io_foreach_fd(struct event_base *base,
+ evmap_io_foreach_fd_cb fn,
+ void *arg)
+{
+ evutil_socket_t fd;
+ struct event_io_map *iomap = &base->io;
+ int r = 0;
+#ifdef EVMAP_USE_HT
+ struct event_map_entry **mapent;
+ HT_FOREACH(mapent, event_io_map, iomap) {
+ struct evmap_io *ctx = &(*mapent)->ent.evmap_io;
+ fd = (*mapent)->fd;
+#else
+ for (fd = 0; fd < iomap->nentries; ++fd) {
+ struct evmap_io *ctx = iomap->entries[fd];
+ if (!ctx)
+ continue;
+#endif
+ if ((r = fn(base, fd, ctx, arg)))
+ break;
+ }
+ return r;
+}
+
+/* Callback type for evmap_signal_foreach_signal */
+typedef int (*evmap_signal_foreach_signal_cb)(
+ struct event_base *, int, struct evmap_signal *, void *);
+
+/* Multipurpose helper function: Iterate over every signal number in the
+ * event_base for which we could have signal events. For each such signal,
+ * call fn(base, signum, evmap_signal, arg), where fn is the user-provided
+ * function, base is the event_base, signum is the signal number, evmap_signal
+ * is an evmap_signal structure containing a list of events pending on the
+ * signal, and arg is the user-supplied argument.
+ *
+ * If fn returns 0, continue on to the next signal. Otherwise, return the same
+ * value that fn returned.
+ */
+static int
+evmap_signal_foreach_signal(struct event_base *base,
+ evmap_signal_foreach_signal_cb fn,
+ void *arg)
+{
+ struct event_signal_map *sigmap = &base->sigmap;
+ int r = 0;
+ int signum;
+
+ for (signum = 0; signum < sigmap->nentries; ++signum) {
+ struct evmap_signal *ctx = sigmap->entries[signum];
+ if (!ctx)
+ continue;
+ if ((r = fn(base, signum, ctx, arg)))
+ break;
+ }
+ return r;
+}
+
+/* Helper for evmap_reinit_: tell the backend to add every fd for which we have
+ * pending events, with the appropriate combination of EV_READ, EV_WRITE, and
+ * EV_ET. */
+static int
+evmap_io_reinit_iter_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *ctx, void *arg)
+{
+ const struct eventop *evsel = base->evsel;
+ void *extra;
+ int *result = arg;
+ short events = 0;
+ struct event *ev;
+ EVUTIL_ASSERT(ctx);
+
+ extra = ((char*)ctx) + sizeof(struct evmap_io);
+ if (ctx->nread)
+ events |= EV_READ;
+ if (ctx->nwrite)
+ events |= EV_WRITE;
+ if (ctx->nclose)
+ events |= EV_CLOSED;
+ if (evsel->fdinfo_len)
+ memset(extra, 0, evsel->fdinfo_len);
+ if (events &&
+ (ev = LIST_FIRST(&ctx->events)) &&
+ (ev->ev_events & EV_ET))
+ events |= EV_ET;
+ if (evsel->add(base, fd, 0, events, extra) == -1)
+ *result = -1;
+
+ return 0;
+}
+
+/* Helper for evmap_reinit_: tell the backend to add every signal for which we
+ * have pending events. */
+static int
+evmap_signal_reinit_iter_fn(struct event_base *base,
+ int signum, struct evmap_signal *ctx, void *arg)
+{
+ const struct eventop *evsel = base->evsigsel;
+ int *result = arg;
+
+ if (!LIST_EMPTY(&ctx->events)) {
+ if (evsel->add(base, signum, 0, EV_SIGNAL, NULL) == -1)
+ *result = -1;
+ }
+ return 0;
+}
+
+int
+evmap_reinit_(struct event_base *base)
+{
+ int result = 0;
+
+ evmap_io_foreach_fd(base, evmap_io_reinit_iter_fn, &result);
+ if (result < 0)
+ return -1;
+ evmap_signal_foreach_signal(base, evmap_signal_reinit_iter_fn, &result);
+ if (result < 0)
+ return -1;
+ return 0;
+}
+
+/* Helper for evmap_delete_all_: delete every event in an event_dlist. */
+static int
+delete_all_in_dlist(struct event_dlist *dlist)
+{
+ struct event *ev;
+ while ((ev = LIST_FIRST(dlist)))
+ event_del(ev);
+ return 0;
+}
+
+/* Helper for evmap_delete_all_: delete every event pending on an fd. */
+static int
+evmap_io_delete_all_iter_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *io_info, void *arg)
+{
+ return delete_all_in_dlist(&io_info->events);
+}
+
+/* Helper for evmap_delete_all_: delete every event pending on a signal. */
+static int
+evmap_signal_delete_all_iter_fn(struct event_base *base, int signum,
+ struct evmap_signal *sig_info, void *arg)
+{
+ return delete_all_in_dlist(&sig_info->events);
+}
+
+void
+evmap_delete_all_(struct event_base *base)
+{
+ evmap_signal_foreach_signal(base, evmap_signal_delete_all_iter_fn, NULL);
+ evmap_io_foreach_fd(base, evmap_io_delete_all_iter_fn, NULL);
+}
+
+/** Per-fd structure for use with changelists. It keeps track, for each fd or
+ * signal using the changelist, of where its entry in the changelist is.
+ */
+struct event_changelist_fdinfo {
+ int idxplus1; /* this is the index +1, so that memset(0) will make it
+ * a no-such-element */
+};
+
+void
+event_changelist_init_(struct event_changelist *changelist)
+{
+ changelist->changes = NULL;
+ changelist->changes_size = 0;
+ changelist->n_changes = 0;
+}
+
+/** Helper: return the changelist_fdinfo corresponding to a given change. */
+static inline struct event_changelist_fdinfo *
+event_change_get_fdinfo(struct event_base *base,
+ const struct event_change *change)
+{
+ char *ptr;
+ if (change->read_change & EV_CHANGE_SIGNAL) {
+ struct evmap_signal *ctx;
+ GET_SIGNAL_SLOT(ctx, &base->sigmap, change->fd, evmap_signal);
+ ptr = ((char*)ctx) + sizeof(struct evmap_signal);
+ } else {
+ struct evmap_io *ctx;
+ GET_IO_SLOT(ctx, &base->io, change->fd, evmap_io);
+ ptr = ((char*)ctx) + sizeof(struct evmap_io);
+ }
+ return (void*)ptr;
+}
+
+/** Callback helper for event_changelist_assert_ok */
+static int
+event_changelist_assert_ok_foreach_iter_fn(
+ struct event_base *base,
+ evutil_socket_t fd, struct evmap_io *io, void *arg)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct event_changelist_fdinfo *f;
+ f = (void*)
+ ( ((char*)io) + sizeof(struct evmap_io) );
+ if (f->idxplus1) {
+ struct event_change *c = &changelist->changes[f->idxplus1 - 1];
+ EVUTIL_ASSERT(c->fd == fd);
+ }
+ return 0;
+}
+
+/** Make sure that the changelist is consistent with the evmap structures. */
+static void
+event_changelist_assert_ok(struct event_base *base)
+{
+ int i;
+ struct event_changelist *changelist = &base->changelist;
+
+ EVUTIL_ASSERT(changelist->changes_size >= changelist->n_changes);
+ for (i = 0; i < changelist->n_changes; ++i) {
+ struct event_change *c = &changelist->changes[i];
+ struct event_changelist_fdinfo *f;
+ EVUTIL_ASSERT(c->fd >= 0);
+ f = event_change_get_fdinfo(base, c);
+ EVUTIL_ASSERT(f);
+ EVUTIL_ASSERT(f->idxplus1 == i + 1);
+ }
+
+ evmap_io_foreach_fd(base,
+ event_changelist_assert_ok_foreach_iter_fn,
+ NULL);
+}
+
+#ifdef DEBUG_CHANGELIST
+#define event_changelist_check(base) event_changelist_assert_ok((base))
+#else
+#define event_changelist_check(base) ((void)0)
+#endif
+
+void
+event_changelist_remove_all_(struct event_changelist *changelist,
+ struct event_base *base)
+{
+ int i;
+
+ event_changelist_check(base);
+
+ for (i = 0; i < changelist->n_changes; ++i) {
+ struct event_change *ch = &changelist->changes[i];
+ struct event_changelist_fdinfo *fdinfo =
+ event_change_get_fdinfo(base, ch);
+ EVUTIL_ASSERT(fdinfo->idxplus1 == i + 1);
+ fdinfo->idxplus1 = 0;
+ }
+
+ changelist->n_changes = 0;
+
+ event_changelist_check(base);
+}
+
+void
+event_changelist_freemem_(struct event_changelist *changelist)
+{
+ if (changelist->changes)
+ mm_free(changelist->changes);
+ event_changelist_init_(changelist); /* zero it all out. */
+}
+
+/** Increase the size of 'changelist' to hold more changes. */
+static int
+event_changelist_grow(struct event_changelist *changelist)
+{
+ int new_size;
+ struct event_change *new_changes;
+ if (changelist->changes_size < 64)
+ new_size = 64;
+ else
+ new_size = changelist->changes_size * 2;
+
+ new_changes = mm_realloc(changelist->changes,
+ new_size * sizeof(struct event_change));
+
+ if (EVUTIL_UNLIKELY(new_changes == NULL))
+ return (-1);
+
+ changelist->changes = new_changes;
+ changelist->changes_size = new_size;
+
+ return (0);
+}
+
+/** Return a pointer to the changelist entry for the file descriptor or signal
+ * 'fd', whose fdinfo is 'fdinfo'. If none exists, construct it, setting its
+ * old_events field to old_events.
+ */
+static struct event_change *
+event_changelist_get_or_construct(struct event_changelist *changelist,
+ evutil_socket_t fd,
+ short old_events,
+ struct event_changelist_fdinfo *fdinfo)
+{
+ struct event_change *change;
+
+ if (fdinfo->idxplus1 == 0) {
+ int idx;
+ EVUTIL_ASSERT(changelist->n_changes <= changelist->changes_size);
+
+ if (changelist->n_changes == changelist->changes_size) {
+ if (event_changelist_grow(changelist) < 0)
+ return NULL;
+ }
+
+ idx = changelist->n_changes++;
+ change = &changelist->changes[idx];
+ fdinfo->idxplus1 = idx + 1;
+
+ memset(change, 0, sizeof(struct event_change));
+ change->fd = fd;
+ change->old_events = old_events;
+ } else {
+ change = &changelist->changes[fdinfo->idxplus1 - 1];
+ EVUTIL_ASSERT(change->fd == fd);
+ }
+ return change;
+}
+
+int
+event_changelist_add_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct event_changelist_fdinfo *fdinfo = p;
+ struct event_change *change;
+
+ event_changelist_check(base);
+
+ change = event_changelist_get_or_construct(changelist, fd, old, fdinfo);
+ if (!change)
+ return -1;
+
+ /* An add replaces any previous delete, but doesn't result in a no-op,
+ * since the delete might fail (because the fd had been closed since
+ * the last add, for instance. */
+
+ if (events & (EV_READ|EV_SIGNAL)) {
+ change->read_change = EV_CHANGE_ADD |
+ (events & (EV_ET|EV_PERSIST|EV_SIGNAL));
+ }
+ if (events & EV_WRITE) {
+ change->write_change = EV_CHANGE_ADD |
+ (events & (EV_ET|EV_PERSIST|EV_SIGNAL));
+ }
+ if (events & EV_CLOSED) {
+ change->close_change = EV_CHANGE_ADD |
+ (events & (EV_ET|EV_PERSIST|EV_SIGNAL));
+ }
+
+ event_changelist_check(base);
+ return (0);
+}
+
+int
+event_changelist_del_(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *p)
+{
+ struct event_changelist *changelist = &base->changelist;
+ struct event_changelist_fdinfo *fdinfo = p;
+ struct event_change *change;
+
+ event_changelist_check(base);
+ change = event_changelist_get_or_construct(changelist, fd, old, fdinfo);
+ event_changelist_check(base);
+ if (!change)
+ return -1;
+
+ /* A delete on an event set that doesn't contain the event to be
+ deleted produces a no-op. This effectively emoves any previous
+ uncommitted add, rather than replacing it: on those platforms where
+ "add, delete, dispatch" is not the same as "no-op, dispatch", we
+ want the no-op behavior.
+
+ If we have a no-op item, we could remove it it from the list
+ entirely, but really there's not much point: skipping the no-op
+ change when we do the dispatch later is far cheaper than rejuggling
+ the array now.
+
+ As this stands, it also lets through deletions of events that are
+ not currently set.
+ */
+
+ if (events & (EV_READ|EV_SIGNAL)) {
+ if (!(change->old_events & (EV_READ | EV_SIGNAL)))
+ change->read_change = 0;
+ else
+ change->read_change = EV_CHANGE_DEL;
+ }
+ if (events & EV_WRITE) {
+ if (!(change->old_events & EV_WRITE))
+ change->write_change = 0;
+ else
+ change->write_change = EV_CHANGE_DEL;
+ }
+ if (events & EV_CLOSED) {
+ if (!(change->old_events & EV_CLOSED))
+ change->close_change = 0;
+ else
+ change->close_change = EV_CHANGE_DEL;
+ }
+
+ event_changelist_check(base);
+ return (0);
+}
+
+/* Helper for evmap_check_integrity_: verify that all of the events pending on
+ * given fd are set up correctly, and that the nread and nwrite counts on that
+ * fd are correct. */
+static int
+evmap_io_check_integrity_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *io_info, void *arg)
+{
+ struct event *ev;
+ int n_read = 0, n_write = 0, n_close = 0;
+
+ /* First, make sure the list itself isn't corrupt. Otherwise,
+ * running LIST_FOREACH could be an exciting adventure. */
+ EVUTIL_ASSERT_LIST_OK(&io_info->events, event, ev_io_next);
+
+ LIST_FOREACH(ev, &io_info->events, ev_io_next) {
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_INSERTED);
+ EVUTIL_ASSERT(ev->ev_fd == fd);
+ EVUTIL_ASSERT(!(ev->ev_events & EV_SIGNAL));
+ EVUTIL_ASSERT((ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED)));
+ if (ev->ev_events & EV_READ)
+ ++n_read;
+ if (ev->ev_events & EV_WRITE)
+ ++n_write;
+ if (ev->ev_events & EV_CLOSED)
+ ++n_close;
+ }
+
+ EVUTIL_ASSERT(n_read == io_info->nread);
+ EVUTIL_ASSERT(n_write == io_info->nwrite);
+ EVUTIL_ASSERT(n_close == io_info->nclose);
+
+ return 0;
+}
+
+/* Helper for evmap_check_integrity_: verify that all of the events pending
+ * on given signal are set up correctly. */
+static int
+evmap_signal_check_integrity_fn(struct event_base *base,
+ int signum, struct evmap_signal *sig_info, void *arg)
+{
+ struct event *ev;
+ /* First, make sure the list itself isn't corrupt. */
+ EVUTIL_ASSERT_LIST_OK(&sig_info->events, event, ev_signal_next);
+
+ LIST_FOREACH(ev, &sig_info->events, ev_io_next) {
+ EVUTIL_ASSERT(ev->ev_flags & EVLIST_INSERTED);
+ EVUTIL_ASSERT(ev->ev_fd == signum);
+ EVUTIL_ASSERT((ev->ev_events & EV_SIGNAL));
+ EVUTIL_ASSERT(!(ev->ev_events & (EV_READ|EV_WRITE|EV_CLOSED)));
+ }
+ return 0;
+}
+
+void
+evmap_check_integrity_(struct event_base *base)
+{
+ evmap_io_foreach_fd(base, evmap_io_check_integrity_fn, NULL);
+ evmap_signal_foreach_signal(base, evmap_signal_check_integrity_fn, NULL);
+
+ if (base->evsel->add == event_changelist_add_)
+ event_changelist_assert_ok(base);
+}
+
+/* Helper type for evmap_foreach_event_: Bundles a function to call on every
+ * event, and the user-provided void* to use as its third argument. */
+struct evmap_foreach_event_helper {
+ event_base_foreach_event_cb fn;
+ void *arg;
+};
+
+/* Helper for evmap_foreach_event_: calls a provided function on every event
+ * pending on a given fd. */
+static int
+evmap_io_foreach_event_fn(struct event_base *base, evutil_socket_t fd,
+ struct evmap_io *io_info, void *arg)
+{
+ struct evmap_foreach_event_helper *h = arg;
+ struct event *ev;
+ int r;
+ LIST_FOREACH(ev, &io_info->events, ev_io_next) {
+ if ((r = h->fn(base, ev, h->arg)))
+ return r;
+ }
+ return 0;
+}
+
+/* Helper for evmap_foreach_event_: calls a provided function on every event
+ * pending on a given signal. */
+static int
+evmap_signal_foreach_event_fn(struct event_base *base, int signum,
+ struct evmap_signal *sig_info, void *arg)
+{
+ struct event *ev;
+ struct evmap_foreach_event_helper *h = arg;
+ int r;
+ LIST_FOREACH(ev, &sig_info->events, ev_signal_next) {
+ if ((r = h->fn(base, ev, h->arg)))
+ return r;
+ }
+ return 0;
+}
+
+int
+evmap_foreach_event_(struct event_base *base,
+ event_base_foreach_event_cb fn, void *arg)
+{
+ struct evmap_foreach_event_helper h;
+ int r;
+ h.fn = fn;
+ h.arg = arg;
+ if ((r = evmap_io_foreach_fd(base, evmap_io_foreach_event_fn, &h)))
+ return r;
+ return evmap_signal_foreach_signal(base, evmap_signal_foreach_event_fn, &h);
+}
+
diff --git a/sntp/libevent/evport.c b/sntp/libevent/evport.c
new file mode 100644
index 0000000..a014386
--- /dev/null
+++ b/sntp/libevent/evport.c
@@ -0,0 +1,451 @@
+/*
+ * Submitted by David Pacheco (dp.spambait@gmail.com)
+ *
+ * Copyright 2006-2007 Niels Provos
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SUN MICROSYSTEMS, INC. ``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 SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2007 Sun Microsystems. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * evport.c: event backend using Solaris 10 event ports. See port_create(3C).
+ * This implementation is loosely modeled after the one used for select(2) (in
+ * select.c).
+ *
+ * The outstanding events are tracked in a data structure called evport_data.
+ * Each entry in the ed_fds array corresponds to a file descriptor, and contains
+ * pointers to the read and write events that correspond to that fd. (That is,
+ * when the file is readable, the "read" event should handle it, etc.)
+ *
+ * evport_add and evport_del update this data structure. evport_dispatch uses it
+ * to determine where to callback when an event occurs (which it gets from
+ * port_getn).
+ *
+ * Helper functions are used: grow() grows the file descriptor array as
+ * necessary when large fd's come in. reassociate() takes care of maintaining
+ * the proper file-descriptor/event-port associations.
+ *
+ * As in the select(2) implementation, signals are handled by evsignal.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_EVENT_PORTS
+
+#include <sys/time.h>
+#include <sys/queue.h>
+#include <errno.h>
+#include <poll.h>
+#include <port.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "event2/thread.h"
+
+#include "evthread-internal.h"
+#include "event-internal.h"
+#include "log-internal.h"
+#include "evsignal-internal.h"
+#include "evmap-internal.h"
+
+#define INITIAL_EVENTS_PER_GETN 8
+#define MAX_EVENTS_PER_GETN 4096
+
+/*
+ * Per-file-descriptor information about what events we're subscribed to. These
+ * fields are NULL if no event is subscribed to either of them.
+ */
+
+struct fd_info {
+ /* combinations of EV_READ and EV_WRITE */
+ short fdi_what;
+ /* Index of this fd within ed_pending, plus 1. Zero if this fd is
+ * not in ed_pending. (The +1 is a hack so that memset(0) will set
+ * it to a nil index. */
+ int pending_idx_plus_1;
+};
+
+#define FDI_HAS_READ(fdi) ((fdi)->fdi_what & EV_READ)
+#define FDI_HAS_WRITE(fdi) ((fdi)->fdi_what & EV_WRITE)
+#define FDI_HAS_EVENTS(fdi) (FDI_HAS_READ(fdi) || FDI_HAS_WRITE(fdi))
+#define FDI_TO_SYSEVENTS(fdi) (FDI_HAS_READ(fdi) ? POLLIN : 0) | \
+ (FDI_HAS_WRITE(fdi) ? POLLOUT : 0)
+
+struct evport_data {
+ int ed_port; /* event port for system events */
+ /* How many elements of ed_pending should we look at? */
+ int ed_npending;
+ /* How many elements are allocated in ed_pending and pevtlist? */
+ int ed_maxevents;
+ /* fdi's that we need to reassoc */
+ int *ed_pending;
+ /* storage space for incoming events. */
+ port_event_t *ed_pevtlist;
+
+};
+
+static void* evport_init(struct event_base *);
+static int evport_add(struct event_base *, int fd, short old, short events, void *);
+static int evport_del(struct event_base *, int fd, short old, short events, void *);
+static int evport_dispatch(struct event_base *, struct timeval *);
+static void evport_dealloc(struct event_base *);
+static int grow(struct evport_data *, int min_events);
+
+const struct eventop evportops = {
+ "evport",
+ evport_init,
+ evport_add,
+ evport_del,
+ evport_dispatch,
+ evport_dealloc,
+ 1, /* need reinit */
+ 0, /* features */
+ sizeof(struct fd_info), /* fdinfo length */
+};
+
+/*
+ * Initialize the event port implementation.
+ */
+
+static void*
+evport_init(struct event_base *base)
+{
+ struct evport_data *evpd;
+
+ if (!(evpd = mm_calloc(1, sizeof(struct evport_data))))
+ return (NULL);
+
+ if ((evpd->ed_port = port_create()) == -1) {
+ mm_free(evpd);
+ return (NULL);
+ }
+
+ if (grow(evpd, INITIAL_EVENTS_PER_GETN) < 0) {
+ close(evpd->ed_port);
+ mm_free(evpd);
+ return NULL;
+ }
+
+ evpd->ed_npending = 0;
+
+ evsig_init_(base);
+
+ return (evpd);
+}
+
+static int
+grow(struct evport_data *data, int min_events)
+{
+ int newsize;
+ int *new_pending;
+ port_event_t *new_pevtlist;
+ if (data->ed_maxevents) {
+ newsize = data->ed_maxevents;
+ do {
+ newsize *= 2;
+ } while (newsize < min_events);
+ } else {
+ newsize = min_events;
+ }
+
+ new_pending = mm_realloc(data->ed_pending, sizeof(int)*newsize);
+ if (new_pending == NULL)
+ return -1;
+ data->ed_pending = new_pending;
+ new_pevtlist = mm_realloc(data->ed_pevtlist, sizeof(port_event_t)*newsize);
+ if (new_pevtlist == NULL)
+ return -1;
+ data->ed_pevtlist = new_pevtlist;
+
+ data->ed_maxevents = newsize;
+ return 0;
+}
+
+#ifdef CHECK_INVARIANTS
+/*
+ * Checks some basic properties about the evport_data structure. Because it
+ * checks all file descriptors, this function can be expensive when the maximum
+ * file descriptor ever used is rather large.
+ */
+
+static void
+check_evportop(struct evport_data *evpd)
+{
+ EVUTIL_ASSERT(evpd);
+ EVUTIL_ASSERT(evpd->ed_port > 0);
+}
+
+/*
+ * Verifies very basic integrity of a given port_event.
+ */
+static void
+check_event(port_event_t* pevt)
+{
+ /*
+ * We've only registered for PORT_SOURCE_FD events. The only
+ * other thing we can legitimately receive is PORT_SOURCE_ALERT,
+ * but since we're not using port_alert either, we can assume
+ * PORT_SOURCE_FD.
+ */
+ EVUTIL_ASSERT(pevt->portev_source == PORT_SOURCE_FD);
+}
+
+#else
+#define check_evportop(epop)
+#define check_event(pevt)
+#endif /* CHECK_INVARIANTS */
+
+/*
+ * (Re)associates the given file descriptor with the event port. The OS events
+ * are specified (implicitly) from the fd_info struct.
+ */
+static int
+reassociate(struct evport_data *epdp, struct fd_info *fdip, int fd)
+{
+ int sysevents = FDI_TO_SYSEVENTS(fdip);
+
+ if (sysevents != 0) {
+ if (port_associate(epdp->ed_port, PORT_SOURCE_FD,
+ fd, sysevents, fdip) == -1) {
+ event_warn("port_associate");
+ return (-1);
+ }
+ }
+
+ check_evportop(epdp);
+
+ return (0);
+}
+
+/*
+ * Main event loop - polls port_getn for some number of events, and processes
+ * them.
+ */
+
+static int
+evport_dispatch(struct event_base *base, struct timeval *tv)
+{
+ int i, res;
+ struct evport_data *epdp = base->evbase;
+ port_event_t *pevtlist = epdp->ed_pevtlist;
+
+ /*
+ * port_getn will block until it has at least nevents events. It will
+ * also return how many it's given us (which may be more than we asked
+ * for, as long as it's less than our maximum (ed_maxevents)) in
+ * nevents.
+ */
+ int nevents = 1;
+
+ /*
+ * We have to convert a struct timeval to a struct timespec
+ * (only difference is nanoseconds vs. microseconds). If no time-based
+ * events are active, we should wait for I/O (and tv == NULL).
+ */
+ struct timespec ts;
+ struct timespec *ts_p = NULL;
+ if (tv != NULL) {
+ ts.tv_sec = tv->tv_sec;
+ ts.tv_nsec = tv->tv_usec * 1000;
+ ts_p = &ts;
+ }
+
+ /*
+ * Before doing anything else, we need to reassociate the events we hit
+ * last time which need reassociation. See comment at the end of the
+ * loop below.
+ */
+ for (i = 0; i < epdp->ed_npending; ++i) {
+ struct fd_info *fdi = NULL;
+ const int fd = epdp->ed_pending[i];
+ if (fd != -1) {
+ /* We might have cleared out this event; we need
+ * to be sure that it's still set. */
+ fdi = evmap_io_get_fdinfo_(&base->io, fd);
+ }
+
+ if (fdi != NULL && FDI_HAS_EVENTS(fdi)) {
+ reassociate(epdp, fdi, fd);
+ /* epdp->ed_pending[i] = -1; */
+ fdi->pending_idx_plus_1 = 0;
+ }
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = port_getn(epdp->ed_port, pevtlist, epdp->ed_maxevents,
+ (unsigned int *) &nevents, ts_p);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno == EINTR || errno == EAGAIN) {
+ return (0);
+ } else if (errno == ETIME) {
+ if (nevents == 0)
+ return (0);
+ } else {
+ event_warn("port_getn");
+ return (-1);
+ }
+ }
+
+ event_debug(("%s: port_getn reports %d events", __func__, nevents));
+
+ for (i = 0; i < nevents; ++i) {
+ port_event_t *pevt = &pevtlist[i];
+ int fd = (int) pevt->portev_object;
+ struct fd_info *fdi = pevt->portev_user;
+ /*EVUTIL_ASSERT(evmap_io_get_fdinfo_(&base->io, fd) == fdi);*/
+
+ check_evportop(epdp);
+ check_event(pevt);
+ epdp->ed_pending[i] = fd;
+ fdi->pending_idx_plus_1 = i + 1;
+
+ /*
+ * Figure out what kind of event it was
+ * (because we have to pass this to the callback)
+ */
+ res = 0;
+ if (pevt->portev_events & (POLLERR|POLLHUP)) {
+ res = EV_READ | EV_WRITE;
+ } else {
+ if (pevt->portev_events & POLLIN)
+ res |= EV_READ;
+ if (pevt->portev_events & POLLOUT)
+ res |= EV_WRITE;
+ }
+
+ /*
+ * Check for the error situations or a hangup situation
+ */
+ if (pevt->portev_events & (POLLERR|POLLHUP|POLLNVAL))
+ res |= EV_READ|EV_WRITE;
+
+ evmap_io_active_(base, fd, res);
+ } /* end of all events gotten */
+ epdp->ed_npending = nevents;
+
+ if (nevents == epdp->ed_maxevents &&
+ epdp->ed_maxevents < MAX_EVENTS_PER_GETN) {
+ /* we used all the space this time. We should be ready
+ * for more events next time around. */
+ grow(epdp, epdp->ed_maxevents * 2);
+ }
+
+ check_evportop(epdp);
+
+ return (0);
+}
+
+
+/*
+ * Adds the given event (so that you will be notified when it happens via
+ * the callback function).
+ */
+
+static int
+evport_add(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct evport_data *evpd = base->evbase;
+ struct fd_info *fdi = p;
+
+ check_evportop(evpd);
+
+ fdi->fdi_what |= events;
+
+ return reassociate(evpd, fdi, fd);
+}
+
+/*
+ * Removes the given event from the list of events to wait for.
+ */
+
+static int
+evport_del(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct evport_data *evpd = base->evbase;
+ struct fd_info *fdi = p;
+ int associated = ! fdi->pending_idx_plus_1;
+
+ check_evportop(evpd);
+
+ fdi->fdi_what &= ~(events &(EV_READ|EV_WRITE));
+
+ if (associated) {
+ if (!FDI_HAS_EVENTS(fdi) &&
+ port_dissociate(evpd->ed_port, PORT_SOURCE_FD, fd) == -1) {
+ /*
+ * Ignore EBADFD error the fd could have been closed
+ * before event_del() was called.
+ */
+ if (errno != EBADFD) {
+ event_warn("port_dissociate");
+ return (-1);
+ }
+ } else {
+ if (FDI_HAS_EVENTS(fdi)) {
+ return (reassociate(evpd, fdi, fd));
+ }
+ }
+ } else {
+ if ((fdi->fdi_what & (EV_READ|EV_WRITE)) == 0) {
+ const int i = fdi->pending_idx_plus_1 - 1;
+ EVUTIL_ASSERT(evpd->ed_pending[i] == fd);
+ evpd->ed_pending[i] = -1;
+ fdi->pending_idx_plus_1 = 0;
+ }
+ }
+ return 0;
+}
+
+
+static void
+evport_dealloc(struct event_base *base)
+{
+ struct evport_data *evpd = base->evbase;
+
+ evsig_dealloc_(base);
+
+ close(evpd->ed_port);
+
+ if (evpd->ed_pending)
+ mm_free(evpd->ed_pending);
+ if (evpd->ed_pevtlist)
+ mm_free(evpd->ed_pevtlist);
+
+ mm_free(evpd);
+}
+
+#endif /* EVENT__HAVE_EVENT_PORTS */
diff --git a/sntp/libevent/evrpc-internal.h b/sntp/libevent/evrpc-internal.h
new file mode 100644
index 0000000..e53d06e
--- /dev/null
+++ b/sntp/libevent/evrpc-internal.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVRPC_INTERNAL_H_INCLUDED_
+#define EVRPC_INTERNAL_H_INCLUDED_
+
+#include "http-internal.h"
+
+struct evrpc;
+struct evrpc_request_wrapper;
+
+#define EVRPC_URI_PREFIX "/.rpc."
+
+struct evrpc_hook {
+ TAILQ_ENTRY(evrpc_hook) next;
+
+ /* returns EVRPC_TERMINATE; if the rpc should be aborted.
+ * a hook is is allowed to rewrite the evbuffer
+ */
+ int (*process)(void *, struct evhttp_request *,
+ struct evbuffer *, void *);
+ void *process_arg;
+};
+
+TAILQ_HEAD(evrpc_hook_list, evrpc_hook);
+
+/*
+ * this is shared between the base and the pool, so that we can reuse
+ * the hook adding functions; we alias both evrpc_pool and evrpc_base
+ * to this common structure.
+ */
+
+struct evrpc_hook_ctx;
+TAILQ_HEAD(evrpc_pause_list, evrpc_hook_ctx);
+
+struct evrpc_hooks_ {
+ /* hooks for processing outbound and inbound rpcs */
+ struct evrpc_hook_list in_hooks;
+ struct evrpc_hook_list out_hooks;
+
+ struct evrpc_pause_list pause_requests;
+};
+
+#define input_hooks common.in_hooks
+#define output_hooks common.out_hooks
+#define paused_requests common.pause_requests
+
+struct evrpc_base {
+ struct evrpc_hooks_ common;
+
+ /* the HTTP server under which we register our RPC calls */
+ struct evhttp* http_server;
+
+ /* a list of all RPCs registered with us */
+ TAILQ_HEAD(evrpc_list, evrpc) registered_rpcs;
+};
+
+struct evrpc_req_generic;
+void evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state);
+
+/* A pool for holding evhttp_connection objects */
+struct evrpc_pool {
+ struct evrpc_hooks_ common;
+
+ struct event_base *base;
+
+ struct evconq connections;
+
+ int timeout;
+
+ TAILQ_HEAD(evrpc_requestq, evrpc_request_wrapper) (requests);
+};
+
+struct evrpc_hook_ctx {
+ TAILQ_ENTRY(evrpc_hook_ctx) next;
+
+ void *ctx;
+ void (*cb)(void *, enum EVRPC_HOOK_RESULT);
+};
+
+struct evrpc_meta {
+ TAILQ_ENTRY(evrpc_meta) next;
+ char *key;
+
+ void *data;
+ size_t data_size;
+};
+
+TAILQ_HEAD(evrpc_meta_list, evrpc_meta);
+
+struct evrpc_hook_meta {
+ struct evrpc_meta_list meta_data;
+ struct evhttp_connection *evcon;
+};
+
+/* allows association of meta data with a request */
+static void evrpc_hook_associate_meta_(struct evrpc_hook_meta **pctx,
+ struct evhttp_connection *evcon);
+
+/* creates a new meta data store */
+static struct evrpc_hook_meta *evrpc_hook_meta_new_(void);
+
+/* frees the meta data associated with a request */
+static void evrpc_hook_context_free_(struct evrpc_hook_meta *ctx);
+
+/* the server side of an rpc */
+
+/* We alias the RPC specific structs to this voided one */
+struct evrpc_req_generic {
+ /*
+ * allows association of meta data via hooks - needs to be
+ * synchronized with evrpc_request_wrapper
+ */
+ struct evrpc_hook_meta *hook_meta;
+
+ /* the unmarshaled request object */
+ void *request;
+
+ /* the empty reply object that needs to be filled in */
+ void *reply;
+
+ /*
+ * the static structure for this rpc; that can be used to
+ * automatically unmarshal and marshal the http buffers.
+ */
+ struct evrpc *rpc;
+
+ /*
+ * the http request structure on which we need to answer.
+ */
+ struct evhttp_request* http_req;
+
+ /*
+ * Temporary data store for marshaled data
+ */
+ struct evbuffer* rpc_data;
+};
+
+/* the client side of an rpc request */
+struct evrpc_request_wrapper {
+ /*
+ * allows association of meta data via hooks - needs to be
+ * synchronized with evrpc_req_generic.
+ */
+ struct evrpc_hook_meta *hook_meta;
+
+ TAILQ_ENTRY(evrpc_request_wrapper) next;
+
+ /* pool on which this rpc request is being made */
+ struct evrpc_pool *pool;
+
+ /* connection on which the request is being sent */
+ struct evhttp_connection *evcon;
+
+ /* the actual request */
+ struct evhttp_request *req;
+
+ /* event for implementing request timeouts */
+ struct event ev_timeout;
+
+ /* the name of the rpc */
+ char *name;
+
+ /* callback */
+ void (*cb)(struct evrpc_status*, void *request, void *reply, void *arg);
+ void *cb_arg;
+
+ void *request;
+ void *reply;
+
+ /* unmarshals the buffer into the proper request structure */
+ void (*request_marshal)(struct evbuffer *, void *);
+
+ /* removes all stored state in the reply */
+ void (*reply_clear)(void *);
+
+ /* marshals the reply into a buffer */
+ int (*reply_unmarshal)(void *, struct evbuffer*);
+};
+
+#endif /* EVRPC_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/evrpc.c b/sntp/libevent/evrpc.c
new file mode 100644
index 0000000..2443ab2
--- /dev/null
+++ b/sntp/libevent/evrpc.c
@@ -0,0 +1,1171 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#include <sys/types.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+
+#include <sys/queue.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/rpc.h"
+#include "event2/rpc_struct.h"
+#include "evrpc-internal.h"
+#include "event2/http.h"
+#include "event2/buffer.h"
+#include "event2/tag.h"
+#include "event2/http_struct.h"
+#include "event2/http_compat.h"
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+
+struct evrpc_base *
+evrpc_init(struct evhttp *http_server)
+{
+ struct evrpc_base* base = mm_calloc(1, sizeof(struct evrpc_base));
+ if (base == NULL)
+ return (NULL);
+
+ /* we rely on the tagging sub system */
+ evtag_init();
+
+ TAILQ_INIT(&base->registered_rpcs);
+ TAILQ_INIT(&base->input_hooks);
+ TAILQ_INIT(&base->output_hooks);
+
+ TAILQ_INIT(&base->paused_requests);
+
+ base->http_server = http_server;
+
+ return (base);
+}
+
+void
+evrpc_free(struct evrpc_base *base)
+{
+ struct evrpc *rpc;
+ struct evrpc_hook *hook;
+ struct evrpc_hook_ctx *pause;
+ int r;
+
+ while ((rpc = TAILQ_FIRST(&base->registered_rpcs)) != NULL) {
+ r = evrpc_unregister_rpc(base, rpc->uri);
+ EVUTIL_ASSERT(r == 0);
+ }
+ while ((pause = TAILQ_FIRST(&base->paused_requests)) != NULL) {
+ TAILQ_REMOVE(&base->paused_requests, pause, next);
+ mm_free(pause);
+ }
+ while ((hook = TAILQ_FIRST(&base->input_hooks)) != NULL) {
+ r = evrpc_remove_hook(base, EVRPC_INPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+ while ((hook = TAILQ_FIRST(&base->output_hooks)) != NULL) {
+ r = evrpc_remove_hook(base, EVRPC_OUTPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+ mm_free(base);
+}
+
+void *
+evrpc_add_hook(void *vbase,
+ enum EVRPC_HOOK_TYPE hook_type,
+ int (*cb)(void *, struct evhttp_request *, struct evbuffer *, void *),
+ void *cb_arg)
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_hook_list *head = NULL;
+ struct evrpc_hook *hook = NULL;
+ switch (hook_type) {
+ case EVRPC_INPUT:
+ head = &base->in_hooks;
+ break;
+ case EVRPC_OUTPUT:
+ head = &base->out_hooks;
+ break;
+ default:
+ EVUTIL_ASSERT(hook_type == EVRPC_INPUT || hook_type == EVRPC_OUTPUT);
+ }
+
+ hook = mm_calloc(1, sizeof(struct evrpc_hook));
+ EVUTIL_ASSERT(hook != NULL);
+
+ hook->process = cb;
+ hook->process_arg = cb_arg;
+ TAILQ_INSERT_TAIL(head, hook, next);
+
+ return (hook);
+}
+
+static int
+evrpc_remove_hook_internal(struct evrpc_hook_list *head, void *handle)
+{
+ struct evrpc_hook *hook = NULL;
+ TAILQ_FOREACH(hook, head, next) {
+ if (hook == handle) {
+ TAILQ_REMOVE(head, hook, next);
+ mm_free(hook);
+ return (1);
+ }
+ }
+
+ return (0);
+}
+
+/*
+ * remove the hook specified by the handle
+ */
+
+int
+evrpc_remove_hook(void *vbase, enum EVRPC_HOOK_TYPE hook_type, void *handle)
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_hook_list *head = NULL;
+ switch (hook_type) {
+ case EVRPC_INPUT:
+ head = &base->in_hooks;
+ break;
+ case EVRPC_OUTPUT:
+ head = &base->out_hooks;
+ break;
+ default:
+ EVUTIL_ASSERT(hook_type == EVRPC_INPUT || hook_type == EVRPC_OUTPUT);
+ }
+
+ return (evrpc_remove_hook_internal(head, handle));
+}
+
+static int
+evrpc_process_hooks(struct evrpc_hook_list *head, void *ctx,
+ struct evhttp_request *req, struct evbuffer *evbuf)
+{
+ struct evrpc_hook *hook;
+ TAILQ_FOREACH(hook, head, next) {
+ int res = hook->process(ctx, req, evbuf, hook->process_arg);
+ if (res != EVRPC_CONTINUE)
+ return (res);
+ }
+
+ return (EVRPC_CONTINUE);
+}
+
+static void evrpc_pool_schedule(struct evrpc_pool *pool);
+static void evrpc_request_cb(struct evhttp_request *, void *);
+
+/*
+ * Registers a new RPC with the HTTP server. The evrpc object is expected
+ * to have been filled in via the EVRPC_REGISTER_OBJECT macro which in turn
+ * calls this function.
+ */
+
+static char *
+evrpc_construct_uri(const char *uri)
+{
+ char *constructed_uri;
+ size_t constructed_uri_len;
+
+ constructed_uri_len = strlen(EVRPC_URI_PREFIX) + strlen(uri) + 1;
+ if ((constructed_uri = mm_malloc(constructed_uri_len)) == NULL)
+ event_err(1, "%s: failed to register rpc at %s",
+ __func__, uri);
+ memcpy(constructed_uri, EVRPC_URI_PREFIX, strlen(EVRPC_URI_PREFIX));
+ memcpy(constructed_uri + strlen(EVRPC_URI_PREFIX), uri, strlen(uri));
+ constructed_uri[constructed_uri_len - 1] = '\0';
+
+ return (constructed_uri);
+}
+
+int
+evrpc_register_rpc(struct evrpc_base *base, struct evrpc *rpc,
+ void (*cb)(struct evrpc_req_generic *, void *), void *cb_arg)
+{
+ char *constructed_uri = evrpc_construct_uri(rpc->uri);
+
+ rpc->base = base;
+ rpc->cb = cb;
+ rpc->cb_arg = cb_arg;
+
+ TAILQ_INSERT_TAIL(&base->registered_rpcs, rpc, next);
+
+ evhttp_set_cb(base->http_server,
+ constructed_uri,
+ evrpc_request_cb,
+ rpc);
+
+ mm_free(constructed_uri);
+
+ return (0);
+}
+
+int
+evrpc_unregister_rpc(struct evrpc_base *base, const char *name)
+{
+ char *registered_uri = NULL;
+ struct evrpc *rpc;
+ int r;
+
+ /* find the right rpc; linear search might be slow */
+ TAILQ_FOREACH(rpc, &base->registered_rpcs, next) {
+ if (strcmp(rpc->uri, name) == 0)
+ break;
+ }
+ if (rpc == NULL) {
+ /* We did not find an RPC with this name */
+ return (-1);
+ }
+ TAILQ_REMOVE(&base->registered_rpcs, rpc, next);
+
+ registered_uri = evrpc_construct_uri(name);
+
+ /* remove the http server callback */
+ r = evhttp_del_cb(base->http_server, registered_uri);
+ EVUTIL_ASSERT(r == 0);
+
+ mm_free(registered_uri);
+
+ mm_free((char *)rpc->uri);
+ mm_free(rpc);
+ return (0);
+}
+
+static int evrpc_pause_request(void *vbase, void *ctx,
+ void (*cb)(void *, enum EVRPC_HOOK_RESULT));
+static void evrpc_request_cb_closure(void *, enum EVRPC_HOOK_RESULT);
+
+static void
+evrpc_request_cb(struct evhttp_request *req, void *arg)
+{
+ struct evrpc *rpc = arg;
+ struct evrpc_req_generic *rpc_state = NULL;
+
+ /* let's verify the outside parameters */
+ if (req->type != EVHTTP_REQ_POST ||
+ evbuffer_get_length(req->input_buffer) <= 0)
+ goto error;
+
+ rpc_state = mm_calloc(1, sizeof(struct evrpc_req_generic));
+ if (rpc_state == NULL)
+ goto error;
+ rpc_state->rpc = rpc;
+ rpc_state->http_req = req;
+ rpc_state->rpc_data = NULL;
+
+ if (TAILQ_FIRST(&rpc->base->input_hooks) != NULL) {
+ int hook_res;
+
+ evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon);
+
+ /*
+ * allow hooks to modify the outgoing request
+ */
+ hook_res = evrpc_process_hooks(&rpc->base->input_hooks,
+ rpc_state, req, req->input_buffer);
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ goto error;
+ case EVRPC_PAUSE:
+ evrpc_pause_request(rpc->base, rpc_state,
+ evrpc_request_cb_closure);
+ return;
+ case EVRPC_CONTINUE:
+ break;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_request_cb_closure(rpc_state, EVRPC_CONTINUE);
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+static void
+evrpc_request_cb_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_req_generic *rpc_state = arg;
+ struct evrpc *rpc;
+ struct evhttp_request *req;
+
+ EVUTIL_ASSERT(rpc_state);
+ rpc = rpc_state->rpc;
+ req = rpc_state->http_req;
+
+ if (hook_res == EVRPC_TERMINATE)
+ goto error;
+
+ /* let's check that we can parse the request */
+ rpc_state->request = rpc->request_new(rpc->request_new_arg);
+ if (rpc_state->request == NULL)
+ goto error;
+
+ if (rpc->request_unmarshal(
+ rpc_state->request, req->input_buffer) == -1) {
+ /* we failed to parse the request; that's a bummer */
+ goto error;
+ }
+
+ /* at this point, we have a well formed request, prepare the reply */
+
+ rpc_state->reply = rpc->reply_new(rpc->reply_new_arg);
+ if (rpc_state->reply == NULL)
+ goto error;
+
+ /* give the rpc to the user; they can deal with it */
+ rpc->cb(rpc_state, rpc->cb_arg);
+
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+
+void
+evrpc_reqstate_free_(struct evrpc_req_generic* rpc_state)
+{
+ struct evrpc *rpc;
+ EVUTIL_ASSERT(rpc_state != NULL);
+ rpc = rpc_state->rpc;
+
+ /* clean up all memory */
+ if (rpc_state->hook_meta != NULL)
+ evrpc_hook_context_free_(rpc_state->hook_meta);
+ if (rpc_state->request != NULL)
+ rpc->request_free(rpc_state->request);
+ if (rpc_state->reply != NULL)
+ rpc->reply_free(rpc_state->reply);
+ if (rpc_state->rpc_data != NULL)
+ evbuffer_free(rpc_state->rpc_data);
+ mm_free(rpc_state);
+}
+
+static void
+evrpc_request_done_closure(void *, enum EVRPC_HOOK_RESULT);
+
+void
+evrpc_request_done(struct evrpc_req_generic *rpc_state)
+{
+ struct evhttp_request *req;
+ struct evrpc *rpc;
+
+ EVUTIL_ASSERT(rpc_state);
+
+ req = rpc_state->http_req;
+ rpc = rpc_state->rpc;
+
+ if (rpc->reply_complete(rpc_state->reply) == -1) {
+ /* the reply was not completely filled in. error out */
+ goto error;
+ }
+
+ if ((rpc_state->rpc_data = evbuffer_new()) == NULL) {
+ /* out of memory */
+ goto error;
+ }
+
+ /* serialize the reply */
+ rpc->reply_marshal(rpc_state->rpc_data, rpc_state->reply);
+
+ if (TAILQ_FIRST(&rpc->base->output_hooks) != NULL) {
+ int hook_res;
+
+ evrpc_hook_associate_meta_(&rpc_state->hook_meta, req->evcon);
+
+ /* do hook based tweaks to the request */
+ hook_res = evrpc_process_hooks(&rpc->base->output_hooks,
+ rpc_state, req, rpc_state->rpc_data);
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ goto error;
+ case EVRPC_PAUSE:
+ if (evrpc_pause_request(rpc->base, rpc_state,
+ evrpc_request_done_closure) == -1)
+ goto error;
+ return;
+ case EVRPC_CONTINUE:
+ break;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_request_done_closure(rpc_state, EVRPC_CONTINUE);
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+void *
+evrpc_get_request(struct evrpc_req_generic *req)
+{
+ return req->request;
+}
+
+void *
+evrpc_get_reply(struct evrpc_req_generic *req)
+{
+ return req->reply;
+}
+
+static void
+evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_req_generic *rpc_state = arg;
+ struct evhttp_request *req;
+ EVUTIL_ASSERT(rpc_state);
+ req = rpc_state->http_req;
+
+ if (hook_res == EVRPC_TERMINATE)
+ goto error;
+
+ /* on success, we are going to transmit marshaled binary data */
+ if (evhttp_find_header(req->output_headers, "Content-Type") == NULL) {
+ evhttp_add_header(req->output_headers,
+ "Content-Type", "application/octet-stream");
+ }
+ evhttp_send_reply(req, HTTP_OK, "OK", rpc_state->rpc_data);
+
+ evrpc_reqstate_free_(rpc_state);
+
+ return;
+
+error:
+ evrpc_reqstate_free_(rpc_state);
+ evhttp_send_error(req, HTTP_SERVUNAVAIL, NULL);
+ return;
+}
+
+
+/* Client implementation of RPC site */
+
+static int evrpc_schedule_request(struct evhttp_connection *connection,
+ struct evrpc_request_wrapper *ctx);
+
+struct evrpc_pool *
+evrpc_pool_new(struct event_base *base)
+{
+ struct evrpc_pool *pool = mm_calloc(1, sizeof(struct evrpc_pool));
+ if (pool == NULL)
+ return (NULL);
+
+ TAILQ_INIT(&pool->connections);
+ TAILQ_INIT(&pool->requests);
+
+ TAILQ_INIT(&pool->paused_requests);
+
+ TAILQ_INIT(&pool->input_hooks);
+ TAILQ_INIT(&pool->output_hooks);
+
+ pool->base = base;
+ pool->timeout = -1;
+
+ return (pool);
+}
+
+static void
+evrpc_request_wrapper_free(struct evrpc_request_wrapper *request)
+{
+ if (request->hook_meta != NULL)
+ evrpc_hook_context_free_(request->hook_meta);
+ mm_free(request->name);
+ mm_free(request);
+}
+
+void
+evrpc_pool_free(struct evrpc_pool *pool)
+{
+ struct evhttp_connection *connection;
+ struct evrpc_request_wrapper *request;
+ struct evrpc_hook_ctx *pause;
+ struct evrpc_hook *hook;
+ int r;
+
+ while ((request = TAILQ_FIRST(&pool->requests)) != NULL) {
+ TAILQ_REMOVE(&pool->requests, request, next);
+ evrpc_request_wrapper_free(request);
+ }
+
+ while ((pause = TAILQ_FIRST(&pool->paused_requests)) != NULL) {
+ TAILQ_REMOVE(&pool->paused_requests, pause, next);
+ mm_free(pause);
+ }
+
+ while ((connection = TAILQ_FIRST(&pool->connections)) != NULL) {
+ TAILQ_REMOVE(&pool->connections, connection, next);
+ evhttp_connection_free(connection);
+ }
+
+ while ((hook = TAILQ_FIRST(&pool->input_hooks)) != NULL) {
+ r = evrpc_remove_hook(pool, EVRPC_INPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+
+ while ((hook = TAILQ_FIRST(&pool->output_hooks)) != NULL) {
+ r = evrpc_remove_hook(pool, EVRPC_OUTPUT, hook);
+ EVUTIL_ASSERT(r);
+ }
+
+ mm_free(pool);
+}
+
+/*
+ * Add a connection to the RPC pool. A request scheduled on the pool
+ * may use any available connection.
+ */
+
+void
+evrpc_pool_add_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *connection)
+{
+ EVUTIL_ASSERT(connection->http_server == NULL);
+ TAILQ_INSERT_TAIL(&pool->connections, connection, next);
+
+ /*
+ * associate an event base with this connection
+ */
+ if (pool->base != NULL)
+ evhttp_connection_set_base(connection, pool->base);
+
+ /*
+ * unless a timeout was specifically set for a connection,
+ * the connection inherits the timeout from the pool.
+ */
+ if (!evutil_timerisset(&connection->timeout))
+ evhttp_connection_set_timeout(connection, pool->timeout);
+
+ /*
+ * if we have any requests pending, schedule them with the new
+ * connections.
+ */
+
+ if (TAILQ_FIRST(&pool->requests) != NULL) {
+ struct evrpc_request_wrapper *request =
+ TAILQ_FIRST(&pool->requests);
+ TAILQ_REMOVE(&pool->requests, request, next);
+ evrpc_schedule_request(connection, request);
+ }
+}
+
+void
+evrpc_pool_remove_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *connection)
+{
+ TAILQ_REMOVE(&pool->connections, connection, next);
+}
+
+void
+evrpc_pool_set_timeout(struct evrpc_pool *pool, int timeout_in_secs)
+{
+ struct evhttp_connection *evcon;
+ TAILQ_FOREACH(evcon, &pool->connections, next) {
+ evhttp_connection_set_timeout(evcon, timeout_in_secs);
+ }
+ pool->timeout = timeout_in_secs;
+}
+
+
+static void evrpc_reply_done(struct evhttp_request *, void *);
+static void evrpc_request_timeout(evutil_socket_t, short, void *);
+
+/*
+ * Finds a connection object associated with the pool that is currently
+ * idle and can be used to make a request.
+ */
+static struct evhttp_connection *
+evrpc_pool_find_connection(struct evrpc_pool *pool)
+{
+ struct evhttp_connection *connection;
+ TAILQ_FOREACH(connection, &pool->connections, next) {
+ if (TAILQ_FIRST(&connection->requests) == NULL)
+ return (connection);
+ }
+
+ return (NULL);
+}
+
+/*
+ * Prototypes responsible for evrpc scheduling and hooking
+ */
+
+static void evrpc_schedule_request_closure(void *ctx, enum EVRPC_HOOK_RESULT);
+
+/*
+ * We assume that the ctx is no longer queued on the pool.
+ */
+static int
+evrpc_schedule_request(struct evhttp_connection *connection,
+ struct evrpc_request_wrapper *ctx)
+{
+ struct evhttp_request *req = NULL;
+ struct evrpc_pool *pool = ctx->pool;
+ struct evrpc_status status;
+
+ if ((req = evhttp_request_new(evrpc_reply_done, ctx)) == NULL)
+ goto error;
+
+ /* serialize the request data into the output buffer */
+ ctx->request_marshal(req->output_buffer, ctx->request);
+
+ /* we need to know the connection that we might have to abort */
+ ctx->evcon = connection;
+
+ /* if we get paused we also need to know the request */
+ ctx->req = req;
+
+ if (TAILQ_FIRST(&pool->output_hooks) != NULL) {
+ int hook_res;
+
+ evrpc_hook_associate_meta_(&ctx->hook_meta, connection);
+
+ /* apply hooks to the outgoing request */
+ hook_res = evrpc_process_hooks(&pool->output_hooks,
+ ctx, req, req->output_buffer);
+
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ goto error;
+ case EVRPC_PAUSE:
+ /* we need to be explicitly resumed */
+ if (evrpc_pause_request(pool, ctx,
+ evrpc_schedule_request_closure) == -1)
+ goto error;
+ return (0);
+ case EVRPC_CONTINUE:
+ /* we can just continue */
+ break;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_schedule_request_closure(ctx, EVRPC_CONTINUE);
+ return (0);
+
+error:
+ memset(&status, 0, sizeof(status));
+ status.error = EVRPC_STATUS_ERR_UNSTARTED;
+ (*ctx->cb)(&status, ctx->request, ctx->reply, ctx->cb_arg);
+ evrpc_request_wrapper_free(ctx);
+ return (-1);
+}
+
+static void
+evrpc_schedule_request_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evhttp_connection *connection = ctx->evcon;
+ struct evhttp_request *req = ctx->req;
+ struct evrpc_pool *pool = ctx->pool;
+ struct evrpc_status status;
+ char *uri = NULL;
+ int res = 0;
+
+ if (hook_res == EVRPC_TERMINATE)
+ goto error;
+
+ uri = evrpc_construct_uri(ctx->name);
+ if (uri == NULL)
+ goto error;
+
+ if (pool->timeout > 0) {
+ /*
+ * a timeout after which the whole rpc is going to be aborted.
+ */
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_sec = pool->timeout;
+ evtimer_add(&ctx->ev_timeout, &tv);
+ }
+
+ /* start the request over the connection */
+ res = evhttp_make_request(connection, req, EVHTTP_REQ_POST, uri);
+ mm_free(uri);
+
+ if (res == -1)
+ goto error;
+
+ return;
+
+error:
+ memset(&status, 0, sizeof(status));
+ status.error = EVRPC_STATUS_ERR_UNSTARTED;
+ (*ctx->cb)(&status, ctx->request, ctx->reply, ctx->cb_arg);
+ evrpc_request_wrapper_free(ctx);
+}
+
+/* we just queue the paused request on the pool under the req object */
+static int
+evrpc_pause_request(void *vbase, void *ctx,
+ void (*cb)(void *, enum EVRPC_HOOK_RESULT))
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_hook_ctx *pause = mm_malloc(sizeof(*pause));
+ if (pause == NULL)
+ return (-1);
+
+ pause->ctx = ctx;
+ pause->cb = cb;
+
+ TAILQ_INSERT_TAIL(&base->pause_requests, pause, next);
+ return (0);
+}
+
+int
+evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res)
+{
+ struct evrpc_hooks_ *base = vbase;
+ struct evrpc_pause_list *head = &base->pause_requests;
+ struct evrpc_hook_ctx *pause;
+
+ TAILQ_FOREACH(pause, head, next) {
+ if (pause->ctx == ctx)
+ break;
+ }
+
+ if (pause == NULL)
+ return (-1);
+
+ (*pause->cb)(pause->ctx, res);
+ TAILQ_REMOVE(head, pause, next);
+ mm_free(pause);
+ return (0);
+}
+
+int
+evrpc_make_request(struct evrpc_request_wrapper *ctx)
+{
+ struct evrpc_pool *pool = ctx->pool;
+
+ /* initialize the event structure for this rpc */
+ evtimer_assign(&ctx->ev_timeout, pool->base, evrpc_request_timeout, ctx);
+
+ /* we better have some available connections on the pool */
+ EVUTIL_ASSERT(TAILQ_FIRST(&pool->connections) != NULL);
+
+ /*
+ * if no connection is available, we queue the request on the pool,
+ * the next time a connection is empty, the rpc will be send on that.
+ */
+ TAILQ_INSERT_TAIL(&pool->requests, ctx, next);
+
+ evrpc_pool_schedule(pool);
+
+ return (0);
+}
+
+
+struct evrpc_request_wrapper *
+evrpc_make_request_ctx(
+ struct evrpc_pool *pool, void *request, void *reply,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer*, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *),
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cbarg)
+{
+ struct evrpc_request_wrapper *ctx = (struct evrpc_request_wrapper *)
+ mm_malloc(sizeof(struct evrpc_request_wrapper));
+ if (ctx == NULL)
+ return (NULL);
+
+ ctx->pool = pool;
+ ctx->hook_meta = NULL;
+ ctx->evcon = NULL;
+ ctx->name = mm_strdup(rpcname);
+ if (ctx->name == NULL) {
+ mm_free(ctx);
+ return (NULL);
+ }
+ ctx->cb = cb;
+ ctx->cb_arg = cbarg;
+ ctx->request = request;
+ ctx->reply = reply;
+ ctx->request_marshal = req_marshal;
+ ctx->reply_clear = rpl_clear;
+ ctx->reply_unmarshal = rpl_unmarshal;
+
+ return (ctx);
+}
+
+static void
+evrpc_reply_done_closure(void *, enum EVRPC_HOOK_RESULT);
+
+static void
+evrpc_reply_done(struct evhttp_request *req, void *arg)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evrpc_pool *pool = ctx->pool;
+ int hook_res = EVRPC_CONTINUE;
+
+ /* cancel any timeout we might have scheduled */
+ event_del(&ctx->ev_timeout);
+
+ ctx->req = req;
+
+ /* we need to get the reply now */
+ if (req == NULL) {
+ evrpc_reply_done_closure(ctx, EVRPC_CONTINUE);
+ return;
+ }
+
+ if (TAILQ_FIRST(&pool->input_hooks) != NULL) {
+ evrpc_hook_associate_meta_(&ctx->hook_meta, ctx->evcon);
+
+ /* apply hooks to the incoming request */
+ hook_res = evrpc_process_hooks(&pool->input_hooks,
+ ctx, req, req->input_buffer);
+
+ switch (hook_res) {
+ case EVRPC_TERMINATE:
+ case EVRPC_CONTINUE:
+ break;
+ case EVRPC_PAUSE:
+ /*
+ * if we get paused we also need to know the
+ * request. unfortunately, the underlying
+ * layer is going to free it. we need to
+ * request ownership explicitly
+ */
+ if (req != NULL)
+ evhttp_request_own(req);
+
+ evrpc_pause_request(pool, ctx,
+ evrpc_reply_done_closure);
+ return;
+ default:
+ EVUTIL_ASSERT(hook_res == EVRPC_TERMINATE ||
+ hook_res == EVRPC_CONTINUE ||
+ hook_res == EVRPC_PAUSE);
+ }
+ }
+
+ evrpc_reply_done_closure(ctx, hook_res);
+
+ /* http request is being freed by underlying layer */
+}
+
+static void
+evrpc_reply_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evhttp_request *req = ctx->req;
+ struct evrpc_pool *pool = ctx->pool;
+ struct evrpc_status status;
+ int res = -1;
+
+ memset(&status, 0, sizeof(status));
+ status.http_req = req;
+
+ /* we need to get the reply now */
+ if (req == NULL) {
+ status.error = EVRPC_STATUS_ERR_TIMEOUT;
+ } else if (hook_res == EVRPC_TERMINATE) {
+ status.error = EVRPC_STATUS_ERR_HOOKABORTED;
+ } else {
+ res = ctx->reply_unmarshal(ctx->reply, req->input_buffer);
+ if (res == -1)
+ status.error = EVRPC_STATUS_ERR_BADPAYLOAD;
+ }
+
+ if (res == -1) {
+ /* clear everything that we might have written previously */
+ ctx->reply_clear(ctx->reply);
+ }
+
+ (*ctx->cb)(&status, ctx->request, ctx->reply, ctx->cb_arg);
+
+ evrpc_request_wrapper_free(ctx);
+
+ /* the http layer owned the original request structure, but if we
+ * got paused, we asked for ownership and need to free it here. */
+ if (req != NULL && evhttp_request_is_owned(req))
+ evhttp_request_free(req);
+
+ /* see if we can schedule another request */
+ evrpc_pool_schedule(pool);
+}
+
+static void
+evrpc_pool_schedule(struct evrpc_pool *pool)
+{
+ struct evrpc_request_wrapper *ctx = TAILQ_FIRST(&pool->requests);
+ struct evhttp_connection *evcon;
+
+ /* if no requests are pending, we have no work */
+ if (ctx == NULL)
+ return;
+
+ if ((evcon = evrpc_pool_find_connection(pool)) != NULL) {
+ TAILQ_REMOVE(&pool->requests, ctx, next);
+ evrpc_schedule_request(evcon, ctx);
+ }
+}
+
+static void
+evrpc_request_timeout(evutil_socket_t fd, short what, void *arg)
+{
+ struct evrpc_request_wrapper *ctx = arg;
+ struct evhttp_connection *evcon = ctx->evcon;
+ EVUTIL_ASSERT(evcon != NULL);
+
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_TIMEOUT);
+}
+
+/*
+ * frees potential meta data associated with a request.
+ */
+
+static void
+evrpc_meta_data_free(struct evrpc_meta_list *meta_data)
+{
+ struct evrpc_meta *entry;
+ EVUTIL_ASSERT(meta_data != NULL);
+
+ while ((entry = TAILQ_FIRST(meta_data)) != NULL) {
+ TAILQ_REMOVE(meta_data, entry, next);
+ mm_free(entry->key);
+ mm_free(entry->data);
+ mm_free(entry);
+ }
+}
+
+static struct evrpc_hook_meta *
+evrpc_hook_meta_new_(void)
+{
+ struct evrpc_hook_meta *ctx;
+ ctx = mm_malloc(sizeof(struct evrpc_hook_meta));
+ EVUTIL_ASSERT(ctx != NULL);
+
+ TAILQ_INIT(&ctx->meta_data);
+ ctx->evcon = NULL;
+
+ return (ctx);
+}
+
+static void
+evrpc_hook_associate_meta_(struct evrpc_hook_meta **pctx,
+ struct evhttp_connection *evcon)
+{
+ struct evrpc_hook_meta *ctx = *pctx;
+ if (ctx == NULL)
+ *pctx = ctx = evrpc_hook_meta_new_();
+ ctx->evcon = evcon;
+}
+
+static void
+evrpc_hook_context_free_(struct evrpc_hook_meta *ctx)
+{
+ evrpc_meta_data_free(&ctx->meta_data);
+ mm_free(ctx);
+}
+
+/* Adds meta data */
+void
+evrpc_hook_add_meta(void *ctx, const char *key,
+ const void *data, size_t data_size)
+{
+ struct evrpc_request_wrapper *req = ctx;
+ struct evrpc_hook_meta *store = NULL;
+ struct evrpc_meta *meta = NULL;
+
+ if ((store = req->hook_meta) == NULL)
+ store = req->hook_meta = evrpc_hook_meta_new_();
+
+ meta = mm_malloc(sizeof(struct evrpc_meta));
+ EVUTIL_ASSERT(meta != NULL);
+ meta->key = mm_strdup(key);
+ EVUTIL_ASSERT(meta->key != NULL);
+ meta->data_size = data_size;
+ meta->data = mm_malloc(data_size);
+ EVUTIL_ASSERT(meta->data != NULL);
+ memcpy(meta->data, data, data_size);
+
+ TAILQ_INSERT_TAIL(&store->meta_data, meta, next);
+}
+
+int
+evrpc_hook_find_meta(void *ctx, const char *key, void **data, size_t *data_size)
+{
+ struct evrpc_request_wrapper *req = ctx;
+ struct evrpc_meta *meta = NULL;
+
+ if (req->hook_meta == NULL)
+ return (-1);
+
+ TAILQ_FOREACH(meta, &req->hook_meta->meta_data, next) {
+ if (strcmp(meta->key, key) == 0) {
+ *data = meta->data;
+ *data_size = meta->data_size;
+ return (0);
+ }
+ }
+
+ return (-1);
+}
+
+struct evhttp_connection *
+evrpc_hook_get_connection(void *ctx)
+{
+ struct evrpc_request_wrapper *req = ctx;
+ return (req->hook_meta != NULL ? req->hook_meta->evcon : NULL);
+}
+
+int
+evrpc_send_request_generic(struct evrpc_pool *pool,
+ void *request, void *reply,
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cb_arg,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer *, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *))
+{
+ struct evrpc_status status;
+ struct evrpc_request_wrapper *ctx;
+ ctx = evrpc_make_request_ctx(pool, request, reply,
+ rpcname, req_marshal, rpl_clear, rpl_unmarshal, cb, cb_arg);
+ if (ctx == NULL)
+ goto error;
+ return (evrpc_make_request(ctx));
+error:
+ memset(&status, 0, sizeof(status));
+ status.error = EVRPC_STATUS_ERR_UNSTARTED;
+ (*(cb))(&status, request, reply, cb_arg);
+ return (-1);
+}
+
+/** Takes a request object and fills it in with the right magic */
+static struct evrpc *
+evrpc_register_object(const char *name,
+ void *(*req_new)(void*), void *req_new_arg, void (*req_free)(void *),
+ int (*req_unmarshal)(void *, struct evbuffer *),
+ void *(*rpl_new)(void*), void *rpl_new_arg, void (*rpl_free)(void *),
+ int (*rpl_complete)(void *),
+ void (*rpl_marshal)(struct evbuffer *, void *))
+{
+ struct evrpc* rpc = (struct evrpc *)mm_calloc(1, sizeof(struct evrpc));
+ if (rpc == NULL)
+ return (NULL);
+ rpc->uri = mm_strdup(name);
+ if (rpc->uri == NULL) {
+ mm_free(rpc);
+ return (NULL);
+ }
+ rpc->request_new = req_new;
+ rpc->request_new_arg = req_new_arg;
+ rpc->request_free = req_free;
+ rpc->request_unmarshal = req_unmarshal;
+ rpc->reply_new = rpl_new;
+ rpc->reply_new_arg = rpl_new_arg;
+ rpc->reply_free = rpl_free;
+ rpc->reply_complete = rpl_complete;
+ rpc->reply_marshal = rpl_marshal;
+ return (rpc);
+}
+
+int
+evrpc_register_generic(struct evrpc_base *base, const char *name,
+ void (*callback)(struct evrpc_req_generic *, void *), void *cbarg,
+ void *(*req_new)(void *), void *req_new_arg, void (*req_free)(void *),
+ int (*req_unmarshal)(void *, struct evbuffer *),
+ void *(*rpl_new)(void *), void *rpl_new_arg, void (*rpl_free)(void *),
+ int (*rpl_complete)(void *),
+ void (*rpl_marshal)(struct evbuffer *, void *))
+{
+ struct evrpc* rpc =
+ evrpc_register_object(name, req_new, req_new_arg, req_free, req_unmarshal,
+ rpl_new, rpl_new_arg, rpl_free, rpl_complete, rpl_marshal);
+ if (rpc == NULL)
+ return (-1);
+ evrpc_register_rpc(base, rpc,
+ (void (*)(struct evrpc_req_generic*, void *))callback, cbarg);
+ return (0);
+}
+
+/** accessors for obscure and undocumented functionality */
+struct evrpc_pool *
+evrpc_request_get_pool(struct evrpc_request_wrapper *ctx)
+{
+ return (ctx->pool);
+}
+
+void
+evrpc_request_set_pool(struct evrpc_request_wrapper *ctx,
+ struct evrpc_pool *pool)
+{
+ ctx->pool = pool;
+}
+
+void
+evrpc_request_set_cb(struct evrpc_request_wrapper *ctx,
+ void (*cb)(struct evrpc_status*, void *request, void *reply, void *arg),
+ void *cb_arg)
+{
+ ctx->cb = cb;
+ ctx->cb_arg = cb_arg;
+}
diff --git a/sntp/libevent/evsignal-internal.h b/sntp/libevent/evsignal-internal.h
new file mode 100644
index 0000000..5cff03b
--- /dev/null
+++ b/sntp/libevent/evsignal-internal.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVSIGNAL_INTERNAL_H_INCLUDED_
+#define EVSIGNAL_INTERNAL_H_INCLUDED_
+
+#ifndef evutil_socket_t
+#include "event2/util.h"
+#endif
+#include <signal.h>
+
+typedef void (*ev_sighandler_t)(int);
+
+/* Data structure for the default signal-handling implementation in signal.c
+ */
+struct evsig_info {
+ /* Event watching ev_signal_pair[1] */
+ struct event ev_signal;
+ /* Socketpair used to send notifications from the signal handler */
+ evutil_socket_t ev_signal_pair[2];
+ /* True iff we've added the ev_signal event yet. */
+ int ev_signal_added;
+ /* Count of the number of signals we're currently watching. */
+ int ev_n_signals_added;
+
+ /* Array of previous signal handler objects before Libevent started
+ * messing with them. Used to restore old signal handlers. */
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction **sh_old;
+#else
+ ev_sighandler_t **sh_old;
+#endif
+ /* Size of sh_old. */
+ int sh_old_max;
+};
+int evsig_init_(struct event_base *);
+void evsig_dealloc_(struct event_base *);
+
+void evsig_set_base_(struct event_base *base);
+void evsig_free_globals_(void);
+
+#endif /* EVSIGNAL_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/evthread-internal.h b/sntp/libevent/evthread-internal.h
new file mode 100644
index 0000000..346b2bb
--- /dev/null
+++ b/sntp/libevent/evthread-internal.h
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVTHREAD_INTERNAL_H_INCLUDED_
+#define EVTHREAD_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include "event2/thread.h"
+#include "util-internal.h"
+
+struct event_base;
+
+#ifndef _WIN32
+/* On Windows, the way we currently make DLLs, it's not allowed for us to
+ * have shared global structures. Thus, we only do the direct-call-to-function
+ * code path if we know that the local shared library system supports it.
+ */
+#define EVTHREAD_EXPOSE_STRUCTS
+#endif
+
+#if ! defined(EVENT__DISABLE_THREAD_SUPPORT) && defined(EVTHREAD_EXPOSE_STRUCTS)
+/* Global function pointers to lock-related functions. NULL if locking isn't
+ enabled. */
+extern struct evthread_lock_callbacks evthread_lock_fns_;
+extern struct evthread_condition_callbacks evthread_cond_fns_;
+extern unsigned long (*evthread_id_fn_)(void);
+extern int evthread_lock_debugging_enabled_;
+
+/** Return the ID of the current thread, or 1 if threading isn't enabled. */
+#define EVTHREAD_GET_ID() \
+ (evthread_id_fn_ ? evthread_id_fn_() : 1)
+
+/** Return true iff we're in the thread that is currently (or most recently)
+ * running a given event_base's loop. Requires lock. */
+#define EVBASE_IN_THREAD(base) \
+ (evthread_id_fn_ == NULL || \
+ (base)->th_owner_id == evthread_id_fn_())
+
+/** Return true iff we need to notify the base's main thread about changes to
+ * its state, because it's currently running the main loop in another
+ * thread. Requires lock. */
+#define EVBASE_NEED_NOTIFY(base) \
+ (evthread_id_fn_ != NULL && \
+ (base)->running_loop && \
+ (base)->th_owner_id != evthread_id_fn_())
+
+/** Allocate a new lock, and store it in lockvar, a void*. Sets lockvar to
+ NULL if locking is not enabled. */
+#define EVTHREAD_ALLOC_LOCK(lockvar, locktype) \
+ ((lockvar) = evthread_lock_fns_.alloc ? \
+ evthread_lock_fns_.alloc(locktype) : NULL)
+
+/** Free a given lock, if it is present and locking is enabled. */
+#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
+ do { \
+ void *lock_tmp_ = (lockvar); \
+ if (lock_tmp_ && evthread_lock_fns_.free) \
+ evthread_lock_fns_.free(lock_tmp_, (locktype)); \
+ } while (0)
+
+/** Acquire a lock. */
+#define EVLOCK_LOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthread_lock_fns_.lock(mode, lockvar); \
+ } while (0)
+
+/** Release a lock */
+#define EVLOCK_UNLOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthread_lock_fns_.unlock(mode, lockvar); \
+ } while (0)
+
+/** Helper: put lockvar1 and lockvar2 into pointerwise ascending order. */
+#define EVLOCK_SORTLOCKS_(lockvar1, lockvar2) \
+ do { \
+ if (lockvar1 && lockvar2 && lockvar1 > lockvar2) { \
+ void *tmp = lockvar1; \
+ lockvar1 = lockvar2; \
+ lockvar2 = tmp; \
+ } \
+ } while (0)
+
+/** Lock an event_base, if it is set up for locking. Acquires the lock
+ in the base structure whose field is named 'lockvar'. */
+#define EVBASE_ACQUIRE_LOCK(base, lockvar) do { \
+ EVLOCK_LOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** Unlock an event_base, if it is set up for locking. */
+#define EVBASE_RELEASE_LOCK(base, lockvar) do { \
+ EVLOCK_UNLOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
+ * locked and held by us. */
+#define EVLOCK_ASSERT_LOCKED(lock) \
+ do { \
+ if ((lock) && evthread_lock_debugging_enabled_) { \
+ EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
+ } \
+ } while (0)
+
+/** Try to grab the lock for 'lockvar' without blocking, and return 1 if we
+ * manage to get it. */
+static inline int EVLOCK_TRY_LOCK_(void *lock);
+static inline int
+EVLOCK_TRY_LOCK_(void *lock)
+{
+ if (lock && evthread_lock_fns_.lock) {
+ int r = evthread_lock_fns_.lock(EVTHREAD_TRY, lock);
+ return !r;
+ } else {
+ /* Locking is disabled either globally or for this thing;
+ * of course we count as having the lock. */
+ return 1;
+ }
+}
+
+/** Allocate a new condition variable and store it in the void *, condvar */
+#define EVTHREAD_ALLOC_COND(condvar) \
+ do { \
+ (condvar) = evthread_cond_fns_.alloc_condition ? \
+ evthread_cond_fns_.alloc_condition(0) : NULL; \
+ } while (0)
+/** Deallocate and free a condition variable in condvar */
+#define EVTHREAD_FREE_COND(cond) \
+ do { \
+ if (cond) \
+ evthread_cond_fns_.free_condition((cond)); \
+ } while (0)
+/** Signal one thread waiting on cond */
+#define EVTHREAD_COND_SIGNAL(cond) \
+ ( (cond) ? evthread_cond_fns_.signal_condition((cond), 0) : 0 )
+/** Signal all threads waiting on cond */
+#define EVTHREAD_COND_BROADCAST(cond) \
+ ( (cond) ? evthread_cond_fns_.signal_condition((cond), 1) : 0 )
+/** Wait until the condition 'cond' is signalled. Must be called while
+ * holding 'lock'. The lock will be released until the condition is
+ * signalled, at which point it will be acquired again. Returns 0 for
+ * success, -1 for failure. */
+#define EVTHREAD_COND_WAIT(cond, lock) \
+ ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), NULL) : 0 )
+/** As EVTHREAD_COND_WAIT, but gives up after 'tv' has elapsed. Returns 1
+ * on timeout. */
+#define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \
+ ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), (tv)) : 0 )
+
+/** True iff locking functions have been configured. */
+#define EVTHREAD_LOCKING_ENABLED() \
+ (evthread_lock_fns_.lock != NULL)
+
+#elif ! defined(EVENT__DISABLE_THREAD_SUPPORT)
+
+unsigned long evthreadimpl_get_id_(void);
+int evthreadimpl_is_lock_debugging_enabled_(void);
+void *evthreadimpl_lock_alloc_(unsigned locktype);
+void evthreadimpl_lock_free_(void *lock, unsigned locktype);
+int evthreadimpl_lock_lock_(unsigned mode, void *lock);
+int evthreadimpl_lock_unlock_(unsigned mode, void *lock);
+void *evthreadimpl_cond_alloc_(unsigned condtype);
+void evthreadimpl_cond_free_(void *cond);
+int evthreadimpl_cond_signal_(void *cond, int broadcast);
+int evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv);
+int evthreadimpl_locking_enabled_(void);
+
+#define EVTHREAD_GET_ID() evthreadimpl_get_id_()
+#define EVBASE_IN_THREAD(base) \
+ ((base)->th_owner_id == evthreadimpl_get_id_())
+#define EVBASE_NEED_NOTIFY(base) \
+ ((base)->running_loop && \
+ ((base)->th_owner_id != evthreadimpl_get_id_()))
+
+#define EVTHREAD_ALLOC_LOCK(lockvar, locktype) \
+ ((lockvar) = evthreadimpl_lock_alloc_(locktype))
+
+#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
+ do { \
+ void *lock_tmp_ = (lockvar); \
+ if (lock_tmp_) \
+ evthreadimpl_lock_free_(lock_tmp_, (locktype)); \
+ } while (0)
+
+/** Acquire a lock. */
+#define EVLOCK_LOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthreadimpl_lock_lock_(mode, lockvar); \
+ } while (0)
+
+/** Release a lock */
+#define EVLOCK_UNLOCK(lockvar,mode) \
+ do { \
+ if (lockvar) \
+ evthreadimpl_lock_unlock_(mode, lockvar); \
+ } while (0)
+
+/** Lock an event_base, if it is set up for locking. Acquires the lock
+ in the base structure whose field is named 'lockvar'. */
+#define EVBASE_ACQUIRE_LOCK(base, lockvar) do { \
+ EVLOCK_LOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** Unlock an event_base, if it is set up for locking. */
+#define EVBASE_RELEASE_LOCK(base, lockvar) do { \
+ EVLOCK_UNLOCK((base)->lockvar, 0); \
+ } while (0)
+
+/** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
+ * locked and held by us. */
+#define EVLOCK_ASSERT_LOCKED(lock) \
+ do { \
+ if ((lock) && evthreadimpl_is_lock_debugging_enabled_()) { \
+ EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
+ } \
+ } while (0)
+
+/** Try to grab the lock for 'lockvar' without blocking, and return 1 if we
+ * manage to get it. */
+static inline int EVLOCK_TRY_LOCK_(void *lock);
+static inline int
+EVLOCK_TRY_LOCK_(void *lock)
+{
+ if (lock) {
+ int r = evthreadimpl_lock_lock_(EVTHREAD_TRY, lock);
+ return !r;
+ } else {
+ /* Locking is disabled either globally or for this thing;
+ * of course we count as having the lock. */
+ return 1;
+ }
+}
+
+/** Allocate a new condition variable and store it in the void *, condvar */
+#define EVTHREAD_ALLOC_COND(condvar) \
+ do { \
+ (condvar) = evthreadimpl_cond_alloc_(0); \
+ } while (0)
+/** Deallocate and free a condition variable in condvar */
+#define EVTHREAD_FREE_COND(cond) \
+ do { \
+ if (cond) \
+ evthreadimpl_cond_free_((cond)); \
+ } while (0)
+/** Signal one thread waiting on cond */
+#define EVTHREAD_COND_SIGNAL(cond) \
+ ( (cond) ? evthreadimpl_cond_signal_((cond), 0) : 0 )
+/** Signal all threads waiting on cond */
+#define EVTHREAD_COND_BROADCAST(cond) \
+ ( (cond) ? evthreadimpl_cond_signal_((cond), 1) : 0 )
+/** Wait until the condition 'cond' is signalled. Must be called while
+ * holding 'lock'. The lock will be released until the condition is
+ * signalled, at which point it will be acquired again. Returns 0 for
+ * success, -1 for failure. */
+#define EVTHREAD_COND_WAIT(cond, lock) \
+ ( (cond) ? evthreadimpl_cond_wait_((cond), (lock), NULL) : 0 )
+/** As EVTHREAD_COND_WAIT, but gives up after 'tv' has elapsed. Returns 1
+ * on timeout. */
+#define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \
+ ( (cond) ? evthreadimpl_cond_wait_((cond), (lock), (tv)) : 0 )
+
+#define EVTHREAD_LOCKING_ENABLED() \
+ (evthreadimpl_locking_enabled_())
+
+#else /* EVENT__DISABLE_THREAD_SUPPORT */
+
+#define EVTHREAD_GET_ID() 1
+#define EVTHREAD_ALLOC_LOCK(lockvar, locktype) EVUTIL_NIL_STMT_
+#define EVTHREAD_FREE_LOCK(lockvar, locktype) EVUTIL_NIL_STMT_
+
+#define EVLOCK_LOCK(lockvar, mode) EVUTIL_NIL_STMT_
+#define EVLOCK_UNLOCK(lockvar, mode) EVUTIL_NIL_STMT_
+#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) EVUTIL_NIL_STMT_
+#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) EVUTIL_NIL_STMT_
+
+#define EVBASE_IN_THREAD(base) 1
+#define EVBASE_NEED_NOTIFY(base) 0
+#define EVBASE_ACQUIRE_LOCK(base, lock) EVUTIL_NIL_STMT_
+#define EVBASE_RELEASE_LOCK(base, lock) EVUTIL_NIL_STMT_
+#define EVLOCK_ASSERT_LOCKED(lock) EVUTIL_NIL_STMT_
+
+#define EVLOCK_TRY_LOCK_(lock) 1
+
+#define EVTHREAD_ALLOC_COND(condvar) EVUTIL_NIL_STMT_
+#define EVTHREAD_FREE_COND(cond) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_SIGNAL(cond) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_BROADCAST(cond) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_WAIT(cond, lock) EVUTIL_NIL_STMT_
+#define EVTHREAD_COND_WAIT_TIMED(cond, lock, howlong) EVUTIL_NIL_STMT_
+
+#define EVTHREAD_LOCKING_ENABLED() 0
+
+#endif
+
+/* This code is shared between both lock impls */
+#if ! defined(EVENT__DISABLE_THREAD_SUPPORT)
+/** Helper: put lockvar1 and lockvar2 into pointerwise ascending order. */
+#define EVLOCK_SORTLOCKS_(lockvar1, lockvar2) \
+ do { \
+ if (lockvar1 && lockvar2 && lockvar1 > lockvar2) { \
+ void *tmp = lockvar1; \
+ lockvar1 = lockvar2; \
+ lockvar2 = tmp; \
+ } \
+ } while (0)
+
+/** Acquire both lock1 and lock2. Always allocates locks in the same order,
+ * so that two threads locking two locks with LOCK2 will not deadlock. */
+#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) \
+ do { \
+ void *lock1_tmplock_ = (lock1); \
+ void *lock2_tmplock_ = (lock2); \
+ EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
+ EVLOCK_LOCK(lock1_tmplock_,mode1); \
+ if (lock2_tmplock_ != lock1_tmplock_) \
+ EVLOCK_LOCK(lock2_tmplock_,mode2); \
+ } while (0)
+/** Release both lock1 and lock2. */
+#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) \
+ do { \
+ void *lock1_tmplock_ = (lock1); \
+ void *lock2_tmplock_ = (lock2); \
+ EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
+ if (lock2_tmplock_ != lock1_tmplock_) \
+ EVLOCK_UNLOCK(lock2_tmplock_,mode2); \
+ EVLOCK_UNLOCK(lock1_tmplock_,mode1); \
+ } while (0)
+
+int evthread_is_debug_lock_held_(void *lock);
+void *evthread_debug_get_real_lock_(void *lock);
+
+void *evthread_setup_global_lock_(void *lock_, unsigned locktype,
+ int enable_locks);
+
+#define EVTHREAD_SETUP_GLOBAL_LOCK(lockvar, locktype) \
+ do { \
+ lockvar = evthread_setup_global_lock_(lockvar, \
+ (locktype), enable_locks); \
+ if (!lockvar) { \
+ event_warn("Couldn't allocate %s", #lockvar); \
+ return -1; \
+ } \
+ } while (0);
+
+int event_global_setup_locks_(const int enable_locks);
+int evsig_global_setup_locks_(const int enable_locks);
+int evutil_global_setup_locks_(const int enable_locks);
+int evutil_secure_rng_global_setup_locks_(const int enable_locks);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVTHREAD_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/evthread.c b/sntp/libevent/evthread.c
new file mode 100644
index 0000000..4da5d24
--- /dev/null
+++ b/sntp/libevent/evthread.c
@@ -0,0 +1,464 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos, Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+
+#include "event2/thread.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "evthread-internal.h"
+
+#ifdef EVTHREAD_EXPOSE_STRUCTS
+#define GLOBAL
+#else
+#define GLOBAL static
+#endif
+
+/* globals */
+GLOBAL int evthread_lock_debugging_enabled_ = 0;
+GLOBAL struct evthread_lock_callbacks evthread_lock_fns_ = {
+ 0, 0, NULL, NULL, NULL, NULL
+};
+GLOBAL unsigned long (*evthread_id_fn_)(void) = NULL;
+GLOBAL struct evthread_condition_callbacks evthread_cond_fns_ = {
+ 0, NULL, NULL, NULL, NULL
+};
+
+/* Used for debugging */
+static struct evthread_lock_callbacks original_lock_fns_ = {
+ 0, 0, NULL, NULL, NULL, NULL
+};
+static struct evthread_condition_callbacks original_cond_fns_ = {
+ 0, NULL, NULL, NULL, NULL
+};
+
+void
+evthread_set_id_callback(unsigned long (*id_fn)(void))
+{
+ evthread_id_fn_ = id_fn;
+}
+
+int
+evthread_set_lock_callbacks(const struct evthread_lock_callbacks *cbs)
+{
+ struct evthread_lock_callbacks *target =
+ evthread_lock_debugging_enabled_
+ ? &original_lock_fns_ : &evthread_lock_fns_;
+
+ if (!cbs) {
+ if (target->alloc)
+ event_warnx("Trying to disable lock functions after "
+ "they have been set up will probaby not work.");
+ memset(target, 0, sizeof(evthread_lock_fns_));
+ return 0;
+ }
+ if (target->alloc) {
+ /* Uh oh; we already had locking callbacks set up.*/
+ if (target->lock_api_version == cbs->lock_api_version &&
+ target->supported_locktypes == cbs->supported_locktypes &&
+ target->alloc == cbs->alloc &&
+ target->free == cbs->free &&
+ target->lock == cbs->lock &&
+ target->unlock == cbs->unlock) {
+ /* no change -- allow this. */
+ return 0;
+ }
+ event_warnx("Can't change lock callbacks once they have been "
+ "initialized.");
+ return -1;
+ }
+ if (cbs->alloc && cbs->free && cbs->lock && cbs->unlock) {
+ memcpy(target, cbs, sizeof(evthread_lock_fns_));
+ return event_global_setup_locks_(1);
+ } else {
+ return -1;
+ }
+}
+
+int
+evthread_set_condition_callbacks(const struct evthread_condition_callbacks *cbs)
+{
+ struct evthread_condition_callbacks *target =
+ evthread_lock_debugging_enabled_
+ ? &original_cond_fns_ : &evthread_cond_fns_;
+
+ if (!cbs) {
+ if (target->alloc_condition)
+ event_warnx("Trying to disable condition functions "
+ "after they have been set up will probaby not "
+ "work.");
+ memset(target, 0, sizeof(evthread_cond_fns_));
+ return 0;
+ }
+ if (target->alloc_condition) {
+ /* Uh oh; we already had condition callbacks set up.*/
+ if (target->condition_api_version == cbs->condition_api_version &&
+ target->alloc_condition == cbs->alloc_condition &&
+ target->free_condition == cbs->free_condition &&
+ target->signal_condition == cbs->signal_condition &&
+ target->wait_condition == cbs->wait_condition) {
+ /* no change -- allow this. */
+ return 0;
+ }
+ event_warnx("Can't change condition callbacks once they "
+ "have been initialized.");
+ return -1;
+ }
+ if (cbs->alloc_condition && cbs->free_condition &&
+ cbs->signal_condition && cbs->wait_condition) {
+ memcpy(target, cbs, sizeof(evthread_cond_fns_));
+ }
+ if (evthread_lock_debugging_enabled_) {
+ evthread_cond_fns_.alloc_condition = cbs->alloc_condition;
+ evthread_cond_fns_.free_condition = cbs->free_condition;
+ evthread_cond_fns_.signal_condition = cbs->signal_condition;
+ }
+ return 0;
+}
+
+#define DEBUG_LOCK_SIG 0xdeb0b10c
+
+struct debug_lock {
+ unsigned signature;
+ unsigned locktype;
+ unsigned long held_by;
+ /* XXXX if we ever use read-write locks, we will need a separate
+ * lock to protect count. */
+ int count;
+ void *lock;
+};
+
+static void *
+debug_lock_alloc(unsigned locktype)
+{
+ struct debug_lock *result = mm_malloc(sizeof(struct debug_lock));
+ if (!result)
+ return NULL;
+ if (original_lock_fns_.alloc) {
+ if (!(result->lock = original_lock_fns_.alloc(
+ locktype|EVTHREAD_LOCKTYPE_RECURSIVE))) {
+ mm_free(result);
+ return NULL;
+ }
+ } else {
+ result->lock = NULL;
+ }
+ result->signature = DEBUG_LOCK_SIG;
+ result->locktype = locktype;
+ result->count = 0;
+ result->held_by = 0;
+ return result;
+}
+
+static void
+debug_lock_free(void *lock_, unsigned locktype)
+{
+ struct debug_lock *lock = lock_;
+ EVUTIL_ASSERT(lock->count == 0);
+ EVUTIL_ASSERT(locktype == lock->locktype);
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ if (original_lock_fns_.free) {
+ original_lock_fns_.free(lock->lock,
+ lock->locktype|EVTHREAD_LOCKTYPE_RECURSIVE);
+ }
+ lock->lock = NULL;
+ lock->count = -100;
+ lock->signature = 0x12300fda;
+ mm_free(lock);
+}
+
+static void
+evthread_debug_lock_mark_locked(unsigned mode, struct debug_lock *lock)
+{
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ ++lock->count;
+ if (!(lock->locktype & EVTHREAD_LOCKTYPE_RECURSIVE))
+ EVUTIL_ASSERT(lock->count == 1);
+ if (evthread_id_fn_) {
+ unsigned long me;
+ me = evthread_id_fn_();
+ if (lock->count > 1)
+ EVUTIL_ASSERT(lock->held_by == me);
+ lock->held_by = me;
+ }
+}
+
+static int
+debug_lock_lock(unsigned mode, void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ int res = 0;
+ if (lock->locktype & EVTHREAD_LOCKTYPE_READWRITE)
+ EVUTIL_ASSERT(mode & (EVTHREAD_READ|EVTHREAD_WRITE));
+ else
+ EVUTIL_ASSERT((mode & (EVTHREAD_READ|EVTHREAD_WRITE)) == 0);
+ if (original_lock_fns_.lock)
+ res = original_lock_fns_.lock(mode, lock->lock);
+ if (!res) {
+ evthread_debug_lock_mark_locked(mode, lock);
+ }
+ return res;
+}
+
+static void
+evthread_debug_lock_mark_unlocked(unsigned mode, struct debug_lock *lock)
+{
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ if (lock->locktype & EVTHREAD_LOCKTYPE_READWRITE)
+ EVUTIL_ASSERT(mode & (EVTHREAD_READ|EVTHREAD_WRITE));
+ else
+ EVUTIL_ASSERT((mode & (EVTHREAD_READ|EVTHREAD_WRITE)) == 0);
+ if (evthread_id_fn_) {
+ unsigned long me;
+ me = evthread_id_fn_();
+ EVUTIL_ASSERT(lock->held_by == me);
+ if (lock->count == 1)
+ lock->held_by = 0;
+ }
+ --lock->count;
+ EVUTIL_ASSERT(lock->count >= 0);
+}
+
+static int
+debug_lock_unlock(unsigned mode, void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ int res = 0;
+ evthread_debug_lock_mark_unlocked(mode, lock);
+ if (original_lock_fns_.unlock)
+ res = original_lock_fns_.unlock(mode, lock->lock);
+ return res;
+}
+
+static int
+debug_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ int r;
+ struct debug_lock *lock = lock_;
+ EVUTIL_ASSERT(lock);
+ EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
+ EVLOCK_ASSERT_LOCKED(lock_);
+ evthread_debug_lock_mark_unlocked(0, lock);
+ r = original_cond_fns_.wait_condition(cond_, lock->lock, tv);
+ evthread_debug_lock_mark_locked(0, lock);
+ return r;
+}
+
+/* misspelled version for backward compatibility */
+void
+evthread_enable_lock_debuging(void)
+{
+ evthread_enable_lock_debugging();
+}
+
+void
+evthread_enable_lock_debugging(void)
+{
+ struct evthread_lock_callbacks cbs = {
+ EVTHREAD_LOCK_API_VERSION,
+ EVTHREAD_LOCKTYPE_RECURSIVE,
+ debug_lock_alloc,
+ debug_lock_free,
+ debug_lock_lock,
+ debug_lock_unlock
+ };
+ if (evthread_lock_debugging_enabled_)
+ return;
+ memcpy(&original_lock_fns_, &evthread_lock_fns_,
+ sizeof(struct evthread_lock_callbacks));
+ memcpy(&evthread_lock_fns_, &cbs,
+ sizeof(struct evthread_lock_callbacks));
+
+ memcpy(&original_cond_fns_, &evthread_cond_fns_,
+ sizeof(struct evthread_condition_callbacks));
+ evthread_cond_fns_.wait_condition = debug_cond_wait;
+ evthread_lock_debugging_enabled_ = 1;
+
+ /* XXX return value should get checked. */
+ event_global_setup_locks_(0);
+}
+
+int
+evthread_is_debug_lock_held_(void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ if (! lock->count)
+ return 0;
+ if (evthread_id_fn_) {
+ unsigned long me = evthread_id_fn_();
+ if (lock->held_by != me)
+ return 0;
+ }
+ return 1;
+}
+
+void *
+evthread_debug_get_real_lock_(void *lock_)
+{
+ struct debug_lock *lock = lock_;
+ return lock->lock;
+}
+
+void *
+evthread_setup_global_lock_(void *lock_, unsigned locktype, int enable_locks)
+{
+ /* there are four cases here:
+ 1) we're turning on debugging; locking is not on.
+ 2) we're turning on debugging; locking is on.
+ 3) we're turning on locking; debugging is not on.
+ 4) we're turning on locking; debugging is on. */
+
+ if (!enable_locks && original_lock_fns_.alloc == NULL) {
+ /* Case 1: allocate a debug lock. */
+ EVUTIL_ASSERT(lock_ == NULL);
+ return debug_lock_alloc(locktype);
+ } else if (!enable_locks && original_lock_fns_.alloc != NULL) {
+ /* Case 2: wrap the lock in a debug lock. */
+ struct debug_lock *lock;
+ EVUTIL_ASSERT(lock_ != NULL);
+
+ if (!(locktype & EVTHREAD_LOCKTYPE_RECURSIVE)) {
+ /* We can't wrap it: We need a recursive lock */
+ original_lock_fns_.free(lock_, locktype);
+ return debug_lock_alloc(locktype);
+ }
+ lock = mm_malloc(sizeof(struct debug_lock));
+ if (!lock) {
+ original_lock_fns_.free(lock_, locktype);
+ return NULL;
+ }
+ lock->lock = lock_;
+ lock->locktype = locktype;
+ lock->count = 0;
+ lock->held_by = 0;
+ return lock;
+ } else if (enable_locks && ! evthread_lock_debugging_enabled_) {
+ /* Case 3: allocate a regular lock */
+ EVUTIL_ASSERT(lock_ == NULL);
+ return evthread_lock_fns_.alloc(locktype);
+ } else {
+ /* Case 4: Fill in a debug lock with a real lock */
+ struct debug_lock *lock = lock_;
+ EVUTIL_ASSERT(enable_locks &&
+ evthread_lock_debugging_enabled_);
+ EVUTIL_ASSERT(lock->locktype == locktype);
+ EVUTIL_ASSERT(lock->lock == NULL);
+ lock->lock = original_lock_fns_.alloc(
+ locktype|EVTHREAD_LOCKTYPE_RECURSIVE);
+ if (!lock->lock) {
+ lock->count = -200;
+ mm_free(lock);
+ return NULL;
+ }
+ return lock;
+ }
+}
+
+
+#ifndef EVTHREAD_EXPOSE_STRUCTS
+unsigned long
+evthreadimpl_get_id_()
+{
+ return evthread_id_fn_ ? evthread_id_fn_() : 1;
+}
+void *
+evthreadimpl_lock_alloc_(unsigned locktype)
+{
+ return evthread_lock_fns_.alloc ?
+ evthread_lock_fns_.alloc(locktype) : NULL;
+}
+void
+evthreadimpl_lock_free_(void *lock, unsigned locktype)
+{
+ if (evthread_lock_fns_.free)
+ evthread_lock_fns_.free(lock, locktype);
+}
+int
+evthreadimpl_lock_lock_(unsigned mode, void *lock)
+{
+ if (evthread_lock_fns_.lock)
+ return evthread_lock_fns_.lock(mode, lock);
+ else
+ return 0;
+}
+int
+evthreadimpl_lock_unlock_(unsigned mode, void *lock)
+{
+ if (evthread_lock_fns_.unlock)
+ return evthread_lock_fns_.unlock(mode, lock);
+ else
+ return 0;
+}
+void *
+evthreadimpl_cond_alloc_(unsigned condtype)
+{
+ return evthread_cond_fns_.alloc_condition ?
+ evthread_cond_fns_.alloc_condition(condtype) : NULL;
+}
+void
+evthreadimpl_cond_free_(void *cond)
+{
+ if (evthread_cond_fns_.free_condition)
+ evthread_cond_fns_.free_condition(cond);
+}
+int
+evthreadimpl_cond_signal_(void *cond, int broadcast)
+{
+ if (evthread_cond_fns_.signal_condition)
+ return evthread_cond_fns_.signal_condition(cond, broadcast);
+ else
+ return 0;
+}
+int
+evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv)
+{
+ if (evthread_cond_fns_.wait_condition)
+ return evthread_cond_fns_.wait_condition(cond, lock, tv);
+ else
+ return 0;
+}
+int
+evthreadimpl_is_lock_debugging_enabled_(void)
+{
+ return evthread_lock_debugging_enabled_;
+}
+
+int
+evthreadimpl_locking_enabled_(void)
+{
+ return evthread_lock_fns_.lock != NULL;
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/evthread_pthread.c b/sntp/libevent/evthread_pthread.c
new file mode 100644
index 0000000..4e11f74
--- /dev/null
+++ b/sntp/libevent/evthread_pthread.c
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+/* With glibc we need to define _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE.
+ * This comes from evconfig-private.h
+ */
+#include <pthread.h>
+
+struct event_base;
+#include "event2/thread.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include "mm-internal.h"
+#include "evthread-internal.h"
+
+static pthread_mutexattr_t attr_recursive;
+
+static void *
+evthread_posix_lock_alloc(unsigned locktype)
+{
+ pthread_mutexattr_t *attr = NULL;
+ pthread_mutex_t *lock = mm_malloc(sizeof(pthread_mutex_t));
+ if (!lock)
+ return NULL;
+ if (locktype & EVTHREAD_LOCKTYPE_RECURSIVE)
+ attr = &attr_recursive;
+ if (pthread_mutex_init(lock, attr)) {
+ mm_free(lock);
+ return NULL;
+ }
+ return lock;
+}
+
+static void
+evthread_posix_lock_free(void *lock_, unsigned locktype)
+{
+ pthread_mutex_t *lock = lock_;
+ pthread_mutex_destroy(lock);
+ mm_free(lock);
+}
+
+static int
+evthread_posix_lock(unsigned mode, void *lock_)
+{
+ pthread_mutex_t *lock = lock_;
+ if (mode & EVTHREAD_TRY)
+ return pthread_mutex_trylock(lock);
+ else
+ return pthread_mutex_lock(lock);
+}
+
+static int
+evthread_posix_unlock(unsigned mode, void *lock_)
+{
+ pthread_mutex_t *lock = lock_;
+ return pthread_mutex_unlock(lock);
+}
+
+static unsigned long
+evthread_posix_get_id(void)
+{
+ union {
+ pthread_t thr;
+#if EVENT__SIZEOF_PTHREAD_T > EVENT__SIZEOF_LONG
+ ev_uint64_t id;
+#else
+ unsigned long id;
+#endif
+ } r;
+#if EVENT__SIZEOF_PTHREAD_T < EVENT__SIZEOF_LONG
+ memset(&r, 0, sizeof(r));
+#endif
+ r.thr = pthread_self();
+ return (unsigned long)r.id;
+}
+
+static void *
+evthread_posix_cond_alloc(unsigned condflags)
+{
+ pthread_cond_t *cond = mm_malloc(sizeof(pthread_cond_t));
+ if (!cond)
+ return NULL;
+ if (pthread_cond_init(cond, NULL)) {
+ mm_free(cond);
+ return NULL;
+ }
+ return cond;
+}
+
+static void
+evthread_posix_cond_free(void *cond_)
+{
+ pthread_cond_t *cond = cond_;
+ pthread_cond_destroy(cond);
+ mm_free(cond);
+}
+
+static int
+evthread_posix_cond_signal(void *cond_, int broadcast)
+{
+ pthread_cond_t *cond = cond_;
+ int r;
+ if (broadcast)
+ r = pthread_cond_broadcast(cond);
+ else
+ r = pthread_cond_signal(cond);
+ return r ? -1 : 0;
+}
+
+static int
+evthread_posix_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ int r;
+ pthread_cond_t *cond = cond_;
+ pthread_mutex_t *lock = lock_;
+
+ if (tv) {
+ struct timeval now, abstime;
+ struct timespec ts;
+ evutil_gettimeofday(&now, NULL);
+ evutil_timeradd(&now, tv, &abstime);
+ ts.tv_sec = abstime.tv_sec;
+ ts.tv_nsec = abstime.tv_usec*1000;
+ r = pthread_cond_timedwait(cond, lock, &ts);
+ if (r == ETIMEDOUT)
+ return 1;
+ else if (r)
+ return -1;
+ else
+ return 0;
+ } else {
+ r = pthread_cond_wait(cond, lock);
+ return r ? -1 : 0;
+ }
+}
+
+int
+evthread_use_pthreads(void)
+{
+ struct evthread_lock_callbacks cbs = {
+ EVTHREAD_LOCK_API_VERSION,
+ EVTHREAD_LOCKTYPE_RECURSIVE,
+ evthread_posix_lock_alloc,
+ evthread_posix_lock_free,
+ evthread_posix_lock,
+ evthread_posix_unlock
+ };
+ struct evthread_condition_callbacks cond_cbs = {
+ EVTHREAD_CONDITION_API_VERSION,
+ evthread_posix_cond_alloc,
+ evthread_posix_cond_free,
+ evthread_posix_cond_signal,
+ evthread_posix_cond_wait
+ };
+ /* Set ourselves up to get recursive locks. */
+ if (pthread_mutexattr_init(&attr_recursive))
+ return -1;
+ if (pthread_mutexattr_settype(&attr_recursive, PTHREAD_MUTEX_RECURSIVE))
+ return -1;
+
+ evthread_set_lock_callbacks(&cbs);
+ evthread_set_condition_callbacks(&cond_cbs);
+ evthread_set_id_callback(evthread_posix_get_id);
+ return 0;
+}
diff --git a/sntp/libevent/evthread_win32.c b/sntp/libevent/evthread_win32.c
new file mode 100644
index 0000000..2ec8056
--- /dev/null
+++ b/sntp/libevent/evthread_win32.c
@@ -0,0 +1,341 @@
+/*
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#ifndef _WIN32_WINNT
+/* Minimum required for InitializeCriticalSectionAndSpinCount */
+#define _WIN32_WINNT 0x0403
+#endif
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <sys/locking.h>
+#endif
+
+struct event_base;
+#include "event2/thread.h"
+
+#include "mm-internal.h"
+#include "evthread-internal.h"
+#include "time-internal.h"
+
+#define SPIN_COUNT 2000
+
+static void *
+evthread_win32_lock_create(unsigned locktype)
+{
+ CRITICAL_SECTION *lock = mm_malloc(sizeof(CRITICAL_SECTION));
+ if (!lock)
+ return NULL;
+ if (InitializeCriticalSectionAndSpinCount(lock, SPIN_COUNT) == 0) {
+ mm_free(lock);
+ return NULL;
+ }
+ return lock;
+}
+
+static void
+evthread_win32_lock_free(void *lock_, unsigned locktype)
+{
+ CRITICAL_SECTION *lock = lock_;
+ DeleteCriticalSection(lock);
+ mm_free(lock);
+}
+
+static int
+evthread_win32_lock(unsigned mode, void *lock_)
+{
+ CRITICAL_SECTION *lock = lock_;
+ if ((mode & EVTHREAD_TRY)) {
+ return ! TryEnterCriticalSection(lock);
+ } else {
+ EnterCriticalSection(lock);
+ return 0;
+ }
+}
+
+static int
+evthread_win32_unlock(unsigned mode, void *lock_)
+{
+ CRITICAL_SECTION *lock = lock_;
+ LeaveCriticalSection(lock);
+ return 0;
+}
+
+static unsigned long
+evthread_win32_get_id(void)
+{
+ return (unsigned long) GetCurrentThreadId();
+}
+
+#ifdef WIN32_HAVE_CONDITION_VARIABLES
+static void WINAPI (*InitializeConditionVariable_fn)(PCONDITION_VARIABLE)
+ = NULL;
+static BOOL WINAPI (*SleepConditionVariableCS_fn)(
+ PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD) = NULL;
+static void WINAPI (*WakeAllConditionVariable_fn)(PCONDITION_VARIABLE) = NULL;
+static void WINAPI (*WakeConditionVariable_fn)(PCONDITION_VARIABLE) = NULL;
+
+static int
+evthread_win32_condvar_init(void)
+{
+ HANDLE lib;
+
+ lib = GetModuleHandle(TEXT("kernel32.dll"));
+ if (lib == NULL)
+ return 0;
+
+#define LOAD(name) \
+ name##_fn = GetProcAddress(lib, #name)
+ LOAD(InitializeConditionVariable);
+ LOAD(SleepConditionVariableCS);
+ LOAD(WakeAllConditionVariable);
+ LOAD(WakeConditionVariable);
+
+ return InitializeConditionVariable_fn && SleepConditionVariableCS_fn &&
+ WakeAllConditionVariable_fn && WakeConditionVariable_fn;
+}
+
+/* XXXX Even if we can build this, we don't necessarily want to: the functions
+ * in question didn't exist before Vista, so we'd better LoadProc them. */
+static void *
+evthread_win32_condvar_alloc(unsigned condflags)
+{
+ CONDITION_VARIABLE *cond = mm_malloc(sizeof(CONDITION_VARIABLE));
+ if (!cond)
+ return NULL;
+ InitializeConditionVariable_fn(cond);
+ return cond;
+}
+
+static void
+evthread_win32_condvar_free(void *cond_)
+{
+ CONDITION_VARIABLE *cond = cond_;
+ /* There doesn't _seem_ to be a cleaup fn here... */
+ mm_free(cond);
+}
+
+static int
+evthread_win32_condvar_signal(void *cond, int broadcast)
+{
+ CONDITION_VARIABLE *cond = cond_;
+ if (broadcast)
+ WakeAllConditionVariable_fn(cond);
+ else
+ WakeConditionVariable_fn(cond);
+ return 0;
+}
+
+static int
+evthread_win32_condvar_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ CONDITION_VARIABLE *cond = cond_;
+ CRITICAL_SECTION *lock = lock_;
+ DWORD ms, err;
+ BOOL result;
+
+ if (tv)
+ ms = evutil_tv_to_msec_(tv);
+ else
+ ms = INFINITE;
+ result = SleepConditionVariableCS_fn(cond, lock, ms);
+ if (result) {
+ if (GetLastError() == WAIT_TIMEOUT)
+ return 1;
+ else
+ return -1;
+ } else {
+ return 0;
+ }
+}
+#endif
+
+struct evthread_win32_cond {
+ HANDLE event;
+
+ CRITICAL_SECTION lock;
+ int n_waiting;
+ int n_to_wake;
+ int generation;
+};
+
+static void *
+evthread_win32_cond_alloc(unsigned flags)
+{
+ struct evthread_win32_cond *cond;
+ if (!(cond = mm_malloc(sizeof(struct evthread_win32_cond))))
+ return NULL;
+ if (InitializeCriticalSectionAndSpinCount(&cond->lock, SPIN_COUNT)==0) {
+ mm_free(cond);
+ return NULL;
+ }
+ if ((cond->event = CreateEvent(NULL,TRUE,FALSE,NULL)) == NULL) {
+ DeleteCriticalSection(&cond->lock);
+ mm_free(cond);
+ return NULL;
+ }
+ cond->n_waiting = cond->n_to_wake = cond->generation = 0;
+ return cond;
+}
+
+static void
+evthread_win32_cond_free(void *cond_)
+{
+ struct evthread_win32_cond *cond = cond_;
+ DeleteCriticalSection(&cond->lock);
+ CloseHandle(cond->event);
+ mm_free(cond);
+}
+
+static int
+evthread_win32_cond_signal(void *cond_, int broadcast)
+{
+ struct evthread_win32_cond *cond = cond_;
+ EnterCriticalSection(&cond->lock);
+ if (broadcast)
+ cond->n_to_wake = cond->n_waiting;
+ else
+ ++cond->n_to_wake;
+ cond->generation++;
+ SetEvent(cond->event);
+ LeaveCriticalSection(&cond->lock);
+ return 0;
+}
+
+static int
+evthread_win32_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
+{
+ struct evthread_win32_cond *cond = cond_;
+ CRITICAL_SECTION *lock = lock_;
+ int generation_at_start;
+ int waiting = 1;
+ int result = -1;
+ DWORD ms = INFINITE, ms_orig = INFINITE, startTime, endTime;
+ if (tv)
+ ms_orig = ms = evutil_tv_to_msec_(tv);
+
+ EnterCriticalSection(&cond->lock);
+ ++cond->n_waiting;
+ generation_at_start = cond->generation;
+ LeaveCriticalSection(&cond->lock);
+
+ LeaveCriticalSection(lock);
+
+ startTime = GetTickCount();
+ do {
+ DWORD res;
+ res = WaitForSingleObject(cond->event, ms);
+ EnterCriticalSection(&cond->lock);
+ if (cond->n_to_wake &&
+ cond->generation != generation_at_start) {
+ --cond->n_to_wake;
+ --cond->n_waiting;
+ result = 0;
+ waiting = 0;
+ goto out;
+ } else if (res != WAIT_OBJECT_0) {
+ result = (res==WAIT_TIMEOUT) ? 1 : -1;
+ --cond->n_waiting;
+ waiting = 0;
+ goto out;
+ } else if (ms != INFINITE) {
+ endTime = GetTickCount();
+ if (startTime + ms_orig <= endTime) {
+ result = 1; /* Timeout */
+ --cond->n_waiting;
+ waiting = 0;
+ goto out;
+ } else {
+ ms = startTime + ms_orig - endTime;
+ }
+ }
+ /* If we make it here, we are still waiting. */
+ if (cond->n_to_wake == 0) {
+ /* There is nobody else who should wake up; reset
+ * the event. */
+ ResetEvent(cond->event);
+ }
+ out:
+ LeaveCriticalSection(&cond->lock);
+ } while (waiting);
+
+ EnterCriticalSection(lock);
+
+ EnterCriticalSection(&cond->lock);
+ if (!cond->n_waiting)
+ ResetEvent(cond->event);
+ LeaveCriticalSection(&cond->lock);
+
+ return result;
+}
+
+int
+evthread_use_windows_threads(void)
+{
+ struct evthread_lock_callbacks cbs = {
+ EVTHREAD_LOCK_API_VERSION,
+ EVTHREAD_LOCKTYPE_RECURSIVE,
+ evthread_win32_lock_create,
+ evthread_win32_lock_free,
+ evthread_win32_lock,
+ evthread_win32_unlock
+ };
+
+
+ struct evthread_condition_callbacks cond_cbs = {
+ EVTHREAD_CONDITION_API_VERSION,
+ evthread_win32_cond_alloc,
+ evthread_win32_cond_free,
+ evthread_win32_cond_signal,
+ evthread_win32_cond_wait
+ };
+#ifdef WIN32_HAVE_CONDITION_VARIABLES
+ struct evthread_condition_callbacks condvar_cbs = {
+ EVTHREAD_CONDITION_API_VERSION,
+ evthread_win32_condvar_alloc,
+ evthread_win32_condvar_free,
+ evthread_win32_condvar_signal,
+ evthread_win32_condvar_wait
+ };
+#endif
+
+ evthread_set_lock_callbacks(&cbs);
+ evthread_set_id_callback(evthread_win32_get_id);
+#ifdef WIN32_HAVE_CONDITION_VARIABLES
+ if (evthread_win32_condvar_init()) {
+ evthread_set_condition_callbacks(&condvar_cbs);
+ return 0;
+ }
+#endif
+ evthread_set_condition_callbacks(&cond_cbs);
+
+ return 0;
+}
+
diff --git a/sntp/libevent/evutil.c b/sntp/libevent/evutil.c
new file mode 100644
index 0000000..c28cade
--- /dev/null
+++ b/sntp/libevent/evutil.c
@@ -0,0 +1,2649 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <io.h>
+#include <tchar.h>
+#include <process.h>
+#undef _WIN32_WINNT
+/* For structs needed by GetAdaptersAddresses */
+#define _WIN32_WINNT 0x0501
+#include <iphlpapi.h>
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef EVENT__HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#ifdef EVENT__HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#include <time.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "mm-internal.h"
+#include "evthread-internal.h"
+
+#include "strlcpy-internal.h"
+#include "ipv6-internal.h"
+
+#ifdef _WIN32
+#define HT_NO_CACHE_HASH_VALUES
+#include "ht-internal.h"
+#define open _open
+#define read _read
+#define close _close
+#ifndef fstat
+#define fstat _fstati64
+#endif
+#ifndef stat
+#define stat _stati64
+#endif
+#define mode_t int
+#endif
+
+int
+evutil_open_closeonexec_(const char *pathname, int flags, unsigned mode)
+{
+ int fd;
+
+#ifdef O_CLOEXEC
+ fd = open(pathname, flags|O_CLOEXEC, (mode_t)mode);
+ if (fd >= 0 || errno == EINVAL)
+ return fd;
+ /* If we got an EINVAL, fall through and try without O_CLOEXEC */
+#endif
+ fd = open(pathname, flags, (mode_t)mode);
+ if (fd < 0)
+ return -1;
+
+#if defined(FD_CLOEXEC)
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
+ close(fd);
+ return -1;
+ }
+#endif
+
+ return fd;
+}
+
+/**
+ Read the contents of 'filename' into a newly allocated NUL-terminated
+ string. Set *content_out to hold this string, and *len_out to hold its
+ length (not including the appended NUL). If 'is_binary', open the file in
+ binary mode.
+
+ Returns 0 on success, -1 if the open fails, and -2 for all other failures.
+
+ Used internally only; may go away in a future version.
+ */
+int
+evutil_read_file_(const char *filename, char **content_out, size_t *len_out,
+ int is_binary)
+{
+ int fd, r;
+ struct stat st;
+ char *mem;
+ size_t read_so_far=0;
+ int mode = O_RDONLY;
+
+ EVUTIL_ASSERT(content_out);
+ EVUTIL_ASSERT(len_out);
+ *content_out = NULL;
+ *len_out = 0;
+
+#ifdef O_BINARY
+ if (is_binary)
+ mode |= O_BINARY;
+#endif
+
+ fd = evutil_open_closeonexec_(filename, mode, 0);
+ if (fd < 0)
+ return -1;
+ if (fstat(fd, &st) || st.st_size < 0 ||
+ st.st_size > EV_SSIZE_MAX-1 ) {
+ close(fd);
+ return -2;
+ }
+ mem = mm_malloc((size_t)st.st_size + 1);
+ if (!mem) {
+ close(fd);
+ return -2;
+ }
+ read_so_far = 0;
+#ifdef _WIN32
+#define N_TO_READ(x) ((x) > INT_MAX) ? INT_MAX : ((int)(x))
+#else
+#define N_TO_READ(x) (x)
+#endif
+ while ((r = read(fd, mem+read_so_far, N_TO_READ(st.st_size - read_so_far))) > 0) {
+ read_so_far += r;
+ if (read_so_far >= (size_t)st.st_size)
+ break;
+ EVUTIL_ASSERT(read_so_far < (size_t)st.st_size);
+ }
+ close(fd);
+ if (r < 0) {
+ mm_free(mem);
+ return -2;
+ }
+ mem[read_so_far] = 0;
+
+ *len_out = read_so_far;
+ *content_out = mem;
+ return 0;
+}
+
+int
+evutil_socketpair(int family, int type, int protocol, evutil_socket_t fd[2])
+{
+#ifndef _WIN32
+ return socketpair(family, type, protocol, fd);
+#else
+ return evutil_ersatz_socketpair_(family, type, protocol, fd);
+#endif
+}
+
+int
+evutil_ersatz_socketpair_(int family, int type, int protocol,
+ evutil_socket_t fd[2])
+{
+ /* This code is originally from Tor. Used with permission. */
+
+ /* This socketpair does not work when localhost is down. So
+ * it's really not the same thing at all. But it's close enough
+ * for now, and really, when localhost is down sometimes, we
+ * have other problems too.
+ */
+#ifdef _WIN32
+#define ERR(e) WSA##e
+#else
+#define ERR(e) e
+#endif
+ evutil_socket_t listener = -1;
+ evutil_socket_t connector = -1;
+ evutil_socket_t acceptor = -1;
+ struct sockaddr_in listen_addr;
+ struct sockaddr_in connect_addr;
+ ev_socklen_t size;
+ int saved_errno = -1;
+
+ if (protocol
+ || (family != AF_INET
+#ifdef AF_UNIX
+ && family != AF_UNIX
+#endif
+ )) {
+ EVUTIL_SET_SOCKET_ERROR(ERR(EAFNOSUPPORT));
+ return -1;
+ }
+ if (!fd) {
+ EVUTIL_SET_SOCKET_ERROR(ERR(EINVAL));
+ return -1;
+ }
+
+ listener = socket(AF_INET, type, 0);
+ if (listener < 0)
+ return -1;
+ memset(&listen_addr, 0, sizeof(listen_addr));
+ listen_addr.sin_family = AF_INET;
+ listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ listen_addr.sin_port = 0; /* kernel chooses port. */
+ if (bind(listener, (struct sockaddr *) &listen_addr, sizeof (listen_addr))
+ == -1)
+ goto tidy_up_and_fail;
+ if (listen(listener, 1) == -1)
+ goto tidy_up_and_fail;
+
+ connector = socket(AF_INET, type, 0);
+ if (connector < 0)
+ goto tidy_up_and_fail;
+ /* We want to find out the port number to connect to. */
+ size = sizeof(connect_addr);
+ if (getsockname(listener, (struct sockaddr *) &connect_addr, &size) == -1)
+ goto tidy_up_and_fail;
+ if (size != sizeof (connect_addr))
+ goto abort_tidy_up_and_fail;
+ if (connect(connector, (struct sockaddr *) &connect_addr,
+ sizeof(connect_addr)) == -1)
+ goto tidy_up_and_fail;
+
+ size = sizeof(listen_addr);
+ acceptor = accept(listener, (struct sockaddr *) &listen_addr, &size);
+ if (acceptor < 0)
+ goto tidy_up_and_fail;
+ if (size != sizeof(listen_addr))
+ goto abort_tidy_up_and_fail;
+ /* Now check we are talking to ourself by matching port and host on the
+ two sockets. */
+ if (getsockname(connector, (struct sockaddr *) &connect_addr, &size) == -1)
+ goto tidy_up_and_fail;
+ if (size != sizeof (connect_addr)
+ || listen_addr.sin_family != connect_addr.sin_family
+ || listen_addr.sin_addr.s_addr != connect_addr.sin_addr.s_addr
+ || listen_addr.sin_port != connect_addr.sin_port)
+ goto abort_tidy_up_and_fail;
+ evutil_closesocket(listener);
+ fd[0] = connector;
+ fd[1] = acceptor;
+
+ return 0;
+
+ abort_tidy_up_and_fail:
+ saved_errno = ERR(ECONNABORTED);
+ tidy_up_and_fail:
+ if (saved_errno < 0)
+ saved_errno = EVUTIL_SOCKET_ERROR();
+ if (listener != -1)
+ evutil_closesocket(listener);
+ if (connector != -1)
+ evutil_closesocket(connector);
+ if (acceptor != -1)
+ evutil_closesocket(acceptor);
+
+ EVUTIL_SET_SOCKET_ERROR(saved_errno);
+ return -1;
+#undef ERR
+}
+
+int
+evutil_make_socket_nonblocking(evutil_socket_t fd)
+{
+#ifdef _WIN32
+ {
+ u_long nonblocking = 1;
+ if (ioctlsocket(fd, FIONBIO, &nonblocking) == SOCKET_ERROR) {
+ event_sock_warn(fd, "fcntl(%d, F_GETFL)", (int)fd);
+ return -1;
+ }
+ }
+#else
+ {
+ int flags;
+ if ((flags = fcntl(fd, F_GETFL, NULL)) < 0) {
+ event_warn("fcntl(%d, F_GETFL)", fd);
+ return -1;
+ }
+ if (!(flags & O_NONBLOCK)) {
+ if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
+ event_warn("fcntl(%d, F_SETFL)", fd);
+ return -1;
+ }
+ }
+ }
+#endif
+ return 0;
+}
+
+/* Faster version of evutil_make_socket_nonblocking for internal use.
+ *
+ * Requires that no F_SETFL flags were previously set on the fd.
+ */
+static int
+evutil_fast_socket_nonblocking(evutil_socket_t fd)
+{
+#ifdef _WIN32
+ return evutil_make_socket_nonblocking(fd);
+#else
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
+ event_warn("fcntl(%d, F_SETFL)", fd);
+ return -1;
+ }
+ return 0;
+#endif
+}
+
+int
+evutil_make_listen_socket_reuseable(evutil_socket_t sock)
+{
+#ifndef _WIN32
+ int one = 1;
+ /* REUSEADDR on Unix means, "don't hang on to this address after the
+ * listener is closed." On Windows, though, it means "don't keep other
+ * processes from binding to this address while we're using it. */
+ return setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*) &one,
+ (ev_socklen_t)sizeof(one));
+#else
+ return 0;
+#endif
+}
+
+int
+evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock)
+{
+#if defined(EVENT__HAVE_NETINET_TCP_H) && defined(TCP_DEFER_ACCEPT)
+ int one = 1;
+
+ /* TCP_DEFER_ACCEPT tells the kernel to call defer accept() only after data
+ * has arrived and ready to read */
+ return setsockopt(sock, IPPROTO_TCP, TCP_DEFER_ACCEPT, &one,
+ (ev_socklen_t)sizeof(one));
+#endif
+ return 0;
+}
+
+int
+evutil_make_socket_closeonexec(evutil_socket_t fd)
+{
+#if !defined(_WIN32) && defined(EVENT__HAVE_SETFD)
+ int flags;
+ if ((flags = fcntl(fd, F_GETFD, NULL)) < 0) {
+ event_warn("fcntl(%d, F_GETFD)", fd);
+ return -1;
+ }
+ if (!(flags & FD_CLOEXEC)) {
+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) {
+ event_warn("fcntl(%d, F_SETFD)", fd);
+ return -1;
+ }
+ }
+#endif
+ return 0;
+}
+
+/* Faster version of evutil_make_socket_closeonexec for internal use.
+ *
+ * Requires that no F_SETFD flags were previously set on the fd.
+ */
+static int
+evutil_fast_socket_closeonexec(evutil_socket_t fd)
+{
+#if !defined(_WIN32) && defined(EVENT__HAVE_SETFD)
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
+ event_warn("fcntl(%d, F_SETFD)", fd);
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+int
+evutil_closesocket(evutil_socket_t sock)
+{
+#ifndef _WIN32
+ return close(sock);
+#else
+ return closesocket(sock);
+#endif
+}
+
+ev_int64_t
+evutil_strtoll(const char *s, char **endptr, int base)
+{
+#ifdef EVENT__HAVE_STRTOLL
+ return (ev_int64_t)strtoll(s, endptr, base);
+#elif EVENT__SIZEOF_LONG == 8
+ return (ev_int64_t)strtol(s, endptr, base);
+#elif defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1300
+ /* XXXX on old versions of MS APIs, we only support base
+ * 10. */
+ ev_int64_t r;
+ if (base != 10)
+ return 0;
+ r = (ev_int64_t) _atoi64(s);
+ while (isspace(*s))
+ ++s;
+ if (*s == '-')
+ ++s;
+ while (isdigit(*s))
+ ++s;
+ if (endptr)
+ *endptr = (char*) s;
+ return r;
+#elif defined(_WIN32)
+ return (ev_int64_t) _strtoi64(s, endptr, base);
+#elif defined(EVENT__SIZEOF_LONG_LONG) && EVENT__SIZEOF_LONG_LONG == 8
+ long long r;
+ int n;
+ if (base != 10 && base != 16)
+ return 0;
+ if (base == 10) {
+ n = sscanf(s, "%lld", &r);
+ } else {
+ unsigned long long ru=0;
+ n = sscanf(s, "%llx", &ru);
+ if (ru > EV_INT64_MAX)
+ return 0;
+ r = (long long) ru;
+ }
+ if (n != 1)
+ return 0;
+ while (EVUTIL_ISSPACE_(*s))
+ ++s;
+ if (*s == '-')
+ ++s;
+ if (base == 10) {
+ while (EVUTIL_ISDIGIT_(*s))
+ ++s;
+ } else {
+ while (EVUTIL_ISXDIGIT_(*s))
+ ++s;
+ }
+ if (endptr)
+ *endptr = (char*) s;
+ return r;
+#else
+#error "I don't know how to parse 64-bit integers."
+#endif
+}
+
+#ifdef _WIN32
+int
+evutil_socket_geterror(evutil_socket_t sock)
+{
+ int optval, optvallen=sizeof(optval);
+ int err = WSAGetLastError();
+ if (err == WSAEWOULDBLOCK && sock >= 0) {
+ if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)&optval,
+ &optvallen))
+ return err;
+ if (optval)
+ return optval;
+ }
+ return err;
+}
+#endif
+
+/* XXX we should use an enum here. */
+/* 2 for connection refused, 1 for connected, 0 for not yet, -1 for error. */
+int
+evutil_socket_connect_(evutil_socket_t *fd_ptr, struct sockaddr *sa, int socklen)
+{
+ int made_fd = 0;
+
+ if (*fd_ptr < 0) {
+ if ((*fd_ptr = socket(sa->sa_family, SOCK_STREAM, 0)) < 0)
+ goto err;
+ made_fd = 1;
+ if (evutil_make_socket_nonblocking(*fd_ptr) < 0) {
+ goto err;
+ }
+ }
+
+ if (connect(*fd_ptr, sa, socklen) < 0) {
+ int e = evutil_socket_geterror(*fd_ptr);
+ if (EVUTIL_ERR_CONNECT_RETRIABLE(e))
+ return 0;
+ if (EVUTIL_ERR_CONNECT_REFUSED(e))
+ return 2;
+ goto err;
+ } else {
+ return 1;
+ }
+
+err:
+ if (made_fd) {
+ evutil_closesocket(*fd_ptr);
+ *fd_ptr = -1;
+ }
+ return -1;
+}
+
+/* Check whether a socket on which we called connect() is done
+ connecting. Return 1 for connected, 0 for not yet, -1 for error. In the
+ error case, set the current socket errno to the error that happened during
+ the connect operation. */
+int
+evutil_socket_finished_connecting_(evutil_socket_t fd)
+{
+ int e;
+ ev_socklen_t elen = sizeof(e);
+
+ if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&e, &elen) < 0)
+ return -1;
+
+ if (e) {
+ if (EVUTIL_ERR_CONNECT_RETRIABLE(e))
+ return 0;
+ EVUTIL_SET_SOCKET_ERROR(e);
+ return -1;
+ }
+
+ return 1;
+}
+
+#if (EVUTIL_AI_PASSIVE|EVUTIL_AI_CANONNAME|EVUTIL_AI_NUMERICHOST| \
+ EVUTIL_AI_NUMERICSERV|EVUTIL_AI_V4MAPPED|EVUTIL_AI_ALL| \
+ EVUTIL_AI_ADDRCONFIG) != \
+ (EVUTIL_AI_PASSIVE^EVUTIL_AI_CANONNAME^EVUTIL_AI_NUMERICHOST^ \
+ EVUTIL_AI_NUMERICSERV^EVUTIL_AI_V4MAPPED^EVUTIL_AI_ALL^ \
+ EVUTIL_AI_ADDRCONFIG)
+#error "Some of our EVUTIL_AI_* flags seem to overlap with system AI_* flags"
+#endif
+
+/* We sometimes need to know whether we have an ipv4 address and whether we
+ have an ipv6 address. If 'have_checked_interfaces', then we've already done
+ the test. If 'had_ipv4_address', then it turns out we had an ipv4 address.
+ If 'had_ipv6_address', then it turns out we had an ipv6 address. These are
+ set by evutil_check_interfaces. */
+static int have_checked_interfaces, had_ipv4_address, had_ipv6_address;
+
+/* Macro: True iff the IPv4 address 'addr', in host order, is in 127.0.0.0/8
+ */
+#define EVUTIL_V4ADDR_IS_LOCALHOST(addr) (((addr)>>24) == 127)
+
+/* Macro: True iff the IPv4 address 'addr', in host order, is a class D
+ * (multiclass) address.
+ */
+#define EVUTIL_V4ADDR_IS_CLASSD(addr) ((((addr)>>24) & 0xf0) == 0xe0)
+
+static void
+evutil_found_ifaddr(const struct sockaddr *sa)
+{
+ const char ZEROES[] = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00";
+
+ if (sa->sa_family == AF_INET) {
+ const struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+ ev_uint32_t addr = ntohl(sin->sin_addr.s_addr);
+ if (addr == 0 ||
+ EVUTIL_V4ADDR_IS_LOCALHOST(addr) ||
+ EVUTIL_V4ADDR_IS_CLASSD(addr)) {
+ /* Not actually a usable external address. */
+ } else {
+ event_debug(("Detected an IPv4 interface"));
+ had_ipv4_address = 1;
+ }
+ } else if (sa->sa_family == AF_INET6) {
+ const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
+ const unsigned char *addr =
+ (unsigned char*)sin6->sin6_addr.s6_addr;
+ if (!memcmp(addr, ZEROES, 8) ||
+ ((addr[0] & 0xfe) == 0xfc) ||
+ (addr[0] == 0xfe && (addr[1] & 0xc0) == 0x80) ||
+ (addr[0] == 0xfe && (addr[1] & 0xc0) == 0xc0) ||
+ (addr[0] == 0xff)) {
+ /* This is a reserved, ipv4compat, ipv4map, loopback,
+ * link-local, multicast, or unspecified address. */
+ } else {
+ event_debug(("Detected an IPv6 interface"));
+ had_ipv6_address = 1;
+ }
+ }
+}
+
+#ifdef _WIN32
+typedef ULONG (WINAPI *GetAdaptersAddresses_fn_t)(
+ ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
+#endif
+
+static int
+evutil_check_ifaddrs(void)
+{
+#if defined(EVENT__HAVE_GETIFADDRS)
+ /* Most free Unixy systems provide getifaddrs, which gives us a linked list
+ * of struct ifaddrs. */
+ struct ifaddrs *ifa = NULL;
+ const struct ifaddrs *i;
+ if (getifaddrs(&ifa) < 0) {
+ event_warn("Unable to call getifaddrs()");
+ return -1;
+ }
+
+ for (i = ifa; i; i = i->ifa_next) {
+ if (!i->ifa_addr)
+ continue;
+ evutil_found_ifaddr(i->ifa_addr);
+ }
+
+ freeifaddrs(ifa);
+ return 0;
+#elif defined(_WIN32)
+ /* Windows XP began to provide GetAdaptersAddresses. Windows 2000 had a
+ "GetAdaptersInfo", but that's deprecated; let's just try
+ GetAdaptersAddresses and fall back to connect+getsockname.
+ */
+ HANDLE lib = evutil_load_windows_system_library_(TEXT("ihplapi.dll"));
+ GetAdaptersAddresses_fn_t fn;
+ ULONG size, res;
+ IP_ADAPTER_ADDRESSES *addresses = NULL, *address;
+ int result = -1;
+
+#define FLAGS (GAA_FLAG_SKIP_ANYCAST | \
+ GAA_FLAG_SKIP_MULTICAST | \
+ GAA_FLAG_SKIP_DNS_SERVER)
+
+ if (!lib)
+ goto done;
+
+ if (!(fn = (GetAdaptersAddresses_fn_t) GetProcAddress(lib, "GetAdaptersAddresses")))
+ goto done;
+
+ /* Guess how much space we need. */
+ size = 15*1024;
+ addresses = mm_malloc(size);
+ if (!addresses)
+ goto done;
+ res = fn(AF_UNSPEC, FLAGS, NULL, addresses, &size);
+ if (res == ERROR_BUFFER_OVERFLOW) {
+ /* we didn't guess that we needed enough space; try again */
+ mm_free(addresses);
+ addresses = mm_malloc(size);
+ if (!addresses)
+ goto done;
+ res = fn(AF_UNSPEC, FLAGS, NULL, addresses, &size);
+ }
+ if (res != NO_ERROR)
+ goto done;
+
+ for (address = addresses; address; address = address->Next) {
+ IP_ADAPTER_UNICAST_ADDRESS *a;
+ for (a = address->FirstUnicastAddress; a; a = a->Next) {
+ /* Yes, it's a linked list inside a linked list */
+ struct sockaddr *sa = a->Address.lpSockaddr;
+ evutil_found_ifaddr(sa);
+ }
+ }
+
+ result = 0;
+done:
+ if (lib)
+ FreeLibrary(lib);
+ if (addresses)
+ mm_free(addresses);
+ return result;
+#else
+ return -1;
+#endif
+}
+
+/* Test whether we have an ipv4 interface and an ipv6 interface. Return 0 if
+ * the test seemed successful. */
+static int
+evutil_check_interfaces(int force_recheck)
+{
+ evutil_socket_t fd = -1;
+ struct sockaddr_in sin, sin_out;
+ struct sockaddr_in6 sin6, sin6_out;
+ ev_socklen_t sin_out_len = sizeof(sin_out);
+ ev_socklen_t sin6_out_len = sizeof(sin6_out);
+ int r;
+ if (have_checked_interfaces && !force_recheck)
+ return 0;
+
+ if (evutil_check_ifaddrs() == 0) {
+ /* Use a nice sane interface, if this system has one. */
+ return 0;
+ }
+
+ /* Ugh. There was no nice sane interface. So to check whether we have
+ * an interface open for a given protocol, will try to make a UDP
+ * 'connection' to a remote host on the internet. We don't actually
+ * use it, so the address doesn't matter, but we want to pick one that
+ * keep us from using a host- or link-local interface. */
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(53);
+ r = evutil_inet_pton(AF_INET, "18.244.0.188", &sin.sin_addr);
+ EVUTIL_ASSERT(r);
+
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(53);
+ r = evutil_inet_pton(AF_INET6, "2001:4860:b002::68", &sin6.sin6_addr);
+ EVUTIL_ASSERT(r);
+
+ memset(&sin_out, 0, sizeof(sin_out));
+ memset(&sin6_out, 0, sizeof(sin6_out));
+
+ /* XXX some errnos mean 'no address'; some mean 'not enough sockets'. */
+ if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) >= 0 &&
+ connect(fd, (struct sockaddr*)&sin, sizeof(sin)) == 0 &&
+ getsockname(fd, (struct sockaddr*)&sin_out, &sin_out_len) == 0) {
+ /* We might have an IPv4 interface. */
+ evutil_found_ifaddr((struct sockaddr*) &sin_out);
+ }
+ if (fd >= 0)
+ evutil_closesocket(fd);
+
+ if ((fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP)) >= 0 &&
+ connect(fd, (struct sockaddr*)&sin6, sizeof(sin6)) == 0 &&
+ getsockname(fd, (struct sockaddr*)&sin6_out, &sin6_out_len) == 0) {
+ /* We might have an IPv6 interface. */
+ evutil_found_ifaddr((struct sockaddr*) &sin6_out);
+ }
+
+ if (fd >= 0)
+ evutil_closesocket(fd);
+
+ return 0;
+}
+
+/* Internal addrinfo flag. This one is set when we allocate the addrinfo from
+ * inside libevent. Otherwise, the built-in getaddrinfo() function allocated
+ * it, and we should trust what they said.
+ **/
+#define EVUTIL_AI_LIBEVENT_ALLOCATED 0x80000000
+
+/* Helper: construct a new addrinfo containing the socket address in
+ * 'sa', which must be a sockaddr_in or a sockaddr_in6. Take the
+ * socktype and protocol info from hints. If they weren't set, then
+ * allocate both a TCP and a UDP addrinfo.
+ */
+struct evutil_addrinfo *
+evutil_new_addrinfo_(struct sockaddr *sa, ev_socklen_t socklen,
+ const struct evutil_addrinfo *hints)
+{
+ struct evutil_addrinfo *res;
+ EVUTIL_ASSERT(hints);
+
+ if (hints->ai_socktype == 0 && hints->ai_protocol == 0) {
+ /* Indecisive user! Give them a UDP and a TCP. */
+ struct evutil_addrinfo *r1, *r2;
+ struct evutil_addrinfo tmp;
+ memcpy(&tmp, hints, sizeof(tmp));
+ tmp.ai_socktype = SOCK_STREAM; tmp.ai_protocol = IPPROTO_TCP;
+ r1 = evutil_new_addrinfo_(sa, socklen, &tmp);
+ if (!r1)
+ return NULL;
+ tmp.ai_socktype = SOCK_DGRAM; tmp.ai_protocol = IPPROTO_UDP;
+ r2 = evutil_new_addrinfo_(sa, socklen, &tmp);
+ if (!r2) {
+ evutil_freeaddrinfo(r1);
+ return NULL;
+ }
+ r1->ai_next = r2;
+ return r1;
+ }
+
+ /* We're going to allocate extra space to hold the sockaddr. */
+ res = mm_calloc(1,sizeof(struct evutil_addrinfo)+socklen);
+ if (!res)
+ return NULL;
+ res->ai_addr = (struct sockaddr*)
+ (((char*)res) + sizeof(struct evutil_addrinfo));
+ memcpy(res->ai_addr, sa, socklen);
+ res->ai_addrlen = socklen;
+ res->ai_family = sa->sa_family; /* Same or not? XXX */
+ res->ai_flags = EVUTIL_AI_LIBEVENT_ALLOCATED;
+ res->ai_socktype = hints->ai_socktype;
+ res->ai_protocol = hints->ai_protocol;
+
+ return res;
+}
+
+/* Append the addrinfo 'append' to the end of 'first', and return the start of
+ * the list. Either element can be NULL, in which case we return the element
+ * that is not NULL. */
+struct evutil_addrinfo *
+evutil_addrinfo_append_(struct evutil_addrinfo *first,
+ struct evutil_addrinfo *append)
+{
+ struct evutil_addrinfo *ai = first;
+ if (!ai)
+ return append;
+ while (ai->ai_next)
+ ai = ai->ai_next;
+ ai->ai_next = append;
+
+ return first;
+}
+
+static int
+parse_numeric_servname(const char *servname)
+{
+ int n;
+ char *endptr=NULL;
+ n = (int) strtol(servname, &endptr, 10);
+ if (n>=0 && n <= 65535 && servname[0] && endptr && !endptr[0])
+ return n;
+ else
+ return -1;
+}
+
+/** Parse a service name in 'servname', which can be a decimal port.
+ * Return the port number, or -1 on error.
+ */
+static int
+evutil_parse_servname(const char *servname, const char *protocol,
+ const struct evutil_addrinfo *hints)
+{
+ int n = parse_numeric_servname(servname);
+ if (n>=0)
+ return n;
+#if defined(EVENT__HAVE_GETSERVBYNAME) || defined(_WIN32)
+ if (!(hints->ai_flags & EVUTIL_AI_NUMERICSERV)) {
+ struct servent *ent = getservbyname(servname, protocol);
+ if (ent) {
+ return ntohs(ent->s_port);
+ }
+ }
+#endif
+ return -1;
+}
+
+/* Return a string corresponding to a protocol number that we can pass to
+ * getservyname. */
+static const char *
+evutil_unparse_protoname(int proto)
+{
+ switch (proto) {
+ case 0:
+ return NULL;
+ case IPPROTO_TCP:
+ return "tcp";
+ case IPPROTO_UDP:
+ return "udp";
+#ifdef IPPROTO_SCTP
+ case IPPROTO_SCTP:
+ return "sctp";
+#endif
+ default:
+#ifdef EVENT__HAVE_GETPROTOBYNUMBER
+ {
+ struct protoent *ent = getprotobynumber(proto);
+ if (ent)
+ return ent->p_name;
+ }
+#endif
+ return NULL;
+ }
+}
+
+static void
+evutil_getaddrinfo_infer_protocols(struct evutil_addrinfo *hints)
+{
+ /* If we can guess the protocol from the socktype, do so. */
+ if (!hints->ai_protocol && hints->ai_socktype) {
+ if (hints->ai_socktype == SOCK_DGRAM)
+ hints->ai_protocol = IPPROTO_UDP;
+ else if (hints->ai_socktype == SOCK_STREAM)
+ hints->ai_protocol = IPPROTO_TCP;
+ }
+
+ /* Set the socktype if it isn't set. */
+ if (!hints->ai_socktype && hints->ai_protocol) {
+ if (hints->ai_protocol == IPPROTO_UDP)
+ hints->ai_socktype = SOCK_DGRAM;
+ else if (hints->ai_protocol == IPPROTO_TCP)
+ hints->ai_socktype = SOCK_STREAM;
+#ifdef IPPROTO_SCTP
+ else if (hints->ai_protocol == IPPROTO_SCTP)
+ hints->ai_socktype = SOCK_STREAM;
+#endif
+ }
+}
+
+#if AF_UNSPEC != PF_UNSPEC
+#error "I cannot build on a system where AF_UNSPEC != PF_UNSPEC"
+#endif
+
+/** Implements the part of looking up hosts by name that's common to both
+ * the blocking and nonblocking resolver:
+ * - Adjust 'hints' to have a reasonable socktype and protocol.
+ * - Look up the port based on 'servname', and store it in *portnum,
+ * - Handle the nodename==NULL case
+ * - Handle some invalid arguments cases.
+ * - Handle the cases where nodename is an IPv4 or IPv6 address.
+ *
+ * If we need the resolver to look up the hostname, we return
+ * EVUTIL_EAI_NEED_RESOLVE. Otherwise, we can completely implement
+ * getaddrinfo: we return 0 or an appropriate EVUTIL_EAI_* error, and
+ * set *res as getaddrinfo would.
+ */
+int
+evutil_getaddrinfo_common_(const char *nodename, const char *servname,
+ struct evutil_addrinfo *hints, struct evutil_addrinfo **res, int *portnum)
+{
+ int port = 0;
+ const char *pname;
+
+ if (nodename == NULL && servname == NULL)
+ return EVUTIL_EAI_NONAME;
+
+ /* We only understand 3 families */
+ if (hints->ai_family != PF_UNSPEC && hints->ai_family != PF_INET &&
+ hints->ai_family != PF_INET6)
+ return EVUTIL_EAI_FAMILY;
+
+ evutil_getaddrinfo_infer_protocols(hints);
+
+ /* Look up the port number and protocol, if possible. */
+ pname = evutil_unparse_protoname(hints->ai_protocol);
+ if (servname) {
+ /* XXXX We could look at the protocol we got back from
+ * getservbyname, but it doesn't seem too useful. */
+ port = evutil_parse_servname(servname, pname, hints);
+ if (port < 0) {
+ return EVUTIL_EAI_NONAME;
+ }
+ }
+
+ /* If we have no node name, then we're supposed to bind to 'any' and
+ * connect to localhost. */
+ if (nodename == NULL) {
+ struct evutil_addrinfo *res4=NULL, *res6=NULL;
+ if (hints->ai_family != PF_INET) { /* INET6 or UNSPEC. */
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ if (hints->ai_flags & EVUTIL_AI_PASSIVE) {
+ /* Bind to :: */
+ } else {
+ /* connect to ::1 */
+ sin6.sin6_addr.s6_addr[15] = 1;
+ }
+ res6 = evutil_new_addrinfo_((struct sockaddr*)&sin6,
+ sizeof(sin6), hints);
+ if (!res6)
+ return EVUTIL_EAI_MEMORY;
+ }
+
+ if (hints->ai_family != PF_INET6) { /* INET or UNSPEC */
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ if (hints->ai_flags & EVUTIL_AI_PASSIVE) {
+ /* Bind to 0.0.0.0 */
+ } else {
+ /* connect to 127.0.0.1 */
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+ }
+ res4 = evutil_new_addrinfo_((struct sockaddr*)&sin,
+ sizeof(sin), hints);
+ if (!res4) {
+ if (res6)
+ evutil_freeaddrinfo(res6);
+ return EVUTIL_EAI_MEMORY;
+ }
+ }
+ *res = evutil_addrinfo_append_(res4, res6);
+ return 0;
+ }
+
+ /* If we can, we should try to parse the hostname without resolving
+ * it. */
+ /* Try ipv6. */
+ if (hints->ai_family == PF_INET6 || hints->ai_family == PF_UNSPEC) {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+ if (1==evutil_inet_pton(AF_INET6, nodename, &sin6.sin6_addr)) {
+ /* Got an ipv6 address. */
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ *res = evutil_new_addrinfo_((struct sockaddr*)&sin6,
+ sizeof(sin6), hints);
+ if (!*res)
+ return EVUTIL_EAI_MEMORY;
+ return 0;
+ }
+ }
+
+ /* Try ipv4. */
+ if (hints->ai_family == PF_INET || hints->ai_family == PF_UNSPEC) {
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+ if (1==evutil_inet_pton(AF_INET, nodename, &sin.sin_addr)) {
+ /* Got an ipv6 address. */
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ *res = evutil_new_addrinfo_((struct sockaddr*)&sin,
+ sizeof(sin), hints);
+ if (!*res)
+ return EVUTIL_EAI_MEMORY;
+ return 0;
+ }
+ }
+
+
+ /* If we have reached this point, we definitely need to do a DNS
+ * lookup. */
+ if ((hints->ai_flags & EVUTIL_AI_NUMERICHOST)) {
+ /* If we're not allowed to do one, then say so. */
+ return EVUTIL_EAI_NONAME;
+ }
+ *portnum = port;
+ return EVUTIL_EAI_NEED_RESOLVE;
+}
+
+#ifdef EVENT__HAVE_GETADDRINFO
+#define USE_NATIVE_GETADDRINFO
+#endif
+
+#ifdef USE_NATIVE_GETADDRINFO
+/* A mask of all the flags that we declare, so we can clear them before calling
+ * the native getaddrinfo */
+static const unsigned int ALL_NONNATIVE_AI_FLAGS =
+#ifndef AI_PASSIVE
+ EVUTIL_AI_PASSIVE |
+#endif
+#ifndef AI_CANONNAME
+ EVUTIL_AI_CANONNAME |
+#endif
+#ifndef AI_NUMERICHOST
+ EVUTIL_AI_NUMERICHOST |
+#endif
+#ifndef AI_NUMERICSERV
+ EVUTIL_AI_NUMERICSERV |
+#endif
+#ifndef AI_ADDRCONFIG
+ EVUTIL_AI_ADDRCONFIG |
+#endif
+#ifndef AI_ALL
+ EVUTIL_AI_ALL |
+#endif
+#ifndef AI_V4MAPPED
+ EVUTIL_AI_V4MAPPED |
+#endif
+ EVUTIL_AI_LIBEVENT_ALLOCATED;
+
+static const unsigned int ALL_NATIVE_AI_FLAGS =
+#ifdef AI_PASSIVE
+ AI_PASSIVE |
+#endif
+#ifdef AI_CANONNAME
+ AI_CANONNAME |
+#endif
+#ifdef AI_NUMERICHOST
+ AI_NUMERICHOST |
+#endif
+#ifdef AI_NUMERICSERV
+ AI_NUMERICSERV |
+#endif
+#ifdef AI_ADDRCONFIG
+ AI_ADDRCONFIG |
+#endif
+#ifdef AI_ALL
+ AI_ALL |
+#endif
+#ifdef AI_V4MAPPED
+ AI_V4MAPPED |
+#endif
+ 0;
+#endif
+
+#ifndef USE_NATIVE_GETADDRINFO
+/* Helper for systems with no getaddrinfo(): make one or more addrinfos out of
+ * a struct hostent.
+ */
+static struct evutil_addrinfo *
+addrinfo_from_hostent(const struct hostent *ent,
+ int port, const struct evutil_addrinfo *hints)
+{
+ int i;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ struct sockaddr *sa;
+ int socklen;
+ struct evutil_addrinfo *res=NULL, *ai;
+ void *addrp;
+
+ if (ent->h_addrtype == PF_INET) {
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ sa = (struct sockaddr *)&sin;
+ socklen = sizeof(struct sockaddr_in);
+ addrp = &sin.sin_addr;
+ if (ent->h_length != sizeof(sin.sin_addr)) {
+ event_warnx("Weird h_length from gethostbyname");
+ return NULL;
+ }
+ } else if (ent->h_addrtype == PF_INET6) {
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ sa = (struct sockaddr *)&sin6;
+ socklen = sizeof(struct sockaddr_in);
+ addrp = &sin6.sin6_addr;
+ if (ent->h_length != sizeof(sin6.sin6_addr)) {
+ event_warnx("Weird h_length from gethostbyname");
+ return NULL;
+ }
+ } else
+ return NULL;
+
+ for (i = 0; ent->h_addr_list[i]; ++i) {
+ memcpy(addrp, ent->h_addr_list[i], ent->h_length);
+ ai = evutil_new_addrinfo_(sa, socklen, hints);
+ if (!ai) {
+ evutil_freeaddrinfo(res);
+ return NULL;
+ }
+ res = evutil_addrinfo_append_(res, ai);
+ }
+
+ if (res && ((hints->ai_flags & EVUTIL_AI_CANONNAME) && ent->h_name)) {
+ res->ai_canonname = mm_strdup(ent->h_name);
+ if (res->ai_canonname == NULL) {
+ evutil_freeaddrinfo(res);
+ return NULL;
+ }
+ }
+
+ return res;
+}
+#endif
+
+/* If the EVUTIL_AI_ADDRCONFIG flag is set on hints->ai_flags, and
+ * hints->ai_family is PF_UNSPEC, then revise the value of hints->ai_family so
+ * that we'll only get addresses we could maybe connect to.
+ */
+void
+evutil_adjust_hints_for_addrconfig_(struct evutil_addrinfo *hints)
+{
+ if (!(hints->ai_flags & EVUTIL_AI_ADDRCONFIG))
+ return;
+ if (hints->ai_family != PF_UNSPEC)
+ return;
+ if (!have_checked_interfaces)
+ evutil_check_interfaces(0);
+ if (had_ipv4_address && !had_ipv6_address) {
+ hints->ai_family = PF_INET;
+ } else if (!had_ipv4_address && had_ipv6_address) {
+ hints->ai_family = PF_INET6;
+ }
+}
+
+#ifdef USE_NATIVE_GETADDRINFO
+static int need_numeric_port_hack_=0;
+static int need_socktype_protocol_hack_=0;
+static int tested_for_getaddrinfo_hacks=0;
+
+/* Some older BSDs (like OpenBSD up to 4.6) used to believe that
+ giving a numeric port without giving an ai_socktype was verboten.
+ We test for this so we can apply an appropriate workaround. If it
+ turns out that the bug is present, then:
+
+ - If nodename==NULL and servname is numeric, we build an answer
+ ourselves using evutil_getaddrinfo_common_().
+
+ - If nodename!=NULL and servname is numeric, then we set
+ servname=NULL when calling getaddrinfo, and post-process the
+ result to set the ports on it.
+
+ We test for this bug at runtime, since otherwise we can't have the
+ same binary run on multiple BSD versions.
+
+ - Some versions of Solaris believe that it's nice to leave to protocol
+ field set to 0. We test for this so we can apply an appropriate
+ workaround.
+*/
+static void
+test_for_getaddrinfo_hacks(void)
+{
+ int r, r2;
+ struct evutil_addrinfo *ai=NULL, *ai2=NULL;
+ struct evutil_addrinfo hints;
+
+ memset(&hints,0,sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags =
+#ifdef AI_NUMERICHOST
+ AI_NUMERICHOST |
+#endif
+#ifdef AI_NUMERICSERV
+ AI_NUMERICSERV |
+#endif
+ 0;
+ r = getaddrinfo("1.2.3.4", "80", &hints, &ai);
+ hints.ai_socktype = SOCK_STREAM;
+ r2 = getaddrinfo("1.2.3.4", "80", &hints, &ai2);
+ if (r2 == 0 && r != 0) {
+ need_numeric_port_hack_=1;
+ }
+ if (ai2 && ai2->ai_protocol == 0) {
+ need_socktype_protocol_hack_=1;
+ }
+
+ if (ai)
+ freeaddrinfo(ai);
+ if (ai2)
+ freeaddrinfo(ai2);
+ tested_for_getaddrinfo_hacks=1;
+}
+
+static inline int
+need_numeric_port_hack(void)
+{
+ if (!tested_for_getaddrinfo_hacks)
+ test_for_getaddrinfo_hacks();
+ return need_numeric_port_hack_;
+}
+
+static inline int
+need_socktype_protocol_hack(void)
+{
+ if (!tested_for_getaddrinfo_hacks)
+ test_for_getaddrinfo_hacks();
+ return need_socktype_protocol_hack_;
+}
+
+static void
+apply_numeric_port_hack(int port, struct evutil_addrinfo **ai)
+{
+ /* Now we run through the list and set the ports on all of the
+ * results where ports would make sense. */
+ for ( ; *ai; ai = &(*ai)->ai_next) {
+ struct sockaddr *sa = (*ai)->ai_addr;
+ if (sa && sa->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in*)sa;
+ sin->sin_port = htons(port);
+ } else if (sa && sa->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
+ sin6->sin6_port = htons(port);
+ } else {
+ /* A numeric port makes no sense here; remove this one
+ * from the list. */
+ struct evutil_addrinfo *victim = *ai;
+ *ai = victim->ai_next;
+ victim->ai_next = NULL;
+ freeaddrinfo(victim);
+ }
+ }
+}
+
+static int
+apply_socktype_protocol_hack(struct evutil_addrinfo *ai)
+{
+ struct evutil_addrinfo *ai_new;
+ for (; ai; ai = ai->ai_next) {
+ evutil_getaddrinfo_infer_protocols(ai);
+ if (ai->ai_socktype || ai->ai_protocol)
+ continue;
+ ai_new = mm_malloc(sizeof(*ai_new));
+ if (!ai_new)
+ return -1;
+ memcpy(ai_new, ai, sizeof(*ai_new));
+ ai->ai_socktype = SOCK_STREAM;
+ ai->ai_protocol = IPPROTO_TCP;
+ ai_new->ai_socktype = SOCK_DGRAM;
+ ai_new->ai_protocol = IPPROTO_UDP;
+
+ ai_new->ai_next = ai->ai_next;
+ ai->ai_next = ai_new;
+ }
+ return 0;
+}
+#endif
+
+int
+evutil_getaddrinfo(const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in, struct evutil_addrinfo **res)
+{
+#ifdef USE_NATIVE_GETADDRINFO
+ struct evutil_addrinfo hints;
+ int portnum=-1, need_np_hack, err;
+
+ if (hints_in) {
+ memcpy(&hints, hints_in, sizeof(hints));
+ } else {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ }
+
+#ifndef AI_ADDRCONFIG
+ /* Not every system has AI_ADDRCONFIG, so fake it. */
+ if (hints.ai_family == PF_UNSPEC &&
+ (hints.ai_flags & EVUTIL_AI_ADDRCONFIG)) {
+ evutil_adjust_hints_for_addrconfig_(&hints);
+ }
+#endif
+
+#ifndef AI_NUMERICSERV
+ /* Not every system has AI_NUMERICSERV, so fake it. */
+ if (hints.ai_flags & EVUTIL_AI_NUMERICSERV) {
+ if (servname && parse_numeric_servname(servname)<0)
+ return EVUTIL_EAI_NONAME;
+ }
+#endif
+
+ /* Enough operating systems handle enough common non-resolve
+ * cases here weirdly enough that we are better off just
+ * overriding them. For example:
+ *
+ * - Windows doesn't like to infer the protocol from the
+ * socket type, or fill in socket or protocol types much at
+ * all. It also seems to do its own broken implicit
+ * always-on version of AI_ADDRCONFIG that keeps it from
+ * ever resolving even a literal IPv6 address when
+ * ai_addrtype is PF_UNSPEC.
+ */
+#ifdef _WIN32
+ {
+ int tmp_port;
+ err = evutil_getaddrinfo_common_(nodename,servname,&hints,
+ res, &tmp_port);
+ if (err == 0 ||
+ err == EVUTIL_EAI_MEMORY ||
+ err == EVUTIL_EAI_NONAME)
+ return err;
+ /* If we make it here, the system getaddrinfo can
+ * have a crack at it. */
+ }
+#endif
+
+ /* See documentation for need_numeric_port_hack above.*/
+ need_np_hack = need_numeric_port_hack() && servname && !hints.ai_socktype
+ && ((portnum=parse_numeric_servname(servname)) >= 0);
+ if (need_np_hack) {
+ if (!nodename)
+ return evutil_getaddrinfo_common_(
+ NULL,servname,&hints, res, &portnum);
+ servname = NULL;
+ }
+
+ if (need_socktype_protocol_hack()) {
+ evutil_getaddrinfo_infer_protocols(&hints);
+ }
+
+ /* Make sure that we didn't actually steal any AI_FLAGS values that
+ * the system is using. (This is a constant expression, and should ge
+ * optimized out.)
+ *
+ * XXXX Turn this into a compile-time failure rather than a run-time
+ * failure.
+ */
+ EVUTIL_ASSERT((ALL_NONNATIVE_AI_FLAGS & ALL_NATIVE_AI_FLAGS) == 0);
+
+ /* Clear any flags that only libevent understands. */
+ hints.ai_flags &= ~ALL_NONNATIVE_AI_FLAGS;
+
+ err = getaddrinfo(nodename, servname, &hints, res);
+ if (need_np_hack)
+ apply_numeric_port_hack(portnum, res);
+
+ if (need_socktype_protocol_hack()) {
+ if (apply_socktype_protocol_hack(*res) < 0) {
+ evutil_freeaddrinfo(*res);
+ *res = NULL;
+ return EVUTIL_EAI_MEMORY;
+ }
+ }
+ return err;
+#else
+ int port=0, err;
+ struct hostent *ent = NULL;
+ struct evutil_addrinfo hints;
+
+ if (hints_in) {
+ memcpy(&hints, hints_in, sizeof(hints));
+ } else {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ }
+
+ evutil_adjust_hints_for_addrconfig_(&hints);
+
+ err = evutil_getaddrinfo_common_(nodename, servname, &hints, res, &port);
+ if (err != EVUTIL_EAI_NEED_RESOLVE) {
+ /* We either succeeded or failed. No need to continue */
+ return err;
+ }
+
+ err = 0;
+ /* Use any of the various gethostbyname_r variants as available. */
+ {
+#ifdef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG
+ /* This one is what glibc provides. */
+ char buf[2048];
+ struct hostent hostent;
+ int r;
+ r = gethostbyname_r(nodename, &hostent, buf, sizeof(buf), &ent,
+ &err);
+#elif defined(EVENT__HAVE_GETHOSTBYNAME_R_5_ARG)
+ char buf[2048];
+ struct hostent hostent;
+ ent = gethostbyname_r(nodename, &hostent, buf, sizeof(buf),
+ &err);
+#elif defined(EVENT__HAVE_GETHOSTBYNAME_R_3_ARG)
+ struct hostent_data data;
+ struct hostent hostent;
+ memset(&data, 0, sizeof(data));
+ err = gethostbyname_r(nodename, &hostent, &data);
+ ent = err ? NULL : &hostent;
+#else
+ /* fall back to gethostbyname. */
+ /* XXXX This needs a lock everywhere but Windows. */
+ ent = gethostbyname(nodename);
+#ifdef _WIN32
+ err = WSAGetLastError();
+#else
+ err = h_errno;
+#endif
+#endif
+
+ /* Now we have either ent or err set. */
+ if (!ent) {
+ /* XXX is this right for windows ? */
+ switch (err) {
+ case TRY_AGAIN:
+ return EVUTIL_EAI_AGAIN;
+ case NO_RECOVERY:
+ default:
+ return EVUTIL_EAI_FAIL;
+ case HOST_NOT_FOUND:
+ return EVUTIL_EAI_NONAME;
+ case NO_ADDRESS:
+#if NO_DATA != NO_ADDRESS
+ case NO_DATA:
+#endif
+ return EVUTIL_EAI_NODATA;
+ }
+ }
+
+ if (ent->h_addrtype != hints.ai_family &&
+ hints.ai_family != PF_UNSPEC) {
+ /* This wasn't the type we were hoping for. Too bad
+ * we never had a chance to ask gethostbyname for what
+ * we wanted. */
+ return EVUTIL_EAI_NONAME;
+ }
+
+ /* Make sure we got _some_ answers. */
+ if (ent->h_length == 0)
+ return EVUTIL_EAI_NODATA;
+
+ /* If we got an address type we don't know how to make a
+ sockaddr for, give up. */
+ if (ent->h_addrtype != PF_INET && ent->h_addrtype != PF_INET6)
+ return EVUTIL_EAI_FAMILY;
+
+ *res = addrinfo_from_hostent(ent, port, &hints);
+ if (! *res)
+ return EVUTIL_EAI_MEMORY;
+ }
+
+ return 0;
+#endif
+}
+
+void
+evutil_freeaddrinfo(struct evutil_addrinfo *ai)
+{
+#ifdef EVENT__HAVE_GETADDRINFO
+ if (!(ai->ai_flags & EVUTIL_AI_LIBEVENT_ALLOCATED)) {
+ freeaddrinfo(ai);
+ return;
+ }
+#endif
+ while (ai) {
+ struct evutil_addrinfo *next = ai->ai_next;
+ if (ai->ai_canonname)
+ mm_free(ai->ai_canonname);
+ mm_free(ai);
+ ai = next;
+ }
+}
+
+static evdns_getaddrinfo_fn evdns_getaddrinfo_impl = NULL;
+
+void
+evutil_set_evdns_getaddrinfo_fn_(evdns_getaddrinfo_fn fn)
+{
+ if (!evdns_getaddrinfo_impl)
+ evdns_getaddrinfo_impl = fn;
+}
+
+/* Internal helper function: act like evdns_getaddrinfo if dns_base is set;
+ * otherwise do a blocking resolve and pass the result to the callback in the
+ * way that evdns_getaddrinfo would.
+ */
+int
+evutil_getaddrinfo_async_(struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ void (*cb)(int, struct evutil_addrinfo *, void *), void *arg)
+{
+ if (dns_base && evdns_getaddrinfo_impl) {
+ evdns_getaddrinfo_impl(
+ dns_base, nodename, servname, hints_in, cb, arg);
+ } else {
+ struct evutil_addrinfo *ai=NULL;
+ int err;
+ err = evutil_getaddrinfo(nodename, servname, hints_in, &ai);
+ cb(err, ai, arg);
+ }
+ return 0;
+}
+
+const char *
+evutil_gai_strerror(int err)
+{
+ /* As a sneaky side-benefit, this case statement will get most
+ * compilers to tell us if any of the error codes we defined
+ * conflict with the platform's native error codes. */
+ switch (err) {
+ case EVUTIL_EAI_CANCEL:
+ return "Request canceled";
+ case 0:
+ return "No error";
+
+ case EVUTIL_EAI_ADDRFAMILY:
+ return "address family for nodename not supported";
+ case EVUTIL_EAI_AGAIN:
+ return "temporary failure in name resolution";
+ case EVUTIL_EAI_BADFLAGS:
+ return "invalid value for ai_flags";
+ case EVUTIL_EAI_FAIL:
+ return "non-recoverable failure in name resolution";
+ case EVUTIL_EAI_FAMILY:
+ return "ai_family not supported";
+ case EVUTIL_EAI_MEMORY:
+ return "memory allocation failure";
+ case EVUTIL_EAI_NODATA:
+ return "no address associated with nodename";
+ case EVUTIL_EAI_NONAME:
+ return "nodename nor servname provided, or not known";
+ case EVUTIL_EAI_SERVICE:
+ return "servname not supported for ai_socktype";
+ case EVUTIL_EAI_SOCKTYPE:
+ return "ai_socktype not supported";
+ case EVUTIL_EAI_SYSTEM:
+ return "system error";
+ default:
+#if defined(USE_NATIVE_GETADDRINFO) && defined(_WIN32)
+ return gai_strerrorA(err);
+#elif defined(USE_NATIVE_GETADDRINFO)
+ return gai_strerror(err);
+#else
+ return "Unknown error code";
+#endif
+ }
+}
+
+#ifdef _WIN32
+/* destructively remove a trailing line terminator from s */
+static void
+chomp (char *s)
+{
+ size_t len;
+ if (s && (len = strlen (s)) > 0 && s[len - 1] == '\n') {
+ s[--len] = 0;
+ if (len > 0 && s[len - 1] == '\r')
+ s[--len] = 0;
+ }
+}
+
+/* FormatMessage returns allocated strings, but evutil_socket_error_to_string
+ * is supposed to return a string which is good indefinitely without having
+ * to be freed. To make this work without leaking memory, we cache the
+ * string the first time FormatMessage is called on a particular error
+ * code, and then return the cached string on subsequent calls with the
+ * same code. The strings aren't freed until libevent_global_shutdown
+ * (or never). We use a linked list to cache the errors, because we
+ * only expect there to be a few dozen, and that should be fast enough.
+ */
+
+struct cached_sock_errs_entry {
+ HT_ENTRY(cached_sock_errs_entry) node;
+ DWORD code;
+ char *msg; /* allocated with LocalAlloc; free with LocalFree */
+};
+
+static inline unsigned
+hash_cached_sock_errs(const struct cached_sock_errs_entry *e)
+{
+ /* Use Murmur3's 32-bit finalizer as an integer hash function */
+ DWORD h = e->code;
+ h ^= h >> 16;
+ h *= 0x85ebca6b;
+ h ^= h >> 13;
+ h *= 0xc2b2ae35;
+ h ^= h >> 16;
+ return h;
+}
+
+static inline int
+eq_cached_sock_errs(const struct cached_sock_errs_entry *a,
+ const struct cached_sock_errs_entry *b)
+{
+ return a->code == b->code;
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+static void *windows_socket_errors_lock_ = NULL;
+#endif
+
+static HT_HEAD(cached_sock_errs_map, cached_sock_errs_entry)
+ windows_socket_errors = HT_INITIALIZER();
+
+HT_PROTOTYPE(cached_sock_errs_map,
+ cached_sock_errs_entry,
+ node,
+ hash_cached_sock_errs,
+ eq_cached_sock_errs);
+
+HT_GENERATE(cached_sock_errs_map,
+ cached_sock_errs_entry,
+ node,
+ hash_cached_sock_errs,
+ eq_cached_sock_errs,
+ 0.5,
+ mm_malloc,
+ mm_realloc,
+ mm_free);
+
+/** Equivalent to strerror, but for windows socket errors. */
+const char *
+evutil_socket_error_to_string(int errcode)
+{
+ struct cached_sock_errs_entry *errs, *newerr, find;
+ char *msg = NULL;
+
+ EVLOCK_LOCK(windows_socket_errors_lock_, 0);
+
+ find.code = errcode;
+ errs = HT_FIND(cached_sock_errs_map, &windows_socket_errors, &find);
+ if (errs) {
+ msg = errs->msg;
+ goto done;
+ }
+
+ if (0 != FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL, errcode, 0, (LPTSTR)&msg, 0, NULL))
+ chomp (msg); /* because message has trailing newline */
+ else {
+ size_t len = 50;
+ /* use LocalAlloc because FormatMessage does */
+ msg = LocalAlloc(LMEM_FIXED, len);
+ if (!msg) {
+ msg = (char *)"LocalAlloc failed during Winsock error";
+ goto done;
+ }
+ evutil_snprintf(msg, len, "winsock error 0x%08x", errcode);
+ }
+
+ newerr = (struct cached_sock_errs_entry *)
+ mm_malloc(sizeof (struct cached_sock_errs_entry));
+
+ if (!newerr) {
+ LocalFree(msg);
+ msg = (char *)"malloc failed during Winsock error";
+ goto done;
+ }
+
+ newerr->code = errcode;
+ newerr->msg = msg;
+ HT_INSERT(cached_sock_errs_map, &windows_socket_errors, newerr);
+
+ done:
+ EVLOCK_UNLOCK(windows_socket_errors_lock_, 0);
+
+ return msg;
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_global_setup_locks_(const int enable_locks)
+{
+ EVTHREAD_SETUP_GLOBAL_LOCK(windows_socket_errors_lock_, 0);
+ return 0;
+}
+#endif
+
+static void
+evutil_free_sock_err_globals(void)
+{
+ struct cached_sock_errs_entry **errs, *tofree;
+
+ for (errs = HT_START(cached_sock_errs_map, &windows_socket_errors)
+ ; errs; ) {
+ tofree = *errs;
+ errs = HT_NEXT_RMV(cached_sock_errs_map,
+ &windows_socket_errors,
+ errs);
+ LocalFree(tofree->msg);
+ mm_free(tofree);
+ }
+
+ HT_CLEAR(cached_sock_errs_map, &windows_socket_errors);
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (windows_socket_errors_lock_ != NULL) {
+ EVTHREAD_FREE_LOCK(windows_socket_errors_lock_, 0);
+ windows_socket_errors_lock_ = NULL;
+ }
+#endif
+}
+
+#else
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_global_setup_locks_(const int enable_locks)
+{
+ return 0;
+}
+#endif
+
+static void
+evutil_free_sock_err_globals(void)
+{
+}
+
+#endif
+
+int
+evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
+{
+ int r;
+ va_list ap;
+ va_start(ap, format);
+ r = evutil_vsnprintf(buf, buflen, format, ap);
+ va_end(ap);
+ return r;
+}
+
+int
+evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
+{
+ int r;
+ if (!buflen)
+ return 0;
+#if defined(_MSC_VER) || defined(_WIN32)
+ r = _vsnprintf(buf, buflen, format, ap);
+ if (r < 0)
+ r = _vscprintf(format, ap);
+#elif defined(sgi)
+ /* Make sure we always use the correct vsnprintf on IRIX */
+ extern int _xpg5_vsnprintf(char * __restrict,
+ __SGI_LIBC_NAMESPACE_QUALIFIER size_t,
+ const char * __restrict, /* va_list */ char *);
+
+ r = _xpg5_vsnprintf(buf, buflen, format, ap);
+#else
+ r = vsnprintf(buf, buflen, format, ap);
+#endif
+ buf[buflen-1] = '\0';
+ return r;
+}
+
+#define USE_INTERNAL_NTOP
+#define USE_INTERNAL_PTON
+
+const char *
+evutil_inet_ntop(int af, const void *src, char *dst, size_t len)
+{
+#if defined(EVENT__HAVE_INET_NTOP) && !defined(USE_INTERNAL_NTOP)
+ return inet_ntop(af, src, dst, len);
+#else
+ if (af == AF_INET) {
+ const struct in_addr *in = src;
+ const ev_uint32_t a = ntohl(in->s_addr);
+ int r;
+ r = evutil_snprintf(dst, len, "%d.%d.%d.%d",
+ (int)(ev_uint8_t)((a>>24)&0xff),
+ (int)(ev_uint8_t)((a>>16)&0xff),
+ (int)(ev_uint8_t)((a>>8 )&0xff),
+ (int)(ev_uint8_t)((a )&0xff));
+ if (r<0||(size_t)r>=len)
+ return NULL;
+ else
+ return dst;
+#ifdef AF_INET6
+ } else if (af == AF_INET6) {
+ const struct in6_addr *addr = src;
+ char buf[64], *cp;
+ int longestGapLen = 0, longestGapPos = -1, i,
+ curGapPos = -1, curGapLen = 0;
+ ev_uint16_t words[8];
+ for (i = 0; i < 8; ++i) {
+ words[i] =
+ (((ev_uint16_t)addr->s6_addr[2*i])<<8) + addr->s6_addr[2*i+1];
+ }
+ if (words[0] == 0 && words[1] == 0 && words[2] == 0 && words[3] == 0 &&
+ words[4] == 0 && ((words[5] == 0 && words[6] && words[7]) ||
+ (words[5] == 0xffff))) {
+ /* This is an IPv4 address. */
+ if (words[5] == 0) {
+ evutil_snprintf(buf, sizeof(buf), "::%d.%d.%d.%d",
+ addr->s6_addr[12], addr->s6_addr[13],
+ addr->s6_addr[14], addr->s6_addr[15]);
+ } else {
+ evutil_snprintf(buf, sizeof(buf), "::%x:%d.%d.%d.%d", words[5],
+ addr->s6_addr[12], addr->s6_addr[13],
+ addr->s6_addr[14], addr->s6_addr[15]);
+ }
+ if (strlen(buf) > len)
+ return NULL;
+ strlcpy(dst, buf, len);
+ return dst;
+ }
+ i = 0;
+ while (i < 8) {
+ if (words[i] == 0) {
+ curGapPos = i++;
+ curGapLen = 1;
+ while (i<8 && words[i] == 0) {
+ ++i; ++curGapLen;
+ }
+ if (curGapLen > longestGapLen) {
+ longestGapPos = curGapPos;
+ longestGapLen = curGapLen;
+ }
+ } else {
+ ++i;
+ }
+ }
+ if (longestGapLen<=1)
+ longestGapPos = -1;
+
+ cp = buf;
+ for (i = 0; i < 8; ++i) {
+ if (words[i] == 0 && longestGapPos == i) {
+ if (i == 0)
+ *cp++ = ':';
+ *cp++ = ':';
+ while (i < 8 && words[i] == 0)
+ ++i;
+ --i; /* to compensate for loop increment. */
+ } else {
+ evutil_snprintf(cp,
+ sizeof(buf)-(cp-buf), "%x", (unsigned)words[i]);
+ cp += strlen(cp);
+ if (i != 7)
+ *cp++ = ':';
+ }
+ }
+ *cp = '\0';
+ if (strlen(buf) > len)
+ return NULL;
+ strlcpy(dst, buf, len);
+ return dst;
+#endif
+ } else {
+ return NULL;
+ }
+#endif
+}
+
+int
+evutil_inet_pton(int af, const char *src, void *dst)
+{
+#if defined(EVENT__HAVE_INET_PTON) && !defined(USE_INTERNAL_PTON)
+ return inet_pton(af, src, dst);
+#else
+ if (af == AF_INET) {
+ int a,b,c,d;
+ char more;
+ struct in_addr *addr = dst;
+ if (sscanf(src, "%d.%d.%d.%d%c", &a,&b,&c,&d,&more) != 4)
+ return 0;
+ if (a < 0 || a > 255) return 0;
+ if (b < 0 || b > 255) return 0;
+ if (c < 0 || c > 255) return 0;
+ if (d < 0 || d > 255) return 0;
+ addr->s_addr = htonl((a<<24) | (b<<16) | (c<<8) | d);
+ return 1;
+#ifdef AF_INET6
+ } else if (af == AF_INET6) {
+ struct in6_addr *out = dst;
+ ev_uint16_t words[8];
+ int gapPos = -1, i, setWords=0;
+ const char *dot = strchr(src, '.');
+ const char *eow; /* end of words. */
+ if (dot == src)
+ return 0;
+ else if (!dot)
+ eow = src+strlen(src);
+ else {
+ int byte1,byte2,byte3,byte4;
+ char more;
+ for (eow = dot-1; eow >= src && EVUTIL_ISDIGIT_(*eow); --eow)
+ ;
+ ++eow;
+
+ /* We use "scanf" because some platform inet_aton()s are too lax
+ * about IPv4 addresses of the form "1.2.3" */
+ if (sscanf(eow, "%d.%d.%d.%d%c",
+ &byte1,&byte2,&byte3,&byte4,&more) != 4)
+ return 0;
+
+ if (byte1 > 255 || byte1 < 0 ||
+ byte2 > 255 || byte2 < 0 ||
+ byte3 > 255 || byte3 < 0 ||
+ byte4 > 255 || byte4 < 0)
+ return 0;
+
+ words[6] = (byte1<<8) | byte2;
+ words[7] = (byte3<<8) | byte4;
+ setWords += 2;
+ }
+
+ i = 0;
+ while (src < eow) {
+ if (i > 7)
+ return 0;
+ if (EVUTIL_ISXDIGIT_(*src)) {
+ char *next;
+ long r = strtol(src, &next, 16);
+ if (next > 4+src)
+ return 0;
+ if (next == src)
+ return 0;
+ if (r<0 || r>65536)
+ return 0;
+
+ words[i++] = (ev_uint16_t)r;
+ setWords++;
+ src = next;
+ if (*src != ':' && src != eow)
+ return 0;
+ ++src;
+ } else if (*src == ':' && i > 0 && gapPos==-1) {
+ gapPos = i;
+ ++src;
+ } else if (*src == ':' && i == 0 && src[1] == ':' && gapPos==-1) {
+ gapPos = i;
+ src += 2;
+ } else {
+ return 0;
+ }
+ }
+
+ if (setWords > 8 ||
+ (setWords == 8 && gapPos != -1) ||
+ (setWords < 8 && gapPos == -1))
+ return 0;
+
+ if (gapPos >= 0) {
+ int nToMove = setWords - (dot ? 2 : 0) - gapPos;
+ int gapLen = 8 - setWords;
+ /* assert(nToMove >= 0); */
+ if (nToMove < 0)
+ return -1; /* should be impossible */
+ memmove(&words[gapPos+gapLen], &words[gapPos],
+ sizeof(ev_uint16_t)*nToMove);
+ memset(&words[gapPos], 0, sizeof(ev_uint16_t)*gapLen);
+ }
+ for (i = 0; i < 8; ++i) {
+ out->s6_addr[2*i ] = words[i] >> 8;
+ out->s6_addr[2*i+1] = words[i] & 0xff;
+ }
+
+ return 1;
+#endif
+ } else {
+ return -1;
+ }
+#endif
+}
+
+int
+evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *outlen)
+{
+ int port;
+ char buf[128];
+ const char *cp, *addr_part, *port_part;
+ int is_ipv6;
+ /* recognized formats are:
+ * [ipv6]:port
+ * ipv6
+ * [ipv6]
+ * ipv4:port
+ * ipv4
+ */
+
+ cp = strchr(ip_as_string, ':');
+ if (*ip_as_string == '[') {
+ int len;
+ if (!(cp = strchr(ip_as_string, ']'))) {
+ return -1;
+ }
+ len = (int) ( cp-(ip_as_string + 1) );
+ if (len > (int)sizeof(buf)-1) {
+ return -1;
+ }
+ memcpy(buf, ip_as_string+1, len);
+ buf[len] = '\0';
+ addr_part = buf;
+ if (cp[1] == ':')
+ port_part = cp+2;
+ else
+ port_part = NULL;
+ is_ipv6 = 1;
+ } else if (cp && strchr(cp+1, ':')) {
+ is_ipv6 = 1;
+ addr_part = ip_as_string;
+ port_part = NULL;
+ } else if (cp) {
+ is_ipv6 = 0;
+ if (cp - ip_as_string > (int)sizeof(buf)-1) {
+ return -1;
+ }
+ memcpy(buf, ip_as_string, cp-ip_as_string);
+ buf[cp-ip_as_string] = '\0';
+ addr_part = buf;
+ port_part = cp+1;
+ } else {
+ addr_part = ip_as_string;
+ port_part = NULL;
+ is_ipv6 = 0;
+ }
+
+ if (port_part == NULL) {
+ port = 0;
+ } else {
+ port = atoi(port_part);
+ if (port <= 0 || port > 65535) {
+ return -1;
+ }
+ }
+
+ if (!addr_part)
+ return -1; /* Should be impossible. */
+#ifdef AF_INET6
+ if (is_ipv6)
+ {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+ sin6.sin6_len = sizeof(sin6);
+#endif
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(port);
+ if (1 != evutil_inet_pton(AF_INET6, addr_part, &sin6.sin6_addr))
+ return -1;
+ if ((int)sizeof(sin6) > *outlen)
+ return -1;
+ memset(out, 0, *outlen);
+ memcpy(out, &sin6, sizeof(sin6));
+ *outlen = sizeof(sin6);
+ return 0;
+ }
+ else
+#endif
+ {
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ sin.sin_len = sizeof(sin);
+#endif
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(port);
+ if (1 != evutil_inet_pton(AF_INET, addr_part, &sin.sin_addr))
+ return -1;
+ if ((int)sizeof(sin) > *outlen)
+ return -1;
+ memset(out, 0, *outlen);
+ memcpy(out, &sin, sizeof(sin));
+ *outlen = sizeof(sin);
+ return 0;
+ }
+}
+
+const char *
+evutil_format_sockaddr_port_(const struct sockaddr *sa, char *out, size_t outlen)
+{
+ char b[128];
+ const char *res=NULL;
+ int port;
+ if (sa->sa_family == AF_INET) {
+ const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
+ res = evutil_inet_ntop(AF_INET, &sin->sin_addr,b,sizeof(b));
+ port = ntohs(sin->sin_port);
+ if (res) {
+ evutil_snprintf(out, outlen, "%s:%d", b, port);
+ return out;
+ }
+ } else if (sa->sa_family == AF_INET6) {
+ const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
+ res = evutil_inet_ntop(AF_INET6, &sin6->sin6_addr,b,sizeof(b));
+ port = ntohs(sin6->sin6_port);
+ if (res) {
+ evutil_snprintf(out, outlen, "[%s]:%d", b, port);
+ return out;
+ }
+ }
+
+ evutil_snprintf(out, outlen, "<addr with socktype %d>",
+ (int)sa->sa_family);
+ return out;
+}
+
+int
+evutil_sockaddr_cmp(const struct sockaddr *sa1, const struct sockaddr *sa2,
+ int include_port)
+{
+ int r;
+ if (0 != (r = (sa1->sa_family - sa2->sa_family)))
+ return r;
+
+ if (sa1->sa_family == AF_INET) {
+ const struct sockaddr_in *sin1, *sin2;
+ sin1 = (const struct sockaddr_in *)sa1;
+ sin2 = (const struct sockaddr_in *)sa2;
+ if (sin1->sin_addr.s_addr < sin2->sin_addr.s_addr)
+ return -1;
+ else if (sin1->sin_addr.s_addr > sin2->sin_addr.s_addr)
+ return 1;
+ else if (include_port &&
+ (r = ((int)sin1->sin_port - (int)sin2->sin_port)))
+ return r;
+ else
+ return 0;
+ }
+#ifdef AF_INET6
+ else if (sa1->sa_family == AF_INET6) {
+ const struct sockaddr_in6 *sin1, *sin2;
+ sin1 = (const struct sockaddr_in6 *)sa1;
+ sin2 = (const struct sockaddr_in6 *)sa2;
+ if ((r = memcmp(sin1->sin6_addr.s6_addr, sin2->sin6_addr.s6_addr, 16)))
+ return r;
+ else if (include_port &&
+ (r = ((int)sin1->sin6_port - (int)sin2->sin6_port)))
+ return r;
+ else
+ return 0;
+ }
+#endif
+ return 1;
+}
+
+/* Tables to implement ctypes-replacement EVUTIL_IS*() functions. Each table
+ * has 256 bits to look up whether a character is in some set or not. This
+ * fails on non-ASCII platforms, but so does every other place where we
+ * take a char and write it onto the network.
+ **/
+static const ev_uint32_t EVUTIL_ISALPHA_TABLE[8] =
+ { 0, 0, 0x7fffffe, 0x7fffffe, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISALNUM_TABLE[8] =
+ { 0, 0x3ff0000, 0x7fffffe, 0x7fffffe, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISSPACE_TABLE[8] = { 0x3e00, 0x1, 0, 0, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISXDIGIT_TABLE[8] =
+ { 0, 0x3ff0000, 0x7e, 0x7e, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISDIGIT_TABLE[8] = { 0, 0x3ff0000, 0, 0, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISPRINT_TABLE[8] =
+ { 0, 0xffffffff, 0xffffffff, 0x7fffffff, 0, 0, 0, 0x0 };
+static const ev_uint32_t EVUTIL_ISUPPER_TABLE[8] = { 0, 0, 0x7fffffe, 0, 0, 0, 0, 0 };
+static const ev_uint32_t EVUTIL_ISLOWER_TABLE[8] = { 0, 0, 0, 0x7fffffe, 0, 0, 0, 0 };
+/* Upper-casing and lowercasing tables to map characters to upper/lowercase
+ * equivalents. */
+static const unsigned char EVUTIL_TOUPPER_TABLE[256] = {
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
+ 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
+ 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
+ 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,
+ 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,
+ 96,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,
+ 80,81,82,83,84,85,86,87,88,89,90,123,124,125,126,127,
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,
+};
+static const unsigned char EVUTIL_TOLOWER_TABLE[256] = {
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
+ 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
+ 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
+ 64,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,
+ 112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95,
+ 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,
+ 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+ 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+ 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,
+};
+
+#define IMPL_CTYPE_FN(name) \
+ int EVUTIL_##name##_(char c) { \
+ ev_uint8_t u = c; \
+ return !!(EVUTIL_##name##_TABLE[(u >> 5) & 7] & (1 << (u & 31))); \
+ }
+IMPL_CTYPE_FN(ISALPHA)
+IMPL_CTYPE_FN(ISALNUM)
+IMPL_CTYPE_FN(ISSPACE)
+IMPL_CTYPE_FN(ISDIGIT)
+IMPL_CTYPE_FN(ISXDIGIT)
+IMPL_CTYPE_FN(ISPRINT)
+IMPL_CTYPE_FN(ISLOWER)
+IMPL_CTYPE_FN(ISUPPER)
+
+char EVUTIL_TOLOWER_(char c)
+{
+ return ((char)EVUTIL_TOLOWER_TABLE[(ev_uint8_t)c]);
+}
+char EVUTIL_TOUPPER_(char c)
+{
+ return ((char)EVUTIL_TOUPPER_TABLE[(ev_uint8_t)c]);
+}
+int
+evutil_ascii_strcasecmp(const char *s1, const char *s2)
+{
+ char c1, c2;
+ while (1) {
+ c1 = EVUTIL_TOLOWER_(*s1++);
+ c2 = EVUTIL_TOLOWER_(*s2++);
+ if (c1 < c2)
+ return -1;
+ else if (c1 > c2)
+ return 1;
+ else if (c1 == 0)
+ return 0;
+ }
+}
+int evutil_ascii_strncasecmp(const char *s1, const char *s2, size_t n)
+{
+ char c1, c2;
+ while (n--) {
+ c1 = EVUTIL_TOLOWER_(*s1++);
+ c2 = EVUTIL_TOLOWER_(*s2++);
+ if (c1 < c2)
+ return -1;
+ else if (c1 > c2)
+ return 1;
+ else if (c1 == 0)
+ return 0;
+ }
+ return 0;
+}
+
+void
+evutil_rtrim_lws_(char *str)
+{
+ char *cp;
+
+ if (str == NULL)
+ return;
+
+ if ((cp = strchr(str, '\0')) == NULL || (cp == str))
+ return;
+
+ --cp;
+
+ while (*cp == ' ' || *cp == '\t') {
+ *cp = '\0';
+ if (cp == str)
+ break;
+ --cp;
+ }
+}
+
+static int
+evutil_issetugid(void)
+{
+#ifdef EVENT__HAVE_ISSETUGID
+ return issetugid();
+#else
+
+#ifdef EVENT__HAVE_GETEUID
+ if (getuid() != geteuid())
+ return 1;
+#endif
+#ifdef EVENT__HAVE_GETEGID
+ if (getgid() != getegid())
+ return 1;
+#endif
+ return 0;
+#endif
+}
+
+const char *
+evutil_getenv_(const char *varname)
+{
+ if (evutil_issetugid())
+ return NULL;
+
+ return getenv(varname);
+}
+
+ev_uint32_t
+evutil_weakrand_seed_(struct evutil_weakrand_state *state, ev_uint32_t seed)
+{
+ if (seed == 0) {
+ struct timeval tv;
+ evutil_gettimeofday(&tv, NULL);
+ seed = (ev_uint32_t)tv.tv_sec + (ev_uint32_t)tv.tv_usec;
+#ifdef _WIN32
+ seed += (ev_uint32_t) _getpid();
+#else
+ seed += (ev_uint32_t) getpid();
+#endif
+ }
+ state->seed = seed;
+ return seed;
+}
+
+ev_int32_t
+evutil_weakrand_(struct evutil_weakrand_state *state)
+{
+ /* This RNG implementation is a linear congruential generator, with
+ * modulus 2^31, multiplier 1103515245, and addend 12345. It's also
+ * used by OpenBSD, and by Glibc's TYPE_0 RNG.
+ *
+ * The linear congruential generator is not an industrial-strength
+ * RNG! It's fast, but it can have higher-order patterns. Notably,
+ * the low bits tend to have periodicity.
+ */
+ state->seed = ((state->seed) * 1103515245 + 12345) & 0x7fffffff;
+ return (ev_int32_t)(state->seed);
+}
+
+ev_int32_t
+evutil_weakrand_range_(struct evutil_weakrand_state *state, ev_int32_t top)
+{
+ ev_int32_t divisor, result;
+
+ /* We can't just do weakrand() % top, since the low bits of the LCG
+ * are less random than the high ones. (Specifically, since the LCG
+ * modulus is 2^N, every 2^m for m<N will divide the modulus, and so
+ * therefore the low m bits of the LCG will have period 2^m.) */
+ divisor = EVUTIL_WEAKRAND_MAX / top;
+ do {
+ result = evutil_weakrand_(state) / divisor;
+ } while (result >= top);
+ return result;
+}
+
+/**
+ * Volatile pointer to memset: we use this to keep the compiler from
+ * eliminating our call to memset.
+ */
+void * (*volatile evutil_memset_volatile_)(void *, int, size_t) = memset;
+
+void
+evutil_memclear_(void *mem, size_t len)
+{
+ evutil_memset_volatile_(mem, 0, len);
+}
+
+int
+evutil_sockaddr_is_loopback_(const struct sockaddr *addr)
+{
+ static const char LOOPBACK_S6[16] =
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1";
+ if (addr->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)addr;
+ return (ntohl(sin->sin_addr.s_addr) & 0xff000000) == 0x7f000000;
+ } else if (addr->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr;
+ return !memcmp(sin6->sin6_addr.s6_addr, LOOPBACK_S6, 16);
+ }
+ return 0;
+}
+
+int
+evutil_hex_char_to_int_(char c)
+{
+ switch(c)
+ {
+ case '0': return 0;
+ case '1': return 1;
+ case '2': return 2;
+ case '3': return 3;
+ case '4': return 4;
+ case '5': return 5;
+ case '6': return 6;
+ case '7': return 7;
+ case '8': return 8;
+ case '9': return 9;
+ case 'A': case 'a': return 10;
+ case 'B': case 'b': return 11;
+ case 'C': case 'c': return 12;
+ case 'D': case 'd': return 13;
+ case 'E': case 'e': return 14;
+ case 'F': case 'f': return 15;
+ }
+ return -1;
+}
+
+#ifdef _WIN32
+HANDLE
+evutil_load_windows_system_library_(const TCHAR *library_name)
+{
+ TCHAR path[MAX_PATH];
+ unsigned n;
+ n = GetSystemDirectory(path, MAX_PATH);
+ if (n == 0 || n + _tcslen(library_name) + 2 >= MAX_PATH)
+ return 0;
+ _tcscat(path, TEXT("\\"));
+ _tcscat(path, library_name);
+ return LoadLibrary(path);
+}
+#endif
+
+/* Internal wrapper around 'socket' to provide Linux-style support for
+ * syscall-saving methods where available.
+ *
+ * In addition to regular socket behavior, you can use a bitwise or to set the
+ * flags EVUTIL_SOCK_NONBLOCK and EVUTIL_SOCK_CLOEXEC in the 'type' argument,
+ * to make the socket nonblocking or close-on-exec with as few syscalls as
+ * possible.
+ */
+evutil_socket_t
+evutil_socket_(int domain, int type, int protocol)
+{
+ evutil_socket_t r;
+#if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC)
+ r = socket(domain, type, protocol);
+ if (r >= 0)
+ return r;
+ else if ((type & (SOCK_NONBLOCK|SOCK_CLOEXEC)) == 0)
+ return -1;
+#endif
+#define SOCKET_TYPE_MASK (~(EVUTIL_SOCK_NONBLOCK|EVUTIL_SOCK_CLOEXEC))
+ r = socket(domain, type & SOCKET_TYPE_MASK, protocol);
+ if (r < 0)
+ return -1;
+ if (type & EVUTIL_SOCK_NONBLOCK) {
+ if (evutil_fast_socket_nonblocking(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ if (type & EVUTIL_SOCK_CLOEXEC) {
+ if (evutil_fast_socket_closeonexec(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ return r;
+}
+
+/* Internal wrapper around 'accept' or 'accept4' to provide Linux-style
+ * support for syscall-saving methods where available.
+ *
+ * In addition to regular accept behavior, you can set one or more of flags
+ * EVUTIL_SOCK_NONBLOCK and EVUTIL_SOCK_CLOEXEC in the 'flags' argument, to
+ * make the socket nonblocking or close-on-exec with as few syscalls as
+ * possible.
+ */
+evutil_socket_t
+evutil_accept4_(evutil_socket_t sockfd, struct sockaddr *addr,
+ ev_socklen_t *addrlen, int flags)
+{
+ evutil_socket_t result;
+#if defined(EVENT__HAVE_ACCEPT4) && defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
+ result = accept4(sockfd, addr, addrlen, flags);
+ if (result >= 0 || (errno != EINVAL && errno != ENOSYS)) {
+ /* A nonnegative result means that we succeeded, so return.
+ * Failing with EINVAL means that an option wasn't supported,
+ * and failing with ENOSYS means that the syscall wasn't
+ * there: in those cases we want to fall back. Otherwise, we
+ * got a real error, and we should return. */
+ return result;
+ }
+#endif
+ result = accept(sockfd, addr, addrlen);
+ if (result < 0)
+ return result;
+
+ if (flags & EVUTIL_SOCK_CLOEXEC) {
+ if (evutil_fast_socket_closeonexec(result) < 0) {
+ evutil_closesocket(result);
+ return -1;
+ }
+ }
+ if (flags & EVUTIL_SOCK_NONBLOCK) {
+ if (evutil_fast_socket_nonblocking(result) < 0) {
+ evutil_closesocket(result);
+ return -1;
+ }
+ }
+ return result;
+}
+
+/* Internal function: Set fd[0] and fd[1] to a pair of fds such that writes on
+ * fd[0] get read from fd[1]. Make both fds nonblocking and close-on-exec.
+ * Return 0 on success, -1 on failure.
+ */
+int
+evutil_make_internal_pipe_(evutil_socket_t fd[2])
+{
+ /*
+ Making the second socket nonblocking is a bit subtle, given that we
+ ignore any EAGAIN returns when writing to it, and you don't usally
+ do that for a nonblocking socket. But if the kernel gives us EAGAIN,
+ then there's no need to add any more data to the buffer, since
+ the main thread is already either about to wake up and drain it,
+ or woken up and in the process of draining it.
+ */
+
+#if defined(EVENT__HAVE_PIPE2)
+ if (pipe2(fd, O_NONBLOCK|O_CLOEXEC) == 0)
+ return 0;
+#endif
+#if defined(EVENT__HAVE_PIPE)
+ if (pipe(fd) == 0) {
+ if (evutil_fast_socket_nonblocking(fd[0]) < 0 ||
+ evutil_fast_socket_nonblocking(fd[1]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[0]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[1]) < 0) {
+ close(fd[0]);
+ close(fd[1]);
+ fd[0] = fd[1] = -1;
+ return -1;
+ }
+ return 0;
+ } else {
+ event_warn("%s: pipe", __func__);
+ }
+#endif
+
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, fd) == 0) {
+ if (evutil_fast_socket_nonblocking(fd[0]) < 0 ||
+ evutil_fast_socket_nonblocking(fd[1]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[0]) < 0 ||
+ evutil_fast_socket_closeonexec(fd[1]) < 0) {
+ evutil_closesocket(fd[0]);
+ evutil_closesocket(fd[1]);
+ fd[0] = fd[1] = -1;
+ return -1;
+ }
+ return 0;
+ }
+ fd[0] = fd[1] = -1;
+ return -1;
+}
+
+/* Wrapper around eventfd on systems that provide it. Unlike the system
+ * eventfd, it always supports EVUTIL_EFD_CLOEXEC and EVUTIL_EFD_NONBLOCK as
+ * flags. Returns -1 on error or if eventfd is not supported.
+ */
+evutil_socket_t
+evutil_eventfd_(unsigned initval, int flags)
+{
+#if defined(EVENT__HAVE_EVENTFD) && defined(EVENT__HAVE_SYS_EVENTFD_H)
+ int r;
+#if defined(EFD_CLOEXEC) && defined(EFD_NONBLOCK)
+ r = eventfd(initval, flags);
+ if (r >= 0 || flags == 0)
+ return r;
+#endif
+ r = eventfd(initval, 0);
+ if (r < 0)
+ return r;
+ if (flags & EVUTIL_EFD_CLOEXEC) {
+ if (evutil_fast_socket_closeonexec(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ if (flags & EVUTIL_EFD_NONBLOCK) {
+ if (evutil_fast_socket_nonblocking(r) < 0) {
+ evutil_closesocket(r);
+ return -1;
+ }
+ }
+ return r;
+#else
+ return -1;
+#endif
+}
+
+void
+evutil_free_globals_(void)
+{
+ evutil_free_secure_rng_globals_();
+ evutil_free_sock_err_globals();
+}
diff --git a/sntp/libevent/evutil_rand.c b/sntp/libevent/evutil_rand.c
new file mode 100644
index 0000000..046a14b
--- /dev/null
+++ b/sntp/libevent/evutil_rand.c
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* This file has our secure PRNG code. On platforms that have arc4random(),
+ * we just use that. Otherwise, we include arc4random.c as a bunch of static
+ * functions, and wrap it lightly. We don't expose the arc4random*() APIs
+ * because A) they aren't in our namespace, and B) it's not nice to name your
+ * APIs after their implementations. We keep them in a separate file
+ * so that other people can rip it out and use it for whatever.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <limits.h>
+
+#include "util-internal.h"
+#include "evthread-internal.h"
+
+#ifdef EVENT__HAVE_ARC4RANDOM
+#include <stdlib.h>
+#include <string.h>
+int
+evutil_secure_rng_set_urandom_device_file(char *fname)
+{
+ (void) fname;
+ return -1;
+}
+int
+evutil_secure_rng_init(void)
+{
+ /* call arc4random() now to force it to self-initialize */
+ (void) arc4random();
+ return 0;
+}
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_secure_rng_global_setup_locks_(const int enable_locks)
+{
+ return 0;
+}
+#endif
+static void
+evutil_free_secure_rng_globals_locks(void)
+{
+}
+
+static void
+ev_arc4random_buf(void *buf, size_t n)
+{
+#if defined(EVENT__HAVE_ARC4RANDOM_BUF) && !defined(__APPLE__)
+ arc4random_buf(buf, n);
+ return;
+#else
+ unsigned char *b = buf;
+
+#if defined(EVENT__HAVE_ARC4RANDOM_BUF)
+ /* OSX 10.7 introducd arc4random_buf, so if you build your program
+ * there, you'll get surprised when older versions of OSX fail to run.
+ * To solve this, we can check whether the function pointer is set,
+ * and fall back otherwise. (OSX does this using some linker
+ * trickery.)
+ */
+ {
+ void (*tptr)(void *,size_t) =
+ (void (*)(void*,size_t))arc4random_buf;
+ if (tptr != NULL) {
+ arc4random_buf(buf, n);
+ return;
+ }
+ }
+#endif
+ /* Make sure that we start out with b at a 4-byte alignment; plenty
+ * of CPUs care about this for 32-bit access. */
+ if (n >= 4 && ((ev_uintptr_t)b) & 3) {
+ ev_uint32_t u = arc4random();
+ int n_bytes = 4 - (((ev_uintptr_t)b) & 3);
+ memcpy(b, &u, n_bytes);
+ b += n_bytes;
+ n -= n_bytes;
+ }
+ while (n >= 4) {
+ *(ev_uint32_t*)b = arc4random();
+ b += 4;
+ n -= 4;
+ }
+ if (n) {
+ ev_uint32_t u = arc4random();
+ memcpy(b, &u, n);
+ }
+#endif
+}
+
+#else /* !EVENT__HAVE_ARC4RANDOM { */
+
+#ifdef EVENT__ssize_t
+#define ssize_t EVENT__ssize_t
+#endif
+#define ARC4RANDOM_EXPORT static
+#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
+#define ARC4_UNLOCK_() EVLOCK_UNLOCK(arc4rand_lock, 0)
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+static void *arc4rand_lock;
+#endif
+
+#define ARC4RANDOM_UINT32 ev_uint32_t
+#define ARC4RANDOM_NOSTIR
+#define ARC4RANDOM_NORANDOM
+#define ARC4RANDOM_NOUNIFORM
+
+#include "./arc4random.c"
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evutil_secure_rng_global_setup_locks_(const int enable_locks)
+{
+ EVTHREAD_SETUP_GLOBAL_LOCK(arc4rand_lock, 0);
+ return 0;
+}
+#endif
+
+static void
+evutil_free_secure_rng_globals_locks(void)
+{
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (arc4rand_lock != NULL) {
+ EVTHREAD_FREE_LOCK(arc4rand_lock, 0);
+ arc4rand_lock = NULL;
+ }
+#endif
+ return;
+}
+
+int
+evutil_secure_rng_set_urandom_device_file(char *fname)
+{
+#ifdef TRY_SEED_URANDOM
+ ARC4_LOCK_();
+ arc4random_urandom_filename = fname;
+ ARC4_UNLOCK_();
+#endif
+ return 0;
+}
+
+int
+evutil_secure_rng_init(void)
+{
+ int val;
+
+ ARC4_LOCK_();
+ if (!arc4_seeded_ok)
+ arc4_stir();
+ val = arc4_seeded_ok ? 0 : -1;
+ ARC4_UNLOCK_();
+ return val;
+}
+
+static void
+ev_arc4random_buf(void *buf, size_t n)
+{
+ arc4random_buf(buf, n);
+}
+
+#endif /* } !EVENT__HAVE_ARC4RANDOM */
+
+void
+evutil_secure_rng_get_bytes(void *buf, size_t n)
+{
+ ev_arc4random_buf(buf, n);
+}
+
+void
+evutil_secure_rng_add_bytes(const char *buf, size_t n)
+{
+ arc4random_addrandom((unsigned char*)buf,
+ n>(size_t)INT_MAX ? INT_MAX : (int)n);
+}
+
+void
+evutil_free_secure_rng_globals_(void)
+{
+ evutil_free_secure_rng_globals_locks();
+}
diff --git a/sntp/libevent/evutil_time.c b/sntp/libevent/evutil_time.c
new file mode 100644
index 0000000..e433043
--- /dev/null
+++ b/sntp/libevent/evutil_time.c
@@ -0,0 +1,488 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <errno.h>
+#include <limits.h>
+#ifndef EVENT__HAVE_GETTIMEOFDAY
+#include <sys/timeb.h>
+#endif
+#if !defined(EVENT__HAVE_NANOSLEEP) && !defined(EVENT_HAVE_USLEEP) && \
+ !defined(_WIN32)
+#include <sys/select.h>
+#endif
+#include <time.h>
+#include <sys/stat.h>
+#include <string.h>
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+
+#ifndef EVENT__HAVE_GETTIMEOFDAY
+/* No gettimeofday; this must be windows. */
+int
+evutil_gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+#ifdef _MSC_VER
+#define U64_LITERAL(n) n##ui64
+#else
+#define U64_LITERAL(n) n##llu
+#endif
+
+ /* Conversion logic taken from Tor, which in turn took it
+ * from Perl. GetSystemTimeAsFileTime returns its value as
+ * an unaligned (!) 64-bit value containing the number of
+ * 100-nanosecond intervals since 1 January 1601 UTC. */
+#define EPOCH_BIAS U64_LITERAL(116444736000000000)
+#define UNITS_PER_SEC U64_LITERAL(10000000)
+#define USEC_PER_SEC U64_LITERAL(1000000)
+#define UNITS_PER_USEC U64_LITERAL(10)
+ union {
+ FILETIME ft_ft;
+ ev_uint64_t ft_64;
+ } ft;
+
+ if (tv == NULL)
+ return -1;
+
+ GetSystemTimeAsFileTime(&ft.ft_ft);
+
+ if (EVUTIL_UNLIKELY(ft.ft_64 < EPOCH_BIAS)) {
+ /* Time before the unix epoch. */
+ return -1;
+ }
+ ft.ft_64 -= EPOCH_BIAS;
+ tv->tv_sec = (long) (ft.ft_64 / UNITS_PER_SEC);
+ tv->tv_usec = (long) ((ft.ft_64 / UNITS_PER_USEC) % USEC_PER_SEC);
+ return 0;
+}
+#endif
+
+#define MAX_SECONDS_IN_MSEC_LONG \
+ (((LONG_MAX) - 999) / 1000)
+
+long
+evutil_tv_to_msec_(const struct timeval *tv)
+{
+ if (tv->tv_usec > 1000000 || tv->tv_sec > MAX_SECONDS_IN_MSEC_LONG)
+ return -1;
+
+ return (tv->tv_sec * 1000) + ((tv->tv_usec + 999) / 1000);
+}
+
+/*
+ Replacement for usleep on platforms that don't have one. Not guaranteed to
+ be any more finegrained than 1 msec.
+ */
+void
+evutil_usleep_(const struct timeval *tv)
+{
+ if (!tv)
+ return;
+#if defined(_WIN32)
+ {
+ long msec = evutil_tv_to_msec_(tv);
+ Sleep((DWORD)msec);
+ }
+#elif defined(EVENT__HAVE_NANOSLEEP)
+ {
+ struct timespec ts;
+ ts.tv_sec = tv->tv_sec;
+ ts.tv_nsec = tv->tv_usec*1000;
+ nanosleep(&ts, NULL);
+ }
+#elif defined(EVENT__HAVE_USLEEP)
+ /* Some systems don't like to usleep more than 999999 usec */
+ sleep(tv->tv_sec);
+ usleep(tv->tv_usec);
+#else
+ select(0, NULL, NULL, NULL, tv);
+#endif
+}
+
+/*
+ This function assumes it's called repeatedly with a
+ not-actually-so-monotonic time source whose outputs are in 'tv'. It
+ implements a trivial ratcheting mechanism so that the values never go
+ backwards.
+ */
+static void
+adjust_monotonic_time(struct evutil_monotonic_timer *base,
+ struct timeval *tv)
+{
+ evutil_timeradd(tv, &base->adjust_monotonic_clock, tv);
+
+ if (evutil_timercmp(tv, &base->last_time, <)) {
+ /* Guess it wasn't monotonic after all. */
+ struct timeval adjust;
+ evutil_timersub(&base->last_time, tv, &adjust);
+ evutil_timeradd(&adjust, &base->adjust_monotonic_clock,
+ &base->adjust_monotonic_clock);
+ *tv = base->last_time;
+ }
+ base->last_time = *tv;
+}
+
+#if defined(HAVE_POSIX_MONOTONIC)
+/* =====
+ The POSIX clock_gettime() interface provides a few ways to get at a
+ monotonic clock. CLOCK_MONOTONIC is most widely supported. Linux also
+ provides a CLOCK_MONOTONIC_COARSE with accuracy of about 1-4 msec.
+
+ On all platforms I'm aware of, CLOCK_MONOTONIC really is monotonic.
+ Platforms don't agree about whether it should jump on a sleep/resume.
+ */
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int flags)
+{
+ /* CLOCK_MONOTONIC exists on FreeBSD, Linux, and Solaris. You need to
+ * check for it at runtime, because some older kernel versions won't
+ * have it working. */
+#ifdef CLOCK_MONOTONIC_COARSE
+ const int precise = flags & EV_MONOT_PRECISE;
+#endif
+ const int fallback = flags & EV_MONOT_FALLBACK;
+ struct timespec ts;
+
+#ifdef CLOCK_MONOTONIC_COARSE
+ if (CLOCK_MONOTONIC_COARSE < 0) {
+ /* Technically speaking, nothing keeps CLOCK_* from being
+ * negative (as far as I know). This check and the one below
+ * make sure that it's safe for us to use -1 as an "unset"
+ * value. */
+ event_errx(1,"I didn't expect CLOCK_MONOTONIC_COARSE to be < 0");
+ }
+ if (! precise && ! fallback) {
+ if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == 0) {
+ base->monotonic_clock = CLOCK_MONOTONIC_COARSE;
+ return 0;
+ }
+ }
+#endif
+ if (!fallback && clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
+ base->monotonic_clock = CLOCK_MONOTONIC;
+ return 0;
+ }
+
+ if (CLOCK_MONOTONIC < 0) {
+ event_errx(1,"I didn't expect CLOCK_MONOTONIC to be < 0");
+ }
+
+ base->monotonic_clock = -1;
+ return 0;
+}
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ struct timespec ts;
+
+ if (base->monotonic_clock < 0) {
+ if (evutil_gettimeofday(tp, NULL) < 0)
+ return -1;
+ adjust_monotonic_time(base, tp);
+ return 0;
+ }
+
+ if (clock_gettime(base->monotonic_clock, &ts) == -1)
+ return -1;
+ tp->tv_sec = ts.tv_sec;
+ tp->tv_usec = ts.tv_nsec / 1000;
+
+ return 0;
+}
+#endif
+
+#if defined(HAVE_MACH_MONOTONIC)
+/* ======
+ Apple is a little late to the POSIX party. And why not? Instead of
+ clock_gettime(), they provide mach_absolute_time(). Its units are not
+ fixed; we need to use mach_timebase_info() to get the right functions to
+ convert its units into nanoseconds.
+
+ To all appearances, mach_absolute_time() seems to be honest-to-goodness
+ monotonic. Whether it stops during sleep or not is unspecified in
+ principle, and dependent on CPU architecture in practice.
+ */
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int flags)
+{
+ const int fallback = flags & EV_MONOT_FALLBACK;
+ struct mach_timebase_info mi;
+ memset(base, 0, sizeof(*base));
+ /* OSX has mach_absolute_time() */
+ if (!fallback &&
+ mach_timebase_info(&mi) == 0 &&
+ mach_absolute_time() != 0) {
+ /* mach_timebase_info tells us how to convert
+ * mach_absolute_time() into nanoseconds, but we
+ * want to use microseconds instead. */
+ mi.denom *= 1000;
+ memcpy(&base->mach_timebase_units, &mi, sizeof(mi));
+ } else {
+ base->mach_timebase_units.numer = 0;
+ }
+ return 0;
+}
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ ev_uint64_t abstime, usec;
+ if (base->mach_timebase_units.numer == 0) {
+ if (evutil_gettimeofday(tp, NULL) < 0)
+ return -1;
+ adjust_monotonic_time(base, tp);
+ return 0;
+ }
+
+ abstime = mach_absolute_time();
+ usec = (abstime * base->mach_timebase_units.numer)
+ / (base->mach_timebase_units.denom);
+ tp->tv_sec = usec / 1000000;
+ tp->tv_usec = usec % 1000000;
+
+ return 0;
+}
+#endif
+
+#if defined(HAVE_WIN32_MONOTONIC)
+/* =====
+ Turn we now to Windows. Want monontonic time on Windows?
+
+ Windows has QueryPerformanceCounter(), which gives time most high-
+ resolution time. It's a pity it's not so monotonic in practice; it's
+ also got some fun bugs, especially: with older Windowses, under
+ virtualizations, with funny hardware, on multiprocessor systems, and so
+ on. PEP418 [1] has a nice roundup of the issues here.
+
+ There's GetTickCount64() on Vista and later, which gives a number of 1-msec
+ ticks since startup. The accuracy here might be as bad as 10-20 msec, I
+ hear. There's an undocumented function (NtSetTimerResolution) that
+ allegedly increases the accuracy. Good luck!
+
+ There's also GetTickCount(), which is only 32 bits, but seems to be
+ supported on pre-Vista versions of Windows. Apparently, you can coax
+ another 14 bits out of it, giving you 2231 years before rollover.
+
+ The less said about timeGetTime() the better.
+
+ "We don't care. We don't have to. We're the Phone Company."
+ -- Lily Tomlin, SNL
+
+ Our strategy, if precise timers are turned off, is to just use the best
+ GetTickCount equivalent available. If we've been asked for precise timing,
+ then we mostly[2] assume that GetTickCount is monotonic, and correct
+ GetPerformanceCounter to approximate it.
+
+ [1] http://www.python.org/dev/peps/pep-0418
+ [2] Of course, we feed the Windows stuff into adjust_monotonic_time()
+ anyway, just in case it isn't.
+
+ */
+/*
+ Parts of our logic in the win32 timer code here are closely based on
+ BitTorrent's libUTP library. That code is subject to the following
+ license:
+
+ Copyright (c) 2010 BitTorrent, Inc.
+
+ 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.
+*/
+
+static ev_uint64_t
+evutil_GetTickCount_(struct evutil_monotonic_timer *base)
+{
+ if (base->GetTickCount64_fn) {
+ /* Let's just use GetTickCount64 if we can. */
+ return base->GetTickCount64_fn();
+ } else if (base->GetTickCount_fn) {
+ /* Greg Hazel assures me that this works, that BitTorrent has
+ * done it for years, and this it won't turn around and
+ * bite us. He says they found it on some game programmers'
+ * forum some time around 2007.
+ */
+ ev_uint64_t v = base->GetTickCount_fn();
+ return (DWORD)v | ((v >> 18) & 0xFFFFFFFF00000000);
+ } else {
+ /* Here's the fallback implementation. We have to use
+ * GetTickCount() with its given signature, so we only get
+ * 32 bits worth of milliseconds, which will roll ove every
+ * 49 days or so. */
+ DWORD ticks = GetTickCount();
+ if (ticks < base->last_tick_count) {
+ base->adjust_tick_count += ((ev_uint64_t)1) << 32;
+ }
+ base->last_tick_count = ticks;
+ return ticks + base->adjust_tick_count;
+ }
+}
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int flags)
+{
+ const int precise = flags & EV_MONOT_PRECISE;
+ const int fallback = flags & EV_MONOT_FALLBACK;
+ HANDLE h;
+ memset(base, 0, sizeof(*base));
+
+ h = evutil_load_windows_system_library_(TEXT("kernel32.dll"));
+ if (h != NULL && !fallback) {
+ base->GetTickCount64_fn = (ev_GetTickCount_func)GetProcAddress(h, "GetTickCount64");
+ base->GetTickCount_fn = (ev_GetTickCount_func)GetProcAddress(h, "GetTickCount");
+ }
+
+ base->first_tick = base->last_tick_count = evutil_GetTickCount_(base);
+ if (precise && !fallback) {
+ LARGE_INTEGER freq;
+ if (QueryPerformanceFrequency(&freq)) {
+ LARGE_INTEGER counter;
+ QueryPerformanceCounter(&counter);
+ base->first_counter = counter.QuadPart;
+ base->usec_per_count = 1.0e6 / freq.QuadPart;
+ base->use_performance_counter = 1;
+ }
+ }
+
+ return 0;
+}
+
+static inline ev_int64_t
+abs64(ev_int64_t i)
+{
+ return i < 0 ? -i : i;
+}
+
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ ev_uint64_t ticks = evutil_GetTickCount_(base);
+ if (base->use_performance_counter) {
+ /* Here's a trick we took from BitTorrent's libutp, at Greg
+ * Hazel's recommendation. We use QueryPerformanceCounter for
+ * our high-resolution timer, but use GetTickCount*() to keep
+ * it sane, and adjust_monotonic_time() to keep it monotonic.
+ */
+ LARGE_INTEGER counter;
+ ev_int64_t counter_elapsed, counter_usec_elapsed, ticks_elapsed;
+ QueryPerformanceCounter(&counter);
+ counter_elapsed = (ev_int64_t)
+ (counter.QuadPart - base->first_counter);
+ ticks_elapsed = ticks - base->first_tick;
+ /* TODO: This may upset VC6. If you need this to work with
+ * VC6, please supply an appropriate patch. */
+ counter_usec_elapsed = (ev_int64_t)
+ (counter_elapsed * base->usec_per_count);
+
+ if (abs64(ticks_elapsed*1000 - counter_usec_elapsed) > 1000000) {
+ /* It appears that the QueryPerformanceCounter()
+ * result is more than 1 second away from
+ * GetTickCount() result. Let's adjust it to be as
+ * accurate as we can; adjust_monotnonic_time() below
+ * will keep it monotonic. */
+ counter_usec_elapsed = ticks_elapsed * 1000;
+ base->first_counter = (ev_uint64_t) (counter.QuadPart - counter_usec_elapsed / base->usec_per_count);
+ }
+ tp->tv_sec = (time_t) (counter_usec_elapsed / 1000000);
+ tp->tv_usec = counter_usec_elapsed % 1000000;
+
+ } else {
+ /* We're just using GetTickCount(). */
+ tp->tv_sec = (time_t) (ticks / 1000);
+ tp->tv_usec = (ticks % 1000) * 1000;
+ }
+ adjust_monotonic_time(base, tp);
+
+ return 0;
+}
+#endif
+
+#if defined(HAVE_FALLBACK_MONOTONIC)
+/* =====
+ And if none of the other options work, let's just use gettimeofday(), and
+ ratchet it forward so that it acts like a monotonic timer, whether it
+ wants to or not.
+ */
+
+int
+evutil_configure_monotonic_time_(struct evutil_monotonic_timer *base,
+ int precise)
+{
+ memset(base, 0, sizeof(*base));
+ return 0;
+}
+
+int
+evutil_gettime_monotonic_(struct evutil_monotonic_timer *base,
+ struct timeval *tp)
+{
+ if (evutil_gettimeofday(tp, NULL) < 0)
+ return -1;
+ adjust_monotonic_time(base, tp);
+ return 0;
+
+}
+#endif
diff --git a/sntp/libevent/ht-internal.h b/sntp/libevent/ht-internal.h
new file mode 100644
index 0000000..8842f4c
--- /dev/null
+++ b/sntp/libevent/ht-internal.h
@@ -0,0 +1,488 @@
+/* Copyright 2002 Christopher Clark */
+/* Copyright 2005-2012 Nick Mathewson */
+/* Copyright 2009-2012 Niels Provos and Nick Mathewson */
+/* See license at end. */
+
+/* Based on ideas by Christopher Clark and interfaces from Niels Provos. */
+
+#ifndef HT_INTERNAL_H_INCLUDED_
+#define HT_INTERNAL_H_INCLUDED_
+
+#define HT_HEAD(name, type) \
+ struct name { \
+ /* The hash table itself. */ \
+ struct type **hth_table; \
+ /* How long is the hash table? */ \
+ unsigned hth_table_length; \
+ /* How many elements does the table contain? */ \
+ unsigned hth_n_entries; \
+ /* How many elements will we allow in the table before resizing it? */ \
+ unsigned hth_load_limit; \
+ /* Position of hth_table_length in the primes table. */ \
+ int hth_prime_idx; \
+ }
+
+#define HT_INITIALIZER() \
+ { NULL, 0, 0, 0, -1 }
+
+#ifdef HT_NO_CACHE_HASH_VALUES
+#define HT_ENTRY(type) \
+ struct { \
+ struct type *hte_next; \
+ }
+#else
+#define HT_ENTRY(type) \
+ struct { \
+ struct type *hte_next; \
+ unsigned hte_hash; \
+ }
+#endif
+
+#define HT_EMPTY(head) \
+ ((head)->hth_n_entries == 0)
+
+/* How many elements in 'head'? */
+#define HT_SIZE(head) \
+ ((head)->hth_n_entries)
+
+/* Return memory usage for a hashtable (not counting the entries themselves) */
+#define HT_MEM_USAGE(head) \
+ (sizeof(*head) + (head)->hth_table_length * sizeof(void*))
+
+#define HT_FIND(name, head, elm) name##_HT_FIND((head), (elm))
+#define HT_INSERT(name, head, elm) name##_HT_INSERT((head), (elm))
+#define HT_REPLACE(name, head, elm) name##_HT_REPLACE((head), (elm))
+#define HT_REMOVE(name, head, elm) name##_HT_REMOVE((head), (elm))
+#define HT_START(name, head) name##_HT_START(head)
+#define HT_NEXT(name, head, elm) name##_HT_NEXT((head), (elm))
+#define HT_NEXT_RMV(name, head, elm) name##_HT_NEXT_RMV((head), (elm))
+#define HT_CLEAR(name, head) name##_HT_CLEAR(head)
+#define HT_INIT(name, head) name##_HT_INIT(head)
+/* Helper: */
+static inline unsigned
+ht_improve_hash_(unsigned h)
+{
+ /* Aim to protect against poor hash functions by adding logic here
+ * - logic taken from java 1.4 hashtable source */
+ h += ~(h << 9);
+ h ^= ((h >> 14) | (h << 18)); /* >>> */
+ h += (h << 4);
+ h ^= ((h >> 10) | (h << 22)); /* >>> */
+ return h;
+}
+
+#if 0
+/** Basic string hash function, from Java standard String.hashCode(). */
+static inline unsigned
+ht_string_hash_(const char *s)
+{
+ unsigned h = 0;
+ int m = 1;
+ while (*s) {
+ h += ((signed char)*s++)*m;
+ m = (m<<5)-1; /* m *= 31 */
+ }
+ return h;
+}
+#endif
+
+/** Basic string hash function, from Python's str.__hash__() */
+static inline unsigned
+ht_string_hash_(const char *s)
+{
+ unsigned h;
+ const unsigned char *cp = (const unsigned char *)s;
+ h = *cp << 7;
+ while (*cp) {
+ h = (1000003*h) ^ *cp++;
+ }
+ /* This conversion truncates the length of the string, but that's ok. */
+ h ^= (unsigned)(cp-(const unsigned char*)s);
+ return h;
+}
+
+#ifndef HT_NO_CACHE_HASH_VALUES
+#define HT_SET_HASH_(elm, field, hashfn) \
+ do { (elm)->field.hte_hash = hashfn(elm); } while (0)
+#define HT_SET_HASHVAL_(elm, field, val) \
+ do { (elm)->field.hte_hash = (val); } while (0)
+#define HT_ELT_HASH_(elm, field, hashfn) \
+ ((elm)->field.hte_hash)
+#else
+#define HT_SET_HASH_(elm, field, hashfn) \
+ ((void)0)
+#define HT_ELT_HASH_(elm, field, hashfn) \
+ (hashfn(elm))
+#define HT_SET_HASHVAL_(elm, field, val) \
+ ((void)0)
+#endif
+
+/* Helper: alias for the bucket containing 'elm'. */
+#define HT_BUCKET_(head, field, elm, hashfn) \
+ ((head)->hth_table[HT_ELT_HASH_(elm,field,hashfn) % head->hth_table_length])
+
+#define HT_FOREACH(x, name, head) \
+ for ((x) = HT_START(name, head); \
+ (x) != NULL; \
+ (x) = HT_NEXT(name, head, x))
+
+#define HT_PROTOTYPE(name, type, field, hashfn, eqfn) \
+ int name##_HT_GROW(struct name *ht, unsigned min_capacity); \
+ void name##_HT_CLEAR(struct name *ht); \
+ int name##_HT_REP_IS_BAD_(const struct name *ht); \
+ static inline void \
+ name##_HT_INIT(struct name *head) { \
+ head->hth_table_length = 0; \
+ head->hth_table = NULL; \
+ head->hth_n_entries = 0; \
+ head->hth_load_limit = 0; \
+ head->hth_prime_idx = -1; \
+ } \
+ /* Helper: returns a pointer to the right location in the table \
+ * 'head' to find or insert the element 'elm'. */ \
+ static inline struct type ** \
+ name##_HT_FIND_P_(struct name *head, struct type *elm) \
+ { \
+ struct type **p; \
+ if (!head->hth_table) \
+ return NULL; \
+ p = &HT_BUCKET_(head, field, elm, hashfn); \
+ while (*p) { \
+ if (eqfn(*p, elm)) \
+ return p; \
+ p = &(*p)->field.hte_next; \
+ } \
+ return p; \
+ } \
+ /* Return a pointer to the element in the table 'head' matching 'elm', \
+ * or NULL if no such element exists */ \
+ static inline struct type * \
+ name##_HT_FIND(const struct name *head, struct type *elm) \
+ { \
+ struct type **p; \
+ struct name *h = (struct name *) head; \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = name##_HT_FIND_P_(h, elm); \
+ return p ? *p : NULL; \
+ } \
+ /* Insert the element 'elm' into the table 'head'. Do not call this \
+ * function if the table might already contain a matching element. */ \
+ static inline void \
+ name##_HT_INSERT(struct name *head, struct type *elm) \
+ { \
+ struct type **p; \
+ if (!head->hth_table || head->hth_n_entries >= head->hth_load_limit) \
+ name##_HT_GROW(head, head->hth_n_entries+1); \
+ ++head->hth_n_entries; \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = &HT_BUCKET_(head, field, elm, hashfn); \
+ elm->field.hte_next = *p; \
+ *p = elm; \
+ } \
+ /* Insert the element 'elm' into the table 'head'. If there already \
+ * a matching element in the table, replace that element and return \
+ * it. */ \
+ static inline struct type * \
+ name##_HT_REPLACE(struct name *head, struct type *elm) \
+ { \
+ struct type **p, *r; \
+ if (!head->hth_table || head->hth_n_entries >= head->hth_load_limit) \
+ name##_HT_GROW(head, head->hth_n_entries+1); \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = name##_HT_FIND_P_(head, elm); \
+ r = *p; \
+ *p = elm; \
+ if (r && (r!=elm)) { \
+ elm->field.hte_next = r->field.hte_next; \
+ r->field.hte_next = NULL; \
+ return r; \
+ } else { \
+ ++head->hth_n_entries; \
+ return NULL; \
+ } \
+ } \
+ /* Remove any element matching 'elm' from the table 'head'. If such \
+ * an element is found, return it; otherwise return NULL. */ \
+ static inline struct type * \
+ name##_HT_REMOVE(struct name *head, struct type *elm) \
+ { \
+ struct type **p, *r; \
+ HT_SET_HASH_(elm, field, hashfn); \
+ p = name##_HT_FIND_P_(head,elm); \
+ if (!p || !*p) \
+ return NULL; \
+ r = *p; \
+ *p = r->field.hte_next; \
+ r->field.hte_next = NULL; \
+ --head->hth_n_entries; \
+ return r; \
+ } \
+ /* Invoke the function 'fn' on every element of the table 'head', \
+ * using 'data' as its second argument. If the function returns \
+ * nonzero, remove the most recently examined element before invoking \
+ * the function again. */ \
+ static inline void \
+ name##_HT_FOREACH_FN(struct name *head, \
+ int (*fn)(struct type *, void *), \
+ void *data) \
+ { \
+ unsigned idx; \
+ struct type **p, **nextp, *next; \
+ if (!head->hth_table) \
+ return; \
+ for (idx=0; idx < head->hth_table_length; ++idx) { \
+ p = &head->hth_table[idx]; \
+ while (*p) { \
+ nextp = &(*p)->field.hte_next; \
+ next = *nextp; \
+ if (fn(*p, data)) { \
+ --head->hth_n_entries; \
+ *p = next; \
+ } else { \
+ p = nextp; \
+ } \
+ } \
+ } \
+ } \
+ /* Return a pointer to the first element in the table 'head', under \
+ * an arbitrary order. This order is stable under remove operations, \
+ * but not under others. If the table is empty, return NULL. */ \
+ static inline struct type ** \
+ name##_HT_START(struct name *head) \
+ { \
+ unsigned b = 0; \
+ while (b < head->hth_table_length) { \
+ if (head->hth_table[b]) \
+ return &head->hth_table[b]; \
+ ++b; \
+ } \
+ return NULL; \
+ } \
+ /* Return the next element in 'head' after 'elm', under the arbitrary \
+ * order used by HT_START. If there are no more elements, return \
+ * NULL. If 'elm' is to be removed from the table, you must call \
+ * this function for the next value before you remove it. \
+ */ \
+ static inline struct type ** \
+ name##_HT_NEXT(struct name *head, struct type **elm) \
+ { \
+ if ((*elm)->field.hte_next) { \
+ return &(*elm)->field.hte_next; \
+ } else { \
+ unsigned b = (HT_ELT_HASH_(*elm, field, hashfn) % head->hth_table_length)+1; \
+ while (b < head->hth_table_length) { \
+ if (head->hth_table[b]) \
+ return &head->hth_table[b]; \
+ ++b; \
+ } \
+ return NULL; \
+ } \
+ } \
+ static inline struct type ** \
+ name##_HT_NEXT_RMV(struct name *head, struct type **elm) \
+ { \
+ unsigned h = HT_ELT_HASH_(*elm, field, hashfn); \
+ *elm = (*elm)->field.hte_next; \
+ --head->hth_n_entries; \
+ if (*elm) { \
+ return elm; \
+ } else { \
+ unsigned b = (h % head->hth_table_length)+1; \
+ while (b < head->hth_table_length) { \
+ if (head->hth_table[b]) \
+ return &head->hth_table[b]; \
+ ++b; \
+ } \
+ return NULL; \
+ } \
+ }
+
+#define HT_GENERATE(name, type, field, hashfn, eqfn, load, mallocfn, \
+ reallocfn, freefn) \
+ static unsigned name##_PRIMES[] = { \
+ 53, 97, 193, 389, \
+ 769, 1543, 3079, 6151, \
+ 12289, 24593, 49157, 98317, \
+ 196613, 393241, 786433, 1572869, \
+ 3145739, 6291469, 12582917, 25165843, \
+ 50331653, 100663319, 201326611, 402653189, \
+ 805306457, 1610612741 \
+ }; \
+ static unsigned name##_N_PRIMES = \
+ (unsigned)(sizeof(name##_PRIMES)/sizeof(name##_PRIMES[0])); \
+ /* Expand the internal table of 'head' until it is large enough to \
+ * hold 'size' elements. Return 0 on success, -1 on allocation \
+ * failure. */ \
+ int \
+ name##_HT_GROW(struct name *head, unsigned size) \
+ { \
+ unsigned new_len, new_load_limit; \
+ int prime_idx; \
+ struct type **new_table; \
+ if (head->hth_prime_idx == (int)name##_N_PRIMES - 1) \
+ return 0; \
+ if (head->hth_load_limit > size) \
+ return 0; \
+ prime_idx = head->hth_prime_idx; \
+ do { \
+ new_len = name##_PRIMES[++prime_idx]; \
+ new_load_limit = (unsigned)(load*new_len); \
+ } while (new_load_limit <= size && \
+ prime_idx < (int)name##_N_PRIMES); \
+ if ((new_table = mallocfn(new_len*sizeof(struct type*)))) { \
+ unsigned b; \
+ memset(new_table, 0, new_len*sizeof(struct type*)); \
+ for (b = 0; b < head->hth_table_length; ++b) { \
+ struct type *elm, *next; \
+ unsigned b2; \
+ elm = head->hth_table[b]; \
+ while (elm) { \
+ next = elm->field.hte_next; \
+ b2 = HT_ELT_HASH_(elm, field, hashfn) % new_len; \
+ elm->field.hte_next = new_table[b2]; \
+ new_table[b2] = elm; \
+ elm = next; \
+ } \
+ } \
+ if (head->hth_table) \
+ freefn(head->hth_table); \
+ head->hth_table = new_table; \
+ } else { \
+ unsigned b, b2; \
+ new_table = reallocfn(head->hth_table, new_len*sizeof(struct type*)); \
+ if (!new_table) return -1; \
+ memset(new_table + head->hth_table_length, 0, \
+ (new_len - head->hth_table_length)*sizeof(struct type*)); \
+ for (b=0; b < head->hth_table_length; ++b) { \
+ struct type *e, **pE; \
+ for (pE = &new_table[b], e = *pE; e != NULL; e = *pE) { \
+ b2 = HT_ELT_HASH_(e, field, hashfn) % new_len; \
+ if (b2 == b) { \
+ pE = &e->field.hte_next; \
+ } else { \
+ *pE = e->field.hte_next; \
+ e->field.hte_next = new_table[b2]; \
+ new_table[b2] = e; \
+ } \
+ } \
+ } \
+ head->hth_table = new_table; \
+ } \
+ head->hth_table_length = new_len; \
+ head->hth_prime_idx = prime_idx; \
+ head->hth_load_limit = new_load_limit; \
+ return 0; \
+ } \
+ /* Free all storage held by 'head'. Does not free 'head' itself, or \
+ * individual elements. */ \
+ void \
+ name##_HT_CLEAR(struct name *head) \
+ { \
+ if (head->hth_table) \
+ freefn(head->hth_table); \
+ head->hth_table_length = 0; \
+ name##_HT_INIT(head); \
+ } \
+ /* Debugging helper: return false iff the representation of 'head' is \
+ * internally consistent. */ \
+ int \
+ name##_HT_REP_IS_BAD_(const struct name *head) \
+ { \
+ unsigned n, i; \
+ struct type *elm; \
+ if (!head->hth_table_length) { \
+ if (!head->hth_table && !head->hth_n_entries && \
+ !head->hth_load_limit && head->hth_prime_idx == -1) \
+ return 0; \
+ else \
+ return 1; \
+ } \
+ if (!head->hth_table || head->hth_prime_idx < 0 || \
+ !head->hth_load_limit) \
+ return 2; \
+ if (head->hth_n_entries > head->hth_load_limit) \
+ return 3; \
+ if (head->hth_table_length != name##_PRIMES[head->hth_prime_idx]) \
+ return 4; \
+ if (head->hth_load_limit != (unsigned)(load*head->hth_table_length)) \
+ return 5; \
+ for (n = i = 0; i < head->hth_table_length; ++i) { \
+ for (elm = head->hth_table[i]; elm; elm = elm->field.hte_next) { \
+ if (HT_ELT_HASH_(elm, field, hashfn) != hashfn(elm)) \
+ return 1000 + i; \
+ if ((HT_ELT_HASH_(elm, field, hashfn) % head->hth_table_length) != i) \
+ return 10000 + i; \
+ ++n; \
+ } \
+ } \
+ if (n != head->hth_n_entries) \
+ return 6; \
+ return 0; \
+ }
+
+/** Implements an over-optimized "find and insert if absent" block;
+ * not meant for direct usage by typical code, or usage outside the critical
+ * path.*/
+#define HT_FIND_OR_INSERT_(name, field, hashfn, head, eltype, elm, var, y, n) \
+ { \
+ struct name *var##_head_ = head; \
+ struct eltype **var; \
+ if (!var##_head_->hth_table || \
+ var##_head_->hth_n_entries >= var##_head_->hth_load_limit) \
+ name##_HT_GROW(var##_head_, var##_head_->hth_n_entries+1); \
+ HT_SET_HASH_((elm), field, hashfn); \
+ var = name##_HT_FIND_P_(var##_head_, (elm)); \
+ if (*var) { \
+ y; \
+ } else { \
+ n; \
+ } \
+ }
+#define HT_FOI_INSERT_(field, head, elm, newent, var) \
+ { \
+ HT_SET_HASHVAL_(newent, field, (elm)->field.hte_hash); \
+ newent->field.hte_next = NULL; \
+ *var = newent; \
+ ++((head)->hth_n_entries); \
+ }
+
+/*
+ * Copyright 2005, Nick Mathewson. Implementation logic is adapted from code
+ * by Christopher Clark, retrofit to allow drop-in memory management, and to
+ * use the same interface as Niels Provos's tree.h. This is probably still
+ * a derived work, so the original license below still applies.
+ *
+ * Copyright (c) 2002, Christopher Clark
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * 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.
+*/
+
+#endif
+
diff --git a/sntp/libevent/http-internal.h b/sntp/libevent/http-internal.h
new file mode 100644
index 0000000..82dd402
--- /dev/null
+++ b/sntp/libevent/http-internal.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2001-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * This header file contains definitions for dealing with HTTP requests
+ * that are internal to libevent. As user of the library, you should not
+ * need to know about these.
+ */
+
+#ifndef HTTP_INTERNAL_H_INCLUDED_
+#define HTTP_INTERNAL_H_INCLUDED_
+
+#include "event2/event_struct.h"
+#include "util-internal.h"
+#include "defer-internal.h"
+
+#define HTTP_CONNECT_TIMEOUT 45
+#define HTTP_WRITE_TIMEOUT 50
+#define HTTP_READ_TIMEOUT 50
+
+#define HTTP_PREFIX "http://"
+#define HTTP_DEFAULTPORT 80
+
+enum message_read_status {
+ ALL_DATA_READ = 1,
+ MORE_DATA_EXPECTED = 0,
+ DATA_CORRUPTED = -1,
+ REQUEST_CANCELED = -2,
+ DATA_TOO_LONG = -3
+};
+
+struct evbuffer;
+struct addrinfo;
+struct evhttp_request;
+
+/* Indicates an unknown request method. */
+#define EVHTTP_REQ_UNKNOWN_ (1<<15)
+
+enum evhttp_connection_state {
+ EVCON_DISCONNECTED, /**< not currently connected not trying either*/
+ EVCON_CONNECTING, /**< tries to currently connect */
+ EVCON_IDLE, /**< connection is established */
+ EVCON_READING_FIRSTLINE,/**< reading Request-Line (incoming conn) or
+ **< Status-Line (outgoing conn) */
+ EVCON_READING_HEADERS, /**< reading request/response headers */
+ EVCON_READING_BODY, /**< reading request/response body */
+ EVCON_READING_TRAILER, /**< reading request/response chunked trailer */
+ EVCON_WRITING /**< writing request/response headers/body */
+};
+
+struct event_base;
+
+/* A client or server connection. */
+struct evhttp_connection {
+ /* we use this tailq only if this connection was created for an http
+ * server */
+ TAILQ_ENTRY(evhttp_connection) next;
+
+ evutil_socket_t fd;
+ struct bufferevent *bufev;
+
+ struct event retry_ev; /* for retrying connects */
+
+ char *bind_address; /* address to use for binding the src */
+ u_short bind_port; /* local port for binding the src */
+
+ char *address; /* address to connect to */
+ u_short port;
+
+ size_t max_headers_size;
+ ev_uint64_t max_body_size;
+
+ int flags;
+#define EVHTTP_CON_INCOMING 0x0001 /* only one request on it ever */
+#define EVHTTP_CON_OUTGOING 0x0002 /* multiple requests possible */
+#define EVHTTP_CON_CLOSEDETECT 0x0004 /* detecting if persistent close */
+
+ struct timeval timeout; /* timeout for events */
+ int retry_cnt; /* retry count */
+ int retry_max; /* maximum number of retries */
+ struct timeval initial_retry_timeout; /* Timeout for low long to wait
+ * after first failing attempt
+ * before retry */
+
+ enum evhttp_connection_state state;
+
+ /* for server connections, the http server they are connected with */
+ struct evhttp *http_server;
+
+ TAILQ_HEAD(evcon_requestq, evhttp_request) requests;
+
+ void (*cb)(struct evhttp_connection *, void *);
+ void *cb_arg;
+
+ void (*closecb)(struct evhttp_connection *, void *);
+ void *closecb_arg;
+
+ struct event_callback read_more_deferred_cb;
+
+ struct event_base *base;
+ struct evdns_base *dns_base;
+
+ /* Saved conn_addr, to extract IP address from it.
+ *
+ * Because some servers may reset/close connection without waiting clients,
+ * in that case we can't extract IP address even in close_cb.
+ * So we need to save it, just after we connected to remote server. */
+ struct sockaddr_storage *conn_address;
+};
+
+/* A callback for an http server */
+struct evhttp_cb {
+ TAILQ_ENTRY(evhttp_cb) next;
+
+ char *what;
+
+ void (*cb)(struct evhttp_request *req, void *);
+ void *cbarg;
+};
+
+/* both the http server as well as the rpc system need to queue connections */
+TAILQ_HEAD(evconq, evhttp_connection);
+
+/* each bound socket is stored in one of these */
+struct evhttp_bound_socket {
+ TAILQ_ENTRY(evhttp_bound_socket) next;
+
+ struct evconnlistener *listener;
+};
+
+/* server alias list item. */
+struct evhttp_server_alias {
+ TAILQ_ENTRY(evhttp_server_alias) next;
+
+ char *alias; /* the server alias. */
+};
+
+struct evhttp {
+ /* Next vhost, if this is a vhost. */
+ TAILQ_ENTRY(evhttp) next_vhost;
+
+ /* All listeners for this host */
+ TAILQ_HEAD(boundq, evhttp_bound_socket) sockets;
+
+ TAILQ_HEAD(httpcbq, evhttp_cb) callbacks;
+
+ /* All live connections on this host. */
+ struct evconq connections;
+
+ TAILQ_HEAD(vhostsq, evhttp) virtualhosts;
+
+ TAILQ_HEAD(aliasq, evhttp_server_alias) aliases;
+
+ /* NULL if this server is not a vhost */
+ char *vhost_pattern;
+
+ struct timeval timeout;
+
+ size_t default_max_headers_size;
+ ev_uint64_t default_max_body_size;
+ const char *default_content_type;
+
+ /* Bitmask of all HTTP methods that we accept and pass to user
+ * callbacks. */
+ ev_uint16_t allowed_methods;
+
+ /* Fallback callback if all the other callbacks for this connection
+ don't match. */
+ void (*gencb)(struct evhttp_request *req, void *);
+ void *gencbarg;
+ struct bufferevent* (*bevcb)(struct event_base *, void *);
+ void *bevcbarg;
+
+ struct event_base *base;
+};
+
+/* XXX most of these functions could be static. */
+
+/* resets the connection; can be reused for more requests */
+void evhttp_connection_reset_(struct evhttp_connection *);
+
+/* connects if necessary */
+int evhttp_connection_connect_(struct evhttp_connection *);
+
+enum evhttp_request_error;
+/* notifies the current request that it failed; resets connection */
+void evhttp_connection_fail_(struct evhttp_connection *,
+ enum evhttp_request_error error);
+
+enum message_read_status;
+
+enum message_read_status evhttp_parse_firstline_(struct evhttp_request *, struct evbuffer*);
+enum message_read_status evhttp_parse_headers_(struct evhttp_request *, struct evbuffer*);
+
+void evhttp_start_read_(struct evhttp_connection *);
+
+/* response sending HTML the data in the buffer */
+void evhttp_response_code_(struct evhttp_request *, int, const char *);
+void evhttp_send_page_(struct evhttp_request *, struct evbuffer *);
+
+int evhttp_decode_uri_internal(const char *uri, size_t length,
+ char *ret, int decode_plus);
+
+#endif /* _HTTP_H */
diff --git a/sntp/libevent/http.c b/sntp/libevent/http.c
new file mode 100644
index 0000000..5147022
--- /dev/null
+++ b/sntp/libevent/http.c
@@ -0,0 +1,4814 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_IOCCOM_H
+#include <sys/ioccom.h>
+#endif
+
+#ifndef _WIN32
+#include <sys/resource.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#else
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
+#include <sys/queue.h>
+
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef EVENT__HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef EVENT__HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef _WIN32
+#include <syslog.h>
+#endif
+#include <signal.h>
+#include <time.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#undef timeout_pending
+#undef timeout_initialized
+
+#include "strlcpy-internal.h"
+#include "event2/http.h"
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/http_struct.h"
+#include "event2/http_compat.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "log-internal.h"
+#include "util-internal.h"
+#include "http-internal.h"
+#include "mm-internal.h"
+#include "bufferevent-internal.h"
+
+#ifndef EVENT__HAVE_GETNAMEINFO
+#define NI_MAXSERV 32
+#define NI_MAXHOST 1025
+
+#ifndef NI_NUMERICHOST
+#define NI_NUMERICHOST 1
+#endif
+
+#ifndef NI_NUMERICSERV
+#define NI_NUMERICSERV 2
+#endif
+
+static int
+fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
+ size_t hostlen, char *serv, size_t servlen, int flags)
+{
+ struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+
+ if (serv != NULL) {
+ char tmpserv[16];
+ evutil_snprintf(tmpserv, sizeof(tmpserv),
+ "%d", ntohs(sin->sin_port));
+ if (strlcpy(serv, tmpserv, servlen) >= servlen)
+ return (-1);
+ }
+
+ if (host != NULL) {
+ if (flags & NI_NUMERICHOST) {
+ if (strlcpy(host, inet_ntoa(sin->sin_addr),
+ hostlen) >= hostlen)
+ return (-1);
+ else
+ return (0);
+ } else {
+ struct hostent *hp;
+ hp = gethostbyaddr((char *)&sin->sin_addr,
+ sizeof(struct in_addr), AF_INET);
+ if (hp == NULL)
+ return (-2);
+
+ if (strlcpy(host, hp->h_name, hostlen) >= hostlen)
+ return (-1);
+ else
+ return (0);
+ }
+ }
+ return (0);
+}
+
+#endif
+
+#define REQ_VERSION_BEFORE(req, major_v, minor_v) \
+ ((req)->major < (major_v) || \
+ ((req)->major == (major_v) && (req)->minor < (minor_v)))
+
+#define REQ_VERSION_ATLEAST(req, major_v, minor_v) \
+ ((req)->major > (major_v) || \
+ ((req)->major == (major_v) && (req)->minor >= (minor_v)))
+
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+extern int debug;
+
+static evutil_socket_t bind_socket_ai(struct evutil_addrinfo *, int reuse);
+static evutil_socket_t bind_socket(const char *, ev_uint16_t, int reuse);
+static void name_from_addr(struct sockaddr *, ev_socklen_t, char **, char **);
+static int evhttp_associate_new_request_with_connection(
+ struct evhttp_connection *evcon);
+static void evhttp_connection_start_detectclose(
+ struct evhttp_connection *evcon);
+static void evhttp_connection_stop_detectclose(
+ struct evhttp_connection *evcon);
+static void evhttp_request_dispatch(struct evhttp_connection* evcon);
+static void evhttp_read_firstline(struct evhttp_connection *evcon,
+ struct evhttp_request *req);
+static void evhttp_read_header(struct evhttp_connection *evcon,
+ struct evhttp_request *req);
+static int evhttp_add_header_internal(struct evkeyvalq *headers,
+ const char *key, const char *value);
+static const char *evhttp_response_phrase_internal(int code);
+static void evhttp_get_request(struct evhttp *, evutil_socket_t, struct sockaddr *, ev_socklen_t);
+static void evhttp_write_buffer(struct evhttp_connection *,
+ void (*)(struct evhttp_connection *, void *), void *);
+static void evhttp_make_header(struct evhttp_connection *, struct evhttp_request *);
+
+/* callbacks for bufferevent */
+static void evhttp_read_cb(struct bufferevent *, void *);
+static void evhttp_write_cb(struct bufferevent *, void *);
+static void evhttp_error_cb(struct bufferevent *bufev, short what, void *arg);
+static int evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
+ const char *hostname);
+
+#ifndef EVENT__HAVE_STRSEP
+/* strsep replacement for platforms that lack it. Only works if
+ * del is one character long. */
+static char *
+strsep(char **s, const char *del)
+{
+ char *d, *tok;
+ EVUTIL_ASSERT(strlen(del) == 1);
+ if (!s || !*s)
+ return NULL;
+ tok = *s;
+ d = strstr(tok, del);
+ if (d) {
+ *d = '\0';
+ *s = d + 1;
+ } else
+ *s = NULL;
+ return tok;
+}
+#endif
+
+static size_t
+html_replace(const char ch, const char **escaped)
+{
+ switch (ch) {
+ case '<':
+ *escaped = "&lt;";
+ return 4;
+ case '>':
+ *escaped = "&gt;";
+ return 4;
+ case '"':
+ *escaped = "&quot;";
+ return 6;
+ case '\'':
+ *escaped = "&#039;";
+ return 6;
+ case '&':
+ *escaped = "&amp;";
+ return 5;
+ default:
+ break;
+ }
+
+ return 1;
+}
+
+/*
+ * Replaces <, >, ", ' and & with &lt;, &gt;, &quot;,
+ * &#039; and &amp; correspondingly.
+ *
+ * The returned string needs to be freed by the caller.
+ */
+
+char *
+evhttp_htmlescape(const char *html)
+{
+ size_t i;
+ size_t new_size = 0, old_size = 0;
+ char *escaped_html, *p;
+
+ if (html == NULL)
+ return (NULL);
+
+ old_size = strlen(html);
+ for (i = 0; i < old_size; ++i) {
+ const char *replaced = NULL;
+ const size_t replace_size = html_replace(html[i], &replaced);
+ if (replace_size > EV_SIZE_MAX - new_size) {
+ event_warn("%s: html_replace overflow", __func__);
+ return (NULL);
+ }
+ new_size += replace_size;
+ }
+
+ if (new_size == EV_SIZE_MAX)
+ return (NULL);
+ p = escaped_html = mm_malloc(new_size + 1);
+ if (escaped_html == NULL) {
+ event_warn("%s: malloc(%lu)", __func__,
+ (unsigned long)(new_size + 1));
+ return (NULL);
+ }
+ for (i = 0; i < old_size; ++i) {
+ const char *replaced = &html[i];
+ const size_t len = html_replace(html[i], &replaced);
+ memcpy(p, replaced, len);
+ p += len;
+ }
+
+ *p = '\0';
+
+ return (escaped_html);
+}
+
+/** Given an evhttp_cmd_type, returns a constant string containing the
+ * equivalent HTTP command, or NULL if the evhttp_command_type is
+ * unrecognized. */
+static const char *
+evhttp_method(enum evhttp_cmd_type type)
+{
+ const char *method;
+
+ switch (type) {
+ case EVHTTP_REQ_GET:
+ method = "GET";
+ break;
+ case EVHTTP_REQ_POST:
+ method = "POST";
+ break;
+ case EVHTTP_REQ_HEAD:
+ method = "HEAD";
+ break;
+ case EVHTTP_REQ_PUT:
+ method = "PUT";
+ break;
+ case EVHTTP_REQ_DELETE:
+ method = "DELETE";
+ break;
+ case EVHTTP_REQ_OPTIONS:
+ method = "OPTIONS";
+ break;
+ case EVHTTP_REQ_TRACE:
+ method = "TRACE";
+ break;
+ case EVHTTP_REQ_CONNECT:
+ method = "CONNECT";
+ break;
+ case EVHTTP_REQ_PATCH:
+ method = "PATCH";
+ break;
+ default:
+ method = NULL;
+ break;
+ }
+
+ return (method);
+}
+
+/**
+ * Determines if a response should have a body.
+ * Follows the rules in RFC 2616 section 4.3.
+ * @return 1 if the response MUST have a body; 0 if the response MUST NOT have
+ * a body.
+ */
+static int
+evhttp_response_needs_body(struct evhttp_request *req)
+{
+ return (req->response_code != HTTP_NOCONTENT &&
+ req->response_code != HTTP_NOTMODIFIED &&
+ (req->response_code < 100 || req->response_code >= 200) &&
+ req->type != EVHTTP_REQ_HEAD);
+}
+
+/** Helper: called after we've added some data to an evcon's bufferevent's
+ * output buffer. Sets the evconn's writing-is-done callback, and puts
+ * the bufferevent into writing mode.
+ */
+static void
+evhttp_write_buffer(struct evhttp_connection *evcon,
+ void (*cb)(struct evhttp_connection *, void *), void *arg)
+{
+ event_debug(("%s: preparing to write buffer\n", __func__));
+
+ /* Set call back */
+ evcon->cb = cb;
+ evcon->cb_arg = arg;
+
+ /* Disable the read callback: we don't actually care about data;
+ * we only care about close detection. (We don't disable reading,
+ * since we *do* want to learn about any close events.) */
+ bufferevent_setcb(evcon->bufev,
+ NULL, /*read*/
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+
+ bufferevent_enable(evcon->bufev, EV_WRITE);
+}
+
+static void
+evhttp_send_continue_done(struct evhttp_connection *evcon, void *arg)
+{
+ bufferevent_disable(evcon->bufev, EV_WRITE);
+}
+
+static void
+evhttp_send_continue(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ bufferevent_enable(evcon->bufev, EV_WRITE);
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
+ "HTTP/%d.%d 100 Continue\r\n\r\n",
+ req->major, req->minor);
+ evcon->cb = evhttp_send_continue_done;
+ evcon->cb_arg = NULL;
+ bufferevent_setcb(evcon->bufev,
+ evhttp_read_cb,
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+}
+
+/** Helper: returns true iff evconn is in any connected state. */
+static int
+evhttp_connected(struct evhttp_connection *evcon)
+{
+ switch (evcon->state) {
+ case EVCON_DISCONNECTED:
+ case EVCON_CONNECTING:
+ return (0);
+ case EVCON_IDLE:
+ case EVCON_READING_FIRSTLINE:
+ case EVCON_READING_HEADERS:
+ case EVCON_READING_BODY:
+ case EVCON_READING_TRAILER:
+ case EVCON_WRITING:
+ default:
+ return (1);
+ }
+}
+
+/* Create the headers needed for an outgoing HTTP request, adds them to
+ * the request's header list, and writes the request line to the
+ * connection's output buffer.
+ */
+static void
+evhttp_make_header_request(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ const char *method;
+
+ evhttp_remove_header(req->output_headers, "Proxy-Connection");
+
+ /* Generate request line */
+ method = evhttp_method(req->type);
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
+ "%s %s HTTP/%d.%d\r\n",
+ method, req->uri, req->major, req->minor);
+
+ /* Add the content length on a post or put request if missing */
+ if ((req->type == EVHTTP_REQ_POST || req->type == EVHTTP_REQ_PUT) &&
+ evhttp_find_header(req->output_headers, "Content-Length") == NULL){
+ char size[22];
+ evutil_snprintf(size, sizeof(size), EV_SIZE_FMT,
+ EV_SIZE_ARG(evbuffer_get_length(req->output_buffer)));
+ evhttp_add_header(req->output_headers, "Content-Length", size);
+ }
+}
+
+/** Return true if the list of headers in 'headers', intepreted with respect
+ * to flags, means that we should send a "connection: close" when the request
+ * is done. */
+static int
+evhttp_is_connection_close(int flags, struct evkeyvalq* headers)
+{
+ if (flags & EVHTTP_PROXY_REQUEST) {
+ /* proxy connection */
+ const char *connection = evhttp_find_header(headers, "Proxy-Connection");
+ return (connection == NULL || evutil_ascii_strcasecmp(connection, "keep-alive") != 0);
+ } else {
+ const char *connection = evhttp_find_header(headers, "Connection");
+ return (connection != NULL && evutil_ascii_strcasecmp(connection, "close") == 0);
+ }
+}
+
+/* Return true iff 'headers' contains 'Connection: keep-alive' */
+static int
+evhttp_is_connection_keepalive(struct evkeyvalq* headers)
+{
+ const char *connection = evhttp_find_header(headers, "Connection");
+ return (connection != NULL
+ && evutil_ascii_strncasecmp(connection, "keep-alive", 10) == 0);
+}
+
+/* Add a correct "Date" header to headers, unless it already has one. */
+static void
+evhttp_maybe_add_date_header(struct evkeyvalq *headers)
+{
+ if (evhttp_find_header(headers, "Date") == NULL) {
+ char date[50];
+#ifndef _WIN32
+ struct tm cur;
+#endif
+ struct tm *cur_p;
+ time_t t = time(NULL);
+#ifdef _WIN32
+ cur_p = gmtime(&t);
+#else
+ gmtime_r(&t, &cur);
+ cur_p = &cur;
+#endif
+ if (strftime(date, sizeof(date),
+ "%a, %d %b %Y %H:%M:%S GMT", cur_p) != 0) {
+ evhttp_add_header(headers, "Date", date);
+ }
+ }
+}
+
+/* Add a "Content-Length" header with value 'content_length' to headers,
+ * unless it already has a content-length or transfer-encoding header. */
+static void
+evhttp_maybe_add_content_length_header(struct evkeyvalq *headers,
+ size_t content_length)
+{
+ if (evhttp_find_header(headers, "Transfer-Encoding") == NULL &&
+ evhttp_find_header(headers, "Content-Length") == NULL) {
+ char len[22];
+ evutil_snprintf(len, sizeof(len), EV_SIZE_FMT,
+ EV_SIZE_ARG(content_length));
+ evhttp_add_header(headers, "Content-Length", len);
+ }
+}
+
+/*
+ * Create the headers needed for an HTTP reply in req->output_headers,
+ * and write the first HTTP response for req line to evcon.
+ */
+static void
+evhttp_make_header_response(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ int is_keepalive = evhttp_is_connection_keepalive(req->input_headers);
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
+ "HTTP/%d.%d %d %s\r\n",
+ req->major, req->minor, req->response_code,
+ req->response_code_line);
+
+ if (req->major == 1) {
+ if (req->minor >= 1)
+ evhttp_maybe_add_date_header(req->output_headers);
+
+ /*
+ * if the protocol is 1.0; and the connection was keep-alive
+ * we need to add a keep-alive header, too.
+ */
+ if (req->minor == 0 && is_keepalive)
+ evhttp_add_header(req->output_headers,
+ "Connection", "keep-alive");
+
+ if ((req->minor >= 1 || is_keepalive) &&
+ evhttp_response_needs_body(req)) {
+ /*
+ * we need to add the content length if the
+ * user did not give it, this is required for
+ * persistent connections to work.
+ */
+ evhttp_maybe_add_content_length_header(
+ req->output_headers,
+ evbuffer_get_length(req->output_buffer));
+ }
+ }
+
+ /* Potentially add headers for unidentified content. */
+ if (evhttp_response_needs_body(req)) {
+ if (evhttp_find_header(req->output_headers,
+ "Content-Type") == NULL
+ && evcon->http_server->default_content_type) {
+ evhttp_add_header(req->output_headers,
+ "Content-Type",
+ evcon->http_server->default_content_type);
+ }
+ }
+
+ /* if the request asked for a close, we send a close, too */
+ if (evhttp_is_connection_close(req->flags, req->input_headers)) {
+ evhttp_remove_header(req->output_headers, "Connection");
+ if (!(req->flags & EVHTTP_PROXY_REQUEST))
+ evhttp_add_header(req->output_headers, "Connection", "close");
+ evhttp_remove_header(req->output_headers, "Proxy-Connection");
+ }
+}
+
+/** Generate all headers appropriate for sending the http request in req (or
+ * the response, if we're sending a response), and write them to evcon's
+ * bufferevent. Also writes all data from req->output_buffer */
+static void
+evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ struct evkeyval *header;
+ struct evbuffer *output = bufferevent_get_output(evcon->bufev);
+
+ /*
+ * Depending if this is a HTTP request or response, we might need to
+ * add some new headers or remove existing headers.
+ */
+ if (req->kind == EVHTTP_REQUEST) {
+ evhttp_make_header_request(evcon, req);
+ } else {
+ evhttp_make_header_response(evcon, req);
+ }
+
+ TAILQ_FOREACH(header, req->output_headers, next) {
+ evbuffer_add_printf(output, "%s: %s\r\n",
+ header->key, header->value);
+ }
+ evbuffer_add(output, "\r\n", 2);
+
+ if (evbuffer_get_length(req->output_buffer) > 0) {
+ /*
+ * For a request, we add the POST data, for a reply, this
+ * is the regular data.
+ */
+ /* XXX We might want to support waiting (a limited amount of
+ time) for a continue status line from the server before
+ sending POST/PUT message bodies. */
+ evbuffer_add_buffer(output, req->output_buffer);
+ }
+}
+
+void
+evhttp_connection_set_max_headers_size(struct evhttp_connection *evcon,
+ ev_ssize_t new_max_headers_size)
+{
+ if (new_max_headers_size<0)
+ evcon->max_headers_size = EV_SIZE_MAX;
+ else
+ evcon->max_headers_size = new_max_headers_size;
+}
+void
+evhttp_connection_set_max_body_size(struct evhttp_connection* evcon,
+ ev_ssize_t new_max_body_size)
+{
+ if (new_max_body_size<0)
+ evcon->max_body_size = EV_UINT64_MAX;
+ else
+ evcon->max_body_size = new_max_body_size;
+}
+
+static int
+evhttp_connection_incoming_fail(struct evhttp_request *req,
+ enum evhttp_request_error error)
+{
+ switch (error) {
+ case EVREQ_HTTP_TIMEOUT:
+ case EVREQ_HTTP_EOF:
+ /*
+ * these are cases in which we probably should just
+ * close the connection and not send a reply. this
+ * case may happen when a browser keeps a persistent
+ * connection open and we timeout on the read. when
+ * the request is still being used for sending, we
+ * need to disassociated it from the connection here.
+ */
+ if (!req->userdone) {
+ /* remove it so that it will not be freed */
+ TAILQ_REMOVE(&req->evcon->requests, req, next);
+ /* indicate that this request no longer has a
+ * connection object
+ */
+ req->evcon = NULL;
+ }
+ return (-1);
+ case EVREQ_HTTP_INVALID_HEADER:
+ case EVREQ_HTTP_BUFFER_ERROR:
+ case EVREQ_HTTP_REQUEST_CANCEL:
+ case EVREQ_HTTP_DATA_TOO_LONG:
+ default: /* xxx: probably should just error on default */
+ /* the callback looks at the uri to determine errors */
+ if (req->uri) {
+ mm_free(req->uri);
+ req->uri = NULL;
+ }
+ if (req->uri_elems) {
+ evhttp_uri_free(req->uri_elems);
+ req->uri_elems = NULL;
+ }
+
+ /*
+ * the callback needs to send a reply, once the reply has
+ * been send, the connection should get freed.
+ */
+ (*req->cb)(req, req->cb_arg);
+ }
+
+ return (0);
+}
+
+/* Called when evcon has experienced a (non-recoverable? -NM) error, as
+ * given in error. If it's an outgoing connection, reset the connection,
+ * retry any pending requests, and inform the user. If it's incoming,
+ * delegates to evhttp_connection_incoming_fail(). */
+void
+evhttp_connection_fail_(struct evhttp_connection *evcon,
+ enum evhttp_request_error error)
+{
+ const int errsave = EVUTIL_SOCKET_ERROR();
+ struct evhttp_request* req = TAILQ_FIRST(&evcon->requests);
+ void (*cb)(struct evhttp_request *, void *);
+ void *cb_arg;
+ void (*error_cb)(enum evhttp_request_error, void *);
+ void *error_cb_arg;
+ EVUTIL_ASSERT(req != NULL);
+
+ bufferevent_disable(evcon->bufev, EV_READ|EV_WRITE);
+
+ if (evcon->flags & EVHTTP_CON_INCOMING) {
+ /*
+ * for incoming requests, there are two different
+ * failure cases. it's either a network level error
+ * or an http layer error. for problems on the network
+ * layer like timeouts we just drop the connections.
+ * For HTTP problems, we might have to send back a
+ * reply before the connection can be freed.
+ */
+ if (evhttp_connection_incoming_fail(req, error) == -1)
+ evhttp_connection_free(evcon);
+ return;
+ }
+
+ error_cb = req->error_cb;
+ error_cb_arg = req->cb_arg;
+ /* when the request was canceled, the callback is not executed */
+ if (error != EVREQ_HTTP_REQUEST_CANCEL) {
+ /* save the callback for later; the cb might free our object */
+ cb = req->cb;
+ cb_arg = req->cb_arg;
+ } else {
+ cb = NULL;
+ cb_arg = NULL;
+ }
+
+ /* do not fail all requests; the next request is going to get
+ * send over a new connection. when a user cancels a request,
+ * all other pending requests should be processed as normal
+ */
+ TAILQ_REMOVE(&evcon->requests, req, next);
+ evhttp_request_free(req);
+
+ /* reset the connection */
+ evhttp_connection_reset_(evcon);
+
+ /* We are trying the next request that was queued on us */
+ if (TAILQ_FIRST(&evcon->requests) != NULL)
+ evhttp_connection_connect_(evcon);
+
+ /* The call to evhttp_connection_reset_ overwrote errno.
+ * Let's restore the original errno, so that the user's
+ * callback can have a better idea of what the error was.
+ */
+ EVUTIL_SET_SOCKET_ERROR(errsave);
+
+ /* inform the user */
+ if (error_cb != NULL)
+ error_cb(error, error_cb_arg);
+ if (cb != NULL)
+ (*cb)(NULL, cb_arg);
+}
+
+/* Bufferevent callback: invoked when any data has been written from an
+ * http connection's bufferevent */
+static void
+evhttp_write_cb(struct bufferevent *bufev, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+
+ /* Activate our call back */
+ if (evcon->cb != NULL)
+ (*evcon->cb)(evcon, evcon->cb_arg);
+}
+
+/**
+ * Advance the connection state.
+ * - If this is an outgoing connection, we've just processed the response;
+ * idle or close the connection.
+ * - If this is an incoming connection, we've just processed the request;
+ * respond.
+ */
+static void
+evhttp_connection_done(struct evhttp_connection *evcon)
+{
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+ int con_outgoing = evcon->flags & EVHTTP_CON_OUTGOING;
+
+ if (con_outgoing) {
+ /* idle or close the connection */
+ int need_close;
+ TAILQ_REMOVE(&evcon->requests, req, next);
+ req->evcon = NULL;
+
+ evcon->state = EVCON_IDLE;
+
+ need_close =
+ evhttp_is_connection_close(req->flags, req->input_headers)||
+ evhttp_is_connection_close(req->flags, req->output_headers);
+
+ /* check if we got asked to close the connection */
+ if (need_close)
+ evhttp_connection_reset_(evcon);
+
+ if (TAILQ_FIRST(&evcon->requests) != NULL) {
+ /*
+ * We have more requests; reset the connection
+ * and deal with the next request.
+ */
+ if (!evhttp_connected(evcon))
+ evhttp_connection_connect_(evcon);
+ else
+ evhttp_request_dispatch(evcon);
+ } else if (!need_close) {
+ /*
+ * The connection is going to be persistent, but we
+ * need to detect if the other side closes it.
+ */
+ evhttp_connection_start_detectclose(evcon);
+ }
+ } else {
+ /*
+ * incoming connection - we need to leave the request on the
+ * connection so that we can reply to it.
+ */
+ evcon->state = EVCON_WRITING;
+ }
+
+ /* notify the user of the request */
+ (*req->cb)(req, req->cb_arg);
+
+ /* if this was an outgoing request, we own and it's done. so free it.
+ * unless the callback specifically requested to own the request.
+ */
+ if (con_outgoing && ((req->flags & EVHTTP_USER_OWNED) == 0)) {
+ evhttp_request_free(req);
+ }
+}
+
+/*
+ * Handles reading from a chunked request.
+ * return ALL_DATA_READ:
+ * all data has been read
+ * return MORE_DATA_EXPECTED:
+ * more data is expected
+ * return DATA_CORRUPTED:
+ * data is corrupted
+ * return REQUEST_CANCELED:
+ * request was canceled by the user calling evhttp_cancel_request
+ * return DATA_TOO_LONG:
+ * ran over the maximum limit
+ */
+
+static enum message_read_status
+evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
+{
+ if (req == NULL || buf == NULL) {
+ return DATA_CORRUPTED;
+ }
+
+ while (1) {
+ size_t buflen;
+
+ if ((buflen = evbuffer_get_length(buf)) == 0) {
+ break;
+ }
+
+ /* evbuffer_get_length returns size_t, but len variable is ssize_t,
+ * check for overflow conditions */
+ if (buflen > EV_SSIZE_MAX) {
+ return DATA_CORRUPTED;
+ }
+
+ if (req->ntoread < 0) {
+ /* Read chunk size */
+ ev_int64_t ntoread;
+ char *p = evbuffer_readln(buf, NULL, EVBUFFER_EOL_CRLF);
+ char *endp;
+ int error;
+ if (p == NULL)
+ break;
+ /* the last chunk is on a new line? */
+ if (strlen(p) == 0) {
+ mm_free(p);
+ continue;
+ }
+ ntoread = evutil_strtoll(p, &endp, 16);
+ error = (*p == '\0' ||
+ (*endp != '\0' && *endp != ' ') ||
+ ntoread < 0);
+ mm_free(p);
+ if (error) {
+ /* could not get chunk size */
+ return (DATA_CORRUPTED);
+ }
+
+ /* ntoread is signed int64, body_size is unsigned size_t, check for under/overflow conditions */
+ if ((ev_uint64_t)ntoread > EV_SIZE_MAX - req->body_size) {
+ return DATA_CORRUPTED;
+ }
+
+ if (req->body_size + (size_t)ntoread > req->evcon->max_body_size) {
+ /* failed body length test */
+ event_debug(("Request body is too long"));
+ return (DATA_TOO_LONG);
+ }
+
+ req->body_size += (size_t)ntoread;
+ req->ntoread = ntoread;
+ if (req->ntoread == 0) {
+ /* Last chunk */
+ return (ALL_DATA_READ);
+ }
+ continue;
+ }
+
+ /* req->ntoread is signed int64, len is ssize_t, based on arch,
+ * ssize_t could only be 32b, check for these conditions */
+ if (req->ntoread > EV_SSIZE_MAX) {
+ return DATA_CORRUPTED;
+ }
+
+ /* don't have enough to complete a chunk; wait for more */
+ if (req->ntoread > 0 && buflen < (ev_uint64_t)req->ntoread)
+ return (MORE_DATA_EXPECTED);
+
+ /* Completed chunk */
+ evbuffer_remove_buffer(buf, req->input_buffer, (size_t)req->ntoread);
+ req->ntoread = -1;
+ if (req->chunk_cb != NULL) {
+ req->flags |= EVHTTP_REQ_DEFER_FREE;
+ (*req->chunk_cb)(req, req->cb_arg);
+ evbuffer_drain(req->input_buffer,
+ evbuffer_get_length(req->input_buffer));
+ req->flags &= ~EVHTTP_REQ_DEFER_FREE;
+ if ((req->flags & EVHTTP_REQ_NEEDS_FREE) != 0) {
+ return (REQUEST_CANCELED);
+ }
+ }
+ }
+
+ return (MORE_DATA_EXPECTED);
+}
+
+static void
+evhttp_read_trailer(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ struct evbuffer *buf = bufferevent_get_input(evcon->bufev);
+
+ switch (evhttp_parse_headers_(req, buf)) {
+ case DATA_CORRUPTED:
+ case DATA_TOO_LONG:
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_DATA_TOO_LONG);
+ break;
+ case ALL_DATA_READ:
+ bufferevent_disable(evcon->bufev, EV_READ);
+ evhttp_connection_done(evcon);
+ break;
+ case MORE_DATA_EXPECTED:
+ case REQUEST_CANCELED: /* ??? */
+ default:
+ bufferevent_enable(evcon->bufev, EV_READ);
+ break;
+ }
+}
+
+static void
+evhttp_read_body(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ struct evbuffer *buf = bufferevent_get_input(evcon->bufev);
+
+ if (req->chunked) {
+ switch (evhttp_handle_chunked_read(req, buf)) {
+ case ALL_DATA_READ:
+ /* finished last chunk */
+ evcon->state = EVCON_READING_TRAILER;
+ evhttp_read_trailer(evcon, req);
+ return;
+ case DATA_CORRUPTED:
+ case DATA_TOO_LONG:
+ /* corrupted data */
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_DATA_TOO_LONG);
+ return;
+ case REQUEST_CANCELED:
+ /* request canceled */
+ evhttp_request_free(req);
+ return;
+ case MORE_DATA_EXPECTED:
+ default:
+ break;
+ }
+ } else if (req->ntoread < 0) {
+ /* Read until connection close. */
+ if ((size_t)(req->body_size + evbuffer_get_length(buf)) < req->body_size) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ return;
+ }
+
+ req->body_size += evbuffer_get_length(buf);
+ evbuffer_add_buffer(req->input_buffer, buf);
+ } else if (req->chunk_cb != NULL || evbuffer_get_length(buf) >= (size_t)req->ntoread) {
+ /* XXX: the above get_length comparison has to be fixed for overflow conditions! */
+ /* We've postponed moving the data until now, but we're
+ * about to use it. */
+ size_t n = evbuffer_get_length(buf);
+
+ if (n > (size_t) req->ntoread)
+ n = (size_t) req->ntoread;
+ req->ntoread -= n;
+ req->body_size += n;
+ evbuffer_remove_buffer(buf, req->input_buffer, n);
+ }
+
+ if (req->body_size > req->evcon->max_body_size ||
+ (!req->chunked && req->ntoread >= 0 &&
+ (size_t)req->ntoread > req->evcon->max_body_size)) {
+ /* XXX: The above casted comparison must checked for overflow */
+ /* failed body length test */
+ event_debug(("Request body is too long"));
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_DATA_TOO_LONG);
+ return;
+ }
+
+ if (evbuffer_get_length(req->input_buffer) > 0 && req->chunk_cb != NULL) {
+ req->flags |= EVHTTP_REQ_DEFER_FREE;
+ (*req->chunk_cb)(req, req->cb_arg);
+ req->flags &= ~EVHTTP_REQ_DEFER_FREE;
+ evbuffer_drain(req->input_buffer,
+ evbuffer_get_length(req->input_buffer));
+ if ((req->flags & EVHTTP_REQ_NEEDS_FREE) != 0) {
+ evhttp_request_free(req);
+ return;
+ }
+ }
+
+ if (req->ntoread == 0) {
+ bufferevent_disable(evcon->bufev, EV_READ);
+ /* Completed content length */
+ evhttp_connection_done(evcon);
+ return;
+ }
+
+ /* Read more! */
+ bufferevent_enable(evcon->bufev, EV_READ);
+}
+
+#define get_deferred_queue(evcon) \
+ ((evcon)->base)
+
+/*
+ * Gets called when more data becomes available
+ */
+
+static void
+evhttp_read_cb(struct bufferevent *bufev, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+
+ /* Cancel if it's pending. */
+ event_deferred_cb_cancel_(get_deferred_queue(evcon),
+ &evcon->read_more_deferred_cb);
+
+ switch (evcon->state) {
+ case EVCON_READING_FIRSTLINE:
+ evhttp_read_firstline(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_read_body */
+ break;
+ case EVCON_READING_HEADERS:
+ evhttp_read_header(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_read_body */
+ break;
+ case EVCON_READING_BODY:
+ evhttp_read_body(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_read_body */
+ break;
+ case EVCON_READING_TRAILER:
+ evhttp_read_trailer(evcon, req);
+ break;
+ case EVCON_IDLE:
+ {
+#ifdef USE_DEBUG
+ struct evbuffer *input;
+ size_t total_len;
+
+ input = bufferevent_get_input(evcon->bufev);
+ total_len = evbuffer_get_length(input);
+ event_debug(("%s: read "EV_SIZE_FMT
+ " bytes in EVCON_IDLE state,"
+ " resetting connection",
+ __func__, EV_SIZE_ARG(total_len)));
+#endif
+
+ evhttp_connection_reset_(evcon);
+ }
+ break;
+ case EVCON_DISCONNECTED:
+ case EVCON_CONNECTING:
+ case EVCON_WRITING:
+ default:
+ event_errx(1, "%s: illegal connection state %d",
+ __func__, evcon->state);
+ }
+}
+
+static void
+evhttp_deferred_read_cb(struct event_callback *cb, void *data)
+{
+ struct evhttp_connection *evcon = data;
+ evhttp_read_cb(evcon->bufev, evcon);
+}
+
+static void
+evhttp_write_connectioncb(struct evhttp_connection *evcon, void *arg)
+{
+ /* This is after writing the request to the server */
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+ EVUTIL_ASSERT(req != NULL);
+
+ EVUTIL_ASSERT(evcon->state == EVCON_WRITING);
+
+ /* We are done writing our header and are now expecting the response */
+ req->kind = EVHTTP_RESPONSE;
+
+ evhttp_start_read_(evcon);
+}
+
+/*
+ * Clean up a connection object
+ */
+
+void
+evhttp_connection_free(struct evhttp_connection *evcon)
+{
+ struct evhttp_request *req;
+
+ /* notify interested parties that this connection is going down */
+ if (evcon->fd != -1) {
+ if (evhttp_connected(evcon) && evcon->closecb != NULL)
+ (*evcon->closecb)(evcon, evcon->closecb_arg);
+ }
+
+ /* remove all requests that might be queued on this
+ * connection. for server connections, this should be empty.
+ * because it gets dequeued either in evhttp_connection_done or
+ * evhttp_connection_fail_.
+ */
+ while ((req = TAILQ_FIRST(&evcon->requests)) != NULL) {
+ TAILQ_REMOVE(&evcon->requests, req, next);
+ evhttp_request_free(req);
+ }
+
+ if (evcon->http_server != NULL) {
+ struct evhttp *http = evcon->http_server;
+ TAILQ_REMOVE(&http->connections, evcon, next);
+ }
+
+ if (event_initialized(&evcon->retry_ev)) {
+ event_del(&evcon->retry_ev);
+ event_debug_unassign(&evcon->retry_ev);
+ }
+
+ if (evcon->bufev != NULL)
+ bufferevent_free(evcon->bufev);
+
+ event_deferred_cb_cancel_(get_deferred_queue(evcon),
+ &evcon->read_more_deferred_cb);
+
+ if (evcon->fd != -1) {
+ shutdown(evcon->fd, EVUTIL_SHUT_WR);
+ if (!(bufferevent_get_options_(evcon->bufev) & BEV_OPT_CLOSE_ON_FREE)) {
+ evutil_closesocket(evcon->fd);
+ }
+ }
+
+ if (evcon->bind_address != NULL)
+ mm_free(evcon->bind_address);
+
+ if (evcon->address != NULL)
+ mm_free(evcon->address);
+
+ if (evcon->conn_address != NULL)
+ mm_free(evcon->conn_address);
+
+ mm_free(evcon);
+}
+
+void
+evhttp_connection_set_local_address(struct evhttp_connection *evcon,
+ const char *address)
+{
+ EVUTIL_ASSERT(evcon->state == EVCON_DISCONNECTED);
+ if (evcon->bind_address)
+ mm_free(evcon->bind_address);
+ if ((evcon->bind_address = mm_strdup(address)) == NULL)
+ event_warn("%s: strdup", __func__);
+}
+
+void
+evhttp_connection_set_local_port(struct evhttp_connection *evcon,
+ ev_uint16_t port)
+{
+ EVUTIL_ASSERT(evcon->state == EVCON_DISCONNECTED);
+ evcon->bind_port = port;
+}
+
+static void
+evhttp_request_dispatch(struct evhttp_connection* evcon)
+{
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+
+ /* this should not usually happy but it's possible */
+ if (req == NULL)
+ return;
+
+ /* delete possible close detection events */
+ evhttp_connection_stop_detectclose(evcon);
+
+ /* we assume that the connection is connected already */
+ EVUTIL_ASSERT(evcon->state == EVCON_IDLE);
+
+ evcon->state = EVCON_WRITING;
+
+ /* Create the header from the store arguments */
+ evhttp_make_header(evcon, req);
+
+ evhttp_write_buffer(evcon, evhttp_write_connectioncb, NULL);
+}
+
+/* Reset our connection state: disables reading/writing, closes our fd (if
+* any), clears out buffers, and puts us in state DISCONNECTED. */
+void
+evhttp_connection_reset_(struct evhttp_connection *evcon)
+{
+ struct evbuffer *tmp;
+
+ /* XXXX This is not actually an optimal fix. Instead we ought to have
+ an API for "stop connecting", or use bufferevent_setfd to turn off
+ connecting. But for Libevent 2.0, this seems like a minimal change
+ least likely to disrupt the rest of the bufferevent and http code.
+
+ Why is this here? If the fd is set in the bufferevent, and the
+ bufferevent is connecting, then you can't actually stop the
+ bufferevent from trying to connect with bufferevent_disable(). The
+ connect will never trigger, since we close the fd, but the timeout
+ might. That caused an assertion failure in evhttp_connection_fail_.
+ */
+ bufferevent_disable_hard_(evcon->bufev, EV_READ|EV_WRITE);
+
+ if (evcon->fd != -1) {
+ /* inform interested parties about connection close */
+ if (evhttp_connected(evcon) && evcon->closecb != NULL)
+ (*evcon->closecb)(evcon, evcon->closecb_arg);
+
+ shutdown(evcon->fd, EVUTIL_SHUT_WR);
+ evutil_closesocket(evcon->fd);
+ evcon->fd = -1;
+ }
+
+ /* we need to clean up any buffered data */
+ tmp = bufferevent_get_output(evcon->bufev);
+ evbuffer_drain(tmp, evbuffer_get_length(tmp));
+ tmp = bufferevent_get_input(evcon->bufev);
+ evbuffer_drain(tmp, evbuffer_get_length(tmp));
+
+ evcon->state = EVCON_DISCONNECTED;
+}
+
+static void
+evhttp_connection_start_detectclose(struct evhttp_connection *evcon)
+{
+ evcon->flags |= EVHTTP_CON_CLOSEDETECT;
+
+ bufferevent_enable(evcon->bufev, EV_READ);
+}
+
+static void
+evhttp_connection_stop_detectclose(struct evhttp_connection *evcon)
+{
+ evcon->flags &= ~EVHTTP_CON_CLOSEDETECT;
+
+ bufferevent_disable(evcon->bufev, EV_READ);
+}
+
+static void
+evhttp_connection_retry(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+
+ evcon->state = EVCON_DISCONNECTED;
+ evhttp_connection_connect_(evcon);
+}
+
+static void
+evhttp_connection_cb_cleanup(struct evhttp_connection *evcon)
+{
+ struct evcon_requestq requests;
+
+ if (evcon->retry_max < 0 || evcon->retry_cnt < evcon->retry_max) {
+ struct timeval tv_retry = evcon->initial_retry_timeout;
+ int i;
+ evtimer_assign(&evcon->retry_ev, evcon->base, evhttp_connection_retry, evcon);
+ /* XXXX handle failure from evhttp_add_event */
+ for (i=0; i < evcon->retry_cnt; ++i) {
+ tv_retry.tv_usec *= 2;
+ if (tv_retry.tv_usec > 1000000) {
+ tv_retry.tv_usec -= 1000000;
+ tv_retry.tv_sec += 1;
+ }
+ tv_retry.tv_sec *= 2;
+ if (tv_retry.tv_sec > 3600) {
+ tv_retry.tv_sec = 3600;
+ tv_retry.tv_usec = 0;
+ }
+ }
+ event_add(&evcon->retry_ev, &tv_retry);
+ evcon->retry_cnt++;
+ return;
+ }
+ evhttp_connection_reset_(evcon);
+
+ /*
+ * User callback can do evhttp_make_request() on the same
+ * evcon so new request will be added to evcon->requests. To
+ * avoid freeing it prematurely we iterate over the copy of
+ * the queue.
+ */
+ TAILQ_INIT(&requests);
+ while (TAILQ_FIRST(&evcon->requests) != NULL) {
+ struct evhttp_request *request = TAILQ_FIRST(&evcon->requests);
+ TAILQ_REMOVE(&evcon->requests, request, next);
+ TAILQ_INSERT_TAIL(&requests, request, next);
+ }
+
+ /* for now, we just signal all requests by executing their callbacks */
+ while (TAILQ_FIRST(&requests) != NULL) {
+ struct evhttp_request *request = TAILQ_FIRST(&requests);
+ TAILQ_REMOVE(&requests, request, next);
+ request->evcon = NULL;
+
+ /* we might want to set an error here */
+ request->cb(request, request->cb_arg);
+ evhttp_request_free(request);
+ }
+}
+
+static void
+evhttp_error_cb(struct bufferevent *bufev, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+
+ if (evcon->fd == -1)
+ evcon->fd = bufferevent_getfd(bufev);
+
+ switch (evcon->state) {
+ case EVCON_CONNECTING:
+ if (what & BEV_EVENT_TIMEOUT) {
+ event_debug(("%s: connection timeout for \"%s:%d\" on "
+ EV_SOCK_FMT,
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd)));
+ evhttp_connection_cb_cleanup(evcon);
+ return;
+ }
+ break;
+
+ case EVCON_READING_BODY:
+ if (!req->chunked && req->ntoread < 0
+ && what == (BEV_EVENT_READING|BEV_EVENT_EOF)) {
+ /* EOF on read can be benign */
+ evhttp_connection_done(evcon);
+ return;
+ }
+ break;
+
+ case EVCON_DISCONNECTED:
+ case EVCON_IDLE:
+ case EVCON_READING_FIRSTLINE:
+ case EVCON_READING_HEADERS:
+ case EVCON_READING_TRAILER:
+ case EVCON_WRITING:
+ default:
+ break;
+ }
+
+ /* when we are in close detect mode, a read error means that
+ * the other side closed their connection.
+ */
+ if (evcon->flags & EVHTTP_CON_CLOSEDETECT) {
+ evcon->flags &= ~EVHTTP_CON_CLOSEDETECT;
+ EVUTIL_ASSERT(evcon->http_server == NULL);
+ /* For connections from the client, we just
+ * reset the connection so that it becomes
+ * disconnected.
+ */
+ EVUTIL_ASSERT(evcon->state == EVCON_IDLE);
+ evhttp_connection_reset_(evcon);
+ return;
+ }
+
+ if (what & BEV_EVENT_TIMEOUT) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_TIMEOUT);
+ } else if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_EOF);
+ } else if (what == BEV_EVENT_CONNECTED) {
+ } else {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_BUFFER_ERROR);
+ }
+}
+
+/*
+ * Event callback for asynchronous connection attempt.
+ */
+static void
+evhttp_connection_cb(struct bufferevent *bufev, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ int error;
+ ev_socklen_t errsz = sizeof(error);
+ socklen_t conn_address_len = sizeof(*evcon->conn_address);
+
+ if (evcon->fd == -1)
+ evcon->fd = bufferevent_getfd(bufev);
+
+ if (!(what & BEV_EVENT_CONNECTED)) {
+ /* some operating systems return ECONNREFUSED immediately
+ * when connecting to a local address. the cleanup is going
+ * to reschedule this function call.
+ */
+#ifndef _WIN32
+ if (errno == ECONNREFUSED)
+ goto cleanup;
+#endif
+ evhttp_error_cb(bufev, what, arg);
+ return;
+ }
+
+ if (evcon->fd == -1) {
+ event_debug(("%s: bufferevent_getfd returned -1",
+ __func__));
+ goto cleanup;
+ }
+
+ /* Check if the connection completed */
+ if (getsockopt(evcon->fd, SOL_SOCKET, SO_ERROR, (void*)&error,
+ &errsz) == -1) {
+ event_debug(("%s: getsockopt for \"%s:%d\" on "EV_SOCK_FMT,
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd)));
+ goto cleanup;
+ }
+
+ if (error) {
+ event_debug(("%s: connect failed for \"%s:%d\" on "
+ EV_SOCK_FMT": %s",
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd),
+ evutil_socket_error_to_string(error)));
+ goto cleanup;
+ }
+
+ /* We are connected to the server now */
+ event_debug(("%s: connected to \"%s:%d\" on "EV_SOCK_FMT"\n",
+ __func__, evcon->address, evcon->port,
+ EV_SOCK_ARG(evcon->fd)));
+
+ /* Reset the retry count as we were successful in connecting */
+ evcon->retry_cnt = 0;
+ evcon->state = EVCON_IDLE;
+
+ if (!evcon->conn_address) {
+ evcon->conn_address = mm_malloc(sizeof(*evcon->conn_address));
+ }
+ if (getpeername(evcon->fd, (struct sockaddr *)evcon->conn_address, &conn_address_len)) {
+ mm_free(evcon->conn_address);
+ evcon->conn_address = NULL;
+ }
+
+ /* reset the bufferevent cbs */
+ bufferevent_setcb(evcon->bufev,
+ evhttp_read_cb,
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+
+ if (!evutil_timerisset(&evcon->timeout)) {
+ const struct timeval read_tv = { HTTP_READ_TIMEOUT, 0 };
+ const struct timeval write_tv = { HTTP_WRITE_TIMEOUT, 0 };
+ bufferevent_set_timeouts(evcon->bufev, &read_tv, &write_tv);
+ } else {
+ bufferevent_set_timeouts(evcon->bufev, &evcon->timeout, &evcon->timeout);
+ }
+
+ /* try to start requests that have queued up on this connection */
+ evhttp_request_dispatch(evcon);
+ return;
+
+ cleanup:
+ evhttp_connection_cb_cleanup(evcon);
+}
+
+/*
+ * Check if we got a valid response code.
+ */
+
+static int
+evhttp_valid_response_code(int code)
+{
+ if (code == 0)
+ return (0);
+
+ return (1);
+}
+
+static int
+evhttp_parse_http_version(const char *version, struct evhttp_request *req)
+{
+ int major, minor;
+ char ch;
+ int n = sscanf(version, "HTTP/%d.%d%c", &major, &minor, &ch);
+ if (n != 2 || major > 1) {
+ event_debug(("%s: bad version %s on message %p from %s",
+ __func__, version, req, req->remote_host));
+ return (-1);
+ }
+ req->major = major;
+ req->minor = minor;
+ return (0);
+}
+
+/* Parses the status line of a web server */
+
+static int
+evhttp_parse_response_line(struct evhttp_request *req, char *line)
+{
+ char *protocol;
+ char *number;
+ const char *readable = "";
+
+ protocol = strsep(&line, " ");
+ if (line == NULL)
+ return (-1);
+ number = strsep(&line, " ");
+ if (line != NULL)
+ readable = line;
+
+ if (evhttp_parse_http_version(protocol, req) < 0)
+ return (-1);
+
+ req->response_code = atoi(number);
+ if (!evhttp_valid_response_code(req->response_code)) {
+ event_debug(("%s: bad response code \"%s\"",
+ __func__, number));
+ return (-1);
+ }
+
+ if ((req->response_code_line = mm_strdup(readable)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ return (-1);
+ }
+
+ return (0);
+}
+
+/* Parse the first line of a HTTP request */
+
+static int
+evhttp_parse_request_line(struct evhttp_request *req, char *line)
+{
+ char *method;
+ char *uri;
+ char *version;
+ const char *hostname;
+ const char *scheme;
+ size_t method_len;
+ enum evhttp_cmd_type type;
+
+ /* Parse the request line */
+ method = strsep(&line, " ");
+ if (line == NULL)
+ return (-1);
+ uri = strsep(&line, " ");
+ if (line == NULL)
+ return (-1);
+ version = strsep(&line, " ");
+ if (line != NULL)
+ return (-1);
+
+ method_len = (uri - method) - 1;
+ type = EVHTTP_REQ_UNKNOWN_;
+
+ /* First line */
+ switch (method_len) {
+ case 3:
+ /* The length of the method string is 3, meaning it can only be one of two methods: GET or PUT */
+
+ /* Since both GET and PUT share the same character 'T' at the end,
+ * if the string doesn't have 'T', we can immediately determine this
+ * is an invalid HTTP method */
+
+ if (method[2] != 'T') {
+ break;
+ }
+
+ switch (*method) {
+ case 'G':
+ /* This first byte is 'G', so make sure the next byte is
+ * 'E', if it isn't then this isn't a valid method */
+
+ if (method[1] == 'E') {
+ type = EVHTTP_REQ_GET;
+ }
+
+ break;
+ case 'P':
+ /* First byte is P, check second byte for 'U', if not,
+ * we know it's an invalid method */
+ if (method[1] == 'U') {
+ type = EVHTTP_REQ_PUT;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case 4:
+ /* The method length is 4 bytes, leaving only the methods "POST" and "HEAD" */
+ switch (*method) {
+ case 'P':
+ if (method[3] == 'T' && method[2] == 'S' && method[1] == 'O') {
+ type = EVHTTP_REQ_POST;
+ }
+ break;
+ case 'H':
+ if (method[3] == 'D' && method[2] == 'A' && method[1] == 'E') {
+ type = EVHTTP_REQ_HEAD;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case 5:
+ /* Method length is 5 bytes, which can only encompass PATCH and TRACE */
+ switch (*method) {
+ case 'P':
+ if (method[4] == 'H' && method[3] == 'C' && method[2] == 'T' && method[1] == 'A') {
+ type = EVHTTP_REQ_PATCH;
+ }
+ break;
+ case 'T':
+ if (method[4] == 'E' && method[3] == 'C' && method[2] == 'A' && method[1] == 'R') {
+ type = EVHTTP_REQ_TRACE;
+ }
+
+ break;
+ default:
+ break;
+ }
+ break;
+ case 6:
+ /* Method length is 6, only valid method 6 bytes in length is DELEte */
+
+ /* If the first byte isn't 'D' then it's invalid */
+ if (*method != 'D') {
+ break;
+ }
+
+ if (method[5] == 'E' && method[4] == 'T' && method[3] == 'E' && method[2] == 'L' && method[1] == 'E') {
+ type = EVHTTP_REQ_DELETE;
+ }
+
+ break;
+ case 7:
+ /* Method length is 7, only valid methods are "OPTIONS" and "CONNECT" */
+ switch (*method) {
+ case 'O':
+ if (method[6] == 'S' && method[5] == 'N' && method[4] == 'O' &&
+ method[3] == 'I' && method[2] == 'T' && method[1] == 'P') {
+ type = EVHTTP_REQ_OPTIONS;
+ }
+
+ break;
+ case 'C':
+ if (method[6] == 'T' && method[5] == 'C' && method[4] == 'E' &&
+ method[3] == 'N' && method[2] == 'N' && method[1] == 'O') {
+ type = EVHTTP_REQ_CONNECT;
+ }
+
+ break;
+ default:
+ break;
+ }
+ break;
+ } /* switch */
+
+ if ((int)type == EVHTTP_REQ_UNKNOWN_) {
+ event_debug(("%s: bad method %s on request %p from %s",
+ __func__, method, req, req->remote_host));
+ /* No error yet; we'll give a better error later when
+ * we see that req->type is unsupported. */
+ }
+
+ req->type = type;
+
+ if (evhttp_parse_http_version(version, req) < 0)
+ return (-1);
+
+ if ((req->uri = mm_strdup(uri)) == NULL) {
+ event_debug(("%s: mm_strdup", __func__));
+ return (-1);
+ }
+
+ if ((req->uri_elems = evhttp_uri_parse_with_flags(req->uri,
+ EVHTTP_URI_NONCONFORMANT)) == NULL) {
+ return -1;
+ }
+
+ /* If we have an absolute-URI, check to see if it is an http request
+ for a known vhost or server alias. If we don't know about this
+ host, we consider it a proxy request. */
+ scheme = evhttp_uri_get_scheme(req->uri_elems);
+ hostname = evhttp_uri_get_host(req->uri_elems);
+ if (scheme && (!evutil_ascii_strcasecmp(scheme, "http") ||
+ !evutil_ascii_strcasecmp(scheme, "https")) &&
+ hostname &&
+ !evhttp_find_vhost(req->evcon->http_server, NULL, hostname))
+ req->flags |= EVHTTP_PROXY_REQUEST;
+
+ return (0);
+}
+
+const char *
+evhttp_find_header(const struct evkeyvalq *headers, const char *key)
+{
+ struct evkeyval *header;
+
+ TAILQ_FOREACH(header, headers, next) {
+ if (evutil_ascii_strcasecmp(header->key, key) == 0)
+ return (header->value);
+ }
+
+ return (NULL);
+}
+
+void
+evhttp_clear_headers(struct evkeyvalq *headers)
+{
+ struct evkeyval *header;
+
+ for (header = TAILQ_FIRST(headers);
+ header != NULL;
+ header = TAILQ_FIRST(headers)) {
+ TAILQ_REMOVE(headers, header, next);
+ mm_free(header->key);
+ mm_free(header->value);
+ mm_free(header);
+ }
+}
+
+/*
+ * Returns 0, if the header was successfully removed.
+ * Returns -1, if the header could not be found.
+ */
+
+int
+evhttp_remove_header(struct evkeyvalq *headers, const char *key)
+{
+ struct evkeyval *header;
+
+ TAILQ_FOREACH(header, headers, next) {
+ if (evutil_ascii_strcasecmp(header->key, key) == 0)
+ break;
+ }
+
+ if (header == NULL)
+ return (-1);
+
+ /* Free and remove the header that we found */
+ TAILQ_REMOVE(headers, header, next);
+ mm_free(header->key);
+ mm_free(header->value);
+ mm_free(header);
+
+ return (0);
+}
+
+static int
+evhttp_header_is_valid_value(const char *value)
+{
+ const char *p = value;
+
+ while ((p = strpbrk(p, "\r\n")) != NULL) {
+ /* we really expect only one new line */
+ p += strspn(p, "\r\n");
+ /* we expect a space or tab for continuation */
+ if (*p != ' ' && *p != '\t')
+ return (0);
+ }
+ return (1);
+}
+
+int
+evhttp_add_header(struct evkeyvalq *headers,
+ const char *key, const char *value)
+{
+ event_debug(("%s: key: %s val: %s\n", __func__, key, value));
+
+ if (strchr(key, '\r') != NULL || strchr(key, '\n') != NULL) {
+ /* drop illegal headers */
+ event_debug(("%s: dropping illegal header key\n", __func__));
+ return (-1);
+ }
+
+ if (!evhttp_header_is_valid_value(value)) {
+ event_debug(("%s: dropping illegal header value\n", __func__));
+ return (-1);
+ }
+
+ return (evhttp_add_header_internal(headers, key, value));
+}
+
+static int
+evhttp_add_header_internal(struct evkeyvalq *headers,
+ const char *key, const char *value)
+{
+ struct evkeyval *header = mm_calloc(1, sizeof(struct evkeyval));
+ if (header == NULL) {
+ event_warn("%s: calloc", __func__);
+ return (-1);
+ }
+ if ((header->key = mm_strdup(key)) == NULL) {
+ mm_free(header);
+ event_warn("%s: strdup", __func__);
+ return (-1);
+ }
+ if ((header->value = mm_strdup(value)) == NULL) {
+ mm_free(header->key);
+ mm_free(header);
+ event_warn("%s: strdup", __func__);
+ return (-1);
+ }
+
+ TAILQ_INSERT_TAIL(headers, header, next);
+
+ return (0);
+}
+
+/*
+ * Parses header lines from a request or a response into the specified
+ * request object given an event buffer.
+ *
+ * Returns
+ * DATA_CORRUPTED on error
+ * MORE_DATA_EXPECTED when we need to read more headers
+ * ALL_DATA_READ when all headers have been read.
+ */
+
+enum message_read_status
+evhttp_parse_firstline_(struct evhttp_request *req, struct evbuffer *buffer)
+{
+ char *line;
+ enum message_read_status status = ALL_DATA_READ;
+
+ size_t line_length;
+ /* XXX try */
+ line = evbuffer_readln(buffer, &line_length, EVBUFFER_EOL_CRLF);
+ if (line == NULL) {
+ if (req->evcon != NULL &&
+ evbuffer_get_length(buffer) > req->evcon->max_headers_size)
+ return (DATA_TOO_LONG);
+ else
+ return (MORE_DATA_EXPECTED);
+ }
+
+ if (req->evcon != NULL &&
+ line_length > req->evcon->max_headers_size) {
+ mm_free(line);
+ return (DATA_TOO_LONG);
+ }
+
+ req->headers_size = line_length;
+
+ switch (req->kind) {
+ case EVHTTP_REQUEST:
+ if (evhttp_parse_request_line(req, line) == -1)
+ status = DATA_CORRUPTED;
+ break;
+ case EVHTTP_RESPONSE:
+ if (evhttp_parse_response_line(req, line) == -1)
+ status = DATA_CORRUPTED;
+ break;
+ default:
+ status = DATA_CORRUPTED;
+ }
+
+ mm_free(line);
+ return (status);
+}
+
+static int
+evhttp_append_to_last_header(struct evkeyvalq *headers, char *line)
+{
+ struct evkeyval *header = TAILQ_LAST(headers, evkeyvalq);
+ char *newval;
+ size_t old_len, line_len;
+
+ if (header == NULL)
+ return (-1);
+
+ old_len = strlen(header->value);
+
+ /* Strip space from start and end of line. */
+ while (*line == ' ' || *line == '\t')
+ ++line;
+ evutil_rtrim_lws_(line);
+
+ line_len = strlen(line);
+
+ newval = mm_realloc(header->value, old_len + line_len + 2);
+ if (newval == NULL)
+ return (-1);
+
+ newval[old_len] = ' ';
+ memcpy(newval + old_len + 1, line, line_len + 1);
+ header->value = newval;
+
+ return (0);
+}
+
+enum message_read_status
+evhttp_parse_headers_(struct evhttp_request *req, struct evbuffer* buffer)
+{
+ enum message_read_status errcode = DATA_CORRUPTED;
+ char *line;
+ enum message_read_status status = MORE_DATA_EXPECTED;
+
+ struct evkeyvalq* headers = req->input_headers;
+ size_t line_length;
+ while ((line = evbuffer_readln(buffer, &line_length, EVBUFFER_EOL_CRLF))
+ != NULL) {
+ char *skey, *svalue;
+
+ req->headers_size += line_length;
+
+ if (req->evcon != NULL &&
+ req->headers_size > req->evcon->max_headers_size) {
+ errcode = DATA_TOO_LONG;
+ goto error;
+ }
+
+ if (*line == '\0') { /* Last header - Done */
+ status = ALL_DATA_READ;
+ mm_free(line);
+ break;
+ }
+
+ /* Check if this is a continuation line */
+ if (*line == ' ' || *line == '\t') {
+ if (evhttp_append_to_last_header(headers, line) == -1)
+ goto error;
+ mm_free(line);
+ continue;
+ }
+
+ /* Processing of header lines */
+ svalue = line;
+ skey = strsep(&svalue, ":");
+ if (svalue == NULL)
+ goto error;
+
+ svalue += strspn(svalue, " ");
+ evutil_rtrim_lws_(svalue);
+
+ if (evhttp_add_header(headers, skey, svalue) == -1)
+ goto error;
+
+ mm_free(line);
+ }
+
+ if (status == MORE_DATA_EXPECTED) {
+ if (req->evcon != NULL &&
+ req->headers_size + evbuffer_get_length(buffer) > req->evcon->max_headers_size)
+ return (DATA_TOO_LONG);
+ }
+
+ return (status);
+
+ error:
+ mm_free(line);
+ return (errcode);
+}
+
+static int
+evhttp_get_body_length(struct evhttp_request *req)
+{
+ struct evkeyvalq *headers = req->input_headers;
+ const char *content_length;
+ const char *connection;
+
+ content_length = evhttp_find_header(headers, "Content-Length");
+ connection = evhttp_find_header(headers, "Connection");
+
+ if (content_length == NULL && connection == NULL)
+ req->ntoread = -1;
+ else if (content_length == NULL &&
+ evutil_ascii_strcasecmp(connection, "Close") != 0) {
+ /* Bad combination, we don't know when it will end */
+ event_warnx("%s: we got no content length, but the "
+ "server wants to keep the connection open: %s.",
+ __func__, connection);
+ return (-1);
+ } else if (content_length == NULL) {
+ req->ntoread = -1;
+ } else {
+ char *endp;
+ ev_int64_t ntoread = evutil_strtoll(content_length, &endp, 10);
+ if (*content_length == '\0' || *endp != '\0' || ntoread < 0) {
+ event_debug(("%s: illegal content length: %s",
+ __func__, content_length));
+ return (-1);
+ }
+ req->ntoread = ntoread;
+ }
+
+ event_debug(("%s: bytes to read: "EV_I64_FMT" (in buffer "EV_SIZE_FMT")\n",
+ __func__, EV_I64_ARG(req->ntoread),
+ EV_SIZE_ARG(evbuffer_get_length(bufferevent_get_input(req->evcon->bufev)))));
+
+ return (0);
+}
+
+static int
+evhttp_method_may_have_body(enum evhttp_cmd_type type)
+{
+ switch (type) {
+ case EVHTTP_REQ_POST:
+ case EVHTTP_REQ_PUT:
+ case EVHTTP_REQ_PATCH:
+ return 1;
+ case EVHTTP_REQ_TRACE:
+ return 0;
+ /* XXX May any of the below methods have a body? */
+ case EVHTTP_REQ_GET:
+ case EVHTTP_REQ_HEAD:
+ case EVHTTP_REQ_DELETE:
+ case EVHTTP_REQ_OPTIONS:
+ case EVHTTP_REQ_CONNECT:
+ return 0;
+ default:
+ return 0;
+ }
+}
+
+static void
+evhttp_get_body(struct evhttp_connection *evcon, struct evhttp_request *req)
+{
+ const char *xfer_enc;
+
+ /* If this is a request without a body, then we are done */
+ if (req->kind == EVHTTP_REQUEST &&
+ !evhttp_method_may_have_body(req->type)) {
+ evhttp_connection_done(evcon);
+ return;
+ }
+ evcon->state = EVCON_READING_BODY;
+ xfer_enc = evhttp_find_header(req->input_headers, "Transfer-Encoding");
+ if (xfer_enc != NULL && evutil_ascii_strcasecmp(xfer_enc, "chunked") == 0) {
+ req->chunked = 1;
+ req->ntoread = -1;
+ } else {
+ if (evhttp_get_body_length(req) == -1) {
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_INVALID_HEADER);
+ return;
+ }
+ if (req->kind == EVHTTP_REQUEST && req->ntoread < 1) {
+ /* An incoming request with no content-length and no
+ * transfer-encoding has no body. */
+ evhttp_connection_done(evcon);
+ return;
+ }
+ }
+
+ /* Should we send a 100 Continue status line? */
+ if (req->kind == EVHTTP_REQUEST && REQ_VERSION_ATLEAST(req, 1, 1)) {
+ const char *expect;
+
+ expect = evhttp_find_header(req->input_headers, "Expect");
+ if (expect) {
+ if (!evutil_ascii_strcasecmp(expect, "100-continue")) {
+ /* XXX It would be nice to do some sanity
+ checking here. Does the resource exist?
+ Should the resource accept post requests? If
+ no, we should respond with an error. For
+ now, just optimistically tell the client to
+ send their message body. */
+ if (req->ntoread > 0) {
+ /* ntoread is ev_int64_t, max_body_size is ev_uint64_t */
+ if ((req->evcon->max_body_size <= EV_INT64_MAX) && (ev_uint64_t)req->ntoread > req->evcon->max_body_size) {
+ evhttp_send_error(req, HTTP_ENTITYTOOLARGE, NULL);
+ return;
+ }
+ }
+ if (!evbuffer_get_length(bufferevent_get_input(evcon->bufev)))
+ evhttp_send_continue(evcon, req);
+ } else {
+ evhttp_send_error(req, HTTP_EXPECTATIONFAILED,
+ NULL);
+ return;
+ }
+ }
+ }
+
+ evhttp_read_body(evcon, req);
+ /* note the request may have been freed in evhttp_read_body */
+}
+
+static void
+evhttp_read_firstline(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ enum message_read_status res;
+
+ res = evhttp_parse_firstline_(req, bufferevent_get_input(evcon->bufev));
+ if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) {
+ /* Error while reading, terminate */
+ event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n",
+ __func__, EV_SOCK_ARG(evcon->fd)));
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ return;
+ } else if (res == MORE_DATA_EXPECTED) {
+ /* Need more header lines */
+ return;
+ }
+
+ evcon->state = EVCON_READING_HEADERS;
+ evhttp_read_header(evcon, req);
+}
+
+static void
+evhttp_read_header(struct evhttp_connection *evcon,
+ struct evhttp_request *req)
+{
+ enum message_read_status res;
+ evutil_socket_t fd = evcon->fd;
+
+ res = evhttp_parse_headers_(req, bufferevent_get_input(evcon->bufev));
+ if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) {
+ /* Error while reading, terminate */
+ event_debug(("%s: bad header lines on "EV_SOCK_FMT"\n",
+ __func__, EV_SOCK_ARG(fd)));
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ return;
+ } else if (res == MORE_DATA_EXPECTED) {
+ /* Need more header lines */
+ return;
+ }
+
+ /* Disable reading for now */
+ bufferevent_disable(evcon->bufev, EV_READ);
+
+ /* Callback can shut down connection with negative return value */
+ if (req->header_cb != NULL) {
+ if ((*req->header_cb)(req, req->cb_arg) < 0) {
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_EOF);
+ return;
+ }
+ }
+
+ /* Done reading headers, do the real work */
+ switch (req->kind) {
+ case EVHTTP_REQUEST:
+ event_debug(("%s: checking for post data on "EV_SOCK_FMT"\n",
+ __func__, EV_SOCK_ARG(fd)));
+ evhttp_get_body(evcon, req);
+ /* note the request may have been freed in evhttp_get_body */
+ break;
+
+ case EVHTTP_RESPONSE:
+ /* Start over if we got a 100 Continue response. */
+ if (req->response_code == 100) {
+ evhttp_start_read_(evcon);
+ return;
+ }
+ if (!evhttp_response_needs_body(req)) {
+ event_debug(("%s: skipping body for code %d\n",
+ __func__, req->response_code));
+ evhttp_connection_done(evcon);
+ } else {
+ event_debug(("%s: start of read body for %s on "
+ EV_SOCK_FMT"\n",
+ __func__, req->remote_host, EV_SOCK_ARG(fd)));
+ evhttp_get_body(evcon, req);
+ /* note the request may have been freed in
+ * evhttp_get_body */
+ }
+ break;
+
+ default:
+ event_warnx("%s: bad header on "EV_SOCK_FMT, __func__,
+ EV_SOCK_ARG(fd));
+ evhttp_connection_fail_(evcon, EVREQ_HTTP_INVALID_HEADER);
+ break;
+ }
+ /* request may have been freed above */
+}
+
+/*
+ * Creates a TCP connection to the specified port and executes a callback
+ * when finished. Failure or success is indicate by the passed connection
+ * object.
+ *
+ * Although this interface accepts a hostname, it is intended to take
+ * only numeric hostnames so that non-blocking DNS resolution can
+ * happen elsewhere.
+ */
+
+struct evhttp_connection *
+evhttp_connection_new(const char *address, unsigned short port)
+{
+ return (evhttp_connection_base_new(NULL, NULL, address, port));
+}
+
+struct evhttp_connection *
+evhttp_connection_base_bufferevent_new(struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev,
+ const char *address, unsigned short port)
+{
+ struct evhttp_connection *evcon = NULL;
+
+ event_debug(("Attempting connection to %s:%d\n", address, port));
+
+ if ((evcon = mm_calloc(1, sizeof(struct evhttp_connection))) == NULL) {
+ event_warn("%s: calloc failed", __func__);
+ goto error;
+ }
+
+ evcon->fd = -1;
+ evcon->port = port;
+
+ evcon->max_headers_size = EV_SIZE_MAX;
+ evcon->max_body_size = EV_SIZE_MAX;
+
+ evutil_timerclear(&evcon->timeout);
+ evcon->retry_cnt = evcon->retry_max = 0;
+
+ if ((evcon->address = mm_strdup(address)) == NULL) {
+ event_warn("%s: strdup failed", __func__);
+ goto error;
+ }
+
+ if (bev == NULL) {
+ if (!(bev = bufferevent_socket_new(base, -1, 0))) {
+ event_warn("%s: bufferevent_socket_new failed", __func__);
+ goto error;
+ }
+ }
+
+ bufferevent_setcb(bev, evhttp_read_cb, evhttp_write_cb, evhttp_error_cb, evcon);
+ evcon->bufev = bev;
+
+ evcon->state = EVCON_DISCONNECTED;
+ TAILQ_INIT(&evcon->requests);
+
+ evcon->initial_retry_timeout.tv_sec = 2;
+ evcon->initial_retry_timeout.tv_usec = 0;
+
+ if (base != NULL) {
+ evcon->base = base;
+ if (bufferevent_get_base(bev) != base)
+ bufferevent_base_set(base, evcon->bufev);
+ }
+
+ event_deferred_cb_init_(
+ &evcon->read_more_deferred_cb,
+ bufferevent_get_priority(bev),
+ evhttp_deferred_read_cb, evcon);
+
+ evcon->dns_base = dnsbase;
+
+ return (evcon);
+
+ error:
+ if (evcon != NULL)
+ evhttp_connection_free(evcon);
+ return (NULL);
+}
+
+struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon)
+{
+ return evcon->bufev;
+}
+
+struct evhttp *
+evhttp_connection_get_server(struct evhttp_connection *evcon)
+{
+ return evcon->http_server;
+}
+
+struct evhttp_connection *
+evhttp_connection_base_new(struct event_base *base, struct evdns_base *dnsbase,
+ const char *address, unsigned short port)
+{
+ return evhttp_connection_base_bufferevent_new(base, dnsbase, NULL, address, port);
+}
+
+void
+evhttp_connection_set_base(struct evhttp_connection *evcon,
+ struct event_base *base)
+{
+ EVUTIL_ASSERT(evcon->base == NULL);
+ EVUTIL_ASSERT(evcon->state == EVCON_DISCONNECTED);
+ evcon->base = base;
+ bufferevent_base_set(base, evcon->bufev);
+}
+
+void
+evhttp_connection_set_timeout(struct evhttp_connection *evcon,
+ int timeout_in_secs)
+{
+ if (timeout_in_secs == -1)
+ evhttp_connection_set_timeout_tv(evcon, NULL);
+ else {
+ struct timeval tv;
+ tv.tv_sec = timeout_in_secs;
+ tv.tv_usec = 0;
+ evhttp_connection_set_timeout_tv(evcon, &tv);
+ }
+}
+
+void
+evhttp_connection_set_timeout_tv(struct evhttp_connection *evcon,
+ const struct timeval* tv)
+{
+ if (tv) {
+ evcon->timeout = *tv;
+ bufferevent_set_timeouts(evcon->bufev, &evcon->timeout, &evcon->timeout);
+ } else {
+ const struct timeval read_tv = { HTTP_READ_TIMEOUT, 0 };
+ const struct timeval write_tv = { HTTP_WRITE_TIMEOUT, 0 };
+ evutil_timerclear(&evcon->timeout);
+ bufferevent_set_timeouts(evcon->bufev, &read_tv, &write_tv);
+ }
+}
+
+void
+evhttp_connection_set_initial_retry_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv)
+{
+ if (tv) {
+ evcon->initial_retry_timeout = *tv;
+ } else {
+ evutil_timerclear(&evcon->initial_retry_timeout);
+ evcon->initial_retry_timeout.tv_sec = 2;
+ }
+}
+
+void
+evhttp_connection_set_retries(struct evhttp_connection *evcon,
+ int retry_max)
+{
+ evcon->retry_max = retry_max;
+}
+
+void
+evhttp_connection_set_closecb(struct evhttp_connection *evcon,
+ void (*cb)(struct evhttp_connection *, void *), void *cbarg)
+{
+ evcon->closecb = cb;
+ evcon->closecb_arg = cbarg;
+}
+
+void
+evhttp_connection_get_peer(struct evhttp_connection *evcon,
+ char **address, ev_uint16_t *port)
+{
+ *address = evcon->address;
+ *port = evcon->port;
+}
+
+const struct sockaddr*
+evhttp_connection_get_addr(struct evhttp_connection *evcon)
+{
+ return (struct sockaddr *)evcon->conn_address;
+}
+
+int
+evhttp_connection_connect_(struct evhttp_connection *evcon)
+{
+ int old_state = evcon->state;
+
+ if (evcon->state == EVCON_CONNECTING)
+ return (0);
+
+ evhttp_connection_reset_(evcon);
+
+ EVUTIL_ASSERT(!(evcon->flags & EVHTTP_CON_INCOMING));
+ evcon->flags |= EVHTTP_CON_OUTGOING;
+
+ if (evcon->bind_address || evcon->bind_port) {
+ evcon->fd = bind_socket(
+ evcon->bind_address, evcon->bind_port, 0 /*reuse*/);
+ if (evcon->fd == -1) {
+ event_debug(("%s: failed to bind to \"%s\"",
+ __func__, evcon->bind_address));
+ return (-1);
+ }
+
+ bufferevent_setfd(evcon->bufev, evcon->fd);
+ } else {
+ bufferevent_setfd(evcon->bufev, -1);
+ }
+
+ /* Set up a callback for successful connection setup */
+ bufferevent_setcb(evcon->bufev,
+ NULL /* evhttp_read_cb */,
+ NULL /* evhttp_write_cb */,
+ evhttp_connection_cb,
+ evcon);
+ if (!evutil_timerisset(&evcon->timeout)) {
+ const struct timeval conn_tv = { HTTP_CONNECT_TIMEOUT, 0 };
+ bufferevent_set_timeouts(evcon->bufev, NULL, &conn_tv);
+ } else {
+ bufferevent_set_timeouts(evcon->bufev, NULL, &evcon->timeout);
+ }
+ /* make sure that we get a write callback */
+ bufferevent_enable(evcon->bufev, EV_WRITE);
+
+ evcon->state = EVCON_CONNECTING;
+
+ if (bufferevent_socket_connect_hostname(evcon->bufev, evcon->dns_base,
+ AF_UNSPEC, evcon->address, evcon->port) < 0) {
+ evcon->state = old_state;
+ event_sock_warn(evcon->fd, "%s: connection to \"%s\" failed",
+ __func__, evcon->address);
+ /* some operating systems return ECONNREFUSED immediately
+ * when connecting to a local address. the cleanup is going
+ * to reschedule this function call.
+ */
+ evhttp_connection_cb_cleanup(evcon);
+ return (0);
+ }
+
+ return (0);
+}
+
+/*
+ * Starts an HTTP request on the provided evhttp_connection object.
+ * If the connection object is not connected to the web server already,
+ * this will start the connection.
+ */
+
+int
+evhttp_make_request(struct evhttp_connection *evcon,
+ struct evhttp_request *req,
+ enum evhttp_cmd_type type, const char *uri)
+{
+ /* We are making a request */
+ req->kind = EVHTTP_REQUEST;
+ req->type = type;
+ if (req->uri != NULL)
+ mm_free(req->uri);
+ if ((req->uri = mm_strdup(uri)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ evhttp_request_free(req);
+ return (-1);
+ }
+
+ /* Set the protocol version if it is not supplied */
+ if (!req->major && !req->minor) {
+ req->major = 1;
+ req->minor = 1;
+ }
+
+ EVUTIL_ASSERT(req->evcon == NULL);
+ req->evcon = evcon;
+ EVUTIL_ASSERT(!(req->flags & EVHTTP_REQ_OWN_CONNECTION));
+
+ TAILQ_INSERT_TAIL(&evcon->requests, req, next);
+
+ /* If the connection object is not connected; make it so */
+ if (!evhttp_connected(evcon)) {
+ int res = evhttp_connection_connect_(evcon);
+ /* evhttp_connection_fail_(), which is called through
+ * evhttp_connection_connect_(), assumes that req lies in
+ * evcon->requests. Thus, enqueue the request in advance and
+ * remove it in the error case. */
+ if (res != 0)
+ TAILQ_REMOVE(&evcon->requests, req, next);
+
+ return res;
+ }
+
+ /*
+ * If it's connected already and we are the first in the queue,
+ * then we can dispatch this request immediately. Otherwise, it
+ * will be dispatched once the pending requests are completed.
+ */
+ if (TAILQ_FIRST(&evcon->requests) == req)
+ evhttp_request_dispatch(evcon);
+
+ return (0);
+}
+
+void
+evhttp_cancel_request(struct evhttp_request *req)
+{
+ struct evhttp_connection *evcon = req->evcon;
+ if (evcon != NULL) {
+ /* We need to remove it from the connection */
+ if (TAILQ_FIRST(&evcon->requests) == req) {
+ /* it's currently being worked on, so reset
+ * the connection.
+ */
+ evhttp_connection_fail_(evcon,
+ EVREQ_HTTP_REQUEST_CANCEL);
+
+ /* connection fail freed the request */
+ return;
+ } else {
+ /* otherwise, we can just remove it from the
+ * queue
+ */
+ TAILQ_REMOVE(&evcon->requests, req, next);
+ }
+ }
+
+ evhttp_request_free(req);
+}
+
+/*
+ * Reads data from file descriptor into request structure
+ * Request structure needs to be set up correctly.
+ */
+
+void
+evhttp_start_read_(struct evhttp_connection *evcon)
+{
+ /* Set up an event to read the headers */
+ bufferevent_disable(evcon->bufev, EV_WRITE);
+ bufferevent_enable(evcon->bufev, EV_READ);
+ evcon->state = EVCON_READING_FIRSTLINE;
+ /* Reset the bufferevent callbacks */
+ bufferevent_setcb(evcon->bufev,
+ evhttp_read_cb,
+ evhttp_write_cb,
+ evhttp_error_cb,
+ evcon);
+
+ /* If there's still data pending, process it next time through the
+ * loop. Don't do it now; that could get recusive. */
+ if (evbuffer_get_length(bufferevent_get_input(evcon->bufev))) {
+ event_deferred_cb_schedule_(get_deferred_queue(evcon),
+ &evcon->read_more_deferred_cb);
+ }
+}
+
+static void
+evhttp_send_done(struct evhttp_connection *evcon, void *arg)
+{
+ int need_close;
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
+ TAILQ_REMOVE(&evcon->requests, req, next);
+
+ if (req->on_complete_cb != NULL) {
+ req->on_complete_cb(req, req->on_complete_cb_arg);
+ }
+
+ need_close =
+ (REQ_VERSION_BEFORE(req, 1, 1) &&
+ !evhttp_is_connection_keepalive(req->input_headers))||
+ evhttp_is_connection_close(req->flags, req->input_headers) ||
+ evhttp_is_connection_close(req->flags, req->output_headers);
+
+ EVUTIL_ASSERT(req->flags & EVHTTP_REQ_OWN_CONNECTION);
+ evhttp_request_free(req);
+
+ if (need_close) {
+ evhttp_connection_free(evcon);
+ return;
+ }
+
+ /* we have a persistent connection; try to accept another request. */
+ if (evhttp_associate_new_request_with_connection(evcon) == -1) {
+ evhttp_connection_free(evcon);
+ }
+}
+
+/*
+ * Returns an error page.
+ */
+
+void
+evhttp_send_error(struct evhttp_request *req, int error, const char *reason)
+{
+
+#define ERR_FORMAT "<HTML><HEAD>\n" \
+ "<TITLE>%d %s</TITLE>\n" \
+ "</HEAD><BODY>\n" \
+ "<H1>%s</H1>\n" \
+ "</BODY></HTML>\n"
+
+ struct evbuffer *buf = evbuffer_new();
+ if (buf == NULL) {
+ /* if we cannot allocate memory; we just drop the connection */
+ evhttp_connection_free(req->evcon);
+ return;
+ }
+ if (reason == NULL) {
+ reason = evhttp_response_phrase_internal(error);
+ }
+
+ evhttp_response_code_(req, error, reason);
+
+ evbuffer_add_printf(buf, ERR_FORMAT, error, reason, reason);
+
+ evhttp_send_page_(req, buf);
+
+ evbuffer_free(buf);
+#undef ERR_FORMAT
+}
+
+/* Requires that headers and response code are already set up */
+
+static inline void
+evhttp_send(struct evhttp_request *req, struct evbuffer *databuf)
+{
+ struct evhttp_connection *evcon = req->evcon;
+
+ if (evcon == NULL) {
+ evhttp_request_free(req);
+ return;
+ }
+
+ EVUTIL_ASSERT(TAILQ_FIRST(&evcon->requests) == req);
+
+ /* we expect no more calls form the user on this request */
+ req->userdone = 1;
+
+ /* xxx: not sure if we really should expose the data buffer this way */
+ if (databuf != NULL)
+ evbuffer_add_buffer(req->output_buffer, databuf);
+
+ /* Adds headers to the response */
+ evhttp_make_header(evcon, req);
+
+ evhttp_write_buffer(evcon, evhttp_send_done, NULL);
+}
+
+void
+evhttp_send_reply(struct evhttp_request *req, int code, const char *reason,
+ struct evbuffer *databuf)
+{
+ evhttp_response_code_(req, code, reason);
+
+ evhttp_send(req, databuf);
+}
+
+void
+evhttp_send_reply_start(struct evhttp_request *req, int code,
+ const char *reason)
+{
+ evhttp_response_code_(req, code, reason);
+ if (evhttp_find_header(req->output_headers, "Content-Length") == NULL &&
+ REQ_VERSION_ATLEAST(req, 1, 1) &&
+ evhttp_response_needs_body(req)) {
+ /*
+ * prefer HTTP/1.1 chunked encoding to closing the connection;
+ * note RFC 2616 section 4.4 forbids it with Content-Length:
+ * and it's not necessary then anyway.
+ */
+ evhttp_add_header(req->output_headers, "Transfer-Encoding",
+ "chunked");
+ req->chunked = 1;
+ } else {
+ req->chunked = 0;
+ }
+ evhttp_make_header(req->evcon, req);
+ evhttp_write_buffer(req->evcon, NULL, NULL);
+}
+
+void
+evhttp_send_reply_chunk_with_cb(struct evhttp_request *req, struct evbuffer *databuf,
+ void (*cb)(struct evhttp_connection *, void *), void *arg)
+{
+ struct evhttp_connection *evcon = req->evcon;
+ struct evbuffer *output;
+
+ if (evcon == NULL)
+ return;
+
+ output = bufferevent_get_output(evcon->bufev);
+
+ if (evbuffer_get_length(databuf) == 0)
+ return;
+ if (!evhttp_response_needs_body(req))
+ return;
+ if (req->chunked) {
+ evbuffer_add_printf(output, "%x\r\n",
+ (unsigned)evbuffer_get_length(databuf));
+ }
+ evbuffer_add_buffer(output, databuf);
+ if (req->chunked) {
+ evbuffer_add(output, "\r\n", 2);
+ }
+ evhttp_write_buffer(evcon, cb, arg);
+}
+
+void
+evhttp_send_reply_chunk(struct evhttp_request *req, struct evbuffer *databuf)
+{
+ evhttp_send_reply_chunk_with_cb(req, databuf, NULL, NULL);
+}
+void
+evhttp_send_reply_end(struct evhttp_request *req)
+{
+ struct evhttp_connection *evcon = req->evcon;
+ struct evbuffer *output;
+
+ if (evcon == NULL) {
+ evhttp_request_free(req);
+ return;
+ }
+
+ output = bufferevent_get_output(evcon->bufev);
+
+ /* we expect no more calls form the user on this request */
+ req->userdone = 1;
+
+ if (req->chunked) {
+ evbuffer_add(output, "0\r\n\r\n", 5);
+ evhttp_write_buffer(req->evcon, evhttp_send_done, NULL);
+ req->chunked = 0;
+ } else if (evbuffer_get_length(output) == 0) {
+ /* let the connection know that we are done with the request */
+ evhttp_send_done(evcon, NULL);
+ } else {
+ /* make the callback execute after all data has been written */
+ evcon->cb = evhttp_send_done;
+ evcon->cb_arg = NULL;
+ }
+}
+
+static const char *informational_phrases[] = {
+ /* 100 */ "Continue",
+ /* 101 */ "Switching Protocols"
+};
+
+static const char *success_phrases[] = {
+ /* 200 */ "OK",
+ /* 201 */ "Created",
+ /* 202 */ "Accepted",
+ /* 203 */ "Non-Authoritative Information",
+ /* 204 */ "No Content",
+ /* 205 */ "Reset Content",
+ /* 206 */ "Partial Content"
+};
+
+static const char *redirection_phrases[] = {
+ /* 300 */ "Multiple Choices",
+ /* 301 */ "Moved Permanently",
+ /* 302 */ "Found",
+ /* 303 */ "See Other",
+ /* 304 */ "Not Modified",
+ /* 305 */ "Use Proxy",
+ /* 307 */ "Temporary Redirect"
+};
+
+static const char *client_error_phrases[] = {
+ /* 400 */ "Bad Request",
+ /* 401 */ "Unauthorized",
+ /* 402 */ "Payment Required",
+ /* 403 */ "Forbidden",
+ /* 404 */ "Not Found",
+ /* 405 */ "Method Not Allowed",
+ /* 406 */ "Not Acceptable",
+ /* 407 */ "Proxy Authentication Required",
+ /* 408 */ "Request Time-out",
+ /* 409 */ "Conflict",
+ /* 410 */ "Gone",
+ /* 411 */ "Length Required",
+ /* 412 */ "Precondition Failed",
+ /* 413 */ "Request Entity Too Large",
+ /* 414 */ "Request-URI Too Large",
+ /* 415 */ "Unsupported Media Type",
+ /* 416 */ "Requested range not satisfiable",
+ /* 417 */ "Expectation Failed"
+};
+
+static const char *server_error_phrases[] = {
+ /* 500 */ "Internal Server Error",
+ /* 501 */ "Not Implemented",
+ /* 502 */ "Bad Gateway",
+ /* 503 */ "Service Unavailable",
+ /* 504 */ "Gateway Time-out",
+ /* 505 */ "HTTP Version not supported"
+};
+
+struct response_class {
+ const char *name;
+ size_t num_responses;
+ const char **responses;
+};
+
+#ifndef MEMBERSOF
+#define MEMBERSOF(x) (sizeof(x)/sizeof(x[0]))
+#endif
+
+static const struct response_class response_classes[] = {
+ /* 1xx */ { "Informational", MEMBERSOF(informational_phrases), informational_phrases },
+ /* 2xx */ { "Success", MEMBERSOF(success_phrases), success_phrases },
+ /* 3xx */ { "Redirection", MEMBERSOF(redirection_phrases), redirection_phrases },
+ /* 4xx */ { "Client Error", MEMBERSOF(client_error_phrases), client_error_phrases },
+ /* 5xx */ { "Server Error", MEMBERSOF(server_error_phrases), server_error_phrases }
+};
+
+static const char *
+evhttp_response_phrase_internal(int code)
+{
+ int klass = code / 100 - 1;
+ int subcode = code % 100;
+
+ /* Unknown class - can't do any better here */
+ if (klass < 0 || klass >= (int) MEMBERSOF(response_classes))
+ return "Unknown Status Class";
+
+ /* Unknown sub-code, return class name at least */
+ if (subcode >= (int) response_classes[klass].num_responses)
+ return response_classes[klass].name;
+
+ return response_classes[klass].responses[subcode];
+}
+
+void
+evhttp_response_code_(struct evhttp_request *req, int code, const char *reason)
+{
+ req->kind = EVHTTP_RESPONSE;
+ req->response_code = code;
+ if (req->response_code_line != NULL)
+ mm_free(req->response_code_line);
+ if (reason == NULL)
+ reason = evhttp_response_phrase_internal(code);
+ req->response_code_line = mm_strdup(reason);
+ if (req->response_code_line == NULL) {
+ event_warn("%s: strdup", __func__);
+ /* XXX what else can we do? */
+ }
+}
+
+void
+evhttp_send_page_(struct evhttp_request *req, struct evbuffer *databuf)
+{
+ if (!req->major || !req->minor) {
+ req->major = 1;
+ req->minor = 1;
+ }
+
+ if (req->kind != EVHTTP_RESPONSE)
+ evhttp_response_code_(req, 200, "OK");
+
+ evhttp_clear_headers(req->output_headers);
+ evhttp_add_header(req->output_headers, "Content-Type", "text/html");
+ evhttp_add_header(req->output_headers, "Connection", "close");
+
+ evhttp_send(req, databuf);
+}
+
+static const char uri_chars[256] = {
+ /* 0 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ /* 64 */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0,
+ /* 128 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ /* 192 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+#define CHAR_IS_UNRESERVED(c) \
+ (uri_chars[(unsigned char)(c)])
+
+/*
+ * Helper functions to encode/decode a string for inclusion in a URI.
+ * The returned string must be freed by the caller.
+ */
+char *
+evhttp_uriencode(const char *uri, ev_ssize_t len, int space_as_plus)
+{
+ struct evbuffer *buf = evbuffer_new();
+ const char *p, *end;
+ char *result;
+
+ if (buf == NULL)
+ return (NULL);
+
+ if (len >= 0)
+ end = uri+len;
+ else
+ end = uri+strlen(uri);
+
+ for (p = uri; p < end; p++) {
+ if (CHAR_IS_UNRESERVED(*p)) {
+ evbuffer_add(buf, p, 1);
+ } else if (*p == ' ' && space_as_plus) {
+ evbuffer_add(buf, "+", 1);
+ } else {
+ evbuffer_add_printf(buf, "%%%02X", (unsigned char)(*p));
+ }
+ }
+ evbuffer_add(buf, "", 1); /* NUL-terminator. */
+ result = mm_malloc(evbuffer_get_length(buf));
+ if (result)
+ evbuffer_remove(buf, result, evbuffer_get_length(buf));
+ evbuffer_free(buf);
+
+ return (result);
+}
+
+char *
+evhttp_encode_uri(const char *str)
+{
+ return evhttp_uriencode(str, -1, 0);
+}
+
+/*
+ * @param decode_plus_ctl: if 1, we decode plus into space. If 0, we don't.
+ * If -1, when true we transform plus to space only after we've seen
+ * a ?. -1 is deprecated.
+ * @return the number of bytes written to 'ret'.
+ */
+int
+evhttp_decode_uri_internal(
+ const char *uri, size_t length, char *ret, int decode_plus_ctl)
+{
+ char c;
+ int j;
+ int decode_plus = (decode_plus_ctl == 1) ? 1: 0;
+ unsigned i;
+
+ for (i = j = 0; i < length; i++) {
+ c = uri[i];
+ if (c == '?') {
+ if (decode_plus_ctl < 0)
+ decode_plus = 1;
+ } else if (c == '+' && decode_plus) {
+ c = ' ';
+ } else if ((i + 2) < length && c == '%' &&
+ EVUTIL_ISXDIGIT_(uri[i+1]) && EVUTIL_ISXDIGIT_(uri[i+2])) {
+ char tmp[3];
+ tmp[0] = uri[i+1];
+ tmp[1] = uri[i+2];
+ tmp[2] = '\0';
+ c = (char)strtol(tmp, NULL, 16);
+ i += 2;
+ }
+ ret[j++] = c;
+ }
+ ret[j] = '\0';
+
+ return (j);
+}
+
+/* deprecated */
+char *
+evhttp_decode_uri(const char *uri)
+{
+ char *ret;
+
+ if ((ret = mm_malloc(strlen(uri) + 1)) == NULL) {
+ event_warn("%s: malloc(%lu)", __func__,
+ (unsigned long)(strlen(uri) + 1));
+ return (NULL);
+ }
+
+ evhttp_decode_uri_internal(uri, strlen(uri),
+ ret, -1 /*always_decode_plus*/);
+
+ return (ret);
+}
+
+char *
+evhttp_uridecode(const char *uri, int decode_plus, size_t *size_out)
+{
+ char *ret;
+ int n;
+
+ if ((ret = mm_malloc(strlen(uri) + 1)) == NULL) {
+ event_warn("%s: malloc(%lu)", __func__,
+ (unsigned long)(strlen(uri) + 1));
+ return (NULL);
+ }
+
+ n = evhttp_decode_uri_internal(uri, strlen(uri),
+ ret, !!decode_plus/*always_decode_plus*/);
+
+ if (size_out) {
+ EVUTIL_ASSERT(n >= 0);
+ *size_out = (size_t)n;
+ }
+
+ return (ret);
+}
+
+/*
+ * Helper function to parse out arguments in a query.
+ * The arguments are separated by key and value.
+ */
+
+static int
+evhttp_parse_query_impl(const char *str, struct evkeyvalq *headers,
+ int is_whole_uri)
+{
+ char *line=NULL;
+ char *argument;
+ char *p;
+ const char *query_part;
+ int result = -1;
+ struct evhttp_uri *uri=NULL;
+
+ TAILQ_INIT(headers);
+
+ if (is_whole_uri) {
+ uri = evhttp_uri_parse(str);
+ if (!uri)
+ goto error;
+ query_part = evhttp_uri_get_query(uri);
+ } else {
+ query_part = str;
+ }
+
+ /* No arguments - we are done */
+ if (!query_part || !strlen(query_part)) {
+ result = 0;
+ goto done;
+ }
+
+ if ((line = mm_strdup(query_part)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto error;
+ }
+
+ p = argument = line;
+ while (p != NULL && *p != '\0') {
+ char *key, *value, *decoded_value;
+ argument = strsep(&p, "&");
+
+ value = argument;
+ key = strsep(&value, "=");
+ if (value == NULL || *key == '\0') {
+ goto error;
+ }
+
+ if ((decoded_value = mm_malloc(strlen(value) + 1)) == NULL) {
+ event_warn("%s: mm_malloc", __func__);
+ goto error;
+ }
+ evhttp_decode_uri_internal(value, strlen(value),
+ decoded_value, 1 /*always_decode_plus*/);
+ event_debug(("Query Param: %s -> %s\n", key, decoded_value));
+ evhttp_add_header_internal(headers, key, decoded_value);
+ mm_free(decoded_value);
+ }
+
+ result = 0;
+ goto done;
+error:
+ evhttp_clear_headers(headers);
+done:
+ if (line)
+ mm_free(line);
+ if (uri)
+ evhttp_uri_free(uri);
+ return result;
+}
+
+int
+evhttp_parse_query(const char *uri, struct evkeyvalq *headers)
+{
+ return evhttp_parse_query_impl(uri, headers, 1);
+}
+int
+evhttp_parse_query_str(const char *uri, struct evkeyvalq *headers)
+{
+ return evhttp_parse_query_impl(uri, headers, 0);
+}
+
+static struct evhttp_cb *
+evhttp_dispatch_callback(struct httpcbq *callbacks, struct evhttp_request *req)
+{
+ struct evhttp_cb *cb;
+ size_t offset = 0;
+ char *translated;
+ const char *path;
+
+ /* Test for different URLs */
+ path = evhttp_uri_get_path(req->uri_elems);
+ offset = strlen(path);
+ if ((translated = mm_malloc(offset + 1)) == NULL)
+ return (NULL);
+ evhttp_decode_uri_internal(path, offset, translated,
+ 0 /* decode_plus */);
+
+ TAILQ_FOREACH(cb, callbacks, next) {
+ if (!strcmp(cb->what, translated)) {
+ mm_free(translated);
+ return (cb);
+ }
+ }
+
+ mm_free(translated);
+ return (NULL);
+}
+
+
+static int
+prefix_suffix_match(const char *pattern, const char *name, int ignorecase)
+{
+ char c;
+
+ while (1) {
+ switch (c = *pattern++) {
+ case '\0':
+ return *name == '\0';
+
+ case '*':
+ while (*name != '\0') {
+ if (prefix_suffix_match(pattern, name,
+ ignorecase))
+ return (1);
+ ++name;
+ }
+ return (0);
+ default:
+ if (c != *name) {
+ if (!ignorecase ||
+ EVUTIL_TOLOWER_(c) != EVUTIL_TOLOWER_(*name))
+ return (0);
+ }
+ ++name;
+ }
+ }
+ /* NOTREACHED */
+}
+
+/*
+ Search the vhost hierarchy beginning with http for a server alias
+ matching hostname. If a match is found, and outhttp is non-null,
+ outhttp is set to the matching http object and 1 is returned.
+*/
+
+static int
+evhttp_find_alias(struct evhttp *http, struct evhttp **outhttp,
+ const char *hostname)
+{
+ struct evhttp_server_alias *alias;
+ struct evhttp *vhost;
+
+ TAILQ_FOREACH(alias, &http->aliases, next) {
+ /* XXX Do we need to handle IP addresses? */
+ if (!evutil_ascii_strcasecmp(alias->alias, hostname)) {
+ if (outhttp)
+ *outhttp = http;
+ return 1;
+ }
+ }
+
+ /* XXX It might be good to avoid recursion here, but I don't
+ see a way to do that w/o a list. */
+ TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) {
+ if (evhttp_find_alias(vhost, outhttp, hostname))
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ Attempts to find the best http object to handle a request for a hostname.
+ All aliases for the root http object and vhosts are searched for an exact
+ match. Then, the vhost hierarchy is traversed again for a matching
+ pattern.
+
+ If an alias or vhost is matched, 1 is returned, and outhttp, if non-null,
+ is set with the best matching http object. If there are no matches, the
+ root http object is stored in outhttp and 0 is returned.
+*/
+
+static int
+evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
+ const char *hostname)
+{
+ struct evhttp *vhost;
+ struct evhttp *oldhttp;
+ int match_found = 0;
+
+ if (evhttp_find_alias(http, outhttp, hostname))
+ return 1;
+
+ do {
+ oldhttp = http;
+ TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) {
+ if (prefix_suffix_match(vhost->vhost_pattern,
+ hostname, 1 /* ignorecase */)) {
+ http = vhost;
+ match_found = 1;
+ break;
+ }
+ }
+ } while (oldhttp != http);
+
+ if (outhttp)
+ *outhttp = http;
+
+ return match_found;
+}
+
+static void
+evhttp_handle_request(struct evhttp_request *req, void *arg)
+{
+ struct evhttp *http = arg;
+ struct evhttp_cb *cb = NULL;
+ const char *hostname;
+
+ /* we have a new request on which the user needs to take action */
+ req->userdone = 0;
+
+ if (req->type == 0 || req->uri == NULL) {
+ evhttp_send_error(req, HTTP_BADREQUEST, NULL);
+ return;
+ }
+
+ if ((http->allowed_methods & req->type) == 0) {
+ event_debug(("Rejecting disallowed method %x (allowed: %x)\n",
+ (unsigned)req->type, (unsigned)http->allowed_methods));
+ evhttp_send_error(req, HTTP_NOTIMPLEMENTED, NULL);
+ return;
+ }
+
+ /* handle potential virtual hosts */
+ hostname = evhttp_request_get_host(req);
+ if (hostname != NULL) {
+ evhttp_find_vhost(http, &http, hostname);
+ }
+
+ if ((cb = evhttp_dispatch_callback(&http->callbacks, req)) != NULL) {
+ (*cb->cb)(req, cb->cbarg);
+ return;
+ }
+
+ /* Generic call back */
+ if (http->gencb) {
+ (*http->gencb)(req, http->gencbarg);
+ return;
+ } else {
+ /* We need to send a 404 here */
+#define ERR_FORMAT "<html><head>" \
+ "<title>404 Not Found</title>" \
+ "</head><body>" \
+ "<h1>Not Found</h1>" \
+ "<p>The requested URL %s was not found on this server.</p>"\
+ "</body></html>\n"
+
+ char *escaped_html;
+ struct evbuffer *buf;
+
+ if ((escaped_html = evhttp_htmlescape(req->uri)) == NULL) {
+ evhttp_connection_free(req->evcon);
+ return;
+ }
+
+ if ((buf = evbuffer_new()) == NULL) {
+ mm_free(escaped_html);
+ evhttp_connection_free(req->evcon);
+ return;
+ }
+
+ evhttp_response_code_(req, HTTP_NOTFOUND, "Not Found");
+
+ evbuffer_add_printf(buf, ERR_FORMAT, escaped_html);
+
+ mm_free(escaped_html);
+
+ evhttp_send_page_(req, buf);
+
+ evbuffer_free(buf);
+#undef ERR_FORMAT
+ }
+}
+
+/* Listener callback when a connection arrives at a server. */
+static void
+accept_socket_cb(struct evconnlistener *listener, evutil_socket_t nfd, struct sockaddr *peer_sa, int peer_socklen, void *arg)
+{
+ struct evhttp *http = arg;
+
+ evhttp_get_request(http, nfd, peer_sa, peer_socklen);
+}
+
+int
+evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port)
+{
+ struct evhttp_bound_socket *bound =
+ evhttp_bind_socket_with_handle(http, address, port);
+ if (bound == NULL)
+ return (-1);
+ return (0);
+}
+
+struct evhttp_bound_socket *
+evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port)
+{
+ evutil_socket_t fd;
+ struct evhttp_bound_socket *bound;
+
+ if ((fd = bind_socket(address, port, 1 /*reuse*/)) == -1)
+ return (NULL);
+
+ if (listen(fd, 128) == -1) {
+ event_sock_warn(fd, "%s: listen", __func__);
+ evutil_closesocket(fd);
+ return (NULL);
+ }
+
+ bound = evhttp_accept_socket_with_handle(http, fd);
+
+ if (bound != NULL) {
+ event_debug(("Bound to port %d - Awaiting connections ... ",
+ port));
+ return (bound);
+ }
+
+ return (NULL);
+}
+
+int
+evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd)
+{
+ struct evhttp_bound_socket *bound =
+ evhttp_accept_socket_with_handle(http, fd);
+ if (bound == NULL)
+ return (-1);
+ return (0);
+}
+
+void
+evhttp_foreach_bound_socket(struct evhttp *http,
+ evhttp_bound_socket_foreach_fn *function,
+ void *argument)
+{
+ struct evhttp_bound_socket *bound;
+
+ TAILQ_FOREACH(bound, &http->sockets, next)
+ function(bound, argument);
+}
+
+struct evhttp_bound_socket *
+evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd)
+{
+ struct evhttp_bound_socket *bound;
+ struct evconnlistener *listener;
+ const int flags =
+ LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC|LEV_OPT_CLOSE_ON_FREE;
+
+ listener = evconnlistener_new(http->base, NULL, NULL,
+ flags,
+ 0, /* Backlog is '0' because we already said 'listen' */
+ fd);
+ if (!listener)
+ return (NULL);
+
+ bound = evhttp_bind_listener(http, listener);
+ if (!bound) {
+ evconnlistener_free(listener);
+ return (NULL);
+ }
+ return (bound);
+}
+
+struct evhttp_bound_socket *
+evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener)
+{
+ struct evhttp_bound_socket *bound;
+
+ bound = mm_malloc(sizeof(struct evhttp_bound_socket));
+ if (bound == NULL)
+ return (NULL);
+
+ bound->listener = listener;
+ TAILQ_INSERT_TAIL(&http->sockets, bound, next);
+
+ evconnlistener_set_cb(listener, accept_socket_cb, http);
+ return bound;
+}
+
+evutil_socket_t
+evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound)
+{
+ return evconnlistener_get_fd(bound->listener);
+}
+
+struct evconnlistener *
+evhttp_bound_socket_get_listener(struct evhttp_bound_socket *bound)
+{
+ return bound->listener;
+}
+
+void
+evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound)
+{
+ TAILQ_REMOVE(&http->sockets, bound, next);
+ evconnlistener_free(bound->listener);
+ mm_free(bound);
+}
+
+static struct evhttp*
+evhttp_new_object(void)
+{
+ struct evhttp *http = NULL;
+
+ if ((http = mm_calloc(1, sizeof(struct evhttp))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ return (NULL);
+ }
+
+ evutil_timerclear(&http->timeout);
+ evhttp_set_max_headers_size(http, EV_SIZE_MAX);
+ evhttp_set_max_body_size(http, EV_SIZE_MAX);
+ evhttp_set_default_content_type(http, "text/html; charset=ISO-8859-1");
+ evhttp_set_allowed_methods(http,
+ EVHTTP_REQ_GET |
+ EVHTTP_REQ_POST |
+ EVHTTP_REQ_HEAD |
+ EVHTTP_REQ_PUT |
+ EVHTTP_REQ_DELETE);
+
+ TAILQ_INIT(&http->sockets);
+ TAILQ_INIT(&http->callbacks);
+ TAILQ_INIT(&http->connections);
+ TAILQ_INIT(&http->virtualhosts);
+ TAILQ_INIT(&http->aliases);
+
+ return (http);
+}
+
+struct evhttp *
+evhttp_new(struct event_base *base)
+{
+ struct evhttp *http = NULL;
+
+ http = evhttp_new_object();
+ if (http == NULL)
+ return (NULL);
+ http->base = base;
+
+ return (http);
+}
+
+/*
+ * Start a web server on the specified address and port.
+ */
+
+struct evhttp *
+evhttp_start(const char *address, unsigned short port)
+{
+ struct evhttp *http = NULL;
+
+ http = evhttp_new_object();
+ if (http == NULL)
+ return (NULL);
+ if (evhttp_bind_socket(http, address, port) == -1) {
+ mm_free(http);
+ return (NULL);
+ }
+
+ return (http);
+}
+
+void
+evhttp_free(struct evhttp* http)
+{
+ struct evhttp_cb *http_cb;
+ struct evhttp_connection *evcon;
+ struct evhttp_bound_socket *bound;
+ struct evhttp* vhost;
+ struct evhttp_server_alias *alias;
+
+ /* Remove the accepting part */
+ while ((bound = TAILQ_FIRST(&http->sockets)) != NULL) {
+ TAILQ_REMOVE(&http->sockets, bound, next);
+
+ evconnlistener_free(bound->listener);
+
+ mm_free(bound);
+ }
+
+ while ((evcon = TAILQ_FIRST(&http->connections)) != NULL) {
+ /* evhttp_connection_free removes the connection */
+ evhttp_connection_free(evcon);
+ }
+
+ while ((http_cb = TAILQ_FIRST(&http->callbacks)) != NULL) {
+ TAILQ_REMOVE(&http->callbacks, http_cb, next);
+ mm_free(http_cb->what);
+ mm_free(http_cb);
+ }
+
+ while ((vhost = TAILQ_FIRST(&http->virtualhosts)) != NULL) {
+ TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost);
+
+ evhttp_free(vhost);
+ }
+
+ if (http->vhost_pattern != NULL)
+ mm_free(http->vhost_pattern);
+
+ while ((alias = TAILQ_FIRST(&http->aliases)) != NULL) {
+ TAILQ_REMOVE(&http->aliases, alias, next);
+ mm_free(alias->alias);
+ mm_free(alias);
+ }
+
+ mm_free(http);
+}
+
+int
+evhttp_add_virtual_host(struct evhttp* http, const char *pattern,
+ struct evhttp* vhost)
+{
+ /* a vhost can only be a vhost once and should not have bound sockets */
+ if (vhost->vhost_pattern != NULL ||
+ TAILQ_FIRST(&vhost->sockets) != NULL)
+ return (-1);
+
+ vhost->vhost_pattern = mm_strdup(pattern);
+ if (vhost->vhost_pattern == NULL)
+ return (-1);
+
+ TAILQ_INSERT_TAIL(&http->virtualhosts, vhost, next_vhost);
+
+ return (0);
+}
+
+int
+evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost)
+{
+ if (vhost->vhost_pattern == NULL)
+ return (-1);
+
+ TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost);
+
+ mm_free(vhost->vhost_pattern);
+ vhost->vhost_pattern = NULL;
+
+ return (0);
+}
+
+int
+evhttp_add_server_alias(struct evhttp *http, const char *alias)
+{
+ struct evhttp_server_alias *evalias;
+
+ evalias = mm_calloc(1, sizeof(*evalias));
+ if (!evalias)
+ return -1;
+
+ evalias->alias = mm_strdup(alias);
+ if (!evalias->alias) {
+ mm_free(evalias);
+ return -1;
+ }
+
+ TAILQ_INSERT_TAIL(&http->aliases, evalias, next);
+
+ return 0;
+}
+
+int
+evhttp_remove_server_alias(struct evhttp *http, const char *alias)
+{
+ struct evhttp_server_alias *evalias;
+
+ TAILQ_FOREACH(evalias, &http->aliases, next) {
+ if (evutil_ascii_strcasecmp(evalias->alias, alias) == 0) {
+ TAILQ_REMOVE(&http->aliases, evalias, next);
+ mm_free(evalias->alias);
+ mm_free(evalias);
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+void
+evhttp_set_timeout(struct evhttp* http, int timeout_in_secs)
+{
+ if (timeout_in_secs == -1) {
+ evhttp_set_timeout_tv(http, NULL);
+ } else {
+ struct timeval tv;
+ tv.tv_sec = timeout_in_secs;
+ tv.tv_usec = 0;
+ evhttp_set_timeout_tv(http, &tv);
+ }
+}
+
+void
+evhttp_set_timeout_tv(struct evhttp* http, const struct timeval* tv)
+{
+ if (tv) {
+ http->timeout = *tv;
+ } else {
+ evutil_timerclear(&http->timeout);
+ }
+}
+
+void
+evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size)
+{
+ if (max_headers_size < 0)
+ http->default_max_headers_size = EV_SIZE_MAX;
+ else
+ http->default_max_headers_size = max_headers_size;
+}
+
+void
+evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size)
+{
+ if (max_body_size < 0)
+ http->default_max_body_size = EV_UINT64_MAX;
+ else
+ http->default_max_body_size = max_body_size;
+}
+
+void
+evhttp_set_default_content_type(struct evhttp *http,
+ const char *content_type) {
+ http->default_content_type = content_type;
+}
+
+void
+evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods)
+{
+ http->allowed_methods = methods;
+}
+
+int
+evhttp_set_cb(struct evhttp *http, const char *uri,
+ void (*cb)(struct evhttp_request *, void *), void *cbarg)
+{
+ struct evhttp_cb *http_cb;
+
+ TAILQ_FOREACH(http_cb, &http->callbacks, next) {
+ if (strcmp(http_cb->what, uri) == 0)
+ return (-1);
+ }
+
+ if ((http_cb = mm_calloc(1, sizeof(struct evhttp_cb))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ return (-2);
+ }
+
+ http_cb->what = mm_strdup(uri);
+ if (http_cb->what == NULL) {
+ event_warn("%s: strdup", __func__);
+ mm_free(http_cb);
+ return (-3);
+ }
+ http_cb->cb = cb;
+ http_cb->cbarg = cbarg;
+
+ TAILQ_INSERT_TAIL(&http->callbacks, http_cb, next);
+
+ return (0);
+}
+
+int
+evhttp_del_cb(struct evhttp *http, const char *uri)
+{
+ struct evhttp_cb *http_cb;
+
+ TAILQ_FOREACH(http_cb, &http->callbacks, next) {
+ if (strcmp(http_cb->what, uri) == 0)
+ break;
+ }
+ if (http_cb == NULL)
+ return (-1);
+
+ TAILQ_REMOVE(&http->callbacks, http_cb, next);
+ mm_free(http_cb->what);
+ mm_free(http_cb);
+
+ return (0);
+}
+
+void
+evhttp_set_gencb(struct evhttp *http,
+ void (*cb)(struct evhttp_request *, void *), void *cbarg)
+{
+ http->gencb = cb;
+ http->gencbarg = cbarg;
+}
+
+void
+evhttp_set_bevcb(struct evhttp *http,
+ struct bufferevent* (*cb)(struct event_base *, void *), void *cbarg)
+{
+ http->bevcb = cb;
+ http->bevcbarg = cbarg;
+}
+
+/*
+ * Request related functions
+ */
+
+struct evhttp_request *
+evhttp_request_new(void (*cb)(struct evhttp_request *, void *), void *arg)
+{
+ struct evhttp_request *req = NULL;
+
+ /* Allocate request structure */
+ if ((req = mm_calloc(1, sizeof(struct evhttp_request))) == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto error;
+ }
+
+ req->headers_size = 0;
+ req->body_size = 0;
+
+ req->kind = EVHTTP_RESPONSE;
+ req->input_headers = mm_calloc(1, sizeof(struct evkeyvalq));
+ if (req->input_headers == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto error;
+ }
+ TAILQ_INIT(req->input_headers);
+
+ req->output_headers = mm_calloc(1, sizeof(struct evkeyvalq));
+ if (req->output_headers == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto error;
+ }
+ TAILQ_INIT(req->output_headers);
+
+ if ((req->input_buffer = evbuffer_new()) == NULL) {
+ event_warn("%s: evbuffer_new", __func__);
+ goto error;
+ }
+
+ if ((req->output_buffer = evbuffer_new()) == NULL) {
+ event_warn("%s: evbuffer_new", __func__);
+ goto error;
+ }
+
+ req->cb = cb;
+ req->cb_arg = arg;
+
+ return (req);
+
+ error:
+ if (req != NULL)
+ evhttp_request_free(req);
+ return (NULL);
+}
+
+void
+evhttp_request_free(struct evhttp_request *req)
+{
+ if ((req->flags & EVHTTP_REQ_DEFER_FREE) != 0) {
+ req->flags |= EVHTTP_REQ_NEEDS_FREE;
+ return;
+ }
+
+ if (req->remote_host != NULL)
+ mm_free(req->remote_host);
+ if (req->uri != NULL)
+ mm_free(req->uri);
+ if (req->uri_elems != NULL)
+ evhttp_uri_free(req->uri_elems);
+ if (req->response_code_line != NULL)
+ mm_free(req->response_code_line);
+ if (req->host_cache != NULL)
+ mm_free(req->host_cache);
+
+ evhttp_clear_headers(req->input_headers);
+ mm_free(req->input_headers);
+
+ evhttp_clear_headers(req->output_headers);
+ mm_free(req->output_headers);
+
+ if (req->input_buffer != NULL)
+ evbuffer_free(req->input_buffer);
+
+ if (req->output_buffer != NULL)
+ evbuffer_free(req->output_buffer);
+
+ mm_free(req);
+}
+
+void
+evhttp_request_own(struct evhttp_request *req)
+{
+ req->flags |= EVHTTP_USER_OWNED;
+}
+
+int
+evhttp_request_is_owned(struct evhttp_request *req)
+{
+ return (req->flags & EVHTTP_USER_OWNED) != 0;
+}
+
+struct evhttp_connection *
+evhttp_request_get_connection(struct evhttp_request *req)
+{
+ return req->evcon;
+}
+
+struct event_base *
+evhttp_connection_get_base(struct evhttp_connection *conn)
+{
+ return conn->base;
+}
+
+void
+evhttp_request_set_chunked_cb(struct evhttp_request *req,
+ void (*cb)(struct evhttp_request *, void *))
+{
+ req->chunk_cb = cb;
+}
+
+void
+evhttp_request_set_header_cb(struct evhttp_request *req,
+ int (*cb)(struct evhttp_request *, void *))
+{
+ req->header_cb = cb;
+}
+
+void
+evhttp_request_set_error_cb(struct evhttp_request *req,
+ void (*cb)(enum evhttp_request_error, void *))
+{
+ req->error_cb = cb;
+}
+
+void
+evhttp_request_set_on_complete_cb(struct evhttp_request *req,
+ void (*cb)(struct evhttp_request *, void *), void *cb_arg)
+{
+ req->on_complete_cb = cb;
+ req->on_complete_cb_arg = cb_arg;
+}
+
+/*
+ * Allows for inspection of the request URI
+ */
+
+const char *
+evhttp_request_get_uri(const struct evhttp_request *req) {
+ if (req->uri == NULL)
+ event_debug(("%s: request %p has no uri\n", __func__, req));
+ return (req->uri);
+}
+
+const struct evhttp_uri *
+evhttp_request_get_evhttp_uri(const struct evhttp_request *req) {
+ if (req->uri_elems == NULL)
+ event_debug(("%s: request %p has no uri elems\n",
+ __func__, req));
+ return (req->uri_elems);
+}
+
+const char *
+evhttp_request_get_host(struct evhttp_request *req)
+{
+ const char *host = NULL;
+
+ if (req->host_cache)
+ return req->host_cache;
+
+ if (req->uri_elems)
+ host = evhttp_uri_get_host(req->uri_elems);
+ if (!host && req->input_headers) {
+ const char *p;
+ size_t len;
+
+ host = evhttp_find_header(req->input_headers, "Host");
+ /* The Host: header may include a port. Remove it here
+ to be consistent with uri_elems case above. */
+ if (host) {
+ p = host + strlen(host) - 1;
+ while (p > host && EVUTIL_ISDIGIT_(*p))
+ --p;
+ if (p > host && *p == ':') {
+ len = p - host;
+ req->host_cache = mm_malloc(len + 1);
+ if (!req->host_cache) {
+ event_warn("%s: malloc", __func__);
+ return NULL;
+ }
+ memcpy(req->host_cache, host, len);
+ req->host_cache[len] = '\0';
+ host = req->host_cache;
+ }
+ }
+ }
+
+ return host;
+}
+
+enum evhttp_cmd_type
+evhttp_request_get_command(const struct evhttp_request *req) {
+ return (req->type);
+}
+
+int
+evhttp_request_get_response_code(const struct evhttp_request *req)
+{
+ return req->response_code;
+}
+
+const char *
+evhttp_request_get_response_code_line(const struct evhttp_request *req)
+{
+ return req->response_code_line;
+}
+
+/** Returns the input headers */
+struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req)
+{
+ return (req->input_headers);
+}
+
+/** Returns the output headers */
+struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *req)
+{
+ return (req->output_headers);
+}
+
+/** Returns the input buffer */
+struct evbuffer *evhttp_request_get_input_buffer(struct evhttp_request *req)
+{
+ return (req->input_buffer);
+}
+
+/** Returns the output buffer */
+struct evbuffer *evhttp_request_get_output_buffer(struct evhttp_request *req)
+{
+ return (req->output_buffer);
+}
+
+
+/*
+ * Takes a file descriptor to read a request from.
+ * The callback is executed once the whole request has been read.
+ */
+
+static struct evhttp_connection*
+evhttp_get_request_connection(
+ struct evhttp* http,
+ evutil_socket_t fd, struct sockaddr *sa, ev_socklen_t salen)
+{
+ struct evhttp_connection *evcon;
+ char *hostname = NULL, *portname = NULL;
+ struct bufferevent* bev = NULL;
+
+ name_from_addr(sa, salen, &hostname, &portname);
+ if (hostname == NULL || portname == NULL) {
+ if (hostname) mm_free(hostname);
+ if (portname) mm_free(portname);
+ return (NULL);
+ }
+
+ event_debug(("%s: new request from %s:%s on "EV_SOCK_FMT"\n",
+ __func__, hostname, portname, EV_SOCK_ARG(fd)));
+
+ /* we need a connection object to put the http request on */
+ if (http->bevcb != NULL) {
+ bev = (*http->bevcb)(http->base, http->bevcbarg);
+ }
+ evcon = evhttp_connection_base_bufferevent_new(
+ http->base, NULL, bev, hostname, atoi(portname));
+ mm_free(hostname);
+ mm_free(portname);
+ if (evcon == NULL)
+ return (NULL);
+
+ evcon->max_headers_size = http->default_max_headers_size;
+ evcon->max_body_size = http->default_max_body_size;
+
+ evcon->flags |= EVHTTP_CON_INCOMING;
+ evcon->state = EVCON_READING_FIRSTLINE;
+
+ evcon->fd = fd;
+
+ bufferevent_setfd(evcon->bufev, fd);
+
+ return (evcon);
+}
+
+static int
+evhttp_associate_new_request_with_connection(struct evhttp_connection *evcon)
+{
+ struct evhttp *http = evcon->http_server;
+ struct evhttp_request *req;
+ if ((req = evhttp_request_new(evhttp_handle_request, http)) == NULL)
+ return (-1);
+
+ if ((req->remote_host = mm_strdup(evcon->address)) == NULL) {
+ event_warn("%s: strdup", __func__);
+ evhttp_request_free(req);
+ return (-1);
+ }
+ req->remote_port = evcon->port;
+
+ req->evcon = evcon; /* the request ends up owning the connection */
+ req->flags |= EVHTTP_REQ_OWN_CONNECTION;
+
+ /* We did not present the request to the user user yet, so treat it as
+ * if the user was done with the request. This allows us to free the
+ * request on a persistent connection if the client drops it without
+ * sending a request.
+ */
+ req->userdone = 1;
+
+ TAILQ_INSERT_TAIL(&evcon->requests, req, next);
+
+ req->kind = EVHTTP_REQUEST;
+
+
+ evhttp_start_read_(evcon);
+
+ return (0);
+}
+
+static void
+evhttp_get_request(struct evhttp *http, evutil_socket_t fd,
+ struct sockaddr *sa, ev_socklen_t salen)
+{
+ struct evhttp_connection *evcon;
+
+ evcon = evhttp_get_request_connection(http, fd, sa, salen);
+ if (evcon == NULL) {
+ event_sock_warn(fd, "%s: cannot get connection on "EV_SOCK_FMT,
+ __func__, EV_SOCK_ARG(fd));
+ evutil_closesocket(fd);
+ return;
+ }
+
+ /* the timeout can be used by the server to close idle connections */
+ if (evutil_timerisset(&http->timeout))
+ evhttp_connection_set_timeout_tv(evcon, &http->timeout);
+
+ /*
+ * if we want to accept more than one request on a connection,
+ * we need to know which http server it belongs to.
+ */
+ evcon->http_server = http;
+ TAILQ_INSERT_TAIL(&http->connections, evcon, next);
+
+ if (evhttp_associate_new_request_with_connection(evcon) == -1)
+ evhttp_connection_free(evcon);
+}
+
+
+/*
+ * Network helper functions that we do not want to export to the rest of
+ * the world.
+ */
+
+static void
+name_from_addr(struct sockaddr *sa, ev_socklen_t salen,
+ char **phost, char **pport)
+{
+ char ntop[NI_MAXHOST];
+ char strport[NI_MAXSERV];
+ int ni_result;
+
+#ifdef EVENT__HAVE_GETNAMEINFO
+ ni_result = getnameinfo(sa, salen,
+ ntop, sizeof(ntop), strport, sizeof(strport),
+ NI_NUMERICHOST|NI_NUMERICSERV);
+
+ if (ni_result != 0) {
+#ifdef EAI_SYSTEM
+ /* Windows doesn't have an EAI_SYSTEM. */
+ if (ni_result == EAI_SYSTEM)
+ event_err(1, "getnameinfo failed");
+ else
+#endif
+ event_errx(1, "getnameinfo failed: %s", gai_strerror(ni_result));
+ return;
+ }
+#else
+ ni_result = fake_getnameinfo(sa, salen,
+ ntop, sizeof(ntop), strport, sizeof(strport),
+ NI_NUMERICHOST|NI_NUMERICSERV);
+ if (ni_result != 0)
+ return;
+#endif
+
+ *phost = mm_strdup(ntop);
+ *pport = mm_strdup(strport);
+}
+
+/* Create a non-blocking socket and bind it */
+/* todo: rename this function */
+static evutil_socket_t
+bind_socket_ai(struct evutil_addrinfo *ai, int reuse)
+{
+ evutil_socket_t fd;
+
+ int on = 1, r;
+ int serrno;
+
+ /* Create listen socket */
+ fd = evutil_socket_(ai ? ai->ai_family : AF_INET,
+ SOCK_STREAM|EVUTIL_SOCK_NONBLOCK|EVUTIL_SOCK_CLOEXEC, 0);
+ if (fd == -1) {
+ event_sock_warn(-1, "socket");
+ return (-1);
+ }
+
+ if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on))<0)
+ goto out;
+ if (reuse) {
+ if (evutil_make_listen_socket_reuseable(fd) < 0)
+ goto out;
+ }
+
+ if (ai != NULL) {
+ r = bind(fd, ai->ai_addr, (ev_socklen_t)ai->ai_addrlen);
+ if (r == -1)
+ goto out;
+ }
+
+ return (fd);
+
+ out:
+ serrno = EVUTIL_SOCKET_ERROR();
+ evutil_closesocket(fd);
+ EVUTIL_SET_SOCKET_ERROR(serrno);
+ return (-1);
+}
+
+static struct evutil_addrinfo *
+make_addrinfo(const char *address, ev_uint16_t port)
+{
+ struct evutil_addrinfo *ai = NULL;
+
+ struct evutil_addrinfo hints;
+ char strport[NI_MAXSERV];
+ int ai_result;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ /* turn NULL hostname into INADDR_ANY, and skip looking up any address
+ * types we don't have an interface to connect to. */
+ hints.ai_flags = EVUTIL_AI_PASSIVE|EVUTIL_AI_ADDRCONFIG;
+ evutil_snprintf(strport, sizeof(strport), "%d", port);
+ if ((ai_result = evutil_getaddrinfo(address, strport, &hints, &ai))
+ != 0) {
+ if (ai_result == EVUTIL_EAI_SYSTEM)
+ event_warn("getaddrinfo");
+ else
+ event_warnx("getaddrinfo: %s",
+ evutil_gai_strerror(ai_result));
+ return (NULL);
+ }
+
+ return (ai);
+}
+
+static evutil_socket_t
+bind_socket(const char *address, ev_uint16_t port, int reuse)
+{
+ evutil_socket_t fd;
+ struct evutil_addrinfo *aitop = NULL;
+
+ /* just create an unbound socket */
+ if (address == NULL && port == 0)
+ return bind_socket_ai(NULL, 0);
+
+ aitop = make_addrinfo(address, port);
+
+ if (aitop == NULL)
+ return (-1);
+
+ fd = bind_socket_ai(aitop, reuse);
+
+ evutil_freeaddrinfo(aitop);
+
+ return (fd);
+}
+
+struct evhttp_uri {
+ unsigned flags;
+ char *scheme; /* scheme; e.g http, ftp etc */
+ char *userinfo; /* userinfo (typically username:pass), or NULL */
+ char *host; /* hostname, IP address, or NULL */
+ int port; /* port, or zero */
+ char *path; /* path, or "". */
+ char *query; /* query, or NULL */
+ char *fragment; /* fragment or NULL */
+};
+
+struct evhttp_uri *
+evhttp_uri_new(void)
+{
+ struct evhttp_uri *uri = mm_calloc(sizeof(struct evhttp_uri), 1);
+ if (uri)
+ uri->port = -1;
+ return uri;
+}
+
+void
+evhttp_uri_set_flags(struct evhttp_uri *uri, unsigned flags)
+{
+ uri->flags = flags;
+}
+
+/* Return true if the string starting at s and ending immediately before eos
+ * is a valid URI scheme according to RFC3986
+ */
+static int
+scheme_ok(const char *s, const char *eos)
+{
+ /* scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) */
+ EVUTIL_ASSERT(eos >= s);
+ if (s == eos)
+ return 0;
+ if (!EVUTIL_ISALPHA_(*s))
+ return 0;
+ while (++s < eos) {
+ if (! EVUTIL_ISALNUM_(*s) &&
+ *s != '+' && *s != '-' && *s != '.')
+ return 0;
+ }
+ return 1;
+}
+
+#define SUBDELIMS "!$&'()*+,;="
+
+/* Return true iff [s..eos) is a valid userinfo */
+static int
+userinfo_ok(const char *s, const char *eos)
+{
+ while (s < eos) {
+ if (CHAR_IS_UNRESERVED(*s) ||
+ strchr(SUBDELIMS, *s) ||
+ *s == ':')
+ ++s;
+ else if (*s == '%' && s+2 < eos &&
+ EVUTIL_ISXDIGIT_(s[1]) &&
+ EVUTIL_ISXDIGIT_(s[2]))
+ s += 3;
+ else
+ return 0;
+ }
+ return 1;
+}
+
+static int
+regname_ok(const char *s, const char *eos)
+{
+ while (s && s<eos) {
+ if (CHAR_IS_UNRESERVED(*s) ||
+ strchr(SUBDELIMS, *s))
+ ++s;
+ else if (*s == '%' &&
+ EVUTIL_ISXDIGIT_(s[1]) &&
+ EVUTIL_ISXDIGIT_(s[2]))
+ s += 3;
+ else
+ return 0;
+ }
+ return 1;
+}
+
+static int
+parse_port(const char *s, const char *eos)
+{
+ int portnum = 0;
+ while (s < eos) {
+ if (! EVUTIL_ISDIGIT_(*s))
+ return -1;
+ portnum = (portnum * 10) + (*s - '0');
+ if (portnum < 0)
+ return -1;
+ ++s;
+ }
+ return portnum;
+}
+
+/* returns 0 for bad, 1 for ipv6, 2 for IPvFuture */
+static int
+bracket_addr_ok(const char *s, const char *eos)
+{
+ if (s + 3 > eos || *s != '[' || *(eos-1) != ']')
+ return 0;
+ if (s[1] == 'v') {
+ /* IPvFuture, or junk.
+ "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
+ */
+ s += 2; /* skip [v */
+ --eos;
+ if (!EVUTIL_ISXDIGIT_(*s)) /*require at least one*/
+ return 0;
+ while (s < eos && *s != '.') {
+ if (EVUTIL_ISXDIGIT_(*s))
+ ++s;
+ else
+ return 0;
+ }
+ if (*s != '.')
+ return 0;
+ ++s;
+ while (s < eos) {
+ if (CHAR_IS_UNRESERVED(*s) ||
+ strchr(SUBDELIMS, *s) ||
+ *s == ':')
+ ++s;
+ else
+ return 0;
+ }
+ return 2;
+ } else {
+ /* IPv6, or junk */
+ char buf[64];
+ ev_ssize_t n_chars = eos-s-2;
+ struct in6_addr in6;
+ if (n_chars >= 64) /* way too long */
+ return 0;
+ memcpy(buf, s+1, n_chars);
+ buf[n_chars]='\0';
+ return (evutil_inet_pton(AF_INET6,buf,&in6)==1) ? 1 : 0;
+ }
+}
+
+static int
+parse_authority(struct evhttp_uri *uri, char *s, char *eos)
+{
+ char *cp, *port;
+ EVUTIL_ASSERT(eos);
+ if (eos == s) {
+ uri->host = mm_strdup("");
+ if (uri->host == NULL) {
+ event_warn("%s: strdup", __func__);
+ return -1;
+ }
+ return 0;
+ }
+
+ /* Optionally, we start with "userinfo@" */
+
+ cp = strchr(s, '@');
+ if (cp && cp < eos) {
+ if (! userinfo_ok(s,cp))
+ return -1;
+ *cp++ = '\0';
+ uri->userinfo = mm_strdup(s);
+ if (uri->userinfo == NULL) {
+ event_warn("%s: strdup", __func__);
+ return -1;
+ }
+ } else {
+ cp = s;
+ }
+ /* Optionally, we end with ":port" */
+ for (port=eos-1; port >= cp && EVUTIL_ISDIGIT_(*port); --port)
+ ;
+ if (port >= cp && *port == ':') {
+ if (port+1 == eos) /* Leave port unspecified; the RFC allows a
+ * nil port */
+ uri->port = -1;
+ else if ((uri->port = parse_port(port+1, eos))<0)
+ return -1;
+ eos = port;
+ }
+ /* Now, cp..eos holds the "host" port, which can be an IPv4Address,
+ * an IP-Literal, or a reg-name */
+ EVUTIL_ASSERT(eos >= cp);
+ if (*cp == '[' && eos >= cp+2 && *(eos-1) == ']') {
+ /* IPv6address, IP-Literal, or junk. */
+ if (! bracket_addr_ok(cp, eos))
+ return -1;
+ } else {
+ /* Make sure the host part is ok. */
+ if (! regname_ok(cp,eos)) /* Match IPv4Address or reg-name */
+ return -1;
+ }
+ uri->host = mm_malloc(eos-cp+1);
+ if (uri->host == NULL) {
+ event_warn("%s: malloc", __func__);
+ return -1;
+ }
+ memcpy(uri->host, cp, eos-cp);
+ uri->host[eos-cp] = '\0';
+ return 0;
+
+}
+
+static char *
+end_of_authority(char *cp)
+{
+ while (*cp) {
+ if (*cp == '?' || *cp == '#' || *cp == '/')
+ return cp;
+ ++cp;
+ }
+ return cp;
+}
+
+enum uri_part {
+ PART_PATH,
+ PART_QUERY,
+ PART_FRAGMENT
+};
+
+/* Return the character after the longest prefix of 'cp' that matches...
+ * *pchar / "/" if allow_qchars is false, or
+ * *(pchar / "/" / "?") if allow_qchars is true.
+ */
+static char *
+end_of_path(char *cp, enum uri_part part, unsigned flags)
+{
+ if (flags & EVHTTP_URI_NONCONFORMANT) {
+ /* If NONCONFORMANT:
+ * Path is everything up to a # or ? or nul.
+ * Query is everything up a # or nul
+ * Fragment is everything up to a nul.
+ */
+ switch (part) {
+ case PART_PATH:
+ while (*cp && *cp != '#' && *cp != '?')
+ ++cp;
+ break;
+ case PART_QUERY:
+ while (*cp && *cp != '#')
+ ++cp;
+ break;
+ case PART_FRAGMENT:
+ cp += strlen(cp);
+ break;
+ };
+ return cp;
+ }
+
+ while (*cp) {
+ if (CHAR_IS_UNRESERVED(*cp) ||
+ strchr(SUBDELIMS, *cp) ||
+ *cp == ':' || *cp == '@' || *cp == '/')
+ ++cp;
+ else if (*cp == '%' && EVUTIL_ISXDIGIT_(cp[1]) &&
+ EVUTIL_ISXDIGIT_(cp[2]))
+ cp += 3;
+ else if (*cp == '?' && part != PART_PATH)
+ ++cp;
+ else
+ return cp;
+ }
+ return cp;
+}
+
+static int
+path_matches_noscheme(const char *cp)
+{
+ while (*cp) {
+ if (*cp == ':')
+ return 0;
+ else if (*cp == '/')
+ return 1;
+ ++cp;
+ }
+ return 1;
+}
+
+struct evhttp_uri *
+evhttp_uri_parse(const char *source_uri)
+{
+ return evhttp_uri_parse_with_flags(source_uri, 0);
+}
+
+struct evhttp_uri *
+evhttp_uri_parse_with_flags(const char *source_uri, unsigned flags)
+{
+ char *readbuf = NULL, *readp = NULL, *token = NULL, *query = NULL;
+ char *path = NULL, *fragment = NULL;
+ int got_authority = 0;
+
+ struct evhttp_uri *uri = mm_calloc(1, sizeof(struct evhttp_uri));
+ if (uri == NULL) {
+ event_warn("%s: calloc", __func__);
+ goto err;
+ }
+ uri->port = -1;
+ uri->flags = flags;
+
+ readbuf = mm_strdup(source_uri);
+ if (readbuf == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+
+ readp = readbuf;
+ token = NULL;
+
+ /* We try to follow RFC3986 here as much as we can, and match
+ the productions
+
+ URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
+
+ relative-ref = relative-part [ "?" query ] [ "#" fragment ]
+ */
+
+ /* 1. scheme: */
+ token = strchr(readp, ':');
+ if (token && scheme_ok(readp,token)) {
+ *token = '\0';
+ uri->scheme = mm_strdup(readp);
+ if (uri->scheme == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+ readp = token+1; /* eat : */
+ }
+
+ /* 2. Optionally, "//" then an 'authority' part. */
+ if (readp[0]=='/' && readp[1] == '/') {
+ char *authority;
+ readp += 2;
+ authority = readp;
+ path = end_of_authority(readp);
+ if (parse_authority(uri, authority, path) < 0)
+ goto err;
+ readp = path;
+ got_authority = 1;
+ }
+
+ /* 3. Query: path-abempty, path-absolute, path-rootless, or path-empty
+ */
+ path = readp;
+ readp = end_of_path(path, PART_PATH, flags);
+
+ /* Query */
+ if (*readp == '?') {
+ *readp = '\0';
+ ++readp;
+ query = readp;
+ readp = end_of_path(readp, PART_QUERY, flags);
+ }
+ /* fragment */
+ if (*readp == '#') {
+ *readp = '\0';
+ ++readp;
+ fragment = readp;
+ readp = end_of_path(readp, PART_FRAGMENT, flags);
+ }
+ if (*readp != '\0') {
+ goto err;
+ }
+
+ /* These next two cases may be unreachable; I'm leaving them
+ * in to be defensive. */
+ /* If you didn't get an authority, the path can't begin with "//" */
+ if (!got_authority && path[0]=='/' && path[1]=='/')
+ goto err;
+ /* If you did get an authority, the path must begin with "/" or be
+ * empty. */
+ if (got_authority && path[0] != '/' && path[0] != '\0')
+ goto err;
+ /* (End of maybe-unreachable cases) */
+
+ /* If there was no scheme, the first part of the path (if any) must
+ * have no colon in it. */
+ if (! uri->scheme && !path_matches_noscheme(path))
+ goto err;
+
+ EVUTIL_ASSERT(path);
+ uri->path = mm_strdup(path);
+ if (uri->path == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+
+ if (query) {
+ uri->query = mm_strdup(query);
+ if (uri->query == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+ }
+ if (fragment) {
+ uri->fragment = mm_strdup(fragment);
+ if (uri->fragment == NULL) {
+ event_warn("%s: strdup", __func__);
+ goto err;
+ }
+ }
+
+ mm_free(readbuf);
+
+ return uri;
+err:
+ if (uri)
+ evhttp_uri_free(uri);
+ if (readbuf)
+ mm_free(readbuf);
+ return NULL;
+}
+
+void
+evhttp_uri_free(struct evhttp_uri *uri)
+{
+#define URI_FREE_STR_(f) \
+ if (uri->f) { \
+ mm_free(uri->f); \
+ }
+
+ URI_FREE_STR_(scheme);
+ URI_FREE_STR_(userinfo);
+ URI_FREE_STR_(host);
+ URI_FREE_STR_(path);
+ URI_FREE_STR_(query);
+ URI_FREE_STR_(fragment);
+
+ mm_free(uri);
+#undef URI_FREE_STR_
+}
+
+char *
+evhttp_uri_join(struct evhttp_uri *uri, char *buf, size_t limit)
+{
+ struct evbuffer *tmp = 0;
+ size_t joined_size = 0;
+ char *output = NULL;
+
+#define URI_ADD_(f) evbuffer_add(tmp, uri->f, strlen(uri->f))
+
+ if (!uri || !buf || !limit)
+ return NULL;
+
+ tmp = evbuffer_new();
+ if (!tmp)
+ return NULL;
+
+ if (uri->scheme) {
+ URI_ADD_(scheme);
+ evbuffer_add(tmp, ":", 1);
+ }
+ if (uri->host) {
+ evbuffer_add(tmp, "//", 2);
+ if (uri->userinfo)
+ evbuffer_add_printf(tmp,"%s@", uri->userinfo);
+ URI_ADD_(host);
+ if (uri->port >= 0)
+ evbuffer_add_printf(tmp,":%d", uri->port);
+
+ if (uri->path && uri->path[0] != '/' && uri->path[0] != '\0')
+ goto err;
+ }
+
+ if (uri->path)
+ URI_ADD_(path);
+
+ if (uri->query) {
+ evbuffer_add(tmp, "?", 1);
+ URI_ADD_(query);
+ }
+
+ if (uri->fragment) {
+ evbuffer_add(tmp, "#", 1);
+ URI_ADD_(fragment);
+ }
+
+ evbuffer_add(tmp, "\0", 1); /* NUL */
+
+ joined_size = evbuffer_get_length(tmp);
+
+ if (joined_size > limit) {
+ /* It doesn't fit. */
+ evbuffer_free(tmp);
+ return NULL;
+ }
+ evbuffer_remove(tmp, buf, joined_size);
+
+ output = buf;
+err:
+ evbuffer_free(tmp);
+
+ return output;
+#undef URI_ADD_
+}
+
+const char *
+evhttp_uri_get_scheme(const struct evhttp_uri *uri)
+{
+ return uri->scheme;
+}
+const char *
+evhttp_uri_get_userinfo(const struct evhttp_uri *uri)
+{
+ return uri->userinfo;
+}
+const char *
+evhttp_uri_get_host(const struct evhttp_uri *uri)
+{
+ return uri->host;
+}
+int
+evhttp_uri_get_port(const struct evhttp_uri *uri)
+{
+ return uri->port;
+}
+const char *
+evhttp_uri_get_path(const struct evhttp_uri *uri)
+{
+ return uri->path;
+}
+const char *
+evhttp_uri_get_query(const struct evhttp_uri *uri)
+{
+ return uri->query;
+}
+const char *
+evhttp_uri_get_fragment(const struct evhttp_uri *uri)
+{
+ return uri->fragment;
+}
+
+#define URI_SET_STR_(f) do { \
+ if (uri->f) \
+ mm_free(uri->f); \
+ if (f) { \
+ if ((uri->f = mm_strdup(f)) == NULL) { \
+ event_warn("%s: strdup()", __func__); \
+ return -1; \
+ } \
+ } else { \
+ uri->f = NULL; \
+ } \
+ } while(0)
+
+int
+evhttp_uri_set_scheme(struct evhttp_uri *uri, const char *scheme)
+{
+ if (scheme && !scheme_ok(scheme, scheme+strlen(scheme)))
+ return -1;
+
+ URI_SET_STR_(scheme);
+ return 0;
+}
+int
+evhttp_uri_set_userinfo(struct evhttp_uri *uri, const char *userinfo)
+{
+ if (userinfo && !userinfo_ok(userinfo, userinfo+strlen(userinfo)))
+ return -1;
+ URI_SET_STR_(userinfo);
+ return 0;
+}
+int
+evhttp_uri_set_host(struct evhttp_uri *uri, const char *host)
+{
+ if (host) {
+ if (host[0] == '[') {
+ if (! bracket_addr_ok(host, host+strlen(host)))
+ return -1;
+ } else {
+ if (! regname_ok(host, host+strlen(host)))
+ return -1;
+ }
+ }
+
+ URI_SET_STR_(host);
+ return 0;
+}
+int
+evhttp_uri_set_port(struct evhttp_uri *uri, int port)
+{
+ if (port < -1)
+ return -1;
+ uri->port = port;
+ return 0;
+}
+#define end_of_cpath(cp,p,f) \
+ ((const char*)(end_of_path(((char*)(cp)), (p), (f))))
+
+int
+evhttp_uri_set_path(struct evhttp_uri *uri, const char *path)
+{
+ if (path && end_of_cpath(path, PART_PATH, uri->flags) != path+strlen(path))
+ return -1;
+
+ URI_SET_STR_(path);
+ return 0;
+}
+int
+evhttp_uri_set_query(struct evhttp_uri *uri, const char *query)
+{
+ if (query && end_of_cpath(query, PART_QUERY, uri->flags) != query+strlen(query))
+ return -1;
+ URI_SET_STR_(query);
+ return 0;
+}
+int
+evhttp_uri_set_fragment(struct evhttp_uri *uri, const char *fragment)
+{
+ if (fragment && end_of_cpath(fragment, PART_FRAGMENT, uri->flags) != fragment+strlen(fragment))
+ return -1;
+ URI_SET_STR_(fragment);
+ return 0;
+}
diff --git a/sntp/libevent/include/evdns.h b/sntp/libevent/include/evdns.h
new file mode 100644
index 0000000..8672db0
--- /dev/null
+++ b/sntp/libevent/include/evdns.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT1_EVDNS_H_INCLUDED_
+#define EVENT1_EVDNS_H_INCLUDED_
+
+/** @file evdns.h
+
+ A dns subsystem for Libevent.
+
+ The <evdns.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/evdns.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other <event2/...>
+ headers.
+ */
+
+#include <event.h>
+#include <event2/dns.h>
+#include <event2/dns_compat.h>
+#include <event2/dns_struct.h>
+
+#endif /* EVENT1_EVDNS_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event.h b/sntp/libevent/include/event.h
new file mode 100644
index 0000000..3a1b0c2
--- /dev/null
+++ b/sntp/libevent/include/event.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT1_EVENT_H_INCLUDED_
+#define EVENT1_EVENT_H_INCLUDED_
+
+/** @file event.h
+
+ A library for writing event-driven network servers.
+
+ The <event.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/event.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other event2/
+ headers.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdarg.h>
+
+/* For int types. */
+#include <evutil.h>
+
+#ifdef _WIN32
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+#endif
+
+#include <event2/event_struct.h>
+#include <event2/event.h>
+#include <event2/event_compat.h>
+#include <event2/buffer.h>
+#include <event2/buffer_compat.h>
+#include <event2/bufferevent.h>
+#include <event2/bufferevent_struct.h>
+#include <event2/bufferevent_compat.h>
+#include <event2/tag.h>
+#include <event2/tag_compat.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT1_EVENT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/buffer.h b/sntp/libevent/include/event2/buffer.h
new file mode 100644
index 0000000..839d6e7
--- /dev/null
+++ b/sntp/libevent/include/event2/buffer.h
@@ -0,0 +1,1081 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_BUFFER_H_INCLUDED_
+#define EVENT2_BUFFER_H_INCLUDED_
+
+/** @file event2/buffer.h
+
+ Functions for buffering data for network sending or receiving.
+
+ An evbuffer can be used for preparing data before sending it to
+ the network or conversely for reading data from the network.
+ Evbuffers try to avoid memory copies as much as possible. As a
+ result, evbuffers can be used to pass data around without actually
+ incurring the overhead of copying the data.
+
+ A new evbuffer can be allocated with evbuffer_new(), and can be
+ freed with evbuffer_free(). Most users will be using evbuffers via
+ the bufferevent interface. To access a bufferevent's evbuffers, use
+ bufferevent_get_input() and bufferevent_get_output().
+
+ There are several guidelines for using evbuffers.
+
+ - if you already know how much data you are going to add as a result
+ of calling evbuffer_add() multiple times, it makes sense to use
+ evbuffer_expand() first to make sure that enough memory is allocated
+ before hand.
+
+ - evbuffer_add_buffer() adds the contents of one buffer to the other
+ without incurring any unnecessary memory copies.
+
+ - evbuffer_add() and evbuffer_add_buffer() do not mix very well:
+ if you use them, you will wind up with fragmented memory in your
+ buffer.
+
+ - For high-performance code, you may want to avoid copying data into and out
+ of buffers. You can skip the copy step by using
+ evbuffer_reserve_space()/evbuffer_commit_space() when writing into a
+ buffer, and evbuffer_peek() when reading.
+
+ In Libevent 2.0 and later, evbuffers are represented using a linked
+ list of memory chunks, with pointers to the first and last chunk in
+ the chain.
+
+ As the contents of an evbuffer can be stored in multiple different
+ memory blocks, it cannot be accessed directly. Instead, evbuffer_pullup()
+ can be used to force a specified number of bytes to be contiguous. This
+ will cause memory reallocation and memory copies if the data is split
+ across multiple blocks. It is more efficient, however, to use
+ evbuffer_peek() if you don't require that the memory to be contiguous.
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#include <stdarg.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+#include <event2/util.h>
+
+/**
+ An evbuffer is an opaque data type for efficiently buffering data to be
+ sent or received on the network.
+
+ @see event2/event.h for more information
+*/
+struct evbuffer
+#ifdef EVENT_IN_DOXYGEN_
+{}
+#endif
+;
+
+/**
+ Pointer to a position within an evbuffer.
+
+ Used when repeatedly searching through a buffer. Calling any function
+ that modifies or re-packs the buffer contents may invalidate all
+ evbuffer_ptrs for that buffer. Do not modify these values except with
+ evbuffer_ptr_set.
+
+ Used when repeatedly searching through a buffer. Calls to any function
+ that modifies or re-packs the buffer contents may invalidate all
+ evbuffer_ptrs for that buffer. Do not modify these values except with
+ evbuffer_ptr_set.
+
+ An evbuffer_ptr can represent any position from the start of a buffer up
+ to a position immediately after the end of a buffer.
+
+ @see evbuffer_ptr_set()
+ */
+struct evbuffer_ptr {
+ ev_ssize_t pos;
+
+ /* Do not alter or rely on the values of fields: they are for internal
+ * use */
+ struct {
+ void *chain;
+ size_t pos_in_chain;
+ } internal_;
+};
+
+/** Describes a single extent of memory inside an evbuffer. Used for
+ direct-access functions.
+
+ @see evbuffer_reserve_space, evbuffer_commit_space, evbuffer_peek
+ */
+#ifdef EVENT__HAVE_SYS_UIO_H
+#define evbuffer_iovec iovec
+/* Internal use -- defined only if we are using the native struct iovec */
+#define EVBUFFER_IOVEC_IS_NATIVE_
+#else
+struct evbuffer_iovec {
+ /** The start of the extent of memory. */
+ void *iov_base;
+ /** The length of the extent of memory. */
+ size_t iov_len;
+};
+#endif
+
+/**
+ Allocate storage for a new evbuffer.
+
+ @return a pointer to a newly allocated evbuffer struct, or NULL if an error
+ occurred
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *evbuffer_new(void);
+/**
+ Deallocate storage for an evbuffer.
+
+ @param buf pointer to the evbuffer to be freed
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_free(struct evbuffer *buf);
+
+/**
+ Enable locking on an evbuffer so that it can safely be used by multiple
+ threads at the same time.
+
+ NOTE: when locking is enabled, the lock will be held when callbacks are
+ invoked. This could result in deadlock if you aren't careful. Plan
+ accordingly!
+
+ @param buf An evbuffer to make lockable.
+ @param lock A lock object, or NULL if we should allocate our own.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_enable_locking(struct evbuffer *buf, void *lock);
+
+/**
+ Acquire the lock on an evbuffer. Has no effect if locking was not enabled
+ with evbuffer_enable_locking.
+*/
+EVENT2_EXPORT_SYMBOL
+void evbuffer_lock(struct evbuffer *buf);
+
+/**
+ Release the lock on an evbuffer. Has no effect if locking was not enabled
+ with evbuffer_enable_locking.
+*/
+EVENT2_EXPORT_SYMBOL
+void evbuffer_unlock(struct evbuffer *buf);
+
+
+/** If this flag is set, then we will not use evbuffer_peek(),
+ * evbuffer_remove(), evbuffer_remove_buffer(), and so on to read bytes
+ * from this buffer: we'll only take bytes out of this buffer by
+ * writing them to the network (as with evbuffer_write_atmost), by
+ * removing them without observing them (as with evbuffer_drain),
+ * or by copying them all out at once (as with evbuffer_add_buffer).
+ *
+ * Using this option allows the implementation to use sendfile-based
+ * operations for evbuffer_add_file(); see that function for more
+ * information.
+ *
+ * This flag is on by default for bufferevents that can take advantage
+ * of it; you should never actually need to set it on a bufferevent's
+ * output buffer.
+ */
+#define EVBUFFER_FLAG_DRAINS_TO_FD 1
+
+/** Change the flags that are set for an evbuffer by adding more.
+ *
+ * @param buffer the evbuffer that the callback is watching.
+ * @param cb the callback whose status we want to change.
+ * @param flags One or more EVBUFFER_FLAG_* options
+ * @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_set_flags(struct evbuffer *buf, ev_uint64_t flags);
+/** Change the flags that are set for an evbuffer by removing some.
+ *
+ * @param buffer the evbuffer that the callback is watching.
+ * @param cb the callback whose status we want to change.
+ * @param flags One or more EVBUFFER_FLAG_* options
+ * @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_clear_flags(struct evbuffer *buf, ev_uint64_t flags);
+
+/**
+ Returns the total number of bytes stored in the evbuffer
+
+ @param buf pointer to the evbuffer
+ @return the number of bytes stored in the evbuffer
+*/
+EVENT2_EXPORT_SYMBOL
+size_t evbuffer_get_length(const struct evbuffer *buf);
+
+/**
+ Returns the number of contiguous available bytes in the first buffer chain.
+
+ This is useful when processing data that might be split into multiple
+ chains, or that might all be in the first chain. Calls to
+ evbuffer_pullup() that cause reallocation and copying of data can thus be
+ avoided.
+
+ @param buf pointer to the evbuffer
+ @return 0 if no data is available, otherwise the number of available bytes
+ in the first buffer chain.
+*/
+EVENT2_EXPORT_SYMBOL
+size_t evbuffer_get_contiguous_space(const struct evbuffer *buf);
+
+/**
+ Expands the available space in an evbuffer.
+
+ Expands the available space in the evbuffer to at least datlen, so that
+ appending datlen additional bytes will not require any new allocations.
+
+ @param buf the evbuffer to be expanded
+ @param datlen the new minimum length requirement
+ @return 0 if successful, or -1 if an error occurred
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_expand(struct evbuffer *buf, size_t datlen);
+
+/**
+ Reserves space in the last chain or chains of an evbuffer.
+
+ Makes space available in the last chain or chains of an evbuffer that can
+ be arbitrarily written to by a user. The space does not become
+ available for reading until it has been committed with
+ evbuffer_commit_space().
+
+ The space is made available as one or more extents, represented by
+ an initial pointer and a length. You can force the memory to be
+ available as only one extent. Allowing more extents, however, makes the
+ function more efficient.
+
+ Multiple subsequent calls to this function will make the same space
+ available until evbuffer_commit_space() has been called.
+
+ It is an error to do anything that moves around the buffer's internal
+ memory structures before committing the space.
+
+ NOTE: The code currently does not ever use more than two extents.
+ This may change in future versions.
+
+ @param buf the evbuffer in which to reserve space.
+ @param size how much space to make available, at minimum. The
+ total length of the extents may be greater than the requested
+ length.
+ @param vec an array of one or more evbuffer_iovec structures to
+ hold pointers to the reserved extents of memory.
+ @param n_vec The length of the vec array. Must be at least 1;
+ 2 is more efficient.
+ @return the number of provided extents, or -1 on error.
+ @see evbuffer_commit_space()
+*/
+EVENT2_EXPORT_SYMBOL
+int
+evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
+ struct evbuffer_iovec *vec, int n_vec);
+
+/**
+ Commits previously reserved space.
+
+ Commits some of the space previously reserved with
+ evbuffer_reserve_space(). It then becomes available for reading.
+
+ This function may return an error if the pointer in the extents do
+ not match those returned from evbuffer_reserve_space, or if data
+ has been added to the buffer since the space was reserved.
+
+ If you want to commit less data than you got reserved space for,
+ modify the iov_len pointer of the appropriate extent to a smaller
+ value. Note that you may have received more space than you
+ requested if it was available!
+
+ @param buf the evbuffer in which to reserve space.
+ @param vec one or two extents returned by evbuffer_reserve_space.
+ @param n_vecs the number of extents.
+ @return 0 on success, -1 on error
+ @see evbuffer_reserve_space()
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_commit_space(struct evbuffer *buf,
+ struct evbuffer_iovec *vec, int n_vecs);
+
+/**
+ Append data to the end of an evbuffer.
+
+ @param buf the evbuffer to be appended to
+ @param data pointer to the beginning of the data buffer
+ @param datlen the number of bytes to be copied from the data buffer
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add(struct evbuffer *buf, const void *data, size_t datlen);
+
+
+/**
+ Read data from an evbuffer and drain the bytes read.
+
+ If more bytes are requested than are available in the evbuffer, we
+ only extract as many bytes as were available.
+
+ @param buf the evbuffer to be read from
+ @param data the destination buffer to store the result
+ @param datlen the maximum size of the destination buffer
+ @return the number of bytes read, or -1 if we can't drain the buffer.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove(struct evbuffer *buf, void *data, size_t datlen);
+
+/**
+ Read data from an evbuffer, and leave the buffer unchanged.
+
+ If more bytes are requested than are available in the evbuffer, we
+ only extract as many bytes as were available.
+
+ @param buf the evbuffer to be read from
+ @param data_out the destination buffer to store the result
+ @param datlen the maximum size of the destination buffer
+ @return the number of bytes read, or -1 if we can't drain the buffer.
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen);
+
+/**
+ Read data from the middle of an evbuffer, and leave the buffer unchanged.
+
+ If more bytes are requested than are available in the evbuffer, we
+ only extract as many bytes as were available.
+
+ @param buf the evbuffer to be read from
+ @param pos the position to start reading from
+ @param data_out the destination buffer to store the result
+ @param datlen the maximum size of the destination buffer
+ @return the number of bytes read, or -1 if we can't drain the buffer.
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos, void *data_out, size_t datlen);
+
+/**
+ Read data from an evbuffer into another evbuffer, draining
+ the bytes from the source buffer. This function avoids copy
+ operations to the extent possible.
+
+ If more bytes are requested than are available in src, the src
+ buffer is drained completely.
+
+ @param src the evbuffer to be read from
+ @param dst the destination evbuffer to store the result into
+ @param datlen the maximum numbers of bytes to transfer
+ @return the number of bytes read
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove_buffer(struct evbuffer *src, struct evbuffer *dst,
+ size_t datlen);
+
+/** Used to tell evbuffer_readln what kind of line-ending to look for.
+ */
+enum evbuffer_eol_style {
+ /** Any sequence of CR and LF characters is acceptable as an
+ * EOL.
+ *
+ * Note that this style can produce ambiguous results: the
+ * sequence "CRLF" will be treated as a single EOL if it is
+ * all in the buffer at once, but if you first read a CR from
+ * the network and later read an LF from the network, it will
+ * be treated as two EOLs.
+ */
+ EVBUFFER_EOL_ANY,
+ /** An EOL is an LF, optionally preceded by a CR. This style is
+ * most useful for implementing text-based internet protocols. */
+ EVBUFFER_EOL_CRLF,
+ /** An EOL is a CR followed by an LF. */
+ EVBUFFER_EOL_CRLF_STRICT,
+ /** An EOL is a LF. */
+ EVBUFFER_EOL_LF,
+ /** An EOL is a NUL character (that is, a single byte with value 0) */
+ EVBUFFER_EOL_NUL
+};
+
+/**
+ * Read a single line from an evbuffer.
+ *
+ * Reads a line terminated by an EOL as determined by the evbuffer_eol_style
+ * argument. Returns a newly allocated nul-terminated string; the caller must
+ * free the returned value. The EOL is not included in the returned string.
+ *
+ * @param buffer the evbuffer to read from
+ * @param n_read_out if non-NULL, points to a size_t that is set to the
+ * number of characters in the returned string. This is useful for
+ * strings that can contain NUL characters.
+ * @param eol_style the style of line-ending to use.
+ * @return pointer to a single line, or NULL if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+char *evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
+ enum evbuffer_eol_style eol_style);
+
+/**
+ Move all data from one evbuffer into another evbuffer.
+
+ This is a destructive add. The data from one buffer moves into
+ the other buffer. However, no unnecessary memory copies occur.
+
+ @param outbuf the output buffer
+ @param inbuf the input buffer
+ @return 0 if successful, or -1 if an error occurred
+
+ @see evbuffer_remove_buffer()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf);
+
+/**
+ Copy data from one evbuffer into another evbuffer.
+
+ This is a non-destructive add. The data from one buffer is copied
+ into the other buffer. However, no unnecessary memory copies occur.
+
+ Note that buffers already containing buffer references can't be added
+ to other buffers.
+
+ @param outbuf the output buffer
+ @param inbuf the input buffer
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_buffer_reference(struct evbuffer *outbuf,
+ struct evbuffer *inbuf);
+
+/**
+ A cleanup function for a piece of memory added to an evbuffer by
+ reference.
+
+ @see evbuffer_add_reference()
+ */
+typedef void (*evbuffer_ref_cleanup_cb)(const void *data,
+ size_t datalen, void *extra);
+
+/**
+ Reference memory into an evbuffer without copying.
+
+ The memory needs to remain valid until all the added data has been
+ read. This function keeps just a reference to the memory without
+ actually incurring the overhead of a copy.
+
+ @param outbuf the output buffer
+ @param data the memory to reference
+ @param datlen how memory to reference
+ @param cleanupfn callback to be invoked when the memory is no longer
+ referenced by this evbuffer.
+ @param cleanupfn_arg optional argument to the cleanup callback
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_reference(struct evbuffer *outbuf,
+ const void *data, size_t datlen,
+ evbuffer_ref_cleanup_cb cleanupfn, void *cleanupfn_arg);
+
+/**
+ Copy data from a file into the evbuffer for writing to a socket.
+
+ This function avoids unnecessary data copies between userland and
+ kernel. If sendfile is available and the EVBUFFER_FLAG_DRAINS_TO_FD
+ flag is set, it uses those functions. Otherwise, it tries to use
+ mmap (or CreateFileMapping on Windows).
+
+ The function owns the resulting file descriptor and will close it
+ when finished transferring data.
+
+ The results of using evbuffer_remove() or evbuffer_pullup() on
+ evbuffers whose data was added using this function are undefined.
+
+ For more fine-grained control, use evbuffer_add_file_segment.
+
+ @param outbuf the output buffer
+ @param fd the file descriptor
+ @param offset the offset from which to read data
+ @param length how much data to read, or -1 to read as much as possible.
+ (-1 requires that 'fd' support fstat.)
+ @return 0 if successful, or -1 if an error occurred
+*/
+
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_file(struct evbuffer *outbuf, int fd, ev_off_t offset,
+ ev_off_t length);
+
+/**
+ An evbuffer_file_segment holds a reference to a range of a file --
+ possibly the whole file! -- for use in writing from an evbuffer to a
+ socket. It could be implemented with mmap, sendfile, splice, or (if all
+ else fails) by just pulling all the data into RAM. A single
+ evbuffer_file_segment can be added more than once, and to more than one
+ evbuffer.
+ */
+struct evbuffer_file_segment;
+
+/**
+ Flag for creating evbuffer_file_segment: If this flag is set, then when
+ the evbuffer_file_segment is freed and no longer in use by any
+ evbuffer, the underlying fd is closed.
+ */
+#define EVBUF_FS_CLOSE_ON_FREE 0x01
+/**
+ Flag for creating evbuffer_file_segment: Disable memory-map based
+ implementations.
+ */
+#define EVBUF_FS_DISABLE_MMAP 0x02
+/**
+ Flag for creating evbuffer_file_segment: Disable direct fd-to-fd
+ implementations (including sendfile and splice).
+
+ You might want to use this option if data needs to be taken from the
+ evbuffer by any means other than writing it to the network: the sendfile
+ backend is fast, but it only works for sending files directly to the
+ network.
+ */
+#define EVBUF_FS_DISABLE_SENDFILE 0x04
+/**
+ Flag for creating evbuffer_file_segment: Do not allocate a lock for this
+ segment. If this option is set, then neither the segment nor any
+ evbuffer it is added to may ever be accessed from more than one thread
+ at a time.
+ */
+#define EVBUF_FS_DISABLE_LOCKING 0x08
+
+/**
+ A cleanup function for a evbuffer_file_segment added to an evbuffer
+ for reference.
+ */
+typedef void (*evbuffer_file_segment_cleanup_cb)(
+ struct evbuffer_file_segment const* seg, int flags, void* arg);
+
+/**
+ Create and return a new evbuffer_file_segment for reading data from a
+ file and sending it out via an evbuffer.
+
+ This function avoids unnecessary data copies between userland and
+ kernel. Where available, it uses sendfile or splice.
+
+ The file descriptor must not be closed so long as any evbuffer is using
+ this segment.
+
+ The results of using evbuffer_remove() or evbuffer_pullup() or any other
+ function that reads bytes from an evbuffer on any evbuffer containing
+ the newly returned segment are undefined, unless you pass the
+ EVBUF_FS_DISABLE_SENDFILE flag to this function.
+
+ @param fd an open file to read from.
+ @param offset an index within the file at which to start reading
+ @param length how much data to read, or -1 to read as much as possible.
+ (-1 requires that 'fd' support fstat.)
+ @param flags any number of the EVBUF_FS_* flags
+ @return a new evbuffer_file_segment, or NULL on failure.
+ **/
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_file_segment *evbuffer_file_segment_new(
+ int fd, ev_off_t offset, ev_off_t length, unsigned flags);
+
+/**
+ Free an evbuffer_file_segment
+
+ It is safe to call this function even if the segment has been added to
+ one or more evbuffers. The evbuffer_file_segment will not be freed
+ until no more references to it exist.
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_file_segment_free(struct evbuffer_file_segment *seg);
+
+/**
+ Add cleanup callback and argument for the callback to an
+ evbuffer_file_segment.
+
+ The cleanup callback will be invoked when no more references to the
+ evbuffer_file_segment exist.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evbuffer_file_segment_add_cleanup_cb(struct evbuffer_file_segment *seg,
+ evbuffer_file_segment_cleanup_cb cb, void* arg);
+
+/**
+ Insert some or all of an evbuffer_file_segment at the end of an evbuffer
+
+ Note that the offset and length parameters of this function have a
+ different meaning from those provided to evbuffer_file_segment_new: When
+ you create the segment, the offset is the offset _within the file_, and
+ the length is the length _of the segment_, whereas when you add a
+ segment to an evbuffer, the offset is _within the segment_ and the
+ length is the length of the _part of the segment you want to use.
+
+ In other words, if you have a 10 KiB file, and you create an
+ evbuffer_file_segment for it with offset 20 and length 1000, it will
+ refer to bytes 20..1019 inclusive. If you then pass this segment to
+ evbuffer_add_file_segment and specify an offset of 20 and a length of
+ 50, you will be adding bytes 40..99 inclusive.
+
+ @param buf the evbuffer to append to
+ @param seg the segment to add
+ @param offset the offset within the segment to start from
+ @param length the amount of data to add, or -1 to add it all.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_file_segment(struct evbuffer *buf,
+ struct evbuffer_file_segment *seg, ev_off_t offset, ev_off_t length);
+
+/**
+ Append a formatted string to the end of an evbuffer.
+
+ The string is formated as printf.
+
+ @param buf the evbuffer that will be appended to
+ @param fmt a format string
+ @param ... arguments that will be passed to printf(3)
+ @return The number of bytes added if successful, or -1 if an error occurred.
+
+ @see evutil_printf(), evbuffer_add_vprintf()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 3)))
+#endif
+;
+
+/**
+ Append a va_list formatted string to the end of an evbuffer.
+
+ @param buf the evbuffer that will be appended to
+ @param fmt a format string
+ @param ap a varargs va_list argument array that will be passed to vprintf(3)
+ @return The number of bytes added if successful, or -1 if an error occurred.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
+#ifdef __GNUC__
+ __attribute__((format(printf, 2, 0)))
+#endif
+;
+
+
+/**
+ Remove a specified number of bytes data from the beginning of an evbuffer.
+
+ @param buf the evbuffer to be drained
+ @param len the number of bytes to drain from the beginning of the buffer
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_drain(struct evbuffer *buf, size_t len);
+
+
+/**
+ Write the contents of an evbuffer to a file descriptor.
+
+ The evbuffer will be drained after the bytes have been successfully written.
+
+ @param buffer the evbuffer to be written and drained
+ @param fd the file descriptor to be written to
+ @return the number of bytes written, or -1 if an error occurred
+ @see evbuffer_read()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_write(struct evbuffer *buffer, evutil_socket_t fd);
+
+/**
+ Write some of the contents of an evbuffer to a file descriptor.
+
+ The evbuffer will be drained after the bytes have been successfully written.
+
+ @param buffer the evbuffer to be written and drained
+ @param fd the file descriptor to be written to
+ @param howmuch the largest allowable number of bytes to write, or -1
+ to write as many bytes as we can.
+ @return the number of bytes written, or -1 if an error occurred
+ @see evbuffer_read()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
+ ev_ssize_t howmuch);
+
+/**
+ Read from a file descriptor and store the result in an evbuffer.
+
+ @param buffer the evbuffer to store the result
+ @param fd the file descriptor to read from
+ @param howmuch the number of bytes to be read
+ @return the number of bytes read, or -1 if an error occurred
+ @see evbuffer_write()
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_read(struct evbuffer *buffer, evutil_socket_t fd, int howmuch);
+
+/**
+ Search for a string within an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param what the string to be searched for
+ @param len the length of the search string
+ @param start NULL or a pointer to a valid struct evbuffer_ptr.
+ @return a struct evbuffer_ptr whose 'pos' field has the offset of the
+ first occurrence of the string in the buffer after 'start'. The 'pos'
+ field of the result is -1 if the string was not found.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_ptr evbuffer_search(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start);
+
+/**
+ Search for a string within part of an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param what the string to be searched for
+ @param len the length of the search string
+ @param start NULL or a pointer to a valid struct evbuffer_ptr that
+ indicates where we should start searching.
+ @param end NULL or a pointer to a valid struct evbuffer_ptr that
+ indicates where we should stop searching.
+ @return a struct evbuffer_ptr whose 'pos' field has the offset of the
+ first occurrence of the string in the buffer after 'start'. The 'pos'
+ field of the result is -1 if the string was not found.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_ptr evbuffer_search_range(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start, const struct evbuffer_ptr *end);
+
+/**
+ Defines how to adjust an evbuffer_ptr by evbuffer_ptr_set()
+
+ @see evbuffer_ptr_set() */
+enum evbuffer_ptr_how {
+ /** Sets the pointer to the position; can be called on with an
+ uninitialized evbuffer_ptr. */
+ EVBUFFER_PTR_SET,
+ /** Advances the pointer by adding to the current position. */
+ EVBUFFER_PTR_ADD
+};
+
+/**
+ Sets the search pointer in the buffer to position.
+
+ There are two ways to use this function: you can call
+ evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET)
+ to move 'pos' to a position 'N' bytes after the start of the buffer, or
+ evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET)
+ to move 'pos' forward by 'N' bytes.
+
+ If evbuffer_ptr is not initialized, this function can only be called
+ with EVBUFFER_PTR_SET.
+
+ An evbuffer_ptr can represent any position from the start of the buffer to
+ a position immediately after the end of the buffer.
+
+ @param buffer the evbuffer to be search
+ @param ptr a pointer to a struct evbuffer_ptr
+ @param position the position at which to start the next search
+ @param how determines how the pointer should be manipulated.
+ @returns 0 on success or -1 otherwise
+*/
+EVENT2_EXPORT_SYMBOL
+int
+evbuffer_ptr_set(struct evbuffer *buffer, struct evbuffer_ptr *ptr,
+ size_t position, enum evbuffer_ptr_how how);
+
+/**
+ Search for an end-of-line string within an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param start NULL or a pointer to a valid struct evbuffer_ptr to start
+ searching at.
+ @param eol_len_out If non-NULL, the pointed-to value will be set to
+ the length of the end-of-line string.
+ @param eol_style The kind of EOL to look for; see evbuffer_readln() for
+ more information
+ @return a struct evbuffer_ptr whose 'pos' field has the offset of the
+ first occurrence EOL in the buffer after 'start'. The 'pos'
+ field of the result is -1 if the string was not found.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_ptr evbuffer_search_eol(struct evbuffer *buffer,
+ struct evbuffer_ptr *start, size_t *eol_len_out,
+ enum evbuffer_eol_style eol_style);
+
+/** Function to peek at data inside an evbuffer without removing it or
+ copying it out.
+
+ Pointers to the data are returned by filling the 'vec_out' array
+ with pointers to one or more extents of data inside the buffer.
+
+ The total data in the extents that you get back may be more than
+ you requested (if there is more data last extent than you asked
+ for), or less (if you do not provide enough evbuffer_iovecs, or if
+ the buffer does not have as much data as you asked to see).
+
+ @param buffer the evbuffer to peek into,
+ @param len the number of bytes to try to peek. If len is negative, we
+ will try to fill as much of vec_out as we can. If len is negative
+ and vec_out is not provided, we return the number of evbuffer_iovecs
+ that would be needed to get all the data in the buffer.
+ @param start_at an evbuffer_ptr indicating the point at which we
+ should start looking for data. NULL means, "At the start of the
+ buffer."
+ @param vec_out an array of evbuffer_iovec
+ @param n_vec the length of vec_out. If 0, we only count how many
+ extents would be necessary to point to the requested amount of
+ data.
+ @return The number of extents needed. This may be less than n_vec
+ if we didn't need all the evbuffer_iovecs we were given, or more
+ than n_vec if we would need more to return all the data that was
+ requested.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len,
+ struct evbuffer_ptr *start_at,
+ struct evbuffer_iovec *vec_out, int n_vec);
+
+
+/** Structure passed to an evbuffer_cb_func evbuffer callback
+
+ @see evbuffer_cb_func, evbuffer_add_cb()
+ */
+struct evbuffer_cb_info {
+ /** The number of bytes in this evbuffer when callbacks were last
+ * invoked. */
+ size_t orig_size;
+ /** The number of bytes added since callbacks were last invoked. */
+ size_t n_added;
+ /** The number of bytes removed since callbacks were last invoked. */
+ size_t n_deleted;
+};
+
+/** Type definition for a callback that is invoked whenever data is added or
+ removed from an evbuffer.
+
+ An evbuffer may have one or more callbacks set at a time. The order
+ in which they are executed is undefined.
+
+ A callback function may add more callbacks, or remove itself from the
+ list of callbacks, or add or remove data from the buffer. It may not
+ remove another callback from the list.
+
+ If a callback adds or removes data from the buffer or from another
+ buffer, this can cause a recursive invocation of your callback or
+ other callbacks. If you ask for an infinite loop, you might just get
+ one: watch out!
+
+ @param buffer the buffer whose size has changed
+ @param info a structure describing how the buffer changed.
+ @param arg a pointer to user data
+*/
+typedef void (*evbuffer_cb_func)(struct evbuffer *buffer, const struct evbuffer_cb_info *info, void *arg);
+
+struct evbuffer_cb_entry;
+/** Add a new callback to an evbuffer.
+
+ Subsequent calls to evbuffer_add_cb() add new callbacks. To remove this
+ callback, call evbuffer_remove_cb or evbuffer_remove_cb_entry.
+
+ @param buffer the evbuffer to be monitored
+ @param cb the callback function to invoke when the evbuffer is modified,
+ or NULL to remove all callbacks.
+ @param cbarg an argument to be provided to the callback function
+ @return a handle to the callback on success, or NULL on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_cb_entry *evbuffer_add_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg);
+
+/** Remove a callback from an evbuffer, given a handle returned from
+ evbuffer_add_cb.
+
+ Calling this function invalidates the handle.
+
+ @return 0 if a callback was removed, or -1 if no matching callback was
+ found.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove_cb_entry(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *ent);
+
+/** Remove a callback from an evbuffer, given the function and argument
+ used to add it.
+
+ @return 0 if a callback was removed, or -1 if no matching callback was
+ found.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_remove_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg);
+
+/** If this flag is not set, then a callback is temporarily disabled, and
+ * should not be invoked.
+ *
+ * @see evbuffer_cb_set_flags(), evbuffer_cb_clear_flags()
+ */
+#define EVBUFFER_CB_ENABLED 1
+
+/** Change the flags that are set for a callback on a buffer by adding more.
+
+ @param buffer the evbuffer that the callback is watching.
+ @param cb the callback whose status we want to change.
+ @param flags EVBUFFER_CB_ENABLED to re-enable the callback.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_cb_set_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags);
+
+/** Change the flags that are set for a callback on a buffer by removing some
+
+ @param buffer the evbuffer that the callback is watching.
+ @param cb the callback whose status we want to change.
+ @param flags EVBUFFER_CB_ENABLED to disable the callback.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_cb_clear_flags(struct evbuffer *buffer,
+ struct evbuffer_cb_entry *cb, ev_uint32_t flags);
+
+#if 0
+/** Postpone calling a given callback until unsuspend is called later.
+
+ This is different from disabling the callback, since the callback will get
+ invoked later if the buffer size changes between now and when we unsuspend
+ it.
+
+ @param the buffer that the callback is watching.
+ @param cb the callback we want to suspend.
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_cb_suspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb);
+/** Stop postponing a callback that we postponed with evbuffer_cb_suspend.
+
+ If data was added to or removed from the buffer while the callback was
+ suspended, the callback will get called once now.
+
+ @param the buffer that the callback is watching.
+ @param cb the callback we want to stop suspending.
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_cb_unsuspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb);
+#endif
+
+/**
+ Makes the data at the beginning of an evbuffer contiguous.
+
+ @param buf the evbuffer to make contiguous
+ @param size the number of bytes to make contiguous, or -1 to make the
+ entire buffer contiguous.
+ @return a pointer to the contiguous memory array, or NULL if param size
+ requested more data than is present in the buffer.
+*/
+
+EVENT2_EXPORT_SYMBOL
+unsigned char *evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size);
+
+/**
+ Prepends data to the beginning of the evbuffer
+
+ @param buf the evbuffer to which to prepend data
+ @param data a pointer to the memory to prepend
+ @param size the number of bytes to prepend
+ @return 0 if successful, or -1 otherwise
+*/
+
+EVENT2_EXPORT_SYMBOL
+int evbuffer_prepend(struct evbuffer *buf, const void *data, size_t size);
+
+/**
+ Prepends all data from the src evbuffer to the beginning of the dst
+ evbuffer.
+
+ @param dst the evbuffer to which to prepend data
+ @param src the evbuffer to prepend; it will be emptied as a result
+ @return 0 if successful, or -1 otherwise
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_prepend_buffer(struct evbuffer *dst, struct evbuffer* src);
+
+/**
+ Prevent calls that modify an evbuffer from succeeding. A buffer may
+ frozen at the front, at the back, or at both the front and the back.
+
+ If the front of a buffer is frozen, operations that drain data from
+ the front of the buffer, or that prepend data to the buffer, will
+ fail until it is unfrozen. If the back a buffer is frozen, operations
+ that append data from the buffer will fail until it is unfrozen.
+
+ @param buf The buffer to freeze
+ @param at_front If true, we freeze the front of the buffer. If false,
+ we freeze the back.
+ @return 0 on success, -1 on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int evbuffer_freeze(struct evbuffer *buf, int at_front);
+/**
+ Re-enable calls that modify an evbuffer.
+
+ @param buf The buffer to un-freeze
+ @param at_front If true, we unfreeze the front of the buffer. If false,
+ we unfreeze the back.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_unfreeze(struct evbuffer *buf, int at_front);
+
+struct event_base;
+/**
+ Force all the callbacks on an evbuffer to be run, not immediately after
+ the evbuffer is altered, but instead from inside the event loop.
+
+ This can be used to serialize all the callbacks to a single thread
+ of execution.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_defer_callbacks(struct evbuffer *buffer, struct event_base *base);
+
+/**
+ Append data from 1 or more iovec's to an evbuffer
+
+ Calculates the number of bytes needed for an iovec structure and guarantees
+ all data will fit into a single chain. Can be used in lieu of functionality
+ which calls evbuffer_add() constantly before being used to increase
+ performance.
+
+ @param buffer the destination buffer
+ @param vec the source iovec
+ @param n_vec the number of iovec structures.
+ @return the number of bytes successfully written to the output buffer.
+*/
+EVENT2_EXPORT_SYMBOL
+size_t evbuffer_add_iovec(struct evbuffer * buffer, struct evbuffer_iovec * vec, int n_vec);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFER_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/buffer_compat.h b/sntp/libevent/include/event2/buffer_compat.h
new file mode 100644
index 0000000..c0bdd9d
--- /dev/null
+++ b/sntp/libevent/include/event2/buffer_compat.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EVENT2_BUFFER_COMPAT_H_INCLUDED_
+#define EVENT2_BUFFER_COMPAT_H_INCLUDED_
+
+#include <event2/visibility.h>
+
+/** @file event2/buffer_compat.h
+
+ Obsolete and deprecated versions of the functions in buffer.h: provided
+ only for backward compatibility.
+ */
+
+
+/**
+ Obsolete alias for evbuffer_readln(buffer, NULL, EOL_STYLE_ANY).
+
+ @deprecated This function is deprecated because its behavior is not correct
+ for almost any protocol, and also because it's wholly subsumed by
+ evbuffer_readln().
+
+ @param buffer the evbuffer to read from
+ @return pointer to a single line, or NULL if an error occurred
+
+*/
+EVENT2_EXPORT_SYMBOL
+char *evbuffer_readline(struct evbuffer *buffer);
+
+/** Type definition for a callback that is invoked whenever data is added or
+ removed from an evbuffer.
+
+ An evbuffer may have one or more callbacks set at a time. The order
+ in which they are executed is undefined.
+
+ A callback function may add more callbacks, or remove itself from the
+ list of callbacks, or add or remove data from the buffer. It may not
+ remove another callback from the list.
+
+ If a callback adds or removes data from the buffer or from another
+ buffer, this can cause a recursive invocation of your callback or
+ other callbacks. If you ask for an infinite loop, you might just get
+ one: watch out!
+
+ @param buffer the buffer whose size has changed
+ @param old_len the previous length of the buffer
+ @param new_len the current length of the buffer
+ @param arg a pointer to user data
+*/
+typedef void (*evbuffer_cb)(struct evbuffer *buffer, size_t old_len, size_t new_len, void *arg);
+
+/**
+ Replace all callbacks on an evbuffer with a single new callback, or
+ remove them.
+
+ Subsequent calls to evbuffer_setcb() replace callbacks set by previous
+ calls. Setting the callback to NULL removes any previously set callback.
+
+ @deprecated This function is deprecated because it clears all previous
+ callbacks set on the evbuffer, which can cause confusing behavior if
+ multiple parts of the code all want to add their own callbacks on a
+ buffer. Instead, use evbuffer_add(), evbuffer_del(), and
+ evbuffer_setflags() to manage your own evbuffer callbacks without
+ interfering with callbacks set by others.
+
+ @param buffer the evbuffer to be monitored
+ @param cb the callback function to invoke when the evbuffer is modified,
+ or NULL to remove all callbacks.
+ @param cbarg an argument to be provided to the callback function
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg);
+
+
+/**
+ Find a string within an evbuffer.
+
+ @param buffer the evbuffer to be searched
+ @param what the string to be searched for
+ @param len the length of the search string
+ @return a pointer to the beginning of the search string, or NULL if the search failed.
+ */
+EVENT2_EXPORT_SYMBOL
+unsigned char *evbuffer_find(struct evbuffer *buffer, const unsigned char *what, size_t len);
+
+/** deprecated in favor of calling the functions directly */
+#define EVBUFFER_LENGTH(x) evbuffer_get_length(x)
+/** deprecated in favor of calling the functions directly */
+#define EVBUFFER_DATA(x) evbuffer_pullup((x), -1)
+
+#endif
+
diff --git a/sntp/libevent/include/event2/bufferevent.h b/sntp/libevent/include/event2/bufferevent.h
new file mode 100644
index 0000000..46203b0
--- /dev/null
+++ b/sntp/libevent/include/event2/bufferevent.h
@@ -0,0 +1,994 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_BUFFEREVENT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_H_INCLUDED_
+
+/**
+ @file event2/bufferevent.h
+
+ Functions for buffering data for network sending or receiving. Bufferevents
+ are higher level than evbuffers: each has an underlying evbuffer for reading
+ and one for writing, and callbacks that are invoked under certain
+ circumstances.
+
+ A bufferevent provides input and output buffers that get filled and
+ drained automatically. The user of a bufferevent no longer deals
+ directly with the I/O, but instead is reading from input and writing
+ to output buffers.
+
+ Once initialized, the bufferevent structure can be used repeatedly
+ with bufferevent_enable() and bufferevent_disable().
+
+ When reading is enabled, the bufferevent will try to read from the
+ file descriptor onto its input buffer, and call the read callback.
+ When writing is enabled, the bufferevent will try to write data onto its
+ file descriptor when the output buffer has enough data, and call the write
+ callback when the output buffer is sufficiently drained.
+
+ Bufferevents come in several flavors, including:
+
+ <dl>
+ <dt>Socket-based bufferevents</dt>
+ <dd>A bufferevent that reads and writes data onto a network
+ socket. Created with bufferevent_socket_new().</dd>
+
+ <dt>Paired bufferevents</dt>
+ <dd>A pair of bufferevents that send and receive data to one
+ another without touching the network. Created with
+ bufferevent_pair_new().</dd>
+
+ <dt>Filtering bufferevents</dt>
+ <dd>A bufferevent that transforms data, and sends or receives it
+ over another underlying bufferevent. Created with
+ bufferevent_filter_new().</dd>
+
+ <dt>SSL-backed bufferevents</dt>
+ <dd>A bufferevent that uses the openssl library to send and
+ receive data over an encrypted connection. Created with
+ bufferevent_openssl_socket_new() or
+ bufferevent_openssl_filter_new().</dd>
+ </dl>
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/** @name Bufferevent event codes
+
+ These flags are passed as arguments to a bufferevent's event callback.
+
+ @{
+*/
+#define BEV_EVENT_READING 0x01 /**< error encountered while reading */
+#define BEV_EVENT_WRITING 0x02 /**< error encountered while writing */
+#define BEV_EVENT_EOF 0x10 /**< eof file reached */
+#define BEV_EVENT_ERROR 0x20 /**< unrecoverable error encountered */
+#define BEV_EVENT_TIMEOUT 0x40 /**< user-specified timeout reached */
+#define BEV_EVENT_CONNECTED 0x80 /**< connect operation finished. */
+/**@}*/
+
+/**
+ An opaque type for handling buffered IO
+
+ @see event2/bufferevent.h
+ */
+struct bufferevent
+#ifdef EVENT_IN_DOXYGEN_
+{}
+#endif
+;
+struct event_base;
+struct evbuffer;
+struct sockaddr;
+
+/**
+ A read or write callback for a bufferevent.
+
+ The read callback is triggered when new data arrives in the input
+ buffer and the amount of readable data exceed the low watermark
+ which is 0 by default.
+
+ The write callback is triggered if the write buffer has been
+ exhausted or fell below its low watermark.
+
+ @param bev the bufferevent that triggered the callback
+ @param ctx the user-specified context for this bufferevent
+ */
+typedef void (*bufferevent_data_cb)(struct bufferevent *bev, void *ctx);
+
+/**
+ An event/error callback for a bufferevent.
+
+ The event callback is triggered if either an EOF condition or another
+ unrecoverable error was encountered.
+
+ For bufferevents with deferred callbacks, this is a bitwise OR of all errors
+ that have happened on the bufferevent since the last callback invocation.
+
+ @param bev the bufferevent for which the error condition was reached
+ @param what a conjunction of flags: BEV_EVENT_READING or BEV_EVENT_WRITING
+ to indicate if the error was encountered on the read or write path,
+ and one of the following flags: BEV_EVENT_EOF, BEV_EVENT_ERROR,
+ BEV_EVENT_TIMEOUT, BEV_EVENT_CONNECTED.
+
+ @param ctx the user-specified context for this bufferevent
+*/
+typedef void (*bufferevent_event_cb)(struct bufferevent *bev, short what, void *ctx);
+
+/** Options that can be specified when creating a bufferevent */
+enum bufferevent_options {
+ /** If set, we close the underlying file
+ * descriptor/bufferevent/whatever when this bufferevent is freed. */
+ BEV_OPT_CLOSE_ON_FREE = (1<<0),
+
+ /** If set, and threading is enabled, operations on this bufferevent
+ * are protected by a lock */
+ BEV_OPT_THREADSAFE = (1<<1),
+
+ /** If set, callbacks are run deferred in the event loop. */
+ BEV_OPT_DEFER_CALLBACKS = (1<<2),
+
+ /** If set, callbacks are executed without locks being held on the
+ * bufferevent. This option currently requires that
+ * BEV_OPT_DEFER_CALLBACKS also be set; a future version of Libevent
+ * might remove the requirement.*/
+ BEV_OPT_UNLOCK_CALLBACKS = (1<<3)
+};
+
+/**
+ Create a new socket bufferevent over an existing socket.
+
+ @param base the event base to associate with the new bufferevent.
+ @param fd the file descriptor from which data is read and written to.
+ This file descriptor is not allowed to be a pipe(2).
+ It is safe to set the fd to -1, so long as you later
+ set it with bufferevent_setfd or bufferevent_socket_connect().
+ @param options Zero or more BEV_OPT_* flags
+ @return a pointer to a newly allocated bufferevent struct, or NULL if an
+ error occurred
+ @see bufferevent_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *bufferevent_socket_new(struct event_base *base, evutil_socket_t fd, int options);
+
+/**
+ Launch a connect() attempt with a socket-based bufferevent.
+
+ When the connect succeeds, the eventcb will be invoked with
+ BEV_EVENT_CONNECTED set.
+
+ If the bufferevent does not already have a socket set, we allocate a new
+ socket here and make it nonblocking before we begin.
+
+ If no address is provided, we assume that the socket is already connecting,
+ and configure the bufferevent so that a BEV_EVENT_CONNECTED event will be
+ yielded when it is done connecting.
+
+ @param bufev an existing bufferevent allocated with
+ bufferevent_socket_new().
+ @param addr the address we should connect to
+ @param socklen The length of the address
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_socket_connect(struct bufferevent *, struct sockaddr *, int);
+
+struct evdns_base;
+/**
+ Resolve the hostname 'hostname' and connect to it as with
+ bufferevent_socket_connect().
+
+ @param bufev An existing bufferevent allocated with bufferevent_socket_new()
+ @param evdns_base Optionally, an evdns_base to use for resolving hostnames
+ asynchronously. May be set to NULL for a blocking resolve.
+ @param family A preferred address family to resolve addresses to, or
+ AF_UNSPEC for no preference. Only AF_INET, AF_INET6, and AF_UNSPEC are
+ supported.
+ @param hostname The hostname to resolve; see below for notes on recognized
+ formats
+ @param port The port to connect to on the resolved address.
+ @return 0 if successful, -1 on failure.
+
+ Recognized hostname formats are:
+
+ www.example.com (hostname)
+ 1.2.3.4 (ipv4address)
+ ::1 (ipv6address)
+ [::1] ([ipv6address])
+
+ Performance note: If you do not provide an evdns_base, this function
+ may block while it waits for a DNS response. This is probably not
+ what you want.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_socket_connect_hostname(struct bufferevent *,
+ struct evdns_base *, int, const char *, int);
+
+/**
+ Return the error code for the last failed DNS lookup attempt made by
+ bufferevent_socket_connect_hostname().
+
+ @param bev The bufferevent object.
+ @return DNS error code.
+ @see evutil_gai_strerror()
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_socket_get_dns_error(struct bufferevent *bev);
+
+/**
+ Assign a bufferevent to a specific event_base.
+
+ NOTE that only socket bufferevents support this function.
+
+ @param base an event_base returned by event_init()
+ @param bufev a bufferevent struct returned by bufferevent_new()
+ or bufferevent_socket_new()
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_new()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_base_set(struct event_base *base, struct bufferevent *bufev);
+
+/**
+ Return the event_base used by a bufferevent
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_base *bufferevent_get_base(struct bufferevent *bev);
+
+/**
+ Assign a priority to a bufferevent.
+
+ Only supported for socket bufferevents.
+
+ @param bufev a bufferevent struct
+ @param pri the priority to be assigned
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_priority_set(struct bufferevent *bufev, int pri);
+
+/**
+ Return the priority of a bufferevent.
+
+ Only supported for socket bufferevents
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_get_priority(const struct bufferevent *bufev);
+
+/**
+ Deallocate the storage associated with a bufferevent structure.
+
+ If there is pending data to write on the bufferevent, it probably won't be
+ flushed before the bufferevent is freed.
+
+ @param bufev the bufferevent structure to be freed.
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_free(struct bufferevent *bufev);
+
+
+/**
+ Changes the callbacks for a bufferevent.
+
+ @param bufev the bufferevent object for which to change callbacks
+ @param readcb callback to invoke when there is data to be read, or NULL if
+ no callback is desired
+ @param writecb callback to invoke when the file descriptor is ready for
+ writing, or NULL if no callback is desired
+ @param eventcb callback to invoke when there is an event on the file
+ descriptor
+ @param cbarg an argument that will be supplied to each of the callbacks
+ (readcb, writecb, and errorcb)
+ @see bufferevent_new()
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_setcb(struct bufferevent *bufev,
+ bufferevent_data_cb readcb, bufferevent_data_cb writecb,
+ bufferevent_event_cb eventcb, void *cbarg);
+
+/**
+ Retrieves the callbacks for a bufferevent.
+
+ @param bufev the bufferevent to examine.
+ @param readcb_ptr if readcb_ptr is nonnull, *readcb_ptr is set to the current
+ read callback for the bufferevent.
+ @param writecb_ptr if writecb_ptr is nonnull, *writecb_ptr is set to the
+ current write callback for the bufferevent.
+ @param eventcb_ptr if eventcb_ptr is nonnull, *eventcb_ptr is set to the
+ current event callback for the bufferevent.
+ @param cbarg_ptr if cbarg_ptr is nonnull, *cbarg_ptr is set to the current
+ callback argument for the bufferevent.
+ @see buffervent_setcb()
+*/
+EVENT2_EXPORT_SYMBOL
+void bufferevent_getcb(struct bufferevent *bufev,
+ bufferevent_data_cb *readcb_ptr,
+ bufferevent_data_cb *writecb_ptr,
+ bufferevent_event_cb *eventcb_ptr,
+ void **cbarg_ptr);
+
+/**
+ Changes the file descriptor on which the bufferevent operates.
+ Not supported for all bufferevent types.
+
+ @param bufev the bufferevent object for which to change the file descriptor
+ @param fd the file descriptor to operate on
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_setfd(struct bufferevent *bufev, evutil_socket_t fd);
+
+/**
+ Returns the file descriptor associated with a bufferevent, or -1 if
+ no file descriptor is associated with the bufferevent.
+ */
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t bufferevent_getfd(struct bufferevent *bufev);
+
+/**
+ Returns the underlying bufferevent associated with a bufferevent (if
+ the bufferevent is a wrapper), or NULL if there is no underlying bufferevent.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *bufferevent_get_underlying(struct bufferevent *bufev);
+
+/**
+ Write data to a bufferevent buffer.
+
+ The bufferevent_write() function can be used to write data to the file
+ descriptor. The data is appended to the output buffer and written to the
+ descriptor automatically as it becomes available for writing.
+
+ @param bufev the bufferevent to be written to
+ @param data a pointer to the data to be written
+ @param size the length of the data, in bytes
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_write_buffer()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_write(struct bufferevent *bufev,
+ const void *data, size_t size);
+
+
+/**
+ Write data from an evbuffer to a bufferevent buffer. The evbuffer is
+ being drained as a result.
+
+ @param bufev the bufferevent to be written to
+ @param buf the evbuffer to be written
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_write()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf);
+
+
+/**
+ Read data from a bufferevent buffer.
+
+ The bufferevent_read() function is used to read data from the input buffer.
+
+ @param bufev the bufferevent to be read from
+ @param data pointer to a buffer that will store the data
+ @param size the size of the data buffer, in bytes
+ @return the amount of data read, in bytes.
+ */
+EVENT2_EXPORT_SYMBOL
+size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size);
+
+/**
+ Read data from a bufferevent buffer into an evbuffer. This avoids
+ memory copies.
+
+ @param bufev the bufferevent to be read from
+ @param buf the evbuffer to which to add data
+ @return 0 if successful, or -1 if an error occurred.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf);
+
+/**
+ Returns the input buffer.
+
+ The user MUST NOT set the callback on this buffer.
+
+ @param bufev the bufferevent from which to get the evbuffer
+ @return the evbuffer object for the input buffer
+ */
+
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *bufferevent_get_input(struct bufferevent *bufev);
+
+/**
+ Returns the output buffer.
+
+ The user MUST NOT set the callback on this buffer.
+
+ When filters are being used, the filters need to be manually
+ triggered if the output buffer was manipulated.
+
+ @param bufev the bufferevent from which to get the evbuffer
+ @return the evbuffer object for the output buffer
+ */
+
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *bufferevent_get_output(struct bufferevent *bufev);
+
+/**
+ Enable a bufferevent.
+
+ @param bufev the bufferevent to be enabled
+ @param event any combination of EV_READ | EV_WRITE.
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_disable()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_enable(struct bufferevent *bufev, short event);
+
+/**
+ Disable a bufferevent.
+
+ @param bufev the bufferevent to be disabled
+ @param event any combination of EV_READ | EV_WRITE.
+ @return 0 if successful, or -1 if an error occurred
+ @see bufferevent_enable()
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_disable(struct bufferevent *bufev, short event);
+
+/**
+ Return the events that are enabled on a given bufferevent.
+
+ @param bufev the bufferevent to inspect
+ @return A combination of EV_READ | EV_WRITE
+ */
+EVENT2_EXPORT_SYMBOL
+short bufferevent_get_enabled(struct bufferevent *bufev);
+
+/**
+ Set the read and write timeout for a bufferevent.
+
+ A bufferevent's timeout will fire the first time that the indicated
+ amount of time has elapsed since a successful read or write operation,
+ during which the bufferevent was trying to read or write.
+
+ (In other words, if reading or writing is disabled, or if the
+ bufferevent's read or write operation has been suspended because
+ there's no data to write, or not enough banwidth, or so on, the
+ timeout isn't active. The timeout only becomes active when we we're
+ willing to actually read or write.)
+
+ Calling bufferevent_enable or setting a timeout for a bufferevent
+ whose timeout is already pending resets its timeout.
+
+ If the timeout elapses, the corresponding operation (EV_READ or
+ EV_WRITE) becomes disabled until you re-enable it again. The
+ bufferevent's event callback is called with the
+ BEV_EVENT_TIMEOUT|BEV_EVENT_READING or
+ BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING.
+
+ @param bufev the bufferevent to be modified
+ @param timeout_read the read timeout, or NULL
+ @param timeout_write the write timeout, or NULL
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_timeouts(struct bufferevent *bufev,
+ const struct timeval *timeout_read, const struct timeval *timeout_write);
+
+/**
+ Sets the watermarks for read and write events.
+
+ On input, a bufferevent does not invoke the user read callback unless
+ there is at least low watermark data in the buffer. If the read buffer
+ is beyond the high watermark, the bufferevent stops reading from the network.
+
+ On output, the user write callback is invoked whenever the buffered data
+ falls below the low watermark. Filters that write to this bufev will try
+ not to write more bytes to this buffer than the high watermark would allow,
+ except when flushing.
+
+ @param bufev the bufferevent to be modified
+ @param events EV_READ, EV_WRITE or both
+ @param lowmark the lower watermark to set
+ @param highmark the high watermark to set
+*/
+
+EVENT2_EXPORT_SYMBOL
+void bufferevent_setwatermark(struct bufferevent *bufev, short events,
+ size_t lowmark, size_t highmark);
+
+/**
+ Retrieves the watermarks for read or write events. Result is undefined if
+ events contains both EV_READ and EV_WRITE.
+
+ @param bufev the bufferevent to be examined
+ @param events EV_READ or EV_WRITE
+ @param lowmark receives the lower watermark if not NULL
+ @param highmark receives the high watermark if not NULL
+*/
+EVENT2_EXPORT_SYMBOL
+void bufferevent_getwatermark(struct bufferevent *bufev, short events,
+ size_t *lowmark, size_t *highmark);
+
+/**
+ Acquire the lock on a bufferevent. Has no effect if locking was not
+ enabled with BEV_OPT_THREADSAFE.
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_lock(struct bufferevent *bufev);
+
+/**
+ Release the lock on a bufferevent. Has no effect if locking was not
+ enabled with BEV_OPT_THREADSAFE.
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_unlock(struct bufferevent *bufev);
+
+/**
+ Flags that can be passed into filters to let them know how to
+ deal with the incoming data.
+*/
+enum bufferevent_flush_mode {
+ /** usually set when processing data */
+ BEV_NORMAL = 0,
+
+ /** want to checkpoint all data sent. */
+ BEV_FLUSH = 1,
+
+ /** encountered EOF on read or done sending data */
+ BEV_FINISHED = 2
+};
+
+/**
+ Triggers the bufferevent to produce more data if possible.
+
+ @param bufev the bufferevent object
+ @param iotype either EV_READ or EV_WRITE or both.
+ @param mode either BEV_NORMAL or BEV_FLUSH or BEV_FINISHED
+ @return -1 on failure, 0 if no data was produces, 1 if data was produced
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_flush(struct bufferevent *bufev,
+ short iotype,
+ enum bufferevent_flush_mode mode);
+
+/**
+ Flags for bufferevent_trigger(_event) that modify when and how to trigger
+ the callback.
+*/
+enum bufferevent_trigger_options {
+ /** trigger the callback regardless of the watermarks */
+ BEV_TRIG_IGNORE_WATERMARKS = (1<<16),
+
+ /** defer even if the callbacks are not */
+ BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS,
+
+ /* (Note: for internal reasons, these need to be disjoint from
+ * bufferevent_options, except when they mean the same thing. */
+};
+
+/**
+ Triggers bufferevent data callbacks.
+
+ The function will honor watermarks unless options contain
+ BEV_TRIG_IGNORE_WATERMARKS. If the options contain BEV_OPT_DEFER_CALLBACKS,
+ the callbacks are deferred.
+
+ @param bufev the bufferevent object
+ @param iotype either EV_READ or EV_WRITE or both.
+ @param options
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_trigger(struct bufferevent *bufev, short iotype,
+ int options);
+
+/**
+ Triggers the bufferevent event callback.
+
+ If the options contain BEV_OPT_DEFER_CALLBACKS, the callbacks are deferred.
+
+ @param bufev the bufferevent object
+ @param what the flags to pass onto the event callback
+ @param options
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_trigger_event(struct bufferevent *bufev, short what,
+ int options);
+
+/**
+ @name Filtering support
+
+ @{
+*/
+/**
+ Values that filters can return.
+ */
+enum bufferevent_filter_result {
+ /** everything is okay */
+ BEV_OK = 0,
+
+ /** the filter needs to read more data before output */
+ BEV_NEED_MORE = 1,
+
+ /** the filter encountered a critical error, no further data
+ can be processed. */
+ BEV_ERROR = 2
+};
+
+/** A callback function to implement a filter for a bufferevent.
+
+ @param src An evbuffer to drain data from.
+ @param dst An evbuffer to add data to.
+ @param limit A suggested upper bound of bytes to write to dst.
+ The filter may ignore this value, but doing so means that
+ it will overflow the high-water mark associated with dst.
+ -1 means "no limit".
+ @param mode Whether we should write data as may be convenient
+ (BEV_NORMAL), or flush as much data as we can (BEV_FLUSH),
+ or flush as much as we can, possibly including an end-of-stream
+ marker (BEV_FINISH).
+ @param ctx A user-supplied pointer.
+
+ @return BEV_OK if we wrote some data; BEV_NEED_MORE if we can't
+ produce any more output until we get some input; and BEV_ERROR
+ on an error.
+ */
+typedef enum bufferevent_filter_result (*bufferevent_filter_cb)(
+ struct evbuffer *src, struct evbuffer *dst, ev_ssize_t dst_limit,
+ enum bufferevent_flush_mode mode, void *ctx);
+
+/**
+ Allocate a new filtering bufferevent on top of an existing bufferevent.
+
+ @param underlying the underlying bufferevent.
+ @param input_filter The filter to apply to data we read from the underlying
+ bufferevent
+ @param output_filter The filer to apply to data we write to the underlying
+ bufferevent
+ @param options A bitfield of bufferevent options.
+ @param free_context A function to use to free the filter context when
+ this bufferevent is freed.
+ @param ctx A context pointer to pass to the filter functions.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *
+bufferevent_filter_new(struct bufferevent *underlying,
+ bufferevent_filter_cb input_filter,
+ bufferevent_filter_cb output_filter,
+ int options,
+ void (*free_context)(void *),
+ void *ctx);
+/**@}*/
+
+/**
+ Allocate a pair of linked bufferevents. The bufferevents behave as would
+ two bufferevent_sock instances connected to opposite ends of a
+ socketpair(), except that no internal socketpair is allocated.
+
+ @param base The event base to associate with the socketpair.
+ @param options A set of options for this bufferevent
+ @param pair A pointer to an array to hold the two new bufferevent objects.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_pair_new(struct event_base *base, int options,
+ struct bufferevent *pair[2]);
+
+/**
+ Given one bufferevent returned by bufferevent_pair_new(), returns the
+ other one if it still exists. Otherwise returns NULL.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *bufferevent_pair_get_partner(struct bufferevent *bev);
+
+/**
+ Abstract type used to configure rate-limiting on a bufferevent or a group
+ of bufferevents.
+ */
+struct ev_token_bucket_cfg;
+
+/**
+ A group of bufferevents which are configured to respect the same rate
+ limit.
+*/
+struct bufferevent_rate_limit_group;
+
+/** Maximum configurable rate- or burst-limit. */
+#define EV_RATE_LIMIT_MAX EV_SSIZE_MAX
+
+/**
+ Initialize and return a new object to configure the rate-limiting behavior
+ of bufferevents.
+
+ @param read_rate The maximum number of bytes to read per tick on
+ average.
+ @param read_burst The maximum number of bytes to read in any single tick.
+ @param write_rate The maximum number of bytes to write per tick on
+ average.
+ @param write_burst The maximum number of bytes to write in any single tick.
+ @param tick_len The length of a single tick. Defaults to one second.
+ Any fractions of a millisecond are ignored.
+
+ Note that all rate-limits hare are currently best-effort: future versions
+ of Libevent may implement them more tightly.
+ */
+EVENT2_EXPORT_SYMBOL
+struct ev_token_bucket_cfg *ev_token_bucket_cfg_new(
+ size_t read_rate, size_t read_burst,
+ size_t write_rate, size_t write_burst,
+ const struct timeval *tick_len);
+
+/** Free all storage held in 'cfg'.
+
+ Note: 'cfg' is not currently reference-counted; it is not safe to free it
+ until no bufferevent is using it.
+ */
+EVENT2_EXPORT_SYMBOL
+void ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg);
+
+/**
+ Set the rate-limit of a the bufferevent 'bev' to the one specified in
+ 'cfg'. If 'cfg' is NULL, disable any per-bufferevent rate-limiting on
+ 'bev'.
+
+ Note that only some bufferevent types currently respect rate-limiting.
+ They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
+ bufferevents.
+
+ Return 0 on sucess, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_rate_limit(struct bufferevent *bev,
+ struct ev_token_bucket_cfg *cfg);
+
+/**
+ Create a new rate-limit group for bufferevents. A rate-limit group
+ constrains the maximum number of bytes sent and received, in toto,
+ by all of its bufferevents.
+
+ @param base An event_base to run any necessary timeouts for the group.
+ Note that all bufferevents in the group do not necessarily need to share
+ this event_base.
+ @param cfg The rate-limit for this group.
+
+ Note that all rate-limits hare are currently best-effort: future versions
+ of Libevent may implement them more tightly.
+
+ Note also that only some bufferevent types currently respect rate-limiting.
+ They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
+ bufferevents.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent_rate_limit_group *bufferevent_rate_limit_group_new(
+ struct event_base *base,
+ const struct ev_token_bucket_cfg *cfg);
+/**
+ Change the rate-limiting settings for a given rate-limiting group.
+
+ Return 0 on success, -1 on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_set_cfg(
+ struct bufferevent_rate_limit_group *,
+ const struct ev_token_bucket_cfg *);
+
+/**
+ Change the smallest quantum we're willing to allocate to any single
+ bufferevent in a group for reading or writing at a time.
+
+ The rationale is that, because of TCP/IP protocol overheads and kernel
+ behavior, if a rate-limiting group is so tight on bandwidth that you're
+ only willing to send 1 byte per tick per bufferevent, you might instead
+ want to batch up the reads and writes so that you send N bytes per
+ 1/N of the bufferevents (chosen at random) each tick, so you still wind
+ up send 1 byte per tick per bufferevent on average, but you don't send
+ so many tiny packets.
+
+ The default min-share is currently 64 bytes.
+
+ Returns 0 on success, -1 on faulre.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_set_min_share(
+ struct bufferevent_rate_limit_group *, size_t);
+
+/**
+ Free a rate-limiting group. The group must have no members when
+ this function is called.
+*/
+EVENT2_EXPORT_SYMBOL
+void bufferevent_rate_limit_group_free(struct bufferevent_rate_limit_group *);
+
+/**
+ Add 'bev' to the list of bufferevents whose aggregate reading and writing
+ is restricted by 'g'. If 'g' is NULL, remove 'bev' from its current group.
+
+ A bufferevent may belong to no more than one rate-limit group at a time.
+ If 'bev' is already a member of a group, it will be removed from its old
+ group before being added to 'g'.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_add_to_rate_limit_group(struct bufferevent *bev,
+ struct bufferevent_rate_limit_group *g);
+
+/** Remove 'bev' from its current rate-limit group (if any). */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_remove_from_rate_limit_group(struct bufferevent *bev);
+
+/**
+ Set the size limit for single read operation.
+
+ Set to 0 for a reasonable default.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_max_single_read(struct bufferevent *bev, size_t size);
+
+/**
+ Set the size limit for single write operation.
+
+ Set to 0 for a reasonable default.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_max_single_write(struct bufferevent *bev, size_t size);
+
+/** Get the current size limit for single read operation. */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_single_read(struct bufferevent *bev);
+
+/** Get the current size limit for single write operation. */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_single_write(struct bufferevent *bev);
+
+/**
+ @name Rate limit inspection
+
+ Return the current read or write bucket size for a bufferevent.
+ If it is not configured with a per-bufferevent ratelimit, return
+ EV_SSIZE_MAX. This function does not inspect the group limit, if any.
+ Note that it can return a negative value if the bufferevent has been
+ made to read or write more than its limit.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_read_limit(struct bufferevent *bev);
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_write_limit(struct bufferevent *bev);
+/*@}*/
+
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_to_read(struct bufferevent *bev);
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_to_write(struct bufferevent *bev);
+
+EVENT2_EXPORT_SYMBOL
+const struct ev_token_bucket_cfg *bufferevent_get_token_bucket_cfg(const struct bufferevent * bev);
+
+/**
+ @name Group Rate limit inspection
+
+ Return the read or write bucket size for a bufferevent rate limit
+ group. Note that it can return a negative value if bufferevents in
+ the group have been made to read or write more than their limits.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_rate_limit_group_get_read_limit(
+ struct bufferevent_rate_limit_group *);
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_rate_limit_group_get_write_limit(
+ struct bufferevent_rate_limit_group *);
+/*@}*/
+
+/**
+ @name Rate limit manipulation
+
+ Subtract a number of bytes from a bufferevent's read or write bucket.
+ The decrement value can be negative, if you want to manually refill
+ the bucket. If the change puts the bucket above or below zero, the
+ bufferevent will resume or suspend reading writing as appropriate.
+ These functions make no change in the buckets for the bufferevent's
+ group, if any.
+
+ Returns 0 on success, -1 on internal error.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_decrement_read_limit(struct bufferevent *bev, ev_ssize_t decr);
+EVENT2_EXPORT_SYMBOL
+int bufferevent_decrement_write_limit(struct bufferevent *bev, ev_ssize_t decr);
+/*@}*/
+
+/**
+ @name Group rate limit manipulation
+
+ Subtract a number of bytes from a bufferevent rate-limiting group's
+ read or write bucket. The decrement value can be negative, if you
+ want to manually refill the bucket. If the change puts the bucket
+ above or below zero, the bufferevents in the group will resume or
+ suspend reading writing as appropriate.
+
+ Returns 0 on success, -1 on internal error.
+
+ @{
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_decrement_read(
+ struct bufferevent_rate_limit_group *, ev_ssize_t);
+EVENT2_EXPORT_SYMBOL
+int bufferevent_rate_limit_group_decrement_write(
+ struct bufferevent_rate_limit_group *, ev_ssize_t);
+/*@}*/
+
+
+/**
+ * Inspect the total bytes read/written on a group.
+ *
+ * Set the variable pointed to by total_read_out to the total number of bytes
+ * ever read on grp, and the variable pointed to by total_written_out to the
+ * total number of bytes ever written on grp. */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_rate_limit_group_get_totals(
+ struct bufferevent_rate_limit_group *grp,
+ ev_uint64_t *total_read_out, ev_uint64_t *total_written_out);
+
+/**
+ * Reset the total bytes read/written on a group.
+ *
+ * Reset the number of bytes read or written on grp as given by
+ * bufferevent_rate_limit_group_reset_totals(). */
+EVENT2_EXPORT_SYMBOL
+void
+bufferevent_rate_limit_group_reset_totals(
+ struct bufferevent_rate_limit_group *grp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFEREVENT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/bufferevent_compat.h b/sntp/libevent/include/event2/bufferevent_compat.h
new file mode 100644
index 0000000..6548204
--- /dev/null
+++ b/sntp/libevent/include/event2/bufferevent_compat.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos, Nick Mathewson
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_
+
+#define evbuffercb bufferevent_data_cb
+#define everrorcb bufferevent_event_cb
+
+/**
+ Create a new bufferevent for an fd.
+
+ This function is deprecated. Use bufferevent_socket_new and
+ bufferevent_set_callbacks instead.
+
+ Libevent provides an abstraction on top of the regular event callbacks.
+ This abstraction is called a buffered event. A buffered event provides
+ input and output buffers that get filled and drained automatically. The
+ user of a buffered event no longer deals directly with the I/O, but
+ instead is reading from input and writing to output buffers.
+
+ Once initialized, the bufferevent structure can be used repeatedly with
+ bufferevent_enable() and bufferevent_disable().
+
+ When read enabled the bufferevent will try to read from the file descriptor
+ and call the read callback. The write callback is executed whenever the
+ output buffer is drained below the write low watermark, which is 0 by
+ default.
+
+ If multiple bases are in use, bufferevent_base_set() must be called before
+ enabling the bufferevent for the first time.
+
+ @deprecated This function is deprecated because it uses the current
+ event base, and as such can be error prone for multithreaded programs.
+ Use bufferevent_socket_new() instead.
+
+ @param fd the file descriptor from which data is read and written to.
+ This file descriptor is not allowed to be a pipe(2).
+ @param readcb callback to invoke when there is data to be read, or NULL if
+ no callback is desired
+ @param writecb callback to invoke when the file descriptor is ready for
+ writing, or NULL if no callback is desired
+ @param errorcb callback to invoke when there is an error on the file
+ descriptor
+ @param cbarg an argument that will be supplied to each of the callbacks
+ (readcb, writecb, and errorcb)
+ @return a pointer to a newly allocated bufferevent struct, or NULL if an
+ error occurred
+ @see bufferevent_base_set(), bufferevent_free()
+ */
+struct bufferevent *bufferevent_new(evutil_socket_t fd,
+ evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg);
+
+
+/**
+ Set the read and write timeout for a buffered event.
+
+ @param bufev the bufferevent to be modified
+ @param timeout_read the read timeout
+ @param timeout_write the write timeout
+ */
+void bufferevent_settimeout(struct bufferevent *bufev,
+ int timeout_read, int timeout_write);
+
+#define EVBUFFER_READ BEV_EVENT_READING
+#define EVBUFFER_WRITE BEV_EVENT_WRITING
+#define EVBUFFER_EOF BEV_EVENT_EOF
+#define EVBUFFER_ERROR BEV_EVENT_ERROR
+#define EVBUFFER_TIMEOUT BEV_EVENT_TIMEOUT
+
+/** macro for getting access to the input buffer of a bufferevent */
+#define EVBUFFER_INPUT(x) bufferevent_get_input(x)
+/** macro for getting access to the output buffer of a bufferevent */
+#define EVBUFFER_OUTPUT(x) bufferevent_get_output(x)
+
+#endif
diff --git a/sntp/libevent/include/event2/bufferevent_ssl.h b/sntp/libevent/include/event2/bufferevent_ssl.h
new file mode 100644
index 0000000..bf39b84
--- /dev/null
+++ b/sntp/libevent/include/event2/bufferevent_ssl.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_BUFFEREVENT_SSL_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_SSL_H_INCLUDED_
+
+/** @file event2/bufferevent_ssl.h
+
+ OpenSSL support for bufferevents.
+ */
+#include <event2/visibility.h>
+#include <event2/event-config.h>
+#include <event2/bufferevent.h>
+#include <event2/util.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This is what openssl's SSL objects are underneath. */
+struct ssl_st;
+
+/**
+ The state of an SSL object to be used when creating a new
+ SSL bufferevent.
+ */
+enum bufferevent_ssl_state {
+ BUFFEREVENT_SSL_OPEN = 0,
+ BUFFEREVENT_SSL_CONNECTING = 1,
+ BUFFEREVENT_SSL_ACCEPTING = 2
+};
+
+#if defined(EVENT__HAVE_OPENSSL) || defined(EVENT_IN_DOXYGEN_)
+/**
+ Create a new SSL bufferevent to send its data over another bufferevent.
+
+ @param base An event_base to use to detect reading and writing. It
+ must also be the base for the underlying bufferevent.
+ @param underlying A socket to use for this SSL
+ @param ssl A SSL* object from openssl.
+ @param state The current state of the SSL connection
+ @param options One or more bufferevent_options
+ @return A new bufferevent on success, or NULL on failure
+*/
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *
+bufferevent_openssl_filter_new(struct event_base *base,
+ struct bufferevent *underlying,
+ struct ssl_st *ssl,
+ enum bufferevent_ssl_state state,
+ int options);
+
+/**
+ Create a new SSL bufferevent to send its data over an SSL * on a socket.
+
+ @param base An event_base to use to detect reading and writing
+ @param fd A socket to use for this SSL
+ @param ssl A SSL* object from openssl.
+ @param state The current state of the SSL connection
+ @param options One or more bufferevent_options
+ @return A new bufferevent on success, or NULL on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+struct bufferevent *
+bufferevent_openssl_socket_new(struct event_base *base,
+ evutil_socket_t fd,
+ struct ssl_st *ssl,
+ enum bufferevent_ssl_state state,
+ int options);
+
+/** Control how to report dirty SSL shutdowns.
+
+ If the peer (or the network, or an attacker) closes the TCP
+ connection before closing the SSL channel, and the protocol is SSL >= v3,
+ this is a "dirty" shutdown. If allow_dirty_shutdown is 0 (default),
+ this is reported as BEV_EVENT_ERROR.
+
+ If instead allow_dirty_shutdown=1, a dirty shutdown is reported as
+ BEV_EVENT_EOF.
+
+ (Note that if the protocol is < SSLv3, you will always receive
+ BEV_EVENT_EOF, since SSL 2 and earlier cannot distinguish a secure
+ connection close from a dirty one. This is one reason (among many)
+ not to use SSL 2.)
+*/
+
+EVENT2_EXPORT_SYMBOL
+int bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev);
+EVENT2_EXPORT_SYMBOL
+void bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev,
+ int allow_dirty_shutdown);
+
+/** Return the underlying openssl SSL * object for an SSL bufferevent. */
+EVENT2_EXPORT_SYMBOL
+struct ssl_st *
+bufferevent_openssl_get_ssl(struct bufferevent *bufev);
+
+/** Tells a bufferevent to begin SSL renegotiation. */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_ssl_renegotiate(struct bufferevent *bev);
+
+/** Return the most recent OpenSSL error reported on an SSL bufferevent. */
+EVENT2_EXPORT_SYMBOL
+unsigned long bufferevent_get_openssl_error(struct bufferevent *bev);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFEREVENT_SSL_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/bufferevent_struct.h b/sntp/libevent/include/event2/bufferevent_struct.h
new file mode 100644
index 0000000..e84c082
--- /dev/null
+++ b/sntp/libevent/include/event2/bufferevent_struct.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_
+
+/** @file event2/bufferevent_struct.h
+
+ Data structures for bufferevents. Using these structures may hurt forward
+ compatibility with later versions of Libevent: be careful!
+
+ @deprecated Use of bufferevent_struct.h is completely deprecated; these
+ structures are only exposed for backward compatibility with programs
+ written before Libevent 2.0 that used them.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+/* For struct event */
+#include <event2/event_struct.h>
+
+struct event_watermark {
+ size_t low;
+ size_t high;
+};
+
+/**
+ Shared implementation of a bufferevent.
+
+ This type is exposed only because it was exposed in previous versions,
+ and some people's code may rely on manipulating it. Otherwise, you
+ should really not rely on the layout, size, or contents of this structure:
+ it is fairly volatile, and WILL change in future versions of the code.
+**/
+struct bufferevent {
+ /** Event base for which this bufferevent was created. */
+ struct event_base *ev_base;
+ /** Pointer to a table of function pointers to set up how this
+ bufferevent behaves. */
+ const struct bufferevent_ops *be_ops;
+
+ /** A read event that triggers when a timeout has happened or a socket
+ is ready to read data. Only used by some subtypes of
+ bufferevent. */
+ struct event ev_read;
+ /** A write event that triggers when a timeout has happened or a socket
+ is ready to write data. Only used by some subtypes of
+ bufferevent. */
+ struct event ev_write;
+
+ /** An input buffer. Only the bufferevent is allowed to add data to
+ this buffer, though the user is allowed to drain it. */
+ struct evbuffer *input;
+
+ /** An input buffer. Only the bufferevent is allowed to drain data
+ from this buffer, though the user is allowed to add it. */
+ struct evbuffer *output;
+
+ struct event_watermark wm_read;
+ struct event_watermark wm_write;
+
+ bufferevent_data_cb readcb;
+ bufferevent_data_cb writecb;
+ /* This should be called 'eventcb', but renaming it would break
+ * backward compatibility */
+ bufferevent_event_cb errorcb;
+ void *cbarg;
+
+ struct timeval timeout_read;
+ struct timeval timeout_write;
+
+ /** Events that are currently enabled: currently EV_READ and EV_WRITE
+ are supported. */
+ short enabled;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/dns.h b/sntp/libevent/include/event2/dns.h
new file mode 100644
index 0000000..a00c83e
--- /dev/null
+++ b/sntp/libevent/include/event2/dns.h
@@ -0,0 +1,701 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * The original DNS code is due to Adam Langley with heavy
+ * modifications by Nick Mathewson. Adam put his DNS software in the
+ * public domain. You can find his original copyright below. Please,
+ * aware that the code as part of Libevent is governed by the 3-clause
+ * BSD license above.
+ *
+ * This software is Public Domain. To view a copy of the public domain dedication,
+ * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
+ * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+ *
+ * I ask and expect, but do not require, that all derivative works contain an
+ * attribution similar to:
+ * Parts developed by Adam Langley <agl@imperialviolet.org>
+ *
+ * You may wish to replace the word "Parts" with something else depending on
+ * the amount of original code.
+ *
+ * (Derivative works does not include programs which link against, run or include
+ * the source verbatim in their source distributions)
+ */
+
+/** @file event2/dns.h
+ *
+ * Welcome, gentle reader
+ *
+ * Async DNS lookups are really a whole lot harder than they should be,
+ * mostly stemming from the fact that the libc resolver has never been
+ * very good at them. Before you use this library you should see if libc
+ * can do the job for you with the modern async call getaddrinfo_a
+ * (see http://www.imperialviolet.org/page25.html#e498). Otherwise,
+ * please continue.
+ *
+ * The library keeps track of the state of nameservers and will avoid
+ * them when they go down. Otherwise it will round robin between them.
+ *
+ * Quick start guide:
+ * #include "evdns.h"
+ * void callback(int result, char type, int count, int ttl,
+ * void *addresses, void *arg);
+ * evdns_resolv_conf_parse(DNS_OPTIONS_ALL, "/etc/resolv.conf");
+ * evdns_resolve("www.hostname.com", 0, callback, NULL);
+ *
+ * When the lookup is complete the callback function is called. The
+ * first argument will be one of the DNS_ERR_* defines in evdns.h.
+ * Hopefully it will be DNS_ERR_NONE, in which case type will be
+ * DNS_IPv4_A, count will be the number of IP addresses, ttl is the time
+ * which the data can be cached for (in seconds), addresses will point
+ * to an array of uint32_t's and arg will be whatever you passed to
+ * evdns_resolve.
+ *
+ * Searching:
+ *
+ * In order for this library to be a good replacement for glibc's resolver it
+ * supports searching. This involves setting a list of default domains, in
+ * which names will be queried for. The number of dots in the query name
+ * determines the order in which this list is used.
+ *
+ * Searching appears to be a single lookup from the point of view of the API,
+ * although many DNS queries may be generated from a single call to
+ * evdns_resolve. Searching can also drastically slow down the resolution
+ * of names.
+ *
+ * To disable searching:
+ * 1. Never set it up. If you never call evdns_resolv_conf_parse or
+ * evdns_search_add then no searching will occur.
+ *
+ * 2. If you do call evdns_resolv_conf_parse then don't pass
+ * DNS_OPTION_SEARCH (or DNS_OPTIONS_ALL, which implies it).
+ *
+ * 3. When calling evdns_resolve, pass the DNS_QUERY_NO_SEARCH flag.
+ *
+ * The order of searches depends on the number of dots in the name. If the
+ * number is greater than the ndots setting then the names is first tried
+ * globally. Otherwise each search domain is appended in turn.
+ *
+ * The ndots setting can either be set from a resolv.conf, or by calling
+ * evdns_search_ndots_set.
+ *
+ * For example, with ndots set to 1 (the default) and a search domain list of
+ * ["myhome.net"]:
+ * Query: www
+ * Order: www.myhome.net, www.
+ *
+ * Query: www.abc
+ * Order: www.abc., www.abc.myhome.net
+ *
+ * Internals:
+ *
+ * Requests are kept in two queues. The first is the inflight queue. In
+ * this queue requests have an allocated transaction id and nameserver.
+ * They will soon be transmitted if they haven't already been.
+ *
+ * The second is the waiting queue. The size of the inflight ring is
+ * limited and all other requests wait in waiting queue for space. This
+ * bounds the number of concurrent requests so that we don't flood the
+ * nameserver. Several algorithms require a full walk of the inflight
+ * queue and so bounding its size keeps thing going nicely under huge
+ * (many thousands of requests) loads.
+ *
+ * If a nameserver loses too many requests it is considered down and we
+ * try not to use it. After a while we send a probe to that nameserver
+ * (a lookup for google.com) and, if it replies, we consider it working
+ * again. If the nameserver fails a probe we wait longer to try again
+ * with the next probe.
+ */
+
+#ifndef EVENT2_DNS_H_INCLUDED_
+#define EVENT2_DNS_H_INCLUDED_
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For integer types. */
+#include <event2/util.h>
+
+/** Error codes 0-5 are as described in RFC 1035. */
+#define DNS_ERR_NONE 0
+/** The name server was unable to interpret the query */
+#define DNS_ERR_FORMAT 1
+/** The name server was unable to process this query due to a problem with the
+ * name server */
+#define DNS_ERR_SERVERFAILED 2
+/** The domain name does not exist */
+#define DNS_ERR_NOTEXIST 3
+/** The name server does not support the requested kind of query */
+#define DNS_ERR_NOTIMPL 4
+/** The name server refuses to reform the specified operation for policy
+ * reasons */
+#define DNS_ERR_REFUSED 5
+/** The reply was truncated or ill-formatted */
+#define DNS_ERR_TRUNCATED 65
+/** An unknown error occurred */
+#define DNS_ERR_UNKNOWN 66
+/** Communication with the server timed out */
+#define DNS_ERR_TIMEOUT 67
+/** The request was canceled because the DNS subsystem was shut down. */
+#define DNS_ERR_SHUTDOWN 68
+/** The request was canceled via a call to evdns_cancel_request */
+#define DNS_ERR_CANCEL 69
+/** There were no answers and no error condition in the DNS packet.
+ * This can happen when you ask for an address that exists, but a record
+ * type that doesn't. */
+#define DNS_ERR_NODATA 70
+
+#define DNS_IPv4_A 1
+#define DNS_PTR 2
+#define DNS_IPv6_AAAA 3
+
+#define DNS_QUERY_NO_SEARCH 1
+
+#define DNS_OPTION_SEARCH 1
+#define DNS_OPTION_NAMESERVERS 2
+#define DNS_OPTION_MISC 4
+#define DNS_OPTION_HOSTSFILE 8
+#define DNS_OPTIONS_ALL 15
+
+/* Obsolete name for DNS_QUERY_NO_SEARCH */
+#define DNS_NO_SEARCH DNS_QUERY_NO_SEARCH
+
+/**
+ * The callback that contains the results from a lookup.
+ * - result is one of the DNS_ERR_* values (DNS_ERR_NONE for success)
+ * - type is either DNS_IPv4_A or DNS_PTR or DNS_IPv6_AAAA
+ * - count contains the number of addresses of form type
+ * - ttl is the number of seconds the resolution may be cached for.
+ * - addresses needs to be cast according to type. It will be an array of
+ * 4-byte sequences for ipv4, or an array of 16-byte sequences for ipv6,
+ * or a nul-terminated string for PTR.
+ */
+typedef void (*evdns_callback_type) (int result, char type, int count, int ttl, void *addresses, void *arg);
+
+struct evdns_base;
+struct event_base;
+
+/** Flag for evdns_base_new: process resolv.conf. */
+#define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
+/** Flag for evdns_base_new: Do not prevent the libevent event loop from
+ * exiting when we have no active dns requests. */
+#define EVDNS_BASE_DISABLE_WHEN_INACTIVE 0x8000
+
+/**
+ Initialize the asynchronous DNS library.
+
+ This function initializes support for non-blocking name resolution by
+ calling evdns_resolv_conf_parse() on UNIX and
+ evdns_config_windows_nameservers() on Windows.
+
+ @param event_base the event base to associate the dns client with
+ @param flags any of EVDNS_BASE_INITIALIZE_NAMESERVERS|
+ EVDNS_BASE_DISABLE_WHEN_INACTIVE
+ @return evdns_base object if successful, or NULL if an error occurred.
+ @see evdns_base_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_base * evdns_base_new(struct event_base *event_base, int initialize_nameservers);
+
+
+/**
+ Shut down the asynchronous DNS resolver and terminate all active requests.
+
+ If the 'fail_requests' option is enabled, all active requests will return
+ an empty result with the error flag set to DNS_ERR_SHUTDOWN. Otherwise,
+ the requests will be silently discarded.
+
+ @param evdns_base the evdns base to free
+ @param fail_requests if zero, active requests will be aborted; if non-zero,
+ active requests will return DNS_ERR_SHUTDOWN.
+ @see evdns_base_new()
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_free(struct evdns_base *base, int fail_requests);
+
+/**
+ Remove all hosts entries that have been loaded into the event_base via
+ evdns_base_load_hosts or via event_base_resolv_conf_parse.
+
+ @param evdns_base the evdns base to remove outdated host addresses from
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_clear_host_addresses(struct evdns_base *base);
+
+/**
+ Convert a DNS error code to a string.
+
+ @param err the DNS error code
+ @return a string containing an explanation of the error code
+*/
+EVENT2_EXPORT_SYMBOL
+const char *evdns_err_to_string(int err);
+
+
+/**
+ Add a nameserver.
+
+ The address should be an IPv4 address in network byte order.
+ The type of address is chosen so that it matches in_addr.s_addr.
+
+ @param base the evdns_base to which to add the name server
+ @param address an IP address in network byte order
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_nameserver_ip_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_nameserver_add(struct evdns_base *base,
+ unsigned long int address);
+
+/**
+ Get the number of configured nameservers.
+
+ This returns the number of configured nameservers (not necessarily the
+ number of running nameservers). This is useful for double-checking
+ whether our calls to the various nameserver configuration functions
+ have been successful.
+
+ @param base the evdns_base to which to apply this operation
+ @return the number of configured nameservers
+ @see evdns_base_nameserver_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_count_nameservers(struct evdns_base *base);
+
+/**
+ Remove all configured nameservers, and suspend all pending resolves.
+
+ Resolves will not necessarily be re-attempted until evdns_base_resume() is called.
+
+ @param base the evdns_base to which to apply this operation
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_resume()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
+
+
+/**
+ Resume normal operation and continue any suspended resolve requests.
+
+ Re-attempt resolves left in limbo after an earlier call to
+ evdns_base_clear_nameservers_and_suspend().
+
+ @param base the evdns_base to which to apply this operation
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_clear_nameservers_and_suspend()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_resume(struct evdns_base *base);
+
+/**
+ Add a nameserver by string address.
+
+ This function parses a n IPv4 or IPv6 address from a string and adds it as a
+ nameserver. It supports the following formats:
+ - [IPv6Address]:port
+ - [IPv6Address]
+ - IPv6Address
+ - IPv4Address:port
+ - IPv4Address
+
+ If no port is specified, it defaults to 53.
+
+ @param base the evdns_base to which to apply this operation
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_base_nameserver_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_nameserver_ip_add(struct evdns_base *base,
+ const char *ip_as_string);
+
+/**
+ Add a nameserver by sockaddr.
+ **/
+EVENT2_EXPORT_SYMBOL
+int
+evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
+ const struct sockaddr *sa, ev_socklen_t len, unsigned flags);
+
+struct evdns_request;
+
+/**
+ Lookup an A record for a given name.
+
+ @param base the evdns_base to which to apply this operation
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Lookup an AAAA record for a given name.
+
+ @param base the evdns_base to which to apply this operation
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_ipv6(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+struct in_addr;
+struct in6_addr;
+
+/**
+ Lookup a PTR record for a given IP address.
+
+ @param base the evdns_base to which to apply this operation
+ @param in an IPv4 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+
+/**
+ Lookup a PTR record for a given IPv6 address.
+
+ @param base the evdns_base to which to apply this operation
+ @param in an IPv6 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return an evdns_request object if successful, or NULL if an error occurred.
+ @see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_request *evdns_base_resolve_reverse_ipv6(struct evdns_base *base, const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Cancels a pending DNS resolution request.
+
+ @param base the evdns_base that was used to make the request
+ @param req the evdns_request that was returned by calling a resolve function
+ @see evdns_base_resolve_ipv4(), evdns_base_resolve_ipv6, evdns_base_resolve_reverse
+*/
+EVENT2_EXPORT_SYMBOL
+void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
+
+/**
+ Set the value of a configuration option.
+
+ The currently available configuration options are:
+
+ ndots, timeout, max-timeouts, max-inflight, attempts, randomize-case,
+ bind-to, initial-probe-timeout, getaddrinfo-allow-skew.
+
+ In versions before Libevent 2.0.3-alpha, the option name needed to end with
+ a colon.
+
+ @param base the evdns_base to which to apply this operation
+ @param option the name of the configuration option to be modified
+ @param val the value to be set
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_set_option(struct evdns_base *base, const char *option, const char *val);
+
+
+/**
+ Parse a resolv.conf file.
+
+ The 'flags' parameter determines what information is parsed from the
+ resolv.conf file. See the man page for resolv.conf for the format of this
+ file.
+
+ The following directives are not parsed from the file: sortlist, rotate,
+ no-check-names, inet6, debug.
+
+ If this function encounters an error, the possible return values are: 1 =
+ failed to open file, 2 = failed to stat file, 3 = file too large, 4 = out of
+ memory, 5 = short read from file, 6 = no nameservers listed in the file
+
+ @param base the evdns_base to which to apply this operation
+ @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC|
+ DNS_OPTIONS_HOSTSFILE|DNS_OPTIONS_ALL
+ @param filename the path to the resolv.conf file
+ @return 0 if successful, or various positive error codes if an error
+ occurred (see above)
+ @see resolv.conf(3), evdns_config_windows_nameservers()
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename);
+
+/**
+ Load an /etc/hosts-style file from 'hosts_fname' into 'base'.
+
+ If hosts_fname is NULL, add minimal entries for localhost, and nothing
+ else.
+
+ Note that only evdns_getaddrinfo uses the /etc/hosts entries.
+
+ This function does not replace previously loaded hosts entries; to do that,
+ call evdns_base_clear_host_addresses first.
+
+ Return 0 on success, negative on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname);
+
+/**
+ Obtain nameserver information using the Windows API.
+
+ Attempt to configure a set of nameservers based on platform settings on
+ a win32 host. Preferentially tries to use GetNetworkParams; if that fails,
+ looks in the registry.
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolv_conf_parse()
+ */
+#ifdef _WIN32
+EVENT2_EXPORT_SYMBOL
+int evdns_base_config_windows_nameservers(struct evdns_base *);
+#define EVDNS_BASE_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
+#endif
+
+
+/**
+ Clear the list of search domains.
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_search_clear(struct evdns_base *base);
+
+
+/**
+ Add a domain to the list of search domains
+
+ @param domain the domain to be added to the search list
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_search_add(struct evdns_base *base, const char *domain);
+
+
+/**
+ Set the 'ndots' parameter for searches.
+
+ Sets the number of dots which, when found in a name, causes
+ the first query to be without any search domain.
+
+ @param ndots the new ndots parameter
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_search_ndots_set(struct evdns_base *base, const int ndots);
+
+/**
+ A callback that is invoked when a log message is generated
+
+ @param is_warning indicates if the log message is a 'warning'
+ @param msg the content of the log message
+ */
+typedef void (*evdns_debug_log_fn_type)(int is_warning, const char *msg);
+
+
+/**
+ Set the callback function to handle DNS log messages. If this
+ callback is not set, evdns log messages are handled with the regular
+ Libevent logging system.
+
+ @param fn the callback to be invoked when a log message is generated
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_set_log_fn(evdns_debug_log_fn_type fn);
+
+/**
+ Set a callback that will be invoked to generate transaction IDs. By
+ default, we pick transaction IDs based on the current clock time, which
+ is bad for security.
+
+ @param fn the new callback, or NULL to use the default.
+
+ NOTE: This function has no effect in Libevent 2.0.4-alpha and later,
+ since Libevent now provides its own secure RNG.
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void));
+
+/**
+ Set a callback used to generate random bytes. By default, we use
+ the same function as passed to evdns_set_transaction_id_fn to generate
+ bytes two at a time. If a function is provided here, it's also used
+ to generate transaction IDs.
+
+ NOTE: This function has no effect in Libevent 2.0.4-alpha and later,
+ since Libevent now provides its own secure RNG.
+*/
+EVENT2_EXPORT_SYMBOL
+void evdns_set_random_bytes_fn(void (*fn)(char *, size_t));
+
+/*
+ * Functions used to implement a DNS server.
+ */
+
+struct evdns_server_request;
+struct evdns_server_question;
+
+/**
+ A callback to implement a DNS server. The callback function receives a DNS
+ request. It should then optionally add a number of answers to the reply
+ using the evdns_server_request_add_*_reply functions, before calling either
+ evdns_server_request_respond to send the reply back, or
+ evdns_server_request_drop to decline to answer the request.
+
+ @param req A newly received request
+ @param user_data A pointer that was passed to
+ evdns_add_server_port_with_base().
+ */
+typedef void (*evdns_request_callback_fn_type)(struct evdns_server_request *, void *);
+#define EVDNS_ANSWER_SECTION 0
+#define EVDNS_AUTHORITY_SECTION 1
+#define EVDNS_ADDITIONAL_SECTION 2
+
+#define EVDNS_TYPE_A 1
+#define EVDNS_TYPE_NS 2
+#define EVDNS_TYPE_CNAME 5
+#define EVDNS_TYPE_SOA 6
+#define EVDNS_TYPE_PTR 12
+#define EVDNS_TYPE_MX 15
+#define EVDNS_TYPE_TXT 16
+#define EVDNS_TYPE_AAAA 28
+
+#define EVDNS_QTYPE_AXFR 252
+#define EVDNS_QTYPE_ALL 255
+
+#define EVDNS_CLASS_INET 1
+
+/* flags that can be set in answers; as part of the err parameter */
+#define EVDNS_FLAGS_AA 0x400
+#define EVDNS_FLAGS_RD 0x080
+
+/** Create a new DNS server port.
+
+ @param base The event base to handle events for the server port.
+ @param socket A UDP socket to accept DNS requests.
+ @param flags Always 0 for now.
+ @param callback A function to invoke whenever we get a DNS request
+ on the socket.
+ @param user_data Data to pass to the callback.
+ @return an evdns_server_port structure for this server port.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_server_port *evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data);
+/** Close down a DNS server port, and free associated structures. */
+EVENT2_EXPORT_SYMBOL
+void evdns_close_server_port(struct evdns_server_port *port);
+
+/** Sets some flags in a reply we're building.
+ Allows setting of the AA or RD flags
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_server_request_set_flags(struct evdns_server_request *req, int flags);
+
+/* Functions to add an answer to an in-progress DNS reply.
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_reply(struct evdns_server_request *req, int section, const char *name, int type, int dns_class, int ttl, int datalen, int is_name, const char *data);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_a_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_aaaa_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_ptr_reply(struct evdns_server_request *req, struct in_addr *in, const char *inaddr_name, const char *hostname, int ttl);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_add_cname_reply(struct evdns_server_request *req, const char *name, const char *cname, int ttl);
+
+/**
+ Send back a response to a DNS request, and free the request structure.
+*/
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_respond(struct evdns_server_request *req, int err);
+/**
+ Free a DNS request without sending back a reply.
+*/
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_drop(struct evdns_server_request *req);
+struct sockaddr;
+/**
+ Get the address that made a DNS request.
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len);
+
+/** Callback for evdns_getaddrinfo. */
+typedef void (*evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg);
+
+struct evdns_base;
+struct evdns_getaddrinfo_request;
+/** Make a non-blocking getaddrinfo request using the dns_base in 'dns_base'.
+ *
+ * If we can answer the request immediately (with an error or not!), then we
+ * invoke cb immediately and return NULL. Otherwise we return
+ * an evdns_getaddrinfo_request and invoke cb later.
+ *
+ * When the callback is invoked, we pass as its first argument the error code
+ * that getaddrinfo would return (or 0 for no error). As its second argument,
+ * we pass the evutil_addrinfo structures we found (or NULL on error). We
+ * pass 'arg' as the third argument.
+ *
+ * Limitations:
+ *
+ * - The AI_V4MAPPED and AI_ALL flags are not currently implemented.
+ * - For ai_socktype, we only handle SOCKTYPE_STREAM, SOCKTYPE_UDP, and 0.
+ * - For ai_protocol, we only handle IPPROTO_TCP, IPPROTO_UDP, and 0.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evdns_getaddrinfo_request *evdns_getaddrinfo(
+ struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ evdns_getaddrinfo_cb cb, void *arg);
+
+/* Cancel an in-progress evdns_getaddrinfo. This MUST NOT be called after the
+ * getaddrinfo's callback has been invoked. The resolves will be canceled,
+ * and the callback will be invoked with the error EVUTIL_EAI_CANCEL. */
+EVENT2_EXPORT_SYMBOL
+void evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *req);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !EVENT2_DNS_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/dns_compat.h b/sntp/libevent/include/event2/dns_compat.h
new file mode 100644
index 0000000..965fd65
--- /dev/null
+++ b/sntp/libevent/include/event2/dns_compat.h
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_DNS_COMPAT_H_INCLUDED_
+#define EVENT2_DNS_COMPAT_H_INCLUDED_
+
+/** @file event2/dns_compat.h
+
+ Potentially non-threadsafe versions of the functions in dns.h: provided
+ only for backwards compatibility.
+
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ Initialize the asynchronous DNS library.
+
+ This function initializes support for non-blocking name resolution by
+ calling evdns_resolv_conf_parse() on UNIX and
+ evdns_config_windows_nameservers() on Windows.
+
+ @deprecated This function is deprecated because it always uses the current
+ event base, and is easily confused by multiple calls to event_init(), and
+ so is not safe for multithreaded use. Additionally, it allocates a global
+ structure that only one thread can use. The replacement is
+ evdns_base_new().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_shutdown()
+ */
+int evdns_init(void);
+
+struct evdns_base;
+/**
+ Return the global evdns_base created by event_init() and used by the other
+ deprecated functions.
+
+ @deprecated This function is deprecated because use of the global
+ evdns_base is error-prone.
+ */
+struct evdns_base *evdns_get_global_base(void);
+
+/**
+ Shut down the asynchronous DNS resolver and terminate all active requests.
+
+ If the 'fail_requests' option is enabled, all active requests will return
+ an empty result with the error flag set to DNS_ERR_SHUTDOWN. Otherwise,
+ the requests will be silently discarded.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_shutdown().
+
+ @param fail_requests if zero, active requests will be aborted; if non-zero,
+ active requests will return DNS_ERR_SHUTDOWN.
+ @see evdns_init()
+ */
+void evdns_shutdown(int fail_requests);
+
+/**
+ Add a nameserver.
+
+ The address should be an IPv4 address in network byte order.
+ The type of address is chosen so that it matches in_addr.s_addr.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_nameserver_add().
+
+ @param address an IP address in network byte order
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_nameserver_ip_add()
+ */
+int evdns_nameserver_add(unsigned long int address);
+
+/**
+ Get the number of configured nameservers.
+
+ This returns the number of configured nameservers (not necessarily the
+ number of running nameservers). This is useful for double-checking
+ whether our calls to the various nameserver configuration functions
+ have been successful.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_count_nameservers().
+
+ @return the number of configured nameservers
+ @see evdns_nameserver_add()
+ */
+int evdns_count_nameservers(void);
+
+/**
+ Remove all configured nameservers, and suspend all pending resolves.
+
+ Resolves will not necessarily be re-attempted until evdns_resume() is called.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_clear_nameservers_and_suspend().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resume()
+ */
+int evdns_clear_nameservers_and_suspend(void);
+
+/**
+ Resume normal operation and continue any suspended resolve requests.
+
+ Re-attempt resolves left in limbo after an earlier call to
+ evdns_clear_nameservers_and_suspend().
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resume().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_clear_nameservers_and_suspend()
+ */
+int evdns_resume(void);
+
+/**
+ Add a nameserver.
+
+ This wraps the evdns_nameserver_add() function by parsing a string as an IP
+ address and adds it as a nameserver.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_nameserver_ip_add().
+
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_nameserver_add()
+ */
+int evdns_nameserver_ip_add(const char *ip_as_string);
+
+/**
+ Lookup an A record for a given name.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolve_ipv4().
+
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_ipv4(const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Lookup an AAAA record for a given name.
+
+ @param name a DNS hostname
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_ipv6(const char *name, int flags, evdns_callback_type callback, void *ptr);
+
+struct in_addr;
+struct in6_addr;
+
+/**
+ Lookup a PTR record for a given IP address.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolve_reverse().
+
+ @param in an IPv4 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Lookup a PTR record for a given IPv6 address.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolve_reverse_ipv6().
+
+ @param in an IPv6 address
+ @param flags either 0, or DNS_QUERY_NO_SEARCH to disable searching for this query.
+ @param callback a callback function to invoke when the request is completed
+ @param ptr an argument to pass to the callback function
+ @return 0 if successful, or -1 if an error occurred
+ @see evdns_resolve_reverse_ipv6()
+ */
+int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
+
+/**
+ Set the value of a configuration option.
+
+ The currently available configuration options are:
+
+ ndots, timeout, max-timeouts, max-inflight, and attempts
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_set_option().
+
+ @param option the name of the configuration option to be modified
+ @param val the value to be set
+ @param flags Ignored.
+ @return 0 if successful, or -1 if an error occurred
+ */
+int evdns_set_option(const char *option, const char *val, int flags);
+
+/**
+ Parse a resolv.conf file.
+
+ The 'flags' parameter determines what information is parsed from the
+ resolv.conf file. See the man page for resolv.conf for the format of this
+ file.
+
+ The following directives are not parsed from the file: sortlist, rotate,
+ no-check-names, inet6, debug.
+
+ If this function encounters an error, the possible return values are: 1 =
+ failed to open file, 2 = failed to stat file, 3 = file too large, 4 = out of
+ memory, 5 = short read from file, 6 = no nameservers listed in the file
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_resolv_conf_parse().
+
+ @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC|
+ DNS_OPTIONS_ALL
+ @param filename the path to the resolv.conf file
+ @return 0 if successful, or various positive error codes if an error
+ occurred (see above)
+ @see resolv.conf(3), evdns_config_windows_nameservers()
+ */
+int evdns_resolv_conf_parse(int flags, const char *const filename);
+
+/**
+ Clear the list of search domains.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_search_clear().
+ */
+void evdns_search_clear(void);
+
+/**
+ Add a domain to the list of search domains
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_search_add().
+
+ @param domain the domain to be added to the search list
+ */
+void evdns_search_add(const char *domain);
+
+/**
+ Set the 'ndots' parameter for searches.
+
+ Sets the number of dots which, when found in a name, causes
+ the first query to be without any search domain.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which evdns_base it applies to. The recommended
+ function is evdns_base_search_ndots_set().
+
+ @param ndots the new ndots parameter
+ */
+void evdns_search_ndots_set(const int ndots);
+
+/**
+ As evdns_server_new_with_base.
+
+ @deprecated This function is deprecated because it does not allow the
+ caller to specify which even_base it uses. The recommended
+ function is evdns_add_server_port_with_base().
+
+*/
+struct evdns_server_port *evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data);
+
+#ifdef _WIN32
+int evdns_config_windows_nameservers(void);
+#define EVDNS_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/dns_struct.h b/sntp/libevent/include/event2/dns_struct.h
new file mode 100644
index 0000000..593a8a7
--- /dev/null
+++ b/sntp/libevent/include/event2/dns_struct.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_DNS_STRUCT_H_INCLUDED_
+#define EVENT2_DNS_STRUCT_H_INCLUDED_
+
+/** @file event2/dns_struct.h
+
+ Data structures for dns. Using these structures may hurt forward
+ compatibility with later versions of Libevent: be careful!
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/*
+ * Structures used to implement a DNS server.
+ */
+
+struct evdns_server_request {
+ int flags;
+ int nquestions;
+ struct evdns_server_question **questions;
+};
+struct evdns_server_question {
+ int type;
+#ifdef __cplusplus
+ int dns_question_class;
+#else
+ /* You should refer to this field as "dns_question_class". The
+ * name "class" works in C for backward compatibility, and will be
+ * removed in a future version. (1.5 or later). */
+ int class;
+#define dns_question_class class
+#endif
+ char name[1];
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_DNS_STRUCT_H_INCLUDED_ */
+
diff --git a/sntp/libevent/include/event2/event.h b/sntp/libevent/include/event2/event.h
new file mode 100644
index 0000000..6e2b884
--- /dev/null
+++ b/sntp/libevent/include/event2/event.h
@@ -0,0 +1,1669 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_EVENT_H_INCLUDED_
+#define EVENT2_EVENT_H_INCLUDED_
+
+/**
+ @mainpage
+
+ @section intro Introduction
+
+ Libevent is an event notification library for developing scalable network
+ servers. The Libevent API provides a mechanism to execute a callback
+ function when a specific event occurs on a file descriptor or after a
+ timeout has been reached. Furthermore, Libevent also support callbacks due
+ to signals or regular timeouts.
+
+ Libevent is meant to replace the event loop found in event driven network
+ servers. An application just needs to call event_base_dispatch() and then add or
+ remove events dynamically without having to change the event loop.
+
+
+ Currently, Libevent supports /dev/poll, kqueue(2), select(2), poll(2),
+ epoll(4), and evports. The internal event mechanism is completely
+ independent of the exposed event API, and a simple update of Libevent can
+ provide new functionality without having to redesign the applications. As a
+ result, Libevent allows for portable application development and provides
+ the most scalable event notification mechanism available on an operating
+ system. Libevent can also be used for multithreaded programs. Libevent
+ should compile on Linux, *BSD, Mac OS X, Solaris and, Windows.
+
+ @section usage Standard usage
+
+ Every program that uses Libevent must include the <event2/event.h>
+ header, and pass the -levent flag to the linker. (You can instead link
+ -levent_core if you only want the main event and buffered IO-based code,
+ and don't want to link any protocol code.)
+
+ @section setup Library setup
+
+ Before you call any other Libevent functions, you need to set up the
+ library. If you're going to use Libevent from multiple threads in a
+ multithreaded application, you need to initialize thread support --
+ typically by using evthread_use_pthreads() or
+ evthread_use_windows_threads(). See <event2/thread.h> for more
+ information.
+
+ This is also the point where you can replace Libevent's memory
+ management functions with event_set_mem_functions, and enable debug mode
+ with event_enable_debug_mode().
+
+ @section base Creating an event base
+
+ Next, you need to create an event_base structure, using event_base_new()
+ or event_base_new_with_config(). The event_base is responsible for
+ keeping track of which events are "pending" (that is to say, being
+ watched to see if they become active) and which events are "active".
+ Every event is associated with a single event_base.
+
+ @section event Event notification
+
+ For each file descriptor that you wish to monitor, you must create an
+ event structure with event_new(). (You may also declare an event
+ structure and call event_assign() to initialize the members of the
+ structure.) To enable notification, you add the structure to the list
+ of monitored events by calling event_add(). The event structure must
+ remain allocated as long as it is active, so it should generally be
+ allocated on the heap.
+
+ @section loop Dispatching events.
+
+ Finally, you call event_base_dispatch() to loop and dispatch events.
+ You can also use event_base_loop() for more fine-grained control.
+
+ Currently, only one thread can be dispatching a given event_base at a
+ time. If you want to run events in multiple threads at once, you can
+ either have a single event_base whose events add work to a work queue,
+ or you can create multiple event_base objects.
+
+ @section bufferevent I/O Buffers
+
+ Libevent provides a buffered I/O abstraction on top of the regular event
+ callbacks. This abstraction is called a bufferevent. A bufferevent
+ provides input and output buffers that get filled and drained
+ automatically. The user of a buffered event no longer deals directly
+ with the I/O, but instead is reading from input and writing to output
+ buffers.
+
+ Once initialized via bufferevent_socket_new(), the bufferevent structure
+ can be used repeatedly with bufferevent_enable() and
+ bufferevent_disable(). Instead of reading and writing directly to a
+ socket, you would call bufferevent_read() and bufferevent_write().
+
+ When read enabled the bufferevent will try to read from the file descriptor
+ and call the read callback. The write callback is executed whenever the
+ output buffer is drained below the write low watermark, which is 0 by
+ default.
+
+ See <event2/bufferevent*.h> for more information.
+
+ @section timers Timers
+
+ Libevent can also be used to create timers that invoke a callback after a
+ certain amount of time has expired. The evtimer_new() macro returns
+ an event struct to use as a timer. To activate the timer, call
+ evtimer_add(). Timers can be deactivated by calling evtimer_del().
+ (These macros are thin wrappers around event_new(), event_add(),
+ and event_del(); you can also use those instead.)
+
+ @section evdns Asynchronous DNS resolution
+
+ Libevent provides an asynchronous DNS resolver that should be used instead
+ of the standard DNS resolver functions. See the <event2/dns.h>
+ functions for more detail.
+
+ @section evhttp Event-driven HTTP servers
+
+ Libevent provides a very simple event-driven HTTP server that can be
+ embedded in your program and used to service HTTP requests.
+
+ To use this capability, you need to include the <event2/http.h> header in your
+ program. See that header for more information.
+
+ @section evrpc A framework for RPC servers and clients
+
+ Libevent provides a framework for creating RPC servers and clients. It
+ takes care of marshaling and unmarshaling all data structures.
+
+ @section api API Reference
+
+ To browse the complete documentation of the libevent API, click on any of
+ the following links.
+
+ event2/event.h
+ The primary libevent header
+
+ event2/thread.h
+ Functions for use by multithreaded programs
+
+ event2/buffer.h and event2/bufferevent.h
+ Buffer management for network reading and writing
+
+ event2/util.h
+ Utility functions for portable nonblocking network code
+
+ event2/dns.h
+ Asynchronous DNS resolution
+
+ event2/http.h
+ An embedded libevent-based HTTP server
+
+ event2/rpc.h
+ A framework for creating RPC servers and clients
+
+ */
+
+/** @file event2/event.h
+
+ Core functions for waiting for and receiving events, and using event bases.
+*/
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <stdio.h>
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ * Structure to hold information and state for a Libevent dispatch loop.
+ *
+ * The event_base lies at the center of Libevent; every application will
+ * have one. It keeps track of all pending and active events, and
+ * notifies your application of the active ones.
+ *
+ * This is an opaque structure; you can allocate one using
+ * event_base_new() or event_base_new_with_config().
+ *
+ * @see event_base_new(), event_base_free(), event_base_loop(),
+ * event_base_new_with_config()
+ */
+struct event_base
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+/**
+ * @struct event
+ *
+ * Structure to represent a single event.
+ *
+ * An event can have some underlying condition it represents: a socket
+ * becoming readable or writeable (or both), or a signal becoming raised.
+ * (An event that represents no underlying condition is still useful: you
+ * can use one to implement a timer, or to communicate between threads.)
+ *
+ * Generally, you can create events with event_new(), then make them
+ * pending with event_add(). As your event_base runs, it will run the
+ * callbacks of an events whose conditions are triggered. When you
+ * longer want the event, free it with event_free().
+ *
+ * In more depth:
+ *
+ * An event may be "pending" (one whose condition we are watching),
+ * "active" (one whose condition has triggered and whose callback is about
+ * to run), neither, or both. Events come into existence via
+ * event_assign() or event_new(), and are then neither active nor pending.
+ *
+ * To make an event pending, pass it to event_add(). When doing so, you
+ * can also set a timeout for the event.
+ *
+ * Events become active during an event_base_loop() call when either their
+ * condition has triggered, or when their timeout has elapsed. You can
+ * also activate an event manually using event_active(). The even_base
+ * loop will run the callbacks of active events; after it has done so, it
+ * marks them as no longer active.
+ *
+ * You can make an event non-pending by passing it to event_del(). This
+ * also makes the event non-active.
+ *
+ * Events can be "persistent" or "non-persistent". A non-persistent event
+ * becomes non-pending as soon as it is triggered: thus, it only runs at
+ * most once per call to event_add(). A persistent event remains pending
+ * even when it becomes active: you'll need to event_del() it manually in
+ * order to make it non-pending. When a persistent event with a timeout
+ * becomes active, its timeout is reset: this means you can use persistent
+ * events to implement periodic timeouts.
+ *
+ * This should be treated as an opaque structure; you should never read or
+ * write any of its fields directly. For backward compatibility with old
+ * code, it is defined in the event2/event_struct.h header; including this
+ * header may make your code incompatible with other versions of Libevent.
+ *
+ * @see event_new(), event_free(), event_assign(), event_get_assignment(),
+ * event_add(), event_del(), event_active(), event_pending(),
+ * event_get_fd(), event_get_base(), event_get_events(),
+ * event_get_callback(), event_get_callback_arg(),
+ * event_priority_set()
+ */
+struct event
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+/**
+ * Configuration for an event_base.
+ *
+ * There are many options that can be used to alter the behavior and
+ * implementation of an event_base. To avoid having to pass them all in a
+ * complex many-argument constructor, we provide an abstract data type
+ * wrhere you set up configation information before passing it to
+ * event_base_new_with_config().
+ *
+ * @see event_config_new(), event_config_free(), event_base_new_with_config(),
+ * event_config_avoid_method(), event_config_require_features(),
+ * event_config_set_flag(), event_config_set_num_cpus_hint()
+ */
+struct event_config
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+/**
+ * Enable some relatively expensive debugging checks in Libevent that
+ * would normally be turned off. Generally, these checks cause code that
+ * would otherwise crash mysteriously to fail earlier with an assertion
+ * failure. Note that this method MUST be called before any events or
+ * event_bases have been created.
+ *
+ * Debug mode can currently catch the following errors:
+ * An event is re-assigned while it is added
+ * Any function is called on a non-assigned event
+ *
+ * Note that debugging mode uses memory to track every event that has been
+ * initialized (via event_assign, event_set, or event_new) but not yet
+ * released (via event_free or event_debug_unassign). If you want to use
+ * debug mode, and you find yourself running out of memory, you will need
+ * to use event_debug_unassign to explicitly stop tracking events that
+ * are no longer considered set-up.
+ *
+ * @see event_debug_unassign()
+ */
+EVENT2_EXPORT_SYMBOL
+void event_enable_debug_mode(void);
+
+/**
+ * When debugging mode is enabled, informs Libevent that an event should no
+ * longer be considered as assigned. When debugging mode is not enabled, does
+ * nothing.
+ *
+ * This function must only be called on a non-added event.
+ *
+ * @see event_enable_debug_mode()
+ */
+EVENT2_EXPORT_SYMBOL
+void event_debug_unassign(struct event *);
+
+/**
+ * Create and return a new event_base to use with the rest of Libevent.
+ *
+ * @return a new event_base on success, or NULL on failure.
+ *
+ * @see event_base_free(), event_base_new_with_config()
+ */
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_base_new(void);
+
+/**
+ Reinitialize the event base after a fork
+
+ Some event mechanisms do not survive across fork. The event base needs
+ to be reinitialized with the event_reinit() function.
+
+ @param base the event base that needs to be re-initialized
+ @return 0 if successful, or -1 if some events could not be re-added.
+ @see event_base_new()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_reinit(struct event_base *base);
+
+/**
+ Event dispatching loop
+
+ This loop will run the event base until either there are no more pending or
+ active, or until something calls event_base_loopbreak() or
+ event_base_loopexit().
+
+ @param base the event_base structure returned by event_base_new() or
+ event_base_new_with_config()
+ @return 0 if successful, -1 if an error occurred, or 1 if we exited because
+ no events were pending or active.
+ @see event_base_loop()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_dispatch(struct event_base *);
+
+/**
+ Get the kernel event notification mechanism used by Libevent.
+
+ @param eb the event_base structure returned by event_base_new()
+ @return a string identifying the kernel event mechanism (kqueue, epoll, etc.)
+ */
+EVENT2_EXPORT_SYMBOL
+const char *event_base_get_method(const struct event_base *);
+
+/**
+ Gets all event notification mechanisms supported by Libevent.
+
+ This functions returns the event mechanism in order preferred by
+ Libevent. Note that this list will include all backends that
+ Libevent has compiled-in support for, and will not necessarily check
+ your OS to see whether it has the required resources.
+
+ @return an array with pointers to the names of support methods.
+ The end of the array is indicated by a NULL pointer. If an
+ error is encountered NULL is returned.
+*/
+EVENT2_EXPORT_SYMBOL
+const char **event_get_supported_methods(void);
+
+/**
+ @name event type flag
+
+ Flags to pass to event_base_get_num_events() to specify the kinds of events
+ we want to aggregate counts for
+*/
+/**@{*/
+/** count the number of active events, which have been triggered.*/
+#define EVENT_BASE_COUNT_ACTIVE 1U
+/** count the number of virtual events, which is used to represent an internal
+ * condition, other than a pending event, that keeps the loop from exiting. */
+#define EVENT_BASE_COUNT_VIRTUAL 2U
+/** count the number of events which have been added to event base, including
+ * internal events. */
+#define EVENT_BASE_COUNT_ADDED 4U
+/**@}*/
+
+/**
+ Gets the number of events in event_base, as specified in the flags.
+
+ Since event base has some internal events added to make some of its
+ functionalities work, EVENT_BASE_COUNT_ADDED may return more than the
+ number of events you added using event_add().
+
+ If you pass EVENT_BASE_COUNT_ACTIVE and EVENT_BASE_COUNT_ADDED together, an
+ active event will be counted twice. However, this might not be the case in
+ future libevent versions. The return value is an indication of the work
+ load, but the user shouldn't rely on the exact value as this may change in
+ the future.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param flags a bitwise combination of the kinds of events to aggregate
+ counts for
+ @return the number of events specified in the flags
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_get_num_events(struct event_base *, unsigned int);
+
+/**
+ Get the maximum number of events in a given event_base as specified in the
+ flags.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param flags a bitwise combination of the kinds of events to aggregate
+ counts for
+ @param clear option used to reset the maximum count.
+ @return the number of events specified in the flags
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_get_max_events(struct event_base *, unsigned int, int);
+
+/**
+ Allocates a new event configuration object.
+
+ The event configuration object can be used to change the behavior of
+ an event base.
+
+ @return an event_config object that can be used to store configuration, or
+ NULL if an error is encountered.
+ @see event_base_new_with_config(), event_config_free(), event_config
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_config *event_config_new(void);
+
+/**
+ Deallocates all memory associated with an event configuration object
+
+ @param cfg the event configuration object to be freed.
+*/
+EVENT2_EXPORT_SYMBOL
+void event_config_free(struct event_config *cfg);
+
+/**
+ Enters an event method that should be avoided into the configuration.
+
+ This can be used to avoid event mechanisms that do not support certain
+ file descriptor types, or for debugging to avoid certain event
+ mechanisms. An application can make use of multiple event bases to
+ accommodate incompatible file descriptor types.
+
+ @param cfg the event configuration object
+ @param method the name of the event method to avoid
+ @return 0 on success, -1 on failure.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_config_avoid_method(struct event_config *cfg, const char *method);
+
+/**
+ A flag used to describe which features an event_base (must) provide.
+
+ Because of OS limitations, not every Libevent backend supports every
+ possible feature. You can use this type with
+ event_config_require_features() to tell Libevent to only proceed if your
+ event_base implements a given feature, and you can receive this type from
+ event_base_get_features() to see which features are available.
+*/
+enum event_method_feature {
+ /** Require an event method that allows edge-triggered events with EV_ET. */
+ EV_FEATURE_ET = 0x01,
+ /** Require an event method where having one event triggered among
+ * many is [approximately] an O(1) operation. This excludes (for
+ * example) select and poll, which are approximately O(N) for N
+ * equal to the total number of possible events. */
+ EV_FEATURE_O1 = 0x02,
+ /** Require an event method that allows file descriptors as well as
+ * sockets. */
+ EV_FEATURE_FDS = 0x04,
+ /** Require an event method that allows you to use EV_CLOSED to detect
+ * connection close without the necessity of reading all the pending data.
+ *
+ * Methods that do support EV_CLOSED may not be able to provide support on
+ * all kernel versions.
+ **/
+ EV_FEATURE_EARLY_CLOSE = 0x08
+};
+
+/**
+ A flag passed to event_config_set_flag().
+
+ These flags change the behavior of an allocated event_base.
+
+ @see event_config_set_flag(), event_base_new_with_config(),
+ event_method_feature
+ */
+enum event_base_config_flag {
+ /** Do not allocate a lock for the event base, even if we have
+ locking set up.
+
+ Setting this option will make it unsafe and nonfunctional to call
+ functions on the base concurrently from multiple threads.
+ */
+ EVENT_BASE_FLAG_NOLOCK = 0x01,
+ /** Do not check the EVENT_* environment variables when configuring
+ an event_base */
+ EVENT_BASE_FLAG_IGNORE_ENV = 0x02,
+ /** Windows only: enable the IOCP dispatcher at startup
+
+ If this flag is set then bufferevent_socket_new() and
+ evconn_listener_new() will use IOCP-backed implementations
+ instead of the usual select-based one on Windows.
+ */
+ EVENT_BASE_FLAG_STARTUP_IOCP = 0x04,
+ /** Instead of checking the current time every time the event loop is
+ ready to run timeout callbacks, check after each timeout callback.
+ */
+ EVENT_BASE_FLAG_NO_CACHE_TIME = 0x08,
+
+ /** If we are using the epoll backend, this flag says that it is
+ safe to use Libevent's internal change-list code to batch up
+ adds and deletes in order to try to do as few syscalls as
+ possible. Setting this flag can make your code run faster, but
+ it may trigger a Linux bug: it is not safe to use this flag
+ if you have any fds cloned by dup() or its variants. Doing so
+ will produce strange and hard-to-diagnose bugs.
+
+ This flag can also be activated by setting the
+ EVENT_EPOLL_USE_CHANGELIST environment variable.
+
+ This flag has no effect if you wind up using a backend other than
+ epoll.
+ */
+ EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST = 0x10,
+
+ /** Ordinarily, Libevent implements its time and timeout code using
+ the fastest monotonic timer that we have. If this flag is set,
+ however, we use less efficient more precise timer, assuming one is
+ present.
+ */
+ EVENT_BASE_FLAG_PRECISE_TIMER = 0x20
+};
+
+/**
+ Return a bitmask of the features implemented by an event base. This
+ will be a bitwise OR of one or more of the values of
+ event_method_feature
+
+ @see event_method_feature
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_get_features(const struct event_base *base);
+
+/**
+ Enters a required event method feature that the application demands.
+
+ Note that not every feature or combination of features is supported
+ on every platform. Code that requests features should be prepared
+ to handle the case where event_base_new_with_config() returns NULL, as in:
+ <pre>
+ event_config_require_features(cfg, EV_FEATURE_ET);
+ base = event_base_new_with_config(cfg);
+ if (base == NULL) {
+ // We can't get edge-triggered behavior here.
+ event_config_require_features(cfg, 0);
+ base = event_base_new_with_config(cfg);
+ }
+ </pre>
+
+ @param cfg the event configuration object
+ @param feature a bitfield of one or more event_method_feature values.
+ Replaces values from previous calls to this function.
+ @return 0 on success, -1 on failure.
+ @see event_method_feature, event_base_new_with_config()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_config_require_features(struct event_config *cfg, int feature);
+
+/**
+ * Sets one or more flags to configure what parts of the eventual event_base
+ * will be initialized, and how they'll work.
+ *
+ * @see event_base_config_flags, event_base_new_with_config()
+ **/
+EVENT2_EXPORT_SYMBOL
+int event_config_set_flag(struct event_config *cfg, int flag);
+
+/**
+ * Records a hint for the number of CPUs in the system. This is used for
+ * tuning thread pools, etc, for optimal performance. In Libevent 2.0,
+ * it is only on Windows, and only when IOCP is in use.
+ *
+ * @param cfg the event configuration object
+ * @param cpus the number of cpus
+ * @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_config_set_num_cpus_hint(struct event_config *cfg, int cpus);
+
+/**
+ * Record an interval and/or a number of callbacks after which the event base
+ * should check for new events. By default, the event base will run as many
+ * events are as activated at the higest activated priority before checking
+ * for new events. If you configure it by setting max_interval, it will check
+ * the time after each callback, and not allow more than max_interval to
+ * elapse before checking for new events. If you configure it by setting
+ * max_callbacks to a value >= 0, it will run no more than max_callbacks
+ * callbacks before checking for new events.
+ *
+ * This option can decrease the latency of high-priority events, and
+ * avoid priority inversions where multiple low-priority events keep us from
+ * polling for high-priority events, but at the expense of slightly decreasing
+ * the throughput. Use it with caution!
+ *
+ * @param cfg The event_base configuration object.
+ * @param max_interval An interval after which Libevent should stop running
+ * callbacks and check for more events, or NULL if there should be
+ * no such interval.
+ * @param max_callbacks A number of callbacks after which Libevent should
+ * stop running callbacks and check for more events, or -1 if there
+ * should be no such limit.
+ * @param min_priority A priority below which max_interval and max_callbacks
+ * should not be enforced. If this is set to 0, they are enforced
+ * for events of every priority; if it's set to 1, they're enforced
+ * for events of priority 1 and above, and so on.
+ * @return 0 on success, -1 on failure.
+ **/
+EVENT2_EXPORT_SYMBOL
+int event_config_set_max_dispatch_interval(struct event_config *cfg,
+ const struct timeval *max_interval, int max_callbacks,
+ int min_priority);
+
+/**
+ Initialize the event API.
+
+ Use event_base_new_with_config() to initialize a new event base, taking
+ the specified configuration under consideration. The configuration object
+ can currently be used to avoid certain event notification mechanisms.
+
+ @param cfg the event configuration object
+ @return an initialized event_base that can be used to registering events,
+ or NULL if no event base can be created with the requested event_config.
+ @see event_base_new(), event_base_free(), event_init(), event_assign()
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_base_new_with_config(const struct event_config *);
+
+/**
+ Deallocate all memory associated with an event_base, and free the base.
+
+ Note that this function will not close any fds or free any memory passed
+ to event_new as the argument to callback.
+
+ If there are any pending finalizer callbacks, this function will invoke
+ them.
+
+ @param eb an event_base to be freed
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_free(struct event_base *);
+
+/**
+ As event_free, but do not run finalizers.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_free_nofinalize(struct event_base *);
+
+/** @name Log severities
+ */
+/**@{*/
+#define EVENT_LOG_DEBUG 0
+#define EVENT_LOG_MSG 1
+#define EVENT_LOG_WARN 2
+#define EVENT_LOG_ERR 3
+/**@}*/
+
+/* Obsolete names: these are deprecated, but older programs might use them.
+ * They violate the reserved-identifier namespace. */
+#define _EVENT_LOG_DEBUG EVENT_LOG_DEBUG
+#define _EVENT_LOG_MSG EVENT_LOG_MSG
+#define _EVENT_LOG_WARN EVENT_LOG_WARN
+#define _EVENT_LOG_ERR EVENT_LOG_ERR
+
+/**
+ A callback function used to intercept Libevent's log messages.
+
+ @see event_set_log_callback
+ */
+typedef void (*event_log_cb)(int severity, const char *msg);
+/**
+ Redirect Libevent's log messages.
+
+ @param cb a function taking two arguments: an integer severity between
+ EVENT_LOG_DEBUG and EVENT_LOG_ERR, and a string. If cb is NULL,
+ then the default log is used.
+
+ NOTE: The function you provide *must not* call any other libevent
+ functionality. Doing so can produce undefined behavior.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_set_log_callback(event_log_cb cb);
+
+/**
+ A function to be called if Libevent encounters a fatal internal error.
+
+ @see event_set_fatal_callback
+ */
+typedef void (*event_fatal_cb)(int err);
+
+/**
+ Override Libevent's behavior in the event of a fatal internal error.
+
+ By default, Libevent will call exit(1) if a programming error makes it
+ impossible to continue correct operation. This function allows you to supply
+ another callback instead. Note that if the function is ever invoked,
+ something is wrong with your program, or with Libevent: any subsequent calls
+ to Libevent may result in undefined behavior.
+
+ Libevent will (almost) always log an EVENT_LOG_ERR message before calling
+ this function; look at the last log message to see why Libevent has died.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_set_fatal_callback(event_fatal_cb cb);
+
+#define EVENT_DBG_ALL 0xffffffffu
+#define EVENT_DBG_NONE 0
+
+/**
+ Turn on debugging logs and have them sent to the default log handler.
+
+ This is a global setting; if you are going to call it, you must call this
+ before any calls that create an event-base. You must call it before any
+ multithreaded use of Libevent.
+
+ Debug logs are verbose.
+
+ @param which Controls which debug messages are turned on. This option is
+ unused for now; for forward compatibility, you must pass in the constant
+ "EVENT_DBG_ALL" to turn debugging logs on, or "EVENT_DBG_NONE" to turn
+ debugging logs off.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_enable_debug_logging(ev_uint32_t which);
+
+/**
+ Associate a different event base with an event.
+
+ The event to be associated must not be currently active or pending.
+
+ @param eb the event base
+ @param ev the event
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_set(struct event_base *, struct event *);
+
+/** @name Loop flags
+
+ These flags control the behavior of event_base_loop().
+ */
+/**@{*/
+/** Block until we have an active event, then exit once all active events
+ * have had their callbacks run. */
+#define EVLOOP_ONCE 0x01
+/** Do not block: see which events are ready now, run the callbacks
+ * of the highest-priority ones, then exit. */
+#define EVLOOP_NONBLOCK 0x02
+/** Do not exit the loop because we have no pending events. Instead, keep
+ * running until event_base_loopexit() or event_base_loopbreak() makes us
+ * stop.
+ */
+#define EVLOOP_NO_EXIT_ON_EMPTY 0x04
+/**@}*/
+
+/**
+ Wait for events to become active, and run their callbacks.
+
+ This is a more flexible version of event_base_dispatch().
+
+ By default, this loop will run the event base until either there are no more
+ pending or active events, or until something calls event_base_loopbreak() or
+ event_base_loopexit(). You can override this behavior with the 'flags'
+ argument.
+
+ @param eb the event_base structure returned by event_base_new() or
+ event_base_new_with_config()
+ @param flags any combination of EVLOOP_ONCE | EVLOOP_NONBLOCK
+ @return 0 if successful, -1 if an error occurred, or 1 if we exited because
+ no events were pending or active.
+ @see event_base_loopexit(), event_base_dispatch(), EVLOOP_ONCE,
+ EVLOOP_NONBLOCK
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loop(struct event_base *, int);
+
+/**
+ Exit the event loop after the specified time
+
+ The next event_base_loop() iteration after the given timer expires will
+ complete normally (handling all queued events) then exit without
+ blocking for events again.
+
+ Subsequent invocations of event_base_loop() will proceed normally.
+
+ @param eb the event_base structure returned by event_init()
+ @param tv the amount of time after which the loop should terminate,
+ or NULL to exit after running all currently active events.
+ @return 0 if successful, or -1 if an error occurred
+ @see event_base_loopbreak()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loopexit(struct event_base *, const struct timeval *);
+
+/**
+ Abort the active event_base_loop() immediately.
+
+ event_base_loop() will abort the loop after the next event is completed;
+ event_base_loopbreak() is typically invoked from this event's callback.
+ This behavior is analogous to the "break;" statement.
+
+ Subsequent invocations of event_base_loop() will proceed normally.
+
+ @param eb the event_base structure returned by event_init()
+ @return 0 if successful, or -1 if an error occurred
+ @see event_base_loopexit()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loopbreak(struct event_base *);
+
+/**
+ Tell the active event_base_loop() to scan for new events immediately.
+
+ Calling this function makes the currently active event_base_loop()
+ start the loop over again (scanning for new events) after the current
+ event callback finishes. If the event loop is not running, this
+ function has no effect.
+
+ event_base_loopbreak() is typically invoked from this event's callback.
+ This behavior is analogous to the "continue;" statement.
+
+ Subsequent invocations of event loop will proceed normally.
+
+ @param eb the event_base structure returned by event_init()
+ @return 0 if successful, or -1 if an error occurred
+ @see event_base_loopbreak()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loopcontinue(struct event_base *);
+
+/**
+ Checks if the event loop was told to exit by event_base_loopexit().
+
+ This function will return true for an event_base at every point after
+ event_loopexit() is called, until the event loop is next entered.
+
+ @param eb the event_base structure returned by event_init()
+ @return true if event_base_loopexit() was called on this event base,
+ or 0 otherwise
+ @see event_base_loopexit()
+ @see event_base_got_break()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_got_exit(struct event_base *);
+
+/**
+ Checks if the event loop was told to abort immediately by event_base_loopbreak().
+
+ This function will return true for an event_base at every point after
+ event_base_loopbreak() is called, until the event loop is next entered.
+
+ @param eb the event_base structure returned by event_init()
+ @return true if event_base_loopbreak() was called on this event base,
+ or 0 otherwise
+ @see event_base_loopbreak()
+ @see event_base_got_exit()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_got_break(struct event_base *);
+
+/**
+ * @name event flags
+ *
+ * Flags to pass to event_new(), event_assign(), event_pending(), and
+ * anything else with an argument of the form "short events"
+ */
+/**@{*/
+/** Indicates that a timeout has occurred. It's not necessary to pass
+ * this flag to event_for new()/event_assign() to get a timeout. */
+#define EV_TIMEOUT 0x01
+/** Wait for a socket or FD to become readable */
+#define EV_READ 0x02
+/** Wait for a socket or FD to become writeable */
+#define EV_WRITE 0x04
+/** Wait for a POSIX signal to be raised*/
+#define EV_SIGNAL 0x08
+/**
+ * Persistent event: won't get removed automatically when activated.
+ *
+ * When a persistent event with a timeout becomes activated, its timeout
+ * is reset to 0.
+ */
+#define EV_PERSIST 0x10
+/** Select edge-triggered behavior, if supported by the backend. */
+#define EV_ET 0x20
+/**
+ * If this option is provided, then event_del() will not block in one thread
+ * while waiting for the event callback to complete in another thread.
+ *
+ * To use this option safely, you may need to use event_finalize() or
+ * event_free_finalize() in order to safely tear down an event in a
+ * multithreaded application. See those functions for more information.
+ *
+ * THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ * BECOMES STABLE.
+ **/
+#define EV_FINALIZE 0x40
+/**
+ * Detects connection close events. You can use this to detect when a
+ * connection has been closed, without having to read all the pending data
+ * from a connection.
+ *
+ * Not all backends support EV_CLOSED. To detect or require it, use the
+ * feature flag EV_FEATURE_EARLY_CLOSE.
+ **/
+#define EV_CLOSED 0x80
+/**@}*/
+
+/**
+ @name evtimer_* macros
+
+ Aliases for working with one-shot timer events */
+/**@{*/
+#define evtimer_assign(ev, b, cb, arg) \
+ event_assign((ev), (b), -1, 0, (cb), (arg))
+#define evtimer_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
+#define evtimer_add(ev, tv) event_add((ev), (tv))
+#define evtimer_del(ev) event_del(ev)
+#define evtimer_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv))
+#define evtimer_initialized(ev) event_initialized(ev)
+/**@}*/
+
+/**
+ @name evsignal_* macros
+
+ Aliases for working with signal events
+ */
+/**@{*/
+#define evsignal_add(ev, tv) event_add((ev), (tv))
+#define evsignal_assign(ev, b, x, cb, arg) \
+ event_assign((ev), (b), (x), EV_SIGNAL|EV_PERSIST, cb, (arg))
+#define evsignal_new(b, x, cb, arg) \
+ event_new((b), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
+#define evsignal_del(ev) event_del(ev)
+#define evsignal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv))
+#define evsignal_initialized(ev) event_initialized(ev)
+/**@}*/
+
+/**
+ A callback function for an event.
+
+ It receives three arguments:
+
+ @param fd An fd or signal
+ @param events One or more EV_* flags
+ @param arg A user-supplied argument.
+
+ @see event_new()
+ */
+typedef void (*event_callback_fn)(evutil_socket_t, short, void *);
+
+/**
+ Return a value used to specify that the event itself must be used as the callback argument.
+
+ The function event_new() takes a callback argument which is passed
+ to the event's callback function. To specify that the argument to be
+ passed to the callback function is the event that event_new() returns,
+ pass in the return value of event_self_cbarg() as the callback argument
+ for event_new().
+
+ For example:
+ <pre>
+ struct event *ev = event_new(base, sock, events, callback, %event_self_cbarg());
+ </pre>
+
+ For consistency with event_new(), it is possible to pass the return value
+ of this function as the callback argument for event_assign() &ndash; this
+ achieves the same result as passing the event in directly.
+
+ @return a value to be passed as the callback argument to event_new() or
+ event_assign().
+ @see event_new(), event_assign()
+ */
+EVENT2_EXPORT_SYMBOL
+void *event_self_cbarg(void);
+
+/**
+ Allocate and asssign a new event structure, ready to be added.
+
+ The function event_new() returns a new event that can be used in
+ future calls to event_add() and event_del(). The fd and events
+ arguments determine which conditions will trigger the event; the
+ callback and callback_arg arguments tell Libevent what to do when the
+ event becomes active.
+
+ If events contains one of EV_READ, EV_WRITE, or EV_READ|EV_WRITE, then
+ fd is a file descriptor or socket that should get monitored for
+ readiness to read, readiness to write, or readiness for either operation
+ (respectively). If events contains EV_SIGNAL, then fd is a signal
+ number to wait for. If events contains none of those flags, then the
+ event can be triggered only by a timeout or by manual activation with
+ event_active(): In this case, fd must be -1.
+
+ The EV_PERSIST flag can also be passed in the events argument: it makes
+ event_add() persistent until event_del() is called.
+
+ The EV_ET flag is compatible with EV_READ and EV_WRITE, and supported
+ only by certain backends. It tells Libevent to use edge-triggered
+ events.
+
+ The EV_TIMEOUT flag has no effect here.
+
+ It is okay to have multiple events all listening on the same fds; but
+ they must either all be edge-triggered, or all not be edge triggerd.
+
+ When the event becomes active, the event loop will run the provided
+ callbuck function, with three arguments. The first will be the provided
+ fd value. The second will be a bitfield of the events that triggered:
+ EV_READ, EV_WRITE, or EV_SIGNAL. Here the EV_TIMEOUT flag indicates
+ that a timeout occurred, and EV_ET indicates that an edge-triggered
+ event occurred. The third event will be the callback_arg pointer that
+ you provide.
+
+ @param base the event base to which the event should be attached.
+ @param fd the file descriptor or signal to be monitored, or -1.
+ @param events desired events to monitor: bitfield of EV_READ, EV_WRITE,
+ EV_SIGNAL, EV_PERSIST, EV_ET.
+ @param callback callback function to be invoked when the event occurs
+ @param callback_arg an argument to be passed to the callback function
+
+ @return a newly allocated struct event that must later be freed with
+ event_free().
+ @see event_free(), event_add(), event_del(), event_assign()
+ */
+EVENT2_EXPORT_SYMBOL
+struct event *event_new(struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
+
+
+/**
+ Prepare a new, already-allocated event structure to be added.
+
+ The function event_assign() prepares the event structure ev to be used
+ in future calls to event_add() and event_del(). Unlike event_new(), it
+ doesn't allocate memory itself: it requires that you have already
+ allocated a struct event, probably on the heap. Doing this will
+ typically make your code depend on the size of the event structure, and
+ thereby create incompatibility with future versions of Libevent.
+
+ The easiest way to avoid this problem is just to use event_new() and
+ event_free() instead.
+
+ A slightly harder way to future-proof your code is to use
+ event_get_struct_event_size() to determine the required size of an event
+ at runtime.
+
+ Note that it is NOT safe to call this function on an event that is
+ active or pending. Doing so WILL corrupt internal data structures in
+ Libevent, and lead to strange, hard-to-diagnose bugs. You _can_ use
+ event_assign to change an existing event, but only if it is not active
+ or pending!
+
+ The arguments for this function, and the behavior of the events that it
+ makes, are as for event_new().
+
+ @param ev an event struct to be modified
+ @param base the event base to which ev should be attached.
+ @param fd the file descriptor to be monitored
+ @param events desired events to monitor; can be EV_READ and/or EV_WRITE
+ @param callback callback function to be invoked when the event occurs
+ @param callback_arg an argument to be passed to the callback function
+
+ @return 0 if success, or -1 on invalid arguments.
+
+ @see event_new(), event_add(), event_del(), event_base_once(),
+ event_get_struct_event_size()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_assign(struct event *, struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
+
+/**
+ Deallocate a struct event * returned by event_new().
+
+ If the event is pending or active, first make it non-pending and
+ non-active.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_free(struct event *);
+
+/**
+ * Callback type for event_finalize and event_free_finalize().
+ *
+ * THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ * BECOMES STABLE.
+ *
+ **/
+typedef void (*event_finalize_callback_fn)(struct event *, void *);
+/**
+ @name Finalization functions
+
+ These functions are used to safely tear down an event in a multithreaded
+ application. If you construct your events with EV_FINALIZE to avoid
+ deadlocks, you will need a way to remove an event in the certainty that
+ it will definitely not be running its callback when you deallocate it
+ and its callback argument.
+
+ To do this, call one of event_finalize() or event_free_finalize with
+ 0 for its first argument, the event to tear down as its second argument,
+ and a callback function as its third argument. The callback will be
+ invoked as part of the event loop, with the event's priority.
+
+ After you call a finalizer function, event_add() and event_active() will
+ no longer work on the event, and event_del() will produce a no-op. You
+ must not try to change the event's fields with event_assign() or
+ event_set() while the finalize callback is in progress. Once the
+ callback has been invoked, you should treat the event structure as
+ containing uninitialized memory.
+
+ The event_free_finalize() function frees the event after it's finalized;
+ event_finalize() does not.
+
+ A finalizer callback must not make events pending or active. It must not
+ add events, activate events, or attempt to "resucitate" the event being
+ finalized in any way.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+
+ @return 0 on succes, -1 on failure.
+ */
+/**@{*/
+EVENT2_EXPORT_SYMBOL
+int event_finalize(unsigned, struct event *, event_finalize_callback_fn);
+EVENT2_EXPORT_SYMBOL
+int event_free_finalize(unsigned, struct event *, event_finalize_callback_fn);
+/**@}*/
+
+/**
+ Schedule a one-time event
+
+ The function event_base_once() is similar to event_new(). However, it
+ schedules a callback to be called exactly once, and does not require the
+ caller to prepare an event structure.
+
+ Note that in Libevent 2.0 and earlier, if the event is never triggered, the
+ internal memory used to hold it will never be freed. In Libevent 2.1,
+ the internal memory will get freed by event_base_free() if the event
+ is never triggered. The 'arg' value, however, will not get freed in either
+ case--you'll need to free that on your own if you want it to go away.
+
+ @param base an event_base
+ @param fd a file descriptor to monitor, or -1 for no fd.
+ @param events event(s) to monitor; can be any of EV_READ |
+ EV_WRITE, or EV_TIMEOUT
+ @param callback callback function to be invoked when the event occurs
+ @param arg an argument to be passed to the callback function
+ @param timeout the maximum amount of time to wait for the event. NULL
+ makes an EV_READ/EV_WRITE event make forever; NULL makes an
+ EV_TIMEOUT event succees immediately.
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_once(struct event_base *, evutil_socket_t, short, event_callback_fn, void *, const struct timeval *);
+
+/**
+ Add an event to the set of pending events.
+
+ The function event_add() schedules the execution of the event 'ev' when the
+ condition specified by event_assign() or event_new() occurs, or when the time
+ specified in timeout has elapesed. If atimeout is NULL, no timeout
+ occurs and the function will only be
+ called if a matching event occurs. The event in the
+ ev argument must be already initialized by event_assign() or event_new()
+ and may not be used
+ in calls to event_assign() until it is no longer pending.
+
+ If the event in the ev argument already has a scheduled timeout, calling
+ event_add() replaces the old timeout with the new one if tv is non-NULL.
+
+ @param ev an event struct initialized via event_assign() or event_new()
+ @param timeout the maximum amount of time to wait for the event, or NULL
+ to wait forever
+ @return 0 if successful, or -1 if an error occurred
+ @see event_del(), event_assign(), event_new()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_add(struct event *ev, const struct timeval *timeout);
+
+/**
+ Remove a timer from a pending event without removing the event itself.
+
+ If the event has a scheduled timeout, this function unschedules it but
+ leaves the event otherwise pending.
+
+ @param ev an event struct initialized via event_assign() or event_new()
+ @return 0 on success, or -1 if an error occurrect.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_remove_timer(struct event *ev);
+
+/**
+ Remove an event from the set of monitored events.
+
+ The function event_del() will cancel the event in the argument ev. If the
+ event has already executed or has never been added the call will have no
+ effect.
+
+ @param ev an event struct to be removed from the working set
+ @return 0 if successful, or -1 if an error occurred
+ @see event_add()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del(struct event *);
+
+/**
+ As event_del(), but never blocks while the event's callback is running
+ in another thread, even if the event was constructed without the
+ EV_FINALIZE flag.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del_noblock(struct event *ev);
+/**
+ As event_del(), but always blocks while the event's callback is running
+ in another thread, even if the event was constructed with the
+ EV_FINALIZE flag.
+
+ THIS IS AN EXPERIMENTAL API. IT MIGHT CHANGE BEFORE THE LIBEVENT 2.1 SERIES
+ BECOMES STABLE.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del_block(struct event *ev);
+
+/**
+ Make an event active.
+
+ You can use this function on a pending or a non-pending event to make it
+ active, so that its callback will be run by event_base_dispatch() or
+ event_base_loop().
+
+ One common use in multithreaded programs is to wake the thread running
+ event_base_loop() from another thread.
+
+ @param ev an event to make active.
+ @param res a set of flags to pass to the event's callback.
+ @param ncalls an obsolete argument: this is ignored.
+ **/
+EVENT2_EXPORT_SYMBOL
+void event_active(struct event *ev, int res, short ncalls);
+
+/**
+ Checks if a specific event is pending or scheduled.
+
+ @param ev an event struct previously passed to event_add()
+ @param events the requested event type; any of EV_TIMEOUT|EV_READ|
+ EV_WRITE|EV_SIGNAL
+ @param tv if this field is not NULL, and the event has a timeout,
+ this field is set to hold the time at which the timeout will
+ expire.
+
+ @return true if the event is pending on any of the events in 'what', (that
+ is to say, it has been added), or 0 if the event is not added.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_pending(const struct event *ev, short events, struct timeval *tv);
+
+/**
+ If called from within the callback for an event, returns that event.
+
+ The behavior of this function is not defined when called from outside the
+ callback function for an event.
+ */
+EVENT2_EXPORT_SYMBOL
+struct event *event_base_get_running_event(struct event_base *base);
+
+/**
+ Test if an event structure might be initialized.
+
+ The event_initialized() function can be used to check if an event has been
+ initialized.
+
+ Warning: This function is only useful for distinguishing a a zeroed-out
+ piece of memory from an initialized event, it can easily be confused by
+ uninitialized memory. Thus, it should ONLY be used to distinguish an
+ initialized event from zero.
+
+ @param ev an event structure to be tested
+ @return 1 if the structure might be initialized, or 0 if it has not been
+ initialized
+ */
+EVENT2_EXPORT_SYMBOL
+int event_initialized(const struct event *ev);
+
+/**
+ Get the signal number assigned to a signal event
+*/
+#define event_get_signal(ev) ((int)event_get_fd(ev))
+
+/**
+ Get the socket or signal assigned to an event, or -1 if the event has
+ no socket.
+*/
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t event_get_fd(const struct event *ev);
+
+/**
+ Get the event_base associated with an event.
+*/
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_get_base(const struct event *ev);
+
+/**
+ Return the events (EV_READ, EV_WRITE, etc) assigned to an event.
+*/
+EVENT2_EXPORT_SYMBOL
+short event_get_events(const struct event *ev);
+
+/**
+ Return the callback assigned to an event.
+*/
+EVENT2_EXPORT_SYMBOL
+event_callback_fn event_get_callback(const struct event *ev);
+
+/**
+ Return the callback argument assigned to an event.
+*/
+EVENT2_EXPORT_SYMBOL
+void *event_get_callback_arg(const struct event *ev);
+
+/**
+ Return the priority of an event.
+ @see event_priority_init(), event_get_priority()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_get_priority(const struct event *ev);
+
+/**
+ Extract _all_ of arguments given to construct a given event. The
+ event_base is copied into *base_out, the fd is copied into *fd_out, and so
+ on.
+
+ If any of the "_out" arguments is NULL, it will be ignored.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_get_assignment(const struct event *event,
+ struct event_base **base_out, evutil_socket_t *fd_out, short *events_out,
+ event_callback_fn *callback_out, void **arg_out);
+
+/**
+ Return the size of struct event that the Libevent library was compiled
+ with.
+
+ This will be NO GREATER than sizeof(struct event) if you're running with
+ the same version of Libevent that your application was built with, but
+ otherwise might not.
+
+ Note that it might be SMALLER than sizeof(struct event) if some future
+ version of Libevent adds extra padding to the end of struct event.
+ We might do this to help ensure ABI-compatibility between different
+ versions of Libevent.
+ */
+EVENT2_EXPORT_SYMBOL
+size_t event_get_struct_event_size(void);
+
+/**
+ Get the Libevent version.
+
+ Note that this will give you the version of the library that you're
+ currently linked against, not the version of the headers that you've
+ compiled against.
+
+ @return a string containing the version number of Libevent
+*/
+EVENT2_EXPORT_SYMBOL
+const char *event_get_version(void);
+
+/**
+ Return a numeric representation of Libevent's version.
+
+ Note that this will give you the version of the library that you're
+ currently linked against, not the version of the headers you've used to
+ compile.
+
+ The format uses one byte each for the major, minor, and patchlevel parts of
+ the version number. The low-order byte is unused. For example, version
+ 2.0.1-alpha has a numeric representation of 0x02000100
+*/
+EVENT2_EXPORT_SYMBOL
+ev_uint32_t event_get_version_number(void);
+
+/** As event_get_version, but gives the version of Libevent's headers. */
+#define LIBEVENT_VERSION EVENT__VERSION
+/** As event_get_version_number, but gives the version number of Libevent's
+ * headers. */
+#define LIBEVENT_VERSION_NUMBER EVENT__NUMERIC_VERSION
+
+/** Largest number of priorities that Libevent can support. */
+#define EVENT_MAX_PRIORITIES 256
+/**
+ Set the number of different event priorities
+
+ By default Libevent schedules all active events with the same priority.
+ However, some time it is desirable to process some events with a higher
+ priority than others. For that reason, Libevent supports strict priority
+ queues. Active events with a lower priority are always processed before
+ events with a higher priority.
+
+ The number of different priorities can be set initially with the
+ event_base_priority_init() function. This function should be called
+ before the first call to event_base_dispatch(). The
+ event_priority_set() function can be used to assign a priority to an
+ event. By default, Libevent assigns the middle priority to all events
+ unless their priority is explicitly set.
+
+ Note that urgent-priority events can starve less-urgent events: after
+ running all urgent-priority callbacks, Libevent checks for more urgent
+ events again, before running less-urgent events. Less-urgent events
+ will not have their callbacks run until there are no events more urgent
+ than them that want to be active.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param npriorities the maximum number of priorities
+ @return 0 if successful, or -1 if an error occurred
+ @see event_priority_set()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_priority_init(struct event_base *, int);
+
+/**
+ Get the number of different event priorities.
+
+ @param eb the event_base structure returned by event_base_new()
+ @return Number of different event priorities
+ @see event_base_priority_init()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_get_npriorities(struct event_base *eb);
+
+/**
+ Assign a priority to an event.
+
+ @param ev an event struct
+ @param priority the new priority to be assigned
+ @return 0 if successful, or -1 if an error occurred
+ @see event_priority_init(), event_get_priority()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_priority_set(struct event *, int);
+
+/**
+ Prepare an event_base to use a large number of timeouts with the same
+ duration.
+
+ Libevent's default scheduling algorithm is optimized for having a large
+ number of timeouts with their durations more or less randomly
+ distributed. But if you have a large number of timeouts that all have
+ the same duration (for example, if you have a large number of
+ connections that all have a 10-second timeout), then you can improve
+ Libevent's performance by telling Libevent about it.
+
+ To do this, call this function with the common duration. It will return a
+ pointer to a different, opaque timeout value. (Don't depend on its actual
+ contents!) When you use this timeout value in event_add(), Libevent will
+ schedule the event more efficiently.
+
+ (This optimization probably will not be worthwhile until you have thousands
+ or tens of thousands of events with the same timeout.)
+ */
+EVENT2_EXPORT_SYMBOL
+const struct timeval *event_base_init_common_timeout(struct event_base *base,
+ const struct timeval *duration);
+
+#if !defined(EVENT__DISABLE_MM_REPLACEMENT) || defined(EVENT_IN_DOXYGEN_)
+/**
+ Override the functions that Libevent uses for memory management.
+
+ Usually, Libevent uses the standard libc functions malloc, realloc, and
+ free to allocate memory. Passing replacements for those functions to
+ event_set_mem_functions() overrides this behavior.
+
+ Note that all memory returned from Libevent will be allocated by the
+ replacement functions rather than by malloc() and realloc(). Thus, if you
+ have replaced those functions, it will not be appropriate to free() memory
+ that you get from Libevent. Instead, you must use the free_fn replacement
+ that you provided.
+
+ Note also that if you are going to call this function, you should do so
+ before any call to any Libevent function that does allocation.
+ Otherwise, those funtions will allocate their memory using malloc(), but
+ then later free it using your provided free_fn.
+
+ @param malloc_fn A replacement for malloc.
+ @param realloc_fn A replacement for realloc
+ @param free_fn A replacement for free.
+ **/
+EVENT2_EXPORT_SYMBOL
+void event_set_mem_functions(
+ void *(*malloc_fn)(size_t sz),
+ void *(*realloc_fn)(void *ptr, size_t sz),
+ void (*free_fn)(void *ptr));
+/** This definition is present if Libevent was built with support for
+ event_set_mem_functions() */
+#define EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
+#endif
+
+/**
+ Writes a human-readable description of all inserted and/or active
+ events to a provided stdio stream.
+
+ This is intended for debugging; its format is not guaranteed to be the same
+ between libevent versions.
+
+ @param base An event_base on which to scan the events.
+ @param output A stdio file to write on.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_dump_events(struct event_base *, FILE *);
+
+
+/**
+ Activates all pending events for the given fd and event mask.
+
+ This function activates pending events only. Events which have not been
+ added will not become active.
+
+ @param base the event_base on which to activate the events.
+ @param fd An fd to active events on.
+ @param events One or more of EV_{READ,WRITE}.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events);
+
+/**
+ Activates all pending signals with a given signal number
+
+ This function activates pending events only. Events which have not been
+ added will not become active.
+
+ @param base the event_base on which to activate the events.
+ @param fd The signal to active events on.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_active_by_signal(struct event_base *base, int sig);
+
+/**
+ * Callback for iterating events in an event base via event_base_foreach_event
+ */
+typedef int (*event_base_foreach_event_cb)(const struct event_base *, const struct event *, void *);
+
+/**
+ Iterate over all added or active events events in an event loop, and invoke
+ a given callback on each one.
+
+ The callback must not call any function that modifies the event base, that
+ modifies any event in the event base, or that adds or removes any event to
+ the event base. Doing so is unsupported and will lead to undefined
+ behavior -- likely, to crashes.
+
+ event_base_foreach_event() holds a lock on the event_base() for the whole
+ time it's running: slow callbacks are not advisable.
+
+ Note that Libevent adds some events of its own to make pieces of its
+ functionality work. You must not assume that the only events you'll
+ encounter will be the ones you added yourself.
+
+ The callback function must return 0 to continue iteration, or some other
+ integer to stop iterating.
+
+ @param base An event_base on which to scan the events.
+ @param fn A callback function to receive the events.
+ @param arg An argument passed to the callback function.
+ @return 0 if we iterated over every event, or the value returned by the
+ callback function if the loop exited early.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_foreach_event(struct event_base *base, event_base_foreach_event_cb fn, void *arg);
+
+
+/** Sets 'tv' to the current time (as returned by gettimeofday()),
+ looking at the cached value in 'base' if possible, and calling
+ gettimeofday() or clock_gettime() as appropriate if there is no
+ cached time.
+
+ Generally, this value will only be cached while actually
+ processing event callbacks, and may be very inaccuate if your
+ callbacks take a long time to execute.
+
+ Returns 0 on success, negative on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_gettimeofday_cached(struct event_base *base,
+ struct timeval *tv);
+
+/** Update cached_tv in the 'base' to the current time
+ *
+ * You can use this function is useful for selectively increasing
+ * the accuracy of the cached time value in 'base' during callbacks
+ * that take a long time to execute.
+ *
+ * This function has no effect if the base is currently not in its
+ * event loop, or if timeval caching is disabled via
+ * EVENT_BASE_FLAG_NO_CACHE_TIME.
+ *
+ * @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_update_cache_time(struct event_base *base);
+
+/** Release up all globally-allocated resources allocated by Libevent.
+
+ This function does not free developer-controlled resources like
+ event_bases, events, bufferevents, listeners, and so on. It only releases
+ resources like global locks that there is no other way to free.
+
+ It is not actually necessary to call this function before exit: every
+ resource that it frees would be released anyway on exit. It mainly exists
+ so that resource-leak debugging tools don't see Libevent as holding
+ resources at exit.
+
+ You should only call this function when no other Libevent functions will
+ be invoked -- e.g., when cleanly exiting a program.
+ */
+EVENT2_EXPORT_SYMBOL
+void libevent_global_shutdown(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/event_compat.h b/sntp/libevent/include/event2/event_compat.h
new file mode 100644
index 0000000..5110175
--- /dev/null
+++ b/sntp/libevent/include/event2/event_compat.h
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_EVENT_COMPAT_H_INCLUDED_
+#define EVENT2_EVENT_COMPAT_H_INCLUDED_
+
+/** @file event2/event_compat.h
+
+ Potentially non-threadsafe versions of the functions in event.h: provided
+ only for backwards compatibility.
+
+ In the oldest versions of Libevent, event_base was not a first-class
+ structure. Instead, there was a single event base that every function
+ manipulated. Later, when separate event bases were added, the old functions
+ that didn't take an event_base argument needed to work by manipulating the
+ "current" event base. This could lead to thread-safety issues, and obscure,
+ hard-to-diagnose bugs.
+
+ @deprecated All functions in this file are by definition deprecated.
+ */
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ Initialize the event API.
+
+ The event API needs to be initialized with event_init() before it can be
+ used. Sets the global current base that gets used for events that have no
+ base associated with them.
+
+ @deprecated This function is deprecated because it replaces the "current"
+ event_base, and is totally unsafe for multithreaded use. The replacement
+ is event_base_new().
+
+ @see event_base_set(), event_base_new()
+ */
+EVENT2_EXPORT_SYMBOL
+struct event_base *event_init(void);
+
+/**
+ Loop to process events.
+
+ Like event_base_dispatch(), but uses the "current" base.
+
+ @deprecated This function is deprecated because it is easily confused by
+ multiple calls to event_init(), and because it is not safe for
+ multithreaded use. The replacement is event_base_dispatch().
+
+ @see event_base_dispatch(), event_init()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_dispatch(void);
+
+/**
+ Handle events.
+
+ This function behaves like event_base_loop(), but uses the "current" base
+
+ @deprecated This function is deprecated because it uses the event base from
+ the last call to event_init, and is therefore not safe for multithreaded
+ use. The replacement is event_base_loop().
+
+ @see event_base_loop(), event_init()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_loop(int);
+
+
+/**
+ Exit the event loop after the specified time.
+
+ This function behaves like event_base_loopexit(), except that it uses the
+ "current" base.
+
+ @deprecated This function is deprecated because it uses the event base from
+ the last call to event_init, and is therefore not safe for multithreaded
+ use. The replacement is event_base_loopexit().
+
+ @see event_init, event_base_loopexit()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_loopexit(const struct timeval *);
+
+
+/**
+ Abort the active event_loop() immediately.
+
+ This function behaves like event_base_loopbreakt(), except that it uses the
+ "current" base.
+
+ @deprecated This function is deprecated because it uses the event base from
+ the last call to event_init, and is therefore not safe for multithreaded
+ use. The replacement is event_base_loopbreak().
+
+ @see event_base_loopbreak(), event_init()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_loopbreak(void);
+
+/**
+ Schedule a one-time event to occur.
+
+ @deprecated This function is obsolete, and has been replaced by
+ event_base_once(). Its use is deprecated because it relies on the
+ "current" base configured by event_init().
+
+ @see event_base_once()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_once(evutil_socket_t , short,
+ void (*)(evutil_socket_t, short, void *), void *, const struct timeval *);
+
+
+/**
+ Get the kernel event notification mechanism used by Libevent.
+
+ @deprecated This function is obsolete, and has been replaced by
+ event_base_get_method(). Its use is deprecated because it relies on the
+ "current" base configured by event_init().
+
+ @see event_base_get_method()
+ */
+EVENT2_EXPORT_SYMBOL
+const char *event_get_method(void);
+
+
+/**
+ Set the number of different event priorities.
+
+ @deprecated This function is deprecated because it is easily confused by
+ multiple calls to event_init(), and because it is not safe for
+ multithreaded use. The replacement is event_base_priority_init().
+
+ @see event_base_priority_init()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_priority_init(int);
+
+/**
+ Prepare an event structure to be added.
+
+ @deprecated event_set() is not recommended for new code, because it requires
+ a subsequent call to event_base_set() to be safe under most circumstances.
+ Use event_assign() or event_new() instead.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_set(struct event *, evutil_socket_t, short, void (*)(evutil_socket_t, short, void *), void *);
+
+#define evtimer_set(ev, cb, arg) event_set((ev), -1, 0, (cb), (arg))
+#define evsignal_set(ev, x, cb, arg) \
+ event_set((ev), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
+
+
+/**
+ @name timeout_* macros
+
+ @deprecated These macros are deprecated because their naming is inconsistent
+ with the rest of Libevent. Use the evtimer_* macros instead.
+ @{
+ */
+#define timeout_add(ev, tv) event_add((ev), (tv))
+#define timeout_set(ev, cb, arg) event_set((ev), -1, 0, (cb), (arg))
+#define timeout_del(ev) event_del(ev)
+#define timeout_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv))
+#define timeout_initialized(ev) event_initialized(ev)
+/**@}*/
+
+/**
+ @name signal_* macros
+
+ @deprecated These macros are deprecated because their naming is inconsistent
+ with the rest of Libevent. Use the evsignal_* macros instead.
+ @{
+ */
+#define signal_add(ev, tv) event_add((ev), (tv))
+#define signal_set(ev, x, cb, arg) \
+ event_set((ev), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
+#define signal_del(ev) event_del(ev)
+#define signal_pending(ev, tv) event_pending((ev), EV_SIGNAL, (tv))
+#define signal_initialized(ev) event_initialized(ev)
+/**@}*/
+
+#ifndef EVENT_FD
+/* These macros are obsolete; use event_get_fd and event_get_signal instead. */
+#define EVENT_FD(ev) ((int)event_get_fd(ev))
+#define EVENT_SIGNAL(ev) event_get_signal(ev)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/event_struct.h b/sntp/libevent/include/event2/event_struct.h
new file mode 100644
index 0000000..1c8b71b
--- /dev/null
+++ b/sntp/libevent/include/event2/event_struct.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_EVENT_STRUCT_H_INCLUDED_
+#define EVENT2_EVENT_STRUCT_H_INCLUDED_
+
+/** @file event2/event_struct.h
+
+ Structures used by event.h. Using these structures directly WILL harm
+ forward compatibility: be careful.
+
+ No field declared in this file should be used directly in user code. Except
+ for historical reasons, these fields would not be exposed at all.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/* For evkeyvalq */
+#include <event2/keyvalq_struct.h>
+
+#define EVLIST_TIMEOUT 0x01
+#define EVLIST_INSERTED 0x02
+#define EVLIST_SIGNAL 0x04
+#define EVLIST_ACTIVE 0x08
+#define EVLIST_INTERNAL 0x10
+#define EVLIST_ACTIVE_LATER 0x20
+#define EVLIST_FINALIZING 0x40
+#define EVLIST_INIT 0x80
+
+#define EVLIST_ALL 0xff
+
+/* Fix so that people don't have to run with <sys/queue.h> */
+#ifndef TAILQ_ENTRY
+#define EVENT_DEFINED_TQENTRY_
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+#endif /* !TAILQ_ENTRY */
+
+#ifndef TAILQ_HEAD
+#define EVENT_DEFINED_TQHEAD_
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; \
+ struct type **tqh_last; \
+}
+#endif
+
+/* Fix so that people don't have to run with <sys/queue.h> */
+#ifndef LIST_ENTRY
+#define EVENT_DEFINED_LISTENTRY_
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+#endif /* !LIST_ENTRY */
+
+#ifndef LIST_HEAD
+#define EVENT_DEFINED_LISTHEAD_
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+ }
+#endif /* !LIST_HEAD */
+
+struct event;
+
+struct event_callback {
+ TAILQ_ENTRY(event_callback) evcb_active_next;
+ short evcb_flags;
+ ev_uint8_t evcb_pri; /* smaller numbers are higher priority */
+ ev_uint8_t evcb_closure;
+ /* allows us to adopt for different types of events */
+ union {
+ void (*evcb_callback)(evutil_socket_t, short, void *);
+ void (*evcb_selfcb)(struct event_callback *, void *);
+ void (*evcb_evfinalize)(struct event *, void *);
+ void (*evcb_cbfinalize)(struct event_callback *, void *);
+ } evcb_cb_union;
+ void *evcb_arg;
+};
+
+struct event_base;
+struct event {
+ struct event_callback ev_evcallback;
+
+ /* for managing timeouts */
+ union {
+ TAILQ_ENTRY(event) ev_next_with_common_timeout;
+ int min_heap_idx;
+ } ev_timeout_pos;
+ evutil_socket_t ev_fd;
+
+ struct event_base *ev_base;
+
+ union {
+ /* used for io events */
+ struct {
+ LIST_ENTRY (event) ev_io_next;
+ struct timeval ev_timeout;
+ } ev_io;
+
+ /* used by signal events */
+ struct {
+ LIST_ENTRY (event) ev_signal_next;
+ short ev_ncalls;
+ /* Allows deletes in callback */
+ short *ev_pncalls;
+ } ev_signal;
+ } ev_;
+
+ short ev_events;
+ short ev_res; /* result passed to event callback */
+ struct timeval ev_timeout;
+};
+
+TAILQ_HEAD (event_list, event);
+
+#ifdef EVENT_DEFINED_TQENTRY_
+#undef TAILQ_ENTRY
+#endif
+
+#ifdef EVENT_DEFINED_TQHEAD_
+#undef TAILQ_HEAD
+#endif
+
+LIST_HEAD (event_dlist, event);
+
+#ifdef EVENT_DEFINED_LISTENTRY_
+#undef LIST_ENTRY
+#endif
+
+#ifdef EVENT_DEFINED_LISTHEAD_
+#undef LIST_HEAD
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_STRUCT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/http.h b/sntp/libevent/include/event2/http.h
new file mode 100644
index 0000000..81f44b8
--- /dev/null
+++ b/sntp/libevent/include/event2/http.h
@@ -0,0 +1,1140 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_HTTP_H_INCLUDED_
+#define EVENT2_HTTP_H_INCLUDED_
+
+/* For int types. */
+#include <event2/util.h>
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* In case we haven't included the right headers yet. */
+struct evbuffer;
+struct event_base;
+struct bufferevent;
+struct evhttp_connection;
+
+/** @file event2/http.h
+ *
+ * Basic support for HTTP serving.
+ *
+ * As Libevent is a library for dealing with event notification and most
+ * interesting applications are networked today, I have often found the
+ * need to write HTTP code. The following prototypes and definitions provide
+ * an application with a minimal interface for making HTTP requests and for
+ * creating a very simple HTTP server.
+ */
+
+/* Response codes */
+#define HTTP_OK 200 /**< request completed ok */
+#define HTTP_NOCONTENT 204 /**< request does not have content */
+#define HTTP_MOVEPERM 301 /**< the uri moved permanently */
+#define HTTP_MOVETEMP 302 /**< the uri moved temporarily */
+#define HTTP_NOTMODIFIED 304 /**< page was not modified from last */
+#define HTTP_BADREQUEST 400 /**< invalid http request was made */
+#define HTTP_NOTFOUND 404 /**< could not find content for uri */
+#define HTTP_BADMETHOD 405 /**< method not allowed for this uri */
+#define HTTP_ENTITYTOOLARGE 413 /**< */
+#define HTTP_EXPECTATIONFAILED 417 /**< we can't handle this expectation */
+#define HTTP_INTERNAL 500 /**< internal error */
+#define HTTP_NOTIMPLEMENTED 501 /**< not implemented */
+#define HTTP_SERVUNAVAIL 503 /**< the server is not available */
+
+struct evhttp;
+struct evhttp_request;
+struct evkeyvalq;
+struct evhttp_bound_socket;
+struct evconnlistener;
+struct evdns_base;
+
+/**
+ * Create a new HTTP server.
+ *
+ * @param base (optional) the event base to receive the HTTP events
+ * @return a pointer to a newly initialized evhttp server structure
+ * @see evhttp_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp *evhttp_new(struct event_base *base);
+
+/**
+ * Binds an HTTP server on the specified address and port.
+ *
+ * Can be called multiple times to bind the same http server
+ * to multiple different ports.
+ *
+ * @param http a pointer to an evhttp object
+ * @param address a string containing the IP address to listen(2) on
+ * @param port the port number to listen on
+ * @return 0 on success, -1 on failure.
+ * @see evhttp_accept_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port);
+
+/**
+ * Like evhttp_bind_socket(), but returns a handle for referencing the socket.
+ *
+ * The returned pointer is not valid after \a http is freed.
+ *
+ * @param http a pointer to an evhttp object
+ * @param address a string containing the IP address to listen(2) on
+ * @param port the port number to listen on
+ * @return Handle for the socket on success, NULL on failure.
+ * @see evhttp_bind_socket(), evhttp_del_accept_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_bound_socket *evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port);
+
+/**
+ * Makes an HTTP server accept connections on the specified socket.
+ *
+ * This may be useful to create a socket and then fork multiple instances
+ * of an http server, or when a socket has been communicated via file
+ * descriptor passing in situations where an http servers does not have
+ * permissions to bind to a low-numbered port.
+ *
+ * Can be called multiple times to have the http server listen to
+ * multiple different sockets.
+ *
+ * @param http a pointer to an evhttp object
+ * @param fd a socket fd that is ready for accepting connections
+ * @return 0 on success, -1 on failure.
+ * @see evhttp_bind_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd);
+
+/**
+ * Like evhttp_accept_socket(), but returns a handle for referencing the socket.
+ *
+ * The returned pointer is not valid after \a http is freed.
+ *
+ * @param http a pointer to an evhttp object
+ * @param fd a socket fd that is ready for accepting connections
+ * @return Handle for the socket on success, NULL on failure.
+ * @see evhttp_accept_socket(), evhttp_del_accept_socket()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_bound_socket *evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd);
+
+/**
+ * The most low-level evhttp_bind/accept method: takes an evconnlistener, and
+ * returns an evhttp_bound_socket. The listener will be freed when the bound
+ * socket is freed.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_bound_socket *evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener);
+
+/**
+ * Return the listener used to implement a bound socket.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evconnlistener *evhttp_bound_socket_get_listener(struct evhttp_bound_socket *bound);
+
+typedef void evhttp_bound_socket_foreach_fn(struct evhttp_bound_socket *, void *);
+/**
+ * Applies the function specified in the first argument to all
+ * evhttp_bound_sockets associated with "http". The user must not
+ * attempt to free or remove any connections, sockets or listeners
+ * in the callback "function".
+ *
+ * @param http pointer to an evhttp object
+ * @param function function to apply to every bound socket
+ * @param argument pointer value passed to function for every socket iterated
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_foreach_bound_socket(struct evhttp *http, evhttp_bound_socket_foreach_fn *function, void *argument);
+
+/**
+ * Makes an HTTP server stop accepting connections on the specified socket
+ *
+ * This may be useful when a socket has been sent via file descriptor passing
+ * and is no longer needed by the current process.
+ *
+ * If you created this bound socket with evhttp_bind_socket_with_handle or
+ * evhttp_accept_socket_with_handle, this function closes the fd you provided.
+ * If you created this bound socket with evhttp_bind_listener, this function
+ * frees the listener you provided.
+ *
+ * \a bound_socket is an invalid pointer after this call returns.
+ *
+ * @param http a pointer to an evhttp object
+ * @param bound_socket a handle returned by evhttp_{bind,accept}_socket_with_handle
+ * @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound_socket);
+
+/**
+ * Get the raw file descriptor referenced by an evhttp_bound_socket.
+ *
+ * @param bound_socket a handle returned by evhttp_{bind,accept}_socket_with_handle
+ * @return the file descriptor used by the bound socket
+ * @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
+ */
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound_socket);
+
+/**
+ * Free the previously created HTTP server.
+ *
+ * Works only if no requests are currently being served.
+ *
+ * @param http the evhttp server object to be freed
+ * @see evhttp_start()
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_free(struct evhttp* http);
+
+/** XXX Document. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size);
+/** XXX Document. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size);
+
+/**
+ Set the value to use for the Content-Type header when none was provided. If
+ the content type string is NULL, the Content-Type header will not be
+ automatically added.
+
+ @param http the http server on which to set the default content type
+ @param content_type the value for the Content-Type header
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_default_content_type(struct evhttp *http,
+ const char *content_type);
+
+/**
+ Sets the what HTTP methods are supported in requests accepted by this
+ server, and passed to user callbacks.
+
+ If not supported they will generate a "405 Method not allowed" response.
+
+ By default this includes the following methods: GET, POST, HEAD, PUT, DELETE
+
+ @param http the http server on which to set the methods
+ @param methods bit mask constructed from evhttp_cmd_type values
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods);
+
+/**
+ Set a callback for a specified URI
+
+ @param http the http sever on which to set the callback
+ @param path the path for which to invoke the callback
+ @param cb the callback function that gets invoked on requesting path
+ @param cb_arg an additional context argument for the callback
+ @return 0 on success, -1 if the callback existed already, -2 on failure
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_set_cb(struct evhttp *http, const char *path,
+ void (*cb)(struct evhttp_request *, void *), void *cb_arg);
+
+/** Removes the callback for a specified URI */
+EVENT2_EXPORT_SYMBOL
+int evhttp_del_cb(struct evhttp *, const char *);
+
+/**
+ Set a callback for all requests that are not caught by specific callbacks
+
+ Invokes the specified callback for all requests that do not match any of
+ the previously specified request paths. This is catchall for requests not
+ specifically configured with evhttp_set_cb().
+
+ @param http the evhttp server object for which to set the callback
+ @param cb the callback to invoke for any unmatched requests
+ @param arg an context argument for the callback
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_gencb(struct evhttp *http,
+ void (*cb)(struct evhttp_request *, void *), void *arg);
+
+/**
+ Set a callback used to create new bufferevents for connections
+ to a given evhttp object.
+
+ You can use this to override the default bufferevent type -- for example,
+ to make this evhttp object use SSL bufferevents rather than unencrypted
+ ones.
+
+ New bufferevents must be allocated with no fd set on them.
+
+ @param http the evhttp server object for which to set the callback
+ @param cb the callback to invoke for incoming connections
+ @param arg an context argument for the callback
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_bevcb(struct evhttp *http,
+ struct bufferevent *(*cb)(struct event_base *, void *), void *arg);
+
+/**
+ Adds a virtual host to the http server.
+
+ A virtual host is a newly initialized evhttp object that has request
+ callbacks set on it via evhttp_set_cb() or evhttp_set_gencb(). It
+ most not have any listing sockets associated with it.
+
+ If the virtual host has not been removed by the time that evhttp_free()
+ is called on the main http server, it will be automatically freed, too.
+
+ It is possible to have hierarchical vhosts. For example: A vhost
+ with the pattern *.example.com may have other vhosts with patterns
+ foo.example.com and bar.example.com associated with it.
+
+ @param http the evhttp object to which to add a virtual host
+ @param pattern the glob pattern against which the hostname is matched.
+ The match is case insensitive and follows otherwise regular shell
+ matching.
+ @param vhost the virtual host to add the regular http server.
+ @return 0 on success, -1 on failure
+ @see evhttp_remove_virtual_host()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_add_virtual_host(struct evhttp* http, const char *pattern,
+ struct evhttp* vhost);
+
+/**
+ Removes a virtual host from the http server.
+
+ @param http the evhttp object from which to remove the virtual host
+ @param vhost the virtual host to remove from the regular http server.
+ @return 0 on success, -1 on failure
+ @see evhttp_add_virtual_host()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost);
+
+/**
+ Add a server alias to an http object. The http object can be a virtual
+ host or the main server.
+
+ @param http the evhttp object
+ @param alias the alias to add
+ @see evhttp_add_remove_alias()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_add_server_alias(struct evhttp *http, const char *alias);
+
+/**
+ Remove a server alias from an http object.
+
+ @param http the evhttp object
+ @param alias the alias to remove
+ @see evhttp_add_server_alias()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_remove_server_alias(struct evhttp *http, const char *alias);
+
+/**
+ * Set the timeout for an HTTP request.
+ *
+ * @param http an evhttp object
+ * @param timeout_in_secs the timeout, in seconds
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_timeout(struct evhttp *http, int timeout_in_secs);
+
+/**
+ * Set the timeout for an HTTP request.
+ *
+ * @param http an evhttp object
+ * @param tv the timeout, or NULL
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_timeout_tv(struct evhttp *http, const struct timeval* tv);
+
+/* Request/Response functionality */
+
+/**
+ * Send an HTML error message to the client.
+ *
+ * @param req a request object
+ * @param error the HTTP error code
+ * @param reason a brief explanation of the error. If this is NULL, we'll
+ * just use the standard meaning of the error code.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_error(struct evhttp_request *req, int error,
+ const char *reason);
+
+/**
+ * Send an HTML reply to the client.
+ *
+ * The body of the reply consists of the data in databuf. After calling
+ * evhttp_send_reply() databuf will be empty, but the buffer is still
+ * owned by the caller and needs to be deallocated by the caller if
+ * necessary.
+ *
+ * @param req a request object
+ * @param code the HTTP response code to send
+ * @param reason a brief message to send with the response code
+ * @param databuf the body of the response
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply(struct evhttp_request *req, int code,
+ const char *reason, struct evbuffer *databuf);
+
+/* Low-level response interface, for streaming/chunked replies */
+
+/**
+ Initiate a reply that uses Transfer-Encoding chunked.
+
+ This allows the caller to stream the reply back to the client and is
+ useful when either not all of the reply data is immediately available
+ or when sending very large replies.
+
+ The caller needs to supply data chunks with evhttp_send_reply_chunk()
+ and complete the reply by calling evhttp_send_reply_end().
+
+ @param req a request object
+ @param code the HTTP response code to send
+ @param reason a brief message to send with the response code
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_start(struct evhttp_request *req, int code,
+ const char *reason);
+
+/**
+ Send another data chunk as part of an ongoing chunked reply.
+
+ The reply chunk consists of the data in databuf. After calling
+ evhttp_send_reply_chunk() databuf will be empty, but the buffer is
+ still owned by the caller and needs to be deallocated by the caller
+ if necessary.
+
+ @param req a request object
+ @param databuf the data chunk to send as part of the reply.
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_chunk(struct evhttp_request *req,
+ struct evbuffer *databuf);
+
+/**
+ Send another data chunk as part of an ongoing chunked reply.
+
+ The reply chunk consists of the data in databuf. After calling
+ evhttp_send_reply_chunk() databuf will be empty, but the buffer is
+ still owned by the caller and needs to be deallocated by the caller
+ if necessary.
+
+ @param req a request object
+ @param databuf the data chunk to send as part of the reply.
+ @param cb callback funcion
+ @param call back's argument.
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_chunk_with_cb(struct evhttp_request *, struct evbuffer *,
+ void (*cb)(struct evhttp_connection *, void *), void *arg);
+
+/**
+ Complete a chunked reply, freeing the request as appropriate.
+
+ @param req a request object
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_end(struct evhttp_request *req);
+
+/*
+ * Interfaces for making requests
+ */
+
+/** The different request types supported by evhttp. These are as specified
+ * in RFC2616, except for PATCH which is specified by RFC5789.
+ *
+ * By default, only some of these methods are accepted and passed to user
+ * callbacks; use evhttp_set_allowed_methods() to change which methods
+ * are allowed.
+ */
+enum evhttp_cmd_type {
+ EVHTTP_REQ_GET = 1 << 0,
+ EVHTTP_REQ_POST = 1 << 1,
+ EVHTTP_REQ_HEAD = 1 << 2,
+ EVHTTP_REQ_PUT = 1 << 3,
+ EVHTTP_REQ_DELETE = 1 << 4,
+ EVHTTP_REQ_OPTIONS = 1 << 5,
+ EVHTTP_REQ_TRACE = 1 << 6,
+ EVHTTP_REQ_CONNECT = 1 << 7,
+ EVHTTP_REQ_PATCH = 1 << 8
+};
+
+/** a request object can represent either a request or a reply */
+enum evhttp_request_kind { EVHTTP_REQUEST, EVHTTP_RESPONSE };
+
+/**
+ * Create and return a connection object that can be used to for making HTTP
+ * requests. The connection object tries to resolve address and establish the
+ * connection when it is given an http request object.
+ *
+ * @param base the event_base to use for handling the connection
+ * @param dnsbase the dns_base to use for resolving host names; if not
+ * specified host name resolution will block.
+ * @param bev a bufferevent to use for connecting to the server; if NULL, a
+ * socket-based bufferevent will be created. This buffrevent will be freed
+ * when the connection closes. It must have no fd set on it.
+ * @param address the address to which to connect
+ * @param port the port to connect to
+ * @return an evhttp_connection object that can be used for making requests
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_connection_base_bufferevent_new(
+ struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, const char *address, unsigned short port);
+
+/**
+ * Return the bufferevent that an evhttp_connection is using.
+ */
+EVENT2_EXPORT_SYMBOL
+struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon);
+
+/**
+ * Return the HTTP server associated with this connection, or NULL.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp *evhttp_connection_get_server(struct evhttp_connection *evcon);
+
+/**
+ * Creates a new request object that needs to be filled in with the request
+ * parameters. The callback is executed when the request completed or an
+ * error occurred.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_request *evhttp_request_new(
+ void (*cb)(struct evhttp_request *, void *), void *arg);
+
+/**
+ * Enable delivery of chunks to requestor.
+ * @param cb will be called after every read of data with the same argument
+ * as the completion callback. Will never be called on an empty
+ * response. May drain the input buffer; it will be drained
+ * automatically on return.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_chunked_cb(struct evhttp_request *,
+ void (*cb)(struct evhttp_request *, void *));
+
+/**
+ * Register callback for additional parsing of request headers.
+ * @param cb will be called after receiving and parsing the full header.
+ * It allows analyzing the header and possibly closing the connection
+ * by returning a value < 0.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_header_cb(struct evhttp_request *,
+ int (*cb)(struct evhttp_request *, void *));
+
+/**
+ * The different error types supported by evhttp
+ *
+ * @see evhttp_request_set_error_cb()
+ */
+enum evhttp_request_error {
+ /**
+ * Timeout reached, also @see evhttp_connection_set_timeout()
+ */
+ EVREQ_HTTP_TIMEOUT,
+ /**
+ * EOF reached
+ */
+ EVREQ_HTTP_EOF,
+ /**
+ * Error while reading header, or invalid header
+ */
+ EVREQ_HTTP_INVALID_HEADER,
+ /**
+ * Error encountered while reading or writing
+ */
+ EVREQ_HTTP_BUFFER_ERROR,
+ /**
+ * The evhttp_cancel_request() called on this request.
+ */
+ EVREQ_HTTP_REQUEST_CANCEL,
+ /**
+ * Body is greater then evhttp_connection_set_max_body_size()
+ */
+ EVREQ_HTTP_DATA_TOO_LONG
+};
+/**
+ * Set a callback for errors
+ * @see evhttp_request_error for error types.
+ *
+ * On error, both the error callback and the regular callback will be called,
+ * error callback is called before the regular callback.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_error_cb(struct evhttp_request *,
+ void (*)(enum evhttp_request_error, void *));
+
+/**
+ * Set a callback to be called on request completion of evhttp_send_* function.
+ *
+ * The callback function will be called on the completion of the request after
+ * the output data has been written and before the evhttp_request object
+ * is destroyed. This can be useful for tracking resources associated with a
+ * request (ex: timing metrics).
+ *
+ * @param req a request object
+ * @param cb callback function that will be called on request completion
+ * @param cb_arg an additional context argument for the callback
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_on_complete_cb(struct evhttp_request *req,
+ void (*cb)(struct evhttp_request *, void *), void *cb_arg);
+
+/** Frees the request object and removes associated events. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_free(struct evhttp_request *req);
+
+/**
+ * Create and return a connection object that can be used to for making HTTP
+ * requests. The connection object tries to resolve address and establish the
+ * connection when it is given an http request object.
+ *
+ * @param base the event_base to use for handling the connection
+ * @param dnsbase the dns_base to use for resolving host names; if not
+ * specified host name resolution will block.
+ * @param address the address to which to connect
+ * @param port the port to connect to
+ * @return an evhttp_connection object that can be used for making requests
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_connection_base_new(
+ struct event_base *base, struct evdns_base *dnsbase,
+ const char *address, unsigned short port);
+
+/** Takes ownership of the request object
+ *
+ * Can be used in a request callback to keep onto the request until
+ * evhttp_request_free() is explicitly called by the user.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_own(struct evhttp_request *req);
+
+/** Returns 1 if the request is owned by the user */
+EVENT2_EXPORT_SYMBOL
+int evhttp_request_is_owned(struct evhttp_request *req);
+
+/**
+ * Returns the connection object associated with the request or NULL
+ *
+ * The user needs to either free the request explicitly or call
+ * evhttp_send_reply_end().
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_request_get_connection(struct evhttp_request *req);
+
+/**
+ * Returns the underlying event_base for this connection
+ */
+EVENT2_EXPORT_SYMBOL
+struct event_base *evhttp_connection_get_base(struct evhttp_connection *req);
+
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_max_headers_size(struct evhttp_connection *evcon,
+ ev_ssize_t new_max_headers_size);
+
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_max_body_size(struct evhttp_connection* evcon,
+ ev_ssize_t new_max_body_size);
+
+/** Frees an http connection */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_free(struct evhttp_connection *evcon);
+
+/** sets the ip address from which http connections are made */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_local_address(struct evhttp_connection *evcon,
+ const char *address);
+
+/** sets the local port from which http connections are made */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_local_port(struct evhttp_connection *evcon,
+ ev_uint16_t port);
+
+/** Sets the timeout in seconds for events related to this connection */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_timeout(struct evhttp_connection *evcon,
+ int timeout_in_secs);
+
+/** Sets the timeout for events related to this connection. Takes a struct
+ * timeval. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_timeout_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv);
+
+/** Sets the delay before retrying requests on this connection. This is only
+ * used if evhttp_connection_set_retries is used to make the number of retries
+ * at least one. Each retry after the first is twice as long as the one before
+ * it. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_initial_retry_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv);
+
+/** Sets the retry limit for this connection - -1 repeats indefinitely */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_retries(struct evhttp_connection *evcon,
+ int retry_max);
+
+/** Set a callback for connection close. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_closecb(struct evhttp_connection *evcon,
+ void (*)(struct evhttp_connection *, void *), void *);
+
+/** Get the remote address and port associated with this connection. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_get_peer(struct evhttp_connection *evcon,
+ char **address, ev_uint16_t *port);
+
+/** Get the remote address associated with this connection.
+ * extracted from getpeername().
+ *
+ * @return NULL if getpeername() return non success,
+ * or connection is not connected,
+ * otherwise it return pointer to struct sockaddr_storage */
+EVENT2_EXPORT_SYMBOL
+const struct sockaddr*
+evhttp_connection_get_addr(struct evhttp_connection *evcon);
+
+/**
+ Make an HTTP request over the specified connection.
+
+ The connection gets ownership of the request. On failure, the
+ request object is no longer valid as it has been freed.
+
+ @param evcon the evhttp_connection object over which to send the request
+ @param req the previously created and configured request object
+ @param type the request type EVHTTP_REQ_GET, EVHTTP_REQ_POST, etc.
+ @param uri the URI associated with the request
+ @return 0 on success, -1 on failure
+ @see evhttp_cancel_request()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_make_request(struct evhttp_connection *evcon,
+ struct evhttp_request *req,
+ enum evhttp_cmd_type type, const char *uri);
+
+/**
+ Cancels a pending HTTP request.
+
+ Cancels an ongoing HTTP request. The callback associated with this request
+ is not executed and the request object is freed. If the request is
+ currently being processed, e.g. it is ongoing, the corresponding
+ evhttp_connection object is going to get reset.
+
+ A request cannot be canceled if its callback has executed already. A request
+ may be canceled reentrantly from its chunked callback.
+
+ @param req the evhttp_request to cancel; req becomes invalid after this call.
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_cancel_request(struct evhttp_request *req);
+
+/**
+ * A structure to hold a parsed URI or Relative-Ref conforming to RFC3986.
+ */
+struct evhttp_uri;
+
+/** Returns the request URI */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_request_get_uri(const struct evhttp_request *req);
+/** Returns the request URI (parsed) */
+EVENT2_EXPORT_SYMBOL
+const struct evhttp_uri *evhttp_request_get_evhttp_uri(const struct evhttp_request *req);
+/** Returns the request command */
+EVENT2_EXPORT_SYMBOL
+enum evhttp_cmd_type evhttp_request_get_command(const struct evhttp_request *req);
+
+EVENT2_EXPORT_SYMBOL
+int evhttp_request_get_response_code(const struct evhttp_request *req);
+EVENT2_EXPORT_SYMBOL
+const char * evhttp_request_get_response_code_line(const struct evhttp_request *req);
+
+/** Returns the input headers */
+EVENT2_EXPORT_SYMBOL
+struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req);
+/** Returns the output headers */
+EVENT2_EXPORT_SYMBOL
+struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *req);
+/** Returns the input buffer */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *evhttp_request_get_input_buffer(struct evhttp_request *req);
+/** Returns the output buffer */
+EVENT2_EXPORT_SYMBOL
+struct evbuffer *evhttp_request_get_output_buffer(struct evhttp_request *req);
+/** Returns the host associated with the request. If a client sends an absolute
+ URI, the host part of that is preferred. Otherwise, the input headers are
+ searched for a Host: header. NULL is returned if no absolute URI or Host:
+ header is provided. */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_request_get_host(struct evhttp_request *req);
+
+/* Interfaces for dealing with HTTP headers */
+
+/**
+ Finds the value belonging to a header.
+
+ @param headers the evkeyvalq object in which to find the header
+ @param key the name of the header to find
+ @returns a pointer to the value for the header or NULL if the header
+ could not be found.
+ @see evhttp_add_header(), evhttp_remove_header()
+*/
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_find_header(const struct evkeyvalq *headers,
+ const char *key);
+
+/**
+ Removes a header from a list of existing headers.
+
+ @param headers the evkeyvalq object from which to remove a header
+ @param key the name of the header to remove
+ @returns 0 if the header was removed, -1 otherwise.
+ @see evhttp_find_header(), evhttp_add_header()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_remove_header(struct evkeyvalq *headers, const char *key);
+
+/**
+ Adds a header to a list of existing headers.
+
+ @param headers the evkeyvalq object to which to add a header
+ @param key the name of the header
+ @param value the value belonging to the header
+ @returns 0 on success, -1 otherwise.
+ @see evhttp_find_header(), evhttp_clear_headers()
+*/
+EVENT2_EXPORT_SYMBOL
+int evhttp_add_header(struct evkeyvalq *headers, const char *key, const char *value);
+
+/**
+ Removes all headers from the header list.
+
+ @param headers the evkeyvalq object from which to remove all headers
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_clear_headers(struct evkeyvalq *headers);
+
+/* Miscellaneous utility functions */
+
+
+/**
+ Helper function to encode a string for inclusion in a URI. All
+ characters are replaced by their hex-escaped (%22) equivalents,
+ except for characters explicitly unreserved by RFC3986 -- that is,
+ ASCII alphanumeric characters, hyphen, dot, underscore, and tilde.
+
+ The returned string must be freed by the caller.
+
+ @param str an unencoded string
+ @return a newly allocated URI-encoded string or NULL on failure
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_encode_uri(const char *str);
+
+/**
+ As evhttp_encode_uri, but if 'size' is nonnegative, treat the string
+ as being 'size' bytes long. This allows you to encode strings that
+ may contain 0-valued bytes.
+
+ The returned string must be freed by the caller.
+
+ @param str an unencoded string
+ @param size the length of the string to encode, or -1 if the string
+ is NUL-terminated
+ @param space_to_plus if true, space characters in 'str' are encoded
+ as +, not %20.
+ @return a newly allocate URI-encoded string, or NULL on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_uriencode(const char *str, ev_ssize_t size, int space_to_plus);
+
+/**
+ Helper function to sort of decode a URI-encoded string. Unlike
+ evhttp_get_decoded_uri, it decodes all plus characters that appear
+ _after_ the first question mark character, but no plusses that occur
+ before. This is not a good way to decode URIs in whole or in part.
+
+ The returned string must be freed by the caller
+
+ @deprecated This function is deprecated; you probably want to use
+ evhttp_get_decoded_uri instead.
+
+ @param uri an encoded URI
+ @return a newly allocated unencoded URI or NULL on failure
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_decode_uri(const char *uri);
+
+/**
+ Helper function to decode a URI-escaped string or HTTP parameter.
+
+ If 'decode_plus' is 1, then we decode the string as an HTTP parameter
+ value, and convert all plus ('+') characters to spaces. If
+ 'decode_plus' is 0, we leave all plus characters unchanged.
+
+ The returned string must be freed by the caller.
+
+ @param uri a URI-encode encoded URI
+ @param decode_plus determines whether we convert '+' to space.
+ @param size_out if size_out is not NULL, *size_out is set to the size of the
+ returned string
+ @return a newly allocated unencoded URI or NULL on failure
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_uridecode(const char *uri, int decode_plus,
+ size_t *size_out);
+
+/**
+ Helper function to parse out arguments in a query.
+
+ Parsing a URI like
+
+ http://foo.com/?q=test&s=some+thing
+
+ will result in two entries in the key value queue.
+
+ The first entry is: key="q", value="test"
+ The second entry is: key="s", value="some thing"
+
+ @deprecated This function is deprecated as of Libevent 2.0.9. Use
+ evhttp_uri_parse and evhttp_parse_query_str instead.
+
+ @param uri the request URI
+ @param headers the head of the evkeyval queue
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_parse_query(const char *uri, struct evkeyvalq *headers);
+
+/**
+ Helper function to parse out arguments from the query portion of an
+ HTTP URI.
+
+ Parsing a query string like
+
+ q=test&s=some+thing
+
+ will result in two entries in the key value queue.
+
+ The first entry is: key="q", value="test"
+ The second entry is: key="s", value="some thing"
+
+ @param query_parse the query portion of the URI
+ @param headers the head of the evkeyval queue
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_parse_query_str(const char *uri, struct evkeyvalq *headers);
+
+/**
+ * Escape HTML character entities in a string.
+ *
+ * Replaces <, >, ", ' and & with &lt;, &gt;, &quot;,
+ * &#039; and &amp; correspondingly.
+ *
+ * The returned string needs to be freed by the caller.
+ *
+ * @param html an unescaped HTML string
+ * @return an escaped HTML string or NULL on error
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_htmlescape(const char *html);
+
+/**
+ * Return a new empty evhttp_uri with no fields set.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_uri *evhttp_uri_new(void);
+
+/**
+ * Changes the flags set on a given URI. See EVHTTP_URI_* for
+ * a list of flags.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evhttp_uri_set_flags(struct evhttp_uri *uri, unsigned flags);
+
+/** Return the scheme of an evhttp_uri, or NULL if there is no scheme has
+ * been set and the evhttp_uri contains a Relative-Ref. */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_scheme(const struct evhttp_uri *uri);
+/**
+ * Return the userinfo part of an evhttp_uri, or NULL if it has no userinfo
+ * set.
+ */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_userinfo(const struct evhttp_uri *uri);
+/**
+ * Return the host part of an evhttp_uri, or NULL if it has no host set.
+ * The host may either be a regular hostname (conforming to the RFC 3986
+ * "regname" production), or an IPv4 address, or the empty string, or a
+ * bracketed IPv6 address, or a bracketed 'IP-Future' address.
+ *
+ * Note that having a NULL host means that the URI has no authority
+ * section, but having an empty-string host means that the URI has an
+ * authority section with no host part. For example,
+ * "mailto:user@example.com" has a host of NULL, but "file:///etc/motd"
+ * has a host of "".
+ */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_host(const struct evhttp_uri *uri);
+/** Return the port part of an evhttp_uri, or -1 if there is no port set. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_get_port(const struct evhttp_uri *uri);
+/** Return the path part of an evhttp_uri, or NULL if it has no path set */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_path(const struct evhttp_uri *uri);
+/** Return the query part of an evhttp_uri (excluding the leading "?"), or
+ * NULL if it has no query set */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_query(const struct evhttp_uri *uri);
+/** Return the fragment part of an evhttp_uri (excluding the leading "#"),
+ * or NULL if it has no fragment set */
+EVENT2_EXPORT_SYMBOL
+const char *evhttp_uri_get_fragment(const struct evhttp_uri *uri);
+
+/** Set the scheme of an evhttp_uri, or clear the scheme if scheme==NULL.
+ * Returns 0 on success, -1 if scheme is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_scheme(struct evhttp_uri *uri, const char *scheme);
+/** Set the userinfo of an evhttp_uri, or clear the userinfo if userinfo==NULL.
+ * Returns 0 on success, -1 if userinfo is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_userinfo(struct evhttp_uri *uri, const char *userinfo);
+/** Set the host of an evhttp_uri, or clear the host if host==NULL.
+ * Returns 0 on success, -1 if host is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_host(struct evhttp_uri *uri, const char *host);
+/** Set the port of an evhttp_uri, or clear the port if port==-1.
+ * Returns 0 on success, -1 if port is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_port(struct evhttp_uri *uri, int port);
+/** Set the path of an evhttp_uri, or clear the path if path==NULL.
+ * Returns 0 on success, -1 if path is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_path(struct evhttp_uri *uri, const char *path);
+/** Set the query of an evhttp_uri, or clear the query if query==NULL.
+ * The query should not include a leading "?".
+ * Returns 0 on success, -1 if query is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_query(struct evhttp_uri *uri, const char *query);
+/** Set the fragment of an evhttp_uri, or clear the fragment if fragment==NULL.
+ * The fragment should not include a leading "#".
+ * Returns 0 on success, -1 if fragment is not well-formed. */
+EVENT2_EXPORT_SYMBOL
+int evhttp_uri_set_fragment(struct evhttp_uri *uri, const char *fragment);
+
+/**
+ * Helper function to parse a URI-Reference as specified by RFC3986.
+ *
+ * This function matches the URI-Reference production from RFC3986,
+ * which includes both URIs like
+ *
+ * scheme://[[userinfo]@]foo.com[:port]]/[path][?query][#fragment]
+ *
+ * and relative-refs like
+ *
+ * [path][?query][#fragment]
+ *
+ * Any optional elements portions not present in the original URI are
+ * left set to NULL in the resulting evhttp_uri. If no port is
+ * specified, the port is set to -1.
+ *
+ * Note that no decoding is performed on percent-escaped characters in
+ * the string; if you want to parse them, use evhttp_uridecode or
+ * evhttp_parse_query_str as appropriate.
+ *
+ * Note also that most URI schemes will have additional constraints that
+ * this function does not know about, and cannot check. For example,
+ * mailto://www.example.com/cgi-bin/fortune.pl is not a reasonable
+ * mailto url, http://www.example.com:99999/ is not a reasonable HTTP
+ * URL, and ftp:username@example.com is not a reasonable FTP URL.
+ * Nevertheless, all of these URLs conform to RFC3986, and this function
+ * accepts all of them as valid.
+ *
+ * @param source_uri the request URI
+ * @param flags Zero or more EVHTTP_URI_* flags to affect the behavior
+ * of the parser.
+ * @return uri container to hold parsed data, or NULL if there is error
+ * @see evhttp_uri_free()
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_uri *evhttp_uri_parse_with_flags(const char *source_uri,
+ unsigned flags);
+
+/** Tolerate URIs that do not conform to RFC3986.
+ *
+ * Unfortunately, some HTTP clients generate URIs that, according to RFC3986,
+ * are not conformant URIs. If you need to support these URIs, you can
+ * do so by passing this flag to evhttp_uri_parse_with_flags.
+ *
+ * Currently, these changes are:
+ * <ul>
+ * <li> Nonconformant URIs are allowed to contain otherwise unreasonable
+ * characters in their path, query, and fragment components.
+ * </ul>
+ */
+#define EVHTTP_URI_NONCONFORMANT 0x01
+
+/** Alias for evhttp_uri_parse_with_flags(source_uri, 0) */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_uri *evhttp_uri_parse(const char *source_uri);
+
+/**
+ * Free all memory allocated for a parsed uri. Only use this for URIs
+ * generated by evhttp_uri_parse.
+ *
+ * @param uri container with parsed data
+ * @see evhttp_uri_parse()
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_uri_free(struct evhttp_uri *uri);
+
+/**
+ * Join together the uri parts from parsed data to form a URI-Reference.
+ *
+ * Note that no escaping of reserved characters is done on the members
+ * of the evhttp_uri, so the generated string might not be a valid URI
+ * unless the members of evhttp_uri are themselves valid.
+ *
+ * @param uri container with parsed data
+ * @param buf destination buffer
+ * @param limit destination buffer size
+ * @return an joined uri as string or NULL on error
+ * @see evhttp_uri_parse()
+ */
+EVENT2_EXPORT_SYMBOL
+char *evhttp_uri_join(struct evhttp_uri *uri, char *buf, size_t limit);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_HTTP_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/http_compat.h b/sntp/libevent/include/event2/http_compat.h
new file mode 100644
index 0000000..0d9af17
--- /dev/null
+++ b/sntp/libevent/include/event2/http_compat.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_HTTP_COMPAT_H_INCLUDED_
+#define EVENT2_HTTP_COMPAT_H_INCLUDED_
+
+/** @file event2/http_compat.h
+
+ Potentially non-threadsafe versions of the functions in http.h: provided
+ only for backwards compatibility.
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ * Start an HTTP server on the specified address and port
+ *
+ * @deprecated It does not allow an event base to be specified
+ *
+ * @param address the address to which the HTTP server should be bound
+ * @param port the port number on which the HTTP server should listen
+ * @return an struct evhttp object
+ */
+struct evhttp *evhttp_start(const char *address, unsigned short port);
+
+/**
+ * A connection object that can be used to for making HTTP requests. The
+ * connection object tries to establish the connection when it is given an
+ * http request object.
+ *
+ * @deprecated It does not allow an event base to be specified
+ */
+struct evhttp_connection *evhttp_connection_new(
+ const char *address, unsigned short port);
+
+/**
+ * Associates an event base with the connection - can only be called
+ * on a freshly created connection object that has not been used yet.
+ *
+ * @deprecated XXXX Why?
+ */
+void evhttp_connection_set_base(struct evhttp_connection *evcon,
+ struct event_base *base);
+
+
+/** Returns the request URI */
+#define evhttp_request_uri evhttp_request_get_uri
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/http_struct.h b/sntp/libevent/include/event2/http_struct.h
new file mode 100644
index 0000000..4bf5b1f
--- /dev/null
+++ b/sntp/libevent/include/event2/http_struct.h
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_HTTP_STRUCT_H_INCLUDED_
+#define EVENT2_HTTP_STRUCT_H_INCLUDED_
+
+/** @file event2/http_struct.h
+
+ Data structures for http. Using these structures may hurt forward
+ compatibility with later versions of Libevent: be careful!
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+/**
+ * the request structure that a server receives.
+ * WARNING: expect this structure to change. I will try to provide
+ * reasonable accessors.
+ */
+struct evhttp_request {
+#if defined(TAILQ_ENTRY)
+ TAILQ_ENTRY(evhttp_request) next;
+#else
+struct {
+ struct evhttp_request *tqe_next;
+ struct evhttp_request **tqe_prev;
+} next;
+#endif
+
+ /* the connection object that this request belongs to */
+ struct evhttp_connection *evcon;
+ int flags;
+/** The request obj owns the evhttp connection and needs to free it */
+#define EVHTTP_REQ_OWN_CONNECTION 0x0001
+/** Request was made via a proxy */
+#define EVHTTP_PROXY_REQUEST 0x0002
+/** The request object is owned by the user; the user must free it */
+#define EVHTTP_USER_OWNED 0x0004
+/** The request will be used again upstack; freeing must be deferred */
+#define EVHTTP_REQ_DEFER_FREE 0x0008
+/** The request should be freed upstack */
+#define EVHTTP_REQ_NEEDS_FREE 0x0010
+
+ struct evkeyvalq *input_headers;
+ struct evkeyvalq *output_headers;
+
+ /* address of the remote host and the port connection came from */
+ char *remote_host;
+ ev_uint16_t remote_port;
+
+ /* cache of the hostname for evhttp_request_get_host */
+ char *host_cache;
+
+ enum evhttp_request_kind kind;
+ enum evhttp_cmd_type type;
+
+ size_t headers_size;
+ size_t body_size;
+
+ char *uri; /* uri after HTTP request was parsed */
+ struct evhttp_uri *uri_elems; /* uri elements */
+
+ char major; /* HTTP Major number */
+ char minor; /* HTTP Minor number */
+
+ int response_code; /* HTTP Response code */
+ char *response_code_line; /* Readable response */
+
+ struct evbuffer *input_buffer; /* read data */
+ ev_int64_t ntoread;
+ unsigned chunked:1, /* a chunked request */
+ userdone:1; /* the user has sent all data */
+
+ struct evbuffer *output_buffer; /* outgoing post or data */
+
+ /* Callback */
+ void (*cb)(struct evhttp_request *, void *);
+ void *cb_arg;
+
+ /*
+ * Chunked data callback - call for each completed chunk if
+ * specified. If not specified, all the data is delivered via
+ * the regular callback.
+ */
+ void (*chunk_cb)(struct evhttp_request *, void *);
+
+ /*
+ * Callback added for forked-daapd so they can collect ICY
+ * (shoutcast) metadata from the http header. If return
+ * int is negative the connection will be closed.
+ */
+ int (*header_cb)(struct evhttp_request *, void *);
+
+ /*
+ * Error callback - called when error is occured.
+ * @see evhttp_request_error for error types.
+ *
+ * @see evhttp_request_set_error_cb()
+ */
+ void (*error_cb)(enum evhttp_request_error, void *);
+
+ /*
+ * Send complete callback - called when the request is actually
+ * sent and completed.
+ */
+ void (*on_complete_cb)(struct evhttp_request *, void *);
+ void *on_complete_cb_arg;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_HTTP_STRUCT_H_INCLUDED_ */
+
diff --git a/sntp/libevent/include/event2/keyvalq_struct.h b/sntp/libevent/include/event2/keyvalq_struct.h
new file mode 100644
index 0000000..bffa54b
--- /dev/null
+++ b/sntp/libevent/include/event2/keyvalq_struct.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_KEYVALQ_STRUCT_H_INCLUDED_
+#define EVENT2_KEYVALQ_STRUCT_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Fix so that people don't have to run with <sys/queue.h> */
+/* XXXX This code is duplicated with event_struct.h */
+#ifndef TAILQ_ENTRY
+#define EVENT_DEFINED_TQENTRY_
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+#endif /* !TAILQ_ENTRY */
+
+#ifndef TAILQ_HEAD
+#define EVENT_DEFINED_TQHEAD_
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; \
+ struct type **tqh_last; \
+}
+#endif
+
+/*
+ * Key-Value pairs. Can be used for HTTP headers but also for
+ * query argument parsing.
+ */
+struct evkeyval {
+ TAILQ_ENTRY(evkeyval) next;
+
+ char *key;
+ char *value;
+};
+
+TAILQ_HEAD (evkeyvalq, evkeyval);
+
+/* XXXX This code is duplicated with event_struct.h */
+#ifdef EVENT_DEFINED_TQENTRY_
+#undef TAILQ_ENTRY
+#endif
+
+#ifdef EVENT_DEFINED_TQHEAD_
+#undef TAILQ_HEAD
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/include/event2/listener.h b/sntp/libevent/include/event2/listener.h
new file mode 100644
index 0000000..8c77803
--- /dev/null
+++ b/sntp/libevent/include/event2/listener.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_LISTENER_H_INCLUDED_
+#define EVENT2_LISTENER_H_INCLUDED_
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event.h>
+
+struct sockaddr;
+struct evconnlistener;
+
+/**
+ A callback that we invoke when a listener has a new connection.
+
+ @param listener The evconnlistener
+ @param fd The new file descriptor
+ @param addr The source address of the connection
+ @param socklen The length of addr
+ @param user_arg the pointer passed to evconnlistener_new()
+ */
+typedef void (*evconnlistener_cb)(struct evconnlistener *, evutil_socket_t, struct sockaddr *, int socklen, void *);
+
+/**
+ A callback that we invoke when a listener encounters a non-retriable error.
+
+ @param listener The evconnlistener
+ @param user_arg the pointer passed to evconnlistener_new()
+ */
+typedef void (*evconnlistener_errorcb)(struct evconnlistener *, void *);
+
+/** Flag: Indicates that we should not make incoming sockets nonblocking
+ * before passing them to the callback. */
+#define LEV_OPT_LEAVE_SOCKETS_BLOCKING (1u<<0)
+/** Flag: Indicates that freeing the listener should close the underlying
+ * socket. */
+#define LEV_OPT_CLOSE_ON_FREE (1u<<1)
+/** Flag: Indicates that we should set the close-on-exec flag, if possible */
+#define LEV_OPT_CLOSE_ON_EXEC (1u<<2)
+/** Flag: Indicates that we should disable the timeout (if any) between when
+ * this socket is closed and when we can listen again on the same port. */
+#define LEV_OPT_REUSEABLE (1u<<3)
+/** Flag: Indicates that the listener should be locked so it's safe to use
+ * from multiple threadcs at once. */
+#define LEV_OPT_THREADSAFE (1u<<4)
+/** Flag: Indicates that the listener should be created in disabled
+ * state. Use evconnlistener_enable() to enable it later. */
+#define LEV_OPT_DISABLED (1u<<5)
+/** Flag: Indicates that the listener should defer accept() until data is
+ * available, if possible. Ignored on platforms that do not support this.
+ *
+ * This option can help performance for protocols where the client transmits
+ * immediately after connecting. Do not use this option if your protocol
+ * _doesn't_ start out with the client transmitting data, since in that case
+ * this option will sometimes cause the kernel to never tell you about the
+ * connection.
+ *
+ * This option is only supported by evconnlistener_new_bind(): it can't
+ * work with evconnlistener_new_fd(), since the listener needs to be told
+ * to use the option before it is actually bound.
+ */
+#define LEV_OPT_DEFERRED_ACCEPT (1u<<6)
+
+/**
+ Allocate a new evconnlistener object to listen for incoming TCP connections
+ on a given file descriptor.
+
+ @param base The event base to associate the listener with.
+ @param cb A callback to be invoked when a new connection arrives. If the
+ callback is NULL, the listener will be treated as disabled until the
+ callback is set.
+ @param ptr A user-supplied pointer to give to the callback.
+ @param flags Any number of LEV_OPT_* flags
+ @param backlog Passed to the listen() call to determine the length of the
+ acceptable connection backlog. Set to -1 for a reasonable default.
+ Set to 0 if the socket is already listening.
+ @param fd The file descriptor to listen on. It must be a nonblocking
+ file descriptor, and it should already be bound to an appropriate
+ port and address.
+*/
+EVENT2_EXPORT_SYMBOL
+struct evconnlistener *evconnlistener_new(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd);
+/**
+ Allocate a new evconnlistener object to listen for incoming TCP connections
+ on a given address.
+
+ @param base The event base to associate the listener with.
+ @param cb A callback to be invoked when a new connection arrives. If the
+ callback is NULL, the listener will be treated as disabled until the
+ callback is set.
+ @param ptr A user-supplied pointer to give to the callback.
+ @param flags Any number of LEV_OPT_* flags
+ @param backlog Passed to the listen() call to determine the length of the
+ acceptable connection backlog. Set to -1 for a reasonable default.
+ @param addr The address to listen for connections on.
+ @param socklen The length of the address.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evconnlistener *evconnlistener_new_bind(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ const struct sockaddr *sa, int socklen);
+/**
+ Disable and deallocate an evconnlistener.
+ */
+EVENT2_EXPORT_SYMBOL
+void evconnlistener_free(struct evconnlistener *lev);
+/**
+ Re-enable an evconnlistener that has been disabled.
+ */
+EVENT2_EXPORT_SYMBOL
+int evconnlistener_enable(struct evconnlistener *lev);
+/**
+ Stop listening for connections on an evconnlistener.
+ */
+EVENT2_EXPORT_SYMBOL
+int evconnlistener_disable(struct evconnlistener *lev);
+
+/** Return an evconnlistener's associated event_base. */
+EVENT2_EXPORT_SYMBOL
+struct event_base *evconnlistener_get_base(struct evconnlistener *lev);
+
+/** Return the socket that an evconnlistner is listening on. */
+EVENT2_EXPORT_SYMBOL
+evutil_socket_t evconnlistener_get_fd(struct evconnlistener *lev);
+
+/** Change the callback on the listener to cb and its user_data to arg.
+ */
+EVENT2_EXPORT_SYMBOL
+void evconnlistener_set_cb(struct evconnlistener *lev,
+ evconnlistener_cb cb, void *arg);
+
+/** Set an evconnlistener's error callback. */
+EVENT2_EXPORT_SYMBOL
+void evconnlistener_set_error_cb(struct evconnlistener *lev,
+ evconnlistener_errorcb errorcb);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/include/event2/rpc.h b/sntp/libevent/include/event2/rpc.h
new file mode 100644
index 0000000..dd43df2
--- /dev/null
+++ b/sntp/libevent/include/event2/rpc.h
@@ -0,0 +1,596 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_RPC_H_INCLUDED_
+#define EVENT2_RPC_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file rpc.h
+ *
+ * This header files provides basic support for an RPC server and client.
+ *
+ * To support RPCs in a server, every supported RPC command needs to be
+ * defined and registered.
+ *
+ * EVRPC_HEADER(SendCommand, Request, Reply);
+ *
+ * SendCommand is the name of the RPC command.
+ * Request is the name of a structure generated by event_rpcgen.py.
+ * It contains all parameters relating to the SendCommand RPC. The
+ * server needs to fill in the Reply structure.
+ * Reply is the name of a structure generated by event_rpcgen.py. It
+ * contains the answer to the RPC.
+ *
+ * To register an RPC with an HTTP server, you need to first create an RPC
+ * base with:
+ *
+ * struct evrpc_base *base = evrpc_init(http);
+ *
+ * A specific RPC can then be registered with
+ *
+ * EVRPC_REGISTER(base, SendCommand, Request, Reply, FunctionCB, arg);
+ *
+ * when the server receives an appropriately formatted RPC, the user callback
+ * is invoked. The callback needs to fill in the reply structure.
+ *
+ * void FunctionCB(EVRPC_STRUCT(SendCommand)* rpc, void *arg);
+ *
+ * To send the reply, call EVRPC_REQUEST_DONE(rpc);
+ *
+ * See the regression test for an example.
+ */
+
+/**
+ Determines if the member has been set in the message
+
+ @param msg the message to inspect
+ @param member the member variable to test for presences
+ @return 1 if it's present or 0 otherwise.
+*/
+#define EVTAG_HAS(msg, member) \
+ ((msg)->member##_set == 1)
+
+#ifndef EVENT2_RPC_COMPAT_H_INCLUDED_
+
+/**
+ Assigns a value to the member in the message.
+
+ @param msg the message to which to assign a value
+ @param member the name of the member variable
+ @param value the value to assign
+*/
+#define EVTAG_ASSIGN(msg, member, value) \
+ (*(msg)->base->member##_assign)((msg), (value))
+/**
+ Assigns a value to the member in the message.
+
+ @param msg the message to which to assign a value
+ @param member the name of the member variable
+ @param value the value to assign
+ @param len the length of the value
+*/
+#define EVTAG_ASSIGN_WITH_LEN(msg, member, value, len) \
+ (*(msg)->base->member##_assign)((msg), (value), (len))
+/**
+ Returns the value for a member.
+
+ @param msg the message from which to get the value
+ @param member the name of the member variable
+ @param pvalue a pointer to the variable to hold the value
+ @return 0 on success, -1 otherwise.
+*/
+#define EVTAG_GET(msg, member, pvalue) \
+ (*(msg)->base->member##_get)((msg), (pvalue))
+/**
+ Returns the value for a member.
+
+ @param msg the message from which to get the value
+ @param member the name of the member variable
+ @param pvalue a pointer to the variable to hold the value
+ @param plen a pointer to the length of the value
+ @return 0 on success, -1 otherwise.
+*/
+#define EVTAG_GET_WITH_LEN(msg, member, pvalue, plen) \
+ (*(msg)->base->member##_get)((msg), (pvalue), (plen))
+
+#endif /* EVENT2_RPC_COMPAT_H_INCLUDED_ */
+
+/**
+ Adds a value to an array.
+*/
+#define EVTAG_ARRAY_ADD_VALUE(msg, member, value) \
+ (*(msg)->base->member##_add)((msg), (value))
+/**
+ Allocates a new entry in the array and returns it.
+*/
+#define EVTAG_ARRAY_ADD(msg, member) \
+ (*(msg)->base->member##_add)(msg)
+/**
+ Gets a variable at the specified offset from the array.
+*/
+#define EVTAG_ARRAY_GET(msg, member, offset, pvalue) \
+ (*(msg)->base->member##_get)((msg), (offset), (pvalue))
+/**
+ Returns the number of entries in the array.
+*/
+#define EVTAG_ARRAY_LEN(msg, member) ((msg)->member##_length)
+
+
+struct evbuffer;
+struct event_base;
+struct evrpc_req_generic;
+struct evrpc_request_wrapper;
+struct evrpc;
+
+/** The type of a specific RPC Message
+ *
+ * @param rpcname the name of the RPC message
+ */
+#define EVRPC_STRUCT(rpcname) struct evrpc_req__##rpcname
+
+struct evhttp_request;
+struct evrpc_status;
+struct evrpc_hook_meta;
+
+/** Creates the definitions and prototypes for an RPC
+ *
+ * You need to use EVRPC_HEADER to create structures and function prototypes
+ * needed by the server and client implementation. The structures have to be
+ * defined in an .rpc file and converted to source code via event_rpcgen.py
+ *
+ * @param rpcname the name of the RPC
+ * @param reqstruct the name of the RPC request structure
+ * @param replystruct the name of the RPC reply structure
+ * @see EVRPC_GENERATE()
+ */
+#define EVRPC_HEADER(rpcname, reqstruct, rplystruct) \
+EVRPC_STRUCT(rpcname) { \
+ struct evrpc_hook_meta *hook_meta; \
+ struct reqstruct* request; \
+ struct rplystruct* reply; \
+ struct evrpc* rpc; \
+ struct evhttp_request* http_req; \
+ struct evbuffer* rpc_data; \
+}; \
+int evrpc_send_request_##rpcname(struct evrpc_pool *, \
+ struct reqstruct *, struct rplystruct *, \
+ void (*)(struct evrpc_status *, \
+ struct reqstruct *, struct rplystruct *, void *cbarg), \
+ void *);
+
+struct evrpc_pool;
+
+/** use EVRPC_GENERATE instead */
+struct evrpc_request_wrapper *evrpc_make_request_ctx(
+ struct evrpc_pool *pool, void *request, void *reply,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer*, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *),
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cbarg);
+
+/** Creates a context structure that contains rpc specific information.
+ *
+ * EVRPC_MAKE_CTX is used to populate a RPC specific context that
+ * contains information about marshaling the RPC data types.
+ *
+ * @param rpcname the name of the RPC
+ * @param reqstruct the name of the RPC request structure
+ * @param replystruct the name of the RPC reply structure
+ * @param pool the evrpc_pool over which to make the request
+ * @param request a pointer to the RPC request structure object
+ * @param reply a pointer to the RPC reply structure object
+ * @param cb the callback function to call when the RPC has completed
+ * @param cbarg the argument to supply to the callback
+ */
+#define EVRPC_MAKE_CTX(rpcname, reqstruct, rplystruct, \
+ pool, request, reply, cb, cbarg) \
+ evrpc_make_request_ctx(pool, request, reply, \
+ #rpcname, \
+ (void (*)(struct evbuffer *, void *))reqstruct##_marshal, \
+ (void (*)(void *))rplystruct##_clear, \
+ (int (*)(void *, struct evbuffer *))rplystruct##_unmarshal, \
+ (void (*)(struct evrpc_status *, void *, void *, void *))cb, \
+ cbarg)
+
+/** Generates the code for receiving and sending an RPC message
+ *
+ * EVRPC_GENERATE is used to create the code corresponding to sending
+ * and receiving a particular RPC message
+ *
+ * @param rpcname the name of the RPC
+ * @param reqstruct the name of the RPC request structure
+ * @param replystruct the name of the RPC reply structure
+ * @see EVRPC_HEADER()
+ */
+#define EVRPC_GENERATE(rpcname, reqstruct, rplystruct) \
+ int evrpc_send_request_##rpcname(struct evrpc_pool *pool, \
+ struct reqstruct *request, struct rplystruct *reply, \
+ void (*cb)(struct evrpc_status *, \
+ struct reqstruct *, struct rplystruct *, void *cbarg), \
+ void *cbarg) { \
+ return evrpc_send_request_generic(pool, request, reply, \
+ (void (*)(struct evrpc_status *, void *, void *, void *))cb, \
+ cbarg, \
+ #rpcname, \
+ (void (*)(struct evbuffer *, void *))reqstruct##_marshal, \
+ (void (*)(void *))rplystruct##_clear, \
+ (int (*)(void *, struct evbuffer *))rplystruct##_unmarshal); \
+}
+
+/** Provides access to the HTTP request object underlying an RPC
+ *
+ * Access to the underlying http object; can be used to look at headers or
+ * for getting the remote ip address
+ *
+ * @param rpc_req the rpc request structure provided to the server callback
+ * @return an struct evhttp_request object that can be inspected for
+ * HTTP headers or sender information.
+ */
+#define EVRPC_REQUEST_HTTP(rpc_req) (rpc_req)->http_req
+
+/** completes the server response to an rpc request */
+void evrpc_request_done(struct evrpc_req_generic *req);
+
+/** accessors for request and reply */
+void *evrpc_get_request(struct evrpc_req_generic *req);
+void *evrpc_get_reply(struct evrpc_req_generic *req);
+
+/** Creates the reply to an RPC request
+ *
+ * EVRPC_REQUEST_DONE is used to answer a request; the reply is expected
+ * to have been filled in. The request and reply pointers become invalid
+ * after this call has finished.
+ *
+ * @param rpc_req the rpc request structure provided to the server callback
+ */
+#define EVRPC_REQUEST_DONE(rpc_req) do { \
+ struct evrpc_req_generic *req_ = (struct evrpc_req_generic *)(rpc_req); \
+ evrpc_request_done(req_); \
+} while (0)
+
+
+struct evrpc_base;
+struct evhttp;
+
+/* functions to start up the rpc system */
+
+/** Creates a new rpc base from which RPC requests can be received
+ *
+ * @param server a pointer to an existing HTTP server
+ * @return a newly allocated evrpc_base struct
+ * @see evrpc_free()
+ */
+struct evrpc_base *evrpc_init(struct evhttp *server);
+
+/**
+ * Frees the evrpc base
+ *
+ * For now, you are responsible for making sure that no rpcs are ongoing.
+ *
+ * @param base the evrpc_base object to be freed
+ * @see evrpc_init
+ */
+void evrpc_free(struct evrpc_base *base);
+
+/** register RPCs with the HTTP Server
+ *
+ * registers a new RPC with the HTTP server, each RPC needs to have
+ * a unique name under which it can be identified.
+ *
+ * @param base the evrpc_base structure in which the RPC should be
+ * registered.
+ * @param name the name of the RPC
+ * @param request the name of the RPC request structure
+ * @param reply the name of the RPC reply structure
+ * @param callback the callback that should be invoked when the RPC
+ * is received. The callback has the following prototype
+ * void (*callback)(EVRPC_STRUCT(Message)* rpc, void *arg)
+ * @param cbarg an additional parameter that can be passed to the callback.
+ * The parameter can be used to carry around state.
+ */
+#define EVRPC_REGISTER(base, name, request, reply, callback, cbarg) \
+ evrpc_register_generic(base, #name, \
+ (void (*)(struct evrpc_req_generic *, void *))callback, cbarg, \
+ (void *(*)(void *))request##_new, NULL, \
+ (void (*)(void *))request##_free, \
+ (int (*)(void *, struct evbuffer *))request##_unmarshal, \
+ (void *(*)(void *))reply##_new, NULL, \
+ (void (*)(void *))reply##_free, \
+ (int (*)(void *))reply##_complete, \
+ (void (*)(struct evbuffer *, void *))reply##_marshal)
+
+/**
+ Low level function for registering an RPC with a server.
+
+ Use EVRPC_REGISTER() instead.
+
+ @see EVRPC_REGISTER()
+*/
+int evrpc_register_rpc(struct evrpc_base *, struct evrpc *,
+ void (*)(struct evrpc_req_generic*, void *), void *);
+
+/**
+ * Unregisters an already registered RPC
+ *
+ * @param base the evrpc_base object from which to unregister an RPC
+ * @param name the name of the rpc to unregister
+ * @return -1 on error or 0 when successful.
+ * @see EVRPC_REGISTER()
+ */
+#define EVRPC_UNREGISTER(base, name) evrpc_unregister_rpc((base), #name)
+
+int evrpc_unregister_rpc(struct evrpc_base *base, const char *name);
+
+/*
+ * Client-side RPC support
+ */
+
+struct evhttp_connection;
+struct evrpc_status;
+
+/** launches an RPC and sends it to the server
+ *
+ * EVRPC_MAKE_REQUEST() is used by the client to send an RPC to the server.
+ *
+ * @param name the name of the RPC
+ * @param pool the evrpc_pool that contains the connection objects over which
+ * the request should be sent.
+ * @param request a pointer to the RPC request structure - it contains the
+ * data to be sent to the server.
+ * @param reply a pointer to the RPC reply structure. It is going to be filled
+ * if the request was answered successfully
+ * @param cb the callback to invoke when the RPC request has been answered
+ * @param cbarg an additional argument to be passed to the client
+ * @return 0 on success, -1 on failure
+ */
+#define EVRPC_MAKE_REQUEST(name, pool, request, reply, cb, cbarg) \
+ evrpc_send_request_##name((pool), (request), (reply), (cb), (cbarg))
+
+/**
+ Makes an RPC request based on the provided context.
+
+ This is a low-level function and should not be used directly
+ unless a custom context object is provided. Use EVRPC_MAKE_REQUEST()
+ instead.
+
+ @param ctx a context from EVRPC_MAKE_CTX()
+ @returns 0 on success, -1 otherwise.
+ @see EVRPC_MAKE_REQUEST(), EVRPC_MAKE_CTX()
+*/
+int evrpc_make_request(struct evrpc_request_wrapper *ctx);
+
+/** creates an rpc connection pool
+ *
+ * a pool has a number of connections associated with it.
+ * rpc requests are always made via a pool.
+ *
+ * @param base a pointer to an struct event_based object; can be left NULL
+ * in singled-threaded applications
+ * @return a newly allocated struct evrpc_pool object
+ * @see evrpc_pool_free()
+ */
+struct evrpc_pool *evrpc_pool_new(struct event_base *base);
+/** frees an rpc connection pool
+ *
+ * @param pool a pointer to an evrpc_pool allocated via evrpc_pool_new()
+ * @see evrpc_pool_new()
+ */
+void evrpc_pool_free(struct evrpc_pool *pool);
+
+/**
+ * Adds a connection over which rpc can be dispatched to the pool.
+ *
+ * The connection object must have been newly created.
+ *
+ * @param pool the pool to which to add the connection
+ * @param evcon the connection to add to the pool.
+ */
+void evrpc_pool_add_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *evcon);
+
+/**
+ * Removes a connection from the pool.
+ *
+ * The connection object must have been newly created.
+ *
+ * @param pool the pool from which to remove the connection
+ * @param evcon the connection to remove from the pool.
+ */
+void evrpc_pool_remove_connection(struct evrpc_pool *pool,
+ struct evhttp_connection *evcon);
+
+/**
+ * Sets the timeout in secs after which a request has to complete. The
+ * RPC is completely aborted if it does not complete by then. Setting
+ * the timeout to 0 means that it never timeouts and can be used to
+ * implement callback type RPCs.
+ *
+ * Any connection already in the pool will be updated with the new
+ * timeout. Connections added to the pool after set_timeout has be
+ * called receive the pool timeout only if no timeout has been set
+ * for the connection itself.
+ *
+ * @param pool a pointer to a struct evrpc_pool object
+ * @param timeout_in_secs the number of seconds after which a request should
+ * timeout and a failure be returned to the callback.
+ */
+void evrpc_pool_set_timeout(struct evrpc_pool *pool, int timeout_in_secs);
+
+/**
+ * Hooks for changing the input and output of RPCs; this can be used to
+ * implement compression, authentication, encryption, ...
+ */
+
+enum EVRPC_HOOK_TYPE {
+ EVRPC_INPUT, /**< apply the function to an input hook */
+ EVRPC_OUTPUT /**< apply the function to an output hook */
+};
+
+#ifndef _WIN32
+/** Deprecated alias for EVRPC_INPUT. Not available on windows, where it
+ * conflicts with platform headers. */
+#define INPUT EVRPC_INPUT
+/** Deprecated alias for EVRPC_OUTPUT. Not available on windows, where it
+ * conflicts with platform headers. */
+#define OUTPUT EVRPC_OUTPUT
+#endif
+
+/**
+ * Return value from hook processing functions
+ */
+
+enum EVRPC_HOOK_RESULT {
+ EVRPC_TERMINATE = -1, /**< indicates the rpc should be terminated */
+ EVRPC_CONTINUE = 0, /**< continue processing the rpc */
+ EVRPC_PAUSE = 1 /**< pause processing request until resumed */
+};
+
+/** adds a processing hook to either an rpc base or rpc pool
+ *
+ * If a hook returns TERMINATE, the processing is aborted. On CONTINUE,
+ * the request is immediately processed after the hook returns. If the
+ * hook returns PAUSE, request processing stops until evrpc_resume_request()
+ * has been called.
+ *
+ * The add functions return handles that can be used for removing hooks.
+ *
+ * @param vbase a pointer to either struct evrpc_base or struct evrpc_pool
+ * @param hook_type either INPUT or OUTPUT
+ * @param cb the callback to call when the hook is activated
+ * @param cb_arg an additional argument for the callback
+ * @return a handle to the hook so it can be removed later
+ * @see evrpc_remove_hook()
+ */
+void *evrpc_add_hook(void *vbase,
+ enum EVRPC_HOOK_TYPE hook_type,
+ int (*cb)(void *, struct evhttp_request *, struct evbuffer *, void *),
+ void *cb_arg);
+
+/** removes a previously added hook
+ *
+ * @param vbase a pointer to either struct evrpc_base or struct evrpc_pool
+ * @param hook_type either INPUT or OUTPUT
+ * @param handle a handle returned by evrpc_add_hook()
+ * @return 1 on success or 0 on failure
+ * @see evrpc_add_hook()
+ */
+int evrpc_remove_hook(void *vbase,
+ enum EVRPC_HOOK_TYPE hook_type,
+ void *handle);
+
+/** resume a paused request
+ *
+ * @param vbase a pointer to either struct evrpc_base or struct evrpc_pool
+ * @param ctx the context pointer provided to the original hook call
+ */
+int
+evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res);
+
+/** adds meta data to request
+ *
+ * evrpc_hook_add_meta() allows hooks to add meta data to a request. for
+ * a client request, the meta data can be inserted by an outgoing request hook
+ * and retrieved by the incoming request hook.
+ *
+ * @param ctx the context provided to the hook call
+ * @param key a NUL-terminated c-string
+ * @param data the data to be associated with the key
+ * @param data_size the size of the data
+ */
+void evrpc_hook_add_meta(void *ctx, const char *key,
+ const void *data, size_t data_size);
+
+/** retrieves meta data previously associated
+ *
+ * evrpc_hook_find_meta() can be used to retrieve meta data associated to a
+ * request by a previous hook.
+ * @param ctx the context provided to the hook call
+ * @param key a NUL-terminated c-string
+ * @param data pointer to a data pointer that will contain the retrieved data
+ * @param data_size pointer to the size of the data
+ * @return 0 on success or -1 on failure
+ */
+int evrpc_hook_find_meta(void *ctx, const char *key,
+ void **data, size_t *data_size);
+
+/**
+ * returns the connection object associated with the request
+ *
+ * @param ctx the context provided to the hook call
+ * @return a pointer to the evhttp_connection object
+ */
+struct evhttp_connection *evrpc_hook_get_connection(void *ctx);
+
+/**
+ Function for sending a generic RPC request.
+
+ Do not call this function directly, use EVRPC_MAKE_REQUEST() instead.
+
+ @see EVRPC_MAKE_REQUEST()
+ */
+int evrpc_send_request_generic(struct evrpc_pool *pool,
+ void *request, void *reply,
+ void (*cb)(struct evrpc_status *, void *, void *, void *),
+ void *cb_arg,
+ const char *rpcname,
+ void (*req_marshal)(struct evbuffer *, void *),
+ void (*rpl_clear)(void *),
+ int (*rpl_unmarshal)(void *, struct evbuffer *));
+
+/**
+ Function for registering a generic RPC with the RPC base.
+
+ Do not call this function directly, use EVRPC_REGISTER() instead.
+
+ @see EVRPC_REGISTER()
+ */
+int
+evrpc_register_generic(struct evrpc_base *base, const char *name,
+ void (*callback)(struct evrpc_req_generic *, void *), void *cbarg,
+ void *(*req_new)(void *), void *req_new_arg, void (*req_free)(void *),
+ int (*req_unmarshal)(void *, struct evbuffer *),
+ void *(*rpl_new)(void *), void *rpl_new_arg, void (*rpl_free)(void *),
+ int (*rpl_complete)(void *),
+ void (*rpl_marshal)(struct evbuffer *, void *));
+
+/** accessors for obscure and undocumented functionality */
+struct evrpc_pool* evrpc_request_get_pool(struct evrpc_request_wrapper *ctx);
+void evrpc_request_set_pool(struct evrpc_request_wrapper *ctx,
+ struct evrpc_pool *pool);
+void evrpc_request_set_cb(struct evrpc_request_wrapper *ctx,
+ void (*cb)(struct evrpc_status*, void *request, void *reply, void *arg),
+ void *cb_arg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_RPC_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/rpc_compat.h b/sntp/libevent/include/event2/rpc_compat.h
new file mode 100644
index 0000000..8d8334d
--- /dev/null
+++ b/sntp/libevent/include/event2/rpc_compat.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_RPC_COMPAT_H_INCLUDED_
+#define EVENT2_RPC_COMPAT_H_INCLUDED_
+
+/** @file event2/rpc_compat.h
+
+ Deprecated versions of the functions in rpc.h: provided only for
+ backwards compatibility.
+
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** backwards compatible accessors that work only with gcc */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+
+#undef EVTAG_ASSIGN
+#undef EVTAG_GET
+#undef EVTAG_ADD
+
+#define EVTAG_ASSIGN(msg, member, args...) \
+ (*(msg)->base->member##_assign)(msg, ## args)
+#define EVTAG_GET(msg, member, args...) \
+ (*(msg)->base->member##_get)(msg, ## args)
+#define EVTAG_ADD(msg, member, args...) \
+ (*(msg)->base->member##_add)(msg, ## args)
+#endif
+#define EVTAG_LEN(msg, member) ((msg)->member##_length)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/rpc_struct.h b/sntp/libevent/include/event2/rpc_struct.h
new file mode 100644
index 0000000..8f691f4
--- /dev/null
+++ b/sntp/libevent/include/event2/rpc_struct.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2006-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_RPC_STRUCT_H_INCLUDED_
+#define EVENT2_RPC_STRUCT_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file event2/rpc_struct.h
+
+ Structures used by rpc.h. Using these structures directly may harm
+ forward compatibility: be careful!
+
+ */
+
+/**
+ * provides information about the completed RPC request.
+ */
+struct evrpc_status {
+#define EVRPC_STATUS_ERR_NONE 0
+#define EVRPC_STATUS_ERR_TIMEOUT 1
+#define EVRPC_STATUS_ERR_BADPAYLOAD 2
+#define EVRPC_STATUS_ERR_UNSTARTED 3
+#define EVRPC_STATUS_ERR_HOOKABORTED 4
+ int error;
+
+ /* for looking at headers or other information */
+ struct evhttp_request *http_req;
+};
+
+/* the structure below needs to be synchronized with evrpc_req_generic */
+
+/* Encapsulates a request */
+struct evrpc {
+ TAILQ_ENTRY(evrpc) next;
+
+ /* the URI at which the request handler lives */
+ const char* uri;
+
+ /* creates a new request structure */
+ void *(*request_new)(void *);
+ void *request_new_arg;
+
+ /* frees the request structure */
+ void (*request_free)(void *);
+
+ /* unmarshals the buffer into the proper request structure */
+ int (*request_unmarshal)(void *, struct evbuffer *);
+
+ /* creates a new reply structure */
+ void *(*reply_new)(void *);
+ void *reply_new_arg;
+
+ /* frees the reply structure */
+ void (*reply_free)(void *);
+
+ /* verifies that the reply is valid */
+ int (*reply_complete)(void *);
+
+ /* marshals the reply into a buffer */
+ void (*reply_marshal)(struct evbuffer*, void *);
+
+ /* the callback invoked for each received rpc */
+ void (*cb)(struct evrpc_req_generic *, void *);
+ void *cb_arg;
+
+ /* reference for further configuration */
+ struct evrpc_base *base;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_RPC_STRUCT_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/tag.h b/sntp/libevent/include/event2/tag.h
new file mode 100644
index 0000000..2f73bfc
--- /dev/null
+++ b/sntp/libevent/include/event2/tag.h
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_TAG_H_INCLUDED_
+#define EVENT2_TAG_H_INCLUDED_
+
+/** @file event2/tag.h
+
+ Helper functions for reading and writing tagged data onto buffers.
+
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+/* For int types. */
+#include <event2/util.h>
+
+struct evbuffer;
+
+/*
+ * Marshaling tagged data - We assume that all tags are inserted in their
+ * numeric order - so that unknown tags will always be higher than the
+ * known ones - and we can just ignore the end of an event buffer.
+ */
+
+EVENT2_EXPORT_SYMBOL
+void evtag_init(void);
+
+/**
+ Unmarshals the header and returns the length of the payload
+
+ @param evbuf the buffer from which to unmarshal data
+ @param ptag a pointer in which the tag id is being stored
+ @returns -1 on failure or the number of bytes in the remaining payload.
+*/
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_header(struct evbuffer *evbuf, ev_uint32_t *ptag);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal(struct evbuffer *evbuf, ev_uint32_t tag, const void *data,
+ ev_uint32_t len);
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_buffer(struct evbuffer *evbuf, ev_uint32_t tag,
+ struct evbuffer *data);
+
+/**
+ Encode an integer and store it in an evbuffer.
+
+ We encode integers by nybbles; the first nibble contains the number
+ of significant nibbles - 1; this allows us to encode up to 64-bit
+ integers. This function is byte-order independent.
+
+ @param evbuf evbuffer to store the encoded number
+ @param number a 32-bit integer
+ */
+EVENT2_EXPORT_SYMBOL
+void evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number);
+EVENT2_EXPORT_SYMBOL
+void evtag_encode_int64(struct evbuffer *evbuf, ev_uint64_t number);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_int(struct evbuffer *evbuf, ev_uint32_t tag,
+ ev_uint32_t integer);
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_int64(struct evbuffer *evbuf, ev_uint32_t tag,
+ ev_uint64_t integer);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_string(struct evbuffer *buf, ev_uint32_t tag,
+ const char *string);
+
+EVENT2_EXPORT_SYMBOL
+void evtag_marshal_timeval(struct evbuffer *evbuf, ev_uint32_t tag,
+ struct timeval *tv);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal(struct evbuffer *src, ev_uint32_t *ptag,
+ struct evbuffer *dst);
+EVENT2_EXPORT_SYMBOL
+int evtag_peek(struct evbuffer *evbuf, ev_uint32_t *ptag);
+EVENT2_EXPORT_SYMBOL
+int evtag_peek_length(struct evbuffer *evbuf, ev_uint32_t *plength);
+EVENT2_EXPORT_SYMBOL
+int evtag_payload_length(struct evbuffer *evbuf, ev_uint32_t *plength);
+EVENT2_EXPORT_SYMBOL
+int evtag_consume(struct evbuffer *evbuf);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_int(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint32_t *pinteger);
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_int64(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ ev_uint64_t *pinteger);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_fixed(struct evbuffer *src, ev_uint32_t need_tag,
+ void *data, size_t len);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_string(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ char **pstring);
+
+EVENT2_EXPORT_SYMBOL
+int evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint32_t need_tag,
+ struct timeval *ptv);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_TAG_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/tag_compat.h b/sntp/libevent/include/event2/tag_compat.h
new file mode 100644
index 0000000..a276c0d
--- /dev/null
+++ b/sntp/libevent/include/event2/tag_compat.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_TAG_COMPAT_H_INCLUDED_
+#define EVENT2_TAG_COMPAT_H_INCLUDED_
+
+/** @file event2/tag_compat.h
+
+ Obsolete/deprecated functions from tag.h; provided only for backwards
+ compatibility.
+ */
+
+/**
+ @name Misnamed functions
+
+ @deprecated These macros are deprecated because their names don't follow
+ Libevent's naming conventions. Use evtag_encode_int and
+ evtag_encode_int64 instead.
+
+ @{
+*/
+#define encode_int(evbuf, number) evtag_encode_int((evbuf), (number))
+#define encode_int64(evbuf, number) evtag_encode_int64((evbuf), (number))
+/**@}*/
+
+#endif /* EVENT2_TAG_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/thread.h b/sntp/libevent/include/event2/thread.h
new file mode 100644
index 0000000..b519986
--- /dev/null
+++ b/sntp/libevent/include/event2/thread.h
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_THREAD_H_INCLUDED_
+#define EVENT2_THREAD_H_INCLUDED_
+
+/** @file event2/thread.h
+
+ Functions for multi-threaded applications using Libevent.
+
+ When using a multi-threaded application in which multiple threads
+ add and delete events from a single event base, Libevent needs to
+ lock its data structures.
+
+ Like the memory-management function hooks, all of the threading functions
+ _must_ be set up before an event_base is created if you want the base to
+ use them.
+
+ Most programs will either be using Windows threads or Posix threads. You
+ can configure Libevent to use one of these event_use_windows_threads() or
+ event_use_pthreads() respectively. If you're using another threading
+ library, you'll need to configure threading functions manually using
+ evthread_set_lock_callbacks() and evthread_set_condition_callbacks().
+
+ */
+
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+
+/**
+ @name Flags passed to lock functions
+
+ @{
+*/
+/** A flag passed to a locking callback when the lock was allocated as a
+ * read-write lock, and we want to acquire or release the lock for writing. */
+#define EVTHREAD_WRITE 0x04
+/** A flag passed to a locking callback when the lock was allocated as a
+ * read-write lock, and we want to acquire or release the lock for reading. */
+#define EVTHREAD_READ 0x08
+/** A flag passed to a locking callback when we don't want to block waiting
+ * for the lock; if we can't get the lock immediately, we will instead
+ * return nonzero from the locking callback. */
+#define EVTHREAD_TRY 0x10
+/**@}*/
+
+#if !defined(EVENT__DISABLE_THREAD_SUPPORT) || defined(EVENT_IN_DOXYGEN_)
+
+#define EVTHREAD_LOCK_API_VERSION 1
+
+/**
+ @name Types of locks
+
+ @{*/
+/** A recursive lock is one that can be acquired multiple times at once by the
+ * same thread. No other process can allocate the lock until the thread that
+ * has been holding it has unlocked it as many times as it locked it. */
+#define EVTHREAD_LOCKTYPE_RECURSIVE 1
+/* A read-write lock is one that allows multiple simultaneous readers, but
+ * where any one writer excludes all other writers and readers. */
+#define EVTHREAD_LOCKTYPE_READWRITE 2
+/**@}*/
+
+/** This structure describes the interface a threading library uses for
+ * locking. It's used to tell evthread_set_lock_callbacks() how to use
+ * locking on this platform.
+ */
+struct evthread_lock_callbacks {
+ /** The current version of the locking API. Set this to
+ * EVTHREAD_LOCK_API_VERSION */
+ int lock_api_version;
+ /** Which kinds of locks does this version of the locking API
+ * support? A bitfield of EVTHREAD_LOCKTYPE_RECURSIVE and
+ * EVTHREAD_LOCKTYPE_READWRITE.
+ *
+ * (Note that RECURSIVE locks are currently mandatory, and
+ * READWRITE locks are not currently used.)
+ **/
+ unsigned supported_locktypes;
+ /** Function to allocate and initialize new lock of type 'locktype'.
+ * Returns NULL on failure. */
+ void *(*alloc)(unsigned locktype);
+ /** Funtion to release all storage held in 'lock', which was created
+ * with type 'locktype'. */
+ void (*free)(void *lock, unsigned locktype);
+ /** Acquire an already-allocated lock at 'lock' with mode 'mode'.
+ * Returns 0 on success, and nonzero on failure. */
+ int (*lock)(unsigned mode, void *lock);
+ /** Release a lock at 'lock' using mode 'mode'. Returns 0 on success,
+ * and nonzero on failure. */
+ int (*unlock)(unsigned mode, void *lock);
+};
+
+/** Sets a group of functions that Libevent should use for locking.
+ * For full information on the required callback API, see the
+ * documentation for the individual members of evthread_lock_callbacks.
+ *
+ * Note that if you're using Windows or the Pthreads threading library, you
+ * probably shouldn't call this function; instead, use
+ * evthread_use_windows_threads() or evthread_use_posix_threads() if you can.
+ */
+EVENT2_EXPORT_SYMBOL
+int evthread_set_lock_callbacks(const struct evthread_lock_callbacks *);
+
+#define EVTHREAD_CONDITION_API_VERSION 1
+
+struct timeval;
+
+/** This structure describes the interface a threading library uses for
+ * condition variables. It's used to tell evthread_set_condition_callbacks
+ * how to use locking on this platform.
+ */
+struct evthread_condition_callbacks {
+ /** The current version of the conditions API. Set this to
+ * EVTHREAD_CONDITION_API_VERSION */
+ int condition_api_version;
+ /** Function to allocate and initialize a new condition variable.
+ * Returns the condition variable on success, and NULL on failure.
+ * The 'condtype' argument will be 0 with this API version.
+ */
+ void *(*alloc_condition)(unsigned condtype);
+ /** Function to free a condition variable. */
+ void (*free_condition)(void *cond);
+ /** Function to signal a condition variable. If 'broadcast' is 1, all
+ * threads waiting on 'cond' should be woken; otherwise, only on one
+ * thread is worken. Should return 0 on success, -1 on failure.
+ * This function will only be called while holding the associated
+ * lock for the condition.
+ */
+ int (*signal_condition)(void *cond, int broadcast);
+ /** Function to wait for a condition variable. The lock 'lock'
+ * will be held when this function is called; should be released
+ * while waiting for the condition to be come signalled, and
+ * should be held again when this function returns.
+ * If timeout is provided, it is interval of seconds to wait for
+ * the event to become signalled; if it is NULL, the function
+ * should wait indefinitely.
+ *
+ * The function should return -1 on error; 0 if the condition
+ * was signalled, or 1 on a timeout. */
+ int (*wait_condition)(void *cond, void *lock,
+ const struct timeval *timeout);
+};
+
+/** Sets a group of functions that Libevent should use for condition variables.
+ * For full information on the required callback API, see the
+ * documentation for the individual members of evthread_condition_callbacks.
+ *
+ * Note that if you're using Windows or the Pthreads threading library, you
+ * probably shouldn't call this function; instead, use
+ * evthread_use_windows_threads() or evthread_use_pthreads() if you can.
+ */
+EVENT2_EXPORT_SYMBOL
+int evthread_set_condition_callbacks(
+ const struct evthread_condition_callbacks *);
+
+/**
+ Sets the function for determining the thread id.
+
+ @param base the event base for which to set the id function
+ @param id_fn the identify function Libevent should invoke to
+ determine the identity of a thread.
+*/
+EVENT2_EXPORT_SYMBOL
+void evthread_set_id_callback(
+ unsigned long (*id_fn)(void));
+
+#if (defined(_WIN32) && !defined(EVENT__DISABLE_THREAD_SUPPORT)) || defined(EVENT_IN_DOXYGEN_)
+/** Sets up Libevent for use with Windows builtin locking and thread ID
+ functions. Unavailable if Libevent is not built for Windows.
+
+ @return 0 on success, -1 on failure. */
+EVENT2_EXPORT_SYMBOL
+int evthread_use_windows_threads(void);
+/**
+ Defined if Libevent was built with support for evthread_use_windows_threads()
+*/
+#define EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED 1
+#endif
+
+#if defined(EVENT__HAVE_PTHREADS) || defined(EVENT_IN_DOXYGEN_)
+/** Sets up Libevent for use with Pthreads locking and thread ID functions.
+ Unavailable if Libevent is not build for use with pthreads. Requires
+ libraries to link against Libevent_pthreads as well as Libevent.
+
+ @return 0 on success, -1 on failure. */
+EVENT2_EXPORT_SYMBOL
+int evthread_use_pthreads(void);
+/** Defined if Libevent was built with support for evthread_use_pthreads() */
+#define EVTHREAD_USE_PTHREADS_IMPLEMENTED 1
+
+#endif
+
+/** Enable debugging wrappers around the current lock callbacks. If Libevent
+ * makes one of several common locking errors, exit with an assertion failure.
+ *
+ * If you're going to call this function, you must do so before any locks are
+ * allocated.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evthread_enable_lock_debugging(void);
+
+/* Old (misspelled) version: This is deprecated; use
+ * evthread_enable_log_debugging instead. */
+EVENT2_EXPORT_SYMBOL
+void evthread_enable_lock_debuging(void);
+
+#endif /* EVENT__DISABLE_THREAD_SUPPORT */
+
+struct event_base;
+/** Make sure it's safe to tell an event base to wake up from another thread
+ or a signal handler.
+
+ You shouldn't need to call this by hand; configuring the base with thread
+ support should be necessary and sufficient.
+
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evthread_make_base_notifiable(struct event_base *base);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT2_THREAD_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/util.h b/sntp/libevent/include/event2/util.h
new file mode 100644
index 0000000..14c6a25
--- /dev/null
+++ b/sntp/libevent/include/event2/util.h
@@ -0,0 +1,768 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_UTIL_H_INCLUDED_
+#define EVENT2_UTIL_H_INCLUDED_
+
+/** @file event2/util.h
+
+ Common convenience functions for cross-platform portability and
+ related socket manipulations.
+
+ */
+#include <event2/visibility.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <event2/event-config.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(EVENT__HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+#ifdef EVENT__HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef EVENT__HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+#ifdef _MSC_VER
+#include <BaseTsd.h>
+#endif
+#include <stdarg.h>
+#ifdef EVENT__HAVE_NETDB_H
+#if !defined(_GNU_SOURCE)
+#define _GNU_SOURCE
+#endif
+#include <netdb.h>
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#ifdef EVENT__HAVE_GETADDRINFO
+/* for EAI_* definitions. */
+#include <ws2tcpip.h>
+#endif
+#else
+#include <sys/socket.h>
+#endif
+
+/* Some openbsd autoconf versions get the name of this macro wrong. */
+#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
+#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__
+#endif
+
+/**
+ * @name Standard integer types.
+ *
+ * Integer type definitions for types that are supposed to be defined in the
+ * C99-specified stdint.h. Shamefully, some platforms do not include
+ * stdint.h, so we need to replace it. (If you are on a platform like this,
+ * your C headers are now over 10 years out of date. You should bug them to
+ * do something about this.)
+ *
+ * We define:
+ *
+ * <dl>
+ * <dt>ev_uint64_t, ev_uint32_t, ev_uint16_t, ev_uint8_t</dt>
+ * <dd>unsigned integer types of exactly 64, 32, 16, and 8 bits
+ * respectively.</dd>
+ * <dt>ev_int64_t, ev_int32_t, ev_int16_t, ev_int8_t</dt>
+ * <dd>signed integer types of exactly 64, 32, 16, and 8 bits
+ * respectively.</dd>
+ * <dt>ev_uintptr_t, ev_intptr_t</dt>
+ * <dd>unsigned/signed integers large enough
+ * to hold a pointer without loss of bits.</dd>
+ * <dt>ev_ssize_t</dt>
+ * <dd>A signed type of the same size as size_t</dd>
+ * <dt>ev_off_t</dt>
+ * <dd>A signed type typically used to represent offsets within a
+ * (potentially large) file</dd>
+ *
+ * @{
+ */
+#ifdef EVENT__HAVE_UINT64_T
+#define ev_uint64_t uint64_t
+#define ev_int64_t int64_t
+#elif defined(_WIN32)
+#define ev_uint64_t unsigned __int64
+#define ev_int64_t signed __int64
+#elif EVENT__SIZEOF_LONG_LONG == 8
+#define ev_uint64_t unsigned long long
+#define ev_int64_t long long
+#elif EVENT__SIZEOF_LONG == 8
+#define ev_uint64_t unsigned long
+#define ev_int64_t long
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint64_t ...
+#define ev_int64_t ...
+#else
+#error "No way to define ev_uint64_t"
+#endif
+
+#ifdef EVENT__HAVE_UINT32_T
+#define ev_uint32_t uint32_t
+#define ev_int32_t int32_t
+#elif defined(_WIN32)
+#define ev_uint32_t unsigned int
+#define ev_int32_t signed int
+#elif EVENT__SIZEOF_LONG == 4
+#define ev_uint32_t unsigned long
+#define ev_int32_t signed long
+#elif EVENT__SIZEOF_INT == 4
+#define ev_uint32_t unsigned int
+#define ev_int32_t signed int
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint32_t ...
+#define ev_int32_t ...
+#else
+#error "No way to define ev_uint32_t"
+#endif
+
+#ifdef EVENT__HAVE_UINT16_T
+#define ev_uint16_t uint16_t
+#define ev_int16_t int16_t
+#elif defined(_WIN32)
+#define ev_uint16_t unsigned short
+#define ev_int16_t signed short
+#elif EVENT__SIZEOF_INT == 2
+#define ev_uint16_t unsigned int
+#define ev_int16_t signed int
+#elif EVENT__SIZEOF_SHORT == 2
+#define ev_uint16_t unsigned short
+#define ev_int16_t signed short
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint16_t ...
+#define ev_int16_t ...
+#else
+#error "No way to define ev_uint16_t"
+#endif
+
+#ifdef EVENT__HAVE_UINT8_T
+#define ev_uint8_t uint8_t
+#define ev_int8_t int8_t
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uint8_t ...
+#define ev_int8_t ...
+#else
+#define ev_uint8_t unsigned char
+#define ev_int8_t signed char
+#endif
+
+#ifdef EVENT__HAVE_UINTPTR_T
+#define ev_uintptr_t uintptr_t
+#define ev_intptr_t intptr_t
+#elif EVENT__SIZEOF_VOID_P <= 4
+#define ev_uintptr_t ev_uint32_t
+#define ev_intptr_t ev_int32_t
+#elif EVENT__SIZEOF_VOID_P <= 8
+#define ev_uintptr_t ev_uint64_t
+#define ev_intptr_t ev_int64_t
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_uintptr_t ...
+#define ev_intptr_t ...
+#else
+#error "No way to define ev_uintptr_t"
+#endif
+
+#ifdef EVENT__ssize_t
+#define ev_ssize_t EVENT__ssize_t
+#else
+#define ev_ssize_t ssize_t
+#endif
+
+/* Note that we define ev_off_t based on the compile-time size of off_t that
+ * we used to build Libevent, and not based on the current size of off_t.
+ * (For example, we don't define ev_off_t to off_t.). We do this because
+ * some systems let you build your software with different off_t sizes
+ * at runtime, and so putting in any dependency on off_t would risk API
+ * mismatch.
+ */
+#ifdef _WIN32
+#define ev_off_t ev_int64_t
+#elif EVENT__SIZEOF_OFF_T == 8
+#define ev_off_t ev_int64_t
+#elif EVENT__SIZEOF_OFF_T == 4
+#define ev_off_t ev_int32_t
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_off_t ...
+#else
+#define ev_off_t off_t
+#endif
+/**@}*/
+
+/* Limits for integer types.
+
+ We're making two assumptions here:
+ - The compiler does constant folding properly.
+ - The platform does signed arithmetic in two's complement.
+*/
+
+/**
+ @name Limits for integer types
+
+ These macros hold the largest or smallest values possible for the
+ ev_[u]int*_t types.
+
+ @{
+*/
+#define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)
+#define EV_INT64_MAX ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)
+#define EV_INT64_MIN ((-EV_INT64_MAX) - 1)
+#define EV_UINT32_MAX ((ev_uint32_t)0xffffffffUL)
+#define EV_INT32_MAX ((ev_int32_t) 0x7fffffffL)
+#define EV_INT32_MIN ((-EV_INT32_MAX) - 1)
+#define EV_UINT16_MAX ((ev_uint16_t)0xffffUL)
+#define EV_INT16_MAX ((ev_int16_t) 0x7fffL)
+#define EV_INT16_MIN ((-EV_INT16_MAX) - 1)
+#define EV_UINT8_MAX 255
+#define EV_INT8_MAX 127
+#define EV_INT8_MIN ((-EV_INT8_MAX) - 1)
+/** @} */
+
+/**
+ @name Limits for SIZE_T and SSIZE_T
+
+ @{
+*/
+#if EVENT__SIZEOF_SIZE_T == 8
+#define EV_SIZE_MAX EV_UINT64_MAX
+#define EV_SSIZE_MAX EV_INT64_MAX
+#elif EVENT__SIZEOF_SIZE_T == 4
+#define EV_SIZE_MAX EV_UINT32_MAX
+#define EV_SSIZE_MAX EV_INT32_MAX
+#elif defined(EVENT_IN_DOXYGEN_)
+#define EV_SIZE_MAX ...
+#define EV_SSIZE_MAX ...
+#else
+#error "No way to define SIZE_MAX"
+#endif
+
+#define EV_SSIZE_MIN ((-EV_SSIZE_MAX) - 1)
+/**@}*/
+
+#ifdef _WIN32
+#define ev_socklen_t int
+#elif defined(EVENT__socklen_t)
+#define ev_socklen_t EVENT__socklen_t
+#else
+#define ev_socklen_t socklen_t
+#endif
+
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
+#if !defined(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \
+ && !defined(ss_family)
+#define ss_family __ss_family
+#endif
+#endif
+
+/**
+ * A type wide enough to hold the output of "socket()" or "accept()". On
+ * Windows, this is an intptr_t; elsewhere, it is an int. */
+#ifdef _WIN32
+#define evutil_socket_t intptr_t
+#else
+#define evutil_socket_t int
+#endif
+
+/** Create two new sockets that are connected to each other.
+
+ On Unix, this simply calls socketpair(). On Windows, it uses the
+ loopback network interface on 127.0.0.1, and only
+ AF_INET,SOCK_STREAM are supported.
+
+ (This may fail on some Windows hosts where firewall software has cleverly
+ decided to keep 127.0.0.1 from talking to itself.)
+
+ Parameters and return values are as for socketpair()
+*/
+EVENT2_EXPORT_SYMBOL
+int evutil_socketpair(int d, int type, int protocol, evutil_socket_t sv[2]);
+/** Do platform-specific operations as needed to make a socket nonblocking.
+
+ @param sock The socket to make nonblocking
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_socket_nonblocking(evutil_socket_t sock);
+
+/** Do platform-specific operations to make a listener socket reusable.
+
+ Specifically, we want to make sure that another program will be able
+ to bind this address right after we've closed the listener.
+
+ This differs from Windows's interpretation of "reusable", which
+ allows multiple listeners to bind the same address at the same time.
+
+ @param sock The socket to make reusable
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_listen_socket_reuseable(evutil_socket_t sock);
+
+/** Do platform-specific operations as needed to close a socket upon a
+ successful execution of one of the exec*() functions.
+
+ @param sock The socket to be closed
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_socket_closeonexec(evutil_socket_t sock);
+
+/** Do the platform-specific call needed to close a socket returned from
+ socket() or accept().
+
+ @param sock The socket to be closed
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_closesocket(evutil_socket_t sock);
+#define EVUTIL_CLOSESOCKET(s) evutil_closesocket(s)
+
+/** Do platform-specific operations, if possible, to make a tcp listener
+ * socket defer accept()s until there is data to read.
+ *
+ * Not all platforms support this. You don't want to do this for every
+ * listener socket: only the ones that implement a protocol where the
+ * client transmits before the server needs to respond.
+ *
+ * @param sock The listening socket to to make deferred
+ * @return 0 on success (whether the operation is supported or not),
+ * -1 on failure
+*/
+EVENT2_EXPORT_SYMBOL
+int evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock);
+
+#ifdef _WIN32
+/** Return the most recent socket error. Not idempotent on all platforms. */
+#define EVUTIL_SOCKET_ERROR() WSAGetLastError()
+/** Replace the most recent socket error with errcode */
+#define EVUTIL_SET_SOCKET_ERROR(errcode) \
+ do { WSASetLastError(errcode); } while (0)
+/** Return the most recent socket error to occur on sock. */
+EVENT2_EXPORT_SYMBOL
+int evutil_socket_geterror(evutil_socket_t sock);
+/** Convert a socket error to a string. */
+EVENT2_EXPORT_SYMBOL
+const char *evutil_socket_error_to_string(int errcode);
+#elif defined(EVENT_IN_DOXYGEN_)
+/**
+ @name Socket error functions
+
+ These functions are needed for making programs compatible between
+ Windows and Unix-like platforms.
+
+ You see, Winsock handles socket errors differently from the rest of
+ the world. Elsewhere, a socket error is like any other error and is
+ stored in errno. But winsock functions require you to retrieve the
+ error with a special function, and don't let you use strerror for
+ the error codes. And handling EWOULDBLOCK is ... different.
+
+ @{
+*/
+/** Return the most recent socket error. Not idempotent on all platforms. */
+#define EVUTIL_SOCKET_ERROR() ...
+/** Replace the most recent socket error with errcode */
+#define EVUTIL_SET_SOCKET_ERROR(errcode) ...
+/** Return the most recent socket error to occur on sock. */
+#define evutil_socket_geterror(sock) ...
+/** Convert a socket error to a string. */
+#define evutil_socket_error_to_string(errcode) ...
+/**@}*/
+#else
+#define EVUTIL_SOCKET_ERROR() (errno)
+#define EVUTIL_SET_SOCKET_ERROR(errcode) \
+ do { errno = (errcode); } while (0)
+#define evutil_socket_geterror(sock) (errno)
+#define evutil_socket_error_to_string(errcode) (strerror(errcode))
+#endif
+
+
+/**
+ * @name Manipulation macros for struct timeval.
+ *
+ * We define replacements
+ * for timeradd, timersub, timerclear, timercmp, and timerisset.
+ *
+ * @{
+ */
+#ifdef EVENT__HAVE_TIMERADD
+#define evutil_timeradd(tvp, uvp, vvp) timeradd((tvp), (uvp), (vvp))
+#define evutil_timersub(tvp, uvp, vvp) timersub((tvp), (uvp), (vvp))
+#else
+#define evutil_timeradd(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
+ if ((vvp)->tv_usec >= 1000000) { \
+ (vvp)->tv_sec++; \
+ (vvp)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+#define evutil_timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif /* !EVENT__HAVE_TIMERADD */
+
+#ifdef EVENT__HAVE_TIMERCLEAR
+#define evutil_timerclear(tvp) timerclear(tvp)
+#else
+#define evutil_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+#endif
+/**@}*/
+
+/** Return true iff the tvp is related to uvp according to the relational
+ * operator cmp. Recognized values for cmp are ==, <=, <, >=, and >. */
+#define evutil_timercmp(tvp, uvp, cmp) \
+ (((tvp)->tv_sec == (uvp)->tv_sec) ? \
+ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec))
+
+#ifdef EVENT__HAVE_TIMERISSET
+#define evutil_timerisset(tvp) timerisset(tvp)
+#else
+#define evutil_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+#endif
+
+/** Replacement for offsetof on platforms that don't define it. */
+#ifdef offsetof
+#define evutil_offsetof(type, field) offsetof(type, field)
+#else
+#define evutil_offsetof(type, field) ((off_t)(&((type *)0)->field))
+#endif
+
+/* big-int related functions */
+/** Parse a 64-bit value from a string. Arguments are as for strtol. */
+EVENT2_EXPORT_SYMBOL
+ev_int64_t evutil_strtoll(const char *s, char **endptr, int base);
+
+/** Replacement for gettimeofday on platforms that lack it. */
+#ifdef EVENT__HAVE_GETTIMEOFDAY
+#define evutil_gettimeofday(tv, tz) gettimeofday((tv), (tz))
+#else
+struct timezone;
+EVENT2_EXPORT_SYMBOL
+int evutil_gettimeofday(struct timeval *tv, struct timezone *tz);
+#endif
+
+/** Replacement for snprintf to get consistent behavior on platforms for
+ which the return value of snprintf does not conform to C99.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
+#ifdef __GNUC__
+ __attribute__((format(printf, 3, 4)))
+#endif
+;
+/** Replacement for vsnprintf to get consistent behavior on platforms for
+ which the return value of snprintf does not conform to C99.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
+#ifdef __GNUC__
+ __attribute__((format(printf, 3, 0)))
+#endif
+;
+
+/** Replacement for inet_ntop for platforms which lack it. */
+EVENT2_EXPORT_SYMBOL
+const char *evutil_inet_ntop(int af, const void *src, char *dst, size_t len);
+/** Replacement for inet_pton for platforms which lack it. */
+EVENT2_EXPORT_SYMBOL
+int evutil_inet_pton(int af, const char *src, void *dst);
+struct sockaddr;
+
+/** Parse an IPv4 or IPv6 address, with optional port, from a string.
+
+ Recognized formats are:
+ - [IPv6Address]:port
+ - [IPv6Address]
+ - IPv6Address
+ - IPv4Address:port
+ - IPv4Address
+
+ If no port is specified, the port in the output is set to 0.
+
+ @param str The string to parse.
+ @param out A struct sockaddr to hold the result. This should probably be
+ a struct sockaddr_storage.
+ @param outlen A pointer to the number of bytes that that 'out' can safely
+ hold. Set to the number of bytes used in 'out' on success.
+ @return -1 if the address is not well-formed, if the port is out of range,
+ or if out is not large enough to hold the result. Otherwise returns
+ 0 on success.
+*/
+EVENT2_EXPORT_SYMBOL
+int evutil_parse_sockaddr_port(const char *str, struct sockaddr *out, int *outlen);
+
+/** Compare two sockaddrs; return 0 if they are equal, or less than 0 if sa1
+ * preceeds sa2, or greater than 0 if sa1 follows sa2. If include_port is
+ * true, consider the port as well as the address. Only implemented for
+ * AF_INET and AF_INET6 addresses. The ordering is not guaranteed to remain
+ * the same between Libevent versions. */
+EVENT2_EXPORT_SYMBOL
+int evutil_sockaddr_cmp(const struct sockaddr *sa1, const struct sockaddr *sa2,
+ int include_port);
+
+/** As strcasecmp, but always compares the characters in locale-independent
+ ASCII. That's useful if you're handling data in ASCII-based protocols.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_ascii_strcasecmp(const char *str1, const char *str2);
+/** As strncasecmp, but always compares the characters in locale-independent
+ ASCII. That's useful if you're handling data in ASCII-based protocols.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_ascii_strncasecmp(const char *str1, const char *str2, size_t n);
+
+/* Here we define evutil_addrinfo to the native addrinfo type, or redefine it
+ * if this system has no getaddrinfo(). */
+#ifdef EVENT__HAVE_STRUCT_ADDRINFO
+#define evutil_addrinfo addrinfo
+#else
+/** A definition of struct addrinfo for systems that lack it.
+
+ (This is just an alias for struct addrinfo if the system defines
+ struct addrinfo.)
+*/
+struct evutil_addrinfo {
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ size_t ai_addrlen; /* length of ai_addr */
+ char *ai_canonname; /* canonical name for nodename */
+ struct sockaddr *ai_addr; /* binary address */
+ struct evutil_addrinfo *ai_next; /* next structure in linked list */
+};
+#endif
+/** @name evutil_getaddrinfo() error codes
+
+ These values are possible error codes for evutil_getaddrinfo() and
+ related functions.
+
+ @{
+*/
+#if defined(EAI_ADDRFAMILY) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_ADDRFAMILY EAI_ADDRFAMILY
+#else
+#define EVUTIL_EAI_ADDRFAMILY -901
+#endif
+#if defined(EAI_AGAIN) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_AGAIN EAI_AGAIN
+#else
+#define EVUTIL_EAI_AGAIN -902
+#endif
+#if defined(EAI_BADFLAGS) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_BADFLAGS EAI_BADFLAGS
+#else
+#define EVUTIL_EAI_BADFLAGS -903
+#endif
+#if defined(EAI_FAIL) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_FAIL EAI_FAIL
+#else
+#define EVUTIL_EAI_FAIL -904
+#endif
+#if defined(EAI_FAMILY) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_FAMILY EAI_FAMILY
+#else
+#define EVUTIL_EAI_FAMILY -905
+#endif
+#if defined(EAI_MEMORY) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_MEMORY EAI_MEMORY
+#else
+#define EVUTIL_EAI_MEMORY -906
+#endif
+/* This test is a bit complicated, since some MS SDKs decide to
+ * remove NODATA or redefine it to be the same as NONAME, in a
+ * fun interpretation of RFC 2553 and RFC 3493. */
+#if defined(EAI_NODATA) && defined(EVENT__HAVE_GETADDRINFO) && (!defined(EAI_NONAME) || EAI_NODATA != EAI_NONAME)
+#define EVUTIL_EAI_NODATA EAI_NODATA
+#else
+#define EVUTIL_EAI_NODATA -907
+#endif
+#if defined(EAI_NONAME) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_NONAME EAI_NONAME
+#else
+#define EVUTIL_EAI_NONAME -908
+#endif
+#if defined(EAI_SERVICE) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_SERVICE EAI_SERVICE
+#else
+#define EVUTIL_EAI_SERVICE -909
+#endif
+#if defined(EAI_SOCKTYPE) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_SOCKTYPE EAI_SOCKTYPE
+#else
+#define EVUTIL_EAI_SOCKTYPE -910
+#endif
+#if defined(EAI_SYSTEM) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_EAI_SYSTEM EAI_SYSTEM
+#else
+#define EVUTIL_EAI_SYSTEM -911
+#endif
+
+#define EVUTIL_EAI_CANCEL -90001
+
+#if defined(AI_PASSIVE) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_PASSIVE AI_PASSIVE
+#else
+#define EVUTIL_AI_PASSIVE 0x1000
+#endif
+#if defined(AI_CANONNAME) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_CANONNAME AI_CANONNAME
+#else
+#define EVUTIL_AI_CANONNAME 0x2000
+#endif
+#if defined(AI_NUMERICHOST) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_NUMERICHOST AI_NUMERICHOST
+#else
+#define EVUTIL_AI_NUMERICHOST 0x4000
+#endif
+#if defined(AI_NUMERICSERV) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_NUMERICSERV AI_NUMERICSERV
+#else
+#define EVUTIL_AI_NUMERICSERV 0x8000
+#endif
+#if defined(AI_V4MAPPED) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_V4MAPPED AI_V4MAPPED
+#else
+#define EVUTIL_AI_V4MAPPED 0x10000
+#endif
+#if defined(AI_ALL) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_ALL AI_ALL
+#else
+#define EVUTIL_AI_ALL 0x20000
+#endif
+#if defined(AI_ADDRCONFIG) && defined(EVENT__HAVE_GETADDRINFO)
+#define EVUTIL_AI_ADDRCONFIG AI_ADDRCONFIG
+#else
+#define EVUTIL_AI_ADDRCONFIG 0x40000
+#endif
+/**@}*/
+
+struct evutil_addrinfo;
+/**
+ * This function clones getaddrinfo for systems that don't have it. For full
+ * details, see RFC 3493, section 6.1.
+ *
+ * Limitations:
+ * - When the system has no getaddrinfo, we fall back to gethostbyname_r or
+ * gethostbyname, with their attendant issues.
+ * - The AI_V4MAPPED and AI_ALL flags are not currently implemented.
+ *
+ * For a nonblocking variant, see evdns_getaddrinfo.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_getaddrinfo(const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in, struct evutil_addrinfo **res);
+
+/** Release storage allocated by evutil_getaddrinfo or evdns_getaddrinfo. */
+EVENT2_EXPORT_SYMBOL
+void evutil_freeaddrinfo(struct evutil_addrinfo *ai);
+
+EVENT2_EXPORT_SYMBOL
+const char *evutil_gai_strerror(int err);
+
+/** Generate n bytes of secure pseudorandom data, and store them in buf.
+ *
+ * Current versions of Libevent use an ARC4-based random number generator,
+ * seeded using the platform's entropy source (/dev/urandom on Unix-like
+ * systems; CryptGenRandom on Windows). This is not actually as secure as it
+ * should be: ARC4 is a pretty lousy cipher, and the current implementation
+ * provides only rudimentary prediction- and backtracking-resistance. Don't
+ * use this for serious cryptographic applications.
+ */
+EVENT2_EXPORT_SYMBOL
+void evutil_secure_rng_get_bytes(void *buf, size_t n);
+
+/**
+ * Seed the secure random number generator if needed, and return 0 on
+ * success or -1 on failure.
+ *
+ * It is okay to call this function more than once; it will still return
+ * 0 if the RNG has been successfully seeded and -1 if it can't be
+ * seeded.
+ *
+ * Ordinarily you don't need to call this function from your own code;
+ * Libevent will seed the RNG itself the first time it needs good random
+ * numbers. You only need to call it if (a) you want to double-check
+ * that one of the seeding methods did succeed, or (b) you plan to drop
+ * the capability to seed (by chrooting, or dropping capabilities, or
+ * whatever), and you want to make sure that seeding happens before your
+ * program loses the ability to do it.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_secure_rng_init(void);
+
+/**
+ * Set a filename to use in place of /dev/urandom for seeding the secure
+ * PRNG. Return 0 on success, -1 on failure.
+ *
+ * Call this function BEFORE calling any other initialization or RNG
+ * functions.
+ *
+ * (This string will _NOT_ be copied internally. Do not free it while any
+ * user of the secure RNG might be running. Don't pass anything other than a
+ * real /dev/...random device file here, or you might lose security.)
+ *
+ * This API is unstable, and might change in a future libevent version.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_secure_rng_set_urandom_device_file(char *fname);
+
+/** Seed the random number generator with extra random bytes.
+
+ You should almost never need to call this function; it should be
+ sufficient to invoke evutil_secure_rng_init(), or let Libevent take
+ care of calling evutil_secure_rng_init() on its own.
+
+ If you call this function as a _replacement_ for the regular
+ entropy sources, then you need to be sure that your input
+ contains a fairly large amount of strong entropy. Doing so is
+ notoriously hard: most people who try get it wrong. Watch out!
+
+ @param dat a buffer full of a strong source of random numbers
+ @param datlen the number of bytes to read from datlen
+ */
+EVENT2_EXPORT_SYMBOL
+void evutil_secure_rng_add_bytes(const char *dat, size_t datlen);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT1_EVUTIL_H_INCLUDED_ */
diff --git a/sntp/libevent/include/event2/visibility.h b/sntp/libevent/include/event2/visibility.h
new file mode 100644
index 0000000..5e7163a
--- /dev/null
+++ b/sntp/libevent/include/event2/visibility.h
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT2_VISIBILITY_H_INCLUDED_
+#define EVENT2_VISIBILITY_H_INCLUDED_
+
+#include <event2/event-config.h>
+
+#if defined(event_EXPORTS) || defined(event_extra_EXPORTS) || defined(event_core_EXPORTS)
+
+#if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define EVENT2_EXPORT_SYMBOL __global
+#elif defined __GNUC__
+#define EVENT2_EXPORT_SYMBOL __attribute__ ((visibility("default")))
+#elif defined(_MSC_VER)
+#define EVENT2_EXPORT_SYMBOL extern __declspec(dllexport)
+#else
+/* unknown compiler */
+#define EVENT2_EXPORT_SYMBOL
+#endif
+
+#else
+
+#if defined(EVENT__NEED_DLLIMPORT) && defined(_MSC_VER) && !defined(EVENT_BUILDING_REGRESS_TEST)
+#define EVENT2_EXPORT_SYMBOL extern __declspec(dllimport)
+#else
+#define EVENT2_EXPORT_SYMBOL
+#endif
+
+#endif
+
+#endif /* EVENT2_VISIBILITY_H_INCLUDED_ */
diff --git a/sntp/libevent/include/evhttp.h b/sntp/libevent/include/evhttp.h
new file mode 100644
index 0000000..549bc9b
--- /dev/null
+++ b/sntp/libevent/include/evhttp.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT1_EVHTTP_H_INCLUDED_
+#define EVENT1_EVHTTP_H_INCLUDED_
+
+/** @file evhttp.h
+
+ An http implementation subsystem for Libevent.
+
+ The <evhttp.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/http.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other <event2/...>
+ headers.
+ */
+
+#include <event.h>
+#include <event2/http.h>
+#include <event2/http_struct.h>
+#include <event2/http_compat.h>
+
+#endif /* EVENT1_EVHTTP_H_INCLUDED_ */
diff --git a/sntp/libevent/include/evrpc.h b/sntp/libevent/include/evrpc.h
new file mode 100644
index 0000000..7e986f7
--- /dev/null
+++ b/sntp/libevent/include/evrpc.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT1_EVRPC_H_INCLUDED_
+#define EVENT1_EVRPC_H_INCLUDED_
+
+/** @file evrpc.h
+
+ An RPC system for Libevent.
+
+ The <evrpc.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/rpc.h> instead. Depending on what functionality you
+ need, you may also want to include more of the other <event2/...>
+ headers.
+ */
+
+#include <event.h>
+#include <event2/rpc.h>
+#include <event2/rpc_struct.h>
+#include <event2/rpc_compat.h>
+
+#endif /* EVENT1_EVRPC_H_INCLUDED_ */
diff --git a/sntp/libevent/include/evutil.h b/sntp/libevent/include/evutil.h
new file mode 100644
index 0000000..12c137d
--- /dev/null
+++ b/sntp/libevent/include/evutil.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef EVENT1_EVUTIL_H_INCLUDED_
+#define EVENT1_EVUTIL_H_INCLUDED_
+
+/** @file evutil.h
+
+ Utility and compatibility functions for Libevent.
+
+ The <evutil.h> header is deprecated in Libevent 2.0 and later; please
+ use <event2/util.h> instead.
+*/
+
+#include <event2/util.h>
+
+#endif /* EVENT1_EVUTIL_H_INCLUDED_ */
diff --git a/sntp/libevent/include/include.am b/sntp/libevent/include/include.am
new file mode 100644
index 0000000..9aad2db
--- /dev/null
+++ b/sntp/libevent/include/include.am
@@ -0,0 +1,46 @@
+# include/Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+include_event2dir = $(includedir)/event2
+
+EVENT2_EXPORT = \
+ include/event2/buffer.h \
+ include/event2/buffer_compat.h \
+ include/event2/bufferevent.h \
+ include/event2/bufferevent_compat.h \
+ include/event2/bufferevent_ssl.h \
+ include/event2/bufferevent_struct.h \
+ include/event2/dns.h \
+ include/event2/dns_compat.h \
+ include/event2/dns_struct.h \
+ include/event2/event.h \
+ include/event2/event_compat.h \
+ include/event2/event_struct.h \
+ include/event2/http.h \
+ include/event2/http_compat.h \
+ include/event2/http_struct.h \
+ include/event2/keyvalq_struct.h \
+ include/event2/listener.h \
+ include/event2/rpc.h \
+ include/event2/rpc_compat.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
+
+## Without the nobase_ prefixing, Automake would strip "include/event2/" from
+## the source header filename to derive the installed header filename.
+## With nobase_ the installed path is $(includedir)/include/event2/ev*.h.
+
+if INSTALL_LIBEVENT
+include_event2_HEADERS = $(EVENT2_EXPORT)
+nodist_include_event2_HEADERS = include/event2/event-config.h
+else
+noinst_HEADERS += $(EVENT2_EXPORT)
+nodist_noinst_HEADERS = include/event2/event-config.h
+endif
diff --git a/sntp/libevent/iocp-internal.h b/sntp/libevent/iocp-internal.h
new file mode 100644
index 0000000..93dbe2b
--- /dev/null
+++ b/sntp/libevent/iocp-internal.h
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IOCP_INTERNAL_H_INCLUDED_
+#define IOCP_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct event_overlapped;
+struct event_iocp_port;
+struct evbuffer;
+typedef void (*iocp_callback)(struct event_overlapped *, ev_uintptr_t, ev_ssize_t, int success);
+
+/* This whole file is actually win32 only. We wrap the structures in a win32
+ * ifdef so that we can test-compile code that uses these interfaces on
+ * non-win32 platforms. */
+#ifdef _WIN32
+
+/**
+ Internal use only. Wraps an OVERLAPPED that we're using for libevent
+ functionality. Whenever an event_iocp_port gets an event for a given
+ OVERLAPPED*, it upcasts the pointer to an event_overlapped, and calls the
+ iocp_callback function with the event_overlapped, the iocp key, and the
+ number of bytes transferred as arguments.
+ */
+struct event_overlapped {
+ OVERLAPPED overlapped;
+ iocp_callback cb;
+};
+
+/* Mingw's headers don't define LPFN_ACCEPTEX. */
+
+typedef BOOL (WINAPI *AcceptExPtr)(SOCKET, SOCKET, PVOID, DWORD, DWORD, DWORD, LPDWORD, LPOVERLAPPED);
+typedef BOOL (WINAPI *ConnectExPtr)(SOCKET, const struct sockaddr *, int, PVOID, DWORD, LPDWORD, LPOVERLAPPED);
+typedef void (WINAPI *GetAcceptExSockaddrsPtr)(PVOID, DWORD, DWORD, DWORD, LPSOCKADDR *, LPINT, LPSOCKADDR *, LPINT);
+
+/** Internal use only. Holds pointers to functions that only some versions of
+ Windows provide.
+ */
+struct win32_extension_fns {
+ AcceptExPtr AcceptEx;
+ ConnectExPtr ConnectEx;
+ GetAcceptExSockaddrsPtr GetAcceptExSockaddrs;
+};
+
+/**
+ Internal use only. Stores a Windows IO Completion port, along with
+ related data.
+ */
+struct event_iocp_port {
+ /** The port itself */
+ HANDLE port;
+ /* A lock to cover internal structures. */
+ CRITICAL_SECTION lock;
+ /** Number of threads ever open on the port. */
+ short n_threads;
+ /** True iff we're shutting down all the threads on this port */
+ short shutdown;
+ /** How often the threads on this port check for shutdown and other
+ * conditions */
+ long ms;
+ /* The threads that are waiting for events. */
+ HANDLE *threads;
+ /** Number of threads currently open on this port. */
+ short n_live_threads;
+ /** A semaphore to signal when we are done shutting down. */
+ HANDLE *shutdownSemaphore;
+};
+
+const struct win32_extension_fns *event_get_win32_extension_fns_(void);
+#else
+/* Dummy definition so we can test-compile more things on unix. */
+struct event_overlapped {
+ iocp_callback cb;
+};
+#endif
+
+/** Initialize the fields in an event_overlapped.
+
+ @param overlapped The struct event_overlapped to initialize
+ @param cb The callback that should be invoked once the IO operation has
+ finished.
+ */
+void event_overlapped_init_(struct event_overlapped *, iocp_callback cb);
+
+/** Allocate and return a new evbuffer that supports overlapped IO on a given
+ socket. The socket must be associated with an IO completion port using
+ event_iocp_port_associate_.
+*/
+struct evbuffer *evbuffer_overlapped_new_(evutil_socket_t fd);
+
+/** XXXX Document (nickm) */
+evutil_socket_t evbuffer_overlapped_get_fd_(struct evbuffer *buf);
+
+void evbuffer_overlapped_set_fd_(struct evbuffer *buf, evutil_socket_t fd);
+
+/** Start reading data onto the end of an overlapped evbuffer.
+
+ An evbuffer can only have one read pending at a time. While the read
+ is in progress, no other data may be added to the end of the buffer.
+ The buffer must be created with event_overlapped_init_().
+ evbuffer_commit_read_() must be called in the completion callback.
+
+ @param buf The buffer to read onto
+ @param n The number of bytes to try to read.
+ @param ol Overlapped object with associated completion callback.
+ @return 0 on success, -1 on error.
+ */
+int evbuffer_launch_read_(struct evbuffer *buf, size_t n, struct event_overlapped *ol);
+
+/** Start writing data from the start of an evbuffer.
+
+ An evbuffer can only have one write pending at a time. While the write is
+ in progress, no other data may be removed from the front of the buffer.
+ The buffer must be created with event_overlapped_init_().
+ evbuffer_commit_write_() must be called in the completion callback.
+
+ @param buf The buffer to read onto
+ @param n The number of bytes to try to read.
+ @param ol Overlapped object with associated completion callback.
+ @return 0 on success, -1 on error.
+ */
+int evbuffer_launch_write_(struct evbuffer *buf, ev_ssize_t n, struct event_overlapped *ol);
+
+/** XXX document */
+void evbuffer_commit_read_(struct evbuffer *, ev_ssize_t);
+void evbuffer_commit_write_(struct evbuffer *, ev_ssize_t);
+
+/** Create an IOCP, and launch its worker threads. Internal use only.
+
+ This interface is unstable, and will change.
+ */
+struct event_iocp_port *event_iocp_port_launch_(int n_cpus);
+
+/** Associate a file descriptor with an iocp, such that overlapped IO on the
+ fd will happen on one of the iocp's worker threads.
+*/
+int event_iocp_port_associate_(struct event_iocp_port *port, evutil_socket_t fd,
+ ev_uintptr_t key);
+
+/** Tell all threads serving an iocp to stop. Wait for up to waitMsec for all
+ the threads to finish whatever they're doing. If waitMsec is -1, wait
+ as long as required. If all the threads are done, free the port and return
+ 0. Otherwise, return -1. If you get a -1 return value, it is safe to call
+ this function again.
+*/
+int event_iocp_shutdown_(struct event_iocp_port *port, long waitMsec);
+
+/* FIXME document. */
+int event_iocp_activate_overlapped_(struct event_iocp_port *port,
+ struct event_overlapped *o,
+ ev_uintptr_t key, ev_uint32_t n_bytes);
+
+struct event_base;
+/* FIXME document. */
+struct event_iocp_port *event_base_get_iocp_(struct event_base *base);
+
+/* FIXME document. */
+int event_base_start_iocp_(struct event_base *base, int n_cpus);
+void event_base_stop_iocp_(struct event_base *base);
+
+/* FIXME document. */
+struct bufferevent *bufferevent_async_new_(struct event_base *base,
+ evutil_socket_t fd, int options);
+
+/* FIXME document. */
+void bufferevent_async_set_connected_(struct bufferevent *bev);
+int bufferevent_async_can_connect_(struct bufferevent *bev);
+int bufferevent_async_connect_(struct bufferevent *bev, evutil_socket_t fd,
+ const struct sockaddr *sa, int socklen);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/ipv6-internal.h b/sntp/libevent/ipv6-internal.h
new file mode 100644
index 0000000..0c20737
--- /dev/null
+++ b/sntp/libevent/ipv6-internal.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Internal use only: Fake IPv6 structures and values on platforms that
+ * do not have them */
+
+#ifndef IPV6_INTERNAL_H_INCLUDED_
+#define IPV6_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include "event2/util.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file ipv6-internal.h
+ *
+ * Replacement types and functions for platforms that don't support ipv6
+ * properly.
+ */
+
+#ifndef EVENT__HAVE_STRUCT_IN6_ADDR
+struct in6_addr {
+ ev_uint8_t s6_addr[16];
+};
+#endif
+
+#ifndef EVENT__HAVE_SA_FAMILY_T
+typedef int sa_family_t;
+#endif
+
+#ifndef EVENT__HAVE_STRUCT_SOCKADDR_IN6
+struct sockaddr_in6 {
+ /* This will fail if we find a struct sockaddr that doesn't have
+ * sa_family as the first element. */
+ sa_family_t sin6_family;
+ ev_uint16_t sin6_port;
+ struct in6_addr sin6_addr;
+};
+#endif
+
+#ifndef AF_INET6
+#define AF_INET6 3333
+#endif
+#ifndef PF_INET6
+#define PF_INET6 AF_INET6
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/kqueue-internal.h b/sntp/libevent/kqueue-internal.h
new file mode 100644
index 0000000..02c5a36
--- /dev/null
+++ b/sntp/libevent/kqueue-internal.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef KQUEUE_INTERNAL_H_INCLUDED_
+#define KQUEUE_INTERNAL_H_INCLUDED_
+
+/** Notification function, used to tell an event base to wake up from another
+ * thread. Only works when event_kq_add_notify_event_() has previously been
+ * called successfully on that base. */
+int event_kq_notify_base_(struct event_base *base);
+
+/** Prepare a kqueue-using event base to receive notifications via an internal
+ * EVFILT_USER event. Return 0 on sucess, -1 on failure.
+ */
+int event_kq_add_notify_event_(struct event_base *base);
+
+#endif
diff --git a/sntp/libevent/kqueue.c b/sntp/libevent/kqueue.c
new file mode 100644
index 0000000..3933467
--- /dev/null
+++ b/sntp/libevent/kqueue.c
@@ -0,0 +1,549 @@
+/* $OpenBSD: kqueue.c,v 1.5 2002/07/10 14:41:31 art Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_KQUEUE
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <sys/event.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+/* Some platforms apparently define the udata field of struct kevent as
+ * intptr_t, whereas others define it as void*. There doesn't seem to be an
+ * easy way to tell them apart via autoconf, so we need to use OS macros. */
+#if defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__)
+#define PTR_TO_UDATA(x) ((intptr_t)(x))
+#define INT_TO_UDATA(x) ((intptr_t)(x))
+#else
+#define PTR_TO_UDATA(x) (x)
+#define INT_TO_UDATA(x) ((void*)(x))
+#endif
+
+#include "event-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "changelist-internal.h"
+
+#include "kqueue-internal.h"
+
+#define NEVENT 64
+
+struct kqop {
+ struct kevent *changes;
+ int changes_size;
+
+ struct kevent *events;
+ int events_size;
+ int kq;
+ int notify_event_added;
+ pid_t pid;
+};
+
+static void kqop_free(struct kqop *kqop);
+
+static void *kq_init(struct event_base *);
+static int kq_sig_add(struct event_base *, int, short, short, void *);
+static int kq_sig_del(struct event_base *, int, short, short, void *);
+static int kq_dispatch(struct event_base *, struct timeval *);
+static void kq_dealloc(struct event_base *);
+
+const struct eventop kqops = {
+ "kqueue",
+ kq_init,
+ event_changelist_add_,
+ event_changelist_del_,
+ kq_dispatch,
+ kq_dealloc,
+ 1 /* need reinit */,
+ EV_FEATURE_ET|EV_FEATURE_O1|EV_FEATURE_FDS,
+ EVENT_CHANGELIST_FDINFO_SIZE
+};
+
+static const struct eventop kqsigops = {
+ "kqueue_signal",
+ NULL,
+ kq_sig_add,
+ kq_sig_del,
+ NULL,
+ NULL,
+ 1 /* need reinit */,
+ 0,
+ 0
+};
+
+static void *
+kq_init(struct event_base *base)
+{
+ int kq = -1;
+ struct kqop *kqueueop = NULL;
+
+ if (!(kqueueop = mm_calloc(1, sizeof(struct kqop))))
+ return (NULL);
+
+/* Initialize the kernel queue */
+
+ if ((kq = kqueue()) == -1) {
+ event_warn("kqueue");
+ goto err;
+ }
+
+ kqueueop->kq = kq;
+
+ kqueueop->pid = getpid();
+
+ /* Initialize fields */
+ kqueueop->changes = mm_calloc(NEVENT, sizeof(struct kevent));
+ if (kqueueop->changes == NULL)
+ goto err;
+ kqueueop->events = mm_calloc(NEVENT, sizeof(struct kevent));
+ if (kqueueop->events == NULL)
+ goto err;
+ kqueueop->events_size = kqueueop->changes_size = NEVENT;
+
+ /* Check for Mac OS X kqueue bug. */
+ memset(&kqueueop->changes[0], 0, sizeof kqueueop->changes[0]);
+ kqueueop->changes[0].ident = -1;
+ kqueueop->changes[0].filter = EVFILT_READ;
+ kqueueop->changes[0].flags = EV_ADD;
+ /*
+ * If kqueue works, then kevent will succeed, and it will
+ * stick an error in events[0]. If kqueue is broken, then
+ * kevent will fail.
+ */
+ if (kevent(kq,
+ kqueueop->changes, 1, kqueueop->events, NEVENT, NULL) != 1 ||
+ (int)kqueueop->events[0].ident != -1 ||
+ kqueueop->events[0].flags != EV_ERROR) {
+ event_warn("%s: detected broken kqueue; not using.", __func__);
+ goto err;
+ }
+
+ base->evsigsel = &kqsigops;
+
+ return (kqueueop);
+err:
+ if (kqueueop)
+ kqop_free(kqueueop);
+
+ return (NULL);
+}
+
+#define ADD_UDATA 0x30303
+
+static void
+kq_setup_kevent(struct kevent *out, evutil_socket_t fd, int filter, short change)
+{
+ memset(out, 0, sizeof(struct kevent));
+ out->ident = fd;
+ out->filter = filter;
+
+ if (change & EV_CHANGE_ADD) {
+ out->flags = EV_ADD;
+ /* We set a magic number here so that we can tell 'add'
+ * errors from 'del' errors. */
+ out->udata = INT_TO_UDATA(ADD_UDATA);
+ if (change & EV_ET)
+ out->flags |= EV_CLEAR;
+#ifdef NOTE_EOF
+ /* Make it behave like select() and poll() */
+ if (filter == EVFILT_READ)
+ out->fflags = NOTE_EOF;
+#endif
+ } else {
+ EVUTIL_ASSERT(change & EV_CHANGE_DEL);
+ out->flags = EV_DELETE;
+ }
+}
+
+static int
+kq_build_changes_list(const struct event_changelist *changelist,
+ struct kqop *kqop)
+{
+ int i;
+ int n_changes = 0;
+
+ for (i = 0; i < changelist->n_changes; ++i) {
+ struct event_change *in_ch = &changelist->changes[i];
+ struct kevent *out_ch;
+ if (n_changes >= kqop->changes_size - 1) {
+ int newsize = kqop->changes_size * 2;
+ struct kevent *newchanges;
+
+ newchanges = mm_realloc(kqop->changes,
+ newsize * sizeof(struct kevent));
+ if (newchanges == NULL) {
+ event_warn("%s: realloc", __func__);
+ return (-1);
+ }
+ kqop->changes = newchanges;
+ kqop->changes_size = newsize;
+ }
+ if (in_ch->read_change) {
+ out_ch = &kqop->changes[n_changes++];
+ kq_setup_kevent(out_ch, in_ch->fd, EVFILT_READ,
+ in_ch->read_change);
+ }
+ if (in_ch->write_change) {
+ out_ch = &kqop->changes[n_changes++];
+ kq_setup_kevent(out_ch, in_ch->fd, EVFILT_WRITE,
+ in_ch->write_change);
+ }
+ }
+ return n_changes;
+}
+
+static int
+kq_grow_events(struct kqop *kqop, size_t new_size)
+{
+ struct kevent *newresult;
+
+ newresult = mm_realloc(kqop->events,
+ new_size * sizeof(struct kevent));
+
+ if (newresult) {
+ kqop->events = newresult;
+ kqop->events_size = new_size;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+static int
+kq_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct kqop *kqop = base->evbase;
+ struct kevent *events = kqop->events;
+ struct kevent *changes;
+ struct timespec ts, *ts_p = NULL;
+ int i, n_changes, res;
+
+ if (tv != NULL) {
+ TIMEVAL_TO_TIMESPEC(tv, &ts);
+ ts_p = &ts;
+ }
+
+ /* Build "changes" from "base->changes" */
+ EVUTIL_ASSERT(kqop->changes);
+ n_changes = kq_build_changes_list(&base->changelist, kqop);
+ if (n_changes < 0)
+ return -1;
+
+ event_changelist_remove_all_(&base->changelist, base);
+
+ /* steal the changes array in case some broken code tries to call
+ * dispatch twice at once. */
+ changes = kqop->changes;
+ kqop->changes = NULL;
+
+ /* Make sure that 'events' is at least as long as the list of changes:
+ * otherwise errors in the changes can get reported as a -1 return
+ * value from kevent() rather than as EV_ERROR events in the events
+ * array.
+ *
+ * (We could instead handle -1 return values from kevent() by
+ * retrying with a smaller changes array or a larger events array,
+ * but this approach seems less risky for now.)
+ */
+ if (kqop->events_size < n_changes) {
+ int new_size = kqop->events_size;
+ do {
+ new_size *= 2;
+ } while (new_size < n_changes);
+
+ kq_grow_events(kqop, new_size);
+ events = kqop->events;
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = kevent(kqop->kq, changes, n_changes,
+ events, kqop->events_size, ts_p);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ EVUTIL_ASSERT(kqop->changes == NULL);
+ kqop->changes = changes;
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("kevent");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: kevent reports %d", __func__, res));
+
+ for (i = 0; i < res; i++) {
+ int which = 0;
+
+ if (events[i].flags & EV_ERROR) {
+ switch (events[i].data) {
+
+ /* Can occur on delete if we are not currently
+ * watching any events on this fd. That can
+ * happen when the fd was closed and another
+ * file was opened with that fd. */
+ case ENOENT:
+ /* Can occur for reasons not fully understood
+ * on FreeBSD. */
+ case EINVAL:
+ continue;
+
+ /* Can occur on a delete if the fd is closed. */
+ case EBADF:
+ /* XXXX On NetBSD, we can also get EBADF if we
+ * try to add the write side of a pipe, but
+ * the read side has already been closed.
+ * Other BSDs call this situation 'EPIPE'. It
+ * would be good if we had a way to report
+ * this situation. */
+ continue;
+ /* These two can occur on an add if the fd was one side
+ * of a pipe, and the other side was closed. */
+ case EPERM:
+ case EPIPE:
+ /* Report read events, if we're listening for
+ * them, so that the user can learn about any
+ * add errors. (If the operation was a
+ * delete, then udata should be cleared.) */
+ if (events[i].udata) {
+ /* The operation was an add:
+ * report the error as a read. */
+ which |= EV_READ;
+ break;
+ } else {
+ /* The operation was a del:
+ * report nothing. */
+ continue;
+ }
+
+ /* Other errors shouldn't occur. */
+ default:
+ errno = events[i].data;
+ return (-1);
+ }
+ } else if (events[i].filter == EVFILT_READ) {
+ which |= EV_READ;
+ } else if (events[i].filter == EVFILT_WRITE) {
+ which |= EV_WRITE;
+ } else if (events[i].filter == EVFILT_SIGNAL) {
+ which |= EV_SIGNAL;
+#ifdef EVFILT_USER
+ } else if (events[i].filter == EVFILT_USER) {
+ base->is_notify_pending = 0;
+#endif
+ }
+
+ if (!which)
+ continue;
+
+ if (events[i].filter == EVFILT_SIGNAL) {
+ evmap_signal_active_(base, events[i].ident, 1);
+ } else {
+ evmap_io_active_(base, events[i].ident, which | EV_ET);
+ }
+ }
+
+ if (res == kqop->events_size) {
+ /* We used all the events space that we have. Maybe we should
+ make it bigger. */
+ kq_grow_events(kqop, kqop->events_size * 2);
+ }
+
+ return (0);
+}
+
+static void
+kqop_free(struct kqop *kqop)
+{
+ if (kqop->changes)
+ mm_free(kqop->changes);
+ if (kqop->events)
+ mm_free(kqop->events);
+ if (kqop->kq >= 0 && kqop->pid == getpid())
+ close(kqop->kq);
+ memset(kqop, 0, sizeof(struct kqop));
+ mm_free(kqop);
+}
+
+static void
+kq_dealloc(struct event_base *base)
+{
+ struct kqop *kqop = base->evbase;
+ evsig_dealloc_(base);
+ kqop_free(kqop);
+}
+
+/* signal handling */
+static int
+kq_sig_add(struct event_base *base, int nsignal, short old, short events, void *p)
+{
+ struct kqop *kqop = base->evbase;
+ struct kevent kev;
+ struct timespec timeout = { 0, 0 };
+ (void)p;
+
+ EVUTIL_ASSERT(nsignal >= 0 && nsignal < NSIG);
+
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = nsignal;
+ kev.filter = EVFILT_SIGNAL;
+ kev.flags = EV_ADD;
+
+ /* Be ready for the signal if it is sent any
+ * time between now and the next call to
+ * kq_dispatch. */
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1)
+ return (-1);
+
+ /* We can set the handler for most signals to SIG_IGN and
+ * still have them reported to us in the queue. However,
+ * if the handler for SIGCHLD is SIG_IGN, the system reaps
+ * zombie processes for us, and we don't get any notification.
+ * This appears to be the only signal with this quirk. */
+ if (evsig_set_handler_(base, nsignal,
+ nsignal == SIGCHLD ? SIG_DFL : SIG_IGN) == -1)
+ return (-1);
+
+ return (0);
+}
+
+static int
+kq_sig_del(struct event_base *base, int nsignal, short old, short events, void *p)
+{
+ struct kqop *kqop = base->evbase;
+ struct kevent kev;
+
+ struct timespec timeout = { 0, 0 };
+ (void)p;
+
+ EVUTIL_ASSERT(nsignal >= 0 && nsignal < NSIG);
+
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = nsignal;
+ kev.filter = EVFILT_SIGNAL;
+ kev.flags = EV_DELETE;
+
+ /* Because we insert signal events
+ * immediately, we need to delete them
+ * immediately, too */
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1)
+ return (-1);
+
+ if (evsig_restore_handler_(base, nsignal) == -1)
+ return (-1);
+
+ return (0);
+}
+
+
+/* OSX 10.6 and FreeBSD 8.1 add support for EVFILT_USER, which we can use
+ * to wake up the event loop from another thread. */
+
+/* Magic number we use for our filter ID. */
+#define NOTIFY_IDENT 42
+
+int
+event_kq_add_notify_event_(struct event_base *base)
+{
+ struct kqop *kqop = base->evbase;
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ struct kevent kev;
+ struct timespec timeout = { 0, 0 };
+#endif
+
+ if (kqop->notify_event_added)
+ return 0;
+
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = NOTIFY_IDENT;
+ kev.filter = EVFILT_USER;
+ kev.flags = EV_ADD | EV_CLEAR;
+
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1) {
+ event_warn("kevent: adding EVFILT_USER event");
+ return -1;
+ }
+
+ kqop->notify_event_added = 1;
+
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+int
+event_kq_notify_base_(struct event_base *base)
+{
+ struct kqop *kqop = base->evbase;
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ struct kevent kev;
+ struct timespec timeout = { 0, 0 };
+#endif
+ if (! kqop->notify_event_added)
+ return -1;
+
+#if defined(EVFILT_USER) && defined(NOTE_TRIGGER)
+ memset(&kev, 0, sizeof(kev));
+ kev.ident = NOTIFY_IDENT;
+ kev.filter = EVFILT_USER;
+ kev.fflags = NOTE_TRIGGER;
+
+ if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1) {
+ event_warn("kevent: triggering EVFILT_USER event");
+ return -1;
+ }
+
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+#endif /* EVENT__HAVE_KQUEUE */
diff --git a/sntp/libevent/libevent.pc.in b/sntp/libevent/libevent.pc.in
new file mode 100644
index 0000000..7030884
--- /dev/null
+++ b/sntp/libevent/libevent.pc.in
@@ -0,0 +1,16 @@
+#libevent pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libevent
+Description: libevent is an asynchronous notification event loop library
+Version: @VERSION@
+Requires:
+Conflicts:
+Libs: -L${libdir} -levent
+Libs.private: @LIBS@
+Cflags: -I${includedir}
+
diff --git a/sntp/libevent/libevent_openssl.pc.in b/sntp/libevent/libevent_openssl.pc.in
new file mode 100644
index 0000000..a65d1e0
--- /dev/null
+++ b/sntp/libevent/libevent_openssl.pc.in
@@ -0,0 +1,16 @@
+#libevent pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libevent_openssl
+Description: libevent_openssl adds openssl-based TLS support to libevent
+Version: @VERSION@
+Requires: libevent
+Conflicts:
+Libs: -L${libdir} -levent_openssl
+Libs.private: @LIBS@ @OPENSSL_LIBS@
+Cflags: -I${includedir} @OPENSSL_INCS@
+
diff --git a/sntp/libevent/libevent_pthreads.pc.in b/sntp/libevent/libevent_pthreads.pc.in
new file mode 100644
index 0000000..9bc2392
--- /dev/null
+++ b/sntp/libevent/libevent_pthreads.pc.in
@@ -0,0 +1,16 @@
+#libevent pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libevent_pthreads
+Description: libevent_pthreads adds pthreads-based threading support to libevent
+Version: @VERSION@
+Requires: libevent
+Conflicts:
+Libs: -L${libdir} -levent_pthreads
+Libs.private: @LIBS@ @PTHREAD_LIBS@
+Cflags: -I${includedir} @PTHREAD_CFLAGS@
+
diff --git a/sntp/libevent/listener.c b/sntp/libevent/listener.c
new file mode 100644
index 0000000..3272c40
--- /dev/null
+++ b/sntp/libevent/listener.c
@@ -0,0 +1,882 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos, Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifdef _WIN32
+#ifndef _WIN32_WINNT
+/* Minimum required for InitializeCriticalSectionAndSpinCount */
+#define _WIN32_WINNT 0x0403
+#endif
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <mswsock.h>
+#endif
+#include <errno.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "event2/listener.h"
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "mm-internal.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "evthread-internal.h"
+#ifdef _WIN32
+#include "iocp-internal.h"
+#include "defer-internal.h"
+#include "event-internal.h"
+#endif
+
+struct evconnlistener_ops {
+ int (*enable)(struct evconnlistener *);
+ int (*disable)(struct evconnlistener *);
+ void (*destroy)(struct evconnlistener *);
+ void (*shutdown)(struct evconnlistener *);
+ evutil_socket_t (*getfd)(struct evconnlistener *);
+ struct event_base *(*getbase)(struct evconnlistener *);
+};
+
+struct evconnlistener {
+ const struct evconnlistener_ops *ops;
+ void *lock;
+ evconnlistener_cb cb;
+ evconnlistener_errorcb errorcb;
+ void *user_data;
+ unsigned flags;
+ short refcnt;
+ int accept4_flags;
+ unsigned enabled : 1;
+};
+
+struct evconnlistener_event {
+ struct evconnlistener base;
+ struct event listener;
+};
+
+#ifdef _WIN32
+struct evconnlistener_iocp {
+ struct evconnlistener base;
+ evutil_socket_t fd;
+ struct event_base *event_base;
+ struct event_iocp_port *port;
+ short n_accepting;
+ unsigned shutting_down : 1;
+ unsigned event_added : 1;
+ struct accepting_socket **accepting;
+};
+#endif
+
+#define LOCK(listener) EVLOCK_LOCK((listener)->lock, 0)
+#define UNLOCK(listener) EVLOCK_UNLOCK((listener)->lock, 0)
+
+struct evconnlistener *
+evconnlistener_new_async(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd); /* XXXX export this? */
+
+static int event_listener_enable(struct evconnlistener *);
+static int event_listener_disable(struct evconnlistener *);
+static void event_listener_destroy(struct evconnlistener *);
+static evutil_socket_t event_listener_getfd(struct evconnlistener *);
+static struct event_base *event_listener_getbase(struct evconnlistener *);
+
+#if 0
+static void
+listener_incref_and_lock(struct evconnlistener *listener)
+{
+ LOCK(listener);
+ ++listener->refcnt;
+}
+#endif
+
+static int
+listener_decref_and_unlock(struct evconnlistener *listener)
+{
+ int refcnt = --listener->refcnt;
+ if (refcnt == 0) {
+ listener->ops->destroy(listener);
+ UNLOCK(listener);
+ EVTHREAD_FREE_LOCK(listener->lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ mm_free(listener);
+ return 1;
+ } else {
+ UNLOCK(listener);
+ return 0;
+ }
+}
+
+static const struct evconnlistener_ops evconnlistener_event_ops = {
+ event_listener_enable,
+ event_listener_disable,
+ event_listener_destroy,
+ NULL, /* shutdown */
+ event_listener_getfd,
+ event_listener_getbase
+};
+
+static void listener_read_cb(evutil_socket_t, short, void *);
+
+struct evconnlistener *
+evconnlistener_new(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd)
+{
+ struct evconnlistener_event *lev;
+
+#ifdef _WIN32
+ if (base && event_base_get_iocp_(base)) {
+ const struct win32_extension_fns *ext =
+ event_get_win32_extension_fns_();
+ if (ext->AcceptEx && ext->GetAcceptExSockaddrs)
+ return evconnlistener_new_async(base, cb, ptr, flags,
+ backlog, fd);
+ }
+#endif
+
+ if (backlog > 0) {
+ if (listen(fd, backlog) < 0)
+ return NULL;
+ } else if (backlog < 0) {
+ if (listen(fd, 128) < 0)
+ return NULL;
+ }
+
+ lev = mm_calloc(1, sizeof(struct evconnlistener_event));
+ if (!lev)
+ return NULL;
+
+ lev->base.ops = &evconnlistener_event_ops;
+ lev->base.cb = cb;
+ lev->base.user_data = ptr;
+ lev->base.flags = flags;
+ lev->base.refcnt = 1;
+
+ lev->base.accept4_flags = 0;
+ if (!(flags & LEV_OPT_LEAVE_SOCKETS_BLOCKING))
+ lev->base.accept4_flags |= EVUTIL_SOCK_NONBLOCK;
+ if (flags & LEV_OPT_CLOSE_ON_EXEC)
+ lev->base.accept4_flags |= EVUTIL_SOCK_CLOEXEC;
+
+ if (flags & LEV_OPT_THREADSAFE) {
+ EVTHREAD_ALLOC_LOCK(lev->base.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ }
+
+ event_assign(&lev->listener, base, fd, EV_READ|EV_PERSIST,
+ listener_read_cb, lev);
+
+ if (!(flags & LEV_OPT_DISABLED))
+ evconnlistener_enable(&lev->base);
+
+ return &lev->base;
+}
+
+struct evconnlistener *
+evconnlistener_new_bind(struct event_base *base, evconnlistener_cb cb,
+ void *ptr, unsigned flags, int backlog, const struct sockaddr *sa,
+ int socklen)
+{
+ struct evconnlistener *listener;
+ evutil_socket_t fd;
+ int on = 1;
+ int family = sa ? sa->sa_family : AF_UNSPEC;
+ int socktype = SOCK_STREAM | EVUTIL_SOCK_NONBLOCK;
+
+ if (backlog == 0)
+ return NULL;
+
+ if (flags & LEV_OPT_CLOSE_ON_EXEC)
+ socktype |= EVUTIL_SOCK_CLOEXEC;
+
+ fd = evutil_socket_(family, socktype, 0);
+ if (fd == -1)
+ return NULL;
+
+ if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void*)&on, sizeof(on))<0)
+ goto err;
+
+ if (flags & LEV_OPT_REUSEABLE) {
+ if (evutil_make_listen_socket_reuseable(fd) < 0)
+ goto err;
+ }
+
+ if (flags & LEV_OPT_DEFERRED_ACCEPT) {
+ if (evutil_make_tcp_listen_socket_deferred(fd) < 0)
+ goto err;
+ }
+
+ if (sa) {
+ if (bind(fd, sa, socklen)<0)
+ goto err;
+ }
+
+ listener = evconnlistener_new(base, cb, ptr, flags, backlog, fd);
+ if (!listener)
+ goto err;
+
+ return listener;
+err:
+ evutil_closesocket(fd);
+ return NULL;
+}
+
+void
+evconnlistener_free(struct evconnlistener *lev)
+{
+ LOCK(lev);
+ lev->cb = NULL;
+ lev->errorcb = NULL;
+ if (lev->ops->shutdown)
+ lev->ops->shutdown(lev);
+ listener_decref_and_unlock(lev);
+}
+
+static void
+event_listener_destroy(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+
+ event_del(&lev_e->listener);
+ if (lev->flags & LEV_OPT_CLOSE_ON_FREE)
+ evutil_closesocket(event_get_fd(&lev_e->listener));
+ event_debug_unassign(&lev_e->listener);
+}
+
+int
+evconnlistener_enable(struct evconnlistener *lev)
+{
+ int r;
+ LOCK(lev);
+ lev->enabled = 1;
+ if (lev->cb)
+ r = lev->ops->enable(lev);
+ else
+ r = 0;
+ UNLOCK(lev);
+ return r;
+}
+
+int
+evconnlistener_disable(struct evconnlistener *lev)
+{
+ int r;
+ LOCK(lev);
+ lev->enabled = 0;
+ r = lev->ops->disable(lev);
+ UNLOCK(lev);
+ return r;
+}
+
+static int
+event_listener_enable(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_add(&lev_e->listener, NULL);
+}
+
+static int
+event_listener_disable(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_del(&lev_e->listener);
+}
+
+evutil_socket_t
+evconnlistener_get_fd(struct evconnlistener *lev)
+{
+ evutil_socket_t fd;
+ LOCK(lev);
+ fd = lev->ops->getfd(lev);
+ UNLOCK(lev);
+ return fd;
+}
+
+static evutil_socket_t
+event_listener_getfd(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_get_fd(&lev_e->listener);
+}
+
+struct event_base *
+evconnlistener_get_base(struct evconnlistener *lev)
+{
+ struct event_base *base;
+ LOCK(lev);
+ base = lev->ops->getbase(lev);
+ UNLOCK(lev);
+ return base;
+}
+
+static struct event_base *
+event_listener_getbase(struct evconnlistener *lev)
+{
+ struct evconnlistener_event *lev_e =
+ EVUTIL_UPCAST(lev, struct evconnlistener_event, base);
+ return event_get_base(&lev_e->listener);
+}
+
+void
+evconnlistener_set_cb(struct evconnlistener *lev,
+ evconnlistener_cb cb, void *arg)
+{
+ int enable = 0;
+ LOCK(lev);
+ if (lev->enabled && !lev->cb)
+ enable = 1;
+ lev->cb = cb;
+ lev->user_data = arg;
+ if (enable)
+ evconnlistener_enable(lev);
+ UNLOCK(lev);
+}
+
+void
+evconnlistener_set_error_cb(struct evconnlistener *lev,
+ evconnlistener_errorcb errorcb)
+{
+ LOCK(lev);
+ lev->errorcb = errorcb;
+ UNLOCK(lev);
+}
+
+static void
+listener_read_cb(evutil_socket_t fd, short what, void *p)
+{
+ struct evconnlistener *lev = p;
+ int err;
+ evconnlistener_cb cb;
+ evconnlistener_errorcb errorcb;
+ void *user_data;
+ LOCK(lev);
+ while (1) {
+ struct sockaddr_storage ss;
+ ev_socklen_t socklen = sizeof(ss);
+ evutil_socket_t new_fd = evutil_accept4_(fd, (struct sockaddr*)&ss, &socklen, lev->accept4_flags);
+ if (new_fd < 0)
+ break;
+ if (socklen == 0) {
+ /* This can happen with some older linux kernels in
+ * response to nmap. */
+ evutil_closesocket(new_fd);
+ continue;
+ }
+
+ if (lev->cb == NULL) {
+ evutil_closesocket(new_fd);
+ UNLOCK(lev);
+ return;
+ }
+ ++lev->refcnt;
+ cb = lev->cb;
+ user_data = lev->user_data;
+ UNLOCK(lev);
+ cb(lev, new_fd, (struct sockaddr*)&ss, (int)socklen,
+ user_data);
+ LOCK(lev);
+ if (lev->refcnt == 1) {
+ int freed = listener_decref_and_unlock(lev);
+ EVUTIL_ASSERT(freed);
+ return;
+ }
+ --lev->refcnt;
+ }
+ err = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_ACCEPT_RETRIABLE(err)) {
+ UNLOCK(lev);
+ return;
+ }
+ if (lev->errorcb != NULL) {
+ ++lev->refcnt;
+ errorcb = lev->errorcb;
+ user_data = lev->user_data;
+ UNLOCK(lev);
+ errorcb(lev, user_data);
+ LOCK(lev);
+ listener_decref_and_unlock(lev);
+ } else {
+ event_sock_warn(fd, "Error from accept() call");
+ }
+}
+
+#ifdef _WIN32
+struct accepting_socket {
+ CRITICAL_SECTION lock;
+ struct event_overlapped overlapped;
+ SOCKET s;
+ int error;
+ struct event_callback deferred;
+ struct evconnlistener_iocp *lev;
+ ev_uint8_t buflen;
+ ev_uint8_t family;
+ unsigned free_on_cb:1;
+ char addrbuf[1];
+};
+
+static void accepted_socket_cb(struct event_overlapped *o, ev_uintptr_t key,
+ ev_ssize_t n, int ok);
+static void accepted_socket_invoke_user_cb(struct event_callback *cb, void *arg);
+
+static void
+iocp_listener_event_add(struct evconnlistener_iocp *lev)
+{
+ if (lev->event_added)
+ return;
+
+ lev->event_added = 1;
+ event_base_add_virtual_(lev->event_base);
+}
+
+static void
+iocp_listener_event_del(struct evconnlistener_iocp *lev)
+{
+ if (!lev->event_added)
+ return;
+
+ lev->event_added = 0;
+ event_base_del_virtual_(lev->event_base);
+}
+
+static struct accepting_socket *
+new_accepting_socket(struct evconnlistener_iocp *lev, int family)
+{
+ struct accepting_socket *res;
+ int addrlen;
+ int buflen;
+
+ if (family == AF_INET)
+ addrlen = sizeof(struct sockaddr_in);
+ else if (family == AF_INET6)
+ addrlen = sizeof(struct sockaddr_in6);
+ else
+ return NULL;
+ buflen = (addrlen+16)*2;
+
+ res = mm_calloc(1,sizeof(struct accepting_socket)-1+buflen);
+ if (!res)
+ return NULL;
+
+ event_overlapped_init_(&res->overlapped, accepted_socket_cb);
+ res->s = INVALID_SOCKET;
+ res->lev = lev;
+ res->buflen = buflen;
+ res->family = family;
+
+ event_deferred_cb_init_(&res->deferred,
+ event_base_get_npriorities(lev->event_base) / 2,
+ accepted_socket_invoke_user_cb, res);
+
+ InitializeCriticalSectionAndSpinCount(&res->lock, 1000);
+
+ return res;
+}
+
+static void
+free_and_unlock_accepting_socket(struct accepting_socket *as)
+{
+ /* requires lock. */
+ if (as->s != INVALID_SOCKET)
+ closesocket(as->s);
+
+ LeaveCriticalSection(&as->lock);
+ DeleteCriticalSection(&as->lock);
+ mm_free(as);
+}
+
+static int
+start_accepting(struct accepting_socket *as)
+{
+ /* requires lock */
+ const struct win32_extension_fns *ext = event_get_win32_extension_fns_();
+ DWORD pending = 0;
+ SOCKET s = socket(as->family, SOCK_STREAM, 0);
+ int error = 0;
+
+ if (!as->lev->base.enabled)
+ return 0;
+
+ if (s == INVALID_SOCKET) {
+ error = WSAGetLastError();
+ goto report_err;
+ }
+
+ /* XXXX It turns out we need to do this again later. Does this call
+ * have any effect? */
+ setsockopt(s, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
+ (char *)&as->lev->fd, sizeof(&as->lev->fd));
+
+ if (!(as->lev->base.flags & LEV_OPT_LEAVE_SOCKETS_BLOCKING))
+ evutil_make_socket_nonblocking(s);
+
+ if (event_iocp_port_associate_(as->lev->port, s, 1) < 0) {
+ closesocket(s);
+ return -1;
+ }
+
+ as->s = s;
+
+ if (ext->AcceptEx(as->lev->fd, s, as->addrbuf, 0,
+ as->buflen/2, as->buflen/2, &pending, &as->overlapped.overlapped))
+ {
+ /* Immediate success! */
+ accepted_socket_cb(&as->overlapped, 1, 0, 1);
+ } else {
+ error = WSAGetLastError();
+ if (error != ERROR_IO_PENDING) {
+ goto report_err;
+ }
+ }
+
+ return 0;
+
+report_err:
+ as->error = error;
+ event_deferred_cb_schedule_(
+ as->lev->event_base,
+ &as->deferred);
+ return 0;
+}
+
+static void
+stop_accepting(struct accepting_socket *as)
+{
+ /* requires lock. */
+ SOCKET s = as->s;
+ as->s = INVALID_SOCKET;
+ closesocket(s);
+}
+
+static void
+accepted_socket_invoke_user_cb(struct event_callback *dcb, void *arg)
+{
+ struct accepting_socket *as = arg;
+
+ struct sockaddr *sa_local=NULL, *sa_remote=NULL;
+ int socklen_local=0, socklen_remote=0;
+ const struct win32_extension_fns *ext = event_get_win32_extension_fns_();
+ struct evconnlistener *lev = &as->lev->base;
+ evutil_socket_t sock=-1;
+ void *data;
+ evconnlistener_cb cb=NULL;
+ evconnlistener_errorcb errorcb=NULL;
+ int error;
+
+ EVUTIL_ASSERT(ext->GetAcceptExSockaddrs);
+
+ LOCK(lev);
+ EnterCriticalSection(&as->lock);
+ if (as->free_on_cb) {
+ free_and_unlock_accepting_socket(as);
+ listener_decref_and_unlock(lev);
+ return;
+ }
+
+ ++lev->refcnt;
+
+ error = as->error;
+ if (error) {
+ as->error = 0;
+ errorcb = lev->errorcb;
+ } else {
+ ext->GetAcceptExSockaddrs(
+ as->addrbuf, 0, as->buflen/2, as->buflen/2,
+ &sa_local, &socklen_local, &sa_remote,
+ &socklen_remote);
+ sock = as->s;
+ cb = lev->cb;
+ as->s = INVALID_SOCKET;
+
+ /* We need to call this so getsockname, getpeername, and
+ * shutdown work correctly on the accepted socket. */
+ /* XXXX handle error? */
+ setsockopt(sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT,
+ (char *)&as->lev->fd, sizeof(&as->lev->fd));
+ }
+ data = lev->user_data;
+
+ LeaveCriticalSection(&as->lock);
+ UNLOCK(lev);
+
+ if (errorcb) {
+ WSASetLastError(error);
+ errorcb(lev, data);
+ } else if (cb) {
+ cb(lev, sock, sa_remote, socklen_remote, data);
+ }
+
+ LOCK(lev);
+ if (listener_decref_and_unlock(lev))
+ return;
+
+ EnterCriticalSection(&as->lock);
+ start_accepting(as);
+ LeaveCriticalSection(&as->lock);
+}
+
+static void
+accepted_socket_cb(struct event_overlapped *o, ev_uintptr_t key, ev_ssize_t n, int ok)
+{
+ struct accepting_socket *as =
+ EVUTIL_UPCAST(o, struct accepting_socket, overlapped);
+
+ LOCK(&as->lev->base);
+ EnterCriticalSection(&as->lock);
+ if (ok) {
+ /* XXXX Don't do this if some EV_MT flag is set. */
+ event_deferred_cb_schedule_(
+ as->lev->event_base,
+ &as->deferred);
+ LeaveCriticalSection(&as->lock);
+ } else if (as->free_on_cb) {
+ struct evconnlistener *lev = &as->lev->base;
+ free_and_unlock_accepting_socket(as);
+ listener_decref_and_unlock(lev);
+ return;
+ } else if (as->s == INVALID_SOCKET) {
+ /* This is okay; we were disabled by iocp_listener_disable. */
+ LeaveCriticalSection(&as->lock);
+ } else {
+ /* Some error on accept that we couldn't actually handle. */
+ BOOL ok;
+ DWORD transfer = 0, flags=0;
+ event_sock_warn(as->s, "Unexpected error on AcceptEx");
+ ok = WSAGetOverlappedResult(as->s, &o->overlapped,
+ &transfer, FALSE, &flags);
+ if (ok) {
+ /* well, that was confusing! */
+ as->error = 1;
+ } else {
+ as->error = WSAGetLastError();
+ }
+ event_deferred_cb_schedule_(
+ as->lev->event_base,
+ &as->deferred);
+ LeaveCriticalSection(&as->lock);
+ }
+ UNLOCK(&as->lev->base);
+}
+
+static int
+iocp_listener_enable(struct evconnlistener *lev)
+{
+ int i;
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+
+ LOCK(lev);
+ iocp_listener_event_add(lev_iocp);
+ for (i = 0; i < lev_iocp->n_accepting; ++i) {
+ struct accepting_socket *as = lev_iocp->accepting[i];
+ if (!as)
+ continue;
+ EnterCriticalSection(&as->lock);
+ if (!as->free_on_cb && as->s == INVALID_SOCKET)
+ start_accepting(as);
+ LeaveCriticalSection(&as->lock);
+ }
+ UNLOCK(lev);
+ return 0;
+}
+
+static int
+iocp_listener_disable_impl(struct evconnlistener *lev, int shutdown)
+{
+ int i;
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+
+ LOCK(lev);
+ iocp_listener_event_del(lev_iocp);
+ for (i = 0; i < lev_iocp->n_accepting; ++i) {
+ struct accepting_socket *as = lev_iocp->accepting[i];
+ if (!as)
+ continue;
+ EnterCriticalSection(&as->lock);
+ if (!as->free_on_cb && as->s != INVALID_SOCKET) {
+ if (shutdown)
+ as->free_on_cb = 1;
+ stop_accepting(as);
+ }
+ LeaveCriticalSection(&as->lock);
+ }
+
+ if (shutdown && lev->flags & LEV_OPT_CLOSE_ON_FREE)
+ evutil_closesocket(lev_iocp->fd);
+
+ UNLOCK(lev);
+ return 0;
+}
+
+static int
+iocp_listener_disable(struct evconnlistener *lev)
+{
+ return iocp_listener_disable_impl(lev,0);
+}
+
+static void
+iocp_listener_destroy(struct evconnlistener *lev)
+{
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+
+ if (! lev_iocp->shutting_down) {
+ lev_iocp->shutting_down = 1;
+ iocp_listener_disable_impl(lev,1);
+ }
+
+}
+
+static evutil_socket_t
+iocp_listener_getfd(struct evconnlistener *lev)
+{
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+ return lev_iocp->fd;
+}
+static struct event_base *
+iocp_listener_getbase(struct evconnlistener *lev)
+{
+ struct evconnlistener_iocp *lev_iocp =
+ EVUTIL_UPCAST(lev, struct evconnlistener_iocp, base);
+ return lev_iocp->event_base;
+}
+
+static const struct evconnlistener_ops evconnlistener_iocp_ops = {
+ iocp_listener_enable,
+ iocp_listener_disable,
+ iocp_listener_destroy,
+ iocp_listener_destroy, /* shutdown */
+ iocp_listener_getfd,
+ iocp_listener_getbase
+};
+
+/* XXX define some way to override this. */
+#define N_SOCKETS_PER_LISTENER 4
+
+struct evconnlistener *
+evconnlistener_new_async(struct event_base *base,
+ evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
+ evutil_socket_t fd)
+{
+ struct sockaddr_storage ss;
+ int socklen = sizeof(ss);
+ struct evconnlistener_iocp *lev;
+ int i;
+
+ flags |= LEV_OPT_THREADSAFE;
+
+ if (!base || !event_base_get_iocp_(base))
+ goto err;
+
+ /* XXXX duplicate code */
+ if (backlog > 0) {
+ if (listen(fd, backlog) < 0)
+ goto err;
+ } else if (backlog < 0) {
+ if (listen(fd, 128) < 0)
+ goto err;
+ }
+ if (getsockname(fd, (struct sockaddr*)&ss, &socklen)) {
+ event_sock_warn(fd, "getsockname");
+ goto err;
+ }
+ lev = mm_calloc(1, sizeof(struct evconnlistener_iocp));
+ if (!lev) {
+ event_warn("calloc");
+ goto err;
+ }
+ lev->base.ops = &evconnlistener_iocp_ops;
+ lev->base.cb = cb;
+ lev->base.user_data = ptr;
+ lev->base.flags = flags;
+ lev->base.refcnt = 1;
+ lev->base.enabled = 1;
+
+ lev->port = event_base_get_iocp_(base);
+ lev->fd = fd;
+ lev->event_base = base;
+
+
+ if (event_iocp_port_associate_(lev->port, fd, 1) < 0)
+ goto err_free_lev;
+
+ EVTHREAD_ALLOC_LOCK(lev->base.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ lev->n_accepting = N_SOCKETS_PER_LISTENER;
+ lev->accepting = mm_calloc(lev->n_accepting,
+ sizeof(struct accepting_socket *));
+ if (!lev->accepting) {
+ event_warn("calloc");
+ goto err_delete_lock;
+ }
+ for (i = 0; i < lev->n_accepting; ++i) {
+ lev->accepting[i] = new_accepting_socket(lev, ss.ss_family);
+ if (!lev->accepting[i]) {
+ event_warnx("Couldn't create accepting socket");
+ goto err_free_accepting;
+ }
+ if (cb && start_accepting(lev->accepting[i]) < 0) {
+ event_warnx("Couldn't start accepting on socket");
+ EnterCriticalSection(&lev->accepting[i]->lock);
+ free_and_unlock_accepting_socket(lev->accepting[i]);
+ goto err_free_accepting;
+ }
+ ++lev->base.refcnt;
+ }
+
+ iocp_listener_event_add(lev);
+
+ return &lev->base;
+
+err_free_accepting:
+ mm_free(lev->accepting);
+ /* XXXX free the other elements. */
+err_delete_lock:
+ EVTHREAD_FREE_LOCK(lev->base.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+err_free_lev:
+ mm_free(lev);
+err:
+ /* Don't close the fd, it is caller's responsibility. */
+ return NULL;
+}
+
+#endif
diff --git a/sntp/libevent/log-internal.h b/sntp/libevent/log-internal.h
new file mode 100644
index 0000000..330478a
--- /dev/null
+++ b/sntp/libevent/log-internal.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef LOG_INTERNAL_H_INCLUDED_
+#define LOG_INTERNAL_H_INCLUDED_
+
+#include "event2/util.h"
+
+#ifdef __GNUC__
+#define EV_CHECK_FMT(a,b) __attribute__((format(printf, a, b)))
+#define EV_NORETURN __attribute__((noreturn))
+#else
+#define EV_CHECK_FMT(a,b)
+#define EV_NORETURN
+#endif
+
+#define EVENT_ERR_ABORT_ ((int)0xdeaddead)
+
+#define USE_GLOBAL_FOR_DEBUG_LOGGING
+
+#if !defined(EVENT__DISABLE_DEBUG_MODE) || defined(USE_DEBUG)
+#define EVENT_DEBUG_LOGGING_ENABLED
+#endif
+
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+#ifdef USE_GLOBAL_FOR_DEBUG_LOGGING
+extern ev_uint32_t event_debug_logging_mask_;
+#define event_debug_get_logging_mask_() (event_debug_logging_mask_)
+#else
+ev_uint32_t event_debug_get_logging_mask_(void);
+#endif
+#else
+#define event_debug_get_logging_mask_() (0)
+#endif
+
+void event_err(int eval, const char *fmt, ...) EV_CHECK_FMT(2,3) EV_NORETURN;
+void event_warn(const char *fmt, ...) EV_CHECK_FMT(1,2);
+void event_sock_err(int eval, evutil_socket_t sock, const char *fmt, ...) EV_CHECK_FMT(3,4) EV_NORETURN;
+void event_sock_warn(evutil_socket_t sock, const char *fmt, ...) EV_CHECK_FMT(2,3);
+void event_errx(int eval, const char *fmt, ...) EV_CHECK_FMT(2,3) EV_NORETURN;
+void event_warnx(const char *fmt, ...) EV_CHECK_FMT(1,2);
+void event_msgx(const char *fmt, ...) EV_CHECK_FMT(1,2);
+void event_debugx_(const char *fmt, ...) EV_CHECK_FMT(1,2);
+
+void event_logv_(int severity, const char *errstr, const char *fmt, va_list ap)
+ EV_CHECK_FMT(3,0);
+
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+#define event_debug(x) do { \
+ if (event_debug_get_logging_mask_()) { \
+ event_debugx_ x; \
+ } \
+ } while (0)
+#else
+#define event_debug(x) ((void)0)
+#endif
+
+#undef EV_CHECK_FMT
+
+#endif
diff --git a/sntp/libevent/log.c b/sntp/libevent/log.c
new file mode 100644
index 0000000..e8ae9fd
--- /dev/null
+++ b/sntp/libevent/log.c
@@ -0,0 +1,253 @@
+/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * log.c
+ *
+ * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code.
+ *
+ * Copyright (c) 2005-2012 Niels Provos and Nick Mathewson
+ *
+ * Copyright (c) 2000 Dug Song <dugsong@monkey.org>
+ *
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include "event2/event.h"
+#include "event2/util.h"
+
+#include "log-internal.h"
+
+static void event_log(int severity, const char *msg);
+static void event_exit(int errcode) EV_NORETURN;
+
+static event_fatal_cb fatal_fn = NULL;
+
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+#ifdef USE_DEBUG
+#define DEFAULT_MASK EVENT_DBG_ALL
+#else
+#define DEFAULT_MASK 0
+#endif
+
+#ifdef USE_GLOBAL_FOR_DEBUG_LOGGING
+ev_uint32_t event_debug_logging_mask_ = DEFAULT_MASK;
+#else
+static ev_uint32_t event_debug_logging_mask_ = DEFAULT_MASK;
+ev_uint32_t
+event_debug_get_logging_mask_(void)
+{
+ return event_debug_logging_mask_;
+}
+#endif
+#endif /* EVENT_DEBUG_LOGGING_ENABLED */
+
+void
+event_enable_debug_logging(ev_uint32_t which)
+{
+#ifdef EVENT_DEBUG_LOGGING_ENABLED
+ event_debug_logging_mask_ = which;
+#endif
+}
+
+void
+event_set_fatal_callback(event_fatal_cb cb)
+{
+ fatal_fn = cb;
+}
+
+static void
+event_exit(int errcode)
+{
+ if (fatal_fn) {
+ fatal_fn(errcode);
+ exit(errcode); /* should never be reached */
+ } else if (errcode == EVENT_ERR_ABORT_)
+ abort();
+ else
+ exit(errcode);
+}
+
+void
+event_err(int eval, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_ERR, strerror(errno), fmt, ap);
+ va_end(ap);
+ event_exit(eval);
+}
+
+void
+event_warn(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_WARN, strerror(errno), fmt, ap);
+ va_end(ap);
+}
+
+void
+event_sock_err(int eval, evutil_socket_t sock, const char *fmt, ...)
+{
+ va_list ap;
+ int err = evutil_socket_geterror(sock);
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_ERR, evutil_socket_error_to_string(err), fmt, ap);
+ va_end(ap);
+ event_exit(eval);
+}
+
+void
+event_sock_warn(evutil_socket_t sock, const char *fmt, ...)
+{
+ va_list ap;
+ int err = evutil_socket_geterror(sock);
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_WARN, evutil_socket_error_to_string(err), fmt, ap);
+ va_end(ap);
+}
+
+void
+event_errx(int eval, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_ERR, NULL, fmt, ap);
+ va_end(ap);
+ event_exit(eval);
+}
+
+void
+event_warnx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_WARN, NULL, fmt, ap);
+ va_end(ap);
+}
+
+void
+event_msgx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_MSG, NULL, fmt, ap);
+ va_end(ap);
+}
+
+void
+event_debugx_(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ event_logv_(EVENT_LOG_DEBUG, NULL, fmt, ap);
+ va_end(ap);
+}
+
+void
+event_logv_(int severity, const char *errstr, const char *fmt, va_list ap)
+{
+ char buf[1024];
+ size_t len;
+
+ if (severity == EVENT_LOG_DEBUG && !event_debug_get_logging_mask_())
+ return;
+
+ if (fmt != NULL)
+ evutil_vsnprintf(buf, sizeof(buf), fmt, ap);
+ else
+ buf[0] = '\0';
+
+ if (errstr) {
+ len = strlen(buf);
+ if (len < sizeof(buf) - 3) {
+ evutil_snprintf(buf + len, sizeof(buf) - len, ": %s", errstr);
+ }
+ }
+
+ event_log(severity, buf);
+}
+
+static event_log_cb log_fn = NULL;
+
+void
+event_set_log_callback(event_log_cb cb)
+{
+ log_fn = cb;
+}
+
+static void
+event_log(int severity, const char *msg)
+{
+ if (log_fn)
+ log_fn(severity, msg);
+ else {
+ const char *severity_str;
+ switch (severity) {
+ case EVENT_LOG_DEBUG:
+ severity_str = "debug";
+ break;
+ case EVENT_LOG_MSG:
+ severity_str = "msg";
+ break;
+ case EVENT_LOG_WARN:
+ severity_str = "warn";
+ break;
+ case EVENT_LOG_ERR:
+ severity_str = "err";
+ break;
+ default:
+ severity_str = "???";
+ break;
+ }
+ (void)fprintf(stderr, "[%s] %s\n", severity_str, msg);
+ }
+}
diff --git a/sntp/libevent/m4/ac_backport_259_ssizet.m4 b/sntp/libevent/m4/ac_backport_259_ssizet.m4
new file mode 100644
index 0000000..75fde38
--- /dev/null
+++ b/sntp/libevent/m4/ac_backport_259_ssizet.m4
@@ -0,0 +1,3 @@
+AN_IDENTIFIER([ssize_t], [AC_TYPE_SSIZE_T])
+AC_DEFUN([AC_TYPE_SSIZE_T], [AC_CHECK_TYPE(ssize_t, int)])
+
diff --git a/sntp/libevent/m4/libevent_openssl.m4 b/sntp/libevent/m4/libevent_openssl.m4
new file mode 100644
index 0000000..3cb064a
--- /dev/null
+++ b/sntp/libevent/m4/libevent_openssl.m4
@@ -0,0 +1,47 @@
+dnl ######################################################################
+dnl OpenSSL support
+AC_DEFUN([LIBEVENT_OPENSSL], [
+AC_REQUIRE([NTP_PKG_CONFIG])dnl
+
+case "$enable_openssl" in
+ yes)
+ have_openssl=no
+ case "$PKG_CONFIG" in
+ '')
+ ;;
+ *)
+ OPENSSL_LIBS=`$PKG_CONFIG --libs openssl 2>/dev/null`
+ case "$OPENSSL_LIBS" in
+ '') ;;
+ *) OPENSSL_LIBS="$OPENSSL_LIBS $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"
+ have_openssl=yes
+ ;;
+ esac
+ OPENSSL_INCS=`$PKG_CONFIG --cflags openssl 2>/dev/null`
+ ;;
+ esac
+ case "$have_openssl" in
+ yes) ;;
+ *)
+ save_LIBS="$LIBS"
+ LIBS=""
+ OPENSSL_LIBS=""
+ AC_SEARCH_LIBS([SSL_new], [ssl],
+ [have_openssl=yes
+ OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"],
+ [have_openssl=no],
+ [-lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD])
+ LIBS="$save_LIBS"
+ ;;
+ esac
+ AC_SUBST(OPENSSL_INCS)
+ AC_SUBST(OPENSSL_LIBS)
+ case "$have_openssl" in
+ yes) AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl]) ;;
+ esac
+ ;;
+esac
+
+# check if we have and should use openssl
+AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
+])
diff --git a/sntp/libevent/m4/libtool.m4 b/sntp/libevent/m4/libtool.m4
new file mode 100644
index 0000000..d812584
--- /dev/null
+++ b/sntp/libevent/m4/libtool.m4
@@ -0,0 +1,7831 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/sntp/libevent/m4/ltoptions.m4 b/sntp/libevent/m4/ltoptions.m4
new file mode 100644
index 0000000..17cfd51
--- /dev/null
+++ b/sntp/libevent/m4/ltoptions.m4
@@ -0,0 +1,369 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/sntp/libevent/m4/ltsugar.m4 b/sntp/libevent/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/sntp/libevent/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/sntp/libevent/m4/ltversion.m4 b/sntp/libevent/m4/ltversion.m4
new file mode 100644
index 0000000..9c7b5d4
--- /dev/null
+++ b/sntp/libevent/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3293 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4])
+m4_define([LT_PACKAGE_REVISION], [1.3293])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4'
+macro_revision='1.3293'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/sntp/libevent/m4/lt~obsolete.m4 b/sntp/libevent/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/sntp/libevent/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/sntp/libevent/m4/ntp_pkg_config.m4 b/sntp/libevent/m4/ntp_pkg_config.m4
new file mode 100644
index 0000000..1bce8a6
--- /dev/null
+++ b/sntp/libevent/m4/ntp_pkg_config.m4
@@ -0,0 +1,27 @@
+dnl NTP_PKG_CONFIG -*- Autoconf -*-
+dnl
+dnl Look for pkg-config, which must be at least
+dnl $ntp_pkgconfig_min_version.
+dnl
+AC_DEFUN([NTP_PKG_CONFIG], [
+
+dnl lower the minimum version if you find an earlier one works
+ntp_pkgconfig_min_version='0.15.0'
+AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+AS_UNSET([ac_cv_path_PKG_CONFIG])
+AS_UNSET([ac_cv_path_ac_pt_PKG_CONFIG])
+
+case "$PKG_CONFIG" in
+ /*)
+ AC_MSG_CHECKING([if pkg-config is at least version $ntp_pkgconfig_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+ ;;
+esac
+
+]) dnl NTP_PKG_CONFIG
+
diff --git a/sntp/libevent/m4/openldap-thread-check.m4 b/sntp/libevent/m4/openldap-thread-check.m4
new file mode 100644
index 0000000..33f9199
--- /dev/null
+++ b/sntp/libevent/m4/openldap-thread-check.m4
@@ -0,0 +1,683 @@
+dnl OpenLDAP Autoconf thread check
+dnl
+dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
+dnl
+dnl Copyright 1998-2010 The OpenLDAP Foundation.
+dnl All rights reserved.
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are permitted only as authorized by the OpenLDAP
+dnl Public License.
+dnl
+dnl A copy of this license is available in the file LICENSE-OPENLDAP in
+dnl this directory of the distribution or, alternatively, at
+dnl <http://www.OpenLDAP.org/license.html>.
+dnl
+dnl --------------------------------------------------------------------
+
+# OL_THREAD_CHECK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+
+AC_DEFUN([OL_THREAD_CHECK], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG([C])
+OL_ARG_WITH(threads,[ --with-threads with threads],
+ auto, [auto nt posix mach pth lwp yes no manual] )
+
+case "$ol_with_threads$host" in
+ auto*-*-solaris2.[[0-6]])
+ dnl signals sometimes delivered to wrong thread with Solaris 2.6
+ ol_with_threads=no
+ ;;
+esac
+
+dnl AIX Thread requires we use cc_r or xlc_r.
+dnl But only do this IF AIX and CC is not set
+dnl and threads are auto|yes|posix.
+dnl
+dnl If we find cc_r|xlc_r, force pthreads and assume
+dnl pthread_create is in $LIBS (ie: don't bring in
+dnl any additional thread libraries)
+dnl If we do not find cc_r|xlc_r, disable threads
+
+ol_aix_threads=no
+case "$host" in
+*-*-aix*) dnl all AIX is not a good idea.
+ if test -z "$CC" ; then
+ case "$ol_with_threads" in
+ auto | yes | posix) ol_aix_threads=yes ;;
+ esac
+ fi
+;;
+esac
+
+if test $ol_aix_threads = yes ; then
+ if test -z "${CC}" ; then
+ AC_CHECK_PROGS(CC,cc_r xlc_r cc)
+
+ if test "$CC" = cc ; then
+ dnl no CC! don't allow --with-threads
+ if test $ol_with_threads != auto ; then
+ AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
+ else
+ AC_MSG_WARN([disabling threads, no cc_r on AIX])
+ fi
+ ol_with_threads=no
+ fi
+ fi
+
+ case ${CC} in cc_r | xlc_r)
+ ol_with_threads=posix
+ ol_cv_pthread_create=yes
+ ;;
+ esac
+fi
+
+dnl ----------------------------------------------------------------
+dnl Threads?
+ol_link_threads=no
+dnl ol_with_yielding_select=${ol_with_yielding_select:-auto}
+OL_ARG_WITH(yielding_select,[ --with-yielding-select with yielding select],
+ auto, [auto yes no manual] )
+
+case $ol_with_threads in auto | yes | nt)
+
+ OL_NT_THREADS
+
+ if test "$ol_cv_nt_threads" = yes ; then
+ ol_link_threads=nt
+ ol_with_threads=found
+ ol_with_yielding_select=yes
+
+ AC_DEFINE([HAVE_NT_SERVICE_MANAGER], [1], [if you have NT Service Manager])
+ AC_DEFINE([HAVE_NT_EVENT_LOG], [1], [if you have NT Event Log])
+ fi
+
+ if test $ol_with_threads = nt ; then
+ AC_MSG_ERROR([could not locate NT Threads])
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | posix)
+
+ AC_CHECK_HEADERS(pthread.h)
+
+ if test $ac_cv_header_pthread_h = yes ; then
+ OL_POSIX_THREAD_VERSION
+
+ if test $ol_cv_pthread_version != 0 ; then
+ AC_DEFINE_UNQUOTED([HAVE_PTHREADS], [$ol_cv_pthread_version],
+ [define to pthreads API spec revision])
+ else
+ AC_MSG_ERROR([unknown pthread version])
+ fi
+
+ # consider threads found
+ ol_with_threads=found
+
+ OL_HEADER_LINUX_THREADS
+ OL_HEADER_GNU_PTH_PTHREAD_H
+
+ if test $ol_cv_header_gnu_pth_pthread_h = no ; then
+ AC_CHECK_HEADERS(sched.h)
+ fi
+
+ dnl Now the hard part, how to link?
+ dnl
+ dnl currently supported checks:
+ dnl
+ dnl Check for no flags
+ dnl pthread_create() in $LIBS
+ dnl
+ dnl Check special pthread (final) flags
+ dnl [skipped] pthread_create() with -mt (Solaris) [disabled]
+ dnl pthread_create() with -kthread (FreeBSD)
+ dnl pthread_create() with -pthread (FreeBSD/Digital Unix)
+ dnl pthread_create() with -pthreads (?)
+ dnl pthread_create() with -mthreads (AIX)
+ dnl pthread_create() with -thread (?)
+ dnl
+ dnl Check pthread (final) libraries
+ dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
+ dnl pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
+ dnl [skipped] pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
+ dnl pthread_join() -Wl,-woff,85 -lpthread (IRIX)
+ dnl pthread_create() in -lpthread (many)
+ dnl pthread_create() in -lc_r (FreeBSD)
+ dnl
+ dnl Check pthread (draft4) flags (depreciated)
+ dnl pthread_create() with -threads (OSF/1)
+ dnl
+ dnl Check pthread (draft4) libraries (depreciated)
+ dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
+ dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
+ dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
+ dnl pthread_create() in -lpthreads (many)
+ dnl
+
+ dnl pthread_create in $LIBS
+ AC_CACHE_CHECK([for pthread_create in default libraries],
+ ol_cv_pthread_create,[
+ AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
+ [ol_cv_pthread_create=yes],
+ [ol_cv_pthread_create=no],
+ [AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
+ [ol_cv_pthread_create=yes],
+ [ol_cv_pthread_create=no])])])
+
+ if test $ol_cv_pthread_create != no ; then
+ ol_link_threads=posix
+ ol_link_pthreads=""
+ fi
+
+dnl OL_PTHREAD_TRY([-mt], [ol_cv_pthread_mt])
+ OL_PTHREAD_TRY([-kthread], [ol_cv_pthread_kthread])
+ OL_PTHREAD_TRY([-pthread], [ol_cv_pthread_pthread])
+ OL_PTHREAD_TRY([-pthreads], [ol_cv_pthread_pthreads])
+ OL_PTHREAD_TRY([-mthreads], [ol_cv_pthread_mthreads])
+ OL_PTHREAD_TRY([-thread], [ol_cv_pthread_thread])
+
+ OL_PTHREAD_TRY([-lpthread -lmach -lexc -lc_r],
+ [ol_cv_pthread_lpthread_lmach_lexc_lc_r])
+ OL_PTHREAD_TRY([-lpthread -lmach -lexc],
+ [ol_cv_pthread_lpthread_lmach_lexc])
+dnl OL_PTHREAD_TRY([-lpthread -lexc],
+dnl [ol_cv_pthread_lpthread_lexc])
+
+ OL_PTHREAD_TRY([-lpthread -Wl,-woff,85],
+ [ol_cv_pthread_lib_lpthread_woff])
+
+ OL_PTHREAD_TRY([-lpthread], [ol_cv_pthread_lpthread])
+ OL_PTHREAD_TRY([-lc_r], [ol_cv_pthread_lc_r])
+
+ OL_PTHREAD_TRY([-threads], [ol_cv_pthread_threads])
+
+ OL_PTHREAD_TRY([-lpthreads -lmach -lexc -lc_r],
+ [ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
+ OL_PTHREAD_TRY([-lpthreads -lmach -lexc],
+ [ol_cv_pthread_lpthreads_lmach_lexc])
+ OL_PTHREAD_TRY([-lpthreads -lexc],
+ [ol_cv_pthread_lpthreads_lexc])
+
+ OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
+
+ if test $ol_link_threads != no ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
+
+ dnl save flags
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+
+ dnl All POSIX Thread (final) implementations should have
+ dnl sched_yield instead of pthread yield.
+ dnl check for both, and thr_yield for Solaris
+ AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
+
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test $ac_cv_func_thr_yield = no ; then
+ dnl Digital UNIX has sched_yield() in -lrt
+ AC_CHECK_LIB(rt, sched_yield,
+ [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+ AC_DEFINE([HAVE_SCHED_YIELD], [1],
+ [Define if you have the sched_yield function.])
+ ac_cv_func_sched_yield=yes],
+ [ac_cv_func_sched_yield=no])
+ fi
+ if test $ac_cv_func_sched_yield = no &&
+ test $ac_cv_func_pthread_yield = no &&
+ test "$ac_cv_func_thr_yield" = no ; then
+ AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
+ fi
+
+ dnl Check functions for compatibility
+ AC_CHECK_FUNCS(pthread_kill)
+
+ dnl Check for pthread_rwlock_destroy with <pthread.h>
+ dnl as pthread_rwlock_t may not be defined.
+ AC_CACHE_CHECK([for pthread_rwlock_destroy with <pthread.h>],
+ [ol_cv_func_pthread_rwlock_destroy], [
+ dnl save the flags
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <pthread.h>
+pthread_rwlock_t rwlock;
+]], [[pthread_rwlock_destroy(&rwlock);]])],[ol_cv_func_pthread_rwlock_destroy=yes],[ol_cv_func_pthread_rwlock_destroy=no])
+ ])
+ if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
+ AC_DEFINE([HAVE_PTHREAD_RWLOCK_DESTROY], [1],
+ [define if you have pthread_rwlock_destroy function])
+ fi
+
+ dnl Check for pthread_detach with <pthread.h> inclusion
+ dnl as it's symbol may have been mangled.
+ AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
+ [ol_cv_func_pthread_detach], [
+ dnl save the flags
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
+ ])
+
+ if test $ol_cv_func_pthread_detach = no ; then
+ AC_MSG_ERROR([could not locate pthread_detach()])
+ fi
+
+ AC_DEFINE([HAVE_PTHREAD_DETACH], [1],
+ [define if you have pthread_detach function])
+
+ dnl Check for setconcurreny functions
+ AC_CHECK_FUNCS( \
+ pthread_setconcurrency \
+ pthread_getconcurrency \
+ thr_setconcurrency \
+ thr_getconcurrency \
+ )
+
+ OL_SYS_LINUX_THREADS
+ OL_LINUX_THREADS
+
+ if test $ol_cv_linux_threads = error; then
+ AC_MSG_ERROR([LinuxThreads header/library mismatch]);
+ fi
+
+ AC_CACHE_CHECK([if pthread_create() works],
+ ol_cv_pthread_create_works,[
+ AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
+ [ol_cv_pthread_create_works=yes],
+ [ol_cv_pthread_create_works=no],
+ [dnl assume yes
+ ol_cv_pthread_create_works=yes])])
+
+ if test $ol_cv_pthread_create_works = no ; then
+ AC_MSG_ERROR([pthread_create is not usable, check environment settings])
+ fi
+
+ ol_replace_broken_yield=no
+dnl case "$host" in
+dnl *-*-linux*)
+dnl AC_CHECK_FUNCS(nanosleep)
+dnl ol_replace_broken_yield=yes
+dnl ;;
+dnl esac
+
+ if test $ol_replace_broken_yield = yes ; then
+ AC_DEFINE([REPLACE_BROKEN_YIELD], [1],
+ [define if sched_yield yields the entire process])
+ fi
+
+ dnl Check if select causes an yield
+ if test x$ol_with_yielding_select = xauto ; then
+ AC_CACHE_CHECK([if select yields when using pthreads],
+ ol_cv_pthread_select_yields,[
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*) 0
+#endif
+
+static int fildes[2];
+
+static void *task(p)
+ void *p;
+{
+ int i;
+ struct timeval tv;
+
+ fd_set rfds;
+
+ tv.tv_sec=10;
+ tv.tv_usec=0;
+
+ FD_ZERO(&rfds);
+ FD_SET(fildes[0], &rfds);
+
+ /* we're not interested in any fds */
+ i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+ if(i < 0) {
+ perror("select");
+ exit(10);
+ }
+
+ exit(0); /* if we exit here, the select blocked the whole process */
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+
+ /* create a pipe to select */
+ if(pipe(&fildes[0])) {
+ perror("select");
+ exit(1);
+ }
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+ (void) pthread_setconcurrency(2);
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
+ /* Set Solaris LWP concurrency to 2 */
+ thr_setconcurrency(2);
+#endif
+#endif
+
+#if HAVE_PTHREADS < 6
+ pthread_create(&t, pthread_attr_default, task, NULL);
+#else
+ pthread_create(&t, NULL, task, NULL);
+#endif
+
+ /* make sure task runs first */
+#ifdef HAVE_THR_YIELD
+ thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+ sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+ pthread_yield();
+#endif
+
+ exit(2);
+}]])],[ol_cv_pthread_select_yields=no],[ol_cv_pthread_select_yields=yes],[ol_cv_pthread_select_yields=cross])])
+
+ if test $ol_cv_pthread_select_yields = cross ; then
+ AC_MSG_ERROR([crossing compiling: use --with-yielding-select=yes|no|manual])
+ fi
+
+ if test $ol_cv_pthread_select_yields = yes ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+
+ dnl restore flags
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ else
+ AC_MSG_ERROR([could not locate usable POSIX Threads])
+ fi
+ fi
+
+ if test $ol_with_threads = posix ; then
+ AC_MSG_ERROR([could not locate POSIX Threads])
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | mach)
+
+ dnl check for Mach CThreads
+ AC_CHECK_HEADERS(mach/cthreads.h cthreads.h)
+ if test $ac_cv_header_mach_cthreads_h = yes ; then
+ ol_with_threads=found
+
+ dnl check for cthreads support in current $LIBS
+ AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
+
+ if test $ol_link_threads = no ; then
+ dnl try -all_load
+ dnl this test needs work
+ AC_CACHE_CHECK([for cthread_fork with -all_load],
+ [ol_cv_cthread_all_load], [
+ dnl save the flags
+ save_LIBS="$LIBS"
+ LIBS="-all_load $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mach/cthreads.h>]], [[
+ cthread_fork((void *)0, (void *)0);
+ ]])],[ol_cv_cthread_all_load=yes],[ol_cv_cthread_all_load=no])
+ dnl restore the LIBS
+ LIBS="$save_LIBS"
+ ])
+
+ if test $ol_cv_cthread_all_load = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+ ol_link_threads=mach
+ ol_with_threads=found
+ fi
+ fi
+
+ elif test $ac_cv_header_cthreads_h = yes ; then
+ dnl Hurd variant of Mach Cthreads
+ dnl uses <cthreads.h> and -lthreads
+
+ ol_with_threads=found
+
+ dnl save the flags
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lthreads"
+ AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
+ LIBS="$save_LIBS"
+
+ if test $ol_link_threads = yes ; then
+ LTHREAD_LIBS="-lthreads"
+ ol_link_threads=mach
+ ol_with_threads=found
+ else
+ AC_MSG_ERROR([could not link with Mach CThreads])
+ fi
+
+ elif test $ol_with_threads = mach ; then
+ AC_MSG_ERROR([could not locate Mach CThreads])
+ fi
+
+ if test $ol_link_threads = mach ; then
+ AC_DEFINE([HAVE_MACH_CTHREADS], [1],
+ [define if you have Mach Cthreads])
+ elif test $ol_with_threads = found ; then
+ AC_MSG_ERROR([could not link with Mach CThreads])
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | pth)
+
+ AC_CHECK_HEADERS(pth.h)
+
+ if test $ac_cv_header_pth_h = yes ; then
+ AC_CHECK_LIB(pth, pth_version, [have_pth=yes], [have_pth=no])
+
+ if test $have_pth = yes ; then
+ AC_DEFINE([HAVE_GNU_PTH], [1], [if you have GNU Pth])
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
+ ol_link_threads=pth
+ ol_with_threads=found
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+ fi
+ fi
+ ;;
+esac
+
+case $ol_with_threads in auto | yes | lwp)
+
+ dnl check for SunOS5 LWP
+ AC_CHECK_HEADERS(thread.h synch.h)
+ if test $ac_cv_header_thread_h = yes &&
+ test $ac_cv_header_synch_h = yes ; then
+ AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
+
+ if test $have_thr = yes ; then
+ AC_DEFINE([HAVE_THR], [1],
+ [if you have Solaris LWP (thr) package])
+ LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
+ ol_link_threads=thr
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=yes
+ fi
+
+ dnl Check for setconcurrency functions
+ AC_CHECK_FUNCS( \
+ thr_setconcurrency \
+ thr_getconcurrency \
+ )
+ fi
+ fi
+
+ dnl check for SunOS4 LWP
+ AC_CHECK_HEADERS(lwp/lwp.h)
+ if test $ac_cv_header_lwp_lwp_h = yes ; then
+ AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no])
+
+ if test $have_lwp = yes ; then
+ AC_DEFINE([HAVE_LWP], [1],
+ [if you have SunOS LWP package])
+ LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+ ol_link_threads=lwp
+
+ if test x$ol_with_yielding_select = xauto ; then
+ ol_with_yielding_select=no
+ fi
+ fi
+ fi
+ ;;
+esac
+
+if test $ol_with_yielding_select = yes ; then
+ AC_DEFINE([HAVE_YIELDING_SELECT], [1],
+ [define if select implicitly yields])
+fi
+
+if test $ol_with_threads = manual ; then
+ dnl User thinks he can manually configure threads.
+ ol_link_threads=yes
+
+ AC_MSG_WARN([thread defines and link options must be set manually])
+
+ AC_CHECK_HEADERS(pthread.h sched.h)
+ AC_CHECK_FUNCS(sched_yield pthread_yield)
+ OL_HEADER_LINUX_THREADS
+
+ AC_CHECK_HEADERS(mach/cthreads.h)
+ AC_CHECK_HEADERS(lwp/lwp.h)
+ AC_CHECK_HEADERS(thread.h synch.h)
+fi
+
+if test $ol_link_threads != no && test $ol_link_threads != nt ; then
+ dnl needed to get reentrant/threadsafe versions
+ dnl
+ AC_DEFINE([REENTRANT], [1], [enable thread safety])
+ AC_DEFINE([_REENTRANT], [1], [enable thread safety])
+ AC_DEFINE([THREAD_SAFE], [1], [enable thread safety])
+ AC_DEFINE([_THREAD_SAFE], [1], [enable thread safety])
+ AC_DEFINE([THREADSAFE], [1], [enable thread safety])
+ AC_DEFINE([_THREADSAFE], [1], [enable thread safety])
+ AC_DEFINE([_SGI_MP_SOURCE], [1], [enable thread safety])
+
+ dnl The errno declaration may dependent upon _REENTRANT.
+ dnl If it does, we must link with thread support.
+ AC_CACHE_CHECK([for thread specific errno],
+ [ol_cv_errno_thread_specific], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[errno = 0;]])],[ol_cv_errno_thread_specific=yes],[ol_cv_errno_thread_specific=no])
+ ])
+
+ dnl The h_errno declaration may dependent upon _REENTRANT.
+ dnl If it does, we must link with thread support.
+ AC_CACHE_CHECK([for thread specific h_errno],
+ [ol_cv_h_errno_thread_specific], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[h_errno = 0;]])],[ol_cv_h_errno_thread_specific=yes],[ol_cv_h_errno_thread_specific=no])
+ ])
+
+ if test $ol_cv_errno_thread_specific != yes ||
+ test $ol_cv_h_errno_thread_specific != yes ; then
+ LIBS="$LTHREAD_LIBS $LIBS"
+ LTHREAD_LIBS=""
+ fi
+
+dnl When in thread environment, use
+dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
+dnl func_r(...);
+dnl #else
+dnl # if defined( HAVE_THREADS )
+dnl /* lock */
+dnl # endif
+dnl func(...);
+dnl # if defined( HAVE_THREADS )
+dnl /* unlock */
+dnl # endif
+dnl #endif
+dnl
+dnl HAVE_REENTRANT_FUNCTIONS is derived from:
+dnl _POSIX_REENTRANT_FUNCTIONS
+dnl _POSIX_THREAD_SAFE_FUNCTIONS
+dnl _POSIX_THREADSAFE_FUNCTIONS
+dnl
+dnl and is currently defined in <ldap_pvt_thread.h>
+dnl
+dnl HAVE_THREADS is defined by <ldap_pvt_thread.h> iff -UNO_THREADS
+dnl
+dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
+dnl LDAP_R_COMPILE is defined. ie:
+dnl #ifdef LDAP_R_COMPILE
+dnl # include <ldap_pvt_thread.h>
+dnl #endif
+dnl
+dnl LDAP_R_COMPILE is defined by libldap_r/Makefile.in
+dnl specifically for compiling the threadsafe version of
+dnl the ldap library (-lldap_r).
+dnl
+dnl dnl check for reentrant/threadsafe functions
+dnl dnl
+dnl dnl note: these should only be used when linking
+dnl dnl with $LTHREAD_LIBS
+dnl dnl
+dnl save_CPPFLAGS="$CPPFLAGS"
+dnl save_LIBS="$LIBS"
+dnl LIBS="$LTHREAD_LIBS $LIBS"
+dnl AC_CHECK_FUNCS( \
+dnl gmtime_r \
+dnl gethostbyaddr_r gethostbyname_r \
+dnl feof_unlocked unlocked_feof \
+dnl putc_unlocked unlocked_putc \
+dnl flockfile ftrylockfile \
+dnl )
+dnl CPPFLAGS="$save_CPPFLAGS"
+dnl LIBS="$save_LIBS"
+fi
+
+if test $ol_link_threads = no ; then
+ if test $ol_with_threads = yes ; then
+ AC_MSG_ERROR([no suitable thread support])
+ fi
+
+ if test $ol_with_threads = auto ; then
+ AC_MSG_WARN([no suitable thread support, disabling threads])
+ ol_with_threads=no
+ fi
+
+ AC_DEFINE([NO_THREADS], [1],
+ [define if you have (or want) no threads])
+ LTHREAD_LIBS=""
+ BUILD_THREAD=no
+else
+ BUILD_THREAD=yes
+fi
+
+if test $ol_link_threads != no ; then
+ AC_DEFINE([LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE], [1],
+ [define to 1 if library is thread safe])
+fi
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+case "$ol_with_threads" in
+ no)
+ ol_pthread_ok=no
+ $2
+ ;;
+ *)
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ ;;
+esac
+
+AC_LANG_RESTORE
+])
diff --git a/sntp/libevent/m4/openldap.m4 b/sntp/libevent/m4/openldap.m4
new file mode 100644
index 0000000..49ffb87
--- /dev/null
+++ b/sntp/libevent/m4/openldap.m4
@@ -0,0 +1,1131 @@
+dnl OpenLDAP Autoconf Macros
+dnl $OpenLDAP: pkg/ldap/build/openldap.m4,v 1.157.2.10 2010/04/13 20:22:21 kurt Exp $
+dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
+dnl
+dnl Copyright 1998-2010 The OpenLDAP Foundation.
+dnl All rights reserved.
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are permitted only as authorized by the OpenLDAP
+dnl Public License.
+dnl
+dnl A copy of this license is available in the file LICENSE-OPENLDAP in
+dnl this directory of the distribution or, alternatively, at
+dnl <http://www.OpenLDAP.org/license.html>.
+dnl
+dnl --------------------------------------------------------------------
+dnl Restricted form of AC_ARG_ENABLE that limits user options
+dnl
+dnl $1 = option name
+dnl $2 = help-string
+dnl $3 = default value (auto). "--" means do not set it by default
+dnl $4 = allowed values (auto yes no)
+dnl $5 = overridden default
+AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1
+ pushdef([ol_DefVal],ifelse($3,,auto,$3))
+ AC_ARG_ENABLE($1,ifelse($4,,[$2],[$2] translit([$4],[ ],[|])) ifelse($3,--,,@<:@ol_DefVal@:>@),[
+ ol_arg=invalid
+ for ol_val in ifelse($4,,[auto yes no],[$4]) ; do
+ if test "$enableval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ AC_MSG_ERROR(bad value $enableval for --enable-$1)
+ fi
+ ol_enable_$1="$ol_arg"
+]ifelse($3,--,,[,
+[ ol_enable_$1=ifelse($5,,ol_DefVal,[${]$5[:-]ol_DefVal[}])]]))dnl
+dnl AC_MSG_RESULT([OpenLDAP -enable-$1 $ol_enable_$1])
+ popdef([ol_DefVal])
+# end --enable-$1
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Restricted form of AC_ARG_WITH that limits user options
+dnl
+dnl $1 = option name
+dnl $2 = help-string
+dnl $3 = default value (no)
+dnl $4 = allowed values (yes or no)
+AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1
+ AC_ARG_WITH($1,[$2 @<:@]ifelse($3,,yes,$3)@:>@,[
+ ol_arg=invalid
+ for ol_val in ifelse($4,,[yes no],[$4]) ; do
+ if test "$withval" = "$ol_val" ; then
+ ol_arg="$ol_val"
+ fi
+ done
+ if test "$ol_arg" = "invalid" ; then
+ AC_MSG_ERROR(bad value $withval for --with-$1)
+ fi
+ ol_with_$1="$ol_arg"
+],
+[ ol_with_$1=ifelse($3,,"no","$3")])dnl
+dnl AC_MSG_RESULT([OpenLDAP --with-$1 $ol_with_$1])
+# end --with-$1
+])dnl
+dnl ====================================================================
+dnl Check for dependency generation flag
+AC_DEFUN([OL_MKDEPEND], [# test for make depend flag
+OL_MKDEP=
+OL_MKDEP_FLAGS=
+if test -z "${MKDEP}"; then
+ OL_MKDEP="${CC-cc}"
+ if test -z "${MKDEP_FLAGS}"; then
+ AC_CACHE_CHECK([for ${OL_MKDEP} depend flag], ol_cv_mkdep, [
+ ol_cv_mkdep=no
+ for flag in "-M" "-xM"; do
+ cat > conftest.c <<EOF
+ noCode;
+EOF
+ if AC_TRY_COMMAND($OL_MKDEP $flag conftest.c) \
+ | grep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
+ then
+ if test ! -f conftest."${ac_object}" ; then
+ ol_cv_mkdep=$flag
+ OL_MKDEP_FLAGS="$flag"
+ break
+ fi
+ fi
+ done
+ rm -f conftest*
+ ])
+ test "$ol_cv_mkdep" = no && OL_MKDEP=":"
+ else
+ cc_cv_mkdep=yes
+ OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
+ fi
+else
+ cc_cv_mkdep=yes
+ OL_MKDEP="${MKDEP}"
+ OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
+fi
+AC_SUBST(OL_MKDEP)
+AC_SUBST(OL_MKDEP_FLAGS)
+])
+dnl
+dnl ====================================================================
+dnl Check if system uses EBCDIC instead of ASCII
+AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
+AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#if !('M' == 0xd4)
+#include <__ASCII__/generate_error.h>
+#endif
+]])],[ol_cv_cpp_ebcdic=yes],[ol_cv_cpp_ebcdic=no])])
+if test $ol_cv_cpp_ebcdic = yes ; then
+ AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
+fi
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Check for MSVC
+AC_DEFUN([OL_MSVC],
+[AC_REQUIRE_CPP()dnl
+AC_CACHE_CHECK([whether we are using MS Visual C++], ol_cv_msvc,
+[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#ifndef _MSC_VER
+#include <__FOO__/generate_error.h>
+#endif
+]])],[ol_cv_msvc=yes],[ol_cv_msvc=no])])])
+
+dnl --------------------------------------------------------------------
+dnl OpenLDAP version of STDC header check w/ EBCDIC support
+AC_DEFUN([OL_HEADER_STDC],
+[AC_REQUIRE_CPP()dnl
+AC_REQUIRE([OL_CPP_EBCDIC])dnl
+AC_CACHE_CHECK([for ANSI C header files], ol_cv_header_stdc,
+[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>]])],[ol_cv_header_stdc=yes],[ol_cv_header_stdc=no])
+
+if test $ol_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+AC_EGREP_HEADER(memchr, string.h, , ol_cv_header_stdc=no)
+fi
+
+if test $ol_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+AC_EGREP_HEADER(free, stdlib.h, , ol_cv_header_stdc=no)
+fi
+
+if test $ol_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h>
+#ifndef HAVE_EBCDIC
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+]])],[],[ol_cv_header_stdc=no],[:])
+fi])
+if test $ol_cv_header_stdc = yes; then
+ AC_DEFINE([STDC_HEADERS], [1], [is standard C provided?])
+fi
+ac_cv_header_stdc=disable
+])
+dnl
+dnl ====================================================================
+dnl DNS resolver macros
+AC_DEFUN([OL_RESOLVER_TRY],
+[if test $ol_cv_lib_resolver = no ; then
+ AC_CACHE_CHECK([for resolver link (]ifelse($2,,default,$2)[)],[$1],
+[
+ ol_RESOLVER_LIB=ifelse($2,,,$2)
+ ol_LIBS=$LIBS
+ LIBS="$ol_RESOLVER_LIB $LIBS"
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+# include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+# include <resolv.h>
+#endif
+]], [[{
+ int len, status;
+ char *request = NULL;
+ unsigned char reply[64*1024];
+ unsigned char host[64*1024];
+ unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+ /* Bind 8/9 interface */
+ len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+ /* Bind 4 interface */
+# ifndef T_SRV
+# define T_SRV 33
+# endif
+ len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+ p = reply;
+#ifdef NS_HFIXEDSZ
+ /* Bind 8/9 interface */
+ p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+ /* Bind 4 interface w/ HFIXEDSZ */
+ p += HFIXEDSZ;
+#else
+ /* Bind 4 interface w/o HFIXEDSZ */
+ p += sizeof(HEADER);
+#endif
+ status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}]])],[$1=yes],[$1=no])
+
+ LIBS="$ol_LIBS"
+])
+
+ if test $$1 = yes ; then
+ ol_cv_lib_resolver=ifelse($2,,yes,$2)
+ fi
+fi
+])
+dnl --------------------------------------------------------------------
+dnl Try to locate appropriate library
+AC_DEFUN([OL_RESOLVER_LINK],
+[ol_cv_lib_resolver=no
+OL_RESOLVER_TRY(ol_cv_resolver_none)
+OL_RESOLVER_TRY(ol_cv_resolver_resolv,[-lresolv])
+OL_RESOLVER_TRY(ol_cv_resolver_bind,[-lbind])
+])
+dnl
+dnl ====================================================================
+dnl International Components for Unicode (ICU)
+AC_DEFUN([OL_ICU],
+[ol_icu=no
+AC_CHECK_HEADERS( unicode/utypes.h )
+if test $ac_cv_header_unicode_utypes_h = yes ; then
+ dnl OL_ICULIBS="-licui18n -licuuc -licudata"
+ OL_ICULIBS="-licuuc -licudata"
+
+ AC_CACHE_CHECK([for ICU libraries], [ol_cv_lib_icu], [
+ ol_LIBS="$LIBS"
+ LIBS="$OL_ICULIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <unicode/utypes.h>
+]], [[
+(void) u_errorName(0);
+]])],[ol_cv_lib_icu=yes],[ol_cv_lib_icu=no])
+ LIBS="$ol_LIBS"
+])
+
+ if test $ol_cv_lib_icu != no ; then
+ ol_icu="$OL_ICULIBS"
+ AC_DEFINE([HAVE_ICU], [1], [define if you actually have ICU])
+ fi
+fi
+])
+dnl
+dnl ====================================================================
+dnl Berkeley DB macros
+dnl
+dnl --------------------------------------------------------------------
+dnl Try to link
+AC_DEFUN([OL_BERKELEY_DB_TRY],
+[if test $ol_cv_lib_db = no ; then
+ AC_CACHE_CHECK([for Berkeley DB link (]ifelse($2,,default,$2)[)],[$1],
+[
+ ol_DB_LIB=ifelse($2,,,$2)
+ ol_LIBS=$LIBS
+ LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+]], [[
+#if DB_VERSION_MAJOR > 2
+ db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+ db_appexit( NULL );
+#else
+ (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+]])],[$1=yes],[$1=no])
+
+ LIBS="$ol_LIBS"
+])
+
+ if test $$1 = yes ; then
+ ol_cv_lib_db=ifelse($2,,yes,$2)
+ fi
+fi
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Get major and minor version from <db.h>
+AC_DEFUN([OL_BDB_HEADER_VERSION],
+[AC_CACHE_CHECK([for Berkeley DB major version in db.h], [ol_cv_bdb_major],[
+ AC_LANG_CONFTEST([
+#include <db.h>
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+__db_version DB_VERSION_MAJOR
+])
+ set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+ ol_cv_bdb_major=${3}
+])
+case $ol_cv_bdb_major in [[1-9]]*) : ;; *)
+ AC_MSG_ERROR([Unknown Berkeley DB major version in db.h]) ;;
+esac
+
+dnl Determine minor version
+AC_CACHE_CHECK([for Berkeley DB minor version in db.h], [ol_cv_bdb_minor],[
+ AC_LANG_CONFTEST([
+#include <db.h>
+#ifndef DB_VERSION_MINOR
+# define DB_VERSION_MINOR 0
+#endif
+__db_version DB_VERSION_MINOR
+])
+ set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+ ol_cv_bdb_minor=${3}
+])
+case $ol_cv_bdb_minor in [[0-9]]*) : ;; *)
+ AC_MSG_ERROR([Unknown Berkeley DB minor version in db.h]) ;;
+esac
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Try to locate appropriate library
+AC_DEFUN([OL_BERKELEY_DB_LINK],
+[ol_cv_lib_db=no
+
+if test $ol_cv_bdb_major = 4 ; then
+ OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_m,[-ldb-4.$ol_cv_bdb_minor])
+ OL_BERKELEY_DB_TRY(ol_cv_db_db4m,[-ldb4$ol_cv_bdb_minor])
+ OL_BERKELEY_DB_TRY(ol_cv_db_db_4m,[-ldb-4$ol_cv_bdb_minor])
+ OL_BERKELEY_DB_TRY(ol_cv_db_db_4_m,[-ldb-4-$ol_cv_bdb_minor])
+ OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
+ OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
+ OL_BERKELEY_DB_TRY(ol_cv_db_db,[-ldb])
+fi
+OL_BERKELEY_DB_TRY(ol_cv_db_none)
+])
+dnl
+dnl --------------------------------------------------------------------
+dnl Check if Berkeley DB version
+AC_DEFUN([OL_BERKELEY_DB_VERSION],
+[AC_CACHE_CHECK([for Berkeley DB library and header version match], [ol_cv_berkeley_db_version], [
+ ol_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ if test $ol_cv_lib_db != yes ; then
+ LIBS="$ol_cv_lib_db $LIBS"
+ fi
+
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_DB_185_H
+ choke me;
+#else
+#include <db.h>
+#endif
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+main()
+{
+#if DB_VERSION_MAJOR > 1
+ char *version;
+ int major, minor, patch;
+
+ version = db_version( &major, &minor, &patch );
+
+ if( major != DB_VERSION_MAJOR ||
+ minor != DB_VERSION_MINOR ||
+ patch != DB_VERSION_PATCH )
+ {
+ printf("Berkeley DB version mismatch\n"
+ "\theader: %s\n\tlibrary: %s\n",
+ DB_VERSION_STRING, version);
+ return 1;
+ }
+#endif
+
+ return 0;
+}]])],[ol_cv_berkeley_db_version=yes],[ol_cv_berkeley_db_version=no],[ol_cv_berkeley_db_version=cross])
+
+ LIBS="$ol_LIBS"
+])
+
+ if test $ol_cv_berkeley_db_version = no ; then
+ AC_MSG_ERROR([Berkeley DB version mismatch])
+ fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Check if Berkeley DB supports DB_THREAD
+AC_DEFUN([OL_BERKELEY_DB_THREAD],
+[AC_CACHE_CHECK([for Berkeley DB thread support], [ol_cv_berkeley_db_thread], [
+ ol_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ if test $ol_cv_lib_db != yes ; then
+ LIBS="$ol_cv_lib_db $LIBS"
+ fi
+
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_DB_185_H
+ choke me;
+#else
+#include <db.h>
+#endif
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+main()
+{
+ int rc;
+ u_int32_t flags = DB_CREATE |
+#ifdef DB_PRIVATE
+ DB_PRIVATE |
+#endif
+ DB_THREAD;
+
+#if DB_VERSION_MAJOR > 2
+ DB_ENV *env = NULL;
+
+ rc = db_env_create( &env, 0 );
+
+ flags |= DB_INIT_MPOOL;
+#ifdef DB_MPOOL_PRIVATE
+ flags |= DB_MPOOL_PRIVATE;
+#endif
+
+ if( rc ) {
+ printf("BerkeleyDB: %s\n", db_strerror(rc) );
+ return rc;
+ }
+
+#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
+ rc = (env->open)( env, NULL, flags, 0 );
+#else
+ rc = (env->open)( env, NULL, NULL, flags, 0 );
+#endif
+
+ if ( rc == 0 ) {
+ rc = env->close( env, 0 );
+ }
+
+ if( rc ) {
+ printf("BerkeleyDB: %s\n", db_strerror(rc) );
+ return rc;
+ }
+
+#else
+ DB_ENV env;
+ memset( &env, '\0', sizeof(env) );
+
+ rc = db_appinit( NULL, NULL, &env, flags );
+
+ if( rc == 0 ) {
+ db_appexit( &env );
+ }
+
+ unlink("__db_mpool.share");
+ unlink("__db_lock.share");
+#endif
+
+ return rc;
+}]])],[ol_cv_berkeley_db_thread=yes],[ol_cv_berkeley_db_thread=no],[ol_cv_berkeley_db_thread=cross])
+
+ LIBS="$ol_LIBS"
+])
+
+ if test $ol_cv_berkeley_db_thread != no ; then
+ AC_DEFINE([HAVE_BERKELEY_DB_THREAD], [1],
+ [define if Berkeley DB has DB_THREAD support])
+ fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Find any DB
+AC_DEFUN([OL_BERKELEY_DB],
+[ol_cv_berkeley_db=no
+AC_CHECK_HEADERS(db.h)
+if test $ac_cv_header_db_h = yes; then
+ OL_BDB_HEADER_VERSION
+ OL_BDB_COMPAT
+
+ if test $ol_cv_bdb_compat != yes ; then
+ AC_MSG_ERROR([BerkeleyDB version incompatible with BDB/HDB backends])
+ fi
+
+ OL_BERKELEY_DB_LINK
+ if test "$ol_cv_lib_db" != no ; then
+ ol_cv_berkeley_db=yes
+ OL_BERKELEY_DB_VERSION
+ OL_BERKELEY_DB_THREAD
+ fi
+fi
+])
+dnl --------------------------------------------------------------------
+dnl Check for version compatility with back-bdb
+AC_DEFUN([OL_BDB_COMPAT],
+[AC_CACHE_CHECK([if Berkeley DB version supported by BDB/HDB backends], [ol_cv_bdb_compat],[
+ AC_EGREP_CPP(__db_version_compat,[
+#include <db.h>
+
+ /* this check could be improved */
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+#ifndef DB_VERSION_MINOR
+# define DB_VERSION_MINOR 0
+#endif
+
+#define DB_VERSION_MM ((DB_VERSION_MAJOR<<8)|DB_VERSION_MINOR)
+
+/* require 4.4 or later */
+#if DB_VERSION_MM >= 0x0404
+ __db_version_compat
+#endif
+ ], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
+])
+
+dnl
+dnl ====================================================================
+dnl Check POSIX Thread version
+dnl
+dnl defines ol_cv_pthread_version to 4, 5, 6, 7, 8, 10, depending on the
+dnl version of the POSIX.4a Draft that is implemented.
+dnl 10 == POSIX.4a Final == POSIX.1c-1996 for our purposes.
+dnl Existence of pthread.h should be tested separately.
+dnl
+dnl tests:
+dnl pthread_detach() was dropped in Draft 8, it is present
+dnl in every other version
+dnl PTHREAD_CREATE_UNDETACHED is only in Draft 7, it was called
+dnl PTHREAD_CREATE_JOINABLE after that
+dnl pthread_attr_create was renamed to pthread_attr_init in Draft 6.
+dnl Draft 6-10 has _init, Draft 4-5 has _create.
+dnl pthread_attr_default was dropped in Draft 6, only 4 and 5 have it
+dnl PTHREAD_MUTEX_INITIALIZER was introduced in Draft 5. It's not
+dnl interesting to us because we don't try to statically
+dnl initialize mutexes. 5-10 has it.
+dnl
+dnl Draft 9 and 10 are equivalent for our purposes.
+dnl
+AC_DEFUN([OL_POSIX_THREAD_VERSION],
+[AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+# include <pthread.h>
+ ]], [[
+ int i = PTHREAD_CREATE_JOINABLE;
+ ]])],[
+ AC_EGREP_HEADER(pthread_detach,pthread.h,
+ ol_cv_pthread_version=10, ol_cv_pthread_version=8)],[
+ AC_EGREP_CPP(draft7,[
+# include <pthread.h>
+# ifdef PTHREAD_CREATE_UNDETACHED
+ draft7
+# endif
+ ], ol_cv_pthread_version=7, [
+ AC_EGREP_HEADER(pthread_attr_init,pthread.h,
+ ol_cv_pthread_version=6, [
+ AC_EGREP_CPP(draft5,[
+# include <pthread.h>
+#ifdef PTHREAD_MUTEX_INITIALIZER
+ draft5
+#endif
+ ], ol_cv_pthread_version=5, ol_cv_pthread_version=4) ]) ]) ])
+])
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [[
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+]])
+AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
+ /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+ pthread_t t;
+ int status;
+ int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+ /* Final pthreads */
+ pthread_attr_t attr;
+
+ status = pthread_attr_init(&attr);
+ if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+ status = pthread_attr_setdetachstate(&attr, &detach);
+ if( status < 0 ) status = errno;
+#else
+ status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+ if( status ) return status;
+ status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+ if( status < 0 ) status = errno;
+#endif
+ if( status ) return status;
+#else
+ /* Draft 4 pthreads */
+ status = pthread_create( &t, pthread_attr_default, task, NULL );
+ if( status ) return errno;
+
+ /* give thread a chance to complete */
+ /* it should remain joinable and hence detachable */
+ sleep( 1 );
+
+ status = pthread_detach( &t );
+ if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+ pthread_kill_other_threads_np();
+#endif
+
+ return 0;
+]])
+
+AC_DEFUN([OL_PTHREAD_TEST_PROGRAM], [
+AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+OL_PTHREAD_TEST_FUNCTION
+}
+])])
+dnl --------------------------------------------------------------------
+AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
+if test "$ol_link_threads" = no ; then
+ # try $1
+ AC_CACHE_CHECK([for pthread link with $1], [$2], [
+ # save the flags
+ ol_LIBS="$LIBS"
+ LIBS="$1 $LIBS"
+
+ AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
+ [$2=yes],
+ [$2=no],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM(OL_PTHREAD_TEST_INCLUDES,
+ OL_PTHREAD_TEST_FUNCTION)],
+ [$2=yes], [$2=no])])
+
+ # restore the LIBS
+ LIBS="$ol_LIBS"
+ ])
+
+ if test $$2 = yes ; then
+ ol_link_pthreads="$1"
+ ol_link_threads=posix
+ fi
+fi
+])
+dnl
+dnl ====================================================================
+dnl Check GNU Pth pthread Header
+dnl
+dnl defines ol_cv_header linux_threads to 'yes' or 'no'
+dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
+dnl doesn't exists. Existance of pthread.h should separately
+dnl checked.
+dnl
+AC_DEFUN([OL_HEADER_GNU_PTH_PTHREAD_H], [
+ AC_CACHE_CHECK([for GNU Pth pthread.h],
+ [ol_cv_header_gnu_pth_pthread_h],
+ [AC_EGREP_CPP(__gnu_pth__,
+ [#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+ __gnu_pth__;
+#endif
+],
+ [ol_cv_header_gnu_pth_pthread_h=yes],
+ [ol_cv_header_gnu_pth_pthread_h=no])
+ ])
+])dnl
+dnl ====================================================================
+dnl Check for NT Threads
+AC_DEFUN([OL_NT_THREADS], [
+ AC_CHECK_FUNC(_beginthread)
+
+ if test $ac_cv_func__beginthread = yes ; then
+ AC_DEFINE([HAVE_NT_THREADS], [1], [if you have NT Threads])
+ ol_cv_nt_threads=yes
+ fi
+])
+dnl ====================================================================
+dnl Check LinuxThreads Header
+dnl
+dnl defines ol_cv_header linux_threads to 'yes' or 'no'
+dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
+dnl doesn't exists. Existance of pthread.h should separately
+dnl checked.
+dnl
+AC_DEFUN([OL_HEADER_LINUX_THREADS], [
+ AC_CACHE_CHECK([for LinuxThreads pthread.h],
+ [ol_cv_header_linux_threads],
+ [AC_EGREP_CPP(pthread_kill_other_threads_np,
+ [#include <pthread.h>],
+ [ol_cv_header_linux_threads=yes],
+ [ol_cv_header_linux_threads=no])
+ ])
+ if test $ol_cv_header_linux_threads = yes; then
+ AC_DEFINE([HAVE_LINUX_THREADS], [1], [if you have LinuxThreads])
+ fi
+])dnl
+dnl --------------------------------------------------------------------
+dnl Check LinuxThreads Implementation
+dnl
+dnl defines ol_cv_sys_linux_threads to 'yes' or 'no'
+dnl 'no' implies pthreads implementation is not LinuxThreads.
+dnl
+AC_DEFUN([OL_SYS_LINUX_THREADS], [
+ AC_CHECK_FUNCS(pthread_kill_other_threads_np)
+ AC_CACHE_CHECK([for LinuxThreads implementation],
+ [ol_cv_sys_linux_threads],
+ [ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np])
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Check LinuxThreads consistency
+AC_DEFUN([OL_LINUX_THREADS], [
+ AC_REQUIRE([OL_HEADER_LINUX_THREADS])
+ AC_REQUIRE([OL_SYS_LINUX_THREADS])
+ AC_CACHE_CHECK([for LinuxThreads consistency], [ol_cv_linux_threads], [
+ if test $ol_cv_header_linux_threads = yes &&
+ test $ol_cv_sys_linux_threads = yes; then
+ ol_cv_linux_threads=yes
+ elif test $ol_cv_header_linux_threads = no &&
+ test $ol_cv_sys_linux_threads = no; then
+ ol_cv_linux_threads=no
+ else
+ ol_cv_linux_threads=error
+ fi
+ ])
+])dnl
+dnl
+dnl ====================================================================
+dnl Check for POSIX Regex
+AC_DEFUN([OL_POSIX_REGEX], [
+AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <regex.h>
+static char *pattern, *string;
+main()
+{
+ int rc;
+ regex_t re;
+
+ pattern = "^A";
+
+ if(regcomp(&re, pattern, 0)) {
+ return -1;
+ }
+
+ string = "ALL MATCH";
+
+ rc = regexec(&re, string, 0, (void*)0, 0);
+
+ regfree(&re);
+
+ return rc;
+}]])],[ol_cv_c_posix_regex=yes],[ol_cv_c_posix_regex=no],[ol_cv_c_posix_regex=cross])])
+])
+dnl
+dnl ====================================================================
+dnl Check if toupper() requires islower() to be called first
+AC_DEFUN([OL_C_UPPER_LOWER],
+[AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <ctype.h>
+main()
+{
+ if ('C' == toupper('C'))
+ exit(0);
+ else
+ exit(1);
+}]])],[ol_cv_c_upper_lower=no],[ol_cv_c_upper_lower=yes],[ol_cv_c_upper_lower=safe])])
+if test $ol_cv_c_upper_lower != no ; then
+ AC_DEFINE([C_UPPER_LOWER], [1], [define if toupper() requires islower()])
+fi
+])
+dnl
+dnl ====================================================================
+dnl Error string checks
+dnl
+dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
+dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
+dnl Reported by Keith Bostic.
+AC_DEFUN([OL_SYS_ERRLIST],
+[AC_CACHE_CHECK([declaration of sys_errlist],ol_cv_dcl_sys_errlist,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h>
+#ifdef _WIN32
+#include <stdlib.h>
+#endif ]], [[char *c = (char *) *sys_errlist]])],[ol_cv_dcl_sys_errlist=yes
+ ol_cv_have_sys_errlist=yes],[ol_cv_dcl_sys_errlist=no])])
+#
+# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
+if test $ol_cv_dcl_sys_errlist = no ; then
+ AC_DEFINE([DECL_SYS_ERRLIST], [1],
+ [define if sys_errlist is not declared in stdio.h or errno.h])
+
+ AC_CACHE_CHECK([existence of sys_errlist],ol_cv_have_sys_errlist,[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[char *c = (char *) *sys_errlist]])],[ol_cv_have_sys_errlist=yes],[ol_cv_have_sys_errlist=no])])
+fi
+if test $ol_cv_have_sys_errlist = yes ; then
+ AC_DEFINE([HAVE_SYS_ERRLIST], [1],
+ [define if you actually have sys_errlist in your libs])
+fi
+])dnl
+AC_DEFUN([OL_NONPOSIX_STRERROR_R],
+[AC_CACHE_CHECK([non-posix strerror_r],ol_cv_nonposix_strerror_r,[
+ AC_EGREP_CPP(strerror_r,[#include <string.h>],
+ ol_decl_strerror_r=yes, ol_decl_strerror_r=no)dnl
+
+ if test $ol_decl_strerror_r = yes ; then
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[ /* from autoconf 2.59 */
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ ]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no])
+ else
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ main() {
+ char buf[100];
+ buf[0] = 0;
+ strerror_r( 1, buf, sizeof buf );
+ exit( buf[0] == 0 );
+ }
+ ]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror=no],[ol_cv_nonposix_strerror=no])
+ fi
+ ])
+if test $ol_cv_nonposix_strerror_r = yes ; then
+ AC_DEFINE([HAVE_NONPOSIX_STRERROR_R], [1],
+ [define if strerror_r returns char* instead of int])
+fi
+])dnl
+dnl
+AC_DEFUN([OL_STRERROR],
+[OL_SYS_ERRLIST dnl TEMPORARY
+AC_CHECK_FUNCS(strerror strerror_r)
+ol_cv_func_strerror_r=no
+if test "${ac_cv_func_strerror_r}" = yes ; then
+ OL_NONPOSIX_STRERROR_R
+elif test "${ac_cv_func_strerror}" = no ; then
+ OL_SYS_ERRLIST
+fi
+])dnl
+dnl ====================================================================
+dnl Early MIPS compilers (used in Ultrix 4.2) don't like
+dnl "int x; int *volatile a = &x; *a = 0;"
+dnl -- borrowed from PDKSH
+AC_DEFUN([OL_C_VOLATILE],
+ [AC_CACHE_CHECK(if compiler understands volatile, ol_cv_c_volatile,
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x, y, z;]], [[volatile int a; int * volatile b = x ? &y : &z;
+ /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
+ *b = 0;]])],[ol_cv_c_volatile=yes],[ol_cv_c_volatile=no])])
+ if test $ol_cv_c_volatile = yes; then
+ :
+ else
+ AC_DEFINE([volatile], [], [define as empty if volatile is not supported])
+ fi
+ ])dnl
+dnl
+dnl ====================================================================
+dnl Look for fetch(3)
+AC_DEFUN([OL_LIB_FETCH],
+[ol_LIBS=$LIBS
+LIBS="-lfetch -lcom_err $LIBS"
+AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <stdio.h>
+#include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
+LIBS=$ol_LIBS
+if test $ol_cv_lib_fetch != no ; then
+ ol_link_fetch="-lfetch -lcom_err"
+ AC_DEFINE([HAVE_FETCH], [1],
+ [define if you actually have FreeBSD fetch(3)])
+fi
+])dnl
+dnl
+dnl ====================================================================
+dnl Define inet_aton is available
+AC_DEFUN([OL_FUNC_INET_ATON],
+ [AC_CACHE_CHECK([for inet_aton()], ol_cv_func_inet_aton,
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+# ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+# endif
+# include <netinet/in.h>
+# ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+# endif
+#endif
+]], [[struct in_addr in;
+int rc = inet_aton( "255.255.255.255", &in );]])],[ol_cv_func_inet_aton=yes],[ol_cv_func_inet_aton=no])])
+ if test $ol_cv_func_inet_aton != no; then
+ AC_DEFINE(HAVE_INET_ATON, 1,
+ [define to you inet_aton(3) is available])
+ fi
+ ])dnl
+dnl
+dnl ====================================================================
+dnl check no of arguments for ctime_r
+AC_DEFUN([OL_FUNC_CTIME_R_NARGS],
+ [AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer,32);]])],[ol_cv_func_ctime_r_nargs3=yes],[ol_cv_func_ctime_r_nargs3=no])
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer);]])],[ol_cv_func_ctime_r_nargs2=yes],[ol_cv_func_ctime_r_nargs2=no])
+
+ if test $ol_cv_func_ctime_r_nargs3 = yes &&
+ test $ol_cv_func_ctime_r_nargs2 = no ; then
+
+ ol_cv_func_ctime_r_nargs=3
+
+ elif test $ol_cv_func_ctime_r_nargs3 = no &&
+ test $ol_cv_func_ctime_r_nargs2 = yes ; then
+
+ ol_cv_func_ctime_r_nargs=2
+
+ else
+ ol_cv_func_ctime_r_nargs=0
+ fi
+ ])
+
+ if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
+ AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
+ [set to the number of arguments ctime_r() expects])
+ fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl check return type of ctime_r()
+AC_DEFUN([OL_FUNC_CTIME_R_TYPE],
+ [AC_CACHE_CHECK(return type of ctime_r, ol_cv_func_ctime_r_type,
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[extern int (ctime_r)();]])],[ol_cv_func_ctime_r_type="int"],[ol_cv_func_ctime_r_type="charp"])
+ ])
+ if test $ol_cv_func_ctime_r_type = "int" ; then
+ AC_DEFINE(CTIME_R_RETURNS_INT,1, [define if ctime_r() returns int])
+ fi
+])dnl
+dnl ====================================================================
+dnl check no of arguments for gethostbyname_r
+AC_DEFUN([OL_FUNC_GETHOSTBYNAME_R_NARGS],
+ [AC_CACHE_CHECK(number of arguments of gethostbyname_r,
+ ol_cv_func_gethostbyname_r_nargs,
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
+ buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs5=yes],[ol_cv_func_gethostbyname_r_nargs5=no])
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;struct hostent *rhent;
+ char buffer[BUFSIZE];
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
+ &rhent, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs6=yes],[ol_cv_func_gethostbyname_r_nargs6=no])
+
+ if test $ol_cv_func_gethostbyname_r_nargs5 = yes &&
+ test $ol_cv_func_gethostbyname_r_nargs6 = no ; then
+
+ ol_cv_func_gethostbyname_r_nargs=5
+
+ elif test $ol_cv_func_gethostbyname_r_nargs5 = no &&
+ test $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
+
+ ol_cv_func_gethostbyname_r_nargs=6
+
+ else
+ ol_cv_func_gethostbyname_r_nargs=0
+ fi
+ ])
+ if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
+ AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS,
+ $ol_cv_func_gethostbyname_r_nargs,
+ [set to the number of arguments gethostbyname_r() expects])
+ fi
+])dnl
+dnl
+dnl check no of arguments for gethostbyaddr_r
+AC_DEFUN([OL_FUNC_GETHOSTBYADDR_R_NARGS],
+ [AC_CACHE_CHECK(number of arguments of gethostbyaddr_r,
+ [ol_cv_func_gethostbyaddr_r_nargs],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
+ struct in_addr add;
+ size_t alen=sizeof(struct in_addr);
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyaddr_r( (void *)&(add.s_addr),
+ alen, AF_INET, &hent, buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs7=yes],[ol_cv_func_gethostbyaddr_r_nargs7=no])
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;
+ struct hostent *rhent; char buffer[BUFSIZE];
+ struct in_addr add;
+ size_t alen=sizeof(struct in_addr);
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyaddr_r( (void *)&(add.s_addr),
+ alen, AF_INET, &hent, buffer, bufsize,
+ &rhent, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs8=yes],[ol_cv_func_gethostbyaddr_r_nargs8=no])
+
+ if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes &&
+ test $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
+
+ ol_cv_func_gethostbyaddr_r_nargs=7
+
+ elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no &&
+ test $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
+
+ ol_cv_func_gethostbyaddr_r_nargs=8
+
+ else
+ ol_cv_func_gethostbyaddr_r_nargs=0
+ fi
+ ])
+ if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
+ AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_NARGS,
+ $ol_cv_func_gethostbyaddr_r_nargs,
+ [set to the number of arguments gethostbyaddr_r() expects])
+ fi
+])dnl
+dnl
+dnl --------------------------------------------------------------------
+dnl Check for Cyrus SASL version compatility
+AC_DEFUN([OL_SASL_COMPAT],
+[AC_CACHE_CHECK([Cyrus SASL library version], [ol_cv_sasl_compat],[
+ AC_EGREP_CPP(__sasl_compat,[
+#ifdef HAVE_SASL_SASL_H
+#include <sasl/sasl.h>
+#else
+#include <sasl.h>
+#endif
+
+/* Require 2.1.15+ */
+#if SASL_VERSION_MAJOR == 2 && SASL_VERSION_MINOR > 1
+ char *__sasl_compat = "2.2+ or better okay (we guess)";
+#elif SASL_VERSION_MAJOR == 2 && SASL_VERSION_MINOR == 1 \
+ && SASL_VERSION_STEP >=15
+ char *__sasl_compat = "2.1.15+ or better okay";
+#endif
+ ], [ol_cv_sasl_compat=yes], [ol_cv_sasl_compat=no])])
+])
+dnl ====================================================================
+dnl check for SSL compatibility
+AC_DEFUN([OL_SSL_COMPAT],
+[AC_CACHE_CHECK([OpenSSL library version (CRL checking capability)],
+ [ol_cv_ssl_crl_compat],[
+ AC_EGREP_CPP(__ssl_compat,[
+#ifdef HAVE_OPENSSL_SSL_H
+#include <openssl/ssl.h>
+#endif
+
+/* Require 0.9.7d+ */
+#if OPENSSL_VERSION_NUMBER >= 0x0090704fL
+ char *__ssl_compat = "0.9.7d";
+#endif
+ ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
+])
diff --git a/sntp/libevent/make-event-config.sed b/sntp/libevent/make-event-config.sed
new file mode 100644
index 0000000..e31018a
--- /dev/null
+++ b/sntp/libevent/make-event-config.sed
@@ -0,0 +1,23 @@
+# Sed script to postprocess config.h into event-config.h.
+
+1i\
+/* event2/event-config.h\
+ *\
+ * This file was generated by autoconf when libevent was built, and post-\
+ * processed by Libevent so that its macros would have a uniform prefix.\
+ *\
+ * DO NOT EDIT THIS FILE.\
+ *\
+ * Do not rely on macros in this file existing in later versions.\
+ */\
+\
+#ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_\
+#define EVENT2_EVENT_CONFIG_H_INCLUDED_\
+
+$a\
+\
+#endif /* event2/event-config.h */
+
+s/#\( *\)define /#\1define EVENT__/
+s/#\( *\)undef /#\1undef EVENT__/
+s/#\( *\)if\(n*\)def /#\1if\2def EVENT__/
diff --git a/sntp/libevent/minheap-internal.h b/sntp/libevent/minheap-internal.h
new file mode 100644
index 0000000..b3b6f1f
--- /dev/null
+++ b/sntp/libevent/minheap-internal.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Copyright (c) 2006 Maxim Yegorushkin <maxim.yegorushkin@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef MINHEAP_INTERNAL_H_INCLUDED_
+#define MINHEAP_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/util.h"
+#include "util-internal.h"
+#include "mm-internal.h"
+
+typedef struct min_heap
+{
+ struct event** p;
+ unsigned n, a;
+} min_heap_t;
+
+static inline void min_heap_ctor_(min_heap_t* s);
+static inline void min_heap_dtor_(min_heap_t* s);
+static inline void min_heap_elem_init_(struct event* e);
+static inline int min_heap_elt_is_top_(const struct event *e);
+static inline int min_heap_empty_(min_heap_t* s);
+static inline unsigned min_heap_size_(min_heap_t* s);
+static inline struct event* min_heap_top_(min_heap_t* s);
+static inline int min_heap_reserve_(min_heap_t* s, unsigned n);
+static inline int min_heap_push_(min_heap_t* s, struct event* e);
+static inline struct event* min_heap_pop_(min_heap_t* s);
+static inline int min_heap_adjust_(min_heap_t *s, struct event* e);
+static inline int min_heap_erase_(min_heap_t* s, struct event* e);
+static inline void min_heap_shift_up_(min_heap_t* s, unsigned hole_index, struct event* e);
+static inline void min_heap_shift_up_unconditional_(min_heap_t* s, unsigned hole_index, struct event* e);
+static inline void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e);
+
+#define min_heap_elem_greater(a, b) \
+ (evutil_timercmp(&(a)->ev_timeout, &(b)->ev_timeout, >))
+
+void min_heap_ctor_(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; }
+void min_heap_dtor_(min_heap_t* s) { if (s->p) mm_free(s->p); }
+void min_heap_elem_init_(struct event* e) { e->ev_timeout_pos.min_heap_idx = -1; }
+int min_heap_empty_(min_heap_t* s) { return 0u == s->n; }
+unsigned min_heap_size_(min_heap_t* s) { return s->n; }
+struct event* min_heap_top_(min_heap_t* s) { return s->n ? *s->p : 0; }
+
+int min_heap_push_(min_heap_t* s, struct event* e)
+{
+ if (min_heap_reserve_(s, s->n + 1))
+ return -1;
+ min_heap_shift_up_(s, s->n++, e);
+ return 0;
+}
+
+struct event* min_heap_pop_(min_heap_t* s)
+{
+ if (s->n)
+ {
+ struct event* e = *s->p;
+ min_heap_shift_down_(s, 0u, s->p[--s->n]);
+ e->ev_timeout_pos.min_heap_idx = -1;
+ return e;
+ }
+ return 0;
+}
+
+int min_heap_elt_is_top_(const struct event *e)
+{
+ return e->ev_timeout_pos.min_heap_idx == 0;
+}
+
+int min_heap_erase_(min_heap_t* s, struct event* e)
+{
+ if (-1 != e->ev_timeout_pos.min_heap_idx)
+ {
+ struct event *last = s->p[--s->n];
+ unsigned parent = (e->ev_timeout_pos.min_heap_idx - 1) / 2;
+ /* we replace e with the last element in the heap. We might need to
+ shift it upward if it is less than its parent, or downward if it is
+ greater than one or both its children. Since the children are known
+ to be less than the parent, it can't need to shift both up and
+ down. */
+ if (e->ev_timeout_pos.min_heap_idx > 0 && min_heap_elem_greater(s->p[parent], last))
+ min_heap_shift_up_unconditional_(s, e->ev_timeout_pos.min_heap_idx, last);
+ else
+ min_heap_shift_down_(s, e->ev_timeout_pos.min_heap_idx, last);
+ e->ev_timeout_pos.min_heap_idx = -1;
+ return 0;
+ }
+ return -1;
+}
+
+int min_heap_adjust_(min_heap_t *s, struct event *e)
+{
+ if (-1 == e->ev_timeout_pos.min_heap_idx) {
+ return min_heap_push_(s, e);
+ } else {
+ unsigned parent = (e->ev_timeout_pos.min_heap_idx - 1) / 2;
+ /* The position of e has changed; we shift it up or down
+ * as needed. We can't need to do both. */
+ if (e->ev_timeout_pos.min_heap_idx > 0 && min_heap_elem_greater(s->p[parent], e))
+ min_heap_shift_up_unconditional_(s, e->ev_timeout_pos.min_heap_idx, e);
+ else
+ min_heap_shift_down_(s, e->ev_timeout_pos.min_heap_idx, e);
+ return 0;
+ }
+}
+
+int min_heap_reserve_(min_heap_t* s, unsigned n)
+{
+ if (s->a < n)
+ {
+ struct event** p;
+ unsigned a = s->a ? s->a * 2 : 8;
+ if (a < n)
+ a = n;
+ if (!(p = (struct event**)mm_realloc(s->p, a * sizeof *p)))
+ return -1;
+ s->p = p;
+ s->a = a;
+ }
+ return 0;
+}
+
+void min_heap_shift_up_unconditional_(min_heap_t* s, unsigned hole_index, struct event* e)
+{
+ unsigned parent = (hole_index - 1) / 2;
+ do
+ {
+ (s->p[hole_index] = s->p[parent])->ev_timeout_pos.min_heap_idx = hole_index;
+ hole_index = parent;
+ parent = (hole_index - 1) / 2;
+ } while (hole_index && min_heap_elem_greater(s->p[parent], e));
+ (s->p[hole_index] = e)->ev_timeout_pos.min_heap_idx = hole_index;
+}
+
+void min_heap_shift_up_(min_heap_t* s, unsigned hole_index, struct event* e)
+{
+ unsigned parent = (hole_index - 1) / 2;
+ while (hole_index && min_heap_elem_greater(s->p[parent], e))
+ {
+ (s->p[hole_index] = s->p[parent])->ev_timeout_pos.min_heap_idx = hole_index;
+ hole_index = parent;
+ parent = (hole_index - 1) / 2;
+ }
+ (s->p[hole_index] = e)->ev_timeout_pos.min_heap_idx = hole_index;
+}
+
+void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e)
+{
+ unsigned min_child = 2 * (hole_index + 1);
+ while (min_child <= s->n)
+ {
+ min_child -= min_child == s->n || min_heap_elem_greater(s->p[min_child], s->p[min_child - 1]);
+ if (!(min_heap_elem_greater(e, s->p[min_child])))
+ break;
+ (s->p[hole_index] = s->p[min_child])->ev_timeout_pos.min_heap_idx = hole_index;
+ hole_index = min_child;
+ min_child = 2 * (hole_index + 1);
+ }
+ (s->p[hole_index] = e)->ev_timeout_pos.min_heap_idx = hole_index;
+}
+
+#endif /* MINHEAP_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/mm-internal.h b/sntp/libevent/mm-internal.h
new file mode 100644
index 0000000..4ba6fce
--- /dev/null
+++ b/sntp/libevent/mm-internal.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef MM_INTERNAL_H_INCLUDED_
+#define MM_INTERNAL_H_INCLUDED_
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+/* Internal use only: Memory allocation functions. We give them nice short
+ * mm_names for our own use, but make sure that the symbols have longer names
+ * so they don't conflict with other libraries (like, say, libmm). */
+
+/** Allocate uninitialized memory.
+ *
+ * @return On success, return a pointer to sz newly allocated bytes.
+ * On failure, set errno to ENOMEM and return NULL.
+ * If the argument sz is 0, simply return NULL.
+ */
+void *event_mm_malloc_(size_t sz);
+
+/** Allocate memory initialized to zero.
+ *
+ * @return On success, return a pointer to (count * size) newly allocated
+ * bytes, initialized to zero.
+ * On failure, or if the product would result in an integer overflow,
+ * set errno to ENOMEM and return NULL.
+ * If either arguments are 0, simply return NULL.
+ */
+void *event_mm_calloc_(size_t count, size_t size);
+
+/** Duplicate a string.
+ *
+ * @return On success, return a pointer to a newly allocated duplicate
+ * of a string.
+ * Set errno to ENOMEM and return NULL if a memory allocation error
+ * occurs (or would occur) in the process.
+ * If the argument str is NULL, set errno to EINVAL and return NULL.
+ */
+char *event_mm_strdup_(const char *str);
+
+void *event_mm_realloc_(void *p, size_t sz);
+void event_mm_free_(void *p);
+#define mm_malloc(sz) event_mm_malloc_(sz)
+#define mm_calloc(count, size) event_mm_calloc_((count), (size))
+#define mm_strdup(s) event_mm_strdup_(s)
+#define mm_realloc(p, sz) event_mm_realloc_((p), (sz))
+#define mm_free(p) event_mm_free_(p)
+#else
+#define mm_malloc(sz) malloc(sz)
+#define mm_calloc(n, sz) calloc((n), (sz))
+#define mm_strdup(s) strdup(s)
+#define mm_realloc(p, sz) realloc((p), (sz))
+#define mm_free(p) free(p)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/poll.c b/sntp/libevent/poll.c
new file mode 100644
index 0000000..5147593
--- /dev/null
+++ b/sntp/libevent/poll.c
@@ -0,0 +1,341 @@
+/* $OpenBSD: poll.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_POLL
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <poll.h>
+#include <signal.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "time-internal.h"
+
+struct pollidx {
+ int idxplus1;
+};
+
+struct pollop {
+ int event_count; /* Highest number alloc */
+ int nfds; /* Highest number used */
+ int realloc_copy; /* True iff we must realloc
+ * event_set_copy */
+ struct pollfd *event_set;
+ struct pollfd *event_set_copy;
+};
+
+static void *poll_init(struct event_base *);
+static int poll_add(struct event_base *, int, short old, short events, void *idx);
+static int poll_del(struct event_base *, int, short old, short events, void *idx);
+static int poll_dispatch(struct event_base *, struct timeval *);
+static void poll_dealloc(struct event_base *);
+
+const struct eventop pollops = {
+ "poll",
+ poll_init,
+ poll_add,
+ poll_del,
+ poll_dispatch,
+ poll_dealloc,
+ 0, /* doesn't need_reinit */
+ EV_FEATURE_FDS,
+ sizeof(struct pollidx),
+};
+
+static void *
+poll_init(struct event_base *base)
+{
+ struct pollop *pollop;
+
+ if (!(pollop = mm_calloc(1, sizeof(struct pollop))))
+ return (NULL);
+
+ evsig_init_(base);
+
+ evutil_weakrand_seed_(&base->weakrand_seed, 0);
+
+ return (pollop);
+}
+
+#ifdef CHECK_INVARIANTS
+static void
+poll_check_ok(struct pollop *pop)
+{
+ int i, idx;
+ struct event *ev;
+
+ for (i = 0; i < pop->fd_count; ++i) {
+ idx = pop->idxplus1_by_fd[i]-1;
+ if (idx < 0)
+ continue;
+ EVUTIL_ASSERT(pop->event_set[idx].fd == i);
+ }
+ for (i = 0; i < pop->nfds; ++i) {
+ struct pollfd *pfd = &pop->event_set[i];
+ EVUTIL_ASSERT(pop->idxplus1_by_fd[pfd->fd] == i+1);
+ }
+}
+#else
+#define poll_check_ok(pop)
+#endif
+
+static int
+poll_dispatch(struct event_base *base, struct timeval *tv)
+{
+ int res, i, j, nfds;
+ long msec = -1;
+ struct pollop *pop = base->evbase;
+ struct pollfd *event_set;
+
+ poll_check_ok(pop);
+
+ nfds = pop->nfds;
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (base->th_base_lock) {
+ /* If we're using this backend in a multithreaded setting,
+ * then we need to work on a copy of event_set, so that we can
+ * let other threads modify the main event_set while we're
+ * polling. If we're not multithreaded, then we'll skip the
+ * copy step here to save memory and time. */
+ if (pop->realloc_copy) {
+ struct pollfd *tmp = mm_realloc(pop->event_set_copy,
+ pop->event_count * sizeof(struct pollfd));
+ if (tmp == NULL) {
+ event_warn("realloc");
+ return -1;
+ }
+ pop->event_set_copy = tmp;
+ pop->realloc_copy = 0;
+ }
+ memcpy(pop->event_set_copy, pop->event_set,
+ sizeof(struct pollfd)*nfds);
+ event_set = pop->event_set_copy;
+ } else {
+ event_set = pop->event_set;
+ }
+#else
+ event_set = pop->event_set;
+#endif
+
+ if (tv != NULL) {
+ msec = evutil_tv_to_msec_(tv);
+ if (msec < 0 || msec > INT_MAX)
+ msec = INT_MAX;
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = poll(event_set, nfds, msec);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("poll");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: poll reports %d", __func__, res));
+
+ if (res == 0 || nfds == 0)
+ return (0);
+
+ i = evutil_weakrand_range_(&base->weakrand_seed, nfds);
+ for (j = 0; j < nfds; j++) {
+ int what;
+ if (++i == nfds)
+ i = 0;
+ what = event_set[i].revents;
+ if (!what)
+ continue;
+
+ res = 0;
+
+ /* If the file gets closed notify */
+ if (what & (POLLHUP|POLLERR))
+ what |= POLLIN|POLLOUT;
+ if (what & POLLIN)
+ res |= EV_READ;
+ if (what & POLLOUT)
+ res |= EV_WRITE;
+ if (res == 0)
+ continue;
+
+ evmap_io_active_(base, event_set[i].fd, res);
+ }
+
+ return (0);
+}
+
+static int
+poll_add(struct event_base *base, int fd, short old, short events, void *idx_)
+{
+ struct pollop *pop = base->evbase;
+ struct pollfd *pfd = NULL;
+ struct pollidx *idx = idx_;
+ int i;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ if (!(events & (EV_READ|EV_WRITE)))
+ return (0);
+
+ poll_check_ok(pop);
+ if (pop->nfds + 1 >= pop->event_count) {
+ struct pollfd *tmp_event_set;
+ int tmp_event_count;
+
+ if (pop->event_count < 32)
+ tmp_event_count = 32;
+ else
+ tmp_event_count = pop->event_count * 2;
+
+ /* We need more file descriptors */
+ tmp_event_set = mm_realloc(pop->event_set,
+ tmp_event_count * sizeof(struct pollfd));
+ if (tmp_event_set == NULL) {
+ event_warn("realloc");
+ return (-1);
+ }
+ pop->event_set = tmp_event_set;
+
+ pop->event_count = tmp_event_count;
+ pop->realloc_copy = 1;
+ }
+
+ i = idx->idxplus1 - 1;
+
+ if (i >= 0) {
+ pfd = &pop->event_set[i];
+ } else {
+ i = pop->nfds++;
+ pfd = &pop->event_set[i];
+ pfd->events = 0;
+ pfd->fd = fd;
+ idx->idxplus1 = i + 1;
+ }
+
+ pfd->revents = 0;
+ if (events & EV_WRITE)
+ pfd->events |= POLLOUT;
+ if (events & EV_READ)
+ pfd->events |= POLLIN;
+ poll_check_ok(pop);
+
+ return (0);
+}
+
+/*
+ * Nothing to be done here.
+ */
+
+static int
+poll_del(struct event_base *base, int fd, short old, short events, void *idx_)
+{
+ struct pollop *pop = base->evbase;
+ struct pollfd *pfd = NULL;
+ struct pollidx *idx = idx_;
+ int i;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ if (!(events & (EV_READ|EV_WRITE)))
+ return (0);
+
+ poll_check_ok(pop);
+ i = idx->idxplus1 - 1;
+ if (i < 0)
+ return (-1);
+
+ /* Do we still want to read or write? */
+ pfd = &pop->event_set[i];
+ if (events & EV_READ)
+ pfd->events &= ~POLLIN;
+ if (events & EV_WRITE)
+ pfd->events &= ~POLLOUT;
+ poll_check_ok(pop);
+ if (pfd->events)
+ /* Another event cares about that fd. */
+ return (0);
+
+ /* Okay, so we aren't interested in that fd anymore. */
+ idx->idxplus1 = 0;
+
+ --pop->nfds;
+ if (i != pop->nfds) {
+ /*
+ * Shift the last pollfd down into the now-unoccupied
+ * position.
+ */
+ memcpy(&pop->event_set[i], &pop->event_set[pop->nfds],
+ sizeof(struct pollfd));
+ idx = evmap_io_get_fdinfo_(&base->io, pop->event_set[i].fd);
+ EVUTIL_ASSERT(idx);
+ EVUTIL_ASSERT(idx->idxplus1 == pop->nfds + 1);
+ idx->idxplus1 = i + 1;
+ }
+
+ poll_check_ok(pop);
+ return (0);
+}
+
+static void
+poll_dealloc(struct event_base *base)
+{
+ struct pollop *pop = base->evbase;
+
+ evsig_dealloc_(base);
+ if (pop->event_set)
+ mm_free(pop->event_set);
+ if (pop->event_set_copy)
+ mm_free(pop->event_set_copy);
+
+ memset(pop, 0, sizeof(struct pollop));
+ mm_free(pop);
+}
+
+#endif /* EVENT__HAVE_POLL */
diff --git a/sntp/libevent/ratelim-internal.h b/sntp/libevent/ratelim-internal.h
new file mode 100644
index 0000000..6cc1cdd
--- /dev/null
+++ b/sntp/libevent/ratelim-internal.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef RATELIM_INTERNAL_H_INCLUDED_
+#define RATELIM_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/util.h"
+
+/** A token bucket is an internal structure that tracks how many bytes we are
+ * currently willing to read or write on a given bufferevent or group of
+ * bufferevents */
+struct ev_token_bucket {
+ /** How many bytes are we willing to read or write right now? These
+ * values are signed so that we can do "defecit spending" */
+ ev_ssize_t read_limit, write_limit;
+ /** When was this bucket last updated? Measured in abstract 'ticks'
+ * relative to the token bucket configuration. */
+ ev_uint32_t last_updated;
+};
+
+/** Configuration info for a token bucket or set of token buckets. */
+struct ev_token_bucket_cfg {
+ /** How many bytes are we willing to read on average per tick? */
+ size_t read_rate;
+ /** How many bytes are we willing to read at most in any one tick? */
+ size_t read_maximum;
+ /** How many bytes are we willing to write on average per tick? */
+ size_t write_rate;
+ /** How many bytes are we willing to write at most in any one tick? */
+ size_t write_maximum;
+
+ /* How long is a tick? Note that fractions of a millisecond are
+ * ignored. */
+ struct timeval tick_timeout;
+
+ /* How long is a tick, in milliseconds? Derived from tick_timeout. */
+ unsigned msec_per_tick;
+};
+
+/** The current tick is 'current_tick': add bytes to 'bucket' as specified in
+ * 'cfg'. */
+int ev_token_bucket_update_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick);
+
+/** In which tick does 'tv' fall according to 'cfg'? Note that ticks can
+ * overflow easily; your code needs to handle this. */
+ev_uint32_t ev_token_bucket_get_tick_(const struct timeval *tv,
+ const struct ev_token_bucket_cfg *cfg);
+
+/** Adjust 'bucket' to respect 'cfg', and note that it was last updated in
+ * 'current_tick'. If 'reinitialize' is true, we are changing the
+ * configuration of 'bucket'; otherwise, we are setting it up for the first
+ * time.
+ */
+int ev_token_bucket_init_(struct ev_token_bucket *bucket,
+ const struct ev_token_bucket_cfg *cfg,
+ ev_uint32_t current_tick,
+ int reinitialize);
+
+int bufferevent_remove_from_rate_limit_group_internal_(struct bufferevent *bev,
+ int unsuspend);
+
+/** Decrease the read limit of 'b' by 'n' bytes */
+#define ev_token_bucket_decrement_read(b,n) \
+ do { \
+ (b)->read_limit -= (n); \
+ } while (0)
+/** Decrease the write limit of 'b' by 'n' bytes */
+#define ev_token_bucket_decrement_write(b,n) \
+ do { \
+ (b)->write_limit -= (n); \
+ } while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/sample/dns-example.c b/sntp/libevent/sample/dns-example.c
new file mode 100644
index 0000000..15e48ce
--- /dev/null
+++ b/sntp/libevent/sample/dns-example.c
@@ -0,0 +1,248 @@
+/*
+ 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/sntp/libevent/sample/event-read-fifo.c b/sntp/libevent/sample/event-read-fifo.c
new file mode 100644
index 0000000..27b0b53
--- /dev/null
+++ b/sntp/libevent/sample/event-read-fifo.c
@@ -0,0 +1,162 @@
+/*
+ * 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/sntp/libevent/sample/hello-world.c b/sntp/libevent/sample/hello-world.c
new file mode 100644
index 0000000..d3cf058
--- /dev/null
+++ b/sntp/libevent/sample/hello-world.c
@@ -0,0 +1,141 @@
+/*
+ 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/sntp/libevent/sample/hostcheck.c b/sntp/libevent/sample/hostcheck.c
new file mode 100644
index 0000000..5070936
--- /dev/null
+++ b/sntp/libevent/sample/hostcheck.c
@@ -0,0 +1,217 @@
+/***************************************************************************
+ * _ _ ____ _
+ * 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/sntp/libevent/sample/hostcheck.h b/sntp/libevent/sample/hostcheck.h
new file mode 100644
index 0000000..f40bc43
--- /dev/null
+++ b/sntp/libevent/sample/hostcheck.h
@@ -0,0 +1,30 @@
+#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/sntp/libevent/sample/http-server.c b/sntp/libevent/sample/http-server.c
new file mode 100644
index 0000000..1cb89bc
--- /dev/null
+++ b/sntp/libevent/sample/http-server.c
@@ -0,0 +1,415 @@
+/*
+ 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, "<html>\n <head>\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
+ CloseHandle(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/sntp/libevent/sample/https-client.c b/sntp/libevent/sample/https-client.c
new file mode 100644
index 0000000..e13ac4b
--- /dev/null
+++ b/sntp/libevent/sample/https-client.c
@@ -0,0 +1,426 @@
+/*
+ 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]\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;
+
+ 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("-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()");
+ }
+
+ // Set hostname for SNI extension
+ SSL_set_tlsext_host_name(ssl, host);
+
+ 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;
+ }
+
+ // 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", 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/sntp/libevent/sample/include.am b/sntp/libevent/sample/include.am
new file mode 100644
index 0000000..81980ac
--- /dev/null
+++ b/sntp/libevent/sample/include.am
@@ -0,0 +1,51 @@
+# 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
+
+noinst_PROGRAMS += $(SAMPLES)
+
+$(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/sntp/libevent/sample/le-proxy.c b/sntp/libevent/sample/le-proxy.c
new file mode 100644
index 0000000..30e0a5f
--- /dev/null
+++ b/sntp/libevent/sample/le-proxy.c
@@ -0,0 +1,288 @@
+/*
+ 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/sntp/libevent/sample/openssl_hostname_validation.c b/sntp/libevent/sample/openssl_hostname_validation.c
new file mode 100644
index 0000000..b5adc67
--- /dev/null
+++ b/sntp/libevent/sample/openssl_hostname_validation.c
@@ -0,0 +1,172 @@
+/* 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/sntp/libevent/sample/openssl_hostname_validation.h b/sntp/libevent/sample/openssl_hostname_validation.h
new file mode 100644
index 0000000..54aa1c4
--- /dev/null
+++ b/sntp/libevent/sample/openssl_hostname_validation.h
@@ -0,0 +1,56 @@
+/* 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/sntp/libevent/sample/signal-test.c b/sntp/libevent/sample/signal-test.c
new file mode 100644
index 0000000..a61642f
--- /dev/null
+++ b/sntp/libevent/sample/signal-test.c
@@ -0,0 +1,75 @@
+/*
+ * 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/sntp/libevent/sample/time-test.c b/sntp/libevent/sample/time-test.c
new file mode 100644
index 0000000..c94c18a
--- /dev/null
+++ b/sntp/libevent/sample/time-test.c
@@ -0,0 +1,107 @@
+/*
+ * 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/sntp/libevent/select.c b/sntp/libevent/select.c
new file mode 100644
index 0000000..8ae53cc
--- /dev/null
+++ b/sntp/libevent/select.c
@@ -0,0 +1,346 @@
+/* $OpenBSD: select.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_SELECT
+
+#ifdef __APPLE__
+/* Apple wants us to define this if we might ever pass more than
+ * FD_SETSIZE bits to select(). */
+#define _DARWIN_UNLIMITED_SELECT
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <sys/queue.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "event-internal.h"
+#include "evsignal-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+
+#ifndef EVENT__HAVE_FD_MASK
+/* This type is mandatory, but Android doesn't define it. */
+typedef unsigned long fd_mask;
+#endif
+
+#ifndef NFDBITS
+#define NFDBITS (sizeof(fd_mask)*8)
+#endif
+
+/* Divide positive x by y, rounding up. */
+#define DIV_ROUNDUP(x, y) (((x)+((y)-1))/(y))
+
+/* How many bytes to allocate for N fds? */
+#define SELECT_ALLOC_SIZE(n) \
+ (DIV_ROUNDUP(n, NFDBITS) * sizeof(fd_mask))
+
+struct selectop {
+ int event_fds; /* Highest fd in fd set */
+ int event_fdsz;
+ int resize_out_sets;
+ fd_set *event_readset_in;
+ fd_set *event_writeset_in;
+ fd_set *event_readset_out;
+ fd_set *event_writeset_out;
+};
+
+static void *select_init(struct event_base *);
+static int select_add(struct event_base *, int, short old, short events, void*);
+static int select_del(struct event_base *, int, short old, short events, void*);
+static int select_dispatch(struct event_base *, struct timeval *);
+static void select_dealloc(struct event_base *);
+
+const struct eventop selectops = {
+ "select",
+ select_init,
+ select_add,
+ select_del,
+ select_dispatch,
+ select_dealloc,
+ 0, /* doesn't need reinit. */
+ EV_FEATURE_FDS,
+ 0,
+};
+
+static int select_resize(struct selectop *sop, int fdsz);
+static void select_free_selectop(struct selectop *sop);
+
+static void *
+select_init(struct event_base *base)
+{
+ struct selectop *sop;
+
+ if (!(sop = mm_calloc(1, sizeof(struct selectop))))
+ return (NULL);
+
+ if (select_resize(sop, SELECT_ALLOC_SIZE(32 + 1))) {
+ select_free_selectop(sop);
+ return (NULL);
+ }
+
+ evsig_init_(base);
+
+ evutil_weakrand_seed_(&base->weakrand_seed, 0);
+
+ return (sop);
+}
+
+#ifdef CHECK_INVARIANTS
+static void
+check_selectop(struct selectop *sop)
+{
+ /* nothing to be done here */
+}
+#else
+#define check_selectop(sop) do { (void) sop; } while (0)
+#endif
+
+static int
+select_dispatch(struct event_base *base, struct timeval *tv)
+{
+ int res=0, i, j, nfds;
+ struct selectop *sop = base->evbase;
+
+ check_selectop(sop);
+ if (sop->resize_out_sets) {
+ fd_set *readset_out=NULL, *writeset_out=NULL;
+ size_t sz = sop->event_fdsz;
+ if (!(readset_out = mm_realloc(sop->event_readset_out, sz)))
+ return (-1);
+ sop->event_readset_out = readset_out;
+ if (!(writeset_out = mm_realloc(sop->event_writeset_out, sz))) {
+ /* We don't free readset_out here, since it was
+ * already successfully reallocated. The next time
+ * we call select_dispatch, the realloc will be a
+ * no-op. */
+ return (-1);
+ }
+ sop->event_writeset_out = writeset_out;
+ sop->resize_out_sets = 0;
+ }
+
+ memcpy(sop->event_readset_out, sop->event_readset_in,
+ sop->event_fdsz);
+ memcpy(sop->event_writeset_out, sop->event_writeset_in,
+ sop->event_fdsz);
+
+ nfds = sop->event_fds+1;
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = select(nfds, sop->event_readset_out,
+ sop->event_writeset_out, NULL, tv);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ check_selectop(sop);
+
+ if (res == -1) {
+ if (errno != EINTR) {
+ event_warn("select");
+ return (-1);
+ }
+
+ return (0);
+ }
+
+ event_debug(("%s: select reports %d", __func__, res));
+
+ check_selectop(sop);
+ i = evutil_weakrand_range_(&base->weakrand_seed, nfds);
+ for (j = 0; j < nfds; ++j) {
+ if (++i >= nfds)
+ i = 0;
+ res = 0;
+ if (FD_ISSET(i, sop->event_readset_out))
+ res |= EV_READ;
+ if (FD_ISSET(i, sop->event_writeset_out))
+ res |= EV_WRITE;
+
+ if (res == 0)
+ continue;
+
+ evmap_io_active_(base, i, res);
+ }
+ check_selectop(sop);
+
+ return (0);
+}
+
+static int
+select_resize(struct selectop *sop, int fdsz)
+{
+ fd_set *readset_in = NULL;
+ fd_set *writeset_in = NULL;
+
+ if (sop->event_readset_in)
+ check_selectop(sop);
+
+ if ((readset_in = mm_realloc(sop->event_readset_in, fdsz)) == NULL)
+ goto error;
+ sop->event_readset_in = readset_in;
+ if ((writeset_in = mm_realloc(sop->event_writeset_in, fdsz)) == NULL) {
+ /* Note that this will leave event_readset_in expanded.
+ * That's okay; we wouldn't want to free it, since that would
+ * change the semantics of select_resize from "expand the
+ * readset_in and writeset_in, or return -1" to "expand the
+ * *set_in members, or trash them and return -1."
+ */
+ goto error;
+ }
+ sop->event_writeset_in = writeset_in;
+ sop->resize_out_sets = 1;
+
+ memset((char *)sop->event_readset_in + sop->event_fdsz, 0,
+ fdsz - sop->event_fdsz);
+ memset((char *)sop->event_writeset_in + sop->event_fdsz, 0,
+ fdsz - sop->event_fdsz);
+
+ sop->event_fdsz = fdsz;
+ check_selectop(sop);
+
+ return (0);
+
+ error:
+ event_warn("malloc");
+ return (-1);
+}
+
+
+static int
+select_add(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct selectop *sop = base->evbase;
+ (void) p;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ check_selectop(sop);
+ /*
+ * Keep track of the highest fd, so that we can calculate the size
+ * of the fd_sets for select(2)
+ */
+ if (sop->event_fds < fd) {
+ int fdsz = sop->event_fdsz;
+
+ if (fdsz < (int)sizeof(fd_mask))
+ fdsz = (int)sizeof(fd_mask);
+
+ /* In theory we should worry about overflow here. In
+ * reality, though, the highest fd on a unixy system will
+ * not overflow here. XXXX */
+ while (fdsz < (int) SELECT_ALLOC_SIZE(fd + 1))
+ fdsz *= 2;
+
+ if (fdsz != sop->event_fdsz) {
+ if (select_resize(sop, fdsz)) {
+ check_selectop(sop);
+ return (-1);
+ }
+ }
+
+ sop->event_fds = fd;
+ }
+
+ if (events & EV_READ)
+ FD_SET(fd, sop->event_readset_in);
+ if (events & EV_WRITE)
+ FD_SET(fd, sop->event_writeset_in);
+ check_selectop(sop);
+
+ return (0);
+}
+
+/*
+ * Nothing to be done here.
+ */
+
+static int
+select_del(struct event_base *base, int fd, short old, short events, void *p)
+{
+ struct selectop *sop = base->evbase;
+ (void)p;
+
+ EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
+ check_selectop(sop);
+
+ if (sop->event_fds < fd) {
+ check_selectop(sop);
+ return (0);
+ }
+
+ if (events & EV_READ)
+ FD_CLR(fd, sop->event_readset_in);
+
+ if (events & EV_WRITE)
+ FD_CLR(fd, sop->event_writeset_in);
+
+ check_selectop(sop);
+ return (0);
+}
+
+static void
+select_free_selectop(struct selectop *sop)
+{
+ if (sop->event_readset_in)
+ mm_free(sop->event_readset_in);
+ if (sop->event_writeset_in)
+ mm_free(sop->event_writeset_in);
+ if (sop->event_readset_out)
+ mm_free(sop->event_readset_out);
+ if (sop->event_writeset_out)
+ mm_free(sop->event_writeset_out);
+
+ memset(sop, 0, sizeof(struct selectop));
+ mm_free(sop);
+}
+
+static void
+select_dealloc(struct event_base *base)
+{
+ evsig_dealloc_(base);
+
+ select_free_selectop(base->evbase);
+}
+
+#endif /* EVENT__HAVE_SELECT */
diff --git a/sntp/libevent/signal.c b/sntp/libevent/signal.c
new file mode 100644
index 0000000..3f46295
--- /dev/null
+++ b/sntp/libevent/signal.c
@@ -0,0 +1,479 @@
+/* $OpenBSD: select.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#endif
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+#ifdef EVENT__HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event-internal.h"
+#include "event2/util.h"
+#include "evsignal-internal.h"
+#include "log-internal.h"
+#include "evmap-internal.h"
+#include "evthread-internal.h"
+
+/*
+ signal.c
+
+ This is the signal-handling implementation we use for backends that don't
+ have a better way to do signal handling. It uses sigaction() or signal()
+ to set a signal handler, and a socket pair to tell the event base when
+
+ Note that I said "the event base" : only one event base can be set up to use
+ this at a time. For historical reasons and backward compatibility, if you
+ add an event for a signal to event_base A, then add an event for a signal
+ (any signal!) to event_base B, event_base B will get informed about the
+ signal, but event_base A won't.
+
+ It would be neat to change this behavior in some future version of Libevent.
+ kqueue already does something far more sensible. We can make all backends
+ on Linux do a reasonable thing using signalfd.
+*/
+
+#ifndef _WIN32
+/* Windows wants us to call our signal handlers as __cdecl. Nobody else
+ * expects you to do anything crazy like this. */
+#define __cdecl
+#endif
+
+static int evsig_add(struct event_base *, evutil_socket_t, short, short, void *);
+static int evsig_del(struct event_base *, evutil_socket_t, short, short, void *);
+
+static const struct eventop evsigops = {
+ "signal",
+ NULL,
+ evsig_add,
+ evsig_del,
+ NULL,
+ NULL,
+ 0, 0, 0
+};
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+/* Lock for evsig_base and evsig_base_n_signals_added fields. */
+static void *evsig_base_lock = NULL;
+#endif
+/* The event base that's currently getting informed about signals. */
+static struct event_base *evsig_base = NULL;
+/* A copy of evsig_base->sigev_n_signals_added. */
+static int evsig_base_n_signals_added = 0;
+static evutil_socket_t evsig_base_fd = -1;
+
+static void __cdecl evsig_handler(int sig);
+
+#define EVSIGBASE_LOCK() EVLOCK_LOCK(evsig_base_lock, 0)
+#define EVSIGBASE_UNLOCK() EVLOCK_UNLOCK(evsig_base_lock, 0)
+
+void
+evsig_set_base_(struct event_base *base)
+{
+ EVSIGBASE_LOCK();
+ evsig_base = base;
+ evsig_base_n_signals_added = base->sig.ev_n_signals_added;
+ evsig_base_fd = base->sig.ev_signal_pair[1];
+ EVSIGBASE_UNLOCK();
+}
+
+/* Callback for when the signal handler write a byte to our signaling socket */
+static void
+evsig_cb(evutil_socket_t fd, short what, void *arg)
+{
+ static char signals[1024];
+ ev_ssize_t n;
+ int i;
+ int ncaught[NSIG];
+ struct event_base *base;
+
+ base = arg;
+
+ memset(&ncaught, 0, sizeof(ncaught));
+
+ while (1) {
+#ifdef _WIN32
+ n = recv(fd, signals, sizeof(signals), 0);
+#else
+ n = read(fd, signals, sizeof(signals));
+#endif
+ if (n == -1) {
+ int err = evutil_socket_geterror(fd);
+ if (! EVUTIL_ERR_RW_RETRIABLE(err))
+ event_sock_err(1, fd, "%s: recv", __func__);
+ break;
+ } else if (n == 0) {
+ /* XXX warn? */
+ break;
+ }
+ for (i = 0; i < n; ++i) {
+ ev_uint8_t sig = signals[i];
+ if (sig < NSIG)
+ ncaught[sig]++;
+ }
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ for (i = 0; i < NSIG; ++i) {
+ if (ncaught[i])
+ evmap_signal_active_(base, i, ncaught[i]);
+ }
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+}
+
+int
+evsig_init_(struct event_base *base)
+{
+ /*
+ * Our signal handler is going to write to one end of the socket
+ * pair to wake up our event loop. The event loop then scans for
+ * signals that got delivered.
+ */
+ if (evutil_make_internal_pipe_(base->sig.ev_signal_pair) == -1) {
+#ifdef _WIN32
+ /* Make this nonfatal on win32, where sometimes people
+ have localhost firewalled. */
+ event_sock_warn(-1, "%s: socketpair", __func__);
+#else
+ event_sock_err(1, -1, "%s: socketpair", __func__);
+#endif
+ return -1;
+ }
+
+ if (base->sig.sh_old) {
+ mm_free(base->sig.sh_old);
+ }
+ base->sig.sh_old = NULL;
+ base->sig.sh_old_max = 0;
+
+ event_assign(&base->sig.ev_signal, base, base->sig.ev_signal_pair[0],
+ EV_READ | EV_PERSIST, evsig_cb, base);
+
+ base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
+ event_priority_set(&base->sig.ev_signal, 0);
+
+ base->evsigsel = &evsigops;
+
+ return 0;
+}
+
+/* Helper: set the signal handler for evsignal to handler in base, so that
+ * we can restore the original handler when we clear the current one. */
+int
+evsig_set_handler_(struct event_base *base,
+ int evsignal, void (__cdecl *handler)(int))
+{
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction sa;
+#else
+ ev_sighandler_t sh;
+#endif
+ struct evsig_info *sig = &base->sig;
+ void *p;
+
+ /*
+ * resize saved signal handler array up to the highest signal number.
+ * a dynamic array is used to keep footprint on the low side.
+ */
+ if (evsignal >= sig->sh_old_max) {
+ int new_max = evsignal + 1;
+ event_debug(("%s: evsignal (%d) >= sh_old_max (%d), resizing",
+ __func__, evsignal, sig->sh_old_max));
+ p = mm_realloc(sig->sh_old, new_max * sizeof(*sig->sh_old));
+ if (p == NULL) {
+ event_warn("realloc");
+ return (-1);
+ }
+
+ memset((char *)p + sig->sh_old_max * sizeof(*sig->sh_old),
+ 0, (new_max - sig->sh_old_max) * sizeof(*sig->sh_old));
+
+ sig->sh_old_max = new_max;
+ sig->sh_old = p;
+ }
+
+ /* allocate space for previous handler out of dynamic array */
+ sig->sh_old[evsignal] = mm_malloc(sizeof *sig->sh_old[evsignal]);
+ if (sig->sh_old[evsignal] == NULL) {
+ event_warn("malloc");
+ return (-1);
+ }
+
+ /* save previous handler and setup new handler */
+#ifdef EVENT__HAVE_SIGACTION
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = handler;
+ sa.sa_flags |= SA_RESTART;
+ sigfillset(&sa.sa_mask);
+
+ if (sigaction(evsignal, &sa, sig->sh_old[evsignal]) == -1) {
+ event_warn("sigaction");
+ mm_free(sig->sh_old[evsignal]);
+ sig->sh_old[evsignal] = NULL;
+ return (-1);
+ }
+#else
+ if ((sh = signal(evsignal, handler)) == SIG_ERR) {
+ event_warn("signal");
+ mm_free(sig->sh_old[evsignal]);
+ sig->sh_old[evsignal] = NULL;
+ return (-1);
+ }
+ *sig->sh_old[evsignal] = sh;
+#endif
+
+ return (0);
+}
+
+static int
+evsig_add(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p)
+{
+ struct evsig_info *sig = &base->sig;
+ (void)p;
+
+ EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG);
+
+ /* catch signals if they happen quickly */
+ EVSIGBASE_LOCK();
+ if (evsig_base != base && evsig_base_n_signals_added) {
+ event_warnx("Added a signal to event base %p with signals "
+ "already added to event_base %p. Only one can have "
+ "signals at a time with the %s backend. The base with "
+ "the most recently added signal or the most recent "
+ "event_base_loop() call gets preference; do "
+ "not rely on this behavior in future Libevent versions.",
+ base, evsig_base, base->evsel->name);
+ }
+ evsig_base = base;
+ evsig_base_n_signals_added = ++sig->ev_n_signals_added;
+ evsig_base_fd = base->sig.ev_signal_pair[1];
+ EVSIGBASE_UNLOCK();
+
+ event_debug(("%s: %d: changing signal handler", __func__, (int)evsignal));
+ if (evsig_set_handler_(base, (int)evsignal, evsig_handler) == -1) {
+ goto err;
+ }
+
+
+ if (!sig->ev_signal_added) {
+ if (event_add_nolock_(&sig->ev_signal, NULL, 0))
+ goto err;
+ sig->ev_signal_added = 1;
+ }
+
+ return (0);
+
+err:
+ EVSIGBASE_LOCK();
+ --evsig_base_n_signals_added;
+ --sig->ev_n_signals_added;
+ EVSIGBASE_UNLOCK();
+ return (-1);
+}
+
+int
+evsig_restore_handler_(struct event_base *base, int evsignal)
+{
+ int ret = 0;
+ struct evsig_info *sig = &base->sig;
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction *sh;
+#else
+ ev_sighandler_t *sh;
+#endif
+
+ if (evsignal >= sig->sh_old_max) {
+ /* Can't actually restore. */
+ /* XXXX.*/
+ return 0;
+ }
+
+ /* restore previous handler */
+ sh = sig->sh_old[evsignal];
+ sig->sh_old[evsignal] = NULL;
+#ifdef EVENT__HAVE_SIGACTION
+ if (sigaction(evsignal, sh, NULL) == -1) {
+ event_warn("sigaction");
+ ret = -1;
+ }
+#else
+ if (signal(evsignal, *sh) == SIG_ERR) {
+ event_warn("signal");
+ ret = -1;
+ }
+#endif
+
+ mm_free(sh);
+
+ return ret;
+}
+
+static int
+evsig_del(struct event_base *base, evutil_socket_t evsignal, short old, short events, void *p)
+{
+ EVUTIL_ASSERT(evsignal >= 0 && evsignal < NSIG);
+
+ event_debug(("%s: "EV_SOCK_FMT": restoring signal handler",
+ __func__, EV_SOCK_ARG(evsignal)));
+
+ EVSIGBASE_LOCK();
+ --evsig_base_n_signals_added;
+ --base->sig.ev_n_signals_added;
+ EVSIGBASE_UNLOCK();
+
+ return (evsig_restore_handler_(base, (int)evsignal));
+}
+
+static void __cdecl
+evsig_handler(int sig)
+{
+ int save_errno = errno;
+#ifdef _WIN32
+ int socket_errno = EVUTIL_SOCKET_ERROR();
+#endif
+ ev_uint8_t msg;
+
+ if (evsig_base == NULL) {
+ event_warnx(
+ "%s: received signal %d, but have no base configured",
+ __func__, sig);
+ return;
+ }
+
+#ifndef EVENT__HAVE_SIGACTION
+ signal(sig, evsig_handler);
+#endif
+
+ /* Wake up our notification mechanism */
+ msg = sig;
+#ifdef _WIN32
+ send(evsig_base_fd, (char*)&msg, 1, 0);
+#else
+ {
+ int r = write(evsig_base_fd, (char*)&msg, 1);
+ (void)r; /* Suppress 'unused return value' and 'unused var' */
+ }
+#endif
+ errno = save_errno;
+#ifdef _WIN32
+ EVUTIL_SET_SOCKET_ERROR(socket_errno);
+#endif
+}
+
+void
+evsig_dealloc_(struct event_base *base)
+{
+ int i = 0;
+ if (base->sig.ev_signal_added) {
+ event_del(&base->sig.ev_signal);
+ base->sig.ev_signal_added = 0;
+ }
+ /* debug event is created in evsig_init_/event_assign even when
+ * ev_signal_added == 0, so unassign is required */
+ event_debug_unassign(&base->sig.ev_signal);
+
+ for (i = 0; i < NSIG; ++i) {
+ if (i < base->sig.sh_old_max && base->sig.sh_old[i] != NULL)
+ evsig_restore_handler_(base, i);
+ }
+ EVSIGBASE_LOCK();
+ if (base == evsig_base) {
+ evsig_base = NULL;
+ evsig_base_n_signals_added = 0;
+ evsig_base_fd = -1;
+ }
+ EVSIGBASE_UNLOCK();
+
+ if (base->sig.ev_signal_pair[0] != -1) {
+ evutil_closesocket(base->sig.ev_signal_pair[0]);
+ base->sig.ev_signal_pair[0] = -1;
+ }
+ if (base->sig.ev_signal_pair[1] != -1) {
+ evutil_closesocket(base->sig.ev_signal_pair[1]);
+ base->sig.ev_signal_pair[1] = -1;
+ }
+ base->sig.sh_old_max = 0;
+
+ /* per index frees are handled in evsig_del() */
+ if (base->sig.sh_old) {
+ mm_free(base->sig.sh_old);
+ base->sig.sh_old = NULL;
+ }
+}
+
+static void
+evsig_free_globals_locks(void)
+{
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (evsig_base_lock != NULL) {
+ EVTHREAD_FREE_LOCK(evsig_base_lock, 0);
+ evsig_base_lock = NULL;
+ }
+#endif
+ return;
+}
+
+void
+evsig_free_globals_(void)
+{
+ evsig_free_globals_locks();
+}
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+int
+evsig_global_setup_locks_(const int enable_locks)
+{
+ EVTHREAD_SETUP_GLOBAL_LOCK(evsig_base_lock, 0);
+ return 0;
+}
+
+#endif
diff --git a/sntp/libevent/strlcpy-internal.h b/sntp/libevent/strlcpy-internal.h
new file mode 100644
index 0000000..cfc27ec
--- /dev/null
+++ b/sntp/libevent/strlcpy-internal.h
@@ -0,0 +1,22 @@
+#ifndef STRLCPY_INTERNAL_H_INCLUDED_
+#define STRLCPY_INTERNAL_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifndef EVENT__HAVE_STRLCPY
+#include <string.h>
+size_t event_strlcpy_(char *dst, const char *src, size_t siz);
+#define strlcpy event_strlcpy_
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/sntp/libevent/strlcpy.c b/sntp/libevent/strlcpy.c
new file mode 100644
index 0000000..3876475
--- /dev/null
+++ b/sntp/libevent/strlcpy.c
@@ -0,0 +1,75 @@
+/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <sys/types.h>
+
+#ifndef EVENT__HAVE_STRLCPY
+#include "strlcpy-internal.h"
+
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+event_strlcpy_(dst, src, siz)
+ char *dst;
+ const char *src;
+ size_t siz;
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0 && --n != 0) {
+ do {
+ if ((*d++ = *s++) == 0)
+ break;
+ } while (--n != 0);
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0) {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return (s - src - 1); /* count does not include NUL */
+}
+#endif
diff --git a/sntp/libevent/test/Makefile.nmake b/sntp/libevent/test/Makefile.nmake
new file mode 100644
index 0000000..30c3eb7
--- /dev/null
+++ b/sntp/libevent/test/Makefile.nmake
@@ -0,0 +1,79 @@
+# WATCH OUT! This makefile is a work in progress. -*- makefile -*-
+
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+SSL_OBJS=regress_ssl.obj
+SSL_LIBS=..\libevent_openssl.lib $(OPENSSL_DIR)\lib\libeay32.lib $(OPENSSL_DIR)\lib\ssleay32.lib gdi32.lib User32.lib
+!ELSE
+SSL_CFLAGS=
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+CFLAGS=/I.. /I../WIN32-Code /I../WIN32-Code/nmake /I../include /I../compat /DHAVE_CONFIG_H /DTINYTEST_LOCAL $(SSL_CFLAGS)
+
+CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
+
+REGRESS_OBJS=regress.obj regress_buffer.obj regress_http.obj regress_dns.obj \
+ regress_testutils.obj \
+ regress_rpc.obj regress.gen.obj \
+ regress_et.obj regress_bufferevent.obj \
+ regress_listener.obj regress_util.obj tinytest.obj \
+ regress_main.obj regress_minheap.obj regress_iocp.obj \
+ regress_thread.obj regress_finalize.obj $(SSL_OBJS)
+
+OTHER_OBJS=test-init.obj test-eof.obj test-closed.obj test-weof.obj test-time.obj \
+ bench.obj bench_cascade.obj bench_http.obj bench_httpclient.obj \
+ test-changelist.obj \
+ print-winsock-errors.obj
+
+PROGRAMS=regress.exe \
+ test-init.exe test-eof.exe test-closed.exe test-weof.exe test-time.exe \
+ test-changelist.exe \
+ print-winsock-errors.exe
+
+# Disabled for now:
+# bench.exe bench_cascade.exe bench_http.exe bench_httpclient.exe
+
+
+LIBS=..\libevent.lib ws2_32.lib shell32.lib advapi32.lib
+
+all: $(PROGRAMS)
+
+regress.exe: $(REGRESS_OBJS)
+ $(CC) $(CFLAGS) $(LIBS) $(SSL_LIBS) $(REGRESS_OBJS)
+
+test-init.exe: test-init.obj
+ $(CC) $(CFLAGS) $(LIBS) test-init.obj
+test-eof.exe: test-eof.obj
+ $(CC) $(CFLAGS) $(LIBS) test-eof.obj
+test-closed.exe: test-closed.obj
+ $(CC) $(CFLAGS) $(LIBS) test-closed.obj
+test-changelist.exe: test-changelist.obj
+ $(CC) $(CFLAGS) $(LIBS) test-changelist.obj
+test-weof.exe: test-weof.obj
+ $(CC) $(CFLAGS) $(LIBS) test-weof.obj
+test-time.exe: test-time.obj
+ $(CC) $(CFLAGS) $(LIBS) test-time.obj
+
+print-winsock-errors.exe: print-winsock-errors.obj
+ $(CC) $(CFLAGS) $(LIBS) print-winsock-errors.obj
+
+bench.exe: bench.obj
+ $(CC) $(CFLAGS) $(LIBS) bench.obj
+bench_cascade.exe: bench_cascade.obj
+ $(CC) $(CFLAGS) $(LIBS) bench_cascade.obj
+bench_http.exe: bench_http.obj
+ $(CC) $(CFLAGS) $(LIBS) bench_http.obj
+bench_httpclient.exe: bench_httpclient.obj
+ $(CC) $(CFLAGS) $(LIBS) bench_httpclient.obj
+
+regress.gen.c regress.gen.h: regress.rpc ../event_rpcgen.py
+ echo // > regress.gen.c
+ echo #define NO_PYTHON_EXISTS > regress.gen.h
+ -python ..\event_rpcgen.py regress.rpc
+
+clean:
+ -del $(REGRESS_OBJS)
+ -del $(OTHER_OBJS)
+ -del $(PROGRAMS)
diff --git a/sntp/libevent/test/bench.c b/sntp/libevent/test/bench.c
new file mode 100644
index 0000000..922a743
--- /dev/null
+++ b/sntp/libevent/test/bench.c
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * Mon 03/10/2003 - Modified by Davide Libenzi <davidel@xmailserver.org>
+ *
+ * Added chain event propagation to improve the sensitivity of
+ * the measure respect to the event loop efficency.
+ *
+ *
+ */
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#else
+#include <sys/socket.h>
+#include <signal.h>
+#include <sys/resource.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+#ifdef _WIN32
+#include <getopt.h>
+#endif
+
+#include <event.h>
+#include <evutil.h>
+
+static int count, writes, fired, failures;
+static evutil_socket_t *pipes;
+static int num_pipes, num_active, num_writes;
+static struct event *events;
+
+
+static void
+read_cb(evutil_socket_t fd, short which, void *arg)
+{
+ ev_intptr_t idx = (ev_intptr_t) arg, widx = idx + 1;
+ u_char ch;
+ ev_ssize_t n;
+
+ n = recv(fd, (char*)&ch, sizeof(ch), 0);
+ if (n >= 0)
+ count += n;
+ else
+ failures++;
+ if (writes) {
+ if (widx >= num_pipes)
+ widx -= num_pipes;
+ n = send(pipes[2 * widx + 1], "e", 1, 0);
+ if (n != 1)
+ failures++;
+ writes--;
+ fired++;
+ }
+}
+
+static struct timeval *
+run_once(void)
+{
+ evutil_socket_t *cp, space;
+ long i;
+ static struct timeval ts, te;
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ if (event_initialized(&events[i]))
+ event_del(&events[i]);
+ event_set(&events[i], cp[0], EV_READ | EV_PERSIST, read_cb, (void *)(ev_intptr_t) i);
+ event_add(&events[i], NULL);
+ }
+
+ event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
+
+ fired = 0;
+ space = num_pipes / num_active;
+ space = space * 2;
+ for (i = 0; i < num_active; i++, fired++)
+ (void) send(pipes[i * space + 1], "e", 1, 0);
+
+ count = 0;
+ writes = num_writes;
+ { int xcount = 0;
+ evutil_gettimeofday(&ts, NULL);
+ do {
+ event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
+ xcount++;
+ } while (count != fired);
+ evutil_gettimeofday(&te, NULL);
+
+ if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count);
+ }
+
+ evutil_timersub(&te, &ts, &te);
+
+ return (&te);
+}
+
+int
+main(int argc, char **argv)
+{
+#ifdef HAVE_SETRLIMIT
+ struct rlimit rl;
+#endif
+ int i, c;
+ struct timeval *tv;
+ evutil_socket_t *cp;
+
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#endif
+ num_pipes = 100;
+ num_active = 1;
+ num_writes = num_pipes;
+ while ((c = getopt(argc, argv, "n:a:w:")) != -1) {
+ switch (c) {
+ case 'n':
+ num_pipes = atoi(optarg);
+ break;
+ case 'a':
+ num_active = atoi(optarg);
+ break;
+ case 'w':
+ num_writes = atoi(optarg);
+ break;
+ default:
+ fprintf(stderr, "Illegal argument \"%c\"\n", c);
+ exit(1);
+ }
+ }
+
+#ifdef HAVE_SETRLIMIT
+ rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
+ if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
+ perror("setrlimit");
+ exit(1);
+ }
+#endif
+
+ events = calloc(num_pipes, sizeof(struct event));
+ pipes = calloc(num_pipes * 2, sizeof(evutil_socket_t));
+ if (events == NULL || pipes == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+
+ event_init();
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+#ifdef USE_PIPES
+ if (pipe(cp) == -1) {
+#else
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, cp) == -1) {
+#endif
+ perror("pipe");
+ exit(1);
+ }
+ }
+
+ for (i = 0; i < 25; i++) {
+ tv = run_once();
+ if (tv == NULL)
+ exit(1);
+ fprintf(stdout, "%ld\n",
+ tv->tv_sec * 1000000L + tv->tv_usec);
+ }
+
+ exit(0);
+}
diff --git a/sntp/libevent/test/bench_cascade.c b/sntp/libevent/test/bench_cascade.c
new file mode 100644
index 0000000..2d85cc1
--- /dev/null
+++ b/sntp/libevent/test/bench_cascade.c
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#else
+#include <sys/socket.h>
+#include <sys/resource.h>
+#endif
+#include <signal.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+#include <getopt.h>
+#include <event.h>
+#include <evutil.h>
+
+/*
+ * This benchmark tests how quickly we can propagate a write down a chain
+ * of socket pairs. We start by writing to the first socket pair and all
+ * events will fire subsequently until the last socket pair has been reached
+ * and the benchmark terminates.
+ */
+
+static int fired;
+static evutil_socket_t *pipes;
+static struct event *events;
+
+static void
+read_cb(evutil_socket_t fd, short which, void *arg)
+{
+ char ch;
+ evutil_socket_t sock = (evutil_socket_t)(ev_intptr_t)arg;
+
+ (void) recv(fd, &ch, sizeof(ch), 0);
+ if (sock >= 0) {
+ if (send(sock, "e", 1, 0) < 0)
+ perror("send");
+ }
+ fired++;
+}
+
+static struct timeval *
+run_once(int num_pipes)
+{
+ int i;
+ evutil_socket_t *cp;
+ static struct timeval ts, te, tv_timeout;
+
+ events = (struct event *)calloc(num_pipes, sizeof(struct event));
+ pipes = (evutil_socket_t *)calloc(num_pipes * 2, sizeof(evutil_socket_t));
+
+ if (events == NULL || pipes == NULL) {
+ perror("malloc");
+ exit(1);
+ }
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, cp) == -1) {
+ perror("socketpair");
+ exit(1);
+ }
+ }
+
+ /* measurements includes event setup */
+ evutil_gettimeofday(&ts, NULL);
+
+ /* provide a default timeout for events */
+ evutil_timerclear(&tv_timeout);
+ tv_timeout.tv_sec = 60;
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ evutil_socket_t fd = i < num_pipes - 1 ? cp[3] : -1;
+ event_set(&events[i], cp[0], EV_READ, read_cb,
+ (void *)(ev_intptr_t)fd);
+ event_add(&events[i], &tv_timeout);
+ }
+
+ fired = 0;
+
+ /* kick everything off with a single write */
+ if (send(pipes[1], "e", 1, 0) < 0)
+ perror("send");
+
+ event_dispatch();
+
+ evutil_gettimeofday(&te, NULL);
+ evutil_timersub(&te, &ts, &te);
+
+ for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
+ event_del(&events[i]);
+ evutil_closesocket(cp[0]);
+ evutil_closesocket(cp[1]);
+ }
+
+ free(pipes);
+ free(events);
+
+ return (&te);
+}
+
+int
+main(int argc, char **argv)
+{
+#ifdef HAVE_SETRLIMIT
+ struct rlimit rl;
+#endif
+ int i, c;
+ struct timeval *tv;
+
+ int num_pipes = 100;
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#endif
+
+ while ((c = getopt(argc, argv, "n:")) != -1) {
+ switch (c) {
+ case 'n':
+ num_pipes = atoi(optarg);
+ break;
+ default:
+ fprintf(stderr, "Illegal argument \"%c\"\n", c);
+ exit(1);
+ }
+ }
+
+#ifdef HAVE_SETRLIMIT
+ rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
+ if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
+ perror("setrlimit");
+ exit(1);
+ }
+#endif
+
+ event_init();
+
+ for (i = 0; i < 25; i++) {
+ tv = run_once(num_pipes);
+ if (tv == NULL)
+ exit(1);
+ fprintf(stdout, "%ld\n",
+ tv->tv_sec * 1000000L + tv->tv_usec);
+ }
+
+#ifdef _WIN32
+ WSACleanup();
+#endif
+
+ exit(0);
+}
diff --git a/sntp/libevent/test/bench_http.c b/sntp/libevent/test/bench_http.c
new file mode 100644
index 0000000..6d0d971
--- /dev/null
+++ b/sntp/libevent/test/bench_http.c
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/util.h"
+#include "event2/http.h"
+#include "event2/thread.h"
+
+static void http_basic_cb(struct evhttp_request *req, void *arg);
+
+static char *content;
+static size_t content_len = 0;
+
+static void
+http_basic_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+
+ evbuffer_add(evb, content, content_len);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+
+#if LIBEVENT_VERSION_NUMBER >= 0x02000200
+static void
+http_ref_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+
+ evbuffer_add_reference(evb, content, content_len, NULL, NULL);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct event_config *cfg = event_config_new();
+ struct event_base *base;
+ struct evhttp *http;
+ int i;
+ int c;
+ int use_iocp = 0;
+ unsigned short port = 8080;
+ char *endptr = NULL;
+
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#else
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return (1);
+#endif
+
+ for (i = 1; i < argc; ++i) {
+ if (*argv[i] != '-')
+ continue;
+
+ c = argv[i][1];
+
+ if ((c == 'p' || c == 'l') && i + 1 >= argc) {
+ fprintf(stderr, "-%c requires argument.\n", c);
+ exit(1);
+ }
+
+ switch (c) {
+ case 'p':
+ if (i+1 >= argc || !argv[i+1]) {
+ fprintf(stderr, "Missing port\n");
+ exit(1);
+ }
+ port = (int)strtol(argv[i+1], &endptr, 10);
+ if (*endptr != '\0') {
+ fprintf(stderr, "Bad port\n");
+ exit(1);
+ }
+ break;
+ case 'l':
+ if (i+1 >= argc || !argv[i+1]) {
+ fprintf(stderr, "Missing content length\n");
+ exit(1);
+ }
+ content_len = (size_t)strtol(argv[i+1], &endptr, 10);
+ if (*endptr != '\0' || content_len == 0) {
+ fprintf(stderr, "Bad content length\n");
+ exit(1);
+ }
+ break;
+#ifdef _WIN32
+ case 'i':
+ use_iocp = 1;
+ evthread_use_windows_threads();
+ event_config_set_flag(cfg,EVENT_BASE_FLAG_STARTUP_IOCP);
+ break;
+#endif
+ default:
+ fprintf(stderr, "Illegal argument \"%c\"\n", c);
+ exit(1);
+ }
+ }
+
+ base = event_base_new_with_config(cfg);
+ if (!base) {
+ fprintf(stderr, "creating event_base failed. Exiting.\n");
+ return 1;
+ }
+
+ http = evhttp_new(base);
+
+ content = malloc(content_len);
+ if (content == NULL) {
+ fprintf(stderr, "Cannot allocate content\n");
+ exit(1);
+ } else {
+ int i = 0;
+ for (i = 0; i < (int)content_len; ++i)
+ content[i] = (i & 255);
+ }
+
+ evhttp_set_cb(http, "/ind", http_basic_cb, NULL);
+ fprintf(stderr, "/ind - basic content (memory copy)\n");
+
+ evhttp_set_cb(http, "/ref", http_ref_cb, NULL);
+ fprintf(stderr, "/ref - basic content (reference)\n");
+
+ fprintf(stderr, "Serving %d bytes on port %d using %s\n",
+ (int)content_len, port,
+ use_iocp? "IOCP" : event_base_get_method(base));
+
+ evhttp_bind_socket(http, "0.0.0.0", port);
+
+#ifdef _WIN32
+ if (use_iocp) {
+ struct timeval tv={99999999,0};
+ event_base_loopexit(base, &tv);
+ }
+#endif
+ event_base_dispatch(base);
+
+#ifdef _WIN32
+ WSACleanup();
+#endif
+
+ /* NOTREACHED */
+ return (0);
+}
diff --git a/sntp/libevent/test/bench_httpclient.c b/sntp/libevent/test/bench_httpclient.c
new file mode 100644
index 0000000..22f174d
--- /dev/null
+++ b/sntp/libevent/test/bench_httpclient.c
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/* for EVUTIL_ERR_CONNECT_RETRIABLE macro */
+#include "util-internal.h"
+
+#include <sys/types.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/util.h"
+
+const char *resource = NULL;
+struct event_base *base = NULL;
+
+int total_n_handled = 0;
+int total_n_errors = 0;
+int total_n_launched = 0;
+size_t total_n_bytes = 0;
+struct timeval total_time = {0,0};
+int n_errors = 0;
+
+const int PARALLELISM = 200;
+const int N_REQUESTS = 20000;
+
+struct request_info {
+ size_t n_read;
+ struct timeval started;
+};
+
+static int launch_request(void);
+static void readcb(struct bufferevent *b, void *arg);
+static void errorcb(struct bufferevent *b, short what, void *arg);
+
+static void
+readcb(struct bufferevent *b, void *arg)
+{
+ struct request_info *ri = arg;
+ struct evbuffer *input = bufferevent_get_input(b);
+ size_t n = evbuffer_get_length(input);
+
+ ri->n_read += n;
+ evbuffer_drain(input, n);
+}
+
+static void
+errorcb(struct bufferevent *b, short what, void *arg)
+{
+ struct request_info *ri = arg;
+ struct timeval now, diff;
+ if (what & BEV_EVENT_EOF) {
+ ++total_n_handled;
+ total_n_bytes += ri->n_read;
+ evutil_gettimeofday(&now, NULL);
+ evutil_timersub(&now, &ri->started, &diff);
+ evutil_timeradd(&diff, &total_time, &total_time);
+
+ if (total_n_handled && (total_n_handled%1000)==0)
+ printf("%d requests done\n",total_n_handled);
+
+ if (total_n_launched < N_REQUESTS) {
+ if (launch_request() < 0)
+ perror("Can't launch");
+ }
+ } else {
+ ++total_n_errors;
+ perror("Unexpected error");
+ }
+
+ bufferevent_setcb(b, NULL, NULL, NULL, NULL);
+ free(ri);
+ bufferevent_disable(b, EV_READ|EV_WRITE);
+ bufferevent_free(b);
+}
+
+static void
+frob_socket(evutil_socket_t sock)
+{
+#ifdef HAVE_SO_LINGER
+ struct linger l;
+#endif
+ int one = 1;
+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one))<0)
+ perror("setsockopt(SO_REUSEADDR)");
+#ifdef HAVE_SO_LINGER
+ l.l_onoff = 1;
+ l.l_linger = 0;
+ if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)
+ perror("setsockopt(SO_LINGER)");
+#endif
+}
+
+static int
+launch_request(void)
+{
+ evutil_socket_t sock;
+ struct sockaddr_in sin;
+ struct bufferevent *b;
+
+ struct request_info *ri;
+
+ memset(&sin, 0, sizeof(sin));
+
+ ++total_n_launched;
+
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+ sin.sin_port = htons(8080);
+ if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+ return -1;
+ if (evutil_make_socket_nonblocking(sock) < 0) {
+ evutil_closesocket(sock);
+ return -1;
+ }
+ frob_socket(sock);
+ if (connect(sock, (struct sockaddr*)&sin, sizeof(sin)) < 0) {
+ int e = errno;
+ if (! EVUTIL_ERR_CONNECT_RETRIABLE(e)) {
+ evutil_closesocket(sock);
+ return -1;
+ }
+ }
+
+ ri = malloc(sizeof(*ri));
+ ri->n_read = 0;
+ evutil_gettimeofday(&ri->started, NULL);
+
+ b = bufferevent_socket_new(base, sock, BEV_OPT_CLOSE_ON_FREE);
+
+ bufferevent_setcb(b, readcb, NULL, errorcb, ri);
+ bufferevent_enable(b, EV_READ|EV_WRITE);
+
+ evbuffer_add_printf(bufferevent_get_output(b),
+ "GET %s HTTP/1.0\r\n\r\n", resource);
+
+ return 0;
+}
+
+
+int
+main(int argc, char **argv)
+{
+ int i;
+ struct timeval start, end, total;
+ long long usec;
+ double throughput;
+ resource = "/ref";
+
+ setvbuf(stdout, NULL, _IONBF, 0);
+
+ base = event_base_new();
+
+ for (i=0; i < PARALLELISM; ++i) {
+ if (launch_request() < 0)
+ perror("launch");
+ }
+
+ evutil_gettimeofday(&start, NULL);
+
+ event_base_dispatch(base);
+
+ evutil_gettimeofday(&end, NULL);
+ evutil_timersub(&end, &start, &total);
+ usec = total_time.tv_sec * (long long)1000000 + total_time.tv_usec;
+
+ if (!total_n_handled) {
+ puts("Nothing worked. You probably did something dumb.");
+ return 0;
+ }
+
+
+ throughput = total_n_handled /
+ (total.tv_sec+ ((double)total.tv_usec)/1000000.0);
+
+#ifdef _WIN32
+#define I64_FMT "%I64d"
+#define I64_TYP __int64
+#else
+#define I64_FMT "%lld"
+#define I64_TYP long long int
+#endif
+
+ printf("\n%d requests in %d.%06d sec. (%.2f throughput)\n"
+ "Each took about %.02f msec latency\n"
+ I64_FMT "bytes read. %d errors.\n",
+ total_n_handled,
+ (int)total.tv_sec, (int)total.tv_usec,
+ throughput,
+ (double)(usec/1000) / total_n_handled,
+ (I64_TYP)total_n_bytes, n_errors);
+
+ return 0;
+}
diff --git a/sntp/libevent/test/check-dumpevents.py b/sntp/libevent/test/check-dumpevents.py
new file mode 100755
index 0000000..16fe9bc
--- /dev/null
+++ b/sntp/libevent/test/check-dumpevents.py
@@ -0,0 +1,54 @@
+#!/usr/bin/python2
+#
+# Post-process the output of test-dumpevents and check it for correctness.
+#
+
+import math
+import re
+import sys
+
+text = sys.stdin.readlines()
+
+try:
+ expect_inserted_pos = text.index("Inserted:\n")
+ expect_active_pos = text.index("Active:\n")
+ got_inserted_pos = text.index("Inserted events:\n")
+ got_active_pos = text.index("Active events:\n")
+except ValueError:
+ print >>sys.stderr, "Missing expected dividing line in dumpevents output"
+ sys.exit(1)
+
+if not (expect_inserted_pos < expect_active_pos <
+ got_inserted_pos < got_active_pos):
+ print >>sys.stderr, "Sections out of order in dumpevents output"
+ sys.exit(1)
+
+now,T= text[1].split()
+T = float(T)
+
+want_inserted = set(text[expect_inserted_pos+1:expect_active_pos])
+want_active = set(text[expect_active_pos+1:got_inserted_pos-1])
+got_inserted = set(text[got_inserted_pos+1:got_active_pos])
+got_active = set(text[got_active_pos+1:])
+
+pat = re.compile(r'Timeout=([0-9\.]+)')
+def replace_time(m):
+ t = float(m.group(1))
+ if .9 < abs(t-T) < 1.1:
+ return "Timeout=T+1"
+ elif 2.4 < abs(t-T) < 2.6:
+ return "Timeout=T+2.5"
+ else:
+ return m.group(0)
+
+cleaned_inserted = set( pat.sub(replace_time, s) for s in got_inserted
+ if "Internal" not in s)
+
+if cleaned_inserted != want_inserted:
+ print >>sys.stderr, "Inserted event lists were not as expected!"
+ sys.exit(1)
+
+if set(got_active) != set(want_active):
+ print >>sys.stderr, "Active event lists were not as expected!"
+ sys.exit(1)
+
diff --git a/sntp/libevent/test/include.am b/sntp/libevent/test/include.am
new file mode 100644
index 0000000..ca36da4
--- /dev/null
+++ b/sntp/libevent/test/include.am
@@ -0,0 +1,145 @@
+# test/Makefile.am for libevent
+# Copyright 2000-2007 Niels Provos
+# Copyright 2007-2012 Niels Provos and Nick Mathewson
+#
+# See LICENSE for copying information.
+
+regress_CPPFLAGS = -DTINYTEST_LOCAL
+
+EXTRA_DIST+= \
+ test/check-dumpevents.py \
+ test/regress.gen.c \
+ test/regress.gen.h \
+ test/regress.rpc \
+ test/rpcgen_wrapper.sh \
+ test/test.sh
+
+TESTPROGRAMS = \
+ test/bench \
+ test/bench_cascade \
+ test/bench_http \
+ test/bench_httpclient \
+ test/test-changelist \
+ test/test-dumpevents \
+ test/test-eof \
+ test/test-closed \
+ test/test-fdleak \
+ test/test-init \
+ test/test-ratelim \
+ test/test-time \
+ test/test-weof \
+ test/regress
+
+if BUILD_REGRESS
+noinst_PROGRAMS += $(TESTPROGRAMS)
+EXTRA_PROGRAMS+= test/regress
+endif
+
+noinst_HEADERS+= \
+ test/regress.h \
+ test/regress_thread.h \
+ test/tinytest.h \
+ test/tinytest_local.h \
+ test/tinytest_macros.h
+
+# We need to copy this file, since automake doesn't want us to use top_srcdir
+# in TESTS.
+TESTS = test/test-script.sh
+
+test/test-script.sh: test/test.sh
+ cp $(top_srcdir)/test/test.sh $@
+
+DISTCLEANFILES += test/test-script.sh test/regress.gen.c test/regress.gen.h
+
+if BUILD_REGRESS
+BUILT_SOURCES += test/regress.gen.c test/regress.gen.h
+endif
+
+test_test_init_SOURCES = test/test-init.c
+test_test_init_LDADD = libevent_core.la
+test_test_dumpevents_SOURCES = test/test-dumpevents.c
+test_test_dumpevents_LDADD = libevent_core.la
+test_test_eof_SOURCES = test/test-eof.c
+test_test_eof_LDADD = libevent_core.la
+test_test_closed_SOURCES = test/test-closed.c
+test_test_closed_LDADD = libevent_core.la
+test_test_changelist_SOURCES = test/test-changelist.c
+test_test_changelist_LDADD = libevent_core.la
+test_test_weof_SOURCES = test/test-weof.c
+test_test_weof_LDADD = libevent_core.la
+test_test_time_SOURCES = test/test-time.c
+test_test_time_LDADD = libevent_core.la
+test_test_ratelim_SOURCES = test/test-ratelim.c
+test_test_ratelim_LDADD = libevent_core.la -lm
+test_test_fdleak_SOURCES = test/test-fdleak.c
+test_test_fdleak_LDADD = libevent_core.la
+
+test_regress_SOURCES = \
+ test/regress.c \
+ test/regress.gen.c \
+ test/regress.gen.h \
+ test/regress_buffer.c \
+ test/regress_bufferevent.c \
+ test/regress_dns.c \
+ test/regress_et.c \
+ test/regress_finalize.c \
+ test/regress_http.c \
+ test/regress_listener.c \
+ test/regress_main.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)
+
+if PTHREADS
+regress_thread_SOURCES = test/regress_thread.c
+PTHREAD_LIBS += libevent_pthreads.la
+endif
+if BUILD_WIN32
+regress_thread_SOURCES = test/regress_thread.c
+endif
+if ZLIB_REGRESS
+regress_zlib_SOURCES = test/regress_zlib.c
+endif
+if BUILD_WIN32
+test_regress_SOURCES += test/regress_iocp.c
+endif
+
+test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la $(PTHREAD_LIBS) $(ZLIB_LIBS)
+test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) -Itest
+test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
+
+if OPENSSL
+test_regress_SOURCES += test/regress_ssl.c
+test_regress_CPPFLAGS += $(OPENSSL_INCS)
+test_regress_LDADD += libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
+endif
+
+test_bench_SOURCES = test/bench.c
+test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+test_bench_cascade_SOURCES = test/bench_cascade.c
+test_bench_cascade_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
+test_bench_http_SOURCES = test/bench_http.c
+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
+
+test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
+
+test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
+ $(AM_V_GEN)date -u > $@
+ $(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
+ true; \
+ else \
+ echo "No Python installed; stubbing out RPC test." >&2; \
+ echo " "> test/regress.gen.c; \
+ echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \
+ fi
+
+CLEANFILES += test/rpcgen-attempted
+
+$(TESTPROGRAMS) : libevent.la
diff --git a/sntp/libevent/test/regress.c b/sntp/libevent/test/regress.c
new file mode 100644
index 0000000..4d17b67
--- /dev/null
+++ b/sntp/libevent/test/regress.c
@@ -0,0 +1,3309 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event2/tag.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/util.h"
+#include "event-internal.h"
+#include "evthread-internal.h"
+#include "log-internal.h"
+#include "time-internal.h"
+
+#include "regress.h"
+
+#ifndef _WIN32
+#include "regress.gen.h"
+#endif
+
+evutil_socket_t pair[2];
+int test_ok;
+int called;
+struct event_base *global_base;
+
+static char wbuf[4096];
+static char rbuf[4096];
+static int woff;
+static int roff;
+static int usepersist;
+static struct timeval tset;
+static struct timeval tcalled;
+
+
+#define TEST1 "this is a test"
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+#ifdef _WIN32
+#define write(fd,buf,len) send((fd),(buf),(int)(len),0)
+#define read(fd,buf,len) recv((fd),(buf),(int)(len),0)
+#endif
+
+struct basic_cb_args
+{
+ struct event_base *eb;
+ struct event *ev;
+ unsigned int callcount;
+};
+
+static void
+simple_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ int len;
+
+ len = read(fd, buf, sizeof(buf));
+
+ if (len) {
+ if (!called) {
+ if (event_add(arg, NULL) == -1)
+ exit(1);
+ }
+ } else if (called == 1)
+ test_ok = 1;
+
+ called++;
+}
+
+static void
+basic_read_cb(evutil_socket_t fd, short event, void *data)
+{
+ char buf[256];
+ int len;
+ struct basic_cb_args *arg = data;
+
+ len = read(fd, buf, sizeof(buf));
+
+ if (len < 0) {
+ tt_fail_perror("read (callback)");
+ } else {
+ switch (arg->callcount++) {
+ case 0: /* first call: expect to read data; cycle */
+ if (len > 0)
+ return;
+
+ tt_fail_msg("EOF before data read");
+ break;
+
+ case 1: /* second call: expect EOF; stop */
+ if (len > 0)
+ tt_fail_msg("not all data read on first cycle");
+ break;
+
+ default: /* third call: should not happen */
+ tt_fail_msg("too many cycles");
+ }
+ }
+
+ event_del(arg->ev);
+ event_base_loopexit(arg->eb, NULL);
+}
+
+static void
+dummy_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+}
+
+static void
+simple_write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ int len;
+
+ len = write(fd, TEST1, strlen(TEST1) + 1);
+ if (len == -1)
+ test_ok = 0;
+ else
+ test_ok = 1;
+}
+
+static void
+multiple_write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ int len;
+
+ len = 128;
+ if (woff + len >= (int)sizeof(wbuf))
+ len = sizeof(wbuf) - woff;
+
+ len = write(fd, wbuf + woff, len);
+ if (len == -1) {
+ fprintf(stderr, "%s: write\n", __func__);
+ if (usepersist)
+ event_del(ev);
+ return;
+ }
+
+ woff += len;
+
+ if (woff >= (int)sizeof(wbuf)) {
+ shutdown(fd, SHUT_WR);
+ if (usepersist)
+ event_del(ev);
+ return;
+ }
+
+ if (!usepersist) {
+ if (event_add(ev, NULL) == -1)
+ exit(1);
+ }
+}
+
+static void
+multiple_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ int len;
+
+ len = read(fd, rbuf + roff, sizeof(rbuf) - roff);
+ if (len == -1)
+ fprintf(stderr, "%s: read\n", __func__);
+ if (len <= 0) {
+ if (usepersist)
+ event_del(ev);
+ return;
+ }
+
+ roff += len;
+ if (!usepersist) {
+ if (event_add(ev, NULL) == -1)
+ exit(1);
+ }
+}
+
+static void
+timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ evutil_gettimeofday(&tcalled, NULL);
+}
+
+struct both {
+ struct event ev;
+ int nread;
+};
+
+static void
+combined_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct both *both = arg;
+ char buf[128];
+ int len;
+
+ len = read(fd, buf, sizeof(buf));
+ if (len == -1)
+ fprintf(stderr, "%s: read\n", __func__);
+ if (len <= 0)
+ return;
+
+ both->nread += len;
+ if (event_add(&both->ev, NULL) == -1)
+ exit(1);
+}
+
+static void
+combined_write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct both *both = arg;
+ char buf[128];
+ int len;
+
+ len = sizeof(buf);
+ if (len > both->nread)
+ len = both->nread;
+
+ memset(buf, 'q', len);
+
+ len = write(fd, buf, len);
+ if (len == -1)
+ fprintf(stderr, "%s: write\n", __func__);
+ if (len <= 0) {
+ shutdown(fd, SHUT_WR);
+ return;
+ }
+
+ both->nread -= len;
+ if (event_add(&both->ev, NULL) == -1)
+ exit(1);
+}
+
+/* These macros used to replicate the work of the legacy test wrapper code */
+#define setup_test(x) do { \
+ if (!in_legacy_test_wrapper) { \
+ TT_FAIL(("Legacy test %s not wrapped properly", x)); \
+ return; \
+ } \
+ } while (0)
+#define cleanup_test() setup_test("cleanup")
+
+static void
+test_simpleread(void)
+{
+ struct event ev;
+
+ /* Very simple read test */
+ setup_test("Simple read: ");
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ shutdown(pair[0], SHUT_WR);
+
+ event_set(&ev, pair[1], EV_READ, simple_read_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+static void
+test_simplewrite(void)
+{
+ struct event ev;
+
+ /* Very simple write test */
+ setup_test("Simple write: ");
+
+ event_set(&ev, pair[0], EV_WRITE, simple_write_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+static void
+simpleread_multiple_cb(evutil_socket_t fd, short event, void *arg)
+{
+ if (++called == 2)
+ test_ok = 1;
+}
+
+static void
+test_simpleread_multiple(void)
+{
+ struct event one, two;
+
+ /* Very simple read test */
+ setup_test("Simple read to multiple evens: ");
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ shutdown(pair[0], SHUT_WR);
+
+ event_set(&one, pair[1], EV_READ, simpleread_multiple_cb, NULL);
+ if (event_add(&one, NULL) == -1)
+ exit(1);
+ event_set(&two, pair[1], EV_READ, simpleread_multiple_cb, NULL);
+ if (event_add(&two, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+static int have_closed = 0;
+static int premature_event = 0;
+static void
+simpleclose_close_fd_cb(evutil_socket_t s, short what, void *ptr)
+{
+ evutil_socket_t **fds = ptr;
+ TT_BLATHER(("Closing"));
+ evutil_closesocket(*fds[0]);
+ evutil_closesocket(*fds[1]);
+ *fds[0] = -1;
+ *fds[1] = -1;
+ have_closed = 1;
+}
+
+static void
+record_event_cb(evutil_socket_t s, short what, void *ptr)
+{
+ short *whatp = ptr;
+ if (!have_closed)
+ premature_event = 1;
+ *whatp = what;
+ TT_BLATHER(("Recorded %d on socket %d", (int)what, (int)s));
+}
+
+static void
+test_simpleclose(void *ptr)
+{
+ /* Test that a close of FD is detected as a read and as a write. */
+ struct event_base *base = event_base_new();
+ evutil_socket_t pair1[2]={-1,-1}, pair2[2] = {-1, -1};
+ evutil_socket_t *to_close[2];
+ struct event *rev=NULL, *wev=NULL, *closeev=NULL;
+ struct timeval tv;
+ short got_read_on_close = 0, got_write_on_close = 0;
+ char buf[1024];
+ memset(buf, 99, sizeof(buf));
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, pair1)<0)
+ TT_DIE(("socketpair: %s", strerror(errno)));
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, pair2)<0)
+ TT_DIE(("socketpair: %s", strerror(errno)));
+ if (evutil_make_socket_nonblocking(pair1[1]) < 0)
+ TT_DIE(("make_socket_nonblocking"));
+ if (evutil_make_socket_nonblocking(pair2[1]) < 0)
+ TT_DIE(("make_socket_nonblocking"));
+
+ /** Stuff pair2[1] full of data, until write fails */
+ while (1) {
+ int r = write(pair2[1], buf, sizeof(buf));
+ if (r<0) {
+ int err = evutil_socket_geterror(pair2[1]);
+ if (! EVUTIL_ERR_RW_RETRIABLE(err))
+ TT_DIE(("write failed strangely: %s",
+ evutil_socket_error_to_string(err)));
+ break;
+ }
+ }
+ to_close[0] = &pair1[0];
+ to_close[1] = &pair2[0];
+
+ closeev = event_new(base, -1, EV_TIMEOUT, simpleclose_close_fd_cb,
+ to_close);
+ rev = event_new(base, pair1[1], EV_READ, record_event_cb,
+ &got_read_on_close);
+ TT_BLATHER(("Waiting for read on %d", (int)pair1[1]));
+ wev = event_new(base, pair2[1], EV_WRITE, record_event_cb,
+ &got_write_on_close);
+ TT_BLATHER(("Waiting for write on %d", (int)pair2[1]));
+ tv.tv_sec = 0;
+ tv.tv_usec = 100*1000; /* Close pair1[0] after a little while, and make
+ * sure we get a read event. */
+ event_add(closeev, &tv);
+ event_add(rev, NULL);
+ event_add(wev, NULL);
+ /* Don't let the test go on too long. */
+ tv.tv_sec = 0;
+ tv.tv_usec = 200*1000;
+ event_base_loopexit(base, &tv);
+ event_base_loop(base, 0);
+
+ tt_int_op(got_read_on_close, ==, EV_READ);
+ tt_int_op(got_write_on_close, ==, EV_WRITE);
+ tt_int_op(premature_event, ==, 0);
+
+end:
+ if (pair1[0] >= 0)
+ evutil_closesocket(pair1[0]);
+ if (pair1[1] >= 0)
+ evutil_closesocket(pair1[1]);
+ if (pair2[0] >= 0)
+ evutil_closesocket(pair2[0]);
+ if (pair2[1] >= 0)
+ evutil_closesocket(pair2[1]);
+ if (rev)
+ event_free(rev);
+ if (wev)
+ event_free(wev);
+ if (closeev)
+ event_free(closeev);
+ if (base)
+ event_base_free(base);
+}
+
+
+static void
+test_multiple(void)
+{
+ struct event ev, ev2;
+ int i;
+
+ /* Multiple read and write test */
+ setup_test("Multiple read/write: ");
+ memset(rbuf, 0, sizeof(rbuf));
+ for (i = 0; i < (int)sizeof(wbuf); i++)
+ wbuf[i] = i;
+
+ roff = woff = 0;
+ usepersist = 0;
+
+ event_set(&ev, pair[0], EV_WRITE, multiple_write_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_set(&ev2, pair[1], EV_READ, multiple_read_cb, &ev2);
+ if (event_add(&ev2, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ if (roff == woff)
+ test_ok = memcmp(rbuf, wbuf, sizeof(wbuf)) == 0;
+
+ cleanup_test();
+}
+
+static void
+test_persistent(void)
+{
+ struct event ev, ev2;
+ int i;
+
+ /* Multiple read and write test with persist */
+ setup_test("Persist read/write: ");
+ memset(rbuf, 0, sizeof(rbuf));
+ for (i = 0; i < (int)sizeof(wbuf); i++)
+ wbuf[i] = i;
+
+ roff = woff = 0;
+ usepersist = 1;
+
+ event_set(&ev, pair[0], EV_WRITE|EV_PERSIST, multiple_write_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_set(&ev2, pair[1], EV_READ|EV_PERSIST, multiple_read_cb, &ev2);
+ if (event_add(&ev2, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ if (roff == woff)
+ test_ok = memcmp(rbuf, wbuf, sizeof(wbuf)) == 0;
+
+ cleanup_test();
+}
+
+static void
+test_combined(void)
+{
+ struct both r1, r2, w1, w2;
+
+ setup_test("Combined read/write: ");
+ memset(&r1, 0, sizeof(r1));
+ memset(&r2, 0, sizeof(r2));
+ memset(&w1, 0, sizeof(w1));
+ memset(&w2, 0, sizeof(w2));
+
+ w1.nread = 4096;
+ w2.nread = 8192;
+
+ event_set(&r1.ev, pair[0], EV_READ, combined_read_cb, &r1);
+ event_set(&w1.ev, pair[0], EV_WRITE, combined_write_cb, &w1);
+ event_set(&r2.ev, pair[1], EV_READ, combined_read_cb, &r2);
+ event_set(&w2.ev, pair[1], EV_WRITE, combined_write_cb, &w2);
+ tt_assert(event_add(&r1.ev, NULL) != -1);
+ tt_assert(!event_add(&w1.ev, NULL));
+ tt_assert(!event_add(&r2.ev, NULL));
+ tt_assert(!event_add(&w2.ev, NULL));
+ event_dispatch();
+
+ if (r1.nread == 8192 && r2.nread == 4096)
+ test_ok = 1;
+
+end:
+ cleanup_test();
+}
+
+static void
+test_simpletimeout(void)
+{
+ struct timeval tv;
+ struct event ev;
+
+ setup_test("Simple timeout: ");
+
+ tv.tv_usec = 200*1000;
+ tv.tv_sec = 0;
+ evutil_timerclear(&tcalled);
+ evtimer_set(&ev, timeout_cb, NULL);
+ evtimer_add(&ev, &tv);
+
+ evutil_gettimeofday(&tset, NULL);
+ event_dispatch();
+ test_timeval_diff_eq(&tset, &tcalled, 200);
+
+ test_ok = 1;
+end:
+ cleanup_test();
+}
+
+static void
+periodic_timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ int *count = arg;
+
+ (*count)++;
+ if (*count == 6) {
+ /* call loopexit only once - on slow machines(?), it is
+ * apparently possible for this to get called twice. */
+ test_ok = 1;
+ event_base_loopexit(global_base, NULL);
+ }
+}
+
+static void
+test_persistent_timeout(void)
+{
+ struct timeval tv;
+ struct event ev;
+ int count = 0;
+
+ evutil_timerclear(&tv);
+ tv.tv_usec = 10000;
+
+ event_assign(&ev, global_base, -1, EV_TIMEOUT|EV_PERSIST,
+ periodic_timeout_cb, &count);
+ event_add(&ev, &tv);
+
+ event_dispatch();
+
+ event_del(&ev);
+}
+
+static void
+test_persistent_timeout_jump(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event ev;
+ int count = 0;
+ struct timeval msec100 = { 0, 100 * 1000 };
+ struct timeval msec50 = { 0, 50 * 1000 };
+ struct timeval msec300 = { 0, 300 * 1000 };
+
+ event_assign(&ev, data->base, -1, EV_PERSIST, periodic_timeout_cb, &count);
+ event_add(&ev, &msec100);
+ /* Wait for a bit */
+ evutil_usleep_(&msec300);
+ event_base_loopexit(data->base, &msec50);
+ event_base_dispatch(data->base);
+ tt_int_op(count, ==, 1);
+
+end:
+ event_del(&ev);
+}
+
+struct persist_active_timeout_called {
+ int n;
+ short events[16];
+ struct timeval tvs[16];
+};
+
+static void
+activate_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ event_active(ev, EV_READ, 1);
+}
+
+static void
+persist_active_timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct persist_active_timeout_called *c = arg;
+ if (c->n < 15) {
+ c->events[c->n] = event;
+ evutil_gettimeofday(&c->tvs[c->n], NULL);
+ ++c->n;
+ }
+}
+
+static void
+test_persistent_active_timeout(void *ptr)
+{
+ struct timeval tv, tv2, tv_exit, start;
+ struct event ev;
+ struct persist_active_timeout_called res;
+
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+
+ memset(&res, 0, sizeof(res));
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 200 * 1000;
+ event_assign(&ev, base, -1, EV_TIMEOUT|EV_PERSIST,
+ persist_active_timeout_cb, &res);
+ event_add(&ev, &tv);
+
+ tv2.tv_sec = 0;
+ tv2.tv_usec = 100 * 1000;
+ event_base_once(base, -1, EV_TIMEOUT, activate_cb, &ev, &tv2);
+
+ tv_exit.tv_sec = 0;
+ tv_exit.tv_usec = 600 * 1000;
+ event_base_loopexit(base, &tv_exit);
+
+ event_base_assert_ok_(base);
+ evutil_gettimeofday(&start, NULL);
+
+ event_base_dispatch(base);
+ event_base_assert_ok_(base);
+
+ tt_int_op(res.n, ==, 3);
+ tt_int_op(res.events[0], ==, EV_READ);
+ tt_int_op(res.events[1], ==, EV_TIMEOUT);
+ tt_int_op(res.events[2], ==, EV_TIMEOUT);
+ test_timeval_diff_eq(&start, &res.tvs[0], 100);
+ test_timeval_diff_eq(&start, &res.tvs[1], 300);
+ test_timeval_diff_eq(&start, &res.tvs[2], 500);
+end:
+ event_del(&ev);
+}
+
+struct common_timeout_info {
+ struct event ev;
+ struct timeval called_at;
+ int which;
+ int count;
+};
+
+static void
+common_timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct common_timeout_info *ti = arg;
+ ++ti->count;
+ evutil_gettimeofday(&ti->called_at, NULL);
+ if (ti->count >= 4)
+ event_del(&ti->ev);
+}
+
+static void
+test_common_timeout(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+
+ struct event_base *base = data->base;
+ int i;
+ struct common_timeout_info info[100];
+
+ struct timeval start;
+ struct timeval tmp_100_ms = { 0, 100*1000 };
+ struct timeval tmp_200_ms = { 0, 200*1000 };
+ struct timeval tmp_5_sec = { 5, 0 };
+ struct timeval tmp_5M_usec = { 0, 5*1000*1000 };
+
+ const struct timeval *ms_100, *ms_200, *sec_5;
+
+ ms_100 = event_base_init_common_timeout(base, &tmp_100_ms);
+ ms_200 = event_base_init_common_timeout(base, &tmp_200_ms);
+ sec_5 = event_base_init_common_timeout(base, &tmp_5_sec);
+ tt_assert(ms_100);
+ tt_assert(ms_200);
+ tt_assert(sec_5);
+ tt_ptr_op(event_base_init_common_timeout(base, &tmp_200_ms),
+ ==, ms_200);
+ tt_ptr_op(event_base_init_common_timeout(base, ms_200), ==, ms_200);
+ tt_ptr_op(event_base_init_common_timeout(base, &tmp_5M_usec), ==, sec_5);
+ tt_int_op(ms_100->tv_sec, ==, 0);
+ tt_int_op(ms_200->tv_sec, ==, 0);
+ tt_int_op(sec_5->tv_sec, ==, 5);
+ tt_int_op(ms_100->tv_usec, ==, 100000|0x50000000);
+ tt_int_op(ms_200->tv_usec, ==, 200000|0x50100000);
+ tt_int_op(sec_5->tv_usec, ==, 0|0x50200000);
+
+ memset(info, 0, sizeof(info));
+
+ for (i=0; i<100; ++i) {
+ info[i].which = i;
+ event_assign(&info[i].ev, base, -1, EV_TIMEOUT|EV_PERSIST,
+ common_timeout_cb, &info[i]);
+ if (i % 2) {
+ if ((i%20)==1) {
+ /* Glass-box test: Make sure we survive the
+ * transition to non-common timeouts. It's
+ * a little tricky. */
+ event_add(&info[i].ev, ms_200);
+ event_add(&info[i].ev, &tmp_100_ms);
+ } else if ((i%20)==3) {
+ /* Check heap-to-common too. */
+ event_add(&info[i].ev, &tmp_200_ms);
+ event_add(&info[i].ev, ms_100);
+ } else if ((i%20)==5) {
+ /* Also check common-to-common. */
+ event_add(&info[i].ev, ms_200);
+ event_add(&info[i].ev, ms_100);
+ } else {
+ event_add(&info[i].ev, ms_100);
+ }
+ } else {
+ event_add(&info[i].ev, ms_200);
+ }
+ }
+
+ event_base_assert_ok_(base);
+ evutil_gettimeofday(&start, NULL);
+ event_base_dispatch(base);
+
+ event_base_assert_ok_(base);
+
+ for (i=0; i<10; ++i) {
+ tt_int_op(info[i].count, ==, 4);
+ if (i % 2) {
+ test_timeval_diff_eq(&start, &info[i].called_at, 400);
+ } else {
+ test_timeval_diff_eq(&start, &info[i].called_at, 800);
+ }
+ }
+
+ /* Make sure we can free the base with some events in. */
+ for (i=0; i<100; ++i) {
+ if (i % 2) {
+ event_add(&info[i].ev, ms_100);
+ } else {
+ event_add(&info[i].ev, ms_200);
+ }
+ }
+
+end:
+ event_base_free(data->base); /* need to do this here before info is
+ * out-of-scope */
+ data->base = NULL;
+}
+
+#ifndef _WIN32
+static void signal_cb(evutil_socket_t fd, short event, void *arg);
+
+#define current_base event_global_current_base_
+extern struct event_base *current_base;
+
+static void
+child_signal_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct timeval tv;
+ int *pint = arg;
+
+ *pint = 1;
+
+ tv.tv_usec = 500000;
+ tv.tv_sec = 0;
+ event_loopexit(&tv);
+}
+
+static void
+test_fork(void)
+{
+ int status, got_sigchld = 0;
+ struct event ev, sig_ev;
+ pid_t pid;
+
+ setup_test("After fork: ");
+
+ tt_assert(current_base);
+ evthread_make_base_notifiable(current_base);
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ event_set(&ev, pair[1], EV_READ, simple_read_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+
+ evsignal_set(&sig_ev, SIGCHLD, child_signal_cb, &got_sigchld);
+ evsignal_add(&sig_ev, NULL);
+
+ event_base_assert_ok_(current_base);
+ TT_BLATHER(("Before fork"));
+ if ((pid = regress_fork()) == 0) {
+ /* in the child */
+ TT_BLATHER(("In child, before reinit"));
+ event_base_assert_ok_(current_base);
+ if (event_reinit(current_base) == -1) {
+ fprintf(stdout, "FAILED (reinit)\n");
+ exit(1);
+ }
+ TT_BLATHER(("After reinit"));
+ event_base_assert_ok_(current_base);
+ TT_BLATHER(("After assert-ok"));
+
+ evsignal_del(&sig_ev);
+
+ called = 0;
+
+ event_dispatch();
+
+ event_base_free(current_base);
+
+ /* we do not send an EOF; simple_read_cb requires an EOF
+ * to set test_ok. we just verify that the callback was
+ * called. */
+ exit(test_ok != 0 || called != 2 ? -2 : 76);
+ }
+
+ /* wait for the child to read the data */
+ {
+ const struct timeval tv = { 0, 100000 };
+ evutil_usleep_(&tv);
+ }
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ TT_BLATHER(("Before waitpid"));
+ if (waitpid(pid, &status, 0) == -1) {
+ fprintf(stdout, "FAILED (fork)\n");
+ exit(1);
+ }
+ TT_BLATHER(("After waitpid"));
+
+ if (WEXITSTATUS(status) != 76) {
+ fprintf(stdout, "FAILED (exit): %d\n", WEXITSTATUS(status));
+ exit(1);
+ }
+
+ /* test that the current event loop still works */
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ fprintf(stderr, "%s: write\n", __func__);
+ }
+
+ shutdown(pair[0], SHUT_WR);
+
+ event_dispatch();
+
+ if (!got_sigchld) {
+ fprintf(stdout, "FAILED (sigchld)\n");
+ exit(1);
+ }
+
+ evsignal_del(&sig_ev);
+
+ end:
+ cleanup_test();
+}
+
+static void
+signal_cb_sa(int sig)
+{
+ test_ok = 2;
+}
+
+static void
+signal_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+
+ evsignal_del(ev);
+ test_ok = 1;
+}
+
+static void
+test_simplesignal(void)
+{
+ struct event ev;
+ struct itimerval itv;
+
+ setup_test("Simple signal: ");
+ evsignal_set(&ev, SIGALRM, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ /* find bugs in which operations are re-ordered */
+ evsignal_del(&ev);
+ evsignal_add(&ev, NULL);
+
+ memset(&itv, 0, sizeof(itv));
+ itv.it_value.tv_sec = 0;
+ itv.it_value.tv_usec = 100000;
+ if (setitimer(ITIMER_REAL, &itv, NULL) == -1)
+ goto skip_simplesignal;
+
+ event_dispatch();
+ skip_simplesignal:
+ if (evsignal_del(&ev) == -1)
+ test_ok = 0;
+
+ cleanup_test();
+}
+
+static void
+test_multiplesignal(void)
+{
+ struct event ev_one, ev_two;
+ struct itimerval itv;
+
+ setup_test("Multiple signal: ");
+
+ evsignal_set(&ev_one, SIGALRM, signal_cb, &ev_one);
+ evsignal_add(&ev_one, NULL);
+
+ evsignal_set(&ev_two, SIGALRM, signal_cb, &ev_two);
+ evsignal_add(&ev_two, NULL);
+
+ memset(&itv, 0, sizeof(itv));
+ itv.it_value.tv_sec = 0;
+ itv.it_value.tv_usec = 100000;
+ if (setitimer(ITIMER_REAL, &itv, NULL) == -1)
+ goto skip_simplesignal;
+
+ event_dispatch();
+
+ skip_simplesignal:
+ if (evsignal_del(&ev_one) == -1)
+ test_ok = 0;
+ if (evsignal_del(&ev_two) == -1)
+ test_ok = 0;
+
+ cleanup_test();
+}
+
+static void
+test_immediatesignal(void)
+{
+ struct event ev;
+
+ test_ok = 0;
+ evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ raise(SIGUSR1);
+ event_loop(EVLOOP_NONBLOCK);
+ evsignal_del(&ev);
+ cleanup_test();
+}
+
+static void
+test_signal_dealloc(void)
+{
+ /* make sure that evsignal_event is event_del'ed and pipe closed */
+ struct event ev;
+ struct event_base *base = event_init();
+ evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ evsignal_del(&ev);
+ event_base_free(base);
+ /* If we got here without asserting, we're fine. */
+ test_ok = 1;
+ cleanup_test();
+}
+
+static void
+test_signal_pipeloss(void)
+{
+ /* make sure that the base1 pipe is closed correctly. */
+ struct event_base *base1, *base2;
+ int pipe1;
+ test_ok = 0;
+ base1 = event_init();
+ pipe1 = base1->sig.ev_signal_pair[0];
+ base2 = event_init();
+ event_base_free(base2);
+ event_base_free(base1);
+ if (close(pipe1) != -1 || errno!=EBADF) {
+ /* fd must be closed, so second close gives -1, EBADF */
+ printf("signal pipe not closed. ");
+ test_ok = 0;
+ } else {
+ test_ok = 1;
+ }
+ cleanup_test();
+}
+
+/*
+ * make two bases to catch signals, use both of them. this only works
+ * for event mechanisms that use our signal pipe trick. kqueue handles
+ * signals internally, and all interested kqueues get all the signals.
+ */
+static void
+test_signal_switchbase(void)
+{
+ struct event ev1, ev2;
+ struct event_base *base1, *base2;
+ int is_kqueue;
+ test_ok = 0;
+ base1 = event_init();
+ base2 = event_init();
+ is_kqueue = !strcmp(event_get_method(),"kqueue");
+ evsignal_set(&ev1, SIGUSR1, signal_cb, &ev1);
+ evsignal_set(&ev2, SIGUSR1, signal_cb, &ev2);
+ if (event_base_set(base1, &ev1) ||
+ event_base_set(base2, &ev2) ||
+ event_add(&ev1, NULL) ||
+ event_add(&ev2, NULL)) {
+ fprintf(stderr, "%s: cannot set base, add\n", __func__);
+ exit(1);
+ }
+
+ tt_ptr_op(event_get_base(&ev1), ==, base1);
+ tt_ptr_op(event_get_base(&ev2), ==, base2);
+
+ test_ok = 0;
+ /* can handle signal before loop is called */
+ raise(SIGUSR1);
+ event_base_loop(base2, EVLOOP_NONBLOCK);
+ if (is_kqueue) {
+ if (!test_ok)
+ goto end;
+ test_ok = 0;
+ }
+ event_base_loop(base1, EVLOOP_NONBLOCK);
+ if (test_ok && !is_kqueue) {
+ test_ok = 0;
+
+ /* set base1 to handle signals */
+ event_base_loop(base1, EVLOOP_NONBLOCK);
+ raise(SIGUSR1);
+ event_base_loop(base1, EVLOOP_NONBLOCK);
+ event_base_loop(base2, EVLOOP_NONBLOCK);
+ }
+end:
+ event_base_free(base1);
+ event_base_free(base2);
+ cleanup_test();
+}
+
+/*
+ * assert that a signal event removed from the event queue really is
+ * removed - with no possibility of it's parent handler being fired.
+ */
+static void
+test_signal_assert(void)
+{
+ struct event ev;
+ struct event_base *base = event_init();
+ test_ok = 0;
+ /* use SIGCONT so we don't kill ourselves when we signal to nowhere */
+ evsignal_set(&ev, SIGCONT, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ /*
+ * if evsignal_del() fails to reset the handler, it's current handler
+ * will still point to evsig_handler().
+ */
+ evsignal_del(&ev);
+
+ raise(SIGCONT);
+#if 0
+ /* only way to verify we were in evsig_handler() */
+ /* XXXX Now there's no longer a good way. */
+ if (base->sig.evsig_caught)
+ test_ok = 0;
+ else
+ test_ok = 1;
+#else
+ test_ok = 1;
+#endif
+
+ event_base_free(base);
+ cleanup_test();
+ return;
+}
+
+/*
+ * assert that we restore our previous signal handler properly.
+ */
+static void
+test_signal_restore(void)
+{
+ struct event ev;
+ struct event_base *base = event_init();
+#ifdef EVENT__HAVE_SIGACTION
+ struct sigaction sa;
+#endif
+
+ test_ok = 0;
+#ifdef EVENT__HAVE_SIGACTION
+ sa.sa_handler = signal_cb_sa;
+ sa.sa_flags = 0x0;
+ sigemptyset(&sa.sa_mask);
+ if (sigaction(SIGUSR1, &sa, NULL) == -1)
+ goto out;
+#else
+ if (signal(SIGUSR1, signal_cb_sa) == SIG_ERR)
+ goto out;
+#endif
+ evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+ evsignal_add(&ev, NULL);
+ evsignal_del(&ev);
+
+ raise(SIGUSR1);
+ /* 1 == signal_cb, 2 == signal_cb_sa, we want our previous handler */
+ if (test_ok != 2)
+ test_ok = 0;
+out:
+ event_base_free(base);
+ cleanup_test();
+ return;
+}
+
+static void
+signal_cb_swp(int sig, short event, void *arg)
+{
+ called++;
+ if (called < 5)
+ raise(sig);
+ else
+ event_loopexit(NULL);
+}
+static void
+timeout_cb_swp(evutil_socket_t fd, short event, void *arg)
+{
+ if (called == -1) {
+ struct timeval tv = {5, 0};
+
+ called = 0;
+ evtimer_add((struct event *)arg, &tv);
+ raise(SIGUSR1);
+ return;
+ }
+ test_ok = 0;
+ event_loopexit(NULL);
+}
+
+static void
+test_signal_while_processing(void)
+{
+ struct event_base *base = event_init();
+ struct event ev, ev_timer;
+ struct timeval tv = {0, 0};
+
+ setup_test("Receiving a signal while processing other signal: ");
+
+ called = -1;
+ test_ok = 1;
+ signal_set(&ev, SIGUSR1, signal_cb_swp, NULL);
+ signal_add(&ev, NULL);
+ evtimer_set(&ev_timer, timeout_cb_swp, &ev_timer);
+ evtimer_add(&ev_timer, &tv);
+ event_dispatch();
+
+ event_base_free(base);
+ cleanup_test();
+ return;
+}
+#endif
+
+static void
+test_free_active_base(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base1;
+ struct event ev1;
+
+ base1 = event_init();
+ if (base1) {
+ event_assign(&ev1, base1, data->pair[1], EV_READ,
+ dummy_read_cb, NULL);
+ event_add(&ev1, NULL);
+ event_base_free(base1); /* should not crash */
+ } else {
+ tt_fail_msg("failed to create event_base for test");
+ }
+
+ base1 = event_init();
+ tt_assert(base1);
+ event_assign(&ev1, base1, 0, 0, dummy_read_cb, NULL);
+ event_active(&ev1, EV_READ, 1);
+ event_base_free(base1);
+end:
+ ;
+}
+
+static void
+test_manipulate_active_events(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev1;
+
+ event_assign(&ev1, base, -1, EV_TIMEOUT, dummy_read_cb, NULL);
+
+ /* Make sure an active event is pending. */
+ event_active(&ev1, EV_READ, 1);
+ tt_int_op(event_pending(&ev1, EV_READ|EV_TIMEOUT|EV_WRITE, NULL),
+ ==, EV_READ);
+
+ /* Make sure that activating an event twice works. */
+ event_active(&ev1, EV_WRITE, 1);
+ tt_int_op(event_pending(&ev1, EV_READ|EV_TIMEOUT|EV_WRITE, NULL),
+ ==, EV_READ|EV_WRITE);
+
+end:
+ event_del(&ev1);
+}
+
+static void
+event_selfarg_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct event *ev = arg;
+ struct event_base *base = event_get_base(ev);
+ event_base_assert_ok_(base);
+ event_base_loopexit(base, NULL);
+ tt_want(ev == event_base_get_running_event(base));
+}
+
+static void
+test_event_new_selfarg(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event *ev = event_new(base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+
+ event_active(ev, EV_READ, 1);
+ event_base_dispatch(base);
+
+ event_free(ev);
+}
+
+static void
+test_event_assign_selfarg(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+
+ event_assign(&ev, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+ event_active(&ev, EV_READ, 1);
+ event_base_dispatch(base);
+}
+
+static void
+test_event_base_get_num_events(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+ int event_count_active;
+ int event_count_virtual;
+ int event_count_added;
+ int event_count_active_virtual;
+ int event_count_active_added;
+ int event_count_virtual_added;
+ int event_count_active_added_virtual;
+
+ struct timeval qsec = {0, 100000};
+
+ event_assign(&ev, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+
+ event_add(&ev, &qsec);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ /* libevent itself adds a timeout event, so the event_count is 2 here */
+ tt_int_op(event_count_added, ==, 2);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 2);
+ tt_int_op(event_count_virtual_added, ==, 2);
+ tt_int_op(event_count_active_added_virtual, ==, 2);
+
+ event_active(&ev, EV_READ, 1);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 1);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 3);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 4);
+ tt_int_op(event_count_virtual_added, ==, 3);
+ tt_int_op(event_count_active_added_virtual, ==, 4);
+
+ event_base_loop(base, 0);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 0);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 0);
+ tt_int_op(event_count_active_added_virtual, ==, 0);
+
+ event_base_add_virtual_(base);
+ event_count_active = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE);
+ event_count_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL);
+ event_count_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ADDED);
+ event_count_active_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_VIRTUAL);
+ event_count_active_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|EVENT_BASE_COUNT_ADDED);
+ event_count_virtual_added = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_VIRTUAL|EVENT_BASE_COUNT_ADDED);
+ event_count_active_added_virtual = event_base_get_num_events(base,
+ EVENT_BASE_COUNT_ACTIVE|
+ EVENT_BASE_COUNT_ADDED|
+ EVENT_BASE_COUNT_VIRTUAL);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 1);
+ tt_int_op(event_count_added, ==, 0);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 1);
+ tt_int_op(event_count_active_added_virtual, ==, 1);
+
+end:
+ ;
+}
+
+static void
+test_event_base_get_max_events(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+ struct event ev2;
+ int event_count_active;
+ int event_count_virtual;
+ int event_count_added;
+ int event_count_active_virtual;
+ int event_count_active_added;
+ int event_count_virtual_added;
+ int event_count_active_added_virtual;
+
+ struct timeval qsec = {0, 100000};
+
+ event_assign(&ev, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+ event_assign(&ev2, base, -1, EV_READ, event_selfarg_cb,
+ event_self_cbarg());
+
+ event_add(&ev, &qsec);
+ event_add(&ev2, &qsec);
+ event_del(&ev2);
+
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ /* libevent itself adds a timeout event, so the event_count is 4 here */
+ tt_int_op(event_count_added, ==, 4);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 4);
+ tt_int_op(event_count_virtual_added, ==, 4);
+ tt_int_op(event_count_active_added_virtual, ==, 4);
+
+ event_active(&ev, EV_READ, 1);
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+
+ tt_int_op(event_count_active, ==, 1);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 4);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 5);
+ tt_int_op(event_count_virtual_added, ==, 4);
+ tt_int_op(event_count_active_added_virtual, ==, 5);
+
+ event_base_loop(base, 0);
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 1);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 1);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 1);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 1);
+
+ tt_int_op(event_count_active, ==, 1);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 4);
+ tt_int_op(event_count_active_virtual, ==, 0);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 0);
+ tt_int_op(event_count_active_added_virtual, ==, 0);
+
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 0);
+ tt_int_op(event_count_added, ==, 0);
+
+ event_base_add_virtual_(base);
+ event_count_active = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE, 0);
+ event_count_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_VIRTUAL, 0);
+ event_count_active_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_virtual_added = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_VIRTUAL | EVENT_BASE_COUNT_ADDED, 0);
+ event_count_active_added_virtual = event_base_get_max_events(base,
+ EVENT_BASE_COUNT_ACTIVE |
+ EVENT_BASE_COUNT_ADDED |
+ EVENT_BASE_COUNT_VIRTUAL, 0);
+
+ tt_int_op(event_count_active, ==, 0);
+ tt_int_op(event_count_virtual, ==, 1);
+ tt_int_op(event_count_added, ==, 0);
+ tt_int_op(event_count_active_virtual, ==, 1);
+ tt_int_op(event_count_active_added, ==, 0);
+ tt_int_op(event_count_virtual_added, ==, 1);
+ tt_int_op(event_count_active_added_virtual, ==, 1);
+
+end:
+ ;
+}
+
+static void
+test_bad_assign(void *ptr)
+{
+ struct event ev;
+ int r;
+ /* READ|SIGNAL is not allowed */
+ r = event_assign(&ev, NULL, -1, EV_SIGNAL|EV_READ, dummy_read_cb, NULL);
+ tt_int_op(r,==,-1);
+
+end:
+ ;
+}
+
+static int reentrant_cb_run = 0;
+
+static void
+bad_reentrant_run_loop_cb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct event_base *base = ptr;
+ int r;
+ reentrant_cb_run = 1;
+ /* This reentrant call to event_base_loop should be detected and
+ * should fail */
+ r = event_base_loop(base, 0);
+ tt_int_op(r, ==, -1);
+end:
+ ;
+}
+
+static void
+test_bad_reentrant(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event ev;
+ int r;
+ event_assign(&ev, base, -1,
+ 0, bad_reentrant_run_loop_cb, base);
+
+ event_active(&ev, EV_WRITE, 1);
+ r = event_base_loop(base, 0);
+ tt_int_op(r, ==, 1);
+ tt_int_op(reentrant_cb_run, ==, 1);
+end:
+ ;
+}
+
+static int n_write_a_byte_cb=0;
+static int n_read_and_drain_cb=0;
+static int n_activate_other_event_cb=0;
+static void
+write_a_byte_cb(evutil_socket_t fd, short what, void *arg)
+{
+ char buf[] = "x";
+ if (write(fd, buf, 1) == 1)
+ ++n_write_a_byte_cb;
+}
+static void
+read_and_drain_cb(evutil_socket_t fd, short what, void *arg)
+{
+ char buf[128];
+ int n;
+ ++n_read_and_drain_cb;
+ while ((n = read(fd, buf, sizeof(buf))) > 0)
+ ;
+}
+
+static void
+activate_other_event_cb(evutil_socket_t fd, short what, void *other_)
+{
+ struct event *ev_activate = other_;
+ ++n_activate_other_event_cb;
+ event_active_later_(ev_activate, EV_READ);
+}
+
+static void
+test_active_later(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event *ev1, *ev2;
+ struct event ev3, ev4;
+ struct timeval qsec = {0, 100000};
+ ev1 = event_new(data->base, data->pair[0], EV_READ|EV_PERSIST, read_and_drain_cb, NULL);
+ ev2 = event_new(data->base, data->pair[1], EV_WRITE|EV_PERSIST, write_a_byte_cb, NULL);
+ event_assign(&ev3, data->base, -1, 0, activate_other_event_cb, &ev4);
+ event_assign(&ev4, data->base, -1, 0, activate_other_event_cb, &ev3);
+ event_add(ev1, NULL);
+ event_add(ev2, NULL);
+ event_active_later_(&ev3, EV_READ);
+
+ event_base_loopexit(data->base, &qsec);
+
+ event_base_loop(data->base, 0);
+
+ TT_BLATHER(("%d write calls, %d read calls, %d activate-other calls.",
+ n_write_a_byte_cb, n_read_and_drain_cb, n_activate_other_event_cb));
+ event_del(&ev3);
+ event_del(&ev4);
+
+ tt_int_op(n_write_a_byte_cb, ==, n_activate_other_event_cb);
+ tt_int_op(n_write_a_byte_cb, >, 100);
+ tt_int_op(n_read_and_drain_cb, >, 100);
+ tt_int_op(n_activate_other_event_cb, >, 100);
+
+ event_active_later_(&ev4, EV_READ);
+ event_active(&ev4, EV_READ, 1); /* This should make the event
+ active immediately. */
+ tt_assert((ev4.ev_flags & EVLIST_ACTIVE) != 0);
+ tt_assert((ev4.ev_flags & EVLIST_ACTIVE_LATER) == 0);
+
+ /* Now leave this one around, so that event_free sees it and removes
+ * it. */
+ event_active_later_(&ev3, EV_READ);
+ event_base_assert_ok_(data->base);
+ event_base_free(data->base);
+ data->base = NULL;
+end:
+ ;
+}
+
+
+static void incr_arg_cb(evutil_socket_t fd, short what, void *arg)
+{
+ int *intptr = arg;
+ (void) fd; (void) what;
+ ++*intptr;
+}
+static void remove_timers_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct event **ep = arg;
+ (void) fd; (void) what;
+ event_remove_timer(ep[0]);
+ event_remove_timer(ep[1]);
+}
+static void send_a_byte_cb(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_socket_t *sockp = arg;
+ (void) fd; (void) what;
+ (void) write(*sockp, "A", 1);
+}
+struct read_not_timeout_param
+{
+ struct event **ev;
+ int events;
+ int count;
+};
+static void read_not_timeout_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct read_not_timeout_param *rntp = arg;
+ char c;
+ ev_ssize_t n;
+ (void) fd; (void) what;
+ n = read(fd, &c, 1);
+ tt_int_op(n, ==, 1);
+ rntp->events |= what;
+ ++rntp->count;
+ if(2 == rntp->count) event_del(rntp->ev[0]);
+end:
+ ;
+}
+
+static void
+test_event_remove_timeout(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = data->base;
+ struct event *ev[5];
+ int ev1_fired=0;
+ struct timeval ms25 = { 0, 25*1000 },
+ ms40 = { 0, 40*1000 },
+ ms75 = { 0, 75*1000 },
+ ms125 = { 0, 125*1000 };
+ struct read_not_timeout_param rntp = { ev, 0, 0 };
+
+ event_base_assert_ok_(base);
+
+ ev[0] = event_new(base, data->pair[0], EV_READ|EV_PERSIST,
+ read_not_timeout_cb, &rntp);
+ ev[1] = evtimer_new(base, incr_arg_cb, &ev1_fired);
+ ev[2] = evtimer_new(base, remove_timers_cb, ev);
+ ev[3] = evtimer_new(base, send_a_byte_cb, &data->pair[1]);
+ ev[4] = evtimer_new(base, send_a_byte_cb, &data->pair[1]);
+ tt_assert(base);
+ event_add(ev[2], &ms25); /* remove timers */
+ event_add(ev[4], &ms40); /* write to test if timer re-activates */
+ event_add(ev[0], &ms75); /* read */
+ event_add(ev[1], &ms75); /* timer */
+ event_add(ev[3], &ms125); /* timeout. */
+ event_base_assert_ok_(base);
+
+ event_base_dispatch(base);
+
+ tt_int_op(ev1_fired, ==, 0);
+ tt_int_op(rntp.events, ==, EV_READ);
+
+ event_base_assert_ok_(base);
+end:
+ event_free(ev[0]);
+ event_free(ev[1]);
+ event_free(ev[2]);
+ event_free(ev[3]);
+ event_free(ev[4]);
+}
+
+static void
+test_event_base_new(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_base *base = 0;
+ struct event ev1;
+ struct basic_cb_args args;
+
+ int towrite = (int)strlen(TEST1)+1;
+ int len = write(data->pair[0], TEST1, towrite);
+
+ if (len < 0)
+ tt_abort_perror("initial write");
+ else if (len != towrite)
+ tt_abort_printf(("initial write fell short (%d of %d bytes)",
+ len, towrite));
+
+ if (shutdown(data->pair[0], SHUT_WR))
+ tt_abort_perror("initial write shutdown");
+
+ base = event_base_new();
+ if (!base)
+ tt_abort_msg("failed to create event base");
+
+ args.eb = base;
+ args.ev = &ev1;
+ args.callcount = 0;
+ event_assign(&ev1, base, data->pair[1],
+ EV_READ|EV_PERSIST, basic_read_cb, &args);
+
+ if (event_add(&ev1, NULL))
+ tt_abort_perror("initial event_add");
+
+ if (event_base_loop(base, 0))
+ tt_abort_msg("unsuccessful exit from event loop");
+
+end:
+ if (base)
+ event_base_free(base);
+}
+
+static void
+test_loopexit(void)
+{
+ struct timeval tv, tv_start, tv_end;
+ struct event ev;
+
+ setup_test("Loop exit: ");
+
+ tv.tv_usec = 0;
+ tv.tv_sec = 60*60*24;
+ evtimer_set(&ev, timeout_cb, NULL);
+ evtimer_add(&ev, &tv);
+
+ tv.tv_usec = 300*1000;
+ tv.tv_sec = 0;
+ event_loopexit(&tv);
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_dispatch();
+ evutil_gettimeofday(&tv_end, NULL);
+
+ evtimer_del(&ev);
+
+ tt_assert(event_base_got_exit(global_base));
+ tt_assert(!event_base_got_break(global_base));
+
+ test_timeval_diff_eq(&tv_start, &tv_end, 300);
+
+ test_ok = 1;
+end:
+ cleanup_test();
+}
+
+static void
+test_loopexit_multiple(void)
+{
+ struct timeval tv, tv_start, tv_end;
+ struct event_base *base;
+
+ setup_test("Loop Multiple exit: ");
+
+ base = event_base_new();
+
+ tv.tv_usec = 200*1000;
+ tv.tv_sec = 0;
+ event_base_loopexit(base, &tv);
+
+ tv.tv_usec = 0;
+ tv.tv_sec = 3;
+ event_base_loopexit(base, &tv);
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(base);
+ evutil_gettimeofday(&tv_end, NULL);
+
+ tt_assert(event_base_got_exit(base));
+ tt_assert(!event_base_got_break(base));
+
+ event_base_free(base);
+
+ test_timeval_diff_eq(&tv_start, &tv_end, 200);
+
+ test_ok = 1;
+
+end:
+ cleanup_test();
+}
+
+static void
+break_cb(evutil_socket_t fd, short events, void *arg)
+{
+ test_ok = 1;
+ event_loopbreak();
+}
+
+static void
+fail_cb(evutil_socket_t fd, short events, void *arg)
+{
+ test_ok = 0;
+}
+
+static void
+test_loopbreak(void)
+{
+ struct event ev1, ev2;
+ struct timeval tv;
+
+ setup_test("Loop break: ");
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ evtimer_set(&ev1, break_cb, NULL);
+ evtimer_add(&ev1, &tv);
+ evtimer_set(&ev2, fail_cb, NULL);
+ evtimer_add(&ev2, &tv);
+
+ event_dispatch();
+
+ tt_assert(!event_base_got_exit(global_base));
+ tt_assert(event_base_got_break(global_base));
+
+ evtimer_del(&ev1);
+ evtimer_del(&ev2);
+
+end:
+ cleanup_test();
+}
+
+static struct event *readd_test_event_last_added = NULL;
+static void
+re_add_read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ struct event *ev_other = arg;
+ ev_ssize_t n_read;
+
+ readd_test_event_last_added = ev_other;
+
+ n_read = read(fd, buf, sizeof(buf));
+
+ if (n_read < 0) {
+ tt_fail_perror("read");
+ event_base_loopbreak(event_get_base(ev_other));
+ return;
+ } else {
+ event_add(ev_other, NULL);
+ ++test_ok;
+ }
+}
+
+static void
+test_nonpersist_readd(void)
+{
+ struct event ev1, ev2;
+
+ setup_test("Re-add nonpersistent events: ");
+ event_set(&ev1, pair[0], EV_READ, re_add_read_cb, &ev2);
+ event_set(&ev2, pair[1], EV_READ, re_add_read_cb, &ev1);
+
+ if (write(pair[0], "Hello", 5) < 0) {
+ tt_fail_perror("write(pair[0])");
+ }
+
+ if (write(pair[1], "Hello", 5) < 0) {
+ tt_fail_perror("write(pair[1])\n");
+ }
+
+ if (event_add(&ev1, NULL) == -1 ||
+ event_add(&ev2, NULL) == -1) {
+ test_ok = 0;
+ }
+ if (test_ok != 0)
+ exit(1);
+ event_loop(EVLOOP_ONCE);
+ if (test_ok != 2)
+ exit(1);
+ /* At this point, we executed both callbacks. Whichever one got
+ * called first added the second, but the second then immediately got
+ * deleted before its callback was called. At this point, though, it
+ * re-added the first.
+ */
+ if (!readd_test_event_last_added) {
+ test_ok = 0;
+ } else if (readd_test_event_last_added == &ev1) {
+ if (!event_pending(&ev1, EV_READ, NULL) ||
+ event_pending(&ev2, EV_READ, NULL))
+ test_ok = 0;
+ } else {
+ if (event_pending(&ev1, EV_READ, NULL) ||
+ !event_pending(&ev2, EV_READ, NULL))
+ test_ok = 0;
+ }
+
+ event_del(&ev1);
+ event_del(&ev2);
+
+ cleanup_test();
+}
+
+struct test_pri_event {
+ struct event ev;
+ int count;
+};
+
+static void
+test_priorities_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct test_pri_event *pri = arg;
+ struct timeval tv;
+
+ if (pri->count == 3) {
+ event_loopexit(NULL);
+ return;
+ }
+
+ pri->count++;
+
+ evutil_timerclear(&tv);
+ event_add(&pri->ev, &tv);
+}
+
+static void
+test_priorities_impl(int npriorities)
+{
+ struct test_pri_event one, two;
+ struct timeval tv;
+
+ TT_BLATHER(("Testing Priorities %d: ", npriorities));
+
+ event_base_priority_init(global_base, npriorities);
+
+ memset(&one, 0, sizeof(one));
+ memset(&two, 0, sizeof(two));
+
+ timeout_set(&one.ev, test_priorities_cb, &one);
+ if (event_priority_set(&one.ev, 0) == -1) {
+ fprintf(stderr, "%s: failed to set priority", __func__);
+ exit(1);
+ }
+
+ timeout_set(&two.ev, test_priorities_cb, &two);
+ if (event_priority_set(&two.ev, npriorities - 1) == -1) {
+ fprintf(stderr, "%s: failed to set priority", __func__);
+ exit(1);
+ }
+
+ evutil_timerclear(&tv);
+
+ if (event_add(&one.ev, &tv) == -1)
+ exit(1);
+ if (event_add(&two.ev, &tv) == -1)
+ exit(1);
+
+ event_dispatch();
+
+ event_del(&one.ev);
+ event_del(&two.ev);
+
+ if (npriorities == 1) {
+ if (one.count == 3 && two.count == 3)
+ test_ok = 1;
+ } else if (npriorities == 2) {
+ /* Two is called once because event_loopexit is priority 1 */
+ if (one.count == 3 && two.count == 1)
+ test_ok = 1;
+ } else {
+ if (one.count == 3 && two.count == 0)
+ test_ok = 1;
+ }
+}
+
+static void
+test_priorities(void)
+{
+ test_priorities_impl(1);
+ if (test_ok)
+ test_priorities_impl(2);
+ if (test_ok)
+ test_priorities_impl(3);
+}
+
+/* priority-active-inversion: activate a higher-priority event, and make sure
+ * it keeps us from running a lower-priority event first. */
+static int n_pai_calls = 0;
+static struct event pai_events[3];
+
+static void
+prio_active_inversion_cb(evutil_socket_t fd, short what, void *arg)
+{
+ int *call_order = arg;
+ *call_order = n_pai_calls++;
+ if (n_pai_calls == 1) {
+ /* This should activate later, even though it shares a
+ priority with us. */
+ event_active(&pai_events[1], EV_READ, 1);
+ /* This should activate next, since its priority is higher,
+ even though we activated it second. */
+ event_active(&pai_events[2], EV_TIMEOUT, 1);
+ }
+}
+
+static void
+test_priority_active_inversion(void *data_)
+{
+ struct basic_test_data *data = data_;
+ struct event_base *base = data->base;
+ int call_order[3];
+ int i;
+ tt_int_op(event_base_priority_init(base, 8), ==, 0);
+
+ n_pai_calls = 0;
+ memset(call_order, 0, sizeof(call_order));
+
+ for (i=0;i<3;++i) {
+ event_assign(&pai_events[i], data->base, -1, 0,
+ prio_active_inversion_cb, &call_order[i]);
+ }
+
+ event_priority_set(&pai_events[0], 4);
+ event_priority_set(&pai_events[1], 4);
+ event_priority_set(&pai_events[2], 0);
+
+ event_active(&pai_events[0], EV_WRITE, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(n_pai_calls, ==, 3);
+ tt_int_op(call_order[0], ==, 0);
+ tt_int_op(call_order[1], ==, 2);
+ tt_int_op(call_order[2], ==, 1);
+end:
+ ;
+}
+
+
+static void
+test_multiple_cb(evutil_socket_t fd, short event, void *arg)
+{
+ if (event & EV_READ)
+ test_ok |= 1;
+ else if (event & EV_WRITE)
+ test_ok |= 2;
+}
+
+static void
+test_multiple_events_for_same_fd(void)
+{
+ struct event e1, e2;
+
+ setup_test("Multiple events for same fd: ");
+
+ event_set(&e1, pair[0], EV_READ, test_multiple_cb, NULL);
+ event_add(&e1, NULL);
+ event_set(&e2, pair[0], EV_WRITE, test_multiple_cb, NULL);
+ event_add(&e2, NULL);
+ event_loop(EVLOOP_ONCE);
+ event_del(&e2);
+
+ if (write(pair[1], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ event_loop(EVLOOP_ONCE);
+ event_del(&e1);
+
+ if (test_ok != 3)
+ test_ok = 0;
+
+ cleanup_test();
+}
+
+int evtag_decode_int(ev_uint32_t *pnumber, struct evbuffer *evbuf);
+int evtag_decode_int64(ev_uint64_t *pnumber, struct evbuffer *evbuf);
+int evtag_encode_tag(struct evbuffer *evbuf, ev_uint32_t number);
+int evtag_decode_tag(ev_uint32_t *pnumber, struct evbuffer *evbuf);
+
+static void
+read_once_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ int len;
+
+ len = read(fd, buf, sizeof(buf));
+
+ if (called) {
+ test_ok = 0;
+ } else if (len) {
+ /* Assumes global pair[0] can be used for writing */
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ test_ok = 0;
+ } else {
+ test_ok = 1;
+ }
+ }
+
+ called++;
+}
+
+static void
+test_want_only_once(void)
+{
+ struct event ev;
+ struct timeval tv;
+
+ /* Very simple read test */
+ setup_test("Want read only once: ");
+
+ if (write(pair[0], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ /* Setup the loop termination */
+ evutil_timerclear(&tv);
+ tv.tv_usec = 300*1000;
+ event_loopexit(&tv);
+
+ event_set(&ev, pair[1], EV_READ, read_once_cb, &ev);
+ if (event_add(&ev, NULL) == -1)
+ exit(1);
+ event_dispatch();
+
+ cleanup_test();
+}
+
+#define TEST_MAX_INT 6
+
+static void
+evtag_int_test(void *ptr)
+{
+ struct evbuffer *tmp = evbuffer_new();
+ ev_uint32_t integers[TEST_MAX_INT] = {
+ 0xaf0, 0x1000, 0x1, 0xdeadbeef, 0x00, 0xbef000
+ };
+ ev_uint32_t integer;
+ ev_uint64_t big_int;
+ int i;
+
+ evtag_init();
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ int oldlen, newlen;
+ oldlen = (int)EVBUFFER_LENGTH(tmp);
+ evtag_encode_int(tmp, integers[i]);
+ newlen = (int)EVBUFFER_LENGTH(tmp);
+ TT_BLATHER(("encoded 0x%08x with %d bytes",
+ (unsigned)integers[i], newlen - oldlen));
+ big_int = integers[i];
+ big_int *= 1000000000; /* 1 billion */
+ evtag_encode_int64(tmp, big_int);
+ }
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ tt_int_op(evtag_decode_int(&integer, tmp), !=, -1);
+ tt_uint_op(integer, ==, integers[i]);
+ tt_int_op(evtag_decode_int64(&big_int, tmp), !=, -1);
+ tt_assert((big_int / 1000000000) == integers[i]);
+ }
+
+ tt_uint_op(EVBUFFER_LENGTH(tmp), ==, 0);
+end:
+ evbuffer_free(tmp);
+}
+
+static void
+evtag_fuzz(void *ptr)
+{
+ u_char buffer[4096];
+ struct evbuffer *tmp = evbuffer_new();
+ struct timeval tv;
+ int i, j;
+
+ int not_failed = 0;
+
+ evtag_init();
+
+ for (j = 0; j < 100; j++) {
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = rand();
+ evbuffer_drain(tmp, -1);
+ evbuffer_add(tmp, buffer, sizeof(buffer));
+
+ if (evtag_unmarshal_timeval(tmp, 0, &tv) != -1)
+ not_failed++;
+ }
+
+ /* The majority of decodes should fail */
+ tt_int_op(not_failed, <, 10);
+
+ /* Now insert some corruption into the tag length field */
+ evbuffer_drain(tmp, -1);
+ evutil_timerclear(&tv);
+ tv.tv_sec = 1;
+ evtag_marshal_timeval(tmp, 0, &tv);
+ evbuffer_add(tmp, buffer, sizeof(buffer));
+
+ ((char *)EVBUFFER_DATA(tmp))[1] = '\xff';
+ if (evtag_unmarshal_timeval(tmp, 0, &tv) != -1) {
+ tt_abort_msg("evtag_unmarshal_timeval should have failed");
+ }
+
+end:
+ evbuffer_free(tmp);
+}
+
+static void
+evtag_tag_encoding(void *ptr)
+{
+ struct evbuffer *tmp = evbuffer_new();
+ ev_uint32_t integers[TEST_MAX_INT] = {
+ 0xaf0, 0x1000, 0x1, 0xdeadbeef, 0x00, 0xbef000
+ };
+ ev_uint32_t integer;
+ int i;
+
+ evtag_init();
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ int oldlen, newlen;
+ oldlen = (int)EVBUFFER_LENGTH(tmp);
+ evtag_encode_tag(tmp, integers[i]);
+ newlen = (int)EVBUFFER_LENGTH(tmp);
+ TT_BLATHER(("encoded 0x%08x with %d bytes",
+ (unsigned)integers[i], newlen - oldlen));
+ }
+
+ for (i = 0; i < TEST_MAX_INT; i++) {
+ tt_int_op(evtag_decode_tag(&integer, tmp), !=, -1);
+ tt_uint_op(integer, ==, integers[i]);
+ }
+
+ tt_uint_op(EVBUFFER_LENGTH(tmp), ==, 0);
+
+end:
+ evbuffer_free(tmp);
+}
+
+static void
+evtag_test_peek(void *ptr)
+{
+ struct evbuffer *tmp = evbuffer_new();
+ ev_uint32_t u32;
+
+ evtag_marshal_int(tmp, 30, 0);
+ evtag_marshal_string(tmp, 40, "Hello world");
+
+ tt_int_op(evtag_peek(tmp, &u32), ==, 1);
+ tt_int_op(u32, ==, 30);
+ tt_int_op(evtag_peek_length(tmp, &u32), ==, 0);
+ tt_int_op(u32, ==, 1+1+1);
+ tt_int_op(evtag_consume(tmp), ==, 0);
+
+ tt_int_op(evtag_peek(tmp, &u32), ==, 1);
+ tt_int_op(u32, ==, 40);
+ tt_int_op(evtag_peek_length(tmp, &u32), ==, 0);
+ tt_int_op(u32, ==, 1+1+11);
+ tt_int_op(evtag_payload_length(tmp, &u32), ==, 0);
+ tt_int_op(u32, ==, 11);
+
+end:
+ evbuffer_free(tmp);
+}
+
+
+static void
+test_methods(void *ptr)
+{
+ const char **methods = event_get_supported_methods();
+ struct event_config *cfg = NULL;
+ struct event_base *base = NULL;
+ const char *backend;
+ int n_methods = 0;
+
+ tt_assert(methods);
+
+ backend = methods[0];
+ while (*methods != NULL) {
+ TT_BLATHER(("Support method: %s", *methods));
+ ++methods;
+ ++n_methods;
+ }
+
+ cfg = event_config_new();
+ assert(cfg != NULL);
+
+ tt_int_op(event_config_avoid_method(cfg, backend), ==, 0);
+ event_config_set_flag(cfg, EVENT_BASE_FLAG_IGNORE_ENV);
+
+ base = event_base_new_with_config(cfg);
+ if (n_methods > 1) {
+ tt_assert(base);
+ tt_str_op(backend, !=, event_base_get_method(base));
+ } else {
+ tt_assert(base == NULL);
+ }
+
+end:
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static void
+test_version(void *arg)
+{
+ const char *vstr;
+ ev_uint32_t vint;
+ int major, minor, patch, n;
+
+ vstr = event_get_version();
+ vint = event_get_version_number();
+
+ tt_assert(vstr);
+ tt_assert(vint);
+
+ tt_str_op(vstr, ==, LIBEVENT_VERSION);
+ tt_int_op(vint, ==, LIBEVENT_VERSION_NUMBER);
+
+ n = sscanf(vstr, "%d.%d.%d", &major, &minor, &patch);
+ tt_assert(3 == n);
+ tt_int_op((vint&0xffffff00), ==, ((major<<24)|(minor<<16)|(patch<<8)));
+end:
+ ;
+}
+
+static void
+test_base_features(void *arg)
+{
+ struct event_base *base = NULL;
+ struct event_config *cfg = NULL;
+
+ cfg = event_config_new();
+
+ tt_assert(0 == event_config_require_features(cfg, EV_FEATURE_ET));
+
+ base = event_base_new_with_config(cfg);
+ if (base) {
+ tt_int_op(EV_FEATURE_ET, ==,
+ event_base_get_features(base) & EV_FEATURE_ET);
+ } else {
+ base = event_base_new();
+ tt_int_op(0, ==, event_base_get_features(base) & EV_FEATURE_ET);
+ }
+
+end:
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+#ifdef EVENT__HAVE_SETENV
+#define SETENV_OK
+#elif !defined(EVENT__HAVE_SETENV) && defined(EVENT__HAVE_PUTENV)
+static void setenv(const char *k, const char *v, int o_)
+{
+ char b[256];
+ evutil_snprintf(b, sizeof(b), "%s=%s",k,v);
+ putenv(b);
+}
+#define SETENV_OK
+#endif
+
+#ifdef EVENT__HAVE_UNSETENV
+#define UNSETENV_OK
+#elif !defined(EVENT__HAVE_UNSETENV) && defined(EVENT__HAVE_PUTENV)
+static void unsetenv(const char *k)
+{
+ char b[256];
+ evutil_snprintf(b, sizeof(b), "%s=",k);
+ putenv(b);
+}
+#define UNSETENV_OK
+#endif
+
+#if defined(SETENV_OK) && defined(UNSETENV_OK)
+static void
+methodname_to_envvar(const char *mname, char *buf, size_t buflen)
+{
+ char *cp;
+ evutil_snprintf(buf, buflen, "EVENT_NO%s", mname);
+ for (cp = buf; *cp; ++cp) {
+ *cp = EVUTIL_TOUPPER_(*cp);
+ }
+}
+#endif
+
+static void
+test_base_environ(void *arg)
+{
+ struct event_base *base = NULL;
+ struct event_config *cfg = NULL;
+
+#if defined(SETENV_OK) && defined(UNSETENV_OK)
+ const char **basenames;
+ int i, n_methods=0;
+ char varbuf[128];
+ const char *defaultname, *ignoreenvname;
+
+ /* See if unsetenv works before we rely on it. */
+ setenv("EVENT_NOWAFFLES", "1", 1);
+ unsetenv("EVENT_NOWAFFLES");
+ if (getenv("EVENT_NOWAFFLES") != NULL) {
+#ifndef EVENT__HAVE_UNSETENV
+ TT_DECLARE("NOTE", ("Can't fake unsetenv; skipping test"));
+#else
+ TT_DECLARE("NOTE", ("unsetenv doesn't work; skipping test"));
+#endif
+ tt_skip();
+ }
+
+ basenames = event_get_supported_methods();
+ for (i = 0; basenames[i]; ++i) {
+ methodname_to_envvar(basenames[i], varbuf, sizeof(varbuf));
+ unsetenv(varbuf);
+ ++n_methods;
+ }
+
+ base = event_base_new();
+ tt_assert(base);
+
+ defaultname = event_base_get_method(base);
+ TT_BLATHER(("default is <%s>", defaultname));
+ event_base_free(base);
+ base = NULL;
+
+ /* Can we disable the method with EVENT_NOfoo ? */
+ if (!strcmp(defaultname, "epoll (with changelist)")) {
+ setenv("EVENT_NOEPOLL", "1", 1);
+ ignoreenvname = "epoll";
+ } else {
+ methodname_to_envvar(defaultname, varbuf, sizeof(varbuf));
+ setenv(varbuf, "1", 1);
+ ignoreenvname = defaultname;
+ }
+
+ /* Use an empty cfg rather than NULL so a failure doesn't exit() */
+ cfg = event_config_new();
+ base = event_base_new_with_config(cfg);
+ event_config_free(cfg);
+ cfg = NULL;
+ if (n_methods == 1) {
+ tt_assert(!base);
+ } else {
+ tt_assert(base);
+ tt_str_op(defaultname, !=, event_base_get_method(base));
+ event_base_free(base);
+ base = NULL;
+ }
+
+ /* Can we disable looking at the environment with IGNORE_ENV ? */
+ cfg = event_config_new();
+ event_config_set_flag(cfg, EVENT_BASE_FLAG_IGNORE_ENV);
+ base = event_base_new_with_config(cfg);
+ tt_assert(base);
+ tt_str_op(ignoreenvname, ==, event_base_get_method(base));
+#else
+ tt_skip();
+#endif
+
+end:
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static void
+read_called_once_cb(evutil_socket_t fd, short event, void *arg)
+{
+ tt_int_op(event, ==, EV_READ);
+ called += 1;
+end:
+ ;
+}
+
+static void
+timeout_called_once_cb(evutil_socket_t fd, short event, void *arg)
+{
+ tt_int_op(event, ==, EV_TIMEOUT);
+ called += 100;
+end:
+ ;
+}
+
+static void
+immediate_called_twice_cb(evutil_socket_t fd, short event, void *arg)
+{
+ tt_int_op(event, ==, EV_TIMEOUT);
+ called += 1000;
+end:
+ ;
+}
+
+static void
+test_event_once(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct timeval tv;
+ int r;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 50*1000;
+ called = 0;
+ r = event_base_once(data->base, data->pair[0], EV_READ,
+ read_called_once_cb, NULL, NULL);
+ tt_int_op(r, ==, 0);
+ r = event_base_once(data->base, -1, EV_TIMEOUT,
+ timeout_called_once_cb, NULL, &tv);
+ tt_int_op(r, ==, 0);
+ r = event_base_once(data->base, -1, 0, NULL, NULL, NULL);
+ tt_int_op(r, <, 0);
+ r = event_base_once(data->base, -1, EV_TIMEOUT,
+ immediate_called_twice_cb, NULL, NULL);
+ tt_int_op(r, ==, 0);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ r = event_base_once(data->base, -1, EV_TIMEOUT,
+ immediate_called_twice_cb, NULL, &tv);
+ tt_int_op(r, ==, 0);
+
+ if (write(data->pair[1], TEST1, strlen(TEST1)+1) < 0) {
+ tt_fail_perror("write");
+ }
+
+ shutdown(data->pair[1], SHUT_WR);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(called, ==, 2101);
+end:
+ ;
+}
+
+static void
+test_event_once_never(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct timeval tv;
+
+ /* Have one trigger in 10 seconds (don't worry, because) */
+ tv.tv_sec = 10;
+ tv.tv_usec = 0;
+ called = 0;
+ event_base_once(data->base, -1, EV_TIMEOUT,
+ timeout_called_once_cb, NULL, &tv);
+
+ /* But shut down the base in 75 msec. */
+ tv.tv_sec = 0;
+ tv.tv_usec = 75*1000;
+ event_base_loopexit(data->base, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(called, ==, 0);
+end:
+ ;
+}
+
+static void
+test_event_pending(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event *r=NULL, *w=NULL, *t=NULL;
+ struct timeval tv, now, tv2;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 500 * 1000;
+ r = event_new(data->base, data->pair[0], EV_READ, simple_read_cb,
+ NULL);
+ w = event_new(data->base, data->pair[1], EV_WRITE, simple_write_cb,
+ NULL);
+ t = evtimer_new(data->base, timeout_cb, NULL);
+
+ tt_assert(r);
+ tt_assert(w);
+ tt_assert(t);
+
+ evutil_gettimeofday(&now, NULL);
+ event_add(r, NULL);
+ event_add(t, &tv);
+
+ tt_assert( event_pending(r, EV_READ, NULL));
+ tt_assert(!event_pending(w, EV_WRITE, NULL));
+ tt_assert(!event_pending(r, EV_WRITE, NULL));
+ tt_assert( event_pending(r, EV_READ|EV_WRITE, NULL));
+ tt_assert(!event_pending(r, EV_TIMEOUT, NULL));
+ tt_assert( event_pending(t, EV_TIMEOUT, NULL));
+ tt_assert( event_pending(t, EV_TIMEOUT, &tv2));
+
+ tt_assert(evutil_timercmp(&tv2, &now, >));
+
+ test_timeval_diff_eq(&now, &tv2, 500);
+
+end:
+ if (r) {
+ event_del(r);
+ event_free(r);
+ }
+ if (w) {
+ event_del(w);
+ event_free(w);
+ }
+ if (t) {
+ event_del(t);
+ event_free(t);
+ }
+}
+
+#ifndef _WIN32
+/* You can't do this test on windows, since dup2 doesn't work on sockets */
+
+static void
+dfd_cb(evutil_socket_t fd, short e, void *data)
+{
+ *(int*)data = (int)e;
+}
+
+/* Regression test for our workaround for a fun epoll/linux related bug
+ * where fd2 = dup(fd1); add(fd2); close(fd2); dup2(fd1,fd2); add(fd2)
+ * will get you an EEXIST */
+static void
+test_dup_fd(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev1=NULL, *ev2=NULL;
+ int fd, dfd=-1;
+ int ev1_got, ev2_got;
+
+ tt_int_op(write(data->pair[0], "Hello world",
+ strlen("Hello world")), >, 0);
+ fd = data->pair[1];
+
+ dfd = dup(fd);
+ tt_int_op(dfd, >=, 0);
+
+ ev1 = event_new(base, fd, EV_READ|EV_PERSIST, dfd_cb, &ev1_got);
+ ev2 = event_new(base, dfd, EV_READ|EV_PERSIST, dfd_cb, &ev2_got);
+ ev1_got = ev2_got = 0;
+ event_add(ev1, NULL);
+ event_add(ev2, NULL);
+ event_base_loop(base, EVLOOP_ONCE);
+ tt_int_op(ev1_got, ==, EV_READ);
+ tt_int_op(ev2_got, ==, EV_READ);
+
+ /* Now close and delete dfd then dispatch. We need to do the
+ * dispatch here so that when we add it later, we think there
+ * was an intermediate delete. */
+ close(dfd);
+ event_del(ev2);
+ ev1_got = ev2_got = 0;
+ event_base_loop(base, EVLOOP_ONCE);
+ tt_want_int_op(ev1_got, ==, EV_READ);
+ tt_int_op(ev2_got, ==, 0);
+
+ /* Re-duplicate the fd. We need to get the same duplicated
+ * value that we closed to provoke the epoll quirk. Also, we
+ * need to change the events to write, or else the old lingering
+ * read event will make the test pass whether the change was
+ * successful or not. */
+ tt_int_op(dup2(fd, dfd), ==, dfd);
+ event_free(ev2);
+ ev2 = event_new(base, dfd, EV_WRITE|EV_PERSIST, dfd_cb, &ev2_got);
+ event_add(ev2, NULL);
+ ev1_got = ev2_got = 0;
+ event_base_loop(base, EVLOOP_ONCE);
+ tt_want_int_op(ev1_got, ==, EV_READ);
+ tt_int_op(ev2_got, ==, EV_WRITE);
+
+end:
+ if (ev1)
+ event_free(ev1);
+ if (ev2)
+ event_free(ev2);
+ if (dfd >= 0)
+ close(dfd);
+}
+#endif
+
+#ifdef EVENT__DISABLE_MM_REPLACEMENT
+static void
+test_mm_functions(void *arg)
+{
+ tinytest_set_test_skipped_();
+}
+#else
+static int
+check_dummy_mem_ok(void *mem_)
+{
+ char *mem = mem_;
+ mem -= 16;
+ return !memcmp(mem, "{[<guardedram>]}", 16);
+}
+
+static void *
+dummy_malloc(size_t len)
+{
+ char *mem = malloc(len+16);
+ memcpy(mem, "{[<guardedram>]}", 16);
+ return mem+16;
+}
+
+static void *
+dummy_realloc(void *mem_, size_t len)
+{
+ char *mem = mem_;
+ if (!mem)
+ return dummy_malloc(len);
+ tt_want(check_dummy_mem_ok(mem_));
+ mem -= 16;
+ mem = realloc(mem, len+16);
+ return mem+16;
+}
+
+static void
+dummy_free(void *mem_)
+{
+ char *mem = mem_;
+ tt_want(check_dummy_mem_ok(mem_));
+ mem -= 16;
+ free(mem);
+}
+
+static void
+test_mm_functions(void *arg)
+{
+ struct event_base *b = NULL;
+ struct event_config *cfg = NULL;
+ event_set_mem_functions(dummy_malloc, dummy_realloc, dummy_free);
+ cfg = event_config_new();
+ event_config_avoid_method(cfg, "Nonesuch");
+ b = event_base_new_with_config(cfg);
+ tt_assert(b);
+ tt_assert(check_dummy_mem_ok(b));
+end:
+ if (cfg)
+ event_config_free(cfg);
+ if (b)
+ event_base_free(b);
+}
+#endif
+
+static void
+many_event_cb(evutil_socket_t fd, short event, void *arg)
+{
+ int *calledp = arg;
+ *calledp += 1;
+}
+
+static void
+test_many_events(void *arg)
+{
+ /* Try 70 events that should all be ready at once. This will
+ * exercise the "resize" code on most of the backends, and will make
+ * sure that we can get past the 64-handle limit of some windows
+ * functions. */
+#define MANY 70
+
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ int one_at_a_time = data->setup_data != NULL;
+ evutil_socket_t sock[MANY];
+ struct event *ev[MANY];
+ int called[MANY];
+ int i;
+ int loopflags = EVLOOP_NONBLOCK, evflags=0;
+ if (one_at_a_time) {
+ loopflags |= EVLOOP_ONCE;
+ evflags = EV_PERSIST;
+ }
+
+ memset(sock, 0xff, sizeof(sock));
+ memset(ev, 0, sizeof(ev));
+ memset(called, 0, sizeof(called));
+
+ for (i = 0; i < MANY; ++i) {
+ /* We need an event that will hit the backend, and that will
+ * be ready immediately. "Send a datagram" is an easy
+ * instance of that. */
+ sock[i] = socket(AF_INET, SOCK_DGRAM, 0);
+ tt_assert(sock[i] >= 0);
+ called[i] = 0;
+ ev[i] = event_new(base, sock[i], EV_WRITE|evflags,
+ many_event_cb, &called[i]);
+ event_add(ev[i], NULL);
+ if (one_at_a_time)
+ event_base_loop(base, EVLOOP_NONBLOCK|EVLOOP_ONCE);
+ }
+
+ event_base_loop(base, loopflags);
+
+ for (i = 0; i < MANY; ++i) {
+ if (one_at_a_time)
+ tt_int_op(called[i], ==, MANY - i + 1);
+ else
+ tt_int_op(called[i], ==, 1);
+ }
+
+end:
+ for (i = 0; i < MANY; ++i) {
+ if (ev[i])
+ event_free(ev[i]);
+ if (sock[i] >= 0)
+ evutil_closesocket(sock[i]);
+ }
+#undef MANY
+}
+
+static void
+test_struct_event_size(void *arg)
+{
+ tt_int_op(event_get_struct_event_size(), <=, sizeof(struct event));
+end:
+ ;
+}
+
+static void
+test_get_assignment(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev1 = NULL;
+ const char *str = "foo";
+
+ struct event_base *b;
+ evutil_socket_t s;
+ short what;
+ event_callback_fn cb;
+ void *cb_arg;
+
+ ev1 = event_new(base, data->pair[1], EV_READ, dummy_read_cb, (void*)str);
+ event_get_assignment(ev1, &b, &s, &what, &cb, &cb_arg);
+
+ tt_ptr_op(b, ==, base);
+ tt_int_op(s, ==, data->pair[1]);
+ tt_int_op(what, ==, EV_READ);
+ tt_ptr_op(cb, ==, dummy_read_cb);
+ tt_ptr_op(cb_arg, ==, str);
+
+ /* Now make sure this doesn't crash. */
+ event_get_assignment(ev1, NULL, NULL, NULL, NULL, NULL);
+
+end:
+ if (ev1)
+ event_free(ev1);
+}
+
+struct foreach_helper {
+ int count;
+ const struct event *ev;
+};
+
+static int
+foreach_count_cb(const struct event_base *base, const struct event *ev, void *arg)
+{
+ struct foreach_helper *h = event_get_callback_arg(ev);
+ struct timeval *tv = arg;
+ if (event_get_callback(ev) != timeout_cb)
+ return 0;
+ tt_ptr_op(event_get_base(ev), ==, base);
+ tt_int_op(tv->tv_sec, ==, 10);
+ h->ev = ev;
+ h->count++;
+ return 0;
+end:
+ return -1;
+}
+
+static int
+foreach_find_cb(const struct event_base *base, const struct event *ev, void *arg)
+{
+ const struct event **ev_out = arg;
+ struct foreach_helper *h = event_get_callback_arg(ev);
+ if (event_get_callback(ev) != timeout_cb)
+ return 0;
+ if (h->count == 99) {
+ *ev_out = ev;
+ return 101;
+ }
+ return 0;
+}
+
+static void
+test_event_foreach(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev[5];
+ struct foreach_helper visited[5];
+ int i;
+ struct timeval ten_sec = {10,0};
+ const struct event *ev_found = NULL;
+
+ for (i = 0; i < 5; ++i) {
+ visited[i].count = 0;
+ visited[i].ev = NULL;
+ ev[i] = event_new(base, -1, 0, timeout_cb, &visited[i]);
+ }
+
+ tt_int_op(-1, ==, event_base_foreach_event(NULL, foreach_count_cb, NULL));
+ tt_int_op(-1, ==, event_base_foreach_event(base, NULL, NULL));
+
+ event_add(ev[0], &ten_sec);
+ event_add(ev[1], &ten_sec);
+ event_active(ev[1], EV_TIMEOUT, 1);
+ event_active(ev[2], EV_TIMEOUT, 1);
+ event_add(ev[3], &ten_sec);
+ /* Don't touch ev[4]. */
+
+ tt_int_op(0, ==, event_base_foreach_event(base, foreach_count_cb,
+ &ten_sec));
+ tt_int_op(1, ==, visited[0].count);
+ tt_int_op(1, ==, visited[1].count);
+ tt_int_op(1, ==, visited[2].count);
+ tt_int_op(1, ==, visited[3].count);
+ tt_ptr_op(ev[0], ==, visited[0].ev);
+ tt_ptr_op(ev[1], ==, visited[1].ev);
+ tt_ptr_op(ev[2], ==, visited[2].ev);
+ tt_ptr_op(ev[3], ==, visited[3].ev);
+
+ visited[2].count = 99;
+ tt_int_op(101, ==, event_base_foreach_event(base, foreach_find_cb,
+ &ev_found));
+ tt_ptr_op(ev_found, ==, ev[2]);
+
+end:
+ for (i=0; i<5; ++i) {
+ event_free(ev[i]);
+ }
+}
+
+static struct event_base *cached_time_base = NULL;
+static int cached_time_reset = 0;
+static int cached_time_sleep = 0;
+static void
+cache_time_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct timeval *tv = arg;
+ tt_int_op(0, ==, event_base_gettimeofday_cached(cached_time_base, tv));
+ if (cached_time_sleep) {
+ struct timeval delay = { 0, 30*1000 };
+ evutil_usleep_(&delay);
+ }
+ if (cached_time_reset) {
+ event_base_update_cache_time(cached_time_base);
+ }
+end:
+ ;
+}
+
+static void
+test_gettimeofday_cached(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_config *cfg = NULL;
+ struct event_base *base = NULL;
+ struct timeval tv1, tv2, tv3, now;
+ struct event *ev1=NULL, *ev2=NULL, *ev3=NULL;
+ int cached_time_disable = strstr(data->setup_data, "disable") != NULL;
+
+ cfg = event_config_new();
+ if (cached_time_disable) {
+ event_config_set_flag(cfg, EVENT_BASE_FLAG_NO_CACHE_TIME);
+ }
+ cached_time_base = base = event_base_new_with_config(cfg);
+ tt_assert(base);
+
+ /* Try gettimeofday_cached outside of an event loop. */
+ evutil_gettimeofday(&now, NULL);
+ tt_int_op(0, ==, event_base_gettimeofday_cached(NULL, &tv1));
+ tt_int_op(0, ==, event_base_gettimeofday_cached(base, &tv2));
+ tt_int_op(timeval_msec_diff(&tv1, &tv2), <, 10);
+ tt_int_op(timeval_msec_diff(&tv1, &now), <, 10);
+
+ cached_time_reset = strstr(data->setup_data, "reset") != NULL;
+ cached_time_sleep = strstr(data->setup_data, "sleep") != NULL;
+
+ ev1 = event_new(base, -1, 0, cache_time_cb, &tv1);
+ ev2 = event_new(base, -1, 0, cache_time_cb, &tv2);
+ ev3 = event_new(base, -1, 0, cache_time_cb, &tv3);
+
+ event_active(ev1, EV_TIMEOUT, 1);
+ event_active(ev2, EV_TIMEOUT, 1);
+ event_active(ev3, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+
+ if (cached_time_reset && cached_time_sleep) {
+ tt_int_op(labs(timeval_msec_diff(&tv1,&tv2)), >, 10);
+ tt_int_op(labs(timeval_msec_diff(&tv2,&tv3)), >, 10);
+ } else if (cached_time_disable && cached_time_sleep) {
+ tt_int_op(labs(timeval_msec_diff(&tv1,&tv2)), >, 10);
+ tt_int_op(labs(timeval_msec_diff(&tv2,&tv3)), >, 10);
+ } else if (! cached_time_disable) {
+ tt_assert(evutil_timercmp(&tv1, &tv2, ==));
+ tt_assert(evutil_timercmp(&tv2, &tv3, ==));
+ }
+
+end:
+ if (ev1)
+ event_free(ev1);
+ if (ev2)
+ event_free(ev2);
+ if (ev3)
+ event_free(ev3);
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static void
+tabf_cb(evutil_socket_t fd, short what, void *arg)
+{
+ int *ptr = arg;
+ *ptr = what;
+ *ptr += 0x10000;
+}
+
+static void
+test_active_by_fd(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct event *ev1 = NULL, *ev2 = NULL, *ev3 = NULL, *ev4 = NULL;
+ int e1,e2,e3,e4;
+#ifndef _WIN32
+ struct event *evsig = NULL;
+ int es;
+#endif
+ struct timeval tenmin = { 600, 0 };
+
+ /* Ensure no crash on nonexistent FD. */
+ event_base_active_by_fd(base, 1000, EV_READ);
+
+ /* Ensure no crash on bogus FD. */
+ event_base_active_by_fd(base, -1, EV_READ);
+
+ /* Ensure no crash on nonexistent/bogus signal. */
+ event_base_active_by_signal(base, 1000);
+ event_base_active_by_signal(base, -1);
+
+ event_base_assert_ok_(base);
+
+ e1 = e2 = e3 = e4 = 0;
+ ev1 = event_new(base, data->pair[0], EV_READ, tabf_cb, &e1);
+ ev2 = event_new(base, data->pair[0], EV_WRITE, tabf_cb, &e2);
+ ev3 = event_new(base, data->pair[1], EV_READ, tabf_cb, &e3);
+ ev4 = event_new(base, data->pair[1], EV_READ, tabf_cb, &e4);
+ tt_assert(ev1);
+ tt_assert(ev2);
+ tt_assert(ev3);
+ tt_assert(ev4);
+#ifndef _WIN32
+ evsig = event_new(base, SIGHUP, EV_SIGNAL, tabf_cb, &es);
+ tt_assert(evsig);
+ event_add(evsig, &tenmin);
+#endif
+
+ event_add(ev1, &tenmin);
+ event_add(ev2, NULL);
+ event_add(ev3, NULL);
+ event_add(ev4, &tenmin);
+
+
+ event_base_assert_ok_(base);
+
+ /* Trigger 2, 3, 4 */
+ event_base_active_by_fd(base, data->pair[0], EV_WRITE);
+ event_base_active_by_fd(base, data->pair[1], EV_READ);
+#ifndef _WIN32
+ event_base_active_by_signal(base, SIGHUP);
+#endif
+
+ event_base_assert_ok_(base);
+
+ event_base_loop(base, EVLOOP_ONCE);
+
+ tt_int_op(e1, ==, 0);
+ tt_int_op(e2, ==, EV_WRITE | 0x10000);
+ tt_int_op(e3, ==, EV_READ | 0x10000);
+ /* Mask out EV_WRITE here, since it could be genuinely writeable. */
+ tt_int_op((e4 & ~EV_WRITE), ==, EV_READ | 0x10000);
+#ifndef _WIN32
+ tt_int_op(es, ==, EV_SIGNAL | 0x10000);
+#endif
+
+end:
+ if (ev1)
+ event_free(ev1);
+ if (ev2)
+ event_free(ev2);
+ if (ev3)
+ event_free(ev3);
+ if (ev4)
+ event_free(ev4);
+#ifndef _WIN32
+ if (evsig)
+ event_free(evsig);
+#endif
+}
+
+struct testcase_t main_testcases[] = {
+ /* Some converted-over tests */
+ { "methods", test_methods, TT_FORK, NULL, NULL },
+ { "version", test_version, 0, NULL, NULL },
+ BASIC(base_features, TT_FORK|TT_NO_LOGS),
+ { "base_environ", test_base_environ, TT_FORK, NULL, NULL },
+
+ BASIC(event_base_new, TT_FORK|TT_NEED_SOCKETPAIR),
+ BASIC(free_active_base, TT_FORK|TT_NEED_SOCKETPAIR),
+
+ BASIC(manipulate_active_events, TT_FORK|TT_NEED_BASE),
+ BASIC(event_new_selfarg, TT_FORK|TT_NEED_BASE),
+ BASIC(event_assign_selfarg, TT_FORK|TT_NEED_BASE),
+ BASIC(event_base_get_num_events, TT_FORK|TT_NEED_BASE),
+ BASIC(event_base_get_max_events, TT_FORK|TT_NEED_BASE),
+
+ BASIC(bad_assign, TT_FORK|TT_NEED_BASE|TT_NO_LOGS),
+ BASIC(bad_reentrant, TT_FORK|TT_NEED_BASE|TT_NO_LOGS),
+ BASIC(active_later, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+ BASIC(event_remove_timeout, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+
+ /* These are still using the old API */
+ LEGACY(persistent_timeout, TT_FORK|TT_NEED_BASE),
+ { "persistent_timeout_jump", test_persistent_timeout_jump, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "persistent_active_timeout", test_persistent_active_timeout,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ LEGACY(priorities, TT_FORK|TT_NEED_BASE),
+ BASIC(priority_active_inversion, TT_FORK|TT_NEED_BASE),
+ { "common_timeout", test_common_timeout, TT_FORK|TT_NEED_BASE,
+ &basic_setup, NULL },
+
+ /* These legacy tests may not all need all of these flags. */
+ LEGACY(simpleread, TT_ISOLATED),
+ LEGACY(simpleread_multiple, TT_ISOLATED),
+ LEGACY(simplewrite, TT_ISOLATED),
+ { "simpleclose", test_simpleclose, TT_FORK, &basic_setup,
+ NULL },
+ LEGACY(multiple, TT_ISOLATED),
+ LEGACY(persistent, TT_ISOLATED),
+ LEGACY(combined, TT_ISOLATED),
+ LEGACY(simpletimeout, TT_ISOLATED),
+ LEGACY(loopbreak, TT_ISOLATED),
+ LEGACY(loopexit, TT_ISOLATED),
+ LEGACY(loopexit_multiple, TT_ISOLATED),
+ LEGACY(nonpersist_readd, TT_ISOLATED),
+ LEGACY(multiple_events_for_same_fd, TT_ISOLATED),
+ LEGACY(want_only_once, TT_ISOLATED),
+ { "event_once", test_event_once, TT_ISOLATED, &basic_setup, NULL },
+ { "event_once_never", test_event_once_never, TT_ISOLATED, &basic_setup, NULL },
+ { "event_pending", test_event_pending, TT_ISOLATED, &basic_setup,
+ NULL },
+#ifndef _WIN32
+ { "dup_fd", test_dup_fd, TT_ISOLATED, &basic_setup, NULL },
+#endif
+ { "mm_functions", test_mm_functions, TT_FORK, NULL, NULL },
+ { "many_events", test_many_events, TT_ISOLATED, &basic_setup, NULL },
+ { "many_events_slow_add", test_many_events, TT_ISOLATED, &basic_setup, (void*)1 },
+
+ { "struct_event_size", test_struct_event_size, 0, NULL, NULL },
+ BASIC(get_assignment, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+
+ BASIC(event_foreach, TT_FORK|TT_NEED_BASE),
+ { "gettimeofday_cached", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"" },
+ { "gettimeofday_cached_sleep", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"sleep" },
+ { "gettimeofday_cached_reset", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"sleep reset" },
+ { "gettimeofday_cached_disabled", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"sleep disable" },
+ { "gettimeofday_cached_disabled_nosleep", test_gettimeofday_cached, TT_FORK, &basic_setup, (void*)"disable" },
+
+ BASIC(active_by_fd, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+
+#ifndef _WIN32
+ LEGACY(fork, TT_ISOLATED),
+#endif
+ END_OF_TESTCASES
+};
+
+struct testcase_t evtag_testcases[] = {
+ { "int", evtag_int_test, TT_FORK, NULL, NULL },
+ { "fuzz", evtag_fuzz, TT_FORK, NULL, NULL },
+ { "encoding", evtag_tag_encoding, TT_FORK, NULL, NULL },
+ { "peek", evtag_test_peek, 0, NULL, NULL },
+
+ END_OF_TESTCASES
+};
+
+struct testcase_t signal_testcases[] = {
+#ifndef _WIN32
+ LEGACY(simplesignal, TT_ISOLATED),
+ LEGACY(multiplesignal, TT_ISOLATED),
+ LEGACY(immediatesignal, TT_ISOLATED),
+ LEGACY(signal_dealloc, TT_ISOLATED),
+ LEGACY(signal_pipeloss, TT_ISOLATED),
+ LEGACY(signal_switchbase, TT_ISOLATED|TT_NO_LOGS),
+ LEGACY(signal_restore, TT_ISOLATED),
+ LEGACY(signal_assert, TT_ISOLATED),
+ LEGACY(signal_while_processing, TT_ISOLATED),
+#endif
+ END_OF_TESTCASES
+};
+
diff --git a/sntp/libevent/test/regress.gen.c b/sntp/libevent/test/regress.gen.c
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/sntp/libevent/test/regress.gen.c
@@ -0,0 +1 @@
+
diff --git a/sntp/libevent/test/regress.gen.h b/sntp/libevent/test/regress.gen.h
new file mode 100644
index 0000000..7130984
--- /dev/null
+++ b/sntp/libevent/test/regress.gen.h
@@ -0,0 +1 @@
+#define NO_PYTHON_EXISTS
diff --git a/sntp/libevent/test/regress.h b/sntp/libevent/test/regress.h
new file mode 100644
index 0000000..a9892b0
--- /dev/null
+++ b/sntp/libevent/test/regress.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef REGRESS_H_INCLUDED_
+#define REGRESS_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+extern struct testcase_t main_testcases[];
+extern struct testcase_t evtag_testcases[];
+extern struct testcase_t evbuffer_testcases[];
+extern struct testcase_t finalize_testcases[];
+extern struct testcase_t bufferevent_testcases[];
+extern struct testcase_t bufferevent_iocp_testcases[];
+extern struct testcase_t util_testcases[];
+extern struct testcase_t signal_testcases[];
+extern struct testcase_t http_testcases[];
+extern struct testcase_t dns_testcases[];
+extern struct testcase_t rpc_testcases[];
+extern struct testcase_t edgetriggered_testcases[];
+extern struct testcase_t minheap_testcases[];
+extern struct testcase_t iocp_testcases[];
+extern struct testcase_t ssl_testcases[];
+extern struct testcase_t listener_testcases[];
+extern struct testcase_t listener_iocp_testcases[];
+extern struct testcase_t thread_testcases[];
+
+void regress_threads(void *);
+void test_bufferevent_zlib(void *);
+
+/* Helpers to wrap old testcases */
+extern evutil_socket_t pair[2];
+extern int test_ok;
+extern int called;
+extern struct event_base *global_base;
+extern int in_legacy_test_wrapper;
+
+int regress_make_tmpfile(const void *data, size_t datalen, char **filename_out);
+
+struct basic_test_data {
+ struct event_base *base;
+ evutil_socket_t pair[2];
+
+ void (*legacy_test_fn)(void);
+
+ void *setup_data;
+};
+extern const struct testcase_setup_t basic_setup;
+
+
+extern const struct testcase_setup_t legacy_setup;
+void run_legacy_test_fn(void *ptr);
+
+extern int libevent_tests_running_in_debug_mode;
+
+/* A couple of flags that basic/legacy_setup can support. */
+#define TT_NEED_SOCKETPAIR TT_FIRST_USER_FLAG
+#define TT_NEED_BASE (TT_FIRST_USER_FLAG<<1)
+#define TT_NEED_DNS (TT_FIRST_USER_FLAG<<2)
+#define TT_LEGACY (TT_FIRST_USER_FLAG<<3)
+#define TT_NEED_THREADS (TT_FIRST_USER_FLAG<<4)
+#define TT_NO_LOGS (TT_FIRST_USER_FLAG<<5)
+#define TT_ENABLE_IOCP_FLAG (TT_FIRST_USER_FLAG<<6)
+#define TT_ENABLE_IOCP (TT_ENABLE_IOCP_FLAG|TT_NEED_THREADS)
+
+/* All the flags that a legacy test needs. */
+#define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE
+
+
+#define BASIC(name,flags) \
+ { #name, test_## name, flags, &basic_setup, NULL }
+
+#define LEGACY(name,flags) \
+ { #name, run_legacy_test_fn, flags|TT_LEGACY, &legacy_setup, \
+ test_## name }
+
+struct evutil_addrinfo;
+struct evutil_addrinfo *ai_find_by_family(struct evutil_addrinfo *ai, int f);
+struct evutil_addrinfo *ai_find_by_protocol(struct evutil_addrinfo *ai, int p);
+int test_ai_eq_(const struct evutil_addrinfo *ai, const char *sockaddr_port,
+ int socktype, int protocol, int line);
+
+#define test_ai_eq(ai, str, s, p) do { \
+ if (test_ai_eq_((ai), (str), (s), (p), __LINE__)<0) \
+ goto end; \
+ } while (0)
+
+#define test_timeval_diff_leq(tv1, tv2, diff, tolerance) \
+ tt_int_op(abs(timeval_msec_diff((tv1), (tv2)) - diff), <=, tolerance)
+
+#define test_timeval_diff_eq(tv1, tv2, diff) \
+ test_timeval_diff_leq((tv1), (tv2), (diff), 50)
+
+long timeval_msec_diff(const struct timeval *start, const struct timeval *end);
+
+#ifndef _WIN32
+pid_t regress_fork(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* REGRESS_H_INCLUDED_ */
diff --git a/sntp/libevent/test/regress.rpc b/sntp/libevent/test/regress.rpc
new file mode 100644
index 0000000..0ee904e
--- /dev/null
+++ b/sntp/libevent/test/regress.rpc
@@ -0,0 +1,25 @@
+/* tests data packing and unpacking */
+
+struct msg {
+ string /* sender */ from_name = 1; /* be verbose */
+ string to_name = 2;
+ optional struct[kill] attack = 3;
+ array struct[run] run = 4;
+}
+
+struct kill {
+ string weapon = 0x10121;
+ string action = 2;
+ array int how_often = 3;
+}
+
+struct run {
+ string how = 1;
+ optional bytes some_bytes = 2;
+
+ bytes fixed_bytes[24] = 3;
+ array string notes = 4;
+
+ optional int64 large_number = 5;
+ array int other_numbers = 6;
+}
diff --git a/sntp/libevent/test/regress_buffer.c b/sntp/libevent/test/regress_buffer.c
new file mode 100644
index 0000000..ccb1487
--- /dev/null
+++ b/sntp/libevent/test/regress_buffer.c
@@ -0,0 +1,2240 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#include "event2/event.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/util.h"
+
+#include "defer-internal.h"
+#include "evbuffer-internal.h"
+#include "log-internal.h"
+
+#include "regress.h"
+
+/* Validates that an evbuffer is good. Returns false if it isn't, true if it
+ * is*/
+static int
+evbuffer_validate_(struct evbuffer *buf)
+{
+ struct evbuffer_chain *chain;
+ size_t sum = 0;
+ int found_last_with_datap = 0;
+
+ if (buf->first == NULL) {
+ tt_assert(buf->last == NULL);
+ tt_assert(buf->total_len == 0);
+ }
+
+ chain = buf->first;
+
+ tt_assert(buf->last_with_datap);
+ if (buf->last_with_datap == &buf->first)
+ found_last_with_datap = 1;
+
+ while (chain != NULL) {
+ if (&chain->next == buf->last_with_datap)
+ found_last_with_datap = 1;
+ sum += chain->off;
+ if (chain->next == NULL) {
+ tt_assert(buf->last == chain);
+ }
+ tt_assert(chain->buffer_len >= chain->misalign + chain->off);
+ chain = chain->next;
+ }
+
+ if (buf->first)
+ tt_assert(*buf->last_with_datap);
+
+ if (*buf->last_with_datap) {
+ chain = *buf->last_with_datap;
+ if (chain->off == 0 || buf->total_len == 0) {
+ tt_assert(chain->off == 0)
+ tt_assert(chain == buf->first);
+ tt_assert(buf->total_len == 0);
+ }
+ chain = chain->next;
+ while (chain != NULL) {
+ tt_assert(chain->off == 0);
+ chain = chain->next;
+ }
+ } else {
+ tt_assert(buf->last_with_datap == &buf->first);
+ }
+ tt_assert(found_last_with_datap);
+
+ tt_assert(sum == buf->total_len);
+ return 1;
+ end:
+ return 0;
+}
+
+static void
+evbuffer_get_waste(struct evbuffer *buf, size_t *allocatedp, size_t *wastedp, size_t *usedp)
+{
+ struct evbuffer_chain *chain;
+ size_t a, w, u;
+ int n = 0;
+ u = a = w = 0;
+
+ chain = buf->first;
+ /* skip empty at start */
+ while (chain && chain->off==0) {
+ ++n;
+ a += chain->buffer_len;
+ chain = chain->next;
+ }
+ /* first nonempty chain: stuff at the end only is wasted. */
+ if (chain) {
+ ++n;
+ a += chain->buffer_len;
+ u += chain->off;
+ if (chain->next && chain->next->off)
+ w += (size_t)(chain->buffer_len - (chain->misalign + chain->off));
+ chain = chain->next;
+ }
+ /* subsequent nonempty chains */
+ while (chain && chain->off) {
+ ++n;
+ a += chain->buffer_len;
+ w += (size_t)chain->misalign;
+ u += chain->off;
+ if (chain->next && chain->next->off)
+ w += (size_t) (chain->buffer_len - (chain->misalign + chain->off));
+ chain = chain->next;
+ }
+ /* subsequent empty chains */
+ while (chain) {
+ ++n;
+ a += chain->buffer_len;
+ }
+ *allocatedp = a;
+ *wastedp = w;
+ *usedp = u;
+}
+
+#define evbuffer_validate(buf) \
+ TT_STMT_BEGIN if (!evbuffer_validate_(buf)) TT_DIE(("Buffer format invalid")); TT_STMT_END
+
+static void
+test_evbuffer(void *ptr)
+{
+ static char buffer[512], *tmp;
+ struct evbuffer *evb = evbuffer_new();
+ struct evbuffer *evb_two = evbuffer_new();
+ size_t sz_tmp;
+ int i;
+
+ evbuffer_validate(evb);
+ evbuffer_add_printf(evb, "%s/%d", "hello", 1);
+ evbuffer_validate(evb);
+
+ tt_assert(evbuffer_get_length(evb) == 7);
+ tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "hello/1", 1));
+
+ evbuffer_add_buffer(evb, evb_two);
+ evbuffer_validate(evb);
+
+ evbuffer_drain(evb, strlen("hello/"));
+ evbuffer_validate(evb);
+ tt_assert(evbuffer_get_length(evb) == 1);
+ tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1", 1));
+
+ evbuffer_add_printf(evb_two, "%s", "/hello");
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_two);
+ evbuffer_validate(evb);
+
+ tt_assert(evbuffer_get_length(evb_two) == 0);
+ tt_assert(evbuffer_get_length(evb) == 7);
+ tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1/hello", 7) != 0);
+
+ memset(buffer, 0, sizeof(buffer));
+ evbuffer_add(evb, buffer, sizeof(buffer));
+ evbuffer_validate(evb);
+ tt_assert(evbuffer_get_length(evb) == 7 + 512);
+
+ tmp = (char *)evbuffer_pullup(evb, 7 + 512);
+ tt_assert(tmp);
+ tt_assert(!strncmp(tmp, "1/hello", 7));
+ tt_assert(!memcmp(tmp + 7, buffer, sizeof(buffer)));
+ evbuffer_validate(evb);
+
+ evbuffer_prepend(evb, "something", 9);
+ evbuffer_validate(evb);
+ evbuffer_prepend(evb, "else", 4);
+ evbuffer_validate(evb);
+
+ tmp = (char *)evbuffer_pullup(evb, 4 + 9 + 7);
+ tt_assert(!strncmp(tmp, "elsesomething1/hello", 4 + 9 + 7));
+ evbuffer_validate(evb);
+
+ evbuffer_drain(evb, -1);
+ evbuffer_validate(evb);
+ evbuffer_drain(evb_two, -1);
+ evbuffer_validate(evb);
+
+ for (i = 0; i < 3; ++i) {
+ evbuffer_add(evb_two, buffer, sizeof(buffer));
+ evbuffer_validate(evb_two);
+ evbuffer_add_buffer(evb, evb_two);
+ evbuffer_validate(evb);
+ evbuffer_validate(evb_two);
+ }
+
+ tt_assert(evbuffer_get_length(evb_two) == 0);
+ tt_assert(evbuffer_get_length(evb) == i * sizeof(buffer));
+
+ /* test remove buffer */
+ sz_tmp = (size_t)(sizeof(buffer)*2.5);
+ evbuffer_remove_buffer(evb, evb_two, sz_tmp);
+ tt_assert(evbuffer_get_length(evb_two) == sz_tmp);
+ tt_assert(evbuffer_get_length(evb) == sizeof(buffer) / 2);
+ evbuffer_validate(evb);
+
+ if (memcmp(evbuffer_pullup(
+ evb, -1), buffer, sizeof(buffer) / 2) != 0 ||
+ memcmp(evbuffer_pullup(
+ evb_two, -1), buffer, sizeof(buffer) != 0))
+ tt_abort_msg("Pullup did not preserve content");
+
+ evbuffer_validate(evb);
+
+
+ /* testing one-vector reserve and commit */
+ {
+ struct evbuffer_iovec v[1];
+ char *buf;
+ int i, j, r;
+
+ for (i = 0; i < 3; ++i) {
+ r = evbuffer_reserve_space(evb, 10000, v, 1);
+ tt_int_op(r, ==, 1);
+ tt_assert(v[0].iov_len >= 10000);
+ tt_assert(v[0].iov_base != NULL);
+
+ evbuffer_validate(evb);
+ buf = v[0].iov_base;
+ for (j = 0; j < 10000; ++j) {
+ buf[j] = j;
+ }
+ evbuffer_validate(evb);
+
+ tt_int_op(evbuffer_commit_space(evb, v, 1), ==, 0);
+ evbuffer_validate(evb);
+
+ tt_assert(evbuffer_get_length(evb) >= 10000);
+
+ evbuffer_drain(evb, j * 5000);
+ evbuffer_validate(evb);
+ }
+ }
+
+ end:
+ evbuffer_free(evb);
+ evbuffer_free(evb_two);
+}
+
+static void
+no_cleanup(const void *data, size_t datalen, void *extra)
+{
+}
+
+static void
+test_evbuffer_remove_buffer_with_empty(void *ptr)
+{
+ struct evbuffer *src = evbuffer_new();
+ struct evbuffer *dst = evbuffer_new();
+ char buf[2];
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ /* setup the buffers */
+ /* we need more data in src than we will move later */
+ evbuffer_add_reference(src, buf, sizeof(buf), no_cleanup, NULL);
+ evbuffer_add_reference(src, buf, sizeof(buf), no_cleanup, NULL);
+ /* we need one buffer in dst and one empty buffer at the end */
+ evbuffer_add(dst, buf, sizeof(buf));
+ evbuffer_add_reference(dst, buf, 0, no_cleanup, NULL);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ /* move three bytes over */
+ evbuffer_remove_buffer(src, dst, 3);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+end:
+ evbuffer_free(src);
+ evbuffer_free(dst);
+}
+
+static void
+test_evbuffer_reserve2(void *ptr)
+{
+ /* Test the two-vector cases of reserve/commit. */
+ struct evbuffer *buf = evbuffer_new();
+ int n, i;
+ struct evbuffer_iovec v[2];
+ size_t remaining;
+ char *cp, *cp2;
+
+ /* First chunk will necessarily be one chunk. Use 512 bytes of it.*/
+ n = evbuffer_reserve_space(buf, 1024, v, 2);
+ tt_int_op(n, ==, 1);
+ tt_int_op(evbuffer_get_length(buf), ==, 0);
+ tt_assert(v[0].iov_base != NULL);
+ tt_int_op(v[0].iov_len, >=, 1024);
+ memset(v[0].iov_base, 'X', 512);
+ cp = v[0].iov_base;
+ remaining = v[0].iov_len - 512;
+ v[0].iov_len = 512;
+ evbuffer_validate(buf);
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 1));
+ tt_int_op(evbuffer_get_length(buf), ==, 512);
+ evbuffer_validate(buf);
+
+ /* Ask for another same-chunk request, in an existing chunk. Use 8
+ * bytes of it. */
+ n = evbuffer_reserve_space(buf, 32, v, 2);
+ tt_int_op(n, ==, 1);
+ tt_assert(cp + 512 == v[0].iov_base);
+ tt_int_op(remaining, ==, v[0].iov_len);
+ memset(v[0].iov_base, 'Y', 8);
+ v[0].iov_len = 8;
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 1));
+ tt_int_op(evbuffer_get_length(buf), ==, 520);
+ remaining -= 8;
+ evbuffer_validate(buf);
+
+ /* Now ask for a request that will be split. Use only one byte of it,
+ though. */
+ n = evbuffer_reserve_space(buf, remaining+64, v, 2);
+ tt_int_op(n, ==, 2);
+ tt_assert(cp + 520 == v[0].iov_base);
+ tt_int_op(remaining, ==, v[0].iov_len);
+ tt_assert(v[1].iov_base);
+ tt_assert(v[1].iov_len >= 64);
+ cp2 = v[1].iov_base;
+ memset(v[0].iov_base, 'Z', 1);
+ v[0].iov_len = 1;
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 1));
+ tt_int_op(evbuffer_get_length(buf), ==, 521);
+ remaining -= 1;
+ evbuffer_validate(buf);
+
+ /* Now ask for a request that will be split. Use some of the first
+ * part and some of the second. */
+ n = evbuffer_reserve_space(buf, remaining+64, v, 2);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 2);
+ tt_assert(cp + 521 == v[0].iov_base);
+ tt_int_op(remaining, ==, v[0].iov_len);
+ tt_assert(v[1].iov_base == cp2);
+ tt_assert(v[1].iov_len >= 64);
+ memset(v[0].iov_base, 'W', 400);
+ v[0].iov_len = 400;
+ memset(v[1].iov_base, 'x', 60);
+ v[1].iov_len = 60;
+ tt_int_op(0, ==, evbuffer_commit_space(buf, v, 2));
+ tt_int_op(evbuffer_get_length(buf), ==, 981);
+ evbuffer_validate(buf);
+
+ /* Now peek to make sure stuff got made how we like. */
+ memset(v,0,sizeof(v));
+ n = evbuffer_peek(buf, -1, NULL, v, 2);
+ tt_int_op(n, ==, 2);
+ tt_int_op(v[0].iov_len, ==, 921);
+ tt_int_op(v[1].iov_len, ==, 60);
+
+ cp = v[0].iov_base;
+ for (i=0; i<512; ++i)
+ tt_int_op(cp[i], ==, 'X');
+ for (i=512; i<520; ++i)
+ tt_int_op(cp[i], ==, 'Y');
+ for (i=520; i<521; ++i)
+ tt_int_op(cp[i], ==, 'Z');
+ for (i=521; i<921; ++i)
+ tt_int_op(cp[i], ==, 'W');
+
+ cp = v[1].iov_base;
+ for (i=0; i<60; ++i)
+ tt_int_op(cp[i], ==, 'x');
+
+end:
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_reserve_many(void *ptr)
+{
+ /* This is a glass-box test to handle expanding a buffer with more
+ * chunks and reallocating chunks as needed */
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer_iovec v[8];
+ int n;
+ size_t sz;
+ int add_data = ptr && !strcmp(ptr, "add");
+ int fill_first = ptr && !strcmp(ptr, "fill");
+ char *cp1, *cp2;
+
+ /* When reserving the the first chunk, we just allocate it */
+ n = evbuffer_reserve_space(buf, 128, v, 2);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 1);
+ tt_assert(v[0].iov_len >= 128);
+ sz = v[0].iov_len;
+ cp1 = v[0].iov_base;
+ if (add_data) {
+ *(char*)v[0].iov_base = 'X';
+ v[0].iov_len = 1;
+ n = evbuffer_commit_space(buf, v, 1);
+ tt_int_op(n, ==, 0);
+ } else if (fill_first) {
+ memset(v[0].iov_base, 'X', v[0].iov_len);
+ n = evbuffer_commit_space(buf, v, 1);
+ tt_int_op(n, ==, 0);
+ n = evbuffer_reserve_space(buf, 128, v, 2);
+ tt_int_op(n, ==, 1);
+ sz = v[0].iov_len;
+ tt_assert(v[0].iov_base != cp1);
+ cp1 = v[0].iov_base;
+ }
+
+ /* Make another chunk get added. */
+ n = evbuffer_reserve_space(buf, sz+128, v, 2);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 2);
+ sz = v[0].iov_len + v[1].iov_len;
+ tt_int_op(sz, >=, v[0].iov_len+128);
+ if (add_data) {
+ tt_assert(v[0].iov_base == cp1 + 1);
+ } else {
+ tt_assert(v[0].iov_base == cp1);
+ }
+ cp1 = v[0].iov_base;
+ cp2 = v[1].iov_base;
+
+ /* And a third chunk. */
+ n = evbuffer_reserve_space(buf, sz+128, v, 3);
+ evbuffer_validate(buf);
+ tt_int_op(n, ==, 3);
+ tt_assert(cp1 == v[0].iov_base);
+ tt_assert(cp2 == v[1].iov_base);
+ sz = v[0].iov_len + v[1].iov_len + v[2].iov_len;
+
+ /* Now force a reallocation by asking for more space in only 2
+ * buffers. */
+ n = evbuffer_reserve_space(buf, sz+128, v, 2);
+ evbuffer_validate(buf);
+ if (add_data) {
+ tt_int_op(n, ==, 2);
+ tt_assert(cp1 == v[0].iov_base);
+ } else {
+ tt_int_op(n, ==, 1);
+ }
+
+end:
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_expand(void *ptr)
+{
+ char data[4096];
+ struct evbuffer *buf;
+ size_t a,w,u;
+ void *buffer;
+
+ memset(data, 'X', sizeof(data));
+
+ /* Make sure that expand() works on an empty buffer */
+ buf = evbuffer_new();
+ tt_int_op(evbuffer_expand(buf, 20000), ==, 0);
+ evbuffer_validate(buf);
+ a=w=u=0;
+ evbuffer_get_waste(buf, &a,&w,&u);
+ tt_assert(w == 0);
+ tt_assert(u == 0);
+ tt_assert(a >= 20000);
+ tt_assert(buf->first);
+ tt_assert(buf->first == buf->last);
+ tt_assert(buf->first->off == 0);
+ tt_assert(buf->first->buffer_len >= 20000);
+
+ /* Make sure that expand() works as a no-op when there's enough
+ * contiguous space already. */
+ buffer = buf->first->buffer;
+ evbuffer_add(buf, data, 1024);
+ tt_int_op(evbuffer_expand(buf, 1024), ==, 0);
+ tt_assert(buf->first->buffer == buffer);
+ evbuffer_validate(buf);
+ evbuffer_free(buf);
+
+ /* Make sure that expand() can work by moving misaligned data
+ * when it makes sense to do so. */
+ buf = evbuffer_new();
+ evbuffer_add(buf, data, 400);
+ {
+ int n = (int)(buf->first->buffer_len - buf->first->off - 1);
+ tt_assert(n < (int)sizeof(data));
+ evbuffer_add(buf, data, n);
+ }
+ tt_assert(buf->first == buf->last);
+ tt_assert(buf->first->off == buf->first->buffer_len - 1);
+ evbuffer_drain(buf, buf->first->off - 1);
+ tt_assert(1 == evbuffer_get_length(buf));
+ tt_assert(buf->first->misalign > 0);
+ tt_assert(buf->first->off == 1);
+ buffer = buf->first->buffer;
+ tt_assert(evbuffer_expand(buf, 40) == 0);
+ tt_assert(buf->first == buf->last);
+ tt_assert(buf->first->off == 1);
+ tt_assert(buf->first->buffer == buffer);
+ tt_assert(buf->first->misalign == 0);
+ evbuffer_validate(buf);
+ evbuffer_free(buf);
+
+ /* add, expand, pull-up: This used to crash libevent. */
+ buf = evbuffer_new();
+
+ evbuffer_add(buf, data, sizeof(data));
+ evbuffer_add(buf, data, sizeof(data));
+ evbuffer_add(buf, data, sizeof(data));
+
+ evbuffer_validate(buf);
+ evbuffer_expand(buf, 1024);
+ evbuffer_validate(buf);
+ evbuffer_pullup(buf, -1);
+ evbuffer_validate(buf);
+
+end:
+ evbuffer_free(buf);
+}
+
+
+static int reference_cb_called;
+static void
+reference_cb(const void *data, size_t len, void *extra)
+{
+ tt_str_op(data, ==, "this is what we add as read-only memory.");
+ tt_int_op(len, ==, strlen(data));
+ tt_want(extra == (void *)0xdeadaffe);
+ ++reference_cb_called;
+end:
+ ;
+}
+
+static void
+test_evbuffer_reference(void *ptr)
+{
+ struct evbuffer *src = evbuffer_new();
+ struct evbuffer *dst = evbuffer_new();
+ struct evbuffer_iovec v[1];
+ const char *data = "this is what we add as read-only memory.";
+ reference_cb_called = 0;
+
+ tt_assert(evbuffer_add_reference(src, data, strlen(data),
+ reference_cb, (void *)0xdeadaffe) != -1);
+
+ evbuffer_reserve_space(dst, strlen(data), v, 1);
+ tt_assert(evbuffer_remove(src, v[0].iov_base, 10) != -1);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ /* make sure that we don't write data at the beginning */
+ evbuffer_prepend(src, "aaaaa", 5);
+ evbuffer_validate(src);
+ evbuffer_drain(src, 5);
+
+ tt_assert(evbuffer_remove(src, ((char*)(v[0].iov_base)) + 10,
+ strlen(data) - 10) != -1);
+
+ v[0].iov_len = strlen(data);
+
+ evbuffer_commit_space(dst, v, 1);
+ evbuffer_validate(src);
+ evbuffer_validate(dst);
+
+ tt_int_op(reference_cb_called, ==, 1);
+
+ tt_assert(!memcmp(evbuffer_pullup(dst, strlen(data)),
+ data, strlen(data)));
+ evbuffer_validate(dst);
+
+ end:
+ evbuffer_free(dst);
+ evbuffer_free(src);
+}
+
+static struct event_base *addfile_test_event_base = NULL;
+static int addfile_test_done_writing = 0;
+static int addfile_test_total_written = 0;
+static int addfile_test_total_read = 0;
+
+static void
+addfile_test_writecb(evutil_socket_t fd, short what, void *arg)
+{
+ struct evbuffer *b = arg;
+ int r;
+ evbuffer_validate(b);
+ while (evbuffer_get_length(b)) {
+ r = evbuffer_write(b, fd);
+ if (r > 0) {
+ addfile_test_total_written += r;
+ TT_BLATHER(("Wrote %d/%d bytes", r, addfile_test_total_written));
+ } else {
+ int e = evutil_socket_geterror(fd);
+ if (EVUTIL_ERR_RW_RETRIABLE(e))
+ return;
+ tt_fail_perror("write");
+ event_base_loopexit(addfile_test_event_base,NULL);
+ }
+ evbuffer_validate(b);
+ }
+ addfile_test_done_writing = 1;
+ return;
+end:
+ event_base_loopexit(addfile_test_event_base,NULL);
+}
+
+static void
+addfile_test_readcb(evutil_socket_t fd, short what, void *arg)
+{
+ struct evbuffer *b = arg;
+ int e, r = 0;
+ do {
+ r = evbuffer_read(b, fd, 1024);
+ if (r > 0) {
+ addfile_test_total_read += r;
+ TT_BLATHER(("Read %d/%d bytes", r, addfile_test_total_read));
+ }
+ } while (r > 0);
+ if (r < 0) {
+ e = evutil_socket_geterror(fd);
+ if (! EVUTIL_ERR_RW_RETRIABLE(e)) {
+ tt_fail_perror("read");
+ event_base_loopexit(addfile_test_event_base,NULL);
+ }
+ }
+ if (addfile_test_done_writing &&
+ addfile_test_total_read >= addfile_test_total_written) {
+ event_base_loopexit(addfile_test_event_base,NULL);
+ }
+}
+
+static void
+test_evbuffer_add_file(void *ptr)
+{
+ struct basic_test_data *testdata = ptr;
+ const char *impl = testdata->setup_data;
+ struct evbuffer *src = evbuffer_new(), *dest = evbuffer_new();
+ char *tmpfilename = NULL;
+ char *data = NULL;
+ const char *expect_data;
+ size_t datalen, expect_len;
+ const char *compare;
+ int fd = -1;
+ int want_ismapping = -1, want_cansendfile = -1;
+ unsigned flags = 0;
+ int use_segment = 1, use_bigfile = 0, map_from_offset = 0,
+ view_from_offset = 0;
+ struct evbuffer_file_segment *seg = NULL;
+ ev_off_t starting_offset = 0, mapping_len = -1;
+ ev_off_t segment_offset = 0, segment_len = -1;
+ struct event *rev=NULL, *wev=NULL;
+ struct event_base *base = testdata->base;
+ evutil_socket_t pair[2] = {-1, -1};
+ struct evutil_weakrand_state seed = { 123456789U };
+
+ /* This test is highly parameterized based on substrings of its
+ * argument. The strings are: */
+ tt_assert(impl);
+ if (strstr(impl, "nosegment")) {
+ /* If nosegment is set, use the older evbuffer_add_file
+ * interface */
+ use_segment = 0;
+ }
+ if (strstr(impl, "bigfile")) {
+ /* If bigfile is set, use a 512K file. Else use a smaller
+ * one. */
+ use_bigfile = 1;
+ }
+ if (strstr(impl, "map_offset")) {
+ /* If map_offset is set, we build the file segment starting
+ * from a point other than byte 0 and ending somewhere other
+ * than the last byte. Otherwise we map the whole thing */
+ map_from_offset = 1;
+ }
+ if (strstr(impl, "offset_in_segment")) {
+ /* If offset_in_segment is set, we add a subsection of the
+ * file semgment starting from a point other than byte 0 of
+ * the segment. */
+ view_from_offset = 1;
+ }
+ if (strstr(impl, "sendfile")) {
+ /* If sendfile is set, we try to use a sendfile/splice style
+ * backend. */
+ flags = EVBUF_FS_DISABLE_MMAP;
+ want_cansendfile = 1;
+ want_ismapping = 0;
+ } else if (strstr(impl, "mmap")) {
+ /* If sendfile is set, we try to use a mmap/CreateFileMapping
+ * style backend. */
+ flags = EVBUF_FS_DISABLE_SENDFILE;
+ want_ismapping = 1;
+ want_cansendfile = 0;
+ } else if (strstr(impl, "linear")) {
+ /* If linear is set, we try to use a read-the-whole-thing
+ * backend. */
+ flags = EVBUF_FS_DISABLE_SENDFILE|EVBUF_FS_DISABLE_MMAP;
+ want_ismapping = 0;
+ want_cansendfile = 0;
+ } else if (strstr(impl, "default")) {
+ /* The caller doesn't care which backend we use. */
+ ;
+ } else {
+ /* The caller must choose a backend. */
+ TT_DIE(("Didn't recognize the implementation"));
+ }
+
+ if (use_bigfile) {
+ unsigned int i;
+ datalen = 1024*512;
+ data = malloc(1024*512);
+ tt_assert(data);
+ for (i = 0; i < datalen; ++i)
+ data[i] = (char)evutil_weakrand_(&seed);
+ } else {
+ data = strdup("here is a relatively small string.");
+ tt_assert(data);
+ datalen = strlen(data);
+ }
+
+ fd = regress_make_tmpfile(data, datalen, &tmpfilename);
+
+ if (map_from_offset) {
+ starting_offset = datalen/4 + 1;
+ mapping_len = datalen / 2 - 1;
+ expect_data = data + starting_offset;
+ expect_len = mapping_len;
+ } else {
+ expect_data = data;
+ expect_len = datalen;
+ }
+ if (view_from_offset) {
+ tt_assert(use_segment); /* Can't do this with add_file*/
+ segment_offset = expect_len / 3;
+ segment_len = expect_len / 2;
+ expect_data = expect_data + segment_offset;
+ expect_len = segment_len;
+ }
+
+ if (use_segment) {
+ seg = evbuffer_file_segment_new(fd, starting_offset,
+ mapping_len, flags);
+ tt_assert(seg);
+ if (want_ismapping >= 0) {
+ if (seg->is_mapping != (unsigned)want_ismapping)
+ tt_skip();
+ }
+ if (want_cansendfile >= 0) {
+ if (seg->can_sendfile != (unsigned)want_cansendfile)
+ tt_skip();
+ }
+ }
+
+ /* Say that it drains to a fd so that we can use sendfile. */
+ evbuffer_set_flags(src, EVBUFFER_FLAG_DRAINS_TO_FD);
+
+#if defined(EVENT__HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__)
+ /* We need to use a pair of AF_INET sockets, since Solaris
+ doesn't support sendfile() over AF_UNIX. */
+ if (evutil_ersatz_socketpair_(AF_INET, SOCK_STREAM, 0, pair) == -1)
+ tt_abort_msg("ersatz_socketpair failed");
+#else
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ tt_abort_msg("socketpair failed");
+#endif
+ evutil_make_socket_nonblocking(pair[0]);
+ evutil_make_socket_nonblocking(pair[1]);
+
+ tt_assert(fd != -1);
+
+ if (use_segment) {
+ tt_assert(evbuffer_add_file_segment(src, seg,
+ segment_offset, segment_len)!=-1);
+ } else {
+ tt_assert(evbuffer_add_file(src, fd, starting_offset,
+ mapping_len) != -1);
+ }
+
+ evbuffer_validate(src);
+
+ addfile_test_event_base = base;
+ wev = event_new(base, pair[0], EV_WRITE|EV_PERSIST,
+ addfile_test_writecb, src);
+ rev = event_new(base, pair[1], EV_READ|EV_PERSIST,
+ addfile_test_readcb, dest);
+
+ event_add(wev, NULL);
+ event_add(rev, NULL);
+ event_base_dispatch(base);
+
+ evbuffer_validate(src);
+ evbuffer_validate(dest);
+
+ tt_assert(addfile_test_done_writing);
+ tt_int_op(addfile_test_total_written, ==, expect_len);
+ tt_int_op(addfile_test_total_read, ==, expect_len);
+
+ compare = (char *)evbuffer_pullup(dest, expect_len);
+ tt_assert(compare != NULL);
+ if (memcmp(compare, expect_data, expect_len)) {
+ tt_abort_msg("Data from add_file differs.");
+ }
+
+ evbuffer_validate(dest);
+ end:
+ if (data)
+ free(data);
+ if (seg)
+ evbuffer_file_segment_free(seg);
+ if (src)
+ evbuffer_free(src);
+ if (dest)
+ evbuffer_free(dest);
+ if (pair[0] >= 0)
+ evutil_closesocket(pair[0]);
+ if (pair[1] >= 0)
+ evutil_closesocket(pair[1]);
+ if (tmpfilename) {
+ unlink(tmpfilename);
+ free(tmpfilename);
+ }
+}
+
+static int file_segment_cleanup_cb_called_count = 0;
+static struct evbuffer_file_segment const* file_segment_cleanup_cb_called_with = NULL;
+static int file_segment_cleanup_cb_called_with_flags = 0;
+static void* file_segment_cleanup_cb_called_with_arg = NULL;
+static void
+file_segment_cleanup_cp(struct evbuffer_file_segment const* seg, int flags, void* arg)
+{
+ ++file_segment_cleanup_cb_called_count;
+ file_segment_cleanup_cb_called_with = seg;
+ file_segment_cleanup_cb_called_with_flags = flags;
+ file_segment_cleanup_cb_called_with_arg = arg;
+}
+
+static void
+test_evbuffer_file_segment_add_cleanup_cb(void* ptr)
+{
+ char *tmpfilename = NULL;
+ int fd = -1;
+ struct evbuffer *evb = NULL;
+ struct evbuffer_file_segment *seg = NULL, *segptr;
+ char const* arg = "token";
+
+ fd = regress_make_tmpfile("file_segment_test_file", 22, &tmpfilename);
+ tt_int_op(fd, >=, 0);
+
+ evb = evbuffer_new();
+ tt_assert(evb);
+
+ segptr = seg = evbuffer_file_segment_new(fd, 0, -1, 0);
+ tt_assert(seg);
+
+ evbuffer_file_segment_add_cleanup_cb(
+ seg, &file_segment_cleanup_cp, (void*)arg);
+
+ tt_assert(fd != -1);
+
+ tt_assert(evbuffer_add_file_segment(evb, seg, 0, -1)!=-1);
+
+ evbuffer_validate(evb);
+
+ tt_int_op(file_segment_cleanup_cb_called_count, ==, 0);
+ evbuffer_file_segment_free(seg);
+ seg = NULL; /* Prevent double-free. */
+
+ tt_int_op(file_segment_cleanup_cb_called_count, ==, 0);
+ evbuffer_free(evb);
+ evb = NULL; /* pevent double-free */
+
+ tt_int_op(file_segment_cleanup_cb_called_count, ==, 1);
+ tt_assert(file_segment_cleanup_cb_called_with == segptr);
+ tt_assert(file_segment_cleanup_cb_called_with_flags == 0);
+ tt_assert(file_segment_cleanup_cb_called_with_arg == (void*)arg);
+
+end:
+ if (evb)
+ evbuffer_free(evb);
+ if (seg)
+ evbuffer_file_segment_free(seg);
+ if (tmpfilename) {
+ unlink(tmpfilename);
+ free(tmpfilename);
+ }
+}
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+static void *
+failing_malloc(size_t how_much)
+{
+ errno = ENOMEM;
+ return NULL;
+}
+#endif
+
+static void
+test_evbuffer_readln(void *ptr)
+{
+ struct evbuffer *evb = evbuffer_new();
+ struct evbuffer *evb_tmp = evbuffer_new();
+ const char *s;
+ char *cp = NULL;
+ size_t sz;
+
+#define tt_line_eq(content) \
+ TT_STMT_BEGIN \
+ if (!cp || sz != strlen(content) || strcmp(cp, content)) { \
+ TT_DIE(("Wanted %s; got %s [%d]", content, cp, (int)sz)); \
+ } \
+ TT_STMT_END
+
+ /* Test EOL_ANY. */
+ s = "complex silly newline\r\n\n\r\n\n\rmore\0\n";
+ evbuffer_add(evb, s, strlen(s)+2);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ tt_line_eq("complex silly newline");
+ free(cp);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ if (!cp || sz != 5 || memcmp(cp, "more\0\0", 6))
+ tt_abort_msg("Not as expected");
+ tt_uint_op(evbuffer_get_length(evb), ==, 0);
+ evbuffer_validate(evb);
+ s = "\nno newline";
+ evbuffer_add(evb, s, strlen(s));
+ free(cp);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+ evbuffer_drain(evb, evbuffer_get_length(evb));
+ tt_assert(evbuffer_get_length(evb) == 0);
+ evbuffer_validate(evb);
+
+ /* Test EOL_CRLF */
+ s = "Line with\rin the middle\nLine with good crlf\r\n\nfinal\n";
+ evbuffer_add(evb, s, strlen(s));
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("Line with\rin the middle");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("Line with good crlf");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_line_eq("final");
+ s = "x";
+ evbuffer_validate(evb);
+ evbuffer_add(evb, s, 1);
+ evbuffer_validate(evb);
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+
+ /* Test CRLF_STRICT */
+ s = " and a bad crlf\nand a good one\r\n\r\nMore\r";
+ evbuffer_add(evb, s, strlen(s));
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("x and a bad crlf\nand a good one");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+ evbuffer_add(evb, "\n", 1);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("More");
+ free(cp);
+ tt_assert(evbuffer_get_length(evb) == 0);
+ evbuffer_validate(evb);
+
+ s = "An internal CR\r is not an eol\r\nNor is a lack of one";
+ evbuffer_add(evb, s, strlen(s));
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("An internal CR\r is not an eol");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_assert(!cp);
+ evbuffer_validate(evb);
+
+ evbuffer_add(evb, "\r\n", 2);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("Nor is a lack of one");
+ free(cp);
+ tt_assert(evbuffer_get_length(evb) == 0);
+ evbuffer_validate(evb);
+
+ /* Test LF */
+ s = "An\rand a nl\n\nText";
+ evbuffer_add(evb, s, strlen(s));
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("An\rand a nl");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_assert(!cp);
+ free(cp);
+ evbuffer_add(evb, "\n", 1);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("Text");
+ free(cp);
+ evbuffer_validate(evb);
+
+ /* Test NUL */
+ tt_int_op(evbuffer_get_length(evb), ==, 0);
+ {
+ char x[] =
+ "NUL\n\0\0"
+ "The all-zeros character which may serve\0"
+ "to accomplish time fill\0and media fill";
+ /* Add all but the final NUL of x. */
+ evbuffer_add(evb, x, sizeof(x)-1);
+ }
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("NUL\n");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("The all-zeros character which may serve");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_line_eq("to accomplish time fill");
+ free(cp);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL);
+ tt_ptr_op(cp, ==, NULL);
+ evbuffer_drain(evb, -1);
+
+ /* Test CRLF_STRICT - across boundaries*/
+ s = " and a bad crlf\nand a good one\r";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+ s = "\n\r";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+ s = "\nMore\r";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq(" and a bad crlf\nand a good one");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("");
+ free(cp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_assert(!cp);
+ free(cp);
+ evbuffer_validate(evb);
+ evbuffer_add(evb, "\n", 1);
+ evbuffer_validate(evb);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT);
+ tt_line_eq("More");
+ free(cp); cp = NULL;
+ evbuffer_validate(evb);
+ tt_assert(evbuffer_get_length(evb) == 0);
+
+ /* Test memory problem*/
+ s = "one line\ntwo line\nblue line";
+ evbuffer_add(evb_tmp, s, strlen(s));
+ evbuffer_validate(evb);
+ evbuffer_add_buffer(evb, evb_tmp);
+ evbuffer_validate(evb);
+
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("one line");
+ free(cp); cp = NULL;
+ evbuffer_validate(evb);
+
+ /* the next call to readline should fail */
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ event_set_mem_functions(failing_malloc, realloc, free);
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_assert(cp == NULL);
+ evbuffer_validate(evb);
+
+ /* now we should get the next line back */
+ event_set_mem_functions(malloc, realloc, free);
+#endif
+ cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF);
+ tt_line_eq("two line");
+ free(cp); cp = NULL;
+ evbuffer_validate(evb);
+
+ end:
+ evbuffer_free(evb);
+ evbuffer_free(evb_tmp);
+ if (cp) free(cp);
+}
+
+static void
+test_evbuffer_search_eol(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer_ptr ptr1, ptr2;
+ const char *s;
+ size_t eol_len;
+
+ s = "string! \r\n\r\nx\n";
+ evbuffer_add(buf, s, strlen(s));
+ eol_len = -1;
+ ptr1 = evbuffer_search_eol(buf, NULL, &eol_len, EVBUFFER_EOL_CRLF);
+ tt_int_op(ptr1.pos, ==, 8);
+ tt_int_op(eol_len, ==, 2);
+
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_CRLF);
+ tt_int_op(ptr2.pos, ==, 8);
+ tt_int_op(eol_len, ==, 2);
+
+ evbuffer_ptr_set(buf, &ptr1, 1, EVBUFFER_PTR_ADD);
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_CRLF);
+ tt_int_op(ptr2.pos, ==, 9);
+ tt_int_op(eol_len, ==, 1);
+
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_CRLF_STRICT);
+ tt_int_op(ptr2.pos, ==, 10);
+ tt_int_op(eol_len, ==, 2);
+
+ eol_len = -1;
+ ptr1 = evbuffer_search_eol(buf, NULL, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr1.pos, ==, 9);
+ tt_int_op(eol_len, ==, 1);
+
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr2.pos, ==, 9);
+ tt_int_op(eol_len, ==, 1);
+
+ evbuffer_ptr_set(buf, &ptr1, 1, EVBUFFER_PTR_ADD);
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr2.pos, ==, 11);
+ tt_int_op(eol_len, ==, 1);
+
+ tt_assert(evbuffer_ptr_set(buf, &ptr1, evbuffer_get_length(buf), EVBUFFER_PTR_SET) == 0);
+ eol_len = -1;
+ ptr2 = evbuffer_search_eol(buf, &ptr1, &eol_len, EVBUFFER_EOL_LF);
+ tt_int_op(ptr2.pos, ==, -1);
+ tt_int_op(eol_len, ==, 0);
+
+end:
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_iterative(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ const char *abc = "abcdefghijklmnopqrstvuwxyzabcdefghijklmnopqrstvuwxyzabcdefghijklmnopqrstvuwxyzabcdefghijklmnopqrstvuwxyz";
+ unsigned i, j, sum, n;
+
+ sum = 0;
+ n = 0;
+ for (i = 0; i < 1000; ++i) {
+ for (j = 1; j < strlen(abc); ++j) {
+ char format[32];
+ evutil_snprintf(format, sizeof(format), "%%%u.%us", j, j);
+ evbuffer_add_printf(buf, format, abc);
+
+ /* Only check for rep violations every so often.
+ Walking over the whole list of chains can get
+ pretty expensive as it gets long.
+ */
+ if ((n % 337) == 0)
+ evbuffer_validate(buf);
+
+ sum += j;
+ n++;
+ }
+ }
+ evbuffer_validate(buf);
+
+ tt_uint_op(sum, ==, evbuffer_get_length(buf));
+
+ {
+ size_t a,w,u;
+ a=w=u=0;
+ evbuffer_get_waste(buf, &a, &w, &u);
+ if (0)
+ printf("Allocated: %u.\nWasted: %u.\nUsed: %u.",
+ (unsigned)a, (unsigned)w, (unsigned)u);
+ tt_assert( ((double)w)/a < .125);
+ }
+ end:
+ evbuffer_free(buf);
+
+}
+
+static void
+test_evbuffer_find(void *ptr)
+{
+ u_char* p;
+ const char* test1 = "1234567890\r\n";
+ const char* test2 = "1234567890\r";
+#define EVBUFFER_INITIAL_LENGTH 256
+ char test3[EVBUFFER_INITIAL_LENGTH];
+ unsigned int i;
+ struct evbuffer * buf = evbuffer_new();
+
+ tt_assert(buf);
+
+ /* make sure evbuffer_find doesn't match past the end of the buffer */
+ evbuffer_add(buf, (u_char*)test1, strlen(test1));
+ evbuffer_validate(buf);
+ evbuffer_drain(buf, strlen(test1));
+ evbuffer_validate(buf);
+ evbuffer_add(buf, (u_char*)test2, strlen(test2));
+ evbuffer_validate(buf);
+ p = evbuffer_find(buf, (u_char*)"\r\n", 2);
+ tt_want(p == NULL);
+
+ /*
+ * drain the buffer and do another find; in r309 this would
+ * read past the allocated buffer causing a valgrind error.
+ */
+ evbuffer_drain(buf, strlen(test2));
+ evbuffer_validate(buf);
+ for (i = 0; i < EVBUFFER_INITIAL_LENGTH; ++i)
+ test3[i] = 'a';
+ test3[EVBUFFER_INITIAL_LENGTH - 1] = 'x';
+ evbuffer_add(buf, (u_char *)test3, EVBUFFER_INITIAL_LENGTH);
+ evbuffer_validate(buf);
+ p = evbuffer_find(buf, (u_char *)"xy", 2);
+ tt_want(p == NULL);
+
+ /* simple test for match at end of allocated buffer */
+ p = evbuffer_find(buf, (u_char *)"ax", 2);
+ tt_assert(p != NULL);
+ tt_want(strncmp((char*)p, "ax", 2) == 0);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_ptr_set(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer_ptr pos;
+ struct evbuffer_iovec v[1];
+
+ tt_assert(buf);
+
+ tt_int_op(evbuffer_get_length(buf), ==, 0);
+
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ tt_assert(pos.pos == 0);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_ADD) == -1);
+ tt_assert(pos.pos == -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_SET) == -1);
+ tt_assert(pos.pos == -1);
+
+ /* create some chains */
+ evbuffer_reserve_space(buf, 5000, v, 1);
+ v[0].iov_len = 5000;
+ memset(v[0].iov_base, 1, v[0].iov_len);
+ evbuffer_commit_space(buf, v, 1);
+ evbuffer_validate(buf);
+
+ evbuffer_reserve_space(buf, 4000, v, 1);
+ v[0].iov_len = 4000;
+ memset(v[0].iov_base, 2, v[0].iov_len);
+ evbuffer_commit_space(buf, v, 1);
+
+ evbuffer_reserve_space(buf, 3000, v, 1);
+ v[0].iov_len = 3000;
+ memset(v[0].iov_base, 3, v[0].iov_len);
+ evbuffer_commit_space(buf, v, 1);
+ evbuffer_validate(buf);
+
+ tt_int_op(evbuffer_get_length(buf), ==, 12000);
+
+ tt_assert(evbuffer_ptr_set(buf, &pos, 13000, EVBUFFER_PTR_SET) == -1);
+ tt_assert(pos.pos == -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ tt_assert(pos.pos == 0);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 13000, EVBUFFER_PTR_ADD) == -1);
+
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ tt_assert(pos.pos == 0);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 10000, EVBUFFER_PTR_ADD) == 0);
+ tt_assert(pos.pos == 10000);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == 0);
+ tt_assert(pos.pos == 11000);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == 0);
+ tt_assert(pos.pos == 12000);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == -1);
+ tt_assert(pos.pos == -1);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+}
+
+static void
+test_evbuffer_search(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer *tmp = evbuffer_new();
+ struct evbuffer_ptr pos, end;
+
+ tt_assert(buf);
+ tt_assert(tmp);
+
+ pos = evbuffer_search(buf, "x", 1, NULL);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search(buf, "x", 1, &pos);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "x", 1, &pos, &pos);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "x", 1, &pos, NULL);
+ tt_int_op(pos.pos, ==, -1);
+
+ /* set up our chains */
+ evbuffer_add_printf(tmp, "hello"); /* 5 chars */
+ evbuffer_add_buffer(buf, tmp);
+ evbuffer_add_printf(tmp, "foo"); /* 3 chars */
+ evbuffer_add_buffer(buf, tmp);
+ evbuffer_add_printf(tmp, "cat"); /* 3 chars */
+ evbuffer_add_buffer(buf, tmp);
+ evbuffer_add_printf(tmp, "attack");
+ evbuffer_add_buffer(buf, tmp);
+
+ pos = evbuffer_search(buf, "attack", 6, NULL);
+ tt_int_op(pos.pos, ==, 11);
+ pos = evbuffer_search(buf, "attacker", 8, NULL);
+ tt_int_op(pos.pos, ==, -1);
+
+ /* test continuing search */
+ pos = evbuffer_search(buf, "oc", 2, NULL);
+ tt_int_op(pos.pos, ==, 7);
+ pos = evbuffer_search(buf, "cat", 3, &pos);
+ tt_int_op(pos.pos, ==, 8);
+ pos = evbuffer_search(buf, "tacking", 7, &pos);
+ tt_int_op(pos.pos, ==, -1);
+
+ evbuffer_ptr_set(buf, &pos, 5, EVBUFFER_PTR_SET);
+ pos = evbuffer_search(buf, "foo", 3, &pos);
+ tt_int_op(pos.pos, ==, 5);
+
+ evbuffer_ptr_set(buf, &pos, 2, EVBUFFER_PTR_ADD);
+ pos = evbuffer_search(buf, "tat", 3, &pos);
+ tt_int_op(pos.pos, ==, 10);
+
+ /* test bounded search. */
+ /* Set "end" to the first t in "attack". */
+ evbuffer_ptr_set(buf, &end, 12, EVBUFFER_PTR_SET);
+ pos = evbuffer_search_range(buf, "foo", 3, NULL, &end);
+ tt_int_op(pos.pos, ==, 5);
+ pos = evbuffer_search_range(buf, "foocata", 7, NULL, &end);
+ tt_int_op(pos.pos, ==, 5);
+ pos = evbuffer_search_range(buf, "foocatat", 8, NULL, &end);
+ tt_int_op(pos.pos, ==, -1);
+ pos = evbuffer_search_range(buf, "ack", 3, NULL, &end);
+ tt_int_op(pos.pos, ==, -1);
+
+ /* Set "end" after the last byte in the buffer. */
+ tt_assert(evbuffer_ptr_set(buf, &end, 17, EVBUFFER_PTR_SET) == 0);
+
+ pos = evbuffer_search_range(buf, "attack", 6, NULL, &end);
+ tt_int_op(pos.pos, ==, 11);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 11, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "attack", 6, &pos, &end);
+ tt_int_op(pos.pos, ==, 11);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 17, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "attack", 6, &pos, &end);
+ tt_int_op(pos.pos, ==, -1);
+ tt_assert(evbuffer_ptr_set(buf, &pos, 17, EVBUFFER_PTR_SET) == 0);
+ pos = evbuffer_search_range(buf, "attack", 6, &pos, NULL);
+ tt_int_op(pos.pos, ==, -1);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+ if (tmp)
+ evbuffer_free(tmp);
+}
+
+static void
+log_change_callback(struct evbuffer *buffer,
+ const struct evbuffer_cb_info *cbinfo,
+ void *arg)
+{
+
+ size_t old_len = cbinfo->orig_size;
+ size_t new_len = old_len + cbinfo->n_added - cbinfo->n_deleted;
+ struct evbuffer *out = arg;
+ evbuffer_add_printf(out, "%lu->%lu; ", (unsigned long)old_len,
+ (unsigned long)new_len);
+}
+static void
+self_draining_callback(struct evbuffer *evbuffer, size_t old_len,
+ size_t new_len, void *arg)
+{
+ if (new_len > old_len)
+ evbuffer_drain(evbuffer, new_len);
+}
+
+static void
+test_evbuffer_callbacks(void *ptr)
+{
+ struct evbuffer *buf = evbuffer_new();
+ struct evbuffer *buf_out1 = evbuffer_new();
+ struct evbuffer *buf_out2 = evbuffer_new();
+ struct evbuffer_cb_entry *cb1, *cb2;
+
+ tt_assert(buf);
+ tt_assert(buf_out1);
+ tt_assert(buf_out2);
+
+ cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
+ cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
+
+ /* Let's run through adding and deleting some stuff from the buffer
+ * and turning the callbacks on and off and removing them. The callback
+ * adds a summary of length changes to buf_out1/buf_out2 when called. */
+ /* size: 0-> 36. */
+ evbuffer_add_printf(buf, "The %d magic words are spotty pudding", 2);
+ evbuffer_validate(buf);
+ evbuffer_cb_clear_flags(buf, cb2, EVBUFFER_CB_ENABLED);
+ evbuffer_drain(buf, 10); /*36->26*/
+ evbuffer_validate(buf);
+ evbuffer_prepend(buf, "Hello", 5);/*26->31*/
+ evbuffer_cb_set_flags(buf, cb2, EVBUFFER_CB_ENABLED);
+ evbuffer_add_reference(buf, "Goodbye", 7, NULL, NULL); /*31->38*/
+ evbuffer_remove_cb_entry(buf, cb1);
+ evbuffer_validate(buf);
+ evbuffer_drain(buf, evbuffer_get_length(buf)); /*38->0*/;
+ tt_assert(-1 == evbuffer_remove_cb(buf, log_change_callback, NULL));
+ evbuffer_add(buf, "X", 1); /* 0->1 */
+ tt_assert(!evbuffer_remove_cb(buf, log_change_callback, buf_out2));
+ evbuffer_validate(buf);
+
+ tt_str_op(evbuffer_pullup(buf_out1, -1), ==,
+ "0->36; 36->26; 26->31; 31->38; ");
+ tt_str_op(evbuffer_pullup(buf_out2, -1), ==,
+ "0->36; 31->38; 38->0; 0->1; ");
+ evbuffer_drain(buf_out1, evbuffer_get_length(buf_out1));
+ evbuffer_drain(buf_out2, evbuffer_get_length(buf_out2));
+ /* Let's test the obsolete buffer_setcb function too. */
+ cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
+ tt_assert(cb1 != NULL);
+ cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
+ tt_assert(cb2 != NULL);
+ evbuffer_setcb(buf, self_draining_callback, NULL);
+ evbuffer_add_printf(buf, "This should get drained right away.");
+ tt_uint_op(evbuffer_get_length(buf), ==, 0);
+ tt_uint_op(evbuffer_get_length(buf_out1), ==, 0);
+ tt_uint_op(evbuffer_get_length(buf_out2), ==, 0);
+ evbuffer_setcb(buf, NULL, NULL);
+ evbuffer_add_printf(buf, "This will not.");
+ tt_str_op(evbuffer_pullup(buf, -1), ==, "This will not.");
+ evbuffer_validate(buf);
+ evbuffer_drain(buf, evbuffer_get_length(buf));
+ evbuffer_validate(buf);
+#if 0
+ /* Now let's try a suspended callback. */
+ cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
+ cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
+ evbuffer_cb_suspend(buf,cb2);
+ evbuffer_prepend(buf,"Hello world",11); /*0->11*/
+ evbuffer_validate(buf);
+ evbuffer_cb_suspend(buf,cb1);
+ evbuffer_add(buf,"more",4); /* 11->15 */
+ evbuffer_cb_unsuspend(buf,cb2);
+ evbuffer_drain(buf, 4); /* 15->11 */
+ evbuffer_cb_unsuspend(buf,cb1);
+ evbuffer_drain(buf, evbuffer_get_length(buf)); /* 11->0 */
+
+ tt_str_op(evbuffer_pullup(buf_out1, -1), ==,
+ "0->11; 11->11; 11->0; ");
+ tt_str_op(evbuffer_pullup(buf_out2, -1), ==,
+ "0->15; 15->11; 11->0; ");
+#endif
+
+ end:
+ if (buf)
+ evbuffer_free(buf);
+ if (buf_out1)
+ evbuffer_free(buf_out1);
+ if (buf_out2)
+ evbuffer_free(buf_out2);
+}
+
+static int ref_done_cb_called_count = 0;
+static void *ref_done_cb_called_with = NULL;
+static const void *ref_done_cb_called_with_data = NULL;
+static size_t ref_done_cb_called_with_len = 0;
+static void ref_done_cb(const void *data, size_t len, void *info)
+{
+ ++ref_done_cb_called_count;
+ ref_done_cb_called_with = info;
+ ref_done_cb_called_with_data = data;
+ ref_done_cb_called_with_len = len;
+}
+
+static void
+test_evbuffer_add_reference(void *ptr)
+{
+ const char chunk1[] = "If you have found the answer to such a problem";
+ const char chunk2[] = "you ought to write it up for publication";
+ /* -- Knuth's "Notes on the Exercises" from TAOCP */
+ char tmp[16];
+ size_t len1 = strlen(chunk1), len2=strlen(chunk2);
+
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ evbuffer_add_reference(buf1, chunk1, len1, ref_done_cb, (void*)111);
+ evbuffer_add(buf1, ", ", 2);
+ evbuffer_add_reference(buf1, chunk2, len2, ref_done_cb, (void*)222);
+ tt_int_op(evbuffer_get_length(buf1), ==, len1+len2+2);
+
+ /* Make sure we can drain a little from a reference. */
+ tt_int_op(evbuffer_remove(buf1, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "If you", 6), ==, 0);
+ tt_int_op(evbuffer_remove(buf1, tmp, 5), ==, 5);
+ tt_int_op(memcmp(tmp, " have", 5), ==, 0);
+
+ /* Make sure that prepending does not meddle with immutable data */
+ tt_int_op(evbuffer_prepend(buf1, "I have ", 7), ==, 0);
+ tt_int_op(memcmp(chunk1, "If you", 6), ==, 0);
+ evbuffer_validate(buf1);
+
+ /* Make sure that when the chunk is over, the callback is invoked. */
+ evbuffer_drain(buf1, 7); /* Remove prepended stuff. */
+ evbuffer_drain(buf1, len1-11-1); /* remove all but one byte of chunk1 */
+ tt_int_op(ref_done_cb_called_count, ==, 0);
+ evbuffer_remove(buf1, tmp, 1);
+ tt_int_op(tmp[0], ==, 'm');
+ tt_assert(ref_done_cb_called_with == (void*)111);
+ tt_assert(ref_done_cb_called_with_data == chunk1);
+ tt_assert(ref_done_cb_called_with_len == len1);
+ tt_int_op(ref_done_cb_called_count, ==, 1);
+ evbuffer_validate(buf1);
+
+ /* Drain some of the remaining chunk, then add it to another buffer */
+ evbuffer_drain(buf1, 6); /* Remove the ", you ". */
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+ tt_int_op(ref_done_cb_called_count, ==, 1);
+ evbuffer_add(buf2, "I ", 2);
+
+ evbuffer_add_buffer(buf2, buf1);
+ tt_int_op(ref_done_cb_called_count, ==, 1);
+ evbuffer_remove(buf2, tmp, 16);
+ tt_int_op(memcmp("I ought to write", tmp, 16), ==, 0);
+ evbuffer_drain(buf2, evbuffer_get_length(buf2));
+ tt_int_op(ref_done_cb_called_count, ==, 2);
+ tt_assert(ref_done_cb_called_with == (void*)222);
+ evbuffer_validate(buf2);
+
+ /* Now add more stuff to buf1 and make sure that it gets removed on
+ * free. */
+ evbuffer_add(buf1, "You shake and shake the ", 24);
+ evbuffer_add_reference(buf1, "ketchup bottle", 14, ref_done_cb,
+ (void*)3333);
+ evbuffer_add(buf1, ". Nothing comes and then a lot'll.", 42);
+ evbuffer_free(buf1);
+ buf1 = NULL;
+ tt_int_op(ref_done_cb_called_count, ==, 3);
+ tt_assert(ref_done_cb_called_with == (void*)3333);
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+}
+
+static void
+test_evbuffer_multicast(void *ptr)
+{
+ const char chunk1[] = "If you have found the answer to such a problem";
+ const char chunk2[] = "you ought to write it up for publication";
+ /* -- Knuth's "Notes on the Exercises" from TAOCP */
+ char tmp[16];
+ size_t len1 = strlen(chunk1), len2=strlen(chunk2);
+
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ evbuffer_add(buf1, chunk1, len1);
+ evbuffer_add(buf1, ", ", 2);
+ evbuffer_add(buf1, chunk2, len2);
+ tt_int_op(evbuffer_get_length(buf1), ==, len1+len2+2);
+
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+
+ tt_int_op(evbuffer_add_buffer_reference(buf2, buf1), ==, 0);
+ /* nested references are not allowed */
+ tt_int_op(evbuffer_add_buffer_reference(buf2, buf2), ==, -1);
+ tt_int_op(evbuffer_add_buffer_reference(buf1, buf2), ==, -1);
+
+ /* both buffers contain the same amount of data */
+ tt_int_op(evbuffer_get_length(buf1), ==, evbuffer_get_length(buf1));
+
+ /* Make sure we can drain a little from the first buffer. */
+ tt_int_op(evbuffer_remove(buf1, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "If you", 6), ==, 0);
+ tt_int_op(evbuffer_remove(buf1, tmp, 5), ==, 5);
+ tt_int_op(memcmp(tmp, " have", 5), ==, 0);
+
+ /* Make sure that prepending does not meddle with immutable data */
+ tt_int_op(evbuffer_prepend(buf1, "I have ", 7), ==, 0);
+ tt_int_op(memcmp(chunk1, "If you", 6), ==, 0);
+ evbuffer_validate(buf1);
+
+ /* Make sure we can drain a little from the second buffer. */
+ tt_int_op(evbuffer_remove(buf2, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "If you", 6), ==, 0);
+ tt_int_op(evbuffer_remove(buf2, tmp, 5), ==, 5);
+ tt_int_op(memcmp(tmp, " have", 5), ==, 0);
+
+ /* Make sure that prepending does not meddle with immutable data */
+ tt_int_op(evbuffer_prepend(buf2, "I have ", 7), ==, 0);
+ tt_int_op(memcmp(chunk1, "If you", 6), ==, 0);
+ evbuffer_validate(buf2);
+
+ /* Make sure the data can be read from the second buffer when the first is freed */
+ evbuffer_free(buf1);
+ buf1 = NULL;
+
+ tt_int_op(evbuffer_remove(buf2, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, "I have", 6), ==, 0);
+
+ tt_int_op(evbuffer_remove(buf2, tmp, 6), ==, 6);
+ tt_int_op(memcmp(tmp, " foun", 6), ==, 0);
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+}
+
+static void
+test_evbuffer_multicast_drain(void *ptr)
+{
+ const char chunk1[] = "If you have found the answer to such a problem";
+ const char chunk2[] = "you ought to write it up for publication";
+ /* -- Knuth's "Notes on the Exercises" from TAOCP */
+ size_t len1 = strlen(chunk1), len2=strlen(chunk2);
+
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ evbuffer_add(buf1, chunk1, len1);
+ evbuffer_add(buf1, ", ", 2);
+ evbuffer_add(buf1, chunk2, len2);
+ tt_int_op(evbuffer_get_length(buf1), ==, len1+len2+2);
+
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+
+ tt_int_op(evbuffer_add_buffer_reference(buf2, buf1), ==, 0);
+ tt_int_op(evbuffer_get_length(buf2), ==, len1+len2+2);
+ tt_int_op(evbuffer_drain(buf1, evbuffer_get_length(buf1)), ==, 0);
+ tt_int_op(evbuffer_get_length(buf2), ==, len1+len2+2);
+ tt_int_op(evbuffer_drain(buf2, evbuffer_get_length(buf2)), ==, 0);
+ evbuffer_validate(buf1);
+ evbuffer_validate(buf2);
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+}
+
+/* Some cases that we didn't get in test_evbuffer() above, for more coverage. */
+static void
+test_evbuffer_prepend(void *ptr)
+{
+ struct evbuffer *buf1 = NULL, *buf2 = NULL;
+ char tmp[128];
+ int n;
+
+ buf1 = evbuffer_new();
+ tt_assert(buf1);
+
+ /* Case 0: The evbuffer is entirely empty. */
+ evbuffer_prepend(buf1, "This string has 29 characters", 29);
+ evbuffer_validate(buf1);
+
+ /* Case 1: Prepend goes entirely in new chunk. */
+ evbuffer_prepend(buf1, "Short.", 6);
+ evbuffer_validate(buf1);
+
+ /* Case 2: prepend goes entirely in first chunk. */
+ evbuffer_drain(buf1, 6+11);
+ evbuffer_prepend(buf1, "it", 2);
+ evbuffer_validate(buf1);
+ tt_assert(!memcmp(buf1->first->buffer+buf1->first->misalign,
+ "it has", 6));
+
+ /* Case 3: prepend is split over multiple chunks. */
+ evbuffer_prepend(buf1, "It is no longer true to say ", 28);
+ evbuffer_validate(buf1);
+ n = evbuffer_remove(buf1, tmp, sizeof(tmp)-1);
+ tt_int_op(n, >=, 0);
+ tmp[n]='\0';
+ tt_str_op(tmp,==,"It is no longer true to say it has 29 characters");
+
+ buf2 = evbuffer_new();
+ tt_assert(buf2);
+
+ /* Case 4: prepend a buffer to an empty buffer. */
+ n = 999;
+ evbuffer_add_printf(buf1, "Here is string %d. ", n++);
+ evbuffer_prepend_buffer(buf2, buf1);
+ evbuffer_validate(buf2);
+
+ /* Case 5: prepend a buffer to a nonempty buffer. */
+ evbuffer_add_printf(buf1, "Here is string %d. ", n++);
+ evbuffer_prepend_buffer(buf2, buf1);
+ evbuffer_validate(buf2);
+ evbuffer_validate(buf1);
+ n = evbuffer_remove(buf2, tmp, sizeof(tmp)-1);
+ tt_int_op(n, >=, 0);
+ tmp[n]='\0';
+ tt_str_op(tmp,==,"Here is string 1000. Here is string 999. ");
+
+end:
+ if (buf1)
+ evbuffer_free(buf1);
+ if (buf2)
+ evbuffer_free(buf2);
+
+}
+
+static void
+test_evbuffer_peek(void *info)
+{
+ struct evbuffer *buf = NULL, *tmp_buf = NULL;
+ int i;
+ struct evbuffer_iovec v[20];
+ struct evbuffer_ptr ptr;
+
+#define tt_iov_eq(v, s) \
+ tt_int_op((v)->iov_len, ==, strlen(s)); \
+ tt_assert(!memcmp((v)->iov_base, (s), strlen(s)))
+
+ /* Let's make a very fragmented buffer. */
+ buf = evbuffer_new();
+ tmp_buf = evbuffer_new();
+ for (i = 0; i < 16; ++i) {
+ evbuffer_add_printf(tmp_buf, "Contents of chunk [%d]\n", i);
+ evbuffer_add_buffer(buf, tmp_buf);
+ }
+
+ /* How many chunks do we need for everything? */
+ i = evbuffer_peek(buf, -1, NULL, NULL, 0);
+ tt_int_op(i, ==, 16);
+
+ /* Simple peek: get everything. */
+ i = evbuffer_peek(buf, -1, NULL, v, 20);
+ tt_int_op(i, ==, 16); /* we used only 16 chunks. */
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_iov_eq(&v[3], "Contents of chunk [3]\n");
+ tt_iov_eq(&v[12], "Contents of chunk [12]\n");
+ tt_iov_eq(&v[15], "Contents of chunk [15]\n");
+
+ /* Just get one chunk worth. */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, -1, NULL, v, 1);
+ tt_int_op(i, ==, 1);
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_assert(v[1].iov_base == NULL);
+
+ /* Suppose we want at least the first 40 bytes. */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 40, NULL, v, 16);
+ tt_int_op(i, ==, 2);
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_iov_eq(&v[1], "Contents of chunk [1]\n");
+ tt_assert(v[2].iov_base == NULL);
+
+ /* How many chunks do we need for 100 bytes? */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 100, NULL, NULL, 0);
+ tt_int_op(i, ==, 5);
+ tt_assert(v[0].iov_base == NULL);
+
+ /* Now we ask for more bytes than we provide chunks for */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 60, NULL, v, 1);
+ tt_int_op(i, ==, 3);
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_assert(v[1].iov_base == NULL);
+
+ /* Now we ask for more bytes than the buffer has. */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(buf, 65536, NULL, v, 20);
+ tt_int_op(i, ==, 16); /* we used only 16 chunks. */
+ tt_iov_eq(&v[0], "Contents of chunk [0]\n");
+ tt_iov_eq(&v[3], "Contents of chunk [3]\n");
+ tt_iov_eq(&v[12], "Contents of chunk [12]\n");
+ tt_iov_eq(&v[15], "Contents of chunk [15]\n");
+ tt_assert(v[16].iov_base == NULL);
+
+ /* What happens if we try an empty buffer? */
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(tmp_buf, -1, NULL, v, 20);
+ tt_int_op(i, ==, 0);
+ tt_assert(v[0].iov_base == NULL);
+ memset(v, 0, sizeof(v));
+ i = evbuffer_peek(tmp_buf, 50, NULL, v, 20);
+ tt_int_op(i, ==, 0);
+ tt_assert(v[0].iov_base == NULL);
+
+ /* Okay, now time to have fun with pointers. */
+ memset(v, 0, sizeof(v));
+ evbuffer_ptr_set(buf, &ptr, 30, EVBUFFER_PTR_SET);
+ i = evbuffer_peek(buf, 50, &ptr, v, 20);
+ tt_int_op(i, ==, 3);
+ tt_iov_eq(&v[0], " of chunk [1]\n");
+ tt_iov_eq(&v[1], "Contents of chunk [2]\n");
+ tt_iov_eq(&v[2], "Contents of chunk [3]\n"); /*more than we asked for*/
+
+ /* advance to the start of another chain. */
+ memset(v, 0, sizeof(v));
+ evbuffer_ptr_set(buf, &ptr, 14, EVBUFFER_PTR_ADD);
+ i = evbuffer_peek(buf, 44, &ptr, v, 20);
+ tt_int_op(i, ==, 2);
+ tt_iov_eq(&v[0], "Contents of chunk [2]\n");
+ tt_iov_eq(&v[1], "Contents of chunk [3]\n"); /*more than we asked for*/
+
+ /* peek at the end of the buffer */
+ memset(v, 0, sizeof(v));
+ tt_assert(evbuffer_ptr_set(buf, &ptr, evbuffer_get_length(buf), EVBUFFER_PTR_SET) == 0);
+ i = evbuffer_peek(buf, 44, &ptr, v, 20);
+ tt_int_op(i, ==, 0);
+ tt_assert(v[0].iov_base == NULL);
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+ if (tmp_buf)
+ evbuffer_free(tmp_buf);
+}
+
+/* Check whether evbuffer freezing works right. This is called twice,
+ once with the argument "start" and once with the argument "end".
+ When we test "start", we freeze the start of an evbuffer and make sure
+ that modifying the start of the buffer doesn't work. When we test
+ "end", we freeze the end of an evbuffer and make sure that modifying
+ the end of the buffer doesn't work.
+ */
+static void
+test_evbuffer_freeze(void *ptr)
+{
+ struct evbuffer *buf = NULL, *tmp_buf=NULL;
+ const char string[] = /* Year's End, Richard Wilbur */
+ "I've known the wind by water banks to shake\n"
+ "The late leaves down, which frozen where they fell\n"
+ "And held in ice as dancers in a spell\n"
+ "Fluttered all winter long into a lake...";
+ const int start = !strcmp(ptr, "start");
+ char *cp;
+ char charbuf[128];
+ int r;
+ size_t orig_length;
+ struct evbuffer_iovec v[1];
+
+ if (!start)
+ tt_str_op(ptr, ==, "end");
+
+ buf = evbuffer_new();
+ tmp_buf = evbuffer_new();
+ tt_assert(tmp_buf);
+
+ evbuffer_add(buf, string, strlen(string));
+ evbuffer_freeze(buf, start); /* Freeze the start or the end.*/
+
+#define FREEZE_EQ(a, startcase, endcase) \
+ do { \
+ if (start) { \
+ tt_int_op((a), ==, (startcase)); \
+ } else { \
+ tt_int_op((a), ==, (endcase)); \
+ } \
+ } while (0)
+
+
+ orig_length = evbuffer_get_length(buf);
+
+ /* These functions all manipulate the end of buf. */
+ r = evbuffer_add(buf, "abc", 0);
+ FREEZE_EQ(r, 0, -1);
+ r = evbuffer_reserve_space(buf, 10, v, 1);
+ FREEZE_EQ(r, 1, -1);
+ if (r == 1) {
+ memset(v[0].iov_base, 'X', 10);
+ v[0].iov_len = 10;
+ }
+ r = evbuffer_commit_space(buf, v, 1);
+ FREEZE_EQ(r, 0, -1);
+ r = evbuffer_add_reference(buf, string, 5, NULL, NULL);
+ FREEZE_EQ(r, 0, -1);
+ r = evbuffer_add_printf(buf, "Hello %s", "world");
+ FREEZE_EQ(r, 11, -1);
+ /* TODO: test add_buffer, add_file, read */
+
+ if (!start)
+ tt_int_op(orig_length, ==, evbuffer_get_length(buf));
+
+ orig_length = evbuffer_get_length(buf);
+
+ /* These functions all manipulate the start of buf. */
+ r = evbuffer_remove(buf, charbuf, 1);
+ FREEZE_EQ(r, -1, 1);
+ r = evbuffer_drain(buf, 3);
+ FREEZE_EQ(r, -1, 0);
+ r = evbuffer_prepend(buf, "dummy", 5);
+ FREEZE_EQ(r, -1, 0);
+ cp = evbuffer_readln(buf, NULL, EVBUFFER_EOL_LF);
+ FREEZE_EQ(cp==NULL, 1, 0);
+ if (cp)
+ free(cp);
+ /* TODO: Test remove_buffer, add_buffer, write, prepend_buffer */
+
+ if (start)
+ tt_int_op(orig_length, ==, evbuffer_get_length(buf));
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+
+ if (tmp_buf)
+ evbuffer_free(tmp_buf);
+}
+
+static void
+test_evbuffer_add_iovec(void * ptr)
+{
+ struct evbuffer * buf = NULL;
+ struct evbuffer_iovec vec[4];
+ const char * data[] = {
+ "Guilt resembles a sword with two edges.",
+ "On the one hand, it cuts for Justice, imposing practical morality upon those who fear it.",
+ "Conscience does not always adhere to rational judgment.",
+ "Guilt is always a self-imposed burden, but it is not always rightly imposed."
+ /* -- R.A. Salvatore, _Sojurn_ */
+ };
+ size_t expected_length = 0;
+ size_t returned_length = 0;
+ int i;
+
+ buf = evbuffer_new();
+
+ tt_assert(buf);
+
+ for (i = 0; i < 4; i++) {
+ vec[i].iov_len = strlen(data[i]);
+ vec[i].iov_base = (char*) data[i];
+ expected_length += vec[i].iov_len;
+ }
+
+ returned_length = evbuffer_add_iovec(buf, vec, 4);
+
+ tt_int_op(returned_length, ==, evbuffer_get_length(buf));
+ tt_int_op(evbuffer_get_length(buf), ==, expected_length);
+
+ for (i = 0; i < 4; i++) {
+ char charbuf[1024];
+
+ memset(charbuf, 0, 1024);
+ evbuffer_remove(buf, charbuf, strlen(data[i]));
+ tt_assert(strcmp(charbuf, data[i]) == 0);
+ }
+
+ tt_assert(evbuffer_get_length(buf) == 0);
+end:
+ if (buf) {
+ evbuffer_free(buf);
+ }
+}
+
+static void
+test_evbuffer_copyout(void *dummy)
+{
+ const char string[] =
+ "Still they skirmish to and fro, men my messmates on the snow "
+ "When we headed off the aurochs turn for turn; "
+ "When the rich Allobrogenses never kept amanuenses, "
+ "And our only plots were piled in lakes at Berne.";
+ /* -- Kipling, "In The Neolithic Age" */
+ char tmp[256];
+ struct evbuffer_ptr ptr;
+ struct evbuffer *buf;
+
+ (void)dummy;
+
+ buf = evbuffer_new();
+ tt_assert(buf);
+
+ tt_int_op(strlen(string), ==, 206);
+
+ /* Ensure separate chains */
+ evbuffer_add_reference(buf, string, 80, no_cleanup, NULL);
+ evbuffer_add_reference(buf, string+80, 80, no_cleanup, NULL);
+ evbuffer_add(buf, string+160, strlen(string)-160);
+
+ tt_int_op(206, ==, evbuffer_get_length(buf));
+
+ /* First, let's test plain old copyout. */
+
+ /* Copy a little from the beginning. */
+ tt_int_op(10, ==, evbuffer_copyout(buf, tmp, 10));
+ tt_int_op(0, ==, memcmp(tmp, "Still they", 10));
+
+ /* Now copy more than a little from the beginning */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(100, ==, evbuffer_copyout(buf, tmp, 100));
+ tt_int_op(0, ==, memcmp(tmp, string, 100));
+
+ /* Copy too much; ensure truncation. */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(206, ==, evbuffer_copyout(buf, tmp, 230));
+ tt_int_op(0, ==, memcmp(tmp, string, 206));
+
+ /* That was supposed to be nondestructive, btw */
+ tt_int_op(206, ==, evbuffer_get_length(buf));
+
+ /* Now it's time to test copyout_from! First, let's start in the
+ * first chain. */
+ evbuffer_ptr_set(buf, &ptr, 15, EVBUFFER_PTR_SET);
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(10, ==, evbuffer_copyout_from(buf, &ptr, tmp, 10));
+ tt_int_op(0, ==, memcmp(tmp, "mish to an", 10));
+
+ /* Right up to the end of the first chain */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(65, ==, evbuffer_copyout_from(buf, &ptr, tmp, 65));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 65));
+
+ /* Span into the second chain */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(90, ==, evbuffer_copyout_from(buf, &ptr, tmp, 90));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 90));
+
+ /* Span into the third chain */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(160, ==, evbuffer_copyout_from(buf, &ptr, tmp, 160));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 160));
+
+ /* Overrun */
+ memset(tmp, 0, sizeof(tmp));
+ tt_int_op(206-15, ==, evbuffer_copyout_from(buf, &ptr, tmp, 999));
+ tt_int_op(0, ==, memcmp(tmp, string+15, 206-15));
+
+ /* That was supposed to be nondestructive, too */
+ tt_int_op(206, ==, evbuffer_get_length(buf));
+
+end:
+ if (buf)
+ evbuffer_free(buf);
+}
+
+static void *
+setup_passthrough(const struct testcase_t *testcase)
+{
+ return testcase->setup_data;
+}
+static int
+cleanup_passthrough(const struct testcase_t *testcase, void *ptr)
+{
+ (void) ptr;
+ return 1;
+}
+
+static const struct testcase_setup_t nil_setup = {
+ setup_passthrough,
+ cleanup_passthrough
+};
+
+struct testcase_t evbuffer_testcases[] = {
+ { "evbuffer", test_evbuffer, 0, NULL, NULL },
+ { "remove_buffer_with_empty", test_evbuffer_remove_buffer_with_empty, 0, NULL, NULL },
+ { "reserve2", test_evbuffer_reserve2, 0, NULL, NULL },
+ { "reserve_many", test_evbuffer_reserve_many, 0, NULL, NULL },
+ { "reserve_many2", test_evbuffer_reserve_many, 0, &nil_setup, (void*)"add" },
+ { "reserve_many3", test_evbuffer_reserve_many, 0, &nil_setup, (void*)"fill" },
+ { "expand", test_evbuffer_expand, 0, NULL, NULL },
+ { "reference", test_evbuffer_reference, 0, NULL, NULL },
+ { "iterative", test_evbuffer_iterative, 0, NULL, NULL },
+ { "readln", test_evbuffer_readln, TT_NO_LOGS, &basic_setup, NULL },
+ { "search_eol", test_evbuffer_search_eol, 0, NULL, NULL },
+ { "find", test_evbuffer_find, 0, NULL, NULL },
+ { "ptr_set", test_evbuffer_ptr_set, 0, NULL, NULL },
+ { "search", test_evbuffer_search, 0, NULL, NULL },
+ { "callbacks", test_evbuffer_callbacks, 0, NULL, NULL },
+ { "add_reference", test_evbuffer_add_reference, 0, NULL, NULL },
+ { "multicast", test_evbuffer_multicast, 0, NULL, NULL },
+ { "multicast_drain", test_evbuffer_multicast_drain, 0, NULL, NULL },
+ { "prepend", test_evbuffer_prepend, TT_FORK, NULL, NULL },
+ { "peek", test_evbuffer_peek, 0, NULL, NULL },
+ { "freeze_start", test_evbuffer_freeze, 0, &nil_setup, (void*)"start" },
+ { "freeze_end", test_evbuffer_freeze, 0, &nil_setup, (void*)"end" },
+ { "add_iovec", test_evbuffer_add_iovec, 0, NULL, NULL},
+ { "copyout", test_evbuffer_copyout, 0, NULL, NULL},
+ { "file_segment_add_cleanup_cb", test_evbuffer_file_segment_add_cleanup_cb, 0, NULL, NULL },
+
+#define ADDFILE_TEST(name, parameters) \
+ { name, test_evbuffer_add_file, TT_FORK|TT_NEED_BASE, \
+ &basic_setup, (void*)(parameters) }
+
+#define ADDFILE_TEST_GROUP(name, parameters) \
+ ADDFILE_TEST(name "_sendfile", "sendfile " parameters), \
+ ADDFILE_TEST(name "_mmap", "mmap " parameters), \
+ ADDFILE_TEST(name "_linear", "linear " parameters)
+
+ ADDFILE_TEST_GROUP("add_file", ""),
+ ADDFILE_TEST("add_file_nosegment", "default nosegment"),
+
+ ADDFILE_TEST_GROUP("add_big_file", "bigfile"),
+ ADDFILE_TEST("add_big_file_nosegment", "default nosegment bigfile"),
+
+ ADDFILE_TEST_GROUP("add_file_offset", "bigfile map_offset"),
+ ADDFILE_TEST("add_file_offset_nosegment",
+ "default nosegment bigfile map_offset"),
+
+ ADDFILE_TEST_GROUP("add_file_offset2", "bigfile offset_in_segment"),
+
+ ADDFILE_TEST_GROUP("add_file_offset3",
+ "bigfile offset_in_segment map_offset"),
+
+ END_OF_TESTCASES
+};
diff --git a/sntp/libevent/test/regress_bufferevent.c b/sntp/libevent/test/regress_bufferevent.c
new file mode 100644
index 0000000..4ec2dcc
--- /dev/null
+++ b/sntp/libevent/test/regress_bufferevent.c
@@ -0,0 +1,1014 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#endif
+#include <fcntl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#ifdef EVENT__HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include "event2/event-config.h"
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event2/tag.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/bufferevent_compat.h"
+#include "event2/bufferevent_struct.h"
+#include "event2/listener.h"
+#include "event2/util.h"
+
+#include "bufferevent-internal.h"
+#include "util-internal.h"
+#ifdef _WIN32
+#include "iocp-internal.h"
+#endif
+
+#include "regress.h"
+#include "regress_testutils.h"
+
+/*
+ * simple bufferevent test
+ */
+
+static void
+readcb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bev->input) == 8333) {
+ struct evbuffer *evbuf = evbuffer_new();
+ assert(evbuf != NULL);
+
+ /* gratuitous test of bufferevent_read_buffer */
+ bufferevent_read_buffer(bev, evbuf);
+
+ bufferevent_disable(bev, EV_READ);
+
+ if (evbuffer_get_length(evbuf) == 8333) {
+ test_ok++;
+ }
+
+ evbuffer_free(evbuf);
+ }
+}
+
+static void
+writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bev->output) == 0) {
+ test_ok++;
+ }
+}
+
+static void
+errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ test_ok = -2;
+}
+
+static void
+test_bufferevent_impl(int use_pair)
+{
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ char buffer[8333];
+ int i;
+
+ if (use_pair) {
+ struct bufferevent *pair[2];
+ tt_assert(0 == bufferevent_pair_new(NULL, 0, pair));
+ bev1 = pair[0];
+ bev2 = pair[1];
+ bufferevent_setcb(bev1, readcb, writecb, errorcb, bev1);
+ bufferevent_setcb(bev2, readcb, writecb, errorcb, NULL);
+ tt_int_op(bufferevent_getfd(bev1), ==, -1);
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, NULL);
+ tt_ptr_op(bufferevent_pair_get_partner(bev1), ==, bev2);
+ tt_ptr_op(bufferevent_pair_get_partner(bev2), ==, bev1);
+ } else {
+ bev1 = bufferevent_new(pair[0], readcb, writecb, errorcb, NULL);
+ bev2 = bufferevent_new(pair[1], readcb, writecb, errorcb, NULL);
+ tt_int_op(bufferevent_getfd(bev1), ==, pair[0]);
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, NULL);
+ tt_ptr_op(bufferevent_pair_get_partner(bev1), ==, NULL);
+ tt_ptr_op(bufferevent_pair_get_partner(bev2), ==, NULL);
+ }
+
+ {
+ /* Test getcb. */
+ bufferevent_data_cb r, w;
+ bufferevent_event_cb e;
+ void *a;
+ bufferevent_getcb(bev1, &r, &w, &e, &a);
+ tt_ptr_op(r, ==, readcb);
+ tt_ptr_op(w, ==, writecb);
+ tt_ptr_op(e, ==, errorcb);
+ tt_ptr_op(a, ==, use_pair ? bev1 : NULL);
+ }
+
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+
+ tt_int_op(bufferevent_get_enabled(bev1), ==, EV_WRITE);
+ tt_int_op(bufferevent_get_enabled(bev2), ==, EV_WRITE|EV_READ);
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = i;
+
+ bufferevent_write(bev1, buffer, sizeof(buffer));
+
+ event_dispatch();
+
+ bufferevent_free(bev1);
+ tt_ptr_op(bufferevent_pair_get_partner(bev2), ==, NULL);
+ bufferevent_free(bev2);
+
+ if (test_ok != 2)
+ test_ok = 0;
+end:
+ ;
+}
+
+static void
+test_bufferevent(void)
+{
+ test_bufferevent_impl(0);
+}
+
+static void
+test_bufferevent_pair(void)
+{
+ test_bufferevent_impl(1);
+}
+
+/*
+ * test watermarks and bufferevent
+ */
+
+static void
+wm_readcb(struct bufferevent *bev, void *arg)
+{
+ struct evbuffer *evbuf = evbuffer_new();
+ int len = (int)evbuffer_get_length(bev->input);
+ static int nread;
+
+ assert(len >= 10 && len <= 20);
+
+ assert(evbuf != NULL);
+
+ /* gratuitous test of bufferevent_read_buffer */
+ bufferevent_read_buffer(bev, evbuf);
+
+ nread += len;
+ if (nread == 65000) {
+ bufferevent_disable(bev, EV_READ);
+ test_ok++;
+ }
+
+ evbuffer_free(evbuf);
+}
+
+static void
+wm_writecb(struct bufferevent *bev, void *arg)
+{
+ assert(evbuffer_get_length(bev->output) <= 100);
+ if (evbuffer_get_length(bev->output) == 0) {
+ evbuffer_drain(bev->output, evbuffer_get_length(bev->output));
+ test_ok++;
+ }
+}
+
+static void
+wm_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ test_ok = -2;
+}
+
+static void
+test_bufferevent_watermarks_impl(int use_pair)
+{
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ char buffer[65000];
+ size_t low, high;
+ int i;
+ test_ok = 0;
+
+ if (use_pair) {
+ struct bufferevent *pair[2];
+ tt_assert(0 == bufferevent_pair_new(NULL, 0, pair));
+ bev1 = pair[0];
+ bev2 = pair[1];
+ bufferevent_setcb(bev1, NULL, wm_writecb, errorcb, NULL);
+ bufferevent_setcb(bev2, wm_readcb, NULL, errorcb, NULL);
+ } else {
+ bev1 = bufferevent_new(pair[0], NULL, wm_writecb, wm_errorcb, NULL);
+ bev2 = bufferevent_new(pair[1], wm_readcb, NULL, wm_errorcb, NULL);
+ }
+ tt_assert(bev1);
+ tt_assert(bev2);
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+
+ /* By default, low watermarks are set to 0 */
+ bufferevent_getwatermark(bev1, EV_READ, &low, NULL);
+ tt_int_op(low, ==, 0);
+ bufferevent_getwatermark(bev2, EV_WRITE, &low, NULL);
+ tt_int_op(low, ==, 0);
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = (char)i;
+
+ /* limit the reading on the receiving bufferevent */
+ bufferevent_setwatermark(bev2, EV_READ, 10, 20);
+
+ bufferevent_getwatermark(bev2, EV_READ, &low, &high);
+ tt_int_op(low, ==, 10);
+ tt_int_op(high, ==, 20);
+
+ /* Tell the sending bufferevent not to notify us till it's down to
+ 100 bytes. */
+ bufferevent_setwatermark(bev1, EV_WRITE, 100, 2000);
+
+ bufferevent_getwatermark(bev1, EV_WRITE, &low, &high);
+ tt_int_op(low, ==, 100);
+ tt_int_op(high, ==, 2000);
+
+ bufferevent_write(bev1, buffer, sizeof(buffer));
+
+ event_dispatch();
+
+ tt_int_op(test_ok, ==, 2);
+
+ /* The write callback drained all the data from outbuf, so we
+ * should have removed the write event... */
+ tt_assert(!event_pending(&bev2->ev_write, EV_WRITE, NULL));
+
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+}
+
+static void
+test_bufferevent_watermarks(void)
+{
+ test_bufferevent_watermarks_impl(0);
+}
+
+static void
+test_bufferevent_pair_watermarks(void)
+{
+ test_bufferevent_watermarks_impl(1);
+}
+
+/*
+ * Test bufferevent filters
+ */
+
+/* strip an 'x' from each byte */
+
+static enum bufferevent_filter_result
+bufferevent_input_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ const unsigned char *buffer;
+ unsigned i;
+
+ buffer = evbuffer_pullup(src, evbuffer_get_length(src));
+ for (i = 0; i < evbuffer_get_length(src); i += 2) {
+ assert(buffer[i] == 'x');
+ evbuffer_add(dst, buffer + i + 1, 1);
+
+ if (i + 2 > evbuffer_get_length(src))
+ break;
+ }
+
+ evbuffer_drain(src, i);
+ return (BEV_OK);
+}
+
+/* add an 'x' before each byte */
+
+static enum bufferevent_filter_result
+bufferevent_output_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ const unsigned char *buffer;
+ unsigned i;
+
+ buffer = evbuffer_pullup(src, evbuffer_get_length(src));
+ for (i = 0; i < evbuffer_get_length(src); ++i) {
+ evbuffer_add(dst, "x", 1);
+ evbuffer_add(dst, buffer + i, 1);
+ }
+
+ evbuffer_drain(src, evbuffer_get_length(src));
+ return (BEV_OK);
+}
+
+static void
+test_bufferevent_filters_impl(int use_pair)
+{
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ struct bufferevent *bev1_base = NULL, *bev2_base = NULL;
+ char buffer[8333];
+ int i;
+
+ test_ok = 0;
+
+ if (use_pair) {
+ struct bufferevent *pair[2];
+ tt_assert(0 == bufferevent_pair_new(NULL, 0, pair));
+ bev1 = pair[0];
+ bev2 = pair[1];
+ } else {
+ bev1 = bufferevent_socket_new(NULL, pair[0], 0);
+ bev2 = bufferevent_socket_new(NULL, pair[1], 0);
+ }
+ bev1_base = bev1;
+ bev2_base = bev2;
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = i;
+
+ bev1 = bufferevent_filter_new(bev1, NULL, bufferevent_output_filter,
+ BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+
+ bev2 = bufferevent_filter_new(bev2, bufferevent_input_filter,
+ NULL, BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+ bufferevent_setcb(bev1, NULL, writecb, errorcb, NULL);
+ bufferevent_setcb(bev2, readcb, NULL, errorcb, NULL);
+
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, bev1_base);
+ tt_ptr_op(bufferevent_get_underlying(bev2), ==, bev2_base);
+ tt_int_op(bufferevent_getfd(bev1), ==, -1);
+ tt_int_op(bufferevent_getfd(bev2), ==, -1);
+
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+ /* insert some filters */
+ bufferevent_write(bev1, buffer, sizeof(buffer));
+
+ event_dispatch();
+
+ if (test_ok != 2)
+ test_ok = 0;
+
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+
+}
+
+static void
+test_bufferevent_filters(void)
+{
+ test_bufferevent_filters_impl(0);
+}
+
+static void
+test_bufferevent_pair_filters(void)
+{
+ test_bufferevent_filters_impl(1);
+}
+
+
+static void
+sender_writecb(struct bufferevent *bev, void *ctx)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ bufferevent_disable(bev,EV_READ|EV_WRITE);
+ TT_BLATHER(("Flushed %d: freeing it.", (int)bufferevent_getfd(bev)));
+ bufferevent_free(bev);
+ }
+}
+
+static void
+sender_errorcb(struct bufferevent *bev, short what, void *ctx)
+{
+ TT_FAIL(("Got sender error %d",(int)what));
+}
+
+static int bufferevent_connect_test_flags = 0;
+static int bufferevent_trigger_test_flags = 0;
+static int n_strings_read = 0;
+static int n_reads_invoked = 0;
+
+#define TEST_STR "Now is the time for all good events to signal for " \
+ "the good of their protocol"
+static void
+listen_cb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *sa, int socklen, void *arg)
+{
+ struct event_base *base = arg;
+ struct bufferevent *bev;
+ const char s[] = TEST_STR;
+ TT_BLATHER(("Got a request on socket %d", (int)fd ));
+ bev = bufferevent_socket_new(base, fd, bufferevent_connect_test_flags);
+ tt_assert(bev);
+ bufferevent_setcb(bev, NULL, sender_writecb, sender_errorcb, NULL);
+ bufferevent_write(bev, s, sizeof(s));
+end:
+ ;
+}
+
+static void
+reader_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct event_base *base = ctx;
+ if (what & BEV_EVENT_ERROR) {
+ perror("foobar");
+ TT_FAIL(("got connector error %d", (int)what));
+ return;
+ }
+ if (what & BEV_EVENT_CONNECTED) {
+ TT_BLATHER(("connected on %d", (int)bufferevent_getfd(bev)));
+ bufferevent_enable(bev, EV_READ);
+ }
+ if (what & BEV_EVENT_EOF) {
+ char buf[512];
+ size_t n;
+ n = bufferevent_read(bev, buf, sizeof(buf)-1);
+ tt_int_op(n, >=, 0);
+ buf[n] = '\0';
+ tt_str_op(buf, ==, TEST_STR);
+ if (++n_strings_read == 2)
+ event_base_loopexit(base, NULL);
+ TT_BLATHER(("EOF on %d: %d strings read.",
+ (int)bufferevent_getfd(bev), n_strings_read));
+ }
+end:
+ ;
+}
+
+static void
+reader_readcb(struct bufferevent *bev, void *ctx)
+{
+ TT_BLATHER(("Read invoked on %d.", (int)bufferevent_getfd(bev)));
+ n_reads_invoked++;
+}
+
+static void
+test_bufferevent_connect(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evconnlistener *lev=NULL;
+ struct bufferevent *bev1=NULL, *bev2=NULL;
+ struct sockaddr_in localhost;
+ struct sockaddr_storage ss;
+ struct sockaddr *sa;
+ ev_socklen_t slen;
+
+ int be_flags=BEV_OPT_CLOSE_ON_FREE;
+
+ if (strstr((char*)data->setup_data, "defer")) {
+ be_flags |= BEV_OPT_DEFER_CALLBACKS;
+ }
+ if (strstr((char*)data->setup_data, "unlocked")) {
+ be_flags |= BEV_OPT_UNLOCK_CALLBACKS;
+ }
+ if (strstr((char*)data->setup_data, "lock")) {
+ be_flags |= BEV_OPT_THREADSAFE;
+ }
+ bufferevent_connect_test_flags = be_flags;
+#ifdef _WIN32
+ if (!strcmp((char*)data->setup_data, "unset_connectex")) {
+ struct win32_extension_fns *ext =
+ (struct win32_extension_fns *)
+ event_get_win32_extension_fns_();
+ ext->ConnectEx = NULL;
+ }
+#endif
+
+ memset(&localhost, 0, sizeof(localhost));
+
+ localhost.sin_port = 0; /* pick-a-port */
+ localhost.sin_addr.s_addr = htonl(0x7f000001L);
+ localhost.sin_family = AF_INET;
+ sa = (struct sockaddr *)&localhost;
+ lev = evconnlistener_new_bind(data->base, listen_cb, data->base,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ 16, sa, sizeof(localhost));
+ tt_assert(lev);
+
+ sa = (struct sockaddr *)&ss;
+ slen = sizeof(ss);
+ if (regress_get_listener_addr(lev, sa, &slen) < 0) {
+ tt_abort_perror("getsockname");
+ }
+
+ tt_assert(!evconnlistener_enable(lev));
+ bev1 = bufferevent_socket_new(data->base, -1, be_flags);
+ bev2 = bufferevent_socket_new(data->base, -1, be_flags);
+ tt_assert(bev1);
+ tt_assert(bev2);
+ bufferevent_setcb(bev1, reader_readcb,NULL, reader_eventcb, data->base);
+ bufferevent_setcb(bev2, reader_readcb,NULL, reader_eventcb, data->base);
+
+ bufferevent_enable(bev1, EV_READ);
+ bufferevent_enable(bev2, EV_READ);
+
+ tt_want(!bufferevent_socket_connect(bev1, sa, sizeof(localhost)));
+ tt_want(!bufferevent_socket_connect(bev2, sa, sizeof(localhost)));
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(n_strings_read, ==, 2);
+ tt_int_op(n_reads_invoked, >=, 2);
+end:
+ if (lev)
+ evconnlistener_free(lev);
+
+ if (bev1)
+ bufferevent_free(bev1);
+
+ if (bev2)
+ bufferevent_free(bev2);
+}
+
+static void
+want_fail_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct event_base *base = ctx;
+ const char *err;
+ evutil_socket_t s;
+
+ if (what & BEV_EVENT_ERROR) {
+ s = bufferevent_getfd(bev);
+ err = evutil_socket_error_to_string(evutil_socket_geterror(s));
+ TT_BLATHER(("connection failure on "EV_SOCK_FMT": %s",
+ EV_SOCK_ARG(s), err));
+ test_ok = 1;
+ } else {
+ TT_FAIL(("didn't fail? what %hd", what));
+ }
+
+ event_base_loopexit(base, NULL);
+}
+
+static void
+close_socket_cb(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_socket_t *fdp = arg;
+ if (*fdp >= 0) {
+ evutil_closesocket(*fdp);
+ *fdp = -1;
+ }
+}
+
+static void
+test_bufferevent_connect_fail(void *arg)
+{
+ struct basic_test_data *data = (struct basic_test_data *)arg;
+ struct bufferevent *bev=NULL;
+ struct sockaddr_in localhost;
+ struct sockaddr *sa = (struct sockaddr*)&localhost;
+ evutil_socket_t fake_listener = -1;
+ ev_socklen_t slen = sizeof(localhost);
+ struct event close_listener_event;
+ int close_listener_event_added = 0;
+ struct timeval one_second = { 1, 0 };
+ int r;
+
+ test_ok = 0;
+
+ memset(&localhost, 0, sizeof(localhost));
+ localhost.sin_port = 0; /* have the kernel pick a port */
+ localhost.sin_addr.s_addr = htonl(0x7f000001L);
+ localhost.sin_family = AF_INET;
+
+ /* bind, but don't listen or accept. should trigger
+ "Connection refused" reliably on most platforms. */
+ fake_listener = socket(localhost.sin_family, SOCK_STREAM, 0);
+ tt_assert(fake_listener >= 0);
+ tt_assert(bind(fake_listener, sa, slen) == 0);
+ tt_assert(getsockname(fake_listener, sa, &slen) == 0);
+ bev = bufferevent_socket_new(data->base, -1,
+ BEV_OPT_CLOSE_ON_FREE | BEV_OPT_DEFER_CALLBACKS);
+ tt_assert(bev);
+ bufferevent_setcb(bev, NULL, NULL, want_fail_eventcb, data->base);
+
+ r = bufferevent_socket_connect(bev, sa, slen);
+ /* XXXX we'd like to test the '0' case everywhere, but FreeBSD tells
+ * detects the error immediately, which is not really wrong of it. */
+ tt_want(r == 0 || r == -1);
+
+ /* Close the listener socket after a second. This should trigger
+ "connection refused" on some other platforms, including OSX. */
+ evtimer_assign(&close_listener_event, data->base, close_socket_cb,
+ &fake_listener);
+ event_add(&close_listener_event, &one_second);
+ close_listener_event_added = 1;
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+end:
+ if (fake_listener >= 0)
+ evutil_closesocket(fake_listener);
+
+ if (bev)
+ bufferevent_free(bev);
+
+ if (close_listener_event_added)
+ event_del(&close_listener_event);
+}
+
+struct timeout_cb_result {
+ struct timeval read_timeout_at;
+ struct timeval write_timeout_at;
+ struct timeval last_wrote_at;
+ int n_read_timeouts;
+ int n_write_timeouts;
+ int total_calls;
+};
+
+static void
+bev_timeout_write_cb(struct bufferevent *bev, void *arg)
+{
+ struct timeout_cb_result *res = arg;
+ evutil_gettimeofday(&res->last_wrote_at, NULL);
+}
+
+static void
+bev_timeout_event_cb(struct bufferevent *bev, short what, void *arg)
+{
+ struct timeout_cb_result *res = arg;
+ ++res->total_calls;
+
+ if ((what & (BEV_EVENT_READING|BEV_EVENT_TIMEOUT))
+ == (BEV_EVENT_READING|BEV_EVENT_TIMEOUT)) {
+ evutil_gettimeofday(&res->read_timeout_at, NULL);
+ ++res->n_read_timeouts;
+ }
+ if ((what & (BEV_EVENT_WRITING|BEV_EVENT_TIMEOUT))
+ == (BEV_EVENT_WRITING|BEV_EVENT_TIMEOUT)) {
+ evutil_gettimeofday(&res->write_timeout_at, NULL);
+ ++res->n_write_timeouts;
+ }
+}
+
+static void
+test_bufferevent_timeouts(void *arg)
+{
+ /* "arg" is a string containing "pair" and/or "filter". */
+ struct bufferevent *bev1 = NULL, *bev2 = NULL;
+ struct basic_test_data *data = arg;
+ int use_pair = 0, use_filter = 0;
+ struct timeval tv_w, tv_r, started_at;
+ struct timeout_cb_result res1, res2;
+ char buf[1024];
+
+ memset(&res1, 0, sizeof(res1));
+ memset(&res2, 0, sizeof(res2));
+
+ if (strstr((char*)data->setup_data, "pair"))
+ use_pair = 1;
+ if (strstr((char*)data->setup_data, "filter"))
+ use_filter = 1;
+
+ if (use_pair) {
+ struct bufferevent *p[2];
+ tt_int_op(0, ==, bufferevent_pair_new(data->base, 0, p));
+ bev1 = p[0];
+ bev2 = p[1];
+ } else {
+ bev1 = bufferevent_socket_new(data->base, data->pair[0], 0);
+ bev2 = bufferevent_socket_new(data->base, data->pair[1], 0);
+ }
+
+ tt_assert(bev1);
+ tt_assert(bev2);
+
+ if (use_filter) {
+ struct bufferevent *bevf1, *bevf2;
+ bevf1 = bufferevent_filter_new(bev1, NULL, NULL,
+ BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+ bevf2 = bufferevent_filter_new(bev2, NULL, NULL,
+ BEV_OPT_CLOSE_ON_FREE, NULL, NULL);
+ tt_assert(bevf1);
+ tt_assert(bevf2);
+ bev1 = bevf1;
+ bev2 = bevf2;
+ }
+
+ /* Do this nice and early. */
+ bufferevent_disable(bev2, EV_READ);
+
+ /* bev1 will try to write and read. Both will time out. */
+ evutil_gettimeofday(&started_at, NULL);
+ tv_w.tv_sec = tv_r.tv_sec = 0;
+ tv_w.tv_usec = 100*1000;
+ tv_r.tv_usec = 150*1000;
+ bufferevent_setcb(bev1, NULL, bev_timeout_write_cb,
+ bev_timeout_event_cb, &res1);
+ bufferevent_setwatermark(bev1, EV_WRITE, 1024*1024+10, 0);
+ bufferevent_set_timeouts(bev1, &tv_r, &tv_w);
+ if (use_pair) {
+ /* For a pair, the fact that the other side isn't reading
+ * makes the writer stall */
+ bufferevent_write(bev1, "ABCDEFG", 7);
+ } else {
+ /* For a real socket, the kernel's TCP buffers can eat a
+ * fair number of bytes; make sure that at some point we
+ * have some bytes that will stall. */
+ struct evbuffer *output = bufferevent_get_output(bev1);
+ int i;
+ memset(buf, 0xbb, sizeof(buf));
+ for (i=0;i<1024;++i) {
+ evbuffer_add_reference(output, buf, sizeof(buf),
+ NULL, NULL);
+ }
+ }
+ bufferevent_enable(bev1, EV_READ|EV_WRITE);
+
+ /* bev2 has nothing to say, and isn't listening. */
+ bufferevent_setcb(bev2, NULL, bev_timeout_write_cb,
+ bev_timeout_event_cb, &res2);
+ tv_w.tv_sec = tv_r.tv_sec = 0;
+ tv_w.tv_usec = 200*1000;
+ tv_r.tv_usec = 100*1000;
+ bufferevent_set_timeouts(bev2, &tv_r, &tv_w);
+ bufferevent_enable(bev2, EV_WRITE);
+
+ tv_r.tv_sec = 0;
+ tv_r.tv_usec = 350000;
+
+ event_base_loopexit(data->base, &tv_r);
+ event_base_dispatch(data->base);
+
+ /* XXXX Test that actually reading or writing a little resets the
+ * timeouts. */
+
+ /* Each buf1 timeout happens, and happens only once. */
+ tt_want(res1.n_read_timeouts);
+ tt_want(res1.n_write_timeouts);
+ tt_want(res1.n_read_timeouts == 1);
+ tt_want(res1.n_write_timeouts == 1);
+
+ test_timeval_diff_eq(&started_at, &res1.read_timeout_at, 150);
+ test_timeval_diff_eq(&started_at, &res1.write_timeout_at, 100);
+
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+}
+
+static void
+trigger_failure_cb(evutil_socket_t fd, short what, void *ctx)
+{
+ TT_FAIL(("The triggered callback did not fire or the machine is really slow (try increasing timeout)."));
+}
+
+static void
+trigger_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct event_base *base = ctx;
+ if (what == ~0) {
+ TT_BLATHER(("Event successfully triggered."));
+ event_base_loopexit(base, NULL);
+ return;
+ }
+ reader_eventcb(bev, what, ctx);
+}
+
+static void
+trigger_readcb_triggered(struct bufferevent *bev, void *ctx)
+{
+ TT_BLATHER(("Read successfully triggered."));
+ n_reads_invoked++;
+ bufferevent_trigger_event(bev, ~0, bufferevent_trigger_test_flags);
+}
+
+static void
+trigger_readcb(struct bufferevent *bev, void *ctx)
+{
+ struct timeval timeout = { 30, 0 };
+ struct event_base *base = ctx;
+ size_t low, high, len;
+ int expected_reads;
+
+ TT_BLATHER(("Read invoked on %d.", (int)bufferevent_getfd(bev)));
+ expected_reads = ++n_reads_invoked;
+
+ bufferevent_setcb(bev, trigger_readcb_triggered, NULL, trigger_eventcb, ctx);
+
+ bufferevent_getwatermark(bev, EV_READ, &low, &high);
+ len = evbuffer_get_length(bufferevent_get_input(bev));
+
+ bufferevent_setwatermark(bev, EV_READ, len + 1, 0);
+ bufferevent_trigger(bev, EV_READ, bufferevent_trigger_test_flags);
+ /* no callback expected */
+ tt_int_op(n_reads_invoked, ==, expected_reads);
+
+ if ((bufferevent_trigger_test_flags & BEV_TRIG_DEFER_CALLBACKS) ||
+ (bufferevent_connect_test_flags & BEV_OPT_DEFER_CALLBACKS)) {
+ /* will be deferred */
+ } else {
+ expected_reads++;
+ }
+
+ event_base_once(base, -1, EV_TIMEOUT, trigger_failure_cb, NULL, &timeout);
+
+ bufferevent_trigger(bev, EV_READ,
+ bufferevent_trigger_test_flags | BEV_TRIG_IGNORE_WATERMARKS);
+ tt_int_op(n_reads_invoked, ==, expected_reads);
+
+ bufferevent_setwatermark(bev, EV_READ, low, high);
+end:
+ ;
+}
+
+static void
+test_bufferevent_trigger(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evconnlistener *lev=NULL;
+ struct bufferevent *bev=NULL;
+ struct sockaddr_in localhost;
+ struct sockaddr_storage ss;
+ struct sockaddr *sa;
+ ev_socklen_t slen;
+
+ int be_flags=BEV_OPT_CLOSE_ON_FREE;
+ int trig_flags=0;
+
+ if (strstr((char*)data->setup_data, "defer")) {
+ be_flags |= BEV_OPT_DEFER_CALLBACKS;
+ }
+ bufferevent_connect_test_flags = be_flags;
+
+ if (strstr((char*)data->setup_data, "postpone")) {
+ trig_flags |= BEV_TRIG_DEFER_CALLBACKS;
+ }
+ bufferevent_trigger_test_flags = trig_flags;
+
+ memset(&localhost, 0, sizeof(localhost));
+
+ localhost.sin_port = 0; /* pick-a-port */
+ localhost.sin_addr.s_addr = htonl(0x7f000001L);
+ localhost.sin_family = AF_INET;
+ sa = (struct sockaddr *)&localhost;
+ lev = evconnlistener_new_bind(data->base, listen_cb, data->base,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ 16, sa, sizeof(localhost));
+ tt_assert(lev);
+
+ sa = (struct sockaddr *)&ss;
+ slen = sizeof(ss);
+ if (regress_get_listener_addr(lev, sa, &slen) < 0) {
+ tt_abort_perror("getsockname");
+ }
+
+ tt_assert(!evconnlistener_enable(lev));
+ bev = bufferevent_socket_new(data->base, -1, be_flags);
+ tt_assert(bev);
+ bufferevent_setcb(bev, trigger_readcb, NULL, trigger_eventcb, data->base);
+
+ bufferevent_enable(bev, EV_READ);
+
+ tt_want(!bufferevent_socket_connect(bev, sa, sizeof(localhost)));
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(n_reads_invoked, ==, 2);
+end:
+ if (lev)
+ evconnlistener_free(lev);
+
+ if (bev)
+ bufferevent_free(bev);
+}
+
+struct testcase_t bufferevent_testcases[] = {
+
+ LEGACY(bufferevent, TT_ISOLATED),
+ LEGACY(bufferevent_pair, TT_ISOLATED),
+ LEGACY(bufferevent_watermarks, TT_ISOLATED),
+ LEGACY(bufferevent_pair_watermarks, TT_ISOLATED),
+ LEGACY(bufferevent_filters, TT_ISOLATED),
+ LEGACY(bufferevent_pair_filters, TT_ISOLATED),
+ { "bufferevent_connect", test_bufferevent_connect, TT_FORK|TT_NEED_BASE,
+ &basic_setup, (void*)"" },
+ { "bufferevent_connect_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"defer" },
+ { "bufferevent_connect_lock", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup, (void*)"lock" },
+ { "bufferevent_connect_lock_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"defer lock" },
+ { "bufferevent_connect_unlocked_cbs", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"lock defer unlocked" },
+ { "bufferevent_connect_fail", test_bufferevent_connect_fail,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "bufferevent_timeout", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR, &basic_setup, (void*)"" },
+ { "bufferevent_timeout_pair", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"pair" },
+ { "bufferevent_timeout_filter", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"filter" },
+ { "bufferevent_timeout_filter_pair", test_bufferevent_timeouts,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"filter pair" },
+ { "bufferevent_trigger", test_bufferevent_trigger, TT_FORK|TT_NEED_BASE,
+ &basic_setup, (void*)"" },
+ { "bufferevent_trigger_defer", test_bufferevent_trigger,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (void*)"defer" },
+ { "bufferevent_trigger_postpone", test_bufferevent_trigger,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"postpone" },
+ { "bufferevent_trigger_defer_postpone", test_bufferevent_trigger,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS, &basic_setup,
+ (void*)"defer postpone" },
+#ifdef EVENT__HAVE_LIBZ
+ LEGACY(bufferevent_zlib, TT_ISOLATED),
+#else
+ { "bufferevent_zlib", NULL, TT_SKIP, NULL, NULL },
+#endif
+
+ END_OF_TESTCASES,
+};
+
+struct testcase_t bufferevent_iocp_testcases[] = {
+
+ LEGACY(bufferevent, TT_ISOLATED|TT_ENABLE_IOCP),
+ LEGACY(bufferevent_watermarks, TT_ISOLATED|TT_ENABLE_IOCP),
+ LEGACY(bufferevent_filters, TT_ISOLATED|TT_ENABLE_IOCP),
+ { "bufferevent_connect", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup, (void*)"" },
+ { "bufferevent_connect_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup, (void*)"defer" },
+ { "bufferevent_connect_lock", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS|TT_ENABLE_IOCP, &basic_setup,
+ (void*)"lock" },
+ { "bufferevent_connect_lock_defer", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_NEED_THREADS|TT_ENABLE_IOCP, &basic_setup,
+ (void*)"defer lock" },
+ { "bufferevent_connect_fail", test_bufferevent_connect_fail,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup, NULL },
+ { "bufferevent_connect_nonblocking", test_bufferevent_connect,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP, &basic_setup,
+ (void*)"unset_connectex" },
+
+ END_OF_TESTCASES,
+};
diff --git a/sntp/libevent/test/regress_dns.c b/sntp/libevent/test/regress_dns.c
new file mode 100644
index 0000000..338c4ee
--- /dev/null
+++ b/sntp/libevent/test/regress_dns.c
@@ -0,0 +1,1922 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "../util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <ws2tcpip.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/dns.h"
+#include "event2/dns_compat.h"
+#include "event2/dns_struct.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/event_struct.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "event2/bufferevent.h"
+#include "log-internal.h"
+#include "regress.h"
+#include "regress_testutils.h"
+
+static int dns_ok = 0;
+static int dns_got_cancel = 0;
+static int dns_err = 0;
+
+
+static void
+dns_gethostbyname_cb(int result, char type, int count, int ttl,
+ void *addresses, void *arg)
+{
+ dns_ok = dns_err = 0;
+
+ if (result == DNS_ERR_TIMEOUT) {
+ printf("[Timed out] ");
+ dns_err = result;
+ goto out;
+ }
+
+ if (result != DNS_ERR_NONE) {
+ printf("[Error code %d] ", result);
+ goto out;
+ }
+
+ TT_BLATHER(("type: %d, count: %d, ttl: %d: ", type, count, ttl));
+
+ switch (type) {
+ case DNS_IPv6_AAAA: {
+#if defined(EVENT__HAVE_STRUCT_IN6_ADDR) && defined(EVENT__HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
+ struct in6_addr *in6_addrs = addresses;
+ char buf[INET6_ADDRSTRLEN+1];
+ int i;
+ /* a resolution that's not valid does not help */
+ if (ttl < 0)
+ goto out;
+ for (i = 0; i < count; ++i) {
+ const char *b = evutil_inet_ntop(AF_INET6, &in6_addrs[i], buf,sizeof(buf));
+ if (b)
+ TT_BLATHER(("%s ", b));
+ else
+ TT_BLATHER(("%s ", strerror(errno)));
+ }
+#endif
+ break;
+ }
+ case DNS_IPv4_A: {
+ struct in_addr *in_addrs = addresses;
+ int i;
+ /* a resolution that's not valid does not help */
+ if (ttl < 0)
+ goto out;
+ for (i = 0; i < count; ++i)
+ TT_BLATHER(("%s ", inet_ntoa(in_addrs[i])));
+ break;
+ }
+ case DNS_PTR:
+ /* may get at most one PTR */
+ if (count != 1)
+ goto out;
+
+ TT_BLATHER(("%s ", *(char **)addresses));
+ break;
+ default:
+ goto out;
+ }
+
+ dns_ok = type;
+
+out:
+ if (arg == NULL)
+ event_loopexit(NULL);
+ else
+ event_base_loopexit((struct event_base *)arg, NULL);
+}
+
+static void
+dns_gethostbyname(void)
+{
+ dns_ok = 0;
+ evdns_resolve_ipv4("www.monkey.org", 0, dns_gethostbyname_cb, NULL);
+ event_dispatch();
+
+ tt_int_op(dns_ok, ==, DNS_IPv4_A);
+ test_ok = dns_ok;
+end:
+ ;
+}
+
+static void
+dns_gethostbyname6(void)
+{
+ dns_ok = 0;
+ evdns_resolve_ipv6("www.ietf.org", 0, dns_gethostbyname_cb, NULL);
+ event_dispatch();
+
+ if (!dns_ok && dns_err == DNS_ERR_TIMEOUT) {
+ tt_skip();
+ }
+
+ tt_int_op(dns_ok, ==, DNS_IPv6_AAAA);
+ test_ok = 1;
+end:
+ ;
+}
+
+static void
+dns_gethostbyaddr(void)
+{
+ struct in_addr in;
+ in.s_addr = htonl(0x7f000001ul); /* 127.0.0.1 */
+ dns_ok = 0;
+ evdns_resolve_reverse(&in, 0, dns_gethostbyname_cb, NULL);
+ event_dispatch();
+
+ tt_int_op(dns_ok, ==, DNS_PTR);
+ test_ok = dns_ok;
+end:
+ ;
+}
+
+static void
+dns_resolve_reverse(void *ptr)
+{
+ struct in_addr in;
+ struct event_base *base = event_base_new();
+ struct evdns_base *dns = evdns_base_new(base, 1/* init name servers */);
+ struct evdns_request *req = NULL;
+
+ tt_assert(base);
+ tt_assert(dns);
+ in.s_addr = htonl(0x7f000001ul); /* 127.0.0.1 */
+ dns_ok = 0;
+
+ req = evdns_base_resolve_reverse(
+ dns, &in, 0, dns_gethostbyname_cb, base);
+ tt_assert(req);
+
+ event_base_dispatch(base);
+
+ tt_int_op(dns_ok, ==, DNS_PTR);
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (base)
+ event_base_free(base);
+}
+
+static int n_server_responses = 0;
+
+static void
+dns_server_request_cb(struct evdns_server_request *req, void *data)
+{
+ int i, r;
+ const char TEST_ARPA[] = "11.11.168.192.in-addr.arpa";
+ const char TEST_IN6[] =
+ "f.e.f.e." "0.0.0.0." "0.0.0.0." "1.1.1.1."
+ "a.a.a.a." "0.0.0.0." "0.0.0.0." "0.f.f.f.ip6.arpa";
+
+ for (i = 0; i < req->nquestions; ++i) {
+ const int qtype = req->questions[i]->type;
+ const int qclass = req->questions[i]->dns_question_class;
+ const char *qname = req->questions[i]->name;
+
+ struct in_addr ans;
+ ans.s_addr = htonl(0xc0a80b0bUL); /* 192.168.11.11 */
+ if (qtype == EVDNS_TYPE_A &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "zz.example.com")) {
+ r = evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 12345);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_AAAA &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "zz.example.com")) {
+ char addr6[17] = "abcdefghijklmnop";
+ r = evdns_server_request_add_aaaa_reply(req,
+ qname, 1, addr6, 123);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_PTR &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, TEST_ARPA)) {
+ r = evdns_server_request_add_ptr_reply(req, NULL,
+ qname, "ZZ.EXAMPLE.COM", 54321);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_PTR &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, TEST_IN6)){
+ r = evdns_server_request_add_ptr_reply(req, NULL,
+ qname,
+ "ZZ-INET6.EXAMPLE.COM", 54322);
+ if (r<0)
+ dns_ok = 0;
+ } else if (qtype == EVDNS_TYPE_A &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "drop.example.com")) {
+ if (evdns_server_request_drop(req)<0)
+ dns_ok = 0;
+ return;
+ } else {
+ printf("Unexpected question %d %d \"%s\" ",
+ qtype, qclass, qname);
+ dns_ok = 0;
+ }
+ }
+ r = evdns_server_request_respond(req, 0);
+ if (r<0) {
+ printf("Couldn't send reply. ");
+ dns_ok = 0;
+ }
+}
+
+static void
+dns_server_gethostbyname_cb(int result, char type, int count, int ttl,
+ void *addresses, void *arg)
+{
+ if (result == DNS_ERR_CANCEL) {
+ if (arg != (void*)(char*)90909) {
+ printf("Unexpected cancelation");
+ dns_ok = 0;
+ }
+ dns_got_cancel = 1;
+ goto out;
+ }
+ if (result != DNS_ERR_NONE) {
+ printf("Unexpected result %d. ", result);
+ dns_ok = 0;
+ goto out;
+ }
+ if (count != 1) {
+ printf("Unexpected answer count %d. ", count);
+ dns_ok = 0;
+ goto out;
+ }
+ switch (type) {
+ case DNS_IPv4_A: {
+ struct in_addr *in_addrs = addresses;
+ if (in_addrs[0].s_addr != htonl(0xc0a80b0bUL) || ttl != 12345) {
+ printf("Bad IPv4 response \"%s\" %d. ",
+ inet_ntoa(in_addrs[0]), ttl);
+ dns_ok = 0;
+ goto out;
+ }
+ break;
+ }
+ case DNS_IPv6_AAAA: {
+#if defined (EVENT__HAVE_STRUCT_IN6_ADDR) && defined(EVENT__HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
+ struct in6_addr *in6_addrs = addresses;
+ char buf[INET6_ADDRSTRLEN+1];
+ if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16)
+ || ttl != 123) {
+ const char *b = evutil_inet_ntop(AF_INET6, &in6_addrs[0],buf,sizeof(buf));
+ printf("Bad IPv6 response \"%s\" %d. ", b, ttl);
+ dns_ok = 0;
+ goto out;
+ }
+#endif
+ break;
+ }
+ case DNS_PTR: {
+ char **addrs = addresses;
+ if (arg != (void*)6) {
+ if (strcmp(addrs[0], "ZZ.EXAMPLE.COM") ||
+ ttl != 54321) {
+ printf("Bad PTR response \"%s\" %d. ",
+ addrs[0], ttl);
+ dns_ok = 0;
+ goto out;
+ }
+ } else {
+ if (strcmp(addrs[0], "ZZ-INET6.EXAMPLE.COM") ||
+ ttl != 54322) {
+ printf("Bad ipv6 PTR response \"%s\" %d. ",
+ addrs[0], ttl);
+ dns_ok = 0;
+ goto out;
+ }
+ }
+ break;
+ }
+ default:
+ printf("Bad response type %d. ", type);
+ dns_ok = 0;
+ }
+ out:
+ if (++n_server_responses == 3) {
+ event_loopexit(NULL);
+ }
+}
+
+static void
+dns_server(void)
+{
+ evutil_socket_t sock=-1;
+ struct sockaddr_in my_addr;
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+ struct evdns_server_port *port=NULL;
+ struct in_addr resolve_addr;
+ struct in6_addr resolve_addr6;
+ struct evdns_base *base=NULL;
+ struct evdns_request *req=NULL;
+
+ dns_ok = 1;
+
+ base = evdns_base_new(NULL, 0);
+
+ /* Now configure a nameserver port. */
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock<0) {
+ tt_abort_perror("socket");
+ }
+
+ evutil_make_socket_nonblocking(sock);
+
+ memset(&my_addr, 0, sizeof(my_addr));
+ my_addr.sin_family = AF_INET;
+ my_addr.sin_port = 0; /* kernel picks */
+ my_addr.sin_addr.s_addr = htonl(0x7f000001UL);
+ if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr)) < 0) {
+ tt_abort_perror("bind");
+ }
+ slen = sizeof(ss);
+ if (getsockname(sock, (struct sockaddr*)&ss, &slen) < 0) {
+ tt_abort_perror("getsockname");
+ }
+
+ port = evdns_add_server_port(sock, 0, dns_server_request_cb, NULL);
+
+ /* Add ourself as the only nameserver, and make sure we really are
+ * the only nameserver. */
+ evdns_base_nameserver_sockaddr_add(base, (struct sockaddr*)&ss, slen, 0);
+ tt_int_op(evdns_base_count_nameservers(base), ==, 1);
+
+ /* Send some queries. */
+ evdns_base_resolve_ipv4(base, "zz.example.com", DNS_QUERY_NO_SEARCH,
+ dns_server_gethostbyname_cb, NULL);
+ evdns_base_resolve_ipv6(base, "zz.example.com", DNS_QUERY_NO_SEARCH,
+ dns_server_gethostbyname_cb, NULL);
+ resolve_addr.s_addr = htonl(0xc0a80b0bUL); /* 192.168.11.11 */
+ evdns_base_resolve_reverse(base, &resolve_addr, 0,
+ dns_server_gethostbyname_cb, NULL);
+ memcpy(resolve_addr6.s6_addr,
+ "\xff\xf0\x00\x00\x00\x00\xaa\xaa"
+ "\x11\x11\x00\x00\x00\x00\xef\xef", 16);
+ evdns_base_resolve_reverse_ipv6(base, &resolve_addr6, 0,
+ dns_server_gethostbyname_cb, (void*)6);
+
+ req = evdns_base_resolve_ipv4(base,
+ "drop.example.com", DNS_QUERY_NO_SEARCH,
+ dns_server_gethostbyname_cb, (void*)(char*)90909);
+
+ evdns_cancel_request(base, req);
+
+ event_dispatch();
+
+ tt_assert(dns_got_cancel);
+ test_ok = dns_ok;
+
+end:
+ if (port)
+ evdns_close_server_port(port);
+ if (sock >= 0)
+ evutil_closesocket(sock);
+ if (base)
+ evdns_base_free(base, 0);
+}
+
+static int n_replies_left;
+static struct event_base *exit_base;
+
+struct generic_dns_callback_result {
+ int result;
+ char type;
+ int count;
+ int ttl;
+ size_t addrs_len;
+ void *addrs;
+ char addrs_buf[256];
+};
+
+static void
+generic_dns_callback(int result, char type, int count, int ttl, void *addresses,
+ void *arg)
+{
+ size_t len;
+ struct generic_dns_callback_result *res = arg;
+ res->result = result;
+ res->type = type;
+ res->count = count;
+ res->ttl = ttl;
+
+ if (type == DNS_IPv4_A)
+ len = count * 4;
+ else if (type == DNS_IPv6_AAAA)
+ len = count * 16;
+ else if (type == DNS_PTR)
+ len = strlen(addresses)+1;
+ else {
+ res->addrs_len = len = 0;
+ res->addrs = NULL;
+ }
+ if (len) {
+ res->addrs_len = len;
+ if (len > 256)
+ len = 256;
+ memcpy(res->addrs_buf, addresses, len);
+ res->addrs = res->addrs_buf;
+ }
+
+ if (--n_replies_left == 0)
+ event_base_loopexit(exit_base, NULL);
+}
+
+static struct regress_dns_server_table search_table[] = {
+ { "host.a.example.com", "err", "3", 0 },
+ { "host.b.example.com", "err", "3", 0 },
+ { "host.c.example.com", "A", "11.22.33.44", 0 },
+ { "host2.a.example.com", "err", "3", 0 },
+ { "host2.b.example.com", "A", "200.100.0.100", 0 },
+ { "host2.c.example.com", "err", "3", 0 },
+ { "hostn.a.example.com", "errsoa", "0", 0 },
+ { "hostn.b.example.com", "errsoa", "3", 0 },
+ { "hostn.c.example.com", "err", "0", 0 },
+
+ { "host", "err", "3", 0 },
+ { "host2", "err", "3", 0 },
+ { "*", "err", "3", 0 },
+ { NULL, NULL, NULL, 0 }
+};
+
+static void
+dns_search_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+
+ struct generic_dns_callback_result r[8];
+
+ tt_assert(regress_dnsserver(base, &portnum, search_table));
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, 0);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+
+ evdns_base_search_add(dns, "a.example.com");
+ evdns_base_search_add(dns, "b.example.com");
+ evdns_base_search_add(dns, "c.example.com");
+
+ n_replies_left = sizeof(r)/sizeof(r[0]);
+ exit_base = base;
+
+ evdns_base_resolve_ipv4(dns, "host", 0, generic_dns_callback, &r[0]);
+ evdns_base_resolve_ipv4(dns, "host2", 0, generic_dns_callback, &r[1]);
+ evdns_base_resolve_ipv4(dns, "host", DNS_NO_SEARCH, generic_dns_callback, &r[2]);
+ evdns_base_resolve_ipv4(dns, "host2", DNS_NO_SEARCH, generic_dns_callback, &r[3]);
+ evdns_base_resolve_ipv4(dns, "host3", 0, generic_dns_callback, &r[4]);
+ evdns_base_resolve_ipv4(dns, "hostn.a.example.com", DNS_NO_SEARCH, generic_dns_callback, &r[5]);
+ evdns_base_resolve_ipv4(dns, "hostn.b.example.com", DNS_NO_SEARCH, generic_dns_callback, &r[6]);
+ evdns_base_resolve_ipv4(dns, "hostn.c.example.com", DNS_NO_SEARCH, generic_dns_callback, &r[7]);
+
+ event_base_dispatch(base);
+
+ tt_int_op(r[0].type, ==, DNS_IPv4_A);
+ tt_int_op(r[0].count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r[0].addrs)[0], ==, htonl(0x0b16212c));
+ tt_int_op(r[1].type, ==, DNS_IPv4_A);
+ tt_int_op(r[1].count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r[1].addrs)[0], ==, htonl(0xc8640064));
+ tt_int_op(r[2].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[3].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[4].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[5].result, ==, DNS_ERR_NODATA);
+ tt_int_op(r[5].ttl, ==, 42);
+ tt_int_op(r[6].result, ==, DNS_ERR_NOTEXIST);
+ tt_int_op(r[6].ttl, ==, 42);
+ tt_int_op(r[7].result, ==, DNS_ERR_NODATA);
+ tt_int_op(r[7].ttl, ==, 0);
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+
+ regress_clean_dnsserver();
+}
+
+static int request_count = 0;
+static struct evdns_request *current_req = NULL;
+
+static void
+search_cancel_server_cb(struct evdns_server_request *req, void *data)
+{
+ const char *question;
+
+ if (req->nquestions != 1)
+ TT_DIE(("Only handling one question at a time; got %d",
+ req->nquestions));
+
+ question = req->questions[0]->name;
+
+ TT_BLATHER(("got question, %s", question));
+
+ tt_assert(request_count > 0);
+ tt_assert(!evdns_server_request_respond(req, 3));
+
+ if (!--request_count)
+ evdns_cancel_request(NULL, current_req);
+
+end:
+ ;
+}
+
+static void
+dns_search_cancel_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ struct evdns_server_port *port = NULL;
+ ev_uint16_t portnum = 0;
+ struct generic_dns_callback_result r1;
+ char buf[64];
+
+ port = regress_get_dnsserver(base, &portnum, NULL,
+ search_cancel_server_cb, NULL);
+ tt_assert(port);
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, 0);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+
+ evdns_base_search_add(dns, "a.example.com");
+ evdns_base_search_add(dns, "b.example.com");
+ evdns_base_search_add(dns, "c.example.com");
+ evdns_base_search_add(dns, "d.example.com");
+
+ exit_base = base;
+ request_count = 3;
+ n_replies_left = 1;
+
+ current_req = evdns_base_resolve_ipv4(dns, "host", 0,
+ generic_dns_callback, &r1);
+ event_base_dispatch(base);
+
+ tt_int_op(r1.result, ==, DNS_ERR_CANCEL);
+
+end:
+ if (port)
+ evdns_close_server_port(port);
+ if (dns)
+ evdns_base_free(dns, 0);
+}
+
+static void
+fail_server_cb(struct evdns_server_request *req, void *data)
+{
+ const char *question;
+ int *count = data;
+ struct in_addr in;
+
+ /* Drop the first N requests that we get. */
+ if (*count > 0) {
+ --*count;
+ tt_want(! evdns_server_request_drop(req));
+ return;
+ }
+
+ if (req->nquestions != 1)
+ TT_DIE(("Only handling one question at a time; got %d",
+ req->nquestions));
+
+ question = req->questions[0]->name;
+
+ if (!evutil_ascii_strcasecmp(question, "google.com")) {
+ /* Detect a probe, and get out of the loop. */
+ event_base_loopexit(exit_base, NULL);
+ }
+
+ tt_assert(evutil_inet_pton(AF_INET, "16.32.64.128", &in));
+ evdns_server_request_add_a_reply(req, question, 1, &in.s_addr,
+ 100);
+ tt_assert(! evdns_server_request_respond(req, 0))
+ return;
+end:
+ tt_want(! evdns_server_request_drop(req));
+}
+
+static void
+dns_retry_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_server_port *port = NULL;
+ struct evdns_base *dns = NULL;
+ int drop_count = 2;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+
+ struct generic_dns_callback_result r1;
+
+ port = regress_get_dnsserver(base, &portnum, NULL,
+ fail_server_cb, &drop_count);
+ tt_assert(port);
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, 0);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+ tt_assert(! evdns_base_set_option(dns, "timeout", "0.2"));
+ tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "10"));
+ tt_assert(! evdns_base_set_option(dns, "initial-probe-timeout", "0.1"));
+
+ evdns_base_resolve_ipv4(dns, "host.example.com", 0,
+ generic_dns_callback, &r1);
+
+ n_replies_left = 1;
+ exit_base = base;
+
+ event_base_dispatch(base);
+
+ tt_int_op(drop_count, ==, 0);
+
+ tt_int_op(r1.type, ==, DNS_IPv4_A);
+ tt_int_op(r1.count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r1.addrs)[0], ==, htonl(0x10204080));
+
+ /* Now try again, but this time have the server get treated as
+ * failed, so we can send it a test probe. */
+ drop_count = 4;
+ tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "2"));
+ tt_assert(! evdns_base_set_option(dns, "attempts:", "3"));
+ memset(&r1, 0, sizeof(r1));
+
+ evdns_base_resolve_ipv4(dns, "host.example.com", 0,
+ generic_dns_callback, &r1);
+
+ n_replies_left = 2;
+
+ /* This will run until it answers the "google.com" probe request. */
+ event_base_dispatch(base);
+
+ /* We'll treat the server as failed here. */
+ tt_int_op(r1.result, ==, DNS_ERR_TIMEOUT);
+
+ /* It should work this time. */
+ tt_int_op(drop_count, ==, 0);
+ evdns_base_resolve_ipv4(dns, "host.example.com", 0,
+ generic_dns_callback, &r1);
+
+ event_base_dispatch(base);
+ tt_int_op(r1.result, ==, DNS_ERR_NONE);
+ tt_int_op(r1.type, ==, DNS_IPv4_A);
+ tt_int_op(r1.count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r1.addrs)[0], ==, htonl(0x10204080));
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (port)
+ evdns_close_server_port(port);
+}
+
+static struct regress_dns_server_table internal_error_table[] = {
+ /* Error 4 (NOTIMPL) makes us reissue the request to another server
+ if we can.
+
+ XXXX we should reissue under a much wider set of circumstances!
+ */
+ { "foof.example.com", "err", "4", 0 },
+ { NULL, NULL, NULL, 0 }
+};
+
+static struct regress_dns_server_table reissue_table[] = {
+ { "foof.example.com", "A", "240.15.240.15", 0 },
+ { NULL, NULL, NULL, 0 }
+};
+
+static void
+dns_reissue_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_server_port *port1 = NULL, *port2 = NULL;
+ struct evdns_base *dns = NULL;
+ struct generic_dns_callback_result r1;
+ ev_uint16_t portnum1 = 0, portnum2=0;
+ char buf1[64], buf2[64];
+
+ port1 = regress_get_dnsserver(base, &portnum1, NULL,
+ regress_dns_server_cb, internal_error_table);
+ tt_assert(port1);
+ port2 = regress_get_dnsserver(base, &portnum2, NULL,
+ regress_dns_server_cb, reissue_table);
+ tt_assert(port2);
+ evutil_snprintf(buf1, sizeof(buf1), "127.0.0.1:%d", (int)portnum1);
+ evutil_snprintf(buf2, sizeof(buf2), "127.0.0.1:%d", (int)portnum2);
+
+ dns = evdns_base_new(base, 0);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf1));
+ tt_assert(! evdns_base_set_option(dns, "timeout:", "0.3"));
+ tt_assert(! evdns_base_set_option(dns, "max-timeouts:", "2"));
+ tt_assert(! evdns_base_set_option(dns, "attempts:", "5"));
+
+ memset(&r1, 0, sizeof(r1));
+ evdns_base_resolve_ipv4(dns, "foof.example.com", 0,
+ generic_dns_callback, &r1);
+
+ /* Add this after, so that we are sure to get a reissue. */
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf2));
+
+ n_replies_left = 1;
+ exit_base = base;
+
+ event_base_dispatch(base);
+ tt_int_op(r1.result, ==, DNS_ERR_NONE);
+ tt_int_op(r1.type, ==, DNS_IPv4_A);
+ tt_int_op(r1.count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r1.addrs)[0], ==, htonl(0xf00ff00f));
+
+ /* Make sure we dropped at least once. */
+ tt_int_op(internal_error_table[0].seen, >, 0);
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (port1)
+ evdns_close_server_port(port1);
+ if (port2)
+ evdns_close_server_port(port2);
+}
+
+#if 0
+static void
+dumb_bytes_fn(char *p, size_t n)
+{
+ unsigned i;
+ /* This gets us 6 bits of entropy per transaction ID, which means we
+ * will have probably have collisions and need to pick again. */
+ for (i=0;i<n;++i)
+ p[i] = (char)(rand() & 7);
+}
+#endif
+
+static void
+dns_inflight_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evdns_base *dns = NULL;
+ ev_uint16_t portnum = 0;
+ char buf[64];
+
+ struct generic_dns_callback_result r[20];
+ int i;
+
+ tt_assert(regress_dnsserver(base, &portnum, reissue_table));
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)portnum);
+
+ dns = evdns_base_new(base, 0);
+ tt_assert(!evdns_base_nameserver_ip_add(dns, buf));
+ tt_assert(! evdns_base_set_option(dns, "max-inflight:", "3"));
+ tt_assert(! evdns_base_set_option(dns, "randomize-case:", "0"));
+
+ for (i=0;i<20;++i)
+ evdns_base_resolve_ipv4(dns, "foof.example.com", 0, generic_dns_callback, &r[i]);
+
+ n_replies_left = 20;
+ exit_base = base;
+
+ event_base_dispatch(base);
+
+ for (i=0;i<20;++i) {
+ tt_int_op(r[i].type, ==, DNS_IPv4_A);
+ tt_int_op(r[i].count, ==, 1);
+ tt_int_op(((ev_uint32_t*)r[i].addrs)[0], ==, htonl(0xf00ff00f));
+ }
+
+end:
+ if (dns)
+ evdns_base_free(dns, 0);
+ regress_clean_dnsserver();
+}
+
+/* === Test for bufferevent_socket_connect_hostname */
+
+static int total_connected_or_failed = 0;
+static int total_n_accepted = 0;
+static struct event_base *be_connect_hostname_base = NULL;
+
+/* Implements a DNS server for the connect_hostname test and the
+ * getaddrinfo_async test */
+static void
+be_getaddrinfo_server_cb(struct evdns_server_request *req, void *data)
+{
+ int i;
+ int *n_got_p=data;
+ int added_any=0;
+ ++*n_got_p;
+
+ for (i=0;i<req->nquestions;++i) {
+ const int qtype = req->questions[i]->type;
+ const int qclass = req->questions[i]->dns_question_class;
+ const char *qname = req->questions[i]->name;
+ struct in_addr ans;
+ struct in6_addr ans6;
+ memset(&ans6, 0, sizeof(ans6));
+
+ TT_BLATHER(("Got question about %s, type=%d", qname, qtype));
+
+ if (qtype == EVDNS_TYPE_A &&
+ qclass == EVDNS_CLASS_INET &&
+ !evutil_ascii_strcasecmp(qname, "nobodaddy.example.com")) {
+ ans.s_addr = htonl(0x7f000001);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "nosuchplace.example.com")) {
+ /* ok, just say notfound. */
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "both.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ ans.s_addr = htonl(0x50502020);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (qtype == EVDNS_TYPE_AAAA) {
+ ans6.s6_addr[0] = 0x80;
+ ans6.s6_addr[1] = 0xff;
+ ans6.s6_addr[14] = 0xbb;
+ ans6.s6_addr[15] = 0xbb;
+ evdns_server_request_add_aaaa_reply(req, qname,
+ 1, &ans6.s6_addr, 2000);
+ added_any = 1;
+ }
+ evdns_server_request_add_cname_reply(req, qname,
+ "both-canonical.example.com", 1000);
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v4only.example.com") ||
+ !evutil_ascii_strcasecmp(qname, "v4assert.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ ans.s_addr = htonl(0x12345678);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v4assert.example.com")) {
+ TT_FAIL(("Got an AAAA request for v4assert"));
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6only.example.com") ||
+ !evutil_ascii_strcasecmp(qname, "v6assert.example.com")) {
+ if (qtype == EVDNS_TYPE_AAAA) {
+ ans6.s6_addr[0] = 0x0b;
+ ans6.s6_addr[1] = 0x0b;
+ ans6.s6_addr[14] = 0xf0;
+ ans6.s6_addr[15] = 0x0d;
+ evdns_server_request_add_aaaa_reply(req, qname,
+ 1, &ans6.s6_addr, 2000);
+ added_any = 1;
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6assert.example.com")) {
+ TT_FAIL(("Got a A request for v6assert"));
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6timeout.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ ans.s_addr = htonl(0xabcdef01);
+ evdns_server_request_add_a_reply(req, qname,
+ 1, &ans.s_addr, 2000);
+ added_any = 1;
+ } else if (qtype == EVDNS_TYPE_AAAA) {
+ /* Let the v6 request time out.*/
+ evdns_server_request_drop(req);
+ return;
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v4timeout.example.com")) {
+ if (qtype == EVDNS_TYPE_AAAA) {
+ ans6.s6_addr[0] = 0x0a;
+ ans6.s6_addr[1] = 0x0a;
+ ans6.s6_addr[14] = 0xff;
+ ans6.s6_addr[15] = 0x01;
+ evdns_server_request_add_aaaa_reply(req, qname,
+ 1, &ans6.s6_addr, 2000);
+ added_any = 1;
+ } else if (qtype == EVDNS_TYPE_A) {
+ /* Let the v4 request time out.*/
+ evdns_server_request_drop(req);
+ return;
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "v6timeout-nonexist.example.com")) {
+ if (qtype == EVDNS_TYPE_A) {
+ /* Fall through, give an nexist. */
+ } else if (qtype == EVDNS_TYPE_AAAA) {
+ /* Let the v6 request time out.*/
+ evdns_server_request_drop(req);
+ return;
+ }
+ } else if (!evutil_ascii_strcasecmp(qname,
+ "all-timeout.example.com")) {
+ /* drop all requests */
+ evdns_server_request_drop(req);
+ return;
+ } else {
+ TT_GRIPE(("Got weird request for %s",qname));
+ }
+ }
+ if (added_any) {
+ TT_BLATHER(("answering"));
+ evdns_server_request_respond(req, 0);
+ } else {
+ TT_BLATHER(("saying nexist."));
+ evdns_server_request_respond(req, 3);
+ }
+}
+
+/* Implements a listener for connect_hostname test. */
+static void
+nil_accept_cb(struct evconnlistener *l, evutil_socket_t fd, struct sockaddr *s,
+ int socklen, void *arg)
+{
+ int *p = arg;
+ (*p)++;
+ ++total_n_accepted;
+ /* don't do anything with the socket; let it close when we exit() */
+ if (total_n_accepted >= 3 && total_connected_or_failed >= 5)
+ event_base_loopexit(be_connect_hostname_base,
+ NULL);
+}
+
+struct be_conn_hostname_result {
+ int dnserr;
+ int what;
+};
+
+/* Bufferevent event callback for the connect_hostname test: remembers what
+ * event we got. */
+static void
+be_connect_hostname_event_cb(struct bufferevent *bev, short what, void *ctx)
+{
+ struct be_conn_hostname_result *got = ctx;
+ if (!got->what) {
+ TT_BLATHER(("Got a bufferevent event %d", what));
+ got->what = what;
+
+ if ((what & BEV_EVENT_CONNECTED) || (what & BEV_EVENT_ERROR)) {
+ int r;
+ if ((r = bufferevent_socket_get_dns_error(bev))) {
+ got->dnserr = r;
+ TT_BLATHER(("DNS error %d: %s", r,
+ evutil_gai_strerror(r)));
+ } ++total_connected_or_failed;
+ TT_BLATHER(("Got %d connections or errors.", total_connected_or_failed));
+
+ if (total_n_accepted >= 3 && total_connected_or_failed >= 5)
+ event_base_loopexit(be_connect_hostname_base,
+ NULL);
+ }
+ } else {
+ TT_FAIL(("Two events on one bufferevent. %d,%d",
+ got->what, (int)what));
+ }
+}
+
+static void
+test_bufferevent_connect_hostname(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evconnlistener *listener = NULL;
+ struct bufferevent *be1=NULL, *be2=NULL, *be3=NULL, *be4=NULL, *be5=NULL;
+ struct be_conn_hostname_result be1_outcome={0,0}, be2_outcome={0,0},
+ be3_outcome={0,0}, be4_outcome={0,0}, be5_outcome={0,0};
+ int expect_err5;
+ struct evdns_base *dns=NULL;
+ struct evdns_server_port *port=NULL;
+ struct sockaddr_in sin;
+ int listener_port=-1;
+ ev_uint16_t dns_port=0;
+ int n_accept=0, n_dns=0;
+ char buf[128];
+
+ be_connect_hostname_base = data->base;
+
+ /* Bind an address and figure out what port it's on. */
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+ sin.sin_port = 0;
+ listener = evconnlistener_new_bind(data->base, nil_accept_cb,
+ &n_accept,
+ LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC,
+ -1, (struct sockaddr *)&sin, sizeof(sin));
+ tt_assert(listener);
+ listener_port = regress_get_socket_port(
+ evconnlistener_get_fd(listener));
+
+ port = regress_get_dnsserver(data->base, &dns_port, NULL,
+ be_getaddrinfo_server_cb, &n_dns);
+ tt_assert(port);
+ tt_int_op(dns_port, >=, 0);
+
+ /* Start an evdns_base that uses the server as its resolver. */
+ dns = evdns_base_new(data->base, 0);
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", (int)dns_port);
+ evdns_base_nameserver_ip_add(dns, buf);
+
+ /* Now, finally, at long last, launch the bufferevents. One should do
+ * a failing lookup IP, one should do a successful lookup by IP,
+ * and one should do a successful lookup by hostname. */
+ be1 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be2 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be3 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be4 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+ be5 = bufferevent_socket_new(data->base, -1, BEV_OPT_CLOSE_ON_FREE);
+
+ bufferevent_setcb(be1, NULL, NULL, be_connect_hostname_event_cb,
+ &be1_outcome);
+ bufferevent_setcb(be2, NULL, NULL, be_connect_hostname_event_cb,
+ &be2_outcome);
+ bufferevent_setcb(be3, NULL, NULL, be_connect_hostname_event_cb,
+ &be3_outcome);
+ bufferevent_setcb(be4, NULL, NULL, be_connect_hostname_event_cb,
+ &be4_outcome);
+ bufferevent_setcb(be5, NULL, NULL, be_connect_hostname_event_cb,
+ &be5_outcome);
+
+ /* Launch an async resolve that will fail. */
+ tt_assert(!bufferevent_socket_connect_hostname(be1, dns, AF_INET,
+ "nosuchplace.example.com", listener_port));
+ /* Connect to the IP without resolving. */
+ tt_assert(!bufferevent_socket_connect_hostname(be2, dns, AF_INET,
+ "127.0.0.1", listener_port));
+ /* Launch an async resolve that will succeed. */
+ tt_assert(!bufferevent_socket_connect_hostname(be3, dns, AF_INET,
+ "nobodaddy.example.com", listener_port));
+ /* Use the blocking resolver. This one will fail if your resolver
+ * can't resolve localhost to 127.0.0.1 */
+ tt_assert(!bufferevent_socket_connect_hostname(be4, NULL, AF_INET,
+ "localhost", listener_port));
+ /* Use the blocking resolver with a nonexistent hostname. */
+ tt_assert(!bufferevent_socket_connect_hostname(be5, NULL, AF_INET,
+ "nonesuch.nowhere.example.com", 80));
+ {
+ /* The blocking resolver will use the system nameserver, which
+ * might tell us anything. (Yes, some twits even pretend that
+ * example.com is real.) Let's see what answer to expect. */
+ struct evutil_addrinfo hints, *ai = NULL;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
+ expect_err5 = evutil_getaddrinfo(
+ "nonesuch.nowhere.example.com", "80", &hints, &ai);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(be1_outcome.what, ==, BEV_EVENT_ERROR);
+ tt_int_op(be1_outcome.dnserr, ==, EVUTIL_EAI_NONAME);
+ tt_int_op(be2_outcome.what, ==, BEV_EVENT_CONNECTED);
+ tt_int_op(be2_outcome.dnserr, ==, 0);
+ tt_int_op(be3_outcome.what, ==, BEV_EVENT_CONNECTED);
+ tt_int_op(be3_outcome.dnserr, ==, 0);
+ tt_int_op(be4_outcome.what, ==, BEV_EVENT_CONNECTED);
+ tt_int_op(be4_outcome.dnserr, ==, 0);
+ if (expect_err5) {
+ tt_int_op(be5_outcome.what, ==, BEV_EVENT_ERROR);
+ tt_int_op(be5_outcome.dnserr, ==, expect_err5);
+ }
+
+ tt_int_op(n_accept, ==, 3);
+ tt_int_op(n_dns, ==, 2);
+
+end:
+ if (listener)
+ evconnlistener_free(listener);
+ if (port)
+ evdns_close_server_port(port);
+ if (dns)
+ evdns_base_free(dns, 0);
+ if (be1)
+ bufferevent_free(be1);
+ if (be2)
+ bufferevent_free(be2);
+ if (be3)
+ bufferevent_free(be3);
+ if (be4)
+ bufferevent_free(be4);
+ if (be5)
+ bufferevent_free(be5);
+}
+
+
+struct gai_outcome {
+ int err;
+ struct evutil_addrinfo *ai;
+};
+
+static int n_gai_results_pending = 0;
+static struct event_base *exit_base_on_no_pending_results = NULL;
+
+static void
+gai_cb(int err, struct evutil_addrinfo *res, void *ptr)
+{
+ struct gai_outcome *go = ptr;
+ go->err = err;
+ go->ai = res;
+ if (--n_gai_results_pending <= 0 && exit_base_on_no_pending_results)
+ event_base_loopexit(exit_base_on_no_pending_results, NULL);
+ if (n_gai_results_pending < 900)
+ TT_BLATHER(("Got an answer; expecting %d more.",
+ n_gai_results_pending));
+}
+
+static void
+cancel_gai_cb(evutil_socket_t fd, short what, void *ptr)
+{
+ struct evdns_getaddrinfo_request *r = ptr;
+ evdns_getaddrinfo_cancel(r);
+}
+
+static void
+test_getaddrinfo_async(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evutil_addrinfo hints, *a;
+ struct gai_outcome local_outcome;
+ struct gai_outcome a_out[12];
+ int i;
+ struct evdns_getaddrinfo_request *r;
+ char buf[128];
+ struct evdns_server_port *port = NULL;
+ ev_uint16_t dns_port = 0;
+ int n_dns_questions = 0;
+ struct evdns_base *dns_base;
+
+ memset(a_out, 0, sizeof(a_out));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+
+ dns_base = evdns_base_new(data->base, 0);
+ tt_assert(dns_base);
+
+ /* for localhost */
+ evdns_base_load_hosts(dns_base, NULL);
+
+ tt_assert(! evdns_base_set_option(dns_base, "timeout", "0.3"));
+ tt_assert(! evdns_base_set_option(dns_base, "getaddrinfo-allow-skew", "0.2"));
+
+ n_gai_results_pending = 10000; /* don't think about exiting yet. */
+
+ /* 1. Try some cases that will never hit the asynchronous resolver. */
+ /* 1a. Simple case with a symbolic service name */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ r = evdns_getaddrinfo(dns_base, "1.2.3.4", "http",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(! r);
+ if (!local_outcome.err) {
+ tt_ptr_op(local_outcome.ai,!=,NULL);
+ test_ai_eq(local_outcome.ai, "1.2.3.4:80", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+ } else {
+ TT_BLATHER(("Apparently we have no getservbyname."));
+ }
+
+ /* 1b. EVUTIL_AI_NUMERICHOST is set */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = EVUTIL_AI_NUMERICHOST;
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ r = evdns_getaddrinfo(dns_base, "www.google.com", "80",
+ &hints, gai_cb, &local_outcome);
+ tt_ptr_op(r,==,NULL);
+ tt_int_op(local_outcome.err,==,EVUTIL_EAI_NONAME);
+ tt_ptr_op(local_outcome.ai,==,NULL);
+
+ /* 1c. We give a numeric address (ipv6) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_protocol = IPPROTO_TCP;
+ r = evdns_getaddrinfo(dns_base, "f::f", "8008",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ tt_ptr_op(local_outcome.ai->ai_next,==,NULL);
+ test_ai_eq(local_outcome.ai, "[f::f]:8008", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1d. We give a numeric address (ipv4) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "5.6.7.8", NULL,
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ a = ai_find_by_protocol(local_outcome.ai, IPPROTO_TCP);
+ tt_assert(a);
+ test_ai_eq(a, "5.6.7.8", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_protocol(local_outcome.ai, IPPROTO_UDP);
+ tt_assert(a);
+ test_ai_eq(a, "5.6.7.8", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1e. nodename is NULL (bind) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = EVUTIL_AI_PASSIVE;
+ r = evdns_getaddrinfo(dns_base, NULL, "9090",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ /* we should get a v4 address of 0.0.0.0... */
+ a = ai_find_by_family(local_outcome.ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "0.0.0.0:9090", SOCK_DGRAM, IPPROTO_UDP);
+ /* ... and a v6 address of ::0 */
+ a = ai_find_by_family(local_outcome.ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::]:9090", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1f. nodename is NULL (connect) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evdns_getaddrinfo(dns_base, NULL, "2",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ /* we should get a v4 address of 127.0.0.1 .... */
+ a = ai_find_by_family(local_outcome.ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "127.0.0.1:2", SOCK_STREAM, IPPROTO_TCP);
+ /* ... and a v6 address of ::1 */
+ a = ai_find_by_family(local_outcome.ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::1]:2", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1g. We find localhost immediately. (pf_unspec) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evdns_getaddrinfo(dns_base, "LOCALHOST", "80",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(!r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ /* we should get a v4 address of 127.0.0.1 .... */
+ a = ai_find_by_family(local_outcome.ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "127.0.0.1:80", SOCK_STREAM, IPPROTO_TCP);
+ /* ... and a v6 address of ::1 */
+ a = ai_find_by_family(local_outcome.ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::1]:80", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 1g. We find localhost immediately. (pf_inet6) */
+ memset(&hints, 0, sizeof(hints));
+ memset(&local_outcome, 0, sizeof(local_outcome));
+ hints.ai_family = PF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evdns_getaddrinfo(dns_base, "LOCALHOST", "9999",
+ &hints, gai_cb, &local_outcome);
+ tt_assert(! r);
+ tt_int_op(local_outcome.err,==,0);
+ tt_assert(local_outcome.ai);
+ a = local_outcome.ai;
+ test_ai_eq(a, "[::1]:9999", SOCK_STREAM, IPPROTO_TCP);
+ tt_ptr_op(a->ai_next, ==, NULL);
+ evutil_freeaddrinfo(local_outcome.ai);
+ local_outcome.ai = NULL;
+
+ /* 2. Okay, now we can actually test the asynchronous resolver. */
+ /* Start a dummy local dns server... */
+ port = regress_get_dnsserver(data->base, &dns_port, NULL,
+ be_getaddrinfo_server_cb, &n_dns_questions);
+ tt_assert(port);
+ tt_int_op(dns_port, >=, 0);
+ /* ... and tell the evdns_base about it. */
+ evutil_snprintf(buf, sizeof(buf), "127.0.0.1:%d", dns_port);
+ evdns_base_nameserver_ip_add(dns_base, buf);
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = EVUTIL_AI_CANONNAME;
+ /* 0: Request for both.example.com should return both addresses. */
+ r = evdns_getaddrinfo(dns_base, "both.example.com", "8000",
+ &hints, gai_cb, &a_out[0]);
+ tt_assert(r);
+
+ /* 1: Request for v4only.example.com should return one address. */
+ r = evdns_getaddrinfo(dns_base, "v4only.example.com", "8001",
+ &hints, gai_cb, &a_out[1]);
+ tt_assert(r);
+
+ /* 2: Request for v6only.example.com should return one address. */
+ hints.ai_flags = 0;
+ r = evdns_getaddrinfo(dns_base, "v6only.example.com", "8002",
+ &hints, gai_cb, &a_out[2]);
+ tt_assert(r);
+
+ /* 3: PF_INET request for v4assert.example.com should not generate a
+ * v6 request. The server will fail the test if it does. */
+ hints.ai_family = PF_INET;
+ r = evdns_getaddrinfo(dns_base, "v4assert.example.com", "8003",
+ &hints, gai_cb, &a_out[3]);
+ tt_assert(r);
+
+ /* 4: PF_INET6 request for v6assert.example.com should not generate a
+ * v4 request. The server will fail the test if it does. */
+ hints.ai_family = PF_INET6;
+ r = evdns_getaddrinfo(dns_base, "v6assert.example.com", "8004",
+ &hints, gai_cb, &a_out[4]);
+ tt_assert(r);
+
+ /* 5: PF_INET request for nosuchplace.example.com should give NEXIST. */
+ hints.ai_family = PF_INET;
+ r = evdns_getaddrinfo(dns_base, "nosuchplace.example.com", "8005",
+ &hints, gai_cb, &a_out[5]);
+ tt_assert(r);
+
+ /* 6: PF_UNSPEC request for nosuchplace.example.com should give NEXIST.
+ */
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "nosuchplace.example.com", "8006",
+ &hints, gai_cb, &a_out[6]);
+ tt_assert(r);
+
+ /* 7: PF_UNSPEC request for v6timeout.example.com should give an ipv4
+ * address only. */
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "v6timeout.example.com", "8007",
+ &hints, gai_cb, &a_out[7]);
+ tt_assert(r);
+
+ /* 8: PF_UNSPEC request for v6timeout-nonexist.example.com should give
+ * a NEXIST */
+ hints.ai_family = PF_UNSPEC;
+ r = evdns_getaddrinfo(dns_base, "v6timeout-nonexist.example.com",
+ "8008", &hints, gai_cb, &a_out[8]);
+ tt_assert(r);
+
+ /* 9: AI_ADDRCONFIG should at least not crash. Can't test it more
+ * without knowing what kind of internet we have. */
+ hints.ai_flags |= EVUTIL_AI_ADDRCONFIG;
+ r = evdns_getaddrinfo(dns_base, "both.example.com",
+ "8009", &hints, gai_cb, &a_out[9]);
+ tt_assert(r);
+
+ /* 10: PF_UNSPEC for v4timeout.example.com should give an ipv6 address
+ * only. */
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = 0;
+ r = evdns_getaddrinfo(dns_base, "v4timeout.example.com", "8010",
+ &hints, gai_cb, &a_out[10]);
+ tt_assert(r);
+
+ /* 11: timeout.example.com: cancel it after 100 msec. */
+ r = evdns_getaddrinfo(dns_base, "all-timeout.example.com", "8011",
+ &hints, gai_cb, &a_out[11]);
+ tt_assert(r);
+ {
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 100*1000; /* 100 msec */
+ event_base_once(data->base, -1, EV_TIMEOUT, cancel_gai_cb,
+ r, &tv);
+ }
+
+ /* XXXXX There are more tests we could do, including:
+
+ - A test to elicit NODATA.
+
+ */
+
+ n_gai_results_pending = 12;
+ exit_base_on_no_pending_results = data->base;
+
+ event_base_dispatch(data->base);
+
+ /* 0: both.example.com */
+ tt_int_op(a_out[0].err, ==, 0);
+ tt_assert(a_out[0].ai);
+ tt_assert(a_out[0].ai->ai_next);
+ tt_assert(!a_out[0].ai->ai_next->ai_next);
+ a = ai_find_by_family(a_out[0].ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "80.80.32.32:8000", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_family(a_out[0].ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[80ff::bbbb]:8000", SOCK_STREAM, IPPROTO_TCP);
+ tt_assert(a_out[0].ai->ai_canonname);
+ tt_str_op(a_out[0].ai->ai_canonname, ==, "both-canonical.example.com");
+
+ /* 1: v4only.example.com */
+ tt_int_op(a_out[1].err, ==, 0);
+ tt_assert(a_out[1].ai);
+ tt_assert(! a_out[1].ai->ai_next);
+ test_ai_eq(a_out[1].ai, "18.52.86.120:8001", SOCK_STREAM, IPPROTO_TCP);
+ tt_assert(a_out[1].ai->ai_canonname == NULL);
+
+
+ /* 2: v6only.example.com */
+ tt_int_op(a_out[2].err, ==, 0);
+ tt_assert(a_out[2].ai);
+ tt_assert(! a_out[2].ai->ai_next);
+ test_ai_eq(a_out[2].ai, "[b0b::f00d]:8002", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 3: v4assert.example.com */
+ tt_int_op(a_out[3].err, ==, 0);
+ tt_assert(a_out[3].ai);
+ tt_assert(! a_out[3].ai->ai_next);
+ test_ai_eq(a_out[3].ai, "18.52.86.120:8003", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 4: v6assert.example.com */
+ tt_int_op(a_out[4].err, ==, 0);
+ tt_assert(a_out[4].ai);
+ tt_assert(! a_out[4].ai->ai_next);
+ test_ai_eq(a_out[4].ai, "[b0b::f00d]:8004", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 5: nosuchplace.example.com (inet) */
+ tt_int_op(a_out[5].err, ==, EVUTIL_EAI_NONAME);
+ tt_assert(! a_out[5].ai);
+
+ /* 6: nosuchplace.example.com (unspec) */
+ tt_int_op(a_out[6].err, ==, EVUTIL_EAI_NONAME);
+ tt_assert(! a_out[6].ai);
+
+ /* 7: v6timeout.example.com */
+ tt_int_op(a_out[7].err, ==, 0);
+ tt_assert(a_out[7].ai);
+ tt_assert(! a_out[7].ai->ai_next);
+ test_ai_eq(a_out[7].ai, "171.205.239.1:8007", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 8: v6timeout-nonexist.example.com */
+ tt_int_op(a_out[8].err, ==, EVUTIL_EAI_NONAME);
+ tt_assert(! a_out[8].ai);
+
+ /* 9: both (ADDRCONFIG) */
+ tt_int_op(a_out[9].err, ==, 0);
+ tt_assert(a_out[9].ai);
+ a = ai_find_by_family(a_out[9].ai, PF_INET);
+ if (a)
+ test_ai_eq(a, "80.80.32.32:8009", SOCK_STREAM, IPPROTO_TCP);
+ else
+ tt_assert(ai_find_by_family(a_out[9].ai, PF_INET6));
+ a = ai_find_by_family(a_out[9].ai, PF_INET6);
+ if (a)
+ test_ai_eq(a, "[80ff::bbbb]:8009", SOCK_STREAM, IPPROTO_TCP);
+ else
+ tt_assert(ai_find_by_family(a_out[9].ai, PF_INET));
+
+ /* 10: v4timeout.example.com */
+ tt_int_op(a_out[10].err, ==, 0);
+ tt_assert(a_out[10].ai);
+ tt_assert(! a_out[10].ai->ai_next);
+ test_ai_eq(a_out[10].ai, "[a0a::ff01]:8010", SOCK_STREAM, IPPROTO_TCP);
+
+ /* 11: cancelled request. */
+ tt_int_op(a_out[11].err, ==, EVUTIL_EAI_CANCEL);
+ tt_assert(a_out[11].ai == NULL);
+
+end:
+ if (local_outcome.ai)
+ evutil_freeaddrinfo(local_outcome.ai);
+ for (i=0;i<10;++i) {
+ if (a_out[i].ai)
+ evutil_freeaddrinfo(a_out[i].ai);
+ }
+ if (port)
+ evdns_close_server_port(port);
+ if (dns_base)
+ evdns_base_free(dns_base, 0);
+}
+
+struct gaic_request_status {
+ int magic;
+ struct event_base *base;
+ struct evdns_base *dns_base;
+ struct evdns_getaddrinfo_request *request;
+ struct event cancel_event;
+ int canceled;
+};
+
+#define GAIC_MAGIC 0x1234abcd
+
+static int pending = 0;
+
+static void
+gaic_cancel_request_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct gaic_request_status *status = arg;
+
+ tt_assert(status->magic == GAIC_MAGIC);
+ status->canceled = 1;
+ evdns_getaddrinfo_cancel(status->request);
+ return;
+end:
+ event_base_loopexit(status->base, NULL);
+}
+
+static void
+gaic_server_cb(struct evdns_server_request *req, void *arg)
+{
+ ev_uint32_t answer = 0x7f000001;
+ tt_assert(req->nquestions);
+ evdns_server_request_add_a_reply(req, req->questions[0]->name, 1,
+ &answer, 100);
+ evdns_server_request_respond(req, 0);
+ return;
+end:
+ evdns_server_request_respond(req, DNS_ERR_REFUSED);
+}
+
+
+static void
+gaic_getaddrinfo_cb(int result, struct evutil_addrinfo *res, void *arg)
+{
+ struct gaic_request_status *status = arg;
+ struct event_base *base = status->base;
+ tt_assert(status->magic == GAIC_MAGIC);
+
+ if (result == EVUTIL_EAI_CANCEL) {
+ tt_assert(status->canceled);
+ }
+ event_del(&status->cancel_event);
+
+ memset(status, 0xf0, sizeof(*status));
+ free(status);
+
+end:
+ if (--pending <= 0)
+ event_base_loopexit(base, NULL);
+}
+
+static void
+gaic_launch(struct event_base *base, struct evdns_base *dns_base)
+{
+ struct gaic_request_status *status = calloc(1,sizeof(*status));
+ struct timeval tv = { 0, 10000 };
+ status->magic = GAIC_MAGIC;
+ status->base = base;
+ status->dns_base = dns_base;
+ event_assign(&status->cancel_event, base, -1, 0, gaic_cancel_request_cb,
+ status);
+ status->request = evdns_getaddrinfo(dns_base,
+ "foobar.bazquux.example.com", "80", NULL, gaic_getaddrinfo_cb,
+ status);
+ event_add(&status->cancel_event, &tv);
+ ++pending;
+}
+
+#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
+/* FIXME: We should move this to regress_main.c if anything else needs it.*/
+
+/* Trivial replacements for malloc/free/realloc to check for memory leaks.
+ * Not threadsafe. */
+static int allocated_chunks = 0;
+
+static void *
+cnt_malloc(size_t sz)
+{
+ allocated_chunks += 1;
+ return malloc(sz);
+}
+
+static void *
+cnt_realloc(void *old, size_t sz)
+{
+ if (!old)
+ allocated_chunks += 1;
+ if (!sz)
+ allocated_chunks -= 1;
+ return realloc(old, sz);
+}
+
+static void
+cnt_free(void *ptr)
+{
+ allocated_chunks -= 1;
+ free(ptr);
+}
+
+struct testleak_env_t {
+ struct event_base *base;
+ struct evdns_base *dns_base;
+ struct evdns_request *req;
+ struct generic_dns_callback_result r;
+};
+
+static void *
+testleak_setup(const struct testcase_t *testcase)
+{
+ struct testleak_env_t *env;
+
+ allocated_chunks = 0;
+ event_set_mem_functions(cnt_malloc, cnt_realloc, cnt_free);
+ if (!libevent_tests_running_in_debug_mode)
+ event_enable_debug_mode();
+
+ /* not mm_calloc: we don't want to mess with the count. */
+ env = calloc(1, sizeof(struct testleak_env_t));
+ env->base = event_base_new();
+ env->dns_base = evdns_base_new(env->base, 0);
+ env->req = evdns_base_resolve_ipv4(
+ env->dns_base, "example.com", DNS_QUERY_NO_SEARCH,
+ generic_dns_callback, &env->r);
+ return env;
+}
+
+static int
+testleak_cleanup(const struct testcase_t *testcase, void *env_)
+{
+ int ok = 0;
+ struct testleak_env_t *env = env_;
+ tt_assert(env);
+#ifdef EVENT__DISABLE_DEBUG_MODE
+ tt_int_op(allocated_chunks, ==, 0);
+#else
+ /* FIXME: that's `1' because of event_debug_map_HT_GROW */
+ tt_int_op(allocated_chunks, ==, 1);
+#endif
+ ok = 1;
+end:
+ if (env) {
+ if (env->dns_base)
+ evdns_base_free(env->dns_base, 0);
+ if (env->base)
+ event_base_free(env->base);
+ free(env);
+ }
+ return ok;
+}
+
+static struct testcase_setup_t testleak_funcs = {
+ testleak_setup, testleak_cleanup
+};
+
+static void
+test_dbg_leak_cancel(void *env_)
+{
+ /* cancel, loop, free/dns, free/base */
+ struct testleak_env_t *env = env_;
+ int send_err_shutdown = 1;
+ evdns_cancel_request(env->dns_base, env->req);
+ env->req = 0;
+
+ /* `req` is freed in callback, that's why one loop is required. */
+ event_base_loop(env->base, EVLOOP_NONBLOCK);
+
+ /* send_err_shutdown means nothing as soon as our request is
+ * already canceled */
+ evdns_base_free(env->dns_base, send_err_shutdown);
+ env->dns_base = 0;
+ event_base_free(env->base);
+ env->base = 0;
+}
+
+static void
+dbg_leak_resume(void *env_, int cancel, int send_err_shutdown)
+{
+ /* cancel, loop, free/dns, free/base */
+ struct testleak_env_t *env = env_;
+ if (cancel) {
+ evdns_cancel_request(env->dns_base, env->req);
+ tt_assert(!evdns_base_resume(env->dns_base));
+ } else {
+ /* TODO: No nameservers, request can't be processed, must be errored */
+ tt_assert(!evdns_base_resume(env->dns_base));
+ }
+
+ /**
+ * Because we don't cancel request,
+ * and want our callback to recieve DNS_ERR_SHUTDOWN,
+ * we use deferred callback, and there was
+ * - one extra malloc(),
+ * @see reply_schedule_callback()
+ * - and one missing free
+ * @see request_finished() (req->handle->pending_cb = 1)
+ * than we don't need to count in testleak_cleanup()
+ *
+ * So just decrement allocated_chunks to 2,
+ * like we already take care about it.
+ */
+ if (!cancel && send_err_shutdown) {
+ allocated_chunks -= 2;
+ }
+
+ event_base_loop(env->base, EVLOOP_NONBLOCK);
+
+end:
+ evdns_base_free(env->dns_base, send_err_shutdown);
+ env->dns_base = 0;
+ event_base_free(env->base);
+ env->base = 0;
+}
+
+#define IMPL_DBG_LEAK_RESUME(name, cancel, send_err_shutdown) \
+ static void \
+ test_dbg_leak_##name##_(void *env_) \
+ { \
+ dbg_leak_resume(env_, cancel, send_err_shutdown); \
+ }
+IMPL_DBG_LEAK_RESUME(resume, 0, 0)
+IMPL_DBG_LEAK_RESUME(cancel_and_resume, 1, 0)
+IMPL_DBG_LEAK_RESUME(resume_send_err, 0, 1)
+IMPL_DBG_LEAK_RESUME(cancel_and_resume_send_err, 1, 1)
+
+static void
+test_dbg_leak_shutdown(void *env_)
+{
+ /* free/dns, loop, free/base */
+ struct testleak_env_t *env = env_;
+ int send_err_shutdown = 1;
+
+ /* `req` is freed both with `send_err_shutdown` and without it,
+ * the only difference is `evdns_callback` call */
+ env->req = 0;
+
+ evdns_base_free(env->dns_base, send_err_shutdown);
+ env->dns_base = 0;
+
+ /* `req` is freed in callback, that's why one loop is required */
+ event_base_loop(env->base, EVLOOP_NONBLOCK);
+ event_base_free(env->base);
+ env->base = 0;
+}
+#endif
+
+static void
+test_getaddrinfo_async_cancel_stress(void *ptr)
+{
+ struct event_base *base;
+ struct evdns_base *dns_base = NULL;
+ struct evdns_server_port *server = NULL;
+ evutil_socket_t fd = -1;
+ struct sockaddr_in sin;
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+ int i;
+
+ base = event_base_new();
+ dns_base = evdns_base_new(base, 0);
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = 0;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ tt_abort_perror("socket");
+ }
+ evutil_make_socket_nonblocking(fd);
+ if (bind(fd, (struct sockaddr*)&sin, sizeof(sin))<0) {
+ tt_abort_perror("bind");
+ }
+ server = evdns_add_server_port_with_base(base, fd, 0, gaic_server_cb,
+ base);
+
+ memset(&ss, 0, sizeof(ss));
+ slen = sizeof(ss);
+ if (getsockname(fd, (struct sockaddr*)&ss, &slen)<0) {
+ tt_abort_perror("getsockname");
+ }
+ evdns_base_nameserver_sockaddr_add(dns_base,
+ (struct sockaddr*)&ss, slen, 0);
+
+ for (i = 0; i < 1000; ++i) {
+ gaic_launch(base, dns_base);
+ }
+
+ event_base_dispatch(base);
+
+end:
+ if (dns_base)
+ evdns_base_free(dns_base, 1);
+ if (server)
+ evdns_close_server_port(server);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+
+#define DNS_LEGACY(name, flags) \
+ { #name, run_legacy_test_fn, flags|TT_LEGACY, &legacy_setup, \
+ dns_##name }
+
+struct testcase_t dns_testcases[] = {
+ DNS_LEGACY(server, TT_FORK|TT_NEED_BASE),
+ DNS_LEGACY(gethostbyname, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
+ DNS_LEGACY(gethostbyname6, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
+ DNS_LEGACY(gethostbyaddr, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
+ { "resolve_reverse", dns_resolve_reverse, TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL },
+ { "search", dns_search_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "search_cancel", dns_search_cancel_test,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "retry", dns_retry_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+ { "reissue", dns_reissue_test, TT_FORK|TT_NEED_BASE|TT_NO_LOGS, &basic_setup, NULL },
+ { "inflight", dns_inflight_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+ { "bufferevent_connect_hostname", test_bufferevent_connect_hostname,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+
+ { "getaddrinfo_async", test_getaddrinfo_async,
+ TT_FORK|TT_NEED_BASE, &basic_setup, (char*)"" },
+ { "getaddrinfo_cancel_stress", test_getaddrinfo_async_cancel_stress,
+ TT_FORK, NULL, NULL },
+
+#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
+ { "leak_shutdown", test_dbg_leak_shutdown, TT_FORK, &testleak_funcs, NULL },
+ { "leak_cancel", test_dbg_leak_cancel, TT_FORK, &testleak_funcs, NULL },
+
+ { "leak_resume", test_dbg_leak_resume_, TT_FORK, &testleak_funcs, NULL },
+ { "leak_cancel_and_resume", test_dbg_leak_cancel_and_resume_,
+ TT_FORK, &testleak_funcs, NULL },
+ { "leak_resume_send_err", test_dbg_leak_resume_send_err_,
+ TT_FORK, &testleak_funcs, NULL },
+ { "leak_cancel_and_resume_send_err", test_dbg_leak_cancel_and_resume_send_err_,
+ TT_FORK, &testleak_funcs, NULL },
+#endif
+
+ END_OF_TESTCASES
+};
+
diff --git a/sntp/libevent/test/regress_et.c b/sntp/libevent/test/regress_et.c
new file mode 100644
index 0000000..229a78e
--- /dev/null
+++ b/sntp/libevent/test/regress_et.c
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "../util-internal.h"
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+
+#include "regress.h"
+
+static int was_et = 0;
+
+static void
+read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf;
+ int len;
+
+ len = recv(fd, &buf, sizeof(buf), 0);
+
+ called++;
+ if (event & EV_ET)
+ was_et = 1;
+
+ if (!len)
+ event_del(arg);
+}
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+
+static void
+test_edgetriggered(void *et)
+{
+ struct event *ev = NULL;
+ struct event_base *base = NULL;
+ const char *test = "test string";
+ evutil_socket_t pair[2] = {-1,-1};
+ int supports_et;
+
+ /* On Linux 3.2.1 (at least, as patched by Fedora and tested by Nick),
+ * doing a "recv" on an AF_UNIX socket resets the readability of the
+ * socket, even though there is no state change, so we don't actually
+ * get edge-triggered behavior. Yuck! Linux 3.1.9 didn't have this
+ * problem.
+ */
+#ifdef __linux__
+ if (evutil_ersatz_socketpair_(AF_INET, SOCK_STREAM, 0, pair) == -1) {
+ tt_abort_perror("socketpair");
+ }
+#else
+ if (evutil_socketpair(LOCAL_SOCKETPAIR_AF, SOCK_STREAM, 0, pair) == -1) {
+ tt_abort_perror("socketpair");
+ }
+#endif
+
+ called = was_et = 0;
+
+ tt_int_op(send(pair[0], test, (int)strlen(test)+1, 0), >, 0);
+ shutdown(pair[0], SHUT_WR);
+
+ /* Initalize the event library */
+ base = event_base_new();
+
+ if (!strcmp(event_base_get_method(base), "epoll") ||
+ !strcmp(event_base_get_method(base), "epoll (with changelist)") ||
+ !strcmp(event_base_get_method(base), "kqueue"))
+ supports_et = 1;
+ else
+ supports_et = 0;
+
+ TT_BLATHER(("Checking for edge-triggered events with %s, which should %s"
+ "support edge-triggering", event_base_get_method(base),
+ supports_et?"":"not "));
+
+ /* Initalize one event */
+ ev = event_new(base, pair[1], EV_READ|EV_ET|EV_PERSIST, read_cb, &ev);
+
+ event_add(ev, NULL);
+
+ /* We're going to call the dispatch function twice. The first invocation
+ * will read a single byte from pair[1] in either case. If we're edge
+ * triggered, we'll only see the event once (since we only see transitions
+ * from no data to data), so the second invocation of event_base_loop will
+ * do nothing. If we're level triggered, the second invocation of
+ * event_base_loop will also activate the event (because there's still
+ * data to read). */
+ event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
+ event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
+
+ if (supports_et) {
+ tt_int_op(called, ==, 1);
+ tt_assert(was_et);
+ } else {
+ tt_int_op(called, ==, 2);
+ tt_assert(!was_et);
+ }
+
+ end:
+ if (ev) {
+ event_del(ev);
+ event_free(ev);
+ }
+ if (base)
+ event_base_free(base);
+ evutil_closesocket(pair[0]);
+ evutil_closesocket(pair[1]);
+}
+
+static void
+test_edgetriggered_mix_error(void *data_)
+{
+ struct basic_test_data *data = data_;
+ struct event_base *base = NULL;
+ struct event *ev_et=NULL, *ev_lt=NULL;
+
+#ifdef EVENT__DISABLE_DEBUG_MODE
+ if (1)
+ tt_skip();
+#endif
+
+ if (!libevent_tests_running_in_debug_mode)
+ event_enable_debug_mode();
+
+ base = event_base_new();
+
+ /* try mixing edge-triggered and level-triggered to make sure it fails*/
+ ev_et = event_new(base, data->pair[0], EV_READ|EV_ET, read_cb, ev_et);
+ tt_assert(ev_et);
+ ev_lt = event_new(base, data->pair[0], EV_READ, read_cb, ev_lt);
+ tt_assert(ev_lt);
+
+ /* Add edge-triggered, then level-triggered. Get an error. */
+ tt_int_op(0, ==, event_add(ev_et, NULL));
+ tt_int_op(-1, ==, event_add(ev_lt, NULL));
+ tt_int_op(EV_READ, ==, event_pending(ev_et, EV_READ, NULL));
+ tt_int_op(0, ==, event_pending(ev_lt, EV_READ, NULL));
+
+ tt_int_op(0, ==, event_del(ev_et));
+ /* Add level-triggered, then edge-triggered. Get an error. */
+ tt_int_op(0, ==, event_add(ev_lt, NULL));
+ tt_int_op(-1, ==, event_add(ev_et, NULL));
+ tt_int_op(EV_READ, ==, event_pending(ev_lt, EV_READ, NULL));
+ tt_int_op(0, ==, event_pending(ev_et, EV_READ, NULL));
+
+end:
+ if (ev_et)
+ event_free(ev_et);
+ if (ev_lt)
+ event_free(ev_lt);
+ if (base)
+ event_base_free(base);
+}
+
+struct testcase_t edgetriggered_testcases[] = {
+ { "et", test_edgetriggered, TT_FORK, NULL, NULL },
+ { "et_mix_error", test_edgetriggered_mix_error,
+ TT_FORK|TT_NEED_SOCKETPAIR|TT_NO_LOGS, &basic_setup, NULL },
+ END_OF_TESTCASES
+};
diff --git a/sntp/libevent/test/regress_finalize.c b/sntp/libevent/test/regress_finalize.c
new file mode 100644
index 0000000..61a6313
--- /dev/null
+++ b/sntp/libevent/test/regress_finalize.c
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2013 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+#include <stdlib.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+#include "event-internal.h"
+#include "defer-internal.h"
+
+#include "regress.h"
+#include "regress_thread.h"
+
+static void
+timer_callback(evutil_socket_t fd, short what, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 1;
+ (void)fd;
+ (void)what;
+}
+static void
+simple_callback(struct event_callback *evcb, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 1;
+ (void)evcb;
+}
+static void
+event_finalize_callback_1(struct event *ev, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 100;
+ (void)ev;
+}
+static void
+callback_finalize_callback_1(struct event_callback *evcb, void *arg)
+{
+ int *int_arg = arg;
+ *int_arg += 100;
+ (void)evcb;
+}
+
+
+static void
+test_fin_cb_invoked(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event *ev;
+ struct event ev2;
+ struct event_callback evcb;
+ int cb_called = 0;
+ int ev_called = 0;
+
+ const struct timeval ten_sec = {10,0};
+
+ event_deferred_cb_init_(&evcb, 0, simple_callback, &cb_called);
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ /* Just finalize them; don't bother adding. */
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_callback_finalize_(base, 0, &evcb, callback_finalize_callback_1);
+
+ event_base_dispatch(base);
+
+ tt_int_op(cb_called, ==, 100);
+ tt_int_op(ev_called, ==, 100);
+
+ ev_called = cb_called = 0;
+ event_base_assert_ok_(base);
+
+ /* Now try it when they're active. (actually, don't finalize: make
+ * sure activation can happen! */
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ event_deferred_cb_init_(&evcb, 0, simple_callback, &cb_called);
+
+ event_active(ev, EV_TIMEOUT, 1);
+ event_callback_activate_(base, &evcb);
+
+ event_base_dispatch(base);
+ tt_int_op(cb_called, ==, 1);
+ tt_int_op(ev_called, ==, 1);
+
+ ev_called = cb_called = 0;
+ event_base_assert_ok_(base);
+
+ /* Great, it worked. Now activate and finalize and make sure only
+ * finalizing happens. */
+ event_active(ev, EV_TIMEOUT, 1);
+ event_callback_activate_(base, &evcb);
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_callback_finalize_(base, 0, &evcb, callback_finalize_callback_1);
+
+ event_base_dispatch(base);
+ tt_int_op(cb_called, ==, 100);
+ tt_int_op(ev_called, ==, 100);
+
+ ev_called = 0;
+
+ event_base_assert_ok_(base);
+
+ /* Okay, now add but don't have it become active, and make sure *that*
+ * works. */
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ event_add(ev, &ten_sec);
+ event_free_finalize(0, ev, event_finalize_callback_1);
+
+ event_base_dispatch(base);
+ tt_int_op(ev_called, ==, 100);
+
+ ev_called = 0;
+ event_base_assert_ok_(base);
+
+ /* Now try adding and deleting after finalizing. */
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ evtimer_assign(&ev2, base, timer_callback, &ev_called);
+ event_add(ev, &ten_sec);
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_finalize(0, &ev2, event_finalize_callback_1);
+
+ event_add(&ev2, &ten_sec);
+ event_del(ev);
+ event_active(&ev2, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(ev_called, ==, 200);
+
+ event_base_assert_ok_(base);
+
+end:
+ ;
+}
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+static void *
+tfff_malloc(size_t n)
+{
+ return malloc(n);
+}
+static void *tfff_p1=NULL, *tfff_p2=NULL;
+static int tfff_p1_freed=0, tfff_p2_freed=0;
+static void
+tfff_free(void *p)
+{
+ if (! p)
+ return;
+ if (p == tfff_p1)
+ ++tfff_p1_freed;
+ if (p == tfff_p2)
+ ++tfff_p2_freed;
+ free(p);
+}
+static void *
+tfff_realloc(void *p, size_t sz)
+{
+ return realloc(p,sz);
+}
+#endif
+
+static void
+test_fin_free_finalize(void *arg)
+{
+#ifdef EVENT__DISABLE_MM_REPLACEMENT
+ tinytest_set_test_skipped_();
+#else
+ struct event_base *base = NULL;
+ struct event *ev, *ev2;
+ int ev_called = 0;
+ int ev2_called = 0;
+
+ (void)arg;
+
+ event_set_mem_functions(tfff_malloc, tfff_realloc, tfff_free);
+
+ base = event_base_new();
+ tt_assert(base);
+
+ ev = evtimer_new(base, timer_callback, &ev_called);
+ ev2 = evtimer_new(base, timer_callback, &ev2_called);
+ tfff_p1 = ev;
+ tfff_p2 = ev2;
+ event_free_finalize(0, ev, event_finalize_callback_1);
+ event_finalize(0, ev2, event_finalize_callback_1);
+
+ event_base_dispatch(base);
+
+ tt_int_op(ev_called, ==, 100);
+ tt_int_op(ev2_called, ==, 100);
+
+ event_base_assert_ok_(base);
+ tt_int_op(tfff_p1_freed, ==, 1);
+ tt_int_op(tfff_p2_freed, ==, 0);
+
+ event_free(ev2);
+
+end:
+ if (base)
+ event_base_free(base);
+#endif
+}
+
+/* For test_fin_within_cb */
+struct event_and_count {
+ struct event *ev;
+ struct event *ev2;
+ int count;
+};
+static void
+event_finalize_callback_2(struct event *ev, void *arg)
+{
+ struct event_and_count *evc = arg;
+ evc->count += 100;
+ event_free(ev);
+}
+static void
+timer_callback_2(evutil_socket_t fd, short what, void *arg)
+{
+ struct event_and_count *evc = arg;
+ event_finalize(0, evc->ev, event_finalize_callback_2);
+ event_finalize(0, evc->ev2, event_finalize_callback_2);
+ ++ evc->count;
+ (void)fd;
+ (void)what;
+}
+
+static void
+test_fin_within_cb(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event_and_count evc1, evc2;
+ evc1.count = evc2.count = 0;
+ evc2.ev2 = evc1.ev = evtimer_new(base, timer_callback_2, &evc1);
+ evc1.ev2 = evc2.ev = evtimer_new(base, timer_callback_2, &evc2);
+
+ /* Activate both. The first one will have its callback run, which
+ * will finalize both of them, preventing the second one's callback
+ * from running. */
+ event_active(evc1.ev, EV_TIMEOUT, 1);
+ event_active(evc2.ev, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(evc1.count, ==, 101);
+ tt_int_op(evc2.count, ==, 100);
+
+ event_base_assert_ok_(base);
+ /* Now try with EV_PERSIST events. */
+ evc1.count = evc2.count = 0;
+ evc2.ev2 = evc1.ev = event_new(base, -1, EV_PERSIST, timer_callback_2, &evc1);
+ evc1.ev2 = evc2.ev = event_new(base, -1, EV_PERSIST, timer_callback_2, &evc2);
+
+ event_active(evc1.ev, EV_TIMEOUT, 1);
+ event_active(evc2.ev, EV_TIMEOUT, 1);
+
+ event_base_dispatch(base);
+ tt_int_op(evc1.count, ==, 101);
+ tt_int_op(evc2.count, ==, 100);
+
+ event_base_assert_ok_(base);
+end:
+ ;
+}
+
+#if 0
+static void
+timer_callback_3(evutil_socket_t *fd, short what, void *arg)
+{
+ (void)fd;
+ (void)what;
+
+}
+static void
+test_fin_many(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event *ev1, *ev2;
+ struct event_callback evcb1, evcb2;
+ int ev1_count = 0, ev2_count = 0;
+ int evcb1_count = 0, evcb2_count = 0;
+ struct event_callback *array[4];
+
+ int n;
+
+ /* First attempt: call finalize_many with no events running */
+ ev1 = evtimer_new(base, timer_callback, &ev1_count);
+ ev1 = evtimer_new(base, timer_callback, &ev2_count);
+ event_deferred_cb_init_(&evcb1, 0, simple_callback, &evcb1_called);
+ event_deferred_cb_init_(&evcb2, 0, simple_callback, &evcb2_called);
+ array[0] = &ev1->ev_evcallback;
+ array[1] = &ev2->ev_evcallback;
+ array[2] = &evcb1;
+ array[3] = &evcb2;
+
+
+
+ n = event_callback_finalize_many(base, 4, array,
+ callback_finalize_callback_1);
+
+}
+#endif
+
+
+#define TEST(name, flags) \
+ { #name, test_fin_##name, (flags), &basic_setup, NULL }
+
+struct testcase_t finalize_testcases[] = {
+
+ TEST(cb_invoked, TT_FORK|TT_NEED_BASE),
+ TEST(free_finalize, TT_FORK),
+ TEST(within_cb, TT_FORK|TT_NEED_BASE),
+// TEST(many, TT_FORK|TT_NEED_BASE),
+
+
+ END_OF_TESTCASES
+};
+
diff --git a/sntp/libevent/test/regress_http.c b/sntp/libevent/test/regress_http.c
new file mode 100644
index 0000000..ca7d515
--- /dev/null
+++ b/sntp/libevent/test/regress_http.c
@@ -0,0 +1,3893 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/dns.h"
+
+#include "event2/event.h"
+#include "event2/http.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+#include "event2/util.h"
+#include "log-internal.h"
+#include "http-internal.h"
+#include "regress.h"
+#include "regress_testutils.h"
+
+static struct evhttp *http;
+/* set if a test needs to call loopexit on a base */
+static struct event_base *exit_base;
+
+static char const BASIC_REQUEST_BODY[] = "This is funny";
+
+#define IMPL_HTTP_REQUEST_ERROR_CB(name, expecting_error) \
+ static void \
+ http_request_error_cb_with_##name##_(enum evhttp_request_error error, \
+ void *arg) \
+ { \
+ if (error != expecting_error) { \
+ fprintf(stderr, "FAILED\n"); \
+ exit(1); \
+ } \
+ test_ok = 1; \
+ }
+IMPL_HTTP_REQUEST_ERROR_CB(cancel, EVREQ_HTTP_REQUEST_CANCEL)
+
+static void http_basic_cb(struct evhttp_request *req, void *arg);
+static void http_chunked_cb(struct evhttp_request *req, void *arg);
+static void http_post_cb(struct evhttp_request *req, void *arg);
+static void http_put_cb(struct evhttp_request *req, void *arg);
+static void http_delete_cb(struct evhttp_request *req, void *arg);
+static void http_delay_cb(struct evhttp_request *req, void *arg);
+static void http_large_delay_cb(struct evhttp_request *req, void *arg);
+static void http_badreq_cb(struct evhttp_request *req, void *arg);
+static void http_dispatcher_cb(struct evhttp_request *req, void *arg);
+static void http_on_complete_cb(struct evhttp_request *req, void *arg);
+
+static int
+http_bind(struct evhttp *myhttp, ev_uint16_t *pport, int ipv6)
+{
+ int port;
+ struct evhttp_bound_socket *sock;
+
+ if (ipv6)
+ sock = evhttp_bind_socket_with_handle(myhttp, "::1", *pport);
+ else
+ sock = evhttp_bind_socket_with_handle(myhttp, "127.0.0.1", *pport);
+
+ if (sock == NULL)
+ event_errx(1, "Could not start web server");
+
+ port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock));
+ if (port < 0)
+ return -1;
+ *pport = (ev_uint16_t) port;
+
+ return 0;
+}
+
+static struct evhttp *
+http_setup(ev_uint16_t *pport, struct event_base *base, int ipv6)
+{
+ struct evhttp *myhttp;
+
+ /* Try a few different ports */
+ myhttp = evhttp_new(base);
+
+ if (http_bind(myhttp, pport, ipv6) < 0)
+ return NULL;
+
+ /* Register a callback for certain types of requests */
+ evhttp_set_cb(myhttp, "/test", http_basic_cb, base);
+ evhttp_set_cb(myhttp, "/chunked", http_chunked_cb, base);
+ evhttp_set_cb(myhttp, "/streamed", http_chunked_cb, base);
+ evhttp_set_cb(myhttp, "/postit", http_post_cb, base);
+ evhttp_set_cb(myhttp, "/putit", http_put_cb, base);
+ evhttp_set_cb(myhttp, "/deleteit", http_delete_cb, base);
+ evhttp_set_cb(myhttp, "/delay", http_delay_cb, base);
+ evhttp_set_cb(myhttp, "/largedelay", http_large_delay_cb, base);
+ evhttp_set_cb(myhttp, "/badrequest", http_badreq_cb, base);
+ evhttp_set_cb(myhttp, "/oncomplete", http_on_complete_cb, base);
+ evhttp_set_cb(myhttp, "/", http_dispatcher_cb, base);
+ return (myhttp);
+}
+
+#ifndef NI_MAXSERV
+#define NI_MAXSERV 1024
+#endif
+
+static evutil_socket_t
+http_connect(const char *address, u_short port)
+{
+ /* Stupid code for connecting */
+ struct evutil_addrinfo ai, *aitop;
+ char strport[NI_MAXSERV];
+
+ struct sockaddr *sa;
+ int slen;
+ evutil_socket_t fd;
+
+ memset(&ai, 0, sizeof(ai));
+ ai.ai_family = AF_INET;
+ ai.ai_socktype = SOCK_STREAM;
+ evutil_snprintf(strport, sizeof(strport), "%d", port);
+ if (evutil_getaddrinfo(address, strport, &ai, &aitop) != 0) {
+ event_warn("getaddrinfo");
+ return (-1);
+ }
+ sa = aitop->ai_addr;
+ slen = aitop->ai_addrlen;
+
+ fd = socket(AF_INET, SOCK_STREAM, 0);
+ if (fd == -1)
+ event_err(1, "socket failed");
+
+ evutil_make_socket_nonblocking(fd);
+ if (connect(fd, sa, slen) == -1) {
+#ifdef _WIN32
+ int tmp_err = WSAGetLastError();
+ if (tmp_err != WSAEINPROGRESS && tmp_err != WSAEINVAL &&
+ tmp_err != WSAEWOULDBLOCK)
+ event_err(1, "connect failed");
+#else
+ if (errno != EINPROGRESS)
+ event_err(1, "connect failed");
+#endif
+ }
+
+ evutil_freeaddrinfo(aitop);
+
+ return (fd);
+}
+
+/* Helper: do a strcmp on the contents of buf and the string s. */
+static int
+evbuffer_datacmp(struct evbuffer *buf, const char *s)
+{
+ size_t b_sz = evbuffer_get_length(buf);
+ size_t s_sz = strlen(s);
+ unsigned char *d;
+ int r;
+
+ if (b_sz < s_sz)
+ return -1;
+
+ d = evbuffer_pullup(buf, s_sz);
+ if ((r = memcmp(d, s, s_sz)))
+ return r;
+
+ if (b_sz > s_sz)
+ return 1;
+ else
+ return 0;
+}
+
+/* Helper: Return true iff buf contains s */
+static int
+evbuffer_contains(struct evbuffer *buf, const char *s)
+{
+ struct evbuffer_ptr ptr;
+ ptr = evbuffer_search(buf, s, strlen(s), NULL);
+ return ptr.pos != -1;
+}
+
+static void
+http_readcb(struct bufferevent *bev, void *arg)
+{
+ const char *what = BASIC_REQUEST_BODY;
+ struct event_base *my_base = arg;
+
+ if (evbuffer_contains(bufferevent_get_input(bev), what)) {
+ struct evhttp_request *req = evhttp_request_new(NULL, NULL);
+ enum message_read_status done;
+
+ /* req->kind = EVHTTP_RESPONSE; */
+ done = evhttp_parse_firstline_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ done = evhttp_parse_headers_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ if (done == 1 &&
+ evhttp_find_header(evhttp_request_get_input_headers(req),
+ "Content-Type") != NULL)
+ test_ok++;
+
+ out:
+ evhttp_request_free(req);
+ bufferevent_disable(bev, EV_READ);
+ if (exit_base)
+ event_base_loopexit(exit_base, NULL);
+ else if (my_base)
+ event_base_loopexit(my_base, NULL);
+ else {
+ fprintf(stderr, "No way to exit loop!\n");
+ exit(1);
+ }
+ }
+}
+
+static void
+http_writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ /* enable reading of the reply */
+ bufferevent_enable(bev, EV_READ);
+ test_ok++;
+ }
+}
+
+static void
+http_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ test_ok = -2;
+ event_base_loopexit(arg, NULL);
+}
+
+static int found_multi = 0;
+static int found_multi2 = 0;
+
+static void
+http_basic_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+ struct evhttp_connection *evcon;
+ int empty = evhttp_find_header(evhttp_request_get_input_headers(req), "Empty") != NULL;
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ evcon = evhttp_request_get_connection(req);
+ tt_assert(evhttp_connection_get_server(evcon) == http);
+
+ /* For multi-line headers test */
+ {
+ const char *multi =
+ evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi");
+ if (multi) {
+ found_multi = !strcmp(multi,"aaaaaaaa a END");
+ if (strcmp("END", multi + strlen(multi) - 3) == 0)
+ test_ok++;
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Last"))
+ test_ok++;
+ }
+ }
+ {
+ const char *multi2 =
+ evhttp_find_header(evhttp_request_get_input_headers(req),"X-Multi-Extra-WS");
+ if (multi2) {
+ found_multi2 = !strcmp(multi2,"libevent 2.1");
+ }
+ }
+
+
+ /* injecting a bad content-length */
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "X-Negative"))
+ evhttp_add_header(evhttp_request_get_output_headers(req),
+ "Content-Length", "-100");
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine",
+ !empty ? evb : NULL);
+
+end:
+ evbuffer_free(evb);
+}
+
+static char const* const CHUNKS[] = {
+ "This is funny",
+ "but not hilarious.",
+ "bwv 1052"
+};
+
+struct chunk_req_state {
+ struct event_base *base;
+ struct evhttp_request *req;
+ int i;
+};
+
+static void
+http_chunked_trickle_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+ struct chunk_req_state *state = arg;
+ struct timeval when = { 0, 0 };
+
+ evbuffer_add_printf(evb, "%s", CHUNKS[state->i]);
+ evhttp_send_reply_chunk(state->req, evb);
+ evbuffer_free(evb);
+
+ if (++state->i < (int) (sizeof(CHUNKS)/sizeof(CHUNKS[0]))) {
+ event_base_once(state->base, -1, EV_TIMEOUT,
+ http_chunked_trickle_cb, state, &when);
+ } else {
+ evhttp_send_reply_end(state->req);
+ free(state);
+ }
+}
+
+static void
+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__));
+
+ memset(state, 0, sizeof(struct chunk_req_state));
+ state->req = req;
+ state->base = arg;
+
+ if (strcmp(evhttp_request_get_uri(req), "/streamed") == 0) {
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Content-Length", "39");
+ }
+
+ /* generate a chunked/streamed reply */
+ evhttp_send_reply_start(req, HTTP_OK, "Everything is fine");
+
+ /* but trickle it across several iterations to ensure we're not
+ * assuming it comes all at once */
+ event_base_once(arg, -1, EV_TIMEOUT, http_chunked_trickle_cb, state, &when);
+}
+
+static void
+http_complete_write(evutil_socket_t fd, short what, void *arg)
+{
+ struct bufferevent *bev = arg;
+ const char *http_request = "host\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+ bufferevent_write(bev, http_request, strlen(http_request));
+}
+
+static void
+http_basic_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct timeval tv;
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0, port2 = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ /* bind to a second socket */
+ if (http_bind(http, &port2, 0) == -1) {
+ fprintf(stdout, "FAILED (bind)\n");
+ exit(1);
+ }
+
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ /* first half of the http request */
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: some";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+ evutil_timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base,
+ -1, EV_TIMEOUT, http_complete_write, bev, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 3);
+
+ /* connect to the second port */
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ fd = http_connect("127.0.0.1", port2);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 5);
+
+ /* Connect to the second port again. This time, send an absolute uri. */
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ fd = http_connect("127.0.0.1", port2);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "GET http://somehost.net/test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 7);
+
+ evhttp_free(http);
+ end:
+ ;
+}
+
+
+static void
+http_delay_reply(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_request *req = arg;
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", NULL);
+
+ ++test_ok;
+}
+
+static void
+http_delay_cb(struct evhttp_request *req, void *arg)
+{
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 200 * 1000;
+
+ event_base_once(arg, -1, EV_TIMEOUT, http_delay_reply, req, &tv);
+}
+
+static void
+http_badreq_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *buf = evbuffer_new();
+
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Content-Type", "text/xml; charset=UTF-8");
+ evbuffer_add_printf(buf, "Hello, %s!", "127.0.0.1");
+
+ evhttp_send_reply(req, HTTP_OK, "OK", buf);
+ evbuffer_free(buf);
+}
+
+static void
+http_badreq_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ event_debug(("%s: called (what=%04x, arg=%p)", __func__, what, arg));
+ /* ignore */
+}
+
+#ifndef SHUT_WR
+#ifdef _WIN32
+#define SHUT_WR SD_SEND
+#else
+#define SHUT_WR 1
+#endif
+#endif
+
+static void
+http_badreq_readcb(struct bufferevent *bev, void *arg)
+{
+ const char *what = "Hello, 127.0.0.1";
+ const char *bad_request = "400 Bad Request";
+
+ if (evbuffer_contains(bufferevent_get_input(bev), bad_request)) {
+ TT_FAIL(("%s:bad request detected", __func__));
+ bufferevent_disable(bev, EV_READ);
+ event_base_loopexit(arg, NULL);
+ return;
+ }
+
+ if (evbuffer_contains(bufferevent_get_input(bev), what)) {
+ struct evhttp_request *req = evhttp_request_new(NULL, NULL);
+ enum message_read_status done;
+
+ /* req->kind = EVHTTP_RESPONSE; */
+ done = evhttp_parse_firstline_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ done = evhttp_parse_headers_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ if (done == 1 &&
+ evhttp_find_header(evhttp_request_get_input_headers(req),
+ "Content-Type") != NULL)
+ test_ok++;
+
+ out:
+ evhttp_request_free(req);
+ evbuffer_drain(bufferevent_get_input(bev), evbuffer_get_length(bufferevent_get_input(bev)));
+ }
+
+ shutdown(bufferevent_getfd(bev), SHUT_WR);
+}
+
+static void
+http_badreq_successcb(evutil_socket_t fd, short what, void *arg)
+{
+ event_debug(("%s: called (what=%04x, arg=%p)", __func__, what, arg));
+ event_base_loopexit(exit_base, NULL);
+}
+
+static void
+http_bad_request_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct timeval tv;
+ struct bufferevent *bev = NULL;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port=0, port2=0;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+
+ /* bind to a second socket */
+ if (http_bind(http, &port2, 0) == -1)
+ TT_DIE(("Bind socket failed"));
+
+ /* NULL request test */
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_badreq_readcb, http_writecb,
+ http_badreq_errorcb, data->base);
+ bufferevent_enable(bev, EV_READ);
+
+ /* real NULL request */
+ http_request = "";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ shutdown(fd, SHUT_WR);
+ timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base, -1, EV_TIMEOUT, http_badreq_successcb, bev, &tv);
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ if (test_ok != 0) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ /* Second answer (BAD REQUEST) on connection close */
+
+ /* connect to the second port */
+ fd = http_connect("127.0.0.1", port2);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_badreq_readcb, http_writecb,
+ http_badreq_errorcb, data->base);
+ bufferevent_enable(bev, EV_READ);
+
+ /* first half of the http request */
+ http_request =
+ "GET /badrequest HTTP/1.0\r\n" \
+ "Connection: Keep-Alive\r\n" \
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base, -1, EV_TIMEOUT, http_badreq_successcb, bev, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 2);
+
+end:
+ evhttp_free(http);
+ if (bev)
+ bufferevent_free(bev);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static struct evhttp_connection *delayed_client;
+
+static void
+http_large_delay_cb(struct evhttp_request *req, void *arg)
+{
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_usec = 500000;
+
+ event_base_once(arg, -1, EV_TIMEOUT, http_delay_reply, req, &tv);
+ evhttp_connection_fail_(delayed_client, EVREQ_HTTP_EOF);
+}
+
+/*
+ * HTTP DELETE test, just piggyback on the basic test
+ */
+
+static void
+http_delete_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+ int empty = evhttp_find_header(evhttp_request_get_input_headers(req), "Empty") != NULL;
+
+ /* Expecting a DELETE request */
+ if (evhttp_request_get_command(req) != EVHTTP_REQ_DELETE) {
+ fprintf(stdout, "FAILED (delete type)\n");
+ exit(1);
+ }
+
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine",
+ !empty ? evb : NULL);
+
+ evbuffer_free(evb);
+}
+
+static void
+http_delete_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "DELETE /deleteit HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 2);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+http_sent_cb(struct evhttp_request *req, void *arg)
+{
+ ev_uintptr_t val = (ev_uintptr_t)arg;
+ struct evbuffer *b;
+
+ if (val != 0xDEADBEEF) {
+ fprintf(stdout, "FAILED on_complete_cb argument\n");
+ exit(1);
+ }
+
+ b = evhttp_request_get_output_buffer(req);
+ if (evbuffer_get_length(b) != 0) {
+ fprintf(stdout, "FAILED on_complete_cb output buffer not written\n");
+ exit(1);
+ }
+
+ event_debug(("%s: called\n", __func__));
+
+ ++test_ok;
+}
+
+static void
+http_on_complete_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb = evbuffer_new();
+
+ evhttp_request_set_on_complete_cb(req, http_sent_cb, (void *)0xDEADBEEF);
+
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ /* allow sending of an empty reply */
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+
+ ++test_ok;
+}
+
+static void
+http_on_complete_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request =
+ "GET /oncomplete HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 4);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+http_allowed_methods_eventcb(struct bufferevent *bev, short what, void *arg)
+{
+ char **output = arg;
+ if ((what & (BEV_EVENT_ERROR|BEV_EVENT_EOF))) {
+ char buf[4096];
+ int n;
+ n = evbuffer_remove(bufferevent_get_input(bev), buf,
+ sizeof(buf)-1);
+ if (n >= 0) {
+ buf[n]='\0';
+ if (*output)
+ free(*output);
+ *output = strdup(buf);
+ }
+ event_base_loopexit(exit_base, NULL);
+ }
+}
+
+static void
+http_allowed_methods_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev1, *bev2, *bev3;
+ evutil_socket_t fd1=-1, fd2=-1, fd3=-1;
+ const char *http_request;
+ char *result1=NULL, *result2=NULL, *result3=NULL;
+ ev_uint16_t port = 0;
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd1 = http_connect("127.0.0.1", port);
+ tt_int_op(fd1, >=, 0);
+
+ /* GET is out; PATCH is in. */
+ evhttp_set_allowed_methods(http, EVHTTP_REQ_PATCH);
+
+ /* Stupid thing to send a request */
+ bev1 = bufferevent_socket_new(data->base, fd1, 0);
+ bufferevent_enable(bev1, EV_READ|EV_WRITE);
+ bufferevent_setcb(bev1, NULL, NULL,
+ http_allowed_methods_eventcb, &result1);
+
+ http_request =
+ "GET /index.html HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev1, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ fd2 = http_connect("127.0.0.1", port);
+ tt_int_op(fd2, >=, 0);
+
+ bev2 = bufferevent_socket_new(data->base, fd2, 0);
+ bufferevent_enable(bev2, EV_READ|EV_WRITE);
+ bufferevent_setcb(bev2, NULL, NULL,
+ http_allowed_methods_eventcb, &result2);
+
+ http_request =
+ "PATCH /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev2, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ fd3 = http_connect("127.0.0.1", port);
+ tt_int_op(fd3, >=, 0);
+
+ bev3 = bufferevent_socket_new(data->base, fd3, 0);
+ bufferevent_enable(bev3, EV_READ|EV_WRITE);
+ bufferevent_setcb(bev3, NULL, NULL,
+ http_allowed_methods_eventcb, &result3);
+
+ http_request =
+ "FLOOP /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev3, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev1);
+ bufferevent_free(bev2);
+ bufferevent_free(bev3);
+
+ evhttp_free(http);
+
+ /* Method known but disallowed */
+ tt_assert(result1);
+ tt_assert(!strncmp(result1, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
+
+ /* Method known and allowed */
+ tt_assert(result2);
+ tt_assert(!strncmp(result2, "HTTP/1.1 200 ", strlen("HTTP/1.1 200 ")));
+
+ /* Method unknown */
+ tt_assert(result3);
+ tt_assert(!strncmp(result3, "HTTP/1.1 501 ", strlen("HTTP/1.1 501 ")));
+
+ end:
+ if (result1)
+ free(result1);
+ if (result2)
+ free(result2);
+ if (result3)
+ free(result3);
+ if (fd1 >= 0)
+ evutil_closesocket(fd1);
+ if (fd2 >= 0)
+ evutil_closesocket(fd2);
+ if (fd3 >= 0)
+ evutil_closesocket(fd3);
+}
+
+static void http_request_done(struct evhttp_request *, void *);
+static void http_request_empty_done(struct evhttp_request *, void *);
+
+static void
+http_connection_test_(struct basic_test_data *data, int persistent, const char *address, struct evdns_base *dnsbase, int ipv6)
+{
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, ipv6);
+
+ evcon = evhttp_connection_base_new(data->base, dnsbase, address, port);
+ tt_assert(evcon);
+
+ tt_assert(evhttp_connection_get_base(evcon) == data->base);
+
+ exit_base = data->base;
+
+ tt_assert(evhttp_connection_get_server(evcon) == NULL);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok);
+
+ /* try to make another request over the same connection */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /*
+ * if our connections are not supposed to be persistent; request
+ * a close from the server.
+ */
+ if (!persistent)
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Connection", "close");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ /* make another request: request empty reply */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_empty_done, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Empty", "itis");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_connection_test(void *arg)
+{
+ http_connection_test_(arg, 0, "127.0.0.1", NULL, 0);
+}
+static void
+http_persist_connection_test(void *arg)
+{
+ http_connection_test_(arg, 1, "127.0.0.1", NULL, 0);
+}
+
+static struct regress_dns_server_table search_table[] = {
+ { "localhost", "A", "127.0.0.1", 0 },
+ { NULL, NULL, NULL, 0 }
+};
+
+static void
+http_connection_async_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct evdns_base *dns_base = NULL;
+ ev_uint16_t portnum = 0;
+ char address[64];
+
+ exit_base = data->base;
+ tt_assert(regress_dnsserver(data->base, &portnum, search_table));
+
+ dns_base = evdns_base_new(data->base, 0/* init name servers */);
+ tt_assert(dns_base);
+
+ /* Add ourself as the only nameserver, and make sure we really are
+ * the only nameserver. */
+ evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
+ evdns_base_nameserver_ip_add(dns_base, address);
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, dns_base, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok);
+
+ /* try to make another request over the same connection */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /*
+ * if our connections are not supposed to be persistent; request
+ * a close from the server.
+ */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Connection", "close");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ /* make another request: request empty reply */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_empty_done, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Empty", "itis");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+ if (dns_base)
+ evdns_base_free(dns_base, 0);
+ regress_clean_dnsserver();
+}
+
+static void
+http_request_never_call(struct evhttp_request *req, void *arg)
+{
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+}
+
+static void
+http_do_cancel(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_request *req = arg;
+ struct timeval tv;
+ struct event_base *base;
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 500 * 1000;
+
+ base = evhttp_connection_get_base(evhttp_request_get_connection(req));
+ evhttp_cancel_request(req);
+
+ event_base_loopexit(base, &tv);
+
+ ++test_ok;
+}
+
+static void
+http_cancel_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct timeval tv;
+
+ exit_base = data->base;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_never_call, NULL);
+ evhttp_request_set_error_cb(req, http_request_error_cb_with_cancel_);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ tt_int_op(evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/delay"),
+ !=, -1);
+
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 100 * 1000;
+
+ event_base_once(data->base, -1, EV_TIMEOUT, http_do_cancel, req, &tv);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 3);
+
+ /* try to make another request over the same connection */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ tt_int_op(evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test"),
+ !=, -1);
+
+ event_base_dispatch(data->base);
+
+ /* make another request: request empty reply */
+ test_ok = 0;
+
+ req = evhttp_request_new(http_request_empty_done, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Empty", "itis");
+
+ /* We give ownership of the request to the connection */
+ tt_int_op(evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test"),
+ !=, -1);
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_request_done(struct evhttp_request *req, void *arg)
+{
+ const char *what = arg;
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ EVUTIL_ASSERT(exit_base);
+ event_base_loopexit(exit_base, NULL);
+}
+
+static void
+http_request_expect_error(struct evhttp_request *req, void *arg)
+{
+ if (evhttp_request_get_response_code(req) == HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ EVUTIL_ASSERT(arg);
+ event_base_loopexit(arg, NULL);
+}
+
+/* test virtual hosts */
+static void
+http_virtual_host_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct evhttp *second = NULL, *third = NULL;
+ evutil_socket_t fd;
+ struct bufferevent *bev;
+ const char *http_request;
+
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+
+ /* virtual host */
+ second = evhttp_new(NULL);
+ evhttp_set_cb(second, "/funnybunny", http_basic_cb, NULL);
+ third = evhttp_new(NULL);
+ evhttp_set_cb(third, "/blackcoffee", http_basic_cb, NULL);
+
+ if (evhttp_add_virtual_host(http, "foo.com", second) == -1) {
+ tt_abort_msg("Couldn't add vhost");
+ }
+
+ if (evhttp_add_virtual_host(http, "bar.*.foo.com", third) == -1) {
+ tt_abort_msg("Couldn't add wildcarded vhost");
+ }
+
+ /* add some aliases to the vhosts */
+ tt_assert(evhttp_add_server_alias(second, "manolito.info") == 0);
+ tt_assert(evhttp_add_server_alias(third, "bonkers.org") == 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* make a request with a different host and expect an error */
+ req = evhttp_request_new(http_request_expect_error, data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/funnybunny") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1);
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "foo.com");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/funnybunny") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1);
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "bar.magic.foo.com");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/blackcoffee") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1)
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "manolito.info");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/funnybunny") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1)
+
+ test_ok = 0;
+
+ /* make a request with the right host and expect a response */
+ req = evhttp_request_new(http_request_done, (void*) BASIC_REQUEST_BODY);
+
+ /* Add the Host header. This time with the optional port. */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "bonkers.org:8000");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/blackcoffee") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1)
+
+ test_ok = 0;
+
+ /* Now make a raw request with an absolute URI. */
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, NULL);
+
+ /* The host in the URI should override the Host: header */
+ http_request =
+ "GET http://manolito.info/funnybunny HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 2);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+
+/* test date header and content length */
+
+static void
+http_request_empty_done(struct evhttp_request *req, void *arg)
+{
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Date") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Length") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (strcmp(evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Length"),
+ "0")) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != 0) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ EVUTIL_ASSERT(arg);
+ event_base_loopexit(arg, NULL);
+}
+
+/*
+ * HTTP DISPATCHER test
+ */
+
+void
+http_dispatcher_cb(struct evhttp_request *req, void *arg)
+{
+
+ struct evbuffer *evb = evbuffer_new();
+ event_debug(("%s: called\n", __func__));
+ evbuffer_add_printf(evb, "DISPATCHER_TEST");
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+
+static void
+http_dispatcher_test_done(struct evhttp_request *req, void *arg)
+{
+ struct event_base *base = arg;
+ const char *what = "DISPATCHER_TEST";
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED (content type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(what));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED (data)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(base, NULL);
+}
+
+static void
+http_dispatcher_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* also bind to local host */
+ evhttp_connection_set_local_address(evcon, "127.0.0.1");
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_dispatcher_test_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+/*
+ * HTTP POST test.
+ */
+
+void http_postrequest_done(struct evhttp_request *, void *);
+
+#define POST_DATA "Okay. Not really printf"
+
+static void
+http_post_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP POST request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_postrequest_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), POST_DATA);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/postit") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+ test_ok = 0;
+
+ req = evhttp_request_new(http_postrequest_done, data->base);
+ tt_assert(req);
+
+ /* Now try with 100-continue. */
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), POST_DATA);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/postit") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+ evhttp_connection_free(evcon);
+ evhttp_free(http);
+
+ end:
+ ;
+}
+
+void
+http_post_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb;
+ event_debug(("%s: called\n", __func__));
+
+ /* Yes, we are expecting a post request */
+ if (evhttp_request_get_command(req) != EVHTTP_REQ_POST) {
+ fprintf(stdout, "FAILED (post type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(POST_DATA)) {
+ fprintf(stdout, "FAILED (length: %lu vs %lu)\n",
+ (unsigned long) evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long) strlen(POST_DATA));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), POST_DATA) != 0) {
+ fprintf(stdout, "FAILED (data)\n");
+ fprintf(stdout, "Got :%s\n", evbuffer_pullup(evhttp_request_get_input_buffer(req),-1));
+ fprintf(stdout, "Want:%s\n", POST_DATA);
+ exit(1);
+ }
+
+ evb = evbuffer_new();
+ evbuffer_add_printf(evb, BASIC_REQUEST_BODY);
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb);
+
+ evbuffer_free(evb);
+}
+
+void
+http_postrequest_done(struct evhttp_request *req, void *arg)
+{
+ const char *what = BASIC_REQUEST_BODY;
+ struct event_base *base = arg;
+
+ if (req == NULL) {
+ fprintf(stderr, "FAILED (timeout)\n");
+ exit(1);
+ }
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED (content type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(what));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED (data)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(base, NULL);
+}
+
+/*
+ * HTTP PUT test, basically just like POST, but ...
+ */
+
+void http_putrequest_done(struct evhttp_request *, void *);
+
+#define PUT_DATA "Hi, I'm some PUT data"
+
+static void
+http_put_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * Schedule the HTTP PUT request
+ */
+
+ req = evhttp_request_new(http_putrequest_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "someotherhost");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), PUT_DATA);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_PUT, "/putit") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ evhttp_connection_free(evcon);
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 1);
+ end:
+ ;
+}
+
+void
+http_put_cb(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *evb;
+ event_debug(("%s: called\n", __func__));
+
+ /* Expecting a PUT request */
+ if (evhttp_request_get_command(req) != EVHTTP_REQ_PUT) {
+ fprintf(stdout, "FAILED (put type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(PUT_DATA)) {
+ fprintf(stdout, "FAILED (length: %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(PUT_DATA));
+ exit(1);
+ }
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), PUT_DATA) != 0) {
+ fprintf(stdout, "FAILED (data)\n");
+ fprintf(stdout, "Got :%s\n", evbuffer_pullup(evhttp_request_get_input_buffer(req),-1));
+ fprintf(stdout, "Want:%s\n", PUT_DATA);
+ exit(1);
+ }
+
+ evb = evbuffer_new();
+ evbuffer_add_printf(evb, "That ain't funny");
+
+ evhttp_send_reply(req, HTTP_OK, "Everything is great", evb);
+
+ evbuffer_free(evb);
+}
+
+void
+http_putrequest_done(struct evhttp_request *req, void *arg)
+{
+ struct event_base *base = arg;
+ const char *what = "That ain't funny";
+
+ if (req == NULL) {
+ fprintf(stderr, "FAILED (timeout)\n");
+ exit(1);
+ }
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") == NULL) {
+ fprintf(stderr, "FAILED (content type)\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != strlen(what)) {
+ fprintf(stderr, "FAILED (length %lu vs %lu)\n",
+ (unsigned long)evbuffer_get_length(evhttp_request_get_input_buffer(req)), (unsigned long)strlen(what));
+ exit(1);
+ }
+
+
+ if (evbuffer_datacmp(evhttp_request_get_input_buffer(req), what) != 0) {
+ fprintf(stderr, "FAILED (data)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(base, NULL);
+}
+
+static void
+http_failure_readcb(struct bufferevent *bev, void *arg)
+{
+ const char *what = "400 Bad Request";
+ if (evbuffer_contains(bufferevent_get_input(bev), what)) {
+ test_ok = 2;
+ bufferevent_disable(bev, EV_READ);
+ event_base_loopexit(arg, NULL);
+ }
+}
+
+/*
+ * Testing that the HTTP server can deal with a malformed request.
+ */
+static void
+http_failure_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd = -1;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, http_failure_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_request = "illegal request\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 2);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+close_detect_done(struct evhttp_request *req, void *arg)
+{
+ struct timeval tv;
+ tt_assert(req);
+ tt_assert(evhttp_request_get_response_code(req) == HTTP_OK);
+
+ test_ok = 1;
+
+ end:
+ evutil_timerclear(&tv);
+ tv.tv_usec = 150000;
+ event_base_loopexit(arg, &tv);
+}
+
+static void
+close_detect_launch(evutil_socket_t fd, short what, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct event_base *base = evhttp_connection_get_base(evcon);
+ struct evhttp_request *req;
+
+ req = evhttp_request_new(close_detect_done, base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_fail_msg("Couldn't make request");
+ }
+}
+
+static void
+close_detect_cb(struct evhttp_request *req, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct event_base *base = evhttp_connection_get_base(evcon);
+ struct timeval tv;
+
+ if (req != NULL && evhttp_request_get_response_code(req) != HTTP_OK) {
+ tt_abort_msg("Failed");
+ }
+
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0; /* longer than the http time out */
+ tv.tv_usec = 600000; /* longer than the http time out */
+
+ /* launch a new request on the persistent connection in .3 seconds */
+ event_base_once(base, -1, EV_TIMEOUT, close_detect_launch, evcon, &tv);
+ end:
+ ;
+}
+
+
+static void
+http_close_detection_(struct basic_test_data *data, int with_delay)
+{
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ const struct timeval sec_tenth = { 0, 100000 };
+
+ test_ok = 0;
+ http = http_setup(&port, data->base, 0);
+
+ /* .1 second timeout */
+ evhttp_set_timeout_tv(http, &sec_tenth);
+
+ evcon = evhttp_connection_base_new(data->base, NULL,
+ "127.0.0.1", port);
+ tt_assert(evcon);
+ evhttp_connection_set_timeout_tv(evcon, &sec_tenth);
+
+
+ tt_assert(evcon);
+ delayed_client = evcon;
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(close_detect_cb, evcon);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon,
+ req, EVHTTP_REQ_GET, with_delay ? "/largedelay" : "/test") == -1) {
+ tt_abort_msg("couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ /* at this point, the http server should have no connection */
+ tt_assert(TAILQ_FIRST(&http->connections) == NULL);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+static void
+http_close_detection_test(void *arg)
+{
+ http_close_detection_(arg, 0);
+}
+static void
+http_close_detection_delay_test(void *arg)
+{
+ http_close_detection_(arg, 1);
+}
+
+static void
+http_highport_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ int i = -1;
+ struct evhttp *myhttp = NULL;
+
+ /* Try a few different ports */
+ for (i = 0; i < 50; ++i) {
+ myhttp = evhttp_new(data->base);
+ if (evhttp_bind_socket(myhttp, "127.0.0.1", 65535 - i) == 0) {
+ test_ok = 1;
+ evhttp_free(myhttp);
+ return;
+ }
+ evhttp_free(myhttp);
+ }
+
+ tt_fail_msg("Couldn't get a high port");
+}
+
+static void
+http_bad_header_test(void *ptr)
+{
+ struct evkeyvalq headers;
+
+ TAILQ_INIT(&headers);
+
+ tt_want(evhttp_add_header(&headers, "One", "Two") == 0);
+ tt_want(evhttp_add_header(&headers, "One", "Two\r\n Three") == 0);
+ tt_want(evhttp_add_header(&headers, "One\r", "Two") == -1);
+ tt_want(evhttp_add_header(&headers, "One\n", "Two") == -1);
+ tt_want(evhttp_add_header(&headers, "One", "Two\r") == -1);
+ tt_want(evhttp_add_header(&headers, "One", "Two\n") == -1);
+
+ evhttp_clear_headers(&headers);
+}
+
+static int validate_header(
+ const struct evkeyvalq* headers,
+ const char *key, const char *value)
+{
+ const char *real_val = evhttp_find_header(headers, key);
+ tt_assert(real_val != NULL);
+ tt_want(strcmp(real_val, value) == 0);
+end:
+ return (0);
+}
+
+static void
+http_parse_query_test(void *ptr)
+{
+ struct evkeyvalq headers;
+ int r;
+
+ TAILQ_INIT(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test", &headers);
+ tt_want(validate_header(&headers, "q", "test") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test&foo=bar", &headers);
+ tt_want(validate_header(&headers, "q", "test") == 0);
+ tt_want(validate_header(&headers, "foo", "bar") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test+foo", &headers);
+ tt_want(validate_header(&headers, "q", "test foo") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test%0Afoo", &headers);
+ tt_want(validate_header(&headers, "q", "test\nfoo") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test%0Dfoo", &headers);
+ tt_want(validate_header(&headers, "q", "test\rfoo") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test&&q2", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test+this", &headers);
+ tt_want(validate_header(&headers, "q", "test this") == 0);
+ tt_int_op(r, ==, 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=test&q2=foo", &headers);
+ tt_int_op(r, ==, 0);
+ tt_want(validate_header(&headers, "q", "test") == 0);
+ tt_want(validate_header(&headers, "q2", "foo") == 0);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q&q2=foo", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=foo&q2", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=foo&q2&q3=x", &headers);
+ tt_int_op(r, ==, -1);
+ evhttp_clear_headers(&headers);
+
+ r = evhttp_parse_query("http://www.test.com/?q=&q2=&q3=", &headers);
+ tt_int_op(r, ==, 0);
+ tt_want(validate_header(&headers, "q", "") == 0);
+ tt_want(validate_header(&headers, "q2", "") == 0);
+ tt_want(validate_header(&headers, "q3", "") == 0);
+ evhttp_clear_headers(&headers);
+
+end:
+ evhttp_clear_headers(&headers);
+}
+
+static void
+http_parse_uri_test(void *ptr)
+{
+ const int nonconform = (ptr != NULL);
+ const unsigned parse_flags =
+ nonconform ? EVHTTP_URI_NONCONFORMANT : 0;
+ struct evhttp_uri *uri = NULL;
+ char url_tmp[4096];
+#define URI_PARSE(uri) \
+ evhttp_uri_parse_with_flags((uri), parse_flags)
+
+#define TT_URI(want) do { \
+ char *ret = evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)); \
+ tt_want(ret != NULL); \
+ tt_want(ret == url_tmp); \
+ if (strcmp(ret,want) != 0) \
+ TT_FAIL(("\"%s\" != \"%s\"",ret,want)); \
+ } while(0)
+
+ tt_want(evhttp_uri_join(NULL, 0, 0) == NULL);
+ tt_want(evhttp_uri_join(NULL, url_tmp, 0) == NULL);
+ tt_want(evhttp_uri_join(NULL, url_tmp, sizeof(url_tmp)) == NULL);
+
+ /* bad URIs: parsing */
+#define BAD(s) do { \
+ if (URI_PARSE(s) != NULL) \
+ TT_FAIL(("Expected error parsing \"%s\"",s)); \
+ } while(0)
+ /* Nonconformant URIs we can parse: parsing */
+#define NCF(s) do { \
+ uri = URI_PARSE(s); \
+ if (uri != NULL && !nonconform) { \
+ TT_FAIL(("Expected error parsing \"%s\"",s)); \
+ } else if (uri == NULL && nonconform) { \
+ TT_FAIL(("Couldn't parse nonconformant URI \"%s\"", \
+ s)); \
+ } \
+ if (uri) { \
+ tt_want(evhttp_uri_join(uri, url_tmp, \
+ sizeof(url_tmp))); \
+ evhttp_uri_free(uri); \
+ } \
+ } while(0)
+
+ NCF("http://www.test.com/ why hello");
+ NCF("http://www.test.com/why-hello\x01");
+ NCF("http://www.test.com/why-hello?\x01");
+ NCF("http://www.test.com/why-hello#\x01");
+ BAD("http://www.\x01.test.com/why-hello");
+ BAD("http://www.%7test.com/why-hello");
+ NCF("http://www.test.com/why-hell%7o");
+ BAD("h%3ttp://www.test.com/why-hello");
+ NCF("http://www.test.com/why-hello%7");
+ NCF("http://www.test.com/why-hell%7o");
+ NCF("http://www.test.com/foo?ba%r");
+ NCF("http://www.test.com/foo#ba%r");
+ BAD("99:99/foo");
+ BAD("http://www.test.com:999x/");
+ BAD("http://www.test.com:x/");
+ BAD("http://[hello-there]/");
+ BAD("http://[::1]]/");
+ BAD("http://[::1/");
+ BAD("http://[foob/");
+ BAD("http://[/");
+ BAD("http://[ffff:ffff:ffff:ffff:Ffff:ffff:ffff:"
+ "ffff:ffff:ffff:ffff:ffff:ffff:ffff]/");
+ BAD("http://[vX.foo]/");
+ BAD("http://[vX.foo]/");
+ BAD("http://[v.foo]/");
+ BAD("http://[v5.fo%o]/");
+ BAD("http://[v5X]/");
+ BAD("http://[v5]/");
+ BAD("http://[]/");
+ BAD("http://f\x01red@www.example.com/");
+ BAD("http://f%0red@www.example.com/");
+ BAD("http://www.example.com:9999999999999999999999999999999999999/");
+ BAD("http://www.example.com:hihi/");
+ BAD("://www.example.com/");
+
+ /* bad URIs: joining */
+ uri = evhttp_uri_new();
+ tt_want(0==evhttp_uri_set_host(uri, "www.example.com"));
+ tt_want(evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)) != NULL);
+ /* not enough space: */
+ tt_want(evhttp_uri_join(uri, url_tmp, 3) == NULL);
+ /* host is set, but path doesn't start with "/": */
+ tt_want(0==evhttp_uri_set_path(uri, "hi_mom"));
+ tt_want(evhttp_uri_join(uri, url_tmp, sizeof(url_tmp)) == NULL);
+ tt_want(evhttp_uri_join(uri, NULL, sizeof(url_tmp))==NULL);
+ tt_want(evhttp_uri_join(uri, url_tmp, 0)==NULL);
+ evhttp_uri_free(uri);
+ uri = URI_PARSE("mailto:foo@bar");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(!strcmp(evhttp_uri_get_scheme(uri), "mailto"));
+ tt_want(!strcmp(evhttp_uri_get_path(uri), "foo@bar"));
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("mailto:foo@bar");
+ evhttp_uri_free(uri);
+
+ uri = evhttp_uri_new();
+ /* Bad URI usage: setting invalid values */
+ tt_want(-1 == evhttp_uri_set_scheme(uri,""));
+ tt_want(-1 == evhttp_uri_set_scheme(uri,"33"));
+ tt_want(-1 == evhttp_uri_set_scheme(uri,"hi!"));
+ tt_want(-1 == evhttp_uri_set_userinfo(uri,"hello@"));
+ tt_want(-1 == evhttp_uri_set_host(uri,"[1.2.3.4]"));
+ tt_want(-1 == evhttp_uri_set_host(uri,"["));
+ tt_want(-1 == evhttp_uri_set_host(uri,"www.[foo].com"));
+ tt_want(-1 == evhttp_uri_set_port(uri,-3));
+ tt_want(-1 == evhttp_uri_set_path(uri,"hello?world"));
+ tt_want(-1 == evhttp_uri_set_query(uri,"hello#world"));
+ tt_want(-1 == evhttp_uri_set_fragment(uri,"hello#world"));
+ /* Valid URI usage: setting valid values */
+ tt_want(0 == evhttp_uri_set_scheme(uri,"http"));
+ tt_want(0 == evhttp_uri_set_scheme(uri,NULL));
+ tt_want(0 == evhttp_uri_set_userinfo(uri,"username:pass"));
+ tt_want(0 == evhttp_uri_set_userinfo(uri,NULL));
+ tt_want(0 == evhttp_uri_set_host(uri,"www.example.com"));
+ tt_want(0 == evhttp_uri_set_host(uri,"1.2.3.4"));
+ tt_want(0 == evhttp_uri_set_host(uri,"[1:2:3:4::]"));
+ tt_want(0 == evhttp_uri_set_host(uri,"[v7.wobblewobble]"));
+ tt_want(0 == evhttp_uri_set_host(uri,NULL));
+ tt_want(0 == evhttp_uri_set_host(uri,""));
+ tt_want(0 == evhttp_uri_set_port(uri, -1));
+ tt_want(0 == evhttp_uri_set_port(uri, 80));
+ tt_want(0 == evhttp_uri_set_port(uri, 65535));
+ tt_want(0 == evhttp_uri_set_path(uri, ""));
+ tt_want(0 == evhttp_uri_set_path(uri, "/documents/public/index.html"));
+ tt_want(0 == evhttp_uri_set_path(uri, NULL));
+ tt_want(0 == evhttp_uri_set_query(uri, "key=val&key2=val2"));
+ tt_want(0 == evhttp_uri_set_query(uri, "keyvalblarg"));
+ tt_want(0 == evhttp_uri_set_query(uri, ""));
+ tt_want(0 == evhttp_uri_set_query(uri, NULL));
+ tt_want(0 == evhttp_uri_set_fragment(uri, ""));
+ tt_want(0 == evhttp_uri_set_fragment(uri, "here?i?am"));
+ tt_want(0 == evhttp_uri_set_fragment(uri, NULL));
+ evhttp_uri_free(uri);
+
+ /* Valid parsing */
+ uri = URI_PARSE("http://www.test.com/?q=t%33est");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=t%33est") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com/?q=t%33est");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://%77ww.test.com");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "%77ww.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://%77ww.test.com");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com#fragment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want_str_op(evhttp_uri_get_fragment(uri), ==, "fragment");
+ TT_URI("http://www.test.com#fragment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://8000/");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "8000") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://8000/");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://:8000/");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == 8000);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://:8000/");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com:/"); /* empty port */
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want_str_op(evhttp_uri_get_path(uri), ==, "/");
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com/");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("http://www.test.com:"); /* empty port 2 */
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "http") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("http://www.test.com");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://www.test.com/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "www.test.com") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://www.test.com/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://[::1]:999/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[::1]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == 999);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://[::1]:999/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://[ff00::127.0.0.1]/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[ff00::127.0.0.1]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://[ff00::127.0.0.1]/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("ftp://[v99.not_(any:time)_soon]/?q=test");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "ftp") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "[v99.not_(any:time)_soon]") == 0);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("ftp://[v99.not_(any:time)_soon]/?q=test");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("scheme://user:pass@foo.com:42/?q=test&s=some+thing#fragment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "user:pass") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == 42);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=test&s=some+thing") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fragment") == 0);
+ TT_URI("scheme://user:pass@foo.com:42/?q=test&s=some+thing#fragment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("scheme://user@foo.com/#fragment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "user") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fragment") == 0);
+ TT_URI("scheme://user@foo.com/#fragment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("scheme://%75ser@foo.com/#frag@ment");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "scheme") == 0);
+ tt_want(strcmp(evhttp_uri_get_userinfo(uri), "%75ser") == 0);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "foo.com") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "frag@ment") == 0);
+ TT_URI("scheme://%75ser@foo.com/#frag@ment");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("file:///some/path/to/the/file");
+ tt_want(strcmp(evhttp_uri_get_scheme(uri), "file") == 0);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/some/path/to/the/file") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("file:///some/path/to/the/file");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("///some/path/to/the-file");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_host(uri), "") == 0);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/some/path/to/the-file") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("///some/path/to/the-file");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("/s:ome/path/to/the-file?q=99#fred");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "/s:ome/path/to/the-file") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=99") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fred") == 0);
+ TT_URI("/s:ome/path/to/the-file?q=99#fred");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("relative/path/with/co:lon");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "relative/path/with/co:lon") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(evhttp_uri_get_fragment(uri) == NULL);
+ TT_URI("relative/path/with/co:lon");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("bob?q=99&q2=q?33#fr?ed");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "bob") == 0);
+ tt_want(strcmp(evhttp_uri_get_query(uri), "q=99&q2=q?33") == 0);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fr?ed") == 0);
+ TT_URI("bob?q=99&q2=q?33#fr?ed");
+ evhttp_uri_free(uri);
+
+ uri = URI_PARSE("#fr?ed");
+ tt_want(uri != NULL);
+ tt_want(evhttp_uri_get_scheme(uri) == NULL);
+ tt_want(evhttp_uri_get_userinfo(uri) == NULL);
+ tt_want(evhttp_uri_get_host(uri) == NULL);
+ tt_want(evhttp_uri_get_port(uri) == -1);
+ tt_want(strcmp(evhttp_uri_get_path(uri), "") == 0);
+ tt_want(evhttp_uri_get_query(uri) == NULL);
+ tt_want(strcmp(evhttp_uri_get_fragment(uri), "fr?ed") == 0);
+ TT_URI("#fr?ed");
+ evhttp_uri_free(uri);
+#undef URI_PARSE
+#undef TT_URI
+#undef BAD
+}
+
+static void
+http_uriencode_test(void *ptr)
+{
+ char *s=NULL, *s2=NULL;
+ size_t sz;
+ int bytes_decoded;
+
+#define ENC(from,want,plus) do { \
+ s = evhttp_uriencode((from), -1, (plus)); \
+ tt_assert(s); \
+ tt_str_op(s,==,(want)); \
+ sz = -1; \
+ s2 = evhttp_uridecode((s), (plus), &sz); \
+ tt_assert(s2); \
+ tt_str_op(s2,==,(from)); \
+ tt_int_op(sz,==,strlen(from)); \
+ free(s); \
+ free(s2); \
+ s = s2 = NULL; \
+ } while (0)
+
+#define DEC(from,want,dp) do { \
+ s = evhttp_uridecode((from),(dp),&sz); \
+ tt_assert(s); \
+ tt_str_op(s,==,(want)); \
+ tt_int_op(sz,==,strlen(want)); \
+ free(s); \
+ s = NULL; \
+ } while (0)
+
+#define OLD_DEC(from,want) do { \
+ s = evhttp_decode_uri((from)); \
+ tt_assert(s); \
+ tt_str_op(s,==,(want)); \
+ free(s); \
+ s = NULL; \
+ } while (0)
+
+
+ ENC("Hello", "Hello",0);
+ ENC("99", "99",0);
+ ENC("", "",0);
+ ENC(
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_",
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-.~_",0);
+ ENC(" ", "%20",0);
+ ENC(" ", "+",1);
+ ENC("\xff\xf0\xe0", "%FF%F0%E0",0);
+ ENC("\x01\x19", "%01%19",1);
+ ENC("http://www.ietf.org/rfc/rfc3986.txt",
+ "http%3A%2F%2Fwww.ietf.org%2Frfc%2Frfc3986.txt",1);
+
+ ENC("1+2=3", "1%2B2%3D3",1);
+ ENC("1+2=3", "1%2B2%3D3",0);
+
+ /* Now try encoding with internal NULs. */
+ s = evhttp_uriencode("hello\0world", 11, 0);
+ tt_assert(s);
+ tt_str_op(s,==,"hello%00world");
+ free(s);
+ s = NULL;
+
+ /* Now try decoding just part of string. */
+ s = malloc(6 + 1 /* NUL byte */);
+ bytes_decoded = evhttp_decode_uri_internal("hello%20%20", 6, s, 0);
+ tt_assert(s);
+ tt_int_op(bytes_decoded,==,6);
+ tt_str_op(s,==,"hello%");
+ free(s);
+ s = NULL;
+
+ /* Now try out some decoding cases that we don't generate with
+ * encode_uri: Make sure that malformed stuff doesn't crash... */
+ DEC("%%xhello th+ere \xff",
+ "%%xhello th+ere \xff", 0);
+ /* Make sure plus decoding works */
+ DEC("plus+should%20work+", "plus should work ",1);
+ /* Try some lowercase hex */
+ DEC("%f0%a0%b0", "\xf0\xa0\xb0",1);
+
+ /* Try an internal NUL. */
+ sz = 0;
+ s = evhttp_uridecode("%00%00x%00%00", 1, &sz);
+ tt_int_op(sz,==,5);
+ tt_assert(!memcmp(s, "\0\0x\0\0", 5));
+ free(s);
+ s = NULL;
+
+ /* Try with size == NULL */
+ sz = 0;
+ s = evhttp_uridecode("%00%00x%00%00", 1, NULL);
+ tt_assert(!memcmp(s, "\0\0x\0\0", 5));
+ free(s);
+ s = NULL;
+
+ /* Test out the crazy old behavior of the deprecated
+ * evhttp_decode_uri */
+ OLD_DEC("http://example.com/normal+path/?key=val+with+spaces",
+ "http://example.com/normal+path/?key=val with spaces");
+
+end:
+ if (s)
+ free(s);
+ if (s2)
+ free(s2);
+#undef ENC
+#undef DEC
+#undef OLD_DEC
+}
+
+static void
+http_base_test(void *ptr)
+{
+ struct event_base *base = NULL;
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+ base = event_base_new();
+ tt_assert(base);
+ http = http_setup(&port, base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(base, fd, 0);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, base);
+ bufferevent_base_set(base, bev);
+
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ event_base_dispatch(base);
+
+ bufferevent_free(bev);
+ evutil_closesocket(fd);
+
+ evhttp_free(http);
+
+ tt_int_op(test_ok, ==, 2);
+
+end:
+ if (base)
+ event_base_free(base);
+}
+
+/*
+ * the server is just going to close the connection if it times out during
+ * reading the headers.
+ */
+
+static void
+http_incomplete_readcb(struct bufferevent *bev, void *arg)
+{
+ test_ok = -1;
+ event_base_loopexit(exit_base,NULL);
+}
+
+static void
+http_incomplete_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ if (what == (BEV_EVENT_READING|BEV_EVENT_EOF))
+ test_ok++;
+ else
+ test_ok = -2;
+ event_base_loopexit(exit_base,NULL);
+}
+
+static void
+http_incomplete_writecb(struct bufferevent *bev, void *arg)
+{
+ if (arg != NULL) {
+ evutil_socket_t fd = *(evutil_socket_t *)arg;
+ /* terminate the write side to simulate EOF */
+ shutdown(fd, SHUT_WR);
+ }
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ /* enable reading of the reply */
+ bufferevent_enable(bev, EV_READ);
+ test_ok++;
+ }
+}
+
+static void
+http_incomplete_test_(struct basic_test_data *data, int use_timeout)
+{
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0;
+ struct timeval tv_start, tv_end;
+
+ exit_base = data->base;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+ evhttp_set_timeout(http, 1);
+
+ fd = http_connect("127.0.0.1", port);
+ tt_int_op(fd, >=, 0);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev,
+ http_incomplete_readcb, http_incomplete_writecb,
+ http_incomplete_errorcb, use_timeout ? NULL : &fd);
+
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ evutil_gettimeofday(&tv_start, NULL);
+
+ event_base_dispatch(data->base);
+
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+
+ bufferevent_free(bev);
+ if (use_timeout) {
+ evutil_closesocket(fd);
+ }
+
+ evhttp_free(http);
+
+ if (use_timeout && tv_end.tv_sec >= 3) {
+ tt_abort_msg("time");
+ } else if (!use_timeout && tv_end.tv_sec >= 1) {
+ /* we should be done immediately */
+ tt_abort_msg("time");
+ }
+
+ tt_int_op(test_ok, ==, 2);
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+static void
+http_incomplete_test(void *arg)
+{
+ http_incomplete_test_(arg, 0);
+}
+static void
+http_incomplete_timeout_test(void *arg)
+{
+ http_incomplete_test_(arg, 1);
+}
+
+/*
+ * the server is going to reply with chunked data.
+ */
+
+static void
+http_chunked_readcb(struct bufferevent *bev, void *arg)
+{
+ /* nothing here */
+}
+
+static void
+http_chunked_errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ struct evhttp_request *req = NULL;
+
+ if (!test_ok)
+ goto out;
+
+ test_ok = -1;
+
+ if ((what & BEV_EVENT_EOF) != 0) {
+ const char *header;
+ enum message_read_status done;
+ req = evhttp_request_new(NULL, NULL);
+
+ /* req->kind = EVHTTP_RESPONSE; */
+ done = evhttp_parse_firstline_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ done = evhttp_parse_headers_(req, bufferevent_get_input(bev));
+ if (done != ALL_DATA_READ)
+ goto out;
+
+ header = evhttp_find_header(evhttp_request_get_input_headers(req), "Transfer-Encoding");
+ if (header == NULL || strcmp(header, "chunked"))
+ goto out;
+
+ header = evhttp_find_header(evhttp_request_get_input_headers(req), "Connection");
+ if (header == NULL || strcmp(header, "close"))
+ goto out;
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 13 chars */
+ if (strcmp(header, "d")) {
+ free((void*)header);
+ goto out;
+ }
+ free((void*)header);
+
+ if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 13),
+ "This is funny", 13))
+ goto out;
+
+ evbuffer_drain(bufferevent_get_input(bev), 13 + 2);
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 18 chars */
+ if (strcmp(header, "12"))
+ goto out;
+ free((char *)header);
+
+ if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 18),
+ "but not hilarious.", 18))
+ goto out;
+
+ evbuffer_drain(bufferevent_get_input(bev), 18 + 2);
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 8 chars */
+ if (strcmp(header, "8")) {
+ free((void*)header);
+ goto out;
+ }
+ free((char *)header);
+
+ if (strncmp((char *)evbuffer_pullup(bufferevent_get_input(bev), 8),
+ "bwv 1052.", 8))
+ goto out;
+
+ evbuffer_drain(bufferevent_get_input(bev), 8 + 2);
+
+ header = evbuffer_readln(bufferevent_get_input(bev), NULL, EVBUFFER_EOL_CRLF);
+ if (header == NULL)
+ goto out;
+ /* 0 chars */
+ if (strcmp(header, "0")) {
+ free((void*)header);
+ goto out;
+ }
+ free((void *)header);
+
+ test_ok = 2;
+ }
+
+out:
+ if (req)
+ evhttp_request_free(req);
+
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_chunked_writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ /* enable reading of the reply */
+ bufferevent_enable(bev, EV_READ);
+ test_ok++;
+ }
+}
+
+static void
+http_chunked_request_done(struct evhttp_request *req, void *arg)
+{
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evhttp_find_header(evhttp_request_get_input_headers(req),
+ "Transfer-Encoding") == NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != 13 + 18 + 8) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ if (strncmp((char *)evbuffer_pullup(evhttp_request_get_input_buffer(req), 13 + 18 + 8),
+ "This is funnybut not hilarious.bwv 1052",
+ 13 + 18 + 8)) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_chunk_out_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ const char *http_request;
+ ev_uint16_t port = 0;
+ struct timeval tv_start, tv_end;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ int i;
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev,
+ http_chunked_readcb, http_chunked_writecb,
+ http_chunked_errorcb, data->base);
+
+ http_request =
+ "GET /chunked HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+
+ evutil_gettimeofday(&tv_start, NULL);
+
+ event_base_dispatch(data->base);
+
+ bufferevent_free(bev);
+
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+
+ tt_int_op(tv_end.tv_sec, <, 1);
+
+ tt_int_op(test_ok, ==, 2);
+
+ /* now try again with the regular connection object */
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* make two requests to check the keepalive behavior */
+ for (i = 0; i < 2; i++) {
+ test_ok = 0;
+ req = evhttp_request_new(http_chunked_request_done,data->base);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req,
+ EVHTTP_REQ_GET, "/chunked") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_ok == 1);
+ }
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_stream_out_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_done,
+ (void *)"This is funnybut not hilarious.bwv 1052");
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/streamed")
+ == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_stream_in_chunk(struct evhttp_request *req, void *arg)
+{
+ struct evbuffer *reply = arg;
+
+ if (evhttp_request_get_response_code(req) != HTTP_OK) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ evbuffer_add_buffer(reply, evhttp_request_get_input_buffer(req));
+}
+
+static void
+http_stream_in_done(struct evhttp_request *req, void *arg)
+{
+ if (evbuffer_get_length(evhttp_request_get_input_buffer(req)) != 0) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ event_base_loopexit(exit_base, NULL);
+}
+
+/**
+ * Makes a request and reads the response in chunks.
+ */
+static void
+http_stream_in_test_(struct basic_test_data *data, char const *url,
+ size_t expected_len, char const *expected)
+{
+ struct evhttp_connection *evcon;
+ struct evbuffer *reply = evbuffer_new();
+ struct evhttp_request *req = NULL;
+ ev_uint16_t port = 0;
+
+ exit_base = data->base;
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL,"127.0.0.1", port);
+ tt_assert(evcon);
+
+ req = evhttp_request_new(http_stream_in_done, reply);
+ evhttp_request_set_chunked_cb(req, http_stream_in_chunk);
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, url) == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ if (evbuffer_get_length(reply) != expected_len) {
+ TT_DIE(("reply length %lu; expected %lu; FAILED (%s)\n",
+ (unsigned long)evbuffer_get_length(reply),
+ (unsigned long)expected_len,
+ (char*)evbuffer_pullup(reply, -1)));
+ }
+
+ if (memcmp(evbuffer_pullup(reply, -1), expected, expected_len) != 0) {
+ tt_abort_msg("Memory mismatch");
+ }
+
+ test_ok = 1;
+ end:
+ if (reply)
+ evbuffer_free(reply);
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_stream_in_test(void *arg)
+{
+ http_stream_in_test_(arg, "/chunked", 13 + 18 + 8,
+ "This is funnybut not hilarious.bwv 1052");
+
+ http_stream_in_test_(arg, "/test", strlen(BASIC_REQUEST_BODY),
+ BASIC_REQUEST_BODY);
+}
+
+static void
+http_stream_in_cancel_chunk(struct evhttp_request *req, void *arg)
+{
+ tt_int_op(evhttp_request_get_response_code(req), ==, HTTP_OK);
+
+ end:
+ evhttp_cancel_request(req);
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_stream_in_cancel_done(struct evhttp_request *req, void *arg)
+{
+ /* should never be called */
+ tt_fail_msg("In cancel done");
+}
+
+static void
+http_stream_in_cancel_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evhttp_connection *evcon;
+ struct evhttp_request *req = NULL;
+ ev_uint16_t port = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ req = evhttp_request_new(http_stream_in_cancel_done, data->base);
+ evhttp_request_set_chunked_cb(req, http_stream_in_cancel_chunk);
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/chunked") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ test_ok = 1;
+ end:
+ evhttp_connection_free(evcon);
+ evhttp_free(http);
+
+}
+
+static void
+http_connection_fail_done(struct evhttp_request *req, void *arg)
+{
+ struct evhttp_connection *evcon = arg;
+ struct event_base *base = evhttp_connection_get_base(evcon);
+
+ /* An ENETUNREACH error results in an unrecoverable
+ * evhttp_connection error (see evhttp_connection_fail_()). The
+ * connection will be reset, and the user will be notified with a NULL
+ * req parameter. */
+ tt_assert(!req);
+
+ evhttp_connection_free(evcon);
+
+ test_ok = 1;
+
+ end:
+ event_base_loopexit(base, NULL);
+}
+
+/* Test unrecoverable evhttp_connection errors by generating an ENETUNREACH
+ * error on connection. */
+static void
+http_connection_fail_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ /* auto detect a port */
+ http = http_setup(&port, data->base, 0);
+ evhttp_free(http);
+ http = NULL;
+
+ /* Pick an unroutable address. This administratively scoped multicast
+ * address should do when working with TCP. */
+ evcon = evhttp_connection_base_new(data->base, NULL, "239.10.20.30", 80);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_connection_fail_done, evcon);
+ tt_assert(req);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(test_ok, ==, 1);
+
+ end:
+ ;
+}
+
+static void
+http_connection_retry_done(struct evhttp_request *req, void *arg)
+{
+ tt_assert(req);
+ tt_int_op(evhttp_request_get_response_code(req), !=, HTTP_OK);
+ if (evhttp_find_header(evhttp_request_get_input_headers(req), "Content-Type") != NULL) {
+ tt_abort_msg("(content type)\n");
+ }
+
+ tt_uint_op(evbuffer_get_length(evhttp_request_get_input_buffer(req)), ==, 0);
+
+ test_ok = 1;
+ end:
+ event_base_loopexit(arg,NULL);
+}
+
+static struct event_base *http_make_web_server_base=NULL;
+static void
+http_make_web_server(evutil_socket_t fd, short what, void *arg)
+{
+ ev_uint16_t port = *(ev_uint16_t*)arg;
+ http = http_setup(&port, http_make_web_server_base, 0);
+}
+
+static void
+http_connection_retry_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct timeval tv, tv_start, tv_end;
+
+ exit_base = data->base;
+ test_ok = 0;
+
+ /* auto detect a port */
+ http = http_setup(&port, data->base, 0);
+ evhttp_free(http);
+ http = NULL;
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ evhttp_connection_set_timeout(evcon, 1);
+ /* also bind to local host */
+ evhttp_connection_set_local_address(evcon, "127.0.0.1");
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_connection_retry_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(data->base);
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+ tt_int_op(tv_end.tv_sec, <, 1);
+
+ tt_int_op(test_ok, ==, 1);
+
+ /*
+ * now test the same but with retries
+ */
+ test_ok = 0;
+
+ {
+ const struct timeval tv_timeout = { 0, 500000 };
+ const struct timeval tv_retry = { 0, 500000 };
+ evhttp_connection_set_timeout_tv(evcon, &tv_timeout);
+ evhttp_connection_set_initial_retry_tv(evcon, &tv_retry);
+ }
+ evhttp_connection_set_retries(evcon, 1);
+
+ req = evhttp_request_new(http_connection_retry_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(data->base);
+ evutil_gettimeofday(&tv_end, NULL);
+
+ /* fails fast, .5 sec to wait to retry, fails fast again. */
+ test_timeval_diff_leq(&tv_start, &tv_end, 500, 200);
+
+ tt_assert(test_ok == 1);
+
+ /*
+ * now test the same but with retries and give it a web server
+ * at the end
+ */
+ test_ok = 0;
+
+ evhttp_connection_set_timeout(evcon, 1);
+ evhttp_connection_set_retries(evcon, 3);
+
+ req = evhttp_request_new(http_dispatcher_test_done, data->base);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET,
+ "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ /* start up a web server .2 seconds after the connection tried
+ * to send a request
+ */
+ evutil_timerclear(&tv);
+ tv.tv_usec = 200000;
+ http_make_web_server_base = data->base;
+ event_base_once(data->base, -1, EV_TIMEOUT, http_make_web_server, &port, &tv);
+
+ evutil_gettimeofday(&tv_start, NULL);
+ event_base_dispatch(data->base);
+ evutil_gettimeofday(&tv_end, NULL);
+ /* We'll wait twice as long as we did last time. */
+ test_timeval_diff_leq(&tv_start, &tv_end, 1000, 400);
+
+ tt_int_op(test_ok, ==, 1);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_primitives(void *ptr)
+{
+ char *escaped = NULL;
+ struct evhttp *http = NULL;
+
+ escaped = evhttp_htmlescape("<script>");
+ tt_assert(escaped);
+ tt_str_op(escaped, ==, "&lt;script&gt;");
+ free(escaped);
+
+ escaped = evhttp_htmlescape("\"\'&");
+ tt_assert(escaped);
+ tt_str_op(escaped, ==, "&quot;&#039;&amp;");
+
+ http = evhttp_new(NULL);
+ tt_assert(http);
+ tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, 0);
+ tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, -1);
+ tt_int_op(evhttp_del_cb(http, "/test"), ==, 0);
+ tt_int_op(evhttp_del_cb(http, "/test"), ==, -1);
+ tt_int_op(evhttp_set_cb(http, "/test", http_basic_cb, NULL), ==, 0);
+
+ end:
+ if (escaped)
+ free(escaped);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_multi_line_header_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev= NULL;
+ evutil_socket_t fd = -1;
+ const char *http_start_request;
+ ev_uint16_t port = 0;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ tt_ptr_op(http, !=, NULL);
+
+ fd = http_connect("127.0.0.1", port);
+
+ tt_int_op(fd, !=, -1);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ tt_ptr_op(bev, !=, NULL);
+ bufferevent_setcb(bev, http_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ http_start_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: somehost\r\n"
+ "Connection: close\r\n"
+ "X-Multi-Extra-WS: libevent \r\n"
+ "\t\t\t2.1 \r\n"
+ "X-Multi: aaaaaaaa\r\n"
+ " a\r\n"
+ "\tEND\r\n"
+ "X-Last: last\r\n"
+ "\r\n";
+
+ bufferevent_write(bev, http_start_request, strlen(http_start_request));
+ found_multi = found_multi2 = 0;
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(found_multi, ==, 1);
+ tt_int_op(found_multi2, ==, 1);
+ tt_int_op(test_ok, ==, 4);
+ end:
+ if (bev)
+ bufferevent_free(bev);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+http_request_bad(struct evhttp_request *req, void *arg)
+{
+ if (req != NULL) {
+ fprintf(stderr, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_negative_content_length_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_bad, data->base);
+
+ /* Cause the response to have a negative content-length */
+ evhttp_add_header(evhttp_request_get_output_headers(req), "X-Negative", "makeitso");
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+
+static void
+http_data_length_constraints_test_done(struct evhttp_request *req, void *arg)
+{
+ tt_assert(req);
+ tt_int_op(evhttp_request_get_response_code(req), ==, HTTP_BADREQUEST);
+end:
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_large_entity_test_done(struct evhttp_request *req, void *arg)
+{
+ tt_assert(req);
+ tt_int_op(evhttp_request_get_response_code(req), ==, HTTP_ENTITYTOOLARGE);
+end:
+ event_base_loopexit(arg, NULL);
+}
+
+static void
+http_data_length_constraints_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ char long_str[8192];
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+
+ /* also bind to local host */
+ evhttp_connection_set_local_address(evcon, "127.0.0.1");
+
+ /*
+ * At this point, we want to schedule an HTTP GET request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_data_length_constraints_test_done, data->base);
+ tt_assert(req);
+
+ memset(long_str, 'a', 8192);
+ long_str[8191] = '\0';
+ /* Add the information that we care about */
+ evhttp_set_max_headers_size(http, 8191);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Longheader", long_str);
+
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/?arg=val") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ req = evhttp_request_new(http_data_length_constraints_test_done, data->base);
+ tt_assert(req);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+
+ /* GET /?arg=verylongvalue HTTP/1.1 */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, long_str) == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ evhttp_set_max_body_size(http, 8190);
+ req = evhttp_request_new(http_data_length_constraints_test_done, data->base);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), "%s", long_str);
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ req = evhttp_request_new(http_large_entity_test_done, data->base);
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Host", "somehost");
+ evhttp_add_header(evhttp_request_get_output_headers(req), "Expect", "100-continue");
+ evbuffer_add_printf(evhttp_request_get_output_buffer(req), "%s", long_str);
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+ event_base_dispatch(data->base);
+
+ test_ok = 1;
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+/*
+ * Testing client reset of server chunked connections
+ */
+
+struct terminate_state {
+ struct event_base *base;
+ struct evhttp_request *req;
+ struct bufferevent *bev;
+ evutil_socket_t fd;
+ int gotclosecb: 1;
+};
+
+static void
+terminate_chunked_trickle_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct terminate_state *state = arg;
+ struct evbuffer *evb;
+ struct timeval tv;
+
+ if (evhttp_request_get_connection(state->req) == NULL) {
+ test_ok = 1;
+ evhttp_request_free(state->req);
+ event_base_loopexit(state->base,NULL);
+ return;
+ }
+
+ evb = evbuffer_new();
+ evbuffer_add_printf(evb, "%p", evb);
+ evhttp_send_reply_chunk(state->req, evb);
+ evbuffer_free(evb);
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 3000;
+ EVUTIL_ASSERT(state);
+ EVUTIL_ASSERT(state->base);
+ event_base_once(state->base, -1, EV_TIMEOUT, terminate_chunked_trickle_cb, arg, &tv);
+}
+
+static void
+terminate_chunked_close_cb(struct evhttp_connection *evcon, void *arg)
+{
+ struct terminate_state *state = arg;
+ state->gotclosecb = 1;
+}
+
+static void
+terminate_chunked_cb(struct evhttp_request *req, void *arg)
+{
+ struct terminate_state *state = arg;
+ struct timeval tv;
+
+ /* we want to know if this connection closes on us */
+ evhttp_connection_set_closecb(
+ evhttp_request_get_connection(req),
+ terminate_chunked_close_cb, arg);
+
+ state->req = req;
+
+ evhttp_send_reply_start(req, HTTP_OK, "OK");
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 3000;
+ event_base_once(state->base, -1, EV_TIMEOUT, terminate_chunked_trickle_cb, arg, &tv);
+}
+
+static void
+terminate_chunked_client(evutil_socket_t fd, short event, void *arg)
+{
+ struct terminate_state *state = arg;
+ bufferevent_free(state->bev);
+ evutil_closesocket(state->fd);
+}
+
+static void
+terminate_readcb(struct bufferevent *bev, void *arg)
+{
+ /* just drop the data */
+ evbuffer_drain(bufferevent_get_input(bev), -1);
+}
+
+
+static void
+http_terminate_chunked_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev = NULL;
+ struct timeval tv;
+ const char *http_request;
+ ev_uint16_t port = 0;
+ evutil_socket_t fd = -1;
+ struct terminate_state terminate_state;
+
+ test_ok = 0;
+
+ http = http_setup(&port, data->base, 0);
+ evhttp_del_cb(http, "/test");
+ tt_assert(evhttp_set_cb(http, "/test",
+ terminate_chunked_cb, &terminate_state) == 0);
+
+ fd = http_connect("127.0.0.1", port);
+
+ /* Stupid thing to send a request */
+ bev = bufferevent_socket_new(data->base, fd, 0);
+ bufferevent_setcb(bev, terminate_readcb, http_writecb,
+ http_errorcb, data->base);
+
+ memset(&terminate_state, 0, sizeof(terminate_state));
+ terminate_state.base = data->base;
+ terminate_state.fd = fd;
+ terminate_state.bev = bev;
+ terminate_state.gotclosecb = 0;
+
+ /* first half of the http request */
+ http_request =
+ "GET /test HTTP/1.1\r\n"
+ "Host: some\r\n\r\n";
+
+ bufferevent_write(bev, http_request, strlen(http_request));
+ evutil_timerclear(&tv);
+ tv.tv_usec = 10000;
+ event_base_once(data->base, -1, EV_TIMEOUT, terminate_chunked_client, &terminate_state,
+ &tv);
+
+ event_base_dispatch(data->base);
+
+ if (terminate_state.gotclosecb == 0)
+ test_ok = 0;
+
+ end:
+ if (fd >= 0)
+ evutil_closesocket(fd);
+ if (http)
+ evhttp_free(http);
+}
+
+static struct regress_dns_server_table ipv6_search_table[] = {
+ { "localhost", "AAAA", "::1", 0 },
+ { NULL, NULL, NULL, 0 }
+};
+
+static void
+http_ipv6_for_domain_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct evdns_base *dns_base = NULL;
+ ev_uint16_t portnum = 0;
+ char address[64];
+
+ tt_assert(regress_dnsserver(data->base, &portnum, ipv6_search_table));
+
+ dns_base = evdns_base_new(data->base, 0/* init name servers */);
+ tt_assert(dns_base);
+
+ /* Add ourself as the only nameserver, and make sure we really are
+ * the only nameserver. */
+ evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum);
+ evdns_base_nameserver_ip_add(dns_base, address);
+
+ http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base, 1 /* ipv6 */);
+
+ end:
+ if (dns_base)
+ evdns_base_free(dns_base, 0);
+ regress_clean_dnsserver();
+}
+
+static void
+http_request_get_addr_on_close(struct evhttp_connection *evcon, void *arg)
+{
+ const struct sockaddr *storage;
+ char addrbuf[128];
+ char local[] = "127.0.0.1:";
+
+ test_ok = 0;
+ tt_assert(evcon);
+
+ storage = evhttp_connection_get_addr(evcon);
+ tt_assert(storage);
+
+ evutil_format_sockaddr_port_((struct sockaddr *)storage, addrbuf, sizeof(addrbuf));
+ tt_assert(!strncmp(addrbuf, local, sizeof(local) - 1));
+
+ test_ok = 1;
+ return;
+
+end:
+ test_ok = 0;
+}
+
+static void
+http_get_addr_test(void *arg)
+{
+ struct basic_test_data *data = arg;
+ ev_uint16_t port = 0;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ test_ok = 0;
+ exit_base = data->base;
+
+ http = http_setup(&port, data->base, 0);
+
+ evcon = evhttp_connection_base_new(data->base, NULL, "127.0.0.1", port);
+ tt_assert(evcon);
+ evhttp_connection_set_closecb(evcon, http_request_get_addr_on_close, arg);
+
+ /*
+ * At this point, we want to schedule a request to the HTTP
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(http_request_done, (void *)BASIC_REQUEST_BODY);
+
+ /* We give ownership of the request to the connection */
+ if (evhttp_make_request(evcon, req, EVHTTP_REQ_GET, "/test") == -1) {
+ tt_abort_msg("Couldn't make request");
+ }
+
+ event_base_dispatch(data->base);
+
+ http_request_get_addr_on_close(evcon, NULL);
+
+ end:
+ if (evcon)
+ evhttp_connection_free(evcon);
+ if (http)
+ evhttp_free(http);
+}
+
+#define HTTP_LEGACY(name) \
+ { #name, run_legacy_test_fn, TT_ISOLATED|TT_LEGACY, &legacy_setup, \
+ http_##name##_test }
+
+#define HTTP(name) \
+ { #name, http_##name##_test, TT_ISOLATED, &basic_setup, NULL }
+
+struct testcase_t http_testcases[] = {
+ { "primitives", http_primitives, 0, NULL, NULL },
+ { "base", http_base_test, TT_FORK, NULL, NULL },
+ { "bad_headers", http_bad_header_test, 0, NULL, NULL },
+ { "parse_query", http_parse_query_test, 0, NULL, NULL },
+ { "parse_uri", http_parse_uri_test, 0, NULL, NULL },
+ { "parse_uri_nc", http_parse_uri_test, 0, &basic_setup, (void*)"nc" },
+ { "uriencode", http_uriencode_test, 0, NULL, NULL },
+ HTTP(basic),
+ HTTP(cancel),
+ HTTP(virtual_host),
+ HTTP(post),
+ HTTP(put),
+ HTTP(delete),
+ HTTP(allowed_methods),
+ HTTP(failure),
+ HTTP(connection),
+ HTTP(persist_connection),
+ HTTP(connection_async),
+ HTTP(close_detection),
+ HTTP(close_detection_delay),
+ HTTP(bad_request),
+ HTTP(incomplete),
+ HTTP(incomplete_timeout),
+ HTTP(terminate_chunked),
+ HTTP(on_complete),
+
+ HTTP(highport),
+ HTTP(dispatcher),
+ HTTP(multi_line_header),
+ HTTP(negative_content_length),
+ HTTP(chunk_out),
+ HTTP(stream_out),
+
+ HTTP(stream_in),
+ HTTP(stream_in_cancel),
+
+ HTTP(connection_fail),
+ { "connection_retry", http_connection_retry_test, TT_ISOLATED|TT_OFF_BY_DEFAULT, &basic_setup, NULL },
+
+ HTTP(data_length_constraints),
+
+ HTTP(ipv6_for_domain),
+ HTTP(get_addr),
+
+ END_OF_TESTCASES
+};
+
diff --git a/sntp/libevent/test/regress_iocp.c b/sntp/libevent/test/regress_iocp.c
new file mode 100644
index 0000000..17b3852
--- /dev/null
+++ b/sntp/libevent/test/regress_iocp.c
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "event2/event.h"
+#include "event2/thread.h"
+#include "event2/buffer.h"
+#include "event2/buffer_compat.h"
+#include "event2/bufferevent.h"
+
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winsock2.h>
+#undef WIN32_LEAN_AND_MEAN
+
+#include "iocp-internal.h"
+#include "evbuffer-internal.h"
+#include "evthread-internal.h"
+
+/* FIXME remove these ones */
+#include <sys/queue.h>
+#include "event2/event_struct.h"
+#include "event-internal.h"
+
+#define MAX_CALLS 16
+
+static void *count_lock = NULL, *count_cond = NULL;
+static int count = 0;
+
+static void
+count_init(void)
+{
+ EVTHREAD_ALLOC_LOCK(count_lock, 0);
+ EVTHREAD_ALLOC_COND(count_cond);
+
+ tt_assert(count_lock);
+ tt_assert(count_cond);
+
+end:
+ ;
+}
+
+static void
+count_free(void)
+{
+ EVTHREAD_FREE_LOCK(count_lock, 0);
+ EVTHREAD_FREE_COND(count_cond);
+}
+
+static void
+count_incr(void)
+{
+ EVLOCK_LOCK(count_lock, 0);
+ count++;
+ EVTHREAD_COND_BROADCAST(count_cond);
+ EVLOCK_UNLOCK(count_lock, 0);
+}
+
+static int
+count_wait_for(int i, int ms)
+{
+ struct timeval tv;
+ DWORD elapsed;
+ int rv = -1;
+
+ EVLOCK_LOCK(count_lock, 0);
+ while (ms > 0 && count != i) {
+ tv.tv_sec = 0;
+ tv.tv_usec = ms * 1000;
+ elapsed = GetTickCount();
+ EVTHREAD_COND_WAIT_TIMED(count_cond, count_lock, &tv);
+ elapsed = GetTickCount() - elapsed;
+ ms -= elapsed;
+ }
+ if (count == i)
+ rv = 0;
+ EVLOCK_UNLOCK(count_lock, 0);
+
+ return rv;
+}
+
+struct dummy_overlapped {
+ struct event_overlapped eo;
+ void *lock;
+ int call_count;
+ uintptr_t keys[MAX_CALLS];
+ ev_ssize_t sizes[MAX_CALLS];
+};
+
+static void
+dummy_cb(struct event_overlapped *o, uintptr_t key, ev_ssize_t n, int ok)
+{
+ struct dummy_overlapped *d_o =
+ EVUTIL_UPCAST(o, struct dummy_overlapped, eo);
+
+ EVLOCK_LOCK(d_o->lock, 0);
+ if (d_o->call_count < MAX_CALLS) {
+ d_o->keys[d_o->call_count] = key;
+ d_o->sizes[d_o->call_count] = n;
+ }
+ d_o->call_count++;
+ EVLOCK_UNLOCK(d_o->lock, 0);
+
+ count_incr();
+}
+
+static int
+pair_is_in(struct dummy_overlapped *o, uintptr_t key, ev_ssize_t n)
+{
+ int i;
+ int result = 0;
+ EVLOCK_LOCK(o->lock, 0);
+ for (i=0; i < o->call_count; ++i) {
+ if (o->keys[i] == key && o->sizes[i] == n) {
+ result = 1;
+ break;
+ }
+ }
+ EVLOCK_UNLOCK(o->lock, 0);
+ return result;
+}
+
+static void
+test_iocp_port(void *ptr)
+{
+ struct event_iocp_port *port = NULL;
+ struct dummy_overlapped o1, o2;
+
+ memset(&o1, 0, sizeof(o1));
+ memset(&o2, 0, sizeof(o2));
+
+ count_init();
+ EVTHREAD_ALLOC_LOCK(o1.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVTHREAD_ALLOC_LOCK(o2.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+
+ tt_assert(o1.lock);
+ tt_assert(o2.lock);
+
+ event_overlapped_init_(&o1.eo, dummy_cb);
+ event_overlapped_init_(&o2.eo, dummy_cb);
+
+ port = event_iocp_port_launch_(0);
+ tt_assert(port);
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 10, 100));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 20, 200));
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 11, 101));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 21, 201));
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 12, 102));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 22, 202));
+
+ tt_assert(!event_iocp_activate_overlapped_(port, &o1.eo, 13, 103));
+ tt_assert(!event_iocp_activate_overlapped_(port, &o2.eo, 23, 203));
+
+ tt_int_op(count_wait_for(8, 2000), ==, 0);
+
+ tt_want(!event_iocp_shutdown_(port, 2000));
+
+ tt_int_op(o1.call_count, ==, 4);
+ tt_int_op(o2.call_count, ==, 4);
+
+ tt_want(pair_is_in(&o1, 10, 100));
+ tt_want(pair_is_in(&o1, 11, 101));
+ tt_want(pair_is_in(&o1, 12, 102));
+ tt_want(pair_is_in(&o1, 13, 103));
+
+ tt_want(pair_is_in(&o2, 20, 200));
+ tt_want(pair_is_in(&o2, 21, 201));
+ tt_want(pair_is_in(&o2, 22, 202));
+ tt_want(pair_is_in(&o2, 23, 203));
+
+end:
+ EVTHREAD_FREE_LOCK(o1.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVTHREAD_FREE_LOCK(o2.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ count_free();
+}
+
+static struct evbuffer *rbuf = NULL, *wbuf = NULL;
+
+static void
+read_complete(struct event_overlapped *eo, uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ tt_assert(ok);
+ evbuffer_commit_read_(rbuf, nbytes);
+ count_incr();
+end:
+ ;
+}
+
+static void
+write_complete(struct event_overlapped *eo, uintptr_t key,
+ ev_ssize_t nbytes, int ok)
+{
+ tt_assert(ok);
+ evbuffer_commit_write_(wbuf, nbytes);
+ count_incr();
+end:
+ ;
+}
+
+static void
+test_iocp_evbuffer(void *ptr)
+{
+ struct event_overlapped rol, wol;
+ struct basic_test_data *data = ptr;
+ struct event_iocp_port *port = NULL;
+ struct evbuffer *buf=NULL;
+ struct evbuffer_chain *chain;
+ char junk[1024];
+ int i;
+
+ count_init();
+ event_overlapped_init_(&rol, read_complete);
+ event_overlapped_init_(&wol, write_complete);
+
+ for (i = 0; i < (int)sizeof(junk); ++i)
+ junk[i] = (char)(i);
+
+ rbuf = evbuffer_overlapped_new_(data->pair[0]);
+ wbuf = evbuffer_overlapped_new_(data->pair[1]);
+ evbuffer_enable_locking(rbuf, NULL);
+ evbuffer_enable_locking(wbuf, NULL);
+
+ port = event_iocp_port_launch_(0);
+ tt_assert(port);
+ tt_assert(rbuf);
+ tt_assert(wbuf);
+
+ tt_assert(!event_iocp_port_associate_(port, data->pair[0], 100));
+ tt_assert(!event_iocp_port_associate_(port, data->pair[1], 100));
+
+ for (i=0;i<10;++i)
+ evbuffer_add(wbuf, junk, sizeof(junk));
+
+ buf = evbuffer_new();
+ tt_assert(buf != NULL);
+ evbuffer_add(rbuf, junk, sizeof(junk));
+ tt_assert(!evbuffer_launch_read_(rbuf, 2048, &rol));
+ evbuffer_add_buffer(buf, rbuf);
+ tt_int_op(evbuffer_get_length(buf), ==, sizeof(junk));
+ for (chain = buf->first; chain; chain = chain->next)
+ tt_int_op(chain->flags & EVBUFFER_MEM_PINNED_ANY, ==, 0);
+ tt_assert(!evbuffer_get_length(rbuf));
+ tt_assert(!evbuffer_launch_write_(wbuf, 512, &wol));
+
+ tt_int_op(count_wait_for(2, 2000), ==, 0);
+
+ tt_int_op(evbuffer_get_length(rbuf),==,512);
+
+ /* FIXME Actually test some stuff here. */
+
+ tt_want(!event_iocp_shutdown_(port, 2000));
+end:
+ count_free();
+ evbuffer_free(rbuf);
+ evbuffer_free(wbuf);
+ if (buf) evbuffer_free(buf);
+}
+
+static int got_readcb = 0;
+
+static void
+async_readcb(struct bufferevent *bev, void *arg)
+{
+ /* Disabling read should cause the loop to quit */
+ bufferevent_disable(bev, EV_READ);
+ got_readcb++;
+}
+
+static void
+test_iocp_bufferevent_async(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ struct event_iocp_port *port = NULL;
+ struct bufferevent *bea1=NULL, *bea2=NULL;
+ char buf[128];
+ size_t n;
+
+ event_base_start_iocp_(data->base, 0);
+ port = event_base_get_iocp_(data->base);
+ tt_assert(port);
+
+ bea1 = bufferevent_async_new_(data->base, data->pair[0],
+ BEV_OPT_DEFER_CALLBACKS);
+ bea2 = bufferevent_async_new_(data->base, data->pair[1],
+ BEV_OPT_DEFER_CALLBACKS);
+ tt_assert(bea1);
+ tt_assert(bea2);
+
+ bufferevent_setcb(bea2, async_readcb, NULL, NULL, NULL);
+ bufferevent_enable(bea1, EV_WRITE);
+ bufferevent_enable(bea2, EV_READ);
+
+ bufferevent_write(bea1, "Hello world", strlen("Hello world")+1);
+
+ event_base_dispatch(data->base);
+
+ tt_int_op(got_readcb, ==, 1);
+ n = bufferevent_read(bea2, buf, sizeof(buf)-1);
+ buf[n]='\0';
+ tt_str_op(buf, ==, "Hello world");
+
+end:
+ bufferevent_free(bea1);
+ bufferevent_free(bea2);
+}
+
+
+struct testcase_t iocp_testcases[] = {
+ { "port", test_iocp_port, TT_FORK|TT_NEED_THREADS, &basic_setup, NULL },
+ { "evbuffer", test_iocp_evbuffer,
+ TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_THREADS,
+ &basic_setup, NULL },
+ { "bufferevent_async", test_iocp_bufferevent_async,
+ TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_THREADS|TT_NEED_BASE,
+ &basic_setup, NULL },
+ END_OF_TESTCASES
+};
diff --git a/sntp/libevent/test/regress_listener.c b/sntp/libevent/test/regress_listener.c
new file mode 100644
index 0000000..4db102d
--- /dev/null
+++ b/sntp/libevent/test/regress_listener.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include <sys/types.h>
+
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#include <unistd.h>
+#endif
+
+#include <string.h>
+
+#include "event2/listener.h"
+#include "event2/event.h"
+#include "event2/util.h"
+
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+static void
+acceptcb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *addr, int socklen, void *arg)
+{
+ int *ptr = arg;
+ --*ptr;
+ TT_BLATHER(("Got one for %p", ptr));
+ evutil_closesocket(fd);
+
+ if (! *ptr)
+ evconnlistener_disable(listener);
+}
+
+static void
+regress_pick_a_port(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evconnlistener *listener1 = NULL, *listener2 = NULL;
+ struct sockaddr_in sin;
+ int count1 = 2, count2 = 1;
+ struct sockaddr_storage ss1, ss2;
+ struct sockaddr_in *sin1, *sin2;
+ ev_socklen_t slen1 = sizeof(ss1), slen2 = sizeof(ss2);
+ unsigned int flags =
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_EXEC;
+
+ evutil_socket_t fd1 = -1, fd2 = -1, fd3 = -1;
+
+ if (data->setup_data && strstr((char*)data->setup_data, "ts")) {
+ flags |= LEV_OPT_THREADSAFE;
+ }
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+ sin.sin_port = 0; /* "You pick!" */
+
+ listener1 = evconnlistener_new_bind(base, acceptcb, &count1,
+ flags, -1, (struct sockaddr *)&sin, sizeof(sin));
+ tt_assert(listener1);
+ listener2 = evconnlistener_new_bind(base, acceptcb, &count2,
+ flags, -1, (struct sockaddr *)&sin, sizeof(sin));
+ tt_assert(listener2);
+
+ tt_int_op(evconnlistener_get_fd(listener1), >=, 0);
+ tt_int_op(evconnlistener_get_fd(listener2), >=, 0);
+ tt_assert(getsockname(evconnlistener_get_fd(listener1),
+ (struct sockaddr*)&ss1, &slen1) == 0);
+ tt_assert(getsockname(evconnlistener_get_fd(listener2),
+ (struct sockaddr*)&ss2, &slen2) == 0);
+ tt_int_op(ss1.ss_family, ==, AF_INET);
+ tt_int_op(ss2.ss_family, ==, AF_INET);
+
+ sin1 = (struct sockaddr_in*)&ss1;
+ sin2 = (struct sockaddr_in*)&ss2;
+ tt_int_op(ntohl(sin1->sin_addr.s_addr), ==, 0x7f000001);
+ tt_int_op(ntohl(sin2->sin_addr.s_addr), ==, 0x7f000001);
+ tt_int_op(sin1->sin_port, !=, sin2->sin_port);
+
+ tt_ptr_op(evconnlistener_get_base(listener1), ==, base);
+ tt_ptr_op(evconnlistener_get_base(listener2), ==, base);
+
+ fd1 = fd2 = fd3 = -1;
+ evutil_socket_connect_(&fd1, (struct sockaddr*)&ss1, slen1);
+ evutil_socket_connect_(&fd2, (struct sockaddr*)&ss1, slen1);
+ evutil_socket_connect_(&fd3, (struct sockaddr*)&ss2, slen2);
+
+#ifdef _WIN32
+ Sleep(100); /* XXXX this is a stupid stopgap. */
+#endif
+ event_base_dispatch(base);
+
+ tt_int_op(count1, ==, 0);
+ tt_int_op(count2, ==, 0);
+
+end:
+ if (fd1>=0)
+ EVUTIL_CLOSESOCKET(fd1);
+ if (fd2>=0)
+ EVUTIL_CLOSESOCKET(fd2);
+ if (fd3>=0)
+ EVUTIL_CLOSESOCKET(fd3);
+ if (listener1)
+ evconnlistener_free(listener1);
+ if (listener2)
+ evconnlistener_free(listener2);
+}
+
+static void
+errorcb(struct evconnlistener *lis, void *data_)
+{
+ int *data = data_;
+ *data = 1000;
+ evconnlistener_disable(lis);
+}
+
+static void
+regress_listener_error(void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ struct evconnlistener *listener = NULL;
+ int count = 1;
+ unsigned int flags = LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE;
+
+ if (data->setup_data && strstr((char*)data->setup_data, "ts")) {
+ flags |= LEV_OPT_THREADSAFE;
+ }
+
+ /* send, so that pair[0] will look 'readable'*/
+ tt_int_op(send(data->pair[1], "hello", 5, 0), >, 0);
+
+ /* Start a listener with a bogus socket. */
+ listener = evconnlistener_new(base, acceptcb, &count,
+ flags, 0,
+ data->pair[0]);
+ tt_assert(listener);
+
+ evconnlistener_set_error_cb(listener, errorcb);
+
+ tt_assert(listener);
+
+ event_base_dispatch(base);
+ tt_int_op(count,==,1000); /* set by error cb */
+
+end:
+ if (listener)
+ evconnlistener_free(listener);
+}
+
+struct testcase_t listener_testcases[] = {
+
+ { "randport", regress_pick_a_port, TT_FORK|TT_NEED_BASE,
+ &basic_setup, NULL},
+
+ { "randport_ts", regress_pick_a_port, TT_FORK|TT_NEED_BASE,
+ &basic_setup, (char*)"ts"},
+
+ { "error", regress_listener_error,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR,
+ &basic_setup, NULL},
+
+ { "error_ts", regress_listener_error,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR,
+ &basic_setup, (char*)"ts"},
+
+ END_OF_TESTCASES,
+};
+
+struct testcase_t listener_iocp_testcases[] = {
+ { "randport", regress_pick_a_port,
+ TT_FORK|TT_NEED_BASE|TT_ENABLE_IOCP,
+ &basic_setup, NULL},
+
+ { "error", regress_listener_error,
+ TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR|TT_ENABLE_IOCP,
+ &basic_setup, NULL},
+
+ END_OF_TESTCASES,
+};
diff --git a/sntp/libevent/test/regress_main.c b/sntp/libevent/test/regress_main.c
new file mode 100644
index 0000000..58cbe5f
--- /dev/null
+++ b/sntp/libevent/test/regress_main.c
@@ -0,0 +1,462 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <io.h>
+#include <fcntl.h>
+#endif
+
+#if defined(__APPLE__) && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+#define FORK_BREAKS_GCOV
+#include <vproc.h>
+#endif
+#endif
+
+#include "event2/event-config.h"
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+#if 0
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#include <signal.h>
+#include <errno.h>
+#endif
+
+#include <sys/types.h>
+#ifdef EVENT__HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/dns.h"
+#include "event2/dns_compat.h"
+#include "event2/thread.h"
+
+#include "event2/event-config.h"
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+#include "../iocp-internal.h"
+#include "../event-internal.h"
+
+long
+timeval_msec_diff(const struct timeval *start, const struct timeval *end)
+{
+ long ms = end->tv_sec - start->tv_sec;
+ ms *= 1000;
+ ms += ((end->tv_usec - start->tv_usec)+500) / 1000;
+ return ms;
+}
+
+/* ============================================================ */
+/* Code to wrap up old legacy test cases that used setup() and cleanup().
+ *
+ * Not all of the tests designated "legacy" are ones that used setup() and
+ * cleanup(), of course. A test is legacy it it uses setup()/cleanup(), OR
+ * if it wants to find its event base/socketpair in global variables (ugh),
+ * OR if it wants to communicate success/failure through test_ok.
+ */
+
+/* This is set to true if we're inside a legacy test wrapper. It lets the
+ setup() and cleanup() functions in regress.c know they're not needed.
+ */
+int in_legacy_test_wrapper = 0;
+
+static void dnslogcb(int w, const char *m)
+{
+ TT_BLATHER(("%s", m));
+}
+
+/* creates a temporary file with the data in it. If *filename_out gets set,
+ * the caller should try to unlink it. */
+int
+regress_make_tmpfile(const void *data, size_t datalen, char **filename_out)
+{
+#ifndef _WIN32
+ char tmpfilename[32];
+ int fd;
+ *filename_out = NULL;
+ strcpy(tmpfilename, "/tmp/eventtmp.XXXXXX");
+#ifdef EVENT__HAVE_UMASK
+ umask(0077);
+#endif
+ fd = mkstemp(tmpfilename);
+ if (fd == -1)
+ return (-1);
+ if (write(fd, data, datalen) != (int)datalen) {
+ close(fd);
+ return (-1);
+ }
+ lseek(fd, 0, SEEK_SET);
+ /* remove it from the file system */
+ unlink(tmpfilename);
+ return (fd);
+#else
+ /* XXXX actually delete the file later */
+ char tmpfilepath[MAX_PATH];
+ char tmpfilename[MAX_PATH];
+ DWORD r, written;
+ int tries = 16;
+ HANDLE h;
+ r = GetTempPathA(MAX_PATH, tmpfilepath);
+ if (r > MAX_PATH || r == 0)
+ return (-1);
+ for (; tries > 0; --tries) {
+ r = GetTempFileNameA(tmpfilepath, "LIBEVENT", 0, tmpfilename);
+ if (r == 0)
+ return (-1);
+ h = CreateFileA(tmpfilename, GENERIC_READ|GENERIC_WRITE,
+ 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h != INVALID_HANDLE_VALUE)
+ break;
+ }
+ if (tries == 0)
+ return (-1);
+ written = 0;
+ *filename_out = strdup(tmpfilename);
+ WriteFile(h, data, (DWORD)datalen, &written, NULL);
+ /* Closing the fd returned by this function will indeed close h. */
+ return _open_osfhandle((intptr_t)h,_O_RDONLY);
+#endif
+}
+
+#ifndef _WIN32
+pid_t
+regress_fork(void)
+{
+ pid_t pid = fork();
+#ifdef FORK_BREAKS_GCOV
+ vproc_transaction_begin(0);
+#endif
+ return pid;
+}
+#endif
+
+static void
+ignore_log_cb(int s, const char *msg)
+{
+}
+
+static void *
+basic_test_setup(const struct testcase_t *testcase)
+{
+ struct event_base *base = NULL;
+ evutil_socket_t spair[2] = { -1, -1 };
+ struct basic_test_data *data = NULL;
+
+#ifndef _WIN32
+ if (testcase->flags & TT_ENABLE_IOCP_FLAG)
+ return (void*)TT_SKIP;
+#endif
+
+ if (testcase->flags & TT_NEED_THREADS) {
+ if (!(testcase->flags & TT_FORK))
+ return NULL;
+#if defined(EVTHREAD_USE_PTHREADS_IMPLEMENTED)
+ if (evthread_use_pthreads())
+ exit(1);
+#elif defined(EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED)
+ if (evthread_use_windows_threads())
+ exit(1);
+#else
+ return (void*)TT_SKIP;
+#endif
+ }
+
+ if (testcase->flags & TT_NEED_SOCKETPAIR) {
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, spair) == -1) {
+ fprintf(stderr, "%s: socketpair\n", __func__);
+ exit(1);
+ }
+
+ if (evutil_make_socket_nonblocking(spair[0]) == -1) {
+ fprintf(stderr, "fcntl(O_NONBLOCK)");
+ exit(1);
+ }
+
+ if (evutil_make_socket_nonblocking(spair[1]) == -1) {
+ fprintf(stderr, "fcntl(O_NONBLOCK)");
+ exit(1);
+ }
+ }
+ if (testcase->flags & TT_NEED_BASE) {
+ if (testcase->flags & TT_LEGACY)
+ base = event_init();
+ else
+ base = event_base_new();
+ if (!base)
+ exit(1);
+ }
+ if (testcase->flags & TT_ENABLE_IOCP_FLAG) {
+ if (event_base_start_iocp_(base, 0)<0) {
+ event_base_free(base);
+ return (void*)TT_SKIP;
+ }
+ }
+
+ if (testcase->flags & TT_NEED_DNS) {
+ evdns_set_log_fn(dnslogcb);
+ if (evdns_init())
+ return NULL; /* fast failure */ /*XXX asserts. */
+ }
+
+ if (testcase->flags & TT_NO_LOGS)
+ event_set_log_callback(ignore_log_cb);
+
+ data = calloc(1, sizeof(*data));
+ if (!data)
+ exit(1);
+ data->base = base;
+ data->pair[0] = spair[0];
+ data->pair[1] = spair[1];
+ data->setup_data = testcase->setup_data;
+ return data;
+}
+
+static int
+basic_test_cleanup(const struct testcase_t *testcase, void *ptr)
+{
+ struct basic_test_data *data = ptr;
+
+ if (testcase->flags & TT_NO_LOGS)
+ event_set_log_callback(NULL);
+
+ if (testcase->flags & TT_NEED_SOCKETPAIR) {
+ if (data->pair[0] != -1)
+ evutil_closesocket(data->pair[0]);
+ if (data->pair[1] != -1)
+ evutil_closesocket(data->pair[1]);
+ }
+
+ if (testcase->flags & TT_NEED_DNS) {
+ evdns_shutdown(0);
+ }
+
+ if (testcase->flags & TT_NEED_BASE) {
+ if (data->base) {
+ event_base_assert_ok_(data->base);
+ event_base_free(data->base);
+ }
+ }
+
+ if (testcase->flags & TT_FORK)
+ libevent_global_shutdown();
+
+ free(data);
+
+ return 1;
+}
+
+const struct testcase_setup_t basic_setup = {
+ basic_test_setup, basic_test_cleanup
+};
+
+/* The "data" for a legacy test is just a pointer to the void fn(void)
+ function implementing the test case. We need to set up some globals,
+ though, since that's where legacy tests expect to find a socketpair
+ (sometimes) and a global event_base (sometimes).
+ */
+static void *
+legacy_test_setup(const struct testcase_t *testcase)
+{
+ struct basic_test_data *data = basic_test_setup(testcase);
+ if (data == (void*)TT_SKIP || data == NULL)
+ return data;
+ global_base = data->base;
+ pair[0] = data->pair[0];
+ pair[1] = data->pair[1];
+ data->legacy_test_fn = testcase->setup_data;
+ return data;
+}
+
+/* This function is the implementation of every legacy test case. It
+ sets test_ok to 0, invokes the test function, and tells tinytest that
+ the test failed if the test didn't set test_ok to 1.
+ */
+void
+run_legacy_test_fn(void *ptr)
+{
+ struct basic_test_data *data = ptr;
+ test_ok = called = 0;
+
+ in_legacy_test_wrapper = 1;
+ data->legacy_test_fn(); /* This part actually calls the test */
+ in_legacy_test_wrapper = 0;
+
+ if (!test_ok)
+ tt_abort_msg("Legacy unit test failed");
+
+end:
+ test_ok = 0;
+}
+
+/* This function doesn't have to clean up ptr (which is just a pointer
+ to the test function), but it may need to close the socketpair or
+ free the event_base.
+ */
+static int
+legacy_test_cleanup(const struct testcase_t *testcase, void *ptr)
+{
+ int r = basic_test_cleanup(testcase, ptr);
+ pair[0] = pair[1] = -1;
+ global_base = NULL;
+ return r;
+}
+
+const struct testcase_setup_t legacy_setup = {
+ legacy_test_setup, legacy_test_cleanup
+};
+
+/* ============================================================ */
+
+#if (!defined(EVENT__HAVE_PTHREADS) && !defined(_WIN32)) || defined(EVENT__DISABLE_THREAD_SUPPORT)
+struct testcase_t thread_testcases[] = {
+ { "basic", NULL, TT_SKIP, NULL, NULL },
+ END_OF_TESTCASES
+};
+#endif
+
+struct testgroup_t testgroups[] = {
+ { "main/", main_testcases },
+ { "heap/", minheap_testcases },
+ { "et/", edgetriggered_testcases },
+ { "finalize/", finalize_testcases },
+ { "evbuffer/", evbuffer_testcases },
+ { "signal/", signal_testcases },
+ { "util/", util_testcases },
+ { "bufferevent/", bufferevent_testcases },
+ { "http/", http_testcases },
+ { "dns/", dns_testcases },
+ { "evtag/", evtag_testcases },
+ { "rpc/", rpc_testcases },
+ { "thread/", thread_testcases },
+ { "listener/", listener_testcases },
+#ifdef _WIN32
+ { "iocp/", iocp_testcases },
+ { "iocp/bufferevent/", bufferevent_iocp_testcases },
+ { "iocp/listener/", listener_iocp_testcases },
+#endif
+#ifdef EVENT__HAVE_OPENSSL
+ { "ssl/", ssl_testcases },
+#endif
+ END_OF_GROUPS
+};
+
+const char *alltests[] = { "+..", NULL };
+const char *livenettests[] = {
+ "+util/getaddrinfo_live",
+ "+dns/gethostby..",
+ "+dns/resolve_reverse",
+ NULL
+};
+const char *finetimetests[] = {
+ "+util/monotonic_res_precise",
+ "+util/monotonic_res_fallback",
+ "+thread/deferred_cb_skew",
+ "+http/connection_retry",
+ NULL
+};
+struct testlist_alias_t testaliases[] = {
+ { "all", alltests },
+ { "live_net", livenettests },
+ { "fine_timing", finetimetests },
+ END_OF_ALIASES
+};
+
+int libevent_tests_running_in_debug_mode = 0;
+
+int
+main(int argc, const char **argv)
+{
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+#ifndef _WIN32
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return 1;
+#endif
+
+#ifdef _WIN32
+ tinytest_skip(testgroups, "http/connection_retry");
+#endif
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ if (!getenv("EVENT_NO_DEBUG_LOCKS"))
+ evthread_enable_lock_debugging();
+#endif
+
+ if (getenv("EVENT_DEBUG_MODE")) {
+ event_enable_debug_mode();
+ libevent_tests_running_in_debug_mode = 1;
+ }
+ if (getenv("EVENT_DEBUG_LOGGING_ALL")) {
+ event_enable_debug_logging(EVENT_DBG_ALL);
+ }
+
+ tinytest_set_aliases(testaliases);
+
+ if (tinytest_main(argc,argv,testgroups))
+ return 1;
+
+ libevent_global_shutdown();
+
+ return 0;
+}
+
diff --git a/sntp/libevent/test/regress_minheap.c b/sntp/libevent/test/regress_minheap.c
new file mode 100644
index 0000000..a1f554e
--- /dev/null
+++ b/sntp/libevent/test/regress_minheap.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "../minheap-internal.h"
+
+#include <stdlib.h>
+#include "event2/event_struct.h"
+
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+static void
+set_random_timeout(struct event *ev)
+{
+ ev->ev_timeout.tv_sec = rand();
+ ev->ev_timeout.tv_usec = rand() & 0xfffff;
+ ev->ev_timeout_pos.min_heap_idx = -1;
+}
+
+static void
+check_heap(struct min_heap *heap)
+{
+ unsigned i;
+ for (i = 1; i < heap->n; ++i) {
+ unsigned parent_idx = (i-1)/2;
+ tt_want(evutil_timercmp(&heap->p[i]->ev_timeout,
+ &heap->p[parent_idx]->ev_timeout, >=));
+ }
+}
+
+static void
+test_heap_randomized(void *ptr)
+{
+ struct min_heap heap;
+ struct event *inserted[1024];
+ struct event *e, *last_e;
+ int i;
+
+ min_heap_ctor_(&heap);
+
+ for (i = 0; i < 1024; ++i) {
+ inserted[i] = malloc(sizeof(struct event));
+ set_random_timeout(inserted[i]);
+ min_heap_push_(&heap, inserted[i]);
+ }
+ check_heap(&heap);
+
+ tt_assert(min_heap_size_(&heap) == 1024);
+
+ for (i = 0; i < 512; ++i) {
+ min_heap_erase_(&heap, inserted[i]);
+ if (0 == (i % 32))
+ check_heap(&heap);
+ }
+ tt_assert(min_heap_size_(&heap) == 512);
+
+ last_e = min_heap_pop_(&heap);
+ while (1) {
+ e = min_heap_pop_(&heap);
+ if (!e)
+ break;
+ tt_want(evutil_timercmp(&last_e->ev_timeout,
+ &e->ev_timeout, <=));
+ }
+ tt_assert(min_heap_size_(&heap) == 0);
+end:
+ for (i = 0; i < 1024; ++i)
+ free(inserted[i]);
+
+ min_heap_dtor_(&heap);
+}
+
+struct testcase_t minheap_testcases[] = {
+ { "randomized", test_heap_randomized, 0, NULL, NULL },
+ END_OF_TESTCASES
+};
diff --git a/sntp/libevent/test/regress_rpc.c b/sntp/libevent/test/regress_rpc.c
new file mode 100644
index 0000000..01a058c
--- /dev/null
+++ b/sntp/libevent/test/regress_rpc.c
@@ -0,0 +1,905 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#include "event2/buffer.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/http.h"
+#include "event2/http_compat.h"
+#include "event2/http_struct.h"
+#include "event2/rpc.h"
+#include "event2/rpc.h"
+#include "event2/rpc_struct.h"
+#include "event2/tag.h"
+#include "log-internal.h"
+
+#include "regress.gen.h"
+
+#include "regress.h"
+#include "regress_testutils.h"
+
+#ifndef NO_PYTHON_EXISTS
+
+static struct evhttp *
+http_setup(ev_uint16_t *pport)
+{
+ struct evhttp *myhttp;
+ ev_uint16_t port;
+ struct evhttp_bound_socket *sock;
+
+ myhttp = evhttp_new(NULL);
+ if (!myhttp)
+ event_errx(1, "Could not start web server");
+
+ /* Try a few different ports */
+ sock = evhttp_bind_socket_with_handle(myhttp, "127.0.0.1", 0);
+ if (!sock)
+ event_errx(1, "Couldn't open web port");
+
+ port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock));
+
+ *pport = port;
+ return (myhttp);
+}
+
+EVRPC_HEADER(Message, msg, kill)
+EVRPC_HEADER(NeverReply, msg, kill)
+
+EVRPC_GENERATE(Message, msg, kill)
+EVRPC_GENERATE(NeverReply, msg, kill)
+
+static int need_input_hook = 0;
+static int need_output_hook = 0;
+
+static void
+MessageCb(EVRPC_STRUCT(Message)* rpc, void *arg)
+{
+ struct kill* kill_reply = rpc->reply;
+
+ if (need_input_hook) {
+ struct evhttp_request* req = EVRPC_REQUEST_HTTP(rpc);
+ const char *header = evhttp_find_header(
+ req->input_headers, "X-Hook");
+ assert(header);
+ assert(strcmp(header, "input") == 0);
+ }
+
+ /* we just want to fill in some non-sense */
+ EVTAG_ASSIGN(kill_reply, weapon, "dagger");
+ EVTAG_ASSIGN(kill_reply, action, "wave around like an idiot");
+
+ /* no reply to the RPC */
+ EVRPC_REQUEST_DONE(rpc);
+}
+
+static EVRPC_STRUCT(NeverReply) *saved_rpc;
+
+static void
+NeverReplyCb(EVRPC_STRUCT(NeverReply)* rpc, void *arg)
+{
+ test_ok += 1;
+ saved_rpc = rpc;
+}
+
+static void
+rpc_setup(struct evhttp **phttp, ev_uint16_t *pport, struct evrpc_base **pbase)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+
+ http = http_setup(&port);
+ base = evrpc_init(http);
+
+ EVRPC_REGISTER(base, Message, msg, kill, MessageCb, NULL);
+ EVRPC_REGISTER(base, NeverReply, msg, kill, NeverReplyCb, NULL);
+
+ *phttp = http;
+ *pport = port;
+ *pbase = base;
+
+ need_input_hook = 0;
+ need_output_hook = 0;
+}
+
+static void
+rpc_teardown(struct evrpc_base *base)
+{
+ assert(EVRPC_UNREGISTER(base, Message) == 0);
+ assert(EVRPC_UNREGISTER(base, NeverReply) == 0);
+
+ evrpc_free(base);
+}
+
+static void
+rpc_postrequest_failure(struct evhttp_request *req, void *arg)
+{
+ if (req->response_code != HTTP_SERVUNAVAIL) {
+
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ test_ok = 1;
+ event_loopexit(NULL);
+}
+
+/*
+ * Test a malformed payload submitted as an RPC
+ */
+
+static void
+rpc_basic_test(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ evcon = evhttp_connection_new("127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP POST request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(rpc_postrequest_failure, NULL);
+ tt_assert(req);
+
+ /* Add the information that we care about */
+ evhttp_add_header(req->output_headers, "Host", "somehost");
+ evbuffer_add_printf(req->output_buffer, "Some Nonsense");
+
+ if (evhttp_make_request(evcon, req,
+ EVHTTP_REQ_POST,
+ "/.rpc.Message") == -1) {
+ tt_abort();
+ }
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ evhttp_connection_free(evcon);
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 1);
+
+end:
+ evhttp_free(http);
+}
+
+static void
+rpc_postrequest_done(struct evhttp_request *req, void *arg)
+{
+ struct kill* kill_reply = NULL;
+
+ if (req->response_code != HTTP_OK) {
+ fprintf(stderr, "FAILED (response code)\n");
+ exit(1);
+ }
+
+ kill_reply = kill_new();
+
+ if ((kill_unmarshal(kill_reply, req->input_buffer)) == -1) {
+ fprintf(stderr, "FAILED (unmarshal)\n");
+ exit(1);
+ }
+
+ kill_free(kill_reply);
+
+ test_ok = 1;
+ event_loopexit(NULL);
+}
+
+static void
+rpc_basic_message(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evhttp_connection *evcon = NULL;
+ struct evhttp_request *req = NULL;
+ struct msg *msg;
+
+ rpc_setup(&http, &port, &base);
+
+ evcon = evhttp_connection_new("127.0.0.1", port);
+ tt_assert(evcon);
+
+ /*
+ * At this point, we want to schedule an HTTP POST request
+ * server using our make request method.
+ */
+
+ req = evhttp_request_new(rpc_postrequest_done, NULL);
+ if (req == NULL) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ /* Add the information that we care about */
+ evhttp_add_header(req->output_headers, "Host", "somehost");
+
+ /* set up the basic message */
+ msg = msg_new();
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+ msg_marshal(req->output_buffer, msg);
+ msg_free(msg);
+
+ if (evhttp_make_request(evcon, req,
+ EVHTTP_REQ_POST,
+ "/.rpc.Message") == -1) {
+ fprintf(stdout, "FAILED\n");
+ exit(1);
+ }
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ evhttp_connection_free(evcon);
+
+ rpc_teardown(base);
+
+end:
+ evhttp_free(http);
+}
+
+static struct evrpc_pool *
+rpc_pool_with_connection(ev_uint16_t port)
+{
+ struct evhttp_connection *evcon;
+ struct evrpc_pool *pool;
+
+ pool = evrpc_pool_new(NULL);
+ assert(pool != NULL);
+
+ evcon = evhttp_connection_new("127.0.0.1", port);
+ assert(evcon != NULL);
+
+ evrpc_pool_add_connection(pool, evcon);
+
+ return (pool);
+}
+
+static void
+GotKillCb(struct evrpc_status *status,
+ struct msg *msg, struct kill *kill, void *arg)
+{
+ char *weapon;
+ char *action;
+
+ if (need_output_hook) {
+ struct evhttp_request *req = status->http_req;
+ const char *header = evhttp_find_header(
+ req->input_headers, "X-Pool-Hook");
+ assert(header);
+ assert(strcmp(header, "ran") == 0);
+ }
+
+ if (status->error != EVRPC_STATUS_ERR_NONE)
+ goto done;
+
+ if (EVTAG_GET(kill, weapon, &weapon) == -1) {
+ fprintf(stderr, "get weapon\n");
+ goto done;
+ }
+ if (EVTAG_GET(kill, action, &action) == -1) {
+ fprintf(stderr, "get action\n");
+ goto done;
+ }
+
+ if (strcmp(weapon, "dagger"))
+ goto done;
+
+ if (strcmp(action, "wave around like an idiot"))
+ goto done;
+
+ test_ok += 1;
+
+done:
+ event_loopexit(NULL);
+}
+
+static void
+GotKillCbTwo(struct evrpc_status *status,
+ struct msg *msg, struct kill *kill, void *arg)
+{
+ char *weapon;
+ char *action;
+
+ if (status->error != EVRPC_STATUS_ERR_NONE)
+ goto done;
+
+ if (EVTAG_GET(kill, weapon, &weapon) == -1) {
+ fprintf(stderr, "get weapon\n");
+ goto done;
+ }
+ if (EVTAG_GET(kill, action, &action) == -1) {
+ fprintf(stderr, "get action\n");
+ goto done;
+ }
+
+ if (strcmp(weapon, "dagger"))
+ goto done;
+
+ if (strcmp(action, "wave around like an idiot"))
+ goto done;
+
+ test_ok += 1;
+
+done:
+ if (test_ok == 2)
+ event_loopexit(NULL);
+}
+
+static int
+rpc_hook_add_header(void *ctx, struct evhttp_request *req,
+ struct evbuffer *evbuf, void *arg)
+{
+ const char *hook_type = arg;
+ if (strcmp("input", hook_type) == 0)
+ evhttp_add_header(req->input_headers, "X-Hook", hook_type);
+ else
+ evhttp_add_header(req->output_headers, "X-Hook", hook_type);
+
+ assert(evrpc_hook_get_connection(ctx) != NULL);
+
+ return (EVRPC_CONTINUE);
+}
+
+static int
+rpc_hook_add_meta(void *ctx, struct evhttp_request *req,
+ struct evbuffer *evbuf, void *arg)
+{
+ evrpc_hook_add_meta(ctx, "meta", "test", 5);
+
+ assert(evrpc_hook_get_connection(ctx) != NULL);
+
+ return (EVRPC_CONTINUE);
+}
+
+static int
+rpc_hook_remove_header(void *ctx, struct evhttp_request *req,
+ struct evbuffer *evbuf, void *arg)
+{
+ const char *header = evhttp_find_header(req->input_headers, "X-Hook");
+ void *data = NULL;
+ size_t data_len = 0;
+
+ assert(header != NULL);
+ assert(strcmp(header, arg) == 0);
+
+ evhttp_remove_header(req->input_headers, "X-Hook");
+ evhttp_add_header(req->input_headers, "X-Pool-Hook", "ran");
+
+ assert(evrpc_hook_find_meta(ctx, "meta", &data, &data_len) == 0);
+ assert(data != NULL);
+ assert(data_len == 5);
+
+ assert(evrpc_hook_get_connection(ctx) != NULL);
+
+ return (EVRPC_CONTINUE);
+}
+
+static void
+rpc_basic_client(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg = NULL;
+ struct kill *kill = NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ need_input_hook = 1;
+ need_output_hook = 1;
+
+ assert(evrpc_add_hook(base, EVRPC_INPUT, rpc_hook_add_header, (void*)"input")
+ != NULL);
+ assert(evrpc_add_hook(base, EVRPC_OUTPUT, rpc_hook_add_header, (void*)"output")
+ != NULL);
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+
+ assert(evrpc_add_hook(pool, EVRPC_OUTPUT, rpc_hook_add_meta, NULL));
+ assert(evrpc_add_hook(pool, EVRPC_INPUT, rpc_hook_remove_header, (void*)"output"));
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill = kill_new();
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill, GotKillCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ tt_assert(test_ok == 1);
+
+ /* we do it twice to make sure that reuse works correctly */
+ kill_clear(kill);
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill, GotKillCb, NULL);
+
+ event_dispatch();
+
+ tt_assert(test_ok == 2);
+
+ /* we do it trice to make sure other stuff works, too */
+ kill_clear(kill);
+
+ {
+ struct evrpc_request_wrapper *ctx =
+ EVRPC_MAKE_CTX(Message, msg, kill,
+ pool, msg, kill, GotKillCb, NULL);
+ evrpc_make_request(ctx);
+ }
+
+ event_dispatch();
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 3);
+
+end:
+ if (msg)
+ msg_free(msg);
+ if (kill)
+ kill_free(kill);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+
+ need_input_hook = 0;
+ need_output_hook = 0;
+}
+
+/*
+ * We are testing that the second requests gets send over the same
+ * connection after the first RPCs completes.
+ */
+static void
+rpc_basic_queued_client(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg=NULL;
+ struct kill *kill_one=NULL, *kill_two=NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill_one = kill_new();
+ kill_two = kill_new();
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill_one, GotKillCbTwo, NULL);
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill_two, GotKillCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 2);
+
+end:
+ if (msg)
+ msg_free(msg);
+ if (kill_one)
+ kill_free(kill_one);
+ if (kill_two)
+ kill_free(kill_two);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+GotErrorCb(struct evrpc_status *status,
+ struct msg *msg, struct kill *kill, void *arg)
+{
+ if (status->error != EVRPC_STATUS_ERR_TIMEOUT)
+ goto done;
+
+ /* should never be complete but just to check */
+ if (kill_complete(kill) == 0)
+ goto done;
+
+ test_ok += 1;
+
+done:
+ event_loopexit(NULL);
+}
+
+/* we just pause the rpc and continue it in the next callback */
+
+struct rpc_hook_ctx_ {
+ void *vbase;
+ void *ctx;
+};
+
+static int hook_pause_cb_called=0;
+
+static void
+rpc_hook_pause_cb(evutil_socket_t fd, short what, void *arg)
+{
+ struct rpc_hook_ctx_ *ctx = arg;
+ ++hook_pause_cb_called;
+ evrpc_resume_request(ctx->vbase, ctx->ctx, EVRPC_CONTINUE);
+ free(arg);
+}
+
+static int
+rpc_hook_pause(void *ctx, struct evhttp_request *req, struct evbuffer *evbuf,
+ void *arg)
+{
+ struct rpc_hook_ctx_ *tmp = malloc(sizeof(*tmp));
+ struct timeval tv;
+
+ assert(tmp != NULL);
+ tmp->vbase = arg;
+ tmp->ctx = ctx;
+
+ memset(&tv, 0, sizeof(tv));
+ event_once(-1, EV_TIMEOUT, rpc_hook_pause_cb, tmp, &tv);
+ return EVRPC_PAUSE;
+}
+
+static void
+rpc_basic_client_with_pause(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg = NULL;
+ struct kill *kill= NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ assert(evrpc_add_hook(base, EVRPC_INPUT, rpc_hook_pause, base));
+ assert(evrpc_add_hook(base, EVRPC_OUTPUT, rpc_hook_pause, base));
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+ assert(evrpc_add_hook(pool, EVRPC_INPUT, rpc_hook_pause, pool));
+ assert(evrpc_add_hook(pool, EVRPC_OUTPUT, rpc_hook_pause, pool));
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill = kill_new();
+
+ EVRPC_MAKE_REQUEST(Message, pool, msg, kill, GotKillCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ tt_int_op(test_ok, ==, 1);
+ tt_int_op(hook_pause_cb_called, ==, 4);
+
+end:
+ if (base)
+ rpc_teardown(base);
+
+ if (msg)
+ msg_free(msg);
+ if (kill)
+ kill_free(kill);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+rpc_client_timeout(void)
+{
+ ev_uint16_t port;
+ struct evhttp *http = NULL;
+ struct evrpc_base *base = NULL;
+ struct evrpc_pool *pool = NULL;
+ struct msg *msg = NULL;
+ struct kill *kill = NULL;
+
+ rpc_setup(&http, &port, &base);
+
+ pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
+
+ /* set the timeout to 1 second. */
+ evrpc_pool_set_timeout(pool, 1);
+
+ /* set up the basic message */
+ msg = msg_new();
+ tt_assert(msg);
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "tester");
+
+ kill = kill_new();
+
+ EVRPC_MAKE_REQUEST(NeverReply, pool, msg, kill, GotErrorCb, NULL);
+
+ test_ok = 0;
+
+ event_dispatch();
+
+ /* free the saved RPC structure up */
+ EVRPC_REQUEST_DONE(saved_rpc);
+
+ rpc_teardown(base);
+
+ tt_assert(test_ok == 2);
+
+end:
+ if (msg)
+ msg_free(msg);
+ if (kill)
+ kill_free(kill);
+
+ if (pool)
+ evrpc_pool_free(pool);
+ if (http)
+ evhttp_free(http);
+}
+
+static void
+rpc_test(void)
+{
+ struct msg *msg = NULL, *msg2 = NULL;
+ struct kill *attack = NULL;
+ struct run *run = NULL;
+ struct evbuffer *tmp = evbuffer_new();
+ struct timeval tv_start, tv_end;
+ ev_uint32_t tag;
+ int i;
+
+ msg = msg_new();
+
+ tt_assert(msg);
+
+ EVTAG_ASSIGN(msg, from_name, "niels");
+ EVTAG_ASSIGN(msg, to_name, "phoenix");
+
+ if (EVTAG_GET(msg, attack, &attack) == -1) {
+ tt_abort_msg("Failed to set kill message.");
+ }
+
+ EVTAG_ASSIGN(attack, weapon, "feather");
+ EVTAG_ASSIGN(attack, action, "tickle");
+ for (i = 0; i < 3; ++i) {
+ if (EVTAG_ARRAY_ADD_VALUE(attack, how_often, i) == NULL) {
+ tt_abort_msg("Failed to add how_often.");
+ }
+ }
+
+ evutil_gettimeofday(&tv_start, NULL);
+ for (i = 0; i < 1000; ++i) {
+ run = EVTAG_ARRAY_ADD(msg, run);
+ if (run == NULL) {
+ tt_abort_msg("Failed to add run message.");
+ }
+ EVTAG_ASSIGN(run, how, "very fast but with some data in it");
+ EVTAG_ASSIGN(run, fixed_bytes,
+ (ev_uint8_t*)"012345678901234567890123");
+
+ if (EVTAG_ARRAY_ADD_VALUE(
+ run, notes, "this is my note") == NULL) {
+ tt_abort_msg("Failed to add note.");
+ }
+ if (EVTAG_ARRAY_ADD_VALUE(run, notes, "pps") == NULL) {
+ tt_abort_msg("Failed to add note");
+ }
+
+ EVTAG_ASSIGN(run, large_number, 0xdead0a0bcafebeefLL);
+ EVTAG_ARRAY_ADD_VALUE(run, other_numbers, 0xdead0a0b);
+ EVTAG_ARRAY_ADD_VALUE(run, other_numbers, 0xbeefcafe);
+ }
+
+ if (msg_complete(msg) == -1)
+ tt_abort_msg("Failed to make complete message.");
+
+ evtag_marshal_msg(tmp, 0xdeaf, msg);
+
+ if (evtag_peek(tmp, &tag) == -1)
+ tt_abort_msg("Failed to peak tag.");
+
+ if (tag != 0xdeaf)
+ TT_DIE(("Got incorrect tag: %0x.", (unsigned)tag));
+
+ msg2 = msg_new();
+ if (evtag_unmarshal_msg(tmp, 0xdeaf, msg2) == -1)
+ tt_abort_msg("Failed to unmarshal message.");
+
+ evutil_gettimeofday(&tv_end, NULL);
+ evutil_timersub(&tv_end, &tv_start, &tv_end);
+ TT_BLATHER(("(%.1f us/add) ",
+ (float)tv_end.tv_sec/(float)i * 1000000.0 +
+ tv_end.tv_usec / (float)i));
+
+ if (!EVTAG_HAS(msg2, from_name) ||
+ !EVTAG_HAS(msg2, to_name) ||
+ !EVTAG_HAS(msg2, attack)) {
+ tt_abort_msg("Missing data structures.");
+ }
+
+ if (EVTAG_GET(msg2, attack, &attack) == -1) {
+ tt_abort_msg("Could not get attack.");
+ }
+
+ if (EVTAG_ARRAY_LEN(msg2, run) != i) {
+ tt_abort_msg("Wrong number of run messages.");
+ }
+
+ /* get the very first run message */
+ if (EVTAG_ARRAY_GET(msg2, run, 0, &run) == -1) {
+ tt_abort_msg("Failed to get run msg.");
+ } else {
+ /* verify the notes */
+ char *note_one, *note_two;
+ ev_uint64_t large_number;
+ ev_uint32_t short_number;
+
+ if (EVTAG_ARRAY_LEN(run, notes) != 2) {
+ tt_abort_msg("Wrong number of note strings.");
+ }
+
+ if (EVTAG_ARRAY_GET(run, notes, 0, &note_one) == -1 ||
+ EVTAG_ARRAY_GET(run, notes, 1, &note_two) == -1) {
+ tt_abort_msg("Could not get note strings.");
+ }
+
+ if (strcmp(note_one, "this is my note") ||
+ strcmp(note_two, "pps")) {
+ tt_abort_msg("Incorrect note strings encoded.");
+ }
+
+ if (EVTAG_GET(run, large_number, &large_number) == -1 ||
+ large_number != 0xdead0a0bcafebeefLL) {
+ tt_abort_msg("Incorrrect large_number.");
+ }
+
+ if (EVTAG_ARRAY_LEN(run, other_numbers) != 2) {
+ tt_abort_msg("Wrong number of other_numbers.");
+ }
+
+ if (EVTAG_ARRAY_GET(
+ run, other_numbers, 0, &short_number) == -1) {
+ tt_abort_msg("Could not get short number.");
+ }
+ tt_uint_op(short_number, ==, 0xdead0a0b);
+
+ }
+ tt_int_op(EVTAG_ARRAY_LEN(attack, how_often), ==, 3);
+
+ for (i = 0; i < 3; ++i) {
+ ev_uint32_t res;
+ if (EVTAG_ARRAY_GET(attack, how_often, i, &res) == -1) {
+ TT_DIE(("Cannot get %dth how_often msg.", i));
+ }
+ if ((int)res != i) {
+ TT_DIE(("Wrong message encoded %d != %d", i, res));
+ }
+ }
+
+ test_ok = 1;
+end:
+ if (msg)
+ msg_free(msg);
+ if (msg2)
+ msg_free(msg2);
+ if (tmp)
+ evbuffer_free(tmp);
+}
+
+#define RPC_LEGACY(name) \
+ { #name, run_legacy_test_fn, TT_FORK|TT_NEED_BASE|TT_LEGACY, \
+ &legacy_setup, \
+ rpc_##name }
+#else
+/* NO_PYTHON_EXISTS */
+
+#define RPC_LEGACY(name) \
+ { #name, NULL, TT_SKIP, NULL, NULL }
+
+#endif
+
+struct testcase_t rpc_testcases[] = {
+ RPC_LEGACY(basic_test),
+ RPC_LEGACY(basic_message),
+ RPC_LEGACY(basic_client),
+ RPC_LEGACY(basic_queued_client),
+ RPC_LEGACY(basic_client_with_pause),
+ RPC_LEGACY(client_timeout),
+ RPC_LEGACY(test),
+
+ END_OF_TESTCASES,
+};
diff --git a/sntp/libevent/test/regress_ssl.c b/sntp/libevent/test/regress_ssl.c
new file mode 100644
index 0000000..c211341
--- /dev/null
+++ b/sntp/libevent/test/regress_ssl.c
@@ -0,0 +1,477 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Get rid of OSX 10.7 and greater deprecation warnings.
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#ifndef _WIN32
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/bufferevent_ssl.h"
+#include "event2/buffer.h"
+#include "event2/listener.h"
+
+#include "regress.h"
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+#include <openssl/ssl.h>
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/pem.h>
+
+#include <string.h>
+
+/* A short pre-generated key, to save the cost of doing an RSA key generation
+ * step during the unit tests. It's only 512 bits long, and it is published
+ * in this file, so you would have to be very foolish to consider using it in
+ * your own code. */
+static const char KEY[] =
+ "-----BEGIN RSA PRIVATE KEY-----\n"
+ "MIIBOgIBAAJBAKibTEzXjj+sqpipePX1lEk5BNFuL/dDBbw8QCXgaJWikOiKHeJq\n"
+ "3FQ0OmCnmpkdsPFE4x3ojYmmdgE2i0dJwq0CAwEAAQJAZ08gpUS+qE1IClps/2gG\n"
+ "AAer6Bc31K2AaiIQvCSQcH440cp062QtWMC3V5sEoWmdLsbAHFH26/9ZHn5zAflp\n"
+ "gQIhANWOx/UYeR8HD0WREU5kcuSzgzNLwUErHLzxP7U6aojpAiEAyh2H35CjN/P7\n"
+ "NhcZ4QYw3PeUWpqgJnaE/4i80BSYkSUCIQDLHFhLYLJZ80HwHTADif/ISn9/Ow6b\n"
+ "p6BWh3DbMar/eQIgBPS6azH5vpp983KXkNv9AL4VZi9ac/b+BeINdzC6GP0CIDmB\n"
+ "U6GFEQTZ3IfuiVabG5pummdC4DNbcdI+WKrSFNmQ\n"
+ "-----END RSA PRIVATE KEY-----\n";
+
+static EVP_PKEY *
+getkey(void)
+{
+ EVP_PKEY *key;
+ BIO *bio;
+
+ /* new read-only BIO backed by KEY. */
+ bio = BIO_new_mem_buf((char*)KEY, -1);
+ tt_assert(bio);
+
+ key = PEM_read_bio_PrivateKey(bio,NULL,NULL,NULL);
+ BIO_free(bio);
+ tt_assert(key);
+
+ return key;
+end:
+ return NULL;
+}
+
+static X509 *
+getcert(void)
+{
+ /* Dummy code to make a quick-and-dirty valid certificate with
+ OpenSSL. Don't copy this code into your own program! It does a
+ number of things in a stupid and insecure way. */
+ X509 *x509 = NULL;
+ X509_NAME *name = NULL;
+ EVP_PKEY *key = getkey();
+ int nid;
+ time_t now = time(NULL);
+
+ tt_assert(key);
+
+ x509 = X509_new();
+ tt_assert(x509);
+ tt_assert(0 != X509_set_version(x509, 2));
+ tt_assert(0 != ASN1_INTEGER_set(X509_get_serialNumber(x509),
+ (long)now));
+
+ name = X509_NAME_new();
+ tt_assert(name);
+ nid = OBJ_txt2nid("commonName");
+ tt_assert(NID_undef != nid);
+ tt_assert(0 != X509_NAME_add_entry_by_NID(
+ name, nid, MBSTRING_ASC, (unsigned char*)"example.com",
+ -1, -1, 0));
+
+ X509_set_subject_name(x509, name);
+ X509_set_issuer_name(x509, name);
+
+ X509_time_adj(X509_get_notBefore(x509), 0, &now);
+ now += 3600;
+ X509_time_adj(X509_get_notAfter(x509), 0, &now);
+ X509_set_pubkey(x509, key);
+ tt_assert(0 != X509_sign(x509, key, EVP_sha1()));
+
+ return x509;
+end:
+ X509_free(x509);
+ return NULL;
+}
+
+static int disable_tls_11_and_12 = 0;
+static SSL_CTX *the_ssl_ctx = NULL;
+
+static SSL_CTX *
+get_ssl_ctx(void)
+{
+ if (the_ssl_ctx)
+ return the_ssl_ctx;
+ the_ssl_ctx = SSL_CTX_new(SSLv23_method());
+ if (!the_ssl_ctx)
+ return NULL;
+ if (disable_tls_11_and_12) {
+#ifdef SSL_OP_NO_TLSv1_2
+ SSL_CTX_set_options(the_ssl_ctx, SSL_OP_NO_TLSv1_2);
+#endif
+#ifdef SSL_OP_NO_TLSv1_1
+ SSL_CTX_set_options(the_ssl_ctx, SSL_OP_NO_TLSv1_1);
+#endif
+ }
+ return the_ssl_ctx;
+}
+
+static void
+init_ssl(void)
+{
+ SSL_library_init();
+ ERR_load_crypto_strings();
+ SSL_load_error_strings();
+ OpenSSL_add_all_algorithms();
+ if (SSLeay() != OPENSSL_VERSION_NUMBER) {
+ TT_DECLARE("WARN", ("Version mismatch for openssl: compiled with %lx but running with %lx", (unsigned long)OPENSSL_VERSION_NUMBER, (unsigned long) SSLeay()));
+ }
+}
+
+/* ====================
+ Here's a simple test: we read a number from the input, increment it, and
+ reply, until we get to 1001.
+*/
+
+static int test_is_done = 0;
+static int n_connected = 0;
+static int got_close = 0;
+static int got_error = 0;
+static int renegotiate_at = -1;
+static int stop_when_connected = 0;
+static int pending_connect_events = 0;
+static struct event_base *exit_base = NULL;
+
+static void
+respond_to_number(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *b = bufferevent_get_input(bev);
+ char *line;
+ int n;
+ line = evbuffer_readln(b, NULL, EVBUFFER_EOL_LF);
+ if (! line)
+ return;
+ n = atoi(line);
+ if (n <= 0)
+ TT_FAIL(("Bad number: %s", line));
+ TT_BLATHER(("The number was %d", n));
+ if (n == 1001) {
+ ++test_is_done;
+ bufferevent_free(bev); /* Should trigger close on other side. */
+ return;
+ }
+ if (!strcmp(ctx, "client") && n == renegotiate_at) {
+ SSL_renegotiate(bufferevent_openssl_get_ssl(bev));
+ }
+ ++n;
+ evbuffer_add_printf(bufferevent_get_output(bev),
+ "%d\n", n);
+ TT_BLATHER(("Done reading; now writing."));
+ bufferevent_enable(bev, EV_WRITE);
+ bufferevent_disable(bev, EV_READ);
+}
+
+static void
+done_writing_cb(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *b = bufferevent_get_output(bev);
+ if (evbuffer_get_length(b))
+ return;
+ TT_BLATHER(("Done writing."));
+ bufferevent_disable(bev, EV_WRITE);
+ bufferevent_enable(bev, EV_READ);
+}
+
+static void
+eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ TT_BLATHER(("Got event %d", (int)what));
+ if (what & BEV_EVENT_CONNECTED) {
+ SSL *ssl;
+ X509 *peer_cert;
+ ++n_connected;
+ ssl = bufferevent_openssl_get_ssl(bev);
+ tt_assert(ssl);
+ peer_cert = SSL_get_peer_certificate(ssl);
+ if (0==strcmp(ctx, "server")) {
+ tt_assert(peer_cert == NULL);
+ } else {
+ tt_assert(peer_cert != NULL);
+ }
+ if (stop_when_connected) {
+ if (--pending_connect_events == 0)
+ event_base_loopexit(exit_base, NULL);
+ }
+ } else if (what & BEV_EVENT_EOF) {
+ TT_BLATHER(("Got a good EOF"));
+ ++got_close;
+ bufferevent_free(bev);
+ } else if (what & BEV_EVENT_ERROR) {
+ TT_BLATHER(("Got an error."));
+ ++got_error;
+ bufferevent_free(bev);
+ }
+end:
+ ;
+}
+
+static void
+open_ssl_bufevs(struct bufferevent **bev1_out, struct bufferevent **bev2_out,
+ struct event_base *base, int is_open, int flags, SSL *ssl1, SSL *ssl2,
+ evutil_socket_t *fd_pair, struct bufferevent **underlying_pair)
+{
+ int state1 = is_open ? BUFFEREVENT_SSL_OPEN :BUFFEREVENT_SSL_CONNECTING;
+ int state2 = is_open ? BUFFEREVENT_SSL_OPEN :BUFFEREVENT_SSL_ACCEPTING;
+ if (fd_pair) {
+ *bev1_out = bufferevent_openssl_socket_new(
+ base, fd_pair[0], ssl1, state1, flags);
+ *bev2_out = bufferevent_openssl_socket_new(
+ base, fd_pair[1], ssl2, state2, flags);
+ } else {
+ *bev1_out = bufferevent_openssl_filter_new(
+ base, underlying_pair[0], ssl1, state1, flags);
+ *bev2_out = bufferevent_openssl_filter_new(
+ base, underlying_pair[1], ssl2, state2, flags);
+
+ }
+ bufferevent_setcb(*bev1_out, respond_to_number, done_writing_cb,
+ eventcb, (void*)"client");
+ bufferevent_setcb(*bev2_out, respond_to_number, done_writing_cb,
+ eventcb, (void*)"server");
+}
+
+static void
+regress_bufferevent_openssl(void *arg)
+{
+ struct basic_test_data *data = arg;
+
+ struct bufferevent *bev1, *bev2;
+ SSL *ssl1, *ssl2;
+ X509 *cert = getcert();
+ EVP_PKEY *key = getkey();
+ const int start_open = strstr((char*)data->setup_data, "open")!=NULL;
+ const int filter = strstr((char*)data->setup_data, "filter")!=NULL;
+ int flags = BEV_OPT_DEFER_CALLBACKS;
+ struct bufferevent *bev_ll[2] = { NULL, NULL };
+ evutil_socket_t *fd_pair = NULL;
+
+ tt_assert(cert);
+ tt_assert(key);
+
+ init_ssl();
+
+ if (strstr((char*)data->setup_data, "renegotiate")) {
+ if (SSLeay() >= 0x10001000 &&
+ SSLeay() < 0x1000104f) {
+ /* 1.0.1 up to 1.0.1c has a bug where TLS1.1 and 1.2
+ * can't renegotiate with themselves. Disable. */
+ disable_tls_11_and_12 = 1;
+ }
+ renegotiate_at = 600;
+ }
+
+ ssl1 = SSL_new(get_ssl_ctx());
+ ssl2 = SSL_new(get_ssl_ctx());
+
+ SSL_use_certificate(ssl2, cert);
+ SSL_use_PrivateKey(ssl2, key);
+
+ if (! start_open)
+ flags |= BEV_OPT_CLOSE_ON_FREE;
+
+ if (!filter) {
+ tt_assert(strstr((char*)data->setup_data, "socketpair"));
+ fd_pair = data->pair;
+ } else {
+ bev_ll[0] = bufferevent_socket_new(data->base, data->pair[0],
+ BEV_OPT_CLOSE_ON_FREE);
+ bev_ll[1] = bufferevent_socket_new(data->base, data->pair[1],
+ BEV_OPT_CLOSE_ON_FREE);
+ }
+
+ open_ssl_bufevs(&bev1, &bev2, data->base, 0, flags, ssl1, ssl2,
+ fd_pair, bev_ll);
+
+ if (!filter) {
+ tt_int_op(bufferevent_getfd(bev1), ==, data->pair[0]);
+ } else {
+ tt_ptr_op(bufferevent_get_underlying(bev1), ==, bev_ll[0]);
+ }
+
+ if (start_open) {
+ pending_connect_events = 2;
+ stop_when_connected = 1;
+ exit_base = data->base;
+ event_base_dispatch(data->base);
+ /* Okay, now the renegotiation is done. Make new
+ * bufferevents to test opening in BUFFEREVENT_SSL_OPEN */
+ flags |= BEV_OPT_CLOSE_ON_FREE;
+ bufferevent_free(bev1);
+ bufferevent_free(bev2);
+ bev1 = bev2 = NULL;
+ open_ssl_bufevs(&bev1, &bev2, data->base, 1, flags, ssl1, ssl2,
+ fd_pair, bev_ll);
+ }
+
+ bufferevent_enable(bev1, EV_READ|EV_WRITE);
+ bufferevent_enable(bev2, EV_READ|EV_WRITE);
+
+ evbuffer_add_printf(bufferevent_get_output(bev1), "1\n");
+
+ event_base_dispatch(data->base);
+
+ tt_assert(test_is_done == 1);
+ tt_assert(n_connected == 2);
+
+ /* We don't handle shutdown properly yet.
+ tt_int_op(got_close, ==, 1);
+ tt_int_op(got_error, ==, 0);
+ */
+end:
+ return;
+}
+
+static void
+acceptcb(struct evconnlistener *listener, evutil_socket_t fd,
+ struct sockaddr *addr, int socklen, void *arg)
+{
+ struct basic_test_data *data = arg;
+ struct bufferevent *bev;
+ SSL *ssl = SSL_new(get_ssl_ctx());
+
+ SSL_use_certificate(ssl, getcert());
+ SSL_use_PrivateKey(ssl, getkey());
+
+ bev = bufferevent_openssl_socket_new(
+ data->base,
+ fd,
+ ssl,
+ BUFFEREVENT_SSL_ACCEPTING,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+
+ bufferevent_setcb(bev, respond_to_number, NULL, eventcb,
+ (void*)"server");
+
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+
+ /* Only accept once, then disable ourself. */
+ evconnlistener_disable(listener);
+}
+
+static void
+regress_bufferevent_openssl_connect(void *arg)
+{
+ struct basic_test_data *data = arg;
+
+ struct event_base *base = data->base;
+
+ struct evconnlistener *listener;
+ struct bufferevent *bev;
+ struct sockaddr_in sin;
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+
+ init_ssl();
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+
+ memset(&ss, 0, sizeof(ss));
+ slen = sizeof(ss);
+
+ listener = evconnlistener_new_bind(base, acceptcb, data,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ -1, (struct sockaddr *)&sin, sizeof(sin));
+
+ tt_assert(listener);
+ tt_assert(evconnlistener_get_fd(listener) >= 0);
+
+ bev = bufferevent_openssl_socket_new(
+ data->base, -1, SSL_new(get_ssl_ctx()),
+ BUFFEREVENT_SSL_CONNECTING,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
+ tt_assert(bev);
+
+ bufferevent_setcb(bev, respond_to_number, NULL, eventcb,
+ (void*)"client");
+
+ tt_assert(getsockname(evconnlistener_get_fd(listener),
+ (struct sockaddr*)&ss, &slen) == 0);
+ tt_assert(slen == sizeof(struct sockaddr_in));
+ tt_int_op(((struct sockaddr*)&ss)->sa_family, ==, AF_INET);
+ tt_int_op(((struct sockaddr*)&ss)->sa_family, ==, AF_INET);
+
+ tt_assert(0 ==
+ bufferevent_socket_connect(bev, (struct sockaddr*)&ss, slen));
+ evbuffer_add_printf(bufferevent_get_output(bev), "1\n");
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+
+ event_base_dispatch(base);
+end:
+ ;
+}
+
+struct testcase_t ssl_testcases[] = {
+
+ { "bufferevent_socketpair", regress_bufferevent_openssl, TT_ISOLATED,
+ &basic_setup, (void*)"socketpair" },
+ { "bufferevent_filter", regress_bufferevent_openssl,
+ TT_ISOLATED,
+ &basic_setup, (void*)"filter" },
+ { "bufferevent_renegotiate_socketpair", regress_bufferevent_openssl,
+ TT_ISOLATED,
+ &basic_setup, (void*)"socketpair renegotiate" },
+ { "bufferevent_renegotiate_filter", regress_bufferevent_openssl,
+ TT_ISOLATED,
+ &basic_setup, (void*)"filter renegotiate" },
+ { "bufferevent_socketpair_startopen", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup, (void*)"socketpair open" },
+ { "bufferevent_filter_startopen", regress_bufferevent_openssl,
+ TT_ISOLATED, &basic_setup, (void*)"filter open" },
+
+ { "bufferevent_connect", regress_bufferevent_openssl_connect,
+ TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
+
+ END_OF_TESTCASES,
+};
diff --git a/sntp/libevent/test/regress_testutils.c b/sntp/libevent/test/regress_testutils.c
new file mode 100644
index 0000000..1f00460
--- /dev/null
+++ b/sntp/libevent/test/regress_testutils.c
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "../util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <ws2tcpip.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/queue.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <signal.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/dns.h"
+#include "event2/dns_struct.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "event2/bufferevent.h"
+#include "log-internal.h"
+#include "regress.h"
+#include "regress_testutils.h"
+
+/* globals */
+static struct evdns_server_port *dns_port;
+evutil_socket_t dns_sock = -1;
+
+/* Helper: return the port that a socket is bound on, in host order. */
+int
+regress_get_socket_port(evutil_socket_t fd)
+{
+ struct sockaddr_storage ss;
+ ev_socklen_t socklen = sizeof(ss);
+ if (getsockname(fd, (struct sockaddr*)&ss, &socklen) != 0)
+ return -1;
+ if (ss.ss_family == AF_INET)
+ return ntohs( ((struct sockaddr_in*)&ss)->sin_port);
+ else if (ss.ss_family == AF_INET6)
+ return ntohs( ((struct sockaddr_in6*)&ss)->sin6_port);
+ else
+ return -1;
+}
+
+struct evdns_server_port *
+regress_get_dnsserver(struct event_base *base,
+ ev_uint16_t *portnum,
+ evutil_socket_t *psock,
+ evdns_request_callback_fn_type cb,
+ void *arg)
+{
+ struct evdns_server_port *port = NULL;
+ evutil_socket_t sock;
+ struct sockaddr_in my_addr;
+
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock < 0) {
+ tt_abort_perror("socket");
+ }
+
+ evutil_make_socket_nonblocking(sock);
+
+ memset(&my_addr, 0, sizeof(my_addr));
+ my_addr.sin_family = AF_INET;
+ my_addr.sin_port = htons(*portnum);
+ my_addr.sin_addr.s_addr = htonl(0x7f000001UL);
+ if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr)) < 0) {
+ evutil_closesocket(sock);
+ tt_abort_perror("bind");
+ }
+ port = evdns_add_server_port_with_base(base, sock, 0, cb, arg);
+ if (!*portnum)
+ *portnum = regress_get_socket_port(sock);
+ if (psock)
+ *psock = sock;
+
+ return port;
+end:
+ return NULL;
+}
+
+void
+regress_clean_dnsserver(void)
+{
+ if (dns_port)
+ evdns_close_server_port(dns_port);
+ if (dns_sock >= 0)
+ evutil_closesocket(dns_sock);
+}
+
+void
+regress_dns_server_cb(struct evdns_server_request *req, void *data)
+{
+ struct regress_dns_server_table *tab = data;
+ const char *question;
+
+ if (req->nquestions != 1)
+ TT_DIE(("Only handling one question at a time; got %d",
+ req->nquestions));
+
+ question = req->questions[0]->name;
+
+ while (tab->q && evutil_ascii_strcasecmp(question, tab->q) &&
+ strcmp("*", tab->q))
+ ++tab;
+ if (tab->q == NULL)
+ TT_DIE(("Unexpected question: '%s'", question));
+
+ ++tab->seen;
+
+ if (!strcmp(tab->anstype, "err")) {
+ int err = atoi(tab->ans);
+ tt_assert(! evdns_server_request_respond(req, err));
+ return;
+ } else if (!strcmp(tab->anstype, "errsoa")) {
+ int err = atoi(tab->ans);
+ char soa_record[] =
+ "\x04" "dns1" "\x05" "icann" "\x03" "org" "\0"
+ "\x0a" "hostmaster" "\x05" "icann" "\x03" "org" "\0"
+ "\x77\xde\x5e\xba" /* serial */
+ "\x00\x00\x1c\x20" /* refreshtime = 2h */
+ "\x00\x00\x0e\x10" /* retry = 1h */
+ "\x00\x12\x75\x00" /* expiration = 14d */
+ "\x00\x00\x0e\x10" /* min.ttl = 1h */
+ ;
+ evdns_server_request_add_reply(
+ req, EVDNS_AUTHORITY_SECTION,
+ "example.com", EVDNS_TYPE_SOA, EVDNS_CLASS_INET,
+ 42, sizeof(soa_record) - 1, 0, soa_record);
+ tt_assert(! evdns_server_request_respond(req, err));
+ return;
+ } else if (!strcmp(tab->anstype, "A")) {
+ struct in_addr in;
+ if (!evutil_inet_pton(AF_INET, tab->ans, &in)) {
+ TT_DIE(("Bad A value %s in table", tab->ans));
+ }
+ evdns_server_request_add_a_reply(req, question, 1, &in.s_addr,
+ 100);
+ } else if (!strcmp(tab->anstype, "AAAA")) {
+ struct in6_addr in6;
+ if (!evutil_inet_pton(AF_INET6, tab->ans, &in6)) {
+ TT_DIE(("Bad AAAA value %s in table", tab->ans));
+ }
+ evdns_server_request_add_aaaa_reply(req,
+ question, 1, &in6.s6_addr, 100);
+ } else {
+ TT_DIE(("Weird table entry with type '%s'", tab->anstype));
+ }
+ tt_assert(! evdns_server_request_respond(req, 0))
+ return;
+end:
+ tt_want(! evdns_server_request_drop(req));
+}
+
+int
+regress_dnsserver(struct event_base *base, ev_uint16_t *port,
+ struct regress_dns_server_table *search_table)
+{
+ dns_port = regress_get_dnsserver(base, port, &dns_sock,
+ regress_dns_server_cb, search_table);
+ return dns_port != NULL;
+}
+
+int
+regress_get_listener_addr(struct evconnlistener *lev,
+ struct sockaddr *sa, ev_socklen_t *socklen)
+{
+ evutil_socket_t s = evconnlistener_get_fd(lev);
+ if (s <= 0)
+ return -1;
+ return getsockname(s, sa, socklen);
+}
diff --git a/sntp/libevent/test/regress_testutils.h b/sntp/libevent/test/regress_testutils.h
new file mode 100644
index 0000000..f90b9c9
--- /dev/null
+++ b/sntp/libevent/test/regress_testutils.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef REGRESS_TESTUTILS_H_INCLUDED_
+#define REGRESS_TESTUTILS_H_INCLUDED_
+
+#include "event2/dns.h"
+
+struct regress_dns_server_table {
+ const char *q;
+ const char *anstype;
+ const char *ans;
+ int seen;
+};
+
+struct evdns_server_port *
+regress_get_dnsserver(struct event_base *base,
+ ev_uint16_t *portnum,
+ evutil_socket_t *psock,
+ evdns_request_callback_fn_type cb,
+ void *arg);
+
+/* Helper: return the port that a socket is bound on, in host order. */
+int regress_get_socket_port(evutil_socket_t fd);
+
+/* used to look up pre-canned responses in a search table */
+void regress_dns_server_cb(
+ struct evdns_server_request *req, void *data);
+
+/* globally allocates a dns server that serves from a search table */
+int regress_dnsserver(struct event_base *base, ev_uint16_t *port,
+ struct regress_dns_server_table *seach_table);
+
+/* clean up the global dns server resources */
+void regress_clean_dnsserver(void);
+
+struct evconnlistener;
+struct sockaddr;
+int regress_get_listener_addr(struct evconnlistener *lev,
+ struct sockaddr *sa, ev_socklen_t *socklen);
+
+#endif /* REGRESS_TESTUTILS_H_INCLUDED_ */
+
diff --git a/sntp/libevent/test/regress_thread.c b/sntp/libevent/test/regress_thread.c
new file mode 100644
index 0000000..612bf1d
--- /dev/null
+++ b/sntp/libevent/test/regress_thread.c
@@ -0,0 +1,584 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef EVENT__HAVE_PTHREADS
+#include <pthread.h>
+#elif defined(_WIN32)
+#include <process.h>
+#endif
+#include <assert.h>
+#ifdef EVENT__HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <time.h>
+
+#include "sys/queue.h"
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/thread.h"
+#include "event2/util.h"
+#include "evthread-internal.h"
+#include "event-internal.h"
+#include "defer-internal.h"
+#include "regress.h"
+#include "tinytest_macros.h"
+#include "time-internal.h"
+#include "regress_thread.h"
+
+struct cond_wait {
+ void *lock;
+ void *cond;
+};
+
+static void
+wake_all_timeout(evutil_socket_t fd, short what, void *arg)
+{
+ struct cond_wait *cw = arg;
+ EVLOCK_LOCK(cw->lock, 0);
+ EVTHREAD_COND_BROADCAST(cw->cond);
+ EVLOCK_UNLOCK(cw->lock, 0);
+
+}
+
+static void
+wake_one_timeout(evutil_socket_t fd, short what, void *arg)
+{
+ struct cond_wait *cw = arg;
+ EVLOCK_LOCK(cw->lock, 0);
+ EVTHREAD_COND_SIGNAL(cw->cond);
+ EVLOCK_UNLOCK(cw->lock, 0);
+}
+
+#define NUM_THREADS 100
+#define NUM_ITERATIONS 100
+void *count_lock;
+static int count;
+
+static THREAD_FN
+basic_thread(void *arg)
+{
+ struct cond_wait cw;
+ struct event_base *base = arg;
+ struct event ev;
+ int i = 0;
+
+ EVTHREAD_ALLOC_LOCK(cw.lock, 0);
+ EVTHREAD_ALLOC_COND(cw.cond);
+ assert(cw.lock);
+ assert(cw.cond);
+
+ evtimer_assign(&ev, base, wake_all_timeout, &cw);
+ for (i = 0; i < NUM_ITERATIONS; i++) {
+ struct timeval tv;
+ evutil_timerclear(&tv);
+ tv.tv_sec = 0;
+ tv.tv_usec = 3000;
+
+ EVLOCK_LOCK(cw.lock, 0);
+ /* we need to make sure that event does not happen before
+ * we get to wait on the conditional variable */
+ assert(evtimer_add(&ev, &tv) == 0);
+
+ assert(EVTHREAD_COND_WAIT(cw.cond, cw.lock) == 0);
+ EVLOCK_UNLOCK(cw.lock, 0);
+
+ EVLOCK_LOCK(count_lock, 0);
+ ++count;
+ EVLOCK_UNLOCK(count_lock, 0);
+ }
+
+ /* exit the loop only if all threads fired all timeouts */
+ EVLOCK_LOCK(count_lock, 0);
+ if (count >= NUM_THREADS * NUM_ITERATIONS)
+ event_base_loopexit(base, NULL);
+ EVLOCK_UNLOCK(count_lock, 0);
+
+ EVTHREAD_FREE_LOCK(cw.lock, 0);
+ EVTHREAD_FREE_COND(cw.cond);
+
+ THREAD_RETURN();
+}
+
+static int notification_fd_used = 0;
+#ifndef _WIN32
+static int got_sigchld = 0;
+static void
+sigchld_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct timeval tv;
+ struct event_base *base = arg;
+
+ got_sigchld++;
+ tv.tv_usec = 100000;
+ tv.tv_sec = 0;
+ event_base_loopexit(base, &tv);
+}
+
+
+static void
+notify_fd_cb(evutil_socket_t fd, short event, void *arg)
+{
+ ++notification_fd_used;
+}
+#endif
+
+static void
+thread_basic(void *arg)
+{
+ THREAD_T threads[NUM_THREADS];
+ struct event ev;
+ struct timeval tv;
+ int i;
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+
+ struct event *notification_event = NULL;
+ struct event *sigchld_event = NULL;
+
+ EVTHREAD_ALLOC_LOCK(count_lock, 0);
+ tt_assert(count_lock);
+
+ tt_assert(base);
+ if (evthread_make_base_notifiable(base)<0) {
+ tt_abort_msg("Couldn't make base notifiable!");
+ }
+
+#ifndef _WIN32
+ if (data->setup_data && !strcmp(data->setup_data, "forking")) {
+ pid_t pid;
+ int status;
+ sigchld_event = evsignal_new(base, SIGCHLD, sigchld_cb, base);
+ /* This piggybacks on the th_notify_fd weirdly, and looks
+ * inside libevent internals. Not a good idea in non-testing
+ * code! */
+ notification_event = event_new(base,
+ base->th_notify_fd[0], EV_READ|EV_PERSIST, notify_fd_cb,
+ NULL);
+ event_add(sigchld_event, NULL);
+ event_add(notification_event, NULL);
+
+ if ((pid = fork()) == 0) {
+ event_del(notification_event);
+ if (event_reinit(base) < 0) {
+ TT_FAIL(("reinit"));
+ exit(1);
+ }
+ event_assign(notification_event, base,
+ base->th_notify_fd[0], EV_READ|EV_PERSIST,
+ notify_fd_cb, NULL);
+ event_add(notification_event, NULL);
+ goto child;
+ }
+
+ event_base_dispatch(base);
+
+ if (waitpid(pid, &status, 0) == -1)
+ tt_abort_perror("waitpid");
+ TT_BLATHER(("Waitpid okay\n"));
+
+ tt_assert(got_sigchld);
+ tt_int_op(notification_fd_used, ==, 0);
+
+ goto end;
+ }
+
+child:
+#endif
+ for (i = 0; i < NUM_THREADS; ++i)
+ THREAD_START(threads[i], basic_thread, base);
+
+ evtimer_assign(&ev, base, NULL, NULL);
+ evutil_timerclear(&tv);
+ tv.tv_sec = 1000;
+ event_add(&ev, &tv);
+
+ event_base_dispatch(base);
+
+ for (i = 0; i < NUM_THREADS; ++i)
+ THREAD_JOIN(threads[i]);
+
+ event_del(&ev);
+
+ tt_int_op(count, ==, NUM_THREADS * NUM_ITERATIONS);
+
+ EVTHREAD_FREE_LOCK(count_lock, 0);
+
+ TT_BLATHER(("notifiations==%d", notification_fd_used));
+
+end:
+
+ if (notification_event)
+ event_free(notification_event);
+ if (sigchld_event)
+ event_free(sigchld_event);
+}
+
+#undef NUM_THREADS
+#define NUM_THREADS 10
+
+struct alerted_record {
+ struct cond_wait *cond;
+ struct timeval delay;
+ struct timeval alerted_at;
+ int timed_out;
+};
+
+static THREAD_FN
+wait_for_condition(void *arg)
+{
+ struct alerted_record *rec = arg;
+ int r;
+
+ EVLOCK_LOCK(rec->cond->lock, 0);
+ if (rec->delay.tv_sec || rec->delay.tv_usec) {
+ r = EVTHREAD_COND_WAIT_TIMED(rec->cond->cond, rec->cond->lock,
+ &rec->delay);
+ } else {
+ r = EVTHREAD_COND_WAIT(rec->cond->cond, rec->cond->lock);
+ }
+ EVLOCK_UNLOCK(rec->cond->lock, 0);
+
+ evutil_gettimeofday(&rec->alerted_at, NULL);
+ if (r == 1)
+ rec->timed_out = 1;
+
+ THREAD_RETURN();
+}
+
+static void
+thread_conditions_simple(void *arg)
+{
+ struct timeval tv_signal, tv_timeout, tv_broadcast;
+ struct alerted_record alerted[NUM_THREADS];
+ THREAD_T threads[NUM_THREADS];
+ struct cond_wait cond;
+ int i;
+ struct timeval launched_at;
+ struct event wake_one;
+ struct event wake_all;
+ struct basic_test_data *data = arg;
+ struct event_base *base = data->base;
+ int n_timed_out=0, n_signal=0, n_broadcast=0;
+
+ tv_signal.tv_sec = tv_timeout.tv_sec = tv_broadcast.tv_sec = 0;
+ tv_signal.tv_usec = 30*1000;
+ tv_timeout.tv_usec = 150*1000;
+ tv_broadcast.tv_usec = 500*1000;
+
+ EVTHREAD_ALLOC_LOCK(cond.lock, EVTHREAD_LOCKTYPE_RECURSIVE);
+ EVTHREAD_ALLOC_COND(cond.cond);
+ tt_assert(cond.lock);
+ tt_assert(cond.cond);
+ for (i = 0; i < NUM_THREADS; ++i) {
+ memset(&alerted[i], 0, sizeof(struct alerted_record));
+ alerted[i].cond = &cond;
+ }
+
+ /* Threads 5 and 6 will be allowed to time out */
+ memcpy(&alerted[5].delay, &tv_timeout, sizeof(tv_timeout));
+ memcpy(&alerted[6].delay, &tv_timeout, sizeof(tv_timeout));
+
+ evtimer_assign(&wake_one, base, wake_one_timeout, &cond);
+ evtimer_assign(&wake_all, base, wake_all_timeout, &cond);
+
+ evutil_gettimeofday(&launched_at, NULL);
+
+ /* Launch the threads... */
+ for (i = 0; i < NUM_THREADS; ++i) {
+ THREAD_START(threads[i], wait_for_condition, &alerted[i]);
+ }
+
+ /* Start the timers... */
+ tt_int_op(event_add(&wake_one, &tv_signal), ==, 0);
+ tt_int_op(event_add(&wake_all, &tv_broadcast), ==, 0);
+
+ /* And run for a bit... */
+ event_base_dispatch(base);
+
+ /* And wait till the threads are done. */
+ for (i = 0; i < NUM_THREADS; ++i)
+ THREAD_JOIN(threads[i]);
+
+ /* Now, let's see what happened. At least one of 5 or 6 should
+ * have timed out. */
+ n_timed_out = alerted[5].timed_out + alerted[6].timed_out;
+ tt_int_op(n_timed_out, >=, 1);
+ tt_int_op(n_timed_out, <=, 2);
+
+ for (i = 0; i < NUM_THREADS; ++i) {
+ const struct timeval *target_delay;
+ struct timeval target_time, actual_delay;
+ if (alerted[i].timed_out) {
+ TT_BLATHER(("%d looks like a timeout\n", i));
+ target_delay = &tv_timeout;
+ tt_assert(i == 5 || i == 6);
+ } else if (evutil_timerisset(&alerted[i].alerted_at)) {
+ long diff1,diff2;
+ evutil_timersub(&alerted[i].alerted_at,
+ &launched_at, &actual_delay);
+ diff1 = timeval_msec_diff(&actual_delay,
+ &tv_signal);
+ diff2 = timeval_msec_diff(&actual_delay,
+ &tv_broadcast);
+ if (abs(diff1) < abs(diff2)) {
+ TT_BLATHER(("%d looks like a signal\n", i));
+ target_delay = &tv_signal;
+ ++n_signal;
+ } else {
+ TT_BLATHER(("%d looks like a broadcast\n", i));
+ target_delay = &tv_broadcast;
+ ++n_broadcast;
+ }
+ } else {
+ TT_FAIL(("Thread %d never got woken", i));
+ continue;
+ }
+ evutil_timeradd(target_delay, &launched_at, &target_time);
+ test_timeval_diff_leq(&target_time, &alerted[i].alerted_at,
+ 0, 50);
+ }
+ tt_int_op(n_broadcast + n_signal + n_timed_out, ==, NUM_THREADS);
+ tt_int_op(n_signal, ==, 1);
+
+end:
+ ;
+}
+
+#define CB_COUNT 128
+#define QUEUE_THREAD_COUNT 8
+
+static void
+SLEEP_MS(int ms)
+{
+ struct timeval tv;
+ tv.tv_sec = ms/1000;
+ tv.tv_usec = (ms%1000)*1000;
+ evutil_usleep_(&tv);
+}
+
+struct deferred_test_data {
+ struct event_callback cbs[CB_COUNT];
+ struct event_base *queue;
+};
+
+static struct timeval timer_start = {0,0};
+static struct timeval timer_end = {0,0};
+static unsigned callback_count = 0;
+static THREAD_T load_threads[QUEUE_THREAD_COUNT];
+static struct deferred_test_data deferred_data[QUEUE_THREAD_COUNT];
+
+static void
+deferred_callback(struct event_callback *cb, void *arg)
+{
+ SLEEP_MS(1);
+ callback_count += 1;
+}
+
+static THREAD_FN
+load_deferred_queue(void *arg)
+{
+ struct deferred_test_data *data = arg;
+ size_t i;
+
+ for (i = 0; i < CB_COUNT; ++i) {
+ event_deferred_cb_init_(&data->cbs[i], 0, deferred_callback,
+ NULL);
+ event_deferred_cb_schedule_(data->queue, &data->cbs[i]);
+ SLEEP_MS(1);
+ }
+
+ THREAD_RETURN();
+}
+
+static void
+timer_callback(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_gettimeofday(&timer_end, NULL);
+}
+
+static void
+start_threads_callback(evutil_socket_t fd, short what, void *arg)
+{
+ int i;
+
+ for (i = 0; i < QUEUE_THREAD_COUNT; ++i) {
+ THREAD_START(load_threads[i], load_deferred_queue,
+ &deferred_data[i]);
+ }
+}
+
+static void
+thread_deferred_cb_skew(void *arg)
+{
+ struct timeval tv_timer = {1, 0};
+ struct event_base *base = NULL;
+ struct event_config *cfg = NULL;
+ struct timeval elapsed;
+ int elapsed_usec;
+ int i;
+
+ cfg = event_config_new();
+ tt_assert(cfg);
+ event_config_set_max_dispatch_interval(cfg, NULL, 16, 0);
+
+ base = event_base_new_with_config(cfg);
+ tt_assert(base);
+
+ for (i = 0; i < QUEUE_THREAD_COUNT; ++i)
+ deferred_data[i].queue = base;
+
+ evutil_gettimeofday(&timer_start, NULL);
+ event_base_once(base, -1, EV_TIMEOUT, timer_callback, NULL,
+ &tv_timer);
+ event_base_once(base, -1, EV_TIMEOUT, start_threads_callback,
+ NULL, NULL);
+ event_base_dispatch(base);
+
+ evutil_timersub(&timer_end, &timer_start, &elapsed);
+ TT_BLATHER(("callback count, %u", callback_count));
+ elapsed_usec =
+ (unsigned)(elapsed.tv_sec*1000000 + elapsed.tv_usec);
+ TT_BLATHER(("elapsed time, %u usec", elapsed_usec));
+
+ /* XXX be more intelligent here. just make sure skew is
+ * within .4 seconds for now. */
+ tt_assert(elapsed_usec >= 600000 && elapsed_usec <= 1400000);
+
+end:
+ for (i = 0; i < QUEUE_THREAD_COUNT; ++i)
+ THREAD_JOIN(load_threads[i]);
+ if (base)
+ event_base_free(base);
+ if (cfg)
+ event_config_free(cfg);
+}
+
+static struct event time_events[5];
+static struct timeval times[5];
+static struct event_base *exit_base = NULL;
+static void
+note_time_cb(evutil_socket_t fd, short what, void *arg)
+{
+ evutil_gettimeofday(arg, NULL);
+ if (arg == &times[4]) {
+ event_base_loopbreak(exit_base);
+ }
+}
+static THREAD_FN
+register_events_subthread(void *arg)
+{
+ struct timeval tv = {0,0};
+ SLEEP_MS(100);
+ event_active(&time_events[0], EV_TIMEOUT, 1);
+ SLEEP_MS(100);
+ event_active(&time_events[1], EV_TIMEOUT, 1);
+ SLEEP_MS(100);
+ tv.tv_usec = 100*1000;
+ event_add(&time_events[2], &tv);
+ tv.tv_usec = 150*1000;
+ event_add(&time_events[3], &tv);
+ SLEEP_MS(200);
+ event_active(&time_events[4], EV_TIMEOUT, 1);
+
+ THREAD_RETURN();
+}
+
+static void
+thread_no_events(void *arg)
+{
+ THREAD_T thread;
+ struct basic_test_data *data = arg;
+ struct timeval starttime, endtime;
+ int i;
+ exit_base = data->base;
+
+ memset(times,0,sizeof(times));
+ for (i=0;i<5;++i) {
+ event_assign(&time_events[i], data->base,
+ -1, 0, note_time_cb, &times[i]);
+ }
+
+ evutil_gettimeofday(&starttime, NULL);
+ THREAD_START(thread, register_events_subthread, data->base);
+ event_base_loop(data->base, EVLOOP_NO_EXIT_ON_EMPTY);
+ evutil_gettimeofday(&endtime, NULL);
+ tt_assert(event_base_got_break(data->base));
+ THREAD_JOIN(thread);
+ for (i=0; i<5; ++i) {
+ struct timeval diff;
+ double sec;
+ evutil_timersub(&times[i], &starttime, &diff);
+ sec = diff.tv_sec + diff.tv_usec/1.0e6;
+ TT_BLATHER(("event %d at %.4f seconds", i, sec));
+ }
+ test_timeval_diff_eq(&starttime, &times[0], 100);
+ test_timeval_diff_eq(&starttime, &times[1], 200);
+ test_timeval_diff_eq(&starttime, &times[2], 400);
+ test_timeval_diff_eq(&starttime, &times[3], 450);
+ test_timeval_diff_eq(&starttime, &times[4], 500);
+ test_timeval_diff_eq(&starttime, &endtime, 500);
+
+end:
+ ;
+}
+
+#define TEST(name) \
+ { #name, thread_##name, TT_FORK|TT_NEED_THREADS|TT_NEED_BASE, \
+ &basic_setup, NULL }
+
+struct testcase_t thread_testcases[] = {
+ { "basic", thread_basic, TT_FORK|TT_NEED_THREADS|TT_NEED_BASE,
+ &basic_setup, NULL },
+#ifndef _WIN32
+ { "forking", thread_basic, TT_FORK|TT_NEED_THREADS|TT_NEED_BASE,
+ &basic_setup, (char*)"forking" },
+#endif
+ TEST(conditions_simple),
+ { "deferred_cb_skew", thread_deferred_cb_skew,
+ TT_FORK|TT_NEED_THREADS|TT_OFF_BY_DEFAULT,
+ &basic_setup, NULL },
+ TEST(no_events),
+ END_OF_TESTCASES
+};
+
diff --git a/sntp/libevent/test/regress_thread.h b/sntp/libevent/test/regress_thread.h
new file mode 100644
index 0000000..831b51e
--- /dev/null
+++ b/sntp/libevent/test/regress_thread.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef REGRESS_THREAD_H_INCLUDED_
+#define REGRESS_THREAD_H_INCLUDED_
+
+#ifdef EVENT__HAVE_PTHREADS
+#define THREAD_T pthread_t
+#define THREAD_FN void *
+#define THREAD_RETURN() return (NULL)
+#define THREAD_START(threadvar, fn, arg) \
+ pthread_create(&(threadvar), NULL, fn, arg)
+#define THREAD_JOIN(th) pthread_join(th, NULL)
+#else
+#define THREAD_T HANDLE
+#define THREAD_FN unsigned __stdcall
+#define THREAD_RETURN() return (0)
+#define THREAD_START(threadvar, fn, arg) do { \
+ uintptr_t threadhandle = _beginthreadex(NULL,0,fn,(arg),0,NULL); \
+ (threadvar) = (HANDLE) threadhandle; \
+ } while (0)
+#define THREAD_JOIN(th) WaitForSingleObject(th, INFINITE)
+#endif
+
+#endif
diff --git a/sntp/libevent/test/regress_util.c b/sntp/libevent/test/regress_util.c
new file mode 100644
index 0000000..d64d002
--- /dev/null
+++ b/sntp/libevent/test/regress_util.c
@@ -0,0 +1,1411 @@
+/*
+ * Copyright (c) 2009-2012 Nick Mathewson and Niels Provos
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "../util-internal.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#include <ws2tcpip.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef EVENT__HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+#include "../ipv6-internal.h"
+#include "../log-internal.h"
+#include "../strlcpy-internal.h"
+#include "../mm-internal.h"
+#include "../time-internal.h"
+
+#include "regress.h"
+
+enum entry_status { NORMAL, CANONICAL, BAD };
+
+/* This is a big table of results we expect from generating and parsing */
+static struct ipv4_entry {
+ const char *addr;
+ ev_uint32_t res;
+ enum entry_status status;
+} ipv4_entries[] = {
+ { "1.2.3.4", 0x01020304u, CANONICAL },
+ { "255.255.255.255", 0xffffffffu, CANONICAL },
+ { "256.0.0.0", 0, BAD },
+ { "ABC", 0, BAD },
+ { "1.2.3.4.5", 0, BAD },
+ { "176.192.208.244", 0xb0c0d0f4, CANONICAL },
+ { NULL, 0, BAD },
+};
+
+static struct ipv6_entry {
+ const char *addr;
+ ev_uint32_t res[4];
+ enum entry_status status;
+} ipv6_entries[] = {
+ { "::", { 0, 0, 0, 0, }, CANONICAL },
+ { "0:0:0:0:0:0:0:0", { 0, 0, 0, 0, }, NORMAL },
+ { "::1", { 0, 0, 0, 1, }, CANONICAL },
+ { "::1.2.3.4", { 0, 0, 0, 0x01020304, }, CANONICAL },
+ { "ffff:1::", { 0xffff0001u, 0, 0, 0, }, CANONICAL },
+ { "ffff:0000::", { 0xffff0000u, 0, 0, 0, }, NORMAL },
+ { "ffff::1234", { 0xffff0000u, 0, 0, 0x1234, }, CANONICAL },
+ { "0102::1.2.3.4", {0x01020000u, 0, 0, 0x01020304u }, NORMAL },
+ { "::9:c0a8:1:1", { 0, 0, 0x0009c0a8u, 0x00010001u }, CANONICAL },
+ { "::ffff:1.2.3.4", { 0, 0, 0x000ffffu, 0x01020304u }, CANONICAL },
+ { "FFFF::", { 0xffff0000u, 0, 0, 0 }, NORMAL },
+ { "foobar.", { 0, 0, 0, 0 }, BAD },
+ { "foobar", { 0, 0, 0, 0 }, BAD },
+ { "fo:obar", { 0, 0, 0, 0 }, BAD },
+ { "ffff", { 0, 0, 0, 0 }, BAD },
+ { "fffff::", { 0, 0, 0, 0 }, BAD },
+ { "fffff::", { 0, 0, 0, 0 }, BAD },
+ { "::1.0.1.1000", { 0, 0, 0, 0 }, BAD },
+ { "1:2:33333:4::", { 0, 0, 0, 0 }, BAD },
+ { "1:2:3:4:5:6:7:8:9", { 0, 0, 0, 0 }, BAD },
+ { "1::2::3", { 0, 0, 0, 0 }, BAD },
+ { ":::1", { 0, 0, 0, 0 }, BAD },
+ { NULL, { 0, 0, 0, 0, }, BAD },
+};
+
+static void
+regress_ipv4_parse(void *ptr)
+{
+ int i;
+ for (i = 0; ipv4_entries[i].addr; ++i) {
+ char written[128];
+ struct ipv4_entry *ent = &ipv4_entries[i];
+ struct in_addr in;
+ int r;
+ r = evutil_inet_pton(AF_INET, ent->addr, &in);
+ if (r == 0) {
+ if (ent->status != BAD) {
+ TT_FAIL(("%s did not parse, but it's a good address!",
+ ent->addr));
+ }
+ continue;
+ }
+ if (ent->status == BAD) {
+ TT_FAIL(("%s parsed, but we expected an error", ent->addr));
+ continue;
+ }
+ if (ntohl(in.s_addr) != ent->res) {
+ TT_FAIL(("%s parsed to %lx, but we expected %lx", ent->addr,
+ (unsigned long)ntohl(in.s_addr),
+ (unsigned long)ent->res));
+ continue;
+ }
+ if (ent->status == CANONICAL) {
+ const char *w = evutil_inet_ntop(AF_INET, &in, written,
+ sizeof(written));
+ if (!w) {
+ TT_FAIL(("Tried to write out %s; got NULL.", ent->addr));
+ continue;
+ }
+ if (strcmp(written, ent->addr)) {
+ TT_FAIL(("Tried to write out %s; got %s",
+ ent->addr, written));
+ continue;
+ }
+ }
+
+ }
+
+}
+
+static void
+regress_ipv6_parse(void *ptr)
+{
+#ifdef AF_INET6
+ int i, j;
+
+ for (i = 0; ipv6_entries[i].addr; ++i) {
+ char written[128];
+ struct ipv6_entry *ent = &ipv6_entries[i];
+ struct in6_addr in6;
+ int r;
+ r = evutil_inet_pton(AF_INET6, ent->addr, &in6);
+ if (r == 0) {
+ if (ent->status != BAD)
+ TT_FAIL(("%s did not parse, but it's a good address!",
+ ent->addr));
+ continue;
+ }
+ if (ent->status == BAD) {
+ TT_FAIL(("%s parsed, but we expected an error", ent->addr));
+ continue;
+ }
+ for (j = 0; j < 4; ++j) {
+ /* Can't use s6_addr32 here; some don't have it. */
+ ev_uint32_t u =
+ (in6.s6_addr[j*4 ] << 24) |
+ (in6.s6_addr[j*4+1] << 16) |
+ (in6.s6_addr[j*4+2] << 8) |
+ (in6.s6_addr[j*4+3]);
+ if (u != ent->res[j]) {
+ TT_FAIL(("%s did not parse as expected.", ent->addr));
+ continue;
+ }
+ }
+ if (ent->status == CANONICAL) {
+ const char *w = evutil_inet_ntop(AF_INET6, &in6, written,
+ sizeof(written));
+ if (!w) {
+ TT_FAIL(("Tried to write out %s; got NULL.", ent->addr));
+ continue;
+ }
+ if (strcmp(written, ent->addr)) {
+ TT_FAIL(("Tried to write out %s; got %s", ent->addr, written));
+ continue;
+ }
+ }
+
+ }
+#else
+ TT_BLATHER(("Skipping IPv6 address parsing."));
+#endif
+}
+
+static struct sa_port_ent {
+ const char *parse;
+ int safamily;
+ const char *addr;
+ int port;
+} sa_port_ents[] = {
+ { "[ffff::1]:1000", AF_INET6, "ffff::1", 1000 },
+ { "[ffff::1]", AF_INET6, "ffff::1", 0 },
+ { "[ffff::1", 0, NULL, 0 },
+ { "[ffff::1]:65599", 0, NULL, 0 },
+ { "[ffff::1]:0", 0, NULL, 0 },
+ { "[ffff::1]:-1", 0, NULL, 0 },
+ { "::1", AF_INET6, "::1", 0 },
+ { "1:2::1", AF_INET6, "1:2::1", 0 },
+ { "192.168.0.1:50", AF_INET, "192.168.0.1", 50 },
+ { "1.2.3.4", AF_INET, "1.2.3.4", 0 },
+ { NULL, 0, NULL, 0 },
+};
+
+static void
+regress_sockaddr_port_parse(void *ptr)
+{
+ struct sockaddr_storage ss;
+ int i, r;
+
+ for (i = 0; sa_port_ents[i].parse; ++i) {
+ struct sa_port_ent *ent = &sa_port_ents[i];
+ int len = sizeof(ss);
+ memset(&ss, 0, sizeof(ss));
+ r = evutil_parse_sockaddr_port(ent->parse, (struct sockaddr*)&ss, &len);
+ if (r < 0) {
+ if (ent->safamily)
+ TT_FAIL(("Couldn't parse %s!", ent->parse));
+ continue;
+ } else if (! ent->safamily) {
+ TT_FAIL(("Shouldn't have been able to parse %s!", ent->parse));
+ continue;
+ }
+ if (ent->safamily == AF_INET) {
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
+ sin.sin_len = sizeof(sin);
+#endif
+ sin.sin_family = AF_INET;
+ sin.sin_port = htons(ent->port);
+ r = evutil_inet_pton(AF_INET, ent->addr, &sin.sin_addr);
+ if (1 != r) {
+ TT_FAIL(("Couldn't parse ipv4 target %s.", ent->addr));
+ } else if (memcmp(&sin, &ss, sizeof(sin))) {
+ TT_FAIL(("Parse for %s was not as expected.", ent->parse));
+ } else if (len != sizeof(sin)) {
+ TT_FAIL(("Length for %s not as expected.",ent->parse));
+ }
+ } else {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
+ sin6.sin6_len = sizeof(sin6);
+#endif
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = htons(ent->port);
+ r = evutil_inet_pton(AF_INET6, ent->addr, &sin6.sin6_addr);
+ if (1 != r) {
+ TT_FAIL(("Couldn't parse ipv6 target %s.", ent->addr));
+ } else if (memcmp(&sin6, &ss, sizeof(sin6))) {
+ TT_FAIL(("Parse for %s was not as expected.", ent->parse));
+ } else if (len != sizeof(sin6)) {
+ TT_FAIL(("Length for %s not as expected.",ent->parse));
+ }
+ }
+ }
+}
+
+
+static void
+regress_sockaddr_port_format(void *ptr)
+{
+ struct sockaddr_storage ss;
+ int len;
+ const char *cp;
+ char cbuf[128];
+ int r;
+
+ len = sizeof(ss);
+ r = evutil_parse_sockaddr_port("192.168.1.1:80",
+ (struct sockaddr*)&ss, &len);
+ tt_int_op(r,==,0);
+ cp = evutil_format_sockaddr_port_(
+ (struct sockaddr*)&ss, cbuf, sizeof(cbuf));
+ tt_ptr_op(cp,==,cbuf);
+ tt_str_op(cp,==,"192.168.1.1:80");
+
+ len = sizeof(ss);
+ r = evutil_parse_sockaddr_port("[ff00::8010]:999",
+ (struct sockaddr*)&ss, &len);
+ tt_int_op(r,==,0);
+ cp = evutil_format_sockaddr_port_(
+ (struct sockaddr*)&ss, cbuf, sizeof(cbuf));
+ tt_ptr_op(cp,==,cbuf);
+ tt_str_op(cp,==,"[ff00::8010]:999");
+
+ ss.ss_family=99;
+ cp = evutil_format_sockaddr_port_(
+ (struct sockaddr*)&ss, cbuf, sizeof(cbuf));
+ tt_ptr_op(cp,==,cbuf);
+ tt_str_op(cp,==,"<addr with socktype 99>");
+end:
+ ;
+}
+
+static struct sa_pred_ent {
+ const char *parse;
+
+ int is_loopback;
+} sa_pred_entries[] = {
+ { "127.0.0.1", 1 },
+ { "127.0.3.2", 1 },
+ { "128.1.2.3", 0 },
+ { "18.0.0.1", 0 },
+ { "129.168.1.1", 0 },
+
+ { "::1", 1 },
+ { "::0", 0 },
+ { "f::1", 0 },
+ { "::501", 0 },
+ { NULL, 0 },
+
+};
+
+static void
+test_evutil_sockaddr_predicates(void *ptr)
+{
+ struct sockaddr_storage ss;
+ int r, i;
+
+ for (i=0; sa_pred_entries[i].parse; ++i) {
+ struct sa_pred_ent *ent = &sa_pred_entries[i];
+ int len = sizeof(ss);
+
+ r = evutil_parse_sockaddr_port(ent->parse, (struct sockaddr*)&ss, &len);
+
+ if (r<0) {
+ TT_FAIL(("Couldn't parse %s!", ent->parse));
+ continue;
+ }
+
+ /* sockaddr_is_loopback */
+ if (ent->is_loopback != evutil_sockaddr_is_loopback_((struct sockaddr*)&ss)) {
+ TT_FAIL(("evutil_sockaddr_loopback(%s) not as expected",
+ ent->parse));
+ }
+ }
+}
+
+static void
+test_evutil_strtoll(void *ptr)
+{
+ const char *s;
+ char *endptr;
+
+ tt_want(evutil_strtoll("5000000000", NULL, 10) ==
+ ((ev_int64_t)5000000)*1000);
+ tt_want(evutil_strtoll("-5000000000", NULL, 10) ==
+ ((ev_int64_t)5000000)*-1000);
+ s = " 99999stuff";
+ tt_want(evutil_strtoll(s, &endptr, 10) == (ev_int64_t)99999);
+ tt_want(endptr == s+6);
+ tt_want(evutil_strtoll("foo", NULL, 10) == 0);
+ }
+
+static void
+test_evutil_snprintf(void *ptr)
+{
+ char buf[16];
+ int r;
+ ev_uint64_t u64 = ((ev_uint64_t)1000000000)*200;
+ ev_int64_t i64 = -1 * (ev_int64_t) u64;
+ size_t size = 8000;
+ ev_ssize_t ssize = -9000;
+
+ r = evutil_snprintf(buf, sizeof(buf), "%d %d", 50, 100);
+ tt_str_op(buf, ==, "50 100");
+ tt_int_op(r, ==, 6);
+
+ r = evutil_snprintf(buf, sizeof(buf), "longish %d", 1234567890);
+ tt_str_op(buf, ==, "longish 1234567");
+ tt_int_op(r, ==, 18);
+
+ r = evutil_snprintf(buf, sizeof(buf), EV_U64_FMT, EV_U64_ARG(u64));
+ tt_str_op(buf, ==, "200000000000");
+ tt_int_op(r, ==, 12);
+
+ r = evutil_snprintf(buf, sizeof(buf), EV_I64_FMT, EV_I64_ARG(i64));
+ tt_str_op(buf, ==, "-200000000000");
+ tt_int_op(r, ==, 13);
+
+ r = evutil_snprintf(buf, sizeof(buf), EV_SIZE_FMT" "EV_SSIZE_FMT,
+ EV_SIZE_ARG(size), EV_SSIZE_ARG(ssize));
+ tt_str_op(buf, ==, "8000 -9000");
+ tt_int_op(r, ==, 10);
+
+ end:
+ ;
+}
+
+static void
+test_evutil_casecmp(void *ptr)
+{
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "ABC"), ==, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "abc"), ==, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "abcd"), <, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABC", "abb"), >, 0);
+ tt_int_op(evutil_ascii_strcasecmp("ABCd", "abc"), >, 0);
+
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibEvEnT", 100), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibEvEnT", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibEXXXX", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libevent", "LibE", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Libe", "LibEvEnT", 4), ==, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Lib", "LibEvEnT", 4), <, 0);
+ tt_int_op(evutil_ascii_strncasecmp("abc", "def", 99), <, 0);
+ tt_int_op(evutil_ascii_strncasecmp("Z", "qrst", 1), >, 0);
+end:
+ ;
+}
+
+static void
+test_evutil_rtrim(void *ptr)
+{
+#define TEST_TRIM(s, result) \
+ do { \
+ if (cp) mm_free(cp); \
+ cp = mm_strdup(s); \
+ tt_assert(cp); \
+ evutil_rtrim_lws_(cp); \
+ tt_str_op(cp, ==, result); \
+ } while(0)
+
+ char *cp = NULL;
+ (void) ptr;
+
+ TEST_TRIM("", "");
+ TEST_TRIM("a", "a");
+ TEST_TRIM("abcdef ghi", "abcdef ghi");
+
+ TEST_TRIM(" ", "");
+ TEST_TRIM(" ", "");
+ TEST_TRIM("a ", "a");
+ TEST_TRIM("abcdef gH ", "abcdef gH");
+
+ TEST_TRIM("\t\t", "");
+ TEST_TRIM(" \t", "");
+ TEST_TRIM("\t", "");
+ TEST_TRIM("a \t", "a");
+ TEST_TRIM("a\t ", "a");
+ TEST_TRIM("a\t", "a");
+ TEST_TRIM("abcdef gH \t ", "abcdef gH");
+
+end:
+ if (cp)
+ mm_free(cp);
+}
+
+static int logsev = 0;
+static char *logmsg = NULL;
+
+static void
+logfn(int severity, const char *msg)
+{
+ logsev = severity;
+ tt_want(msg);
+ if (msg) {
+ if (logmsg)
+ free(logmsg);
+ logmsg = strdup(msg);
+ }
+}
+
+static int fatal_want_severity = 0;
+static const char *fatal_want_message = NULL;
+static void
+fatalfn(int exitcode)
+{
+ if (logsev != fatal_want_severity ||
+ !logmsg ||
+ strcmp(logmsg, fatal_want_message))
+ exit(0);
+ else
+ exit(exitcode);
+}
+
+#ifndef _WIN32
+#define CAN_CHECK_ERR
+static void
+check_error_logging(void (*fn)(void), int wantexitcode,
+ int wantseverity, const char *wantmsg)
+{
+ pid_t pid;
+ int status = 0, exitcode;
+ fatal_want_severity = wantseverity;
+ fatal_want_message = wantmsg;
+ if ((pid = regress_fork()) == 0) {
+ /* child process */
+ fn();
+ exit(0); /* should be unreachable. */
+ } else {
+ wait(&status);
+ exitcode = WEXITSTATUS(status);
+ tt_int_op(wantexitcode, ==, exitcode);
+ }
+end:
+ ;
+}
+
+static void
+errx_fn(void)
+{
+ event_errx(2, "Fatal error; too many kumquats (%d)", 5);
+}
+
+static void
+err_fn(void)
+{
+ errno = ENOENT;
+ event_err(5,"Couldn't open %s", "/very/bad/file");
+}
+
+static void
+sock_err_fn(void)
+{
+ evutil_socket_t fd = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef _WIN32
+ EVUTIL_SET_SOCKET_ERROR(WSAEWOULDBLOCK);
+#else
+ errno = EAGAIN;
+#endif
+ event_sock_err(20, fd, "Unhappy socket");
+}
+#endif
+
+static void
+test_evutil_log(void *ptr)
+{
+ evutil_socket_t fd = -1;
+ char buf[128];
+
+ event_set_log_callback(logfn);
+ event_set_fatal_callback(fatalfn);
+#define RESET() do { \
+ logsev = 0; \
+ if (logmsg) free(logmsg); \
+ logmsg = NULL; \
+ } while (0)
+#define LOGEQ(sev,msg) do { \
+ tt_int_op(logsev,==,sev); \
+ tt_assert(logmsg != NULL); \
+ tt_str_op(logmsg,==,msg); \
+ } while (0)
+
+#ifdef CAN_CHECK_ERR
+ /* We need to disable these tests for now. Previously, the logging
+ * module didn't enforce the requirement that a fatal callback
+ * actually exit. Now, it exits no matter what, so if we wan to
+ * reinstate these tests, we'll need to fork for each one. */
+ check_error_logging(errx_fn, 2, EVENT_LOG_ERR,
+ "Fatal error; too many kumquats (5)");
+ RESET();
+#endif
+
+ event_warnx("Far too many %s (%d)", "wombats", 99);
+ LOGEQ(EVENT_LOG_WARN, "Far too many wombats (99)");
+ RESET();
+
+ event_msgx("Connecting lime to coconut");
+ LOGEQ(EVENT_LOG_MSG, "Connecting lime to coconut");
+ RESET();
+
+ event_debug(("A millisecond passed! We should log that!"));
+#ifdef USE_DEBUG
+ LOGEQ(EVENT_LOG_DEBUG, "A millisecond passed! We should log that!");
+#else
+ tt_int_op(logsev,==,0);
+ tt_ptr_op(logmsg,==,NULL);
+#endif
+ RESET();
+
+ /* Try with an errno. */
+ errno = ENOENT;
+ event_warn("Couldn't open %s", "/bad/file");
+ evutil_snprintf(buf, sizeof(buf),
+ "Couldn't open /bad/file: %s",strerror(ENOENT));
+ LOGEQ(EVENT_LOG_WARN,buf);
+ RESET();
+
+#ifdef CAN_CHECK_ERR
+ evutil_snprintf(buf, sizeof(buf),
+ "Couldn't open /very/bad/file: %s",strerror(ENOENT));
+ check_error_logging(err_fn, 5, EVENT_LOG_ERR, buf);
+ RESET();
+#endif
+
+ /* Try with a socket errno. */
+ fd = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef _WIN32
+ evutil_snprintf(buf, sizeof(buf),
+ "Unhappy socket: %s",
+ evutil_socket_error_to_string(WSAEWOULDBLOCK));
+ EVUTIL_SET_SOCKET_ERROR(WSAEWOULDBLOCK);
+#else
+ evutil_snprintf(buf, sizeof(buf),
+ "Unhappy socket: %s", strerror(EAGAIN));
+ errno = EAGAIN;
+#endif
+ event_sock_warn(fd, "Unhappy socket");
+ LOGEQ(EVENT_LOG_WARN, buf);
+ RESET();
+
+#ifdef CAN_CHECK_ERR
+ check_error_logging(sock_err_fn, 20, EVENT_LOG_ERR, buf);
+ RESET();
+#endif
+
+#undef RESET
+#undef LOGEQ
+end:
+ if (logmsg)
+ free(logmsg);
+ if (fd >= 0)
+ evutil_closesocket(fd);
+}
+
+static void
+test_evutil_strlcpy(void *arg)
+{
+ char buf[8];
+
+ /* Successful case. */
+ tt_int_op(5, ==, strlcpy(buf, "Hello", sizeof(buf)));
+ tt_str_op(buf, ==, "Hello");
+
+ /* Overflow by a lot. */
+ tt_int_op(13, ==, strlcpy(buf, "pentasyllabic", sizeof(buf)));
+ tt_str_op(buf, ==, "pentasy");
+
+ /* Overflow by exactly one. */
+ tt_int_op(8, ==, strlcpy(buf, "overlong", sizeof(buf)));
+ tt_str_op(buf, ==, "overlon");
+end:
+ ;
+}
+
+struct example_struct {
+ const char *a;
+ const char *b;
+ long c;
+};
+
+static void
+test_evutil_upcast(void *arg)
+{
+ struct example_struct es1;
+ const char **cp;
+ es1.a = "World";
+ es1.b = "Hello";
+ es1.c = -99;
+
+ tt_int_op(evutil_offsetof(struct example_struct, b), ==, sizeof(char*));
+
+ cp = &es1.b;
+ tt_ptr_op(EVUTIL_UPCAST(cp, struct example_struct, b), ==, &es1);
+
+end:
+ ;
+}
+
+static void
+test_evutil_integers(void *arg)
+{
+ ev_int64_t i64;
+ ev_uint64_t u64;
+ ev_int32_t i32;
+ ev_uint32_t u32;
+ ev_int16_t i16;
+ ev_uint16_t u16;
+ ev_int8_t i8;
+ ev_uint8_t u8;
+
+ void *ptr;
+ ev_intptr_t iptr;
+ ev_uintptr_t uptr;
+
+ ev_ssize_t ssize;
+
+ tt_int_op(sizeof(u64), ==, 8);
+ tt_int_op(sizeof(i64), ==, 8);
+ tt_int_op(sizeof(u32), ==, 4);
+ tt_int_op(sizeof(i32), ==, 4);
+ tt_int_op(sizeof(u16), ==, 2);
+ tt_int_op(sizeof(i16), ==, 2);
+ tt_int_op(sizeof(u8), ==, 1);
+ tt_int_op(sizeof(i8), ==, 1);
+
+ tt_int_op(sizeof(ev_ssize_t), ==, sizeof(size_t));
+ tt_int_op(sizeof(ev_intptr_t), >=, sizeof(void *));
+ tt_int_op(sizeof(ev_uintptr_t), ==, sizeof(intptr_t));
+
+ u64 = 1000000000;
+ u64 *= 1000000000;
+ tt_assert(u64 / 1000000000 == 1000000000);
+ i64 = -1000000000;
+ i64 *= 1000000000;
+ tt_assert(i64 / 1000000000 == -1000000000);
+
+ u64 = EV_UINT64_MAX;
+ i64 = EV_INT64_MAX;
+ tt_assert(u64 > 0);
+ tt_assert(i64 > 0);
+ u64++;
+ i64++;
+ tt_assert(u64 == 0);
+ tt_assert(i64 == EV_INT64_MIN);
+ tt_assert(i64 < 0);
+
+ u32 = EV_UINT32_MAX;
+ i32 = EV_INT32_MAX;
+ tt_assert(u32 > 0);
+ tt_assert(i32 > 0);
+ u32++;
+ i32++;
+ tt_assert(u32 == 0);
+ tt_assert(i32 == EV_INT32_MIN);
+ tt_assert(i32 < 0);
+
+ u16 = EV_UINT16_MAX;
+ i16 = EV_INT16_MAX;
+ tt_assert(u16 > 0);
+ tt_assert(i16 > 0);
+ u16++;
+ i16++;
+ tt_assert(u16 == 0);
+ tt_assert(i16 == EV_INT16_MIN);
+ tt_assert(i16 < 0);
+
+ u8 = EV_UINT8_MAX;
+ i8 = EV_INT8_MAX;
+ tt_assert(u8 > 0);
+ tt_assert(i8 > 0);
+ u8++;
+ i8++;
+ tt_assert(u8 == 0);
+ tt_assert(i8 == EV_INT8_MIN);
+ tt_assert(i8 < 0);
+
+ ssize = EV_SSIZE_MAX;
+ tt_assert(ssize > 0);
+ ssize++;
+ tt_assert(ssize < 0);
+ tt_assert(ssize == EV_SSIZE_MIN);
+
+ ptr = &ssize;
+ iptr = (ev_intptr_t)ptr;
+ uptr = (ev_uintptr_t)ptr;
+ ptr = (void *)iptr;
+ tt_assert(ptr == &ssize);
+ ptr = (void *)uptr;
+ tt_assert(ptr == &ssize);
+
+ iptr = -1;
+ tt_assert(iptr < 0);
+end:
+ ;
+}
+
+struct evutil_addrinfo *
+ai_find_by_family(struct evutil_addrinfo *ai, int family)
+{
+ while (ai) {
+ if (ai->ai_family == family)
+ return ai;
+ ai = ai->ai_next;
+ }
+ return NULL;
+}
+
+struct evutil_addrinfo *
+ai_find_by_protocol(struct evutil_addrinfo *ai, int protocol)
+{
+ while (ai) {
+ if (ai->ai_protocol == protocol)
+ return ai;
+ ai = ai->ai_next;
+ }
+ return NULL;
+}
+
+
+int
+test_ai_eq_(const struct evutil_addrinfo *ai, const char *sockaddr_port,
+ int socktype, int protocol, int line)
+{
+ struct sockaddr_storage ss;
+ int slen = sizeof(ss);
+ int gotport;
+ char buf[128];
+ memset(&ss, 0, sizeof(ss));
+ if (socktype > 0)
+ tt_int_op(ai->ai_socktype, ==, socktype);
+ if (protocol > 0)
+ tt_int_op(ai->ai_protocol, ==, protocol);
+
+ if (evutil_parse_sockaddr_port(
+ sockaddr_port, (struct sockaddr*)&ss, &slen)<0) {
+ TT_FAIL(("Couldn't parse expected address %s on line %d",
+ sockaddr_port, line));
+ return -1;
+ }
+ if (ai->ai_family != ss.ss_family) {
+ TT_FAIL(("Address family %d did not match %d on line %d",
+ ai->ai_family, ss.ss_family, line));
+ return -1;
+ }
+ if (ai->ai_addr->sa_family == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in*)ai->ai_addr;
+ evutil_inet_ntop(AF_INET, &sin->sin_addr, buf, sizeof(buf));
+ gotport = ntohs(sin->sin_port);
+ if (ai->ai_addrlen != sizeof(struct sockaddr_in)) {
+ TT_FAIL(("Addr size mismatch on line %d", line));
+ return -1;
+ }
+ } else {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)ai->ai_addr;
+ evutil_inet_ntop(AF_INET6, &sin6->sin6_addr, buf, sizeof(buf));
+ gotport = ntohs(sin6->sin6_port);
+ if (ai->ai_addrlen != sizeof(struct sockaddr_in6)) {
+ TT_FAIL(("Addr size mismatch on line %d", line));
+ return -1;
+ }
+ }
+ if (evutil_sockaddr_cmp(ai->ai_addr, (struct sockaddr*)&ss, 1)) {
+ TT_FAIL(("Wanted %s, got %s:%d on line %d", sockaddr_port,
+ buf, gotport, line));
+ return -1;
+ } else {
+ TT_BLATHER(("Wanted %s, got %s:%d on line %d", sockaddr_port,
+ buf, gotport, line));
+ }
+ return 0;
+end:
+ TT_FAIL(("Test failed on line %d", line));
+ return -1;
+}
+
+static void
+test_evutil_rand(void *arg)
+{
+ char buf1[32];
+ char buf2[32];
+ int counts[256];
+ int i, j, k, n=0;
+ struct evutil_weakrand_state seed = { 12346789U };
+
+ memset(buf2, 0, sizeof(buf2));
+ memset(counts, 0, sizeof(counts));
+
+ for (k=0;k<32;++k) {
+ /* Try a few different start and end points; try to catch
+ * the various misaligned cases of arc4random_buf */
+ int startpoint = evutil_weakrand_(&seed) % 4;
+ int endpoint = 32 - (evutil_weakrand_(&seed) % 4);
+
+ memset(buf2, 0, sizeof(buf2));
+
+ /* Do 6 runs over buf1, or-ing the result into buf2 each
+ * time, to make sure we're setting each byte that we mean
+ * to set. */
+ for (i=0;i<8;++i) {
+ memset(buf1, 0, sizeof(buf1));
+ evutil_secure_rng_get_bytes(buf1 + startpoint,
+ endpoint-startpoint);
+ n += endpoint - startpoint;
+ for (j=0; j<32; ++j) {
+ if (j >= startpoint && j < endpoint) {
+ buf2[j] |= buf1[j];
+ ++counts[(unsigned char)buf1[j]];
+ } else {
+ tt_assert(buf1[j] == 0);
+ tt_int_op(buf1[j], ==, 0);
+
+ }
+ }
+ }
+
+ /* This will give a false positive with P=(256**8)==(2**64)
+ * for each character. */
+ for (j=startpoint;j<endpoint;++j) {
+ tt_int_op(buf2[j], !=, 0);
+ }
+ }
+
+ evutil_weakrand_seed_(&seed, 0);
+ for (i = 0; i < 10000; ++i) {
+ ev_int32_t r = evutil_weakrand_range_(&seed, 9999);
+ tt_int_op(0, <=, r);
+ tt_int_op(r, <, 9999);
+ }
+
+ /* for (i=0;i<256;++i) { printf("%3d %2d\n", i, counts[i]); } */
+end:
+ ;
+}
+
+static void
+test_evutil_getaddrinfo(void *arg)
+{
+ struct evutil_addrinfo *ai = NULL, *a;
+ struct evutil_addrinfo hints;
+ int r;
+
+ /* Try using it as a pton. */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evutil_getaddrinfo("1.2.3.4", "8080", &hints, &ai);
+ tt_int_op(r, ==, 0);
+ tt_assert(ai);
+ tt_ptr_op(ai->ai_next, ==, NULL); /* no ambiguity */
+ test_ai_eq(ai, "1.2.3.4:8080", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_protocol = IPPROTO_UDP;
+ r = evutil_getaddrinfo("1001:b0b::f00f", "4321", &hints, &ai);
+ tt_int_op(r, ==, 0);
+ tt_assert(ai);
+ tt_ptr_op(ai->ai_next, ==, NULL); /* no ambiguity */
+ test_ai_eq(ai, "[1001:b0b::f00f]:4321", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Try out the behavior of nodename=NULL */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_INET;
+ hints.ai_protocol = IPPROTO_TCP;
+ hints.ai_flags = EVUTIL_AI_PASSIVE; /* as if for bind */
+ r = evutil_getaddrinfo(NULL, "9999", &hints, &ai);
+ tt_int_op(r,==,0);
+ tt_assert(ai);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ test_ai_eq(ai, "0.0.0.0:9999", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+ hints.ai_flags = 0; /* as if for connect */
+ r = evutil_getaddrinfo(NULL, "9998", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ test_ai_eq(ai, "127.0.0.1:9998", SOCK_STREAM, IPPROTO_TCP);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ hints.ai_flags = 0; /* as if for connect */
+ hints.ai_family = PF_INET6;
+ r = evutil_getaddrinfo(NULL, "9997", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ test_ai_eq(ai, "[::1]:9997", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ hints.ai_flags = EVUTIL_AI_PASSIVE; /* as if for bind. */
+ hints.ai_family = PF_INET6;
+ r = evutil_getaddrinfo(NULL, "9996", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ tt_ptr_op(ai->ai_next, ==, NULL);
+ test_ai_eq(ai, "[::]:9996", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Now try an unspec one. We should get a v6 and a v4. */
+ hints.ai_family = PF_UNSPEC;
+ r = evutil_getaddrinfo(NULL, "9996", &hints, &ai);
+ tt_assert(ai);
+ tt_int_op(r,==,0);
+ a = ai_find_by_family(ai, PF_INET6);
+ tt_assert(a);
+ test_ai_eq(a, "[::]:9996", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_family(ai, PF_INET);
+ tt_assert(a);
+ test_ai_eq(a, "0.0.0.0:9996", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Try out AI_NUMERICHOST: successful case. Also try
+ * multiprotocol. */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = EVUTIL_AI_NUMERICHOST;
+ r = evutil_getaddrinfo("1.2.3.4", NULL, &hints, &ai);
+ tt_int_op(r, ==, 0);
+ a = ai_find_by_protocol(ai, IPPROTO_TCP);
+ tt_assert(a);
+ test_ai_eq(a, "1.2.3.4", SOCK_STREAM, IPPROTO_TCP);
+ a = ai_find_by_protocol(ai, IPPROTO_UDP);
+ tt_assert(a);
+ test_ai_eq(a, "1.2.3.4", SOCK_DGRAM, IPPROTO_UDP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+
+ /* Try the failing case of AI_NUMERICHOST */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_flags = EVUTIL_AI_NUMERICHOST;
+ r = evutil_getaddrinfo("www.google.com", "80", &hints, &ai);
+ tt_int_op(r, ==, EVUTIL_EAI_NONAME);
+ tt_ptr_op(ai, ==, NULL);
+
+ /* Try symbolic service names wit AI_NUMERICSERV */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = EVUTIL_AI_NUMERICSERV;
+ r = evutil_getaddrinfo("1.2.3.4", "http", &hints, &ai);
+ tt_int_op(r,==,EVUTIL_EAI_NONAME);
+
+ /* Try symbolic service names */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evutil_getaddrinfo("1.2.3.4", "http", &hints, &ai);
+ if (r!=0) {
+ TT_DECLARE("SKIP", ("Symbolic service names seem broken."));
+ } else {
+ tt_assert(ai);
+ test_ai_eq(ai, "1.2.3.4:80", SOCK_STREAM, IPPROTO_TCP);
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+ }
+
+end:
+ if (ai)
+ evutil_freeaddrinfo(ai);
+}
+
+static void
+test_evutil_getaddrinfo_live(void *arg)
+{
+ struct evutil_addrinfo *ai = NULL;
+ struct evutil_addrinfo hints;
+
+ struct sockaddr_in6 *sin6;
+ struct sockaddr_in *sin;
+ char buf[128];
+ const char *cp;
+ int r;
+
+ /* Now do some actual lookups. */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_INET;
+ hints.ai_protocol = IPPROTO_TCP;
+ hints.ai_socktype = SOCK_STREAM;
+ r = evutil_getaddrinfo("www.google.com", "80", &hints, &ai);
+ if (r != 0) {
+ TT_DECLARE("SKIP", ("Couldn't resolve www.google.com"));
+ } else {
+ tt_assert(ai);
+ tt_int_op(ai->ai_family, ==, PF_INET);
+ tt_int_op(ai->ai_protocol, ==, IPPROTO_TCP);
+ tt_int_op(ai->ai_socktype, ==, SOCK_STREAM);
+ tt_int_op(ai->ai_addrlen, ==, sizeof(struct sockaddr_in));
+ sin = (struct sockaddr_in*)ai->ai_addr;
+ tt_int_op(sin->sin_family, ==, AF_INET);
+ tt_int_op(sin->sin_port, ==, htons(80));
+ tt_int_op(sin->sin_addr.s_addr, !=, 0xffffffff);
+
+ cp = evutil_inet_ntop(AF_INET, &sin->sin_addr, buf, sizeof(buf));
+ TT_BLATHER(("www.google.com resolved to %s",
+ cp?cp:"<unwriteable>"));
+ evutil_freeaddrinfo(ai);
+ ai = NULL;
+ }
+
+ hints.ai_family = PF_INET6;
+ r = evutil_getaddrinfo("ipv6.google.com", "80", &hints, &ai);
+ if (r != 0) {
+ TT_BLATHER(("Couldn't do an ipv6 lookup for ipv6.google.com"));
+ } else {
+ tt_assert(ai);
+ tt_int_op(ai->ai_family, ==, PF_INET6);
+ tt_int_op(ai->ai_addrlen, ==, sizeof(struct sockaddr_in6));
+ sin6 = (struct sockaddr_in6*)ai->ai_addr;
+ tt_int_op(sin6->sin6_port, ==, htons(80));
+
+ cp = evutil_inet_ntop(AF_INET6, &sin6->sin6_addr, buf,
+ sizeof(buf));
+ TT_BLATHER(("ipv6.google.com resolved to %s",
+ cp?cp:"<unwriteable>"));
+ }
+
+end:
+ if (ai)
+ evutil_freeaddrinfo(ai);
+}
+
+#ifdef _WIN32
+static void
+test_evutil_loadsyslib(void *arg)
+{
+ HANDLE h=NULL;
+
+ h = evutil_load_windows_system_library_(TEXT("kernel32.dll"));
+ tt_assert(h);
+
+end:
+ if (h)
+ CloseHandle(h);
+
+}
+#endif
+
+/** Test mm_malloc(). */
+static void
+test_event_malloc(void *arg)
+{
+ void *p = NULL;
+ (void)arg;
+
+ /* mm_malloc(0) should simply return NULL. */
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ errno = 0;
+ p = mm_malloc(0);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+#endif
+
+ /* Trivial case. */
+ errno = 0;
+ p = mm_malloc(8);
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ mm_free(p);
+
+ end:
+ errno = 0;
+ return;
+}
+
+static void
+test_event_calloc(void *arg)
+{
+ void *p = NULL;
+ (void)arg;
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ /* mm_calloc() should simply return NULL
+ * if either argument is zero. */
+ errno = 0;
+ p = mm_calloc(0, 0);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+ errno = 0;
+ p = mm_calloc(0, 1);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+ errno = 0;
+ p = mm_calloc(1, 0);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, 0);
+#endif
+
+ /* Trivial case. */
+ errno = 0;
+ p = mm_calloc(8, 8);
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ mm_free(p);
+ p = NULL;
+
+ /* mm_calloc() should set errno = ENOMEM and return NULL
+ * in case of potential overflow. */
+ errno = 0;
+ p = mm_calloc(EV_SIZE_MAX/2, EV_SIZE_MAX/2 + 8);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, ENOMEM);
+
+ end:
+ errno = 0;
+ if (p)
+ mm_free(p);
+
+ return;
+}
+
+static void
+test_event_strdup(void *arg)
+{
+ void *p = NULL;
+ (void)arg;
+
+#ifndef EVENT__DISABLE_MM_REPLACEMENT
+ /* mm_strdup(NULL) should set errno = EINVAL and return NULL. */
+ errno = 0;
+ p = mm_strdup(NULL);
+ tt_assert(p == NULL);
+ tt_int_op(errno, ==, EINVAL);
+#endif
+
+ /* Trivial cases. */
+
+ errno = 0;
+ p = mm_strdup("");
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ tt_str_op(p, ==, "");
+ mm_free(p);
+
+ errno = 0;
+ p = mm_strdup("foo");
+ tt_assert(p != NULL);
+ tt_int_op(errno, ==, 0);
+ tt_str_op(p, ==, "foo");
+ mm_free(p);
+
+ /* XXX
+ * mm_strdup(str) where str is a string of length EV_SIZE_MAX
+ * should set errno = ENOMEM and return NULL. */
+
+ end:
+ errno = 0;
+ return;
+}
+
+static void
+test_evutil_usleep(void *arg)
+{
+ struct timeval tv1, tv2, tv3, diff1, diff2;
+ const struct timeval quarter_sec = {0, 250*1000};
+ const struct timeval tenth_sec = {0, 100*1000};
+ long usec1, usec2;
+
+ evutil_gettimeofday(&tv1, NULL);
+ evutil_usleep_(&quarter_sec);
+ evutil_gettimeofday(&tv2, NULL);
+ evutil_usleep_(&tenth_sec);
+ evutil_gettimeofday(&tv3, NULL);
+
+ evutil_timersub(&tv2, &tv1, &diff1);
+ evutil_timersub(&tv3, &tv2, &diff2);
+ usec1 = diff1.tv_sec * 1000000 + diff1.tv_usec;
+ usec2 = diff2.tv_sec * 1000000 + diff2.tv_usec;
+
+ tt_int_op(usec1, >, 200000);
+ tt_int_op(usec1, <, 300000);
+ tt_int_op(usec2, >, 80000);
+ tt_int_op(usec2, <, 120000);
+
+end:
+ ;
+}
+
+static void
+test_evutil_monotonic_res(void *data_)
+{
+ /* Basic santity-test for monotonic timers. What we'd really like
+ * to do is make sure that they can't go backwards even when the
+ * system clock goes backwards. But we haven't got a good way to
+ * move the system clock backwards.
+ */
+ struct basic_test_data *data = data_;
+ struct evutil_monotonic_timer timer;
+ const int precise = strstr(data->setup_data, "precise") != NULL;
+ const int fallback = strstr(data->setup_data, "fallback") != NULL;
+ struct timeval tv[10], delay;
+ int total_diff = 0;
+
+ int flags = 0, wantres, acceptdiff, i;
+ if (precise)
+ flags |= EV_MONOT_PRECISE;
+ if (fallback)
+ flags |= EV_MONOT_FALLBACK;
+ if (precise || fallback) {
+#ifdef _WIN32
+ wantres = 10*1000;
+ acceptdiff = 1000;
+#else
+ wantres = 1000;
+ acceptdiff = 300;
+#endif
+ } else {
+ wantres = 40*1000;
+ acceptdiff = 20*1000;
+ }
+
+ TT_BLATHER(("Precise = %d", precise));
+ TT_BLATHER(("Fallback = %d", fallback));
+
+ /* First, make sure we match up with usleep. */
+
+ delay.tv_sec = 0;
+ delay.tv_usec = wantres;
+
+ tt_int_op(evutil_configure_monotonic_time_(&timer, flags), ==, 0);
+
+ for (i = 0; i < 10; ++i) {
+ evutil_gettime_monotonic_(&timer, &tv[i]);
+ evutil_usleep_(&delay);
+ }
+
+ for (i = 0; i < 9; ++i) {
+ struct timeval diff;
+ tt_assert(evutil_timercmp(&tv[i], &tv[i+1], <));
+ evutil_timersub(&tv[i+1], &tv[i], &diff);
+ tt_int_op(diff.tv_sec, ==, 0);
+ total_diff += diff.tv_usec;
+ TT_BLATHER(("Difference = %d", (int)diff.tv_usec));
+ }
+ tt_int_op(abs(total_diff/9 - wantres), <, acceptdiff);
+
+end:
+ ;
+}
+
+static void
+test_evutil_monotonic_prc(void *data_)
+{
+ struct basic_test_data *data = data_;
+ struct evutil_monotonic_timer timer;
+ const int precise = strstr(data->setup_data, "precise") != NULL;
+ const int fallback = strstr(data->setup_data, "fallback") != NULL;
+ struct timeval tv[10];
+ int total_diff = 0;
+ int i, maxstep = 25*1000,flags=0;
+ if (precise)
+ maxstep = 500;
+ if (precise)
+ flags |= EV_MONOT_PRECISE;
+ if (fallback)
+ flags |= EV_MONOT_FALLBACK;
+ tt_int_op(evutil_configure_monotonic_time_(&timer, flags), ==, 0);
+
+ /* find out what precision we actually see. */
+
+ evutil_gettime_monotonic_(&timer, &tv[0]);
+ for (i = 1; i < 10; ++i) {
+ do {
+ evutil_gettime_monotonic_(&timer, &tv[i]);
+ } while (evutil_timercmp(&tv[i-1], &tv[i], ==));
+ }
+
+ total_diff = 0;
+ for (i = 0; i < 9; ++i) {
+ struct timeval diff;
+ tt_assert(evutil_timercmp(&tv[i], &tv[i+1], <));
+ evutil_timersub(&tv[i+1], &tv[i], &diff);
+ tt_int_op(diff.tv_sec, ==, 0);
+ total_diff += diff.tv_usec;
+ TT_BLATHER(("Step difference = %d", (int)diff.tv_usec));
+ }
+ TT_BLATHER(("Average step difference = %d", total_diff / 9));
+ tt_int_op(total_diff/9, <, maxstep);
+
+end:
+ ;
+}
+
+struct testcase_t util_testcases[] = {
+ { "ipv4_parse", regress_ipv4_parse, 0, NULL, NULL },
+ { "ipv6_parse", regress_ipv6_parse, 0, NULL, NULL },
+ { "sockaddr_port_parse", regress_sockaddr_port_parse, 0, NULL, NULL },
+ { "sockaddr_port_format", regress_sockaddr_port_format, 0, NULL, NULL },
+ { "sockaddr_predicates", test_evutil_sockaddr_predicates, 0,NULL,NULL },
+ { "evutil_snprintf", test_evutil_snprintf, 0, NULL, NULL },
+ { "evutil_strtoll", test_evutil_strtoll, 0, NULL, NULL },
+ { "evutil_casecmp", test_evutil_casecmp, 0, NULL, NULL },
+ { "evutil_rtrim", test_evutil_rtrim, 0, NULL, NULL },
+ { "strlcpy", test_evutil_strlcpy, 0, NULL, NULL },
+ { "log", test_evutil_log, TT_FORK, NULL, NULL },
+ { "upcast", test_evutil_upcast, 0, NULL, NULL },
+ { "integers", test_evutil_integers, 0, NULL, NULL },
+ { "rand", test_evutil_rand, TT_FORK, NULL, NULL },
+ { "getaddrinfo", test_evutil_getaddrinfo, TT_FORK, NULL, NULL },
+ { "getaddrinfo_live", test_evutil_getaddrinfo_live, TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL },
+#ifdef _WIN32
+ { "loadsyslib", test_evutil_loadsyslib, TT_FORK, NULL, NULL },
+#endif
+ { "mm_malloc", test_event_malloc, 0, NULL, NULL },
+ { "mm_calloc", test_event_calloc, 0, NULL, NULL },
+ { "mm_strdup", test_event_strdup, 0, NULL, NULL },
+ { "usleep", test_evutil_usleep, 0, NULL, NULL },
+ { "monotonic_res", test_evutil_monotonic_res, 0, &basic_setup, (void*)"" },
+ { "monotonic_res_precise", test_evutil_monotonic_res, TT_OFF_BY_DEFAULT, &basic_setup, (void*)"precise" },
+ { "monotonic_res_fallback", test_evutil_monotonic_res, TT_OFF_BY_DEFAULT, &basic_setup, (void*)"fallback" },
+ { "monotonic_prc", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"" },
+ { "monotonic_prc_precise", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"precise" },
+ { "monotonic_prc_fallback", test_evutil_monotonic_prc, 0, &basic_setup, (void*)"fallback" },
+ END_OF_TESTCASES,
+};
+
diff --git a/sntp/libevent/test/regress_zlib.c b/sntp/libevent/test/regress_zlib.c
new file mode 100644
index 0000000..9339397
--- /dev/null
+++ b/sntp/libevent/test/regress_zlib.c
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2008-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* The old tests here need assertions to work. */
+#undef NDEBUG
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#ifndef _WIN32
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <netdb.h>
+#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <assert.h>
+#include <errno.h>
+
+#include "event2/util.h"
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/buffer.h"
+#include "event2/bufferevent.h"
+
+#include "regress.h"
+
+/* zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of
+ saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory
+ that nobody will care if the compile outputs a no-such-identifier warning.
+
+ Sorry, but we like -Werror over here, so I guess we need to define these.
+ I hope that zlib 1.2.6 doesn't break these too.
+*/
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 0
+#endif
+#ifndef _LFS64_LARGEFILE
+#define _LFS64_LARGEFILE 0
+#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 0
+#endif
+#ifndef off64_t
+#define off64_t ev_int64_t
+#endif
+
+#include <zlib.h>
+
+static int infilter_calls;
+static int outfilter_calls;
+static int readcb_finished;
+static int writecb_finished;
+static int errorcb_invoked;
+
+/*
+ * Zlib filters
+ */
+
+static void
+zlib_deflate_free(void *ctx)
+{
+ z_streamp p = ctx;
+
+ assert(deflateEnd(p) == Z_OK);
+}
+
+static void
+zlib_inflate_free(void *ctx)
+{
+ z_streamp p = ctx;
+
+ assert(inflateEnd(p) == Z_OK);
+}
+
+static int
+getstate(enum bufferevent_flush_mode state)
+{
+ switch (state) {
+ case BEV_FINISHED:
+ return Z_FINISH;
+ case BEV_FLUSH:
+ return Z_SYNC_FLUSH;
+ case BEV_NORMAL:
+ default:
+ return Z_NO_FLUSH;
+ }
+}
+
+/*
+ * The input filter is triggered only on new input read from the network.
+ * That means all input data needs to be consumed or the filter needs to
+ * initiate its own triggering via a timeout.
+ */
+static enum bufferevent_filter_result
+zlib_input_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ struct evbuffer_iovec v_in[1];
+ struct evbuffer_iovec v_out[1];
+ int nread, nwrite;
+ int res, n;
+
+ z_streamp p = ctx;
+
+ do {
+ /* let's do some decompression */
+ n = evbuffer_peek(src, -1, NULL, v_in, 1);
+ if (n) {
+ p->avail_in = v_in[0].iov_len;
+ p->next_in = v_in[0].iov_base;
+ } else {
+ p->avail_in = 0;
+ p->next_in = 0;
+ }
+
+ evbuffer_reserve_space(dst, 4096, v_out, 1);
+ p->next_out = v_out[0].iov_base;
+ p->avail_out = v_out[0].iov_len;
+
+ /* we need to flush zlib if we got a flush */
+ res = inflate(p, getstate(state));
+
+ /* let's figure out how much was compressed */
+ nread = v_in[0].iov_len - p->avail_in;
+ nwrite = v_out[0].iov_len - p->avail_out;
+
+ evbuffer_drain(src, nread);
+ v_out[0].iov_len = nwrite;
+ evbuffer_commit_space(dst, v_out, 1);
+
+ if (res==Z_BUF_ERROR) {
+ /* We're out of space, or out of decodeable input.
+ Only if nwrite == 0 assume the latter.
+ */
+ if (nwrite == 0)
+ return BEV_NEED_MORE;
+ } else {
+ assert(res == Z_OK || res == Z_STREAM_END);
+ }
+
+ } while (evbuffer_get_length(src) > 0);
+
+ ++infilter_calls;
+
+ return (BEV_OK);
+}
+
+static enum bufferevent_filter_result
+zlib_output_filter(struct evbuffer *src, struct evbuffer *dst,
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+{
+ struct evbuffer_iovec v_in[1];
+ struct evbuffer_iovec v_out[1];
+ int nread, nwrite;
+ int res, n;
+
+ z_streamp p = ctx;
+
+ do {
+ /* let's do some compression */
+ n = evbuffer_peek(src, -1, NULL, v_in, 1);
+ if (n) {
+ p->avail_in = v_in[0].iov_len;
+ p->next_in = v_in[0].iov_base;
+ } else {
+ p->avail_in = 0;
+ p->next_in = 0;
+ }
+
+ evbuffer_reserve_space(dst, 4096, v_out, 1);
+ p->next_out = v_out[0].iov_base;
+ p->avail_out = v_out[0].iov_len;
+
+ /* we need to flush zlib if we got a flush */
+ res = deflate(p, getstate(state));
+
+ /* let's figure out how much was decompressed */
+ nread = v_in[0].iov_len - p->avail_in;
+ nwrite = v_out[0].iov_len - p->avail_out;
+
+ evbuffer_drain(src, nread);
+ v_out[0].iov_len = nwrite;
+ evbuffer_commit_space(dst, v_out, 1);
+
+ if (res==Z_BUF_ERROR) {
+ /* We're out of space, or out of decodeable input.
+ Only if nwrite == 0 assume the latter.
+ */
+ if (nwrite == 0)
+ return BEV_NEED_MORE;
+ } else {
+ assert(res == Z_OK || res == Z_STREAM_END);
+ }
+
+ } while (evbuffer_get_length(src) > 0);
+
+ ++outfilter_calls;
+
+ return (BEV_OK);
+}
+
+/*
+ * simple bufferevent test (over transparent zlib treatment)
+ */
+
+static void
+readcb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_input(bev)) == 8333) {
+ struct evbuffer *evbuf = evbuffer_new();
+ assert(evbuf != NULL);
+
+ /* gratuitous test of bufferevent_read_buffer */
+ bufferevent_read_buffer(bev, evbuf);
+
+ bufferevent_disable(bev, EV_READ);
+
+ if (evbuffer_get_length(evbuf) == 8333) {
+ ++readcb_finished;
+ }
+
+ evbuffer_free(evbuf);
+ }
+}
+
+static void
+writecb(struct bufferevent *bev, void *arg)
+{
+ if (evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
+ ++writecb_finished;
+ }
+}
+
+static void
+errorcb(struct bufferevent *bev, short what, void *arg)
+{
+ errorcb_invoked = 1;
+}
+
+void
+test_bufferevent_zlib(void *arg)
+{
+ struct bufferevent *bev1=NULL, *bev2=NULL;
+ char buffer[8333];
+ z_stream z_input, z_output;
+ int i, r;
+ evutil_socket_t pair[2] = {-1, -1};
+ (void)arg;
+
+ infilter_calls = outfilter_calls = readcb_finished = writecb_finished
+ = errorcb_invoked = 0;
+
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) {
+ tt_abort_perror("socketpair");
+ }
+
+ evutil_make_socket_nonblocking(pair[0]);
+ evutil_make_socket_nonblocking(pair[1]);
+
+ bev1 = bufferevent_socket_new(NULL, pair[0], 0);
+ bev2 = bufferevent_socket_new(NULL, pair[1], 0);
+
+ memset(&z_output, 0, sizeof(z_output));
+ r = deflateInit(&z_output, Z_DEFAULT_COMPRESSION);
+ tt_int_op(r, ==, Z_OK);
+ memset(&z_input, 0, sizeof(z_input));
+ r = inflateInit(&z_input);
+ tt_int_op(r, ==, Z_OK);
+
+ /* initialize filters */
+ bev1 = bufferevent_filter_new(bev1, NULL, zlib_output_filter,
+ BEV_OPT_CLOSE_ON_FREE, zlib_deflate_free, &z_output);
+ bev2 = bufferevent_filter_new(bev2, zlib_input_filter,
+ NULL, BEV_OPT_CLOSE_ON_FREE, zlib_inflate_free, &z_input);
+ bufferevent_setcb(bev1, readcb, writecb, errorcb, NULL);
+ bufferevent_setcb(bev2, readcb, writecb, errorcb, NULL);
+
+ bufferevent_disable(bev1, EV_READ);
+ bufferevent_enable(bev1, EV_WRITE);
+
+ bufferevent_enable(bev2, EV_READ);
+
+ for (i = 0; i < (int)sizeof(buffer); i++)
+ buffer[i] = i;
+
+ /* break it up into multiple buffer chains */
+ bufferevent_write(bev1, buffer, 1800);
+ bufferevent_write(bev1, buffer + 1800, sizeof(buffer) - 1800);
+
+ /* we are done writing - we need to flush everything */
+ bufferevent_flush(bev1, EV_WRITE, BEV_FINISHED);
+
+ event_dispatch();
+
+ tt_want(infilter_calls);
+ tt_want(outfilter_calls);
+ tt_want(readcb_finished);
+ tt_want(writecb_finished);
+ tt_want(!errorcb_invoked);
+
+ test_ok = 1;
+end:
+ if (bev1)
+ bufferevent_free(bev1);
+ if (bev2)
+ bufferevent_free(bev2);
+
+ if (pair[0] >= 0)
+ evutil_closesocket(pair[0]);
+ if (pair[1] >= 0)
+ evutil_closesocket(pair[1]);
+}
diff --git a/sntp/libevent/test/rpcgen_wrapper.sh b/sntp/libevent/test/rpcgen_wrapper.sh
new file mode 100755
index 0000000..aaa0303
--- /dev/null
+++ b/sntp/libevent/test/rpcgen_wrapper.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# libevent rpcgen_wrapper.sh
+# Transforms event_rpcgen.py failure into success for make, only if
+# regress.gen.c and regress.gen.h already exist in $srcdir. This
+# is needed for "make distcheck" to pass the read-only $srcdir build,
+# as with read-only sources fresh from tarball, regress.gen.[ch] will
+# be correct in $srcdir but unwritable. This previously triggered
+# Makefile.am to create stub regress.gen.c and regress.gen.h in the
+# distcheck _build directory, which were then detected as leftover
+# files in the build tree after distclean, breaking distcheck.
+# Note that regress.gen.[ch] are not in fresh git clones, making
+# working Python a requirement for make distcheck of a git tree.
+
+exit_updated() {
+# echo "Updated ${srcdir}/regress.gen.c and ${srcdir}/regress.gen.h"
+ exit 0
+}
+
+exit_reuse() {
+ echo "event_rpcgen.py failed, ${srcdir}/regress.gen.\[ch\] will be reused." >&2
+ exit 0
+}
+
+exit_failed() {
+ echo "Could not generate regress.gen.\[ch\] using event_rpcgen.sh" >&2
+ exit 1
+}
+
+if [ -x /usr/bin/python2 ] ; then
+ PYTHON2=/usr/bin/python2
+elif [ "x`which python2`" != x ] ; then
+ PYTHON2=python2
+else
+ PYTHON2=python
+fi
+
+srcdir=$1
+srcdir=${srcdir:-.}
+
+${PYTHON2} ${srcdir}/../event_rpcgen.py --quiet ${srcdir}/regress.rpc \
+ test/regress.gen.h test/regress.gen.c
+
+case "$?" in
+ 0)
+ exit_updated
+ ;;
+ *)
+ test -r ${srcdir}/regress.gen.c -a -r ${srcdir}/regress.gen.h && \
+ exit_reuse
+ exit_failed
+ ;;
+esac
diff --git a/sntp/libevent/test/test-changelist.c b/sntp/libevent/test/test-changelist.c
new file mode 100644
index 0000000..6e2466d
--- /dev/null
+++ b/sntp/libevent/test/test-changelist.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/util.h"
+#include <time.h>
+
+struct cpu_usage_timer {
+#ifdef _WIN32
+ HANDLE thread;
+ FILETIME usertimeBegin;
+ FILETIME kerneltimeBegin;
+#else
+ clock_t ticksBegin;
+#endif
+ struct timeval timeBegin;
+};
+static void
+start_cpu_usage_timer(struct cpu_usage_timer *timer)
+{
+#ifdef _WIN32
+ int r;
+ FILETIME createtime, exittime;
+ timer->thread = GetCurrentThread();
+ r = GetThreadTimes(timer->thread, &createtime, &exittime,
+ &timer->usertimeBegin, &timer->kerneltimeBegin);
+ if (r==0) printf("GetThreadTimes failed.");
+#else
+ timer->ticksBegin = clock();
+#endif
+
+ evutil_gettimeofday(&timer->timeBegin, NULL);
+}
+#ifdef _WIN32
+static ev_int64_t
+filetime_to_100nsec(const FILETIME *ft)
+{
+ /* Number of 100-nanosecond units */
+ ev_int64_t n = ft->dwHighDateTime;
+ n <<= 32;
+ n += ft->dwLowDateTime;
+ return n;
+}
+static double
+filetime_diff(const FILETIME *ftStart, const FILETIME *ftEnd)
+{
+ ev_int64_t s, e, diff;
+ double r;
+ s = filetime_to_100nsec(ftStart);
+ e = filetime_to_100nsec(ftEnd);
+ diff = e - s;
+ r = (double) diff;
+ return r / 1.0e7;
+}
+#endif
+
+static void
+get_cpu_usage(struct cpu_usage_timer *timer, double *secElapsedOut,
+ double *secUsedOut, double *usageOut)
+{
+#ifdef _WIN32
+ double usertime_seconds, kerneltime_seconds;
+ FILETIME createtime, exittime, usertimeEnd, kerneltimeEnd;
+ int r;
+#else
+ clock_t ticksEnd;
+#endif
+ struct timeval timeEnd, timeDiff;
+ double secondsPassed, secondsUsed;
+
+#ifdef _WIN32
+ r = GetThreadTimes(timer->thread, &createtime, &exittime,
+ &usertimeEnd, &kerneltimeEnd);
+ if (r==0) printf("GetThreadTimes failed.");
+ usertime_seconds = filetime_diff(&timer->usertimeBegin, &usertimeEnd);
+ kerneltime_seconds = filetime_diff(&timer->kerneltimeBegin, &kerneltimeEnd);
+ secondsUsed = kerneltime_seconds + usertime_seconds;
+#else
+ ticksEnd = clock();
+ secondsUsed = (ticksEnd - timer->ticksBegin) / (double)CLOCKS_PER_SEC;
+#endif
+ evutil_gettimeofday(&timeEnd, NULL);
+ evutil_timersub(&timeEnd, &timer->timeBegin, &timeDiff);
+ secondsPassed = timeDiff.tv_sec + (timeDiff.tv_usec / 1.0e6);
+
+ *secElapsedOut = secondsPassed;
+ *secUsedOut = secondsUsed;
+ *usageOut = secondsUsed / secondsPassed;
+}
+
+static void
+write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ printf("write callback. should only see this once\n");
+
+ /* got what we want remove the event */
+ event_del(*(struct event**)arg);
+
+ /* opps changed my mind add it back again */
+ event_add(*(struct event**)arg,NULL);
+
+ /* not a good day for decisiveness, I really didn't want it after all */
+ event_del(*(struct event**)arg);
+
+}
+
+static void
+timeout_cb(evutil_socket_t fd, short event, void *arg)
+{
+ printf("timeout fired, time to end test\n");
+ event_del(*(struct event**)arg);
+ return;
+}
+
+int
+main(int argc, char **argv)
+{
+ struct event* ev;
+ struct event* timeout;
+ struct event_base* base;
+
+ evutil_socket_t pair[2];
+ struct timeval tv;
+ struct cpu_usage_timer timer;
+
+ double usage, secPassed, secUsed;
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+ /* Initalize the event library */
+ if (!(base = event_base_new()))
+ return (1);
+
+ /* Initalize a timeout to terminate the test */
+ timeout = evtimer_new(base,timeout_cb,&timeout);
+ /* and watch for writability on one end of the pipe */
+ ev = event_new(base,pair[1],EV_WRITE | EV_PERSIST, write_cb, &ev);
+
+ tv.tv_sec = 1;
+ tv.tv_usec = 500*1000;
+
+ evtimer_add(timeout, &tv);
+
+ event_add(ev, NULL);
+
+ start_cpu_usage_timer(&timer);
+
+ event_base_dispatch(base);
+
+ event_free(ev);
+ event_free(timeout);
+ event_base_free(base);
+
+ get_cpu_usage(&timer, &secPassed, &secUsed, &usage);
+
+ /* attempt to calculate our cpu usage over the test should be
+ virtually nil */
+
+ printf("usec used=%d, usec passed=%d, cpu usage=%.2f%%\n",
+ (int)(secUsed*1e6),
+ (int)(secPassed*1e6),
+ usage*100);
+
+ if (usage > 50.0) /* way too high */
+ return 1;
+
+ return 0;
+}
+
diff --git a/sntp/libevent/test/test-closed.c b/sntp/libevent/test/test-closed.c
new file mode 100644
index 0000000..5b04f35
--- /dev/null
+++ b/sntp/libevent/test/test-closed.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2013 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <event.h>
+#include <evutil.h>
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+struct timeval timeout = {3, 0};
+
+static void
+closed_cb(evutil_socket_t fd, short event, void *arg)
+{
+ if (EV_TIMEOUT & event) {
+ printf("%s: Timeout!\n", __func__);
+ exit(1);
+ }
+
+ if (EV_CLOSED & event) {
+ printf("%s: detected socket close with success\n", __func__);
+ return;
+ }
+
+ printf("%s: unable to detect socket close\n", __func__);
+ exit(1);
+}
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct event_base *base;
+ struct event_config *cfg;
+ struct event *ev;
+ const char *test = "test string";
+ evutil_socket_t pair[2];
+
+ /* Initialize the library and check if the backend
+ supports EV_FEATURE_EARLY_CLOSE
+ */
+ cfg = event_config_new();
+ event_config_require_features(cfg, EV_FEATURE_EARLY_CLOSE);
+ base = event_base_new_with_config(cfg);
+ event_config_free(cfg);
+ if (!base) {
+ /* Backend doesn't support EV_FEATURE_EARLY_CLOSE */
+ return 0;
+ }
+
+ /* Create a pair of sockets */
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+ /* Send some data on socket 0 and immediately close it */
+ if (send(pair[0], test, (int)strlen(test)+1, 0) < 0)
+ return (1);
+ shutdown(pair[0], SHUT_WR);
+
+ /* Dispatch */
+ ev = event_new(base, pair[1], EV_CLOSED | EV_TIMEOUT, closed_cb, event_self_cbarg());
+ event_add(ev, &timeout);
+ event_base_dispatch(base);
+
+ /* Finalize library */
+ event_base_free(base);
+ return 0;
+}
+
diff --git a/sntp/libevent/test/test-dumpevents.c b/sntp/libevent/test/test-dumpevents.c
new file mode 100644
index 0000000..1c272d4
--- /dev/null
+++ b/sntp/libevent/test/test-dumpevents.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "util-internal.h"
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <stdio.h>
+#include <event2/event.h>
+#include <signal.h>
+
+static void
+sock_perror(const char *s)
+{
+#ifdef _WIN32
+ const char *err = evutil_socket_error_to_string(EVUTIL_SOCKET_ERROR());
+ fprintf(stderr, "%s: %s\n", s, err);
+#else
+ perror(s);
+#endif
+}
+
+static void
+callback1(evutil_socket_t fd, short events, void *arg)
+{
+}
+static void
+callback2(evutil_socket_t fd, short events, void *arg)
+{
+}
+
+/* Testing code for event_base_dump_events().
+
+ Notes that just because we have code to exercise this function,
+ doesn't mean that *ANYTHING* about the output format is guaranteed to
+ remain in the future.
+ */
+int
+main(int argc, char **argv)
+{
+#define N_EVENTS 13
+ int i;
+ struct event *ev[N_EVENTS];
+ evutil_socket_t pair1[2];
+ evutil_socket_t pair2[2];
+ struct timeval tv_onesec = {1,0};
+ struct timeval tv_two5sec = {2,500*1000};
+ const struct timeval *tv_onesec_common;
+ const struct timeval *tv_two5sec_common;
+ struct event_base *base;
+ struct timeval now;
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+#ifdef _WIN32
+#define LOCAL_SOCKETPAIR_AF AF_INET
+#else
+#define LOCAL_SOCKETPAIR_AF AF_UNIX
+#endif
+
+ if (evutil_make_internal_pipe_(pair1) < 0 ||
+ evutil_make_internal_pipe_(pair2) < 0) {
+ sock_perror("evutil_make_internal_pipe_");
+ return 1;
+ }
+
+ if (!(base = event_base_new())) {
+ fprintf(stderr,"Couldn't make event_base\n");
+ return 2;
+ }
+
+ tv_onesec_common = event_base_init_common_timeout(base, &tv_onesec);
+ tv_two5sec_common = event_base_init_common_timeout(base, &tv_two5sec);
+
+ ev[0] = event_new(base, pair1[0], EV_WRITE, callback1, NULL);
+ ev[1] = event_new(base, pair1[1], EV_READ|EV_PERSIST, callback1, NULL);
+ ev[2] = event_new(base, pair2[0], EV_WRITE|EV_PERSIST, callback2, NULL);
+ ev[3] = event_new(base, pair2[1], EV_READ, callback2, NULL);
+
+ /* For timers */
+ ev[4] = evtimer_new(base, callback1, NULL);
+ ev[5] = evtimer_new(base, callback1, NULL);
+ ev[6] = evtimer_new(base, callback1, NULL);
+ ev[7] = event_new(base, -1, EV_PERSIST, callback2, NULL);
+ ev[8] = event_new(base, -1, EV_PERSIST, callback2, NULL);
+ ev[9] = event_new(base, -1, EV_PERSIST, callback2, NULL);
+
+ /* To activate */
+ ev[10] = event_new(base, -1, 0, callback1, NULL);
+ ev[11] = event_new(base, -1, 0, callback2, NULL);
+
+ /* Signals */
+ ev[12] = evsignal_new(base, SIGINT, callback2, NULL);
+
+ event_add(ev[0], NULL);
+ event_add(ev[1], &tv_onesec);
+ event_add(ev[2], tv_onesec_common);
+ event_add(ev[3], tv_two5sec_common);
+
+ event_add(ev[4], tv_onesec_common);
+ event_add(ev[5], tv_onesec_common);
+ event_add(ev[6], &tv_onesec);
+ event_add(ev[7], tv_two5sec_common);
+ event_add(ev[8], tv_onesec_common);
+ event_add(ev[9], &tv_two5sec);
+
+ event_active(ev[10], EV_READ, 1);
+ event_active(ev[11], EV_READ|EV_WRITE|EV_TIMEOUT, 1);
+ event_active(ev[1], EV_READ, 1);
+
+ event_add(ev[12], NULL);
+
+ evutil_gettimeofday(&now,NULL);
+ puts("=====expected");
+ printf("Now= %ld.%06d\n",(long)now.tv_sec,(int)now.tv_usec);
+ puts("Inserted:");
+ printf(" %p [fd %ld] Write\n",ev[0],(long)pair1[0]);
+ printf(" %p [fd %ld] Read Persist Timeout=T+1\n",ev[1],(long)pair1[1]);
+ printf(" %p [fd %ld] Write Persist Timeout=T+1\n",ev[2],(long)pair2[0]);
+ printf(" %p [fd %ld] Read Timeout=T+2.5\n",ev[3],(long)pair2[1]);
+ printf(" %p [fd -1] Timeout=T+1\n",ev[4]);
+ printf(" %p [fd -1] Timeout=T+1\n",ev[5]);
+ printf(" %p [fd -1] Timeout=T+1\n",ev[6]);
+ printf(" %p [fd -1] Persist Timeout=T+2.5\n",ev[7]);
+ printf(" %p [fd -1] Persist Timeout=T+1\n",ev[8]);
+ printf(" %p [fd -1] Persist Timeout=T+2.5\n",ev[9]);
+ printf(" %p [sig %d] Signal Persist\n", ev[12], (int)SIGINT);
+
+ puts("Active:");
+ printf(" %p [fd -1, priority=0] Read active\n", ev[10]);
+ printf(" %p [fd -1, priority=0] Read Write Timeout active\n", ev[11]);
+ printf(" %p [fd %ld, priority=0] Read active\n", ev[1], (long)pair1[1]);
+
+ puts("======received");
+ event_base_dump_events(base, stdout);
+
+ for (i = 0; i < N_EVENTS; ++i) {
+ event_free(ev[i]);
+ }
+ event_base_free(base);
+
+ return 0;
+}
+
diff --git a/sntp/libevent/test/test-eof.c b/sntp/libevent/test/test-eof.c
new file mode 100644
index 0000000..a9ca534
--- /dev/null
+++ b/sntp/libevent/test/test-eof.c
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <event.h>
+#include <evutil.h>
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+int test_okay = 1;
+int called = 0;
+struct timeval timeout = {60, 0};
+
+static void
+read_cb(evutil_socket_t fd, short event, void *arg)
+{
+ char buf[256];
+ int len;
+
+ if (EV_TIMEOUT & event) {
+ printf("%s: Timeout!\n", __func__);
+ exit(1);
+ }
+
+ len = recv(fd, buf, sizeof(buf), 0);
+
+ printf("%s: read %d%s\n", __func__,
+ len, len ? "" : " - means EOF");
+
+ if (len) {
+ if (!called)
+ event_add(arg, &timeout);
+ } else if (called == 1)
+ test_okay = 0;
+
+ called++;
+}
+
+#ifndef SHUT_WR
+#define SHUT_WR 1
+#endif
+
+int
+main(int argc, char **argv)
+{
+ struct event ev;
+ const char *test = "test string";
+ evutil_socket_t pair[2];
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+
+ if (send(pair[0], test, (int)strlen(test)+1, 0) < 0)
+ return (1);
+ shutdown(pair[0], SHUT_WR);
+
+ /* Initalize the event library */
+ event_init();
+
+ /* Initalize one event */
+ event_set(&ev, pair[1], EV_READ | EV_TIMEOUT, read_cb, &ev);
+
+ event_add(&ev, &timeout);
+
+ event_dispatch();
+
+ return (test_okay);
+}
+
diff --git a/sntp/libevent/test/test-fdleak.c b/sntp/libevent/test/test-fdleak.c
new file mode 100644
index 0000000..ee2432b
--- /dev/null
+++ b/sntp/libevent/test/test-fdleak.c
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2012 Ross Lagerwall <rosslagerwall@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#ifdef EVENT__HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include "event2/event.h"
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/listener.h"
+
+/* Number of requests to make. Setting this too high might result in the machine
+ running out of ephemeral ports */
+#ifdef _WIN32
+#define MAX_REQUESTS 1000
+#else
+#define MAX_REQUESTS 4000
+#endif
+
+/* Provide storage for the address, both for the server & the clients */
+static struct sockaddr_in sin;
+
+/* Number of sucessful requests so far */
+static int num_requests;
+
+static void start_client(struct event_base *base);
+
+static void
+my_perror(const char *s)
+{
+ fprintf(stderr, "%s: %s",
+ s, evutil_socket_error_to_string(EVUTIL_SOCKET_ERROR()));
+}
+
+/*
+===============================================
+Server functions
+===============================================
+*/
+
+/* Read a byte from the client and write it back */
+static void
+server_read_cb(struct bufferevent *bev, void *ctx)
+{
+ while (evbuffer_get_length(bufferevent_get_input(bev))) {
+ unsigned char tmp;
+ bufferevent_read(bev, &tmp, 1);
+ bufferevent_write(bev, &tmp, 1);
+ }
+}
+
+/* Wait for an EOF and then free the bufferevent */
+static void
+server_event_cb(struct bufferevent *bev, short events, void *ctx)
+{
+ if (events & BEV_EVENT_ERROR) {
+ my_perror("Error from bufferevent");
+ exit(1);
+ } else if (events & (BEV_EVENT_EOF | BEV_EVENT_ERROR)) {
+ bufferevent_free(bev);
+ }
+}
+
+/* Accept a client socket and set it up to for reading & writing */
+static void
+listener_accept_cb(struct evconnlistener *listener, evutil_socket_t sock,
+ struct sockaddr *addr, int len, void *ptr)
+{
+ struct event_base *base = evconnlistener_get_base(listener);
+ struct bufferevent *bev = bufferevent_socket_new(base, sock,
+ BEV_OPT_CLOSE_ON_FREE);
+
+ bufferevent_setcb(bev, server_read_cb, NULL, server_event_cb, NULL);
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+}
+
+/* Start the server listening on a random port and start the first client. */
+static void
+start_loop(void)
+{
+ struct event_base *base;
+ struct evconnlistener *listener;
+ struct sockaddr_storage ss;
+ ev_socklen_t socklen = sizeof(ss);
+ evutil_socket_t fd;
+
+ base = event_base_new();
+ if (base == NULL) {
+ puts("Could not open event base!");
+ exit(1);
+ }
+
+ listener = evconnlistener_new_bind(base, listener_accept_cb, NULL,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE,
+ -1, (struct sockaddr *)&sin, sizeof(sin));
+ if (listener == NULL) {
+ my_perror("Could not create listener!");
+ exit(1);
+ }
+ fd = evconnlistener_get_fd(listener);
+ if (fd < 0) {
+ puts("Couldn't get fd from listener");
+ exit(1);
+ }
+ if (getsockname(fd, (struct sockaddr *)&ss, &socklen) < 0) {
+ my_perror("getsockname()");
+ exit(1);
+ }
+ memcpy(&sin, &ss, sizeof(sin));
+ if (sin.sin_family != AF_INET) {
+ puts("AF mismatch from getsockname().");
+ exit(1);
+ }
+
+ start_client(base);
+
+ event_base_dispatch(base);
+}
+
+/*
+===============================================
+Client functions
+===============================================
+*/
+
+/* Check that the server sends back the same byte that the client sent.
+ If MAX_REQUESTS have been reached, exit. Otherwise, start another client. */
+static void
+client_read_cb(struct bufferevent *bev, void *ctx)
+{
+ unsigned char tmp;
+ struct event_base *base = bufferevent_get_base(bev);
+
+ bufferevent_read(bev, &tmp, 1);
+ if (tmp != 'A') {
+ puts("Incorrect data received!");
+ exit(2);
+ }
+ bufferevent_free(bev);
+
+ num_requests++;
+ if (num_requests == MAX_REQUESTS) {
+ event_base_loopbreak(base);
+ } else {
+ start_client(base);
+ }
+}
+
+/* Send a byte to the server. */
+static void
+client_event_cb(struct bufferevent *bev, short events, void *ctx)
+{
+ if (events & BEV_EVENT_CONNECTED) {
+ unsigned char tmp = 'A';
+ bufferevent_write(bev, &tmp, 1);
+ } else if (events & BEV_EVENT_ERROR) {
+ puts("Client socket got error!");
+ exit(2);
+ }
+
+ bufferevent_enable(bev, EV_READ);
+}
+
+/* Open a client socket to connect to localhost on sin */
+static void
+start_client(struct event_base *base)
+{
+ struct bufferevent *bev = bufferevent_socket_new(base, -1,
+ BEV_OPT_CLOSE_ON_FREE);
+ bufferevent_setcb(bev, client_read_cb, NULL, client_event_cb, NULL);
+
+ if (bufferevent_socket_connect(bev, (struct sockaddr *)&sin,
+ sizeof(sin)) < 0) {
+ my_perror("Could not connect!");
+ bufferevent_free(bev);
+ exit(2);
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+#ifdef EVENT__HAVE_SETRLIMIT
+ /* Set the fd limit to a low value so that any fd leak is caught without
+ making many requests. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 20;
+ if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
+ my_perror("setrlimit");
+ exit(3);
+ }
+#endif
+
+#ifdef _WIN32
+ WSADATA WSAData;
+ WSAStartup(0x101, &WSAData);
+#endif
+
+ /* Set up an address, used by both client & server. */
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+ sin.sin_port = 0; /* Tell the implementation to pick a port. */
+
+ start_loop();
+
+ return 0;
+}
+
+/* XXX why does this test cause so much latency sometimes (OSX 10.5)? */
diff --git a/sntp/libevent/test/test-init.c b/sntp/libevent/test/test-init.c
new file mode 100644
index 0000000..92fbc6b
--- /dev/null
+++ b/sntp/libevent/test/test-init.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+#include <event.h>
+
+int
+main(int argc, char **argv)
+{
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ /* Initalize the event library */
+ event_init();
+
+ return (0);
+}
+
diff --git a/sntp/libevent/test/test-ratelim.c b/sntp/libevent/test/test-ratelim.c
new file mode 100644
index 0000000..27649b8
--- /dev/null
+++ b/sntp/libevent/test/test-ratelim.c
@@ -0,0 +1,602 @@
+/*
+ * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "../util-internal.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
+#endif
+#include <signal.h>
+
+#include "event2/bufferevent.h"
+#include "event2/buffer.h"
+#include "event2/event.h"
+#include "event2/util.h"
+#include "event2/listener.h"
+#include "event2/thread.h"
+
+
+static int cfg_verbose = 0;
+static int cfg_help = 0;
+
+static int cfg_n_connections = 30;
+static int cfg_duration = 5;
+static int cfg_connlimit = 0;
+static int cfg_grouplimit = 0;
+static int cfg_tick_msec = 1000;
+static int cfg_min_share = -1;
+static int cfg_group_drain = 0;
+
+static int cfg_connlimit_tolerance = -1;
+static int cfg_grouplimit_tolerance = -1;
+static int cfg_stddev_tolerance = -1;
+
+#ifdef _WIN32
+static int cfg_enable_iocp = 0;
+#endif
+
+static struct timeval cfg_tick = { 0, 500*1000 };
+
+static struct ev_token_bucket_cfg *conn_bucket_cfg = NULL;
+static struct ev_token_bucket_cfg *group_bucket_cfg = NULL;
+struct bufferevent_rate_limit_group *ratelim_group = NULL;
+static double seconds_per_tick = 0.0;
+
+struct client_state {
+ size_t queued;
+ ev_uint64_t received;
+
+};
+static const struct timeval *ms100_common=NULL;
+
+/* info from check_bucket_levels_cb */
+static int total_n_bev_checks = 0;
+static ev_int64_t total_rbucket_level=0;
+static ev_int64_t total_wbucket_level=0;
+static ev_int64_t total_max_to_read=0;
+static ev_int64_t total_max_to_write=0;
+static ev_int64_t max_bucket_level=EV_INT64_MIN;
+static ev_int64_t min_bucket_level=EV_INT64_MAX;
+
+/* from check_group_bucket_levels_cb */
+static int total_n_group_bev_checks = 0;
+static ev_int64_t total_group_rbucket_level = 0;
+static ev_int64_t total_group_wbucket_level = 0;
+
+static int n_echo_conns_open = 0;
+
+/* Info on the open connections */
+struct bufferevent **bevs;
+struct client_state *states;
+struct bufferevent_rate_limit_group *group = NULL;
+
+static void check_bucket_levels_cb(evutil_socket_t fd, short events, void *arg);
+
+static void
+loud_writecb(struct bufferevent *bev, void *ctx)
+{
+ struct client_state *cs = ctx;
+ struct evbuffer *output = bufferevent_get_output(bev);
+ char buf[1024];
+#ifdef _WIN32
+ int r = rand() % 256;
+#else
+ int r = random() % 256;
+#endif
+ memset(buf, r, sizeof(buf));
+ while (evbuffer_get_length(output) < 8192) {
+ evbuffer_add(output, buf, sizeof(buf));
+ cs->queued += sizeof(buf);
+ }
+}
+
+static void
+discard_readcb(struct bufferevent *bev, void *ctx)
+{
+ struct client_state *cs = ctx;
+ struct evbuffer *input = bufferevent_get_input(bev);
+ size_t len = evbuffer_get_length(input);
+ evbuffer_drain(input, len);
+ cs->received += len;
+}
+
+static void
+write_on_connectedcb(struct bufferevent *bev, short what, void *ctx)
+{
+ if (what & BEV_EVENT_CONNECTED) {
+ loud_writecb(bev, ctx);
+ /* XXXX this shouldn't be needed. */
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+ }
+}
+
+static void
+echo_readcb(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *input = bufferevent_get_input(bev);
+ struct evbuffer *output = bufferevent_get_output(bev);
+
+ evbuffer_add_buffer(output, input);
+ if (evbuffer_get_length(output) > 1024000)
+ bufferevent_disable(bev, EV_READ);
+}
+
+static void
+echo_writecb(struct bufferevent *bev, void *ctx)
+{
+ struct evbuffer *output = bufferevent_get_output(bev);
+ if (evbuffer_get_length(output) < 512000)
+ bufferevent_enable(bev, EV_READ);
+}
+
+static void
+echo_eventcb(struct bufferevent *bev, short what, void *ctx)
+{
+ if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
+ --n_echo_conns_open;
+ bufferevent_free(bev);
+ }
+}
+
+static void
+echo_listenercb(struct evconnlistener *listener, evutil_socket_t newsock,
+ struct sockaddr *sourceaddr, int socklen, void *ctx)
+{
+ struct event_base *base = ctx;
+ int flags = BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE;
+ struct bufferevent *bev;
+
+ bev = bufferevent_socket_new(base, newsock, flags);
+ bufferevent_setcb(bev, echo_readcb, echo_writecb, echo_eventcb, NULL);
+ if (conn_bucket_cfg) {
+ struct event *check_event =
+ event_new(base, -1, EV_PERSIST, check_bucket_levels_cb, bev);
+ bufferevent_set_rate_limit(bev, conn_bucket_cfg);
+
+ assert(bufferevent_get_token_bucket_cfg(bev) != NULL);
+ event_add(check_event, ms100_common);
+ }
+ if (ratelim_group)
+ bufferevent_add_to_rate_limit_group(bev, ratelim_group);
+ ++n_echo_conns_open;
+ bufferevent_enable(bev, EV_READ|EV_WRITE);
+}
+
+/* Called periodically to check up on how full the buckets are */
+static void
+check_bucket_levels_cb(evutil_socket_t fd, short events, void *arg)
+{
+ struct bufferevent *bev = arg;
+
+ ev_ssize_t r = bufferevent_get_read_limit(bev);
+ ev_ssize_t w = bufferevent_get_write_limit(bev);
+ ev_ssize_t rm = bufferevent_get_max_to_read(bev);
+ ev_ssize_t wm = bufferevent_get_max_to_write(bev);
+ /* XXXX check that no value is above the cofigured burst
+ * limit */
+ total_rbucket_level += r;
+ total_wbucket_level += w;
+ total_max_to_read += rm;
+ total_max_to_write += wm;
+#define B(x) \
+ if ((x) > max_bucket_level) \
+ max_bucket_level = (x); \
+ if ((x) < min_bucket_level) \
+ min_bucket_level = (x)
+ B(r);
+ B(w);
+#undef B
+
+ total_n_bev_checks++;
+ if (total_n_bev_checks >= .8 * (cfg_duration / cfg_tick_msec) * cfg_n_connections) {
+ event_free(event_base_get_running_event(bufferevent_get_base(bev)));
+ }
+}
+
+static void
+check_group_bucket_levels_cb(evutil_socket_t fd, short events, void *arg)
+{
+ if (ratelim_group) {
+ ev_ssize_t r = bufferevent_rate_limit_group_get_read_limit(ratelim_group);
+ ev_ssize_t w = bufferevent_rate_limit_group_get_write_limit(ratelim_group);
+ total_group_rbucket_level += r;
+ total_group_wbucket_level += w;
+ }
+ ++total_n_group_bev_checks;
+}
+
+static void
+group_drain_cb(evutil_socket_t fd, short events, void *arg)
+{
+ bufferevent_rate_limit_group_decrement_read(ratelim_group, cfg_group_drain);
+ bufferevent_rate_limit_group_decrement_write(ratelim_group, cfg_group_drain);
+}
+
+static int
+test_ratelimiting(void)
+{
+ struct event_base *base;
+ struct sockaddr_in sin;
+ struct evconnlistener *listener;
+
+ struct sockaddr_storage ss;
+ ev_socklen_t slen;
+
+ int i;
+
+ struct timeval tv;
+
+ ev_uint64_t total_received;
+ double total_sq_persec, total_persec;
+ double variance;
+ double expected_total_persec = -1.0, expected_avg_persec = -1.0;
+ int ok = 1;
+ struct event_config *base_cfg;
+ struct event *periodic_level_check;
+ struct event *group_drain_event=NULL;
+
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
+ sin.sin_port = 0; /* unspecified port */
+
+ if (0)
+ event_enable_debug_mode();
+
+ base_cfg = event_config_new();
+
+#ifdef _WIN32
+ if (cfg_enable_iocp) {
+ evthread_use_windows_threads();
+ event_config_set_flag(base_cfg, EVENT_BASE_FLAG_STARTUP_IOCP);
+ }
+#endif
+
+ base = event_base_new_with_config(base_cfg);
+ event_config_free(base_cfg);
+ if (! base) {
+ fprintf(stderr, "Couldn't create event_base");
+ return 1;
+ }
+
+ listener = evconnlistener_new_bind(base, echo_listenercb, base,
+ LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE, -1,
+ (struct sockaddr *)&sin, sizeof(sin));
+ if (! listener) {
+ fprintf(stderr, "Couldn't create listener");
+ return 1;
+ }
+
+ slen = sizeof(ss);
+ if (getsockname(evconnlistener_get_fd(listener), (struct sockaddr *)&ss,
+ &slen) < 0) {
+ perror("getsockname");
+ return 1;
+ }
+
+ if (cfg_connlimit > 0) {
+ conn_bucket_cfg = ev_token_bucket_cfg_new(
+ cfg_connlimit, cfg_connlimit * 4,
+ cfg_connlimit, cfg_connlimit * 4,
+ &cfg_tick);
+ assert(conn_bucket_cfg);
+ }
+
+ if (cfg_grouplimit > 0) {
+ group_bucket_cfg = ev_token_bucket_cfg_new(
+ cfg_grouplimit, cfg_grouplimit * 4,
+ cfg_grouplimit, cfg_grouplimit * 4,
+ &cfg_tick);
+ group = ratelim_group = bufferevent_rate_limit_group_new(
+ base, group_bucket_cfg);
+ expected_total_persec = cfg_grouplimit - (cfg_group_drain / seconds_per_tick);
+ expected_avg_persec = cfg_grouplimit / cfg_n_connections;
+ if (cfg_connlimit > 0 && expected_avg_persec > cfg_connlimit)
+ expected_avg_persec = cfg_connlimit;
+ if (cfg_min_share >= 0)
+ bufferevent_rate_limit_group_set_min_share(
+ ratelim_group, cfg_min_share);
+ }
+
+ if (expected_avg_persec < 0 && cfg_connlimit > 0)
+ expected_avg_persec = cfg_connlimit;
+
+ if (expected_avg_persec > 0)
+ expected_avg_persec /= seconds_per_tick;
+ if (expected_total_persec > 0)
+ expected_total_persec /= seconds_per_tick;
+
+ bevs = calloc(cfg_n_connections, sizeof(struct bufferevent *));
+ states = calloc(cfg_n_connections, sizeof(struct client_state));
+
+ for (i = 0; i < cfg_n_connections; ++i) {
+ bevs[i] = bufferevent_socket_new(base, -1,
+ BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE);
+ assert(bevs[i]);
+ bufferevent_setcb(bevs[i], discard_readcb, loud_writecb,
+ write_on_connectedcb, &states[i]);
+ bufferevent_enable(bevs[i], EV_READ|EV_WRITE);
+ bufferevent_socket_connect(bevs[i], (struct sockaddr *)&ss,
+ slen);
+ }
+
+ tv.tv_sec = cfg_duration - 1;
+ tv.tv_usec = 995000;
+
+ event_base_loopexit(base, &tv);
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 100*1000;
+ ms100_common = event_base_init_common_timeout(base, &tv);
+
+ periodic_level_check = event_new(base, -1, EV_PERSIST, check_group_bucket_levels_cb, NULL);
+ event_add(periodic_level_check, ms100_common);
+
+ if (cfg_group_drain && ratelim_group) {
+ group_drain_event = event_new(base, -1, EV_PERSIST, group_drain_cb, NULL);
+ event_add(group_drain_event, &cfg_tick);
+ }
+
+ event_base_dispatch(base);
+
+ ratelim_group = NULL; /* So no more responders get added */
+ event_free(periodic_level_check);
+ if (group_drain_event)
+ event_del(group_drain_event);
+
+ for (i = 0; i < cfg_n_connections; ++i) {
+ bufferevent_free(bevs[i]);
+ }
+ evconnlistener_free(listener);
+
+ /* Make sure no new echo_conns get added to the group. */
+ ratelim_group = NULL;
+
+ /* This should get _everybody_ freed */
+ while (n_echo_conns_open) {
+ printf("waiting for %d conns\n", n_echo_conns_open);
+ tv.tv_sec = 0;
+ tv.tv_usec = 300000;
+ event_base_loopexit(base, &tv);
+ event_base_dispatch(base);
+ }
+
+ if (group)
+ bufferevent_rate_limit_group_free(group);
+
+ if (total_n_bev_checks) {
+ printf("Average read bucket level: %f\n",
+ (double)total_rbucket_level/total_n_bev_checks);
+ printf("Average write bucket level: %f\n",
+ (double)total_wbucket_level/total_n_bev_checks);
+ printf("Highest read bucket level: %f\n",
+ (double)max_bucket_level);
+ printf("Highest write bucket level: %f\n",
+ (double)min_bucket_level);
+ printf("Average max-to-read: %f\n",
+ ((double)total_max_to_read)/total_n_bev_checks);
+ printf("Average max-to-write: %f\n",
+ ((double)total_max_to_write)/total_n_bev_checks);
+ }
+ if (total_n_group_bev_checks) {
+ printf("Average group read bucket level: %f\n",
+ ((double)total_group_rbucket_level)/total_n_group_bev_checks);
+ printf("Average group write bucket level: %f\n",
+ ((double)total_group_wbucket_level)/total_n_group_bev_checks);
+ }
+
+ total_received = 0;
+ total_persec = 0.0;
+ total_sq_persec = 0.0;
+ for (i=0; i < cfg_n_connections; ++i) {
+ double persec = states[i].received;
+ persec /= cfg_duration;
+ total_received += states[i].received;
+ total_persec += persec;
+ total_sq_persec += persec*persec;
+ printf("%d: %f per second\n", i+1, persec);
+ }
+ printf(" total: %f per second\n",
+ ((double)total_received)/cfg_duration);
+ if (expected_total_persec > 0) {
+ double diff = expected_total_persec -
+ ((double)total_received/cfg_duration);
+ printf(" [Off by %lf]\n", diff);
+ if (cfg_grouplimit_tolerance > 0 &&
+ fabs(diff) > cfg_grouplimit_tolerance) {
+ fprintf(stderr, "Group bandwidth out of bounds\n");
+ ok = 0;
+ }
+ }
+
+ printf(" average: %f per second\n",
+ (((double)total_received)/cfg_duration)/cfg_n_connections);
+ if (expected_avg_persec > 0) {
+ double diff = expected_avg_persec - (((double)total_received)/cfg_duration)/cfg_n_connections;
+ printf(" [Off by %lf]\n", diff);
+ if (cfg_connlimit_tolerance > 0 &&
+ fabs(diff) > cfg_connlimit_tolerance) {
+ fprintf(stderr, "Connection bandwidth out of bounds\n");
+ ok = 0;
+ }
+ }
+
+ variance = total_sq_persec/cfg_n_connections - total_persec*total_persec/(cfg_n_connections*cfg_n_connections);
+
+ printf(" stddev: %f per second\n", sqrt(variance));
+ if (cfg_stddev_tolerance > 0 &&
+ sqrt(variance) > cfg_stddev_tolerance) {
+ fprintf(stderr, "Connection variance out of bounds\n");
+ ok = 0;
+ }
+
+ event_base_free(base);
+ free(bevs);
+ free(states);
+
+ return ok ? 0 : 1;
+}
+
+static struct option {
+ const char *name; int *ptr; int min; int isbool;
+} options[] = {
+ { "-v", &cfg_verbose, 0, 1 },
+ { "-h", &cfg_help, 0, 1 },
+ { "-n", &cfg_n_connections, 1, 0 },
+ { "-d", &cfg_duration, 1, 0 },
+ { "-c", &cfg_connlimit, 0, 0 },
+ { "-g", &cfg_grouplimit, 0, 0 },
+ { "-G", &cfg_group_drain, -100000, 0 },
+ { "-t", &cfg_tick_msec, 10, 0 },
+ { "--min-share", &cfg_min_share, 0, 0 },
+ { "--check-connlimit", &cfg_connlimit_tolerance, 0, 0 },
+ { "--check-grouplimit", &cfg_grouplimit_tolerance, 0, 0 },
+ { "--check-stddev", &cfg_stddev_tolerance, 0, 0 },
+#ifdef _WIN32
+ { "--iocp", &cfg_enable_iocp, 0, 1 },
+#endif
+ { NULL, NULL, -1, 0 },
+};
+
+static int
+handle_option(int argc, char **argv, int *i, const struct option *opt)
+{
+ long val;
+ char *endptr = NULL;
+ if (opt->isbool) {
+ *opt->ptr = 1;
+ return 0;
+ }
+ if (*i + 1 == argc) {
+ fprintf(stderr, "Too few arguments to '%s'\n",argv[*i]);
+ return -1;
+ }
+ val = strtol(argv[*i+1], &endptr, 10);
+ if (*argv[*i+1] == '\0' || !endptr || *endptr != '\0') {
+ fprintf(stderr, "Couldn't parse numeric value '%s'\n",
+ argv[*i+1]);
+ return -1;
+ }
+ if (val < opt->min || val > 0x7fffffff) {
+ fprintf(stderr, "Value '%s' is out-of-range'\n",
+ argv[*i+1]);
+ return -1;
+ }
+ *opt->ptr = (int)val;
+ ++*i;
+ return 0;
+}
+
+static void
+usage(void)
+{
+ fprintf(stderr,
+"test-ratelim [-v] [-n INT] [-d INT] [-c INT] [-g INT] [-t INT]\n\n"
+"Pushes bytes through a number of possibly rate-limited connections, and\n"
+"displays average throughput.\n\n"
+" -n INT: Number of connections to open (default: 30)\n"
+" -d INT: Duration of the test in seconds (default: 5 sec)\n");
+ fprintf(stderr,
+" -c INT: Connection-rate limit applied to each connection in bytes per second\n"
+" (default: None.)\n"
+" -g INT: Group-rate limit applied to sum of all usage in bytes per second\n"
+" (default: None.)\n"
+" -G INT: drain INT bytes from the group limit every tick. (default: 0)\n"
+" -t INT: Granularity of timing, in milliseconds (default: 1000 msec)\n");
+}
+
+int
+main(int argc, char **argv)
+{
+ int i,j;
+ double ratio;
+
+#ifdef _WIN32
+ WORD wVersionRequested = MAKEWORD(2,2);
+ WSADATA wsaData;
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+#ifndef _WIN32
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return 1;
+#endif
+ for (i = 1; i < argc; ++i) {
+ for (j = 0; options[j].name; ++j) {
+ if (!strcmp(argv[i],options[j].name)) {
+ if (handle_option(argc,argv,&i,&options[j])<0)
+ return 1;
+ goto again;
+ }
+ }
+ fprintf(stderr, "Unknown option '%s'\n", argv[i]);
+ usage();
+ return 1;
+ again:
+ ;
+ }
+ if (cfg_help) {
+ usage();
+ return 0;
+ }
+
+ cfg_tick.tv_sec = cfg_tick_msec / 1000;
+ cfg_tick.tv_usec = (cfg_tick_msec % 1000)*1000;
+
+ seconds_per_tick = ratio = cfg_tick_msec / 1000.0;
+
+ cfg_connlimit *= ratio;
+ cfg_grouplimit *= ratio;
+
+ {
+ struct timeval tv;
+ evutil_gettimeofday(&tv, NULL);
+#ifdef _WIN32
+ srand(tv.tv_usec);
+#else
+ srandom(tv.tv_usec);
+#endif
+ }
+
+#ifndef EVENT__DISABLE_THREAD_SUPPORT
+ evthread_enable_lock_debugging();
+#endif
+
+ return test_ratelimiting();
+}
diff --git a/sntp/libevent/test/test-time.c b/sntp/libevent/test/test-time.c
new file mode 100644
index 0000000..dcd6639
--- /dev/null
+++ b/sntp/libevent/test/test-time.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32
+#include <unistd.h>
+#include <sys/time.h>
+#endif
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/event_compat.h"
+#include "event2/event_struct.h"
+
+int called = 0;
+
+#define NEVENT 20000
+
+struct event *ev[NEVENT];
+
+static int
+rand_int(int n)
+{
+#ifdef _WIN32
+ return (int)(rand() % n);
+#else
+ return (int)(random() % n);
+#endif
+}
+
+static void
+time_cb(evutil_socket_t fd, short event, void *arg)
+{
+ struct timeval tv;
+ int i, j;
+
+ called++;
+
+ if (called < 10*NEVENT) {
+ for (i = 0; i < 10; i++) {
+ j = rand_int(NEVENT);
+ tv.tv_sec = 0;
+ tv.tv_usec = rand_int(50000);
+ if (tv.tv_usec % 2)
+ evtimer_add(ev[j], &tv);
+ else
+ evtimer_del(ev[j]);
+ }
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ struct timeval tv;
+ int i;
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ /* Initalize the event library */
+ event_init();
+
+ for (i = 0; i < NEVENT; i++) {
+ ev[i] = malloc(sizeof(struct event));
+
+ /* Initalize one event */
+ evtimer_set(ev[i], time_cb, ev[i]);
+ tv.tv_sec = 0;
+ tv.tv_usec = rand_int(50000);
+ evtimer_add(ev[i], &tv);
+ }
+
+ event_dispatch();
+
+ return (called < NEVENT);
+}
+
diff --git a/sntp/libevent/test/test-weof.c b/sntp/libevent/test/test-weof.c
new file mode 100644
index 0000000..c379f28
--- /dev/null
+++ b/sntp/libevent/test/test-weof.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2002-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef EVENT__HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+#include <errno.h>
+
+#include "event2/event.h"
+#include "event2/event_struct.h"
+#include "event2/event_compat.h"
+#include "event2/util.h"
+
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+evutil_socket_t pair[2];
+int test_okay = 1;
+int called = 0;
+
+static void
+write_cb(evutil_socket_t fd, short event, void *arg)
+{
+ const char *test = "test string";
+ int len;
+
+ len = send(fd, test, (int)strlen(test) + 1, 0);
+
+ printf("%s: write %d%s\n", __func__,
+ len, len ? "" : " - means EOF");
+
+ if (len > 0) {
+ if (!called)
+ event_add(arg, NULL);
+ evutil_closesocket(pair[0]);
+ } else if (called == 1)
+ test_okay = 0;
+
+ called++;
+}
+
+int
+main(int argc, char **argv)
+{
+ struct event ev;
+
+#ifdef _WIN32
+ WORD wVersionRequested;
+ WSADATA wsaData;
+
+ wVersionRequested = MAKEWORD(2, 2);
+
+ (void) WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+#ifndef _WIN32
+ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+ return (1);
+#endif
+
+ if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
+ return (1);
+
+ /* Initalize the event library */
+ event_init();
+
+ /* Initalize one event */
+ event_set(&ev, pair[1], EV_WRITE, write_cb, &ev);
+
+ event_add(&ev, NULL);
+
+ event_dispatch();
+
+ return (test_okay);
+}
+
diff --git a/sntp/libevent/test/test.sh b/sntp/libevent/test/test.sh
new file mode 100755
index 0000000..2b083ac
--- /dev/null
+++ b/sntp/libevent/test/test.sh
@@ -0,0 +1,144 @@
+#!/bin/sh
+
+BACKENDS="EVPORT KQUEUE EPOLL DEVPOLL POLL SELECT WIN32"
+TESTS="test-eof test-closed test-weof test-time test-changelist test-fdleak"
+FAILED=no
+TEST_OUTPUT_FILE=${TEST_OUTPUT_FILE:-/dev/null}
+REGRESS_ARGS=${REGRESS_ARGS:-}
+
+# /bin/echo is a little more likely to support -n than sh's builtin echo,
+# printf is even more likely
+if test "`printf %s hello 2>&1`" = "hello"
+then
+ ECHO_N="printf %s"
+else
+ if test -x /bin/echo
+ then
+ ECHO_N="/bin/echo -n"
+ else
+ ECHO_N="echo -n"
+ fi
+fi
+
+if test "$TEST_OUTPUT_FILE" != "/dev/null"
+then
+ touch "$TEST_OUTPUT_FILE" || exit 1
+fi
+
+TEST_DIR=.
+TEST_SRC_DIR=.
+
+T=`echo "$0" | sed -e 's/test.sh$//' | sed -e 's/test-script.sh//' `
+if test -x "$T/test-init"
+then
+ TEST_DIR="$T"
+elif test -x "./test/test-init"
+then
+ TEST_DIR="./test"
+fi
+if test -f "$T/check-dumpevents.py"
+then
+ TEST_SRC_DIR="$T"
+elif test -f "./test/check-dumpevents.py"
+then
+ TEST_SRC_DIR="./test"
+fi
+
+setup () {
+ for i in $BACKENDS; do
+ eval "EVENT_NO$i=yes; export EVENT_NO$i"
+ done
+ unset EVENT_EPOLL_USE_CHANGELIST
+ unset EVENT_PRECISE_TIMER
+}
+
+announce () {
+ echo "$@"
+ echo "$@" >>"$TEST_OUTPUT_FILE"
+}
+
+announce_n () {
+ $ECHO_N "$@"
+ echo "$@" >>"$TEST_OUTPUT_FILE"
+}
+
+
+run_tests () {
+ if $TEST_DIR/test-init 2>>"$TEST_OUTPUT_FILE" ;
+ then
+ true
+ else
+ announce Skipping test
+ return
+ fi
+ for i in $TESTS; do
+ announce_n " $i: "
+ if $TEST_DIR/$i >>"$TEST_OUTPUT_FILE" ;
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+ done
+ announce_n " test-dumpevents: "
+ if python2 -c 'import sys; assert(sys.version_info >= (2, 4))' 2>/dev/null && test -f $TEST_SRC_DIR/check-dumpevents.py; then
+ if $TEST_DIR/test-dumpevents | python2 $TEST_SRC_DIR/check-dumpevents.py >> "$TEST_OUTPUT_FILE" ;
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ fi
+ else
+ # no python
+ if $TEST_DIR/test-dumpevents >/dev/null; then
+ announce "OKAY (output not checked)" ;
+ else
+ announce "FAILED (output not checked)" ;
+ fi
+ fi
+ test -x $TEST_DIR/regress || return
+ announce_n " regress: "
+ if test "$TEST_OUTPUT_FILE" = "/dev/null" ;
+ then
+ $TEST_DIR/regress --quiet $REGRESS_ARGS
+ else
+ $TEST_DIR/regress $REGRESS_ARGS >>"$TEST_OUTPUT_FILE"
+ fi
+ if test "$?" = "0" ;
+ then
+ announce OKAY ;
+ else
+ announce FAILED ;
+ FAILED=yes
+ fi
+}
+
+do_test() {
+ setup
+ announce "$1 $2"
+ unset EVENT_NO$1
+ if test "$2" = "(changelist)" ; then
+ EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST
+ elif test "$2" = "(timerfd)" ; then
+ EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER
+ elif test "$2" = "(timerfd+changelist)" ; then
+ EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST
+ EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER
+ fi
+
+ run_tests
+}
+
+announce "Running tests:"
+
+do_test EPOLL "(timerfd)"
+do_test EPOLL "(changelist)"
+do_test EPOLL "(timerfd+changelist)"
+for i in $BACKENDS; do
+ do_test $i
+done
+
+if test "$FAILED" = "yes"; then
+ exit 1
+fi
diff --git a/sntp/libevent/test/tinytest.c b/sntp/libevent/test/tinytest.c
new file mode 100644
index 0000000..36b3a62
--- /dev/null
+++ b/sntp/libevent/test/tinytest.c
@@ -0,0 +1,460 @@
+/* tinytest.c -- Copyright 2009-2012 Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifdef TINYTEST_LOCAL
+#include "tinytest_local.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#endif
+
+#if defined(__APPLE__) && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+/* Workaround for a stupid bug in OSX 10.6 */
+#define FORK_BREAKS_GCOV
+#include <vproc.h>
+#endif
+#endif
+
+#ifndef __GNUC__
+#define __attribute__(x)
+#endif
+
+#include "tinytest.h"
+#include "tinytest_macros.h"
+
+#define LONGEST_TEST_NAME 16384
+
+static int in_tinytest_main = 0; /**< true if we're in tinytest_main().*/
+static int n_ok = 0; /**< Number of tests that have passed */
+static int n_bad = 0; /**< Number of tests that have failed. */
+static int n_skipped = 0; /**< Number of tests that have been skipped. */
+
+static int opt_forked = 0; /**< True iff we're called from inside a win32 fork*/
+static int opt_nofork = 0; /**< Suppress calls to fork() for debugging. */
+static int opt_verbosity = 1; /**< -==quiet,0==terse,1==normal,2==verbose */
+const char *verbosity_flag = "";
+
+const struct testlist_alias_t *cfg_aliases=NULL;
+
+enum outcome { SKIP=2, OK=1, FAIL=0 };
+static enum outcome cur_test_outcome = 0;
+const char *cur_test_prefix = NULL; /**< prefix of the current test group */
+/** Name of the current test, if we haven't logged is yet. Used for --quiet */
+const char *cur_test_name = NULL;
+
+#ifdef _WIN32
+/* Copy of argv[0] for win32. */
+static char commandname[MAX_PATH+1];
+#endif
+
+static void usage(struct testgroup_t *groups, int list_groups)
+ __attribute__((noreturn));
+static int process_test_option(struct testgroup_t *groups, const char *test);
+
+static enum outcome
+testcase_run_bare_(const struct testcase_t *testcase)
+{
+ void *env = NULL;
+ int outcome;
+ if (testcase->setup) {
+ env = testcase->setup->setup_fn(testcase);
+ if (!env)
+ return FAIL;
+ else if (env == (void*)TT_SKIP)
+ return SKIP;
+ }
+
+ cur_test_outcome = OK;
+ testcase->fn(env);
+ outcome = cur_test_outcome;
+
+ if (testcase->setup) {
+ if (testcase->setup->cleanup_fn(testcase, env) == 0)
+ outcome = FAIL;
+ }
+
+ return outcome;
+}
+
+#define MAGIC_EXITCODE 42
+
+static enum outcome
+testcase_run_forked_(const struct testgroup_t *group,
+ const struct testcase_t *testcase)
+{
+#ifdef _WIN32
+ /* Fork? On Win32? How primitive! We'll do what the smart kids do:
+ we'll invoke our own exe (whose name we recall from the command
+ line) with a command line that tells it to run just the test we
+ want, and this time without forking.
+
+ (No, threads aren't an option. The whole point of forking is to
+ share no state between tests.)
+ */
+ int ok;
+ char buffer[LONGEST_TEST_NAME+256];
+ STARTUPINFOA si;
+ PROCESS_INFORMATION info;
+ DWORD exitcode;
+
+ if (!in_tinytest_main) {
+ printf("\nERROR. On Windows, testcase_run_forked_ must be"
+ " called from within tinytest_main.\n");
+ abort();
+ }
+ if (opt_verbosity>0)
+ printf("[forking] ");
+
+ snprintf(buffer, sizeof(buffer), "%s --RUNNING-FORKED %s %s%s",
+ commandname, verbosity_flag, group->prefix, testcase->name);
+
+ memset(&si, 0, sizeof(si));
+ memset(&info, 0, sizeof(info));
+ si.cb = sizeof(si);
+
+ ok = CreateProcessA(commandname, buffer, NULL, NULL, 0,
+ 0, NULL, NULL, &si, &info);
+ if (!ok) {
+ printf("CreateProcess failed!\n");
+ return 0;
+ }
+ WaitForSingleObject(info.hProcess, INFINITE);
+ GetExitCodeProcess(info.hProcess, &exitcode);
+ CloseHandle(info.hProcess);
+ CloseHandle(info.hThread);
+ if (exitcode == 0)
+ return OK;
+ else if (exitcode == MAGIC_EXITCODE)
+ return SKIP;
+ else
+ return FAIL;
+#else
+ int outcome_pipe[2];
+ pid_t pid;
+ (void)group;
+
+ if (pipe(outcome_pipe))
+ perror("opening pipe");
+
+ if (opt_verbosity>0)
+ printf("[forking] ");
+ pid = fork();
+#ifdef FORK_BREAKS_GCOV
+ vproc_transaction_begin(0);
+#endif
+ if (!pid) {
+ /* child. */
+ int test_r, write_r;
+ char b[1];
+ close(outcome_pipe[0]);
+ test_r = testcase_run_bare_(testcase);
+ assert(0<=(int)test_r && (int)test_r<=2);
+ b[0] = "NYS"[test_r];
+ write_r = (int)write(outcome_pipe[1], b, 1);
+ if (write_r != 1) {
+ perror("write outcome to pipe");
+ exit(1);
+ }
+ exit(0);
+ return FAIL; /* unreachable */
+ } else {
+ /* parent */
+ int status, r;
+ char b[1];
+ /* Close this now, so that if the other side closes it,
+ * our read fails. */
+ close(outcome_pipe[1]);
+ r = (int)read(outcome_pipe[0], b, 1);
+ if (r == 0) {
+ printf("[Lost connection!] ");
+ return 0;
+ } else if (r != 1) {
+ perror("read outcome from pipe");
+ }
+ waitpid(pid, &status, 0);
+ close(outcome_pipe[0]);
+ return b[0]=='Y' ? OK : (b[0]=='S' ? SKIP : FAIL);
+ }
+#endif
+}
+
+int
+testcase_run_one(const struct testgroup_t *group,
+ const struct testcase_t *testcase)
+{
+ enum outcome outcome;
+
+ if (testcase->flags & (TT_SKIP|TT_OFF_BY_DEFAULT)) {
+ if (opt_verbosity>0)
+ printf("%s%s: %s\n",
+ group->prefix, testcase->name,
+ (testcase->flags & TT_SKIP) ? "SKIPPED" : "DISABLED");
+ ++n_skipped;
+ return SKIP;
+ }
+
+ if (opt_verbosity>0 && !opt_forked) {
+ printf("%s%s: ", group->prefix, testcase->name);
+ } else {
+ if (opt_verbosity==0) printf(".");
+ cur_test_prefix = group->prefix;
+ cur_test_name = testcase->name;
+ }
+
+ if ((testcase->flags & TT_FORK) && !(opt_forked||opt_nofork)) {
+ outcome = testcase_run_forked_(group, testcase);
+ } else {
+ outcome = testcase_run_bare_(testcase);
+ }
+
+ if (outcome == OK) {
+ ++n_ok;
+ if (opt_verbosity>0 && !opt_forked)
+ puts(opt_verbosity==1?"OK":"");
+ } else if (outcome == SKIP) {
+ ++n_skipped;
+ if (opt_verbosity>0 && !opt_forked)
+ puts("SKIPPED");
+ } else {
+ ++n_bad;
+ if (!opt_forked)
+ printf("\n [%s FAILED]\n", testcase->name);
+ }
+
+ if (opt_forked) {
+ exit(outcome==OK ? 0 : (outcome==SKIP?MAGIC_EXITCODE : 1));
+ return 1; /* unreachable */
+ } else {
+ return (int)outcome;
+ }
+}
+
+int
+tinytest_set_flag_(struct testgroup_t *groups, const char *arg, int set, unsigned long flag)
+{
+ int i, j;
+ size_t length = LONGEST_TEST_NAME;
+ char fullname[LONGEST_TEST_NAME];
+ int found=0;
+ if (strstr(arg, ".."))
+ length = strstr(arg,"..")-arg;
+ for (i=0; groups[i].prefix; ++i) {
+ for (j=0; groups[i].cases[j].name; ++j) {
+ struct testcase_t *testcase = &groups[i].cases[j];
+ snprintf(fullname, sizeof(fullname), "%s%s",
+ groups[i].prefix, testcase->name);
+ if (!flag) { /* Hack! */
+ printf(" %s", fullname);
+ if (testcase->flags & TT_OFF_BY_DEFAULT)
+ puts(" (Off by default)");
+ else if (testcase->flags & TT_SKIP)
+ puts(" (DISABLED)");
+ else
+ puts("");
+ }
+ if (!strncmp(fullname, arg, length)) {
+ if (set)
+ testcase->flags |= flag;
+ else
+ testcase->flags &= ~flag;
+ ++found;
+ }
+ }
+ }
+ return found;
+}
+
+static void
+usage(struct testgroup_t *groups, int list_groups)
+{
+ puts("Options are: [--verbose|--quiet|--terse] [--no-fork]");
+ puts(" Specify tests by name, or using a prefix ending with '..'");
+ puts(" To skip a test, prefix its name with a colon.");
+ puts(" To enable a disabled test, prefix its name with a plus.");
+ puts(" Use --list-tests for a list of tests.");
+ if (list_groups) {
+ puts("Known tests are:");
+ tinytest_set_flag_(groups, "..", 1, 0);
+ }
+ exit(0);
+}
+
+static int
+process_test_alias(struct testgroup_t *groups, const char *test)
+{
+ int i, j, n, r;
+ for (i=0; cfg_aliases && cfg_aliases[i].name; ++i) {
+ if (!strcmp(cfg_aliases[i].name, test)) {
+ n = 0;
+ for (j = 0; cfg_aliases[i].tests[j]; ++j) {
+ r = process_test_option(groups, cfg_aliases[i].tests[j]);
+ if (r<0)
+ return -1;
+ n += r;
+ }
+ return n;
+ }
+ }
+ printf("No such test alias as @%s!",test);
+ return -1;
+}
+
+static int
+process_test_option(struct testgroup_t *groups, const char *test)
+{
+ int flag = TT_ENABLED_;
+ int n = 0;
+ if (test[0] == '@') {
+ return process_test_alias(groups, test + 1);
+ } else if (test[0] == ':') {
+ ++test;
+ flag = TT_SKIP;
+ } else if (test[0] == '+') {
+ ++test;
+ ++n;
+ if (!tinytest_set_flag_(groups, test, 0, TT_OFF_BY_DEFAULT)) {
+ printf("No such test as %s!\n", test);
+ return -1;
+ }
+ } else {
+ ++n;
+ }
+ if (!tinytest_set_flag_(groups, test, 1, flag)) {
+ printf("No such test as %s!\n", test);
+ return -1;
+ }
+ return n;
+}
+
+void
+tinytest_set_aliases(const struct testlist_alias_t *aliases)
+{
+ cfg_aliases = aliases;
+}
+
+int
+tinytest_main(int c, const char **v, struct testgroup_t *groups)
+{
+ int i, j, n=0;
+
+#ifdef _WIN32
+ const char *sp = strrchr(v[0], '.');
+ const char *extension = "";
+ if (!sp || stricmp(sp, ".exe"))
+ extension = ".exe"; /* Add an exe so CreateProcess will work */
+ snprintf(commandname, sizeof(commandname), "%s%s", v[0], extension);
+ commandname[MAX_PATH]='\0';
+#endif
+ for (i=1; i<c; ++i) {
+ if (v[i][0] == '-') {
+ if (!strcmp(v[i], "--RUNNING-FORKED")) {
+ opt_forked = 1;
+ } else if (!strcmp(v[i], "--no-fork")) {
+ opt_nofork = 1;
+ } else if (!strcmp(v[i], "--quiet")) {
+ opt_verbosity = -1;
+ verbosity_flag = "--quiet";
+ } else if (!strcmp(v[i], "--verbose")) {
+ opt_verbosity = 2;
+ verbosity_flag = "--verbose";
+ } else if (!strcmp(v[i], "--terse")) {
+ opt_verbosity = 0;
+ verbosity_flag = "--terse";
+ } else if (!strcmp(v[i], "--help")) {
+ usage(groups, 0);
+ } else if (!strcmp(v[i], "--list-tests")) {
+ usage(groups, 1);
+ } else {
+ printf("Unknown option %s. Try --help\n",v[i]);
+ return -1;
+ }
+ } else {
+ int r = process_test_option(groups, v[i]);
+ if (r<0)
+ return -1;
+ n += r;
+ }
+ }
+ if (!n)
+ tinytest_set_flag_(groups, "..", 1, TT_ENABLED_);
+
+ setvbuf(stdout, NULL, _IONBF, 0);
+
+ ++in_tinytest_main;
+ for (i=0; groups[i].prefix; ++i)
+ for (j=0; groups[i].cases[j].name; ++j)
+ if (groups[i].cases[j].flags & TT_ENABLED_)
+ testcase_run_one(&groups[i],
+ &groups[i].cases[j]);
+
+ --in_tinytest_main;
+
+ if (opt_verbosity==0)
+ puts("");
+
+ if (n_bad)
+ printf("%d/%d TESTS FAILED. (%d skipped)\n", n_bad,
+ n_bad+n_ok,n_skipped);
+ else if (opt_verbosity >= 1)
+ printf("%d tests ok. (%d skipped)\n", n_ok, n_skipped);
+
+ return (n_bad == 0) ? 0 : 1;
+}
+
+int
+tinytest_get_verbosity_(void)
+{
+ return opt_verbosity;
+}
+
+void
+tinytest_set_test_failed_(void)
+{
+ if (opt_verbosity <= 0 && cur_test_name) {
+ if (opt_verbosity==0) puts("");
+ printf("%s%s: ", cur_test_prefix, cur_test_name);
+ cur_test_name = NULL;
+ }
+ cur_test_outcome = 0;
+}
+
+void
+tinytest_set_test_skipped_(void)
+{
+ if (cur_test_outcome==OK)
+ cur_test_outcome = SKIP;
+}
+
diff --git a/sntp/libevent/test/tinytest.h b/sntp/libevent/test/tinytest.h
new file mode 100644
index 0000000..dff440e
--- /dev/null
+++ b/sntp/libevent/test/tinytest.h
@@ -0,0 +1,98 @@
+/* tinytest.h -- Copyright 2009-2012 Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TINYTEST_H_INCLUDED_
+#define TINYTEST_H_INCLUDED_
+
+/** Flag for a test that needs to run in a subprocess. */
+#define TT_FORK (1<<0)
+/** Runtime flag for a test we've decided to skip. */
+#define TT_SKIP (1<<1)
+/** Internal runtime flag for a test we've decided to run. */
+#define TT_ENABLED_ (1<<2)
+/** Flag for a test that's off by default. */
+#define TT_OFF_BY_DEFAULT (1<<3)
+/** If you add your own flags, make them start at this point. */
+#define TT_FIRST_USER_FLAG (1<<4)
+
+typedef void (*testcase_fn)(void *);
+
+struct testcase_t;
+
+/** Functions to initialize/teardown a structure for a testcase. */
+struct testcase_setup_t {
+ /** Return a new structure for use by a given testcase. */
+ void *(*setup_fn)(const struct testcase_t *);
+ /** Clean/free a structure from setup_fn. Return 1 if ok, 0 on err. */
+ int (*cleanup_fn)(const struct testcase_t *, void *);
+};
+
+/** A single test-case that you can run. */
+struct testcase_t {
+ const char *name; /**< An identifier for this case. */
+ testcase_fn fn; /**< The function to run to implement this case. */
+ unsigned long flags; /**< Bitfield of TT_* flags. */
+ const struct testcase_setup_t *setup; /**< Optional setup/cleanup fns*/
+ void *setup_data; /**< Extra data usable by setup function */
+};
+#define END_OF_TESTCASES { NULL, NULL, 0, NULL, NULL }
+
+/** A group of tests that are selectable together. */
+struct testgroup_t {
+ const char *prefix; /**< Prefix to prepend to testnames. */
+ struct testcase_t *cases; /** Array, ending with END_OF_TESTCASES */
+};
+#define END_OF_GROUPS { NULL, NULL}
+
+struct testlist_alias_t {
+ const char *name;
+ const char **tests;
+};
+#define END_OF_ALIASES { NULL, NULL }
+
+/** Implementation: called from a test to indicate failure, before logging. */
+void tinytest_set_test_failed_(void);
+/** Implementation: called from a test to indicate that we're skipping. */
+void tinytest_set_test_skipped_(void);
+/** Implementation: return 0 for quiet, 1 for normal, 2 for loud. */
+int tinytest_get_verbosity_(void);
+/** Implementation: Set a flag on tests matching a name; returns number
+ * of tests that matched. */
+int tinytest_set_flag_(struct testgroup_t *, const char *, int set, unsigned long);
+
+/** Set all tests in 'groups' matching the name 'named' to be skipped. */
+#define tinytest_skip(groups, named) \
+ tinytest_set_flag_(groups, named, 1, TT_SKIP)
+
+/** Run a single testcase in a single group. */
+int testcase_run_one(const struct testgroup_t *,const struct testcase_t *);
+
+void tinytest_set_aliases(const struct testlist_alias_t *aliases);
+
+/** Run a set of testcases from an END_OF_GROUPS-terminated array of groups,
+ as selected from the command line. */
+int tinytest_main(int argc, const char **argv, struct testgroup_t *groups);
+
+#endif
diff --git a/sntp/libevent/test/tinytest_local.h b/sntp/libevent/test/tinytest_local.h
new file mode 100644
index 0000000..87ec2fa
--- /dev/null
+++ b/sntp/libevent/test/tinytest_local.h
@@ -0,0 +1,12 @@
+
+#include "util-internal.h"
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
+#include "event2/util.h"
+
+#ifdef snprintf
+#undef snprintf
+#endif
+#define snprintf evutil_snprintf
diff --git a/sntp/libevent/test/tinytest_macros.h b/sntp/libevent/test/tinytest_macros.h
new file mode 100644
index 0000000..9ff69b1
--- /dev/null
+++ b/sntp/libevent/test/tinytest_macros.h
@@ -0,0 +1,184 @@
+/* tinytest_macros.h -- Copyright 2009-2012 Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TINYTEST_MACROS_H_INCLUDED_
+#define TINYTEST_MACROS_H_INCLUDED_
+
+/* Helpers for defining statement-like macros */
+#define TT_STMT_BEGIN do {
+#define TT_STMT_END } while (0)
+
+/* Redefine this if your test functions want to abort with something besides
+ * "goto end;" */
+#ifndef TT_EXIT_TEST_FUNCTION
+#define TT_EXIT_TEST_FUNCTION TT_STMT_BEGIN goto end; TT_STMT_END
+#endif
+
+/* Redefine this if you want to note success/failure in some different way. */
+#ifndef TT_DECLARE
+#define TT_DECLARE(prefix, args) \
+ TT_STMT_BEGIN \
+ printf("\n %s %s:%d: ",prefix,__FILE__,__LINE__); \
+ printf args ; \
+ TT_STMT_END
+#endif
+
+/* Announce a failure. Args are parenthesized printf args. */
+#define TT_GRIPE(args) TT_DECLARE("FAIL", args)
+
+/* Announce a non-failure if we're verbose. */
+#define TT_BLATHER(args) \
+ TT_STMT_BEGIN \
+ if (tinytest_get_verbosity_()>1) TT_DECLARE(" OK", args); \
+ TT_STMT_END
+
+#define TT_DIE(args) \
+ TT_STMT_BEGIN \
+ tinytest_set_test_failed_(); \
+ TT_GRIPE(args); \
+ TT_EXIT_TEST_FUNCTION; \
+ TT_STMT_END
+
+#define TT_FAIL(args) \
+ TT_STMT_BEGIN \
+ tinytest_set_test_failed_(); \
+ TT_GRIPE(args); \
+ TT_STMT_END
+
+/* Fail and abort the current test for the reason in msg */
+#define tt_abort_printf(msg) TT_DIE(msg)
+#define tt_abort_perror(op) TT_DIE(("%s: %s [%d]",(op),strerror(errno), errno))
+#define tt_abort_msg(msg) TT_DIE(("%s", msg))
+#define tt_abort() TT_DIE(("%s", "(Failed.)"))
+
+/* Fail but do not abort the current test for the reason in msg. */
+#define tt_failprint_f(msg) TT_FAIL(msg)
+#define tt_fail_perror(op) TT_FAIL(("%s: %s [%d]",(op),strerror(errno), errno))
+#define tt_fail_msg(msg) TT_FAIL(("%s", msg))
+#define tt_fail() TT_FAIL(("%s", "(Failed.)"))
+
+/* End the current test, and indicate we are skipping it. */
+#define tt_skip() \
+ TT_STMT_BEGIN \
+ tinytest_set_test_skipped_(); \
+ TT_EXIT_TEST_FUNCTION; \
+ TT_STMT_END
+
+#define tt_want_(b, msg, fail) \
+ TT_STMT_BEGIN \
+ if (!(b)) { \
+ tinytest_set_test_failed_(); \
+ TT_GRIPE(("%s",msg)); \
+ fail; \
+ } else { \
+ TT_BLATHER(("%s",msg)); \
+ } \
+ TT_STMT_END
+
+/* Assert b, but do not stop the test if b fails. Log msg on failure. */
+#define tt_want_msg(b, msg) \
+ tt_want_(b, msg, );
+
+/* Assert b and stop the test if b fails. Log msg on failure. */
+#define tt_assert_msg(b, msg) \
+ tt_want_(b, msg, TT_EXIT_TEST_FUNCTION);
+
+/* Assert b, but do not stop the test if b fails. */
+#define tt_want(b) tt_want_msg( (b), "want("#b")")
+/* Assert b, and stop the test if b fails. */
+#define tt_assert(b) tt_assert_msg((b), "assert("#b")")
+
+#define tt_assert_test_fmt_type(a,b,str_test,type,test,printf_type,printf_fmt, \
+ setup_block,cleanup_block,die_on_fail) \
+ TT_STMT_BEGIN \
+ type val1_ = (type)(a); \
+ type val2_ = (type)(b); \
+ int tt_status_ = (test); \
+ if (!tt_status_ || tinytest_get_verbosity_()>1) { \
+ printf_type print_; \
+ printf_type print1_; \
+ printf_type print2_; \
+ type value_ = val1_; \
+ setup_block; \
+ print1_ = print_; \
+ value_ = val2_; \
+ setup_block; \
+ print2_ = print_; \
+ TT_DECLARE(tt_status_?" OK":"FAIL", \
+ ("assert(%s): "printf_fmt" vs "printf_fmt, \
+ str_test, print1_, print2_)); \
+ print_ = print1_; \
+ cleanup_block; \
+ print_ = print2_; \
+ cleanup_block; \
+ if (!tt_status_) { \
+ tinytest_set_test_failed_(); \
+ die_on_fail ; \
+ } \
+ } \
+ TT_STMT_END
+
+#define tt_assert_test_type(a,b,str_test,type,test,fmt,die_on_fail) \
+ tt_assert_test_fmt_type(a,b,str_test,type,test,type,fmt, \
+ {print_=value_;},{},die_on_fail)
+
+/* Helper: assert that a op b, when cast to type. Format the values with
+ * printf format fmt on failure. */
+#define tt_assert_op_type(a,op,b,type,fmt) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,type,(val1_ op val2_),fmt, \
+ TT_EXIT_TEST_FUNCTION)
+
+#define tt_int_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_), \
+ "%ld",TT_EXIT_TEST_FUNCTION)
+
+#define tt_uint_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,unsigned long, \
+ (val1_ op val2_),"%lu",TT_EXIT_TEST_FUNCTION)
+
+#define tt_ptr_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,void*, \
+ (val1_ op val2_),"%p",TT_EXIT_TEST_FUNCTION)
+
+#define tt_str_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,const char *, \
+ (strcmp(val1_,val2_) op 0),"<%s>",TT_EXIT_TEST_FUNCTION)
+
+#define tt_want_int_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,long,(val1_ op val2_),"%ld",(void)0)
+
+#define tt_want_uint_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,unsigned long, \
+ (val1_ op val2_),"%lu",(void)0)
+
+#define tt_want_ptr_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,void*, \
+ (val1_ op val2_),"%p",(void)0)
+
+#define tt_want_str_op(a,op,b) \
+ tt_assert_test_type(a,b,#a" "#op" "#b,const char *, \
+ (strcmp(val1_,val2_) op 0),"<%s>",(void)0)
+
+#endif
diff --git a/sntp/libevent/time-internal.h b/sntp/libevent/time-internal.h
new file mode 100644
index 0000000..daf20f4
--- /dev/null
+++ b/sntp/libevent/time-internal.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef TIME_INTERNAL_H_INCLUDED_
+#define TIME_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef EVENT__HAVE_MACH_MACH_TIME_H
+/* For mach_timebase_info */
+#include <mach/mach_time.h>
+#endif
+
+#include <time.h>
+
+#include "event2/util.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(EVENT__HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+#define HAVE_POSIX_MONOTONIC
+#elif defined(EVENT__HAVE_MACH_ABSOLUTE_TIME)
+#define HAVE_MACH_MONOTONIC
+#elif defined(_WIN32)
+#define HAVE_WIN32_MONOTONIC
+#else
+#define HAVE_FALLBACK_MONOTONIC
+#endif
+
+long evutil_tv_to_msec_(const struct timeval *tv);
+void evutil_usleep_(const struct timeval *tv);
+
+#ifdef _WIN32
+typedef ULONGLONG (WINAPI *ev_GetTickCount_func)(void);
+#endif
+
+struct evutil_monotonic_timer {
+
+#ifdef HAVE_MACH_MONOTONIC
+ struct mach_timebase_info mach_timebase_units;
+#endif
+
+#ifdef HAVE_POSIX_MONOTONIC
+ int monotonic_clock;
+#endif
+
+#ifdef HAVE_WIN32_MONOTONIC
+ ev_GetTickCount_func GetTickCount64_fn;
+ ev_GetTickCount_func GetTickCount_fn;
+ ev_uint64_t last_tick_count;
+ ev_uint64_t adjust_tick_count;
+
+ ev_uint64_t first_tick;
+ ev_uint64_t first_counter;
+ double usec_per_count;
+ int use_performance_counter;
+#endif
+
+ struct timeval adjust_monotonic_clock;
+ struct timeval last_time;
+};
+
+#define EV_MONOT_PRECISE 1
+#define EV_MONOT_FALLBACK 2
+
+int evutil_configure_monotonic_time_(struct evutil_monotonic_timer *mt,
+ int flags);
+int evutil_gettime_monotonic_(struct evutil_monotonic_timer *mt, struct timeval *tv);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EVENT_INTERNAL_H_INCLUDED_ */
diff --git a/sntp/libevent/util-internal.h b/sntp/libevent/util-internal.h
new file mode 100644
index 0000000..5866dbc
--- /dev/null
+++ b/sntp/libevent/util-internal.h
@@ -0,0 +1,479 @@
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef UTIL_INTERNAL_H_INCLUDED_
+#define UTIL_INTERNAL_H_INCLUDED_
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#include <errno.h>
+
+/* For EVUTIL_ASSERT */
+#include "log-internal.h"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef EVENT__HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef EVENT__HAVE_SYS_EVENTFD_H
+#include <sys/eventfd.h>
+#endif
+#include "event2/util.h"
+
+#include "time-internal.h"
+#include "ipv6-internal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* If we need magic to say "inline", get it for free internally. */
+#ifdef EVENT__inline
+#define inline EVENT__inline
+#endif
+#ifdef EVENT____func__
+#define __func__ EVENT____func__
+#endif
+
+/* A good no-op to use in macro definitions. */
+#define EVUTIL_NIL_STMT_ ((void)0)
+/* A no-op that tricks the compiler into thinking a condition is used while
+ * definitely not making any code for it. Used to compile out asserts while
+ * avoiding "unused variable" warnings. The "!" forces the compiler to
+ * do the sizeof() on an int, in case "condition" is a bitfield value.
+ */
+#define EVUTIL_NIL_CONDITION_(condition) do { \
+ (void)sizeof(!(condition)); \
+} while(0)
+
+/* Internal use only: macros to match patterns of error codes in a
+ cross-platform way. We need these macros because of two historical
+ reasons: first, nonblocking IO functions are generally written to give an
+ error on the "blocked now, try later" case, so sometimes an error from a
+ read, write, connect, or accept means "no error; just wait for more
+ data," and we need to look at the error code. Second, Windows defines
+ a different set of error codes for sockets. */
+
+#ifndef _WIN32
+
+#if EAGAIN == EWOULDBLOCK
+#define EVUTIL_ERR_IS_EAGAIN(e) \
+ ((e) == EAGAIN)
+#else
+#define EVUTIL_ERR_IS_EAGAIN(e) \
+ ((e) == EAGAIN || (e) == EWOULDBLOCK)
+#endif
+
+/* True iff e is an error that means a read/write operation can be retried. */
+#define EVUTIL_ERR_RW_RETRIABLE(e) \
+ ((e) == EINTR || EVUTIL_ERR_IS_EAGAIN(e))
+/* True iff e is an error that means an connect can be retried. */
+#define EVUTIL_ERR_CONNECT_RETRIABLE(e) \
+ ((e) == EINTR || (e) == EINPROGRESS)
+/* True iff e is an error that means a accept can be retried. */
+#define EVUTIL_ERR_ACCEPT_RETRIABLE(e) \
+ ((e) == EINTR || EVUTIL_ERR_IS_EAGAIN(e) || (e) == ECONNABORTED)
+
+/* True iff e is an error that means the connection was refused */
+#define EVUTIL_ERR_CONNECT_REFUSED(e) \
+ ((e) == ECONNREFUSED)
+
+#else
+/* Win32 */
+
+#define EVUTIL_ERR_IS_EAGAIN(e) \
+ ((e) == WSAEWOULDBLOCK || (e) == EAGAIN)
+
+#define EVUTIL_ERR_RW_RETRIABLE(e) \
+ ((e) == WSAEWOULDBLOCK || \
+ (e) == WSAEINTR)
+
+#define EVUTIL_ERR_CONNECT_RETRIABLE(e) \
+ ((e) == WSAEWOULDBLOCK || \
+ (e) == WSAEINTR || \
+ (e) == WSAEINPROGRESS || \
+ (e) == WSAEINVAL)
+
+#define EVUTIL_ERR_ACCEPT_RETRIABLE(e) \
+ EVUTIL_ERR_RW_RETRIABLE(e)
+
+#define EVUTIL_ERR_CONNECT_REFUSED(e) \
+ ((e) == WSAECONNREFUSED)
+
+#endif
+
+/* Arguments for shutdown() */
+#ifdef SHUT_RD
+#define EVUTIL_SHUT_RD SHUT_RD
+#else
+#define EVUTIL_SHUT_RD 0
+#endif
+#ifdef SHUT_WR
+#define EVUTIL_SHUT_WR SHUT_WR
+#else
+#define EVUTIL_SHUT_WR 1
+#endif
+#ifdef SHUT_BOTH
+#define EVUTIL_SHUT_BOTH SHUT_BOTH
+#else
+#define EVUTIL_SHUT_BOTH 2
+#endif
+
+/* Helper: Verify that all the elements in 'dlist' are internally consistent.
+ * Checks for circular lists and bad prev/next pointers.
+ *
+ * Example usage:
+ * EVUTIL_ASSERT_LIST_OK(eventlist, event, ev_next);
+ */
+#define EVUTIL_ASSERT_LIST_OK(dlist, type, field) do { \
+ struct type *elm1, *elm2, **nextp; \
+ if (LIST_EMPTY((dlist))) \
+ break; \
+ \
+ /* Check list for circularity using Floyd's */ \
+ /* 'Tortoise and Hare' algorithm */ \
+ elm1 = LIST_FIRST((dlist)); \
+ elm2 = LIST_NEXT(elm1, field); \
+ while (elm1 && elm2) { \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm1 = LIST_NEXT(elm1, field); \
+ elm2 = LIST_NEXT(elm2, field); \
+ if (!elm2) \
+ break; \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm2 = LIST_NEXT(elm2, field); \
+ } \
+ \
+ /* Now check next and prev pointers for consistency. */ \
+ nextp = &LIST_FIRST((dlist)); \
+ elm1 = LIST_FIRST((dlist)); \
+ while (elm1) { \
+ EVUTIL_ASSERT(*nextp == elm1); \
+ EVUTIL_ASSERT(nextp == elm1->field.le_prev); \
+ nextp = &LIST_NEXT(elm1, field); \
+ elm1 = *nextp; \
+ } \
+ } while (0)
+
+/* Helper: Verify that all the elements in a TAILQ are internally consistent.
+ * Checks for circular lists and bad prev/next pointers.
+ *
+ * Example usage:
+ * EVUTIL_ASSERT_TAILQ_OK(activelist, event, ev_active_next);
+ */
+#define EVUTIL_ASSERT_TAILQ_OK(tailq, type, field) do { \
+ struct type *elm1, *elm2, **nextp; \
+ if (TAILQ_EMPTY((tailq))) \
+ break; \
+ \
+ /* Check list for circularity using Floyd's */ \
+ /* 'Tortoise and Hare' algorithm */ \
+ elm1 = TAILQ_FIRST((tailq)); \
+ elm2 = TAILQ_NEXT(elm1, field); \
+ while (elm1 && elm2) { \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm1 = TAILQ_NEXT(elm1, field); \
+ elm2 = TAILQ_NEXT(elm2, field); \
+ if (!elm2) \
+ break; \
+ EVUTIL_ASSERT(elm1 != elm2); \
+ elm2 = TAILQ_NEXT(elm2, field); \
+ } \
+ \
+ /* Now check next and prev pointers for consistency. */ \
+ nextp = &TAILQ_FIRST((tailq)); \
+ elm1 = TAILQ_FIRST((tailq)); \
+ while (elm1) { \
+ EVUTIL_ASSERT(*nextp == elm1); \
+ EVUTIL_ASSERT(nextp == elm1->field.tqe_prev); \
+ nextp = &TAILQ_NEXT(elm1, field); \
+ elm1 = *nextp; \
+ } \
+ EVUTIL_ASSERT(nextp == (tailq)->tqh_last); \
+ } while (0)
+
+/* Locale-independent replacements for some ctypes functions. Use these
+ * when you care about ASCII's notion of character types, because you are about
+ * to send those types onto the wire.
+ */
+int EVUTIL_ISALPHA_(char c);
+int EVUTIL_ISALNUM_(char c);
+int EVUTIL_ISSPACE_(char c);
+int EVUTIL_ISDIGIT_(char c);
+int EVUTIL_ISXDIGIT_(char c);
+int EVUTIL_ISPRINT_(char c);
+int EVUTIL_ISLOWER_(char c);
+int EVUTIL_ISUPPER_(char c);
+char EVUTIL_TOUPPER_(char c);
+char EVUTIL_TOLOWER_(char c);
+
+/** Remove all trailing horizontal whitespace (space or tab) from the end of a
+ * string */
+void evutil_rtrim_lws_(char *);
+
+
+/** Helper macro. If we know that a given pointer points to a field in a
+ structure, return a pointer to the structure itself. Used to implement
+ our half-baked C OO. Example:
+
+ struct subtype {
+ int x;
+ struct supertype common;
+ int y;
+ };
+ ...
+ void fn(struct supertype *super) {
+ struct subtype *sub = EVUTIL_UPCAST(super, struct subtype, common);
+ ...
+ }
+ */
+#define EVUTIL_UPCAST(ptr, type, field) \
+ ((type *)(((char*)(ptr)) - evutil_offsetof(type, field)))
+
+/* As open(pathname, flags, mode), except that the file is always opened with
+ * the close-on-exec flag set. (And the mode argument is mandatory.)
+ */
+int evutil_open_closeonexec_(const char *pathname, int flags, unsigned mode);
+
+int evutil_read_file_(const char *filename, char **content_out, size_t *len_out,
+ int is_binary);
+
+int evutil_socket_connect_(evutil_socket_t *fd_ptr, struct sockaddr *sa, int socklen);
+
+int evutil_socket_finished_connecting_(evutil_socket_t fd);
+
+int evutil_ersatz_socketpair_(int, int , int, evutil_socket_t[]);
+
+int evutil_resolve_(int family, const char *hostname, struct sockaddr *sa,
+ ev_socklen_t *socklen, int port);
+
+const char *evutil_getenv_(const char *name);
+
+/* Structure to hold the state of our weak random number generator.
+ */
+struct evutil_weakrand_state {
+ ev_uint32_t seed;
+};
+
+#define EVUTIL_WEAKRAND_MAX EV_INT32_MAX
+
+/* Initialize the state of a week random number generator based on 'seed'. If
+ * the seed is 0, construct a new seed based on not-very-strong platform
+ * entropy, like the PID and the time of day.
+ *
+ * This function, and the other evutil_weakrand* functions, are meant for
+ * speed, not security or statistical strength. If you need a RNG which an
+ * attacker can't predict, or which passes strong statistical tests, use the
+ * evutil_secure_rng* functions instead.
+ */
+ev_uint32_t evutil_weakrand_seed_(struct evutil_weakrand_state *state, ev_uint32_t seed);
+/* Return a pseudorandom value between 0 and EVUTIL_WEAKRAND_MAX inclusive.
+ * Updates the state in 'seed' as needed -- this value must be protected by a
+ * lock.
+ */
+ev_int32_t evutil_weakrand_(struct evutil_weakrand_state *seed);
+/* Return a pseudorandom value x such that 0 <= x < top. top must be no more
+ * than EVUTIL_WEAKRAND_MAX. Updates the state in 'seed' as needed -- this
+ * value must be proteced by a lock */
+ev_int32_t evutil_weakrand_range_(struct evutil_weakrand_state *seed, ev_int32_t top);
+
+/* Evaluates to the same boolean value as 'p', and hints to the compiler that
+ * we expect this value to be false. */
+#if defined(__GNUC__) && __GNUC__ >= 3 /* gcc 3.0 or later */
+#define EVUTIL_UNLIKELY(p) __builtin_expect(!!(p),0)
+#else
+#define EVUTIL_UNLIKELY(p) (p)
+#endif
+
+/* Replacement for assert() that calls event_errx on failure. */
+#ifdef NDEBUG
+#define EVUTIL_ASSERT(cond) EVUTIL_NIL_CONDITION_(cond)
+#define EVUTIL_FAILURE_CHECK(cond) 0
+#else
+#define EVUTIL_ASSERT(cond) \
+ do { \
+ if (EVUTIL_UNLIKELY(!(cond))) { \
+ event_errx(EVENT_ERR_ABORT_, \
+ "%s:%d: Assertion %s failed in %s", \
+ __FILE__,__LINE__,#cond,__func__); \
+ /* In case a user-supplied handler tries to */ \
+ /* return control to us, log and abort here. */ \
+ (void)fprintf(stderr, \
+ "%s:%d: Assertion %s failed in %s", \
+ __FILE__,__LINE__,#cond,__func__); \
+ abort(); \
+ } \
+ } while (0)
+#define EVUTIL_FAILURE_CHECK(cond) EVUTIL_UNLIKELY(cond)
+#endif
+
+#ifndef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE
+/* Replacement for sockaddr storage that we can use internally on platforms
+ * that lack it. It is not space-efficient, but neither is sockaddr_storage.
+ */
+struct sockaddr_storage {
+ union {
+ struct sockaddr ss_sa;
+ struct sockaddr_in ss_sin;
+ struct sockaddr_in6 ss_sin6;
+ char ss_padding[128];
+ } ss_union;
+};
+#define ss_family ss_union.ss_sa.sa_family
+#endif
+
+/* Internal addrinfo error code. This one is returned from only from
+ * evutil_getaddrinfo_common_, when we are sure that we'll have to hit a DNS
+ * server. */
+#define EVUTIL_EAI_NEED_RESOLVE -90002
+
+struct evdns_base;
+struct evdns_getaddrinfo_request;
+typedef struct evdns_getaddrinfo_request* (*evdns_getaddrinfo_fn)(
+ struct evdns_base *base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ void (*cb)(int, struct evutil_addrinfo *, void *), void *arg);
+
+void evutil_set_evdns_getaddrinfo_fn_(evdns_getaddrinfo_fn fn);
+
+struct evutil_addrinfo *evutil_new_addrinfo_(struct sockaddr *sa,
+ ev_socklen_t socklen, const struct evutil_addrinfo *hints);
+struct evutil_addrinfo *evutil_addrinfo_append_(struct evutil_addrinfo *first,
+ struct evutil_addrinfo *append);
+void evutil_adjust_hints_for_addrconfig_(struct evutil_addrinfo *hints);
+int evutil_getaddrinfo_common_(const char *nodename, const char *servname,
+ struct evutil_addrinfo *hints, struct evutil_addrinfo **res, int *portnum);
+
+int evutil_getaddrinfo_async_(struct evdns_base *dns_base,
+ const char *nodename, const char *servname,
+ const struct evutil_addrinfo *hints_in,
+ void (*cb)(int, struct evutil_addrinfo *, void *), void *arg);
+
+/** Return true iff sa is a looback address. (That is, it is 127.0.0.1/8, or
+ * ::1). */
+int evutil_sockaddr_is_loopback_(const struct sockaddr *sa);
+
+
+/**
+ Formats a sockaddr sa into a string buffer of size outlen stored in out.
+ Returns a pointer to out. Always writes something into out, so it's safe
+ to use the output of this function without checking it for NULL.
+ */
+const char *evutil_format_sockaddr_port_(const struct sockaddr *sa, char *out, size_t outlen);
+
+int evutil_hex_char_to_int_(char c);
+
+
+void evutil_free_secure_rng_globals_(void);
+void evutil_free_globals_(void);
+
+#ifdef _WIN32
+HANDLE evutil_load_windows_system_library_(const TCHAR *library_name);
+#endif
+
+#ifndef EV_SIZE_FMT
+#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
+#define EV_U64_FMT "%I64u"
+#define EV_I64_FMT "%I64d"
+#define EV_I64_ARG(x) ((__int64)(x))
+#define EV_U64_ARG(x) ((unsigned __int64)(x))
+#else
+#define EV_U64_FMT "%llu"
+#define EV_I64_FMT "%lld"
+#define EV_I64_ARG(x) ((long long)(x))
+#define EV_U64_ARG(x) ((unsigned long long)(x))
+#endif
+#endif
+
+#ifdef _WIN32
+#define EV_SOCK_FMT EV_I64_FMT
+#define EV_SOCK_ARG(x) EV_I64_ARG((x))
+#else
+#define EV_SOCK_FMT "%d"
+#define EV_SOCK_ARG(x) (x)
+#endif
+
+#if defined(__STDC__) && defined(__STDC_VERSION__)
+#if (__STDC_VERSION__ >= 199901L)
+#define EV_SIZE_FMT "%zu"
+#define EV_SSIZE_FMT "%zd"
+#define EV_SIZE_ARG(x) (x)
+#define EV_SSIZE_ARG(x) (x)
+#endif
+#endif
+
+#ifndef EV_SIZE_FMT
+#if (EVENT__SIZEOF_SIZE_T <= EVENT__SIZEOF_LONG)
+#define EV_SIZE_FMT "%lu"
+#define EV_SSIZE_FMT "%ld"
+#define EV_SIZE_ARG(x) ((unsigned long)(x))
+#define EV_SSIZE_ARG(x) ((long)(x))
+#else
+#define EV_SIZE_FMT EV_U64_FMT
+#define EV_SSIZE_FMT EV_I64_FMT
+#define EV_SIZE_ARG(x) EV_U64_ARG(x)
+#define EV_SSIZE_ARG(x) EV_I64_ARG(x)
+#endif
+#endif
+
+evutil_socket_t evutil_socket_(int domain, int type, int protocol);
+evutil_socket_t evutil_accept4_(evutil_socket_t sockfd, struct sockaddr *addr,
+ ev_socklen_t *addrlen, int flags);
+
+ /* used by one of the test programs.. */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_internal_pipe_(evutil_socket_t fd[2]);
+evutil_socket_t evutil_eventfd_(unsigned initval, int flags);
+
+#ifdef SOCK_NONBLOCK
+#define EVUTIL_SOCK_NONBLOCK SOCK_NONBLOCK
+#else
+#define EVUTIL_SOCK_NONBLOCK 0x4000000
+#endif
+#ifdef SOCK_CLOEXEC
+#define EVUTIL_SOCK_CLOEXEC SOCK_CLOEXEC
+#else
+#define EVUTIL_SOCK_CLOEXEC 0x80000000
+#endif
+#ifdef EFD_NONBLOCK
+#define EVUTIL_EFD_NONBLOCK EFD_NONBLOCK
+#else
+#define EVUTIL_EFD_NONBLOCK 0x4000
+#endif
+#ifdef EFD_CLOEXEC
+#define EVUTIL_EFD_CLOEXEC EFD_CLOEXEC
+#else
+#define EVUTIL_EFD_CLOEXEC 0x8000
+#endif
+
+void evutil_memclear_(void *mem, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sntp/libevent/whatsnew-2.0.txt b/sntp/libevent/whatsnew-2.0.txt
new file mode 100644
index 0000000..3561fcb
--- /dev/null
+++ b/sntp/libevent/whatsnew-2.0.txt
@@ -0,0 +1,609 @@
+What's New In Libevent 2.0 so far:
+
+1. Meta-issues
+
+1.1. About this document
+
+ This document describes the key differences between Libevent 1.4 and
+ Libevent 2.0, from a user's point of view. It was most recently
+ updated based on features in git master as of August 2010.
+
+ NOTE: I am very sure that I missed some thing on this list. Caveat
+ haxxor.
+
+1.2. Better documentation
+
+ There is now a book-in-progress that explains how to use Libevent and its
+ growing pile of APIs. As of this writing, it covers everything except the
+ http and rpc code. Check out the latest draft at
+ http://www.wangafu.net/~nickm/libevent-book/ .
+
+2. New and Improved Event APIs
+
+ Many APIs are improved, refactored, or deprecated in Libevent 2.0.
+
+ COMPATIBILITY:
+
+ Nearly all existing code that worked with Libevent 1.4 should still
+ work correctly with Libevent 2.0. However, if you are writing new code,
+ or if you want to port old code, we strongly recommend using the new APIs
+ and avoiding deprecated APIs as much as possible.
+
+ Binaries linked against Libevent 1.4 will need to be recompiled to link
+ against Libevent 2.0. This is nothing new; we have never been good at
+ preserving binary compatibility between releases. We'll try harder in the
+ future, though: see 2.1 below.
+
+2.1. New header layout for improved forward-compatibility
+
+ Libevent 2.0 has a new header layout to make it easier for programmers to
+ write good, well-supported libevent code. The new headers are divided
+ into three types.
+
+ There are *regular headers*, like event2/event.h. These headers contain
+ the functions that most programmers will want to use.
+
+ There are *backward compatibility headers*, like event2/event_compat.h.
+ These headers contain declarations for deprecated functions from older
+ versions of Libevent. Documentation in these headers should suggest what's
+ wrong with the old functions, and what functions you want to start using
+ instead of the old ones. Some of these functions might be removed in a
+ future release. New programs should generally not include these headers.
+
+ Finally, there are *structure headers*, like event2/event_struct.h.
+ These headers contain definitions of some structures that Libevent has
+ historically exposed. Exposing them caused problems in the past,
+ since programs that were compiled to work with one version of Libevent
+ would often stop working with another version that changed the size or
+ layout of some object. We've moving them into separate headers so
+ that programmers can know that their code is not depending on any
+ unstable aspect of the Libvent ABI. New programs should generally not
+ include these headers unless they really know what they are doing, are
+ willing to rebuild their software whenever they want to link it
+ against a new version of Libevent, and are willing to risk their code
+ breaking if and when data structures change.
+
+ Functionality that once was located in event.h is now more subdivided.
+ The core event logic is now in event2/event.h. The "evbuffer" functions
+ for low-level buffer manipulation are in event2/buffer.h. The
+ "bufferevent" functions for higher-level buffered IO are in
+ event2/bufferevent.h.
+
+ COMPATIBILITY:
+
+ All of the old headers (event.h, evdns.h, evhttp.h, evrpc.h, and
+ evutil.h) will continue to work by including the corresponding new
+ headers. Old code should not be broken by this change.
+
+2.2. New thread-safe, binary-compatible, harder-to-mess-up APIs
+
+ Some aspects of the historical Libevent API have encouraged
+ non-threadsafe code, or forced code built against one version of Libevent
+ to no longer build with another. The problems with now-deprecated APIs
+ fell into two categories:
+
+ 1) Dependence on the "current" event_base. In an application with
+ multiple event_bases, Libevent previously had a notion of the
+ "current" event_base. New events were linked to this base, and
+ the caller needed to explicitly reattach them to another base.
+ This was horribly error-prone.
+
+ Functions like "event_set" that worked with the "current" event_base
+ are now deprecated but still available (see 2.1). There are new
+ functions like "event_assign" that take an explicit event_base
+ argument when setting up a structure. Using these functions will help
+ prevent errors in your applications, and to be more threadsafe.
+
+ 2) Structure dependence. Applications needed to allocate 'struct
+ event' themselves, since there was no function in Libevent to do it
+ for them. But since the size and contents of struct event can
+ change between libevent versions, this created binary-compatibility
+ nightmares. All structures of this kind are now isolated in
+ _struct.h header (see 2.1), and there are new allocate-and-
+ initialize functions you can use instead of the old initialize-only
+ functions. For example, instead of malloc and event_set, you
+ can use event_new().
+
+ (For people who do really want to allocate a struct event on the
+ stack, or put one inside another structure, you can still use
+ event2/event_compat.h.)
+
+ So in the case where old code would look like this:
+
+ #include <event.h>
+ ...
+ struct event *ev = malloc(sizeof(struct event));
+ /* This call will cause a buffer overrun if you compile with one version
+ of Libevent and link dynamically against another. */
+ event_set(ev, fd, EV_READ, cb, NULL);
+ /* If you forget this call, your code will break in hard-to-diagnose
+ ways in the presence of multiple event bases. */
+ event_set_base(ev, base);
+
+ New code will look more like this:
+
+ #include <event2/event.h>
+ ...
+ struct event *ev;
+ ev = event_new(base, fd, EV_READ, cb, NULL);
+
+2.3. Overrideable allocation functions
+
+ If you want to override the allocation functions used by libevent
+ (for example, to use a specialized allocator, or debug memory
+ issues, or so on), you can replace them by calling
+ event_set_mem_functions. It takes replacements for malloc(),
+ free(), and realloc().
+
+ If you're going to use this facility, you need to call it _before_
+ Libevent does any memory allocation; otherwise, Libevent may allocate some
+ memory with malloc(), and free it with the free() function you provide.
+
+ You can disable this feature when you are building Libevent by passing
+ the --disable-malloc-replacement argument to configure.
+
+2.4. Configurable event_base creation
+
+ Older versions of Libevent would always got the fastest backend
+ available, unless you reconfigured their behavior with the environment
+ variables EVENT_NOSELECT, EVENT_NOPOLL, and so forth. This was annoying
+ to programmers who wanted to pick a backend explicitly without messing
+ with the environment.
+
+ Also, despite our best efforts, not every backend supports every
+ operation we might like. Some features (like edge-triggered events, or
+ working with non-socket file descriptors) only work with some operating
+ systems' fast backends. Previously, programmers who cared about this
+ needed to know which backends supported what. This tended to get quite
+ ungainly.
+
+ There is now an API to choose backends, either by name or by feature.
+ Here is an example:
+
+ struct event_config_t *config;
+ struct event_base *base;
+
+ /* Create a new configuration object. */
+ config = event_config_new();
+ /* We don't want to use the "select" method. */
+ event_config_avoid_method(config, "select");
+ /* We want a method that can work with non-socket file descriptors */
+ event_config_require_features(config, EV_FEATURE_FDS);
+
+ base = event_base_new_with_config(config);
+ if (!base) {
+ /* There is no backend method that does what we want. */
+ exit(1);
+ }
+ event_config_free(config);
+
+ Supported features are documented in event2/event.h
+
+2.5. Socket is now an abstract type
+
+ All APIs that formerly accepted int as a socket type now accept
+ "evutil_socket_t". On Unix, this is just an alias for "int" as
+ before. On Windows, however, it's an alias for SOCKET, which can
+ be wider than int on 64-bit platforms.
+
+2.6. Timeouts and persistent events work together.
+
+ Previously, it wasn't useful to set a timeout on a persistent event:
+ the timeout would trigger once, and never again. This is not what
+ applications tend to want. Instead, applications tend to want every
+ triggering of the event to re-set the timeout. So now, if you set
+ up an event like this:
+ struct event *ev;
+ struct timeval tv;
+ ev = event_new(base, fd, EV_READ|EV_PERSIST, cb, NULL);
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ event_add(ev, &tv);
+
+ The callback 'cb' will be invoked whenever fd is ready to read, OR whenever
+ a second has passed since the last invocation of cb.
+
+2.7. Multiple events allowed per fd
+
+ Older versions of Libevent allowed at most one EV_READ event and at most
+ one EV_WRITE event per socket, per event base. This restriction is no
+ longer present.
+
+2.8. evthread_* functions for thread-safe structures.
+
+ Libevent structures can now be built with locking support. This code
+ makes it safe to add, remove, and activate events on an event base from a
+ different thread. (Previously, if you wanted to write multithreaded code
+ with Libevent, you could only an event_base or its events in one thread at
+ a time.)
+
+ If you want threading support and you're using pthreads, you can just
+ call evthread_use_pthreads(). (You'll need to link against the
+ libevent_pthreads library in addition to libevent_core. These functions are
+ not in libevent_core.)
+
+ If you want threading support and you're using Windows, you can just
+ call evthread_use_windows_threads().
+
+ If you are using some locking system besides Windows and pthreads, You
+ can enable this on a per-event-base level by writing functions to
+ implement mutexes, conditions, and thread IDs, and passing them to
+ evthread_set_lock_callbacks and related functions in event2/thread.h.
+
+ Once locking functions are enabled, every new event_base is created with a
+ lock. You can prevent a single event_base from being built with a lock
+ disabled by using the EVENT_BASE_FLAG_NOLOCK flag in its
+ event_config. If an event_base is created with a lock, it is safe to call
+ event_del, event_add, and event_active on its events from any thread. The
+ event callbacks themselves are still all executed from the thread running
+ the event loop.
+
+ To make an evbuffer or a bufferevent object threadsafe, call its
+ *_enable_locking() function.
+
+ The HTTP api is not currently threadsafe.
+
+ To build Libevent with threading support disabled, pass
+ --disable-thread-support to the configure script.
+
+2.9. Edge-triggered events on some backends.
+
+ With some backends, it's now possible to add the EV_ET flag to an event
+ in order to request that the event's semantics be edge-triggered. Right
+ now, epoll and kqueue support this.
+
+ The corresponding event_config feature is EV_FEATURE_ET; see 2.4 for more
+ information.
+
+2.10. Better support for huge numbers of timeouts
+
+ The heap-based priority queue timer implementation for Libevent 1.4 is good
+ for randomly distributed timeouts, but suboptimal if you have huge numbers
+ of timeouts that all expire in the same amount of time after their
+ creation. The new event_base_init_common_timeout() logic lets you signal
+ that a given timeout interval will be very common, and should use a linked
+ list implementation instead of a priority queue.
+
+2.11. Improved debugging support
+
+ It's been pretty easy to forget to delete all your events before you
+ re-initialize them, or otherwise put Libevent in an internally inconsistent
+ state. You can tell libevent to catch these and other common errors with
+ the new event_enable_debug_mode() call. Just invoke it before you do
+ any calls to other libevent functions, and it'll catch many common
+ event-level errors in your code.
+
+2.12. Functions to access all event fields
+
+ So that you don't have to access the struct event fields directly, Libevent
+ now provides accessor functions to retrieve everything from an event that
+ you set during event_new() or event_assign().
+
+3. Backend-specific and performance improvements.
+
+3.1. Change-minimization on O(1) backends
+
+ With previous versions of Libevent, if you called event_del() and
+ event_add() repeatedly on a single event between trips to the backend's
+ dispatch function, the backend might wind up making unnecessary calls or
+ passing unnecessary data to the kernel. The new backend logic batches up
+ redundant adds and deletes, and performs no more operations than necessary
+ at the kernel level.
+
+ This logic is on for the kqueue backend, and available (but off by
+ default) for the epoll backend. To turn it on for the epoll backend,
+ set the EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST flag in the
+ event_base_cofig, or set the EVENT_EPOLL_USE_CHANGELIST environment
+ variable. Doing this with epoll may result in weird bugs if you give
+ any fds closed by dup() or its variants.
+
+3.2. Improved notification on Linux
+
+ When we need to wake the event loop up from another thread, we use
+ an epollfd to do so, instead of a socketpair. This is supposed to be
+ faster.
+
+3.3. Windows: better support for everything
+
+ Bufferevents on Windows can use a new mechanism (off-by-default; see below)
+ to send their data via Windows overlapped IO and get their notifications
+ via the IOCP API. This should be much faster than using event-based
+ notification.
+
+ Other functions throughout the code have been fixed to work more
+ consistently with Windows. Libevent now builds on Windows using either
+ mingw, or using MSVC (with nmake). Libevent works fine with UNICODE
+ defined, or not.
+
+ Data structures are a little smarter: our lookups from socket to pending
+ event are now done with O(1) hash tables rather than O(lg n) red-black
+ trees.
+
+ Unfortunately, the main Windows backend is still select()-based: from
+ testing the IOCP backends on the mailing list, it seems that there isn't
+ actually a way to tell for certain whether a socket is writable with IOCP.
+ Libevent 2.1 may add a multithreaded WaitForMultipleEvents-based
+ backend for better performance with many inactive sockets and better
+ integration with Windows events.
+
+4. Improvements to evbuffers
+
+ Libevent has long had an "evbuffer" implementation to wrap access to an
+ input or output memory buffer. In previous versions, the implementation
+ was very inefficient and lacked some desirable features. We've made many
+ improvements in Libevent 2.0.
+
+4.1. Chunked-memory internal representation
+
+ Previously, each evbuffer was a huge chunk of memory. When we ran out of
+ space in an evbuffer, we used realloc() to grow the chunk of memory. When
+ data was misaligned, we used memmove to move the data back to the front
+ of the buffer.
+
+ Needless to say, this is a terrible interface for networked IO.
+
+ Now, evbuffers are implemented as a linked list of memory chunks, like
+ most Unix kernels use for network IO. (See Linux's skbuf interfaces,
+ or *BSD's mbufs). Data is added at the end of the linked list and
+ removed from the front, so that we don't ever need realloc huge chunks
+ or memmove the whole buffer contents.
+
+ To avoid excessive calls to read and write, we use the readv/writev
+ interfaces (or WSASend/WSARecv on Windows) to do IO on multiple chunks at
+ once with a single system call.
+
+ COMPATIBILITY NOTE:
+ The evbuffer struct is no longer exposed in a header. The code here is
+ too volatile to expose an official evbuffer structure, and there was never
+ any means provided to create an evbuffer except via evbuffer_new which
+ heap-allocated the buffer.
+
+ If you need access to the whole buffer as a linear chunk of memory, the
+ EVBUFFER_DATA() function still works. Watch out, though: it needs to copy
+ the buffer's contents in a linear chunk before you can use it.
+
+4.2. More flexible readline support
+
+ The old evbuffer_readline() function (which accepted any sequence of
+ CR and LF characters as a newline, and which couldn't handle lines
+ containing NUL characters), is now deprecated. The preferred
+ function is evbuffer_readln(), which supports a variety of
+ line-ending styles, and which can return the number of characters in
+ the line returned.
+
+ You can also call evbuffer_search_eol() to find the end of a line
+ in an evbuffer without ever extracting the line.
+
+4.3. Support for file-based IO in evbuffers.
+
+ You can now add chunks of a file into a evbuffer, and Libevent will have
+ your OS use mapped-memory functionality, sendfile, or splice to transfer
+ the data without ever copying it to userspace. On OSs where this is not
+ supported, Libevent just loads the data.
+
+ There are probably some bugs remaining in this code. On some platforms
+ (like Windows), it just reads the relevant parts of the file into RAM.
+
+4.4. Support for zero-copy ("scatter/gather") writes in evbuffers.
+
+ You can add a piece of memory to an evbuffer without copying it.
+ Instead, Libevent adds a new element to the evbuffer's linked list of
+ chunks with a pointer to the memory you supplied. You can do this
+ either with a reference-counted chunk (via evbuffer_add_reference), or
+ by asking Libevent for a pointer to its internal vectors (via
+ evbuffer_reserve_space or evbuffer_peek()).
+
+4.5. Multiple callbacks per evbuffer
+
+ Previously, you could only have one callback active on an evbuffer at a
+ time. In practice, this meant that if one part of Libevent was using an
+ evbuffer callback to notice when an internal evbuffer was reading or
+ writing data, you couldn't have your own callback on that evbuffer.
+
+ Now, you can now use the evbuffer_add_cb() function to add a callback that
+ does not interfere with any other callbacks.
+
+ The evbuffer_setcb() function is now deprecated.
+
+4.6. New callback interface
+
+ Previously, evbuffer callbacks were invoked with the old size of the
+ buffer and the new size of the buffer. This interface could not capture
+ operations that simultaneously filled _and_ drained a buffer, or handle
+ cases where we needed to postpone callbacks until multiple operations were
+ complete.
+
+ Callbacks that are set with evbuffer_setcb still use the old API.
+ Callbacks added with evbuffer_add_cb() use a new interface that takes a
+ pointer to a struct holding the total number of bytes drained read and the
+ total number of bytes written. See event2/buffer.h for full details.
+
+4.7. Misc new evbuffer features
+
+ You can use evbuffer_remove() to move a given number of bytes from one
+ buffer to another.
+
+ The evbuffer_search() function lets you search for repeated instances of
+ a pattern inside an evbuffer.
+
+ You can use evbuffer_freeze() to temporarily suspend drains from or adds
+ to a given evbuffer. This is useful for code that exposes an evbuffer as
+ part of its public API, but wants users to treat it as a pure source or
+ sink.
+
+ There's an evbuffer_copyout() that looks at the data at the start of an
+ evbuffer without doing a drain.
+
+ You can have an evbuffer defer all of its callbacks, so that rather than
+ being invoked immediately when the evbuffer's length changes, they are
+ invoked from within the event_loop. This is useful when you have a
+ complex set of callbacks that can change the length of other evbuffers,
+ and you want to avoid having them recurse and overflow your stack.
+
+5. Bufferevents improvements
+
+ Libevent has long included a "bufferevents" structure and related
+ functions that were useful for generic buffered IO on a TCP connection.
+ This is what Libevent uses for its HTTP implementation. In addition to
+ the improvements that they get for free from the underlying evbuffer
+ implementation above, there are many new features in Libevent 2.0's
+ evbuffers.
+
+5.1. New OO implementations
+
+ The "bufferevent" structure is now an abstract base type with multiple
+ implementations. This should not break existing code, which always
+ allocated bufferevents with bufferevent_new().
+
+ Current implementations of the bufferevent interface are described below.
+
+5.2. bufferevent_socket_new() replaces bufferevent_new()
+
+ Since bufferevents that use a socket are not the only kind,
+ bufferevent_new() is now deprecated. Use bufferevent_socket_new()
+ instead.
+
+5.3. Filtered bufferevent IO
+
+ You can use bufferevent_filter_new() to create a bufferevent that wraps
+ around another bufferevent and transforms data it is sending and
+ receiving. See test/regress_zlib.c for a toy example that uses zlib to
+ compress data before sending it over a bufferevent.
+
+5.3. Linked pairs of bufferevents
+
+ You can use bufferevent_pair_new() to produce two linked
+ bufferevents. This is like using socketpair, but doesn't require
+ system-calls.
+
+5.4. SSL support for bufferevents with OpenSSL
+
+ There is now a bufferevent type that supports SSL/TLS using the
+ OpenSSL library. The code for this is build in a separate
+ library, libevent_openssl, so that your programs don't need to
+ link against OpenSSL unless they actually want SSL support.
+
+ There are two ways to construct one of these bufferevents, both
+ declared in <event2/bufferevent_ssl.h>. If you want to wrap an
+ SSL layer around an existing bufferevent, you would call the
+ bufferevent_openssl_filter_new() function. If you want to do SSL
+ on a socket directly, call bufferevent_openssl_socket_new().
+
+5.5. IOCP support for bufferevents on Windows
+
+ There is now a bufferevents backend that supports IOCP on Windows.
+ Supposedly, this will eventually make Windows IO much faster for
+ programs using bufferevents. We'll have to see; the code is not
+ currently optimized at all. To try it out, call the
+ event_base_start_iocp() method on an event_base before contructing
+ bufferevents.
+
+ This is tricky code; there are probably some bugs hiding here.
+
+5.6. Improved connect support for bufferevents.
+
+ You can now create a bufferevent that is not yet connected to any
+ host, and tell it to connect, either by address or by hostname.
+
+ The functions to do this are bufferevent_socket_connect and
+ bufferevent_socket_connect_hostname.
+
+5.7. Rate-limiting for bufferevents
+
+ If you need to limit the number of bytes read/written by a single
+ bufferevent, or by a group of them, you can do this with a new set of
+ bufferevent rate-limiting calls.
+
+6. Other improvements
+
+6.1. DNS improvements
+
+6.1.1. DNS: IPv6 nameservers
+
+ The evdns code now lets you have nameservers whose addresses are IPv6.
+
+6.1.2. DNS: Better security
+
+ Libevent 2.0 tries harder to resist DNS answer-sniping attacks than
+ earlier versions of evdns. See comments in the code for full details.
+
+ Notably, evdns now supports the "0x20 hack" to make it harder to
+ impersonate a DNS server. Additionally, Libevent now uses a strong
+ internal RNG to generate DNS transaction IDs, so you don't need to supply
+ your own.
+
+6.1.3. DNS: Getaddrinfo support
+
+ There's now an asynchronous getaddrinfo clone, evdns_getaddrinfo(),
+ to make the results of the evdns functions more usable. It doesn't
+ support every feature of a typical platform getaddrinfo() yet, but it
+ is quite close.
+
+ There is also a blocking evutil_getaddrinfo() declared in
+ event2/util.h, to provide a getaddrinfo() implementation for
+ platforms that don't have one, and smooth over the differences in
+ various platforms implementations of RFC3493.
+
+ Bufferevents provide bufferevent_connect_hostname(), which combines
+ the name lookup and connect operations.
+
+6.1.4. DNS: No more evdns globals
+
+ Like an event base, evdns operations are now supposed to use an evdns_base
+ argument. This makes them easier to wrap for other (more OO) languages,
+ and easier to control the lifetime of. The old evdns functions will
+ still, of course, continue working.
+
+6.2. Listener support
+
+ You can now more easily automate setting up a bound socket to listen for
+ TCP connections. Just use the evconnlistener_*() functions in the
+ event2/listener.h header.
+
+ The listener code supports IOCP on Windows if available.
+
+6.3. Secure RNG support
+
+ Network code very frequently needs a secure, hard-to-predict random number
+ generator. Some operating systems provide a good C implementation of one;
+ others do not. Libevent 2.0 now provides a consistent implementation
+ based on the arc4random code originally from OpenBSD. Libevent (and you)
+ can use the evutil_secure_rng_*() functions to access a fairly secure
+ random stream of bytes.
+
+6.4. HTTP
+
+ The evhttp uriencoding and uridecoding APIs have updated versions
+ that behave more correctly, and can handle strings with internal NULs.
+
+ The evhttp query parsing and URI parsing logic can now detect errors
+ more usefully. Moreover, we include an actual URI parsing function
+ (evhttp_uri_parse()) to correctly parse URIs, so as to discourage
+ people from rolling their own ad-hoc parsing functions.
+
+ There are now accessor functions for the useful fields of struct http
+ and friends; it shouldn't be necessary to access them directly any
+ more.
+
+ Libevent now lets you declare support for all specified HTTP methods,
+ including OPTIONS, PATCH, and so on. The default list is unchanged.
+
+ Numerous evhttp bugs also got fixed.
+
+7. Infrastructure improvements
+
+7.1. Better unit test framework
+
+ We now use a unit test framework that Nick wrote called "tinytest".
+ The main benefit from Libevent's point of view is that tests which
+ might mess with global state can all run each in their own
+ subprocess. This way, when there's a bug that makes one unit test
+ crash or mess up global state, it doesn't affect any others.
+
+7.2. Better unit tests
+
+ Despite all the code we've added, our unit tests are much better than
+ before. Right now, iterating over the different backends on various
+ platforms, I'm getting between 78% and 81% test coverage, compared
+ with less than 45% test coverage in Libevent 1.4.
+
diff --git a/sntp/libevent/whatsnew-2.1.txt b/sntp/libevent/whatsnew-2.1.txt
new file mode 100644
index 0000000..c0ee7cf
--- /dev/null
+++ b/sntp/libevent/whatsnew-2.1.txt
@@ -0,0 +1,639 @@
+ What's new in Libevent 2.1
+ Nick Mathewson
+
+0. Before we start
+
+0.1. About this document
+
+ This document describes the key differences between Libevent 2.0 and
+ Libevent 2.1, from a user's point of view. It's a work in progress.
+
+ For better documentation about libevent, see the links at
+ http://libevent.org/
+
+ Libevent 2.1 would not be possible without the generous help of
+ numerous volunteers. For a list of who did what in Libevent 2.1,
+ please see the ChangeLog!
+
+ NOTE: I am very sure that I missed some thing on this list. Caveat
+ haxxor.
+
+0.2. Where to get help
+
+ Try looking at the other documentation too. All of the header files
+ have documentation in the doxygen format; this gets turned into nice
+ HTML and linked to from the libevent.org website.
+
+ There is a work-in-progress book with reference manual at
+ http://www.wangafu.net/~nickm/libevent-book/ .
+
+ You can ask questions on the #libevent IRC channel at irc.oftc.net or
+ on the mailing list at libevent-users@freehaven.net. The mailing list
+ is subscribers-only, so you will need to subscribe before you post.
+
+0.3. Compatibility
+
+ Our source-compatibility policy is that correct code (that is to say,
+ code that uses public interfaces of Libevent and relies only on their
+ documented behavior) should have forward source compatibility: any
+ such code that worked with a previous version of Libevent should work
+ with this version too.
+
+ We don't try to do binary compatibility except within stable release
+ series, so binaries linked against any version of Libevent 2.0 will
+ probably need to be recompiled against Libevent 2.1.3-alpha if you
+ want to use it. It is probable that we'll break binary compatibility
+ again before Libevent 2.1 is stable.
+
+1. New APIs and features
+
+1.1. New ways to build libevent
+
+ We now provide an --enable-gcc-hardening configure option to turn on
+ GCC features designed for increased code security.
+
+ There is also an --enable-silent-rules configure option to make
+ compilation run more quietly with automake 1.11 or later.
+
+ You no longer need to use the --enable-gcc-warnings option to turn on
+ all of the GCC warnings that Libevent uses. The only change from
+ using that option now is to turn warnings into errors.
+
+ For IDE users, files that are not supposed to be built are now
+ surrounded with appropriate #ifdef lines to keep your IDE from getting
+ upset.
+
+
+1.2. New functions for events and the event loop
+
+ If you're running Libevent with multiple event priorities, you might
+ want to make sure that Libevent checks for new events frequently, so
+ that time-consuming or numerous low-priority events don't keep it from
+ checking for new high-priority events. You can now use the
+ event_config_set_max_dispatch_interval() interface to ensure that the
+ loop checks for new events either every N microseconds, every M
+ callbacks, or both.
+
+ When configuring an event base, you can now choose whether you want
+ timers to be more efficient, or more precise. (This only has effect
+ on Linux for now.) Timers are efficient by default: to select more
+ precise timers, use the EVENT_BASE_FLAG_PRECISE_TIMER flag when
+ constructing the event_config, or set the EVENT_PRECISE_TIMER
+ environment variable to a non-empty string.
+
+ There is an EVLOOP_NO_EXIT_ON_EMPTY flag that tells event_base_loop()
+ to keep looping even when there are no pending events. (Ordinarily,
+ event_base_loop() will exit as soon as no events are pending.)
+
+ Past versions of Libevent have been annoying to use with some
+ memory-leak-checking tools, because Libevent allocated some global
+ singletons but provided no means to free them. There is now a
+ function, libevent_global_shutdown(), that you can use to free all
+ globally held resources before exiting, so that your leak-check tools
+ don't complain. (Note: this function doesn't free non-global things
+ like events, bufferevents, and so on; and it doesn't free anything
+ that wouldn't otherwise get cleaned up by the operating system when
+ your process exit()s. If you aren't using a leak-checking tool, there
+ is not much reason to call libevent_global_shutdown().)
+
+ There is a new event_base_get_npriorities() function to return the
+ number of priorities set in the event base.
+
+ Libevent 2.0 added an event_new() function to construct a new struct
+ event on the heap. Unfortunately, with event_new(), there was no
+ equivalent for:
+
+ struct event ev;
+ event_assign(&ev, base, fd, EV_READ, callback, &ev);
+
+ In other words, there was no easy way for event_new() to set up an
+ event so that the event itself would be its callback argument.
+ Libevent 2.1 lets you do this by passing "event_self_cbarg()" as the
+ callback argument:
+
+ struct event *evp;
+ evp = event_new(base, fd, EV_READ, callback,
+ event_self_cbarg());
+
+ There's also a new event_base_get_running_event() function you can
+ call from within a Libevent callback to get a pointer to the current
+ event. This should never be strictly necessary, but it's sometimes
+ convenient.
+
+ The event_base_once() function used to leak some memory if the event
+ that it added was never actually triggered. Now, its memory is
+ tracked in the event_base and freed when the event_base is freed.
+ Note however that Libevent doesn't know how to free any information
+ passed as the callback argument to event_base_once is still something
+ you'll might need a way to de-allocate yourself.
+
+ There is an event_get_priority() function to return an event's
+ priority.
+
+ By analogy to event_base_loopbreak(), there is now an
+ event_base_loopcontinue() that tells Libevent to stop processing
+ active event callbacks, and re-scan for new events right away.
+
+ There's a function, event_base_foreach_event(), that can iterate over
+ every event currently pending or active on an event base, and invoke a
+ user-supplied callback on each. The callback must not alter the events
+ or add or remove anything to the event base.
+
+ We now have an event_remove_timer() function to remove the timeout on
+ an event while leaving its socket and/or signal triggers unchanged.
+ (If we were designing the API from scratch, this would be the behavior
+ of "event_add(ev, NULL)" on an already-added event with a timeout. But
+ that's a no-op in past versions of Libevent, and we don't want to
+ break compatibility.)
+
+1.3. Event finalization
+
+ [NOTE: This is an experimental feature in Libevent 2.1.3-alpha. Though
+ it seems solid so far, its API might change between now and the first
+ release candidate for Libevent 2.1.]
+
+1.3.1. Why event finalization?
+
+ Libevent 2.1 now supports an API for safely "finalizing" events that
+ might be running in multiple threads, and provides a way to slightly
+ change the semantics of event_del() to prevent deadlocks in
+ multithreaded programs.
+
+ To motivate this feature, consider the following code, in the context
+ of a mulithreaded Libevent application:
+
+ struct connection *conn = event_get_callback_arg(ev);
+ event_del(ev);
+ connection_free(conn);
+
+ Suppose that the event's callback might be running in another thread,
+ and using the value of "conn" concurrently. We wouldn't want to
+ execute the connection_free() call until "conn" is no longer in use.
+ How can we make this code safe?
+
+ Libevent 2.0 answered that question by saying that the event_del()
+ call should block if the event's callback is running in another
+ thread. That way, we can be sure that event_del() has canceled the
+ callback (if the callback hadn't started running yet), or has waited
+ for the callback to finish.
+
+ But now suppose that the data structure is protected by a lock, and we
+ have the following code:
+
+ void check_disable(struct connection *connection) {
+ lock(connection);
+ if (should_stop_reading(connection))
+ event_del(connection->read_event);
+ unlock(connection);
+ }
+
+ What happens when we call check_disable() from a callback and from
+ another thread? Let's say that the other thread gets the lock
+ first. If it decides to call event_del(), it will wait for the
+ callback to finish. But meanwhile, the callback will be waiting for
+ the lock on the connection. Since each threads is waiting for the
+ other one to release a resource, the program will deadlock.
+
+ This bug showed up in multithreaded bufferevent programs in 2.1,
+ particularly when freeing bufferevents. (For more information, see
+ the "Deadlock when calling bufferevent_free from an other thread"
+ thread on libevent-users starting on 6 August 2012 and running through
+ February of 2013. You might also like to read my earlier writeup at
+ http://archives.seul.org/libevent/users/Feb-2012/msg00053.html and
+ the ensuing discussion.)
+
+1.3.2. The EV_FINALIZE flag and avoiding deadlock
+
+ To prevent the deadlock condition described above, Libevent
+ 2.1.3-alpha adds a new flag, "EV_FINALIZE". You can pass it to
+ event_new() and event_assign() along with EV_READ, EV_WRITE, and the
+ other event flags.
+
+ When an event is constructed with the EV_FINALIZE flag, event_del()
+ will not block on that event, even when the event's callback is
+ running in another thread. By using EV_FINALIZE, you are therefore
+ promising not to use the "event_del(ev); free(event_get_callback_arg(ev));"
+ pattern, but rather to use one of the finalization functions below to
+ clean up the event.
+
+ EV_FINALIZE has no effect on a single-threaded program, or on a
+ program where events are only used from one thread.
+
+
+ There are also two new variants of event_del() that you can use for
+ more fine-grained control:
+ event_del_noblock(ev)
+ event_del_block(ev)
+ The event_del_noblock() function will never block, even if the event
+ callback is running in another thread and doesn't have the EV_FINALIZE
+ flag. The event_del_block() function will _always_ block if the event
+ callback is running in another thread, even if the event _does_ have
+ the EV_FINALIZE flag.
+
+ [A future version of Libevent may have a way to make the EV_FINALIZE
+ flag the default.]
+
+1.3.3. Safely finalizing events
+
+ To safely tear down an event that may be running, Libevent 2.1.3-alpha
+ introduces event_finalize() and event_free_finalize(). You call them
+ on an event, and provide a finalizer callback to be run on the event
+ and its callback argument once the event is definitely no longer
+ running.
+
+ With event_free_finalize(), the event is also freed once the finalizer
+ callback has been invoked.
+
+ A finalized event cannot be re-added or activated. The finalizer
+ callback must not add events, activate events, or attempt to
+ "resucitate" the event being finalized in any way.
+
+ If any finalizer callbacks are pending as the event_base is being
+ freed, they will be invoked. You can override this behavior with the
+ new function event_base_free_nofinalize().
+
+1.4. New debugging features
+
+ You can now turn on debug logs at runtime using a new function,
+ event_enable_debug_logging().
+
+ The event_enable_lock_debugging() function is now spelled correctly.
+ You can still use the old "event_enable_lock_debuging" name, though,
+ so your old programs shouldnt' break.
+
+ There's also been some work done to try to make the debugging logs
+ more generally useful.
+
+1.5. New evbuffer functions
+
+ In Libevent 2.0, we introduced evbuffer_add_file() to add an entire
+ file's contents to an evbuffer, and then send them using sendfile() or
+ mmap() as appropriate. This API had some drawbacks, however.
+ Notably, it created one mapping or fd for every instance of the same
+ file added to any evbuffer. Also, adding a file to an evbuffer could
+ make that buffer unusable with SSL bufferevents, filtering
+ bufferevents, and any code that tried to read the contents of the
+ evbuffer.
+
+ Libevent 2.1 adds a new evbuffer_file_segment API to solve these
+ problems. Now, you can use evbuffer_file_segment_new() to construct a
+ file-segment object, and evbuffer_add_file_segment() to insert it (or
+ part of it) into an evbuffer. These segments avoid creating redundant
+ maps or fds. Better still, the code is smart enough (when the OS
+ supports sendfile) to map the file when that's necessary, and use
+ sendfile() otherwise.
+
+ File segments can receive callback functions that are invoked when the
+ file segments are freed.
+
+ The evbuffer_ptr interface has been extended so that an evbuffer_ptr
+ can now yield a point just after the end of the buffer. This makes
+ many algorithms simpler to implement.
+
+ There's a new evbuffer_add_buffer() interface that you can use to add
+ one buffer to another nondestructively. When you say
+ evbuffer_add_buffer_reference(outbuf, inbuf), outbuf now contains a
+ reference to the contents of inbuf.
+
+ To aid in adding data in bulk while minimizing evbuffer calls, there
+ is an evbuffer_add_iovec() function.
+
+ There's a new evbuffer_copyout_from() variant function to enable
+ copying data nondestructively from the middle of a buffer.
+
+ evbuffer_readln() now supports an EVBUFFER_EOL_NUL argument to fetch
+ NUL-terminated strings from buffers.
+
+1.6. New functions and features: bufferevents
+
+ You can now use the bufferevent_getcb() function to find out a
+ bufferevent's callbacks. Previously, there was no supported way to do
+ that.
+
+ The largest chunk readable or writeable in a single bufferevent
+ callback is no longer hardcoded; it's now configurable with
+ the new functions bufferevent_set_max_single_read() and
+ bufferevent_set_max_single_write().
+
+ For consistency, OpenSSL bufferevents now make sure to always set one
+ of BEV_EVENT_READING or BEV_EVENT_WRITING when invoking an event
+ callback.
+
+ Calling bufferevent_set_timeouts(bev, NULL, NULL) now removes the
+ timeouts from socket and ssl bufferevents correctly.
+
+ You can find the priority at which a bufferevent runs with
+ bufferevent_get_priority().
+
+1.7. New functions and features: evdns
+
+ The previous evdns interface used an "open a test UDP socket" trick in
+ order to detect IPv6 support. This was a hack, since it would
+ sometimes badly confuse people's firewall software, even though no
+ packets were sent. The current evdns interface-detection code uses
+ the appropriate OS functions to see which interfaces are configured.
+
+ The evdns_base_new() function now has multiple possible values for its
+ second (flags) argument. Using 1 and 0 have their old meanings, though the
+ 1 flag now has a symbolic name of EVDNS_BASE_INITIALIZE_NAMESERVERS.
+ A second flag is now supported too: the EVDNS_BASE_DISABLE_WHEN_INACTIVE
+ flag, which tells the evdns_base that it should not prevent Libevent from
+ exiting while it has no DNS requests in progress.
+
+1.8. New functions and features: evconnlistener
+
+ Libevent 2.1 adds the following evconnlistener flags:
+
+ LEV_OPT_DEFERRED_ACCEPT -- Tells the OS that it doesn't need to
+ report sockets as having arrived until the initiator has sent some
+ data too. This can greatly improve performance with protocols like
+ HTTP where the client always speaks first. On operating systems
+ that don't support this functionality, this option has no effect.
+
+ LEV_OPT_DISABLED -- Creates an evconnlistener in the disabled (not
+ listening) state.
+
+ Libevent 2.1 changes the behavior of the LEV_OPT_CLOSE_ON_EXEC
+ flag. Previously, it would apply to the listener sockets, but not to
+ the accepted sockets themselves. That's almost never what you want.
+ Now, it applies both to the listener and the accepted sockets.
+
+1.9. New functions and features: evhttp
+
+ **********************************************************************
+ NOTE: The evhttp module will eventually be deprecated in favor of Mark
+ Ellzey's libevhtp library. Don't worry -- this won't happen until
+ libevhtp provides every feature that evhttp does, and provides a
+ compatible interface that applications can use to migrate.
+ **********************************************************************
+
+ Previously, you could only set evhttp timeouts in increments of one
+ second. Now, you can use evhttp_set_timeout_tv() and
+ evhttp_connection_set_timeout_tv() to configure
+ microsecond-granularity timeouts.
+
+ There are a new pair of functions: evhttp_set_bevcb() and
+ evhttp_connection_base_bufferevent_new(), that you can use to
+ configure which bufferevents will be used for incoming and outgoing
+ http connections respectively. These functions, combined with SSL
+ bufferevents, should enable HTTPS support.
+
+ There's a new evhttp_foreach_bound_socket() function to iterate over
+ every listener on an evhttp object.
+
+ Whitespace between lines in headers is now folded into a single space;
+ whitespace at the end of a header is now removed.
+
+ The socket errno value is now preserved when invoking an http error
+ callback.
+
+ There's a new kind of request callback for errors; you can set it with
+ evhttp_request_set_error_cb(). It gets called when there's a request error,
+ and actually reports the error code and lets you figure out which request
+ failed.
+
+2. Cross-platform performance improvements
+
+2.1. Better data structures
+
+ We replaced several users of the sys/queue.h "TAILQ" data structure
+ with the "LIST" data structure. Because this data type doesn't
+ require FIFO access, it requires fewer pointer checks and
+ manipulations to keep it in line.
+
+ All previous versions of Libevent have kept every pending (added)
+ event in an "eventqueue" data structure. Starting in Libevent 2.0,
+ however, this structure became redundant: every pending timeout event
+ is stored in the timeout heap or in one of the common_timeout queues,
+ and every pending fd or signal event is stored in an evmap. Libevent
+ 2.1 removes this data structure, and thereby saves all of the code
+ that we'd been using to keep it updated.
+
+2.2. Faster activations and timeouts
+
+ It's a common pattern in older code to use event_base_once() with a
+ 0-second timeout to ensure that a callback will get run 'as soon as
+ possible' in the current iteration of the Libevent loop. We optimize
+ this case by calling event_active() directly, and bypassing the
+ timeout pool. (People who are using this pattern should also consider
+ using event_active() themselves.)
+
+ Libevent 2.0 would wake up a polling event loop whenever the first
+ timeout in the event loop was adjusted--whether it had become earlier
+ or later. We now only notify the event loop when a change causes the
+ expiration time to become _sooner_ than it would have been otherwise.
+
+ The timeout heap code is now optimized to perform fewer comparisons
+ and shifts when changing or removing a timeout.
+
+ Instead of checking for a wall-clock time jump every time we call
+ clock_gettime(), we now check only every 5 seconds. This should save
+ a huge number of gettimeofday() calls.
+
+2.3. Microoptimizations
+
+ Internal event list maintainance no longer use the antipattern where
+ we have one function with multiple totally independent behaviors
+ depending on an argument:
+ #define OP1 1
+ #define OP2 2
+ #define OP3 3
+ void func(int operation, struct event *ev) {
+ switch (op) {
+ ...
+ }
+ }
+ Instead, these functions are now split into separate functions for
+ each operation:
+ void func_op1(struct event *ev) { ... }
+ void func_op2(struct event *ev) { ... }
+ void func_op3(struct event *ev) { ... }
+
+ This produces better code generation and inlining decisions on some
+ compilers, and makes the code easier to read and check.
+
+2.4. Evbuffer performance improvements
+
+ The EVBUFFER_EOL_CRLF line-ending type is now much faster, thanks to
+ smart optimizations.
+
+2.5. HTTP performance improvements
+
+ o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey)
+ o Add missing break to evhttp_parse_request_line (0fcc536)
+
+2.6. Coarse timers by default on Linux
+
+ Due to limitations of the epoll interface, Libevent programs using epoll
+ have not previously been able to wait for timeouts with accuracy smaller
+ than 1 millisecond. But Libevent had been using CLOCK_MONOTONIC for
+ timekeeping on Linux, which is needlessly expensive: CLOCK_MONOTONIC_COARSE
+ has approximately the resolution corresponding to epoll, and is much faster
+ to invoke than CLOCK_MONOTONIC.
+
+ To disable coarse timers, and get a more plausible precision, use the
+ new EVENT_BASE_FLAG_PRECISE_TIMER flag when setting up your event base.
+
+3. Backend/OS-specific improvements
+
+3.1. Linux-specific improvements
+
+ The logic for deciding which arguements to use with epoll_ctl() is now
+ a table-driven lookup, rather than the previous pile of cascading
+ branches. This should minimize epoll_ctl() calls and make the epoll
+ code run a little faster on change-heavy loads.
+
+ Libevent now takes advantage of Linux's support for enhanced APIs
+ (e.g., SOCK_CLOEXEC, SOCK_NONBLOCK, accept4, pipe2) that allow us to
+ simultaneously create a socket, make it nonblocking, and make it
+ close-on-exec. This should save syscalls throughout our codebase, and
+ avoid race-conditions if an exec() occurs after a socket is socket is
+ created but before we can make it close-on-execute on it.
+
+3.2. Windows-specific improvements
+
+ We now use GetSystemTimeAsFileTime to implement gettimeofday. It's
+ significantly faster and more accurate than our old ftime()-based approach.
+
+3.3. Improvements in the solaris evport backend.
+
+ The evport backend has been updated to use many of the infrastructure
+ improvements from Libevent 2.0. Notably, it keeps track of per-fd
+ information using the evmap infrastructure, and removes a number of
+ linear scans over recently-added events. This last change makes it
+ efficient to receive many more events per evport_getn() call, thereby
+ reducing evport overhead in general.
+
+3.4. OSX backend improvements
+
+ The OSX select backend doesn't like to have more than a certain number
+ of fds set unless an "unlimited select" option has been set.
+ Therefore, we now set it.
+
+3.5. Monotonic clocks on even more platforms
+
+ Libevent previously used a monotonic clock for its internal timekeeping
+ only on platforms supporting the POSIX clock_gettime() interface. Now,
+ Libevent has support for monotonic clocks on OSX and Windows too, and a
+ fallback implementation for systems without monotonic clocks that will at
+ least keep time running forwards.
+
+ Using monotonic timers makes Libevent more resilient to changes in the
+ system time, as can happen in small amounts due to clock adjustments from
+ NTP, or in large amounts due to users who move their system clocks all over
+ the timeline in order to keep nagware from nagging them.
+
+3.6. Faster cross-thread notification on kqueue
+
+ When a thread other than the one in which the main event loop is
+ running needs to wake the thread running the main event loop, Libevent
+ usually writes to a socketpair in order to force the main event loop
+ to wake up. On Linux, we've been able to use eventfd() instead. Now
+ on BSD and OSX systems (any anywhere else that has kqueue with the
+ EVFILT_USER extension), we can use EVFILT_USER to wake up the main
+ thread from kqueue. This should be a tiny bit faster than the
+ previous approach.
+
+4. Infrastructure improvements
+
+4.1. Faster tests
+
+ I've spent some time to try to make the unit tests run faster in
+ Libevent 2.1. Nearly all of this was a matter of searching slow tests
+ for unreasonably long timeouts, and cutting them down to reasonably
+ long delays, though on one or two cases I actually had to parallelize
+ an operation or improve an algorithm.
+
+ On my desktop, a full "make verify" run of Libevent 2.0.18-stable
+ requires about 218 seconds. Libevent 2.1.1-alpha cuts this down to
+ about 78 seconds.
+
+ Faster unit tests are great, since they let programmers test their
+ changes without losing their train of thought.
+
+4.2. Finicky tests are now off-by-default
+
+ The Tinytest unit testing framework now supports optional tests, and
+ Libevent uses them. By default, Libevent's unit testing framework
+ does not run tests that require a working network, and does not run
+ tests that tend to fail on heavily loaded systems because of timing
+ issues. To re-enable all tests, run ./test/regress using the "@all"
+ alias.
+
+4.3. Modernized use of autotools
+
+ Our autotools-based build system has been updated to build without
+ warnings on recent autoconf/automake versions.
+
+ Libevent's autotools makefiles are no longer recursive. This allows
+ make to use the maximum possible parallelism to do the minimally
+ necessary amount of work. See Peter Miller's "Recursive Make
+ Considered Harmful" at http://miller.emu.id.au/pmiller/books/rmch/ for
+ more information here.
+
+ We now use the "quiet build" option to suppress distracting messages
+ about which commandlines are running. You can get them back with
+ "make V=1".
+
+4.4. Portability
+
+ Libevent now uses large-file support internally on platforms where it
+ matters. You shouldn't need to set _LARGEFILE or OFFSET_BITS or
+ anything magic before including the Libevent headers, either, since
+ Libevent now sets the size of ev_off_t to the size of off_t that it
+ received at compile time, not to some (possibly different) size based
+ on current macro definitions when your program is building.
+
+ We now also use the Autoconf AC_USE_SYSTEM_EXTENSIONS mechanism to
+ enable per-system macros needed to enable not-on-by-default features.
+ Unlike the rest of the autoconf macros, we output these to an
+ internal-use-only evconfig-private.h header, since their names need to
+ survive unmangled. This lets us build correctly on more platforms,
+ and avoid inconsistencies when some files define _GNU_SOURCE and
+ others don't.
+
+ Libevent now tries to detect OpenSSL via pkg-config.
+
+4.5. Standards conformance
+
+ Previous Libevent versions had no consistent convention for internal
+ vs external identifiers, and used identifiers starting with the "_"
+ character throughout the codebase. That's no good, since the C
+ standard says that identifiers beginning with _ are reserved. I'm not
+ aware of having any collisions with system identifiers, but it's best
+ to fix these things before they cause trouble.
+
+ We now avoid all use of the _identifiers in the Libevent source code.
+ These changes were made *mainly* through the use of automated scripts,
+ so there shouldn't be any mistakes, but you never know.
+
+ As an exception, the names _EVENT_LOG_DEBUG, _EVENT_LOG_MSG_,
+ _EVENT_LOG_WARN, and _EVENT_LOG_ERR are still exposed in event.h: they
+ are now deprecated, but to support older code, they will need to stay
+ around for a while. New code should use EVENT_LOG_DEBUG,
+ EVENT_LOG_MSG, EVENT_LOG_WARN, and EVENT_LOG_ERR instead.
+
+4.6. Event and callback refactoring
+
+ As a simplification and optimization to Libevent's "deferred callback"
+ logic (introduced in 2.0 to avoid callback recursion), Libevent now
+ treats all of its deferrable callback types using the same logic it
+ uses for active events. Now deferred events no longer cause priority
+ inversion, no longer require special code to cancel them, and so on.
+
+ Regular events and deferred callbacks now both descend from an
+ internal light-weight event_callback supertype, and both support
+ priorities and take part in the other anti-priority-inversion
+ mechanisms in Libevent.
+
+ To avoid starvation from callback recursion (which was the reason we
+ introduced "deferred callbacks" in the first place) the implementation
+ now allows an event callback to be scheduled as "active later":
+ instead of running in the current iteration of the event loop, it runs
+ in the next one.
+
+5. Testing
+
+ Libevent's test coverage level is more or less unchanged since before:
+ we still have over 80% line coverage in our tests on Linux and OSX.
+ There are some under-tested modules, though: we need to fix those.
diff --git a/sntp/libevent/win32select.c b/sntp/libevent/win32select.c
new file mode 100644
index 0000000..a50a2df
--- /dev/null
+++ b/sntp/libevent/win32select.c
@@ -0,0 +1,388 @@
+/*
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
+ * Copyright 2000-2007 Niels Provos <provos@citi.umich.edu>
+ * Copyright 2003 Michael A. Davis <mike@datanerds.net>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+
+#include <winsock2.h>
+#include <windows.h>
+#include <sys/types.h>
+#include <sys/queue.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "event2/util.h"
+#include "util-internal.h"
+#include "log-internal.h"
+#include "event2/event.h"
+#include "event-internal.h"
+#include "evmap-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
+#include "time-internal.h"
+
+#define XFREE(ptr) do { if (ptr) mm_free(ptr); } while (0)
+
+extern struct event_list timequeue;
+extern struct event_list addqueue;
+
+struct win_fd_set {
+ u_int fd_count;
+ SOCKET fd_array[1];
+};
+
+/* MSDN says this is required to handle SIGFPE */
+volatile double SIGFPE_REQ = 0.0f;
+
+struct idx_info {
+ int read_pos_plus1;
+ int write_pos_plus1;
+};
+
+struct win32op {
+ unsigned num_fds_in_fd_sets;
+ int resize_out_sets;
+ struct win_fd_set *readset_in;
+ struct win_fd_set *writeset_in;
+ struct win_fd_set *readset_out;
+ struct win_fd_set *writeset_out;
+ struct win_fd_set *exset_out;
+ unsigned signals_are_broken : 1;
+};
+
+static void *win32_init(struct event_base *);
+static int win32_add(struct event_base *, evutil_socket_t, short old, short events, void *idx_);
+static int win32_del(struct event_base *, evutil_socket_t, short old, short events, void *idx_);
+static int win32_dispatch(struct event_base *base, struct timeval *);
+static void win32_dealloc(struct event_base *);
+
+struct eventop win32ops = {
+ "win32",
+ win32_init,
+ win32_add,
+ win32_del,
+ win32_dispatch,
+ win32_dealloc,
+ 0, /* doesn't need reinit */
+ 0, /* No features supported. */
+ sizeof(struct idx_info),
+};
+
+#define FD_SET_ALLOC_SIZE(n) ((sizeof(struct win_fd_set) + ((n)-1)*sizeof(SOCKET)))
+
+static int
+grow_fd_sets(struct win32op *op, unsigned new_num_fds)
+{
+ size_t size;
+
+ EVUTIL_ASSERT(new_num_fds >= op->readset_in->fd_count &&
+ new_num_fds >= op->writeset_in->fd_count);
+ EVUTIL_ASSERT(new_num_fds >= 1);
+
+ size = FD_SET_ALLOC_SIZE(new_num_fds);
+ if (!(op->readset_in = mm_realloc(op->readset_in, size)))
+ return (-1);
+ if (!(op->writeset_in = mm_realloc(op->writeset_in, size)))
+ return (-1);
+ op->resize_out_sets = 1;
+ op->num_fds_in_fd_sets = new_num_fds;
+ return (0);
+}
+
+static int
+do_fd_set(struct win32op *op, struct idx_info *ent, evutil_socket_t s, int read)
+{
+ struct win_fd_set *set = read ? op->readset_in : op->writeset_in;
+ if (read) {
+ if (ent->read_pos_plus1 > 0)
+ return (0);
+ } else {
+ if (ent->write_pos_plus1 > 0)
+ return (0);
+ }
+ if (set->fd_count == op->num_fds_in_fd_sets) {
+ if (grow_fd_sets(op, op->num_fds_in_fd_sets*2))
+ return (-1);
+ /* set pointer will have changed and needs reiniting! */
+ set = read ? op->readset_in : op->writeset_in;
+ }
+ set->fd_array[set->fd_count] = s;
+ if (read)
+ ent->read_pos_plus1 = set->fd_count+1;
+ else
+ ent->write_pos_plus1 = set->fd_count+1;
+ return (set->fd_count++);
+}
+
+static int
+do_fd_clear(struct event_base *base,
+ struct win32op *op, struct idx_info *ent, int read)
+{
+ int i;
+ struct win_fd_set *set = read ? op->readset_in : op->writeset_in;
+ if (read) {
+ i = ent->read_pos_plus1 - 1;
+ ent->read_pos_plus1 = 0;
+ } else {
+ i = ent->write_pos_plus1 - 1;
+ ent->write_pos_plus1 = 0;
+ }
+ if (i < 0)
+ return (0);
+ if (--set->fd_count != (unsigned)i) {
+ struct idx_info *ent2;
+ SOCKET s2;
+ s2 = set->fd_array[i] = set->fd_array[set->fd_count];
+
+ ent2 = evmap_io_get_fdinfo_(&base->io, s2);
+
+ if (!ent2) /* This indicates a bug. */
+ return (0);
+ if (read)
+ ent2->read_pos_plus1 = i+1;
+ else
+ ent2->write_pos_plus1 = i+1;
+ }
+ return (0);
+}
+
+#define NEVENT 32
+void *
+win32_init(struct event_base *base)
+{
+ struct win32op *winop;
+ size_t size;
+ if (!(winop = mm_calloc(1, sizeof(struct win32op))))
+ return NULL;
+ winop->num_fds_in_fd_sets = NEVENT;
+ size = FD_SET_ALLOC_SIZE(NEVENT);
+ if (!(winop->readset_in = mm_malloc(size)))
+ goto err;
+ if (!(winop->writeset_in = mm_malloc(size)))
+ goto err;
+ if (!(winop->readset_out = mm_malloc(size)))
+ goto err;
+ if (!(winop->writeset_out = mm_malloc(size)))
+ goto err;
+ if (!(winop->exset_out = mm_malloc(size)))
+ goto err;
+ winop->readset_in->fd_count = winop->writeset_in->fd_count = 0;
+ winop->readset_out->fd_count = winop->writeset_out->fd_count
+ = winop->exset_out->fd_count = 0;
+
+ if (evsig_init_(base) < 0)
+ winop->signals_are_broken = 1;
+
+ evutil_weakrand_seed_(&base->weakrand_seed, 0);
+
+ return (winop);
+ err:
+ XFREE(winop->readset_in);
+ XFREE(winop->writeset_in);
+ XFREE(winop->readset_out);
+ XFREE(winop->writeset_out);
+ XFREE(winop->exset_out);
+ XFREE(winop);
+ return (NULL);
+}
+
+int
+win32_add(struct event_base *base, evutil_socket_t fd,
+ short old, short events, void *idx_)
+{
+ struct win32op *win32op = base->evbase;
+ struct idx_info *idx = idx_;
+
+ if ((events & EV_SIGNAL) && win32op->signals_are_broken)
+ return (-1);
+
+ if (!(events & (EV_READ|EV_WRITE)))
+ return (0);
+
+ event_debug(("%s: adding event for %d", __func__, (int)fd));
+ if (events & EV_READ) {
+ if (do_fd_set(win32op, idx, fd, 1)<0)
+ return (-1);
+ }
+ if (events & EV_WRITE) {
+ if (do_fd_set(win32op, idx, fd, 0)<0)
+ return (-1);
+ }
+ return (0);
+}
+
+int
+win32_del(struct event_base *base, evutil_socket_t fd, short old, short events,
+ void *idx_)
+{
+ struct win32op *win32op = base->evbase;
+ struct idx_info *idx = idx_;
+
+ event_debug(("%s: Removing event for "EV_SOCK_FMT,
+ __func__, EV_SOCK_ARG(fd)));
+ if (events & EV_READ)
+ do_fd_clear(base, win32op, idx, 1);
+ if (events & EV_WRITE)
+ do_fd_clear(base, win32op, idx, 0);
+
+ return 0;
+}
+
+static void
+fd_set_copy(struct win_fd_set *out, const struct win_fd_set *in)
+{
+ out->fd_count = in->fd_count;
+ memcpy(out->fd_array, in->fd_array, in->fd_count * (sizeof(SOCKET)));
+}
+
+/*
+ static void dump_fd_set(struct win_fd_set *s)
+ {
+ unsigned int i;
+ printf("[ ");
+ for(i=0;i<s->fd_count;++i)
+ printf("%d ",(int)s->fd_array[i]);
+ printf("]\n");
+ }
+*/
+
+int
+win32_dispatch(struct event_base *base, struct timeval *tv)
+{
+ struct win32op *win32op = base->evbase;
+ int res = 0;
+ unsigned j, i;
+ int fd_count;
+ SOCKET s;
+
+ if (win32op->resize_out_sets) {
+ size_t size = FD_SET_ALLOC_SIZE(win32op->num_fds_in_fd_sets);
+ if (!(win32op->readset_out = mm_realloc(win32op->readset_out, size)))
+ return (-1);
+ if (!(win32op->exset_out = mm_realloc(win32op->exset_out, size)))
+ return (-1);
+ if (!(win32op->writeset_out = mm_realloc(win32op->writeset_out, size)))
+ return (-1);
+ win32op->resize_out_sets = 0;
+ }
+
+ fd_set_copy(win32op->readset_out, win32op->readset_in);
+ fd_set_copy(win32op->exset_out, win32op->writeset_in);
+ fd_set_copy(win32op->writeset_out, win32op->writeset_in);
+
+ fd_count =
+ (win32op->readset_out->fd_count > win32op->writeset_out->fd_count) ?
+ win32op->readset_out->fd_count : win32op->writeset_out->fd_count;
+
+ if (!fd_count) {
+ long msec = tv ? evutil_tv_to_msec_(tv) : LONG_MAX;
+ /* Sleep's DWORD argument is unsigned long */
+ if (msec < 0)
+ msec = LONG_MAX;
+ /* Windows doesn't like you to call select() with no sockets */
+ Sleep(msec);
+ return (0);
+ }
+
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+
+ res = select(fd_count,
+ (struct fd_set*)win32op->readset_out,
+ (struct fd_set*)win32op->writeset_out,
+ (struct fd_set*)win32op->exset_out, tv);
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+
+ event_debug(("%s: select returned %d", __func__, res));
+
+ if (res <= 0) {
+ return res;
+ }
+
+ if (win32op->readset_out->fd_count) {
+ i = evutil_weakrand_range_(&base->weakrand_seed,
+ win32op->readset_out->fd_count);
+ for (j=0; j<win32op->readset_out->fd_count; ++j) {
+ if (++i >= win32op->readset_out->fd_count)
+ i = 0;
+ s = win32op->readset_out->fd_array[i];
+ evmap_io_active_(base, s, EV_READ);
+ }
+ }
+ if (win32op->exset_out->fd_count) {
+ i = evutil_weakrand_range_(&base->weakrand_seed,
+ win32op->exset_out->fd_count);
+ for (j=0; j<win32op->exset_out->fd_count; ++j) {
+ if (++i >= win32op->exset_out->fd_count)
+ i = 0;
+ s = win32op->exset_out->fd_array[i];
+ evmap_io_active_(base, s, EV_WRITE);
+ }
+ }
+ if (win32op->writeset_out->fd_count) {
+ SOCKET s;
+ i = evutil_weakrand_range_(&base->weakrand_seed,
+ win32op->writeset_out->fd_count);
+ for (j=0; j<win32op->writeset_out->fd_count; ++j) {
+ if (++i >= win32op->writeset_out->fd_count)
+ i = 0;
+ s = win32op->writeset_out->fd_array[i];
+ evmap_io_active_(base, s, EV_WRITE);
+ }
+ }
+ return (0);
+}
+
+void
+win32_dealloc(struct event_base *base)
+{
+ struct win32op *win32op = base->evbase;
+
+ evsig_dealloc_(base);
+ if (win32op->readset_in)
+ mm_free(win32op->readset_in);
+ if (win32op->writeset_in)
+ mm_free(win32op->writeset_in);
+ if (win32op->readset_out)
+ mm_free(win32op->readset_out);
+ if (win32op->writeset_out)
+ mm_free(win32op->writeset_out);
+ if (win32op->exset_out)
+ mm_free(win32op->exset_out);
+ /* XXXXX free the tree. */
+
+ memset(win32op, 0, sizeof(*win32op));
+ mm_free(win32op);
+}
+
+#endif
diff --git a/sntp/libopts/COPYING.gplv3 b/sntp/libopts/COPYING.gplv3
new file mode 100644
index 0000000..065b7a6
--- /dev/null
+++ b/sntp/libopts/COPYING.gplv3
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) by Bruce Korb - all rights reserved
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) by Bruce Korb - all rights reserved
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/sntp/libopts/COPYING.lgplv3 b/sntp/libopts/COPYING.lgplv3
new file mode 100644
index 0000000..3deaacb
--- /dev/null
+++ b/sntp/libopts/COPYING.lgplv3
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/sntp/libopts/COPYING.mbsd b/sntp/libopts/COPYING.mbsd
new file mode 100644
index 0000000..8a70427
--- /dev/null
+++ b/sntp/libopts/COPYING.mbsd
@@ -0,0 +1,26 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ 3. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/sntp/libopts/MakeDefs.inc b/sntp/libopts/MakeDefs.inc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/sntp/libopts/MakeDefs.inc
diff --git a/sntp/libopts/Makefile.am b/sntp/libopts/Makefile.am
new file mode 100644
index 0000000..ea1b56d
--- /dev/null
+++ b/sntp/libopts/Makefile.am
@@ -0,0 +1,60 @@
+## LIBOPTS Makefile
+MAINTAINERCLEANFILES = Makefile.in
+if INSTALL_LIBOPTS
+lib_LTLIBRARIES = libopts.la
+else
+noinst_LTLIBRARIES = libopts.la
+endif
+libopts_la_SOURCES = libopts.c
+libopts_la_CPPFLAGS = -I$(srcdir)
+libopts_la_LDFLAGS = -version-info 41:0:16
+EXTRA_DIST =
+BUILT_SOURCES =
+MOSTLYCLEANFILES =
+
+libopts.c: $(BUILT_SOURCES)
+ @: do-nothing rule to avoid default SCCS get
+
+
+# Makefile fragment from gnulib-s stdnoreturn module:
+#
+_NORETURN_H=$(srcdir)/compat/_Noreturn.h
+EXTRA_DIST += $(srcdir)/compat/_Noreturn.h
+BUILT_SOURCES += $(STDNORETURN_H)
+if GL_GENERATE_STDNORETURN_H
+stdnoreturn.h: stdnoreturn.in.h $(top_builddir)/config.status $(_NORETURN_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ < $(srcdir)/stdnoreturn.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+stdnoreturn.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdnoreturn.h stdnoreturn.h-t
+EXTRA_DIST += stdnoreturn.in.h
+
+EXTRA_DIST += \
+ COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \
+ MakeDefs.inc README ag-char-map.h \
+ alias.c ao-strs.c ao-strs.h \
+ autoopts/project.h autoopts/options.h autoopts/usage-txt.h \
+ autoopts.c autoopts.h boolean.c \
+ check.c compat/snprintf.c compat/strchr.c \
+ compat/strdup.c compat/_Noreturn.h compat/pathfind.c \
+ compat/compat.h compat/windows-config.h configfile.c \
+ cook.c enum.c env.c \
+ file.c find.c genshell.c \
+ genshell.h gettext.h init.c \
+ intprops.h load.c m4/stdnoreturn.m4 \
+ m4/liboptschk.m4 m4/libopts.m4 makeshell.c \
+ nested.c numeric.c option-value-type.c \
+ option-value-type.h option-xat-attribute.c option-xat-attribute.h \
+ parse-duration.c parse-duration.h pgusage.c \
+ proto.h putshell.c reset.c \
+ restore.c save.c sort.c \
+ stack.c stdnoreturn.in.h streqvcmp.c \
+ text_mmap.c time.c tokenize.c \
+ usage.c version.c
diff --git a/sntp/libopts/Makefile.in b/sntp/libopts/Makefile.in
new file mode 100644
index 0000000..111bc0f
--- /dev/null
+++ b/sntp/libopts/Makefile.in
@@ -0,0 +1,733 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libopts
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
+ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/libevent/m4/openldap.m4 \
+ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/m4/ntp_compiler.m4 \
+ $(top_srcdir)/m4/ntp_crosscompile.m4 \
+ $(top_srcdir)/m4/ntp_debug.m4 $(top_srcdir)/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/m4/ntp_googletest.m4 \
+ $(top_srcdir)/m4/ntp_ipv6.m4 $(top_srcdir)/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/m4/ntp_libevent.m4 \
+ $(top_srcdir)/m4/ntp_libntp.m4 \
+ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/m4/ntp_openssl.m4 \
+ $(top_srcdir)/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
+ $(top_srcdir)/m4/ntp_sysexits.m4 \
+ $(top_srcdir)/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
+ $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(libdir)"
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+libopts_la_LIBADD =
+am_libopts_la_OBJECTS = libopts_la-libopts.lo
+libopts_la_OBJECTS = $(am_libopts_la_OBJECTS)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+libopts_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libopts_la_LDFLAGS) $(LDFLAGS) -o $@
+@INSTALL_LIBOPTS_FALSE@am_libopts_la_rpath =
+@INSTALL_LIBOPTS_TRUE@am_libopts_la_rpath = -rpath $(libdir)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libopts_la_SOURCES)
+DIST_SOURCES = $(libopts_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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@
+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_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@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIB_SYSLOG = @LIB_SYSLOG@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+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_FORCE_LIBEVENT_DIST = @NTP_FORCE_LIBEVENT_DIST@
+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_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_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+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@
+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@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+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@
+MAINTAINERCLEANFILES = Makefile.in
+@INSTALL_LIBOPTS_TRUE@lib_LTLIBRARIES = libopts.la
+@INSTALL_LIBOPTS_FALSE@noinst_LTLIBRARIES = libopts.la
+libopts_la_SOURCES = libopts.c
+libopts_la_CPPFLAGS = -I$(srcdir)
+libopts_la_LDFLAGS = -version-info 41:0:16
+EXTRA_DIST = $(srcdir)/compat/_Noreturn.h stdnoreturn.in.h \
+ COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd MakeDefs.inc README \
+ ag-char-map.h alias.c ao-strs.c ao-strs.h autoopts/project.h \
+ autoopts/options.h autoopts/usage-txt.h autoopts.c autoopts.h \
+ boolean.c check.c compat/snprintf.c compat/strchr.c \
+ compat/strdup.c compat/_Noreturn.h compat/pathfind.c \
+ compat/compat.h compat/windows-config.h configfile.c cook.c \
+ enum.c env.c file.c find.c genshell.c genshell.h gettext.h \
+ init.c intprops.h load.c m4/stdnoreturn.m4 m4/liboptschk.m4 \
+ m4/libopts.m4 makeshell.c nested.c numeric.c \
+ option-value-type.c option-value-type.h option-xat-attribute.c \
+ option-xat-attribute.h parse-duration.c parse-duration.h \
+ pgusage.c proto.h putshell.c reset.c restore.c save.c sort.c \
+ stack.c stdnoreturn.in.h streqvcmp.c text_mmap.c time.c \
+ tokenize.c usage.c version.c
+BUILT_SOURCES = $(STDNORETURN_H)
+MOSTLYCLEANFILES = stdnoreturn.h stdnoreturn.h-t
+
+# Makefile fragment from gnulib-s stdnoreturn module:
+#
+_NORETURN_H = $(srcdir)/compat/_Noreturn.h
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libopts/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libopts/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libopts.la: $(libopts_la_OBJECTS) $(libopts_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libopts_la_LINK) $(am_libopts_la_rpath) $(libopts_la_OBJECTS) $(libopts_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopts_la-libopts.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libopts_la-libopts.lo: libopts.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libopts_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libopts_la-libopts.lo -MD -MP -MF $(DEPDIR)/libopts_la-libopts.Tpo -c -o libopts_la-libopts.lo `test -f 'libopts.c' || echo '$(srcdir)/'`libopts.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libopts_la-libopts.Tpo $(DEPDIR)/libopts_la-libopts.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libopts.c' object='libopts_la-libopts.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libopts_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libopts_la-libopts.lo `test -f 'libopts.c' || echo '$(srcdir)/'`libopts.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
+ ctags distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-libLTLIBRARIES install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-libLTLIBRARIES
+
+
+libopts.c: $(BUILT_SOURCES)
+ @: do-nothing rule to avoid default SCCS get
+@GL_GENERATE_STDNORETURN_H_TRUE@stdnoreturn.h: stdnoreturn.in.h $(top_builddir)/config.status $(_NORETURN_H)
+@GL_GENERATE_STDNORETURN_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDNORETURN_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_STDNORETURN_H_TRUE@ sed -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+@GL_GENERATE_STDNORETURN_H_TRUE@ < $(srcdir)/stdnoreturn.in.h; \
+@GL_GENERATE_STDNORETURN_H_TRUE@ } > $@-t && \
+@GL_GENERATE_STDNORETURN_H_TRUE@ mv $@-t $@
+@GL_GENERATE_STDNORETURN_H_FALSE@stdnoreturn.h: $(top_builddir)/config.status
+@GL_GENERATE_STDNORETURN_H_FALSE@ rm -f $@
+
+# 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/sntp/libopts/README b/sntp/libopts/README
new file mode 100644
index 0000000..4bf758d
--- /dev/null
+++ b/sntp/libopts/README
@@ -0,0 +1,122 @@
+ THIS TARBALL IS NOT A FULL DISTRIBUTION.
+
+The contents of this tarball is designed to be incorporated into
+software packages that utilize the AutoOpts option automation package
+and are intended to be installed on systems that may not have libopts
+installed. It is redistributable under the terms of either the LGPL
+(see COPYING.lgpl) or under the terms of the advertising clause free BSD
+license (see COPYING.mbsd).
+
+Usage Instructions for autoconf/automake/libtoolized projects:
+
+1. Install the unrolled tarball into your package source tree,
+ copying ``libopts.m4'' to your autoconf macro directory.
+
+ In your bootstrap (pre-configure) script, you can do this:
+
+ rm -rf libopts libopts-*
+ gunzip -c `autoopts-config libsrc` | tar -xvf -
+ mv -f libopts-*.*.* libopts
+ cp -fp libopts/m4/*.m4 m4/.
+
+ I tend to put my configure auxiliary files in "m4".
+ Whatever directory you choose, if it is not ".", then
+ be sure to tell autoconf about it with:
+
+ AC_CONFIG_AUX_DIR(m4)
+
+ This is one macro where you *MUST* remember to *NOT* quote
+ the argument. If you do, automake will get lost.
+
+2. Add an invocation of either LIBOPTS_CHECK or LIBOPTS_CHECK_NOBUILD
+ to your configure.ac file. See LIBOPTS_CHECK: below for details.
+
+3. Add the following to your top level ``Makefile.am'' file:
+
+ if NEED_LIBOPTS
+ SUBDIRS += $(LIBOPTS_DIR)
+ endif
+
+ where ``<...>'' can be whatever other files or directories you may
+ need. The SUBDIRS must be properly ordered. *PLEASE NOTE* it is
+ crucial that the SUBDIRS be set under the control of an automake
+ conditional. To work correctly, automake has to know the range of
+ possible values of SUBDIRS. It's a magical name with magical
+ properties. ``NEED_LIBOPTS'' will be correctly set by the
+ ``LIBOPTS_CHECK'' macro, above.
+
+4. Add ``$(LIBOPTS_CFLAGS)'' to relevant compiler flags and
+ ``$(LIBOPTS_LDADD)'' to relevant link options whereever
+ you need them in your build tree.
+
+5. Make sure your object files explicitly depend upon the
+ generated options header file. e.g.:
+
+ $(prog_OBJECTS) : prog-opts.h
+ prog-opts.h : prog-opts.c
+ prog-opts.c : prog-opts.def
+ autogen prog-opts.def
+
+6. *OPTIONAL* --
+ If you are creating man pages and texi documentation from
+ the program options, you will need these rules somewhere, too:
+
+ man_MANS = prog.1
+ prog.1 : prog-opts.def
+ autogen -Tagman-cmd.tpl -bprog prog-opts.def
+
+ invoke-prog.texi : prog-opts.def
+ autogen -Tagtexi-cmd.tpl prog-opts.def
+
+If your package does not utilize the auto* tools, then you
+will need to hand craft the rules for building the library.
+
+LIBOPTS_CHECK:
+
+The arguments to both macro are a relative path to the directory with
+the libopts source code. It is optional and defaults to "libopts".
+These macros work as follows:
+
+1. LIBOPTS_CHECK([libopts/rel/path/optional])
+
+ Adds two command-line options to the generated configure script,
+ --enable-local-libopts and --disable-libopts-install. AC_SUBST's
+ LIBOPTS_CFLAGS, LIBOPTS_LDADD, and LIBOPTS_DIR for use in
+ Makefile.am files. Adds Automake conditional NEED_LIBOPTS which
+ will be true when the local copy of libopts should be built. Uses
+ AC_CONFIG_FILES([$libopts-dir/Makefile]) to cause the local libopts
+ into the package build. If the optional relative path to libopts is
+ not provided, it defaults to simply "libopts".
+
+2. LIBOPTS_CHECK_NOBUILD([libopts/rel/path/optional])
+
+ This variant of LIBOPTS_CHECK is useful when multiple configure.ac
+ files in a package make use of a single libopts tearoff. In that
+ case, only one of the configure.ac files should build libopts and
+ others should simply use it. Consider this package arrangment:
+
+ all-tools/
+ configure.ac
+ common-tools/
+ configure.ac
+ libopts/
+
+ The parent package all-tools contains a subpackage common-tools
+ which can be torn off and used independently. Programs configured
+ by both configure.ac files link against the common-tools/libopts
+ tearoff, when not using the system's libopts. The top-level
+ configure.ac uses LIBOPTS_CHECK_NOBUILD([common-tools/libopts]),
+ while common-tools/configure.ac uses LIBOPTS_CHECK. The difference
+ is LIBOPTS_CHECK_NOBUILD will never build the libopts tearoff,
+ leaving that to the subpackage configure.ac's LIBOPTS_CHECK.
+ Specifically, LIBOPTS_CHECK_NOBUILD always results in the
+ NEED_LIBOPTS Automake conditional being false, and does not invoke
+ AC_CONFIG_FILES(path-to-libopts/Makefile).
+
+LICENSING:
+
+This material is Copyright (C) 1992-2014 by Bruce Korb. You are
+licensed to use this under the terms of either the GNU Lesser General
+Public License (see: COPYING.lgpl), or, at your option, the modified
+Berkeley Software Distribution License (see: COPYING.mbsd). Both of
+these files should be included with this tarball.
diff --git a/sntp/libopts/ag-char-map.h b/sntp/libopts/ag-char-map.h
new file mode 100644
index 0000000..01733d7
--- /dev/null
+++ b/sntp/libopts/ag-char-map.h
@@ -0,0 +1,526 @@
+/*
+ * 29 bits for 46 character classifications
+ * generated by char-mapper on 08/08/14 at 16:09:03
+ *
+ * This file contains the character classifications
+ * used by AutoGen and AutoOpts for identifying tokens.
+ * The table is static scope, so %guard is empty.
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+#ifndef AG_CHAR_MAP_H_GUARD
+#define AG_CHAR_MAP_H_GUARD 1
+
+#ifdef HAVE_CONFIG_H
+# if defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+
+# elif defined(HAVE_STDINT_H)
+# include <stdint.h>
+
+# elif !defined(HAVE_UINT32_T)
+# if SIZEOF_INT == 4
+ typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+ typedef unsigned long uint32_t;
+# endif
+# endif /* HAVE_*INT*_H header */
+
+#else /* not HAVE_CONFIG_H -- */
+# include <inttypes.h>
+#endif /* HAVE_CONFIG_H */
+
+#if 0 /* mapping specification source (from autogen.map) */
+//
+// %guard
+// %file ag-char-map.h
+// %backup
+// %optimize
+//
+// %comment -- see above
+// %
+//
+// newline "\n"
+// nul-byte "\x00"
+// dir-sep "/\\"
+// percent "%"
+// comma ","
+// colon ":"
+// underscore "_"
+// plus "+"
+// dollar "$"
+// option-marker "-"
+//
+// horiz-white "\t "
+// alt-white "\v\f\r\b"
+// whitespace +horiz-white +newline +alt-white
+// non-nl-white +horiz-white +alt-white
+// quote "'\""
+// parentheses "()"
+//
+// graphic "!-~"
+// inversion "~-"
+// oct-digit "0-7"
+// dec-digit "89" +oct-digit
+// hex-digit "a-fA-F" +dec-digit
+// lower-case "a-z"
+// upper-case "A-Z"
+// alphabetic +lower-case +upper-case
+// alphanumeric +alphabetic +dec-digit
+// var-first +underscore +alphabetic
+// variable-name +var-first +dec-digit
+// option-name "^-" +variable-name
+// value-name +colon +option-name
+// name-sep "[.]"
+// compound-name +value-name +name-sep +horiz-white
+// scheme-note +parentheses +quote
+//
+// unquotable "!-~" -"#,;<=>[\\]`{}?*" -quote -parentheses
+// end-xml-token "/>" +whitespace
+// plus-n-space +plus +whitespace
+// punctuation "!-~" -alphanumeric -"_"
+// suffix "-._" +alphanumeric
+// suffix-fmt +percent +suffix +dir-sep
+// false-type "nNfF0" +nul-byte
+// file-name +dir-sep +suffix
+// end-token +nul-byte +whitespace
+// end-list-entry +comma +end-token
+// set-separator "|+-!" +end-list-entry
+// signed-number +inversion +dec-digit
+// make-script +dollar +newline
+// load-line-skip +horiz-white +option-marker
+//
+#endif /* 0 -- mapping spec. source */
+
+
+typedef uint32_t ag_char_map_mask_t;
+
+#define IS_NEWLINE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000001)
+#define SPN_NEWLINE_CHARS(_s) spn_ag_char_map_chars(_s, 0)
+#define BRK_NEWLINE_CHARS(_s) brk_ag_char_map_chars(_s, 0)
+#define SPN_NEWLINE_BACK(s,e) spn_ag_char_map_back(s, e, 0)
+#define BRK_NEWLINE_BACK(s,e) brk_ag_char_map_back(s, e, 0)
+#define IS_NUL_BYTE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000002)
+#define SPN_NUL_BYTE_CHARS(_s) spn_ag_char_map_chars(_s, 1)
+#define BRK_NUL_BYTE_CHARS(_s) brk_ag_char_map_chars(_s, 1)
+#define SPN_NUL_BYTE_BACK(s,e) spn_ag_char_map_back(s, e, 1)
+#define BRK_NUL_BYTE_BACK(s,e) brk_ag_char_map_back(s, e, 1)
+#define IS_DIR_SEP_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000004)
+#define SPN_DIR_SEP_CHARS(_s) spn_ag_char_map_chars(_s, 2)
+#define BRK_DIR_SEP_CHARS(_s) brk_ag_char_map_chars(_s, 2)
+#define SPN_DIR_SEP_BACK(s,e) spn_ag_char_map_back(s, e, 2)
+#define BRK_DIR_SEP_BACK(s,e) brk_ag_char_map_back(s, e, 2)
+#define IS_PERCENT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000008)
+#define SPN_PERCENT_CHARS(_s) spn_ag_char_map_chars(_s, 3)
+#define BRK_PERCENT_CHARS(_s) brk_ag_char_map_chars(_s, 3)
+#define SPN_PERCENT_BACK(s,e) spn_ag_char_map_back(s, e, 3)
+#define BRK_PERCENT_BACK(s,e) brk_ag_char_map_back(s, e, 3)
+#define IS_COMMA_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000010)
+#define SPN_COMMA_CHARS(_s) spn_ag_char_map_chars(_s, 4)
+#define BRK_COMMA_CHARS(_s) brk_ag_char_map_chars(_s, 4)
+#define SPN_COMMA_BACK(s,e) spn_ag_char_map_back(s, e, 4)
+#define BRK_COMMA_BACK(s,e) brk_ag_char_map_back(s, e, 4)
+#define IS_COLON_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000020)
+#define SPN_COLON_CHARS(_s) spn_ag_char_map_chars(_s, 5)
+#define BRK_COLON_CHARS(_s) brk_ag_char_map_chars(_s, 5)
+#define SPN_COLON_BACK(s,e) spn_ag_char_map_back(s, e, 5)
+#define BRK_COLON_BACK(s,e) brk_ag_char_map_back(s, e, 5)
+#define IS_UNDERSCORE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000040)
+#define SPN_UNDERSCORE_CHARS(_s) spn_ag_char_map_chars(_s, 6)
+#define BRK_UNDERSCORE_CHARS(_s) brk_ag_char_map_chars(_s, 6)
+#define SPN_UNDERSCORE_BACK(s,e) spn_ag_char_map_back(s, e, 6)
+#define BRK_UNDERSCORE_BACK(s,e) brk_ag_char_map_back(s, e, 6)
+#define IS_PLUS_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000080)
+#define SPN_PLUS_CHARS(_s) spn_ag_char_map_chars(_s, 7)
+#define BRK_PLUS_CHARS(_s) brk_ag_char_map_chars(_s, 7)
+#define SPN_PLUS_BACK(s,e) spn_ag_char_map_back(s, e, 7)
+#define BRK_PLUS_BACK(s,e) brk_ag_char_map_back(s, e, 7)
+#define IS_DOLLAR_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000100)
+#define SPN_DOLLAR_CHARS(_s) spn_ag_char_map_chars(_s, 8)
+#define BRK_DOLLAR_CHARS(_s) brk_ag_char_map_chars(_s, 8)
+#define SPN_DOLLAR_BACK(s,e) spn_ag_char_map_back(s, e, 8)
+#define BRK_DOLLAR_BACK(s,e) brk_ag_char_map_back(s, e, 8)
+#define IS_OPTION_MARKER_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000200)
+#define SPN_OPTION_MARKER_CHARS(_s) spn_ag_char_map_chars(_s, 9)
+#define BRK_OPTION_MARKER_CHARS(_s) brk_ag_char_map_chars(_s, 9)
+#define SPN_OPTION_MARKER_BACK(s,e) spn_ag_char_map_back(s, e, 9)
+#define BRK_OPTION_MARKER_BACK(s,e) brk_ag_char_map_back(s, e, 9)
+#define IS_HORIZ_WHITE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000400)
+#define SPN_HORIZ_WHITE_CHARS(_s) spn_ag_char_map_chars(_s, 10)
+#define BRK_HORIZ_WHITE_CHARS(_s) brk_ag_char_map_chars(_s, 10)
+#define SPN_HORIZ_WHITE_BACK(s,e) spn_ag_char_map_back(s, e, 10)
+#define BRK_HORIZ_WHITE_BACK(s,e) brk_ag_char_map_back(s, e, 10)
+#define IS_ALT_WHITE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000800)
+#define SPN_ALT_WHITE_CHARS(_s) spn_ag_char_map_chars(_s, 11)
+#define BRK_ALT_WHITE_CHARS(_s) brk_ag_char_map_chars(_s, 11)
+#define SPN_ALT_WHITE_BACK(s,e) spn_ag_char_map_back(s, e, 11)
+#define BRK_ALT_WHITE_BACK(s,e) brk_ag_char_map_back(s, e, 11)
+#define IS_WHITESPACE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C01)
+#define SPN_WHITESPACE_CHARS(_s) spn_ag_char_map_chars(_s, 12)
+#define BRK_WHITESPACE_CHARS(_s) brk_ag_char_map_chars(_s, 12)
+#define SPN_WHITESPACE_BACK(s,e) spn_ag_char_map_back(s, e, 12)
+#define BRK_WHITESPACE_BACK(s,e) brk_ag_char_map_back(s, e, 12)
+#define IS_NON_NL_WHITE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C00)
+#define SPN_NON_NL_WHITE_CHARS(_s) spn_ag_char_map_chars(_s, 13)
+#define BRK_NON_NL_WHITE_CHARS(_s) brk_ag_char_map_chars(_s, 13)
+#define SPN_NON_NL_WHITE_BACK(s,e) spn_ag_char_map_back(s, e, 13)
+#define BRK_NON_NL_WHITE_BACK(s,e) brk_ag_char_map_back(s, e, 13)
+#define IS_QUOTE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00001000)
+#define SPN_QUOTE_CHARS(_s) spn_ag_char_map_chars(_s, 14)
+#define BRK_QUOTE_CHARS(_s) brk_ag_char_map_chars(_s, 14)
+#define SPN_QUOTE_BACK(s,e) spn_ag_char_map_back(s, e, 14)
+#define BRK_QUOTE_BACK(s,e) brk_ag_char_map_back(s, e, 14)
+#define IS_PARENTHESES_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00002000)
+#define SPN_PARENTHESES_CHARS(_s) spn_ag_char_map_chars(_s, 15)
+#define BRK_PARENTHESES_CHARS(_s) brk_ag_char_map_chars(_s, 15)
+#define SPN_PARENTHESES_BACK(s,e) spn_ag_char_map_back(s, e, 15)
+#define BRK_PARENTHESES_BACK(s,e) brk_ag_char_map_back(s, e, 15)
+#define IS_GRAPHIC_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00004000)
+#define SPN_GRAPHIC_CHARS(_s) spn_ag_char_map_chars(_s, 16)
+#define BRK_GRAPHIC_CHARS(_s) brk_ag_char_map_chars(_s, 16)
+#define SPN_GRAPHIC_BACK(s,e) spn_ag_char_map_back(s, e, 16)
+#define BRK_GRAPHIC_BACK(s,e) brk_ag_char_map_back(s, e, 16)
+#define IS_INVERSION_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00008000)
+#define SPN_INVERSION_CHARS(_s) spn_ag_char_map_chars(_s, 17)
+#define BRK_INVERSION_CHARS(_s) brk_ag_char_map_chars(_s, 17)
+#define SPN_INVERSION_BACK(s,e) spn_ag_char_map_back(s, e, 17)
+#define BRK_INVERSION_BACK(s,e) brk_ag_char_map_back(s, e, 17)
+#define IS_OCT_DIGIT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00010000)
+#define SPN_OCT_DIGIT_CHARS(_s) spn_ag_char_map_chars(_s, 18)
+#define BRK_OCT_DIGIT_CHARS(_s) brk_ag_char_map_chars(_s, 18)
+#define SPN_OCT_DIGIT_BACK(s,e) spn_ag_char_map_back(s, e, 18)
+#define BRK_OCT_DIGIT_BACK(s,e) brk_ag_char_map_back(s, e, 18)
+#define IS_DEC_DIGIT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00030000)
+#define SPN_DEC_DIGIT_CHARS(_s) spn_ag_char_map_chars(_s, 19)
+#define BRK_DEC_DIGIT_CHARS(_s) brk_ag_char_map_chars(_s, 19)
+#define SPN_DEC_DIGIT_BACK(s,e) spn_ag_char_map_back(s, e, 19)
+#define BRK_DEC_DIGIT_BACK(s,e) brk_ag_char_map_back(s, e, 19)
+#define IS_HEX_DIGIT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00070000)
+#define SPN_HEX_DIGIT_CHARS(_s) spn_ag_char_map_chars(_s, 20)
+#define BRK_HEX_DIGIT_CHARS(_s) brk_ag_char_map_chars(_s, 20)
+#define SPN_HEX_DIGIT_BACK(s,e) spn_ag_char_map_back(s, e, 20)
+#define BRK_HEX_DIGIT_BACK(s,e) brk_ag_char_map_back(s, e, 20)
+#define IS_LOWER_CASE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00080000)
+#define SPN_LOWER_CASE_CHARS(_s) spn_ag_char_map_chars(_s, 21)
+#define BRK_LOWER_CASE_CHARS(_s) brk_ag_char_map_chars(_s, 21)
+#define SPN_LOWER_CASE_BACK(s,e) spn_ag_char_map_back(s, e, 21)
+#define BRK_LOWER_CASE_BACK(s,e) brk_ag_char_map_back(s, e, 21)
+#define IS_UPPER_CASE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00100000)
+#define SPN_UPPER_CASE_CHARS(_s) spn_ag_char_map_chars(_s, 22)
+#define BRK_UPPER_CASE_CHARS(_s) brk_ag_char_map_chars(_s, 22)
+#define SPN_UPPER_CASE_BACK(s,e) spn_ag_char_map_back(s, e, 22)
+#define BRK_UPPER_CASE_BACK(s,e) brk_ag_char_map_back(s, e, 22)
+#define IS_ALPHABETIC_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00180000)
+#define SPN_ALPHABETIC_CHARS(_s) spn_ag_char_map_chars(_s, 23)
+#define BRK_ALPHABETIC_CHARS(_s) brk_ag_char_map_chars(_s, 23)
+#define SPN_ALPHABETIC_BACK(s,e) spn_ag_char_map_back(s, e, 23)
+#define BRK_ALPHABETIC_BACK(s,e) brk_ag_char_map_back(s, e, 23)
+#define IS_ALPHANUMERIC_CHAR( _c) is_ag_char_map_char((char)(_c), 0x001B0000)
+#define SPN_ALPHANUMERIC_CHARS(_s) spn_ag_char_map_chars(_s, 24)
+#define BRK_ALPHANUMERIC_CHARS(_s) brk_ag_char_map_chars(_s, 24)
+#define SPN_ALPHANUMERIC_BACK(s,e) spn_ag_char_map_back(s, e, 24)
+#define BRK_ALPHANUMERIC_BACK(s,e) brk_ag_char_map_back(s, e, 24)
+#define IS_VAR_FIRST_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00180040)
+#define SPN_VAR_FIRST_CHARS(_s) spn_ag_char_map_chars(_s, 25)
+#define BRK_VAR_FIRST_CHARS(_s) brk_ag_char_map_chars(_s, 25)
+#define SPN_VAR_FIRST_BACK(s,e) spn_ag_char_map_back(s, e, 25)
+#define BRK_VAR_FIRST_BACK(s,e) brk_ag_char_map_back(s, e, 25)
+#define IS_VARIABLE_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x001B0040)
+#define SPN_VARIABLE_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 26)
+#define BRK_VARIABLE_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 26)
+#define SPN_VARIABLE_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 26)
+#define BRK_VARIABLE_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 26)
+#define IS_OPTION_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x003B0040)
+#define SPN_OPTION_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 27)
+#define BRK_OPTION_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 27)
+#define SPN_OPTION_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 27)
+#define BRK_OPTION_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 27)
+#define IS_VALUE_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x003B0060)
+#define SPN_VALUE_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 28)
+#define BRK_VALUE_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 28)
+#define SPN_VALUE_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 28)
+#define BRK_VALUE_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 28)
+#define IS_NAME_SEP_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00400000)
+#define SPN_NAME_SEP_CHARS(_s) spn_ag_char_map_chars(_s, 29)
+#define BRK_NAME_SEP_CHARS(_s) brk_ag_char_map_chars(_s, 29)
+#define SPN_NAME_SEP_BACK(s,e) spn_ag_char_map_back(s, e, 29)
+#define BRK_NAME_SEP_BACK(s,e) brk_ag_char_map_back(s, e, 29)
+#define IS_COMPOUND_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x007B0460)
+#define SPN_COMPOUND_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 30)
+#define BRK_COMPOUND_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 30)
+#define SPN_COMPOUND_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 30)
+#define BRK_COMPOUND_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 30)
+#define IS_SCHEME_NOTE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00003000)
+#define SPN_SCHEME_NOTE_CHARS(_s) spn_ag_char_map_chars(_s, 31)
+#define BRK_SCHEME_NOTE_CHARS(_s) brk_ag_char_map_chars(_s, 31)
+#define SPN_SCHEME_NOTE_BACK(s,e) spn_ag_char_map_back(s, e, 31)
+#define BRK_SCHEME_NOTE_BACK(s,e) brk_ag_char_map_back(s, e, 31)
+#define IS_UNQUOTABLE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00800000)
+#define SPN_UNQUOTABLE_CHARS(_s) spn_ag_char_map_chars(_s, 32)
+#define BRK_UNQUOTABLE_CHARS(_s) brk_ag_char_map_chars(_s, 32)
+#define SPN_UNQUOTABLE_BACK(s,e) spn_ag_char_map_back(s, e, 32)
+#define BRK_UNQUOTABLE_BACK(s,e) brk_ag_char_map_back(s, e, 32)
+#define IS_END_XML_TOKEN_CHAR( _c) is_ag_char_map_char((char)(_c), 0x01000C01)
+#define SPN_END_XML_TOKEN_CHARS(_s) spn_ag_char_map_chars(_s, 33)
+#define BRK_END_XML_TOKEN_CHARS(_s) brk_ag_char_map_chars(_s, 33)
+#define SPN_END_XML_TOKEN_BACK(s,e) spn_ag_char_map_back(s, e, 33)
+#define BRK_END_XML_TOKEN_BACK(s,e) brk_ag_char_map_back(s, e, 33)
+#define IS_PLUS_N_SPACE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C81)
+#define SPN_PLUS_N_SPACE_CHARS(_s) spn_ag_char_map_chars(_s, 34)
+#define BRK_PLUS_N_SPACE_CHARS(_s) brk_ag_char_map_chars(_s, 34)
+#define SPN_PLUS_N_SPACE_BACK(s,e) spn_ag_char_map_back(s, e, 34)
+#define BRK_PLUS_N_SPACE_BACK(s,e) brk_ag_char_map_back(s, e, 34)
+#define IS_PUNCTUATION_CHAR( _c) is_ag_char_map_char((char)(_c), 0x02000000)
+#define SPN_PUNCTUATION_CHARS(_s) spn_ag_char_map_chars(_s, 35)
+#define BRK_PUNCTUATION_CHARS(_s) brk_ag_char_map_chars(_s, 35)
+#define SPN_PUNCTUATION_BACK(s,e) spn_ag_char_map_back(s, e, 35)
+#define BRK_PUNCTUATION_BACK(s,e) brk_ag_char_map_back(s, e, 35)
+#define IS_SUFFIX_CHAR( _c) is_ag_char_map_char((char)(_c), 0x041B0000)
+#define SPN_SUFFIX_CHARS(_s) spn_ag_char_map_chars(_s, 36)
+#define BRK_SUFFIX_CHARS(_s) brk_ag_char_map_chars(_s, 36)
+#define SPN_SUFFIX_BACK(s,e) spn_ag_char_map_back(s, e, 36)
+#define BRK_SUFFIX_BACK(s,e) brk_ag_char_map_back(s, e, 36)
+#define IS_SUFFIX_FMT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x041B000C)
+#define SPN_SUFFIX_FMT_CHARS(_s) spn_ag_char_map_chars(_s, 37)
+#define BRK_SUFFIX_FMT_CHARS(_s) brk_ag_char_map_chars(_s, 37)
+#define SPN_SUFFIX_FMT_BACK(s,e) spn_ag_char_map_back(s, e, 37)
+#define BRK_SUFFIX_FMT_BACK(s,e) brk_ag_char_map_back(s, e, 37)
+#define IS_FALSE_TYPE_CHAR( _c) is_ag_char_map_char((char)(_c), 0x08000002)
+#define SPN_FALSE_TYPE_CHARS(_s) spn_ag_char_map_chars(_s, 38)
+#define BRK_FALSE_TYPE_CHARS(_s) brk_ag_char_map_chars(_s, 38)
+#define SPN_FALSE_TYPE_BACK(s,e) spn_ag_char_map_back(s, e, 38)
+#define BRK_FALSE_TYPE_BACK(s,e) brk_ag_char_map_back(s, e, 38)
+#define IS_FILE_NAME_CHAR( _c) is_ag_char_map_char((char)(_c), 0x041B0004)
+#define SPN_FILE_NAME_CHARS(_s) spn_ag_char_map_chars(_s, 39)
+#define BRK_FILE_NAME_CHARS(_s) brk_ag_char_map_chars(_s, 39)
+#define SPN_FILE_NAME_BACK(s,e) spn_ag_char_map_back(s, e, 39)
+#define BRK_FILE_NAME_BACK(s,e) brk_ag_char_map_back(s, e, 39)
+#define IS_END_TOKEN_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C03)
+#define SPN_END_TOKEN_CHARS(_s) spn_ag_char_map_chars(_s, 40)
+#define BRK_END_TOKEN_CHARS(_s) brk_ag_char_map_chars(_s, 40)
+#define SPN_END_TOKEN_BACK(s,e) spn_ag_char_map_back(s, e, 40)
+#define BRK_END_TOKEN_BACK(s,e) brk_ag_char_map_back(s, e, 40)
+#define IS_END_LIST_ENTRY_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000C13)
+#define SPN_END_LIST_ENTRY_CHARS(_s) spn_ag_char_map_chars(_s, 41)
+#define BRK_END_LIST_ENTRY_CHARS(_s) brk_ag_char_map_chars(_s, 41)
+#define SPN_END_LIST_ENTRY_BACK(s,e) spn_ag_char_map_back(s, e, 41)
+#define BRK_END_LIST_ENTRY_BACK(s,e) brk_ag_char_map_back(s, e, 41)
+#define IS_SET_SEPARATOR_CHAR( _c) is_ag_char_map_char((char)(_c), 0x10000C13)
+#define SPN_SET_SEPARATOR_CHARS(_s) spn_ag_char_map_chars(_s, 42)
+#define BRK_SET_SEPARATOR_CHARS(_s) brk_ag_char_map_chars(_s, 42)
+#define SPN_SET_SEPARATOR_BACK(s,e) spn_ag_char_map_back(s, e, 42)
+#define BRK_SET_SEPARATOR_BACK(s,e) brk_ag_char_map_back(s, e, 42)
+#define IS_SIGNED_NUMBER_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00038000)
+#define SPN_SIGNED_NUMBER_CHARS(_s) spn_ag_char_map_chars(_s, 43)
+#define BRK_SIGNED_NUMBER_CHARS(_s) brk_ag_char_map_chars(_s, 43)
+#define SPN_SIGNED_NUMBER_BACK(s,e) spn_ag_char_map_back(s, e, 43)
+#define BRK_SIGNED_NUMBER_BACK(s,e) brk_ag_char_map_back(s, e, 43)
+#define IS_MAKE_SCRIPT_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000101)
+#define SPN_MAKE_SCRIPT_CHARS(_s) spn_ag_char_map_chars(_s, 44)
+#define BRK_MAKE_SCRIPT_CHARS(_s) brk_ag_char_map_chars(_s, 44)
+#define SPN_MAKE_SCRIPT_BACK(s,e) spn_ag_char_map_back(s, e, 44)
+#define BRK_MAKE_SCRIPT_BACK(s,e) brk_ag_char_map_back(s, e, 44)
+#define IS_LOAD_LINE_SKIP_CHAR( _c) is_ag_char_map_char((char)(_c), 0x00000600)
+#define SPN_LOAD_LINE_SKIP_CHARS(_s) spn_ag_char_map_chars(_s, 45)
+#define BRK_LOAD_LINE_SKIP_CHARS(_s) brk_ag_char_map_chars(_s, 45)
+#define SPN_LOAD_LINE_SKIP_BACK(s,e) spn_ag_char_map_back(s, e, 45)
+#define BRK_LOAD_LINE_SKIP_BACK(s,e) brk_ag_char_map_back(s, e, 45)
+
+static ag_char_map_mask_t const ag_char_map_table[128] = {
+ /*NUL*/ 0x00000002, /*x01*/ 0x00000000, /*x02*/ 0x00000000, /*x03*/ 0x00000000,
+ /*x04*/ 0x00000000, /*x05*/ 0x00000000, /*x06*/ 0x00000000, /*BEL*/ 0x00000000,
+ /* BS*/ 0x00000800, /* HT*/ 0x00000400, /* NL*/ 0x00000001, /* VT*/ 0x00000800,
+ /* FF*/ 0x00000800, /* CR*/ 0x00000800, /*x0E*/ 0x00000000, /*x0F*/ 0x00000000,
+ /*x10*/ 0x00000000, /*x11*/ 0x00000000, /*x12*/ 0x00000000, /*x13*/ 0x00000000,
+ /*x14*/ 0x00000000, /*x15*/ 0x00000000, /*x16*/ 0x00000000, /*x17*/ 0x00000000,
+ /*x18*/ 0x00000000, /*x19*/ 0x00000000, /*x1A*/ 0x00000000, /*ESC*/ 0x00000000,
+ /*x1C*/ 0x00000000, /*x1D*/ 0x00000000, /*x1E*/ 0x00000000, /*x1F*/ 0x00000000,
+ /* */ 0x00000400, /* ! */ 0x02804000, /* " */ 0x02005000, /* # */ 0x02004000,
+ /* $ */ 0x02804100, /* % */ 0x02804008, /* & */ 0x02804000, /* ' */ 0x02005000,
+ /* ( */ 0x02006000, /* ) */ 0x02006000, /* * */ 0x02004000, /* + */ 0x12804080,
+ /* , */ 0x02004010, /* - */ 0x06A0C200, /* . */ 0x06C04000, /* / */ 0x03804004,
+ /* 0 */ 0x08814000, /* 1 */ 0x00814000, /* 2 */ 0x00814000, /* 3 */ 0x00814000,
+ /* 4 */ 0x00814000, /* 5 */ 0x00814000, /* 6 */ 0x00814000, /* 7 */ 0x00814000,
+ /* 8 */ 0x00824000, /* 9 */ 0x00824000, /* : */ 0x02804020, /* ; */ 0x02004000,
+ /* < */ 0x02004000, /* = */ 0x02004000, /* > */ 0x03004000, /* ? */ 0x02004000,
+ /* @ */ 0x02804000, /* A */ 0x00944000, /* B */ 0x00944000, /* C */ 0x00944000,
+ /* D */ 0x00944000, /* E */ 0x00944000, /* F */ 0x08944000, /* G */ 0x00904000,
+ /* H */ 0x00904000, /* I */ 0x00904000, /* J */ 0x00904000, /* K */ 0x00904000,
+ /* L */ 0x00904000, /* M */ 0x00904000, /* N */ 0x08904000, /* O */ 0x00904000,
+ /* P */ 0x00904000, /* Q */ 0x00904000, /* R */ 0x00904000, /* S */ 0x00904000,
+ /* T */ 0x00904000, /* U */ 0x00904000, /* V */ 0x00904000, /* W */ 0x00904000,
+ /* X */ 0x00904000, /* Y */ 0x00904000, /* Z */ 0x00904000, /* [ */ 0x02404000,
+ /* \ */ 0x02004004, /* ] */ 0x02404000, /* ^ */ 0x02A04000, /* _ */ 0x04804040,
+ /* ` */ 0x02004000, /* a */ 0x008C4000, /* b */ 0x008C4000, /* c */ 0x008C4000,
+ /* d */ 0x008C4000, /* e */ 0x008C4000, /* f */ 0x088C4000, /* g */ 0x00884000,
+ /* h */ 0x00884000, /* i */ 0x00884000, /* j */ 0x00884000, /* k */ 0x00884000,
+ /* l */ 0x00884000, /* m */ 0x00884000, /* n */ 0x08884000, /* o */ 0x00884000,
+ /* p */ 0x00884000, /* q */ 0x00884000, /* r */ 0x00884000, /* s */ 0x00884000,
+ /* t */ 0x00884000, /* u */ 0x00884000, /* v */ 0x00884000, /* w */ 0x00884000,
+ /* x */ 0x00884000, /* y */ 0x00884000, /* z */ 0x00884000, /* { */ 0x02004000,
+ /* | */ 0x12804000, /* } */ 0x02004000, /* ~ */ 0x0280C000, /*x7F*/ 0x00000000
+};
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef _
+# define _(_s) _s
+#endif
+
+static unsigned char const * ag_char_map_spanners[46];
+/**
+ * Character category masks. Some categories may have multiple bits,
+ * if their definition incorporates other character categories.
+ * This mask array is only used by calc_ag_char_map_spanners().
+ */
+static ag_char_map_mask_t const ag_char_map_masks[46] = {
+ 0x00000001, /* NEWLINE */
+ 0x00000002, /* NUL_BYTE */
+ 0x00000004, /* DIR_SEP */
+ 0x00000008, /* PERCENT */
+ 0x00000010, /* COMMA */
+ 0x00000020, /* COLON */
+ 0x00000040, /* UNDERSCORE */
+ 0x00000080, /* PLUS */
+ 0x00000100, /* DOLLAR */
+ 0x00000200, /* OPTION_MARKER */
+ 0x00000400, /* HORIZ_WHITE */
+ 0x00000800, /* ALT_WHITE */
+ 0x00000C01, /* WHITESPACE */
+ 0x00000C00, /* NON_NL_WHITE */
+ 0x00001000, /* QUOTE */
+ 0x00002000, /* PARENTHESES */
+ 0x00004000, /* GRAPHIC */
+ 0x00008000, /* INVERSION */
+ 0x00010000, /* OCT_DIGIT */
+ 0x00030000, /* DEC_DIGIT */
+ 0x00070000, /* HEX_DIGIT */
+ 0x00080000, /* LOWER_CASE */
+ 0x00100000, /* UPPER_CASE */
+ 0x00180000, /* ALPHABETIC */
+ 0x001B0000, /* ALPHANUMERIC */
+ 0x00180040, /* VAR_FIRST */
+ 0x001B0040, /* VARIABLE_NAME */
+ 0x003B0040, /* OPTION_NAME */
+ 0x003B0060, /* VALUE_NAME */
+ 0x00400000, /* NAME_SEP */
+ 0x007B0460, /* COMPOUND_NAME */
+ 0x00003000, /* SCHEME_NOTE */
+ 0x00800000, /* UNQUOTABLE */
+ 0x01000C01, /* END_XML_TOKEN */
+ 0x00000C81, /* PLUS_N_SPACE */
+ 0x02000000, /* PUNCTUATION */
+ 0x041B0000, /* SUFFIX */
+ 0x041B000C, /* SUFFIX_FMT */
+ 0x08000002, /* FALSE_TYPE */
+ 0x041B0004, /* FILE_NAME */
+ 0x00000C03, /* END_TOKEN */
+ 0x00000C13, /* END_LIST_ENTRY */
+ 0x10000C13, /* SET_SEPARATOR */
+ 0x00038000, /* SIGNED_NUMBER */
+ 0x00000101, /* MAKE_SCRIPT */
+ 0x00000600, /* LOAD_LINE_SKIP */
+};
+#undef LOCK_SPANNER_TABLES
+
+static unsigned char const *
+calc_ag_char_map_spanners(unsigned int mask_ix)
+{
+#ifdef LOCK_SPANNER_TABLES
+ if (ag_char_map_spanners[mask_ix] != NULL)
+ return ag_char_map_spanners[mask_ix];
+
+ pthread_mutex_lock(&ag_char_map_mutex);
+ if (ag_char_map_spanners[mask_ix] == NULL)
+#endif
+ {
+ int ix = 1;
+ ag_char_map_mask_t mask = ag_char_map_masks[mask_ix];
+ unsigned char * res = malloc(256 /* 1 << NBBY */);
+ if (res == NULL) {
+ fputs(_("no memory for char-mapper span map\n"), stderr);
+ exit(EXIT_FAILURE);
+ }
+
+ memset(res, 0, 256);
+ for (; ix < 128; ix++)
+ if (ag_char_map_table[ix] & mask)
+ res[ix] = 1;
+ ag_char_map_spanners[mask_ix] = res;
+ }
+#ifdef LOCK_SPANNER_TABLES
+ pthread_mutex_unlock(&ag_char_map_mutex);
+#endif
+ return ag_char_map_spanners[mask_ix];
+}
+#define ag_char_map_masks POISONED_ag_char_map_masks
+
+static inline int
+is_ag_char_map_char(char ch, ag_char_map_mask_t mask)
+{
+ unsigned int ix = (unsigned char)ch;
+ return ((ix < 128) && ((ag_char_map_table[ix] & mask) != 0));
+}
+
+static inline char *
+spn_ag_char_map_chars(char const * p, unsigned int mask_ix)
+{
+ unsigned char const * v = ag_char_map_spanners[mask_ix];
+ if (v == NULL)
+ v = calc_ag_char_map_spanners(mask_ix);
+ while (v[(unsigned char)*p]) p++;
+ return (char *)(uintptr_t)p;
+}
+
+static inline char *
+brk_ag_char_map_chars(char const * p, unsigned int mask_ix)
+{
+ unsigned char const * v = ag_char_map_spanners[mask_ix];
+ if (v == NULL)
+ v = calc_ag_char_map_spanners(mask_ix);
+ while ((*p != '\0') && (! v[(unsigned char)*p])) p++;
+ return (char *)(uintptr_t)p;
+}
+
+static inline char *
+spn_ag_char_map_back(char const * s, char const * e, unsigned int mask_ix)
+{
+ unsigned char const * v = ag_char_map_spanners[mask_ix];
+ if (v == NULL)
+ v = calc_ag_char_map_spanners(mask_ix);
+ if (s >= e) e = s + strlen(s);
+ while ((e > s) && v[(unsigned char)e[-1]]) e--;
+ return (char *)(uintptr_t)e;
+}
+
+static inline char *
+brk_ag_char_map_back(char const * s, char const * e, unsigned int mask_ix)
+{
+ unsigned char const * v = ag_char_map_spanners[mask_ix];
+ if (v == NULL)
+ v = calc_ag_char_map_spanners(mask_ix);
+ if (s == e) e += strlen(e);
+ while ((e > s) && (! v[(unsigned char)e[-1]])) e--;
+ return (char *)(uintptr_t)e;
+}
+#endif /* AG_CHAR_MAP_H_GUARD */
diff --git a/sntp/libopts/alias.c b/sntp/libopts/alias.c
new file mode 100644
index 0000000..be8c6c6
--- /dev/null
+++ b/sntp/libopts/alias.c
@@ -0,0 +1,116 @@
+
+/**
+ * \file alias.c
+ *
+ * Handle options that are aliases for another option.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This routine will forward an option alias to the correct option code.
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+LOCAL tSuccess
+too_many_occurrences(tOptions * opts, tOptDesc * od)
+{
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0) {
+ char const * eqv = (od->optEquivIndex != NO_EQUIVALENT) ? zequiv : zNil;
+
+ fprintf(stderr, ztoo_often_fmt, opts->pzProgName);
+
+ if (od->optMaxCt > 1)
+ fprintf(stderr, zat_most, od->optMaxCt, od->pz_Name, eqv);
+ else
+ fprintf(stderr, zonly_one, od->pz_Name, eqv);
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+ /* NOTREACHED */
+ }
+
+ return FAILURE;
+}
+
+/*=export_func optionAlias
+ * private:
+ *
+ * what: relay an option to its alias
+ * arg: + tOptions * + opts + program options descriptor +
+ * arg: + tOptDesc * + old_od + the descriptor for this arg +
+ * arg: + unsigned int + alias + the aliased-to option index +
+ * ret-type: int
+ *
+ * doc:
+ * Handle one option as if it had been specified as another. Exactly.
+ * Returns "-1" if the aliased-to option has appeared too many times.
+=*/
+int
+optionAlias(tOptions * opts, tOptDesc * old_od, unsigned int alias)
+{
+ tOptDesc * new_od;
+
+ if (opts <= OPTPROC_EMIT_LIMIT)
+ return 0;
+
+ new_od = opts->pOptDesc + alias;
+ if ((unsigned)opts->optCt <= alias) {
+ fputs(zbad_alias_id, stderr);
+ option_exits(EXIT_FAILURE);
+ }
+
+ /*
+ * Copy over the option instance flags
+ */
+ new_od->fOptState &= OPTST_PERSISTENT_MASK;
+ new_od->fOptState |= (old_od->fOptState & ~OPTST_PERSISTENT_MASK);
+ new_od->optArg.argString = old_od->optArg.argString;
+
+ /*
+ * Keep track of count only for DEFINED (command line) options.
+ * IF we have too many, build up an error message and bail.
+ */
+ if ( (new_od->fOptState & OPTST_DEFINED)
+ && (++new_od->optOccCt > new_od->optMaxCt) )
+ return too_many_occurrences(opts, new_od);
+
+ /*
+ * Clear the state bits and counters
+ */
+ old_od->fOptState &= OPTST_PERSISTENT_MASK;
+ old_od->optOccCt = 0;
+
+ /*
+ * If there is a procedure to call, call it
+ */
+ if (new_od->pOptProc != NULL)
+ (*new_od->pOptProc)(opts, new_od);
+ return 0;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/alias.c */
diff --git a/sntp/libopts/ao-strs.c b/sntp/libopts/ao-strs.c
new file mode 100644
index 0000000..a8fac46
--- /dev/null
+++ b/sntp/libopts/ao-strs.c
@@ -0,0 +1,374 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (ao-strs.c)
+ *
+ * It has been AutoGen-ed August 8, 2014 at 04:09:03 PM by AutoGen 5.18.4pre11
+ * From the definitions ao-strs.def
+ * and the template file strings
+ *
+ * Copyright (C) 2011-2014 Bruce Korb, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the
+ * Modified (3 clause) Berkeley Software Distribution License
+ * <http://www.xfree86.org/3.3.6/COPYRIGHT2.html>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name ``Bruce Korb'' nor the name of any other
+ * contributor may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * strings IS PROVIDED BY Bruce Korb ``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 Bruce Korb OR ANY OTHER CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "ao-strs.h"
+
+char const ao_strs_strtable[6633] =
+/* 0 */ "-_^\0"
+/* 4 */ " %s%s\n\0"
+/* 12 */ "auto-options\0"
+/* 25 */ "program\0"
+/* 33 */ "%%-%ds %%s\n\0"
+/* 45 */ "\n"
+ "%s\n\n\0"
+/* 51 */ "=file\0"
+/* 57 */ "=Mbr\0"
+/* 62 */ "=Cplx\0"
+/* 68 */ "[=arg]\0"
+/* 75 */ "--%2$s%1$s\0"
+/* 86 */ "=Tim\0"
+/* 91 */ "none\0"
+/* 96 */ "# preset/initialization file\n"
+ "# %s#\n\0"
+/* 134 */ " %3s %-14s %s\0"
+/* 148 */ "%s\0"
+/* 151 */ "T/F\0"
+/* 155 */ "\n"
+ "%s\n\n"
+ "%s\0"
+/* 163 */ "Fil\0"
+/* 167 */ "KWd\0"
+/* 171 */ "Mbr\0"
+/* 175 */ "Cpx\0"
+/* 179 */ "no \0"
+/* 183 */ "Num\0"
+/* 187 */ "opt\0"
+/* 191 */ "YES\0"
+/* 195 */ "Str\0"
+/* 199 */ "Tim\0"
+/* 203 */ "\t\t\t\t- \0"
+/* 210 */ "\t\t\t\t \0"
+/* 217 */ "\t\t\t\t-- and \0"
+/* 229 */ "\t\t\t\t%s\n\0"
+/* 237 */ " \0"
+/* 244 */ " \0"
+/* 250 */ " \0"
+/* 254 */ " \0"
+/* 257 */ "all\0"
+/* 261 */ " \t\n"
+ ":=\0"
+/* 267 */ "%s_%s_%d=\0"
+/* 277 */ "''\0"
+/* 280 */ " ;;\n\n\0"
+/* 293 */ "'\n\n\0"
+/* 297 */ "</%s>\n\0"
+/* 304 */ " %s\n\0"
+/* 310 */ "%%-%ds\0"
+/* 317 */ "\n"
+ "export %s_%s_%d\n\0"
+/* 335 */ "false\0"
+/* 341 */ " -* )\n\0"
+/* 351 */ "flag\0"
+/* 356 */ "INVALID-%d\0"
+/* 367 */ "*INVALID*\0"
+/* 377 */ "\\n\\\n\0"
+/* 382 */ " --* )\n\0"
+/* 393 */ "--\0"
+/* 396 */ "LONGUSAGE\0"
+/* 406 */ " %s\n\0"
+/* 422 */ "\\%03o\0"
+/* 428 */ "more\0"
+/* 433 */ "<%s type=nested>\n\0"
+/* 451 */ "%s\n\0"
+/* 455 */ "%s\n"
+ " \0"
+/* 461 */ "OPT_ARG_NEEDED=NO\0"
+/* 479 */ "<%s/>\n\0"
+/* 486 */ "OPT_ARG_NEEDED=OK\0"
+/* 504 */ "\t\0"
+/* 506 */ "<%s>\0"
+/* 511 */ "option\0"
+/* 518 */ "\n"
+ "export %s_%s\n\0"
+/* 533 */ "%s_%s=\0"
+/* 540 */ " | \0"
+/* 544 */ "PAGER\0"
+/* 550 */ " + \0"
+/* 554 */ " puts(_(%s));\n\0"
+/* 570 */ "\\'\0"
+/* 573 */ "'%s'\0"
+/* 578 */ " -- %s\0"
+/* 585 */ "%s_%s_TEXT='\0"
+/* 598 */ "#! %s\n\0"
+/* 605 */ "\n"
+ "env | grep '^%s_'\n\0"
+/* 625 */ "=%1$lu # 0x%1$lX\n\0"
+/* 643 */ "stdout\0"
+/* 650 */ "%A %B %e, %Y at %r %Z\0"
+/* 672 */ "%s/use-%u.XXXXXX\0"
+/* 689 */ "true\0"
+/* 694 */ "<%s type=%s>\0"
+/* 707 */ "VERSION\0"
+/* 715 */ "#x%02X;\0"
+/* 723 */ "OPT_ARG_NEEDED=YES\0"
+/* 742 */ "'\\''\0"
+/* 747 */ " '%s'\0"
+/* 753 */ "\n"
+ "OPTION_CT=0\n\0"
+/* 767 */ "set --\0"
+/* 774 */ " ;;\n\n\0"
+/* 791 */ " '%c' )\n\0"
+/* 807 */ " '%s' )\n\0"
+/* 823 */ " '%s' | \\\n\0"
+/* 841 */ "TMPDIR\0"
+/* 848 */ "/tmp\0"
+/* 853 */ "%1$s %2$s ; rm -f %2$s\0"
+/* 876 */ "<%1$s type=boolean>%2$s</%1$s>\n\0"
+/* 908 */ "# From the %s option definitions\n"
+ "#\n\0"
+/* 945 */ "echo 'Warning: Cannot load options files' >&2\0"
+/* 992 */ "echo 'Warning: Cannot save options files' >&2\0"
+/* 1039 */ "echo 'Warning: Cannot suppress the loading of options files' >&2\0"
+/* 1105 */ "<%1$s type=integer>0x%2$lX</%1$s>\n\0"
+/* 1140 */ "%1$s_%2$s_TEXT='no %2$s text'\n\0"
+/* 1171 */ "%1$s_%2$s_MODE='%3$s'\n"
+ "export %1$s_%2$s_MODE\n\0"
+/* 1216 */ "%1$s_%2$s='%3$s'\n"
+ "export %1$s_%2$s\n\0"
+/* 1251 */ "%1$s_%2$s_CT=%3$d\n"
+ "export %1$s_%2$s_CT\n\0"
+/* 1290 */ "OPTION_CT=%d\n"
+ "export OPTION_CT\n\0"
+/* 1321 */ "%1$s_%2$s=%3$s\n"
+ "export %1$s_%2$s\n\0"
+/* 1354 */ "%1$s_%2$s=%3$d # 0x%3$X\n"
+ "export %1$s_%2$s\n\0"
+/* 1396 */ " case \"${OPT_CODE}\" in\n\0"
+/* 1427 */ " if [ $%1$s_%2$s_CT -gt %3$u ] ; then\n"
+ " echo 'Error: more than %3$d %2$s options'\n"
+ " echo \"$%1$s_USAGE_TEXT\"\n"
+ " exit 1\n"
+ " fi >&2\n\0"
+/* 1618 */ "test ${%1$s_%2$s_CT-0} -ge %3$u || {\n"
+ " echo %1$s_%2$s has not been set\n"
+ " exit 1\n"
+ "} 1>&2\n\0"
+/* 1710 */ "test -n \"$%1$s_%2$s\" || {\n"
+ " echo %1$s_%2$s has not been set\n"
+ " exit 1\n"
+ "} 1>&2\n\0"
+/* 1791 */ " echo \"$%s_%s_TEXT\"\n"
+ " exit 0\n\0"
+/* 1842 */ "\n"
+ "# # # # # # # # # #\n"
+ "#\n"
+ "# END OF AUTOMATED OPTION PROCESSING\n"
+ "#\n"
+ "# # # # # # # # # # -- do not modify this marker --\n\0"
+/* 1958 */ " if [ -n \"${OPT_ARG_VAL}\" ]\n"
+ " then\n"
+ " eval %1$s_${OPT_NAME}${OPT_ELEMENT}=\"'${OPT_ARG_VAL}'\"\n"
+ " export %1$s_${OPT_NAME}${OPT_ELEMENT}\n"
+ " fi\n"
+ "done\n"
+ "OPTION_COUNT=`expr $ARG_COUNT - $#`\n"
+ "OPERAND_COUNT=$#\n"
+ "unset OPT_PROCESS || :\n"
+ "unset OPT_ELEMENT || :\n"
+ "unset OPT_ARG || :\n"
+ "unset OPT_ARG_NEEDED || :\n"
+ "unset OPT_NAME || :\n"
+ "unset OPT_CODE || :\n"
+ "unset OPT_ARG_VAL || :\n\0"
+/* 2337 */ " OPT_CODE=`echo \"X${OPT_ARG}\"|sed 's/^X-*//'`\n"
+ " shift\n"
+ " OPT_ARG=$1\n"
+ " case \"${OPT_CODE}\" in *=* )\n"
+ " OPT_ARG_VAL=`echo \"${OPT_CODE}\"|sed 's/^[^=]*=//'`\n"
+ " OPT_CODE=`echo \"${OPT_CODE}\"|sed 's/=.*$//'` ;; esac\n\0"
+/* 2588 */ " OPT_CODE=`echo \"X${OPT_ARG}\" | sed 's/X-\\(.\\).*/\\1/'`\n"
+ " OPT_ARG=` echo \"X${OPT_ARG}\" | sed 's/X-.//'`\n\0"
+/* 2705 */ "\n"
+ "ARG_COUNT=$#\n"
+ "OPT_PROCESS=true\n"
+ "OPT_ARG=$1\n"
+ "while ${OPT_PROCESS} && [ $# -gt 0 ]\n"
+ "do\n"
+ " OPT_ELEMENT=''\n"
+ " OPT_ARG_VAL=''\n\n"
+ " case \"${OPT_ARG}\" in\n"
+ " -- )\n"
+ " OPT_PROCESS=false\n"
+ " shift\n"
+ " ;;\n\0"
+/* 2912 */ " case \"${OPT_ARG_NEEDED}\" in\n"
+ " NO )\n"
+ " OPT_ARG_VAL=''\n"
+ " ;;\n"
+ " YES )\n"
+ " if [ -z \"${OPT_ARG_VAL}\" ]\n"
+ " then\n"
+ " if [ $# -eq 0 ]\n"
+ " then\n"
+ " echo No argument provided for ${OPT_NAME} option\n"
+ " echo \"$%s_USAGE_TEXT\"\n"
+ " exit 1\n"
+ " fi >&2\n"
+ " OPT_ARG_VAL=${OPT_ARG}\n"
+ " shift\n"
+ " OPT_ARG=$1\n"
+ " fi\n"
+ " ;;\n"
+ " OK )\n"
+ " if [ -z \"${OPT_ARG_VAL}\" ] && [ $# -gt 0 ]\n"
+ " then\n"
+ " case \"${OPT_ARG}\" in -* ) ;; * )\n"
+ " OPT_ARG_VAL=${OPT_ARG}\n"
+ " shift\n"
+ " OPT_ARG=$1 ;; esac\n"
+ " fi\n"
+ " ;;\n"
+ " esac\n\0"
+/* 3691 */ " %1$s_%2$s_CT=`expr ${%1$s_%2$s_CT} + 1`\n"
+ " OPT_ELEMENT=\"_${%1$s_%2$s_CT}\"\n"
+ " OPT_NAME='%2$s'\n\0"
+/* 3815 */ "\n"
+ "if test -z \"${%1$s_%2$s}\"\n"
+ "then\n"
+ " %1$s_%2$s_CT=0\n"
+ " export %1$s_%2$s_CT\n"
+ "else\n"
+ " %1$s_%2$s_CT=1\n"
+ " %1$s_%2$s_1=${%1$s_%2$s}\n"
+ " export %1$s_%2$s_CT %1$s_%2$s_1\n"
+ "fi\n\0"
+/* 3973 */ " * )\n"
+ " OPT_PROCESS=false\n"
+ " ;;\n"
+ " esac\n\0"
+/* 4030 */ " %1$s_%2$s_CT=0\n"
+ " OPT_ELEMENT=''\n"
+ " %1$s_%2$s='%3$s'\n"
+ " export %1$s_%2$s\n"
+ " OPT_NAME='%2$s'\n\0"
+/* 4171 */ " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
+ " echo 'Error: duplicate %2$s option'\n"
+ " echo \"$%1$s_USAGE_TEXT\"\n"
+ " exit 1\n"
+ " fi >&2\n"
+ " %1$s_%2$s_set=true\n"
+ " %1$s_%2$s='%3$s'\n"
+ " export %1$s_%2$s\n"
+ " OPT_NAME='%2$s'\n\0"
+/* 4488 */ "\n"
+ "ARG_COUNT=$#\n"
+ "OPT_ARG=$1\n"
+ "while [ $# -gt 0 ]\n"
+ "do\n"
+ " OPT_ELEMENT=''\n"
+ " OPT_ARG_VAL=''\n"
+ " OPT_ARG=${1}\n\0"
+/* 4591 */ " case \"${OPT_ARG_NEEDED}\" in\n"
+ " NO )\n"
+ " if [ -n \"${OPT_ARG}\" ]\n"
+ " then\n"
+ " OPT_ARG=-${OPT_ARG}\n"
+ " else\n"
+ " shift\n"
+ " OPT_ARG=$1\n"
+ " fi\n"
+ " ;;\n"
+ " YES )\n"
+ " if [ -n \"${OPT_ARG}\" ]\n"
+ " then\n"
+ " OPT_ARG_VAL=${OPT_ARG}\n"
+ " else\n"
+ " if [ $# -eq 0 ]\n"
+ " then\n"
+ " echo No argument provided for ${OPT_NAME} option\n"
+ " echo \"$%s_USAGE_TEXT\"\n"
+ " exit 1\n"
+ " fi >&2\n"
+ " shift\n"
+ " OPT_ARG_VAL=$1\n"
+ " fi\n"
+ " shift\n"
+ " OPT_ARG=$1\n"
+ " ;;\n"
+ " OK )\n"
+ " if [ -n \"${OPT_ARG}\" ]\n"
+ " then\n"
+ " OPT_ARG_VAL=${OPT_ARG}\n"
+ " shift\n"
+ " OPT_ARG=$1\n"
+ " else\n"
+ " shift\n"
+ " if [ $# -gt 0 ]\n"
+ " then\n"
+ " case \"$1\" in -* ) ;; * )\n"
+ " OPT_ARG_VAL=$1\n"
+ " shift ;; esac\n"
+ " OPT_ARG=$1\n"
+ " fi\n"
+ " fi\n"
+ " ;;\n"
+ " esac\n\0"
+/* 5745 */ " echo \"$%s_LONGUSAGE_TEXT\" | ${PAGER-more}\n"
+ " exit 0\n\0"
+/* 5819 */ "%s OF %s\n"
+ "#\n"
+ "# From here to the next `-- do not modify this marker --',\n"
+ "# the text has been generated %s\n\0"
+/* 5925 */ " eval %1$s_%2$s${OPT_ELEMENT}=true\n"
+ " export %1$s_%2$s${OPT_ELEMENT}\n\0"
+/* 6015 */ " if [ -n \"${%1$s_%2$s}\" ] && ${%1$s_%2$s_set} ; then\n"
+ " echo 'Error: duplicate %2$s option'\n"
+ " echo \"$%1$s_USAGE_TEXT\"\n"
+ " exit 1\n"
+ " fi >&2\n"
+ " %1$s_%2$s_set=true\n"
+ " OPT_NAME='%2$s'\n\0"
+/* 6274 */ "\n"
+ "%1$s_%2$s=${%1$s_%2$s-'%3$s'}\n"
+ "%1$s_%2$s_set=false\n"
+ "export %1$s_%2$s\n\0"
+/* 6343 */ "\n"
+ "%1$s_%2$s=${%1$s_%2$s}\n"
+ "%1$s_%2$s_set=false\n"
+ "export %1$s_%2$s\n\0"
+/* 6405 */ "# # # # # # # # # # -- do not modify this marker --\n"
+ "#\n"
+ "# DO NOT EDIT THIS SECTION\n\0"
+/* 6488 */ " * )\n"
+ " echo Unknown %s: \"${OPT_CODE}\" >&2\n"
+ " echo \"$%s_USAGE_TEXT\" >&2\n"
+ " exit 1\n"
+ " ;;\n"
+ " esac\n";
+
+/* end of ao-strs.c */
diff --git a/sntp/libopts/ao-strs.h b/sntp/libopts/ao-strs.h
new file mode 100644
index 0000000..abe1f89
--- /dev/null
+++ b/sntp/libopts/ao-strs.h
@@ -0,0 +1,330 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (ao-strs.h)
+ *
+ * It has been AutoGen-ed August 8, 2014 at 04:09:03 PM by AutoGen 5.18.4pre11
+ * From the definitions ao-strs.def
+ * and the template file strings
+ *
+ * Copyright (C) 2011-2014 Bruce Korb, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the
+ * Modified (3 clause) Berkeley Software Distribution License
+ * <http://www.xfree86.org/3.3.6/COPYRIGHT2.html>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name ``Bruce Korb'' nor the name of any other
+ * contributor may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * strings IS PROVIDED BY Bruce Korb ``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 Bruce Korb OR ANY OTHER CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef STRINGS_AO_STRS_H_GUARD
+#define STRINGS_AO_STRS_H_GUARD 1
+/*
+ * 142 strings in ao_strs_strtable string table
+ */
+#define ARG_BREAK_STR (ao_strs_strtable+261)
+#define ARG_BREAK_STR_LEN 5
+#define ARG_BY_NUM_FMT (ao_strs_strtable+267)
+#define ARG_BY_NUM_FMT_LEN 9
+#define BOOL_ATR_FMT (ao_strs_strtable+876)
+#define BOOL_ATR_FMT_LEN 31
+#define CHK_MAX_COUNT (ao_strs_strtable+1427)
+#define CHK_MAX_COUNT_LEN 190
+#define CHK_MIN_COUNT (ao_strs_strtable+1618)
+#define CHK_MIN_COUNT_LEN 91
+#define CHK_ONE_REQUIRED (ao_strs_strtable+1710)
+#define CHK_ONE_REQUIRED_LEN 80
+#define ECHO_N_EXIT (ao_strs_strtable+1791)
+#define ECHO_N_EXIT_LEN 50
+#define EMPTY_ARG (ao_strs_strtable+277)
+#define EMPTY_ARG_LEN 2
+#define END_MARK (ao_strs_strtable+1842)
+#define END_MARK_LEN 115
+#define END_OPT_SEL_STR (ao_strs_strtable+280)
+#define END_OPT_SEL_STR_LEN 12
+#define END_PRE_FMT (ao_strs_strtable+908)
+#define END_PRE_FMT_LEN 36
+#define END_SET_TEXT (ao_strs_strtable+293)
+#define END_SET_TEXT_LEN 3
+#define END_XML_FMT (ao_strs_strtable+297)
+#define END_XML_FMT_LEN 6
+#define ENUM_ERR_LINE (ao_strs_strtable+304)
+#define ENUM_ERR_LINE_LEN 5
+#define ENUM_ERR_WIDTH (ao_strs_strtable+310)
+#define ENUM_ERR_WIDTH_LEN 6
+#define EXPORT_ARG_FMT (ao_strs_strtable+317)
+#define EXPORT_ARG_FMT_LEN 17
+#define FALSE_STR (ao_strs_strtable+335)
+#define FALSE_STR_LEN 5
+#define FINISH_LOOP (ao_strs_strtable+1958)
+#define FINISH_LOOP_LEN 378
+#define FLAG_OPT_MARK (ao_strs_strtable+341)
+#define FLAG_OPT_MARK_LEN 9
+#define FLAG_STR (ao_strs_strtable+351)
+#define FLAG_STR_LEN 4
+#define INIT_LOPT_STR (ao_strs_strtable+2337)
+#define INIT_LOPT_STR_LEN 250
+#define INIT_OPT_STR (ao_strs_strtable+2588)
+#define INIT_OPT_STR_LEN 116
+#define INVALID_FMT (ao_strs_strtable+356)
+#define INVALID_FMT_LEN 10
+#define INVALID_STR (ao_strs_strtable+367)
+#define INVALID_STR_LEN 9
+#define LINE_SPLICE (ao_strs_strtable+377)
+#define LINE_SPLICE_LEN 4
+#define LONG_OPT_MARK (ao_strs_strtable+382)
+#define LONG_OPT_MARKER (ao_strs_strtable+393)
+#define LONG_OPT_MARKER_LEN 2
+#define LONG_OPT_MARK_LEN 10
+#define LONG_USE_STR (ao_strs_strtable+396)
+#define LONG_USE_STR_LEN 9
+#define LOOP_STR (ao_strs_strtable+2705)
+#define LOOP_STR_LEN 206
+#define LOPT_ARG_FMT (ao_strs_strtable+2912)
+#define LOPT_ARG_FMT_LEN 778
+#define LVL3_CMD (ao_strs_strtable+406)
+#define LVL3_CMD_LEN 15
+#define MK_STR_OCT_FMT (ao_strs_strtable+422)
+#define MK_STR_OCT_FMT_LEN 5
+#define MORE_STR (ao_strs_strtable+428)
+#define MORE_STR_LEN 4
+#define MULTI_ARG_FMT (ao_strs_strtable+3691)
+#define MULTI_ARG_FMT_LEN 123
+#define MULTI_DEF_FMT (ao_strs_strtable+3815)
+#define MULTI_DEF_FMT_LEN 157
+#define NESTED_OPT_FMT (ao_strs_strtable+433)
+#define NESTED_OPT_FMT_LEN 17
+#define NLSTR_FMT (ao_strs_strtable+451)
+#define NLSTR_FMT_LEN 3
+#define NLSTR_SPACE_FMT (ao_strs_strtable+455)
+#define NLSTR_SPACE_FMT_LEN 5
+#define NONE_STR (ao_strs_strtable+91)
+#define NONE_STR_LEN 4
+#define NOT_FOUND_STR (ao_strs_strtable+3973)
+#define NOT_FOUND_STR_LEN 56
+#define NO_ARG_NEEDED (ao_strs_strtable+461)
+#define NO_ARG_NEEDED_LEN 17
+#define NO_LOAD_WARN (ao_strs_strtable+945)
+#define NO_LOAD_WARN_LEN 46
+#define NO_MULTI_ARG_FMT (ao_strs_strtable+4030)
+#define NO_MULTI_ARG_FMT_LEN 140
+#define NO_SAVE_OPTS (ao_strs_strtable+992)
+#define NO_SAVE_OPTS_LEN 46
+#define NO_SGL_ARG_FMT (ao_strs_strtable+4171)
+#define NO_SGL_ARG_FMT_LEN 316
+#define NO_SUPPRESS_LOAD (ao_strs_strtable+1039)
+#define NO_SUPPRESS_LOAD_LEN 65
+#define NULL_ATR_FMT (ao_strs_strtable+479)
+#define NULL_ATR_FMT_LEN 6
+#define NUMB_ATR_FMT (ao_strs_strtable+1105)
+#define NUMB_ATR_FMT_LEN 34
+#define OK_NEED_OPT_ARG (ao_strs_strtable+486)
+#define OK_NEED_OPT_ARG_LEN 17
+#define ONE_TAB_STR (ao_strs_strtable+504)
+#define ONE_TAB_STR_LEN 1
+#define ONLY_OPTS_LOOP (ao_strs_strtable+4488)
+#define ONLY_OPTS_LOOP_LEN 102
+#define OPEN_CLOSE_FMT (ao_strs_strtable+479)
+#define OPEN_CLOSE_FMT_LEN 6
+#define OPEN_XML_FMT (ao_strs_strtable+506)
+#define OPEN_XML_FMT_LEN 4
+#define OPTION_STR (ao_strs_strtable+511)
+#define OPTION_STR_LEN 6
+#define OPT_ARG_FMT (ao_strs_strtable+4591)
+#define OPT_ARG_FMT_LEN 1153
+#define OPT_END_FMT (ao_strs_strtable+518)
+#define OPT_END_FMT_LEN 14
+#define OPT_VAL_FMT (ao_strs_strtable+533)
+#define OPT_VAL_FMT_LEN 6
+#define OR_STR (ao_strs_strtable+540)
+#define OR_STR_LEN 3
+#define PAGER_NAME (ao_strs_strtable+544)
+#define PAGER_NAME_LEN 5
+#define PAGE_USAGE_FMT (ao_strs_strtable+853)
+#define PAGE_USAGE_FMT_LEN 22
+#define PAGE_USAGE_TEXT (ao_strs_strtable+5745)
+#define PAGE_USAGE_TEXT_LEN 73
+#define PLUS_STR (ao_strs_strtable+550)
+#define PLUS_STR_LEN 3
+#define PREAMBLE_FMT (ao_strs_strtable+5819)
+#define PREAMBLE_FMT_LEN 105
+#define PUTS_FMT (ao_strs_strtable+554)
+#define PUTS_FMT_LEN 15
+#define QUOT_APOS (ao_strs_strtable+570)
+#define QUOT_APOS_LEN 2
+#define QUOT_ARG_FMT (ao_strs_strtable+573)
+#define QUOT_ARG_FMT_LEN 4
+#define SET_MULTI_ARG (ao_strs_strtable+5925)
+#define SET_MULTI_ARG_LEN 89
+#define SET_NO_TEXT_FMT (ao_strs_strtable+1140)
+#define SET_NO_TEXT_FMT_LEN 30
+#define SET_OFF_FMT (ao_strs_strtable+578)
+#define SET_OFF_FMT_LEN 6
+#define SET_TEXT_FMT (ao_strs_strtable+585)
+#define SET_TEXT_FMT_LEN 12
+#define SGL_ARG_FMT (ao_strs_strtable+6015)
+#define SGL_ARG_FMT_LEN 258
+#define SGL_DEF_FMT (ao_strs_strtable+6274)
+#define SGL_DEF_FMT_LEN 68
+#define SGL_NO_DEF_FMT (ao_strs_strtable+6343)
+#define SGL_NO_DEF_FMT_LEN 61
+#define SHELL_MAGIC (ao_strs_strtable+598)
+#define SHELL_MAGIC_LEN 6
+#define SHOW_PROG_ENV (ao_strs_strtable+605)
+#define SHOW_PROG_ENV_LEN 19
+#define SHOW_VAL_FMT (ao_strs_strtable+625)
+#define SHOW_VAL_FMT_LEN 17
+#define START_MARK (ao_strs_strtable+6405)
+#define START_MARK_LEN 82
+#define STDOUT (ao_strs_strtable+643)
+#define STDOUT_LEN 6
+#define TIME_FMT (ao_strs_strtable+650)
+#define TIME_FMT_LEN 21
+#define TMPDIR (ao_strs_strtable+841)
+#define TMPDIR_LEN 6
+#define TMP_FILE_FMT (ao_strs_strtable+672)
+#define TMP_FILE_FMT_LEN 16
+#define TMP_USAGE_FMT (ao_strs_strtable+672)
+#define TMP_USAGE_FMT_LEN 16
+#define TRUE_STR (ao_strs_strtable+689)
+#define TRUE_STR_LEN 4
+#define TWO_SPACES_STR (ao_strs_strtable+254)
+#define TWO_SPACES_STR_LEN 2
+#define TYPE_ATR_FMT (ao_strs_strtable+694)
+#define TYPE_ATR_FMT_LEN 12
+#define UNK_OPT_FMT (ao_strs_strtable+6488)
+#define UNK_OPT_FMT_LEN 144
+#define VER_STR (ao_strs_strtable+707)
+#define VER_STR_LEN 7
+#define XML_HEX_BYTE_FMT (ao_strs_strtable+715)
+#define XML_HEX_BYTE_FMT_LEN 7
+#define YES_NEED_OPT_ARG (ao_strs_strtable+723)
+#define YES_NEED_OPT_ARG_LEN 18
+#define apostrophe (ao_strs_strtable+742)
+#define apostrophe_LEN 4
+#define arg_fmt (ao_strs_strtable+747)
+#define arg_fmt_LEN 5
+#define init_optct (ao_strs_strtable+753)
+#define init_optct_LEN 13
+#define set_dash (ao_strs_strtable+767)
+#define set_dash_LEN 6
+#define tmp_dir (ao_strs_strtable+848)
+#define tmp_dir_LEN 4
+#define zAll (ao_strs_strtable+257)
+#define zAll_LEN 3
+#define zCfgAO_Flags (ao_strs_strtable+12)
+#define zCfgAO_Flags_LEN 12
+#define zCfgProg (ao_strs_strtable+25)
+#define zCfgProg_LEN 7
+#define zEquivMode (ao_strs_strtable+1171)
+#define zEquivMode_LEN 44
+#define zFiveSpaces (ao_strs_strtable+244)
+#define zFiveSpaces_LEN 5
+#define zFmtFmt (ao_strs_strtable+33)
+#define zFmtFmt_LEN 11
+#define zFullOptFmt (ao_strs_strtable+1216)
+#define zFullOptFmt_LEN 34
+#define zGnuBreak (ao_strs_strtable+45)
+#define zGnuBreak_LEN 5
+#define zGnuFileArg (ao_strs_strtable+51)
+#define zGnuFileArg_LEN 5
+#define zGnuKeyLArg (ao_strs_strtable+57)
+#define zGnuKeyLArg_LEN 4
+#define zGnuNestArg (ao_strs_strtable+62)
+#define zGnuNestArg_LEN 5
+#define zGnuOptArg (ao_strs_strtable+68)
+#define zGnuOptArg_LEN 6
+#define zGnuOptFmt (ao_strs_strtable+75)
+#define zGnuOptFmt_LEN 10
+#define zGnuTimeArg (ao_strs_strtable+86)
+#define zGnuTimeArg_LEN 4
+#define zNone (ao_strs_strtable+91)
+#define zNone_LEN 4
+#define zOptCookieCt (ao_strs_strtable+1251)
+#define zOptCookieCt_LEN 38
+#define zOptCtFmt (ao_strs_strtable+1290)
+#define zOptCtFmt_LEN 30
+#define zOptDisabl (ao_strs_strtable+1321)
+#define zOptDisabl_LEN 32
+#define zOptNumFmt (ao_strs_strtable+1354)
+#define zOptNumFmt_LEN 41
+#define zOptionCase (ao_strs_strtable+1396)
+#define zOptionCase_LEN 30
+#define zOptionEndSelect (ao_strs_strtable+774)
+#define zOptionEndSelect_LEN 16
+#define zOptionFlag (ao_strs_strtable+791)
+#define zOptionFlag_LEN 15
+#define zOptionFullName (ao_strs_strtable+807)
+#define zOptionFullName_LEN 15
+#define zOptionPartName (ao_strs_strtable+823)
+#define zOptionPartName_LEN 17
+#define zPresetFile (ao_strs_strtable+96)
+#define zPresetFile_LEN 37
+#define zReqOptFmt (ao_strs_strtable+134)
+#define zReqOptFmt_LEN 13
+#define zSepChars (ao_strs_strtable+0)
+#define zSepChars_LEN 3
+#define zShrtGnuOptFmt (ao_strs_strtable+148)
+#define zShrtGnuOptFmt_LEN 2
+#define zSixSpaces (ao_strs_strtable+237)
+#define zSixSpaces_LEN 6
+#define zStdBoolArg (ao_strs_strtable+151)
+#define zStdBoolArg_LEN 3
+#define zStdBreak (ao_strs_strtable+155)
+#define zStdBreak_LEN 7
+#define zStdFileArg (ao_strs_strtable+163)
+#define zStdFileArg_LEN 3
+#define zStdKeyArg (ao_strs_strtable+167)
+#define zStdKeyArg_LEN 3
+#define zStdKeyLArg (ao_strs_strtable+171)
+#define zStdKeyLArg_LEN 3
+#define zStdNestArg (ao_strs_strtable+175)
+#define zStdNestArg_LEN 3
+#define zStdNoArg (ao_strs_strtable+179)
+#define zStdNoArg_LEN 3
+#define zStdNumArg (ao_strs_strtable+183)
+#define zStdNumArg_LEN 3
+#define zStdOptArg (ao_strs_strtable+187)
+#define zStdOptArg_LEN 3
+#define zStdReqArg (ao_strs_strtable+191)
+#define zStdReqArg_LEN 3
+#define zStdStrArg (ao_strs_strtable+195)
+#define zStdStrArg_LEN 3
+#define zStdTimeArg (ao_strs_strtable+199)
+#define zStdTimeArg_LEN 3
+#define zTabHyp (ao_strs_strtable+203)
+#define zTabHypAnd (ao_strs_strtable+217)
+#define zTabHypAnd_LEN 11
+#define zTabHyp_LEN 6
+#define zTabSpace (ao_strs_strtable+210)
+#define zTabSpace_LEN 6
+#define zTabout (ao_strs_strtable+229)
+#define zTabout_LEN 7
+#define zThreeSpaces (ao_strs_strtable+250)
+#define zThreeSpaces_LEN 3
+#define zTwoSpaces (ao_strs_strtable+254)
+#define zTwoSpaces_LEN 2
+#define zambig_file (ao_strs_strtable+4)
+#define zambig_file_LEN 7
+extern char const ao_strs_strtable[6633];
+
+#endif /* STRINGS_AO_STRS_H_GUARD */
diff --git a/sntp/libopts/autoopts.c b/sntp/libopts/autoopts.c
new file mode 100644
index 0000000..a519318
--- /dev/null
+++ b/sntp/libopts/autoopts.c
@@ -0,0 +1,397 @@
+
+/**
+ * \file autoopts.c
+ *
+ * This file contains all of the routines that must be linked into
+ * an executable to use the generated option processing. The optional
+ * routines are in separately compiled modules so that they will not
+ * necessarily be linked in.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/**
+ * The number of tab characters to skip when printing continuation lines.
+ */
+static unsigned int tab_skip_ct = 0;
+
+#ifndef HAVE_PATHFIND
+# define pathfind(_p, _n, _m) option_pathfind(_p, _n, _m)
+# include "compat/pathfind.c"
+#endif
+
+#ifndef HAVE_SNPRINTF
+# define vsnprintf option_vsnprintf
+# define snprintf option_snprintf
+# include "compat/snprintf.c"
+#endif
+
+#ifndef HAVE_STRDUP
+# define strdup(_s) option_strdup(_s)
+# include "compat/strdup.c"
+#endif
+
+#ifndef HAVE_STRCHR
+# define strrchr(_s, _c) option_strrchr(_s, _c)
+# define strchr(_s, _c) option_strchr(_s, _c)
+# include "compat/strchr.c"
+#endif
+
+LOCAL void *
+ao_malloc(size_t sz)
+{
+ void * res = malloc(sz);
+ if (res == NULL) {
+ fprintf(stderr, zalloc_fail, (int)sz);
+ option_exits(EXIT_FAILURE);
+ }
+ return res;
+}
+#undef malloc
+#define malloc(_s) ao_malloc(_s)
+
+LOCAL void *
+ao_realloc(void *p, size_t sz)
+{
+ void * res = (p == NULL) ? malloc(sz) : realloc(p, sz);
+ if (res == NULL) {
+ fprintf(stderr, zrealloc_fail, (int)sz, p);
+ option_exits(EXIT_FAILURE);
+ }
+ return res;
+}
+#undef realloc
+#define realloc(_p,_s) ao_realloc(_p,_s)
+
+LOCAL char *
+ao_strdup(char const *str)
+{
+ char * res = strdup(str);
+ if (res == NULL) {
+ fprintf(stderr, zalloc_fail, (int)strlen(str));
+ option_exits(EXIT_FAILURE);
+ }
+ return res;
+}
+#undef strdup
+#define strdup(_p) ao_strdup(_p)
+
+/**
+ * handle an option.
+ *
+ * This routine handles equivalencing, sets the option state flags and
+ * invokes the handler procedure, if any.
+ */
+LOCAL tSuccess
+handle_opt(tOptions * opts, tOptState * o_st)
+{
+ /*
+ * Save a copy of the option procedure pointer.
+ * If this is an equivalence class option, we still want this proc.
+ */
+ tOptDesc * od = o_st->pOD;
+ tOptProc * opt_proc = od->pOptProc;
+ if (od->fOptState & OPTST_ALLOC_ARG)
+ AGFREE(od->optArg.argString);
+
+ od->optArg.argString = o_st->pzOptArg;
+
+ /*
+ * IF we are presetting options, then we will ignore any un-presettable
+ * options. They are the ones either marked as such.
+ */
+ if ( ((opts->fOptSet & OPTPROC_PRESETTING) != 0)
+ && ((od->fOptState & OPTST_NO_INIT) != 0)
+ )
+ return PROBLEM;
+
+ /*
+ * IF this is an equivalence class option,
+ * THEN
+ * Save the option value that got us to this option
+ * entry. (It may not be od->optChar[0], if this is an
+ * equivalence entry.)
+ * set the pointer to the equivalence class base
+ */
+ if (od->optEquivIndex != NO_EQUIVALENT) {
+ tOptDesc * eqv_od = opts->pOptDesc + od->optEquivIndex;
+
+ /*
+ * IF the current option state has not been defined (set on the
+ * command line), THEN we will allow continued resetting of
+ * the value. Once "defined", then it must not change.
+ */
+ if ((od->fOptState & OPTST_DEFINED) != 0) {
+ /*
+ * The equivalenced-to option has been found on the command
+ * line before. Make sure new occurrences are the same type.
+ *
+ * IF this option has been previously equivalenced and
+ * it was not the same equivalenced-to option,
+ * THEN we have a usage problem.
+ */
+ if (eqv_od->optActualIndex != od->optIndex) {
+ fprintf(stderr, zmultiway_bug, eqv_od->pz_Name, od->pz_Name,
+ (opts->pOptDesc + eqv_od->optActualIndex)->pz_Name);
+ return FAILURE;
+ }
+ } else {
+ /*
+ * Set the equivalenced-to actual option index to no-equivalent
+ * so that we set all the entries below. This option may either
+ * never have been selected before, or else it was selected by
+ * some sort of "presetting" mechanism.
+ */
+ eqv_od->optActualIndex = NO_EQUIVALENT;
+ }
+
+ if (eqv_od->optActualIndex != od->optIndex) {
+ /*
+ * First time through, copy over the state
+ * and add in the equivalence flag
+ */
+ eqv_od->optActualValue = od->optValue;
+ eqv_od->optActualIndex = od->optIndex;
+ o_st->flags |= OPTST_EQUIVALENCE;
+ }
+
+ /*
+ * Copy the most recent option argument. set membership state
+ * is kept in 'eqv_od->optCookie'. Do not overwrite.
+ */
+ eqv_od->optArg.argString = od->optArg.argString;
+ od = eqv_od;
+
+ } else {
+ od->optActualValue = od->optValue;
+ od->optActualIndex = od->optIndex;
+ }
+
+ od->fOptState &= OPTST_PERSISTENT_MASK;
+ od->fOptState |= (o_st->flags & ~OPTST_PERSISTENT_MASK);
+
+ /*
+ * Keep track of count only for DEFINED (command line) options.
+ * IF we have too many, build up an error message and bail.
+ */
+ if ( (od->fOptState & OPTST_DEFINED)
+ && (++od->optOccCt > od->optMaxCt) )
+ return too_many_occurrences(opts, od);
+ /*
+ * If provided a procedure to call, call it
+ */
+ if (opt_proc != NULL)
+ (*opt_proc)(opts, od);
+
+ return SUCCESS;
+}
+
+/**
+ * Find the option descriptor and option argument (if any) for the
+ * next command line argument. DO NOT modify the descriptor. Put
+ * all the state in the state argument so that the option can be skipped
+ * without consequence (side effect).
+ *
+ * @param opts the program option descriptor
+ * @param o_st the state of the next found option
+ */
+LOCAL tSuccess
+next_opt(tOptions * opts, tOptState * o_st)
+{
+ {
+ tSuccess res = find_opt(opts, o_st);
+ if (! SUCCESSFUL(res))
+ return res;
+ }
+
+ if ( ((o_st->flags & OPTST_DEFINED) != 0)
+ && ((o_st->pOD->fOptState & OPTST_NO_COMMAND) != 0)) {
+ fprintf(stderr, zNotCmdOpt, o_st->pOD->pz_Name);
+ return FAILURE;
+ }
+
+ return get_opt_arg(opts, o_st);
+}
+
+/**
+ * Process all the options from our current position onward. (This allows
+ * interspersed options and arguments for the few non-standard programs that
+ * require it.) Thus, do not rewind option indexes because some programs
+ * choose to re-invoke after a non-option.
+ *
+ * @param[in,out] opts program options descriptor
+ * @returns SUCCESS or FAILURE
+ */
+LOCAL tSuccess
+regular_opts(tOptions * opts)
+{
+ /* assert: opts->fOptSet & OPTPROC_IMMEDIATE == 0 */
+ for (;;) {
+ tOptState opt_st = OPTSTATE_INITIALIZER(DEFINED);
+
+ switch (next_opt(opts, &opt_st)) {
+ case FAILURE: goto failed_option;
+ case PROBLEM: return SUCCESS; /* no more args */
+ case SUCCESS: break;
+ }
+
+ /*
+ * IF this is an immediate action option,
+ * THEN skip it (unless we are supposed to do it a second time).
+ */
+ if (! DO_NORMALLY(opt_st.flags)) {
+ if (! DO_SECOND_TIME(opt_st.flags))
+ continue;
+ opt_st.pOD->optOccCt--; /* don't count this repetition */
+ }
+
+ if (! SUCCESSFUL(handle_opt(opts, &opt_st)))
+ break;
+ } failed_option:;
+
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0)
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+
+ return FAILURE;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * THESE ROUTINES ARE CALLABLE FROM THE GENERATED OPTION PROCESSING CODE
+ */
+/*=--subblock=arg=arg_type,arg_name,arg_desc =*/
+/*=*
+ * library: opts
+ * header: your-opts.h
+ *
+ * lib_description:
+ *
+ * These are the routines that libopts users may call directly from their
+ * code. There are several other routines that can be called by code
+ * generated by the libopts option templates, but they are not to be
+ * called from any other user code. The @file{options.h} header is
+ * fairly clear about this, too.
+=*/
+
+/*=export_func optionProcess
+ *
+ * what: this is the main option processing routine
+ *
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + int + a_ct + program arg count +
+ * arg: + char** + a_v + program arg vector +
+ *
+ * ret_type: int
+ * ret_desc: the count of the arguments processed
+ *
+ * doc:
+ *
+ * This is the main entry point for processing options. It is intended
+ * that this procedure be called once at the beginning of the execution of
+ * a program. Depending on options selected earlier, it is sometimes
+ * necessary to stop and restart option processing, or to select completely
+ * different sets of options. This can be done easily, but you generally
+ * do not want to do this.
+ *
+ * The number of arguments processed always includes the program name.
+ * If one of the arguments is "--", then it is counted and the processing
+ * stops. If an error was encountered and errors are to be tolerated, then
+ * the returned value is the index of the argument causing the error.
+ * A hyphen by itself ("-") will also cause processing to stop and will
+ * @emph{not} be counted among the processed arguments. A hyphen by itself
+ * is treated as an operand. Encountering an operand stops option
+ * processing.
+ *
+ * err: Errors will cause diagnostics to be printed. @code{exit(3)} may
+ * or may not be called. It depends upon whether or not the options
+ * were generated with the "allow-errors" attribute, or if the
+ * ERRSKIP_OPTERR or ERRSTOP_OPTERR macros were invoked.
+=*/
+int
+optionProcess(tOptions * opts, int a_ct, char ** a_v)
+{
+ if (! SUCCESSFUL(validate_struct(opts, a_v[0])))
+ ao_bug(zbad_data_msg);
+
+ /*
+ * Establish the real program name, the program full path,
+ * and do all the presetting the first time thru only.
+ */
+ if (! ao_initialize(opts, a_ct, a_v))
+ return 0;
+
+ /*
+ * IF we are (re)starting,
+ * THEN reset option location
+ */
+ if (opts->curOptIdx <= 0) {
+ opts->curOptIdx = 1;
+ opts->pzCurOpt = NULL;
+ }
+
+ if (! SUCCESSFUL(regular_opts(opts)))
+ return (int)opts->origArgCt;
+
+ /*
+ * IF there were no errors
+ * AND we have RC/INI files
+ * AND there is a request to save the files
+ * THEN do that now before testing for conflicts.
+ * (conflicts are ignored in preset options)
+ */
+ switch (opts->specOptIdx.save_opts) {
+ case 0:
+ case NO_EQUIVALENT:
+ break;
+ default:
+ {
+ tOptDesc * od = opts->pOptDesc + opts->specOptIdx.save_opts;
+
+ if (SELECTED_OPT(od)) {
+ optionSaveFile(opts);
+ option_exits(EXIT_SUCCESS);
+ }
+ }
+ }
+
+ /*
+ * IF we are checking for errors,
+ * THEN look for too few occurrences of required options
+ */
+ if (((opts->fOptSet & OPTPROC_ERRSTOP) != 0)
+ && (! is_consistent(opts)))
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+
+ return (int)opts->curOptIdx;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/autoopts.c */
diff --git a/sntp/libopts/autoopts.h b/sntp/libopts/autoopts.h
new file mode 100644
index 0000000..ac0a199
--- /dev/null
+++ b/sntp/libopts/autoopts.h
@@ -0,0 +1,484 @@
+
+/*
+ * \file autoopts.h
+ *
+ * This file defines all the global structures and special values
+ * used in the automated option processing library.
+ *
+ * @group autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+#ifndef AUTOGEN_AUTOOPTS_H
+#define AUTOGEN_AUTOOPTS_H
+#include <stdnoreturn.h>
+
+#define AO_NAME_LIMIT 127
+#define AO_NAME_SIZE ((size_t)(AO_NAME_LIMIT + 1))
+
+#ifndef AG_PATH_MAX
+# ifdef PATH_MAX
+# define AG_PATH_MAX ((size_t)PATH_MAX)
+# else
+# define AG_PATH_MAX ((size_t)4096)
+# endif
+#else
+# if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN)
+# undef AG_PATH_MAX
+# define AG_PATH_MAX ((size_t)PATH_MAX)
+# endif
+#endif
+
+#undef EXPORT
+#define EXPORT
+
+#ifndef NUL
+#define NUL '\0'
+#endif
+#define BEL '\a'
+#define BS '\b'
+#define HT '\t'
+#define LF '\n'
+#define VT '\v'
+#define FF '\f'
+#define CR '\r'
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# define DIRCH '\\'
+#else
+# define DIRCH '/'
+#endif
+
+#ifndef EX_USAGE
+ /**
+ * Command line usage problem
+ */
+# define EX_USAGE 64
+#endif
+#ifndef EX_DATAERR
+ /**
+ * The input data was incorrect in some way.
+ */
+# define EX_DATAERR 64
+#endif
+#ifndef EX_NOINPUT
+ /**
+ * option state was requested from a file that cannot be loaded.
+ */
+# define EX_NOINPUT 66
+#endif
+#ifndef EX_SOFTWARE
+ /**
+ * AutoOpts Software failure.
+ */
+# define EX_SOFTWARE 70
+#endif
+#ifndef EX_OSERR
+ /**
+ * Command line usage problem
+ */
+# define EX_OSERR 71
+#endif
+
+#define NL '\n'
+#ifndef C
+/**
+ * Coercive cast. Compel an address to be interpreted as the type
+ * of the first argument. No complaints, just do it.
+ */
+#define C(_t,_p) ((_t)(void *)(_p))
+#endif
+
+/* The __attribute__((__warn_unused_result__)) feature
+ is available in gcc versions 3.4 and newer,
+ while the typeof feature has been available since 2.7 at least. */
+# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
+# define ignore_val(x) ((void) (x))
+# else
+# define ignore_val(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
+# endif
+
+/*
+ * Convert the number to a list usable in a printf call
+ */
+#define NUM_TO_VER(n) ((n) >> 12), ((n) >> 7) & 0x001F, (n) & 0x007F
+
+#define NAMED_OPTS(po) \
+ (((po)->fOptSet & (OPTPROC_SHORTOPT | OPTPROC_LONGOPT)) == 0)
+
+#define SKIP_OPT(p) (((p)->fOptState & OPTST_IMMUTABLE_MASK) != 0)
+
+typedef int tDirection;
+/**
+ * handling option presets. Start with command line and work through
+ * config settings in reverse order.
+ */
+#define DIRECTION_PRESET -1
+/**
+ * handling normal options. Start with first config file, then environment
+ * variables and finally the command line.
+ */
+#define DIRECTION_PROCESS 1
+/**
+ * An initialzation phase or an option being loaded from program sources.
+ */
+#define DIRECTION_CALLED 0
+
+#define PROCESSING(d) ((d)>0)
+#define PRESETTING(d) ((d)<0)
+#define CALLED(d) ((d)==0)
+
+/**
+ * When loading a line (or block) of text as an option, the value can
+ * be processed in any of several modes.
+ */
+typedef enum {
+ /**
+ * If the value looks like a quoted string, then process it. Double
+ * quoted strings are processed the way strings are in "C" programs,
+ * except they are treated as regular characters if the following
+ * character is not a well-established escape sequence. Single quoted
+ * strings (quoted with apostrophies) are handled the way strings are
+ * handled in shell scripts, *except* that backslash escapes are
+ * honored before backslash escapes and apostrophies.
+ */
+ OPTION_LOAD_COOKED,
+
+ /**
+ * Even if the value begins with quote characters, do not do quote
+ * processing. Strip leading and trailing white space.
+ */
+ OPTION_LOAD_UNCOOKED,
+
+ /**
+ * Keep every part of the value between the delimiters.
+ */
+ OPTION_LOAD_KEEP
+} tOptionLoadMode;
+
+static tOptionLoadMode option_load_mode;
+
+/**
+ * The pager state is used by optionPagedUsage() procedure.
+ * When it runs, it sets itself up to be called again on exit.
+ * If, however, a routine needs a child process to do some work
+ * before it is done, then 'pagerState' must be set to
+ * 'PAGER_STATE_CHILD' so that optionPagedUsage() will not try
+ * to run the pager program before its time.
+ */
+typedef enum {
+ PAGER_STATE_INITIAL, //@< initial option paging state
+
+ /**
+ * temp file created and optionPagedUsage is scheduled to run at exit
+ */
+ PAGER_STATE_READY,
+
+ /**
+ * This is a child process used in creating shell script usage.
+ */
+ PAGER_STATE_CHILD
+} tePagerState;
+
+typedef enum {
+ ENV_ALL,
+ ENV_IMM,
+ ENV_NON_IMM
+} teEnvPresetType;
+
+typedef enum {
+ TOPT_UNDEFINED = 0,
+ TOPT_SHORT,
+ TOPT_LONG,
+ TOPT_DEFAULT
+} teOptType;
+
+typedef struct {
+ tOptDesc * pOD;
+ char const * pzOptArg;
+ opt_state_mask_t flags;
+ teOptType optType;
+} tOptState;
+#define OPTSTATE_INITIALIZER(st) \
+ { NULL, NULL, OPTST_ ## st, TOPT_UNDEFINED }
+
+#define TEXTTO_TABLE \
+ _TT_(LONGUSAGE) \
+ _TT_(USAGE) \
+ _TT_(VERSION)
+#define _TT_(n) \
+ TT_ ## n ,
+
+typedef enum { TEXTTO_TABLE COUNT_TT } teTextTo;
+
+#undef _TT_
+
+/**
+ * option argument types. Used to create usage information for
+ * particular options.
+ */
+typedef struct {
+ char const * pzStr;
+ char const * pzReq;
+ char const * pzNum;
+ char const * pzFile;
+ char const * pzKey;
+ char const * pzKeyL;
+ char const * pzBool;
+ char const * pzNest;
+ char const * pzOpt;
+ char const * pzNo;
+ char const * pzBrk;
+ char const * pzNoF;
+ char const * pzSpc;
+ char const * pzOptFmt;
+ char const * pzTime;
+} arg_types_t;
+
+#define AGALOC(c, w) ao_malloc((size_t)c)
+#define AGREALOC(p, c, w) ao_realloc((void*)p, (size_t)c)
+#define AGFREE(_p) free((void *)_p)
+#define AGDUPSTR(p, s, w) (p = ao_strdup(s))
+
+static void *
+ao_malloc(size_t sz);
+
+static void *
+ao_realloc(void *p, size_t sz);
+
+#define ao_free(_p) free((void *)_p)
+
+static char *
+ao_strdup(char const *str);
+
+/**
+ * DO option handling?
+ *
+ * Options are examined at two times: at immediate handling time and at
+ * normal handling time. If an option is disabled, the timing may be
+ * different from the handling of the undisabled option. The OPTST_DIABLED
+ * bit indicates the state of the currently discovered option.
+ * So, here's how it works:
+ *
+ * A) handling at "immediate" time, either 1 or 2:
+ *
+ * 1. OPTST_DISABLED is not set:
+ * IMM must be set
+ * DISABLE_IMM don't care
+ * TWICE don't care
+ * DISABLE_TWICE don't care
+ * 0 -and- 1 x x x
+ *
+ * 2. OPTST_DISABLED is set:
+ * IMM don't care
+ * DISABLE_IMM must be set
+ * TWICE don't care
+ * DISABLE_TWICE don't care
+ * 1 -and- x 1 x x
+ */
+#define DO_IMMEDIATELY(_flg) \
+ ( (((_flg) & (OPTST_DISABLED|OPTST_IMM)) == OPTST_IMM) \
+ || ( ((_flg) & (OPTST_DISABLED|OPTST_DISABLE_IMM)) \
+ == (OPTST_DISABLED|OPTST_DISABLE_IMM) ))
+
+/**
+ * B) handling at "regular" time because it was not immediate
+ *
+ * 1. OPTST_DISABLED is not set:
+ * IMM must *NOT* be set
+ * DISABLE_IMM don't care
+ * TWICE don't care
+ * DISABLE_TWICE don't care
+ * 0 -and- 0 x x x
+ *
+ * 2. OPTST_DISABLED is set:
+ * IMM don't care
+ * DISABLE_IMM don't care
+ * TWICE must be set
+ * DISABLE_TWICE don't care
+ * 1 -and- x x 1 x
+ */
+#define DO_NORMALLY(_flg) ( \
+ (((_flg) & (OPTST_DISABLED|OPTST_IMM)) == 0) \
+ || (((_flg) & (OPTST_DISABLED|OPTST_DISABLE_IMM)) == \
+ OPTST_DISABLED) )
+
+/**
+ * C) handling at "regular" time because it is to be handled twice.
+ * The immediate bit was already tested and found to be set:
+ *
+ * 3. OPTST_DISABLED is not set:
+ * IMM is set (but don't care)
+ * DISABLE_IMM don't care
+ * TWICE must be set
+ * DISABLE_TWICE don't care
+ * 0 -and- ? x 1 x
+ *
+ * 4. OPTST_DISABLED is set:
+ * IMM don't care
+ * DISABLE_IMM is set (but don't care)
+ * TWICE don't care
+ * DISABLE_TWICE must be set
+ * 1 -and- x ? x 1
+ */
+#define DO_SECOND_TIME(_flg) ( \
+ (((_flg) & (OPTST_DISABLED|OPTST_TWICE)) == \
+ OPTST_TWICE) \
+ || (((_flg) & (OPTST_DISABLED|OPTST_DISABLE_TWICE)) == \
+ (OPTST_DISABLED|OPTST_DISABLE_TWICE) ))
+
+/*
+ * text_mmap structure. Only active on platforms with mmap(2).
+ */
+#ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+#else
+# ifndef PROT_READ
+# define PROT_READ 0x01
+# endif
+# ifndef PROT_WRITE
+# define PROT_WRITE 0x02
+# endif
+# ifndef MAP_SHARED
+# define MAP_SHARED 0x01
+# endif
+# ifndef MAP_PRIVATE
+# define MAP_PRIVATE 0x02
+# endif
+#endif
+
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void*)-1)
+#endif
+
+#ifndef _SC_PAGESIZE
+# ifdef _SC_PAGE_SIZE
+# define _SC_PAGESIZE _SC_PAGE_SIZE
+# endif
+#endif
+
+#ifndef HAVE_STRCHR
+extern char* strchr(char const *s, int c);
+extern char* strrchr(char const *s, int c);
+#endif
+
+/**
+ * INQUERY_CALL() tests whether the option handling function has been
+ * called by an inquery (help text needed, or option being reset),
+ * or called by a set-the-option operation.
+ */
+#define INQUERY_CALL(_o, _d) ( \
+ ((_o) <= OPTPROC_EMIT_LIMIT) \
+ || ((_d) == NULL) \
+ || (((_d)->fOptState & OPTST_RESET) != 0) )
+
+/**
+ * Define and initialize all the user visible strings.
+ * We do not do translations. If translations are to be done, then
+ * the client will provide a callback for that purpose.
+ */
+#undef DO_TRANSLATIONS
+#include "autoopts/usage-txt.h"
+
+/**
+ * File pointer for usage output
+ */
+FILE * option_usage_fp;
+/**
+ * If provided in the option structure
+ */
+static char const * program_pkgdatadir;
+/**
+ * privately exported functions
+ */
+extern tOptProc optionPrintVersion, optionPagedUsage, optionLoadOpt;
+
+#ifdef AUTOOPTS_INTERNAL
+
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+#define APOSTROPHE '\''
+
+#define OPTPROC_L_N_S (OPTPROC_LONGOPT | OPTPROC_SHORTOPT)
+#if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H)
+# include <libintl.h>
+#endif
+
+typedef struct {
+ size_t fnm_len;
+ uint32_t fnm_mask;
+ char const * fnm_name;
+} ao_flag_names_t;
+
+/**
+ * Automated Options Usage Flags.
+ * NB: no entry may be a prefix of another entry
+ */
+#define AOFLAG_TABLE \
+ _aof_(gnu, OPTPROC_GNUUSAGE ) \
+ _aof_(autoopts, ~OPTPROC_GNUUSAGE) \
+ _aof_(no_misuse_usage, OPTPROC_MISUSE ) \
+ _aof_(misuse_usage, ~OPTPROC_MISUSE ) \
+ _aof_(compute, OPTPROC_COMPUTE )
+
+#define _aof_(_n, _f) AOUF_ ## _n ## _ID,
+typedef enum { AOFLAG_TABLE AOUF_COUNT } ao_flag_id_t;
+#undef _aof_
+
+#define _aof_(_n, _f) AOUF_ ## _n = (1 << AOUF_ ## _n ## _ID),
+typedef enum { AOFLAG_TABLE } ao_flags_t;
+#undef _aof_
+
+static char const zNil[] = "";
+static arg_types_t argTypes = { NULL };
+static char line_fmt_buf[32];
+static bool displayEnum = false;
+static char const pkgdatadir_default[] = PKGDATADIR;
+static char const * program_pkgdatadir = pkgdatadir_default;
+static tOptionLoadMode option_load_mode = OPTION_LOAD_UNCOOKED;
+static tePagerState pagerState = PAGER_STATE_INITIAL;
+
+ FILE * option_usage_fp = NULL;
+
+static char const * pz_enum_err_fmt;
+
+tOptions * optionParseShellOptions = NULL;
+
+static char const * shell_prog = NULL;
+static char * script_leader = NULL;
+static char * script_trailer = NULL;
+static char * script_text = NULL;
+static bool print_exit = false;
+#endif /* AUTOOPTS_INTERNAL */
+
+#endif /* AUTOGEN_AUTOOPTS_H */
+/**
+ * @}
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/autoopts.h */
diff --git a/sntp/libopts/autoopts/options.h b/sntp/libopts/autoopts/options.h
new file mode 100644
index 0000000..0d6f2c3
--- /dev/null
+++ b/sntp/libopts/autoopts/options.h
@@ -0,0 +1,1253 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (options.h)
+ *
+ * It has been AutoGen-ed August 3, 2014 at 10:44:46 AM by AutoGen 5.18.4pre11
+ * From the definitions funcs.def
+ * and the template file options_h
+ *
+ * This file defines all the global structures and special values
+ * used in the automated option processing library.
+ *
+ * Automated Options Copyright (C) 1992-2014 by Bruce Korb
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+#ifndef AUTOOPTS_OPTIONS_H_GUARD
+#define AUTOOPTS_OPTIONS_H_GUARD 1
+/** \file options.h
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+#include <sys/types.h>
+#include <stdio.h>
+
+#ifndef COMPAT_H_GUARD
+/*
+ * This is needed for test compilations where the "compat.h"
+ * header is not usually available.
+ */
+# if defined(HAVE_STDINT_H)
+# include <stdint.h>
+# elif defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+# endif /* HAVE_STDINT/INTTYPES_H */
+
+# if defined(HAVE_LIMITS_H)
+# include <limits.h>
+# elif defined(HAVE_SYS_LIMITS_H)
+# include <sys/limits.h>
+# endif /* HAVE_LIMITS/SYS_LIMITS_H */
+
+# if defined(HAVE_SYSEXITS_H)
+# include <sysexits.h>
+# endif /* HAVE_SYSEXITS_H */
+
+# if defined(HAVE_STDBOOL_H)
+# include <stdbool.h>
+# else
+ typedef enum { false = 0, true = 1 } _Bool;
+# define bool _Bool
+
+ /* The other macros must be usable in preprocessor directives. */
+# define false 0
+# define true 1
+# endif /* HAVE_SYSEXITS_H */
+#endif /* COMPAT_H_GUARD */
+// END-CONFIGURED-HEADERS
+
+/**
+ * Defined to abnormal value of EX_USAGE. Used to indicate that paged usage
+ * was requested. It is used to distinguish a --usage from a --help request.
+ * --usage is abbreviated and --help gives as much help as possible.
+ */
+#define AO_EXIT_REQ_USAGE 10064
+
+/**
+ * PUBLIC DEFINES
+ *
+ * The following defines may be used in applications that need to test the
+ * state of an option. To test against these masks and values, a pointer
+ * to an option descriptor must be obtained. There are two ways:
+ *
+ * 1. inside an option processing procedure, it is the second argument,
+ * conventionally "tOptDesc* pOD".
+ *
+ * 2. Outside of an option procedure (or to reference a different option
+ * descriptor), use either "&DESC( opt_name )" or "&pfx_DESC( opt_name )".
+ *
+ * See the relevant generated header file to determine which and what
+ * values for "opt_name" are available.
+ * @group version
+ * @{
+ */
+/// autoopts structure version
+#define OPTIONS_STRUCT_VERSION 167936
+/// autoopts structure version string
+#define OPTIONS_VERSION_STRING "41:0:16"
+/// minimum version the autoopts library supports
+#define OPTIONS_MINIMUM_VERSION 102400
+/// minimum version the autoopts library supports as a string
+#define OPTIONS_MIN_VER_STRING "25:0:0"
+/// the display version of the autoopts library, as a string
+#define OPTIONS_DOTTED_VERSION "41.0"
+/// convert a version/release number pair to an integer value
+#define OPTIONS_VER_TO_NUM(_v, _r) (((_v) * 4096) + (_r))
+/// @}
+
+/**
+ * Option argument types. This must fit in the OPTST_ARG_TYPE_MASK
+ * field of the fOptState field of an option descriptor (tOptDesc).
+ * It will be a problem to extend beyond 4 bits.
+ */
+typedef enum {
+ OPARG_TYPE_NONE = 0, ///< does not take an argument
+ OPARG_TYPE_STRING = 1, ///< default type/ vanilla string
+ OPARG_TYPE_ENUMERATION = 2, ///< opt arg is an enum (keyword list)
+ OPARG_TYPE_BOOLEAN = 3, ///< opt arg is boolean-valued
+ OPARG_TYPE_MEMBERSHIP = 4, ///< opt arg sets set membership bits
+ OPARG_TYPE_NUMERIC = 5, ///< opt arg is a long int
+ OPARG_TYPE_HIERARCHY = 6, ///< option arg is hierarchical value
+ OPARG_TYPE_FILE = 7, ///< option arg names a file
+ OPARG_TYPE_TIME = 8, ///< opt arg is a time duration
+ OPARG_TYPE_FLOAT = 9, ///< opt arg is a floating point num
+ OPARG_TYPE_DOUBLE = 10, ///< opt arg is a double prec. float
+ OPARG_TYPE_LONG_DOUBLE = 11, ///< opt arg is a long double prec.
+ OPARG_TYPE_LONG_LONG = 12 ///< opt arg is a long long int
+} teOptArgType;
+
+/**
+ * value descriptor for sub options
+ */
+typedef struct optionValue {
+ teOptArgType valType; ///< which argument type
+ char * pzName; ///< name of the sub-option
+ union {
+ char strVal[1]; ///< OPARG_TYPE_STRING
+ unsigned int enumVal; ///< OPARG_TYPE_ENUMERATION
+ unsigned int boolVal; ///< OPARG_TYPE_BOOLEAN
+ unsigned long setVal; ///< OPARG_TYPE_MEMBERSHIP
+ long longVal; ///< OPARG_TYPE_NUMERIC
+ void* nestVal; ///< OPARG_TYPE_HIERARCHY
+ } v;
+} tOptionValue;
+
+/**
+ * file argument state and handling.
+ */
+typedef enum {
+ FTYPE_MODE_MAY_EXIST = 0x00, ///< may or may not exist
+ FTYPE_MODE_MUST_EXIST = 0x01, ///< must pre-exist
+ FTYPE_MODE_MUST_NOT_EXIST = 0x02, ///< must *not* pre-exist
+ FTYPE_MODE_EXIST_MASK = 0x03, ///< mask for these bits
+ FTYPE_MODE_NO_OPEN = 0x00, ///< leave file closed
+ FTYPE_MODE_OPEN_FD = 0x10, ///< call open(2)
+ FTYPE_MODE_FOPEN_FP = 0x20, ///< call fopen(3)
+ FTYPE_MODE_OPEN_MASK = 0x30 ///< open/fopen/not open
+} teOptFileType;
+
+/**
+ * the open flag bits or the mode string, depending on the open type.
+ */
+typedef union {
+ int file_flags; ///< open(2) flag bits
+ char const * file_mode; ///< fopen(3) mode string
+} tuFileMode;
+
+/// initial number of option argument holders to allocate
+#define MIN_ARG_ALLOC_CT 6
+/// amount by which to increment the argument holder allocation.
+#define INCR_ARG_ALLOC_CT 8
+/**
+ * an argument list. When an option appears multiple times and
+ * the values get "stacked". \a apzArgs holds 8 pointers initially
+ * and is incremented by \a INCR_ARG_ALLOC_CT as needed.
+ */
+typedef struct {
+ int useCt; ///< elements in use
+
+ /// allocated elements, mininum \a MIN_ARG_ALLOC_CT
+ /// steps by \a INCR_ARG_ALLOC_CT
+ int allocCt;
+ char const * apzArgs[MIN_ARG_ALLOC_CT]; ///< element array
+} tArgList;
+
+/**
+ * Bits in the fOptState option descriptor field.
+ * @{
+ */
+
+/** integral type for holding opt_state masks */
+typedef uint32_t opt_state_mask_t;
+
+#define OPTST_ARG_TYPE_SHIFT 12
+/** bits defined for opt_state_mask_t */
+/** Set via the "SET_OPT()" macro */
+#define OPTST_SET 0x0000001U
+/** Set via an RC/INI file */
+#define OPTST_PRESET 0x0000002U
+/** Set via a command line option */
+#define OPTST_DEFINED 0x0000004U
+/** Reset via command line option */
+#define OPTST_RESET 0x0000008U
+/** selected by equiv'ed option */
+#define OPTST_EQUIVALENCE 0x0000010U
+/** option is in disabled state */
+#define OPTST_DISABLED 0x0000020U
+/** pzOptArg was allocated */
+#define OPTST_ALLOC_ARG 0x0000040U
+/** option cannot be preset */
+#define OPTST_NO_INIT 0x0000100U
+/** opt value (flag) is any digit */
+#define OPTST_NUMBER_OPT 0x0000200U
+/** opt uses optionStackArg proc */
+#define OPTST_STACKED 0x0000400U
+/** option defaults to enabled */
+#define OPTST_INITENABLED 0x0000800U
+/** bit 1 of arg type enum */
+#define OPTST_ARG_TYPE_1 0x0001000U
+/** bit 2 of arg type enum */
+#define OPTST_ARG_TYPE_2 0x0002000U
+/** bit 3 of arg type enum */
+#define OPTST_ARG_TYPE_3 0x0004000U
+/** bit 4 of arg type enum */
+#define OPTST_ARG_TYPE_4 0x0008000U
+/** the option arg not required */
+#define OPTST_ARG_OPTIONAL 0x0010000U
+/** process opt on first pass */
+#define OPTST_IMM 0x0020000U
+/** process disablement immed. */
+#define OPTST_DISABLE_IMM 0x0040000U
+/** compiled out of program */
+#define OPTST_OMITTED 0x0080000U
+/** must be set or pre-set */
+#define OPTST_MUST_SET 0x0100000U
+/** opt is for doc only */
+#define OPTST_DOCUMENT 0x0200000U
+/** process opt twice - imm + reg */
+#define OPTST_TWICE 0x0400000U
+/** process disabled option twice */
+#define OPTST_DISABLE_TWICE 0x0800000U
+/** scaled integer value */
+#define OPTST_SCALED_NUM 0x1000000U
+/** disable from cmd line */
+#define OPTST_NO_COMMAND 0x2000000U
+/** support is being removed */
+#define OPTST_DEPRECATED 0x4000000U
+/** alias for other option */
+#define OPTST_ALIAS 0x8000000U
+
+/** bits in SET mask:
+ * set preset reset defined */
+#define OPTST_SET_MASK 0x000000FU
+
+/** bits in MUTABLE mask:
+ * set preset reset defined equivalence disabled
+ * alloc_arg */
+#define OPTST_MUTABLE_MASK 0x000007FU
+
+/** bits omitted from PERSISTENT mask:
+ * mutable_mask */
+#define OPTST_PERSISTENT_MASK 0xFFFFF00U
+
+/** bits in SELECTED mask:
+ * set defined */
+#define OPTST_SELECTED_MASK 0x0000005U
+
+/** bits in ARG_TYPE mask:
+ * arg_type_1 arg_type_2 arg_type_3 arg_type_4 */
+#define OPTST_ARG_TYPE_MASK 0x000F000U
+
+/** bits in NO_USAGE mask:
+ * omitted no_command deprecated */
+#define OPTST_NO_USAGE_MASK 0x6080000U
+
+/** bits in IMMUTABLE mask:
+ * document omitted */
+#define OPTST_IMMUTABLE_MASK 0x0280000U
+
+/** bits in DO_NOT_SAVE mask:
+ * document omitted no_init */
+#define OPTST_DO_NOT_SAVE_MASK 0x0280100U
+
+/** bits in NO_OUTPUT mask:
+ * document omitted alias */
+#define OPTST_NO_OUTPUT_MASK 0x8280000U
+
+/** all bits in opt_state_mask_t masks */
+#define OPTST_MASK_ALL 0xFFFFF7FU
+
+/** no bits in opt_state_mask_t */
+#define OPTST_INIT 0x0000000U
+/** @} */
+
+#ifdef NO_OPTIONAL_OPT_ARGS
+# undef OPTST_ARG_OPTIONAL
+# define OPTST_ARG_OPTIONAL 0
+#endif
+
+#define VENDOR_OPTION_VALUE 'W'
+
+#define SELECTED_OPT(_od) ((_od)->fOptState & OPTST_SELECTED_MASK)
+#define UNUSED_OPT( _od) (((_od)->fOptState & OPTST_SET_MASK) == 0)
+#define DISABLED_OPT(_od) ((_od)->fOptState & OPTST_DISABLED)
+#define OPTION_STATE(_od) ((_od)->fOptState)
+#define OPTST_SET_ARGTYPE(_n) ((_n) << OPTST_ARG_TYPE_SHIFT)
+#define OPTST_GET_ARGTYPE(_f) \
+ (((_f)&OPTST_ARG_TYPE_MASK) >> OPTST_ARG_TYPE_SHIFT)
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * PRIVATE INTERFACES
+ *
+ * The following values are used in the generated code to communicate
+ * with the option library procedures. They are not for public use
+ * and may be subject to change.
+ */
+
+/**
+ * Define the processing state flags
+ * @{
+ */
+
+/** integral type for holding proc_state masks */
+typedef uint32_t proc_state_mask_t;
+
+/** bits defined for proc_state_mask_t */
+/** Process long style options */
+#define OPTPROC_LONGOPT 0x000001U
+/** Process short style "flags" */
+#define OPTPROC_SHORTOPT 0x000002U
+/** Stop on argument errors */
+#define OPTPROC_ERRSTOP 0x000004U
+/** Current option is disabled */
+#define OPTPROC_DISABLEDOPT 0x000008U
+/** no options are required */
+#define OPTPROC_NO_REQ_OPT 0x000010U
+/** there is a number option */
+#define OPTPROC_NUM_OPT 0x000020U
+/** have inits been done? */
+#define OPTPROC_INITDONE 0x000040U
+/** any negation options? */
+#define OPTPROC_NEGATIONS 0x000080U
+/** check environment? */
+#define OPTPROC_ENVIRON 0x000100U
+/** Disallow remaining arguments */
+#define OPTPROC_NO_ARGS 0x000200U
+/** Require args after options */
+#define OPTPROC_ARGS_REQ 0x000400U
+/** reorder operands after opts */
+#define OPTPROC_REORDER 0x000800U
+/** emit usage in GNU style */
+#define OPTPROC_GNUUSAGE 0x001000U
+/** Translate strings in tOptions */
+#define OPTPROC_TRANSLATE 0x002000U
+/** no usage on usage error */
+#define OPTPROC_MISUSE 0x004000U
+/** immediate options active */
+#define OPTPROC_IMMEDIATE 0x008000U
+/** suppress for config only */
+#define OPTPROC_NXLAT_OPT_CFG 0x010000U
+/** suppress xlation always */
+#define OPTPROC_NXLAT_OPT 0x020000U
+/** vendor options active */
+#define OPTPROC_VENDOR_OPT 0x040000U
+/** opt processing in preset state */
+#define OPTPROC_PRESETTING 0x080000U
+/** Ignore pzFullUsage, compute usage text */
+#define OPTPROC_COMPUTE 0x100000U
+/** Program outputs digested option state for shell scripts. Usage text
+ * always written to stderr */
+#define OPTPROC_SHELL_OUTPUT 0x200000U
+
+/** bits in NO_XLAT mask:
+ * nxlat_opt_cfg nxlat_opt */
+#define OPTPROC_NO_XLAT_MASK 0x030000U
+
+/** all bits in proc_state_mask_t masks */
+#define OPTPROC_MASK_ALL 0x3FFFFFU
+
+/** no bits in proc_state_mask_t */
+#define OPTPROC_NONE 0x000000U
+/** @} */
+
+#define STMTS(s) do { s; } while (false)
+
+/**
+ * Abbreviation for const memory character.
+ */
+#define tCC char const
+
+/**
+ * Magical values for the program's option pointer
+ * @{
+ */
+typedef enum {
+ OP_VAL_EMIT_USAGE = 1, ///< request for usage
+ OP_VAL_EMIT_SHELL = 2, ///< emit value for Bourne shell evaluation
+ OP_VAL_RETURN_VALNAME = 3, ///< return the value as a string
+ OP_VAL_EMIT_LIMIT = 15 ///< limit for magic values
+} opt_proc_vals_t;
+
+/// \a OPT_VAL_EMIT_USAGE cast as a pointer
+#define OPTPROC_EMIT_USAGE ((tOptions *)OP_VAL_EMIT_USAGE)
+
+/// \a OPT_VAL_EMIT_SHELL cast as a pointer
+#define OPTPROC_EMIT_SHELL ((tOptions *)OP_VAL_EMIT_SHELL)
+
+/// \a OPT_VAL_RETURN_VALNAME cast as a pointer
+#define OPTPROC_RETURN_VALNAME ((tOptions *)OP_VAL_RETURN_VALNAME)
+
+/// \a OPT_VAL_EMIT_LIMIT cast as a pointer
+#define OPTPROC_EMIT_LIMIT ((tOptions *)OP_VAL_EMIT_LIMIT)
+/** @} */
+
+/** group option processing procedure types
+ * @{
+ */
+/** forward declaration for tOptDesc */
+typedef struct opt_desc tOptDesc;
+/** forward declaration for tOptiond */
+typedef struct options tOptions;
+
+/**
+ * The option procedures do the special processing for each
+ * option flag that needs it.
+ */
+typedef void (tOptProc)(tOptions * pOpts, tOptDesc * pOptDesc);
+
+/**
+ * a pointer to an option processing procedure
+ */
+typedef tOptProc * tpOptProc;
+
+/**
+ * The usage procedure will never return. It calls "exit(2)"
+ * with the "exitCode" argument passed to it.
+ */
+// coverity[+kill]
+typedef void (tUsageProc)(tOptions* pOpts, int exitCode);
+
+/**
+ * a pointer to a procedure that prints usage and exits.
+ */
+typedef tUsageProc * tpUsageProc;
+/** @} */
+
+/**
+ * Special definitions. "NOLIMIT" is the 'max' value to use when
+ * a flag may appear multiple times without limit. "NO_EQUIVALENT"
+ * is an illegal value for 'optIndex' (option description index).
+ * @{
+ */
+#define NOLIMIT USHRT_MAX ///< no occurrance count limit
+#define OPTION_LIMIT SHRT_MAX ///< maximum number of option types
+/// option index to indicate no equivalance or alias
+#define NO_EQUIVALENT (OPTION_LIMIT+1)
+/** @} */
+
+/**
+ * Option argument value. Which is valid is determined by:
+ * (fOptState & OPTST_ARG_TYPE_MASK) >> OPTST_ARG_TYPE_SHIFT
+ * which will yield one of the teOptArgType values.
+ */
+typedef union {
+ char const * argString; ///< as a string
+ uintptr_t argEnum; ///< as an enumeration value
+ uintptr_t argIntptr; ///< as an integer big enough to hold pointer
+ long argInt; ///< as a long integer
+ unsigned long argUint; ///< as an unsigned long ingeger
+ unsigned int argBool; ///< as a boolean value
+ FILE * argFp; ///< as a FILE * pointer
+ int argFd; ///< as a file descriptor (int)
+} opt_arg_union_t;
+
+/// Compatibility define: \a pzLastArg is now \a optArg.argString
+#define pzLastArg optArg.argString
+/// The old amorphous argument bucket is now the opt_arg_union_t union.
+#define optArgBucket_t opt_arg_union_t
+
+/**
+ * Enumeration of AutoOpts defined options. The enumeration is used in
+ * marking each option that is defined by AutoOpts so libopts can find
+ * the correct descriptor. This renders \a option_spec_idx_t redundant.
+ */
+typedef enum {
+ AOUSE_USER_DEFINED = 0, ///< user specified option
+ AOUSE_RESET_OPTION, ///< reset option state option
+ AOUSE_VERSION, ///< request version
+ AOUSE_HELP, ///< request usage help
+ AOUSE_MORE_HELP, ///< request paged usage
+ AOUSE_USAGE, ///< request short usage
+ AOUSE_SAVE_OPTS, ///< save option state
+ AOUSE_LOAD_OPTS, ///< load options from file
+ AOUSE_VENDOR_OPT ///< specify a vendor option
+} opt_usage_t;
+
+/**
+ * Descriptor structure for each option.
+ * Only the fields marked "PUBLIC" are for public use.
+ */
+struct opt_desc {
+ /// Public, the index of this descriptor
+ uint16_t const optIndex;
+ /// Public, the flag character (value)
+ uint16_t const optValue;
+ /// Public, the index of the option used to activate option
+ uint16_t optActualIndex;
+ /// Public, the flag character of the activating option
+ uint16_t optActualValue;
+
+ /// Public, the index of the equivalenced-to option.
+ /// This is NO_EQUIVALENT unless activated.
+ uint16_t const optEquivIndex;
+ /// Private, the minimum occurrance count
+ uint16_t const optMinCt;
+ /// Private, the maximum occurrance count (NOLIMIT, if unlimited)
+ uint16_t const optMaxCt;
+ /// Public, the actual occurrance count
+ uint16_t optOccCt;
+
+ /// Public, the option processing state
+ opt_state_mask_t fOptState;
+ /// Private, how the option is used (opt_usage_t)
+ uint32_t optUsage;
+ /// Public, The current option argument value
+ opt_arg_union_t optArg;
+ /// Public, data that is actually private to the code that handles
+ /// this particular option. It is public IFF you have your own
+ /// handling function.
+ void * optCookie;
+
+ /// Private, a list of options that must be specified when this option
+ /// has been specified
+ int const * const pOptMust;
+
+ /// Private, a list of options that cannot be specified when this option
+ /// has been specified
+ int const * const pOptCant;
+
+ /// Private, the function to call for handling this option
+ tpOptProc const pOptProc;
+
+ /// Private, usage information about this option
+ char const * const pzText;
+
+ /// Public, the UPPER CASE, shell variable name syntax name of the option
+ char const * const pz_NAME;
+
+ /// the unmodified name of the option
+ char const * const pz_Name;
+
+ /// the option name to use to disable the option. Long options names
+ /// must be active.
+ char const * const pz_DisableName;
+
+ /// the special prefix that makes the normal option name become the
+ /// disablement name.
+ char const * const pz_DisablePfx;
+};
+
+/**
+ * Some options need special processing, so we store their
+ * indexes in a known place.
+ */
+typedef struct {
+ uint16_t const more_help; ///< passes help text through pager
+ uint16_t const save_opts; ///< stores option state to a file
+ uint16_t const number_option; ///< the option "name" is an integer
+ /// all arguments are options, this is the default option that must
+ /// take an argument. That argument is the unrecognized option.
+ uint16_t const default_opt;
+} option_spec_idx_t;
+
+/**
+ * The procedure generated for translating option text
+ */
+typedef void (tOptionXlateProc)(void);
+
+/**
+ * Everything marked "PUBLIC" is also marked "const". Public access is not
+ * a license to modify. Other fields are used and modified by the library.
+ * They are also subject to change without any notice.
+ * Do not even look at these outside of libopts.
+ */
+struct options {
+ int const structVersion; ///< The version of this struct
+ unsigned int origArgCt; ///< program argument count
+ char ** origArgVect; ///< program argument vector
+ proc_state_mask_t fOptSet; ///< option proc. state flags
+ unsigned int curOptIdx; ///< current option index
+ char * pzCurOpt; ///< current option text
+
+ /// Public, the full path of the program
+ char const * const pzProgPath;
+ /// Public, the name of the executable, without any path
+ char const * const pzProgName;
+ /// Public, the upper-cased, shell variable syntax-ed program name
+ char const * const pzPROGNAME;
+ /// the name of the "rc file" (configuration file)
+ char const * const pzRcName;
+ /// the copyright text
+ char const * const pzCopyright;
+ /// the full copyright notice
+ char const * const pzCopyNotice;
+ /// a string with the program name, project name and version
+ char const * const pzFullVersion;
+ /// a list of pointers to directories to search for the config file
+ char const * const * const papzHomeList;
+ /// the title line for usage
+ char const * const pzUsageTitle;
+ /// some added explanation for what this program is trying to do
+ char const * const pzExplain;
+ /// a detailed explanation of the program's purpose, for use when
+ /// full help has been requested
+ char const * const pzDetail;
+ /// The public array of option descriptors
+ tOptDesc * const pOptDesc;
+ /// the email address for reporting bugs
+ char const * const pzBugAddr;
+
+ /// Reserved for future use
+ void * pExtensions;
+ /// A copy of the option state when optionSaveState was called.
+ void * pSavedState;
+
+ /// The procedure to call to print usage text
+ // coverity[+kill]
+ tpUsageProc pUsageProc;
+ /// The procedure to call to translate translatable option messages
+ tOptionXlateProc * pTransProc;
+
+ /// Special option indexes.
+ option_spec_idx_t specOptIdx;
+ /// the total number of options for the program
+ int const optCt;
+ /// The number of "presettable" options, though some may be marked
+ /// "no-preset". Includes all user specified options, plus a few
+ /// that are specified by AutoOpts.
+ int const presetOptCt;
+ /// user specified full usage text
+ char const * pzFullUsage;
+ /// user specifed short usage (usage error triggered) message
+ char const * pzShortUsage;
+ /// The option argument settings active when optionSaveState was called
+ opt_arg_union_t const * const originalOptArgArray;
+ /// any saved cookie value
+ void * const * const originalOptArgCookie;
+ /// the package data directory (e.g. global configuration files)
+ char const * const pzPkgDataDir;
+ /// email address of the project packager
+ char const * const pzPackager;
+};
+
+/*
+ * Versions where in various fields first appear:
+ * ($AO_CURRENT * 4096 + $AO_REVISION, but $AO_REVISION must be zero)
+ */
+/**
+ * The version that first stored the original argument vector
+ */
+#define originalOptArgArray_STRUCT_VERSION 0x20000 /* AO_CURRENT = 32 */
+#define HAS_originalOptArgArray(_opt) \
+ ((_opt)->structVersion >= originalOptArgArray_STRUCT_VERSION)
+
+/**
+ * The version that first stored the package data directory
+ */
+#define pzPkgDataDir_STRUCT_VERSION 0x22000 /* AO_CURRENT = 34 */
+#define HAS_pzPkgDataDir(_opt) \
+ ((_opt)->structVersion >= pzPkgDataDir_STRUCT_VERSION)
+
+/**
+ * The version that first stored the option usage in each option descriptor
+ */
+#define opt_usage_t_STRUCT_VERSION 0x26000 /* AO_CURRENT = 38 */
+#define HAS_opt_usage_t(_opt) \
+ ((_opt)->structVersion >= opt_usage_t_STRUCT_VERSION)
+
+/**
+ * "token list" structure returned by "string_tokenize()"
+ */
+typedef struct {
+ unsigned long tkn_ct; ///< number of tokens found
+ unsigned char* tkn_list[1]; ///< array of pointers to tokens
+} token_list_t;
+
+/*
+ * Hide the interface - it pollutes a POSIX claim, but leave it for
+ * anyone #include-ing this header
+ */
+#define strneqvcmp option_strneqvcmp
+#define streqvcmp option_streqvcmp
+#define streqvmap option_streqvmap
+#define strequate option_strequate
+#define strtransform option_strtransform
+
+/**
+ * Everything needed to be known about an mmap-ed file.
+ *
+ * This is an output only structure used by text_mmap and text_munmap.
+ * Clients must not alter the contents and must provide it to both
+ * the text_mmap and text_munmap procedures. BE ADVISED: if you are
+ * mapping the file with PROT_WRITE the NUL byte at the end MIGHT NOT
+ * BE WRITABLE. In any event, that byte is not be written back
+ * to the source file. ALSO: if "txt_data" is valid and "txt_errno"
+ * is not zero, then there *may* not be a terminating NUL.
+ */
+typedef struct {
+ void * txt_data; ///< text file data
+ size_t txt_size; ///< actual file size
+ size_t txt_full_size; ///< mmaped mem size
+ int txt_fd; ///< file descriptor
+ int txt_zero_fd; ///< fd for /dev/zero
+ int txt_errno; ///< warning code
+ int txt_prot; ///< "prot" flags
+ int txt_flags; ///< mapping type
+} tmap_info_t;
+
+/**
+ * mmap result wrapper that yields "true" when mmap has failed.
+ */
+#define TEXT_MMAP_FAILED_ADDR(a) ((void*)(a) == (void*)MAP_FAILED)
+
+#ifdef __cplusplus
+#define CPLUSPLUS_OPENER extern "C" {
+CPLUSPLUS_OPENER
+#define CPLUSPLUS_CLOSER }
+#else
+#define CPLUSPLUS_CLOSER
+#endif
+
+/**
+ * The following routines may be coded into AutoOpts client code:
+ */
+
+/**
+ * ao_string_tokenize - tokenize an input string
+ *
+ * This function will convert one input string into a list of strings.
+ * The list of strings is derived by separating the input based on
+ * white space separation. However, if the input contains either single
+ * or double quote characters, then the text after that character up to
+ * a matching quote will become the string in the list.
+ *
+ * The returned pointer should be deallocated with @code{free(3C)} when
+ * are done using the data. The data are placed in a single block of
+ * allocated memory. Do not deallocate individual token/strings.
+ *
+ * The structure pointed to will contain at least these two fields:
+ * @table @samp
+ * @item tkn_ct
+ * The number of tokens found in the input string.
+ * @item tok_list
+ * An array of @code{tkn_ct + 1} pointers to substring tokens, with
+ * the last pointer set to NULL.
+ * @end table
+ *
+ * There are two types of quoted strings: single quoted (@code{'}) and
+ * double quoted (@code{"}). Singly quoted strings are fairly raw in that
+ * escape characters (@code{\\}) are simply another character, except when
+ * preceding the following characters:
+ * @example
+ * @code{\\} double backslashes reduce to one
+ * @code{'} incorporates the single quote into the string
+ * @code{\n} suppresses both the backslash and newline character
+ * @end example
+ *
+ * Double quote strings are formed according to the rules of string
+ * constants in ANSI-C programs.
+ *
+ * @param string string to be tokenized
+ *
+ * @return token_list_t* - pointer to a structure that lists each token
+ */
+extern token_list_t* ao_string_tokenize(char const*);
+
+
+/**
+ * configFileLoad - parse a configuration file
+ *
+ * This routine will load a named configuration file and parse the
+ * text as a hierarchically valued option. The option descriptor
+ * created from an option definition file is not used via this interface.
+ * The returned value is "named" with the input file name and is of
+ * type "@code{OPARG_TYPE_HIERARCHY}". It may be used in calls to
+ * @code{optionGetValue()}, @code{optionNextValue()} and
+ * @code{optionUnloadNested()}.
+ *
+ * @param fname the file to load
+ *
+ * @return const tOptionValue* - An allocated, compound value structure
+ */
+extern const tOptionValue* configFileLoad(char const*);
+
+
+/**
+ * optionFileLoad - Load the locatable config files, in order
+ *
+ * This function looks in all the specified directories for a configuration
+ * file ("rc" file or "ini" file) and processes any found twice. The first
+ * time through, they are processed in reverse order (last file first). At
+ * that time, only "immediate action" configurables are processed. For
+ * example, if the last named file specifies not processing any more
+ * configuration files, then no more configuration files will be processed.
+ * Such an option in the @strong{first} named directory will have no effect.
+ *
+ * Once the immediate action configurables have been handled, then the
+ * directories are handled in normal, forward order. In that way, later
+ * config files can override the settings of earlier config files.
+ *
+ * See the AutoOpts documentation for a thorough discussion of the
+ * config file format.
+ *
+ * Configuration files not found or not decipherable are simply ignored.
+ *
+ * @param opts program options descriptor
+ * @param prog program name
+ *
+ * @return int - 0 -> SUCCESS, -1 -> FAILURE
+ */
+extern int optionFileLoad(tOptions*, char const*);
+
+
+/**
+ * optionFindNextValue - find a hierarcicaly valued option instance
+ *
+ * This routine will find the next entry in a nested value option or
+ * configurable. It will search through the list and return the next entry
+ * that matches the criteria.
+ *
+ * @param odesc an option with a nested arg type
+ * @param pPrevVal the last entry
+ * @param name name of value to find
+ * @param value the matching value
+ *
+ * @return const tOptionValue* - a compound value structure
+ */
+extern const tOptionValue* optionFindNextValue(const tOptDesc*, const tOptionValue*, char const*, char const*);
+
+
+/**
+ * optionFindValue - find a hierarcicaly valued option instance
+ *
+ * This routine will find an entry in a nested value option or configurable.
+ * It will search through the list and return a matching entry.
+ *
+ * @param odesc an option with a nested arg type
+ * @param name name of value to find
+ * @param val the matching value
+ *
+ * @return const tOptionValue* - a compound value structure
+ */
+extern const tOptionValue* optionFindValue(const tOptDesc*, char const*, char const*);
+
+
+/**
+ * optionFree - free allocated option processing memory
+ *
+ * AutoOpts sometimes allocates memory and puts pointers to it in the
+ * option state structures. This routine deallocates all such memory.
+ *
+ * @param pOpts program options descriptor
+ */
+extern void optionFree(tOptions*);
+
+
+/**
+ * optionGetValue - get a specific value from a hierarcical list
+ *
+ * This routine will find an entry in a nested value option or configurable.
+ * If "valueName" is NULL, then the first entry is returned. Otherwise,
+ * the first entry with a name that exactly matches the argument will be
+ * returned. If there is no matching value, NULL is returned and errno is
+ * set to ENOENT. If the provided option value is not a hierarchical value,
+ * NULL is also returned and errno is set to EINVAL.
+ *
+ * @param pOptValue a hierarchcal value
+ * @param valueName name of value to get
+ *
+ * @return const tOptionValue* - a compound value structure
+ */
+extern const tOptionValue* optionGetValue(const tOptionValue*, char const*);
+
+
+/**
+ * optionLoadLine - process a string for an option name and value
+ *
+ * This is a client program callable routine for setting options from, for
+ * example, the contents of a file that they read in. Only one option may
+ * appear in the text. It will be treated as a normal (non-preset) option.
+ *
+ * When passed a pointer to the option struct and a string, it will find
+ * the option named by the first token on the string and set the option
+ * argument to the remainder of the string. The caller must NUL terminate
+ * the string. The caller need not skip over any introductory hyphens.
+ * Any embedded new lines will be included in the option
+ * argument. If the input looks like one or more quoted strings, then the
+ * input will be "cooked". The "cooking" is identical to the string
+ * formation used in AutoGen definition files (@pxref{basic expression}),
+ * except that you may not use backquotes.
+ *
+ * @param opts program options descriptor
+ * @param line NUL-terminated text
+ */
+extern void optionLoadLine(tOptions*, char const*);
+
+
+/**
+ * optionMemberList - Get the list of members of a bit mask set
+ *
+ * This converts the OPT_VALUE_name mask value to a allocated string.
+ * It is the caller's responsibility to free the string.
+ *
+ * @param od the set membership option description
+ *
+ * @return char* - the names of the set bits
+ */
+extern char* optionMemberList(tOptDesc *);
+
+
+/**
+ * optionNextValue - get the next value from a hierarchical list
+ *
+ * This routine will return the next entry after the entry passed in. At the
+ * end of the list, NULL will be returned. If the entry is not found on the
+ * list, NULL will be returned and "@var{errno}" will be set to EINVAL.
+ * The "@var{pOldValue}" must have been gotten from a prior call to this
+ * routine or to "@code{opitonGetValue()}".
+ *
+ * @param pOptValue a hierarchcal list value
+ * @param pOldValue a value from this list
+ *
+ * @return const tOptionValue* - a compound value structure
+ */
+extern const tOptionValue* optionNextValue(const tOptionValue*, const tOptionValue*);
+
+
+/**
+ * optionOnlyUsage - Print usage text for just the options
+ *
+ * This routine will print only the usage for each option.
+ * This function may be used when the emitted usage must incorporate
+ * information not available to AutoOpts.
+ *
+ * @param pOpts program options descriptor
+ * @param ex_code exit code for calling exit(3)
+ */
+extern void optionOnlyUsage(tOptions*, int);
+
+
+/**
+ * optionPrintVersion - Print the program version
+ *
+ * This routine will print the version to stdout.
+ *
+ * @param opts program options descriptor
+ * @param od the descriptor for this arg
+ */
+extern void optionPrintVersion(tOptions*, tOptDesc*);
+
+
+/**
+ * optionPrintVersionAndReturn - Print the program version
+ *
+ * This routine will print the version to stdout and return
+ * instead of exiting. Please see the source for the
+ * @code{print_ver} funtion for details on selecting how
+ * verbose to be after this function returns.
+ *
+ * @param opts program options descriptor
+ * @param od the descriptor for this arg
+ */
+extern void optionPrintVersionAndReturn(tOptions*, tOptDesc*);
+
+
+/**
+ * optionProcess - this is the main option processing routine
+ *
+ * This is the main entry point for processing options. It is intended
+ * that this procedure be called once at the beginning of the execution of
+ * a program. Depending on options selected earlier, it is sometimes
+ * necessary to stop and restart option processing, or to select completely
+ * different sets of options. This can be done easily, but you generally
+ * do not want to do this.
+ *
+ * The number of arguments processed always includes the program name.
+ * If one of the arguments is "--", then it is counted and the processing
+ * stops. If an error was encountered and errors are to be tolerated, then
+ * the returned value is the index of the argument causing the error.
+ * A hyphen by itself ("-") will also cause processing to stop and will
+ * @emph{not} be counted among the processed arguments. A hyphen by itself
+ * is treated as an operand. Encountering an operand stops option
+ * processing.
+ *
+ * @param opts program options descriptor
+ * @param a_ct program arg count
+ * @param a_v program arg vector
+ *
+ * @return int - the count of the arguments processed
+ */
+extern int optionProcess(tOptions*, int, char**);
+
+
+/**
+ * optionRestore - restore option state from memory copy
+ *
+ * Copy back the option state from saved memory.
+ * The allocated memory is left intact, so this routine can be
+ * called repeatedly without having to call optionSaveState again.
+ * If you are restoring a state that was saved before the first call
+ * to optionProcess(3AO), then you may change the contents of the
+ * argc/argv parameters to optionProcess.
+ *
+ * @param pOpts program options descriptor
+ */
+extern void optionRestore(tOptions*);
+
+
+/**
+ * optionSaveFile - saves the option state to a file
+ *
+ * This routine will save the state of option processing to a file. The name
+ * of that file can be specified with the argument to the @code{--save-opts}
+ * option, or by appending the @code{rcfile} attribute to the last
+ * @code{homerc} attribute. If no @code{rcfile} attribute was specified, it
+ * will default to @code{.@i{programname}rc}. If you wish to specify another
+ * file, you should invoke the @code{SET_OPT_SAVE_OPTS(@i{filename})} macro.
+ *
+ * The recommend usage is as follows:
+ * @example
+ * optionProcess(&progOptions, argc, argv);
+ * if (i_want_a_non_standard_place_for_this)
+ * SET_OPT_SAVE_OPTS("myfilename");
+ * optionSaveFile(&progOptions);
+ * @end example
+ *
+ * @param opts program options descriptor
+ */
+extern void optionSaveFile(tOptions*);
+
+
+/**
+ * optionSaveState - saves the option state to memory
+ *
+ * This routine will allocate enough memory to save the current option
+ * processing state. If this routine has been called before, that memory
+ * will be reused. You may only save one copy of the option state. This
+ * routine may be called before optionProcess(3AO). If you do call it
+ * before the first call to optionProcess, then you may also change the
+ * contents of argc/argv after you call optionRestore(3AO)
+ *
+ * In fact, more strongly put: it is safest to only use this function
+ * before having processed any options. In particular, the saving and
+ * restoring of stacked string arguments and hierarchical values is
+ * disabled. The values are not saved.
+ *
+ * @param pOpts program options descriptor
+ */
+extern void optionSaveState(tOptions*);
+
+
+/**
+ * optionUnloadNested - Deallocate the memory for a nested value
+ *
+ * A nested value needs to be deallocated. The pointer passed in should
+ * have been gotten from a call to @code{configFileLoad()} (See
+ * @pxref{libopts-configFileLoad}).
+ *
+ * @param pOptVal the hierarchical value
+ */
+extern void optionUnloadNested(tOptionValue const *);
+
+
+/**
+ * optionVersion - return the compiled AutoOpts version number
+ *
+ * Returns the full version string compiled into the library.
+ * The returned string cannot be modified.
+ *
+ * @return char const* - the version string in constant memory
+ */
+extern char const* optionVersion(void);
+
+
+/**
+ * strequate - map a list of characters to the same value
+ *
+ * Each character in the input string get mapped to the first character
+ * in the string.
+ * This function name is mapped to option_strequate so as to not conflict
+ * with the POSIX name space.
+ *
+ * @param ch_list characters to equivalence
+ */
+extern void strequate(char const*);
+
+
+/**
+ * streqvcmp - compare two strings with an equivalence mapping
+ *
+ * Using a character mapping, two strings are compared for "equivalence".
+ * Each input character is mapped to a comparison character and the
+ * mapped-to characters are compared for the two NUL terminated input strings.
+ * This function name is mapped to option_streqvcmp so as to not conflict
+ * with the POSIX name space.
+ *
+ * @param str1 first string
+ * @param str2 second string
+ *
+ * @return int - the difference between two differing characters
+ */
+extern int streqvcmp(char const*, char const*);
+
+
+/**
+ * streqvmap - Set the character mappings for the streqv functions
+ *
+ * Set the character mapping. If the count (@code{ct}) is set to zero, then
+ * the map is cleared by setting all entries in the map to their index
+ * value. Otherwise, the "@code{From}" character is mapped to the "@code{To}"
+ * character. If @code{ct} is greater than 1, then @code{From} and @code{To}
+ * are incremented and the process repeated until @code{ct} entries have been
+ * set. For example,
+ * @example
+ * streqvmap('a', 'A', 26);
+ * @end example
+ * @noindent
+ * will alter the mapping so that all English lower case letters
+ * will map to upper case.
+ *
+ * This function name is mapped to option_streqvmap so as to not conflict
+ * with the POSIX name space.
+ *
+ * @param from Input character
+ * @param to Mapped-to character
+ * @param ct compare length
+ */
+extern void streqvmap(char, char, int);
+
+
+/**
+ * strneqvcmp - compare two strings with an equivalence mapping
+ *
+ * Using a character mapping, two strings are compared for "equivalence".
+ * Each input character is mapped to a comparison character and the
+ * mapped-to characters are compared for the two NUL terminated input strings.
+ * The comparison is limited to @code{ct} bytes.
+ * This function name is mapped to option_strneqvcmp so as to not conflict
+ * with the POSIX name space.
+ *
+ * @param str1 first string
+ * @param str2 second string
+ * @param ct compare length
+ *
+ * @return int - the difference between two differing characters
+ */
+extern int strneqvcmp(char const*, char const*, int);
+
+
+/**
+ * strtransform - convert a string into its mapped-to value
+ *
+ * Each character in the input string is mapped and the mapped-to
+ * character is put into the output.
+ * This function name is mapped to option_strtransform so as to not conflict
+ * with the POSIX name space.
+ *
+ * The source and destination may be the same.
+ *
+ * @param dest output string
+ * @param src input string
+ */
+extern void strtransform(char*, char const*);
+
+/* AutoOpts PRIVATE FUNCTIONS: */
+tOptProc optionStackArg, optionUnstackArg, optionBooleanVal, optionNumericVal;
+
+extern char* ao_string_cook(char*, int*);
+
+extern unsigned int ao_string_cook_escape_char(char const*, char*, unsigned int);
+
+extern void genshelloptUsage(tOptions*, int);
+
+extern int optionAlias(tOptions *, tOptDesc *, unsigned int);
+
+extern void optionBooleanVal(tOptions*, tOptDesc*);
+
+extern uintptr_t optionEnumerationVal(tOptions*, tOptDesc*, char const * const *, unsigned int);
+
+extern void optionFileCheck(tOptions*, tOptDesc*, teOptFileType, tuFileMode);
+
+extern char const * optionKeywordName(tOptDesc*, unsigned int);
+
+extern void optionLoadOpt(tOptions*, tOptDesc*);
+
+extern bool optionMakePath(char*, int, char const*, char const*);
+
+extern void optionNestedVal(tOptions*, tOptDesc*);
+
+extern void optionNumericVal(tOptions*, tOptDesc*);
+
+extern void optionPagedUsage(tOptions *, tOptDesc *);
+
+extern void optionParseShell(tOptions*);
+
+extern void optionPrintParagraphs(char const *, bool, FILE *);
+
+extern void optionPutShell(tOptions*);
+
+extern char const * optionQuoteString(char const *, char const *);
+
+extern void optionResetOpt(tOptions*, tOptDesc*);
+
+extern void optionSetMembers(tOptions*, tOptDesc*, char const * const *, unsigned int);
+
+extern void optionShowRange(tOptions*, tOptDesc*, void *, int);
+
+extern void optionStackArg(tOptions*, tOptDesc*);
+
+extern void optionTimeDate(tOptions*, tOptDesc*);
+
+extern void optionTimeVal(tOptions*, tOptDesc*);
+
+extern void optionUnstackArg(tOptions*, tOptDesc*);
+
+extern void optionUsage(tOptions*, int);
+
+extern void optionVendorOption(tOptions *, tOptDesc *);
+
+extern void optionVersionStderr(tOptions*, tOptDesc*);
+
+extern void* text_mmap(char const*, int, int, tmap_info_t*);
+
+extern int text_munmap(tmap_info_t*);
+
+CPLUSPLUS_CLOSER
+#endif /* AUTOOPTS_OPTIONS_H_GUARD */
+/** @}
+ *
+ * Local Variables:
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * options.h ends here */
diff --git a/sntp/libopts/autoopts/project.h b/sntp/libopts/autoopts/project.h
new file mode 100644
index 0000000..c61a6ca
--- /dev/null
+++ b/sntp/libopts/autoopts/project.h
@@ -0,0 +1,77 @@
+
+/**
+ * \file project.h
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+#ifndef AUTOGEN_PROJECT_H
+#define AUTOGEN_PROJECT_H
+
+#include "config.h"
+#include "compat/compat.h"
+#include "ag-char-map.h"
+
+/*
+ * Procedure success codes
+ *
+ * USAGE: define procedures to return "tSuccess". Test their results
+ * with the SUCCEEDED, FAILED and HADGLITCH macros.
+ *
+ * Microsoft sticks its nose into user space here, so for Windows' sake,
+ * make sure all of these are undefined.
+ */
+#undef SUCCESS
+#undef FAILURE
+#undef PROBLEM
+#undef SUCCEEDED
+#undef SUCCESSFUL
+#undef FAILED
+#undef HADGLITCH
+
+#define SUCCESS ((tSuccess) 0)
+#define FAILURE ((tSuccess)-1)
+#define PROBLEM ((tSuccess) 1)
+
+typedef int tSuccess;
+
+#define SUCCEEDED(p) ((p) == SUCCESS)
+#define SUCCESSFUL(p) SUCCEEDED(p)
+#define FAILED(p) ((p) < SUCCESS)
+#define HADGLITCH(p) ((p) > SUCCESS)
+
+#ifndef STR
+# define __STR(s) #s
+# define STR(s) __STR(s)
+#endif
+
+#ifdef DEFINING
+# define VALUE(s) = s
+# define MODE
+#else
+# define VALUE(s)
+# define MODE extern
+#endif
+
+#define parse_duration option_parse_duration
+
+#endif /* AUTOGEN_PROJECT_H */
+/* end of project.h */
diff --git a/sntp/libopts/autoopts/usage-txt.h b/sntp/libopts/autoopts/usage-txt.h
new file mode 100644
index 0000000..0c72d32
--- /dev/null
+++ b/sntp/libopts/autoopts/usage-txt.h
@@ -0,0 +1,657 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (usage-txt.h)
+ *
+ * It has been AutoGen-ed August 3, 2014 at 10:44:44 AM by AutoGen 5.18.4pre11
+ * From the definitions usage-txt.def
+ * and the template file usage-txt.tpl
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+/** @file usage-txt.h
+ *
+ * This file handles all the bookkeeping required for tracking all the little
+ * tiny strings used by the AutoOpts library. There are 108
+ * of them. This is not versioned because it is entirely internal to the
+ * library and accessed by client code only in a very well-controlled way:
+ * they may substitute translated strings using a procedure that steps through
+ * all the string pointers.
+ */
+#ifndef AUTOOPTS_USAGE_TXT_H_GUARD
+#define AUTOOPTS_USAGE_TXT_H_GUARD 1
+
+/*
+ * One structure to hold all the pointers to all the translatable strings.
+ */
+typedef struct {
+ int field_ct;
+ char * utpz_GnuBoolArg;
+ char * utpz_GnuKeyArg;
+ char * utpz_GnuNumArg;
+ char * utpz_GnuStrArg;
+ char const * apz_str[104];
+} usage_text_t;
+
+/*
+ * Declare the global structure with all the pointers to translatable
+ * strings and the text array containing untranslatable strings.
+ */
+extern usage_text_t option_xlateable_txt;
+extern char const option_lib_text[4285];
+
+#if defined(AUTOOPTS_INTERNAL)
+/*
+ * Provide a mapping from a short name to either the text directly
+ * (for untranslatable strings), or to pointers to the text, rendering
+ * them translatable.
+ */
+#define zalloc_fail (option_xlateable_txt.apz_str[ 0])
+#define zno_opt_arg (option_xlateable_txt.apz_str[ 1])
+#define ztoo_new (option_xlateable_txt.apz_str[ 2])
+#define zwrong_ver (option_xlateable_txt.apz_str[ 3])
+#define zrealloc_fail (option_xlateable_txt.apz_str[ 4])
+#define ztoo_old (option_xlateable_txt.apz_str[ 5])
+#define zao_ver_fmt (option_xlateable_txt.apz_str[ 6])
+#define zao_bug_msg (option_xlateable_txt.apz_str[ 7])
+#define zno_reset (option_xlateable_txt.apz_str[ 8])
+#define zmissing_help_msg (option_xlateable_txt.apz_str[ 9])
+#define zbad_data_msg (option_xlateable_txt.apz_str[ 10])
+#define zbad_arg_type_msg (option_xlateable_txt.apz_str[ 11])
+#define zbad_default_msg (option_xlateable_txt.apz_str[ 12])
+#define zbad_alias_id (option_xlateable_txt.apz_str[ 13])
+#define zambiguous_key (option_xlateable_txt.apz_str[ 14])
+#define zambig_list_msg (option_xlateable_txt.apz_str[ 15])
+#define zambig_opt_fmt (option_xlateable_txt.apz_str[ 16])
+#define zargs_must (option_xlateable_txt.apz_str[ 17])
+#define zat_most (option_xlateable_txt.apz_str[ 18])
+#define zfserr_fmt (option_xlateable_txt.apz_str[ 19])
+#define zinter_proc_pipe (option_xlateable_txt.apz_str[ 20])
+#define zBadVerArg (option_xlateable_txt.apz_str[ 21])
+#define zconflict_fmt (option_xlateable_txt.apz_str[ 22])
+#define zDisabledErr (option_xlateable_txt.apz_str[ 23])
+#define zequiv (option_xlateable_txt.apz_str[ 24])
+#define zGnuBoolArg (option_xlateable_txt.utpz_GnuBoolArg)
+#define zGnuKeyArg (option_xlateable_txt.utpz_GnuKeyArg)
+#define zGnuNumArg (option_xlateable_txt.utpz_GnuNumArg)
+#define zGnuStrArg (option_xlateable_txt.utpz_GnuStrArg)
+#define zIllOptChr (option_xlateable_txt.apz_str[ 25])
+#define zIllOptStr (option_xlateable_txt.apz_str[ 26])
+#define zIllVendOptStr (option_xlateable_txt.apz_str[ 27])
+#define zIntRange (option_xlateable_txt.apz_str[ 28])
+#define zbad_od (option_xlateable_txt.apz_str[ 29])
+#define zInvalOptName (option_xlateable_txt.apz_str[ 30])
+#define zMisArg (option_xlateable_txt.apz_str[ 31])
+#define zmultiway_bug (option_xlateable_txt.apz_str[ 32])
+#define zneed_one (option_xlateable_txt.apz_str[ 33])
+#define zNoArg (option_xlateable_txt.apz_str[ 34])
+#define zNoArgs (option_xlateable_txt.apz_str[ 35])
+#define zNoCreat (option_xlateable_txt.apz_str[ 36])
+#define zNoKey (option_xlateable_txt.apz_str[ 37])
+#define zreset_arg (option_xlateable_txt.apz_str[ 38])
+#define zNoStat (option_xlateable_txt.apz_str[ 39])
+#define zNoState (option_xlateable_txt.apz_str[ 40])
+#define zNotCmdOpt (option_xlateable_txt.apz_str[ 41])
+#define zNotDate (option_xlateable_txt.apz_str[ 42])
+#define zNotDef (option_xlateable_txt.apz_str[ 43])
+#define zNotDuration (option_xlateable_txt.apz_str[ 44])
+#define zneed_more (option_xlateable_txt.apz_str[ 45])
+#define zNotNumber (option_xlateable_txt.apz_str[ 46])
+#define znum_too_large (option_xlateable_txt.apz_str[ 47])
+#define zoffer_usage_fmt (option_xlateable_txt.apz_str[ 48])
+#define zonly_one (option_xlateable_txt.apz_str[ 49])
+#define zstdout_name (option_xlateable_txt.apz_str[ 50])
+#define zstderr_name (option_xlateable_txt.apz_str[ 51])
+#define zwriting (option_xlateable_txt.apz_str[ 52])
+#define zRangeErr (option_xlateable_txt.apz_str[ 53])
+#define zneed_fmt (option_xlateable_txt.apz_str[ 54])
+#define zsave_warn (option_xlateable_txt.apz_str[ 55])
+#define zalt_opt (option_xlateable_txt.apz_str[ 56])
+#define zAuto (option_xlateable_txt.apz_str[ 57])
+#define zDefaultOpt (option_xlateable_txt.apz_str[ 58])
+#define zDis (option_xlateable_txt.apz_str[ 59])
+#define zDisabledOpt (option_xlateable_txt.apz_str[ 60])
+#define zDisabledWhy (option_xlateable_txt.apz_str[ 61])
+#define zEnab (option_xlateable_txt.apz_str[ 62])
+#define ztoo_often_fmt (option_xlateable_txt.apz_str[ 63])
+#define zExamineFmt (option_xlateable_txt.apz_str[ 64])
+#define zFileCannotExist (option_xlateable_txt.apz_str[ 65])
+#define zFileMustExist (option_xlateable_txt.apz_str[ 66])
+#define zFlagOkay (option_xlateable_txt.apz_str[ 67])
+#define zGenshell (option_xlateable_txt.apz_str[ 68])
+#define zLowerBits (option_xlateable_txt.apz_str[ 69])
+#define zMembers (option_xlateable_txt.apz_str[ 70])
+#define zMust (option_xlateable_txt.apz_str[ 71])
+#define zNoFlags (option_xlateable_txt.apz_str[ 72])
+#define zNoLim (option_xlateable_txt.apz_str[ 73])
+#define zNoPreset (option_xlateable_txt.apz_str[ 74])
+#define zNoRq_NoShrtTtl (option_xlateable_txt.apz_str[ 75])
+#define zNoRq_ShrtTtl (option_xlateable_txt.apz_str[ 76])
+#define zNrmOptFmt (option_xlateable_txt.apz_str[ 77])
+#define zNumberOpt (option_xlateable_txt.apz_str[ 78])
+#define zOptsOnly (option_xlateable_txt.apz_str[ 79])
+#define zPathFmt (option_xlateable_txt.apz_str[ 80])
+#define zPlsSendBugs (option_xlateable_txt.apz_str[ 81])
+#define zPreset (option_xlateable_txt.apz_str[ 82])
+#define zPresetIntro (option_xlateable_txt.apz_str[ 83])
+#define zProhib (option_xlateable_txt.apz_str[ 84])
+#define zProhibOne (option_xlateable_txt.apz_str[ 85])
+#define zRange (option_xlateable_txt.apz_str[ 86])
+#define zRangeAbove (option_xlateable_txt.apz_str[ 87])
+#define zRangeExact (option_xlateable_txt.apz_str[ 88])
+#define zRangeLie (option_xlateable_txt.apz_str[ 89])
+#define zRangeOnly (option_xlateable_txt.apz_str[ 90])
+#define zRangeOr (option_xlateable_txt.apz_str[ 91])
+#define zRangeScaled (option_xlateable_txt.apz_str[ 92])
+#define zRangeUpto (option_xlateable_txt.apz_str[ 93])
+#define zReorder (option_xlateable_txt.apz_str[ 94])
+#define zReqOne (option_xlateable_txt.apz_str[ 95])
+#define zReqThese (option_xlateable_txt.apz_str[ 96])
+#define zReq_NoShrtTtl (option_xlateable_txt.apz_str[ 97])
+#define zReq_ShrtTtl (option_xlateable_txt.apz_str[ 98])
+#define zSetMemberSettings (option_xlateable_txt.apz_str[ 99])
+#define zUpTo (option_xlateable_txt.apz_str[100])
+#define zValidKeys (option_xlateable_txt.apz_str[101])
+#define zVendIntro (option_xlateable_txt.apz_str[102])
+#define zVendOptsAre (option_xlateable_txt.apz_str[103])
+
+ /*
+ * First, set up the strings. Some of these are writable. These are all in
+ * English. This gets compiled into libopts and is distributed here so that
+ * xgettext (or equivalents) can extract these strings for translation.
+ */
+static char eng_zGnuBoolArg[] = "=T/F";
+static char eng_zGnuKeyArg[] = "=KWd";
+static char eng_zGnuNumArg[] = "=num";
+static char eng_zGnuStrArg[] = "=str";
+char const option_lib_text[4285] =
+/* 0 */ "allocation of %d bytes failed\n\0"
+/* 31 */ "AutoOpts function called without option descriptor\n\0"
+/* 83 */ "\tThis exceeds the compiled library version: \0"
+/* 129 */ "Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n\0"
+/* 228 */ "realloc of %d bytes at 0x%p failed\n\0"
+/* 264 */ "\tThis is less than the minimum library version: \0"
+/* 314 */ "Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n\0"
+/* 405 */ "(AutoOpts bug): %s.\n\0"
+/* 427 */ "optionResetOpt() called, but reset-option not configured\0"
+/* 484 */ "could not locate the 'help' option\0"
+/* 519 */ "optionProcess() was called with invalid data\0"
+/* 564 */ "invalid argument type specified\0"
+/* 596 */ "defaulted to option with optional arg\0"
+/* 634 */ "aliasing option is out of range.\0"
+/* 667 */ "%s error: the keyword '%s' is ambiguous for %s\n\0"
+/* 716 */ " The following options match:\n\0"
+/* 748 */ "%s: ambiguous option name: %s (matches %d options)\n\0"
+/* 800 */ "%s: Command line arguments required\n\0"
+/* 837 */ "%d %s%s options allowed\n\0"
+/* 862 */ "%s error %d (%s) calling %s for '%s'\n\0"
+/* 900 */ "interprocess pipe\0"
+/* 918 */ "error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n\0"
+/* 1060 */ "%s error: the '%s' and '%s' options conflict\n\0"
+/* 1107 */ "%s: The '%s' option has been disabled.\0"
+/* 1146 */ "-equivalence\0"
+/* 1159 */ "%s: illegal option -- %c\n\0"
+/* 1185 */ "%s: illegal option -- %s\n\0"
+/* 1211 */ "%s: unknown vendor extension option -- %s\n\0"
+/* 1254 */ " or an integer from %d through %d\n\0"
+/* 1290 */ "%s error: invalid option descriptor for %s\n\0"
+/* 1335 */ "%s: invalid option name: %s\n\0"
+/* 1364 */ "%s: The '%s' option requires an argument.\n\0"
+/* 1407 */ "(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'.\0"
+/* 1490 */ "%s error: The %s option is required\n\0"
+/* 1528 */ "%s: The '%s' option cannot have an argument.\n\0"
+/* 1574 */ "%s: Command line arguments are not allowed.\n\0"
+/* 1619 */ "error %d (%s) creating %s\n\0"
+/* 1646 */ "%s error: '%s' does not match any %s keywords.\n\0"
+/* 1695 */ "%s error: The '%s' option requires an argument.\n\0"
+/* 1744 */ "error %d (%s) stat-ing %s\n\0"
+/* 1771 */ "%s error: no saved option state\n\0"
+/* 1804 */ "'%s' is not a command line option.\n\0"
+/* 1840 */ "%s error: '%s' is not a recognizable date/time.\n\0"
+/* 1890 */ "'%s' not defined\n\0"
+/* 1908 */ "%s error: '%s' is not a recognizable time duration.\n\0"
+/* 1962 */ "%s error: The %s option must appear %d times.\n\0"
+/* 2010 */ "%s error: '%s' is not a recognizable number.\n\0"
+/* 2057 */ "%s error: %s exceeds %s keyword count\n\0"
+/* 2097 */ "Try '%s %s' for more information.\n\0"
+/* 2132 */ "one %s%s option allowed\n\0"
+/* 2157 */ "standard output\0"
+/* 2173 */ "standard error\0"
+/* 2188 */ "write\0"
+/* 2194 */ "%s error: %s option value %ld is out of range.\n\0"
+/* 2243 */ "%s error: %s option requires the %s option\n\0"
+/* 2288 */ "%s warning: cannot save options - %s not regular file\n\0"
+/* 2344 */ "\t\t\t\t- an alternate for '%s'\n\0"
+/* 2373 */ "Version, usage and configuration options:\0"
+/* 2415 */ "\t\t\t\t- default option for unnamed options\n\0"
+/* 2457 */ "\t\t\t\t- disabled as '--%s'\n\0"
+/* 2483 */ " --- %-14s %s\n\0"
+/* 2498 */ "This option has been disabled\0"
+/* 2528 */ "\t\t\t\t- enabled by default\n\0"
+/* 2554 */ "%s error: only \0"
+/* 2571 */ " - examining environment variables named %s_*\n\0"
+/* 2618 */ "\t\t\t\t- file must not pre-exist\n\0"
+/* 2649 */ "\t\t\t\t- file must pre-exist\n\0"
+/* 2676 */ "Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n\0"
+/* 2779 */ "\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n\0"
+/* 2885 */ " or an integer mask with any of the lower %d bits set\n\0"
+/* 2941 */ "\t\t\t\t- is a set membership option\n\0"
+/* 2975 */ "\t\t\t\t- must appear between %d and %d times\n\0"
+/* 3018 */ "Options are specified by single or double hyphens and their name.\n\0"
+/* 3085 */ "\t\t\t\t- may appear multiple times\n\0"
+/* 3118 */ "\t\t\t\t- may not be preset\n\0"
+/* 3143 */ " Arg Option-Name Description\n\0"
+/* 3178 */ " Flg Arg Option-Name Description\n\0"
+/* 3216 */ " %3s %s\0"
+/* 3224 */ "The '-#<number>' option may omit the hash char\n\0"
+/* 3272 */ "All arguments are named options.\n\0"
+/* 3306 */ " - reading file %s\0"
+/* 3325 */ "\n"
+ "Please send bug reports to: <%s>\n\0"
+/* 3361 */ "\t\t\t\t- may NOT appear - preset only\n\0"
+/* 3397 */ "\n"
+ "The following option preset mechanisms are supported:\n\0"
+/* 3453 */ "prohibits these options:\n\0"
+/* 3479 */ "prohibits the option '%s'\n\0"
+/* 3506 */ "%s%ld to %ld\0"
+/* 3519 */ "%sgreater than or equal to %ld\0"
+/* 3550 */ "%s%ld exactly\0"
+/* 3564 */ "%sit must lie in one of the ranges:\n\0"
+/* 3601 */ "%sit must be in the range:\n\0"
+/* 3629 */ ", or\n\0"
+/* 3635 */ "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0"
+/* 3681 */ "%sless than or equal to %ld\0"
+/* 3709 */ "Operands and options may be intermixed. They will be reordered.\n\0"
+/* 3775 */ "requires the option '%s'\n\0"
+/* 3801 */ "requires these options:\n\0"
+/* 3826 */ " Arg Option-Name Req? Description\n\0"
+/* 3866 */ " Flg Arg Option-Name Req? Description\n\0"
+/* 3909 */ "or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n\0"
+/* 4128 */ "\t\t\t\t- may appear up to %d times\n\0"
+/* 4161 */ "The valid \"%s\" option keywords are:\n\0"
+/* 4198 */ "The next option supports vendor supported extra options:\0"
+/* 4255 */ "These additional options are:";
+
+/*
+ * Now, define (and initialize) the structure that contains
+ * the pointers to all these strings.
+ * Aren't you glad you don't maintain this by hand?
+ */
+usage_text_t option_xlateable_txt = {
+ 108,
+ eng_zGnuBoolArg, eng_zGnuKeyArg, eng_zGnuNumArg, eng_zGnuStrArg,
+ {
+ option_lib_text + 0, option_lib_text + 31, option_lib_text + 83,
+ option_lib_text + 129, option_lib_text + 228, option_lib_text + 264,
+ option_lib_text + 314, option_lib_text + 405, option_lib_text + 427,
+ option_lib_text + 484, option_lib_text + 519, option_lib_text + 564,
+ option_lib_text + 596, option_lib_text + 634, option_lib_text + 667,
+ option_lib_text + 716, option_lib_text + 748, option_lib_text + 800,
+ option_lib_text + 837, option_lib_text + 862, option_lib_text + 900,
+ option_lib_text + 918, option_lib_text + 1060, option_lib_text + 1107,
+ option_lib_text + 1146, option_lib_text + 1159, option_lib_text + 1185,
+ option_lib_text + 1211, option_lib_text + 1254, option_lib_text + 1290,
+ option_lib_text + 1335, option_lib_text + 1364, option_lib_text + 1407,
+ option_lib_text + 1490, option_lib_text + 1528, option_lib_text + 1574,
+ option_lib_text + 1619, option_lib_text + 1646, option_lib_text + 1695,
+ option_lib_text + 1744, option_lib_text + 1771, option_lib_text + 1804,
+ option_lib_text + 1840, option_lib_text + 1890, option_lib_text + 1908,
+ option_lib_text + 1962, option_lib_text + 2010, option_lib_text + 2057,
+ option_lib_text + 2097, option_lib_text + 2132, option_lib_text + 2157,
+ option_lib_text + 2173, option_lib_text + 2188, option_lib_text + 2194,
+ option_lib_text + 2243, option_lib_text + 2288, option_lib_text + 2344,
+ option_lib_text + 2373, option_lib_text + 2415, option_lib_text + 2457,
+ option_lib_text + 2483, option_lib_text + 2498, option_lib_text + 2528,
+ option_lib_text + 2554, option_lib_text + 2571, option_lib_text + 2618,
+ option_lib_text + 2649, option_lib_text + 2676, option_lib_text + 2779,
+ option_lib_text + 2885, option_lib_text + 2941, option_lib_text + 2975,
+ option_lib_text + 3018, option_lib_text + 3085, option_lib_text + 3118,
+ option_lib_text + 3143, option_lib_text + 3178, option_lib_text + 3216,
+ option_lib_text + 3224, option_lib_text + 3272, option_lib_text + 3306,
+ option_lib_text + 3325, option_lib_text + 3361, option_lib_text + 3397,
+ option_lib_text + 3453, option_lib_text + 3479, option_lib_text + 3506,
+ option_lib_text + 3519, option_lib_text + 3550, option_lib_text + 3564,
+ option_lib_text + 3601, option_lib_text + 3629, option_lib_text + 3635,
+ option_lib_text + 3681, option_lib_text + 3709, option_lib_text + 3775,
+ option_lib_text + 3801, option_lib_text + 3826, option_lib_text + 3866,
+ option_lib_text + 3909, option_lib_text + 4128, option_lib_text + 4161,
+ option_lib_text + 4198, option_lib_text + 4255
+ } };
+#endif /* AUTOOPTS_INTERNAL */
+
+#ifdef XGETTEXT_SCAN_DO_NOT_COMPILE
+do not compile this section.
+/* TRANSLATORS: The following dummy functions were crated solely so that
+ * xgettext can extract the correct strings. These strings are actually
+ * referenced where the preceding "#line" directive states, though you will
+ * not see the literal string there. The literal string is defined above in
+ * the @code{option_lib_text} table and referenced via a #define name that
+ * redirects into the @code{option_xlateable_txt} structure above. When
+ * translating is activated, the pointers in @code{option_xlateable_txt} are
+ * updated to point to translated strings.
+ */
+static void dummy_func(void) {
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 90 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 88 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 92 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* XGETTEXT_SCAN_DO_NOT_COMPILE */
+#endif /* AUTOOPTS_USAGE_TXT_H_GUARD */
diff --git a/sntp/libopts/boolean.c b/sntp/libopts/boolean.c
new file mode 100644
index 0000000..e83e518
--- /dev/null
+++ b/sntp/libopts/boolean.c
@@ -0,0 +1,95 @@
+
+/**
+ * \file boolean.c
+ *
+ * Handle options with true/false values for arguments.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This routine will run run-on options through a pager so the
+ * user may examine, print or edit them at their leisure.
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/*=export_func optionBooleanVal
+ * private:
+ *
+ * what: Decipher a boolean value
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * Decipher a true or false value for a boolean valued option argument.
+ * The value is true, unless it starts with 'n' or 'f' or "#f" or
+ * it is an empty string or it is a number that evaluates to zero.
+=*/
+void
+optionBooleanVal(tOptions * opts, tOptDesc * od)
+{
+ char* pz;
+ bool res = true;
+
+ if (INQUERY_CALL(opts, od))
+ return;
+
+ if (od->optArg.argString == NULL) {
+ od->optArg.argBool = false;
+ return;
+ }
+
+ switch (*(od->optArg.argString)) {
+ case '0':
+ {
+ long val = strtol(od->optArg.argString, &pz, 0);
+ if ((val != 0) || (*pz != NUL))
+ break;
+ /* FALLTHROUGH */
+ }
+ case 'N':
+ case 'n':
+ case 'F':
+ case 'f':
+ case NUL:
+ res = false;
+ break;
+ case '#':
+ if (od->optArg.argString[1] != 'f')
+ break;
+ res = false;
+ }
+
+ if (od->fOptState & OPTST_ALLOC_ARG) {
+ AGFREE(od->optArg.argString);
+ od->fOptState &= ~OPTST_ALLOC_ARG;
+ }
+ od->optArg.argBool = res;
+}
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/boolean.c */
diff --git a/sntp/libopts/check.c b/sntp/libopts/check.c
new file mode 100644
index 0000000..9b221a1
--- /dev/null
+++ b/sntp/libopts/check.c
@@ -0,0 +1,177 @@
+/**
+ * @file check.c
+ *
+ * @brief option consistency checks.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/**
+ * Check for conflicts based on "must" and "cannot" attributes.
+ */
+static bool
+has_conflict(tOptions * pOpts, tOptDesc * od)
+{
+ if (od->pOptMust != NULL) {
+ int const * must = od->pOptMust;
+
+ while (*must != NO_EQUIVALENT) {
+ tOptDesc * p = pOpts->pOptDesc + *(must++);
+ if (UNUSED_OPT(p)) {
+ const tOptDesc * ood = pOpts->pOptDesc + must[-1];
+ fprintf(stderr, zneed_fmt, pOpts->pzProgName,
+ od->pz_Name, ood->pz_Name);
+ return true;
+ }
+ }
+ }
+
+ if (od->pOptCant != NULL) {
+ int const * cant = od->pOptCant;
+
+ while (*cant != NO_EQUIVALENT) {
+ tOptDesc * p = pOpts->pOptDesc + *(cant++);
+ if (SELECTED_OPT(p)) {
+ const tOptDesc * ood = pOpts->pOptDesc + cant[-1];
+ fprintf(stderr, zconflict_fmt, pOpts->pzProgName,
+ od->pz_Name, ood->pz_Name);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Check that the option occurs often enough. Too often is already checked.
+ */
+static bool
+occurs_enough(tOptions * pOpts, tOptDesc * pOD)
+{
+ (void)pOpts;
+
+ /*
+ * IF the occurrence counts have been satisfied,
+ * THEN there is no problem.
+ */
+ if (pOD->optOccCt >= pOD->optMinCt)
+ return true;
+
+ /*
+ * IF MUST_SET means SET and PRESET are okay,
+ * so min occurrence count doesn't count
+ */
+ if ( (pOD->fOptState & OPTST_MUST_SET)
+ && (pOD->fOptState & (OPTST_PRESET | OPTST_SET)) )
+ return true;
+
+ if (pOD->optMinCt > 1)
+ fprintf(stderr, zneed_more, pOpts->pzProgName, pOD->pz_Name,
+ pOD->optMinCt);
+ else fprintf(stderr, zneed_one, pOpts->pzProgName, pOD->pz_Name);
+ return false;
+}
+
+/**
+ * Verify option consistency.
+ *
+ * Make sure that the argument list passes our consistency tests.
+ */
+LOCAL bool
+is_consistent(tOptions * pOpts)
+{
+ tOptDesc * pOD = pOpts->pOptDesc;
+ int oCt = pOpts->presetOptCt;
+
+ /*
+ * FOR each of "oCt" options, ...
+ */
+ for (;;) {
+ /*
+ * IF the current option was provided on the command line
+ * THEN ensure that any "MUST" requirements are not
+ * "DEFAULT" (unspecified) *AND* ensure that any
+ * "CANT" options have not been SET or DEFINED.
+ */
+ if (SELECTED_OPT(pOD)) {
+ if (has_conflict(pOpts, pOD))
+ return false;
+ }
+
+ /*
+ * IF this option is not equivalenced to another,
+ * OR it is equivalenced to itself (is the equiv. root)
+ * THEN we need to make sure it occurs often enough.
+ */
+ if ( (pOD->optEquivIndex == NO_EQUIVALENT)
+ || (pOD->optEquivIndex == pOD->optIndex) )
+
+ if (! occurs_enough(pOpts, pOD))
+ return false;
+
+ if (--oCt <= 0)
+ break;
+ pOD++;
+ }
+
+ /*
+ * IF we are stopping on errors, check to see if any remaining
+ * arguments are required to be there or prohibited from being there.
+ */
+ if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) {
+
+ /*
+ * Check for prohibition
+ */
+ if ((pOpts->fOptSet & OPTPROC_NO_ARGS) != 0) {
+ if (pOpts->origArgCt > pOpts->curOptIdx) {
+ fprintf(stderr, zNoArgs, pOpts->pzProgName);
+ return false;
+ }
+ }
+
+ /*
+ * ELSE not prohibited, check for being required
+ */
+ else if ((pOpts->fOptSet & OPTPROC_ARGS_REQ) != 0) {
+ if (pOpts->origArgCt <= pOpts->curOptIdx) {
+ fprintf(stderr, zargs_must, pOpts->pzProgName);
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/check.c */
diff --git a/sntp/libopts/compat/_Noreturn.h b/sntp/libopts/compat/_Noreturn.h
new file mode 100644
index 0000000..c44ad89
--- /dev/null
+++ b/sntp/libopts/compat/_Noreturn.h
@@ -0,0 +1,10 @@
+#if !defined _Noreturn && __STDC_VERSION__ < 201112
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
diff --git a/sntp/libopts/compat/compat.h b/sntp/libopts/compat/compat.h
new file mode 100644
index 0000000..69206a3
--- /dev/null
+++ b/sntp/libopts/compat/compat.h
@@ -0,0 +1,383 @@
+/* -*- Mode: C -*-
+ *
+ * compat.h is free software.
+ * This file is part of AutoGen and AutoOpts.
+ *
+ * AutoGen Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/**
+ * \file compat.h
+ * fake the preprocessor into handlng stuff portability
+ */
+#ifndef COMPAT_H_GUARD
+#define COMPAT_H_GUARD 1
+
+#if defined(HAVE_CONFIG_H)
+# include <config.h>
+
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+# include "windows-config.h"
+
+#else
+# error "compat.h" requires "config.h"
+ choke me.
+#endif
+
+
+#ifndef HAVE_STRSIGNAL
+# ifndef HAVE_RAW_DECL_STRSIGNAL
+ char * strsignal(int signo);
+# endif
+#endif
+
+#define _GNU_SOURCE 1 /* for strsignal in GNU's libc */
+#define __USE_GNU 1 /* exact same thing as above */
+#define __EXTENSIONS__ 1 /* and another way to call for it */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * SYSTEM HEADERS:
+ */
+#include <sys/types.h>
+#ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+#endif
+#include <sys/param.h>
+#if HAVE_SYS_PROCSET_H
+# include <sys/procset.h>
+#endif
+#include <sys/stat.h>
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#if defined( HAVE_SOLARIS_SYSINFO )
+# include <sys/systeminfo.h>
+#elif defined( HAVE_UNAME_SYSCALL )
+# include <sys/utsname.h>
+#endif
+
+#ifdef DAEMON_ENABLED
+# if HAVE_SYS_STROPTS_H
+# include <sys/stropts.h>
+# endif
+
+# if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+# endif
+
+# if ! defined(HAVE_SYS_POLL_H) && ! defined(HAVE_SYS_SELECT_H)
+# error This system cannot support daemon processing
+ Choke Me.
+# endif
+
+# if HAVE_SYS_POLL_H
+# include <sys/poll.h>
+# endif
+
+# if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+# endif
+
+# if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+# endif
+
+# if HAVE_SYS_UN_H
+# include <sys/un.h>
+# endif
+#endif
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * USER HEADERS:
+ */
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+/*
+ * Directory opening stuff:
+ */
+# if defined (_POSIX_SOURCE)
+/* Posix does not require that the d_ino field be present, and some
+ systems do not provide it. */
+# define REAL_DIR_ENTRY(dp) 1
+# else /* !_POSIX_SOURCE */
+# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
+# endif /* !_POSIX_SOURCE */
+
+# if defined (HAVE_DIRENT_H)
+# include <dirent.h>
+# define D_NAMLEN(dirent) strlen((dirent)->d_name)
+# else /* !HAVE_DIRENT_H */
+# define dirent direct
+# define D_NAMLEN(dirent) (dirent)->d_namlen
+# if defined (HAVE_SYS_NDIR_H)
+# include <sys/ndir.h>
+# endif /* HAVE_SYS_NDIR_H */
+# if defined (HAVE_SYS_DIR_H)
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+# if defined (HAVE_NDIR_H)
+# include <ndir.h>
+# endif /* HAVE_NDIR_H */
+# endif /* !HAVE_DIRENT_H */
+
+#include <errno.h>
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#ifndef O_NONBLOCK
+# define O_NONBLOCK FNDELAY
+#endif
+
+#if defined(HAVE_LIBGEN) && defined(HAVE_LIBGEN_H)
+# include <libgen.h>
+#endif
+
+#if defined(HAVE_LIMITS_H) /* this is also in options.h */
+# include <limits.h>
+#elif defined(HAVE_SYS_LIMITS_H)
+# include <sys/limits.h>
+#endif /* HAVE_LIMITS/SYS_LIMITS_H */
+
+#include <memory.h>
+#include <setjmp.h>
+#include <signal.h>
+
+#if defined(HAVE_STDINT_H)
+# include <stdint.h>
+
+#elif defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#ifdef HAVE_UTIME_H
+# include <utime.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+ typedef enum { false = 0, true = 1 } _Bool;
+# define bool _Bool
+
+ /* The other macros must be usable in preprocessor directives. */
+# define false 0
+# define true 1
+#endif
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * FIXUPS and CONVIENCE STUFF:
+ */
+#ifdef __cplusplus
+# define EXTERN extern "C"
+#else
+# define EXTERN extern
+#endif
+
+/* some systems #def errno! and others do not declare it!! */
+#ifndef errno
+ extern int errno;
+#endif
+
+/* Some machines forget this! */
+
+# ifndef EXIT_FAILURE
+# define EXIT_SUCCESS 0
+# define EXIT_FAILURE 1
+# endif
+
+#ifndef NUL
+# define NUL '\0'
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+#if !defined (MAXPATHLEN) && defined (HAVE_SYS_PARAM_H)
+# include <sys/param.h>
+#endif /* !MAXPATHLEN && HAVE_SYS_PARAM_H */
+
+#if !defined (MAXPATHLEN) && defined (PATH_MAX)
+# define MAXPATHLEN PATH_MAX
+#endif /* !MAXPATHLEN && PATH_MAX */
+
+#if !defined (MAXPATHLEN) && defined(_MAX_PATH)
+# define PATH_MAX _MAX_PATH
+# define MAXPATHLEN _MAX_PATH
+#endif
+
+#if !defined (MAXPATHLEN)
+# define MAXPATHLEN 4096
+#endif /* MAXPATHLEN */
+
+#define AG_PATH_MAX ((size_t)MAXPATHLEN)
+
+#ifndef LONG_MAX
+# define LONG_MAX ~(1L << (8*sizeof(long) -1))
+# define INT_MAX ~(1 << (8*sizeof(int) -1))
+#endif
+
+#ifndef ULONG_MAX
+# define ULONG_MAX ~(OUL)
+# define UINT_MAX ~(OU)
+#endif
+
+#ifndef SHORT_MAX
+# define SHORT_MAX ~(1 << (8*sizeof(short) - 1))
+#else
+# define USHORT_MAX ~(OUS)
+#endif
+
+#ifndef HAVE_INT8_T
+ typedef signed char int8_t;
+# define HAVE_INT8_T 1
+#endif
+#ifndef HAVE_UINT8_T
+ typedef unsigned char uint8_t;
+# define HAVE_UINT8_T 1
+#endif
+#ifndef HAVE_INT16_T
+ typedef signed short int16_t;
+# define HAVE_INT16_T 1
+#endif
+#ifndef HAVE_UINT16_T
+ typedef unsigned short uint16_t;
+# define HAVE_UINT16_T 1
+#endif
+
+#ifndef HAVE_INT32_T
+# if SIZEOF_INT == 4
+ typedef signed int int32_t;
+# elif SIZEOF_LONG == 4
+ typedef signed long int32_t;
+# endif
+# define HAVE_INT32_T 1
+#endif
+
+#ifndef HAVE_UINT32_T
+# if SIZEOF_INT == 4
+ typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+ typedef unsigned long uint32_t;
+# else
+# error Cannot create a uint32_t type.
+ Choke Me.
+# endif
+# define HAVE_UINT32_T 1
+#endif
+
+#ifndef HAVE_INTPTR_T
+# if SIZEOF_CHARP == SIZEOF_LONG
+ typedef signed long intptr_t;
+# else
+ typedef signed int intptr_t;
+# endif
+# define HAVE_INTPTR_T 1
+#endif
+
+#ifndef HAVE_UINTPTR_T
+# if SIZEOF_CHARP == SIZEOF_LONG
+ typedef unsigned long intptr_t;
+# else
+ typedef unsigned int intptr_t;
+# endif
+# define HAVE_INTPTR_T 1
+#endif
+
+#ifndef HAVE_UINT_T
+ typedef unsigned int uint_t;
+# define HAVE_UINT_T 1
+#endif
+
+#ifndef HAVE_SIZE_T
+ typedef unsigned int size_t;
+# define HAVE_SIZE_T 1
+#endif
+#ifndef HAVE_WINT_T
+ typedef unsigned int wint_t;
+# define HAVE_WINT_T 1
+#endif
+#ifndef HAVE_PID_T
+ typedef signed int pid_t;
+# define HAVE_PID_T 1
+#endif
+
+/* redefine these for BSD style string libraries */
+#ifndef HAVE_STRCHR
+# define strchr index
+# define strrchr rindex
+#endif
+
+#ifdef USE_FOPEN_BINARY
+# ifndef FOPEN_BINARY_FLAG
+# define FOPEN_BINARY_FLAG "b"
+# endif
+# ifndef FOPEN_TEXT_FLAG
+# define FOPEN_TEXT_FLAG "t"
+# endif
+#else
+# ifndef FOPEN_BINARY_FLAG
+# define FOPEN_BINARY_FLAG
+# endif
+# ifndef FOPEN_TEXT_FLAG
+# define FOPEN_TEXT_FLAG
+# endif
+#endif
+
+#ifndef STR
+# define _STR(s) #s
+# define STR(s) _STR(s)
+#endif
+
+/* ##### Pointer sized word ##### */
+
+/* FIXME: the MAX stuff in here is broken! */
+#if SIZEOF_CHARP > SIZEOF_INT
+ typedef long t_word;
+ #define WORD_MAX LONG_MAX
+ #define WORD_MIN LONG_MIN
+#else /* SIZEOF_CHARP <= SIZEOF_INT */
+ typedef int t_word;
+ #define WORD_MAX INT_MAX
+ #define WORD_MIN INT_MIN
+#endif
+
+#endif /* COMPAT_H_GUARD */
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of compat/compat.h */
diff --git a/sntp/libopts/compat/pathfind.c b/sntp/libopts/compat/pathfind.c
new file mode 100644
index 0000000..6554533
--- /dev/null
+++ b/sntp/libopts/compat/pathfind.c
@@ -0,0 +1,283 @@
+/* -*- Mode: C -*- */
+
+/* pathfind.c --- find a FILE MODE along PATH */
+
+/* Author: Gary V Vaughan <gvaughan@oranda.demon.co.uk> */
+
+/* Code: */
+
+static char *
+pathfind( char const * path,
+ char const * fname,
+ char const * mode );
+
+#include "compat.h"
+#ifndef HAVE_PATHFIND
+#if defined(__windows__) && !defined(__CYGWIN__)
+static char *
+pathfind( char const * path,
+ char const * fname,
+ char const * mode )
+{
+ return strdup(fname);
+}
+#else
+
+static char* make_absolute( char const *string, char const *dot_path );
+static char* canonicalize_pathname( char *path );
+static char* extract_colon_unit( char* dir, char const *string, int *p_index );
+
+/**
+ * local implementation of pathfind.
+ * @param[in] path colon separated list of directories
+ * @param[in] fname the name we are hunting for
+ * @param[in] mode the required file mode
+ * @returns an allocated string with the full path, or NULL
+ */
+static char *
+pathfind( char const * path,
+ char const * fname,
+ char const * mode )
+{
+ int p_index = 0;
+ int mode_bits = 0;
+ char * res_path = NULL;
+ char zPath[ AG_PATH_MAX + 1 ];
+
+ if (strchr( mode, 'r' )) mode_bits |= R_OK;
+ if (strchr( mode, 'w' )) mode_bits |= W_OK;
+ if (strchr( mode, 'x' )) mode_bits |= X_OK;
+
+ /*
+ * FOR each non-null entry in the colon-separated path, DO ...
+ */
+ for (;;) {
+ DIR* dirP;
+ char* colon_unit = extract_colon_unit( zPath, path, &p_index );
+
+ if (colon_unit == NULL)
+ break;
+
+ dirP = opendir( colon_unit );
+
+ /*
+ * IF the directory is inaccessable, THEN next directory
+ */
+ if (dirP == NULL)
+ continue;
+
+ for (;;) {
+ struct dirent *entP = readdir( dirP );
+
+ if (entP == (struct dirent*)NULL)
+ break;
+
+ /*
+ * IF the file name matches the one we are looking for, ...
+ */
+ if (strcmp(entP->d_name, fname) == 0) {
+ char * abs_name = make_absolute(fname, colon_unit);
+
+ /*
+ * Make sure we can access it in the way we want
+ */
+ if (access(abs_name, mode_bits) >= 0) {
+ /*
+ * We can, so normalize the name and return it below
+ */
+ res_path = canonicalize_pathname(abs_name);
+ }
+
+ free(abs_name);
+ break;
+ }
+ }
+
+ closedir( dirP );
+
+ if (res_path != NULL)
+ break;
+ }
+
+ return res_path;
+}
+
+/*
+ * Turn STRING (a pathname) into an absolute pathname, assuming that
+ * DOT_PATH contains the symbolic location of `.'. This always returns
+ * a new string, even if STRING was an absolute pathname to begin with.
+ */
+static char*
+make_absolute( char const *string, char const *dot_path )
+{
+ char *result;
+ int result_len;
+
+ if (!dot_path || *string == '/') {
+ result = strdup( string );
+ } else {
+ if (dot_path && dot_path[0]) {
+ result = malloc( 2 + strlen( dot_path ) + strlen( string ) );
+ strcpy( result, dot_path );
+ result_len = (int)strlen(result);
+ if (result[result_len - 1] != '/') {
+ result[result_len++] = '/';
+ result[result_len] = '\0';
+ }
+ } else {
+ result = malloc( 3 + strlen( string ) );
+ result[0] = '.'; result[1] = '/'; result[2] = '\0';
+ result_len = 2;
+ }
+
+ strcpy( result + result_len, string );
+ }
+
+ return result;
+}
+
+/*
+ * Canonicalize PATH, and return a new path. The new path differs from
+ * PATH in that:
+ *
+ * Multiple `/'s are collapsed to a single `/'.
+ * Leading `./'s are removed.
+ * Trailing `/.'s are removed.
+ * Trailing `/'s are removed.
+ * Non-leading `../'s and trailing `..'s are handled by removing
+ * portions of the path.
+ */
+static char*
+canonicalize_pathname( char *path )
+{
+ int i, start;
+ char stub_char, *result;
+
+ /* The result cannot be larger than the input PATH. */
+ result = strdup( path );
+
+ stub_char = (*path == '/') ? '/' : '.';
+
+ /* Walk along RESULT looking for things to compact. */
+ i = 0;
+ while (result[i]) {
+ while (result[i] != '\0' && result[i] != '/')
+ i++;
+
+ start = i++;
+
+ /* If we didn't find any slashes, then there is nothing left to
+ * do.
+ */
+ if (!result[start])
+ break;
+
+ /* Handle multiple `/'s in a row. */
+ while (result[i] == '/')
+ i++;
+
+#if !defined (apollo)
+ if ((start + 1) != i)
+#else
+ if ((start + 1) != i && (start != 0 || i != 2))
+#endif /* apollo */
+ {
+ strcpy( result + start + 1, result + i );
+ i = start + 1;
+ }
+
+ /* Handle backquoted `/'. */
+ if (start > 0 && result[start - 1] == '\\')
+ continue;
+
+ /* Check for trailing `/', and `.' by itself. */
+ if ((start && !result[i])
+ || (result[i] == '.' && !result[i+1])) {
+ result[--i] = '\0';
+ break;
+ }
+
+ /* Check for `../', `./' or trailing `.' by itself. */
+ if (result[i] == '.') {
+ /* Handle `./'. */
+ if (result[i + 1] == '/') {
+ strcpy( result + i, result + i + 1 );
+ i = (start < 0) ? 0 : start;
+ continue;
+ }
+
+ /* Handle `../' or trailing `..' by itself. */
+ if (result[i + 1] == '.' &&
+ (result[i + 2] == '/' || !result[i + 2])) {
+ while (--start > -1 && result[start] != '/')
+ ;
+ strcpy( result + start + 1, result + i + 2 );
+ i = (start < 0) ? 0 : start;
+ continue;
+ }
+ }
+ }
+
+ if (!*result) {
+ *result = stub_char;
+ result[1] = '\0';
+ }
+
+ return result;
+}
+
+/*
+ * Given a string containing units of information separated by colons,
+ * return the next one pointed to by (P_INDEX), or NULL if there are no
+ * more. Advance (P_INDEX) to the character after the colon.
+ */
+static char*
+extract_colon_unit( char* pzDir, char const *string, int *p_index )
+{
+ char * pzDest = pzDir;
+ int ix = *p_index;
+
+ if (string == NULL)
+ return NULL;
+
+ if ((unsigned)ix >= strlen( string ))
+ return NULL;
+
+ {
+ char const * pzSrc = string + ix;
+
+ while (*pzSrc == ':') pzSrc++;
+
+ for (;;) {
+ char ch = (*(pzDest++) = *(pzSrc++));
+ switch (ch) {
+ case ':':
+ pzDest[-1] = NUL;
+ /* FALLTHROUGH */
+ case NUL:
+ goto copy_done;
+ }
+
+ if ((unsigned long)(pzDest - pzDir) >= AG_PATH_MAX)
+ break;
+ } copy_done:;
+
+ ix = (int)(pzSrc - string);
+ }
+
+ if (*pzDir == NUL)
+ return NULL;
+
+ *p_index = ix;
+ return pzDir;
+}
+#endif /* __windows__ / __CYGWIN__ */
+#endif /* HAVE_PATHFIND */
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of compat/pathfind.c */
diff --git a/sntp/libopts/compat/snprintf.c b/sntp/libopts/compat/snprintf.c
new file mode 100644
index 0000000..eccea1f
--- /dev/null
+++ b/sntp/libopts/compat/snprintf.c
@@ -0,0 +1,62 @@
+
+#ifndef HAVE_VPRINTF
+#include "choke-me: no vprintf and no snprintf"
+ choke me.
+#endif
+
+#if defined(HAVE_STDARG_H)
+# include <stdarg.h>
+# ifndef VA_START
+# define VA_START(a, f) va_start(a, f)
+# define VA_END(a) va_end(a)
+# endif /* VA_START */
+# define SNV_USING_STDARG_H
+
+#elif defined(HAVE_VARARGS_H)
+# include <varargs.h>
+# ifndef VA_START
+# define VA_START(a, f) va_start(a)
+# define VA_END(a) va_end(a)
+# endif /* VA_START */
+# undef SNV_USING_STDARG_H
+
+#else
+# include "must-have-stdarg-or-varargs"
+ choke me.
+#endif
+
+static int
+snprintf(char *str, size_t n, char const *fmt, ...)
+{
+ va_list ap;
+ int rval;
+
+#ifdef VSPRINTF_CHARSTAR
+ char *rp;
+ VA_START(ap, fmt);
+ rp = vsprintf(str, fmt, ap);
+ VA_END(ap);
+ rval = strlen(rp);
+
+#else
+ VA_START(ap, fmt);
+ rval = vsprintf(str, fmt, ap);
+ VA_END(ap);
+#endif
+
+ if (rval > n) {
+ fprintf(stderr, "snprintf buffer overrun %d > %d\n", rval, (int)n);
+ abort();
+ }
+ return rval;
+}
+
+static int
+vsnprintf( char *str, size_t n, char const *fmt, va_list ap )
+{
+#ifdef VSPRINTF_CHARSTAR
+ return (strlen(vsprintf(str, fmt, ap)));
+#else
+ return (vsprintf(str, fmt, ap));
+#endif
+}
diff --git a/sntp/libopts/compat/strchr.c b/sntp/libopts/compat/strchr.c
new file mode 100644
index 0000000..f409387
--- /dev/null
+++ b/sntp/libopts/compat/strchr.c
@@ -0,0 +1,66 @@
+/*
+ SYNOPSIS
+ #include <string.h>
+
+ char *strchr(char const *s, int c);
+
+ char *strrchr(char const *s, int c);
+
+ DESCRIPTION
+ The strchr() function returns a pointer to the first occurrence of the
+ character c in the string s.
+
+ The strrchr() function returns a pointer to the last occurrence of the
+ character c in the string s.
+
+ Here "character" means "byte" - these functions do not work with wide
+ or multi-byte characters.
+
+ RETURN VALUE
+ The strchr() and strrchr() functions return a pointer to the matched
+ character or NULL if the character is not found.
+
+ CONFORMING TO
+ SVID 3, POSIX, BSD 4.3, ISO 9899
+*/
+
+static char *
+strchr(char const *s, int c);
+
+static char *
+strrchr(char const *s, int c);
+
+static char *
+strchr(char const *s, int c)
+{
+ do {
+ if ((unsigned char)*s == (unsigned char)c)
+ return s;
+
+ } while (*(++s) != NUL);
+
+ return NULL;
+}
+
+static char *
+strrchr(char const *s, int c)
+{
+ char const *e = s + strlen(s);
+
+ for (;;) {
+ if (--e < s)
+ break;
+
+ if ((unsigned char)*e == (unsigned char)c)
+ return e;
+ }
+ return NULL;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of compat/strsignal.c */
diff --git a/sntp/libopts/compat/strdup.c b/sntp/libopts/compat/strdup.c
new file mode 100644
index 0000000..f3a4077
--- /dev/null
+++ b/sntp/libopts/compat/strdup.c
@@ -0,0 +1,22 @@
+/*
+ * Platforms without strdup ?!?!?!
+ */
+
+static char *
+strdup( char const *s );
+
+static char *
+strdup( char const *s )
+{
+ char *cp;
+
+ if (s == NULL)
+ return NULL;
+
+ cp = (char *) AGALOC((unsigned) (strlen(s)+1), "strdup");
+
+ if (cp != NULL)
+ (void) strcpy(cp, s);
+
+ return cp;
+}
diff --git a/sntp/libopts/compat/windows-config.h b/sntp/libopts/compat/windows-config.h
new file mode 100644
index 0000000..78f3202
--- /dev/null
+++ b/sntp/libopts/compat/windows-config.h
@@ -0,0 +1,144 @@
+
+/**
+ * \file windows-config.h
+ *
+ * This file contains all of the routines that must be linked into
+ * an executable to use the generated option processing. The optional
+ * routines are in separately compiled modules so that they will not
+ * necessarily be linked in.
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+#ifndef WINDOWS_CONFIG_HACKERY
+#define WINDOWS_CONFIG_HACKERY 1
+
+/*
+ * The definitions below have been stolen from NTP's config.h for Windows.
+ * However, they may be kept here in order to keep libopts independent from
+ * the NTP project.
+ */
+#ifndef __windows__
+# define __windows__ 4
+#endif
+
+/*
+ * Miscellaneous functions that Microsoft maps to other names
+ */
+#define snprintf _snprintf
+
+#define SIZEOF_INT 4
+#define SIZEOF_CHARP 4
+#define SIZEOF_LONG 4
+#define SIZEOF_SHORT 2
+
+#define HAVE_LIMITS_H 1
+#define HAVE_STRDUP 1
+#define HAVE_STRCHR 1
+#define HAVE_FCNTL_H 1
+
+/*
+ * VS.NET's version of wspiapi.h has a bug in it where it assigns a value
+ * to a variable inside an if statement. It should be comparing them.
+ * We prevent inclusion since we are not using this code so we don't have
+ * to see the warning messages
+ */
+#ifndef _WSPIAPI_H_
+#define _WSPIAPI_H_
+#endif
+
+/* Prevent inclusion of winsock.h in windows.h */
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_
+#endif
+
+#ifndef __RPCASYNC_H__
+#define __RPCASYNC_H__
+#endif
+
+/* Include Windows headers */
+#include <windows.h>
+#include <winsock2.h>
+#include <limits.h>
+
+/*
+ * Compatibility declarations for Windows, assuming SYS_WINNT
+ * has been defined.
+ */
+#define strdup _strdup
+#define stat _stat /* struct stat from <sys/stat.h> */
+#define unlink _unlink
+#define fchmod( _x, _y )
+#define ssize_t SSIZE_T
+
+#include <io.h>
+#define open _open
+#define close _close
+#define read _read
+#define write _write
+#define lseek _lseek
+#define pipe _pipe
+#define dup2 _dup2
+
+#define O_RDWR _O_RDWR
+#define O_RDONLY _O_RDONLY
+#define O_EXCL _O_EXCL
+
+#ifndef S_ISREG
+# define S_IFREG _S_IFREG
+# define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG)
+#endif
+
+#ifndef S_ISDIR
+# define S_IFDIR _S_IFDIR
+# define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR)
+#endif
+
+/* C99 exact size integer support. */
+#if defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+
+#elif defined(HAVE_STDINT_H)
+# include <stdint.h>
+# define MISSING_INTTYPES_H 1
+
+#elif ! defined(ADDED_EXACT_SIZE_INTEGERS)
+# define ADDED_EXACT_SIZE_INTEGERS 1
+# define MISSING_INTTYPES_H 1
+
+ typedef __int8 int8_t;
+ typedef unsigned __int8 uint8_t;
+
+ typedef __int16 int16_t;
+ typedef unsigned __int16 uint16_t;
+
+ typedef __int32 int32_t;
+ typedef unsigned __int32 uint32_t;
+
+ typedef __int64 int64_t;
+ typedef unsigned __int64 uint64_t;
+
+ typedef unsigned long uintptr_t;
+ typedef long intptr_t;
+#endif
+
+#endif /* WINDOWS_CONFIG_HACKERY */
+/* windows-config.h ends here */
diff --git a/sntp/libopts/configfile.c b/sntp/libopts/configfile.c
new file mode 100644
index 0000000..d4bc4fe
--- /dev/null
+++ b/sntp/libopts/configfile.c
@@ -0,0 +1,1382 @@
+/**
+ * \file configfile.c
+ *
+ * configuration/rc/ini file handling.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static void
+file_preset(tOptions * opts, char const * fname, int dir);
+
+static char *
+handle_comment(char* txt);
+
+static char *
+handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir);
+
+static char *
+handle_directive(tOptions * opts, char * txt);
+
+static char *
+aoflags_directive(tOptions * opts, char * txt);
+
+static char *
+program_directive(tOptions * opts, char * txt);
+
+static char *
+handle_section(tOptions * opts, char * txt);
+
+static int
+parse_xml_encoding(char ** ppz);
+
+static char *
+trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode);
+
+static void
+cook_xml_text(char * pzData);
+
+static char *
+handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir);
+
+static char const *
+parse_keyword(tOptions * opts, char const * txt, tOptionValue * typ);
+
+static char const *
+parse_set_mem(tOptions * opts, char const * txt, tOptionValue * typ);
+
+static char const *
+parse_value(char const * txt, tOptionValue * typ);
+/* = = = END-STATIC-FORWARD = = = */
+
+/**
+ * Skip over some unknown attribute
+ * @param[in] txt start of skpped text
+ * @returns character after skipped text
+ */
+inline static char const *
+skip_unkn(char const * txt)
+{
+ txt = BRK_END_XML_TOKEN_CHARS(txt);
+ return (*txt == NUL) ? NULL : txt;
+}
+
+/*=export_func configFileLoad
+ *
+ * what: parse a configuration file
+ * arg: + char const* + fname + the file to load +
+ *
+ * ret_type: const tOptionValue*
+ * ret_desc: An allocated, compound value structure
+ *
+ * doc:
+ * This routine will load a named configuration file and parse the
+ * text as a hierarchically valued option. The option descriptor
+ * created from an option definition file is not used via this interface.
+ * The returned value is "named" with the input file name and is of
+ * type "@code{OPARG_TYPE_HIERARCHY}". It may be used in calls to
+ * @code{optionGetValue()}, @code{optionNextValue()} and
+ * @code{optionUnloadNested()}.
+ *
+ * err:
+ * If the file cannot be loaded or processed, @code{NULL} is returned and
+ * @var{errno} is set. It may be set by a call to either @code{open(2)}
+ * @code{mmap(2)} or other file system calls, or it may be:
+ * @itemize @bullet
+ * @item
+ * @code{ENOENT} - the file was not found.
+ * @item
+ * @code{ENOMSG} - the file was empty.
+ * @item
+ * @code{EINVAL} - the file contents are invalid -- not properly formed.
+ * @item
+ * @code{ENOMEM} - not enough memory to allocate the needed structures.
+ * @end itemize
+=*/
+const tOptionValue *
+configFileLoad(char const * fname)
+{
+ tmap_info_t cfgfile;
+ tOptionValue * res = NULL;
+ tOptionLoadMode save_mode = option_load_mode;
+
+ char * txt = text_mmap(fname, PROT_READ, MAP_PRIVATE, &cfgfile);
+
+ if (TEXT_MMAP_FAILED_ADDR(txt))
+ return NULL; /* errno is set */
+
+ option_load_mode = OPTION_LOAD_COOKED;
+ res = optionLoadNested(txt, fname, strlen(fname));
+
+ if (res == NULL) {
+ int err = errno;
+ text_munmap(&cfgfile);
+ errno = err;
+ } else
+ text_munmap(&cfgfile);
+
+ option_load_mode = save_mode;
+ return res;
+}
+
+
+/*=export_func optionFindValue
+ *
+ * what: find a hierarcicaly valued option instance
+ * arg: + const tOptDesc* + odesc + an option with a nested arg type +
+ * arg: + char const* + name + name of value to find +
+ * arg: + char const* + val + the matching value +
+ *
+ * ret_type: const tOptionValue*
+ * ret_desc: a compound value structure
+ *
+ * doc:
+ * This routine will find an entry in a nested value option or configurable.
+ * It will search through the list and return a matching entry.
+ *
+ * err:
+ * The returned result is NULL and errno is set:
+ * @itemize @bullet
+ * @item
+ * @code{EINVAL} - the @code{pOptValue} does not point to a valid
+ * hierarchical option value.
+ * @item
+ * @code{ENOENT} - no entry matched the given name.
+ * @end itemize
+=*/
+const tOptionValue *
+optionFindValue(const tOptDesc * odesc, char const * name, char const * val)
+{
+ const tOptionValue * res = NULL;
+
+ if ( (odesc == NULL)
+ || (OPTST_GET_ARGTYPE(odesc->fOptState) != OPARG_TYPE_HIERARCHY)) {
+ errno = EINVAL;
+ }
+
+ else if (odesc->optCookie == NULL) {
+ errno = ENOENT;
+ }
+
+ else do {
+ tArgList* argl = odesc->optCookie;
+ int argct = argl->useCt;
+ void ** poptv = (void**)(argl->apzArgs);
+
+ if (argct == 0) {
+ errno = ENOENT;
+ break;
+ }
+
+ if (name == NULL) {
+ res = (tOptionValue*)*poptv;
+ break;
+ }
+
+ while (--argct >= 0) {
+ const tOptionValue * ov = *(poptv++);
+ const tOptionValue * rv = optionGetValue(ov, name);
+
+ if (rv == NULL)
+ continue;
+
+ if (val == NULL) {
+ res = ov;
+ break;
+ }
+ }
+ if (res == NULL)
+ errno = ENOENT;
+ } while (false);
+
+ return res;
+}
+
+
+/*=export_func optionFindNextValue
+ *
+ * FIXME: the handling of 'pzName' and 'pzVal' is just wrong.
+ *
+ * what: find a hierarcicaly valued option instance
+ * arg: + const tOptDesc* + odesc + an option with a nested arg type +
+ * arg: + const tOptionValue* + pPrevVal + the last entry +
+ * arg: + char const* + name + name of value to find +
+ * arg: + char const* + value + the matching value +
+ *
+ * ret_type: const tOptionValue*
+ * ret_desc: a compound value structure
+ *
+ * doc:
+ * This routine will find the next entry in a nested value option or
+ * configurable. It will search through the list and return the next entry
+ * that matches the criteria.
+ *
+ * err:
+ * The returned result is NULL and errno is set:
+ * @itemize @bullet
+ * @item
+ * @code{EINVAL} - the @code{pOptValue} does not point to a valid
+ * hierarchical option value.
+ * @item
+ * @code{ENOENT} - no entry matched the given name.
+ * @end itemize
+=*/
+tOptionValue const *
+optionFindNextValue(const tOptDesc * odesc, const tOptionValue * pPrevVal,
+ char const * pzName, char const * pzVal)
+{
+ bool old_found = false;
+ tOptionValue* res = NULL;
+
+ (void)pzName;
+ (void)pzVal;
+
+ if ( (odesc == NULL)
+ || (OPTST_GET_ARGTYPE(odesc->fOptState) != OPARG_TYPE_HIERARCHY)) {
+ errno = EINVAL;
+ }
+
+ else if (odesc->optCookie == NULL) {
+ errno = ENOENT;
+ }
+
+ else do {
+ tArgList* argl = odesc->optCookie;
+ int ct = argl->useCt;
+ void** poptv = (void**)argl->apzArgs;
+
+ while (--ct >= 0) {
+ tOptionValue* pOV = *(poptv++);
+ if (old_found) {
+ res = pOV;
+ break;
+ }
+ if (pOV == pPrevVal)
+ old_found = true;
+ }
+ if (res == NULL)
+ errno = ENOENT;
+ } while (false);
+
+ return res;
+}
+
+
+/*=export_func optionGetValue
+ *
+ * what: get a specific value from a hierarcical list
+ * arg: + const tOptionValue* + pOptValue + a hierarchcal value +
+ * arg: + char const* + valueName + name of value to get +
+ *
+ * ret_type: const tOptionValue*
+ * ret_desc: a compound value structure
+ *
+ * doc:
+ * This routine will find an entry in a nested value option or configurable.
+ * If "valueName" is NULL, then the first entry is returned. Otherwise,
+ * the first entry with a name that exactly matches the argument will be
+ * returned. If there is no matching value, NULL is returned and errno is
+ * set to ENOENT. If the provided option value is not a hierarchical value,
+ * NULL is also returned and errno is set to EINVAL.
+ *
+ * err:
+ * The returned result is NULL and errno is set:
+ * @itemize @bullet
+ * @item
+ * @code{EINVAL} - the @code{pOptValue} does not point to a valid
+ * hierarchical option value.
+ * @item
+ * @code{ENOENT} - no entry matched the given name.
+ * @end itemize
+=*/
+tOptionValue const *
+optionGetValue(tOptionValue const * oov, char const * vname)
+{
+ tArgList * arg_list;
+ tOptionValue * res = NULL;
+
+ if ((oov == NULL) || (oov->valType != OPARG_TYPE_HIERARCHY)) {
+ errno = EINVAL;
+ return res;
+ }
+ arg_list = oov->v.nestVal;
+
+ if (arg_list->useCt > 0) {
+ int ct = arg_list->useCt;
+ void ** ovlist = (void**)(arg_list->apzArgs);
+
+ if (vname == NULL) {
+ res = (tOptionValue*)*ovlist;
+
+ } else do {
+ tOptionValue * opt_val = *(ovlist++);
+ if (strcmp(opt_val->pzName, vname) == 0) {
+ res = opt_val;
+ break;
+ }
+ } while (--ct > 0);
+ }
+ if (res == NULL)
+ errno = ENOENT;
+ return res;
+}
+
+/*=export_func optionNextValue
+ *
+ * what: get the next value from a hierarchical list
+ * arg: + const tOptionValue* + pOptValue + a hierarchcal list value +
+ * arg: + const tOptionValue* + pOldValue + a value from this list +
+ *
+ * ret_type: const tOptionValue*
+ * ret_desc: a compound value structure
+ *
+ * doc:
+ * This routine will return the next entry after the entry passed in. At the
+ * end of the list, NULL will be returned. If the entry is not found on the
+ * list, NULL will be returned and "@var{errno}" will be set to EINVAL.
+ * The "@var{pOldValue}" must have been gotten from a prior call to this
+ * routine or to "@code{opitonGetValue()}".
+ *
+ * err:
+ * The returned result is NULL and errno is set:
+ * @itemize @bullet
+ * @item
+ * @code{EINVAL} - the @code{pOptValue} does not point to a valid
+ * hierarchical option value or @code{pOldValue} does not point to a
+ * member of that option value.
+ * @item
+ * @code{ENOENT} - the supplied @code{pOldValue} pointed to the last entry.
+ * @end itemize
+=*/
+tOptionValue const *
+optionNextValue(tOptionValue const * ov_list,tOptionValue const * oov )
+{
+ tArgList * arg_list;
+ tOptionValue * res = NULL;
+ int err = EINVAL;
+
+ if ((ov_list == NULL) || (ov_list->valType != OPARG_TYPE_HIERARCHY)) {
+ errno = EINVAL;
+ return NULL;
+ }
+ arg_list = ov_list->v.nestVal;
+ {
+ int ct = arg_list->useCt;
+ void ** o_list = (void**)(arg_list->apzArgs);
+
+ while (ct-- > 0) {
+ tOptionValue * nov = *(o_list++);
+ if (nov == oov) {
+ if (ct == 0) {
+ err = ENOENT;
+
+ } else {
+ err = 0;
+ res = (tOptionValue*)*o_list;
+ }
+ break;
+ }
+ }
+ }
+ if (err != 0)
+ errno = err;
+ return res;
+}
+
+/**
+ * Load a file containing presetting information (a configuration file).
+ */
+static void
+file_preset(tOptions * opts, char const * fname, int dir)
+{
+ tmap_info_t cfgfile;
+ tOptState optst = OPTSTATE_INITIALIZER(PRESET);
+ opt_state_mask_t st_flags = optst.flags;
+ opt_state_mask_t fl_save = opts->fOptSet;
+ char * ftext =
+ text_mmap(fname, PROT_READ|PROT_WRITE, MAP_PRIVATE, &cfgfile);
+
+ if (TEXT_MMAP_FAILED_ADDR(ftext))
+ return;
+
+ /*
+ * While processing config files, we ignore errors.
+ */
+ opts->fOptSet &= ~OPTPROC_ERRSTOP;
+
+ if (dir == DIRECTION_CALLED) {
+ st_flags = OPTST_DEFINED;
+ dir = DIRECTION_PROCESS;
+ }
+
+ /*
+ * IF this is called via "optionProcess", then we are presetting.
+ * This is the default and the PRESETTING bit will be set.
+ * If this is called via "optionFileLoad", then the bit is not set
+ * and we consider stuff set herein to be "set" by the client program.
+ */
+ if ((opts->fOptSet & OPTPROC_PRESETTING) == 0)
+ st_flags = OPTST_SET;
+
+ do {
+ optst.flags = st_flags;
+ ftext = SPN_WHITESPACE_CHARS(ftext);
+
+ if (IS_VAR_FIRST_CHAR(*ftext)) {
+ ftext = handle_cfg(opts, &optst, ftext, dir);
+
+ } else switch (*ftext) {
+ case '<':
+ if (IS_VAR_FIRST_CHAR(ftext[1]))
+ ftext = handle_struct(opts, &optst, ftext, dir);
+
+ else switch (ftext[1]) {
+ case '?':
+ ftext = handle_directive(opts, ftext);
+ break;
+
+ case '!':
+ ftext = handle_comment(ftext);
+ break;
+
+ case '/':
+ ftext = strchr(ftext + 2, '>');
+ if (ftext++ != NULL)
+ break;
+
+ default:
+ ftext = NULL;
+ }
+ if (ftext == NULL)
+ goto all_done;
+ break;
+
+ case '[':
+ ftext = handle_section(opts, ftext);
+ break;
+
+ case '#':
+ ftext = strchr(ftext + 1, NL);
+ break;
+
+ default:
+ goto all_done; /* invalid format */
+ }
+ } while (ftext != NULL);
+
+ all_done:
+ text_munmap(&cfgfile);
+ opts->fOptSet = fl_save;
+}
+
+/**
+ * "txt" points to a "<!" sequence.
+ * Theoretically, we should ensure that it begins with "<!--",
+ * but actually I don't care that much. It ends with "-->".
+ */
+static char *
+handle_comment(char* txt)
+{
+ char* pz = strstr(txt, "-->");
+ if (pz != NULL)
+ pz += 3;
+ return pz;
+}
+
+/**
+ * "txt" points to the start of some value name.
+ * The end of the entry is the end of the line that is not preceded by
+ * a backslash escape character. The string value is always processed
+ * in "cooked" mode.
+ */
+static char *
+handle_cfg(tOptions * opts, tOptState * ost, char * txt, int dir)
+{
+ char* pzName = txt++;
+ char* pzEnd = strchr(txt, NL);
+
+ if (pzEnd == NULL)
+ return txt + strlen(txt);
+
+ txt = SPN_VALUE_NAME_CHARS(txt);
+ txt = SPN_WHITESPACE_CHARS(txt);
+ if (txt > pzEnd) {
+ name_only:
+ *pzEnd++ = NUL;
+ load_opt_line(opts, ost, pzName, dir, OPTION_LOAD_UNCOOKED);
+ return pzEnd;
+ }
+
+ /*
+ * Either the first character after the name is a ':' or '=',
+ * or else we must have skipped over white space. Anything else
+ * is an invalid format and we give up parsing the text.
+ */
+ if ((*txt == '=') || (*txt == ':')) {
+ txt = SPN_WHITESPACE_CHARS(txt+1);
+ if (txt > pzEnd)
+ goto name_only;
+ } else if (! IS_WHITESPACE_CHAR(txt[-1]))
+ return NULL;
+
+ /*
+ * IF the value is continued, remove the backslash escape and push "pzEnd"
+ * on to a newline *not* preceded by a backslash.
+ */
+ if (pzEnd[-1] == '\\') {
+ char* pcD = pzEnd-1;
+ char* pcS = pzEnd;
+
+ for (;;) {
+ char ch = *(pcS++);
+ switch (ch) {
+ case NUL:
+ pcS = NULL;
+ /* FALLTHROUGH */
+
+ case NL:
+ *pcD = NUL;
+ pzEnd = pcS;
+ goto copy_done;
+
+ case '\\':
+ if (*pcS == NL)
+ ch = *(pcS++);
+ /* FALLTHROUGH */
+ default:
+ *(pcD++) = ch;
+ }
+ } copy_done:;
+
+ } else {
+ /*
+ * The newline was not preceded by a backslash. NUL it out
+ */
+ *(pzEnd++) = NUL;
+ }
+
+ /*
+ * "pzName" points to what looks like text for one option/configurable.
+ * It is NUL terminated. Process it.
+ */
+ load_opt_line(opts, ost, pzName, dir, OPTION_LOAD_UNCOOKED);
+
+ return pzEnd;
+}
+
+/**
+ * "txt" points to a "<?" sequence.
+ * We handle "<?program" and "<?auto-options" directives.
+ * All others are treated as comments.
+ *
+ * @param[in,out] opts program option descriptor
+ * @param[in] txt scanning pointer
+ * @returns the next character to look at
+ */
+static char *
+handle_directive(tOptions * opts, char * txt)
+{
+# define DIRECTIVE_TABLE \
+ _dt_(zCfgProg, program_directive) \
+ _dt_(zCfgAO_Flags, aoflags_directive)
+
+ typedef char * (directive_func_t)(tOptions *, char *);
+# define _dt_(_s, _fn) _fn,
+ static directive_func_t * dir_disp[] = {
+ DIRECTIVE_TABLE
+ };
+# undef _dt_
+
+# define _dt_(_s, _fn) 1 +
+ static int const dir_ct = DIRECTIVE_TABLE 0;
+ static char const * dir_names[DIRECTIVE_TABLE 0];
+# undef _dt_
+
+ int ix;
+
+ if (dir_names[0] == NULL) {
+ ix = 0;
+# define _dt_(_s, _fn) dir_names[ix++] = _s;
+ DIRECTIVE_TABLE;
+# undef _dt_
+ }
+
+ for (ix = 0; ix < dir_ct; ix++) {
+ size_t len = strlen(dir_names[ix]);
+ if ( (strncmp(txt + 2, dir_names[ix], len) == 0)
+ && (! IS_VALUE_NAME_CHAR(txt[len+2])) )
+ return dir_disp[ix](opts, txt + len + 2);
+ }
+
+ /*
+ * We don't know what this is. Skip it.
+ */
+ txt = strchr(txt+2, '>');
+ if (txt != NULL)
+ txt++;
+ return txt;
+# undef DIRECTIVE_TABLE
+}
+
+/**
+ * handle AutoOpts mode flags.
+ *
+ * @param[in,out] opts program option descriptor
+ * @param[in] txt scanning pointer
+ * @returns the next character to look at
+ */
+static char *
+aoflags_directive(tOptions * opts, char * txt)
+{
+ char * pz;
+
+ pz = SPN_WHITESPACE_CHARS(txt+1);
+ txt = strchr(pz, '>');
+ if (txt != NULL) {
+
+ size_t len = (unsigned)(txt - pz);
+ char * ftxt = AGALOC(len + 1, "aoflags");
+
+ memcpy(ftxt, pz, len);
+ ftxt[len] = NUL;
+ set_usage_flags(opts, ftxt);
+ AGFREE(ftxt);
+
+ txt++;
+ }
+
+ return txt;
+}
+
+/**
+ * handle program segmentation of config file.
+ *
+ * @param[in,out] opts program option descriptor
+ * @param[in] txt scanning pointer
+ * @returns the next character to look at
+ */
+static char *
+program_directive(tOptions * opts, char * txt)
+{
+ static char const ttlfmt[] = "<?";
+ size_t ttl_len = sizeof(ttlfmt) + strlen(zCfgProg);
+ char * ttl = AGALOC(ttl_len, "prog title");
+ size_t name_len = strlen(opts->pzProgName);
+
+ memcpy(ttl, ttlfmt, sizeof(ttlfmt) - 1);
+ memcpy(ttl + sizeof(ttlfmt) - 1, zCfgProg, ttl_len - (sizeof(ttlfmt) - 1));
+
+ do {
+ txt = SPN_WHITESPACE_CHARS(txt+1);
+
+ if ( (strneqvcmp(txt, opts->pzProgName, (int)name_len) == 0)
+ && (IS_END_XML_TOKEN_CHAR(txt[name_len])) ) {
+ txt += name_len;
+ break;
+ }
+
+ txt = strstr(txt, ttl);
+ } while (txt != NULL);
+
+ AGFREE(ttl);
+ if (txt != NULL)
+ for (;;) {
+ if (*txt == NUL) {
+ txt = NULL;
+ break;
+ }
+ if (*(txt++) == '>')
+ break;
+ }
+
+ return txt;
+}
+
+/**
+ * "txt" points to a '[' character.
+ * The "traditional" [PROG_NAME] segmentation of the config file.
+ * Do not ever mix with the "<?program prog-name>" variation.
+ *
+ * @param[in,out] opts program option descriptor
+ * @param[in] txt scanning pointer
+ * @returns the next character to look at
+ */
+static char *
+handle_section(tOptions * opts, char * txt)
+{
+ size_t len = strlen(opts->pzPROGNAME);
+ if ( (strncmp(txt+1, opts->pzPROGNAME, len) == 0)
+ && (txt[len+1] == ']'))
+ return strchr(txt + len + 2, NL);
+
+ if (len > 16)
+ return NULL;
+
+ {
+ char z[24];
+ sprintf(z, "[%s]", opts->pzPROGNAME);
+ txt = strstr(txt, z);
+ }
+
+ if (txt != NULL)
+ txt = strchr(txt, NL);
+ return txt;
+}
+
+/**
+ * parse XML encodings
+ */
+static int
+parse_xml_encoding(char ** ppz)
+{
+# define XMLTABLE \
+ _xmlNm_(amp, '&') \
+ _xmlNm_(lt, '<') \
+ _xmlNm_(gt, '>') \
+ _xmlNm_(ff, '\f') \
+ _xmlNm_(ht, '\t') \
+ _xmlNm_(cr, '\r') \
+ _xmlNm_(vt, '\v') \
+ _xmlNm_(bel, '\a') \
+ _xmlNm_(nl, NL) \
+ _xmlNm_(space, ' ') \
+ _xmlNm_(quot, '"') \
+ _xmlNm_(apos, '\'')
+
+ static struct {
+ char const * const nm_str;
+ unsigned short nm_len;
+ short nm_val;
+ } const xml_names[] = {
+# define _xmlNm_(_n, _v) { #_n ";", sizeof(#_n), _v },
+ XMLTABLE
+# undef _xmlNm_
+# undef XMLTABLE
+ };
+
+ static int const nm_ct = sizeof(xml_names) / sizeof(xml_names[0]);
+ int base = 10;
+
+ char * pz = *ppz;
+
+ if (*pz == '#') {
+ pz++;
+ goto parse_number;
+ }
+
+ if (IS_DEC_DIGIT_CHAR(*pz)) {
+ unsigned long v;
+
+ parse_number:
+ switch (*pz) {
+ case 'x': case 'X':
+ /*
+ * Some forms specify hex with: &#xNN;
+ */
+ base = 16;
+ pz++;
+ break;
+
+ case '0':
+ /*
+ * &#0022; is hex and &#22; is decimal. Cool.
+ * Ya gotta love it.
+ */
+ if (pz[1] == '0')
+ base = 16;
+ break;
+ }
+
+ v = strtoul(pz, &pz, base);
+ if ((*pz != ';') || (v > 0x7F))
+ return NUL;
+ *ppz = pz + 1;
+ return (int)v;
+ }
+
+ {
+ int ix = 0;
+ do {
+ if (strncmp(pz, xml_names[ix].nm_str, xml_names[ix].nm_len)
+ == 0) {
+ *ppz = pz + xml_names[ix].nm_len;
+ return xml_names[ix].nm_val;
+ }
+ } while (++ix < nm_ct);
+ }
+
+ return NUL;
+}
+
+/**
+ * Find the end marker for the named section of XML.
+ * Trim that text there, trimming trailing white space for all modes
+ * except for OPTION_LOAD_UNCOOKED.
+ */
+static char *
+trim_xml_text(char * intxt, char const * pznm, tOptionLoadMode mode)
+{
+ static char const fmt[] = "</%s>";
+ size_t len = strlen(pznm) + sizeof(fmt) - 2 /* for %s */;
+ char * etext;
+
+ {
+ char z[64], *pz = z;
+ if (len >= sizeof(z))
+ pz = AGALOC(len, "scan name");
+
+ len = (size_t)sprintf(pz, fmt, pznm);
+ *intxt = ' ';
+ etext = strstr(intxt, pz);
+ if (pz != z) AGFREE(pz);
+ }
+
+ if (etext == NULL)
+ return etext;
+
+ {
+ char * result = etext + len;
+
+ if (mode != OPTION_LOAD_UNCOOKED)
+ etext = SPN_WHITESPACE_BACK(intxt, etext);
+
+ *etext = NUL;
+ return result;
+ }
+}
+
+/**
+ */
+static void
+cook_xml_text(char * pzData)
+{
+ char * pzs = pzData;
+ char * pzd = pzData;
+ char bf[4];
+ bf[2] = NUL;
+
+ for (;;) {
+ int ch = ((int)*(pzs++)) & 0xFF;
+ switch (ch) {
+ case NUL:
+ *pzd = NUL;
+ return;
+
+ case '&':
+ ch = parse_xml_encoding(&pzs);
+ *(pzd++) = (char)ch;
+ if (ch == NUL)
+ return;
+ break;
+
+ case '%':
+ bf[0] = *(pzs++);
+ bf[1] = *(pzs++);
+ if ((bf[0] == NUL) || (bf[1] == NUL)) {
+ *pzd = NUL;
+ return;
+ }
+
+ ch = (int)strtoul(bf, NULL, 16);
+ /* FALLTHROUGH */
+
+ default:
+ *(pzd++) = (char)ch;
+ }
+ }
+}
+
+/**
+ * "txt" points to a '<' character, followed by an alpha.
+ * The end of the entry is either the "/>" following the name, or else a
+ * "</name>" string.
+ */
+static char *
+handle_struct(tOptions * opts, tOptState * ost, char * txt, int dir)
+{
+ tOptionLoadMode mode = option_load_mode;
+ tOptionValue valu;
+
+ char* pzName = ++txt;
+ char* pzData;
+ char* pcNulPoint;
+
+ txt = SPN_VALUE_NAME_CHARS(txt);
+ pcNulPoint = txt;
+ valu.valType = OPARG_TYPE_STRING;
+
+ switch (*txt) {
+ case ' ':
+ case '\t':
+ txt = (void *)parse_attrs(
+ opts, SPN_WHITESPACE_CHARS(txt), &mode, &valu);
+ if (txt == NULL)
+ return txt;
+ if (*txt == '>')
+ break;
+ if (*txt != '/')
+ return NULL;
+ /* FALLTHROUGH */
+
+ case '/':
+ if (txt[1] != '>')
+ return NULL;
+ *txt = NUL;
+ txt += 2;
+ load_opt_line(opts, ost, pzName, dir, mode);
+ return txt;
+
+ case '>':
+ break;
+
+ default:
+ txt = strchr(txt, '>');
+ if (txt != NULL)
+ txt++;
+ return txt;
+ }
+
+ /*
+ * If we are here, we have a value. "txt" points to a closing angle
+ * bracket. Separate the name from the value for a moment.
+ */
+ *pcNulPoint = NUL;
+ pzData = ++txt;
+ txt = trim_xml_text(txt, pzName, mode);
+ if (txt == NULL)
+ return txt;
+
+ /*
+ * Rejoin the name and value for parsing by "load_opt_line()".
+ * Erase any attributes parsed by "parse_attrs()".
+ */
+ memset(pcNulPoint, ' ', (size_t)(pzData - pcNulPoint));
+
+ /*
+ * If we are getting a "string" value that is to be cooked,
+ * then process the XML-ish &xx; XML-ish and %XX hex characters.
+ */
+ if ( (valu.valType == OPARG_TYPE_STRING)
+ && (mode == OPTION_LOAD_COOKED))
+ cook_xml_text(pzData);
+
+ /*
+ * "pzName" points to what looks like text for one option/configurable.
+ * It is NUL terminated. Process it.
+ */
+ load_opt_line(opts, ost, pzName, dir, mode);
+
+ return txt;
+}
+
+/**
+ * Load a configuration file. This may be invoked either from
+ * scanning the "homerc" list, or from a specific file request.
+ * (see "optionFileLoad()", the implementation for --load-opts)
+ */
+LOCAL void
+intern_file_load(tOptions * opts)
+{
+ uint32_t svfl;
+ int idx;
+ int inc;
+ char f_name[ AG_PATH_MAX+1 ];
+
+ if (opts->papzHomeList == NULL)
+ return;
+
+ svfl = opts->fOptSet;
+ inc = DIRECTION_PRESET;
+
+ /*
+ * Never stop on errors in config files.
+ */
+ opts->fOptSet &= ~OPTPROC_ERRSTOP;
+
+ /*
+ * Find the last RC entry (highest priority entry)
+ */
+ for (idx = 0; opts->papzHomeList[ idx+1 ] != NULL; ++idx) ;
+
+ /*
+ * For every path in the home list, ... *TWICE* We start at the last
+ * (highest priority) entry, work our way down to the lowest priority,
+ * handling the immediate options.
+ * Then we go back up, doing the normal options.
+ */
+ for (;;) {
+ struct stat sb;
+ cch_t * path;
+
+ /*
+ * IF we've reached the bottom end, change direction
+ */
+ if (idx < 0) {
+ inc = DIRECTION_PROCESS;
+ idx = 0;
+ }
+
+ path = opts->papzHomeList[ idx ];
+
+ /*
+ * IF we've reached the top end, bail out
+ */
+ if (path == NULL)
+ break;
+
+ idx += inc;
+
+ if (! optionMakePath(f_name, (int)sizeof(f_name),
+ path, opts->pzProgPath))
+ continue;
+
+ /*
+ * IF the file name we constructed is a directory,
+ * THEN append the Resource Configuration file name
+ * ELSE we must have the complete file name
+ */
+ if (stat(f_name, &sb) != 0)
+ continue; /* bogus name - skip the home list entry */
+
+ if (S_ISDIR(sb.st_mode)) {
+ size_t len = strlen(f_name);
+ size_t nln = strlen(opts->pzRcName) + 1;
+ char * pz = f_name + len;
+
+ if (len + 1 + nln >= sizeof(f_name))
+ continue;
+
+ if (pz[-1] != DIRCH)
+ *(pz++) = DIRCH;
+ memcpy(pz, opts->pzRcName, nln);
+ }
+
+ file_preset(opts, f_name, inc);
+
+ /*
+ * IF we are now to skip config files AND we are presetting,
+ * THEN change direction. We must go the other way.
+ */
+ {
+ tOptDesc * od = opts->pOptDesc + opts->specOptIdx.save_opts + 1;
+ if (DISABLED_OPT(od) && PRESETTING(inc)) {
+ idx -= inc; /* go back and reprocess current file */
+ inc = DIRECTION_PROCESS;
+ }
+ }
+ } /* twice for every path in the home list, ... */
+
+ opts->fOptSet = svfl;
+}
+
+/*=export_func optionFileLoad
+ *
+ * what: Load the locatable config files, in order
+ *
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + char const* + prog + program name +
+ *
+ * ret_type: int
+ * ret_desc: 0 -> SUCCESS, -1 -> FAILURE
+ *
+ * doc:
+ *
+ * This function looks in all the specified directories for a configuration
+ * file ("rc" file or "ini" file) and processes any found twice. The first
+ * time through, they are processed in reverse order (last file first). At
+ * that time, only "immediate action" configurables are processed. For
+ * example, if the last named file specifies not processing any more
+ * configuration files, then no more configuration files will be processed.
+ * Such an option in the @strong{first} named directory will have no effect.
+ *
+ * Once the immediate action configurables have been handled, then the
+ * directories are handled in normal, forward order. In that way, later
+ * config files can override the settings of earlier config files.
+ *
+ * See the AutoOpts documentation for a thorough discussion of the
+ * config file format.
+ *
+ * Configuration files not found or not decipherable are simply ignored.
+ *
+ * err: Returns the value, "-1" if the program options descriptor
+ * is out of date or indecipherable. Otherwise, the value "0" will
+ * always be returned.
+=*/
+int
+optionFileLoad(tOptions * opts, char const * prog)
+{
+ if (! SUCCESSFUL(validate_struct(opts, prog)))
+ return -1;
+
+ /*
+ * The pointer to the program name is "const". However, the
+ * structure is in writable memory, so we coerce the address
+ * of this pointer to point to writable memory.
+ */
+ {
+ char const ** pp =
+ (char const **)(void *)&(opts->pzProgName);
+ *pp = prog;
+ }
+
+ intern_file_load(opts);
+ return 0;
+}
+
+/*=export_func optionLoadOpt
+ * private:
+ *
+ * what: Load an option rc/ini file
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + odesc + the descriptor for this arg +
+ *
+ * doc:
+ * Processes the options found in the file named with
+ * odesc->optArg.argString.
+=*/
+void
+optionLoadOpt(tOptions * opts, tOptDesc * odesc)
+{
+ struct stat sb;
+
+ if (opts <= OPTPROC_EMIT_LIMIT)
+ return;
+
+ /*
+ * IF the option is not being disabled, THEN load the file. There must
+ * be a file. (If it is being disabled, then the disablement processing
+ * already took place. It must be done to suppress preloading of ini/rc
+ * files.)
+ */
+ if ( DISABLED_OPT(odesc)
+ || ((odesc->fOptState & OPTST_RESET) != 0))
+ return;
+
+ if (stat(odesc->optArg.argString, &sb) != 0) {
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) == 0)
+ return;
+
+ fserr_exit(opts->pzProgName, "stat", odesc->optArg.argString);
+ /* NOT REACHED */
+ }
+
+ if (! S_ISREG(sb.st_mode)) {
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) == 0)
+ return;
+ errno = EINVAL;
+ fserr_exit(opts->pzProgName, "stat", odesc->optArg.argString);
+ /* NOT REACHED */
+ }
+
+ file_preset(opts, odesc->optArg.argString, DIRECTION_CALLED);
+}
+
+/**
+ * Parse the various attributes of an XML-styled config file entry
+ *
+ * @returns NULL on failure, otherwise the scan point
+ */
+LOCAL char const *
+parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode,
+ tOptionValue * pType)
+{
+ size_t len = 0;
+
+ for (;;) {
+ len = (size_t)(SPN_LOWER_CASE_CHARS(txt) - txt);
+
+ /*
+ * The enumeration used in this switch is derived from this switch
+ * statement itself. The "find_option_xat_attribute_cmd" function
+ * will return XAT_CMD_MEMBERS for the "txt" string value
+ * "members", etc.
+ */
+ switch (find_option_xat_attribute_cmd(txt, len)) {
+ case XAT_CMD_TYPE:
+ txt = parse_value(txt+len, pType);
+ break;
+
+ case XAT_CMD_WORDS:
+ txt = parse_keyword(opts, txt+len, pType);
+ break;
+
+ case XAT_CMD_MEMBERS:
+ txt = parse_set_mem(opts, txt+len, pType);
+ break;
+
+ case XAT_CMD_COOKED:
+ txt += len;
+ if (! IS_END_XML_TOKEN_CHAR(*txt))
+ goto invalid_kwd;
+
+ *pMode = OPTION_LOAD_COOKED;
+ break;
+
+ case XAT_CMD_UNCOOKED:
+ txt += len;
+ if (! IS_END_XML_TOKEN_CHAR(*txt))
+ goto invalid_kwd;
+
+ *pMode = OPTION_LOAD_UNCOOKED;
+ break;
+
+ case XAT_CMD_KEEP:
+ txt += len;
+ if (! IS_END_XML_TOKEN_CHAR(*txt))
+ goto invalid_kwd;
+
+ *pMode = OPTION_LOAD_KEEP;
+ break;
+
+ default:
+ case XAT_INVALID_CMD:
+ invalid_kwd:
+ pType->valType = OPARG_TYPE_NONE;
+ return skip_unkn(txt);
+ }
+
+ if (txt == NULL)
+ return NULL;
+ txt = SPN_WHITESPACE_CHARS(txt);
+ switch (*txt) {
+ case '/': pType->valType = OPARG_TYPE_NONE;
+ /* FALLTHROUGH */
+ case '>': return txt;
+ }
+ if (! IS_LOWER_CASE_CHAR(*txt))
+ return NULL;
+ }
+}
+
+/**
+ * "txt" points to the character after "words=".
+ * What should follow is a name of a keyword (enumeration) list.
+ *
+ * @param opts unused
+ * @param[in] txt keyword to skip over
+ * @param type unused value type
+ * @returns pointer after skipped text
+ */
+static char const *
+parse_keyword(tOptions * opts, char const * txt, tOptionValue * typ)
+{
+ (void)opts;
+ (void)typ;
+
+ return skip_unkn(txt);
+}
+
+/**
+ * "txt" points to the character after "members="
+ * What should follow is a name of a "set membership".
+ * A collection of bit flags.
+ *
+ * @param opts unused
+ * @param[in] txt keyword to skip over
+ * @param type unused value type
+ * @returns pointer after skipped text
+ */
+static char const *
+parse_set_mem(tOptions * opts, char const * txt, tOptionValue * typ)
+{
+ (void)opts;
+ (void)typ;
+
+ return skip_unkn(txt);
+}
+
+/**
+ * parse the type. The keyword "type" was found, now figure out
+ * the type that follows the type.
+ *
+ * @param[in] txt points to the '=' character after the "type" keyword.
+ * @param[out] typ where to store the type found
+ * @returns the next byte after the type name
+ */
+static char const *
+parse_value(char const * txt, tOptionValue * typ)
+{
+ size_t len = 0;
+
+ if (*(txt++) != '=')
+ goto woops;
+
+ len = (size_t)(SPN_OPTION_NAME_CHARS(txt) - txt);
+
+ if ((len == 0) || (! IS_END_XML_TOKEN_CHAR(txt[len]))) {
+ woops:
+ typ->valType = OPARG_TYPE_NONE;
+ return skip_unkn(txt + len);
+ }
+
+ /*
+ * The enumeration used in this switch is derived from this switch
+ * statement itself. The "find_option_value_type_cmd" function
+ * will return VTP_CMD_INTEGER for the "txt" string value
+ * "integer", etc.
+ */
+ switch (find_option_value_type_cmd(txt, len)) {
+ default:
+ case VTP_INVALID_CMD: goto woops;
+
+ case VTP_CMD_STRING:
+ typ->valType = OPARG_TYPE_STRING;
+ break;
+
+ case VTP_CMD_INTEGER:
+ typ->valType = OPARG_TYPE_NUMERIC;
+ break;
+
+ case VTP_CMD_BOOL:
+ case VTP_CMD_BOOLEAN:
+ typ->valType = OPARG_TYPE_BOOLEAN;
+ break;
+
+ case VTP_CMD_KEYWORD:
+ typ->valType = OPARG_TYPE_ENUMERATION;
+ break;
+
+ case VTP_CMD_SET:
+ case VTP_CMD_SET_MEMBERSHIP:
+ typ->valType = OPARG_TYPE_MEMBERSHIP;
+ break;
+
+ case VTP_CMD_NESTED:
+ case VTP_CMD_HIERARCHY:
+ typ->valType = OPARG_TYPE_HIERARCHY;
+ }
+
+ return txt + len;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/configfile.c */
diff --git a/sntp/libopts/cook.c b/sntp/libopts/cook.c
new file mode 100644
index 0000000..952aac9
--- /dev/null
+++ b/sntp/libopts/cook.c
@@ -0,0 +1,325 @@
+/**
+ * \file cook.c
+ *
+ * This file contains the routines that deal with processing quoted strings
+ * into an internal format.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static bool
+contiguous_quote(char ** pps, char * pq, int * lnct_p);
+/* = = = END-STATIC-FORWARD = = = */
+
+/*=export_func ao_string_cook_escape_char
+ * private:
+ *
+ * what: escape-process a string fragment
+ * arg: + char const* + pzScan + points to character after the escape +
+ * arg: + char* + pRes + Where to put the result byte +
+ * arg: + unsigned int + nl_ch + replacement char if scanned char is \n +
+ *
+ * ret-type: unsigned int
+ * ret-desc: The number of bytes consumed processing the escaped character.
+ *
+ * doc:
+ *
+ * This function converts "t" into "\t" and all your other favorite
+ * escapes, including numeric ones: hex and ocatal, too.
+ * The returned result tells the caller how far to advance the
+ * scan pointer (passed in). The default is to just pass through the
+ * escaped character and advance the scan by one.
+ *
+ * Some applications need to keep an escaped newline, others need to
+ * suppress it. This is accomplished by supplying a '\n' replacement
+ * character that is different from \n, if need be. For example, use
+ * 0x7F and never emit a 0x7F.
+ *
+ * err: @code{NULL} is returned if the string is mal-formed.
+=*/
+unsigned int
+ao_string_cook_escape_char(char const * pzIn, char * pRes, uint_t nl)
+{
+ unsigned int res = 1;
+
+ switch (*pRes = *pzIn++) {
+ case NUL: /* NUL - end of input string */
+ return 0;
+ case '\r':
+ if (*pzIn != NL)
+ return 1;
+ res++;
+ /* FALLTHROUGH */
+ case NL: /* NL - emit newline */
+ *pRes = (char)nl;
+ return res;
+
+ case 'a': *pRes = '\a'; break;
+ case 'b': *pRes = '\b'; break;
+ case 'f': *pRes = '\f'; break;
+ case 'n': *pRes = NL; break;
+ case 'r': *pRes = '\r'; break;
+ case 't': *pRes = '\t'; break;
+ case 'v': *pRes = '\v'; break;
+
+ case 'x':
+ case 'X': /* HEX Escape */
+ if (IS_HEX_DIGIT_CHAR(*pzIn)) {
+ char z[4];
+ unsigned int ct = 0;
+
+ do {
+ z[ct] = pzIn[ct];
+ if (++ct >= 2)
+ break;
+ } while (IS_HEX_DIGIT_CHAR(pzIn[ct]));
+ z[ct] = NUL;
+ *pRes = (char)strtoul(z, NULL, 16);
+ return ct + 1;
+ }
+ break;
+
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ {
+ /*
+ * IF the character copied was an octal digit,
+ * THEN set the output character to an octal value.
+ * The 3 octal digit result might exceed 0xFF, so check it.
+ */
+ char z[4];
+ unsigned long val;
+ unsigned int ct = 0;
+
+ z[ct++] = *--pzIn;
+ while (IS_OCT_DIGIT_CHAR(pzIn[ct])) {
+ z[ct] = pzIn[ct];
+ if (++ct >= 3)
+ break;
+ }
+
+ z[ct] = NUL;
+ val = strtoul(z, NULL, 8);
+ if (val > 0xFF)
+ val = 0xFF;
+ *pRes = (char)val;
+ return ct;
+ }
+
+ default: /* quoted character is result character */;
+ }
+
+ return res;
+}
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * A quoted string has been found.
+ * Find the end of it and compress any escape sequences.
+ */
+static bool
+contiguous_quote(char ** pps, char * pq, int * lnct_p)
+{
+ char * ps = *pps + 1;
+
+ for (;;) {
+ while (IS_WHITESPACE_CHAR(*ps))
+ if (*(ps++) == NL)
+ (*lnct_p)++;
+
+ /*
+ * IF the next character is a quote character,
+ * THEN we will concatenate the strings.
+ */
+ switch (*ps) {
+ case '"':
+ case '\'':
+ *pq = *(ps++); /* assign new quote character and return */
+ *pps = ps;
+ return true;
+
+ case '/':
+ /*
+ * Allow for a comment embedded in the concatenated string.
+ */
+ switch (ps[1]) {
+ default:
+ *pps = NULL;
+ return false;
+
+ case '/':
+ /*
+ * Skip to end of line
+ */
+ ps = strchr(ps, NL);
+ if (ps == NULL) {
+ *pps = NULL;
+ return false;
+ }
+ break;
+
+ case '*':
+ {
+ char* p = strstr( ps+2, "*/" );
+ /*
+ * Skip to terminating star slash
+ */
+ if (p == NULL) {
+ *pps = NULL;
+ return false;
+ }
+
+ while (ps < p) {
+ if (*(ps++) == NL)
+ (*lnct_p)++;
+ }
+
+ ps = p + 2;
+ }
+ }
+ continue;
+
+ default:
+ /*
+ * The next non-whitespace character is not a quote.
+ * The series of quoted strings has come to an end.
+ */
+ *pps = ps;
+ return false;
+ }
+ }
+}
+
+/*=export_func ao_string_cook
+ * private:
+ *
+ * what: concatenate and escape-process strings
+ * arg: + char* + pzScan + The *MODIFIABLE* input buffer +
+ * arg: + int* + lnct_p + The (possibly NULL) pointer to a line count +
+ *
+ * ret-type: char*
+ * ret-desc: The address of the text following the processed strings.
+ * The return value is NULL if the strings are ill-formed.
+ *
+ * doc:
+ *
+ * A series of one or more quoted strings are concatenated together.
+ * If they are quoted with double quotes (@code{"}), then backslash
+ * escapes are processed per the C programming language. If they are
+ * single quote strings, then the backslashes are honored only when they
+ * precede another backslash or a single quote character.
+ *
+ * err: @code{NULL} is returned if the string(s) is/are mal-formed.
+=*/
+char *
+ao_string_cook(char * pzScan, int * lnct_p)
+{
+ int l = 0;
+ char q = *pzScan;
+
+ /*
+ * It is a quoted string. Process the escape sequence characters
+ * (in the set "abfnrtv") and make sure we find a closing quote.
+ */
+ char* pzD = pzScan++;
+ char* pzS = pzScan;
+
+ if (lnct_p == NULL)
+ lnct_p = &l;
+
+ for (;;) {
+ /*
+ * IF the next character is the quote character, THEN we may end the
+ * string. We end it unless the next non-blank character *after* the
+ * string happens to also be a quote. If it is, then we will change
+ * our quote character to the new quote character and continue
+ * condensing text.
+ */
+ while (*pzS == q) {
+ *pzD = NUL; /* This is probably the end of the line */
+ if (! contiguous_quote(&pzS, &q, lnct_p))
+ return pzS;
+ }
+
+ /*
+ * We are inside a quoted string. Copy text.
+ */
+ switch (*(pzD++) = *(pzS++)) {
+ case NUL:
+ return NULL;
+
+ case NL:
+ (*lnct_p)++;
+ break;
+
+ case '\\':
+ /*
+ * IF we are escaping a new line,
+ * THEN drop both the escape and the newline from
+ * the result string.
+ */
+ if (*pzS == NL) {
+ pzS++;
+ pzD--;
+ (*lnct_p)++;
+ }
+
+ /*
+ * ELSE IF the quote character is '"' or '`',
+ * THEN we do the full escape character processing
+ */
+ else if (q != '\'') {
+ unsigned int ct;
+ ct = ao_string_cook_escape_char(pzS, pzD-1, (uint_t)NL);
+ if (ct == 0)
+ return NULL;
+
+ pzS += ct;
+ } /* if (q != '\'') */
+
+ /*
+ * OTHERWISE, we only process "\\", "\'" and "\#" sequences.
+ * The latter only to easily hide preprocessing directives.
+ */
+ else switch (*pzS) {
+ case '\\':
+ case '\'':
+ case '#':
+ pzD[-1] = *pzS++;
+ }
+ } /* switch (*(pzD++) = *(pzS++)) */
+ } /* for (;;) */
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/cook.c */
diff --git a/sntp/libopts/enum.c b/sntp/libopts/enum.c
new file mode 100644
index 0000000..299ffb1
--- /dev/null
+++ b/sntp/libopts/enum.c
@@ -0,0 +1,652 @@
+
+/**
+ * \file enumeration.c
+ *
+ * Handle options with enumeration names and bit mask bit names
+ * for their arguments.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This routine will run run-on options through a pager so the
+ * user may examine, print or edit them at their leisure.
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static void
+enum_err(tOptions * pOpts, tOptDesc * pOD,
+ char const * const * paz_names, int name_ct);
+
+static uintptr_t
+find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
+ char const * const * paz_names, unsigned int name_ct);
+
+static void
+set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names,
+ unsigned int name_ct);
+
+static void
+set_memb_names(tOptions * opts, tOptDesc * od, char const * const * nm_list,
+ unsigned int nm_ct);
+
+static uintptr_t
+check_membership_start(tOptDesc * od, char const ** argp, bool * invert);
+
+static uintptr_t
+find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
+ char const * const * nm_list, unsigned int nm_ct);
+/* = = = END-STATIC-FORWARD = = = */
+
+static void
+enum_err(tOptions * pOpts, tOptDesc * pOD,
+ char const * const * paz_names, int name_ct)
+{
+ size_t max_len = 0;
+ size_t ttl_len = 0;
+ int ct_down = name_ct;
+ int hidden = 0;
+
+ /*
+ * A real "pOpts" pointer means someone messed up. Give a real error.
+ */
+ if (pOpts > OPTPROC_EMIT_LIMIT)
+ fprintf(option_usage_fp, pz_enum_err_fmt, pOpts->pzProgName,
+ pOD->optArg.argString, pOD->pz_Name);
+
+ fprintf(option_usage_fp, zValidKeys, pOD->pz_Name);
+
+ /*
+ * If the first name starts with this funny character, then we have
+ * a first value with an unspellable name. You cannot specify it.
+ * So, we don't list it either.
+ */
+ if (**paz_names == 0x7F) {
+ paz_names++;
+ hidden = 1;
+ ct_down = --name_ct;
+ }
+
+ /*
+ * Figure out the maximum length of any name, plus the total length
+ * of all the names.
+ */
+ {
+ char const * const * paz = paz_names;
+
+ do {
+ size_t len = strlen(*(paz++)) + 1;
+ if (len > max_len)
+ max_len = len;
+ ttl_len += len;
+ } while (--ct_down > 0);
+
+ ct_down = name_ct;
+ }
+
+ /*
+ * IF any one entry is about 1/2 line or longer, print one per line
+ */
+ if (max_len > 35) {
+ do {
+ fprintf(option_usage_fp, ENUM_ERR_LINE, *(paz_names++));
+ } while (--ct_down > 0);
+ }
+
+ /*
+ * ELSE IF they all fit on one line, then do so.
+ */
+ else if (ttl_len < 76) {
+ fputc(' ', option_usage_fp);
+ do {
+ fputc(' ', option_usage_fp);
+ fputs(*(paz_names++), option_usage_fp);
+ } while (--ct_down > 0);
+ fputc(NL, option_usage_fp);
+ }
+
+ /*
+ * Otherwise, columnize the output
+ */
+ else {
+ unsigned int ent_no = 0;
+ char zFmt[16]; /* format for all-but-last entries on a line */
+
+ sprintf(zFmt, ENUM_ERR_WIDTH, (int)max_len);
+ max_len = 78 / max_len; /* max_len is now max entries on a line */
+ fputs(TWO_SPACES_STR, option_usage_fp);
+
+ /*
+ * Loop through all but the last entry
+ */
+ ct_down = name_ct;
+ while (--ct_down > 0) {
+ if (++ent_no == max_len) {
+ /*
+ * Last entry on a line. Start next line, too.
+ */
+ fprintf(option_usage_fp, NLSTR_SPACE_FMT, *(paz_names++));
+ ent_no = 0;
+ }
+
+ else
+ fprintf(option_usage_fp, zFmt, *(paz_names++) );
+ }
+ fprintf(option_usage_fp, NLSTR_FMT, *paz_names);
+ }
+
+ if (pOpts > OPTPROC_EMIT_LIMIT) {
+ fprintf(option_usage_fp, zIntRange, hidden, name_ct - 1 + hidden);
+
+ (*(pOpts->pUsageProc))(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ }
+
+ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_MEMBERSHIP) {
+ fprintf(option_usage_fp, zLowerBits, name_ct);
+ fputs(zSetMemberSettings, option_usage_fp);
+ } else {
+ fprintf(option_usage_fp, zIntRange, hidden, name_ct - 1 + hidden);
+ }
+}
+
+/**
+ * Convert a name or number into a binary number.
+ * "~0" and "-1" will be converted to the largest value in the enumeration.
+ *
+ * @param name the keyword name (number) to convert
+ * @param pOpts the program's option descriptor
+ * @param pOD the option descriptor for this option
+ * @param paz_names the list of keywords for this option
+ * @param name_ct the count of keywords
+ */
+static uintptr_t
+find_name(char const * name, tOptions * pOpts, tOptDesc * pOD,
+ char const * const * paz_names, unsigned int name_ct)
+{
+ /*
+ * Return the matching index as a pointer sized integer.
+ * The result gets stashed in a char* pointer.
+ */
+ uintptr_t res = name_ct;
+ size_t len = strlen((char*)name);
+ uintptr_t idx;
+
+ if (IS_DEC_DIGIT_CHAR(*name)) {
+ char * pz = (char *)(void *)name;
+ unsigned long val = strtoul(pz, &pz, 0);
+ if ((*pz == NUL) && (val < name_ct))
+ return (uintptr_t)val;
+ pz_enum_err_fmt = znum_too_large;
+ option_usage_fp = stderr;
+ enum_err(pOpts, pOD, paz_names, (int)name_ct);
+ return name_ct;
+ }
+
+ if (IS_INVERSION_CHAR(*name) && (name[2] == NUL)) {
+ if ( ((name[0] == '~') && (name[1] == '0'))
+ || ((name[0] == '-') && (name[1] == '1')))
+ return (uintptr_t)(name_ct - 1);
+ goto oops;
+ }
+
+ /*
+ * Look for an exact match, but remember any partial matches.
+ * Multiple partial matches means we have an ambiguous match.
+ */
+ for (idx = 0; idx < name_ct; idx++) {
+ if (strncmp((char*)paz_names[idx], (char*)name, len) == 0) {
+ if (paz_names[idx][len] == NUL)
+ return idx; /* full match */
+
+ if (res == name_ct)
+ res = idx; /* save partial match */
+ else
+ res = (uintptr_t)~0; /* may yet find full match */
+ }
+ }
+
+ if (res < name_ct)
+ return res; /* partial match */
+
+ oops:
+
+ pz_enum_err_fmt = (res == name_ct) ? zNoKey : zambiguous_key;
+ option_usage_fp = stderr;
+ enum_err(pOpts, pOD, paz_names, (int)name_ct);
+ return name_ct;
+}
+
+
+/*=export_func optionKeywordName
+ * what: Convert between enumeration values and strings
+ * private:
+ *
+ * arg: tOptDesc*, pOD, enumeration option description
+ * arg: unsigned int, enum_val, the enumeration value to map
+ *
+ * ret_type: char const *
+ * ret_desc: the enumeration name from const memory
+ *
+ * doc: This converts an enumeration value into the matching string.
+=*/
+char const *
+optionKeywordName(tOptDesc * pOD, unsigned int enum_val)
+{
+ tOptDesc od = { 0 };
+ od.optArg.argEnum = enum_val;
+
+ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, &od );
+ return od.optArg.argString;
+}
+
+
+/*=export_func optionEnumerationVal
+ * what: Convert from a string to an enumeration value
+ * private:
+ *
+ * arg: tOptions*, pOpts, the program options descriptor
+ * arg: tOptDesc*, pOD, enumeration option description
+ * arg: char const * const *, paz_names, list of enumeration names
+ * arg: unsigned int, name_ct, number of names in list
+ *
+ * ret_type: uintptr_t
+ * ret_desc: the enumeration value
+ *
+ * doc: This converts the optArg.argString string from the option description
+ * into the index corresponding to an entry in the name list.
+ * This will match the generated enumeration value.
+ * Full matches are always accepted. Partial matches are accepted
+ * if there is only one partial match.
+=*/
+uintptr_t
+optionEnumerationVal(tOptions * pOpts, tOptDesc * pOD,
+ char const * const * paz_names, unsigned int name_ct)
+{
+ uintptr_t res = 0UL;
+
+ /*
+ * IF the program option descriptor pointer is invalid,
+ * then it is some sort of special request.
+ */
+ switch ((uintptr_t)pOpts) {
+ case (uintptr_t)OPTPROC_EMIT_USAGE:
+ /*
+ * print the list of enumeration names.
+ */
+ enum_err(pOpts, pOD, paz_names, (int)name_ct);
+ break;
+
+ case (uintptr_t)OPTPROC_EMIT_SHELL:
+ {
+ unsigned int ix = (unsigned int)pOD->optArg.argEnum;
+ /*
+ * print the name string.
+ */
+ if (ix >= name_ct)
+ printf(INVALID_FMT, ix);
+ else
+ fputs(paz_names[ ix ], stdout);
+
+ break;
+ }
+
+ case (uintptr_t)OPTPROC_RETURN_VALNAME:
+ {
+ unsigned int ix = (unsigned int)pOD->optArg.argEnum;
+ /*
+ * Replace the enumeration value with the name string.
+ */
+ if (ix >= name_ct)
+ return (uintptr_t)INVALID_STR;
+
+ pOD->optArg.argString = paz_names[ix];
+ break;
+ }
+
+ default:
+ if ((pOD->fOptState & OPTST_RESET) != 0)
+ break;
+
+ res = find_name(pOD->optArg.argString, pOpts, pOD, paz_names, name_ct);
+
+ if (pOD->fOptState & OPTST_ALLOC_ARG) {
+ AGFREE(pOD->optArg.argString);
+ pOD->fOptState &= ~OPTST_ALLOC_ARG;
+ pOD->optArg.argString = NULL;
+ }
+ }
+
+ return res;
+}
+
+static void
+set_memb_shell(tOptions * pOpts, tOptDesc * pOD, char const * const * paz_names,
+ unsigned int name_ct)
+{
+ /*
+ * print the name string.
+ */
+ unsigned int ix = 0;
+ uintptr_t bits = (uintptr_t)pOD->optCookie;
+ size_t len = 0;
+
+ (void)pOpts;
+ bits &= ((uintptr_t)1 << (uintptr_t)name_ct) - (uintptr_t)1;
+
+ while (bits != 0) {
+ if (bits & 1) {
+ if (len++ > 0) fputs(OR_STR, stdout);
+ fputs(paz_names[ix], stdout);
+ }
+ if (++ix >= name_ct) break;
+ bits >>= 1;
+ }
+}
+
+static void
+set_memb_names(tOptions * opts, tOptDesc * od, char const * const * nm_list,
+ unsigned int nm_ct)
+{
+ char * pz;
+ uintptr_t mask = (1UL << (uintptr_t)nm_ct) - 1UL;
+ uintptr_t bits = (uintptr_t)od->optCookie & mask;
+ unsigned int ix = 0;
+ size_t len = 1;
+
+ /*
+ * Replace the enumeration value with the name string.
+ * First, determine the needed length, then allocate and fill in.
+ */
+ while (bits != 0) {
+ if (bits & 1)
+ len += strlen(nm_list[ix]) + PLUS_STR_LEN + 1;
+ if (++ix >= nm_ct) break;
+ bits >>= 1;
+ }
+
+ od->optArg.argString = pz = AGALOC(len, "enum");
+ bits = (uintptr_t)od->optCookie & mask;
+ if (bits == 0) {
+ *pz = NUL;
+ return;
+ }
+
+ for (ix = 0; ; ix++) {
+ size_t nln;
+ int doit = bits & 1;
+
+ bits >>= 1;
+ if (doit == 0)
+ continue;
+
+ nln = strlen(nm_list[ix]);
+ memcpy(pz, nm_list[ix], nln);
+ pz += nln;
+ if (bits == 0)
+ break;
+ memcpy(pz, PLUS_STR, PLUS_STR_LEN);
+ pz += PLUS_STR_LEN;
+ }
+ *pz = NUL;
+ (void)opts;
+}
+
+/**
+ * Check membership start conditions. An equal character (@samp{=}) says to
+ * clear the result and not carry over any residual value. A carat
+ * (@samp{^}), which may follow the equal character, says to invert the
+ * result. The scanning pointer is advanced past these characters and any
+ * leading white space. Invalid sequences are indicated by setting the
+ * scanning pointer to NULL.
+ *
+ * @param od the set membership option description
+ * @param argp a pointer to the string scanning pointer
+ * @param invert a pointer to the boolean inversion indicator
+ *
+ * @returns either zero or the original value for the optCookie.
+ */
+static uintptr_t
+check_membership_start(tOptDesc * od, char const ** argp, bool * invert)
+{
+ uintptr_t res = (uintptr_t)od->optCookie;
+ char const * arg = SPN_WHITESPACE_CHARS(od->optArg.argString);
+ if ((arg == NULL) || (*arg == NUL))
+ goto member_start_fail;
+
+ *invert = false;
+
+ switch (*arg) {
+ case '=':
+ res = 0UL;
+ arg = SPN_WHITESPACE_CHARS(arg + 1);
+ switch (*arg) {
+ case '=': case ',':
+ goto member_start_fail;
+ case '^':
+ goto inversion;
+ default:
+ break;
+ }
+ break;
+
+ case '^':
+ inversion:
+ *invert = true;
+ arg = SPN_WHITESPACE_CHARS(arg + 1);
+ if (*arg != ',')
+ break;
+ /* FALLTHROUGH */
+
+ case ',':
+ goto member_start_fail;
+
+ default:
+ break;
+ }
+
+ *argp = arg;
+ return res;
+
+member_start_fail:
+ *argp = NULL;
+ return 0UL;
+}
+
+/**
+ * convert a name to a bit. Look up a name string to get a bit number
+ * and shift the value "1" left that number of bits.
+ *
+ * @param opts program options descriptor
+ * @param od the set membership option description
+ * @param pz address of the start of the bit name
+ * @param nm_list the list of names for this option
+ * @param nm_ct the number of entries in this list
+ *
+ * @returns 0UL on error, other an unsigned long with the correct bit set.
+ */
+static uintptr_t
+find_member_bit(tOptions * opts, tOptDesc * od, char const * pz, int len,
+ char const * const * nm_list, unsigned int nm_ct)
+{
+ char nm_buf[ AO_NAME_SIZE ];
+
+ memcpy(nm_buf, pz, len);
+ nm_buf[len] = NUL;
+
+ {
+ unsigned int shift_ct = (unsigned int)
+ find_name(nm_buf, opts, od, nm_list, nm_ct);
+ if (shift_ct >= nm_ct)
+ return 0UL;
+
+ return 1UL << shift_ct;
+ }
+}
+
+/*=export_func optionMemberList
+ * what: Get the list of members of a bit mask set
+ *
+ * arg: tOptDesc *, od, the set membership option description
+ *
+ * ret_type: char*
+ * ret_desc: the names of the set bits
+ *
+ * doc: This converts the OPT_VALUE_name mask value to a allocated string.
+ * It is the caller's responsibility to free the string.
+=*/
+char *
+optionMemberList(tOptDesc * od)
+{
+ uintptr_t sv = od->optArg.argIntptr;
+ char * res;
+ (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od);
+ res = (void *)od->optArg.argString;
+ od->optArg.argIntptr = sv;
+ return res;
+}
+
+/*=export_func optionSetMembers
+ * what: Convert between bit flag values and strings
+ * private:
+ *
+ * arg: tOptions*, opts, the program options descriptor
+ * arg: tOptDesc*, od, the set membership option description
+ * arg: char const * const *,
+ * nm_list, list of enumeration names
+ * arg: unsigned int, nm_ct, number of names in list
+ *
+ * doc: This converts the optArg.argString string from the option description
+ * into the index corresponding to an entry in the name list.
+ * This will match the generated enumeration value.
+ * Full matches are always accepted. Partial matches are accepted
+ * if there is only one partial match.
+=*/
+void
+optionSetMembers(tOptions * opts, tOptDesc * od,
+ char const * const * nm_list, unsigned int nm_ct)
+{
+ /*
+ * IF the program option descriptor pointer is invalid,
+ * then it is some sort of special request.
+ */
+ switch ((uintptr_t)opts) {
+ case (uintptr_t)OPTPROC_EMIT_USAGE:
+ enum_err(OPTPROC_EMIT_USAGE, od, nm_list, nm_ct);
+ return;
+
+ case (uintptr_t)OPTPROC_EMIT_SHELL:
+ set_memb_shell(opts, od, nm_list, nm_ct);
+ return;
+
+ case (uintptr_t)OPTPROC_RETURN_VALNAME:
+ set_memb_names(opts, od, nm_list, nm_ct);
+ return;
+
+ default:
+ break;
+ }
+
+ if ((od->fOptState & OPTST_RESET) != 0)
+ return;
+
+ {
+ char const * arg;
+ bool invert;
+ uintptr_t res = check_membership_start(od, &arg, &invert);
+ if (arg == NULL)
+ goto fail_return;
+
+ while (*arg != NUL) {
+ bool inv_val = false;
+ int len;
+
+ switch (*arg) {
+ case ',':
+ arg = SPN_WHITESPACE_CHARS(arg+1);
+ if ((*arg == ',') || (*arg == '|'))
+ goto fail_return;
+ continue;
+
+ case '-':
+ case '!':
+ inv_val = true;
+ /* FALLTHROUGH */
+
+ case '+':
+ case '|':
+ arg = SPN_WHITESPACE_CHARS(arg+1);
+ }
+
+ len = (int)(BRK_SET_SEPARATOR_CHARS(arg) - arg);
+ if (len == 0)
+ break;
+
+ if ((len == 3) && (strncmp(arg, zAll, 3) == 0)) {
+ if (inv_val)
+ res = 0;
+ else res = ~0UL;
+ }
+ else if ((len == 4) && (strncmp(arg, zNone, 4) == 0)) {
+ if (! inv_val)
+ res = 0;
+ }
+ else do {
+ char * pz;
+ uintptr_t bit = strtoul(arg, &pz, 0);
+
+ if (pz != arg + len) {
+ bit = find_member_bit(opts, od, pz, len, nm_list, nm_ct);
+ if (bit == 0UL)
+ goto fail_return;
+ }
+ if (inv_val)
+ res &= ~bit;
+ else res |= bit;
+ } while (false);
+
+ arg = SPN_WHITESPACE_CHARS(arg + len);
+ }
+
+ if (invert)
+ res ^= ~0UL;
+
+ if (nm_ct < (8 * sizeof(uintptr_t)))
+ res &= (1UL << nm_ct) - 1UL;
+
+ od->optCookie = (void *)res;
+ }
+ return;
+
+fail_return:
+ od->optCookie = (void *)0;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/enum.c */
diff --git a/sntp/libopts/env.c b/sntp/libopts/env.c
new file mode 100644
index 0000000..7b6615e
--- /dev/null
+++ b/sntp/libopts/env.c
@@ -0,0 +1,267 @@
+
+/**
+ * \file environment.c
+ *
+ * This file contains all of the routines that must be linked into
+ * an executable to use the generated option processing. The optional
+ * routines are in separately compiled modules so that they will not
+ * necessarily be linked in.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static void
+do_env_opt(tOptState * os, char * env_name,
+ tOptions * pOpts, teEnvPresetType type);
+/* = = = END-STATIC-FORWARD = = = */
+
+/*
+ * doPrognameEnv - check for preset values from the ${PROGNAME}
+ * environment variable. This is accomplished by parsing the text into
+ * tokens, temporarily replacing the arg vector and calling
+ * immediate_opts and/or regular_opts.
+ */
+LOCAL void
+doPrognameEnv(tOptions * pOpts, teEnvPresetType type)
+{
+ char const * env_opts = getenv(pOpts->pzPROGNAME);
+ token_list_t* pTL;
+ int sv_argc;
+ proc_state_mask_t sv_flag;
+ char ** sv_argv;
+
+ /*
+ * No such beast? Then bail now.
+ */
+ if (env_opts == NULL)
+ return;
+
+ /*
+ * Tokenize the string. If there's nothing of interest, we'll bail
+ * here immediately.
+ */
+ pTL = ao_string_tokenize(env_opts);
+ if (pTL == NULL)
+ return;
+
+ /*
+ * Substitute our $PROGNAME argument list for the real one
+ */
+ sv_argc = (int)pOpts->origArgCt;
+ sv_argv = pOpts->origArgVect;
+ sv_flag = pOpts->fOptSet;
+
+ /*
+ * We add a bogus pointer to the start of the list. The program name
+ * has already been pulled from "argv", so it won't get dereferenced.
+ * The option scanning code will skip the "program name" at the start
+ * of this list of tokens, so we accommodate this way ....
+ */
+ {
+ uintptr_t v = (uintptr_t)(pTL->tkn_list);
+ pOpts->origArgVect = (void *)(v - sizeof(char *));
+ }
+ pOpts->origArgCt = (unsigned int)pTL->tkn_ct + 1;
+ pOpts->fOptSet &= ~OPTPROC_ERRSTOP;
+
+ pOpts->curOptIdx = 1;
+ pOpts->pzCurOpt = NULL;
+
+ switch (type) {
+ case ENV_IMM:
+ (void)immediate_opts(pOpts);
+ break;
+
+ case ENV_ALL:
+ (void)immediate_opts(pOpts);
+ pOpts->curOptIdx = 1;
+ pOpts->pzCurOpt = NULL;
+ /* FALLTHROUGH */
+
+ case ENV_NON_IMM:
+ (void)regular_opts(pOpts);
+ }
+
+ /*
+ * Free up the temporary arg vector and restore the original program args.
+ */
+ free(pTL);
+ pOpts->origArgVect = sv_argv;
+ pOpts->origArgCt = (unsigned int)sv_argc;
+ pOpts->fOptSet = sv_flag;
+}
+
+static void
+do_env_opt(tOptState * os, char * env_name,
+ tOptions * pOpts, teEnvPresetType type)
+{
+ os->pzOptArg = getenv(env_name);
+ if (os->pzOptArg == NULL)
+ return;
+
+ os->flags = OPTST_PRESET | OPTST_ALLOC_ARG | os->pOD->fOptState;
+ os->optType = TOPT_UNDEFINED;
+
+ if ( (os->pOD->pz_DisablePfx != NULL)
+ && (streqvcmp(os->pzOptArg, os->pOD->pz_DisablePfx) == 0)) {
+ os->flags |= OPTST_DISABLED;
+ os->pzOptArg = NULL;
+ handle_opt(pOpts, os);
+ return;
+ }
+
+ switch (type) {
+ case ENV_IMM:
+ /*
+ * Process only immediate actions
+ */
+ if (DO_IMMEDIATELY(os->flags))
+ break;
+ return;
+
+ case ENV_NON_IMM:
+ /*
+ * Process only NON immediate actions
+ */
+ if (DO_NORMALLY(os->flags) || DO_SECOND_TIME(os->flags))
+ break;
+ return;
+
+ default: /* process everything */
+ break;
+ }
+
+ /*
+ * Make sure the option value string is persistent and consistent.
+ *
+ * The interpretation of the option value depends
+ * on the type of value argument the option takes
+ */
+ if (OPTST_GET_ARGTYPE(os->pOD->fOptState) == OPARG_TYPE_NONE) {
+ /*
+ * Ignore any value.
+ */
+ os->pzOptArg = NULL;
+
+ } else if (os->pzOptArg[0] == NUL) {
+ /*
+ * If the argument is the empty string and the argument is
+ * optional, then treat it as if the option was not specified.
+ */
+ if ((os->pOD->fOptState & OPTST_ARG_OPTIONAL) == 0)
+ return;
+ os->pzOptArg = NULL;
+
+ } else {
+ AGDUPSTR(os->pzOptArg, os->pzOptArg, "option argument");
+ os->flags |= OPTST_ALLOC_ARG;
+ }
+
+ handle_opt(pOpts, os);
+}
+
+/*
+ * env_presets - check for preset values from the envrionment
+ * This routine should process in all, immediate or normal modes....
+ */
+LOCAL void
+env_presets(tOptions * pOpts, teEnvPresetType type)
+{
+ int ct;
+ tOptState st;
+ char* pzFlagName;
+ size_t spaceLeft;
+ char zEnvName[ AO_NAME_SIZE ];
+
+ /*
+ * Finally, see if we are to look at the environment
+ * variables for initial values.
+ */
+ if ((pOpts->fOptSet & OPTPROC_ENVIRON) == 0)
+ return;
+
+ doPrognameEnv(pOpts, type);
+
+ ct = pOpts->presetOptCt;
+ st.pOD = pOpts->pOptDesc;
+
+ pzFlagName = zEnvName
+ + snprintf(zEnvName, sizeof(zEnvName), "%s_", pOpts->pzPROGNAME);
+ spaceLeft = AO_NAME_SIZE - (unsigned long)(pzFlagName - zEnvName) - 1;
+
+ for (;ct-- > 0; st.pOD++) {
+ size_t nln;
+
+ /*
+ * If presetting is disallowed, then skip this entry
+ */
+ if ( ((st.pOD->fOptState & OPTST_NO_INIT) != 0)
+ || (st.pOD->optEquivIndex != NO_EQUIVALENT) )
+ continue;
+
+ /*
+ * IF there is no such environment variable,
+ * THEN skip this entry, too.
+ */
+ nln = strlen(st.pOD->pz_NAME) + 1;
+ if (nln <= spaceLeft) {
+ /*
+ * Set up the option state
+ */
+ memcpy(pzFlagName, st.pOD->pz_NAME, nln);
+ do_env_opt(&st, zEnvName, pOpts, type);
+ }
+ }
+
+ /*
+ * Special handling for ${PROGNAME_LOAD_OPTS}
+ */
+ if ( (pOpts->specOptIdx.save_opts != NO_EQUIVALENT)
+ && (pOpts->specOptIdx.save_opts != 0)) {
+ size_t nln;
+ st.pOD = pOpts->pOptDesc + pOpts->specOptIdx.save_opts + 1;
+
+ if (st.pOD->pz_NAME == NULL)
+ return;
+
+ nln = strlen(st.pOD->pz_NAME) + 1;
+
+ if (nln > spaceLeft)
+ return;
+
+ memcpy(pzFlagName, st.pOD->pz_NAME, nln);
+ do_env_opt(&st, zEnvName, pOpts, type);
+ }
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/environment.c */
diff --git a/sntp/libopts/file.c b/sntp/libopts/file.c
new file mode 100644
index 0000000..ec740c5
--- /dev/null
+++ b/sntp/libopts/file.c
@@ -0,0 +1,201 @@
+
+/**
+ * \file file.c
+ *
+ * Handle options that have file names for arguments.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/**
+ * Make sure the directory containing the subject file exists and that
+ * the file exists or does not exist, per the option requirements.
+ *
+ * @param ftype file existence type flags
+ * @param pOpts program option descriptor
+ * @param pOD the option descriptor
+ */
+static void
+check_existence(teOptFileType ftype, tOptions * pOpts, tOptDesc * pOD)
+{
+ char const * fname = pOD->optArg.argString;
+ struct stat sb;
+
+ errno = 0;
+
+ switch (ftype & FTYPE_MODE_EXIST_MASK) {
+ case FTYPE_MODE_MUST_NOT_EXIST:
+ if ((stat(fname, &sb) == 0) || (errno != ENOENT)) {
+ if (errno == 0)
+ errno = EINVAL;
+ fserr_exit(pOpts->pzProgName, "stat", fname);
+ /* NOTREACHED */
+ }
+ /* FALLTHROUGH */
+
+ default:
+ case FTYPE_MODE_MAY_EXIST:
+ {
+ char * p = strrchr(fname, DIRCH);
+ size_t l;
+
+ if (p == NULL)
+ /*
+ * The file may or may not exist and its directory is ".".
+ * Assume that "." exists.
+ */
+ break;
+
+ l = (size_t)(p - fname);
+ p = AGALOC(l + 1, "fname");
+ memcpy(p, fname, l);
+ p[l] = NUL;
+
+ if ((stat(p, &sb) != 0) || (errno = EINVAL, ! S_ISDIR(sb.st_mode)))
+ fserr_exit(pOpts->pzProgName, "stat", p);
+ /* NOTREACHED */
+
+ AGFREE(p);
+ break;
+ }
+
+ case FTYPE_MODE_MUST_EXIST:
+ if ( (stat(fname, &sb) != 0)
+ || (errno = EINVAL, ! S_ISREG(sb.st_mode)) )
+ fserr_exit(pOpts->pzProgName, "stat", fname);
+ /* NOTREACHED */
+
+ break;
+ }
+}
+
+/**
+ * Open the specified file with open(2) and save the FD.
+ *
+ * @param pOpts program option descriptor
+ * @param pOD the option descriptor
+ * @param mode the open mode (uses int flags value)
+ */
+static void
+open_file_fd(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
+{
+ int fd = open(pOD->optArg.argString, mode.file_flags);
+ if (fd < 0)
+ fserr_exit(pOpts->pzProgName, "open", pOD->optArg.argString);
+ /* NOTREACHED */
+
+ if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
+ pOD->optCookie = (void *)pOD->optArg.argString;
+ else
+ AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
+
+ pOD->optArg.argFd = fd;
+ pOD->fOptState &= ~OPTST_ALLOC_ARG;
+}
+
+/**
+ * Open the specified file with open(2) and save the FD.
+ *
+ * @param pOpts program option descriptor
+ * @param pOD the option descriptor
+ * @param mode the open mode (uses "char *" mode value)
+ */
+static void
+fopen_file_fp(tOptions * pOpts, tOptDesc * pOD, tuFileMode mode)
+{
+ FILE * fp = fopen(pOD->optArg.argString, mode.file_mode);
+ if (fp == NULL)
+ fserr_exit(pOpts->pzProgName, "fopen", pOD->optArg.argString);
+ /* NOTREACHED */
+
+ if ((pOD->fOptState & OPTST_ALLOC_ARG) != 0)
+ pOD->optCookie = (void *)pOD->optArg.argString;
+ else
+ AGDUPSTR(pOD->optCookie, pOD->optArg.argString, "file name");
+
+ pOD->optArg.argFp = fp;
+ pOD->fOptState &= ~OPTST_ALLOC_ARG;
+}
+
+/*=export_func optionFileCheck
+ * private:
+ *
+ * what: Decipher a boolean value
+ * arg: + tOptions* + pOpts + program options descriptor +
+ * arg: + tOptDesc* + pOptDesc + the descriptor for this arg +
+ * arg: + teOptFileType + ftype + File handling type +
+ * arg: + tuFileMode + mode + file open mode (if needed) +
+ *
+ * doc:
+ * Make sure the named file conforms with the file type mode.
+ * The mode specifies if the file must exist, must not exist or may
+ * (or may not) exist. The mode may also specify opening the
+ * file: don't, open just the descriptor (fd), or open as a stream
+ * (FILE* pointer).
+=*/
+void
+optionFileCheck(tOptions * pOpts, tOptDesc * pOD,
+ teOptFileType ftype, tuFileMode mode)
+{
+ if (pOpts <= OPTPROC_EMIT_LIMIT) {
+ if (pOpts != OPTPROC_EMIT_USAGE)
+ return;
+
+ switch (ftype & FTYPE_MODE_EXIST_MASK) {
+ case FTYPE_MODE_MUST_NOT_EXIST:
+ fputs(zFileCannotExist + tab_skip_ct, option_usage_fp);
+ break;
+
+ case FTYPE_MODE_MUST_EXIST:
+ fputs(zFileMustExist + tab_skip_ct, option_usage_fp);
+ break;
+ }
+ return;
+ }
+
+ if ((pOD->fOptState & OPTST_RESET) != 0) {
+ if (pOD->optCookie != NULL)
+ AGFREE(pOD->optCookie);
+ return;
+ }
+
+ check_existence(ftype, pOpts, pOD);
+
+ switch (ftype & FTYPE_MODE_OPEN_MASK) {
+ default:
+ case FTYPE_MODE_NO_OPEN: break;
+ case FTYPE_MODE_OPEN_FD: open_file_fd( pOpts, pOD, mode); break;
+ case FTYPE_MODE_FOPEN_FP: fopen_file_fp(pOpts, pOD, mode); break;
+ }
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/file.c */
diff --git a/sntp/libopts/find.c b/sntp/libopts/find.c
new file mode 100644
index 0000000..1ec02e5
--- /dev/null
+++ b/sntp/libopts/find.c
@@ -0,0 +1,780 @@
+/**
+ * @file check.c
+ *
+ * @brief Hunt for options in the option descriptor list
+ *
+ * This file contains the routines that deal with processing quoted strings
+ * into an internal format.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static int
+parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz);
+
+static void
+opt_ambiguities(tOptions * opts, char const * name, int nm_len);
+
+static int
+opt_match_ct(tOptions * opts, char const * name, int nm_len,
+ int * ixp, bool * disable);
+
+static tSuccess
+opt_set(tOptions * opts, char * arg, int idx, bool disable, tOptState * st);
+
+static tSuccess
+opt_unknown(tOptions * opts, char const * name, char * arg, tOptState * st);
+
+static tSuccess
+opt_ambiguous(tOptions * opts, char const * name, int match_ct);
+
+static tSuccess
+get_opt_arg_must(tOptions * opts, tOptState * o_st);
+
+static tSuccess
+get_opt_arg_may(tOptions * pOpts, tOptState * o_st);
+
+static tSuccess
+get_opt_arg_none(tOptions * pOpts, tOptState* o_st);
+/* = = = END-STATIC-FORWARD = = = */
+
+/**
+ * find the name and name length we are looking for
+ */
+static int
+parse_opt(char const ** nm_pp, char ** arg_pp, char * buf, size_t bufsz)
+{
+ int res = 0;
+ char const * p = *nm_pp;
+ *arg_pp = NULL;
+
+ for (;;) {
+ switch (*(p++)) {
+ case NUL: return res;
+
+ case '=':
+ memcpy(buf, *nm_pp, (size_t)res);
+
+ buf[res] = NUL;
+ *nm_pp = buf;
+ *arg_pp = (char *)p;
+ return res;
+
+ default:
+ if (++res >= (int)bufsz)
+ return -1;
+ }
+ }
+}
+
+/**
+ * print out the options that match the given name.
+ *
+ * @param pOpts option data
+ * @param opt_name name of option to look for
+ */
+static void
+opt_ambiguities(tOptions * opts, char const * name, int nm_len)
+{
+ char const * const hyph =
+ NAMED_OPTS(opts) ? "" : LONG_OPT_MARKER;
+
+ tOptDesc * pOD = opts->pOptDesc;
+ int idx = 0;
+
+ fputs(zambig_list_msg, stderr);
+ do {
+ if (pOD->pz_Name == NULL)
+ continue; /* doc option */
+
+ if (strneqvcmp(name, pOD->pz_Name, nm_len) == 0)
+ fprintf(stderr, zambig_file, hyph, pOD->pz_Name);
+
+ else if ( (pOD->pz_DisableName != NULL)
+ && (strneqvcmp(name, pOD->pz_DisableName, nm_len) == 0)
+ )
+ fprintf(stderr, zambig_file, hyph, pOD->pz_DisableName);
+ } while (pOD++, (++idx < opts->optCt));
+}
+
+/**
+ * Determine the number of options that match the name
+ *
+ * @param pOpts option data
+ * @param opt_name name of option to look for
+ * @param nm_len length of provided name
+ * @param index pointer to int for option index
+ * @param disable pointer to bool to mark disabled option
+ * @return count of options that match
+ */
+static int
+opt_match_ct(tOptions * opts, char const * name, int nm_len,
+ int * ixp, bool * disable)
+{
+ int matchCt = 0;
+ int idx = 0;
+ int idxLim = opts->optCt;
+ tOptDesc * pOD = opts->pOptDesc;
+
+ do {
+ /*
+ * If option disabled or a doc option, skip to next
+ */
+ if (pOD->pz_Name == NULL)
+ continue;
+
+ if ( SKIP_OPT(pOD)
+ && (pOD->fOptState != (OPTST_OMITTED | OPTST_NO_INIT)))
+ continue;
+
+ if (strneqvcmp(name, pOD->pz_Name, nm_len) == 0) {
+ /*
+ * IF we have a complete match
+ * THEN it takes priority over any already located partial
+ */
+ if (pOD->pz_Name[ nm_len ] == NUL) {
+ *ixp = idx;
+ return 1;
+ }
+ }
+
+ /*
+ * IF there is a disable name
+ * *AND* the option name matches the disable name
+ * THEN ...
+ */
+ else if ( (pOD->pz_DisableName != NULL)
+ && (strneqvcmp(name, pOD->pz_DisableName, nm_len) == 0)
+ ) {
+ *disable = true;
+
+ /*
+ * IF we have a complete match
+ * THEN it takes priority over any already located partial
+ */
+ if (pOD->pz_DisableName[ nm_len ] == NUL) {
+ *ixp = idx;
+ return 1;
+ }
+ }
+
+ else
+ continue; /* does not match any option */
+
+ /*
+ * We found a full or partial match, either regular or disabling.
+ * Remember the index for later.
+ */
+ *ixp = idx;
+ ++matchCt;
+
+ } while (pOD++, (++idx < idxLim));
+
+ return matchCt;
+}
+
+/**
+ * Set the option to the indicated option number.
+ *
+ * @param opts option data
+ * @param arg option argument (if glued to name)
+ * @param idx option index
+ * @param disable mark disabled option
+ * @param st state about current option
+ */
+static tSuccess
+opt_set(tOptions * opts, char * arg, int idx, bool disable, tOptState * st)
+{
+ tOptDesc * pOD = opts->pOptDesc + idx;
+
+ if (SKIP_OPT(pOD)) {
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) == 0)
+ return FAILURE;
+
+ fprintf(stderr, zDisabledErr, opts->pzProgName, pOD->pz_Name);
+ if (pOD->pzText != NULL)
+ fprintf(stderr, SET_OFF_FMT, pOD->pzText);
+ fputc(NL, stderr);
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE); /* to be certain */
+ }
+
+ /*
+ * IF we found a disablement name,
+ * THEN set the bit in the callers' flag word
+ */
+ if (disable)
+ st->flags |= OPTST_DISABLED;
+
+ st->pOD = pOD;
+ st->pzOptArg = arg;
+ st->optType = TOPT_LONG;
+
+ return SUCCESS;
+}
+
+/**
+ * An option was not found. Check for default option and set it
+ * if there is one. Otherwise, handle the error.
+ *
+ * @param opts option data
+ * @param name name of option to look for
+ * @param arg option argument
+ * @param st state about current option
+ *
+ * @return success status
+ */
+static tSuccess
+opt_unknown(tOptions * opts, char const * name, char * arg, tOptState * st)
+{
+ /*
+ * IF there is no equal sign
+ * *AND* we are using named arguments
+ * *AND* there is a default named option,
+ * THEN return that option.
+ */
+ if ( (arg == NULL)
+ && NAMED_OPTS(opts)
+ && (opts->specOptIdx.default_opt != NO_EQUIVALENT)) {
+
+ st->pOD = opts->pOptDesc + opts->specOptIdx.default_opt;
+ st->pzOptArg = name;
+ st->optType = TOPT_DEFAULT;
+ return SUCCESS;
+ }
+
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0) {
+ fprintf(stderr, zIllOptStr, opts->pzProgPath, name);
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE); /* to be certain */
+ }
+
+ return FAILURE;
+}
+
+/**
+ * Several options match the provided name.
+ *
+ * @param opts option data
+ * @param name name of option to look for
+ * @param match_ct number of matching options
+ *
+ * @return success status (always FAILURE, if it returns)
+ */
+static tSuccess
+opt_ambiguous(tOptions * opts, char const * name, int match_ct)
+{
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0) {
+ fprintf(stderr, zambig_opt_fmt, opts->pzProgPath, name, match_ct);
+ if (match_ct <= 4)
+ opt_ambiguities(opts, name, (int)strlen(name));
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE); /* to be certain */
+ }
+ return FAILURE;
+}
+
+/*=export_func optionVendorOption
+ * private:
+ *
+ * what: Process a vendor option
+ * arg: + tOptions * + pOpts + program options descriptor +
+ * arg: + tOptDesc * + pOptDesc + the descriptor for this arg +
+ *
+ * doc:
+ * For POSIX specified utilities, the options are constrained to the options,
+ * @xref{config attributes, Program Configuration}. AutoOpts clients should
+ * never specify this directly. It gets referenced when the option
+ * definitions contain a "vendor-opt" attribute.
+=*/
+void
+optionVendorOption(tOptions * pOpts, tOptDesc * pOD)
+{
+ tOptState opt_st = OPTSTATE_INITIALIZER(PRESET);
+ char const * vopt_str = pOD->optArg.argString;
+
+ if (pOpts <= OPTPROC_EMIT_LIMIT)
+ return;
+
+ if ((pOD->fOptState & OPTST_RESET) != 0)
+ return;
+
+ if ((pOD->fOptState & OPTPROC_IMMEDIATE) == 0)
+ opt_st.flags = OPTST_DEFINED;
+
+ if ( ((pOpts->fOptSet & OPTPROC_VENDOR_OPT) == 0)
+ || ! SUCCESSFUL(opt_find_long(pOpts, vopt_str, &opt_st))
+ || ! SUCCESSFUL(get_opt_arg(pOpts, &opt_st)) )
+ {
+ fprintf(stderr, zIllVendOptStr, pOpts->pzProgName, vopt_str);
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE); /* to be certain */
+ }
+
+ /*
+ * See if we are in immediate handling state.
+ */
+ if (pOpts->fOptSet & OPTPROC_IMMEDIATE) {
+ /*
+ * See if the enclosed option is okay with that state.
+ */
+ if (DO_IMMEDIATELY(opt_st.flags))
+ (void)handle_opt(pOpts, &opt_st);
+
+ } else {
+ /*
+ * non-immediate direction.
+ * See if the enclosed option is okay with that state.
+ */
+ if (DO_NORMALLY(opt_st.flags) || DO_SECOND_TIME(opt_st.flags))
+ (void)handle_opt(pOpts, &opt_st);
+ }
+}
+
+/**
+ * Find the option descriptor by full name.
+ *
+ * @param opts option data
+ * @param opt_name name of option to look for
+ * @param state state about current option
+ *
+ * @return success status
+ */
+LOCAL tSuccess
+opt_find_long(tOptions * opts, char const * opt_name, tOptState * state)
+{
+ char name_buf[128];
+ char * opt_arg;
+ int nm_len = parse_opt(&opt_name, &opt_arg, name_buf, sizeof(name_buf));
+
+ int idx = 0;
+ bool disable = false;
+ int ct;
+
+ if (nm_len <= 1) {
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) == 0)
+ return FAILURE;
+
+ fprintf(stderr, zInvalOptName, opts->pzProgName, opt_name);
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE); /* to be certain */
+ }
+
+ ct = opt_match_ct(opts, opt_name, nm_len, &idx, &disable);
+
+ /*
+ * See if we found one match, no matches or multiple matches.
+ */
+ switch (ct) {
+ case 1: return opt_set(opts, opt_arg, idx, disable, state);
+ case 0: return opt_unknown(opts, opt_name, opt_arg, state);
+ default: return opt_ambiguous(opts, opt_name, ct);
+ }
+}
+
+
+/**
+ * Find the short option descriptor for the current option
+ *
+ * @param pOpts option data
+ * @param optValue option flag character
+ * @param pOptState state about current option
+ */
+LOCAL tSuccess
+opt_find_short(tOptions* pOpts, uint_t optValue, tOptState* pOptState)
+{
+ tOptDesc* pRes = pOpts->pOptDesc;
+ int ct = pOpts->optCt;
+
+ /*
+ * Search the option list
+ */
+ do {
+ if (optValue != pRes->optValue)
+ continue;
+
+ if (SKIP_OPT(pRes)) {
+ if ( (pRes->fOptState == (OPTST_OMITTED | OPTST_NO_INIT))
+ && (pRes->pz_Name != NULL)) {
+ if ((pOpts->fOptSet & OPTPROC_ERRSTOP) == 0)
+ return FAILURE;
+
+ fprintf(stderr, zDisabledErr, pOpts->pzProgPath, pRes->pz_Name);
+ if (pRes->pzText != NULL)
+ fprintf(stderr, SET_OFF_FMT, pRes->pzText);
+ fputc(NL, stderr);
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE); /* to be certain */
+ }
+ goto short_opt_error;
+ }
+
+ pOptState->pOD = pRes;
+ pOptState->optType = TOPT_SHORT;
+ return SUCCESS;
+
+ } while (pRes++, --ct > 0);
+
+ /*
+ * IF the character value is a digit
+ * AND there is a special number option ("-n")
+ * THEN the result is the "option" itself and the
+ * option is the specially marked "number" option.
+ */
+ if ( IS_DEC_DIGIT_CHAR(optValue)
+ && (pOpts->specOptIdx.number_option != NO_EQUIVALENT) ) {
+ pOptState->pOD = \
+ pRes = pOpts->pOptDesc + pOpts->specOptIdx.number_option;
+ (pOpts->pzCurOpt)--;
+ pOptState->optType = TOPT_SHORT;
+ return SUCCESS;
+ }
+
+ short_opt_error:
+
+ /*
+ * IF we are to stop on errors (the default, actually)
+ * THEN call the usage procedure.
+ */
+ if ((pOpts->fOptSet & OPTPROC_ERRSTOP) != 0) {
+ fprintf(stderr, zIllOptChr, pOpts->pzProgPath, optValue);
+ (*pOpts->pUsageProc)(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE); /* to be certain */
+ }
+
+ return FAILURE;
+}
+
+/**
+ * Process option with a required argument. Long options can either have a
+ * separate command line argument, or an argument attached by the '='
+ * character. Figure out which.
+ *
+ * @param[in,out] opts the program option descriptor
+ * @param[in,out] o_st the option processing state
+ * @returns SUCCESS or FAILURE
+ */
+static tSuccess
+get_opt_arg_must(tOptions * opts, tOptState * o_st)
+{
+ switch (o_st->optType) {
+ case TOPT_SHORT:
+ /*
+ * See if an arg string follows the flag character
+ */
+ if (*++(opts->pzCurOpt) == NUL)
+ opts->pzCurOpt = opts->origArgVect[ opts->curOptIdx++ ];
+ o_st->pzOptArg = opts->pzCurOpt;
+ break;
+
+ case TOPT_LONG:
+ /*
+ * See if an arg string has already been assigned (glued on
+ * with an `=' character)
+ */
+ if (o_st->pzOptArg == NULL)
+ o_st->pzOptArg = opts->origArgVect[ opts->curOptIdx++ ];
+ break;
+
+ default:
+#ifdef DEBUG
+ fputs("AutoOpts lib error: option type not selected\n", stderr);
+ option_exits(EXIT_FAILURE);
+#endif
+
+ case TOPT_DEFAULT:
+ /*
+ * The option was selected by default. The current token is
+ * the option argument.
+ */
+ break;
+ }
+
+ /*
+ * Make sure we did not overflow the argument list.
+ */
+ if (opts->curOptIdx > opts->origArgCt) {
+ fprintf(stderr, zMisArg, opts->pzProgPath, o_st->pOD->pz_Name);
+ return FAILURE;
+ }
+
+ opts->pzCurOpt = NULL; /* next time advance to next arg */
+ return SUCCESS;
+}
+
+/**
+ * Process an option with an optional argument. For short options, it looks
+ * at the character after the option character, or it consumes the next full
+ * argument. For long options, it looks for an '=' character attachment to
+ * the long option name before deciding to take the next command line
+ * argument.
+ *
+ * @param pOpts the option descriptor
+ * @param o_st a structure for managing the current processing state
+ * @returns SUCCESS or does not return
+ */
+static tSuccess
+get_opt_arg_may(tOptions * pOpts, tOptState * o_st)
+{
+ /*
+ * An option argument is optional.
+ */
+ switch (o_st->optType) {
+ case TOPT_SHORT:
+ if (*++pOpts->pzCurOpt != NUL)
+ o_st->pzOptArg = pOpts->pzCurOpt;
+ else {
+ char* pzLA = pOpts->origArgVect[ pOpts->curOptIdx ];
+
+ /*
+ * BECAUSE it is optional, we must make sure
+ * we did not find another flag and that there
+ * is such an argument.
+ */
+ if ((pzLA == NULL) || (*pzLA == '-'))
+ o_st->pzOptArg = NULL;
+ else {
+ pOpts->curOptIdx++; /* argument found */
+ o_st->pzOptArg = pzLA;
+ }
+ }
+ break;
+
+ case TOPT_LONG:
+ /*
+ * Look for an argument if we don't already have one (glued on
+ * with a `=' character) *AND* we are not in named argument mode
+ */
+ if ( (o_st->pzOptArg == NULL)
+ && (! NAMED_OPTS(pOpts))) {
+ char* pzLA = pOpts->origArgVect[ pOpts->curOptIdx ];
+
+ /*
+ * BECAUSE it is optional, we must make sure
+ * we did not find another flag and that there
+ * is such an argument.
+ */
+ if ((pzLA == NULL) || (*pzLA == '-'))
+ o_st->pzOptArg = NULL;
+ else {
+ pOpts->curOptIdx++; /* argument found */
+ o_st->pzOptArg = pzLA;
+ }
+ }
+ break;
+
+ default:
+ case TOPT_DEFAULT:
+ ao_bug(zbad_default_msg);
+ }
+
+ /*
+ * After an option with an optional argument, we will
+ * *always* start with the next option because if there
+ * were any characters following the option name/flag,
+ * they would be interpreted as the argument.
+ */
+ pOpts->pzCurOpt = NULL;
+ return SUCCESS;
+}
+
+/**
+ * Process option that does not have an argument.
+ *
+ * @param[in,out] opts the program option descriptor
+ * @param[in,out] o_st the option processing state
+ * @returns SUCCESS or FAILURE
+ */
+static tSuccess
+get_opt_arg_none(tOptions * pOpts, tOptState* o_st)
+{
+ /*
+ * No option argument. Make sure next time around we find
+ * the correct option flag character for short options
+ */
+ if (o_st->optType == TOPT_SHORT)
+ (pOpts->pzCurOpt)++;
+
+ /*
+ * It is a long option. Make sure there was no ``=xxx'' argument
+ */
+ else if (o_st->pzOptArg != NULL) {
+ fprintf(stderr, zNoArg, pOpts->pzProgPath, o_st->pOD->pz_Name);
+ return FAILURE;
+ }
+
+ /*
+ * It is a long option. Advance to next command line argument.
+ */
+ else
+ pOpts->pzCurOpt = NULL;
+ return SUCCESS;
+}
+
+/**
+ * Process option. Figure out whether or not to look for an option argument.
+ *
+ * @param[in,out] opts the program option descriptor
+ * @param[in,out] o_st the option processing state
+ * @returns SUCCESS or FAILURE
+ */
+LOCAL tSuccess
+get_opt_arg(tOptions * opts, tOptState * o_st)
+{
+ o_st->flags |= (o_st->pOD->fOptState & OPTST_PERSISTENT_MASK);
+
+ /*
+ * Disabled options and options specified to not have arguments
+ * are handled with the "none" procedure. Otherwise, check the
+ * optional flag and call either the "may" or "must" function.
+ */
+ if ( ((o_st->flags & OPTST_DISABLED) != 0)
+ || (OPTST_GET_ARGTYPE(o_st->flags) == OPARG_TYPE_NONE))
+ return get_opt_arg_none(opts, o_st);
+
+ if (o_st->flags & OPTST_ARG_OPTIONAL)
+ return get_opt_arg_may( opts, o_st);
+
+ return get_opt_arg_must(opts, o_st);
+}
+
+/**
+ * Find the option descriptor for the current option.
+ *
+ * @param[in,out] opts the program option descriptor
+ * @param[in,out] o_st the option processing state
+ * @returns SUCCESS or FAILURE
+ */
+LOCAL tSuccess
+find_opt(tOptions * opts, tOptState * o_st)
+{
+ /*
+ * IF we are continuing a short option list (e.g. -xyz...)
+ * THEN continue a single flag option.
+ * OTHERWISE see if there is room to advance and then do so.
+ */
+ if ((opts->pzCurOpt != NULL) && (*opts->pzCurOpt != NUL))
+ return opt_find_short(opts, (uint8_t)*(opts->pzCurOpt), o_st);
+
+ if (opts->curOptIdx >= opts->origArgCt)
+ return PROBLEM; /* NORMAL COMPLETION */
+
+ opts->pzCurOpt = opts->origArgVect[ opts->curOptIdx ];
+
+ /*
+ * IF all arguments must be named options, ...
+ */
+ if (NAMED_OPTS(opts)) {
+ char * pz = opts->pzCurOpt;
+ int def;
+ tSuccess res;
+ uint16_t * def_opt;
+
+ opts->curOptIdx++;
+
+ if (*pz != '-')
+ return opt_find_long(opts, pz, o_st);
+
+ /*
+ * The name is prefixed with one or more hyphens. Strip them off
+ * and disable the "default_opt" setting. Use heavy recasting to
+ * strip off the "const" quality of the "default_opt" field.
+ */
+ while (*(++pz) == '-') ;
+ def_opt = (void *)&(opts->specOptIdx.default_opt);
+ def = *def_opt;
+ *def_opt = NO_EQUIVALENT;
+ res = opt_find_long(opts, pz, o_st);
+ *def_opt = (uint16_t)def;
+ return res;
+ }
+
+ /*
+ * Note the kind of flag/option marker
+ */
+ if (*((opts->pzCurOpt)++) != '-')
+ return PROBLEM; /* NORMAL COMPLETION - this + rest are operands */
+
+ /*
+ * Special hack for a hyphen by itself
+ */
+ if (*(opts->pzCurOpt) == NUL)
+ return PROBLEM; /* NORMAL COMPLETION - this + rest are operands */
+
+ /*
+ * The current argument is to be processed as an option argument
+ */
+ opts->curOptIdx++;
+
+ /*
+ * We have an option marker.
+ * Test the next character for long option indication
+ */
+ if (opts->pzCurOpt[0] == '-') {
+ if (*++(opts->pzCurOpt) == NUL)
+ /*
+ * NORMAL COMPLETION - NOT this arg, but rest are operands
+ */
+ return PROBLEM;
+
+ /*
+ * We do not allow the hyphen to be used as a flag value.
+ * Therefore, if long options are not to be accepted, we punt.
+ */
+ if ((opts->fOptSet & OPTPROC_LONGOPT) == 0) {
+ fprintf(stderr, zIllOptStr, opts->pzProgPath, opts->pzCurOpt-2);
+ return FAILURE;
+ }
+
+ return opt_find_long(opts, opts->pzCurOpt, o_st);
+ }
+
+ /*
+ * If short options are not allowed, then do long
+ * option processing. Otherwise the character must be a
+ * short (i.e. single character) option.
+ */
+ if ((opts->fOptSet & OPTPROC_SHORTOPT) != 0)
+ return opt_find_short(opts, (uint8_t)*(opts->pzCurOpt), o_st);
+
+ return opt_find_long(opts, opts->pzCurOpt, o_st);
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/find.c */
diff --git a/sntp/libopts/genshell.c b/sntp/libopts/genshell.c
new file mode 100644
index 0000000..20e6c15
--- /dev/null
+++ b/sntp/libopts/genshell.c
@@ -0,0 +1,847 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (genshell.c)
+ *
+ * It has been AutoGen-ed
+ * From the definitions genshell.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the genshellopt author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The genshellopt program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1999-2014 Bruce Korb, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the GNU Lesser General Public License,
+ * version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
+ *
+ * The genshellopt library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
+ */
+
+#ifndef __doxygen__
+#define OPTION_CODE_COMPILE 1
+#include "genshell.h"
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern FILE * option_usage_fp;
+#define zCopyright (genshellopt_opt_strs+0)
+#define zLicenseDescrip (genshellopt_opt_strs+285)
+
+extern tUsageProc genshelloptUsage;
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/**
+ * static const strings for genshellopt options
+ */
+static char const genshellopt_opt_strs[1769] =
+/* 0 */ "genshellopt 1\n"
+ "Copyright (C) 1999-2014 Bruce Korb, all rights reserved.\n"
+ "This is free software. It is licensed for use, modification and\n"
+ "redistribution under the terms of the GNU Lesser General Public License,\n"
+ "version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n\0"
+/* 285 */ "The genshellopt library is free software; you can redistribute it and/or\n"
+ "modify it under the terms of the GNU Library General Public License as\n"
+ "published by the Free Software Foundation; either version 2 of the License,\n"
+ "or (at your option) any later version.\n\n"
+ "This library is distributed in the hope that it will be useful, but WITHOUT\n"
+ "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
+ "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public\n"
+ "License for more details.\n\n"
+ "You should have received a copy of the GNU Library General Public License\n"
+ "along with this library; if not, see\n"
+ "<http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n\0"
+/* 957 */ "Output Script File\0"
+/* 976 */ "SCRIPT\0"
+/* 983 */ "script\0"
+/* 990 */ "Shell name (follows \"#!\" magic)\0"
+/* 1022 */ "SHELL\0"
+/* 1028 */ "no-shell\0"
+/* 1037 */ "no\0"
+/* 1040 */ "display extended usage information and exit\0"
+/* 1084 */ "help\0"
+/* 1089 */ "extended usage information passed thru pager\0"
+/* 1134 */ "more-help\0"
+/* 1144 */ "output version information and exit\0"
+/* 1180 */ "version\0"
+/* 1188 */ "GENSHELLOPT\0"
+/* 1200 */ "genshellopt - Generate Shell Option Processing Script - Ver. 1\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
+/* 1321 */ "autogen-users@lists.sourceforge.net\0"
+/* 1357 */ "Note that 'shell' is only useful if the output file does not already exist.\n"
+ "If it does, then the shell name and optional first argument will be\n"
+ "extracted from the script file.\n\0"
+/* 1534 */ "If the script file already exists and contains Automated Option Processing\n"
+ "text, the second line of the file through the ending tag will be replaced\n"
+ "by the newly generated text. The first '#!' line will be regenerated.\n\0"
+/* 1755 */ "genshellopt 1";
+
+/**
+ * script option description:
+ */
+/** Descriptive text for the script option */
+#define SCRIPT_DESC (genshellopt_opt_strs+957)
+/** Upper-cased name for the script option */
+#define SCRIPT_NAME (genshellopt_opt_strs+976)
+/** Name string for the script option */
+#define SCRIPT_name (genshellopt_opt_strs+983)
+/** Compiled in flag settings for the script option */
+#define SCRIPT_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * shell option description:
+ */
+/** Descriptive text for the shell option */
+#define SHELL_DESC (genshellopt_opt_strs+990)
+/** Upper-cased name for the shell option */
+#define SHELL_NAME (genshellopt_opt_strs+1022)
+/** disablement name for the shell option */
+#define NOT_SHELL_name (genshellopt_opt_strs+1028)
+/** disablement prefix for the shell option */
+#define NOT_SHELL_PFX (genshellopt_opt_strs+1037)
+/** Name string for the shell option */
+#define SHELL_name (NOT_SHELL_name + 3)
+/** Compiled in flag settings for the shell option */
+#define SHELL_FLAGS (OPTST_INITENABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/*
+ * Help/More_Help/Version option descriptions:
+ */
+#define HELP_DESC (genshellopt_opt_strs+1040)
+#define HELP_name (genshellopt_opt_strs+1084)
+#ifdef HAVE_WORKING_FORK
+#define MORE_HELP_DESC (genshellopt_opt_strs+1089)
+#define MORE_HELP_name (genshellopt_opt_strs+1134)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+#define MORE_HELP_DESC HELP_DESC
+#define MORE_HELP_name HELP_name
+#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#endif
+#ifdef NO_OPTIONAL_OPT_ARGS
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
+#endif
+#define VER_DESC (genshellopt_opt_strs+1144)
+#define VER_name (genshellopt_opt_strs+1180)
+/**
+ * Declare option callback procedures
+ */
+extern tOptProc
+ optionBooleanVal, optionNestedVal, optionNumericVal,
+ optionPagedUsage, optionPrintVersion, optionResetOpt,
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVendorOption;
+static tOptProc
+ doUsageOpt;
+#define VER_PROC optionPrintVersion
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the genshellopt Option Descriptions.
+ * This is an array of GENSHELL_OPTION_CT entries, one for each
+ * option that the genshellopt program responds to.
+ */
+static tOptDesc optDesc[GENSHELL_OPTION_CT] = {
+ { /* entry idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT,
+ /* equiv idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SCRIPT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --script */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SCRIPT_DESC, SCRIPT_NAME, SCRIPT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 1, VALUE_GENSHELL_OPT_SHELL,
+ /* equiv idx, value */ 1, VALUE_GENSHELL_OPT_SHELL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SHELL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --shell */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SHELL_DESC, SHELL_NAME, SHELL_name,
+ /* disablement strs */ NOT_SHELL_name, NOT_SHELL_PFX },
+
+ { /* entry idx, value */ INDEX_GENSHELL_OPT_VERSION, VALUE_GENSHELL_OPT_VERSION,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_VERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ VER_PROC,
+ /* desc, NAME, name */ VER_DESC, NULL, VER_name,
+ /* disablement strs */ NULL, NULL },
+
+
+
+ { /* entry idx, value */ INDEX_GENSHELL_OPT_HELP, VALUE_GENSHELL_OPT_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doUsageOpt,
+ /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_GENSHELL_OPT_MORE_HELP, VALUE_GENSHELL_OPT_MORE_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_MORE_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionPagedUsage,
+ /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
+ /* disablement strs */ NULL, NULL }
+};
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of genshellopt. */
+#define zPROGNAME (genshellopt_opt_strs+1188)
+/** Reference to the title line for genshellopt usage. */
+#define zUsageTitle (genshellopt_opt_strs+1200)
+/** There is no genshellopt configuration file. */
+#define zRcName NULL
+/** There are no directories to search for genshellopt config files. */
+#define apzHomeList NULL
+/** The genshellopt program bug email address. */
+#define zBugsAddr (genshellopt_opt_strs+1321)
+/** Clarification/explanation of what genshellopt does. */
+#define zExplain (genshellopt_opt_strs+1357)
+/** Extra detail explaining what genshellopt does. */
+#define zDetail (genshellopt_opt_strs+1534)
+/** The full version string for genshellopt. */
+#define zFullVersion (genshellopt_opt_strs+1755)
+/* extracted from optcode.tlib near line 364 */
+
+#if defined(ENABLE_NLS)
+# define OPTPROC_BASE OPTPROC_TRANSLATE
+ static tOptionXlateProc translate_option_strings;
+#else
+# define OPTPROC_BASE OPTPROC_NONE
+# define translate_option_strings NULL
+#endif /* ENABLE_NLS */
+
+#define genshellopt_full_usage (NULL)
+#define genshellopt_short_usage (NULL)
+
+#endif /* not defined __doxygen__ */
+
+/*
+ * Create the static procedure(s) declared above.
+ */
+/**
+ * The callout function that invokes the genshelloptUsage function.
+ *
+ * @param[in] opts the AutoOpts option description structure
+ * @param[in] od the descriptor for the "help" (usage) option.
+ * @noreturn
+ */
+static void
+doUsageOpt(tOptions * opts, tOptDesc * od)
+{
+ int ex_code;
+ ex_code = GENSHELLOPT_EXIT_SUCCESS;
+ genshelloptUsage(&genshelloptOptions, ex_code);
+ /* NOTREACHED */
+ exit(1);
+ (void)opts;
+ (void)od;
+}
+/* extracted from optmain.tlib near line 1245 */
+
+/**
+ * The directory containing the data associated with genshellopt.
+ */
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+/**
+ * Information about the person or institution that packaged genshellopt
+ * for the current distribution.
+ */
+#ifndef WITH_PACKAGER
+# define genshellopt_packager_info NULL
+#else
+/** Packager information for genshellopt. */
+static char const genshellopt_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport genshellopt bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+#ifndef __doxygen__
+
+#endif /* __doxygen__ */
+/**
+ * The option definitions for genshellopt. The one structure that
+ * binds them all.
+ */
+tOptions genshelloptOptions = {
+ OPTIONS_STRUCT_VERSION,
+ 0, NULL, /* original argc + argv */
+ ( OPTPROC_BASE
+ + OPTPROC_ERRSTOP
+ + OPTPROC_SHORTOPT
+ + OPTPROC_LONGOPT
+ + OPTPROC_NO_REQ_OPT
+ + OPTPROC_NEGATIONS
+ + OPTPROC_NO_ARGS ),
+ 0, NULL, /* current option index, current option */
+ NULL, NULL, zPROGNAME,
+ zRcName, zCopyright, zLicenseDescrip,
+ zFullVersion, apzHomeList, zUsageTitle,
+ zExplain, zDetail, optDesc,
+ zBugsAddr, /* address to send bugs to */
+ NULL, NULL, /* extensions/saved state */
+ genshelloptUsage, /* usage procedure */
+ translate_option_strings, /* translation procedure */
+ /*
+ * Indexes to special options
+ */
+ { INDEX_GENSHELL_OPT_MORE_HELP, /* more-help option index */
+ NO_EQUIVALENT, /* save option index */
+ NO_EQUIVALENT, /* '-#' option index */
+ NO_EQUIVALENT /* index of default opt */
+ },
+ 5 /* full option count */, 2 /* user option count */,
+ genshellopt_full_usage, genshellopt_short_usage,
+ NULL, NULL,
+ PKGDATADIR, genshellopt_packager_info
+};
+
+#if ENABLE_NLS
+/**
+ * This code is designed to translate translatable option text for the
+ * genshellopt program. These translations happen upon entry
+ * to optionProcess().
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#ifdef HAVE_DCGETTEXT
+# include <gettext.h>
+#endif
+#include <autoopts/usage-txt.h>
+
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
+
+/**
+ * AutoGen specific wrapper function for gettext. It relies on the macro _()
+ * to convert from English to the target language, then strdup-duplicates the
+ * result string. It tries the "libopts" domain first, then whatever has been
+ * set via the \a textdomain(3) call.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
+AO_gettext(char const * pz)
+{
+ char * res;
+ if (pz == NULL)
+ return NULL;
+#ifdef HAVE_DCGETTEXT
+ /*
+ * While processing the option_xlateable_txt data, try to use the
+ * "libopts" domain. Once we switch to the option descriptor data,
+ * do *not* use that domain.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ res = dgettext("libopts", pz);
+ if (res == pz)
+ res = (char *)(void *)_(pz);
+ } else
+ res = (char *)(void *)_(pz);
+#else
+ res = (char *)(void *)_(pz);
+#endif
+ if (res == pz)
+ return res;
+ res = strdup(res);
+ if (res == NULL) {
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(GENSHELLOPT_EXIT_FAILURE);
+ }
+ return res;
+}
+
+/**
+ * All the pointers we use are marked "* const", but they are stored in
+ * writable memory. Coerce the mutability and set the pointer.
+ */
+static void coerce_it(void ** s) { *s = AO_gettext(*s);
+}
+
+/**
+ * Translate all the translatable strings in the genshelloptOptions
+ * structure defined above. This is done only once.
+ */
+static void
+translate_option_strings(void)
+{
+ tOptions * const opts = &genshelloptOptions;
+
+ /*
+ * Guard against re-translation. It won't work. The strings will have
+ * been changed by the first pass through this code. One shot only.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ /*
+ * Do the translations. The first pointer follows the field count
+ * field. The field count field is the size of a pointer.
+ */
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
+
+ do {
+ ppz++; /* skip over field_ct */
+ *ppz = AO_gettext(*ppz);
+ } while (--ix > 0);
+ /* prevent re-translation and disable "libopts" domain lookup */
+ option_xlateable_txt.field_ct = 0;
+
+ coerce_it((void*)&(opts->pzCopyright));
+ coerce_it((void*)&(opts->pzCopyNotice));
+ coerce_it((void*)&(opts->pzFullVersion));
+ coerce_it((void*)&(opts->pzUsageTitle));
+ coerce_it((void*)&(opts->pzExplain));
+ coerce_it((void*)&(opts->pzDetail));
+ {
+ tOptDesc * od = opts->pOptDesc;
+ for (ix = opts->optCt; ix > 0; ix--, od++)
+ coerce_it((void*)&(od->pzText));
+ }
+ }
+}
+#endif /* ENABLE_NLS */
+
+#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
+/** I18N function strictly for xgettext. Do not compile. */
+static void bogus_function(void) {
+ /* TRANSLATORS:
+
+ The following dummy function was crated solely so that xgettext can
+ extract the correct strings. These strings are actually referenced
+ by a field name in the genshelloptOptions structure noted in the
+ comments below. The literal text is defined in genshellopt_opt_strs.
+
+ NOTE: the strings below are segmented with respect to the source string
+ genshellopt_opt_strs. The strings above are handed off for translation
+ at run time a paragraph at a time. Consequently, they are presented here
+ for translation a paragraph at a time.
+
+ ALSO: often the description for an option will reference another option
+ by name. These are set off with apostrophe quotes (I hope). Do not
+ translate option names.
+ */
+ /* referenced via genshelloptOptions.pzCopyright */
+ puts(_("genshellopt 1\n\
+Copyright (C) 1999-2014 Bruce Korb, all rights reserved.\n\
+This is free software. It is licensed for use, modification and\n\
+redistribution under the terms of the GNU Lesser General Public License,\n\
+version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n"));
+
+ /* referenced via genshelloptOptions.pzCopyNotice */
+ puts(_("The genshellopt library is free software; you can redistribute it and/or\n\
+modify it under the terms of the GNU Library General Public License as\n\
+published by the Free Software Foundation; either version 2 of the License,\n\
+or (at your option) any later version.\n\n"));
+ puts(_("This library is distributed in the hope that it will be useful, but WITHOUT\n\
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public\n\
+License for more details.\n\n"));
+ puts(_("You should have received a copy of the GNU Library General Public License\n\
+along with this library; if not, see\n\
+<http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n"));
+
+ /* referenced via genshelloptOptions.pOptDesc->pzText */
+ puts(_("Output Script File"));
+
+ /* referenced via genshelloptOptions.pOptDesc->pzText */
+ puts(_("Shell name (follows \"#!\" magic)"));
+
+ /* referenced via genshelloptOptions.pOptDesc->pzText */
+ puts(_("display extended usage information and exit"));
+
+ /* referenced via genshelloptOptions.pOptDesc->pzText */
+ puts(_("extended usage information passed thru pager"));
+
+ /* referenced via genshelloptOptions.pOptDesc->pzText */
+ puts(_("output version information and exit"));
+
+ /* referenced via genshelloptOptions.pzUsageTitle */
+ puts(_("genshellopt - Generate Shell Option Processing Script - Ver. 1\n\
+Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
+
+ /* referenced via genshelloptOptions.pzExplain */
+ puts(_("Note that 'shell' is only useful if the output file does not already exist.\n\
+If it does, then the shell name and optional first argument will be\n\
+extracted from the script file.\n"));
+
+ /* referenced via genshelloptOptions.pzDetail */
+ puts(_("If the script file already exists and contains Automated Option Processing\n\
+text, the second line of the file through the ending tag will be replaced\n\
+by the newly generated text. The first '#!' line will be regenerated.\n"));
+
+ /* referenced via genshelloptOptions.pzFullVersion */
+ puts(_("genshellopt 1"));
+
+ /* referenced via genshelloptOptions.pzFullUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+
+ /* referenced via genshelloptOptions.pzShortUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 90 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 88 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 92 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* uncompilable code */
+#ifdef __cplusplus
+}
+#endif
+/* genshell.c ends here */
diff --git a/sntp/libopts/genshell.h b/sntp/libopts/genshell.h
new file mode 100644
index 0000000..1c18735
--- /dev/null
+++ b/sntp/libopts/genshell.h
@@ -0,0 +1,209 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (genshell.h)
+ *
+ * It has been AutoGen-ed
+ * From the definitions genshell.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the genshellopt author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The genshellopt program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1999-2014 Bruce Korb, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the GNU Lesser General Public License,
+ * version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
+ *
+ * The genshellopt library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
+ */
+/**
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the genshellopt program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_GENSHELL_H_GUARD
+#define AUTOOPTS_GENSHELL_H_GUARD 1
+#include <autoopts/options.h>
+
+/**
+ * Ensure that the library used for compiling this generated header is at
+ * least as new as the version current when the header template was released
+ * (not counting patch version increments). Also ensure that the oldest
+ * tolerable version is at least as old as what was current when the header
+ * template was released.
+ */
+#define AO_TEMPLATE_VERSION 167936
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+ Choke Me.
+#endif
+
+/**
+ * Enumeration of each option type for genshellopt
+ */
+typedef enum {
+ INDEX_GENSHELL_OPT_SCRIPT = 0,
+ INDEX_GENSHELL_OPT_SHELL = 1,
+ INDEX_GENSHELL_OPT_VERSION = 2,
+ INDEX_GENSHELL_OPT_HELP = 3,
+ INDEX_GENSHELL_OPT_MORE_HELP = 4
+} teGenshell_OptIndex;
+/** count of all options for genshellopt */
+#define GENSHELL_OPTION_CT 5
+/** genshellopt version */
+#define GENSHELLOPT_VERSION "1"
+/** Full genshellopt version text */
+#define GENSHELLOPT_FULL_VERSION "genshellopt 1"
+
+/**
+ * Interface defines for all options. Replace "n" with the UPPER_CASED
+ * option name (as in the teGenshell_OptIndex enumeration above).
+ * e.g. HAVE_GENSHELL_OPT(SCRIPT)
+ */
+#define GENSHELL_DESC(n) (genshelloptOptions.pOptDesc[INDEX_GENSHELL_OPT_## n])
+/** 'true' if an option has been specified in any way */
+#define HAVE_GENSHELL_OPT(n) (! UNUSED_OPT(& GENSHELL_DESC(n)))
+/** The string argument to an option. The argument type must be \"string\". */
+#define GENSHELL_OPT_ARG(n) (GENSHELL_DESC(n).optArg.argString)
+/** Mask the option state revealing how an option was specified.
+ * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
+ * \a OPTST_DEFINED, \a OPTST_RESET or zero.
+ */
+#define STATE_GENSHELL_OPT(n) (GENSHELL_DESC(n).fOptState & OPTST_SET_MASK)
+/** Count of option's occurrances *on the command line*. */
+#define COUNT_GENSHELL_OPT(n) (GENSHELL_DESC(n).optOccCt)
+/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
+#define ISSEL_GENSHELL_OPT(n) (SELECTED_OPT(&GENSHELL_DESC(n)))
+/** 'true' if \a HAVE_OPT would yield 'false'. */
+#define ISUNUSED_GENSHELL_OPT(n) (UNUSED_OPT(& GENSHELL_DESC(n)))
+/** 'true' if OPTST_DISABLED bit not set. */
+#define ENABLED_GENSHELL_OPT(n) (! DISABLED_OPT(& GENSHELL_DESC(n)))
+/** number of stacked option arguments.
+ * Valid only for stacked option arguments. */
+#define STACKCT_GENSHELL_OPT(n) (((tArgList*)(GENSHELL_DESC(n).optCookie))->useCt)
+/** stacked argument vector.
+ * Valid only for stacked option arguments. */
+#define STACKLST_GENSHELL_OPT(n) (((tArgList*)(GENSHELL_DESC(n).optCookie))->apzArgs)
+/** Reset an option. */
+#define CLEAR_GENSHELL_OPT(n) STMTS( \
+ GENSHELL_DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
+ if ((GENSHELL_DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ GENSHELL_DESC(n).fOptState |= OPTST_DISABLED; \
+ GENSHELL_DESC(n).optCookie = NULL )
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Enumeration of genshellopt exit codes
+ */
+typedef enum {
+ GENSHELLOPT_EXIT_SUCCESS = 0,
+ GENSHELLOPT_EXIT_FAILURE = 1,
+ GENSHELLOPT_EXIT_USAGE_ERROR = 64,
+ GENSHELLOPT_EXIT_LIBOPTS_FAILURE = 70
+} genshellopt_exit_code_t;
+/**
+ * Interface defines for specific options.
+ * @{
+ */
+#define VALUE_GENSHELL_OPT_SCRIPT 'o'
+#define VALUE_GENSHELL_OPT_SHELL 's'
+/** option flag (value) for help-value option */
+#define VALUE_GENSHELL_OPT_HELP '?'
+/** option flag (value) for more-help-value option */
+#define VALUE_GENSHELL_OPT_MORE_HELP '!'
+/** option flag (value) for version-value option */
+#define VALUE_GENSHELL_OPT_VERSION 'v'
+/*
+ * Interface defines not associated with particular options
+ */
+#define ERRSKIP_GENSHELL_OPTERR STMTS(genshelloptOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_GENSHELL_OPTERR STMTS(genshelloptOptions.fOptSet |= OPTPROC_ERRSTOP)
+#define RESTART_GENSHELL_OPT(n) STMTS( \
+ genshelloptOptions.curOptIdx = (n); \
+ genshelloptOptions.pzCurOpt = NULL )
+#define START_GENSHELL_OPT RESTART_GENSHELL_OPT(1)
+#define GENSHELL_USAGE(c) (*genshelloptOptions.pUsageProc)(&genshelloptOptions, c)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* * * * * *
+ *
+ * Declare the genshellopt option descriptor.
+ */
+extern tOptions genshelloptOptions;
+
+#if defined(ENABLE_NLS)
+# ifndef _
+# include <stdio.h>
+# ifndef HAVE_GETTEXT
+ extern char * gettext(char const *);
+# else
+# include <libintl.h>
+# endif
+
+# ifndef ATTRIBUTE_FORMAT_ARG
+# define ATTRIBUTE_FORMAT_ARG(_a)
+# endif
+
+static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
+static inline char* aoGetsText(char const* pz) {
+ if (pz == NULL) return NULL;
+ return (char*)gettext(pz);
+}
+# define _(s) aoGetsText(s)
+# endif /* _() */
+
+# define OPT_NO_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT_CFG;)
+# define OPT_NO_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
+
+# define OPT_XLAT_CFG_NAMES STMTS(genshelloptOptions.fOptSet &= \
+ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
+# define OPT_XLAT_OPT_NAMES STMTS(genshelloptOptions.fOptSet &= \
+ ~OPTPROC_NXLAT_OPT;)
+
+#else /* ENABLE_NLS */
+# define OPT_NO_XLAT_CFG_NAMES
+# define OPT_NO_XLAT_OPT_NAMES
+
+# define OPT_XLAT_CFG_NAMES
+# define OPT_XLAT_OPT_NAMES
+
+# ifndef _
+# define _(_s) _s
+# endif
+#endif /* ENABLE_NLS */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_GENSHELL_H_GUARD */
+
+/* genshell.h ends here */
diff --git a/sntp/libopts/gettext.h b/sntp/libopts/gettext.h
new file mode 100644
index 0000000..9b7416d
--- /dev/null
+++ b/sntp/libopts/gettext.h
@@ -0,0 +1,288 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2014 Free Software
+ Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License along
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
+ the gettext() and ngettext() macros. This is an alternative to calling
+ textdomain(), and is useful for libraries. */
+# ifdef DEFAULT_TEXT_DOMAIN
+# undef gettext
+# define gettext(Msgid) \
+ dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
+# endif
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+ <libintl.h>, which chokes if dcgettext is defined as a macro. So include
+ it now, to make later inclusions of <libintl.h> a NOP. */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
+# include <libintl.h>
+# endif
+#endif
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# undef gettext
+# define gettext(Msgid) ((const char *) (Msgid))
+# undef dgettext
+# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# undef dcgettext
+# define dcgettext(Domainname, Msgid, Category) \
+ ((void) (Category), dgettext (Domainname, Msgid))
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 \
+ ? ((void) (Msgid2), (const char *) (Msgid1)) \
+ : ((void) (Msgid1), (const char *) (Msgid2)))
+# undef dngettext
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# undef dcngettext
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
+# undef textdomain
+# define textdomain(Domainname) ((const char *) (Domainname))
+# undef bindtextdomain
+# define bindtextdomain(Domainname, Dirname) \
+ ((void) (Domainname), (const char *) (Dirname))
+# undef bind_textdomain_codeset
+# define bind_textdomain_codeset(Domainname, Codeset) \
+ ((void) (Domainname), (const char *) (Codeset))
+
+#endif
+
+/* Prefer gnulib's setlocale override over libintl's setlocale override. */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+/* The separator between msgctxt and msgid in a .mo file. */
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+ MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
+ short and rarely need to change.
+ The letter 'p' stands for 'particular' or 'special'. */
+#ifdef DEFAULT_TEXT_DOMAIN
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#else
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#endif
+#define dpgettext(Domainname, Msgctxt, Msgid) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#else
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#endif
+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+pgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ int category)
+{
+ const char *translation = dcgettext (domain, msg_ctxt_id, category);
+ if (translation == msg_ctxt_id)
+ return msgid;
+ else
+ return translation;
+}
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+npgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ const char *translation =
+ dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ if (translation == msg_ctxt_id || translation == msgid_plural)
+ return (n == 1 ? msgid : msgid_plural);
+ else
+ return translation;
+}
+
+/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
+ can be arbitrary expressions. But for string literals these macros are
+ less efficient than those above. */
+
+#include <string.h>
+
+#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+ /* || __STDC_VERSION__ >= 199901L */ )
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
+
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+#include <stdlib.h>
+#endif
+
+#define pgettext_expr(Msgctxt, Msgid) \
+ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcgettext (domain, msg_ctxt_id, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (translation != msg_ctxt_id)
+ return translation;
+ }
+ return msgid;
+}
+
+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcnpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (!(translation == msg_ctxt_id || translation == msgid_plural))
+ return translation;
+ }
+ return (n == 1 ? msgid : msgid_plural);
+}
+
+#endif /* _LIBGETTEXT_H */
diff --git a/sntp/libopts/init.c b/sntp/libopts/init.c
new file mode 100644
index 0000000..e038ed7
--- /dev/null
+++ b/sntp/libopts/init.c
@@ -0,0 +1,298 @@
+/**
+ * \file initialize.c
+ *
+ * initialize the libopts data structures.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static tSuccess
+do_presets(tOptions * opts);
+/* = = = END-STATIC-FORWARD = = = */
+
+/**
+ * Make sure the option descriptor is there and that we understand it.
+ * This should be called from any user entry point where one needs to
+ * worry about validity. (Some entry points are free to assume that
+ * the call is not the first to the library and, thus, that this has
+ * already been called.)
+ *
+ * Upon successful completion, pzProgName and pzProgPath are set.
+ *
+ * @param[in,out] opts program options descriptor
+ * @param[in] pname name of program, from argv[]
+ * @returns SUCCESS or FAILURE
+ */
+LOCAL tSuccess
+validate_struct(tOptions * opts, char const * pname)
+{
+ if (opts == NULL) {
+ fputs(zno_opt_arg, stderr);
+ return FAILURE;
+ }
+ print_exit = ((opts->fOptSet & OPTPROC_SHELL_OUTPUT) != 0);
+
+ /*
+ * IF the client has enabled translation and the translation procedure
+ * is available, then go do it.
+ */
+ if ( ((opts->fOptSet & OPTPROC_TRANSLATE) != 0)
+ && (opts->pTransProc != NULL)
+ && (option_xlateable_txt.field_ct != 0) ) {
+ /*
+ * If option names are not to be translated at all, then do not do
+ * it for configuration parsing either. (That is the bit that really
+ * gets tested anyway.)
+ */
+ if ((opts->fOptSet & OPTPROC_NO_XLAT_MASK) == OPTPROC_NXLAT_OPT)
+ opts->fOptSet |= OPTPROC_NXLAT_OPT_CFG;
+ (*opts->pTransProc)();
+ }
+
+ /*
+ * IF the struct version is not the current, and also
+ * either too large (?!) or too small,
+ * THEN emit error message and fail-exit
+ */
+ if ( ( opts->structVersion != OPTIONS_STRUCT_VERSION )
+ && ( (opts->structVersion > OPTIONS_STRUCT_VERSION )
+ || (opts->structVersion < OPTIONS_MINIMUM_VERSION )
+ ) ) {
+
+ static char const ao_ver_string[] =
+ STR(AO_CURRENT)":"STR(AO_REVISION)":"STR(AO_AGE)"\n";
+
+ fprintf(stderr, zwrong_ver, pname, NUM_TO_VER(opts->structVersion));
+ if (opts->structVersion > OPTIONS_STRUCT_VERSION )
+ fputs(ztoo_new, stderr);
+ else
+ fputs(ztoo_old, stderr);
+
+ fwrite(ao_ver_string, sizeof(ao_ver_string) - 1, 1, stderr);
+ return FAILURE;
+ }
+
+ /*
+ * If the program name hasn't been set, then set the name and the path
+ * and the set of equivalent characters.
+ */
+ if (opts->pzProgName == NULL) {
+ char const * pz = strrchr(pname, DIRCH);
+ char const ** pp =
+ (char const **)(void **)&(opts->pzProgName);
+
+ if (pz != NULL)
+ *pp = pz+1;
+ else
+ *pp = pname;
+
+ pz = pathfind(getenv("PATH"), (char *)pname, "rx");
+ if (pz != NULL)
+ pname = (void *)pz;
+
+ pp = (char const **)(void **)&(opts->pzProgPath);
+ *pp = pname;
+
+ /*
+ * when comparing long names, these are equivalent
+ */
+ strequate(zSepChars);
+ }
+
+ return SUCCESS;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * DO PRESETS
+ *
+ * The next several routines do the immediate action pass on the command
+ * line options, then the environment variables, then the config files in
+ * reverse order. Once done with that, the order is reversed and all
+ * the config files and environment variables are processed again, this
+ * time only processing the non-immediate action options. do_presets()
+ * will then return for optionProcess() to do the final pass on the command
+ * line arguments.
+ */
+
+/**
+ * scan the command line for immediate action options.
+ * This is only called the first time through.
+ * While this procedure is active, the OPTPROC_IMMEDIATE is true.
+ *
+ * @param pOpts program options descriptor
+ * @returns SUCCESS or FAILURE
+ */
+LOCAL tSuccess
+immediate_opts(tOptions * opts)
+{
+ tSuccess res;
+
+ opts->fOptSet |= OPTPROC_IMMEDIATE;
+ opts->curOptIdx = 1; /* start by skipping program name */
+ opts->pzCurOpt = NULL;
+
+ /*
+ * Examine all the options from the start. We process any options that
+ * are marked for immediate processing.
+ */
+ for (;;) {
+ tOptState opt_st = OPTSTATE_INITIALIZER(PRESET);
+
+ res = next_opt(opts, &opt_st);
+ switch (res) {
+ case FAILURE: goto failed_option;
+ case PROBLEM: res = SUCCESS; goto leave;
+ case SUCCESS: break;
+ }
+
+ /*
+ * IF this is an immediate-attribute option, then do it.
+ */
+ if (! DO_IMMEDIATELY(opt_st.flags))
+ continue;
+
+ if (! SUCCESSFUL(handle_opt(opts, &opt_st)))
+ break;
+ } failed_option:;
+
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0)
+ (*opts->pUsageProc)(opts, EXIT_FAILURE);
+
+ leave:
+
+ opts->fOptSet &= ~OPTPROC_IMMEDIATE;
+ return res;
+}
+
+/**
+ * check for preset values from a config files or envrionment variables
+ *
+ * @param[in,out] opts the structure with the option names to check
+ */
+static tSuccess
+do_presets(tOptions * opts)
+{
+ tOptDesc * od = NULL;
+
+ if (! SUCCESSFUL(immediate_opts(opts)))
+ return FAILURE;
+
+ /*
+ * IF this option set has a --save-opts option, then it also
+ * has a --load-opts option. See if a command line option has disabled
+ * option presetting.
+ */
+ if ( (opts->specOptIdx.save_opts != NO_EQUIVALENT)
+ && (opts->specOptIdx.save_opts != 0)) {
+ od = opts->pOptDesc + opts->specOptIdx.save_opts + 1;
+ if (DISABLED_OPT(od))
+ return SUCCESS;
+ }
+
+ /*
+ * Until we return from this procedure, disable non-presettable opts
+ */
+ opts->fOptSet |= OPTPROC_PRESETTING;
+ /*
+ * IF there are no config files,
+ * THEN do any environment presets and leave.
+ */
+ if (opts->papzHomeList == NULL) {
+ env_presets(opts, ENV_ALL);
+ }
+ else {
+ env_presets(opts, ENV_IMM);
+
+ /*
+ * Check to see if environment variables have disabled presetting.
+ */
+ if ((od != NULL) && ! DISABLED_OPT(od))
+ intern_file_load(opts);
+
+ /*
+ * ${PROGRAM_LOAD_OPTS} value of "no" cannot disable other environment
+ * variable options. Only the loading of .rc files.
+ */
+ env_presets(opts, ENV_NON_IMM);
+ }
+ opts->fOptSet &= ~OPTPROC_PRESETTING;
+
+ return SUCCESS;
+}
+
+/**
+ * AutoOpts initialization
+ *
+ * @param[in,out] opts the structure to initialize
+ * @param[in] a_ct program argument count
+ * @param[in] a_v program argument vector
+ */
+LOCAL bool
+ao_initialize(tOptions * opts, int a_ct, char ** a_v)
+{
+ if ((opts->fOptSet & OPTPROC_INITDONE) != 0)
+ return true;
+
+ opts->origArgCt = (unsigned int)a_ct;
+ opts->origArgVect = a_v;
+ opts->fOptSet |= OPTPROC_INITDONE;
+
+ if (HAS_pzPkgDataDir(opts))
+ program_pkgdatadir = opts->pzPkgDataDir;
+
+ if (! SUCCESSFUL(do_presets(opts)))
+ return false;
+
+ /*
+ * IF option name conversion was suppressed but it is not suppressed
+ * for the command line, then it's time to translate option names.
+ * Usage text will not get retranslated.
+ */
+ if ( ((opts->fOptSet & OPTPROC_TRANSLATE) != 0)
+ && (opts->pTransProc != NULL)
+ && ((opts->fOptSet & OPTPROC_NO_XLAT_MASK) == OPTPROC_NXLAT_OPT_CFG)
+ ) {
+ opts->fOptSet &= ~OPTPROC_NXLAT_OPT_CFG;
+ (*opts->pTransProc)();
+ }
+
+ if ((opts->fOptSet & OPTPROC_REORDER) != 0)
+ optionSort(opts);
+
+ opts->curOptIdx = 1;
+ opts->pzCurOpt = NULL;
+ return true;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/initialize.c */
diff --git a/sntp/libopts/intprops.h b/sntp/libopts/intprops.h
new file mode 100644
index 0000000..6936ad5
--- /dev/null
+++ b/sntp/libopts/intprops.h
@@ -0,0 +1,320 @@
+/* intprops.h -- properties of integer types
+
+ Copyright (C) 2001-2005, 2009-2014 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef _GL_INTPROPS_H
+#define _GL_INTPROPS_H
+
+#include <limits.h>
+
+/* Return an integer value, converted to the same type as the integer
+ expression E after integer type promotion. V is the unconverted value. */
+#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
+
+/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */
+#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
+
+/* The extra casts in the following macros work around compiler bugs,
+ e.g., in Cray C 5.0.3.0. */
+
+/* True if the arithmetic type T is an integer type. bool counts as
+ an integer. */
+#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
+
+/* True if negative values of the signed integer type T use two's
+ complement, ones' complement, or signed magnitude representation,
+ respectively. Much GNU code assumes two's complement, but some
+ people like to be portable to all possible C hosts. */
+#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
+#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
+#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
+
+/* True if the signed integer expression E uses two's complement. */
+#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1)
+
+/* True if the arithmetic type T is signed. */
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* Return 1 if the integer expression E, after integer promotion, has
+ a signed type. */
+#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
+
+/* Minimum and maximum values for integer types and expressions. These
+ macros have undefined behavior if T is signed and has padding bits.
+ If this is a problem for you, please let us know how to fix it for
+ your host. */
+
+/* The maximum and minimum values for the integer type T. */
+#define TYPE_MINIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) 0 \
+ : TYPE_SIGNED_MAGNITUDE (t) \
+ ? ~ (t) 0 \
+ : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+/* The maximum and minimum values for the type of the expression E,
+ after integer promotion. E should not have side effects. */
+#define _GL_INT_MINIMUM(e) \
+ (_GL_INT_SIGNED (e) \
+ ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_CONVERT (e, 0))
+#define _GL_INT_MAXIMUM(e) \
+ (_GL_INT_SIGNED (e) \
+ ? _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_NEGATE_CONVERT (e, 1))
+#define _GL_SIGNED_INT_MAXIMUM(e) \
+ (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
+
+
+/* Return 1 if the __typeof__ keyword works. This could be done by
+ 'configure', but for now it's easier to do it by hand. */
+#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+# define _GL_HAVE___TYPEOF__ 1
+#else
+# define _GL_HAVE___TYPEOF__ 0
+#endif
+
+/* Return 1 if the integer type or expression T might be signed. Return 0
+ if it is definitely unsigned. This macro does not evaluate its argument,
+ and expands to an integer constant expression. */
+#if _GL_HAVE___TYPEOF__
+# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
+#else
+# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
+#endif
+
+/* Bound on length of the string representing an unsigned integer
+ value representable in B bits. log10 (2.0) < 146/485. The
+ smallest value of B where this bound is not tight is 2621. */
+#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
+
+/* Bound on length of the string representing an integer type or expression T.
+ Subtract 1 for the sign bit if T is signed, and then add 1 more for
+ a minus sign if needed.
+
+ Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is
+ signed, this macro may overestimate the true bound by one byte when
+ applied to unsigned types of size 2, 4, 16, ... bytes. */
+#define INT_STRLEN_BOUND(t) \
+ (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \
+ - _GL_SIGNED_TYPE_OR_EXPR (t)) \
+ + _GL_SIGNED_TYPE_OR_EXPR (t))
+
+/* Bound on buffer size needed to represent an integer type or expression T,
+ including the terminating null. */
+#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
+
+
+/* Range overflow checks.
+
+ The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
+ operators might not yield numerically correct answers due to
+ arithmetic overflow. They do not rely on undefined or
+ implementation-defined behavior. Their implementations are simple
+ and straightforward, but they are a bit harder to use than the
+ INT_<op>_OVERFLOW macros described below.
+
+ Example usage:
+
+ long int i = ...;
+ long int j = ...;
+ if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX))
+ printf ("multiply would overflow");
+ else
+ printf ("product is %ld", i * j);
+
+ Restrictions on *_RANGE_OVERFLOW macros:
+
+ These macros do not check for all possible numerical problems or
+ undefined or unspecified behavior: they do not check for division
+ by zero, for bad shift counts, or for shifting negative numbers.
+
+ These macros may evaluate their arguments zero or multiple times,
+ so the arguments should not have side effects. The arithmetic
+ arguments (including the MIN and MAX arguments) must be of the same
+ integer type after the usual arithmetic conversions, and the type
+ must have minimum value MIN and maximum MAX. Unsigned types should
+ use a zero MIN of the proper type.
+
+ These macros are tuned for constant MIN and MAX. For commutative
+ operations such as A + B, they are also tuned for constant B. */
+
+/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_ADD_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? (a) < (min) - (b) \
+ : (max) - (b) < (a))
+
+/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? (max) + (b) < (a) \
+ : (a) < (min) + (b))
+
+/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
+ ((min) < 0 \
+ ? (a) < - (max) \
+ : 0 < (a))
+
+/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Avoid && and || as they tickle
+ bugs in Sun C 5.11 2010/08/13 and other compilers; see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */
+#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? ((a) < 0 \
+ ? (a) < (max) / (b) \
+ : (b) == -1 \
+ ? 0 \
+ : (min) / (b) < (a)) \
+ : (b) == 0 \
+ ? 0 \
+ : ((a) < 0 \
+ ? (a) < (min) / (b) \
+ : (max) / (b) < (a)))
+
+/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Do not check for division by zero. */
+#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max) \
+ ((min) < 0 && (b) == -1 && (a) < - (max))
+
+/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Do not check for division by zero.
+ Mathematically, % should never overflow, but on x86-like hosts
+ INT_MIN % -1 traps, and the C standard permits this, so treat this
+ as an overflow too. */
+#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max) \
+ INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
+
+/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Here, MIN and MAX are for A only, and B need
+ not be of the same type as the other arguments. The C standard says that
+ behavior is undefined for shifts unless 0 <= B < wordwidth, and that when
+ A is negative then A << B has undefined behavior and A >> B has
+ implementation-defined behavior, but do not check these other
+ restrictions. */
+#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max) \
+ ((a) < 0 \
+ ? (a) < (min) >> (b) \
+ : (max) >> (b) < (a))
+
+
+/* The _GL*_OVERFLOW macros have the same restrictions as the
+ *_RANGE_OVERFLOW macros, except that they do not assume that operands
+ (e.g., A and B) have the same type as MIN and MAX. Instead, they assume
+ that the result (e.g., A + B) has that type. */
+#define _GL_ADD_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
+ : (a) < 0 ? (b) <= (a) + (b) \
+ : (b) < 0 ? (a) <= (a) + (b) \
+ : (a) + (b) < (b))
+#define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \
+ : (a) < 0 ? 1 \
+ : (b) < 0 ? (a) - (b) <= (a) \
+ : (a) < (b))
+#define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
+ (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \
+ || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#define _GL_DIVIDE_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
+ : (a) < 0 ? (b) <= (a) + (b) - 1 \
+ : (b) < 0 && (a) + (b) <= (a))
+#define _GL_REMAINDER_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
+ : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \
+ : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
+
+/* Return a nonzero value if A is a mathematical multiple of B, where
+ A is unsigned, B is negative, and MAX is the maximum value of A's
+ type. A's type must be the same as (A % B)'s type. Normally (A %
+ -B == 0) suffices, but things get tricky if -B would overflow. */
+#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max) \
+ (((b) < -_GL_SIGNED_INT_MAXIMUM (b) \
+ ? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \
+ ? (a) \
+ : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \
+ : (a) % - (b)) \
+ == 0)
+
+
+/* Integer overflow checks.
+
+ The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
+ might not yield numerically correct answers due to arithmetic overflow.
+ They work correctly on all known practical hosts, and do not rely
+ on undefined behavior due to signed arithmetic overflow.
+
+ Example usage:
+
+ long int i = ...;
+ long int j = ...;
+ if (INT_MULTIPLY_OVERFLOW (i, j))
+ printf ("multiply would overflow");
+ else
+ printf ("product is %ld", i * j);
+
+ These macros do not check for all possible numerical problems or
+ undefined or unspecified behavior: they do not check for division
+ by zero, for bad shift counts, or for shifting negative numbers.
+
+ These macros may evaluate their arguments zero or multiple times, so the
+ arguments should not have side effects.
+
+ These macros are tuned for their last argument being a constant.
+
+ Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
+ A % B, and A << B would overflow, respectively. */
+
+#define INT_ADD_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+#define INT_SUBTRACT_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+#define INT_NEGATE_OVERFLOW(a) \
+ INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#define INT_MULTIPLY_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
+#define INT_DIVIDE_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
+#define INT_REMAINDER_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
+#define INT_LEFT_SHIFT_OVERFLOW(a, b) \
+ INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \
+ _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+
+/* Return 1 if the expression A <op> B would overflow,
+ where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
+ assuming MIN and MAX are the minimum and maximum for the result type.
+ Arguments should be free of side effects. */
+#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
+ op_result_overflow (a, b, \
+ _GL_INT_MINIMUM (0 * (b) + (a)), \
+ _GL_INT_MAXIMUM (0 * (b) + (a)))
+
+#endif /* _GL_INTPROPS_H */
diff --git a/sntp/libopts/libopts.c b/sntp/libopts/libopts.c
new file mode 100644
index 0000000..a0ff362
--- /dev/null
+++ b/sntp/libopts/libopts.c
@@ -0,0 +1,46 @@
+#define AUTOOPTS_INTERNAL 1
+#include "autoopts/project.h"
+#define LOCAL static
+#include "ao-strs.h"
+#include "autoopts/options.h"
+#include "autoopts/usage-txt.h"
+#include "genshell.h"
+#include "option-xat-attribute.h"
+#include "option-value-type.h"
+#include "ao-strs.h"
+#include "ag-char-map.h"
+#include "autoopts.h"
+#include "proto.h"
+#include "parse-duration.c"
+#include "ao-strs.c"
+#include "option-value-type.c"
+#include "option-xat-attribute.c"
+#include "autoopts.c"
+#include "alias.c"
+#include "boolean.c"
+#include "check.c"
+#include "configfile.c"
+#include "cook.c"
+#include "enum.c"
+#include "env.c"
+#include "file.c"
+#include "find.c"
+#include "genshell.c"
+#include "load.c"
+#include "makeshell.c"
+#include "nested.c"
+#include "numeric.c"
+#include "pgusage.c"
+#include "putshell.c"
+#include "reset.c"
+#include "restore.c"
+#include "save.c"
+#include "sort.c"
+#include "stack.c"
+#include "streqvcmp.c"
+#include "text_mmap.c"
+#include "time.c"
+#include "tokenize.c"
+#include "usage.c"
+#include "version.c"
+#include "init.c"
diff --git a/sntp/libopts/load.c b/sntp/libopts/load.c
new file mode 100644
index 0000000..5c29d96
--- /dev/null
+++ b/sntp/libopts/load.c
@@ -0,0 +1,588 @@
+
+/**
+ * \file load.c
+ *
+ * This file contains the routines that deal with processing text strings
+ * for options, either from a NUL-terminated string passed in or from an
+ * rc/ini file.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static bool
+get_realpath(char * buf, size_t b_sz);
+
+static bool
+add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path);
+
+static bool
+add_env_val(char * buf, int buf_sz, char const * name);
+
+static char *
+assemble_arg_val(char * txt, tOptionLoadMode mode);
+
+static char *
+trim_quotes(char * arg);
+
+static bool
+direction_ok(opt_state_mask_t f, int dir);
+/* = = = END-STATIC-FORWARD = = = */
+
+static bool
+get_realpath(char * buf, size_t b_sz)
+{
+#if defined(HAVE_CANONICALIZE_FILE_NAME)
+ {
+ size_t name_len;
+
+ char * pz = canonicalize_file_name(buf);
+ if (pz == NULL)
+ return false;
+
+ name_len = strlen(pz);
+ if (name_len >= (size_t)b_sz) {
+ free(pz);
+ return false;
+ }
+
+ memcpy(buf, pz, name_len + 1);
+ free(pz);
+ }
+
+#elif defined(HAVE_REALPATH)
+ {
+ size_t name_len;
+ char z[PATH_MAX+1];
+
+ if (realpath(buf, z) == NULL)
+ return false;
+
+ name_len = strlen(z);
+ if (name_len >= b_sz)
+ return false;
+
+ memcpy(buf, z, name_len + 1);
+ }
+#endif
+ return true;
+}
+
+/*=export_func optionMakePath
+ * private:
+ *
+ * what: translate and construct a path
+ * arg: + char* + p_buf + The result buffer +
+ * arg: + int + b_sz + The size of this buffer +
+ * arg: + char const* + fname + The input name +
+ * arg: + char const* + prg_path + The full path of the current program +
+ *
+ * ret-type: bool
+ * ret-desc: true if the name was handled, otherwise false.
+ * If the name does not start with ``$'', then it is handled
+ * simply by copying the input name to the output buffer and
+ * resolving the name with either
+ * @code{canonicalize_file_name(3GLIBC)} or @code{realpath(3C)}.
+ *
+ * doc:
+ *
+ * This routine will copy the @code{pzName} input name into the
+ * @code{pzBuf} output buffer, not exceeding @code{bufSize} bytes. If the
+ * first character of the input name is a @code{'$'} character, then there
+ * is special handling:
+ * @*
+ * @code{$$} is replaced with the directory name of the @code{pzProgPath},
+ * searching @code{$PATH} if necessary.
+ * @*
+ * @code{$@} is replaced with the AutoGen package data installation directory
+ * (aka @code{pkgdatadir}).
+ * @*
+ * @code{$NAME} is replaced by the contents of the @code{NAME} environment
+ * variable. If not found, the search fails.
+ *
+ * Please note: both @code{$$} and @code{$NAME} must be at the start of the
+ * @code{pzName} string and must either be the entire string or be followed
+ * by the @code{'/'} (backslash on windows) character.
+ *
+ * err: @code{false} is returned if:
+ * @*
+ * @bullet{} The input name exceeds @code{bufSize} bytes.
+ * @*
+ * @bullet{} @code{$$}, @code{$@@} or @code{$NAME} is not the full string
+ * and the next character is not '/'.
+ * @*
+ * @bullet{} libopts was built without PKGDATADIR defined and @code{$@@}
+ * was specified.
+ * @*
+ * @bullet{} @code{NAME} is not a known environment variable
+ * @*
+ * @bullet{} @code{canonicalize_file_name} or @code{realpath} return
+ * errors (cannot resolve the resulting path).
+=*/
+bool
+optionMakePath(char * p_buf, int b_sz, char const * fname, char const * prg_path)
+{
+ {
+ size_t len = strlen(fname);
+
+ if (((size_t)b_sz <= len) || (len == 0))
+ return false;
+ }
+
+ /*
+ * IF not an environment variable, just copy the data
+ */
+ if (*fname != '$') {
+ char const * src = fname;
+ char * dst = p_buf;
+ int ct = b_sz;
+
+ for (;;) {
+ if ( (*(dst++) = *(src++)) == NUL)
+ break;
+ if (--ct <= 0)
+ return false;
+ }
+ }
+
+ /*
+ * IF the name starts with "$$", then it must be "$$" or
+ * it must start with "$$/". In either event, replace the "$$"
+ * with the path to the executable and append a "/" character.
+ */
+ else switch (fname[1]) {
+ case NUL:
+ return false;
+
+ case '$':
+ if (! add_prog_path(p_buf, b_sz, fname, prg_path))
+ return false;
+ break;
+
+ case '@':
+ if (program_pkgdatadir[0] == NUL)
+ return false;
+
+ if (snprintf(p_buf, (size_t)b_sz, "%s%s",
+ program_pkgdatadir, fname + 2) >= b_sz)
+ return false;
+ break;
+
+ default:
+ if (! add_env_val(p_buf, b_sz, fname))
+ return false;
+ }
+
+ return get_realpath(p_buf, b_sz);
+}
+
+/**
+ * convert a leading "$$" into a path to the executable.
+ */
+static bool
+add_prog_path(char * buf, int b_sz, char const * fname, char const * prg_path)
+{
+ char const * path;
+ char const * pz;
+ int skip = 2;
+
+ switch (fname[2]) {
+ case DIRCH:
+ skip = 3;
+ case NUL:
+ break;
+ default:
+ return false;
+ }
+
+ /*
+ * See if the path is included in the program name.
+ * If it is, we're done. Otherwise, we have to hunt
+ * for the program using "pathfind".
+ */
+ if (strchr(prg_path, DIRCH) != NULL)
+ path = prg_path;
+ else {
+ path = pathfind(getenv("PATH"), (char*)prg_path, "rx");
+
+ if (path == NULL)
+ return false;
+ }
+
+ pz = strrchr(path, DIRCH);
+
+ /*
+ * IF we cannot find a directory name separator,
+ * THEN we do not have a path name to our executable file.
+ */
+ if (pz == NULL)
+ return false;
+
+ fname += skip;
+
+ /*
+ * Concatenate the file name to the end of the executable path.
+ * The result may be either a file or a directory.
+ */
+ if ((unsigned)(pz - path) + 1 + strlen(fname) >= (unsigned)b_sz)
+ return false;
+
+ memcpy(buf, path, (size_t)((pz - path)+1));
+ strcpy(buf + (pz - path) + 1, fname);
+
+ /*
+ * If the "path" path was gotten from "pathfind()", then it was
+ * allocated and we need to deallocate it.
+ */
+ if (path != prg_path)
+ AGFREE(path);
+ return true;
+}
+
+/**
+ * Add an environment variable value.
+ */
+static bool
+add_env_val(char * buf, int buf_sz, char const * name)
+{
+ char * dir_part = buf;
+
+ for (;;) {
+ int ch = (int)*++name;
+ if (! IS_VALUE_NAME_CHAR(ch))
+ break;
+ *(dir_part++) = (char)ch;
+ }
+
+ if (dir_part == buf)
+ return false;
+
+ *dir_part = NUL;
+
+ dir_part = getenv(buf);
+
+ /*
+ * Environment value not found -- skip the home list entry
+ */
+ if (dir_part == NULL)
+ return false;
+
+ if (strlen(dir_part) + 1 + strlen(name) >= (unsigned)buf_sz)
+ return false;
+
+ sprintf(buf, "%s%s", dir_part, name);
+ return true;
+}
+
+/**
+ * Trim leading and trailing white space.
+ * If we are cooking the text and the text is quoted, then "cook"
+ * the string. To cook, the string must be quoted.
+ *
+ * @param[in,out] txt the input and output string
+ * @param[in] mode the handling mode (cooking method)
+ */
+LOCAL void
+munge_str(char * txt, tOptionLoadMode mode)
+{
+ char * pzE;
+
+ if (mode == OPTION_LOAD_KEEP)
+ return;
+
+ if (IS_WHITESPACE_CHAR(*txt)) {
+ char * src = SPN_WHITESPACE_CHARS(txt+1);
+ size_t l = strlen(src) + 1;
+ memmove(txt, src, l);
+ pzE = txt + l - 1;
+
+ } else
+ pzE = txt + strlen(txt);
+
+ pzE = SPN_WHITESPACE_BACK(txt, pzE);
+ *pzE = NUL;
+
+ if (mode == OPTION_LOAD_UNCOOKED)
+ return;
+
+ switch (*txt) {
+ default: return;
+ case '"':
+ case '\'': break;
+ }
+
+ switch (pzE[-1]) {
+ default: return;
+ case '"':
+ case '\'': break;
+ }
+
+ (void)ao_string_cook(txt, NULL);
+}
+
+static char *
+assemble_arg_val(char * txt, tOptionLoadMode mode)
+{
+ char * end = strpbrk(txt, ARG_BREAK_STR);
+ int space_break;
+
+ /*
+ * Not having an argument to a configurable name is okay.
+ */
+ if (end == NULL)
+ return txt + strlen(txt);
+
+ /*
+ * If we are keeping all whitespace, then the modevalue starts with the
+ * character that follows the end of the configurable name, regardless
+ * of which character caused it.
+ */
+ if (mode == OPTION_LOAD_KEEP) {
+ *(end++) = NUL;
+ return end;
+ }
+
+ /*
+ * If the name ended on a white space character, remember that
+ * because we'll have to skip over an immediately following ':' or '='
+ * (and the white space following *that*).
+ */
+ space_break = IS_WHITESPACE_CHAR(*end);
+ *(end++) = NUL;
+
+ end = SPN_WHITESPACE_CHARS(end);
+ if (space_break && ((*end == ':') || (*end == '=')))
+ end = SPN_WHITESPACE_CHARS(end+1);
+
+ return end;
+}
+
+static char *
+trim_quotes(char * arg)
+{
+ switch (*arg) {
+ case '"':
+ case '\'':
+ ao_string_cook(arg, NULL);
+ }
+ return arg;
+}
+
+/**
+ * See if the option is to be processed in the current scan direction
+ * (-1 or +1).
+ */
+static bool
+direction_ok(opt_state_mask_t f, int dir)
+{
+ if (dir == 0)
+ return true;
+
+ switch (f & (OPTST_IMM|OPTST_DISABLE_IMM)) {
+ case 0:
+ /*
+ * The selected option has no immediate action.
+ * THEREFORE, if the direction is PRESETTING
+ * THEN we skip this option.
+ */
+ if (PRESETTING(dir))
+ return false;
+ break;
+
+ case OPTST_IMM:
+ if (PRESETTING(dir)) {
+ /*
+ * We are in the presetting direction with an option we handle
+ * immediately for enablement, but normally for disablement.
+ * Therefore, skip if disabled.
+ */
+ if ((f & OPTST_DISABLED) == 0)
+ return false;
+ } else {
+ /*
+ * We are in the processing direction with an option we handle
+ * immediately for enablement, but normally for disablement.
+ * Therefore, skip if NOT disabled.
+ */
+ if ((f & OPTST_DISABLED) != 0)
+ return false;
+ }
+ break;
+
+ case OPTST_DISABLE_IMM:
+ if (PRESETTING(dir)) {
+ /*
+ * We are in the presetting direction with an option we handle
+ * immediately for disablement, but normally for disablement.
+ * Therefore, skip if NOT disabled.
+ */
+ if ((f & OPTST_DISABLED) != 0)
+ return false;
+ } else {
+ /*
+ * We are in the processing direction with an option we handle
+ * immediately for disablement, but normally for disablement.
+ * Therefore, skip if disabled.
+ */
+ if ((f & OPTST_DISABLED) == 0)
+ return false;
+ }
+ break;
+
+ case OPTST_IMM|OPTST_DISABLE_IMM:
+ /*
+ * The selected option is always for immediate action.
+ * THEREFORE, if the direction is PROCESSING
+ * THEN we skip this option.
+ */
+ if (PROCESSING(dir))
+ return false;
+ break;
+ }
+ return true;
+}
+
+/**
+ * Load an option from a block of text. The text must start with the
+ * configurable/option name and be followed by its associated value.
+ * That value may be processed in any of several ways. See "tOptionLoadMode"
+ * in autoopts.h.
+ *
+ * @param[in,out] opts program options descriptor
+ * @param[in,out] opt_state option processing state
+ * @param[in,out] line source line with long option name in it
+ * @param[in] direction current processing direction (preset or not)
+ * @param[in] load_mode option loading mode (OPTION_LOAD_*)
+ */
+LOCAL void
+load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
+ tDirection direction, tOptionLoadMode load_mode )
+{
+ /*
+ * When parsing a stored line, we only look at the characters after
+ * a hyphen. Long names must always be at least two characters and
+ * short options are always exactly one character long.
+ */
+ line = SPN_LOAD_LINE_SKIP_CHARS(line);
+
+ {
+ char * arg = assemble_arg_val(line, load_mode);
+
+ if (IS_OPTION_NAME_CHAR(line[1])) {
+
+ if (! SUCCESSFUL(opt_find_long(opts, line, opt_state)))
+ return;
+
+ } else if (! SUCCESSFUL(opt_find_short(opts, *line, opt_state)))
+ return;
+
+ if ((! CALLED(direction)) && (opt_state->flags & OPTST_NO_INIT))
+ return;
+
+ opt_state->pzOptArg = trim_quotes(arg);
+ }
+
+ if (! direction_ok(opt_state->flags, direction))
+ return;
+
+ /*
+ * Fix up the args.
+ */
+ if (OPTST_GET_ARGTYPE(opt_state->pOD->fOptState) == OPARG_TYPE_NONE) {
+ if (*opt_state->pzOptArg != NUL)
+ return;
+ opt_state->pzOptArg = NULL;
+
+ } else if (opt_state->pOD->fOptState & OPTST_ARG_OPTIONAL) {
+ if (*opt_state->pzOptArg == NUL)
+ opt_state->pzOptArg = NULL;
+ else {
+ AGDUPSTR(opt_state->pzOptArg, opt_state->pzOptArg, "opt arg");
+ opt_state->flags |= OPTST_ALLOC_ARG;
+ }
+
+ } else {
+ if (*opt_state->pzOptArg == NUL)
+ opt_state->pzOptArg = zNil;
+ else {
+ AGDUPSTR(opt_state->pzOptArg, opt_state->pzOptArg, "opt arg");
+ opt_state->flags |= OPTST_ALLOC_ARG;
+ }
+ }
+
+ {
+ tOptionLoadMode sv = option_load_mode;
+ option_load_mode = load_mode;
+ handle_opt(opts, opt_state);
+ option_load_mode = sv;
+ }
+}
+
+/*=export_func optionLoadLine
+ *
+ * what: process a string for an option name and value
+ *
+ * arg: tOptions*, opts, program options descriptor
+ * arg: char const*, line, NUL-terminated text
+ *
+ * doc:
+ *
+ * This is a client program callable routine for setting options from, for
+ * example, the contents of a file that they read in. Only one option may
+ * appear in the text. It will be treated as a normal (non-preset) option.
+ *
+ * When passed a pointer to the option struct and a string, it will find
+ * the option named by the first token on the string and set the option
+ * argument to the remainder of the string. The caller must NUL terminate
+ * the string. The caller need not skip over any introductory hyphens.
+ * Any embedded new lines will be included in the option
+ * argument. If the input looks like one or more quoted strings, then the
+ * input will be "cooked". The "cooking" is identical to the string
+ * formation used in AutoGen definition files (@pxref{basic expression}),
+ * except that you may not use backquotes.
+ *
+ * err: Invalid options are silently ignored. Invalid option arguments
+ * will cause a warning to print, but the function should return.
+=*/
+void
+optionLoadLine(tOptions * opts, char const * line)
+{
+ tOptState st = OPTSTATE_INITIALIZER(SET);
+ char * pz;
+ proc_state_mask_t sv_flags = opts->fOptSet;
+ opts->fOptSet &= ~OPTPROC_ERRSTOP;
+ AGDUPSTR(pz, line, "opt line");
+ load_opt_line(opts, &st, pz, DIRECTION_CALLED, OPTION_LOAD_COOKED);
+ AGFREE(pz);
+ opts->fOptSet = sv_flags;
+}
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/load.c */
diff --git a/sntp/libopts/m4/libopts.m4 b/sntp/libopts/m4/libopts.m4
new file mode 100644
index 0000000..4a4ca18
--- /dev/null
+++ b/sntp/libopts/m4/libopts.m4
@@ -0,0 +1,592 @@
+dnl -*- buffer-read-only: t -*- vi: set ro:
+dnl
+dnl DO NOT EDIT THIS FILE (libopts.m4)
+dnl
+dnl It has been AutoGen-ed August 3, 2014 at 10:44:34 AM by AutoGen 5.18.4pre11
+dnl From the definitions libopts.def
+dnl and the template file conftest.tpl
+dnl
+dnl do always before generated macros:
+dnl
+AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
+ AC_REQUIRE([AC_HEADER_STDC])
+ AC_HEADER_DIRENT
+
+ # =================
+ # AC_CHECK_HEADERS
+ # =================
+ AC_CHECK_HEADERS([ \
+ sys/mman.h sys/param.h sys/poll.h sys/procset.h \
+ sys/select.h sys/socket.h sys/stropts.h sys/time.h \
+ sys/un.h sys/wait.h dlfcn.h errno.h \
+ fcntl.h libgen.h libintl.h memory.h \
+ netinet/in.h setjmp.h stdbool.h sysexits.h \
+ unistd.h utime.h])
+
+ AC_CHECK_HEADERS([stdarg.h varargs.h],
+ [lo_have_arg_hdr=true;break],
+ [lo_have_arg_hdr=false])
+
+ AC_CHECK_HEADERS([string.h strings.h],
+ [lo_have_str_hdr=true;break],
+ [lo_have_str_hdr=false])
+
+ AC_CHECK_HEADERS([limits.h sys/limits.h values.h],
+ [lo_have_lim_hdr=true;break],
+ [lo_have_lim_hdr=false])
+
+ AC_CHECK_HEADERS([inttypes.h stdint.h],
+ [lo_have_typ_hdr=true;break],
+ [lo_have_typ_hdr=false])
+ gl_STDNORETURN_H
+
+ # ----------------------------------------------------------------------
+ # check for various programs used during the build.
+ # On OS/X, "wchar.h" needs "runetype.h" to work properly.
+ # ----------------------------------------------------------------------
+ AC_CHECK_HEADERS([runetype.h wchar.h], [], [],[
+ AC_INCLUDES_DEFAULT
+ #if HAVE_RUNETYPE_H
+ # include <runetype.h>
+ #endif
+ ])
+
+ AC_ARG_ENABLE([nls],
+ AS_HELP_STRING([--disable-nls],[disable nls support in libopts]))
+ AS_IF([test "x$enable_nls" != "xno" && \
+ test "X${ac_cv_header_libintl_h}" = Xyes], [
+ AC_DEFINE([ENABLE_NLS],[1],[nls support in libopts])])
+
+ # --------------------------------------------
+ # Verify certain entries from AC_CHECK_HEADERS
+ # --------------------------------------------
+ [${lo_have_arg_hdr} || \
+ ]AC_MSG_ERROR([you must have stdarg.h or varargs.h on your system])[
+
+ ${lo_have_str_hdr} || \
+ ]AC_MSG_ERROR([you must have string.h or strings.h on your system])[
+
+ ${lo_have_lim_hdr} || \
+ ]AC_MSG_ERROR(
+ [you must have one of limits.h, sys/limits.h or values.h])[
+
+ ${lo_have_typ_hdr} || \
+ ]AC_MSG_ERROR([you must have inttypes.h or stdint.h on your system])[
+
+ for f in sys_types sys_param sys_stat string errno stdlib memory setjmp
+ do eval as_ac_var=\${ac_cv_header_${f}_h}
+ test "X${as_ac_var}" = Xyes || {
+ ]AC_MSG_ERROR([you must have ${f}.h on your system])[
+ }
+ done
+ test "X${ac_cv_header_inttypes_h-no}" = Xyes || \
+ echo '#include <stdint.h>' > inttypes.h]
+
+ # ----------------------------------------------------------------------
+ # Checks for typedefs
+ # ----------------------------------------------------------------------
+ AC_CHECK_TYPES(wchar_t)
+ AC_CHECK_TYPES(wint_t, [], [], [
+ AC_INCLUDES_DEFAULT
+ #if HAVE_RUNETYPE_H
+ # include <runetype.h>
+ #endif
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+ ])
+ AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
+ intptr_t, uintptr_t, uint_t, pid_t, size_t, ptrdiff_t])
+ AC_CHECK_SIZEOF(char*, 8)
+ AC_CHECK_SIZEOF(int, 4)
+ AC_CHECK_SIZEOF(long, 8)
+ AC_CHECK_SIZEOF(short, 2)
+
+ # ------------
+ # AC_CHECK_LIB
+ # ------------
+ AC_CHECK_LIB(gen, pathfind)
+ AC_CHECK_LIB(intl,gettext)
+ AC_FUNC_VPRINTF
+ AC_FUNC_FORK
+ AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr \
+ strrchr strsignal fchmod fstat chmod])
+ AC_PROG_SED
+ [while :
+ do
+ POSIX_SHELL=`which bash`
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=`which dash`
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=/usr/xpg4/bin/sh
+ test -x "$POSIX_SHELL" && break
+ POSIX_SHELL=`/bin/sh -c '
+ exec 2>/dev/null
+ if ! true ; then exit 1 ; fi
+ echo /bin/sh'`
+ test -x "$POSIX_SHELL" && break
+ ]AC_MSG_ERROR([cannot locate a working POSIX shell])[
+ done]
+ AC_DEFINE_UNQUOTED([POSIX_SHELL], ["${POSIX_SHELL}"],
+ [define to a working POSIX compliant shell])
+ AC_SUBST([POSIX_SHELL])
+])
+
+dnl
+dnl @synopsis INVOKE_LIBOPTS_MACROS
+dnl
+dnl This macro will invoke the AutoConf macros specified in libopts.def
+dnl that have not been disabled with "omit-invocation".
+dnl
+AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[
+ AC_ARG_WITH([regex-header],
+ AS_HELP_STRING([--with-regex-header], [a reg expr header is specified]),
+ [libopts_cv_with_regex_header=${with_regex_header}],
+ AC_CACHE_CHECK([whether a reg expr header is specified], libopts_cv_with_regex_header,
+ libopts_cv_with_regex_header=no)
+ ) # end of AC_ARG_WITH
+ if test "X${libopts_cv_with_regex_header}" != Xno
+ then
+ AC_DEFINE_UNQUOTED([REGEX_HEADER],[<${libopts_cv_with_regex_header}>])
+ else
+ AC_DEFINE([REGEX_HEADER],[<regex.h>],[name of regex header file])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_WITH_REGEX_HEADER
+
+
+AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[
+ AC_ARG_WITH([libregex],
+ AS_HELP_STRING([--with-libregex], [libregex installation prefix]),
+ [libopts_cv_with_libregex_root=${with_libregex}],
+ AC_CACHE_CHECK([whether with-libregex was specified], libopts_cv_with_libregex_root,
+ libopts_cv_with_libregex_root=no)
+ ) # end of AC_ARG_WITH libregex
+
+ if test "${with_libregex+set}" = set && \
+ test "X${withval}" = Xno
+ then ## disabled by request
+ libopts_cv_with_libregex_root=no
+ libopts_cv_with_libregex_cflags=no
+ libopts_cv_with_libregex_libs=no
+ else
+
+ AC_ARG_WITH([libregex-cflags],
+ AS_HELP_STRING([--with-libregex-cflags], [libregex compile flags]),
+ [libopts_cv_with_libregex_cflags=${with_libregex_cflags}],
+ AC_CACHE_CHECK([whether with-libregex-cflags was specified], libopts_cv_with_libregex_cflags,
+ libopts_cv_with_libregex_cflags=no)
+ ) # end of AC_ARG_WITH libregex-cflags
+
+ AC_ARG_WITH([libregex-libs],
+ AS_HELP_STRING([--with-libregex-libs], [libregex link command arguments]),
+ [libopts_cv_with_libregex_libs=${with_libregex_libs}],
+ AC_CACHE_CHECK([whether with-libregex-libs was specified], libopts_cv_with_libregex_libs,
+ libopts_cv_with_libregex_libs=no)
+ ) # end of AC_ARG_WITH libregex-libs
+
+ case "X${libopts_cv_with_libregex_cflags}" in
+ Xyes|Xno|X )
+ case "X${libopts_cv_with_libregex_root}" in
+ Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;;
+ * ) libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;;
+ esac
+ esac
+ case "X${libopts_cv_with_libregex_libs}" in
+ Xyes|Xno|X )
+ case "X${libopts_cv_with_libregex_root}" in
+ Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;;
+ * ) libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";;
+ esac
+ esac
+ libopts_save_CPPFLAGS="${CPPFLAGS}"
+ libopts_save_LIBS="${LIBS}"
+ case "X${libopts_cv_with_libregex_cflags}" in
+ Xyes|Xno|X )
+ libopts_cv_with_libregex_cflags="" ;;
+ * ) CPPFLAGS="${CPPFLAGS} ${libopts_cv_with_libregex_cflags}" ;;
+ esac
+ case "X${libopts_cv_with_libregex_libs}" in
+ Xyes|Xno|X )
+ libopts_cv_with_libregex_libs="" ;;
+ * )
+ LIBS="${LIBS} ${libopts_cv_with_libregex_libs}" ;;
+ esac
+ LIBREGEX_CFLAGS=""
+ LIBREGEX_LIBS=""
+ AC_MSG_CHECKING([whether libregex functions properly])
+ AC_CACHE_VAL([libopts_cv_with_libregex],[
+ AC_RUN_IFELSE([@%:@include <stdio.h>
+@%:@include <stdlib.h>
+@%:@include <sys/types.h>
+@%:@include REGEX_HEADER
+static regex_t re;
+void comp_re( char const* pzPat ) {
+ int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE );
+ if (res == 0) return;
+ exit( res ); }
+int main() {
+ regmatch_t m@<:@2@:>@;
+ comp_re( "^.*\@S|@" );
+ comp_re( "()|no.*" );
+ comp_re( "." );
+ if (regexec( &re, "X", 2, m, 0 ) != 0) return 1;
+ if ((m@<:@0@:>@.rm_so != 0) || (m@<:@0@:>@.rm_eo != 1)) {
+ fputs( "error: regex -->.<-- did not match\n", stderr );
+ return 1;
+ }
+ return 0; }],
+ [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
+ [libopts_cv_with_libregex=no]) # end of AC_RUN_IFELSE
+ ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
+ fi ## disabled by request
+ AC_MSG_RESULT([${libopts_cv_with_libregex}])
+ if test "X${libopts_cv_with_libregex}" != Xno
+ then
+ AC_DEFINE([WITH_LIBREGEX],[1],
+ [Define this if a working libregex can be found])
+ else
+ CPPFLAGS="${libopts_save_CPPFLAGS}"
+ LIBS="${libopts_save_LIBS}"
+ libopts_cv_with_libregex_root=no
+libopts_cv_with_libregex_cflags=no
+libopts_cv_with_libregex_libs=no
+libopts_cv_with_libregex=no
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_WITHLIB_REGEX
+
+
+AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
+ AC_MSG_CHECKING([whether pathfind(3) works])
+ AC_CACHE_VAL([libopts_cv_run_pathfind],[
+ AC_RUN_IFELSE([@%:@include <string.h>
+@%:@include <stdlib.h>
+int main (int argc, char** argv) {
+ char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
+ return (pz == 0) ? 1 : 0;
+}],
+ [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
+ ) # end of RUN_IFELSE
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
+ AC_MSG_RESULT([${libopts_cv_run_pathfind}])
+ if test "X${libopts_cv_run_pathfind}" != Xno
+ then
+ AC_DEFINE([HAVE_PATHFIND],[1],
+ [Define this if pathfind(3) works])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_PATHFIND
+
+
+AC_DEFUN([LIBOPTS_TEST_DEV_ZERO],[
+ AC_MSG_CHECKING([whether /dev/zero is readable device])
+ AC_CACHE_VAL([libopts_cv_test_dev_zero],[
+ libopts_cv_test_dev_zero=`exec 2> /dev/null
+dzero=\`ls -lL /dev/zero | egrep ^c......r\`
+test -z "${dzero}" && exit 1
+echo ${dzero}`
+ if test $? -ne 0 || test -z "$libopts_cv_test_dev_zero"
+ then libopts_cv_test_dev_zero=no
+ fi
+ ]) # end of CACHE_VAL of libopts_cv_test_dev_zero
+ AC_MSG_RESULT([${libopts_cv_test_dev_zero}])
+ if test "X${libopts_cv_test_dev_zero}" != Xno
+ then
+ AC_DEFINE([HAVE_DEV_ZERO],[1],
+ [Define this if /dev/zero is readable device])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_TEST_DEV_ZERO
+
+
+AC_DEFUN([LIBOPTS_RUN_REALPATH],[
+ AC_MSG_CHECKING([whether we have a functional realpath(3C)])
+ AC_CACHE_VAL([libopts_cv_run_realpath],[
+ AC_RUN_IFELSE([@%:@include <limits.h>
+@%:@include <stdlib.h>
+int main (int argc, char** argv) {
+@%:@ifndef PATH_MAX
+choke me!!
+@%:@else
+ char zPath@<:@PATH_MAX+1@:>@;
+@%:@endif
+ char *pz = realpath(argv@<:@0@:>@, zPath);
+ return (pz == zPath) ? 0 : 1;
+}],
+ [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
+ ) # end of RUN_IFELSE
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
+ AC_MSG_RESULT([${libopts_cv_run_realpath}])
+ if test "X${libopts_cv_run_realpath}" != Xno
+ then
+ AC_DEFINE([HAVE_REALPATH],[1],
+ [Define this if we have a functional realpath(3C)])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_REALPATH
+
+
+AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
+ AC_MSG_CHECKING([whether strftime() works])
+ AC_CACHE_VAL([libopts_cv_run_strftime],[
+ AC_RUN_IFELSE([@%:@include <time.h>
+@%:@include <string.h>
+char t_buf@<:@ 64 @:>@;
+int main() {
+ static char const z@<:@@:>@ = "Thursday Aug 28 240";
+ struct tm tm;
+ tm.tm_sec = 36; /* seconds after the minute @<:@0, 61@:>@ */
+ tm.tm_min = 44; /* minutes after the hour @<:@0, 59@:>@ */
+ tm.tm_hour = 12; /* hour since midnight @<:@0, 23@:>@ */
+ tm.tm_mday = 28; /* day of the month @<:@1, 31@:>@ */
+ tm.tm_mon = 7; /* months since January @<:@0, 11@:>@ */
+ tm.tm_year = 86; /* years since 1900 */
+ tm.tm_wday = 4; /* days since Sunday @<:@0, 6@:>@ */
+ tm.tm_yday = 239; /* days since January 1 @<:@0, 365@:>@ */
+ tm.tm_isdst = 1; /* flag for daylight savings time */
+ strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
+ return (strcmp( t_buf, z ) != 0); }],
+ [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
+ ) # end of RUN_IFELSE
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
+ AC_MSG_RESULT([${libopts_cv_run_strftime}])
+ if test "X${libopts_cv_run_strftime}" != Xno
+ then
+ AC_DEFINE([HAVE_STRFTIME],[1],
+ [Define this if strftime() works])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_STRFTIME
+
+
+AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
+ AC_MSG_CHECKING([whether fopen accepts "b" mode])
+ AC_CACHE_VAL([libopts_cv_run_fopen_binary],[
+ AC_RUN_IFELSE([@%:@include <stdio.h>
+int main (int argc, char** argv) {
+FILE* fp = fopen("conftest.@S|@ac_ext", "rb");
+return (fp == NULL) ? 1 : fclose(fp); }],
+ [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
+ ) # end of RUN_IFELSE
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
+ AC_MSG_RESULT([${libopts_cv_run_fopen_binary}])
+ if test "X${libopts_cv_run_fopen_binary}" != Xno
+ then
+ AC_DEFINE([FOPEN_BINARY_FLAG],"b",
+ [fopen(3) accepts a 'b' in the mode flag])
+ else
+ AC_DEFINE([FOPEN_BINARY_FLAG],"",
+ [fopen(3) accepts a 'b' in the mode flag])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_BINARY
+
+
+AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
+ AC_MSG_CHECKING([whether fopen accepts "t" mode])
+ AC_CACHE_VAL([libopts_cv_run_fopen_text],[
+ AC_RUN_IFELSE([@%:@include <stdio.h>
+int main (int argc, char** argv) {
+FILE* fp = fopen("conftest.@S|@ac_ext", "rt");
+return (fp == NULL) ? 1 : fclose(fp); }],
+ [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
+ ) # end of RUN_IFELSE
+ ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
+ AC_MSG_RESULT([${libopts_cv_run_fopen_text}])
+ if test "X${libopts_cv_run_fopen_text}" != Xno
+ then
+ AC_DEFINE([FOPEN_TEXT_FLAG],"t",
+ [fopen(3) accepts a 't' in the mode flag])
+ else
+ AC_DEFINE([FOPEN_TEXT_FLAG],"",
+ [fopen(3) accepts a 't' in the mode flag])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_TEXT
+
+
+AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[
+ AC_ARG_ENABLE([optional-args],
+ AS_HELP_STRING([--disable-optional-args], [not wanting optional option args]),
+ [libopts_cv_enable_optional_args=${enable_optional_args}],
+ AC_CACHE_CHECK([whether not wanting optional option args], libopts_cv_enable_optional_args,
+ libopts_cv_enable_optional_args=yes)
+ ) # end of AC_ARG_ENABLE
+ if test "X${libopts_cv_enable_optional_args}" = Xno
+ then
+ AC_DEFINE([NO_OPTIONAL_OPT_ARGS], [1],
+ [Define this if optional arguments are disallowed])
+ fi
+
+]) # end of AC_DEFUN of LIBOPTS_DISABLE_OPTIONAL_ARGS
+
+
+AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
+ AC_REQUIRE([INVOKE_LIBOPTS_MACROS_FIRST])
+ # Check to see if a reg expr header is specified.
+ LIBOPTS_WITH_REGEX_HEADER
+
+ # Check to see if a working libregex can be found.
+ LIBOPTS_WITHLIB_REGEX
+
+ # Check to see if pathfind(3) works.
+ LIBOPTS_RUN_PATHFIND
+
+ # Check to see if /dev/zero is readable device.
+ LIBOPTS_TEST_DEV_ZERO
+
+ # Check to see if we have a functional realpath(3C).
+ LIBOPTS_RUN_REALPATH
+
+ # Check to see if strftime() works.
+ LIBOPTS_RUN_STRFTIME
+
+ # Check to see if fopen accepts "b" mode.
+ LIBOPTS_RUN_FOPEN_BINARY
+
+ # Check to see if fopen accepts "t" mode.
+ LIBOPTS_RUN_FOPEN_TEXT
+
+ # Check to see if not wanting optional option args.
+ LIBOPTS_DISABLE_OPTIONAL_ARGS
+
+]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS
+
+dnl @synopsis LIBOPTS_CHECK
+dnl
+dnl If autoopts-config works, add the linking information to LIBS.
+dnl Otherwise, add ``libopts-${ao_rev}'' to SUBDIRS and run all
+dnl the config tests that the library needs. Invoke the
+dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts.
+dnl
+dnl This file is part of AutoGen.
+dnl AutoGen Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+dnl
+dnl AutoGen is free software: you can redistribute it and/or modify it
+dnl under the terms of the GNU General Public License as published by the
+dnl Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl AutoGen is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+dnl See the GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License along
+dnl with this program. If not, see <http://www.gnu.org/licenses/>.
+dnl
+dnl Default to system libopts
+dnl
+AC_DEFUN([LIBOPTS_CHECK_COMMON],[
+ AC_REQUIRE([INVOKE_LIBOPTS_MACROS_FIRST])
+ [NEED_LIBOPTS_DIR='']
+ m4_pushdef([AO_Libopts_Dir],
+ [ifelse($1, , [libopts], [$1])])
+ AC_ARG_ENABLE([local-libopts],
+ AC_HELP_STRING([--enable-local-libopts],
+ [Use the supplied libopts tearoff code]),[
+ if test x$enableval = xyes ; then
+ AC_MSG_NOTICE([Using supplied libopts tearoff])
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/AO_Libopts_Dir'
+ NEED_LIBOPTS_DIR=true
+ LIBOPTS_LDADD='$(top_builddir)/AO_Libopts_Dir/libopts.la'
+ fi])
+
+ AC_ARG_ENABLE([libopts-install],
+ AC_HELP_STRING([--enable-libopts-install],
+ [Install libopts with client installation]))
+ AM_CONDITIONAL([INSTALL_LIBOPTS],[test "X${enable_libopts_install}" = Xyes])
+
+ [if test -z "${NEED_LIBOPTS_DIR}" ; then]
+ AC_MSG_CHECKING([whether autoopts-config can be found])
+ AC_ARG_WITH([autoopts-config],
+ AC_HELP_STRING([--with-autoopts-config],
+ [specify the config-info script]),
+ [lo_cv_with_autoopts_config=${with_autoopts_config}],
+ AC_CACHE_CHECK([whether autoopts-config is specified],
+ [lo_cv_with_autoopts_config],
+ [if autoopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=autoopts-config
+ elif libopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=libopts-config
+ else lo_cv_with_autoopts_config=no ; fi])
+ ) # end of AC_ARG_WITH
+
+ AC_CACHE_VAL([lo_cv_test_autoopts],[
+ if test -z "${lo_cv_with_autoopts_config}" \
+ -o X"${lo_cv_with_autoopts_config}" = Xno
+ then
+ if autoopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=autoopts-config
+ elif libopts-config --help 2>/dev/null 1>&2
+ then lo_cv_with_autoopts_config=libopts-config
+ else lo_cv_with_autoopts_config=false ; fi
+ fi
+ lo_cv_test_autoopts=`
+ ${lo_cv_with_autoopts_config} --libs` 2> /dev/null
+ if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
+ then lo_cv_test_autoopts=no ; fi
+ ]) # end of CACHE_VAL
+ AC_MSG_RESULT([${lo_cv_test_autoopts}])
+
+ [if test "X${lo_cv_test_autoopts}" != Xno
+ then
+ LIBOPTS_LDADD="${lo_cv_test_autoopts}"
+ LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`"
+ else
+ LIBOPTS_LDADD='$(top_builddir)/]AO_Libopts_Dir[/libopts.la'
+ LIBOPTS_CFLAGS='-I$(top_srcdir)/]AO_Libopts_Dir['
+ NEED_LIBOPTS_DIR=true
+ fi
+ fi # end of if test -z "${NEED_LIBOPTS_DIR}"
+ if test -n "${LIBOPTS_BUILD_BLOCKED}" ; then
+ NEED_LIBOPTS_DIR=''
+ fi]
+ AM_CONDITIONAL([NEED_LIBOPTS], [test -n "${NEED_LIBOPTS_DIR}"])
+ AC_SUBST(LIBOPTS_LDADD)
+ AC_SUBST(LIBOPTS_CFLAGS)
+ AC_SUBST(LIBOPTS_DIR, AO_Libopts_Dir)
+ m4_popdef([AO_Libopts_Dir])
+[# end of AC_DEFUN of LIBOPTS_CHECK_COMMON]
+])
+dnl
+dnl AC_CONFIG_FILES conditionalization requires using AM_COND_IF, however
+dnl AM_COND_IF is new to Automake 1.11. To use it on new Automake without
+dnl requiring same, a fallback implementation for older Automake is provided.
+dnl Note that disabling of AC_CONFIG_FILES requires Automake 1.11, this code
+dnl is correct only in terms of m4sh generated script.
+dnl
+m4_ifndef([AM_COND_IF],
+ [AC_DEFUN([AM_COND_IF], [
+ if test -z "$$1_TRUE"; then :
+ m4_n([$2])[]dnl
+ m4_ifval([$3],[
+ else
+ $3
+ ])dnl
+ fi[]dnl
+ ])dnl
+])
+dnl
+AC_DEFUN([LIBOPTS_CHECK_NOBUILD], [
+ m4_pushdef([AO_Libopts_Dir],
+ [ifelse($1, , [libopts], [$1])])
+ LIBOPTS_BUILD_BLOCKED=true
+ LIBOPTS_CHECK_COMMON(AO_Libopts_Dir)
+ m4_popdef([AO_Libopts_Dir])dnl
+# end of AC_DEFUN of LIBOPTS_CHECK_NOBUILD
+])
+dnl
+AC_DEFUN([LIBOPTS_CHECK], [
+ m4_pushdef([AO_Libopts_Dir],
+ [ifelse($1, , [libopts], [$1])])
+ LIBOPTS_BUILD_BLOCKED=''
+ LIBOPTS_CHECK_COMMON(AO_Libopts_Dir)
+ AM_COND_IF([NEED_LIBOPTS], [
+ INVOKE_LIBOPTS_MACROS
+ ])
+ AC_CONFIG_FILES(AO_Libopts_Dir/Makefile)
+ m4_popdef([AO_Libopts_Dir])dnl
+# end of AC_DEFUN of LIBOPTS_CHECK
+])
diff --git a/sntp/libopts/m4/liboptschk.m4 b/sntp/libopts/m4/liboptschk.m4
new file mode 100644
index 0000000..c71ae10
--- /dev/null
+++ b/sntp/libopts/m4/liboptschk.m4
@@ -0,0 +1,27 @@
+# liboptschk.m4 serial 2 (autogen - 5.11.4)
+dnl Copyright (C) 2005-2014 by Bruce Korb - all rights reserved
+dnl
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+AC_DEFUN([ag_FIND_LIBOPTS],
+ [if test "X${ac_cv_header_autoopts_options_h}" = Xno
+ then :
+ else
+ f=`autoopts-config cflags` 2>/dev/null
+ if test X"${f}" = X
+ then
+ :
+ else
+ AC_DEFINE([HAVE_LIBOPTS],[1],[define if we can find libopts])
+ CFLAGS="${CFLAGS} ${f}"
+ ao_CFLAGS="${f}"
+ AC_SUBST(ao_CFLAGS)
+
+ f=`autoopts-config ldflags` 2>/dev/null
+ LIBS="${LIBS} ${f}"
+ ao_LIBS="${f}"
+ AC_SUBST(ao_LIBS)
+ fi
+ fi])
diff --git a/sntp/libopts/m4/stdnoreturn.m4 b/sntp/libopts/m4/stdnoreturn.m4
new file mode 100644
index 0000000..eea2c1e
--- /dev/null
+++ b/sntp/libopts/m4/stdnoreturn.m4
@@ -0,0 +1,41 @@
+# Check for stdnoreturn.h that conforms to C11.
+
+dnl Copyright 2012-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Prepare for substituting <stdnoreturn.h> if it is not supported.
+
+AC_DEFUN([gl_STDNORETURN_H],
+[
+ AC_CACHE_CHECK([for working stdnoreturn.h],
+ [gl_cv_header_working_stdnoreturn_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ #include <stdnoreturn.h>
+ /* Do not check for 'noreturn' after the return type.
+ C11 allows it, but it's rarely done that way
+ and circa-2012 bleeding-edge GCC rejects it when given
+ -Werror=old-style-declaration. */
+ noreturn void foo1 (void) { exit (0); }
+ _Noreturn void foo2 (void) { exit (0); }
+ int testit (int argc, char **argv) {
+ if (argc & 1)
+ return 0;
+ (argv[0][0] ? foo1 : foo2) ();
+ }
+ ]])],
+ [gl_cv_header_working_stdnoreturn_h=yes],
+ [gl_cv_header_working_stdnoreturn_h=no])])
+
+ if test $gl_cv_header_working_stdnoreturn_h = yes; then
+ STDNORETURN_H=''
+ else
+ STDNORETURN_H='stdnoreturn.h'
+ fi
+
+ AC_SUBST([STDNORETURN_H])
+ AM_CONDITIONAL([GL_GENERATE_STDNORETURN_H], [test -n "$STDNORETURN_H"])
+])
diff --git a/sntp/libopts/makeshell.c b/sntp/libopts/makeshell.c
new file mode 100644
index 0000000..a0bfcac
--- /dev/null
+++ b/sntp/libopts/makeshell.c
@@ -0,0 +1,951 @@
+
+/**
+ * \file makeshell.c
+ *
+ * This module will interpret the options set in the tOptions
+ * structure and create a Bourne shell script capable of parsing them.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static void
+emit_var_text(char const * prog, char const * var, int fdin);
+
+static void
+text_to_var(tOptions * opts, teTextTo which, tOptDesc * od);
+
+static void
+emit_usage(tOptions * opts);
+
+static void
+emit_wrapup(tOptions * opts);
+
+static void
+emit_setup(tOptions * opts);
+
+static void
+emit_action(tOptions * opts, tOptDesc * od);
+
+static void
+emit_inaction(tOptions * opts, tOptDesc * od);
+
+static void
+emit_flag(tOptions * opts);
+
+static void
+emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts);
+
+static void
+emit_long(tOptions * opts);
+
+static char *
+load_old_output(char const * fname, char const * pname);
+
+static void
+open_out(char const * fname, char const * pname);
+/* = = = END-STATIC-FORWARD = = = */
+
+LOCAL noreturn void
+option_exits(int exit_code)
+{
+ if (print_exit)
+ printf("\nexit %d\n", exit_code);
+ exit(exit_code);
+}
+
+LOCAL noreturn void
+ao_bug(char const * msg)
+{
+ fprintf(stderr, zao_bug_msg, msg);
+ option_exits(EX_SOFTWARE);
+}
+
+LOCAL void
+fserr_warn(char const * prog, char const * op, char const * fname)
+{
+ fprintf(stderr, zfserr_fmt, prog, errno, strerror(errno),
+ op, fname);
+}
+
+LOCAL noreturn void
+fserr_exit(char const * prog, char const * op, char const * fname)
+{
+ fserr_warn(prog, op, fname);
+ option_exits(EXIT_FAILURE);
+}
+
+/*=export_func optionParseShell
+ * private:
+ *
+ * what: Decipher a boolean value
+ * arg: + tOptions* + pOpts + program options descriptor +
+ *
+ * doc:
+ * Emit a shell script that will parse the command line options.
+=*/
+void
+optionParseShell(tOptions * opts)
+{
+ /*
+ * Check for our SHELL option now.
+ * IF the output file contains the "#!" magic marker,
+ * it will override anything we do here.
+ */
+ if (HAVE_GENSHELL_OPT(SHELL))
+ shell_prog = GENSHELL_OPT_ARG(SHELL);
+
+ else if (! ENABLED_GENSHELL_OPT(SHELL))
+ shell_prog = NULL;
+
+ else if ((shell_prog = getenv("SHELL")),
+ shell_prog == NULL)
+
+ shell_prog = POSIX_SHELL;
+
+ /*
+ * Check for a specified output file
+ */
+ if (HAVE_GENSHELL_OPT(SCRIPT))
+ open_out(GENSHELL_OPT_ARG(SCRIPT), opts->pzProgName);
+
+ emit_usage(opts);
+ emit_setup(opts);
+
+ /*
+ * There are four modes of option processing.
+ */
+ switch (opts->fOptSet & (OPTPROC_LONGOPT|OPTPROC_SHORTOPT)) {
+ case OPTPROC_LONGOPT:
+ fputs(LOOP_STR, stdout);
+
+ fputs(LONG_OPT_MARK, stdout);
+ fputs(INIT_LOPT_STR, stdout);
+ emit_long(opts);
+ printf(LOPT_ARG_FMT, opts->pzPROGNAME);
+ fputs(END_OPT_SEL_STR, stdout);
+
+ fputs(NOT_FOUND_STR, stdout);
+ break;
+
+ case 0:
+ fputs(ONLY_OPTS_LOOP, stdout);
+ fputs(INIT_LOPT_STR, stdout);
+ emit_long(opts);
+ printf(LOPT_ARG_FMT, opts->pzPROGNAME);
+ break;
+
+ case OPTPROC_SHORTOPT:
+ fputs(LOOP_STR, stdout);
+
+ fputs(FLAG_OPT_MARK, stdout);
+ fputs(INIT_OPT_STR, stdout);
+ emit_flag(opts);
+ printf(OPT_ARG_FMT, opts->pzPROGNAME);
+ fputs(END_OPT_SEL_STR, stdout);
+
+ fputs(NOT_FOUND_STR, stdout);
+ break;
+
+ case OPTPROC_LONGOPT|OPTPROC_SHORTOPT:
+ fputs(LOOP_STR, stdout);
+
+ fputs(LONG_OPT_MARK, stdout);
+ fputs(INIT_LOPT_STR, stdout);
+ emit_long(opts);
+ printf(LOPT_ARG_FMT, opts->pzPROGNAME);
+ fputs(END_OPT_SEL_STR, stdout);
+
+ fputs(FLAG_OPT_MARK, stdout);
+ fputs(INIT_OPT_STR, stdout);
+ emit_flag(opts);
+ printf(OPT_ARG_FMT, opts->pzPROGNAME);
+ fputs(END_OPT_SEL_STR, stdout);
+
+ fputs(NOT_FOUND_STR, stdout);
+ break;
+ }
+
+ emit_wrapup(opts);
+ if ((script_trailer != NULL) && (*script_trailer != NUL))
+ fputs(script_trailer, stdout);
+ else if (ENABLED_GENSHELL_OPT(SHELL))
+ printf(SHOW_PROG_ENV, opts->pzPROGNAME);
+
+#ifdef HAVE_FCHMOD
+ fchmod(STDOUT_FILENO, 0755);
+#endif
+ fclose(stdout);
+
+ if (ferror(stdout))
+ fserr_exit(opts->pzProgName, zwriting, zstdout_name);
+
+ AGFREE(script_text);
+ script_leader = NULL;
+ script_trailer = NULL;
+ script_text = NULL;
+}
+
+#ifdef HAVE_WORKING_FORK
+/**
+ * Print the value of "var" to a file descriptor.
+ * The "fdin" is the read end of a pipe to a forked process that
+ * is writing usage text to it. We read that text in and re-emit
+ * to standard out, formatting it so that it is assigned to a
+ * shell variable.
+ *
+ * @param[in] prog The capitalized, c-variable-formatted program name
+ * @param[in] var a similarly formatted type name
+ * (LONGUSAGE, USAGE or VERSION)
+ * @param[in] fdin the input end of a pipe
+ */
+static void
+emit_var_text(char const * prog, char const * var, int fdin)
+{
+ FILE * fp = fdopen(fdin, "r" FOPEN_BINARY_FLAG);
+ int nlct = 0; /* defer newlines and skip trailing ones */
+
+ printf(SET_TEXT_FMT, prog, var);
+ if (fp == NULL)
+ goto skip_text;
+
+ for (;;) {
+ int ch = fgetc(fp);
+ switch (ch) {
+
+ case NL:
+ nlct++;
+ break;
+
+ case '\'':
+ while (nlct > 0) {
+ fputc(NL, stdout);
+ nlct--;
+ }
+ fputs(apostrophe, stdout);
+ break;
+
+ case EOF:
+ goto done;
+
+ default:
+ while (nlct > 0) {
+ fputc(NL, stdout);
+ nlct--;
+ }
+ fputc(ch, stdout);
+ break;
+ }
+ } done:;
+
+ fclose(fp);
+
+ skip_text:
+
+ fputs(END_SET_TEXT, stdout);
+}
+#endif
+
+/**
+ * The purpose of this function is to assign "long usage", short usage
+ * and version information to a shell variable. Rather than wind our
+ * way through all the logic necessary to emit the text directly, we
+ * fork(), have our child process emit the text the normal way and
+ * capture the output in the parent process.
+ *
+ * @param[in] opts the program options
+ * @param[in] which what to print: long usage, usage or version
+ * @param[in] od for TT_VERSION, it is the version option
+ */
+static void
+text_to_var(tOptions * opts, teTextTo which, tOptDesc * od)
+{
+# define _TT_(n) static char const z ## n [] = #n;
+ TEXTTO_TABLE
+# undef _TT_
+# define _TT_(n) z ## n ,
+ static char const * ttnames[] = { TEXTTO_TABLE };
+# undef _TT_
+
+#if ! defined(HAVE_WORKING_FORK)
+ printf(SET_NO_TEXT_FMT, opts->pzPROGNAME, ttnames[which]);
+#else
+ int fdpair[2];
+
+ fflush(stdout);
+ fflush(stderr);
+
+ if (pipe(fdpair) != 0)
+ fserr_exit(opts->pzProgName, "pipe", zinter_proc_pipe);
+
+ switch (fork()) {
+ case -1:
+ fserr_exit(opts->pzProgName, "fork", opts->pzProgName);
+ /* NOTREACHED */
+
+ case 0:
+ /*
+ * Send both stderr and stdout to the pipe. No matter which
+ * descriptor is used, we capture the output on the read end.
+ */
+ dup2(fdpair[1], STDERR_FILENO);
+ dup2(fdpair[1], STDOUT_FILENO);
+ close(fdpair[0]);
+
+ switch (which) {
+ case TT_LONGUSAGE:
+ (*(opts->pUsageProc))(opts, EXIT_SUCCESS);
+ /* NOTREACHED */
+
+ case TT_USAGE:
+ (*(opts->pUsageProc))(opts, EXIT_FAILURE);
+ /* NOTREACHED */
+
+ case TT_VERSION:
+ if (od->fOptState & OPTST_ALLOC_ARG) {
+ AGFREE(od->optArg.argString);
+ od->fOptState &= ~OPTST_ALLOC_ARG;
+ }
+ od->optArg.argString = "c";
+ optionPrintVersion(opts, od);
+ /* NOTREACHED */
+
+ default:
+ option_exits(EXIT_FAILURE);
+ /* NOTREACHED */
+ }
+ /* NOTREACHED */
+
+ default:
+ close(fdpair[1]);
+ }
+
+ emit_var_text(opts->pzPROGNAME, ttnames[which], fdpair[0]);
+#endif
+}
+
+/**
+ * capture usage text in shell variables.
+ *
+ */
+static void
+emit_usage(tOptions * opts)
+{
+ char tm_nm_buf[AO_NAME_SIZE];
+
+ /*
+ * First, switch stdout to the output file name.
+ * Then, change the program name to the one defined
+ * by the definitions (rather than the current
+ * executable name). Down case the upper cased name.
+ */
+ if (script_leader != NULL)
+ fputs(script_leader, stdout);
+
+ {
+ char const * out_nm;
+
+ {
+ time_t c_tim = time(NULL);
+ struct tm * ptm = localtime(&c_tim);
+ strftime(tm_nm_buf, AO_NAME_SIZE, TIME_FMT, ptm );
+ }
+
+ if (HAVE_GENSHELL_OPT(SCRIPT))
+ out_nm = GENSHELL_OPT_ARG(SCRIPT);
+ else out_nm = STDOUT;
+
+ if ((script_leader == NULL) && (shell_prog != NULL))
+ printf(SHELL_MAGIC, shell_prog);
+
+ printf(PREAMBLE_FMT, START_MARK, out_nm, tm_nm_buf);
+ }
+
+ printf(END_PRE_FMT, opts->pzPROGNAME);
+
+ /*
+ * Get a copy of the original program name in lower case and
+ * fill in an approximation of the program name from it.
+ */
+ {
+ char * pzPN = tm_nm_buf;
+ char const * pz = opts->pzPROGNAME;
+ char ** pp;
+
+ /* Copy the program name into the time/name buffer */
+ for (;;) {
+ if ((*pzPN++ = (char)tolower(*pz++)) == NUL)
+ break;
+ }
+
+ pp = (char **)(void *)&(opts->pzProgPath);
+ *pp = tm_nm_buf;
+ pp = (char **)(void *)&(opts->pzProgName);
+ *pp = tm_nm_buf;
+ }
+
+ text_to_var(opts, TT_LONGUSAGE, NULL);
+ text_to_var(opts, TT_USAGE, NULL);
+
+ {
+ tOptDesc* pOptDesc = opts->pOptDesc;
+ int optionCt = opts->optCt;
+
+ for (;;) {
+ if (pOptDesc->pOptProc == optionPrintVersion) {
+ text_to_var(opts, TT_VERSION, pOptDesc);
+ break;
+ }
+
+ if (--optionCt <= 0)
+ break;
+ pOptDesc++;
+ }
+ }
+}
+
+static void
+emit_wrapup(tOptions * opts)
+{
+ tOptDesc * od = opts->pOptDesc;
+ int opt_ct = opts->presetOptCt;
+ char const * fmt;
+
+ printf(FINISH_LOOP, opts->pzPROGNAME);
+ for (;opt_ct > 0; od++, --opt_ct) {
+ /*
+ * Options that are either usage documentation or are compiled out
+ * are not to be processed.
+ */
+ if (SKIP_OPT(od) || (od->pz_NAME == NULL))
+ continue;
+
+ /*
+ * do not presence check if there is no minimum/must-set
+ */
+ if ((od->optMinCt == 0) && ((od->fOptState & OPTST_MUST_SET) == 0))
+ continue;
+
+ if (od->optMaxCt > 1)
+ fmt = CHK_MIN_COUNT;
+ else fmt = CHK_ONE_REQUIRED;
+
+ {
+ int min = (od->optMinCt == 0) ? 1 : od->optMinCt;
+ printf(fmt, opts->pzPROGNAME, od->pz_NAME, min);
+ }
+ }
+ fputs(END_MARK, stdout);
+}
+
+static void
+emit_setup(tOptions * opts)
+{
+ tOptDesc * od = opts->pOptDesc;
+ int opt_ct = opts->presetOptCt;
+ char const * fmt;
+ char const * def_val;
+
+ for (;opt_ct > 0; od++, --opt_ct) {
+ char int_val_buf[32];
+
+ /*
+ * Options that are either usage documentation or are compiled out
+ * are not to be processed.
+ */
+ if (SKIP_OPT(od) || (od->pz_NAME == NULL))
+ continue;
+
+ if (od->optMaxCt > 1)
+ fmt = MULTI_DEF_FMT;
+ else fmt = SGL_DEF_FMT;
+
+ /*
+ * IF this is an enumeration/bitmask option, then convert the value
+ * to a string before printing the default value.
+ */
+ switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_ENUMERATION:
+ (*(od->pOptProc))(OPTPROC_EMIT_SHELL, od );
+ def_val = od->optArg.argString;
+ break;
+
+ /*
+ * Numeric and membership bit options are just printed as a number.
+ */
+ case OPARG_TYPE_NUMERIC:
+ snprintf(int_val_buf, sizeof(int_val_buf), "%d",
+ (int)od->optArg.argInt);
+ def_val = int_val_buf;
+ break;
+
+ case OPARG_TYPE_MEMBERSHIP:
+ snprintf(int_val_buf, sizeof(int_val_buf), "%lu",
+ (unsigned long)od->optArg.argIntptr);
+ def_val = int_val_buf;
+ break;
+
+ case OPARG_TYPE_BOOLEAN:
+ def_val = (od->optArg.argBool) ? TRUE_STR : FALSE_STR;
+ break;
+
+ default:
+ if (od->optArg.argString == NULL) {
+ if (fmt == SGL_DEF_FMT)
+ fmt = SGL_NO_DEF_FMT;
+ def_val = NULL;
+ }
+ else
+ def_val = od->optArg.argString;
+ }
+
+ printf(fmt, opts->pzPROGNAME, od->pz_NAME, def_val);
+ }
+}
+
+static void
+emit_action(tOptions * opts, tOptDesc * od)
+{
+ if (od->pOptProc == optionPrintVersion)
+ printf(ECHO_N_EXIT, opts->pzPROGNAME, VER_STR);
+
+ else if (od->pOptProc == optionPagedUsage)
+ printf(PAGE_USAGE_TEXT, opts->pzPROGNAME);
+
+ else if (od->pOptProc == optionLoadOpt) {
+ printf(LVL3_CMD, NO_LOAD_WARN);
+ printf(LVL3_CMD, YES_NEED_OPT_ARG);
+
+ } else if (od->pz_NAME == NULL) {
+
+ if (od->pOptProc == NULL) {
+ printf(LVL3_CMD, NO_SAVE_OPTS);
+ printf(LVL3_CMD, OK_NEED_OPT_ARG);
+ } else
+ printf(ECHO_N_EXIT, opts->pzPROGNAME, LONG_USE_STR);
+
+ } else {
+ if (od->optMaxCt == 1)
+ printf(SGL_ARG_FMT, opts->pzPROGNAME, od->pz_NAME);
+ else {
+ if ((unsigned)od->optMaxCt < NOLIMIT)
+ printf(CHK_MAX_COUNT, opts->pzPROGNAME,
+ od->pz_NAME, od->optMaxCt);
+
+ printf(MULTI_ARG_FMT, opts->pzPROGNAME, od->pz_NAME);
+ }
+
+ /*
+ * Fix up the args.
+ */
+ if (OPTST_GET_ARGTYPE(od->fOptState) == OPARG_TYPE_NONE) {
+ printf(SET_MULTI_ARG, opts->pzPROGNAME, od->pz_NAME);
+ printf(LVL3_CMD, NO_ARG_NEEDED);
+
+ } else if (od->fOptState & OPTST_ARG_OPTIONAL) {
+ printf(SET_MULTI_ARG, opts->pzPROGNAME, od->pz_NAME);
+ printf(LVL3_CMD, OK_NEED_OPT_ARG);
+
+ } else {
+ printf(LVL3_CMD, YES_NEED_OPT_ARG);
+ }
+ }
+ fputs(zOptionEndSelect, stdout);
+}
+
+static void
+emit_inaction(tOptions * opts, tOptDesc * od)
+{
+ if (od->pOptProc == optionLoadOpt) {
+ printf(LVL3_CMD, NO_SUPPRESS_LOAD);
+
+ } else if (od->optMaxCt == 1)
+ printf(NO_SGL_ARG_FMT, opts->pzPROGNAME,
+ od->pz_NAME, od->pz_DisablePfx);
+ else
+ printf(NO_MULTI_ARG_FMT, opts->pzPROGNAME,
+ od->pz_NAME, od->pz_DisablePfx);
+
+ printf(LVL3_CMD, NO_ARG_NEEDED);
+ fputs(zOptionEndSelect, stdout);
+}
+
+/**
+ * recognize flag options. These go at the end.
+ * At the end, emit code to handle options we don't recognize.
+ *
+ * @param[in] opts the program options
+ */
+static void
+emit_flag(tOptions * opts)
+{
+ tOptDesc* od = opts->pOptDesc;
+ int opt_ct = opts->optCt;
+
+ fputs(zOptionCase, stdout);
+
+ for (;opt_ct > 0; od++, --opt_ct) {
+
+ if (SKIP_OPT(od) || ! IS_GRAPHIC_CHAR(od->optValue))
+ continue;
+
+ printf(zOptionFlag, od->optValue);
+ emit_action(opts, od);
+ }
+ printf(UNK_OPT_FMT, FLAG_STR, opts->pzPROGNAME);
+}
+
+/**
+ * Emit the match text for a long option. The passed in \a name may be
+ * either the enablement name or the disablement name.
+ *
+ * @param[in] name The current name to check.
+ * @param[in] cod current option descriptor
+ * @param[in] opts the program options
+ */
+static void
+emit_match_expr(char const * name, tOptDesc * cod, tOptions * opts)
+{
+ char name_bf[32];
+ unsigned int min_match_ct = 2;
+ unsigned int max_match_ct = strlen(name) - 1;
+
+ if (max_match_ct >= sizeof(name_bf) - 1)
+ goto leave;
+
+ {
+ tOptDesc * od = opts->pOptDesc;
+ int ct = opts->optCt;
+
+ for (; ct-- > 0; od++) {
+ unsigned int match_ct = 0;
+
+ /*
+ * Omit the current option, Doc opts and compiled out opts.
+ */
+ if ((od == cod) || SKIP_OPT(od))
+ continue;
+
+ /*
+ * Check each character of the name case insensitively.
+ * They must not be the same. They cannot be, because it would
+ * not compile correctly if they were.
+ */
+ while (toupper(od->pz_Name[match_ct]) == toupper(name[match_ct]))
+ match_ct++;
+
+ if (match_ct > min_match_ct)
+ min_match_ct = match_ct;
+
+ /*
+ * Check the disablement name, too.
+ */
+ if (od->pz_DisableName == NULL)
+ continue;
+
+ match_ct = 0;
+ while ( toupper(od->pz_DisableName[match_ct])
+ == toupper(name[match_ct]))
+ match_ct++;
+ if (match_ct > min_match_ct)
+ min_match_ct = match_ct;
+ }
+ }
+
+ /*
+ * Don't bother emitting partial matches if there is only one possible
+ * partial match.
+ */
+ if (min_match_ct < max_match_ct) {
+ char * pz = name_bf + min_match_ct;
+ int nm_ix = min_match_ct;
+
+ memcpy(name_bf, name, min_match_ct);
+
+ for (;;) {
+ *pz = NUL;
+ printf(zOptionPartName, name_bf);
+ *pz++ = name[nm_ix++];
+ if (name[nm_ix] == NUL) {
+ *pz = NUL;
+ break;
+ }
+ }
+ }
+
+leave:
+ printf(zOptionFullName, name);
+}
+
+/**
+ * Emit GNU-standard long option handling code.
+ *
+ * @param[in] opts the program options
+ */
+static void
+emit_long(tOptions * opts)
+{
+ tOptDesc * od = opts->pOptDesc;
+ int ct = opts->optCt;
+
+ fputs(zOptionCase, stdout);
+
+ /*
+ * do each option, ...
+ */
+ do {
+ /*
+ * Documentation & compiled-out options
+ */
+ if (SKIP_OPT(od))
+ continue;
+
+ emit_match_expr(od->pz_Name, od, opts);
+ emit_action(opts, od);
+
+ /*
+ * Now, do the same thing for the disablement version of the option.
+ */
+ if (od->pz_DisableName != NULL) {
+ emit_match_expr(od->pz_DisableName, od, opts);
+ emit_inaction(opts, od);
+ }
+ } while (od++, --ct > 0);
+
+ printf(UNK_OPT_FMT, OPTION_STR, opts->pzPROGNAME);
+}
+
+/**
+ * Load the previous shell script output file. We need to preserve any
+ * hand-edited additions outside of the START_MARK and END_MARKs.
+ *
+ * @param[in] fname the output file name
+ */
+static char *
+load_old_output(char const * fname, char const * pname)
+{
+ /*
+ * IF we cannot stat the file,
+ * THEN assume we are creating a new file.
+ * Skip the loading of the old data.
+ */
+ FILE * fp = fopen(fname, "r" FOPEN_BINARY_FLAG);
+ struct stat stbf;
+ char * text;
+ char * scan;
+
+ if (fp == NULL)
+ return NULL;
+
+ /*
+ * If we opened it, we should be able to stat it and it needs
+ * to be a regular file
+ */
+ if ((fstat(fileno(fp), &stbf) != 0) || (! S_ISREG(stbf.st_mode)))
+ fserr_exit(pname, "fstat", fname);
+
+ scan = text = AGALOC(stbf.st_size + 1, "f data");
+
+ /*
+ * Read in all the data as fast as our OS will let us.
+ */
+ for (;;) {
+ size_t inct = fread((void*)scan, 1, (size_t)stbf.st_size, fp);
+ if (inct == 0)
+ break;
+
+ stbf.st_size -= (ssize_t)inct;
+
+ if (stbf.st_size == 0)
+ break;
+
+ scan += inct;
+ }
+
+ *scan = NUL;
+ fclose(fp);
+
+ return text;
+}
+
+/**
+ * Open the specified output file. If it already exists, load its
+ * contents and save the non-generated (hand edited) portions.
+ * If a "start mark" is found, everything before it is preserved leader.
+ * If not, the entire thing is a trailer. Assuming the start is found,
+ * then everything after the end marker is the trailer. If the end
+ * mark is not found, the file is actually corrupt, but we take the
+ * remainder to be the trailer.
+ *
+ * @param[in] fname the output file name
+ */
+static void
+open_out(char const * fname, char const * pname)
+{
+
+ do {
+ char * txt = script_text = load_old_output(fname, pname);
+ char * scn;
+
+ if (txt == NULL)
+ break;
+
+ scn = strstr(txt, START_MARK);
+ if (scn == NULL) {
+ script_trailer = txt;
+ break;
+ }
+
+ *(scn++) = NUL;
+ scn = strstr(scn, END_MARK);
+ if (scn == NULL) {
+ /*
+ * The file is corrupt. Set the trailer to be everything
+ * after the start mark. The user will need to fix it up.
+ */
+ script_trailer = txt + strlen(txt) + START_MARK_LEN + 1;
+ break;
+ }
+
+ /*
+ * Check to see if the data contains our marker.
+ * If it does, then we will skip over it
+ */
+ script_trailer = scn + END_MARK_LEN;
+ script_leader = txt;
+ } while (false);
+
+ if (freopen(fname, "w" FOPEN_BINARY_FLAG, stdout) != stdout)
+ fserr_exit(pname, "freopen", fname);
+}
+
+/*=export_func genshelloptUsage
+ * private:
+ * what: The usage function for the genshellopt generated program
+ *
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + int + exit_cd + usage text type to produce +
+ *
+ * doc:
+ * This function is used to create the usage strings for the option
+ * processing shell script code. Two child processes are spawned
+ * each emitting the usage text in either the short (error exit)
+ * style or the long style. The generated program will capture this
+ * and create shell script variables containing the two types of text.
+=*/
+void
+genshelloptUsage(tOptions * opts, int exit_cd)
+{
+#if ! defined(HAVE_WORKING_FORK)
+ optionUsage(opts, exit_cd);
+#else
+ /*
+ * IF not EXIT_SUCCESS,
+ * THEN emit the short form of usage.
+ */
+ if (exit_cd != EXIT_SUCCESS)
+ optionUsage(opts, exit_cd);
+ fflush(stderr);
+ fflush(stdout);
+ if (ferror(stdout) || ferror(stderr))
+ option_exits(EXIT_FAILURE);
+
+ option_usage_fp = stdout;
+
+ /*
+ * First, print our usage
+ */
+ switch (fork()) {
+ case -1:
+ optionUsage(opts, EXIT_FAILURE);
+ /* NOTREACHED */
+
+ case 0:
+ pagerState = PAGER_STATE_CHILD;
+ optionUsage(opts, EXIT_SUCCESS);
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE);
+
+ default:
+ {
+ int sts;
+ wait(&sts);
+ }
+ }
+
+ /*
+ * Generate the pzProgName, since optionProcess() normally
+ * gets it from the command line
+ */
+ {
+ char * pz;
+ char ** pp = (char **)(void *)&(optionParseShellOptions->pzProgName);
+ AGDUPSTR(pz, optionParseShellOptions->pzPROGNAME, "prog name");
+ *pp = pz;
+ while (*pz != NUL) {
+ *pz = (char)tolower(*pz);
+ pz++;
+ }
+ }
+
+ /*
+ * Separate the makeshell usage from the client usage
+ */
+ fprintf(option_usage_fp, zGenshell, optionParseShellOptions->pzProgName);
+ fflush(option_usage_fp);
+
+ /*
+ * Now, print the client usage.
+ */
+ switch (fork()) {
+ case 0:
+ pagerState = PAGER_STATE_CHILD;
+ /*FALLTHROUGH*/
+ case -1:
+ optionUsage(optionParseShellOptions, EXIT_FAILURE);
+
+ default:
+ {
+ int sts;
+ wait(&sts);
+ }
+ }
+
+ fflush(stdout);
+ if (ferror(stdout))
+ fserr_exit(opts->pzProgName, zwriting, zstdout_name);
+
+ option_exits(EXIT_SUCCESS);
+#endif
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/makeshell.c */
diff --git a/sntp/libopts/nested.c b/sntp/libopts/nested.c
new file mode 100644
index 0000000..0ec8f08
--- /dev/null
+++ b/sntp/libopts/nested.c
@@ -0,0 +1,936 @@
+
+/**
+ * \file nested.c
+ *
+ * Handle options with arguments that contain nested values.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * Automated Options Nested Values module.
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+typedef struct {
+ int xml_ch;
+ int xml_len;
+ char xml_txt[8];
+} xml_xlate_t;
+
+static xml_xlate_t const xml_xlate[] = {
+ { '&', 4, "amp;" },
+ { '<', 3, "lt;" },
+ { '>', 3, "gt;" },
+ { '"', 5, "quot;" },
+ { '\'',5, "apos;" }
+};
+
+#ifndef ENOMSG
+#define ENOMSG ENOENT
+#endif
+
+/* = = = START-STATIC-FORWARD = = = */
+static void
+remove_continuation(char * src);
+
+static char const*
+scan_q_str(char const* pzTxt);
+
+static tOptionValue *
+add_string(void ** pp, char const * name, size_t nm_len,
+ char const * val, size_t d_len);
+
+static tOptionValue *
+add_bool(void ** pp, char const * name, size_t nm_len,
+ char const * val, size_t d_len);
+
+static tOptionValue*
+add_number(void ** pp, char const * name, size_t nm_len,
+ char const * val, size_t d_len);
+
+static tOptionValue*
+add_nested(void ** pp, char const * name, size_t nm_len,
+ char * val, size_t d_len);
+
+static char const *
+scan_name(char const * name, tOptionValue * res);
+
+static char const *
+unnamed_xml(char const * txt);
+
+static char const *
+scan_xml_name(char const * name, size_t * nm_len, tOptionValue * val);
+
+static char const *
+find_end_xml(char const * src, size_t nm_len, char const * val, size_t * len);
+
+static char const *
+scan_xml(char const * xml_name, tOptionValue * res_val);
+
+static void
+sort_list(tArgList * arg_list);
+/* = = = END-STATIC-FORWARD = = = */
+
+/**
+ * Backslashes are used for line continuations. We keep the newline
+ * characters, but trim out the backslash:
+ */
+static void
+remove_continuation(char * src)
+{
+ char* pzD;
+
+ do {
+ while (*src == NL) src++;
+ pzD = strchr(src, NL);
+ if (pzD == NULL)
+ return;
+
+ /*
+ * pzD has skipped at least one non-newline character and now
+ * points to a newline character. It now becomes the source and
+ * pzD goes to the previous character.
+ */
+ src = pzD--;
+ if (*pzD != '\\')
+ pzD++;
+ } while (pzD == src);
+
+ /*
+ * Start shifting text.
+ */
+ for (;;) {
+ char ch = ((*pzD++) = *(src++));
+ switch (ch) {
+ case NUL: return;
+ case '\\':
+ if (*src == NL)
+ --pzD; /* rewrite on next iteration */
+ }
+ }
+}
+
+/**
+ * Find the end of a quoted string, skipping escaped quote characters.
+ */
+static char const*
+scan_q_str(char const* pzTxt)
+{
+ char q = *(pzTxt++); /* remember the type of quote */
+
+ for (;;) {
+ char ch = *(pzTxt++);
+ if (ch == NUL)
+ return pzTxt-1;
+
+ if (ch == q)
+ return pzTxt;
+
+ if (ch == '\\') {
+ ch = *(pzTxt++);
+ /*
+ * IF the next character is NUL, drop the backslash, too.
+ */
+ if (ch == NUL)
+ return pzTxt - 2;
+
+ /*
+ * IF the quote character or the escape character were escaped,
+ * then skip both, as long as the string does not end.
+ */
+ if ((ch == q) || (ch == '\\')) {
+ if (*(pzTxt++) == NUL)
+ return pzTxt-1;
+ }
+ }
+ }
+}
+
+
+/**
+ * Associate a name with either a string or no value.
+ *
+ * @param[in,out] pp argument list to add to
+ * @param[in] name the name of the "suboption"
+ * @param[in] nm_len the length of the name
+ * @param[in] val the string value for the suboption
+ * @param[in] d_len the length of the value
+ *
+ * @returns the new value structure
+ */
+static tOptionValue *
+add_string(void ** pp, char const * name, size_t nm_len,
+ char const * val, size_t d_len)
+{
+ tOptionValue* pNV;
+ size_t sz = nm_len + d_len + sizeof(*pNV);
+
+ pNV = AGALOC(sz, "option name/str value pair");
+
+ if (val == NULL) {
+ pNV->valType = OPARG_TYPE_NONE;
+ pNV->pzName = pNV->v.strVal;
+
+ } else {
+ pNV->valType = OPARG_TYPE_STRING;
+ if (d_len > 0) {
+ char const * src = val;
+ char * pzDst = pNV->v.strVal;
+ int ct = (int)d_len;
+ do {
+ int ch = *(src++) & 0xFF;
+ if (ch == NUL) goto data_copy_done;
+ if (ch == '&')
+ ch = get_special_char(&src, &ct);
+ *(pzDst++) = (char)ch;
+ } while (--ct > 0);
+ data_copy_done:
+ *pzDst = NUL;
+
+ } else {
+ pNV->v.strVal[0] = NUL;
+ }
+
+ pNV->pzName = pNV->v.strVal + d_len + 1;
+ }
+
+ memcpy(pNV->pzName, name, nm_len);
+ pNV->pzName[ nm_len ] = NUL;
+ addArgListEntry(pp, pNV);
+ return pNV;
+}
+
+/**
+ * Associate a name with a boolean value
+ *
+ * @param[in,out] pp argument list to add to
+ * @param[in] name the name of the "suboption"
+ * @param[in] nm_len the length of the name
+ * @param[in] val the boolean value for the suboption
+ * @param[in] d_len the length of the value
+ *
+ * @returns the new value structure
+ */
+static tOptionValue *
+add_bool(void ** pp, char const * name, size_t nm_len,
+ char const * val, size_t d_len)
+{
+ size_t sz = nm_len + sizeof(tOptionValue) + 1;
+ tOptionValue * new_val = AGALOC(sz, "bool val");
+
+ /*
+ * Scan over whitespace is constrained by "d_len"
+ */
+ while (IS_WHITESPACE_CHAR(*val) && (d_len > 0)) {
+ d_len--; val++;
+ }
+
+ if (d_len == 0)
+ new_val->v.boolVal = 0;
+
+ else if (IS_DEC_DIGIT_CHAR(*val))
+ new_val->v.boolVal = (unsigned)atoi(val);
+
+ else new_val->v.boolVal = ! IS_FALSE_TYPE_CHAR(*val);
+
+ new_val->valType = OPARG_TYPE_BOOLEAN;
+ new_val->pzName = (char*)(new_val + 1);
+ memcpy(new_val->pzName, name, nm_len);
+ new_val->pzName[ nm_len ] = NUL;
+ addArgListEntry(pp, new_val);
+ return new_val;
+}
+
+/**
+ * Associate a name with strtol() value, defaulting to zero.
+ *
+ * @param[in,out] pp argument list to add to
+ * @param[in] name the name of the "suboption"
+ * @param[in] nm_len the length of the name
+ * @param[in] val the numeric value for the suboption
+ * @param[in] d_len the length of the value
+ *
+ * @returns the new value structure
+ */
+static tOptionValue*
+add_number(void ** pp, char const * name, size_t nm_len,
+ char const * val, size_t d_len)
+{
+ size_t sz = nm_len + sizeof(tOptionValue) + 1;
+ tOptionValue * new_val = AGALOC(sz, "int val");
+
+ /*
+ * Scan over whitespace is constrained by "d_len"
+ */
+ while (IS_WHITESPACE_CHAR(*val) && (d_len > 0)) {
+ d_len--; val++;
+ }
+ if (d_len == 0)
+ new_val->v.longVal = 0;
+ else
+ new_val->v.longVal = strtol(val, 0, 0);
+
+ new_val->valType = OPARG_TYPE_NUMERIC;
+ new_val->pzName = (char*)(new_val + 1);
+ memcpy(new_val->pzName, name, nm_len);
+ new_val->pzName[ nm_len ] = NUL;
+ addArgListEntry(pp, new_val);
+ return new_val;
+}
+
+/**
+ * Associate a name with a nested/hierarchical value.
+ *
+ * @param[in,out] pp argument list to add to
+ * @param[in] name the name of the "suboption"
+ * @param[in] nm_len the length of the name
+ * @param[in] val the nested values for the suboption
+ * @param[in] d_len the length of the value
+ *
+ * @returns the new value structure
+ */
+static tOptionValue*
+add_nested(void ** pp, char const * name, size_t nm_len,
+ char * val, size_t d_len)
+{
+ tOptionValue* new_val;
+
+ if (d_len == 0) {
+ size_t sz = nm_len + sizeof(*new_val) + 1;
+ new_val = AGALOC(sz, "empty nest");
+ new_val->v.nestVal = NULL;
+ new_val->valType = OPARG_TYPE_HIERARCHY;
+ new_val->pzName = (char*)(new_val + 1);
+ memcpy(new_val->pzName, name, nm_len);
+ new_val->pzName[ nm_len ] = NUL;
+
+ } else {
+ new_val = optionLoadNested(val, name, nm_len);
+ }
+
+ if (new_val != NULL)
+ addArgListEntry(pp, new_val);
+
+ return new_val;
+}
+
+/**
+ * We have an entry that starts with a name. Find the end of it, cook it
+ * (if called for) and create the name/value association.
+ */
+static char const *
+scan_name(char const * name, tOptionValue * res)
+{
+ tOptionValue* new_val;
+ char const * pzScan = name+1; /* we know first char is a name char */
+ char const * pzVal;
+ size_t nm_len = 1;
+ size_t d_len = 0;
+
+ /*
+ * Scan over characters that name a value. These names may not end
+ * with a colon, but they may contain colons.
+ */
+ pzScan = SPN_VALUE_NAME_CHARS(name + 1);
+ if (pzScan[-1] == ':')
+ pzScan--;
+ nm_len = (size_t)(pzScan - name);
+
+ pzScan = SPN_HORIZ_WHITE_CHARS(pzScan);
+
+ re_switch:
+
+ switch (*pzScan) {
+ case '=':
+ case ':':
+ pzScan = SPN_HORIZ_WHITE_CHARS(pzScan + 1);
+ if ((*pzScan == '=') || (*pzScan == ':'))
+ goto default_char;
+ goto re_switch;
+
+ case NL:
+ case ',':
+ pzScan++;
+ /* FALLTHROUGH */
+
+ case NUL:
+ add_string(&(res->v.nestVal), name, nm_len, NULL, (size_t)0);
+ break;
+
+ case '"':
+ case '\'':
+ pzVal = pzScan;
+ pzScan = scan_q_str(pzScan);
+ d_len = (size_t)(pzScan - pzVal);
+ new_val = add_string(&(res->v.nestVal), name, nm_len, pzVal,
+ d_len);
+ if ((new_val != NULL) && (option_load_mode == OPTION_LOAD_COOKED))
+ ao_string_cook(new_val->v.strVal, NULL);
+ break;
+
+ default:
+ default_char:
+ /*
+ * We have found some strange text value. It ends with a newline
+ * or a comma.
+ */
+ pzVal = pzScan;
+ for (;;) {
+ char ch = *(pzScan++);
+ switch (ch) {
+ case NUL:
+ pzScan--;
+ d_len = (size_t)(pzScan - pzVal);
+ goto string_done;
+ /* FALLTHROUGH */
+
+ case NL:
+ if ( (pzScan > pzVal + 2)
+ && (pzScan[-2] == '\\')
+ && (pzScan[ 0] != NUL))
+ continue;
+ /* FALLTHROUGH */
+
+ case ',':
+ d_len = (size_t)(pzScan - pzVal) - 1;
+ string_done:
+ new_val = add_string(&(res->v.nestVal), name, nm_len,
+ pzVal, d_len);
+ if (new_val != NULL)
+ remove_continuation(new_val->v.strVal);
+ goto leave_scan_name;
+ }
+ }
+ break;
+ } leave_scan_name:;
+
+ return pzScan;
+}
+
+/**
+ * Some xml element that does not start with a name.
+ * The next character must be either '!' (introducing a comment),
+ * or '?' (introducing an XML meta-marker of some sort).
+ * We ignore these and indicate an error (NULL result) otherwise.
+ *
+ * @param[in] txt the text within an xml bracket
+ * @returns the address of the character after the closing marker, or NULL.
+ */
+static char const *
+unnamed_xml(char const * txt)
+{
+ switch (*txt) {
+ default:
+ txt = NULL;
+ break;
+
+ case '!':
+ txt = strstr(txt, "-->");
+ if (txt != NULL)
+ txt += 3;
+ break;
+
+ case '?':
+ txt = strchr(txt, '>');
+ if (txt != NULL)
+ txt++;
+ break;
+ }
+ return txt;
+}
+
+/**
+ * Scan off the xml element name, and the rest of the header, too.
+ * Set the value type to NONE if it ends with "/>".
+ *
+ * @param[in] name the first name character (alphabetic)
+ * @param[out] nm_len the length of the name
+ * @param[out] val set valType field to STRING or NONE.
+ *
+ * @returns the scan resumption point, or NULL on error
+ */
+static char const *
+scan_xml_name(char const * name, size_t * nm_len, tOptionValue * val)
+{
+ char const * scan = SPN_VALUE_NAME_CHARS(name + 1);
+ *nm_len = (size_t)(scan - name);
+ if (*nm_len > 64)
+ return NULL;
+ val->valType = OPARG_TYPE_STRING;
+
+ if (IS_WHITESPACE_CHAR(*scan)) {
+ /*
+ * There are attributes following the name. Parse 'em.
+ */
+ scan = SPN_WHITESPACE_CHARS(scan);
+ scan = parse_attrs(NULL, scan, &option_load_mode, val);
+ if (scan == NULL)
+ return NULL; /* oops */
+ }
+
+ if (! IS_END_XML_TOKEN_CHAR(*scan))
+ return NULL; /* oops */
+
+ if (*scan == '/') {
+ /*
+ * Single element XML entries get inserted as an empty string.
+ */
+ if (*++scan != '>')
+ return NULL;
+ val->valType = OPARG_TYPE_NONE;
+ }
+ return scan+1;
+}
+
+/**
+ * We've found a closing '>' without a preceding '/', thus we must search
+ * the text for '<name/>' where "name" is the name of the XML element.
+ *
+ * @param[in] name the start of the name in the element header
+ * @param[in] nm_len the length of that name
+ * @param[out] len the length of the value (string between header and
+ * the trailer/tail.
+ * @returns the character after the trailer, or NULL if not found.
+ */
+static char const *
+find_end_xml(char const * src, size_t nm_len, char const * val, size_t * len)
+{
+ char z[72] = "</";
+ char * dst = z + 2;
+
+ do {
+ *(dst++) = *(src++);
+ } while (--nm_len > 0); /* nm_len is known to be 64 or less */
+ *(dst++) = '>';
+ *dst = NUL;
+
+ {
+ char const * res = strstr(val, z);
+
+ if (res != NULL) {
+ char const * end = (option_load_mode != OPTION_LOAD_KEEP)
+ ? SPN_WHITESPACE_BACK(val, res)
+ : res;
+ *len = (size_t)(end - val); /* includes trailing white space */
+ res = SPN_WHITESPACE_CHARS(res + (dst - z));
+ }
+ return res;
+ }
+}
+
+/**
+ * We've found a '<' character. We ignore this if it is a comment or a
+ * directive. If it is something else, then whatever it is we are looking
+ * at is bogus. Returning NULL stops processing.
+ *
+ * @param[in] xml_name the name of an xml bracket (usually)
+ * @param[in,out] res_val the option data derived from the XML element
+ *
+ * @returns the place to resume scanning input
+ */
+static char const *
+scan_xml(char const * xml_name, tOptionValue * res_val)
+{
+ size_t nm_len, v_len;
+ char const * scan;
+ char const * val_str;
+ tOptionValue valu;
+ tOptionLoadMode save_mode = option_load_mode;
+
+ if (! IS_VAR_FIRST_CHAR(*++xml_name))
+ return unnamed_xml(xml_name);
+
+ /*
+ * "scan_xml_name()" may change "option_load_mode".
+ */
+ val_str = scan_xml_name(xml_name, &nm_len, &valu);
+ if (val_str == NULL)
+ goto bail_scan_xml;
+
+ if (valu.valType == OPARG_TYPE_NONE)
+ scan = val_str;
+ else {
+ if (option_load_mode != OPTION_LOAD_KEEP)
+ val_str = SPN_WHITESPACE_CHARS(val_str);
+ scan = find_end_xml(xml_name, nm_len, val_str, &v_len);
+ if (scan == NULL)
+ goto bail_scan_xml;
+ }
+
+ /*
+ * "scan" now points to where the scan is to resume after returning.
+ * It either points after "/>" at the end of the XML element header,
+ * or it points after the "</name>" tail based on the name in the header.
+ */
+
+ switch (valu.valType) {
+ case OPARG_TYPE_NONE:
+ add_string(&(res_val->v.nestVal), xml_name, nm_len, NULL, 0);
+ break;
+
+ case OPARG_TYPE_STRING:
+ {
+ tOptionValue * new_val = add_string(
+ &(res_val->v.nestVal), xml_name, nm_len, val_str, v_len);
+
+ if (option_load_mode != OPTION_LOAD_KEEP)
+ munge_str(new_val->v.strVal, option_load_mode);
+
+ break;
+ }
+
+ case OPARG_TYPE_BOOLEAN:
+ add_bool(&(res_val->v.nestVal), xml_name, nm_len, val_str, v_len);
+ break;
+
+ case OPARG_TYPE_NUMERIC:
+ add_number(&(res_val->v.nestVal), xml_name, nm_len, val_str, v_len);
+ break;
+
+ case OPARG_TYPE_HIERARCHY:
+ {
+ char * pz = AGALOC(v_len+1, "h scan");
+ memcpy(pz, val_str, v_len);
+ pz[v_len] = NUL;
+ add_nested(&(res_val->v.nestVal), xml_name, nm_len, pz, v_len);
+ AGFREE(pz);
+ break;
+ }
+
+ case OPARG_TYPE_ENUMERATION:
+ case OPARG_TYPE_MEMBERSHIP:
+ default:
+ break;
+ }
+
+ option_load_mode = save_mode;
+ return scan;
+
+bail_scan_xml:
+ option_load_mode = save_mode;
+ return NULL;
+}
+
+
+/**
+ * Deallocate a list of option arguments. This must have been gotten from
+ * a hierarchical option argument, not a stacked list of strings. It is
+ * an internal call, so it is not validated. The caller is responsible for
+ * knowing what they are doing.
+ */
+LOCAL void
+unload_arg_list(tArgList * arg_list)
+{
+ int ct = arg_list->useCt;
+ char const ** pnew_val = arg_list->apzArgs;
+
+ while (ct-- > 0) {
+ tOptionValue* new_val = (tOptionValue*)(void*)*(pnew_val++);
+ if (new_val->valType == OPARG_TYPE_HIERARCHY)
+ unload_arg_list(new_val->v.nestVal);
+ AGFREE(new_val);
+ }
+
+ AGFREE((void*)arg_list);
+}
+
+/*=export_func optionUnloadNested
+ *
+ * what: Deallocate the memory for a nested value
+ * arg: + tOptionValue const * + pOptVal + the hierarchical value +
+ *
+ * doc:
+ * A nested value needs to be deallocated. The pointer passed in should
+ * have been gotten from a call to @code{configFileLoad()} (See
+ * @pxref{libopts-configFileLoad}).
+=*/
+void
+optionUnloadNested(tOptionValue const * opt_val)
+{
+ if (opt_val == NULL) return;
+ if (opt_val->valType != OPARG_TYPE_HIERARCHY) {
+ errno = EINVAL;
+ return;
+ }
+
+ unload_arg_list(opt_val->v.nestVal);
+
+ AGFREE((void*)opt_val);
+}
+
+/**
+ * This is a _stable_ sort. The entries are sorted alphabetically,
+ * but within entries of the same name the ordering is unchanged.
+ * Typically, we also hope the input is sorted.
+ */
+static void
+sort_list(tArgList * arg_list)
+{
+ int ix;
+ int lm = arg_list->useCt;
+
+ /*
+ * This loop iterates "useCt" - 1 times.
+ */
+ for (ix = 0; ++ix < lm;) {
+ int iy = ix-1;
+ tOptionValue * new_v = C(tOptionValue *, arg_list->apzArgs[ix]);
+ tOptionValue * old_v = C(tOptionValue *, arg_list->apzArgs[iy]);
+
+ /*
+ * For as long as the new entry precedes the "old" entry,
+ * move the old pointer. Stop before trying to extract the
+ * "-1" entry.
+ */
+ while (strcmp(old_v->pzName, new_v->pzName) > 0) {
+ arg_list->apzArgs[iy+1] = (void*)old_v;
+ old_v = (tOptionValue*)(void*)(arg_list->apzArgs[--iy]);
+ if (iy < 0)
+ break;
+ }
+
+ /*
+ * Always store the pointer. Sometimes it is redundant,
+ * but the redundancy is cheaper than a test and branch sequence.
+ */
+ arg_list->apzArgs[iy+1] = (void*)new_v;
+ }
+}
+
+/*=
+ * private:
+ *
+ * what: parse a hierarchical option argument
+ * arg: + char const * + pzTxt + the text to scan +
+ * arg: + char const * + pzName + the name for the text +
+ * arg: + size_t + nm_len + the length of "name" +
+ *
+ * ret_type: tOptionValue*
+ * ret_desc: An allocated, compound value structure
+ *
+ * doc:
+ * A block of text represents a series of values. It may be an
+ * entire configuration file, or it may be an argument to an
+ * option that takes a hierarchical value.
+ *
+ * If NULL is returned, errno will be set:
+ * @itemize @bullet
+ * @item
+ * @code{EINVAL} the input text was NULL.
+ * @item
+ * @code{ENOMEM} the storage structures could not be allocated
+ * @item
+ * @code{ENOMSG} no configuration values were found
+ * @end itemize
+=*/
+LOCAL tOptionValue *
+optionLoadNested(char const * text, char const * name, size_t nm_len)
+{
+ tOptionValue* res_val;
+
+ /*
+ * Make sure we have some data and we have space to put what we find.
+ */
+ if (text == NULL) {
+ errno = EINVAL;
+ return NULL;
+ }
+ text = SPN_WHITESPACE_CHARS(text);
+ if (*text == NUL) {
+ errno = ENOMSG;
+ return NULL;
+ }
+ res_val = AGALOC(sizeof(*res_val) + nm_len + 1, "nest args");
+ res_val->valType = OPARG_TYPE_HIERARCHY;
+ res_val->pzName = (char*)(res_val + 1);
+ memcpy(res_val->pzName, name, nm_len);
+ res_val->pzName[nm_len] = NUL;
+
+ {
+ tArgList * arg_list = AGALOC(sizeof(*arg_list), "nest arg l");
+
+ res_val->v.nestVal = arg_list;
+ arg_list->useCt = 0;
+ arg_list->allocCt = MIN_ARG_ALLOC_CT;
+ }
+
+ /*
+ * Scan until we hit a NUL.
+ */
+ do {
+ text = SPN_WHITESPACE_CHARS(text);
+ if (IS_VAR_FIRST_CHAR(*text))
+ text = scan_name(text, res_val);
+
+ else switch (*text) {
+ case NUL: goto scan_done;
+ case '<': text = scan_xml(text, res_val);
+ if (text == NULL) goto woops;
+ if (*text == ',') text++; break;
+ case '#': text = strchr(text, NL); break;
+ default: goto woops;
+ }
+ } while (text != NULL); scan_done:;
+
+ {
+ tArgList * al = res_val->v.nestVal;
+ if (al->useCt == 0) {
+ errno = ENOMSG;
+ goto woops;
+ }
+ if (al->useCt > 1)
+ sort_list(al);
+ }
+
+ return res_val;
+
+ woops:
+ AGFREE(res_val->v.nestVal);
+ AGFREE(res_val);
+ return NULL;
+}
+
+/*=export_func optionNestedVal
+ * private:
+ *
+ * what: parse a hierarchical option argument
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * Nested value was found on the command line
+=*/
+void
+optionNestedVal(tOptions * opts, tOptDesc * od)
+{
+ if (opts < OPTPROC_EMIT_LIMIT)
+ return;
+
+ if (od->fOptState & OPTST_RESET) {
+ tArgList * arg_list = od->optCookie;
+ int ct;
+ char const ** av;
+
+ if (arg_list == NULL)
+ return;
+ ct = arg_list->useCt;
+ av = arg_list->apzArgs;
+
+ while (--ct >= 0) {
+ void * p = (void *)*(av++);
+ optionUnloadNested((tOptionValue const *)p);
+ }
+
+ AGFREE(od->optCookie);
+
+ } else {
+ tOptionValue * opt_val = optionLoadNested(
+ od->optArg.argString, od->pz_Name, strlen(od->pz_Name));
+
+ if (opt_val != NULL)
+ addArgListEntry(&(od->optCookie), (void*)opt_val);
+ }
+}
+
+/**
+ * get_special_char
+ */
+LOCAL int
+get_special_char(char const ** ppz, int * ct)
+{
+ char const * pz = *ppz;
+
+ if (*ct < 3)
+ return '&';
+
+ if (*pz == '#') {
+ int base = 10;
+ int retch;
+
+ pz++;
+ if (*pz == 'x') {
+ base = 16;
+ pz++;
+ }
+ retch = (int)strtoul(pz, (char **)&pz, base);
+ if (*pz != ';')
+ return '&';
+ base = (int)(++pz - *ppz);
+ if (base > *ct)
+ return '&';
+
+ *ct -= base;
+ *ppz = pz;
+ return retch;
+ }
+
+ {
+ int ctr = sizeof(xml_xlate) / sizeof(xml_xlate[0]);
+ xml_xlate_t const * xlatp = xml_xlate;
+
+ for (;;) {
+ if ( (*ct >= xlatp->xml_len)
+ && (strncmp(pz, xlatp->xml_txt, (size_t)xlatp->xml_len) == 0)) {
+ *ppz += xlatp->xml_len;
+ *ct -= xlatp->xml_len;
+ return xlatp->xml_ch;
+ }
+
+ if (--ctr <= 0)
+ break;
+ xlatp++;
+ }
+ }
+ return '&';
+}
+
+/**
+ * emit_special_char
+ */
+LOCAL void
+emit_special_char(FILE * fp, int ch)
+{
+ int ctr = sizeof(xml_xlate) / sizeof(xml_xlate[0]);
+ xml_xlate_t const * xlatp = xml_xlate;
+
+ putc('&', fp);
+ for (;;) {
+ if (ch == xlatp->xml_ch) {
+ fputs(xlatp->xml_txt, fp);
+ return;
+ }
+ if (--ctr <= 0)
+ break;
+ xlatp++;
+ }
+ fprintf(fp, XML_HEX_BYTE_FMT, (ch & 0xFF));
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/nested.c */
diff --git a/sntp/libopts/numeric.c b/sntp/libopts/numeric.c
new file mode 100644
index 0000000..9baba65
--- /dev/null
+++ b/sntp/libopts/numeric.c
@@ -0,0 +1,179 @@
+
+/**
+ * \file numeric.c
+ *
+ * Handle options with numeric (integer) arguments.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/*=export_func optionShowRange
+ * private:
+ *
+ * what: Show info about range constraints
+ * arg: + tOptions* + pOpts + program options descriptor +
+ * arg: + tOptDesc* + pOptDesc + the descriptor for this arg +
+ * arg: + void * + rng_table + the value range tables +
+ * arg: + int + rng_count + the number of entries +
+ *
+ * doc:
+ * Show information about a numeric option with range constraints.
+=*/
+void
+optionShowRange(tOptions * pOpts, tOptDesc * pOD, void * rng_table, int rng_ct)
+{
+ const struct {long const rmin, rmax;} * rng = rng_table;
+
+ char const * pz_indent = zTabHyp + tab_skip_ct;
+
+ /*
+ * The range is shown only for full usage requests and an error
+ * in this particular option.
+ */
+ if (pOpts != OPTPROC_EMIT_USAGE) {
+ if (pOpts <= OPTPROC_EMIT_LIMIT)
+ return;
+ pz_indent = ONE_TAB_STR;
+
+ fprintf(option_usage_fp, zRangeErr, pOpts->pzProgName,
+ pOD->pz_Name, pOD->optArg.argInt);
+ pz_indent = "";
+ }
+
+ if (pOD->fOptState & OPTST_SCALED_NUM)
+ fprintf(option_usage_fp, zRangeScaled, pz_indent);
+
+ fprintf(option_usage_fp, (rng_ct > 1) ? zRangeLie : zRangeOnly, pz_indent);
+ pz_indent = (pOpts != OPTPROC_EMIT_USAGE)
+ ? ONE_TAB_STR
+ : (zTabSpace + tab_skip_ct);
+
+ for (;;) {
+ if (rng->rmax == LONG_MIN)
+ fprintf(option_usage_fp, zRangeExact, pz_indent, rng->rmin);
+ else if (rng->rmin == LONG_MIN)
+ fprintf(option_usage_fp, zRangeUpto, pz_indent, rng->rmax);
+ else if (rng->rmax == LONG_MAX)
+ fprintf(option_usage_fp, zRangeAbove, pz_indent, rng->rmin);
+ else
+ fprintf(option_usage_fp, zRange, pz_indent, rng->rmin,
+ rng->rmax);
+
+ if (--rng_ct <= 0) {
+ fputc(NL, option_usage_fp);
+ break;
+ }
+ fputs(zRangeOr, option_usage_fp);
+ rng++;
+ }
+
+ if (pOpts > OPTPROC_EMIT_LIMIT)
+ pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+}
+
+/*=export_func optionNumericVal
+ * private:
+ *
+ * what: process an option with a numeric value.
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * Decipher a numeric value.
+=*/
+void
+optionNumericVal(tOptions * opts, tOptDesc * od)
+{
+ char* pz;
+ long val;
+
+ /*
+ * Guard against all the different ways this procedure might get invoked
+ * when there is no string argument provided.
+ */
+ if (INQUERY_CALL(opts, od) || (od->optArg.argString == NULL))
+ return;
+
+ /*
+ * Numeric options may have a range associated with it.
+ * If it does, the usage procedure requests that it be
+ * emitted by passing a NULL od pointer. Also bail out
+ * if there is no option argument or if we are being reset.
+ */
+ if ( (od == NULL)
+ || (od->optArg.argString == NULL)
+ || ((od->fOptState & OPTST_RESET) != 0))
+ return;
+
+ errno = 0;
+ val = strtol(od->optArg.argString, &pz, 0);
+ if ((pz == od->optArg.argString) || (errno != 0))
+ goto bad_number;
+
+ if ((od->fOptState & OPTST_SCALED_NUM) != 0)
+ switch (*(pz++)) {
+ case NUL: pz--; break;
+ case 't': val *= 1000;
+ case 'g': val *= 1000;
+ case 'm': val *= 1000;
+ case 'k': val *= 1000; break;
+
+ case 'T': val *= 1024;
+ case 'G': val *= 1024;
+ case 'M': val *= 1024;
+ case 'K': val *= 1024; break;
+
+ default: goto bad_number;
+ }
+
+ if (*pz != NUL)
+ goto bad_number;
+
+ if (od->fOptState & OPTST_ALLOC_ARG) {
+ AGFREE(od->optArg.argString);
+ od->fOptState &= ~OPTST_ALLOC_ARG;
+ }
+
+ od->optArg.argInt = val;
+ return;
+
+ bad_number:
+
+ fprintf( stderr, zNotNumber, opts->pzProgName, od->optArg.argString );
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0)
+ (*(opts->pUsageProc))(opts, EXIT_FAILURE);
+
+ errno = EINVAL;
+ od->optArg.argInt = ~0;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/numeric.c */
diff --git a/sntp/libopts/option-value-type.c b/sntp/libopts/option-value-type.c
new file mode 100644
index 0000000..08c003a
--- /dev/null
+++ b/sntp/libopts/option-value-type.c
@@ -0,0 +1,156 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (stdin.c)
+ *
+ * It has been AutoGen-ed August 8, 2014 at 04:09:05 PM by AutoGen 5.18.4pre11
+ * From the definitions stdin
+ * and the template file str2enum
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name ``Bruce Korb'' nor the name of any other
+ * contributor may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * str2enum IS PROVIDED BY Bruce Korb ``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 Bruce Korb OR ANY OTHER CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "option-value-type.h"
+/* ANSI-C code produced by gperf version 3.0.3 */
+/* Command-line: gperf option-value-type.gp */
+/* Computed positions: -k'1' */
+
+
+
+# if 0 /* gperf build options: */
+// %struct-type
+// %language=ANSI-C
+// %includes
+// %global-table
+// %omit-struct-type
+// %readonly-tables
+// %compare-strncmp
+//
+// %define slot-name vtp_name
+// %define hash-function-name option_value_type_hash
+// %define lookup-function-name find_option_value_type_name
+// %define word-array-name option_value_type_table
+// %define initializer-suffix ,VTP_COUNT_CMD
+//
+# endif
+
+#include "option-value-type.h"
+typedef struct {
+ char const * vtp_name;
+ option_value_type_enum_t vtp_id;
+} option_value_type_map_t;
+#include <string.h>
+
+/* maximum key range = 15, duplicates = 0 */
+
+static unsigned int
+option_value_type_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 0, 18,
+ 18, 18, 18, 18, 0, 10, 18, 5, 18, 18,
+ 5, 18, 18, 18, 18, 0, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18
+ };
+ return len + asso_values[(unsigned char)str[0]];
+}
+
+static const option_value_type_map_t option_value_type_table[] =
+ {
+ {"",VTP_COUNT_CMD}, {"",VTP_COUNT_CMD},
+ {"",VTP_COUNT_CMD},
+ {"set", VTP_CMD_SET},
+ {"bool", VTP_CMD_BOOL},
+ {"",VTP_COUNT_CMD},
+ {"string", VTP_CMD_STRING},
+ {"boolean", VTP_CMD_BOOLEAN},
+ {"",VTP_COUNT_CMD},
+ {"hierarchy", VTP_CMD_HIERARCHY},
+ {"",VTP_COUNT_CMD},
+ {"nested", VTP_CMD_NESTED},
+ {"keyword", VTP_CMD_KEYWORD},
+ {"",VTP_COUNT_CMD},
+ {"set-membership", VTP_CMD_SET_MEMBERSHIP},
+ {"",VTP_COUNT_CMD}, {"",VTP_COUNT_CMD},
+ {"integer", VTP_CMD_INTEGER}
+ };
+
+static inline const option_value_type_map_t *
+find_option_value_type_name (register const char *str, register unsigned int len)
+{
+ if (len <= 14 && len >= 3)
+ {
+ register int key = (int)option_value_type_hash (str, len);
+
+ if (key <= 17 && key >= 0)
+ {
+ register const char *s = option_value_type_table[key].vtp_name;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+ return &option_value_type_table[key];
+ }
+ }
+ return 0;
+}
+
+/**
+ * Convert a command (keyword) to a option_value_type_enum_t enumeration value.
+ *
+ * @param[in] str a string that should start with a known key word.
+ * @param[in] len the provided length of the keyword at \a str.
+ * @returns the enumeration value.
+ * If not found, that value is VTP_INVALID_CMD.
+ */
+option_value_type_enum_t
+find_option_value_type_cmd(char const * str, size_t len)
+{
+ option_value_type_map_t const * map;
+
+ map = find_option_value_type_name(str, (unsigned int)len);
+ return (map == NULL) ? VTP_INVALID_CMD : map->vtp_id;
+}
+
+/* end of option-value-type.c */
diff --git a/sntp/libopts/option-value-type.h b/sntp/libopts/option-value-type.h
new file mode 100644
index 0000000..23b2be9
--- /dev/null
+++ b/sntp/libopts/option-value-type.h
@@ -0,0 +1,60 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (stdin.h)
+ *
+ * It has been AutoGen-ed August 8, 2014 at 04:09:05 PM by AutoGen 5.18.4pre11
+ * From the definitions stdin
+ * and the template file str2enum
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name ``Bruce Korb'' nor the name of any other
+ * contributor may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * str2enum IS PROVIDED BY Bruce Korb ``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 Bruce Korb OR ANY OTHER 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.
+ *
+ * Command/Keyword Dispatcher
+ */
+#ifndef STR2ENUM_OPTION_VALUE_TYPE_H_GUARD
+#define STR2ENUM_OPTION_VALUE_TYPE_H_GUARD 1
+#include <sys/types.h>
+#ifndef MISSING_INTTYPES_H
+# include <inttypes.h>
+#endif
+
+typedef enum {
+ VTP_INVALID_CMD = 0,
+ VTP_CMD_STRING = 1,
+ VTP_CMD_INTEGER = 2,
+ VTP_CMD_BOOL = 3,
+ VTP_CMD_BOOLEAN = 4,
+ VTP_CMD_KEYWORD = 5,
+ VTP_CMD_SET = 6,
+ VTP_CMD_SET_MEMBERSHIP = 7,
+ VTP_CMD_NESTED = 8,
+ VTP_CMD_HIERARCHY = 9,
+ VTP_COUNT_CMD
+} option_value_type_enum_t;
+
+extern option_value_type_enum_t
+find_option_value_type_cmd(char const * str, size_t len);
+
+#endif /* STR2ENUM_OPTION_VALUE_TYPE_H_GUARD */
+/* end of option-value-type.h */
diff --git a/sntp/libopts/option-xat-attribute.c b/sntp/libopts/option-xat-attribute.c
new file mode 100644
index 0000000..cc5f4f1
--- /dev/null
+++ b/sntp/libopts/option-xat-attribute.c
@@ -0,0 +1,148 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (stdin.c)
+ *
+ * It has been AutoGen-ed August 8, 2014 at 04:09:04 PM by AutoGen 5.18.4pre11
+ * From the definitions stdin
+ * and the template file str2enum
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name ``Bruce Korb'' nor the name of any other
+ * contributor may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * str2enum IS PROVIDED BY Bruce Korb ``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 Bruce Korb OR ANY OTHER CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "option-xat-attribute.h"
+/* ANSI-C code produced by gperf version 3.0.3 */
+/* Command-line: gperf option-xat-attribute.gp */
+/* Computed positions: -k'1' */
+
+
+
+# if 0 /* gperf build options: */
+// %struct-type
+// %language=ANSI-C
+// %includes
+// %global-table
+// %omit-struct-type
+// %readonly-tables
+// %compare-strncmp
+//
+// %define slot-name xat_name
+// %define hash-function-name option_xat_attribute_hash
+// %define lookup-function-name find_option_xat_attribute_name
+// %define word-array-name option_xat_attribute_table
+// %define initializer-suffix ,XAT_COUNT_CMD
+//
+# endif
+
+#include "option-xat-attribute.h"
+typedef struct {
+ char const * xat_name;
+ option_xat_attribute_enum_t xat_id;
+} option_xat_attribute_map_t;
+#include <string.h>
+
+/* maximum key range = 6, duplicates = 0 */
+
+static unsigned int
+option_xat_attribute_hash (register const char *str, register unsigned int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10, 0,
+ 10,10,10,10,10,10,10, 5,10, 0,
+ 10,10,10,10,10,10, 0, 0,10, 0,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10
+ };
+ return len + asso_values[(unsigned char)str[0]];
+}
+
+static const option_xat_attribute_map_t option_xat_attribute_table[] =
+ {
+ {"",XAT_COUNT_CMD}, {"",XAT_COUNT_CMD},
+ {"",XAT_COUNT_CMD}, {"",XAT_COUNT_CMD},
+ {"type", XAT_CMD_TYPE},
+ {"words", XAT_CMD_WORDS},
+ {"cooked", XAT_CMD_COOKED},
+ {"members", XAT_CMD_MEMBERS},
+ {"uncooked", XAT_CMD_UNCOOKED},
+ {"keep", XAT_CMD_KEEP}
+ };
+
+static inline const option_xat_attribute_map_t *
+find_option_xat_attribute_name (register const char *str, register unsigned int len)
+{
+ if (len <= 8 && len >= 4)
+ {
+ register int key = (int)option_xat_attribute_hash (str, len);
+
+ if (key <= 9 && key >= 0)
+ {
+ register const char *s = option_xat_attribute_table[key].xat_name;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+ return &option_xat_attribute_table[key];
+ }
+ }
+ return 0;
+}
+
+/**
+ * Convert a command (keyword) to a option_xat_attribute_enum_t enumeration value.
+ *
+ * @param[in] str a string that should start with a known key word.
+ * @param[in] len the provided length of the keyword at \a str.
+ * @returns the enumeration value.
+ * If not found, that value is XAT_INVALID_CMD.
+ */
+option_xat_attribute_enum_t
+find_option_xat_attribute_cmd(char const * str, size_t len)
+{
+ option_xat_attribute_map_t const * map;
+
+ map = find_option_xat_attribute_name(str, (unsigned int)len);
+ return (map == NULL) ? XAT_INVALID_CMD : map->xat_id;
+}
+
+/* end of option-xat-attribute.c */
diff --git a/sntp/libopts/option-xat-attribute.h b/sntp/libopts/option-xat-attribute.h
new file mode 100644
index 0000000..d2c19c7
--- /dev/null
+++ b/sntp/libopts/option-xat-attribute.h
@@ -0,0 +1,57 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * DO NOT EDIT THIS FILE (stdin.h)
+ *
+ * It has been AutoGen-ed August 8, 2014 at 04:09:04 PM by AutoGen 5.18.4pre11
+ * From the definitions stdin
+ * and the template file str2enum
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name ``Bruce Korb'' nor the name of any other
+ * contributor may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * str2enum IS PROVIDED BY Bruce Korb ``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 Bruce Korb OR ANY OTHER 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.
+ *
+ * Command/Keyword Dispatcher
+ */
+#ifndef STR2ENUM_OPTION_XAT_ATTRIBUTE_H_GUARD
+#define STR2ENUM_OPTION_XAT_ATTRIBUTE_H_GUARD 1
+#include <sys/types.h>
+#ifndef MISSING_INTTYPES_H
+# include <inttypes.h>
+#endif
+
+typedef enum {
+ XAT_INVALID_CMD = 0,
+ XAT_CMD_TYPE = 1,
+ XAT_CMD_WORDS = 2,
+ XAT_CMD_MEMBERS = 3,
+ XAT_CMD_COOKED = 4,
+ XAT_CMD_UNCOOKED = 5,
+ XAT_CMD_KEEP = 6,
+ XAT_COUNT_CMD
+} option_xat_attribute_enum_t;
+
+extern option_xat_attribute_enum_t
+find_option_xat_attribute_cmd(char const * str, size_t len);
+
+#endif /* STR2ENUM_OPTION_XAT_ATTRIBUTE_H_GUARD */
+/* end of option-xat-attribute.h */
diff --git a/sntp/libopts/parse-duration.c b/sntp/libopts/parse-duration.c
new file mode 100644
index 0000000..ff3fe42
--- /dev/null
+++ b/sntp/libopts/parse-duration.c
@@ -0,0 +1,604 @@
+/* Parse a time duration and return a seconds count
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
+ Written by Bruce Korb <bkorb@gnu.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "parse-duration.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "intprops.h"
+
+#ifndef NUL
+#define NUL '\0'
+#endif
+
+#define cch_t char const
+
+typedef enum {
+ NOTHING_IS_DONE,
+ YEAR_IS_DONE,
+ MONTH_IS_DONE,
+ WEEK_IS_DONE,
+ DAY_IS_DONE,
+ HOUR_IS_DONE,
+ MINUTE_IS_DONE,
+ SECOND_IS_DONE
+} whats_done_t;
+
+#define SEC_PER_MIN 60
+#define SEC_PER_HR (SEC_PER_MIN * 60)
+#define SEC_PER_DAY (SEC_PER_HR * 24)
+#define SEC_PER_WEEK (SEC_PER_DAY * 7)
+#define SEC_PER_MONTH (SEC_PER_DAY * 30)
+#define SEC_PER_YEAR (SEC_PER_DAY * 365)
+
+#undef MAX_DURATION
+#define MAX_DURATION TYPE_MAXIMUM(time_t)
+
+/* Wrapper around strtoul that does not require a cast. */
+static unsigned long
+str_const_to_ul (cch_t * str, cch_t ** ppz, int base)
+{
+ return strtoul (str, (char **)ppz, base);
+}
+
+/* Wrapper around strtol that does not require a cast. */
+static long
+str_const_to_l (cch_t * str, cch_t ** ppz, int base)
+{
+ return strtol (str, (char **)ppz, base);
+}
+
+/* Returns BASE + VAL * SCALE, interpreting BASE = BAD_TIME
+ with errno set as an error situation, and returning BAD_TIME
+ with errno set in an error situation. */
+static time_t
+scale_n_add (time_t base, time_t val, int scale)
+{
+ if (base == BAD_TIME)
+ {
+ if (errno == 0)
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ if (val > MAX_DURATION / scale)
+ {
+ errno = ERANGE;
+ return BAD_TIME;
+ }
+
+ val *= scale;
+ if (base > MAX_DURATION - val)
+ {
+ errno = ERANGE;
+ return BAD_TIME;
+ }
+
+ return base + val;
+}
+
+/* After a number HH has been parsed, parse subsequent :MM or :MM:SS. */
+static time_t
+parse_hr_min_sec (time_t start, cch_t * pz)
+{
+ int lpct = 0;
+
+ errno = 0;
+
+ /* For as long as our scanner pointer points to a colon *AND*
+ we've not looped before, then keep looping. (two iterations max) */
+ while ((*pz == ':') && (lpct++ <= 1))
+ {
+ unsigned long v = str_const_to_ul (pz+1, &pz, 10);
+
+ if (errno != 0)
+ return BAD_TIME;
+
+ start = scale_n_add (v, start, 60);
+
+ if (errno != 0)
+ return BAD_TIME;
+ }
+
+ /* allow for trailing spaces */
+ while (isspace ((unsigned char)*pz))
+ pz++;
+ if (*pz != NUL)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ return start;
+}
+
+/* Parses a value and returns BASE + value * SCALE, interpreting
+ BASE = BAD_TIME with errno set as an error situation, and returning
+ BAD_TIME with errno set in an error situation. */
+static time_t
+parse_scaled_value (time_t base, cch_t ** ppz, cch_t * endp, int scale)
+{
+ cch_t * pz = *ppz;
+ time_t val;
+
+ if (base == BAD_TIME)
+ return base;
+
+ errno = 0;
+ val = str_const_to_ul (pz, &pz, 10);
+ if (errno != 0)
+ return BAD_TIME;
+ while (isspace ((unsigned char)*pz))
+ pz++;
+ if (pz != endp)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ *ppz = pz;
+ return scale_n_add (base, val, scale);
+}
+
+/* Parses the syntax YEAR-MONTH-DAY.
+ PS points into the string, after "YEAR", before "-MONTH-DAY". */
+static time_t
+parse_year_month_day (cch_t * pz, cch_t * ps)
+{
+ time_t res = 0;
+
+ res = parse_scaled_value (0, &pz, ps, SEC_PER_YEAR);
+
+ pz++; /* over the first '-' */
+ ps = strchr (pz, '-');
+ if (ps == NULL)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+ res = parse_scaled_value (res, &pz, ps, SEC_PER_MONTH);
+
+ pz++; /* over the second '-' */
+ ps = pz + strlen (pz);
+ return parse_scaled_value (res, &pz, ps, SEC_PER_DAY);
+}
+
+/* Parses the syntax YYYYMMDD. */
+static time_t
+parse_yearmonthday (cch_t * in_pz)
+{
+ time_t res = 0;
+ char buf[8];
+ cch_t * pz;
+
+ if (strlen (in_pz) != 8)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ memcpy (buf, in_pz, 4);
+ buf[4] = NUL;
+ pz = buf;
+ res = parse_scaled_value (0, &pz, buf + 4, SEC_PER_YEAR);
+
+ memcpy (buf, in_pz + 4, 2);
+ buf[2] = NUL;
+ pz = buf;
+ res = parse_scaled_value (res, &pz, buf + 2, SEC_PER_MONTH);
+
+ memcpy (buf, in_pz + 6, 2);
+ buf[2] = NUL;
+ pz = buf;
+ return parse_scaled_value (res, &pz, buf + 2, SEC_PER_DAY);
+}
+
+/* Parses the syntax yy Y mm M ww W dd D. */
+static time_t
+parse_YMWD (cch_t * pz)
+{
+ time_t res = 0;
+ cch_t * ps = strchr (pz, 'Y');
+ if (ps != NULL)
+ {
+ res = parse_scaled_value (0, &pz, ps, SEC_PER_YEAR);
+ pz++;
+ }
+
+ ps = strchr (pz, 'M');
+ if (ps != NULL)
+ {
+ res = parse_scaled_value (res, &pz, ps, SEC_PER_MONTH);
+ pz++;
+ }
+
+ ps = strchr (pz, 'W');
+ if (ps != NULL)
+ {
+ res = parse_scaled_value (res, &pz, ps, SEC_PER_WEEK);
+ pz++;
+ }
+
+ ps = strchr (pz, 'D');
+ if (ps != NULL)
+ {
+ res = parse_scaled_value (res, &pz, ps, SEC_PER_DAY);
+ pz++;
+ }
+
+ while (isspace ((unsigned char)*pz))
+ pz++;
+ if (*pz != NUL)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ return res;
+}
+
+/* Parses the syntax HH:MM:SS.
+ PS points into the string, after "HH", before ":MM:SS". */
+static time_t
+parse_hour_minute_second (cch_t * pz, cch_t * ps)
+{
+ time_t res = 0;
+
+ res = parse_scaled_value (0, &pz, ps, SEC_PER_HR);
+
+ pz++;
+ ps = strchr (pz, ':');
+ if (ps == NULL)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ res = parse_scaled_value (res, &pz, ps, SEC_PER_MIN);
+
+ pz++;
+ ps = pz + strlen (pz);
+ return parse_scaled_value (res, &pz, ps, 1);
+}
+
+/* Parses the syntax HHMMSS. */
+static time_t
+parse_hourminutesecond (cch_t * in_pz)
+{
+ time_t res = 0;
+ char buf[4];
+ cch_t * pz;
+
+ if (strlen (in_pz) != 6)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ memcpy (buf, in_pz, 2);
+ buf[2] = NUL;
+ pz = buf;
+ res = parse_scaled_value (0, &pz, buf + 2, SEC_PER_HR);
+
+ memcpy (buf, in_pz + 2, 2);
+ buf[2] = NUL;
+ pz = buf;
+ res = parse_scaled_value (res, &pz, buf + 2, SEC_PER_MIN);
+
+ memcpy (buf, in_pz + 4, 2);
+ buf[2] = NUL;
+ pz = buf;
+ return parse_scaled_value (res, &pz, buf + 2, 1);
+}
+
+/* Parses the syntax hh H mm M ss S. */
+static time_t
+parse_HMS (cch_t * pz)
+{
+ time_t res = 0;
+ cch_t * ps = strchr (pz, 'H');
+ if (ps != NULL)
+ {
+ res = parse_scaled_value (0, &pz, ps, SEC_PER_HR);
+ pz++;
+ }
+
+ ps = strchr (pz, 'M');
+ if (ps != NULL)
+ {
+ res = parse_scaled_value (res, &pz, ps, SEC_PER_MIN);
+ pz++;
+ }
+
+ ps = strchr (pz, 'S');
+ if (ps != NULL)
+ {
+ res = parse_scaled_value (res, &pz, ps, 1);
+ pz++;
+ }
+
+ while (isspace ((unsigned char)*pz))
+ pz++;
+ if (*pz != NUL)
+ {
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+
+ return res;
+}
+
+/* Parses a time (hours, minutes, seconds) specification in either syntax. */
+static time_t
+parse_time (cch_t * pz)
+{
+ cch_t * ps;
+ time_t res = 0;
+
+ /*
+ * Scan for a hyphen
+ */
+ ps = strchr (pz, ':');
+ if (ps != NULL)
+ {
+ res = parse_hour_minute_second (pz, ps);
+ }
+
+ /*
+ * Try for a 'H', 'M' or 'S' suffix
+ */
+ else if (ps = strpbrk (pz, "HMS"),
+ ps == NULL)
+ {
+ /* Its a YYYYMMDD format: */
+ res = parse_hourminutesecond (pz);
+ }
+
+ else
+ res = parse_HMS (pz);
+
+ return res;
+}
+
+/* Returns a substring of the given string, with spaces at the beginning and at
+ the end destructively removed, per SNOBOL. */
+static char *
+trim (char * pz)
+{
+ /* trim leading white space */
+ while (isspace ((unsigned char)*pz))
+ pz++;
+
+ /* trim trailing white space */
+ {
+ char * pe = pz + strlen (pz);
+ while ((pe > pz) && isspace ((unsigned char)pe[-1]))
+ pe--;
+ *pe = NUL;
+ }
+
+ return pz;
+}
+
+/*
+ * Parse the year/months/days of a time period
+ */
+static time_t
+parse_period (cch_t * in_pz)
+{
+ char * pT;
+ char * ps;
+ char * pz = strdup (in_pz);
+ void * fptr = pz;
+ time_t res = 0;
+
+ if (pz == NULL)
+ {
+ errno = ENOMEM;
+ return BAD_TIME;
+ }
+
+ pT = strchr (pz, 'T');
+ if (pT != NULL)
+ {
+ *(pT++) = NUL;
+ pz = trim (pz);
+ pT = trim (pT);
+ }
+
+ /*
+ * Scan for a hyphen
+ */
+ ps = strchr (pz, '-');
+ if (ps != NULL)
+ {
+ res = parse_year_month_day (pz, ps);
+ }
+
+ /*
+ * Try for a 'Y', 'M' or 'D' suffix
+ */
+ else if (ps = strpbrk (pz, "YMWD"),
+ ps == NULL)
+ {
+ /* Its a YYYYMMDD format: */
+ res = parse_yearmonthday (pz);
+ }
+
+ else
+ res = parse_YMWD (pz);
+
+ if ((errno == 0) && (pT != NULL))
+ {
+ time_t val = parse_time (pT);
+ res = scale_n_add (res, val, 1);
+ }
+
+ free (fptr);
+ return res;
+}
+
+static time_t
+parse_non_iso8601 (cch_t * pz)
+{
+ whats_done_t whatd_we_do = NOTHING_IS_DONE;
+
+ time_t res = 0;
+
+ do {
+ time_t val;
+
+ errno = 0;
+ val = str_const_to_l (pz, &pz, 10);
+ if (errno != 0)
+ goto bad_time;
+
+ /* IF we find a colon, then we're going to have a seconds value.
+ We will not loop here any more. We cannot already have parsed
+ a minute value and if we've parsed an hour value, then the result
+ value has to be less than an hour. */
+ if (*pz == ':')
+ {
+ if (whatd_we_do >= MINUTE_IS_DONE)
+ break;
+
+ val = parse_hr_min_sec (val, pz);
+
+ if ((whatd_we_do == HOUR_IS_DONE) && (val >= SEC_PER_HR))
+ break;
+
+ return scale_n_add (res, val, 1);
+ }
+
+ {
+ unsigned int mult;
+
+ /* Skip over white space following the number we just parsed. */
+ while (isspace ((unsigned char)*pz))
+ pz++;
+
+ switch (*pz)
+ {
+ default: goto bad_time;
+ case NUL:
+ return scale_n_add (res, val, 1);
+
+ case 'y': case 'Y':
+ if (whatd_we_do >= YEAR_IS_DONE)
+ goto bad_time;
+ mult = SEC_PER_YEAR;
+ whatd_we_do = YEAR_IS_DONE;
+ break;
+
+ case 'M':
+ if (whatd_we_do >= MONTH_IS_DONE)
+ goto bad_time;
+ mult = SEC_PER_MONTH;
+ whatd_we_do = MONTH_IS_DONE;
+ break;
+
+ case 'W':
+ if (whatd_we_do >= WEEK_IS_DONE)
+ goto bad_time;
+ mult = SEC_PER_WEEK;
+ whatd_we_do = WEEK_IS_DONE;
+ break;
+
+ case 'd': case 'D':
+ if (whatd_we_do >= DAY_IS_DONE)
+ goto bad_time;
+ mult = SEC_PER_DAY;
+ whatd_we_do = DAY_IS_DONE;
+ break;
+
+ case 'h':
+ if (whatd_we_do >= HOUR_IS_DONE)
+ goto bad_time;
+ mult = SEC_PER_HR;
+ whatd_we_do = HOUR_IS_DONE;
+ break;
+
+ case 'm':
+ if (whatd_we_do >= MINUTE_IS_DONE)
+ goto bad_time;
+ mult = SEC_PER_MIN;
+ whatd_we_do = MINUTE_IS_DONE;
+ break;
+
+ case 's':
+ mult = 1;
+ whatd_we_do = SECOND_IS_DONE;
+ break;
+ }
+
+ res = scale_n_add (res, val, mult);
+
+ pz++;
+ while (isspace ((unsigned char)*pz))
+ pz++;
+ if (*pz == NUL)
+ return res;
+
+ if (! isdigit ((unsigned char)*pz))
+ break;
+ }
+
+ } while (whatd_we_do < SECOND_IS_DONE);
+
+ bad_time:
+ errno = EINVAL;
+ return BAD_TIME;
+}
+
+time_t
+parse_duration (char const * pz)
+{
+ while (isspace ((unsigned char)*pz))
+ pz++;
+
+ switch (*pz)
+ {
+ case 'P':
+ return parse_period (pz + 1);
+
+ case 'T':
+ return parse_time (pz + 1);
+
+ default:
+ if (isdigit ((unsigned char)*pz))
+ return parse_non_iso8601 (pz);
+
+ errno = EINVAL;
+ return BAD_TIME;
+ }
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-file-style: "gnu"
+ * indent-tabs-mode: nil
+ * End:
+ * end of parse-duration.c */
diff --git a/sntp/libopts/parse-duration.h b/sntp/libopts/parse-duration.h
new file mode 100644
index 0000000..da7301e
--- /dev/null
+++ b/sntp/libopts/parse-duration.h
@@ -0,0 +1,90 @@
+/* Parse a time duration and return a seconds count
+ Copyright (C) 2008-2014 Free Software Foundation, Inc.
+ Written by Bruce Korb <bkorb@gnu.org>, 2008.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/*
+
+ Readers and users of this function are referred to the ISO-8601
+ specification, with particular attention to "Durations".
+
+ At the time of writing, this worked:
+
+ http://en.wikipedia.org/wiki/ISO_8601#Durations
+
+ The string must start with a 'P', 'T' or a digit.
+
+ ==== if it is a digit
+
+ the string may contain: NNN Y NNN M NNN W NNN d NNN h NNN m NNN s
+ This represents NNN years, NNN months, NNN weeks, NNN days, NNN hours,
+ NNN minutes and NNN seconds.
+ The embedded white space is optional.
+ These terms must appear in this order.
+ Case is significant: 'M' is months and 'm' is minutes.
+ The final "s" is optional.
+ All of the terms ("NNN" plus designator) are optional.
+ Minutes and seconds may optionally be represented as NNN:NNN.
+ Also, hours, minute and seconds may be represented as NNN:NNN:NNN.
+ There is no limitation on the value of any of the terms, except
+ that the final result must fit in a time_t value.
+
+ ==== if it is a 'P' or 'T', please see ISO-8601 for a rigorous definition.
+
+ The 'P' term may be followed by any of three formats:
+ yyyymmdd
+ yy-mm-dd
+ yy Y mm M ww W dd D
+
+ or it may be empty and followed by a 'T'. The "yyyymmdd" must be eight
+ digits long.
+
+ NOTE! Months are always 30 days and years are always 365 days long.
+ 5 years is always 1825 days, not 1826 or 1827 depending on leap year
+ considerations. 3 months is always 90 days. There is no consideration
+ for how many days are in the current, next or previous months.
+
+ For the final format:
+ * Embedded white space is allowed, but it is optional.
+ * All of the terms are optional. Any or all-but-one may be omitted.
+ * The meanings are yy years, mm months, ww weeks and dd days.
+ * The terms must appear in this order.
+
+ ==== The 'T' term may be followed by any of these formats:
+
+ hhmmss
+ hh:mm:ss
+ hh H mm M ss S
+
+ For the final format:
+ * Embedded white space is allowed, but it is optional.
+ * All of the terms are optional. Any or all-but-one may be omitted.
+ * The terms must appear in this order.
+
+ */
+#ifndef GNULIB_PARSE_DURATION_H
+#define GNULIB_PARSE_DURATION_H
+
+#include <time.h>
+
+/* Return value when a valid duration cannot be parsed. */
+#define BAD_TIME ((time_t)~0)
+
+/* Parses the given string. If it has the syntax of a valid duration,
+ this duration is returned. Otherwise, the return value is BAD_TIME,
+ and errno is set to either EINVAL (bad syntax) or ERANGE (out of range). */
+extern time_t parse_duration (char const * in_pz);
+
+#endif /* GNULIB_PARSE_DURATION_H */
diff --git a/sntp/libopts/pgusage.c b/sntp/libopts/pgusage.c
new file mode 100644
index 0000000..80a89a7
--- /dev/null
+++ b/sntp/libopts/pgusage.c
@@ -0,0 +1,187 @@
+
+/**
+ * \file pgusage.c
+ *
+ * Automated Options Paged Usage module.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This routine will run run-on options through a pager so the
+ * user may examine, print or edit them at their leisure.
+ *
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+#if defined(HAVE_WORKING_FORK)
+static FILE *
+open_tmp_usage(char ** buf)
+{
+ char * bf;
+ size_t bfsz;
+
+ {
+ unsigned int my_pid = (unsigned int)getpid();
+ char const * tmpdir = getenv(TMPDIR);
+ if (tmpdir == NULL)
+ tmpdir = tmp_dir;
+ bfsz = TMP_FILE_FMT_LEN + strlen(tmpdir) + 10;
+ bf = AGALOC(bfsz, "tmp fil");
+ snprintf(bf, bfsz, TMP_FILE_FMT, tmpdir, my_pid);
+ }
+
+ {
+ static mode_t const cmask = S_IRWXO | S_IRWXG;
+ mode_t svmsk = umask(cmask);
+ int fd = mkstemp(bf);
+ (void)umask(svmsk);
+
+ if (fd < 0) {
+ AGFREE(bf);
+ return NULL;
+ }
+ *buf = bf;
+ return fdopen(fd, "w");
+ }
+}
+
+static char *
+mk_pager_cmd(char const * fname)
+{
+ /*
+ * Page the file and remove it when done. For shell script processing,
+ * we must redirect the output to the current stderr, otherwise stdout.
+ */
+ fclose(option_usage_fp);
+ option_usage_fp = NULL;
+
+ {
+ char const * pager = (char const *)getenv(PAGER_NAME);
+ size_t bfsz;
+ char * res;
+
+ /*
+ * Use the "more(1)" program if "PAGER" has not been defined
+ */
+ if (pager == NULL)
+ pager = MORE_STR;
+
+ bfsz = strlen(fname) + strlen(pager) + PAGE_USAGE_FMT_LEN;
+ res = AGALOC(bfsz, "more cmd");
+ snprintf(res, bfsz, PAGE_USAGE_FMT, pager, fname);
+ AGFREE((void*)fname);
+ return res;
+ }
+}
+#endif
+
+/*=export_func optionPagedUsage
+ * private:
+ *
+ * what: emit help text and pass through a pager program.
+ * arg: + tOptions * + opts + program options descriptor +
+ * arg: + tOptDesc * + od + the descriptor for this arg +
+ *
+ * doc:
+ * Run the usage output through a pager.
+ * This is very handy if it is very long.
+ * This is disabled on platforms without a working fork() function.
+=*/
+void
+optionPagedUsage(tOptions * opts, tOptDesc * od)
+{
+#if ! defined(HAVE_WORKING_FORK)
+ if ((od->fOptState & OPTST_RESET) != 0)
+ return;
+
+ (*opts->pUsageProc)(opts, EXIT_SUCCESS);
+#else
+ static bool sv_print_exit = false;
+ static char * fil_name = NULL;
+
+ /*
+ * IF we are being called after the usage proc is done
+ * (and thus has called "exit(2)")
+ * THEN invoke the pager to page through the usage file we created.
+ */
+ switch (pagerState) {
+ case PAGER_STATE_INITIAL:
+ {
+ if ((od->fOptState & OPTST_RESET) != 0)
+ return;
+ option_usage_fp = open_tmp_usage(&fil_name);
+ if (option_usage_fp == NULL)
+ (*opts->pUsageProc)(opts, EXIT_SUCCESS);
+
+ pagerState = PAGER_STATE_READY;
+ sv_print_exit = print_exit;
+
+ /*
+ * Set up so this routine gets called during the exit logic
+ */
+ atexit((void(*)(void))optionPagedUsage);
+
+ /*
+ * The usage procedure will now put the usage information into
+ * the temporary file we created above. Keep any shell commands
+ * out of the result.
+ */
+ print_exit = false;
+ (*opts->pUsageProc)(opts, EXIT_SUCCESS);
+
+ /* NOTREACHED */
+ _exit(EXIT_FAILURE);
+ }
+
+ case PAGER_STATE_READY:
+ fil_name = mk_pager_cmd(fil_name);
+
+ if (sv_print_exit) {
+ fputs("\nexit 0\n", stdout);
+ fclose(stdout);
+ dup2(STDERR_FILENO, STDOUT_FILENO);
+
+ } else {
+ fclose(stderr);
+ dup2(STDOUT_FILENO, STDERR_FILENO);
+ }
+
+ ignore_val( system( fil_name));
+ AGFREE(fil_name);
+
+ case PAGER_STATE_CHILD:
+ /*
+ * This is a child process used in creating shell script usage.
+ */
+ break;
+ }
+#endif
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/pgusage.c */
diff --git a/sntp/libopts/proto.h b/sntp/libopts/proto.h
new file mode 100644
index 0000000..3275ea1
--- /dev/null
+++ b/sntp/libopts/proto.h
@@ -0,0 +1,146 @@
+/* -*- buffer-read-only: t -*- vi: set ro:
+ *
+ * Prototypes for autoopts
+ * Generated Fri Aug 8 16:09:18 PDT 2014
+ */
+#ifndef AUTOOPTS_PROTO_H_GUARD
+#define AUTOOPTS_PROTO_H_GUARD 1
+
+/*
+ * Extracted from alias.c
+ */
+static tSuccess
+too_many_occurrences(tOptions * opts, tOptDesc * od);
+
+/*
+ * Extracted from autoopts.c
+ */
+static void *
+ao_malloc(size_t sz);
+
+static void *
+ao_realloc(void *p, size_t sz);
+
+static char *
+ao_strdup(char const *str);
+
+static tSuccess
+handle_opt(tOptions * opts, tOptState * o_st);
+
+static tSuccess
+next_opt(tOptions * opts, tOptState * o_st);
+
+static tSuccess
+regular_opts(tOptions * opts);
+
+/*
+ * Extracted from check.c
+ */
+static bool
+is_consistent(tOptions * pOpts);
+
+/*
+ * Extracted from configfile.c
+ */
+static void
+intern_file_load(tOptions * opts);
+
+static char const *
+parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode,
+ tOptionValue * pType);
+
+/*
+ * Extracted from env.c
+ */
+static void
+doPrognameEnv(tOptions * pOpts, teEnvPresetType type);
+
+static void
+env_presets(tOptions * pOpts, teEnvPresetType type);
+
+/*
+ * Extracted from find.c
+ */
+static tSuccess
+opt_find_long(tOptions * opts, char const * opt_name, tOptState * state);
+
+static tSuccess
+opt_find_short(tOptions* pOpts, uint_t optValue, tOptState* pOptState);
+
+static tSuccess
+get_opt_arg(tOptions * opts, tOptState * o_st);
+
+static tSuccess
+find_opt(tOptions * opts, tOptState * o_st);
+
+/*
+ * Extracted from init.c
+ */
+static tSuccess
+validate_struct(tOptions * opts, char const * pname);
+
+static tSuccess
+immediate_opts(tOptions * opts);
+
+static bool
+ao_initialize(tOptions * opts, int a_ct, char ** a_v);
+
+/*
+ * Extracted from load.c
+ */
+static void
+munge_str(char * txt, tOptionLoadMode mode);
+
+static void
+load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
+ tDirection direction, tOptionLoadMode load_mode );
+
+/*
+ * Extracted from makeshell.c
+ */
+static noreturn void
+option_exits(int exit_code);
+
+static noreturn void
+ao_bug(char const * msg);
+
+static void
+fserr_warn(char const * prog, char const * op, char const * fname);
+
+static noreturn void
+fserr_exit(char const * prog, char const * op, char const * fname);
+
+/*
+ * Extracted from nested.c
+ */
+static void
+unload_arg_list(tArgList * arg_list);
+
+static tOptionValue *
+optionLoadNested(char const * text, char const * name, size_t nm_len);
+
+static int
+get_special_char(char const ** ppz, int * ct);
+
+static void
+emit_special_char(FILE * fp, int ch);
+
+/*
+ * Extracted from sort.c
+ */
+static void
+optionSort(tOptions * opts);
+
+/*
+ * Extracted from stack.c
+ */
+static void
+addArgListEntry(void ** ppAL, void * entry);
+
+/*
+ * Extracted from usage.c
+ */
+static void
+set_usage_flags(tOptions * opts, char const * flg_txt);
+
+#endif /* AUTOOPTS_PROTO_H_GUARD */
diff --git a/sntp/libopts/putshell.c b/sntp/libopts/putshell.c
new file mode 100644
index 0000000..4b0fa10
--- /dev/null
+++ b/sntp/libopts/putshell.c
@@ -0,0 +1,511 @@
+
+/**
+ * \file putshell.c
+ *
+ * This module will interpret the options set in the tOptions
+ * structure and print them to standard out in a fashion that
+ * will allow them to be interpreted by the Bourne or Korn shells.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static size_t
+string_size(char const * scan, size_t nl_len);
+
+static char const *
+print_quoted_apostrophes(char const * str);
+
+static void
+print_quot_str(char const * str);
+
+static void
+print_enumeration(tOptions * pOpts, tOptDesc * pOD);
+
+static void
+print_membership(tOptions * pOpts, tOptDesc * pOD);
+
+static void
+print_stacked_arg(tOptions * pOpts, tOptDesc * pOD);
+
+static void
+print_reordering(tOptions * opts);
+/* = = = END-STATIC-FORWARD = = = */
+
+/**
+ * Count the number of bytes required to represent a string as a
+ * compilable string.
+ *
+ * @param[in] scan the text to be rewritten as a C program text string.
+ * @param[in] nl_len the number of bytes used for each embedded newline.
+ *
+ * @returns the count, including the terminating NUL byte.
+ */
+static size_t
+string_size(char const * scan, size_t nl_len)
+{
+ /*
+ * Start by counting the start and end quotes, plus the NUL.
+ */
+ size_t res_ln = 3;
+
+ for (;;) {
+ char ch = *(scan++);
+ if ((ch >= ' ') && (ch <= '~')) {
+
+ /*
+ * a backslash allowance for double quotes and baskslashes
+ */
+ res_ln += ((ch == '"') || (ch == '\\')) ? 2 : 1;
+ }
+
+ /*
+ * When not a normal character, then count the characters
+ * required to represent whatever it is.
+ */
+ else switch (ch) {
+ case NUL:
+ return res_ln;
+
+ case NL:
+ res_ln += nl_len;
+ break;
+
+ case HT:
+ case BEL:
+ case BS:
+ case FF:
+ case CR:
+ case VT:
+ res_ln += 2;
+ break;
+
+ default:
+ res_ln += 4; /* text len for \xNN */
+ }
+ }
+}
+
+/*=export_func optionQuoteString
+ * private:
+ *
+ * what: Print a string as quoted text suitable for a C compiler.
+ * arg: + char const * + text + a block of text to quote +
+ * arg: + char const * + nl + line splice text +
+ *
+ * ret_type: char const *
+ * ret_desc: the allocated input string as a quoted string
+ *
+ * doc:
+ * This is for internal use by autogen and autoopts.
+ * It takes an input string and produces text the C compiler can process
+ * to produce an exact copy of the original string.
+ * The caller must deallocate the result. Standard C strings and
+ * K&R strings are distinguished by the "nl" string.
+=*/
+char const *
+optionQuoteString(char const * text, char const * nl)
+{
+ size_t nl_len = strlen(nl);
+ char * out;
+ char * res = out = AGALOC(string_size(text, nl_len), "quot str");
+ *(out++) = '"';
+
+ for (;;) {
+ unsigned char ch = (unsigned char)*text;
+ if ((ch >= ' ') && (ch <= '~')) {
+ if ((ch == '"') || (ch == '\\'))
+ /*
+ * We must escape these characters in the output string
+ */
+ *(out++) = '\\';
+ *(out++) = (char)ch;
+
+ } else switch (ch) {
+# define add_esc_ch(_ch) { *(out++) = '\\'; *(out++) = (_ch); }
+ case BEL: add_esc_ch('a'); break;
+ case BS: add_esc_ch('b'); break;
+ case HT: add_esc_ch('t'); break;
+ case VT: add_esc_ch('v'); break;
+ case FF: add_esc_ch('f'); break;
+ case CR: add_esc_ch('r'); break;
+
+ case LF:
+ /*
+ * Place contiguous new-lines on a single line.
+ * The current character is a NL, check the next one.
+ */
+ while (*++text == NL)
+ add_esc_ch('n');
+
+ /*
+ * Insert a splice before starting next line
+ */
+ if (*text != NUL) {
+ memcpy(out, nl, nl_len);
+ out += nl_len;
+
+ continue; /* text is already at the next character */
+ }
+
+ add_esc_ch('n');
+ /* FALLTHROUGH */
+
+ case NUL:
+ /*
+ * End of string. Terminate the quoted output. If necessary,
+ * deallocate the text string. Return the scan resumption point.
+ */
+ *(out++) = '"';
+ *out = NUL;
+ return res;
+
+ default:
+ /*
+ * sprintf is safe here, because we already computed
+ * the amount of space we will be using.
+ */
+ sprintf(out, MK_STR_OCT_FMT, ch);
+ out += 4;
+ }
+
+ text++;
+# undef add_esc_ch
+ }
+}
+
+/**
+ * Print out escaped apostorophes.
+ *
+ * @param[in] str the apostrophies to print
+ */
+static char const *
+print_quoted_apostrophes(char const * str)
+{
+ while (*str == APOSTROPHE) {
+ fputs(QUOT_APOS, stdout);
+ str++;
+ }
+ return str;
+}
+
+/**
+ * Print a single quote (apostrophe quoted) string.
+ * Other than somersaults for apostrophes, nothing else needs quoting.
+ *
+ * @param[in] str the string to print
+ */
+static void
+print_quot_str(char const * str)
+{
+ /*
+ * Handle empty strings to make the rest of the logic simpler.
+ */
+ if ((str == NULL) || (*str == NUL)) {
+ fputs(EMPTY_ARG, stdout);
+ return;
+ }
+
+ /*
+ * Emit any single quotes/apostrophes at the start of the string and
+ * bail if that is all we need to do.
+ */
+ str = print_quoted_apostrophes(str);
+ if (*str == NUL)
+ return;
+
+ /*
+ * Start the single quote string
+ */
+ fputc(APOSTROPHE, stdout);
+ for (;;) {
+ char const * pz = strchr(str, APOSTROPHE);
+ if (pz == NULL)
+ break;
+
+ /*
+ * Emit the string up to the single quote (apostrophe) we just found.
+ */
+ (void)fwrite(str, (size_t)(pz - str), (size_t)1, stdout);
+
+ /*
+ * Close the current string, emit the apostrophes and re-open the
+ * string (IFF there is more text to print).
+ */
+ fputc(APOSTROPHE, stdout);
+ str = print_quoted_apostrophes(pz);
+ if (*str == NUL)
+ return;
+
+ fputc(APOSTROPHE, stdout);
+ }
+
+ /*
+ * If we broke out of the loop, we must still emit the remaining text
+ * and then close the single quote string.
+ */
+ fputs(str, stdout);
+ fputc(APOSTROPHE, stdout);
+}
+
+static void
+print_enumeration(tOptions * pOpts, tOptDesc * pOD)
+{
+ uintptr_t e_val = pOD->optArg.argEnum;
+ printf(OPT_VAL_FMT, pOpts->pzPROGNAME, pOD->pz_NAME);
+
+ /*
+ * Convert value to string, print that and restore numeric value.
+ */
+ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD);
+ printf(QUOT_ARG_FMT, pOD->optArg.argString);
+ if (pOD->fOptState & OPTST_ALLOC_ARG)
+ AGFREE(pOD->optArg.argString);
+ pOD->optArg.argEnum = e_val;
+
+ printf(OPT_END_FMT, pOpts->pzPROGNAME, pOD->pz_NAME);
+}
+
+static void
+print_membership(tOptions * pOpts, tOptDesc * pOD)
+{
+ char const * svstr = pOD->optArg.argString;
+ char const * pz;
+ uintptr_t val = 1;
+ printf(zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
+ (int)(uintptr_t)(pOD->optCookie));
+ pOD->optCookie = (void*)(uintptr_t)~0UL;
+ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD);
+
+ pz = pOD->optArg.argString;
+ while (*pz != NUL) {
+ printf("readonly %s_", pOD->pz_NAME);
+ pz = SPN_PLUS_N_SPACE_CHARS(pz);
+
+ for (;;) {
+ int ch = *(pz++);
+ if (IS_LOWER_CASE_CHAR(ch)) fputc(toupper(ch), stdout);
+ else if (IS_UPPER_CASE_CHAR(ch)) fputc(ch, stdout);
+ else if (IS_PLUS_N_SPACE_CHAR(ch)) goto name_done;
+ else if (ch == NUL) { pz--; goto name_done; }
+ else fputc('_', stdout);
+ } name_done:;
+ printf(SHOW_VAL_FMT, (unsigned long)val);
+ val <<= 1;
+ }
+
+ AGFREE(pOD->optArg.argString);
+ pOD->optArg.argString = svstr;
+}
+
+static void
+print_stacked_arg(tOptions * pOpts, tOptDesc * pOD)
+{
+ tArgList* pAL = (tArgList*)pOD->optCookie;
+ char const ** ppz = pAL->apzArgs;
+ int ct = pAL->useCt;
+
+ printf(zOptCookieCt, pOpts->pzPROGNAME, pOD->pz_NAME, ct);
+
+ while (--ct >= 0) {
+ printf(ARG_BY_NUM_FMT, pOpts->pzPROGNAME, pOD->pz_NAME,
+ pAL->useCt - ct);
+ print_quot_str(*(ppz++));
+ printf(EXPORT_ARG_FMT, pOpts->pzPROGNAME, pOD->pz_NAME,
+ pAL->useCt - ct);
+ }
+}
+
+/**
+ * emit the arguments as readily parsed text.
+ * The program options are set by emitting the shell "set" command.
+ *
+ * @param[in] opts the program options structure
+ */
+static void
+print_reordering(tOptions * opts)
+{
+ unsigned int ix;
+
+ fputs(set_dash, stdout);
+
+ for (ix = opts->curOptIdx;
+ ix < opts->origArgCt;
+ ix++) {
+ fputc(' ', stdout);
+ print_quot_str(opts->origArgVect[ ix ]);
+ }
+ fputs(init_optct, stdout);
+}
+
+/*=export_func optionPutShell
+ * what: write a portable shell script to parse options
+ * private:
+ * arg: tOptions*, pOpts, the program options descriptor
+ * doc: This routine will emit portable shell script text for parsing
+ * the options described in the option definitions.
+=*/
+void
+optionPutShell(tOptions* pOpts)
+{
+ int optIx = 0;
+
+ printf(zOptCtFmt, pOpts->curOptIdx-1);
+
+ do {
+ tOptDesc* pOD = pOpts->pOptDesc + optIx;
+
+ if ((pOD->fOptState & OPTST_NO_OUTPUT_MASK) != 0)
+ continue;
+
+ /*
+ * Equivalence classes are hard to deal with. Where the
+ * option data wind up kind of squishes around. For the purposes
+ * of emitting shell state, they are not recommended, but we'll
+ * do something. I guess we'll emit the equivalenced-to option
+ * at the point in time when the base option is found.
+ */
+ if (pOD->optEquivIndex != NO_EQUIVALENT)
+ continue; /* equivalence to a different option */
+
+ /*
+ * Equivalenced to a different option. Process the current option
+ * as the equivalenced-to option. Keep the persistent state bits,
+ * but copy over the set-state bits.
+ */
+ if (pOD->optActualIndex != optIx) {
+ tOptDesc* p = pOpts->pOptDesc + pOD->optActualIndex;
+ p->optArg = pOD->optArg;
+ p->fOptState &= OPTST_PERSISTENT_MASK;
+ p->fOptState |= pOD->fOptState & ~OPTST_PERSISTENT_MASK;
+ printf(zEquivMode, pOpts->pzPROGNAME, pOD->pz_NAME, p->pz_NAME);
+ pOD = p;
+ }
+
+ /*
+ * If the argument type is a set membership bitmask, then we always
+ * emit the thing. We do this because it will always have some sort
+ * of bitmask value and we need to emit the bit values.
+ */
+ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_MEMBERSHIP) {
+ print_membership(pOpts, pOD);
+ continue;
+ }
+
+ /*
+ * IF the option was either specified or it wakes up enabled,
+ * then we will emit information. Otherwise, skip it.
+ * The idea is that if someone defines an option to initialize
+ * enabled, we should tell our shell script that it is enabled.
+ */
+ if (UNUSED_OPT(pOD) && DISABLED_OPT(pOD))
+ continue;
+
+ /*
+ * Handle stacked arguments
+ */
+ if ( (pOD->fOptState & OPTST_STACKED)
+ && (pOD->optCookie != NULL) ) {
+ print_stacked_arg(pOpts, pOD);
+ continue;
+ }
+
+ /*
+ * If the argument has been disabled,
+ * Then set its value to the disablement string
+ */
+ if ((pOD->fOptState & OPTST_DISABLED) != 0) {
+ printf(zOptDisabl, pOpts->pzPROGNAME, pOD->pz_NAME,
+ (pOD->pz_DisablePfx != NULL)
+ ? pOD->pz_DisablePfx : "false");
+ continue;
+ }
+
+ /*
+ * If the argument type is numeric, the last arg pointer
+ * is really the VALUE of the string that was pointed to.
+ */
+ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_NUMERIC) {
+ printf(zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
+ (int)pOD->optArg.argInt);
+ continue;
+ }
+
+ /*
+ * If the argument type is an enumeration, then it is much
+ * like a text value, except we call the callback function
+ * to emit the value corresponding to the "optArg" number.
+ */
+ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_ENUMERATION) {
+ print_enumeration(pOpts, pOD);
+ continue;
+ }
+
+ /*
+ * If the argument type is numeric, the last arg pointer
+ * is really the VALUE of the string that was pointed to.
+ */
+ if (OPTST_GET_ARGTYPE(pOD->fOptState) == OPARG_TYPE_BOOLEAN) {
+ printf(zFullOptFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
+ (pOD->optArg.argBool == 0) ? "false" : "true");
+ continue;
+ }
+
+ /*
+ * IF the option has an empty value,
+ * THEN we set the argument to the occurrence count.
+ */
+ if ( (pOD->optArg.argString == NULL)
+ || (pOD->optArg.argString[0] == NUL) ) {
+
+ printf(zOptNumFmt, pOpts->pzPROGNAME, pOD->pz_NAME,
+ pOD->optOccCt);
+ continue;
+ }
+
+ /*
+ * This option has a text value
+ */
+ printf(OPT_VAL_FMT, pOpts->pzPROGNAME, pOD->pz_NAME);
+ print_quot_str(pOD->optArg.argString);
+ printf(OPT_END_FMT, pOpts->pzPROGNAME, pOD->pz_NAME);
+
+ } while (++optIx < pOpts->presetOptCt );
+
+ if ( ((pOpts->fOptSet & OPTPROC_REORDER) != 0)
+ && (pOpts->curOptIdx < pOpts->origArgCt))
+ print_reordering(pOpts);
+
+ fflush(stdout);
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/putshell.c */
diff --git a/sntp/libopts/reset.c b/sntp/libopts/reset.c
new file mode 100644
index 0000000..df81cd7
--- /dev/null
+++ b/sntp/libopts/reset.c
@@ -0,0 +1,141 @@
+
+/**
+ * \file reset.c
+ *
+ * Reset the option state to the compiled state.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+static void
+optionReset( tOptions* pOpts, tOptDesc* pOD )
+{
+ pOD->fOptState &= OPTST_PERSISTENT_MASK;
+ pOD->fOptState |= OPTST_RESET;
+ if (pOD->pOptProc != NULL)
+ pOD->pOptProc(pOpts, pOD);
+ pOD->optArg.argString =
+ pOpts->originalOptArgArray[ pOD->optIndex ].argString;
+ pOD->optCookie = pOpts->originalOptArgCookie[ pOD->optIndex ];
+ pOD->fOptState &= OPTST_PERSISTENT_MASK;
+}
+
+
+static void
+optionResetEverything(tOptions * pOpts)
+{
+ tOptDesc * pOD = pOpts->pOptDesc;
+ int ct = pOpts->presetOptCt;
+
+ for (;;) {
+ optionReset(pOpts, pOD);
+
+ if (--ct <= 0)
+ break;
+ pOD++;
+ }
+}
+
+
+/*=export_func optionResetOpt
+ * private:
+ *
+ * what: Reset the value of an option
+ * arg: + tOptions* + pOpts + program options descriptor +
+ * arg: + tOptDesc* + pOptDesc + the descriptor for this arg +
+ *
+ * doc:
+ * This code will cause another option to be reset to its initial state.
+ * For example, --reset=foo will cause the --foo option to be reset.
+=*/
+void
+optionResetOpt(tOptions * pOpts, tOptDesc * pOD)
+{
+ static bool reset_active = false;
+
+ tOptState opt_state = OPTSTATE_INITIALIZER(DEFINED);
+ char const * pzArg = pOD->optArg.argString;
+ tSuccess succ;
+
+ if (pOpts <= OPTPROC_EMIT_LIMIT)
+ return;
+
+ if (reset_active)
+ return;
+
+ if ( (! HAS_originalOptArgArray(pOpts))
+ || (pOpts->originalOptArgCookie == NULL))
+ ao_bug(zno_reset);
+
+ if ((pzArg == NULL) || (*pzArg == NUL)) {
+ fprintf(stderr, zreset_arg, pOpts->pzProgName, pOD->pz_Name);
+ pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
+ }
+
+ reset_active = true;
+
+ if (pzArg[1] == NUL) {
+ if (*pzArg == '*') {
+ optionResetEverything(pOpts);
+ reset_active = false;
+ return;
+ }
+
+ succ = opt_find_short(pOpts, (uint8_t)*pzArg, &opt_state);
+ if (! SUCCESSFUL(succ)) {
+ fprintf(stderr, zIllOptChr, pOpts->pzProgPath, *pzArg);
+ pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
+ }
+ } else {
+ succ = opt_find_long(pOpts, (char *)pzArg, &opt_state);
+ if (! SUCCESSFUL(succ)) {
+ fprintf(stderr, zIllOptStr, pOpts->pzProgPath, pzArg);
+ pOpts->pUsageProc(pOpts, EXIT_FAILURE);
+ /* NOTREACHED */
+ assert(0 == 1);
+ }
+ }
+
+ /*
+ * We've found the indicated option. Turn off all non-persistent
+ * flags because we're forcing the option back to its initialized state.
+ * Call any callout procedure to handle whatever it needs to.
+ * Finally, clear the reset flag, too.
+ */
+ optionReset(pOpts, opt_state.pOD);
+ reset_active = false;
+}
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/reset.c */
diff --git a/sntp/libopts/restore.c b/sntp/libopts/restore.c
new file mode 100644
index 0000000..f711cb3
--- /dev/null
+++ b/sntp/libopts/restore.c
@@ -0,0 +1,223 @@
+
+/*
+ * \file restore.c
+ *
+ * This module's routines will save the current option state to memory
+ * and restore it. If saved prior to the initial optionProcess call,
+ * then the initial state will be restored.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/*
+ * optionFixupSavedOpts Really, it just wipes out option state for
+ * options that are troublesome to copy. viz., stacked strings and
+ * hierarcicaly valued option args. We do duplicate string args that
+ * have been marked as allocated though.
+ */
+static void
+fixupSavedOptionArgs(tOptions* pOpts)
+{
+ tOptions* p = pOpts->pSavedState;
+ tOptDesc* pOD = pOpts->pOptDesc;
+ int ct = pOpts->optCt;
+
+ /*
+ * Make sure that allocated stuff is only referenced in the
+ * archived copy of the data.
+ */
+ for (; ct-- > 0; pOD++) {
+ switch (OPTST_GET_ARGTYPE(pOD->fOptState)) {
+ case OPARG_TYPE_STRING:
+ if (pOD->fOptState & OPTST_STACKED) {
+ tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc);
+ q->optCookie = NULL;
+ }
+ if (pOD->fOptState & OPTST_ALLOC_ARG) {
+ tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc);
+ AGDUPSTR(q->optArg.argString, pOD->optArg.argString, "arg");
+ }
+ break;
+
+ case OPARG_TYPE_HIERARCHY:
+ {
+ tOptDesc* q = p->pOptDesc + (pOD - pOpts->pOptDesc);
+ q->optCookie = NULL;
+ }
+ }
+ }
+}
+
+/*=export_func optionSaveState
+ *
+ * what: saves the option state to memory
+ * arg: tOptions*, pOpts, program options descriptor
+ *
+ * doc:
+ *
+ * This routine will allocate enough memory to save the current option
+ * processing state. If this routine has been called before, that memory
+ * will be reused. You may only save one copy of the option state. This
+ * routine may be called before optionProcess(3AO). If you do call it
+ * before the first call to optionProcess, then you may also change the
+ * contents of argc/argv after you call optionRestore(3AO)
+ *
+ * In fact, more strongly put: it is safest to only use this function
+ * before having processed any options. In particular, the saving and
+ * restoring of stacked string arguments and hierarchical values is
+ * disabled. The values are not saved.
+ *
+ * err: If it fails to allocate the memory,
+ * it will print a message to stderr and exit.
+ * Otherwise, it will always succeed.
+=*/
+void
+optionSaveState(tOptions * pOpts)
+{
+ tOptions * p = (tOptions*)pOpts->pSavedState;
+
+ if (p == NULL) {
+ size_t sz = sizeof(*pOpts)
+ + ((size_t)pOpts->optCt * sizeof(tOptDesc));
+ p = AGALOC(sz, "saved option state");
+
+ pOpts->pSavedState = p;
+ }
+
+ memcpy(p, pOpts, sizeof(*p));
+ memcpy(p + 1, pOpts->pOptDesc, (size_t)p->optCt * sizeof(tOptDesc));
+
+ fixupSavedOptionArgs(pOpts);
+}
+
+
+/*=export_func optionRestore
+ *
+ * what: restore option state from memory copy
+ * arg: tOptions*, pOpts, program options descriptor
+ *
+ * doc: Copy back the option state from saved memory.
+ * The allocated memory is left intact, so this routine can be
+ * called repeatedly without having to call optionSaveState again.
+ * If you are restoring a state that was saved before the first call
+ * to optionProcess(3AO), then you may change the contents of the
+ * argc/argv parameters to optionProcess.
+ *
+ * err: If you have not called @code{optionSaveState} before, a diagnostic is
+ * printed to @code{stderr} and exit is called.
+=*/
+void
+optionRestore(tOptions* pOpts)
+{
+ tOptions* p = (tOptions*)pOpts->pSavedState;
+
+ if (p == NULL) {
+ char const * pzName = pOpts->pzProgName;
+ if (pzName == NULL) {
+ pzName = pOpts->pzPROGNAME;
+ if (pzName == NULL)
+ pzName = zNil;
+ }
+ fprintf(stderr, zNoState, pzName);
+ option_exits(EXIT_FAILURE);
+ }
+
+ pOpts->pSavedState = NULL;
+ optionFree(pOpts);
+
+ memcpy(pOpts, p, sizeof(*p));
+ memcpy(pOpts->pOptDesc, p+1, (size_t)p->optCt * sizeof(tOptDesc));
+ pOpts->pSavedState = p;
+
+ fixupSavedOptionArgs(pOpts);
+}
+
+/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
+
+/*=export_func optionFree
+ *
+ * what: free allocated option processing memory
+ * arg: tOptions*, pOpts, program options descriptor
+ *
+ * doc: AutoOpts sometimes allocates memory and puts pointers to it in the
+ * option state structures. This routine deallocates all such memory.
+ *
+ * err: As long as memory has not been corrupted,
+ * this routine is always successful.
+=*/
+void
+optionFree(tOptions* pOpts)
+{
+ free_saved_state:
+ {
+ tOptDesc* p = pOpts->pOptDesc;
+ int ct = pOpts->optCt;
+ do {
+ if (p->fOptState & OPTST_ALLOC_ARG) {
+ AGFREE(p->optArg.argString);
+ p->optArg.argString = NULL;
+ p->fOptState &= ~OPTST_ALLOC_ARG;
+ }
+
+ switch (OPTST_GET_ARGTYPE(p->fOptState)) {
+ case OPARG_TYPE_STRING:
+#ifdef WITH_LIBREGEX
+ if ( (p->fOptState & OPTST_STACKED)
+ && (p->optCookie != NULL)) {
+ p->optArg.argString = ".*";
+ optionUnstackArg(pOpts, p);
+ }
+#else
+ /* leak memory */;
+#endif
+ break;
+
+ case OPARG_TYPE_HIERARCHY:
+ if (p->optCookie != NULL)
+ unload_arg_list(p->optCookie);
+ break;
+ }
+
+ p->optCookie = NULL;
+ } while (p++, --ct > 0);
+ }
+ if (pOpts->pSavedState != NULL) {
+ tOptions * p = (tOptions*)pOpts->pSavedState;
+ memcpy(pOpts, p, sizeof(*p));
+ memcpy(pOpts->pOptDesc, p+1, (size_t)p->optCt * sizeof(tOptDesc));
+ AGFREE(pOpts->pSavedState);
+ pOpts->pSavedState = NULL;
+ goto free_saved_state;
+ }
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/restore.c */
diff --git a/sntp/libopts/save.c b/sntp/libopts/save.c
new file mode 100644
index 0000000..19c4c5b
--- /dev/null
+++ b/sntp/libopts/save.c
@@ -0,0 +1,809 @@
+
+/*
+ * \file save.c
+ *
+ * This module's routines will take the currently set options and
+ * store them into an ".rc" file for re-interpretation the next
+ * time the invoking program is run.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static char const *
+find_dir_name(tOptions * opts, int * p_free);
+
+static char const *
+find_file_name(tOptions * opts, int * p_free_name);
+
+static void
+prt_entry(FILE * fp, tOptDesc * od, char const * l_arg);
+
+static void
+prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp);
+
+static void
+prt_string(FILE * fp, char const * name, char const * pz);
+
+static void
+prt_val_list(FILE * fp, char const * name, tArgList * al);
+
+static void
+prt_nested(FILE * fp, tOptDesc * p);
+
+static FILE *
+open_sv_file(tOptions * opts);
+
+static void
+prt_no_arg_opt(FILE * fp, tOptDesc * p, tOptDesc * pOD);
+
+static void
+prt_str_arg(FILE * fp, tOptDesc * pOD);
+
+static void
+prt_enum_arg(FILE * fp, tOptDesc * od);
+
+static void
+prt_set_arg(FILE * fp, tOptDesc * od);
+
+static void
+prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts);
+/* = = = END-STATIC-FORWARD = = = */
+
+/**
+ */
+static char const *
+find_dir_name(tOptions * opts, int * p_free)
+{
+ char const * pzDir;
+
+ if ( (opts->specOptIdx.save_opts == NO_EQUIVALENT)
+ || (opts->specOptIdx.save_opts == 0))
+ return NULL;
+
+ pzDir = opts->pOptDesc[ opts->specOptIdx.save_opts ].optArg.argString;
+ if ((pzDir != NULL) && (*pzDir != NUL))
+ return pzDir;
+
+ /*
+ * This function only works if there is a directory where
+ * we can stash the RC (INI) file.
+ */
+ {
+ char const * const* papz = opts->papzHomeList;
+ if (papz == NULL)
+ return NULL;
+
+ while (papz[1] != NULL) papz++;
+ pzDir = *papz;
+ }
+
+ /*
+ * IF it does not require deciphering an env value, then just copy it
+ */
+ if (*pzDir != '$')
+ return pzDir;
+
+ {
+ char const * pzEndDir = strchr(++pzDir, DIRCH);
+ char * pzFileName;
+ char * pzEnv;
+
+ if (pzEndDir != NULL) {
+ char z[ AO_NAME_SIZE ];
+ if ((pzEndDir - pzDir) > AO_NAME_LIMIT )
+ return NULL;
+ memcpy(z, pzDir, (size_t)(pzEndDir - pzDir));
+ z[pzEndDir - pzDir] = NUL;
+ pzEnv = getenv(z);
+ } else {
+
+ /*
+ * Make sure we can get the env value (after stripping off
+ * any trailing directory or file names)
+ */
+ pzEnv = getenv(pzDir);
+ }
+
+ if (pzEnv == NULL) {
+ fprintf(stderr, zsave_warn, opts->pzProgName);
+ fprintf(stderr, zNotDef, pzDir);
+ return NULL;
+ }
+
+ if (pzEndDir == NULL)
+ return pzEnv;
+
+ {
+ size_t sz = strlen(pzEnv) + strlen(pzEndDir) + 2;
+ pzFileName = (char *)AGALOC(sz, "dir name");
+ }
+
+ if (pzFileName == NULL)
+ return NULL;
+
+ *p_free = 1;
+ /*
+ * Glue together the full name into the allocated memory.
+ * FIXME: We lose track of this memory.
+ */
+ sprintf(pzFileName, "%s/%s", pzEnv, pzEndDir);
+ return pzFileName;
+ }
+}
+
+/**
+ */
+static char const *
+find_file_name(tOptions * opts, int * p_free_name)
+{
+ struct stat stBuf;
+ int free_dir_name = 0;
+
+ char const * pzDir = find_dir_name(opts, &free_dir_name);
+ if (pzDir == NULL)
+ return NULL;
+
+ /*
+ * See if we can find the specified directory. We use a once-only loop
+ * structure so we can bail out early.
+ */
+ if (stat(pzDir, &stBuf) != 0) do {
+ char z[AG_PATH_MAX];
+ char * dirchp;
+
+ /*
+ * IF we could not, check to see if we got a full
+ * path to a file name that has not been created yet.
+ */
+ if (errno != ENOENT) {
+ bogus_name:
+ fprintf(stderr, zsave_warn, opts->pzProgName);
+ fprintf(stderr, zNoStat, errno, strerror(errno), pzDir);
+ if (free_dir_name)
+ AGFREE((void*)pzDir);
+ return NULL;
+ }
+
+ /*
+ * Strip off the last component, stat the remaining string and
+ * that string must name a directory
+ */
+ dirchp = strrchr(pzDir, DIRCH);
+ if (dirchp == NULL) {
+ stBuf.st_mode = S_IFREG;
+ break; /* found directory -- viz., "." */
+ }
+
+ if ((size_t)(dirchp - pzDir) >= sizeof(z))
+ goto bogus_name;
+
+ memcpy(z, pzDir, (size_t)(dirchp - pzDir));
+ z[dirchp - pzDir] = NUL;
+
+ if ((stat(z, &stBuf) != 0) || ! S_ISDIR(stBuf.st_mode))
+ goto bogus_name;
+ stBuf.st_mode = S_IFREG; /* file within this directory */
+ } while (false);
+
+ /*
+ * IF what we found was a directory,
+ * THEN tack on the config file name
+ */
+ if (S_ISDIR(stBuf.st_mode)) {
+ size_t sz = strlen(pzDir) + strlen(opts->pzRcName) + 2;
+
+ {
+ char * pzPath = (char*)AGALOC(sz, "file name");
+#ifdef HAVE_SNPRINTF
+ snprintf(pzPath, sz, "%s/%s", pzDir, opts->pzRcName);
+#else
+ sprintf(pzPath, "%s/%s", pzDir, opts->pzRcName);
+#endif
+ if (free_dir_name)
+ AGFREE((void*)pzDir);
+ pzDir = pzPath;
+ free_dir_name = 1;
+ }
+
+ /*
+ * IF we cannot stat the object for any reason other than
+ * it does not exist, then we bail out
+ */
+ if (stat(pzDir, &stBuf) != 0) {
+ if (errno != ENOENT) {
+ fprintf(stderr, zsave_warn, opts->pzProgName);
+ fprintf(stderr, zNoStat, errno, strerror(errno),
+ pzDir);
+ AGFREE((void*)pzDir);
+ return NULL;
+ }
+
+ /*
+ * It does not exist yet, but it will be a regular file
+ */
+ stBuf.st_mode = S_IFREG;
+ }
+ }
+
+ /*
+ * Make sure that whatever we ultimately found, that it either is
+ * or will soon be a file.
+ */
+ if (! S_ISREG(stBuf.st_mode)) {
+ fprintf(stderr, zsave_warn, opts->pzProgName, pzDir);
+ if (free_dir_name)
+ AGFREE((void*)pzDir);
+ return NULL;
+ }
+
+ /*
+ * Get rid of the old file
+ */
+ unlink(pzDir);
+ *p_free_name = free_dir_name;
+ return pzDir;
+}
+
+/**
+ * print one option entry to the save file.
+ *
+ * @param[in] fp the file pointer for the save file
+ * @param[in] od the option descriptor to print
+ * @param[in] l_arg the last argument for the option
+ */
+static void
+prt_entry(FILE * fp, tOptDesc * od, char const * l_arg)
+{
+ int space_ct;
+
+ /*
+ * There is an argument. Pad the name so values line up.
+ * Not disabled *OR* this got equivalenced to another opt,
+ * then use current option name.
+ * Otherwise, there must be a disablement name.
+ */
+ {
+ char const * pz =
+ (! DISABLED_OPT(od) || (od->optEquivIndex != NO_EQUIVALENT))
+ ? od->pz_Name
+ : od->pz_DisableName;
+ space_ct = 17 - strlen(pz);
+ fputs(pz, fp);
+ }
+
+ if ( (l_arg == NULL)
+ && (OPTST_GET_ARGTYPE(od->fOptState) != OPARG_TYPE_NUMERIC))
+ goto end_entry;
+
+ fputs(" = ", fp);
+ while (space_ct-- > 0) fputc(' ', fp);
+
+ /*
+ * IF the option is numeric only,
+ * THEN the char pointer is really the number
+ */
+ if (OPTST_GET_ARGTYPE(od->fOptState) == OPARG_TYPE_NUMERIC)
+ fprintf(fp, "%d", (int)(t_word)l_arg);
+
+ else {
+ for (;;) {
+ char const * eol = strchr(l_arg, NL);
+
+ /*
+ * IF this is the last line
+ * THEN bail and print it
+ */
+ if (eol == NULL)
+ break;
+
+ /*
+ * Print the continuation and the text from the current line
+ */
+ (void)fwrite(l_arg, (size_t)(eol - l_arg), (size_t)1, fp);
+ l_arg = eol+1; /* advance the Last Arg pointer */
+ fputs("\\\n", fp);
+ }
+
+ /*
+ * Terminate the entry
+ */
+ fputs(l_arg, fp);
+ }
+
+end_entry:
+ fputc(NL, fp);
+}
+
+/**
+ */
+static void
+prt_value(FILE * fp, int depth, tOptDesc * pOD, tOptionValue const * ovp)
+{
+ while (--depth >= 0)
+ putc(' ', fp), putc(' ', fp);
+
+ switch (ovp->valType) {
+ default:
+ case OPARG_TYPE_NONE:
+ fprintf(fp, NULL_ATR_FMT, ovp->pzName);
+ break;
+
+ case OPARG_TYPE_STRING:
+ prt_string(fp, ovp->pzName, ovp->v.strVal);
+ break;
+
+ case OPARG_TYPE_ENUMERATION:
+ case OPARG_TYPE_MEMBERSHIP:
+ if (pOD != NULL) {
+ uint32_t opt_state = pOD->fOptState;
+ uintptr_t val = pOD->optArg.argEnum;
+ char const * typ = (ovp->valType == OPARG_TYPE_ENUMERATION)
+ ? "keyword" : "set-membership";
+
+ fprintf(fp, TYPE_ATR_FMT, ovp->pzName, typ);
+
+ /*
+ * This is a magic incantation that will convert the
+ * bit flag values back into a string suitable for printing.
+ */
+ (*(pOD->pOptProc))(OPTPROC_RETURN_VALNAME, pOD );
+ if (pOD->optArg.argString != NULL) {
+ fputs(pOD->optArg.argString, fp);
+
+ if (ovp->valType != OPARG_TYPE_ENUMERATION) {
+ /*
+ * set membership strings get allocated
+ */
+ AGFREE((void*)pOD->optArg.argString);
+ }
+ }
+
+ pOD->optArg.argEnum = val;
+ pOD->fOptState = opt_state;
+ fprintf(fp, END_XML_FMT, ovp->pzName);
+ break;
+ }
+ /* FALLTHROUGH */
+
+ case OPARG_TYPE_NUMERIC:
+ fprintf(fp, NUMB_ATR_FMT, ovp->pzName, ovp->v.longVal);
+ break;
+
+ case OPARG_TYPE_BOOLEAN:
+ fprintf(fp, BOOL_ATR_FMT, ovp->pzName,
+ ovp->v.boolVal ? "true" : "false");
+ break;
+
+ case OPARG_TYPE_HIERARCHY:
+ prt_val_list(fp, ovp->pzName, ovp->v.nestVal);
+ break;
+ }
+}
+
+/**
+ */
+static void
+prt_string(FILE * fp, char const * name, char const * pz)
+{
+ fprintf(fp, OPEN_XML_FMT, name);
+ for (;;) {
+ int ch = ((int)*(pz++)) & 0xFF;
+
+ switch (ch) {
+ case NUL: goto string_done;
+
+ case '&':
+ case '<':
+ case '>':
+#if __GNUC__ >= 4
+ case 1 ... (' ' - 1):
+ case ('~' + 1) ... 0xFF:
+#endif
+ emit_special_char(fp, ch);
+ break;
+
+ default:
+#if __GNUC__ < 4
+ if ( ((ch >= 1) && (ch <= (' ' - 1)))
+ || ((ch >= ('~' + 1)) && (ch <= 0xFF)) ) {
+ emit_special_char(fp, ch);
+ break;
+ }
+#endif
+ putc(ch, fp);
+ }
+ } string_done:;
+ fprintf(fp, END_XML_FMT, name);
+}
+
+/**
+ */
+static void
+prt_val_list(FILE * fp, char const * name, tArgList * al)
+{
+ static int depth = 1;
+
+ int sp_ct;
+ int opt_ct;
+ void ** opt_list;
+
+ if (al == NULL)
+ return;
+ opt_ct = al->useCt;
+ opt_list = (void **)al->apzArgs;
+
+ if (opt_ct <= 0) {
+ fprintf(fp, OPEN_CLOSE_FMT, name);
+ return;
+ }
+
+ fprintf(fp, NESTED_OPT_FMT, name);
+
+ depth++;
+ while (--opt_ct >= 0) {
+ tOptionValue const * ovp = *(opt_list++);
+
+ prt_value(fp, depth, NULL, ovp);
+ }
+ depth--;
+
+ for (sp_ct = depth; --sp_ct >= 0;)
+ putc(' ', fp), putc(' ', fp);
+ fprintf(fp, "</%s>\n", name);
+}
+
+/**
+ */
+static void
+prt_nested(FILE * fp, tOptDesc * p)
+{
+ int opt_ct;
+ tArgList * al = p->optCookie;
+ void ** opt_list;
+
+ if (al == NULL)
+ return;
+
+ opt_ct = al->useCt;
+ opt_list = (void **)al->apzArgs;
+
+ if (opt_ct <= 0)
+ return;
+
+ do {
+ tOptionValue const * base = *(opt_list++);
+ tOptionValue const * ovp = optionGetValue(base, NULL);
+
+ if (ovp == NULL)
+ continue;
+
+ fprintf(fp, NESTED_OPT_FMT, p->pz_Name);
+
+ do {
+ prt_value(fp, 1, p, ovp);
+
+ } while (ovp = optionNextValue(base, ovp),
+ ovp != NULL);
+
+ fprintf(fp, "</%s>\n", p->pz_Name);
+ } while (--opt_ct > 0);
+}
+
+/**
+ * open the file for saving option state.
+ *
+ * @param[in] opts the program options structure
+ * @returns the open file pointer. It may be NULL.
+ */
+static FILE *
+open_sv_file(tOptions * opts)
+{
+ FILE * fp;
+
+ {
+ int free_name = 0;
+ char const * pzFName = find_file_name(opts, &free_name);
+ if (pzFName == NULL)
+ return NULL;
+
+ fp = fopen(pzFName, "w" FOPEN_BINARY_FLAG);
+ if (fp == NULL) {
+ fprintf(stderr, zsave_warn, opts->pzProgName);
+ fprintf(stderr, zNoCreat, errno, strerror(errno), pzFName);
+ if (free_name)
+ AGFREE((void*) pzFName );
+ return fp;
+ }
+
+ if (free_name)
+ AGFREE((void*)pzFName);
+ }
+
+ fputs("# ", fp);
+ {
+ char const * e = strchr(opts->pzUsageTitle, NL);
+ if (e++ != NULL)
+ fwrite(opts->pzUsageTitle, 1, e - opts->pzUsageTitle, fp);
+ }
+
+ {
+ time_t cur_time = time(NULL);
+ char * time_str = ctime(&cur_time);
+
+ fprintf(fp, zPresetFile, time_str);
+#ifdef HAVE_ALLOCATED_CTIME
+ /*
+ * The return values for ctime(), localtime(), and gmtime()
+ * normally point to static data that is overwritten by each call.
+ * The test to detect allocated ctime, so we leak the memory.
+ */
+ AGFREE((void*)time_str);
+#endif
+ }
+
+ return fp;
+}
+
+/**
+ */
+static void
+prt_no_arg_opt(FILE * fp, tOptDesc * p, tOptDesc * pOD)
+{
+ /*
+ * The aliased to argument indicates whether or not the option
+ * is "disabled". However, the original option has the name
+ * string, so we get that there, not with "p".
+ */
+ char const * pznm =
+ (DISABLED_OPT(p)) ? pOD->pz_DisableName : pOD->pz_Name;
+ /*
+ * If the option was disabled and the disablement name is NULL,
+ * then the disablement was caused by aliasing.
+ * Use the name as the string to emit.
+ */
+ if (pznm == NULL)
+ pznm = pOD->pz_Name;
+
+ fprintf(fp, "%s\n", pznm);
+}
+
+/**
+ */
+static void
+prt_str_arg(FILE * fp, tOptDesc * pOD)
+{
+ if (pOD->fOptState & OPTST_STACKED) {
+ tArgList * pAL = (tArgList*)pOD->optCookie;
+ int uct = pAL->useCt;
+ char const ** ppz = pAL->apzArgs;
+
+ /*
+ * un-disable multiple copies of disabled options.
+ */
+ if (uct > 1)
+ pOD->fOptState &= ~OPTST_DISABLED;
+
+ while (uct-- > 0)
+ prt_entry(fp, pOD, *(ppz++));
+ } else {
+ prt_entry(fp, pOD, pOD->optArg.argString);
+ }
+}
+
+/**
+ * print the string value of an enumeration.
+ *
+ * @param[in] fp the file pointer to write to
+ * @param[in] od the option descriptor with the enumerated value
+ */
+static void
+prt_enum_arg(FILE * fp, tOptDesc * od)
+{
+ uintptr_t val = od->optArg.argEnum;
+
+ /*
+ * This is a magic incantation that will convert the
+ * bit flag values back into a string suitable for printing.
+ */
+ (*(od->pOptProc))(OPTPROC_RETURN_VALNAME, od);
+ prt_entry(fp, od, (void*)(od->optArg.argString));
+
+ od->optArg.argEnum = val;
+}
+
+/**
+ * Print the bits set in a bit mask option.
+ * We call the option handling function with a magic value for
+ * the options pointer and it allocates and fills in the string.
+ * We print that with a call to prt_entry().
+ *
+ * @param[in] fp the file pointer to write to
+ * @param[in] od the option descriptor with a bit mask value type
+ */
+static void
+prt_set_arg(FILE * fp, tOptDesc * od)
+{
+ char * list = optionMemberList(od);
+ size_t len = strlen(list);
+ char * buf = (char *)AGALOC(len + 3, "dir name");
+ *buf= '=';
+ memcpy(buf+1, list, len + 1);
+ prt_entry(fp, od, buf);
+ AGFREE(buf);
+ AGFREE(list);
+}
+
+/**
+ * figure out what the option file name argument is.
+ * If one can be found, call prt_entry() to emit it.
+ *
+ * @param[in] fp the file pointer to write to.
+ * @param[in] od the option descriptor with a bit mask value type
+ * @param[in] opts the program options descriptor
+ */
+static void
+prt_file_arg(FILE * fp, tOptDesc * od, tOptions * opts)
+{
+ /*
+ * If the cookie is not NULL, then it has the file name, period.
+ * Otherwise, if we have a non-NULL string argument, then....
+ */
+ if (od->optCookie != NULL)
+ prt_entry(fp, od, od->optCookie);
+
+ else if (HAS_originalOptArgArray(opts)) {
+ char const * orig =
+ opts->originalOptArgArray[od->optIndex].argString;
+
+ if (od->optArg.argString == orig)
+ return;
+
+ prt_entry(fp, od, od->optArg.argString);
+ }
+}
+
+/*=export_func optionSaveFile
+ *
+ * what: saves the option state to a file
+ *
+ * arg: tOptions*, opts, program options descriptor
+ *
+ * doc:
+ *
+ * This routine will save the state of option processing to a file. The name
+ * of that file can be specified with the argument to the @code{--save-opts}
+ * option, or by appending the @code{rcfile} attribute to the last
+ * @code{homerc} attribute. If no @code{rcfile} attribute was specified, it
+ * will default to @code{.@i{programname}rc}. If you wish to specify another
+ * file, you should invoke the @code{SET_OPT_SAVE_OPTS(@i{filename})} macro.
+ *
+ * The recommend usage is as follows:
+ * @example
+ * optionProcess(&progOptions, argc, argv);
+ * if (i_want_a_non_standard_place_for_this)
+ * SET_OPT_SAVE_OPTS("myfilename");
+ * optionSaveFile(&progOptions);
+ * @end example
+ *
+ * err:
+ *
+ * If no @code{homerc} file was specified, this routine will silently return
+ * and do nothing. If the output file cannot be created or updated, a message
+ * will be printed to @code{stderr} and the routine will return.
+=*/
+void
+optionSaveFile(tOptions * opts)
+{
+ tOptDesc * od;
+ int ct;
+ FILE * fp = open_sv_file(opts);
+
+ if (fp == NULL)
+ return;
+
+ /*
+ * FOR each of the defined options, ...
+ */
+ ct = opts->presetOptCt;
+ od = opts->pOptDesc;
+ do {
+ tOptDesc * p;
+
+ /*
+ * IF the option has not been defined
+ * OR it does not take an initialization value
+ * OR it is equivalenced to another option
+ * THEN continue (ignore it)
+ *
+ * Equivalenced options get picked up when the equivalenced-to
+ * option is processed.
+ */
+ if (UNUSED_OPT(od))
+ continue;
+
+ if ((od->fOptState & OPTST_DO_NOT_SAVE_MASK) != 0)
+ continue;
+
+ if ( (od->optEquivIndex != NO_EQUIVALENT)
+ && (od->optEquivIndex != od->optIndex))
+ continue;
+
+ /*
+ * The option argument data are found at the equivalenced-to option,
+ * but the actual option argument type comes from the original
+ * option descriptor. Be careful!
+ */
+ p = ((od->fOptState & OPTST_EQUIVALENCE) != 0)
+ ? (opts->pOptDesc + od->optActualIndex) : od;
+
+ switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_NONE:
+ prt_no_arg_opt(fp, p, od);
+ break;
+
+ case OPARG_TYPE_NUMERIC:
+ prt_entry(fp, p, (void*)(p->optArg.argInt));
+ break;
+
+ case OPARG_TYPE_STRING:
+ prt_str_arg(fp, p);
+ break;
+
+ case OPARG_TYPE_ENUMERATION:
+ prt_enum_arg(fp, p);
+ break;
+
+ case OPARG_TYPE_MEMBERSHIP:
+ prt_set_arg(fp, p);
+ break;
+
+ case OPARG_TYPE_BOOLEAN:
+ prt_entry(fp, p, p->optArg.argBool ? "true" : "false");
+ break;
+
+ case OPARG_TYPE_HIERARCHY:
+ prt_nested(fp, p);
+ break;
+
+ case OPARG_TYPE_FILE:
+ prt_file_arg(fp, p, opts);
+ break;
+
+ default:
+ break; /* cannot handle - skip it */
+ }
+ } while (od++, (--ct > 0));
+
+ fclose(fp);
+}
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/save.c */
diff --git a/sntp/libopts/sort.c b/sntp/libopts/sort.c
new file mode 100644
index 0000000..894d0ec
--- /dev/null
+++ b/sntp/libopts/sort.c
@@ -0,0 +1,340 @@
+
+/*
+ * \file sort.c
+ *
+ * This module implements argument sorting.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static tSuccess
+must_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
+ char ** opt_txt, uint32_t * opt_idx);
+
+static tSuccess
+maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
+ char ** opt_txt, uint32_t * opt_idx);
+
+static tSuccess
+short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS,
+ char ** opt_txt, uint32_t * opt_idx);
+/* = = = END-STATIC-FORWARD = = = */
+
+/*
+ * "must_arg" and "maybe_arg" are really similar. The biggest
+ * difference is that "may" will consume the next argument only if it
+ * does not start with a hyphen and "must" will consume it, hyphen or not.
+ */
+static tSuccess
+must_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
+ char ** opt_txt, uint32_t * opt_idx)
+{
+ /*
+ * An option argument is required. Long options can either have
+ * a separate command line argument, or an argument attached by
+ * the '=' character. Figure out which.
+ */
+ switch (pOS->optType) {
+ case TOPT_SHORT:
+ /*
+ * See if an arg string follows the flag character. If not,
+ * the next arg must be the option argument.
+ */
+ if (*arg_txt != NUL)
+ return SUCCESS;
+ break;
+
+ case TOPT_LONG:
+ /*
+ * See if an arg string has already been assigned (glued on
+ * with an `=' character). If not, the next is the opt arg.
+ */
+ if (pOS->pzOptArg != NULL)
+ return SUCCESS;
+ break;
+
+ default:
+ return FAILURE;
+ }
+ if (opts->curOptIdx >= opts->origArgCt)
+ return FAILURE;
+
+ opt_txt[ (*opt_idx)++ ] = opts->origArgVect[ (opts->curOptIdx)++ ];
+ return SUCCESS;
+}
+
+static tSuccess
+maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS,
+ char ** opt_txt, uint32_t * opt_idx)
+{
+ /*
+ * An option argument is optional.
+ */
+ switch (pOS->optType) {
+ case TOPT_SHORT:
+ /*
+ * IF nothing is glued on after the current flag character,
+ * THEN see if there is another argument. If so and if it
+ * does *NOT* start with a hyphen, then it is the option arg.
+ */
+ if (*arg_txt != NUL)
+ return SUCCESS;
+ break;
+
+ case TOPT_LONG:
+ /*
+ * Look for an argument if we don't already have one (glued on
+ * with a `=' character)
+ */
+ if (pOS->pzOptArg != NULL)
+ return SUCCESS;
+ break;
+
+ default:
+ return FAILURE;
+ }
+ if (opts->curOptIdx >= opts->origArgCt)
+ return PROBLEM;
+
+ arg_txt = opts->origArgVect[ opts->curOptIdx ];
+ if (*arg_txt != '-')
+ opt_txt[ (*opt_idx)++ ] = opts->origArgVect[ (opts->curOptIdx)++ ];
+ return SUCCESS;
+}
+
+/*
+ * Process a string of short options glued together. If the last one
+ * does or may take an argument, the do the argument processing and leave.
+ */
+static tSuccess
+short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS,
+ char ** opt_txt, uint32_t * opt_idx)
+{
+ while (*arg_txt != NUL) {
+ if (FAILED(opt_find_short(opts, (uint8_t)*arg_txt, pOS)))
+ return FAILURE;
+
+ /*
+ * See if we can have an arg.
+ */
+ if (OPTST_GET_ARGTYPE(pOS->pOD->fOptState) == OPARG_TYPE_NONE) {
+ arg_txt++;
+
+ } else if (pOS->pOD->fOptState & OPTST_ARG_OPTIONAL) {
+ /*
+ * Take an argument if it is not attached and it does not
+ * start with a hyphen.
+ */
+ if (arg_txt[1] != NUL)
+ return SUCCESS;
+
+ arg_txt = opts->origArgVect[ opts->curOptIdx ];
+ if (*arg_txt != '-')
+ opt_txt[ (*opt_idx)++ ] =
+ opts->origArgVect[ (opts->curOptIdx)++ ];
+ return SUCCESS;
+
+ } else {
+ /*
+ * IF we need another argument, be sure it is there and
+ * take it.
+ */
+ if (arg_txt[1] == NUL) {
+ if (opts->curOptIdx >= opts->origArgCt)
+ return FAILURE;
+ opt_txt[ (*opt_idx)++ ] =
+ opts->origArgVect[ (opts->curOptIdx)++ ];
+ }
+ return SUCCESS;
+ }
+ }
+ return SUCCESS;
+}
+
+/*
+ * If the program wants sorted options (separated operands and options),
+ * then this routine will to the trick.
+ */
+LOCAL void
+optionSort(tOptions * opts)
+{
+ char ** opt_txt;
+ char ** ppzOpds;
+ uint32_t optsIdx = 0;
+ uint32_t opdsIdx = 0;
+
+ tOptState os = OPTSTATE_INITIALIZER(DEFINED);
+
+ /*
+ * Disable for POSIX conformance, or if there are no operands.
+ */
+ if ( (getenv("POSIXLY_CORRECT") != NULL)
+ || NAMED_OPTS(opts))
+ return;
+
+ /*
+ * Make sure we can allocate two full-sized arg vectors.
+ */
+ opt_txt = malloc(opts->origArgCt * sizeof(char*));
+ if (opt_txt == NULL)
+ goto exit_no_mem;
+
+ ppzOpds = malloc(opts->origArgCt * sizeof(char*));
+ if (ppzOpds == NULL) {
+ free(opt_txt);
+ goto exit_no_mem;
+ }
+
+ opts->curOptIdx = 1;
+ opts->pzCurOpt = NULL;
+
+ /*
+ * Now, process all the options from our current position onward.
+ * (This allows interspersed options and arguments for the few
+ * non-standard programs that require it.)
+ */
+ for (;;) {
+ char * arg_txt;
+ tSuccess res;
+
+ /*
+ * If we're out of arguments, we're done. Join the option and
+ * operand lists into the original argument vector.
+ */
+ if (opts->curOptIdx >= opts->origArgCt) {
+ errno = 0;
+ goto joinLists;
+ }
+
+ arg_txt = opts->origArgVect[ opts->curOptIdx ];
+ if (*arg_txt != '-') {
+ ppzOpds[ opdsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ];
+ continue;
+ }
+
+ switch (arg_txt[1]) {
+ case NUL:
+ /*
+ * A single hyphen is an operand.
+ */
+ ppzOpds[ opdsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ];
+ continue;
+
+ case '-':
+ /*
+ * Two consecutive hypens. Put them on the options list and then
+ * _always_ force the remainder of the arguments to be operands.
+ */
+ if (arg_txt[2] == NUL) {
+ opt_txt[ optsIdx++ ] =
+ opts->origArgVect[ (opts->curOptIdx)++ ];
+ goto restOperands;
+ }
+ res = opt_find_long(opts, arg_txt+2, &os);
+ break;
+
+ default:
+ /*
+ * If short options are not allowed, then do long
+ * option processing. Otherwise the character must be a
+ * short (i.e. single character) option.
+ */
+ if ((opts->fOptSet & OPTPROC_SHORTOPT) == 0) {
+ res = opt_find_long(opts, arg_txt+1, &os);
+ } else {
+ res = opt_find_short(opts, (uint8_t)arg_txt[1], &os);
+ }
+ break;
+ }
+ if (FAILED(res)) {
+ errno = EINVAL;
+ goto freeTemps;
+ }
+
+ /*
+ * We've found an option. Add the argument to the option list.
+ * Next, we have to see if we need to pull another argument to be
+ * used as the option argument.
+ */
+ opt_txt[ optsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ];
+
+ if (OPTST_GET_ARGTYPE(os.pOD->fOptState) == OPARG_TYPE_NONE) {
+ /*
+ * No option argument. If we have a short option here,
+ * then scan for short options until we get to the end
+ * of the argument string.
+ */
+ if ( (os.optType == TOPT_SHORT)
+ && FAILED(short_opt_ck(opts, arg_txt+2, &os, opt_txt,
+ &optsIdx)) ) {
+ errno = EINVAL;
+ goto freeTemps;
+ }
+
+ } else if (os.pOD->fOptState & OPTST_ARG_OPTIONAL) {
+ switch (maybe_arg(opts, arg_txt+2, &os, opt_txt, &optsIdx)) {
+ case FAILURE: errno = EIO; goto freeTemps;
+ case PROBLEM: errno = 0; goto joinLists;
+ }
+
+ } else {
+ switch (must_arg(opts, arg_txt+2, &os, opt_txt, &optsIdx)) {
+ case PROBLEM:
+ case FAILURE: errno = EIO; goto freeTemps;
+ }
+ }
+ } /* for (;;) */
+
+ restOperands:
+ while (opts->curOptIdx < opts->origArgCt)
+ ppzOpds[ opdsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ];
+
+ joinLists:
+ if (optsIdx > 0)
+ memcpy(opts->origArgVect + 1, opt_txt,
+ (size_t)optsIdx * sizeof(char*));
+ if (opdsIdx > 0)
+ memcpy(opts->origArgVect + 1 + optsIdx, ppzOpds,
+ (size_t)opdsIdx * sizeof(char*));
+
+ freeTemps:
+ free(opt_txt);
+ free(ppzOpds);
+ return;
+
+ exit_no_mem:
+ errno = ENOMEM;
+ return;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/sort.c */
diff --git a/sntp/libopts/stack.c b/sntp/libopts/stack.c
new file mode 100644
index 0000000..d2ce165
--- /dev/null
+++ b/sntp/libopts/stack.c
@@ -0,0 +1,267 @@
+
+/**
+ * \file stack.c
+ *
+ * This is a special option processing routine that will save the
+ * argument to an option in a FIFO queue.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+#ifdef WITH_LIBREGEX
+# include REGEX_HEADER
+#endif
+
+/*=export_func optionUnstackArg
+ * private:
+ *
+ * what: Remove option args from a stack
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * Invoked for options that are equivalenced to stacked options.
+=*/
+void
+optionUnstackArg(tOptions * opts, tOptDesc * od)
+{
+ tArgList * arg_list;
+
+ if (INQUERY_CALL(opts, od))
+ return;
+
+ arg_list = (tArgList*)od->optCookie;
+
+ /*
+ * IF we don't have any stacked options,
+ * THEN indicate that we don't have any of these options
+ */
+ if (arg_list == NULL) {
+ od->fOptState &= OPTST_PERSISTENT_MASK;
+ if ((od->fOptState & OPTST_INITENABLED) == 0)
+ od->fOptState |= OPTST_DISABLED;
+ return;
+ }
+
+#ifdef WITH_LIBREGEX
+ {
+ regex_t re;
+ int i, ct, dIdx;
+
+ if (regcomp(&re, od->optArg.argString, REG_NOSUB) != 0)
+ return;
+
+ /*
+ * search the list for the entry(s) to remove. Entries that
+ * are removed are *not* copied into the result. The source
+ * index is incremented every time. The destination only when
+ * we are keeping a define.
+ */
+ for (i = 0, dIdx = 0, ct = arg_list->useCt; --ct >= 0; i++) {
+ char const * pzSrc = arg_list->apzArgs[ i ];
+ char * pzEq = strchr(pzSrc, '=');
+ int res;
+
+
+ if (pzEq != NULL)
+ *pzEq = NUL;
+
+ res = regexec(&re, pzSrc, (size_t)0, NULL, 0);
+ switch (res) {
+ case 0:
+ /*
+ * Remove this entry by reducing the in-use count
+ * and *not* putting the string pointer back into
+ * the list.
+ */
+ AGFREE(pzSrc);
+ arg_list->useCt--;
+ break;
+
+ default:
+ case REG_NOMATCH:
+ if (pzEq != NULL)
+ *pzEq = '=';
+
+ /*
+ * IF we have dropped an entry
+ * THEN we have to move the current one.
+ */
+ if (dIdx != i)
+ arg_list->apzArgs[ dIdx ] = pzSrc;
+ dIdx++;
+ }
+ }
+
+ regfree(&re);
+ }
+#else /* not WITH_LIBREGEX */
+ {
+ int i, ct, dIdx;
+
+ /*
+ * search the list for the entry(s) to remove. Entries that
+ * are removed are *not* copied into the result. The source
+ * index is incremented every time. The destination only when
+ * we are keeping a define.
+ */
+ for (i = 0, dIdx = 0, ct = arg_list->useCt; --ct >= 0; i++) {
+ const char * pzSrc = arg_list->apzArgs[ i ];
+ char * pzEq = strchr(pzSrc, '=');
+
+ if (pzEq != NULL)
+ *pzEq = NUL;
+
+ if (strcmp(pzSrc, od->optArg.argString) == 0) {
+ /*
+ * Remove this entry by reducing the in-use count
+ * and *not* putting the string pointer back into
+ * the list.
+ */
+ AGFREE(pzSrc);
+ arg_list->useCt--;
+ } else {
+ if (pzEq != NULL)
+ *pzEq = '=';
+
+ /*
+ * IF we have dropped an entry
+ * THEN we have to move the current one.
+ */
+ if (dIdx != i)
+ arg_list->apzArgs[ dIdx ] = pzSrc;
+ dIdx++;
+ }
+ }
+ }
+#endif /* WITH_LIBREGEX */
+ /*
+ * IF we have unstacked everything,
+ * THEN indicate that we don't have any of these options
+ */
+ if (arg_list->useCt == 0) {
+ od->fOptState &= OPTST_PERSISTENT_MASK;
+ if ((od->fOptState & OPTST_INITENABLED) == 0)
+ od->fOptState |= OPTST_DISABLED;
+ AGFREE((void *)arg_list);
+ od->optCookie = NULL;
+ }
+}
+
+
+/*
+ * Put an entry into an argument list. The first argument points to
+ * a pointer to the argument list structure. It gets passed around
+ * as an opaque address.
+ */
+LOCAL void
+addArgListEntry(void ** ppAL, void * entry)
+{
+ tArgList* pAL = *(void**)ppAL;
+
+ /*
+ * IF we have never allocated one of these,
+ * THEN allocate one now
+ */
+ if (pAL == NULL) {
+ pAL = (tArgList*)AGALOC(sizeof(*pAL), "new option arg stack");
+ if (pAL == NULL)
+ return;
+ pAL->useCt = 0;
+ pAL->allocCt = MIN_ARG_ALLOC_CT;
+ *ppAL = (void*)pAL;
+ }
+
+ /*
+ * ELSE if we are out of room
+ * THEN make it bigger
+ */
+ else if (pAL->useCt >= pAL->allocCt) {
+ size_t sz = sizeof(*pAL);
+ pAL->allocCt += INCR_ARG_ALLOC_CT;
+
+ /*
+ * The base structure contains space for MIN_ARG_ALLOC_CT
+ * pointers. We subtract it off to find our augment size.
+ */
+ sz += sizeof(char*) * ((size_t)pAL->allocCt - MIN_ARG_ALLOC_CT);
+ pAL = (tArgList*)AGREALOC((void*)pAL, sz, "expanded opt arg stack");
+ if (pAL == NULL)
+ return;
+ *ppAL = (void*)pAL;
+ }
+
+ /*
+ * Insert the new argument into the list
+ */
+ pAL->apzArgs[ (pAL->useCt)++ ] = entry;
+}
+
+
+/*=export_func optionStackArg
+ * private:
+ *
+ * what: put option args on a stack
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * Keep an entry-ordered list of option arguments.
+=*/
+void
+optionStackArg(tOptions * opts, tOptDesc * od)
+{
+ char * pz;
+
+ if (INQUERY_CALL(opts, od))
+ return;
+
+ if ((od->fOptState & OPTST_RESET) != 0) {
+ tArgList * arg_list = (void*)od->optCookie;
+ int ix;
+ if (arg_list == NULL)
+ return;
+
+ ix = arg_list->useCt;
+ while (--ix >= 0)
+ AGFREE(arg_list->apzArgs[ix]);
+ AGFREE(arg_list);
+
+ } else {
+ if (od->optArg.argString == NULL)
+ return;
+
+ AGDUPSTR(pz, od->optArg.argString, "stack arg");
+ addArgListEntry(&(od->optCookie), (void*)pz);
+ }
+}
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/stack.c */
diff --git a/sntp/libopts/stdnoreturn.in.h b/sntp/libopts/stdnoreturn.in.h
new file mode 100644
index 0000000..d4ae183
--- /dev/null
+++ b/sntp/libopts/stdnoreturn.in.h
@@ -0,0 +1,50 @@
+/* A substitute for ISO C11 <stdnoreturn.h>.
+
+ Copyright 2012-2014 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef noreturn
+
+/* ISO C11 <stdnoreturn.h> for platforms that lack it.
+
+ References:
+ ISO C11 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
+ section 7.23 */
+
+/* The definition of _Noreturn is copied here. */
+
+#if 1200 <= _MSC_VER
+/* Standard include files on this platform contain declarations like
+ "__declspec (noreturn) void abort (void);". "#define noreturn
+ _Noreturn" would cause this declaration to be rewritten to the
+ invalid "__declspec (__declspec (noreturn)) void abort (void);".
+ Instead, define noreturn to empty, so that such declarations are
+ rewritten to "__declspec () void abort (void);", which is
+ equivalent to "void abort (void);"; this gives up on noreturn's
+ advice to the compiler but at least it is valid code. */
+# define noreturn /*empty*/
+#else
+# define noreturn _Noreturn
+#endif
+
+/* Did he ever return?
+ No he never returned
+ And his fate is still unlearn'd ...
+ -- Steiner J, Hawes BL. M.T.A. (1949) */
+
+#endif /* noreturn */
diff --git a/sntp/libopts/streqvcmp.c b/sntp/libopts/streqvcmp.c
new file mode 100644
index 0000000..371d7f4
--- /dev/null
+++ b/sntp/libopts/streqvcmp.c
@@ -0,0 +1,284 @@
+
+/**
+ * \file streqvcmp.c
+ *
+ * String Equivalence Comparison
+ *
+ * These routines allow any character to be mapped to any other
+ * character before comparison. In processing long option names,
+ * the characters "-", "_" and "^" all need to be equivalent
+ * (because they are treated so by different development environments).
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ *
+ * This array is designed for mapping upper and lower case letter
+ * together for a case independent comparison. The mappings are
+ * based upon ascii character sequences.
+ */
+static unsigned char charmap[] = {
+ NUL, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, '\a',
+ '\b', '\t', NL, '\v', '\f', '\r', 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+
+ ' ', '!', '"', '#', '$', '%', '&', '\'',
+ '(', ')', '*', '+', ',', '-', '.', '/',
+ '0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', ':', ';', '<', '=', '>', '?',
+
+ '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
+ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
+ 'x', 'y', 'z', '[', '\\', ']', '^', '_',
+ '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
+ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
+ 'x', 'y', 'z', '{', '|', '}', '~', 0x7f,
+
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
+ 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
+ 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
+ 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
+ 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
+
+ 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
+ 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
+ 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
+ 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
+ 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
+ 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
+ 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
+ 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
+};
+
+
+/*=export_func strneqvcmp
+ *
+ * what: compare two strings with an equivalence mapping
+ *
+ * arg: + char const* + str1 + first string +
+ * arg: + char const* + str2 + second string +
+ * arg: + int + ct + compare length +
+ *
+ * ret_type: int
+ * ret_desc: the difference between two differing characters
+ *
+ * doc:
+ *
+ * Using a character mapping, two strings are compared for "equivalence".
+ * Each input character is mapped to a comparison character and the
+ * mapped-to characters are compared for the two NUL terminated input strings.
+ * The comparison is limited to @code{ct} bytes.
+ * This function name is mapped to option_strneqvcmp so as to not conflict
+ * with the POSIX name space.
+ *
+ * err: none checked. Caller responsible for seg faults.
+=*/
+int
+strneqvcmp(char const * s1, char const * s2, int ct)
+{
+ for (; ct > 0; --ct) {
+ unsigned char u1 = (unsigned char) *s1++;
+ unsigned char u2 = (unsigned char) *s2++;
+ int dif;
+ if (u1 == u2) {
+ if (u1 == NUL)
+ return 0;
+ continue;
+ }
+
+ dif = charmap[ u1 ] - charmap[ u2 ];
+
+ if (dif != 0)
+ return dif;
+
+ if (u1 == NUL)
+ return 0;
+ }
+
+ return 0;
+}
+
+
+/*=export_func streqvcmp
+ *
+ * what: compare two strings with an equivalence mapping
+ *
+ * arg: + char const* + str1 + first string +
+ * arg: + char const* + str2 + second string +
+ *
+ * ret_type: int
+ * ret_desc: the difference between two differing characters
+ *
+ * doc:
+ *
+ * Using a character mapping, two strings are compared for "equivalence".
+ * Each input character is mapped to a comparison character and the
+ * mapped-to characters are compared for the two NUL terminated input strings.
+ * This function name is mapped to option_streqvcmp so as to not conflict
+ * with the POSIX name space.
+ *
+ * err: none checked. Caller responsible for seg faults.
+=*/
+int
+streqvcmp(char const * s1, char const * s2)
+{
+ for (;;) {
+ unsigned char u1 = (unsigned char) *s1++;
+ unsigned char u2 = (unsigned char) *s2++;
+ int dif;
+ if (u1 == u2) {
+ if (u1 == NUL)
+ return 0;
+ continue;
+ }
+
+ dif = charmap[ u1 ] - charmap[ u2 ];
+
+ if (dif != 0)
+ return dif;
+
+ if (u1 == NUL)
+ return 0;
+ }
+}
+
+
+/*=export_func streqvmap
+ *
+ * what: Set the character mappings for the streqv functions
+ *
+ * arg: + char + from + Input character +
+ * arg: + char + to + Mapped-to character +
+ * arg: + int + ct + compare length +
+ *
+ * doc:
+ *
+ * Set the character mapping. If the count (@code{ct}) is set to zero, then
+ * the map is cleared by setting all entries in the map to their index
+ * value. Otherwise, the "@code{From}" character is mapped to the "@code{To}"
+ * character. If @code{ct} is greater than 1, then @code{From} and @code{To}
+ * are incremented and the process repeated until @code{ct} entries have been
+ * set. For example,
+ * @example
+ * streqvmap('a', 'A', 26);
+ * @end example
+ * @noindent
+ * will alter the mapping so that all English lower case letters
+ * will map to upper case.
+ *
+ * This function name is mapped to option_streqvmap so as to not conflict
+ * with the POSIX name space.
+ *
+ * err: none.
+=*/
+void
+streqvmap(char from, char to, int ct)
+{
+ if (ct == 0) {
+ ct = sizeof(charmap) - 1;
+ do {
+ charmap[ct] = (unsigned char)ct;
+ } while (--ct >= 0);
+ }
+
+ else {
+ unsigned int i_to = (int)to & 0xFF;
+ unsigned int i_from = (int)from & 0xFF;
+
+ do {
+ charmap[i_from] = (unsigned char)i_to;
+ i_from++;
+ i_to++;
+ if ((i_from >= sizeof(charmap)) || (i_to >= sizeof(charmap)))
+ break;
+ } while (--ct > 0);
+ }
+}
+
+
+/*=export_func strequate
+ *
+ * what: map a list of characters to the same value
+ *
+ * arg: + char const* + ch_list + characters to equivalence +
+ *
+ * doc:
+ *
+ * Each character in the input string get mapped to the first character
+ * in the string.
+ * This function name is mapped to option_strequate so as to not conflict
+ * with the POSIX name space.
+ *
+ * err: none.
+=*/
+void
+strequate(char const* s)
+{
+ if ((s != NULL) && (*s != NUL)) {
+ unsigned char equiv = (unsigned char)*s;
+ while (*s != NUL)
+ charmap[(unsigned char)*(s++)] = equiv;
+ }
+}
+
+
+/*=export_func strtransform
+ *
+ * what: convert a string into its mapped-to value
+ *
+ * arg: + char* + dest + output string +
+ * arg: + char const* + src + input string +
+ *
+ * doc:
+ *
+ * Each character in the input string is mapped and the mapped-to
+ * character is put into the output.
+ * This function name is mapped to option_strtransform so as to not conflict
+ * with the POSIX name space.
+ *
+ * The source and destination may be the same.
+ *
+ * err: none.
+=*/
+void
+strtransform(char* d, char const* s)
+{
+ do {
+ *(d++) = (char)charmap[(unsigned char)*s];
+ } while (*(s++) != NUL);
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/streqvcmp.c */
diff --git a/sntp/libopts/text_mmap.c b/sntp/libopts/text_mmap.c
new file mode 100644
index 0000000..f30e71c
--- /dev/null
+++ b/sntp/libopts/text_mmap.c
@@ -0,0 +1,379 @@
+/**
+ * @file text_mmap.c
+ *
+ * Map a text file, ensuring the text always has an ending NUL byte.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+#if defined(HAVE_MMAP)
+# ifndef MAP_ANONYMOUS
+# ifdef MAP_ANON
+# define MAP_ANONYMOUS MAP_ANON
+# endif
+# endif
+
+# if ! defined(MAP_ANONYMOUS) && ! defined(HAVE_DEV_ZERO)
+ /*
+ * We must have either /dev/zero or anonymous mapping for
+ * this to work.
+ */
+# undef HAVE_MMAP
+
+# else
+# ifdef _SC_PAGESIZE
+# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
+# else
+# define GETPAGESIZE() getpagesize()
+# endif
+# endif
+#endif
+
+/*
+ * Some weird systems require that a specifically invalid FD number
+ * get passed in as an argument value. Which value is that? Well,
+ * as everybody knows, if open(2) fails, it returns -1, so that must
+ * be the value. :)
+ */
+#define AO_INVALID_FD -1
+
+#define FILE_WRITABLE(_prt,_flg) \
+ ( (_prt & PROT_WRITE) \
+ && ((_flg & (MAP_SHARED|MAP_PRIVATE)) == MAP_SHARED))
+#define MAP_FAILED_PTR ((void*)MAP_FAILED)
+
+/**
+ * Load the contents of a text file. There are two separate implementations,
+ * depending up on whether mmap(3) is available.
+ *
+ * If not available, malloc the file length plus one byte. Read it in
+ * and NUL terminate.
+ *
+ * If available, first check to see if the text file size is a multiple of a
+ * page size. If it is, map the file size plus an extra page from either
+ * anonymous memory or from /dev/zero. Then map the file text on top of the
+ * first pages of the anonymous/zero pages. Otherwise, just map the file
+ * because there will be NUL bytes provided at the end.
+ *
+ * @param mapinfo a structure holding everything we need to know
+ * about the mapping.
+ *
+ * @param pzFile name of the file, for error reporting.
+ */
+static void
+load_text_file(tmap_info_t * mapinfo, char const * pzFile)
+{
+#if ! defined(HAVE_MMAP)
+ mapinfo->txt_data = AGALOC(mapinfo->txt_size+1, "file text");
+ if (mapinfo->txt_data == NULL) {
+ mapinfo->txt_errno = ENOMEM;
+ return;
+ }
+
+ {
+ size_t sz = mapinfo->txt_size;
+ char* pz = mapinfo->txt_data;
+
+ while (sz > 0) {
+ ssize_t rdct = read(mapinfo->txt_fd, pz, sz);
+ if (rdct <= 0) {
+ mapinfo->txt_errno = errno;
+ fserr_warn("libopts", "read", pzFile);
+ free(mapinfo->txt_data);
+ return;
+ }
+
+ pz += rdct;
+ sz -= rdct;
+ }
+
+ *pz = NUL;
+ }
+
+ mapinfo->txt_errno = 0;
+
+#else /* HAVE mmap */
+ size_t const pgsz = (size_t)GETPAGESIZE();
+ void * map_addr = NULL;
+
+ (void)pzFile;
+
+ mapinfo->txt_full_size = (mapinfo->txt_size + pgsz) & ~(pgsz - 1);
+ if (mapinfo->txt_full_size == (mapinfo->txt_size + pgsz)) {
+ /*
+ * The text is a multiple of a page boundary. We must map an
+ * extra page so the text ends with a NUL.
+ */
+#if defined(MAP_ANONYMOUS)
+ map_addr = mmap(NULL, mapinfo->txt_full_size, PROT_READ|PROT_WRITE,
+ MAP_ANONYMOUS|MAP_PRIVATE, AO_INVALID_FD, 0);
+#else
+ mapinfo->txt_zero_fd = open("/dev/zero", O_RDONLY);
+
+ if (mapinfo->txt_zero_fd == AO_INVALID_FD) {
+ mapinfo->txt_errno = errno;
+ return;
+ }
+ map_addr = mmap(NULL, mapinfo->txt_full_size, PROT_READ|PROT_WRITE,
+ MAP_PRIVATE, mapinfo->txt_zero_fd, 0);
+#endif
+ if (map_addr == MAP_FAILED_PTR) {
+ mapinfo->txt_errno = errno;
+ return;
+ }
+ mapinfo->txt_flags |= MAP_FIXED;
+ }
+
+ mapinfo->txt_data =
+ mmap(map_addr, mapinfo->txt_size, mapinfo->txt_prot,
+ mapinfo->txt_flags, mapinfo->txt_fd, 0);
+
+ if (mapinfo->txt_data == MAP_FAILED_PTR)
+ mapinfo->txt_errno = errno;
+#endif /* HAVE_MMAP */
+}
+
+/**
+ * Make sure all the parameters are correct: we have a file name that
+ * is a text file that we can read.
+ *
+ * @param fname the text file to map
+ * @param prot the memory protections requested (read/write/etc.)
+ * @param flags mmap flags
+ * @param mapinfo a structure holding everything we need to know
+ * about the mapping.
+ */
+static void
+validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo)
+{
+ memset(mapinfo, 0, sizeof(*mapinfo));
+#if defined(HAVE_MMAP) && ! defined(MAP_ANONYMOUS)
+ mapinfo->txt_zero_fd = AO_INVALID_FD;
+#endif
+ mapinfo->txt_fd = AO_INVALID_FD;
+ mapinfo->txt_prot = prot;
+ mapinfo->txt_flags = flags;
+
+ /*
+ * Map mmap flags and protections into open flags and do the open.
+ */
+ {
+ /*
+ * See if we will be updating the file. If we can alter the memory
+ * and if we share the data and we are *not* copy-on-writing the data,
+ * then our updates will show in the file, so we must open with
+ * write access.
+ */
+ int o_flag = FILE_WRITABLE(prot, flags) ? O_RDWR : O_RDONLY;
+
+ /*
+ * If you're not sharing the file and you are writing to it,
+ * then don't let anyone else have access to the file.
+ */
+ if (((flags & MAP_SHARED) == 0) && (prot & PROT_WRITE))
+ o_flag |= O_EXCL;
+
+ mapinfo->txt_fd = open(fname, o_flag);
+ if (mapinfo->txt_fd < 0) {
+ mapinfo->txt_errno = errno;
+ mapinfo->txt_fd = AO_INVALID_FD;
+ return;
+ }
+ }
+
+ /*
+ * Make sure we can stat the regular file. Save the file size.
+ */
+ {
+ struct stat sb;
+ if (fstat(mapinfo->txt_fd, &sb) != 0) {
+ mapinfo->txt_errno = errno;
+ close(mapinfo->txt_fd);
+ return;
+ }
+
+ if (! S_ISREG(sb.st_mode)) {
+ mapinfo->txt_errno = errno = EINVAL;
+ close(mapinfo->txt_fd);
+ return;
+ }
+
+ mapinfo->txt_size = (size_t)sb.st_size;
+ }
+
+ if (mapinfo->txt_fd == AO_INVALID_FD)
+ mapinfo->txt_errno = errno;
+}
+
+/**
+ * Close any files opened by the mapping.
+ *
+ * @param mi a structure holding everything we need to know about the map.
+ */
+static void
+close_mmap_files(tmap_info_t * mi)
+{
+ if (mi->txt_fd == AO_INVALID_FD)
+ return;
+
+ close(mi->txt_fd);
+ mi->txt_fd = AO_INVALID_FD;
+
+#if defined(HAVE_MMAP) && ! defined(MAP_ANONYMOUS)
+ if (mi->txt_zero_fd == AO_INVALID_FD)
+ return;
+
+ close(mi->txt_zero_fd);
+ mi->txt_zero_fd = AO_INVALID_FD;
+#endif
+}
+
+/*=export_func text_mmap
+ * private:
+ *
+ * what: map a text file with terminating NUL
+ *
+ * arg: char const*, pzFile, name of the file to map
+ * arg: int, prot, mmap protections (see mmap(2))
+ * arg: int, flags, mmap flags (see mmap(2))
+ * arg: tmap_info_t*, mapinfo, returned info about the mapping
+ *
+ * ret-type: void*
+ * ret-desc: The mmaped data address
+ *
+ * doc:
+ *
+ * This routine will mmap a file into memory ensuring that there is at least
+ * one @file{NUL} character following the file data. It will return the
+ * address where the file contents have been mapped into memory. If there is a
+ * problem, then it will return @code{MAP_FAILED} and set @code{errno}
+ * appropriately.
+ *
+ * The named file does not exist, @code{stat(2)} will set @code{errno} as it
+ * will. If the file is not a regular file, @code{errno} will be
+ * @code{EINVAL}. At that point, @code{open(2)} is attempted with the access
+ * bits set appropriately for the requested @code{mmap(2)} protections and flag
+ * bits. On failure, @code{errno} will be set according to the documentation
+ * for @code{open(2)}. If @code{mmap(2)} fails, @code{errno} will be set as
+ * that routine sets it. If @code{text_mmap} works to this point, a valid
+ * address will be returned, but there may still be ``issues''.
+ *
+ * If the file size is not an even multiple of the system page size, then
+ * @code{text_map} will return at this point and @code{errno} will be zero.
+ * Otherwise, an anonymous map is attempted. If not available, then an attempt
+ * is made to @code{mmap(2)} @file{/dev/zero}. If any of these fail, the
+ * address of the file's data is returned, bug @code{no} @file{NUL} characters
+ * are mapped after the end of the data.
+ *
+ * see: mmap(2), open(2), stat(2)
+ *
+ * err: Any error code issued by mmap(2), open(2), stat(2) is possible.
+ * Additionally, if the specified file is not a regular file, then
+ * errno will be set to @code{EINVAL}.
+ *
+ * example:
+ * #include <mylib.h>
+ * tmap_info_t mi;
+ * int no_nul;
+ * void* data = text_mmap("file", PROT_WRITE, MAP_PRIVATE, &mi);
+ * if (data == MAP_FAILED) return;
+ * no_nul = (mi.txt_size == mi.txt_full_size);
+ * << use the data >>
+ * text_munmap(&mi);
+=*/
+void *
+text_mmap(char const * pzFile, int prot, int flags, tmap_info_t * mi)
+{
+ validate_mmap(pzFile, prot, flags, mi);
+ if (mi->txt_errno != 0)
+ return MAP_FAILED_PTR;
+
+ load_text_file(mi, pzFile);
+
+ if (mi->txt_errno == 0)
+ return mi->txt_data;
+
+ close_mmap_files(mi);
+
+ errno = mi->txt_errno;
+ mi->txt_data = MAP_FAILED_PTR;
+ return mi->txt_data;
+}
+
+
+/*=export_func text_munmap
+ * private:
+ *
+ * what: unmap the data mapped in by text_mmap
+ *
+ * arg: tmap_info_t*, mapinfo, info about the mapping
+ *
+ * ret-type: int
+ * ret-desc: -1 or 0. @code{errno} will have the error code.
+ *
+ * doc:
+ *
+ * This routine will unmap the data mapped in with @code{text_mmap} and close
+ * the associated file descriptors opened by that function.
+ *
+ * see: munmap(2), close(2)
+ *
+ * err: Any error code issued by munmap(2) or close(2) is possible.
+=*/
+int
+text_munmap(tmap_info_t * mi)
+{
+ errno = 0;
+
+#ifdef HAVE_MMAP
+ (void)munmap(mi->txt_data, mi->txt_full_size);
+
+#else /* don't HAVE_MMAP */
+ /*
+ * IF the memory is writable *AND* it is not private (copy-on-write)
+ * *AND* the memory is "sharable" (seen by other processes)
+ * THEN rewrite the data. Emulate mmap visibility.
+ */
+ if ( FILE_WRITABLE(mi->txt_prot, mi->txt_flags)
+ && (lseek(mi->txt_fd, 0, SEEK_SET) >= 0) ) {
+ write(mi->txt_fd, mi->txt_data, mi->txt_size);
+ }
+
+ free(mi->txt_data);
+#endif /* HAVE_MMAP */
+
+ mi->txt_errno = errno;
+ close_mmap_files(mi);
+
+ return mi->txt_errno;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/text_mmap.c */
diff --git a/sntp/libopts/time.c b/sntp/libopts/time.c
new file mode 100644
index 0000000..517d5b1
--- /dev/null
+++ b/sntp/libopts/time.c
@@ -0,0 +1,143 @@
+
+/**
+ * \file time.c
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/*=export_func optionTimeVal
+ * private:
+ *
+ * what: process an option with a time duration.
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * Decipher a time duration value.
+=*/
+void
+optionTimeVal(tOptions * opts, tOptDesc * od)
+{
+ time_t val;
+
+ if (INQUERY_CALL(opts, od))
+ return;
+
+ val = parse_duration(od->optArg.argString);
+ if (val == BAD_TIME) {
+ fprintf(stderr, zNotDuration, opts->pzProgName, od->optArg.argString);
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0)
+ (*(opts->pUsageProc))(opts, EXIT_FAILURE);
+ }
+
+ if (od->fOptState & OPTST_ALLOC_ARG) {
+ AGFREE(od->optArg.argString);
+ od->fOptState &= ~OPTST_ALLOC_ARG;
+ }
+
+ od->optArg.argInt = (long)val;
+}
+
+/*=export_func optionTimeDate
+ * private:
+ *
+ * what: process an option with a time and date.
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * Decipher a time and date value.
+=*/
+void
+optionTimeDate(tOptions * opts, tOptDesc * od)
+{
+#if defined(HAVE_GETDATE_R) && defined(HAVE_PUTENV)
+ if (INQUERY_CALL(opts, od))
+ return;
+
+ if ((! HAS_pzPkgDataDir(opts)) || (opts->pzPkgDataDir == NULL))
+ goto default_action;
+
+ /*
+ * Export the DATEMSK environment variable. getdate_r() uses it to
+ * find the file with the strptime formats. If we cannot find the file
+ * we need ($PKGDATADIR/datemsk), then fall back to just a time duration.
+ */
+ {
+ static char * envptr = NULL;
+
+ if (envptr == NULL) {
+ static char const fmt[] = "DATEMSK=%s/datemsk";
+ envptr = AGALOC(sizeof(fmt) + strlen(opts->pzPkgDataDir), fmt);
+ sprintf(envptr, fmt, opts->pzPkgDataDir);
+
+ putenv(envptr);
+ }
+
+ if (access(envptr+8, R_OK) != 0)
+ goto default_action;
+ }
+
+ /*
+ * Convert the date to a time since the epoch and stash it in a long int.
+ */
+ {
+ struct tm stm;
+ time_t tm;
+
+ if (getdate_r(od->optArg.argString, &stm) != 0) {
+ fprintf(stderr, zNotDate, opts->pzProgName,
+ od->optArg.argString);
+ if ((opts->fOptSet & OPTPROC_ERRSTOP) != 0)
+ (*(opts->pUsageProc))(opts, EXIT_FAILURE);
+ return;
+ }
+
+ tm = mktime(&stm);
+
+ if (od->fOptState & OPTST_ALLOC_ARG) {
+ AGFREE(od->optArg.argString);
+ od->fOptState &= ~OPTST_ALLOC_ARG;
+ }
+
+ od->optArg.argInt = tm;
+ }
+ return;
+
+ default_action:
+
+#endif
+ optionTimeVal(opts, od);
+ if (od->optArg.argInt != BAD_TIME)
+ od->optArg.argInt += (long)time(NULL);
+}
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/time.c */
diff --git a/sntp/libopts/tokenize.c b/sntp/libopts/tokenize.c
new file mode 100644
index 0000000..34abf83
--- /dev/null
+++ b/sntp/libopts/tokenize.c
@@ -0,0 +1,339 @@
+/** \file tokenize.c
+ *
+ * Tokenize a string, accommodating quoted strings.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file defines the string_tokenize interface
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+
+#define cc_t const unsigned char
+#define ch_t unsigned char
+
+/* = = = START-STATIC-FORWARD = = = */
+static void
+copy_cooked(ch_t** ppDest, char const ** ppSrc);
+
+static void
+copy_raw(ch_t** ppDest, char const ** ppSrc);
+
+static token_list_t *
+alloc_token_list(char const * str);
+/* = = = END-STATIC-FORWARD = = = */
+
+static void
+copy_cooked(ch_t** ppDest, char const ** ppSrc)
+{
+ ch_t* pDest = (ch_t*)*ppDest;
+ const ch_t* pSrc = (const ch_t*)(*ppSrc + 1);
+
+ for (;;) {
+ ch_t ch = *(pSrc++);
+ switch (ch) {
+ case NUL: *ppSrc = NULL; return;
+ case '"': goto done;
+ case '\\':
+ pSrc += ao_string_cook_escape_char((char*)pSrc, (char*)&ch, 0x7F);
+ if (ch == 0x7F)
+ break;
+ /* FALLTHROUGH */
+
+ default:
+ *(pDest++) = ch;
+ }
+ }
+
+ done:
+ *ppDest = (ch_t*)pDest; /* next spot for storing character */
+ *ppSrc = (char const *)pSrc; /* char following closing quote */
+}
+
+
+static void
+copy_raw(ch_t** ppDest, char const ** ppSrc)
+{
+ ch_t* pDest = *ppDest;
+ cc_t* pSrc = (cc_t*) (*ppSrc + 1);
+
+ for (;;) {
+ ch_t ch = *(pSrc++);
+ switch (ch) {
+ case NUL: *ppSrc = NULL; return;
+ case '\'': goto done;
+ case '\\':
+ /*
+ * *Four* escapes are handled: newline removal, escape char
+ * quoting and apostrophe quoting
+ */
+ switch (*pSrc) {
+ case NUL: *ppSrc = NULL; return;
+ case '\r':
+ if (*(++pSrc) == NL)
+ ++pSrc;
+ continue;
+
+ case NL:
+ ++pSrc;
+ continue;
+
+ case '\'':
+ ch = '\'';
+ /* FALLTHROUGH */
+
+ case '\\':
+ ++pSrc;
+ break;
+ }
+ /* FALLTHROUGH */
+
+ default:
+ *(pDest++) = ch;
+ }
+ }
+
+ done:
+ *ppDest = pDest; /* next spot for storing character */
+ *ppSrc = (char const *) pSrc; /* char following closing quote */
+}
+
+static token_list_t *
+alloc_token_list(char const * str)
+{
+ token_list_t * res;
+
+ int max_token_ct = 2; /* allow for trailing NULL pointer & NUL on string */
+
+ if (str == NULL) goto enoent_res;
+
+ /*
+ * Trim leading white space. Use "ENOENT" and a NULL return to indicate
+ * an empty string was passed.
+ */
+ str = SPN_WHITESPACE_CHARS(str);
+ if (*str == NUL) goto enoent_res;
+
+ /*
+ * Take an approximate count of tokens. If no quoted strings are used,
+ * it will be accurate. If quoted strings are used, it will be a little
+ * high and we'll squander the space for a few extra pointers.
+ */
+ {
+ char const * pz = str;
+
+ do {
+ max_token_ct++;
+ pz = BRK_WHITESPACE_CHARS(pz+1);
+ pz = SPN_WHITESPACE_CHARS(pz);
+ } while (*pz != NUL);
+
+ res = malloc(sizeof(*res) + (size_t)(pz - str)
+ + ((size_t)max_token_ct * sizeof(ch_t*)));
+ }
+
+ if (res == NULL)
+ errno = ENOMEM;
+ else res->tkn_list[0] = (ch_t*)(res->tkn_list + (max_token_ct - 1));
+
+ return res;
+
+ enoent_res:
+
+ errno = ENOENT;
+ return NULL;
+}
+
+/*=export_func ao_string_tokenize
+ *
+ * what: tokenize an input string
+ *
+ * arg: + char const* + string + string to be tokenized +
+ *
+ * ret_type: token_list_t*
+ * ret_desc: pointer to a structure that lists each token
+ *
+ * doc:
+ *
+ * This function will convert one input string into a list of strings.
+ * The list of strings is derived by separating the input based on
+ * white space separation. However, if the input contains either single
+ * or double quote characters, then the text after that character up to
+ * a matching quote will become the string in the list.
+ *
+ * The returned pointer should be deallocated with @code{free(3C)} when
+ * are done using the data. The data are placed in a single block of
+ * allocated memory. Do not deallocate individual token/strings.
+ *
+ * The structure pointed to will contain at least these two fields:
+ * @table @samp
+ * @item tkn_ct
+ * The number of tokens found in the input string.
+ * @item tok_list
+ * An array of @code{tkn_ct + 1} pointers to substring tokens, with
+ * the last pointer set to NULL.
+ * @end table
+ *
+ * There are two types of quoted strings: single quoted (@code{'}) and
+ * double quoted (@code{"}). Singly quoted strings are fairly raw in that
+ * escape characters (@code{\\}) are simply another character, except when
+ * preceding the following characters:
+ * @example
+ * @code{\\} double backslashes reduce to one
+ * @code{'} incorporates the single quote into the string
+ * @code{\n} suppresses both the backslash and newline character
+ * @end example
+ *
+ * Double quote strings are formed according to the rules of string
+ * constants in ANSI-C programs.
+ *
+ * example:
+ * @example
+ * #include <stdlib.h>
+ * int ix;
+ * token_list_t* ptl = ao_string_tokenize(some_string)
+ * for (ix = 0; ix < ptl->tkn_ct; ix++)
+ * do_something_with_tkn(ptl->tkn_list[ix]);
+ * free(ptl);
+ * @end example
+ * Note that everything is freed with the one call to @code{free(3C)}.
+ *
+ * err:
+ * NULL is returned and @code{errno} will be set to indicate the problem:
+ * @itemize @bullet
+ * @item
+ * @code{EINVAL} - There was an unterminated quoted string.
+ * @item
+ * @code{ENOENT} - The input string was empty.
+ * @item
+ * @code{ENOMEM} - There is not enough memory.
+ * @end itemize
+=*/
+token_list_t*
+ao_string_tokenize(char const* str)
+{
+ token_list_t* res = alloc_token_list(str);
+ ch_t* pzDest;
+
+ /*
+ * Now copy each token into the output buffer.
+ */
+ if (res == NULL)
+ return res;
+
+ pzDest = (ch_t*)(res->tkn_list[0]);
+ res->tkn_ct = 0;
+
+ do {
+ res->tkn_list[ res->tkn_ct++ ] = pzDest;
+ for (;;) {
+ int ch = (ch_t)*str;
+ if (IS_WHITESPACE_CHAR(ch)) {
+ found_white_space:
+ str = SPN_WHITESPACE_CHARS(str+1);
+ break;
+ }
+
+ switch (ch) {
+ case '"':
+ copy_cooked(&pzDest, &str);
+ if (str == NULL) {
+ free(res);
+ errno = EINVAL;
+ return NULL;
+ }
+ if (IS_WHITESPACE_CHAR(*str))
+ goto found_white_space;
+ break;
+
+ case '\'':
+ copy_raw(&pzDest, &str);
+ if (str == NULL) {
+ free(res);
+ errno = EINVAL;
+ return NULL;
+ }
+ if (IS_WHITESPACE_CHAR(*str))
+ goto found_white_space;
+ break;
+
+ case NUL:
+ goto copy_done;
+
+ default:
+ str++;
+ *(pzDest++) = (unsigned char)ch;
+ }
+ } copy_done:;
+
+ /*
+ * NUL terminate the last token and see if we have any more tokens.
+ */
+ *(pzDest++) = NUL;
+ } while (*str != NUL);
+
+ res->tkn_list[ res->tkn_ct ] = NULL;
+
+ return res;
+}
+
+#ifdef TEST
+#include <stdio.h>
+#include <string.h>
+
+int
+main(int argc, char** argv)
+{
+ if (argc == 1) {
+ printf("USAGE: %s arg [ ... ]\n", *argv);
+ return 1;
+ }
+ while (--argc > 0) {
+ char* arg = *(++argv);
+ token_list_t* p = ao_string_tokenize(arg);
+ if (p == NULL) {
+ printf("Parsing string ``%s'' failed:\n\terrno %d (%s)\n",
+ arg, errno, strerror(errno));
+ } else {
+ int ix = 0;
+ printf("Parsed string ``%s''\ninto %d tokens:\n", arg, p->tkn_ct);
+ do {
+ printf(" %3d: ``%s''\n", ix+1, p->tkn_list[ix]);
+ } while (++ix < p->tkn_ct);
+ free(p);
+ }
+ }
+ return 0;
+}
+#endif
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/tokenize.c */
diff --git a/sntp/libopts/usage.c b/sntp/libopts/usage.c
new file mode 100644
index 0000000..206235d
--- /dev/null
+++ b/sntp/libopts/usage.c
@@ -0,0 +1,1336 @@
+
+/*
+ * \file usage.c
+ *
+ * This module implements the default usage procedure for
+ * Automated Options. It may be overridden, of course.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * Sort options:
+ --start=END-[S]TATIC-FORWARD --patt='^/\*($|[^:])' \
+ --out=xx.c key='^[a-zA-Z0-9_]+\(' --trail='^/\*:' \
+ --spac=2 --input=usage.c
+ */
+
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/* = = = START-STATIC-FORWARD = = = */
+static unsigned int
+parse_usage_flags(ao_flag_names_t const * fnt, char const * txt);
+
+static inline bool
+do_gnu_usage(tOptions * pOpts);
+
+static inline bool
+skip_misuse_usage(tOptions * pOpts);
+
+static void
+print_offer_usage(tOptions * opts);
+
+static void
+print_usage_details(tOptions * opts, int exit_code);
+
+static void
+print_one_paragraph(char const * text, bool plain, FILE * fp);
+
+static void
+prt_conflicts(tOptions * opts, tOptDesc * od);
+
+static void
+prt_one_vendor(tOptions * opts, tOptDesc * od,
+ arg_types_t * argtp, char const * usefmt);
+
+static void
+prt_vendor_opts(tOptions * opts, char const * title);
+
+static void
+prt_extd_usage(tOptions * opts, tOptDesc * od, char const * title);
+
+static void
+prt_ini_list(char const * const * papz, char const * ini_file,
+ char const * path_nm);
+
+static void
+prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at);
+
+static void
+prt_one_usage(tOptions * opts, tOptDesc * od, arg_types_t * at);
+
+static void
+prt_opt_usage(tOptions * opts, int ex_code, char const * title);
+
+static void
+prt_prog_detail(tOptions * opts);
+
+static int
+setGnuOptFmts(tOptions * opts, char const ** ptxt);
+
+static int
+setStdOptFmts(tOptions * opts, char const ** ptxt);
+/* = = = END-STATIC-FORWARD = = = */
+
+/**
+ * Parse the option usage flags string. Any parsing problems yield
+ * a zero (no flags set) result. This function is internal to
+ * set_usage_flags().
+ *
+ * @param[in] fnt Flag Name Table - maps a name to a mask
+ * @param[in] txt the text to process. If NULL, then
+ * getenv("AUTOOPTS_USAGE") is used.
+ * @returns a bit mask indicating which \a fnt entries were found.
+ */
+static unsigned int
+parse_usage_flags(ao_flag_names_t const * fnt, char const * txt)
+{
+ unsigned int res = 0;
+
+ /*
+ * The text may be passed in. If not, use the environment variable.
+ */
+ if (txt == NULL) {
+ txt = getenv("AUTOOPTS_USAGE");
+ if (txt == NULL)
+ return 0;
+ }
+
+ txt = SPN_WHITESPACE_CHARS(txt);
+ if (*txt == NUL)
+ return 0;
+
+ /*
+ * search the string for table entries. We must understand everything
+ * we see in the string, or we give up on it.
+ */
+ for (;;) {
+ int ix = 0;
+
+ for (;;) {
+ if (strneqvcmp(txt, fnt[ix].fnm_name, (int)fnt[ix].fnm_len) == 0)
+ break;
+ if (++ix >= AOUF_COUNT)
+ return 0;
+ }
+
+ /*
+ * Make sure we have a full match. Look for whitespace,
+ * a comma, or a NUL byte.
+ */
+ if (! IS_END_LIST_ENTRY_CHAR(txt[fnt[ix].fnm_len]))
+ return 0;
+
+ res |= 1U << ix;
+ txt = SPN_WHITESPACE_CHARS(txt + fnt[ix].fnm_len);
+
+ switch (*txt) {
+ case NUL:
+ return res;
+
+ case ',':
+ txt = SPN_WHITESPACE_CHARS(txt + 1);
+ /* Something must follow the comma */
+
+ default:
+ continue;
+ }
+ }
+}
+
+/**
+ * Set option usage flags. Any parsing problems yield no changes to options.
+ * Three different bits may be fiddled: \a OPTPROC_GNUUSAGE, \a OPTPROC_MISUSE
+ * and \a OPTPROC_COMPUTE.
+ *
+ * @param[in] flg_txt text to parse. If NULL, then the AUTOOPTS_USAGE
+ * environment variable is parsed.
+ * @param[in,out] opts the program option descriptor
+ */
+LOCAL void
+set_usage_flags(tOptions * opts, char const * flg_txt)
+{
+# define _aof_(_n, _f) { sizeof(#_n)-1, _f, #_n },
+ static ao_flag_names_t const fn_table[AOUF_COUNT] = {
+ AOFLAG_TABLE
+ };
+# undef _aof_
+
+ /*
+ * the flag word holds a bit for each selected table entry.
+ */
+ unsigned int flg = parse_usage_flags(fn_table, flg_txt);
+ if (flg == 0) return;
+
+ /*
+ * Ensure we do not have conflicting selections
+ */
+ {
+ static unsigned int const form_mask =
+ AOUF_gnu | AOUF_autoopts;
+ static unsigned int const misuse_mask =
+ AOUF_no_misuse_usage | AOUF_misuse_usage;
+ if ( ((flg & form_mask) == form_mask)
+ || ((flg & misuse_mask) == misuse_mask) )
+ return;
+ }
+
+ /*
+ * Now fiddle the fOptSet bits, based on settings.
+ * The OPTPROC_LONGOPT bit is immutable, thus if it is set,
+ * then fnm points to a mask off mask.
+ */
+ {
+ ao_flag_names_t const * fnm = fn_table;
+ for (;;) {
+ if ((flg & 1) != 0) {
+ if ((fnm->fnm_mask & OPTPROC_LONGOPT) != 0)
+ opts->fOptSet &= fnm->fnm_mask;
+ else opts->fOptSet |= fnm->fnm_mask;
+ }
+ flg >>= 1;
+ if (flg == 0)
+ break;
+ fnm++;
+ }
+ }
+}
+
+/*
+ * Figure out if we should try to format usage text sort-of like
+ * the way many GNU programs do.
+ */
+static inline bool
+do_gnu_usage(tOptions * pOpts)
+{
+ return (pOpts->fOptSet & OPTPROC_GNUUSAGE) ? true : false;
+}
+
+/*
+ * Figure out if we should try to format usage text sort-of like
+ * the way many GNU programs do.
+ */
+static inline bool
+skip_misuse_usage(tOptions * pOpts)
+{
+ return (pOpts->fOptSet & OPTPROC_MISUSE) ? true : false;
+}
+
+
+/*=export_func optionOnlyUsage
+ *
+ * what: Print usage text for just the options
+ * arg: + tOptions* + pOpts + program options descriptor +
+ * arg: + int + ex_code + exit code for calling exit(3) +
+ *
+ * doc:
+ * This routine will print only the usage for each option.
+ * This function may be used when the emitted usage must incorporate
+ * information not available to AutoOpts.
+=*/
+void
+optionOnlyUsage(tOptions * pOpts, int ex_code)
+{
+ char const * pOptTitle = NULL;
+
+ set_usage_flags(pOpts, NULL);
+ if ((ex_code != EXIT_SUCCESS) &&
+ skip_misuse_usage(pOpts))
+ return;
+
+ /*
+ * Determine which header and which option formatting strings to use
+ */
+ if (do_gnu_usage(pOpts))
+ (void)setGnuOptFmts(pOpts, &pOptTitle);
+ else
+ (void)setStdOptFmts(pOpts, &pOptTitle);
+
+ prt_opt_usage(pOpts, ex_code, pOptTitle);
+
+ fflush(option_usage_fp);
+ if (ferror(option_usage_fp) != 0)
+ fserr_exit(pOpts->pzProgName, zwriting, (option_usage_fp == stderr)
+ ? zstderr_name : zstdout_name);
+}
+
+/**
+ * Print a message suggesting how to get help.
+ *
+ * @param[in] opts the program options
+ */
+static void
+print_offer_usage(tOptions * opts)
+{
+ char help[24];
+
+ if (HAS_opt_usage_t(opts)) {
+ int ix = opts->presetOptCt;
+ tOptDesc * od = opts->pOptDesc + ix;
+ while (od->optUsage != AOUSE_HELP) {
+ if (++ix >= opts->optCt)
+ ao_bug(zmissing_help_msg);
+ od++;
+ }
+ switch (opts->fOptSet & (OPTPROC_LONGOPT | OPTPROC_SHORTOPT)) {
+ case OPTPROC_SHORTOPT:
+ help[0] = '-';
+ help[1] = od->optValue;
+ help[2] = NUL;
+ break;
+
+ case OPTPROC_LONGOPT:
+ case (OPTPROC_LONGOPT | OPTPROC_SHORTOPT):
+ help[0] = help[1] = '-';
+ strncpy(help + 2, od->pz_Name, 20);
+ break;
+
+ case 0:
+ strncpy(help, od->pz_Name, 20);
+ break;
+ }
+
+ } else {
+ switch (opts->fOptSet & (OPTPROC_LONGOPT | OPTPROC_SHORTOPT)) {
+ case OPTPROC_SHORTOPT:
+ strcpy(help, "-h");
+ break;
+
+ case OPTPROC_LONGOPT:
+ case (OPTPROC_LONGOPT | OPTPROC_SHORTOPT):
+ strcpy(help, "--help");
+ break;
+
+ case 0:
+ strcpy(help, "help");
+ break;
+ }
+ }
+
+ fprintf(option_usage_fp, zoffer_usage_fmt, opts->pzProgName, help);
+}
+
+/**
+ * Print information about each option.
+ *
+ * @param[in] opts the program options
+ * @param[in] exit_code whether or not there was a usage error reported.
+ * used to select full usage versus abbreviated.
+ */
+static void
+print_usage_details(tOptions * opts, int exit_code)
+{
+ {
+ char const * pOptTitle = NULL;
+ int flen;
+
+ /*
+ * Determine which header and which option formatting strings to use
+ */
+ if (do_gnu_usage(opts)) {
+ flen = setGnuOptFmts(opts, &pOptTitle);
+ sprintf(line_fmt_buf, zFmtFmt, flen);
+ fputc(NL, option_usage_fp);
+ }
+ else {
+ flen = setStdOptFmts(opts, &pOptTitle);
+ sprintf(line_fmt_buf, zFmtFmt, flen);
+
+ /*
+ * When we exit with EXIT_SUCCESS and the first option is a doc
+ * option, we do *NOT* want to emit the column headers.
+ * Otherwise, we do.
+ */
+ if ( (exit_code != EXIT_SUCCESS)
+ || ((opts->pOptDesc->fOptState & OPTST_DOCUMENT) == 0) )
+
+ fputs(pOptTitle, option_usage_fp);
+ }
+
+ flen = 4 - ((flen + 15) / 8);
+ if (flen > 0)
+ tab_skip_ct = flen;
+ prt_opt_usage(opts, exit_code, pOptTitle);
+ }
+
+ /*
+ * Describe the mechanics of denoting the options
+ */
+ switch (opts->fOptSet & OPTPROC_L_N_S) {
+ case OPTPROC_L_N_S: fputs(zFlagOkay, option_usage_fp); break;
+ case OPTPROC_SHORTOPT: break;
+ case OPTPROC_LONGOPT: fputs(zNoFlags, option_usage_fp); break;
+ case 0: fputs(zOptsOnly, option_usage_fp); break;
+ }
+
+ if ((opts->fOptSet & OPTPROC_NUM_OPT) != 0)
+ fputs(zNumberOpt, option_usage_fp);
+
+ if ((opts->fOptSet & OPTPROC_REORDER) != 0)
+ fputs(zReorder, option_usage_fp);
+
+ if (opts->pzExplain != NULL)
+ fputs(opts->pzExplain, option_usage_fp);
+
+ /*
+ * IF the user is asking for help (thus exiting with SUCCESS),
+ * THEN see what additional information we can provide.
+ */
+ if (exit_code == EXIT_SUCCESS)
+ prt_prog_detail(opts);
+
+ /*
+ * Give bug notification preference to the packager information
+ */
+ if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL))
+ fputs(opts->pzPackager, option_usage_fp);
+
+ else if (opts->pzBugAddr != NULL)
+ fprintf(option_usage_fp, zPlsSendBugs, opts->pzBugAddr);
+
+ fflush(option_usage_fp);
+
+ if (ferror(option_usage_fp) != 0)
+ fserr_exit(opts->pzProgName, zwriting, (option_usage_fp == stderr)
+ ? zstderr_name : zstdout_name);
+}
+
+static void
+print_one_paragraph(char const * text, bool plain, FILE * fp)
+{
+ if (plain) {
+#ifdef ENABLE_NLS
+#ifdef HAVE_LIBINTL_H
+#ifdef DEBUG_ENABLED
+#undef gettext
+#endif
+ char * buf = dgettext("libopts", text);
+ if (buf == text)
+ text = gettext(text);
+#endif /* HAVE_LIBINTL_H */
+#endif /* ENABLE_NLS */
+ fputs(text, fp);
+ }
+
+ else {
+ char const * t = optionQuoteString(text, LINE_SPLICE);
+ fprintf(fp, PUTS_FMT, t);
+ AGFREE((void *)t);
+ }
+}
+
+/*=export_func optionPrintParagraphs
+ * private:
+ *
+ * what: Print a paragraph of usage text
+ * arg: + char const * + text + a block of text that has bee i18n-ed +
+ * arg: + bool + plain + false -> wrap text in fputs() +
+ * arg: + FILE * + fp + the stream file pointer for output +
+ *
+ * doc:
+ * This procedure is called in two contexts: when a full or short usage text
+ * has been provided for display, and when autogen is assembling a list of
+ * translatable texts in the optmain.tlib template. In the former case, \a
+ * plain is set to \a true, otherwise \a false.
+ *
+ * Anything less than 256 characters in size is printed as a single unit.
+ * Otherwise, paragraphs are detected. A paragraph break is defined as just
+ * before a non-empty line preceded by two newlines or a line that starts
+ * with at least one space character but fewer than 8 space characters.
+ * Lines indented with tabs or more than 7 spaces are considered continuation
+ * lines.
+ *
+ * If 'plain' is true, we are emitting text for a user to see. So, if it is
+ * true and NLS is not enabled, then just write the whole thing at once.
+=*/
+void
+optionPrintParagraphs(char const * text, bool plain, FILE * fp)
+{
+ size_t len = strlen(text);
+ char * buf;
+#ifndef ENABLE_NLS
+ if (plain || (len < 256))
+#else
+ if (len < 256)
+#endif
+ {
+ print_one_paragraph(text, plain, fp);
+ return;
+ }
+
+ AGDUPSTR(buf, text, "ppara");
+ text = buf;
+
+ for (;;) {
+ char * scan;
+
+ if (len < 256) {
+ done:
+ print_one_paragraph(buf, plain, fp);
+ break;
+ }
+ scan = buf;
+
+ try_longer:
+ scan = strchr(scan, NL);
+ if (scan == NULL)
+ goto done;
+
+ if ((scan - buf) < 40) {
+ scan++;
+ goto try_longer;
+ }
+
+ scan++;
+ if ((! isspace((int)*scan)) || (*scan == HT))
+ /*
+ * line starts with tab or non-whitespace --> continuation
+ */
+ goto try_longer;
+
+ if (*scan == NL) {
+ /*
+ * Double newline -> paragraph break
+ * Include all newlines in current paragraph.
+ */
+ while (*++scan == NL) /*continue*/;
+
+ } else {
+ char * p = scan;
+ int sp_ct = 0;
+
+ while (*p == ' ') {
+ if (++sp_ct >= 8) {
+ /*
+ * Too many spaces --> continuation line
+ */
+ scan = p;
+ goto try_longer;
+ }
+ p++;
+ }
+ }
+
+ /*
+ * "scan" points to the first character of a paragraph or the
+ * terminating NUL byte.
+ */
+ {
+ char svch = *scan;
+ *scan = NUL;
+ print_one_paragraph(buf, plain, fp);
+ len -= scan - buf;
+ if (len <= 0)
+ break;
+ *scan = svch;
+ buf = scan;
+ }
+ }
+ AGFREE((void *)text);
+}
+
+/*=export_func optionUsage
+ * private:
+ *
+ * what: Print usage text
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + int + exitCode + exit code for calling exit(3) +
+ *
+ * doc:
+ * This routine will print usage in both GNU-standard and AutoOpts-expanded
+ * formats. The descriptor specifies the default, but AUTOOPTS_USAGE will
+ * over-ride this, providing the value of it is set to either "gnu" or
+ * "autoopts". This routine will @strong{not} return.
+ *
+ * If "exitCode" is "AO_EXIT_REQ_USAGE" (normally 64), then output will to
+ * to stdout and the actual exit code will be "EXIT_SUCCESS".
+=*/
+void
+optionUsage(tOptions * opts, int usage_exit_code)
+{
+ int exit_code = (usage_exit_code == AO_EXIT_REQ_USAGE)
+ ? EXIT_SUCCESS : usage_exit_code;
+
+ displayEnum = false;
+ set_usage_flags(opts, NULL);
+
+ /*
+ * Paged usage will preset option_usage_fp to an output file.
+ * If it hasn't already been set, then set it to standard output
+ * on successful exit (help was requested), otherwise error out.
+ *
+ * Test the version before obtaining pzFullUsage or pzShortUsage.
+ * These fields do not exist before revision 30.
+ */
+ {
+ char const * pz;
+
+ if (exit_code == EXIT_SUCCESS) {
+ pz = (opts->structVersion >= 30 * 4096)
+ ? opts->pzFullUsage : NULL;
+
+ if (option_usage_fp == NULL)
+ option_usage_fp = print_exit ? stderr : stdout;
+
+ } else {
+ pz = (opts->structVersion >= 30 * 4096)
+ ? opts->pzShortUsage : NULL;
+
+ if (option_usage_fp == NULL)
+ option_usage_fp = stderr;
+ }
+
+ if (((opts->fOptSet & OPTPROC_COMPUTE) == 0) && (pz != NULL)) {
+ if ((opts->fOptSet & OPTPROC_TRANSLATE) != 0)
+ optionPrintParagraphs(pz, true, option_usage_fp);
+ else
+ fputs(pz, option_usage_fp);
+ goto flush_and_exit;
+ }
+ }
+
+ fprintf(option_usage_fp, opts->pzUsageTitle, opts->pzProgName);
+
+ if ((exit_code == EXIT_SUCCESS) ||
+ (! skip_misuse_usage(opts)))
+
+ print_usage_details(opts, usage_exit_code);
+ else
+ print_offer_usage(opts);
+
+ flush_and_exit:
+ fflush(option_usage_fp);
+ if (ferror(option_usage_fp) != 0)
+ fserr_exit(opts->pzProgName, zwriting, (option_usage_fp == stdout)
+ ? zstdout_name : zstderr_name);
+
+ option_exits(exit_code);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * PER OPTION TYPE USAGE INFORMATION
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * print option conflicts.
+ *
+ * @param opts the program option descriptor
+ * @param od the option descriptor
+ */
+static void
+prt_conflicts(tOptions * opts, tOptDesc * od)
+{
+ const int * opt_no;
+ fputs(zTabHyp + tab_skip_ct, option_usage_fp);
+
+ /*
+ * REQUIRED:
+ */
+ if (od->pOptMust != NULL) {
+ opt_no = od->pOptMust;
+
+ if (opt_no[1] == NO_EQUIVALENT) {
+ fprintf(option_usage_fp, zReqOne,
+ opts->pOptDesc[*opt_no].pz_Name);
+ } else {
+ fputs(zReqThese, option_usage_fp);
+ for (;;) {
+ fprintf(option_usage_fp, zTabout + tab_skip_ct,
+ opts->pOptDesc[*opt_no].pz_Name);
+ if (*++opt_no == NO_EQUIVALENT)
+ break;
+ }
+ }
+
+ if (od->pOptCant != NULL)
+ fputs(zTabHypAnd + tab_skip_ct, option_usage_fp);
+ }
+
+ /*
+ * CONFLICTS:
+ */
+ if (od->pOptCant == NULL)
+ return;
+
+ opt_no = od->pOptCant;
+
+ if (opt_no[1] == NO_EQUIVALENT) {
+ fprintf(option_usage_fp, zProhibOne,
+ opts->pOptDesc[*opt_no].pz_Name);
+ return;
+ }
+
+ fputs(zProhib, option_usage_fp);
+ for (;;) {
+ fprintf(option_usage_fp, zTabout + tab_skip_ct,
+ opts->pOptDesc[*opt_no].pz_Name);
+ if (*++opt_no == NO_EQUIVALENT)
+ break;
+ }
+}
+
+/**
+ * Print the usage information for a single vendor option.
+ *
+ * @param[in] opts the program option descriptor
+ * @param[in] od the option descriptor
+ * @param[in] argtp names of the option argument types
+ * @param[in] usefmt format for primary usage line
+ */
+static void
+prt_one_vendor(tOptions * opts, tOptDesc * od,
+ arg_types_t * argtp, char const * usefmt)
+{
+ prt_preamble(opts, od, argtp);
+
+ {
+ char z[ 80 ];
+ char const * pzArgType;
+
+ /*
+ * Determine the argument type string first on its usage, then,
+ * when the option argument is required, base the type string on the
+ * argument type.
+ */
+ if (od->fOptState & OPTST_ARG_OPTIONAL) {
+ pzArgType = argtp->pzOpt;
+
+ } else switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_NONE: pzArgType = argtp->pzNo; break;
+ case OPARG_TYPE_ENUMERATION: pzArgType = argtp->pzKey; break;
+ case OPARG_TYPE_FILE: pzArgType = argtp->pzFile; break;
+ case OPARG_TYPE_MEMBERSHIP: pzArgType = argtp->pzKeyL; break;
+ case OPARG_TYPE_BOOLEAN: pzArgType = argtp->pzBool; break;
+ case OPARG_TYPE_NUMERIC: pzArgType = argtp->pzNum; break;
+ case OPARG_TYPE_HIERARCHY: pzArgType = argtp->pzNest; break;
+ case OPARG_TYPE_STRING: pzArgType = argtp->pzStr; break;
+ case OPARG_TYPE_TIME: pzArgType = argtp->pzTime; break;
+ default: goto bogus_desc;
+ }
+
+ pzArgType = SPN_WHITESPACE_CHARS(pzArgType);
+ if (*pzArgType == NUL)
+ snprintf(z, sizeof(z), "%s", od->pz_Name);
+ else
+ snprintf(z, sizeof(z), "%s=%s", od->pz_Name, pzArgType);
+ fprintf(option_usage_fp, usefmt, z, od->pzText);
+
+ switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_ENUMERATION:
+ case OPARG_TYPE_MEMBERSHIP:
+ displayEnum = (od->pOptProc != NULL) ? true : displayEnum;
+ }
+ }
+
+ return;
+
+ bogus_desc:
+ fprintf(stderr, zbad_od, opts->pzProgName, od->pz_Name);
+ ao_bug(zbad_arg_type_msg);
+}
+
+/**
+ * Print the long options processed with "-W". These options will be the
+ * ones that do *not* have flag characters.
+ *
+ * @param opts the program option descriptor
+ * @param title the title for the options
+ */
+static void
+prt_vendor_opts(tOptions * opts, char const * title)
+{
+ static unsigned int const not_vended_mask =
+ OPTST_NO_USAGE_MASK | OPTST_DOCUMENT;
+
+ static char const vfmtfmt[] = "%%-%us %%s\n";
+ char vfmt[sizeof(vfmtfmt)];
+
+ /*
+ * Only handle client specified options. The "vendor option" follows
+ * "presetOptCt", so we won't loop/recurse indefinitely.
+ */
+ int ct = opts->presetOptCt;
+ tOptDesc * od = opts->pOptDesc;
+ fprintf(option_usage_fp, zTabout + tab_skip_ct, zVendOptsAre);
+
+ {
+ size_t nmlen = 0;
+ do {
+ size_t l;
+ if ( ((od->fOptState & not_vended_mask) != 0)
+ || IS_GRAPHIC_CHAR(od->optValue))
+ continue;
+
+ l = strlen(od->pz_Name);
+ if (l > nmlen) nmlen = l;
+ } while (od++, (--ct > 0));
+
+ snprintf(vfmt, sizeof(vfmt), vfmtfmt, (unsigned int)nmlen + 4);
+ }
+
+ if (tab_skip_ct > 0)
+ tab_skip_ct--;
+
+ ct = opts->presetOptCt;
+ od = opts->pOptDesc;
+
+ do {
+ if ( ((od->fOptState & not_vended_mask) != 0)
+ || IS_GRAPHIC_CHAR(od->optValue))
+ continue;
+
+ prt_one_vendor(opts, od, &argTypes, vfmt);
+ prt_extd_usage(opts, od, title);
+
+ } while (od++, (--ct > 0));
+
+ /* no need to restore "tab_skip_ct" - options are done now */
+}
+
+/**
+ * Print extended usage. Usage/help was requested.
+ *
+ * @param opts the program option descriptor
+ * @param od the option descriptor
+ * @param title the title for the options
+ */
+static void
+prt_extd_usage(tOptions * opts, tOptDesc * od, char const * title)
+{
+ if ( ((opts->fOptSet & OPTPROC_VENDOR_OPT) != 0)
+ && (od->optActualValue == VENDOR_OPTION_VALUE)) {
+ prt_vendor_opts(opts, title);
+ return;
+ }
+
+ /*
+ * IF there are option conflicts or dependencies,
+ * THEN print them here.
+ */
+ if ((od->pOptMust != NULL) || (od->pOptCant != NULL))
+ prt_conflicts(opts, od);
+
+ /*
+ * IF there is a disablement string
+ * THEN print the disablement info
+ */
+ if (od->pz_DisableName != NULL )
+ fprintf(option_usage_fp, zDis + tab_skip_ct, od->pz_DisableName);
+
+ /*
+ * Check for argument types that have callbacks with magical properties
+ */
+ switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_NUMERIC:
+ /*
+ * IF the numeric option has a special callback,
+ * THEN call it, requesting the range or other special info
+ */
+ if ( (od->pOptProc != NULL)
+ && (od->pOptProc != optionNumericVal) ) {
+ (*(od->pOptProc))(OPTPROC_EMIT_USAGE, od);
+ }
+ break;
+
+ case OPARG_TYPE_FILE:
+ (*(od->pOptProc))(OPTPROC_EMIT_USAGE, od);
+ break;
+ }
+
+ /*
+ * IF the option defaults to being enabled,
+ * THEN print that out
+ */
+ if (od->fOptState & OPTST_INITENABLED)
+ fputs(zEnab + tab_skip_ct, option_usage_fp);
+
+ /*
+ * IF the option is in an equivalence class
+ * AND not the designated lead
+ * THEN print equivalence and leave it at that.
+ */
+ if ( (od->optEquivIndex != NO_EQUIVALENT)
+ && (od->optEquivIndex != od->optActualIndex ) ) {
+ fprintf(option_usage_fp, zalt_opt + tab_skip_ct,
+ opts->pOptDesc[ od->optEquivIndex ].pz_Name);
+ return;
+ }
+
+ /*
+ * IF this particular option can NOT be preset
+ * AND some form of presetting IS allowed,
+ * AND it is not an auto-managed option (e.g. --help, et al.)
+ * THEN advise that this option may not be preset.
+ */
+ if ( ((od->fOptState & OPTST_NO_INIT) != 0)
+ && ( (opts->papzHomeList != NULL)
+ || (opts->pzPROGNAME != NULL)
+ )
+ && (od->optIndex < opts->presetOptCt)
+ )
+
+ fputs(zNoPreset + tab_skip_ct, option_usage_fp);
+
+ /*
+ * Print the appearance requirements.
+ */
+ if (OPTST_GET_ARGTYPE(od->fOptState) == OPARG_TYPE_MEMBERSHIP)
+ fputs(zMembers + tab_skip_ct, option_usage_fp);
+
+ else switch (od->optMinCt) {
+ case 1:
+ case 0:
+ switch (od->optMaxCt) {
+ case 0: fputs(zPreset + tab_skip_ct, option_usage_fp); break;
+ case NOLIMIT: fputs(zNoLim + tab_skip_ct, option_usage_fp); break;
+ case 1: break;
+ /*
+ * IF the max is more than one but limited, print "UP TO" message
+ */
+ default:
+ fprintf(option_usage_fp, zUpTo + tab_skip_ct, od->optMaxCt); break;
+ }
+ break;
+
+ default:
+ /*
+ * More than one is required. Print the range.
+ */
+ fprintf(option_usage_fp, zMust + tab_skip_ct,
+ od->optMinCt, od->optMaxCt);
+ }
+
+ if ( NAMED_OPTS(opts)
+ && (opts->specOptIdx.default_opt == od->optIndex))
+ fputs(zDefaultOpt + tab_skip_ct, option_usage_fp);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Figure out where all the initialization files might live. This requires
+ * translating some environment variables and testing to see if a name is a
+ * directory or a file. It's squishy, but important to tell users how to
+ * find these files.
+ *
+ * @param[in] papz search path
+ * @param[out] ini_file an output buffer of AG_PATH_MAX+1 bytes
+ * @param[in] path_nm the name of the file we're hunting for
+ */
+static void
+prt_ini_list(char const * const * papz, char const * ini_file,
+ char const * path_nm)
+{
+ char pth_buf[AG_PATH_MAX+1];
+
+ fputs(zPresetIntro, option_usage_fp);
+
+ for (;;) {
+ char const * path = *(papz++);
+ char const * nm_buf = pth_buf;
+
+ if (path == NULL)
+ break;
+
+ /*
+ * Ignore any invalid paths
+ */
+ if (! optionMakePath(pth_buf, (int)sizeof(pth_buf), path, path_nm))
+ nm_buf = path;
+
+ /*
+ * Expand paths that are relative to the executable or installation
+ * directories. Leave alone paths that use environment variables.
+ */
+ else if ((*path == '$')
+ && ((path[1] == '$') || (path[1] == '@')))
+ path = nm_buf;
+
+ /*
+ * Print the name of the "homerc" file. If the "rcfile" name is
+ * not empty, we may or may not print that, too...
+ */
+ fprintf(option_usage_fp, zPathFmt, path);
+ if (*ini_file != NUL) {
+ struct stat sb;
+
+ /*
+ * IF the "homerc" file is a directory,
+ * then append the "rcfile" name.
+ */
+ if ((stat(nm_buf, &sb) == 0) && S_ISDIR(sb.st_mode)) {
+ fputc(DIRCH, option_usage_fp);
+ fputs(ini_file, option_usage_fp);
+ }
+ }
+
+ fputc(NL, option_usage_fp);
+ }
+}
+
+/**
+ * Print the usage line preamble text
+ *
+ * @param opts the program option descriptor
+ * @param od the option descriptor
+ * @param at names of the option argument types
+ */
+static void
+prt_preamble(tOptions * opts, tOptDesc * od, arg_types_t * at)
+{
+ /*
+ * Flag prefix: IF no flags at all, then omit it. If not printable
+ * (not allowed for this option), then blank, else print it.
+ * Follow it with a comma if we are doing GNU usage and long
+ * opts are to be printed too.
+ */
+ if ((opts->fOptSet & OPTPROC_SHORTOPT) == 0)
+ fputs(at->pzSpc, option_usage_fp);
+
+ else if (! IS_GRAPHIC_CHAR(od->optValue)) {
+ if ( (opts->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
+ == (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
+ fputc(' ', option_usage_fp);
+ fputs(at->pzNoF, option_usage_fp);
+
+ } else {
+ fprintf(option_usage_fp, " -%c", od->optValue);
+ if ( (opts->fOptSet & (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
+ == (OPTPROC_GNUUSAGE|OPTPROC_LONGOPT))
+ fputs(", ", option_usage_fp);
+ }
+}
+
+/**
+ * Print the usage information for a single option.
+ *
+ * @param opts the program option descriptor
+ * @param od the option descriptor
+ * @param at names of the option argument types
+ */
+static void
+prt_one_usage(tOptions * opts, tOptDesc * od, arg_types_t * at)
+{
+ prt_preamble(opts, od, at);
+
+ {
+ char z[80];
+ char const * atyp;
+
+ /*
+ * Determine the argument type string first on its usage, then,
+ * when the option argument is required, base the type string on the
+ * argument type.
+ */
+ if (od->fOptState & OPTST_ARG_OPTIONAL) {
+ atyp = at->pzOpt;
+
+ } else switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_NONE: atyp = at->pzNo; break;
+ case OPARG_TYPE_ENUMERATION: atyp = at->pzKey; break;
+ case OPARG_TYPE_FILE: atyp = at->pzFile; break;
+ case OPARG_TYPE_MEMBERSHIP: atyp = at->pzKeyL; break;
+ case OPARG_TYPE_BOOLEAN: atyp = at->pzBool; break;
+ case OPARG_TYPE_NUMERIC: atyp = at->pzNum; break;
+ case OPARG_TYPE_HIERARCHY: atyp = at->pzNest; break;
+ case OPARG_TYPE_STRING: atyp = at->pzStr; break;
+ case OPARG_TYPE_TIME: atyp = at->pzTime; break;
+ default: goto bogus_desc;
+ }
+
+#ifdef _WIN32
+ if (at->pzOptFmt == zGnuOptFmt)
+ snprintf(z, sizeof(z), "--%s%s", od->pz_Name, atyp);
+ else if (at->pzOptFmt == zGnuOptFmt + 2)
+ snprintf(z, sizeof(z), "%s%s", od->pz_Name, atyp);
+ else
+#endif
+ snprintf(z, sizeof(z), at->pzOptFmt, atyp, od->pz_Name,
+ (od->optMinCt != 0) ? at->pzReq : at->pzOpt);
+
+ fprintf(option_usage_fp, line_fmt_buf, z, od->pzText);
+
+ switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_ENUMERATION:
+ case OPARG_TYPE_MEMBERSHIP:
+ displayEnum = (od->pOptProc != NULL) ? true : displayEnum;
+ }
+ }
+
+ return;
+
+ bogus_desc:
+ fprintf(stderr, zbad_od, opts->pzProgName, od->pz_Name);
+ option_exits(EX_SOFTWARE);
+}
+
+/**
+ * Print out the usage information for just the options.
+ */
+static void
+prt_opt_usage(tOptions * opts, int ex_code, char const * title)
+{
+ int ct = opts->optCt;
+ int optNo = 0;
+ tOptDesc * od = opts->pOptDesc;
+ int docCt = 0;
+
+ do {
+ /*
+ * no usage --> disallowed on command line (OPTST_NO_COMMAND), or
+ * deprecated -- strongly discouraged (OPTST_DEPRECATED), or
+ * compiled out of current object code (OPTST_OMITTED)
+ */
+ if ((od->fOptState & OPTST_NO_USAGE_MASK) != 0) {
+
+ /*
+ * IF this is a compiled-out option
+ * *AND* usage was requested with "omitted-usage"
+ * *AND* this is NOT abbreviated usage
+ * THEN display this option.
+ */
+ if ( (od->fOptState == (OPTST_OMITTED | OPTST_NO_INIT))
+ && (od->pz_Name != NULL)
+ && (ex_code == EXIT_SUCCESS)) {
+
+ char const * why_pz =
+ (od->pzText == NULL) ? zDisabledWhy : od->pzText;
+ prt_preamble(opts, od, &argTypes);
+ fprintf(option_usage_fp, zDisabledOpt, od->pz_Name, why_pz);
+ }
+
+ continue;
+ }
+
+ if ((od->fOptState & OPTST_DOCUMENT) != 0) {
+ if (ex_code == EXIT_SUCCESS) {
+ fprintf(option_usage_fp, argTypes.pzBrk, od->pzText,
+ title);
+ docCt++;
+ }
+
+ continue;
+ }
+
+ /* Skip name only options when we have a vendor option */
+ if ( ((opts->fOptSet & OPTPROC_VENDOR_OPT) != 0)
+ && (! IS_GRAPHIC_CHAR(od->optValue)))
+ continue;
+
+ /*
+ * IF this is the first auto-opt maintained option
+ * *AND* we are doing a full help
+ * *AND* there are documentation options
+ * *AND* the last one was not a doc option,
+ * THEN document that the remaining options are not user opts
+ */
+ if ((docCt > 0) && (ex_code == EXIT_SUCCESS)) {
+ if (opts->presetOptCt == optNo) {
+ if ((od[-1].fOptState & OPTST_DOCUMENT) == 0)
+ fprintf(option_usage_fp, argTypes.pzBrk, zAuto, title);
+
+ } else if ((ct == 1) &&
+ (opts->fOptSet & OPTPROC_VENDOR_OPT))
+ fprintf(option_usage_fp, argTypes.pzBrk, zVendIntro, title);
+ }
+
+ prt_one_usage(opts, od, &argTypes);
+
+ /*
+ * IF we were invoked because of the --help option,
+ * THEN print all the extra info
+ */
+ if (ex_code == EXIT_SUCCESS)
+ prt_extd_usage(opts, od, title);
+
+ } while (od++, optNo++, (--ct > 0));
+
+ fputc(NL, option_usage_fp);
+}
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Print program details.
+ * @param[in] opts the program option descriptor
+ */
+static void
+prt_prog_detail(tOptions * opts)
+{
+ bool need_intro = (opts->papzHomeList == NULL);
+
+ /*
+ * Display all the places we look for config files, if we have
+ * a list of directories to search.
+ */
+ if (! need_intro)
+ prt_ini_list(opts->papzHomeList, opts->pzRcName, opts->pzProgPath);
+
+ /*
+ * Let the user know about environment variable settings
+ */
+ if ((opts->fOptSet & OPTPROC_ENVIRON) != 0) {
+ if (need_intro)
+ fputs(zPresetIntro, option_usage_fp);
+
+ fprintf(option_usage_fp, zExamineFmt, opts->pzPROGNAME);
+ }
+
+ /*
+ * IF we found an enumeration,
+ * THEN hunt for it again. Call the handler proc with a NULL
+ * option struct pointer. That tells it to display the keywords.
+ */
+ if (displayEnum) {
+ int ct = opts->optCt;
+ int optNo = 0;
+ tOptDesc * od = opts->pOptDesc;
+
+ fputc(NL, option_usage_fp);
+ fflush(option_usage_fp);
+ do {
+ switch (OPTST_GET_ARGTYPE(od->fOptState)) {
+ case OPARG_TYPE_ENUMERATION:
+ case OPARG_TYPE_MEMBERSHIP:
+ (*(od->pOptProc))(OPTPROC_EMIT_USAGE, od);
+ }
+ } while (od++, optNo++, (--ct > 0));
+ }
+
+ /*
+ * If there is a detail string, now is the time for that.
+ */
+ if (opts->pzDetail != NULL)
+ fputs(opts->pzDetail, option_usage_fp);
+}
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * OPTION LINE FORMATTING SETUP
+ *
+ * The "OptFmt" formats receive three arguments:
+ * 1. the type of the option's argument
+ * 2. the long name of the option
+ * 3. "YES" or "no ", depending on whether or not the option must appear
+ * on the command line.
+ * These formats are used immediately after the option flag (if used) has
+ * been printed.
+ *
+ * Set up the formatting for GNU-style output
+ */
+static int
+setGnuOptFmts(tOptions * opts, char const ** ptxt)
+{
+ static char const zOneSpace[] = " ";
+ int flen = 22;
+ *ptxt = zNoRq_ShrtTtl;
+
+ argTypes.pzStr = zGnuStrArg;
+ argTypes.pzReq = zOneSpace;
+ argTypes.pzNum = zGnuNumArg;
+ argTypes.pzKey = zGnuKeyArg;
+ argTypes.pzKeyL = zGnuKeyLArg;
+ argTypes.pzTime = zGnuTimeArg;
+ argTypes.pzFile = zGnuFileArg;
+ argTypes.pzBool = zGnuBoolArg;
+ argTypes.pzNest = zGnuNestArg;
+ argTypes.pzOpt = zGnuOptArg;
+ argTypes.pzNo = zOneSpace;
+ argTypes.pzBrk = zGnuBreak;
+ argTypes.pzNoF = zSixSpaces;
+ argTypes.pzSpc = zThreeSpaces;
+
+ switch (opts->fOptSet & OPTPROC_L_N_S) {
+ case OPTPROC_L_N_S: argTypes.pzOptFmt = zGnuOptFmt; break;
+ case OPTPROC_LONGOPT: argTypes.pzOptFmt = zGnuOptFmt; break;
+ case 0: argTypes.pzOptFmt = zGnuOptFmt + 2; break;
+ case OPTPROC_SHORTOPT:
+ argTypes.pzOptFmt = zShrtGnuOptFmt;
+ zGnuStrArg[0] = zGnuNumArg[0] = zGnuKeyArg[0] = zGnuBoolArg[0] = ' ';
+ argTypes.pzOpt = " [arg]";
+ flen = 8;
+ break;
+ }
+
+ return flen;
+}
+
+
+/*
+ * Standard (AutoOpts normal) option line formatting
+ */
+static int
+setStdOptFmts(tOptions * opts, char const ** ptxt)
+{
+ int flen = 0;
+
+ argTypes.pzStr = zStdStrArg;
+ argTypes.pzReq = zStdReqArg;
+ argTypes.pzNum = zStdNumArg;
+ argTypes.pzKey = zStdKeyArg;
+ argTypes.pzKeyL = zStdKeyLArg;
+ argTypes.pzTime = zStdTimeArg;
+ argTypes.pzFile = zStdFileArg;
+ argTypes.pzBool = zStdBoolArg;
+ argTypes.pzNest = zStdNestArg;
+ argTypes.pzOpt = zStdOptArg;
+ argTypes.pzNo = zStdNoArg;
+ argTypes.pzBrk = zStdBreak;
+ argTypes.pzNoF = zFiveSpaces;
+ argTypes.pzSpc = zTwoSpaces;
+
+ switch (opts->fOptSet & (OPTPROC_NO_REQ_OPT | OPTPROC_SHORTOPT)) {
+ case (OPTPROC_NO_REQ_OPT | OPTPROC_SHORTOPT):
+ *ptxt = zNoRq_ShrtTtl;
+ argTypes.pzOptFmt = zNrmOptFmt;
+ flen = 19;
+ break;
+
+ case OPTPROC_NO_REQ_OPT:
+ *ptxt = zNoRq_NoShrtTtl;
+ argTypes.pzOptFmt = zNrmOptFmt;
+ flen = 19;
+ break;
+
+ case OPTPROC_SHORTOPT:
+ *ptxt = zReq_ShrtTtl;
+ argTypes.pzOptFmt = zReqOptFmt;
+ flen = 24;
+ break;
+
+ case 0:
+ *ptxt = zReq_NoShrtTtl;
+ argTypes.pzOptFmt = zReqOptFmt;
+ flen = 24;
+ }
+
+ return flen;
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/usage.c */
diff --git a/sntp/libopts/version.c b/sntp/libopts/version.c
new file mode 100644
index 0000000..1516c14
--- /dev/null
+++ b/sntp/libopts/version.c
@@ -0,0 +1,237 @@
+
+/** \file version.c
+ *
+ * This module implements the default usage procedure for
+ * Automated Options. It may be overridden, of course.
+ *
+ * @addtogroup autoopts
+ * @{
+ */
+/*
+ * This file is part of AutoOpts, a companion to AutoGen.
+ * AutoOpts is free software.
+ * AutoOpts is Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
+ *
+ * AutoOpts is available under any one of two licenses. The license
+ * in use must be one of these two and the choice is under the control
+ * of the user of the license.
+ *
+ * The GNU Lesser General Public License, version 3 or later
+ * See the files "COPYING.lgplv3" and "COPYING.gplv3"
+ *
+ * The Modified Berkeley Software Distribution License
+ * See the file "COPYING.mbsd"
+ *
+ * These files have the following sha256 sums:
+ *
+ * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
+ * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
+ * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
+ */
+
+/*=export_func optionVersion
+ *
+ * what: return the compiled AutoOpts version number
+ * ret_type: char const*
+ * ret_desc: the version string in constant memory
+ * doc:
+ * Returns the full version string compiled into the library.
+ * The returned string cannot be modified.
+=*/
+char const*
+optionVersion(void)
+{
+ static char const ver[] = OPTIONS_DOTTED_VERSION;
+ return ver;
+}
+
+static void
+emit_first_line(
+ FILE * fp, char const * alt1, char const * alt2, char const * alt3)
+{
+ char const * p = (alt1 != NULL) ? alt1 : ((alt2 != NULL) ? alt2 : alt3);
+ char const * e;
+ if (p == NULL)
+ return;
+ e = strchr(p, NL);
+ if (e == NULL)
+ fputs(p, fp);
+ else
+ fwrite(p, 1, (e - p), fp);
+ fputc(NL, fp);
+}
+
+/**
+ * Select among various ways to emit version information.
+ *
+ * @param[in] o the option descriptor
+ * @param[in] fp the output stream
+ */
+static void
+emit_simple_ver(tOptions * o, FILE * fp)
+{
+ emit_first_line(fp, o->pzFullVersion, o->pzCopyright, o->pzUsageTitle);
+}
+
+/**
+ * print the version with a copyright notice.
+ *
+ * @param[in] o the option descriptor
+ * @param[in] fp the output stream
+ */
+static void
+emit_copy_full(tOptions * o, FILE * fp)
+{
+ if (o->pzCopyright != NULL)
+ fputs(o->pzCopyright, fp);
+
+ else if (o->pzFullVersion != NULL)
+ fputs(o->pzFullVersion, fp);
+
+ else
+ emit_first_line(fp, o->pzUsageTitle, NULL, NULL);
+
+ if (HAS_pzPkgDataDir(o) && (o->pzPackager != NULL)) {
+ fputc(NL, fp);
+ fputs(o->pzPackager, fp);
+
+ } else if (o->pzBugAddr != NULL) {
+ fputc(NL, fp);
+ fprintf(fp, zPlsSendBugs, o->pzBugAddr);
+ }
+}
+
+/**
+ * print the version and any copyright notice.
+ * The version with a full copyright and additional notes.
+ *
+ * @param[in] opts the option descriptor
+ * @param[in] fp the output stream
+ */
+static void
+emit_copy_note(tOptions * opts, FILE * fp)
+{
+ if (opts->pzCopyright != NULL)
+ fputs(opts->pzCopyright, fp);
+
+ if (opts->pzCopyNotice != NULL)
+ fputs(opts->pzCopyNotice, fp);
+
+ fputc(NL, fp);
+ fprintf(fp, zao_ver_fmt, optionVersion());
+
+ if (HAS_pzPkgDataDir(opts) && (opts->pzPackager != NULL)) {
+ fputc(NL, fp);
+ fputs(opts->pzPackager, fp);
+
+ } else if (opts->pzBugAddr != NULL) {
+ fputc(NL, fp);
+ fprintf(fp, zPlsSendBugs, opts->pzBugAddr);
+ }
+}
+
+/**
+ * Handle the version printing. We must see how much information
+ * is being requested and select the correct printing routine.
+ */
+static void
+print_ver(tOptions * opts, tOptDesc * od, FILE * fp, bool call_exit)
+{
+ char ch;
+
+ if (opts <= OPTPROC_EMIT_LIMIT)
+ return;
+
+ /*
+ * IF we have an argument for this option, use it
+ * Otherwise, default to version only or copyright note,
+ * depending on whether the layout is GNU standard form or not.
+ */
+ if ( (od->fOptState & OPTST_ARG_OPTIONAL)
+ && (od->optArg.argString != NULL)
+ && (od->optArg.argString[0] != NUL))
+
+ ch = od->optArg.argString[0];
+
+ else {
+ set_usage_flags(opts, NULL);
+ ch = (opts->fOptSet & OPTPROC_GNUUSAGE) ? 'c' : 'v';
+ }
+
+ switch (ch) {
+ case NUL: /* arg provided, but empty */
+ case 'v': case 'V': emit_simple_ver(opts, fp); break;
+ case 'c': case 'C': emit_copy_full( opts, fp); break;
+ case 'n': case 'N': emit_copy_note( opts, fp); break;
+
+ default:
+ fprintf(stderr, zBadVerArg, ch);
+ option_exits(EXIT_FAILURE);
+ }
+
+ fflush(fp);
+ if (ferror(fp))
+ fserr_exit(opts->pzProgName, zwriting,
+ (fp == stdout) ? zstdout_name : zstderr_name);
+
+ if (call_exit)
+ option_exits(EXIT_SUCCESS);
+}
+
+/*=export_func optionPrintVersion
+ *
+ * what: Print the program version
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * This routine will print the version to stdout.
+=*/
+void
+optionPrintVersion(tOptions * opts, tOptDesc * od)
+{
+ print_ver(opts, od, print_exit ? stderr : stdout, true);
+}
+
+/*=export_func optionPrintVersionAndReturn
+ *
+ * what: Print the program version
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * This routine will print the version to stdout and return
+ * instead of exiting. Please see the source for the
+ * @code{print_ver} funtion for details on selecting how
+ * verbose to be after this function returns.
+=*/
+void
+optionPrintVersionAndReturn(tOptions * opts, tOptDesc * od)
+{
+ print_ver(opts, od, print_exit ? stderr : stdout, false);
+}
+
+/*=export_func optionVersionStderr
+ * private:
+ *
+ * what: Print the program version to stderr
+ * arg: + tOptions* + opts + program options descriptor +
+ * arg: + tOptDesc* + od + the descriptor for this arg +
+ *
+ * doc:
+ * This routine will print the version to stderr.
+=*/
+void
+optionVersionStderr(tOptions * opts, tOptDesc * od)
+{
+ print_ver(opts, od, stderr, true);
+}
+
+/** @}
+ *
+ * Local Variables:
+ * mode: C
+ * c-file-style: "stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * end of autoopts/version.c */
diff --git a/sntp/loc/README b/sntp/loc/README
new file mode 100644
index 0000000..58f2169
--- /dev/null
+++ b/sntp/loc/README
@@ -0,0 +1,17 @@
+If you look at the files here you should be able to figure out what is
+being done.
+
+../scripts/genLocInfo handles the parsing of these files.
+
+If no "more specific" file has been found and cvo.sh says the OS is
+redhat* or fedora*, we will look for loc/redhat .
+
+If no "mode specific" file has been found and the "uname" command returns
+"Linux", we will look for loc/linux .
+
+Note that automake has interesting behavior - we build the man pages using
+the man_MANS target, but they are actually installed using the empty
+manX_MANS= target, which "does the right thing". This means that we
+need to have empty manX_MANS= targets for each possible X, based on
+the data in the loc/ files. For executables, this generally means
+sections 1 and 8.
diff --git a/sntp/loc/darwin b/sntp/loc/darwin
new file mode 100644
index 0000000..c902860
--- /dev/null
+++ b/sntp/loc/darwin
@@ -0,0 +1,14 @@
+# Darwin (Mac OS X) installations and man page suffixes
+MDOC
+ntp-keygen,bin,8
+ntp-wait,sbin,8
+ntpd,sbin,8
+ntpdate,sbin,8
+ntpdc,sbin,8
+ntpdsim,sbin,8
+ntpq,bin,8
+ntpsnmpd,sbin,8
+ntpsweep,noinst,8
+ntptime,sbin,8
+ntptrace,sbin,8
+sntp,bin,8
diff --git a/sntp/loc/debian b/sntp/loc/debian
new file mode 100644
index 0000000..7bc895a
--- /dev/null
+++ b/sntp/loc/debian
@@ -0,0 +1,17 @@
+# Debian installations and man page suffixes
+MDOC
+calc_tickadj,sbin,8
+ntp-keygen,sbin,8
+ntp-wait,sbin,8
+ntpd,sbin,8
+ntpdate,sbin,8
+ntpdc,bin,1
+ntpdsim,sbin,8
+ntpq,bin,1
+ntpsnmpd,sbin,8
+ntpsweep,bin,1
+ntptime,sbin,8
+ntptrace,bin,1
+sntp,bin,1
+tickadj,sbin,8
+timetrim,sbin,8
diff --git a/sntp/loc/freebsd b/sntp/loc/freebsd
new file mode 100644
index 0000000..7759e31
--- /dev/null
+++ b/sntp/loc/freebsd
@@ -0,0 +1,14 @@
+# FreeBSD installations and man page suffixes
+MDOC
+ntp-keygen,sbin,8
+ntp-wait,sbin,8
+ntpd,sbin,8
+ntpdate,sbin,8
+ntpdc,sbin,8
+ntpdsim,sbin,8
+ntpq,sbin,8
+ntpsnmpd,sbin,8
+ntptime,sbin,8
+ntpsweep,noinst,8
+ntptrace,sbin,8
+sntp,sbin,8
diff --git a/sntp/loc/legacy b/sntp/loc/legacy
new file mode 100644
index 0000000..46c63a2
--- /dev/null
+++ b/sntp/loc/legacy
@@ -0,0 +1,17 @@
+# Legacy installations and man page suffixes
+MAN
+calc_tickadj,bin,1
+ntp-keygen,bin,1
+ntp-wait,bin,1
+ntpd,bin,1
+ntpdate,bin,1
+ntpdc,bin,1
+ntpdsim,bin,1
+ntpq,bin,1
+ntpsnmpd,bin,1
+ntpsweep,noinst,1
+ntptime,bin,1
+ntptrace,bin,1
+sntp,bin,1
+tickadj,bin,1
+timetrim,bin,1
diff --git a/sntp/loc/netbsd b/sntp/loc/netbsd
new file mode 100644
index 0000000..e84f789
--- /dev/null
+++ b/sntp/loc/netbsd
@@ -0,0 +1,14 @@
+# NetBSD installations and man page suffixes
+MDOC
+ntp-keygen,sbin,8
+ntp-wait,sbin,8
+ntpd,sbin,8
+ntpdate,sbin,8
+ntpdc,sbin,8
+ntpdsim,sbin,8
+ntpq,sbin,8
+ntpsnmpd,sbin,8
+ntpsweep,noinst,8
+ntptime,sbin,8
+ntptrace,sbin,8
+sntp,bin,1
diff --git a/sntp/loc/redhat b/sntp/loc/redhat
new file mode 100644
index 0000000..a35a605
--- /dev/null
+++ b/sntp/loc/redhat
@@ -0,0 +1,17 @@
+# RedHat/Fedora installations and man page suffixes
+MAN
+calc_tickadj,sbin,8
+ntp-keygen,sbin,8
+ntp-wait,sbin,8
+ntpd,sbin,8
+ntpdate,sbin,8
+ntpdc,sbin,8
+ntpdsim,sbin,8
+ntpq,sbin,8
+ntpsnmpd,sbin,8
+ntpsweep,noinst,8
+ntptime,sbin,8
+ntptrace,sbin,8
+sntp,sbin,8
+tickadj,sbin,8
+timetrim,sbin,8
diff --git a/sntp/loc/solaris b/sntp/loc/solaris
new file mode 100644
index 0000000..eca1438
--- /dev/null
+++ b/sntp/loc/solaris
@@ -0,0 +1,16 @@
+# Solaris installations and man page suffixes
+MAN
+calc_tickadj,sbin,1m
+ntp-keygen,sbin,1m
+ntp-wait,libexec,1m
+ntpd,libexec,1m
+ntpdate,sbin,1m
+ntpdc,sbin,1m
+ntpdsim,sbin,1m
+ntpq,sbin,1m
+ntpsnmpd,libexec,1m
+ntpsweep,noinst,1m
+ntptime,sbin,1m
+ntptrace,sbin,1m
+sntp,sbin,1m
+tickadj,sbin,1m
diff --git a/sntp/log.c b/sntp/log.c
new file mode 100644
index 0000000..d703495
--- /dev/null
+++ b/sntp/log.c
@@ -0,0 +1,38 @@
+#include <config.h>
+
+#include "log.h"
+
+char *progname; /* for msyslog use too */
+
+static void cleanup_log(void);
+
+void
+sntp_init_logging(
+ const char *prog
+ )
+{
+ msyslog_term = TRUE;
+ init_logging(prog, 0, FALSE);
+ msyslog_term_pid = FALSE;
+ msyslog_include_timestamp = FALSE;
+}
+
+
+void
+open_logfile(
+ const char *logfile
+ )
+{
+ change_logfile(logfile, FALSE);
+ atexit(cleanup_log);
+}
+
+
+static void
+cleanup_log(void)
+{
+ syslogit = TRUE;
+ fflush(syslog_file);
+ fclose(syslog_file);
+ syslog_file = NULL;
+}
diff --git a/sntp/log.h b/sntp/log.h
new file mode 100644
index 0000000..fdb2ba2
--- /dev/null
+++ b/sntp/log.h
@@ -0,0 +1,27 @@
+#ifndef LOG_H
+#define LOG_H
+
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <syslog.h>
+#include <time.h>
+
+/* syslog as ntpd does, even though we are not a daemon */
+#ifdef LOG_NTP
+# define OPENLOG_FAC LOG_NTP
+#else
+# ifndef LOG_DAEMON
+# define LOG_DAEMON 0
+# endif
+# define OPENLOG_FAC LOG_DAEMON
+#endif
+
+void sntp_init_logging(const char *program);
+void open_logfile(const char *logfile);
+
+extern char *progname; /* for msyslog use too */
+
+#endif
diff --git a/sntp/m4/define_dir.m4 b/sntp/m4/define_dir.m4
new file mode 100644
index 0000000..3b48c8b
--- /dev/null
+++ b/sntp/m4/define_dir.m4
@@ -0,0 +1,35 @@
+dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
+dnl
+dnl This macro sets VARNAME to the expansion of the DIR variable,
+dnl taking care of fixing up ${prefix} and such.
+dnl
+dnl VARNAME is then offered as both an output variable and a C
+dnl preprocessor symbol.
+dnl
+dnl Example:
+dnl
+dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
+dnl
+dnl @category Misc
+dnl @author Stepan Kasal <kasal@ucw.cz>
+dnl @author Andreas Schwab <schwab@suse.de>
+dnl @author Guido U. Draheim <guidod@gmx.de>
+dnl @author Alexandre Oliva
+dnl @version 2006-10-13
+dnl @license AllPermissive
+
+AC_DEFUN([AC_DEFINE_DIR], [
+ prefix_NONE=
+ exec_prefix_NONE=
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
+dnl refers to ${prefix}. Thus we have to use `eval' twice.
+ eval ac_define_dir="\"[$]$2\""
+ eval ac_define_dir="\"$ac_define_dir\""
+ AC_SUBST($1, "$ac_define_dir")
+ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
+ test "$prefix_NONE" && prefix=NONE
+ test "$exec_prefix_NONE" && exec_prefix=NONE
+])
+
diff --git a/sntp/m4/hms_search_lib.m4 b/sntp/m4/hms_search_lib.m4
new file mode 100644
index 0000000..e6dd601
--- /dev/null
+++ b/sntp/m4/hms_search_lib.m4
@@ -0,0 +1,30 @@
+dnl Helper function to manage granular libraries
+dnl
+dnl Usage:
+dnl
+dnl LIB_MATH=''
+dnl AC_SUBST([LIB_MATH])
+dnl ...
+dnl HMS_SEARCH_LIBS([LIB_MATH], [sqrt], [m], [AIF], [AINF], [OL])
+dnl
+dnl which expands to something like:
+dnl
+dnl AC_SEARCH_LIBS([sqrt], [m], [case "$ac_cv_search_sqrt" in
+dnl 'none required') ;;
+dnl no) ;;
+dnl *) LIB_MATH="$ac_cv_search_sqrt $LIB_MATH" ;;
+dnl esac
+dnl [AIF]],
+dnl [AINF],
+dnl [OL])
+dnl
+dnl arguments are: lib-var, function, search-libs, [AIF], [AINF], [other-libs]
+AC_DEFUN([HMS_SEARCH_LIBS],
+[AC_SEARCH_LIBS([$2], [$3], [case "$ac_cv_search_$2[]" in
+ 'none required') ;;
+ no) ;;
+ *) $1[]="$ac_cv_search_$2[] $[]$1" ;;
+ esac
+ [$4]],
+ [$5],
+ [$6])])
diff --git a/sntp/m4/libtool.m4 b/sntp/m4/libtool.m4
new file mode 100644
index 0000000..d812584
--- /dev/null
+++ b/sntp/m4/libtool.m4
@@ -0,0 +1,7831 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*) ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/sntp/m4/ltoptions.m4 b/sntp/m4/ltoptions.m4
new file mode 100644
index 0000000..17cfd51
--- /dev/null
+++ b/sntp/m4/ltoptions.m4
@@ -0,0 +1,369 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/sntp/m4/ltsugar.m4 b/sntp/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/sntp/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/sntp/m4/ltversion.m4 b/sntp/m4/ltversion.m4
new file mode 100644
index 0000000..9c7b5d4
--- /dev/null
+++ b/sntp/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3293 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4])
+m4_define([LT_PACKAGE_REVISION], [1.3293])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4'
+macro_revision='1.3293'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/sntp/m4/lt~obsolete.m4 b/sntp/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/sntp/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/sntp/m4/ntp_cacheversion.m4 b/sntp/m4/ntp_cacheversion.m4
new file mode 100644
index 0000000..3619a60
--- /dev/null
+++ b/sntp/m4/ntp_cacheversion.m4
@@ -0,0 +1,129 @@
+# NTP_CACHEVERSION(component, version)
+# ------------------------------------
+# compare this configure script's cache version stamp with the stamp
+# saved by the prior run in config.cache. If they differ, clear all
+# cache variables to avoid using results cached with a script that
+# is known to differ in a cache-invalidating manner.
+#
+# Note: use immediately following AC_INIT in configure.ac, as clearing
+# all _cv_ variables only makes sense immediately after loading, before
+# use or modification.
+#
+# The top-level configure.ac in a subtree using NTP_CACHEVERSION
+# will clear a previous cache lacking any saved cache version number,
+# while children do not. This comes into play only when introducing
+# NTP_CACHEVERSION where it had not been previously used: Previous
+# cached results are presumed incompatible and not used. The reason
+# children do not flush the cached is it is shared with the parent and
+# the children can rely on the parent having cleared any cache variables
+# predating this mechanism. Therefore the child can rely on the
+# config.cache generated by the parent on the first run despite not
+# finding the child version stamp in it.
+#
+# See html/copyright.html or COPYRIGHT in plain text.
+
+AC_DEFUN_ONCE([NTP_CACHEVERSION], [
+ AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
+ AC_BEFORE([$0], [AC_CONFIG_HEADERS])dnl
+ AC_BEFORE([$0], [AC_PROG_CC])dnl
+ AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
+
+ ntp_cache_flush=1
+
+ case "$ntp_cv_[$1]_cache_version" in
+ [$2])
+ # same version, good
+ ntp_cache_flush=0
+ ;;
+ '')
+ # No cache, predates ntp_cv_$1_cache_version, or is empty.
+ case "$cache_file" in
+ /dev/null)
+ ntp_cache_flush=0
+ ;;
+ *)
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
+ # Do not clear the cache immediately after it is created
+ # empty as it is noisy. Differentiate a newly-created
+ # config.cache from one predating the cache version
+ # mechanism by looking for the first cached variable set
+ # by Autoconf
+ case "$ac_cv_path_install" in
+ '')
+ # empty config.cache file
+ ntp_cache_flush=0
+ esac
+ ;;
+ *)
+ # Parent configure just created cache from empty,
+ # flushing would be counterproductive.
+ ntp_cache_flush=0;
+ ;;
+ esac
+ esac
+ ;;
+ *)
+ # configure cache version mismatches config.cache version
+ ;;
+ esac
+
+ case "$ntp_cache_flush" in
+ 1)
+ c_version="${ntp_cv_[$1]_cache_version:-(no version found)}"
+
+ # Do we flush all variables or exclude others' version stamps?
+
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
+ # Clear all *_cv_* variables including our child subdirs'
+ # ntp_cv_*_cache_version variables. This prevents subdir
+ # configure scripts from noticing a version mismatch just
+ # after the top configure in the invocation cleared and
+ # recreated the cache.
+
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/_cv_/p'
+ `
+ ;;
+ *)
+ # This is not the top configure this particular invocation.
+ # Clear all *_cv_* variables sparing the version stamps
+ # of other configure scripts, so we don't trigger
+ # useless repeated clearings.
+
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/ntp_cv_.*_cache_version/d' \
+ -e '/_cv_/p'
+ `
+ esac
+
+ for c_varname in $c_varname_list
+ do
+ dnl AS_UNSET([$c_varname])
+ dnl With Autoconf 2.61 and automake 1.10.3, using AS_UNSET
+ dnl here triggers generation of a syntax error in configure.
+ dnl Once we require a newer Autoconf we can revert to the
+ dnl AS_UNSET code.
+ { eval $c_varname=; unset $c_varname; }
+ done
+
+ AC_MSG_NOTICE([[$cache_file saved by another version, ignored.]])
+ AC_MSG_NOTICE([[configure script cache version: ]][$2])
+ AC_MSG_NOTICE([[$cache_file version: $c_version]])
+ AS_UNSET([c_varname])
+ AS_UNSET([c_varname_list])
+ AS_UNSET([c_version])
+ esac
+
+ AS_UNSET([ntp_cache_flush])
+
+ # save configure version in config.cache for next time
+ ntp_cv_[$1]_cache_version="[$2]"
+
+ # let any subdir configure.ac NTP_CACHEVERSION invocations
+ # know they are not the top level.
+ NTP_CACHEVERSION_PARENT='[$1]' ; export NTP_CACHEVERSION_PARENT
+])dnl
diff --git a/sntp/m4/ntp_compiler.m4 b/sntp/m4/ntp_compiler.m4
new file mode 100644
index 0000000..2b41866
--- /dev/null
+++ b/sntp/m4/ntp_compiler.m4
@@ -0,0 +1,195 @@
+dnl ######################################################################
+dnl Common m4sh code for compiler stuff
+AC_DEFUN([NTP_COMPILER], [
+AC_REQUIRE([AC_PROG_CC_C89])
+
+CFLAGS_NTP=
+CPPFLAGS_NTP=
+LDADD_NTP=
+LDFLAGS_NTP=
+AC_SUBST([CFLAGS_NTP])
+AC_SUBST([CPPFLAGS_NTP])
+AC_SUBST([LDADD_NTP])
+AC_SUBST([LDFLAGS_NTP])
+
+case "$ac_cv_prog_cc_c89" in
+ no)
+ AC_MSG_WARN([ANSI C89/ISO C90 is the minimum to compile NTP]
+ [ version 4.2.5 and higher.])
+ ;;
+esac
+
+AC_CACHE_CHECK(
+ [if $CC can handle @%:@warning],
+ [ntp_cv_cpp_warning],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[#warning foo]])],
+ [ntp_cv_cpp_warning=yes],
+ [ntp_cv_cpp_warning=no]
+ )]
+)
+case "$ntp_cv_cpp_warning" in
+ no)
+ AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1],
+ [Should we avoid @%:@warning on option name collisions?])
+esac
+
+AC_CACHE_CHECK(
+ [if $CC supports __attribute__((...))],
+ [ntp_cv_cc_attribute],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[]],
+ [[void foo(void) __attribute__((__noreturn__));]]
+ )],
+ [ntp_cv_cc_attribute=yes],
+ [ntp_cv_cc_attribute=no]
+ )]
+)
+case "$ntp_cv_cc_attribute" in
+ yes)
+ AC_DEFINE([HAVE___ATTRIBUTE__], [],
+ [defined if C compiler supports __attribute__((...))])
+esac
+AH_VERBATIM(
+ [HAVE___ATTRIBUTE___VERBATIM],
+ [
+ /* define away __attribute__() if unsupported */
+ #ifndef HAVE___ATTRIBUTE__
+ # define __attribute__(x) /* empty */
+ #endif
+ #define ISC_PLATFORM_NORETURN_PRE
+ #define ISC_PLATFORM_NORETURN_POST __attribute__((__noreturn__))
+ ]
+)
+
+case "$GCC" in
+ yes)
+ SAVED_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wstrict-overflow"
+ AC_CACHE_CHECK(
+ [if $CC can handle -Wstrict-overflow],
+ [ntp_cv_gcc_Wstrict_overflow],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [ntp_cv_gcc_Wstrict_overflow=yes],
+ [ntp_cv_gcc_Wstrict_overflow=no]
+ ) ]
+ )
+ #
+ # $ntp_cv_gcc_Wstrict_overflow is tested later to add the
+ # flag to CFLAGS.
+ #
+ CFLAGS="$SAVED_CFLAGS -Winit-self"
+ AC_CACHE_CHECK(
+ [if $CC can handle -Winit-self],
+ [ntp_cv_gcc_Winit_self],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [ntp_cv_gcc_Winit_self=yes],
+ [ntp_cv_gcc_Winit_self=no]
+ )
+ ]
+ )
+ CFLAGS="$SAVED_CFLAGS"
+ AS_UNSET([SAVED_CFLAGS])
+ #
+ # $ntp_cv_gcc_Winit_self is tested later to add the
+ # flag to CFLAGS_NTP.
+ #
+ AC_CACHE_CHECK(
+ [if linker supports omitting unused code and data],
+ [ntp_cv_gc_sections_runs],
+ [
+ dnl NetBSD will link but likely not run with --gc-sections
+ dnl http://bugs.ntp.org/1844
+ dnl http://gnats.netbsd.org/40401
+ dnl --gc-sections causes attempt to load as linux elf, with
+ dnl wrong syscalls in place. Test a little gauntlet of
+ dnl simple stdio read code checking for errors, expecting
+ dnl enough syscall differences that the NetBSD code will
+ dnl fail even with Linux emulation working as designed.
+ dnl A shorter test could be refined by someone with access
+ dnl to a NetBSD host with Linux emulation working.
+ origCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,--gc-sections"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stdlib.h>
+ #include <stdio.h>
+ ]],
+ [[
+ FILE * fpC;
+ char buf[32];
+ size_t cch;
+ int read_success_once;
+
+ fpC = fopen("conftest.c", "r");
+ if (NULL == fpC)
+ exit(1);
+ do {
+ cch = fread(buf, sizeof(buf), 1, fpC);
+ read_success_once |= (0 != cch);
+ } while (0 != cch);
+ if (!read_success_once)
+ exit(2);
+ if (!feof(fpC))
+ exit(3);
+ if (0 != fclose(fpC))
+ exit(4);
+
+ exit(EXIT_SUCCESS);
+ ]]
+ )],
+ [
+ if test "X$cross_compiling" = "Xyes" || grep gc-sections conftest.err ; then
+ ntp_cv_gc_sections_runs=no
+ else
+ ntp_cv_gc_sections_runs=no
+ ./conftest >/dev/null 2>&1 && ntp_cv_gc_sections_runs=yes
+ fi
+ ],
+ [ntp_cv_gc_sections_runs=no]
+ )
+ CFLAGS="$origCFLAGS"
+ AS_UNSET([origCFLAGS])
+ ]
+ )
+ case "$ntp_cv_gc_sections_runs" in
+ yes)
+ LDADD_LIBNTP="-Wl,--gc-sections"
+ CFLAGS_NTP="$CFLAGS_NTP -ffunction-sections -fdata-sections"
+ ;;
+ no)
+ LDADD_LIBNTP=
+ ;;
+ esac
+ CFLAGS_NTP="$CFLAGS_NTP -Wall"
+ CFLAGS_NTP="$CFLAGS_NTP -Wcast-align"
+ CFLAGS_NTP="$CFLAGS_NTP -Wcast-qual"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wconversion"
+ # CFLAGS_NTP="$CFLAGS_NTP -Werror"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wextra"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wfloat-equal"
+ CFLAGS_NTP="$CFLAGS_NTP -Wmissing-prototypes"
+ CFLAGS_NTP="$CFLAGS_NTP -Wpointer-arith"
+ CFLAGS_NTP="$CFLAGS_NTP -Wshadow"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wtraditional"
+ # CFLAGS_NTP="$CFLAGS_NTP -Wwrite-strings"
+ case "$ntp_cv_gcc_Winit_self" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Winit-self"
+ esac
+ case "$ntp_cv_gcc_Wstrict_overflow" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-overflow"
+ esac
+ # -W[no-]strict-prototypes might be added by NTP_OPENSSL
+esac
+
+NTP_OS_CFLAGS
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_crosscompile.m4 b/sntp/m4/ntp_crosscompile.m4
new file mode 100644
index 0000000..941618d
--- /dev/null
+++ b/sntp/m4/ntp_crosscompile.m4
@@ -0,0 +1,8 @@
+dnl ######################################################################
+AC_DEFUN([NTP_CROSSCOMPILE], [
+
+# Expose a cross-compilation indicator to makefiles
+AM_CONDITIONAL([NTP_CROSSCOMPILE], [test $build != $host])
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_debug.m4 b/sntp/m4/ntp_debug.m4
new file mode 100644
index 0000000..820f9a0
--- /dev/null
+++ b/sntp/m4/ntp_debug.m4
@@ -0,0 +1,22 @@
+dnl ######################################################################
+dnl Common m4sh code for debug
+AC_DEFUN([NTP_DEBUG], [
+
+AC_MSG_CHECKING([if we're including debugging code])
+AC_ARG_ENABLE(
+ [debugging],
+ [AS_HELP_STRING(
+ [--enable-debugging],
+ [+ include ntpd debugging code]
+ )],
+ [ntp_ok=$enableval],
+ [ntp_ok=yes]
+)
+case "$ntp_ok" in
+ yes)
+ AC_DEFINE([DEBUG], [1], [Enable debugging code?])
+esac
+AC_MSG_RESULT([$ntp_ok])
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_dir_sep.m4 b/sntp/m4/ntp_dir_sep.m4
new file mode 100644
index 0000000..d10735b
--- /dev/null
+++ b/sntp/m4/ntp_dir_sep.m4
@@ -0,0 +1,24 @@
+dnl ######################################################################
+dnl What directory path separator do we use?
+AC_DEFUN([NTP_DIR_SEP], [
+AC_CACHE_CHECK(
+ [for directory path separator],
+ [ntp_cv_dir_sep],
+ [
+ case "$ntp_cv_dir_sep" in
+ '')
+ case "$host_os" in
+ *djgpp | *mingw32* | *emx*)
+ ntp_cv_dir_sep="'\\'"
+ ;;
+ *)
+ ntp_cv_dir_sep="'/'"
+ ;;
+ esac
+ esac
+ ]
+)
+AC_DEFINE_UNQUOTED([DIR_SEP], [$ntp_cv_dir_sep],
+ [Directory separator character, usually / or \\])
+])
+dnl ======================================================================
diff --git a/sntp/m4/ntp_facilitynames.m4 b/sntp/m4/ntp_facilitynames.m4
new file mode 100644
index 0000000..f58f894
--- /dev/null
+++ b/sntp/m4/ntp_facilitynames.m4
@@ -0,0 +1,24 @@
+dnl ######################################################################
+dnl Check syslog.h for 'facilitynames' table
+AC_DEFUN([NTP_FACILITYNAMES], [
+AC_CACHE_CHECK([for facilitynames in syslog.h],ac_cv_HAVE_SYSLOG_FACILITYNAMES,[
+AC_TRY_COMPILE([
+#define SYSLOG_NAMES
+#include <stdlib.h>
+#include <syslog.h>
+],
+[ void *fnames; fnames = facilitynames; ],
+ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes,ac_cv_HAVE_SYSLOG_FACILITYNAMES=no,ac_cv_HAVE_SYSLOG_FACILITYNAMES=cross)])
+case "$ac_cv_HAVE_SYSLOG_FACILITYNAMES" in
+ yes)
+ AC_DEFINE(HAVE_SYSLOG_FACILITYNAMES,1,[ ])
+ ;;
+ no)
+ AC_MSG_WARN([No facilitynames in <syslog.h>])
+ ;;
+ cross)
+ AC_MSG_WARN([facilitynames in <syslog.h> - cross-compiling])
+ ;;
+esac
+])
+dnl ======================================================================
diff --git a/sntp/m4/ntp_googletest.m4 b/sntp/m4/ntp_googletest.m4
new file mode 100644
index 0000000..4aa740f
--- /dev/null
+++ b/sntp/m4/ntp_googletest.m4
@@ -0,0 +1,53 @@
+dnl ######################################################################
+dnl NTP_GOOGLETEST gtest support shared by top-level and sntp/configure.ac
+AC_DEFUN([NTP_GOOGLETEST], [
+gta=false
+AC_ARG_WITH(
+ [gtest],
+ [AS_HELP_STRING(
+ [--with-gtest],
+ [Use the gtest framework (Default: if it's available)]
+ )],
+ [try_gtest=$withval],
+ [try_gtest=yes]
+)
+case "$try_gtest" in
+ yes)
+ AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
+ AS_UNSET([ac_cv_path_GTEST_CONFIG])
+ case x${GTEST_CONFIG} in
+ x) ;;
+ *)
+ AC_MSG_CHECKING([gtest version])
+ gtest_version_test=`$GTEST_CONFIG --min-version=1.5 || echo toolow`
+ case "$gtest_version_test" in
+ toolow*)
+ ;;
+ *)
+ GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags`
+ GTEST_LIBS=`$GTEST_CONFIG --libs`
+ GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags`
+ GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags`
+ AC_SUBST([GTEST_LDFLAGS])
+ AC_SUBST([GTEST_LIBS])
+ AC_SUBST([GTEST_CXXFLAGS])
+ AC_SUBST([GTEST_CPPFLAGS])
+ gta=true
+ ;;
+ esac
+ gtest_version=`$GTEST_CONFIG --version`
+ case "$gta" in
+ true)
+ AC_MSG_RESULT([($gtest_version) ok])
+ ;;
+ *) AC_MSG_RESULT([($gtest_version) not ok])
+ ;;
+ esac
+ AS_UNSET([gtest_version_test])
+ AS_UNSET([gtest_version])
+ esac
+esac
+AM_CONDITIONAL([GTEST_AVAILABLE], [$gta])
+
+])
+dnl ======================================================================
diff --git a/sntp/m4/ntp_ipv6.m4 b/sntp/m4/ntp_ipv6.m4
new file mode 100644
index 0000000..079e510
--- /dev/null
+++ b/sntp/m4/ntp_ipv6.m4
@@ -0,0 +1,528 @@
+dnl ######################################################################
+dnl Common IPv6 detection for NTP configure.ac files
+AC_DEFUN([NTP_IPV6], [
+
+AC_CACHE_CHECK(
+ [for struct sockaddr_storage],
+ [ntp_cv_sockaddr_storage],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ ]],
+ [[
+ struct sockaddr_storage n;
+ ]]
+ )],
+ [ntp_cv_sockaddr_storage=yes],
+ [ntp_cv_sockaddr_storage=no]
+ )]
+)
+case "$ntp_cv_sockaddr_storage" in
+ yes)
+ AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], [1],
+ [Does a system header define struct sockaddr_storage?])
+ AC_CACHE_CHECK(
+ [for sockaddr_storage.__ss_family],
+ [ntp_cv_have___ss_family],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ ]],
+ [[
+ struct sockaddr_storage s;
+ s.__ss_family = 1;
+ ]]
+ )],
+ [ntp_cv_have___ss_family=yes],
+ [ntp_cv_have___ss_family=no]
+ )]
+ )
+ case "$ntp_cv_have___ss_family" in
+ yes)
+ AC_DEFINE([HAVE___SS_FAMILY_IN_SS], [1],
+ [Does struct sockaddr_storage have __ss_family?])
+ esac
+ AH_VERBATIM(
+ [HAVE___SS_FAMILY_IN_SS_VERBATIM],
+ [
+ /* Handle sockaddr_storage.__ss_family */
+ #ifdef HAVE___SS_FAMILY_IN_SS
+ # define ss_family __ss_family
+ #endif /* HAVE___SS_FAMILY_IN_SS */
+ ]
+ )
+esac
+
+
+#
+# Look for in_port_t.
+#
+AC_CACHE_CHECK(
+ [for in_port_t],
+ [isc_cv_have_in_port_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ ]],
+ [[
+ in_port_t port = 25;
+ return (0);
+ ]]
+ )],
+ [isc_cv_have_in_port_t=yes],
+ [isc_cv_have_in_port_t=no]
+ )]
+)
+case "$isc_cv_have_in_port_t" in
+ no)
+ AC_DEFINE([ISC_PLATFORM_NEEDPORTT], [1],
+ [Declare in_port_t?])
+esac
+
+AC_CACHE_CHECK(
+ [type of socklen arg for getsockname()],
+ [ntp_cv_getsockname_socklen_type],
+ [
+ getsockname_socklen_type_found=no
+ for getsockname_arg2 in 'struct sockaddr *' 'void *'; do
+ for ntp_cv_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ ]], [[
+ extern
+ getsockname(int, $getsockname_arg2,
+ $ntp_cv_getsockname_socklen_type *);
+ ]]
+ )],
+ [getsockname_socklen_type_found=yes ; break 2],
+ []
+ )
+ done
+ done
+ case "$getsockname_socklen_type_found" in
+ no)
+ ntp_cv_getsockname_socklen_type='socklen_t'
+ esac
+ AS_UNSET([getsockname_arg2])
+ AS_UNSET([getsockname_socklen_type_found])
+ ]
+)
+AC_DEFINE_UNQUOTED([GETSOCKNAME_SOCKLEN_TYPE],
+ [$ntp_cv_getsockname_socklen_type],
+ [What is getsockname()'s socklen type?])
+
+AC_CACHE_CHECK(
+ [struct sockaddr for sa_len],
+ [isc_cv_platform_havesalen],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ]],
+ [[
+ extern struct sockaddr *ps;
+ return ps->sa_len;
+ ]]
+ )],
+ [isc_cv_platform_havesalen=yes],
+ [isc_cv_platform_havesalen=no]
+ )]
+)
+case "$isc_cv_platform_havesalen" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_HAVESALEN], [1],
+ [struct sockaddr has sa_len?])
+esac
+
+AC_ARG_ENABLE(
+ [ipv6],
+ [AS_HELP_STRING(
+ [--enable-ipv6],
+ [s use IPv6?]
+ )]
+)
+
+case "$enable_ipv6" in
+ yes|''|autodetect)
+ case "$host" in
+ powerpc-ibm-aix4*)
+ ;;
+ *)
+ AC_DEFINE([WANT_IPV6], [1], [configure --enable-ipv6])
+ ;;
+ esac
+ ;;
+ no)
+ ;;
+esac
+
+
+dnl [Bug 1984] ntp/libisc fails to compile on OS X 10.7 (Lion)
+case "$host" in
+ *-*-darwin*)
+ AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Are we _special_?])
+esac
+
+
+AC_CACHE_CHECK(
+ [for IPv6 structures],
+ [isc_cv_found_ipv6],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ ]],
+ [[
+ struct sockaddr_in6 sin6;
+ ]]
+ )],
+ [isc_cv_found_ipv6=yes],
+ [isc_cv_found_ipv6=no]
+ )]
+)
+
+#
+# See whether IPv6 support is provided via a Kame add-on.
+# This is done before other IPv6 linking tests so LIBS is properly set.
+#
+AC_MSG_CHECKING([for Kame IPv6 support])
+AC_ARG_WITH(
+ [kame],
+ [AS_HELP_STRING(
+ [--with-kame],
+ [- =/usr/local/v6]
+ )],
+ [use_kame="$withval"],
+ [use_kame="no"]
+)
+case "$use_kame" in
+ no)
+ ;;
+ yes)
+ kame_path=/usr/local/v6
+ ;;
+ *)
+ kame_path="$use_kame"
+ ;;
+esac
+case "$use_kame" in
+ no)
+ AC_MSG_RESULT([no])
+ ;;
+ *)
+ if test -f $kame_path/lib/libinet6.a; then
+ AC_MSG_RESULT([$kame_path/lib/libinet6.a])
+ LIBS="-L$kame_path/lib -linet6 $LIBS"
+ else
+ AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
+
+Please choose the proper path with the following command:
+
+ configure --with-kame=PATH
+])
+ fi
+ ;;
+esac
+
+#
+# Whether netinet6/in6.h is needed has to be defined in isc/platform.h.
+# Including it on Kame-using platforms is very bad, though, because
+# Kame uses #error against direct inclusion. So include it on only
+# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
+# This is done before the in6_pktinfo check because that's what
+# netinet6/in6.h is needed for.
+#
+case "$host" in
+ *-bsdi4.[[01]]*)
+ AC_DEFINE([ISC_PLATFORM_NEEDNETINET6IN6H], [1],
+ [Do we need netinet6/in6.h?])
+ isc_netinet6in6_hack="#include <netinet6/in6.h>"
+ ;;
+ *)
+ isc_netinet6in6_hack=""
+ ;;
+esac
+
+#
+# This is similar to the netinet6/in6.h issue.
+#
+case "$host" in
+ *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+ AC_DEFINE([ISC_PLATFORM_FIXIN6ISADDR], [1],
+ [Do we need to fix in6isaddr?])
+ isc_netinetin6_hack="#include <netinet/in6.h>"
+ ;;
+ *)
+ isc_netinetin6_hack=""
+ ;;
+esac
+
+
+case "$isc_cv_found_ipv6" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIPV6], [1], [have IPv6?])
+ AC_CACHE_CHECK(
+ [for in6_pktinfo],
+ [isc_cv_have_in6_pktinfo],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+ ]],
+ [[
+ struct in6_pktinfo xyzzy;
+ ]]
+ )],
+ [isc_cv_have_in6_pktinfo=yes],
+ [isc_cv_have_in6_pktinfo=no]
+ )]
+ )
+ case "$isc_cv_have_in6_pktinfo" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIN6PKTINFO], [1],
+ [have struct in6_pktinfo?])
+ esac
+
+
+ # HMS: Use HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID instead?
+ AC_CACHE_CHECK(
+ [for sockaddr_in6.sin6_scope_id],
+ [isc_cv_have_sin6_scope_id],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+ ]],
+ [[
+ struct sockaddr_in6 xyzzy;
+ xyzzy.sin6_scope_id = 0;
+ ]]
+ )],
+ [isc_cv_have_sin6_scope_id=yes],
+ [isc_cv_have_sin6_scope_id=no]
+ )]
+ )
+
+ case "$isc_cv_have_sin6_scope_id" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_HAVESCOPEID], [1], [sin6_scope_id?])
+ esac
+esac
+
+
+# We need this check run even without isc_cv_found_ipv6=yes
+
+AC_CACHE_CHECK(
+ [for in6addr_any],
+ [isc_cv_in6addr_any_links],
+ [
+ SAVED_LIBS="$LIBS"
+ LIBS="$LDADD_LIBNTP $LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ AC_INCLUDES_DEFAULT [[
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ $isc_netinetin6_hack
+ $isc_netinet6in6_hack
+ ]],
+ [[
+ printf("%x", in6addr_any.s6_addr[15]);
+ ]]
+ )],
+ [isc_cv_in6addr_any_links=yes],
+ [isc_cv_in6addr_any_links=no]
+ )
+ LIBS="$SAVED_LIBS"
+ AS_UNSET([SAVED_LIBS])
+ ]
+)
+
+case "$isc_cv_in6addr_any_links" in
+ no)
+ AC_DEFINE([ISC_PLATFORM_NEEDIN6ADDRANY], [1], [missing in6addr_any?])
+esac
+
+
+AC_CACHE_CHECK(
+ [for struct if_laddrconf],
+ [isc_cv_struct_if_laddrconf],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <net/if6.h>
+ ]],
+ [[
+ struct if_laddrconf a;
+ ]]
+ )],
+ [isc_cv_struct_if_laddrconf=yes],
+ [isc_cv_struct_if_laddrconf=no]
+ )]
+)
+
+case "$isc_cv_struct_if_laddrconf" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1],
+ [have struct if_laddrconf?])
+esac
+
+AC_CACHE_CHECK(
+ [for struct if_laddrreq],
+ isc_cv_struct_if_laddrreq,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <net/if6.h>
+ ]],
+ [[
+ struct if_laddrreq a;
+ ]]
+ )],
+ [isc_cv_struct_if_laddrreq=yes],
+ [isc_cv_struct_if_laddrreq=no]
+ )]
+)
+
+case "$isc_cv_struct_if_laddrreq" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1],
+ [have struct if_laddrreq?])
+esac
+
+AC_CACHE_CHECK(
+ [for multicast IP support],
+ [ntp_cv_multicast],
+ [
+ ntp_cv_multicast=no
+ case "$host" in
+ i386-sequent-sysv4)
+ ;;
+ *)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ ]],
+ [[
+ struct ip_mreq ipmr;
+ ipmr.imr_interface.s_addr = 0;
+ ]]
+ )],
+ [ntp_cv_multicast=yes],
+ []
+ )
+ ;;
+ esac
+ ]
+)
+case "$ntp_cv_multicast" in
+ yes)
+ AC_DEFINE([MCAST], [1], [Does the target support multicast IP?])
+ AC_CACHE_CHECK(
+ [arg type needed for setsockopt() IP*_MULTICAST_LOOP],
+ [ntp_cv_typeof_ip_multicast_loop],
+ [
+ case "$host" in
+ *-*-netbsd*|*-*-*linux*)
+ ntp_cv_typeof_ip_multicast_loop=u_int
+ ;;
+ *)
+ ntp_cv_typeof_ip_multicast_loop=u_char
+ ;;
+ esac
+ ]
+ )
+ AC_DEFINE_UNQUOTED([TYPEOF_IP_MULTICAST_LOOP],
+ [$ntp_cv_typeof_ip_multicast_loop],
+ [What type to use for setsockopt])
+esac
+
+AC_ARG_ENABLE(
+ [getifaddrs],
+ [AS_HELP_STRING(
+ [--enable-getifaddrs],
+ [+ Enable the use of getifaddrs() [[yes|no]].]
+ )],
+ [want_getifaddrs="$enableval"],
+ [want_getifaddrs="yes"]
+)
+
+case $want_getifaddrs in
+ glibc)
+ AC_MSG_WARN([--enable-getifaddrs=glibc is no longer required])
+esac
+case $want_getifaddrs in
+ no)
+ ;;
+ *)
+ SAVED_LIBS="$LIBS"
+ LIBS="$LDADD_LIBNTP $LIBS"
+ AC_CHECK_FUNCS([getifaddrs])
+ LIBS="$SAVED_LIBS"
+ AS_UNSET([SAVED_LIBS])
+ ;;
+esac
+
+#
+# Check for if_nametoindex() for IPv6 scoped addresses support
+#
+case "$host" in
+ *-hp-hpux*)
+ AC_SEARCH_LIBS([if_nametoindex], [ipv6])
+esac
+SAVED_LIBS="$LIBS"
+LIBS="$LDADD_LIBNTP $LIBS"
+AC_CHECK_FUNCS([if_nametoindex])
+LIBS="$SAVED_LIBS"
+AS_UNSET([SAVED_LIBS])
+case "$ac_cv_func_if_nametoindex" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIFNAMETOINDEX], [1],
+ [ISC: do we have if_nametoindex()?])
+esac
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_lib_m.m4 b/sntp/m4/ntp_lib_m.m4
new file mode 100644
index 0000000..ea0503c
--- /dev/null
+++ b/sntp/m4/ntp_lib_m.m4
@@ -0,0 +1,17 @@
+dnl ######################################################################
+dnl What do we need for math libraries?
+AC_DEFUN([NTP_LIB_M], [
+LIBM=
+case "$host" in
+ *-*-darwin*)
+ ;;
+ *)
+ _libs=$LIBS
+ AC_SEARCH_LIBS([cos], [m], [LIBM="-lm"])
+ LIBS=$_libs
+ ;;
+esac
+AC_SUBST([LIBM])
+AS_UNSET([_libs])
+])
+dnl ======================================================================
diff --git a/sntp/m4/ntp_libevent.m4 b/sntp/m4/ntp_libevent.m4
new file mode 100644
index 0000000..5f81ae9
--- /dev/null
+++ b/sntp/m4/ntp_libevent.m4
@@ -0,0 +1,150 @@
+dnl NTP_ENABLE_LOCAL_LIBEVENT -*- Autoconf -*-
+dnl
+dnl Provide only the --enable-local-libevent command-line option.
+dnl
+dnl Used standalone by top-level NTP configure.ac, which should have
+dnl --enable-local-libevent in its --help output but which doesn't do
+dnl anything differently based upon its presence or value.
+dnl
+dnl Also AC_REQUIRE'd by NTP_LIBEVENT_CHECK_NOBUILD.
+AC_DEFUN([NTP_ENABLE_LOCAL_LIBEVENT], [
+
+AC_ARG_ENABLE(
+ [local-libevent],
+ [AC_HELP_STRING(
+ [--enable-local-libevent],
+ [Force using the supplied libevent tearoff code]
+ )],
+ [ntp_use_local_libevent=$enableval],
+ [ntp_use_local_libevent=${ntp_use_local_libevent-detect}]
+)
+
+]) dnl NTP_ENABLE_LOCAL_LIBEVENT
+
+dnl NTP_LIBEVENT_CHECK_NOBUILD([MINVERSION [, DIR]]) -*- Autoconf -*-
+dnl
+dnl Look for libevent, which must be at least MINVERSION.
+dnl DIR is the location of our "bundled" copy of libevent.
+dnl If NOBUILD is provided as the 3rd argument, do all of the above,
+dnl but DO NOT invoke DIR/configure if we are going to use our bundled
+dnl version. This may be the case for nested packages.
+dnl
+dnl provide --enable-local-libevent .
+dnl
+dnl Examples:
+dnl
+dnl NTP_LIBEVENT_CHECK_NOBUILD([2.0.9], [sntp/libevent])
+dnl NTP_LIBEVENT_CHECK
+dnl
+AC_DEFUN([NTP_LIBEVENT_CHECK_NOBUILD], [
+AC_REQUIRE([NTP_PKG_CONFIG])dnl
+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([CPPFLAGS_LIBEVENT])
+AC_SUBST([LDADD_LIBEVENT])
+
+case "$ntp_use_local_libevent" in
+ yes)
+ ;;
+ *) # If we have (a good enough) pkg-config, see if it can find libevent
+ case "$PKG_CONFIG" in
+ /*)
+ AC_MSG_CHECKING([if libevent $ntp_libevent_min_version or later is installed])
+ if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent
+ then
+ ntp_use_local_libevent=no
+ AC_MSG_NOTICE([Using the installed libevent])
+ 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.
+ # While we could grab only the -L stuff, there *might* be
+ # other flags there we want. Originally we just removed -levent
+ # but then somebody decided to install -levent-2.0
+ # LDADD_LIBEVENT=`$PKG_CONFIG --libs libevent | sed 's:-levent::'`
+ # So now we dance...
+ LDADD_LIBEVENT=
+ for i in `$PKG_CONFIG --libs libevent`
+ do
+ case "$i" in
+ -levent*) ;;
+ *) case "$LDADD_LIBEVENT" in
+ '') LDADD_LIBEVENT="$i" ;;
+ *) LDADD_LIBEVENT="$LDADD_LIBEVENT $i" ;;
+ esac
+ ;;
+ esac
+ done
+ case "$LIBISC_PTHREADS_NOTHREADS" in
+ pthreads)
+ LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads"
+ esac
+ LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core"
+ AC_MSG_RESULT([yes])
+ else
+ ntp_use_local_libevent=yes
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ ntp_use_local_libevent=yes
+ ;;
+ esac
+ ;;
+esac
+
+case "$ntp_use_local_libevent" in
+ yes)
+ AC_MSG_NOTICE([Using libevent tearoff])
+ CPPFLAGS_LIBEVENT="-I\$(top_builddir)/$ntp_libevent_tearoff/include -I\$(top_srcdir)/$ntp_libevent_tearoff/include"
+ case "$LIBISC_PTHREADS_NOTHREADS" in
+ pthreads)
+ LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_pthreads.la \$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+ ;;
+ *)
+ LDADD_LIBEVENT="\$(top_builddir)/$ntp_libevent_tearoff/libevent_core.la"
+ esac
+esac
+
+AM_CONDITIONAL([BUILD_LIBEVENT], [test "x$ntp_use_local_libevent" = "xyes"])
+
+]) dnl NTP_LIBEVENT_CHECK_NOBUILD
+
+dnl NTP_LIBEVENT_CHECK([MINVERSION [, DIR]]) -*- Autoconf -*-
+AC_DEFUN([NTP_LIBEVENT_CHECK], [
+
+AC_SUBST([NTP_FORCE_LIBEVENT_DIST])
+NTP_LIBEVENT_CHECK_NOBUILD([$1], [$2])
+
+case "$ntp_libevent_tearoff" in
+ libevent)
+ ;;
+ *)
+ AC_MSG_ERROR([ntp_libevent.m4 dir must be libevent, not $ntp_libevent_tearoff])
+ ;;
+esac
+
+case "$ntp_use_local_libevent" in
+ yes)
+ dnl ac_configure_args is undocumented but widely abused, as here,
+ dnl to modify the defaults of the libevent subpackage, by prefixing
+ dnl our changes to the child configure arguments already assembled.
+ dnl User-supplied contradictory choices should prevail thanks to
+ dnl "last wins".
+ ac_configure_args=" --disable-openssl${ac_configure_args}"
+ ac_configure_args=" --disable-shared${ac_configure_args}"
+ ac_configure_args=" --disable-libevent-regress${ac_configure_args}"
+ ac_configure_args=" --disable-libevent-install${ac_configure_args}"
+ ac_configure_args=" --enable-silent-rules${ac_configure_args}"
+ ac_configure_args=" --enable-function-sections${ac_configure_args}"
+ AC_CONFIG_SUBDIRS([libevent])
+ ;;
+ *)
+ NTP_FORCE_LIBEVENT_DIST=libevent
+ ;;
+esac
+
+]) dnl NTP_LIBEVENT_CHECK
+
diff --git a/sntp/m4/ntp_libntp.m4 b/sntp/m4/ntp_libntp.m4
new file mode 100644
index 0000000..13a621d
--- /dev/null
+++ b/sntp/m4/ntp_libntp.m4
@@ -0,0 +1,1137 @@
+dnl ######################################################################
+dnl Common m4sh code for libntp and clients
+dnl
+dnl Any configure tests which libntp or libisc code depends upon should
+dnl be here or in another m4 macro used by the top-level and sntp
+dnl configure.ac files, so that libntp can be moved into the sntp
+dnl subpackage while retaining access to such test results.
+dnl
+AC_DEFUN([NTP_LIBNTP], [
+
+AC_REQUIRE([NTP_CROSSCOMPILE])
+
+# HMS: Save $LIBS and empty it.
+# any LIBS we add here should go in to LDADD_LIBNTP
+AC_SUBST([LDADD_LIBNTP])
+__LIBS=$LIBS
+LIBS=
+
+dnl The contents of NTP_PROG_CC used to be here...
+
+AC_PROG_INSTALL
+# [Bug 2332] because we need to know if we are using GNU ld...
+LT_PATH_LD
+
+NTP_DIR_SEP
+NTP_LINEEDITLIBS
+NTP_LIB_M
+
+AC_FUNC_FORK
+AC_FUNC_ALLOCA
+AC_FUNC_STRERROR_R
+
+ac_busted_vpath_in_make=no
+case "$build" in
+ *-*-irix6.1*) # 64 bit only
+ # busted vpath?
+ ;;
+ *-*-irix6*) # 6.2 (and later?)
+ ac_busted_vpath_in_make=yes
+ ;;
+ *-*-solaris2.5.1)
+ ac_busted_vpath_in_make=yes
+ ;;
+ *-*-unicosmp*)
+ ac_busted_vpath_in_make=yes
+ ;;
+esac
+
+case "$ac_busted_vpath_in_make$srcdir" in
+ yes.|no*)
+ ;;
+ *) case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in
+ '')
+ AC_MSG_ERROR([building outside of the main directory requires GNU make])
+ esac
+ ;;
+esac
+
+case "$host" in
+ *-*-aix4*)
+ # Bug 2516:
+ # Was *-*-aix[[4-9]]*
+ # XXX only verified thru AIX6. But...
+ # Ken Link says this is fine for AIX 5.3 and 7.1, and sees no reason
+ # that this support would be in 5.3, removed in 6, and added back.
+ #
+ # (prr) aix 4.1 doesn't have clock_settime, but in aix 4.3 it's a stub
+ # (returning ENOSYS). I didn't check 4.2. If, in the future,
+ # IBM pulls its thumbs out long enough to implement clock_settime,
+ # this conditional will need to change. Maybe use AC_TRY_RUN
+ # instead to try to set the time to itself and check errno.
+ ;;
+ *)
+ HMS_SEARCH_LIBS([LDADD_LIBNTP], [clock_gettime], [rt])
+ AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime])
+ ;;
+esac
+
+AC_CHECK_FUNCS([getclock stime timegm strlcpy strlcat])
+
+dnl HP-UX 11.31 on HPPA has a net/if.h that can't be compiled with gcc4
+dnl due to an incomplete type (a union) mpinfou used in an array. gcc3
+dnl compiles it without complaint. The mpinfou union is defined later
+dnl in the resulting preprocessed source than the spu_info array in
+dnl /usr/include/machine/sys/getppdp.h:
+dnl extern union mpinfou spu_info[];
+dnl triggering the error. Our strategy is on HP-UX only, test compile
+dnl net/if.h. If that fails, try adding a duplicate definition of
+dnl mpinfou, and if that helps add it to confdefs.h (used for further
+dnl configure tests) and config.h.
+#
+AC_CHECK_HEADERS([errno.h sys/socket.h sys/types.h time.h])
+AC_CHECK_HEADERS([net/if.h], [], [], [
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+])
+case "$host" in
+ *-hp-hpux*)
+ AC_CACHE_CHECK(
+ [if net/if.h requires mpinfou predeclaration],
+ [ntp_cv_predecl_mpinfou],
+ [
+ np_cv_predecl_mpinfou=no
+ case "$ac_cv_header_net_if_h" in
+ no)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+ } mpinfou_t;
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #include <net/if.h>
+ ]],
+ [[
+ ]]
+ )],
+ [
+ ntp_cv_predecl_mpinfou=yes
+ ac_cv_header_net_if_h=yes
+ ]
+ )
+ esac
+ ]
+ )
+ case "$ntp_cv_predecl_mpinfou" in
+ yes)
+ cat >>confdefs.h <<_ACEOF
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+_ACEOF
+ AH_BOTTOM([
+#ifndef MPINFOU_PREDECLARED
+# define MPINFOU_PREDECLARED
+typedef union mpinfou {
+ struct pdk_mpinfo *pdkptr;
+ struct mpinfo *pikptr;
+} mpinfou_t;
+#endif
+])
+ esac
+esac
+
+case "$host" in
+ *-linux*)
+ AC_CHECK_HEADERS([linux/if_addr.h], [], [], [
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ ])
+esac
+
+AC_CHECK_HEADERS([arpa/nameser.h sys/param.h sys/time.h sys/timers.h])
+# sys/sysctl.h depends on sys/param.h on OpenBSD - Bug 1576
+AC_CHECK_HEADERS([sys/sysctl.h], [], [], [
+ #if defined HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+])
+AC_CHECK_HEADERS([netinet/in_system.h netinet/in_systm.h netinet/in.h])
+
+AC_CHECK_HEADERS([resolv.h], [], [], [
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+])
+
+AC_CHECK_HEADERS([net/if_var.h], [], [], [
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_NET_IF_H
+ # include <net/if.h>
+ #endif
+])
+
+AC_CHECK_HEADERS([netinet/ip.h netinet/in_var.h], [], [], [
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NET_IF_H
+ # include <net/if.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif
+ #ifdef HAVE_NET_IF_VAR_H
+ # include <net/if_var.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_SYSTM_H
+ # include <netinet/in_systm.h>
+ #endif
+])
+
+# HMS: Do we need to check for -lsocket before or after these tests?
+HMS_SEARCH_LIBS([LDADD_LIBNTP], [inet_pton], [nsl])
+HMS_SEARCH_LIBS([LDADD_LIBNTP], [inet_ntop], [resolv], , , [-lnsl])
+
+# [Bug 1628] On Solaris, we need -lxnet -lsocket. Generalize this to
+# avoid keying on the OS name: If we find socket functions in
+# libsocket, next try for them in libxnet without libsocket, if found,
+# list both. If we simply tested libxnet first, we would find the
+# functions there and never add libsocket. See also [Bug 660]
+# http://bugs.ntp.org/show_bug.cgi?id=660#c9
+saved_LIBS=$LIBS
+HMS_SEARCH_LIBS([LDADD_LIBNTP], [setsockopt], [socket])
+case "$ac_cv_search_setsockopt" in
+ -lsocket)
+ LIBS="$saved_LIBS"
+ HMS_SEARCH_LIBS([LDADD_LIBNTP], [getsockopt], [xnet])
+ # XXX Possible trouble here - reading the comments above and looking at the
+ # code below I wonder if we'll add -lxnet when we don't need it.
+ # Also, do we need to add -lxnet to LDADD_LIBNTP, or perhaps see if it's
+ # there when it is not needed?
+ case "$ac_cv_search_getsockopt" in
+ -lxnet)
+ LIBS="-lxnet -lsocket $saved_LIBS"
+ ;;
+ *) LIBS="-lsocket $saved_LIBS"
+ ;;
+ esac
+ ;;
+esac
+AS_UNSET([saved_LIBS])
+
+# Bug 2427 - look for recvmsg here.
+AC_CHECK_FUNCS([recvmsg])
+
+AC_C_INLINE
+
+case "$ac_cv_c_inline" in
+ '')
+ ;;
+ *)
+ AC_DEFINE([HAVE_INLINE], [1], [inline keyword or macro available])
+ AC_SUBST([HAVE_INLINE])
+esac
+
+AC_HEADER_TIME
+AC_CHECK_SIZEOF([time_t])
+AC_C_CHAR_UNSIGNED dnl CROSS_COMPILE?
+AC_CHECK_SIZEOF([signed char])
+AC_CHECK_TYPES([s_char, long long])
+AC_CHECK_SIZEOF([short])
+AC_CHECK_SIZEOF([int])
+AC_CHECK_SIZEOF([long])
+
+case "$ac_cv_type_long_long" in
+ no)
+ ;;
+ *)
+ AC_CHECK_SIZEOF([long long])
+ ;;
+esac
+
+case "$ac_cv_c_char_unsigned$ac_cv_sizeof_signed_char$ac_cv_type_s_char" in
+ *yes)
+ # We have a typedef for s_char. Might as well believe it...
+ ;;
+ no0no)
+ # We have signed chars, can't say 'signed char', no s_char typedef.
+ AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
+ [Do we need an s_char typedef?])
+ ;;
+ no1no)
+ # We have signed chars, can say 'signed char', no s_char typedef.
+ AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
+ [Do we need an s_char typedef?])
+ ;;
+ yes0no)
+ # We have unsigned chars, can't say 'signed char', no s_char typedef.
+ AC_MSG_ERROR([No way to specify a signed character!])
+ ;;
+ yes1no)
+ # We have unsigned chars, can say 'signed char', no s_char typedef.
+ AC_DEFINE([NEED_S_CHAR_TYPEDEF], [1],
+ [Do we need an s_char typedef?])
+ ;;
+esac
+
+AC_TYPE_UID_T
+
+m4_divert_text([HELP_ENABLE],
+[AS_HELP_STRING([defaults:],
+ [+ yes, - no, s system-specific])])
+
+NTP_DEBUG
+
+# check if we can compile with pthreads
+AC_CHECK_HEADERS([semaphore.h])
+AC_CHECK_FUNCS([socketpair])
+AC_ARG_ENABLE(
+ [thread-support],
+ [AS_HELP_STRING([--enable-thread-support],
+ [s use threads (+ if available)])],
+ [],
+ [enable_thread_support=yes]
+ )
+have_pthreads=no
+case "$enable_thread_support" in
+ yes)
+ ol_found_pthreads=no
+ OL_THREAD_CHECK([ol_found_pthreads=yes])
+ case "$ol_found_pthreads" in
+ yes)
+ saved_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+ AC_CHECK_FUNCS([sem_timedwait])
+ LIBS="$saved_LIBS"
+ AS_UNSET([saved_LIBS])
+ CFLAGS="$saved_CFLAGS"
+ AS_UNSET([saved_CFLAGS])
+ case "$ac_cv_func_sem_timedwait" 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
+AC_SUBST([PTHREAD_LIBS])
+case "$have_pthreads" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP $PTHREAD_CFLAGS"
+ saved_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+ AC_CHECK_SIZEOF(
+ [pthread_t],
+ ,
+ [
+ AC_INCLUDES_DEFAULT()
+ #include <pthread.h>
+ ]
+ )
+ LIBISC_PTHREADS_NOTHREADS=pthreads
+ AC_DEFINE([ISC_PLATFORM_USETHREADS], [1],
+ [enable libisc thread support?])
+ #
+ # We'd like to use sigwait() too
+ #
+ AC_CHECK_FUNC(
+ [sigwait],
+ [have_sigwait=yes],
+ [AC_CHECK_LIB(
+ [c],
+ [sigwait],
+ [have_sigwait=yes],
+ [AC_CHECK_LIB(
+ [pthread],
+ [sigwait],
+ [have_sigwait=yes],
+ [AC_CHECK_LIB(
+ [pthread],
+ [_Psigwait],
+ [have_sigwait=yes],
+ [have_sigwait=no]
+ )]
+ )]
+ )]
+ )
+ case "$host:$have_sigwait" in
+ *-freebsd*:no)
+ AC_CHECK_LIB(
+ [c_r],
+ [sigwait],
+ [have_sigwait=yes]
+ )
+ esac
+ case "$have_sigwait" in
+ yes)
+ ac_cv_func_sigwait=yes
+ AC_DEFINE([HAVE_SIGWAIT], [1], [sigwait() available?])
+ esac
+
+ AC_CHECK_FUNCS([pthread_attr_getstacksize])
+ AC_CHECK_FUNCS([pthread_attr_setstacksize sysconf])
+
+ case "$host" in
+ *-freebsd5.[[012]]|*-freebsd5.[[012]].*)
+ ;;
+ *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*|*-freebsd6.*)
+ AC_DEFINE([NEED_PTHREAD_SCOPE_SYSTEM], [1],
+ [use PTHREAD_SCOPE_SYSTEM?])
+ ;;
+ *-bsdi3.*|*-bsdi4.0*)
+ AC_DEFINE([NEED_PTHREAD_INIT], [1], [pthread_init() required?])
+ ;;
+ *-linux*)
+ AC_DEFINE([HAVE_LINUXTHREADS], [1], [using Linux pthread?])
+ ;;
+ *-solaris*)
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1])
+ AC_CHECK_FUNCS([pthread_setconcurrency])
+ case "$ac_cv_func_pthread_setconcurrency" in
+ yes)
+ AC_DEFINE([CALL_PTHREAD_SETCONCURRENCY], [1],
+ [why not HAVE_P_S?])
+ esac
+ ;;
+ *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
+ AC_DEFINE([HAVE_UNIXWARE_SIGWAIT], [1], [deviant sigwait?])
+ ;;
+ esac
+ hack_shutup_pthreadonceinit=no
+ case "$host" in
+ *-aix5.[[123]].*)
+ hack_shutup_pthreadonceinit=yes
+ ;;
+ *-solaris2.[[89]])
+ hack_shutup_pthreadonceinit=yes
+ ;;
+ *-solaris2.1[[0-9]])
+ AC_CACHE_CHECK(
+ [if extra braces are needed for PTHREAD_ONCE_INIT],
+ [ntp_cv_braces_around_pthread_once_init],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <pthread.h>
+ ]],
+ [[
+ static pthread_once_t once_test =
+ PTHREAD_ONCE_INIT;
+ ]]
+ )],
+ [ntp_cv_braces_around_pthread_once_init=no],
+ [ntp_cv_braces_around_pthread_once_init=yes]
+ )]
+ )
+ case "$ntp_cv_braces_around_pthread_once_init" in
+ yes)
+ hack_shutup_pthreadonceinit=yes
+ esac
+ ;;
+ esac
+ case "$hack_shutup_pthreadonceinit" in
+ yes)
+ AC_DEFINE([ISC_PLATFORM_BRACEPTHREADONCEINIT], [1],
+ [Enclose PTHREAD_ONCE_INIT in extra braces?])
+ esac
+ LIBS="$saved_LIBS"
+ AS_UNSET([saved_LIBS])
+ CFLAGS="$saved_CFLAGS"
+ AS_UNSET([saved_CFLAGS])
+ ;;
+ *)
+ LIBISC_PTHREADS_NOTHREADS=nothreads
+ ;;
+esac
+AC_SUBST([LIBISC_PTHREADS_NOTHREADS])
+AM_CONDITIONAL([PTHREADS], [test "$have_pthreads" != "no"])
+
+AC_DEFUN([NTP_BEFORE_HW_FUNC_VSNPRINTF], [
+ AC_BEFORE([$0], [HW_FUNC_VSNPRINTF])dnl
+ AC_BEFORE([$0], [HW_FUNC_SNPRINTF])dnl
+ AC_ARG_ENABLE(
+ [c99-snprintf],
+ [AS_HELP_STRING([--enable-c99-snprintf], [s force replacement])],
+ [force_c99_snprintf=$enableval],
+ [force_c99_snprintf=no]
+ )
+ case "$force_c99_snprintf" in
+ yes)
+ hw_force_rpl_snprintf=yes
+ hw_force_rpl_vsnprintf=yes
+ esac
+ AH_VERBATIM(
+ [snprinte],dnl sorted in config.h just before #define snprintf
+ [
+ #if !defined(_KERNEL) && !defined(PARSESTREAM)
+ /*
+ * stdio.h must be included after _GNU_SOURCE is defined
+ * but before #define snprintf rpl_snprintf
+ */
+ # include <stdio.h>
+ #endif
+ ])
+ AH_BOTTOM([
+ #if !defined(_KERNEL) && !defined(PARSESTREAM)
+ # if defined(HW_WANT_RPL_VSNPRINTF)
+ # if defined(__cplusplus)
+ extern "C" {
+ # endif
+ # include <stdarg.h>
+ int rpl_vsnprintf(char *, size_t, const char *, va_list);
+ # if defined(__cplusplus)
+ }
+ # endif
+ # endif
+ # if defined(HW_WANT_RPL_SNPRINTF)
+ # if defined(__cplusplus)
+ extern "C" {
+ # endif
+ int rpl_snprintf(char *, size_t, const char *, ...);
+ # if defined(__cplusplus)
+ }
+ # endif
+ # endif
+ #endif /* !defined(_KERNEL) && !defined(PARSESTREAM) */
+ ])
+]) dnl end of AC_DEFUN of NTP_BEFORE_HW_FUNC_VSNPRINTF
+
+AC_DEFUN([NTP_C99_SNPRINTF], [
+ AC_REQUIRE([NTP_BEFORE_HW_FUNC_VSNPRINTF])dnl
+ AC_REQUIRE([HW_FUNC_VSNPRINTF])dnl
+ AC_REQUIRE([HW_FUNC_SNPRINTF])dnl
+]) dnl end of DEFUN of NTP_C99_SNPRINTF
+
+NTP_C99_SNPRINTF
+
+dnl C99-snprintf does not handle %m
+case "$hw_use_rpl_vsnprintf:$hw_cv_func_vsnprintf" in
+ no:yes)
+ AC_CACHE_CHECK(
+ [if vsnprintf expands "%m" to strerror(errno)],
+ [ntp_cv_vsnprintf_percent_m],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stdarg.h>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
+
+ int call_vsnprintf(
+ char * dst,
+ size_t sz,
+ const char *fmt,
+ ...
+ );
+
+ int call_vsnprintf(
+ char * dst,
+ size_t sz,
+ const char *fmt,
+ ...
+ )
+ {
+ va_list ap;
+ int rc;
+
+ va_start(ap, fmt);
+ rc = vsnprintf(dst, sz, fmt, ap);
+ va_end(ap);
+
+ return rc;
+ }
+ ]],
+ [[
+ char sbuf[512];
+ char pbuf[512];
+ int slen;
+
+ strcpy(sbuf, strerror(ENOENT));
+ errno = ENOENT;
+ slen = call_vsnprintf(pbuf, sizeof(pbuf), "%m",
+ "wrong");
+ return strcmp(sbuf, pbuf);
+ ]]
+ )],
+ [ntp_cv_vsnprintf_percent_m=yes],
+ [ntp_cv_vsnprintf_percent_m=no],
+ [ntp_cv_vsnprintf_percent_m=no]
+ )]
+ )
+ case "$ntp_cv_vsnprintf_percent_m" in
+ yes)
+ AC_DEFINE([VSNPRINTF_PERCENT_M], [1],
+ [vsnprintf expands "%m" to strerror(errno)])
+ esac
+esac
+
+AC_CHECK_HEADERS([sys/clockctl.h])
+
+AC_ARG_ENABLE(
+ [clockctl],
+ [AS_HELP_STRING(
+ [--enable-clockctl],
+ [s Use /dev/clockctl for non-root clock control]
+ )],
+ [ntp_use_dev_clockctl=$enableval],
+ [ntp_use_dev_clockctl=$ac_cv_header_sys_clockctl_h]
+)
+
+AC_MSG_CHECKING([if we should use /dev/clockctl])
+AC_MSG_RESULT([$ntp_use_dev_clockctl])
+
+
+AC_CHECK_HEADERS([sys/capability.h sys/prctl.h])
+
+AC_MSG_CHECKING([if we have linux capabilities (libcap)])
+
+case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in
+ yesyes)
+ case "$host" in
+ mips-sgi-irix*)
+ ntp_have_linuxcaps=no
+ ;;
+ *) ntp_have_linuxcaps=yes
+ ;;
+ esac
+ ;;
+ *)
+ ntp_have_linuxcaps=no
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [linuxcaps],
+ [AS_HELP_STRING(
+ [--enable-linuxcaps],
+ [+ Use Linux capabilities for non-root clock control]
+ )],
+ [ntp_have_linuxcaps=$enableval]
+)
+
+AC_MSG_RESULT([$ntp_have_linuxcaps])
+
+case "$ntp_have_linuxcaps" in
+ yes)
+ AC_DEFINE([HAVE_LINUX_CAPABILITIES], [1],
+ [Do we have Linux capabilities?])
+ LIBS="$LIBS -lcap"
+ ;;
+esac
+
+
+AC_CHECK_HEADERS([priv.h])
+
+AC_MSG_CHECKING([if we have solaris privileges])
+
+case "$ac_cv_header_priv_h" in
+ yes)
+ case "$host" in
+ *-solaris*)
+ AC_CHECK_FUNC(
+ [setppriv],
+ [ntp_have_solarisprivs=yes],
+ [ntp_have_solarisprivs=no]
+ )
+ ;;
+ esac
+esac
+
+AC_ARG_ENABLE(
+ [solarisprivs],
+ [AS_HELP_STRING(
+ [--enable-solarisprivs],
+ [+ Use Solaris privileges for non-root clock control]
+ )],
+ [ntp_have_solarisprivs=$enableval]
+)
+
+
+case "$ntp_have_solarisprivs" in
+ yes)
+ AC_DEFINE([HAVE_SOLARIS_PRIVS], [1],
+ [Are Solaris privileges available?])
+esac
+
+AC_MSG_RESULT([$ntp_have_solarisprivs])
+
+case "$ntp_use_dev_clockctl$ntp_have_linuxcaps$ntp_have_solarisprivs" in
+ *yes*)
+ AC_DEFINE([HAVE_DROPROOT], [1],
+ [Can we drop root privileges?])
+esac
+
+case "$host" in
+ *-*-darwin*)
+ AC_SEARCH_LIBS([res_9_init], [resolv])
+ ;;
+ *) AC_SEARCH_LIBS([res_init], [resolv])
+ ;;
+esac
+AC_HEADER_RESOLV
+#HMS: Why do we do this check so "early"?
+AC_CHECK_FUNCS([res_init], , [AC_CHECK_FUNCS([__res_init])])
+
+# We also need -lsocket, but we have tested for that already.
+AC_CHECK_FUNC([inet_ntop], [],
+ [AC_DEFINE([ISC_PLATFORM_NEEDNTOP], [1], [ISC: provide inet_ntop()])])
+AC_CHECK_FUNC([inet_pton], [],
+ [AC_DEFINE([ISC_PLATFORM_NEEDPTON], [1], [ISC: provide inet_pton()])])
+
+AC_CHECK_TYPES([uintptr_t, int32, u_int32])
+
+AH_VERBATIM([TYPEDEF_UINTPTR_T],
+[/* Provide a typedef for uintptr_t? */
+#ifndef HAVE_UINTPTR_T
+typedef unsigned int uintptr_t;
+#define HAVE_UINTPTR_T 1
+#endif])
+
+case "$ac_cv_type_int32::$ac_cv_header_resolv_h" in
+ no::yes)
+ AC_CACHE_CHECK(
+ [for int32 with DNS headers included],
+ [ntp_cv_type_int32_with_dns],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #include <resolv.h>
+ ]],
+ [[
+ size_t cb = sizeof(int32);
+ ]]
+ )],
+ [ntp_cv_type_int32_with_dns=yes],
+ [ntp_cv_type_int32_with_dns=no]
+ )]
+ )
+ case "$ntp_cv_type_int32_with_dns" in
+ yes)
+ AC_DEFINE([HAVE_INT32_ONLY_WITH_DNS], [1],
+ [int32 type in DNS headers, not others.])
+ esac
+esac
+
+case "$ac_cv_type_u_int32::$ac_cv_header_resolv_h" in
+ no::yes)
+ AC_CACHE_CHECK(
+ [for u_int32 with DNS headers included],
+ [ntp_cv_type_u_int32_with_dns],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_ARPA_NAMESER_H
+ # include <arpa/nameser.h>
+ #endif
+ #include <resolv.h>
+ ]],
+ [[
+ size_t cb = sizeof(u_int32);
+ ]]
+ )],
+ [ntp_cv_type_u_int32_with_dns=yes],
+ [ntp_cv_type_u_int32_with_dns=no]
+ )]
+ )
+ case "$ntp_cv_type_u_int32_with_dns" in
+ yes)
+ AC_DEFINE([HAVE_U_INT32_ONLY_WITH_DNS], [1],
+ [u_int32 type in DNS headers, not others.])
+ esac
+esac
+
+AC_CHECK_HEADERS(
+ [sys/timepps.h],
+ [],
+ [],
+ [
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+ ]
+)
+
+AC_CACHE_CHECK(
+ [for struct timespec],
+ [ntp_cv_struct_timespec],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/time.h>
+ /* Under SunOS, timespec is in sys/timepps.h,
+ which needs errno.h and FRAC */
+ #ifdef HAVE_ERRNO_H
+ # include <errno.h>
+ #endif
+ #ifdef HAVE_SYS_TIMEPPS_H
+ # define FRAC 4294967296
+ # include <sys/timepps.h>
+ #endif
+ ]],
+ [[
+ struct timespec n;
+ ]]
+ )],
+ [ntp_cv_struct_timespec=yes],
+ [ntp_cv_struct_timespec=no]
+ )]
+)
+case "$ntp_cv_struct_timespec" in
+ yes)
+ AC_DEFINE([HAVE_STRUCT_TIMESPEC], [1], [struct timespec declared?])
+esac
+
+AC_CACHE_CHECK(
+ [for struct ntptimeval],
+ [ntp_cv_struct_ntptimeval],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/time.h>
+ #include <sys/timex.h>
+ ]],
+ [[
+ struct ntptimeval n;
+ ]]
+ )],
+ [ntp_cv_struct_ntptimeval=yes],
+ [ntp_cv_struct_ntptimeval=no]
+ )]
+)
+case "$ntp_cv_struct_ntptimeval" in
+ yes)
+ AC_DEFINE([HAVE_STRUCT_NTPTIMEVAL], [1],
+ [Do we have struct ntptimeval?])
+esac
+
+AC_CHECK_HEADERS(
+ [md5.h],
+ [],
+ [],
+ [
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ ]
+)
+
+AC_SEARCH_LIBS([MD5Init], [md5 md])
+AC_CHECK_FUNCS([MD5Init sysconf getdtablesize sigaction sigset sigvec])
+
+AC_CACHE_CHECK(
+ [for SIGIO],
+ [ntp_cv_hdr_def_sigio],
+ [AC_PREPROC_IFELSE(
+ [
+ #include <signal.h>
+
+ #ifndef SIGIO
+ # error
+ #endif
+ ],
+ [ntp_cv_hdr_def_sigio=yes],
+ [ntp_cv_hdr_def_sigio=no]
+ )]
+ )
+
+dnl Override those system that have a losing SIGIO
+AC_MSG_CHECKING([if we want to use SIGIO])
+ans=no
+case "$ntp_cv_hdr_def_sigio" in
+ yes)
+ ans=yes
+ case "$host" in
+ alpha*-dec-osf4*|alpha*-dec-osf5*)
+ ans=no
+ ;;
+ *-convex-*)
+ ans=no
+ ;;
+ *-dec-*)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-univel-sysv*)
+ ans=no
+ ;;
+ *-*-irix6*)
+ ans=no
+ ;;
+ *-*-freebsd*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ m68k-*-mint*)
+ ans=no
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+ AC_DEFINE([HAVE_SIGNALED_IO], [1],
+ [Can we use SIGIO for tcp and udp IO?])
+esac
+AC_MSG_RESULT([$ans])
+
+AC_CACHE_CHECK(
+ [for SIGPOLL],
+ [ntp_cv_hdr_def_sigpoll],
+ [AC_PREPROC_IFELSE(
+ [
+ #include <signal.h>
+
+ #ifndef SIGPOLL
+ # error
+ #endif
+ ],
+ [ntp_cv_hdr_def_sigpoll=yes],
+ [ntp_cv_hdr_def_sigpoll=no]
+ )]
+)
+
+AC_MSG_CHECKING([if we can use SIGPOLL for UDP I/O])
+ans=no
+case "$ntp_cv_hdr_def_sigpoll" in
+ yes)
+ case "$host" in
+ mips-sgi-irix*)
+ ans=no
+ ;;
+ vax-dec-bsd)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-*-aix[[4-9]]*)
+ # XXX Only verified thru AIX6
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-osf*)
+ ans=no
+ ;;
+ *-*-qnx*)
+ ans=no
+ ;;
+ *-*-sunos*)
+ ans=no
+ ;;
+ *-*-solaris*)
+ ans=no
+ ;;
+ *-*-ultrix*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ *) ans=yes
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+ AC_DEFINE([USE_UDP_SIGPOLL], [1], [Can we use SIGPOLL for UDP?])
+esac
+AC_MSG_RESULT([$ans])
+
+AC_MSG_CHECKING([if we can use SIGPOLL for TTY I/O])
+ans=no
+case "$ntp_cv_hdr_def_sigpoll" in
+ yes)
+ case "$host" in
+ mips-sgi-irix*)
+ ans=no
+ ;;
+ vax-dec-bsd)
+ ans=no
+ ;;
+ *-pc-cygwin*)
+ ans=no
+ ;;
+ *-sni-sysv*)
+ ans=no
+ ;;
+ *-*-aix[[4-9]]*)
+ # XXX Only verified thru AIX6
+ ans=no
+ ;;
+ *-*-hpux*)
+ ans=no
+ ;;
+ *-*-*linux*)
+ ans=no
+ ;;
+ *-*-osf*)
+ ans=no
+ ;;
+ *-*-sunos*)
+ ans=no
+ ;;
+ *-*-ultrix*)
+ ans=no
+ ;;
+ *-*-qnx*)
+ ans=no
+ ;;
+ *-*-unicosmp*)
+ ans=no
+ ;;
+ *-*-kfreebsd*)
+ ans=no
+ ;;
+ *) ans=yes
+ ;;
+ esac
+ ;;
+esac
+case "$ans" in
+ yes)
+ AC_DEFINE([USE_TTY_SIGPOLL], [1], [Can we use SIGPOLL for tty IO?])
+esac
+AC_MSG_RESULT([$ans])
+
+AC_CACHE_CHECK(
+ [number of arguments to gettimeofday()],
+ [ntp_cv_func_Xettimeofday_nargs],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/time.h>
+ ]],
+ [[
+ gettimeofday(0, 0);
+ settimeofday(0, 0);
+ ]]
+ )],
+ [ntp_cv_func_Xettimeofday_nargs=2],
+ [ntp_cv_func_Xettimeofday_nargs=1]
+ )]
+)
+case "$ntp_cv_func_Xettimeofday_nargs" in
+ 1)
+ AC_DEFINE([SYSV_TIMEOFDAY], [1], [Does Xettimeofday take 1 arg?])
+esac
+
+AC_CHECK_FUNCS([settimeofday], ,[
+ case "$host" in
+ *-*-mpeix*) ac_cv_func_settimeofday=yes
+ esac
+])
+
+AC_MSG_CHECKING([if we'll use clock_settime or settimeofday or stime])
+ntp_warning='GRONK'
+ans=none
+case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
+ yes*)
+ ntp_warning=''
+ ans='clock_settime()'
+ ;;
+ noyes*)
+ ntp_warning='But clock_settime() would be better (if we had it)'
+ ans='settimeofday()'
+ ;;
+ nonoyes)
+ ntp_warning='Which is the worst of the three'
+ ans='stime()'
+ ;;
+ *)
+ case "$build" in
+ $host)
+ ntp_warning='Which leaves us with nothing to use!'
+ esac
+esac
+AC_MSG_RESULT([$ans])
+case "$ntp_warning" in
+ '')
+ ;;
+ *)
+ AC_MSG_WARN([*** $ntp_warning ***])
+ ;;
+esac
+
+
+dnl add to LDADD_LIBNTP set by ntp_compiler.m4
+LDADD_LIBNTP="$LDADD_LIBNTP $LIBS"
+LIBS=$__LIBS
+AS_UNSET([__LIBS])
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_lineeditlibs.m4 b/sntp/m4/ntp_lineeditlibs.m4
new file mode 100644
index 0000000..f86e617
--- /dev/null
+++ b/sntp/m4/ntp_lineeditlibs.m4
@@ -0,0 +1,136 @@
+AC_DEFUN([NTP_LINEEDITLIBS], [
+ NTP_ORIG_LIBS="$LIBS"
+ AC_ARG_WITH(
+ [lineeditlibs],
+ [AS_HELP_STRING(
+ [--with-lineeditlibs],
+ [edit,editline (readline may be specified if desired)]
+ )],
+ [use_lineeditlibs="$withval"],
+ [use_lineeditlibs="edit,editline"]
+ )
+ AC_MSG_CHECKING([line editing libraries])
+ AC_MSG_RESULT([$use_lineeditlibs])
+ case "$use_lineeditlibs" in
+ no)
+ ntp_lib_lineedit=no
+ ;;
+ *)
+ for lineedit_lib in `echo $use_lineeditlibs | sed -e 's/,/ /'`; do
+ for term_lib in "" termcap curses ncurses; do
+ case "$term_lib" in
+ '')
+ TRY_LIB="-l$lineedit_lib"
+ ;;
+ *)
+ TRY_LIB="-l$lineedit_lib -l$term_lib"
+ ;;
+ esac
+ LIBS="$NTP_ORIG_LIBS $TRY_LIB"
+ AC_MSG_CHECKING([for readline() with $TRY_LIB])
+ AC_TRY_LINK_FUNC([readline], [ntp_lib_lineedit="$TRY_LIB"])
+ case "$ntp_lib_lineedit" in
+ '')
+ AC_MSG_RESULT([no])
+ ;;
+ *)
+ # Use readline()
+ AC_MSG_RESULT([yes])
+ break
+ esac
+ case "$term_lib" in
+ '')
+ # do not try el_gets without a terminal library
+ ;;
+ *)
+ AC_MSG_CHECKING([for el_gets() with $TRY_LIB])
+ AC_TRY_LINK_FUNC([el_gets], [ntp_lib_lineedit="$TRY_LIB"])
+ case "$ntp_lib_lineedit" in
+ '')
+ AC_MSG_RESULT([no])
+ ;;
+ *) # Use el_gets()
+ AC_MSG_RESULT([yes])
+ break
+ ;;
+ esac # $ntp_lib_lineedit
+ esac # $term_lib
+ done
+ case "$ntp_lib_lineedit" in
+ '')
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ LIBS="$NTP_ORIG_LIBS"
+ ;;
+ esac # $use_lineeditlibs
+
+ case "$ntp_lib_lineedit" in
+ '')
+ ntp_lib_lineedit="no"
+ ;;
+ no)
+ ;;
+ *)
+ EDITLINE_LIBS="$ntp_lib_lineedit"
+ AC_SUBST([EDITLINE_LIBS])
+ ;;
+ esac # $ntp_lib_lineedit
+
+ case "$ntp_lib_lineedit" in
+ no)
+ ;;
+ *)
+ AC_CHECK_HEADERS([readline.h readline/readline.h histedit.h])
+ AC_CHECK_HEADERS([history.h readline/history.h])
+
+ case "$ac_cv_header_histedit_h" in
+ yes)
+ AC_CACHE_CHECK(
+ [number of arguments to el_init()],
+ [ntp_cv_el_init_args],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stdio.h>
+ #include <histedit.h>
+ ]],
+ [[
+ el_init("conftest", stdin, stdout, stderr);
+ ]]
+ )],
+ [ntp_cv_el_init_args=4],
+ [ntp_cv_el_init_args=3]
+ )]
+ )
+ AC_DEFINE_UNQUOTED(
+ [EL_INIT_ARGS],
+ [$ntp_cv_el_init_args],
+ [number of args to el_init()]
+ )
+ esac
+
+ AC_MSG_CHECKING([whether readline supports history])
+
+ ntp_lib_lineedit_history="no"
+ ORIG_LIBS="$LIBS"
+ LIBS="$ORIG_LIBS $ntp_lib_lineedit"
+ AC_TRY_LINK_FUNC([add_history], [ntp_lib_lineedit_history="yes"])
+ LIBS="$ORIG_LIBS"
+
+ AC_MSG_RESULT([$ntp_lib_lineedit_history])
+
+ case "$ntp_lib_lineedit_history" in
+ yes)
+ AC_DEFINE([HAVE_READLINE_HISTORY], [1],
+ [Define if your readline library has \`add_history'])
+ esac
+ esac # $ntp_lib_lineedit
+ AS_UNSET([NTP_ORIG_LIBS])
+ AS_UNSET([ORIG_LIBS])
+ AS_UNSET([TRY_LIB])
+ AS_UNSET([use_lineeditlibs])
+])dnl
diff --git a/sntp/m4/ntp_locinfo.m4 b/sntp/m4/ntp_locinfo.m4
new file mode 100644
index 0000000..f045ac2
--- /dev/null
+++ b/sntp/m4/ntp_locinfo.m4
@@ -0,0 +1,129 @@
+dnl ######################################################################
+dnl @synopsis NTP_LOCINFO([SCRIPTSDIRPATH])
+dnl Location information:
+dnl - installation directory (*_DB for bin/, *_DL for libexec/, *_DS for sbin/)
+dnl ... or *_NI for noinst_*
+dnl - man tag format (man or mdoc)
+dnl - man section (1, 1m, 1M, 8)
+
+AC_DEFUN([NTP_LOCINFO], [
+
+AC_MSG_CHECKING([for install dir and man conventions])
+
+AC_ARG_WITH(
+ [locfile],
+ [AS_HELP_STRING(
+ [--with-locfile=XXX],
+ [os-specific or "legacy"]
+ )],
+ [],
+ [with_locfile=no]
+)
+
+( \
+ SENTINEL_DIR="$PWD" && \
+ cd $srcdir/$1 && \
+ case "$with_locfile" in \
+ yes|no|'') \
+ scripts/genLocInfo -d "$SENTINEL_DIR" \
+ ;; \
+ *) \
+ scripts/genLocInfo -d "$SENTINEL_DIR" -f "$with_locfile" \
+ ;; \
+ esac \
+) > genLocInfo.i 2> genLocInfo.err
+. ./genLocInfo.i
+
+case "$GENLOCINFO" in
+ OK)
+ AC_MSG_RESULT([in file $GENLOCINFOFILE])
+ rm genLocInfo.err genLocInfo.i
+ ;;
+ *)
+ AC_MSG_RESULT([failed.])
+ AC_MSG_ERROR([Problem with genLocInfo!])
+ ;;
+esac
+
+AM_CONDITIONAL([WANT_CALC_TICKADJ_MS], [test "$CALC_TICKADJ_MS" ])
+
+AC_SUBST([CALC_TICKADJ_DB])
+AC_SUBST([CALC_TICKADJ_DL])
+AC_SUBST([CALC_TICKADJ_DS])
+AC_SUBST([CALC_TICKADJ_MS])
+AC_SUBST([CALC_TICKADJ_NI])
+AC_SUBST([MANTAGFMT])
+AC_SUBST([NTPDATE_DB])
+AC_SUBST([NTPDATE_DL])
+AC_SUBST([NTPDATE_DS])
+AC_SUBST([NTPDATE_MS])
+AC_SUBST([NTPDATE_NI])
+AC_SUBST([NTPDC_DB])
+AC_SUBST([NTPDC_DL])
+AC_SUBST([NTPDC_DS])
+AC_SUBST([NTPDC_MS])
+AC_SUBST([NTPDC_NI])
+AC_SUBST([NTPDSIM_DB])
+AC_SUBST([NTPDSIM_DL])
+AC_SUBST([NTPDSIM_DS])
+AC_SUBST([NTPDSIM_MS])
+AC_SUBST([NTPDSIM_NI])
+AC_SUBST([NTPD_DB])
+AC_SUBST([NTPD_DL])
+AC_SUBST([NTPD_DS])
+AC_SUBST([NTPD_MS])
+AC_SUBST([NTPD_NI])
+AC_SUBST([NTPQ_DB])
+AC_SUBST([NTPQ_DL])
+AC_SUBST([NTPQ_DS])
+AC_SUBST([NTPQ_MS])
+AC_SUBST([NTPQ_NI])
+AC_SUBST([NTPSNMPD_DB])
+AC_SUBST([NTPSNMPD_DL])
+AC_SUBST([NTPSNMPD_DS])
+AC_SUBST([NTPSNMPD_MS])
+AC_SUBST([NTPSNMPD_NI])
+AC_SUBST([NTPSWEEP_DB])
+AC_SUBST([NTPSWEEP_DL])
+AC_SUBST([NTPSWEEP_DS])
+AC_SUBST([NTPSWEEP_MS])
+AC_SUBST([NTPSWEEP_NI])
+AM_CONDITIONAL([INSTALL_NTPSWEEP], [test -z "$NTPSWEEP_NI" ])
+AC_SUBST([NTPTIME_DB])
+AC_SUBST([NTPTIME_DL])
+AC_SUBST([NTPTIME_DS])
+AC_SUBST([NTPTIME_MS])
+AC_SUBST([NTPTIME_NI])
+AC_SUBST([NTPTRACE_DB])
+AC_SUBST([NTPTRACE_DL])
+AC_SUBST([NTPTRACE_DS])
+AC_SUBST([NTPTRACE_MS])
+AC_SUBST([NTPTRACE_NI])
+AC_SUBST([NTP_KEYGEN_DB])
+AC_SUBST([NTP_KEYGEN_DL])
+AC_SUBST([NTP_KEYGEN_DS])
+AC_SUBST([NTP_KEYGEN_MS])
+AC_SUBST([NTP_KEYGEN_NI])
+AC_SUBST([NTP_WAIT_DB])
+AC_SUBST([NTP_WAIT_DL])
+AC_SUBST([NTP_WAIT_DS])
+AC_SUBST([NTP_WAIT_MS])
+AC_SUBST([NTP_WAIT_NI])
+AC_SUBST([SNTP_DB])
+AC_SUBST([SNTP_DL])
+AC_SUBST([SNTP_DS])
+AC_SUBST([SNTP_MS])
+AC_SUBST([SNTP_NI])
+AC_SUBST([TICKADJ_DB])
+AC_SUBST([TICKADJ_DL])
+AC_SUBST([TICKADJ_DS])
+AC_SUBST([TICKADJ_MS])
+AC_SUBST([TICKADJ_NI])
+AC_SUBST([TIMETRIM_DB])
+AC_SUBST([TIMETRIM_DL])
+AC_SUBST([TIMETRIM_DS])
+AC_SUBST([TIMETRIM_MS])
+AC_SUBST([TIMETRIM_NI])
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_openssl.m4 b/sntp/m4/ntp_openssl.m4
new file mode 100644
index 0000000..9d9189c
--- /dev/null
+++ b/sntp/m4/ntp_openssl.m4
@@ -0,0 +1,372 @@
+dnl ####################################################################
+dnl OpenSSL support shared by top-level and sntp/configure.ac
+dnl
+dnl Provides command-line option --with-crypto, as well as deprecated
+dnl options --with-openssl-incdir, --with-openssl-libdir, and the
+dnl latter's suboption --with-rpath.
+dnl
+dnl Specifying --with-openssl-libdir or --with-openssl-incdir causes any
+dnl pkg-config openssl information to be ignored in favor of the legacy
+dnl manual search for directories and specified library names.
+dnl
+dnl Output AC_DEFINEs (for config.h)
+dnl OPENSSL defined only if using OpenSSL
+dnl
+dnl Output variables:
+dnl ntp_openssl yes if using OpenSSL, no otherwise
+dnl
+dnl Output substitutions:
+dnl CFLAGS_NTP OpenSSL-specific flags added as needed, and
+dnl -Wstrict-prototypes for gcc if it does not
+dnl trigger a flood of warnings for each file
+dnl including OpenSSL headers.
+dnl CPPFLAGS_NTP OpenSSL -Iincludedir flags added as needed.
+dnl LDADD_NTP OpenSSL -L and -l flags added as needed.
+dnl LDFLAGS_NTP Other OpenSSL link flags added as needed.
+dnl
+dnl ####################################################################
+AC_DEFUN([NTP_OPENSSL], [
+AC_REQUIRE([NTP_PKG_CONFIG])dnl
+AC_REQUIRE([NTP_VER_SUFFIX])dnl
+
+AC_ARG_WITH(
+ [crypto],
+ [AS_HELP_STRING(
+ [--with-crypto],
+ [+ =openssl,libcrypto]
+ )]
+)
+AC_ARG_WITH(
+ [openssl-libdir],
+ [AS_HELP_STRING(
+ [--with-openssl-libdir],
+ [+ =/something/reasonable]
+ )]
+)
+AC_ARG_WITH(
+ [openssl-incdir],
+ [AS_HELP_STRING(
+ [--with-openssl-incdir],
+ [+ =/something/reasonable]
+ )]
+)
+AC_ARG_WITH(
+ [rpath],
+ [AS_HELP_STRING(
+ [--without-rpath],
+ [s Disable auto-added -R linker paths]
+ )]
+)
+ntp_openssl=no
+ntp_openssl_from_pkg_config=no
+with_crypto=${with_crypto:-openssl,libcrypto}
+case "$with_crypto" in
+ yes)
+ with_crypto=openssl,libcrypto
+esac
+case "$with_crypto:${PKG_CONFIG:+notempty}:${with_openssl_libdir-notgiven}:${with_openssl_incdir-notgiven}" in
+ no:*) ;;
+ *:notempty:notgiven:notgiven)
+ for pkg in `echo $with_crypto | sed -e 's/,/ /'`; do
+ AC_MSG_CHECKING([pkg-config for $pkg])
+ if $PKG_CONFIG --exists $pkg ; then
+ CPPFLAGS_NTP="$CPPFLAGS_NTP `$PKG_CONFIG --cflags-only-I $pkg`"
+ CFLAGS_NTP="$CFLAGS_NTP `$PKG_CONFIG --cflags-only-other $pkg`"
+ LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-L $pkg`"
+ LDADD_NTP="$LDADD_NTP `$PKG_CONFIG --libs-only-l $pkg`"
+ LDFLAGS_NTP="$LDFLAGS_NTP `$PKG_CONFIG --libs-only-other $pkg`"
+ VER_SUFFIX=o
+ ntp_openssl=yes
+ ntp_openssl_from_pkg_config=yes
+ AC_MSG_RESULT([yes])
+
+ break
+ fi
+ AC_MSG_RESULT([no])
+ done
+esac
+case "$with_crypto:$ntp_openssl" in
+ no:*) ;;
+ *:no)
+ need_dash_r=
+ need_dash_Wlrpath=
+ case "${with_rpath-notgiven}" in
+ yes)
+ # Lame - what to do if we need -Wl... but not -R?
+ need_dash_r=1
+ ;;
+ notgiven)
+ case "$host" in
+ *-*-linux*)
+ # This may really only be true for gcc
+ need_dash_Wlrpath=1
+ ;;
+ *-*-netbsd*)
+ need_dash_r=1
+ ;;
+ *-*-solaris*)
+ need_dash_r=1
+ ;;
+ esac
+ ;;
+ esac
+
+ AC_MSG_CHECKING([for openssl library directory])
+ with_openssl_libdir=${with_openssl_libdir-notgiven}
+ case "$with_openssl_libdir" in
+ notgiven)
+ case "$build" in
+ $host)
+ with_openssl_libdir=default
+ ;;
+ *)
+ with_openssl_libdir=no
+ ;;
+ esac
+ esac
+ case "$with_openssl_libdir" in
+ default)
+ # Look in:
+ with_openssl_libdir="/usr/lib /usr/lib/openssl /usr/sfw/lib"
+ with_openssl_libdir="$with_openssl_libdir /usr/local/lib"
+ with_openssl_libdir="$with_openssl_libdir /usr/local/ssl/lib /lib"
+ esac
+ case "$with_openssl_libdir" in
+ no)
+ ;;
+ *) # Look for libcrypto.a and libssl.a:
+ for i in $with_openssl_libdir no
+ do
+ case "$host" in
+ *-*-darwin*)
+ test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
+ ;;
+ *)
+ test -f $i/libcrypto.so -a -f $i/libssl.so && break
+ test -f $i/libcrypto.a -a -f $i/libssl.a && break
+ ;;
+ esac
+ done
+ openssl_libdir=$i
+ ;;
+ esac
+ AC_MSG_RESULT([$openssl_libdir])
+ case "$openssl_libdir" in
+ no)
+ openssl_libdir=
+ AC_MSG_WARN([libcrypto and libssl not found in any of $with_openssl_libdir])
+ esac
+
+ AC_MSG_CHECKING([for openssl include directory])
+ with_openssl_incdir=${with_openssl_incdir-notgiven}
+ case "$with_openssl_incdir" in
+ notgiven)
+ # Look in:
+ with_openssl_incdir="/usr/include /usr/sfw/include"
+ with_openssl_incdir="$with_openssl_incdir /usr/local/include"
+ with_openssl_incdir="$with_openssl_incdir /usr/local/ssl/include"
+ esac
+ case "$with_openssl_incdir" in
+ no)
+ ;;
+ *) # look for openssl/evp.h:
+ for i in $with_openssl_incdir no
+ do
+ test -f $i/openssl/evp.h && break
+ done
+ openssl_incdir=$i
+ ;;
+ esac
+ AS_UNSET([i])
+ AC_MSG_RESULT([$openssl_incdir])
+ case "$openssl_incdir" in
+ no)
+ openssl_incdir=
+ AC_MSG_WARN([did not find openssl/evp.h in any of $with_openssl_incdir])
+ esac
+ if test -z "$openssl_libdir" -o -z "$openssl_incdir"
+ then
+ ntp_openssl=no
+ else
+ ntp_openssl=yes
+ VER_SUFFIX=o
+ fi
+ case "$ntp_openssl" in
+ yes)
+ # We have OpenSSL inc/lib dirs - use them.
+ case "$openssl_incdir" in
+ /usr/include)
+ ;;
+ *)
+ CPPFLAGS_NTP="$CPPFLAGS_NTP -I$openssl_incdir"
+ ;;
+ esac
+ case "$openssl_libdir" in
+ /usr/lib)
+ ;;
+ *)
+ LDADD_NTP="$LDADD_NTP -L$openssl_libdir"
+ case "$need_dash_r" in
+ 1)
+ LDFLAGS_NTP="$LDFLAGS_NTP -R$openssl_libdir"
+ esac
+ case "$need_dash_Wlrpath" in
+ 1)
+ LDFLAGS_NTP="$LDFLAGS_NTP -Wl,-rpath,$openssl_libdir"
+ esac
+ ;;
+ esac
+ LDADD_NTP="$LDADD_NTP -lcrypto"
+ esac
+esac
+
+AC_MSG_CHECKING([if we will use crypto])
+AC_MSG_RESULT([$ntp_openssl])
+
+case "$ntp_openssl" in
+ yes)
+ AC_DEFINE([OPENSSL], [], [Use OpenSSL?])
+ case "$VER_SUFFIX" in
+ *o*) ;;
+ *) AC_MSG_ERROR([OPENSSL set but no 'o' in VER_SUFFIX!]) ;;
+ esac
+ ;;
+esac
+
+NTPO_SAVED_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $CPPFLAGS_NTP"
+NTPO_SAVED_LIBS="$LIBS"
+
+#
+# check for linking with -lcrypto failure, and try -lcrypto -lz.
+# Helps m68k-atari-mint
+#
+case "$ntp_openssl:$ntp_openssl_from_pkg_config" in
+ yes:no)
+ LIBS="$NTPO_SAVED_LIBS $LDADD_NTP"
+ AC_CACHE_CHECK(
+ [if linking with -lcrypto alone works],
+ [ntp_cv_bare_lcrypto],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+ ]],
+ [[
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+ ]]
+ )],
+ [ntp_cv_bare_lcrypto=yes],
+ [ntp_cv_bare_lcrypto=no]
+ )]
+ )
+ case "$ntp_cv_bare_lcrypto" in
+ no)
+ LIBS="$NTPO_SAVED_LIBS $LDADD_NTP -lz"
+ AC_CACHE_CHECK(
+ [if linking with -lcrypto -lz works],
+ [ntp_cv_lcrypto_lz],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+ ]],
+ [[
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+ ]]
+ )],
+ [ntp_cv_lcrypto_lz=yes],
+ [ntp_cv_lcrypto_lz=no]
+ )]
+ )
+ case "$ntp_cv_lcrypto_lz" in
+ yes)
+ LDADD_NTP="$LDADD_NTP -lz"
+ esac
+ esac
+esac
+
+#
+# Older OpenSSL headers have a number of callback prototypes inside
+# other function prototypes which trigger copious warnings with gcc's
+# -Wstrict-prototypes, which is included in -Wall.
+#
+# An example:
+#
+# int i2d_RSA_NET(const RSA *a, unsigned char **pp,
+# int (*cb)(), int sgckey);
+# ^^^^^^^^^^^
+#
+#
+#
+openssl_triggers_warnings=unknown
+NTPO_SAVED_CFLAGS="$CFLAGS"
+
+case "$ntp_openssl:$GCC" in
+ yes:yes)
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ ]],
+ [[
+ /* see if -Werror breaks gcc */
+ ]]
+ )],
+ [gcc_handles_Werror=yes],
+ [gcc_handles_Werror=no]
+ )
+ case "$gcc_handles_Werror" in
+ no)
+ # if this gcc doesn't do -Werror go ahead and use
+ # -Wstrict-prototypes.
+ openssl_triggers_warnings=yes
+ ;;
+ yes)
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include "openssl/asn1_mac.h"
+ #include "openssl/bn.h"
+ #include "openssl/err.h"
+ #include "openssl/evp.h"
+ #include "openssl/pem.h"
+ #include "openssl/rand.h"
+ #include "openssl/x509v3.h"
+ ]],
+ [[
+ /* empty body */
+ ]]
+ )],
+ [openssl_triggers_warnings=no],
+ [openssl_triggers_warnings=yes]
+ )
+ esac
+ case "$openssl_triggers_warnings" in
+ yes)
+ CFLAGS_NTP="$CFLAGS_NTP -Wno-strict-prototypes"
+ ;;
+ *)
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes"
+ esac
+ ;;
+ no:yes)
+ # gcc without OpenSSL
+ CFLAGS_NTP="$CFLAGS_NTP -Wstrict-prototypes"
+esac
+
+CFLAGS="$NTPO_SAVED_CFLAGS"
+CPPFLAGS="$NTPO_SAVED_CPPFLAGS"
+LIBS="$NTPO_SAVED_LIBS"
+AS_UNSET([NTPO_SAVED_CFLAGS])
+AS_UNSET([NTPO_SAVED_CPPFLAGS])
+AS_UNSET([NTPO_SAVED_LIBS])
+AS_UNSET([openssl_triggers_warnings])
+AS_UNSET([ntp_openssl_from_pkg_config])
+])
+dnl ======================================================================
diff --git a/sntp/m4/ntp_pkg_config.m4 b/sntp/m4/ntp_pkg_config.m4
new file mode 100644
index 0000000..1bce8a6
--- /dev/null
+++ b/sntp/m4/ntp_pkg_config.m4
@@ -0,0 +1,27 @@
+dnl NTP_PKG_CONFIG -*- Autoconf -*-
+dnl
+dnl Look for pkg-config, which must be at least
+dnl $ntp_pkgconfig_min_version.
+dnl
+AC_DEFUN([NTP_PKG_CONFIG], [
+
+dnl lower the minimum version if you find an earlier one works
+ntp_pkgconfig_min_version='0.15.0'
+AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+AS_UNSET([ac_cv_path_PKG_CONFIG])
+AS_UNSET([ac_cv_path_ac_pt_PKG_CONFIG])
+
+case "$PKG_CONFIG" in
+ /*)
+ AC_MSG_CHECKING([if pkg-config is at least version $ntp_pkgconfig_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $ntp_pkgconfig_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+ ;;
+esac
+
+]) dnl NTP_PKG_CONFIG
+
diff --git a/sntp/m4/ntp_prog_cc.m4 b/sntp/m4/ntp_prog_cc.m4
new file mode 100644
index 0000000..c6b4e03
--- /dev/null
+++ b/sntp/m4/ntp_prog_cc.m4
@@ -0,0 +1,21 @@
+dnl ######################################################################
+dnl NTP compiler basics
+dnl
+AC_DEFUN([NTP_PROG_CC], [
+
+dnl must come before AC_PROG_CC or similar
+AC_USE_SYSTEM_EXTENSIONS
+
+dnl we need to check for cross compile tools for vxWorks here
+AC_PROG_CC
+# Ralf Wildenhues: With per-target flags we need CC_C_O
+# AM_PROG_CC_C_O supersets AC_PROG_CC_C_O
+AM_PROG_CC_C_O
+AC_PROG_GCC_TRADITIONAL
+NTP_COMPILER
+AC_C_BIGENDIAN
+AC_C_VOLATILE
+AC_PROG_CPP
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_rlimit.m4 b/sntp/m4/ntp_rlimit.m4
new file mode 100644
index 0000000..c1267b7
--- /dev/null
+++ b/sntp/m4/ntp_rlimit.m4
@@ -0,0 +1,66 @@
+dnl ######################################################################
+dnl rlimit capabilities checks
+AC_DEFUN([NTP_RLIMIT_ITEMS], [
+
+AC_CACHE_CHECK(
+ [for RLIMIT_MEMLOCK],
+ [ntp_cv_rlimit_memlock],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_SYS_RESOURCE_H
+ # include <sys/resource.h>
+ #endif
+ ]],
+ [[
+ getrlimit(RLIMIT_MEMLOCK, 0);
+ ]]
+ )],
+ [ntp_cv_rlimit_memlock=yes],
+ [ntp_cv_rlimit_memlock=no]
+ )]
+)
+case "$ntp_cv_rlimit_memlock" in
+ yes)
+ AC_SUBST([HAVE_RLIMIT_MEMLOCK])
+ HAVE_RLIMIT_MEMLOCK=" memlock 32"
+esac
+
+AC_CACHE_CHECK(
+ [for RLIMIT_STACK],
+ [ntp_cv_rlimit_stack],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #ifdef HAVE_SYS_RESOURCE_H
+ # include <sys/resource.h>
+ #endif
+ ]],
+ [[
+ getrlimit(RLIMIT_STACK, 0);
+ ]]
+ )],
+ [ntp_cv_rlimit_stack=yes],
+ [ntp_cv_rlimit_stack=no]
+ )]
+)
+case "$ntp_cv_rlimit_stack" in
+ yes)
+ AC_SUBST([HAVE_RLIMIT_STACK])
+ HAVE_RLIMIT_STACK=" stacksize 50"
+esac
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_sntp.m4 b/sntp/m4/ntp_sntp.m4
new file mode 100644
index 0000000..a9d405e
--- /dev/null
+++ b/sntp/m4/ntp_sntp.m4
@@ -0,0 +1,29 @@
+dnl ######################################################################
+dnl Common m4sh code SNTP
+AC_DEFUN([NTP_WITHSNTP], [
+
+dnl preset withsntp=no in env to change default to --without-sntp
+AC_MSG_CHECKING([if sntp will be built])
+AC_ARG_WITH(
+ [sntp],
+ [AS_HELP_STRING(
+ [--without-sntp],
+ [- disable building sntp and sntp/tests]
+ )],
+ [],
+ [with_sntp="${withsntp=yes}"]
+)
+case "$with_sntp" in
+ no)
+ SNTP=
+ ;;
+ *)
+ SNTP=sntp
+ ;;
+esac
+AC_SUBST([SNTP])
+AM_CONDITIONAL([BUILD_SNTP], [test -n "$SNTP"])
+AC_MSG_RESULT([$with_sntp])
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_sysexits.m4 b/sntp/m4/ntp_sysexits.m4
new file mode 100644
index 0000000..48a529d
--- /dev/null
+++ b/sntp/m4/ntp_sysexits.m4
@@ -0,0 +1,11 @@
+dnl ######################################################################
+dnl sysexits.h
+AC_DEFUN([NTP_SYSEXITS_H], [
+
+AC_CHECK_HEADERS([sysexits.h], [],[
+AC_DEFINE([EX_OK], [0], [successful termination])
+AC_DEFINE([EX_SOFTWARE], [70], [internal software error])
+])dnl
+
+])dnl
+dnl ======================================================================
diff --git a/sntp/m4/ntp_ver_suffix.m4 b/sntp/m4/ntp_ver_suffix.m4
new file mode 100644
index 0000000..34839b5
--- /dev/null
+++ b/sntp/m4/ntp_ver_suffix.m4
@@ -0,0 +1,13 @@
+dnl ####################################################################
+dnl NTP Version Suffix (Crypto)
+dnl
+dnl Output substitutions:
+dnl VER_SUFFIX Version Suffix (scripts/mkver.in)
+dnl
+dnl ####################################################################
+AC_DEFUN([NTP_VER_SUFFIX], [
+
+AC_SUBST([VER_SUFFIX])
+VER_SUFFIX=
+])
+dnl ======================================================================
diff --git a/sntp/m4/ntp_vpathhack.m4 b/sntp/m4/ntp_vpathhack.m4
new file mode 100644
index 0000000..7099fe8
--- /dev/null
+++ b/sntp/m4/ntp_vpathhack.m4
@@ -0,0 +1,43 @@
+dnl ######################################################################
+dnl NTP_VPATH_HACK
+dnl
+dnl Compiling ntpd doesn't require YACC or Bison unless ntp_parser.y is
+dnl modified, because the output ntp_parser.[ch] are committed. This
+dnl raises an issue with Automake-generated Makefiles on non-GNU make
+dnl used from a build tree outside the source tree.
+dnl
+dnl With GNU make, ylwrap updates $srcdir/ntp_parser.[ch] directly.
+dnl Under Sun or BSD make, ylwrap needs those files to be in the build
+dnl tree.
+dnl
+dnl With VPATH_HACK enabled, ntpd/Makefile.am includes code to symlink
+dnl from ntp_parser.[ch] in the build tree to the corresponding files
+dnl in $srcdir, and to check for ylwrap replacing the .h with a normal
+dnl file, and in that case copy the updated .h to $srcdir and restore
+dnl the symlink.
+dnl
+dnl if we are building outside the srcdir and either
+dnl force_ntp_vpath_hack is yes
+dnl or
+dnl we're not using GNU make
+dnl then we want VPATH_HACK to be true for .am tests
+dnl
+AC_DEFUN([NTP_VPATH_HACK], [
+AC_MSG_CHECKING([to see if we need ylwrap VPATH hack])
+ntp_vpath_hack="no"
+case "$srcdir::${force_ntp_vpath_hack-no}" in
+ .::*)
+ ;; # VPATH_HACK path is for VPATH builds only.
+ *::yes)
+ ntp_vpath_hack="yes"
+ ;;
+ *::*)
+ case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make'`" in
+ '')
+ ntp_vpath_hack="yes"
+ esac
+esac
+AC_MSG_RESULT([$ntp_vpath_hack])
+AM_CONDITIONAL([VPATH_HACK], [test x$ntp_vpath_hack = xyes])
+])
+dnl ======================================================================
diff --git a/sntp/m4/os_cflags.m4 b/sntp/m4/os_cflags.m4
new file mode 100644
index 0000000..2ac4ffc
--- /dev/null
+++ b/sntp/m4/os_cflags.m4
@@ -0,0 +1,104 @@
+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
+ case "${ntp_os_cflags+set}" in
+ set)
+ ;;
+ *)
+ ntp_os_cflags=
+ case "$host_os" in
+ aix[[1-3]]*)
+ ;;
+ aix4.[[0-2]]*)
+ # turn on additional headers
+ ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
+ ;;
+ aix5.3*)
+ # avoid circular dependencies in yp headers, and more
+ ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
+ ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT"
+ ;;
+ aix*)
+ # XXX Only verified thru AIX6.
+ # aix7 seems to need a different XOPEN_SOURCE_EXTENDED thing.
+ # avoid circular dependencies in yp headers
+ # _XOPEN_SOURCE=500 = X/Open 5: POSIX 1995
+ # _XOPEN_SOURCE=600 = X/Open 6: POSIX 2004
+ # _XOPEN_SOURCE=700 = X/Open 7: POSIX 2008
+ ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_SOURCE=600"
+ ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS"
+ ;;
+ amigaos)
+ ntp_os_cflags="-DSYS_AMIGA"
+ ;;
+ darwin*|macosx*|rhapsody*)
+ ntp_os_cflags="-D_P1003_1B_VISIBLE"
+ ;;
+ hpux10.*) # at least for hppa2.0-hp-hpux10.20
+ case "$GCC" in
+ yes)
+ ;;
+ *)
+ # use Ansi compiler on HPUX, and some -Wp magic
+ ntp_os_cflags="-Ae -Wp,-H18816"
+ ;;
+ esac
+ ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
+ ;;
+ hpux*)
+ case "$GCC" in
+ yes)
+ ;;
+ *)
+ # use Ansi compiler on HPUX
+ ntp_os_cflags="-Ae"
+ esac
+ ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE"
+ ;;
+ irix6*)
+ case "$CC" in
+ cc)
+ # do not use 64-bit compiler
+ ntp_os_cflags="-n32 -mips3 -Wl,-woff,84"
+ esac
+ ;;
+ nextstep3)
+ ntp_os_cflags="-posix"
+ ;;
+ solaris1*|solaris2.[[0-5]]|solaris2.5.*)
+ ;;
+ sunos[[34]]*|sunos5.[[0-5]]|sunos5.5.*)
+ ;;
+ solaris2*|sunos5*)
+ # turn on 64-bit file offset interface
+ ntp_os_cflags="-D_LARGEFILE64_SOURCE"
+ ;;
+ vxworks*)
+ case "$build" in
+ $host)
+ ;;
+ *)
+ # Quick and dirty sanity check
+ case "$VX_KERNEL" in
+ '')
+ AC_MSG_ERROR([See html/build/hints/vxworks.html])
+ esac
+ ntp_os_cflags="-DSYS_VXWORKS"
+ esac
+ ;;
+ esac
+ esac
+ case "$ntp_os_flags" in
+ '')
+ ntp_os_cflags_msg="none needed"
+ ;;
+ *)
+ ntp_os_cflags_msg="$ntp_os_cflags"
+ esac
+ CFLAGS_NTP="$CFLAGS_NTP $ntp_os_cflags"
+ AC_MSG_RESULT([$ntp_os_cflags_msg])
+ AS_UNSET([ntp_os_cflags_msg])
+])
+dnl ======================================================================
diff --git a/sntp/m4/snprintf.m4 b/sntp/m4/snprintf.m4
new file mode 100644
index 0000000..15f06f0
--- /dev/null
+++ b/sntp/m4/snprintf.m4
@@ -0,0 +1,288 @@
+# Modified by Dave Hart for integration into NTP 4.2.7 <hart@ntp.org>
+#
+# Changed in a backwards-incompatible way to separate HAVE_SNPRINTF from
+# HW_WANT_RPL_SNPRINTF, etc. for each of the four replaced functions.
+# HAVE_* will always be set if the corresponding HW_FUNC_* macro is
+# invoked, directly or indirectly. This allows 3rd-party modules like
+# libopts to avoid their own replacement of snprintf.
+#
+# Changed to honor hw_nodef_snprintf, etc. which prevent config.h from
+# aliasing snprintf to rpl_snprintf, etc.
+#
+# Changed to honor hw_force_rpl_snprintf=yes, etc. This is used by NTP
+# to test rpl_snprintf() and rpl_vsnprintf() on platforms which provide
+# C99-compliant implementations.
+#
+
+# $Id: snprintf.m4,v 1.1.1.1 2008/01/06 03:24:00 holger Exp $
+
+# Copyright (c) 2008 Holger Weiss <holger@jhweiss.de>.
+#
+# This code may freely be used, modified and/or redistributed for any purpose.
+# It would be nice if additions and fixes to this file (including trivial code
+# cleanups) would be sent back in order to let me include them in the version
+# available at <http://www.jhweiss.de/software/snprintf.html>. However, this is
+# not a requirement for using or redistributing (possibly modified) versions of
+# this file, nor is leaving this notice intact mandatory.
+
+# HW_HEADER_STDARG_H
+# ------------------
+# Define HAVE_STDARG_H to 1 if <stdarg.h> is available.
+AC_DEFUN([HW_HEADER_STDARG_H],
+[
+ AC_PREREQ([2.60])dnl Older releases should work if AC_CHECK_HEADERS is used.
+ AC_CHECK_HEADERS_ONCE([stdarg.h])
+])# HW_HEADER_STDARG_H
+
+# HW_HEADER_VARARGS_H
+# -------------------
+# Define HAVE_VARARGS_H to 1 if <varargs.h> is available.
+AC_DEFUN([HW_HEADER_VARARGS_H],
+[
+ AC_PREREQ([2.60])dnl Older releases should work if AC_CHECK_HEADERS is used.
+ AC_CHECK_HEADERS_ONCE([varargs.h])
+])# HW_HEADER_VARARGS_H
+
+# HW_FUNC_VA_COPY
+# ---------------
+# Set $hw_cv_func_va_copy to "yes" or "no". Define HAVE_VA_COPY to 1 if
+# $hw_cv_func_va_copy is set to "yes". Note that it's "unspecified whether
+# va_copy and va_end are macros or identifiers declared with external linkage."
+# (C99: 7.15.1, 1) Therefore, the presence of va_copy(3) cannot simply "be
+# tested with #ifdef", as suggested by the Autoconf manual (5.5.1).
+AC_DEFUN([HW_FUNC_VA_COPY],
+[
+ AC_REQUIRE([HW_HEADER_STDARG_H])dnl Our check evaluates HAVE_STDARG_H.
+ AC_REQUIRE([HW_HEADER_VARARGS_H])dnl Our check evaluates HAVE_VARARGS_H.
+ AC_CACHE_CHECK([for va_copy],
+ [hw_cv_func_va_copy],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_STDARG_H
+ #include <stdarg.h>
+ #elif HAVE_VARARGS_H
+ #include <varargs.h>
+ #endif]],
+ [[va_list ap, aq; va_copy(aq, ap);]])],
+ [hw_cv_func_va_copy=yes],
+ [hw_cv_func_va_copy=no],
+ [hw_cv_func_va_copy=no])])
+ AS_IF([test "$hw_cv_func_va_copy" = yes],
+ [AC_DEFINE([HAVE_VA_COPY], [1],
+ [Define to 1 if you have the `va_copy' function or macro.])])
+])# HW_FUNC_VA_COPY
+
+# HW_FUNC___VA_COPY
+# -----------------
+# Set $hw_cv_func___va_copy to "yes" or "no". Define HAVE___VA_COPY to 1 if
+# $hw_cv_func___va_copy is set to "yes".
+AC_DEFUN([HW_FUNC___VA_COPY],
+[
+ AC_REQUIRE([HW_HEADER_STDARG_H])dnl Our check evaluates HAVE_STDARG_H.
+ AC_REQUIRE([HW_HEADER_VARARGS_H])dnl Our check evaluates HAVE_VARARGS_H.
+ AC_CACHE_CHECK([for __va_copy],
+ [hw_cv_func___va_copy],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_STDARG_H
+ #include <stdarg.h>
+ #elif HAVE_VARARGS_H
+ #include <varargs.h>
+ #endif]],
+ [[va_list ap, aq; __va_copy(aq, ap);]])],
+ [hw_cv_func___va_copy=yes],
+ [hw_cv_func___va_copy=no],
+ [hw_cv_func___va_copy=no])])
+ AS_IF([test "$hw_cv_func___va_copy" = yes],
+ [AC_DEFINE([HAVE___VA_COPY], [1],
+ [Define to 1 if you have the `__va_copy' function or macro.])])
+])# HW_FUNC___VA_COPY
+
+# HW_FUNC_VSNPRINTF
+# -----------------
+# Set $hw_cv_func_vsnprintf and $hw_cv_func_vsnprintf_c99 to "yes" or
+# "no", respectively. If either $hw_force_rpl_vsnprintf is "yes" or
+# $hw_cv_func_vsnprintf_c99 is "no", define HW_WANT_RPL_VSNPRINTF and
+# define vsnprintf to rpl_vsnprintf.
+AC_DEFUN([HW_FUNC_VSNPRINTF],
+[
+ AC_PREREQ([2.60])dnl 2.59 should work if some AC_TYPE_* macros are replaced.
+ AC_REQUIRE([HW_HEADER_STDARG_H])dnl Our check evaluates HAVE_STDARG_H.
+ AC_CHECK_FUNC([vsnprintf],
+ [hw_cv_func_vsnprintf=yes],
+ [hw_cv_func_vsnprintf=no])
+ AS_IF([test "$hw_cv_func_vsnprintf" = yes],
+ [AC_CACHE_CHECK([whether vsnprintf is C99 compliant],
+ [hw_cv_func_vsnprintf_c99],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_STDARG_H
+ #include <stdarg.h>
+ #endif
+ #include <stdio.h>
+ static int testprintf(char *buf, size_t size, const char *format, ...)
+ {
+ int result;
+ va_list ap;
+ va_start(ap, format);
+ result = vsnprintf(buf, size, format, ap);
+ va_end(ap);
+ return result;
+ }]],
+ [[char buf[43];
+ if (testprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+ testprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+ buf[0] != 'T' || buf[3] != '\0')
+ return 1;]])],
+ [hw_cv_func_vsnprintf_c99=yes],
+ [hw_cv_func_vsnprintf_c99=no],
+ [hw_cv_func_vsnprintf_c99=no])])],
+ [hw_cv_func_vsnprintf_c99=no])
+ AC_DEFINE([HAVE_VSNPRINTF], [1],
+ [Define if C99-compliant `vsnprintf' is available.])
+ AC_MSG_CHECKING([if C99-snprintf replacement vsnprintf will be used])
+ AS_IF([test "${hw_force_rpl_vsnprintf=no}" = yes -o "$hw_cv_func_vsnprintf_c99" = no],
+ [hw_use_rpl_vsnprintf=yes],
+ [hw_use_rpl_vsnprintf=no])
+ AC_MSG_RESULT([$hw_use_rpl_vsnprintf])
+ AS_IF([test "$hw_use_rpl_vsnprintf" = yes],
+ [AC_DEFINE([HW_WANT_RPL_VSNPRINTF], [1],
+ [Define to provide `rpl_vsnprintf' function.])
+ AS_IF([test ${hw_nodef_vsnprintf=no} = no],
+ [AC_DEFINE([vsnprintf], [rpl_vsnprintf],
+ [Define to rpl_vsnprintf if the replacement function should be used.])])
+ AC_CHECK_HEADERS([inttypes.h locale.h stddef.h stdint.h])
+ AC_CHECK_MEMBERS([struct lconv.decimal_point, struct lconv.thousands_sep],
+ [], [], [#include <locale.h>])
+ AC_TYPE_LONG_DOUBLE
+ AC_TYPE_LONG_LONG_INT
+ AC_TYPE_UNSIGNED_LONG_LONG_INT
+ AC_TYPE_SIZE_T
+ AC_TYPE_INTMAX_T
+ AC_TYPE_UINTMAX_T
+ AC_TYPE_UINTPTR_T
+ AC_CHECK_TYPES([ptrdiff_t])
+ AC_CHECK_FUNCS([localeconv])
+ _HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_VSNPRINTF
+
+# HW_FUNC_SNPRINTF
+# ----------------
+# Set $hw_cv_func_snprintf and $hw_cv_func_snprintf_c99 to "yes" or
+# "no", respectively. If either $hw_force_rpl_snprintf is "yes" or
+# $hw_cv_func_snprintf_c99 is "no", define HW_WANT_RPL_SNPRINTF and
+# define snprintf to rpl_snprintf.
+# The same will be done for vsnprintf, as if HW_FUNC_VSNPRINTF were
+# used.
+AC_DEFUN([HW_FUNC_SNPRINTF],
+[
+ AC_REQUIRE([HW_FUNC_VSNPRINTF])dnl Our snprintf(3) calls vsnprintf(3).
+ AC_CHECK_FUNC([snprintf],
+ [hw_cv_func_snprintf=yes],
+ [hw_cv_func_snprintf=no])
+ AS_IF([test "$hw_cv_func_snprintf" = yes],
+ [AC_CACHE_CHECK([whether snprintf is C99 compliant],
+ [hw_cv_func_snprintf_c99],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdio.h>]],
+ [[char buf[43];
+ if (snprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+ snprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+ buf[0] != 'T' || buf[3] != '\0')
+ return 1;]])],
+ [hw_cv_func_snprintf_c99=yes],
+ [hw_cv_func_snprintf_c99=no],
+ [hw_cv_func_snprintf_c99=no])])],
+ [hw_cv_func_snprintf_c99=no])
+ AC_DEFINE([HAVE_SNPRINTF], [1],
+ [Define if C99-compliant `snprintf' is available.])
+ AC_MSG_CHECKING([if C99-snprintf replacement snprintf will be used])
+ AS_IF([test "${hw_force_rpl_snprintf=no}" = yes -o "$hw_cv_func_snprintf_c99" = no],
+ [hw_use_rpl_snprintf=yes],
+ [hw_use_rpl_snprintf=no])
+ AC_MSG_RESULT([$hw_use_rpl_snprintf])
+ AS_IF([test "$hw_use_rpl_snprintf" = yes],
+ [AC_DEFINE([HW_WANT_RPL_SNPRINTF], [1],
+ [Define to provide `rpl_snprintf' function.])
+ AS_IF([test ${hw_nodef_snprintf=no} = no],
+ [AC_DEFINE([snprintf], [rpl_snprintf],
+ [Define to rpl_snprintf if the replacement function should be used.])])
+ _HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_SNPRINTF
+
+# HW_FUNC_VASPRINTF
+# -----------------
+# Set $hw_cv_func_vasprintf to "yes" or "no". If either
+# $hw_force_rpl_vasprintf is "yes" or $hw_cv_func_vasprintf is "no",
+# define HW_WANT_RPL_VASPRINTF and define vasprintf to rpl_vasprintf.
+# The same will be done for vsnprintf, as if HW_FUNC_VSNPRINTF were
+# used.
+AC_DEFUN([HW_FUNC_VASPRINTF],
+[
+ AC_REQUIRE([HW_FUNC_VSNPRINTF])dnl Our vasprintf(3) calls vsnprintf(3).
+ AC_CHECK_FUNCS([vasprintf],
+ [hw_cv_func_vasprintf=yes],
+ [hw_cv_func_vasprintf=no])
+ AC_DEFINE([HAVE_VASPRINTF], [1],
+ [Define if `vasprintf' is available.])
+ AC_MSG_CHECKING([if C99-snprintf replacement vasprintf will be used])
+ AS_IF([test "${hw_force_rpl_vasprintf=no}" = yes -o "$hw_cv_func_vasprintf" = no],
+ [hw_use_rpl_vasprintf=yes],
+ [hw_use_rpl_vasprintf=no])
+ AC_MSG_RESULT([$hw_use_rpl_vasprintf])
+ AS_IF([test "$hw_use_rpl_vasprintf" = yes],
+ [AC_DEFINE([HW_WANT_RPL_VASPRINTF], [1],
+ [Define to provide `rpl_vasprintf' function.])
+ AS_IF([test ${hw_nodef_vasprintf=no} = no],
+ [AC_DEFINE([vasprintf], [rpl_vasprintf],
+ [Define to rpl_vasprintf if the replacement function should be used.])])
+ AC_CHECK_HEADERS([stdlib.h])
+ HW_FUNC_VA_COPY
+ AS_IF([test "$hw_cv_func_va_copy" = no],
+ [HW_FUNC___VA_COPY])
+ _HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_VASPRINTF
+
+# HW_FUNC_ASPRINTF
+# ----------------
+# Set $hw_cv_func_asprintf to "yes" or "no". If either
+# $hw_force_rpl_asprintf is "yes" or $hw_cv_func_asprintf is "no",
+# define HW_WANT_RPL_ASPRINTF and define asprintf to rpl_asprintf.
+# The same will be done for vasprintf, as if HW_FUNC_VASPRINTF were
+# used.
+AC_DEFUN([HW_FUNC_ASPRINTF],
+[
+ AC_REQUIRE([HW_FUNC_VASPRINTF])dnl Our asprintf(3) calls vasprintf(3).
+ AC_CHECK_FUNCS([asprintf],
+ [hw_cv_func_asprintf=yes],
+ [hw_cv_func_asprintf=no])
+ AC_DEFINE([HAVE_ASPRINTF], [1],
+ [Define if `asprintf' is available.])
+ AC_MSG_CHECKING([if C99-snprintf replacement asprintf will be used])
+ AS_IF([test "${hw_force_rpl_asprintf=no}" = yes -o "$hw_cv_func_asprintf" = no],
+ [hw_use_rpl_asprintf=yes],
+ [hw_use_rpl_asprintf=no])
+ AC_MSG_RESULT([$hw_use_rpl_asprintf])
+ AS_IF([test "$hw_use_rpl_asprintf" = yes],
+ [AC_DEFINE([HW_WANT_RPL_ASPRINTF], [1],
+ [Define to provide `rpl_asprintf' function.])
+ AS_IF([test ${hw_nodef_asprintf=no} = no],
+ [AC_DEFINE([asprintf], [rpl_asprintf],
+ [Define to rpl_asprintf if the replacement function should be used.])])
+ _HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_ASPRINTF
+
+# _HW_FUNC_XPRINTF_REPLACE
+# ------------------------
+# Arrange for building snprintf.c. Must be called if one or more of the
+# functions provided by snprintf.c are needed.
+AC_DEFUN([_HW_FUNC_XPRINTF_REPLACE],
+[
+ AS_IF([test "x$_hw_cv_func_xprintf_replace_done" != xyes],
+ [AC_C_CONST
+ HW_HEADER_STDARG_H
+ AC_LIBOBJ([snprintf])
+ _hw_cv_func_xprintf_replace_done=yes])
+])# _HW_FUNC_XPRINTF_REPLACE
+
+dnl vim: set joinspaces textwidth=80:
diff --git a/sntp/m4/version.m4 b/sntp/m4/version.m4
new file mode 100644
index 0000000..cfbb398
--- /dev/null
+++ b/sntp/m4/version.m4
@@ -0,0 +1 @@
+m4_define([VERSION_NUMBER],[4.2.7p482])
diff --git a/sntp/main.c b/sntp/main.c
new file mode 100644
index 0000000..d607108
--- /dev/null
+++ b/sntp/main.c
@@ -0,0 +1,1579 @@
+#include <config.h>
+
+#include <event2/util.h>
+#include <event2/event.h>
+
+#include "ntp_workimpl.h"
+#ifdef WORK_THREAD
+# include <event2/thread.h>
+#endif
+
+#include "main.h"
+#include "ntp_libopts.h"
+#include "kod_management.h"
+#include "networking.h"
+#include "utilities.h"
+#include "log.h"
+#include "libntp.h"
+
+
+int shutting_down;
+int time_derived;
+int time_adjusted;
+int n_pending_dns = 0;
+int n_pending_ntp = 0;
+int ai_fam_pref = AF_UNSPEC;
+int ntpver = 4;
+double steplimit = -1;
+SOCKET sock4 = -1; /* Socket for IPv4 */
+SOCKET sock6 = -1; /* Socket for IPv6 */
+/*
+** BCAST *must* listen on port 123 (by default), so we can only
+** use the UCST sockets (above) if they too are using port 123
+*/
+SOCKET bsock4 = -1; /* Broadcast Socket for IPv4 */
+SOCKET bsock6 = -1; /* Broadcast Socket for IPv6 */
+struct event_base *base;
+struct event *ev_sock4;
+struct event *ev_sock6;
+struct event *ev_worker_timeout;
+struct event *ev_xmt_timer;
+
+struct dns_ctx {
+ const char * name;
+ int flags;
+#define CTX_BCST 0x0001
+#define CTX_UCST 0x0002
+#define CTX_xCST 0x0003
+#define CTX_CONC 0x0004
+#define CTX_unused 0xfffd
+ int key_id;
+ struct timeval timeout;
+ struct key * key;
+};
+
+typedef struct sent_pkt_tag sent_pkt;
+struct sent_pkt_tag {
+ sent_pkt * link;
+ struct dns_ctx * dctx;
+ sockaddr_u addr;
+ time_t stime;
+ int done;
+ struct pkt x_pkt;
+};
+
+typedef struct xmt_ctx_tag xmt_ctx;
+struct xmt_ctx_tag {
+ xmt_ctx * link;
+ SOCKET sock;
+ time_t sched;
+ sent_pkt * spkt;
+};
+
+struct timeval gap;
+xmt_ctx * xmt_q;
+struct key * keys = NULL;
+int response_timeout;
+struct timeval response_tv;
+struct timeval start_tv;
+/* check the timeout at least once per second */
+struct timeval wakeup_tv = { 0, 888888 };
+
+sent_pkt * fam_listheads[2];
+#define v4_pkts_list (fam_listheads[0])
+#define v6_pkts_list (fam_listheads[1])
+
+static union {
+ struct pkt pkt;
+ char buf[LEN_PKT_NOMAC + NTP_MAXEXTEN + MAX_MAC_LEN];
+} rbuf;
+
+#define r_pkt rbuf.pkt
+
+#ifdef HAVE_DROPROOT
+int droproot; /* intres imports these */
+int root_dropped;
+#endif
+u_long current_time; /* libntp/authkeys.c */
+
+void open_sockets(void);
+void handle_lookup(const char *name, int flags);
+void sntp_addremove_fd(int fd, int is_pipe, int remove_it);
+void worker_timeout(evutil_socket_t, short, void *);
+void worker_resp_cb(evutil_socket_t, short, void *);
+void sntp_name_resolved(int, int, void *, const char *, const char *,
+ const struct addrinfo *,
+ const struct addrinfo *);
+void queue_xmt(SOCKET sock, struct dns_ctx *dctx, sent_pkt *spkt,
+ u_int xmt_delay);
+void xmt_timer_cb(evutil_socket_t, short, void *ptr);
+void xmt(xmt_ctx *xctx);
+int check_kod(const struct addrinfo *ai);
+void timeout_query(sent_pkt *);
+void timeout_queries(void);
+void sock_cb(evutil_socket_t, short, void *);
+void check_exit_conditions(void);
+void sntp_libevent_log_cb(int, const char *);
+void set_li_vn_mode(struct pkt *spkt, char leap, char version, char mode);
+int set_time(double offset);
+void dec_pending_ntp(const char *, sockaddr_u *);
+int libevent_version_ok(void);
+int gettimeofday_cached(struct event_base *b, struct timeval *tv);
+
+
+/*
+ * The actual main function.
+ */
+int
+sntp_main (
+ int argc,
+ char **argv,
+ const char *sntpVersion
+ )
+{
+ int i;
+ int exitcode;
+ int optct;
+ struct event_config * evcfg;
+
+ /* Initialize logging system - sets up progname */
+ sntp_init_logging(argv[0]);
+
+ if (!libevent_version_ok())
+ exit(EX_SOFTWARE);
+
+ init_lib();
+ init_auth();
+
+ optct = ntpOptionProcess(&sntpOptions, argc, argv);
+ argc -= optct;
+ argv += optct;
+
+
+ debug = OPT_VALUE_SET_DEBUG_LEVEL;
+
+ TRACE(2, ("init_lib() done, %s%s\n",
+ (ipv4_works)
+ ? "ipv4_works "
+ : "",
+ (ipv6_works)
+ ? "ipv6_works "
+ : ""));
+ ntpver = OPT_VALUE_NTPVERSION;
+ steplimit = OPT_VALUE_STEPLIMIT / 1e3;
+ gap.tv_usec = max(0, OPT_VALUE_GAP * 1000);
+ gap.tv_usec = min(gap.tv_usec, 999999);
+
+ if (HAVE_OPT(LOGFILE))
+ open_logfile(OPT_ARG(LOGFILE));
+
+ msyslog(LOG_INFO, "%s", sntpVersion);
+
+ if (0 == argc && !HAVE_OPT(BROADCAST) && !HAVE_OPT(CONCURRENT)) {
+ printf("%s: Must supply at least one of -b hostname, -c hostname, or hostname.\n",
+ progname);
+ exit(EX_USAGE);
+ }
+
+
+ /*
+ ** Eventually, we probably want:
+ ** - separate bcst and ucst timeouts (why?)
+ ** - multiple --timeout values in the commandline
+ */
+
+ response_timeout = OPT_VALUE_TIMEOUT;
+ response_tv.tv_sec = response_timeout;
+ response_tv.tv_usec = 0;
+
+ /* IPv6 available? */
+ if (isc_net_probeipv6() != ISC_R_SUCCESS) {
+ ai_fam_pref = AF_INET;
+ TRACE(1, ("No ipv6 support available, forcing ipv4\n"));
+ } else {
+ /* Check for options -4 and -6 */
+ if (HAVE_OPT(IPV4))
+ ai_fam_pref = AF_INET;
+ else if (HAVE_OPT(IPV6))
+ ai_fam_pref = AF_INET6;
+ }
+
+ /* TODO: Parse config file if declared */
+
+ /*
+ ** Init the KOD system.
+ ** For embedded systems with no writable filesystem,
+ ** -K /dev/null can be used to disable KoD storage.
+ */
+ kod_init_kod_db(OPT_ARG(KOD), FALSE);
+
+ // HMS: Should we use arg-defalt for this too?
+ if (HAVE_OPT(KEYFILE))
+ auth_init(OPT_ARG(KEYFILE), &keys);
+
+ /*
+ ** Considering employing a variable that prevents functions of doing
+ ** anything until everything is initialized properly
+ **
+ ** HMS: What exactly does the above mean?
+ */
+ event_set_log_callback(&sntp_libevent_log_cb);
+ if (debug > 0)
+ event_enable_debug_mode();
+#ifdef WORK_THREAD
+ evthread_use_pthreads();
+ /* we use libevent from main thread only, locks should be academic */
+ if (debug > 0)
+ evthread_enable_lock_debuging();
+#endif
+ evcfg = event_config_new();
+ if (NULL == evcfg) {
+ printf("%s: event_config_new() failed!\n", progname);
+ return -1;
+ }
+#ifndef HAVE_SOCKETPAIR
+ event_config_require_features(evcfg, EV_FEATURE_FDS);
+#endif
+ /* all libevent calls are from main thread */
+ /* event_config_set_flag(evcfg, EVENT_BASE_FLAG_NOLOCK); */
+ base = event_base_new_with_config(evcfg);
+ event_config_free(evcfg);
+ if (NULL == base) {
+ printf("%s: event_base_new() failed!\n", progname);
+ return -1;
+ }
+
+ /* wire into intres resolver */
+ worker_per_query = TRUE;
+ addremove_io_fd = &sntp_addremove_fd;
+
+ open_sockets();
+
+ if (HAVE_OPT(BROADCAST)) {
+ int cn = STACKCT_OPT( BROADCAST );
+ const char ** cp = STACKLST_OPT( BROADCAST );
+
+ while (cn-- > 0) {
+ handle_lookup(*cp, CTX_BCST);
+ cp++;
+ }
+ }
+
+ if (HAVE_OPT(CONCURRENT)) {
+ int cn = STACKCT_OPT( CONCURRENT );
+ const char ** cp = STACKLST_OPT( CONCURRENT );
+
+ while (cn-- > 0) {
+ handle_lookup(*cp, CTX_UCST | CTX_CONC);
+ cp++;
+ }
+ }
+
+ for (i = 0; i < argc; ++i)
+ handle_lookup(argv[i], CTX_UCST);
+
+ gettimeofday_cached(base, &start_tv);
+ event_base_dispatch(base);
+ event_base_free(base);
+
+ if (!time_adjusted &&
+ (ENABLED_OPT(STEP) || ENABLED_OPT(SLEW)))
+ exitcode = 1;
+ else
+ exitcode = 0;
+
+ return exitcode;
+}
+
+
+/*
+** open sockets and make them non-blocking
+*/
+void
+open_sockets(
+ void
+ )
+{
+ sockaddr_u name;
+
+ if (-1 == sock4) {
+ sock4 = socket(PF_INET, SOCK_DGRAM, 0);
+ if (-1 == sock4) {
+ /* error getting a socket */
+ msyslog(LOG_ERR, "open_sockets: socket(PF_INET) failed: %m");
+ exit(1);
+ }
+ /* Make it non-blocking */
+ make_socket_nonblocking(sock4);
+
+ /* Let's try using a wildcard... */
+ ZERO(name);
+ AF(&name) = AF_INET;
+ SET_ADDR4N(&name, INADDR_ANY);
+ SET_PORT(&name, (HAVE_OPT(USERESERVEDPORT) ? 123 : 0));
+
+ if (-1 == bind(sock4, &name.sa,
+ SOCKLEN(&name))) {
+ msyslog(LOG_ERR, "open_sockets: bind(sock4) failed: %m");
+ exit(1);
+ }
+
+ /* Register an NTP callback for recv/timeout */
+ ev_sock4 = event_new(base, sock4,
+ EV_TIMEOUT | EV_READ | EV_PERSIST,
+ &sock_cb, NULL);
+ if (NULL == ev_sock4) {
+ msyslog(LOG_ERR,
+ "open_sockets: event_new(base, sock4) failed!");
+ } else {
+ event_add(ev_sock4, &wakeup_tv);
+ }
+ }
+
+ /* We may not always have IPv6... */
+ if (-1 == sock6 && ipv6_works) {
+ sock6 = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (-1 == sock6 && ipv6_works) {
+ /* error getting a socket */
+ msyslog(LOG_ERR, "open_sockets: socket(PF_INET6) failed: %m");
+ exit(1);
+ }
+ /* Make it non-blocking */
+ make_socket_nonblocking(sock6);
+
+ /* Let's try using a wildcard... */
+ ZERO(name);
+ AF(&name) = AF_INET6;
+ SET_ADDR6N(&name, in6addr_any);
+ SET_PORT(&name, (HAVE_OPT(USERESERVEDPORT) ? 123 : 0));
+
+ if (-1 == bind(sock6, &name.sa,
+ SOCKLEN(&name))) {
+ msyslog(LOG_ERR, "open_sockets: bind(sock6) failed: %m");
+ exit(1);
+ }
+ /* Register an NTP callback for recv/timeout */
+ ev_sock6 = event_new(base, sock6,
+ EV_TIMEOUT | EV_READ | EV_PERSIST,
+ &sock_cb, NULL);
+ if (NULL == ev_sock6) {
+ msyslog(LOG_ERR,
+ "open_sockets: event_new(base, sock6) failed!");
+ } else {
+ event_add(ev_sock6, &wakeup_tv);
+ }
+ }
+
+ return;
+}
+
+
+/*
+** handle_lookup
+*/
+void
+handle_lookup(
+ const char *name,
+ int flags
+ )
+{
+ struct addrinfo hints; /* Local copy is OK */
+ struct dns_ctx *ctx;
+ long l;
+ char * name_copy;
+ size_t name_sz;
+ size_t octets;
+
+ TRACE(1, ("handle_lookup(%s,%#x)\n", name, flags));
+
+ ZERO(hints);
+ hints.ai_family = ai_fam_pref;
+ hints.ai_flags = AI_CANONNAME | Z_AI_NUMERICSERV;
+ /*
+ ** Unless we specify a socktype, we'll get at least two
+ ** entries for each address: one for TCP and one for
+ ** UDP. That's not what we want.
+ */
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+
+ name_sz = 1 + strlen(name);
+ octets = sizeof(*ctx) + name_sz; // Space for a ctx and the name
+ ctx = emalloc_zero(octets); // ctx at ctx[0]
+ name_copy = (char *)(ctx + 1); // Put the name at ctx[1]
+ memcpy(name_copy, name, name_sz); // copy the name to ctx[1]
+ ctx->name = name_copy; // point to it...
+ ctx->flags = flags;
+ ctx->timeout = response_tv;
+
+ /* The following should arguably be passed in... */
+ if (ENABLED_OPT(AUTHENTICATION) &&
+ atoint(OPT_ARG(AUTHENTICATION), &l)) {
+ ctx->key_id = l;
+ get_key(ctx->key_id, &ctx->key);
+ } else {
+ ctx->key_id = -1;
+ ctx->key = NULL;
+ }
+
+ ++n_pending_dns;
+ getaddrinfo_sometime(name, "123", &hints, 0,
+ &sntp_name_resolved, ctx);
+}
+
+
+/*
+** DNS Callback:
+** - For each IP:
+** - - open a socket
+** - - increment n_pending_ntp
+** - - send a request if this is a Unicast callback
+** - - queue wait for response
+** - decrement n_pending_dns
+*/
+void
+sntp_name_resolved(
+ int rescode,
+ int gai_errno,
+ void * context,
+ const char * name,
+ const char * service,
+ const struct addrinfo * hints,
+ const struct addrinfo * addr
+ )
+{
+ struct dns_ctx * dctx;
+ sent_pkt * spkt;
+ const struct addrinfo * ai;
+ SOCKET sock;
+ u_int xmt_delay_v4;
+ u_int xmt_delay_v6;
+ u_int xmt_delay;
+ size_t octets;
+
+ xmt_delay_v4 = 0;
+ xmt_delay_v6 = 0;
+ dctx = context;
+ if (rescode) {
+#ifdef EAI_SYSTEM
+ if (EAI_SYSTEM == rescode) {
+ errno = gai_errno;
+ mfprintf(stderr, "%s lookup error %m\n",
+ dctx->name);
+ } else
+#endif
+ fprintf(stderr, "%s lookup error %s\n",
+ dctx->name, gai_strerror(rescode));
+ } else {
+ TRACE(3, ("%s [%s]\n", dctx->name,
+ (addr->ai_canonname != NULL)
+ ? addr->ai_canonname
+ : ""));
+
+ for (ai = addr; ai != NULL; ai = ai->ai_next) {
+
+ if (check_kod(ai))
+ continue;
+
+ switch (ai->ai_family) {
+
+ case AF_INET:
+ sock = sock4;
+ xmt_delay = xmt_delay_v4;
+ xmt_delay_v4++;
+ break;
+
+ case AF_INET6:
+ if (!ipv6_works)
+ continue;
+
+ sock = sock6;
+ xmt_delay = xmt_delay_v6;
+ xmt_delay_v6++;
+ break;
+
+ default:
+ msyslog(LOG_ERR, "sntp_name_resolved: unexpected ai_family: %d",
+ ai->ai_family);
+ exit(1);
+ break;
+ }
+
+ /*
+ ** We're waiting for a response for either unicast
+ ** or broadcast, so...
+ */
+ ++n_pending_ntp;
+
+ /* If this is for a unicast IP, queue a request */
+ if (dctx->flags & CTX_UCST) {
+ spkt = emalloc_zero(sizeof(*spkt));
+ spkt->dctx = dctx;
+ octets = min(ai->ai_addrlen, sizeof(spkt->addr));
+ memcpy(&spkt->addr, ai->ai_addr, octets);
+ queue_xmt(sock, dctx, spkt, xmt_delay);
+ }
+ }
+ }
+ /* n_pending_dns really should be >0 here... */
+ --n_pending_dns;
+ check_exit_conditions();
+}
+
+
+/*
+** queue_xmt
+*/
+void
+queue_xmt(
+ SOCKET sock,
+ struct dns_ctx * dctx,
+ sent_pkt * spkt,
+ u_int xmt_delay
+ )
+{
+ sockaddr_u * dest;
+ sent_pkt ** pkt_listp;
+ sent_pkt * match;
+ xmt_ctx * xctx;
+ struct timeval start_cb;
+ struct timeval delay;
+
+ dest = &spkt->addr;
+ if (IS_IPV6(dest))
+ pkt_listp = &v6_pkts_list;
+ else
+ pkt_listp = &v4_pkts_list;
+
+ /* reject attempts to add address already listed */
+ for (match = *pkt_listp; match != NULL; match = match->link) {
+ if (ADDR_PORT_EQ(&spkt->addr, &match->addr)) {
+ if (strcasecmp(spkt->dctx->name,
+ match->dctx->name))
+ printf("%s %s duplicate address from %s ignored.\n",
+ sptoa(&match->addr),
+ match->dctx->name,
+ spkt->dctx->name);
+ else
+ printf("%s %s, duplicate address ignored.\n",
+ sptoa(&match->addr),
+ match->dctx->name);
+ dec_pending_ntp(spkt->dctx->name, &spkt->addr);
+ free(spkt);
+ return;
+ }
+ }
+
+ LINK_SLIST(*pkt_listp, spkt, link);
+
+ xctx = emalloc_zero(sizeof(*xctx));
+ xctx->sock = sock;
+ xctx->spkt = spkt;
+ gettimeofday_cached(base, &start_cb);
+ xctx->sched = start_cb.tv_sec + (2 * xmt_delay);
+
+ LINK_SORT_SLIST(xmt_q, xctx, (xctx->sched < L_S_S_CUR()->sched),
+ link, xmt_ctx);
+ if (xmt_q == xctx) {
+ /*
+ * The new entry is the first scheduled. The timer is
+ * either not active or is set for the second xmt
+ * context in xmt_q.
+ */
+ if (NULL == ev_xmt_timer)
+ ev_xmt_timer = event_new(base, INVALID_SOCKET,
+ EV_TIMEOUT,
+ &xmt_timer_cb, NULL);
+ if (NULL == ev_xmt_timer) {
+ msyslog(LOG_ERR,
+ "queue_xmt: event_new(base, -1, EV_TIMEOUT) failed!");
+ exit(1);
+ }
+ ZERO(delay);
+ if (xctx->sched > start_cb.tv_sec)
+ delay.tv_sec = xctx->sched - start_cb.tv_sec;
+ event_add(ev_xmt_timer, &delay);
+ TRACE(2, ("queue_xmt: xmt timer for %u usec\n",
+ (u_int)delay.tv_usec));
+ }
+}
+
+
+/*
+** xmt_timer_cb
+*/
+void
+xmt_timer_cb(
+ evutil_socket_t fd,
+ short what,
+ void * ctx
+ )
+{
+ struct timeval start_cb;
+ struct timeval delay;
+ xmt_ctx * x;
+
+ UNUSED_ARG(fd);
+ UNUSED_ARG(ctx);
+ DEBUG_INSIST(EV_TIMEOUT == what);
+
+ if (NULL == xmt_q || shutting_down)
+ return;
+ gettimeofday_cached(base, &start_cb);
+ if (xmt_q->sched <= start_cb.tv_sec) {
+ UNLINK_HEAD_SLIST(x, xmt_q, link);
+ TRACE(2, ("xmt_timer_cb: at .%6.6u -> %s\n",
+ (u_int)start_cb.tv_usec, stoa(&x->spkt->addr)));
+ xmt(x);
+ free(x);
+ if (NULL == xmt_q)
+ return;
+ }
+ if (xmt_q->sched <= start_cb.tv_sec) {
+ event_add(ev_xmt_timer, &gap);
+ TRACE(2, ("xmt_timer_cb: at .%6.6u gap %6.6u\n",
+ (u_int)start_cb.tv_usec,
+ (u_int)gap.tv_usec));
+ } else {
+ delay.tv_sec = xmt_q->sched - start_cb.tv_sec;
+ delay.tv_usec = 0;
+ event_add(ev_xmt_timer, &delay);
+ TRACE(2, ("xmt_timer_cb: at .%6.6u next %ld seconds\n",
+ (u_int)start_cb.tv_usec,
+ (long)delay.tv_sec));
+ }
+}
+
+
+/*
+** xmt()
+*/
+void
+xmt(
+ xmt_ctx * xctx
+ )
+{
+ SOCKET sock = xctx->sock;
+ struct dns_ctx *dctx = xctx->spkt->dctx;
+ sent_pkt * spkt = xctx->spkt;
+ sockaddr_u * dst = &spkt->addr;
+ struct timeval tv_xmt;
+ struct pkt x_pkt;
+ int pkt_len;
+ int sent;
+
+ if (0 != gettimeofday(&tv_xmt, NULL)) {
+ msyslog(LOG_ERR,
+ "xmt: gettimeofday() failed: %m");
+ exit(1);
+ }
+ tv_xmt.tv_sec += JAN_1970;
+
+ pkt_len = generate_pkt(&x_pkt, &tv_xmt, dctx->key_id,
+ dctx->key);
+
+ sent = sendpkt(sock, dst, &x_pkt, pkt_len);
+ if (sent) {
+ /* Save the packet we sent... */
+ memcpy(&spkt->x_pkt, &x_pkt, min(sizeof(spkt->x_pkt),
+ pkt_len));
+ spkt->stime = tv_xmt.tv_sec - JAN_1970;
+
+ TRACE(2, ("xmt: %lx.%6.6u %s %s\n", (u_long)tv_xmt.tv_sec,
+ (u_int)tv_xmt.tv_usec, dctx->name, stoa(dst)));
+ } else {
+ dec_pending_ntp(dctx->name, dst);
+ }
+
+ return;
+}
+
+
+/*
+ * timeout_queries() -- give up on unrequited NTP queries
+ */
+void
+timeout_queries(void)
+{
+ struct timeval start_cb;
+ u_int idx;
+ sent_pkt * head;
+ sent_pkt * spkt;
+ sent_pkt * spkt_next;
+ long age;
+ int didsomething = 0;
+
+ TRACE(3, ("timeout_queries: called to check %u items\n",
+ (unsigned)COUNTOF(fam_listheads)));
+
+ gettimeofday_cached(base, &start_cb);
+ for (idx = 0; idx < COUNTOF(fam_listheads); idx++) {
+ head = fam_listheads[idx];
+ for (spkt = head; spkt != NULL; spkt = spkt_next) {
+ char xcst;
+
+ didsomething = 1;
+ switch (spkt->dctx->flags & CTX_xCST) {
+ case CTX_BCST:
+ xcst = 'B';
+ break;
+
+ case CTX_UCST:
+ xcst = 'U';
+ break;
+
+ default:
+ INSIST(!"spkt->dctx->flags neither UCST nor BCST");
+ break;
+ }
+
+ spkt_next = spkt->link;
+ if (0 == spkt->stime || spkt->done)
+ continue;
+ age = start_cb.tv_sec - spkt->stime;
+ TRACE(3, ("%s %s %cCST age %ld\n",
+ stoa(&spkt->addr),
+ spkt->dctx->name, xcst, age));
+ if (age > response_timeout)
+ timeout_query(spkt);
+ }
+ }
+ // Do we care about didsomething?
+ TRACE(3, ("timeout_queries: didsomething is %d, age is %ld\n",
+ didsomething, (long) (start_cb.tv_sec - start_tv.tv_sec)));
+ if (start_cb.tv_sec - start_tv.tv_sec > response_timeout) {
+ TRACE(3, ("timeout_queries: bail!\n"));
+ event_base_loopexit(base, NULL);
+ shutting_down = TRUE;
+ }
+}
+
+
+void dec_pending_ntp(
+ const char * name,
+ sockaddr_u * server
+ )
+{
+ if (n_pending_ntp > 0) {
+ --n_pending_ntp;
+ check_exit_conditions();
+ } else {
+ INSIST(0 == n_pending_ntp);
+ TRACE(1, ("n_pending_ntp was zero before decrement for %s\n",
+ hostnameaddr(name, server)));
+ }
+}
+
+
+void timeout_query(
+ sent_pkt * spkt
+ )
+{
+ sockaddr_u * server;
+ char xcst;
+
+
+ switch (spkt->dctx->flags & CTX_xCST) {
+ case CTX_BCST:
+ xcst = 'B';
+ break;
+
+ case CTX_UCST:
+ xcst = 'U';
+ break;
+
+ default:
+ INSIST(!"spkt->dctx->flags neither UCST nor BCST");
+ break;
+ }
+ spkt->done = TRUE;
+ server = &spkt->addr;
+ msyslog(LOG_INFO, "%s no %cCST response after %d seconds",
+ hostnameaddr(spkt->dctx->name, server), xcst,
+ response_timeout);
+ dec_pending_ntp(spkt->dctx->name, server);
+ return;
+}
+
+
+/*
+** check_kod
+*/
+int
+check_kod(
+ const struct addrinfo * ai
+ )
+{
+ char *hostname;
+ struct kod_entry *reason;
+
+ /* Is there a KoD on file for this address? */
+ hostname = addrinfo_to_str(ai);
+ TRACE(2, ("check_kod: checking <%s>\n", hostname));
+ if (search_entry(hostname, &reason)) {
+ printf("prior KoD for %s, skipping.\n",
+ hostname);
+ free(reason);
+ free(hostname);
+
+ return 1;
+ }
+ free(hostname);
+
+ return 0;
+}
+
+
+/*
+** Socket readable/timeout Callback:
+** Read in the packet
+** Unicast:
+** - close socket
+** - decrement n_pending_ntp
+** - If packet is good, set the time and "exit"
+** Broadcast:
+** - If packet is good, set the time and "exit"
+*/
+void
+sock_cb(
+ evutil_socket_t fd,
+ short what,
+ void *ptr
+ )
+{
+ sockaddr_u sender;
+ sockaddr_u * psau;
+ sent_pkt ** p_pktlist;
+ sent_pkt * spkt;
+ int rpktl;
+ int rc;
+
+ INSIST(sock4 == fd || sock6 == fd);
+
+ TRACE(3, ("sock_cb: event on sock%s:%s%s%s%s\n",
+ (fd == sock6)
+ ? "6"
+ : "4",
+ (what & EV_TIMEOUT) ? " timeout" : "",
+ (what & EV_READ) ? " read" : "",
+ (what & EV_WRITE) ? " write" : "",
+ (what & EV_SIGNAL) ? " signal" : ""));
+
+ if (!(EV_READ & what)) {
+ if (EV_TIMEOUT & what)
+ timeout_queries();
+
+ return;
+ }
+
+ /* Read in the packet */
+ rpktl = recvdata(fd, &sender, &rbuf, sizeof(rbuf));
+ if (rpktl < 0) {
+ msyslog(LOG_DEBUG, "recvfrom error %m");
+ return;
+ }
+
+ if (sock6 == fd)
+ p_pktlist = &v6_pkts_list;
+ else
+ p_pktlist = &v4_pkts_list;
+
+ for (spkt = *p_pktlist; spkt != NULL; spkt = spkt->link) {
+ psau = &spkt->addr;
+ if (SOCK_EQ(&sender, psau))
+ break;
+ }
+ if (NULL == spkt) {
+ msyslog(LOG_WARNING,
+ "Packet from unexpected source %s dropped",
+ sptoa(&sender));
+ return;
+ }
+
+ TRACE(1, ("sock_cb: %s %s\n", spkt->dctx->name,
+ sptoa(&sender)));
+
+ rpktl = process_pkt(&r_pkt, &sender, rpktl, MODE_SERVER,
+ &spkt->x_pkt, "sock_cb");
+
+ TRACE(2, ("sock_cb: process_pkt returned %d\n", rpktl));
+
+ /* If this is a Unicast packet, one down ... */
+ if (!spkt->done && (CTX_UCST & spkt->dctx->flags)) {
+ dec_pending_ntp(spkt->dctx->name, &spkt->addr);
+ spkt->done = TRUE;
+ }
+
+
+ /* If the packet is good, set the time and we're all done */
+ rc = handle_pkt(rpktl, &r_pkt, &spkt->addr, spkt->dctx->name);
+ if (0 != rc)
+ TRACE(1, ("sock_cb: handle_pkt() returned %d\n", rc));
+ check_exit_conditions();
+}
+
+
+/*
+ * check_exit_conditions()
+ *
+ * If sntp has a reply, ask the event loop to stop after this round of
+ * callbacks, unless --wait was used.
+ */
+void
+check_exit_conditions(void)
+{
+ if ((0 == n_pending_ntp && 0 == n_pending_dns) ||
+ (time_derived && !HAVE_OPT(WAIT))) {
+ event_base_loopexit(base, NULL);
+ shutting_down = TRUE;
+ } else {
+ TRACE(2, ("%d NTP and %d name queries pending\n",
+ n_pending_ntp, n_pending_dns));
+ }
+}
+
+
+/*
+ * sntp_addremove_fd() is invoked by the intres blocking worker code
+ * to read from a pipe, or to stop same.
+ */
+void sntp_addremove_fd(
+ int fd,
+ int is_pipe,
+ int remove_it
+ )
+{
+ u_int idx;
+ blocking_child *c;
+ struct event * ev;
+
+#ifdef HAVE_SOCKETPAIR
+ if (is_pipe) {
+ /* sntp only asks for EV_FEATURE_FDS without HAVE_SOCKETPAIR */
+ msyslog(LOG_ERR, "fatal: pipes not supported on systems with socketpair()");
+ exit(1);
+ }
+#endif
+
+ c = NULL;
+ for (idx = 0; idx < blocking_children_alloc; idx++) {
+ c = blocking_children[idx];
+ if (NULL == c)
+ continue;
+ if (fd == c->resp_read_pipe)
+ break;
+ }
+ if (idx == blocking_children_alloc)
+ return;
+
+ if (remove_it) {
+ ev = c->resp_read_ctx;
+ c->resp_read_ctx = NULL;
+ event_del(ev);
+ event_free(ev);
+
+ return;
+ }
+
+ ev = event_new(base, fd, EV_READ | EV_PERSIST,
+ &worker_resp_cb, c);
+ if (NULL == ev) {
+ msyslog(LOG_ERR,
+ "sntp_addremove_fd: event_new(base, fd) failed!");
+ return;
+ }
+ c->resp_read_ctx = ev;
+ event_add(ev, NULL);
+}
+
+
+/* called by forked intres child to close open descriptors */
+#ifdef WORK_FORK
+void
+kill_asyncio(
+ int startfd
+ )
+{
+ if (INVALID_SOCKET != sock4) {
+ closesocket(sock4);
+ sock4 = INVALID_SOCKET;
+ }
+ if (INVALID_SOCKET != sock6) {
+ closesocket(sock6);
+ sock6 = INVALID_SOCKET;
+ }
+ if (INVALID_SOCKET != bsock4) {
+ closesocket(sock4);
+ sock4 = INVALID_SOCKET;
+ }
+ if (INVALID_SOCKET != bsock6) {
+ closesocket(sock6);
+ sock6 = INVALID_SOCKET;
+ }
+}
+#endif
+
+
+/*
+ * worker_resp_cb() is invoked when resp_read_pipe is readable.
+ */
+void
+worker_resp_cb(
+ evutil_socket_t fd,
+ short what,
+ void * ctx /* blocking_child * */
+ )
+{
+ blocking_child * c;
+
+ DEBUG_INSIST(EV_READ & what);
+ c = ctx;
+ DEBUG_INSIST(fd == c->resp_read_pipe);
+ process_blocking_resp(c);
+}
+
+
+/*
+ * intres_timeout_req(s) is invoked in the parent to schedule an idle
+ * timeout to fire in s seconds, if not reset earlier by a call to
+ * intres_timeout_req(0), which clears any pending timeout. When the
+ * timeout expires, worker_idle_timer_fired() is invoked (again, in the
+ * parent).
+ *
+ * sntp and ntpd each provide implementations adapted to their timers.
+ */
+void
+intres_timeout_req(
+ u_int seconds /* 0 cancels */
+ )
+{
+ struct timeval tv_to;
+
+ if (NULL == ev_worker_timeout) {
+ ev_worker_timeout = event_new(base, -1,
+ EV_TIMEOUT | EV_PERSIST,
+ &worker_timeout, NULL);
+ DEBUG_INSIST(NULL != ev_worker_timeout);
+ } else {
+ event_del(ev_worker_timeout);
+ }
+ if (0 == seconds)
+ return;
+ tv_to.tv_sec = seconds;
+ tv_to.tv_usec = 0;
+ event_add(ev_worker_timeout, &tv_to);
+}
+
+
+void
+worker_timeout(
+ evutil_socket_t fd,
+ short what,
+ void * ctx
+ )
+{
+ UNUSED_ARG(fd);
+ UNUSED_ARG(ctx);
+
+ DEBUG_REQUIRE(EV_TIMEOUT & what);
+ worker_idle_timer_fired();
+}
+
+
+void
+sntp_libevent_log_cb(
+ int severity,
+ const char * msg
+ )
+{
+ int level;
+
+ switch (severity) {
+
+ default:
+ case _EVENT_LOG_DEBUG:
+ level = LOG_DEBUG;
+ break;
+
+ case _EVENT_LOG_MSG:
+ level = LOG_NOTICE;
+ break;
+
+ case _EVENT_LOG_WARN:
+ level = LOG_WARNING;
+ break;
+
+ case _EVENT_LOG_ERR:
+ level = LOG_ERR;
+ break;
+ }
+
+ msyslog(level, "%s", msg);
+}
+
+
+int
+generate_pkt (
+ struct pkt *x_pkt,
+ const struct timeval *tv_xmt,
+ int key_id,
+ struct key *pkt_key
+ )
+{
+ l_fp xmt_fp;
+ int pkt_len;
+ int mac_size;
+
+ pkt_len = LEN_PKT_NOMAC;
+ ZERO(*x_pkt);
+ TVTOTS(tv_xmt, &xmt_fp);
+ HTONL_FP(&xmt_fp, &x_pkt->xmt);
+ x_pkt->stratum = STRATUM_TO_PKT(STRATUM_UNSPEC);
+ x_pkt->ppoll = 8;
+ /* FIXME! Modus broadcast + adr. check -> bdr. pkt */
+ set_li_vn_mode(x_pkt, LEAP_NOTINSYNC, ntpver, 3);
+ if (pkt_key != NULL) {
+ x_pkt->exten[0] = htonl(key_id);
+ mac_size = 20; /* max room for MAC */
+ mac_size = make_mac((char *)x_pkt, pkt_len, mac_size,
+ pkt_key, (char *)&x_pkt->exten[1]);
+ if (mac_size > 0)
+ pkt_len += mac_size + 4;
+ }
+ return pkt_len;
+}
+
+
+int
+handle_pkt(
+ int rpktl,
+ struct pkt * rpkt,
+ sockaddr_u * host,
+ const char * hostname
+ )
+{
+ char disptxt[32];
+ const char * addrtxt;
+ struct timeval tv_dst;
+ int cnt;
+ int sw_case;
+ int digits;
+ int stratum;
+ char * ref;
+ char * ts_str;
+ double offset;
+ double precision;
+ double synch_distance;
+ char * p_SNTP_PRETEND_TIME;
+ time_t pretend_time;
+#if SIZEOF_TIME_T == 8
+ long long ll;
+#else
+ long l;
+#endif
+
+ ts_str = NULL;
+
+ if (rpktl > 0)
+ sw_case = 1;
+ else
+ sw_case = rpktl;
+
+ switch (sw_case) {
+
+ case SERVER_UNUSEABLE:
+ return -1;
+ break;
+
+ case PACKET_UNUSEABLE:
+ break;
+
+ case SERVER_AUTH_FAIL:
+ break;
+
+ case KOD_DEMOBILIZE:
+ /* Received a DENY or RESTR KOD packet */
+ addrtxt = stoa(host);
+ ref = (char *)&rpkt->refid;
+ add_entry(addrtxt, ref);
+ msyslog(LOG_WARNING, "KOD code %c%c%c%c from %s %s",
+ ref[0], ref[1], ref[2], ref[3], addrtxt, hostname);
+ break;
+
+ case KOD_RATE:
+ /*
+ ** Hmm...
+ ** We should probably call add_entry() with an
+ ** expiration timestamp of several seconds in the future,
+ ** and back-off even more if we get more RATE responses.
+ */
+ break;
+
+ case 1:
+ TRACE(3, ("handle_pkt: %d bytes from %s %s\n",
+ rpktl, stoa(host), hostname));
+
+ gettimeofday_cached(base, &tv_dst);
+
+ p_SNTP_PRETEND_TIME = getenv("SNTP_PRETEND_TIME");
+ if (p_SNTP_PRETEND_TIME) {
+ pretend_time = 0;
+#if SIZEOF_TIME_T == 4
+ if (1 == sscanf(p_SNTP_PRETEND_TIME, "%ld", &l))
+ pretend_time = (time_t)l;
+#elif SIZEOF_TIME_T == 8
+ if (1 == sscanf(p_SNTP_PRETEND_TIME, "%lld", &ll))
+ pretend_time = (time_t)ll;
+#else
+# include "GRONK: unexpected value for SIZEOF_TIME_T"
+#endif
+ if (0 != pretend_time)
+ tv_dst.tv_sec = pretend_time;
+ }
+
+ offset_calculation(rpkt, rpktl, &tv_dst, &offset,
+ &precision, &synch_distance);
+ time_derived = TRUE;
+
+ for (digits = 0; (precision *= 10.) < 1.; ++digits)
+ /* empty */ ;
+ if (digits > 6)
+ digits = 6;
+
+ ts_str = tv_to_str(&tv_dst);
+ stratum = rpkt->stratum;
+ if (0 == stratum)
+ stratum = 16;
+
+ if (synch_distance > 0.) {
+ cnt = snprintf(disptxt, sizeof(disptxt),
+ " +/- %f", synch_distance);
+ if (cnt >= sizeof(disptxt))
+ snprintf(disptxt, sizeof(disptxt),
+ "ERROR %d >= %d", cnt,
+ (int)sizeof(disptxt));
+ } else {
+ disptxt[0] = '\0';
+ }
+
+ msyslog(LOG_INFO, "%s %+.*f%s %s s%d%s", ts_str,
+ digits, offset, disptxt,
+ hostnameaddr(hostname, host), stratum,
+ (time_adjusted)
+ ? " [excess]"
+ : "");
+ free(ts_str);
+
+ if (p_SNTP_PRETEND_TIME)
+ return 0;
+
+ if (!time_adjusted &&
+ (ENABLED_OPT(STEP) || ENABLED_OPT(SLEW)))
+ return set_time(offset);
+
+ return EX_OK;
+ }
+
+ return 1;
+}
+
+
+void
+offset_calculation(
+ struct pkt *rpkt,
+ int rpktl,
+ struct timeval *tv_dst,
+ double *offset,
+ double *precision,
+ double *synch_distance
+ )
+{
+ l_fp p_rec, p_xmt, p_ref, p_org, tmp, dst;
+ u_fp p_rdly, p_rdsp;
+ double t21, t34, delta;
+
+ /* Convert timestamps from network to host byte order */
+ p_rdly = NTOHS_FP(rpkt->rootdelay);
+ p_rdsp = NTOHS_FP(rpkt->rootdisp);
+ NTOHL_FP(&rpkt->reftime, &p_ref);
+ NTOHL_FP(&rpkt->org, &p_org);
+ NTOHL_FP(&rpkt->rec, &p_rec);
+ NTOHL_FP(&rpkt->xmt, &p_xmt);
+
+ *precision = LOGTOD(rpkt->precision);
+
+ TRACE(3, ("offset_calculation: LOGTOD(rpkt->precision): %f\n", *precision));
+
+ /* Compute offset etc. */
+ tmp = p_rec;
+ L_SUB(&tmp, &p_org);
+ LFPTOD(&tmp, t21);
+ TVTOTS(tv_dst, &dst);
+ dst.l_ui += JAN_1970;
+ tmp = p_xmt;
+ L_SUB(&tmp, &dst);
+ LFPTOD(&tmp, t34);
+ *offset = (t21 + t34) / 2.;
+ delta = t21 - t34;
+
+ // synch_distance is:
+ // (peer->delay + peer->rootdelay) / 2 + peer->disp
+ // + peer->rootdisp + clock_phi * (current_time - peer->update)
+ // + peer->jitter;
+ //
+ // and peer->delay = fabs(peer->offset - p_offset) * 2;
+ // and peer->offset needs history, so we're left with
+ // p_offset = (t21 + t34) / 2.;
+ // peer->disp = 0; (we have no history to augment this)
+ // clock_phi = 15e-6;
+ // peer->jitter = LOGTOD(sys_precision); (we have no history to augment this)
+ // and ntp_proto.c:set_sys_tick_precision() should get us sys_precision.
+ //
+ // so our answer seems to be:
+ //
+ // (fabs(t21 + t34) + peer->rootdelay) / 3.
+ // + 0 (peer->disp)
+ // + peer->rootdisp
+ // + 15e-6 (clock_phi)
+ // + LOGTOD(sys_precision)
+
+ INSIST( FPTOD(p_rdly) >= 0. );
+#if 1
+ *synch_distance = (fabs(t21 + t34) + FPTOD(p_rdly)) / 3.
+ + 0.
+ + FPTOD(p_rdsp)
+ + 15e-6
+ + 0. /* LOGTOD(sys_precision) when we can get it */
+ ;
+ INSIST( *synch_distance >= 0. );
+#else
+ *synch_distance = (FPTOD(p_rdly) + FPTOD(p_rdsp))/2.0;
+#endif
+
+#ifdef DEBUG
+ if (debug > 3) {
+ printf("sntp rootdelay: %f\n", FPTOD(p_rdly));
+ printf("sntp rootdisp: %f\n", FPTOD(p_rdsp));
+ printf("sntp syncdist: %f\n", *synch_distance);
+
+ pkt_output(rpkt, rpktl, stdout);
+
+ printf("sntp offset_calculation: rpkt->reftime:\n");
+ l_fp_output(&p_ref, stdout);
+ printf("sntp offset_calculation: rpkt->org:\n");
+ l_fp_output(&p_org, stdout);
+ printf("sntp offset_calculation: rpkt->rec:\n");
+ l_fp_output(&p_rec, stdout);
+ printf("sntp offset_calculation: rpkt->xmt:\n");
+ l_fp_output(&p_xmt, stdout);
+ }
+#endif
+
+ TRACE(3, ("sntp offset_calculation:\trec - org t21: %.6f\n"
+ "\txmt - dst t34: %.6f\tdelta: %.6f\toffset: %.6f\n",
+ t21, t34, delta, *offset));
+
+ return;
+}
+
+
+
+/* Compute the 8 bits for li_vn_mode */
+void
+set_li_vn_mode (
+ struct pkt *spkt,
+ char leap,
+ char version,
+ char mode
+ )
+{
+ if (leap > 3) {
+ msyslog(LOG_DEBUG, "set_li_vn_mode: leap > 3, using max. 3");
+ leap = 3;
+ }
+
+ if (version < 0 || version > 7) {
+ msyslog(LOG_DEBUG, "set_li_vn_mode: version < 0 or > 7, using 4");
+ version = 4;
+ }
+
+ if (mode > 7) {
+ msyslog(LOG_DEBUG, "set_li_vn_mode: mode > 7, using client mode 3");
+ mode = 3;
+ }
+
+ spkt->li_vn_mode = leap << 6;
+ spkt->li_vn_mode |= version << 3;
+ spkt->li_vn_mode |= mode;
+}
+
+
+/*
+** set_time applies 'offset' to the local clock.
+*/
+int
+set_time(
+ double offset
+ )
+{
+ int rc;
+
+ if (time_adjusted)
+ return EX_OK;
+
+ /*
+ ** If we can step but we cannot slew, then step.
+ ** If we can step or slew and and |offset| > steplimit, then step.
+ */
+ if (ENABLED_OPT(STEP) &&
+ ( !ENABLED_OPT(SLEW)
+ || (ENABLED_OPT(SLEW) && (fabs(offset) > steplimit))
+ )) {
+ rc = step_systime(offset);
+
+ /* If there was a problem, can we rely on errno? */
+ if (1 == rc)
+ time_adjusted = TRUE;
+ return (time_adjusted)
+ ? EX_OK
+ : 1;
+ /*
+ ** In case of error, what should we use?
+ ** EX_UNAVAILABLE?
+ ** EX_OSERR?
+ ** EX_NOPERM?
+ */
+ }
+
+ if (ENABLED_OPT(SLEW)) {
+ rc = adj_systime(offset);
+
+ /* If there was a problem, can we rely on errno? */
+ if (1 == rc)
+ time_adjusted = TRUE;
+ return (time_adjusted)
+ ? EX_OK
+ : 1;
+ /*
+ ** In case of error, what should we use?
+ ** EX_UNAVAILABLE?
+ ** EX_OSERR?
+ ** EX_NOPERM?
+ */
+ }
+
+ return EX_SOFTWARE;
+}
+
+
+int
+libevent_version_ok(void)
+{
+ ev_uint32_t v_compile_maj;
+ ev_uint32_t v_run_maj;
+
+ v_compile_maj = LIBEVENT_VERSION_NUMBER & 0xffff0000;
+ v_run_maj = event_get_version_number() & 0xffff0000;
+ if (v_compile_maj != v_run_maj) {
+ fprintf(stderr,
+ "Incompatible libevent versions: have %s, built with %s\n",
+ event_get_version(),
+ LIBEVENT_VERSION);
+ return 0;
+ }
+ return 1;
+}
+
+/*
+ * gettimeofday_cached()
+ *
+ * Clones the event_base_gettimeofday_cached() interface but ensures the
+ * times are always on the gettimeofday() 1970 scale. Older libevent 2
+ * sometimes used gettimeofday(), sometimes the since-system-start
+ * clock_gettime(CLOCK_MONOTONIC), depending on the platform.
+ *
+ * It is not cleanly possible to tell which timescale older libevent is
+ * using.
+ *
+ * The strategy involves 1 hour thresholds chosen to be far longer than
+ * the duration of a round of libevent callbacks, which share a cached
+ * start-of-round time. First compare the last cached time with the
+ * current gettimeofday() time. If they are within one hour, libevent
+ * is using the proper timescale so leave the offset 0. Otherwise,
+ * compare libevent's cached time and the current time on the monotonic
+ * scale. If they are within an hour, libevent is using the monotonic
+ * scale so calculate the offset to add to such times to bring them to
+ * gettimeofday()'s scale.
+ */
+int
+gettimeofday_cached(
+ struct event_base * b,
+ struct timeval * caller_tv
+ )
+{
+#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+ static struct event_base * cached_b;
+ static struct timeval cached;
+ static struct timeval adj_cached;
+ static struct timeval offset;
+ static int offset_ready;
+ struct timeval latest;
+ struct timeval systemt;
+ struct timespec ts;
+ struct timeval mono;
+ struct timeval diff;
+ int cgt_rc;
+ int gtod_rc;
+
+ event_base_gettimeofday_cached(b, &latest);
+ if (b == cached_b &&
+ !memcmp(&latest, &cached, sizeof(latest))) {
+ *caller_tv = adj_cached;
+ return 0;
+ }
+ cached = latest;
+ cached_b = b;
+ if (!offset_ready) {
+ cgt_rc = clock_gettime(CLOCK_MONOTONIC, &ts);
+ gtod_rc = gettimeofday(&systemt, NULL);
+ if (0 != gtod_rc) {
+ msyslog(LOG_ERR,
+ "%s: gettimeofday() error %m",
+ progname);
+ exit(1);
+ }
+ diff = sub_tval(systemt, latest);
+ if (debug > 1)
+ printf("system minus cached %+ld.%06ld\n",
+ (long)diff.tv_sec, diff.tv_usec);
+ if (0 != cgt_rc || labs((long)diff.tv_sec) < 3600) {
+ /*
+ * Either use_monotonic == 0, or this libevent
+ * has been repaired. Leave offset at zero.
+ */
+ } else {
+ mono.tv_sec = ts.tv_sec;
+ mono.tv_usec = ts.tv_nsec / 1000;
+ diff = sub_tval(latest, mono);
+ if (debug > 1)
+ printf("cached minus monotonic %+ld.%06ld\n",
+ (long)diff.tv_sec, diff.tv_usec);
+ if (labs((long)diff.tv_sec) < 3600) {
+ /* older libevent2 using monotonic */
+ offset = sub_tval(systemt, mono);
+ TRACE(1, ("%s: Offsetting libevent CLOCK_MONOTONIC times by %+ld.%06ld\n",
+ "gettimeofday_cached",
+ (long)offset.tv_sec, offset.tv_usec));
+ }
+ }
+ offset_ready = TRUE;
+ }
+ adj_cached = add_tval(cached, offset);
+ *caller_tv = adj_cached;
+
+ return 0;
+#else
+ return event_base_gettimeofday_cached(b, caller_tv);
+#endif
+}
+
diff --git a/sntp/main.h b/sntp/main.h
new file mode 100644
index 0000000..ebe1ee3
--- /dev/null
+++ b/sntp/main.h
@@ -0,0 +1,31 @@
+#ifndef MAIN_H
+#define MAIN_H
+
+#include <stdio.h>
+#include <isc/result.h>
+#include <isc/net.h>
+
+#include <ntp.h>
+#include <ntp_unixtime.h>
+#include <ntp_stdlib.h>
+#include <ntp_intres.h>
+#include <ntp_debug.h>
+#include <timevalops.h>
+
+#include <sntp-opts.h>
+
+#include "crypto.h"
+
+void set_li_vn_mode(struct pkt *spkt, char leap, char version, char mode);
+extern int sntp_main(int argc, char **argv, const char *);
+int generate_pkt(struct pkt *x_pkt, const struct timeval *tv_xmt,
+ int key_id, struct key *pkt_key);
+int handle_pkt(int rpktl, struct pkt *rpkt, sockaddr_u *host,
+ const char *hostname);
+void offset_calculation(struct pkt *rpkt, int rpktl,
+ struct timeval *tv_dst, double *offset,
+ double *precision, double *root_dispersion);
+int on_wire(struct addrinfo *host, struct addrinfo *bcastaddr);
+int set_time(double offset);
+
+#endif /* MAIN_H */
diff --git a/sntp/networking.c b/sntp/networking.c
new file mode 100644
index 0000000..75c2f71
--- /dev/null
+++ b/sntp/networking.c
@@ -0,0 +1,278 @@
+#include <config.h>
+#include "networking.h"
+#include "ntp_debug.h"
+
+
+/* Send a packet */
+int
+sendpkt (
+ SOCKET rsock,
+ sockaddr_u *dest,
+ struct pkt *pkt,
+ int len
+ )
+{
+ int cc;
+
+#ifdef DEBUG
+ if (debug > 2) {
+ printf("sntp sendpkt: Packet data:\n");
+ pkt_output(pkt, len, stdout);
+ }
+#endif
+ TRACE(1, ("sntp sendpkt: Sending packet to %s ...\n",
+ sptoa(dest)));
+
+ cc = sendto(rsock, (void *)pkt, len, 0, &dest->sa,
+ SOCKLEN(dest));
+ if (cc == SOCKET_ERROR) {
+ msyslog(LOG_ERR, "Send to %s failed, %m",
+ sptoa(dest));
+ return FALSE;
+ }
+ TRACE(1, ("Packet sent.\n"));
+
+ return TRUE;
+}
+
+
+/* Receive raw data */
+int
+recvdata(
+ SOCKET rsock,
+ sockaddr_u * sender,
+ void * rdata,
+ int rdata_length
+ )
+{
+ GETSOCKNAME_SOCKLEN_TYPE slen;
+ int recvc;
+
+ slen = sizeof(*sender);
+ recvc = recvfrom(rsock, rdata, rdata_length, 0,
+ &sender->sa, &slen);
+ if (recvc < 0)
+ return recvc;
+#ifdef DEBUG
+ if (debug > 2) {
+ printf("Received %d bytes from %s:\n", recvc, sptoa(sender));
+ pkt_output((struct pkt *)rdata, recvc, stdout);
+ }
+#endif
+ return recvc;
+}
+
+/* Parsing from a short 'struct pkt' directly is bound to create
+ * coverity warnings. These are hard to avoid, as the formal declaration
+ * does not reflect the true layout in the presence of autokey extension
+ * fields. Parsing and skipping the extension fields of a received packet
+ * until there's only the MAC left is better done in this separate
+ * function.
+ */
+static void*
+skip_efields(
+ u_int32 *head, /* head of extension chain */
+ u_int32 *tail /* tail/end of extension chain */
+ )
+{
+
+ u_int nlen; /* next extension length */
+ while ((tail - head) > 6) {
+ nlen = ntohl(*head++) & 0xffff;
+ nlen = (nlen + 3) >> 2;
+ if (nlen > (tail - head) || nlen < 4)
+ return NULL; /* Blooper! Inconsistent! */
+ head += nlen;
+ }
+ return head;
+}
+
+/*
+** Check if it's data for us and whether it's useable or not.
+**
+** If not, return a failure code so we can delete this server from our list
+** and continue with another one.
+*/
+int
+process_pkt (
+ struct pkt *rpkt,
+ sockaddr_u *sender,
+ int pkt_len,
+ int mode,
+ struct pkt *spkt,
+ const char * func_name
+ )
+{
+ u_int key_id;
+ struct key * pkt_key;
+ int is_authentic;
+ int mac_size;
+ u_int exten_len;
+ u_int32 * exten_end;
+ u_int32 * packet_end;
+ l_fp sent_xmt;
+ l_fp resp_org;
+
+ key_id = 0;
+ pkt_key = NULL;
+ is_authentic = (HAVE_OPT(AUTHENTICATION)) ? 0 : -1;
+
+ /*
+ * Parse the extension field if present. We figure out whether
+ * an extension field is present by measuring the MAC size. If
+ * the number of words following the packet header is 0, no MAC
+ * is present and the packet is not authenticated. If 1, the
+ * packet is a crypto-NAK; if 3, the packet is authenticated
+ * with DES; if 5, the packet is authenticated with MD5; if 6,
+ * the packet is authenticated with SHA. If 2 or 4, the packet
+ * is a runt and discarded forthwith. If greater than 6, an
+ * extension field is present, so we subtract the length of the
+ * field and go around again.
+ */
+ if (pkt_len < LEN_PKT_NOMAC || (pkt_len & 3) != 0) {
+unusable:
+ msyslog(LOG_ERR,
+ "%s: Incredible packet length: %d. Discarding.",
+ func_name, pkt_len);
+ return PACKET_UNUSEABLE;
+ }
+ /* Note: pkt_len must be a multiple of 4 at this point! */
+ packet_end = (u_int32*)((char*)rpkt + pkt_len);
+ exten_end = skip_efields(rpkt->exten, packet_end);
+ if (NULL == exten_end)
+ goto unusable;
+ /* get size of MAC in cells; can be zero */
+ exten_len = (u_int)(packet_end - exten_end);
+
+ /* deduce action required from remaining length */
+ switch (exten_len) {
+
+ case 0: /* no MAC at all */
+ break;
+
+ case 1: /* crypto NAK */
+ key_id = ntohl(*exten_end);
+ printf("Crypto NAK = 0x%08x\n", key_id);
+ break;
+
+ case 3: /* key ID + 3DES MAC -- unsupported! */
+ goto unusable;
+
+ case 5: /* key ID + MD5 MAC */
+ case 6: /* key ID + SHA MAC */
+ /*
+ ** Look for the key used by the server in the specified
+ ** keyfile and if existent, fetch it or else leave the
+ ** pointer untouched
+ */
+ key_id = ntohl(*exten_end);
+ get_key(key_id, &pkt_key);
+ if (!pkt_key) {
+ printf("unrecognized key ID = 0x%08x\n", key_id);
+ break;
+ }
+ /*
+ ** Seems like we've got a key with matching keyid.
+ **
+ ** Generate a md5sum of the packet with the key from our
+ ** keyfile and compare those md5sums.
+ */
+ mac_size = exten_len << 2;
+ if (!auth_md5((char *)rpkt, pkt_len - mac_size,
+ mac_size - 4, pkt_key)) {
+ is_authentic = FALSE;
+ break;
+ }
+ /* Yay! Things worked out! */
+ is_authentic = TRUE;
+ TRACE(1, ("sntp %s: packet from %s authenticated using key id %d.\n",
+ func_name, stoa(sender), key_id));
+ break;
+
+ default:
+ goto unusable;
+ }
+
+ switch (is_authentic) {
+
+ case -1: /* unknown */
+ break;
+
+ case 0: /* not authentic */
+ return SERVER_AUTH_FAIL;
+ break;
+
+ case 1: /* authentic */
+ break;
+
+ default: /* error */
+ break;
+ }
+
+ /* Check for server's ntp version */
+ if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION ||
+ PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) {
+ msyslog(LOG_ERR,
+ "%s: Packet shows wrong version (%d)",
+ func_name, PKT_VERSION(rpkt->li_vn_mode));
+ return SERVER_UNUSEABLE;
+ }
+ /* We want a server to sync with */
+ if (PKT_MODE(rpkt->li_vn_mode) != mode &&
+ PKT_MODE(rpkt->li_vn_mode) != MODE_PASSIVE) {
+ msyslog(LOG_ERR,
+ "%s: mode %d stratum %d", func_name,
+ PKT_MODE(rpkt->li_vn_mode), rpkt->stratum);
+ return SERVER_UNUSEABLE;
+ }
+ /* Stratum is unspecified (0) check what's going on */
+ if (STRATUM_PKT_UNSPEC == rpkt->stratum) {
+ char *ref_char;
+
+ TRACE(1, ("%s: Stratum unspecified, going to check for KOD (stratum: %d)\n",
+ func_name, rpkt->stratum));
+ ref_char = (char *) &rpkt->refid;
+ TRACE(1, ("%s: Packet refid: %c%c%c%c\n", func_name,
+ ref_char[0], ref_char[1], ref_char[2], ref_char[3]));
+ /* If it's a KOD packet we'll just use the KOD information */
+ if (ref_char[0] != 'X') {
+ if (strncmp(ref_char, "DENY", 4) == 0)
+ return KOD_DEMOBILIZE;
+ if (strncmp(ref_char, "RSTR", 4) == 0)
+ return KOD_DEMOBILIZE;
+ if (strncmp(ref_char, "RATE", 4) == 0)
+ return KOD_RATE;
+ /*
+ ** There are other interesting kiss codes which
+ ** might be interesting for authentication.
+ */
+ }
+ }
+ /* If the server is not synced it's not really useable for us */
+ if (LEAP_NOTINSYNC == PKT_LEAP(rpkt->li_vn_mode)) {
+ msyslog(LOG_ERR,
+ "%s: %s not in sync, skipping this server",
+ func_name, stoa(sender));
+ return SERVER_UNUSEABLE;
+ }
+
+ /*
+ * Decode the org timestamp and make sure we're getting a response
+ * to our last request, but only if we're not in broadcast mode.
+ */
+ if (MODE_BROADCAST == mode)
+ return pkt_len;
+
+ if (!L_ISEQU(&rpkt->org, &spkt->xmt)) {
+ NTOHL_FP(&rpkt->org, &resp_org);
+ NTOHL_FP(&spkt->xmt, &sent_xmt);
+ msyslog(LOG_ERR,
+ "%s response org expected to match sent xmt",
+ stoa(sender));
+ msyslog(LOG_ERR, "resp org: %s", prettydate(&resp_org));
+ msyslog(LOG_ERR, "sent xmt: %s", prettydate(&sent_xmt));
+ return PACKET_UNUSEABLE;
+ }
+
+ return pkt_len;
+}
diff --git a/sntp/networking.h b/sntp/networking.h
new file mode 100644
index 0000000..3e63891
--- /dev/null
+++ b/sntp/networking.h
@@ -0,0 +1,110 @@
+#ifndef NETWORKING_H
+#define NETWORKING_H
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+#include <strings.h>
+#include <errno.h>
+#include <config.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <ntp_rfc2553.h>
+#include <ntp_stdlib.h>
+#include <ntp_machine.h>
+#include <ntp_unixtime.h>
+#include <ntp_fp.h>
+#include <ntp.h>
+
+#include "crypto.h"
+#include "log.h"
+#include "sntp-opts.h"
+#include "utilities.h"
+
+/* FIXME To be replaced by the constants in ntp.h */
+#define SERVER_UNUSEABLE -1 /* Skip server */
+#define PACKET_UNUSEABLE -2 /* Discard packet and try to get a useable packet again if not tried too often */
+#define SERVER_AUTH_FAIL -3 /* Authentication failed, act upon settings */
+#define KOD_DEMOBILIZE -4 /* KOD packet with code DENY or RSTR, stop all communication and save KOD information */
+#define KOD_RATE -5 /* KOD packet with code RATE, reduce poll intervall */
+#define BROADCAST_FAILED -6
+
+/* prototypes */
+int sendpkt(SOCKET rsock, sockaddr_u *dest, struct pkt *pkt, int len);
+int recvdata(SOCKET rsock, sockaddr_u *sender, void *rdata,
+ int rdata_len);
+int recvpkt(SOCKET rsock, struct pkt *rpkt, unsigned int rsize,
+ struct pkt *spkt);
+int process_pkt(struct pkt *rpkt, sockaddr_u *sas, int pkt_len,
+ int mode, struct pkt *spkt, const char *func_name);
+
+/* Shortened peer structure. Not absolutely necessary yet */
+struct speer {
+ struct speer *next;
+ sockaddr_u srcadr;
+ u_char version;
+ u_char hmode;
+ u_char hpoll;
+ u_char minpoll;
+ u_char maxpoll;
+ u_int flags;
+ u_char num_events;
+ u_char ttl;
+ u_char leap;
+ u_char pmode;
+ u_char stratum;
+ u_char ppoll;
+ u_char precision; /* should be s_char */
+ u_int32 refid;
+ l_fp reftime;
+ keyid_t keyid;
+
+#ifdef AUTOKEY
+#define clear_to_zero opcode
+ u_int32 opcode; /* last request opcode */
+ associd_t assoc; /* peer association ID */
+ u_int32 crypto; /* peer status word */
+ EVP_PKEY *pkey; /* public key */
+ const EVP_MD *digest; /* message digest algorithm */
+ char *subject; /* certificate subject name */
+ char *issuer; /* certificate issuer name */
+ struct cert_info *xinfo; /* issuer certificate */
+ keyid_t pkeyid; /* previous key ID */
+ keyid_t hcookie; /* host cookie */
+ keyid_t pcookie; /* peer cookie */
+ const struct pkey_info *ident_pkey; /* identity key */
+ BIGNUM *iffval; /* identity challenge (IFF, GQ, MV) */
+ const BIGNUM *grpkey; /* identity challenge key (GQ) */
+ struct value cookval; /* receive cookie values */
+ struct value recval; /* receive autokey values */
+ struct exten *cmmd; /* extension pointer */
+ u_long refresh; /* next refresh epoch */
+
+ /*
+ * Variables used by authenticated server
+ */
+ keyid_t *keylist; /* session key ID list */
+ int keynumber; /* current key number */
+ struct value encrypt; /* send encrypt values */
+ struct value sndval; /* send autokey values */
+#else /* !AUTOKEY follows */
+#define clear_to_zero status
+#endif /* !AUTOKEY */
+
+ l_fp rec; /* receive time stamp */
+ l_fp xmt; /* transmit time stamp */
+ l_fp dst; /* destination timestamp */
+ l_fp aorg; /* origin timestamp */
+ l_fp borg; /* alternate origin timestamp */
+ double offset; /* peer clock offset */
+ double delay; /* peer roundtrip delay */
+};
+
+
+
+
+
+#endif
diff --git a/sntp/scm-rev b/sntp/scm-rev
new file mode 100644
index 0000000..794bc25
--- /dev/null
+++ b/sntp/scm-rev
@@ -0,0 +1 @@
+1.2483
diff --git a/sntp/scripts/Makefile.am b/sntp/scripts/Makefile.am
new file mode 100644
index 0000000..5240610
--- /dev/null
+++ b/sntp/scripts/Makefile.am
@@ -0,0 +1,7 @@
+NULL=
+
+EXTRA_DIST = \
+ cvo.sh \
+ genLocInfo \
+ mansec2subst.sed \
+ $(NULL)
diff --git a/sntp/scripts/Makefile.in b/sntp/scripts/Makefile.in
new file mode 100644
index 0000000..6dccb2d
--- /dev/null
+++ b/sntp/scripts/Makefile.in
@@ -0,0 +1,498 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
+ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/libevent/m4/openldap.m4 \
+ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/m4/ntp_compiler.m4 \
+ $(top_srcdir)/m4/ntp_crosscompile.m4 \
+ $(top_srcdir)/m4/ntp_debug.m4 $(top_srcdir)/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/m4/ntp_googletest.m4 \
+ $(top_srcdir)/m4/ntp_ipv6.m4 $(top_srcdir)/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/m4/ntp_libevent.m4 \
+ $(top_srcdir)/m4/ntp_libntp.m4 \
+ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/m4/ntp_openssl.m4 \
+ $(top_srcdir)/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
+ $(top_srcdir)/m4/ntp_sysexits.m4 \
+ $(top_srcdir)/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
+ $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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@
+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_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@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIB_SYSLOG = @LIB_SYSLOG@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+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_FORCE_LIBEVENT_DIST = @NTP_FORCE_LIBEVENT_DIST@
+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_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_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+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@
+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@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+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 =
+EXTRA_DIST = \
+ cvo.sh \
+ genLocInfo \
+ mansec2subst.sed \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign scripts/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/sntp/scripts/cvo.sh b/sntp/scripts/cvo.sh
new file mode 100755
index 0000000..a8d00ef
--- /dev/null
+++ b/sntp/scripts/cvo.sh
@@ -0,0 +1,150 @@
+#! /bin/sh
+
+# Copyright 2002, 2009, 2010 Harlan Stenn. Used by NTP with permission.
+# Author: Harlan Stenn <harlan+cvo@pfcs.com>
+
+# Possible output formats:
+#
+# CVO=... Shell variable
+# CVO=... ; export CVO Old-style exported envariable
+# export CVO=... New-style exported envariable
+# setenv CVO ... csh-style exported envariable
+
+TS="$*"
+
+CVO_raw=`config.guess`
+CVO=$CVO_raw
+
+set 1 `echo $CVO | tr '-' ' '`
+shift
+
+case "$#" in
+ 4) # eg: i686-pc-linux-gnu
+ CVO_CPU=$1
+ CVO_VENDOR=$2
+ cvo_KERN=$3 # Note the capitalization...
+ CVO_OS=$4
+ case "$cvo_KERN" in
+ linux) # Braindamage. We want OS, not kernel info
+ if lsb_release > /dev/null 2>&1
+ then
+ CVO_OS=`lsb_release --id --short | tr '[:upper:]' '[:lower:]'`
+ CVO_OS="$CVO_OS`lsb_release --release --short`"
+ elif test -f /etc/debian_version
+ then
+ set `cat /etc/debian_version`
+ CVO_OS=debian$1
+ CVO_KOSVER=`uname -r`
+ elif test -f /etc/mandrake-release
+ then
+ set `cat /etc/mandrake-release`
+ CVO_OS=mandrake$4
+ CVO_KOSVER=`uname -r`
+ elif test -f /etc/redhat-release
+ then
+ set `cat /etc/redhat-release`
+ case "$1" in
+ CentOS)
+ CVO_OS=centos$3
+ ;;
+ Fedora)
+ CVO_OS=fedora$3
+ ;;
+ *)
+ case "$3" in
+ Enterprise)
+ CVO_OS=redhat$7.E
+ ;;
+ Linux)
+ CVO_OS=redhat$5
+ ;;
+ esac
+ ;;
+ esac
+ CVO_KOSVER=`uname -r`
+ elif test -f /etc/slackware-version
+ then
+ set `cat /etc/slackware-version`
+ CVO_OS=slackware$2
+ CVO_KOSVER=`uname -r`
+ elif test -f /etc/SuSE-release
+ then
+ set `cat /etc/SuSE-release`
+ CVO_OS=suse$9
+ CVO_KOSVER=`uname -r`
+ else
+ CVO_OS=$cvo_KERN`uname -r`
+
+ fi
+ ;;
+ nto) # QNX
+ CVO_KOSVER=`uname -r`
+ ;;
+ *)
+ echo "gronk - I don't understand <$CVO>!"
+ exit 1
+ ;;
+ esac
+ ;;
+ 3) CVO_CPU=$1
+ CVO_VENDOR=$2
+ CVO_OS=$3
+ ;;
+ *) echo "gronk - config.guess returned $# pieces, not 3 pieces!"
+ exit 1
+ ;;
+esac
+
+case "$CVO_OS" in
+ cygwin)
+ # Decisions, decisions.
+ # uname -r is the cygwin version #, eg: 1.3.3(0.46/3/2)
+ # uname -s returns something like CYGWIN_NT-5.0
+ CVO_OS="$CVO_OS`uname -r | sed 's/(.*//'`"
+ ;;
+esac
+set `echo $CVO_OS | sed 's/\([0-9]\)/ \1/'`
+
+case "$#" in
+ 2) ;;
+ *) echo "gronk - <$CVO_OS> expanded to $#, not 2 pieces!"
+ exit 1
+ ;;
+esac
+
+CVO_OSNAME=$1
+CVO_OSVER=$2
+
+case "$CVO_OSNAME" in
+ solaris)
+ CVO_KOSVER=`uname -v`
+ ;;
+esac
+
+CVO=$CVO_CPU-$CVO_VENDOR-$CVO_OS
+
+case "$TS" in
+ '')
+ set | grep CVO
+ ;;
+ *)
+ # keys['cvo'] = "cvo.CVO['CVO']"
+ TS=`echo $TS | sed -e s/@cvo@/$CVO/g`
+ # keys['cpu'] = "cvo.CVO['CVO_CPU']"
+ TS=`echo $TS | sed -e s/@cpu@/$CVO_CPU/g`
+ # keys['kosver'] = "cvo.CVO['CVO_KOSVER']"
+ TS=`echo $TS | sed -e s/@kosver@/$CVO_KOSVER/g`
+ # keys['os'] = "cvo.CVO['CVO_OS']"
+ TS=`echo $TS | sed -e s/@os@/$CVO_OS/g`
+ # keys['osname'] = "cvo.CVO['CVO_OSNAME']"
+ TS=`echo $TS | sed -e s/@osname@/$CVO_OSNAME/g`
+ # keys['osver'] = "cvo.CVO['CVO_OSVER']"
+ TS=`echo $TS | sed -e s/@osver@/$CVO_OSVER/g`
+ # keys['vendor'] = "cvo.CVO['CVO_VENDOR']"
+ TS=`echo $TS | sed -e s/@vendor@/$CVO_VENDOR/g`
+ # keys['raw'] = "cvo.CVO['CVO_raw']"
+ TS=`echo $TS | sed -e s/@raw@/$CVO_raw/g`
+
+ echo $TS
+ ;;
+esac
diff --git a/sntp/scripts/genLocInfo b/sntp/scripts/genLocInfo
new file mode 100755
index 0000000..d761c4c
--- /dev/null
+++ b/sntp/scripts/genLocInfo
@@ -0,0 +1,256 @@
+#! /bin/sh
+
+args=`getopt d:f:v $*`
+set -- $args
+
+LF=
+V=": "
+
+for i
+do
+ case "$i" in
+ -d) sdir="$2" ; shift 2 ;;
+ -f) locfile="$2" ; shift 2 ;;
+ -v) V= ; shift ;;
+ --) shift ; break ;;
+ esac
+done
+
+case "$sdir" in
+ '')
+ sdir=.
+esac
+
+case "$locfile" in
+ */*)
+ LF=$locfile
+ ;;
+ '')
+ ;;
+ *)
+ lf=loc/$locfile
+ if test -f $lf
+ then
+ LF=$lf
+ fi
+ ;;
+esac
+
+# If we have a file to use (ie, LF is not empty) then look for one.
+case "$LF" in
+ '')
+ PATH=$PATH:libevent/build-aux
+ export PATH
+ set `scripts/cvo.sh @osname@ @osver@` || exit 1
+
+ CVO_OSNAME=$1
+ CVO_OSVER=$2
+
+ x=$CVO_OSVER
+
+ while true
+ do
+ case "$x" in
+ '') break ;;
+ esac
+lf=loc/$CVO_OSNAME$x
+${V}echo "Looking for <$lf>" >&2
+ if test -f $lf
+ then
+ LF=$lf
+ break
+ fi
+ case "$x" in
+ *.*) x=`echo $x | sed -e 's/\.[^.]*$//'` ;;
+ *) x= ;;
+ esac
+ done
+ case "$LF" in
+ '')
+ lf=loc/$CVO_OSNAME
+${V}echo "Looking for <$lf>" >&2
+ if test -f $lf
+ then
+ LF=$lf
+ fi
+ ;;
+ esac
+ # Handle some "aliases"
+ case "$LF" in
+ '')
+ case "$CVO_OSNAME" in
+ redhat* | fedora*)
+ lf=loc/redhat
+${V}echo "Looking for <$lf>" >&2
+ if test -f $lf
+ then
+ LF=$lf
+ fi
+ ;;
+ esac
+ ;;
+ esac
+
+ # This might be a good place to see if uname returns "Linux",
+ # and if so, use a generic file for that.
+ case "$LF" in
+ '')
+ case "`uname`" in
+ Linux)
+ lf=loc/linux
+${V}echo "Looking for <$lf>" >&2
+ if test -f $lf
+ then
+ LF=$lf
+ fi
+ ;;
+ esac
+ ;;
+ esac
+
+ # Finally, 'legacy'
+ case "$LF" in
+ '')
+ lf=loc/legacy
+${V}echo "Looking for <$lf>" >&2
+ if test -f $lf
+ then
+ LF=$lf
+ fi
+ ;;
+ esac
+
+ case "$LF" in
+ '')
+ echo "No loc/XXX file found!" >&2
+ exit 1
+ ;;
+ esac
+ ;;
+esac
+
+${V}echo "Using <$LF>" >&2
+echo "GENLOCINFOFILE=$LF"
+
+###
+
+rm -f $sdir/genLocInfo.rc?
+
+oIFS=$IFS
+IFS=","
+
+while true
+do
+ if read c d s x
+ then
+ # echo "Got <$c><$d><$s><$x>" >&2
+ case "$c" in
+ \#*) continue ;;
+ esac
+ case "$x" in
+ '') ;;
+ *) echo "Unrecognized input: <$c,$d,$s,$x>" >&2
+ touch $sdir/genLocInfo.rc1
+ continue
+ ;;
+ esac
+ case "$c,$d,$s" in
+ [Mm][Aa][Nn],,)
+ echo "MANTAGFMT=man"
+ continue
+ ;;
+ [Mm][Dd][Oo][Cc],,)
+ echo "MANTAGFMT=mdoc"
+ continue
+ ;;
+ esac
+
+ case "$c,$d,$s" in
+ *,bin,*) DB=bin ; DL= ; DS= ; NI= ;;
+ *,libexec,*) DB= ; DL=libexec ; DS= ; NI= ;;
+ *,noinst,*) DB= ; DL= ; DS= ; NI=noinst ;;
+ *,sbin,*) DB= ; DL= ; DS=sbin ; NI= ;;
+ *) echo "Unrecognized input: <$c,$d,$s>" >&2
+ touch $sdir/genLocInfo.rc1
+ continue
+ ;;
+ esac
+ case "$c,$d,$s" in
+ *,*,1) ;;
+ *,*,1m) ;;
+ *,*,1M) ;;
+ *,*,8) ;;
+ *) echo "Unrecognized input: <$c,$d,$s>" >&2
+ touch $sdir/genLocInfo.rc1
+ continue
+ ;;
+ esac
+
+ # Should be OK, mostly...
+ C=`echo $c | sed -e 'y/abcdefghijklmnopqrstuvwxyz-/ABCDEFGHIJKLMNOPQRSTUVWXYZ_/'`
+ # echo "c: <$c>, C: <$C>, DB: <$DB>, DL: <$DL>, DS: <$DS>" >&2
+
+ case "$d" in
+ bin)
+ eval ${C}_DB=$c
+ eval ${C}_DL=
+ eval ${C}_DS=
+ eval ${C}_NI=
+ ;;
+ libexec)
+ eval ${C}_DB=
+ eval ${C}_DL=$c
+ eval ${C}_DS=
+ eval ${C}_NI=
+ ;;
+ noinst)
+ eval ${C}_DB=
+ eval ${C}_DL=
+ eval ${C}_DS=
+ eval ${C}_NI=$c
+ ;;
+ sbin)
+ eval ${C}_DB=
+ eval ${C}_DL=
+ eval ${C}_DS=$c
+ eval ${C}_NI=
+ ;;
+ *) echo "$0: installdir <$d> must be bin, sbin, libexec, or noinst" >&2
+ exit 1
+ ;;
+ esac
+ eval ${C}_MS=$s
+
+ # echo "<$c> gets installed in <$d> with a <$s> manpage suffix" >&2
+ # echo "${C}_DB is <`eval echo '$'${C}_DB`>" >&2
+ # echo "${C}_DL is <`eval echo '$'${C}_DL`>" >&2
+ # echo "${C}_DS is <`eval echo '$'${C}_DS`>" >&2
+ # echo "${C}_NI is <`eval echo '$'${C}_NI`>" >&2
+ # echo "${C}_MS is <`eval echo '$'${C}_MS`>" >&2
+ echo "${C}_DB=`eval echo '$'${C}_DB`"
+ echo "${C}_DL=`eval echo '$'${C}_DL`"
+ echo "${C}_DS=`eval echo '$'${C}_DS`"
+ echo "${C}_NI=`eval echo '$'${C}_NI`"
+ echo "${C}_MS=`eval echo '$'${C}_MS`"
+
+ touch $sdir/genLocInfo.rc0
+ else
+ break
+ fi
+done < $LF
+IFS=$oIFS
+
+if test -f $sdir/genLocInfo.rc1
+then
+ rm $sdir/genLocInfo.rc?
+ exit 1
+fi
+
+if test -f $sdir/genLocInfo.rc0
+then
+ rm $sdir/genLocInfo.rc?
+ echo 'GENLOCINFO=OK'
+ exit 0
+fi
+
+exit 1
diff --git a/sntp/scripts/mansec2subst.sed b/sntp/scripts/mansec2subst.sed
new file mode 100644
index 0000000..5e8c3e1
--- /dev/null
+++ b/sntp/scripts/mansec2subst.sed
@@ -0,0 +1,28 @@
+s/1ntp-keygenman/@NTP_KEYGEN_MS@/g
+s/1ntp-keygenmdoc/@NTP_KEYGEN_MS@/g
+s/1ntp-waitman/@NTP_WAIT_MS@/g
+s/1ntp-waitmdoc/@NTP_WAIT_MS@/g
+s/1ntpdateman/@NTPDATE_MS@/g
+s/1ntpdatemdoc/@NTPDATE_MS@/g
+s/1ntpdcman/@NTPDC_MS@/g
+s/1ntpdcmdoc/@NTPDC_MS@/g
+s/1ntpdman/@NTPD_MS@/g
+s/1ntpdmdoc/@NTPD_MS@/g
+s/1ntpdsimman/@NTPDSIM_MS@/g
+s/1ntpdsimmdoc/@NTPDSIM_MS@/g
+s/1ntpqman/@NTPQ_MS@/g
+s/1ntpqmdoc/@NTPQ_MS@/g
+s/1ntpsnmpdman/@NTPSNMPD_MS@/g
+s/1ntpsnmpdmdoc/@NTPSNMPD_MS@/g
+s/1ntptimeman/@NTPTIME_MS@/g
+s/1ntptimemdoc/@NTPTIME_MS@/g
+s/1ntptraceman/@NTPTRACE_MS@/g
+s/1ntptracemdoc/@NTPTRACE_MS@/g
+s/1sntpman/@SNTP_MS@/g
+s/1sntpmdoc/@SNTP_MS@/g
+s/1tickadjman/@TICKADJ_MS@/g
+s/1tickadjmdoc/@TICKADJ_MS@/g
+s/1timetrimman/@TIMETRIM_MS@/g
+s/1timetrimmdoc/@TIMETRIM_MS@/g
+s/5man/5/g
+s/5mdoc/5/g
diff --git a/sntp/sntp-opts.c b/sntp/sntp-opts.c
new file mode 100644
index 0000000..11859b6
--- /dev/null
+++ b/sntp/sntp-opts.c
@@ -0,0 +1,1572 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (sntp-opts.c)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:49:12 AM by AutoGen 5.18.5pre4
+ * From the definitions sntp-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the sntp author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The sntp program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+
+#ifndef __doxygen__
+#define OPTION_CODE_COMPILE 1
+#include "sntp-opts.h"
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern FILE * option_usage_fp;
+#define zCopyright (sntp_opt_strs+0)
+#define zLicenseDescrip (sntp_opt_strs+314)
+
+/*
+ * global included definitions
+ */
+#ifdef __windows
+ extern int atoi(const char*);
+#else
+# include <stdlib.h>
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/**
+ * static const strings for sntp options
+ */
+static char const sntp_opt_strs[2499] =
+/* 0 */ "sntp 4.2.7p482\n"
+ "Copyright (C) 1970-2014 The University of Delaware, 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"
+ "can be seen at:\n"
+ " <http://ntp.org/license>\n"
+ " <http://opensource.org/licenses/ntp-license.php>\n\0"
+/* 314 */ "Permission to use, copy, modify, and distribute this software and its\n"
+ "documentation for any purpose with or without fee is hereby granted,\n"
+ "provided that the above copyright notice appears in all copies and that\n"
+ "both the copyright notice and this permission notice appear in supporting\n"
+ "documentation, and that the name The University of Delaware not be used in\n"
+ "advertising or publicity pertaining to distribution of the software without\n"
+ "specific, written prior permission. The University of Delaware makes no\n"
+ "representations about the suitability this software for any purpose. It is\n"
+ "provided \"as is\" without express or implied warranty.\n\0"
+/* 954 */ "Force IPv4 DNS name resolution\0"
+/* 985 */ "IPV4\0"
+/* 990 */ "ipv4\0"
+/* 995 */ "Force IPv6 DNS name resolution\0"
+/* 1026 */ "IPV6\0"
+/* 1031 */ "ipv6\0"
+/* 1036 */ "Enable authentication with the key auth-keynumber\0"
+/* 1086 */ "AUTHENTICATION\0"
+/* 1101 */ "authentication\0"
+/* 1116 */ "Listen to the address specified for broadcast time sync\0"
+/* 1172 */ "BROADCAST\0"
+/* 1182 */ "broadcast\0"
+/* 1192 */ "Concurrently query all IPs returned for host-name\0"
+/* 1242 */ "CONCURRENT\0"
+/* 1253 */ "concurrent\0"
+/* 1264 */ "Increase debug verbosity level\0"
+/* 1295 */ "DEBUG_LEVEL\0"
+/* 1307 */ "debug-level\0"
+/* 1319 */ "Set the debug verbosity level\0"
+/* 1349 */ "SET_DEBUG_LEVEL\0"
+/* 1365 */ "set-debug-level\0"
+/* 1381 */ "The gap (in milliseconds) between time requests\0"
+/* 1429 */ "GAP\0"
+/* 1433 */ "gap\0"
+/* 1437 */ "KoD history filename\0"
+/* 1458 */ "KOD\0"
+/* 1462 */ "kod\0"
+/* 1466 */ "/var/db/ntp-kod\0"
+/* 1482 */ "Look in this file for the key specified with -a\0"
+/* 1530 */ "KEYFILE\0"
+/* 1538 */ "keyfile\0"
+/* 1546 */ "Log to specified logfile\0"
+/* 1571 */ "LOGFILE\0"
+/* 1579 */ "logfile\0"
+/* 1587 */ "Adjustments less than steplimit msec will be slewed\0"
+/* 1639 */ "STEPLIMIT\0"
+/* 1649 */ "steplimit\0"
+/* 1659 */ "Send int as our NTP protocol version\0"
+/* 1696 */ "NTPVERSION\0"
+/* 1707 */ "ntpversion\0"
+/* 1718 */ "Use the NTP Reserved Port (port 123)\0"
+/* 1755 */ "USERESERVEDPORT\0"
+/* 1771 */ "usereservedport\0"
+/* 1787 */ "OK to 'step' the time with settimeofday(2)\0"
+/* 1830 */ "STEP\0"
+/* 1835 */ "step\0"
+/* 1840 */ "OK to 'slew' the time with adjtime(2)\0"
+/* 1878 */ "SLEW\0"
+/* 1883 */ "slew\0"
+/* 1888 */ "The number of seconds to wait for responses\0"
+/* 1932 */ "TIMEOUT\0"
+/* 1940 */ "timeout\0"
+/* 1948 */ "Wait for pending replies (if not setting the time)\0"
+/* 1999 */ "WAIT\0"
+/* 2004 */ "no-wait\0"
+/* 2012 */ "no\0"
+/* 2015 */ "display extended usage information and exit\0"
+/* 2059 */ "help\0"
+/* 2064 */ "extended usage information passed thru pager\0"
+/* 2109 */ "more-help\0"
+/* 2119 */ "output version information and exit\0"
+/* 2155 */ "version\0"
+/* 2163 */ "save the option state to a config file\0"
+/* 2202 */ "save-opts\0"
+/* 2212 */ "load options from a config file\0"
+/* 2244 */ "LOAD_OPTS\0"
+/* 2254 */ "no-load-opts\0"
+/* 2267 */ "SNTP\0"
+/* 2272 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p482\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
+ "\t\t[ hostname-or-IP ...]\n\0"
+/* 2433 */ "$HOME\0"
+/* 2439 */ ".\0"
+/* 2441 */ ".ntprc\0"
+/* 2448 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 2482 */ "\n\0"
+/* 2484 */ "sntp 4.2.7p482";
+
+/**
+ * ipv4 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv4 option */
+#define IPV4_DESC (sntp_opt_strs+954)
+/** Upper-cased name for the ipv4 option */
+#define IPV4_NAME (sntp_opt_strs+985)
+/** Name string for the ipv4 option */
+#define IPV4_name (sntp_opt_strs+990)
+/** Other options that appear in conjunction with the ipv4 option */
+static int const aIpv4CantList[] = {
+ INDEX_OPT_IPV6, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv4 option */
+#define IPV4_FLAGS (OPTST_DISABLED)
+
+/**
+ * ipv6 option description with
+ * "Must also have options" and "Incompatible options":
+ */
+/** Descriptive text for the ipv6 option */
+#define IPV6_DESC (sntp_opt_strs+995)
+/** Upper-cased name for the ipv6 option */
+#define IPV6_NAME (sntp_opt_strs+1026)
+/** Name string for the ipv6 option */
+#define IPV6_name (sntp_opt_strs+1031)
+/** Other options that appear in conjunction with the ipv6 option */
+static int const aIpv6CantList[] = {
+ INDEX_OPT_IPV4, NO_EQUIVALENT };
+/** Compiled in flag settings for the ipv6 option */
+#define IPV6_FLAGS (OPTST_DISABLED)
+
+/**
+ * authentication option description:
+ */
+/** Descriptive text for the authentication option */
+#define AUTHENTICATION_DESC (sntp_opt_strs+1036)
+/** Upper-cased name for the authentication option */
+#define AUTHENTICATION_NAME (sntp_opt_strs+1086)
+/** Name string for the authentication option */
+#define AUTHENTICATION_name (sntp_opt_strs+1101)
+/** Compiled in flag settings for the authentication option */
+#define AUTHENTICATION_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * broadcast option description:
+ */
+/** Descriptive text for the broadcast option */
+#define BROADCAST_DESC (sntp_opt_strs+1116)
+/** Upper-cased name for the broadcast option */
+#define BROADCAST_NAME (sntp_opt_strs+1172)
+/** Name string for the broadcast option */
+#define BROADCAST_name (sntp_opt_strs+1182)
+/** Compiled in flag settings for the broadcast option */
+#define BROADCAST_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * concurrent option description:
+ */
+/** Descriptive text for the concurrent option */
+#define CONCURRENT_DESC (sntp_opt_strs+1192)
+/** Upper-cased name for the concurrent option */
+#define CONCURRENT_NAME (sntp_opt_strs+1242)
+/** Name string for the concurrent option */
+#define CONCURRENT_name (sntp_opt_strs+1253)
+/** Compiled in flag settings for the concurrent option */
+#define CONCURRENT_FLAGS (OPTST_DISABLED | OPTST_STACKED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+/**
+ * debug-level option description:
+ */
+/** Descriptive text for the debug-level option */
+#define DEBUG_LEVEL_DESC (sntp_opt_strs+1264)
+/** Upper-cased name for the debug-level option */
+#define DEBUG_LEVEL_NAME (sntp_opt_strs+1295)
+/** Name string for the debug-level option */
+#define DEBUG_LEVEL_name (sntp_opt_strs+1307)
+/** Compiled in flag settings for the debug-level option */
+#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
+
+/**
+ * set-debug-level option description:
+ */
+/** Descriptive text for the set-debug-level option */
+#define SET_DEBUG_LEVEL_DESC (sntp_opt_strs+1319)
+/** Upper-cased name for the set-debug-level option */
+#define SET_DEBUG_LEVEL_NAME (sntp_opt_strs+1349)
+/** Name string for the set-debug-level option */
+#define SET_DEBUG_LEVEL_name (sntp_opt_strs+1365)
+/** Compiled in flag settings for the set-debug-level option */
+#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * gap option description:
+ */
+/** Descriptive text for the gap option */
+#define GAP_DESC (sntp_opt_strs+1381)
+/** Upper-cased name for the gap option */
+#define GAP_NAME (sntp_opt_strs+1429)
+/** Name string for the gap option */
+#define GAP_name (sntp_opt_strs+1433)
+/** The compiled in default value for the gap option argument */
+#define GAP_DFT_ARG ((char const*)50)
+/** Compiled in flag settings for the gap option */
+#define GAP_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * kod option description:
+ */
+/** Descriptive text for the kod option */
+#define KOD_DESC (sntp_opt_strs+1437)
+/** Upper-cased name for the kod option */
+#define KOD_NAME (sntp_opt_strs+1458)
+/** Name string for the kod option */
+#define KOD_name (sntp_opt_strs+1462)
+/** The compiled in default value for the kod option argument */
+#define KOD_DFT_ARG (sntp_opt_strs+1466)
+/** Compiled in flag settings for the kod option */
+#define KOD_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
+
+/**
+ * keyfile option description:
+ */
+/** Descriptive text for the keyfile option */
+#define KEYFILE_DESC (sntp_opt_strs+1482)
+/** Upper-cased name for the keyfile option */
+#define KEYFILE_NAME (sntp_opt_strs+1530)
+/** Name string for the keyfile option */
+#define KEYFILE_name (sntp_opt_strs+1538)
+/** Compiled in flag settings for the keyfile option */
+#define KEYFILE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
+
+/**
+ * logfile option description:
+ */
+/** Descriptive text for the logfile option */
+#define LOGFILE_DESC (sntp_opt_strs+1546)
+/** Upper-cased name for the logfile option */
+#define LOGFILE_NAME (sntp_opt_strs+1571)
+/** Name string for the logfile option */
+#define LOGFILE_name (sntp_opt_strs+1579)
+/** Compiled in flag settings for the logfile option */
+#define LOGFILE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
+
+/**
+ * steplimit option description:
+ */
+/** Descriptive text for the steplimit option */
+#define STEPLIMIT_DESC (sntp_opt_strs+1587)
+/** Upper-cased name for the steplimit option */
+#define STEPLIMIT_NAME (sntp_opt_strs+1639)
+/** Name string for the steplimit option */
+#define STEPLIMIT_name (sntp_opt_strs+1649)
+/** Compiled in flag settings for the steplimit option */
+#define STEPLIMIT_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * ntpversion option description:
+ */
+/** Descriptive text for the ntpversion option */
+#define NTPVERSION_DESC (sntp_opt_strs+1659)
+/** Upper-cased name for the ntpversion option */
+#define NTPVERSION_NAME (sntp_opt_strs+1696)
+/** Name string for the ntpversion option */
+#define NTPVERSION_name (sntp_opt_strs+1707)
+/** The compiled in default value for the ntpversion option argument */
+#define NTPVERSION_DFT_ARG ((char const*)4)
+/** Compiled in flag settings for the ntpversion option */
+#define NTPVERSION_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * usereservedport option description:
+ */
+/** Descriptive text for the usereservedport option */
+#define USERESERVEDPORT_DESC (sntp_opt_strs+1718)
+/** Upper-cased name for the usereservedport option */
+#define USERESERVEDPORT_NAME (sntp_opt_strs+1755)
+/** Name string for the usereservedport option */
+#define USERESERVEDPORT_name (sntp_opt_strs+1771)
+/** Compiled in flag settings for the usereservedport option */
+#define USERESERVEDPORT_FLAGS (OPTST_DISABLED)
+
+/**
+ * step option description:
+ */
+/** Descriptive text for the step option */
+#define STEP_DESC (sntp_opt_strs+1787)
+/** Upper-cased name for the step option */
+#define STEP_NAME (sntp_opt_strs+1830)
+/** Name string for the step option */
+#define STEP_name (sntp_opt_strs+1835)
+/** Compiled in flag settings for the step option */
+#define STEP_FLAGS (OPTST_DISABLED)
+
+/**
+ * slew option description:
+ */
+/** Descriptive text for the slew option */
+#define SLEW_DESC (sntp_opt_strs+1840)
+/** Upper-cased name for the slew option */
+#define SLEW_NAME (sntp_opt_strs+1878)
+/** Name string for the slew option */
+#define SLEW_name (sntp_opt_strs+1883)
+/** Compiled in flag settings for the slew option */
+#define SLEW_FLAGS (OPTST_DISABLED)
+
+/**
+ * timeout option description:
+ */
+/** Descriptive text for the timeout option */
+#define TIMEOUT_DESC (sntp_opt_strs+1888)
+/** Upper-cased name for the timeout option */
+#define TIMEOUT_NAME (sntp_opt_strs+1932)
+/** Name string for the timeout option */
+#define TIMEOUT_name (sntp_opt_strs+1940)
+/** The compiled in default value for the timeout option argument */
+#define TIMEOUT_DFT_ARG ((char const*)5)
+/** Compiled in flag settings for the timeout option */
+#define TIMEOUT_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * wait option description:
+ */
+/** Descriptive text for the wait option */
+#define WAIT_DESC (sntp_opt_strs+1948)
+/** Upper-cased name for the wait option */
+#define WAIT_NAME (sntp_opt_strs+1999)
+/** disablement name for the wait option */
+#define NOT_WAIT_name (sntp_opt_strs+2004)
+/** disablement prefix for the wait option */
+#define NOT_WAIT_PFX (sntp_opt_strs+2012)
+/** Name string for the wait option */
+#define WAIT_name (NOT_WAIT_name + 3)
+/** Compiled in flag settings for the wait option */
+#define WAIT_FLAGS (OPTST_INITENABLED)
+
+/*
+ * Help/More_Help/Version option descriptions:
+ */
+#define HELP_DESC (sntp_opt_strs+2015)
+#define HELP_name (sntp_opt_strs+2059)
+#ifdef HAVE_WORKING_FORK
+#define MORE_HELP_DESC (sntp_opt_strs+2064)
+#define MORE_HELP_name (sntp_opt_strs+2109)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+#define MORE_HELP_DESC HELP_DESC
+#define MORE_HELP_name HELP_name
+#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#endif
+#ifdef NO_OPTIONAL_OPT_ARGS
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
+#endif
+#define VER_DESC (sntp_opt_strs+2119)
+#define VER_name (sntp_opt_strs+2155)
+#define SAVE_OPTS_DESC (sntp_opt_strs+2163)
+#define SAVE_OPTS_name (sntp_opt_strs+2202)
+#define LOAD_OPTS_DESC (sntp_opt_strs+2212)
+#define LOAD_OPTS_NAME (sntp_opt_strs+2244)
+#define NO_LOAD_OPTS_name (sntp_opt_strs+2254)
+#define LOAD_OPTS_pfx (sntp_opt_strs+2012)
+#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
+/**
+ * Declare option callback procedures
+ */
+extern tOptProc
+ ntpOptionPrintVersion, optionBooleanVal, optionNestedVal,
+ optionNumericVal, optionPagedUsage, optionResetOpt,
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVendorOption;
+static tOptProc
+ doOptDebug_Level, doOptKeyfile, doOptKod, doOptLogfile,
+ doOptNtpversion, doOptSteplimit, doUsageOpt;
+#define VER_PROC ntpOptionPrintVersion
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the sntp Option Descriptions.
+ * This is an array of OPTION_CT entries, one for each
+ * option that the sntp program responds to.
+ */
+static tOptDesc optDesc[OPTION_CT] = {
+ { /* entry idx, value */ 0, VALUE_OPT_IPV4,
+ /* equiv idx, value */ 0, VALUE_OPT_IPV4,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV4_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv4 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv4CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV4_DESC, IPV4_NAME, IPV4_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 1, VALUE_OPT_IPV6,
+ /* equiv idx, value */ 1, VALUE_OPT_IPV6,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IPV6_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ipv6 */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, aIpv6CantList,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IPV6_DESC, IPV6_NAME, IPV6_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 2, VALUE_OPT_AUTHENTICATION,
+ /* equiv idx, value */ 2, VALUE_OPT_AUTHENTICATION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ AUTHENTICATION_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --authentication */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ AUTHENTICATION_DESC, AUTHENTICATION_NAME, AUTHENTICATION_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 3, VALUE_OPT_BROADCAST,
+ /* equiv idx, value */ 3, VALUE_OPT_BROADCAST,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ BROADCAST_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --broadcast */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ BROADCAST_DESC, BROADCAST_NAME, BROADCAST_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 4, VALUE_OPT_CONCURRENT,
+ /* equiv idx, value */ 4, VALUE_OPT_CONCURRENT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ CONCURRENT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --concurrent */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionStackArg,
+ /* desc, NAME, name */ CONCURRENT_DESC, CONCURRENT_NAME, CONCURRENT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 5, VALUE_OPT_DEBUG_LEVEL,
+ /* equiv idx, value */ 5, VALUE_OPT_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptDebug_Level,
+ /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equiv idx, value */ 6, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --set-debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 7, VALUE_OPT_GAP,
+ /* equiv idx, value */ 7, VALUE_OPT_GAP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ GAP_FLAGS, 0,
+ /* last opt argumnt */ { GAP_DFT_ARG },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ GAP_DESC, GAP_NAME, GAP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 8, VALUE_OPT_KOD,
+ /* equiv idx, value */ 8, VALUE_OPT_KOD,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ KOD_FLAGS, 0,
+ /* last opt argumnt */ { KOD_DFT_ARG },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptKod,
+ /* desc, NAME, name */ KOD_DESC, KOD_NAME, KOD_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 9, VALUE_OPT_KEYFILE,
+ /* equiv idx, value */ 9, VALUE_OPT_KEYFILE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ KEYFILE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --keyfile */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptKeyfile,
+ /* desc, NAME, name */ KEYFILE_DESC, KEYFILE_NAME, KEYFILE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 10, VALUE_OPT_LOGFILE,
+ /* equiv idx, value */ 10, VALUE_OPT_LOGFILE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ LOGFILE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --logfile */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptLogfile,
+ /* desc, NAME, name */ LOGFILE_DESC, LOGFILE_NAME, LOGFILE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 11, VALUE_OPT_STEPLIMIT,
+ /* equiv idx, value */ 11, VALUE_OPT_STEPLIMIT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ STEPLIMIT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --steplimit */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptSteplimit,
+ /* desc, NAME, name */ STEPLIMIT_DESC, STEPLIMIT_NAME, STEPLIMIT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 12, VALUE_OPT_NTPVERSION,
+ /* equiv idx, value */ 12, VALUE_OPT_NTPVERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ NTPVERSION_FLAGS, 0,
+ /* last opt argumnt */ { NTPVERSION_DFT_ARG },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptNtpversion,
+ /* desc, NAME, name */ NTPVERSION_DESC, NTPVERSION_NAME, NTPVERSION_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 13, VALUE_OPT_USERESERVEDPORT,
+ /* equiv idx, value */ 13, VALUE_OPT_USERESERVEDPORT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ USERESERVEDPORT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --usereservedport */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ USERESERVEDPORT_DESC, USERESERVEDPORT_NAME, USERESERVEDPORT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 14, VALUE_OPT_STEP,
+ /* equiv idx, value */ 14, VALUE_OPT_STEP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ STEP_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --step */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ STEP_DESC, STEP_NAME, STEP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 15, VALUE_OPT_SLEW,
+ /* equiv idx, value */ 15, VALUE_OPT_SLEW,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SLEW_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --slew */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SLEW_DESC, SLEW_NAME, SLEW_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 16, VALUE_OPT_TIMEOUT,
+ /* equiv idx, value */ 16, VALUE_OPT_TIMEOUT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ TIMEOUT_FLAGS, 0,
+ /* last opt argumnt */ { TIMEOUT_DFT_ARG },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ TIMEOUT_DESC, TIMEOUT_NAME, TIMEOUT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 17, VALUE_OPT_WAIT,
+ /* equiv idx, value */ 17, VALUE_OPT_WAIT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ WAIT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --wait */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ WAIT_DESC, WAIT_NAME, WAIT_name,
+ /* disablement strs */ NOT_WAIT_name, NOT_WAIT_PFX },
+
+ { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ VER_PROC,
+ /* desc, NAME, name */ VER_DESC, NULL, VER_name,
+ /* disablement strs */ NULL, NULL },
+
+
+
+ { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doUsageOpt,
+ /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionPagedUsage,
+ /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionLoadOpt,
+ /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
+ /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
+};
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of sntp. */
+#define zPROGNAME (sntp_opt_strs+2267)
+/** Reference to the title line for sntp usage. */
+#define zUsageTitle (sntp_opt_strs+2272)
+/** sntp configuration file name. */
+#define zRcName (sntp_opt_strs+2441)
+/** Directories to search for sntp config files. */
+static char const * const apzHomeList[3] = {
+ sntp_opt_strs+2433,
+ sntp_opt_strs+2439,
+ NULL };
+/** The sntp program bug email address. */
+#define zBugsAddr (sntp_opt_strs+2448)
+/** Clarification/explanation of what sntp does. */
+#define zExplain (sntp_opt_strs+2482)
+/** Extra detail explaining what sntp does. */
+#define zDetail (NULL)
+/** The full version string for sntp. */
+#define zFullVersion (sntp_opt_strs+2484)
+/* extracted from optcode.tlib near line 364 */
+
+#if defined(ENABLE_NLS)
+# define OPTPROC_BASE OPTPROC_TRANSLATE
+ static tOptionXlateProc translate_option_strings;
+#else
+# define OPTPROC_BASE OPTPROC_NONE
+# define translate_option_strings NULL
+#endif /* ENABLE_NLS */
+
+#define sntp_full_usage (NULL)
+#define sntp_short_usage (NULL)
+
+#endif /* not defined __doxygen__ */
+
+/*
+ * Create the static procedure(s) declared above.
+ */
+/**
+ * The callout function that invokes the optionUsage function.
+ *
+ * @param[in] opts the AutoOpts option description structure
+ * @param[in] od the descriptor for the "help" (usage) option.
+ * @noreturn
+ */
+static void
+doUsageOpt(tOptions * opts, tOptDesc * od)
+{
+ int ex_code;
+ ex_code = SNTP_EXIT_SUCCESS;
+ optionUsage(&sntpOptions, ex_code);
+ /* NOTREACHED */
+ exit(1);
+ (void)opts;
+ (void)od;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the debug-level option.
+ *
+ * @param[in] pOptions the sntp options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ /*
+ * Be sure the flag-code[0] handles special values for the options pointer
+ * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
+ * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
+ * reset its state.
+ */
+ /* extracted from debug-opt.def, line 15 */
+OPT_VALUE_SET_DEBUG_LEVEL++;
+ (void)pOptDesc;
+ (void)pOptions;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the kod option.
+ * Specifies the filename to be used for the persistent history of KoD
+ * responses received from servers.
+ * @param[in] pOptions the sntp options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptKod(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static teOptFileType const type =
+ FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ static tuFileMode mode;
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+ mode.file_flags = O_CLOEXEC;
+
+ /*
+ * This function handles special invalid values for "pOptions"
+ */
+ optionFileCheck(pOptions, pOptDesc, type, mode);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the keyfile option.
+ * This option specifies the keyfile.
+ * @code{sntp} will search for the key specified with @option{-a}
+ * @file{keyno} in this file. See @command{ntp.keys(5)} for more
+ * information.
+ * @param[in] pOptions the sntp options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptKeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static teOptFileType const type =
+ FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ static tuFileMode mode;
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+ mode.file_flags = O_CLOEXEC;
+
+ /*
+ * This function handles special invalid values for "pOptions"
+ */
+ optionFileCheck(pOptions, pOptDesc, type, mode);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the logfile option.
+ * This option causes the client to write log messages to the specified
+ * @file{logfile}.
+ * @param[in] pOptions the sntp options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptLogfile(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static teOptFileType const type =
+ FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
+ static tuFileMode mode;
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+ mode.file_flags = O_CLOEXEC;
+
+ /*
+ * This function handles special invalid values for "pOptions"
+ */
+ optionFileCheck(pOptions, pOptDesc, type, mode);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the steplimit option.
+ * If the time adjustment is less than @file{steplimit} milliseconds,
+ * slew the amount using @command{adjtime(2)}. Otherwise, step the
+ * correction using @command{settimeofday(2)}.
+ * @param[in] pOptions the sntp options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptSteplimit(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static struct {long rmin, rmax;} const rng[1] = {
+ { 0, LONG_MAX } };
+ int ix;
+
+ if (pOptions <= OPTPROC_EMIT_LIMIT)
+ goto emit_ranges;
+ optionNumericVal(pOptions, pOptDesc);
+
+ for (ix = 0; ix < 1; ix++) {
+ if (pOptDesc->optArg.argInt < rng[ix].rmin)
+ continue; /* ranges need not be ordered. */
+ if (pOptDesc->optArg.argInt == rng[ix].rmin)
+ return;
+ if (rng[ix].rmax == LONG_MIN)
+ continue;
+ if (pOptDesc->optArg.argInt <= rng[ix].rmax)
+ return;
+ }
+
+ option_usage_fp = stderr;
+
+ emit_ranges:
+ optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the ntpversion option.
+ * When sending requests to a remote server, tell them we are running
+ * NTP protocol version @file{ntpversion} .
+ * @param[in] pOptions the sntp options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptNtpversion(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static struct {long rmin, rmax;} const rng[1] = {
+ { 0, 7 } };
+ int ix;
+
+ if (pOptions <= OPTPROC_EMIT_LIMIT)
+ goto emit_ranges;
+ optionNumericVal(pOptions, pOptDesc);
+
+ for (ix = 0; ix < 1; ix++) {
+ if (pOptDesc->optArg.argInt < rng[ix].rmin)
+ continue; /* ranges need not be ordered. */
+ if (pOptDesc->optArg.argInt == rng[ix].rmin)
+ return;
+ if (rng[ix].rmax == LONG_MIN)
+ continue;
+ if (pOptDesc->optArg.argInt <= rng[ix].rmax)
+ return;
+ }
+
+ option_usage_fp = stderr;
+
+ emit_ranges:
+ optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
+}
+/* extracted from optmain.tlib near line 1245 */
+
+/**
+ * The directory containing the data associated with sntp.
+ */
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+/**
+ * Information about the person or institution that packaged sntp
+ * for the current distribution.
+ */
+#ifndef WITH_PACKAGER
+# define sntp_packager_info NULL
+#else
+/** Packager information for sntp. */
+static char const sntp_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport sntp bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+#ifndef __doxygen__
+
+#endif /* __doxygen__ */
+/**
+ * The option definitions for sntp. The one structure that
+ * binds them all.
+ */
+tOptions sntpOptions = {
+ OPTIONS_STRUCT_VERSION,
+ 0, NULL, /* original argc + argv */
+ ( OPTPROC_BASE
+ + OPTPROC_ERRSTOP
+ + OPTPROC_SHORTOPT
+ + OPTPROC_LONGOPT
+ + OPTPROC_NO_REQ_OPT
+ + OPTPROC_NEGATIONS
+ + OPTPROC_ENVIRON
+ + OPTPROC_MISUSE ),
+ 0, NULL, /* current option index, current option */
+ NULL, NULL, zPROGNAME,
+ zRcName, zCopyright, zLicenseDescrip,
+ zFullVersion, apzHomeList, zUsageTitle,
+ zExplain, zDetail, optDesc,
+ zBugsAddr, /* address to send bugs to */
+ NULL, NULL, /* extensions/saved state */
+ optionUsage, /* usage procedure */
+ translate_option_strings, /* translation procedure */
+ /*
+ * Indexes to special options
+ */
+ { INDEX_OPT_MORE_HELP, /* more-help option index */
+ INDEX_OPT_SAVE_OPTS, /* save option index */
+ NO_EQUIVALENT, /* '-#' option index */
+ NO_EQUIVALENT /* index of default opt */
+ },
+ 23 /* full option count */, 18 /* user option count */,
+ sntp_full_usage, sntp_short_usage,
+ NULL, NULL,
+ PKGDATADIR, sntp_packager_info
+};
+
+#if ENABLE_NLS
+/**
+ * This code is designed to translate translatable option text for the
+ * sntp program. These translations happen upon entry
+ * to optionProcess().
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#ifdef HAVE_DCGETTEXT
+# include <gettext.h>
+#endif
+#include <autoopts/usage-txt.h>
+
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
+
+/**
+ * AutoGen specific wrapper function for gettext. It relies on the macro _()
+ * to convert from English to the target language, then strdup-duplicates the
+ * result string. It tries the "libopts" domain first, then whatever has been
+ * set via the \a textdomain(3) call.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
+AO_gettext(char const * pz)
+{
+ char * res;
+ if (pz == NULL)
+ return NULL;
+#ifdef HAVE_DCGETTEXT
+ /*
+ * While processing the option_xlateable_txt data, try to use the
+ * "libopts" domain. Once we switch to the option descriptor data,
+ * do *not* use that domain.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ res = dgettext("libopts", pz);
+ if (res == pz)
+ res = (char *)(void *)_(pz);
+ } else
+ res = (char *)(void *)_(pz);
+#else
+ res = (char *)(void *)_(pz);
+#endif
+ if (res == pz)
+ return res;
+ res = strdup(res);
+ if (res == NULL) {
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(SNTP_EXIT_FAILURE);
+ }
+ return res;
+}
+
+/**
+ * All the pointers we use are marked "* const", but they are stored in
+ * writable memory. Coerce the mutability and set the pointer.
+ */
+static void coerce_it(void ** s) { *s = AO_gettext(*s);
+}
+
+/**
+ * Translate all the translatable strings in the sntpOptions
+ * structure defined above. This is done only once.
+ */
+static void
+translate_option_strings(void)
+{
+ tOptions * const opts = &sntpOptions;
+
+ /*
+ * Guard against re-translation. It won't work. The strings will have
+ * been changed by the first pass through this code. One shot only.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ /*
+ * Do the translations. The first pointer follows the field count
+ * field. The field count field is the size of a pointer.
+ */
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
+
+ do {
+ ppz++; /* skip over field_ct */
+ *ppz = AO_gettext(*ppz);
+ } while (--ix > 0);
+ /* prevent re-translation and disable "libopts" domain lookup */
+ option_xlateable_txt.field_ct = 0;
+
+ coerce_it((void*)&(opts->pzCopyright));
+ coerce_it((void*)&(opts->pzCopyNotice));
+ coerce_it((void*)&(opts->pzFullVersion));
+ coerce_it((void*)&(opts->pzUsageTitle));
+ coerce_it((void*)&(opts->pzExplain));
+ coerce_it((void*)&(opts->pzDetail));
+ {
+ tOptDesc * od = opts->pOptDesc;
+ for (ix = opts->optCt; ix > 0; ix--, od++)
+ coerce_it((void*)&(od->pzText));
+ }
+ }
+}
+#endif /* ENABLE_NLS */
+
+#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
+/** I18N function strictly for xgettext. Do not compile. */
+static void bogus_function(void) {
+ /* TRANSLATORS:
+
+ The following dummy function was crated solely so that xgettext can
+ extract the correct strings. These strings are actually referenced
+ by a field name in the sntpOptions structure noted in the
+ comments below. The literal text is defined in sntp_opt_strs.
+
+ NOTE: the strings below are segmented with respect to the source string
+ sntp_opt_strs. The strings above are handed off for translation
+ at run time a paragraph at a time. Consequently, they are presented here
+ for translation a paragraph at a time.
+
+ ALSO: often the description for an option will reference another option
+ by name. These are set off with apostrophe quotes (I hope). Do not
+ translate option names.
+ */
+ /* referenced via sntpOptions.pzCopyright */
+ puts(_("sntp 4.2.7p482\n\
+Copyright (C) 1970-2014 The University of Delaware, 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\
+can be seen at:\n"));
+ puts(_(" <http://ntp.org/license>\n\
+ <http://opensource.org/licenses/ntp-license.php>\n"));
+
+ /* referenced via sntpOptions.pzCopyNotice */
+ puts(_("Permission to use, copy, modify, and distribute this software and its\n\
+documentation for any purpose with or without fee is hereby granted,\n\
+provided that the above copyright notice appears in all copies and that\n\
+both the copyright notice and this permission notice appear in supporting\n\
+documentation, and that the name The University of Delaware not be used in\n\
+advertising or publicity pertaining to distribution of the software without\n\
+specific, written prior permission. The University of Delaware makes no\n\
+representations about the suitability this software for any purpose. It is\n\
+provided \"as is\" without express or implied warranty.\n"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Force IPv4 DNS name resolution"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Force IPv6 DNS name resolution"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Enable authentication with the key auth-keynumber"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Listen to the address specified for broadcast time sync"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Concurrently query all IPs returned for host-name"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Increase debug verbosity level"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Set the debug verbosity level"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("The gap (in milliseconds) between time requests"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("KoD history filename"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Look in this file for the key specified with -a"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Log to specified logfile"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Adjustments less than steplimit msec will be slewed"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Send int as our NTP protocol version"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Use the NTP Reserved Port (port 123)"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("OK to 'step' the time with settimeofday(2)"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("OK to 'slew' the time with adjtime(2)"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("The number of seconds to wait for responses"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("Wait for pending replies (if not setting the time)"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("display extended usage information and exit"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("extended usage information passed thru pager"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("output version information and exit"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("save the option state to a config file"));
+
+ /* referenced via sntpOptions.pOptDesc->pzText */
+ puts(_("load options from a config file"));
+
+ /* referenced via sntpOptions.pzUsageTitle */
+ puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p482\n\
+Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
+\t\t[ hostname-or-IP ...]\n"));
+
+ /* referenced via sntpOptions.pzExplain */
+ puts(_("\n"));
+
+ /* referenced via sntpOptions.pzFullVersion */
+ puts(_("sntp 4.2.7p482"));
+
+ /* referenced via sntpOptions.pzFullUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+
+ /* referenced via sntpOptions.pzShortUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 86 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 84 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 88 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* uncompilable code */
+#ifdef __cplusplus
+}
+#endif
+/* sntp-opts.c ends here */
diff --git a/sntp/sntp-opts.def b/sntp/sntp-opts.def
new file mode 100644
index 0000000..86e17c9
--- /dev/null
+++ b/sntp/sntp-opts.def
@@ -0,0 +1,319 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include autogen-version.def
+#include copyright.def
+
+prog-name = "sntp";
+prog-title = "standard Simple Network Time Protocol client program";
+argument = '[ hostname-or-IP ...]';
+
+#include homerc.def
+
+long-opts;
+
+config-header = "config.h";
+
+environrc;
+
+#include version.def
+
+flag = {
+ name = ipv4;
+ value = 4;
+ flags-cant = ipv6;
+ descrip = "Force IPv4 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of the following host names on the command line
+ to the IPv4 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = ipv6;
+ value = 6;
+ flags-cant = ipv4;
+ descrip = "Force IPv6 DNS name resolution";
+ doc = <<- _EndOfDoc_
+ Force DNS resolution of the following host names on the command line
+ to the IPv6 namespace.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = authentication;
+ value = a;
+ descrip = "Enable authentication with the key @var{auth-keynumber}";
+ arg-type = number;
+ arg-name = "auth-keynumber";
+ doc = <<- _EndOfDoc_
+ Enable authentication using the key specified in this option's
+ argument. The argument of this option is the @option{keyid}, a
+ number specified in the @option{keyfile} as this key's identifier.
+ See the @option{keyfile} option (@option{-k}) for more details.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = broadcast;
+ value = b;
+ descrip = "Listen to the address specified for broadcast time sync";
+ arg-type = string;
+ arg-name = "broadcast-address";
+ max = NOLIMIT;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ If specified @code{sntp} will listen to the specified address
+ for NTP broadcasts. The default maximum wait time
+ can (and probably should) be modified with @option{-t}.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = concurrent;
+ value = c;
+ descrip = "Concurrently query all IPs returned for host-name";
+ arg-type = string;
+ arg-name = "host-name";
+ max = NOLIMIT;
+ stack-arg;
+ doc = <<- _EndOfDoc_
+ Requests from an NTP "client" to a "server" should never be sent
+ more rapidly than one every 2 seconds. By default, any IPs returned
+ as part of a DNS lookup are assumed to be for a single instance of
+ @code{ntpd}, and therefore @code{sntp} will send queries to these IPs
+ one after another, with a 2-second gap in between each query.
+
+ The @option{-c} or @option{--concurrent} flag says that any IPs
+ returned for the DNS lookup of the supplied host-name are on
+ different machines, so we can send concurrent queries.
+ _EndOfDoc_;
+};
+
+#include debug-opt.def
+
+flag = {
+ name = gap;
+ value = g;
+ descrip = "The gap (in milliseconds) between time requests";
+ arg-type = number;
+ arg-name = "milliseconds";
+ arg-default = 50;
+ doc = <<- _EndOfDoc_
+ Since we're only going to use the first valid response we get and
+ there is benefit to specifying a good number of servers to query,
+ separate the queries we send out by the specified number of
+ milliseconds.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = kod;
+ value = K;
+ arg-type = file;
+ arg-name = "file-name";
+ arg-default = "/var/db/ntp-kod";
+ descrip = "KoD history filename";
+ doc = <<- _EndOfDoc_
+ Specifies the filename to be used for the persistent history of KoD
+ responses received from servers.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = keyfile;
+ value = k;
+ descrip = "Look in this file for the key specified with @option{-a}";
+ arg-type = file;
+ arg-name = "file-name";
+ doc = <<- _EndOfDoc_
+ This option specifies the keyfile.
+ @code{sntp} will search for the key specified with @option{-a}
+ @file{keyno} in this file. See @command{ntp.keys(5)} for more
+ information.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = logfile;
+ value = l;
+ arg-type = file;
+ arg-name = "file-name";
+ descrip = "Log to specified logfile";
+ doc = <<- _EndOfDoc_
+ This option causes the client to write log messages to the specified
+ @file{logfile}.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = steplimit;
+ value = M;
+ arg-type = number;
+ arg-range = "0->";
+ descrip = "Adjustments less than @var{steplimit} msec will be slewed";
+ doc = <<- _EndOfDoc_
+ If the time adjustment is less than @file{steplimit} milliseconds,
+ slew the amount using @command{adjtime(2)}. Otherwise, step the
+ correction using @command{settimeofday(2)}.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = ntpversion;
+ value = o;
+ descrip = "Send @var{int} as our NTP protocol version";
+ arg-type = number;
+ arg-default = 4;
+ arg-range = "0->7";
+ doc = <<- _EndOfDoc_
+ When sending requests to a remote server, tell them we are running
+ NTP protocol version @file{ntpversion} .
+ _EndOfDoc_;
+};
+
+flag = {
+ name = usereservedport;
+ value = r;
+ descrip = "Use the NTP Reserved Port (port 123)";
+ doc = <<- _EndOfDoc_
+ Use port 123, which is reserved for NTP, for our network
+ communications.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = step;
+ value = S;
+ descrip = "OK to 'step' the time with @command{settimeofday(2)}";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+flag = {
+ name = slew;
+ value = s;
+ descrip = "OK to 'slew' the time with @command{adjtime(2)}";
+ doc = <<- _EndOfDoc_
+ _EndOfDoc_;
+};
+
+
+flag = {
+ name = timeout;
+ value = t;
+ descrip = "The number of seconds to wait for responses";
+ arg-type = number;
+ arg-name = "seconds";
+ arg-default = 5;
+ doc = <<- _EndOfDoc_
+ When waiting for a reply, @code{sntp} will wait the number
+ of seconds specified before giving up. The default should be
+ more than enough for a unicast response. If @code{sntp} is
+ only waiting for a broadcast response a longer timeout is
+ likely needed.
+ _EndOfDoc_;
+};
+
+flag = {
+ name = "wait";
+ descrip = "Wait for pending replies (if not setting the time)";
+ disable = no;
+ enabled;
+ settable;
+ doc = <<- _EndOfDoc_
+ If we are not setting the time, wait for all pending responses.
+ _EndOfDoc_;
+};
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+.Nm
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command or from a
+.Ic cron
+job.
+
+NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+
+.Pp
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+
+.Ic "'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'"
+
+where the
+.Ic "'(+0800)'"
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+.Ic "'+4.567'"
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+.Ic "'+/- 0.089'"
+is the reported
+.Em synchronization distance
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+.Ic "'+/- ?'" .
+If the
+.Em host
+is different from the
+.Em IP ,
+both will be displayed.
+Otherwise, only the
+.Em IP
+is displayed.
+Finally, the
+.Em stratum
+of the host is reported.
+ _END_PROG_MDOC_DESCRIP;
+};
+
+doc-section = {
+ ds-type = 'USAGE';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_USAGE
+.Bl -tag -width indent
+.It Li "sntp ntpserver.somewhere"
+is the simplest use of this program
+and can be run as an unprivileged command
+to check the current time and error in the local clock.
+.It Li "sntp -a ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp -a"
+will reset the local clock from a synchronized specified server,
+like the (deprecated)
+.Xr ntpdate 1ntpdatemdoc ,
+or
+.Xr rdate 8
+commands.
+.El
+ _END_MDOC_USAGE;
+};
+
+doc-section = {
+ ds-type = 'AUTHORS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_AUTHORS
+.An "Johannes Maximilian Kuehn"
+.An "Harlan Stenn"
+.An "Dave Hart"
+ _END_MDOC_AUTHORS;
+};
diff --git a/sntp/sntp-opts.h b/sntp/sntp-opts.h
new file mode 100644
index 0000000..6c843d9
--- /dev/null
+++ b/sntp/sntp-opts.h
@@ -0,0 +1,370 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (sntp-opts.h)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:49:11 AM by AutoGen 5.18.5pre4
+ * From the definitions sntp-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the sntp author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The sntp program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+/**
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the sntp program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_SNTP_OPTS_H_GUARD
+#define AUTOOPTS_SNTP_OPTS_H_GUARD 1
+#include "config.h"
+#include <autoopts/options.h>
+
+/**
+ * Ensure that the library used for compiling this generated header is at
+ * least as new as the version current when the header template was released
+ * (not counting patch version increments). Also ensure that the oldest
+ * tolerable version is at least as old as what was current when the header
+ * template was released.
+ */
+#define AO_TEMPLATE_VERSION 167936
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+ Choke Me.
+#endif
+
+/**
+ * Enumeration of each option type for sntp
+ */
+typedef enum {
+ INDEX_OPT_IPV4 = 0,
+ INDEX_OPT_IPV6 = 1,
+ INDEX_OPT_AUTHENTICATION = 2,
+ INDEX_OPT_BROADCAST = 3,
+ INDEX_OPT_CONCURRENT = 4,
+ INDEX_OPT_DEBUG_LEVEL = 5,
+ INDEX_OPT_SET_DEBUG_LEVEL = 6,
+ INDEX_OPT_GAP = 7,
+ INDEX_OPT_KOD = 8,
+ INDEX_OPT_KEYFILE = 9,
+ INDEX_OPT_LOGFILE = 10,
+ INDEX_OPT_STEPLIMIT = 11,
+ INDEX_OPT_NTPVERSION = 12,
+ INDEX_OPT_USERESERVEDPORT = 13,
+ INDEX_OPT_STEP = 14,
+ INDEX_OPT_SLEW = 15,
+ INDEX_OPT_TIMEOUT = 16,
+ INDEX_OPT_WAIT = 17,
+ INDEX_OPT_VERSION = 18,
+ INDEX_OPT_HELP = 19,
+ INDEX_OPT_MORE_HELP = 20,
+ INDEX_OPT_SAVE_OPTS = 21,
+ INDEX_OPT_LOAD_OPTS = 22
+} teOptIndex;
+/** count of all options for sntp */
+#define OPTION_CT 23
+/** sntp version */
+#define SNTP_VERSION "4.2.7p482"
+/** Full sntp version text */
+#define SNTP_FULL_VERSION "sntp 4.2.7p482"
+
+/**
+ * Interface defines for all options. Replace "n" with the UPPER_CASED
+ * option name (as in the teOptIndex enumeration above).
+ * e.g. HAVE_OPT(IPV4)
+ */
+#define DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n])
+/** 'true' if an option has been specified in any way */
+#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
+/** The string argument to an option. The argument type must be \"string\". */
+#define OPT_ARG(n) (DESC(n).optArg.argString)
+/** Mask the option state revealing how an option was specified.
+ * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
+ * \a OPTST_DEFINED, \a OPTST_RESET or zero.
+ */
+#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
+/** Count of option's occurrances *on the command line*. */
+#define COUNT_OPT(n) (DESC(n).optOccCt)
+/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
+#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
+/** 'true' if \a HAVE_OPT would yield 'false'. */
+#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
+/** 'true' if OPTST_DISABLED bit not set. */
+#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
+/** number of stacked option arguments.
+ * Valid only for stacked option arguments. */
+#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
+/** stacked argument vector.
+ * Valid only for stacked option arguments. */
+#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
+/** Reset an option. */
+#define CLEAR_OPT(n) STMTS( \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ DESC(n).fOptState |= OPTST_DISABLED; \
+ DESC(n).optCookie = NULL )
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Enumeration of sntp exit codes
+ */
+typedef enum {
+ SNTP_EXIT_SUCCESS = 0,
+ SNTP_EXIT_FAILURE = 1,
+ SNTP_EXIT_USAGE_ERROR = 64,
+ SNTP_EXIT_NO_CONFIG_INPUT = 66,
+ SNTP_EXIT_LIBOPTS_FAILURE = 70
+} sntp_exit_code_t;
+/** @} */
+/**
+ * Make sure there are no #define name conflicts with the option names
+ */
+#ifndef NO_OPTION_NAME_WARNINGS
+# ifdef IPV4
+# warning undefining IPV4 due to option name conflict
+# undef IPV4
+# endif
+# ifdef IPV6
+# warning undefining IPV6 due to option name conflict
+# undef IPV6
+# endif
+# ifdef AUTHENTICATION
+# warning undefining AUTHENTICATION due to option name conflict
+# undef AUTHENTICATION
+# endif
+# ifdef BROADCAST
+# warning undefining BROADCAST due to option name conflict
+# undef BROADCAST
+# endif
+# ifdef CONCURRENT
+# warning undefining CONCURRENT due to option name conflict
+# undef CONCURRENT
+# endif
+# ifdef DEBUG_LEVEL
+# warning undefining DEBUG_LEVEL due to option name conflict
+# undef DEBUG_LEVEL
+# endif
+# ifdef SET_DEBUG_LEVEL
+# warning undefining SET_DEBUG_LEVEL due to option name conflict
+# undef SET_DEBUG_LEVEL
+# endif
+# ifdef GAP
+# warning undefining GAP due to option name conflict
+# undef GAP
+# endif
+# ifdef KOD
+# warning undefining KOD due to option name conflict
+# undef KOD
+# endif
+# ifdef KEYFILE
+# warning undefining KEYFILE due to option name conflict
+# undef KEYFILE
+# endif
+# ifdef LOGFILE
+# warning undefining LOGFILE due to option name conflict
+# undef LOGFILE
+# endif
+# ifdef STEPLIMIT
+# warning undefining STEPLIMIT due to option name conflict
+# undef STEPLIMIT
+# endif
+# ifdef NTPVERSION
+# warning undefining NTPVERSION due to option name conflict
+# undef NTPVERSION
+# endif
+# ifdef USERESERVEDPORT
+# warning undefining USERESERVEDPORT due to option name conflict
+# undef USERESERVEDPORT
+# endif
+# ifdef STEP
+# warning undefining STEP due to option name conflict
+# undef STEP
+# endif
+# ifdef SLEW
+# warning undefining SLEW due to option name conflict
+# undef SLEW
+# endif
+# ifdef TIMEOUT
+# warning undefining TIMEOUT due to option name conflict
+# undef TIMEOUT
+# endif
+# ifdef WAIT
+# warning undefining WAIT due to option name conflict
+# undef WAIT
+# endif
+#else /* NO_OPTION_NAME_WARNINGS */
+# undef IPV4
+# undef IPV6
+# undef AUTHENTICATION
+# undef BROADCAST
+# undef CONCURRENT
+# undef DEBUG_LEVEL
+# undef SET_DEBUG_LEVEL
+# undef GAP
+# undef KOD
+# undef KEYFILE
+# undef LOGFILE
+# undef STEPLIMIT
+# undef NTPVERSION
+# undef USERESERVEDPORT
+# undef STEP
+# undef SLEW
+# undef TIMEOUT
+# undef WAIT
+#endif /* NO_OPTION_NAME_WARNINGS */
+
+/**
+ * Interface defines for specific options.
+ * @{
+ */
+#define VALUE_OPT_IPV4 '4'
+#define VALUE_OPT_IPV6 '6'
+#define VALUE_OPT_AUTHENTICATION 'a'
+
+#define OPT_VALUE_AUTHENTICATION (DESC(AUTHENTICATION).optArg.argInt)
+#define VALUE_OPT_BROADCAST 'b'
+#define VALUE_OPT_CONCURRENT 'c'
+#define VALUE_OPT_DEBUG_LEVEL 'd'
+#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
+
+#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
+#define VALUE_OPT_GAP 'g'
+
+#define OPT_VALUE_GAP (DESC(GAP).optArg.argInt)
+#define VALUE_OPT_KOD 'K'
+#define VALUE_OPT_KEYFILE 'k'
+#define VALUE_OPT_LOGFILE 'l'
+#define VALUE_OPT_STEPLIMIT 'M'
+
+#define OPT_VALUE_STEPLIMIT (DESC(STEPLIMIT).optArg.argInt)
+#define VALUE_OPT_NTPVERSION 'o'
+
+#define OPT_VALUE_NTPVERSION (DESC(NTPVERSION).optArg.argInt)
+#define VALUE_OPT_USERESERVEDPORT 'r'
+#define VALUE_OPT_STEP 'S'
+#define VALUE_OPT_SLEW 's'
+#define VALUE_OPT_TIMEOUT 't'
+
+#define OPT_VALUE_TIMEOUT (DESC(TIMEOUT).optArg.argInt)
+#define VALUE_OPT_WAIT 0x1001
+
+#define SET_OPT_WAIT STMTS( \
+ DESC(WAIT).optActualIndex = 17; \
+ DESC(WAIT).optActualValue = VALUE_OPT_WAIT; \
+ DESC(WAIT).fOptState &= OPTST_PERSISTENT_MASK; \
+ DESC(WAIT).fOptState |= OPTST_SET )
+#define DISABLE_OPT_WAIT STMTS( \
+ DESC(WAIT).fOptState &= OPTST_PERSISTENT_MASK; \
+ DESC(WAIT).fOptState |= OPTST_SET | OPTST_DISABLED; \
+ DESC(WAIT).optArg.argString = NULL )
+/** option flag (value) for help-value option */
+#define VALUE_OPT_HELP '?'
+/** option flag (value) for more-help-value option */
+#define VALUE_OPT_MORE_HELP '!'
+/** option flag (value) for version-value option */
+#define VALUE_OPT_VERSION 0x1002
+/** option flag (value) for save-opts-value option */
+#define VALUE_OPT_SAVE_OPTS '>'
+/** option flag (value) for load-opts-value option */
+#define VALUE_OPT_LOAD_OPTS '<'
+#define SET_OPT_SAVE_OPTS(a) STMTS( \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
+ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
+ DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
+/*
+ * Interface defines not associated with particular options
+ */
+#define ERRSKIP_OPTERR STMTS(sntpOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(sntpOptions.fOptSet |= OPTPROC_ERRSTOP)
+#define RESTART_OPT(n) STMTS( \
+ sntpOptions.curOptIdx = (n); \
+ sntpOptions.pzCurOpt = NULL )
+#define START_OPT RESTART_OPT(1)
+#define USAGE(c) (*sntpOptions.pUsageProc)(&sntpOptions, c)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* * * * * *
+ *
+ * Declare the sntp option descriptor.
+ */
+extern tOptions sntpOptions;
+
+#if defined(ENABLE_NLS)
+# ifndef _
+# include <stdio.h>
+# ifndef HAVE_GETTEXT
+ extern char * gettext(char const *);
+# else
+# include <libintl.h>
+# endif
+
+# ifndef ATTRIBUTE_FORMAT_ARG
+# define ATTRIBUTE_FORMAT_ARG(_a)
+# endif
+
+static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
+static inline char* aoGetsText(char const* pz) {
+ if (pz == NULL) return NULL;
+ return (char*)gettext(pz);
+}
+# define _(s) aoGetsText(s)
+# endif /* _() */
+
+# define OPT_NO_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT_CFG;)
+# define OPT_NO_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
+
+# define OPT_XLAT_CFG_NAMES STMTS(sntpOptions.fOptSet &= \
+ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
+# define OPT_XLAT_OPT_NAMES STMTS(sntpOptions.fOptSet &= \
+ ~OPTPROC_NXLAT_OPT;)
+
+#else /* ENABLE_NLS */
+# define OPT_NO_XLAT_CFG_NAMES
+# define OPT_NO_XLAT_OPT_NAMES
+
+# define OPT_XLAT_CFG_NAMES
+# define OPT_XLAT_OPT_NAMES
+
+# ifndef _
+# define _(_s) _s
+# endif
+#endif /* ENABLE_NLS */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_SNTP_OPTS_H_GUARD */
+
+/* sntp-opts.h ends here */
diff --git a/sntp/sntp.1sntpman b/sntp/sntp.1sntpman
new file mode 100644
index 0000000..15b4dff
--- /dev/null
+++ b/sntp/sntp.1sntpman
@@ -0,0 +1,339 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH sntp 1sntpman "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-GgaaeT/ag-5ga4cT)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:59:25 AM by AutoGen 5.18.5pre4
+.\" From the definitions sntp-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]sntp\fP
+\- standard Simple Network Time Protocol client program
+.SH SYNOPSIS
+\f\*[B-Font]sntp\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ hostname-or-IP ...]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]sntp\fP
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command or from a
+\f\*[B-Font]cron\f[]
+job.
+NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+.sp \n(Ppu
+.ne 2
+
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+\f\*[B-Font]'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'\f[]
+where the
+\f\*[B-Font]'(+0800)'\f[]
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+\f\*[B-Font]'+4.567'\f[]
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+\f\*[B-Font]'+/- 0.089'\f[]
+is the reported
+\fIsynchronization\f[] \fIdistance\f[]
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+\f\*[B-Font]'+/- ?'\f[].
+If the
+\fIhost\f[]
+is different from the
+\fIIP\f[],
+both will be displayed.
+Otherwise, only the
+\fIIP\f[]
+is displayed.
+Finally, the
+\fIstratum\f[]
+of the host is reported.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-a\f[] \f\*[I-Font]auth\-keynumber\f[], \f\*[B-Font]\-\-authentication\f[]=\f\*[I-Font]auth\-keynumber\f[]
+Enable authentication with the key \fBauth-keynumber\fP.
+This option takes an integer number as its argument.
+.sp
+Enable authentication using the key specified in this option's
+argument. The argument of this option is the \fBkeyid\fP, a
+number specified in the \fBkeyfile\fP as this key's identifier.
+See the \fBkeyfile\fP option (\fB-k\fP) for more details.
+.TP
+.NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]broadcast\-address\f[], \f\*[B-Font]\-\-broadcast\f[]=\f\*[I-Font]broadcast\-address\f[]
+Listen to the address specified for broadcast time sync.
+This option may appear an unlimited number of times.
+.sp
+If specified \fBsntp\fP will listen to the specified address
+for NTP broadcasts. The default maximum wait time
+can (and probably should) be modified with \fB-t\fP.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]host\-name\f[], \f\*[B-Font]\-\-concurrent\f[]=\f\*[I-Font]host\-name\f[]
+Concurrently query all IPs returned for host-name.
+This option may appear an unlimited number of times.
+.sp
+Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+\fBntpd\fP, and therefore \fBsntp\fP will send queries to these IPs
+one after another, with a 2-second gap in between each query.
+.sp
+The \fB-c\fP or \fB--concurrent\fP flag says that any IPs
+returned for the DNS lookup of the supplied host-name are on
+different machines, so we can send concurrent queries.
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-g\f[] \f\*[I-Font]milliseconds\f[], \f\*[B-Font]\-\-gap\f[]=\f\*[I-Font]milliseconds\f[]
+The gap (in milliseconds) between time requests.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]milliseconds\f[]
+for this option is:
+.ti +4
+ 50
+.sp
+Since we're only going to use the first valid response we get and
+there is benefit to specifying a good number of servers to query,
+separate the queries we send out by the specified number of
+milliseconds.
+.TP
+.NOP \f\*[B-Font]\-K\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-kod\f[]=\f\*[I-Font]file\-name\f[]
+KoD history filename.
+The default
+\f\*[I-Font]file\-name\f[]
+for this option is:
+.ti +4
+ /var/db/ntp-kod
+.sp
+Specifies the filename to be used for the persistent history of KoD
+responses received from servers.
+.TP
+.NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]file\-name\f[]
+Look in this file for the key specified with \fB-a\fP.
+.sp
+This option specifies the keyfile.
+\fBsntp\fP will search for the key specified with \fB-a\fP
+\fIkeyno\fP in this file. See \fBntp.keys(5)\fP for more
+information.
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]file\-name\f[]
+Log to specified logfile.
+.sp
+This option causes the client to write log messages to the specified
+\fIlogfile\fP.
+.TP
+.NOP \f\*[B-Font]\-M\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-steplimit\f[]=\f\*[I-Font]number\f[]
+Adjustments less than \fBsteplimit\fP msec will be slewed.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]number\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+greater than or equal to 0
+.fi
+.in -4
+.sp
+If the time adjustment is less than \fIsteplimit\fP milliseconds,
+slew the amount using \fBadjtime(2)\fP. Otherwise, step the
+correction using \fBsettimeofday(2)\fP.
+.TP
+.NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
+Send \fBint\fP as our NTP protocol version.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]number\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 0 through 7
+.fi
+.in -4
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 4
+.sp
+When sending requests to a remote server, tell them we are running
+NTP protocol version \fIntpversion\fP .
+.TP
+.NOP \f\*[B-Font]\-r\f[], \f\*[B-Font]\-\-usereservedport\f[]
+Use the NTP Reserved Port (port 123).
+.sp
+Use port 123, which is reserved for NTP, for our network
+communications.
+.TP
+.NOP \f\*[B-Font]\-S\f[], \f\*[B-Font]\-\-step\f[]
+OK to 'step' the time with \fBsettimeofday(2)\fP.
+.sp
+.TP
+.NOP \f\*[B-Font]\-s\f[], \f\*[B-Font]\-\-slew\f[]
+OK to 'slew' the time with \fBadjtime(2)\fP.
+.sp
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]seconds\f[], \f\*[B-Font]\-\-timeout\f[]=\f\*[I-Font]seconds\f[]
+The number of seconds to wait for responses.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]seconds\f[]
+for this option is:
+.ti +4
+ 5
+.sp
+When waiting for a reply, \fBsntp\fP will wait the number
+of seconds specified before giving up. The default should be
+more than enough for a unicast response. If \fBsntp\fP is
+only waiting for a broadcast response a longer timeout is
+likely needed.
+.TP
+.NOP \f\*[B-Font]\-\-wait\f[], \f\*[B-Font]\- Fl \-no\-wait\f[]
+Wait for pending replies (if not setting the time).
+The \fIno\-wait\fP form will disable the option.
+This option is enabled by default.
+.sp
+If we are not setting the time, wait for all pending responses.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBSNTP_<option-name>\fP or \fBSNTP\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+.TP 7
+.NOP \f[C]sntp ntpserver.somewhere\f[]
+is the simplest use of this program
+and can be run as an unprivileged command
+to check the current time and error in the local clock.
+.TP 7
+.NOP \f[C]sntp \-a ntpserver.somewhere\f[]
+With suitable privilege,
+run as a command
+or from a
+\fCcron\fR(8)\f[]
+job,
+\f\*[B-Font]sntp \-a\f[]
+will reset the local clock from a synchronized specified server,
+like the (deprecated)
+\fCntpdate\fR(1ntpdatemdoc)\f[],
+or
+\fCrdate\fR(8)\f[]
+commands.
+.PP
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Johannes Maximilian Kuehn"
+.br
+.NOP "Harlan Stenn"
+.br
+.NOP "Dave Hart"
+.br
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP
+option definitions.
diff --git a/sntp/sntp.1sntpmdoc b/sntp/sntp.1sntpmdoc
new file mode 100644
index 0000000..f60f61f
--- /dev/null
+++ b/sntp/sntp.1sntpmdoc
@@ -0,0 +1,295 @@
+.Dd December 2 2014
+.Dt SNTP 1sntpmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:59:31 AM by AutoGen 5.18.5pre4
+.\" From the definitions sntp-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm sntp
+.Nd standard Simple Network Time Protocol client program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ hostname\-or\-IP ...]
+.Pp
+.Sh DESCRIPTION
+.Nm
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command or from a
+.Ic cron
+job.
+NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+.Pp
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+.Ic "'1996\-10\-15 20:17:25.123 (+0800) +4.567 +/\- 0.089 [host] IP sN'"
+where the
+.Ic "'(+0800)'"
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+.Ic "'+4.567'"
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+.Ic "'+/\- 0.089'"
+is the reported
+.Em synchronization distance
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+.Ic "'+/\- ?'" .
+If the
+.Em host
+is different from the
+.Em IP ,
+both will be displayed.
+Otherwise, only the
+.Em IP
+is displayed.
+Finally, the
+.Em stratum
+of the host is reported.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv6 namespace.
+.It Fl a Ar auth\-keynumber , Fl \-authentication Ns = Ns Ar auth\-keynumber
+Enable authentication with the key \fBauth\-keynumber\fP.
+This option takes an integer number as its argument.
+.sp
+Enable authentication using the key specified in this option's
+argument. The argument of this option is the \fBkeyid\fP, a
+number specified in the \fBkeyfile\fP as this key's identifier.
+See the \fBkeyfile\fP option (\fB\-k\fP) for more details.
+.It Fl b Ar broadcast\-address , Fl \-broadcast Ns = Ns Ar broadcast\-address
+Listen to the address specified for broadcast time sync.
+This option may appear an unlimited number of times.
+.sp
+If specified \fBsntp\fP will listen to the specified address
+for NTP broadcasts. The default maximum wait time
+can (and probably should) be modified with \fB\-t\fP.
+.It Fl c Ar host\-name , Fl \-concurrent Ns = Ns Ar host\-name
+Concurrently query all IPs returned for host\-name.
+This option may appear an unlimited number of times.
+.sp
+Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+\fBntpd\fP, and therefore \fBsntp\fP will send queries to these IPs
+one after another, with a 2\-second gap in between each query.
+.sp
+The \fB\-c\fP or \fB\-\-concurrent\fP flag says that any IPs
+returned for the DNS lookup of the supplied host\-name are on
+different machines, so we can send concurrent queries.
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl g Ar milliseconds , Fl \-gap Ns = Ns Ar milliseconds
+The gap (in milliseconds) between time requests.
+This option takes an integer number as its argument.
+The default
+.Ar milliseconds
+for this option is:
+.ti +4
+ 50
+.sp
+Since we're only going to use the first valid response we get and
+there is benefit to specifying a good number of servers to query,
+separate the queries we send out by the specified number of
+milliseconds.
+.It Fl K Ar file\-name , Fl \-kod Ns = Ns Ar file\-name
+KoD history filename.
+The default
+.Ar file\-name
+for this option is:
+.ti +4
+ /var/db/ntp\-kod
+.sp
+Specifies the filename to be used for the persistent history of KoD
+responses received from servers.
+.It Fl k Ar file\-name , Fl \-keyfile Ns = Ns Ar file\-name
+Look in this file for the key specified with \fB\-a\fP.
+.sp
+This option specifies the keyfile.
+\fBsntp\fP will search for the key specified with \fB\-a\fP
+\fIkeyno\fP in this file. See \fBntp.keys(5)\fP for more
+information.
+.It Fl l Ar file\-name , Fl \-logfile Ns = Ns Ar file\-name
+Log to specified logfile.
+.sp
+This option causes the client to write log messages to the specified
+\fIlogfile\fP.
+.It Fl M Ar number , Fl \-steplimit Ns = Ns Ar number
+Adjustments less than \fBsteplimit\fP msec will be slewed.
+This option takes an integer number as its argument.
+The value of
+.Ar number
+is constrained to being:
+.in +4
+.nf
+.na
+greater than or equal to 0
+.fi
+.in -4
+.sp
+If the time adjustment is less than \fIsteplimit\fP milliseconds,
+slew the amount using \fBadjtime(2)\fP. Otherwise, step the
+correction using \fBsettimeofday(2)\fP.
+.It Fl o Ar number , Fl \-ntpversion Ns = Ns Ar number
+Send \fBint\fP as our NTP protocol version.
+This option takes an integer number as its argument.
+The value of
+.Ar number
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 0 through 7
+.fi
+.in -4
+The default
+.Ar number
+for this option is:
+.ti +4
+ 4
+.sp
+When sending requests to a remote server, tell them we are running
+NTP protocol version \fIntpversion\fP .
+.It Fl r , Fl \-usereservedport
+Use the NTP Reserved Port (port 123).
+.sp
+Use port 123, which is reserved for NTP, for our network
+communications.
+.It Fl S , Fl \-step
+OK to 'step' the time with \fBsettimeofday(2)\fP.
+.sp
+.It Fl s , Fl \-slew
+OK to 'slew' the time with \fBadjtime(2)\fP.
+.sp
+.It Fl t Ar seconds , Fl \-timeout Ns = Ns Ar seconds
+The number of seconds to wait for responses.
+This option takes an integer number as its argument.
+The default
+.Ar seconds
+for this option is:
+.ti +4
+ 5
+.sp
+When waiting for a reply, \fBsntp\fP will wait the number
+of seconds specified before giving up. The default should be
+more than enough for a unicast response. If \fBsntp\fP is
+only waiting for a broadcast response a longer timeout is
+likely needed.
+.It Fl \-wait , " Fl \-no\-wait"
+Wait for pending replies (if not setting the time).
+The \fIno\-wait\fP form will disable the option.
+This option is enabled by default.
+.sp
+If we are not setting the time, wait for all pending responses.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBSNTP_<option\-name>\fP or \fBSNTP\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+.Bl -tag -width indent
+.It Li "sntp ntpserver.somewhere"
+is the simplest use of this program
+and can be run as an unprivileged command
+to check the current time and error in the local clock.
+.It Li "sntp \-a ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp \-a"
+will reset the local clock from a synchronized specified server,
+like the (deprecated)
+.Xr ntpdate 1ntpdatemdoc ,
+or
+.Xr rdate 8
+commands.
+.El
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Johannes Maximilian Kuehn"
+.An "Harlan Stenn"
+.An "Dave Hart"
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBsntp\fP
+option definitions.
diff --git a/sntp/sntp.c b/sntp/sntp.c
new file mode 100644
index 0000000..2e3bfec
--- /dev/null
+++ b/sntp/sntp.c
@@ -0,0 +1,12 @@
+#include <config.h>
+
+#include "main.h"
+
+int
+main (
+ int argc,
+ char ** argv
+ )
+{
+ return sntp_main(argc, argv, Version);
+}
diff --git a/sntp/sntp.html b/sntp/sntp.html
new file mode 100644
index 0000000..1606920
--- /dev/null
+++ b/sntp/sntp.html
@@ -0,0 +1,620 @@
+<html lang="en">
+<head>
+<title>Sntp User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Sntp User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Sntp User's Manual</h1>
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Description">sntp Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">Simple Network Time Protocol User Manual</h2>
+
+<p>This document describes the use of the NTP Project's <code>sntp</code> program,
+that can be used to query a Network Time Protocol (NTP) server and
+display the time offset of the system clock relative to the server
+clock. Run as root, it can correct the system clock to this offset as
+well. It can be run as an interactive command or from a cron job.
+
+ <p>This document applies to version 4.2.7p482 of <code>sntp</code>.
+
+ <p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
+IETF specification.
+
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Simple Network Time Protocol User Manual</a>
+</ul>
+</div>
+
+<ul class="menu">
+<li><a accesskey="1" href="#sntp-Description">sntp Description</a>: Description
+<li><a accesskey="2" href="#sntp-Invocation">sntp Invocation</a>: Invoking sntp
+<li><a accesskey="3" href="#Usage">Usage</a>: Usage
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="sntp-Description"></a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>By default, <code>sntp</code> writes the local data and time (i.e., not UTC) to the
+standard output in the format:
+
+<pre class="example"> 1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
+</pre>
+ <p>where
+YYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
+(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
+and
+the +4.567 +/- 0.089 secs indicates the time offset and
+error bound of the system clock relative to the server clock.
+
+<div class="node">
+<p><hr>
+<a name="sntp-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">Invoking sntp</h3>
+
+<p><a name="index-sntp-1"></a><a name="index-standard-Simple-Network-Time-Protocol-client-program-2"></a>
+
+ <p><code>sntp</code>
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command or from a
+<code>cron</code>
+job.
+
+ <p>NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+
+ <p>The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+
+ <p><code>'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'</code>
+
+ <p>where the
+<code>'(+0800)'</code>
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+<code>'+4.567'</code>
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+<code>'+/- 0.089'</code>
+is the reported
+<em>synchronization</em> <em>distance</em>
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+<code>'+/- ?'</code>.
+If the
+<em>host</em>
+is different from the
+<em>IP</em>,
+both will be displayed.
+Otherwise, only the
+<em>IP</em>
+is displayed.
+Finally, the
+<em>stratum</em>
+of the host is reported.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>sntp</code> program.
+This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
+
+<ul class="menu">
+<li><a accesskey="1" href="#sntp-usage">sntp usage</a>: sntp help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#sntp-ipv4">sntp ipv4</a>: ipv4 option (-4)
+<li><a accesskey="3" href="#sntp-ipv6">sntp ipv6</a>: ipv6 option (-6)
+<li><a accesskey="4" href="#sntp-authentication">sntp authentication</a>: authentication option (-a)
+<li><a accesskey="5" href="#sntp-broadcast">sntp broadcast</a>: broadcast option (-b)
+<li><a accesskey="6" href="#sntp-concurrent">sntp concurrent</a>: concurrent option (-c)
+<li><a accesskey="7" href="#sntp-gap">sntp gap</a>: gap option (-g)
+<li><a accesskey="8" href="#sntp-kod">sntp kod</a>: kod option (-K)
+<li><a accesskey="9" href="#sntp-keyfile">sntp keyfile</a>: keyfile option (-k)
+<li><a href="#sntp-logfile">sntp logfile</a>: logfile option (-l)
+<li><a href="#sntp-steplimit">sntp steplimit</a>: steplimit option (-M)
+<li><a href="#sntp-ntpversion">sntp ntpversion</a>: ntpversion option (-o)
+<li><a href="#sntp-usereservedport">sntp usereservedport</a>: usereservedport option (-r)
+<li><a href="#sntp-timeout">sntp timeout</a>: timeout option (-t)
+<li><a href="#sntp-wait">sntp wait</a>: wait option
+<li><a href="#sntp-config">sntp config</a>: presetting/configuring sntp
+<li><a href="#sntp-exit-status">sntp exit status</a>: exit status
+<li><a href="#sntp-Usage">sntp Usage</a>: Usage
+<li><a href="#sntp-Authors">sntp Authors</a>: Authors
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="sntp-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv4">sntp ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">sntp help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-sntp-help-3"></a>
+This is the automatically generated usage text for sntp.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.7p482
+Usage: sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
+ [ hostname-or-IP ...]
+ Flg Arg Option-Name Description
+ -4 no ipv4 Force IPv4 DNS name resolution
+ - prohibits the option 'ipv6'
+ -6 no ipv6 Force IPv6 DNS name resolution
+ - prohibits the option 'ipv4'
+ -a Num authentication Enable authentication with the key auth-keynumber
+ -b Str broadcast Listen to the address specified for broadcast time sync
+ - may appear multiple times
+ -c Str concurrent Concurrently query all IPs returned for host-name
+ - may appear multiple times
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -g Num gap The gap (in milliseconds) between time requests
+ -K Fil kod KoD history filename
+ -k Fil keyfile Look in this file for the key specified with -a
+ -l Fil logfile Log to specified logfile
+ -M Num steplimit Adjustments less than steplimit msec will be slewed
+ - it must be in the range:
+ greater than or equal to 0
+ -o Num ntpversion Send int as our NTP protocol version
+ - it must be in the range:
+ 0 to 7
+ -r no usereservedport Use the NTP Reserved Port (port 123)
+ -S no step OK to 'step' the time with settimeofday(2)
+ -s no slew OK to 'slew' the time with adjtime(2)
+ -t Num timeout The number of seconds to wait for responses
+ no wait Wait for pending replies (if not setting the time)
+ - disabled as '--no-wait'
+ - enabled by default
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -&gt; opt save-opts save the option state to a config file
+ -&lt; Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named SNTP_*
+
+Please send bug reports to: &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
+</pre>
+ <div class="node">
+<p><hr>
+<a name="sntp-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv6">sntp ipv6</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-usage">sntp usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv4 option (-4)</h4>
+
+<p><a name="index-sntp_002dipv4-4"></a>
+This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv6.
+</ul>
+
+ <p>Force DNS resolution of the following host names on the command line
+to the IPv4 namespace.
+<div class="node">
+<p><hr>
+<a name="sntp-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-authentication">sntp authentication</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ipv4">sntp ipv4</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ipv6 option (-6)</h4>
+
+<p><a name="index-sntp_002dipv6-5"></a>
+This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must not appear in combination with any of the following options:
+ipv4.
+</ul>
+
+ <p>Force DNS resolution of the following host names on the command line
+to the IPv6 namespace.
+<div class="node">
+<p><hr>
+<a name="sntp-authentication"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-broadcast">sntp broadcast</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ipv6">sntp ipv6</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">authentication option (-a)</h4>
+
+<p><a name="index-sntp_002dauthentication-6"></a>
+This is the &ldquo;enable authentication with the key <var>auth-keynumber</var>&rdquo; option.
+This option takes a number argument <span class="file">auth-keynumber</span>.
+Enable authentication using the key specified in this option's
+argument. The argument of this option is the <span class="option">keyid</span>, a
+number specified in the <span class="option">keyfile</span> as this key's identifier.
+See the <span class="option">keyfile</span> option (<span class="option">-k</span>) for more details.
+<div class="node">
+<p><hr>
+<a name="sntp-broadcast"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-concurrent">sntp concurrent</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-authentication">sntp authentication</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">broadcast option (-b)</h4>
+
+<p><a name="index-sntp_002dbroadcast-7"></a>
+This is the &ldquo;listen to the address specified for broadcast time sync&rdquo; option.
+This option takes a string argument <span class="file">broadcast-address</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>If specified <code>sntp</code> will listen to the specified address
+for NTP broadcasts. The default maximum wait time
+can (and probably should) be modified with <span class="option">-t</span>.
+<div class="node">
+<p><hr>
+<a name="sntp-concurrent"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-gap">sntp gap</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-broadcast">sntp broadcast</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">concurrent option (-c)</h4>
+
+<p><a name="index-sntp_002dconcurrent-8"></a>
+This is the &ldquo;concurrently query all ips returned for host-name&rdquo; option.
+This option takes a string argument <span class="file">host-name</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>may appear an unlimited number of times.
+</ul>
+
+ <p>Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+<code>ntpd</code>, and therefore <code>sntp</code> will send queries to these IPs
+one after another, with a 2-second gap in between each query.
+
+ <p>The <span class="option">-c</span> or <span class="option">--concurrent</span> flag says that any IPs
+returned for the DNS lookup of the supplied host-name are on
+different machines, so we can send concurrent queries.
+<div class="node">
+<p><hr>
+<a name="sntp-gap"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-kod">sntp kod</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-concurrent">sntp concurrent</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">gap option (-g)</h4>
+
+<p><a name="index-sntp_002dgap-9"></a>
+This is the &ldquo;the gap (in milliseconds) between time requests&rdquo; option.
+This option takes a number argument <span class="file">milliseconds</span>.
+Since we're only going to use the first valid response we get and
+there is benefit to specifying a good number of servers to query,
+separate the queries we send out by the specified number of
+milliseconds.
+<div class="node">
+<p><hr>
+<a name="sntp-kod"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-keyfile">sntp keyfile</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-gap">sntp gap</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">kod option (-K)</h4>
+
+<p><a name="index-sntp_002dkod-10"></a>
+This is the &ldquo;kod history filename&rdquo; option.
+This option takes a file argument <span class="file">file-name</span>.
+Specifies the filename to be used for the persistent history of KoD
+responses received from servers.
+<div class="node">
+<p><hr>
+<a name="sntp-keyfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-logfile">sntp logfile</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-kod">sntp kod</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">keyfile option (-k)</h4>
+
+<p><a name="index-sntp_002dkeyfile-11"></a>
+This is the &ldquo;look in this file for the key specified with <span class="option">-a</span>&rdquo; option.
+This option takes a file argument <span class="file">file-name</span>.
+This option specifies the keyfile.
+<code>sntp</code> will search for the key specified with <span class="option">-a</span>
+<span class="file">keyno</span> in this file. See <span class="command">ntp.keys(5)</span> for more
+information.
+<div class="node">
+<p><hr>
+<a name="sntp-logfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-steplimit">sntp steplimit</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-keyfile">sntp keyfile</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">logfile option (-l)</h4>
+
+<p><a name="index-sntp_002dlogfile-12"></a>
+This is the &ldquo;log to specified logfile&rdquo; option.
+This option takes a file argument <span class="file">file-name</span>.
+This option causes the client to write log messages to the specified
+<span class="file">logfile</span>.
+<div class="node">
+<p><hr>
+<a name="sntp-steplimit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ntpversion">sntp ntpversion</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-logfile">sntp logfile</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">steplimit option (-M)</h4>
+
+<p><a name="index-sntp_002dsteplimit-13"></a>
+This is the &ldquo;adjustments less than <var>steplimit</var> msec will be slewed&rdquo; option.
+This option takes a number argument.
+If the time adjustment is less than <span class="file">steplimit</span> milliseconds,
+slew the amount using <span class="command">adjtime(2)</span>. Otherwise, step the
+correction using <span class="command">settimeofday(2)</span>.
+<div class="node">
+<p><hr>
+<a name="sntp-ntpversion"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-usereservedport">sntp usereservedport</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-steplimit">sntp steplimit</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntpversion option (-o)</h4>
+
+<p><a name="index-sntp_002dntpversion-14"></a>
+This is the &ldquo;send <var>int</var> as our ntp protocol version&rdquo; option.
+This option takes a number argument.
+When sending requests to a remote server, tell them we are running
+NTP protocol version <span class="file">ntpversion</span> .
+<div class="node">
+<p><hr>
+<a name="sntp-usereservedport"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-timeout">sntp timeout</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ntpversion">sntp ntpversion</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">usereservedport option (-r)</h4>
+
+<p><a name="index-sntp_002dusereservedport-15"></a>
+This is the &ldquo;use the ntp reserved port (port 123)&rdquo; option.
+Use port 123, which is reserved for NTP, for our network
+communications.
+<div class="node">
+<p><hr>
+<a name="sntp-timeout"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-wait">sntp wait</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-usereservedport">sntp usereservedport</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">timeout option (-t)</h4>
+
+<p><a name="index-sntp_002dtimeout-16"></a>
+This is the &ldquo;the number of seconds to wait for responses&rdquo; option.
+This option takes a number argument <span class="file">seconds</span>.
+When waiting for a reply, <code>sntp</code> will wait the number
+of seconds specified before giving up. The default should be
+more than enough for a unicast response. If <code>sntp</code> is
+only waiting for a broadcast response a longer timeout is
+likely needed.
+<div class="node">
+<p><hr>
+<a name="sntp-wait"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-config">sntp config</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-timeout">sntp timeout</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">wait option</h4>
+
+<p><a name="index-sntp_002dwait-17"></a>
+This is the &ldquo;wait for pending replies (if not setting the time)&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>can be disabled with &ndash;no-wait.
+<li>It is enabled by default.
+</ul>
+
+ <p>If we are not setting the time, wait for all pending responses.
+
+<div class="node">
+<p><hr>
+<a name="sntp-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-exit-status">sntp exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-wait">sntp wait</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">presetting/configuring sntp</h4>
+
+<p>Any option that is not marked as <i>not presettable</i> may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named <code>SNTP</code> and <code>SNTP_&lt;OPTION_NAME&gt;</code>. <code>&lt;OPTION_NAME&gt;</code> must be one of
+the options listed above in upper case and segmented with underscores.
+The <code>SNTP</code> variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+<p class="noindent"><code>libopts</code> will search in 2 places for configuration files:
+ <ul>
+<li>$HOME
+<li>$PWD
+</ul>
+ The environment variables <code>HOME</code>, and <code>PWD</code>
+are expanded and replaced when <span class="file">sntp</span> runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named <span class="file">.ntprc</span> is searched for
+within that directory and processed.
+
+ <p>Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+ <p>Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+<pre class="example"> [SNTP]
+</pre>
+ <p class="noindent">or by
+<pre class="example"> &lt;?program sntp&gt;
+</pre>
+ <p class="noindent">Do not mix these styles within one configuration file.
+
+ <p>Compound values and carefully constructed string values may also be
+specified using XML syntax:
+<pre class="example"> &lt;option-name&gt;
+ &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
+ &lt;/option-name&gt;
+</pre>
+ <p class="noindent">yielding an <code>option-name.sub-opt</code> string value of
+<pre class="example"> "...&lt;...&gt;..."
+</pre>
+ <p><code>AutoOpts</code> does not track suboptions. You simply note that it is a
+hierarchicly valued option. <code>AutoOpts</code> does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+ <p>The command line options relating to configuration and/or usage help are:
+
+<h5 class="subsubheading">version (-)</h5>
+
+<p>Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+ <dl>
+<dt><span class="samp">version</span><dd>Only print the version. This is the default.
+<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
+<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
+</dl>
+
+<div class="node">
+<p><hr>
+<a name="sntp-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Usage">sntp Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-config">sntp config</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">sntp exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+<br><dt><span class="samp">66 (EX_NOINPUT)</span><dd>A specified configuration file could not be loaded.
+<br><dt><span class="samp">70 (EX_SOFTWARE)</span><dd>libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+</dl>
+ <div class="node">
+<p><hr>
+<a name="sntp-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Authors">sntp Authors</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-exit-status">sntp exit status</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">sntp Usage</h4>
+
+<div class="node">
+<p><hr>
+<a name="sntp-Authors"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-Usage">sntp Usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">sntp Authors</h4>
+
+<div class="node">
+<p><hr>
+<a name="Usage"></a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Usage</h3>
+
+<p>The simplest use of this program is as an unprivileged command to
+check the current time, offset, and error in the local clock.
+For example:
+
+<pre class="example"> sntp ntpserver.somewhere
+</pre>
+ <p>With suitable privilege, it can be run as a command or in a
+<code>crom</code> job to reset the local clock from a reliable server, like
+the <code>ntpdate</code> and <code>rdate</code> commands.
+For example:
+
+<pre class="example"> sntp -a ntpserver.somewhere
+</pre>
+ </body></html>
+
diff --git a/sntp/sntp.man.in b/sntp/sntp.man.in
new file mode 100644
index 0000000..5d54a30
--- /dev/null
+++ b/sntp/sntp.man.in
@@ -0,0 +1,339 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH sntp @SNTP_MS@ "02 Dec 2014" "4.2.7p482" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-GgaaeT/ag-5ga4cT)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:59:25 AM by AutoGen 5.18.5pre4
+.\" From the definitions sntp-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]sntp\fP
+\- standard Simple Network Time Protocol client program
+.SH SYNOPSIS
+\f\*[B-Font]sntp\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+[ hostname-or-IP ...]
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+\f\*[B-Font]sntp\fP
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command or from a
+\f\*[B-Font]cron\f[]
+job.
+NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+.sp \n(Ppu
+.ne 2
+
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+\f\*[B-Font]'1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN'\f[]
+where the
+\f\*[B-Font]'(+0800)'\f[]
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+\f\*[B-Font]'+4.567'\f[]
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+\f\*[B-Font]'+/- 0.089'\f[]
+is the reported
+\fIsynchronization\f[] \fIdistance\f[]
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+\f\*[B-Font]'+/- ?'\f[].
+If the
+\fIhost\f[]
+is different from the
+\fIIP\f[],
+both will be displayed.
+Otherwise, only the
+\fIIP\f[]
+is displayed.
+Finally, the
+\fIstratum\f[]
+of the host is reported.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[]
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv4 namespace.
+.TP
+.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[]
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv6 namespace.
+.TP
+.NOP \f\*[B-Font]\-a\f[] \f\*[I-Font]auth\-keynumber\f[], \f\*[B-Font]\-\-authentication\f[]=\f\*[I-Font]auth\-keynumber\f[]
+Enable authentication with the key \fBauth-keynumber\fP.
+This option takes an integer number as its argument.
+.sp
+Enable authentication using the key specified in this option's
+argument. The argument of this option is the \fBkeyid\fP, a
+number specified in the \fBkeyfile\fP as this key's identifier.
+See the \fBkeyfile\fP option (\fB-k\fP) for more details.
+.TP
+.NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]broadcast\-address\f[], \f\*[B-Font]\-\-broadcast\f[]=\f\*[I-Font]broadcast\-address\f[]
+Listen to the address specified for broadcast time sync.
+This option may appear an unlimited number of times.
+.sp
+If specified \fBsntp\fP will listen to the specified address
+for NTP broadcasts. The default maximum wait time
+can (and probably should) be modified with \fB-t\fP.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]host\-name\f[], \f\*[B-Font]\-\-concurrent\f[]=\f\*[I-Font]host\-name\f[]
+Concurrently query all IPs returned for host-name.
+This option may appear an unlimited number of times.
+.sp
+Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+\fBntpd\fP, and therefore \fBsntp\fP will send queries to these IPs
+one after another, with a 2-second gap in between each query.
+.sp
+The \fB-c\fP or \fB--concurrent\fP flag says that any IPs
+returned for the DNS lookup of the supplied host-name are on
+different machines, so we can send concurrent queries.
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-g\f[] \f\*[I-Font]milliseconds\f[], \f\*[B-Font]\-\-gap\f[]=\f\*[I-Font]milliseconds\f[]
+The gap (in milliseconds) between time requests.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]milliseconds\f[]
+for this option is:
+.ti +4
+ 50
+.sp
+Since we're only going to use the first valid response we get and
+there is benefit to specifying a good number of servers to query,
+separate the queries we send out by the specified number of
+milliseconds.
+.TP
+.NOP \f\*[B-Font]\-K\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-kod\f[]=\f\*[I-Font]file\-name\f[]
+KoD history filename.
+The default
+\f\*[I-Font]file\-name\f[]
+for this option is:
+.ti +4
+ /var/db/ntp-kod
+.sp
+Specifies the filename to be used for the persistent history of KoD
+responses received from servers.
+.TP
+.NOP \f\*[B-Font]\-k\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-keyfile\f[]=\f\*[I-Font]file\-name\f[]
+Look in this file for the key specified with \fB-a\fP.
+.sp
+This option specifies the keyfile.
+\fBsntp\fP will search for the key specified with \fB-a\fP
+\fIkeyno\fP in this file. See \fBntp.keys(5)\fP for more
+information.
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]file\-name\f[], \f\*[B-Font]\-\-logfile\f[]=\f\*[I-Font]file\-name\f[]
+Log to specified logfile.
+.sp
+This option causes the client to write log messages to the specified
+\fIlogfile\fP.
+.TP
+.NOP \f\*[B-Font]\-M\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-steplimit\f[]=\f\*[I-Font]number\f[]
+Adjustments less than \fBsteplimit\fP msec will be slewed.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]number\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+greater than or equal to 0
+.fi
+.in -4
+.sp
+If the time adjustment is less than \fIsteplimit\fP milliseconds,
+slew the amount using \fBadjtime(2)\fP. Otherwise, step the
+correction using \fBsettimeofday(2)\fP.
+.TP
+.NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-ntpversion\f[]=\f\*[I-Font]number\f[]
+Send \fBint\fP as our NTP protocol version.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]number\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 0 through 7
+.fi
+.in -4
+The default
+\f\*[I-Font]number\f[]
+for this option is:
+.ti +4
+ 4
+.sp
+When sending requests to a remote server, tell them we are running
+NTP protocol version \fIntpversion\fP .
+.TP
+.NOP \f\*[B-Font]\-r\f[], \f\*[B-Font]\-\-usereservedport\f[]
+Use the NTP Reserved Port (port 123).
+.sp
+Use port 123, which is reserved for NTP, for our network
+communications.
+.TP
+.NOP \f\*[B-Font]\-S\f[], \f\*[B-Font]\-\-step\f[]
+OK to 'step' the time with \fBsettimeofday(2)\fP.
+.sp
+.TP
+.NOP \f\*[B-Font]\-s\f[], \f\*[B-Font]\-\-slew\f[]
+OK to 'slew' the time with \fBadjtime(2)\fP.
+.sp
+.TP
+.NOP \f\*[B-Font]\-t\f[] \f\*[I-Font]seconds\f[], \f\*[B-Font]\-\-timeout\f[]=\f\*[I-Font]seconds\f[]
+The number of seconds to wait for responses.
+This option takes an integer number as its argument.
+The default
+\f\*[I-Font]seconds\f[]
+for this option is:
+.ti +4
+ 5
+.sp
+When waiting for a reply, \fBsntp\fP will wait the number
+of seconds specified before giving up. The default should be
+more than enough for a unicast response. If \fBsntp\fP is
+only waiting for a broadcast response a longer timeout is
+likely needed.
+.TP
+.NOP \f\*[B-Font]\-\-wait\f[], \f\*[B-Font]\- Fl \-no\-wait\f[]
+Wait for pending replies (if not setting the time).
+The \fIno\-wait\fP form will disable the option.
+This option is enabled by default.
+.sp
+If we are not setting the time, wait for all pending responses.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBSNTP_<option-name>\fP or \fBSNTP\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+.TP 7
+.NOP \f[C]sntp ntpserver.somewhere\f[]
+is the simplest use of this program
+and can be run as an unprivileged command
+to check the current time and error in the local clock.
+.TP 7
+.NOP \f[C]sntp \-a ntpserver.somewhere\f[]
+With suitable privilege,
+run as a command
+or from a
+\fCcron\fR(8)\f[]
+job,
+\f\*[B-Font]sntp \-a\f[]
+will reset the local clock from a synchronized specified server,
+like the (deprecated)
+\fCntpdate\fR(@NTPDATE_MS@)\f[],
+or
+\fCrdate\fR(8)\f[]
+commands.
+.PP
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH AUTHORS
+.NOP "Johannes Maximilian Kuehn"
+.br
+.NOP "Harlan Stenn"
+.br
+.NOP "Dave Hart"
+.br
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH "NOTES"
+This manual page was \fIAutoGen\fP-erated from the \fBsntp\fP
+option definitions.
diff --git a/sntp/sntp.mdoc.in b/sntp/sntp.mdoc.in
new file mode 100644
index 0000000..13c768f
--- /dev/null
+++ b/sntp/sntp.mdoc.in
@@ -0,0 +1,295 @@
+.Dd December 2 2014
+.Dt SNTP @SNTP_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:59:31 AM by AutoGen 5.18.5pre4
+.\" From the definitions sntp-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm sntp
+.Nd standard Simple Network Time Protocol client program
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+[ hostname\-or\-IP ...]
+.Pp
+.Sh DESCRIPTION
+.Nm
+can be used as an SNTP client to query a NTP or SNTP server and either display
+the time or set the local system's time (given suitable privilege). It can be
+run as an interactive command or from a
+.Ic cron
+job.
+NTP (the Network Time Protocol) and SNTP (the Simple Network Time Protocol)
+are defined and described by RFC 5905.
+.Pp
+The default is to write the estimated correct local date and time (i.e. not
+UTC) to the standard output in a format like:
+.Ic "'1996\-10\-15 20:17:25.123 (+0800) +4.567 +/\- 0.089 [host] IP sN'"
+where the
+.Ic "'(+0800)'"
+means that to get to UTC from the reported local time one must
+add 8 hours and 0 minutes,
+the
+.Ic "'+4.567'"
+indicates the local clock is 4.567 seconds behind the correct time
+(so 4.567 seconds must be added to the local clock to get it to be correct).
+Note that the number of decimals printed for this value will change
+based on the reported precision of the server.
+.Ic "'+/\- 0.089'"
+is the reported
+.Em synchronization distance
+(in seconds), which represents the maximum error due to all causes.
+If the server does not report valid data needed to calculate the
+synchronization distance, this will be reported as
+.Ic "'+/\- ?'" .
+If the
+.Em host
+is different from the
+.Em IP ,
+both will be displayed.
+Otherwise, only the
+.Em IP
+is displayed.
+Finally, the
+.Em stratum
+of the host is reported.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl 4 , Fl \-ipv4
+Force IPv4 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv6.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv4 namespace.
+.It Fl 6 , Fl \-ipv6
+Force IPv6 DNS name resolution.
+This option must not appear in combination with any of the following options:
+ipv4.
+.sp
+Force DNS resolution of the following host names on the command line
+to the IPv6 namespace.
+.It Fl a Ar auth\-keynumber , Fl \-authentication Ns = Ns Ar auth\-keynumber
+Enable authentication with the key \fBauth\-keynumber\fP.
+This option takes an integer number as its argument.
+.sp
+Enable authentication using the key specified in this option's
+argument. The argument of this option is the \fBkeyid\fP, a
+number specified in the \fBkeyfile\fP as this key's identifier.
+See the \fBkeyfile\fP option (\fB\-k\fP) for more details.
+.It Fl b Ar broadcast\-address , Fl \-broadcast Ns = Ns Ar broadcast\-address
+Listen to the address specified for broadcast time sync.
+This option may appear an unlimited number of times.
+.sp
+If specified \fBsntp\fP will listen to the specified address
+for NTP broadcasts. The default maximum wait time
+can (and probably should) be modified with \fB\-t\fP.
+.It Fl c Ar host\-name , Fl \-concurrent Ns = Ns Ar host\-name
+Concurrently query all IPs returned for host\-name.
+This option may appear an unlimited number of times.
+.sp
+Requests from an NTP "client" to a "server" should never be sent
+more rapidly than one every 2 seconds. By default, any IPs returned
+as part of a DNS lookup are assumed to be for a single instance of
+\fBntpd\fP, and therefore \fBsntp\fP will send queries to these IPs
+one after another, with a 2\-second gap in between each query.
+.sp
+The \fB\-c\fP or \fB\-\-concurrent\fP flag says that any IPs
+returned for the DNS lookup of the supplied host\-name are on
+different machines, so we can send concurrent queries.
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl g Ar milliseconds , Fl \-gap Ns = Ns Ar milliseconds
+The gap (in milliseconds) between time requests.
+This option takes an integer number as its argument.
+The default
+.Ar milliseconds
+for this option is:
+.ti +4
+ 50
+.sp
+Since we're only going to use the first valid response we get and
+there is benefit to specifying a good number of servers to query,
+separate the queries we send out by the specified number of
+milliseconds.
+.It Fl K Ar file\-name , Fl \-kod Ns = Ns Ar file\-name
+KoD history filename.
+The default
+.Ar file\-name
+for this option is:
+.ti +4
+ /var/db/ntp\-kod
+.sp
+Specifies the filename to be used for the persistent history of KoD
+responses received from servers.
+.It Fl k Ar file\-name , Fl \-keyfile Ns = Ns Ar file\-name
+Look in this file for the key specified with \fB\-a\fP.
+.sp
+This option specifies the keyfile.
+\fBsntp\fP will search for the key specified with \fB\-a\fP
+\fIkeyno\fP in this file. See \fBntp.keys(5)\fP for more
+information.
+.It Fl l Ar file\-name , Fl \-logfile Ns = Ns Ar file\-name
+Log to specified logfile.
+.sp
+This option causes the client to write log messages to the specified
+\fIlogfile\fP.
+.It Fl M Ar number , Fl \-steplimit Ns = Ns Ar number
+Adjustments less than \fBsteplimit\fP msec will be slewed.
+This option takes an integer number as its argument.
+The value of
+.Ar number
+is constrained to being:
+.in +4
+.nf
+.na
+greater than or equal to 0
+.fi
+.in -4
+.sp
+If the time adjustment is less than \fIsteplimit\fP milliseconds,
+slew the amount using \fBadjtime(2)\fP. Otherwise, step the
+correction using \fBsettimeofday(2)\fP.
+.It Fl o Ar number , Fl \-ntpversion Ns = Ns Ar number
+Send \fBint\fP as our NTP protocol version.
+This option takes an integer number as its argument.
+The value of
+.Ar number
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 0 through 7
+.fi
+.in -4
+The default
+.Ar number
+for this option is:
+.ti +4
+ 4
+.sp
+When sending requests to a remote server, tell them we are running
+NTP protocol version \fIntpversion\fP .
+.It Fl r , Fl \-usereservedport
+Use the NTP Reserved Port (port 123).
+.sp
+Use port 123, which is reserved for NTP, for our network
+communications.
+.It Fl S , Fl \-step
+OK to 'step' the time with \fBsettimeofday(2)\fP.
+.sp
+.It Fl s , Fl \-slew
+OK to 'slew' the time with \fBadjtime(2)\fP.
+.sp
+.It Fl t Ar seconds , Fl \-timeout Ns = Ns Ar seconds
+The number of seconds to wait for responses.
+This option takes an integer number as its argument.
+The default
+.Ar seconds
+for this option is:
+.ti +4
+ 5
+.sp
+When waiting for a reply, \fBsntp\fP will wait the number
+of seconds specified before giving up. The default should be
+more than enough for a unicast response. If \fBsntp\fP is
+only waiting for a broadcast response a longer timeout is
+likely needed.
+.It Fl \-wait , " Fl \-no\-wait"
+Wait for pending replies (if not setting the time).
+The \fIno\-wait\fP form will disable the option.
+This option is enabled by default.
+.sp
+If we are not setting the time, wait for all pending responses.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBSNTP_<option\-name>\fP or \fBSNTP\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+.Bl -tag -width indent
+.It Li "sntp ntpserver.somewhere"
+is the simplest use of this program
+and can be run as an unprivileged command
+to check the current time and error in the local clock.
+.It Li "sntp \-a ntpserver.somewhere"
+With suitable privilege,
+run as a command
+or from a
+.Xr cron 8
+job,
+.Ic "sntp \-a"
+will reset the local clock from a synchronized specified server,
+like the (deprecated)
+.Xr ntpdate @NTPDATE_MS@ ,
+or
+.Xr rdate 8
+commands.
+.El
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh AUTHORS
+.An "Johannes Maximilian Kuehn"
+.An "Harlan Stenn"
+.An "Dave Hart"
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh "BUGS"
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh "NOTES"
+This manual page was \fIAutoGen\fP\-erated from the \fBsntp\fP
+option definitions.
diff --git a/sntp/sntp.texi b/sntp/sntp.texi
new file mode 100644
index 0000000..123eed3
--- /dev/null
+++ b/sntp/sntp.texi
@@ -0,0 +1,88 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename sntp.info
+@settitle Sntp User's Manual
+@include include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of the NTP Project's SNTP, a program for
+querying and setting the time.
+@end ifinfo
+
+@direntry
+* sntp: (sntp). Simple Network Time Protocol
+@end direntry
+
+@titlepage
+@title Simple Network Time Protocol User's Manual
+@subtitle sntp, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@node Top, sntp Description, (dir), (dir)
+@top Simple Network Time Protocol User Manual
+
+This document describes the use of the NTP Project's @code{sntp} program,
+that can be used to query a Network Time Protocol (NTP) server and
+display the time offset of the system clock relative to the server
+clock. Run as root, it can correct the system clock to this offset as
+well. It can be run as an interactive command or from a cron job.
+
+This document applies to version @value{VERSION} of @code{sntp}.
+
+The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
+IETF specification.
+
+@shortcontents
+
+@menu
+* sntp Description:: Description
+* sntp Invocation:: Invoking sntp
+* Usage:: Usage
+@end menu
+
+@node sntp Description
+@comment node-name, next, previous, up
+@section Description
+
+By default, @code{sntp} writes the local data and time (i.e., not UTC) to the
+standard output in the format:
+
+@example
+1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 secs
+@end example
+
+where
+YYYY-MM-DD HH:MM:SS.SUBSEC is the local date and time,
+(+0800) is the local timezone adjustment (so we would add 8 hours and 0 minutes to convert the reported local time to UTC),
+and
+the +4.567 +/- 0.089 secs indicates the time offset and
+error bound of the system clock relative to the server clock.
+
+@include invoke-sntp.texi
+
+@node Usage
+@comment node-name, next, previous, up
+@section Usage
+
+The simplest use of this program is as an unprivileged command to
+check the current time, offset, and error in the local clock.
+For example:
+
+@example
+sntp ntpserver.somewhere
+@end example
+
+With suitable privilege, it can be run as a command or in a
+@code{crom} job to reset the local clock from a reliable server, like
+the @code{ntpdate} and @code{rdate} commands.
+For example:
+
+@example
+sntp -a ntpserver.somewhere
+@end example
diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am
new file mode 100644
index 0000000..feb9142
--- /dev/null
+++ b/sntp/tests/Makefile.am
@@ -0,0 +1,111 @@
+NULL =
+BUILT_SOURCES =
+
+check_PROGRAMS =
+if BUILD_SNTP
+check_PROGRAMS += tests
+endif
+
+base_SOURCES = \
+ $(srcdir)/../tests_main.cpp \
+ $(NULL)
+
+tests_SOURCES = \
+ $(base_SOURCES) \
+ crypto.cpp \
+ keyFile.cpp \
+ kodDatabase.cpp \
+ kodFile.cpp \
+ networking.cpp \
+ packetHandling.cpp \
+ packetProcessing.cpp \
+ utilities.cpp \
+ $(NULL)
+
+noinst_HEADERS = \
+ sntptest.h \
+ fileHandlingTest.h \
+ $(NULL)
+
+dist_check_SCRIPTS = tests-runner
+
+EXTRA_DIST = \
+ data/debug-input-lfp-bin \
+ data/debug-input-lfp-dec \
+ data/debug-input-pkt \
+ data/key-test-ascii \
+ data/key-test-comments \
+ data/key-test-empty \
+ data/key-test-hex \
+ data/key-test-invalid-hex \
+ data/kod-expected-multiple \
+ data/kod-expected-single \
+ data/kod-test-blanks \
+ data/kod-test-correct \
+ data/kod-test-empty \
+ $(NULL)
+
+CLEANFILES = \
+ 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)
+
+LDADD = \
+ ../libsntp.a \
+ $(LIBOPTS_LDADD) \
+ $(LDADD_LIBEVENT) \
+ $(top_builddir)/../libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(LDADD_NTP) \
+ $(GTEST_LDFLAGS) \
+ $(GTEST_LIBS) \
+ $(NULL)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CXXFLAGS = $(GTEST_CXXFLAGS)
+
+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_LDFLAGS = $(LDFLAGS_NTP)
+
+TESTS =
+
+if !NTP_CROSSCOMPILE
+TESTS += tests-runner
+endif
+
+## ensure ../libsntp.a is built
+
+BUILT_SOURCES += check-libsntp
+CLEANFILES += check-libsntp
+
+check-libsntp: ../libsntp.a
+ @echo stamp > $@
+
+../libsntp.a:
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) libsntp.a
+
+## check-libntp.mf - automake fragment
+## slightly adapted for deeper directory
+
+BUILT_SOURCES += check-libntp
+CLEANFILES += check-libntp
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/sntp/tests/Makefile.in b/sntp/tests/Makefile.in
new file mode 100644
index 0000000..c123282
--- /dev/null
+++ b/sntp/tests/Makefile.in
@@ -0,0 +1,898 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = $(am__EXEEXT_1)
+@BUILD_SNTP_TRUE@am__append_1 = tests
+@NTP_CROSSCOMPILE_FALSE@am__append_2 = tests-runner
+DIST_COMMON = $(dist_check_SCRIPTS) $(noinst_HEADERS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf
+subdir = tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
+ $(top_srcdir)/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/libevent/m4/openldap.m4 \
+ $(top_srcdir)/m4/hms_search_lib.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/m4/ntp_compiler.m4 \
+ $(top_srcdir)/m4/ntp_crosscompile.m4 \
+ $(top_srcdir)/m4/ntp_debug.m4 $(top_srcdir)/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/m4/ntp_googletest.m4 \
+ $(top_srcdir)/m4/ntp_ipv6.m4 $(top_srcdir)/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/m4/ntp_libevent.m4 \
+ $(top_srcdir)/m4/ntp_libntp.m4 \
+ $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/m4/ntp_openssl.m4 \
+ $(top_srcdir)/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/m4/ntp_prog_cc.m4 $(top_srcdir)/m4/ntp_sntp.m4 \
+ $(top_srcdir)/m4/ntp_sysexits.m4 \
+ $(top_srcdir)/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/m4/snprintf.m4 \
+ $(top_srcdir)/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@BUILD_SNTP_TRUE@am__EXEEXT_1 = tests$(EXEEXT)
+am__objects_1 =
+am__objects_2 = tests_main.$(OBJEXT) $(am__objects_1)
+am_tests_OBJECTS = $(am__objects_2) crypto.$(OBJEXT) keyFile.$(OBJEXT) \
+ kodDatabase.$(OBJEXT) kodFile.$(OBJEXT) networking.$(OBJEXT) \
+ packetHandling.$(OBJEXT) packetProcessing.$(OBJEXT) \
+ utilities.$(OBJEXT) $(am__objects_1)
+tests_OBJECTS = $(am_tests_OBJECTS)
+tests_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+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) \
+ $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/libevent/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+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_$(V))
+am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
+am__v_CXX_0 = @echo " CXX " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(tests_SOURCES)
+DIST_SOURCES = $(tests_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+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@
+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_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@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIB_SYSLOG = @LIB_SYSLOG@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+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_FORCE_LIBEVENT_DIST = @NTP_FORCE_LIBEVENT_DIST@
+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_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_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+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@
+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@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+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 = check-libsntp check-libntp .deps-ver
+base_SOURCES = \
+ $(srcdir)/../tests_main.cpp \
+ $(NULL)
+
+tests_SOURCES = \
+ $(base_SOURCES) \
+ crypto.cpp \
+ keyFile.cpp \
+ kodDatabase.cpp \
+ kodFile.cpp \
+ networking.cpp \
+ packetHandling.cpp \
+ packetProcessing.cpp \
+ utilities.cpp \
+ $(NULL)
+
+noinst_HEADERS = \
+ sntptest.h \
+ fileHandlingTest.h \
+ $(NULL)
+
+dist_check_SCRIPTS = tests-runner
+EXTRA_DIST = \
+ data/debug-input-lfp-bin \
+ data/debug-input-lfp-dec \
+ data/debug-input-pkt \
+ data/key-test-ascii \
+ data/key-test-comments \
+ data/key-test-empty \
+ data/key-test-hex \
+ data/key-test-invalid-hex \
+ data/kod-expected-multiple \
+ data/kod-expected-single \
+ data/kod-test-blanks \
+ data/kod-test-correct \
+ data/kod-test-empty \
+ $(NULL)
+
+CLEANFILES = 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 .deps-ver
+LDADD = \
+ ../libsntp.a \
+ $(LIBOPTS_LDADD) \
+ $(LDADD_LIBEVENT) \
+ $(top_builddir)/../libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(LDADD_NTP) \
+ $(GTEST_LDFLAGS) \
+ $(GTEST_LIBS) \
+ $(NULL)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CXXFLAGS = $(GTEST_CXXFLAGS)
+AM_CPPFLAGS = $(SNTP_INCS) -I$(srcdir)/.. -I$(top_srcdir)/../tests \
+ $(LIBOPTS_CFLAGS) $(CPPFLAGS_LIBEVENT) $(GTEST_CPPFLAGS) \
+ $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+TESTS = $(am__append_2)
+SNTP_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: .cpp .lo .o .obj
+$(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/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-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
+tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES)
+ @rm -f tests$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/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)/tests_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilities.Po@am__quote@
+
+.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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+tests_main.o: $(srcdir)/../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 '$(srcdir)/../tests_main.cpp' || echo '$(srcdir)/'`$(srcdir)/../tests_main.cpp
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(srcdir)/../tests_main.cpp' object='tests_main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.o `test -f '$(srcdir)/../tests_main.cpp' || echo '$(srcdir)/'`$(srcdir)/../tests_main.cpp
+
+tests_main.obj: $(srcdir)/../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 '$(srcdir)/../tests_main.cpp'; then $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../tests_main.cpp'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(srcdir)/../tests_main.cpp' object='tests_main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.obj `if test -f '$(srcdir)/../tests_main.cpp'; then $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../tests_main.cpp'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes$$std"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+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) \
+ $(dist_check_SCRIPTS)
+ $(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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-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 all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+check-libsntp: ../libsntp.a
+ @echo stamp > $@
+
+../libsntp.a:
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) libsntp.a
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/sntp/tests/crypto.cpp b/sntp/tests/crypto.cpp
new file mode 100644
index 0000000..a6f89f5
--- /dev/null
+++ b/sntp/tests/crypto.cpp
@@ -0,0 +1,129 @@
+#include "sntptest.h"
+
+extern "C" {
+#include "crypto.h"
+};
+
+class cryptoTest : public sntptest {
+};
+
+#define MD5_LENGTH 16
+#define SHA1_LENGTH 20
+
+TEST_F(cryptoTest, MakeMd5Mac) {
+
+ const char* PKT_DATA = "abcdefgh0123";
+ const int PKT_LEN = strlen(PKT_DATA);
+ const char* EXPECTED_DIGEST =
+ "\x52\x6c\xb8\x38\xaf\x06\x5a\xfb\x6c\x98\xbb\xc0\x9b\x0a\x7a\x1b";
+ char actual[MD5_LENGTH];
+
+ key md5;
+ md5.next = NULL;
+ md5.key_id = 10;
+ md5.key_len = 6;
+ memcpy(&md5.key_seq, "md5seq", md5.key_len);
+ memcpy(&md5.type, "MD5", 4);
+
+ EXPECT_EQ(MD5_LENGTH,
+ make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual));
+
+ EXPECT_TRUE(memcmp(EXPECTED_DIGEST, actual, MD5_LENGTH) == 0);
+}
+
+#ifdef OPENSSL
+TEST_F(cryptoTest, MakeSHA1Mac) {
+ const char* PKT_DATA = "abcdefgh0123";
+ const int PKT_LEN = strlen(PKT_DATA);
+ const char* EXPECTED_DIGEST =
+ "\x17\xaa\x82\x97\xc7\x17\x13\x6a\x9b\xa9"
+ "\x63\x85\xb4\xce\xbe\x94\xa0\x97\x16\x1d";
+ char actual[SHA1_LENGTH];
+
+ key sha1;
+ sha1.next = NULL;
+ sha1.key_id = 20;
+ sha1.key_len = 7;
+ memcpy(&sha1.key_seq, "sha1seq", sha1.key_len);
+ memcpy(&sha1.type, "SHA1", 5);
+
+ EXPECT_EQ(SHA1_LENGTH,
+ make_mac((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1, actual));
+
+ EXPECT_TRUE(memcmp(EXPECTED_DIGEST, actual, SHA1_LENGTH) == 0);
+}
+#endif /* OPENSSL */
+
+TEST_F(cryptoTest, VerifyCorrectMD5) {
+ const char* PKT_DATA =
+ "sometestdata" // Data
+ "\0\0\0\0" // Key-ID (unused)
+ "\xc7\x58\x99\xdd\x99\x32\x0f\x71" // MAC
+ "\x2b\x7b\xfe\x4f\xa2\x32\xcf\xac";
+ const int PKT_LEN = 12;
+
+ key md5;
+ md5.next = NULL;
+ md5.key_id = 0;
+ md5.key_len = 6;
+ memcpy(&md5.key_seq, "md5key", md5.key_len);
+ memcpy(&md5.type, "MD5", 4);
+
+ EXPECT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
+}
+
+#ifdef OPENSSL
+TEST_F(cryptoTest, VerifySHA1) {
+ const char* PKT_DATA =
+ "sometestdata" // Data
+ "\0\0\0\0" // Key-ID (unused)
+ "\xad\x07\xde\x36\x39\xa6\x77\xfa\x5b\xce" // MAC
+ "\x2d\x8a\x7d\x06\x96\xe6\x0c\xbc\xed\xe1";
+ const int PKT_LEN = 12;
+
+ key sha1;
+ sha1.next = NULL;
+ sha1.key_id = 0;
+ sha1.key_len = 7;
+ memcpy(&sha1.key_seq, "sha1key", sha1.key_len);
+ memcpy(&sha1.type, "SHA1", 5);
+
+ EXPECT_TRUE(auth_md5((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1));
+}
+#endif /* OPENSSL */
+
+TEST_F(cryptoTest, VerifyFailure) {
+ /* We use a copy of the MD5 verification code, but modify
+ * the last bit to make sure verification fails. */
+ const char* PKT_DATA =
+ "sometestdata" // Data
+ "\0\0\0\0" // Key-ID (unused)
+ "\xc7\x58\x99\xdd\x99\x32\x0f\x71" // MAC
+ "\x2b\x7b\xfe\x4f\xa2\x32\xcf\x00"; // Last byte is wrong!
+ const int PKT_LEN = 12;
+
+ key md5;
+ md5.next = NULL;
+ md5.key_id = 0;
+ md5.key_len = 6;
+ memcpy(&md5.key_seq, "md5key", md5.key_len);
+ memcpy(&md5.type, "MD5", 4);
+
+ EXPECT_FALSE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
+}
+
+TEST_F(cryptoTest, PacketSizeNotMultipleOfFourBytes) {
+ const char* PKT_DATA = "123456";
+ const int PKT_LEN = 6;
+ char actual[MD5_LENGTH];
+
+ key md5;
+ md5.next = NULL;
+ md5.key_id = 10;
+ md5.key_len = 6;
+ memcpy(&md5.key_seq, "md5seq", md5.key_len);
+ memcpy(&md5.type, "MD5", 4);
+
+ EXPECT_EQ(0, make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual));
+}
+
diff --git a/sntp/tests/data/debug-input-lfp-bin b/sntp/tests/data/debug-input-lfp-bin
new file mode 100644
index 0000000..99d559c
--- /dev/null
+++ b/sntp/tests/data/debug-input-lfp-bin
@@ -0,0 +1,3 @@
+--------------------------------------------------------------------------------
+0: 00000000 1: 00000000 2: 00000000 3: 00111111 4: 00000000 5: 00000000 6: 00000000 7: 01111111
+--------------------------------------------------------------------------------
diff --git a/sntp/tests/data/debug-input-lfp-dec b/sntp/tests/data/debug-input-lfp-dec
new file mode 100644
index 0000000..6e81c85
--- /dev/null
+++ b/sntp/tests/data/debug-input-lfp-dec
@@ -0,0 +1,3 @@
+--------------------------------------------------------------------------------
+0: 0 1: 0 2: 24 3: 166 4: 0 5: 4 6: 181 7: 22
+--------------------------------------------------------------------------------
diff --git a/sntp/tests/data/debug-input-pkt b/sntp/tests/data/debug-input-pkt
new file mode 100644
index 0000000..ff61b75
--- /dev/null
+++ b/sntp/tests/data/debug-input-pkt
@@ -0,0 +1,8 @@
+--------------------------------------------------------------------------------
+0: 24 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0
+8: 0 9: 0 10: 0 11: 0 12: 0 13: 0 14: 0 15: 0
+16: 0 17: 0 18: 0 19: 0 20: 0 21: 0 22: 0 23: 0
+24: 0 25: 0 26: 0 27: 0 28: 0 29: 0 30: 0 31: 0
+32: 0 33: 0 34: 0 35: 0 36: 0 37: 0 38: 0 39: 0
+40: 0 41: 0 42: 0 43: 8 44: 7f 45: ff 46: ff 47: ff
+--------------------------------------------------------------------------------
diff --git a/sntp/tests/data/key-test-ascii b/sntp/tests/data/key-test-ascii
new file mode 100644
index 0000000..9240c81
--- /dev/null
+++ b/sntp/tests/data/key-test-ascii
@@ -0,0 +1,2 @@
+50 MD5 asciikeyOne
+40 MD5 asciikeyTwo
diff --git a/sntp/tests/data/key-test-comments b/sntp/tests/data/key-test-comments
new file mode 100644
index 0000000..437049e
--- /dev/null
+++ b/sntp/tests/data/key-test-comments
@@ -0,0 +1,3 @@
+# This is an initial comment, this file should contain 2 keys.
+34 MD5 xyz #This is a comment after an ASCII key.
+10 MD5 010101010101010101010101010101 #Comment after hex key.
diff --git a/sntp/tests/data/key-test-empty b/sntp/tests/data/key-test-empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/sntp/tests/data/key-test-empty
diff --git a/sntp/tests/data/key-test-hex b/sntp/tests/data/key-test-hex
new file mode 100644
index 0000000..fb704c5
--- /dev/null
+++ b/sntp/tests/data/key-test-hex
@@ -0,0 +1,3 @@
+10 MD5 0123456789abcdef0123456789
+20 MD5 111111111111111111111111111111
+30 MD5 01010101010101010101010101
diff --git a/sntp/tests/data/key-test-invalid-hex b/sntp/tests/data/key-test-invalid-hex
new file mode 100644
index 0000000..0933ed0
--- /dev/null
+++ b/sntp/tests/data/key-test-invalid-hex
@@ -0,0 +1,2 @@
+30 MD5 0101010101010101010101010101gh
+10 MD5 010101010101010101010101010101
diff --git a/sntp/tests/data/kod-expected-multiple b/sntp/tests/data/kod-expected-multiple
new file mode 100644
index 0000000..c6ba292
--- /dev/null
+++ b/sntp/tests/data/kod-expected-multiple
@@ -0,0 +1,3 @@
+000000000000abcd DENY 192.0.2.1
+000000000000abcd RSTR 192.0.2.5
+000000000000abcd RATE example.com
diff --git a/sntp/tests/data/kod-expected-single b/sntp/tests/data/kod-expected-single
new file mode 100644
index 0000000..8ad3c7c
--- /dev/null
+++ b/sntp/tests/data/kod-expected-single
@@ -0,0 +1 @@
+0000000000000001 DENY host1
diff --git a/sntp/tests/data/kod-test-blanks b/sntp/tests/data/kod-test-blanks
new file mode 100644
index 0000000..5c20e72
--- /dev/null
+++ b/sntp/tests/data/kod-test-blanks
@@ -0,0 +1,6 @@
+
+0000000012345678 DENY 192.0.2.5
+
+0000000000000fff RSTR 192.0.2.100
+000000000000abcd DENY example.com
+
diff --git a/sntp/tests/data/kod-test-correct b/sntp/tests/data/kod-test-correct
new file mode 100644
index 0000000..8a3e230
--- /dev/null
+++ b/sntp/tests/data/kod-test-correct
@@ -0,0 +1,2 @@
+0000000012345678 DENY 192.0.2.5
+0000000000000fff RSTR 192.0.2.100
diff --git a/sntp/tests/data/kod-test-empty b/sntp/tests/data/kod-test-empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/sntp/tests/data/kod-test-empty
diff --git a/sntp/tests/fileHandlingTest.h b/sntp/tests/fileHandlingTest.h
new file mode 100644
index 0000000..502a248
--- /dev/null
+++ b/sntp/tests/fileHandlingTest.h
@@ -0,0 +1,64 @@
+#ifndef FILE_HANDLING_TEST_H
+#define FILE_HANDLING_TEST_H
+
+#include "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/sntp/tests/keyFile.cpp b/sntp/tests/keyFile.cpp
new file mode 100644
index 0000000..3efbe8f
--- /dev/null
+++ b/sntp/tests/keyFile.cpp
@@ -0,0 +1,131 @@
+#include "fileHandlingTest.h"
+
+extern "C" {
+#include "crypto.h"
+};
+
+class keyFileTest : public fileHandlingTest {
+protected:
+ ::testing::AssertionResult CompareKeys(key& expected, key& actual) {
+ if (expected.key_id != actual.key_id)
+ return ::testing::AssertionFailure()
+ << "Expected key_id: " << expected.key_id
+ << " but was: " << actual.key_id;
+ if (expected.key_len != actual.key_len)
+ return ::testing::AssertionFailure()
+ << "Expected key_len: " << expected.key_len
+ << " but was: " << actual.key_len;
+ if (strcmp(expected.type, actual.type) != 0)
+ return ::testing::AssertionFailure()
+ << "Expected key_type: " << expected.type
+ << " but was: " << actual.type;
+ if (memcmp(expected.key_seq, actual.key_seq, expected.key_len) != 0)
+ return ::testing::AssertionFailure()
+ << "Key mismatch!";
+ return ::testing::AssertionSuccess();
+ }
+
+ ::testing::AssertionResult CompareKeys(int key_id,
+ int key_len,
+ const char* type,
+ const char* key_seq,
+ key& actual) {
+ key temp;
+
+ temp.key_id = key_id;
+ temp.key_len = key_len;
+ strlcpy(temp.type, type, sizeof(temp.type));
+ memcpy(temp.key_seq, key_seq, key_len);
+
+ return CompareKeys(temp, actual);
+ }
+};
+
+TEST_F(keyFileTest, ReadEmptyKeyFile) {
+ key* keys = NULL;
+
+ ASSERT_EQ(0, auth_init(CreatePath("key-test-empty", INPUT_DIR).c_str(), &keys));
+
+ EXPECT_TRUE(keys == NULL);
+}
+
+TEST_F(keyFileTest, ReadASCIIKeys) {
+ key* keys = NULL;
+
+ ASSERT_EQ(2, auth_init(CreatePath("key-test-ascii", INPUT_DIR).c_str(), &keys));
+
+ ASSERT_TRUE(keys != NULL);
+
+ key* result = NULL;
+ get_key(40, &result);
+ ASSERT_TRUE(result != NULL);
+ EXPECT_TRUE(CompareKeys(40, 11, "MD5", "asciikeyTwo", *result));
+
+ result = NULL;
+ get_key(50, &result);
+ ASSERT_TRUE(result != NULL);
+ EXPECT_TRUE(CompareKeys(50, 11, "MD5", "asciikeyOne", *result));
+}
+
+TEST_F(keyFileTest, ReadHexKeys) {
+ key* keys = NULL;
+
+ ASSERT_EQ(3, auth_init(CreatePath("key-test-hex", INPUT_DIR).c_str(), &keys));
+
+ ASSERT_TRUE(keys != NULL);
+
+ key* result = NULL;
+ get_key(10, &result);
+ ASSERT_TRUE(result != NULL);
+ EXPECT_TRUE(CompareKeys(10, 13, "MD5",
+ "\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89", *result));
+
+ result = NULL;
+ get_key(20, &result);
+ ASSERT_TRUE(result != NULL);
+ char data1[15]; memset(data1, 0x11, 15);
+ EXPECT_TRUE(CompareKeys(20, 15, "MD5", data1, *result));
+
+ result = NULL;
+ get_key(30, &result);
+ ASSERT_TRUE(result != NULL);
+ char data2[13]; memset(data2, 0x01, 13);
+ EXPECT_TRUE(CompareKeys(30, 13, "MD5", data2, *result));
+}
+
+TEST_F(keyFileTest, ReadKeyFileWithComments) {
+ key* keys = NULL;
+
+ ASSERT_EQ(2, auth_init(CreatePath("key-test-comments", INPUT_DIR).c_str(), &keys));
+
+ ASSERT_TRUE(keys != NULL);
+
+ key* result = NULL;
+ get_key(10, &result);
+ ASSERT_TRUE(result != NULL);
+ char data[15]; memset(data, 0x01, 15);
+ EXPECT_TRUE(CompareKeys(10, 15, "MD5", data, *result));
+
+ result = NULL;
+ get_key(34, &result);
+ ASSERT_TRUE(result != NULL);
+ EXPECT_TRUE(CompareKeys(34, 3, "MD5", "xyz", *result));
+}
+
+TEST_F(keyFileTest, ReadKeyFileWithInvalidHex) {
+ key* keys = NULL;
+
+ ASSERT_EQ(1, auth_init(CreatePath("key-test-invalid-hex", INPUT_DIR).c_str(), &keys));
+
+ ASSERT_TRUE(keys != NULL);
+
+ key* result = NULL;
+ get_key(10, &result);
+ ASSERT_TRUE(result != NULL);
+ char data[15]; memset(data, 0x01, 15);
+ EXPECT_TRUE(CompareKeys(10, 15, "MD5", data, *result));
+
+ result = NULL;
+ get_key(30, &result); // Should not exist, and result should remain NULL.
+ ASSERT_TRUE(result == NULL);
+}
diff --git a/sntp/tests/kodDatabase.cpp b/sntp/tests/kodDatabase.cpp
new file mode 100644
index 0000000..515f433
--- /dev/null
+++ b/sntp/tests/kodDatabase.cpp
@@ -0,0 +1,118 @@
+#include "sntptest.h"
+
+extern "C" {
+#include "kod_management.h"
+};
+
+class kodDatabaseTest : public sntptest {
+protected:
+ virtual void SetUp() {
+ kod_init_kod_db("/dev/null", TRUE);
+ }
+};
+
+TEST_F(kodDatabaseTest, SingleEntryHandling) {
+ char HOST[] = "192.0.2.5";
+ char REASON[] = "DENY";
+
+ add_entry(HOST, REASON);
+
+ kod_entry* result;
+
+ EXPECT_EQ(1, search_entry(HOST, &result));
+ EXPECT_STREQ(HOST, result->hostname);
+ EXPECT_STREQ(REASON, result->type);
+}
+
+TEST_F(kodDatabaseTest, MultipleEntryHandling) {
+ char HOST1[] = "192.0.2.3";
+ char REASON1[] = "DENY";
+
+ char HOST2[] = "192.0.5.5";
+ char REASON2[] = "RATE";
+
+ char HOST3[] = "192.0.10.1";
+ char REASON3[] = "DENY";
+
+ add_entry(HOST1, REASON1);
+ add_entry(HOST2, REASON2);
+ add_entry(HOST3, REASON3);
+
+ kod_entry* result;
+
+ EXPECT_EQ(1, search_entry(HOST1, &result));
+ EXPECT_STREQ(HOST1, result->hostname);
+ EXPECT_STREQ(REASON1, result->type);
+
+ EXPECT_EQ(1, search_entry(HOST2, &result));
+ EXPECT_STREQ(HOST2, result->hostname);
+ EXPECT_STREQ(REASON2, result->type);
+
+ EXPECT_EQ(1, search_entry(HOST3, &result));
+ EXPECT_STREQ(HOST3, result->hostname);
+ EXPECT_STREQ(REASON3, result->type);
+
+ free(result);
+}
+
+TEST_F(kodDatabaseTest, NoMatchInSearch) {
+ char HOST_ADD[] = "192.0.2.6";
+ char HOST_NOTADD[] = "192.0.6.1";
+ char REASON[] = "DENY";
+
+ add_entry(HOST_ADD, REASON);
+
+ kod_entry* result;
+
+ EXPECT_EQ(0, search_entry(HOST_NOTADD, &result));
+ EXPECT_TRUE(result == NULL);
+}
+
+TEST_F(kodDatabaseTest, AddDuplicate) {
+ char HOST[] = "192.0.2.3";
+ char REASON1[] = "RATE";
+ char REASON2[] = "DENY";
+
+ add_entry(HOST, REASON1);
+ kod_entry* result1;
+ ASSERT_EQ(1, search_entry(HOST, &result1));
+
+ /*
+ * Sleeps for two seconds since we want to ensure that
+ * the timestamp is updated to a new value.
+ */
+ sleep(2);
+
+ add_entry(HOST, REASON2);
+ kod_entry* result2;
+ ASSERT_EQ(1, search_entry(HOST, &result2));
+
+ EXPECT_NE(result1->timestamp, result2->timestamp);
+
+ free(result1);
+ free(result2);
+}
+
+TEST_F(kodDatabaseTest, DeleteEntry) {
+ char HOST1[] = "192.0.2.1";
+ char HOST2[] = "192.0.2.2";
+ char HOST3[] = "192.0.2.3";
+ char REASON[] = "DENY";
+
+ add_entry(HOST1, REASON);
+ add_entry(HOST2, REASON);
+ add_entry(HOST3, REASON);
+
+ kod_entry* result;
+
+ ASSERT_EQ(1, search_entry(HOST2, &result));
+ free(result);
+
+ delete_entry(HOST2, REASON);
+
+ EXPECT_EQ(0, search_entry(HOST2, &result));
+
+ // Ensure that the other entry is still there.
+ EXPECT_EQ(1, search_entry(HOST1, &result));
+ free(result);
+}
diff --git a/sntp/tests/kodFile.cpp b/sntp/tests/kodFile.cpp
new file mode 100644
index 0000000..e1775f6
--- /dev/null
+++ b/sntp/tests/kodFile.cpp
@@ -0,0 +1,138 @@
+#include "fileHandlingTest.h"
+
+extern "C" {
+#include "kod_management.h"
+
+#include "ntp_stdlib.h" // For estrdup()
+};
+
+/*
+ * We access some parts of the kod database directly, without
+ * going through the public interface
+ */
+extern int kod_db_cnt;
+extern kod_entry** kod_db;
+extern char* kod_db_file;
+
+class kodFileTest : public fileHandlingTest {
+protected:
+ virtual void SetUp() {
+ kod_db_cnt = 0;
+ kod_db = NULL;
+ }
+
+ virtual void TearDown() {
+ }
+};
+
+TEST_F(kodFileTest, ReadEmptyFile) {
+ kod_init_kod_db(CreatePath("kod-test-empty", INPUT_DIR).c_str(), TRUE);
+
+ EXPECT_EQ(0, kod_db_cnt);
+}
+
+TEST_F(kodFileTest, ReadCorrectFile) {
+ kod_init_kod_db(CreatePath("kod-test-correct", INPUT_DIR).c_str(), TRUE);
+
+ EXPECT_EQ(2, kod_db_cnt);
+
+ kod_entry* res;
+
+ ASSERT_EQ(1, search_entry("192.0.2.5", &res));
+ EXPECT_STREQ("DENY", res->type);
+ EXPECT_STREQ("192.0.2.5", res->hostname);
+ EXPECT_EQ(0x12345678, res->timestamp);
+
+ ASSERT_EQ(1, search_entry("192.0.2.100", &res));
+ EXPECT_STREQ("RSTR", res->type);
+ EXPECT_STREQ("192.0.2.100", res->hostname);
+ EXPECT_EQ(0xfff, res->timestamp);
+}
+
+TEST_F(kodFileTest, ReadFileWithBlankLines) {
+ kod_init_kod_db(CreatePath("kod-test-blanks", INPUT_DIR).c_str(), TRUE);
+
+ EXPECT_EQ(3, kod_db_cnt);
+
+ kod_entry* res;
+
+ ASSERT_EQ(1, search_entry("192.0.2.5", &res));
+ EXPECT_STREQ("DENY", res->type);
+ EXPECT_STREQ("192.0.2.5", res->hostname);
+ EXPECT_EQ(0x12345678, res->timestamp);
+
+ ASSERT_EQ(1, search_entry("192.0.2.100", &res));
+ EXPECT_STREQ("RSTR", res->type);
+ EXPECT_STREQ("192.0.2.100", res->hostname);
+ EXPECT_EQ(0xfff, res->timestamp);
+
+ ASSERT_EQ(1, search_entry("example.com", &res));
+ EXPECT_STREQ("DENY", res->type);
+ EXPECT_STREQ("example.com", res->hostname);
+ EXPECT_EQ(0xabcd, res->timestamp);
+}
+
+TEST_F(kodFileTest, WriteEmptyFile) {
+ kod_db_file = estrdup(CreatePath("kod-output-blank", OUTPUT_DIR).c_str());
+
+ write_kod_db();
+
+ // Open file and ensure that the filesize is 0 bytes.
+ std::ifstream is(kod_db_file, std::ios::binary);
+ ASSERT_FALSE(is.fail());
+
+ EXPECT_EQ(0, GetFileSize(is));
+
+ is.close();
+}
+
+TEST_F(kodFileTest, WriteFileWithSingleEntry) {
+ kod_db_file = estrdup(CreatePath("kod-output-single", OUTPUT_DIR).c_str());
+
+ 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();
+
+ // Open file and compare sizes.
+ ifstream actual(kod_db_file, ios::binary);
+ ifstream expected(CreatePath("kod-expected-single", INPUT_DIR).c_str());
+ ASSERT_TRUE(actual.good());
+ ASSERT_TRUE(expected.good());
+
+ ASSERT_EQ(GetFileSize(expected), GetFileSize(actual));
+
+ CompareFileContent(expected, actual);
+}
+
+TEST_F(kodFileTest, WriteFileWithMultipleEntries) {
+ kod_db_file = estrdup(CreatePath("kod-output-multiple", OUTPUT_DIR).c_str());
+
+ add_entry("example.com", "RATE");
+ add_entry("192.0.2.1", "DENY");
+ add_entry("192.0.2.5", "RSTR");
+
+ /*
+ * Manipulate timestamps. This is a bit of a hack, ideally these
+ * tests should not care about the internal representation.
+ */
+ kod_db[0]->timestamp = 0xabcd;
+ kod_db[1]->timestamp = 0xabcd;
+ kod_db[2]->timestamp = 0xabcd;
+
+ write_kod_db();
+
+ // Open file and compare sizes and content.
+ ifstream actual(kod_db_file, ios::binary);
+ ifstream expected(CreatePath("kod-expected-multiple", INPUT_DIR).c_str());
+ ASSERT_TRUE(actual.good());
+ ASSERT_TRUE(expected.good());
+
+ ASSERT_EQ(GetFileSize(expected), GetFileSize(actual));
+
+ CompareFileContent(expected, actual);
+}
diff --git a/sntp/tests/networking.cpp b/sntp/tests/networking.cpp
new file mode 100644
index 0000000..1d6ad6c
--- /dev/null
+++ b/sntp/tests/networking.cpp
@@ -0,0 +1,5 @@
+#include "sntptest.h"
+
+extern "C" {
+#include "networking.h"
+};
diff --git a/sntp/tests/packetHandling.cpp b/sntp/tests/packetHandling.cpp
new file mode 100644
index 0000000..ef17489
--- /dev/null
+++ b/sntp/tests/packetHandling.cpp
@@ -0,0 +1,264 @@
+#include "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/sntp/tests/packetProcessing.cpp b/sntp/tests/packetProcessing.cpp
new file mode 100644
index 0000000..322b893
--- /dev/null
+++ b/sntp/tests/packetProcessing.cpp
@@ -0,0 +1,334 @@
+#include "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/sntp/tests/sntptest.h b/sntp/tests/sntptest.h
new file mode 100644
index 0000000..d5add9c
--- /dev/null
+++ b/sntp/tests/sntptest.h
@@ -0,0 +1,35 @@
+#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/sntp/tests/tests-runner b/sntp/tests/tests-runner
new file mode 100755
index 0000000..412516c
--- /dev/null
+++ b/sntp/tests/tests-runner
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# $builddir is always .
+builddir=.
+# $srcdir will be set to the correct directory when this script is called from
+# the Makefiles generated by Automake.
+
+# Create output directory.
+mkdir -p $builddir/data
+
+# Test executable expects two arguments: test_input_dir and test_output_dir.
+./tests $srcdir/data $builddir/data
+
diff --git a/sntp/tests/utilities.cpp b/sntp/tests/utilities.cpp
new file mode 100644
index 0000000..4c8c305
--- /dev/null
+++ b/sntp/tests/utilities.cpp
@@ -0,0 +1,176 @@
+#include "sntptest.h"
+#include "fileHandlingTest.h"
+
+extern "C" {
+#include "main.h"
+#include "utilities.h"
+const char * Version = "stub unit test Version string";
+};
+
+using std::string;
+
+class utilitiesTest : public sntptest {
+protected:
+ sockaddr_u CreateSockaddr4(const char* address) {
+ sockaddr_u s;
+ s.sa4.sin_family = AF_INET;
+ s.sa4.sin_addr.s_addr = inet_addr(address);
+ SET_PORT(&s, 123);
+
+ return s;
+ }
+
+ addrinfo CreateAddrinfo(sockaddr_u* sock) {
+ addrinfo a;
+ a.ai_family = sock->sa.sa_family;
+ a.ai_addrlen = SIZEOF_SOCKADDR(a.ai_family);
+ a.ai_addr = &sock->sa;
+ return a;
+ }
+};
+
+class debugUtilitiesTest : public fileHandlingTest {
+protected:
+ bool outputFileOpened;
+ FILE* outputFile;
+
+ debugUtilitiesTest() : outputFileOpened(false) {}
+
+ void InitDebugTest(const string& filename) {
+ // Clear the contents of the current file.
+ // Open the output file
+ outputFile = fopen(filename.c_str(), "w+");
+ ASSERT_TRUE(outputFile != NULL);
+ outputFileOpened = true;
+ }
+
+ // Closes outputFile, and compare contents.
+ void FinishDebugTest(const string& expected,
+ const string& actual) {
+ if (outputFileOpened)
+ fclose(outputFile);
+
+ ifstream e(expected.c_str());
+ ifstream a(actual.c_str());
+ ASSERT_TRUE(e.good());
+ ASSERT_TRUE(a.good());
+
+ CompareFileContent(e, a);
+ }
+};
+
+/*
+ * These tests are essentially a copy of the tests for socktoa()
+ * in libntp. If sntp switches to using that functions, these
+ * tests can be removed.
+ */
+
+TEST_F(utilitiesTest, IPv4Address) {
+ const char* ADDR = "192.0.2.10";
+
+ sockaddr_u input = CreateSockaddr4(ADDR);
+ addrinfo inputA = CreateAddrinfo(&input);
+
+ EXPECT_STREQ(ADDR, ss_to_str(&input));
+ EXPECT_STREQ(ADDR, addrinfo_to_str(&inputA));
+}
+
+TEST_F(utilitiesTest, IPv6Address) {
+ 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";
+ sockaddr_u input;
+ addrinfo inputA;
+
+ memset(&input, 0, sizeof(input));
+ input.sa6.sin6_family = AF_INET6;
+ input.sa6.sin6_addr = address;
+ EXPECT_STREQ(expected, ss_to_str(&input));
+
+ inputA = CreateAddrinfo(&input);
+ EXPECT_STREQ(expected, addrinfo_to_str(&inputA));
+}
+
+TEST_F(utilitiesTest, SetLiVnMode1) {
+ pkt expected;
+ expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
+ NTP_VERSION,
+ MODE_SERVER);
+
+ pkt actual;
+ set_li_vn_mode(&actual, LEAP_NOWARNING, NTP_VERSION,
+ MODE_SERVER);
+
+ EXPECT_EQ(expected.li_vn_mode, actual.li_vn_mode);
+}
+
+TEST_F(utilitiesTest, SetLiVnMode2) {
+ pkt expected;
+ expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
+ NTP_OLDVERSION,
+ MODE_BROADCAST);
+
+ pkt actual;
+ set_li_vn_mode(&actual, LEAP_NOTINSYNC, NTP_OLDVERSION,
+ MODE_BROADCAST);
+
+ EXPECT_EQ(expected.li_vn_mode, actual.li_vn_mode);
+}
+
+/* Debug utilities tests */
+
+TEST_F(debugUtilitiesTest, PktOutput) {
+ string filename = CreatePath("debug-output-pkt", OUTPUT_DIR);
+ InitDebugTest(filename);
+
+ pkt testpkt;
+ memset(&testpkt, 0, sizeof(pkt));
+ testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
+ NTP_VERSION,
+ MODE_SERVER);
+
+ l_fp test;
+ test.l_ui = 8;
+ test.l_uf = 2147483647; // Lots of ones.
+ HTONL_FP(&test, &testpkt.xmt);
+
+ pkt_output(&testpkt, LEN_PKT_NOMAC, outputFile);
+
+ FinishDebugTest(CreatePath("debug-input-pkt", INPUT_DIR), filename);
+}
+
+TEST_F(debugUtilitiesTest, LfpOutputBinaryFormat) {
+ string filename = CreatePath("debug-output-lfp-bin", OUTPUT_DIR);
+ InitDebugTest(filename);
+
+ l_fp test;
+ test.l_ui = 63; // 00000000 00000000 00000000 00111111
+ test.l_uf = 127; // 00000000 00000000 00000000 01111111
+
+ l_fp network;
+ HTONL_FP(&test, &network);
+
+ l_fp_output_bin(&network, outputFile);
+
+ FinishDebugTest(CreatePath("debug-input-lfp-bin", INPUT_DIR), filename);
+}
+
+TEST_F(debugUtilitiesTest, LfpOutputDecimalFormat) {
+ string filename = CreatePath("debug-output-lfp-dec", OUTPUT_DIR);
+ InitDebugTest(filename);
+
+ l_fp test;
+ test.l_ui = 6310; // 0x000018A6
+ test.l_uf = 308502; // 0x00004B516
+
+ l_fp network;
+ HTONL_FP(&test, &network);
+
+ l_fp_output_dec(&network, outputFile);
+
+ FinishDebugTest(CreatePath("debug-input-lfp-dec", INPUT_DIR), filename);
+}
diff --git a/sntp/tests_main.cpp b/sntp/tests_main.cpp
new file mode 100644
index 0000000..3d11bb1
--- /dev/null
+++ b/sntp/tests_main.cpp
@@ -0,0 +1,25 @@
+#include "tests_main.h"
+
+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/sntp/tests_main.h b/sntp/tests_main.h
new file mode 100644
index 0000000..991f4b6
--- /dev/null
+++ b/sntp/tests_main.h
@@ -0,0 +1,22 @@
+#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/sntp/utilities.c b/sntp/utilities.c
new file mode 100644
index 0000000..591c4f7
--- /dev/null
+++ b/sntp/utilities.c
@@ -0,0 +1,209 @@
+#include <config.h>
+#include "utilities.h"
+#include <assert.h>
+
+/* Display a NTP packet in hex with leading address offset
+ * e.g. offset: value, 0: ff 1: fe ... 255: 00
+ */
+void
+pkt_output (
+ struct pkt *dpkg,
+ int pkt_length,
+ FILE *output
+ )
+{
+ register int a;
+ u_char *pkt;
+
+ pkt = (u_char *)dpkg;
+
+ fprintf(output, HLINE);
+
+ for (a = 0; a < pkt_length; a++) {
+ if (a > 0 && a % 8 == 0)
+ fprintf(output, "\n");
+
+ fprintf(output, "%d: %x \t", a, pkt[a]);
+ }
+
+ fprintf(output, "\n");
+ fprintf(output, HLINE);
+}
+
+/* Output a long floating point value in hex in the style described above
+ */
+void
+l_fp_output(
+ l_fp * ts,
+ FILE * output
+ )
+{
+ fprintf(output, "%s\n", prettydate(ts));
+}
+
+/* Output a long floating point value in binary in the style described above
+ */
+void
+l_fp_output_bin (
+ l_fp *ts,
+ FILE *output
+ )
+{
+ register int a, b;
+
+ fprintf(output, HLINE);
+
+ for(a=0; a<8; a++) {
+ short tmp = ((unsigned char *) ts)[a];
+ tmp++;
+
+ fprintf(output, "%i: ", a);
+
+ for(b=7; b>=0; b--) {
+ int texp = (int) pow(2, b);
+
+ if(tmp - texp > 0) {
+ fprintf(output, "1");
+ tmp -= texp;
+ }
+ else {
+ fprintf(output, "0");
+ }
+ }
+
+ fprintf(output, " ");
+ }
+
+ fprintf(output, "\n");
+ fprintf(output, HLINE);
+}
+
+/* Output a long floating point value in decimal in the style described above
+ */
+void
+l_fp_output_dec (
+ l_fp *ts,
+ FILE *output
+ )
+{
+ register int a;
+
+ fprintf(output, HLINE);
+
+ for(a=0; a<8; a++)
+ fprintf(output, "%i: %i \t", a, ((unsigned char *) ts)[a]);
+
+ fprintf(output, "\n");
+ fprintf(output, HLINE);
+
+}
+
+/* Convert a struct addrinfo to a string containing the address in style
+ * of inet_ntoa
+ */
+char *
+addrinfo_to_str (
+ const struct addrinfo *addr
+ )
+{
+ sockaddr_u s;
+
+ ZERO(s);
+ memcpy(&s, addr->ai_addr, min(sizeof(s), addr->ai_addrlen));
+
+ return ss_to_str(&s);
+}
+
+
+/* Convert a sockaddr_u to a string containing the address in
+ * style of inet_ntoa
+ * Why not switch callers to use stoa from libntp? No free() needed
+ * in that case.
+ */
+char *
+ss_to_str(
+ sockaddr_u *saddr
+ )
+{
+ return estrdup(stoa(saddr));
+}
+
+
+/*
+ * Converts a struct tv to a date string
+ */
+char *
+tv_to_str(
+ const struct timeval *tv
+ )
+{
+ const size_t bufsize = 48;
+ char *buf;
+ time_t gmt_time, local_time;
+ struct tm *p_tm_local;
+ int hh, mm, lto;
+
+ /*
+ * convert to struct tm in UTC, then intentionally feed
+ * that tm to mktime() which expects local time input, to
+ * derive the offset from UTC to local time.
+ */
+ gmt_time = tv->tv_sec;
+ local_time = mktime(gmtime(&gmt_time));
+ p_tm_local = localtime(&gmt_time);
+
+ /* Local timezone offsets should never cause an overflow. Yeah. */
+ lto = difftime(local_time, gmt_time);
+ lto /= 60;
+ hh = lto / 60;
+ mm = abs(lto % 60);
+
+ buf = emalloc(bufsize);
+ snprintf(buf, bufsize,
+ "%d-%.2d-%.2d %.2d:%.2d:%.2d.%.6d (%+03d%02d)",
+ p_tm_local->tm_year + 1900,
+ p_tm_local->tm_mon + 1,
+ p_tm_local->tm_mday,
+ p_tm_local->tm_hour,
+ p_tm_local->tm_min,
+ p_tm_local->tm_sec,
+ (int)tv->tv_usec,
+ hh,
+ mm);
+
+ return buf;
+}
+
+
+/*
+ *
+ * hostnameaddr()
+ *
+ * Formats the hostname and resulting numeric IP address into a string,
+ * avoiding duplication if the "hostname" was in fact a numeric address.
+ *
+ */
+const char *
+hostnameaddr(
+ const char * hostname,
+ const sockaddr_u * addr
+ )
+{
+ const char * addrtxt;
+ char * result;
+ int cnt;
+
+ addrtxt = stoa(addr);
+ LIB_GETBUF(result);
+ if (strcmp(hostname, addrtxt))
+ cnt = snprintf(result, LIB_BUFLENGTH, "%s %s",
+ hostname, addrtxt);
+ else
+ cnt = snprintf(result, LIB_BUFLENGTH, "%s", addrtxt);
+ if (cnt >= LIB_BUFLENGTH)
+ snprintf(result, LIB_BUFLENGTH,
+ "hostnameaddr ERROR have %d (%d needed)",
+ LIB_BUFLENGTH, cnt + 1);
+
+ return result;
+}
diff --git a/sntp/utilities.h b/sntp/utilities.h
new file mode 100644
index 0000000..a022c7d
--- /dev/null
+++ b/sntp/utilities.h
@@ -0,0 +1,27 @@
+#ifndef UTILITIES_H
+#define UTILITIES_H
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include "lib_strbuf.h"
+
+#define HLINE "--------------------------------------------------------------------------------\n"
+#define PHLINE fprintf(output, HLINE);
+#define STDLINE printf(HLINE);
+
+
+void pkt_output(struct pkt *dpkg, int pkt_length, FILE *output);
+void l_fp_output(l_fp *ts, FILE *output);
+void l_fp_output_bin(l_fp *ts, FILE *output);
+void l_fp_output_dec(l_fp *ts, FILE *output);
+
+char *addrinfo_to_str(const struct addrinfo *addr);
+char *ss_to_str(sockaddr_u *saddr);
+char *tv_to_str(const struct timeval *tv);
+const char * hostnameaddr(const char *, const sockaddr_u *);
+
+#endif /* UTILITIES_H */
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..a7d7c3c
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,9 @@
+NULL =
+SUBDIRS =
+
+if GTEST_AVAILABLE
+SUBDIRS += libntp \
+ ntpd \
+ $(NULL)
+endif
+
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644
index 0000000..93868a2
--- /dev/null
+++ b/tests/Makefile.in
@@ -0,0 +1,736 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@GTEST_AVAILABLE_TRUE@am__append_1 = libntp \
+@GTEST_AVAILABLE_TRUE@ ntpd \
+@GTEST_AVAILABLE_TRUE@ $(NULL)
+
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = libntp ntpd
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+SUBDIRS = $(am__append_1)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @fail= failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ ctags ctags-recursive distclean distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/libntp/Makefile.am b/tests/libntp/Makefile.am
new file mode 100644
index 0000000..2f19a89
--- /dev/null
+++ b/tests/libntp/Makefile.am
@@ -0,0 +1,93 @@
+NULL =
+BUILT_SOURCES =
+CLEANFILES =
+
+check_PROGRAMS = tests
+
+LDADD = \
+ $(top_builddir)/libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(PTHREAD_LIBS) \
+ $(LDADD_NTP) \
+ $(GTEST_LDFLAGS) \
+ $(GTEST_LIBS) \
+ $(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_LDFLAGS = $(LDFLAGS_NTP)
+
+tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \
+ libntptest.cpp \
+ a_md5encrypt.cpp \
+ atoint.cpp \
+ atouint.cpp \
+ authkeys.cpp \
+ buftvtots.cpp \
+ calendar.cpp \
+ caljulian.cpp \
+ caltontp.cpp \
+ calyearstart.cpp \
+ clocktime.cpp \
+ decodenetnum.cpp \
+ hextoint.cpp \
+ hextolfp.cpp \
+ humandate.cpp \
+ lfpfunc.cpp \
+ lfptostr.cpp \
+ modetoa.cpp \
+ msyslog.cpp \
+ netof.cpp \
+ numtoa.cpp \
+ numtohost.cpp \
+ octtoint.cpp \
+ prettydate.cpp \
+ recvbuff.cpp \
+ refnumtoa.cpp \
+ sfptostr.cpp \
+ socktoa.cpp \
+ ssl_init.cpp \
+ statestr.cpp \
+ strtolfp.cpp \
+ timespecops.cpp \
+ timestructs.cpp \
+ timevalops.cpp \
+ tstotv.cpp \
+ tvtots.cpp \
+ uglydate.cpp \
+ vi64ops.cpp \
+ ymd2yd.cpp \
+ $(NULL)
+
+noinst_HEADERS = lfptest.h \
+ libntptest.h \
+ sockaddrtest.h \
+ timestructs.h \
+ $(NULL)
+
+TESTS =
+
+if !NTP_CROSSCOMPILE
+TESTS += tests
+endif
+
+## check-libntp.mf - automake fragment
+## slightly adapted for deeper directory
+
+BUILT_SOURCES += check-libntp
+CLEANFILES += check-libntp
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/tests/libntp/Makefile.in b/tests/libntp/Makefile.in
new file mode 100644
index 0000000..ff397f0
--- /dev/null
+++ b/tests/libntp/Makefile.in
@@ -0,0 +1,970 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = tests$(EXEEXT)
+TESTS = $(am__EXEEXT_1)
+@NTP_CROSSCOMPILE_FALSE@am__append_1 = tests
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \
+ $(top_srcdir)/includes.mf
+subdir = tests/libntp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__objects_1 =
+am_tests_OBJECTS = tests_main.$(OBJEXT) libntptest.$(OBJEXT) \
+ a_md5encrypt.$(OBJEXT) atoint.$(OBJEXT) atouint.$(OBJEXT) \
+ authkeys.$(OBJEXT) buftvtots.$(OBJEXT) calendar.$(OBJEXT) \
+ caljulian.$(OBJEXT) caltontp.$(OBJEXT) calyearstart.$(OBJEXT) \
+ clocktime.$(OBJEXT) decodenetnum.$(OBJEXT) hextoint.$(OBJEXT) \
+ hextolfp.$(OBJEXT) humandate.$(OBJEXT) lfpfunc.$(OBJEXT) \
+ lfptostr.$(OBJEXT) modetoa.$(OBJEXT) msyslog.$(OBJEXT) \
+ netof.$(OBJEXT) numtoa.$(OBJEXT) numtohost.$(OBJEXT) \
+ octtoint.$(OBJEXT) prettydate.$(OBJEXT) recvbuff.$(OBJEXT) \
+ refnumtoa.$(OBJEXT) sfptostr.$(OBJEXT) socktoa.$(OBJEXT) \
+ ssl_init.$(OBJEXT) statestr.$(OBJEXT) strtolfp.$(OBJEXT) \
+ timespecops.$(OBJEXT) timestructs.$(OBJEXT) \
+ timevalops.$(OBJEXT) tstotv.$(OBJEXT) tvtots.$(OBJEXT) \
+ uglydate.$(OBJEXT) vi64ops.$(OBJEXT) ymd2yd.$(OBJEXT) \
+ $(am__objects_1)
+tests_OBJECTS = $(am_tests_OBJECTS)
+tests_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+tests_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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
+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_$(V))
+am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
+am__v_CXX_0 = @echo " CXX " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(tests_SOURCES)
+DIST_SOURCES = $(tests_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+@NTP_CROSSCOMPILE_FALSE@am__EXEEXT_1 = tests$(EXEEXT)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 = check-libntp .deps-ver
+CLEANFILES = check-libntp .deps-ver
+LDADD = \
+ $(top_builddir)/libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(PTHREAD_LIBS) \
+ $(LDADD_NTP) \
+ $(GTEST_LDFLAGS) \
+ $(GTEST_LIBS) \
+ $(NULL)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CXXFLAGS = $(GTEST_CXXFLAGS)
+AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp $(GTEST_CPPFLAGS) \
+ $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \
+ libntptest.cpp \
+ a_md5encrypt.cpp \
+ atoint.cpp \
+ atouint.cpp \
+ authkeys.cpp \
+ buftvtots.cpp \
+ calendar.cpp \
+ caljulian.cpp \
+ caltontp.cpp \
+ calyearstart.cpp \
+ clocktime.cpp \
+ decodenetnum.cpp \
+ hextoint.cpp \
+ hextolfp.cpp \
+ humandate.cpp \
+ lfpfunc.cpp \
+ lfptostr.cpp \
+ modetoa.cpp \
+ msyslog.cpp \
+ netof.cpp \
+ numtoa.cpp \
+ numtohost.cpp \
+ octtoint.cpp \
+ prettydate.cpp \
+ recvbuff.cpp \
+ refnumtoa.cpp \
+ sfptostr.cpp \
+ socktoa.cpp \
+ ssl_init.cpp \
+ statestr.cpp \
+ strtolfp.cpp \
+ timespecops.cpp \
+ timestructs.cpp \
+ timevalops.cpp \
+ tstotv.cpp \
+ tvtots.cpp \
+ uglydate.cpp \
+ vi64ops.cpp \
+ ymd2yd.cpp \
+ $(NULL)
+
+noinst_HEADERS = lfptest.h \
+ libntptest.h \
+ sockaddrtest.h \
+ timestructs.h \
+ $(NULL)
+
+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: .cpp .lo .o .obj
+$(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/libntp/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/libntp/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-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
+tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES)
+ @rm -f tests$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_md5encrypt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/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)/caljulian.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caltontp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calyearstart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clocktime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decodenetnum.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)/lfptostr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libntptest.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)/refnumtoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfptostr.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)/strtolfp.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)/timestructs.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@
+
+.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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ 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@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ 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@ $(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`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes$$std"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-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 all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/tests/libntp/a_md5encrypt.cpp b/tests/libntp/a_md5encrypt.cpp
new file mode 100644
index 0000000..f4cea7e
--- /dev/null
+++ b/tests/libntp/a_md5encrypt.cpp
@@ -0,0 +1,89 @@
+#include "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/tests/libntp/atoint.cpp b/tests/libntp/atoint.cpp
new file mode 100644
index 0000000..371f3fe
--- /dev/null
+++ b/tests/libntp/atoint.cpp
@@ -0,0 +1,48 @@
+#include "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/tests/libntp/atouint.cpp b/tests/libntp/atouint.cpp
new file mode 100644
index 0000000..cc8cc39
--- /dev/null
+++ b/tests/libntp/atouint.cpp
@@ -0,0 +1,40 @@
+#include "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/tests/libntp/authkeys.cpp b/tests/libntp/authkeys.cpp
new file mode 100644
index 0000000..8dd33a9
--- /dev/null
+++ b/tests/libntp/authkeys.cpp
@@ -0,0 +1,100 @@
+/* This file contains test for both libntp/authkeys.c and libntp/authusekey.c */
+
+#include "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/tests/libntp/buftvtots.cpp b/tests/libntp/buftvtots.cpp
new file mode 100644
index 0000000..bb8a32d
--- /dev/null
+++ b/tests/libntp/buftvtots.cpp
@@ -0,0 +1,61 @@
+#include "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/tests/libntp/calendar.cpp b/tests/libntp/calendar.cpp
new file mode 100644
index 0000000..35b39c7
--- /dev/null
+++ b/tests/libntp/calendar.cpp
@@ -0,0 +1,337 @@
+#include "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/tests/libntp/caljulian.cpp b/tests/libntp/caljulian.cpp
new file mode 100644
index 0000000..d9cc952
--- /dev/null
+++ b/tests/libntp/caljulian.cpp
@@ -0,0 +1,94 @@
+#include "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/tests/libntp/caltontp.cpp b/tests/libntp/caltontp.cpp
new file mode 100644
index 0000000..b9732db
--- /dev/null
+++ b/tests/libntp/caltontp.cpp
@@ -0,0 +1,49 @@
+#include "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/tests/libntp/calyearstart.cpp b/tests/libntp/calyearstart.cpp
new file mode 100644
index 0000000..774edf3
--- /dev/null
+++ b/tests/libntp/calyearstart.cpp
@@ -0,0 +1,43 @@
+#include "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/tests/libntp/clocktime.cpp b/tests/libntp/clocktime.cpp
new file mode 100644
index 0000000..a24df1a
--- /dev/null
+++ b/tests/libntp/clocktime.cpp
@@ -0,0 +1,187 @@
+#include "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/tests/libntp/decodenetnum.cpp b/tests/libntp/decodenetnum.cpp
new file mode 100644
index 0000000..c6766de
--- /dev/null
+++ b/tests/libntp/decodenetnum.cpp
@@ -0,0 +1,93 @@
+#include "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/tests/libntp/hextoint.cpp b/tests/libntp/hextoint.cpp
new file mode 100644
index 0000000..54c9a67
--- /dev/null
+++ b/tests/libntp/hextoint.cpp
@@ -0,0 +1,42 @@
+#include "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/tests/libntp/hextolfp.cpp b/tests/libntp/hextolfp.cpp
new file mode 100644
index 0000000..2e9f072
--- /dev/null
+++ b/tests/libntp/hextolfp.cpp
@@ -0,0 +1,58 @@
+#include "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/tests/libntp/humandate.cpp b/tests/libntp/humandate.cpp
new file mode 100644
index 0000000..742aa28
--- /dev/null
+++ b/tests/libntp/humandate.cpp
@@ -0,0 +1,41 @@
+#include "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/tests/libntp/lfpfunc.cpp b/tests/libntp/lfpfunc.cpp
new file mode 100644
index 0000000..275918c
--- /dev/null
+++ b/tests/libntp/lfpfunc.cpp
@@ -0,0 +1,547 @@
+#include "libntptest.h"
+#include "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/tests/libntp/lfptest.h b/tests/libntp/lfptest.h
new file mode 100644
index 0000000..034eb41
--- /dev/null
+++ b/tests/libntp/lfptest.h
@@ -0,0 +1,31 @@
+#ifndef NTP_TESTS_LFPTEST_H
+#define NTP_TESTS_LFPTEST_H
+
+#include "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/tests/libntp/lfptostr.cpp b/tests/libntp/lfptostr.cpp
new file mode 100644
index 0000000..aa5f511
--- /dev/null
+++ b/tests/libntp/lfptostr.cpp
@@ -0,0 +1,103 @@
+/*
+ * 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 "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/tests/libntp/libntptest.cpp b/tests/libntp/libntptest.cpp
new file mode 100644
index 0000000..c3363b0
--- /dev/null
+++ b/tests/libntp/libntptest.cpp
@@ -0,0 +1,27 @@
+#include "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/tests/libntp/libntptest.h b/tests/libntp/libntptest.h
new file mode 100644
index 0000000..ef2daa8
--- /dev/null
+++ b/tests/libntp/libntptest.h
@@ -0,0 +1,15 @@
+#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/tests/libntp/modetoa.cpp b/tests/libntp/modetoa.cpp
new file mode 100644
index 0000000..cb7404d
--- /dev/null
+++ b/tests/libntp/modetoa.cpp
@@ -0,0 +1,16 @@
+#include "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/tests/libntp/msyslog.cpp b/tests/libntp/msyslog.cpp
new file mode 100644
index 0000000..5b00703
--- /dev/null
+++ b/tests/libntp/msyslog.cpp
@@ -0,0 +1,137 @@
+#include "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/tests/libntp/netof.cpp b/tests/libntp/netof.cpp
new file mode 100644
index 0000000..67b9df4
--- /dev/null
+++ b/tests/libntp/netof.cpp
@@ -0,0 +1,69 @@
+#include "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/tests/libntp/numtoa.cpp b/tests/libntp/numtoa.cpp
new file mode 100644
index 0000000..58e00c4
--- /dev/null
+++ b/tests/libntp/numtoa.cpp
@@ -0,0 +1,18 @@
+#include "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/tests/libntp/numtohost.cpp b/tests/libntp/numtohost.cpp
new file mode 100644
index 0000000..ffc574e
--- /dev/null
+++ b/tests/libntp/numtohost.cpp
@@ -0,0 +1,15 @@
+#include "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/tests/libntp/octtoint.cpp b/tests/libntp/octtoint.cpp
new file mode 100644
index 0000000..14a993e
--- /dev/null
+++ b/tests/libntp/octtoint.cpp
@@ -0,0 +1,57 @@
+#include "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/tests/libntp/prettydate.cpp b/tests/libntp/prettydate.cpp
new file mode 100644
index 0000000..391ac29
--- /dev/null
+++ b/tests/libntp/prettydate.cpp
@@ -0,0 +1,16 @@
+#include "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/tests/libntp/recvbuff.cpp b/tests/libntp/recvbuff.cpp
new file mode 100644
index 0000000..e9505bd
--- /dev/null
+++ b/tests/libntp/recvbuff.cpp
@@ -0,0 +1,38 @@
+#include "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/tests/libntp/refnumtoa.cpp b/tests/libntp/refnumtoa.cpp
new file mode 100644
index 0000000..75460c0
--- /dev/null
+++ b/tests/libntp/refnumtoa.cpp
@@ -0,0 +1,52 @@
+#include "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/tests/libntp/sfptostr.cpp b/tests/libntp/sfptostr.cpp
new file mode 100644
index 0000000..5cef47e
--- /dev/null
+++ b/tests/libntp/sfptostr.cpp
@@ -0,0 +1,71 @@
+/*
+ * This file contains test for both fptoa and fptoms (which uses dofptoa),
+ * since all these functions are very similar.
+ */
+
+#include "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/tests/libntp/sockaddrtest.h b/tests/libntp/sockaddrtest.h
new file mode 100644
index 0000000..4baac4d
--- /dev/null
+++ b/tests/libntp/sockaddrtest.h
@@ -0,0 +1,58 @@
+#ifndef TESTS_SOCKADDRTEST_H
+#define TESTS_SOCKADDRTEST_H
+
+#include "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/tests/libntp/socktoa.cpp b/tests/libntp/socktoa.cpp
new file mode 100644
index 0000000..6c70b6d
--- /dev/null
+++ b/tests/libntp/socktoa.cpp
@@ -0,0 +1,100 @@
+#include "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/tests/libntp/ssl_init.cpp b/tests/libntp/ssl_init.cpp
new file mode 100644
index 0000000..8812656
--- /dev/null
+++ b/tests/libntp/ssl_init.cpp
@@ -0,0 +1,50 @@
+#include "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/tests/libntp/statestr.cpp b/tests/libntp/statestr.cpp
new file mode 100644
index 0000000..506b079
--- /dev/null
+++ b/tests/libntp/statestr.cpp
@@ -0,0 +1,27 @@
+#include "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/tests/libntp/strtolfp.cpp b/tests/libntp/strtolfp.cpp
new file mode 100644
index 0000000..729996e
--- /dev/null
+++ b/tests/libntp/strtolfp.cpp
@@ -0,0 +1,107 @@
+#include "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/tests/libntp/timespecops.cpp b/tests/libntp/timespecops.cpp
new file mode 100644
index 0000000..392d271
--- /dev/null
+++ b/tests/libntp/timespecops.cpp
@@ -0,0 +1,475 @@
+#include "libntptest.h"
+#include "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/tests/libntp/timestructs.cpp b/tests/libntp/timestructs.cpp
new file mode 100644
index 0000000..3cd0c54
--- /dev/null
+++ b/tests/libntp/timestructs.cpp
@@ -0,0 +1,156 @@
+/*
+ * 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 "libntptest.h"
+#include "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/tests/libntp/timestructs.h b/tests/libntp/timestructs.h
new file mode 100644
index 0000000..7bc4ffd
--- /dev/null
+++ b/tests/libntp/timestructs.h
@@ -0,0 +1,185 @@
+/*
+ * 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/tests/libntp/timevalops.cpp b/tests/libntp/timevalops.cpp
new file mode 100644
index 0000000..7232615
--- /dev/null
+++ b/tests/libntp/timevalops.cpp
@@ -0,0 +1,480 @@
+#include "libntptest.h"
+#include "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/tests/libntp/tstotv.cpp b/tests/libntp/tstotv.cpp
new file mode 100644
index 0000000..41f44d7
--- /dev/null
+++ b/tests/libntp/tstotv.cpp
@@ -0,0 +1,57 @@
+#include "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/tests/libntp/tvtots.cpp b/tests/libntp/tvtots.cpp
new file mode 100644
index 0000000..c51b7f5
--- /dev/null
+++ b/tests/libntp/tvtots.cpp
@@ -0,0 +1,54 @@
+#include "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/tests/libntp/uglydate.cpp b/tests/libntp/uglydate.cpp
new file mode 100644
index 0000000..6d9e6c6
--- /dev/null
+++ b/tests/libntp/uglydate.cpp
@@ -0,0 +1,18 @@
+#include "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/tests/libntp/vi64ops.cpp b/tests/libntp/vi64ops.cpp
new file mode 100644
index 0000000..7b839ab
--- /dev/null
+++ b/tests/libntp/vi64ops.cpp
@@ -0,0 +1,64 @@
+#include "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/tests/libntp/ymd2yd.cpp b/tests/libntp/ymd2yd.cpp
new file mode 100644
index 0000000..e6f46f8
--- /dev/null
+++ b/tests/libntp/ymd2yd.cpp
@@ -0,0 +1,23 @@
+#include "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/tests/ntpd/Makefile.am b/tests/ntpd/Makefile.am
new file mode 100644
index 0000000..c5df6e4
--- /dev/null
+++ b/tests/ntpd/Makefile.am
@@ -0,0 +1,55 @@
+NULL =
+BUILT_SOURCES =
+CLEANFILES =
+
+check_PROGRAMS = tests
+
+LDADD = \
+ $(top_builddir)/libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(PTHREAD_LIBS) \
+ $(LDADD_NTP) \
+ $(GTEST_LDFLAGS) \
+ $(GTEST_LIBS) \
+ $(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 += $(CPPFLAGS_NTP)
+
+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)
+
+TESTS =
+
+if !NTP_CROSSCOMPILE
+TESTS += tests
+endif
+
+## check-libntp.mf - automake fragment
+## slightly adapted for deeper directory
+
+BUILT_SOURCES += check-libntp
+CLEANFILES += check-libntp
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/tests/ntpd/Makefile.in b/tests/ntpd/Makefile.in
new file mode 100644
index 0000000..2235fc5
--- /dev/null
+++ b/tests/ntpd/Makefile.in
@@ -0,0 +1,938 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = tests$(EXEEXT)
+TESTS = $(am__EXEEXT_1)
+@NTP_CROSSCOMPILE_FALSE@am__append_1 = tests
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \
+ $(top_srcdir)/includes.mf
+subdir = tests/ntpd
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__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__DEPENDENCIES_1 =
+tests_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+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_$(V))
+am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
+am__v_CXX_0 = @echo " CXX " $@;
+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_$(V))
+am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(tests_SOURCES)
+DIST_SOURCES = $(tests_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+@NTP_CROSSCOMPILE_FALSE@am__EXEEXT_1 = tests$(EXEEXT)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 = check-libntp .deps-ver
+CLEANFILES = check-libntp .deps-ver
+LDADD = \
+ $(top_builddir)/libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(PTHREAD_LIBS) \
+ $(LDADD_NTP) \
+ $(GTEST_LDFLAGS) \
+ $(GTEST_LIBS) \
+ $(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)
+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)
+
+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 .cpp .lo .o .obj
+$(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/ntpd/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/ntpd/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-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
+tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES)
+ @rm -f tests$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+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@
+
+.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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/ntpd/ntp_leapsec.c' object='ntp_leapsec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntp_leapsec.o `test -f '$(top_srcdir)/ntpd/ntp_leapsec.c' || echo '$(srcdir)/'`$(top_srcdir)/ntpd/ntp_leapsec.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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/ntpd/ntp_leapsec.c' object='ntp_leapsec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ 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@ $(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
+@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ 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@ $(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`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes$$std"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+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:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-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 all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am
+
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
+ @[ -f $@ ] || \
+ cp $(top_srcdir)/deps-ver $@
+ @[ -w $@ ] || \
+ chmod ug+w $@
+ @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \
+ $(MAKE) $(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/tests/ntpd/leapsec.cpp b/tests/ntpd/leapsec.cpp
new file mode 100644
index 0000000..6ae0cee
--- /dev/null
+++ b/tests/ntpd/leapsec.cpp
@@ -0,0 +1,901 @@
+#include "ntpdtest.h"
+
+extern "C" {
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_leapsec.h"
+}
+
+#include <string>
+#include <sstream>
+
+static const char leap1 [] =
+ "#\n"
+ "#@ 3610569600\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ " \t \n"
+ "2571782400 20 # 1 Jul 1981\n"
+ "2603318400 21 # 1 Jul 1982\n"
+ "2634854400 22 # 1 Jul 1983\n"
+ "2698012800 23 # 1 Jul 1985\n"
+ "2776982400 24 # 1 Jan 1988\n"
+ "2840140800 25 # 1 Jan 1990\n"
+ "2871676800 26 # 1 Jan 1991\n"
+ "2918937600 27 # 1 Jul 1992\n"
+ "2950473600 28 # 1 Jul 1993\n"
+ "2982009600 29 # 1 Jul 1994\n"
+ "3029443200 30 # 1 Jan 1996\n"
+ "3076704000 31 # 1 Jul 1997\n"
+ "3124137600 32 # 1 Jan 1999\n"
+ "3345062400 33 # 1 Jan 2006\n"
+ "3439756800 34 # 1 Jan 2009\n"
+ "3550089600 35 # 1 Jul 2012\n"
+ "#\n"
+ "#h dc2e6b0b 5aade95d a0587abd 4e0dacb4 e4d5049e\n"
+ "#\n";
+
+static const char leap2 [] =
+ "#\n"
+ "#@ 2950473700\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ "2571782400 20 # 1 Jul 1981\n"
+ "2603318400 21 # 1 Jul 1982\n"
+ "2634854400 22 # 1 Jul 1983\n"
+ "2698012800 23 # 1 Jul 1985\n"
+ "2776982400 24 # 1 Jan 1988\n"
+ "2840140800 25 # 1 Jan 1990\n"
+ "2871676800 26 # 1 Jan 1991\n"
+ "2918937600 27 # 1 Jul 1992\n"
+ "2950473600 28 # 1 Jul 1993\n"
+ "#\n";
+
+// Faked table with a leap second removal at 2009
+static const char leap3 [] =
+ "#\n"
+ "#@ 3610569600\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ "2571782400 20 # 1 Jul 1981\n"
+ "2603318400 21 # 1 Jul 1982\n"
+ "2634854400 22 # 1 Jul 1983\n"
+ "2698012800 23 # 1 Jul 1985\n"
+ "2776982400 24 # 1 Jan 1988\n"
+ "2840140800 25 # 1 Jan 1990\n"
+ "2871676800 26 # 1 Jan 1991\n"
+ "2918937600 27 # 1 Jul 1992\n"
+ "2950473600 28 # 1 Jul 1993\n"
+ "2982009600 29 # 1 Jul 1994\n"
+ "3029443200 30 # 1 Jan 1996\n"
+ "3076704000 31 # 1 Jul 1997\n"
+ "3124137600 32 # 1 Jan 1999\n"
+ "3345062400 33 # 1 Jan 2006\n"
+ "3439756800 32 # 1 Jan 2009\n"
+ "3550089600 33 # 1 Jul 2012\n"
+ "#\n";
+
+// short table with good hash
+static const char leap_ghash [] =
+ "#\n"
+ "#@ 3610569600\n"
+ "#$ 3610566000\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ "#\n"
+ "#h 4b304e10 95642b3f c10b91f9 90791725 25f280d0\n"
+ "#\n";
+
+// short table with bad hash
+static const char leap_bhash [] =
+ "#\n"
+ "#@ 3610569600\n"
+ "#$ 3610566000\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ "#\n"
+ "#h dc2e6b0b 5aade95d a0587abd 4e0dacb4 e4d5049e\n"
+ "#\n";
+
+// short table with malformed hash
+static const char leap_mhash [] =
+ "#\n"
+ "#@ 3610569600\n"
+ "#$ 3610566000\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ "#\n"
+ "#h f2349a02 788b9534 a8f2e141 f2029Q6d 4064a7ee\n"
+ "#\n";
+
+// short table with only 4 hash groups
+static const char leap_shash [] =
+ "#\n"
+ "#@ 3610569600\n"
+ "#$ 3610566000\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ "#\n"
+ "#h f2349a02 788b9534 a8f2e141 f2029Q6d\n"
+ "#\n";
+
+// table with good hash and truncated/missing leading zeros
+static const char leap_gthash [] = {
+ "#\n"
+ "#$ 3535228800\n"
+ "#\n"
+ "# Updated through IERS Bulletin C46\n"
+ "# File expires on: 28 June 2014\n"
+ "#\n"
+ "#@ 3612902400\n"
+ "#\n"
+ "2272060800 10 # 1 Jan 1972\n"
+ "2287785600 11 # 1 Jul 1972\n"
+ "2303683200 12 # 1 Jan 1973\n"
+ "2335219200 13 # 1 Jan 1974\n"
+ "2366755200 14 # 1 Jan 1975\n"
+ "2398291200 15 # 1 Jan 1976\n"
+ "2429913600 16 # 1 Jan 1977\n"
+ "2461449600 17 # 1 Jan 1978\n"
+ "2492985600 18 # 1 Jan 1979\n"
+ "2524521600 19 # 1 Jan 1980\n"
+ "2571782400 20 # 1 Jul 1981\n"
+ "2603318400 21 # 1 Jul 1982\n"
+ "2634854400 22 # 1 Jul 1983\n"
+ "2698012800 23 # 1 Jul 1985\n"
+ "2776982400 24 # 1 Jan 1988\n"
+ "2840140800 25 # 1 Jan 1990\n"
+ "2871676800 26 # 1 Jan 1991\n"
+ "2918937600 27 # 1 Jul 1992\n"
+ "2950473600 28 # 1 Jul 1993\n"
+ "2982009600 29 # 1 Jul 1994\n"
+ "3029443200 30 # 1 Jan 1996\n"
+ "3076704000 31 # 1 Jul 1997\n"
+ "3124137600 32 # 1 Jan 1999\n"
+ "3345062400 33 # 1 Jan 2006\n"
+ "3439756800 34 # 1 Jan 2009\n"
+ "3550089600 35 # 1 Jul 2012\n"
+ "#\n"
+ "#h 1151a8f e85a5069 9000fcdb 3d5e5365 1d505b37"
+};
+
+static uint32_t lsec2009 = 3439756800u; // 1 Jan 2009, 00:00:00 utc
+static uint32_t lsec2012 = 3550089600u; // 1 Jul 2012, 00:00:00 utc
+
+int stringreader(void* farg)
+{
+ const char ** cpp = (const char**)farg;
+ if (**cpp)
+ return *(*cpp)++;
+ else
+ return EOF;
+}
+
+static int/*BOOL*/
+setup_load_table(
+ const char * cp,
+ int blim=FALSE)
+{
+ int rc;
+ leap_table_t * pt = leapsec_get_table(0);
+ rc = (pt != NULL) && leapsec_load(pt, stringreader, &cp, blim);
+ rc = rc && leapsec_set_table(pt);
+ return rc;
+}
+
+static int/*BOOL*/
+setup_clear_table()
+{
+ int rc;
+ leap_table_t * pt = leapsec_get_table(0);
+ if (pt)
+ leapsec_clear(pt);
+ rc = leapsec_set_table(pt);
+ return rc;
+}
+
+
+class leapsecTest : public ntpdtest {
+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 leapsecTest::SetUp()
+{
+ ntpcal_set_timefunc(timefunc);
+ settime(1970, 1, 1, 0, 0, 0);
+ leapsec_electric(1);
+}
+
+void leapsecTest::TearDown()
+{
+ ntpcal_set_timefunc(NULL);
+}
+
+// =====================================================================
+// VALIDATION TESTS
+// =====================================================================
+
+// ----------------------------------------------------------------------
+TEST_F(leapsecTest, ValidateGood) {
+ const char *cp = leap_ghash;
+ int rc = leapsec_validate(stringreader, &cp);
+ EXPECT_EQ(LSVALID_GOODHASH, rc);
+}
+
+// ----------------------------------------------------------------------
+TEST_F(leapsecTest, ValidateNoHash) {
+ const char *cp = leap2;
+ int rc = leapsec_validate(stringreader, &cp);
+ EXPECT_EQ(LSVALID_NOHASH, rc);
+}
+
+// ----------------------------------------------------------------------
+TEST_F(leapsecTest, ValidateBad) {
+ const char *cp = leap_bhash;
+ int rc = leapsec_validate(stringreader, &cp);
+ EXPECT_EQ(LSVALID_BADHASH, rc);
+}
+
+// ----------------------------------------------------------------------
+TEST_F(leapsecTest, ValidateMalformed) {
+ const char *cp = leap_mhash;
+ int rc = leapsec_validate(stringreader, &cp);
+ EXPECT_EQ(LSVALID_BADFORMAT, rc);
+}
+
+// ----------------------------------------------------------------------
+TEST_F(leapsecTest, ValidateMalformedShort) {
+ const char *cp = leap_shash;
+ int rc = leapsec_validate(stringreader, &cp);
+ EXPECT_EQ(LSVALID_BADFORMAT, rc);
+}
+
+// ----------------------------------------------------------------------
+TEST_F(leapsecTest, ValidateNoLeadZero) {
+ const char *cp = leap_gthash;
+ int rc = leapsec_validate(stringreader, &cp);
+ EXPECT_EQ(LSVALID_GOODHASH, rc);
+}
+
+// =====================================================================
+// BASIC FUNCTIONS
+// =====================================================================
+
+// ----------------------------------------------------------------------
+// test table selection
+TEST_F(leapsecTest, tableSelect) {
+ leap_table_t *pt1, *pt2, *pt3, *pt4;
+
+ pt1 = leapsec_get_table(0);
+ pt2 = leapsec_get_table(0);
+ EXPECT_EQ(pt1, pt2);
+
+ pt1 = leapsec_get_table(1);
+ pt2 = leapsec_get_table(1);
+ EXPECT_EQ(pt1, pt2);
+
+ pt1 = leapsec_get_table(1);
+ pt2 = leapsec_get_table(0);
+ EXPECT_NE(pt1, pt2);
+
+ pt1 = leapsec_get_table(0);
+ pt2 = leapsec_get_table(1);
+ EXPECT_NE(pt1, pt2);
+
+ leapsec_set_table(pt1);
+ pt2 = leapsec_get_table(0);
+ pt3 = leapsec_get_table(1);
+ EXPECT_EQ(pt1, pt2);
+ EXPECT_NE(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);
+}
+
+// ----------------------------------------------------------------------
+// load file & check expiration
+TEST_F(leapsecTest, loadFileExpire) {
+ 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);
+ rc = leapsec_expired(3439756800, NULL);
+ EXPECT_EQ(0, rc);
+ rc = leapsec_expired(3610569601, NULL);
+ EXPECT_EQ(1, rc);
+}
+
+// ----------------------------------------------------------------------
+// load file & check time-to-live
+TEST_F(leapsecTest, loadFileTTL) {
+ const char *cp = leap1;
+ int rc;
+ leap_table_t * pt = leapsec_get_table(0);
+ time_t pivot = 0x70000000;
+
+ const uint32_t limit = 3610569600u;
+
+ rc = leapsec_load(pt, stringreader, &cp, FALSE)
+ && leapsec_set_table(pt);
+ ASSERT_EQ(1, rc);
+
+ // exactly 1 day to live
+ rc = leapsec_daystolive(limit - 86400, &pivot);
+ EXPECT_EQ( 1, rc);
+ // less than 1 day to live
+ rc = leapsec_daystolive(limit - 86399, &pivot);
+ EXPECT_EQ( 0, rc);
+ // hit expiration exactly
+ rc = leapsec_daystolive(limit, &pivot);
+ EXPECT_EQ( 0, rc);
+ // expired since 1 sec
+ rc = leapsec_daystolive(limit + 1, &pivot);
+ EXPECT_EQ(-1, rc);
+}
+
+// ----------------------------------------------------------------------
+// ad-hoc jump: leap second at 2009.01.01 -60days
+TEST_F(leapsecTest, ls2009faraway) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(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);
+}
+
+// ----------------------------------------------------------------------
+// ad-hoc jump: leap second at 2009.01.01 -1week
+TEST_F(leapsecTest, ls2009weekaway) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(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);
+}
+
+// ----------------------------------------------------------------------
+// ad-hoc jump: leap second at 2009.01.01 -1hr
+TEST_F(leapsecTest, ls2009houraway) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(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);
+}
+
+// ----------------------------------------------------------------------
+// ad-hoc jump: leap second at 2009.01.01 -1sec
+TEST_F(leapsecTest, ls2009secaway) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(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);
+}
+
+// ----------------------------------------------------------------------
+// ad-hoc jump to leap second at 2009.01.01
+TEST_F(leapsecTest, ls2009onspot) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(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 handling of the leap second at 2009.01.01 without table
+TEST_F(leapsecTest, ls2009nodata) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_clear_table();
+ EXPECT_EQ(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 handling of the leap second at 2009.01.01 with culled data
+TEST_F(leapsecTest, ls2009limdata) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1, TRUE);
+ EXPECT_EQ(1, rc);
+
+ // test on-spot with limted table - does not work if build before 2013!
+ rc = leapsec_query(&qr, lsec2009, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(35, qr.tai_offs);
+ EXPECT_EQ(0, qr.tai_diff);
+ EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+}
+
+// ----------------------------------------------------------------------
+// add dynamic leap second (like from peer/clock)
+TEST_F(leapsecTest, addDynamic) {
+ int rc;
+ leap_result_t qr;
+
+ static const uint32_t insns[] = {
+ 2982009600, // 29 # 1 Jul 1994
+ 3029443200, // 30 # 1 Jan 1996
+ 3076704000, // 31 # 1 Jul 1997
+ 3124137600, // 32 # 1 Jan 1999
+ 3345062400, // 33 # 1 Jan 2006
+ 3439756800, // 34 # 1 Jan 2009
+ 3550089600, // 35 # 1 Jul 2012
+ 0 // sentinel
+ };
+
+ rc = setup_load_table(leap2, FALSE);
+ EXPECT_EQ(1, rc);
+
+ leap_table_t * pt = leapsec_get_table(0);
+ for (int idx=1; insns[idx]; ++idx) {
+ rc = leapsec_add_dyn(TRUE, insns[idx] - 20*SECSPERDAY - 100, NULL);
+ EXPECT_EQ(TRUE, rc);
+ }
+ // try to slip in a previous entry
+ rc = leapsec_add_dyn(TRUE, insns[0] - 20*SECSPERDAY - 100, NULL);
+ EXPECT_EQ(FALSE, rc);
+ //leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
+}
+
+// ----------------------------------------------------------------------
+// add fixed leap seconds (like from network packet)
+TEST_F(leapsecTest, addFixed) {
+ int rc;
+ leap_result_t qr;
+
+ static const struct { uint32_t tt; int of; } insns[] = {
+ {2982009600, 29},// # 1 Jul 1994
+ {3029443200, 30},// # 1 Jan 1996
+ {3076704000, 31},// # 1 Jul 1997
+ {3124137600, 32},// # 1 Jan 1999
+ {3345062400, 33},// # 1 Jan 2006
+ {3439756800, 34},// # 1 Jan 2009
+ {3550089600, 35},// # 1 Jul 2012
+ {0,0} // sentinel
+ };
+
+ rc = setup_load_table(leap2, FALSE);
+ EXPECT_EQ(1, rc);
+
+ leap_table_t * pt = leapsec_get_table(0);
+ // try to get in BAD time stamps...
+ for (int 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);
+ }
+ // no do it right
+ for (int 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);
+ }
+ // try to slip in a previous entry
+ rc = leapsec_add_fix(
+ insns[0].of,
+ insns[0].tt,
+ insns[0].tt + SECSPERDAY,
+ NULL);
+ EXPECT_EQ(FALSE, rc);
+ //leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
+}
+
+// =====================================================================
+// SEQUENCE TESTS
+// =====================================================================
+
+// ----------------------------------------------------------------------
+// leap second insert at 2009.01.01, electric mode
+TEST_F(leapsecTest, ls2009seqInsElectric) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(1, rc);
+ 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);
+
+ rc = leapsec_query(&qr, lsec2009 - 7*SECSPERDAY, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2009 - 1, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ // 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);
+}
+
+// ----------------------------------------------------------------------
+// leap second insert at 2009.01.01, dumb mode
+TEST_F(leapsecTest, ls2009seqInsDumb) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(1, rc);
+ leapsec_electric(0);
+
+ rc = leapsec_query(&qr, lsec2009 - 60*SECSPERDAY, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2009 - SECSPERHR, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2009, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ // 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);
+}
+
+
+// ----------------------------------------------------------------------
+// fake leap second remove at 2009.01.01, electric mode
+TEST_F(leapsecTest, ls2009seqDelElectric) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap3);
+ EXPECT_EQ(1, rc);
+ 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);
+
+ rc = leapsec_query(&qr, lsec2009 - 7*SECSPERDAY, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2009 - 1, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ // 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);
+}
+
+// ----------------------------------------------------------------------
+// fake leap second remove at 2009.01.01. dumb mode
+TEST_F(leapsecTest, ls2009seqDelDumb) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap3);
+ EXPECT_EQ(1, rc);
+ leapsec_electric(0);
+
+ rc = leapsec_query(&qr, lsec2009 - 60*SECSPERDAY, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2009 - SECSPERHR, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2009 - 1, NULL);
+ EXPECT_EQ(TRUE, rc);
+ EXPECT_EQ(1, qr.warped );
+ EXPECT_EQ(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);
+}
+
+// ----------------------------------------------------------------------
+// leap second insert at 2012.07.01, electric mode
+TEST_F(leapsecTest, ls2012seqInsElectric) {
+ int rc;
+ leap_result_t qr;
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(1, rc);
+
+ rc = leapsec_query(&qr, lsec2012 - 60*SECSPERDAY, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2012 - SECSPERHR, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2012, NULL);
+ EXPECT_EQ(TRUE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+}
+
+// ----------------------------------------------------------------------
+// leap second insert at 2012.07.01, dumb mode
+TEST_F(leapsecTest, ls2012seqInsDumb) {
+ int rc;
+ leap_result_t qr;
+
+ leapsec_electric(0);
+ EXPECT_EQ(0, leapsec_electric(-1));
+ EXPECT_EQ(0, leapsec_electric(-1));
+
+ rc = setup_load_table(leap1);
+ EXPECT_EQ(1, rc);
+
+ rc = leapsec_query(&qr, lsec2012 - 60*SECSPERDAY, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ rc = leapsec_query(&qr, lsec2012 - SECSPERHR, NULL);
+ EXPECT_EQ(FALSE, rc);
+ EXPECT_EQ(0, qr.warped );
+ EXPECT_EQ(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);
+
+ // 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);
+
+ // 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);
+
+ // 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);
+}
+
diff --git a/tests/ntpd/ntpdtest.cpp b/tests/ntpd/ntpdtest.cpp
new file mode 100644
index 0000000..76b3b1a
--- /dev/null
+++ b/tests/ntpd/ntpdtest.cpp
@@ -0,0 +1,27 @@
+#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/tests/ntpd/ntpdtest.h b/tests/ntpd/ntpdtest.h
new file mode 100644
index 0000000..cc3172a
--- /dev/null
+++ b/tests/ntpd/ntpdtest.h
@@ -0,0 +1,15 @@
+#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/util/Makefile.am b/util/Makefile.am
new file mode 100644
index 0000000..4265e0b
--- /dev/null
+++ b/util/Makefile.am
@@ -0,0 +1,135 @@
+NULL=
+
+bin_PROGRAMS= $(NTP_KEYGEN_DB) $(NTPTIME_DB) $(TICKADJ_DB) $(TIMETRIM_DB)
+libexec_PROGRAMS= $(NTP_KEYGEN_DL) $(NTPTIME_DL) $(TICKADJ_DL) $(TIMETRIM_DL)
+sbin_PROGRAMS= $(NTP_KEYGEN_DS) $(NTPTIME_DS) $(TICKADJ_DS) $(TIMETRIM_DS)
+
+EXTRA_PROGRAMS= audio-pcm byteorder hist jitter kern longsize ntp-keygen \
+ ntptime pps-api precision sht testrs6000 tg tg2 tickadj timetrim
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+tg2_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
+ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a
+ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
+ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
+
+tickadj_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST)
+
+EXTRA_DIST= \
+ invoke-ntp-keygen.menu \
+ invoke-ntp-keygen.texi \
+ ntp-keygen-opts.def \
+ ntp-keygen.1ntp-keygenman \
+ ntp-keygen.1ntp-keygenmdoc \
+ ntp-keygen.man.in \
+ ntp-keygen.mdoc.in \
+ ntp-keygen.mdoc.in \
+ ntp-keygen.html \
+ ntp-keygen.texi \
+ $(NULL)
+
+BUILT_SOURCES= ntp-keygen-opts.c ntp-keygen-opts.h
+CLEANFILES=
+DISTCLEANFILES= .version version.c config.log $(man_MANS)
+
+html_DATA= \
+ $(srcdir)/ntp-keygen.html \
+ $(NULL)
+
+noinst_DATA= \
+ $(srcdir)/invoke-ntp-keygen.menu \
+ $(srcdir)/invoke-ntp-keygen.texi \
+ $(srcdir)/ntp-keygen.man.in \
+ $(srcdir)/ntp-keygen.mdoc.in \
+ $(man_MANS) \
+ $(NULL)
+
+man1_MANS=
+man8_MANS=
+man_MANS= ntp-keygen.$(NTP_KEYGEN_MS)
+
+run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+$(srcdir)/ntp-keygen-opts.h: $(srcdir)/ntp-keygen-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntp-keygen-opts.c: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) ntp-keygen-opts.def
+
+###
+
+$(srcdir)/ntp-keygen.1ntp-keygenman: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-keygenman -Tagman-cmd.tpl ntp-keygen-opts.def
+
+$(srcdir)/ntp-keygen.man.in: $(srcdir)/ntp-keygen.1ntp-keygenman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenman > $(srcdir)/ntp-keygen.man.in+
+ mv $(srcdir)/ntp-keygen.man.in+ $(srcdir)/ntp-keygen.man.in
+
+###
+
+$(srcdir)/ntp-keygen.1ntp-keygenmdoc: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-keygenmdoc -Tagmdoc-cmd.tpl ntp-keygen-opts.def
+
+$(srcdir)/ntp-keygen.mdoc.in: $(srcdir)/ntp-keygen.1ntp-keygenmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenmdoc > $(srcdir)/ntp-keygen.mdoc.in+
+ mv $(srcdir)/ntp-keygen.mdoc.in+ $(srcdir)/ntp-keygen.mdoc.in
+
+###
+
+ntp-keygen.$(NTP_KEYGEN_MS): $(srcdir)/ntp-keygen.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp-keygen.$(NTP_KEYGEN_MS)+:$(srcdir)/ntp-keygen.$(MANTAGFMT).in
+ mv ntp-keygen.$(NTP_KEYGEN_MS)+ ntp-keygen.$(NTP_KEYGEN_MS)
+
+###
+
+$(srcdir)/invoke-ntp-keygen.menu: $(srcdir)/invoke-ntp-keygen.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp-keygen.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-keygen-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntp-keygen.html: $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true )
+
+
+jitter_SOURCES= jitter.c jitter.h
+jitter_LDADD=
+
+kern.o: kern.c
+ $(COMPILE) -DHAVE_TIMEX_H -c kern.c
+
+$(PROGRAMS): version.o
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+include $(top_srcdir)/bincheck.mf
+include $(top_srcdir)/sntp/check-libntp.mf
+include $(top_srcdir)/check-libopts.mf
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/util/Makefile.in b/util/Makefile.in
new file mode 100644
index 0000000..06293ac
--- /dev/null
+++ b/util/Makefile.in
@@ -0,0 +1,1289 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# we traditionally installed software in bindir, while it should have gone
+# in sbindir. Now that we offer a choice, look in the "other" installation
+# subdir to warn folks if there is another version there.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = audio-pcm$(EXEEXT) byteorder$(EXEEXT) hist$(EXEEXT) \
+ jitter$(EXEEXT) kern$(EXEEXT) longsize$(EXEEXT) \
+ ntp-keygen$(EXEEXT) ntptime$(EXEEXT) pps-api$(EXEEXT) \
+ precision$(EXEEXT) sht$(EXEEXT) testrs6000$(EXEEXT) \
+ tg$(EXEEXT) tg2$(EXEEXT) tickadj$(EXEEXT) timetrim$(EXEEXT)
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf \
+ $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/check-libntp.mf
+subdir = util
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/libevent/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/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_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"
+PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+audio_pcm_SOURCES = audio-pcm.c
+audio_pcm_OBJECTS = audio-pcm.$(OBJEXT)
+audio_pcm_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+audio_pcm_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+byteorder_SOURCES = byteorder.c
+byteorder_OBJECTS = byteorder.$(OBJEXT)
+byteorder_LDADD = $(LDADD)
+byteorder_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+hist_SOURCES = hist.c
+hist_OBJECTS = hist.$(OBJEXT)
+hist_LDADD = $(LDADD)
+hist_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_jitter_OBJECTS = jitter.$(OBJEXT)
+jitter_OBJECTS = $(am_jitter_OBJECTS)
+jitter_DEPENDENCIES =
+kern_SOURCES = kern.c
+kern_OBJECTS = kern.$(OBJEXT)
+kern_LDADD = $(LDADD)
+kern_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+longsize_SOURCES = longsize.c
+longsize_OBJECTS = longsize.$(OBJEXT)
+longsize_LDADD = $(LDADD)
+longsize_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_ntp_keygen_OBJECTS = ntp-keygen.$(OBJEXT) ntp-keygen-opts.$(OBJEXT)
+ntp_keygen_OBJECTS = $(am_ntp_keygen_OBJECTS)
+ntp_keygen_DEPENDENCIES = version.o $(am__DEPENDENCIES_1) \
+ ../libntp/libntp.a $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ntptime_SOURCES = ntptime.c
+ntptime_OBJECTS = ntptime.$(OBJEXT)
+ntptime_LDADD = $(LDADD)
+ntptime_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+pps_api_SOURCES = pps-api.c
+pps_api_OBJECTS = pps-api.$(OBJEXT)
+pps_api_LDADD = $(LDADD)
+pps_api_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+precision_SOURCES = precision.c
+precision_OBJECTS = precision.$(OBJEXT)
+precision_LDADD = $(LDADD)
+precision_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+sht_SOURCES = sht.c
+sht_OBJECTS = sht.$(OBJEXT)
+sht_LDADD = $(LDADD)
+sht_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+testrs6000_SOURCES = testrs6000.c
+testrs6000_OBJECTS = testrs6000.$(OBJEXT)
+testrs6000_LDADD = $(LDADD)
+testrs6000_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+tg_SOURCES = tg.c
+tg_OBJECTS = tg.$(OBJEXT)
+tg_LDADD = $(LDADD)
+tg_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+tg2_SOURCES = tg2.c
+tg2_OBJECTS = tg2.$(OBJEXT)
+tg2_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+tickadj_SOURCES = tickadj.c
+tickadj_OBJECTS = tickadj.$(OBJEXT)
+tickadj_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+timetrim_SOURCES = timetrim.c
+timetrim_OBJECTS = timetrim.$(OBJEXT)
+timetrim_LDADD = $(LDADD)
+timetrim_DEPENDENCIES = ../libntp/libntp.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_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_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+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_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = audio-pcm.c byteorder.c hist.c $(jitter_SOURCES) kern.c \
+ longsize.c $(ntp_keygen_SOURCES) ntptime.c pps-api.c \
+ precision.c sht.c testrs6000.c tg.c tg2.c tickadj.c timetrim.c
+DIST_SOURCES = audio-pcm.c byteorder.c hist.c $(jitter_SOURCES) kern.c \
+ longsize.c $(ntp_keygen_SOURCES) ntptime.c pps-api.c \
+ precision.c sht.c testrs6000.c tg.c tg2.c tickadj.c timetrim.c
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man1_MANS) $(man8_MANS) $(man_MANS)
+DATA = $(html_DATA) $(noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+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 =
+bin_PROGRAMS = $(NTP_KEYGEN_DB) $(NTPTIME_DB) $(TICKADJ_DB) $(TIMETRIM_DB)
+libexec_PROGRAMS = $(NTP_KEYGEN_DL) $(NTPTIME_DL) $(TICKADJ_DL) $(TIMETRIM_DL)
+sbin_PROGRAMS = $(NTP_KEYGEN_DS) $(NTPTIME_DS) $(TICKADJ_DS) $(TIMETRIM_DS)
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) $(LIBOPTS_CFLAGS) $(CPPFLAGS_NTP)
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+# LDADD might need RESLIB and ADJLIB
+LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
+tg2_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
+ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a \
+ $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
+ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
+tickadj_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST)
+EXTRA_DIST = \
+ invoke-ntp-keygen.menu \
+ invoke-ntp-keygen.texi \
+ ntp-keygen-opts.def \
+ ntp-keygen.1ntp-keygenman \
+ ntp-keygen.1ntp-keygenmdoc \
+ ntp-keygen.man.in \
+ ntp-keygen.mdoc.in \
+ ntp-keygen.mdoc.in \
+ ntp-keygen.html \
+ ntp-keygen.texi \
+ $(NULL)
+
+BUILT_SOURCES = ntp-keygen-opts.c ntp-keygen-opts.h check-libntp \
+ check-libopts .deps-ver
+CLEANFILES = check-libntp check-libopts .deps-ver
+DISTCLEANFILES = .version version.c config.log $(man_MANS)
+html_DATA = \
+ $(srcdir)/ntp-keygen.html \
+ $(NULL)
+
+noinst_DATA = \
+ $(srcdir)/invoke-ntp-keygen.menu \
+ $(srcdir)/invoke-ntp-keygen.texi \
+ $(srcdir)/ntp-keygen.man.in \
+ $(srcdir)/ntp-keygen.mdoc.in \
+ $(man_MANS) \
+ $(NULL)
+
+man1_MANS =
+man8_MANS =
+man_MANS = ntp-keygen.$(NTP_KEYGEN_MS)
+run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \
+ autogen -L ../sntp/include -L ../sntp/ag-tpl --writable
+
+std_def_list = \
+ $(top_srcdir)/sntp/include/debug-opt.def \
+ $(top_srcdir)/sntp/include/autogen-version.def \
+ $(top_srcdir)/sntp/include/copyright.def \
+ $(top_srcdir)/sntp/include/homerc.def \
+ $(top_srcdir)/sntp/include/ntp.lic \
+ $(top_srcdir)/sntp/include/version.def \
+ $(NULL)
+
+jitter_SOURCES = jitter.c jitter.h
+jitter_LDADD =
+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 .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/check-libopts.mf $(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 util/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign util/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+audio-pcm$(EXEEXT): $(audio_pcm_OBJECTS) $(audio_pcm_DEPENDENCIES)
+ @rm -f audio-pcm$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(audio_pcm_OBJECTS) $(audio_pcm_LDADD) $(LIBS)
+byteorder$(EXEEXT): $(byteorder_OBJECTS) $(byteorder_DEPENDENCIES)
+ @rm -f byteorder$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(byteorder_OBJECTS) $(byteorder_LDADD) $(LIBS)
+hist$(EXEEXT): $(hist_OBJECTS) $(hist_DEPENDENCIES)
+ @rm -f hist$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(hist_OBJECTS) $(hist_LDADD) $(LIBS)
+jitter$(EXEEXT): $(jitter_OBJECTS) $(jitter_DEPENDENCIES)
+ @rm -f jitter$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(jitter_OBJECTS) $(jitter_LDADD) $(LIBS)
+kern$(EXEEXT): $(kern_OBJECTS) $(kern_DEPENDENCIES)
+ @rm -f kern$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(kern_OBJECTS) $(kern_LDADD) $(LIBS)
+longsize$(EXEEXT): $(longsize_OBJECTS) $(longsize_DEPENDENCIES)
+ @rm -f longsize$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(longsize_OBJECTS) $(longsize_LDADD) $(LIBS)
+ntp-keygen$(EXEEXT): $(ntp_keygen_OBJECTS) $(ntp_keygen_DEPENDENCIES)
+ @rm -f ntp-keygen$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntp_keygen_OBJECTS) $(ntp_keygen_LDADD) $(LIBS)
+ntptime$(EXEEXT): $(ntptime_OBJECTS) $(ntptime_DEPENDENCIES)
+ @rm -f ntptime$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(ntptime_OBJECTS) $(ntptime_LDADD) $(LIBS)
+pps-api$(EXEEXT): $(pps_api_OBJECTS) $(pps_api_DEPENDENCIES)
+ @rm -f pps-api$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pps_api_OBJECTS) $(pps_api_LDADD) $(LIBS)
+precision$(EXEEXT): $(precision_OBJECTS) $(precision_DEPENDENCIES)
+ @rm -f precision$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(precision_OBJECTS) $(precision_LDADD) $(LIBS)
+sht$(EXEEXT): $(sht_OBJECTS) $(sht_DEPENDENCIES)
+ @rm -f sht$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(sht_OBJECTS) $(sht_LDADD) $(LIBS)
+testrs6000$(EXEEXT): $(testrs6000_OBJECTS) $(testrs6000_DEPENDENCIES)
+ @rm -f testrs6000$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(testrs6000_OBJECTS) $(testrs6000_LDADD) $(LIBS)
+tg$(EXEEXT): $(tg_OBJECTS) $(tg_DEPENDENCIES)
+ @rm -f tg$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tg_OBJECTS) $(tg_LDADD) $(LIBS)
+tg2$(EXEEXT): $(tg2_OBJECTS) $(tg2_DEPENDENCIES)
+ @rm -f tg2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tg2_OBJECTS) $(tg2_LDADD) $(LIBS)
+tickadj$(EXEEXT): $(tickadj_OBJECTS) $(tickadj_DEPENDENCIES)
+ @rm -f tickadj$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tickadj_OBJECTS) $(tickadj_LDADD) $(LIBS)
+timetrim$(EXEEXT): $(timetrim_OBJECTS) $(timetrim_DEPENDENCIES)
+ @rm -f timetrim$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(timetrim_OBJECTS) $(timetrim_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio-pcm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byteorder.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hist.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jitter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kern.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/longsize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen-opts.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp-keygen.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntptime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pps-api.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precision.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sht.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrs6000.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tg2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tickadj.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timetrim.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(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
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.8[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+install-htmlDATA: $(html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+ done
+
+uninstall-htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(htmldir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-htmlDATA install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1 install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man1 uninstall-man8
+
+.MAKE: all check install install-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-sbinPROGRAMS ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-hook \
+ install-html install-html-am install-htmlDATA install-info \
+ install-info-am install-libexecPROGRAMS install-man \
+ install-man1 install-man8 install-pdf install-pdf-am \
+ install-ps install-ps-am install-sbinPROGRAMS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-htmlDATA uninstall-libexecPROGRAMS uninstall-man \
+ uninstall-man1 uninstall-man8 uninstall-sbinPROGRAMS
+
+
+$(srcdir)/ntp-keygen-opts.h: $(srcdir)/ntp-keygen-opts.c
+ @: do-nothing action to avoid default SCCS get, .h built with .c
+
+$(srcdir)/ntp-keygen-opts.c: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) ntp-keygen-opts.def
+
+###
+
+$(srcdir)/ntp-keygen.1ntp-keygenman: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-keygenman -Tagman-cmd.tpl ntp-keygen-opts.def
+
+$(srcdir)/ntp-keygen.man.in: $(srcdir)/ntp-keygen.1ntp-keygenman $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenman > $(srcdir)/ntp-keygen.man.in+
+ mv $(srcdir)/ntp-keygen.man.in+ $(srcdir)/ntp-keygen.man.in
+
+###
+
+$(srcdir)/ntp-keygen.1ntp-keygenmdoc: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) -DMAN_SECTION=1ntp-keygenmdoc -Tagmdoc-cmd.tpl ntp-keygen-opts.def
+
+$(srcdir)/ntp-keygen.mdoc.in: $(srcdir)/ntp-keygen.1ntp-keygenmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed
+ sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-keygen.1ntp-keygenmdoc > $(srcdir)/ntp-keygen.mdoc.in+
+ mv $(srcdir)/ntp-keygen.mdoc.in+ $(srcdir)/ntp-keygen.mdoc.in
+
+###
+
+ntp-keygen.$(NTP_KEYGEN_MS): $(srcdir)/ntp-keygen.$(MANTAGFMT).in $(top_builddir)/config.status
+ $(top_builddir)/config.status --file=ntp-keygen.$(NTP_KEYGEN_MS)+:$(srcdir)/ntp-keygen.$(MANTAGFMT).in
+ mv ntp-keygen.$(NTP_KEYGEN_MS)+ ntp-keygen.$(NTP_KEYGEN_MS)
+
+###
+
+$(srcdir)/invoke-ntp-keygen.menu: $(srcdir)/invoke-ntp-keygen.texi
+ @: do-nothing action to avoid default SCCS get, .menu built with .texi
+
+$(srcdir)/invoke-ntp-keygen.texi: $(srcdir)/ntp-keygen-opts.def $(std_def_list)
+ $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-keygen-opts.def
+ $(top_srcdir)/scripts/build/check--help $@
+
+$(srcdir)/ntp-keygen.html: $(srcdir)/ntp-keygen.texi $(top_srcdir)/sntp/include/version.texi
+ cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp-keygen.html ntp-keygen.texi || true )
+
+kern.o: kern.c
+ $(COMPILE) -DHAVE_TIMEX_H -c kern.c
+
+$(PROGRAMS): version.o
+
+$(top_srcdir)/sntp/scm-rev:
+ cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev
+
+version.c: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+ env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen
+
+version.o: version.c
+ env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+
+install-exec-hook:
+ @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
+ || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
+ test ! -f ${sbindir}/$$i \
+ || echo "*** $$i is also in ${sbindir}!"; \
+ done
+ @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \
+ || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \
+ test ! -f ${bindir}/$$i \
+ || echo "*** $$i is also in ${bindir}!"; \
+ done
+
+#
+
+check-libntp: ../libntp/libntp.a
+ @echo stamp > $@
+
+../libntp/libntp.a:
+ cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+check-libopts: ../sntp/libopts/libopts.la
+ @echo stamp > $@
+
+../sntp/libopts/libopts.la:
+ -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la
+$(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/util/README b/util/README
new file mode 100644
index 0000000..d67b4c1
--- /dev/null
+++ b/util/README
@@ -0,0 +1,44 @@
+README file for directory ./util of the NTP Version 4 distribution
+
+This directory contains the sources for the various utility programs.
+See the README and RELNOTES files in the parent directory for directions
+on how to make and install these programs.
+
+The ntptime.c program checks the kernel configuration for the NTP user
+interface syscalls ntp_gettime() and ntp_adjtime(). If present, the
+current timekeeping data are displayed. If not, a dissapointment is
+displayed. See the kernel page file in the HTML documentation in
+distribution for further details. ntptime will be built be if configure
+believes your system can use it.
+
+The jitter.c program can be used to determine the timing jitter due to
+the operating system in a gettimeofday() call. For most systems the
+dominant contribution to the jitter budget is the period of the hardware
+interrupt, usually in the range 10 us-1 ms. For those systems with
+microsecond counters, such as recent Sun and certain HP and DEC systems,
+the jitter is dominated only by the operating system.
+
+The timetrim.c program can be used with SGI machines to implement a
+scheme to discipline the hardware clock frequency. See the source code
+for further information.
+
+The byteorder.c and longsize.c programs are used during the configuration
+process to determine the byte order (little or big endian) and longword
+size (32 or 64 bits). See the configure scripts for further details.
+
+The testrs6000.c program is used for testing purposes with the IBM
+RS/6000 AIX machines. Bill Jones <jones@chpc.utexas.edu> reports:
+"I could not get a tickadj of less than 40 us to work on a RS6000.
+If you set it less than 40 us do so at your own risk!"
+
+The tickadj.c program can be used to read and set various kernel
+parameters affecting NTP operations. See the tickadj page in the HTML
+documentation for further details. tickadj will be built if configure
+believes your system can use it.
+
+tg.c and tg2.c are tone generators. They make audio signals
+that emulate WWV or IRIG (-B and -E). tg runs on Solaris.
+tg2 is a clone that runs on Linux, FreeBSD, and NetBSD.
+Read the source for the fine print. tg2 has a help option
+available via -h.
+
diff --git a/util/audio-pcm.c b/util/audio-pcm.c
new file mode 100644
index 0000000..cbaf0f2
--- /dev/null
+++ b/util/audio-pcm.c
@@ -0,0 +1,154 @@
+/*
+ * audio-pcm.c - Scope out the PCM audio stuff
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(HAVE_MACHINE_SOUNDCARD_H) || defined(HAVE_SYS_SOUNDCARD_H)
+
+#include "audio.h"
+#include "ntp_stdlib.h"
+#include "ntp_syslog.h"
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <stdio.h>
+#include "ntp_string.h"
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#include <fcntl.h>
+
+#ifdef HAVE_MACHINE_SOUNDCARD_H
+# include <machine/soundcard.h>
+# define PCM_STYLE_SOUND
+#else
+# ifdef HAVE_SYS_SOUNDCARD_H
+# include <sys/soundcard.h>
+# define PCM_STYLE_SOUND
+# endif
+#endif
+
+/*
+ * Global variables
+ */
+static int ctl_fd; /* audio control file descriptor */
+
+const char *m_names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES ;
+
+void
+d_fmt(
+ unsigned int format
+ )
+{
+
+ if (format & AFMT_MU_LAW) printf("MU_LAW ");
+ if (format & AFMT_A_LAW) printf("A_LAW ");
+ if (format & AFMT_IMA_ADPCM) printf("IMA_ADPCM ");
+ if (format & AFMT_U8) printf("U8 ");
+ if (format & AFMT_S16_LE) printf("S16_LE ");
+ if (format & AFMT_S16_BE) printf("S16_BE ");
+ if (format & AFMT_S8) printf("S8 ");
+ if (format & AFMT_U16_LE) printf("U16_LE ");
+ if (format & AFMT_U16_BE) printf("U16_BE ");
+ if (format & AFMT_MPEG) printf("MPEG ");
+ if (format & AFMT_AC3) printf("AC3 ");
+ printf("\n");
+}
+
+void
+d_mixer(
+ unsigned int mixer
+ )
+{
+ int i;
+ int n = 0;
+
+ for (i = 0; i < SOUND_MIXER_NRDEVICES; ++i)
+ if ((1 << i) & mixer) {
+ if (n)
+ printf(", ");
+ printf("%s", m_names[i]);
+ n = 1;
+ }
+ printf("\n");
+}
+
+int
+main( )
+{
+ int unit = 0; /* device unit (0-3) */
+# define AI_DEV "/dev/audio%d"
+# define AC_DEV "/dev/mixer%d"
+ char ai_dev[30];
+ char ac_dev[30];
+ struct snd_size s_size;
+ snd_chan_param s_c_p;
+ snd_capabilities s_c;
+ int fd;
+ int rval;
+ char *dname = ai_dev; /* device name */
+ char *actl = ac_dev;
+ int devmask = 0, recmask = 0, recsrc = 0;
+
+ snprintf(ai_dev, sizeof(ai_dev), AI_DEV, unit);
+ snprintf(ac_dev, sizeof(ac_dev), AC_DEV, unit);
+
+ /*
+ * Open audio device. Do not complain if not there.
+ */
+ fd = open(dname, O_RDWR | O_NONBLOCK, 0777);
+ if (fd < 0)
+ return (fd);
+
+ /*
+ * Open audio control device.
+ */
+ ctl_fd = open(actl, O_RDWR);
+ if (ctl_fd < 0) {
+ fprintf(stderr, "invalid control device <%s>\n", actl);
+ close(fd);
+ return(ctl_fd);
+ }
+
+ printf("input: <%s> %d\n", dname, fd);
+ printf("control: <%s> %d\n", actl, ctl_fd);
+
+ if (ioctl(ctl_fd, SOUND_MIXER_READ_DEVMASK, &devmask) == -1)
+ printf("SOUND_MIXER_READ_DEVMASK: %s\n", strerror(errno));
+ if (ioctl(ctl_fd, SOUND_MIXER_READ_RECMASK, &recmask) == -1)
+ printf("SOUND_MIXER_READ_RECMASK: %s\n", strerror(errno));
+ if (ioctl(ctl_fd, SOUND_MIXER_READ_RECSRC, &recsrc) == -1)
+ printf("SOUND_MIXER_READ_RECSRC: %s\n", strerror(errno));
+
+ printf("devmask: %#x recmask: %#x recsrc: %#x\n",
+ devmask, recmask, recsrc);
+ printf("Devmask: "); d_mixer(devmask);
+ printf("Recmask: "); d_mixer(recmask);
+ printf("RecSrc: "); d_mixer(recsrc);
+
+ /*
+ * Set audio device parameters.
+ */
+ rval = fd;
+
+ if (ioctl(fd, AIOGSIZE, &s_size) == -1)
+ printf("AIOGSIZE: %s\n", strerror(errno));
+ else
+ printf("play_size %d, rec_size %d\n",
+ s_size.play_size, s_size.rec_size);
+
+ if (ioctl(fd, AIOGFMT, &s_c_p) == -1)
+ printf("AIOGFMT: %s\n", strerror(errno));
+ else {
+ printf("play_rate %lu, rec_rate %lu, play_format %#lx, rec_format %#lx\n",
+ s_c_p.play_rate, s_c_p.rec_rate, s_c_p.play_format, s_c_p.rec_format);
+ printf("Play format: "); d_fmt(s_c_p.play_format);
+ printf("Rec format: "); d_fmt(s_c_p.rec_format);
+ }
+
+}
+#endif /* HAVE_{MACHINE_SOUNDCARD,SYS_SOUNDCARD}_H */
diff --git a/util/byteorder.c b/util/byteorder.c
new file mode 100644
index 0000000..188536f
--- /dev/null
+++ b/util/byteorder.c
@@ -0,0 +1,56 @@
+/*
+ * This works on:
+ * Crays
+ * Conven
+ * sparc's
+ * Dec mip machines
+ * Dec alpha machines
+ * RS6000
+ * SGI's
+ */
+
+#include <stdio.h>
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ int i;
+ int big;
+ union {
+ unsigned long l;
+ char c[sizeof(long)];
+ } u;
+
+#if defined(LONG8)
+ u.l = (((long)0x08070605) << 32) | (long)0x04030201;
+#else
+ u.l = 0x04030201;
+#endif
+ if (sizeof(long) > 4) {
+ if (u.c[0] == 0x08) big = 1;
+ else big = 0;
+ } else {
+ if (u.c[0] == 0x04) big = 1;
+ else big = 0;
+ }
+ for (i=0; i< sizeof(long); i++) {
+ if (big == 1 && (u.c[i] == (sizeof(long) - i))) {
+ continue;
+ } else if (big == 0 && (u.c[i] == (i+1))) {
+ continue;
+ } else {
+ big = -1;
+ break;
+ }
+ }
+
+ if (big == 1) {
+ printf("XNTP_BIG_ENDIAN\n");
+ } else if (big == 0) {
+ printf("XNTP_LITTLE_ENDIAN\n");
+ }
+ exit(0);
+}
diff --git a/util/hist.c b/util/hist.c
new file mode 100644
index 0000000..c8cbe49
--- /dev/null
+++ b/util/hist.c
@@ -0,0 +1,110 @@
+/*
+ * This program can be used to calibrate the clock reading jitter of a
+ * particular CPU and operating system. It first tickles every element
+ * of an array, in order to force pages into memory, then repeatedly calls
+ * gettimeofday() and, finally, writes out the time values for later
+ * analysis. From this you can determine the jitter and if the clock ever
+ * runs backwards.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_types.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define NBUF 100001 /* size of basic histogram */
+#define NSRT 20000 /* size of overflow histogram */
+#define NCNT (600 * 1000000) /* sample interval (us) */
+
+int col (const void *, const void *);
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ struct timeval ts, tr, tp;
+ struct timezone tzp;
+ int i, j, n;
+ long t, u, v, w, gtod[NBUF], ovfl[NSRT];
+
+ /*
+ * Force pages into memory
+ */
+ for (i = 0; i < NBUF; i++)
+ gtod[i] = 0;
+ for (i = 0; i < NSRT; i++)
+ ovfl[i] = 0;
+
+ /*
+ * Construct histogram
+ */
+ n = 0;
+ gettimeofday(&ts, &tzp);
+ t = ts.tv_sec * 1000000 + ts.tv_usec;
+ v = t;
+ while (1) {
+ gettimeofday(&tr, &tzp);
+ u = tr.tv_sec * 1000000 + tr.tv_usec;
+ if (u - v > NCNT)
+ break;
+ w = u - t;
+ if (w <= 0) {
+/*
+ printf("error <= 0 %ld %d %d, %d %d\n", w, ts.tv_sec,
+ ts.tv_usec, tr.tv_sec, tr.tv_usec);
+*/
+ } else if (w > NBUF - 1) {
+ ovfl[n] = w;
+ if (n < NSRT - 1)
+ n++;
+ } else {
+ gtod[w]++;
+ }
+ ts = tr;
+ t = u;
+ }
+
+ /*
+ * Write out histogram
+ */
+ for (i = 0; i < NBUF - 1; i++) {
+ if (gtod[i] > 0)
+ printf("%ld %ld\n", i, gtod[i]);
+ }
+ if (n == 0)
+ return;
+ qsort(&ovfl, (size_t)n, sizeof(ovfl[0]), col);
+ w = 0;
+ j = 0;
+ for (i = 0; i < n; i++) {
+ if (ovfl[i] != w) {
+ if (j > 0)
+ printf("%ld %ld\n", w, j);
+ w = ovfl[i];
+ j = 1;
+ } else
+ j++;
+ }
+ if (j > 0)
+ printf("%ld %ld\n", w, j);
+
+ exit(0);
+}
+
+int
+col(
+ const void *vx,
+ const void *vy
+ )
+{
+ const long *x = vx;
+ const long *y = vy;
+
+ return (*x - *y);
+}
diff --git a/util/invoke-ntp-keygen.menu b/util/invoke-ntp-keygen.menu
new file mode 100644
index 0000000..bc5cfe9
--- /dev/null
+++ b/util/invoke-ntp-keygen.menu
@@ -0,0 +1 @@
+* ntp-keygen Invocation:: Invoking ntp-keygen
diff --git a/util/invoke-ntp-keygen.texi b/util/invoke-ntp-keygen.texi
new file mode 100644
index 0000000..99266fa
--- /dev/null
+++ b/util/invoke-ntp-keygen.texi
@@ -0,0 +1,1354 @@
+@node ntp-keygen Invocation
+@section Invoking ntp-keygen
+@pindex ntp-keygen
+@cindex Create a NTP host key
+@ignore
+#
+# EDIT THIS FILE WITH CAUTION (invoke-ntp-keygen.texi)
+#
+# It has been AutoGen-ed December 2, 2014 at 08:58:48 AM by AutoGen 5.18.5pre4
+# From the definitions ntp-keygen-opts.def
+# and the template file agtexi-cmd.tpl
+@end ignore
+
+
+
+This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+
+All files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+
+When used to generate message digest keys, the program produces a file
+containing ten pseudo-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the OpenSSL library is installed, it produces an additional ten
+hex-encoded random bit strings suitable for the SHA1 and other message
+digest algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys used for ordinary NTP associations, additional keys
+can be defined as passwords for the
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+utility programs.
+
+The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys are probably not compatible with anything
+other than Autokey.
+
+Some files used by this program are encrypted using a private password.
+The
+@code{-p}
+option specifies the password for local encrypted files and the
+@code{-q}
+option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+@code{gethostname()}
+function, normally the DNS name of the host is used.
+
+The
+@kbd{pw}
+option of the
+@kbd{crypto}
+configuration command specifies the read
+password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by
+@kbd{ntpd}
+without password but only on the same host.
+
+Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called
+@kbd{ntp.keys},
+is usually installed in
+@file{/etc}.
+Other files and links are usually installed in
+@file{/usr/local/etc},
+which is normally in a shared filesystem in
+NFS-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the
+@kbd{keysdir}
+configuration command in such cases.
+Normally, this is in
+@file{/etc}.
+
+This program directs commentary and error messages to the standard
+error stream
+@kbd{stderr}
+and remote files to the standard output stream
+@kbd{stdout}
+where they can be piped to other applications or redirected to files.
+The names used for generated files and links all begin with the
+string
+@kbd{ntpkey}
+and include the file type, generating host and filestamp,
+as described in the
+@quotedblleft{}Cryptographic Data Files@quotedblright{}
+section below.
+@subsubsection Running the Program
+To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually
+@file{/usr/local/etc}
+When run for the first time, or if all files with names beginning with
+@kbd{ntpkey}
+have been removed, use the
+@code{ntp-keygen}
+command without arguments to generate a
+default RSA host key and matching RSA-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+@code{ntp-keygen}
+with the
+@code{-T}
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+@code{-S}
+option and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+@code{-c}
+option.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
+
+Additional information on trusted groups and identity schemes is on the
+@quotedblleft{}Autokey Public-Key Authentication@quotedblright{}
+page.
+
+
+
+The
+@code{ntpd(1ntpdmdoc)}
+configuration command
+@code{crypto} @code{pw} @kbd{password}
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+
+
+File names begin with the prefix
+@code{ntpkey_}
+and end with the postfix
+@kbd{_hostname.filestamp},
+where
+@kbd{hostname}
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+@kbd{filestamp}
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+@code{rm} @code{ntpkey*}
+command or all files generated
+at a specific time can be removed by a
+@code{rm}
+@kbd{*filestamp}
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+
+All files are installed by default in the keys directory
+@file{/usr/local/etc},
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+@code{ntpd(1ntpdmdoc)}
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+@code{ntp-keygen}
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+@subsubsection Running the program
+The safest way to run the
+@code{ntp-keygen}
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+@file{/usr/local/etc},
+then run the program.
+When run for the first time,
+or if all
+@code{ntpkey}
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+
+Running the program as other than root and using the Unix
+@code{su}
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+@code{.rnd}
+in the user home directory.
+However, there should be only one
+@code{.rnd},
+most conveniently
+in the root directory, so it is convenient to define the
+@code{$RANDFILE}
+environment variable used by the OpenSSL library as the path to
+@code{/.rnd}.
+
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+@file{/etc}
+using the
+@code{keysdir}
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+
+
+All files are installed by default in the keys directory
+@file{/usr/local/etc},
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+@code{ntpd(1ntpdmdoc)}
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+@code{ntp-keygen}
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+@subsubsection Running the program
+The safest way to run the
+@code{ntp-keygen}
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+@file{/usr/local/etc},
+then run the program.
+When run for the first time,
+or if all
+@code{ntpkey}
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+
+Running the program as other than root and using the Unix
+@code{su}
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+@code{.rnd}
+in the user home directory.
+However, there should be only one
+@code{.rnd},
+most conveniently
+in the root directory, so it is convenient to define the
+@code{$RANDFILE}
+environment variable used by the OpenSSL library as the path to
+@code{/.rnd}.
+
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+@file{/etc}
+using the
+@code{keysdir}
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+
+s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+@ref{Authentication Options}
+section of
+@code{ntp.conf(5)}.
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+@ref{Automatic NTP Configuration Options}
+section of
+@code{ntp.conf(5)}.
+
+On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+@code{ntpkey}
+files.
+Then run
+@code{ntp-keygen}
+@code{-T}
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+@code{-T}
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+
+If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+@code{ntp-keygen}
+with the
+@code{-S} @kbd{type}
+option, where
+@kbd{type}
+is either
+@code{RSA}
+or
+@code{DSA}.
+The most often need to do this is when a DSA-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+@code{ntp-keygen}
+with the
+@code{-c} @kbd{scheme}
+option and selected
+@kbd{scheme}
+as needed.
+f
+@code{ntp-keygen}
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+
+After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+@code{ntp-keygen}
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+@code{ntpd(1ntpdmdoc)}
+should be restarted.
+When
+@code{ntpd(1ntpdmdoc)}
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+@subsubsection Identity Schemes
+As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+"Identification Schemes"
+page
+(maybe available at
+@code{http://www.eecis.udel.edu/%7emills/keygen.html}).
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+
+In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+
+The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+@code{ntp-keygen}
+@code{-P}
+@code{-p} @kbd{password}
+to generate the host key file
+@file{ntpkey_RSAkey_}@kbd{alice.filestamp}
+and trusted private certificate file
+@file{ntpkey_RSA-MD5_cert_}@kbd{alice.filestamp}.
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+@file{ntpkey_host_}@kbd{bob}
+to the host key file and soft link
+@file{ntpkey_cert_}@kbd{bob}
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+
+For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+@code{ntp-keygen}
+@code{-T}
+@code{-I}
+@code{-p} @kbd{password}
+to produce her parameter file
+@file{ntpkey_IFFpar_}@kbd{alice.filestamp},
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+@file{ntpkey_iff_}@kbd{alice}
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+
+If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+@code{ntp-keygen}
+@code{-e}
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+@file{ntpkey_iff_}@kbd{alice}
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+
+For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+@code{ntp-keygen}
+@code{-T}
+@code{-G}
+@code{-p} @kbd{password}
+to produce her parameter file
+@file{ntpkey_GQpar_}@kbd{alice.filestamp},
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+@file{ntpkey_gq_}@kbd{alice}
+to this file.
+In addition, on each host bob install a soft link
+from generic
+@file{ntpkey_gq_}@kbd{bob}
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+
+For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+@code{ntp-keygen}
+@code{-V} @kbd{n}
+@code{-p} @kbd{password},
+where
+@kbd{n}
+is the number of revokable keys (typically 5) to produce
+the parameter file
+@file{ntpkeys_MVpar_}@kbd{trish.filestamp}
+and client key files
+@file{ntpkeys_MVkeyd_}@kbd{trish.filestamp}
+where
+@kbd{d}
+is the key number (0 <
+@kbd{d}
+<
+@kbd{n}).
+Copy the parameter file to alice and install a soft link
+from the generic
+@file{ntpkey_mv_}@kbd{alice}
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+@file{ntpkey_mvkey_}@kbd{bob}
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+@subsubsection Command Line Options
+@table @asis
+@item @code{-c} @kbd{scheme}
+Select certificate message digest/signature encryption scheme.
+The
+@kbd{scheme}
+can be one of the following:
+. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+or
+@code{DSA-SHA1}.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+@code{RSA-MD5}.
+@item @code{-d}
+Enable debugging.
+This option displays the cryptographic data produced in eye-friendly billboards.
+@item @code{-e}
+Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+@item @code{-G}
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+@item @code{-g}
+Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+@item @code{-H}
+Generate new host keys, obsoleting any that may exist.
+@item @code{-I}
+Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+@item @code{-i} @kbd{name}
+Set the suject name to
+@kbd{name}.
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+@item @code{-M}
+Generate MD5 keys, obsoleting any that may exist.
+@item @code{-P}
+Generate a private certificate.
+By default, the program generates public certificates.
+@item @code{-p} @kbd{password}
+Encrypt generated files containing private data with
+@kbd{password}
+and the DES-CBC algorithm.
+@item @code{-q}
+Set the password for reading files to password.
+@item @code{-S} @code{[@code{RSA} | @code{DSA}]}
+Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+@item @code{-s} @kbd{name}
+Set the issuer name to
+@kbd{name}.
+This is used for the issuer field in certificates
+and in the file name for identity files.
+@item @code{-T}
+Generate a trusted certificate.
+By default, the program generates a non-trusted certificate.
+@item @code{-V} @kbd{nkeys}
+Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+@end table
+@subsubsection Random Seed File
+All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+@code{ntp-keygen}
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+
+It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+@code{.rnd},
+which must be available when starting the NTP daemon
+or the
+@code{ntp-keygen}
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+@code{randfile}
+subcommand of the
+@code{crypto}
+configuration command.
+If not specified in this way, or when starting the
+@code{ntp-keygen}
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+.Ev RANDFILE
+environment variable in the user home directory,
+whether root or some other user.
+If the
+.Ev RANDFILE
+environment variable is not present,
+the library will look for the
+@code{.rnd}
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+@subsubsection Cryptographic Data Files
+All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+@code{ntp-keygen}
+program and
+@code{ntpd(1ntpdmdoc)}
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+
+The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+@example
+@kbd{keyno} @kbd{type} @kbd{key}
+@end example
+where
+@kbd{keyno}
+is a positive integer in the range 1-65,535,
+@kbd{type}
+is the string MD5 defining the key format and
+@kbd{key}
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+@quoteleft{}#@quoteright{}
+character.
+
+Note that the keys used by the
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+
+The
+@code{ntp-keygen}
+program generates a MD5 symmetric keys file
+@file{ntpkey_MD5key_}@kbd{hostname.filestamp}.
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+@file{ntp.keys},
+so
+@code{ntp-keygen}
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+@code{ntpq(1ntpqmdoc)}
+and
+@code{ntpdc(1ntpdcmdoc)}
+utilities.
+
+This section was generated by @strong{AutoGen},
+using the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-keygen} program.
+This software is released under the NTP license, <http://ntp.org/license>.
+
+@menu
+* ntp-keygen usage:: ntp-keygen help/usage (@option{--help})
+* ntp-keygen imbits:: imbits option (-b)
+* ntp-keygen certificate:: certificate option (-c)
+* ntp-keygen cipher:: cipher option (-C)
+* ntp-keygen id-key:: id-key option (-e)
+* ntp-keygen gq-params:: gq-params option (-G)
+* ntp-keygen host-key:: host-key option (-H)
+* ntp-keygen iffkey:: iffkey option (-I)
+* ntp-keygen ident:: ident option (-i)
+* ntp-keygen lifetime:: lifetime option (-l)
+* ntp-keygen md5key:: md5key option (-M)
+* ntp-keygen modulus:: modulus option (-m)
+* ntp-keygen pvt-cert:: pvt-cert option (-P)
+* ntp-keygen password:: password option (-p)
+* ntp-keygen export-passwd:: export-passwd option (-q)
+* ntp-keygen sign-key:: sign-key option (-S)
+* ntp-keygen subject-name:: subject-name option (-s)
+* ntp-keygen trusted-cert:: trusted-cert option (-T)
+* ntp-keygen mv-params:: mv-params option (-V)
+* ntp-keygen mv-keys:: mv-keys option (-v)
+* ntp-keygen config:: presetting/configuring ntp-keygen
+* ntp-keygen exit status:: exit status
+* ntp-keygen Usage:: Usage
+* ntp-keygen Notes:: Notes
+* ntp-keygen Bugs:: Bugs
+@end menu
+
+@node ntp-keygen usage
+@subsection ntp-keygen help/usage (@option{--help})
+@cindex ntp-keygen help
+
+This is the automatically generated usage text for ntp-keygen.
+
+The text printed is the same whether selected with the @code{help} option
+(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print
+the usage text by passing it through a pager program.
+@code{more-help} is disabled on platforms without a working
+@code{fork(2)} function. The @code{PAGER} environment variable is
+used to select the program, defaulting to @file{more}. Both will exit
+with a status code of 0.
+
+@exampleindent 0
+@example
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p482
+Usage: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
+ Flg Arg Option-Name Description
+ -b Num imbits identity modulus bits
+ - it must be in the range:
+ 256 to 2048
+ -c Str certificate certificate scheme
+ -C Str cipher privatekey cipher
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -e no id-key Write IFF or GQ identity keys
+ -G no gq-params Generate GQ parameters and keys
+ -H no host-key generate RSA host key
+ -I no iffkey generate IFF parameters
+ -i Str ident set Autokey group name
+ -l Num lifetime set certificate lifetime
+ -M no md5key generate MD5 keys
+ -m Num modulus modulus
+ - it must be in the range:
+ 256 to 2048
+ -P no pvt-cert generate PC private certificate
+ -p Str password local private password
+ -q Str export-passwd export IFF or GQ group keys with password
+ -S Str sign-key generate sign key (RSA or DSA)
+ -s Str subject-name set host and optionally group name
+ -T no trusted-cert trusted certificate (TC scheme)
+ -V Num mv-params generate <num> MV parameters
+ -v Num mv-keys update <num> MV keys
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -> opt save-opts save the option state to a config file
+ -< Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTP_KEYGEN_*
+
+Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org>
+@end example
+@exampleindent 4
+
+@node ntp-keygen imbits
+@subsection imbits option (-b)
+@cindex ntp-keygen-imbits
+
+This is the ``identity modulus bits'' option.
+This option takes a number argument @file{imbits}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+The number of bits in the identity modulus. The default is 256.
+@node ntp-keygen certificate
+@subsection certificate option (-c)
+@cindex ntp-keygen-certificate
+
+This is the ``certificate scheme'' option.
+This option takes a string argument @file{scheme}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+scheme is one of
+RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+DSA-SHA, or DSA-SHA1.
+
+Select the certificate message digest/signature encryption scheme.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key. The default without
+this option is RSA-MD5.
+@node ntp-keygen cipher
+@subsection cipher option (-C)
+@cindex ntp-keygen-cipher
+
+This is the ``privatekey cipher'' option.
+This option takes a string argument @file{cipher}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Select the cipher which is used to encrypt the files containing
+private keys. The default is three-key triple DES in CBC mode,
+equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+available in "@code{openssl -h}" output.
+@node ntp-keygen id-key
+@subsection id-key option (-e)
+@cindex ntp-keygen-id-key
+
+This is the ``write iff or gq identity keys'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Write the IFF or GQ client keys to the standard output. This is
+intended for automatic key distribution by mail.
+@node ntp-keygen gq-params
+@subsection gq-params option (-G)
+@cindex ntp-keygen-gq-params
+
+This is the ``generate gq parameters and keys'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+@node ntp-keygen host-key
+@subsection host-key option (-H)
+@cindex ntp-keygen-host-key
+
+This is the ``generate rsa host key'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate new host keys, obsoleting any that may exist.
+@node ntp-keygen iffkey
+@subsection iffkey option (-I)
+@cindex ntp-keygen-iffkey
+
+This is the ``generate iff parameters'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate parameters for the IFF identification scheme, obsoleting
+any that may exist.
+@node ntp-keygen ident
+@subsection ident option (-i)
+@cindex ntp-keygen-ident
+
+This is the ``set autokey group name'' option.
+This option takes a string argument @file{group}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Set the optional Autokey group name to name. This is used in
+the file name of IFF, GQ, and MV client parameters files. In
+that role, the default is the host name if this option is not
+provided. The group name, if specified using @code{-i/--ident} or
+using @code{-s/--subject-name} following an '@code{@}' character,
+is also a part of the self-signed host certificate's subject and
+issuer names in the form @code{host@group} and should match the
+'@code{crypto ident}' or '@code{server ident}' configuration in
+@code{ntpd}'s configuration file.
+@node ntp-keygen lifetime
+@subsection lifetime option (-l)
+@cindex ntp-keygen-lifetime
+
+This is the ``set certificate lifetime'' option.
+This option takes a number argument @file{lifetime}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Set the certificate expiration to lifetime days from now.
+@node ntp-keygen md5key
+@subsection md5key option (-M)
+@cindex ntp-keygen-md5key
+
+This is the ``generate md5 keys'' option.
+Generate MD5 keys, obsoleting any that may exist.
+@node ntp-keygen modulus
+@subsection modulus option (-m)
+@cindex ntp-keygen-modulus
+
+This is the ``modulus'' option.
+This option takes a number argument @file{modulus}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+The number of bits in the prime modulus. The default is 512.
+@node ntp-keygen pvt-cert
+@subsection pvt-cert option (-P)
+@cindex ntp-keygen-pvt-cert
+
+This is the ``generate pc private certificate'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate a private certificate. By default, the program generates
+public certificates.
+@node ntp-keygen password
+@subsection password option (-p)
+@cindex ntp-keygen-password
+
+This is the ``local private password'' option.
+This option takes a string argument @file{passwd}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Local files containing private data are encrypted with the
+DES-CBC algorithm and the specified password. The same password
+must be specified to the local ntpd via the "crypto pw password"
+configuration command. The default password is the local
+hostname.
+@node ntp-keygen export-passwd
+@subsection export-passwd option (-q)
+@cindex ntp-keygen-export-passwd
+
+This is the ``export iff or gq group keys with password'' option.
+This option takes a string argument @file{passwd}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Export IFF or GQ identity group keys to the standard output,
+encrypted with the DES-CBC algorithm and the specified password.
+The same password must be specified to the remote ntpd via the
+"crypto pw password" configuration command. See also the option
+--id-key (-e) for unencrypted exports.
+@node ntp-keygen sign-key
+@subsection sign-key option (-S)
+@cindex ntp-keygen-sign-key
+
+This is the ``generate sign key (rsa or dsa)'' option.
+This option takes a string argument @file{sign}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+@node ntp-keygen subject-name
+@subsection subject-name option (-s)
+@cindex ntp-keygen-subject-name
+
+This is the ``set host and optionally group name'' option.
+This option takes a string argument @file{host@@group}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Set the Autokey host name, and optionally, group name specified
+following an '@code{@}' character. The host name is used in the file
+name of generated host and signing certificates, without the
+group name. The host name, and if provided, group name are used
+in @code{host@group} form for the host certificate's subject and issuer
+fields. Specifying '@code{-s @group}' is allowed, and results in
+leaving the host name unchanged while appending @code{@group} to the
+subject and issuer fields, as with @code{-i group}. The group name, or
+if not provided, the host name are also used in the file names
+of IFF, GQ, and MV client parameter files.
+@node ntp-keygen trusted-cert
+@subsection trusted-cert option (-T)
+@cindex ntp-keygen-trusted-cert
+
+This is the ``trusted certificate (tc scheme)'' option.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate a trusted certificate. By default, the program generates
+a non-trusted certificate.
+@node ntp-keygen mv-params
+@subsection mv-params option (-V)
+@cindex ntp-keygen-mv-params
+
+This is the ``generate <num> mv parameters'' option.
+This option takes a number argument @file{num}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+Generate parameters and keys for the Mu-Varadharajan (MV)
+identification scheme.
+@node ntp-keygen mv-keys
+@subsection mv-keys option (-v)
+@cindex ntp-keygen-mv-keys
+
+This is the ``update <num> mv keys'' option.
+This option takes a number argument @file{num}.
+
+@noindent
+This option has some usage constraints. It:
+@itemize @bullet
+@item
+must be compiled in by defining @code{AUTOKEY} during the compilation.
+@end itemize
+
+This option has no @samp{doc} documentation.
+
+
+@node ntp-keygen config
+@subsection presetting/configuring ntp-keygen
+
+Any option that is not marked as @i{not presettable} may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTP-KEYGEN} and @code{NTP-KEYGEN_<OPTION_NAME>}. @code{<OPTION_NAME>} must be one of
+the options listed above in upper case and segmented with underscores.
+The @code{NTP-KEYGEN} variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+
+@noindent
+@code{libopts} will search in 2 places for configuration files:
+@itemize @bullet
+@item
+$HOME
+@item
+$PWD
+@end itemize
+The environment variables @code{HOME}, and @code{PWD}
+are expanded and replaced when @file{ntp-keygen} runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named @file{.ntprc} is searched for
+within that directory and processed.
+
+Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+@example
+[NTP-KEYGEN]
+@end example
+@noindent
+or by
+@example
+<?program ntp-keygen>
+@end example
+@noindent
+Do not mix these styles within one configuration file.
+
+Compound values and carefully constructed string values may also be
+specified using XML syntax:
+@example
+<option-name>
+ <sub-opt>...&lt;...&gt;...</sub-opt>
+</option-name>
+@end example
+@noindent
+yielding an @code{option-name.sub-opt} string value of
+@example
+"...<...>..."
+@end example
+@code{AutoOpts} does not track suboptions. You simply note that it is a
+hierarchicly valued option. @code{AutoOpts} does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+The command line options relating to configuration and/or usage help are:
+
+@subsubheading version (-)
+
+Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+@table @samp
+@item version
+Only print the version. This is the default.
+@item copyright
+Name the copyright usage licensing terms.
+@item verbose
+Print the full copyright usage licensing terms.
+@end table
+
+@node ntp-keygen exit status
+@subsection ntp-keygen exit status
+
+One of the following exit values will be returned:
+@table @samp
+@item 0 (EXIT_SUCCESS)
+Successful program execution.
+@item 1 (EXIT_FAILURE)
+The operation failed or the command syntax was not valid.
+@item 66 (EX_NOINPUT)
+A specified configuration file could not be loaded.
+@item 70 (EX_SOFTWARE)
+libopts had an internal operational error. Please report
+it to autogen-users@@lists.sourceforge.net. Thank you.
+@end table
+@node ntp-keygen Usage
+@subsection ntp-keygen Usage
+@node ntp-keygen Notes
+@subsection ntp-keygen Notes
+@node ntp-keygen Bugs
+@subsection ntp-keygen Bugs
diff --git a/util/jitter.c b/util/jitter.c
new file mode 100644
index 0000000..62a84ad
--- /dev/null
+++ b/util/jitter.c
@@ -0,0 +1,136 @@
+/*
+ * This program can be used to calibrate the clock reading jitter of a
+ * particular CPU and operating system. It first tickles every element
+ * of an array, in order to force pages into memory, then repeatedly
+ * reads the system clock and, finally, writes out the time values for
+ * later analysis. From this you can determine the jitter and if the
+ * clock ever runs backwards.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include "jitter.h"
+
+#define NBUF 800002
+#define FRAC 4294967296. /* a bbbbillion */
+#define JAN_1970 2208988800UL /* Unix base epoch */
+#define CLOCK_GETTIME /* Solaris hires clock */
+
+char progname[10];
+double sys_residual;
+double average;
+void sys_gettime(l_fp *);
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ l_fp tr;
+ int i, j;
+ double dtemp, gtod[NBUF];
+
+ /*
+ * Force pages into memory
+ */
+ for (i = 0; i < NBUF; i ++)
+ gtod[i] = 0;
+
+ /*
+ * Construct gtod array
+ */
+ for (i = 0; i < NBUF; i ++) {
+ get_systime(&tr);
+ LFPTOD(&tr, gtod[i]);
+ }
+
+ /*
+ * Write out gtod array for later processing with Matlab
+ */
+ average = 0;
+ for (i = 0; i < NBUF - 2; i++) {
+ gtod[i] = gtod[i + 1] - gtod[i];
+ printf("%13.9f\n", gtod[i]);
+ average += gtod[i];
+ }
+
+ /*
+ * Sort the gtod array and display deciles
+ */
+ for (i = 0; i < NBUF - 2; i++) {
+ for (j = 0; j <= i; j++) {
+ if (gtod[j] > gtod[i]) {
+ dtemp = gtod[j];
+ gtod[j] = gtod[i];
+ gtod[i] = dtemp;
+ }
+ }
+ }
+ average = average / (NBUF - 2);
+ fprintf(stderr, "Average %13.9f\n", average);
+ fprintf(stderr, "First rank\n");
+ for (i = 0; i < 10; i++)
+ fprintf(stderr, "%2d %13.9f\n", i, gtod[i]);
+ fprintf(stderr, "Last rank\n");
+ for (i = NBUF - 12; i < NBUF - 2; i++)
+ fprintf(stderr, "%2d %13.9f\n", i, gtod[i]);
+ exit(0);
+}
+
+
+/*
+ * get_systime - return system time in NTP timestamp format.
+ */
+void
+get_systime(
+ l_fp *now /* system time */
+ )
+{
+ double dtemp;
+
+#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_GETCLOCK)
+ struct timespec ts; /* seconds and nanoseconds */
+
+ /*
+ * Convert Unix clock from seconds and nanoseconds to seconds.
+ */
+# ifdef HAVE_CLOCK_GETTIME
+ clock_gettime(CLOCK_REALTIME, &ts);
+# else
+ getclock(TIMEOFDAY, &ts);
+# endif
+ now->l_i = ts.tv_sec + JAN_1970;
+ dtemp = ts.tv_nsec / 1e9;
+
+#else /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */
+ struct timeval tv; /* seconds and microseconds */
+
+ /*
+ * Convert Unix clock from seconds and microseconds to seconds.
+ */
+ gettimeofday(&tv, NULL);
+ now->l_i = tv.tv_sec + JAN_1970;
+ dtemp = tv.tv_usec / 1e6;
+
+#endif /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */
+
+ /*
+ * Renormalize to seconds past 1900 and fraction.
+ */
+ dtemp += sys_residual;
+ if (dtemp >= 1) {
+ dtemp -= 1;
+ now->l_i++;
+ } else if (dtemp < -1) {
+ dtemp += 1;
+ now->l_i--;
+ }
+ dtemp *= FRAC;
+ now->l_uf = (u_int32)dtemp;
+}
diff --git a/util/jitter.h b/util/jitter.h
new file mode 100644
index 0000000..8c774b0
--- /dev/null
+++ b/util/jitter.h
@@ -0,0 +1,401 @@
+/*
+ * ntp_types.h - defines how int32 and u_int32 are treated.
+ * For 64 bit systems like the DEC Alpha, they have to be defined
+ * as int and u_int.
+ * For 32 bit systems, define them as long and u_long
+ */
+#define SIZEOF_INT 4
+
+/*
+ * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H,
+ * and u_int isn't defined anywhere
+ */
+#if defined(VMS)
+#include <socket.h>
+typedef unsigned int u_int;
+/*
+ * Note: VMS DECC has long == int (even on __alpha),
+ * so the distinction below doesn't matter
+ */
+#endif /* VMS */
+
+#if (SIZEOF_INT == 4)
+# ifndef int32
+# define int32 int
+# endif
+# ifndef u_int32
+# define u_int32 unsigned int
+# endif
+#else /* not sizeof(int) == 4 */
+# if (SIZEOF_LONG == 4)
+# else /* not sizeof(long) == 4 */
+# ifndef int32
+# define int32 long
+# endif
+# ifndef u_int32
+# define u_int32 unsigned long
+# endif
+# endif /* not sizeof(long) == 4 */
+# include "Bletch: what's 32 bits on this machine?"
+#endif /* not sizeof(int) == 4 */
+
+typedef unsigned short associd_t; /* association ID */
+typedef u_int32 keyid_t; /* cryptographic key ID */
+typedef u_int32 tstamp_t; /* NTP seconds timestamp */
+
+/*
+ * NTP uses two fixed point formats. The first (l_fp) is the "long"
+ * format and is 64 bits long with the decimal between bits 31 and 32.
+ * This is used for time stamps in the NTP packet header (in network
+ * byte order) and for internal computations of offsets (in local host
+ * byte order). We use the same structure for both signed and unsigned
+ * values, which is a big hack but saves rewriting all the operators
+ * twice. Just to confuse this, we also sometimes just carry the
+ * fractional part in calculations, in both signed and unsigned forms.
+ * Anyway, an l_fp looks like:
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Integral Part |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Fractional Part |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+typedef struct {
+ union {
+ u_int32 Xl_ui;
+ int32 Xl_i;
+ } Ul_i;
+ union {
+ u_int32 Xl_uf;
+ int32 Xl_f;
+ } Ul_f;
+} l_fp;
+
+#define l_ui Ul_i.Xl_ui /* unsigned integral part */
+#define l_i Ul_i.Xl_i /* signed integral part */
+#define l_uf Ul_f.Xl_uf /* unsigned fractional part */
+#define l_f Ul_f.Xl_f /* signed fractional part */
+
+/*
+ * Fractional precision (of an l_fp) is actually the number of
+ * bits in a long.
+ */
+#define FRACTION_PREC (32)
+
+
+/*
+ * The second fixed point format is 32 bits, with the decimal between
+ * bits 15 and 16. There is a signed version (s_fp) and an unsigned
+ * version (u_fp). This is used to represent synchronizing distance
+ * and synchronizing dispersion in the NTP packet header (again, in
+ * network byte order) and internally to hold both distance and
+ * dispersion values (in local byte order). In network byte order
+ * it looks like:
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Integer Part | Fraction Part |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+typedef int32 s_fp;
+typedef u_int32 u_fp;
+
+/*
+ * A unit second in fp format. Actually 2**(half_the_bits_in_a_long)
+ */
+#define FP_SECOND (0x10000)
+
+/*
+ * Byte order conversions
+ */
+#define HTONS_FP(x) (htonl(x))
+#define HTONL_FP(h, n) do { (n)->l_ui = htonl((h)->l_ui); \
+ (n)->l_uf = htonl((h)->l_uf); } while (0)
+#define NTOHS_FP(x) (ntohl(x))
+#define NTOHL_FP(n, h) do { (h)->l_ui = ntohl((n)->l_ui); \
+ (h)->l_uf = ntohl((n)->l_uf); } while (0)
+#define NTOHL_MFP(ni, nf, hi, hf) \
+ do { (hi) = ntohl(ni); (hf) = ntohl(nf); } while (0)
+#define HTONL_MFP(hi, hf, ni, nf) \
+ do { (ni) = ntohl(hi); (nf) = ntohl(hf); } while (0)
+
+/* funny ones. Converts ts fractions to net order ts */
+#define HTONL_UF(uf, nts) \
+ do { (nts)->l_ui = 0; (nts)->l_uf = htonl(uf); } while (0)
+#define HTONL_F(f, nts) do { (nts)->l_uf = htonl(f); \
+ if ((f) & 0x80000000) \
+ (nts)->l_i = -1; \
+ else \
+ (nts)->l_i = 0; \
+ } while (0)
+
+/*
+ * Conversions between the two fixed point types
+ */
+#define MFPTOFP(x_i, x_f) (((x_i) >= 0x00010000) ? 0x7fffffff : \
+ (((x_i) <= -0x00010000) ? 0x80000000 : \
+ (((x_i)<<16) | (((x_f)>>16)&0xffff))))
+#define LFPTOFP(v) MFPTOFP((v)->l_i, (v)->l_f)
+
+#define UFPTOLFP(x, v) ((v)->l_ui = (u_fp)(x)>>16, (v)->l_uf = (x)<<16)
+#define FPTOLFP(x, v) (UFPTOLFP((x), (v)), (x) < 0 ? (v)->l_ui -= 0x10000 : 0)
+
+#define MAXLFP(v) ((v)->l_ui = 0x7fffffff, (v)->l_uf = 0xffffffff)
+#define MINLFP(v) ((v)->l_ui = 0x80000000, (v)->l_uf = 0)
+
+/*
+ * Primitive operations on long fixed point values. If these are
+ * reminiscent of assembler op codes it's only because some may
+ * be replaced by inline assembler for particular machines someday.
+ * These are the (kind of inefficient) run-anywhere versions.
+ */
+#define M_NEG(v_i, v_f) /* v = -v */ \
+ do { \
+ if ((v_f) == 0) \
+ (v_i) = -((s_fp)(v_i)); \
+ else { \
+ (v_f) = -((s_fp)(v_f)); \
+ (v_i) = ~(v_i); \
+ } \
+ } while(0)
+
+#define M_NEGM(r_i, r_f, a_i, a_f) /* r = -a */ \
+ do { \
+ if ((a_f) == 0) { \
+ (r_f) = 0; \
+ (r_i) = -(a_i); \
+ } else { \
+ (r_f) = -(a_f); \
+ (r_i) = ~(a_i); \
+ } \
+ } while(0)
+
+#define M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \
+ do { \
+ register u_int32 lo_tmp; \
+ register u_int32 hi_tmp; \
+ \
+ lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \
+ hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \
+ if (lo_tmp & 0x10000) \
+ hi_tmp++; \
+ (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
+ \
+ (r_i) += (a_i); \
+ if (hi_tmp & 0x10000) \
+ (r_i)++; \
+ } while (0)
+
+#define M_ADD3(r_ovr, r_i, r_f, a_ovr, a_i, a_f) /* r += a, three word */ \
+ do { \
+ register u_int32 lo_tmp; \
+ register u_int32 hi_tmp; \
+ \
+ lo_tmp = ((r_f) & 0xffff) + ((a_f) & 0xffff); \
+ hi_tmp = (((r_f) >> 16) & 0xffff) + (((a_f) >> 16) & 0xffff); \
+ if (lo_tmp & 0x10000) \
+ hi_tmp++; \
+ (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
+ \
+ lo_tmp = ((r_i) & 0xffff) + ((a_i) & 0xffff); \
+ if (hi_tmp & 0x10000) \
+ lo_tmp++; \
+ hi_tmp = (((r_i) >> 16) & 0xffff) + (((a_i) >> 16) & 0xffff); \
+ if (lo_tmp & 0x10000) \
+ hi_tmp++; \
+ (r_i) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
+ \
+ (r_ovr) += (a_ovr); \
+ if (hi_tmp & 0x10000) \
+ (r_ovr)++; \
+ } while (0)
+
+#define M_SUB(r_i, r_f, a_i, a_f) /* r -= a */ \
+ do { \
+ register u_int32 lo_tmp; \
+ register u_int32 hi_tmp; \
+ \
+ if ((a_f) == 0) { \
+ (r_i) -= (a_i); \
+ } else { \
+ lo_tmp = ((r_f) & 0xffff) + ((-((s_fp)(a_f))) & 0xffff); \
+ hi_tmp = (((r_f) >> 16) & 0xffff) \
+ + (((-((s_fp)(a_f))) >> 16) & 0xffff); \
+ if (lo_tmp & 0x10000) \
+ hi_tmp++; \
+ (r_f) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff); \
+ \
+ (r_i) += ~(a_i); \
+ if (hi_tmp & 0x10000) \
+ (r_i)++; \
+ } \
+ } while (0)
+
+#define M_RSHIFTU(v_i, v_f) /* v >>= 1, v is unsigned */ \
+ do { \
+ (v_f) = (u_int32)(v_f) >> 1; \
+ if ((v_i) & 01) \
+ (v_f) |= 0x80000000; \
+ (v_i) = (u_int32)(v_i) >> 1; \
+ } while (0)
+
+#define M_RSHIFT(v_i, v_f) /* v >>= 1, v is signed */ \
+ do { \
+ (v_f) = (u_int32)(v_f) >> 1; \
+ if ((v_i) & 01) \
+ (v_f) |= 0x80000000; \
+ if ((v_i) & 0x80000000) \
+ (v_i) = ((v_i) >> 1) | 0x80000000; \
+ else \
+ (v_i) = (v_i) >> 1; \
+ } while (0)
+
+#define M_LSHIFT(v_i, v_f) /* v <<= 1 */ \
+ do { \
+ (v_i) <<= 1; \
+ if ((v_f) & 0x80000000) \
+ (v_i) |= 0x1; \
+ (v_f) <<= 1; \
+ } while (0)
+
+#define M_LSHIFT3(v_ovr, v_i, v_f) /* v <<= 1, with overflow */ \
+ do { \
+ (v_ovr) <<= 1; \
+ if ((v_i) & 0x80000000) \
+ (v_ovr) |= 0x1; \
+ (v_i) <<= 1; \
+ if ((v_f) & 0x80000000) \
+ (v_i) |= 0x1; \
+ (v_f) <<= 1; \
+ } while (0)
+
+#define M_ADDUF(r_i, r_f, uf) /* r += uf, uf is u_int32 fraction */ \
+ M_ADD((r_i), (r_f), 0, (uf)) /* let optimizer worry about it */
+
+#define M_SUBUF(r_i, r_f, uf) /* r -= uf, uf is u_int32 fraction */ \
+ M_SUB((r_i), (r_f), 0, (uf)) /* let optimizer worry about it */
+
+#define M_ADDF(r_i, r_f, f) /* r += f, f is a int32 fraction */ \
+ do { \
+ if ((f) > 0) \
+ M_ADD((r_i), (r_f), 0, (f)); \
+ else if ((f) < 0) \
+ M_ADD((r_i), (r_f), (-1), (f));\
+ } while(0)
+
+#define M_ISNEG(v_i, v_f) /* v < 0 */ \
+ (((v_i) & 0x80000000) != 0)
+
+#define M_ISHIS(a_i, a_f, b_i, b_f) /* a >= b unsigned */ \
+ (((u_int32)(a_i)) > ((u_int32)(b_i)) || \
+ ((a_i) == (b_i) && ((u_int32)(a_f)) >= ((u_int32)(b_f))))
+
+#define M_ISGEQ(a_i, a_f, b_i, b_f) /* a >= b signed */ \
+ (((int32)(a_i)) > ((int32)(b_i)) || \
+ ((a_i) == (b_i) && ((u_int32)(a_f)) >= ((u_int32)(b_f))))
+
+#define M_ISEQU(a_i, a_f, b_i, b_f) /* a == b unsigned */ \
+ ((a_i) == (b_i) && (a_f) == (b_f))
+
+/*
+ * Operations on the long fp format
+ */
+#define L_ADD(r, a) M_ADD((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf)
+#define L_SUB(r, a) M_SUB((r)->l_ui, (r)->l_uf, (a)->l_ui, (a)->l_uf)
+#define L_NEG(v) M_NEG((v)->l_ui, (v)->l_uf)
+#define L_ADDUF(r, uf) M_ADDUF((r)->l_ui, (r)->l_uf, (uf))
+#define L_SUBUF(r, uf) M_SUBUF((r)->l_ui, (r)->l_uf, (uf))
+#define L_ADDF(r, f) M_ADDF((r)->l_ui, (r)->l_uf, (f))
+#define L_RSHIFT(v) M_RSHIFT((v)->l_i, (v)->l_uf)
+#define L_RSHIFTU(v) M_RSHIFT((v)->l_ui, (v)->l_uf)
+#define L_LSHIFT(v) M_LSHIFT((v)->l_ui, (v)->l_uf)
+#define L_CLR(v) ((v)->l_ui = (v)->l_uf = 0)
+
+#define L_ISNEG(v) (((v)->l_ui & 0x80000000) != 0)
+#define L_ISZERO(v) ((v)->l_ui == 0 && (v)->l_uf == 0)
+#define L_ISHIS(a, b) ((a)->l_ui > (b)->l_ui || \
+ ((a)->l_ui == (b)->l_ui && (a)->l_uf >= (b)->l_uf))
+#define L_ISGEQ(a, b) ((a)->l_i > (b)->l_i || \
+ ((a)->l_i == (b)->l_i && (a)->l_uf >= (b)->l_uf))
+#define L_ISEQU(a, b) M_ISEQU((a)->l_ui, (a)->l_uf, (b)->l_ui, (b)->l_uf)
+
+/*
+ * s_fp/double and u_fp/double conversions
+ */
+#define FRIC 65536. /* 2^16 as a double */
+#define DTOFP(r) ((s_fp)((r) * FRIC))
+#define DTOUFP(r) ((u_fp)((r) * FRIC))
+#define FPTOD(r) ((double)(r) / FRIC)
+
+/*
+ * l_fp/double conversions
+ */
+#define FRAC 4294967296. /* 2^32 as a double */
+#define M_DTOLFP(d, r_i, r_uf) /* double to l_fp */ \
+ do { \
+ register double d_tmp; \
+ \
+ d_tmp = (d); \
+ if (d_tmp < 0) { \
+ d_tmp = -d_tmp; \
+ (r_i) = (int32)(d_tmp); \
+ (r_uf) = (u_int32)(((d_tmp) - (double)(r_i)) * FRAC); \
+ M_NEG((r_i), (r_uf)); \
+ } else { \
+ (r_i) = (int32)(d_tmp); \
+ (r_uf) = (u_int32)(((d_tmp) - (double)(r_i)) * FRAC); \
+ } \
+ } while (0)
+#define M_LFPTOD(r_i, r_uf, d) /* l_fp to double */ \
+ do { \
+ register l_fp l_tmp; \
+ \
+ l_tmp.l_i = (r_i); \
+ l_tmp.l_f = (r_uf); \
+ if (l_tmp.l_i < 0) { \
+ M_NEG(l_tmp.l_i, l_tmp.l_uf); \
+ (d) = -((double)l_tmp.l_i + ((double)l_tmp.l_uf) / FRAC); \
+ } else { \
+ (d) = (double)l_tmp.l_i + ((double)l_tmp.l_uf) / FRAC; \
+ } \
+ } while (0)
+#define DTOLFP(d, v) M_DTOLFP((d), (v)->l_ui, (v)->l_uf)
+#define LFPTOD(v, d) M_LFPTOD((v)->l_ui, (v)->l_uf, (d))
+
+/*
+ * Prototypes
+ */
+#if 0
+extern char * dofptoa (u_fp, int, short, int);
+extern char * dolfptoa (u_long, u_long, int, short, int);
+#endif
+
+extern int atolfp (const char *, l_fp *);
+extern int buftvtots (const char *, l_fp *);
+extern char * fptoa (s_fp, short);
+extern char * fptoms (s_fp, short);
+extern int hextolfp (const char *, l_fp *);
+extern void gpstolfp (int, int, unsigned long, l_fp *);
+extern int mstolfp (const char *, l_fp *);
+extern char * prettydate (l_fp *);
+extern char * gmprettydate (l_fp *);
+extern char * uglydate (l_fp *);
+extern void mfp_mul (int32 *, u_int32 *, int32, u_int32, int32, u_int32);
+
+extern void get_systime (l_fp *);
+extern int step_systime (double);
+extern int adj_systime (double);
+
+#define lfptoa(_fpv, _ndec) mfptoa((_fpv)->l_ui, (_fpv)->l_uf, (_ndec))
+#define lfptoms(_fpv, _ndec) mfptoms((_fpv)->l_ui, (_fpv)->l_uf, (_ndec))
+
+#define ufptoa(_fpv, _ndec) dofptoa((_fpv), 0, (_ndec), 0)
+#define ufptoms(_fpv, _ndec) dofptoa((_fpv), 0, (_ndec), 1)
+#define ulfptoa(_fpv, _ndec) dolfptoa((_fpv)->l_ui, (_fpv)->l_uf, 0, (_ndec), 0)
+#define ulfptoms(_fpv, _ndec) dolfptoa((_fpv)->l_ui, (_fpv)->l_uf, 0, (_ndec), 1)
+#define umfptoa(_fpi, _fpf, _ndec) dolfptoa((_fpi), (_fpf), 0, (_ndec), 0)
diff --git a/util/kern.c b/util/kern.c
new file mode 100644
index 0000000..b193d6f
--- /dev/null
+++ b/util/kern.c
@@ -0,0 +1,225 @@
+/*
+ * This program simulates a first-order, type-II phase-lock loop using
+ * actual code segments from modified kernel distributions for SunOS,
+ * Ultrix and OSF/1 kernels. These segments do not use any licensed code.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+#include <sys/time.h>
+
+#ifdef HAVE_TIMEX_H
+# include "timex.h"
+#endif
+
+/*
+ * Phase-lock loop definitions
+ */
+#define HZ 100 /* timer interrupt frequency (Hz) */
+#define MAXPHASE 512000 /* max phase error (us) */
+#define MAXFREQ 200 /* max frequency error (ppm) */
+#define TAU 2 /* time constant (shift 0 - 6) */
+#define POLL 16 /* interval between updates (s) */
+#define MAXSEC 1200 /* max interval between updates (s) */
+
+/*
+ * Function declarations
+ */
+void hardupdate();
+void hardclock();
+void second_overflow();
+
+/*
+ * Kernel variables
+ */
+int tick; /* timer interrupt period (us) */
+int fixtick; /* amortization constant (ppm) */
+struct timeval timex; /* ripoff of kernel time variable */
+
+/*
+ * Phase-lock loop variables
+ */
+int time_status = TIME_BAD; /* clock synchronization status */
+long time_offset = 0; /* time adjustment (us) */
+long time_constant = 0; /* pll time constant */
+long time_tolerance = MAXFREQ; /* frequency tolerance (ppm) */
+long time_precision = 1000000 / HZ; /* clock precision (us) */
+long time_maxerror = MAXPHASE; /* maximum error (us) */
+long time_esterror = MAXPHASE; /* estimated error (us) */
+long time_phase = 0; /* phase offset (scaled us) */
+long time_freq = 0; /* frequency offset (scaled ppm) */
+long time_adj = 0; /* tick adjust (scaled 1 / HZ) */
+long time_reftime = 0; /* time at last adjustment (s) */
+
+/*
+ * Simulation variables
+ */
+double timey = 0; /* simulation time (us) */
+long timez = 0; /* current error (us) */
+long poll_interval = 0; /* poll counter */
+
+/*
+ * Simulation test program
+ */
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ tick = 1000000 / HZ;
+ fixtick = 1000000 % HZ;
+ timex.tv_sec = 0;
+ timex.tv_usec = MAXPHASE;
+ time_freq = 0;
+ time_constant = TAU;
+ printf("tick %d us, fixtick %d us\n", tick, fixtick);
+ printf(" time offset freq _offset _freq _adj\n");
+
+ /*
+ * Grind the loop until ^C
+ */
+ while (1) {
+ timey += (double)(1000000) / HZ;
+ if (timey >= 1000000)
+ timey -= 1000000;
+ hardclock();
+ if (timex.tv_usec >= 1000000) {
+ timex.tv_usec -= 1000000;
+ timex.tv_sec++;
+ second_overflow();
+ poll_interval++;
+ if (!(poll_interval % POLL)) {
+ timez = (long)timey - timex.tv_usec;
+ if (timez > 500000)
+ timez -= 1000000;
+ if (timez < -500000)
+ timez += 1000000;
+ hardupdate(timez);
+ printf("%10li%10li%10.2f %08lx %08lx %08lx\n",
+ timex.tv_sec, timez,
+ (double)time_freq / (1 << SHIFT_KF),
+ time_offset, time_freq, time_adj);
+ }
+ }
+ }
+}
+
+/*
+ * This routine simulates the ntp_adjtime() call
+ *
+ * For default SHIFT_UPDATE = 12, offset is limited to +-512 ms, the
+ * maximum interval between updates is 4096 s and the maximum frequency
+ * offset is +-31.25 ms/s.
+ */
+void
+hardupdate(
+ long offset
+ )
+{
+ long ltemp, mtemp;
+
+ time_offset = offset << SHIFT_UPDATE;
+ mtemp = timex.tv_sec - time_reftime;
+ time_reftime = timex.tv_sec;
+ if (mtemp > MAXSEC)
+ mtemp = 0;
+
+ /* ugly multiply should be replaced */
+ if (offset < 0)
+ time_freq -= (-offset * mtemp) >>
+ (time_constant + time_constant);
+ else
+ time_freq += (offset * mtemp) >>
+ (time_constant + time_constant);
+ ltemp = time_tolerance << SHIFT_KF;
+ if (time_freq > ltemp)
+ time_freq = ltemp;
+ else if (time_freq < -ltemp)
+ time_freq = -ltemp;
+ if (time_status == TIME_BAD)
+ time_status = TIME_OK;
+}
+
+/*
+ * This routine simulates the timer interrupt
+ */
+void
+hardclock(void)
+{
+ int ltemp, time_update;
+
+ time_update = tick; /* computed by adjtime() */
+ time_phase += time_adj;
+ if (time_phase < -FINEUSEC) {
+ ltemp = -time_phase >> SHIFT_SCALE;
+ time_phase += ltemp << SHIFT_SCALE;
+ time_update -= ltemp;
+ }
+ else if (time_phase > FINEUSEC) {
+ ltemp = time_phase >> SHIFT_SCALE;
+ time_phase -= ltemp << SHIFT_SCALE;
+ time_update += ltemp;
+ }
+ timex.tv_usec += time_update;
+}
+
+/*
+ * This routine simulates the overflow of the microsecond field
+ *
+ * With SHIFT_SCALE = 23, the maximum frequency adjustment is +-256 us
+ * per tick, or 25.6 ms/s at a clock frequency of 100 Hz. The time
+ * contribution is shifted right a minimum of two bits, while the frequency
+ * contribution is a right shift. Thus, overflow is prevented if the
+ * frequency contribution is limited to half the maximum or 15.625 ms/s.
+ */
+void
+second_overflow(void)
+{
+ int ltemp;
+
+ time_maxerror += time_tolerance;
+ if (time_offset < 0) {
+ ltemp = -time_offset >>
+ (SHIFT_KG + time_constant);
+ time_offset += ltemp;
+ time_adj = -(ltemp <<
+ (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE));
+ } else {
+ ltemp = time_offset >>
+ (SHIFT_KG + time_constant);
+ time_offset -= ltemp;
+ time_adj = ltemp <<
+ (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE);
+ }
+ if (time_freq < 0)
+ time_adj -= -time_freq >> (SHIFT_KF + SHIFT_HZ - SHIFT_SCALE);
+ else
+ time_adj += time_freq >> (SHIFT_KF + SHIFT_HZ - SHIFT_SCALE);
+ time_adj += fixtick << (SHIFT_SCALE - SHIFT_HZ);
+
+ /* ugly divide should be replaced */
+ if (timex.tv_sec % 86400 == 0) {
+ switch (time_status) {
+
+ case TIME_INS:
+ timex.tv_sec--; /* !! */
+ time_status = TIME_OOP;
+ break;
+
+ case TIME_DEL:
+ timex.tv_sec++;
+ time_status = TIME_OK;
+ break;
+
+ case TIME_OOP:
+ time_status = TIME_OK;
+ break;
+ }
+ }
+}
diff --git a/util/longsize.c b/util/longsize.c
new file mode 100644
index 0000000..bba1955
--- /dev/null
+++ b/util/longsize.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+main()
+{
+ if (sizeof(long) == 8) {
+ printf("-DLONG8\n");
+ } else if (sizeof(long) == 4) {
+ printf("-DLONG4\n");
+ }
+ exit(0);
+}
diff --git a/util/ntp-keygen-opts.c b/util/ntp-keygen-opts.c
new file mode 100644
index 0000000..718588f
--- /dev/null
+++ b/util/ntp-keygen-opts.c
@@ -0,0 +1,1719 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:58:32 AM by AutoGen 5.18.5pre4
+ * From the definitions ntp-keygen-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This source file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntp-keygen author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntp-keygen program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+
+#ifndef __doxygen__
+#define OPTION_CODE_COMPILE 1
+#include "ntp-keygen-opts.h"
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern FILE * option_usage_fp;
+#define zCopyright (ntp_keygen_opt_strs+0)
+#define zLicenseDescrip (ntp_keygen_opt_strs+326)
+
+/*
+ * global included definitions
+ */
+#include <stdlib.h>
+
+#ifdef __windows
+ extern int atoi(const char*);
+#else
+# include <stdlib.h>
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/**
+ * static const strings for ntp-keygen options
+ */
+static char const ntp_keygen_opt_strs[2369] =
+/* 0 */ "ntp-keygen (ntp) 4.2.7p482\n"
+ "Copyright (C) 1970-2014 The University of Delaware, 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"
+ "can be seen at:\n"
+ " <http://ntp.org/license>\n"
+ " <http://opensource.org/licenses/ntp-license.php>\n\0"
+/* 326 */ "Permission to use, copy, modify, and distribute this software and its\n"
+ "documentation for any purpose with or without fee is hereby granted,\n"
+ "provided that the above copyright notice appears in all copies and that\n"
+ "both the copyright notice and this permission notice appear in supporting\n"
+ "documentation, and that the name The University of Delaware not be used in\n"
+ "advertising or publicity pertaining to distribution of the software without\n"
+ "specific, written prior permission. The University of Delaware makes no\n"
+ "representations about the suitability this software for any purpose. It is\n"
+ "provided \"as is\" without express or implied warranty.\n\0"
+/* 966 */ "identity modulus bits\0"
+/* 988 */ "IMBITS\0"
+/* 995 */ "imbits\0"
+/* 1002 */ "certificate scheme\0"
+/* 1021 */ "CERTIFICATE\0"
+/* 1033 */ "certificate\0"
+/* 1045 */ "privatekey cipher\0"
+/* 1063 */ "CIPHER\0"
+/* 1070 */ "cipher\0"
+/* 1077 */ "Increase debug verbosity level\0"
+/* 1108 */ "DEBUG_LEVEL\0"
+/* 1120 */ "debug-level\0"
+/* 1132 */ "Set the debug verbosity level\0"
+/* 1162 */ "SET_DEBUG_LEVEL\0"
+/* 1178 */ "set-debug-level\0"
+/* 1194 */ "Write IFF or GQ identity keys\0"
+/* 1224 */ "ID_KEY\0"
+/* 1231 */ "id-key\0"
+/* 1238 */ "Generate GQ parameters and keys\0"
+/* 1270 */ "GQ_PARAMS\0"
+/* 1280 */ "gq-params\0"
+/* 1290 */ "generate RSA host key\0"
+/* 1312 */ "HOST_KEY\0"
+/* 1321 */ "host-key\0"
+/* 1330 */ "generate IFF parameters\0"
+/* 1354 */ "IFFKEY\0"
+/* 1361 */ "iffkey\0"
+/* 1368 */ "set Autokey group name\0"
+/* 1391 */ "IDENT\0"
+/* 1397 */ "ident\0"
+/* 1403 */ "set certificate lifetime\0"
+/* 1428 */ "LIFETIME\0"
+/* 1437 */ "lifetime\0"
+/* 1446 */ "generate MD5 keys\0"
+/* 1464 */ "MD5KEY\0"
+/* 1471 */ "md5key\0"
+/* 1478 */ "modulus\0"
+/* 1486 */ "MODULUS\0"
+/* 1494 */ "generate PC private certificate\0"
+/* 1526 */ "PVT_CERT\0"
+/* 1535 */ "pvt-cert\0"
+/* 1544 */ "local private password\0"
+/* 1567 */ "PASSWORD\0"
+/* 1576 */ "password\0"
+/* 1585 */ "export IFF or GQ group keys with password\0"
+/* 1627 */ "EXPORT_PASSWD\0"
+/* 1641 */ "export-passwd\0"
+/* 1655 */ "generate sign key (RSA or DSA)\0"
+/* 1686 */ "SIGN_KEY\0"
+/* 1695 */ "sign-key\0"
+/* 1704 */ "set host and optionally group name\0"
+/* 1739 */ "SUBJECT_NAME\0"
+/* 1752 */ "subject-name\0"
+/* 1765 */ "trusted certificate (TC scheme)\0"
+/* 1797 */ "TRUSTED_CERT\0"
+/* 1810 */ "trusted-cert\0"
+/* 1823 */ "generate <num> MV parameters\0"
+/* 1852 */ "MV_PARAMS\0"
+/* 1862 */ "mv-params\0"
+/* 1872 */ "update <num> MV keys\0"
+/* 1893 */ "MV_KEYS\0"
+/* 1901 */ "mv-keys\0"
+/* 1909 */ "display extended usage information and exit\0"
+/* 1953 */ "help\0"
+/* 1958 */ "extended usage information passed thru pager\0"
+/* 2003 */ "more-help\0"
+/* 2013 */ "output version information and exit\0"
+/* 2049 */ "version\0"
+/* 2057 */ "save the option state to a config file\0"
+/* 2096 */ "save-opts\0"
+/* 2106 */ "load options from a config file\0"
+/* 2138 */ "LOAD_OPTS\0"
+/* 2148 */ "no-load-opts\0"
+/* 2161 */ "no\0"
+/* 2164 */ "NTP_KEYGEN\0"
+/* 2175 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p482\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
+/* 2291 */ "$HOME\0"
+/* 2297 */ ".\0"
+/* 2299 */ ".ntprc\0"
+/* 2306 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 2340 */ "\n\0"
+/* 2342 */ "ntp-keygen (ntp) 4.2.7p482";
+
+/**
+ * imbits option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the imbits option */
+#define IMBITS_DESC (ntp_keygen_opt_strs+966)
+/** Upper-cased name for the imbits option */
+#define IMBITS_NAME (ntp_keygen_opt_strs+988)
+/** Name string for the imbits option */
+#define IMBITS_name (ntp_keygen_opt_strs+995)
+/** Compiled in flag settings for the imbits option */
+#define IMBITS_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+#else /* disable imbits */
+#define IMBITS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define IMBITS_NAME NULL
+#define IMBITS_DESC NULL
+#define IMBITS_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * certificate option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the certificate option */
+#define CERTIFICATE_DESC (ntp_keygen_opt_strs+1002)
+/** Upper-cased name for the certificate option */
+#define CERTIFICATE_NAME (ntp_keygen_opt_strs+1021)
+/** Name string for the certificate option */
+#define CERTIFICATE_name (ntp_keygen_opt_strs+1033)
+/** Compiled in flag settings for the certificate option */
+#define CERTIFICATE_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable certificate */
+#define CERTIFICATE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define CERTIFICATE_NAME NULL
+#define CERTIFICATE_DESC NULL
+#define CERTIFICATE_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * cipher option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the cipher option */
+#define CIPHER_DESC (ntp_keygen_opt_strs+1045)
+/** Upper-cased name for the cipher option */
+#define CIPHER_NAME (ntp_keygen_opt_strs+1063)
+/** Name string for the cipher option */
+#define CIPHER_name (ntp_keygen_opt_strs+1070)
+/** Compiled in flag settings for the cipher option */
+#define CIPHER_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable cipher */
+#define CIPHER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define CIPHER_NAME NULL
+#define CIPHER_DESC NULL
+#define CIPHER_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * debug-level option description:
+ */
+/** Descriptive text for the debug-level option */
+#define DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1077)
+/** Upper-cased name for the debug-level option */
+#define DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1108)
+/** Name string for the debug-level option */
+#define DEBUG_LEVEL_name (ntp_keygen_opt_strs+1120)
+/** Compiled in flag settings for the debug-level option */
+#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED)
+
+/**
+ * set-debug-level option description:
+ */
+/** Descriptive text for the set-debug-level option */
+#define SET_DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1132)
+/** Upper-cased name for the set-debug-level option */
+#define SET_DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1162)
+/** Name string for the set-debug-level option */
+#define SET_DEBUG_LEVEL_name (ntp_keygen_opt_strs+1178)
+/** Compiled in flag settings for the set-debug-level option */
+#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+/**
+ * id-key option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the id-key option */
+#define ID_KEY_DESC (ntp_keygen_opt_strs+1194)
+/** Upper-cased name for the id-key option */
+#define ID_KEY_NAME (ntp_keygen_opt_strs+1224)
+/** Name string for the id-key option */
+#define ID_KEY_name (ntp_keygen_opt_strs+1231)
+/** Compiled in flag settings for the id-key option */
+#define ID_KEY_FLAGS (OPTST_DISABLED)
+
+#else /* disable id-key */
+#define ID_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define ID_KEY_NAME NULL
+#define ID_KEY_DESC NULL
+#define ID_KEY_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * gq-params option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the gq-params option */
+#define GQ_PARAMS_DESC (ntp_keygen_opt_strs+1238)
+/** Upper-cased name for the gq-params option */
+#define GQ_PARAMS_NAME (ntp_keygen_opt_strs+1270)
+/** Name string for the gq-params option */
+#define GQ_PARAMS_name (ntp_keygen_opt_strs+1280)
+/** Compiled in flag settings for the gq-params option */
+#define GQ_PARAMS_FLAGS (OPTST_DISABLED)
+
+#else /* disable gq-params */
+#define GQ_PARAMS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define GQ_PARAMS_NAME NULL
+#define GQ_PARAMS_DESC NULL
+#define GQ_PARAMS_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * host-key option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the host-key option */
+#define HOST_KEY_DESC (ntp_keygen_opt_strs+1290)
+/** Upper-cased name for the host-key option */
+#define HOST_KEY_NAME (ntp_keygen_opt_strs+1312)
+/** Name string for the host-key option */
+#define HOST_KEY_name (ntp_keygen_opt_strs+1321)
+/** Compiled in flag settings for the host-key option */
+#define HOST_KEY_FLAGS (OPTST_DISABLED)
+
+#else /* disable host-key */
+#define HOST_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define HOST_KEY_NAME NULL
+#define HOST_KEY_DESC NULL
+#define HOST_KEY_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * iffkey option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the iffkey option */
+#define IFFKEY_DESC (ntp_keygen_opt_strs+1330)
+/** Upper-cased name for the iffkey option */
+#define IFFKEY_NAME (ntp_keygen_opt_strs+1354)
+/** Name string for the iffkey option */
+#define IFFKEY_name (ntp_keygen_opt_strs+1361)
+/** Compiled in flag settings for the iffkey option */
+#define IFFKEY_FLAGS (OPTST_DISABLED)
+
+#else /* disable iffkey */
+#define IFFKEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define IFFKEY_NAME NULL
+#define IFFKEY_DESC NULL
+#define IFFKEY_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * ident option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the ident option */
+#define IDENT_DESC (ntp_keygen_opt_strs+1368)
+/** Upper-cased name for the ident option */
+#define IDENT_NAME (ntp_keygen_opt_strs+1391)
+/** Name string for the ident option */
+#define IDENT_name (ntp_keygen_opt_strs+1397)
+/** Compiled in flag settings for the ident option */
+#define IDENT_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable ident */
+#define IDENT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define IDENT_NAME NULL
+#define IDENT_DESC NULL
+#define IDENT_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * lifetime option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the lifetime option */
+#define LIFETIME_DESC (ntp_keygen_opt_strs+1403)
+/** Upper-cased name for the lifetime option */
+#define LIFETIME_NAME (ntp_keygen_opt_strs+1428)
+/** Name string for the lifetime option */
+#define LIFETIME_name (ntp_keygen_opt_strs+1437)
+/** Compiled in flag settings for the lifetime option */
+#define LIFETIME_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+#else /* disable lifetime */
+#define LIFETIME_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define LIFETIME_NAME NULL
+#define LIFETIME_DESC NULL
+#define LIFETIME_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * md5key option description:
+ */
+/** Descriptive text for the md5key option */
+#define MD5KEY_DESC (ntp_keygen_opt_strs+1446)
+/** Upper-cased name for the md5key option */
+#define MD5KEY_NAME (ntp_keygen_opt_strs+1464)
+/** Name string for the md5key option */
+#define MD5KEY_name (ntp_keygen_opt_strs+1471)
+/** Compiled in flag settings for the md5key option */
+#define MD5KEY_FLAGS (OPTST_DISABLED)
+
+/**
+ * modulus option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the modulus option */
+#define MODULUS_DESC (ntp_keygen_opt_strs+1478)
+/** Upper-cased name for the modulus option */
+#define MODULUS_NAME (ntp_keygen_opt_strs+1486)
+/** Name string for the modulus option */
+#define MODULUS_name (ntp_keygen_opt_strs+1478)
+/** Compiled in flag settings for the modulus option */
+#define MODULUS_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+#else /* disable modulus */
+#define MODULUS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define MODULUS_NAME NULL
+#define MODULUS_DESC NULL
+#define MODULUS_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * pvt-cert option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the pvt-cert option */
+#define PVT_CERT_DESC (ntp_keygen_opt_strs+1494)
+/** Upper-cased name for the pvt-cert option */
+#define PVT_CERT_NAME (ntp_keygen_opt_strs+1526)
+/** Name string for the pvt-cert option */
+#define PVT_CERT_name (ntp_keygen_opt_strs+1535)
+/** Compiled in flag settings for the pvt-cert option */
+#define PVT_CERT_FLAGS (OPTST_DISABLED)
+
+#else /* disable pvt-cert */
+#define PVT_CERT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define PVT_CERT_NAME NULL
+#define PVT_CERT_DESC NULL
+#define PVT_CERT_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * password option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the password option */
+#define PASSWORD_DESC (ntp_keygen_opt_strs+1544)
+/** Upper-cased name for the password option */
+#define PASSWORD_NAME (ntp_keygen_opt_strs+1567)
+/** Name string for the password option */
+#define PASSWORD_name (ntp_keygen_opt_strs+1576)
+/** Compiled in flag settings for the password option */
+#define PASSWORD_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable password */
+#define PASSWORD_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define PASSWORD_NAME NULL
+#define PASSWORD_DESC NULL
+#define PASSWORD_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * export-passwd option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the export-passwd option */
+#define EXPORT_PASSWD_DESC (ntp_keygen_opt_strs+1585)
+/** Upper-cased name for the export-passwd option */
+#define EXPORT_PASSWD_NAME (ntp_keygen_opt_strs+1627)
+/** Name string for the export-passwd option */
+#define EXPORT_PASSWD_name (ntp_keygen_opt_strs+1641)
+/** Compiled in flag settings for the export-passwd option */
+#define EXPORT_PASSWD_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable export-passwd */
+#define EXPORT_PASSWD_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define EXPORT_PASSWD_NAME NULL
+#define EXPORT_PASSWD_DESC NULL
+#define EXPORT_PASSWD_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * sign-key option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the sign-key option */
+#define SIGN_KEY_DESC (ntp_keygen_opt_strs+1655)
+/** Upper-cased name for the sign-key option */
+#define SIGN_KEY_NAME (ntp_keygen_opt_strs+1686)
+/** Name string for the sign-key option */
+#define SIGN_KEY_name (ntp_keygen_opt_strs+1695)
+/** Compiled in flag settings for the sign-key option */
+#define SIGN_KEY_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable sign-key */
+#define SIGN_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define SIGN_KEY_NAME NULL
+#define SIGN_KEY_DESC NULL
+#define SIGN_KEY_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * subject-name option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the subject-name option */
+#define SUBJECT_NAME_DESC (ntp_keygen_opt_strs+1704)
+/** Upper-cased name for the subject-name option */
+#define SUBJECT_NAME_NAME (ntp_keygen_opt_strs+1739)
+/** Name string for the subject-name option */
+#define SUBJECT_NAME_name (ntp_keygen_opt_strs+1752)
+/** Compiled in flag settings for the subject-name option */
+#define SUBJECT_NAME_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
+#else /* disable subject-name */
+#define SUBJECT_NAME_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define SUBJECT_NAME_NAME NULL
+#define SUBJECT_NAME_DESC NULL
+#define SUBJECT_NAME_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * trusted-cert option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the trusted-cert option */
+#define TRUSTED_CERT_DESC (ntp_keygen_opt_strs+1765)
+/** Upper-cased name for the trusted-cert option */
+#define TRUSTED_CERT_NAME (ntp_keygen_opt_strs+1797)
+/** Name string for the trusted-cert option */
+#define TRUSTED_CERT_name (ntp_keygen_opt_strs+1810)
+/** Compiled in flag settings for the trusted-cert option */
+#define TRUSTED_CERT_FLAGS (OPTST_DISABLED)
+
+#else /* disable trusted-cert */
+#define TRUSTED_CERT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define TRUSTED_CERT_NAME NULL
+#define TRUSTED_CERT_DESC NULL
+#define TRUSTED_CERT_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * mv-params option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the mv-params option */
+#define MV_PARAMS_DESC (ntp_keygen_opt_strs+1823)
+/** Upper-cased name for the mv-params option */
+#define MV_PARAMS_NAME (ntp_keygen_opt_strs+1852)
+/** Name string for the mv-params option */
+#define MV_PARAMS_name (ntp_keygen_opt_strs+1862)
+/** Compiled in flag settings for the mv-params option */
+#define MV_PARAMS_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+#else /* disable mv-params */
+#define MV_PARAMS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define MV_PARAMS_NAME NULL
+#define MV_PARAMS_DESC NULL
+#define MV_PARAMS_name NULL
+#endif /* AUTOKEY */
+
+/**
+ * mv-keys option description:
+ */
+#ifdef AUTOKEY
+/** Descriptive text for the mv-keys option */
+#define MV_KEYS_DESC (ntp_keygen_opt_strs+1872)
+/** Upper-cased name for the mv-keys option */
+#define MV_KEYS_NAME (ntp_keygen_opt_strs+1893)
+/** Name string for the mv-keys option */
+#define MV_KEYS_name (ntp_keygen_opt_strs+1901)
+/** Compiled in flag settings for the mv-keys option */
+#define MV_KEYS_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
+
+#else /* disable mv-keys */
+#define MV_KEYS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#define MV_KEYS_NAME NULL
+#define MV_KEYS_DESC NULL
+#define MV_KEYS_name NULL
+#endif /* AUTOKEY */
+
+/*
+ * Help/More_Help/Version option descriptions:
+ */
+#define HELP_DESC (ntp_keygen_opt_strs+1909)
+#define HELP_name (ntp_keygen_opt_strs+1953)
+#ifdef HAVE_WORKING_FORK
+#define MORE_HELP_DESC (ntp_keygen_opt_strs+1958)
+#define MORE_HELP_name (ntp_keygen_opt_strs+2003)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+#define MORE_HELP_DESC HELP_DESC
+#define MORE_HELP_name HELP_name
+#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
+#endif
+#ifdef NO_OPTIONAL_OPT_ARGS
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
+#else
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
+#endif
+#define VER_DESC (ntp_keygen_opt_strs+2013)
+#define VER_name (ntp_keygen_opt_strs+2049)
+#define SAVE_OPTS_DESC (ntp_keygen_opt_strs+2057)
+#define SAVE_OPTS_name (ntp_keygen_opt_strs+2096)
+#define LOAD_OPTS_DESC (ntp_keygen_opt_strs+2106)
+#define LOAD_OPTS_NAME (ntp_keygen_opt_strs+2138)
+#define NO_LOAD_OPTS_name (ntp_keygen_opt_strs+2148)
+#define LOAD_OPTS_pfx (ntp_keygen_opt_strs+2161)
+#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
+/**
+ * Declare option callback procedures
+ */
+#ifdef AUTOKEY
+ static tOptProc doOptImbits;
+#else /* not AUTOKEY */
+# define doOptImbits NULL
+#endif /* def/not AUTOKEY */
+#ifdef AUTOKEY
+ static tOptProc doOptModulus;
+#else /* not AUTOKEY */
+# define doOptModulus NULL
+#endif /* def/not AUTOKEY */
+extern tOptProc
+ ntpOptionPrintVersion, optionBooleanVal, optionNestedVal,
+ optionNumericVal, optionPagedUsage, optionResetOpt,
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVendorOption;
+static tOptProc
+ doOptDebug_Level, doUsageOpt;
+#define VER_PROC ntpOptionPrintVersion
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Define the ntp-keygen Option Descriptions.
+ * This is an array of OPTION_CT entries, one for each
+ * option that the ntp-keygen program responds to.
+ */
+static tOptDesc optDesc[OPTION_CT] = {
+ { /* entry idx, value */ 0, VALUE_OPT_IMBITS,
+ /* equiv idx, value */ 0, VALUE_OPT_IMBITS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IMBITS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --imbits */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptImbits,
+ /* desc, NAME, name */ IMBITS_DESC, IMBITS_NAME, IMBITS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 1, VALUE_OPT_CERTIFICATE,
+ /* equiv idx, value */ 1, VALUE_OPT_CERTIFICATE,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ CERTIFICATE_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --certificate */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ CERTIFICATE_DESC, CERTIFICATE_NAME, CERTIFICATE_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 2, VALUE_OPT_CIPHER,
+ /* equiv idx, value */ 2, VALUE_OPT_CIPHER,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ CIPHER_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --cipher */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ CIPHER_DESC, CIPHER_NAME, CIPHER_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
+ /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptDebug_Level,
+ /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --set-debug-level */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 5, VALUE_OPT_ID_KEY,
+ /* equiv idx, value */ 5, VALUE_OPT_ID_KEY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ ID_KEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --id-key */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ ID_KEY_DESC, ID_KEY_NAME, ID_KEY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 6, VALUE_OPT_GQ_PARAMS,
+ /* equiv idx, value */ 6, VALUE_OPT_GQ_PARAMS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ GQ_PARAMS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --gq-params */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ GQ_PARAMS_DESC, GQ_PARAMS_NAME, GQ_PARAMS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 7, VALUE_OPT_HOST_KEY,
+ /* equiv idx, value */ 7, VALUE_OPT_HOST_KEY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ HOST_KEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --host-key */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ HOST_KEY_DESC, HOST_KEY_NAME, HOST_KEY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 8, VALUE_OPT_IFFKEY,
+ /* equiv idx, value */ 8, VALUE_OPT_IFFKEY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IFFKEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --iffkey */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IFFKEY_DESC, IFFKEY_NAME, IFFKEY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 9, VALUE_OPT_IDENT,
+ /* equiv idx, value */ 9, VALUE_OPT_IDENT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ IDENT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --ident */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ IDENT_DESC, IDENT_NAME, IDENT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 10, VALUE_OPT_LIFETIME,
+ /* equiv idx, value */ 10, VALUE_OPT_LIFETIME,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ LIFETIME_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --lifetime */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ LIFETIME_DESC, LIFETIME_NAME, LIFETIME_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 11, VALUE_OPT_MD5KEY,
+ /* equiv idx, value */ 11, VALUE_OPT_MD5KEY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MD5KEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --md5key */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ MD5KEY_DESC, MD5KEY_NAME, MD5KEY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 12, VALUE_OPT_MODULUS,
+ /* equiv idx, value */ 12, VALUE_OPT_MODULUS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MODULUS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --modulus */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doOptModulus,
+ /* desc, NAME, name */ MODULUS_DESC, MODULUS_NAME, MODULUS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 13, VALUE_OPT_PVT_CERT,
+ /* equiv idx, value */ 13, VALUE_OPT_PVT_CERT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PVT_CERT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --pvt-cert */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ PVT_CERT_DESC, PVT_CERT_NAME, PVT_CERT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 14, VALUE_OPT_PASSWORD,
+ /* equiv idx, value */ 14, VALUE_OPT_PASSWORD,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ PASSWORD_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --password */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ PASSWORD_DESC, PASSWORD_NAME, PASSWORD_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 15, VALUE_OPT_EXPORT_PASSWD,
+ /* equiv idx, value */ 15, VALUE_OPT_EXPORT_PASSWD,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ EXPORT_PASSWD_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --export-passwd */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ EXPORT_PASSWD_DESC, EXPORT_PASSWD_NAME, EXPORT_PASSWD_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 16, VALUE_OPT_SIGN_KEY,
+ /* equiv idx, value */ 16, VALUE_OPT_SIGN_KEY,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SIGN_KEY_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --sign-key */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SIGN_KEY_DESC, SIGN_KEY_NAME, SIGN_KEY_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 17, VALUE_OPT_SUBJECT_NAME,
+ /* equiv idx, value */ 17, VALUE_OPT_SUBJECT_NAME,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ SUBJECT_NAME_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --subject-name */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SUBJECT_NAME_DESC, SUBJECT_NAME_NAME, SUBJECT_NAME_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 18, VALUE_OPT_TRUSTED_CERT,
+ /* equiv idx, value */ 18, VALUE_OPT_TRUSTED_CERT,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ TRUSTED_CERT_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --trusted-cert */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ TRUSTED_CERT_DESC, TRUSTED_CERT_NAME, TRUSTED_CERT_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 19, VALUE_OPT_MV_PARAMS,
+ /* equiv idx, value */ 19, VALUE_OPT_MV_PARAMS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MV_PARAMS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --mv-params */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ MV_PARAMS_DESC, MV_PARAMS_NAME, MV_PARAMS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ 20, VALUE_OPT_MV_KEYS,
+ /* equiv idx, value */ 20, VALUE_OPT_MV_KEYS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MV_KEYS_FLAGS, 0,
+ /* last opt argumnt */ { NULL }, /* --mv-keys */
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionNumericVal,
+ /* desc, NAME, name */ MV_KEYS_DESC, MV_KEYS_NAME, MV_KEYS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ VER_PROC,
+ /* desc, NAME, name */ VER_DESC, NULL, VER_name,
+ /* disablement strs */ NULL, NULL },
+
+
+
+ { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ doUsageOpt,
+ /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionPagedUsage,
+ /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
+ /* disablement strs */ NULL, NULL },
+
+ { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, NOLIMIT, 0,
+ /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
+ | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
+ /* last opt argumnt */ { NULL },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ optionLoadOpt,
+ /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
+ /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
+};
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of ntp-keygen. */
+#define zPROGNAME (ntp_keygen_opt_strs+2164)
+/** Reference to the title line for ntp-keygen usage. */
+#define zUsageTitle (ntp_keygen_opt_strs+2175)
+/** ntp-keygen configuration file name. */
+#define zRcName (ntp_keygen_opt_strs+2299)
+/** Directories to search for ntp-keygen config files. */
+static char const * const apzHomeList[3] = {
+ ntp_keygen_opt_strs+2291,
+ ntp_keygen_opt_strs+2297,
+ NULL };
+/** The ntp-keygen program bug email address. */
+#define zBugsAddr (ntp_keygen_opt_strs+2306)
+/** Clarification/explanation of what ntp-keygen does. */
+#define zExplain (ntp_keygen_opt_strs+2340)
+/** Extra detail explaining what ntp-keygen does. */
+#define zDetail (NULL)
+/** The full version string for ntp-keygen. */
+#define zFullVersion (ntp_keygen_opt_strs+2342)
+/* extracted from optcode.tlib near line 364 */
+
+#if defined(ENABLE_NLS)
+# define OPTPROC_BASE OPTPROC_TRANSLATE
+ static tOptionXlateProc translate_option_strings;
+#else
+# define OPTPROC_BASE OPTPROC_NONE
+# define translate_option_strings NULL
+#endif /* ENABLE_NLS */
+
+#define ntp_keygen_full_usage (NULL)
+#define ntp_keygen_short_usage (NULL)
+
+#endif /* not defined __doxygen__ */
+
+/*
+ * Create the static procedure(s) declared above.
+ */
+/**
+ * The callout function that invokes the optionUsage function.
+ *
+ * @param[in] opts the AutoOpts option description structure
+ * @param[in] od the descriptor for the "help" (usage) option.
+ * @noreturn
+ */
+static void
+doUsageOpt(tOptions * opts, tOptDesc * od)
+{
+ int ex_code;
+ ex_code = NTP_KEYGEN_EXIT_SUCCESS;
+ optionUsage(&ntp_keygenOptions, ex_code);
+ /* NOTREACHED */
+ exit(1);
+ (void)opts;
+ (void)od;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the imbits option, when AUTOKEY is #define-d.
+ * The number of bits in the identity modulus. The default is 256.
+ * @param[in] pOptions the ntp-keygen options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+#ifdef AUTOKEY
+static void
+doOptImbits(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static struct {long rmin, rmax;} const rng[1] = {
+ { 256, 2048 } };
+ int ix;
+
+ if (pOptions <= OPTPROC_EMIT_LIMIT)
+ goto emit_ranges;
+ optionNumericVal(pOptions, pOptDesc);
+
+ for (ix = 0; ix < 1; ix++) {
+ if (pOptDesc->optArg.argInt < rng[ix].rmin)
+ continue; /* ranges need not be ordered. */
+ if (pOptDesc->optArg.argInt == rng[ix].rmin)
+ return;
+ if (rng[ix].rmax == LONG_MIN)
+ continue;
+ if (pOptDesc->optArg.argInt <= rng[ix].rmax)
+ return;
+ }
+
+ option_usage_fp = stderr;
+
+ emit_ranges:
+ optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
+}
+#endif /* defined AUTOKEY */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the debug-level option.
+ *
+ * @param[in] pOptions the ntp-keygen options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+static void
+doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ /*
+ * Be sure the flag-code[0] handles special values for the options pointer
+ * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
+ * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
+ * reset its state.
+ */
+ /* extracted from debug-opt.def, line 15 */
+OPT_VALUE_SET_DEBUG_LEVEL++;
+ (void)pOptDesc;
+ (void)pOptions;
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Code to handle the modulus option, when AUTOKEY is #define-d.
+ * The number of bits in the prime modulus. The default is 512.
+ * @param[in] pOptions the ntp-keygen options data structure
+ * @param[in,out] pOptDesc the option descriptor for this option.
+ */
+#ifdef AUTOKEY
+static void
+doOptModulus(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+ static struct {long rmin, rmax;} const rng[1] = {
+ { 256, 2048 } };
+ int ix;
+
+ if (pOptions <= OPTPROC_EMIT_LIMIT)
+ goto emit_ranges;
+ optionNumericVal(pOptions, pOptDesc);
+
+ for (ix = 0; ix < 1; ix++) {
+ if (pOptDesc->optArg.argInt < rng[ix].rmin)
+ continue; /* ranges need not be ordered. */
+ if (pOptDesc->optArg.argInt == rng[ix].rmin)
+ return;
+ if (rng[ix].rmax == LONG_MIN)
+ continue;
+ if (pOptDesc->optArg.argInt <= rng[ix].rmax)
+ return;
+ }
+
+ option_usage_fp = stderr;
+
+ emit_ranges:
+ optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
+}
+#endif /* defined AUTOKEY */
+/* extracted from optmain.tlib near line 1245 */
+
+/**
+ * The directory containing the data associated with ntp-keygen.
+ */
+#ifndef PKGDATADIR
+# define PKGDATADIR ""
+#endif
+
+/**
+ * Information about the person or institution that packaged ntp-keygen
+ * for the current distribution.
+ */
+#ifndef WITH_PACKAGER
+# define ntp_keygen_packager_info NULL
+#else
+/** Packager information for ntp-keygen. */
+static char const ntp_keygen_packager_info[] =
+ "Packaged by " WITH_PACKAGER
+
+# ifdef WITH_PACKAGER_VERSION
+ " ("WITH_PACKAGER_VERSION")"
+# endif
+
+# ifdef WITH_PACKAGER_BUG_REPORTS
+ "\nReport ntp_keygen bugs to " WITH_PACKAGER_BUG_REPORTS
+# endif
+ "\n";
+#endif
+#ifndef __doxygen__
+
+#endif /* __doxygen__ */
+/**
+ * The option definitions for ntp-keygen. The one structure that
+ * binds them all.
+ */
+tOptions ntp_keygenOptions = {
+ OPTIONS_STRUCT_VERSION,
+ 0, NULL, /* original argc + argv */
+ ( OPTPROC_BASE
+ + OPTPROC_ERRSTOP
+ + OPTPROC_SHORTOPT
+ + OPTPROC_LONGOPT
+ + OPTPROC_NO_REQ_OPT
+ + OPTPROC_ENVIRON
+ + OPTPROC_NO_ARGS
+ + OPTPROC_MISUSE ),
+ 0, NULL, /* current option index, current option */
+ NULL, NULL, zPROGNAME,
+ zRcName, zCopyright, zLicenseDescrip,
+ zFullVersion, apzHomeList, zUsageTitle,
+ zExplain, zDetail, optDesc,
+ zBugsAddr, /* address to send bugs to */
+ NULL, NULL, /* extensions/saved state */
+ optionUsage, /* usage procedure */
+ translate_option_strings, /* translation procedure */
+ /*
+ * Indexes to special options
+ */
+ { INDEX_OPT_MORE_HELP, /* more-help option index */
+ INDEX_OPT_SAVE_OPTS, /* save option index */
+ NO_EQUIVALENT, /* '-#' option index */
+ NO_EQUIVALENT /* index of default opt */
+ },
+ 26 /* full option count */, 21 /* user option count */,
+ ntp_keygen_full_usage, ntp_keygen_short_usage,
+ NULL, NULL,
+ PKGDATADIR, ntp_keygen_packager_info
+};
+
+#if ENABLE_NLS
+/**
+ * This code is designed to translate translatable option text for the
+ * ntp-keygen program. These translations happen upon entry
+ * to optionProcess().
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#ifdef HAVE_DCGETTEXT
+# include <gettext.h>
+#endif
+#include <autoopts/usage-txt.h>
+
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
+
+/**
+ * AutoGen specific wrapper function for gettext. It relies on the macro _()
+ * to convert from English to the target language, then strdup-duplicates the
+ * result string. It tries the "libopts" domain first, then whatever has been
+ * set via the \a textdomain(3) call.
+ *
+ * @param[in] pz the input text used as a lookup key.
+ * @returns the translated text (if there is one),
+ * or the original text (if not).
+ */
+static char *
+AO_gettext(char const * pz)
+{
+ char * res;
+ if (pz == NULL)
+ return NULL;
+#ifdef HAVE_DCGETTEXT
+ /*
+ * While processing the option_xlateable_txt data, try to use the
+ * "libopts" domain. Once we switch to the option descriptor data,
+ * do *not* use that domain.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ res = dgettext("libopts", pz);
+ if (res == pz)
+ res = (char *)(void *)_(pz);
+ } else
+ res = (char *)(void *)_(pz);
+#else
+ res = (char *)(void *)_(pz);
+#endif
+ if (res == pz)
+ return res;
+ res = strdup(res);
+ if (res == NULL) {
+ fputs(_("No memory for duping translated strings\n"), stderr);
+ exit(NTP_KEYGEN_EXIT_FAILURE);
+ }
+ return res;
+}
+
+/**
+ * All the pointers we use are marked "* const", but they are stored in
+ * writable memory. Coerce the mutability and set the pointer.
+ */
+static void coerce_it(void ** s) { *s = AO_gettext(*s);
+}
+
+/**
+ * Translate all the translatable strings in the ntp_keygenOptions
+ * structure defined above. This is done only once.
+ */
+static void
+translate_option_strings(void)
+{
+ tOptions * const opts = &ntp_keygenOptions;
+
+ /*
+ * Guard against re-translation. It won't work. The strings will have
+ * been changed by the first pass through this code. One shot only.
+ */
+ if (option_xlateable_txt.field_ct != 0) {
+ /*
+ * Do the translations. The first pointer follows the field count
+ * field. The field count field is the size of a pointer.
+ */
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
+
+ do {
+ ppz++; /* skip over field_ct */
+ *ppz = AO_gettext(*ppz);
+ } while (--ix > 0);
+ /* prevent re-translation and disable "libopts" domain lookup */
+ option_xlateable_txt.field_ct = 0;
+
+ coerce_it((void*)&(opts->pzCopyright));
+ coerce_it((void*)&(opts->pzCopyNotice));
+ coerce_it((void*)&(opts->pzFullVersion));
+ coerce_it((void*)&(opts->pzUsageTitle));
+ coerce_it((void*)&(opts->pzExplain));
+ coerce_it((void*)&(opts->pzDetail));
+ {
+ tOptDesc * od = opts->pOptDesc;
+ for (ix = opts->optCt; ix > 0; ix--, od++)
+ coerce_it((void*)&(od->pzText));
+ }
+ }
+}
+#endif /* ENABLE_NLS */
+
+#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
+/** I18N function strictly for xgettext. Do not compile. */
+static void bogus_function(void) {
+ /* TRANSLATORS:
+
+ The following dummy function was crated solely so that xgettext can
+ extract the correct strings. These strings are actually referenced
+ by a field name in the ntp_keygenOptions structure noted in the
+ comments below. The literal text is defined in ntp_keygen_opt_strs.
+
+ NOTE: the strings below are segmented with respect to the source string
+ ntp_keygen_opt_strs. The strings above are handed off for translation
+ at run time a paragraph at a time. Consequently, they are presented here
+ for translation a paragraph at a time.
+
+ ALSO: often the description for an option will reference another option
+ by name. These are set off with apostrophe quotes (I hope). Do not
+ translate option names.
+ */
+ /* referenced via ntp_keygenOptions.pzCopyright */
+ puts(_("ntp-keygen (ntp) 4.2.7p482\n\
+Copyright (C) 1970-2014 The University of Delaware, 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\
+can be seen at:\n"));
+ puts(_(" <http://ntp.org/license>\n\
+ <http://opensource.org/licenses/ntp-license.php>\n"));
+
+ /* referenced via ntp_keygenOptions.pzCopyNotice */
+ puts(_("Permission to use, copy, modify, and distribute this software and its\n\
+documentation for any purpose with or without fee is hereby granted,\n\
+provided that the above copyright notice appears in all copies and that\n\
+both the copyright notice and this permission notice appear in supporting\n\
+documentation, and that the name The University of Delaware not be used in\n\
+advertising or publicity pertaining to distribution of the software without\n\
+specific, written prior permission. The University of Delaware makes no\n\
+representations about the suitability this software for any purpose. It is\n\
+provided \"as is\" without express or implied warranty.\n"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("identity modulus bits"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("certificate scheme"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("privatekey cipher"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("Increase debug verbosity level"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("Set the debug verbosity level"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("Write IFF or GQ identity keys"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("Generate GQ parameters and keys"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("generate RSA host key"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("generate IFF parameters"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("set Autokey group name"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("set certificate lifetime"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("generate MD5 keys"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("modulus"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("generate PC private certificate"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("local private password"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("export IFF or GQ group keys with password"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("generate sign key (RSA or DSA)"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("set host and optionally group name"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("trusted certificate (TC scheme)"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("generate <num> MV parameters"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("update <num> MV keys"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("display extended usage information and exit"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("extended usage information passed thru pager"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("output version information and exit"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("save the option state to a config file"));
+
+ /* referenced via ntp_keygenOptions.pOptDesc->pzText */
+ puts(_("load options from a config file"));
+
+ /* referenced via ntp_keygenOptions.pzUsageTitle */
+ puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p482\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.7p482"));
+
+ /* referenced via ntp_keygenOptions.pzFullUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+
+ /* referenced via ntp_keygenOptions.pzShortUsage */
+ puts(_("<<<NOT-FOUND>>>"));
+ /* LIBOPTS-MESSAGES: */
+#line 67 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 93 "../autoopts.c"
+ puts(_("allocation of %d bytes failed\n"));
+#line 53 "../init.c"
+ puts(_("AutoOpts function called without option descriptor\n"));
+#line 86 "../init.c"
+ puts(_("\tThis exceeds the compiled library version: "));
+#line 84 "../init.c"
+ puts(_("Automated Options Processing Error!\n"
+ "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
+#line 80 "../autoopts.c"
+ puts(_("realloc of %d bytes at 0x%p failed\n"));
+#line 88 "../init.c"
+ puts(_("\tThis is less than the minimum library version: "));
+#line 121 "../version.c"
+ puts(_("Automated Options version %s\n"
+ "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
+#line 82 "../makeshell.c"
+ puts(_("(AutoOpts bug): %s.\n"));
+#line 90 "../reset.c"
+ puts(_("optionResetOpt() called, but reset-option not configured"));
+#line 292 "../usage.c"
+ puts(_("could not locate the 'help' option"));
+#line 336 "../autoopts.c"
+ puts(_("optionProcess() was called with invalid data"));
+#line 748 "../usage.c"
+ puts(_("invalid argument type specified"));
+#line 598 "../find.c"
+ puts(_("defaulted to option with optional arg"));
+#line 76 "../alias.c"
+ puts(_("aliasing option is out of range."));
+#line 234 "../enum.c"
+ puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
+#line 108 "../find.c"
+ puts(_(" The following options match:\n"));
+#line 293 "../find.c"
+ puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
+#line 161 "../check.c"
+ puts(_("%s: Command line arguments required\n"));
+#line 43 "../alias.c"
+ puts(_("%d %s%s options allowed\n"));
+#line 89 "../makeshell.c"
+ puts(_("%s error %d (%s) calling %s for '%s'\n"));
+#line 301 "../makeshell.c"
+ puts(_("interprocess pipe"));
+#line 168 "../version.c"
+ puts(_("error: version option argument '%c' invalid. Use:\n"
+ "\t'v' - version only\n"
+ "\t'c' - version and copyright\n"
+ "\t'n' - version and full copyright notice\n"));
+#line 58 "../check.c"
+ puts(_("%s error: the '%s' and '%s' options conflict\n"));
+#line 217 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 430 "../find.c"
+ puts(_("%s: The '%s' option has been disabled."));
+#line 38 "../alias.c"
+ puts(_("-equivalence"));
+#line 469 "../find.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 110 "../reset.c"
+ puts(_("%s: illegal option -- %c\n"));
+#line 271 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 755 "../find.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 118 "../reset.c"
+ puts(_("%s: illegal option -- %s\n"));
+#line 335 "../find.c"
+ puts(_("%s: unknown vendor extension option -- %s\n"));
+#line 159 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 169 "../enum.c"
+ puts(_(" or an integer from %d through %d\n"));
+#line 747 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 1081 "../usage.c"
+ puts(_("%s error: invalid option descriptor for %s\n"));
+#line 385 "../find.c"
+ puts(_("%s: invalid option name: %s\n"));
+#line 527 "../find.c"
+ puts(_("%s: The '%s' option requires an argument.\n"));
+#line 156 "../autoopts.c"
+ puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
+ "\t'%s' and '%s'."));
+#line 94 "../check.c"
+ puts(_("%s error: The %s option is required\n"));
+#line 632 "../find.c"
+ puts(_("%s: The '%s' option cannot have an argument.\n"));
+#line 151 "../check.c"
+ puts(_("%s: Command line arguments are not allowed.\n"));
+#line 535 "../save.c"
+ puts(_("error %d (%s) creating %s\n"));
+#line 234 "../enum.c"
+ puts(_("%s error: '%s' does not match any %s keywords.\n"));
+#line 93 "../reset.c"
+ puts(_("%s error: The '%s' option requires an argument.\n"));
+#line 184 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 238 "../save.c"
+ puts(_("error %d (%s) stat-ing %s\n"));
+#line 143 "../restore.c"
+ puts(_("%s error: no saved option state\n"));
+#line 231 "../autoopts.c"
+ puts(_("'%s' is not a command line option.\n"));
+#line 111 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable date/time.\n"));
+#line 132 "../save.c"
+ puts(_("'%s' not defined\n"));
+#line 50 "../time.c"
+ puts(_("%s error: '%s' is not a recognizable time duration.\n"));
+#line 92 "../check.c"
+ puts(_("%s error: The %s option must appear %d times.\n"));
+#line 164 "../numeric.c"
+ puts(_("%s error: '%s' is not a recognizable number.\n"));
+#line 200 "../enum.c"
+ puts(_("%s error: %s exceeds %s keyword count\n"));
+#line 330 "../usage.c"
+ puts(_("Try '%s %s' for more information.\n"));
+#line 45 "../alias.c"
+ puts(_("one %s%s option allowed\n"));
+#line 203 "../makeshell.c"
+ puts(_("standard output"));
+#line 938 "../makeshell.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard output"));
+#line 415 "../usage.c"
+ puts(_("standard output"));
+#line 625 "../usage.c"
+ puts(_("standard output"));
+#line 175 "../version.c"
+ puts(_("standard output"));
+#line 274 "../usage.c"
+ puts(_("standard error"));
+#line 415 "../usage.c"
+ puts(_("standard error"));
+#line 625 "../usage.c"
+ puts(_("standard error"));
+#line 175 "../version.c"
+ puts(_("standard error"));
+#line 203 "../makeshell.c"
+ puts(_("write"));
+#line 938 "../makeshell.c"
+ puts(_("write"));
+#line 273 "../usage.c"
+ puts(_("write"));
+#line 414 "../usage.c"
+ puts(_("write"));
+#line 624 "../usage.c"
+ puts(_("write"));
+#line 174 "../version.c"
+ puts(_("write"));
+#line 60 "../numeric.c"
+ puts(_("%s error: %s option value %ld is out of range.\n"));
+#line 44 "../check.c"
+ puts(_("%s error: %s option requires the %s option\n"));
+#line 131 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 183 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 237 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 256 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+#line 534 "../save.c"
+ puts(_("%s warning: cannot save options - %s not regular file\n"));
+ /* END-LIBOPTS-MESSAGES */
+
+ /* USAGE-TEXT: */
+#line 873 "../usage.c"
+ puts(_("\t\t\t\t- an alternate for '%s'\n"));
+#line 1148 "../usage.c"
+ puts(_("Version, usage and configuration options:"));
+#line 924 "../usage.c"
+ puts(_("\t\t\t\t- default option for unnamed options\n"));
+#line 837 "../usage.c"
+ puts(_("\t\t\t\t- disabled as '--%s'\n"));
+#line 1117 "../usage.c"
+ puts(_(" --- %-14s %s\n"));
+#line 1115 "../usage.c"
+ puts(_("This option has been disabled"));
+#line 864 "../usage.c"
+ puts(_("\t\t\t\t- enabled by default\n"));
+#line 40 "../alias.c"
+ puts(_("%s error: only "));
+#line 1194 "../usage.c"
+ puts(_(" - examining environment variables named %s_*\n"));
+#line 168 "../file.c"
+ puts(_("\t\t\t\t- file must not pre-exist\n"));
+#line 172 "../file.c"
+ puts(_("\t\t\t\t- file must pre-exist\n"));
+#line 380 "../usage.c"
+ puts(_("Options are specified by doubled hyphens and their name or by a single\n"
+ "hyphen and the flag character.\n"));
+#line 916 "../makeshell.c"
+ puts(_("\n"
+ "= = = = = = = =\n\n"
+ "This incarnation of genshell will produce\n"
+ "a shell script to parse the options for %s:\n\n"));
+#line 166 "../enum.c"
+ puts(_(" or an integer mask with any of the lower %d bits set\n"));
+#line 897 "../usage.c"
+ puts(_("\t\t\t\t- is a set membership option\n"));
+#line 918 "../usage.c"
+ puts(_("\t\t\t\t- must appear between %d and %d times\n"));
+#line 382 "../usage.c"
+ puts(_("Options are specified by single or double hyphens and their name.\n"));
+#line 904 "../usage.c"
+ puts(_("\t\t\t\t- may appear multiple times\n"));
+#line 891 "../usage.c"
+ puts(_("\t\t\t\t- may not be preset\n"));
+#line 1309 "../usage.c"
+ puts(_(" Arg Option-Name Description\n"));
+#line 1245 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1303 "../usage.c"
+ puts(_(" Flg Arg Option-Name Description\n"));
+#line 1304 "../usage.c"
+ puts(_(" %3s %s"));
+#line 1310 "../usage.c"
+ puts(_(" %3s %s"));
+#line 387 "../usage.c"
+ puts(_("The '-#<number>' option may omit the hash char\n"));
+#line 383 "../usage.c"
+ puts(_("All arguments are named options.\n"));
+#line 971 "../usage.c"
+ puts(_(" - reading file %s"));
+#line 409 "../usage.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 100 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 129 "../version.c"
+ puts(_("\n"
+ "Please send bug reports to: <%s>\n"));
+#line 903 "../usage.c"
+ puts(_("\t\t\t\t- may NOT appear - preset only\n"));
+#line 944 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 1192 "../usage.c"
+ puts(_("\n"
+ "The following option preset mechanisms are supported:\n"));
+#line 682 "../usage.c"
+ puts(_("prohibits these options:\n"));
+#line 677 "../usage.c"
+ puts(_("prohibits the option '%s'\n"));
+#line 81 "../numeric.c"
+ puts(_("%s%ld to %ld"));
+#line 79 "../numeric.c"
+ puts(_("%sgreater than or equal to %ld"));
+#line 75 "../numeric.c"
+ puts(_("%s%ld exactly"));
+#line 68 "../numeric.c"
+ puts(_("%sit must lie in one of the ranges:\n"));
+#line 68 "../numeric.c"
+ puts(_("%sit must be in the range:\n"));
+#line 88 "../numeric.c"
+ puts(_(", or\n"));
+#line 66 "../numeric.c"
+ puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
+#line 77 "../numeric.c"
+ puts(_("%sless than or equal to %ld"));
+#line 390 "../usage.c"
+ puts(_("Operands and options may be intermixed. They will be reordered.\n"));
+#line 652 "../usage.c"
+ puts(_("requires the option '%s'\n"));
+#line 655 "../usage.c"
+ puts(_("requires these options:\n"));
+#line 1321 "../usage.c"
+ puts(_(" Arg Option-Name Req? Description\n"));
+#line 1315 "../usage.c"
+ puts(_(" Flg Arg Option-Name Req? Description\n"));
+#line 167 "../enum.c"
+ puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
+ "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
+ "will set them all. Multiple entries may be passed as an option\n"
+ "argument list.\n"));
+#line 910 "../usage.c"
+ puts(_("\t\t\t\t- may appear up to %d times\n"));
+#line 77 "../enum.c"
+ puts(_("The valid \"%s\" option keywords are:\n"));
+#line 1152 "../usage.c"
+ puts(_("The next option supports vendor supported extra options:"));
+#line 773 "../usage.c"
+ puts(_("These additional options are:"));
+ /* END-USAGE-TEXT */
+}
+#endif /* uncompilable code */
+#ifdef __cplusplus
+}
+#endif
+/* ntp-keygen-opts.c ends here */
diff --git a/util/ntp-keygen-opts.def b/util/ntp-keygen-opts.def
new file mode 100644
index 0000000..3088cf5
--- /dev/null
+++ b/util/ntp-keygen-opts.def
@@ -0,0 +1,1144 @@
+/* -*- Mode: Text -*- */
+
+autogen definitions options;
+
+#include copyright.def
+#include homerc.def
+#include autogen-version.def
+
+prog-name = "ntp-keygen";
+prog-title = "Create a NTP host key";
+package = ntp;
+
+include = '#include <stdlib.h>';
+#include version.def
+
+flag = {
+ value = b;
+ name = imbits;
+ arg-type = number;
+ arg-name = imbits;
+ arg-range = '256->2048';
+ ifdef = AUTOKEY;
+ descrip = "identity modulus bits";
+ doc = <<- _EndOfDoc_
+ The number of bits in the identity modulus. The default is 256.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = c;
+ name = certificate;
+ arg-type = string;
+ arg-name = scheme;
+ ifdef = AUTOKEY;
+ descrip = "certificate scheme";
+ doc = <<- _EndOfDoc_
+ scheme is one of
+ RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+ DSA-SHA, or DSA-SHA1.
+
+ Select the certificate message digest/signature encryption scheme.
+ Note that RSA schemes must be used with a RSA sign key and DSA
+ schemes must be used with a DSA sign key. The default without
+ this option is RSA-MD5.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = C;
+ name = cipher;
+ arg-type = string;
+ arg-name = cipher;
+ ifdef = AUTOKEY;
+ descrip = "privatekey cipher";
+ doc = <<- _EndOfDoc_
+ Select the cipher which is used to encrypt the files containing
+ private keys. The default is three-key triple DES in CBC mode,
+ equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+ available in "@code{openssl -h}" output.
+ _EndOfDoc_;
+};
+
+#include debug-opt.def
+
+flag = {
+ value = e;
+ name = id-key;
+ ifdef = AUTOKEY;
+ descrip = "Write IFF or GQ identity keys";
+ doc = <<- _EndOfDoc_
+ Write the IFF or GQ client keys to the standard output. This is
+ intended for automatic key distribution by mail.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = G;
+ name = gq-params;
+ ifdef = AUTOKEY;
+ descrip = "Generate GQ parameters and keys";
+ doc = <<- _EndOfDoc_
+ Generate parameters and keys for the GQ identification scheme,
+ obsoleting any that may exist.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = H;
+ name = host-key;
+ ifdef = AUTOKEY;
+ descrip = "generate RSA host key";
+ doc = <<- _EndOfDoc_
+ Generate new host keys, obsoleting any that may exist.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = I;
+ name = iffkey;
+ ifdef = AUTOKEY;
+ descrip = "generate IFF parameters";
+ doc = <<- _EndOfDoc_
+ Generate parameters for the IFF identification scheme, obsoleting
+ any that may exist.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = i;
+ name = ident;
+ ifdef = AUTOKEY;
+ arg-type = string;
+ arg-name = group;
+ descrip = "set Autokey group name";
+ doc = <<- _EndOfDoc_
+ Set the optional Autokey group name to name. This is used in
+ the file name of IFF, GQ, and MV client parameters files. In
+ that role, the default is the host name if this option is not
+ provided. The group name, if specified using @code{-i/--ident} or
+ using @code{-s/--subject-name} following an '@code{@}' character,
+ is also a part of the self-signed host certificate's subject and
+ issuer names in the form @code{host@group} and should match the
+ '@code{crypto ident}' or '@code{server ident}' configuration in
+ @code{ntpd}'s configuration file.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = l;
+ name = lifetime;
+ ifdef = AUTOKEY;
+ arg-type = number;
+ arg-name = lifetime;
+ descrip = "set certificate lifetime";
+ doc = <<- _EndOfDoc_
+ Set the certificate expiration to lifetime days from now.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = M;
+ name = md5key;
+ descrip = "generate MD5 keys";
+ doc = <<- _EndOfDoc_
+ Generate MD5 keys, obsoleting any that may exist.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = m;
+ name = modulus;
+ arg-type = number;
+ arg-name = modulus;
+ arg-range = '256->2048';
+ ifdef = AUTOKEY;
+ descrip = "modulus";
+ doc = <<- _EndOfDoc_
+ The number of bits in the prime modulus. The default is 512.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = P;
+ name = pvt-cert;
+ ifdef = AUTOKEY;
+ descrip = "generate PC private certificate";
+ doc = <<- _EndOfDoc_
+ Generate a private certificate. By default, the program generates
+ public certificates.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = p;
+ name = password; // was: pvt-passwd;
+ ifdef = AUTOKEY;
+ arg-type = string;
+ arg-name = passwd;
+ descrip = "local private password";
+ doc = <<- _EndOfDoc_
+ Local files containing private data are encrypted with the
+ DES-CBC algorithm and the specified password. The same password
+ must be specified to the local ntpd via the "crypto pw password"
+ configuration command. The default password is the local
+ hostname.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = q;
+ name = export-passwd; // Was: get-pvt-passwd;
+ ifdef = AUTOKEY;
+ arg-type = string;
+ arg-name = passwd;
+ descrip = "export IFF or GQ group keys with password";
+ doc = <<- _EndOfDoc_
+ Export IFF or GQ identity group keys to the standard output,
+ encrypted with the DES-CBC algorithm and the specified password.
+ The same password must be specified to the remote ntpd via the
+ "crypto pw password" configuration command. See also the option
+ --id-key (-e) for unencrypted exports.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = S;
+ name = sign-key;
+ arg-type = string;
+ arg-name = sign;
+ ifdef = AUTOKEY;
+ descrip = "generate sign key (RSA or DSA)";
+ doc = <<- _EndOfDoc_
+ Generate a new sign key of the designated type, obsoleting any
+ that may exist. By default, the program uses the host key as the
+ sign key.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = s;
+ name = subject-name;
+ arg-type = string;
+ arg-name = host@group;
+ ifdef = AUTOKEY;
+ descrip = "set host and optionally group name";
+ doc = <<- _EndOfDoc_
+ Set the Autokey host name, and optionally, group name specified
+ following an '@code{@}' character. The host name is used in the file
+ name of generated host and signing certificates, without the
+ group name. The host name, and if provided, group name are used
+ in @code{host@group} form for the host certificate's subject and issuer
+ fields. Specifying '@code{-s @group}' is allowed, and results in
+ leaving the host name unchanged while appending @code{@group} to the
+ subject and issuer fields, as with @code{-i group}. The group name, or
+ if not provided, the host name are also used in the file names
+ of IFF, GQ, and MV client parameter files.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = T;
+ name = trusted-cert;
+ ifdef = AUTOKEY;
+ descrip = "trusted certificate (TC scheme)";
+ doc = <<- _EndOfDoc_
+ Generate a trusted certificate. By default, the program generates
+ a non-trusted certificate.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = V;
+ name = mv-params;
+ arg-type = number;
+ arg-name = num;
+ ifdef = AUTOKEY;
+ descrip = "generate <num> MV parameters";
+ doc = <<- _EndOfDoc_
+ Generate parameters and keys for the Mu-Varadharajan (MV)
+ identification scheme.
+ _EndOfDoc_;
+};
+
+flag = {
+ value = v;
+ name = mv-keys;
+ arg-type = number;
+ arg-name = num;
+ ifdef = AUTOKEY;
+ descrip = "update <num> MV keys";
+};
+
+/* explain: Additional information whenever the usage routine is invoked */
+explain = <<- _END_EXPLAIN
+ _END_EXPLAIN;
+
+doc-section = {
+ ds-type = 'DESCRIPTION';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_PROG_MDOC_DESCRIP
+This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+.Pp
+All files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+.Pp
+When used to generate message digest keys, the program produces a file
+containing ten pseudo-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the OpenSSL library is installed, it produces an additional ten
+hex-encoded random bit strings suitable for the SHA1 and other message
+digest algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys used for ordinary NTP associations, additional keys
+can be defined as passwords for the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+.Pp
+The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys are probably not compatible with anything
+other than Autokey.
+.Pp
+Some files used by this program are encrypted using a private password.
+The
+.Fl p
+option specifies the password for local encrypted files and the
+.Fl q
+option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+.Fn gethostname
+function, normally the DNS name of the host is used.
+.Pp
+The
+.Ar pw
+option of the
+.Ar crypto
+configuration command specifies the read
+password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by
+.Ar ntpd
+without password but only on the same host.
+.Pp
+Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called
+.Ar ntp.keys ,
+is usually installed in
+.Pa /etc .
+Other files and links are usually installed in
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem in
+NFS-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the
+.Ar keysdir
+configuration command in such cases.
+Normally, this is in
+.Pa /etc .
+.Pp
+This program directs commentary and error messages to the standard
+error stream
+.Ar stderr
+and remote files to the standard output stream
+.Ar stdout
+where they can be piped to other applications or redirected to files.
+The names used for generated files and links all begin with the
+string
+.Ar ntpkey
+and include the file type, generating host and filestamp,
+as described in the
+.Dq Cryptographic Data Files
+section below.
+.Ss Running the Program
+To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually
+.Pa /usr/local/etc
+When run for the first time, or if all files with names beginning with
+.Ar ntpkey
+have been removed, use the
+.Nm
+command without arguments to generate a
+default RSA host key and matching RSA-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+.Pp
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+.Nm
+with the
+.Fl T
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+.Pp
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+.Fl S
+option and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+.Fl c
+option.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
+.Pp
+Additional information on trusted groups and identity schemes is on the
+.Dq Autokey Public-Key Authentication
+page.
+
+
+.Pp
+The
+.Xr ntpd 1ntpdmdoc
+configuration command
+.Ic crypto pw Ar password
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+
+.Pp
+File names begin with the prefix
+.Cm ntpkey_
+and end with the postfix
+.Ar _hostname.filestamp ,
+where
+.Ar hostname
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+.Ar filestamp
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+.Ic rm ntpkey\&*
+command or all files generated
+at a specific time can be removed by a
+.Ic rm
+.Ar \&*filestamp
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.Pp
+All files are installed by default in the keys directory
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.Pp
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.Pp
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+.Xr ntpd 1ntpdmdoc
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+.Nm
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.Ss Running the program
+The safest way to run the
+.Nm
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+.Pa /usr/local/etc ,
+then run the program.
+When run for the first time,
+or if all
+.Cm ntpkey
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.Pp
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.Pp
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.Pp
+Running the program as other than root and using the Unix
+.Ic su
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+.Cm .rnd
+in the user home directory.
+However, there should be only one
+.Cm .rnd ,
+most conveniently
+in the root directory, so it is convenient to define the
+.Cm $RANDFILE
+environment variable used by the OpenSSL library as the path to
+.Cm /.rnd .
+.Pp
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.Pp
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+
+.Pp
+All files are installed by default in the keys directory
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.Pp
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.Pp
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+.Xr ntpd 1ntpdmdoc
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+.Nm
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.Ss Running the program
+The safest way to run the
+.Nm
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+.Pa /usr/local/etc ,
+then run the program.
+When run for the first time,
+or if all
+.Cm ntpkey
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.Pp
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.Pp
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.Pp
+Running the program as other than root and using the Unix
+.Ic su
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+.Cm .rnd
+in the user home directory.
+However, there should be only one
+.Cm .rnd ,
+most conveniently
+in the root directory, so it is convenient to define the
+.Cm $RANDFILE
+environment variable used by the OpenSSL library as the path to
+.Cm /.rnd .
+.Pp
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.Pp
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+
+s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+.Sx Authentication Options
+section of
+.Xr ntp.conf 5 .
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+.Sx Automatic NTP Configuration Options
+section of
+.Xr ntp.conf 5 .
+.Pp
+On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+.Cm ntpkey
+files.
+Then run
+.Nm
+.Fl T
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+.Fl T
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+.Pp
+If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+.Nm
+with the
+.Fl S Ar type
+option, where
+.Ar type
+is either
+.Cm RSA
+or
+.Cm DSA .
+The most often need to do this is when a DSA-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+.Nm
+with the
+.Fl c Ar scheme
+option and selected
+.Ar scheme
+as needed.
+f
+.Nm
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+.Pp
+After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+.Nm
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+.Xr ntpd 1ntpdmdoc
+should be restarted.
+When
+.Xr ntpd 1ntpdmdoc
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+.Ss Identity Schemes
+As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+.Qq Identification Schemes
+page
+(maybe available at
+.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+.Pp
+In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+.Pp
+The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+.Nm
+.Fl P
+.Fl p Ar password
+to generate the host key file
+.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
+and trusted private certificate file
+.Pa ntpkey_RSA-MD5_cert_ Ns Ar alice.filestamp .
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+.Pa ntpkey_host_ Ns Ar bob
+to the host key file and soft link
+.Pa ntpkey_cert_ Ns Ar bob
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+.Pp
+For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+.Nm
+.Fl T
+.Fl I
+.Fl p Ar password
+to produce her parameter file
+.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+.Pa ntpkey_iff_ Ns Ar alice
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+.Pp
+If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+.Nm
+.Fl e
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+.Pa ntpkey_iff_ Ns Ar alice
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+.Pp
+For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+.Nm
+.Fl T
+.Fl G
+.Fl p Ar password
+to produce her parameter file
+.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+.Pa ntpkey_gq_ Ns Ar alice
+to this file.
+In addition, on each host bob install a soft link
+from generic
+.Pa ntpkey_gq_ Ns Ar bob
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+.Pp
+For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+.Nm
+.Fl V Ar n
+.Fl p Ar password ,
+where
+.Ar n
+is the number of revokable keys (typically 5) to produce
+the parameter file
+.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
+and client key files
+.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
+where
+.Ar d
+is the key number (0 \&<
+.Ar d
+\&<
+.Ar n ) .
+Copy the parameter file to alice and install a soft link
+from the generic
+.Pa ntpkey_mv_ Ns Ar alice
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+.Pa ntpkey_mvkey_ Ns Ar bob
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+.Ss Command Line Options
+.Bl -tag -width indent
+.It Fl c Ar scheme
+Select certificate message digest/signature encryption scheme.
+The
+.Ar scheme
+can be one of the following:
+. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+or
+.Cm DSA-SHA1 .
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+.Cm RSA-MD5 .
+.It Fl d
+Enable debugging.
+This option displays the cryptographic data produced in eye-friendly billboards.
+.It Fl e
+Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+.It Fl G
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.It Fl g
+Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+.It Fl H
+Generate new host keys, obsoleting any that may exist.
+.It Fl I
+Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+.It Fl i Ar name
+Set the suject name to
+.Ar name .
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+.It Fl M
+Generate MD5 keys, obsoleting any that may exist.
+.It Fl P
+Generate a private certificate.
+By default, the program generates public certificates.
+.It Fl p Ar password
+Encrypt generated files containing private data with
+.Ar password
+and the DES-CBC algorithm.
+.It Fl q
+Set the password for reading files to password.
+.It Fl S Oo Cm RSA | DSA Oc
+Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+.It Fl s Ar name
+Set the issuer name to
+.Ar name .
+This is used for the issuer field in certificates
+and in the file name for identity files.
+.It Fl T
+Generate a trusted certificate.
+By default, the program generates a non-trusted certificate.
+.It Fl V Ar nkeys
+Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+.El
+.Ss Random Seed File
+All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+.Nm
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+.Pp
+It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+.Pp
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+.Cm .rnd ,
+which must be available when starting the NTP daemon
+or the
+.Nm
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+.Ic randfile
+subcommand of the
+.Ic crypto
+configuration command.
+If not specified in this way, or when starting the
+.Nm
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+.Ev RANDFILE
+environment variable in the user home directory,
+whether root or some other user.
+If the
+.Ev RANDFILE
+environment variable is not present,
+the library will look for the
+.Cm .rnd
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+.Ss Cryptographic Data Files
+All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+.Nm
+program and
+.Xr ntpd 1ntpdmdoc
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+.Pp
+The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+.D1 Ar keyno type key
+where
+.Ar keyno
+is a positive integer in the range 1-65,535,
+.Ar type
+is the string MD5 defining the key format and
+.Ar key
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+.Ql #
+character.
+.Pp
+Note that the keys used by the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+.Pp
+The
+.Nm
+program generates a MD5 symmetric keys file
+.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+.Pa ntp.keys ,
+so
+.Nm
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utilities.
+ _END_PROG_MDOC_DESCRIP;
+};
+
+doc-section = {
+ ds-type = 'USAGE';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_USAGE
+The
+.Fl p Ar password
+option specifies the write password and
+.Fl q Ar password
+option the read password for previously encrypted files.
+The
+.Nm
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
+ _END_MDOC_USAGE;
+};
+
+doc-section = {
+ ds-type = 'NOTES';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_NOTES
+Portions of this document came from FreeBSD.
+ _END_MDOC_NOTES;
+};
+
+doc-section = {
+ ds-type = 'BUGS';
+ ds-format = 'mdoc';
+ ds-text = <<- _END_MDOC_BUGS
+It can take quite a while to generate some cryptographic values,
+from one to several minutes with modern architectures
+such as UltraSPARC and up to tens of minutes to an hour
+with older architectures such as SPARC IPC.
+.Pp
+Please report bugs to http://bugs.ntp.org .
+ _END_MDOC_BUGS;
+};
diff --git a/util/ntp-keygen-opts.h b/util/ntp-keygen-opts.h
new file mode 100644
index 0000000..48a9998
--- /dev/null
+++ b/util/ntp-keygen-opts.h
@@ -0,0 +1,386 @@
+/*
+ * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
+ *
+ * It has been AutoGen-ed December 2, 2014 at 08:58:31 AM by AutoGen 5.18.5pre4
+ * From the definitions ntp-keygen-opts.def
+ * and the template file options
+ *
+ * Generated from AutoOpts 41:0:16 templates.
+ *
+ * AutoOpts is a copyrighted work. This header file is not encumbered
+ * by AutoOpts licensing, but is provided under the licensing terms chosen
+ * by the ntp-keygen author or copyright holder. AutoOpts is
+ * licensed under the terms of the LGPL. The redistributable library
+ * (``libopts'') is licensed under the terms of either the LGPL or, at the
+ * users discretion, the BSD license. See the AutoOpts and/or libopts sources
+ * for details.
+ *
+ * The ntp-keygen program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, all rights reserved.
+ * This is free software. It is licensed for use, modification and
+ * redistribution under the terms of the NTP License, copies of which
+ * can be seen at:
+ * <http://ntp.org/license>
+ * <http://opensource.org/licenses/ntp-license.php>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose with or without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and that
+ * both the copyright notice and this permission notice appear in
+ * supporting documentation, and that the name The University of Delaware not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The University of Delaware makes no
+ * representations about the suitability this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ */
+/**
+ * This file contains the programmatic interface to the Automated
+ * Options generated for the ntp-keygen program.
+ * These macros are documented in the AutoGen info file in the
+ * "AutoOpts" chapter. Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD
+#define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 1
+#include "config.h"
+#include <autoopts/options.h>
+
+/**
+ * Ensure that the library used for compiling this generated header is at
+ * least as new as the version current when the header template was released
+ * (not counting patch version increments). Also ensure that the oldest
+ * tolerable version is at least as old as what was current when the header
+ * template was released.
+ */
+#define AO_TEMPLATE_VERSION 167936
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+ Choke Me.
+#endif
+
+/**
+ * Enumeration of each option type for ntp-keygen
+ */
+typedef enum {
+ INDEX_OPT_IMBITS = 0,
+ INDEX_OPT_CERTIFICATE = 1,
+ INDEX_OPT_CIPHER = 2,
+ INDEX_OPT_DEBUG_LEVEL = 3,
+ INDEX_OPT_SET_DEBUG_LEVEL = 4,
+ INDEX_OPT_ID_KEY = 5,
+ INDEX_OPT_GQ_PARAMS = 6,
+ INDEX_OPT_HOST_KEY = 7,
+ INDEX_OPT_IFFKEY = 8,
+ INDEX_OPT_IDENT = 9,
+ INDEX_OPT_LIFETIME = 10,
+ INDEX_OPT_MD5KEY = 11,
+ INDEX_OPT_MODULUS = 12,
+ INDEX_OPT_PVT_CERT = 13,
+ INDEX_OPT_PASSWORD = 14,
+ INDEX_OPT_EXPORT_PASSWD = 15,
+ INDEX_OPT_SIGN_KEY = 16,
+ INDEX_OPT_SUBJECT_NAME = 17,
+ INDEX_OPT_TRUSTED_CERT = 18,
+ INDEX_OPT_MV_PARAMS = 19,
+ INDEX_OPT_MV_KEYS = 20,
+ INDEX_OPT_VERSION = 21,
+ INDEX_OPT_HELP = 22,
+ INDEX_OPT_MORE_HELP = 23,
+ INDEX_OPT_SAVE_OPTS = 24,
+ INDEX_OPT_LOAD_OPTS = 25
+} teOptIndex;
+/** count of all options for ntp-keygen */
+#define OPTION_CT 26
+/** ntp-keygen version */
+#define NTP_KEYGEN_VERSION "4.2.7p482"
+/** Full ntp-keygen version text */
+#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.7p482"
+
+/**
+ * Interface defines for all options. Replace "n" with the UPPER_CASED
+ * option name (as in the teOptIndex enumeration above).
+ * e.g. HAVE_OPT(IMBITS)
+ */
+#define DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n])
+/** 'true' if an option has been specified in any way */
+#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
+/** The string argument to an option. The argument type must be \"string\". */
+#define OPT_ARG(n) (DESC(n).optArg.argString)
+/** Mask the option state revealing how an option was specified.
+ * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
+ * \a OPTST_DEFINED, \a OPTST_RESET or zero.
+ */
+#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
+/** Count of option's occurrances *on the command line*. */
+#define COUNT_OPT(n) (DESC(n).optOccCt)
+/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
+#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
+/** 'true' if \a HAVE_OPT would yield 'false'. */
+#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
+/** 'true' if OPTST_DISABLED bit not set. */
+#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
+/** number of stacked option arguments.
+ * Valid only for stacked option arguments. */
+#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
+/** stacked argument vector.
+ * Valid only for stacked option arguments. */
+#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
+/** Reset an option. */
+#define CLEAR_OPT(n) STMTS( \
+ DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \
+ if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+ DESC(n).fOptState |= OPTST_DISABLED; \
+ DESC(n).optCookie = NULL )
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * Enumeration of ntp-keygen exit codes
+ */
+typedef enum {
+ NTP_KEYGEN_EXIT_SUCCESS = 0,
+ NTP_KEYGEN_EXIT_FAILURE = 1,
+ NTP_KEYGEN_EXIT_USAGE_ERROR = 64,
+ NTP_KEYGEN_EXIT_NO_CONFIG_INPUT = 66,
+ NTP_KEYGEN_EXIT_LIBOPTS_FAILURE = 70
+} ntp_keygen_exit_code_t;
+/** @} */
+/**
+ * Make sure there are no #define name conflicts with the option names
+ */
+#ifndef NO_OPTION_NAME_WARNINGS
+# ifdef IMBITS
+# warning undefining IMBITS due to option name conflict
+# undef IMBITS
+# endif
+# ifdef CERTIFICATE
+# warning undefining CERTIFICATE due to option name conflict
+# undef CERTIFICATE
+# endif
+# ifdef CIPHER
+# warning undefining CIPHER due to option name conflict
+# undef CIPHER
+# endif
+# ifdef DEBUG_LEVEL
+# warning undefining DEBUG_LEVEL due to option name conflict
+# undef DEBUG_LEVEL
+# endif
+# ifdef SET_DEBUG_LEVEL
+# warning undefining SET_DEBUG_LEVEL due to option name conflict
+# undef SET_DEBUG_LEVEL
+# endif
+# ifdef ID_KEY
+# warning undefining ID_KEY due to option name conflict
+# undef ID_KEY
+# endif
+# ifdef GQ_PARAMS
+# warning undefining GQ_PARAMS due to option name conflict
+# undef GQ_PARAMS
+# endif
+# ifdef HOST_KEY
+# warning undefining HOST_KEY due to option name conflict
+# undef HOST_KEY
+# endif
+# ifdef IFFKEY
+# warning undefining IFFKEY due to option name conflict
+# undef IFFKEY
+# endif
+# ifdef IDENT
+# warning undefining IDENT due to option name conflict
+# undef IDENT
+# endif
+# ifdef LIFETIME
+# warning undefining LIFETIME due to option name conflict
+# undef LIFETIME
+# endif
+# ifdef MD5KEY
+# warning undefining MD5KEY due to option name conflict
+# undef MD5KEY
+# endif
+# ifdef MODULUS
+# warning undefining MODULUS due to option name conflict
+# undef MODULUS
+# endif
+# ifdef PVT_CERT
+# warning undefining PVT_CERT due to option name conflict
+# undef PVT_CERT
+# endif
+# ifdef PASSWORD
+# warning undefining PASSWORD due to option name conflict
+# undef PASSWORD
+# endif
+# ifdef EXPORT_PASSWD
+# warning undefining EXPORT_PASSWD due to option name conflict
+# undef EXPORT_PASSWD
+# endif
+# ifdef SIGN_KEY
+# warning undefining SIGN_KEY due to option name conflict
+# undef SIGN_KEY
+# endif
+# ifdef SUBJECT_NAME
+# warning undefining SUBJECT_NAME due to option name conflict
+# undef SUBJECT_NAME
+# endif
+# ifdef TRUSTED_CERT
+# warning undefining TRUSTED_CERT due to option name conflict
+# undef TRUSTED_CERT
+# endif
+# ifdef MV_PARAMS
+# warning undefining MV_PARAMS due to option name conflict
+# undef MV_PARAMS
+# endif
+# ifdef MV_KEYS
+# warning undefining MV_KEYS due to option name conflict
+# undef MV_KEYS
+# endif
+#else /* NO_OPTION_NAME_WARNINGS */
+# undef IMBITS
+# undef CERTIFICATE
+# undef CIPHER
+# undef DEBUG_LEVEL
+# undef SET_DEBUG_LEVEL
+# undef ID_KEY
+# undef GQ_PARAMS
+# undef HOST_KEY
+# undef IFFKEY
+# undef IDENT
+# undef LIFETIME
+# undef MD5KEY
+# undef MODULUS
+# undef PVT_CERT
+# undef PASSWORD
+# undef EXPORT_PASSWD
+# undef SIGN_KEY
+# undef SUBJECT_NAME
+# undef TRUSTED_CERT
+# undef MV_PARAMS
+# undef MV_KEYS
+#endif /* NO_OPTION_NAME_WARNINGS */
+
+/**
+ * Interface defines for specific options.
+ * @{
+ */
+#define VALUE_OPT_IMBITS 'b'
+#ifdef AUTOKEY
+#define OPT_VALUE_IMBITS (DESC(IMBITS).optArg.argInt)
+#endif /* AUTOKEY */
+#define VALUE_OPT_CERTIFICATE 'c'
+#define VALUE_OPT_CIPHER 'C'
+#define VALUE_OPT_DEBUG_LEVEL 'd'
+#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
+
+#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
+#define VALUE_OPT_ID_KEY 'e'
+#define VALUE_OPT_GQ_PARAMS 'G'
+#define VALUE_OPT_HOST_KEY 'H'
+#define VALUE_OPT_IFFKEY 'I'
+#define VALUE_OPT_IDENT 'i'
+#define VALUE_OPT_LIFETIME 'l'
+#ifdef AUTOKEY
+#define OPT_VALUE_LIFETIME (DESC(LIFETIME).optArg.argInt)
+#endif /* AUTOKEY */
+#define VALUE_OPT_MD5KEY 'M'
+#define VALUE_OPT_MODULUS 'm'
+#ifdef AUTOKEY
+#define OPT_VALUE_MODULUS (DESC(MODULUS).optArg.argInt)
+#endif /* AUTOKEY */
+#define VALUE_OPT_PVT_CERT 'P'
+#define VALUE_OPT_PASSWORD 'p'
+#define VALUE_OPT_EXPORT_PASSWD 'q'
+#define VALUE_OPT_SIGN_KEY 'S'
+#define VALUE_OPT_SUBJECT_NAME 's'
+#define VALUE_OPT_TRUSTED_CERT 'T'
+#define VALUE_OPT_MV_PARAMS 'V'
+#ifdef AUTOKEY
+#define OPT_VALUE_MV_PARAMS (DESC(MV_PARAMS).optArg.argInt)
+#endif /* AUTOKEY */
+#define VALUE_OPT_MV_KEYS 'v'
+#ifdef AUTOKEY
+#define OPT_VALUE_MV_KEYS (DESC(MV_KEYS).optArg.argInt)
+#endif /* AUTOKEY */
+/** option flag (value) for help-value option */
+#define VALUE_OPT_HELP '?'
+/** option flag (value) for more-help-value option */
+#define VALUE_OPT_MORE_HELP '!'
+/** option flag (value) for version-value option */
+#define VALUE_OPT_VERSION 0x1001
+/** option flag (value) for save-opts-value option */
+#define VALUE_OPT_SAVE_OPTS '>'
+/** option flag (value) for load-opts-value option */
+#define VALUE_OPT_LOAD_OPTS '<'
+#define SET_OPT_SAVE_OPTS(a) STMTS( \
+ DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
+ DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
+ DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
+/*
+ * Interface defines not associated with particular options
+ */
+#define ERRSKIP_OPTERR STMTS(ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP)
+#define ERRSTOP_OPTERR STMTS(ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP)
+#define RESTART_OPT(n) STMTS( \
+ ntp_keygenOptions.curOptIdx = (n); \
+ ntp_keygenOptions.pzCurOpt = NULL )
+#define START_OPT RESTART_OPT(1)
+#define USAGE(c) (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* * * * * *
+ *
+ * Declare the ntp-keygen option descriptor.
+ */
+extern tOptions ntp_keygenOptions;
+
+#if defined(ENABLE_NLS)
+# ifndef _
+# include <stdio.h>
+# ifndef HAVE_GETTEXT
+ extern char * gettext(char const *);
+# else
+# include <libintl.h>
+# endif
+
+# ifndef ATTRIBUTE_FORMAT_ARG
+# define ATTRIBUTE_FORMAT_ARG(_a)
+# endif
+
+static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
+static inline char* aoGetsText(char const* pz) {
+ if (pz == NULL) return NULL;
+ return (char*)gettext(pz);
+}
+# define _(s) aoGetsText(s)
+# endif /* _() */
+
+# define OPT_NO_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT_CFG;)
+# define OPT_NO_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet |= \
+ OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
+
+# define OPT_XLAT_CFG_NAMES STMTS(ntp_keygenOptions.fOptSet &= \
+ ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
+# define OPT_XLAT_OPT_NAMES STMTS(ntp_keygenOptions.fOptSet &= \
+ ~OPTPROC_NXLAT_OPT;)
+
+#else /* ENABLE_NLS */
+# define OPT_NO_XLAT_CFG_NAMES
+# define OPT_NO_XLAT_OPT_NAMES
+
+# define OPT_XLAT_CFG_NAMES
+# define OPT_XLAT_OPT_NAMES
+
+# ifndef _
+# define _(_s) _s
+# endif
+#endif /* ENABLE_NLS */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */
+
+/* ntp-keygen-opts.h ends here */
diff --git a/util/ntp-keygen.1ntp-keygenman b/util/ntp-keygen.1ntp-keygenman
new file mode 100644
index 0000000..28dc6ad
--- /dev/null
+++ b/util/ntp-keygen.1ntp-keygenman
@@ -0,0 +1,1221 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp-keygen 1ntp-keygenman "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-znaynR/ag-LnaqmR)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:44 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-keygen-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp-keygen\fP
+\- Create a NTP host key
+.SH SYNOPSIS
+\f\*[B-Font]ntp-keygen\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+.sp \n(Ppu
+.ne 2
+
+All files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+.sp \n(Ppu
+.ne 2
+
+When used to generate message digest keys, the program produces a file
+containing ten pseudo-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the OpenSSL library is installed, it produces an additional ten
+hex-encoded random bit strings suitable for the SHA1 and other message
+digest algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys used for ordinary NTP associations, additional keys
+can be defined as passwords for the
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utility programs.
+.sp \n(Ppu
+.ne 2
+
+The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys are probably not compatible with anything
+other than Autokey.
+.sp \n(Ppu
+.ne 2
+
+Some files used by this program are encrypted using a private password.
+The
+\f\*[B-Font]\-p\f[]
+option specifies the password for local encrypted files and the
+\f\*[B-Font]\-q\f[]
+option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+\fBgethostname\fR()\f[]
+function, normally the DNS name of the host is used.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[I-Font]pw\f[]
+option of the
+\f\*[I-Font]crypto\f[]
+configuration command specifies the read
+password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by
+\f\*[I-Font]ntpd\f[]
+without password but only on the same host.
+.sp \n(Ppu
+.ne 2
+
+Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called
+\f\*[I-Font]ntp.keys\f[],
+is usually installed in
+\fI/etc\f[].
+Other files and links are usually installed in
+\fI/usr/local/etc\f[],
+which is normally in a shared filesystem in
+NFS-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the
+\f\*[I-Font]keysdir\f[]
+configuration command in such cases.
+Normally, this is in
+\fI/etc\f[].
+.sp \n(Ppu
+.ne 2
+
+This program directs commentary and error messages to the standard
+error stream
+\f\*[I-Font]stderr\f[]
+and remote files to the standard output stream
+\f\*[I-Font]stdout\f[]
+where they can be piped to other applications or redirected to files.
+The names used for generated files and links all begin with the
+string
+\f\*[I-Font]ntpkey\f[]
+and include the file type, generating host and filestamp,
+as described in the
+\*[Lq]Cryptographic Data Files\*[Rq]
+section below.
+.SS Running the Program
+To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually
+\fI/usr/local/etc\f[]
+When run for the first time, or if all files with names beginning with
+\f\*[I-Font]ntpkey\f[]
+have been removed, use the
+\f\*[B-Font]ntp-keygen\fP
+command without arguments to generate a
+default RSA host key and matching RSA-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+.sp \n(Ppu
+.ne 2
+
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-T\f[]
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+.sp \n(Ppu
+.ne 2
+
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+\f\*[B-Font]\-S\f[]
+option and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+\f\*[B-Font]\-c\f[]
+option.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
+.sp \n(Ppu
+.ne 2
+
+Additional information on trusted groups and identity schemes is on the
+\*[Lq]Autokey Public-Key Authentication\*[Rq]
+page.
+.sp \n(Ppu
+.ne 2
+
+The
+\fCntpd\fR(1ntpdmdoc)\f[]
+configuration command
+\f\*[B-Font]crypto\f[] \f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+.sp \n(Ppu
+.ne 2
+
+File names begin with the prefix
+\f\*[B-Font]ntpkey_\f[]
+and end with the postfix
+\f\*[I-Font]_hostname.filestamp\f[],
+where
+\f\*[I-Font]hostname\f[]
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+\f\*[I-Font]filestamp\f[]
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+\f\*[B-Font]rm\f[] \f\*[B-Font]ntpkey\&*\f[]
+command or all files generated
+at a specific time can be removed by a
+\f\*[B-Font]rm\f[]
+\f\*[I-Font]\&*filestamp\f[]
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.sp \n(Ppu
+.ne 2
+
+All files are installed by default in the keys directory
+\fI/usr/local/etc\f[],
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.sp \n(Ppu
+.ne 2
+
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.sp \n(Ppu
+.ne 2
+
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+\fCntpd\fR(1ntpdmdoc)\f[]
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+\f\*[B-Font]ntp-keygen\fP
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.SS Running the program
+The safest way to run the
+\f\*[B-Font]ntp-keygen\fP
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+\fI/usr/local/etc\f[],
+then run the program.
+When run for the first time,
+or if all
+\f\*[B-Font]ntpkey\f[]
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.sp \n(Ppu
+.ne 2
+
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.sp \n(Ppu
+.ne 2
+
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.sp \n(Ppu
+.ne 2
+
+Running the program as other than root and using the Unix
+\f\*[B-Font]su\f[]
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+\f\*[B-Font].rnd\f[]
+in the user home directory.
+However, there should be only one
+\f\*[B-Font].rnd\f[],
+most conveniently
+in the root directory, so it is convenient to define the
+\f\*[B-Font]$RANDFILE\f[]
+environment variable used by the OpenSSL library as the path to
+\f\*[B-Font]/.rnd\f[].
+.sp \n(Ppu
+.ne 2
+
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+\fI/etc\f[]
+using the
+\f\*[B-Font]keysdir\f[]
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+.sp \n(Ppu
+.ne 2
+
+All files are installed by default in the keys directory
+\fI/usr/local/etc\f[],
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.sp \n(Ppu
+.ne 2
+
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.sp \n(Ppu
+.ne 2
+
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+\fCntpd\fR(1ntpdmdoc)\f[]
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+\f\*[B-Font]ntp-keygen\fP
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.SS Running the program
+The safest way to run the
+\f\*[B-Font]ntp-keygen\fP
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+\fI/usr/local/etc\f[],
+then run the program.
+When run for the first time,
+or if all
+\f\*[B-Font]ntpkey\f[]
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.sp \n(Ppu
+.ne 2
+
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.sp \n(Ppu
+.ne 2
+
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.sp \n(Ppu
+.ne 2
+
+Running the program as other than root and using the Unix
+\f\*[B-Font]su\f[]
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+\f\*[B-Font].rnd\f[]
+in the user home directory.
+However, there should be only one
+\f\*[B-Font].rnd\f[],
+most conveniently
+in the root directory, so it is convenient to define the
+\f\*[B-Font]$RANDFILE\f[]
+environment variable used by the OpenSSL library as the path to
+\f\*[B-Font]/.rnd\f[].
+.sp \n(Ppu
+.ne 2
+
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+\fI/etc\f[]
+using the
+\f\*[B-Font]keysdir\f[]
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+\fIAuthentication\f[] \fIOptions\f[]
+section of
+\fCntp.conf\fR(5)\f[].
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+\fIAutomatic\f[] \fINTP\f[] \fIConfiguration\f[] \fIOptions\f[]
+section of
+\fCntp.conf\fR(5)\f[].
+.sp \n(Ppu
+.ne 2
+
+On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+\f\*[B-Font]ntpkey\f[]
+files.
+Then run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-T\f[]
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+\f\*[B-Font]\-T\f[]
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+.sp \n(Ppu
+.ne 2
+
+If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-S\f[] \f\*[I-Font]type\f[]
+option, where
+\f\*[I-Font]type\f[]
+is either
+\f\*[B-Font]RSA\f[]
+or
+\f\*[B-Font]DSA\f[].
+The most often need to do this is when a DSA-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[]
+option and selected
+\f\*[I-Font]scheme\f[]
+as needed.
+f
+\f\*[B-Font]ntp-keygen\fP
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+.sp \n(Ppu
+.ne 2
+
+After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+\f\*[B-Font]ntp-keygen\fP
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+\fCntpd\fR(1ntpdmdoc)\f[]
+should be restarted.
+When
+\fCntpd\fR(1ntpdmdoc)\f[]
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+.SS Identity Schemes
+As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+"Identification Schemes"
+page
+(maybe available at
+\f[C]http://www.eecis.udel.edu/%7emills/keygen.html\f[]).
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+.sp \n(Ppu
+.ne 2
+
+In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+.sp \n(Ppu
+.ne 2
+
+The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-P\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+to generate the host key file
+\fIntpkey_RSAkey_\f[]\f\*[I-Font]alice.filestamp\f[]
+and trusted private certificate file
+\fIntpkey_RSA-MD5_cert_\f[]\f\*[I-Font]alice.filestamp\f[].
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+\fIntpkey_host_\f[]\f\*[I-Font]bob\f[]
+to the host key file and soft link
+\fIntpkey_cert_\f[]\f\*[I-Font]bob\f[]
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+.sp \n(Ppu
+.ne 2
+
+For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-T\f[]
+\f\*[B-Font]\-I\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+to produce her parameter file
+\fIntpkey_IFFpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+.sp \n(Ppu
+.ne 2
+
+If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-e\f[]
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+.sp \n(Ppu
+.ne 2
+
+For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-T\f[]
+\f\*[B-Font]\-G\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+to produce her parameter file
+\fIntpkey_GQpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+\fIntpkey_gq_\f[]\f\*[I-Font]alice\f[]
+to this file.
+In addition, on each host bob install a soft link
+from generic
+\fIntpkey_gq_\f[]\f\*[I-Font]bob\f[]
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+.sp \n(Ppu
+.ne 2
+
+For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-V\f[] \f\*[I-Font]n\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[],
+where
+\f\*[I-Font]n\f[]
+is the number of revokable keys (typically 5) to produce
+the parameter file
+\fIntpkeys_MVpar_\f[]\f\*[I-Font]trish.filestamp\f[]
+and client key files
+\fIntpkeys_MVkeyd_\f[]\f\*[I-Font]trish.filestamp\f[]
+where
+\f\*[I-Font]d\f[]
+is the key number (0 \&<
+\f\*[I-Font]d\f[]
+\&<
+\f\*[I-Font]n\f[]).
+Copy the parameter file to alice and install a soft link
+from the generic
+\fIntpkey_mv_\f[]\f\*[I-Font]alice\f[]
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+\fIntpkey_mvkey_\f[]\f\*[I-Font]bob\f[]
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+.SS Command Line Options
+.TP 7
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[]
+Select certificate message digest/signature encryption scheme.
+The
+\f\*[I-Font]scheme\f[]
+can be one of the following:
+. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+or
+\f\*[B-Font]DSA-SHA1\f[].
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+\f\*[B-Font]RSA-MD5\f[].
+.TP 7
+.NOP \f\*[B-Font]\-d\f[]
+Enable debugging.
+This option displays the cryptographic data produced in eye-friendly billboards.
+.TP 7
+.NOP \f\*[B-Font]\-e\f[]
+Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+.TP 7
+.NOP \f\*[B-Font]\-G\f[]
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-g\f[]
+Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+.TP 7
+.NOP \f\*[B-Font]\-H\f[]
+Generate new host keys, obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-I\f[]
+Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]name\f[]
+Set the suject name to
+\f\*[I-Font]name\f[].
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+.TP 7
+.NOP \f\*[B-Font]\-M\f[]
+Generate MD5 keys, obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-P\f[]
+Generate a private certificate.
+By default, the program generates public certificates.
+.TP 7
+.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+Encrypt generated files containing private data with
+\f\*[I-Font]password\f[]
+and the DES-CBC algorithm.
+.TP 7
+.NOP \f\*[B-Font]\-q\f[]
+Set the password for reading files to password.
+.TP 7
+.NOP \f\*[B-Font]\-S\f[] [\f\*[B-Font]RSA\f[] | \f\*[B-Font]DSA\f[]]
+Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+.TP 7
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]name\f[]
+Set the issuer name to
+\f\*[I-Font]name\f[].
+This is used for the issuer field in certificates
+and in the file name for identity files.
+.TP 7
+.NOP \f\*[B-Font]\-T\f[]
+Generate a trusted certificate.
+By default, the program generates a non-trusted certificate.
+.TP 7
+.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]nkeys\f[]
+Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+.PP
+.SS Random Seed File
+All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+\f\*[B-Font]ntp-keygen\fP
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+.sp \n(Ppu
+.ne 2
+
+It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+.sp \n(Ppu
+.ne 2
+
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+\f\*[B-Font].rnd\f[],
+which must be available when starting the NTP daemon
+or the
+\f\*[B-Font]ntp-keygen\fP
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+\f\*[B-Font]randfile\f[]
+subcommand of the
+\f\*[B-Font]crypto\f[]
+configuration command.
+If not specified in this way, or when starting the
+\f\*[B-Font]ntp-keygen\fP
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+RANDFILE
+environment variable in the user home directory,
+whether root or some other user.
+If the
+RANDFILE
+environment variable is not present,
+the library will look for the
+\f\*[B-Font].rnd\f[]
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+.SS Cryptographic Data Files
+All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+\f\*[B-Font]ntp-keygen\fP
+program and
+\fCntpd\fR(1ntpdmdoc)\f[]
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+.sp \n(Ppu
+.ne 2
+
+The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+.in +4
+\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
+.in -4
+where
+\f\*[I-Font]keyno\f[]
+is a positive integer in the range 1-65,535,
+\f\*[I-Font]type\f[]
+is the string MD5 defining the key format and
+\f\*[I-Font]key\f[]
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+\[oq]#\[cq]
+character.
+.sp \n(Ppu
+.ne 2
+
+Note that the keys used by the
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]ntp-keygen\fP
+program generates a MD5 symmetric keys file
+\fIntpkey_MD5key_\f[]\f\*[I-Font]hostname.filestamp\f[].
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+\fIntp.keys\f[],
+so
+\f\*[B-Font]ntp-keygen\fP
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+\fCntpq\fR(1ntpqmdoc)\f[]
+and
+\fCntpdc\fR(1ntpdcmdoc)\f[]
+utilities.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]imbits\f[], \f\*[B-Font]\-\-imbits\f[]=\f\*[I-Font]imbits\f[]
+identity modulus bits.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]imbits\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the identity modulus. The default is 256.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[], \f\*[B-Font]\-\-certificate\f[]=\f\*[I-Font]scheme\f[]
+certificate scheme.
+.sp
+scheme is one of
+RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+DSA-SHA, or DSA-SHA1.
+.sp
+Select the certificate message digest/signature encryption scheme.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key. The default without
+this option is RSA-MD5.
+.TP
+.NOP \f\*[B-Font]\-C\f[] \f\*[I-Font]cipher\f[], \f\*[B-Font]\-\-cipher\f[]=\f\*[I-Font]cipher\f[]
+privatekey cipher.
+.sp
+Select the cipher which is used to encrypt the files containing
+private keys. The default is three-key triple DES in CBC mode,
+equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+available in "\fBopenssl \-h\fP" output.
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-e\f[], \f\*[B-Font]\-\-id\-key\f[]
+Write IFF or GQ identity keys.
+.sp
+Write the IFF or GQ client keys to the standard output. This is
+intended for automatic key distribution by mail.
+.TP
+.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-gq\-params\f[]
+Generate GQ parameters and keys.
+.sp
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.TP
+.NOP \f\*[B-Font]\-H\f[], \f\*[B-Font]\-\-host\-key\f[]
+generate RSA host key.
+.sp
+Generate new host keys, obsoleting any that may exist.
+.TP
+.NOP \f\*[B-Font]\-I\f[], \f\*[B-Font]\-\-iffkey\f[]
+generate IFF parameters.
+.sp
+Generate parameters for the IFF identification scheme, obsoleting
+any that may exist.
+.TP
+.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]group\f[], \f\*[B-Font]\-\-ident\f[]=\f\*[I-Font]group\f[]
+set Autokey group name.
+.sp
+Set the optional Autokey group name to name. This is used in
+the file name of IFF, GQ, and MV client parameters files. In
+that role, the default is the host name if this option is not
+provided. The group name, if specified using \fB-i/--ident\fP or
+using \fB-s/--subject-name\fP following an '\fB@\fP' character,
+is also a part of the self-signed host certificate's subject and
+issuer names in the form \fBhost@group\fP and should match the
+'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
+\fBntpd\fP's configuration file.
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]lifetime\f[], \f\*[B-Font]\-\-lifetime\f[]=\f\*[I-Font]lifetime\f[]
+set certificate lifetime.
+This option takes an integer number as its argument.
+.sp
+Set the certificate expiration to lifetime days from now.
+.TP
+.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-md5key\f[]
+generate MD5 keys.
+.sp
+Generate MD5 keys, obsoleting any that may exist.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]modulus\f[], \f\*[B-Font]\-\-modulus\f[]=\f\*[I-Font]modulus\f[]
+modulus.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]modulus\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the prime modulus. The default is 512.
+.TP
+.NOP \f\*[B-Font]\-P\f[], \f\*[B-Font]\-\-pvt\-cert\f[]
+generate PC private certificate.
+.sp
+Generate a private certificate. By default, the program generates
+public certificates.
+.TP
+.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]passwd\f[], \f\*[B-Font]\-\-password\f[]=\f\*[I-Font]passwd\f[]
+local private password.
+.sp
+Local files containing private data are encrypted with the
+DES-CBC algorithm and the specified password. The same password
+must be specified to the local ntpd via the "crypto pw password"
+configuration command. The default password is the local
+hostname.
+.TP
+.NOP \f\*[B-Font]\-q\f[] \f\*[I-Font]passwd\f[], \f\*[B-Font]\-\-export\-passwd\f[]=\f\*[I-Font]passwd\f[]
+export IFF or GQ group keys with password.
+.sp
+Export IFF or GQ identity group keys to the standard output,
+encrypted with the DES-CBC algorithm and the specified password.
+The same password must be specified to the remote ntpd via the
+"crypto pw password" configuration command. See also the option
+--id-key (-e) for unencrypted exports.
+.TP
+.NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]sign\f[], \f\*[B-Font]\-\-sign\-key\f[]=\f\*[I-Font]sign\f[]
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]host@group\f[], \f\*[B-Font]\-\-subject\-name\f[]=\f\*[I-Font]host@group\f[]
+set host and optionally group name.
+.sp
+Set the Autokey host name, and optionally, group name specified
+following an '\fB@\fP' character. The host name is used in the file
+name of generated host and signing certificates, without the
+group name. The host name, and if provided, group name are used
+in \fBhost@group\fP form for the host certificate's subject and issuer
+fields. Specifying '\fB-s @group\fP' is allowed, and results in
+leaving the host name unchanged while appending \fB@group\fP to the
+subject and issuer fields, as with \fB-i group\fP. The group name, or
+if not provided, the host name are also used in the file names
+of IFF, GQ, and MV client parameter files.
+.TP
+.NOP \f\*[B-Font]\-T\f[], \f\*[B-Font]\-\-trusted\-cert\f[]
+trusted certificate (TC scheme).
+.sp
+Generate a trusted certificate. By default, the program generates
+a non-trusted certificate.
+.TP
+.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]num\f[], \f\*[B-Font]\-\-mv\-params\f[]=\f\*[I-Font]num\f[]
+generate <num> MV parameters.
+This option takes an integer number as its argument.
+.sp
+Generate parameters and keys for the Mu-Varadharajan (MV)
+identification scheme.
+.TP
+.NOP \f\*[B-Font]\-v\f[] \f\*[I-Font]num\f[], \f\*[B-Font]\-\-mv\-keys\f[]=\f\*[I-Font]num\f[]
+update <num> MV keys.
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTP_KEYGEN_<option-name>\fP or \fBNTP_KEYGEN\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+The
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+option specifies the write password and
+\f\*[B-Font]\-q\f[] \f\*[I-Font]password\f[]
+option the read password for previously encrypted files.
+The
+\f\*[B-Font]ntp-keygen\fP
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+It can take quite a while to generate some cryptographic values,
+from one to several minutes with modern architectures
+such as UltraSPARC and up to tens of minutes to an hour
+with older architectures such as SPARC IPC.
+.sp \n(Ppu
+.ne 2
+
+Please report bugs to http://bugs.ntp.org .
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+Portions of this document came from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp-keygen\fP
+option definitions.
diff --git a/util/ntp-keygen.1ntp-keygenmdoc b/util/ntp-keygen.1ntp-keygenmdoc
new file mode 100644
index 0000000..9b3dabb
--- /dev/null
+++ b/util/ntp-keygen.1ntp-keygenmdoc
@@ -0,0 +1,1071 @@
+.Dd December 2 2014
+.Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:51 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-keygen-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp-keygen
+.Nd Create a NTP host key
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+.Pp
+All files are in PEM\-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+.Pp
+When used to generate message digest keys, the program produces a file
+containing ten pseudo\-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the OpenSSL library is installed, it produces an additional ten
+hex\-encoded random bit strings suitable for the SHA1 and other message
+digest algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys used for ordinary NTP associations, additional keys
+can be defined as passwords for the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utility programs.
+.Pp
+The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys are probably not compatible with anything
+other than Autokey.
+.Pp
+Some files used by this program are encrypted using a private password.
+The
+.Fl p
+option specifies the password for local encrypted files and the
+.Fl q
+option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+.Fn gethostname
+function, normally the DNS name of the host is used.
+.Pp
+The
+.Ar pw
+option of the
+.Ar crypto
+configuration command specifies the read
+password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by
+.Ar ntpd
+without password but only on the same host.
+.Pp
+Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called
+.Ar ntp.keys ,
+is usually installed in
+.Pa /etc .
+Other files and links are usually installed in
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem in
+NFS\-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the
+.Ar keysdir
+configuration command in such cases.
+Normally, this is in
+.Pa /etc .
+.Pp
+This program directs commentary and error messages to the standard
+error stream
+.Ar stderr
+and remote files to the standard output stream
+.Ar stdout
+where they can be piped to other applications or redirected to files.
+The names used for generated files and links all begin with the
+string
+.Ar ntpkey
+and include the file type, generating host and filestamp,
+as described in the
+.Dq Cryptographic Data Files
+section below.
+.Ss Running the Program
+To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually
+.Pa /usr/local/etc
+When run for the first time, or if all files with names beginning with
+.Ar ntpkey
+have been removed, use the
+.Nm
+command without arguments to generate a
+default RSA host key and matching RSA\-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+.Pp
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+.Nm
+with the
+.Fl T
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+.Pp
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+.Fl S
+option and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+.Fl c
+option.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken\-and\-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball\-and\-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re\-generated.
+.Pp
+Additional information on trusted groups and identity schemes is on the
+.Dq Autokey Public\-Key Authentication
+page.
+.Pp
+The
+.Xr ntpd 1ntpdmdoc
+configuration command
+.Ic crypto pw Ar password
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+.Pp
+File names begin with the prefix
+.Cm ntpkey_
+and end with the postfix
+.Ar _hostname.filestamp ,
+where
+.Ar hostname
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+.Ar filestamp
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+.Ic rm ntpkey\&*
+command or all files generated
+at a specific time can be removed by a
+.Ic rm
+.Ar \&*filestamp
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.Pp
+All files are installed by default in the keys directory
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem
+in NFS\-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.Pp
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write\-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.Pp
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+.Xr ntpd 1ntpdmdoc
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+.Nm
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.Ss Running the program
+The safest way to run the
+.Nm
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+.Pa /usr/local/etc ,
+then run the program.
+When run for the first time,
+or if all
+.Cm ntpkey
+files have been removed,
+the program generates a RSA host key file and matching RSA\-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.Pp
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.Pp
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.Pp
+Running the program as other than root and using the Unix
+.Ic su
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+.Cm .rnd
+in the user home directory.
+However, there should be only one
+.Cm .rnd ,
+most conveniently
+in the root directory, so it is convenient to define the
+.Cm $RANDFILE
+environment variable used by the OpenSSL library as the path to
+.Cm /.rnd .
+.Pp
+Installing the keys as root might not work in NFS\-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.Pp
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+.Pp
+All files are installed by default in the keys directory
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem
+in NFS\-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.Pp
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write\-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.Pp
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+.Xr ntpd 1ntpdmdoc
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+.Nm
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.Ss Running the program
+The safest way to run the
+.Nm
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+.Pa /usr/local/etc ,
+then run the program.
+When run for the first time,
+or if all
+.Cm ntpkey
+files have been removed,
+the program generates a RSA host key file and matching RSA\-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.Pp
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.Pp
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.Pp
+Running the program as other than root and using the Unix
+.Ic su
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+.Cm .rnd
+in the user home directory.
+However, there should be only one
+.Cm .rnd ,
+most conveniently
+in the root directory, so it is convenient to define the
+.Cm $RANDFILE
+environment variable used by the OpenSSL library as the path to
+.Cm /.rnd .
+.Pp
+Installing the keys as root might not work in NFS\-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.Pp
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+.Sx Authentication Options
+section of
+.Xr ntp.conf 5 .
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low\-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+.Sx Automatic NTP Configuration Options
+section of
+.Xr ntp.conf 5 .
+.Pp
+On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+.Cm ntpkey
+files.
+Then run
+.Nm
+.Fl T
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+.Fl T
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+.Pp
+If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+.Nm
+with the
+.Fl S Ar type
+option, where
+.Ar type
+is either
+.Cm RSA
+or
+.Cm DSA .
+The most often need to do this is when a DSA\-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+.Nm
+with the
+.Fl c Ar scheme
+option and selected
+.Ar scheme
+as needed.
+f
+.Nm
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+.Pp
+After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+.Nm
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+.Xr ntpd 1ntpdmdoc
+should be restarted.
+When
+.Xr ntpd 1ntpdmdoc
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+.Ss Identity Schemes
+As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+.Qq Identification Schemes
+page
+(maybe available at
+.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+.Pp
+In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+.Pp
+The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+.Nm
+.Fl P
+.Fl p Ar password
+to generate the host key file
+.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
+and trusted private certificate file
+.Pa ntpkey_RSA\-MD5_cert_ Ns Ar alice.filestamp .
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+.Pa ntpkey_host_ Ns Ar bob
+to the host key file and soft link
+.Pa ntpkey_cert_ Ns Ar bob
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+.Pp
+For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+.Nm
+.Fl T
+.Fl I
+.Fl p Ar password
+to produce her parameter file
+.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+.Pa ntpkey_iff_ Ns Ar alice
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+.Pp
+If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+.Nm
+.Fl e
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+.Pa ntpkey_iff_ Ns Ar alice
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+.Pp
+For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+.Nm
+.Fl T
+.Fl G
+.Fl p Ar password
+to produce her parameter file
+.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+.Pa ntpkey_gq_ Ns Ar alice
+to this file.
+In addition, on each host bob install a soft link
+from generic
+.Pa ntpkey_gq_ Ns Ar bob
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+.Pp
+For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+.Nm
+.Fl V Ar n
+.Fl p Ar password ,
+where
+.Ar n
+is the number of revokable keys (typically 5) to produce
+the parameter file
+.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
+and client key files
+.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
+where
+.Ar d
+is the key number (0 \&<
+.Ar d
+\&<
+.Ar n ) .
+Copy the parameter file to alice and install a soft link
+from the generic
+.Pa ntpkey_mv_ Ns Ar alice
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+.Pa ntpkey_mvkey_ Ns Ar bob
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+.Ss Command Line Options
+.Bl -tag -width indent
+.It Fl c Ar scheme
+Select certificate message digest/signature encryption scheme.
+The
+.Ar scheme
+can be one of the following:
+. Cm RSA\-MD2 , RSA\-MD5 , RSA\-SHA , RSA\-SHA1 , RSA\-MDC2 , RSA\-RIPEMD160 , DSA\-SHA ,
+or
+.Cm DSA\-SHA1 .
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+.Cm RSA\-MD5 .
+.It Fl d
+Enable debugging.
+This option displays the cryptographic data produced in eye\-friendly billboards.
+.It Fl e
+Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+.It Fl G
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.It Fl g
+Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+.It Fl H
+Generate new host keys, obsoleting any that may exist.
+.It Fl I
+Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+.It Fl i Ar name
+Set the suject name to
+.Ar name .
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+.It Fl M
+Generate MD5 keys, obsoleting any that may exist.
+.It Fl P
+Generate a private certificate.
+By default, the program generates public certificates.
+.It Fl p Ar password
+Encrypt generated files containing private data with
+.Ar password
+and the DES\-CBC algorithm.
+.It Fl q
+Set the password for reading files to password.
+.It Fl S Oo Cm RSA | DSA Oc
+Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+.It Fl s Ar name
+Set the issuer name to
+.Ar name .
+This is used for the issuer field in certificates
+and in the file name for identity files.
+.It Fl T
+Generate a trusted certificate.
+By default, the program generates a non\-trusted certificate.
+.It Fl V Ar nkeys
+Generate parameters and keys for the Mu\-Varadharajan (MV) identification scheme.
+.El
+.Ss Random Seed File
+All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo\-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+.Nm
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+.Pp
+It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built\-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+.Pp
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+.Cm .rnd ,
+which must be available when starting the NTP daemon
+or the
+.Nm
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+.Ic randfile
+subcommand of the
+.Ic crypto
+configuration command.
+If not specified in this way, or when starting the
+.Nm
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+.Ev RANDFILE
+environment variable in the user home directory,
+whether root or some other user.
+If the
+.Ev RANDFILE
+environment variable is not present,
+the library will look for the
+.Cm .rnd
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+.Ss Cryptographic Data Files
+All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+.Nm
+program and
+.Xr ntpd 1ntpdmdoc
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM\-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+.Pp
+The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES\-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+.D1 Ar keyno type key
+where
+.Ar keyno
+is a positive integer in the range 1\-65,535,
+.Ar type
+is the string MD5 defining the key format and
+.Ar key
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+.Ql #
+character.
+.Pp
+Note that the keys used by the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+.Pp
+The
+.Nm
+program generates a MD5 symmetric keys file
+.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+.Pa ntp.keys ,
+so
+.Nm
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+.Xr ntpq 1ntpqmdoc
+and
+.Xr ntpdc 1ntpdcmdoc
+utilities.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl b Ar imbits , Fl \-imbits Ns = Ns Ar imbits
+identity modulus bits.
+This option takes an integer number as its argument.
+The value of
+.Ar imbits
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the identity modulus. The default is 256.
+.It Fl c Ar scheme , Fl \-certificate Ns = Ns Ar scheme
+certificate scheme.
+.sp
+scheme is one of
+RSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160,
+DSA\-SHA, or DSA\-SHA1.
+.sp
+Select the certificate message digest/signature encryption scheme.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key. The default without
+this option is RSA\-MD5.
+.It Fl C Ar cipher , Fl \-cipher Ns = Ns Ar cipher
+privatekey cipher.
+.sp
+Select the cipher which is used to encrypt the files containing
+private keys. The default is three\-key triple DES in CBC mode,
+equivalent to "@code{\-C des\-ede3\-cbc". The openssl tool lists ciphers
+available in "\fBopenssl \-h\fP" output.
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl e , Fl \-id\-key
+Write IFF or GQ identity keys.
+.sp
+Write the IFF or GQ client keys to the standard output. This is
+intended for automatic key distribution by mail.
+.It Fl G , Fl \-gq\-params
+Generate GQ parameters and keys.
+.sp
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.It Fl H , Fl \-host\-key
+generate RSA host key.
+.sp
+Generate new host keys, obsoleting any that may exist.
+.It Fl I , Fl \-iffkey
+generate IFF parameters.
+.sp
+Generate parameters for the IFF identification scheme, obsoleting
+any that may exist.
+.It Fl i Ar group , Fl \-ident Ns = Ns Ar group
+set Autokey group name.
+.sp
+Set the optional Autokey group name to name. This is used in
+the file name of IFF, GQ, and MV client parameters files. In
+that role, the default is the host name if this option is not
+provided. The group name, if specified using \fB\-i/\-\-ident\fP or
+using \fB\-s/\-\-subject\-name\fP following an '\fB@\fP' character,
+is also a part of the self\-signed host certificate's subject and
+issuer names in the form \fBhost@group\fP and should match the
+\'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
+\fBntpd\fP's configuration file.
+.It Fl l Ar lifetime , Fl \-lifetime Ns = Ns Ar lifetime
+set certificate lifetime.
+This option takes an integer number as its argument.
+.sp
+Set the certificate expiration to lifetime days from now.
+.It Fl M , Fl \-md5key
+generate MD5 keys.
+.sp
+Generate MD5 keys, obsoleting any that may exist.
+.It Fl m Ar modulus , Fl \-modulus Ns = Ns Ar modulus
+modulus.
+This option takes an integer number as its argument.
+The value of
+.Ar modulus
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the prime modulus. The default is 512.
+.It Fl P , Fl \-pvt\-cert
+generate PC private certificate.
+.sp
+Generate a private certificate. By default, the program generates
+public certificates.
+.It Fl p Ar passwd , Fl \-password Ns = Ns Ar passwd
+local private password.
+.sp
+Local files containing private data are encrypted with the
+DES\-CBC algorithm and the specified password. The same password
+must be specified to the local ntpd via the "crypto pw password"
+configuration command. The default password is the local
+hostname.
+.It Fl q Ar passwd , Fl \-export\-passwd Ns = Ns Ar passwd
+export IFF or GQ group keys with password.
+.sp
+Export IFF or GQ identity group keys to the standard output,
+encrypted with the DES\-CBC algorithm and the specified password.
+The same password must be specified to the remote ntpd via the
+"crypto pw password" configuration command. See also the option
+-\-id\-key (\-e) for unencrypted exports.
+.It Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+.It Fl s Ar host@group , Fl \-subject\-name Ns = Ns Ar host@group
+set host and optionally group name.
+.sp
+Set the Autokey host name, and optionally, group name specified
+following an '\fB@\fP' character. The host name is used in the file
+name of generated host and signing certificates, without the
+group name. The host name, and if provided, group name are used
+in \fBhost@group\fP form for the host certificate's subject and issuer
+fields. Specifying '\fB\-s @group\fP' is allowed, and results in
+leaving the host name unchanged while appending \fB@group\fP to the
+subject and issuer fields, as with \fB\-i group\fP. The group name, or
+if not provided, the host name are also used in the file names
+of IFF, GQ, and MV client parameter files.
+.It Fl T , Fl \-trusted\-cert
+trusted certificate (TC scheme).
+.sp
+Generate a trusted certificate. By default, the program generates
+a non\-trusted certificate.
+.It Fl V Ar num , Fl \-mv\-params Ns = Ns Ar num
+generate <num> MV parameters.
+This option takes an integer number as its argument.
+.sp
+Generate parameters and keys for the Mu\-Varadharajan (MV)
+identification scheme.
+.It Fl v Ar num , Fl \-mv\-keys Ns = Ns Ar num
+update <num> MV keys.
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTP_KEYGEN_<option\-name>\fP or \fBNTP_KEYGEN\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+The
+.Fl p Ar password
+option specifies the write password and
+.Fl q Ar password
+option the read password for previously encrypted files.
+The
+.Nm
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+It can take quite a while to generate some cryptographic values,
+from one to several minutes with modern architectures
+such as UltraSPARC and up to tens of minutes to an hour
+with older architectures such as SPARC IPC.
+.Pp
+Please report bugs to http://bugs.ntp.org .
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+Portions of this document came from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp\-keygen\fP
+option definitions.
diff --git a/util/ntp-keygen.c b/util/ntp-keygen.c
new file mode 100644
index 0000000..d55a357
--- /dev/null
+++ b/util/ntp-keygen.c
@@ -0,0 +1,2181 @@
+/*
+ * Program to generate cryptographic keys for ntp clients and servers
+ *
+ * This program generates password encrypted data files for use with the
+ * Autokey security protocol and Network Time Protocol Version 4. Files
+ * are prefixed with a header giving the name and date of creation
+ * followed by a type-specific descriptive label and PEM-encoded data
+ * structure compatible with programs of the OpenSSL library.
+ *
+ * All file names are like "ntpkey_<type>_<hostname>.<filestamp>", where
+ * <type> is the file type, <hostname> the generating host name and
+ * <filestamp> the generation time in NTP seconds. The NTP programs
+ * expect generic names such as "ntpkey_<type>_whimsy.udel.edu" with the
+ * association maintained by soft links. Following is a list of file
+ * types; the first line is the file name and the second link name.
+ *
+ * ntpkey_MD5key_<hostname>.<filestamp>
+ * MD5 (128-bit) keys used to compute message digests in symmetric
+ * key cryptography
+ *
+ * ntpkey_RSAhost_<hostname>.<filestamp>
+ * ntpkey_host_<hostname>
+ * RSA private/public host key pair used for public key signatures
+ *
+ * ntpkey_RSAsign_<hostname>.<filestamp>
+ * ntpkey_sign_<hostname>
+ * RSA private/public sign key pair used for public key signatures
+ *
+ * ntpkey_DSAsign_<hostname>.<filestamp>
+ * ntpkey_sign_<hostname>
+ * DSA Private/public sign key pair used for public key signatures
+ *
+ * Available digest/signature schemes
+ *
+ * RSA: RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, EVP-RIPEMD160
+ * DSA: DSA-SHA, DSA-SHA1
+ *
+ * ntpkey_XXXcert_<hostname>.<filestamp>
+ * ntpkey_cert_<hostname>
+ * X509v3 certificate using RSA or DSA public keys and signatures.
+ * XXX is a code identifying the message digest and signature
+ * encryption algorithm
+ *
+ * Identity schemes. The key type par is used for the challenge; the key
+ * type key is used for the response.
+ *
+ * ntpkey_IFFkey_<groupname>.<filestamp>
+ * ntpkey_iffkey_<groupname>
+ * Schnorr (IFF) identity parameters and keys
+ *
+ * ntpkey_GQkey_<groupname>.<filestamp>,
+ * ntpkey_gqkey_<groupname>
+ * Guillou-Quisquater (GQ) identity parameters and keys
+ *
+ * ntpkey_MVkeyX_<groupname>.<filestamp>,
+ * ntpkey_mvkey_<groupname>
+ * Mu-Varadharajan (MV) identity parameters and keys
+ *
+ * Note: Once in a while because of some statistical fluke this program
+ * fails to generate and verify some cryptographic data, as indicated by
+ * exit status -1. In this case simply run the program again. If the
+ * program does complete with exit code 0, the data are correct as
+ * verified.
+ *
+ * These cryptographic routines are characterized by the prime modulus
+ * size in bits. The default value of 512 bits is a compromise between
+ * cryptographic strength and computing time and is ordinarily
+ * considered adequate for this application. The routines have been
+ * tested with sizes of 256, 512, 1024 and 2048 bits. Not all message
+ * digest and signature encryption schemes work with sizes less than 512
+ * bits. The computing time for sizes greater than 2048 bits is
+ * prohibitive on all but the fastest processors. An UltraSPARC Blade
+ * 1000 took something over nine minutes to generate and verify the
+ * values with size 2048. An old SPARC IPC would take a week.
+ *
+ * The OpenSSL library used by this program expects a random seed file.
+ * As described in the OpenSSL documentation, the file name defaults to
+ * first the RANDFILE environment variable in the user's home directory
+ * and then .rnd in the user's home directory.
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
+#include "ntp.h"
+#include "ntp_random.h"
+#include "ntp_stdlib.h"
+#include "ntp_assert.h"
+#include "ntp_libopts.h"
+#include "ntp_unixtime.h"
+#include "ntp-keygen-opts.h"
+
+#ifdef OPENSSL
+#include "openssl/bn.h"
+#include "openssl/evp.h"
+#include "openssl/err.h"
+#include "openssl/rand.h"
+#include "openssl/pem.h"
+#include "openssl/x509v3.h"
+#include <openssl/objects.h>
+#endif /* OPENSSL */
+#include <ssl_applink.c>
+
+/*
+ * Cryptodefines
+ */
+#define MD5KEYS 10 /* number of keys generated of each type */
+#define MD5SIZE 20 /* maximum key size */
+#ifdef AUTOKEY
+#define PLEN 512 /* default prime modulus size (bits) */
+#define ILEN 256 /* default identity modulus size (bits) */
+#define MVMAX 100 /* max MV parameters */
+
+/*
+ * Strings used in X509v3 extension fields
+ */
+#define KEY_USAGE "digitalSignature,keyCertSign"
+#define BASIC_CONSTRAINTS "critical,CA:TRUE"
+#define EXT_KEY_PRIVATE "private"
+#define EXT_KEY_TRUST "trustRoot"
+#endif /* AUTOKEY */
+
+/*
+ * Prototypes
+ */
+FILE *fheader (const char *, const char *, const char *);
+int gen_md5 (char *);
+void followlink (char *, size_t);
+#ifdef AUTOKEY
+EVP_PKEY *gen_rsa (char *);
+EVP_PKEY *gen_dsa (char *);
+EVP_PKEY *gen_iffkey (char *);
+EVP_PKEY *gen_gqkey (char *);
+EVP_PKEY *gen_mvkey (char *, EVP_PKEY **);
+void gen_mvserv (char *, EVP_PKEY **);
+int x509 (EVP_PKEY *, const EVP_MD *, char *, char *,
+ char *);
+void cb (int, int, void *);
+EVP_PKEY *genkey (char *, char *);
+EVP_PKEY *readkey (char *, char *, u_int *, EVP_PKEY **);
+void writekey (char *, char *, u_int *, EVP_PKEY **);
+u_long asn2ntp (ASN1_TIME *);
+#endif /* AUTOKEY */
+
+/*
+ * Program variables
+ */
+extern char *optarg; /* command line argument */
+char *progname;
+u_int lifetime = DAYSPERYEAR; /* certificate lifetime (days) */
+int nkeys; /* MV keys */
+time_t epoch; /* Unix epoch (seconds) since 1970 */
+u_int fstamp; /* NTP filestamp */
+char hostbuf[MAXHOSTNAME + 1];
+char *hostname = NULL; /* host, used in cert filenames */
+char *groupname = NULL; /* group name */
+char certnamebuf[2 * sizeof(hostbuf)];
+char *certname = NULL; /* certificate subject/issuer name */
+char *passwd1 = NULL; /* input private key password */
+char *passwd2 = NULL; /* output private key password */
+char filename[MAXFILENAME + 1]; /* file name */
+#ifdef AUTOKEY
+u_int modulus = PLEN; /* prime modulus size (bits) */
+u_int modulus2 = ILEN; /* identity modulus size (bits) */
+long d0, d1, d2, d3; /* callback counters */
+const EVP_CIPHER * cipher = NULL;
+#endif /* AUTOKEY */
+
+#ifdef SYS_WINNT
+BOOL init_randfile();
+
+/*
+ * Don't try to follow symbolic links on Windows. Assume link == file.
+ */
+int
+readlink(
+ char * link,
+ char * file,
+ int len
+ )
+{
+ return strlen(file);
+}
+
+/*
+ * Don't try to create symbolic links on Windows, that is supported on
+ * Vista and later only. Instead, if CreateHardLink is available (XP
+ * and later), hardlink the linkname to the original filename. On
+ * earlier systems, user must rename file to match expected link for
+ * ntpd to find it. To allow building a ntp-keygen.exe which loads on
+ * Windows pre-XP, runtime link to CreateHardLinkA().
+ */
+int
+symlink(
+ char * filename,
+ char* linkname
+ )
+{
+ typedef BOOL (WINAPI *PCREATEHARDLINKA)(
+ __in LPCSTR lpFileName,
+ __in LPCSTR lpExistingFileName,
+ __reserved LPSECURITY_ATTRIBUTES lpSA
+ );
+ static PCREATEHARDLINKA pCreateHardLinkA;
+ static int tried;
+ HMODULE hDll;
+ FARPROC pfn;
+ int link_created;
+ int saved_errno;
+
+ if (!tried) {
+ tried = TRUE;
+ hDll = LoadLibrary("kernel32");
+ pfn = GetProcAddress(hDll, "CreateHardLinkA");
+ pCreateHardLinkA = (PCREATEHARDLINKA)pfn;
+ }
+
+ if (NULL == pCreateHardLinkA) {
+ errno = ENOSYS;
+ return -1;
+ }
+
+ link_created = (*pCreateHardLinkA)(linkname, filename, NULL);
+
+ if (link_created)
+ return 0;
+
+ saved_errno = GetLastError(); /* yes we play loose */
+ mfprintf(stderr, "Create hard link %s to %s failed: %m\n",
+ linkname, filename);
+ errno = saved_errno;
+ return -1;
+}
+
+void
+InitWin32Sockets() {
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ wVersionRequested = MAKEWORD(2,0);
+ if (WSAStartup(wVersionRequested, &wsaData))
+ {
+ fprintf(stderr, "No useable winsock.dll\n");
+ exit(1);
+ }
+}
+#endif /* SYS_WINNT */
+
+
+/*
+ * followlink() - replace filename with its target if symlink.
+ *
+ * Some readlink() implementations do not null-terminate the result.
+ */
+void
+followlink(
+ char * fname,
+ size_t bufsiz
+ )
+{
+ int len;
+
+ REQUIRE(bufsiz > 0);
+
+ len = readlink(fname, fname, (int)bufsiz);
+ if (len < 0 ) {
+ fname[0] = '\0';
+ return;
+ }
+ if (len > (int)bufsiz - 1)
+ len = (int)bufsiz - 1;
+ fname[len] = '\0';
+}
+
+
+/*
+ * Main program
+ */
+int
+main(
+ int argc, /* command line options */
+ char **argv
+ )
+{
+ struct timeval tv; /* initialization vector */
+ int md5key = 0; /* generate MD5 keys */
+ int optct; /* option count */
+#ifdef AUTOKEY
+ X509 *cert = NULL; /* X509 certificate */
+ X509_EXTENSION *ext; /* X509v3 extension */
+ EVP_PKEY *pkey_host = NULL; /* host key */
+ EVP_PKEY *pkey_sign = NULL; /* sign key */
+ EVP_PKEY *pkey_iffkey = NULL; /* IFF sever keys */
+ EVP_PKEY *pkey_gqkey = NULL; /* GQ server keys */
+ EVP_PKEY *pkey_mvkey = NULL; /* MV trusted agen keys */
+ EVP_PKEY *pkey_mvpar[MVMAX]; /* MV cleient keys */
+ int hostkey = 0; /* generate RSA keys */
+ int iffkey = 0; /* generate IFF keys */
+ int gqkey = 0; /* generate GQ keys */
+ int mvkey = 0; /* update MV keys */
+ int mvpar = 0; /* generate MV parameters */
+ char *sign = NULL; /* sign key */
+ EVP_PKEY *pkey = NULL; /* temp key */
+ const EVP_MD *ectx; /* EVP digest */
+ char pathbuf[MAXFILENAME + 1];
+ const char *scheme = NULL; /* digest/signature scheme */
+ const char *ciphername = NULL; /* to encrypt priv. key */
+ char *exten = NULL; /* private extension */
+ char *grpkey = NULL; /* identity extension */
+ int nid; /* X509 digest/signature scheme */
+ FILE *fstr = NULL; /* file handle */
+ char groupbuf[MAXHOSTNAME + 1];
+ u_int temp;
+ BIO * bp;
+ int i, cnt;
+ char * ptr;
+#endif /* AUTOKEY */
+
+ progname = argv[0];
+
+#ifdef SYS_WINNT
+ /* Initialize before OpenSSL checks */
+ InitWin32Sockets();
+ if (!init_randfile())
+ fprintf(stderr, "Unable to initialize .rnd file\n");
+ ssl_applink();
+#endif
+
+#ifdef OPENSSL
+ ssl_check_version();
+#endif /* OPENSSL */
+
+ /*
+ * Process options, initialize host name and timestamp.
+ * gethostname() won't null-terminate if hostname is exactly the
+ * length provided for the buffer.
+ */
+ gethostname(hostbuf, sizeof(hostbuf) - 1);
+ hostbuf[COUNTOF(hostbuf) - 1] = '\0';
+ hostname = hostbuf;
+ groupname = hostbuf;
+ passwd1 = hostbuf;
+ passwd2 = NULL;
+ GETTIMEOFDAY(&tv, NULL);
+ ntp_srandom((u_long)(tv.tv_sec + tv.tv_usec));
+ epoch = tv.tv_sec;
+ fstamp = (u_int)(epoch + JAN_1970);
+
+ optct = ntpOptionProcess(&ntp_keygenOptions, argc, argv);
+ argc -= optct;
+ argv += optct;
+
+#ifdef OPENSSL
+ if (SSLeay() == SSLEAY_VERSION_NUMBER)
+ fprintf(stderr, "Using OpenSSL version %s\n",
+ SSLeay_version(SSLEAY_VERSION));
+ else
+ fprintf(stderr, "Built against OpenSSL %s, using version %s\n",
+ OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
+#endif /* OPENSSL */
+
+ debug = OPT_VALUE_SET_DEBUG_LEVEL;
+
+ if (HAVE_OPT( MD5KEY ))
+ md5key++;
+#ifdef AUTOKEY
+ if (HAVE_OPT( PASSWORD ))
+ passwd1 = estrdup(OPT_ARG( PASSWORD ));
+
+ if (HAVE_OPT( EXPORT_PASSWD ))
+ passwd2 = estrdup(OPT_ARG( EXPORT_PASSWD ));
+
+ if (HAVE_OPT( HOST_KEY ))
+ hostkey++;
+
+ if (HAVE_OPT( SIGN_KEY ))
+ sign = estrdup(OPT_ARG( SIGN_KEY ));
+
+ if (HAVE_OPT( GQ_PARAMS ))
+ gqkey++;
+
+ if (HAVE_OPT( IFFKEY ))
+ iffkey++;
+
+ if (HAVE_OPT( MV_PARAMS )) {
+ mvkey++;
+ nkeys = OPT_VALUE_MV_PARAMS;
+ }
+ if (HAVE_OPT( MV_KEYS )) {
+ mvpar++;
+ nkeys = OPT_VALUE_MV_KEYS;
+ }
+
+ if (HAVE_OPT( IMBITS ))
+ modulus2 = OPT_VALUE_IMBITS;
+
+ if (HAVE_OPT( MODULUS ))
+ modulus = OPT_VALUE_MODULUS;
+
+ if (HAVE_OPT( CERTIFICATE ))
+ scheme = OPT_ARG( CERTIFICATE );
+
+ if (HAVE_OPT( CIPHER ))
+ ciphername = OPT_ARG( CIPHER );
+
+ if (HAVE_OPT( SUBJECT_NAME ))
+ hostname = estrdup(OPT_ARG( SUBJECT_NAME ));
+
+ if (HAVE_OPT( IDENT ))
+ groupname = estrdup(OPT_ARG( IDENT ));
+
+ if (HAVE_OPT( LIFETIME ))
+ lifetime = OPT_VALUE_LIFETIME;
+
+ if (HAVE_OPT( PVT_CERT ))
+ exten = EXT_KEY_PRIVATE;
+
+ if (HAVE_OPT( TRUSTED_CERT ))
+ exten = EXT_KEY_TRUST;
+
+ /*
+ * Remove the group name from the hostname variable used
+ * in host and sign certificate file names.
+ */
+ if (hostname != hostbuf)
+ ptr = strchr(hostname, '@');
+ else
+ ptr = NULL;
+ if (ptr != NULL) {
+ *ptr = '\0';
+ groupname = estrdup(ptr + 1);
+ /* -s @group is equivalent to -i group, host unch. */
+ if (ptr == hostname)
+ hostname = hostbuf;
+ }
+
+ /*
+ * Derive host certificate issuer/subject names from host name
+ * and optional group. If no groupname is provided, the issuer
+ * and subject is the hostname with no '@group', and the
+ * groupname variable is pointed to hostname for use in IFF, GQ,
+ * and MV parameters file names.
+ */
+ if (groupname == hostbuf) {
+ certname = hostname;
+ } else {
+ snprintf(certnamebuf, sizeof(certnamebuf), "%s@%s",
+ hostname, groupname);
+ certname = certnamebuf;
+ }
+
+ /*
+ * Seed random number generator and grow weeds.
+ */
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+ if (!RAND_status()) {
+ if (RAND_file_name(pathbuf, sizeof(pathbuf)) == NULL) {
+ fprintf(stderr, "RAND_file_name %s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ exit (-1);
+ }
+ temp = RAND_load_file(pathbuf, -1);
+ if (temp == 0) {
+ fprintf(stderr,
+ "RAND_load_file %s not found or empty\n",
+ pathbuf);
+ exit (-1);
+ }
+ fprintf(stderr,
+ "Random seed file %s %u bytes\n", pathbuf, temp);
+ RAND_add(&epoch, sizeof(epoch), 4.0);
+ }
+#endif /* AUTOKEY */
+
+ /*
+ * Create new unencrypted MD5 keys file if requested. If this
+ * option is selected, ignore all other options.
+ */
+ if (md5key) {
+ gen_md5("md5");
+ exit (0);
+ }
+
+#ifdef AUTOKEY
+ /*
+ * Load previous certificate if available.
+ */
+ snprintf(filename, sizeof(filename), "ntpkey_cert_%s", hostname);
+ if ((fstr = fopen(filename, "r")) != NULL) {
+ cert = PEM_read_X509(fstr, NULL, NULL, NULL);
+ fclose(fstr);
+ }
+ if (cert != NULL) {
+
+ /*
+ * Extract subject name.
+ */
+ X509_NAME_oneline(X509_get_subject_name(cert), groupbuf,
+ MAXFILENAME);
+
+ /*
+ * Extract digest/signature scheme.
+ */
+ if (scheme == NULL) {
+ nid = OBJ_obj2nid(cert->cert_info->
+ signature->algorithm);
+ scheme = OBJ_nid2sn(nid);
+ }
+
+ /*
+ * If a key_usage extension field is present, determine
+ * whether this is a trusted or private certificate.
+ */
+ if (exten == NULL) {
+ ptr = strstr(groupbuf, "CN=");
+ cnt = X509_get_ext_count(cert);
+ for (i = 0; i < cnt; i++) {
+ ext = X509_get_ext(cert, i);
+ if (OBJ_obj2nid(ext->object) ==
+ NID_ext_key_usage) {
+ bp = BIO_new(BIO_s_mem());
+ X509V3_EXT_print(bp, ext, 0, 0);
+ BIO_gets(bp, pathbuf,
+ MAXFILENAME);
+ BIO_free(bp);
+ if (strcmp(pathbuf,
+ "Trust Root") == 0)
+ exten = EXT_KEY_TRUST;
+ else if (strcmp(pathbuf,
+ "Private") == 0)
+ exten = EXT_KEY_PRIVATE;
+ certname = estrdup(ptr + 3);
+ }
+ }
+ }
+ }
+ if (scheme == NULL)
+ scheme = "RSA-MD5";
+ if (ciphername == NULL)
+ ciphername = "des-ede3-cbc";
+ cipher = EVP_get_cipherbyname(ciphername);
+ if (cipher == NULL) {
+ fprintf(stderr, "Unknown cipher %s\n", ciphername);
+ exit(-1);
+ }
+ fprintf(stderr, "Using host %s group %s\n", hostname,
+ groupname);
+
+ /*
+ * Create a new encrypted RSA host key file if requested;
+ * otherwise, look for an existing host key file. If not found,
+ * create a new encrypted RSA host key file. If that fails, go
+ * no further.
+ */
+ if (hostkey)
+ pkey_host = genkey("RSA", "host");
+ if (pkey_host == NULL) {
+ snprintf(filename, sizeof(filename), "ntpkey_host_%s", hostname);
+ pkey_host = readkey(filename, passwd1, &fstamp, NULL);
+ if (pkey_host != NULL) {
+ followlink(filename, sizeof(filename));
+ fprintf(stderr, "Using host key %s\n",
+ filename);
+ } else {
+ pkey_host = genkey("RSA", "host");
+ }
+ }
+ if (pkey_host == NULL) {
+ fprintf(stderr, "Generating host key fails\n");
+ exit(-1);
+ }
+
+ /*
+ * Create new encrypted RSA or DSA sign keys file if requested;
+ * otherwise, look for an existing sign key file. If not found,
+ * use the host key instead.
+ */
+ if (sign != NULL)
+ pkey_sign = genkey(sign, "sign");
+ if (pkey_sign == NULL) {
+ snprintf(filename, sizeof(filename), "ntpkey_sign_%s",
+ hostname);
+ pkey_sign = readkey(filename, passwd1, &fstamp, NULL);
+ if (pkey_sign != NULL) {
+ followlink(filename, sizeof(filename));
+ fprintf(stderr, "Using sign key %s\n",
+ filename);
+ } else {
+ pkey_sign = pkey_host;
+ fprintf(stderr, "Using host key as sign key\n");
+ }
+ }
+
+ /*
+ * Create new encrypted GQ server keys file if requested;
+ * otherwise, look for an exisiting file. If found, fetch the
+ * public key for the certificate.
+ */
+ if (gqkey)
+ pkey_gqkey = gen_gqkey("gqkey");
+ if (pkey_gqkey == NULL) {
+ snprintf(filename, sizeof(filename), "ntpkey_gqkey_%s",
+ groupname);
+ pkey_gqkey = readkey(filename, passwd1, &fstamp, NULL);
+ if (pkey_gqkey != NULL) {
+ followlink(filename, sizeof(filename));
+ fprintf(stderr, "Using GQ parameters %s\n",
+ filename);
+ }
+ }
+ if (pkey_gqkey != NULL)
+ grpkey = BN_bn2hex(pkey_gqkey->pkey.rsa->q);
+
+ /*
+ * Write the nonencrypted GQ client parameters to the stdout
+ * stream. The parameter file is the server key file with the
+ * private key obscured.
+ */
+ if (pkey_gqkey != NULL && HAVE_OPT(ID_KEY)) {
+ RSA *rsa;
+
+ snprintf(filename, sizeof(filename),
+ "ntpkey_gqpar_%s.%u", groupname, fstamp);
+ fprintf(stderr, "Writing GQ parameters %s to stdout\n",
+ filename);
+ fprintf(stdout, "# %s\n# %s\n", filename,
+ ctime(&epoch));
+ rsa = pkey_gqkey->pkey.rsa;
+ BN_copy(rsa->p, BN_value_one());
+ BN_copy(rsa->q, BN_value_one());
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_RSA(pkey, rsa);
+ PEM_write_PKCS8PrivateKey(stdout, pkey, NULL, NULL, 0,
+ NULL, NULL);
+ fflush(stdout);
+ if (debug)
+ RSA_print_fp(stderr, rsa, 0);
+ }
+
+ /*
+ * Write the encrypted GQ server keys to the stdout stream.
+ */
+ if (pkey_gqkey != NULL && passwd2 != NULL) {
+ RSA *rsa;
+
+ snprintf(filename, sizeof(filename),
+ "ntpkey_gqkey_%s.%u", groupname, fstamp);
+ fprintf(stderr, "Writing GQ keys %s to stdout\n",
+ filename);
+ fprintf(stdout, "# %s\n# %s\n", filename,
+ ctime(&epoch));
+ rsa = pkey_gqkey->pkey.rsa;
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_RSA(pkey, rsa);
+ PEM_write_PKCS8PrivateKey(stdout, pkey, cipher, NULL, 0,
+ NULL, passwd2);
+ fflush(stdout);
+ if (debug)
+ RSA_print_fp(stderr, rsa, 0);
+ }
+
+ /*
+ * Create new encrypted IFF server keys file if requested;
+ * otherwise, look for existing file.
+ */
+ if (iffkey)
+ pkey_iffkey = gen_iffkey("iffkey");
+ if (pkey_iffkey == NULL) {
+ snprintf(filename, sizeof(filename), "ntpkey_iffkey_%s",
+ groupname);
+ pkey_iffkey = readkey(filename, passwd1, &fstamp, NULL);
+ if (pkey_iffkey != NULL) {
+ followlink(filename, sizeof(filename));
+ fprintf(stderr, "Using IFF keys %s\n",
+ filename);
+ }
+ }
+
+ /*
+ * Write the nonencrypted IFF client parameters to the stdout
+ * stream. The parameter file is the server key file with the
+ * private key obscured.
+ */
+ if (pkey_iffkey != NULL && HAVE_OPT(ID_KEY)) {
+ DSA *dsa;
+
+ snprintf(filename, sizeof(filename),
+ "ntpkey_iffpar_%s.%u", groupname, fstamp);
+ fprintf(stderr, "Writing IFF parameters %s to stdout\n",
+ filename);
+ fprintf(stdout, "# %s\n# %s\n", filename,
+ ctime(&epoch));
+ dsa = pkey_iffkey->pkey.dsa;
+ BN_copy(dsa->priv_key, BN_value_one());
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_DSA(pkey, dsa);
+ PEM_write_PKCS8PrivateKey(stdout, pkey, NULL, NULL, 0,
+ NULL, NULL);
+ fflush(stdout);
+ if (debug)
+ DSA_print_fp(stderr, dsa, 0);
+ }
+
+ /*
+ * Write the encrypted IFF server keys to the stdout stream.
+ */
+ if (pkey_iffkey != NULL && passwd2 != NULL) {
+ DSA *dsa;
+
+ snprintf(filename, sizeof(filename),
+ "ntpkey_iffkey_%s.%u", groupname, fstamp);
+ fprintf(stderr, "Writing IFF keys %s to stdout\n",
+ filename);
+ fprintf(stdout, "# %s\n# %s\n", filename,
+ ctime(&epoch));
+ dsa = pkey_iffkey->pkey.dsa;
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_DSA(pkey, dsa);
+ PEM_write_PKCS8PrivateKey(stdout, pkey, cipher, NULL, 0,
+ NULL, passwd2);
+ fflush(stdout);
+ if (debug)
+ DSA_print_fp(stderr, dsa, 0);
+ }
+
+ /*
+ * Create new encrypted MV trusted-authority keys file if
+ * requested; otherwise, look for existing keys file.
+ */
+ if (mvkey)
+ pkey_mvkey = gen_mvkey("mv", pkey_mvpar);
+ if (pkey_mvkey == NULL) {
+ snprintf(filename, sizeof(filename), "ntpkey_mvta_%s",
+ groupname);
+ pkey_mvkey = readkey(filename, passwd1, &fstamp,
+ pkey_mvpar);
+ if (pkey_mvkey != NULL) {
+ followlink(filename, sizeof(filename));
+ fprintf(stderr, "Using MV keys %s\n",
+ filename);
+ }
+ }
+
+ /*
+ * Write the nonencrypted MV client parameters to the stdout
+ * stream. For the moment, we always use the client parameters
+ * associated with client key 1.
+ */
+ if (pkey_mvkey != NULL && HAVE_OPT(ID_KEY)) {
+ snprintf(filename, sizeof(filename),
+ "ntpkey_mvpar_%s.%u", groupname, fstamp);
+ fprintf(stderr, "Writing MV parameters %s to stdout\n",
+ filename);
+ fprintf(stdout, "# %s\n# %s\n", filename,
+ ctime(&epoch));
+ pkey = pkey_mvpar[2];
+ PEM_write_PKCS8PrivateKey(stdout, pkey, NULL, NULL, 0,
+ NULL, NULL);
+ fflush(stdout);
+ if (debug)
+ DSA_print_fp(stderr, pkey->pkey.dsa, 0);
+ }
+
+ /*
+ * Write the encrypted MV server keys to the stdout stream.
+ */
+ if (pkey_mvkey != NULL && passwd2 != NULL) {
+ snprintf(filename, sizeof(filename),
+ "ntpkey_mvkey_%s.%u", groupname, fstamp);
+ fprintf(stderr, "Writing MV keys %s to stdout\n",
+ filename);
+ fprintf(stdout, "# %s\n# %s\n", filename,
+ ctime(&epoch));
+ pkey = pkey_mvpar[1];
+ PEM_write_PKCS8PrivateKey(stdout, pkey, cipher, NULL, 0,
+ NULL, passwd2);
+ fflush(stdout);
+ if (debug)
+ DSA_print_fp(stderr, pkey->pkey.dsa, 0);
+ }
+
+ /*
+ * Decode the digest/signature scheme and create the
+ * certificate. Do this every time we run the program.
+ */
+ ectx = EVP_get_digestbyname(scheme);
+ if (ectx == NULL) {
+ fprintf(stderr,
+ "Invalid digest/signature combination %s\n",
+ scheme);
+ exit (-1);
+ }
+ x509(pkey_sign, ectx, grpkey, exten, certname);
+#endif /* AUTOKEY */
+ exit(0);
+}
+
+
+/*
+ * Generate semi-random MD5 keys compatible with NTPv3 and NTPv4. Also,
+ * if OpenSSL is around, generate random SHA1 keys compatible with
+ * symmetric key cryptography.
+ */
+int
+gen_md5(
+ char *id /* file name id */
+ )
+{
+ u_char md5key[MD5SIZE + 1]; /* MD5 key */
+ FILE *str;
+ int i, j;
+#ifdef OPENSSL
+ u_char keystr[MD5SIZE];
+ u_char hexstr[2 * MD5SIZE + 1];
+ u_char hex[] = "0123456789abcdef";
+#endif /* OPENSSL */
+
+ str = fheader("MD5key", id, groupname);
+ for (i = 1; i <= MD5KEYS; i++) {
+ for (j = 0; j < MD5SIZE; j++) {
+ int temp;
+
+ while (1) {
+ temp = ntp_random() & 0xff;
+ if (temp == '#')
+ continue;
+
+ if (temp > 0x20 && temp < 0x7f)
+ break;
+ }
+ md5key[j] = (u_char)temp;
+ }
+ md5key[j] = '\0';
+ fprintf(str, "%2d MD5 %s # MD5 key\n", i,
+ md5key);
+ }
+#ifdef OPENSSL
+ for (i = 1; i <= MD5KEYS; i++) {
+ RAND_bytes(keystr, 20);
+ for (j = 0; j < MD5SIZE; j++) {
+ hexstr[2 * j] = hex[keystr[j] >> 4];
+ hexstr[2 * j + 1] = hex[keystr[j] & 0xf];
+ }
+ hexstr[2 * MD5SIZE] = '\0';
+ fprintf(str, "%2d SHA1 %s # SHA1 key\n", i + MD5KEYS,
+ hexstr);
+ }
+#endif /* OPENSSL */
+ fclose(str);
+ return (1);
+}
+
+
+#ifdef AUTOKEY
+/*
+ * readkey - load cryptographic parameters and keys
+ *
+ * This routine loads a PEM-encoded file of given name and password and
+ * extracts the filestamp from the file name. It returns a pointer to
+ * the first key if valid, NULL if not.
+ */
+EVP_PKEY * /* public/private key pair */
+readkey(
+ char *cp, /* file name */
+ char *passwd, /* password */
+ u_int *estamp, /* file stamp */
+ EVP_PKEY **evpars /* parameter list pointer */
+ )
+{
+ FILE *str; /* file handle */
+ EVP_PKEY *pkey = NULL; /* public/private key */
+ u_int gstamp; /* filestamp */
+ char linkname[MAXFILENAME]; /* filestamp buffer) */
+ EVP_PKEY *parkey;
+ char *ptr;
+ int i;
+
+ /*
+ * Open the key file.
+ */
+ str = fopen(cp, "r");
+ if (str == NULL)
+ return (NULL);
+
+ /*
+ * Read the filestamp, which is contained in the first line.
+ */
+ if ((ptr = fgets(linkname, MAXFILENAME, str)) == NULL) {
+ fprintf(stderr, "Empty key file %s\n", cp);
+ fclose(str);
+ return (NULL);
+ }
+ if ((ptr = strrchr(ptr, '.')) == NULL) {
+ fprintf(stderr, "No filestamp found in %s\n", cp);
+ fclose(str);
+ return (NULL);
+ }
+ if (sscanf(++ptr, "%u", &gstamp) != 1) {
+ fprintf(stderr, "Invalid filestamp found in %s\n", cp);
+ fclose(str);
+ return (NULL);
+ }
+
+ /*
+ * Read and decrypt PEM-encoded private keys. The first one
+ * found is returned. If others are expected, add them to the
+ * parameter list.
+ */
+ for (i = 0; i <= MVMAX - 1;) {
+ parkey = PEM_read_PrivateKey(str, NULL, NULL, passwd);
+ if (evpars != NULL) {
+ evpars[i++] = parkey;
+ evpars[i] = NULL;
+ }
+ if (parkey == NULL)
+ break;
+
+ if (pkey == NULL)
+ pkey = parkey;
+ if (debug) {
+ if (parkey->type == EVP_PKEY_DSA)
+ DSA_print_fp(stderr, parkey->pkey.dsa,
+ 0);
+ else if (parkey->type == EVP_PKEY_RSA)
+ RSA_print_fp(stderr, parkey->pkey.rsa,
+ 0);
+ }
+ }
+ fclose(str);
+ if (pkey == NULL) {
+ fprintf(stderr, "Corrupt file %s or wrong key %s\n%s\n",
+ cp, passwd, ERR_error_string(ERR_get_error(),
+ NULL));
+ exit (-1);
+ }
+ *estamp = gstamp;
+ return (pkey);
+}
+
+
+/*
+ * Generate RSA public/private key pair
+ */
+EVP_PKEY * /* public/private key pair */
+gen_rsa(
+ char *id /* file name id */
+ )
+{
+ EVP_PKEY *pkey; /* private key */
+ RSA *rsa; /* RSA parameters and key pair */
+ FILE *str;
+
+ fprintf(stderr, "Generating RSA keys (%d bits)...\n", modulus);
+ rsa = RSA_generate_key(modulus, 3, cb, "RSA");
+ fprintf(stderr, "\n");
+ if (rsa == NULL) {
+ fprintf(stderr, "RSA generate keys fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (NULL);
+ }
+
+ /*
+ * For signature encryption it is not necessary that the RSA
+ * parameters be strictly groomed and once in a while the
+ * modulus turns out to be non-prime. Just for grins, we check
+ * the primality.
+ */
+ if (!RSA_check_key(rsa)) {
+ fprintf(stderr, "Invalid RSA key\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ RSA_free(rsa);
+ return (NULL);
+ }
+
+ /*
+ * Write the RSA parameters and keys as a RSA private key
+ * encoded in PEM.
+ */
+ if (strcmp(id, "sign") == 0)
+ str = fheader("RSAsign", id, hostname);
+ else
+ str = fheader("RSAhost", id, hostname);
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_RSA(pkey, rsa);
+ PEM_write_PKCS8PrivateKey(str, pkey, cipher, NULL, 0, NULL,
+ passwd1);
+ fclose(str);
+ if (debug)
+ RSA_print_fp(stderr, rsa, 0);
+ return (pkey);
+}
+
+
+/*
+ * Generate DSA public/private key pair
+ */
+EVP_PKEY * /* public/private key pair */
+gen_dsa(
+ char *id /* file name id */
+ )
+{
+ EVP_PKEY *pkey; /* private key */
+ DSA *dsa; /* DSA parameters */
+ u_char seed[20]; /* seed for parameters */
+ FILE *str;
+
+ /*
+ * Generate DSA parameters.
+ */
+ fprintf(stderr,
+ "Generating DSA parameters (%d bits)...\n", modulus);
+ RAND_bytes(seed, sizeof(seed));
+ dsa = DSA_generate_parameters(modulus, seed, sizeof(seed), NULL,
+ NULL, cb, "DSA");
+ fprintf(stderr, "\n");
+ if (dsa == NULL) {
+ fprintf(stderr, "DSA generate parameters fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (NULL);
+ }
+
+ /*
+ * Generate DSA keys.
+ */
+ fprintf(stderr, "Generating DSA keys (%d bits)...\n", modulus);
+ if (!DSA_generate_key(dsa)) {
+ fprintf(stderr, "DSA generate keys fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ DSA_free(dsa);
+ return (NULL);
+ }
+
+ /*
+ * Write the DSA parameters and keys as a DSA private key
+ * encoded in PEM.
+ */
+ str = fheader("DSAsign", id, hostname);
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_DSA(pkey, dsa);
+ PEM_write_PKCS8PrivateKey(str, pkey, cipher, NULL, 0, NULL,
+ passwd1);
+ fclose(str);
+ if (debug)
+ DSA_print_fp(stderr, dsa, 0);
+ return (pkey);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines implement the Schnorr (IFF) identity scheme *
+ * *
+ ***********************************************************************
+ *
+ * The Schnorr (IFF) identity scheme is intended for use when
+ * certificates are generated by some other trusted certificate
+ * authority and the certificate cannot be used to convey public
+ * parameters. There are two kinds of files: encrypted server files that
+ * contain private and public values and nonencrypted client files that
+ * contain only public values. New generations of server files must be
+ * securely transmitted to all servers of the group; client files can be
+ * distributed by any means. The scheme is self contained and
+ * independent of new generations of host keys, sign keys and
+ * certificates.
+ *
+ * The IFF values hide in a DSA cuckoo structure which uses the same
+ * parameters. The values are used by an identity scheme based on DSA
+ * cryptography and described in Stimson p. 285. The p is a 512-bit
+ * prime, g a generator of Zp* and q a 160-bit prime that divides p - 1
+ * and is a qth root of 1 mod p; that is, g^q = 1 mod p. The TA rolls a
+ * private random group key b (0 < b < q) and public key v = g^b, then
+ * sends (p, q, g, b) to the servers and (p, q, g, v) to the clients.
+ * Alice challenges Bob to confirm identity using the protocol described
+ * below.
+ *
+ * How it works
+ *
+ * The scheme goes like this. Both Alice and Bob have the public primes
+ * p, q and generator g. The TA gives private key b to Bob and public
+ * key v to Alice.
+ *
+ * Alice rolls new random challenge r (o < r < q) and sends to Bob in
+ * the IFF request message. Bob rolls new random k (0 < k < q), then
+ * computes y = k + b r mod q and x = g^k mod p and sends (y, hash(x))
+ * to Alice in the response message. Besides making the response
+ * shorter, the hash makes it effectivey impossible for an intruder to
+ * solve for b by observing a number of these messages.
+ *
+ * Alice receives the response and computes g^y v^r mod p. After a bit
+ * of algebra, this simplifies to g^k. If the hash of this result
+ * matches hash(x), Alice knows that Bob has the group key b. The signed
+ * response binds this knowledge to Bob's private key and the public key
+ * previously received in his certificate.
+ */
+/*
+ * Generate Schnorr (IFF) keys.
+ */
+EVP_PKEY * /* DSA cuckoo nest */
+gen_iffkey(
+ char *id /* file name id */
+ )
+{
+ EVP_PKEY *pkey; /* private key */
+ DSA *dsa; /* DSA parameters */
+ u_char seed[20]; /* seed for parameters */
+ BN_CTX *ctx; /* BN working space */
+ BIGNUM *b, *r, *k, *u, *v, *w; /* BN temp */
+ FILE *str;
+ u_int temp;
+
+ /*
+ * Generate DSA parameters for use as IFF parameters.
+ */
+ fprintf(stderr, "Generating IFF keys (%d bits)...\n",
+ modulus2);
+ RAND_bytes(seed, sizeof(seed));
+ dsa = DSA_generate_parameters(modulus2, seed, sizeof(seed), NULL,
+ NULL, cb, "IFF");
+ fprintf(stderr, "\n");
+ if (dsa == NULL) {
+ fprintf(stderr, "DSA generate parameters fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (NULL);;
+ }
+
+ /*
+ * Generate the private and public keys. The DSA parameters and
+ * private key are distributed to the servers, while all except
+ * the private key are distributed to the clients.
+ */
+ b = BN_new(); r = BN_new(); k = BN_new();
+ u = BN_new(); v = BN_new(); w = BN_new(); ctx = BN_CTX_new();
+ BN_rand(b, BN_num_bits(dsa->q), -1, 0); /* a */
+ BN_mod(b, b, dsa->q, ctx);
+ BN_sub(v, dsa->q, b);
+ BN_mod_exp(v, dsa->g, v, dsa->p, ctx); /* g^(q - b) mod p */
+ BN_mod_exp(u, dsa->g, b, dsa->p, ctx); /* g^b mod p */
+ BN_mod_mul(u, u, v, dsa->p, ctx);
+ temp = BN_is_one(u);
+ fprintf(stderr,
+ "Confirm g^(q - b) g^b = 1 mod p: %s\n", temp == 1 ?
+ "yes" : "no");
+ if (!temp) {
+ BN_free(b); BN_free(r); BN_free(k);
+ BN_free(u); BN_free(v); BN_free(w); BN_CTX_free(ctx);
+ return (NULL);
+ }
+ dsa->priv_key = BN_dup(b); /* private key */
+ dsa->pub_key = BN_dup(v); /* public key */
+
+ /*
+ * Here is a trial round of the protocol. First, Alice rolls
+ * random nonce r mod q and sends it to Bob. She needs only
+ * q from parameters.
+ */
+ BN_rand(r, BN_num_bits(dsa->q), -1, 0); /* r */
+ BN_mod(r, r, dsa->q, ctx);
+
+ /*
+ * Bob rolls random nonce k mod q, computes y = k + b r mod q
+ * and x = g^k mod p, then sends (y, x) to Alice. He needs
+ * p, q and b from parameters and r from Alice.
+ */
+ BN_rand(k, BN_num_bits(dsa->q), -1, 0); /* k, 0 < k < q */
+ BN_mod(k, k, dsa->q, ctx);
+ BN_mod_mul(v, dsa->priv_key, r, dsa->q, ctx); /* b r mod q */
+ BN_add(v, v, k);
+ BN_mod(v, v, dsa->q, ctx); /* y = k + b r mod q */
+ BN_mod_exp(u, dsa->g, k, dsa->p, ctx); /* x = g^k mod p */
+
+ /*
+ * Alice verifies x = g^y v^r to confirm that Bob has group key
+ * b. She needs p, q, g from parameters, (y, x) from Bob and the
+ * original r. We omit the detail here thatt only the hash of y
+ * is sent.
+ */
+ BN_mod_exp(v, dsa->g, v, dsa->p, ctx); /* g^y mod p */
+ BN_mod_exp(w, dsa->pub_key, r, dsa->p, ctx); /* v^r */
+ BN_mod_mul(v, w, v, dsa->p, ctx); /* product mod p */
+ temp = BN_cmp(u, v);
+ fprintf(stderr,
+ "Confirm g^k = g^(k + b r) g^(q - b) r: %s\n", temp ==
+ 0 ? "yes" : "no");
+ BN_free(b); BN_free(r); BN_free(k);
+ BN_free(u); BN_free(v); BN_free(w); BN_CTX_free(ctx);
+ if (temp != 0) {
+ DSA_free(dsa);
+ return (NULL);
+ }
+
+ /*
+ * Write the IFF keys as an encrypted DSA private key encoded in
+ * PEM.
+ *
+ * p modulus p
+ * q modulus q
+ * g generator g
+ * priv_key b
+ * public_key v
+ * kinv not used
+ * r not used
+ */
+ str = fheader("IFFkey", id, groupname);
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_DSA(pkey, dsa);
+ PEM_write_PKCS8PrivateKey(str, pkey, cipher, NULL, 0, NULL,
+ passwd1);
+ fclose(str);
+ if (debug)
+ DSA_print_fp(stderr, dsa, 0);
+ return (pkey);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines implement the Guillou-Quisquater (GQ) *
+ * identity scheme *
+ * *
+ ***********************************************************************
+ *
+ * The Guillou-Quisquater (GQ) identity scheme is intended for use when
+ * the certificate can be used to convey public parameters. The scheme
+ * uses a X509v3 certificate extension field do convey the public key of
+ * a private key known only to servers. There are two kinds of files:
+ * encrypted server files that contain private and public values and
+ * nonencrypted client files that contain only public values. New
+ * generations of server files must be securely transmitted to all
+ * servers of the group; client files can be distributed by any means.
+ * The scheme is self contained and independent of new generations of
+ * host keys and sign keys. The scheme is self contained and independent
+ * of new generations of host keys and sign keys.
+ *
+ * The GQ parameters hide in a RSA cuckoo structure which uses the same
+ * parameters. The values are used by an identity scheme based on RSA
+ * cryptography and described in Stimson p. 300 (with errors). The 512-
+ * bit public modulus is n = p q, where p and q are secret large primes.
+ * The TA rolls private random group key b as RSA exponent. These values
+ * are known to all group members.
+ *
+ * When rolling new certificates, a server recomputes the private and
+ * public keys. The private key u is a random roll, while the public key
+ * is the inverse obscured by the group key v = (u^-1)^b. These values
+ * replace the private and public keys normally generated by the RSA
+ * scheme. Alice challenges Bob to confirm identity using the protocol
+ * described below.
+ *
+ * How it works
+ *
+ * The scheme goes like this. Both Alice and Bob have the same modulus n
+ * and some random b as the group key. These values are computed and
+ * distributed in advance via secret means, although only the group key
+ * b is truly secret. Each has a private random private key u and public
+ * key (u^-1)^b, although not necessarily the same ones. Bob and Alice
+ * can regenerate the key pair from time to time without affecting
+ * operations. The public key is conveyed on the certificate in an
+ * extension field; the private key is never revealed.
+ *
+ * Alice rolls new random challenge r and sends to Bob in the GQ
+ * request message. Bob rolls new random k, then computes y = k u^r mod
+ * n and x = k^b mod n and sends (y, hash(x)) to Alice in the response
+ * message. Besides making the response shorter, the hash makes it
+ * effectivey impossible for an intruder to solve for b by observing
+ * a number of these messages.
+ *
+ * Alice receives the response and computes y^b v^r mod n. After a bit
+ * of algebra, this simplifies to k^b. If the hash of this result
+ * matches hash(x), Alice knows that Bob has the group key b. The signed
+ * response binds this knowledge to Bob's private key and the public key
+ * previously received in his certificate.
+ */
+/*
+ * Generate Guillou-Quisquater (GQ) parameters file.
+ */
+EVP_PKEY * /* RSA cuckoo nest */
+gen_gqkey(
+ char *id /* file name id */
+ )
+{
+ EVP_PKEY *pkey; /* private key */
+ RSA *rsa; /* RSA parameters */
+ BN_CTX *ctx; /* BN working space */
+ BIGNUM *u, *v, *g, *k, *r, *y; /* BN temps */
+ FILE *str;
+ u_int temp;
+
+ /*
+ * Generate RSA parameters for use as GQ parameters.
+ */
+ fprintf(stderr,
+ "Generating GQ parameters (%d bits)...\n",
+ modulus2);
+ rsa = RSA_generate_key(modulus2, 3, cb, "GQ");
+ fprintf(stderr, "\n");
+ if (rsa == NULL) {
+ fprintf(stderr, "RSA generate keys fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (NULL);
+ }
+ u = BN_new(); v = BN_new(); g = BN_new();
+ k = BN_new(); r = BN_new(); y = BN_new();
+
+ /*
+ * Generate the group key b, which is saved in the e member of
+ * the RSA structure. The group key is transmitted to each group
+ * member encrypted by the member private key.
+ */
+ ctx = BN_CTX_new();
+ BN_rand(rsa->e, BN_num_bits(rsa->n), -1, 0); /* b */
+ BN_mod(rsa->e, rsa->e, rsa->n, ctx);
+
+ /*
+ * When generating his certificate, Bob rolls random private key
+ * u, then computes inverse v = u^-1.
+ */
+ BN_rand(u, BN_num_bits(rsa->n), -1, 0); /* u */
+ BN_mod(u, u, rsa->n, ctx);
+ BN_mod_inverse(v, u, rsa->n, ctx); /* u^-1 mod n */
+ BN_mod_mul(k, v, u, rsa->n, ctx);
+
+ /*
+ * Bob computes public key v = (u^-1)^b, which is saved in an
+ * extension field on his certificate. We check that u^b v =
+ * 1 mod n.
+ */
+ BN_mod_exp(v, v, rsa->e, rsa->n, ctx);
+ BN_mod_exp(g, u, rsa->e, rsa->n, ctx); /* u^b */
+ BN_mod_mul(g, g, v, rsa->n, ctx); /* u^b (u^-1)^b */
+ temp = BN_is_one(g);
+ fprintf(stderr,
+ "Confirm u^b (u^-1)^b = 1 mod n: %s\n", temp ? "yes" :
+ "no");
+ if (!temp) {
+ BN_free(u); BN_free(v);
+ BN_free(g); BN_free(k); BN_free(r); BN_free(y);
+ BN_CTX_free(ctx);
+ RSA_free(rsa);
+ return (NULL);
+ }
+ BN_copy(rsa->p, u); /* private key */
+ BN_copy(rsa->q, v); /* public key */
+
+ /*
+ * Here is a trial run of the protocol. First, Alice rolls
+ * random nonce r mod n and sends it to Bob. She needs only n
+ * from parameters.
+ */
+ BN_rand(r, BN_num_bits(rsa->n), -1, 0); /* r */
+ BN_mod(r, r, rsa->n, ctx);
+
+ /*
+ * Bob rolls random nonce k mod n, computes y = k u^r mod n and
+ * g = k^b mod n, then sends (y, g) to Alice. He needs n, u, b
+ * from parameters and r from Alice.
+ */
+ BN_rand(k, BN_num_bits(rsa->n), -1, 0); /* k */
+ BN_mod(k, k, rsa->n, ctx);
+ BN_mod_exp(y, rsa->p, r, rsa->n, ctx); /* u^r mod n */
+ BN_mod_mul(y, k, y, rsa->n, ctx); /* y = k u^r mod n */
+ BN_mod_exp(g, k, rsa->e, rsa->n, ctx); /* g = k^b mod n */
+
+ /*
+ * Alice verifies g = v^r y^b mod n to confirm that Bob has
+ * private key u. She needs n, g from parameters, public key v =
+ * (u^-1)^b from the certificate, (y, g) from Bob and the
+ * original r. We omit the detaul here that only the hash of g
+ * is sent.
+ */
+ BN_mod_exp(v, rsa->q, r, rsa->n, ctx); /* v^r mod n */
+ BN_mod_exp(y, y, rsa->e, rsa->n, ctx); /* y^b mod n */
+ BN_mod_mul(y, v, y, rsa->n, ctx); /* v^r y^b mod n */
+ temp = BN_cmp(y, g);
+ fprintf(stderr, "Confirm g^k = v^r y^b mod n: %s\n", temp == 0 ?
+ "yes" : "no");
+ BN_CTX_free(ctx); BN_free(u); BN_free(v);
+ BN_free(g); BN_free(k); BN_free(r); BN_free(y);
+ if (temp != 0) {
+ RSA_free(rsa);
+ return (NULL);
+ }
+
+ /*
+ * Write the GQ parameter file as an encrypted RSA private key
+ * encoded in PEM.
+ *
+ * n modulus n
+ * e group key b
+ * d not used
+ * p private key u
+ * q public key (u^-1)^b
+ * dmp1 not used
+ * dmq1 not used
+ * iqmp not used
+ */
+ BN_copy(rsa->d, BN_value_one());
+ BN_copy(rsa->dmp1, BN_value_one());
+ BN_copy(rsa->dmq1, BN_value_one());
+ BN_copy(rsa->iqmp, BN_value_one());
+ str = fheader("GQkey", id, groupname);
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_RSA(pkey, rsa);
+ PEM_write_PKCS8PrivateKey(str, pkey, cipher, NULL, 0, NULL,
+ passwd1);
+ fclose(str);
+ if (debug)
+ RSA_print_fp(stderr, rsa, 0);
+ return (pkey);
+}
+
+
+/*
+ ***********************************************************************
+ * *
+ * The following routines implement the Mu-Varadharajan (MV) identity *
+ * scheme *
+ * *
+ ***********************************************************************
+ *
+ * The Mu-Varadharajan (MV) cryptosystem was originally intended when
+ * servers broadcast messages to clients, but clients never send
+ * messages to servers. There is one encryption key for the server and a
+ * separate decryption key for each client. It operated something like a
+ * pay-per-view satellite broadcasting system where the session key is
+ * encrypted by the broadcaster and the decryption keys are held in a
+ * tamperproof set-top box.
+ *
+ * The MV parameters and private encryption key hide in a DSA cuckoo
+ * structure which uses the same parameters, but generated in a
+ * different way. The values are used in an encryption scheme similar to
+ * El Gamal cryptography and a polynomial formed from the expansion of
+ * product terms (x - x[j]), as described in Mu, Y., and V.
+ * Varadharajan: Robust and Secure Broadcasting, Proc. Indocrypt 2001,
+ * 223-231. The paper has significant errors and serious omissions.
+ *
+ * Let q be the product of n distinct primes s1[j] (j = 1...n), where
+ * each s1[j] has m significant bits. Let p be a prime p = 2 * q + 1, so
+ * that q and each s1[j] divide p - 1 and p has M = n * m + 1
+ * significant bits. Let g be a generator of Zp; that is, gcd(g, p - 1)
+ * = 1 and g^q = 1 mod p. We do modular arithmetic over Zq and then
+ * project into Zp* as exponents of g. Sometimes we have to compute an
+ * inverse b^-1 of random b in Zq, but for that purpose we require
+ * gcd(b, q) = 1. We expect M to be in the 500-bit range and n
+ * relatively small, like 30. These are the parameters of the scheme and
+ * they are expensive to compute.
+ *
+ * We set up an instance of the scheme as follows. A set of random
+ * values x[j] mod q (j = 1...n), are generated as the zeros of a
+ * polynomial of order n. The product terms (x - x[j]) are expanded to
+ * form coefficients a[i] mod q (i = 0...n) in powers of x. These are
+ * used as exponents of the generator g mod p to generate the private
+ * encryption key A. The pair (gbar, ghat) of public server keys and the
+ * pairs (xbar[j], xhat[j]) (j = 1...n) of private client keys are used
+ * to construct the decryption keys. The devil is in the details.
+ *
+ * This routine generates a private server encryption file including the
+ * private encryption key E and partial decryption keys gbar and ghat.
+ * It then generates public client decryption files including the public
+ * keys xbar[j] and xhat[j] for each client j. The partial decryption
+ * files are used to compute the inverse of E. These values are suitably
+ * blinded so secrets are not revealed.
+ *
+ * The distinguishing characteristic of this scheme is the capability to
+ * revoke keys. Included in the calculation of E, gbar and ghat is the
+ * product s = prod(s1[j]) (j = 1...n) above. If the factor s1[j] is
+ * subsequently removed from the product and E, gbar and ghat
+ * recomputed, the jth client will no longer be able to compute E^-1 and
+ * thus unable to decrypt the messageblock.
+ *
+ * How it works
+ *
+ * The scheme goes like this. Bob has the server values (p, E, q,
+ * gbar, ghat) and Alice has the client values (p, xbar, xhat).
+ *
+ * Alice rolls new random nonce r mod p and sends to Bob in the MV
+ * request message. Bob rolls random nonce k mod q, encrypts y = r E^k
+ * mod p and sends (y, gbar^k, ghat^k) to Alice.
+ *
+ * Alice receives the response and computes the inverse (E^k)^-1 from
+ * the partial decryption keys gbar^k, ghat^k, xbar and xhat. She then
+ * decrypts y and verifies it matches the original r. The signed
+ * response binds this knowledge to Bob's private key and the public key
+ * previously received in his certificate.
+ */
+EVP_PKEY * /* DSA cuckoo nest */
+gen_mvkey(
+ char *id, /* file name id */
+ EVP_PKEY **evpars /* parameter list pointer */
+ )
+{
+ EVP_PKEY *pkey, *pkey1; /* private keys */
+ DSA *dsa, *dsa2, *sdsa; /* DSA parameters */
+ BN_CTX *ctx; /* BN working space */
+ BIGNUM *a[MVMAX]; /* polynomial coefficient vector */
+ BIGNUM *g[MVMAX]; /* public key vector */
+ BIGNUM *s1[MVMAX]; /* private enabling keys */
+ BIGNUM *x[MVMAX]; /* polynomial zeros vector */
+ BIGNUM *xbar[MVMAX], *xhat[MVMAX]; /* private keys vector */
+ BIGNUM *b; /* group key */
+ BIGNUM *b1; /* inverse group key */
+ BIGNUM *s; /* enabling key */
+ BIGNUM *biga; /* master encryption key */
+ BIGNUM *bige; /* session encryption key */
+ BIGNUM *gbar, *ghat; /* public key */
+ BIGNUM *u, *v, *w; /* BN scratch */
+ int i, j, n;
+ FILE *str;
+ u_int temp;
+
+ /*
+ * Generate MV parameters.
+ *
+ * The object is to generate a multiplicative group Zp* modulo a
+ * prime p and a subset Zq mod q, where q is the product of n
+ * distinct primes s1[j] (j = 1...n) and q divides p - 1. We
+ * first generate n m-bit primes, where the product n m is in
+ * the order of 512 bits. One or more of these may have to be
+ * replaced later. As a practical matter, it is tough to find
+ * more than 31 distinct primes for 512 bits or 61 primes for
+ * 1024 bits. The latter can take several hundred iterations
+ * and several minutes on a Sun Blade 1000.
+ */
+ n = nkeys;
+ fprintf(stderr,
+ "Generating MV parameters for %d keys (%d bits)...\n", n,
+ modulus2 / n);
+ ctx = BN_CTX_new(); u = BN_new(); v = BN_new(); w = BN_new();
+ b = BN_new(); b1 = BN_new();
+ dsa = DSA_new();
+ dsa->p = BN_new(); dsa->q = BN_new(); dsa->g = BN_new();
+ dsa->priv_key = BN_new(); dsa->pub_key = BN_new();
+ temp = 0;
+ for (j = 1; j <= n; j++) {
+ s1[j] = BN_new();
+ while (1) {
+ BN_generate_prime(s1[j], modulus2 / n, 0, NULL,
+ NULL, NULL, NULL);
+ for (i = 1; i < j; i++) {
+ if (BN_cmp(s1[i], s1[j]) == 0)
+ break;
+ }
+ if (i == j)
+ break;
+ temp++;
+ }
+ }
+ fprintf(stderr, "Birthday keys regenerated %d\n", temp);
+
+ /*
+ * Compute the modulus q as the product of the primes. Compute
+ * the modulus p as 2 * q + 1 and test p for primality. If p
+ * is composite, replace one of the primes with a new distinct
+ * one and try again. Note that q will hardly be a secret since
+ * we have to reveal p to servers, but not clients. However,
+ * factoring q to find the primes should be adequately hard, as
+ * this is the same problem considered hard in RSA. Question: is
+ * it as hard to find n small prime factors totalling n bits as
+ * it is to find two large prime factors totalling n bits?
+ * Remember, the bad guy doesn't know n.
+ */
+ temp = 0;
+ while (1) {
+ BN_one(dsa->q);
+ for (j = 1; j <= n; j++)
+ BN_mul(dsa->q, dsa->q, s1[j], ctx);
+ BN_copy(dsa->p, dsa->q);
+ BN_add(dsa->p, dsa->p, dsa->p);
+ BN_add_word(dsa->p, 1);
+ if (BN_is_prime(dsa->p, BN_prime_checks, NULL, ctx,
+ NULL))
+ break;
+
+ temp++;
+ j = temp % n + 1;
+ while (1) {
+ BN_generate_prime(u, modulus2 / n, 0, 0, NULL,
+ NULL, NULL);
+ for (i = 1; i <= n; i++) {
+ if (BN_cmp(u, s1[i]) == 0)
+ break;
+ }
+ if (i > n)
+ break;
+ }
+ BN_copy(s1[j], u);
+ }
+ fprintf(stderr, "Defective keys regenerated %d\n", temp);
+
+ /*
+ * Compute the generator g using a random roll such that
+ * gcd(g, p - 1) = 1 and g^q = 1. This is a generator of p, not
+ * q. This may take several iterations.
+ */
+ BN_copy(v, dsa->p);
+ BN_sub_word(v, 1);
+ while (1) {
+ BN_rand(dsa->g, BN_num_bits(dsa->p) - 1, 0, 0);
+ BN_mod(dsa->g, dsa->g, dsa->p, ctx);
+ BN_gcd(u, dsa->g, v, ctx);
+ if (!BN_is_one(u))
+ continue;
+
+ BN_mod_exp(u, dsa->g, dsa->q, dsa->p, ctx);
+ if (BN_is_one(u))
+ break;
+ }
+
+ /*
+ * Setup is now complete. Roll random polynomial roots x[j]
+ * (j = 1...n) for all j. While it may not be strictly
+ * necessary, Make sure each root has no factors in common with
+ * q.
+ */
+ fprintf(stderr,
+ "Generating polynomial coefficients for %d roots (%d bits)\n",
+ n, BN_num_bits(dsa->q));
+ for (j = 1; j <= n; j++) {
+ x[j] = BN_new();
+
+ while (1) {
+ BN_rand(x[j], BN_num_bits(dsa->q), 0, 0);
+ BN_mod(x[j], x[j], dsa->q, ctx);
+ BN_gcd(u, x[j], dsa->q, ctx);
+ if (BN_is_one(u))
+ break;
+ }
+ }
+
+ /*
+ * Generate polynomial coefficients a[i] (i = 0...n) from the
+ * expansion of root products (x - x[j]) mod q for all j. The
+ * method is a present from Charlie Boncelet.
+ */
+ for (i = 0; i <= n; i++) {
+ a[i] = BN_new();
+ BN_one(a[i]);
+ }
+ for (j = 1; j <= n; j++) {
+ BN_zero(w);
+ for (i = 0; i < j; i++) {
+ BN_copy(u, dsa->q);
+ BN_mod_mul(v, a[i], x[j], dsa->q, ctx);
+ BN_sub(u, u, v);
+ BN_add(u, u, w);
+ BN_copy(w, a[i]);
+ BN_mod(a[i], u, dsa->q, ctx);
+ }
+ }
+
+ /*
+ * Generate g[i] = g^a[i] mod p for all i and the generator g.
+ */
+ for (i = 0; i <= n; i++) {
+ g[i] = BN_new();
+ BN_mod_exp(g[i], dsa->g, a[i], dsa->p, ctx);
+ }
+
+ /*
+ * Verify prod(g[i]^(a[i] x[j]^i)) = 1 for all i, j. Note the
+ * a[i] x[j]^i exponent is computed mod q, but the g[i] is
+ * computed mod p. also note the expression given in the paper
+ * is incorrect.
+ */
+ temp = 1;
+ for (j = 1; j <= n; j++) {
+ BN_one(u);
+ for (i = 0; i <= n; i++) {
+ BN_set_word(v, i);
+ BN_mod_exp(v, x[j], v, dsa->q, ctx);
+ BN_mod_mul(v, v, a[i], dsa->q, ctx);
+ BN_mod_exp(v, dsa->g, v, dsa->p, ctx);
+ BN_mod_mul(u, u, v, dsa->p, ctx);
+ }
+ if (!BN_is_one(u))
+ temp = 0;
+ }
+ fprintf(stderr,
+ "Confirm prod(g[i]^(x[j]^i)) = 1 for all i, j: %s\n", temp ?
+ "yes" : "no");
+ if (!temp) {
+ return (NULL);
+ }
+
+ /*
+ * Make private encryption key A. Keep it around for awhile,
+ * since it is expensive to compute.
+ */
+ biga = BN_new();
+
+ BN_one(biga);
+ for (j = 1; j <= n; j++) {
+ for (i = 0; i < n; i++) {
+ BN_set_word(v, i);
+ BN_mod_exp(v, x[j], v, dsa->q, ctx);
+ BN_mod_exp(v, g[i], v, dsa->p, ctx);
+ BN_mod_mul(biga, biga, v, dsa->p, ctx);
+ }
+ }
+
+ /*
+ * Roll private random group key b mod q (0 < b < q), where
+ * gcd(b, q) = 1 to guarantee b^-1 exists, then compute b^-1
+ * mod q. If b is changed, the client keys must be recomputed.
+ */
+ while (1) {
+ BN_rand(b, BN_num_bits(dsa->q), 0, 0);
+ BN_mod(b, b, dsa->q, ctx);
+ BN_gcd(u, b, dsa->q, ctx);
+ if (BN_is_one(u))
+ break;
+ }
+ BN_mod_inverse(b1, b, dsa->q, ctx);
+
+ /*
+ * Make private client keys (xbar[j], xhat[j]) for all j. Note
+ * that the keys for the jth client do not s1[j] or the product
+ * s1[j]) (j = 1...n) which is q by construction.
+ *
+ * Compute the factor w such that w s1[j] = s1[j] for all j. The
+ * easy way to do this is to compute (q + s1[j]) / s1[j].
+ * Exercise for the student: prove the remainder is always zero.
+ */
+ for (j = 1; j <= n; j++) {
+ xbar[j] = BN_new(); xhat[j] = BN_new();
+
+ BN_add(w, dsa->q, s1[j]);
+ BN_div(w, u, w, s1[j], ctx);
+ BN_zero(xbar[j]);
+ BN_set_word(v, n);
+ for (i = 1; i <= n; i++) {
+ if (i == j)
+ continue;
+
+ BN_mod_exp(u, x[i], v, dsa->q, ctx);
+ BN_add(xbar[j], xbar[j], u);
+ }
+ BN_mod_mul(xbar[j], xbar[j], b1, dsa->q, ctx);
+ BN_mod_exp(xhat[j], x[j], v, dsa->q, ctx);
+ BN_mod_mul(xhat[j], xhat[j], w, dsa->q, ctx);
+ }
+
+ /*
+ * We revoke client j by dividing q by s1[j]. The quotient
+ * becomes the enabling key s. Note we always have to revoke
+ * one key; otherwise, the plaintext and cryptotext would be
+ * identical. For the present there are no provisions to revoke
+ * additional keys, so we sail on with only token revocations.
+ */
+ s = BN_new();
+ BN_copy(s, dsa->q);
+ BN_div(s, u, s, s1[n], ctx);
+
+ /*
+ * For each combination of clients to be revoked, make private
+ * encryption key E = A^s and partial decryption keys gbar = g^s
+ * and ghat = g^(s b), all mod p. The servers use these keys to
+ * compute the session encryption key and partial decryption
+ * keys. These values must be regenerated if the enabling key is
+ * changed.
+ */
+ bige = BN_new(); gbar = BN_new(); ghat = BN_new();
+ BN_mod_exp(bige, biga, s, dsa->p, ctx);
+ BN_mod_exp(gbar, dsa->g, s, dsa->p, ctx);
+ BN_mod_mul(v, s, b, dsa->q, ctx);
+ BN_mod_exp(ghat, dsa->g, v, dsa->p, ctx);
+
+ /*
+ * Notes: We produce the key media in three steps. The first
+ * step is to generate the system parameters p, q, g, b, A and
+ * the enabling keys s1[j]. Associated with each s1[j] are
+ * parameters xbar[j] and xhat[j]. All of these parameters are
+ * retained in a data structure protecteted by the trusted-agent
+ * password. The p, xbar[j] and xhat[j] paremeters are
+ * distributed to the j clients. When the client keys are to be
+ * activated, the enabled keys are multipied together to form
+ * the master enabling key s. This and the other parameters are
+ * used to compute the server encryption key E and the partial
+ * decryption keys gbar and ghat.
+ *
+ * In the identity exchange the client rolls random r and sends
+ * it to the server. The server rolls random k, which is used
+ * only once, then computes the session key E^k and partial
+ * decryption keys gbar^k and ghat^k. The server sends the
+ * encrypted r along with gbar^k and ghat^k to the client. The
+ * client completes the decryption and verifies it matches r.
+ */
+ /*
+ * Write the MV trusted-agent parameters and keys as a DSA
+ * private key encoded in PEM.
+ *
+ * p modulus p
+ * q modulus q
+ * g generator g
+ * priv_key A mod p
+ * pub_key b mod q
+ * (remaining values are not used)
+ */
+ i = 0;
+ str = fheader("MVta", "mvta", groupname);
+ fprintf(stderr, "Generating MV trusted-authority keys\n");
+ BN_copy(dsa->priv_key, biga);
+ BN_copy(dsa->pub_key, b);
+ pkey = EVP_PKEY_new();
+ EVP_PKEY_assign_DSA(pkey, dsa);
+ PEM_write_PKCS8PrivateKey(str, pkey, cipher, NULL, 0, NULL,
+ passwd1);
+ evpars[i++] = pkey;
+ if (debug)
+ DSA_print_fp(stderr, dsa, 0);
+
+ /*
+ * Append the MV server parameters and keys as a DSA key encoded
+ * in PEM.
+ *
+ * p modulus p
+ * q modulus q (used only when generating k)
+ * g bige
+ * priv_key gbar
+ * pub_key ghat
+ * (remaining values are not used)
+ */
+ fprintf(stderr, "Generating MV server keys\n");
+ dsa2 = DSA_new();
+ dsa2->p = BN_dup(dsa->p);
+ dsa2->q = BN_dup(dsa->q);
+ dsa2->g = BN_dup(bige);
+ dsa2->priv_key = BN_dup(gbar);
+ dsa2->pub_key = BN_dup(ghat);
+ pkey1 = EVP_PKEY_new();
+ EVP_PKEY_assign_DSA(pkey1, dsa2);
+ PEM_write_PKCS8PrivateKey(str, pkey1, cipher, NULL, 0, NULL,
+ passwd1);
+ evpars[i++] = pkey1;
+ if (debug)
+ DSA_print_fp(stderr, dsa2, 0);
+
+ /*
+ * Append the MV client parameters for each client j as DSA keys
+ * encoded in PEM.
+ *
+ * p modulus p
+ * priv_key xbar[j] mod q
+ * pub_key xhat[j] mod q
+ * (remaining values are not used)
+ */
+ fprintf(stderr, "Generating %d MV client keys\n", n);
+ for (j = 1; j <= n; j++) {
+ sdsa = DSA_new();
+ sdsa->p = BN_dup(dsa->p);
+ sdsa->q = BN_dup(BN_value_one());
+ sdsa->g = BN_dup(BN_value_one());
+ sdsa->priv_key = BN_dup(xbar[j]);
+ sdsa->pub_key = BN_dup(xhat[j]);
+ pkey1 = EVP_PKEY_new();
+ EVP_PKEY_set1_DSA(pkey1, sdsa);
+ PEM_write_PKCS8PrivateKey(str, pkey1, cipher, NULL, 0,
+ NULL, passwd1);
+ evpars[i++] = pkey1;
+ if (debug)
+ DSA_print_fp(stderr, sdsa, 0);
+
+ /*
+ * The product gbar^k)^xbar[j] (ghat^k)^xhat[j] and E
+ * are inverses of each other. We check that the product
+ * is one for each client except the ones that have been
+ * revoked.
+ */
+ BN_mod_exp(v, dsa2->priv_key, sdsa->pub_key, dsa->p,
+ ctx);
+ BN_mod_exp(u, dsa2->pub_key, sdsa->priv_key, dsa->p,
+ ctx);
+ BN_mod_mul(u, u, v, dsa->p, ctx);
+ BN_mod_mul(u, u, bige, dsa->p, ctx);
+ if (!BN_is_one(u)) {
+ fprintf(stderr, "Revoke key %d\n", j);
+ continue;
+ }
+ }
+ evpars[i++] = NULL;
+ fclose(str);
+
+ /*
+ * Free the countries.
+ */
+ for (i = 0; i <= n; i++) {
+ BN_free(a[i]); BN_free(g[i]);
+ }
+ for (j = 1; j <= n; j++) {
+ BN_free(x[j]); BN_free(xbar[j]); BN_free(xhat[j]);
+ BN_free(s1[j]);
+ }
+ return (pkey);
+}
+
+
+/*
+ * Generate X509v3 certificate.
+ *
+ * The certificate consists of the version number, serial number,
+ * validity interval, issuer name, subject name and public key. For a
+ * self-signed certificate, the issuer name is the same as the subject
+ * name and these items are signed using the subject private key. The
+ * validity interval extends from the current time to the same time one
+ * year hence. For NTP purposes, it is convenient to use the NTP seconds
+ * of the current time as the serial number.
+ */
+int
+x509 (
+ EVP_PKEY *pkey, /* signing key */
+ const EVP_MD *md, /* signature/digest scheme */
+ char *gqpub, /* identity extension (hex string) */
+ char *exten, /* private cert extension */
+ char *name /* subject/issuer name */
+ )
+{
+ X509 *cert; /* X509 certificate */
+ X509_NAME *subj; /* distinguished (common) name */
+ X509_EXTENSION *ex; /* X509v3 extension */
+ FILE *str; /* file handle */
+ ASN1_INTEGER *serial; /* serial number */
+ const char *id; /* digest/signature scheme name */
+ char pathbuf[MAXFILENAME + 1];
+
+ /*
+ * Generate X509 self-signed certificate.
+ *
+ * Set the certificate serial to the NTP seconds for grins. Set
+ * the version to 3. Set the initial validity to the current
+ * time and the finalvalidity one year hence.
+ */
+ id = OBJ_nid2sn(md->pkey_type);
+ fprintf(stderr, "Generating new certificate %s %s\n", name, id);
+ cert = X509_new();
+ X509_set_version(cert, 2L);
+ serial = ASN1_INTEGER_new();
+ ASN1_INTEGER_set(serial, (long)epoch + JAN_1970);
+ X509_set_serialNumber(cert, serial);
+ ASN1_INTEGER_free(serial);
+ X509_time_adj(X509_get_notBefore(cert), 0L, &epoch);
+ X509_time_adj(X509_get_notAfter(cert), lifetime * SECSPERDAY, &epoch);
+ subj = X509_get_subject_name(cert);
+ X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC,
+ (u_char *)name, strlen(name), -1, 0);
+ subj = X509_get_issuer_name(cert);
+ X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC,
+ (u_char *)name, strlen(name), -1, 0);
+ if (!X509_set_pubkey(cert, pkey)) {
+ fprintf(stderr, "Assign certificate signing key fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ X509_free(cert);
+ return (0);
+ }
+
+ /*
+ * Add X509v3 extensions if present. These represent the minimum
+ * set defined in RFC3280 less the certificate_policy extension,
+ * which is seriously obfuscated in OpenSSL.
+ */
+ /*
+ * The basic_constraints extension CA:TRUE allows servers to
+ * sign client certficitates.
+ */
+ fprintf(stderr, "%s: %s\n", LN_basic_constraints,
+ BASIC_CONSTRAINTS);
+ ex = X509V3_EXT_conf_nid(NULL, NULL, NID_basic_constraints,
+ BASIC_CONSTRAINTS);
+ if (!X509_add_ext(cert, ex, -1)) {
+ fprintf(stderr, "Add extension field fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (0);
+ }
+ X509_EXTENSION_free(ex);
+
+ /*
+ * The key_usage extension designates the purposes the key can
+ * be used for.
+ */
+ fprintf(stderr, "%s: %s\n", LN_key_usage, KEY_USAGE);
+ ex = X509V3_EXT_conf_nid(NULL, NULL, NID_key_usage, KEY_USAGE);
+ if (!X509_add_ext(cert, ex, -1)) {
+ fprintf(stderr, "Add extension field fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (0);
+ }
+ X509_EXTENSION_free(ex);
+ /*
+ * The subject_key_identifier is used for the GQ public key.
+ * This should not be controversial.
+ */
+ if (gqpub != NULL) {
+ fprintf(stderr, "%s\n", LN_subject_key_identifier);
+ ex = X509V3_EXT_conf_nid(NULL, NULL,
+ NID_subject_key_identifier, gqpub);
+ if (!X509_add_ext(cert, ex, -1)) {
+ fprintf(stderr,
+ "Add extension field fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (0);
+ }
+ X509_EXTENSION_free(ex);
+ }
+
+ /*
+ * The extended key usage extension is used for special purpose
+ * here. The semantics probably do not conform to the designer's
+ * intent and will likely change in future.
+ *
+ * "trustRoot" designates a root authority
+ * "private" designates a private certificate
+ */
+ if (exten != NULL) {
+ fprintf(stderr, "%s: %s\n", LN_ext_key_usage, exten);
+ ex = X509V3_EXT_conf_nid(NULL, NULL,
+ NID_ext_key_usage, exten);
+ if (!X509_add_ext(cert, ex, -1)) {
+ fprintf(stderr,
+ "Add extension field fails\n%s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ return (0);
+ }
+ X509_EXTENSION_free(ex);
+ }
+
+ /*
+ * Sign and verify.
+ */
+ X509_sign(cert, pkey, md);
+ if (X509_verify(cert, pkey) <= 0) {
+ fprintf(stderr, "Verify %s certificate fails\n%s\n", id,
+ ERR_error_string(ERR_get_error(), NULL));
+ X509_free(cert);
+ return (0);
+ }
+
+ /*
+ * Write the certificate encoded in PEM.
+ */
+ snprintf(pathbuf, sizeof(pathbuf), "%scert", id);
+ str = fheader(pathbuf, "cert", hostname);
+ PEM_write_X509(str, cert);
+ fclose(str);
+ if (debug)
+ X509_print_fp(stderr, cert);
+ X509_free(cert);
+ return (1);
+}
+
+#if 0 /* asn2ntp is used only with commercial certificates */
+/*
+ * asn2ntp - convert ASN1_TIME time structure to NTP time
+ */
+u_long
+asn2ntp (
+ ASN1_TIME *asn1time /* pointer to ASN1_TIME structure */
+ )
+{
+ char *v; /* pointer to ASN1_TIME string */
+ struct tm tm; /* time decode structure time */
+
+ /*
+ * Extract time string YYMMDDHHMMSSZ from ASN.1 time structure.
+ * Note that the YY, MM, DD fields start with one, the HH, MM,
+ * SS fiels start with zero and the Z character should be 'Z'
+ * for UTC. Also note that years less than 50 map to years
+ * greater than 100. Dontcha love ASN.1?
+ */
+ if (asn1time->length > 13)
+ return (-1);
+ v = (char *)asn1time->data;
+ tm.tm_year = (v[0] - '0') * 10 + v[1] - '0';
+ if (tm.tm_year < 50)
+ tm.tm_year += 100;
+ tm.tm_mon = (v[2] - '0') * 10 + v[3] - '0' - 1;
+ tm.tm_mday = (v[4] - '0') * 10 + v[5] - '0';
+ tm.tm_hour = (v[6] - '0') * 10 + v[7] - '0';
+ tm.tm_min = (v[8] - '0') * 10 + v[9] - '0';
+ tm.tm_sec = (v[10] - '0') * 10 + v[11] - '0';
+ tm.tm_wday = 0;
+ tm.tm_yday = 0;
+ tm.tm_isdst = 0;
+ return (mktime(&tm) + JAN_1970);
+}
+#endif
+
+/*
+ * Callback routine
+ */
+void
+cb (
+ int n1, /* arg 1 */
+ int n2, /* arg 2 */
+ void *chr /* arg 3 */
+ )
+{
+ switch (n1) {
+ case 0:
+ d0++;
+ fprintf(stderr, "%s %d %d %lu\r", (char *)chr, n1, n2,
+ d0);
+ break;
+ case 1:
+ d1++;
+ fprintf(stderr, "%s\t\t%d %d %lu\r", (char *)chr, n1,
+ n2, d1);
+ break;
+ case 2:
+ d2++;
+ fprintf(stderr, "%s\t\t\t\t%d %d %lu\r", (char *)chr,
+ n1, n2, d2);
+ break;
+ case 3:
+ d3++;
+ fprintf(stderr, "%s\t\t\t\t\t\t%d %d %lu\r",
+ (char *)chr, n1, n2, d3);
+ break;
+ }
+}
+
+
+/*
+ * Generate key
+ */
+EVP_PKEY * /* public/private key pair */
+genkey(
+ char *type, /* key type (RSA or DSA) */
+ char *id /* file name id */
+ )
+{
+ if (type == NULL)
+ return (NULL);
+ if (strcmp(type, "RSA") == 0)
+ return (gen_rsa(id));
+
+ else if (strcmp(type, "DSA") == 0)
+ return (gen_dsa(id));
+
+ fprintf(stderr, "Invalid %s key type %s\n", id, type);
+ return (NULL);
+}
+#endif /* AUTOKEY */
+
+
+/*
+ * Generate file header and link
+ */
+FILE *
+fheader (
+ const char *file, /* file name id */
+ const char *ulink, /* linkname */
+ const char *owner /* owner name */
+ )
+{
+ FILE *str; /* file handle */
+ char linkname[MAXFILENAME]; /* link name */
+ int temp;
+
+ snprintf(filename, sizeof(filename), "ntpkey_%s_%s.%u", file,
+ owner, fstamp);
+ if ((str = fopen(filename, "w")) == NULL) {
+ perror("Write");
+ exit (-1);
+ }
+ snprintf(linkname, sizeof(linkname), "ntpkey_%s_%s", ulink,
+ hostname);
+ (void)remove(linkname); /* The symlink() line below matters */
+ temp = symlink(filename, linkname);
+ if (temp < 0)
+ perror(file);
+ fprintf(stderr, "Generating new %s file and link\n", ulink);
+ fprintf(stderr, "%s->%s\n", linkname, filename);
+ fprintf(str, "# %s\n# %s\n", filename, ctime(&epoch));
+ return (str);
+}
diff --git a/util/ntp-keygen.html b/util/ntp-keygen.html
new file mode 100644
index 0000000..b5315d2
--- /dev/null
+++ b/util/ntp-keygen.html
@@ -0,0 +1,1811 @@
+<html lang="en">
+<head>
+<title>Ntp-keygen User's Manual</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="Ntp-keygen User's Manual">
+<meta name="generator" content="makeinfo 4.7">
+<link title="Top" rel="top" href="#Top">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+ pre.display { font-family:inherit }
+ pre.format { font-family:inherit }
+ pre.smalldisplay { font-family:inherit; font-size:smaller }
+ pre.smallformat { font-family:inherit; font-size:smaller }
+ pre.smallexample { font-size:smaller }
+ pre.smalllisp { font-size:smaller }
+ span.sc { font-variant:small-caps }
+ span.roman { font-family: serif; font-weight: normal; }
+--></style>
+</head>
+<body>
+<h1 class="settitle">Ntp-keygen User's Manual</h1>
+ <div class="shortcontents">
+<h2>Short Contents</h2>
+<ul>
+<a href="#Top">Top</a>
+<a href="#Top">NTP Key Generation Program User Manual</a>
+</ul>
+</div>
+
+
+
+<div class="node">
+<p><hr>
+<a name="Top"></a>Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">Top</h2>
+
+<ul class="menu">
+<li><a accesskey="1" href="#Description">Description</a>
+<li><a accesskey="2" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>: Invoking ntp-keygen
+<li><a accesskey="3" href="#Running-the-Program">Running the Program</a>
+<li><a accesskey="4" href="#Random-Seed-File">Random Seed File</a>
+<li><a accesskey="5" href="#Cryptographic-Data-Files">Cryptographic Data Files</a>
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Description">Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
+<br>
+</div>
+
+<h2 class="unnumbered">NTP Key Generation Program User Manual</h2>
+
+<p>This document describes the use of the NTP Project's <code>ntp-keygen</code>
+program, that generates cryptographic data files used by the NTPv4
+authentication and identity schemes.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software
+library has been installed, it can generate host keys, sign keys,
+certificates, and identity keys and parameters used by the Autokey
+public key cryptography.
+The message digest keys file is generated in a
+format compatible with NTPv3.
+All other files are in PEM-encoded
+printable ASCII format so they can be embedded as MIME attachments in
+mail to other sites.
+
+ <p>This document applies to version 4.2.7p482 of <code>ntp-keygen</code>.
+
+<div class="node">
+<p><hr>
+<a name="Description"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Running-the-Program">Running the Program</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Description</h3>
+
+<p>This program generates cryptographic data files used by the NTPv4
+authentication and identity schemes. It can generate message digest
+keys used in symmetric key cryptography and, if the OpenSSL software
+library has been installed, it can generate host keys, sign keys,
+certificates, and identity keys and parameters used by the Autokey
+public key cryptography. The message digest keys file is generated in a
+format compatible with NTPv3. All other files are in PEM-encoded
+printable ASCII format so they can be embedded as MIME attachments in
+mail to other sites.
+
+ <p>When used to generate message digest keys, the program produces a file
+containing ten pseudo-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the
+OpenSSL library is installed, it produces an additional ten hex-encoded
+random bit strings suitable for the SHA1 and other message digest
+algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys
+used for ordinary NTP associations, additional keys can be defined as
+passwords for the ntpq and ntpdc utility programs.
+
+ <p>The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys
+are probably not compatible with anything other than Autokey.
+
+ <p>Some files used by this program are encrypted using a private password.
+The <code>-p</code> option specifies the password for local encrypted files and the
+<code>-q</code> option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+<code>gethostname()</code> function, normally the DNS name of the host, is used.
+
+ <p>The <kbd>pw</kbd> option of the <code>crypto</code> configuration command
+specifies the read password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by ntpd without password, but only on the same
+host.
+
+ <p>Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called <code>ntp.keys</code>, is
+usually installed in <code>/etc</code>.
+Other files and links are usually installed
+in <code>/usr/local/etc</code>, which is normally in a shared filesystem in
+NFS-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the keysdir
+configuration command in such cases.
+Normally, this is in <code>/etc</code>.
+
+ <p>This program directs commentary and error messages to the standard
+error stream <code>stderr</code> and remote files to the standard output stream
+<code>stdout</code> where they can be piped to other applications or redirected to
+files.
+The names used for generated files and links all begin with the
+string <code>ntpkey</code> and include the file type,
+generating host and filestamp,
+as described in the <a href="#Cryptographic-Data-Files">Cryptographic Data Files</a> section below.
+
+<div class="node">
+<p><hr>
+<a name="Running-the-Program"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Random-Seed-File">Random Seed File</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Description">Description</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Running the Program</h3>
+
+<p>To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually <code>/usr/local/etc</code>.
+When run for the
+first time, or if all files with names beginning <code>ntpkey</code>] have been
+removed, use the <code>ntp-keygen</code> command without arguments to generate a
+default RSA host key and matching RSA-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+
+ <p>Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using <code>ntp-keygen</code>
+with the <code>-T</code> option and configure
+it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+
+ <p>The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+A different sign key can be assigned using the <code>-S</code> option
+and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the <code>-c</code> option.
+
+ <p>The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
+
+ <p>Additional information on trusted groups and identity schemes is on the
+Autokey Public-Key Authentication page.
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-Invocation"></a>
+<br>
+</div>
+
+<h3 class="section">Invoking ntp-keygen</h3>
+
+<p><a name="index-ntp_002dkeygen-1"></a><a name="index-Create-a-NTP-host-key-2"></a>
+
+ <p>This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+
+ <p>All files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+
+ <p>When used to generate message digest keys, the program produces a file
+containing ten pseudo-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the OpenSSL library is installed, it produces an additional ten
+hex-encoded random bit strings suitable for the SHA1 and other message
+digest algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys used for ordinary NTP associations, additional keys
+can be defined as passwords for the
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+utility programs.
+
+ <p>The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys are probably not compatible with anything
+other than Autokey.
+
+ <p>Some files used by this program are encrypted using a private password.
+The
+<code>-p</code>
+option specifies the password for local encrypted files and the
+<code>-q</code>
+option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+<code>gethostname()</code>
+function, normally the DNS name of the host is used.
+
+ <p>The
+<kbd>pw</kbd>
+option of the
+<kbd>crypto</kbd>
+configuration command specifies the read
+password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by
+<kbd>ntpd</kbd>
+without password but only on the same host.
+
+ <p>Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called
+<kbd>ntp.keys</kbd>,
+is usually installed in
+<span class="file">/etc</span>.
+Other files and links are usually installed in
+<span class="file">/usr/local/etc</span>,
+which is normally in a shared filesystem in
+NFS-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the
+<kbd>keysdir</kbd>
+configuration command in such cases.
+Normally, this is in
+<span class="file">/etc</span>.
+
+ <p>This program directs commentary and error messages to the standard
+error stream
+<kbd>stderr</kbd>
+and remote files to the standard output stream
+<kbd>stdout</kbd>
+where they can be piped to other applications or redirected to files.
+The names used for generated files and links all begin with the
+string
+<kbd>ntpkey</kbd>
+and include the file type, generating host and filestamp,
+as described in the
+Cryptographic Data Files
+section below.
+
+<h5 class="subsubsection">Running the Program</h5>
+
+<p>To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually
+<span class="file">/usr/local/etc</span>
+When run for the first time, or if all files with names beginning with
+<kbd>ntpkey</kbd>
+have been removed, use the
+<code>ntp-keygen</code>
+command without arguments to generate a
+default RSA host key and matching RSA-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+
+ <p>Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+<code>ntp-keygen</code>
+with the
+<code>-T</code>
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+
+ <p>The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+<code>-S</code>
+option and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+<code>-c</code>
+option.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
+
+ <p>Additional information on trusted groups and identity schemes is on the
+Autokey Public-Key Authentication
+page.
+
+ <p>The
+<code>ntpd(1ntpdmdoc)</code>
+configuration command
+<code>crypto</code> <code>pw</code> <kbd>password</kbd>
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+
+ <p>File names begin with the prefix
+<code>ntpkey_</code>
+and end with the postfix
+<kbd>_hostname.filestamp</kbd>,
+where
+<kbd>hostname</kbd>
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+<kbd>filestamp</kbd>
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+<code>rm</code> <code>ntpkey*</code>
+command or all files generated
+at a specific time can be removed by a
+<code>rm</code>
+<kbd>*filestamp</kbd>
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+
+ <p>All files are installed by default in the keys directory
+<span class="file">/usr/local/etc</span>,
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+
+ <p>Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+
+ <p>The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+<code>ntpd(1ntpdmdoc)</code>
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+<code>ntp-keygen</code>
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+
+<h5 class="subsubsection">Running the program</h5>
+
+<p>The safest way to run the
+<code>ntp-keygen</code>
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+<span class="file">/usr/local/etc</span>,
+then run the program.
+When run for the first time,
+or if all
+<code>ntpkey</code>
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+
+ <p>The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+
+ <p>Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+
+ <p>Running the program as other than root and using the Unix
+<code>su</code>
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+<code>.rnd</code>
+in the user home directory.
+However, there should be only one
+<code>.rnd</code>,
+most conveniently
+in the root directory, so it is convenient to define the
+<code>$RANDFILE</code>
+environment variable used by the OpenSSL library as the path to
+<code>/.rnd</code>.
+
+ <p>Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+<span class="file">/etc</span>
+using the
+<code>keysdir</code>
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+
+ <p>Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+
+ <p>All files are installed by default in the keys directory
+<span class="file">/usr/local/etc</span>,
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+
+ <p>Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+
+ <p>The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+<code>ntpd(1ntpdmdoc)</code>
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+<code>ntp-keygen</code>
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+
+<h5 class="subsubsection">Running the program</h5>
+
+<p>The safest way to run the
+<code>ntp-keygen</code>
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+<span class="file">/usr/local/etc</span>,
+then run the program.
+When run for the first time,
+or if all
+<code>ntpkey</code>
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+
+ <p>The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+
+ <p>Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+
+ <p>Running the program as other than root and using the Unix
+<code>su</code>
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+<code>.rnd</code>
+in the user home directory.
+However, there should be only one
+<code>.rnd</code>,
+most conveniently
+in the root directory, so it is convenient to define the
+<code>$RANDFILE</code>
+environment variable used by the OpenSSL library as the path to
+<code>/.rnd</code>.
+
+ <p>Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+<span class="file">/etc</span>
+using the
+<code>keysdir</code>
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+
+ <p>Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+
+ <p>s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+<a href="#Authentication-Options">Authentication Options</a>
+section of
+<code>ntp.conf(5)</code>.
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+<a href="#Automatic-NTP-Configuration-Options">Automatic NTP Configuration Options</a>
+section of
+<code>ntp.conf(5)</code>.
+
+ <p>On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+<code>ntpkey</code>
+files.
+Then run
+<code>ntp-keygen</code>
+<code>-T</code>
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+<code>-T</code>
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+
+ <p>If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+<code>ntp-keygen</code>
+with the
+<code>-S</code> <kbd>type</kbd>
+option, where
+<kbd>type</kbd>
+is either
+<code>RSA</code>
+or
+<code>DSA</code>.
+The most often need to do this is when a DSA-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+<code>ntp-keygen</code>
+with the
+<code>-c</code> <kbd>scheme</kbd>
+option and selected
+<kbd>scheme</kbd>
+as needed.
+f
+<code>ntp-keygen</code>
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+
+ <p>After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+<code>ntp-keygen</code>
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+<code>ntpd(1ntpdmdoc)</code>
+should be restarted.
+When
+<code>ntpd(1ntpdmdoc)</code>
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+
+<h5 class="subsubsection">Identity Schemes</h5>
+
+<p>As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+"Identification Schemes"
+page
+(maybe available at
+<code>http://www.eecis.udel.edu/%7emills/keygen.html</code>).
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+
+ <p>In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+
+ <p>The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+<code>ntp-keygen</code>
+<code>-P</code>
+<code>-p</code> <kbd>password</kbd>
+to generate the host key file
+<span class="file">ntpkey_RSAkey_</span><kbd>alice.filestamp</kbd>
+and trusted private certificate file
+<span class="file">ntpkey_RSA-MD5_cert_</span><kbd>alice.filestamp</kbd>.
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+<span class="file">ntpkey_host_</span><kbd>bob</kbd>
+to the host key file and soft link
+<span class="file">ntpkey_cert_</span><kbd>bob</kbd>
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+
+ <p>For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+<code>ntp-keygen</code>
+<code>-T</code>
+<code>-I</code>
+<code>-p</code> <kbd>password</kbd>
+to produce her parameter file
+<span class="file">ntpkey_IFFpar_</span><kbd>alice.filestamp</kbd>,
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+<span class="file">ntpkey_iff_</span><kbd>alice</kbd>
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+
+ <p>If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+<code>ntp-keygen</code>
+<code>-e</code>
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+<span class="file">ntpkey_iff_</span><kbd>alice</kbd>
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+
+ <p>For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+<code>ntp-keygen</code>
+<code>-T</code>
+<code>-G</code>
+<code>-p</code> <kbd>password</kbd>
+to produce her parameter file
+<span class="file">ntpkey_GQpar_</span><kbd>alice.filestamp</kbd>,
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+<span class="file">ntpkey_gq_</span><kbd>alice</kbd>
+to this file.
+In addition, on each host bob install a soft link
+from generic
+<span class="file">ntpkey_gq_</span><kbd>bob</kbd>
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+
+ <p>For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+<code>ntp-keygen</code>
+<code>-V</code> <kbd>n</kbd>
+<code>-p</code> <kbd>password</kbd>,
+where
+<kbd>n</kbd>
+is the number of revokable keys (typically 5) to produce
+the parameter file
+<span class="file">ntpkeys_MVpar_</span><kbd>trish.filestamp</kbd>
+and client key files
+<span class="file">ntpkeys_MVkeyd_</span><kbd>trish.filestamp</kbd>
+where
+<kbd>d</kbd>
+is the key number (0 &lt;
+<kbd>d</kbd>
+&lt;
+<kbd>n</kbd>).
+Copy the parameter file to alice and install a soft link
+from the generic
+<span class="file">ntpkey_mv_</span><kbd>alice</kbd>
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+<span class="file">ntpkey_mvkey_</span><kbd>bob</kbd>
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+
+<h5 class="subsubsection">Command Line Options</h5>
+
+ <dl>
+<dt><code>-c</code> <kbd>scheme</kbd><dd>Select certificate message digest/signature encryption scheme.
+The
+<kbd>scheme</kbd>
+can be one of the following:
+. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+or
+<code>DSA-SHA1</code>.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+<code>RSA-MD5</code>.
+<br><dt><code>-d</code><dd>Enable debugging.
+This option displays the cryptographic data produced in eye-friendly billboards.
+<br><dt><code>-e</code><dd>Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+<br><dt><code>-G</code><dd>Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+<br><dt><code>-g</code><dd>Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+<br><dt><code>-H</code><dd>Generate new host keys, obsoleting any that may exist.
+<br><dt><code>-I</code><dd>Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+<br><dt><code>-i</code> <kbd>name</kbd><dd>Set the suject name to
+<kbd>name</kbd>.
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+<br><dt><code>-M</code><dd>Generate MD5 keys, obsoleting any that may exist.
+<br><dt><code>-P</code><dd>Generate a private certificate.
+By default, the program generates public certificates.
+<br><dt><code>-p</code> <kbd>password</kbd><dd>Encrypt generated files containing private data with
+<kbd>password</kbd>
+and the DES-CBC algorithm.
+<br><dt><code>-q</code><dd>Set the password for reading files to password.
+<br><dt><code>-S</code> <code>[RSA | DSA]</code><dd>Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+<br><dt><code>-s</code> <kbd>name</kbd><dd>Set the issuer name to
+<kbd>name</kbd>.
+This is used for the issuer field in certificates
+and in the file name for identity files.
+<br><dt><code>-T</code><dd>Generate a trusted certificate.
+By default, the program generates a non-trusted certificate.
+<br><dt><code>-V</code> <kbd>nkeys</kbd><dd>Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+</dl>
+
+<h5 class="subsubsection">Random Seed File</h5>
+
+<p>All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+<code>ntp-keygen</code>
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+
+ <p>It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+
+ <p>The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+<code>.rnd</code>,
+which must be available when starting the NTP daemon
+or the
+<code>ntp-keygen</code>
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+<code>randfile</code>
+subcommand of the
+<code>crypto</code>
+configuration command.
+If not specified in this way, or when starting the
+<code>ntp-keygen</code>
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+.Ev RANDFILE
+environment variable in the user home directory,
+whether root or some other user.
+If the
+.Ev RANDFILE
+environment variable is not present,
+the library will look for the
+<code>.rnd</code>
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+
+<h5 class="subsubsection">Cryptographic Data Files</h5>
+
+<p>All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+<code>ntp-keygen</code>
+program and
+<code>ntpd(1ntpdmdoc)</code>
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+
+ <p>The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+<pre class="example"> <kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd>
+</pre>
+ <p>where
+<kbd>keyno</kbd>
+is a positive integer in the range 1-65,535,
+<kbd>type</kbd>
+is the string MD5 defining the key format and
+<kbd>key</kbd>
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+#
+character.
+
+ <p>Note that the keys used by the
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+
+ <p>The
+<code>ntp-keygen</code>
+program generates a MD5 symmetric keys file
+<span class="file">ntpkey_MD5key_</span><kbd>hostname.filestamp</kbd>.
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+<span class="file">ntp.keys</span>,
+so
+<code>ntp-keygen</code>
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+<code>ntpq(1ntpqmdoc)</code>
+and
+<code>ntpdc(1ntpdcmdoc)</code>
+utilities.
+
+ <p>This section was generated by <strong>AutoGen</strong>,
+using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-keygen</code> program.
+This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
+
+<ul class="menu">
+<li><a accesskey="1" href="#ntp_002dkeygen-usage">ntp-keygen usage</a>: ntp-keygen help/usage (<span class="option">--help</span>)
+<li><a accesskey="2" href="#ntp_002dkeygen-imbits">ntp-keygen imbits</a>: imbits option (-b)
+<li><a accesskey="3" href="#ntp_002dkeygen-certificate">ntp-keygen certificate</a>: certificate option (-c)
+<li><a accesskey="4" href="#ntp_002dkeygen-cipher">ntp-keygen cipher</a>: cipher option (-C)
+<li><a accesskey="5" href="#ntp_002dkeygen-id_002dkey">ntp-keygen id-key</a>: id-key option (-e)
+<li><a accesskey="6" href="#ntp_002dkeygen-gq_002dparams">ntp-keygen gq-params</a>: gq-params option (-G)
+<li><a accesskey="7" href="#ntp_002dkeygen-host_002dkey">ntp-keygen host-key</a>: host-key option (-H)
+<li><a accesskey="8" href="#ntp_002dkeygen-iffkey">ntp-keygen iffkey</a>: iffkey option (-I)
+<li><a accesskey="9" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>: ident option (-i)
+<li><a href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>: lifetime option (-l)
+<li><a href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>: md5key option (-M)
+<li><a href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>: modulus option (-m)
+<li><a href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>: pvt-cert option (-P)
+<li><a href="#ntp_002dkeygen-password">ntp-keygen password</a>: password option (-p)
+<li><a href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>: export-passwd option (-q)
+<li><a href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>: sign-key option (-S)
+<li><a href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>: subject-name option (-s)
+<li><a href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>: trusted-cert option (-T)
+<li><a href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>: mv-params option (-V)
+<li><a href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>: mv-keys option (-v)
+<li><a href="#ntp_002dkeygen-config">ntp-keygen config</a>: presetting/configuring ntp-keygen
+<li><a href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>: exit status
+<li><a href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>: Usage
+<li><a href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>: Notes
+<li><a href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a>: Bugs
+</ul>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-imbits">ntp-keygen imbits</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp-keygen help/usage (<span class="option">--help</span>)</h4>
+
+<p><a name="index-ntp_002dkeygen-help-3"></a>
+This is the automatically generated usage text for ntp-keygen.
+
+ <p>The text printed is the same whether selected with the <code>help</code> option
+(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
+the usage text by passing it through a pager program.
+<code>more-help</code> is disabled on platforms without a working
+<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
+used to select the program, defaulting to <span class="file">more</span>. Both will exit
+with a status code of 0.
+
+<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.7p481
+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
+ - it must be in the range:
+ 256 to 2048
+ -c Str certificate certificate scheme
+ -C Str cipher privatekey cipher
+ -d no debug-level Increase debug verbosity level
+ - may appear multiple times
+ -D Num set-debug-level Set the debug verbosity level
+ - may appear multiple times
+ -e no id-key Write IFF or GQ identity keys
+ -G no gq-params Generate GQ parameters and keys
+ -H no host-key generate RSA host key
+ -I no iffkey generate IFF parameters
+ -i Str ident set Autokey group name
+ -l Num lifetime set certificate lifetime
+ -M no md5key generate MD5 keys
+ -m Num modulus modulus
+ - it must be in the range:
+ 256 to 2048
+ -P no pvt-cert generate PC private certificate
+ -p Str password local private password
+ -q Str export-passwd export IFF or GQ group keys with password
+ -S Str sign-key generate sign key (RSA or DSA)
+ -s Str subject-name set host and optionally group name
+ -T no trusted-cert trusted certificate (TC scheme)
+ -V Num mv-params generate &lt;num&gt; MV parameters
+ -v Num mv-keys update &lt;num&gt; MV keys
+ opt version output version information and exit
+ -? no help display extended usage information and exit
+ -! no more-help extended usage information passed thru pager
+ -&gt; opt save-opts save the option state to a config file
+ -&lt; Str load-opts load options from a config file
+ - disabled as '--no-load-opts'
+ - may appear multiple times
+
+Options are specified by doubled hyphens and their name or by a single
+hyphen and the flag character.
+
+
+The following option preset mechanisms are supported:
+ - reading file $HOME/.ntprc
+ - reading file ./.ntprc
+ - examining environment variables named NTP_KEYGEN_*
+
+Please send bug reports to: &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
+</pre>
+ <div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-imbits"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-certificate">ntp-keygen certificate</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-usage">ntp-keygen usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">imbits option (-b)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dimbits-4"></a>
+This is the &ldquo;identity modulus bits&rdquo; option.
+This option takes a number argument <span class="file">imbits</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>The number of bits in the identity modulus. The default is 256.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-certificate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-cipher">ntp-keygen cipher</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-imbits">ntp-keygen imbits</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">certificate option (-c)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dcertificate-5"></a>
+This is the &ldquo;certificate scheme&rdquo; option.
+This option takes a string argument <span class="file">scheme</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>scheme is one of
+RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+DSA-SHA, or DSA-SHA1.
+
+ <p>Select the certificate message digest/signature encryption scheme.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key. The default without
+this option is RSA-MD5.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-cipher"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-id_002dkey">ntp-keygen id-key</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-certificate">ntp-keygen certificate</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">cipher option (-C)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dcipher-6"></a>
+This is the &ldquo;privatekey cipher&rdquo; option.
+This option takes a string argument <span class="file">cipher</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Select the cipher which is used to encrypt the files containing
+private keys. The default is three-key triple DES in CBC mode,
+equivalent to "<code>-C des-ede3-cbc". The openssl tool lists ciphers
+available in "openssl -h" output.
+</code><div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-id_002dkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-gq_002dparams">ntp-keygen gq-params</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-cipher">ntp-keygen cipher</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">id-key option (-e)</h4>
+
+<p><a name="index-ntp_002dkeygen_002did_002dkey-7"></a>
+This is the &ldquo;write iff or gq identity keys&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Write the IFF or GQ client keys to the standard output. This is
+intended for automatic key distribution by mail.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-gq_002dparams"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-host_002dkey">ntp-keygen host-key</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-id_002dkey">ntp-keygen id-key</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">gq-params option (-G)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dgq_002dparams-8"></a>
+This is the &ldquo;generate gq parameters and keys&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-host_002dkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-iffkey">ntp-keygen iffkey</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-gq_002dparams">ntp-keygen gq-params</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">host-key option (-H)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dhost_002dkey-9"></a>
+This is the &ldquo;generate rsa host key&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Generate new host keys, obsoleting any that may exist.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-iffkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-host_002dkey">ntp-keygen host-key</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">iffkey option (-I)</h4>
+
+<p><a name="index-ntp_002dkeygen_002diffkey-10"></a>
+This is the &ldquo;generate iff parameters&rdquo; option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Generate parameters for the IFF identification scheme, obsoleting
+any that may exist.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-ident"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-iffkey">ntp-keygen iffkey</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ident option (-i)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dident-11"></a>
+This is the &ldquo;set autokey group name&rdquo; option.
+This option takes a string argument <span class="file">group</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Set the optional Autokey group name to name. This is used in
+the file name of IFF, GQ, and MV client parameters files. In
+that role, the default is the host name if this option is not
+provided. The group name, if specified using <code>-i/--ident</code> or
+using <code>-s/--subject-name</code> following an '<code>}' character,
+is also a part of the self-signed host certificate's subject and
+issuer names in the form host
+ <p>'crypto ident' or 'server ident' configuration in
+ntpd's configuration file.
+</code><div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-lifetime"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">lifetime option (-l)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dlifetime-12"></a>
+This is the ``set certificate lifetime'' option.
+This option takes a number argument <span class="file">lifetime</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Set the certificate expiration to lifetime days from now.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-md5key"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">md5key option (-M)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dmd5key-13"></a>
+This is the ``generate md5 keys'' option.
+Generate MD5 keys, obsoleting any that may exist.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-modulus"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">modulus option (-m)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dmodulus-14"></a>
+This is the ``modulus'' option.
+This option takes a number argument <span class="file">modulus</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>The number of bits in the prime modulus. The default is 512.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-pvt_002dcert"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-password">ntp-keygen password</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">pvt-cert option (-P)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dpvt_002dcert-15"></a>
+This is the ``generate pc private certificate'' option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Generate a private certificate. By default, the program generates
+public certificates.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-password"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">password option (-p)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dpassword-16"></a>
+This is the ``local private password'' option.
+This option takes a string argument <span class="file">passwd</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Local files containing private data are encrypted with the
+DES-CBC algorithm and the specified password. The same password
+must be specified to the local ntpd via the "crypto pw password"
+configuration command. The default password is the local
+hostname.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-export_002dpasswd"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-password">ntp-keygen password</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">export-passwd option (-q)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dexport_002dpasswd-17"></a>
+This is the ``export iff or gq group keys with password'' option.
+This option takes a string argument <span class="file">passwd</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Export IFF or GQ identity group keys to the standard output,
+encrypted with the DES-CBC algorithm and the specified password.
+The same password must be specified to the remote ntpd via the
+"crypto pw password" configuration command. See also the option
+--id-key (-e) for unencrypted exports.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-sign_002dkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">sign-key option (-S)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dsign_002dkey-18"></a>
+This is the ``generate sign key (rsa or dsa)'' option.
+This option takes a string argument <span class="file">sign</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-subject_002dname"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">subject-name option (-s)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dsubject_002dname-19"></a>
+This is the ``set host and optionally group name'' option.
+This option takes a string argument <span class="file">host@group</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Set the Autokey host name, and optionally, group name specified
+following an '<code>}' character. The host name is used in the file
+name of generated host and signing certificates, without the
+group name. The host name, and if provided, group name are used
+in host
+ <p>fields. Specifying '-s
+ <p>leaving the host name unchanged while appending
+ <p>subject and issuer fields, as with -i group. The group name, or
+if not provided, the host name are also used in the file names
+of IFF, GQ, and MV client parameter files.
+</code><div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-trusted_002dcert"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">trusted-cert option (-T)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dtrusted_002dcert-20"></a>
+This is the ``trusted certificate (tc scheme)'' option.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Generate a trusted certificate. By default, the program generates
+a non-trusted certificate.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-mv_002dparams"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">mv-params option (-V)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dmv_002dparams-21"></a>
+This is the ``generate &lt;num&gt; mv parameters'' option.
+This option takes a number argument <span class="file">num</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>Generate parameters and keys for the Mu-Varadharajan (MV)
+identification scheme.
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-mv_002dkeys"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-config">ntp-keygen config</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">mv-keys option (-v)</h4>
+
+<p><a name="index-ntp_002dkeygen_002dmv_002dkeys-22"></a>
+This is the ``update &lt;num&gt; mv keys'' option.
+This option takes a number argument <span class="file">num</span>.
+
+<p class="noindent">This option has some usage constraints. It:
+ <ul>
+<li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
+</ul>
+
+ <p>This option has no <span class="samp">doc</span> documentation.
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">presetting/configuring ntp-keygen</h4>
+
+<p>Any option that is not marked as <i>not presettable</i> may be preset by
+loading values from configuration ("rc" or "ini") files, and values from environment variables named <code>NTP-KEYGEN</code> and <code>NTP-KEYGEN_&lt;OPTION_NAME&gt;</code>. <code>&lt;OPTION_NAME&gt;</code> must be one of
+the options listed above in upper case and segmented with underscores.
+The <code>NTP-KEYGEN</code> variable will be tokenized and parsed like
+the command line. The remaining variables are tested for existence and their
+values are treated like option arguments.
+
+<p class="noindent"><code>libopts</code> will search in 2 places for configuration files:
+ <ul>
+<li>$HOME
+<li>$PWD
+</ul>
+ The environment variables <code>HOME</code>, and <code>PWD</code>
+are expanded and replaced when <span class="file">ntp-keygen</span> runs.
+For any of these that are plain files, they are simply processed.
+For any that are directories, then a file named <span class="file">.ntprc</span> is searched for
+within that directory and processed.
+
+ <p>Configuration files may be in a wide variety of formats.
+The basic format is an option name followed by a value (argument) on the
+same line. Values may be separated from the option name with a colon,
+equal sign or simply white space. Values may be continued across multiple
+lines by escaping the newline with a backslash.
+
+ <p>Multiple programs may also share the same initialization file.
+Common options are collected at the top, followed by program specific
+segments. The segments are separated by lines like:
+<pre class="example"> [NTP-KEYGEN]
+</pre>
+ <p class="noindent">or by
+<pre class="example"> &lt;?program ntp-keygen&gt;
+</pre>
+ <p class="noindent">Do not mix these styles within one configuration file.
+
+ <p>Compound values and carefully constructed string values may also be
+specified using XML syntax:
+<pre class="example"> &lt;option-name&gt;
+ &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
+ &lt;/option-name&gt;
+</pre>
+ <p class="noindent">yielding an <code>option-name.sub-opt</code> string value of
+<pre class="example"> "...&lt;...&gt;..."
+</pre>
+ <p><code>AutoOpts</code> does not track suboptions. You simply note that it is a
+hierarchicly valued option. <code>AutoOpts</code> does provide a means for searching
+the associated name/value pair list (see: optionFindValue).
+
+ <p>The command line options relating to configuration and/or usage help are:
+
+<h5 class="subsubheading">version (-)</h5>
+
+<p>Print the program version to standard out, optionally with licensing
+information, then exit 0. The optional argument specifies how much licensing
+detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
+Only the first letter of the argument is examined:
+
+ <dl>
+<dt><span class="samp">version</span><dd>Only print the version. This is the default.
+<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
+<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
+</dl>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-config">ntp-keygen config</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp-keygen exit status</h4>
+
+<p>One of the following exit values will be returned:
+ <dl>
+<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
+<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
+<br><dt><span class="samp">66 (EX_NOINPUT)</span><dd>A specified configuration file could not be loaded.
+<br><dt><span class="samp">70 (EX_SOFTWARE)</span><dd>libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+</dl>
+ <div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp-keygen Usage</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-Notes"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp-keygen Notes</h4>
+
+<div class="node">
+<p><hr>
+<a name="ntp_002dkeygen-Bugs"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
+<br>
+</div>
+
+<h4 class="subsection">ntp-keygen Bugs</h4>
+
+<div class="node">
+<p><hr>
+<a name="Random-Seed-File"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Cryptographic-Data-Files">Cryptographic Data Files</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Running-the-Program">Running the Program</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Random Seed File</h3>
+
+<p>All cryptographically sound key generation schemes must have means to
+randomize the entropy seed used to initialize the internal
+pseudo-random number generator used by the OpenSSL library routines.
+If a site supports ssh, it is very likely that means to do this are
+already available.
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called <code>.rnd</code>, which must be available when
+starting the <code>ntp-keygen</code> program or <code>ntpd</code> daemon.
+
+ <p>The OpenSSL library looks for the file using the path specified by the
+<code>RANDFILE</code> environment variable in the user home directory, whether root
+or some other user.
+If the <code>RANDFILE</code> environment variable is not
+present, the library looks for the <code>.rnd</code> file in the user home
+directory.
+Since both the <code>ntp-keygen</code> program and <code>ntpd</code> daemon must run
+as root, the logical place to put this file is in <code>/.rnd</code> or
+<code>/root/.rnd</code>.
+If the file is not available or cannot be written, the program exits
+with a message to the system log.
+
+<div class="node">
+<p><hr>
+<a name="Cryptographic-Data-Files"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Random-Seed-File">Random Seed File</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
+<br>
+</div>
+
+<!-- node-name, next, previous, up -->
+<h3 class="section">Cryptographic Data Files</h3>
+
+<p>File and link names are in the <code>form ntpkey_key_name.fstamp</code>,
+where <code>key</code> is the key or parameter type,
+<code>name</code> is the host or group name and
+<code>fstamp</code> is the filestamp (NTP seconds) when the file was created).
+By convention, key names in generated file names include both upper and
+lower case characters, while key names in generated link names include
+only lower case characters. The filestamp is not used in generated link
+names.
+
+ <p>The key name is a string defining the cryptographic key type.
+Key types include public/private keys host and sign, certificate cert
+and several challenge/response key types.
+By convention, client files used for
+challenges have a par subtype, as in the IFF challenge IFFpar, while
+server files for responses have a key subtype, as in the GQ response
+GQkey.
+
+ <p>All files begin with two nonencrypted lines. The first line contains
+the file name in the format <code>ntpkey_key_host.fstamp</code>.
+The second line contains the datestamp in conventional Unix date format.
+Lines beginning with <code>#</code> are ignored.
+
+ <p>The remainder of the file contains cryptographic data encoded first
+using ASN.1 rules, then encrypted using the DES-CBC algorithm with
+given password and finally written in PEM-encoded printable ASCII text
+preceded and followed by MIME content identifier lines.
+
+ <p>The format of the symmetric keys file, ordinarily named <code>ntp.keys</code>,
+is somewhat different than the other files in the interest of backward
+compatibility.
+Ordinarily, the file is generated by this program, but
+it can be constructed and edited using an ordinary text editor.
+
+<pre class="example"> # ntpkey_MD5key_hms.local.3564038757
+ # Sun Dec 9 02:45:57 2012
+
+ 1 MD5 "]!ghT%O;3)WJ,/Nc:&gt;I # MD5 key
+ 2 MD5 lu+H^tF46BKR-6~pV_5 # MD5 key
+ 3 MD5 :lnoVsE%Yz*avh%EtNC # MD5 key
+ 4 MD5 |fdZrf0sF~^V # MD5 key
+ 5 MD5 IyAG&gt;O"y"LmCRS!*bHC # MD5 key
+ 6 MD5 "&gt;e\A # MD5 key
+ 7 MD5 c9x=M'CfLxax9v)PV-si # MD5 key
+ 8 MD5 E|=jvFVov?Bn|Ev=&amp;aK\ # MD5 key
+ 9 MD5 T!c4UT&amp;`(m$+m+B6,`Q0 # MD5 key
+ 10 MD5 JVF/1=)=IFbHbJQz..Cd # MD5 key
+ 11 SHA1 6dea311109529e436c2b4fccae9bc753c16d1b48 # SHA1 key
+ 12 SHA1 7076f373d86c4848c59ff8046e49cb7d614ec394 # SHA1 key
+ 13 SHA1 5f48b1b60591eb01b7cf1d33b7774f08d20262d3 # SHA1 key
+ 14 SHA1 eed5ab9d9497319ec60cf3781d52607e76720178 # SHA1 key
+ 15 SHA1 f283562611a04c964da8126296f5f8e58c3f85de # SHA1 key
+ 16 SHA1 1930da171297dd63549af50b29449de17dcf341f # SHA1 key
+ 17 SHA1 fee892110358cd4382322b889869e750db8e8a8f # SHA1 key
+ 18 SHA1 b5520c9fadd7ad3fd8bfa061c8821b65d029bb37 # SHA1 key
+ 19 SHA1 8c74fb440ec80f453ec6aaa62b9baed0ab723b92 # SHA1 key
+ 20 SHA1 6bc05f734306a189326000970c19b3910f403795 # SHA1 key
+</pre>
+ <p>Figure 1. Typical Symmetric Key File
+
+ <p>Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Each line of the file contains three fields, first an
+integer between 1 and 65534, inclusive, representing the key identifier
+used in the server and peer configuration commands.
+Next is the key type for the message digest algorithm,
+which in the absence of the
+OpenSSL library must be MD5 to designate the MD5 message digest
+algorithm.
+If the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library.
+However, if
+compatibility with FIPS 140-2 is required, the key type must be either
+SHA or SHA1.
+The key type can be changed using an ASCII text editor.
+
+ <p>An MD5 key consists of a printable ASCII string less than or equal to
+16 characters and terminated by whitespace or a # character.
+An OpenSSL
+key consists of a hex-encoded ASCII string of 40 characters, which is
+truncated as necessary.
+
+ <p>Note that the keys used by the <code>ntpq</code> and <code>ntpdc</code> programs are
+checked against passwords requested by the programs and entered by hand,
+so it
+is generally appropriate to specify these keys in human readable ASCII
+format.
+
+ <p>The <code>ntp-keygen</code> program generates a MD5 symmetric keys file
+<code>ntpkey_MD5key_hostname.filestamp</code>.
+Since the file contains private
+shared keys, it should be visible only to root and distributed by
+secure means to other subnet hosts.
+The NTP daemon loads the file <code>ntp.keys</code>, so <code>ntp-keygen</code>
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by
+manual or automated means on the other subnet hosts.
+While this file is
+not used with the Autokey Version 2 protocol, it is needed to
+authenticate some remote configuration commands used by the <code>ntpq</code> and
+<code>ntpdc</code> utilities.
+
+</body></html>
+
diff --git a/util/ntp-keygen.man.in b/util/ntp-keygen.man.in
new file mode 100644
index 0000000..69fcfaa
--- /dev/null
+++ b/util/ntp-keygen.man.in
@@ -0,0 +1,1221 @@
+.de1 NOP
+. it 1 an-trap
+. if \\n[.$] \,\\$*\/
+..
+.ie t \
+.ds B-Font [CB]
+.ds I-Font [CI]
+.ds R-Font [CR]
+.el \
+.ds B-Font B
+.ds I-Font I
+.ds R-Font R
+.TH ntp-keygen @NTP_KEYGEN_MS@ "02 Dec 2014" "ntp (4.2.7p482)" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-znaynR/ag-LnaqmR)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:44 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-keygen-opts.def
+.\" and the template file agman-cmd.tpl
+.SH NAME
+\f\*[B-Font]ntp-keygen\fP
+\- Create a NTP host key
+.SH SYNOPSIS
+\f\*[B-Font]ntp-keygen\fP
+.\" Mixture of short (flag) options and long options
+[\f\*[B-Font]\-flags\f[]]
+[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
+[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
+.sp \n(Ppu
+.ne 2
+
+All arguments must be options.
+.sp \n(Ppu
+.ne 2
+
+.SH DESCRIPTION
+This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+.sp \n(Ppu
+.ne 2
+
+All files are in PEM-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+.sp \n(Ppu
+.ne 2
+
+When used to generate message digest keys, the program produces a file
+containing ten pseudo-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the OpenSSL library is installed, it produces an additional ten
+hex-encoded random bit strings suitable for the SHA1 and other message
+digest algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys used for ordinary NTP associations, additional keys
+can be defined as passwords for the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utility programs.
+.sp \n(Ppu
+.ne 2
+
+The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys are probably not compatible with anything
+other than Autokey.
+.sp \n(Ppu
+.ne 2
+
+Some files used by this program are encrypted using a private password.
+The
+\f\*[B-Font]\-p\f[]
+option specifies the password for local encrypted files and the
+\f\*[B-Font]\-q\f[]
+option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+\fBgethostname\fR()\f[]
+function, normally the DNS name of the host is used.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[I-Font]pw\f[]
+option of the
+\f\*[I-Font]crypto\f[]
+configuration command specifies the read
+password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by
+\f\*[I-Font]ntpd\f[]
+without password but only on the same host.
+.sp \n(Ppu
+.ne 2
+
+Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called
+\f\*[I-Font]ntp.keys\f[],
+is usually installed in
+\fI/etc\f[].
+Other files and links are usually installed in
+\fI/usr/local/etc\f[],
+which is normally in a shared filesystem in
+NFS-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the
+\f\*[I-Font]keysdir\f[]
+configuration command in such cases.
+Normally, this is in
+\fI/etc\f[].
+.sp \n(Ppu
+.ne 2
+
+This program directs commentary and error messages to the standard
+error stream
+\f\*[I-Font]stderr\f[]
+and remote files to the standard output stream
+\f\*[I-Font]stdout\f[]
+where they can be piped to other applications or redirected to files.
+The names used for generated files and links all begin with the
+string
+\f\*[I-Font]ntpkey\f[]
+and include the file type, generating host and filestamp,
+as described in the
+\*[Lq]Cryptographic Data Files\*[Rq]
+section below.
+.SS Running the Program
+To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually
+\fI/usr/local/etc\f[]
+When run for the first time, or if all files with names beginning with
+\f\*[I-Font]ntpkey\f[]
+have been removed, use the
+\f\*[B-Font]ntp-keygen\fP
+command without arguments to generate a
+default RSA host key and matching RSA-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+.sp \n(Ppu
+.ne 2
+
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-T\f[]
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+.sp \n(Ppu
+.ne 2
+
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+\f\*[B-Font]\-S\f[]
+option and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+\f\*[B-Font]\-c\f[]
+option.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
+.sp \n(Ppu
+.ne 2
+
+Additional information on trusted groups and identity schemes is on the
+\*[Lq]Autokey Public-Key Authentication\*[Rq]
+page.
+.sp \n(Ppu
+.ne 2
+
+The
+\fCntpd\fR(@NTPD_MS@)\f[]
+configuration command
+\f\*[B-Font]crypto\f[] \f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+.sp \n(Ppu
+.ne 2
+
+File names begin with the prefix
+\f\*[B-Font]ntpkey_\f[]
+and end with the postfix
+\f\*[I-Font]_hostname.filestamp\f[],
+where
+\f\*[I-Font]hostname\f[]
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+\f\*[I-Font]filestamp\f[]
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+\f\*[B-Font]rm\f[] \f\*[B-Font]ntpkey\&*\f[]
+command or all files generated
+at a specific time can be removed by a
+\f\*[B-Font]rm\f[]
+\f\*[I-Font]\&*filestamp\f[]
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.sp \n(Ppu
+.ne 2
+
+All files are installed by default in the keys directory
+\fI/usr/local/etc\f[],
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.sp \n(Ppu
+.ne 2
+
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.sp \n(Ppu
+.ne 2
+
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+\fCntpd\fR(@NTPD_MS@)\f[]
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+\f\*[B-Font]ntp-keygen\fP
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.SS Running the program
+The safest way to run the
+\f\*[B-Font]ntp-keygen\fP
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+\fI/usr/local/etc\f[],
+then run the program.
+When run for the first time,
+or if all
+\f\*[B-Font]ntpkey\f[]
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.sp \n(Ppu
+.ne 2
+
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.sp \n(Ppu
+.ne 2
+
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.sp \n(Ppu
+.ne 2
+
+Running the program as other than root and using the Unix
+\f\*[B-Font]su\f[]
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+\f\*[B-Font].rnd\f[]
+in the user home directory.
+However, there should be only one
+\f\*[B-Font].rnd\f[],
+most conveniently
+in the root directory, so it is convenient to define the
+\f\*[B-Font]$RANDFILE\f[]
+environment variable used by the OpenSSL library as the path to
+\f\*[B-Font]/.rnd\f[].
+.sp \n(Ppu
+.ne 2
+
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+\fI/etc\f[]
+using the
+\f\*[B-Font]keysdir\f[]
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+.sp \n(Ppu
+.ne 2
+
+All files are installed by default in the keys directory
+\fI/usr/local/etc\f[],
+which is normally in a shared filesystem
+in NFS-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.sp \n(Ppu
+.ne 2
+
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.sp \n(Ppu
+.ne 2
+
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+\fCntpd\fR(@NTPD_MS@)\f[]
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+\f\*[B-Font]ntp-keygen\fP
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.SS Running the program
+The safest way to run the
+\f\*[B-Font]ntp-keygen\fP
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+\fI/usr/local/etc\f[],
+then run the program.
+When run for the first time,
+or if all
+\f\*[B-Font]ntpkey\f[]
+files have been removed,
+the program generates a RSA host key file and matching RSA-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.sp \n(Ppu
+.ne 2
+
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.sp \n(Ppu
+.ne 2
+
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.sp \n(Ppu
+.ne 2
+
+Running the program as other than root and using the Unix
+\f\*[B-Font]su\f[]
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+\f\*[B-Font].rnd\f[]
+in the user home directory.
+However, there should be only one
+\f\*[B-Font].rnd\f[],
+most conveniently
+in the root directory, so it is convenient to define the
+\f\*[B-Font]$RANDFILE\f[]
+environment variable used by the OpenSSL library as the path to
+\f\*[B-Font]/.rnd\f[].
+.sp \n(Ppu
+.ne 2
+
+Installing the keys as root might not work in NFS-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+\fI/etc\f[]
+using the
+\f\*[B-Font]keysdir\f[]
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.sp \n(Ppu
+.ne 2
+
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+\fIAuthentication\f[] \fIOptions\f[]
+section of
+\fCntp.conf\fR(5)\f[].
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+\fIAutomatic\f[] \fINTP\f[] \fIConfiguration\f[] \fIOptions\f[]
+section of
+\fCntp.conf\fR(5)\f[].
+.sp \n(Ppu
+.ne 2
+
+On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+\f\*[B-Font]ntpkey\f[]
+files.
+Then run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-T\f[]
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+\f\*[B-Font]\-T\f[]
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+.sp \n(Ppu
+.ne 2
+
+If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-S\f[] \f\*[I-Font]type\f[]
+option, where
+\f\*[I-Font]type\f[]
+is either
+\f\*[B-Font]RSA\f[]
+or
+\f\*[B-Font]DSA\f[].
+The most often need to do this is when a DSA-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+\f\*[B-Font]ntp-keygen\fP
+with the
+\f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[]
+option and selected
+\f\*[I-Font]scheme\f[]
+as needed.
+f
+\f\*[B-Font]ntp-keygen\fP
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+.sp \n(Ppu
+.ne 2
+
+After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+\f\*[B-Font]ntp-keygen\fP
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+\fCntpd\fR(@NTPD_MS@)\f[]
+should be restarted.
+When
+\fCntpd\fR(@NTPD_MS@)\f[]
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+.SS Identity Schemes
+As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+"Identification Schemes"
+page
+(maybe available at
+\f[C]http://www.eecis.udel.edu/%7emills/keygen.html\f[]).
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+.sp \n(Ppu
+.ne 2
+
+In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+.sp \n(Ppu
+.ne 2
+
+The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-P\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+to generate the host key file
+\fIntpkey_RSAkey_\f[]\f\*[I-Font]alice.filestamp\f[]
+and trusted private certificate file
+\fIntpkey_RSA-MD5_cert_\f[]\f\*[I-Font]alice.filestamp\f[].
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+\fIntpkey_host_\f[]\f\*[I-Font]bob\f[]
+to the host key file and soft link
+\fIntpkey_cert_\f[]\f\*[I-Font]bob\f[]
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+.sp \n(Ppu
+.ne 2
+
+For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-T\f[]
+\f\*[B-Font]\-I\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+to produce her parameter file
+\fIntpkey_IFFpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+.sp \n(Ppu
+.ne 2
+
+If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-e\f[]
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[]
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+.sp \n(Ppu
+.ne 2
+
+For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-T\f[]
+\f\*[B-Font]\-G\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+to produce her parameter file
+\fIntpkey_GQpar_\f[]\f\*[I-Font]alice.filestamp\f[],
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+\fIntpkey_gq_\f[]\f\*[I-Font]alice\f[]
+to this file.
+In addition, on each host bob install a soft link
+from generic
+\fIntpkey_gq_\f[]\f\*[I-Font]bob\f[]
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+.sp \n(Ppu
+.ne 2
+
+For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+\f\*[B-Font]ntp-keygen\fP
+\f\*[B-Font]\-V\f[] \f\*[I-Font]n\f[]
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[],
+where
+\f\*[I-Font]n\f[]
+is the number of revokable keys (typically 5) to produce
+the parameter file
+\fIntpkeys_MVpar_\f[]\f\*[I-Font]trish.filestamp\f[]
+and client key files
+\fIntpkeys_MVkeyd_\f[]\f\*[I-Font]trish.filestamp\f[]
+where
+\f\*[I-Font]d\f[]
+is the key number (0 \&<
+\f\*[I-Font]d\f[]
+\&<
+\f\*[I-Font]n\f[]).
+Copy the parameter file to alice and install a soft link
+from the generic
+\fIntpkey_mv_\f[]\f\*[I-Font]alice\f[]
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+\fIntpkey_mvkey_\f[]\f\*[I-Font]bob\f[]
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+.SS Command Line Options
+.TP 7
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[]
+Select certificate message digest/signature encryption scheme.
+The
+\f\*[I-Font]scheme\f[]
+can be one of the following:
+. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
+or
+\f\*[B-Font]DSA-SHA1\f[].
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+\f\*[B-Font]RSA-MD5\f[].
+.TP 7
+.NOP \f\*[B-Font]\-d\f[]
+Enable debugging.
+This option displays the cryptographic data produced in eye-friendly billboards.
+.TP 7
+.NOP \f\*[B-Font]\-e\f[]
+Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+.TP 7
+.NOP \f\*[B-Font]\-G\f[]
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-g\f[]
+Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+.TP 7
+.NOP \f\*[B-Font]\-H\f[]
+Generate new host keys, obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-I\f[]
+Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]name\f[]
+Set the suject name to
+\f\*[I-Font]name\f[].
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+.TP 7
+.NOP \f\*[B-Font]\-M\f[]
+Generate MD5 keys, obsoleting any that may exist.
+.TP 7
+.NOP \f\*[B-Font]\-P\f[]
+Generate a private certificate.
+By default, the program generates public certificates.
+.TP 7
+.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+Encrypt generated files containing private data with
+\f\*[I-Font]password\f[]
+and the DES-CBC algorithm.
+.TP 7
+.NOP \f\*[B-Font]\-q\f[]
+Set the password for reading files to password.
+.TP 7
+.NOP \f\*[B-Font]\-S\f[] [\f\*[B-Font]RSA\f[] | \f\*[B-Font]DSA\f[]]
+Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+.TP 7
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]name\f[]
+Set the issuer name to
+\f\*[I-Font]name\f[].
+This is used for the issuer field in certificates
+and in the file name for identity files.
+.TP 7
+.NOP \f\*[B-Font]\-T\f[]
+Generate a trusted certificate.
+By default, the program generates a non-trusted certificate.
+.TP 7
+.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]nkeys\f[]
+Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
+.PP
+.SS Random Seed File
+All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+\f\*[B-Font]ntp-keygen\fP
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+.sp \n(Ppu
+.ne 2
+
+It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+.sp \n(Ppu
+.ne 2
+
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+\f\*[B-Font].rnd\f[],
+which must be available when starting the NTP daemon
+or the
+\f\*[B-Font]ntp-keygen\fP
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+\f\*[B-Font]randfile\f[]
+subcommand of the
+\f\*[B-Font]crypto\f[]
+configuration command.
+If not specified in this way, or when starting the
+\f\*[B-Font]ntp-keygen\fP
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+RANDFILE
+environment variable in the user home directory,
+whether root or some other user.
+If the
+RANDFILE
+environment variable is not present,
+the library will look for the
+\f\*[B-Font].rnd\f[]
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+.SS Cryptographic Data Files
+All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+\f\*[B-Font]ntp-keygen\fP
+program and
+\fCntpd\fR(@NTPD_MS@)\f[]
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+.sp \n(Ppu
+.ne 2
+
+The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+.in +4
+\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[]
+.in -4
+where
+\f\*[I-Font]keyno\f[]
+is a positive integer in the range 1-65,535,
+\f\*[I-Font]type\f[]
+is the string MD5 defining the key format and
+\f\*[I-Font]key\f[]
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+\[oq]#\[cq]
+character.
+.sp \n(Ppu
+.ne 2
+
+Note that the keys used by the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+.sp \n(Ppu
+.ne 2
+
+The
+\f\*[B-Font]ntp-keygen\fP
+program generates a MD5 symmetric keys file
+\fIntpkey_MD5key_\f[]\f\*[I-Font]hostname.filestamp\f[].
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+\fIntp.keys\f[],
+so
+\f\*[B-Font]ntp-keygen\fP
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+\fCntpq\fR(@NTPQ_MS@)\f[]
+and
+\fCntpdc\fR(@NTPDC_MS@)\f[]
+utilities.
+.SH "OPTIONS"
+.TP
+.NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]imbits\f[], \f\*[B-Font]\-\-imbits\f[]=\f\*[I-Font]imbits\f[]
+identity modulus bits.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]imbits\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the identity modulus. The default is 256.
+.TP
+.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[], \f\*[B-Font]\-\-certificate\f[]=\f\*[I-Font]scheme\f[]
+certificate scheme.
+.sp
+scheme is one of
+RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
+DSA-SHA, or DSA-SHA1.
+.sp
+Select the certificate message digest/signature encryption scheme.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key. The default without
+this option is RSA-MD5.
+.TP
+.NOP \f\*[B-Font]\-C\f[] \f\*[I-Font]cipher\f[], \f\*[B-Font]\-\-cipher\f[]=\f\*[I-Font]cipher\f[]
+privatekey cipher.
+.sp
+Select the cipher which is used to encrypt the files containing
+private keys. The default is three-key triple DES in CBC mode,
+equivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers
+available in "\fBopenssl \-h\fP" output.
+.TP
+.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[]
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.TP
+.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[]
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.TP
+.NOP \f\*[B-Font]\-e\f[], \f\*[B-Font]\-\-id\-key\f[]
+Write IFF or GQ identity keys.
+.sp
+Write the IFF or GQ client keys to the standard output. This is
+intended for automatic key distribution by mail.
+.TP
+.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-gq\-params\f[]
+Generate GQ parameters and keys.
+.sp
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.TP
+.NOP \f\*[B-Font]\-H\f[], \f\*[B-Font]\-\-host\-key\f[]
+generate RSA host key.
+.sp
+Generate new host keys, obsoleting any that may exist.
+.TP
+.NOP \f\*[B-Font]\-I\f[], \f\*[B-Font]\-\-iffkey\f[]
+generate IFF parameters.
+.sp
+Generate parameters for the IFF identification scheme, obsoleting
+any that may exist.
+.TP
+.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]group\f[], \f\*[B-Font]\-\-ident\f[]=\f\*[I-Font]group\f[]
+set Autokey group name.
+.sp
+Set the optional Autokey group name to name. This is used in
+the file name of IFF, GQ, and MV client parameters files. In
+that role, the default is the host name if this option is not
+provided. The group name, if specified using \fB-i/--ident\fP or
+using \fB-s/--subject-name\fP following an '\fB@\fP' character,
+is also a part of the self-signed host certificate's subject and
+issuer names in the form \fBhost@group\fP and should match the
+'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
+\fBntpd\fP's configuration file.
+.TP
+.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]lifetime\f[], \f\*[B-Font]\-\-lifetime\f[]=\f\*[I-Font]lifetime\f[]
+set certificate lifetime.
+This option takes an integer number as its argument.
+.sp
+Set the certificate expiration to lifetime days from now.
+.TP
+.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-md5key\f[]
+generate MD5 keys.
+.sp
+Generate MD5 keys, obsoleting any that may exist.
+.TP
+.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]modulus\f[], \f\*[B-Font]\-\-modulus\f[]=\f\*[I-Font]modulus\f[]
+modulus.
+This option takes an integer number as its argument.
+The value of
+\f\*[I-Font]modulus\f[]
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the prime modulus. The default is 512.
+.TP
+.NOP \f\*[B-Font]\-P\f[], \f\*[B-Font]\-\-pvt\-cert\f[]
+generate PC private certificate.
+.sp
+Generate a private certificate. By default, the program generates
+public certificates.
+.TP
+.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]passwd\f[], \f\*[B-Font]\-\-password\f[]=\f\*[I-Font]passwd\f[]
+local private password.
+.sp
+Local files containing private data are encrypted with the
+DES-CBC algorithm and the specified password. The same password
+must be specified to the local ntpd via the "crypto pw password"
+configuration command. The default password is the local
+hostname.
+.TP
+.NOP \f\*[B-Font]\-q\f[] \f\*[I-Font]passwd\f[], \f\*[B-Font]\-\-export\-passwd\f[]=\f\*[I-Font]passwd\f[]
+export IFF or GQ group keys with password.
+.sp
+Export IFF or GQ identity group keys to the standard output,
+encrypted with the DES-CBC algorithm and the specified password.
+The same password must be specified to the remote ntpd via the
+"crypto pw password" configuration command. See also the option
+--id-key (-e) for unencrypted exports.
+.TP
+.NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]sign\f[], \f\*[B-Font]\-\-sign\-key\f[]=\f\*[I-Font]sign\f[]
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+.TP
+.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]host@group\f[], \f\*[B-Font]\-\-subject\-name\f[]=\f\*[I-Font]host@group\f[]
+set host and optionally group name.
+.sp
+Set the Autokey host name, and optionally, group name specified
+following an '\fB@\fP' character. The host name is used in the file
+name of generated host and signing certificates, without the
+group name. The host name, and if provided, group name are used
+in \fBhost@group\fP form for the host certificate's subject and issuer
+fields. Specifying '\fB-s @group\fP' is allowed, and results in
+leaving the host name unchanged while appending \fB@group\fP to the
+subject and issuer fields, as with \fB-i group\fP. The group name, or
+if not provided, the host name are also used in the file names
+of IFF, GQ, and MV client parameter files.
+.TP
+.NOP \f\*[B-Font]\-T\f[], \f\*[B-Font]\-\-trusted\-cert\f[]
+trusted certificate (TC scheme).
+.sp
+Generate a trusted certificate. By default, the program generates
+a non-trusted certificate.
+.TP
+.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]num\f[], \f\*[B-Font]\-\-mv\-params\f[]=\f\*[I-Font]num\f[]
+generate <num> MV parameters.
+This option takes an integer number as its argument.
+.sp
+Generate parameters and keys for the Mu-Varadharajan (MV)
+identification scheme.
+.TP
+.NOP \f\*[B-Font]\-v\f[] \f\*[I-Font]num\f[], \f\*[B-Font]\-\-mv\-keys\f[]=\f\*[I-Font]num\f[]
+update <num> MV keys.
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.TP
+.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[]
+Display usage information and exit.
+.TP
+.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
+Pass the extended usage information through a pager.
+.TP
+.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.TP
+.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
+Load options from \fIcfgfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
+out of order.
+.TP
+.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}]
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.PP
+.SH "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTP_KEYGEN_<option-name>\fP or \fBNTP_KEYGEN\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.SH USAGE
+The
+\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[]
+option specifies the write password and
+\f\*[B-Font]\-q\f[] \f\*[I-Font]password\f[]
+option the read password for previously encrypted files.
+The
+\f\*[B-Font]ntp-keygen\fP
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
+.SH "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.SH "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.SH "EXIT STATUS"
+One of the following exit values will be returned:
+.TP
+.NOP 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.TP
+.NOP 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.TP
+.NOP 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.TP
+.NOP 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen-users@lists.sourceforge.net. Thank you.
+.PP
+.SH "AUTHORS"
+The University of Delaware
+.SH "COPYRIGHT"
+Copyright (C) 1970-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.SH BUGS
+It can take quite a while to generate some cryptographic values,
+from one to several minutes with modern architectures
+such as UltraSPARC and up to tens of minutes to an hour
+with older architectures such as SPARC IPC.
+.sp \n(Ppu
+.ne 2
+
+Please report bugs to http://bugs.ntp.org .
+.sp \n(Ppu
+.ne 2
+
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.SH NOTES
+Portions of this document came from FreeBSD.
+.sp \n(Ppu
+.ne 2
+
+This manual page was \fIAutoGen\fP-erated from the \fBntp-keygen\fP
+option definitions.
diff --git a/util/ntp-keygen.mdoc.in b/util/ntp-keygen.mdoc.in
new file mode 100644
index 0000000..80c6009
--- /dev/null
+++ b/util/ntp-keygen.mdoc.in
@@ -0,0 +1,1071 @@
+.Dd December 2 2014
+.Dt NTP_KEYGEN @NTP_KEYGEN_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 2, 2014 at 08:58:51 AM by AutoGen 5.18.5pre4
+.\" From the definitions ntp-keygen-opts.def
+.\" and the template file agmdoc-cmd.tpl
+.Sh NAME
+.Nm ntp-keygen
+.Nd Create a NTP host key
+.Sh SYNOPSIS
+.Nm
+.\" Mixture of short (flag) options and long options
+.Op Fl flags
+.Op Fl flag Op Ar value
+.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
+.Pp
+All arguments must be options.
+.Pp
+.Sh DESCRIPTION
+This program generates cryptographic data files used by the NTPv4
+authentication and identification schemes.
+It generates MD5 key files used in symmetric key cryptography.
+In addition, if the OpenSSL software library has been installed,
+it generates keys, certificate and identity files used in public key
+cryptography.
+These files are used for cookie encryption,
+digital signature and challenge/response identification algorithms
+compatible with the Internet standard security infrastructure.
+.Pp
+All files are in PEM\-encoded printable ASCII format,
+so they can be embedded as MIME attachments in mail to other sites
+and certificate authorities.
+By default, files are not encrypted.
+.Pp
+When used to generate message digest keys, the program produces a file
+containing ten pseudo\-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the OpenSSL library is installed, it produces an additional ten
+hex\-encoded random bit strings suitable for the SHA1 and other message
+digest algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys used for ordinary NTP associations, additional keys
+can be defined as passwords for the
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+utility programs.
+.Pp
+The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys are probably not compatible with anything
+other than Autokey.
+.Pp
+Some files used by this program are encrypted using a private password.
+The
+.Fl p
+option specifies the password for local encrypted files and the
+.Fl q
+option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+.Fn gethostname
+function, normally the DNS name of the host is used.
+.Pp
+The
+.Ar pw
+option of the
+.Ar crypto
+configuration command specifies the read
+password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by
+.Ar ntpd
+without password but only on the same host.
+.Pp
+Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called
+.Ar ntp.keys ,
+is usually installed in
+.Pa /etc .
+Other files and links are usually installed in
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem in
+NFS\-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the
+.Ar keysdir
+configuration command in such cases.
+Normally, this is in
+.Pa /etc .
+.Pp
+This program directs commentary and error messages to the standard
+error stream
+.Ar stderr
+and remote files to the standard output stream
+.Ar stdout
+where they can be piped to other applications or redirected to files.
+The names used for generated files and links all begin with the
+string
+.Ar ntpkey
+and include the file type, generating host and filestamp,
+as described in the
+.Dq Cryptographic Data Files
+section below.
+.Ss Running the Program
+To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually
+.Pa /usr/local/etc
+When run for the first time, or if all files with names beginning with
+.Ar ntpkey
+have been removed, use the
+.Nm
+command without arguments to generate a
+default RSA host key and matching RSA\-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+.Pp
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using
+.Nm
+with the
+.Fl T
+option and configure it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or
+indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+.Pp
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt
+signatures.
+A different sign key can be assigned using the
+.Fl S
+option and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the
+.Fl c
+option.
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken\-and\-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball\-and\-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re\-generated.
+.Pp
+Additional information on trusted groups and identity schemes is on the
+.Dq Autokey Public\-Key Authentication
+page.
+.Pp
+The
+.Xr ntpd @NTPD_MS@
+configuration command
+.Ic crypto pw Ar password
+specifies the read password for previously encrypted files.
+The daemon expires on the spot if the password is missing
+or incorrect.
+For convenience, if a file has been previously encrypted,
+the default read password is the name of the host running
+the program.
+If the previous write password is specified as the host name,
+these files can be read by that host with no explicit password.
+.Pp
+File names begin with the prefix
+.Cm ntpkey_
+and end with the postfix
+.Ar _hostname.filestamp ,
+where
+.Ar hostname
+is the owner name, usually the string returned
+by the Unix gethostname() routine, and
+.Ar filestamp
+is the NTP seconds when the file was generated, in decimal digits.
+This both guarantees uniqueness and simplifies maintenance
+procedures, since all files can be quickly removed
+by a
+.Ic rm ntpkey\&*
+command or all files generated
+at a specific time can be removed by a
+.Ic rm
+.Ar \&*filestamp
+command.
+To further reduce the risk of misconfiguration,
+the first two lines of a file contain the file name
+and generation date and time as comments.
+.Pp
+All files are installed by default in the keys directory
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem
+in NFS\-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.Pp
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write\-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.Pp
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+.Xr ntpd @NTPD_MS@
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+.Nm
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.Ss Running the program
+The safest way to run the
+.Nm
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+.Pa /usr/local/etc ,
+then run the program.
+When run for the first time,
+or if all
+.Cm ntpkey
+files have been removed,
+the program generates a RSA host key file and matching RSA\-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.Pp
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.Pp
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.Pp
+Running the program as other than root and using the Unix
+.Ic su
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+.Cm .rnd
+in the user home directory.
+However, there should be only one
+.Cm .rnd ,
+most conveniently
+in the root directory, so it is convenient to define the
+.Cm $RANDFILE
+environment variable used by the OpenSSL library as the path to
+.Cm /.rnd .
+.Pp
+Installing the keys as root might not work in NFS\-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.Pp
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+.Pp
+All files are installed by default in the keys directory
+.Pa /usr/local/etc ,
+which is normally in a shared filesystem
+in NFS\-mounted networks.
+The actual location of the keys directory
+and each file can be overridden by configuration commands,
+but this is not recommended.
+Normally, the files for each host are generated by that host
+and used only by that host, although exceptions exist
+as noted later on this page.
+.Pp
+Normally, files containing private values,
+including the host key, sign key and identification parameters,
+are permitted root read/write\-only;
+while others containing public values are permitted world readable.
+Alternatively, files containing private values can be encrypted
+and these files permitted world readable,
+which simplifies maintenance in shared file systems.
+Since uniqueness is insured by the hostname and
+file name extensions, the files for a NFS server and
+dependent clients can all be installed in the same shared directory.
+.Pp
+The recommended practice is to keep the file name extensions
+when installing a file and to install a soft link
+from the generic names specified elsewhere on this page
+to the generated files.
+This allows new file generations to be activated simply
+by changing the link.
+If a link is present, ntpd follows it to the file name
+to extract the filestamp.
+If a link is not present,
+.Xr ntpd @NTPD_MS@
+extracts the filestamp from the file itself.
+This allows clients to verify that the file and generation times
+are always current.
+The
+.Nm
+program uses the same timestamp extension for all files generated
+at one time, so each generation is distinct and can be readily
+recognized in monitoring data.
+.Ss Running the program
+The safest way to run the
+.Nm
+program is logged in directly as root.
+The recommended procedure is change to the keys directory,
+usually
+.Pa /usr/local/etc ,
+then run the program.
+When run for the first time,
+or if all
+.Cm ntpkey
+files have been removed,
+the program generates a RSA host key file and matching RSA\-MD5 certificate file,
+which is all that is necessary in many cases.
+The program also generates soft links from the generic names
+to the respective files.
+If run again, the program uses the same host key file,
+but generates a new certificate file and link.
+.Pp
+The host key is used to encrypt the cookie when required and so must be RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+When necessary, a different sign key can be specified and this can be
+either RSA or DSA type.
+By default, the message digest type is MD5, but any combination
+of sign key type and message digest type supported by the OpenSSL library
+can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
+and RIPE160 message digest algorithms.
+However, the scheme specified in the certificate must be compatible
+with the sign key.
+Certificates using any digest algorithm are compatible with RSA sign keys;
+however, only SHA and SHA1 certificates are compatible with DSA sign keys.
+.Pp
+Private/public key files and certificates are compatible with
+other OpenSSL applications and very likely other libraries as well.
+Certificates or certificate requests derived from them should be compatible
+with extant industry practice, although some users might find
+the interpretation of X509v3 extension fields somewhat liberal.
+However, the identification parameter files, although encoded
+as the other files, are probably not compatible with anything other than Autokey.
+.Pp
+Running the program as other than root and using the Unix
+.Ic su
+command
+to assume root may not work properly, since by default the OpenSSL library
+looks for the random seed file
+.Cm .rnd
+in the user home directory.
+However, there should be only one
+.Cm .rnd ,
+most conveniently
+in the root directory, so it is convenient to define the
+.Cm $RANDFILE
+environment variable used by the OpenSSL library as the path to
+.Cm /.rnd .
+.Pp
+Installing the keys as root might not work in NFS\-mounted
+shared file systems, as NFS clients may not be able to write
+to the shared keys directory, even as root.
+In this case, NFS clients can specify the files in another
+directory such as
+.Pa /etc
+using the
+.Ic keysdir
+command.
+There is no need for one client to read the keys and certificates
+of other clients or servers, as these data are obtained automatically
+by the Autokey protocol.
+.Pp
+Ordinarily, cryptographic files are generated by the host that uses them,
+but it is possible for a trusted agent (TA) to generate these files
+for other hosts; however, in such cases files should always be encrypted.
+The subject name and trusted name default to the hostname
+of the host generating the files, but can be changed by command line options.
+It is convenient to designate the owner name and trusted name
+as the subject and issuer fields, respectively, of the certificate.
+The owner name is also used for the host and sign key files,
+while the trusted name is used for the identity files.
+seconds.
+seconds.
+s Trusted Hosts and Groups
+Each cryptographic configuration involves selection of a signature scheme
+and identification scheme, called a cryptotype,
+as explained in the
+.Sx Authentication Options
+section of
+.Xr ntp.conf 5 .
+The default cryptotype uses RSA encryption, MD5 message digest
+and TC identification.
+First, configure a NTP subnet including one or more low\-stratum
+trusted hosts from which all other hosts derive synchronization
+directly or indirectly.
+Trusted hosts have trusted certificates;
+all other hosts have nontrusted certificates.
+These hosts will automatically and dynamically build authoritative
+certificate trails to one or more trusted hosts.
+A trusted group is the set of all hosts that have, directly or indirectly,
+a certificate trail ending at a trusted host.
+The trail is defined by static configuration file entries
+or dynamic means described on the
+.Sx Automatic NTP Configuration Options
+section of
+.Xr ntp.conf 5 .
+.Pp
+On each trusted host as root, change to the keys directory.
+To insure a fresh fileset, remove all
+.Cm ntpkey
+files.
+Then run
+.Nm
+.Fl T
+to generate keys and a trusted certificate.
+On all other hosts do the same, but leave off the
+.Fl T
+flag to generate keys and nontrusted certificates.
+When complete, start the NTP daemons beginning at the lowest stratum
+and working up the tree.
+It may take some time for Autokey to instantiate the certificate trails
+throughout the subnet, but setting up the environment is completely automatic.
+.Pp
+If it is necessary to use a different sign key or different digest/signature
+scheme than the default, run
+.Nm
+with the
+.Fl S Ar type
+option, where
+.Ar type
+is either
+.Cm RSA
+or
+.Cm DSA .
+The most often need to do this is when a DSA\-signed certificate is used.
+If it is necessary to use a different certificate scheme than the default,
+run
+.Nm
+with the
+.Fl c Ar scheme
+option and selected
+.Ar scheme
+as needed.
+f
+.Nm
+is run again without these options, it generates a new certificate
+using the same scheme and sign key.
+.Pp
+After setting up the environment it is advisable to update certificates
+from time to time, if only to extend the validity interval.
+Simply run
+.Nm
+with the same flags as before to generate new certificates
+using existing keys.
+However, if the host or sign key is changed,
+.Xr ntpd @NTPD_MS@
+should be restarted.
+When
+.Xr ntpd @NTPD_MS@
+is restarted, it loads any new files and restarts the protocol.
+Other dependent hosts will continue as usual until signatures are refreshed,
+at which time the protocol is restarted.
+.Ss Identity Schemes
+As mentioned on the Autonomous Authentication page,
+the default TC identity scheme is vulnerable to a middleman attack.
+However, there are more secure identity schemes available,
+including PC, IFF, GQ and MV described on the
+.Qq Identification Schemes
+page
+(maybe available at
+.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
+These schemes are based on a TA, one or more trusted hosts
+and some number of nontrusted hosts.
+Trusted hosts prove identity using values provided by the TA,
+while the remaining hosts prove identity using values provided
+by a trusted host and certificate trails that end on that host.
+The name of a trusted host is also the name of its sugroup
+and also the subject and issuer name on its trusted certificate.
+The TA is not necessarily a trusted host in this sense, but often is.
+.Pp
+In some schemes there are separate keys for servers and clients.
+A server can also be a client of another server,
+but a client can never be a server for another client.
+In general, trusted hosts and nontrusted hosts that operate
+as both server and client have parameter files that contain
+both server and client keys.
+Hosts that operate
+only as clients have key files that contain only client keys.
+.Pp
+The PC scheme supports only one trusted host in the group.
+On trusted host alice run
+.Nm
+.Fl P
+.Fl p Ar password
+to generate the host key file
+.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
+and trusted private certificate file
+.Pa ntpkey_RSA\-MD5_cert_ Ns Ar alice.filestamp .
+Copy both files to all group hosts;
+they replace the files which would be generated in other schemes.
+On each host bob install a soft link from the generic name
+.Pa ntpkey_host_ Ns Ar bob
+to the host key file and soft link
+.Pa ntpkey_cert_ Ns Ar bob
+to the private certificate file.
+Note the generic links are on bob, but point to files generated
+by trusted host alice.
+In this scheme it is not possible to refresh
+either the keys or certificates without copying them
+to all other hosts in the group.
+.Pp
+For the IFF scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host in the group,
+generate the IFF parameter file.
+On trusted host alice run
+.Nm
+.Fl T
+.Fl I
+.Fl p Ar password
+to produce her parameter file
+.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
+which includes both server and client keys.
+Copy this file to all group hosts that operate as both servers
+and clients and install a soft link from the generic
+.Pa ntpkey_iff_ Ns Ar alice
+to this file.
+If there are no hosts restricted to operate only as clients,
+there is nothing further to do.
+As the IFF scheme is independent
+of keys and certificates, these files can be refreshed as needed.
+.Pp
+If a rogue client has the parameter file, it could masquerade
+as a legitimate server and present a middleman threat.
+To eliminate this threat, the client keys can be extracted
+from the parameter file and distributed to all restricted clients.
+After generating the parameter file, on alice run
+.Nm
+.Fl e
+and pipe the output to a file or mail program.
+Copy or mail this file to all restricted clients.
+On these clients install a soft link from the generic
+.Pa ntpkey_iff_ Ns Ar alice
+to this file.
+To further protect the integrity of the keys,
+each file can be encrypted with a secret password.
+.Pp
+For the GQ scheme proceed as in the TC scheme to generate keys
+and certificates for all group hosts, then for every trusted host
+in the group, generate the IFF parameter file.
+On trusted host alice run
+.Nm
+.Fl T
+.Fl G
+.Fl p Ar password
+to produce her parameter file
+.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
+which includes both server and client keys.
+Copy this file to all group hosts and install a soft link
+from the generic
+.Pa ntpkey_gq_ Ns Ar alice
+to this file.
+In addition, on each host bob install a soft link
+from generic
+.Pa ntpkey_gq_ Ns Ar bob
+to this file.
+As the GQ scheme updates the GQ parameters file and certificate
+at the same time, keys and certificates can be regenerated as needed.
+.Pp
+For the MV scheme, proceed as in the TC scheme to generate keys
+and certificates for all group hosts.
+For illustration assume trish is the TA, alice one of several trusted hosts
+and bob one of her clients.
+On TA trish run
+.Nm
+.Fl V Ar n
+.Fl p Ar password ,
+where
+.Ar n
+is the number of revokable keys (typically 5) to produce
+the parameter file
+.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
+and client key files
+.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
+where
+.Ar d
+is the key number (0 \&<
+.Ar d
+\&<
+.Ar n ) .
+Copy the parameter file to alice and install a soft link
+from the generic
+.Pa ntpkey_mv_ Ns Ar alice
+to this file.
+Copy one of the client key files to alice for later distribution
+to her clients.
+It doesn't matter which client key file goes to alice,
+since they all work the same way.
+Alice copies the client key file to all of her cliens.
+On client bob install a soft link from generic
+.Pa ntpkey_mvkey_ Ns Ar bob
+to the client key file.
+As the MV scheme is independent of keys and certificates,
+these files can be refreshed as needed.
+.Ss Command Line Options
+.Bl -tag -width indent
+.It Fl c Ar scheme
+Select certificate message digest/signature encryption scheme.
+The
+.Ar scheme
+can be one of the following:
+. Cm RSA\-MD2 , RSA\-MD5 , RSA\-SHA , RSA\-SHA1 , RSA\-MDC2 , RSA\-RIPEMD160 , DSA\-SHA ,
+or
+.Cm DSA\-SHA1 .
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key.
+The default without this option is
+.Cm RSA\-MD5 .
+.It Fl d
+Enable debugging.
+This option displays the cryptographic data produced in eye\-friendly billboards.
+.It Fl e
+Write the IFF client keys to the standard output.
+This is intended for automatic key distribution by mail.
+.It Fl G
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.It Fl g
+Generate keys for the GQ identification scheme
+using the existing GQ parameters.
+If the GQ parameters do not yet exist, create them first.
+.It Fl H
+Generate new host keys, obsoleting any that may exist.
+.It Fl I
+Generate parameters for the IFF identification scheme,
+obsoleting any that may exist.
+.It Fl i Ar name
+Set the suject name to
+.Ar name .
+This is used as the subject field in certificates
+and in the file name for host and sign keys.
+.It Fl M
+Generate MD5 keys, obsoleting any that may exist.
+.It Fl P
+Generate a private certificate.
+By default, the program generates public certificates.
+.It Fl p Ar password
+Encrypt generated files containing private data with
+.Ar password
+and the DES\-CBC algorithm.
+.It Fl q
+Set the password for reading files to password.
+.It Fl S Oo Cm RSA | DSA Oc
+Generate a new sign key of the designated type,
+obsoleting any that may exist.
+By default, the program uses the host key as the sign key.
+.It Fl s Ar name
+Set the issuer name to
+.Ar name .
+This is used for the issuer field in certificates
+and in the file name for identity files.
+.It Fl T
+Generate a trusted certificate.
+By default, the program generates a non\-trusted certificate.
+.It Fl V Ar nkeys
+Generate parameters and keys for the Mu\-Varadharajan (MV) identification scheme.
+.El
+.Ss Random Seed File
+All cryptographically sound key generation schemes must have means
+to randomize the entropy seed used to initialize
+the internal pseudo\-random number generator used
+by the library routines.
+The OpenSSL library uses a designated random seed file for this purpose.
+The file must be available when starting the NTP daemon and
+.Nm
+program.
+If a site supports OpenSSL or its companion OpenSSH,
+it is very likely that means to do this are already available.
+.Pp
+It is important to understand that entropy must be evolved
+for each generation, for otherwise the random number sequence
+would be predictable.
+Various means dependent on external events, such as keystroke intervals,
+can be used to do this and some systems have built\-in entropy sources.
+Suitable means are described in the OpenSSL software documentation,
+but are outside the scope of this page.
+.Pp
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called
+.Cm .rnd ,
+which must be available when starting the NTP daemon
+or the
+.Nm
+program.
+The NTP daemon will first look for the file
+using the path specified by the
+.Ic randfile
+subcommand of the
+.Ic crypto
+configuration command.
+If not specified in this way, or when starting the
+.Nm
+program,
+the OpenSSL library will look for the file using the path specified
+by the
+.Ev RANDFILE
+environment variable in the user home directory,
+whether root or some other user.
+If the
+.Ev RANDFILE
+environment variable is not present,
+the library will look for the
+.Cm .rnd
+file in the user home directory.
+If the file is not available or cannot be written,
+the daemon exits with a message to the system log and the program
+exits with a suitable error message.
+.Ss Cryptographic Data Files
+All other file formats begin with two lines.
+The first contains the file name, including the generated host name
+and filestamp.
+The second contains the datestamp in conventional Unix date format.
+Lines beginning with # are considered comments and ignored by the
+.Nm
+program and
+.Xr ntpd @NTPD_MS@
+daemon.
+Cryptographic values are encoded first using ASN.1 rules,
+then encrypted if necessary, and finally written PEM\-encoded
+printable ASCII format preceded and followed by MIME content identifier lines.
+.Pp
+The format of the symmetric keys file is somewhat different
+than the other files in the interest of backward compatibility.
+Since DES\-CBC is deprecated in NTPv4, the only key format of interest
+is MD5 alphanumeric strings.
+Following hte heard the keys are
+entered one per line in the format
+.D1 Ar keyno type key
+where
+.Ar keyno
+is a positive integer in the range 1\-65,535,
+.Ar type
+is the string MD5 defining the key format and
+.Ar key
+is the key itself,
+which is a printable ASCII string 16 characters or less in length.
+Each character is chosen from the 93 printable characters
+in the range 0x21 through 0x7f excluding space and the
+.Ql #
+character.
+.Pp
+Note that the keys used by the
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+programs
+are checked against passwords requested by the programs
+and entered by hand, so it is generally appropriate to specify these keys
+in human readable ASCII format.
+.Pp
+The
+.Nm
+program generates a MD5 symmetric keys file
+.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
+Since the file contains private shared keys,
+it should be visible only to root and distributed by secure means
+to other subnet hosts.
+The NTP daemon loads the file
+.Pa ntp.keys ,
+so
+.Nm
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by manual
+or automated means on the other subnet hosts.
+While this file is not used with the Autokey Version 2 protocol,
+it is needed to authenticate some remote configuration commands
+used by the
+.Xr ntpq @NTPQ_MS@
+and
+.Xr ntpdc @NTPDC_MS@
+utilities.
+.Sh "OPTIONS"
+.Bl -tag
+.It Fl b Ar imbits , Fl \-imbits Ns = Ns Ar imbits
+identity modulus bits.
+This option takes an integer number as its argument.
+The value of
+.Ar imbits
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the identity modulus. The default is 256.
+.It Fl c Ar scheme , Fl \-certificate Ns = Ns Ar scheme
+certificate scheme.
+.sp
+scheme is one of
+RSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160,
+DSA\-SHA, or DSA\-SHA1.
+.sp
+Select the certificate message digest/signature encryption scheme.
+Note that RSA schemes must be used with a RSA sign key and DSA
+schemes must be used with a DSA sign key. The default without
+this option is RSA\-MD5.
+.It Fl C Ar cipher , Fl \-cipher Ns = Ns Ar cipher
+privatekey cipher.
+.sp
+Select the cipher which is used to encrypt the files containing
+private keys. The default is three\-key triple DES in CBC mode,
+equivalent to "@code{\-C des\-ede3\-cbc". The openssl tool lists ciphers
+available in "\fBopenssl \-h\fP" output.
+.It Fl d , Fl \-debug\-level
+Increase debug verbosity level.
+This option may appear an unlimited number of times.
+.sp
+.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
+Set the debug verbosity level.
+This option may appear an unlimited number of times.
+This option takes an integer number as its argument.
+.sp
+.It Fl e , Fl \-id\-key
+Write IFF or GQ identity keys.
+.sp
+Write the IFF or GQ client keys to the standard output. This is
+intended for automatic key distribution by mail.
+.It Fl G , Fl \-gq\-params
+Generate GQ parameters and keys.
+.sp
+Generate parameters and keys for the GQ identification scheme,
+obsoleting any that may exist.
+.It Fl H , Fl \-host\-key
+generate RSA host key.
+.sp
+Generate new host keys, obsoleting any that may exist.
+.It Fl I , Fl \-iffkey
+generate IFF parameters.
+.sp
+Generate parameters for the IFF identification scheme, obsoleting
+any that may exist.
+.It Fl i Ar group , Fl \-ident Ns = Ns Ar group
+set Autokey group name.
+.sp
+Set the optional Autokey group name to name. This is used in
+the file name of IFF, GQ, and MV client parameters files. In
+that role, the default is the host name if this option is not
+provided. The group name, if specified using \fB\-i/\-\-ident\fP or
+using \fB\-s/\-\-subject\-name\fP following an '\fB@\fP' character,
+is also a part of the self\-signed host certificate's subject and
+issuer names in the form \fBhost@group\fP and should match the
+\'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
+\fBntpd\fP's configuration file.
+.It Fl l Ar lifetime , Fl \-lifetime Ns = Ns Ar lifetime
+set certificate lifetime.
+This option takes an integer number as its argument.
+.sp
+Set the certificate expiration to lifetime days from now.
+.It Fl M , Fl \-md5key
+generate MD5 keys.
+.sp
+Generate MD5 keys, obsoleting any that may exist.
+.It Fl m Ar modulus , Fl \-modulus Ns = Ns Ar modulus
+modulus.
+This option takes an integer number as its argument.
+The value of
+.Ar modulus
+is constrained to being:
+.in +4
+.nf
+.na
+in the range 256 through 2048
+.fi
+.in -4
+.sp
+The number of bits in the prime modulus. The default is 512.
+.It Fl P , Fl \-pvt\-cert
+generate PC private certificate.
+.sp
+Generate a private certificate. By default, the program generates
+public certificates.
+.It Fl p Ar passwd , Fl \-password Ns = Ns Ar passwd
+local private password.
+.sp
+Local files containing private data are encrypted with the
+DES\-CBC algorithm and the specified password. The same password
+must be specified to the local ntpd via the "crypto pw password"
+configuration command. The default password is the local
+hostname.
+.It Fl q Ar passwd , Fl \-export\-passwd Ns = Ns Ar passwd
+export IFF or GQ group keys with password.
+.sp
+Export IFF or GQ identity group keys to the standard output,
+encrypted with the DES\-CBC algorithm and the specified password.
+The same password must be specified to the remote ntpd via the
+"crypto pw password" configuration command. See also the option
+-\-id\-key (\-e) for unencrypted exports.
+.It Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign
+generate sign key (RSA or DSA).
+.sp
+Generate a new sign key of the designated type, obsoleting any
+that may exist. By default, the program uses the host key as the
+sign key.
+.It Fl s Ar host@group , Fl \-subject\-name Ns = Ns Ar host@group
+set host and optionally group name.
+.sp
+Set the Autokey host name, and optionally, group name specified
+following an '\fB@\fP' character. The host name is used in the file
+name of generated host and signing certificates, without the
+group name. The host name, and if provided, group name are used
+in \fBhost@group\fP form for the host certificate's subject and issuer
+fields. Specifying '\fB\-s @group\fP' is allowed, and results in
+leaving the host name unchanged while appending \fB@group\fP to the
+subject and issuer fields, as with \fB\-i group\fP. The group name, or
+if not provided, the host name are also used in the file names
+of IFF, GQ, and MV client parameter files.
+.It Fl T , Fl \-trusted\-cert
+trusted certificate (TC scheme).
+.sp
+Generate a trusted certificate. By default, the program generates
+a non\-trusted certificate.
+.It Fl V Ar num , Fl \-mv\-params Ns = Ns Ar num
+generate <num> MV parameters.
+This option takes an integer number as its argument.
+.sp
+Generate parameters and keys for the Mu\-Varadharajan (MV)
+identification scheme.
+.It Fl v Ar num , Fl \-mv\-keys Ns = Ns Ar num
+update <num> MV keys.
+This option takes an integer number as its argument.
+.sp
+This option has not been fully documented.
+.It Fl \&? , Fl \-help
+Display usage information and exit.
+.It Fl \&! , Fl \-more\-help
+Pass the extended usage information through a pager.
+.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
+Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+The command will exit after updating the config file.
+.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
+Load options from \fIcfgfile\fP.
+The \fIno\-load\-opts\fP form will disable the loading
+of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
+out of order.
+.It Fl \-version Op Brq Ar v|c|n
+Output version of program and exit. The default mode is `v', a simple
+version. The `c' mode will print copyright information and `n' will
+print the full copyright notice.
+.El
+.Sh "OPTION PRESETS"
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s) and values from
+environment variables named:
+.nf
+ \fBNTP_KEYGEN_<option\-name>\fP or \fBNTP_KEYGEN\fP
+.fi
+.ad
+The environmental presets take precedence (are processed later than)
+the configuration files.
+The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
+If any of these are directories, then the file \fI.ntprc\fP
+is searched for within those directories.
+.Sh USAGE
+The
+.Fl p Ar password
+option specifies the write password and
+.Fl q Ar password
+option the read password for previously encrypted files.
+The
+.Nm
+program prompts for the password if it reads an encrypted file
+and the password is missing or incorrect.
+If an encrypted file is read successfully and
+no write password is specified, the read password is used
+as the write password by default.
+.Sh "ENVIRONMENT"
+See \fBOPTION PRESETS\fP for configuration environment variables.
+.Sh "FILES"
+See \fBOPTION PRESETS\fP for configuration files.
+.Sh "EXIT STATUS"
+One of the following exit values will be returned:
+.Bl -tag
+.It 0 " (EXIT_SUCCESS)"
+Successful program execution.
+.It 1 " (EXIT_FAILURE)"
+The operation failed or the command syntax was not valid.
+.It 66 " (EX_NOINPUT)"
+A specified configuration file could not be loaded.
+.It 70 " (EX_SOFTWARE)"
+libopts had an internal operational error. Please report
+it to autogen\-users@lists.sourceforge.net. Thank you.
+.El
+.Sh "AUTHORS"
+The University of Delaware
+.Sh "COPYRIGHT"
+Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
+This program is released under the terms of the NTP license, <http://ntp.org/license>.
+.Sh BUGS
+It can take quite a while to generate some cryptographic values,
+from one to several minutes with modern architectures
+such as UltraSPARC and up to tens of minutes to an hour
+with older architectures such as SPARC IPC.
+.Pp
+Please report bugs to http://bugs.ntp.org .
+.Pp
+Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
+.Sh NOTES
+Portions of this document came from FreeBSD.
+.Pp
+This manual page was \fIAutoGen\fP\-erated from the \fBntp\-keygen\fP
+option definitions.
diff --git a/util/ntp-keygen.texi b/util/ntp-keygen.texi
new file mode 100644
index 0000000..92cec48
--- /dev/null
+++ b/util/ntp-keygen.texi
@@ -0,0 +1,307 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename ntp-keygen.info
+@settitle Ntp-keygen User's Manual
+@include ../sntp/include/version.texi
+@paragraphindent 2
+@c %**end of header
+
+@ifinfo
+This file documents the use of the NTP Project's @code{ntp-keygen}
+program, which generates various keys for @code{ntpd},
+@end ifinfo
+
+@direntry
+* ntp-keygen: (ntp-keygen). NTP Key Generation
+@end direntry
+
+@titlepage
+@title NTP Key Generation User's Manual
+@subtitle ntp-keygen, version @value{VERSION}, @value{UPDATED}
+@c @author Max @email{foo@ntp.org}
+@end titlepage
+
+@c @page
+@c @vskip 0pt plus 1filll
+
+@shortcontents
+
+@menu
+* Description::
+* ntp-keygen Invocation:: Invoking ntp-keygen
+* Running the Program::
+* Random Seed File::
+* Cryptographic Data Files::
+@end menu
+
+@node Top, Description, (dir), (dir)
+@top NTP Key Generation Program User Manual
+
+This document describes the use of the NTP Project's @code{ntp-keygen}
+program, that generates cryptographic data files used by the NTPv4
+authentication and identity schemes.
+It can generate message digest keys used in symmetric key cryptography and,
+if the OpenSSL software
+library has been installed, it can generate host keys, sign keys,
+certificates, and identity keys and parameters used by the Autokey
+public key cryptography.
+The message digest keys file is generated in a
+format compatible with NTPv3.
+All other files are in PEM-encoded
+printable ASCII format so they can be embedded as MIME attachments in
+mail to other sites.
+
+This document applies to version @value{VERSION} of @code{ntp-keygen}.
+
+@node Description, Running the Program, Top, Top
+@comment node-name, next, previous, up
+@section Description
+
+This program generates cryptographic data files used by the NTPv4
+authentication and identity schemes. It can generate message digest
+keys used in symmetric key cryptography and, if the OpenSSL software
+library has been installed, it can generate host keys, sign keys,
+certificates, and identity keys and parameters used by the Autokey
+public key cryptography. The message digest keys file is generated in a
+format compatible with NTPv3. All other files are in PEM-encoded
+printable ASCII format so they can be embedded as MIME attachments in
+mail to other sites.
+
+When used to generate message digest keys, the program produces a file
+containing ten pseudo-random printable ASCII strings suitable for the
+MD5 message digest algorithm included in the distribution.
+If the
+OpenSSL library is installed, it produces an additional ten hex-encoded
+random bit strings suitable for the SHA1 and other message digest
+algorithms.
+The message digest keys file must be distributed and stored
+using secure means beyond the scope of NTP itself.
+Besides the keys
+used for ordinary NTP associations, additional keys can be defined as
+passwords for the ntpq and ntpdc utility programs.
+
+The remaining generated files are compatible with other OpenSSL
+applications and other Public Key Infrastructure (PKI) resources.
+Certificates generated by this program are compatible with extant
+industry practice, although some users might find the interpretation of
+X509v3 extension fields somewhat liberal.
+However, the identity keys
+are probably not compatible with anything other than Autokey.
+
+Some files used by this program are encrypted using a private password.
+The @code{-p} option specifies the password for local encrypted files and the
+@code{-q} option the password for encrypted files sent to remote sites.
+If no password is specified, the host name returned by the Unix
+@code{gethostname()} function, normally the DNS name of the host, is used.
+
+The @kbd{pw} option of the @code{crypto} configuration command
+specifies the read password for previously encrypted local files.
+This must match the local password used by this program.
+If not specified, the host name is used.
+Thus, if files are generated by this program without password,
+they can be read back by ntpd without password, but only on the same
+host.
+
+Normally, encrypted files for each host are generated by that host and
+used only by that host, although exceptions exist as noted later on
+this page.
+The symmetric keys file, normally called @code{ntp.keys}, is
+usually installed in @code{/etc}.
+Other files and links are usually installed
+in @code{/usr/local/etc}, which is normally in a shared filesystem in
+NFS-mounted networks and cannot be changed by shared clients.
+The location of the keys directory can be changed by the keysdir
+configuration command in such cases.
+Normally, this is in @code{/etc}.
+
+This program directs commentary and error messages to the standard
+error stream @code{stderr} and remote files to the standard output stream
+@code{stdout} where they can be piped to other applications or redirected to
+files.
+The names used for generated files and links all begin with the
+string @code{ntpkey} and include the file type,
+generating host and filestamp,
+as described in the @ref{Cryptographic Data Files} section below.
+
+@node Running the Program, Random Seed File, Description, Top
+@comment node-name, next, previous, up
+@section Running the Program
+
+To test and gain experience with Autokey concepts, log in as root and
+change to the keys directory, usually @code{/usr/local/etc}.
+When run for the
+first time, or if all files with names beginning @code{ntpkey}] have been
+removed, use the @code{ntp-keygen} command without arguments to generate a
+default RSA host key and matching RSA-MD5 certificate with expiration
+date one year hence.
+If run again without options, the program uses the
+existing keys and parameters and generates only a new certificate with
+new expiration date one year hence.
+
+Run the command on as many hosts as necessary.
+Designate one of them as the trusted host (TH) using @code{ntp-keygen}
+with the @code{-T} option and configure
+it to synchronize from reliable Internet servers.
+Then configure the other hosts to synchronize to the TH directly or indirectly.
+A certificate trail is created when Autokey asks the immediately
+ascendant host towards the TH to sign its certificate, which is then
+provided to the immediately descendant host on request.
+All group hosts should have acyclic certificate trails ending on the TH.
+
+The host key is used to encrypt the cookie when required and so must be
+RSA type.
+By default, the host key is also the sign key used to encrypt signatures.
+A different sign key can be assigned using the @code{-S} option
+and this can be either RSA or DSA type.
+By default, the signature
+message digest type is MD5, but any combination of sign key type and
+message digest type supported by the OpenSSL library can be specified
+using the @code{-c} option.
+
+The rules say cryptographic media should be generated with proventic
+filestamps, which means the host should already be synchronized before
+this program is run.
+This of course creates a chicken-and-egg problem
+when the host is started for the first time.
+Accordingly, the host time
+should be set by some other means, such as eyeball-and-wristwatch, at
+least so that the certificate lifetime is within the current year.
+After that and when the host is synchronized to a proventic source, the
+certificate should be re-generated.
+
+Additional information on trusted groups and identity schemes is on the
+Autokey Public-Key Authentication page.
+
+@include invoke-ntp-keygen.texi
+
+@node Random Seed File, Cryptographic Data Files, Running the Program, Top
+@comment node-name, next, previous, up
+@section Random Seed File
+
+All cryptographically sound key generation schemes must have means to
+randomize the entropy seed used to initialize the internal
+pseudo-random number generator used by the OpenSSL library routines.
+If a site supports ssh, it is very likely that means to do this are
+already available.
+The entropy seed used by the OpenSSL library is contained in a file,
+usually called @code{.rnd}, which must be available when
+starting the @code{ntp-keygen} program or @code{ntpd} daemon.
+
+The OpenSSL library looks for the file using the path specified by the
+@code{RANDFILE} environment variable in the user home directory, whether root
+or some other user.
+If the @code{RANDFILE} environment variable is not
+present, the library looks for the @code{.rnd} file in the user home
+directory.
+Since both the @code{ntp-keygen} program and @code{ntpd} daemon must run
+as root, the logical place to put this file is in @code{/.rnd} or
+@code{/root/.rnd}.
+If the file is not available or cannot be written, the program exits
+with a message to the system log.
+
+@node Cryptographic Data Files, , Random Seed File, Top
+@comment node-name, next, previous, up
+@section Cryptographic Data Files
+
+File and link names are in the @code{form ntpkey_key_name.fstamp},
+where @code{key} is the key or parameter type,
+@code{name} is the host or group name and
+@code{fstamp} is the filestamp (NTP seconds) when the file was created).
+By convention, key names in generated file names include both upper and
+lower case characters, while key names in generated link names include
+only lower case characters. The filestamp is not used in generated link
+names.
+
+The key name is a string defining the cryptographic key type.
+Key types include public/private keys host and sign, certificate cert
+and several challenge/response key types.
+By convention, client files used for
+challenges have a par subtype, as in the IFF challenge IFFpar, while
+server files for responses have a key subtype, as in the GQ response
+GQkey.
+
+All files begin with two nonencrypted lines. The first line contains
+the file name in the format @code{ntpkey_key_host.fstamp}.
+The second line contains the datestamp in conventional Unix date format.
+Lines beginning with @code{#} are ignored.
+
+The remainder of the file contains cryptographic data encoded first
+using ASN.1 rules, then encrypted using the DES-CBC algorithm with
+given password and finally written in PEM-encoded printable ASCII text
+preceded and followed by MIME content identifier lines.
+
+The format of the symmetric keys file, ordinarily named @code{ntp.keys},
+is somewhat different than the other files in the interest of backward
+compatibility.
+Ordinarily, the file is generated by this program, but
+it can be constructed and edited using an ordinary text editor.
+
+@example
+# ntpkey_MD5key_hms.local.3564038757
+# Sun Dec 9 02:45:57 2012
+
+ 1 MD5 "]!ghT%O;3)WJ,/Nc:>I # MD5 key
+ 2 MD5 lu+H^tF46BKR-6~p{V_5 # MD5 key
+ 3 MD5 :lnoVsE%Y}z*avh%EtNC # MD5 key
+ 4 MD5 |fdZrf0sF~@PHZ;w-i^V # MD5 key
+ 5 MD5 IyAG>O"}y"LmCRS!*bHC # MD5 key
+ 6 MD5 ">e\A@>hT/661ri52,,H # MD5 key
+ 7 MD5 c9x=M'CfLxax9v)PV-si # MD5 key
+ 8 MD5 E|=jvFVov?Bn|Ev=&aK\ # MD5 key
+ 9 MD5 T!c4UT&`(m$+m+B6,`Q0 # MD5 key
+10 MD5 JVF/1=)=IFbHbJQz..Cd # MD5 key
+11 SHA1 6dea311109529e436c2b4fccae9bc753c16d1b48 # SHA1 key
+12 SHA1 7076f373d86c4848c59ff8046e49cb7d614ec394 # SHA1 key
+13 SHA1 5f48b1b60591eb01b7cf1d33b7774f08d20262d3 # SHA1 key
+14 SHA1 eed5ab9d9497319ec60cf3781d52607e76720178 # SHA1 key
+15 SHA1 f283562611a04c964da8126296f5f8e58c3f85de # SHA1 key
+16 SHA1 1930da171297dd63549af50b29449de17dcf341f # SHA1 key
+17 SHA1 fee892110358cd4382322b889869e750db8e8a8f # SHA1 key
+18 SHA1 b5520c9fadd7ad3fd8bfa061c8821b65d029bb37 # SHA1 key
+19 SHA1 8c74fb440ec80f453ec6aaa62b9baed0ab723b92 # SHA1 key
+20 SHA1 6bc05f734306a189326000970c19b3910f403795 # SHA1 key
+@end example
+
+ Figure 1. Typical Symmetric Key File
+
+Figure 1 shows a typical symmetric keys file used by the reference
+implementation.
+Each line of the file contains three fields, first an
+integer between 1 and 65534, inclusive, representing the key identifier
+used in the server and peer configuration commands.
+Next is the key type for the message digest algorithm,
+which in the absence of the
+OpenSSL library must be MD5 to designate the MD5 message digest
+algorithm.
+If the OpenSSL library is installed, the key type can be any
+message digest algorithm supported by that library.
+However, if
+compatibility with FIPS 140-2 is required, the key type must be either
+SHA or SHA1.
+The key type can be changed using an ASCII text editor.
+
+An MD5 key consists of a printable ASCII string less than or equal to
+16 characters and terminated by whitespace or a # character.
+An OpenSSL
+key consists of a hex-encoded ASCII string of 40 characters, which is
+truncated as necessary.
+
+Note that the keys used by the @code{ntpq} and @code{ntpdc} programs are
+checked against passwords requested by the programs and entered by hand,
+so it
+is generally appropriate to specify these keys in human readable ASCII
+format.
+
+The @code{ntp-keygen} program generates a MD5 symmetric keys file
+@code{ntpkey_MD5key_hostname.filestamp}.
+Since the file contains private
+shared keys, it should be visible only to root and distributed by
+secure means to other subnet hosts.
+The NTP daemon loads the file @code{ntp.keys}, so @code{ntp-keygen}
+installs a soft link from this name to the generated file.
+Subsequently, similar soft links must be installed by
+manual or automated means on the other subnet hosts.
+While this file is
+not used with the Autokey Version 2 protocol, it is needed to
+authenticate some remote configuration commands used by the @code{ntpq} and
+@code{ntpdc} utilities.
diff --git a/util/ntptime.c b/util/ntptime.c
new file mode 100644
index 0000000..dd5605c
--- /dev/null
+++ b/util/ntptime.c
@@ -0,0 +1,474 @@
+/*
+ * NTP test program
+ *
+ * This program tests to see if the NTP user interface routines
+ * ntp_gettime() and ntp_adjtime() have been implemented in the kernel.
+ * If so, each of these routines is called to display current timekeeping
+ * data.
+ *
+ * For more information, see the README.kern file in the doc directory
+ * of the xntp3 distribution.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include "ntp_fp.h"
+#include "timevalops.h"
+#include "ntp_syscall.h"
+#include "ntp_stdlib.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+#include <setjmp.h>
+
+#ifdef NTP_SYSCALLS_STD
+# ifndef SYS_DECOSF1
+# define BADCALL -1 /* this is supposed to be a bad syscall */
+# endif /* SYS_DECOSF1 */
+#endif
+
+#ifdef HAVE_STRUCT_NTPTIMEVAL_TIME_TV_NSEC
+#define tv_frac_sec tv_nsec
+#else
+#define tv_frac_sec tv_usec
+#endif
+
+
+#define TIMEX_MOD_BITS \
+"\20\1OFFSET\2FREQUENCY\3MAXERROR\4ESTERROR\5STATUS\6TIMECONST\
+\13PLL\14FLL\15MICRO\16NANO\17CLKB\20CLKA"
+
+#define TIMEX_STA_BITS \
+"\20\1PLL\2PPSFREQ\3PPSTIME\4FLL\5INS\6DEL\7UNSYNC\10FREQHOLD\
+\11PPSSIGNAL\12PPSJITTER\13PPSWANDER\14PPSERROR\15CLOCKERR\
+\16NANO\17MODE\20CLK"
+
+#define SCALE_FREQ 65536 /* frequency scale */
+
+/*
+ * These constants are used to round the time stamps computed from
+ * a struct timeval to the microsecond (more or less). This keeps
+ * things neat.
+ */
+#define TS_MASK 0xfffff000 /* mask to usec, for time stamps */
+#define TS_ROUNDBIT 0x00000800 /* round at this bit */
+
+/*
+ * Function prototypes
+ */
+const char * sprintb (u_int, const char *);
+const char * timex_state (int);
+
+#ifdef SIGSYS
+void pll_trap (int);
+
+static struct sigaction newsigsys; /* new sigaction status */
+static struct sigaction sigsys; /* current sigaction status */
+static sigjmp_buf env; /* environment var. for pll_trap() */
+#endif
+
+static volatile int pll_control; /* (0) daemon, (1) kernel loop */
+static volatile int status; /* most recent status bits */
+static volatile int flash; /* most recent ntp_adjtime() bits */
+char* progname;
+static char optargs[] = "MNT:cde:f:hm:o:rs:t:";
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ extern int ntp_optind;
+ extern char *ntp_optarg;
+#ifdef SUBST_ADJTIMEX
+ struct timex ntv;
+#else
+ struct ntptimeval ntv;
+#endif
+ struct timeval tv;
+ struct timex ntx, _ntx;
+ int times[20];
+ double ftemp, gtemp, htemp;
+ long time_frac; /* ntv.time.tv_frac_sec (us/ns) */
+ l_fp ts;
+ volatile unsigned ts_mask = TS_MASK; /* defaults to 20 bits (us) */
+ volatile unsigned ts_roundbit = TS_ROUNDBIT; /* defaults to 20 bits (us) */
+ volatile int fdigits = 6; /* fractional digits for us */
+ int c;
+ int errflg = 0;
+ int cost = 0;
+ volatile int rawtime = 0;
+
+ ZERO(ntx);
+ progname = argv[0];
+ while ((c = ntp_getopt(argc, argv, optargs)) != EOF) {
+ switch (c) {
+#ifdef MOD_MICRO
+ case 'M':
+ ntx.modes |= MOD_MICRO;
+ break;
+#endif
+#ifdef MOD_NANO
+ case 'N':
+ ntx.modes |= MOD_NANO;
+ break;
+#endif
+#ifdef NTP_API
+# if NTP_API > 3
+ case 'T':
+ ntx.modes = MOD_TAI;
+ ntx.constant = atoi(ntp_optarg);
+ break;
+# endif
+#endif
+ case 'c':
+ cost++;
+ break;
+
+ case 'e':
+ ntx.modes |= MOD_ESTERROR;
+ ntx.esterror = atoi(ntp_optarg);
+ break;
+
+ case 'f':
+ ntx.modes |= MOD_FREQUENCY;
+ ntx.freq = (long)(atof(ntp_optarg) * SCALE_FREQ);
+ break;
+
+ case 'm':
+ ntx.modes |= MOD_MAXERROR;
+ ntx.maxerror = atoi(ntp_optarg);
+ break;
+
+ case 'o':
+ ntx.modes |= MOD_OFFSET;
+ ntx.offset = atoi(ntp_optarg);
+ break;
+
+ case 'r':
+ rawtime++;
+ break;
+
+ case 's':
+ ntx.modes |= MOD_STATUS;
+ ntx.status = atoi(ntp_optarg);
+ if (ntx.status < 0 || ntx.status >= 0x100)
+ errflg++;
+ break;
+
+ case 't':
+ ntx.modes |= MOD_TIMECONST;
+ ntx.constant = atoi(ntp_optarg);
+ break;
+
+ default:
+ errflg++;
+ }
+ }
+ if (errflg || (ntp_optind != argc)) {
+ fprintf(stderr,
+ "usage: %s [-%s]\n\n\
+%s%s%s\
+-c display the time taken to call ntp_gettime (us)\n\
+-e esterror estimate of the error (us)\n\
+-f frequency Frequency error (-500 .. 500) (ppm)\n\
+-h display this help info\n\
+-m maxerror max possible error (us)\n\
+-o offset current offset (ms)\n\
+-r print the unix and NTP time raw\n\
+-s status Set the status bits\n\
+-t timeconstant log2 of PLL time constant (0 .. %d)\n",
+ progname, optargs,
+#ifdef MOD_MICRO
+"-M switch to microsecond mode\n",
+#else
+"",
+#endif
+#ifdef MOD_NANO
+"-N switch to nanosecond mode\n",
+#else
+"",
+#endif
+#ifdef NTP_API
+# if NTP_API > 3
+"-T tai_offset set TAI offset\n",
+# else
+"",
+# endif
+#else
+"",
+#endif
+ MAXTC);
+ exit(2);
+ }
+
+#ifdef SIGSYS
+ /*
+ * Test to make sure the sigaction() works in case of invalid
+ * syscall codes.
+ */
+ newsigsys.sa_handler = pll_trap;
+ newsigsys.sa_flags = 0;
+ if (sigaction(SIGSYS, &newsigsys, &sigsys)) {
+ perror("sigaction() fails to save SIGSYS trap");
+ exit(1);
+ }
+#endif /* SIGSYS */
+
+#ifdef BADCALL
+ /*
+ * Make sure the trapcatcher works.
+ */
+ pll_control = 1;
+#ifdef SIGSYS
+ if (sigsetjmp(env, 1) == 0) {
+#endif
+ status = syscall(BADCALL, &ntv); /* dummy parameter */
+ if ((status < 0) && (errno == ENOSYS))
+ --pll_control;
+#ifdef SIGSYS
+ }
+#endif
+ if (pll_control)
+ printf("sigaction() failed to catch an invalid syscall\n");
+#endif /* BADCALL */
+
+ if (cost) {
+#ifdef SIGSYS
+ if (sigsetjmp(env, 1) == 0) {
+#endif
+ for (c = 0; c < COUNTOF(times); c++) {
+ status = ntp_gettime(&ntv);
+ if ((status < 0) && (errno == ENOSYS))
+ --pll_control;
+ if (pll_control < 0)
+ break;
+ times[c] = ntv.time.tv_frac_sec;
+ }
+#ifdef SIGSYS
+ }
+#endif
+ if (pll_control >= 0) {
+ printf("[ us %06d:", times[0]);
+ for (c = 1; c < COUNTOF(times); c++)
+ printf(" %d", times[c] - times[c - 1]);
+ printf(" ]\n");
+ }
+ }
+#ifdef SIGSYS
+ if (sigsetjmp(env, 1) == 0) {
+#endif
+ status = ntp_gettime(&ntv);
+ if ((status < 0) && (errno == ENOSYS))
+ --pll_control;
+#ifdef SIGSYS
+ }
+#endif
+ _ntx.modes = 0; /* Ensure nothing is set */
+#ifdef SIGSYS
+ if (sigsetjmp(env, 1) == 0) {
+#endif
+ status = ntp_adjtime(&_ntx);
+ if ((status < 0) && (errno == ENOSYS))
+ --pll_control;
+ flash = _ntx.status;
+#ifdef SIGSYS
+ }
+#endif
+ if (pll_control < 0) {
+ printf("NTP user interface routines are not configured in this kernel.\n");
+ goto lexit;
+ }
+
+ /*
+ * Fetch timekeeping data and display.
+ */
+ status = ntp_gettime(&ntv);
+ if (status < 0) {
+ perror("ntp_gettime() call fails");
+ } else {
+ printf("ntp_gettime() returns code %d (%s)\n",
+ status, timex_state(status));
+ time_frac = ntv.time.tv_frac_sec;
+#ifdef STA_NANO
+ if (flash & STA_NANO) {
+ ntv.time.tv_frac_sec /= 1000;
+ ts_mask = 0xfffffffc; /* 1/2^30 */
+ ts_roundbit = 0x00000002;
+ fdigits = 9;
+ }
+#endif
+ tv.tv_sec = ntv.time.tv_sec;
+ tv.tv_usec = ntv.time.tv_frac_sec;
+ TVTOTS(&tv, &ts);
+ ts.l_ui += JAN_1970;
+ ts.l_uf += ts_roundbit;
+ ts.l_uf &= ts_mask;
+ printf(" time %s, (.%0*d),\n",
+ prettydate(&ts), fdigits, (int)time_frac);
+ printf(" maximum error %lu us, estimated error %lu us",
+ (u_long)ntv.maxerror, (u_long)ntv.esterror);
+ if (rawtime)
+ printf(" ntptime=%x.%x unixtime=%x.%0*d %s",
+ (u_int)ts.l_ui, (u_int)ts.l_uf,
+ (int)ntv.time.tv_sec, fdigits,
+ (int)time_frac,
+ ctime((time_t *)&ntv.time.tv_sec));
+#if NTP_API > 3
+ printf(", TAI offset %ld\n", (long)ntv.tai);
+#else
+ printf("\n");
+#endif /* NTP_API */
+ }
+ status = ntp_adjtime(&ntx);
+ if (status < 0) {
+ perror((errno == EPERM) ?
+ "Must be root to set kernel values\nntp_adjtime() call fails" :
+ "ntp_adjtime() call fails");
+ } else {
+ flash = ntx.status;
+ printf("ntp_adjtime() returns code %d (%s)\n",
+ status, timex_state(status));
+ printf(" modes %s,\n", sprintb(ntx.modes, TIMEX_MOD_BITS));
+ ftemp = (double)ntx.offset;
+#ifdef STA_NANO
+ if (flash & STA_NANO)
+ ftemp /= 1000.0;
+#endif
+ printf(" offset %.3f", ftemp);
+ ftemp = (double)ntx.freq / SCALE_FREQ;
+ printf(" us, frequency %.3f ppm, interval %d s,\n",
+ ftemp, 1 << ntx.shift);
+ printf(" maximum error %lu us, estimated error %lu us,\n",
+ (u_long)ntx.maxerror, (u_long)ntx.esterror);
+ printf(" status %s,\n", sprintb((u_int)ntx.status, TIMEX_STA_BITS));
+ ftemp = (double)ntx.tolerance / SCALE_FREQ;
+ gtemp = (double)ntx.precision;
+#ifdef STA_NANO
+ if (flash & STA_NANO)
+ gtemp /= 1000.0;
+#endif
+ printf(
+ " time constant %lu, precision %.3f us, tolerance %.0f ppm,\n",
+ (u_long)ntx.constant, gtemp, ftemp);
+ if (ntx.shift == 0)
+ exit(0);
+ ftemp = (double)ntx.ppsfreq / SCALE_FREQ;
+ gtemp = (double)ntx.stabil / SCALE_FREQ;
+ htemp = (double)ntx.jitter;
+#ifdef STA_NANO
+ if (flash & STA_NANO)
+ htemp /= 1000.0;
+#endif
+ printf(
+ " pps frequency %.3f ppm, stability %.3f ppm, jitter %.3f us,\n",
+ ftemp, gtemp, htemp);
+ printf(" intervals %lu, jitter exceeded %lu, stability exceeded %lu, errors %lu.\n",
+ (u_long)ntx.calcnt, (u_long)ntx.jitcnt,
+ (u_long)ntx.stbcnt, (u_long)ntx.errcnt);
+ return 0;
+ }
+
+ /*
+ * Put things back together the way we found them.
+ */
+ lexit:
+#ifdef SIGSYS
+ if (sigaction(SIGSYS, &sigsys, (struct sigaction *)NULL)) {
+ perror("sigaction() fails to restore SIGSYS trap");
+ exit(1);
+ }
+#endif
+ exit(0);
+}
+
+#ifdef SIGSYS
+/*
+ * pll_trap - trap processor for undefined syscalls
+ */
+void
+pll_trap(
+ int arg
+ )
+{
+ pll_control--;
+ siglongjmp(env, 1);
+}
+#endif
+
+/*
+ * Print a value a la the %b format of the kernel's printf
+ */
+const char *
+sprintb(
+ u_int v,
+ const char * bits
+ )
+{
+ char *cp;
+ char *cplim;
+ int i;
+ int any;
+ char c;
+ static char buf[132];
+
+ if (bits != NULL && *bits == 8)
+ snprintf(buf, sizeof(buf), "0%o", v);
+ else
+ snprintf(buf, sizeof(buf), "0x%x", v);
+ cp = buf + strlen(buf);
+ cplim = buf + sizeof(buf);
+ if (bits != NULL) {
+ bits++;
+ *cp++ = ' ';
+ *cp++ = '(';
+ any = FALSE;
+ while ((i = *bits++) != 0) {
+ if (v & (1 << (i - 1))) {
+ if (any) {
+ *cp++ = ',';
+ if (cp >= cplim)
+ goto overrun;
+ }
+ any = TRUE;
+ for (; (c = *bits) > 32; bits++) {
+ *cp++ = c;
+ if (cp >= cplim)
+ goto overrun;
+ }
+ } else {
+ for (; *bits > 32; bits++)
+ continue;
+ }
+ }
+ *cp++ = ')';
+ if (cp >= cplim)
+ goto overrun;
+ }
+ *cp = '\0';
+ return buf;
+
+ overrun:
+ return "sprintb buffer too small";
+}
+
+const char * const timex_states[] = {
+ "OK", "INS", "DEL", "OOP", "WAIT", "ERROR"
+};
+
+const char *
+timex_state(
+ int s
+ )
+{
+ static char buf[32];
+
+ if (s >= 0 && s < COUNTOF(timex_states))
+ return timex_states[s];
+ snprintf(buf, sizeof(buf), "TIME-#%d", s);
+ return buf;
+}
diff --git a/util/pps-api.c b/util/pps-api.c
new file mode 100644
index 0000000..60c98b8
--- /dev/null
+++ b/util/pps-api.c
@@ -0,0 +1,100 @@
+/*
+
+Try to run this program to see what the PPS-API finds. You give it the
+device as argument and you may have to modify the pp.mode = BLA assignment.
+
+Poul-Henning
+
+*/
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <err.h>
+#include <sys/types.h>
+#include <time.h>
+#include <sys/timepps.h>
+#include <sys/termios.h>
+
+#define timespecsub(vvp, uvp) \
+ do { \
+ (vvp)->tv_sec -= (uvp)->tv_sec; \
+ (vvp)->tv_nsec -= (uvp)->tv_nsec; \
+ if ((vvp)->tv_nsec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_nsec += 1000000000; \
+ } \
+ } while (0)
+
+
+void
+Chew(struct timespec *tsa, struct timespec *tsc, unsigned sa, unsigned sc)
+{
+ static int idx;
+ struct timespec ts;
+
+ printf("%d.%09d ", tsa->tv_sec, tsa->tv_nsec);
+ printf("%d.%09d ", tsc->tv_sec, tsc->tv_nsec);
+ printf("%u %u ", sa, sc);
+
+ ts = *tsc;
+ timespecsub(&ts,tsa);
+ printf("%.9f ", ts.tv_sec + ts.tv_nsec / 1e9);
+ printf("\n");
+ fflush(stdout);
+}
+
+int
+main(int argc, char **argv)
+{
+ int fd;
+ pps_info_t pi;
+ pps_params_t pp;
+ pps_handle_t ph;
+ int i, mode;
+ u_int olda, oldc;
+ double d = 0;
+ struct timespec to;
+
+ if (argc < 2)
+ argv[1] = "/dev/cuaa1";
+ setbuf(stdout, 0);
+ fd = open(argv[1], O_RDONLY);
+ if (fd < 0)
+ err(1, argv[1]);
+ i = time_pps_create(fd, &ph);
+ if (i < 0)
+ err(1, "time_pps_create");
+
+ i = time_pps_getcap(ph, &mode);
+ if (i < 0)
+ err(1, "time_pps_getcap");
+
+ pp.mode = PPS_CAPTUREASSERT | PPS_ECHOASSERT;
+ pp.mode = PPS_CAPTUREBOTH;
+ /* pp.mode = PPS_CAPTUREASSERT; */
+
+ i = time_pps_setparams(ph, &pp);
+ if (i < 0)
+ err(1, "time_pps_setparams");
+
+ while (1) {
+ to.tv_nsec = 0;
+ to.tv_sec = 0;
+ i = time_pps_fetch(ph, PPS_TSFMT_TSPEC, &pi, &to);
+ if (i < 0)
+ err(1, "time_pps_fetch");
+ if (olda == pi.assert_sequence &&
+ oldc == pi.clear_sequence) {
+ usleep(10000);
+ continue;
+ }
+
+ Chew(&pi.assert_timestamp, &pi.clear_timestamp,
+ pi.assert_sequence, pi.clear_sequence);
+ olda = pi.assert_sequence;
+ oldc = pi.clear_sequence;
+ }
+
+ return(0);
+}
diff --git a/util/precision.c b/util/precision.c
new file mode 100644
index 0000000..b1516b3
--- /dev/null
+++ b/util/precision.c
@@ -0,0 +1,171 @@
+#include "ntp_unixtime.h"
+
+#include <stdio.h>
+
+#define DEFAULT_SYS_PRECISION -99
+
+int default_get_resolution();
+int default_get_precision();
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ printf("log2(resolution) = %d, log2(precision) = %d\n",
+ default_get_resolution(),
+ default_get_precision());
+ return 0;
+}
+
+/* Find the resolution of the system clock by watching how the current time
+ * changes as we read it repeatedly.
+ *
+ * struct timeval is only good to 1us, which may cause problems as machines
+ * get faster, but until then the logic goes:
+ *
+ * If a machine has resolution (i.e. accurate timing info) > 1us, then it will
+ * probably use the "unused" low order bits as a counter (to force time to be
+ * a strictly increaing variable), incrementing it each time any process
+ * requests the time [[ or maybe time will stand still ? ]].
+ *
+ * SO: the logic goes:
+ *
+ * IF the difference from the last time is "small" (< MINSTEP)
+ * THEN this machine is "counting" with the low order bits
+ * ELIF this is not the first time round the loop
+ * THEN this machine *WAS* counting, and has now stepped
+ * ELSE this machine has resolution < time to read clock
+ *
+ * SO: if it exits on the first loop, assume "full accuracy" (1us)
+ * otherwise, take the log2(observered difference, rounded UP)
+ *
+ * MINLOOPS > 1 ensures that even if there is a STEP between the initial call
+ * and the first loop, it doesn't stop too early.
+ * Making it even greater allows MINSTEP to be reduced, assuming that the
+ * chance of MINSTEP-1 other processes getting in and calling gettimeofday
+ * between this processes's calls.
+ * Reducing MINSTEP may be necessary as this sets an upper bound for the time
+ * to actually call gettimeofday.
+ */
+
+#define DUSECS 1000000
+#define HUSECS (1024 * 1024)
+#define MINSTEP 5 /* some systems increment uS on each call */
+/* Don't use "1" as some *other* process may read too*/
+/*We assume no system actually *ANSWERS* in this time*/
+#define MAXSTEP 20000 /* maximum clock increment (us) */
+#define MINLOOPS 5 /* minimum number of step samples */
+#define MAXLOOPS HUSECS /* Assume precision < .1s ! */
+
+int
+default_get_resolution(void)
+{
+ struct timeval tp;
+ struct timezone tzp;
+ long last;
+ int i;
+ long diff;
+ long val;
+ int minsteps = MINLOOPS; /* need at least this many steps */
+
+ gettimeofday(&tp, &tzp);
+ last = tp.tv_usec;
+ for (i = - --minsteps; i< MAXLOOPS; i++) {
+ gettimeofday(&tp, &tzp);
+ diff = tp.tv_usec - last;
+ if (diff < 0) diff += DUSECS;
+ if (diff > MINSTEP) if (minsteps-- <= 0) break;
+ last = tp.tv_usec;
+ }
+
+ printf("resolution = %ld usec after %d loop%s\n",
+ diff, i, (i==1) ? "" : "s");
+
+ diff = (diff *3)/2;
+ if (i >= MAXLOOPS) {
+ printf(
+ " (Boy this machine is fast ! %d loops without a step)\n",
+ MAXLOOPS);
+ diff = 1; /* No STEP, so FAST machine */
+ }
+ if (i == 0) {
+ printf(
+ " (The resolution is less than the time to read the clock -- Assume 1us)\n");
+ diff = 1; /* time to read clock >= resolution */
+ }
+ for (i=0, val=HUSECS; val>0; i--, val >>= 1) if (diff >= val) return i;
+ printf(" (Oh dear -- that wasn't expected ! I'll guess !)\n");
+ return DEFAULT_SYS_PRECISION /* Something's BUST, so lie ! */;
+}
+
+/* ===== Rest of this code lifted straight from xntpd/ntp_proto.c ! ===== */
+
+/*
+ * This routine calculates the differences between successive calls to
+ * gettimeofday(). If a difference is less than zero, the us field
+ * has rolled over to the next second, so we add a second in us. If
+ * the difference is greater than zero and less than MINSTEP, the
+ * clock has been advanced by a small amount to avoid standing still.
+ * If the clock has advanced by a greater amount, then a timer interrupt
+ * has occurred and this amount represents the precision of the clock.
+ * In order to guard against spurious values, which could occur if we
+ * happen to hit a fat interrupt, we do this for MINLOOPS times and
+ * keep the minimum value obtained.
+ */
+int
+default_get_precision(void)
+{
+ struct timeval tp;
+ struct timezone tzp;
+#ifdef HAVE_GETCLOCK
+ struct timespec ts;
+#endif
+ long last;
+ int i;
+ long diff;
+ long val;
+ long usec;
+
+ usec = 0;
+ val = MAXSTEP;
+#ifdef HAVE_GETCLOCK
+ (void) getclock(TIMEOFDAY, &ts);
+ tp.tv_sec = ts.tv_sec;
+ tp.tv_usec = ts.tv_nsec / 1000;
+#else /* not HAVE_GETCLOCK */
+ GETTIMEOFDAY(&tp, &tzp);
+#endif /* not HAVE_GETCLOCK */
+ last = tp.tv_usec;
+ for (i = 0; i < MINLOOPS && usec < HUSECS;) {
+#ifdef HAVE_GETCLOCK
+ (void) getclock(TIMEOFDAY, &ts);
+ tp.tv_sec = ts.tv_sec;
+ tp.tv_usec = ts.tv_nsec / 1000;
+#else /* not HAVE_GETCLOCK */
+ GETTIMEOFDAY(&tp, &tzp);
+#endif /* not HAVE_GETCLOCK */
+ diff = tp.tv_usec - last;
+ last = tp.tv_usec;
+ if (diff < 0)
+ diff += DUSECS;
+ usec += diff;
+ if (diff > MINSTEP) {
+ i++;
+ if (diff < val)
+ val = diff;
+ }
+ }
+ printf("precision = %ld usec after %d loop%s\n",
+ val, i, (i == 1) ? "" : "s");
+ if (usec >= HUSECS) {
+ printf(" (Boy this machine is fast ! usec was %ld)\n",
+ usec);
+ val = MINSTEP; /* val <= MINSTEP; fast machine */
+ }
+ diff = HUSECS;
+ for (i = 0; diff > val; i--)
+ diff >>= 1;
+ return (i);
+}
diff --git a/util/sht.c b/util/sht.c
new file mode 100644
index 0000000..dfd97ff
--- /dev/null
+++ b/util/sht.c
@@ -0,0 +1,260 @@
+/*
+ * sht.c - Testprogram for shared memory refclock
+ * read/write shared memory segment; see usage
+ */
+#include "config.h"
+
+#ifndef SYS_WINNT
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <stdio.h>
+#include <time.h>
+#include <unistd.h>
+#include <stdlib.h>
+#else
+#include <windows.h>
+#include <time.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <iostream.h>
+#define sleep(x) Sleep(x*1000)
+#endif
+#include <assert.h>
+
+struct shmTime {
+ int mode; /* 0 - if valid set
+ * use values,
+ * clear valid
+ * 1 - if valid set
+ * if count before and after read of values is equal,
+ * use values
+ * clear valid
+ */
+ volatile int count;
+ time_t clockTimeStampSec;
+ int clockTimeStampUSec;
+ time_t receiveTimeStampSec;
+ int receiveTimeStampUSec;
+ int leap;
+ int precision;
+ int nsamples;
+ volatile int valid;
+ unsigned clockTimeStampNSec; /* Unsigned ns timestamps */
+ unsigned receiveTimeStampNSec; /* Unsigned ns timestamps */
+};
+
+static struct shmTime *
+getShmTime (
+ int unit
+ )
+{
+#ifndef SYS_WINNT
+ int shmid=shmget (0x4e545030+unit, sizeof (struct shmTime), IPC_CREAT|0777);
+ if (shmid==-1) {
+ perror ("shmget");
+ exit (1);
+ }
+ else {
+ struct shmTime *p=(struct shmTime *)shmat (shmid, 0, 0);
+ if ((int)(long)p==-1) {
+ perror ("shmat");
+ p=0;
+ }
+ assert (p!=0);
+ return p;
+ }
+#else
+ char buf[10];
+ LPSECURITY_ATTRIBUTES psec=0;
+ snprintf (buf, sizeof(buf), "NTP%d", unit);
+ SECURITY_DESCRIPTOR sd;
+ SECURITY_ATTRIBUTES sa;
+ HANDLE shmid;
+
+ assert (InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION));
+ assert (SetSecurityDescriptorDacl(&sd,1,0,0));
+ sa.nLength=sizeof (SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor=&sd;
+ sa.bInheritHandle=0;
+ shmid=CreateFileMapping ((HANDLE)0xffffffff, 0, PAGE_READWRITE,
+ psec, sizeof (struct shmTime),buf);
+ if (!shmid) {
+ shmid=CreateFileMapping ((HANDLE)0xffffffff, 0, PAGE_READWRITE,
+ 0, sizeof (struct shmTime),buf);
+ cout <<"CreateFileMapping with psec!=0 failed"<<endl;
+ }
+
+ if (!shmid) {
+ char mbuf[1000];
+ FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
+ 0, GetLastError (), 0, mbuf, sizeof (mbuf), 0);
+ int x=GetLastError ();
+ cout <<"CreateFileMapping "<<buf<<":"<<mbuf<<endl;
+ exit (1);
+ }
+ else {
+ struct shmTime *p=(struct shmTime *) MapViewOfFile (shmid,
+ FILE_MAP_WRITE, 0, 0, sizeof (struct shmTime));
+ if (p==0) {
+ char mbuf[1000];
+ FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
+ 0, GetLastError (), 0, mbuf, sizeof (mbuf), 0);
+ cout <<"MapViewOfFile "<<buf<<":"<<mbuf<<endl;
+ exit (1);
+ }
+ return p;
+ }
+ return 0;
+#endif
+}
+
+
+int
+main (
+ int argc,
+ char *argv[]
+ )
+{
+ volatile struct shmTime *p;
+ int unit;
+ char *argp;
+
+ if (argc<=1) {
+ usage:
+ printf ("usage: %s [uu:]{r[c][l]|w|snnn}\n",argv[0]);
+ printf (" uu use clock unit uu (default: 2)\n");
+ printf (" r read shared memory\n");
+ printf (" c clear valid-flag\n");
+ printf (" l loop (so, rcl will read and clear in a loop\n");
+ printf (" w write shared memory with current time\n");
+ printf (" snnnn set nsamples to nnn\n");
+ printf (" lnnnn set leap to nnn\n");
+ printf (" pnnnn set precision to -nnn\n");
+ exit (0);
+ }
+
+ srand(time(NULL));
+
+ unit = strtoul(argv[1], &argp, 10);
+ if (argp == argv[1])
+ unit = 2;
+ else if (*argp == ':')
+ argp++;
+ else
+ goto usage;
+
+ p=getShmTime(unit);
+ switch (*argp) {
+ case 's':
+ p->nsamples=atoi(argp+1);
+ break;
+
+ case 'l':
+ p->leap=atoi(argp+1);
+ break;
+
+ case 'p':
+ p->precision=-atoi(argp+1);
+ break;
+
+ case 'r': {
+ int clear=0;
+ int loop=0;
+ printf ("reader\n");
+ while (*++argp) {
+ switch (*argp) {
+ case 'l': loop=1; break;
+ case 'c': clear=1; break;
+ default : goto usage;
+ }
+ }
+again:
+ printf ("mode=%d, count=%d, clock=%ld.%09u, rec=%ld.%09u,\n",
+ p->mode,p->count,
+ (long)p->clockTimeStampSec,p->clockTimeStampNSec,
+ (long)p->receiveTimeStampSec,p->receiveTimeStampNSec);
+ printf (" leap=%d, precision=%d, nsamples=%d, valid=%d\n",
+ p->leap, p->precision, p->nsamples, p->valid);
+ if (!p->valid)
+ printf ("***\n");
+ if (clear) {
+ p->valid=0;
+ printf ("cleared\n");
+ }
+ if (loop) {
+ sleep (1);
+ goto again;
+ }
+ break;
+ }
+
+ case 'w': {
+ /* To show some life action, we read the system
+ * clock and use a bit of fuzz from 'random()' to get a
+ * bit of wobbling into the values (so we can observe a
+ * certain jitter!)
+ */
+ time_t clk_sec, rcv_sec;
+ uint clk_frc, rcv_frc;
+
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME)
+
+ /* Here we have a high-resolution system clock, and
+ * we're not afraid to use it!
+ */
+ struct timespec tmptime;
+ if (0 == clock_gettime(CLOCK_REALTIME, &tmptime)) {
+ rcv_sec = tmptime.tv_sec;
+ rcv_frc = (uint)tmptime.tv_nsec;
+ }
+ else
+#endif
+ {
+ time(&rcv_sec);
+ rcv_frc = (uint)random() % 1000000000u;
+ }
+ /* add a wobble of ~3.5msec to the clock time */
+ clk_sec = rcv_sec;
+ clk_frc = rcv_frc + (uint)(random()%7094713 - 3547356);
+ /* normalise result -- the SHM driver is picky! */
+ while ((int)clk_frc < 0) {
+ clk_frc += 1000000000;
+ clk_sec -= 1;
+ }
+ while ((int)clk_frc >= 1000000000) {
+ clk_frc -= 1000000000;
+ clk_sec += 1;
+ }
+
+ /* Most 'real' time sources would create a clock
+ * (reference) time stamp where the fraction is zero,
+ * but that's not an actual requirement. So we show how
+ * to deal with the time stamps in general; changing the
+ * behaviour for cases where the fraction of the
+ * clock time is zero should be trivial.
+ */
+ printf ("writer\n");
+ p->mode=0;
+ if (!p->valid) {
+ p->clockTimeStampSec = clk_sec;
+ p->clockTimeStampUSec = clk_frc / 1000; /* truncate! */
+ p->clockTimeStampNSec = clk_frc;
+ p->receiveTimeStampSec = rcv_sec;
+ p->receiveTimeStampUSec = rcv_frc / 1000; /* truncate! */
+ p->receiveTimeStampNSec = rcv_frc;
+ printf ("%ld.%09u %ld.%09u\n",
+ (long)p->clockTimeStampSec , p->clockTimeStampNSec ,
+ (long)p->receiveTimeStampSec, p->receiveTimeStampNSec);
+ p->valid=1;
+ }
+ else {
+ printf ("p->valid still set\n"); /* not an error! */
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
diff --git a/util/testrs6000.c b/util/testrs6000.c
new file mode 100644
index 0000000..e4d939a
--- /dev/null
+++ b/util/testrs6000.c
@@ -0,0 +1,55 @@
+/* Checks for the RS/6000 AIX adjtime() bug, in which if a negative
+ * offset is given, the system gets messed up and never completes the
+ * adjustment. If the problem is fixed, this program will print the
+ * time, sit there for 10 seconds, and exit. If the problem isn't fixed,
+ * the program will print an occasional "result=nnnnnn" (the residual
+ * slew from adjtime()).
+ *
+ * Compile this with bsdcc and run it as root!
+ */
+#include <signal.h>
+#include <sys/time.h>
+#include <time.h>
+#include <stdio.h>
+
+int timeout();
+struct timeval adjustment, result;
+
+int
+main (
+ int argc,
+ char *argv[]
+ )
+{
+ struct itimerval value, oldvalue;
+ int i;
+ time_t curtime;
+
+ curtime = time(0);
+ printf("Starting: %s", ctime(&curtime));
+ value.it_interval.tv_sec = value.it_value.tv_sec = 1;
+ value.it_interval.tv_usec = value.it_value.tv_usec = 0;
+ adjustment.tv_sec = 0;
+ adjustment.tv_usec = -2000;
+ signal(SIGALRM, timeout);
+ setitimer(ITIMER_REAL, &value, &oldvalue);
+ for (i=0; i<10; i++) {
+ pause();
+ }
+}
+
+int
+timeout(
+ int sig,
+ int code,
+ struct sigcontext *scp
+ )
+{
+ signal (SIGALRM, timeout);
+ if (adjtime(&adjustment, &result))
+ printf("adjtime call failed\n");
+ if (result.tv_sec != 0 || result.tv_usec != 0) {
+ printf("result.u = %d.%06.6d ", (int) result.tv_sec,
+ (int) result.tv_usec);
+ }
+}
diff --git a/util/tg.c b/util/tg.c
new file mode 100644
index 0000000..8a96a81
--- /dev/null
+++ b/util/tg.c
@@ -0,0 +1,653 @@
+/*
+ * tg.c generate WWV or IRIG signals for test
+ */
+/*
+ * This program can generate audio signals that simulate the WWV/H
+ * broadcast timecode. Alternatively, it can generate the IRIG-B
+ * timecode commonly used to synchronize laboratory equipment. It is
+ * intended to test the WWV/H driver (refclock_wwv.c) and the IRIG
+ * driver (refclock_irig.c) in the NTP driver collection.
+ *
+ * Besides testing the drivers themselves, this program can be used to
+ * synchronize remote machines over audio transmission lines or program
+ * feeds. The program reads the time on the local machine and sets the
+ * initial epoch of the signal generator within one millisecond.
+ * Alernatively, the initial epoch can be set to an arbitrary time. This
+ * is useful when searching for bugs and testing for correct response to
+ * a leap second in UTC. Note however, the ultimate accuracy is limited
+ * by the intrinsic frequency error of the codec sample clock, which can
+ # reach well over 100 PPM.
+ *
+ * The default is to route generated signals to the line output
+ * jack; the s option on the command line routes these signals to the
+ * internal speaker as well. The v option controls the speaker volume
+ * over the range 0-255. The signal generator by default uses WWV
+ * format; the h option switches to WWVH format and the i option
+ * switches to IRIG-B format.
+ *
+ * Once started the program runs continuously. The default initial epoch
+ * for the signal generator is read from the computer system clock when
+ * the program starts. The y option specifies an alternate epoch using a
+ * string yydddhhmmss, where yy is the year of century, ddd the day of
+ * year, hh the hour of day and mm the minute of hour. For instance,
+ * 1946Z on 1 January 2006 is 060011946. The l option lights the leap
+ * warning bit in the WWV/H timecode, so is handy to check for correct
+ * behavior at the next leap second epoch. The remaining options are
+ * specified below under the Parse Options heading. Most of these are
+ * for testing.
+ *
+ * During operation the program displays the WWV/H timecode (9 digits)
+ * or IRIG timecode (20 digits) as each new string is constructed. The
+ * display is followed by the BCD binary bits as transmitted. Note that
+ * the transmissionorder is low-order first as the frame is processed
+ * left to right. For WWV/H The leap warning L preceeds the first bit.
+ * For IRIG the on-time marker M preceeds the first (units) bit, so its
+ * code is delayed one bit and the next digit (tens) needs only three
+ * bits.
+ *
+ * The program has been tested with the Sun Blade 1500 running Solaris
+ * 10, but not yet with other machines. It uses no special features and
+ * should be readily portable to other hardware and operating systems.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/audio.h>
+#include <math.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+
+#define SECOND 8000 /* one second of 125-us samples */
+#define BUFLNG 400 /* buffer size */
+#define DEVICE "/dev/audio" /* default audio device */
+#define WWV 0 /* WWV encoder */
+#define IRIG 1 /* IRIG-B encoder */
+#define OFF 0 /* zero amplitude */
+#define LOW 1 /* low amplitude */
+#define HIGH 2 /* high amplitude */
+#define DATA0 200 /* WWV/H 0 pulse */
+#define DATA1 500 /* WWV/H 1 pulse */
+#define PI 800 /* WWV/H PI pulse */
+#define M2 2 /* IRIG 0 pulse */
+#define M5 5 /* IRIG 1 pulse */
+#define M8 8 /* IRIG PI pulse */
+
+/*
+ * Companded sine table amplitude 3000 units
+ */
+int c3000[] = {1, 48, 63, 70, 78, 82, 85, 89, 92, 94, /* 0-9 */
+ 96, 98, 99, 100, 101, 101, 102, 103, 103, 103, /* 10-19 */
+ 103, 103, 103, 103, 102, 101, 101, 100, 99, 98, /* 20-29 */
+ 96, 94, 92, 89, 85, 82, 78, 70, 63, 48, /* 30-39 */
+ 129, 176, 191, 198, 206, 210, 213, 217, 220, 222, /* 40-49 */
+ 224, 226, 227, 228, 229, 229, 230, 231, 231, 231, /* 50-59 */
+ 231, 231, 231, 231, 230, 229, 229, 228, 227, 226, /* 60-69 */
+ 224, 222, 220, 217, 213, 210, 206, 198, 191, 176}; /* 70-79 */
+/*
+ * Companded sine table amplitude 6000 units
+ */
+int c6000[] = {1, 63, 78, 86, 93, 98, 101, 104, 107, 110, /* 0-9 */
+ 112, 113, 115, 116, 117, 117, 118, 118, 119, 119, /* 10-19 */
+ 119, 119, 119, 118, 118, 117, 117, 116, 115, 113, /* 20-29 */
+ 112, 110, 107, 104, 101, 98, 93, 86, 78, 63, /* 30-39 */
+ 129, 191, 206, 214, 221, 226, 229, 232, 235, 238, /* 40-49 */
+ 240, 241, 243, 244, 245, 245, 246, 246, 247, 247, /* 50-59 */
+ 247, 247, 247, 246, 246, 245, 245, 244, 243, 241, /* 60-69 */
+ 240, 238, 235, 232, 229, 226, 221, 214, 206, 191}; /* 70-79 */
+
+/*
+ * Decoder operations at the end of each second are driven by a state
+ * machine. The transition matrix consists of a dispatch table indexed
+ * by second number. Each entry in the table contains a case switch
+ * number and argument.
+ */
+struct progx {
+ int sw; /* case switch number */
+ int arg; /* argument */
+};
+
+/*
+ * Case switch numbers
+ */
+#define DATA 0 /* send data (0, 1, PI) */
+#define COEF 1 /* send BCD bit */
+#define DEC 2 /* decrement to next digit */
+#define MIN 3 /* minute pulse */
+#define LEAP 4 /* leap warning */
+#define DUT1 5 /* DUT1 bits */
+#define DST1 6 /* DST1 bit */
+#define DST2 7 /* DST2 bit */
+
+/*
+ * WWV/H format (100-Hz, 9 digits, 1 m frame)
+ */
+struct progx progx[] = {
+ {MIN, 800}, /* 0 minute sync pulse */
+ {DATA, DATA0}, /* 1 */
+ {DST2, 0}, /* 2 DST2 */
+ {LEAP, 0}, /* 3 leap warning */
+ {COEF, 1}, /* 4 1 year units */
+ {COEF, 2}, /* 5 2 */
+ {COEF, 4}, /* 6 4 */
+ {COEF, 8}, /* 7 8 */
+ {DEC, DATA0}, /* 8 */
+ {DATA, PI}, /* 9 p1 */
+ {COEF, 1}, /* 10 1 minute units */
+ {COEF, 2}, /* 11 2 */
+ {COEF, 4}, /* 12 4 */
+ {COEF, 8}, /* 13 8 */
+ {DEC, DATA0}, /* 14 */
+ {COEF, 1}, /* 15 10 minute tens */
+ {COEF, 2}, /* 16 20 */
+ {COEF, 4}, /* 17 40 */
+ {COEF, 8}, /* 18 80 (not used) */
+ {DEC, PI}, /* 19 p2 */
+ {COEF, 1}, /* 20 1 hour units */
+ {COEF, 2}, /* 21 2 */
+ {COEF, 4}, /* 22 4 */
+ {COEF, 8}, /* 23 8 */
+ {DEC, DATA0}, /* 24 */
+ {COEF, 1}, /* 25 10 hour tens */
+ {COEF, 2}, /* 26 20 */
+ {COEF, 4}, /* 27 40 (not used) */
+ {COEF, 8}, /* 28 80 (not used) */
+ {DEC, PI}, /* 29 p3 */
+ {COEF, 1}, /* 30 1 day units */
+ {COEF, 2}, /* 31 2 */
+ {COEF, 4}, /* 32 4 */
+ {COEF, 8}, /* 33 8 */
+ {DEC, DATA0}, /* 34 not used */
+ {COEF, 1}, /* 35 10 day tens */
+ {COEF, 2}, /* 36 20 */
+ {COEF, 4}, /* 37 40 */
+ {COEF, 8}, /* 38 80 */
+ {DEC, PI}, /* 39 p4 */
+ {COEF, 1}, /* 40 100 day hundreds */
+ {COEF, 2}, /* 41 200 */
+ {COEF, 4}, /* 42 400 (not used) */
+ {COEF, 8}, /* 43 800 (not used) */
+ {DEC, DATA0}, /* 44 */
+ {DATA, DATA0}, /* 45 */
+ {DATA, DATA0}, /* 46 */
+ {DATA, DATA0}, /* 47 */
+ {DATA, DATA0}, /* 48 */
+ {DATA, PI}, /* 49 p5 */
+ {DUT1, 8}, /* 50 DUT1 sign */
+ {COEF, 1}, /* 51 10 year tens */
+ {COEF, 2}, /* 52 20 */
+ {COEF, 4}, /* 53 40 */
+ {COEF, 8}, /* 54 80 */
+ {DST1, 0}, /* 55 DST1 */
+ {DUT1, 1}, /* 56 0.1 DUT1 fraction */
+ {DUT1, 2}, /* 57 0.2 */
+ {DUT1, 4}, /* 58 0.4 */
+ {DATA, PI}, /* 59 p6 */
+ {DATA, DATA0}, /* 60 leap */
+};
+
+/*
+ * IRIG format except first frame (1000 Hz, 20 digits, 1 s frame)
+ */
+struct progx progy[] = {
+ {COEF, 1}, /* 0 1 units */
+ {COEF, 2}, /* 1 2 */
+ {COEF, 4}, /* 2 4 */
+ {COEF, 8}, /* 3 8 */
+ {DEC, M2}, /* 4 im */
+ {COEF, 1}, /* 5 10 tens */
+ {COEF, 2}, /* 6 20 */
+ {COEF, 4}, /* 7 40 */
+ {COEF, 8}, /* 8 80 */
+ {DEC, M8}, /* 9 pi */
+};
+
+/*
+ * IRIG format first frame (1000 Hz, 20 digits, 1 s frame)
+ */
+struct progx progz[] = {
+ {MIN, M8}, /* 0 pi (second) */
+ {COEF, 1}, /* 1 1 units */
+ {COEF, 2}, /* 2 2 */
+ {COEF, 4}, /* 3 4 */
+ {COEF, 8}, /* 4 8 */
+ {DEC, M2}, /* 5 im */
+ {COEF, 1}, /* 6 10 tens */
+ {COEF, 2}, /* 7 20 */
+ {COEF, 4}, /* 8 40 */
+ {DEC, M8}, /* 9 pi */
+};
+
+/*
+ * Forward declarations
+ */
+void sec(int); /* send second */
+void digit(int); /* encode digit */
+void peep(int, int, int); /* send cycles */
+void delay(int); /* delay samples */
+
+/*
+ * Global variables
+ */
+char buffer[BUFLNG]; /* output buffer */
+int bufcnt = 0; /* buffer counter */
+int second = 0; /* seconds counter */
+int fd; /* audio codec file descriptor */
+int tone = 1000; /* WWV sync frequency */
+int level = AUDIO_MAX_GAIN / 8; /* output level */
+int port = AUDIO_LINE_OUT; /* output port */
+int encode = WWV; /* encoder select */
+int leap = 0; /* leap indicator */
+int dst = 0; /* winter/summer time */
+int dut1 = 0; /* DUT1 correction (sign, magnitude) */
+int utc = 0; /* option epoch */
+
+/*
+ * Main program
+ */
+int
+main(
+ int argc, /* command line options */
+ char **argv /* poiniter to list of tokens */
+ )
+{
+ struct timeval tv; /* system clock at startup */
+ audio_info_t info; /* Sun audio structure */
+ struct tm *tm = NULL; /* structure returned by gmtime */
+ char device[50]; /* audio device */
+ char code[100]; /* timecode */
+ int rval, temp, arg, sw, ptr;
+ int minute, hour, day, year;
+ int i;
+
+ /*
+ * Parse options
+ */
+ strlcpy(device, DEVICE, sizeof(device));
+ year = 0;
+ while ((temp = getopt(argc, argv, "a:dhilsu:v:y:")) != -1) {
+ switch (temp) {
+
+ case 'a': /* specify audio device (/dev/audio) */
+ strlcpy(device, optarg, sizeof(device));
+ break;
+
+ case 'd': /* set DST for summer (WWV/H only) */
+ dst++;
+ break;
+
+ case 'h': /* select WWVH sync frequency */
+ tone = 1200;
+ break;
+
+ case 'i': /* select irig format */
+ encode = IRIG;
+ break;
+
+ case 'l': /* set leap warning bit (WWV/H only) */
+ leap++;
+ break;
+
+ case 's': /* enable speaker */
+ port |= AUDIO_SPEAKER;
+ break;
+
+ case 'u': /* set DUT1 offset (-7 to +7) */
+ sscanf(optarg, "%d", &dut1);
+ if (dut1 < 0)
+ dut1 = abs(dut1);
+ else
+ dut1 |= 0x8;
+ break;
+
+ case 'v': /* set output level (0-255) */
+ sscanf(optarg, "%d", &level);
+ break;
+
+ case 'y': /* set initial date and time */
+ sscanf(optarg, "%2d%3d%2d%2d", &year, &day,
+ &hour, &minute);
+ utc++;
+ break;
+
+ defult:
+ printf("invalid option %c\n", temp);
+ break;
+ }
+ }
+
+ /*
+ * Open audio device and set options
+ */
+ fd = open("/dev/audio", O_WRONLY);
+ if (fd <= 0) {
+ printf("audio open %s\n", strerror(errno));
+ exit(1);
+ }
+ rval = ioctl(fd, AUDIO_GETINFO, &info);
+ if (rval < 0) {
+ printf("audio control %s\n", strerror(errno));
+ exit(0);
+ }
+ info.play.port = port;
+ info.play.gain = level;
+ info.play.sample_rate = SECOND;
+ info.play.channels = 1;
+ info.play.precision = 8;
+ info.play.encoding = AUDIO_ENCODING_ULAW;
+ printf("port %d gain %d rate %d chan %d prec %d encode %d\n",
+ info.play.port, info.play.gain, info.play.sample_rate,
+ info.play.channels, info.play.precision,
+ info.play.encoding);
+ ioctl(fd, AUDIO_SETINFO, &info);
+
+ /*
+ * Unless specified otherwise, read the system clock and
+ * initialize the time.
+ */
+ if (!utc) {
+ gettimeofday(&tv, NULL);
+ tm = gmtime(&tv.tv_sec);
+ minute = tm->tm_min;
+ hour = tm->tm_hour;
+ day = tm->tm_yday + 1;
+ year = tm->tm_year % 100;
+ second = tm->tm_sec;
+
+ /*
+ * Delay the first second so the generator is accurately
+ * aligned with the system clock within one sample (125
+ * microseconds ).
+ */
+ delay(SECOND - tv.tv_usec * 8 / 1000);
+ }
+ memset(code, 0, sizeof(code));
+ switch (encode) {
+
+ /*
+ * For WWV/H and default time, carefully set the signal
+ * generator seconds number to agree with the current time.
+ */
+ case WWV:
+ printf("year %d day %d time %02d:%02d:%02d tone %d\n",
+ year, day, hour, minute, second, tone);
+ snprintf(code, sizeof(code), "%01d%03d%02d%02d%01d",
+ year / 10, day, hour, minute, year % 10);
+ printf("%s\n", code);
+ ptr = 8;
+ for (i = 0; i <= second; i++) {
+ if (progx[i].sw == DEC)
+ ptr--;
+ }
+ break;
+
+ /*
+ * For IRIG the signal generator runs every second, so requires
+ * no additional alignment.
+ */
+ case IRIG:
+ printf("sbs %x year %d day %d time %02d:%02d:%02d\n",
+ 0, year, day, hour, minute, second);
+ break;
+ }
+
+ /*
+ * Run the signal generator to generate new timecode strings
+ * once per minute for WWV/H and once per second for IRIG.
+ */
+ while(1) {
+
+ /*
+ * Crank the state machine to propagate carries to the
+ * year of century. Note that we delayed up to one
+ * second for alignment after reading the time, so this
+ * is the next second.
+ */
+ second = (second + 1) % 60;
+ if (second == 0) {
+ minute++;
+ if (minute >= 60) {
+ minute = 0;
+ hour++;
+ }
+ if (hour >= 24) {
+ hour = 0;
+ day++;
+ }
+
+ /*
+ * At year rollover check for leap second.
+ */
+ if (day >= (year & 0x3 ? 366 : 367)) {
+ if (leap) {
+ sec(DATA0);
+ printf("\nleap!");
+ leap = 0;
+ }
+ day = 1;
+ year++;
+ }
+ if (encode == WWV) {
+ snprintf(code, sizeof(code),
+ "%01d%03d%02d%02d%01d", year / 10,
+ day, hour, minute, year % 10);
+ printf("\n%s\n", code);
+ ptr = 8;
+ }
+ }
+ if (encode == IRIG) {
+ snprintf(code, sizeof(code),
+ "%04x%04d%06d%02d%02d%02d", 0, year, day,
+ hour, minute, second);
+ printf("%s\n", code);
+ ptr = 19;
+ }
+
+ /*
+ * Generate data for the second
+ */
+ switch(encode) {
+
+ /*
+ * The IRIG second consists of 20 BCD digits of width-
+ * modulateod pulses at 2, 5 and 8 ms and modulated 50
+ * percent on the 1000-Hz carrier.
+ */
+ case IRIG:
+ for (i = 0; i < 100; i++) {
+ if (i < 10) {
+ sw = progz[i].sw;
+ arg = progz[i].arg;
+ } else {
+ sw = progy[i % 10].sw;
+ arg = progy[i % 10].arg;
+ }
+ switch(sw) {
+
+ case COEF: /* send BCD bit */
+ if (code[ptr] & arg) {
+ peep(M5, 1000, HIGH);
+ peep(M5, 1000, LOW);
+ printf("1");
+ } else {
+ peep(M2, 1000, HIGH);
+ peep(M8, 1000, LOW);
+ printf("0");
+ }
+ break;
+
+ case DEC: /* send IM/PI bit */
+ ptr--;
+ printf(" ");
+ peep(arg, 1000, HIGH);
+ peep(10 - arg, 1000, LOW);
+ break;
+
+ case MIN: /* send data bit */
+ peep(arg, 1000, HIGH);
+ peep(10 - arg, 1000, LOW);
+ printf("M ");
+ break;
+ }
+ if (ptr < 0)
+ break;
+ }
+ printf("\n");
+ break;
+
+ /*
+ * The WWV/H second consists of 9 BCD digits of width-
+ * modulateod pulses 200, 500 and 800 ms at 100-Hz.
+ */
+ case WWV:
+ sw = progx[second].sw;
+ arg = progx[second].arg;
+ switch(sw) {
+
+ case DATA: /* send data bit */
+ sec(arg);
+ break;
+
+ case COEF: /* send BCD bit */
+ if (code[ptr] & arg) {
+ sec(DATA1);
+ printf("1");
+ } else {
+ sec(DATA0);
+ printf("0");
+ }
+ break;
+
+ case LEAP: /* send leap bit */
+ if (leap) {
+ sec(DATA1);
+ printf("L ");
+ } else {
+ sec(DATA0);
+ printf(" ");
+ }
+ break;
+
+ case DEC: /* send data bit */
+ ptr--;
+ sec(arg);
+ printf(" ");
+ break;
+
+ case MIN: /* send minute sync */
+ peep(arg, tone, HIGH);
+ peep(1000 - arg, tone, OFF);
+ break;
+
+ case DUT1: /* send DUT1 bits */
+ if (dut1 & arg)
+ sec(DATA1);
+ else
+ sec(DATA0);
+ break;
+
+ case DST1: /* send DST1 bit */
+ ptr--;
+ if (dst)
+ sec(DATA1);
+ else
+ sec(DATA0);
+ printf(" ");
+ break;
+
+ case DST2: /* send DST2 bit */
+ if (dst)
+ sec(DATA1);
+ else
+ sec(DATA0);
+ break;
+ }
+ }
+ }
+}
+
+
+/*
+ * Generate WWV/H 0 or 1 data pulse.
+ */
+void sec(
+ int code /* DATA0, DATA1, PI */
+ )
+{
+ /*
+ * The WWV data pulse begins with 5 ms of 1000 Hz follwed by a
+ * guard time of 25 ms. The data pulse is 170, 570 or 770 ms at
+ * 100 Hz corresponding to 0, 1 or position indicator (PI),
+ * respectively. Note the 100-Hz data pulses are transmitted 6
+ * dB below the 1000-Hz sync pulses. Originally the data pulses
+ * were transmited 10 dB below the sync pulses, but the station
+ * engineers increased that to 6 dB because the Heath GC-1000
+ * WWV/H radio clock worked much better.
+ */
+ peep(5, tone, HIGH); /* send seconds tick */
+ peep(25, tone, OFF);
+ peep(code - 30, 100, LOW); /* send data */
+ peep(1000 - code, 100, OFF);
+}
+
+
+/*
+ * Generate cycles of 100 Hz or any multiple of 100 Hz.
+ */
+void peep(
+ int pulse, /* pulse length (ms) */
+ int freq, /* frequency (Hz) */
+ int amp /* amplitude */
+ )
+{
+ int increm; /* phase increment */
+ int i, j;
+
+ if (amp == OFF || freq == 0)
+ increm = 10;
+ else
+ increm = freq / 100;
+ j = 0;
+ for (i = 0 ; i < pulse * 8; i++) {
+ switch (amp) {
+
+ case HIGH:
+ buffer[bufcnt++] = ~c6000[j];
+ break;
+
+ case LOW:
+ buffer[bufcnt++] = ~c3000[j];
+ break;
+
+ default:
+ buffer[bufcnt++] = ~0;
+ }
+ if (bufcnt >= BUFLNG) {
+ write(fd, buffer, BUFLNG);
+ bufcnt = 0;
+ }
+ j = (j + increm) % 80;
+ }
+}
+
+
+/*
+ * Delay for initial phasing
+ */
+void delay (
+ int delay /* delay in samples */
+ )
+{
+ int samples; /* samples remaining */
+
+ samples = delay;
+ memset(buffer, 0, BUFLNG);
+ while (samples >= BUFLNG) {
+ write(fd, buffer, BUFLNG);
+ samples -= BUFLNG;
+ }
+ write(fd, buffer, samples);
+}
diff --git a/util/tg2.c b/util/tg2.c
new file mode 100644
index 0000000..6d52ef4
--- /dev/null
+++ b/util/tg2.c
@@ -0,0 +1,2506 @@
+/*
+ * tg.c generate WWV or IRIG signals for test
+ */
+/*
+ * This program can generate audio signals that simulate the WWV/H
+ * broadcast timecode. Alternatively, it can generate the IRIG-B
+ * timecode commonly used to synchronize laboratory equipment. It is
+ * intended to test the WWV/H driver (refclock_wwv.c) and the IRIG
+ * driver (refclock_irig.c) in the NTP driver collection.
+ *
+ * Besides testing the drivers themselves, this program can be used to
+ * synchronize remote machines over audio transmission lines or program
+ * feeds. The program reads the time on the local machine and sets the
+ * initial epoch of the signal generator within one millisecond.
+ * Alernatively, the initial epoch can be set to an arbitrary time. This
+ * is useful when searching for bugs and testing for correct response to
+ * a leap second in UTC. Note however, the ultimate accuracy is limited
+ * by the intrinsic frequency error of the codec sample clock, which can
+ # reach well over 100 PPM.
+ *
+ * The default is to route generated signals to the line output
+ * jack; the s option on the command line routes these signals to the
+ * internal speaker as well. The v option controls the speaker volume
+ * over the range 0-255. The signal generator by default uses WWV
+ * format; the h option switches to WWVH format and the i option
+ * switches to IRIG-B format.
+ *
+ * Once started the program runs continuously. The default initial epoch
+ * for the signal generator is read from the computer system clock when
+ * the program starts. The y option specifies an alternate epoch using a
+ * string yydddhhmmss, where yy is the year of century, ddd the day of
+ * year, hh the hour of day and mm the minute of hour. For instance,
+ * 1946Z on 1 January 2006 is 060011946. The l option lights the leap
+ * warning bit in the WWV/H timecode, so is handy to check for correct
+ * behavior at the next leap second epoch. The remaining options are
+ * specified below under the Parse Options heading. Most of these are
+ * for testing.
+ *
+ * During operation the program displays the WWV/H timecode (9 digits)
+ * or IRIG timecode (20 digits) as each new string is constructed. The
+ * display is followed by the BCD binary bits as transmitted. Note that
+ * the transmissionorder is low-order first as the frame is processed
+ * left to right. For WWV/H The leap warning L preceeds the first bit.
+ * For IRIG the on-time marker M preceeds the first (units) bit, so its
+ * code is delayed one bit and the next digit (tens) needs only three
+ * bits.
+ *
+ * The program has been tested with the Sun Blade 1500 running Solaris
+ * 10, but not yet with other machines. It uses no special features and
+ * should be readily portable to other hardware and operating systems.
+ *
+ * $Log: tg.c,v $
+ * Revision 1.28 2007/02/12 23:57:45 dmw
+ * v0.23 2007-02-12 dmw:
+ * - Changed statistics to include calculated error
+ * of frequency, based on number of added or removed
+ * cycles over time.
+ *
+ * Revision 1.27 2007/02/09 02:28:59 dmw
+ * v0.22 2007-02-08 dmw:
+ * - Changed default for rate correction to "enabled", "-j" switch now disables.
+ * - Adjusted help message accordingly.
+ * - Added "2007" to modifications note at end of help message.
+ *
+ * Revision 1.26 2007/02/08 03:36:17 dmw
+ * v0.21 2007-02-07 dmw:
+ * - adjusted strings for shorten and lengthen to make
+ * fit on smaller screen.
+ *
+ * Revision 1.25 2007/02/01 06:08:09 dmw
+ * v0.20 2007-02-01 dmw:
+ * - Added periodic display of running time along with legend on IRIG-B, allows tracking how
+ * close IRIG output is to actual clock time.
+ *
+ * Revision 1.24 2007/01/31 19:24:11 dmw
+ * v0.19 2007-01-31 dmw:
+ * - Added tracking of how many seconds have been adjusted,
+ * how many cycles added (actually in milliseconds), how
+ * many cycles removed, print periodically if verbose is
+ * active.
+ * - Corrected lack of lengthen or shorten of minute & hour
+ * pulses for WWV format.
+ *
+ * Revision 1.23 2007/01/13 07:09:12 dmw
+ * v0.18 2007-01-13 dmw:
+ * - added -k option, which allows force of long or short
+ * cycles, to test against IRIG-B decoder.
+ *
+ * Revision 1.22 2007/01/08 16:27:23 dmw
+ * v0.17 2007-01-08 dmw:
+ * - Changed -j option to **enable** rate correction, not disable.
+ *
+ * Revision 1.21 2007/01/08 06:22:36 dmw
+ * v0.17 2007-01-08 dmw:
+ * - Run stability check versus ongoing system clock (assume NTP correction)
+ * and adjust time code rate to try to correct, if gets too far out of sync.
+ * Disable this algorithm with -j option.
+ *
+ * Revision 1.20 2006/12/19 04:59:04 dmw
+ * v0.16 2006-12-18 dmw
+ * - Corrected print of setting of output frequency, always
+ * showed 8000 samples/sec, now as specified on command line.
+ * - Modified to reflect new employer Norscan.
+ *
+ * Revision 1.19 2006/12/19 03:45:38 dmw
+ * v0.15 2006-12-18 dmw:
+ * - Added count of number of seconds to output then exit,
+ * default zero for forever.
+ *
+ * Revision 1.18 2006/12/18 05:43:36 dmw
+ * v0.14 2006-12-17 dmw:
+ * - Corrected WWV(H) signal to leave "tick" sound off of 29th and 59th second of minute.
+ * - Adjusted verbose output format for WWV(H).
+ *
+ * Revision 1.17 2006/12/18 02:31:33 dmw
+ * v0.13 2006-12-17 dmw:
+ * - Put SPARC code back in, hopefully will work, but I don't have
+ * a SPARC to try it on...
+ * - Reworked Verbose mode, different flag to initiate (x not v)
+ * and actually implement turn off of verbosity when this flag used.
+ * - Re-claimed v flag for output level.
+ * - Note that you must define OSS_MODS to get OSS to compile,
+ * otherwise will expect to compile using old SPARC options, as
+ * it used to be.
+ *
+ * Revision 1.16 2006/10/26 19:08:43 dmw
+ * v0.12 2006-10-26 dmw:
+ * - Reversed output binary dump for IRIG, makes it easier to read the numbers.
+ *
+ * Revision 1.15 2006/10/24 15:57:09 dmw
+ * v0.11 2006-10-24 dmw:
+ * - another tweak.
+ *
+ * Revision 1.14 2006/10/24 15:55:53 dmw
+ * v0.11 2006-10-24 dmw:
+ * - Curses a fix to the fix to the fix of the usaeg.
+ *
+ * Revision 1.13 2006/10/24 15:53:25 dmw
+ * v0.11 (still) 2006-10-24 dmw:
+ * - Messed with usage message that's all.
+ *
+ * Revision 1.12 2006/10/24 15:50:05 dmw
+ * v0.11 2006-10-24 dmw:
+ * - oops, needed to note "hours" in usage of that offset.
+ *
+ * Revision 1.11 2006/10/24 15:49:09 dmw
+ * v0.11 2006-10-24 dmw:
+ * - Added ability to offset actual time sent, from the UTC time
+ * as per the computer.
+ *
+ * Revision 1.10 2006/10/24 03:25:55 dmw
+ * v0.10 2006-10-23 dmw:
+ * - Corrected polarity of correction of offset when going into or out of DST.
+ * - Ensure that zero offset is always positive (pet peeve).
+ *
+ * Revision 1.9 2006/10/24 00:00:35 dmw
+ * v0.9 2006-10-23 dmw:
+ * - Shift time offset when DST in or out.
+ *
+ * Revision 1.8 2006/10/23 23:49:28 dmw
+ * v0.8 2006-10-23 dmw:
+ * - made offset of zero default positive.
+ *
+ * Revision 1.7 2006/10/23 23:44:13 dmw
+ * v0.7 2006-10-23 dmw:
+ * - Added unmodulated and inverted unmodulated output.
+ *
+ * Revision 1.6 2006/10/23 18:10:37 dmw
+ * v0.6 2006-10-23 dmw:
+ * - Cleaned up usage message.
+ * - Require at least one option, or prints usage message and exits.
+ *
+ * Revision 1.5 2006/10/23 16:58:10 dmw
+ * v0.5 2006-10-23 dmw:
+ * - Finally added a usage message.
+ * - Added leap second pending and DST change pending into IEEE 1344.
+ * - Default code type is now IRIG-B with IEEE 1344.
+ *
+ * Revision 1.4 2006/10/23 03:27:25 dmw
+ * v0.4 2006-10-22 dmw:
+ * - Added leap second addition and deletion.
+ * - Added DST changing forward and backward.
+ * - Changed date specification to more conventional year, month, and day of month
+ * (rather than day of year).
+ *
+ * Revision 1.3 2006/10/22 21:04:12 dmw
+ * v0.2 2006-10-22 dmw:
+ * - Corrected format of legend line.
+ *
+ * Revision 1.2 2006/10/22 21:01:07 dmw
+ * v0.1 2006-10-22 dmw:
+ * - Added some more verbose output (as is my style)
+ * - Corrected frame format - there were markers in the
+ * middle of frames, now correctly as "zero" bits.
+ * - Added header line to show fields of output.
+ * - Added straight binary seconds, were not implemented
+ * before.
+ * - Added IEEE 1344 with parity.
+ *
+ *
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#undef VERSION /* avoid conflict below */
+#endif
+
+#ifdef HAVE_SYS_SOUNDCARD_H
+#include <sys/soundcard.h>
+#else
+# ifdef HAVE_SYS_AUDIOIO_H
+# include <sys/audioio.h>
+# else
+# include <sys/audio.h>
+# endif
+#endif
+
+#include "ntp_stdlib.h" /* for strlcat(), strlcpy() */
+
+#include <math.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+
+#define VERSION (0)
+#define ISSUE (23)
+#define ISSUE_DATE "2007-02-12"
+
+#define SECOND (8000) /* one second of 125-us samples */
+#define BUFLNG (400) /* buffer size */
+#define DEVICE "/dev/audio" /* default audio device */
+#define WWV (0) /* WWV encoder */
+#define IRIG (1) /* IRIG-B encoder */
+#define OFF (0) /* zero amplitude */
+#define LOW (1) /* low amplitude */
+#define HIGH (2) /* high amplitude */
+#define DATA0 (200) /* WWV/H 0 pulse */
+#define DATA1 (500) /* WWV/H 1 pulse */
+#define PI (800) /* WWV/H PI pulse */
+#define M2 (2) /* IRIG 0 pulse */
+#define M5 (5) /* IRIG 1 pulse */
+#define M8 (8) /* IRIG PI pulse */
+
+#define NUL (0)
+
+#define SECONDS_PER_MINUTE (60)
+#define SECONDS_PER_HOUR (3600)
+
+#define OUTPUT_DATA_STRING_LENGTH (200)
+
+/* Attempt at unmodulated - "high" */
+int u6000[] = {
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, /* 0- 9 */
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, /* 10-19 */
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, /* 20-29 */
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, /* 30-39 */
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, /* 40-49 */
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, /* 50-59 */
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, /* 60-69 */
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247}; /* 70-79 */
+
+/* Attempt at unmodulated - "low" */
+int u3000[] = {
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, /* 0- 9 */
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, /* 10-19 */
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, /* 20-29 */
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, /* 30-39 */
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, /* 40-49 */
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, /* 50-59 */
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, /* 60-69 */
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119}; /* 70-79 */
+
+/*
+ * Companded sine table amplitude 3000 units
+ */
+int c3000[] = {1, 48, 63, 70, 78, 82, 85, 89, 92, 94, /* 0-9 */
+ 96, 98, 99, 100, 101, 101, 102, 103, 103, 103, /* 10-19 */
+ 103, 103, 103, 103, 102, 101, 101, 100, 99, 98, /* 20-29 */
+ 96, 94, 92, 89, 85, 82, 78, 70, 63, 48, /* 30-39 */
+ 129, 176, 191, 198, 206, 210, 213, 217, 220, 222, /* 40-49 */
+ 224, 226, 227, 228, 229, 229, 230, 231, 231, 231, /* 50-59 */
+ 231, 231, 231, 231, 230, 229, 229, 228, 227, 226, /* 60-69 */
+ 224, 222, 220, 217, 213, 210, 206, 198, 191, 176}; /* 70-79 */
+/*
+ * Companded sine table amplitude 6000 units
+ */
+int c6000[] = {1, 63, 78, 86, 93, 98, 101, 104, 107, 110, /* 0-9 */
+ 112, 113, 115, 116, 117, 117, 118, 118, 119, 119, /* 10-19 */
+ 119, 119, 119, 118, 118, 117, 117, 116, 115, 113, /* 20-29 */
+ 112, 110, 107, 104, 101, 98, 93, 86, 78, 63, /* 30-39 */
+ 129, 191, 206, 214, 221, 226, 229, 232, 235, 238, /* 40-49 */
+ 240, 241, 243, 244, 245, 245, 246, 246, 247, 247, /* 50-59 */
+ 247, 247, 247, 246, 246, 245, 245, 244, 243, 241, /* 60-69 */
+ 240, 238, 235, 232, 229, 226, 221, 214, 206, 191}; /* 70-79 */
+
+/*
+ * Decoder operations at the end of each second are driven by a state
+ * machine. The transition matrix consists of a dispatch table indexed
+ * by second number. Each entry in the table contains a case switch
+ * number and argument.
+ */
+struct progx {
+ int sw; /* case switch number */
+ int arg; /* argument */
+};
+
+/*
+ * Case switch numbers
+ */
+#define DATA (0) /* send data (0, 1, PI) */
+#define COEF (1) /* send BCD bit */
+#define DEC (2) /* decrement to next digit and send PI */
+#define MIN (3) /* minute pulse */
+#define LEAP (4) /* leap warning */
+#define DUT1 (5) /* DUT1 bits */
+#define DST1 (6) /* DST1 bit */
+#define DST2 (7) /* DST2 bit */
+#define DECZ (8) /* decrement to next digit and send zero */
+#define DECC (9) /* decrement to next digit and send bit */
+#define NODEC (10) /* no decerement to next digit, send PI */
+#define DECX (11) /* decrement to next digit, send PI, but no tick */
+#define DATAX (12) /* send data (0, 1, PI), but no tick */
+
+/*
+ * WWV/H format (100-Hz, 9 digits, 1 m frame)
+ */
+struct progx progx[] = {
+ {MIN, 800}, /* 0 minute sync pulse */
+ {DATA, DATA0}, /* 1 */
+ {DST2, 0}, /* 2 DST2 */
+ {LEAP, 0}, /* 3 leap warning */
+ {COEF, 1}, /* 4 1 year units */
+ {COEF, 2}, /* 5 2 */
+ {COEF, 4}, /* 6 4 */
+ {COEF, 8}, /* 7 8 */
+ {DEC, DATA0}, /* 8 */
+ {DATA, PI}, /* 9 p1 */
+ {COEF, 1}, /* 10 1 minute units */
+ {COEF, 2}, /* 11 2 */
+ {COEF, 4}, /* 12 4 */
+ {COEF, 8}, /* 13 8 */
+ {DEC, DATA0}, /* 14 */
+ {COEF, 1}, /* 15 10 minute tens */
+ {COEF, 2}, /* 16 20 */
+ {COEF, 4}, /* 17 40 */
+ {COEF, 8}, /* 18 80 (not used) */
+ {DEC, PI}, /* 19 p2 */
+ {COEF, 1}, /* 20 1 hour units */
+ {COEF, 2}, /* 21 2 */
+ {COEF, 4}, /* 22 4 */
+ {COEF, 8}, /* 23 8 */
+ {DEC, DATA0}, /* 24 */
+ {COEF, 1}, /* 25 10 hour tens */
+ {COEF, 2}, /* 26 20 */
+ {COEF, 4}, /* 27 40 (not used) */
+ {COEF, 8}, /* 28 80 (not used) */
+ {DECX, PI}, /* 29 p3 */
+ {COEF, 1}, /* 30 1 day units */
+ {COEF, 2}, /* 31 2 */
+ {COEF, 4}, /* 32 4 */
+ {COEF, 8}, /* 33 8 */
+ {DEC, DATA0}, /* 34 not used */
+ {COEF, 1}, /* 35 10 day tens */
+ {COEF, 2}, /* 36 20 */
+ {COEF, 4}, /* 37 40 */
+ {COEF, 8}, /* 38 80 */
+ {DEC, PI}, /* 39 p4 */
+ {COEF, 1}, /* 40 100 day hundreds */
+ {COEF, 2}, /* 41 200 */
+ {COEF, 4}, /* 42 400 (not used) */
+ {COEF, 8}, /* 43 800 (not used) */
+ {DEC, DATA0}, /* 44 */
+ {DATA, DATA0}, /* 45 */
+ {DATA, DATA0}, /* 46 */
+ {DATA, DATA0}, /* 47 */
+ {DATA, DATA0}, /* 48 */
+ {DATA, PI}, /* 49 p5 */
+ {DUT1, 8}, /* 50 DUT1 sign */
+ {COEF, 1}, /* 51 10 year tens */
+ {COEF, 2}, /* 52 20 */
+ {COEF, 4}, /* 53 40 */
+ {COEF, 8}, /* 54 80 */
+ {DST1, 0}, /* 55 DST1 */
+ {DUT1, 1}, /* 56 0.1 DUT1 fraction */
+ {DUT1, 2}, /* 57 0.2 */
+ {DUT1, 4}, /* 58 0.4 */
+ {DATAX, PI}, /* 59 p6 */
+ {DATA, DATA0}, /* 60 leap */
+};
+
+/*
+ * IRIG format frames (1000 Hz, 1 second for 10 frames of data)
+ */
+
+/*
+ * IRIG format frame 10 - MS straight binary seconds
+ */
+struct progx progu[] = {
+ {COEF, 2}, /* 0 0x0 0200 seconds */
+ {COEF, 4}, /* 1 0x0 0400 */
+ {COEF, 8}, /* 2 0x0 0800 */
+ {DECC, 1}, /* 3 0x0 1000 */
+ {COEF, 2}, /* 4 0x0 2000 */
+ {COEF, 4}, /* 6 0x0 4000 */
+ {COEF, 8}, /* 7 0x0 8000 */
+ {DECC, 1}, /* 8 0x1 0000 */
+ {COEF, 2}, /* 9 0x2 0000 - but only 86,401 / 0x1 5181 seconds in a day, so always zero */
+ {NODEC, M8}, /* 9 PI */
+};
+
+/*
+ * IRIG format frame 8 - MS control functions
+ */
+struct progx progv[] = {
+ {COEF, 2}, /* 0 CF # 19 */
+ {COEF, 4}, /* 1 CF # 20 */
+ {COEF, 8}, /* 2 CF # 21 */
+ {DECC, 1}, /* 3 CF # 22 */
+ {COEF, 2}, /* 4 CF # 23 */
+ {COEF, 4}, /* 6 CF # 24 */
+ {COEF, 8}, /* 7 CF # 25 */
+ {DECC, 1}, /* 8 CF # 26 */
+ {COEF, 2}, /* 9 CF # 27 */
+ {DEC, M8}, /* 10 PI */
+};
+
+/*
+ * IRIG format frames 7 & 9 - LS control functions & LS straight binary seconds
+ */
+struct progx progw[] = {
+ {COEF, 1}, /* 0 CF # 10, 0x0 0001 seconds */
+ {COEF, 2}, /* 1 CF # 11, 0x0 0002 */
+ {COEF, 4}, /* 2 CF # 12, 0x0 0004 */
+ {COEF, 8}, /* 3 CF # 13, 0x0 0008 */
+ {DECC, 1}, /* 4 CF # 14, 0x0 0010 */
+ {COEF, 2}, /* 6 CF # 15, 0x0 0020 */
+ {COEF, 4}, /* 7 CF # 16, 0x0 0040 */
+ {COEF, 8}, /* 8 CF # 17, 0x0 0080 */
+ {DECC, 1}, /* 9 CF # 18, 0x0 0100 */
+ {NODEC, M8}, /* 10 PI */
+};
+
+/*
+ * IRIG format frames 2 to 6 - minutes, hours, days, hundreds days, 2 digit years (also called control functions bits 1-9)
+ */
+struct progx progy[] = {
+ {COEF, 1}, /* 0 1 units, CF # 1 */
+ {COEF, 2}, /* 1 2 units, CF # 2 */
+ {COEF, 4}, /* 2 4 units, CF # 3 */
+ {COEF, 8}, /* 3 8 units, CF # 4 */
+ {DECZ, M2}, /* 4 zero bit, CF # 5 / unused, default zero in years */
+ {COEF, 1}, /* 5 10 tens, CF # 6 */
+ {COEF, 2}, /* 6 20 tens, CF # 7*/
+ {COEF, 4}, /* 7 40 tens, CF # 8*/
+ {COEF, 8}, /* 8 80 tens, CF # 9*/
+ {DEC, M8}, /* 9 PI */
+};
+
+/*
+ * IRIG format first frame, frame 1 - seconds
+ */
+struct progx progz[] = {
+ {MIN, M8}, /* 0 PI (on-time marker for the second at zero cross of 1st cycle) */
+ {COEF, 1}, /* 1 1 units */
+ {COEF, 2}, /* 2 2 */
+ {COEF, 4}, /* 3 4 */
+ {COEF, 8}, /* 4 8 */
+ {DECZ, M2}, /* 5 zero bit */
+ {COEF, 1}, /* 6 10 tens */
+ {COEF, 2}, /* 7 20 */
+ {COEF, 4}, /* 8 40 */
+ {DEC, M8}, /* 9 PI */
+};
+
+/* LeapState values. */
+#define LEAPSTATE_NORMAL (0)
+#define LEAPSTATE_DELETING (1)
+#define LEAPSTATE_INSERTING (2)
+#define LEAPSTATE_ZERO_AFTER_INSERT (3)
+
+
+/*
+ * Forward declarations
+ */
+void WWV_Second(int, int); /* send second */
+void WWV_SecondNoTick(int, int); /* send second with no tick */
+void digit(int); /* encode digit */
+void peep(int, int, int); /* send cycles */
+void poop(int, int, int, int); /* Generate unmodulated from similar tables */
+void delay(int); /* delay samples */
+int ConvertMonthDayToDayOfYear (int, int, int); /* Calc day of year from year month & day */
+void Help (void); /* Usage message */
+void ReverseString(char *);
+
+/*
+ * Extern declarations, don't know why not in headers
+ */
+//float round ( float );
+
+/*
+ * Global variables
+ */
+char buffer[BUFLNG]; /* output buffer */
+int bufcnt = 0; /* buffer counter */
+int fd; /* audio codec file descriptor */
+int tone = 1000; /* WWV sync frequency */
+int HourTone = 1500; /* WWV hour on-time frequency */
+int encode = IRIG; /* encoder select */
+int leap = 0; /* leap indicator */
+int DstFlag = 0; /* winter/summer time */
+int dut1 = 0; /* DUT1 correction (sign, magnitude) */
+int utc = 0; /* option epoch */
+int IrigIncludeYear = FALSE; /* Whether to send year in first control functions area, between P5 and P6. */
+int IrigIncludeIeee = FALSE; /* Whether to send IEEE 1344 control functions extensions between P6 and P8. */
+int StraightBinarySeconds = 0;
+int ControlFunctions = 0;
+int Debug = FALSE;
+int Verbose = TRUE;
+char *CommandName;
+
+#ifndef HAVE_SYS_SOUNDCARD_H
+int level = AUDIO_MAX_GAIN / 8; /* output level */
+int port = AUDIO_LINE_OUT; /* output port */
+#endif
+
+int TotalSecondsCorrected = 0;
+int TotalCyclesAdded = 0;
+int TotalCyclesRemoved = 0;
+
+
+/*
+ * Main program
+ */
+int
+main(
+ int argc, /* command line options */
+ char **argv /* poiniter to list of tokens */
+ )
+{
+#ifndef HAVE_SYS_SOUNDCARD_H
+ audio_info_t info; /* Sun audio structure */
+ int rval; /* For IOCTL calls */
+#endif
+
+ struct timeval TimeValue; /* System clock at startup */
+ time_t SecondsPartOfTime; /* Sent to gmtime() for calculation of TimeStructure (can apply offset). */
+ time_t BaseRealTime; /* Base realtime so can determine seconds since starting. */
+ time_t NowRealTime; /* New realtime to can determine seconds as of now. */
+ unsigned SecondsRunningRealTime; /* Difference between NowRealTime and BaseRealTime. */
+ unsigned SecondsRunningSimulationTime; /* Time that the simulator has been running. */
+ int SecondsRunningDifference; /* Difference between what real time says we have been running */
+ /* and what simulator says we have been running - will slowly */
+ /* change because of clock drift. */
+ int ExpectedRunningDifference = 0; /* Stable value that we've obtained from check at initial start-up. */
+ unsigned StabilityCount; /* Used to check stability of difference while starting */
+#define RUN_BEFORE_STABILITY_CHECK (30) // Must run this many seconds before even checking stability.
+#define MINIMUM_STABILITY_COUNT (10) // Number of consecutive differences that need to be within initial stability band to say we are stable.
+#define INITIAL_STABILITY_BAND ( 2) // Determining initial stability for consecutive differences within +/- this value.
+#define RUNNING_STABILITY_BAND ( 5) // When running, stability is defined as difference within +/- this value.
+
+ struct tm *TimeStructure = NULL; /* Structure returned by gmtime */
+ char device[200]; /* audio device */
+ char code[200]; /* timecode */
+ int temp;
+ int arg = 0;
+ int sw = 0;
+ int ptr = 0;
+
+ int Year;
+ int Month;
+ int DayOfMonth;
+ int Hour;
+ int Minute;
+ int Second = 0;
+ int DayOfYear;
+
+ int BitNumber;
+#ifdef HAVE_SYS_SOUNDCARD_H
+ int AudioFormat;
+ int MonoStereo; /* 0=mono, 1=stereo */
+#define MONO (0)
+#define STEREO (1)
+ int SampleRate;
+ int SampleRateDifference;
+#endif
+ int SetSampleRate;
+ char FormatCharacter = '3'; /* Default is IRIG-B with IEEE 1344 extensions */
+ char AsciiValue;
+ int HexValue;
+ int OldPtr = 0;
+ int FrameNumber = 0;
+
+ /* Time offset for IEEE 1344 indication. */
+ float TimeOffset = 0.0;
+ int OffsetSignBit = 0;
+ int OffsetOnes = 0;
+ int OffsetHalf = 0;
+
+ int TimeQuality = 0; /* Time quality for IEEE 1344 indication. */
+ char ParityString[200]; /* Partial output string, to calculate parity on. */
+ int ParitySum = 0;
+ int ParityValue;
+ char *StringPointer;
+
+ /* Flags to indicate requested leap second addition or deletion by command line option. */
+ /* Should be mutually exclusive - generally ensured by code which interprets command line option. */
+ int InsertLeapSecond = FALSE;
+ int DeleteLeapSecond = FALSE;
+
+ /* Date and time of requested leap second addition or deletion. */
+ int LeapYear = 0;
+ int LeapMonth = 0;
+ int LeapDayOfMonth = 0;
+ int LeapHour = 0;
+ int LeapMinute = 0;
+ int LeapDayOfYear = 0;
+
+ /* State flag for the insertion and deletion of leap seconds, esp. deletion, */
+ /* where the logic gets a bit tricky. */
+ int LeapState = LEAPSTATE_NORMAL;
+
+ /* Flags for indication of leap second pending and leap secod polarity in IEEE 1344 */
+ int LeapSecondPending = FALSE;
+ int LeapSecondPolarity = FALSE;
+
+ /* Date and time of requested switch into or out of DST by command line option. */
+ int DstSwitchYear = 0;
+ int DstSwitchMonth = 0;
+ int DstSwitchDayOfMonth = 0;
+ int DstSwitchHour = 0;
+ int DstSwitchMinute = 0;
+ int DstSwitchDayOfYear = 0;
+
+ /* Indicate when we have been asked to switch into or out of DST by command line option. */
+ int DstSwitchFlag = FALSE;
+
+ /* To allow predict for DstPendingFlag in IEEE 1344 */
+ int DstSwitchPendingYear = 0; /* Default value isn't valid, but I don't care. */
+ int DstSwitchPendingDayOfYear = 0;
+ int DstSwitchPendingHour = 0;
+ int DstSwitchPendingMinute = 0;
+
+ /* /Flag for indication of a DST switch pending in IEEE 1344 */
+ int DstPendingFlag = FALSE;
+
+ /* Attempt at unmodulated */
+ int Unmodulated = FALSE;
+ int UnmodulatedInverted = FALSE;
+
+ /* Offset to actual time value sent. */
+ float UseOffsetHoursFloat;
+ int UseOffsetSecondsInt = 0;
+ float UseOffsetSecondsFloat;
+
+ /* String to allow us to put out reversed data - so can read the binary numbers. */
+ char OutputDataString[OUTPUT_DATA_STRING_LENGTH];
+
+ /* Number of seconds to send before exiting. Default = 0 = forever. */
+ int SecondsToSend = 0;
+ int CountOfSecondsSent = 0; /* Counter of seconds */
+
+ /* Flags to indicate whether to add or remove a cycle for time adjustment. */
+ int AddCycle = FALSE; // We are ahead, add cycle to slow down and get back in sync.
+ int RemoveCycle = FALSE; // We are behind, remove cycle to slow down and get back in sync.
+ int RateCorrection; // Aggregate flag for passing to subroutines.
+ int EnableRateCorrection = TRUE;
+
+ float RatioError;
+
+
+ CommandName = argv[0];
+
+ if (argc < 1)
+ {
+ Help ();
+ exit (-1);
+ }
+
+ /*
+ * Parse options
+ */
+ strlcpy(device, DEVICE, sizeof(device));
+ Year = 0;
+ SetSampleRate = SECOND;
+
+#if HAVE_SYS_SOUNDCARD_H
+ while ((temp = getopt(argc, argv, "a:b:c:df:g:hHi:jk:l:o:q:r:stu:xy:z?")) != -1) {
+#else
+ while ((temp = getopt(argc, argv, "a:b:c:df:g:hHi:jk:l:o:q:r:stu:v:xy:z?")) != -1) {
+#endif
+ switch (temp) {
+
+ case 'a': /* specify audio device (/dev/audio) */
+ strlcpy(device, optarg, sizeof(device));
+ break;
+
+ case 'b': /* Remove (delete) a leap second at the end of the specified minute. */
+ sscanf(optarg, "%2d%2d%2d%2d%2d", &LeapYear, &LeapMonth, &LeapDayOfMonth,
+ &LeapHour, &LeapMinute);
+ InsertLeapSecond = FALSE;
+ DeleteLeapSecond = TRUE;
+ break;
+
+ case 'c': /* specify number of seconds to send output for before exiting, 0 = forever */
+ sscanf(optarg, "%d", &SecondsToSend);
+ break;
+
+ case 'd': /* set DST for summer (WWV/H only) / start with DST active (IRIG) */
+ DstFlag++;
+ break;
+
+ case 'f': /* select format: i=IRIG-98 (default) 2=IRIG-2004 3-IRIG+IEEE-1344 w=WWV(H) */
+ sscanf(optarg, "%c", &FormatCharacter);
+ break;
+
+ case 'g': /* Date and time to switch back into / out of DST active. */
+ sscanf(optarg, "%2d%2d%2d%2d%2d", &DstSwitchYear, &DstSwitchMonth, &DstSwitchDayOfMonth,
+ &DstSwitchHour, &DstSwitchMinute);
+ DstSwitchFlag = TRUE;
+ break;
+
+ case 'h':
+ case 'H':
+ case '?':
+ Help ();
+ exit(-1);
+ break;
+
+ case 'i': /* Insert (add) a leap second at the end of the specified minute. */
+ sscanf(optarg, "%2d%2d%2d%2d%2d", &LeapYear, &LeapMonth, &LeapDayOfMonth,
+ &LeapHour, &LeapMinute);
+ InsertLeapSecond = TRUE;
+ DeleteLeapSecond = FALSE;
+ break;
+
+ case 'j':
+ EnableRateCorrection = FALSE;
+ break;
+
+ case 'k':
+ sscanf (optarg, "%d", &RateCorrection);
+ EnableRateCorrection = FALSE;
+ if (RateCorrection < 0)
+ {
+ RemoveCycle = TRUE;
+ AddCycle = FALSE;
+
+ if (Verbose)
+ printf ("\n> Forcing rate correction removal of cycle...\n");
+ }
+ else
+ {
+ if (RateCorrection > 0)
+ {
+ RemoveCycle = FALSE;
+ AddCycle = TRUE;
+
+ if (Verbose)
+ printf ("\n> Forcing rate correction addition of cycle...\n");
+ }
+ }
+ break;
+
+ case 'l': /* use time offset from UTC */
+ sscanf(optarg, "%f", &UseOffsetHoursFloat);
+ UseOffsetSecondsFloat = UseOffsetHoursFloat * (float) SECONDS_PER_HOUR;
+ UseOffsetSecondsInt = (int) (UseOffsetSecondsFloat + 0.5);
+ break;
+
+ case 'o': /* Set IEEE 1344 time offset in hours - positive or negative, to the half hour */
+ sscanf(optarg, "%f", &TimeOffset);
+ if (TimeOffset >= -0.2)
+ {
+ OffsetSignBit = 0;
+
+ if (TimeOffset > 0)
+ {
+ OffsetOnes = TimeOffset;
+
+ if ( (TimeOffset - floor(TimeOffset)) >= 0.4)
+ OffsetHalf = 1;
+ else
+ OffsetHalf = 0;
+ }
+ else
+ {
+ OffsetOnes = 0;
+ OffsetHalf = 0;
+ }
+ }
+ else
+ {
+ OffsetSignBit = 1;
+ OffsetOnes = -TimeOffset;
+
+ if ( (ceil(TimeOffset) - TimeOffset) >= 0.4)
+ OffsetHalf = 1;
+ else
+ OffsetHalf = 0;
+ }
+
+ /*printf ("\nGot TimeOffset = %3.1f, OffsetSignBit = %d, OffsetOnes = %d, OffsetHalf = %d...\n",
+ TimeOffset, OffsetSignBit, OffsetOnes, OffsetHalf);
+ */
+ break;
+
+ case 'q': /* Hex quality code 0 to 0x0F - 0 = maximum, 0x0F = no lock */
+ sscanf(optarg, "%x", &TimeQuality);
+ TimeQuality &= 0x0F;
+ /*printf ("\nGot TimeQuality = 0x%1X...\n", TimeQuality);
+ */
+ break;
+
+ case 'r': /* sample rate (nominally 8000, integer close to 8000 I hope) */
+ sscanf(optarg, "%d", &SetSampleRate);
+ break;
+
+ case 's': /* set leap warning bit (WWV/H only) */
+ leap++;
+ break;
+
+ case 't': /* select WWVH sync frequency */
+ tone = 1200;
+ break;
+
+ case 'u': /* set DUT1 offset (-7 to +7) */
+ sscanf(optarg, "%d", &dut1);
+ if (dut1 < 0)
+ dut1 = abs(dut1);
+ else
+ dut1 |= 0x8;
+ break;
+
+#ifndef HAVE_SYS_SOUNDCARD_H
+ case 'v': /* set output level (0-255) */
+ sscanf(optarg, "%d", &level);
+ break;
+#endif
+
+ case 'x': /* Turn off verbose output. */
+ Verbose = FALSE;
+ break;
+
+ case 'y': /* Set initial date and time */
+ sscanf(optarg, "%2d%2d%2d%2d%2d%2d", &Year, &Month, &DayOfMonth,
+ &Hour, &Minute, &Second);
+ utc++;
+ break;
+
+ case 'z': /* Turn on Debug output (also turns on Verbose below) */
+ Debug = TRUE;
+ break;
+
+ default:
+ printf("Invalid option \"%c\", aborting...\n", temp);
+ exit (-1);
+ break;
+ }
+ }
+
+ if (Debug)
+ Verbose = TRUE;
+
+ if (InsertLeapSecond || DeleteLeapSecond)
+ {
+ LeapDayOfYear = ConvertMonthDayToDayOfYear (LeapYear, LeapMonth, LeapDayOfMonth);
+
+ if (Debug)
+ {
+ printf ("\nHave request for leap second %s at year %4d day %3d at %2.2dh%2.2d....\n",\
+ DeleteLeapSecond ? "DELETION" : (InsertLeapSecond ? "ADDITION" : "( error ! )" ),
+ LeapYear, LeapDayOfYear, LeapHour, LeapMinute);
+ }
+ }
+
+ if (DstSwitchFlag)
+ {
+ DstSwitchDayOfYear = ConvertMonthDayToDayOfYear (DstSwitchYear, DstSwitchMonth, DstSwitchDayOfMonth);
+
+ /* Figure out time of minute previous to DST switch, so can put up warning flag in IEEE 1344 */
+ DstSwitchPendingYear = DstSwitchYear;
+ DstSwitchPendingDayOfYear = DstSwitchDayOfYear;
+ DstSwitchPendingHour = DstSwitchHour;
+ DstSwitchPendingMinute = DstSwitchMinute - 1;
+ if (DstSwitchPendingMinute < 0)
+ {
+ DstSwitchPendingMinute = 59;
+ DstSwitchPendingHour--;
+ if (DstSwitchPendingHour < 0)
+ {
+ DstSwitchPendingHour = 23;
+ DstSwitchPendingDayOfYear--;
+ if (DstSwitchPendingDayOfYear < 1)
+ {
+ DstSwitchPendingYear--;
+ }
+ }
+ }
+
+ if (Debug)
+ {
+ printf ("\nHave DST switch request for year %4d day %3d at %2.2dh%2.2d,",
+ DstSwitchYear, DstSwitchDayOfYear, DstSwitchHour, DstSwitchMinute);
+ printf ("\n so will have warning at year %4d day %3d at %2.2dh%2.2d.\n",
+ DstSwitchPendingYear, DstSwitchPendingDayOfYear, DstSwitchPendingHour, DstSwitchPendingMinute);
+ }
+ }
+
+ switch (tolower(FormatCharacter)) {
+ case 'i':
+ printf ("\nFormat is IRIG-1998 (no year coded)...\n\n");
+ encode = IRIG;
+ IrigIncludeYear = FALSE;
+ IrigIncludeIeee = FALSE;
+ break;
+
+ case '2':
+ printf ("\nFormat is IRIG-2004 (BCD year coded)...\n\n");
+ encode = IRIG;
+ IrigIncludeYear = TRUE;
+ IrigIncludeIeee = FALSE;
+ break;
+
+ case '3':
+ printf ("\nFormat is IRIG with IEEE-1344 (BCD year coded, and more control functions)...\n\n");
+ encode = IRIG;
+ IrigIncludeYear = TRUE;
+ IrigIncludeIeee = TRUE;
+ break;
+
+ case '4':
+ printf ("\nFormat is unmodulated IRIG with IEEE-1344 (BCD year coded, and more control functions)...\n\n");
+ encode = IRIG;
+ IrigIncludeYear = TRUE;
+ IrigIncludeIeee = TRUE;
+
+ Unmodulated = TRUE;
+ UnmodulatedInverted = FALSE;
+ break;
+
+ case '5':
+ printf ("\nFormat is inverted unmodulated IRIG with IEEE-1344 (BCD year coded, and more control functions)...\n\n");
+ encode = IRIG;
+ IrigIncludeYear = TRUE;
+ IrigIncludeIeee = TRUE;
+
+ Unmodulated = TRUE;
+ UnmodulatedInverted = TRUE;
+ break;
+
+ case 'w':
+ printf ("\nFormat is WWV(H)...\n\n");
+ encode = WWV;
+ break;
+
+ default:
+ printf ("\n\nUnexpected format value of \'%c\', cannot parse, aborting...\n\n", FormatCharacter);
+ exit (-1);
+ break;
+ }
+
+ /*
+ * Open audio device and set options
+ */
+ fd = open(device, O_WRONLY);
+ if (fd <= 0) {
+ printf("Unable to open audio device \"%s\", aborting: %s\n", device, strerror(errno));
+ exit(1);
+ }
+
+#ifdef HAVE_SYS_SOUNDCARD_H
+ /* First set coding type */
+ AudioFormat = AFMT_MU_LAW;
+ if (ioctl(fd, SNDCTL_DSP_SETFMT, &AudioFormat)==-1)
+ { /* Fatal error */
+ printf ("\nUnable to set output format, aborting...\n\n");
+ exit(-1);
+ }
+
+ if (AudioFormat != AFMT_MU_LAW)
+ {
+ printf ("\nUnable to set output format for mu law, aborting...\n\n");
+ exit(-1);
+ }
+
+ /* Next set number of channels */
+ MonoStereo = MONO; /* Mono */
+ if (ioctl(fd, SNDCTL_DSP_STEREO, &MonoStereo)==-1)
+ { /* Fatal error */
+ printf ("\nUnable to set mono/stereo, aborting...\n\n");
+ exit(-1);
+ }
+
+ if (MonoStereo != MONO)
+ {
+ printf ("\nUnable to set mono/stereo for mono, aborting...\n\n");
+ exit(-1);
+ }
+
+ /* Now set sample rate */
+ SampleRate = SetSampleRate;
+ if (ioctl(fd, SNDCTL_DSP_SPEED, &SampleRate)==-1)
+ { /* Fatal error */
+ printf ("\nUnable to set sample rate to %d, returned %d, aborting...\n\n", SetSampleRate, SampleRate);
+ exit(-1);
+ }
+
+ SampleRateDifference = SampleRate - SetSampleRate;
+
+ if (SampleRateDifference < 0)
+ SampleRateDifference = - SampleRateDifference;
+
+ /* Fixed allowable sample rate error 0.1% */
+ if (SampleRateDifference > (SetSampleRate/1000))
+ {
+ printf ("\nUnable to set sample rate to %d, result was %d, more than 0.1 percent, aborting...\n\n", SetSampleRate, SampleRate);
+ exit(-1);
+ }
+ else
+ {
+ /* printf ("\nAttempt to set sample rate to %d, actual %d...\n\n", SetSampleRate, SampleRate); */
+ }
+#else
+ rval = ioctl(fd, AUDIO_GETINFO, &info);
+ if (rval < 0) {
+ printf("\naudio control %s", strerror(errno));
+ exit(0);
+ }
+ info.play.port = port;
+ info.play.gain = level;
+ info.play.sample_rate = SetSampleRate;
+ info.play.channels = 1;
+ info.play.precision = 8;
+ info.play.encoding = AUDIO_ENCODING_ULAW;
+ printf("\nport %d gain %d rate %d chan %d prec %d encode %d\n",
+ info.play.port, info.play.gain, info.play.sample_rate,
+ info.play.channels, info.play.precision,
+ info.play.encoding);
+ ioctl(fd, AUDIO_SETINFO, &info);
+#endif
+
+ /*
+ * Unless specified otherwise, read the system clock and
+ * initialize the time.
+ */
+ gettimeofday(&TimeValue, NULL); // Now always read the system time to keep "real time" of operation.
+ NowRealTime = BaseRealTime = SecondsPartOfTime = TimeValue.tv_sec;
+ SecondsRunningSimulationTime = 0; // Just starting simulation, running zero seconds as of now.
+ StabilityCount = 0; // No stability yet.
+
+ if (utc)
+ {
+ DayOfYear = ConvertMonthDayToDayOfYear (Year, Month, DayOfMonth);
+ }
+ else
+ {
+ /* Apply offset to time. */
+ if (UseOffsetSecondsInt >= 0)
+ SecondsPartOfTime += (time_t) UseOffsetSecondsInt;
+ else
+ SecondsPartOfTime -= (time_t) (-UseOffsetSecondsInt);
+
+ TimeStructure = gmtime(&SecondsPartOfTime);
+ Minute = TimeStructure->tm_min;
+ Hour = TimeStructure->tm_hour;
+ DayOfYear = TimeStructure->tm_yday + 1;
+ Year = TimeStructure->tm_year % 100;
+ Second = TimeStructure->tm_sec;
+
+ /*
+ * Delay the first second so the generator is accurately
+ * aligned with the system clock within one sample (125
+ * microseconds ).
+ */
+ delay(SECOND - TimeValue.tv_usec * 8 / 1000);
+ }
+
+ StraightBinarySeconds = Second + (Minute * SECONDS_PER_MINUTE) + (Hour * SECONDS_PER_HOUR);
+
+ memset(code, 0, sizeof(code));
+ switch (encode) {
+
+ /*
+ * For WWV/H and default time, carefully set the signal
+ * generator seconds number to agree with the current time.
+ */
+ case WWV:
+ printf("WWV time signal, starting point:\n");
+ printf(" Year = %02d, Day of year = %03d, Time = %02d:%02d:%02d, Minute tone = %d Hz, Hour tone = %d Hz.\n",
+ Year, DayOfYear, Hour, Minute, Second, tone, HourTone);
+ snprintf(code, sizeof(code), "%01d%03d%02d%02d%01d",
+ Year / 10, DayOfYear, Hour, Minute, Year % 10);
+ if (Verbose)
+ {
+ printf("\n Year = %2.2d, Day of year = %3d, Time = %2.2d:%2.2d:%2.2d, Code = %s",
+ Year, DayOfYear, Hour, Minute, Second, code);
+
+ if ((EnableRateCorrection) || (RemoveCycle) || (AddCycle))
+ printf (", CountOfSecondsSent = %d, TotalCyclesAdded = %d, TotalCyclesRemoved = %d\n", CountOfSecondsSent, TotalCyclesAdded, TotalCyclesRemoved);
+ else
+ printf ("\n");
+ }
+
+ ptr = 8;
+ for (BitNumber = 0; BitNumber <= Second; BitNumber++) {
+ if (progx[BitNumber].sw == DEC)
+ ptr--;
+ }
+ break;
+
+ /*
+ * For IRIG the signal generator runs every second, so requires
+ * no additional alignment.
+ */
+ case IRIG:
+ printf ("IRIG-B time signal, starting point:\n");
+ printf (" Year = %02d, Day of year = %03d, Time = %02d:%02d:%02d, Straight binary seconds (SBS) = %05d / 0x%04X.\n",
+ Year, DayOfYear, Hour, Minute, Second, StraightBinarySeconds, StraightBinarySeconds);
+ printf ("\n");
+ if (Verbose)
+ {
+ printf ("Codes: \".\" = marker/position indicator, \"-\" = zero dummy bit, \"0\" = zero bit, \"1\" = one bit.\n");
+ if ((EnableRateCorrection) || (AddCycle) || (RemoveCycle))
+ {
+ printf (" \"o\" = short zero, \"*\" = long zero, \"x\" = short one, \"+\" = long one.\n");
+ }
+ printf ("Numerical values are time order reversed in output to make it easier to read.\n");
+ /* 111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999 */
+ /* 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 */
+ printf ("\n");
+ printf ("Legend of output codes:\n");
+ //printf ("\n");
+ //printf ("| StraightBinSecs | IEEE_1344_Control | Year | Day_of_Year | Hours | Minutes |Seconds |\n");
+ //printf ("| --------------- | ----------------- | ---- | ----------- | ----- | ------- |------- |\n");
+ //printf ("| | | | | | | |\n");
+ }
+ break;
+ }
+
+ /*
+ * Run the signal generator to generate new timecode strings
+ * once per minute for WWV/H and once per second for IRIG.
+ */
+ for (CountOfSecondsSent=0; ((SecondsToSend==0) || (CountOfSecondsSent<SecondsToSend)); CountOfSecondsSent++)
+ {
+ if ((encode == IRIG) && (((Second % 20) == 0) || (CountOfSecondsSent == 0)))
+ {
+ printf ("\n");
+
+ printf (" Year = %02d, Day of year = %03d, Time = %02d:%02d:%02d, Straight binary seconds (SBS) = %05d / 0x%04X.\n",
+ Year, DayOfYear, Hour, Minute, Second, StraightBinarySeconds, StraightBinarySeconds);
+ if ((EnableRateCorrection) || (RemoveCycle) || (AddCycle))
+ {
+ printf (" CountOfSecondsSent = %d, TotalCyclesAdded = %d, TotalCyclesRemoved = %d\n", CountOfSecondsSent, TotalCyclesAdded, TotalCyclesRemoved);
+ if ((CountOfSecondsSent != 0) && ((TotalCyclesAdded != 0) || (TotalCyclesRemoved != 0)))
+ {
+ RatioError = ((float) (TotalCyclesAdded - TotalCyclesRemoved)) / (1000.0 * (float) CountOfSecondsSent);
+ printf (" Adjusted by %2.1f%%, apparent send frequency is %4.2f Hz not %d Hz.\n\n",
+ RatioError*100.0, (1.0+RatioError)*((float) SetSampleRate), SetSampleRate);
+ }
+ }
+ else
+ printf ("\n");
+
+ /* printf ("|Seconds | Minutes | Hours | Day_of_Year | Year | IEEE_1344_Control | StraightBinSecs |\n");
+ printf ("|------- | ------- | ----- | ----------- | ---- | ----------------- |-------------------|\n");
+ printf ("| | | | | | | |\n");*/
+ printf ("| StraightBinSecs | IEEE_1344_Control | Year | Day_of_Year | Hours | Minutes |Seconds |\n");
+ printf ("| --------------- | ----------------- | ---- | ----------- | ----- | ------- |------- |\n");
+ printf ("| | | | | | | |\n");
+ }
+
+ if (RemoveCycle)
+ {
+ RateCorrection = -1;
+ TotalSecondsCorrected ++;
+ }
+ else
+ {
+ if (AddCycle)
+ {
+ TotalSecondsCorrected ++;
+ RateCorrection = +1;
+ }
+ else
+ RateCorrection = 0;
+ }
+
+ /*
+ * Crank the state machine to propagate carries to the
+ * year of century. Note that we delayed up to one
+ * second for alignment after reading the time, so this
+ * is the next second.
+ */
+
+ if (LeapState == LEAPSTATE_NORMAL)
+ {
+ /* If on the second of a leap (second 59 in the specified minute), then add or delete a second */
+ if ((Year == LeapYear) && (DayOfYear == LeapDayOfYear) && (Hour == LeapHour) && (Minute == LeapMinute))
+ {
+ /* To delete a second, which means we go from 58->60 instead of 58->59->00. */
+ if ((DeleteLeapSecond) && (Second == 58))
+ {
+ LeapState = LEAPSTATE_DELETING;
+
+ if (Debug)
+ printf ("\n<--- Ready to delete a leap second...\n");
+ }
+ else
+ { /* Delete takes precedence over insert. */
+ /* To add a second, which means we go from 59->60->00 instead of 59->00. */
+ if ((InsertLeapSecond) && (Second == 59))
+ {
+ LeapState = LEAPSTATE_INSERTING;
+
+ if (Debug)
+ printf ("\n<--- Ready to insert a leap second...\n");
+ }
+ }
+ }
+ }
+
+ switch (LeapState)
+ {
+ case LEAPSTATE_NORMAL:
+ Second = (Second + 1) % 60;
+ break;
+
+ case LEAPSTATE_DELETING:
+ Second = 0;
+ LeapState = LEAPSTATE_NORMAL;
+
+ if (Debug)
+ printf ("\n<--- Deleting a leap second...\n");
+ break;
+
+ case LEAPSTATE_INSERTING:
+ Second = 60;
+ LeapState = LEAPSTATE_ZERO_AFTER_INSERT;
+
+ if (Debug)
+ printf ("\n<--- Inserting a leap second...\n");
+ break;
+
+ case LEAPSTATE_ZERO_AFTER_INSERT:
+ Second = 0;
+ LeapState = LEAPSTATE_NORMAL;
+
+ if (Debug)
+ printf ("\n<--- Inserted a leap second, now back to zero...\n");
+ break;
+
+ default:
+ printf ("\n\nLeap second state invalid value of %d, aborting...", LeapState);
+ exit (-1);
+ break;
+ }
+
+ /* Check for second rollover, increment minutes and ripple upward if required. */
+ if (Second == 0) {
+ Minute++;
+ if (Minute >= 60) {
+ Minute = 0;
+ Hour++;
+ }
+
+ /* Check for activation of DST switch. */
+ /* If DST is active, this would mean that at the appointed time, we de-activate DST, */
+ /* which translates to going backward an hour (repeating the last hour). */
+ /* If DST is not active, this would mean that at the appointed time, we activate DST, */
+ /* which translates to going forward an hour (skipping the next hour). */
+ if (DstSwitchFlag)
+ {
+ /* The actual switch happens on the zero'th second of the actual minute specified. */
+ if ((Year == DstSwitchYear) && (DayOfYear == DstSwitchDayOfYear) && (Hour == DstSwitchHour) && (Minute == DstSwitchMinute))
+ {
+ if (DstFlag == 0)
+ { /* DST flag is zero, not in DST, going to DST, "spring ahead", so increment hour by two instead of one. */
+ Hour++;
+ DstFlag = 1;
+
+ /* Must adjust offset to keep consistent with UTC. */
+ /* Here we have to increase offset by one hour. If it goes from negative to positive, then we fix that. */
+ if (OffsetSignBit == 0)
+ { /* Offset is positive */
+ if (OffsetOnes == 0x0F)
+ {
+ OffsetSignBit = 1;
+ OffsetOnes = (OffsetHalf == 0) ? 8 : 7;
+ }
+ else
+ OffsetOnes++;
+ }
+ else
+ { /* Offset is negative */
+ if (OffsetOnes == 0)
+ {
+ OffsetSignBit = 0;
+ OffsetOnes = (OffsetHalf == 0) ? 1 : 0;
+ }
+ else
+ OffsetOnes--;
+ }
+
+ if (Debug)
+ printf ("\n<--- DST activated, spring ahead an hour, new offset !...\n");
+ }
+ else
+ { /* DST flag is non zero, in DST, going out of DST, "fall back", so no increment of hour. */
+ Hour--;
+ DstFlag = 0;
+
+ /* Must adjust offset to keep consistent with UTC. */
+ /* Here we have to reduce offset by one hour. If it goes negative, then we fix that. */
+ if (OffsetSignBit == 0)
+ { /* Offset is positive */
+ if (OffsetOnes == 0)
+ {
+ OffsetSignBit = 1;
+ OffsetOnes = (OffsetHalf == 0) ? 1 : 0;
+ }
+ else
+ OffsetOnes--;
+ }
+ else
+ { /* Offset is negative */
+ if (OffsetOnes == 0x0F)
+ {
+ OffsetSignBit = 0;
+ OffsetOnes = (OffsetHalf == 0) ? 8 : 7;
+ }
+ else
+ OffsetOnes++;
+ }
+
+ if (Debug)
+ printf ("\n<--- DST de-activated, fall back an hour!...\n");
+ }
+
+ DstSwitchFlag = FALSE; /* One time deal, not intended to run this program past two switches... */
+ }
+ }
+
+ if (Hour >= 24) {
+ /* Modified, just in case dumb case where activating DST advances 23h59:59 -> 01h00:00 */
+ Hour = Hour % 24;
+ DayOfYear++;
+ }
+
+ /*
+ * At year rollover check for leap second.
+ */
+ if (DayOfYear >= (Year & 0x3 ? 366 : 367)) {
+ if (leap) {
+ WWV_Second(DATA0, RateCorrection);
+ if (Verbose)
+ printf("\nLeap!");
+ leap = 0;
+ }
+ DayOfYear = 1;
+ Year++;
+ }
+ if (encode == WWV) {
+ snprintf(code, sizeof(code),
+ "%01d%03d%02d%02d%01d", Year / 10,
+ DayOfYear, Hour, Minute, Year % 10);
+ if (Verbose)
+ printf("\n Year = %2.2d, Day of year = %3d, Time = %2.2d:%2.2d:%2.2d, Code = %s",
+ Year, DayOfYear, Hour, Minute, Second, code);
+
+ if ((EnableRateCorrection) || (RemoveCycle) || (AddCycle))
+ {
+ printf (", CountOfSecondsSent = %d, TotalCyclesAdded = %d, TotalCyclesRemoved = %d\n", CountOfSecondsSent, TotalCyclesAdded, TotalCyclesRemoved);
+ if ((CountOfSecondsSent != 0) && ((TotalCyclesAdded != 0) || (TotalCyclesRemoved != 0)))
+ {
+ RatioError = ((float) (TotalCyclesAdded - TotalCyclesRemoved)) / (1000.0 * (float) CountOfSecondsSent);
+ printf (" Adjusted by %2.1f%%, apparent send frequency is %4.2f Hz not %d Hz.\n\n",
+ RatioError*100.0, (1.0+RatioError)*((float) SetSampleRate), SetSampleRate);
+ }
+ }
+ else
+ printf ("\n");
+
+ ptr = 8;
+ }
+ } /* End of "if (Second == 0)" */
+
+ /* After all that, if we are in the minute just prior to a leap second, warn of leap second pending */
+ /* and of the polarity */
+ if ((Year == LeapYear) && (DayOfYear == LeapDayOfYear) && (Hour == LeapHour) && (Minute == LeapMinute))
+ {
+ LeapSecondPending = TRUE;
+ LeapSecondPolarity = DeleteLeapSecond;
+ }
+ else
+ {
+ LeapSecondPending = FALSE;
+ LeapSecondPolarity = FALSE;
+ }
+
+ /* Notification through IEEE 1344 happens during the whole minute previous to the minute specified. */
+ /* The time of that minute has been previously calculated. */
+ if ((Year == DstSwitchPendingYear) && (DayOfYear == DstSwitchPendingDayOfYear) &&
+ (Hour == DstSwitchPendingHour) && (Minute == DstSwitchPendingMinute))
+ {
+ DstPendingFlag = TRUE;
+ }
+ else
+ {
+ DstPendingFlag = FALSE;
+ }
+
+
+ StraightBinarySeconds = Second + (Minute * SECONDS_PER_MINUTE) + (Hour * SECONDS_PER_HOUR);
+
+ if (encode == IRIG) {
+ if (IrigIncludeIeee)
+ {
+ if ((OffsetOnes == 0) && (OffsetHalf == 0))
+ OffsetSignBit = 0;
+
+ ControlFunctions = (LeapSecondPending == 0 ? 0x00000 : 0x00001) | (LeapSecondPolarity == 0 ? 0x00000 : 0x00002)
+ | (DstPendingFlag == 0 ? 0x00000 : 0x00004) | (DstFlag == 0 ? 0x00000 : 0x00008)
+ | (OffsetSignBit == 0 ? 0x00000 : 0x00010) | ((OffsetOnes & 0x0F) << 5) | (OffsetHalf == 0 ? 0x00000 : 0x00200)
+ | ((TimeQuality & 0x0F) << 10);
+ /* if (Verbose)
+ printf ("\nDstFlag = %d, OffsetSignBit = %d, OffsetOnes = %d, OffsetHalf = %d, TimeQuality = 0x%1.1X ==> ControlFunctions = 0x%5.5X...",
+ DstFlag, OffsetSignBit, OffsetOnes, OffsetHalf, TimeQuality, ControlFunctions);
+ */
+ }
+ else
+ ControlFunctions = 0;
+
+ /*
+ YearDay HourMin Sec
+ snprintf(code, sizeof(code), "%04x%04d%06d%02d%02d%02d",
+ 0, Year, DayOfYear, Hour, Minute, Second);
+ */
+ if (IrigIncludeYear) {
+ snprintf(ParityString, sizeof(ParityString),
+ "%04X%02d%04d%02d%02d%02d",
+ ControlFunctions & 0x7FFF, Year,
+ DayOfYear, Hour, Minute, Second);
+ } else {
+ snprintf(ParityString, sizeof(ParityString),
+ "%04X%02d%04d%02d%02d%02d",
+ ControlFunctions & 0x7FFF,
+ 0, DayOfYear, Hour, Minute, Second);
+ }
+
+ if (IrigIncludeIeee)
+ {
+ ParitySum = 0;
+ for (StringPointer=ParityString; *StringPointer!=NUL; StringPointer++)
+ {
+ switch (toupper(*StringPointer))
+ {
+ case '1':
+ case '2':
+ case '4':
+ case '8':
+ ParitySum += 1;
+ break;
+
+ case '3':
+ case '5':
+ case '6':
+ case '9':
+ case 'A':
+ case 'C':
+ ParitySum += 2;
+ break;
+
+ case '7':
+ case 'B':
+ case 'D':
+ case 'E':
+ ParitySum += 3;
+ break;
+
+ case 'F':
+ ParitySum += 4;
+ break;
+ }
+ }
+
+ if ((ParitySum & 0x01) == 0x01)
+ ParityValue = 0x01;
+ else
+ ParityValue = 0;
+ }
+ else
+ ParityValue = 0;
+
+ ControlFunctions |= ((ParityValue & 0x01) << 14);
+
+ if (IrigIncludeYear) {
+ snprintf(code, sizeof(code),
+ /* YearDay HourMin Sec */
+ "%05X%05X%02d%04d%02d%02d%02d",
+ StraightBinarySeconds,
+ ControlFunctions, Year, DayOfYear,
+ Hour, Minute, Second);
+ } else {
+ snprintf(code, sizeof(code),
+ /* YearDay HourMin Sec */
+ "%05X%05X%02d%04d%02d%02d%02d",
+ StraightBinarySeconds,
+ ControlFunctions, 0, DayOfYear,
+ Hour, Minute, Second);
+ }
+
+ if (Debug)
+ printf("\nCode string: %s, ParityString = %s, ParitySum = 0x%2.2X, ParityValue = %d, DstFlag = %d...\n", code, ParityString, ParitySum, ParityValue, DstFlag);
+
+ ptr = strlen(code)-1;
+ OldPtr = 0;
+ }
+
+ /*
+ * Generate data for the second
+ */
+ switch (encode) {
+
+ /*
+ * The IRIG second consists of 20 BCD digits of width-
+ * modulateod pulses at 2, 5 and 8 ms and modulated 50
+ * percent on the 1000-Hz carrier.
+ */
+ case IRIG:
+ /* Initialize the output string */
+ OutputDataString[0] = '\0';
+
+ for (BitNumber = 0; BitNumber < 100; BitNumber++) {
+ FrameNumber = (BitNumber/10) + 1;
+ switch (FrameNumber)
+ {
+ case 1:
+ /* bits 0 to 9, first frame */
+ sw = progz[BitNumber % 10].sw;
+ arg = progz[BitNumber % 10].arg;
+ break;
+
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ /* bits 10 to 59, second to sixth frame */
+ sw = progy[BitNumber % 10].sw;
+ arg = progy[BitNumber % 10].arg;
+ break;
+
+ case 7:
+ /* bits 60 to 69, seventh frame */
+ sw = progw[BitNumber % 10].sw;
+ arg = progw[BitNumber % 10].arg;
+ break;
+
+ case 8:
+ /* bits 70 to 79, eighth frame */
+ sw = progv[BitNumber % 10].sw;
+ arg = progv[BitNumber % 10].arg;
+ break;
+
+ case 9:
+ /* bits 80 to 89, ninth frame */
+ sw = progw[BitNumber % 10].sw;
+ arg = progw[BitNumber % 10].arg;
+ break;
+
+ case 10:
+ /* bits 90 to 99, tenth frame */
+ sw = progu[BitNumber % 10].sw;
+ arg = progu[BitNumber % 10].arg;
+ break;
+
+ default:
+ /* , Unexpected values of FrameNumber */
+ printf ("\n\nUnexpected value of FrameNumber = %d, cannot parse, aborting...\n\n", FrameNumber);
+ exit (-1);
+ break;
+ }
+
+ switch(sw) {
+
+ case DECC: /* decrement pointer and send bit. */
+ ptr--;
+ case COEF: /* send BCD bit */
+ AsciiValue = toupper(code[ptr]);
+ HexValue = isdigit(AsciiValue) ? AsciiValue - '0' : (AsciiValue - 'A')+10;
+ /* if (Debug) {
+ if (ptr != OldPtr) {
+ if (Verbose)
+ printf("\n(%c->%X)", AsciiValue, HexValue);
+ OldPtr = ptr;
+ }
+ }
+ */
+ // OK, adjust all unused bits in hundreds of days.
+ if ((FrameNumber == 5) && ((BitNumber % 10) > 1))
+ {
+ if (RateCorrection < 0)
+ { // Need to remove cycles to catch up.
+ if ((HexValue & arg) != 0)
+ {
+ if (Unmodulated)
+ {
+ poop(M5, 1000, HIGH, UnmodulatedInverted);
+ poop(M5-1, 1000, LOW, UnmodulatedInverted);
+
+ TotalCyclesRemoved += 1;
+ }
+ else
+ {
+ peep(M5, 1000, HIGH);
+ peep(M5-1, 1000, LOW);
+
+ TotalCyclesRemoved += 1;
+ }
+ strlcat(OutputDataString, "x", OUTPUT_DATA_STRING_LENGTH);
+ }
+ else
+ {
+ if (Unmodulated)
+ {
+ poop(M2, 1000, HIGH, UnmodulatedInverted);
+ poop(M8-1, 1000, LOW, UnmodulatedInverted);
+
+ TotalCyclesRemoved += 1;
+ }
+ else
+ {
+ peep(M2, 1000, HIGH);
+ peep(M8-1, 1000, LOW);
+
+ TotalCyclesRemoved += 1;
+ }
+ strlcat(OutputDataString, "o", OUTPUT_DATA_STRING_LENGTH);
+ }
+ } // End of true clause for "if (RateCorrection < 0)"
+ else
+ { // Else clause for "if (RateCorrection < 0)"
+ if (RateCorrection > 0)
+ { // Need to add cycles to slow back down.
+ if ((HexValue & arg) != 0)
+ {
+ if (Unmodulated)
+ {
+ poop(M5, 1000, HIGH, UnmodulatedInverted);
+ poop(M5+1, 1000, LOW, UnmodulatedInverted);
+
+ TotalCyclesAdded += 1;
+ }
+ else
+ {
+ peep(M5, 1000, HIGH);
+ peep(M5+1, 1000, LOW);
+
+ TotalCyclesAdded += 1;
+ }
+ strlcat(OutputDataString, "+", OUTPUT_DATA_STRING_LENGTH);
+ }
+ else
+ {
+ if (Unmodulated)
+ {
+ poop(M2, 1000, HIGH, UnmodulatedInverted);
+ poop(M8+1, 1000, LOW, UnmodulatedInverted);
+
+ TotalCyclesAdded += 1;
+ }
+ else
+ {
+ peep(M2, 1000, HIGH);
+ peep(M8+1, 1000, LOW);
+
+ TotalCyclesAdded += 1;
+ }
+ strlcat(OutputDataString, "*", OUTPUT_DATA_STRING_LENGTH);
+ }
+ } // End of true clause for "if (RateCorrection > 0)"
+ else
+ { // Else clause for "if (RateCorrection > 0)"
+ // Rate is OK, just do what you feel!
+ if ((HexValue & arg) != 0)
+ {
+ if (Unmodulated)
+ {
+ poop(M5, 1000, HIGH, UnmodulatedInverted);
+ poop(M5, 1000, LOW, UnmodulatedInverted);
+ }
+ else
+ {
+ peep(M5, 1000, HIGH);
+ peep(M5, 1000, LOW);
+ }
+ strlcat(OutputDataString, "1", OUTPUT_DATA_STRING_LENGTH);
+ }
+ else
+ {
+ if (Unmodulated)
+ {
+ poop(M2, 1000, HIGH, UnmodulatedInverted);
+ poop(M8, 1000, LOW, UnmodulatedInverted);
+ }
+ else
+ {
+ peep(M2, 1000, HIGH);
+ peep(M8, 1000, LOW);
+ }
+ strlcat(OutputDataString, "0", OUTPUT_DATA_STRING_LENGTH);
+ }
+ } // End of else clause for "if (RateCorrection > 0)"
+ } // End of else claues for "if (RateCorrection < 0)"
+ } // End of true clause for "if ((FrameNumber == 5) && (BitNumber == 8))"
+ else
+ { // Else clause for "if ((FrameNumber == 5) && (BitNumber == 8))"
+ if ((HexValue & arg) != 0)
+ {
+ if (Unmodulated)
+ {
+ poop(M5, 1000, HIGH, UnmodulatedInverted);
+ poop(M5, 1000, LOW, UnmodulatedInverted);
+ }
+ else
+ {
+ peep(M5, 1000, HIGH);
+ peep(M5, 1000, LOW);
+ }
+ strlcat(OutputDataString, "1", OUTPUT_DATA_STRING_LENGTH);
+ }
+ else
+ {
+ if (Unmodulated)
+ {
+ poop(M2, 1000, HIGH, UnmodulatedInverted);
+ poop(M8, 1000, LOW, UnmodulatedInverted);
+ }
+ else
+ {
+ peep(M2, 1000, HIGH);
+ peep(M8, 1000, LOW);
+ }
+ strlcat(OutputDataString, "0", OUTPUT_DATA_STRING_LENGTH);
+ }
+ } // end of else clause for "if ((FrameNumber == 5) && (BitNumber == 8))"
+ break;
+
+ case DECZ: /* decrement pointer and send zero bit */
+ ptr--;
+ if (Unmodulated)
+ {
+ poop(M2, 1000, HIGH, UnmodulatedInverted);
+ poop(M8, 1000, LOW, UnmodulatedInverted);
+ }
+ else
+ {
+ peep(M2, 1000, HIGH);
+ peep(M8, 1000, LOW);
+ }
+ strlcat(OutputDataString, "-", OUTPUT_DATA_STRING_LENGTH);
+ break;
+
+ case DEC: /* send marker/position indicator IM/PI bit */
+ ptr--;
+ case NODEC: /* send marker/position indicator IM/PI bit but no decrement pointer */
+ case MIN: /* send "second start" marker/position indicator IM/PI bit */
+ if (Unmodulated)
+ {
+ poop(arg, 1000, HIGH, UnmodulatedInverted);
+ poop(10 - arg, 1000, LOW, UnmodulatedInverted);
+ }
+ else
+ {
+ peep(arg, 1000, HIGH);
+ peep(10 - arg, 1000, LOW);
+ }
+ strlcat(OutputDataString, ".", OUTPUT_DATA_STRING_LENGTH);
+ break;
+
+ default:
+ printf ("\n\nUnknown state machine value \"%d\", unable to continue, aborting...\n\n", sw);
+ exit (-1);
+ break;
+ }
+ if (ptr < 0)
+ break;
+ }
+ ReverseString ( OutputDataString );
+ if (Verbose)
+ {
+ printf("%s", OutputDataString);
+ if (RateCorrection > 0)
+ printf(" fast\n");
+ else
+ {
+ if (RateCorrection < 0)
+ printf (" slow\n");
+ else
+ printf ("\n");
+ }
+ }
+ break;
+
+ /*
+ * The WWV/H second consists of 9 BCD digits of width-
+ * modulateod pulses 200, 500 and 800 ms at 100-Hz.
+ */
+ case WWV:
+ sw = progx[Second].sw;
+ arg = progx[Second].arg;
+ switch(sw) {
+
+ case DATA: /* send data bit */
+ WWV_Second(arg, RateCorrection);
+ if (Verbose)
+ {
+ if (arg == DATA0)
+ printf ("0");
+ else
+ {
+ if (arg == DATA1)
+ printf ("1");
+ else
+ {
+ if (arg == PI)
+ printf ("P");
+ else
+ printf ("?");
+ }
+ }
+ }
+ break;
+
+ case DATAX: /* send data bit */
+ WWV_SecondNoTick(arg, RateCorrection);
+ if (Verbose)
+ {
+ if (arg == DATA0)
+ printf ("0");
+ else
+ {
+ if (arg == DATA1)
+ printf ("1");
+ else
+ {
+ if (arg == PI)
+ printf ("P");
+ else
+ printf ("?");
+ }
+ }
+ }
+ break;
+
+ case COEF: /* send BCD bit */
+ if (code[ptr] & arg) {
+ WWV_Second(DATA1, RateCorrection);
+ if (Verbose)
+ printf("1");
+ } else {
+ WWV_Second(DATA0, RateCorrection);
+ if (Verbose)
+ printf("0");
+ }
+ break;
+
+ case LEAP: /* send leap bit */
+ if (leap) {
+ WWV_Second(DATA1, RateCorrection);
+ if (Verbose)
+ printf("L");
+ } else {
+ WWV_Second(DATA0, RateCorrection);
+ if (Verbose)
+ printf("0");
+ }
+ break;
+
+ case DEC: /* send data bit */
+ ptr--;
+ WWV_Second(arg, RateCorrection);
+ if (Verbose)
+ {
+ if (arg == DATA0)
+ printf ("0");
+ else
+ {
+ if (arg == DATA1)
+ printf ("1");
+ else
+ {
+ if (arg == PI)
+ printf ("P");
+ else
+ printf ("?");
+ }
+ }
+ }
+ break;
+
+ case DECX: /* send data bit with no tick */
+ ptr--;
+ WWV_SecondNoTick(arg, RateCorrection);
+ if (Verbose)
+ {
+ if (arg == DATA0)
+ printf ("0");
+ else
+ {
+ if (arg == DATA1)
+ printf ("1");
+ else
+ {
+ if (arg == PI)
+ printf ("P");
+ else
+ printf ("?");
+ }
+ }
+ }
+ break;
+
+ case MIN: /* send minute sync */
+ if (Minute == 0)
+ {
+ peep(arg, HourTone, HIGH);
+
+ if (RateCorrection < 0)
+ {
+ peep( 990 - arg, HourTone, OFF);
+ TotalCyclesRemoved += 10;
+
+ if (Debug)
+ printf ("\n* Shorter Second: ");
+ }
+ else
+ {
+ if (RateCorrection > 0)
+ {
+ peep(1010 - arg, HourTone, OFF);
+
+ TotalCyclesAdded += 10;
+
+ if (Debug)
+ printf ("\n* Longer Second: ");
+ }
+ else
+ {
+ peep(1000 - arg, HourTone, OFF);
+ }
+ }
+
+ if (Verbose)
+ printf("H");
+ }
+ else
+ {
+ peep(arg, tone, HIGH);
+
+ if (RateCorrection < 0)
+ {
+ peep( 990 - arg, tone, OFF);
+ TotalCyclesRemoved += 10;
+
+ if (Debug)
+ printf ("\n* Shorter Second: ");
+ }
+ else
+ {
+ if (RateCorrection > 0)
+ {
+ peep(1010 - arg, tone, OFF);
+
+ TotalCyclesAdded += 10;
+
+ if (Debug)
+ printf ("\n* Longer Second: ");
+ }
+ else
+ {
+ peep(1000 - arg, tone, OFF);
+ }
+ }
+
+ if (Verbose)
+ printf("M");
+ }
+ break;
+
+ case DUT1: /* send DUT1 bits */
+ if (dut1 & arg)
+ {
+ WWV_Second(DATA1, RateCorrection);
+ if (Verbose)
+ printf("1");
+ }
+ else
+ {
+ WWV_Second(DATA0, RateCorrection);
+ if (Verbose)
+ printf("0");
+ }
+ break;
+
+ case DST1: /* send DST1 bit */
+ ptr--;
+ if (DstFlag)
+ {
+ WWV_Second(DATA1, RateCorrection);
+ if (Verbose)
+ printf("1");
+ }
+ else
+ {
+ WWV_Second(DATA0, RateCorrection);
+ if (Verbose)
+ printf("0");
+ }
+ break;
+
+ case DST2: /* send DST2 bit */
+ if (DstFlag)
+ {
+ WWV_Second(DATA1, RateCorrection);
+ if (Verbose)
+ printf("1");
+ }
+ else
+ {
+ WWV_Second(DATA0, RateCorrection);
+ if (Verbose)
+ printf("0");
+ }
+ break;
+ }
+ }
+
+ if (EnableRateCorrection)
+ {
+ SecondsRunningSimulationTime++;
+
+ gettimeofday(&TimeValue, NULL);
+ NowRealTime = TimeValue.tv_sec;
+
+ if (NowRealTime >= BaseRealTime) // Just in case system time corrects backwards, do not blow up.
+ {
+ SecondsRunningRealTime = (unsigned) (NowRealTime - BaseRealTime);
+ SecondsRunningDifference = SecondsRunningSimulationTime - SecondsRunningRealTime;
+
+ if (Debug)
+ {
+ printf ("> NowRealTime = 0x%8.8X, BaseRealtime = 0x%8.8X, SecondsRunningRealTime = 0x%8.8X, SecondsRunningSimulationTime = 0x%8.8X.\n",
+ (unsigned) NowRealTime, (unsigned) BaseRealTime, SecondsRunningRealTime, SecondsRunningSimulationTime);
+ printf ("> SecondsRunningDifference = 0x%8.8X, ExpectedRunningDifference = 0x%8.8X.\n",
+ SecondsRunningDifference, ExpectedRunningDifference);
+ }
+
+ if (SecondsRunningSimulationTime > RUN_BEFORE_STABILITY_CHECK)
+ {
+ if (StabilityCount < MINIMUM_STABILITY_COUNT)
+ {
+ if (StabilityCount == 0)
+ {
+ ExpectedRunningDifference = SecondsRunningDifference;
+ StabilityCount++;
+ if (Debug)
+ printf ("> Starting stability check.\n");
+ }
+ else
+ { // Else for "if (StabilityCount == 0)"
+ if ((ExpectedRunningDifference+INITIAL_STABILITY_BAND > SecondsRunningDifference)
+ && (ExpectedRunningDifference-INITIAL_STABILITY_BAND < SecondsRunningDifference))
+ { // So far, still within stability band, increment count.
+ StabilityCount++;
+ if (Debug)
+ printf ("> StabilityCount = %d.\n", StabilityCount);
+ }
+ else
+ { // Outside of stability band, start over.
+ StabilityCount = 0;
+ if (Debug)
+ printf ("> Out of stability band, start over.\n");
+ }
+ } // End of else for "if (StabilityCount == 0)"
+ } // End of true clause for "if (StabilityCount < MINIMUM_STABILITY_COUNT))"
+ else
+ { // Else clause for "if (StabilityCount < MINIMUM_STABILITY_COUNT))" - OK, so we are supposed to be stable.
+ if (AddCycle)
+ {
+ if (ExpectedRunningDifference >= SecondsRunningDifference)
+ {
+ if (Debug)
+ printf ("> Was adding cycles, ExpectedRunningDifference >= SecondsRunningDifference, can stop it now.\n");
+
+ AddCycle = FALSE;
+ RemoveCycle = FALSE;
+ }
+ else
+ {
+ if (Debug)
+ printf ("> Was adding cycles, not done yet.\n");
+ }
+ }
+ else
+ {
+ if (RemoveCycle)
+ {
+ if (ExpectedRunningDifference <= SecondsRunningDifference)
+ {
+ if (Debug)
+ printf ("> Was removing cycles, ExpectedRunningDifference <= SecondsRunningDifference, can stop it now.\n");
+
+ AddCycle = FALSE;
+ RemoveCycle = FALSE;
+ }
+ else
+ {
+ if (Debug)
+ printf ("> Was removing cycles, not done yet.\n");
+ }
+ }
+ else
+ {
+ if ((ExpectedRunningDifference+RUNNING_STABILITY_BAND > SecondsRunningDifference)
+ && (ExpectedRunningDifference-RUNNING_STABILITY_BAND < SecondsRunningDifference))
+ { // All is well, within tolerances.
+ if (Debug)
+ printf ("> All is well, within tolerances.\n");
+ }
+ else
+ { // Oops, outside tolerances. Else clause of "if ((ExpectedRunningDifference...SecondsRunningDifference)"
+ if (ExpectedRunningDifference > SecondsRunningDifference)
+ {
+ if (Debug)
+ printf ("> ExpectedRunningDifference > SecondsRunningDifference, running behind real time.\n");
+
+ // Behind real time, have to add a cycle to slow down and get back in sync.
+ AddCycle = FALSE;
+ RemoveCycle = TRUE;
+ }
+ else
+ { // Else clause of "if (ExpectedRunningDifference < SecondsRunningDifference)"
+ if (ExpectedRunningDifference < SecondsRunningDifference)
+ {
+ if (Debug)
+ printf ("> ExpectedRunningDifference < SecondsRunningDifference, running ahead of real time.\n");
+
+ // Ahead of real time, have to remove a cycle to speed up and get back in sync.
+ AddCycle = TRUE;
+ RemoveCycle = FALSE;
+ }
+ else
+ {
+ if (Debug)
+ printf ("> Oops, outside tolerances, but doesn't fit the profiles, how can this be?\n");
+ }
+ } // End of else clause of "if (ExpectedRunningDifference > SecondsRunningDifference)"
+ } // End of else clause of "if ((ExpectedRunningDifference...SecondsRunningDifference)"
+ } // End of else clause of "if (RemoveCycle)".
+ } // End of else clause of "if (AddCycle)".
+ } // End of else clause for "if (StabilityCount < MINIMUM_STABILITY_COUNT))"
+ } // End of true clause for "if ((SecondsRunningSimulationTime > RUN_BEFORE_STABILITY_CHECK)"
+ } // End of true clause for "if (NowRealTime >= BaseRealTime)"
+ else
+ {
+ if (Debug)
+ printf ("> Hmm, time going backwards?\n");
+ }
+ } // End of true clause for "if (EnableRateCorrection)"
+
+ fflush (stdout);
+ }
+
+
+printf ("\n\n>> Completed %d seconds, exiting...\n\n", SecondsToSend);
+return (0);
+}
+
+
+/*
+ * Generate WWV/H 0 or 1 data pulse.
+ */
+void WWV_Second(
+ int code, /* DATA0, DATA1, PI */
+ int Rate /* <0 -> do a short second, 0 -> normal second, >0 -> long second */
+ )
+{
+ /*
+ * The WWV data pulse begins with 5 ms of 1000 Hz follwed by a
+ * guard time of 25 ms. The data pulse is 170, 570 or 770 ms at
+ * 100 Hz corresponding to 0, 1 or position indicator (PI),
+ * respectively. Note the 100-Hz data pulses are transmitted 6
+ * dB below the 1000-Hz sync pulses. Originally the data pulses
+ * were transmited 10 dB below the sync pulses, but the station
+ * engineers increased that to 6 dB because the Heath GC-1000
+ * WWV/H radio clock worked much better.
+ */
+ peep(5, tone, HIGH); /* send seconds tick */
+ peep(25, tone, OFF);
+ peep(code - 30, 100, LOW); /* send data */
+
+ /* The quiet time is shortened or lengthened to get us back on time */
+ if (Rate < 0)
+ {
+ peep( 990 - code, 100, OFF);
+
+ TotalCyclesRemoved += 10;
+
+ if (Debug)
+ printf ("\n* Shorter Second: ");
+ }
+ else
+ {
+ if (Rate > 0)
+ {
+ peep(1010 - code, 100, OFF);
+
+ TotalCyclesAdded += 10;
+
+ if (Debug)
+ printf ("\n* Longer Second: ");
+ }
+ else
+ peep(1000 - code, 100, OFF);
+ }
+}
+
+/*
+ * Generate WWV/H 0 or 1 data pulse, with no tick, for 29th and 59th seconds
+ */
+void WWV_SecondNoTick(
+ int code, /* DATA0, DATA1, PI */
+ int Rate /* <0 -> do a short second, 0 -> normal second, >0 -> long second */
+ )
+{
+ /*
+ * The WWV data pulse begins with 5 ms of 1000 Hz follwed by a
+ * guard time of 25 ms. The data pulse is 170, 570 or 770 ms at
+ * 100 Hz corresponding to 0, 1 or position indicator (PI),
+ * respectively. Note the 100-Hz data pulses are transmitted 6
+ * dB below the 1000-Hz sync pulses. Originally the data pulses
+ * were transmited 10 dB below the sync pulses, but the station
+ * engineers increased that to 6 dB because the Heath GC-1000
+ * WWV/H radio clock worked much better.
+ */
+ peep(30, tone, OFF); /* send seconds non-tick */
+ peep(code - 30, 100, LOW); /* send data */
+
+ /* The quiet time is shortened or lengthened to get us back on time */
+ if (Rate < 0)
+ {
+ peep( 990 - code, 100, OFF);
+
+ TotalCyclesRemoved += 10;
+
+ if (Debug)
+ printf ("\n* Shorter Second: ");
+ }
+ else
+ {
+ if (Rate > 0)
+ {
+ peep(1010 - code, 100, OFF);
+
+ TotalCyclesAdded += 10;
+
+ if (Debug)
+ printf ("\n* Longer Second: ");
+ }
+ else
+ peep(1000 - code, 100, OFF);
+ }
+}
+
+/*
+ * Generate cycles of 100 Hz or any multiple of 100 Hz.
+ */
+void peep(
+ int pulse, /* pulse length (ms) */
+ int freq, /* frequency (Hz) */
+ int amp /* amplitude */
+ )
+{
+ int increm; /* phase increment */
+ int i, j;
+
+ if (amp == OFF || freq == 0)
+ increm = 10;
+ else
+ increm = freq / 100;
+ j = 0;
+ for (i = 0 ; i < pulse * 8; i++) {
+ switch (amp) {
+
+ case HIGH:
+ buffer[bufcnt++] = ~c6000[j];
+ break;
+
+ case LOW:
+ buffer[bufcnt++] = ~c3000[j];
+ break;
+
+ default:
+ buffer[bufcnt++] = ~0;
+ }
+ if (bufcnt >= BUFLNG) {
+ write(fd, buffer, BUFLNG);
+ bufcnt = 0;
+ }
+ j = (j + increm) % 80;
+ }
+}
+
+
+/*
+ * Generate unmodulated from similar tables.
+ */
+void poop(
+ int pulse, /* pulse length (ms) */
+ int freq, /* frequency (Hz) */
+ int amp, /* amplitude */
+ int inverted /* is upside down */
+ )
+{
+ int increm; /* phase increment */
+ int i, j;
+
+ if (amp == OFF || freq == 0)
+ increm = 10;
+ else
+ increm = freq / 100;
+ j = 0;
+ for (i = 0 ; i < pulse * 8; i++) {
+ switch (amp) {
+
+ case HIGH:
+ if (inverted)
+ buffer[bufcnt++] = ~u3000[j];
+ else
+ buffer[bufcnt++] = ~u6000[j];
+ break;
+
+ case LOW:
+ if (inverted)
+ buffer[bufcnt++] = ~u6000[j];
+ else
+ buffer[bufcnt++] = ~u3000[j];
+ break;
+
+ default:
+ buffer[bufcnt++] = ~0;
+ }
+ if (bufcnt >= BUFLNG) {
+ write(fd, buffer, BUFLNG);
+ bufcnt = 0;
+ }
+ j = (j + increm) % 80;
+ }
+}
+
+/*
+ * Delay for initial phasing
+ */
+void delay (
+ int Delay /* delay in samples */
+ )
+{
+ int samples; /* samples remaining */
+
+ samples = Delay;
+ memset(buffer, 0, BUFLNG);
+ while (samples >= BUFLNG) {
+ write(fd, buffer, BUFLNG);
+ samples -= BUFLNG;
+ }
+ write(fd, buffer, samples);
+}
+
+
+/* Calc day of year from year month & day */
+/* Year - 0 means 2000, 100 means 2100. */
+/* Month - 1 means January, 12 means December. */
+/* DayOfMonth - 1 is first day of month */
+int
+ConvertMonthDayToDayOfYear (int YearValue, int MonthValue, int DayOfMonthValue)
+ {
+ int ReturnValue;
+ int LeapYear;
+ int MonthCounter;
+
+ /* Array of days in a month. Note that here January is zero. */
+ /* NB: have to add 1 to days in February in a leap year! */
+ int DaysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+
+ LeapYear = FALSE;
+ if ((YearValue % 4) == 0)
+ {
+ if ((YearValue % 100) == 0)
+ {
+ if ((YearValue % 400) == 0)
+ {
+ LeapYear = TRUE;
+ }
+ }
+ else
+ {
+ LeapYear = TRUE;
+ }
+ }
+
+ if (Debug)
+ printf ("\nConvertMonthDayToDayOfYear(): Year %d %s a leap year.\n", YearValue+2000, LeapYear ? "is" : "is not");
+
+ /* Day of month given us starts in this algorithm. */
+ ReturnValue = DayOfMonthValue;
+
+ /* Add in days in month for each month past January. */
+ for (MonthCounter=1; MonthCounter<MonthValue; MonthCounter++)
+ {
+ ReturnValue += DaysInMonth [ MonthCounter - 1 ];
+ }
+
+ /* Add a day for leap years where we are past February. */
+ if ((LeapYear) && (MonthValue > 2))
+ {
+ ReturnValue++;
+ }
+
+ if (Debug)
+ printf ("\nConvertMonthDayToDayOfYear(): %4.4d-%2.2d-%2.2d represents day %3d of year.\n",
+ YearValue+2000, MonthValue, DayOfMonthValue, ReturnValue);
+
+ return (ReturnValue);
+ }
+
+
+void
+Help ( void )
+ {
+ printf ("\n\nTime Code Generation - IRIG-B or WWV, v%d.%d, %s dmw", VERSION, ISSUE, ISSUE_DATE);
+ printf ("\n\nRCS Info:");
+ printf ( "\n $Header: /home/dmw/src/IRIG_generation/ntp-4.2.2p3/util/RCS/tg.c,v 1.28 2007/02/12 23:57:45 dmw Exp $");
+ printf ("\n\nUsage: %s [option]*", CommandName);
+ printf ("\n\nOptions: -a device_name Output audio device name (default /dev/audio)");
+ printf ( "\n -b yymmddhhmm Remove leap second at end of minute specified");
+ printf ( "\n -c seconds_to_send Number of seconds to send (default 0 = forever)");
+ printf ( "\n -d Start with IEEE 1344 DST active");
+ printf ( "\n -f format_type i = Modulated IRIG-B 1998 (no year coded)");
+ printf ( "\n 2 = Modulated IRIG-B 2002 (year coded)");
+ printf ( "\n 3 = Modulated IRIG-B w/IEEE 1344 (year & control funcs) (default)");
+ printf ( "\n 4 = Unmodulated IRIG-B w/IEEE 1344 (year & control funcs)");
+ printf ( "\n 5 = Inverted unmodulated IRIG-B w/IEEE 1344 (year & control funcs)");
+ printf ( "\n w = WWV(H)");
+ printf ( "\n -g yymmddhhmm Switch into/out of DST at beginning of minute specified");
+ printf ( "\n -i yymmddhhmm Insert leap second at end of minute specified");
+ printf ( "\n -j Disable time rate correction against system clock (default enabled)");
+ printf ( "\n -k nn Force rate correction for testing (+1 = add cycle, -1 = remove cycle)");
+ printf ( "\n -l time_offset Set offset of time sent to UTC as per computer, +/- float hours");
+ printf ( "\n -o time_offset Set IEEE 1344 time offset, +/-, to 0.5 hour (default 0)");
+ printf ( "\n -q quality_code_hex Set IEEE 1344 quality code (default 0)");
+ printf ( "\n -r sample_rate Audio sample rate (default 8000)");
+ printf ( "\n -s Set leap warning bit (WWV[H] only)");
+ printf ( "\n -t sync_frequency WWV(H) on-time pulse tone frequency (default 1200)");
+ printf ( "\n -u DUT1_offset Set WWV(H) DUT1 offset -7 to +7 (default 0)");
+#ifndef HAVE_SYS_SOUNDCARD_H
+ printf ( "\n -v initial_output_level Set initial output level (default %d, must be 0 to 255)", AUDIO_MAX_GAIN/8);
+#endif
+ printf ( "\n -x Turn off verbose output (default on)");
+ printf ( "\n -y yymmddhhmmss Set initial date and time as specified (default system time)");
+ printf ("\n\nThis software licenced under the GPL, modifications performed 2006 & 2007 by Dean Weiten");
+ printf ( "\nContact: Dean Weiten, Norscan Instruments Ltd., Winnipeg, MB, Canada, ph (204)-233-9138, E-mail dmw@norscan.com");
+ printf ("\n\n");
+ }
+
+/* Reverse string order for nicer print. */
+void
+ReverseString(char *str)
+ {
+ int StringLength;
+ int IndexCounter;
+ int CentreOfString;
+ char TemporaryCharacter;
+
+
+ StringLength = strlen(str);
+ CentreOfString = (StringLength/2)+1;
+ for (IndexCounter = StringLength; IndexCounter >= CentreOfString; IndexCounter--)
+ {
+ TemporaryCharacter = str[IndexCounter-1];
+ str[IndexCounter-1] = str[StringLength-IndexCounter];
+ str[StringLength-IndexCounter] = TemporaryCharacter;
+ }
+ }
+
diff --git a/util/tickadj.c b/util/tickadj.c
new file mode 100644
index 0000000..d54e9e6
--- /dev/null
+++ b/util/tickadj.c
@@ -0,0 +1,908 @@
+/*
+ * tickadj - read, and possibly modify, the kernel `tick' and
+ * `tickadj' variables, as well as `dosynctodr'. Note that
+ * this operates on the running kernel only. I'd like to be
+ * able to read and write the binary as well, but haven't
+ * mastered this yet.
+ *
+ * HMS: The #includes here are different from those in xntpd/ntp_unixclock.c
+ * These seem "worse".
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "ntp_types.h"
+#include "l_stdlib.h"
+
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_SYS_TIMEX_H
+# include <sys/timex.h>
+#endif
+
+#ifdef HAVE_ADJTIMEX /* Linux */
+
+struct timex txc;
+
+#if 0
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ int c, i;
+ int quiet = 0;
+ int errflg = 0;
+ char *progname;
+ extern int ntp_optind;
+ extern char *ntp_optarg;
+
+ progname = argv[0];
+ if (argc==2 && argv[1][0] != '-') { /* old Linux format, for compatability */
+ if ((i = atoi(argv[1])) > 0) {
+ txc.time_tick = i;
+ txc.modes = ADJ_TIMETICK;
+ } else {
+ fprintf(stderr, "Silly value for tick: %s\n", argv[1]);
+ errflg++;
+ }
+ } else {
+ while ((c = ntp_getopt(argc, argv, "a:qt:")) != EOF) {
+ switch (c) {
+ case 'a':
+ if ((i=atoi(ntp_optarg)) > 0) {
+ txc.tickadj = i;
+ txc.modes |= ADJ_TICKADJ;
+ } else {
+ fprintf(stderr,
+ "%s: unlikely value for tickadj: %s\n",
+ progname, ntp_optarg);
+ errflg++;
+ }
+ break;
+
+ case 'q':
+ quiet = 1;
+ break;
+
+ case 't':
+ if ((i=atoi(ntp_optarg)) > 0) {
+ txc.time_tick = i;
+ txc.modes |= ADJ_TIMETICK;
+ } else {
+ (void) fprintf(stderr,
+ "%s: unlikely value for tick: %s\n",
+ progname, ntp_optarg);
+ errflg++;
+ }
+ break;
+
+ default:
+ fprintf(stderr,
+ "Usage: %s [tick_value]\n-or- %s [ -q ] [ -t tick ] [ -a tickadj ]\n",
+ progname, progname);
+ errflg++;
+ break;
+ }
+ }
+ }
+
+ if (!errflg) {
+ if (adjtimex(&txc) < 0)
+ perror("adjtimex");
+ else if (!quiet)
+ printf("tick = %ld\ntick_adj = %d\n",
+ txc.time_tick, txc.tickadj);
+ }
+
+ exit(errflg ? 1 : 0);
+}
+#else
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ if (argc > 2)
+ {
+ fprintf(stderr, "Usage: %s [tick_value]\n", argv[0]);
+ exit(-1);
+ }
+ else if (argc == 2)
+ {
+#ifdef ADJ_TIMETICK
+ if ( (txc.time_tick = atoi(argv[1])) < 1 )
+#else
+ if ( (txc.tick = atoi(argv[1])) < 1 )
+#endif
+ {
+ fprintf(stderr, "Silly value for tick: %s\n", argv[1]);
+ exit(-1);
+ }
+#ifdef ADJ_TIMETICK
+ txc.modes = ADJ_TIMETICK;
+#else
+#ifdef MOD_OFFSET
+ txc.modes = ADJ_TICK;
+#else
+ txc.mode = ADJ_TICK;
+#endif
+#endif
+ }
+ else
+ {
+#ifdef ADJ_TIMETICK
+ txc.modes = 0;
+#else
+#ifdef MOD_OFFSET
+ txc.modes = 0;
+#else
+ txc.mode = 0;
+#endif
+#endif
+ }
+
+ if (adjtimex(&txc) < 0)
+ {
+ perror("adjtimex");
+ }
+ else
+ {
+#ifdef ADJ_TIMETICK
+ printf("tick = %ld\ntick_adj = %ld\n", txc.time_tick, txc.tickadj);
+#else
+ printf("tick = %ld\n", txc.tick);
+#endif
+ }
+
+ exit(0);
+}
+#endif
+
+#else /* not Linux... kmem tweaking: */
+
+#ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
+#include <sys/stat.h>
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef NLIST_STRUCT
+# include <nlist.h>
+#else /* not NLIST_STRUCT */ /* was defined(SYS_AUX3) || defined(SYS_AUX2) */
+# include <sys/resource.h>
+# include <sys/file.h>
+# include <a.out.h>
+# ifdef HAVE_SYS_VAR_H
+# include <sys/var.h>
+# endif
+#endif
+
+#include "ntp_stdlib.h"
+#include "ntp_io.h"
+
+#ifdef hz /* Was: RS6000 */
+# undef hz
+#endif /* hz */
+
+#ifdef HAVE_KVM_OPEN
+# include <kvm.h>
+#endif
+
+#ifdef SYS_VXWORKS
+/* vxWorks needs mode flag -casey*/
+#define open(name, flags) open(name, flags, 0777)
+#endif
+
+#ifndef L_SET /* Was: defined(SYS_PTX) || defined(SYS_IX86OSF1) */
+# define L_SET SEEK_SET
+#endif
+
+#ifndef HZ
+# define HZ DEFAULT_HZ
+#endif
+
+#define KMEM "/dev/kmem"
+#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
+
+char *progname;
+
+int dokmem = 1;
+int writetickadj = 0;
+int writeopttickadj = 0;
+int unsetdosync = 0;
+int writetick = 0;
+int quiet = 0;
+int setnoprintf = 0;
+
+const char *kmem = KMEM;
+const char *file = NULL;
+int fd = -1;
+
+static void getoffsets (off_t *, off_t *, off_t *, off_t *);
+static int openfile (const char *, int);
+static void writevar (int, off_t, int);
+static void readvar (int, off_t, int *);
+
+/*
+ * main - parse arguments and handle options
+ */
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ int c;
+ int errflg = 0;
+ off_t tickadj_offset;
+ off_t tick_offset;
+ off_t dosync_offset;
+ off_t noprintf_offset;
+ int tickadj, ktickadj; /* HMS: Why isn't this u_long? */
+ int tick, ktick; /* HMS: Why isn't this u_long? */
+ int dosynctodr;
+ int noprintf;
+ int hz;
+ int hz_int, hz_hundredths;
+ int recommend_tickadj;
+ long tmp;
+
+ init_lib();
+
+ progname = argv[0];
+ while ((c = ntp_getopt(argc, argv, "a:Adkpqst:")) != EOF)
+ {
+ switch (c)
+ {
+ case 'a':
+ writetickadj = atoi(ntp_optarg);
+ if (writetickadj <= 0)
+ {
+ (void) fprintf(stderr,
+ "%s: unlikely value for tickadj: %s\n",
+ progname, ntp_optarg);
+ errflg++;
+ }
+
+#if defined SCO5_CLOCK
+ if (writetickadj % HZ)
+ {
+ writetickadj = (writetickadj / HZ) * HZ;
+ (void) fprintf(stderr,
+ "tickadj truncated to: %d\n", writetickadj);
+ }
+#endif /* SCO5_CLOCK */
+
+ break;
+ case 'A':
+ writeopttickadj = 1;
+ break;
+ case 'd':
+ ++debug;
+ break;
+ case 'k':
+ dokmem = 1;
+ break;
+ case 'p':
+ setnoprintf = 1;
+ break;
+ case 'q':
+ quiet = 1;
+ break;
+ case 's':
+ unsetdosync = 1;
+ break;
+ case 't':
+ writetick = atoi(ntp_optarg);
+ if (writetick <= 0)
+ {
+ (void) fprintf(stderr,
+ "%s: unlikely value for tick: %s\n",
+ progname, ntp_optarg);
+ errflg++;
+ }
+ break;
+ default:
+ errflg++;
+ break;
+ }
+ }
+ if (errflg || ntp_optind != argc)
+ {
+ (void) fprintf(stderr,
+ "usage: %s [-Adkpqs] [-a newadj] [-t newtick]\n", progname);
+ exit(2);
+ }
+
+ getoffsets(&tick_offset, &tickadj_offset, &dosync_offset, &noprintf_offset);
+
+ if (debug)
+ {
+ (void) printf("tick offset = %lu\n", (unsigned long)tick_offset);
+ (void) printf("tickadj offset = %lu\n", (unsigned long)tickadj_offset);
+ (void) printf("dosynctodr offset = %lu\n", (unsigned long)dosync_offset);
+ (void) printf("noprintf offset = %lu\n", (unsigned long)noprintf_offset);
+ }
+
+ if (writetick && (tick_offset == 0))
+ {
+ (void) fprintf(stderr,
+ "No tick kernel variable\n");
+ errflg++;
+ }
+
+ if (writeopttickadj && (tickadj_offset == 0))
+ {
+ (void) fprintf(stderr,
+ "No tickadj kernel variable\n");
+ errflg++;
+ }
+
+ if (unsetdosync && (dosync_offset == 0))
+ {
+ (void) fprintf(stderr,
+ "No dosynctodr kernel variable\n");
+ errflg++;
+ }
+
+ if (setnoprintf && (noprintf_offset == 0))
+ {
+ (void) fprintf(stderr,
+ "No noprintf kernel variable\n");
+ errflg++;
+ }
+
+ if (tick_offset != 0)
+ {
+ readvar(fd, tick_offset, &tick);
+#if defined(TICK_NANO) && defined(K_TICK_NAME)
+ if (!quiet)
+ (void) printf("KERNEL %s = %d nsec\n", K_TICK_NAME, tick);
+#endif /* TICK_NANO && K_TICK_NAME */
+
+#ifdef TICK_NANO
+ tick /= 1000;
+#endif
+ }
+ else
+ {
+ tick = 0;
+ }
+
+ if (tickadj_offset != 0)
+ {
+ readvar(fd, tickadj_offset, &tickadj);
+
+#ifdef SCO5_CLOCK
+ /* scale from nsec/sec to usec/tick */
+ tickadj /= (1000L * HZ);
+#endif /*SCO5_CLOCK */
+
+#if defined(TICKADJ_NANO) && defined(K_TICKADJ_NAME)
+ if (!quiet)
+ (void) printf("KERNEL %s = %d nsec\n", K_TICKADJ_NAME, tickadj);
+#endif /* TICKADJ_NANO && K_TICKADJ_NAME */
+
+#ifdef TICKADJ_NANO
+ tickadj += 999;
+ tickadj /= 1000;
+#endif
+ }
+ else
+ {
+ tickadj = 0;
+ }
+
+ if (dosync_offset != 0)
+ {
+ readvar(fd, dosync_offset, &dosynctodr);
+ }
+
+ if (noprintf_offset != 0)
+ {
+ readvar(fd, noprintf_offset, &noprintf);
+ }
+
+ (void) close(fd);
+
+ if (unsetdosync && dosync_offset == 0)
+ {
+ (void) fprintf(stderr,
+ "%s: can't find %s in namelist\n",
+ progname,
+#ifdef K_DOSYNCTODR_NAME
+ K_DOSYNCTODR_NAME
+#else /* not K_DOSYNCTODR_NAME */
+ "dosynctodr"
+#endif /* not K_DOSYNCTODR_NAME */
+ );
+ exit(1);
+ }
+
+ hz = HZ;
+#if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK)
+ hz = (int) sysconf (_SC_CLK_TCK);
+#endif /* not HAVE_SYSCONF && _SC_CLK_TCK */
+#ifdef OVERRIDE_HZ
+ hz = DEFAULT_HZ;
+#endif
+ ktick = tick;
+#ifdef PRESET_TICK
+ tick = PRESET_TICK;
+#endif /* PRESET_TICK */
+#ifdef TICKADJ_NANO
+ tickadj /= 1000;
+ if (tickadj == 0)
+ tickadj = 1;
+#endif
+ ktickadj = tickadj;
+#ifdef PRESET_TICKADJ
+ tickadj = (PRESET_TICKADJ) ? PRESET_TICKADJ : 1;
+#endif /* PRESET_TICKADJ */
+
+ if (!quiet)
+ {
+ if (tick_offset != 0)
+ {
+ (void) printf("KERNEL tick = %d usec (from %s kernel variable)\n",
+ ktick,
+#ifdef K_TICK_NAME
+ K_TICK_NAME
+#else
+ "<this can't happen>"
+#endif
+ );
+ }
+#ifdef PRESET_TICK
+ (void) printf("PRESET tick = %d usec\n", tick);
+#endif /* PRESET_TICK */
+ if (tickadj_offset != 0)
+ {
+ (void) printf("KERNEL tickadj = %d usec (from %s kernel variable)\n",
+ ktickadj,
+#ifdef K_TICKADJ_NAME
+ K_TICKADJ_NAME
+#else
+ "<this can't happen>"
+#endif
+ );
+ }
+#ifdef PRESET_TICKADJ
+ (void) printf("PRESET tickadj = %d usec\n", tickadj);
+#endif /* PRESET_TICKADJ */
+ if (dosync_offset != 0)
+ {
+ (void) printf("dosynctodr is %s\n", dosynctodr ? "on" : "off");
+ }
+ if (noprintf_offset != 0)
+ {
+ (void) printf("kernel level printf's: %s\n",
+ noprintf ? "off" : "on");
+ }
+ }
+
+ if (tick <= 0)
+ {
+ (void) fprintf(stderr, "%s: the value of tick is silly!\n",
+ progname);
+ exit(1);
+ }
+
+ hz_int = (int)(1000000L / (long)tick);
+ hz_hundredths = (int)((100000000L / (long)tick) - ((long)hz_int * 100L));
+ if (!quiet)
+ {
+ (void) printf("KERNEL hz = %d\n", hz);
+ (void) printf("calculated hz = %d.%02d Hz\n", hz_int,
+ hz_hundredths);
+ }
+
+#if defined SCO5_CLOCK
+ recommend_tickadj = 100;
+#else /* SCO5_CLOCK */
+ tmp = (long) tick * 500L;
+ recommend_tickadj = (int)(tmp / 1000000L);
+ if (tmp % 1000000L > 0)
+ {
+ recommend_tickadj++;
+ }
+
+#ifdef MIN_REC_TICKADJ
+ if (recommend_tickadj < MIN_REC_TICKADJ)
+ {
+ recommend_tickadj = MIN_REC_TICKADJ;
+ }
+#endif /* MIN_REC_TICKADJ */
+#endif /* SCO5_CLOCK */
+
+
+ if ((!quiet) && (tickadj_offset != 0))
+ {
+ (void) printf("recommended value of tickadj = %d us\n",
+ recommend_tickadj);
+ }
+
+ if ( writetickadj == 0
+ && !writeopttickadj
+ && !unsetdosync
+ && writetick == 0
+ && !setnoprintf)
+ {
+ exit(errflg ? 1 : 0);
+ }
+
+ if (writetickadj == 0 && writeopttickadj)
+ {
+ writetickadj = recommend_tickadj;
+ }
+
+ fd = openfile(file, O_WRONLY);
+
+ if (setnoprintf && (noprintf_offset != 0))
+ {
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "setting noprintf: ");
+ (void) fflush(stderr);
+ }
+ writevar(fd, noprintf_offset, 1);
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "done!\n");
+ }
+ }
+
+ if ((writetick > 0) && (tick_offset != 0))
+ {
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "writing tick, value %d: ",
+ writetick);
+ (void) fflush(stderr);
+ }
+ writevar(fd, tick_offset, writetick);
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "done!\n");
+ }
+ }
+
+ if ((writetickadj > 0) && (tickadj_offset != 0))
+ {
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "writing tickadj, value %d: ",
+ writetickadj);
+ (void) fflush(stderr);
+ }
+
+#ifdef SCO5_CLOCK
+ /* scale from usec/tick to nsec/sec */
+ writetickadj *= (1000L * HZ);
+#endif /* SCO5_CLOCK */
+
+ writevar(fd, tickadj_offset, writetickadj);
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "done!\n");
+ }
+ }
+
+ if (unsetdosync && (dosync_offset != 0))
+ {
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "zeroing dosynctodr: ");
+ (void) fflush(stderr);
+ }
+ writevar(fd, dosync_offset, 0);
+ if (!quiet)
+ {
+ (void) fprintf(stderr, "done!\n");
+ }
+ }
+ (void) close(fd);
+ return(errflg ? 1 : 0);
+}
+
+/*
+ * getoffsets - read the magic offsets from the specified file
+ */
+static void
+getoffsets(
+ off_t *tick_off,
+ off_t *tickadj_off,
+ off_t *dosync_off,
+ off_t *noprintf_off
+ )
+{
+
+#ifndef NOKMEM
+# ifndef HAVE_KVM_OPEN
+ const char **kname;
+# endif
+#endif
+
+#ifndef NOKMEM
+# ifdef NLIST_NAME_UNION
+# define NL_B {{
+# define NL_E }}
+# else
+# define NL_B {
+# define NL_E }
+# endif
+#endif
+
+#define K_FILLER_NAME "DavidLetterman"
+
+#ifdef NLIST_EXTRA_INDIRECTION
+ int i;
+#endif
+
+#ifndef NOKMEM
+ static struct nlist nl[] =
+ {
+ NL_B
+#ifdef K_TICKADJ_NAME
+#define N_TICKADJ 0
+ K_TICKADJ_NAME
+#else
+ K_FILLER_NAME
+#endif
+ NL_E,
+ NL_B
+#ifdef K_TICK_NAME
+#define N_TICK 1
+ K_TICK_NAME
+#else
+ K_FILLER_NAME
+#endif
+ NL_E,
+ NL_B
+#ifdef K_DOSYNCTODR_NAME
+#define N_DOSYNC 2
+ K_DOSYNCTODR_NAME
+#else
+ K_FILLER_NAME
+#endif
+ NL_E,
+ NL_B
+#ifdef K_NOPRINTF_NAME
+#define N_NOPRINTF 3
+ K_NOPRINTF_NAME
+#else
+ K_FILLER_NAME
+#endif
+ NL_E,
+ NL_B "" NL_E,
+ };
+
+#ifndef HAVE_KVM_OPEN
+ static const char *kernels[] =
+ {
+#ifdef HAVE_GETBOOTFILE
+ NULL, /* *** SEE BELOW! *** */
+#endif
+ "/kernel/unix",
+ "/kernel",
+ "/vmunix",
+ "/unix",
+ "/mach",
+ "/hp-ux",
+ "/386bsd",
+ "/netbsd",
+ "/stand/vmunix",
+ "/bsd",
+ NULL
+ };
+#endif /* not HAVE_KVM_OPEN */
+
+#ifdef HAVE_KVM_OPEN
+ /*
+ * Solaris > 2.5 doesn't have a kernel file. Use the kvm_* interface
+ * to read the kernel name list. -- stolcke 3/4/96
+ */
+ kvm_t *kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, progname);
+
+ if (kvm_handle == NULL)
+ {
+ (void) fprintf(stderr,
+ "%s: kvm_open failed\n",
+ progname);
+ exit(1);
+ }
+ if (kvm_nlist(kvm_handle, nl) == -1)
+ {
+ (void) fprintf(stderr,
+ "%s: kvm_nlist failed\n",
+ progname);
+ exit(1);
+ }
+ kvm_close(kvm_handle);
+#else /* not HAVE_KVM_OPEN */
+#ifdef HAVE_GETBOOTFILE /* *** SEE HERE! *** */
+ if (kernels[0] == NULL)
+ {
+ char * cp = (char *)getbootfile();
+
+ if (cp)
+ {
+ kernels[0] = cp;
+ }
+ else
+ {
+ kernels[0] = "/Placeholder";
+ }
+ }
+#endif /* HAVE_GETBOOTFILE */
+ for (kname = kernels; *kname != NULL; kname++)
+ {
+ struct stat stbuf;
+
+ if (stat(*kname, &stbuf) == -1)
+ {
+ continue;
+ }
+ if (nlist(*kname, nl) >= 0)
+ {
+ break;
+ }
+ else
+ {
+ (void) fprintf(stderr,
+ "%s: nlist didn't find needed symbols from <%s>: %s\n",
+ progname, *kname, strerror(errno));
+ }
+ }
+ if (*kname == NULL)
+ {
+ (void) fprintf(stderr,
+ "%s: Couldn't find the kernel\n",
+ progname);
+ exit(1);
+ }
+#endif /* HAVE_KVM_OPEN */
+
+ if (dokmem)
+ {
+ file = kmem;
+
+ fd = openfile(file, O_RDONLY);
+#ifdef NLIST_EXTRA_INDIRECTION
+ /*
+ * Go one more round of indirection.
+ */
+ for (i = 0; i < (sizeof(nl) / sizeof(struct nlist)); i++)
+ {
+ if ((nl[i].n_value) && (nl[i].n_sclass == 0x6b))
+ {
+ readvar(fd, nl[i].n_value, &nl[i].n_value);
+ }
+ }
+#endif /* NLIST_EXTRA_INDIRECTION */
+ }
+#endif /* not NOKMEM */
+
+ *tickadj_off = 0;
+ *tick_off = 0;
+ *dosync_off = 0;
+ *noprintf_off = 0;
+
+#if defined(N_TICKADJ)
+ *tickadj_off = nl[N_TICKADJ].n_value;
+#endif
+
+#if defined(N_TICK)
+ *tick_off = nl[N_TICK].n_value;
+#endif
+
+#if defined(N_DOSYNC)
+ *dosync_off = nl[N_DOSYNC].n_value;
+#endif
+
+#if defined(N_NOPRINTF)
+ *noprintf_off = nl[N_NOPRINTF].n_value;
+#endif
+ return;
+}
+
+#undef N_TICKADJ
+#undef N_TICK
+#undef N_DOSYNC
+#undef N_NOPRINTF
+
+
+/*
+ * openfile - open the file, check for errors
+ */
+static int
+openfile(
+ const char *name,
+ int mode
+ )
+{
+ int ifd;
+
+ ifd = open(name, mode);
+ if (ifd < 0)
+ {
+ (void) fprintf(stderr, "%s: open %s: ", progname, name);
+ perror("");
+ exit(1);
+ }
+ return ifd;
+}
+
+
+/*
+ * writevar - write a variable into the file
+ */
+static void
+writevar(
+ int ofd,
+ off_t off,
+ int var
+ )
+{
+
+ if (lseek(ofd, off, L_SET) == -1)
+ {
+ (void) fprintf(stderr, "%s: lseek fails: ", progname);
+ perror("");
+ exit(1);
+ }
+ if (write(ofd, (char *)&var, sizeof(int)) != sizeof(int))
+ {
+ (void) fprintf(stderr, "%s: write fails: ", progname);
+ perror("");
+ exit(1);
+ }
+ return;
+}
+
+
+/*
+ * readvar - read a variable from the file
+ */
+static void
+readvar(
+ int ifd,
+ off_t off,
+ int *var
+ )
+{
+ int i;
+
+ if (lseek(ifd, off, L_SET) == -1)
+ {
+ (void) fprintf(stderr, "%s: lseek fails: ", progname);
+ perror("");
+ exit(1);
+ }
+ i = read(ifd, (char *)var, sizeof(int));
+ if (i < 0)
+ {
+ (void) fprintf(stderr, "%s: read fails: ", progname);
+ perror("");
+ exit(1);
+ }
+ if (i != sizeof(int))
+ {
+ (void) fprintf(stderr, "%s: read expected %d, got %d\n",
+ progname, (int)sizeof(int), i);
+ exit(1);
+ }
+ return;
+}
+#endif /* not Linux */
diff --git a/util/timetrim.c b/util/timetrim.c
new file mode 100644
index 0000000..911ea28
--- /dev/null
+++ b/util/timetrim.c
@@ -0,0 +1,116 @@
+#if defined(sgi) || defined(_UNICOSMP)
+/*
+ * timetrim.c
+ *
+ * "timetrim" allows setting and adjustment of the system clock frequency
+ * trim parameter on Silicon Graphics machines. The trim value native
+ * units are nanoseconds per second (10**-9), so a trim value of 1 makes
+ * the system clock step ahead 1 nanosecond more per second than a value
+ * of zero. Xntpd currently uses units of 2**-20 secs for its frequency
+ * offset (drift) values; to convert to a timetrim value, multiply by
+ * 1E9 / 2**20 (about 954).
+ *
+ * "timetrim" with no arguments just prints out the current kernel value.
+ * With a numeric argument, the kernel value is set to the supplied value.
+ * The "-i" flag causes the supplied value to be added to the kernel value.
+ * The "-n" option causes all input and output to be in xntpd units rather
+ * than timetrim native units.
+ *
+ * Note that there is a limit of +-3000000 (0.3%) on the timetrim value
+ * which is (silently?) enforced by the kernel.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#ifdef HAVE_SYS_SYSSGI_H
+# include <sys/syssgi.h>
+#endif
+#ifdef HAVE_SYS_SYSTUNE_H
+# include <sys/systune.h>
+#endif
+
+#define abs(X) (((X) < 0) ? -(X) : (X))
+#define USAGE "usage: timetrim [-n] [[-i] value]\n"
+#define SGITONTP(X) ((double)(X) * 1048576.0/1.0e9)
+#define NTPTOSGI(X) ((long)((X) * 1.0e9/1048576.0))
+
+int
+main(
+ int argc,
+ char *argv[]
+ )
+{
+ char *rem;
+ int incremental = 0, ntpunits = 0;
+ long timetrim;
+ double value;
+
+ while (--argc && **++argv == '-' && isalpha((int)argv[0][1])) {
+ switch (argv[0][1]) {
+ case 'i':
+ incremental++;
+ break;
+ case 'n':
+ ntpunits++;
+ break;
+ default:
+ fprintf(stderr, USAGE);
+ exit(1);
+ }
+ }
+
+#ifdef HAVE_SYS_SYSSGI_H
+ if (syssgi(SGI_GETTIMETRIM, &timetrim) < 0) {
+ perror("syssgi");
+ exit(2);
+ }
+#endif
+#ifdef HAVE_SYS_SYSTUNE_H
+ if (systune(SYSTUNE_GET, "timetrim", &timetrim) < 0) {
+ perror("systune");
+ exit(2);
+ }
+#endif
+
+ if (argc == 0) {
+ if (ntpunits)
+ fprintf(stdout, "%0.5f\n", SGITONTP(timetrim));
+ else
+ fprintf(stdout, "%ld\n", timetrim);
+ } else if (argc != 1) {
+ fprintf(stderr, USAGE);
+ exit(1);
+ } else {
+ value = strtod(argv[0], &rem);
+ if (*rem != '\0') {
+ fprintf(stderr, USAGE);
+ exit(1);
+ }
+ if (ntpunits)
+ value = NTPTOSGI(value);
+ if (incremental)
+ timetrim += value;
+ else
+ timetrim = value;
+#ifdef HAVE_SYS_SYSSGI_H
+ if (syssgi(SGI_SETTIMETRIM, timetrim) < 0) {
+ perror("syssgi");
+ exit(2);
+ }
+#endif
+#ifdef HAVE_SYS_SYSTUNE_H
+ if (systune(SYSTUNE_SET, "timer", "timetrim", &timetrim) < 0) {
+ perror("systune");
+ exit(2);
+ }
+#endif
+ }
+ return 0;
+}
+#endif